From bcc5c0f2687b6c601d3456badf2f0e8ecbbc8254 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Malo=20L=C3=A9on?= Date: Thu, 17 Aug 2023 19:59:09 +0200 Subject: [PATCH] chore: rename package --- .../.gitignore | 0 .../.pubignore | 0 .../AUTHORS | 0 .../CHANGELOG.md | 0 .../LICENSE | 0 .../README.md | 0 .../analysis_options.yaml | 0 .../example/.gitignore | 0 .../example/.metadata | 0 .../example/README.md | 0 .../example/analysis_options.yaml | 0 .../example/android/.gitignore | 0 .../example/android/app/build.gradle | 0 .../android/app/src/debug/AndroidManifest.xml | 0 .../android/app/src/main/AndroidManifest.xml | 0 .../notification_bloc_example/MainActivity.kt | 0 .../res/drawable-v21/launch_background.xml | 0 .../main/res/drawable/launch_background.xml | 0 .../src/main/res/mipmap-hdpi/ic_launcher.png | Bin .../src/main/res/mipmap-mdpi/ic_launcher.png | Bin .../src/main/res/mipmap-xhdpi/ic_launcher.png | Bin .../main/res/mipmap-xxhdpi/ic_launcher.png | Bin .../main/res/mipmap-xxxhdpi/ic_launcher.png | Bin .../app/src/main/res/values-night/styles.xml | 0 .../app/src/main/res/values/styles.xml | 0 .../app/src/profile/AndroidManifest.xml | 0 .../example/android/build.gradle | 0 .../example/android/gradle.properties | 0 .../gradle/wrapper/gradle-wrapper.properties | 0 .../example/android/settings.gradle | 0 .../example/ios/.gitignore | 0 .../ios/Flutter/AppFrameworkInfo.plist | 0 .../example/ios/Flutter/Debug.xcconfig | 0 .../example/ios/Flutter/Release.xcconfig | 0 .../example/ios/Podfile | 0 .../example/ios/Podfile.lock | 0 .../ios/Runner.xcodeproj/project.pbxproj | 0 .../contents.xcworkspacedata | 0 .../xcshareddata/IDEWorkspaceChecks.plist | 0 .../xcshareddata/xcschemes/Runner.xcscheme | 0 .../contents.xcworkspacedata | 0 .../xcshareddata/IDEWorkspaceChecks.plist | 0 .../example/ios/Runner/AppDelegate.swift | 0 .../AppIcon.appiconset/Contents.json | 0 .../Icon-App-1024x1024@1x.png | Bin .../AppIcon.appiconset/Icon-App-20x20@1x.png | Bin .../AppIcon.appiconset/Icon-App-20x20@2x.png | Bin .../AppIcon.appiconset/Icon-App-20x20@3x.png | Bin .../AppIcon.appiconset/Icon-App-29x29@1x.png | Bin .../AppIcon.appiconset/Icon-App-29x29@2x.png | Bin .../AppIcon.appiconset/Icon-App-29x29@3x.png | Bin .../AppIcon.appiconset/Icon-App-40x40@1x.png | Bin .../AppIcon.appiconset/Icon-App-40x40@2x.png | Bin .../AppIcon.appiconset/Icon-App-40x40@3x.png | Bin .../AppIcon.appiconset/Icon-App-60x60@2x.png | Bin .../AppIcon.appiconset/Icon-App-60x60@3x.png | Bin .../AppIcon.appiconset/Icon-App-76x76@1x.png | Bin .../AppIcon.appiconset/Icon-App-76x76@2x.png | Bin .../Icon-App-83.5x83.5@2x.png | Bin .../LaunchImage.imageset/Contents.json | 0 .../LaunchImage.imageset/LaunchImage.png | Bin .../LaunchImage.imageset/LaunchImage@2x.png | Bin .../LaunchImage.imageset/LaunchImage@3x.png | Bin .../LaunchImage.imageset/README.md | 0 .../Runner/Base.lproj/LaunchScreen.storyboard | 0 .../ios/Runner/Base.lproj/Main.storyboard | 0 .../example/ios/Runner/Info.plist | 0 .../ios/Runner/Runner-Bridging-Header.h | 0 .../example/ios/Runner/Runner.entitlements | 0 .../example/ios/firebase_app_id_file.json | 0 .../example/lib/firebase_options.dart | 0 .../example/lib/main.dart | 0 .../example/pubspec.yaml | 2 +- .../example/pushes/push.json | 0 .../example/scripts/package-lock.json | 0 .../example/scripts/package.json | 0 .../example/scripts/send-message.js | 0 ...le-firebase-adminsdk-aji7z-d74c5eb58d.json | 0 .../example/test/widget_test.dart | 0 .../lib/src/core/core.dart | 0 .../exceptions/notification_exeption.dart | 0 .../extensions/build_context_extension.dart | 2 +- .../lib/src/data/data.dart | 0 .../notification_repository_impl.dart | 8 +- .../notification_remote_data_source.dart | 2 +- .../lib/src/domain/domain.dart | 0 .../lib/src/domain/entities/entities.dart | 0 .../domain/entities/remote_notifications.dart | 0 .../repositories/notification_repository.dart | 2 +- .../src/domain/repositories/repositories.dart | 0 .../get_cloud_messaging_token_use_case.dart | 2 +- .../init_cloud_messaging_use_case.dart | 2 +- .../listen_notification_use_case.dart | 6 +- ...t_cloud_messaging_permission_use_case.dart | 2 +- .../lib/src/domain/usecases/subscribe.dart | 2 +- .../lib/src/domain/usecases/unsubscribe.dart | 2 +- .../lib/src/domain/usecases/usecases.dart | 0 .../bloc/cloud_messaging_cubit.dart | 8 +- .../bloc/cloud_messaging_state.dart | 0 .../lib/src/src.dart | 0 .../lib/wyatt_cloud_messaging_bloc.dart | 2 +- .../pubspec.yaml | 2 +- .../example/scripts/node_modules/.bin/acorn | 1 - .../scripts/node_modules/.bin/compileProtos | 1 - .../scripts/node_modules/.bin/escodegen | 1 - .../scripts/node_modules/.bin/esgenerate | 1 - .../example/scripts/node_modules/.bin/esparse | 1 - .../scripts/node_modules/.bin/esvalidate | 1 - .../scripts/node_modules/.bin/gp12-pem | 1 - .../example/scripts/node_modules/.bin/jsdoc | 1 - .../scripts/node_modules/.bin/markdown-it | 1 - .../example/scripts/node_modules/.bin/marked | 1 - .../example/scripts/node_modules/.bin/mime | 1 - .../scripts/node_modules/.bin/minifyProtoJson | 1 - .../example/scripts/node_modules/.bin/mkdirp | 1 - .../example/scripts/node_modules/.bin/parser | 1 - .../example/scripts/node_modules/.bin/pbjs | 1 - .../example/scripts/node_modules/.bin/pbts | 1 - .../node_modules/.bin/proto-loader-gen-types | 1 - .../example/scripts/node_modules/.bin/rimraf | 1 - .../example/scripts/node_modules/.bin/semver | 1 - .../scripts/node_modules/.bin/uglifyjs | 1 - .../example/scripts/node_modules/.bin/uuid | 1 - .../scripts/node_modules/.package-lock.json | 2130 -- .../node_modules/@babel/parser/CHANGELOG.md | 1073 - .../node_modules/@babel/parser/LICENSE | 19 - .../node_modules/@babel/parser/README.md | 19 - .../@babel/parser/bin/babel-parser.js | 15 - .../node_modules/@babel/parser/index.cjs | 5 - .../node_modules/@babel/parser/lib/index.js | 14761 ------------ .../node_modules/@babel/parser/package.json | 46 - .../@babel/parser/typings/babel-parser.d.ts | 227 - .../parser/typings/babel-parser.source.d.ts | 151 - .../node_modules/@fastify/busboy/LICENSE | 19 - .../node_modules/@fastify/busboy/README.md | 271 - .../@fastify/busboy/deps/dicer/LICENSE | 19 - .../@fastify/busboy/deps/dicer/lib/Dicer.js | 205 - .../busboy/deps/dicer/lib/HeaderParser.js | 98 - .../busboy/deps/dicer/lib/PartStream.js | 11 - .../@fastify/busboy/deps/dicer/lib/dicer.d.ts | 164 - .../@fastify/busboy/deps/streamsearch/sbmh.js | 226 - .../@fastify/busboy/lib/main.d.ts | 196 - .../node_modules/@fastify/busboy/lib/main.js | 83 - .../@fastify/busboy/lib/types/multipart.js | 301 - .../@fastify/busboy/lib/types/urlencoded.js | 188 - .../node_modules/@fastify/busboy/lib/utils.js | 198 - .../node_modules/@fastify/busboy/package.json | 92 - .../@firebase/app-types/CHANGELOG.md | 31 - .../@firebase/app-types/README.md | 3 - .../@firebase/app-types/index.d.ts | 129 - .../@firebase/app-types/package.json | 29 - .../@firebase/app-types/private.d.ts | 165 - .../@firebase/auth-interop-types/CHANGELOG.md | 13 - .../@firebase/auth-interop-types/README.md | 3 - .../@firebase/auth-interop-types/index.d.ts | 35 - .../@firebase/auth-interop-types/package.json | 29 - .../@firebase/component/CHANGELOG.md | 261 - .../@firebase/component/README.md | 12 - .../@firebase/component/dist/esm/index.d.ts | 20 - .../component/dist/esm/index.esm2017.js | 409 - .../component/dist/esm/index.esm5.js | 460 - .../@firebase/component/dist/esm/package.json | 1 - .../component/dist/esm/src/component.d.ts | 43 - .../dist/esm/src/component_container.d.ts | 47 - .../esm/src/component_container.test.d.ts | 24 - .../component/dist/esm/src/constants.d.ts | 17 - .../component/dist/esm/src/provider.d.ts | 79 - .../component/dist/esm/src/provider.test.d.ts | 23 - .../component/dist/esm/src/types.d.ts | 62 - .../component/dist/esm/test/setup.d.ts | 17 - .../component/dist/esm/test/util.d.ts | 5 - .../@firebase/component/dist/index.cjs.js | 466 - .../@firebase/component/dist/index.d.ts | 20 - .../component/dist/src/component.d.ts | 43 - .../dist/src/component_container.d.ts | 47 - .../dist/src/component_container.test.d.ts | 24 - .../component/dist/src/constants.d.ts | 17 - .../component/dist/src/provider.d.ts | 79 - .../component/dist/src/provider.test.d.ts | 23 - .../@firebase/component/dist/src/types.d.ts | 62 - .../@firebase/component/dist/test/setup.d.ts | 17 - .../@firebase/component/dist/test/util.d.ts | 5 - .../@firebase/component/package.json | 59 - .../@firebase/database-compat/CHANGELOG.md | 224 - .../@firebase/database-compat/README.md | 5 - .../database-compat/src/api/Database.d.ts | 74 - .../database-compat/src/api/Reference.d.ts | 201 - .../src/api/TransactionResult.d.ts | 26 - .../database-compat/src/api/internal.d.ts | 39 - .../database-compat/src/api/onDisconnect.d.ts | 27 - .../dist/database-compat/src/index.d.ts | 72 - .../dist/database-compat/src/index.node.d.ts | 30 - .../database-compat/src/index.standalone.d.ts | 52 - .../dist/database-compat/src/util/util.d.ts | 17 - .../database-compat/src/util/validation.d.ts | 18 - .../test/browser/crawler_support.test.d.ts | 17 - .../database-compat/test/database.test.d.ts | 17 - .../test/datasnapshot.test.d.ts | 17 - .../database-compat/test/helpers/events.d.ts | 34 - .../database-compat/test/helpers/util.d.ts | 42 - .../dist/database-compat/test/info.test.d.ts | 17 - .../dist/database-compat/test/order.test.d.ts | 17 - .../database-compat/test/order_by.test.d.ts | 17 - .../database-compat/test/promise.test.d.ts | 17 - .../dist/database-compat/test/query.test.d.ts | 17 - .../test/servervalues.test.d.ts | 17 - .../test/transaction.test.d.ts | 17 - .../database-compat/dist/index.esm2017.js | 872 - .../database-compat/dist/index.esm5.js | 925 - .../@firebase/database-compat/dist/index.js | 929 - .../database-compat/dist/index.standalone.js | 18776 ---------------- .../database-compat/src/api/Database.d.ts | 74 - .../database-compat/src/api/Reference.d.ts | 201 - .../src/api/TransactionResult.d.ts | 26 - .../database-compat/src/api/internal.d.ts | 39 - .../database-compat/src/api/onDisconnect.d.ts | 27 - .../node-esm/database-compat/src/index.d.ts | 32 - .../database-compat/src/index.node.d.ts | 30 - .../database-compat/src/index.standalone.d.ts | 52 - .../database-compat/src/util/util.d.ts | 17 - .../database-compat/src/util/validation.d.ts | 18 - .../test/browser/crawler_support.test.d.ts | 17 - .../database-compat/test/database.test.d.ts | 17 - .../test/datasnapshot.test.d.ts | 17 - .../database-compat/test/helpers/events.d.ts | 34 - .../database-compat/test/helpers/util.d.ts | 42 - .../database-compat/test/info.test.d.ts | 17 - .../database-compat/test/order.test.d.ts | 17 - .../database-compat/test/order_by.test.d.ts | 17 - .../database-compat/test/promise.test.d.ts | 17 - .../database-compat/test/query.test.d.ts | 17 - .../test/servervalues.test.d.ts | 17 - .../test/transaction.test.d.ts | 17 - .../database-compat/dist/node-esm/index.js | 870 - .../dist/node-esm/package.json | 1 - .../@firebase/database-compat/package.json | 66 - .../database-compat/standalone/package.json | 7 - .../@firebase/database-types/CHANGELOG.md | 194 - .../@firebase/database-types/README.md | 3 - .../@firebase/database-types/index.d.ts | 171 - .../@firebase/database-types/package.json | 29 - .../@firebase/database/CHANGELOG.md | 534 - .../node_modules/@firebase/database/README.md | 5 - .../@firebase/database/dist/index.esm2017.js | 14021 ------------ .../@firebase/database/dist/index.esm5.js | 14488 ------------ .../@firebase/database/dist/index.node.cjs.js | 14564 ------------ .../database/dist/index.standalone.js | 14504 ------------ .../@firebase/database/dist/internal.d.ts | 2972 --- .../database/dist/node-esm/index.node.esm.js | 14037 ------------ .../database/dist/node-esm/package.json | 1 - .../database/dist/node-esm/src/api.d.ts | 18 - .../dist/node-esm/src/api.standalone.d.ts | 29 - .../dist/node-esm/src/api/Database.d.ts | 138 - .../dist/node-esm/src/api/OnDisconnect.d.ts | 110 - .../dist/node-esm/src/api/Reference.d.ts | 122 - .../dist/node-esm/src/api/Reference_impl.d.ts | 1092 - .../dist/node-esm/src/api/ServerValue.d.ts | 30 - .../dist/node-esm/src/api/Transaction.d.ts | 83 - .../dist/node-esm/src/api/test_access.d.ts | 31 - .../src/core/AppCheckTokenProvider.d.ts | 30 - .../node-esm/src/core/AuthTokenProvider.d.ts | 49 - .../dist/node-esm/src/core/CompoundWrite.d.ts | 81 - .../src/core/PersistentConnection.d.ts | 135 - .../node-esm/src/core/ReadonlyRestClient.d.ts | 60 - .../database/dist/node-esm/src/core/Repo.d.ts | 144 - .../dist/node-esm/src/core/RepoInfo.d.ts | 55 - .../dist/node-esm/src/core/ServerActions.d.ts | 52 - .../node-esm/src/core/SnapshotHolder.d.ts | 26 - .../node-esm/src/core/SparseSnapshotTree.d.ts | 64 - .../dist/node-esm/src/core/SyncPoint.d.ts | 91 - .../dist/node-esm/src/core/SyncTree.d.ts | 166 - .../dist/node-esm/src/core/WriteTree.d.ts | 205 - .../src/core/operation/AckUserWrite.d.ts | 36 - .../src/core/operation/ListenComplete.d.ts | 26 - .../node-esm/src/core/operation/Merge.d.ts | 33 - .../src/core/operation/Operation.d.ts | 45 - .../src/core/operation/Overwrite.d.ts | 28 - .../node-esm/src/core/snap/ChildrenNode.d.ts | 112 - .../dist/node-esm/src/core/snap/IndexMap.d.ts | 43 - .../dist/node-esm/src/core/snap/LeafNode.d.ts | 83 - .../dist/node-esm/src/core/snap/Node.d.ts | 126 - .../dist/node-esm/src/core/snap/childSet.d.ts | 32 - .../node-esm/src/core/snap/comparators.d.ts | 19 - .../node-esm/src/core/snap/indexes/Index.d.ts | 50 - .../src/core/snap/indexes/KeyIndex.d.ts | 34 - .../src/core/snap/indexes/PathIndex.d.ts | 29 - .../src/core/snap/indexes/PriorityIndex.d.ts | 33 - .../src/core/snap/indexes/ValueIndex.d.ts | 31 - .../node-esm/src/core/snap/nodeFromJSON.d.ts | 24 - .../dist/node-esm/src/core/snap/snap.d.ts | 23 - .../src/core/stats/StatsCollection.d.ts | 26 - .../src/core/stats/StatsListener.d.ts | 30 - .../node-esm/src/core/stats/StatsManager.d.ts | 20 - .../src/core/stats/StatsReporter.d.ts | 28 - .../src/core/storage/DOMStorageWrapper.d.ts | 46 - .../src/core/storage/MemoryStorage.d.ts | 27 - .../node-esm/src/core/storage/storage.d.ts | 22 - .../node-esm/src/core/util/EventEmitter.d.ts | 39 - .../node-esm/src/core/util/ImmutableTree.d.ts | 117 - .../node-esm/src/core/util/NextPushId.d.ts | 33 - .../node-esm/src/core/util/OnlineMonitor.d.ts | 31 - .../dist/node-esm/src/core/util/Path.d.ts | 94 - .../node-esm/src/core/util/ServerValues.d.ts | 56 - .../node-esm/src/core/util/SortedMap.d.ts | 324 - .../dist/node-esm/src/core/util/Tree.d.ts | 105 - .../src/core/util/VisibilityMonitor.d.ts | 23 - .../node-esm/src/core/util/libs/parser.d.ts | 32 - .../dist/node-esm/src/core/util/misc.d.ts | 19 - .../dist/node-esm/src/core/util/util.d.ts | 176 - .../node-esm/src/core/util/validation.d.ts | 70 - .../dist/node-esm/src/core/version.d.ts | 23 - .../node-esm/src/core/view/CacheNode.d.ts | 41 - .../dist/node-esm/src/core/view/Change.d.ts | 46 - .../src/core/view/ChildChangeAccumulator.d.ts | 22 - .../src/core/view/CompleteChildSource.d.ts | 55 - .../dist/node-esm/src/core/view/Event.d.ts | 64 - .../src/core/view/EventGenerator.d.ts | 42 - .../node-esm/src/core/view/EventQueue.d.ts | 67 - .../src/core/view/EventRegistration.d.ts | 87 - .../node-esm/src/core/view/QueryParams.d.ts | 97 - .../dist/node-esm/src/core/view/View.d.ts | 59 - .../node-esm/src/core/view/ViewCache.d.ts | 32 - .../node-esm/src/core/view/ViewProcessor.d.ts | 32 - .../src/core/view/filter/IndexedFilter.d.ts | 35 - .../src/core/view/filter/LimitedFilter.d.ts | 41 - .../src/core/view/filter/NodeFilter.d.ts | 54 - .../src/core/view/filter/RangedFilter.d.ts | 45 - .../database/dist/node-esm/src/index.d.ts | 28 - .../dist/node-esm/src/index.node.d.ts | 17 - .../dist/node-esm/src/index.standalone.d.ts | 17 - .../src/realtime/BrowserPollConnection.d.ts | 198 - .../node-esm/src/realtime/Connection.d.ts | 102 - .../dist/node-esm/src/realtime/Constants.d.ts | 27 - .../dist/node-esm/src/realtime/Transport.d.ts | 58 - .../src/realtime/TransportManager.d.ts | 50 - .../src/realtime/WebSocketConnection.d.ts | 127 - .../src/realtime/polling/PacketReceiver.d.ts | 38 - .../database/dist/node-esm/src/register.d.ts | 1 - .../node-esm/test/compound_write.test.d.ts | 17 - .../dist/node-esm/test/connection.test.d.ts | 17 - .../dist/node-esm/test/deno.test.d.ts | 17 - .../node-esm/test/exp/integration.test.d.ts | 17 - .../test/helpers/EventAccumulator.d.ts | 35 - .../node-esm/test/helpers/syncpoint-util.d.ts | 29 - .../dist/node-esm/test/helpers/util.d.ts | 34 - .../dist/node-esm/test/node.test.d.ts | 17 - .../dist/node-esm/test/parser.test.d.ts | 17 - .../dist/node-esm/test/path.test.d.ts | 17 - .../dist/node-esm/test/pushid.test.d.ts | 17 - .../dist/node-esm/test/repoinfo.test.d.ts | 17 - .../dist/node-esm/test/sortedmap.test.d.ts | 17 - .../test/sparsesnapshottree.test.d.ts | 17 - .../dist/node-esm/test/syncpoint.test.d.ts | 17 - .../dist/node-esm/test/transport.test.d.ts | 17 - .../test/websocketconnection.test.d.ts | 17 - .../@firebase/database/dist/private.d.ts | 2849 --- .../@firebase/database/dist/public.d.ts | 1397 -- .../@firebase/database/dist/src/api.d.ts | 18 - .../database/dist/src/api.standalone.d.ts | 29 - .../database/dist/src/api/Database.d.ts | 138 - .../database/dist/src/api/OnDisconnect.d.ts | 110 - .../database/dist/src/api/Reference.d.ts | 122 - .../database/dist/src/api/Reference_impl.d.ts | 1092 - .../database/dist/src/api/ServerValue.d.ts | 30 - .../database/dist/src/api/Transaction.d.ts | 83 - .../database/dist/src/api/test_access.d.ts | 31 - .../dist/src/core/AppCheckTokenProvider.d.ts | 30 - .../dist/src/core/AuthTokenProvider.d.ts | 49 - .../database/dist/src/core/CompoundWrite.d.ts | 81 - .../dist/src/core/PersistentConnection.d.ts | 135 - .../dist/src/core/ReadonlyRestClient.d.ts | 60 - .../database/dist/src/core/Repo.d.ts | 144 - .../database/dist/src/core/RepoInfo.d.ts | 55 - .../database/dist/src/core/ServerActions.d.ts | 52 - .../dist/src/core/SnapshotHolder.d.ts | 26 - .../dist/src/core/SparseSnapshotTree.d.ts | 64 - .../database/dist/src/core/SyncPoint.d.ts | 91 - .../database/dist/src/core/SyncTree.d.ts | 166 - .../database/dist/src/core/WriteTree.d.ts | 205 - .../dist/src/core/operation/AckUserWrite.d.ts | 36 - .../src/core/operation/ListenComplete.d.ts | 26 - .../dist/src/core/operation/Merge.d.ts | 33 - .../dist/src/core/operation/Operation.d.ts | 45 - .../dist/src/core/operation/Overwrite.d.ts | 28 - .../dist/src/core/snap/ChildrenNode.d.ts | 112 - .../database/dist/src/core/snap/IndexMap.d.ts | 43 - .../database/dist/src/core/snap/LeafNode.d.ts | 83 - .../database/dist/src/core/snap/Node.d.ts | 126 - .../database/dist/src/core/snap/childSet.d.ts | 32 - .../dist/src/core/snap/comparators.d.ts | 19 - .../dist/src/core/snap/indexes/Index.d.ts | 50 - .../dist/src/core/snap/indexes/KeyIndex.d.ts | 34 - .../dist/src/core/snap/indexes/PathIndex.d.ts | 29 - .../src/core/snap/indexes/PriorityIndex.d.ts | 33 - .../src/core/snap/indexes/ValueIndex.d.ts | 31 - .../dist/src/core/snap/nodeFromJSON.d.ts | 24 - .../database/dist/src/core/snap/snap.d.ts | 23 - .../dist/src/core/stats/StatsCollection.d.ts | 26 - .../dist/src/core/stats/StatsListener.d.ts | 30 - .../dist/src/core/stats/StatsManager.d.ts | 20 - .../dist/src/core/stats/StatsReporter.d.ts | 28 - .../src/core/storage/DOMStorageWrapper.d.ts | 46 - .../dist/src/core/storage/MemoryStorage.d.ts | 27 - .../dist/src/core/storage/storage.d.ts | 22 - .../dist/src/core/util/EventEmitter.d.ts | 39 - .../dist/src/core/util/ImmutableTree.d.ts | 117 - .../dist/src/core/util/NextPushId.d.ts | 33 - .../dist/src/core/util/OnlineMonitor.d.ts | 31 - .../database/dist/src/core/util/Path.d.ts | 94 - .../dist/src/core/util/ServerValues.d.ts | 56 - .../dist/src/core/util/SortedMap.d.ts | 324 - .../database/dist/src/core/util/Tree.d.ts | 105 - .../dist/src/core/util/VisibilityMonitor.d.ts | 23 - .../dist/src/core/util/libs/parser.d.ts | 32 - .../database/dist/src/core/util/misc.d.ts | 19 - .../database/dist/src/core/util/util.d.ts | 176 - .../dist/src/core/util/validation.d.ts | 70 - .../database/dist/src/core/version.d.ts | 23 - .../dist/src/core/view/CacheNode.d.ts | 41 - .../database/dist/src/core/view/Change.d.ts | 46 - .../src/core/view/ChildChangeAccumulator.d.ts | 22 - .../src/core/view/CompleteChildSource.d.ts | 55 - .../database/dist/src/core/view/Event.d.ts | 64 - .../dist/src/core/view/EventGenerator.d.ts | 42 - .../dist/src/core/view/EventQueue.d.ts | 67 - .../dist/src/core/view/EventRegistration.d.ts | 87 - .../dist/src/core/view/QueryParams.d.ts | 97 - .../database/dist/src/core/view/View.d.ts | 59 - .../dist/src/core/view/ViewCache.d.ts | 32 - .../dist/src/core/view/ViewProcessor.d.ts | 32 - .../src/core/view/filter/IndexedFilter.d.ts | 35 - .../src/core/view/filter/LimitedFilter.d.ts | 41 - .../dist/src/core/view/filter/NodeFilter.d.ts | 54 - .../src/core/view/filter/RangedFilter.d.ts | 45 - .../@firebase/database/dist/src/index.d.ts | 28 - .../database/dist/src/index.node.d.ts | 17 - .../database/dist/src/index.standalone.d.ts | 17 - .../src/realtime/BrowserPollConnection.d.ts | 198 - .../dist/src/realtime/Connection.d.ts | 102 - .../database/dist/src/realtime/Constants.d.ts | 27 - .../database/dist/src/realtime/Transport.d.ts | 58 - .../dist/src/realtime/TransportManager.d.ts | 50 - .../src/realtime/WebSocketConnection.d.ts | 127 - .../src/realtime/polling/PacketReceiver.d.ts | 38 - .../@firebase/database/dist/src/register.d.ts | 1 - .../database/dist/src/tsdoc-metadata.json | 11 - .../dist/test/compound_write.test.d.ts | 17 - .../database/dist/test/connection.test.d.ts | 17 - .../database/dist/test/deno.test.d.ts | 17 - .../dist/test/exp/integration.test.d.ts | 17 - .../dist/test/helpers/EventAccumulator.d.ts | 35 - .../dist/test/helpers/syncpoint-util.d.ts | 29 - .../database/dist/test/helpers/util.d.ts | 34 - .../database/dist/test/node.test.d.ts | 17 - .../database/dist/test/parser.test.d.ts | 17 - .../database/dist/test/path.test.d.ts | 17 - .../database/dist/test/pushid.test.d.ts | 17 - .../database/dist/test/repoinfo.test.d.ts | 17 - .../database/dist/test/sortedmap.test.d.ts | 17 - .../dist/test/sparsesnapshottree.test.d.ts | 17 - .../database/dist/test/syncpoint.test.d.ts | 17 - .../database/dist/test/transport.test.d.ts | 17 - .../dist/test/websocketconnection.test.d.ts | 17 - .../@firebase/database/package.json | 76 - .../@firebase/logger/CHANGELOG.md | 37 - .../node_modules/@firebase/logger/README.md | 40 - .../@firebase/logger/dist/esm/index.d.ts | 17 - .../logger/dist/esm/index.esm2017.js | 219 - .../@firebase/logger/dist/esm/index.esm5.js | 266 - .../@firebase/logger/dist/esm/package.json | 1 - .../@firebase/logger/dist/esm/src/logger.d.ts | 96 - .../dist/esm/test/custom-logger.test.d.ts | 17 - .../logger/dist/esm/test/logger.test.d.ts | 17 - .../@firebase/logger/dist/index.cjs.js | 272 - .../@firebase/logger/dist/index.d.ts | 17 - .../@firebase/logger/dist/src/logger.d.ts | 96 - .../logger/dist/test/custom-logger.test.d.ts | 17 - .../logger/dist/test/logger.test.d.ts | 17 - .../@firebase/logger/package.json | 58 - .../node_modules/@firebase/util/CHANGELOG.md | 182 - .../node_modules/@firebase/util/README.md | 25 - .../@firebase/util/dist/index.d.ts | 38 - .../@firebase/util/dist/index.esm2017.js | 2068 -- .../@firebase/util/dist/index.esm5.js | 2063 -- .../@firebase/util/dist/index.node.cjs.js | 2149 -- .../@firebase/util/dist/index.node.d.ts | 38 - .../@firebase/util/dist/node-esm/index.d.ts | 38 - .../util/dist/node-esm/index.node.d.ts | 38 - .../util/dist/node-esm/index.node.esm.js | 2087 -- .../@firebase/util/dist/node-esm/package.json | 1 - .../util/dist/node-esm/src/assert.d.ts | 24 - .../util/dist/node-esm/src/compat.d.ts | 20 - .../util/dist/node-esm/src/constants.d.ts | 33 - .../util/dist/node-esm/src/crypt.d.ts | 60 - .../util/dist/node-esm/src/deepCopy.d.ts | 35 - .../util/dist/node-esm/src/defaults.d.ts | 66 - .../util/dist/node-esm/src/deferred.d.ts | 28 - .../util/dist/node-esm/src/emulator.d.ts | 47 - .../util/dist/node-esm/src/environment.d.ts | 84 - .../util/dist/node-esm/src/errors.d.ts | 87 - .../node-esm/src/exponential_backoff.d.ts | 37 - .../util/dist/node-esm/src/formatters.d.ts | 20 - .../util/dist/node-esm/src/json.d.ts | 29 - .../@firebase/util/dist/node-esm/src/jwt.d.ts | 73 - .../@firebase/util/dist/node-esm/src/obj.d.ts | 30 - .../util/dist/node-esm/src/promise.d.ts | 21 - .../util/dist/node-esm/src/query.d.ts | 33 - .../util/dist/node-esm/src/sha1.d.ts | 84 - .../util/dist/node-esm/src/subscribe.d.ts | 49 - .../util/dist/node-esm/src/utf8.d.ts | 27 - .../util/dist/node-esm/src/uuid.d.ts | 22 - .../util/dist/node-esm/src/validation.d.ts | 43 - .../util/dist/node-esm/test/base64.test.d.ts | 1 - .../util/dist/node-esm/test/compat.test.d.ts | 17 - .../dist/node-esm/test/deepCopy.test.d.ts | 1 - .../dist/node-esm/test/defaults.test.d.ts | 1 - .../dist/node-esm/test/emulator.test.d.ts | 1 - .../util/dist/node-esm/test/errors.test.d.ts | 1 - .../test/exponential_backoff.test.d.ts | 17 - .../util/dist/node-esm/test/object.test.d.ts | 17 - .../dist/node-esm/test/subscribe.test.d.ts | 17 - .../@firebase/util/dist/src/assert.d.ts | 24 - .../@firebase/util/dist/src/compat.d.ts | 20 - .../@firebase/util/dist/src/constants.d.ts | 33 - .../@firebase/util/dist/src/crypt.d.ts | 60 - .../@firebase/util/dist/src/deepCopy.d.ts | 35 - .../@firebase/util/dist/src/defaults.d.ts | 66 - .../@firebase/util/dist/src/deferred.d.ts | 28 - .../@firebase/util/dist/src/emulator.d.ts | 47 - .../@firebase/util/dist/src/environment.d.ts | 84 - .../@firebase/util/dist/src/errors.d.ts | 87 - .../util/dist/src/exponential_backoff.d.ts | 37 - .../@firebase/util/dist/src/formatters.d.ts | 20 - .../@firebase/util/dist/src/json.d.ts | 29 - .../@firebase/util/dist/src/jwt.d.ts | 73 - .../@firebase/util/dist/src/obj.d.ts | 30 - .../@firebase/util/dist/src/promise.d.ts | 21 - .../@firebase/util/dist/src/query.d.ts | 33 - .../@firebase/util/dist/src/sha1.d.ts | 84 - .../@firebase/util/dist/src/subscribe.d.ts | 49 - .../@firebase/util/dist/src/utf8.d.ts | 27 - .../@firebase/util/dist/src/uuid.d.ts | 22 - .../@firebase/util/dist/src/validation.d.ts | 43 - .../@firebase/util/dist/test/base64.test.d.ts | 1 - .../@firebase/util/dist/test/compat.test.d.ts | 17 - .../util/dist/test/deepCopy.test.d.ts | 1 - .../util/dist/test/defaults.test.d.ts | 1 - .../util/dist/test/emulator.test.d.ts | 1 - .../@firebase/util/dist/test/errors.test.d.ts | 1 - .../dist/test/exponential_backoff.test.d.ts | 17 - .../@firebase/util/dist/test/object.test.d.ts | 17 - .../util/dist/test/subscribe.test.d.ts | 17 - .../@firebase/util/dist/tsdoc-metadata.json | 11 - .../@firebase/util/dist/util-public.d.ts | 918 - .../@firebase/util/dist/util.d.ts | 938 - .../node_modules/@firebase/util/package.json | 64 - .../@google-cloud/firestore/CHANGELOG.md | 1102 - .../@google-cloud/firestore/LICENSE | 202 - .../@google-cloud/firestore/README.md | 181 - .../@google-cloud/firestore/package.json | 90 - .../firestore/types/firestore.d.ts | 2431 -- .../protos/firestore_admin_v1_proto_api.d.ts | 5152 ----- .../types/protos/firestore_v1_proto_api.d.ts | 7132 ------ .../protos/firestore_v1beta1_proto_api.d.ts | 6826 ------ .../types/v1/firestore_admin_client.d.ts | 1255 -- .../firestore/types/v1/firestore_client.d.ts | 1203 - .../types/v1beta1/firestore_client.d.ts | 1216 - .../@google-cloud/paginator/CHANGELOG.md | 219 - .../@google-cloud/paginator/LICENSE | 202 - .../@google-cloud/paginator/README.md | 136 - .../@google-cloud/paginator/package.json | 57 - .../@google-cloud/projectify/CHANGELOG.md | 180 - .../@google-cloud/projectify/LICENSE | 202 - .../@google-cloud/projectify/README.md | 138 - .../@google-cloud/projectify/package.json | 46 - .../@google-cloud/promisify/CHANGELOG.md | 180 - .../@google-cloud/promisify/LICENSE | 202 - .../@google-cloud/promisify/README.md | 156 - .../@google-cloud/promisify/package.json | 50 - .../@google-cloud/storage/CHANGELOG.md | 1418 -- .../@google-cloud/storage/LICENSE | 202 - .../@google-cloud/storage/README.md | 282 - .../storage/node_modules/.bin/uuid | 1 - .../storage/node_modules/uuid/CHANGELOG.md | 229 - .../storage/node_modules/uuid/CONTRIBUTING.md | 18 - .../storage/node_modules/uuid/LICENSE.md | 9 - .../storage/node_modules/uuid/README.md | 505 - .../storage/node_modules/uuid/dist/bin/uuid | 2 - .../uuid/dist/esm-browser/index.js | 9 - .../node_modules/uuid/dist/esm-browser/md5.js | 215 - .../node_modules/uuid/dist/esm-browser/nil.js | 1 - .../uuid/dist/esm-browser/parse.js | 35 - .../uuid/dist/esm-browser/regex.js | 1 - .../node_modules/uuid/dist/esm-browser/rng.js | 19 - .../uuid/dist/esm-browser/sha1.js | 96 - .../uuid/dist/esm-browser/stringify.js | 30 - .../node_modules/uuid/dist/esm-browser/v1.js | 95 - .../node_modules/uuid/dist/esm-browser/v3.js | 4 - .../node_modules/uuid/dist/esm-browser/v35.js | 64 - .../node_modules/uuid/dist/esm-browser/v4.js | 24 - .../node_modules/uuid/dist/esm-browser/v5.js | 4 - .../uuid/dist/esm-browser/validate.js | 7 - .../uuid/dist/esm-browser/version.js | 11 - .../node_modules/uuid/dist/esm-node/index.js | 9 - .../node_modules/uuid/dist/esm-node/md5.js | 13 - .../node_modules/uuid/dist/esm-node/nil.js | 1 - .../node_modules/uuid/dist/esm-node/parse.js | 35 - .../node_modules/uuid/dist/esm-node/regex.js | 1 - .../node_modules/uuid/dist/esm-node/rng.js | 12 - .../node_modules/uuid/dist/esm-node/sha1.js | 13 - .../uuid/dist/esm-node/stringify.js | 29 - .../node_modules/uuid/dist/esm-node/v1.js | 95 - .../node_modules/uuid/dist/esm-node/v3.js | 4 - .../node_modules/uuid/dist/esm-node/v35.js | 64 - .../node_modules/uuid/dist/esm-node/v4.js | 24 - .../node_modules/uuid/dist/esm-node/v5.js | 4 - .../uuid/dist/esm-node/validate.js | 7 - .../uuid/dist/esm-node/version.js | 11 - .../storage/node_modules/uuid/dist/index.js | 79 - .../node_modules/uuid/dist/md5-browser.js | 223 - .../storage/node_modules/uuid/dist/md5.js | 23 - .../storage/node_modules/uuid/dist/nil.js | 8 - .../storage/node_modules/uuid/dist/parse.js | 45 - .../storage/node_modules/uuid/dist/regex.js | 8 - .../node_modules/uuid/dist/rng-browser.js | 26 - .../storage/node_modules/uuid/dist/rng.js | 24 - .../node_modules/uuid/dist/sha1-browser.js | 104 - .../storage/node_modules/uuid/dist/sha1.js | 23 - .../node_modules/uuid/dist/stringify.js | 39 - .../node_modules/uuid/dist/umd/uuid.min.js | 1 - .../node_modules/uuid/dist/umd/uuidNIL.min.js | 1 - .../uuid/dist/umd/uuidParse.min.js | 1 - .../uuid/dist/umd/uuidStringify.min.js | 1 - .../uuid/dist/umd/uuidValidate.min.js | 1 - .../uuid/dist/umd/uuidVersion.min.js | 1 - .../node_modules/uuid/dist/umd/uuidv1.min.js | 1 - .../node_modules/uuid/dist/umd/uuidv3.min.js | 1 - .../node_modules/uuid/dist/umd/uuidv4.min.js | 1 - .../node_modules/uuid/dist/umd/uuidv5.min.js | 1 - .../node_modules/uuid/dist/uuid-bin.js | 85 - .../storage/node_modules/uuid/dist/v1.js | 107 - .../storage/node_modules/uuid/dist/v3.js | 16 - .../storage/node_modules/uuid/dist/v35.js | 78 - .../storage/node_modules/uuid/dist/v4.js | 37 - .../storage/node_modules/uuid/dist/v5.js | 16 - .../node_modules/uuid/dist/validate.js | 17 - .../storage/node_modules/uuid/dist/version.js | 21 - .../storage/node_modules/uuid/package.json | 135 - .../storage/node_modules/uuid/wrapper.mjs | 10 - .../@google-cloud/storage/package.json | 108 - .../node_modules/@grpc/grpc-js/LICENSE | 201 - .../node_modules/@grpc/grpc-js/README.md | 73 - .../node_modules/@grpc/grpc-js/package.json | 78 - .../@grpc/grpc-js/proto/channelz.proto | 564 - .../node_modules/@grpc/grpc-js/src/admin.ts | 39 - .../@grpc/grpc-js/src/backoff-timeout.ts | 181 - .../grpc-js/src/call-credentials-filter.ts | 86 - .../@grpc/grpc-js/src/call-credentials.ts | 222 - .../@grpc/grpc-js/src/call-stream.ts | 899 - .../node_modules/@grpc/grpc-js/src/call.ts | 195 - .../@grpc/grpc-js/src/channel-credentials.ts | 273 - .../@grpc/grpc-js/src/channel-options.ts | 95 - .../node_modules/@grpc/grpc-js/src/channel.ts | 820 - .../@grpc/grpc-js/src/channelz.ts | 758 - .../@grpc/grpc-js/src/client-interceptors.ts | 581 - .../node_modules/@grpc/grpc-js/src/client.ts | 710 - .../grpc-js/src/compression-algorithms.ts | 22 - .../@grpc/grpc-js/src/compression-filter.ts | 289 - .../@grpc/grpc-js/src/connectivity-state.ts | 24 - .../@grpc/grpc-js/src/constants.ts | 66 - .../@grpc/grpc-js/src/deadline-filter.ts | 120 - .../@grpc/grpc-js/src/duration.ts | 36 - .../node_modules/@grpc/grpc-js/src/events.ts | 26 - .../@grpc/grpc-js/src/experimental.ts | 39 - .../@grpc/grpc-js/src/filter-stack.ts | 102 - .../node_modules/@grpc/grpc-js/src/filter.ts | 65 - .../@grpc/grpc-js/src/generated/channelz.ts | 73 - .../src/generated/google/protobuf/Any.ts | 13 - .../generated/google/protobuf/BoolValue.ts | 10 - .../generated/google/protobuf/BytesValue.ts | 10 - .../generated/google/protobuf/DoubleValue.ts | 10 - .../src/generated/google/protobuf/Duration.ts | 13 - .../generated/google/protobuf/FloatValue.ts | 10 - .../generated/google/protobuf/Int32Value.ts | 10 - .../generated/google/protobuf/Int64Value.ts | 11 - .../generated/google/protobuf/StringValue.ts | 10 - .../generated/google/protobuf/Timestamp.ts | 13 - .../generated/google/protobuf/UInt32Value.ts | 10 - .../generated/google/protobuf/UInt64Value.ts | 11 - .../src/generated/grpc/channelz/v1/Address.ts | 89 - .../src/generated/grpc/channelz/v1/Channel.ts | 68 - .../channelz/v1/ChannelConnectivityState.ts | 29 - .../generated/grpc/channelz/v1/ChannelData.ts | 76 - .../generated/grpc/channelz/v1/ChannelRef.ts | 31 - .../grpc/channelz/v1/ChannelTrace.ts | 45 - .../grpc/channelz/v1/ChannelTraceEvent.ts | 73 - .../generated/grpc/channelz/v1/Channelz.ts | 178 - .../grpc/channelz/v1/GetChannelRequest.ts | 17 - .../grpc/channelz/v1/GetChannelResponse.ts | 19 - .../grpc/channelz/v1/GetServerRequest.ts | 17 - .../grpc/channelz/v1/GetServerResponse.ts | 19 - .../channelz/v1/GetServerSocketsRequest.ts | 39 - .../channelz/v1/GetServerSocketsResponse.ts | 33 - .../grpc/channelz/v1/GetServersRequest.ts | 37 - .../grpc/channelz/v1/GetServersResponse.ts | 33 - .../grpc/channelz/v1/GetSocketRequest.ts | 29 - .../grpc/channelz/v1/GetSocketResponse.ts | 19 - .../grpc/channelz/v1/GetSubchannelRequest.ts | 17 - .../grpc/channelz/v1/GetSubchannelResponse.ts | 19 - .../grpc/channelz/v1/GetTopChannelsRequest.ts | 37 - .../channelz/v1/GetTopChannelsResponse.ts | 33 - .../generated/grpc/channelz/v1/Security.ts | 87 - .../src/generated/grpc/channelz/v1/Server.ts | 45 - .../generated/grpc/channelz/v1/ServerData.ts | 57 - .../generated/grpc/channelz/v1/ServerRef.ts | 31 - .../src/generated/grpc/channelz/v1/Socket.ts | 70 - .../generated/grpc/channelz/v1/SocketData.ts | 150 - .../grpc/channelz/v1/SocketOption.ts | 47 - .../grpc/channelz/v1/SocketOptionLinger.ts | 33 - .../grpc/channelz/v1/SocketOptionTcpInfo.ts | 74 - .../grpc/channelz/v1/SocketOptionTimeout.ts | 19 - .../generated/grpc/channelz/v1/SocketRef.ts | 31 - .../generated/grpc/channelz/v1/Subchannel.ts | 70 - .../grpc/channelz/v1/SubchannelRef.ts | 31 - .../@grpc/grpc-js/src/http_proxy.ts | 301 - .../node_modules/@grpc/grpc-js/src/index.ts | 290 - .../src/load-balancer-child-handler.ts | 155 - .../src/load-balancer-outlier-detection.ts | 673 - .../grpc-js/src/load-balancer-pick-first.ts | 480 - .../grpc-js/src/load-balancer-round-robin.ts | 257 - .../@grpc/grpc-js/src/load-balancer.ts | 219 - .../node_modules/@grpc/grpc-js/src/logging.ts | 119 - .../@grpc/grpc-js/src/make-client.ts | 238 - .../grpc-js/src/max-message-size-filter.ts | 89 - .../@grpc/grpc-js/src/metadata.ts | 299 - .../@grpc/grpc-js/src/object-stream.ts | 52 - .../node_modules/@grpc/grpc-js/src/picker.ts | 156 - .../@grpc/grpc-js/src/resolver-dns.ts | 373 - .../@grpc/grpc-js/src/resolver-ip.ts | 116 - .../@grpc/grpc-js/src/resolver-uds.ts | 59 - .../@grpc/grpc-js/src/resolver.ts | 177 - .../grpc-js/src/resolving-load-balancer.ts | 332 - .../@grpc/grpc-js/src/server-call.ts | 970 - .../@grpc/grpc-js/src/server-credentials.ts | 108 - .../node_modules/@grpc/grpc-js/src/server.ts | 1091 - .../@grpc/grpc-js/src/service-config.ts | 334 - .../@grpc/grpc-js/src/status-builder.ts | 80 - .../@grpc/grpc-js/src/stream-decoder.ts | 105 - .../@grpc/grpc-js/src/subchannel-address.ts | 79 - .../@grpc/grpc-js/src/subchannel-interface.ts | 82 - .../@grpc/grpc-js/src/subchannel-pool.ts | 174 - .../@grpc/grpc-js/src/subchannel.ts | 1012 - .../@grpc/grpc-js/src/tls-helpers.ts | 35 - .../@grpc/grpc-js/src/uri-parser.ts | 114 - .../node_modules/@grpc/proto-loader/LICENSE | 201 - .../node_modules/@grpc/proto-loader/README.md | 124 - .../@grpc/proto-loader/package.json | 68 - .../node_modules/@panva/asn1.js/CHANGELOG.md | 10 - .../node_modules/@panva/asn1.js/LICENSE | 22 - .../node_modules/@panva/asn1.js/README.md | 83 - .../node_modules/@panva/asn1.js/lib/asn1.js | 13 - .../@panva/asn1.js/lib/asn1/api.js | 51 - .../@panva/asn1.js/lib/asn1/base/buffer.js | 140 - .../@panva/asn1.js/lib/asn1/base/index.js | 10 - .../@panva/asn1.js/lib/asn1/base/node.js | 555 - .../@panva/asn1.js/lib/asn1/base/reporter.js | 117 - .../@panva/asn1.js/lib/asn1/constants/der.js | 55 - .../asn1.js/lib/asn1/constants/index.js | 3 - .../@panva/asn1.js/lib/asn1/decoders/der.js | 296 - .../@panva/asn1.js/lib/asn1/decoders/index.js | 4 - .../@panva/asn1.js/lib/asn1/decoders/pem.js | 44 - .../@panva/asn1.js/lib/asn1/encoders/der.js | 269 - .../@panva/asn1.js/lib/asn1/encoders/index.js | 4 - .../@panva/asn1.js/lib/asn1/encoders/pem.js | 21 - .../node_modules/@panva/asn1.js/package.json | 34 - .../@protobufjs/aspromise/LICENSE | 26 - .../@protobufjs/aspromise/README.md | 13 - .../@protobufjs/aspromise/index.d.ts | 13 - .../@protobufjs/aspromise/index.js | 52 - .../@protobufjs/aspromise/package.json | 21 - .../@protobufjs/aspromise/tests/index.js | 130 - .../node_modules/@protobufjs/base64/LICENSE | 26 - .../node_modules/@protobufjs/base64/README.md | 19 - .../@protobufjs/base64/index.d.ts | 32 - .../node_modules/@protobufjs/base64/index.js | 139 - .../@protobufjs/base64/package.json | 21 - .../@protobufjs/base64/tests/index.js | 46 - .../node_modules/@protobufjs/codegen/LICENSE | 26 - .../@protobufjs/codegen/README.md | 49 - .../@protobufjs/codegen/index.d.ts | 31 - .../node_modules/@protobufjs/codegen/index.js | 99 - .../@protobufjs/codegen/package.json | 13 - .../@protobufjs/codegen/tests/index.js | 13 - .../@protobufjs/eventemitter/LICENSE | 26 - .../@protobufjs/eventemitter/README.md | 22 - .../@protobufjs/eventemitter/index.d.ts | 43 - .../@protobufjs/eventemitter/index.js | 76 - .../@protobufjs/eventemitter/package.json | 21 - .../@protobufjs/eventemitter/tests/index.js | 47 - .../node_modules/@protobufjs/fetch/LICENSE | 26 - .../node_modules/@protobufjs/fetch/README.md | 13 - .../node_modules/@protobufjs/fetch/index.d.ts | 56 - .../node_modules/@protobufjs/fetch/index.js | 115 - .../@protobufjs/fetch/package.json | 25 - .../@protobufjs/fetch/tests/index.js | 16 - .../node_modules/@protobufjs/float/LICENSE | 26 - .../node_modules/@protobufjs/float/README.md | 102 - .../@protobufjs/float/bench/index.js | 87 - .../@protobufjs/float/bench/suite.js | 46 - .../node_modules/@protobufjs/float/index.d.ts | 83 - .../node_modules/@protobufjs/float/index.js | 335 - .../@protobufjs/float/package.json | 26 - .../@protobufjs/float/tests/index.js | 100 - .../@protobufjs/inquire/.npmignore | 3 - .../node_modules/@protobufjs/inquire/LICENSE | 26 - .../@protobufjs/inquire/README.md | 13 - .../@protobufjs/inquire/index.d.ts | 9 - .../node_modules/@protobufjs/inquire/index.js | 17 - .../@protobufjs/inquire/package.json | 21 - .../@protobufjs/inquire/tests/data/array.js | 1 - .../inquire/tests/data/emptyArray.js | 1 - .../inquire/tests/data/emptyObject.js | 1 - .../@protobufjs/inquire/tests/data/object.js | 1 - .../@protobufjs/inquire/tests/index.js | 20 - .../node_modules/@protobufjs/path/LICENSE | 26 - .../node_modules/@protobufjs/path/README.md | 19 - .../node_modules/@protobufjs/path/index.d.ts | 22 - .../node_modules/@protobufjs/path/index.js | 65 - .../@protobufjs/path/package.json | 21 - .../@protobufjs/path/tests/index.js | 60 - .../node_modules/@protobufjs/pool/.npmignore | 3 - .../node_modules/@protobufjs/pool/LICENSE | 26 - .../node_modules/@protobufjs/pool/README.md | 13 - .../node_modules/@protobufjs/pool/index.d.ts | 32 - .../node_modules/@protobufjs/pool/index.js | 48 - .../@protobufjs/pool/package.json | 21 - .../@protobufjs/pool/tests/index.js | 33 - .../node_modules/@protobufjs/utf8/.npmignore | 3 - .../node_modules/@protobufjs/utf8/LICENSE | 26 - .../node_modules/@protobufjs/utf8/README.md | 20 - .../node_modules/@protobufjs/utf8/index.d.ts | 24 - .../node_modules/@protobufjs/utf8/index.js | 105 - .../@protobufjs/utf8/package.json | 21 - .../@protobufjs/utf8/tests/data/utf8.txt | 216 - .../@protobufjs/utf8/tests/index.js | 57 - .../node_modules/@tootallnate/once/LICENSE | 21 - .../node_modules/@tootallnate/once/README.md | 93 - .../@tootallnate/once/dist/index.d.ts | 7 - .../@tootallnate/once/dist/index.js | 24 - .../once/dist/overloaded-parameters.d.ts | 231 - .../once/dist/overloaded-parameters.js | 3 - .../@tootallnate/once/dist/types.d.ts | 17 - .../@tootallnate/once/dist/types.js | 3 - .../@tootallnate/once/package.json | 52 - .../node_modules/@types/body-parser/LICENSE | 21 - .../node_modules/@types/body-parser/README.md | 16 - .../@types/body-parser/index.d.ts | 107 - .../@types/body-parser/package.json | 58 - .../node_modules/@types/connect/LICENSE | 21 - .../node_modules/@types/connect/README.md | 16 - .../node_modules/@types/connect/index.d.ts | 93 - .../node_modules/@types/connect/package.json | 32 - .../@types/express-serve-static-core/LICENSE | 21 - .../express-serve-static-core/README.md | 16 - .../express-serve-static-core/index.d.ts | 1254 -- .../express-serve-static-core/package.json | 54 - .../node_modules/@types/express/LICENSE | 21 - .../node_modules/@types/express/README.md | 16 - .../node_modules/@types/express/index.d.ts | 133 - .../node_modules/@types/express/package.json | 45 - .../node_modules/@types/jsonwebtoken/LICENSE | 21 - .../@types/jsonwebtoken/README.md | 16 - .../@types/jsonwebtoken/index.d.ts | 247 - .../@types/jsonwebtoken/package.json | 82 - .../node_modules/@types/linkify-it/LICENSE | 21 - .../node_modules/@types/linkify-it/README.md | 89 - .../node_modules/@types/linkify-it/index.d.ts | 69 - .../@types/linkify-it/package.json | 39 - .../scripts/node_modules/@types/long/LICENSE | 21 - .../node_modules/@types/long/README.md | 16 - .../node_modules/@types/long/index.d.ts | 389 - .../node_modules/@types/long/package.json | 25 - .../node_modules/@types/markdown-it/LICENSE | 21 - .../node_modules/@types/markdown-it/README.md | 16 - .../@types/markdown-it/index.d.ts | 13 - .../markdown-it/lib/common/entities.d.ts | 7 - .../markdown-it/lib/common/html_blocks.d.ts | 3 - .../markdown-it/lib/common/html_re.d.ts | 8 - .../@types/markdown-it/lib/common/utils.d.ts | 70 - .../@types/markdown-it/lib/helpers/index.d.ts | 13 - .../lib/helpers/parse_link_destination.d.ts | 12 - .../lib/helpers/parse_link_label.d.ts | 5 - .../lib/helpers/parse_link_title.d.ts | 5 - .../@types/markdown-it/lib/index.d.ts | 406 - .../@types/markdown-it/lib/parser_block.d.ts | 29 - .../@types/markdown-it/lib/parser_core.d.ts | 19 - .../@types/markdown-it/lib/parser_inline.d.ts | 42 - .../@types/markdown-it/lib/renderer.d.ts | 96 - .../@types/markdown-it/lib/ruler.d.ts | 167 - .../lib/rules_block/state_block.d.ts | 134 - .../lib/rules_core/state_core.d.ts | 20 - .../lib/rules_inline/state_inline.d.ts | 78 - .../@types/markdown-it/lib/token.d.ts | 111 - .../@types/markdown-it/package.json | 43 - .../scripts/node_modules/@types/mdurl/LICENSE | 21 - .../node_modules/@types/mdurl/README.md | 16 - .../node_modules/@types/mdurl/decode.d.ts | 7 - .../node_modules/@types/mdurl/encode.d.ts | 7 - .../node_modules/@types/mdurl/format.d.ts | 5 - .../node_modules/@types/mdurl/index.d.ts | 26 - .../node_modules/@types/mdurl/package.json | 23 - .../node_modules/@types/mdurl/parse.d.ts | 5 - .../scripts/node_modules/@types/mime/LICENSE | 21 - .../node_modules/@types/mime/Mime.d.ts | 11 - .../node_modules/@types/mime/README.md | 16 - .../node_modules/@types/mime/index.d.ts | 21 - .../node_modules/@types/mime/lite.d.ts | 7 - .../node_modules/@types/mime/package.json | 30 - .../scripts/node_modules/@types/node/LICENSE | 21 - .../node_modules/@types/node/README.md | 16 - .../node_modules/@types/node/assert.d.ts | 961 - .../@types/node/assert/strict.d.ts | 8 - .../node_modules/@types/node/async_hooks.d.ts | 501 - .../node_modules/@types/node/buffer.d.ts | 2258 -- .../@types/node/child_process.d.ts | 1369 -- .../node_modules/@types/node/cluster.d.ts | 410 - .../node_modules/@types/node/console.d.ts | 412 - .../node_modules/@types/node/constants.d.ts | 18 - .../node_modules/@types/node/crypto.d.ts | 3964 ---- .../node_modules/@types/node/dgram.d.ts | 545 - .../@types/node/diagnostics_channel.d.ts | 153 - .../scripts/node_modules/@types/node/dns.d.ts | 659 - .../@types/node/dns/promises.d.ts | 370 - .../node_modules/@types/node/dom-events.d.ts | 126 - .../node_modules/@types/node/domain.d.ts | 170 - .../node_modules/@types/node/events.d.ts | 678 - .../scripts/node_modules/@types/node/fs.d.ts | 3872 ---- .../node_modules/@types/node/fs/promises.d.ts | 1138 - .../node_modules/@types/node/globals.d.ts | 300 - .../@types/node/globals.global.d.ts | 1 - .../node_modules/@types/node/http.d.ts | 1614 -- .../node_modules/@types/node/http2.d.ts | 2134 -- .../node_modules/@types/node/https.d.ts | 541 - .../node_modules/@types/node/index.d.ts | 133 - .../node_modules/@types/node/inspector.d.ts | 2741 --- .../node_modules/@types/node/module.d.ts | 114 - .../scripts/node_modules/@types/node/net.d.ts | 869 - .../scripts/node_modules/@types/node/os.d.ts | 466 - .../node_modules/@types/node/package.json | 232 - .../node_modules/@types/node/path.d.ts | 191 - .../node_modules/@types/node/perf_hooks.d.ts | 625 - .../node_modules/@types/node/process.d.ts | 1482 -- .../node_modules/@types/node/punycode.d.ts | 117 - .../node_modules/@types/node/querystring.d.ts | 131 - .../node_modules/@types/node/readline.d.ts | 653 - .../@types/node/readline/promises.d.ts | 143 - .../node_modules/@types/node/repl.d.ts | 424 - .../node_modules/@types/node/stream.d.ts | 1340 -- .../@types/node/stream/consumers.d.ts | 12 - .../@types/node/stream/promises.d.ts | 42 - .../node_modules/@types/node/stream/web.d.ts | 330 - .../@types/node/string_decoder.d.ts | 67 - .../node_modules/@types/node/test.d.ts | 374 - .../node_modules/@types/node/timers.d.ts | 94 - .../@types/node/timers/promises.d.ts | 68 - .../scripts/node_modules/@types/node/tls.d.ts | 1028 - .../@types/node/trace_events.d.ts | 171 - .../@types/node/ts4.8/assert.d.ts | 961 - .../@types/node/ts4.8/assert/strict.d.ts | 8 - .../@types/node/ts4.8/async_hooks.d.ts | 501 - .../@types/node/ts4.8/buffer.d.ts | 2259 -- .../@types/node/ts4.8/child_process.d.ts | 1369 -- .../@types/node/ts4.8/cluster.d.ts | 410 - .../@types/node/ts4.8/console.d.ts | 412 - .../@types/node/ts4.8/constants.d.ts | 18 - .../@types/node/ts4.8/crypto.d.ts | 3964 ---- .../node_modules/@types/node/ts4.8/dgram.d.ts | 545 - .../node/ts4.8/diagnostics_channel.d.ts | 153 - .../node_modules/@types/node/ts4.8/dns.d.ts | 659 - .../@types/node/ts4.8/dns/promises.d.ts | 370 - .../@types/node/ts4.8/dom-events.d.ts | 126 - .../@types/node/ts4.8/domain.d.ts | 170 - .../@types/node/ts4.8/events.d.ts | 678 - .../node_modules/@types/node/ts4.8/fs.d.ts | 3872 ---- .../@types/node/ts4.8/fs/promises.d.ts | 1138 - .../@types/node/ts4.8/globals.d.ts | 294 - .../@types/node/ts4.8/globals.global.d.ts | 1 - .../node_modules/@types/node/ts4.8/http.d.ts | 1614 -- .../node_modules/@types/node/ts4.8/http2.d.ts | 2134 -- .../node_modules/@types/node/ts4.8/https.d.ts | 541 - .../node_modules/@types/node/ts4.8/index.d.ts | 88 - .../@types/node/ts4.8/inspector.d.ts | 2741 --- .../@types/node/ts4.8/module.d.ts | 114 - .../node_modules/@types/node/ts4.8/net.d.ts | 869 - .../node_modules/@types/node/ts4.8/os.d.ts | 466 - .../node_modules/@types/node/ts4.8/path.d.ts | 191 - .../@types/node/ts4.8/perf_hooks.d.ts | 625 - .../@types/node/ts4.8/process.d.ts | 1482 -- .../@types/node/ts4.8/punycode.d.ts | 117 - .../@types/node/ts4.8/querystring.d.ts | 131 - .../@types/node/ts4.8/readline.d.ts | 653 - .../@types/node/ts4.8/readline/promises.d.ts | 143 - .../node_modules/@types/node/ts4.8/repl.d.ts | 424 - .../@types/node/ts4.8/stream.d.ts | 1340 -- .../@types/node/ts4.8/stream/consumers.d.ts | 12 - .../@types/node/ts4.8/stream/promises.d.ts | 42 - .../@types/node/ts4.8/stream/web.d.ts | 330 - .../@types/node/ts4.8/string_decoder.d.ts | 67 - .../node_modules/@types/node/ts4.8/test.d.ts | 374 - .../@types/node/ts4.8/timers.d.ts | 94 - .../@types/node/ts4.8/timers/promises.d.ts | 68 - .../node_modules/@types/node/ts4.8/tls.d.ts | 1028 - .../@types/node/ts4.8/trace_events.d.ts | 171 - .../node_modules/@types/node/ts4.8/tty.d.ts | 206 - .../node_modules/@types/node/ts4.8/url.d.ts | 897 - .../node_modules/@types/node/ts4.8/util.d.ts | 1850 -- .../node_modules/@types/node/ts4.8/v8.d.ts | 396 - .../node_modules/@types/node/ts4.8/vm.d.ts | 509 - .../node_modules/@types/node/ts4.8/wasi.d.ts | 158 - .../@types/node/ts4.8/worker_threads.d.ts | 689 - .../node_modules/@types/node/ts4.8/zlib.d.ts | 517 - .../scripts/node_modules/@types/node/tty.d.ts | 206 - .../scripts/node_modules/@types/node/url.d.ts | 897 - .../node_modules/@types/node/util.d.ts | 1850 -- .../scripts/node_modules/@types/node/v8.d.ts | 396 - .../scripts/node_modules/@types/node/vm.d.ts | 509 - .../node_modules/@types/node/wasi.d.ts | 158 - .../@types/node/worker_threads.d.ts | 689 - .../node_modules/@types/node/zlib.d.ts | 517 - .../scripts/node_modules/@types/qs/LICENSE | 21 - .../scripts/node_modules/@types/qs/README.md | 16 - .../scripts/node_modules/@types/qs/index.d.ts | 62 - .../node_modules/@types/qs/package.json | 65 - .../node_modules/@types/range-parser/LICENSE | 21 - .../@types/range-parser/README.md | 55 - .../@types/range-parser/index.d.ts | 35 - .../@types/range-parser/package.json | 25 - .../node_modules/@types/serve-static/LICENSE | 21 - .../@types/serve-static/README.md | 16 - .../@types/serve-static/index.d.ts | 107 - .../@types/serve-static/package.json | 38 - .../node_modules/abort-controller/LICENSE | 21 - .../node_modules/abort-controller/README.md | 98 - .../node_modules/abort-controller/browser.js | 13 - .../node_modules/abort-controller/browser.mjs | 11 - .../dist/abort-controller.d.ts | 43 - .../abort-controller/dist/abort-controller.js | 127 - .../dist/abort-controller.mjs | 118 - .../dist/abort-controller.mjs.map | 1 - .../dist/abort-controller.umd.js | 5 - .../abort-controller/package.json | 97 - .../node_modules/abort-controller/polyfill.js | 21 - .../abort-controller/polyfill.mjs | 19 - .../scripts/node_modules/acorn-jsx/LICENSE | 19 - .../scripts/node_modules/acorn-jsx/README.md | 40 - .../scripts/node_modules/acorn-jsx/index.d.ts | 12 - .../scripts/node_modules/acorn-jsx/index.js | 488 - .../node_modules/acorn-jsx/package.json | 27 - .../scripts/node_modules/acorn-jsx/xhtml.js | 255 - .../scripts/node_modules/acorn/CHANGELOG.md | 816 - .../scripts/node_modules/acorn/LICENSE | 21 - .../scripts/node_modules/acorn/README.md | 273 - .../scripts/node_modules/acorn/bin/acorn | 4 - .../node_modules/acorn/dist/acorn.d.ts | 252 - .../scripts/node_modules/acorn/dist/acorn.js | 5605 ----- .../scripts/node_modules/acorn/dist/acorn.mjs | 5574 ----- .../node_modules/acorn/dist/acorn.mjs.d.ts | 2 - .../scripts/node_modules/acorn/dist/bin.js | 91 - .../scripts/node_modules/acorn/package.json | 50 - .../scripts/node_modules/agent-base/README.md | 145 - .../agent-base/dist/src/index.d.ts | 78 - .../node_modules/agent-base/dist/src/index.js | 203 - .../agent-base/dist/src/promisify.d.ts | 4 - .../agent-base/dist/src/promisify.js | 18 - .../node_modules/agent-base/package.json | 64 - .../node_modules/agent-base/src/index.ts | 345 - .../node_modules/agent-base/src/promisify.ts | 33 - .../node_modules/ansi-regex/index.d.ts | 37 - .../scripts/node_modules/ansi-regex/index.js | 10 - .../scripts/node_modules/ansi-regex/license | 9 - .../node_modules/ansi-regex/package.json | 55 - .../scripts/node_modules/ansi-regex/readme.md | 78 - .../node_modules/ansi-styles/index.d.ts | 345 - .../scripts/node_modules/ansi-styles/index.js | 163 - .../scripts/node_modules/ansi-styles/license | 9 - .../node_modules/ansi-styles/package.json | 56 - .../node_modules/ansi-styles/readme.md | 152 - .../node_modules/argparse/CHANGELOG.md | 216 - .../scripts/node_modules/argparse/LICENSE | 254 - .../scripts/node_modules/argparse/README.md | 84 - .../scripts/node_modules/argparse/argparse.js | 3707 --- .../scripts/node_modules/argparse/lib/sub.js | 67 - .../node_modules/argparse/lib/textwrap.js | 440 - .../node_modules/argparse/package.json | 31 - .../scripts/node_modules/arrify/index.d.ts | 38 - .../scripts/node_modules/arrify/index.js | 23 - .../scripts/node_modules/arrify/license | 9 - .../scripts/node_modules/arrify/package.json | 35 - .../scripts/node_modules/arrify/readme.md | 39 - .../node_modules/async-retry/LICENSE.md | 21 - .../node_modules/async-retry/README.md | 53 - .../node_modules/async-retry/lib/index.js | 61 - .../node_modules/async-retry/package.json | 55 - .../balanced-match/.github/FUNDING.yml | 2 - .../node_modules/balanced-match/LICENSE.md | 21 - .../node_modules/balanced-match/README.md | 97 - .../node_modules/balanced-match/index.js | 62 - .../node_modules/balanced-match/package.json | 48 - .../scripts/node_modules/base64-js/LICENSE | 21 - .../scripts/node_modules/base64-js/README.md | 34 - .../node_modules/base64-js/base64js.min.js | 1 - .../scripts/node_modules/base64-js/index.d.ts | 3 - .../scripts/node_modules/base64-js/index.js | 150 - .../node_modules/base64-js/package.json | 47 - .../node_modules/bignumber.js/CHANGELOG.md | 286 - .../node_modules/bignumber.js/LICENCE.md | 26 - .../node_modules/bignumber.js/README.md | 286 - .../node_modules/bignumber.js/bignumber.d.ts | 1831 -- .../node_modules/bignumber.js/bignumber.js | 2926 --- .../node_modules/bignumber.js/bignumber.mjs | 2889 --- .../node_modules/bignumber.js/doc/API.html | 2249 -- .../node_modules/bignumber.js/package.json | 50 - .../scripts/node_modules/bluebird/LICENSE | 21 - .../scripts/node_modules/bluebird/README.md | 57 - .../node_modules/bluebird/changelog.md | 1 - .../bluebird/js/browser/bluebird.core.js | 3914 ---- .../bluebird/js/browser/bluebird.core.min.js | 31 - .../bluebird/js/browser/bluebird.js | 5778 ----- .../bluebird/js/browser/bluebird.min.js | 31 - .../node_modules/bluebird/js/release/any.js | 21 - .../bluebird/js/release/assert.js | 55 - .../node_modules/bluebird/js/release/async.js | 120 - .../node_modules/bluebird/js/release/bind.js | 67 - .../bluebird/js/release/bluebird.js | 11 - .../bluebird/js/release/call_get.js | 123 - .../bluebird/js/release/cancel.js | 129 - .../bluebird/js/release/catch_filter.js | 42 - .../bluebird/js/release/context.js | 69 - .../bluebird/js/release/debuggability.js | 1009 - .../bluebird/js/release/direct_resolve.js | 46 - .../node_modules/bluebird/js/release/each.js | 30 - .../bluebird/js/release/errors.js | 116 - .../node_modules/bluebird/js/release/es5.js | 80 - .../bluebird/js/release/filter.js | 12 - .../bluebird/js/release/finally.js | 146 - .../bluebird/js/release/generators.js | 223 - .../node_modules/bluebird/js/release/join.js | 165 - .../node_modules/bluebird/js/release/map.js | 175 - .../bluebird/js/release/method.js | 55 - .../bluebird/js/release/nodeback.js | 51 - .../bluebird/js/release/nodeify.js | 58 - .../bluebird/js/release/promise.js | 819 - .../bluebird/js/release/promise_array.js | 186 - .../bluebird/js/release/promisify.js | 314 - .../node_modules/bluebird/js/release/props.js | 118 - .../node_modules/bluebird/js/release/queue.js | 73 - .../node_modules/bluebird/js/release/race.js | 49 - .../bluebird/js/release/reduce.js | 183 - .../bluebird/js/release/schedule.js | 62 - .../bluebird/js/release/settle.js | 47 - .../node_modules/bluebird/js/release/some.js | 148 - .../js/release/synchronous_inspection.js | 103 - .../bluebird/js/release/thenables.js | 86 - .../bluebird/js/release/timers.js | 93 - .../node_modules/bluebird/js/release/using.js | 226 - .../node_modules/bluebird/js/release/util.js | 421 - .../node_modules/bluebird/package.json | 78 - .../brace-expansion/.github/FUNDING.yml | 2 - .../node_modules/brace-expansion/LICENSE | 21 - .../node_modules/brace-expansion/README.md | 135 - .../node_modules/brace-expansion/index.js | 203 - .../node_modules/brace-expansion/package.json | 46 - .../buffer-equal-constant-time/.npmignore | 2 - .../buffer-equal-constant-time/.travis.yml | 4 - .../buffer-equal-constant-time/LICENSE.txt | 12 - .../buffer-equal-constant-time/README.md | 50 - .../buffer-equal-constant-time/index.js | 41 - .../buffer-equal-constant-time/package.json | 21 - .../buffer-equal-constant-time/test.js | 42 - .../scripts/node_modules/catharsis/LICENSE | 17 - .../scripts/node_modules/catharsis/README.md | 393 - .../node_modules/catharsis/bin/parse.js | 55 - .../node_modules/catharsis/catharsis.js | 169 - .../node_modules/catharsis/lib/describe.js | 563 - .../node_modules/catharsis/lib/parser.js | 5776 ----- .../node_modules/catharsis/lib/schema.js | 72 - .../node_modules/catharsis/lib/stringify.js | 277 - .../node_modules/catharsis/lib/types.js | 22 - .../node_modules/catharsis/package.json | 30 - .../node_modules/catharsis/res/en.json | 92 - .../scripts/node_modules/chalk/index.d.ts | 415 - .../scripts/node_modules/chalk/license | 9 - .../scripts/node_modules/chalk/package.json | 68 - .../scripts/node_modules/chalk/readme.md | 341 - .../node_modules/chalk/source/index.js | 229 - .../node_modules/chalk/source/templates.js | 134 - .../scripts/node_modules/chalk/source/util.js | 39 - .../scripts/node_modules/cliui/CHANGELOG.md | 121 - .../scripts/node_modules/cliui/LICENSE.txt | 14 - .../scripts/node_modules/cliui/README.md | 141 - .../scripts/node_modules/cliui/index.mjs | 13 - .../scripts/node_modules/cliui/package.json | 83 - .../node_modules/color-convert/CHANGELOG.md | 54 - .../node_modules/color-convert/LICENSE | 21 - .../node_modules/color-convert/README.md | 68 - .../node_modules/color-convert/conversions.js | 839 - .../node_modules/color-convert/index.js | 81 - .../node_modules/color-convert/package.json | 48 - .../node_modules/color-convert/route.js | 97 - .../scripts/node_modules/color-name/LICENSE | 8 - .../scripts/node_modules/color-name/README.md | 11 - .../scripts/node_modules/color-name/index.js | 152 - .../node_modules/color-name/package.json | 28 - .../node_modules/compressible/HISTORY.md | 111 - .../scripts/node_modules/compressible/LICENSE | 24 - .../node_modules/compressible/README.md | 61 - .../node_modules/compressible/index.js | 58 - .../node_modules/compressible/package.json | 48 - .../node_modules/concat-map/.travis.yml | 4 - .../scripts/node_modules/concat-map/LICENSE | 18 - .../node_modules/concat-map/README.markdown | 62 - .../node_modules/concat-map/example/map.js | 6 - .../scripts/node_modules/concat-map/index.js | 13 - .../node_modules/concat-map/package.json | 43 - .../node_modules/concat-map/test/map.js | 39 - .../scripts/node_modules/debug/LICENSE | 20 - .../scripts/node_modules/debug/README.md | 481 - .../scripts/node_modules/debug/package.json | 59 - .../scripts/node_modules/debug/src/browser.js | 269 - .../scripts/node_modules/debug/src/common.js | 274 - .../scripts/node_modules/debug/src/index.js | 10 - .../scripts/node_modules/debug/src/node.js | 263 - .../scripts/node_modules/deep-is/.travis.yml | 5 - .../scripts/node_modules/deep-is/LICENSE | 22 - .../node_modules/deep-is/README.markdown | 70 - .../node_modules/deep-is/example/cmp.js | 11 - .../scripts/node_modules/deep-is/index.js | 102 - .../scripts/node_modules/deep-is/package.json | 58 - .../scripts/node_modules/deep-is/test/NaN.js | 16 - .../scripts/node_modules/deep-is/test/cmp.js | 23 - .../node_modules/deep-is/test/neg-vs-pos-0.js | 15 - .../node_modules/duplexify/.travis.yml | 9 - .../scripts/node_modules/duplexify/LICENSE | 21 - .../scripts/node_modules/duplexify/README.md | 97 - .../scripts/node_modules/duplexify/example.js | 21 - .../scripts/node_modules/duplexify/index.js | 238 - .../node_modules/duplexify/package.json | 39 - .../scripts/node_modules/duplexify/test.js | 339 - .../ecdsa-sig-formatter/CODEOWNERS | 1 - .../node_modules/ecdsa-sig-formatter/LICENSE | 201 - .../ecdsa-sig-formatter/README.md | 65 - .../ecdsa-sig-formatter/package.json | 46 - .../src/ecdsa-sig-formatter.d.ts | 17 - .../src/ecdsa-sig-formatter.js | 187 - .../src/param-bytes-for-alg.js | 23 - .../node_modules/emoji-regex/LICENSE-MIT.txt | 20 - .../node_modules/emoji-regex/README.md | 73 - .../node_modules/emoji-regex/es2015/index.js | 6 - .../node_modules/emoji-regex/es2015/text.js | 6 - .../node_modules/emoji-regex/index.d.ts | 23 - .../scripts/node_modules/emoji-regex/index.js | 6 - .../node_modules/emoji-regex/package.json | 50 - .../scripts/node_modules/emoji-regex/text.js | 6 - .../node_modules/end-of-stream/LICENSE | 21 - .../node_modules/end-of-stream/README.md | 54 - .../node_modules/end-of-stream/index.js | 94 - .../node_modules/end-of-stream/package.json | 37 - .../scripts/node_modules/ent/.npmignore | 1 - .../scripts/node_modules/ent/.travis.yml | 4 - .../example/scripts/node_modules/ent/LICENSE | 18 - .../scripts/node_modules/ent/decode.js | 32 - .../scripts/node_modules/ent/encode.js | 39 - .../scripts/node_modules/ent/entities.json | 2233 -- .../node_modules/ent/examples/simple.js | 3 - .../example/scripts/node_modules/ent/index.js | 2 - .../scripts/node_modules/ent/package.json | 34 - .../scripts/node_modules/ent/readme.markdown | 71 - .../scripts/node_modules/ent/reversed.json | 1315 -- .../scripts/node_modules/ent/test/codes.js | 101 - .../scripts/node_modules/ent/test/hex.js | 35 - .../scripts/node_modules/ent/test/num.js | 13 - .../scripts/node_modules/entities/LICENSE | 11 - .../node_modules/entities/lib/decode.d.ts | 7 - .../node_modules/entities/lib/decode.d.ts.map | 1 - .../node_modules/entities/lib/decode.js | 54 - .../entities/lib/decode_codepoint.d.ts | 2 - .../entities/lib/decode_codepoint.d.ts.map | 1 - .../entities/lib/decode_codepoint.js | 24 - .../node_modules/entities/lib/encode.d.ts | 4 - .../node_modules/entities/lib/encode.d.ts.map | 1 - .../node_modules/entities/lib/encode.js | 73 - .../node_modules/entities/lib/index.d.ts | 24 - .../node_modules/entities/lib/index.d.ts.map | 1 - .../node_modules/entities/lib/index.js | 52 - .../entities/lib/maps/decode.json | 1 - .../entities/lib/maps/entities.json | 1 - .../entities/lib/maps/legacy.json | 1 - .../node_modules/entities/lib/maps/xml.json | 1 - .../node_modules/entities/package.json | 63 - .../scripts/node_modules/entities/readme.md | 50 - .../node_modules/escalade/dist/index.js | 22 - .../node_modules/escalade/dist/index.mjs | 22 - .../scripts/node_modules/escalade/index.d.ts | 3 - .../scripts/node_modules/escalade/license | 9 - .../node_modules/escalade/package.json | 61 - .../scripts/node_modules/escalade/readme.md | 211 - .../node_modules/escalade/sync/index.d.ts | 2 - .../node_modules/escalade/sync/index.js | 18 - .../node_modules/escalade/sync/index.mjs | 18 - .../escape-string-regexp/index.d.ts | 18 - .../escape-string-regexp/index.js | 11 - .../node_modules/escape-string-regexp/license | 9 - .../escape-string-regexp/package.json | 43 - .../escape-string-regexp/readme.md | 29 - .../node_modules/escodegen/LICENSE.BSD | 21 - .../scripts/node_modules/escodegen/README.md | 84 - .../node_modules/escodegen/bin/escodegen.js | 77 - .../node_modules/escodegen/bin/esgenerate.js | 64 - .../node_modules/escodegen/escodegen.js | 2626 --- .../node_modules/estraverse/.jshintrc | 16 - .../node_modules/estraverse/LICENSE.BSD | 19 - .../node_modules/estraverse/README.md | 153 - .../node_modules/estraverse/estraverse.js | 782 - .../node_modules/estraverse/gulpfile.js | 70 - .../node_modules/estraverse/package.json | 40 - .../node_modules/escodegen/package.json | 61 - .../node_modules/eslint-visitor-keys/LICENSE | 201 - .../eslint-visitor-keys/README.md | 107 - .../dist/eslint-visitor-keys.cjs | 382 - .../eslint-visitor-keys/dist/index.d.ts | 18 - .../dist/visitor-keys.d.ts | 10 - .../eslint-visitor-keys/lib/index.js | 65 - .../eslint-visitor-keys/lib/visitor-keys.js | 312 - .../eslint-visitor-keys/package.json | 62 - .../scripts/node_modules/espree/LICENSE | 25 - .../scripts/node_modules/espree/README.md | 244 - .../node_modules/espree/dist/espree.cjs | 938 - .../scripts/node_modules/espree/espree.js | 173 - .../scripts/node_modules/espree/lib/espree.js | 348 - .../node_modules/espree/lib/features.js | 27 - .../node_modules/espree/lib/options.js | 122 - .../espree/lib/token-translator.js | 265 - .../node_modules/espree/lib/version.js | 3 - .../scripts/node_modules/espree/package.json | 82 - .../scripts/node_modules/esprima/ChangeLog | 235 - .../scripts/node_modules/esprima/LICENSE.BSD | 21 - .../scripts/node_modules/esprima/README.md | 46 - .../node_modules/esprima/bin/esparse.js | 139 - .../node_modules/esprima/bin/esvalidate.js | 236 - .../node_modules/esprima/dist/esprima.js | 6709 ------ .../scripts/node_modules/esprima/package.json | 112 - .../scripts/node_modules/estraverse/.jshintrc | 16 - .../node_modules/estraverse/LICENSE.BSD | 19 - .../scripts/node_modules/estraverse/README.md | 153 - .../node_modules/estraverse/estraverse.js | 805 - .../node_modules/estraverse/gulpfile.js | 70 - .../node_modules/estraverse/package.json | 40 - .../scripts/node_modules/esutils/LICENSE.BSD | 19 - .../scripts/node_modules/esutils/README.md | 174 - .../scripts/node_modules/esutils/lib/ast.js | 144 - .../scripts/node_modules/esutils/lib/code.js | 135 - .../node_modules/esutils/lib/keyword.js | 165 - .../scripts/node_modules/esutils/lib/utils.js | 33 - .../scripts/node_modules/esutils/package.json | 44 - .../node_modules/event-target-shim/LICENSE | 22 - .../node_modules/event-target-shim/README.md | 293 - .../dist/event-target-shim.js | 871 - .../dist/event-target-shim.mjs | 862 - .../dist/event-target-shim.mjs.map | 1 - .../dist/event-target-shim.umd.js | 6 - .../node_modules/event-target-shim/index.d.ts | 399 - .../event-target-shim/package.json | 82 - .../scripts/node_modules/extend/.editorconfig | 20 - .../scripts/node_modules/extend/.eslintrc | 17 - .../scripts/node_modules/extend/.jscs.json | 175 - .../scripts/node_modules/extend/.travis.yml | 230 - .../scripts/node_modules/extend/CHANGELOG.md | 83 - .../scripts/node_modules/extend/LICENSE | 23 - .../scripts/node_modules/extend/README.md | 81 - .../node_modules/extend/component.json | 32 - .../scripts/node_modules/extend/index.js | 117 - .../scripts/node_modules/extend/package.json | 42 - .../node_modules/fast-deep-equal/LICENSE | 21 - .../node_modules/fast-deep-equal/README.md | 96 - .../fast-deep-equal/es6/index.d.ts | 2 - .../node_modules/fast-deep-equal/es6/index.js | 72 - .../fast-deep-equal/es6/react.d.ts | 2 - .../node_modules/fast-deep-equal/es6/react.js | 79 - .../node_modules/fast-deep-equal/index.d.ts | 4 - .../node_modules/fast-deep-equal/index.js | 46 - .../node_modules/fast-deep-equal/package.json | 61 - .../node_modules/fast-deep-equal/react.d.ts | 2 - .../node_modules/fast-deep-equal/react.js | 53 - .../node_modules/fast-levenshtein/LICENSE.md | 25 - .../node_modules/fast-levenshtein/README.md | 104 - .../fast-levenshtein/levenshtein.js | 136 - .../fast-levenshtein/package.json | 39 - .../node_modules/fast-text-encoding/LICENSE | 201 - .../node_modules/fast-text-encoding/README.md | 38 - .../fast-text-encoding/package.json | 9 - .../fast-text-encoding/text.min.js | 3 - .../node_modules/faye-websocket/CHANGELOG.md | 139 - .../node_modules/faye-websocket/LICENSE.md | 12 - .../node_modules/faye-websocket/README.md | 311 - .../faye-websocket/lib/faye/eventsource.js | 133 - .../faye-websocket/lib/faye/websocket.js | 47 - .../faye-websocket/lib/faye/websocket/api.js | 199 - .../lib/faye/websocket/api/event.js | 22 - .../lib/faye/websocket/api/event_target.js | 30 - .../lib/faye/websocket/client.js | 90 - .../node_modules/faye-websocket/package.json | 35 - .../node_modules/firebase-admin/LICENSE | 201 - .../node_modules/firebase-admin/README.md | 94 - .../app-check-api-client-internal.d.ts | 32 - .../app-check-api-client-internal.js | 178 - .../lib/app-check/app-check-api.d.ts | 95 - .../lib/app-check/app-check-api.js | 19 - .../lib/app-check/app-check-namespace.d.ts | 65 - .../lib/app-check/app-check-namespace.js | 18 - .../lib/app-check/app-check.d.ts | 49 - .../firebase-admin/lib/app-check/app-check.js | 80 - .../firebase-admin/lib/app-check/index.d.ts | 53 - .../firebase-admin/lib/app-check/index.js | 63 - .../lib/app-check/token-generator.d.ts | 25 - .../lib/app-check/token-generator.js | 154 - .../lib/app-check/token-verifier.d.ts | 17 - .../lib/app-check/token-verifier.js | 147 - .../firebase-admin/lib/app/core.d.ts | 188 - .../firebase-admin/lib/app/core.js | 19 - .../lib/app/credential-factory.d.ts | 123 - .../lib/app/credential-factory.js | 150 - .../lib/app/credential-internal.d.ts | 98 - .../lib/app/credential-internal.js | 425 - .../firebase-admin/lib/app/credential.d.ts | 45 - .../firebase-admin/lib/app/credential.js | 19 - .../firebase-admin/lib/app/firebase-app.d.ts | 51 - .../firebase-admin/lib/app/firebase-app.js | 207 - .../lib/app/firebase-namespace.d.ts | 163 - .../lib/app/firebase-namespace.js | 335 - .../firebase-admin/lib/app/index.d.ts | 27 - .../firebase-admin/lib/app/index.js | 31 - .../firebase-admin/lib/app/lifecycle.d.ts | 60 - .../firebase-admin/lib/app/lifecycle.js | 159 - .../auth/action-code-settings-builder.d.ts | 87 - .../lib/auth/action-code-settings-builder.js | 119 - .../lib/auth/auth-api-request.d.ts | 185 - .../lib/auth/auth-api-request.js | 1948 -- .../firebase-admin/lib/auth/auth-config.d.ts | 630 - .../firebase-admin/lib/auth/auth-config.js | 691 - .../lib/auth/auth-namespace.d.ts | 257 - .../firebase-admin/lib/auth/auth-namespace.js | 18 - .../firebase-admin/lib/auth/auth.d.ts | 48 - .../firebase-admin/lib/auth/auth.js | 66 - .../firebase-admin/lib/auth/base-auth.d.ts | 640 - .../firebase-admin/lib/auth/base-auth.js | 981 - .../firebase-admin/lib/auth/identifier.d.ts | 57 - .../firebase-admin/lib/auth/identifier.js | 40 - .../firebase-admin/lib/auth/index.d.ts | 57 - .../firebase-admin/lib/auth/index.js | 75 - .../lib/auth/project-config-manager.d.ts | 25 - .../lib/auth/project-config-manager.js | 50 - .../lib/auth/project-config.d.ts | 48 - .../firebase-admin/lib/auth/project-config.js | 90 - .../lib/auth/tenant-manager.d.ts | 146 - .../firebase-admin/lib/auth/tenant-manager.js | 230 - .../firebase-admin/lib/auth/tenant.d.ts | 142 - .../firebase-admin/lib/auth/tenant.js | 221 - .../lib/auth/token-generator.d.ts | 44 - .../lib/auth/token-generator.js | 198 - .../lib/auth/token-verifier.d.ts | 219 - .../firebase-admin/lib/auth/token-verifier.js | 310 - .../lib/auth/user-import-builder.d.ts | 322 - .../lib/auth/user-import-builder.js | 384 - .../firebase-admin/lib/auth/user-record.d.ts | 265 - .../firebase-admin/lib/auth/user-record.js | 359 - .../firebase-admin/lib/credential/index.d.ts | 127 - .../firebase-admin/lib/credential/index.js | 123 - .../lib/database/database-namespace.d.ts | 95 - .../lib/database/database-namespace.js | 23 - .../firebase-admin/lib/database/database.d.ts | 66 - .../firebase-admin/lib/database/database.js | 257 - .../firebase-admin/lib/database/index.d.ts | 90 - .../firebase-admin/lib/database/index.js | 103 - .../firebase-admin/lib/default-namespace.d.ts | 24 - .../firebase-admin/lib/default-namespace.js | 30 - .../firebase-admin/lib/esm/app-check/index.js | 4 - .../firebase-admin/lib/esm/app/index.js | 10 - .../firebase-admin/lib/esm/auth/index.js | 16 - .../firebase-admin/lib/esm/database/index.js | 6 - .../firebase-admin/lib/esm/eventarc/index.js | 5 - .../lib/esm/extensions/index.js | 5 - .../firebase-admin/lib/esm/firestore/index.js | 24 - .../firebase-admin/lib/esm/functions/index.js | 5 - .../lib/esm/installations/index.js | 4 - .../lib/esm/instance-id/index.js | 4 - .../lib/esm/machine-learning/index.js | 5 - .../firebase-admin/lib/esm/messaging/index.js | 4 - .../firebase-admin/lib/esm/package.json | 1 - .../lib/esm/project-management/index.js | 8 - .../lib/esm/remote-config/index.js | 4 - .../lib/esm/security-rules/index.js | 6 - .../firebase-admin/lib/esm/storage/index.js | 4 - .../lib/eventarc/cloudevent.d.ts | 84 - .../firebase-admin/lib/eventarc/cloudevent.js | 19 - .../eventarc/eventarc-client-internal.d.ts | 18 - .../lib/eventarc/eventarc-client-internal.js | 139 - .../lib/eventarc/eventarc-utils.d.ts | 31 - .../lib/eventarc/eventarc-utils.js | 125 - .../firebase-admin/lib/eventarc/eventarc.d.ts | 107 - .../firebase-admin/lib/eventarc/eventarc.js | 125 - .../firebase-admin/lib/eventarc/index.d.ts | 53 - .../firebase-admin/lib/eventarc/index.js | 64 - .../extensions-api-client-internal.d.ts | 30 - .../extensions-api-client-internal.js | 105 - .../lib/extensions/extensions-api.d.ts | 44 - .../lib/extensions/extensions-api.js | 19 - .../lib/extensions/extensions.d.ts | 73 - .../lib/extensions/extensions.js | 122 - .../firebase-admin/lib/extensions/index.d.ts | 53 - .../firebase-admin/lib/extensions/index.js | 64 - .../lib/firebase-namespace-api.d.ts | 91 - .../lib/firebase-namespace-api.js | 58 - .../lib/firestore/firestore-internal.d.ts | 32 - .../lib/firestore/firestore-internal.js | 102 - .../lib/firestore/firestore-namespace.d.ts | 63 - .../lib/firestore/firestore-namespace.js | 48 - .../firebase-admin/lib/firestore/index.d.ts | 65 - .../firebase-admin/lib/firestore/index.js | 52 - .../functions-api-client-internal.d.ts | 50 - .../functions-api-client-internal.js | 259 - .../lib/functions/functions-api.d.ts | 67 - .../lib/functions/functions-api.js | 19 - .../lib/functions/functions.d.ts | 63 - .../firebase-admin/lib/functions/functions.js | 97 - .../firebase-admin/lib/functions/index.d.ts | 53 - .../firebase-admin/lib/functions/index.js | 64 - .../firebase-admin/lib/index.d.ts | 24 - .../node_modules/firebase-admin/lib/index.js | 37 - .../lib/installations/index.d.ts | 52 - .../firebase-admin/lib/installations/index.js | 62 - .../installations-namespace.d.ts | 55 - .../installations/installations-namespace.js | 18 - .../installations-request-handler.d.ts | 43 - .../installations-request-handler.js | 114 - .../lib/installations/installations.d.ts | 38 - .../lib/installations/installations.js | 58 - .../firebase-admin/lib/instance-id/index.d.ts | 61 - .../firebase-admin/lib/instance-id/index.js | 71 - .../instance-id/instance-id-namespace.d.ts | 38 - .../lib/instance-id/instance-id-namespace.js | 3 - .../lib/instance-id/instance-id.d.ts | 47 - .../lib/instance-id/instance-id.js | 77 - .../lib/machine-learning/index.d.ts | 52 - .../lib/machine-learning/index.js | 63 - .../machine-learning-api-client.d.ts | 102 - .../machine-learning-api-client.js | 290 - .../machine-learning-namespace.d.ts | 85 - .../machine-learning-namespace.js | 18 - .../machine-learning-utils.d.ts | 22 - .../machine-learning-utils.js | 47 - .../machine-learning/machine-learning.d.ts | 181 - .../lib/machine-learning/machine-learning.js | 338 - .../lib/messaging/batch-request-internal.d.ts | 55 - .../lib/messaging/batch-request-internal.js | 127 - .../firebase-admin/lib/messaging/index.d.ts | 52 - .../firebase-admin/lib/messaging/index.js | 62 - .../messaging-api-request-internal.d.ts | 50 - .../messaging-api-request-internal.js | 126 - .../lib/messaging/messaging-api.d.ts | 980 - .../lib/messaging/messaging-api.js | 19 - .../messaging/messaging-errors-internal.d.ts | 31 - .../messaging/messaging-errors-internal.js | 105 - .../lib/messaging/messaging-internal.d.ts | 27 - .../lib/messaging/messaging-internal.js | 484 - .../lib/messaging/messaging-namespace.d.ts | 181 - .../lib/messaging/messaging-namespace.js | 18 - .../lib/messaging/messaging.d.ts | 269 - .../firebase-admin/lib/messaging/messaging.js | 813 - .../lib/project-management/android-app.d.ts | 110 - .../lib/project-management/android-app.js | 183 - .../lib/project-management/app-metadata.d.ts | 85 - .../lib/project-management/app-metadata.js | 37 - .../lib/project-management/index.d.ts | 53 - .../lib/project-management/index.js | 68 - .../lib/project-management/ios-app.d.ts | 66 - .../lib/project-management/ios-app.js | 94 - ...oject-management-api-request-internal.d.ts | 17 - ...project-management-api-request-internal.js | 268 - .../project-management-namespace.d.ts | 82 - .../project-management-namespace.js | 18 - .../project-management.d.ts | 115 - .../project-management/project-management.js | 244 - .../lib/remote-config/index.d.ts | 52 - .../firebase-admin/lib/remote-config/index.js | 62 - .../remote-config-api-client-internal.d.ts | 28 - .../remote-config-api-client-internal.js | 369 - .../lib/remote-config/remote-config-api.d.ts | 258 - .../lib/remote-config/remote-config-api.js | 18 - .../remote-config-namespace.d.ts | 105 - .../remote-config/remote-config-namespace.js | 18 - .../lib/remote-config/remote-config.d.ts | 94 - .../lib/remote-config/remote-config.js | 297 - .../lib/security-rules/index.d.ts | 50 - .../lib/security-rules/index.js | 63 - .../security-rules-api-client-internal.d.ts | 75 - .../security-rules-api-client-internal.js | 248 - .../security-rules-internal.d.ts | 21 - .../security-rules/security-rules-internal.js | 26 - .../security-rules-namespace.d.ts | 69 - .../security-rules-namespace.js | 18 - .../lib/security-rules/security-rules.d.ts | 196 - .../lib/security-rules/security-rules.js | 319 - .../firebase-admin/lib/storage/index.d.ts | 44 - .../firebase-admin/lib/storage/index.js | 55 - .../lib/storage/storage-namespace.d.ts | 45 - .../lib/storage/storage-namespace.js | 18 - .../firebase-admin/lib/storage/storage.d.ts | 42 - .../firebase-admin/lib/storage/storage.js | 121 - .../firebase-admin/lib/utils/api-request.d.ts | 232 - .../firebase-admin/lib/utils/api-request.js | 767 - .../lib/utils/crypto-signer.d.ts | 128 - .../firebase-admin/lib/utils/crypto-signer.js | 202 - .../firebase-admin/lib/utils/deep-copy.d.ts | 40 - .../firebase-admin/lib/utils/deep-copy.js | 78 - .../firebase-admin/lib/utils/error.d.ts | 658 - .../firebase-admin/lib/utils/error.js | 1005 - .../firebase-admin/lib/utils/index.d.ts | 147 - .../firebase-admin/lib/utils/index.js | 283 - .../firebase-admin/lib/utils/jwt.d.ts | 131 - .../firebase-admin/lib/utils/jwt.js | 329 - .../firebase-admin/lib/utils/validator.d.ts | 144 - .../firebase-admin/lib/utils/validator.js | 271 - .../node_modules/firebase-admin/package.json | 264 - .../scripts/node_modules/fs.realpath/LICENSE | 43 - .../node_modules/fs.realpath/README.md | 33 - .../scripts/node_modules/fs.realpath/index.js | 66 - .../scripts/node_modules/fs.realpath/old.js | 303 - .../node_modules/fs.realpath/package.json | 26 - .../functional-red-black-tree/.npmignore | 16 - .../functional-red-black-tree/LICENSE | 22 - .../functional-red-black-tree/README.md | 237 - .../functional-red-black-tree/bench/test.js | 11 - .../functional-red-black-tree/package.json | 40 - .../functional-red-black-tree/rbtree.js | 996 - .../functional-red-black-tree/test/test.js | 479 - .../scripts/node_modules/gaxios/CHANGELOG.md | 241 - .../scripts/node_modules/gaxios/LICENSE | 202 - .../scripts/node_modules/gaxios/README.md | 159 - .../scripts/node_modules/gaxios/package.json | 95 - .../node_modules/gcp-metadata/CHANGELOG.md | 410 - .../scripts/node_modules/gcp-metadata/LICENSE | 202 - .../node_modules/gcp-metadata/README.md | 227 - .../node_modules/gcp-metadata/package.json | 68 - .../node_modules/get-caller-file/LICENSE.md | 6 - .../node_modules/get-caller-file/README.md | 41 - .../node_modules/get-caller-file/index.d.ts | 2 - .../node_modules/get-caller-file/index.js | 22 - .../node_modules/get-caller-file/package.json | 42 - .../example/scripts/node_modules/glob/LICENSE | 15 - .../scripts/node_modules/glob/README.md | 378 - .../scripts/node_modules/glob/common.js | 240 - .../example/scripts/node_modules/glob/glob.js | 790 - .../scripts/node_modules/glob/package.json | 55 - .../example/scripts/node_modules/glob/sync.js | 486 - .../google-auth-library/CHANGELOG.md | 1092 - .../node_modules/google-auth-library/LICENSE | 202 - .../google-auth-library/README.md | 1279 -- .../google-auth-library/package.json | 96 - .../node_modules/google-gax/CHANGELOG.md | 1412 -- .../scripts/node_modules/google-gax/LICENSE | 202 - .../scripts/node_modules/google-gax/README.md | 45 - .../node_modules/google-gax/package.json | 111 - .../node_modules/google-p12-pem/CHANGELOG.md | 242 - .../node_modules/google-p12-pem/LICENSE | 21 - .../node_modules/google-p12-pem/README.md | 154 - .../node_modules/google-p12-pem/package.json | 53 - .../scripts/node_modules/graceful-fs/LICENSE | 15 - .../node_modules/graceful-fs/README.md | 143 - .../scripts/node_modules/graceful-fs/clone.js | 23 - .../node_modules/graceful-fs/graceful-fs.js | 448 - .../graceful-fs/legacy-streams.js | 118 - .../node_modules/graceful-fs/package.json | 50 - .../node_modules/graceful-fs/polyfills.js | 355 - .../scripts/node_modules/gtoken/CHANGELOG.md | 341 - .../scripts/node_modules/gtoken/LICENSE | 21 - .../scripts/node_modules/gtoken/README.md | 187 - .../scripts/node_modules/gtoken/package.json | 62 - .../scripts/node_modules/has-flag/index.d.ts | 39 - .../scripts/node_modules/has-flag/index.js | 8 - .../scripts/node_modules/has-flag/license | 9 - .../node_modules/has-flag/package.json | 46 - .../scripts/node_modules/has-flag/readme.md | 89 - .../node_modules/http-parser-js/LICENSE.md | 110 - .../node_modules/http-parser-js/README.md | 43 - .../http-parser-js/http-parser.d.ts | 175 - .../http-parser-js/http-parser.js | 463 - .../node_modules/http-parser-js/package.json | 30 - .../node_modules/http-proxy-agent/README.md | 74 - .../http-proxy-agent/dist/agent.d.ts | 32 - .../http-proxy-agent/dist/agent.js | 145 - .../http-proxy-agent/dist/index.d.ts | 21 - .../http-proxy-agent/dist/index.js | 14 - .../http-proxy-agent/package.json | 57 - .../node_modules/https-proxy-agent/README.md | 137 - .../https-proxy-agent/dist/agent.d.ts | 30 - .../https-proxy-agent/dist/agent.js | 177 - .../https-proxy-agent/dist/index.d.ts | 23 - .../https-proxy-agent/dist/index.js | 14 - .../dist/parse-proxy-response.d.ts | 7 - .../dist/parse-proxy-response.js | 66 - .../https-proxy-agent/package.json | 56 - .../scripts/node_modules/inflight/LICENSE | 15 - .../scripts/node_modules/inflight/README.md | 37 - .../scripts/node_modules/inflight/inflight.js | 54 - .../node_modules/inflight/package.json | 29 - .../scripts/node_modules/inherits/LICENSE | 16 - .../scripts/node_modules/inherits/README.md | 42 - .../scripts/node_modules/inherits/inherits.js | 9 - .../node_modules/inherits/inherits_browser.js | 27 - .../node_modules/inherits/package.json | 29 - .../is-fullwidth-code-point/index.d.ts | 17 - .../is-fullwidth-code-point/index.js | 50 - .../is-fullwidth-code-point/license | 9 - .../is-fullwidth-code-point/package.json | 42 - .../is-fullwidth-code-point/readme.md | 39 - .../node_modules/is-stream-ended/index.d.ts | 4 - .../node_modules/is-stream-ended/index.js | 13 - .../node_modules/is-stream-ended/license | 20 - .../node_modules/is-stream-ended/package.json | 36 - .../node_modules/is-stream-ended/readme.md | 21 - .../scripts/node_modules/is-stream/index.d.ts | 79 - .../scripts/node_modules/is-stream/index.js | 28 - .../scripts/node_modules/is-stream/license | 9 - .../node_modules/is-stream/package.json | 42 - .../scripts/node_modules/is-stream/readme.md | 60 - .../scripts/node_modules/jose/LICENSE.md | 21 - .../node_modules/jose/LICENSE_THIRD_PARTY | 209 - .../scripts/node_modules/jose/README.md | 426 - .../scripts/node_modules/jose/lib/errors.js | 86 - .../lib/help/asn1/algorithm_identifier.js | 8 - .../jose/lib/help/asn1/ec_private_key.js | 10 - .../node_modules/jose/lib/help/asn1/index.js | 29 - .../node_modules/jose/lib/help/asn1/oids.js | 14 - .../jose/lib/help/asn1/one_asymmetric_key.js | 7 - .../jose/lib/help/asn1/private_key.js | 5 - .../jose/lib/help/asn1/private_key_info.js | 7 - .../jose/lib/help/asn1/public_key_info.js | 6 - .../jose/lib/help/asn1/rsa_private_key.js | 13 - .../jose/lib/help/asn1/rsa_public_key.js | 6 - .../node_modules/jose/lib/help/base64url.js | 64 - .../node_modules/jose/lib/help/consts.js | 18 - .../node_modules/jose/lib/help/deep_clone.js | 1 - .../jose/lib/help/ecdsa_signatures.js | 180 - .../node_modules/jose/lib/help/epoch.js | 1 - .../node_modules/jose/lib/help/generate_iv.js | 5 - .../node_modules/jose/lib/help/get_key.js | 35 - .../node_modules/jose/lib/help/is_disjoint.js | 5 - .../node_modules/jose/lib/help/is_object.js | 1 - .../node_modules/jose/lib/help/key_object.js | 435 - .../node_modules/jose/lib/help/key_utils.js | 300 - .../node_modules/jose/lib/help/node_alg.js | 1 - .../node_modules/jose/lib/help/rsa_primes.js | 170 - .../jose/lib/help/runtime_support.js | 11 - .../node_modules/jose/lib/help/secs.js | 53 - .../jose/lib/help/timing_safe_equal.js | 18 - .../node_modules/jose/lib/help/uint64be.js | 10 - .../jose/lib/help/validate_crit.js | 41 - .../scripts/node_modules/jose/lib/index.js | 8 - .../scripts/node_modules/jose/lib/index.mjs | 9 - .../jose/lib/jwa/aes_cbc_hmac_sha2.js | 74 - .../node_modules/jose/lib/jwa/aes_gcm.js | 55 - .../node_modules/jose/lib/jwa/aes_gcm_kw.js | 24 - .../node_modules/jose/lib/jwa/aes_kw.js | 37 - .../jose/lib/jwa/ecdh/compute_secret.js | 43 - .../node_modules/jose/lib/jwa/ecdh/derive.js | 40 - .../node_modules/jose/lib/jwa/ecdh/dir.js | 31 - .../node_modules/jose/lib/jwa/ecdh/kw.js | 47 - .../node_modules/jose/lib/jwa/ecdsa.js | 77 - .../node_modules/jose/lib/jwa/eddsa.js | 24 - .../scripts/node_modules/jose/lib/jwa/hmac.js | 28 - .../node_modules/jose/lib/jwa/index.js | 88 - .../scripts/node_modules/jose/lib/jwa/none.js | 7 - .../node_modules/jose/lib/jwa/pbes2.js | 56 - .../node_modules/jose/lib/jwa/rsaes.js | 67 - .../node_modules/jose/lib/jwa/rsassa.js | 29 - .../node_modules/jose/lib/jwa/rsassa_pss.js | 43 - .../node_modules/jose/lib/jwe/decrypt.js | 235 - .../node_modules/jose/lib/jwe/encrypt.js | 214 - .../node_modules/jose/lib/jwe/generate_cek.js | 15 - .../node_modules/jose/lib/jwe/index.js | 15 - .../node_modules/jose/lib/jwe/serializers.js | 121 - .../jose/lib/jwe/validate_headers.js | 70 - .../node_modules/jose/lib/jwk/generate.js | 53 - .../node_modules/jose/lib/jwk/import.js | 134 - .../node_modules/jose/lib/jwk/index.js | 15 - .../node_modules/jose/lib/jwk/key/base.js | 339 - .../node_modules/jose/lib/jwk/key/ec.js | 110 - .../jose/lib/jwk/key/embedded.jwk.js | 27 - .../jose/lib/jwk/key/embedded.x5c.js | 27 - .../node_modules/jose/lib/jwk/key/none.js | 34 - .../node_modules/jose/lib/jwk/key/oct.js | 103 - .../node_modules/jose/lib/jwk/key/okp.js | 86 - .../node_modules/jose/lib/jwk/key/rsa.js | 117 - .../node_modules/jose/lib/jwk/thumbprint.js | 9 - .../node_modules/jose/lib/jwks/index.js | 3 - .../node_modules/jose/lib/jwks/keystore.js | 183 - .../node_modules/jose/lib/jws/index.js | 15 - .../node_modules/jose/lib/jws/serializers.js | 104 - .../scripts/node_modules/jose/lib/jws/sign.js | 130 - .../node_modules/jose/lib/jws/verify.js | 202 - .../node_modules/jose/lib/jwt/decode.js | 30 - .../node_modules/jose/lib/jwt/index.js | 16 - .../node_modules/jose/lib/jwt/profiles.js | 168 - .../jose/lib/jwt/shared_validations.js | 45 - .../scripts/node_modules/jose/lib/jwt/sign.js | 94 - .../node_modules/jose/lib/jwt/verify.js | 186 - .../jose/lib/registry/ec_curves.js | 21 - .../jose/lib/registry/ecdh_derive_lengths.js | 1 - .../node_modules/jose/lib/registry/index.js | 17 - .../jose/lib/registry/iv_lengths.js | 11 - .../node_modules/jose/lib/registry/jwa.js | 8 - .../node_modules/jose/lib/registry/jwk.js | 38 - .../jose/lib/registry/key_lengths.js | 8 - .../jose/lib/registry/okp_curves.js | 9 - .../scripts/node_modules/jose/package.json | 143 - .../node_modules/jose/types/index.d.ts | 544 - .../node_modules/js2xmlparser/CHANGES.md | 133 - .../scripts/node_modules/js2xmlparser/LICENSE | 201 - .../scripts/node_modules/js2xmlparser/NOTICE | 10 - .../node_modules/js2xmlparser/README.md | 155 - .../node_modules/js2xmlparser/lib/main.d.ts | 49 - .../node_modules/js2xmlparser/lib/main.js | 282 - .../js2xmlparser/lib/options.d.ts | 477 - .../node_modules/js2xmlparser/lib/options.js | 155 - .../node_modules/js2xmlparser/lib/utils.d.ts | 32 - .../node_modules/js2xmlparser/lib/utils.js | 67 - .../node_modules/js2xmlparser/package.json | 65 - .../node_modules/jsdoc/Apache_License_2.0.txt | 202 - .../scripts/node_modules/jsdoc/LICENSE.md | 102 - .../scripts/node_modules/jsdoc/README.md | 100 - .../example/scripts/node_modules/jsdoc/cli.js | 465 - .../node_modules/jsdoc/conf.json.EXAMPLE | 17 - .../scripts/node_modules/jsdoc/jsdoc.js | 94 - .../node_modules/jsdoc/lib/jsdoc/app.js | 19 - .../node_modules/jsdoc/lib/jsdoc/augment.js | 608 - .../node_modules/jsdoc/lib/jsdoc/borrow.js | 52 - .../node_modules/jsdoc/lib/jsdoc/config.js | 74 - .../node_modules/jsdoc/lib/jsdoc/doclet.js | 562 - .../node_modules/jsdoc/lib/jsdoc/env.js | 77 - .../node_modules/jsdoc/lib/jsdoc/fs.js | 109 - .../node_modules/jsdoc/lib/jsdoc/name.js | 595 - .../jsdoc/lib/jsdoc/opts/argparser.js | 306 - .../node_modules/jsdoc/lib/jsdoc/opts/args.js | 82 - .../node_modules/jsdoc/lib/jsdoc/package.js | 257 - .../node_modules/jsdoc/lib/jsdoc/path.js | 169 - .../node_modules/jsdoc/lib/jsdoc/plugins.js | 35 - .../node_modules/jsdoc/lib/jsdoc/readme.js | 24 - .../node_modules/jsdoc/lib/jsdoc/schema.js | 664 - .../jsdoc/lib/jsdoc/src/astbuilder.js | 72 - .../jsdoc/lib/jsdoc/src/astnode.js | 555 - .../jsdoc/lib/jsdoc/src/filter.js | 63 - .../jsdoc/lib/jsdoc/src/handlers.js | 372 - .../jsdoc/lib/jsdoc/src/parser.js | 673 - .../jsdoc/lib/jsdoc/src/scanner.js | 62 - .../jsdoc/lib/jsdoc/src/syntax.js | 96 - .../jsdoc/lib/jsdoc/src/visitor.js | 859 - .../jsdoc/lib/jsdoc/src/walker.js | 704 - .../node_modules/jsdoc/lib/jsdoc/tag.js | 198 - .../jsdoc/lib/jsdoc/tag/dictionary.js | 120 - .../lib/jsdoc/tag/dictionary/definitions.js | 1089 - .../jsdoc/lib/jsdoc/tag/inline.js | 135 - .../node_modules/jsdoc/lib/jsdoc/tag/type.js | 306 - .../jsdoc/lib/jsdoc/tag/validator.js | 51 - .../node_modules/jsdoc/lib/jsdoc/template.js | 80 - .../node_modules/jsdoc/lib/jsdoc/tutorial.js | 153 - .../jsdoc/lib/jsdoc/tutorial/resolver.js | 183 - .../node_modules/jsdoc/lib/jsdoc/util/cast.js | 95 - .../node_modules/jsdoc/lib/jsdoc/util/doop.js | 79 - .../jsdoc/lib/jsdoc/util/dumper.js | 146 - .../jsdoc/lib/jsdoc/util/error.js | 32 - .../jsdoc/lib/jsdoc/util/logger.js | 254 - .../jsdoc/lib/jsdoc/util/markdown.js | 282 - .../jsdoc/lib/jsdoc/util/stripbom.js | 14 - .../jsdoc/lib/jsdoc/util/templateHelper.js | 1018 - .../scripts/node_modules/jsdoc/package.json | 80 - .../jsdoc/plugins/commentConvert.js | 21 - .../jsdoc/plugins/commentsOnly.js | 17 - .../node_modules/jsdoc/plugins/escapeHtml.js | 18 - .../node_modules/jsdoc/plugins/eventDumper.js | 98 - .../node_modules/jsdoc/plugins/markdown.js | 88 - .../jsdoc/plugins/overloadHelper.js | 181 - .../node_modules/jsdoc/plugins/partial.js | 30 - .../jsdoc/plugins/railsTemplate.js | 19 - .../node_modules/jsdoc/plugins/shout.js | 15 - .../node_modules/jsdoc/plugins/sourcetag.js | 49 - .../node_modules/jsdoc/plugins/summarize.js | 58 - .../jsdoc/plugins/test/fixtures/markdown.js | 31 - .../plugins/test/fixtures/overloadHelper.js | 50 - .../test/fixtures/railsTemplate.js.erb | 19 - .../jsdoc/plugins/test/fixtures/underscore.js | 22 - .../plugins/test/specs/commentConvert.js | 20 - .../jsdoc/plugins/test/specs/escapeHtml.js | 20 - .../jsdoc/plugins/test/specs/markdown.js | 60 - .../plugins/test/specs/overloadHelper.js | 102 - .../jsdoc/plugins/test/specs/railsTemplate.js | 19 - .../jsdoc/plugins/test/specs/shout.js | 20 - .../jsdoc/plugins/test/specs/sourcetag.js | 22 - .../jsdoc/plugins/test/specs/summarize.js | 112 - .../jsdoc/plugins/test/specs/underscore.js | 35 - .../node_modules/jsdoc/plugins/underscore.js | 16 - .../node_modules/jsdoc/templates/README.md | 27 - .../jsdoc/templates/default/README.md | 12 - .../jsdoc/templates/default/publish.js | 692 - .../static/fonts/OpenSans-Bold-webfont.eot | Bin 19544 -> 0 bytes .../static/fonts/OpenSans-Bold-webfont.svg | 1830 -- .../static/fonts/OpenSans-Bold-webfont.woff | Bin 22432 -> 0 bytes .../fonts/OpenSans-BoldItalic-webfont.eot | Bin 20133 -> 0 bytes .../fonts/OpenSans-BoldItalic-webfont.svg | 1830 -- .../fonts/OpenSans-BoldItalic-webfont.woff | Bin 23048 -> 0 bytes .../static/fonts/OpenSans-Italic-webfont.eot | Bin 20265 -> 0 bytes .../static/fonts/OpenSans-Italic-webfont.svg | 1830 -- .../static/fonts/OpenSans-Italic-webfont.woff | Bin 23188 -> 0 bytes .../static/fonts/OpenSans-Light-webfont.eot | Bin 19514 -> 0 bytes .../static/fonts/OpenSans-Light-webfont.svg | 1831 -- .../static/fonts/OpenSans-Light-webfont.woff | Bin 22248 -> 0 bytes .../fonts/OpenSans-LightItalic-webfont.eot | Bin 20535 -> 0 bytes .../fonts/OpenSans-LightItalic-webfont.svg | 1835 -- .../fonts/OpenSans-LightItalic-webfont.woff | Bin 23400 -> 0 bytes .../static/fonts/OpenSans-Regular-webfont.eot | Bin 19836 -> 0 bytes .../static/fonts/OpenSans-Regular-webfont.svg | 1831 -- .../fonts/OpenSans-Regular-webfont.woff | Bin 22660 -> 0 bytes .../default/static/scripts/linenumber.js | 25 - .../scripts/prettify/Apache-License-2.0.txt | 202 - .../static/scripts/prettify/lang-css.js | 2 - .../static/scripts/prettify/prettify.js | 28 - .../default/static/styles/jsdoc-default.css | 358 - .../default/static/styles/prettify-jsdoc.css | 111 - .../static/styles/prettify-tomorrow.css | 132 - .../templates/default/tmpl/augments.tmpl | 10 - .../templates/default/tmpl/container.tmpl | 196 - .../jsdoc/templates/default/tmpl/details.tmpl | 143 - .../jsdoc/templates/default/tmpl/example.tmpl | 2 - .../templates/default/tmpl/examples.tmpl | 13 - .../templates/default/tmpl/exceptions.tmpl | 32 - .../jsdoc/templates/default/tmpl/layout.tmpl | 38 - .../templates/default/tmpl/mainpage.tmpl | 14 - .../jsdoc/templates/default/tmpl/members.tmpl | 38 - .../jsdoc/templates/default/tmpl/method.tmpl | 131 - .../templates/default/tmpl/modifies.tmpl | 14 - .../jsdoc/templates/default/tmpl/params.tmpl | 131 - .../templates/default/tmpl/properties.tmpl | 108 - .../jsdoc/templates/default/tmpl/returns.tmpl | 19 - .../jsdoc/templates/default/tmpl/source.tmpl | 8 - .../templates/default/tmpl/tutorial.tmpl | 19 - .../jsdoc/templates/default/tmpl/type.tmpl | 7 - .../jsdoc/templates/haruki/README.md | 39 - .../jsdoc/templates/haruki/publish.js | 224 - .../jsdoc/templates/silent/README.md | 11 - .../jsdoc/templates/silent/publish.js | 7 - .../scripts/node_modules/json-bigint/LICENSE | 20 - .../node_modules/json-bigint/README.md | 240 - .../scripts/node_modules/json-bigint/index.js | 12 - .../node_modules/json-bigint/lib/parse.js | 443 - .../node_modules/json-bigint/lib/stringify.js | 384 - .../node_modules/json-bigint/package.json | 34 - .../node_modules/jsonwebtoken/CHANGELOG.md | 476 - .../scripts/node_modules/jsonwebtoken/LICENSE | 21 - .../node_modules/jsonwebtoken/README.md | 375 - .../node_modules/jsonwebtoken/decode.js | 30 - .../node_modules/jsonwebtoken/index.js | 8 - .../jsonwebtoken/lib/JsonWebTokenError.js | 14 - .../jsonwebtoken/lib/NotBeforeError.js | 13 - .../jsonwebtoken/lib/TokenExpiredError.js | 13 - .../jsonwebtoken/lib/psSupported.js | 3 - .../node_modules/jsonwebtoken/lib/timespan.js | 18 - .../jsonwebtoken/node_modules/jwa/LICENSE | 17 - .../jsonwebtoken/node_modules/jwa/README.md | 150 - .../jsonwebtoken/node_modules/jwa/index.js | 252 - .../node_modules/jwa/package.json | 37 - .../node_modules/jws/CHANGELOG.md | 34 - .../jsonwebtoken/node_modules/jws/LICENSE | 17 - .../jsonwebtoken/node_modules/jws/index.js | 22 - .../node_modules/jws/lib/data-stream.js | 55 - .../node_modules/jws/lib/sign-stream.js | 78 - .../node_modules/jws/lib/tostring.js | 10 - .../node_modules/jws/lib/verify-stream.js | 120 - .../node_modules/jws/package.json | 34 - .../jsonwebtoken/node_modules/jws/readme.md | 255 - .../node_modules/jsonwebtoken/package.json | 71 - .../scripts/node_modules/jsonwebtoken/sign.js | 206 - .../node_modules/jsonwebtoken/verify.js | 225 - .../example/scripts/node_modules/jwa/LICENSE | 17 - .../scripts/node_modules/jwa/README.md | 150 - .../example/scripts/node_modules/jwa/index.js | 252 - .../scripts/node_modules/jwa/package.json | 37 - .../scripts/node_modules/jwks-rsa/LICENSE | 21 - .../scripts/node_modules/jwks-rsa/README.md | 171 - .../scripts/node_modules/jwks-rsa/index.d.ts | 130 - .../node_modules/jwks-rsa/package.json | 72 - .../node_modules/jwks-rsa/src/JwksClient.js | 91 - .../jwks-rsa/src/errors/ArgumentError.js | 10 - .../jwks-rsa/src/errors/JwksError.js | 10 - .../jwks-rsa/src/errors/JwksRateLimitError.js | 10 - .../src/errors/SigningKeyNotFoundError.js | 10 - .../node_modules/jwks-rsa/src/errors/index.js | 6 - .../node_modules/jwks-rsa/src/index.js | 22 - .../jwks-rsa/src/integrations/config.js | 15 - .../jwks-rsa/src/integrations/express.js | 60 - .../jwks-rsa/src/integrations/hapi.js | 59 - .../jwks-rsa/src/integrations/koa.js | 30 - .../jwks-rsa/src/integrations/passport.js | 49 - .../node_modules/jwks-rsa/src/utils.js | 19 - .../jwks-rsa/src/wrappers/cache.js | 15 - .../jwks-rsa/src/wrappers/callbackSupport.js | 16 - .../jwks-rsa/src/wrappers/index.js | 7 - .../jwks-rsa/src/wrappers/interceptor.js | 30 - .../jwks-rsa/src/wrappers/rateLimit.js | 34 - .../jwks-rsa/src/wrappers/request.js | 52 - .../scripts/node_modules/jws/CHANGELOG.md | 34 - .../example/scripts/node_modules/jws/LICENSE | 17 - .../example/scripts/node_modules/jws/index.js | 22 - .../node_modules/jws/lib/data-stream.js | 55 - .../node_modules/jws/lib/sign-stream.js | 78 - .../scripts/node_modules/jws/lib/tostring.js | 10 - .../node_modules/jws/lib/verify-stream.js | 120 - .../scripts/node_modules/jws/package.json | 34 - .../scripts/node_modules/jws/readme.md | 255 - .../scripts/node_modules/klaw/CHANGELOG.md | 68 - .../example/scripts/node_modules/klaw/LICENSE | 15 - .../scripts/node_modules/klaw/README.md | 253 - .../scripts/node_modules/klaw/package.json | 40 - .../scripts/node_modules/klaw/src/index.js | 64 - .../example/scripts/node_modules/levn/LICENSE | 22 - .../scripts/node_modules/levn/README.md | 196 - .../scripts/node_modules/levn/lib/cast.js | 298 - .../scripts/node_modules/levn/lib/coerce.js | 285 - .../scripts/node_modules/levn/lib/index.js | 22 - .../node_modules/levn/lib/parse-string.js | 113 - .../scripts/node_modules/levn/lib/parse.js | 102 - .../scripts/node_modules/levn/package.json | 47 - .../scripts/node_modules/limiter/.travis.yml | 9 - .../scripts/node_modules/limiter/LICENSE.txt | 19 - .../scripts/node_modules/limiter/README.md | 140 - .../scripts/node_modules/limiter/bower.json | 22 - .../scripts/node_modules/limiter/index.d.ts | 22 - .../scripts/node_modules/limiter/index.js | 3 - .../scripts/node_modules/limiter/lib/clock.js | 13 - .../node_modules/limiter/lib/rateLimiter.js | 137 - .../node_modules/limiter/lib/tokenBucket.js | 167 - .../scripts/node_modules/limiter/package.json | 25 - .../limiter/test/ratelimiter-test.js | 20 - .../limiter/test/tokenbucket-test.js | 67 - .../node_modules/linkify-it/CHANGELOG.md | 182 - .../scripts/node_modules/linkify-it/LICENSE | 22 - .../scripts/node_modules/linkify-it/README.md | 188 - .../scripts/node_modules/linkify-it/index.js | 636 - .../scripts/node_modules/linkify-it/lib/re.js | 181 - .../node_modules/linkify-it/package.json | 48 - .../node_modules/lodash.camelcase/LICENSE | 47 - .../node_modules/lodash.camelcase/README.md | 18 - .../node_modules/lodash.camelcase/index.js | 599 - .../lodash.camelcase/package.json | 17 - .../node_modules/lodash.clonedeep/LICENSE | 47 - .../node_modules/lodash.clonedeep/README.md | 18 - .../node_modules/lodash.clonedeep/index.js | 1748 -- .../lodash.clonedeep/package.json | 17 - .../node_modules/lodash.includes/LICENSE | 47 - .../node_modules/lodash.includes/README.md | 18 - .../node_modules/lodash.includes/index.js | 745 - .../node_modules/lodash.includes/package.json | 17 - .../node_modules/lodash.isboolean/LICENSE | 22 - .../node_modules/lodash.isboolean/README.md | 18 - .../node_modules/lodash.isboolean/index.js | 70 - .../lodash.isboolean/package.json | 17 - .../node_modules/lodash.isinteger/LICENSE | 47 - .../node_modules/lodash.isinteger/README.md | 18 - .../node_modules/lodash.isinteger/index.js | 265 - .../lodash.isinteger/package.json | 17 - .../node_modules/lodash.isnumber/LICENSE | 22 - .../node_modules/lodash.isnumber/README.md | 18 - .../node_modules/lodash.isnumber/index.js | 79 - .../node_modules/lodash.isnumber/package.json | 17 - .../node_modules/lodash.isplainobject/LICENSE | 47 - .../lodash.isplainobject/README.md | 18 - .../lodash.isplainobject/index.js | 139 - .../lodash.isplainobject/package.json | 17 - .../node_modules/lodash.isstring/LICENSE | 22 - .../node_modules/lodash.isstring/README.md | 18 - .../node_modules/lodash.isstring/index.js | 95 - .../node_modules/lodash.isstring/package.json | 17 - .../scripts/node_modules/lodash.once/LICENSE | 47 - .../node_modules/lodash.once/README.md | 18 - .../scripts/node_modules/lodash.once/index.js | 294 - .../node_modules/lodash.once/package.json | 17 - .../scripts/node_modules/lodash/LICENSE | 47 - .../scripts/node_modules/lodash/README.md | 39 - .../scripts/node_modules/lodash/_DataView.js | 7 - .../scripts/node_modules/lodash/_Hash.js | 32 - .../node_modules/lodash/_LazyWrapper.js | 28 - .../scripts/node_modules/lodash/_ListCache.js | 32 - .../node_modules/lodash/_LodashWrapper.js | 22 - .../scripts/node_modules/lodash/_Map.js | 7 - .../scripts/node_modules/lodash/_MapCache.js | 32 - .../scripts/node_modules/lodash/_Promise.js | 7 - .../scripts/node_modules/lodash/_Set.js | 7 - .../scripts/node_modules/lodash/_SetCache.js | 27 - .../scripts/node_modules/lodash/_Stack.js | 27 - .../scripts/node_modules/lodash/_Symbol.js | 6 - .../node_modules/lodash/_Uint8Array.js | 6 - .../scripts/node_modules/lodash/_WeakMap.js | 7 - .../scripts/node_modules/lodash/_apply.js | 21 - .../node_modules/lodash/_arrayAggregator.js | 22 - .../scripts/node_modules/lodash/_arrayEach.js | 22 - .../node_modules/lodash/_arrayEachRight.js | 21 - .../node_modules/lodash/_arrayEvery.js | 23 - .../node_modules/lodash/_arrayFilter.js | 25 - .../node_modules/lodash/_arrayIncludes.js | 17 - .../node_modules/lodash/_arrayIncludesWith.js | 22 - .../node_modules/lodash/_arrayLikeKeys.js | 49 - .../scripts/node_modules/lodash/_arrayMap.js | 21 - .../scripts/node_modules/lodash/_arrayPush.js | 20 - .../node_modules/lodash/_arrayReduce.js | 26 - .../node_modules/lodash/_arrayReduceRight.js | 24 - .../node_modules/lodash/_arraySample.js | 15 - .../node_modules/lodash/_arraySampleSize.js | 17 - .../node_modules/lodash/_arrayShuffle.js | 15 - .../scripts/node_modules/lodash/_arraySome.js | 23 - .../scripts/node_modules/lodash/_asciiSize.js | 12 - .../node_modules/lodash/_asciiToArray.js | 12 - .../node_modules/lodash/_asciiWords.js | 15 - .../node_modules/lodash/_assignMergeValue.js | 20 - .../node_modules/lodash/_assignValue.js | 28 - .../node_modules/lodash/_assocIndexOf.js | 21 - .../node_modules/lodash/_baseAggregator.js | 21 - .../node_modules/lodash/_baseAssign.js | 17 - .../node_modules/lodash/_baseAssignIn.js | 17 - .../node_modules/lodash/_baseAssignValue.js | 25 - .../scripts/node_modules/lodash/_baseAt.js | 23 - .../scripts/node_modules/lodash/_baseClamp.js | 22 - .../scripts/node_modules/lodash/_baseClone.js | 166 - .../node_modules/lodash/_baseConforms.js | 18 - .../node_modules/lodash/_baseConformsTo.js | 27 - .../node_modules/lodash/_baseCreate.js | 30 - .../scripts/node_modules/lodash/_baseDelay.js | 21 - .../node_modules/lodash/_baseDifference.js | 67 - .../scripts/node_modules/lodash/_baseEach.js | 14 - .../node_modules/lodash/_baseEachRight.js | 14 - .../scripts/node_modules/lodash/_baseEvery.js | 21 - .../node_modules/lodash/_baseExtremum.js | 32 - .../scripts/node_modules/lodash/_baseFill.js | 32 - .../node_modules/lodash/_baseFilter.js | 21 - .../node_modules/lodash/_baseFindIndex.js | 24 - .../node_modules/lodash/_baseFindKey.js | 23 - .../node_modules/lodash/_baseFlatten.js | 38 - .../scripts/node_modules/lodash/_baseFor.js | 16 - .../node_modules/lodash/_baseForOwn.js | 16 - .../node_modules/lodash/_baseForOwnRight.js | 16 - .../node_modules/lodash/_baseForRight.js | 15 - .../node_modules/lodash/_baseFunctions.js | 19 - .../scripts/node_modules/lodash/_baseGet.js | 24 - .../node_modules/lodash/_baseGetAllKeys.js | 20 - .../node_modules/lodash/_baseGetTag.js | 28 - .../scripts/node_modules/lodash/_baseGt.js | 14 - .../scripts/node_modules/lodash/_baseHas.js | 19 - .../scripts/node_modules/lodash/_baseHasIn.js | 13 - .../node_modules/lodash/_baseInRange.js | 18 - .../node_modules/lodash/_baseIndexOf.js | 20 - .../node_modules/lodash/_baseIndexOfWith.js | 23 - .../node_modules/lodash/_baseIntersection.js | 74 - .../node_modules/lodash/_baseInverter.js | 21 - .../node_modules/lodash/_baseInvoke.js | 24 - .../node_modules/lodash/_baseIsArguments.js | 18 - .../node_modules/lodash/_baseIsArrayBuffer.js | 17 - .../node_modules/lodash/_baseIsDate.js | 18 - .../node_modules/lodash/_baseIsEqual.js | 28 - .../node_modules/lodash/_baseIsEqualDeep.js | 83 - .../scripts/node_modules/lodash/_baseIsMap.js | 18 - .../node_modules/lodash/_baseIsMatch.js | 62 - .../scripts/node_modules/lodash/_baseIsNaN.js | 12 - .../node_modules/lodash/_baseIsNative.js | 47 - .../node_modules/lodash/_baseIsRegExp.js | 18 - .../scripts/node_modules/lodash/_baseIsSet.js | 18 - .../node_modules/lodash/_baseIsTypedArray.js | 60 - .../node_modules/lodash/_baseIteratee.js | 31 - .../scripts/node_modules/lodash/_baseKeys.js | 30 - .../node_modules/lodash/_baseKeysIn.js | 33 - .../node_modules/lodash/_baseLodash.js | 10 - .../scripts/node_modules/lodash/_baseLt.js | 14 - .../scripts/node_modules/lodash/_baseMap.js | 22 - .../node_modules/lodash/_baseMatches.js | 22 - .../lodash/_baseMatchesProperty.js | 33 - .../scripts/node_modules/lodash/_baseMean.js | 20 - .../scripts/node_modules/lodash/_baseMerge.js | 42 - .../node_modules/lodash/_baseMergeDeep.js | 94 - .../scripts/node_modules/lodash/_baseNth.js | 20 - .../node_modules/lodash/_baseOrderBy.js | 49 - .../scripts/node_modules/lodash/_basePick.js | 19 - .../node_modules/lodash/_basePickBy.js | 30 - .../node_modules/lodash/_baseProperty.js | 14 - .../node_modules/lodash/_basePropertyDeep.js | 16 - .../node_modules/lodash/_basePropertyOf.js | 14 - .../node_modules/lodash/_basePullAll.js | 51 - .../node_modules/lodash/_basePullAt.js | 37 - .../node_modules/lodash/_baseRandom.js | 18 - .../scripts/node_modules/lodash/_baseRange.js | 28 - .../node_modules/lodash/_baseReduce.js | 23 - .../node_modules/lodash/_baseRepeat.js | 35 - .../scripts/node_modules/lodash/_baseRest.js | 17 - .../node_modules/lodash/_baseSample.js | 15 - .../node_modules/lodash/_baseSampleSize.js | 18 - .../scripts/node_modules/lodash/_baseSet.js | 51 - .../node_modules/lodash/_baseSetData.js | 17 - .../node_modules/lodash/_baseSetToString.js | 22 - .../node_modules/lodash/_baseShuffle.js | 15 - .../scripts/node_modules/lodash/_baseSlice.js | 31 - .../scripts/node_modules/lodash/_baseSome.js | 22 - .../node_modules/lodash/_baseSortBy.js | 21 - .../node_modules/lodash/_baseSortedIndex.js | 42 - .../node_modules/lodash/_baseSortedIndexBy.js | 67 - .../node_modules/lodash/_baseSortedUniq.js | 30 - .../scripts/node_modules/lodash/_baseSum.js | 24 - .../scripts/node_modules/lodash/_baseTimes.js | 20 - .../node_modules/lodash/_baseToNumber.js | 24 - .../node_modules/lodash/_baseToPairs.js | 18 - .../node_modules/lodash/_baseToString.js | 37 - .../scripts/node_modules/lodash/_baseTrim.js | 19 - .../scripts/node_modules/lodash/_baseUnary.js | 14 - .../scripts/node_modules/lodash/_baseUniq.js | 72 - .../scripts/node_modules/lodash/_baseUnset.js | 20 - .../node_modules/lodash/_baseUpdate.js | 18 - .../node_modules/lodash/_baseValues.js | 19 - .../scripts/node_modules/lodash/_baseWhile.js | 26 - .../node_modules/lodash/_baseWrapperValue.js | 25 - .../scripts/node_modules/lodash/_baseXor.js | 36 - .../node_modules/lodash/_baseZipObject.js | 23 - .../scripts/node_modules/lodash/_cacheHas.js | 13 - .../lodash/_castArrayLikeObject.js | 14 - .../node_modules/lodash/_castFunction.js | 14 - .../scripts/node_modules/lodash/_castPath.js | 21 - .../scripts/node_modules/lodash/_castRest.js | 14 - .../scripts/node_modules/lodash/_castSlice.js | 18 - .../node_modules/lodash/_charsEndIndex.js | 19 - .../node_modules/lodash/_charsStartIndex.js | 20 - .../node_modules/lodash/_cloneArrayBuffer.js | 16 - .../node_modules/lodash/_cloneBuffer.js | 35 - .../node_modules/lodash/_cloneDataView.js | 16 - .../node_modules/lodash/_cloneRegExp.js | 17 - .../node_modules/lodash/_cloneSymbol.js | 18 - .../node_modules/lodash/_cloneTypedArray.js | 16 - .../node_modules/lodash/_compareAscending.js | 41 - .../node_modules/lodash/_compareMultiple.js | 44 - .../node_modules/lodash/_composeArgs.js | 39 - .../node_modules/lodash/_composeArgsRight.js | 41 - .../scripts/node_modules/lodash/_copyArray.js | 20 - .../node_modules/lodash/_copyObject.js | 40 - .../node_modules/lodash/_copySymbols.js | 16 - .../node_modules/lodash/_copySymbolsIn.js | 16 - .../node_modules/lodash/_coreJsData.js | 6 - .../node_modules/lodash/_countHolders.js | 21 - .../node_modules/lodash/_createAggregator.js | 23 - .../node_modules/lodash/_createAssigner.js | 37 - .../node_modules/lodash/_createBaseEach.js | 32 - .../node_modules/lodash/_createBaseFor.js | 25 - .../node_modules/lodash/_createBind.js | 28 - .../node_modules/lodash/_createCaseFirst.js | 33 - .../node_modules/lodash/_createCompounder.js | 24 - .../node_modules/lodash/_createCtor.js | 37 - .../node_modules/lodash/_createCurry.js | 46 - .../node_modules/lodash/_createFind.js | 25 - .../node_modules/lodash/_createFlow.js | 78 - .../node_modules/lodash/_createHybrid.js | 92 - .../node_modules/lodash/_createInverter.js | 17 - .../lodash/_createMathOperation.js | 38 - .../node_modules/lodash/_createOver.js | 27 - .../node_modules/lodash/_createPadding.js | 33 - .../node_modules/lodash/_createPartial.js | 43 - .../node_modules/lodash/_createRange.js | 30 - .../node_modules/lodash/_createRecurry.js | 56 - .../lodash/_createRelationalOperation.js | 20 - .../node_modules/lodash/_createRound.js | 35 - .../scripts/node_modules/lodash/_createSet.js | 19 - .../node_modules/lodash/_createToPairs.js | 30 - .../node_modules/lodash/_createWrap.js | 106 - .../lodash/_customDefaultsAssignIn.js | 29 - .../lodash/_customDefaultsMerge.js | 28 - .../node_modules/lodash/_customOmitClone.js | 16 - .../node_modules/lodash/_deburrLetter.js | 71 - .../node_modules/lodash/_defineProperty.js | 11 - .../node_modules/lodash/_equalArrays.js | 84 - .../node_modules/lodash/_equalByTag.js | 112 - .../node_modules/lodash/_equalObjects.js | 90 - .../node_modules/lodash/_escapeHtmlChar.js | 21 - .../node_modules/lodash/_escapeStringChar.js | 22 - .../scripts/node_modules/lodash/_flatRest.js | 16 - .../node_modules/lodash/_freeGlobal.js | 4 - .../node_modules/lodash/_getAllKeys.js | 16 - .../node_modules/lodash/_getAllKeysIn.js | 17 - .../scripts/node_modules/lodash/_getData.js | 15 - .../node_modules/lodash/_getFuncName.js | 31 - .../scripts/node_modules/lodash/_getHolder.js | 13 - .../node_modules/lodash/_getMapData.js | 18 - .../node_modules/lodash/_getMatchData.js | 24 - .../scripts/node_modules/lodash/_getNative.js | 17 - .../node_modules/lodash/_getPrototype.js | 6 - .../scripts/node_modules/lodash/_getRawTag.js | 46 - .../node_modules/lodash/_getSymbols.js | 30 - .../node_modules/lodash/_getSymbolsIn.js | 25 - .../scripts/node_modules/lodash/_getTag.js | 58 - .../scripts/node_modules/lodash/_getValue.js | 13 - .../scripts/node_modules/lodash/_getView.js | 33 - .../node_modules/lodash/_getWrapDetails.js | 17 - .../scripts/node_modules/lodash/_hasPath.js | 39 - .../node_modules/lodash/_hasUnicode.js | 26 - .../node_modules/lodash/_hasUnicodeWord.js | 15 - .../scripts/node_modules/lodash/_hashClear.js | 15 - .../node_modules/lodash/_hashDelete.js | 17 - .../scripts/node_modules/lodash/_hashGet.js | 30 - .../scripts/node_modules/lodash/_hashHas.js | 23 - .../scripts/node_modules/lodash/_hashSet.js | 23 - .../node_modules/lodash/_initCloneArray.js | 26 - .../node_modules/lodash/_initCloneByTag.js | 77 - .../node_modules/lodash/_initCloneObject.js | 18 - .../node_modules/lodash/_insertWrapDetails.js | 23 - .../node_modules/lodash/_isFlattenable.js | 20 - .../scripts/node_modules/lodash/_isIndex.js | 25 - .../node_modules/lodash/_isIterateeCall.js | 30 - .../scripts/node_modules/lodash/_isKey.js | 29 - .../scripts/node_modules/lodash/_isKeyable.js | 15 - .../node_modules/lodash/_isLaziable.js | 28 - .../node_modules/lodash/_isMaskable.js | 14 - .../scripts/node_modules/lodash/_isMasked.js | 20 - .../node_modules/lodash/_isPrototype.js | 18 - .../lodash/_isStrictComparable.js | 15 - .../node_modules/lodash/_iteratorToArray.js | 18 - .../scripts/node_modules/lodash/_lazyClone.js | 23 - .../node_modules/lodash/_lazyReverse.js | 23 - .../scripts/node_modules/lodash/_lazyValue.js | 69 - .../node_modules/lodash/_listCacheClear.js | 13 - .../node_modules/lodash/_listCacheDelete.js | 35 - .../node_modules/lodash/_listCacheGet.js | 19 - .../node_modules/lodash/_listCacheHas.js | 16 - .../node_modules/lodash/_listCacheSet.js | 26 - .../node_modules/lodash/_mapCacheClear.js | 21 - .../node_modules/lodash/_mapCacheDelete.js | 18 - .../node_modules/lodash/_mapCacheGet.js | 16 - .../node_modules/lodash/_mapCacheHas.js | 16 - .../node_modules/lodash/_mapCacheSet.js | 22 - .../node_modules/lodash/_mapToArray.js | 18 - .../lodash/_matchesStrictComparable.js | 20 - .../node_modules/lodash/_memoizeCapped.js | 26 - .../scripts/node_modules/lodash/_mergeData.js | 90 - .../scripts/node_modules/lodash/_metaMap.js | 6 - .../node_modules/lodash/_nativeCreate.js | 6 - .../node_modules/lodash/_nativeKeys.js | 6 - .../node_modules/lodash/_nativeKeysIn.js | 20 - .../scripts/node_modules/lodash/_nodeUtil.js | 30 - .../node_modules/lodash/_objectToString.js | 22 - .../scripts/node_modules/lodash/_overArg.js | 15 - .../scripts/node_modules/lodash/_overRest.js | 36 - .../scripts/node_modules/lodash/_parent.js | 16 - .../scripts/node_modules/lodash/_reEscape.js | 4 - .../node_modules/lodash/_reEvaluate.js | 4 - .../node_modules/lodash/_reInterpolate.js | 4 - .../scripts/node_modules/lodash/_realNames.js | 4 - .../scripts/node_modules/lodash/_reorder.js | 29 - .../node_modules/lodash/_replaceHolders.js | 29 - .../scripts/node_modules/lodash/_root.js | 9 - .../scripts/node_modules/lodash/_safeGet.js | 21 - .../node_modules/lodash/_setCacheAdd.js | 19 - .../node_modules/lodash/_setCacheHas.js | 14 - .../scripts/node_modules/lodash/_setData.js | 20 - .../node_modules/lodash/_setToArray.js | 18 - .../node_modules/lodash/_setToPairs.js | 18 - .../node_modules/lodash/_setToString.js | 14 - .../node_modules/lodash/_setWrapToString.js | 21 - .../scripts/node_modules/lodash/_shortOut.js | 37 - .../node_modules/lodash/_shuffleSelf.js | 28 - .../node_modules/lodash/_stackClear.js | 15 - .../node_modules/lodash/_stackDelete.js | 18 - .../scripts/node_modules/lodash/_stackGet.js | 14 - .../scripts/node_modules/lodash/_stackHas.js | 14 - .../scripts/node_modules/lodash/_stackSet.js | 34 - .../node_modules/lodash/_strictIndexOf.js | 23 - .../node_modules/lodash/_strictLastIndexOf.js | 21 - .../node_modules/lodash/_stringSize.js | 18 - .../node_modules/lodash/_stringToArray.js | 18 - .../node_modules/lodash/_stringToPath.js | 27 - .../scripts/node_modules/lodash/_toKey.js | 21 - .../scripts/node_modules/lodash/_toSource.js | 26 - .../node_modules/lodash/_trimmedEndIndex.js | 19 - .../node_modules/lodash/_unescapeHtmlChar.js | 21 - .../node_modules/lodash/_unicodeSize.js | 44 - .../node_modules/lodash/_unicodeToArray.js | 40 - .../node_modules/lodash/_unicodeWords.js | 69 - .../node_modules/lodash/_updateWrapDetails.js | 46 - .../node_modules/lodash/_wrapperClone.js | 23 - .../scripts/node_modules/lodash/add.js | 22 - .../scripts/node_modules/lodash/after.js | 42 - .../scripts/node_modules/lodash/array.js | 67 - .../scripts/node_modules/lodash/ary.js | 29 - .../scripts/node_modules/lodash/assign.js | 58 - .../scripts/node_modules/lodash/assignIn.js | 40 - .../node_modules/lodash/assignInWith.js | 38 - .../scripts/node_modules/lodash/assignWith.js | 37 - .../example/scripts/node_modules/lodash/at.js | 23 - .../scripts/node_modules/lodash/attempt.js | 35 - .../scripts/node_modules/lodash/before.js | 40 - .../scripts/node_modules/lodash/bind.js | 57 - .../scripts/node_modules/lodash/bindAll.js | 41 - .../scripts/node_modules/lodash/bindKey.js | 68 - .../scripts/node_modules/lodash/camelCase.js | 29 - .../scripts/node_modules/lodash/capitalize.js | 23 - .../scripts/node_modules/lodash/castArray.js | 44 - .../scripts/node_modules/lodash/ceil.js | 26 - .../scripts/node_modules/lodash/chain.js | 38 - .../scripts/node_modules/lodash/chunk.js | 50 - .../scripts/node_modules/lodash/clamp.js | 39 - .../scripts/node_modules/lodash/clone.js | 36 - .../scripts/node_modules/lodash/cloneDeep.js | 29 - .../node_modules/lodash/cloneDeepWith.js | 40 - .../scripts/node_modules/lodash/cloneWith.js | 42 - .../scripts/node_modules/lodash/collection.js | 30 - .../scripts/node_modules/lodash/commit.js | 33 - .../scripts/node_modules/lodash/compact.js | 31 - .../scripts/node_modules/lodash/concat.js | 43 - .../scripts/node_modules/lodash/cond.js | 60 - .../scripts/node_modules/lodash/conforms.js | 35 - .../scripts/node_modules/lodash/conformsTo.js | 32 - .../scripts/node_modules/lodash/constant.js | 26 - .../scripts/node_modules/lodash/core.js | 3877 ---- .../scripts/node_modules/lodash/core.min.js | 29 - .../scripts/node_modules/lodash/countBy.js | 40 - .../scripts/node_modules/lodash/create.js | 43 - .../scripts/node_modules/lodash/curry.js | 57 - .../scripts/node_modules/lodash/curryRight.js | 54 - .../scripts/node_modules/lodash/date.js | 3 - .../scripts/node_modules/lodash/debounce.js | 191 - .../scripts/node_modules/lodash/deburr.js | 45 - .../scripts/node_modules/lodash/defaultTo.js | 25 - .../scripts/node_modules/lodash/defaults.js | 64 - .../node_modules/lodash/defaultsDeep.js | 30 - .../scripts/node_modules/lodash/defer.js | 26 - .../scripts/node_modules/lodash/delay.js | 28 - .../scripts/node_modules/lodash/difference.js | 33 - .../node_modules/lodash/differenceBy.js | 44 - .../node_modules/lodash/differenceWith.js | 40 - .../scripts/node_modules/lodash/divide.js | 22 - .../scripts/node_modules/lodash/drop.js | 38 - .../scripts/node_modules/lodash/dropRight.js | 39 - .../node_modules/lodash/dropRightWhile.js | 45 - .../scripts/node_modules/lodash/dropWhile.js | 45 - .../scripts/node_modules/lodash/each.js | 1 - .../scripts/node_modules/lodash/eachRight.js | 1 - .../scripts/node_modules/lodash/endsWith.js | 43 - .../scripts/node_modules/lodash/entries.js | 1 - .../scripts/node_modules/lodash/entriesIn.js | 1 - .../example/scripts/node_modules/lodash/eq.js | 37 - .../scripts/node_modules/lodash/escape.js | 43 - .../node_modules/lodash/escapeRegExp.js | 32 - .../scripts/node_modules/lodash/every.js | 56 - .../scripts/node_modules/lodash/extend.js | 1 - .../scripts/node_modules/lodash/extendWith.js | 1 - .../scripts/node_modules/lodash/fill.js | 45 - .../scripts/node_modules/lodash/filter.js | 52 - .../scripts/node_modules/lodash/find.js | 42 - .../scripts/node_modules/lodash/findIndex.js | 55 - .../scripts/node_modules/lodash/findKey.js | 44 - .../scripts/node_modules/lodash/findLast.js | 25 - .../node_modules/lodash/findLastIndex.js | 59 - .../node_modules/lodash/findLastKey.js | 44 - .../scripts/node_modules/lodash/first.js | 1 - .../scripts/node_modules/lodash/flake.lock | 40 - .../scripts/node_modules/lodash/flake.nix | 20 - .../scripts/node_modules/lodash/flatMap.js | 29 - .../node_modules/lodash/flatMapDeep.js | 31 - .../node_modules/lodash/flatMapDepth.js | 31 - .../scripts/node_modules/lodash/flatten.js | 22 - .../node_modules/lodash/flattenDeep.js | 25 - .../node_modules/lodash/flattenDepth.js | 33 - .../scripts/node_modules/lodash/flip.js | 28 - .../scripts/node_modules/lodash/floor.js | 26 - .../scripts/node_modules/lodash/flow.js | 27 - .../scripts/node_modules/lodash/flowRight.js | 26 - .../scripts/node_modules/lodash/forEach.js | 41 - .../node_modules/lodash/forEachRight.js | 31 - .../scripts/node_modules/lodash/forIn.js | 39 - .../scripts/node_modules/lodash/forInRight.js | 37 - .../scripts/node_modules/lodash/forOwn.js | 36 - .../node_modules/lodash/forOwnRight.js | 34 - .../example/scripts/node_modules/lodash/fp.js | 2 - .../scripts/node_modules/lodash/fp/F.js | 1 - .../scripts/node_modules/lodash/fp/T.js | 1 - .../scripts/node_modules/lodash/fp/__.js | 1 - .../node_modules/lodash/fp/_baseConvert.js | 569 - .../node_modules/lodash/fp/_convertBrowser.js | 18 - .../node_modules/lodash/fp/_falseOptions.js | 7 - .../node_modules/lodash/fp/_mapping.js | 358 - .../scripts/node_modules/lodash/fp/_util.js | 16 - .../scripts/node_modules/lodash/fp/add.js | 5 - .../scripts/node_modules/lodash/fp/after.js | 5 - .../scripts/node_modules/lodash/fp/all.js | 1 - .../scripts/node_modules/lodash/fp/allPass.js | 1 - .../scripts/node_modules/lodash/fp/always.js | 1 - .../scripts/node_modules/lodash/fp/any.js | 1 - .../scripts/node_modules/lodash/fp/anyPass.js | 1 - .../scripts/node_modules/lodash/fp/apply.js | 1 - .../scripts/node_modules/lodash/fp/array.js | 2 - .../scripts/node_modules/lodash/fp/ary.js | 5 - .../scripts/node_modules/lodash/fp/assign.js | 5 - .../node_modules/lodash/fp/assignAll.js | 5 - .../node_modules/lodash/fp/assignAllWith.js | 5 - .../node_modules/lodash/fp/assignIn.js | 5 - .../node_modules/lodash/fp/assignInAll.js | 5 - .../node_modules/lodash/fp/assignInAllWith.js | 5 - .../node_modules/lodash/fp/assignInWith.js | 5 - .../node_modules/lodash/fp/assignWith.js | 5 - .../scripts/node_modules/lodash/fp/assoc.js | 1 - .../node_modules/lodash/fp/assocPath.js | 1 - .../scripts/node_modules/lodash/fp/at.js | 5 - .../scripts/node_modules/lodash/fp/attempt.js | 5 - .../scripts/node_modules/lodash/fp/before.js | 5 - .../scripts/node_modules/lodash/fp/bind.js | 5 - .../scripts/node_modules/lodash/fp/bindAll.js | 5 - .../scripts/node_modules/lodash/fp/bindKey.js | 5 - .../node_modules/lodash/fp/camelCase.js | 5 - .../node_modules/lodash/fp/capitalize.js | 5 - .../node_modules/lodash/fp/castArray.js | 5 - .../scripts/node_modules/lodash/fp/ceil.js | 5 - .../scripts/node_modules/lodash/fp/chain.js | 5 - .../scripts/node_modules/lodash/fp/chunk.js | 5 - .../scripts/node_modules/lodash/fp/clamp.js | 5 - .../scripts/node_modules/lodash/fp/clone.js | 5 - .../node_modules/lodash/fp/cloneDeep.js | 5 - .../node_modules/lodash/fp/cloneDeepWith.js | 5 - .../node_modules/lodash/fp/cloneWith.js | 5 - .../node_modules/lodash/fp/collection.js | 2 - .../scripts/node_modules/lodash/fp/commit.js | 5 - .../scripts/node_modules/lodash/fp/compact.js | 5 - .../node_modules/lodash/fp/complement.js | 1 - .../scripts/node_modules/lodash/fp/compose.js | 1 - .../scripts/node_modules/lodash/fp/concat.js | 5 - .../scripts/node_modules/lodash/fp/cond.js | 5 - .../node_modules/lodash/fp/conforms.js | 1 - .../node_modules/lodash/fp/conformsTo.js | 5 - .../node_modules/lodash/fp/constant.js | 5 - .../node_modules/lodash/fp/contains.js | 1 - .../scripts/node_modules/lodash/fp/convert.js | 18 - .../scripts/node_modules/lodash/fp/countBy.js | 5 - .../scripts/node_modules/lodash/fp/create.js | 5 - .../scripts/node_modules/lodash/fp/curry.js | 5 - .../scripts/node_modules/lodash/fp/curryN.js | 5 - .../node_modules/lodash/fp/curryRight.js | 5 - .../node_modules/lodash/fp/curryRightN.js | 5 - .../scripts/node_modules/lodash/fp/date.js | 2 - .../node_modules/lodash/fp/debounce.js | 5 - .../scripts/node_modules/lodash/fp/deburr.js | 5 - .../node_modules/lodash/fp/defaultTo.js | 5 - .../node_modules/lodash/fp/defaults.js | 5 - .../node_modules/lodash/fp/defaultsAll.js | 5 - .../node_modules/lodash/fp/defaultsDeep.js | 5 - .../node_modules/lodash/fp/defaultsDeepAll.js | 5 - .../scripts/node_modules/lodash/fp/defer.js | 5 - .../scripts/node_modules/lodash/fp/delay.js | 5 - .../node_modules/lodash/fp/difference.js | 5 - .../node_modules/lodash/fp/differenceBy.js | 5 - .../node_modules/lodash/fp/differenceWith.js | 5 - .../scripts/node_modules/lodash/fp/dissoc.js | 1 - .../node_modules/lodash/fp/dissocPath.js | 1 - .../scripts/node_modules/lodash/fp/divide.js | 5 - .../scripts/node_modules/lodash/fp/drop.js | 5 - .../node_modules/lodash/fp/dropLast.js | 1 - .../node_modules/lodash/fp/dropLastWhile.js | 1 - .../node_modules/lodash/fp/dropRight.js | 5 - .../node_modules/lodash/fp/dropRightWhile.js | 5 - .../node_modules/lodash/fp/dropWhile.js | 5 - .../scripts/node_modules/lodash/fp/each.js | 1 - .../node_modules/lodash/fp/eachRight.js | 1 - .../node_modules/lodash/fp/endsWith.js | 5 - .../scripts/node_modules/lodash/fp/entries.js | 1 - .../node_modules/lodash/fp/entriesIn.js | 1 - .../scripts/node_modules/lodash/fp/eq.js | 5 - .../scripts/node_modules/lodash/fp/equals.js | 1 - .../scripts/node_modules/lodash/fp/escape.js | 5 - .../node_modules/lodash/fp/escapeRegExp.js | 5 - .../scripts/node_modules/lodash/fp/every.js | 5 - .../scripts/node_modules/lodash/fp/extend.js | 1 - .../node_modules/lodash/fp/extendAll.js | 1 - .../node_modules/lodash/fp/extendAllWith.js | 1 - .../node_modules/lodash/fp/extendWith.js | 1 - .../scripts/node_modules/lodash/fp/fill.js | 5 - .../scripts/node_modules/lodash/fp/filter.js | 5 - .../scripts/node_modules/lodash/fp/find.js | 5 - .../node_modules/lodash/fp/findFrom.js | 5 - .../node_modules/lodash/fp/findIndex.js | 5 - .../node_modules/lodash/fp/findIndexFrom.js | 5 - .../scripts/node_modules/lodash/fp/findKey.js | 5 - .../node_modules/lodash/fp/findLast.js | 5 - .../node_modules/lodash/fp/findLastFrom.js | 5 - .../node_modules/lodash/fp/findLastIndex.js | 5 - .../lodash/fp/findLastIndexFrom.js | 5 - .../node_modules/lodash/fp/findLastKey.js | 5 - .../scripts/node_modules/lodash/fp/first.js | 1 - .../scripts/node_modules/lodash/fp/flatMap.js | 5 - .../node_modules/lodash/fp/flatMapDeep.js | 5 - .../node_modules/lodash/fp/flatMapDepth.js | 5 - .../scripts/node_modules/lodash/fp/flatten.js | 5 - .../node_modules/lodash/fp/flattenDeep.js | 5 - .../node_modules/lodash/fp/flattenDepth.js | 5 - .../scripts/node_modules/lodash/fp/flip.js | 5 - .../scripts/node_modules/lodash/fp/floor.js | 5 - .../scripts/node_modules/lodash/fp/flow.js | 5 - .../node_modules/lodash/fp/flowRight.js | 5 - .../scripts/node_modules/lodash/fp/forEach.js | 5 - .../node_modules/lodash/fp/forEachRight.js | 5 - .../scripts/node_modules/lodash/fp/forIn.js | 5 - .../node_modules/lodash/fp/forInRight.js | 5 - .../scripts/node_modules/lodash/fp/forOwn.js | 5 - .../node_modules/lodash/fp/forOwnRight.js | 5 - .../node_modules/lodash/fp/fromPairs.js | 5 - .../node_modules/lodash/fp/function.js | 2 - .../node_modules/lodash/fp/functions.js | 5 - .../node_modules/lodash/fp/functionsIn.js | 5 - .../scripts/node_modules/lodash/fp/get.js | 5 - .../scripts/node_modules/lodash/fp/getOr.js | 5 - .../scripts/node_modules/lodash/fp/groupBy.js | 5 - .../scripts/node_modules/lodash/fp/gt.js | 5 - .../scripts/node_modules/lodash/fp/gte.js | 5 - .../scripts/node_modules/lodash/fp/has.js | 5 - .../scripts/node_modules/lodash/fp/hasIn.js | 5 - .../scripts/node_modules/lodash/fp/head.js | 5 - .../node_modules/lodash/fp/identical.js | 1 - .../node_modules/lodash/fp/identity.js | 5 - .../scripts/node_modules/lodash/fp/inRange.js | 5 - .../node_modules/lodash/fp/includes.js | 5 - .../node_modules/lodash/fp/includesFrom.js | 5 - .../scripts/node_modules/lodash/fp/indexBy.js | 1 - .../scripts/node_modules/lodash/fp/indexOf.js | 5 - .../node_modules/lodash/fp/indexOfFrom.js | 5 - .../scripts/node_modules/lodash/fp/init.js | 1 - .../scripts/node_modules/lodash/fp/initial.js | 5 - .../node_modules/lodash/fp/intersection.js | 5 - .../node_modules/lodash/fp/intersectionBy.js | 5 - .../lodash/fp/intersectionWith.js | 5 - .../scripts/node_modules/lodash/fp/invert.js | 5 - .../node_modules/lodash/fp/invertBy.js | 5 - .../node_modules/lodash/fp/invertObj.js | 1 - .../scripts/node_modules/lodash/fp/invoke.js | 5 - .../node_modules/lodash/fp/invokeArgs.js | 5 - .../node_modules/lodash/fp/invokeArgsMap.js | 5 - .../node_modules/lodash/fp/invokeMap.js | 5 - .../node_modules/lodash/fp/isArguments.js | 5 - .../scripts/node_modules/lodash/fp/isArray.js | 5 - .../node_modules/lodash/fp/isArrayBuffer.js | 5 - .../node_modules/lodash/fp/isArrayLike.js | 5 - .../lodash/fp/isArrayLikeObject.js | 5 - .../node_modules/lodash/fp/isBoolean.js | 5 - .../node_modules/lodash/fp/isBuffer.js | 5 - .../scripts/node_modules/lodash/fp/isDate.js | 5 - .../node_modules/lodash/fp/isElement.js | 5 - .../scripts/node_modules/lodash/fp/isEmpty.js | 5 - .../scripts/node_modules/lodash/fp/isEqual.js | 5 - .../node_modules/lodash/fp/isEqualWith.js | 5 - .../scripts/node_modules/lodash/fp/isError.js | 5 - .../node_modules/lodash/fp/isFinite.js | 5 - .../node_modules/lodash/fp/isFunction.js | 5 - .../node_modules/lodash/fp/isInteger.js | 5 - .../node_modules/lodash/fp/isLength.js | 5 - .../scripts/node_modules/lodash/fp/isMap.js | 5 - .../scripts/node_modules/lodash/fp/isMatch.js | 5 - .../node_modules/lodash/fp/isMatchWith.js | 5 - .../scripts/node_modules/lodash/fp/isNaN.js | 5 - .../node_modules/lodash/fp/isNative.js | 5 - .../scripts/node_modules/lodash/fp/isNil.js | 5 - .../scripts/node_modules/lodash/fp/isNull.js | 5 - .../node_modules/lodash/fp/isNumber.js | 5 - .../node_modules/lodash/fp/isObject.js | 5 - .../node_modules/lodash/fp/isObjectLike.js | 5 - .../node_modules/lodash/fp/isPlainObject.js | 5 - .../node_modules/lodash/fp/isRegExp.js | 5 - .../node_modules/lodash/fp/isSafeInteger.js | 5 - .../scripts/node_modules/lodash/fp/isSet.js | 5 - .../node_modules/lodash/fp/isString.js | 5 - .../node_modules/lodash/fp/isSymbol.js | 5 - .../node_modules/lodash/fp/isTypedArray.js | 5 - .../node_modules/lodash/fp/isUndefined.js | 5 - .../node_modules/lodash/fp/isWeakMap.js | 5 - .../node_modules/lodash/fp/isWeakSet.js | 5 - .../node_modules/lodash/fp/iteratee.js | 5 - .../scripts/node_modules/lodash/fp/join.js | 5 - .../scripts/node_modules/lodash/fp/juxt.js | 1 - .../node_modules/lodash/fp/kebabCase.js | 5 - .../scripts/node_modules/lodash/fp/keyBy.js | 5 - .../scripts/node_modules/lodash/fp/keys.js | 5 - .../scripts/node_modules/lodash/fp/keysIn.js | 5 - .../scripts/node_modules/lodash/fp/lang.js | 2 - .../scripts/node_modules/lodash/fp/last.js | 5 - .../node_modules/lodash/fp/lastIndexOf.js | 5 - .../node_modules/lodash/fp/lastIndexOfFrom.js | 5 - .../node_modules/lodash/fp/lowerCase.js | 5 - .../node_modules/lodash/fp/lowerFirst.js | 5 - .../scripts/node_modules/lodash/fp/lt.js | 5 - .../scripts/node_modules/lodash/fp/lte.js | 5 - .../scripts/node_modules/lodash/fp/map.js | 5 - .../scripts/node_modules/lodash/fp/mapKeys.js | 5 - .../node_modules/lodash/fp/mapValues.js | 5 - .../scripts/node_modules/lodash/fp/matches.js | 1 - .../node_modules/lodash/fp/matchesProperty.js | 5 - .../scripts/node_modules/lodash/fp/math.js | 2 - .../scripts/node_modules/lodash/fp/max.js | 5 - .../scripts/node_modules/lodash/fp/maxBy.js | 5 - .../scripts/node_modules/lodash/fp/mean.js | 5 - .../scripts/node_modules/lodash/fp/meanBy.js | 5 - .../scripts/node_modules/lodash/fp/memoize.js | 5 - .../scripts/node_modules/lodash/fp/merge.js | 5 - .../node_modules/lodash/fp/mergeAll.js | 5 - .../node_modules/lodash/fp/mergeAllWith.js | 5 - .../node_modules/lodash/fp/mergeWith.js | 5 - .../scripts/node_modules/lodash/fp/method.js | 5 - .../node_modules/lodash/fp/methodOf.js | 5 - .../scripts/node_modules/lodash/fp/min.js | 5 - .../scripts/node_modules/lodash/fp/minBy.js | 5 - .../scripts/node_modules/lodash/fp/mixin.js | 5 - .../node_modules/lodash/fp/multiply.js | 5 - .../scripts/node_modules/lodash/fp/nAry.js | 1 - .../scripts/node_modules/lodash/fp/negate.js | 5 - .../scripts/node_modules/lodash/fp/next.js | 5 - .../scripts/node_modules/lodash/fp/noop.js | 5 - .../scripts/node_modules/lodash/fp/now.js | 5 - .../scripts/node_modules/lodash/fp/nth.js | 5 - .../scripts/node_modules/lodash/fp/nthArg.js | 5 - .../scripts/node_modules/lodash/fp/number.js | 2 - .../scripts/node_modules/lodash/fp/object.js | 2 - .../scripts/node_modules/lodash/fp/omit.js | 5 - .../scripts/node_modules/lodash/fp/omitAll.js | 1 - .../scripts/node_modules/lodash/fp/omitBy.js | 5 - .../scripts/node_modules/lodash/fp/once.js | 5 - .../scripts/node_modules/lodash/fp/orderBy.js | 5 - .../scripts/node_modules/lodash/fp/over.js | 5 - .../node_modules/lodash/fp/overArgs.js | 5 - .../node_modules/lodash/fp/overEvery.js | 5 - .../node_modules/lodash/fp/overSome.js | 5 - .../scripts/node_modules/lodash/fp/pad.js | 5 - .../node_modules/lodash/fp/padChars.js | 5 - .../node_modules/lodash/fp/padCharsEnd.js | 5 - .../node_modules/lodash/fp/padCharsStart.js | 5 - .../scripts/node_modules/lodash/fp/padEnd.js | 5 - .../node_modules/lodash/fp/padStart.js | 5 - .../node_modules/lodash/fp/parseInt.js | 5 - .../scripts/node_modules/lodash/fp/partial.js | 5 - .../node_modules/lodash/fp/partialRight.js | 5 - .../node_modules/lodash/fp/partition.js | 5 - .../scripts/node_modules/lodash/fp/path.js | 1 - .../scripts/node_modules/lodash/fp/pathEq.js | 1 - .../scripts/node_modules/lodash/fp/pathOr.js | 1 - .../scripts/node_modules/lodash/fp/paths.js | 1 - .../scripts/node_modules/lodash/fp/pick.js | 5 - .../scripts/node_modules/lodash/fp/pickAll.js | 1 - .../scripts/node_modules/lodash/fp/pickBy.js | 5 - .../scripts/node_modules/lodash/fp/pipe.js | 1 - .../node_modules/lodash/fp/placeholder.js | 6 - .../scripts/node_modules/lodash/fp/plant.js | 5 - .../scripts/node_modules/lodash/fp/pluck.js | 1 - .../scripts/node_modules/lodash/fp/prop.js | 1 - .../scripts/node_modules/lodash/fp/propEq.js | 1 - .../scripts/node_modules/lodash/fp/propOr.js | 1 - .../node_modules/lodash/fp/property.js | 1 - .../node_modules/lodash/fp/propertyOf.js | 5 - .../scripts/node_modules/lodash/fp/props.js | 1 - .../scripts/node_modules/lodash/fp/pull.js | 5 - .../scripts/node_modules/lodash/fp/pullAll.js | 5 - .../node_modules/lodash/fp/pullAllBy.js | 5 - .../node_modules/lodash/fp/pullAllWith.js | 5 - .../scripts/node_modules/lodash/fp/pullAt.js | 5 - .../scripts/node_modules/lodash/fp/random.js | 5 - .../scripts/node_modules/lodash/fp/range.js | 5 - .../node_modules/lodash/fp/rangeRight.js | 5 - .../node_modules/lodash/fp/rangeStep.js | 5 - .../node_modules/lodash/fp/rangeStepRight.js | 5 - .../scripts/node_modules/lodash/fp/rearg.js | 5 - .../scripts/node_modules/lodash/fp/reduce.js | 5 - .../node_modules/lodash/fp/reduceRight.js | 5 - .../scripts/node_modules/lodash/fp/reject.js | 5 - .../scripts/node_modules/lodash/fp/remove.js | 5 - .../scripts/node_modules/lodash/fp/repeat.js | 5 - .../scripts/node_modules/lodash/fp/replace.js | 5 - .../scripts/node_modules/lodash/fp/rest.js | 5 - .../node_modules/lodash/fp/restFrom.js | 5 - .../scripts/node_modules/lodash/fp/result.js | 5 - .../scripts/node_modules/lodash/fp/reverse.js | 5 - .../scripts/node_modules/lodash/fp/round.js | 5 - .../scripts/node_modules/lodash/fp/sample.js | 5 - .../node_modules/lodash/fp/sampleSize.js | 5 - .../scripts/node_modules/lodash/fp/seq.js | 2 - .../scripts/node_modules/lodash/fp/set.js | 5 - .../scripts/node_modules/lodash/fp/setWith.js | 5 - .../scripts/node_modules/lodash/fp/shuffle.js | 5 - .../scripts/node_modules/lodash/fp/size.js | 5 - .../scripts/node_modules/lodash/fp/slice.js | 5 - .../node_modules/lodash/fp/snakeCase.js | 5 - .../scripts/node_modules/lodash/fp/some.js | 5 - .../scripts/node_modules/lodash/fp/sortBy.js | 5 - .../node_modules/lodash/fp/sortedIndex.js | 5 - .../node_modules/lodash/fp/sortedIndexBy.js | 5 - .../node_modules/lodash/fp/sortedIndexOf.js | 5 - .../node_modules/lodash/fp/sortedLastIndex.js | 5 - .../lodash/fp/sortedLastIndexBy.js | 5 - .../lodash/fp/sortedLastIndexOf.js | 5 - .../node_modules/lodash/fp/sortedUniq.js | 5 - .../node_modules/lodash/fp/sortedUniqBy.js | 5 - .../scripts/node_modules/lodash/fp/split.js | 5 - .../scripts/node_modules/lodash/fp/spread.js | 5 - .../node_modules/lodash/fp/spreadFrom.js | 5 - .../node_modules/lodash/fp/startCase.js | 5 - .../node_modules/lodash/fp/startsWith.js | 5 - .../scripts/node_modules/lodash/fp/string.js | 2 - .../node_modules/lodash/fp/stubArray.js | 5 - .../node_modules/lodash/fp/stubFalse.js | 5 - .../node_modules/lodash/fp/stubObject.js | 5 - .../node_modules/lodash/fp/stubString.js | 5 - .../node_modules/lodash/fp/stubTrue.js | 5 - .../node_modules/lodash/fp/subtract.js | 5 - .../scripts/node_modules/lodash/fp/sum.js | 5 - .../scripts/node_modules/lodash/fp/sumBy.js | 5 - .../lodash/fp/symmetricDifference.js | 1 - .../lodash/fp/symmetricDifferenceBy.js | 1 - .../lodash/fp/symmetricDifferenceWith.js | 1 - .../scripts/node_modules/lodash/fp/tail.js | 5 - .../scripts/node_modules/lodash/fp/take.js | 5 - .../node_modules/lodash/fp/takeLast.js | 1 - .../node_modules/lodash/fp/takeLastWhile.js | 1 - .../node_modules/lodash/fp/takeRight.js | 5 - .../node_modules/lodash/fp/takeRightWhile.js | 5 - .../node_modules/lodash/fp/takeWhile.js | 5 - .../scripts/node_modules/lodash/fp/tap.js | 5 - .../node_modules/lodash/fp/template.js | 5 - .../lodash/fp/templateSettings.js | 5 - .../node_modules/lodash/fp/throttle.js | 5 - .../scripts/node_modules/lodash/fp/thru.js | 5 - .../scripts/node_modules/lodash/fp/times.js | 5 - .../scripts/node_modules/lodash/fp/toArray.js | 5 - .../node_modules/lodash/fp/toFinite.js | 5 - .../node_modules/lodash/fp/toInteger.js | 5 - .../node_modules/lodash/fp/toIterator.js | 5 - .../scripts/node_modules/lodash/fp/toJSON.js | 5 - .../node_modules/lodash/fp/toLength.js | 5 - .../scripts/node_modules/lodash/fp/toLower.js | 5 - .../node_modules/lodash/fp/toNumber.js | 5 - .../scripts/node_modules/lodash/fp/toPairs.js | 5 - .../node_modules/lodash/fp/toPairsIn.js | 5 - .../scripts/node_modules/lodash/fp/toPath.js | 5 - .../node_modules/lodash/fp/toPlainObject.js | 5 - .../node_modules/lodash/fp/toSafeInteger.js | 5 - .../node_modules/lodash/fp/toString.js | 5 - .../scripts/node_modules/lodash/fp/toUpper.js | 5 - .../node_modules/lodash/fp/transform.js | 5 - .../scripts/node_modules/lodash/fp/trim.js | 5 - .../node_modules/lodash/fp/trimChars.js | 5 - .../node_modules/lodash/fp/trimCharsEnd.js | 5 - .../node_modules/lodash/fp/trimCharsStart.js | 5 - .../scripts/node_modules/lodash/fp/trimEnd.js | 5 - .../node_modules/lodash/fp/trimStart.js | 5 - .../node_modules/lodash/fp/truncate.js | 5 - .../scripts/node_modules/lodash/fp/unapply.js | 1 - .../scripts/node_modules/lodash/fp/unary.js | 5 - .../node_modules/lodash/fp/unescape.js | 5 - .../scripts/node_modules/lodash/fp/union.js | 5 - .../scripts/node_modules/lodash/fp/unionBy.js | 5 - .../node_modules/lodash/fp/unionWith.js | 5 - .../scripts/node_modules/lodash/fp/uniq.js | 5 - .../scripts/node_modules/lodash/fp/uniqBy.js | 5 - .../node_modules/lodash/fp/uniqWith.js | 5 - .../node_modules/lodash/fp/uniqueId.js | 5 - .../scripts/node_modules/lodash/fp/unnest.js | 1 - .../scripts/node_modules/lodash/fp/unset.js | 5 - .../scripts/node_modules/lodash/fp/unzip.js | 5 - .../node_modules/lodash/fp/unzipWith.js | 5 - .../scripts/node_modules/lodash/fp/update.js | 5 - .../node_modules/lodash/fp/updateWith.js | 5 - .../node_modules/lodash/fp/upperCase.js | 5 - .../node_modules/lodash/fp/upperFirst.js | 5 - .../scripts/node_modules/lodash/fp/useWith.js | 1 - .../scripts/node_modules/lodash/fp/util.js | 2 - .../scripts/node_modules/lodash/fp/value.js | 5 - .../scripts/node_modules/lodash/fp/valueOf.js | 5 - .../scripts/node_modules/lodash/fp/values.js | 5 - .../node_modules/lodash/fp/valuesIn.js | 5 - .../scripts/node_modules/lodash/fp/where.js | 1 - .../scripts/node_modules/lodash/fp/whereEq.js | 1 - .../scripts/node_modules/lodash/fp/without.js | 5 - .../scripts/node_modules/lodash/fp/words.js | 5 - .../scripts/node_modules/lodash/fp/wrap.js | 5 - .../node_modules/lodash/fp/wrapperAt.js | 5 - .../node_modules/lodash/fp/wrapperChain.js | 5 - .../node_modules/lodash/fp/wrapperLodash.js | 5 - .../node_modules/lodash/fp/wrapperReverse.js | 5 - .../node_modules/lodash/fp/wrapperValue.js | 5 - .../scripts/node_modules/lodash/fp/xor.js | 5 - .../scripts/node_modules/lodash/fp/xorBy.js | 5 - .../scripts/node_modules/lodash/fp/xorWith.js | 5 - .../scripts/node_modules/lodash/fp/zip.js | 5 - .../scripts/node_modules/lodash/fp/zipAll.js | 5 - .../scripts/node_modules/lodash/fp/zipObj.js | 1 - .../node_modules/lodash/fp/zipObject.js | 5 - .../node_modules/lodash/fp/zipObjectDeep.js | 5 - .../scripts/node_modules/lodash/fp/zipWith.js | 5 - .../scripts/node_modules/lodash/fromPairs.js | 28 - .../scripts/node_modules/lodash/function.js | 25 - .../scripts/node_modules/lodash/functions.js | 31 - .../node_modules/lodash/functionsIn.js | 31 - .../scripts/node_modules/lodash/get.js | 33 - .../scripts/node_modules/lodash/groupBy.js | 41 - .../example/scripts/node_modules/lodash/gt.js | 29 - .../scripts/node_modules/lodash/gte.js | 30 - .../scripts/node_modules/lodash/has.js | 35 - .../scripts/node_modules/lodash/hasIn.js | 34 - .../scripts/node_modules/lodash/head.js | 23 - .../scripts/node_modules/lodash/identity.js | 21 - .../scripts/node_modules/lodash/inRange.js | 55 - .../scripts/node_modules/lodash/includes.js | 53 - .../scripts/node_modules/lodash/index.js | 1 - .../scripts/node_modules/lodash/indexOf.js | 42 - .../scripts/node_modules/lodash/initial.js | 22 - .../node_modules/lodash/intersection.js | 30 - .../node_modules/lodash/intersectionBy.js | 45 - .../node_modules/lodash/intersectionWith.js | 41 - .../scripts/node_modules/lodash/invert.js | 42 - .../scripts/node_modules/lodash/invertBy.js | 56 - .../scripts/node_modules/lodash/invoke.js | 24 - .../scripts/node_modules/lodash/invokeMap.js | 41 - .../node_modules/lodash/isArguments.js | 36 - .../scripts/node_modules/lodash/isArray.js | 26 - .../node_modules/lodash/isArrayBuffer.js | 27 - .../node_modules/lodash/isArrayLike.js | 33 - .../node_modules/lodash/isArrayLikeObject.js | 33 - .../scripts/node_modules/lodash/isBoolean.js | 29 - .../scripts/node_modules/lodash/isBuffer.js | 38 - .../scripts/node_modules/lodash/isDate.js | 27 - .../scripts/node_modules/lodash/isElement.js | 25 - .../scripts/node_modules/lodash/isEmpty.js | 77 - .../scripts/node_modules/lodash/isEqual.js | 35 - .../node_modules/lodash/isEqualWith.js | 41 - .../scripts/node_modules/lodash/isError.js | 36 - .../scripts/node_modules/lodash/isFinite.js | 36 - .../scripts/node_modules/lodash/isFunction.js | 37 - .../scripts/node_modules/lodash/isInteger.js | 33 - .../scripts/node_modules/lodash/isLength.js | 35 - .../scripts/node_modules/lodash/isMap.js | 27 - .../scripts/node_modules/lodash/isMatch.js | 36 - .../node_modules/lodash/isMatchWith.js | 41 - .../scripts/node_modules/lodash/isNaN.js | 38 - .../scripts/node_modules/lodash/isNative.js | 40 - .../scripts/node_modules/lodash/isNil.js | 25 - .../scripts/node_modules/lodash/isNull.js | 22 - .../scripts/node_modules/lodash/isNumber.js | 38 - .../scripts/node_modules/lodash/isObject.js | 31 - .../node_modules/lodash/isObjectLike.js | 29 - .../node_modules/lodash/isPlainObject.js | 62 - .../scripts/node_modules/lodash/isRegExp.js | 27 - .../node_modules/lodash/isSafeInteger.js | 37 - .../scripts/node_modules/lodash/isSet.js | 27 - .../scripts/node_modules/lodash/isString.js | 30 - .../scripts/node_modules/lodash/isSymbol.js | 29 - .../node_modules/lodash/isTypedArray.js | 27 - .../node_modules/lodash/isUndefined.js | 22 - .../scripts/node_modules/lodash/isWeakMap.js | 28 - .../scripts/node_modules/lodash/isWeakSet.js | 28 - .../scripts/node_modules/lodash/iteratee.js | 53 - .../scripts/node_modules/lodash/join.js | 26 - .../scripts/node_modules/lodash/kebabCase.js | 28 - .../scripts/node_modules/lodash/keyBy.js | 36 - .../scripts/node_modules/lodash/keys.js | 37 - .../scripts/node_modules/lodash/keysIn.js | 32 - .../scripts/node_modules/lodash/lang.js | 58 - .../scripts/node_modules/lodash/last.js | 20 - .../node_modules/lodash/lastIndexOf.js | 46 - .../scripts/node_modules/lodash/lodash.js | 17209 -------------- .../scripts/node_modules/lodash/lodash.min.js | 140 - .../scripts/node_modules/lodash/lowerCase.js | 27 - .../scripts/node_modules/lodash/lowerFirst.js | 22 - .../example/scripts/node_modules/lodash/lt.js | 29 - .../scripts/node_modules/lodash/lte.js | 30 - .../scripts/node_modules/lodash/map.js | 53 - .../scripts/node_modules/lodash/mapKeys.js | 36 - .../scripts/node_modules/lodash/mapValues.js | 43 - .../scripts/node_modules/lodash/matches.js | 46 - .../node_modules/lodash/matchesProperty.js | 44 - .../scripts/node_modules/lodash/math.js | 17 - .../scripts/node_modules/lodash/max.js | 29 - .../scripts/node_modules/lodash/maxBy.js | 34 - .../scripts/node_modules/lodash/mean.js | 22 - .../scripts/node_modules/lodash/meanBy.js | 31 - .../scripts/node_modules/lodash/memoize.js | 73 - .../scripts/node_modules/lodash/merge.js | 39 - .../scripts/node_modules/lodash/mergeWith.js | 39 - .../scripts/node_modules/lodash/method.js | 34 - .../scripts/node_modules/lodash/methodOf.js | 33 - .../scripts/node_modules/lodash/min.js | 29 - .../scripts/node_modules/lodash/minBy.js | 34 - .../scripts/node_modules/lodash/mixin.js | 74 - .../scripts/node_modules/lodash/multiply.js | 22 - .../scripts/node_modules/lodash/negate.js | 40 - .../scripts/node_modules/lodash/next.js | 35 - .../scripts/node_modules/lodash/noop.js | 17 - .../scripts/node_modules/lodash/now.js | 23 - .../scripts/node_modules/lodash/nth.js | 29 - .../scripts/node_modules/lodash/nthArg.js | 32 - .../scripts/node_modules/lodash/number.js | 5 - .../scripts/node_modules/lodash/object.js | 49 - .../scripts/node_modules/lodash/omit.js | 57 - .../scripts/node_modules/lodash/omitBy.js | 29 - .../scripts/node_modules/lodash/once.js | 25 - .../scripts/node_modules/lodash/orderBy.js | 47 - .../scripts/node_modules/lodash/over.js | 24 - .../scripts/node_modules/lodash/overArgs.js | 61 - .../scripts/node_modules/lodash/overEvery.js | 34 - .../scripts/node_modules/lodash/overSome.js | 37 - .../scripts/node_modules/lodash/package.json | 17 - .../scripts/node_modules/lodash/pad.js | 49 - .../scripts/node_modules/lodash/padEnd.js | 39 - .../scripts/node_modules/lodash/padStart.js | 39 - .../scripts/node_modules/lodash/parseInt.js | 43 - .../scripts/node_modules/lodash/partial.js | 50 - .../node_modules/lodash/partialRight.js | 49 - .../scripts/node_modules/lodash/partition.js | 43 - .../scripts/node_modules/lodash/pick.js | 25 - .../scripts/node_modules/lodash/pickBy.js | 37 - .../scripts/node_modules/lodash/plant.js | 48 - .../scripts/node_modules/lodash/property.js | 32 - .../scripts/node_modules/lodash/propertyOf.js | 30 - .../scripts/node_modules/lodash/pull.js | 29 - .../scripts/node_modules/lodash/pullAll.js | 29 - .../scripts/node_modules/lodash/pullAllBy.js | 33 - .../node_modules/lodash/pullAllWith.js | 32 - .../scripts/node_modules/lodash/pullAt.js | 43 - .../scripts/node_modules/lodash/random.js | 82 - .../scripts/node_modules/lodash/range.js | 46 - .../scripts/node_modules/lodash/rangeRight.js | 41 - .../scripts/node_modules/lodash/rearg.js | 33 - .../scripts/node_modules/lodash/reduce.js | 51 - .../node_modules/lodash/reduceRight.js | 36 - .../scripts/node_modules/lodash/reject.js | 46 - .../scripts/node_modules/lodash/release.md | 48 - .../scripts/node_modules/lodash/remove.js | 53 - .../scripts/node_modules/lodash/repeat.js | 37 - .../scripts/node_modules/lodash/replace.js | 29 - .../scripts/node_modules/lodash/rest.js | 40 - .../scripts/node_modules/lodash/result.js | 56 - .../scripts/node_modules/lodash/reverse.js | 34 - .../scripts/node_modules/lodash/round.js | 26 - .../scripts/node_modules/lodash/sample.js | 24 - .../scripts/node_modules/lodash/sampleSize.js | 37 - .../scripts/node_modules/lodash/seq.js | 16 - .../scripts/node_modules/lodash/set.js | 35 - .../scripts/node_modules/lodash/setWith.js | 32 - .../scripts/node_modules/lodash/shuffle.js | 25 - .../scripts/node_modules/lodash/size.js | 46 - .../scripts/node_modules/lodash/slice.js | 37 - .../scripts/node_modules/lodash/snakeCase.js | 28 - .../scripts/node_modules/lodash/some.js | 51 - .../scripts/node_modules/lodash/sortBy.js | 48 - .../node_modules/lodash/sortedIndex.js | 24 - .../node_modules/lodash/sortedIndexBy.js | 33 - .../node_modules/lodash/sortedIndexOf.js | 31 - .../node_modules/lodash/sortedLastIndex.js | 25 - .../node_modules/lodash/sortedLastIndexBy.js | 33 - .../node_modules/lodash/sortedLastIndexOf.js | 31 - .../scripts/node_modules/lodash/sortedUniq.js | 24 - .../node_modules/lodash/sortedUniqBy.js | 26 - .../scripts/node_modules/lodash/split.js | 52 - .../scripts/node_modules/lodash/spread.js | 63 - .../scripts/node_modules/lodash/startCase.js | 29 - .../scripts/node_modules/lodash/startsWith.js | 39 - .../scripts/node_modules/lodash/string.js | 33 - .../scripts/node_modules/lodash/stubArray.js | 23 - .../scripts/node_modules/lodash/stubFalse.js | 18 - .../scripts/node_modules/lodash/stubObject.js | 23 - .../scripts/node_modules/lodash/stubString.js | 18 - .../scripts/node_modules/lodash/stubTrue.js | 18 - .../scripts/node_modules/lodash/subtract.js | 22 - .../scripts/node_modules/lodash/sum.js | 24 - .../scripts/node_modules/lodash/sumBy.js | 33 - .../scripts/node_modules/lodash/tail.js | 22 - .../scripts/node_modules/lodash/take.js | 37 - .../scripts/node_modules/lodash/takeRight.js | 39 - .../node_modules/lodash/takeRightWhile.js | 45 - .../scripts/node_modules/lodash/takeWhile.js | 45 - .../scripts/node_modules/lodash/tap.js | 29 - .../scripts/node_modules/lodash/template.js | 272 - .../node_modules/lodash/templateSettings.js | 67 - .../scripts/node_modules/lodash/throttle.js | 69 - .../scripts/node_modules/lodash/thru.js | 28 - .../scripts/node_modules/lodash/times.js | 51 - .../scripts/node_modules/lodash/toArray.js | 58 - .../scripts/node_modules/lodash/toFinite.js | 42 - .../scripts/node_modules/lodash/toInteger.js | 36 - .../scripts/node_modules/lodash/toIterator.js | 23 - .../scripts/node_modules/lodash/toJSON.js | 1 - .../scripts/node_modules/lodash/toLength.js | 38 - .../scripts/node_modules/lodash/toLower.js | 28 - .../scripts/node_modules/lodash/toNumber.js | 64 - .../scripts/node_modules/lodash/toPairs.js | 30 - .../scripts/node_modules/lodash/toPairsIn.js | 30 - .../scripts/node_modules/lodash/toPath.js | 33 - .../node_modules/lodash/toPlainObject.js | 32 - .../node_modules/lodash/toSafeInteger.js | 37 - .../scripts/node_modules/lodash/toString.js | 28 - .../scripts/node_modules/lodash/toUpper.js | 28 - .../scripts/node_modules/lodash/transform.js | 65 - .../scripts/node_modules/lodash/trim.js | 47 - .../scripts/node_modules/lodash/trimEnd.js | 41 - .../scripts/node_modules/lodash/trimStart.js | 43 - .../scripts/node_modules/lodash/truncate.js | 111 - .../scripts/node_modules/lodash/unary.js | 22 - .../scripts/node_modules/lodash/unescape.js | 34 - .../scripts/node_modules/lodash/union.js | 26 - .../scripts/node_modules/lodash/unionBy.js | 39 - .../scripts/node_modules/lodash/unionWith.js | 34 - .../scripts/node_modules/lodash/uniq.js | 25 - .../scripts/node_modules/lodash/uniqBy.js | 31 - .../scripts/node_modules/lodash/uniqWith.js | 28 - .../scripts/node_modules/lodash/uniqueId.js | 28 - .../scripts/node_modules/lodash/unset.js | 34 - .../scripts/node_modules/lodash/unzip.js | 45 - .../scripts/node_modules/lodash/unzipWith.js | 39 - .../scripts/node_modules/lodash/update.js | 35 - .../scripts/node_modules/lodash/updateWith.js | 33 - .../scripts/node_modules/lodash/upperCase.js | 27 - .../scripts/node_modules/lodash/upperFirst.js | 22 - .../scripts/node_modules/lodash/util.js | 34 - .../scripts/node_modules/lodash/value.js | 1 - .../scripts/node_modules/lodash/valueOf.js | 1 - .../scripts/node_modules/lodash/values.js | 34 - .../scripts/node_modules/lodash/valuesIn.js | 32 - .../scripts/node_modules/lodash/without.js | 31 - .../scripts/node_modules/lodash/words.js | 35 - .../scripts/node_modules/lodash/wrap.js | 30 - .../scripts/node_modules/lodash/wrapperAt.js | 48 - .../node_modules/lodash/wrapperChain.js | 34 - .../node_modules/lodash/wrapperLodash.js | 147 - .../node_modules/lodash/wrapperReverse.js | 44 - .../node_modules/lodash/wrapperValue.js | 21 - .../scripts/node_modules/lodash/xor.js | 28 - .../scripts/node_modules/lodash/xorBy.js | 39 - .../scripts/node_modules/lodash/xorWith.js | 34 - .../scripts/node_modules/lodash/zip.js | 22 - .../scripts/node_modules/lodash/zipObject.js | 24 - .../node_modules/lodash/zipObjectDeep.js | 23 - .../scripts/node_modules/lodash/zipWith.js | 32 - .../example/scripts/node_modules/long/LICENSE | 202 - .../scripts/node_modules/long/README.md | 246 - .../scripts/node_modules/long/dist/long.js | 2 - .../scripts/node_modules/long/index.js | 1 - .../scripts/node_modules/long/package.json | 34 - .../scripts/node_modules/long/src/long.js | 1323 -- .../scripts/node_modules/lru-cache/LICENSE | 15 - .../scripts/node_modules/lru-cache/README.md | 166 - .../scripts/node_modules/lru-cache/index.js | 334 - .../node_modules/lru-cache/package.json | 34 - .../node_modules/lru-memoizer/.jshintrc | 41 - .../scripts/node_modules/lru-memoizer/LICENSE | 21 - .../node_modules/lru-memoizer/README.md | 88 - .../node_modules/lru-memoizer/lib/async.d.ts | 31 - .../node_modules/lru-memoizer/lib/async.js | 176 - .../node_modules/lru-memoizer/lib/freeze.d.ts | 1 - .../node_modules/lru-memoizer/lib/freeze.js | 22 - .../node_modules/lru-memoizer/lib/index.d.ts | 2 - .../node_modules/lru-memoizer/lib/index.js | 4 - .../node_modules/lru-memoizer/lib/sync.d.ts | 27 - .../node_modules/lru-memoizer/lib/sync.js | 113 - .../node_modules/lru-memoizer/lib/util.d.ts | 83 - .../node_modules/lru-memoizer/lib/util.js | 3 - .../node_modules/lru-cache/LICENSE | 15 - .../node_modules/lru-cache/README.md | 148 - .../node_modules/lru-cache/lib/lru-cache.js | 469 - .../node_modules/lru-cache/package.json | 29 - .../lru-memoizer/node_modules/yallist/LICENSE | 15 - .../node_modules/yallist/README.md | 204 - .../node_modules/yallist/iterator.js | 7 - .../node_modules/yallist/package.json | 29 - .../node_modules/yallist/yallist.js | 370 - .../node_modules/lru-memoizer/package.json | 33 - .../test/lru-memoizer.bypass.test.js | 39 - .../test/lru-memoizer.clone.test.js | 44 - .../test/lru-memoizer.disable.test.js | 49 - .../test/lru-memoizer.events.test.js | 132 - .../test/lru-memoizer.freeze.test.js | 45 - .../test/lru-memoizer.itemmaxage.test.js | 204 - .../test/lru-memoizer.lock.test.js | 36 - .../test/lru-memoizer.nokey.test.js | 43 - .../test/lru-memoizer.queumaxage.test.js | 110 - .../test/lru-memoizer.sync.clone.test.js | 76 - .../test/lru-memoizer.sync.events.test.js | 95 - .../test/lru-memoizer.sync.freeze.js | 74 - .../test/lru-memoizer.sync.test.js | 47 - .../lru-memoizer/test/lru-memoizer.test.js | 88 - .../node_modules/lru-memoizer/tsconfig.json | 59 - .../node_modules/markdown-it-anchor/README.md | 586 - .../node_modules/markdown-it-anchor/UNLICENSE | 24 - .../dist/markdownItAnchor.js | 2 - .../dist/markdownItAnchor.mjs | 2 - .../dist/markdownItAnchor.mjs.map | 1 - .../dist/markdownItAnchor.modern.js | 2 - .../dist/markdownItAnchor.umd.js | 2 - .../markdown-it-anchor/package.json | 53 - .../node_modules/markdown-it-anchor/runkit.js | 22 - .../markdown-it-anchor/types/index.d.ts | 71 - .../markdown-it-anchor/types/package.json | 3 - .../scripts/node_modules/markdown-it/LICENSE | 22 - .../node_modules/markdown-it/README.md | 307 - .../markdown-it/bin/markdown-it.js | 117 - .../markdown-it/dist/markdown-it.js | 8356 ------- .../markdown-it/dist/markdown-it.min.js | 3 - .../scripts/node_modules/markdown-it/index.js | 4 - .../markdown-it/lib/common/entities.js | 6 - .../markdown-it/lib/common/html_blocks.js | 70 - .../markdown-it/lib/common/html_re.js | 28 - .../markdown-it/lib/common/utils.js | 317 - .../markdown-it/lib/helpers/index.js | 7 - .../lib/helpers/parse_link_destination.js | 82 - .../lib/helpers/parse_link_label.js | 48 - .../lib/helpers/parse_link_title.js | 55 - .../node_modules/markdown-it/lib/index.js | 582 - .../markdown-it/lib/parser_block.js | 122 - .../markdown-it/lib/parser_core.js | 58 - .../markdown-it/lib/parser_inline.js | 177 - .../markdown-it/lib/presets/commonmark.js | 80 - .../markdown-it/lib/presets/default.js | 41 - .../markdown-it/lib/presets/zero.js | 62 - .../node_modules/markdown-it/lib/renderer.js | 341 - .../node_modules/markdown-it/lib/ruler.js | 352 - .../markdown-it/lib/rules_block/blockquote.js | 284 - .../markdown-it/lib/rules_block/code.js | 34 - .../markdown-it/lib/rules_block/fence.js | 98 - .../markdown-it/lib/rules_block/heading.js | 55 - .../markdown-it/lib/rules_block/hr.js | 45 - .../markdown-it/lib/rules_block/html_block.js | 74 - .../markdown-it/lib/rules_block/lheading.js | 83 - .../markdown-it/lib/rules_block/list.js | 364 - .../markdown-it/lib/rules_block/paragraph.js | 52 - .../markdown-it/lib/rules_block/reference.js | 198 - .../lib/rules_block/state_block.js | 231 - .../markdown-it/lib/rules_block/table.js | 221 - .../markdown-it/lib/rules_core/block.js | 16 - .../markdown-it/lib/rules_core/inline.js | 13 - .../markdown-it/lib/rules_core/linkify.js | 133 - .../markdown-it/lib/rules_core/normalize.js | 21 - .../lib/rules_core/replacements.js | 107 - .../markdown-it/lib/rules_core/smartquotes.js | 201 - .../markdown-it/lib/rules_core/state_core.js | 20 - .../markdown-it/lib/rules_inline/autolink.js | 76 - .../markdown-it/lib/rules_inline/backticks.js | 63 - .../lib/rules_inline/balance_pairs.js | 130 - .../markdown-it/lib/rules_inline/emphasis.js | 130 - .../markdown-it/lib/rules_inline/entity.js | 48 - .../markdown-it/lib/rules_inline/escape.js | 52 - .../lib/rules_inline/html_inline.js | 47 - .../markdown-it/lib/rules_inline/image.js | 152 - .../markdown-it/lib/rules_inline/link.js | 148 - .../markdown-it/lib/rules_inline/newline.js | 46 - .../lib/rules_inline/state_inline.js | 154 - .../lib/rules_inline/strikethrough.js | 130 - .../markdown-it/lib/rules_inline/text.js | 89 - .../lib/rules_inline/text_collapse.js | 41 - .../node_modules/markdown-it/lib/token.js | 201 - .../node_modules/markdown-it/package.json | 87 - .../scripts/node_modules/marked/LICENSE.md | 44 - .../scripts/node_modules/marked/README.md | 99 - .../scripts/node_modules/marked/bin/marked.js | 217 - .../node_modules/marked/lib/marked.cjs | 2692 --- .../node_modules/marked/lib/marked.esm.js | 2809 --- .../node_modules/marked/lib/marked.umd.js | 2698 --- .../scripts/node_modules/marked/man/marked.1 | 92 - .../node_modules/marked/man/marked.1.txt | 86 - .../scripts/node_modules/marked/marked.min.js | 6 - .../scripts/node_modules/marked/package.json | 94 - .../scripts/node_modules/marked/src/Lexer.js | 503 - .../scripts/node_modules/marked/src/Parser.js | 286 - .../node_modules/marked/src/Renderer.js | 203 - .../node_modules/marked/src/Slugger.js | 55 - .../node_modules/marked/src/TextRenderer.js | 42 - .../node_modules/marked/src/Tokenizer.js | 779 - .../node_modules/marked/src/defaults.js | 29 - .../node_modules/marked/src/helpers.js | 276 - .../scripts/node_modules/marked/src/marked.js | 366 - .../scripts/node_modules/marked/src/rules.js | 305 - .../scripts/node_modules/mdurl/CHANGELOG.md | 16 - .../scripts/node_modules/mdurl/LICENSE | 45 - .../scripts/node_modules/mdurl/README.md | 102 - .../scripts/node_modules/mdurl/decode.js | 122 - .../scripts/node_modules/mdurl/encode.js | 98 - .../scripts/node_modules/mdurl/format.js | 25 - .../scripts/node_modules/mdurl/index.js | 7 - .../scripts/node_modules/mdurl/package.json | 16 - .../scripts/node_modules/mdurl/parse.js | 312 - .../scripts/node_modules/mime-db/HISTORY.md | 507 - .../scripts/node_modules/mime-db/LICENSE | 23 - .../scripts/node_modules/mime-db/README.md | 100 - .../scripts/node_modules/mime-db/db.json | 8519 ------- .../scripts/node_modules/mime-db/index.js | 12 - .../scripts/node_modules/mime-db/package.json | 60 - .../node_modules/mime-types/HISTORY.md | 397 - .../scripts/node_modules/mime-types/LICENSE | 23 - .../scripts/node_modules/mime-types/README.md | 113 - .../scripts/node_modules/mime-types/index.js | 188 - .../node_modules/mime-types/package.json | 44 - .../scripts/node_modules/mime/CHANGELOG.md | 312 - .../example/scripts/node_modules/mime/LICENSE | 21 - .../example/scripts/node_modules/mime/Mime.js | 97 - .../scripts/node_modules/mime/README.md | 178 - .../example/scripts/node_modules/mime/cli.js | 46 - .../scripts/node_modules/mime/index.js | 4 - .../example/scripts/node_modules/mime/lite.js | 4 - .../scripts/node_modules/mime/package.json | 52 - .../scripts/node_modules/mime/types/other.js | 1 - .../node_modules/mime/types/standard.js | 1 - .../scripts/node_modules/minimatch/LICENSE | 15 - .../scripts/node_modules/minimatch/README.md | 259 - .../node_modules/minimatch/lib/path.js | 4 - .../node_modules/minimatch/minimatch.js | 906 - .../node_modules/minimatch/package.json | 32 - .../scripts/node_modules/minimist/.eslintrc | 54 - .../node_modules/minimist/.github/FUNDING.yml | 12 - .../scripts/node_modules/minimist/.nycrc | 14 - .../node_modules/minimist/CHANGELOG.md | 212 - .../scripts/node_modules/minimist/LICENSE | 18 - .../scripts/node_modules/minimist/README.md | 117 - .../node_modules/minimist/example/parse.js | 2 - .../scripts/node_modules/minimist/index.js | 249 - .../node_modules/minimist/package.json | 75 - .../node_modules/minimist/test/all_bool.js | 32 - .../node_modules/minimist/test/bool.js | 178 - .../node_modules/minimist/test/dash.js | 31 - .../minimist/test/default_bool.js | 35 - .../node_modules/minimist/test/dotted.js | 22 - .../node_modules/minimist/test/kv_short.js | 16 - .../node_modules/minimist/test/long.js | 31 - .../scripts/node_modules/minimist/test/num.js | 36 - .../node_modules/minimist/test/parse.js | 197 - .../minimist/test/parse_modified.js | 9 - .../node_modules/minimist/test/proto.js | 60 - .../node_modules/minimist/test/short.js | 67 - .../node_modules/minimist/test/stop_early.js | 15 - .../node_modules/minimist/test/unknown.js | 102 - .../node_modules/minimist/test/whitespace.js | 8 - .../scripts/node_modules/mkdirp/CHANGELOG.md | 15 - .../scripts/node_modules/mkdirp/LICENSE | 21 - .../scripts/node_modules/mkdirp/bin/cmd.js | 68 - .../scripts/node_modules/mkdirp/index.js | 31 - .../node_modules/mkdirp/lib/find-made.js | 29 - .../node_modules/mkdirp/lib/mkdirp-manual.js | 64 - .../node_modules/mkdirp/lib/mkdirp-native.js | 39 - .../node_modules/mkdirp/lib/opts-arg.js | 23 - .../node_modules/mkdirp/lib/path-arg.js | 29 - .../node_modules/mkdirp/lib/use-native.js | 10 - .../scripts/node_modules/mkdirp/package.json | 44 - .../node_modules/mkdirp/readme.markdown | 266 - .../example/scripts/node_modules/ms/index.js | 162 - .../scripts/node_modules/ms/license.md | 21 - .../scripts/node_modules/ms/package.json | 37 - .../example/scripts/node_modules/ms/readme.md | 60 - .../node_modules/node-fetch/LICENSE.md | 22 - .../scripts/node_modules/node-fetch/README.md | 590 - .../node_modules/node-fetch/browser.js | 25 - .../node_modules/node-fetch/lib/index.es.js | 1688 -- .../node_modules/node-fetch/lib/index.js | 1697 -- .../node_modules/node-fetch/lib/index.mjs | 1686 -- .../node_modules/node-fetch/package.json | 76 - .../node_modules/node-forge/CHANGELOG.md | 412 - .../scripts/node_modules/node-forge/LICENSE | 331 - .../scripts/node_modules/node-forge/README.md | 2071 -- .../node-forge/dist/forge.all.min.js | 2 - .../node_modules/node-forge/dist/forge.min.js | 2 - .../node-forge/dist/prime.worker.min.js | 2 - .../node_modules/node-forge/flash/README.md | 48 - .../node-forge/flash/package.json | 28 - .../node-forge/flash/swf/SocketPool.swf | Bin 21162 -> 0 bytes .../node_modules/node-forge/lib/aes.js | 1091 - .../node-forge/lib/aesCipherSuites.js | 282 - .../node-forge/lib/asn1-validator.js | 91 - .../node_modules/node-forge/lib/asn1.js | 1434 -- .../node_modules/node-forge/lib/baseN.js | 186 - .../node_modules/node-forge/lib/cipher.js | 230 - .../node-forge/lib/cipherModes.js | 999 - .../node_modules/node-forge/lib/des.js | 496 - .../node_modules/node-forge/lib/ed25519.js | 1072 - .../node_modules/node-forge/lib/forge.js | 13 - .../node_modules/node-forge/lib/form.js | 149 - .../node_modules/node-forge/lib/hmac.js | 146 - .../node_modules/node-forge/lib/http.js | 1346 -- .../node_modules/node-forge/lib/index.all.js | 16 - .../node_modules/node-forge/lib/index.js | 33 - .../node_modules/node-forge/lib/jsbn.js | 1264 -- .../node_modules/node-forge/lib/kem.js | 168 - .../node_modules/node-forge/lib/log.js | 319 - .../node_modules/node-forge/lib/md.all.js | 13 - .../scripts/node_modules/node-forge/lib/md.js | 11 - .../node_modules/node-forge/lib/md5.js | 289 - .../node_modules/node-forge/lib/mgf.js | 12 - .../node_modules/node-forge/lib/mgf1.js | 57 - .../node_modules/node-forge/lib/oids.js | 179 - .../node_modules/node-forge/lib/pbe.js | 1023 - .../node_modules/node-forge/lib/pbkdf2.js | 211 - .../node_modules/node-forge/lib/pem.js | 237 - .../node_modules/node-forge/lib/pkcs1.js | 276 - .../node_modules/node-forge/lib/pkcs12.js | 1074 - .../node_modules/node-forge/lib/pkcs7.js | 1260 -- .../node_modules/node-forge/lib/pkcs7asn1.js | 410 - .../node_modules/node-forge/lib/pki.js | 102 - .../node_modules/node-forge/lib/prime.js | 297 - .../node-forge/lib/prime.worker.js | 168 - .../node_modules/node-forge/lib/prng.js | 419 - .../node_modules/node-forge/lib/pss.js | 241 - .../node_modules/node-forge/lib/random.js | 191 - .../node_modules/node-forge/lib/rc2.js | 410 - .../node_modules/node-forge/lib/rsa.js | 1949 -- .../node_modules/node-forge/lib/sha1.js | 319 - .../node_modules/node-forge/lib/sha256.js | 327 - .../node_modules/node-forge/lib/sha512.js | 561 - .../node_modules/node-forge/lib/socket.js | 287 - .../node_modules/node-forge/lib/ssh.js | 236 - .../node_modules/node-forge/lib/tls.js | 4282 ---- .../node_modules/node-forge/lib/tlssocket.js | 249 - .../node_modules/node-forge/lib/util.js | 2652 --- .../node_modules/node-forge/lib/x509.js | 3242 --- .../node_modules/node-forge/lib/xhr.js | 738 - .../node_modules/node-forge/package.json | 123 - .../scripts/node_modules/object-hash/LICENSE | 22 - .../object-hash/dist/object_hash.js | 1 - .../scripts/node_modules/object-hash/index.js | 453 - .../node_modules/object-hash/package.json | 53 - .../node_modules/object-hash/readme.markdown | 198 - .../example/scripts/node_modules/once/LICENSE | 15 - .../scripts/node_modules/once/README.md | 79 - .../example/scripts/node_modules/once/once.js | 42 - .../scripts/node_modules/once/package.json | 33 - .../node_modules/optionator/CHANGELOG.md | 56 - .../scripts/node_modules/optionator/LICENSE | 22 - .../scripts/node_modules/optionator/README.md | 238 - .../node_modules/optionator/lib/help.js | 260 - .../node_modules/optionator/lib/index.js | 465 - .../node_modules/optionator/lib/util.js | 54 - .../node_modules/optionator/package.json | 44 - .../scripts/node_modules/p-limit/index.d.ts | 42 - .../scripts/node_modules/p-limit/index.js | 71 - .../scripts/node_modules/p-limit/license | 9 - .../scripts/node_modules/p-limit/package.json | 52 - .../scripts/node_modules/p-limit/readme.md | 101 - .../node_modules/path-is-absolute/index.js | 20 - .../node_modules/path-is-absolute/license | 21 - .../path-is-absolute/package.json | 43 - .../node_modules/path-is-absolute/readme.md | 59 - .../node_modules/prelude-ls/CHANGELOG.md | 99 - .../scripts/node_modules/prelude-ls/LICENSE | 22 - .../scripts/node_modules/prelude-ls/README.md | 15 - .../node_modules/prelude-ls/lib/Func.js | 65 - .../node_modules/prelude-ls/lib/List.js | 686 - .../node_modules/prelude-ls/lib/Num.js | 130 - .../node_modules/prelude-ls/lib/Obj.js | 154 - .../node_modules/prelude-ls/lib/Str.js | 92 - .../node_modules/prelude-ls/lib/index.js | 178 - .../node_modules/prelude-ls/package.json | 52 - .../proto3-json-serializer/CHANGELOG.md | 119 - .../proto3-json-serializer/LICENSE | 202 - .../proto3-json-serializer/README.md | 97 - .../proto3-json-serializer/package.json | 58 - .../node_modules/protobufjs-cli/CHANGELOG.md | 48 - .../node_modules/protobufjs-cli/LICENSE | 33 - .../node_modules/protobufjs-cli/README.md | 173 - .../node_modules/protobufjs-cli/bin/pbjs | 6 - .../node_modules/protobufjs-cli/bin/pbts | 6 - .../node_modules/protobufjs-cli/index.d.ts | 3 - .../node_modules/protobufjs-cli/index.js | 3 - .../protobufjs-cli/lib/tsd-jsdoc.json | 18 - .../protobufjs-cli/lib/tsd-jsdoc/LICENSE | 21 - .../protobufjs-cli/lib/tsd-jsdoc/README.md | 23 - .../protobufjs-cli/lib/tsd-jsdoc/plugin.js | 21 - .../protobufjs-cli/lib/tsd-jsdoc/publish.js | 705 - .../protobufjs-cli/node_modules/.bin/semver | 1 - .../node_modules/semver/LICENSE | 15 - .../node_modules/semver/README.md | 568 - .../node_modules/semver/bin/semver.js | 183 - .../node_modules/semver/classes/comparator.js | 136 - .../node_modules/semver/classes/index.js | 5 - .../node_modules/semver/classes/range.js | 522 - .../node_modules/semver/classes/semver.js | 287 - .../node_modules/semver/functions/clean.js | 6 - .../node_modules/semver/functions/cmp.js | 52 - .../node_modules/semver/functions/coerce.js | 52 - .../semver/functions/compare-build.js | 7 - .../semver/functions/compare-loose.js | 3 - .../node_modules/semver/functions/compare.js | 5 - .../node_modules/semver/functions/diff.js | 23 - .../node_modules/semver/functions/eq.js | 3 - .../node_modules/semver/functions/gt.js | 3 - .../node_modules/semver/functions/gte.js | 3 - .../node_modules/semver/functions/inc.js | 18 - .../node_modules/semver/functions/lt.js | 3 - .../node_modules/semver/functions/lte.js | 3 - .../node_modules/semver/functions/major.js | 3 - .../node_modules/semver/functions/minor.js | 3 - .../node_modules/semver/functions/neq.js | 3 - .../node_modules/semver/functions/parse.js | 33 - .../node_modules/semver/functions/patch.js | 3 - .../semver/functions/prerelease.js | 6 - .../node_modules/semver/functions/rcompare.js | 3 - .../node_modules/semver/functions/rsort.js | 3 - .../semver/functions/satisfies.js | 10 - .../node_modules/semver/functions/sort.js | 3 - .../node_modules/semver/functions/valid.js | 6 - .../node_modules/semver/index.js | 88 - .../node_modules/semver/internal/constants.js | 17 - .../node_modules/semver/internal/debug.js | 9 - .../semver/internal/identifiers.js | 23 - .../semver/internal/parse-options.js | 11 - .../node_modules/semver/internal/re.js | 182 - .../node_modules/semver/package.json | 86 - .../node_modules/semver/preload.js | 2 - .../node_modules/semver/range.bnf | 16 - .../node_modules/semver/ranges/gtr.js | 4 - .../node_modules/semver/ranges/intersects.js | 7 - .../node_modules/semver/ranges/ltr.js | 4 - .../semver/ranges/max-satisfying.js | 25 - .../semver/ranges/min-satisfying.js | 24 - .../node_modules/semver/ranges/min-version.js | 61 - .../node_modules/semver/ranges/outside.js | 80 - .../node_modules/semver/ranges/simplify.js | 47 - .../node_modules/semver/ranges/subset.js | 244 - .../semver/ranges/to-comparators.js | 8 - .../node_modules/semver/ranges/valid.js | 11 - .../node_modules/protobufjs-cli/package.json | 38 - .../node_modules/protobufjs-cli/pbjs.d.ts | 9 - .../node_modules/protobufjs-cli/pbjs.js | 335 - .../node_modules/protobufjs-cli/pbts.d.ts | 9 - .../node_modules/protobufjs-cli/pbts.js | 195 - .../protobufjs-cli/scripts/prepublish.js | 13 - .../protobufjs-cli/targets/json-module.js | 38 - .../protobufjs-cli/targets/json.js | 8 - .../protobufjs-cli/targets/proto.js | 326 - .../protobufjs-cli/targets/proto2.js | 10 - .../protobufjs-cli/targets/proto3.js | 10 - .../protobufjs-cli/targets/static-module.js | 28 - .../protobufjs-cli/targets/static.js | 733 - .../node_modules/protobufjs-cli/util.js | 127 - .../protobufjs-cli/wrappers/amd.js | 7 - .../protobufjs-cli/wrappers/closure.js | 7 - .../protobufjs-cli/wrappers/commonjs.js | 7 - .../protobufjs-cli/wrappers/default.js | 15 - .../protobufjs-cli/wrappers/es6.js | 5 - .../scripts/node_modules/protobufjs/LICENSE | 39 - .../scripts/node_modules/protobufjs/README.md | 740 - .../protobufjs/dist/light/protobuf.js | 7369 ------ .../protobufjs/dist/light/protobuf.min.js | 8 - .../protobufjs/dist/minimal/protobuf.js | 2731 --- .../protobufjs/dist/minimal/protobuf.min.js | 8 - .../node_modules/protobufjs/dist/protobuf.js | 9065 -------- .../protobufjs/dist/protobuf.min.js | 8 - .../protobufjs/ext/debug/README.md | 4 - .../protobufjs/ext/debug/index.js | 71 - .../protobufjs/ext/descriptor/README.md | 72 - .../protobufjs/ext/descriptor/index.d.ts | 191 - .../protobufjs/ext/descriptor/index.js | 1052 - .../protobufjs/ext/descriptor/test.js | 54 - .../node_modules/protobufjs/google/LICENSE | 27 - .../node_modules/protobufjs/google/README.md | 1 - .../protobufjs/google/api/annotations.json | 83 - .../protobufjs/google/api/annotations.proto | 11 - .../protobufjs/google/api/http.json | 86 - .../protobufjs/google/api/http.proto | 31 - .../protobufjs/google/protobuf/api.json | 118 - .../protobufjs/google/protobuf/api.proto | 34 - .../google/protobuf/descriptor.json | 739 - .../google/protobuf/descriptor.proto | 286 - .../google/protobuf/source_context.json | 20 - .../google/protobuf/source_context.proto | 7 - .../protobufjs/google/protobuf/type.json | 202 - .../protobufjs/google/protobuf/type.proto | 89 - .../node_modules/protobufjs/index.d.ts | 2741 --- .../scripts/node_modules/protobufjs/index.js | 4 - .../node_modules/protobufjs/light.d.ts | 2 - .../scripts/node_modules/protobufjs/light.js | 4 - .../node_modules/protobufjs/minimal.d.ts | 2 - .../node_modules/protobufjs/minimal.js | 4 - .../protobufjs/node_modules/long/LICENSE | 202 - .../protobufjs/node_modules/long/README.md | 280 - .../protobufjs/node_modules/long/index.d.ts | 446 - .../protobufjs/node_modules/long/index.js | 1467 -- .../protobufjs/node_modules/long/package.json | 45 - .../node_modules/long/umd/index.d.ts | 2 - .../protobufjs/node_modules/long/umd/index.js | 1432 -- .../node_modules/long/umd/package.json | 3 - .../node_modules/protobufjs/package.json | 103 - .../protobufjs/scripts/postinstall.js | 32 - .../node_modules/protobufjs/src/common.js | 399 - .../node_modules/protobufjs/src/converter.js | 301 - .../node_modules/protobufjs/src/decoder.js | 129 - .../node_modules/protobufjs/src/encoder.js | 100 - .../node_modules/protobufjs/src/enum.js | 198 - .../node_modules/protobufjs/src/field.js | 377 - .../protobufjs/src/index-light.js | 104 - .../protobufjs/src/index-minimal.js | 36 - .../node_modules/protobufjs/src/index.js | 12 - .../node_modules/protobufjs/src/mapfield.js | 126 - .../node_modules/protobufjs/src/message.js | 139 - .../node_modules/protobufjs/src/method.js | 160 - .../node_modules/protobufjs/src/namespace.js | 433 - .../node_modules/protobufjs/src/object.js | 243 - .../node_modules/protobufjs/src/oneof.js | 203 - .../node_modules/protobufjs/src/parse.js | 859 - .../node_modules/protobufjs/src/reader.js | 411 - .../protobufjs/src/reader_buffer.js | 51 - .../node_modules/protobufjs/src/root.js | 363 - .../node_modules/protobufjs/src/roots.js | 18 - .../node_modules/protobufjs/src/rpc.js | 36 - .../protobufjs/src/rpc/service.js | 142 - .../node_modules/protobufjs/src/service.js | 167 - .../node_modules/protobufjs/src/tokenize.js | 418 - .../node_modules/protobufjs/src/type.js | 589 - .../node_modules/protobufjs/src/types.js | 196 - .../protobufjs/src/typescript.jsdoc | 15 - .../node_modules/protobufjs/src/util.js | 212 - .../protobufjs/src/util/longbits.js | 200 - .../protobufjs/src/util/minimal.js | 438 - .../node_modules/protobufjs/src/verifier.js | 177 - .../node_modules/protobufjs/src/wrappers.js | 102 - .../node_modules/protobufjs/src/writer.js | 465 - .../protobufjs/src/writer_buffer.js | 85 - .../node_modules/protobufjs/tsconfig.json | 8 - .../scripts/node_modules/pseudomap/LICENSE | 15 - .../scripts/node_modules/pseudomap/README.md | 60 - .../scripts/node_modules/pseudomap/map.js | 9 - .../node_modules/pseudomap/package.json | 25 - .../node_modules/pseudomap/pseudomap.js | 113 - .../node_modules/pseudomap/test/basic.js | 86 - .../readable-stream/CONTRIBUTING.md | 38 - .../readable-stream/GOVERNANCE.md | 136 - .../node_modules/readable-stream/LICENSE | 47 - .../node_modules/readable-stream/README.md | 106 - .../readable-stream/errors-browser.js | 127 - .../node_modules/readable-stream/errors.js | 116 - .../readable-stream/experimentalWarning.js | 17 - .../readable-stream/lib/_stream_duplex.js | 139 - .../lib/_stream_passthrough.js | 39 - .../readable-stream/lib/_stream_readable.js | 1124 - .../readable-stream/lib/_stream_transform.js | 201 - .../readable-stream/lib/_stream_writable.js | 697 - .../lib/internal/streams/async_iterator.js | 207 - .../lib/internal/streams/buffer_list.js | 210 - .../lib/internal/streams/destroy.js | 105 - .../lib/internal/streams/end-of-stream.js | 104 - .../lib/internal/streams/from-browser.js | 3 - .../lib/internal/streams/from.js | 64 - .../lib/internal/streams/pipeline.js | 97 - .../lib/internal/streams/state.js | 27 - .../lib/internal/streams/stream-browser.js | 1 - .../lib/internal/streams/stream.js | 1 - .../node_modules/readable-stream/package.json | 68 - .../readable-stream/readable-browser.js | 9 - .../node_modules/readable-stream/readable.js | 16 - .../node_modules/require-directory/.jshintrc | 67 - .../node_modules/require-directory/.npmignore | 1 - .../require-directory/.travis.yml | 3 - .../node_modules/require-directory/LICENSE | 22 - .../require-directory/README.markdown | 184 - .../node_modules/require-directory/index.js | 86 - .../require-directory/package.json | 40 - .../node_modules/requizzle/.editorconfig | 12 - .../node_modules/requizzle/.travis.yml | 8 - .../scripts/node_modules/requizzle/LICENSE | 22 - .../scripts/node_modules/requizzle/README.md | 171 - .../scripts/node_modules/requizzle/index.js | 28 - .../node_modules/requizzle/lib/loader.js | 165 - .../node_modules/requizzle/lib/requizzle.js | 93 - .../requizzle/lib/wrappers/extras.js | 21 - .../requizzle/lib/wrappers/requirepaths.js | 46 - .../requizzle/lib/wrappers/strict.js | 13 - .../node_modules/requizzle/package.json | 36 - .../node_modules/retry-request/CHANGELOG.md | 49 - .../node_modules/retry-request/index.d.ts | 31 - .../node_modules/retry-request/index.js | 273 - .../node_modules/retry-request/license | 20 - .../node_modules/retry-request/package.json | 49 - .../node_modules/retry-request/readme.md | 199 - .../scripts/node_modules/retry/License | 21 - .../scripts/node_modules/retry/README.md | 227 - .../scripts/node_modules/retry/example/dns.js | 31 - .../node_modules/retry/example/stop.js | 40 - .../scripts/node_modules/retry/index.js | 1 - .../scripts/node_modules/retry/lib/retry.js | 100 - .../node_modules/retry/lib/retry_operation.js | 162 - .../scripts/node_modules/retry/package.json | 36 - .../scripts/node_modules/rimraf/CHANGELOG.md | 65 - .../scripts/node_modules/rimraf/LICENSE | 15 - .../scripts/node_modules/rimraf/README.md | 101 - .../scripts/node_modules/rimraf/bin.js | 68 - .../node_modules/brace-expansion/LICENSE | 21 - .../node_modules/brace-expansion/README.md | 129 - .../node_modules/brace-expansion/index.js | 201 - .../node_modules/brace-expansion/package.json | 47 - .../rimraf/node_modules/glob/LICENSE | 21 - .../rimraf/node_modules/glob/README.md | 378 - .../rimraf/node_modules/glob/common.js | 238 - .../rimraf/node_modules/glob/glob.js | 790 - .../rimraf/node_modules/glob/package.json | 55 - .../rimraf/node_modules/glob/sync.js | 486 - .../rimraf/node_modules/minimatch/LICENSE | 15 - .../rimraf/node_modules/minimatch/README.md | 230 - .../node_modules/minimatch/minimatch.js | 947 - .../node_modules/minimatch/package.json | 33 - .../scripts/node_modules/rimraf/package.json | 32 - .../scripts/node_modules/rimraf/rimraf.js | 360 - .../scripts/node_modules/safe-buffer/LICENSE | 21 - .../node_modules/safe-buffer/README.md | 584 - .../node_modules/safe-buffer/index.d.ts | 187 - .../scripts/node_modules/safe-buffer/index.js | 65 - .../node_modules/safe-buffer/package.json | 51 - .../scripts/node_modules/semver/CHANGELOG.md | 39 - .../scripts/node_modules/semver/LICENSE | 15 - .../scripts/node_modules/semver/README.md | 412 - .../scripts/node_modules/semver/bin/semver | 160 - .../scripts/node_modules/semver/package.json | 28 - .../scripts/node_modules/semver/range.bnf | 16 - .../scripts/node_modules/semver/semver.js | 1483 -- .../node_modules/source-map/CHANGELOG.md | 301 - .../scripts/node_modules/source-map/LICENSE | 28 - .../scripts/node_modules/source-map/README.md | 742 - .../source-map/dist/source-map.debug.js | 3234 --- .../source-map/dist/source-map.js | 3233 --- .../source-map/dist/source-map.min.js | 2 - .../node_modules/source-map/lib/array-set.js | 121 - .../node_modules/source-map/lib/base64-vlq.js | 140 - .../node_modules/source-map/lib/base64.js | 67 - .../source-map/lib/binary-search.js | 111 - .../source-map/lib/mapping-list.js | 79 - .../node_modules/source-map/lib/quick-sort.js | 114 - .../source-map/lib/source-map-consumer.js | 1145 - .../source-map/lib/source-map-generator.js | 425 - .../source-map/lib/source-node.js | 413 - .../node_modules/source-map/lib/util.js | 488 - .../node_modules/source-map/package.json | 73 - .../node_modules/source-map/source-map.d.ts | 98 - .../node_modules/source-map/source-map.js | 8 - .../node_modules/stream-events/index.d.ts | 5 - .../node_modules/stream-events/index.js | 30 - .../node_modules/stream-events/package.json | 38 - .../node_modules/stream-events/readme.md | 64 - .../node_modules/stream-shift/.travis.yml | 6 - .../scripts/node_modules/stream-shift/LICENSE | 21 - .../node_modules/stream-shift/README.md | 25 - .../node_modules/stream-shift/index.js | 20 - .../node_modules/stream-shift/package.json | 25 - .../scripts/node_modules/stream-shift/test.js | 48 - .../node_modules/string-width/index.d.ts | 29 - .../node_modules/string-width/index.js | 47 - .../scripts/node_modules/string-width/license | 9 - .../node_modules/string-width/package.json | 56 - .../node_modules/string-width/readme.md | 50 - .../node_modules/string_decoder/LICENSE | 48 - .../node_modules/string_decoder/README.md | 47 - .../string_decoder/lib/string_decoder.js | 296 - .../node_modules/string_decoder/package.json | 34 - .../node_modules/strip-ansi/index.d.ts | 17 - .../scripts/node_modules/strip-ansi/index.js | 4 - .../scripts/node_modules/strip-ansi/license | 9 - .../node_modules/strip-ansi/package.json | 54 - .../scripts/node_modules/strip-ansi/readme.md | 46 - .../strip-json-comments/index.d.ts | 36 - .../node_modules/strip-json-comments/index.js | 77 - .../node_modules/strip-json-comments/license | 9 - .../strip-json-comments/package.json | 47 - .../strip-json-comments/readme.md | 78 - .../scripts/node_modules/stubs/index.js | 35 - .../scripts/node_modules/stubs/package.json | 25 - .../scripts/node_modules/stubs/readme.md | 73 - .../scripts/node_modules/stubs/test.js | 172 - .../node_modules/supports-color/browser.js | 5 - .../node_modules/supports-color/index.js | 135 - .../node_modules/supports-color/license | 9 - .../node_modules/supports-color/package.json | 53 - .../node_modules/supports-color/readme.md | 76 - .../scripts/node_modules/taffydb/package.json | 47 - .../node_modules/taffydb/taffy-test.html | 84 - .../scripts/node_modules/taffydb/taffy.js | 1973 -- .../node_modules/teeny-request/CHANGELOG.md | 235 - .../node_modules/teeny-request/LICENSE | 202 - .../node_modules/teeny-request/README.md | 95 - .../node_modules/teeny-request/package.json | 67 - .../node_modules/text-decoding/CHANGELOG.md | 10 - .../node_modules/text-decoding/LICENSE | 27 - .../node_modules/text-decoding/README.md | 179 - .../node_modules/text-decoding/package.json | 66 - .../text-decoding/src/encoding-indexes.js | 37 - .../text-decoding/src/encodings.js | 460 - .../text-decoding/src/implementations/big5.js | 154 - .../src/implementations/euc-jp.js | 166 - .../src/implementations/euc-kr.js | 124 - .../src/implementations/gb18030.js | 251 - .../src/implementations/iso-2022-jp.js | 441 - .../src/implementations/shift-jis.js | 170 - .../src/implementations/single-byte.js | 86 - .../src/implementations/utf16.js | 139 - .../text-decoding/src/implementations/utf8.js | 208 - .../src/implementations/x-user-defined.js | 56 - .../node_modules/text-decoding/src/index.js | 11 - .../node_modules/text-decoding/src/indexes.js | 153 - .../text-decoding/src/lib/TextDecoder.js | 189 - .../text-decoding/src/lib/TextEncoder.js | 106 - .../text-decoding/src/lib/index.js | 118 - .../node_modules/text-decoding/src/table.js | 119 - .../node_modules/text-decoding/src/utils.js | 180 - .../text-decoding/types/externs.js | 32 - .../scripts/node_modules/tmp/CHANGELOG.md | 288 - .../example/scripts/node_modules/tmp/LICENSE | 21 - .../scripts/node_modules/tmp/README.md | 365 - .../scripts/node_modules/tmp/lib/tmp.js | 780 - .../scripts/node_modules/tmp/package.json | 58 - .../scripts/node_modules/tr46/.npmignore | 4 - .../scripts/node_modules/tr46/index.js | 193 - .../scripts/node_modules/tr46/lib/.gitkeep | 0 .../node_modules/tr46/lib/mappingTable.json | 1 - .../scripts/node_modules/tr46/package.json | 31 - .../node_modules/tslib/CopyrightNotice.txt | 15 - .../scripts/node_modules/tslib/LICENSE.txt | 12 - .../scripts/node_modules/tslib/README.md | 164 - .../scripts/node_modules/tslib/SECURITY.md | 41 - .../node_modules/tslib/modules/index.js | 55 - .../node_modules/tslib/modules/package.json | 3 - .../scripts/node_modules/tslib/package.json | 38 - .../scripts/node_modules/tslib/tslib.d.ts | 398 - .../scripts/node_modules/tslib/tslib.es6.html | 1 - .../scripts/node_modules/tslib/tslib.es6.js | 248 - .../scripts/node_modules/tslib/tslib.html | 1 - .../scripts/node_modules/tslib/tslib.js | 317 - .../scripts/node_modules/type-check/LICENSE | 22 - .../scripts/node_modules/type-check/README.md | 210 - .../node_modules/type-check/lib/check.js | 126 - .../node_modules/type-check/lib/index.js | 16 - .../node_modules/type-check/lib/parse-type.js | 196 - .../node_modules/type-check/package.json | 40 - .../node_modules/uc.micro/CHANGELOG.md | 52 - .../scripts/node_modules/uc.micro/LICENSE.txt | 20 - .../scripts/node_modules/uc.micro/README.md | 14 - .../uc.micro/categories/Cc/regex.js | 1 - .../uc.micro/categories/Cf/regex.js | 1 - .../uc.micro/categories/P/regex.js | 1 - .../uc.micro/categories/Z/regex.js | 1 - .../scripts/node_modules/uc.micro/index.js | 7 - .../node_modules/uc.micro/package.json | 21 - .../uc.micro/properties/Any/regex.js | 1 - .../scripts/node_modules/uglify-js/LICENSE | 29 - .../scripts/node_modules/uglify-js/README.md | 1478 -- .../node_modules/uglify-js/bin/uglifyjs | 605 - .../scripts/node_modules/uglify-js/lib/ast.js | 2356 -- .../node_modules/uglify-js/lib/compress.js | 14241 ------------ .../node_modules/uglify-js/lib/minify.js | 276 - .../node_modules/uglify-js/lib/mozilla-ast.js | 1310 -- .../node_modules/uglify-js/lib/output.js | 1956 -- .../node_modules/uglify-js/lib/parse.js | 2585 --- .../node_modules/uglify-js/lib/propmangle.js | 328 - .../node_modules/uglify-js/lib/scope.js | 866 - .../node_modules/uglify-js/lib/sourcemap.js | 195 - .../node_modules/uglify-js/lib/transform.js | 250 - .../node_modules/uglify-js/lib/utils.js | 287 - .../node_modules/uglify-js/package.json | 56 - .../uglify-js/tools/domprops.html | 456 - .../uglify-js/tools/domprops.json | 8325 ------- .../node_modules/uglify-js/tools/exports.js | 8 - .../node_modules/uglify-js/tools/node.js | 110 - .../node_modules/uglify-js/tools/tty.js | 22 - .../scripts/node_modules/underscore/LICENSE | 22 - .../scripts/node_modules/underscore/README.md | 34 - .../underscore/amd/_baseCreate.js | 21 - .../underscore/amd/_baseIteratee.js | 15 - .../node_modules/underscore/amd/_cb.js | 12 - .../underscore/amd/_chainResult.js | 10 - .../underscore/amd/_collectNonEnumProps.js | 42 - .../underscore/amd/_createAssigner.js | 24 - .../underscore/amd/_createEscaper.js | 21 - .../underscore/amd/_createIndexFinder.js | 30 - .../amd/_createPredicateIndexFinder.js | 18 - .../underscore/amd/_createReduce.js | 30 - .../amd/_createSizePropertyCheck.js | 13 - .../node_modules/underscore/amd/_deepGet.js | 15 - .../node_modules/underscore/amd/_escapeMap.js | 15 - .../underscore/amd/_executeBound.js | 16 - .../node_modules/underscore/amd/_flatten.js | 32 - .../underscore/amd/_getByteLength.js | 8 - .../node_modules/underscore/amd/_getLength.js | 8 - .../node_modules/underscore/amd/_group.js | 18 - .../node_modules/underscore/amd/_has.js | 10 - .../underscore/amd/_hasObjectTag.js | 7 - .../underscore/amd/_isArrayLike.js | 11 - .../underscore/amd/_isBufferLike.js | 9 - .../node_modules/underscore/amd/_keyInObj.js | 11 - .../underscore/amd/_methodFingerprint.js | 44 - .../underscore/amd/_optimizeCb.js | 27 - .../node_modules/underscore/amd/_set.js | 21 - .../node_modules/underscore/amd/_setup.js | 70 - .../underscore/amd/_shallowProperty.js | 12 - .../underscore/amd/_stringTagBug.js | 16 - .../node_modules/underscore/amd/_tagTester.js | 13 - .../underscore/amd/_toBufferView.js | 15 - .../node_modules/underscore/amd/_toPath.js | 11 - .../underscore/amd/_unescapeMap.js | 8 - .../node_modules/underscore/amd/after.js | 14 - .../node_modules/underscore/amd/allKeys.js | 15 - .../node_modules/underscore/amd/before.js | 18 - .../node_modules/underscore/amd/bind.js | 15 - .../node_modules/underscore/amd/bindAll.js | 19 - .../node_modules/underscore/amd/chain.js | 12 - .../node_modules/underscore/amd/chunk.js | 17 - .../node_modules/underscore/amd/clone.js | 11 - .../node_modules/underscore/amd/compact.js | 10 - .../node_modules/underscore/amd/compose.js | 18 - .../node_modules/underscore/amd/constant.js | 12 - .../node_modules/underscore/amd/contains.js | 12 - .../node_modules/underscore/amd/countBy.js | 12 - .../node_modules/underscore/amd/create.js | 14 - .../node_modules/underscore/amd/debounce.js | 43 - .../node_modules/underscore/amd/defaults.js | 8 - .../node_modules/underscore/amd/defer.js | 9 - .../node_modules/underscore/amd/delay.js | 13 - .../node_modules/underscore/amd/difference.js | 14 - .../node_modules/underscore/amd/each.js | 25 - .../node_modules/underscore/amd/escape.js | 8 - .../node_modules/underscore/amd/every.js | 17 - .../node_modules/underscore/amd/extend.js | 8 - .../node_modules/underscore/amd/extendOwn.js | 10 - .../node_modules/underscore/amd/filter.js | 15 - .../node_modules/underscore/amd/find.js | 12 - .../node_modules/underscore/amd/findIndex.js | 8 - .../node_modules/underscore/amd/findKey.js | 15 - .../underscore/amd/findLastIndex.js | 8 - .../node_modules/underscore/amd/findWhere.js | 11 - .../node_modules/underscore/amd/first.js | 13 - .../node_modules/underscore/amd/flatten.js | 11 - .../node_modules/underscore/amd/functions.js | 14 - .../node_modules/underscore/amd/get.js | 14 - .../node_modules/underscore/amd/groupBy.js | 11 - .../node_modules/underscore/amd/has.js | 19 - .../node_modules/underscore/amd/identity.js | 10 - .../underscore/amd/index-default.js | 12 - .../node_modules/underscore/amd/index.js | 154 - .../node_modules/underscore/amd/indexBy.js | 11 - .../node_modules/underscore/amd/indexOf.js | 11 - .../node_modules/underscore/amd/initial.js | 12 - .../underscore/amd/intersection.js | 22 - .../node_modules/underscore/amd/invert.js | 15 - .../node_modules/underscore/amd/invoke.js | 28 - .../underscore/amd/isArguments.js | 19 - .../node_modules/underscore/amd/isArray.js | 9 - .../underscore/amd/isArrayBuffer.js | 7 - .../node_modules/underscore/amd/isBoolean.js | 10 - .../node_modules/underscore/amd/isDataView.js | 15 - .../node_modules/underscore/amd/isDate.js | 7 - .../node_modules/underscore/amd/isElement.js | 10 - .../node_modules/underscore/amd/isEmpty.js | 18 - .../node_modules/underscore/amd/isEqual.js | 133 - .../node_modules/underscore/amd/isError.js | 7 - .../node_modules/underscore/amd/isFinite.js | 10 - .../node_modules/underscore/amd/isFunction.js | 18 - .../node_modules/underscore/amd/isMap.js | 7 - .../node_modules/underscore/amd/isMatch.js | 17 - .../node_modules/underscore/amd/isNaN.js | 10 - .../node_modules/underscore/amd/isNull.js | 10 - .../node_modules/underscore/amd/isNumber.js | 7 - .../node_modules/underscore/amd/isObject.js | 11 - .../node_modules/underscore/amd/isRegExp.js | 7 - .../node_modules/underscore/amd/isSet.js | 7 - .../node_modules/underscore/amd/isString.js | 7 - .../node_modules/underscore/amd/isSymbol.js | 7 - .../underscore/amd/isTypedArray.js | 16 - .../underscore/amd/isUndefined.js | 10 - .../node_modules/underscore/amd/isWeakMap.js | 7 - .../node_modules/underscore/amd/isWeakSet.js | 7 - .../node_modules/underscore/amd/iteratee.js | 13 - .../node_modules/underscore/amd/keys.js | 17 - .../node_modules/underscore/amd/last.js | 13 - .../underscore/amd/lastIndexOf.js | 9 - .../node_modules/underscore/amd/map.js | 18 - .../node_modules/underscore/amd/mapObject.js | 19 - .../node_modules/underscore/amd/matcher.js | 14 - .../node_modules/underscore/amd/max.js | 30 - .../node_modules/underscore/amd/memoize.js | 17 - .../node_modules/underscore/amd/min.js | 30 - .../node_modules/underscore/amd/mixin.js | 18 - .../node_modules/underscore/amd/negate.js | 12 - .../node_modules/underscore/amd/noop.js | 8 - .../node_modules/underscore/amd/now.js | 10 - .../node_modules/underscore/amd/object.js | 20 - .../node_modules/underscore/amd/omit.js | 20 - .../node_modules/underscore/amd/once.js | 9 - .../node_modules/underscore/amd/pairs.js | 17 - .../node_modules/underscore/amd/partial.js | 25 - .../node_modules/underscore/amd/partition.js | 11 - .../node_modules/underscore/amd/pick.js | 25 - .../node_modules/underscore/amd/pluck.js | 10 - .../node_modules/underscore/amd/property.js | 14 - .../node_modules/underscore/amd/propertyOf.js | 13 - .../node_modules/underscore/amd/random.js | 14 - .../node_modules/underscore/amd/range.js | 27 - .../node_modules/underscore/amd/reduce.js | 9 - .../underscore/amd/reduceRight.js | 8 - .../node_modules/underscore/amd/reject.js | 10 - .../node_modules/underscore/amd/rest.js | 12 - .../underscore/amd/restArguments.js | 33 - .../node_modules/underscore/amd/result.js | 25 - .../node_modules/underscore/amd/sample.js | 27 - .../node_modules/underscore/amd/set.js | 15 - .../node_modules/underscore/amd/shuffle.js | 10 - .../node_modules/underscore/amd/size.js | 11 - .../node_modules/underscore/amd/some.js | 17 - .../node_modules/underscore/amd/sortBy.js | 26 - .../underscore/amd/sortedIndex.js | 18 - .../node_modules/underscore/amd/tap.js | 13 - .../node_modules/underscore/amd/template.js | 103 - .../underscore/amd/templateSettings.js | 13 - .../node_modules/underscore/amd/throttle.js | 51 - .../node_modules/underscore/amd/times.js | 13 - .../node_modules/underscore/amd/toArray.js | 18 - .../node_modules/underscore/amd/toPath.js | 12 - .../amd/underscore-array-methods.js | 30 - .../node_modules/underscore/amd/underscore.js | 29 - .../node_modules/underscore/amd/unescape.js | 8 - .../node_modules/underscore/amd/union.js | 11 - .../node_modules/underscore/amd/uniq.js | 37 - .../node_modules/underscore/amd/uniqueId.js | 13 - .../node_modules/underscore/amd/unzip.js | 17 - .../node_modules/underscore/amd/values.js | 16 - .../node_modules/underscore/amd/where.js | 11 - .../node_modules/underscore/amd/without.js | 10 - .../node_modules/underscore/amd/wrap.js | 12 - .../node_modules/underscore/amd/zip.js | 9 - .../underscore/cjs/_baseCreate.js | 20 - .../underscore/cjs/_baseIteratee.js | 19 - .../node_modules/underscore/cjs/_cb.js | 12 - .../underscore/cjs/_chainResult.js | 8 - .../underscore/cjs/_collectNonEnumProps.js | 42 - .../underscore/cjs/_createAssigner.js | 20 - .../underscore/cjs/_createEscaper.js | 19 - .../underscore/cjs/_createIndexFinder.js | 30 - .../cjs/_createPredicateIndexFinder.js | 17 - .../underscore/cjs/_createReduce.js | 30 - .../cjs/_createSizePropertyCheck.js | 11 - .../node_modules/underscore/cjs/_deepGet.js | 11 - .../node_modules/underscore/cjs/_escapeMap.js | 11 - .../underscore/cjs/_executeBound.js | 15 - .../node_modules/underscore/cjs/_flatten.js | 33 - .../underscore/cjs/_getByteLength.js | 6 - .../node_modules/underscore/cjs/_getLength.js | 6 - .../node_modules/underscore/cjs/_group.js | 17 - .../node_modules/underscore/cjs/_has.js | 8 - .../underscore/cjs/_hasObjectTag.js | 5 - .../underscore/cjs/_isArrayLike.js | 10 - .../underscore/cjs/_isBufferLike.js | 8 - .../node_modules/underscore/cjs/_keyInObj.js | 7 - .../underscore/cjs/_methodFingerprint.js | 44 - .../underscore/cjs/_optimizeCb.js | 23 - .../node_modules/underscore/cjs/_set.js | 21 - .../node_modules/underscore/cjs/_setup.js | 66 - .../underscore/cjs/_shallowProperty.js | 8 - .../underscore/cjs/_stringTagBug.js | 15 - .../node_modules/underscore/cjs/_tagTester.js | 11 - .../underscore/cjs/_toBufferView.js | 13 - .../node_modules/underscore/cjs/_toPath.js | 10 - .../underscore/cjs/_unescapeMap.js | 7 - .../node_modules/underscore/cjs/after.js | 10 - .../node_modules/underscore/cjs/allKeys.js | 15 - .../node_modules/underscore/cjs/before.js | 14 - .../node_modules/underscore/cjs/bind.js | 15 - .../node_modules/underscore/cjs/bindAll.js | 19 - .../node_modules/underscore/cjs/chain.js | 10 - .../node_modules/underscore/cjs/chunk.js | 15 - .../node_modules/underscore/cjs/clone.js | 11 - .../node_modules/underscore/cjs/compact.js | 8 - .../node_modules/underscore/cjs/compose.js | 14 - .../node_modules/underscore/cjs/constant.js | 8 - .../node_modules/underscore/cjs/contains.js | 12 - .../node_modules/underscore/cjs/countBy.js | 11 - .../node_modules/underscore/cjs/create.js | 13 - .../node_modules/underscore/cjs/debounce.js | 42 - .../node_modules/underscore/cjs/defaults.js | 7 - .../node_modules/underscore/cjs/defer.js | 9 - .../node_modules/underscore/cjs/delay.js | 11 - .../node_modules/underscore/cjs/difference.js | 15 - .../node_modules/underscore/cjs/each.js | 25 - .../node_modules/underscore/cjs/escape.js | 7 - .../node_modules/underscore/cjs/every.js | 17 - .../node_modules/underscore/cjs/extend.js | 7 - .../node_modules/underscore/cjs/extendOwn.js | 9 - .../node_modules/underscore/cjs/filter.js | 14 - .../node_modules/underscore/cjs/find.js | 12 - .../node_modules/underscore/cjs/findIndex.js | 6 - .../node_modules/underscore/cjs/findKey.js | 14 - .../underscore/cjs/findLastIndex.js | 6 - .../node_modules/underscore/cjs/findWhere.js | 10 - .../node_modules/underscore/cjs/first.js | 11 - .../node_modules/underscore/cjs/flatten.js | 9 - .../node_modules/underscore/cjs/functions.js | 12 - .../node_modules/underscore/cjs/get.js | 14 - .../node_modules/underscore/cjs/groupBy.js | 10 - .../node_modules/underscore/cjs/has.js | 18 - .../node_modules/underscore/cjs/identity.js | 6 - .../underscore/cjs/index-default.js | 11 - .../node_modules/underscore/cjs/index.js | 278 - .../node_modules/underscore/cjs/indexBy.js | 9 - .../node_modules/underscore/cjs/indexOf.js | 11 - .../node_modules/underscore/cjs/initial.js | 10 - .../underscore/cjs/intersection.js | 21 - .../node_modules/underscore/cjs/invert.js | 13 - .../node_modules/underscore/cjs/invoke.js | 30 - .../underscore/cjs/isArguments.js | 18 - .../node_modules/underscore/cjs/isArray.js | 8 - .../underscore/cjs/isArrayBuffer.js | 5 - .../node_modules/underscore/cjs/isBoolean.js | 8 - .../node_modules/underscore/cjs/isDataView.js | 16 - .../node_modules/underscore/cjs/isDate.js | 5 - .../node_modules/underscore/cjs/isElement.js | 6 - .../node_modules/underscore/cjs/isEmpty.js | 20 - .../node_modules/underscore/cjs/isEqual.js | 140 - .../node_modules/underscore/cjs/isError.js | 5 - .../node_modules/underscore/cjs/isFinite.js | 9 - .../node_modules/underscore/cjs/isFunction.js | 17 - .../node_modules/underscore/cjs/isMap.js | 7 - .../node_modules/underscore/cjs/isMatch.js | 15 - .../node_modules/underscore/cjs/isNaN.js | 9 - .../node_modules/underscore/cjs/isNull.js | 6 - .../node_modules/underscore/cjs/isNumber.js | 5 - .../node_modules/underscore/cjs/isObject.js | 7 - .../node_modules/underscore/cjs/isRegExp.js | 5 - .../node_modules/underscore/cjs/isSet.js | 7 - .../node_modules/underscore/cjs/isString.js | 5 - .../node_modules/underscore/cjs/isSymbol.js | 5 - .../underscore/cjs/isTypedArray.js | 17 - .../underscore/cjs/isUndefined.js | 6 - .../node_modules/underscore/cjs/isWeakMap.js | 7 - .../node_modules/underscore/cjs/isWeakSet.js | 5 - .../node_modules/underscore/cjs/iteratee.js | 12 - .../node_modules/underscore/cjs/keys.js | 18 - .../node_modules/underscore/cjs/last.js | 11 - .../underscore/cjs/lastIndexOf.js | 8 - .../node_modules/underscore/cjs/map.js | 18 - .../node_modules/underscore/cjs/mapObject.js | 18 - .../node_modules/underscore/cjs/matcher.js | 13 - .../node_modules/underscore/cjs/max.js | 31 - .../node_modules/underscore/cjs/memoize.js | 15 - .../node_modules/underscore/cjs/min.js | 31 - .../node_modules/underscore/cjs/mixin.js | 20 - .../node_modules/underscore/cjs/negate.js | 8 - .../node_modules/underscore/cjs/noop.js | 4 - .../node_modules/underscore/cjs/now.js | 6 - .../node_modules/underscore/cjs/object.js | 18 - .../node_modules/underscore/cjs/omit.js | 24 - .../node_modules/underscore/cjs/once.js | 8 - .../node_modules/underscore/cjs/pairs.js | 15 - .../node_modules/underscore/cjs/partial.js | 25 - .../node_modules/underscore/cjs/partition.js | 9 - .../node_modules/underscore/cjs/pick.js | 28 - .../node_modules/underscore/cjs/pluck.js | 9 - .../node_modules/underscore/cjs/property.js | 13 - .../node_modules/underscore/cjs/propertyOf.js | 12 - .../node_modules/underscore/cjs/random.js | 10 - .../node_modules/underscore/cjs/range.js | 23 - .../node_modules/underscore/cjs/reduce.js | 7 - .../underscore/cjs/reduceRight.js | 6 - .../node_modules/underscore/cjs/reject.js | 10 - .../node_modules/underscore/cjs/rest.js | 10 - .../underscore/cjs/restArguments.js | 29 - .../node_modules/underscore/cjs/result.js | 24 - .../node_modules/underscore/cjs/sample.js | 29 - .../node_modules/underscore/cjs/set.js | 15 - .../node_modules/underscore/cjs/shuffle.js | 8 - .../node_modules/underscore/cjs/size.js | 10 - .../node_modules/underscore/cjs/some.js | 17 - .../node_modules/underscore/cjs/sortBy.js | 26 - .../underscore/cjs/sortedIndex.js | 17 - .../node_modules/underscore/cjs/tap.js | 9 - .../node_modules/underscore/cjs/template.js | 103 - .../underscore/cjs/templateSettings.js | 11 - .../node_modules/underscore/cjs/throttle.js | 49 - .../node_modules/underscore/cjs/times.js | 11 - .../node_modules/underscore/cjs/toArray.js | 22 - .../node_modules/underscore/cjs/toPath.js | 11 - .../cjs/underscore-array-methods.js | 31 - .../node_modules/underscore/cjs/underscore.js | 27 - .../node_modules/underscore/cjs/unescape.js | 7 - .../node_modules/underscore/cjs/union.js | 11 - .../node_modules/underscore/cjs/uniq.js | 38 - .../node_modules/underscore/cjs/uniqueId.js | 9 - .../node_modules/underscore/cjs/unzip.js | 17 - .../node_modules/underscore/cjs/values.js | 14 - .../node_modules/underscore/cjs/where.js | 10 - .../node_modules/underscore/cjs/without.js | 9 - .../node_modules/underscore/cjs/wrap.js | 10 - .../node_modules/underscore/cjs/zip.js | 8 - .../node_modules/underscore/modules/.eslintrc | 21 - .../underscore/modules/_baseCreate.js | 18 - .../underscore/modules/_baseIteratee.js | 17 - .../node_modules/underscore/modules/_cb.js | 10 - .../underscore/modules/_chainResult.js | 6 - .../modules/_collectNonEnumProps.js | 40 - .../underscore/modules/_createAssigner.js | 18 - .../underscore/modules/_createEscaper.js | 17 - .../underscore/modules/_createIndexFinder.js | 28 - .../modules/_createPredicateIndexFinder.js | 15 - .../underscore/modules/_createReduce.js | 28 - .../modules/_createSizePropertyCheck.js | 9 - .../underscore/modules/_deepGet.js | 9 - .../underscore/modules/_escapeMap.js | 9 - .../underscore/modules/_executeBound.js | 13 - .../underscore/modules/_flatten.js | 31 - .../underscore/modules/_getByteLength.js | 4 - .../underscore/modules/_getLength.js | 4 - .../node_modules/underscore/modules/_group.js | 15 - .../node_modules/underscore/modules/_has.js | 6 - .../underscore/modules/_hasObjectTag.js | 3 - .../underscore/modules/_isArrayLike.js | 8 - .../underscore/modules/_isBufferLike.js | 6 - .../underscore/modules/_keyInObj.js | 5 - .../underscore/modules/_methodFingerprint.js | 37 - .../underscore/modules/_optimizeCb.js | 21 - .../node_modules/underscore/modules/_setup.js | 43 - .../underscore/modules/_shallowProperty.js | 6 - .../underscore/modules/_stringTagBug.js | 10 - .../underscore/modules/_tagTester.js | 9 - .../underscore/modules/_toBufferView.js | 11 - .../underscore/modules/_toPath.js | 8 - .../underscore/modules/_unescapeMap.js | 5 - .../node_modules/underscore/modules/after.js | 8 - .../underscore/modules/allKeys.js | 13 - .../node_modules/underscore/modules/before.js | 12 - .../node_modules/underscore/modules/bind.js | 13 - .../underscore/modules/bindAll.js | 17 - .../node_modules/underscore/modules/chain.js | 8 - .../node_modules/underscore/modules/chunk.js | 13 - .../node_modules/underscore/modules/clone.js | 9 - .../underscore/modules/compact.js | 6 - .../underscore/modules/compose.js | 12 - .../underscore/modules/constant.js | 6 - .../underscore/modules/contains.js | 10 - .../underscore/modules/countBy.js | 9 - .../node_modules/underscore/modules/create.js | 11 - .../underscore/modules/debounce.js | 40 - .../underscore/modules/defaults.js | 5 - .../node_modules/underscore/modules/defer.js | 7 - .../node_modules/underscore/modules/delay.js | 9 - .../underscore/modules/difference.js | 13 - .../node_modules/underscore/modules/each.js | 23 - .../node_modules/underscore/modules/escape.js | 5 - .../node_modules/underscore/modules/every.js | 15 - .../node_modules/underscore/modules/extend.js | 5 - .../underscore/modules/extendOwn.js | 7 - .../node_modules/underscore/modules/filter.js | 12 - .../node_modules/underscore/modules/find.js | 10 - .../underscore/modules/findIndex.js | 4 - .../underscore/modules/findKey.js | 12 - .../underscore/modules/findLastIndex.js | 4 - .../underscore/modules/findWhere.js | 8 - .../node_modules/underscore/modules/first.js | 9 - .../underscore/modules/flatten.js | 7 - .../underscore/modules/functions.js | 10 - .../node_modules/underscore/modules/get.js | 12 - .../underscore/modules/groupBy.js | 8 - .../node_modules/underscore/modules/has.js | 16 - .../underscore/modules/identity.js | 4 - .../underscore/modules/index-all.js | 18 - .../underscore/modules/index-default.js | 27 - .../node_modules/underscore/modules/index.js | 200 - .../underscore/modules/indexBy.js | 7 - .../underscore/modules/indexOf.js | 9 - .../underscore/modules/initial.js | 8 - .../underscore/modules/intersection.js | 19 - .../node_modules/underscore/modules/invert.js | 11 - .../node_modules/underscore/modules/invoke.js | 28 - .../underscore/modules/isArguments.js | 16 - .../underscore/modules/isArray.js | 6 - .../underscore/modules/isArrayBuffer.js | 3 - .../underscore/modules/isBoolean.js | 6 - .../underscore/modules/isDataView.js | 14 - .../node_modules/underscore/modules/isDate.js | 3 - .../underscore/modules/isElement.js | 4 - .../underscore/modules/isEmpty.js | 18 - .../underscore/modules/isEqual.js | 138 - .../underscore/modules/isError.js | 3 - .../underscore/modules/isFinite.js | 7 - .../underscore/modules/isFunction.js | 15 - .../node_modules/underscore/modules/isMap.js | 5 - .../underscore/modules/isMatch.js | 13 - .../node_modules/underscore/modules/isNaN.js | 7 - .../node_modules/underscore/modules/isNull.js | 4 - .../underscore/modules/isNumber.js | 3 - .../underscore/modules/isObject.js | 5 - .../underscore/modules/isRegExp.js | 3 - .../node_modules/underscore/modules/isSet.js | 5 - .../underscore/modules/isString.js | 3 - .../underscore/modules/isSymbol.js | 3 - .../underscore/modules/isTypedArray.js | 15 - .../underscore/modules/isUndefined.js | 4 - .../underscore/modules/isWeakMap.js | 5 - .../underscore/modules/isWeakSet.js | 3 - .../underscore/modules/iteratee.js | 10 - .../node_modules/underscore/modules/keys.js | 16 - .../node_modules/underscore/modules/last.js | 9 - .../underscore/modules/lastIndexOf.js | 6 - .../node_modules/underscore/modules/map.js | 16 - .../underscore/modules/mapObject.js | 16 - .../underscore/modules/matcher.js | 11 - .../node_modules/underscore/modules/max.js | 29 - .../underscore/modules/memoize.js | 13 - .../node_modules/underscore/modules/min.js | 29 - .../node_modules/underscore/modules/mixin.js | 18 - .../node_modules/underscore/modules/negate.js | 6 - .../node_modules/underscore/modules/noop.js | 2 - .../node_modules/underscore/modules/now.js | 4 - .../node_modules/underscore/modules/object.js | 16 - .../node_modules/underscore/modules/omit.js | 22 - .../node_modules/underscore/modules/once.js | 6 - .../underscore/modules/package.json | 1 - .../node_modules/underscore/modules/pairs.js | 13 - .../underscore/modules/partial.js | 24 - .../underscore/modules/partition.js | 7 - .../node_modules/underscore/modules/pick.js | 26 - .../node_modules/underscore/modules/pluck.js | 7 - .../underscore/modules/property.js | 11 - .../underscore/modules/propertyOf.js | 10 - .../node_modules/underscore/modules/random.js | 8 - .../node_modules/underscore/modules/range.js | 21 - .../node_modules/underscore/modules/reduce.js | 5 - .../underscore/modules/reduceRight.js | 4 - .../node_modules/underscore/modules/reject.js | 8 - .../node_modules/underscore/modules/rest.js | 8 - .../underscore/modules/restArguments.js | 27 - .../node_modules/underscore/modules/result.js | 22 - .../node_modules/underscore/modules/sample.js | 27 - .../underscore/modules/shuffle.js | 6 - .../node_modules/underscore/modules/size.js | 8 - .../node_modules/underscore/modules/some.js | 15 - .../node_modules/underscore/modules/sortBy.js | 24 - .../underscore/modules/sortedIndex.js | 15 - .../node_modules/underscore/modules/tap.js | 7 - .../underscore/modules/template.js | 101 - .../underscore/modules/templateSettings.js | 9 - .../underscore/modules/throttle.js | 47 - .../node_modules/underscore/modules/times.js | 9 - .../underscore/modules/toArray.js | 20 - .../node_modules/underscore/modules/toPath.js | 9 - .../modules/underscore-array-methods.js | 31 - .../underscore/modules/underscore.js | 25 - .../underscore/modules/unescape.js | 5 - .../node_modules/underscore/modules/union.js | 9 - .../node_modules/underscore/modules/uniq.js | 36 - .../underscore/modules/uniqueId.js | 7 - .../node_modules/underscore/modules/unzip.js | 15 - .../node_modules/underscore/modules/values.js | 12 - .../node_modules/underscore/modules/where.js | 8 - .../underscore/modules/without.js | 7 - .../node_modules/underscore/modules/wrap.js | 8 - .../node_modules/underscore/modules/zip.js | 6 - .../node_modules/underscore/package.json | 124 - .../underscore/underscore-esm-min.js | 5 - .../node_modules/underscore/underscore-esm.js | 2034 -- .../node_modules/underscore/underscore-min.js | 6 - .../underscore/underscore-node-f.cjs | 2158 -- .../underscore/underscore-node-f.cjs.map | 1 - .../underscore/underscore-node.cjs | 11 - .../underscore/underscore-node.cjs.map | 1 - .../underscore/underscore-node.mjs | 7 - .../underscore/underscore-node.mjs.map | 1 - .../underscore/underscore-umd-min.js | 6 - .../node_modules/underscore/underscore-umd.js | 2042 -- .../node_modules/underscore/underscore.js | 2042 -- .../node_modules/util-deprecate/History.md | 16 - .../node_modules/util-deprecate/LICENSE | 24 - .../node_modules/util-deprecate/README.md | 53 - .../node_modules/util-deprecate/browser.js | 67 - .../node_modules/util-deprecate/node.js | 6 - .../node_modules/util-deprecate/package.json | 27 - .../scripts/node_modules/uuid/CHANGELOG.md | 268 - .../scripts/node_modules/uuid/CONTRIBUTING.md | 18 - .../scripts/node_modules/uuid/LICENSE.md | 9 - .../scripts/node_modules/uuid/README.md | 462 - .../scripts/node_modules/uuid/dist/bin/uuid | 2 - .../uuid/dist/commonjs-browser/index.js | 79 - .../uuid/dist/commonjs-browser/md5.js | 223 - .../uuid/dist/commonjs-browser/native.js | 11 - .../uuid/dist/commonjs-browser/nil.js | 8 - .../uuid/dist/commonjs-browser/parse.js | 45 - .../uuid/dist/commonjs-browser/regex.js | 8 - .../uuid/dist/commonjs-browser/rng.js | 25 - .../uuid/dist/commonjs-browser/sha1.js | 104 - .../uuid/dist/commonjs-browser/stringify.js | 44 - .../uuid/dist/commonjs-browser/v1.js | 107 - .../uuid/dist/commonjs-browser/v3.js | 16 - .../uuid/dist/commonjs-browser/v35.js | 80 - .../uuid/dist/commonjs-browser/v4.js | 43 - .../uuid/dist/commonjs-browser/v5.js | 16 - .../uuid/dist/commonjs-browser/validate.js | 17 - .../uuid/dist/commonjs-browser/version.js | 21 - .../uuid/dist/esm-browser/index.js | 9 - .../node_modules/uuid/dist/esm-browser/md5.js | 215 - .../uuid/dist/esm-browser/native.js | 4 - .../node_modules/uuid/dist/esm-browser/nil.js | 1 - .../uuid/dist/esm-browser/parse.js | 35 - .../uuid/dist/esm-browser/regex.js | 1 - .../node_modules/uuid/dist/esm-browser/rng.js | 18 - .../uuid/dist/esm-browser/sha1.js | 96 - .../uuid/dist/esm-browser/stringify.js | 33 - .../node_modules/uuid/dist/esm-browser/v1.js | 95 - .../node_modules/uuid/dist/esm-browser/v3.js | 4 - .../node_modules/uuid/dist/esm-browser/v35.js | 66 - .../node_modules/uuid/dist/esm-browser/v4.js | 29 - .../node_modules/uuid/dist/esm-browser/v5.js | 4 - .../uuid/dist/esm-browser/validate.js | 7 - .../uuid/dist/esm-browser/version.js | 11 - .../node_modules/uuid/dist/esm-node/index.js | 9 - .../node_modules/uuid/dist/esm-node/md5.js | 13 - .../node_modules/uuid/dist/esm-node/native.js | 4 - .../node_modules/uuid/dist/esm-node/nil.js | 1 - .../node_modules/uuid/dist/esm-node/parse.js | 35 - .../node_modules/uuid/dist/esm-node/regex.js | 1 - .../node_modules/uuid/dist/esm-node/rng.js | 12 - .../node_modules/uuid/dist/esm-node/sha1.js | 13 - .../uuid/dist/esm-node/stringify.js | 33 - .../node_modules/uuid/dist/esm-node/v1.js | 95 - .../node_modules/uuid/dist/esm-node/v3.js | 4 - .../node_modules/uuid/dist/esm-node/v35.js | 66 - .../node_modules/uuid/dist/esm-node/v4.js | 29 - .../node_modules/uuid/dist/esm-node/v5.js | 4 - .../uuid/dist/esm-node/validate.js | 7 - .../uuid/dist/esm-node/version.js | 11 - .../scripts/node_modules/uuid/dist/index.js | 79 - .../node_modules/uuid/dist/md5-browser.js | 223 - .../scripts/node_modules/uuid/dist/md5.js | 23 - .../node_modules/uuid/dist/native-browser.js | 11 - .../scripts/node_modules/uuid/dist/native.js | 15 - .../scripts/node_modules/uuid/dist/nil.js | 8 - .../scripts/node_modules/uuid/dist/parse.js | 45 - .../scripts/node_modules/uuid/dist/regex.js | 8 - .../node_modules/uuid/dist/rng-browser.js | 25 - .../scripts/node_modules/uuid/dist/rng.js | 24 - .../node_modules/uuid/dist/sha1-browser.js | 104 - .../scripts/node_modules/uuid/dist/sha1.js | 23 - .../node_modules/uuid/dist/stringify.js | 44 - .../node_modules/uuid/dist/uuid-bin.js | 85 - .../scripts/node_modules/uuid/dist/v1.js | 107 - .../scripts/node_modules/uuid/dist/v3.js | 16 - .../scripts/node_modules/uuid/dist/v35.js | 80 - .../scripts/node_modules/uuid/dist/v4.js | 43 - .../scripts/node_modules/uuid/dist/v5.js | 16 - .../node_modules/uuid/dist/validate.js | 17 - .../scripts/node_modules/uuid/dist/version.js | 21 - .../scripts/node_modules/uuid/package.json | 131 - .../scripts/node_modules/uuid/wrapper.mjs | 10 - .../webidl-conversions/LICENSE.md | 12 - .../node_modules/webidl-conversions/README.md | 53 - .../webidl-conversions/lib/index.js | 189 - .../webidl-conversions/package.json | 23 - .../websocket-driver/CHANGELOG.md | 142 - .../node_modules/websocket-driver/LICENSE.md | 12 - .../node_modules/websocket-driver/README.md | 370 - .../websocket-driver/lib/websocket/driver.js | 43 - .../lib/websocket/driver/base.js | 193 - .../lib/websocket/driver/client.js | 142 - .../lib/websocket/driver/draft75.js | 123 - .../lib/websocket/driver/draft76.js | 117 - .../lib/websocket/driver/headers.js | 35 - .../lib/websocket/driver/hybi.js | 483 - .../lib/websocket/driver/hybi/frame.js | 21 - .../lib/websocket/driver/hybi/message.js | 34 - .../lib/websocket/driver/proxy.js | 99 - .../lib/websocket/driver/server.js | 112 - .../lib/websocket/driver/stream_reader.js | 69 - .../lib/websocket/http_parser.js | 135 - .../websocket-driver/lib/websocket/streams.js | 146 - .../websocket-driver/package.json | 35 - .../websocket-extensions/CHANGELOG.md | 28 - .../websocket-extensions/LICENSE.md | 12 - .../websocket-extensions/README.md | 331 - .../websocket-extensions/lib/parser.js | 103 - .../lib/pipeline/README.md | 607 - .../websocket-extensions/lib/pipeline/cell.js | 53 - .../lib/pipeline/functor.js | 72 - .../lib/pipeline/index.js | 47 - .../lib/pipeline/pledge.js | 37 - .../lib/pipeline/ring_buffer.js | 66 - .../lib/websocket_extensions.js | 162 - .../websocket-extensions/package.json | 29 - .../node_modules/whatwg-url/LICENSE.txt | 21 - .../scripts/node_modules/whatwg-url/README.md | 67 - .../node_modules/whatwg-url/lib/URL-impl.js | 200 - .../node_modules/whatwg-url/lib/URL.js | 196 - .../node_modules/whatwg-url/lib/public-api.js | 11 - .../whatwg-url/lib/url-state-machine.js | 1297 -- .../node_modules/whatwg-url/lib/utils.js | 20 - .../node_modules/whatwg-url/package.json | 32 - .../scripts/node_modules/word-wrap/LICENSE | 21 - .../scripts/node_modules/word-wrap/README.md | 182 - .../scripts/node_modules/word-wrap/index.d.ts | 50 - .../scripts/node_modules/word-wrap/index.js | 46 - .../node_modules/word-wrap/package.json | 77 - .../scripts/node_modules/wrap-ansi/index.js | 216 - .../scripts/node_modules/wrap-ansi/license | 9 - .../node_modules/wrap-ansi/package.json | 62 - .../scripts/node_modules/wrap-ansi/readme.md | 91 - .../scripts/node_modules/wrappy/LICENSE | 15 - .../scripts/node_modules/wrappy/README.md | 36 - .../scripts/node_modules/wrappy/package.json | 29 - .../scripts/node_modules/wrappy/wrappy.js | 33 - .../scripts/node_modules/xmlcreate/CHANGES.md | 53 - .../scripts/node_modules/xmlcreate/LICENSE | 201 - .../scripts/node_modules/xmlcreate/NOTICE | 2 - .../scripts/node_modules/xmlcreate/README.md | 141 - .../node_modules/xmlcreate/lib/error.d.ts | 19 - .../node_modules/xmlcreate/lib/error.js | 47 - .../node_modules/xmlcreate/lib/escape.d.ts | 37 - .../node_modules/xmlcreate/lib/escape.js | 55 - .../node_modules/xmlcreate/lib/main.d.ts | 38 - .../node_modules/xmlcreate/lib/main.js | 64 - .../xmlcreate/lib/nodes/XmlAttribute.d.ts | 88 - .../xmlcreate/lib/nodes/XmlAttribute.js | 146 - .../xmlcreate/lib/nodes/XmlAttributeText.d.ts | 58 - .../xmlcreate/lib/nodes/XmlAttributeText.js | 80 - .../xmlcreate/lib/nodes/XmlCdata.d.ts | 63 - .../xmlcreate/lib/nodes/XmlCdata.js | 88 - .../xmlcreate/lib/nodes/XmlCharData.d.ts | 59 - .../xmlcreate/lib/nodes/XmlCharData.js | 82 - .../xmlcreate/lib/nodes/XmlCharRef.d.ts | 89 - .../xmlcreate/lib/nodes/XmlCharRef.js | 136 - .../xmlcreate/lib/nodes/XmlComment.d.ts | 62 - .../xmlcreate/lib/nodes/XmlComment.js | 99 - .../xmlcreate/lib/nodes/XmlDecl.d.ts | 92 - .../xmlcreate/lib/nodes/XmlDecl.js | 180 - .../xmlcreate/lib/nodes/XmlDocument.d.ts | 96 - .../xmlcreate/lib/nodes/XmlDocument.js | 166 - .../xmlcreate/lib/nodes/XmlDtd.d.ts | 147 - .../xmlcreate/lib/nodes/XmlDtd.js | 312 - .../xmlcreate/lib/nodes/XmlDtdAttlist.d.ts | 56 - .../xmlcreate/lib/nodes/XmlDtdAttlist.js | 71 - .../xmlcreate/lib/nodes/XmlDtdElement.d.ts | 56 - .../xmlcreate/lib/nodes/XmlDtdElement.js | 71 - .../xmlcreate/lib/nodes/XmlDtdEntity.d.ts | 56 - .../xmlcreate/lib/nodes/XmlDtdEntity.js | 71 - .../xmlcreate/lib/nodes/XmlDtdNotation.d.ts | 56 - .../xmlcreate/lib/nodes/XmlDtdNotation.js | 71 - .../lib/nodes/XmlDtdParamEntityRef.d.ts | 56 - .../lib/nodes/XmlDtdParamEntityRef.js | 71 - .../xmlcreate/lib/nodes/XmlElement.d.ts | 153 - .../xmlcreate/lib/nodes/XmlElement.js | 302 - .../xmlcreate/lib/nodes/XmlEntityRef.d.ts | 56 - .../xmlcreate/lib/nodes/XmlEntityRef.js | 71 - .../xmlcreate/lib/nodes/XmlProcInst.d.ts | 71 - .../xmlcreate/lib/nodes/XmlProcInst.js | 112 - .../node_modules/xmlcreate/lib/options.d.ts | 51 - .../node_modules/xmlcreate/lib/options.js | 45 - .../node_modules/xmlcreate/lib/validate.d.ts | 46 - .../node_modules/xmlcreate/lib/validate.js | 274 - .../node_modules/xmlcreate/package.json | 55 - .../scripts/node_modules/y18n/CHANGELOG.md | 100 - .../example/scripts/node_modules/y18n/LICENSE | 13 - .../scripts/node_modules/y18n/README.md | 127 - .../scripts/node_modules/y18n/index.mjs | 8 - .../scripts/node_modules/y18n/package.json | 70 - .../scripts/node_modules/yallist/LICENSE | 15 - .../scripts/node_modules/yallist/README.md | 204 - .../scripts/node_modules/yallist/iterator.js | 8 - .../scripts/node_modules/yallist/package.json | 29 - .../scripts/node_modules/yallist/yallist.js | 426 - .../node_modules/yargs-parser/CHANGELOG.md | 263 - .../node_modules/yargs-parser/LICENSE.txt | 14 - .../node_modules/yargs-parser/README.md | 518 - .../node_modules/yargs-parser/browser.js | 29 - .../node_modules/yargs-parser/package.json | 87 - .../scripts/node_modules/yargs/CHANGELOG.md | 88 - .../scripts/node_modules/yargs/LICENSE | 21 - .../scripts/node_modules/yargs/README.md | 202 - .../scripts/node_modules/yargs/browser.mjs | 7 - .../node_modules/yargs/helpers/helpers.mjs | 10 - .../node_modules/yargs/helpers/index.js | 14 - .../node_modules/yargs/helpers/package.json | 3 - .../scripts/node_modules/yargs/index.cjs | 39 - .../scripts/node_modules/yargs/index.mjs | 8 - .../yargs/lib/platform-shims/browser.mjs | 92 - .../yargs/lib/platform-shims/esm.mjs | 67 - .../node_modules/yargs/locales/be.json | 46 - .../node_modules/yargs/locales/de.json | 46 - .../node_modules/yargs/locales/en.json | 51 - .../node_modules/yargs/locales/es.json | 46 - .../node_modules/yargs/locales/fi.json | 49 - .../node_modules/yargs/locales/fr.json | 53 - .../node_modules/yargs/locales/hi.json | 49 - .../node_modules/yargs/locales/hu.json | 46 - .../node_modules/yargs/locales/id.json | 50 - .../node_modules/yargs/locales/it.json | 46 - .../node_modules/yargs/locales/ja.json | 51 - .../node_modules/yargs/locales/ko.json | 49 - .../node_modules/yargs/locales/nb.json | 44 - .../node_modules/yargs/locales/nl.json | 49 - .../node_modules/yargs/locales/nn.json | 44 - .../node_modules/yargs/locales/pirate.json | 13 - .../node_modules/yargs/locales/pl.json | 49 - .../node_modules/yargs/locales/pt.json | 45 - .../node_modules/yargs/locales/pt_BR.json | 48 - .../node_modules/yargs/locales/ru.json | 46 - .../node_modules/yargs/locales/th.json | 46 - .../node_modules/yargs/locales/tr.json | 48 - .../node_modules/yargs/locales/zh_CN.json | 48 - .../node_modules/yargs/locales/zh_TW.json | 47 - .../scripts/node_modules/yargs/package.json | 122 - .../example/scripts/node_modules/yargs/yargs | 9 - .../node_modules/yocto-queue/index.d.ts | 56 - .../scripts/node_modules/yocto-queue/index.js | 68 - .../scripts/node_modules/yocto-queue/license | 9 - .../node_modules/yocto-queue/package.json | 43 - .../node_modules/yocto-queue/readme.md | 64 - 4613 files changed, 22 insertions(+), 766656 deletions(-) rename packages/{wyatt_notification_bloc => wyatt_cloud_messaging_bloc_base}/.gitignore (100%) rename packages/{wyatt_notification_bloc => wyatt_cloud_messaging_bloc_base}/.pubignore (100%) rename packages/{wyatt_notification_bloc => wyatt_cloud_messaging_bloc_base}/AUTHORS (100%) rename packages/{wyatt_notification_bloc => wyatt_cloud_messaging_bloc_base}/CHANGELOG.md (100%) rename packages/{wyatt_notification_bloc => wyatt_cloud_messaging_bloc_base}/LICENSE (100%) rename packages/{wyatt_notification_bloc => wyatt_cloud_messaging_bloc_base}/README.md (100%) rename packages/{wyatt_notification_bloc => wyatt_cloud_messaging_bloc_base}/analysis_options.yaml (100%) rename packages/{wyatt_notification_bloc => wyatt_cloud_messaging_bloc_base}/example/.gitignore (100%) rename packages/{wyatt_notification_bloc => wyatt_cloud_messaging_bloc_base}/example/.metadata (100%) rename packages/{wyatt_notification_bloc => wyatt_cloud_messaging_bloc_base}/example/README.md (100%) rename packages/{wyatt_notification_bloc => wyatt_cloud_messaging_bloc_base}/example/analysis_options.yaml (100%) rename packages/{wyatt_notification_bloc => wyatt_cloud_messaging_bloc_base}/example/android/.gitignore (100%) rename packages/{wyatt_notification_bloc => wyatt_cloud_messaging_bloc_base}/example/android/app/build.gradle (100%) rename packages/{wyatt_notification_bloc => wyatt_cloud_messaging_bloc_base}/example/android/app/src/debug/AndroidManifest.xml (100%) rename packages/{wyatt_notification_bloc => wyatt_cloud_messaging_bloc_base}/example/android/app/src/main/AndroidManifest.xml (100%) rename packages/{wyatt_notification_bloc => wyatt_cloud_messaging_bloc_base}/example/android/app/src/main/kotlin/com/example/notification_bloc_example/MainActivity.kt (100%) rename packages/{wyatt_notification_bloc => wyatt_cloud_messaging_bloc_base}/example/android/app/src/main/res/drawable-v21/launch_background.xml (100%) rename packages/{wyatt_notification_bloc => wyatt_cloud_messaging_bloc_base}/example/android/app/src/main/res/drawable/launch_background.xml (100%) rename packages/{wyatt_notification_bloc => wyatt_cloud_messaging_bloc_base}/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png (100%) rename packages/{wyatt_notification_bloc => wyatt_cloud_messaging_bloc_base}/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png (100%) rename packages/{wyatt_notification_bloc => wyatt_cloud_messaging_bloc_base}/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png (100%) rename packages/{wyatt_notification_bloc => wyatt_cloud_messaging_bloc_base}/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png (100%) rename packages/{wyatt_notification_bloc => wyatt_cloud_messaging_bloc_base}/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png (100%) rename packages/{wyatt_notification_bloc => wyatt_cloud_messaging_bloc_base}/example/android/app/src/main/res/values-night/styles.xml (100%) rename packages/{wyatt_notification_bloc => wyatt_cloud_messaging_bloc_base}/example/android/app/src/main/res/values/styles.xml (100%) rename packages/{wyatt_notification_bloc => wyatt_cloud_messaging_bloc_base}/example/android/app/src/profile/AndroidManifest.xml (100%) rename packages/{wyatt_notification_bloc => wyatt_cloud_messaging_bloc_base}/example/android/build.gradle (100%) rename packages/{wyatt_notification_bloc => wyatt_cloud_messaging_bloc_base}/example/android/gradle.properties (100%) rename packages/{wyatt_notification_bloc => wyatt_cloud_messaging_bloc_base}/example/android/gradle/wrapper/gradle-wrapper.properties (100%) rename packages/{wyatt_notification_bloc => wyatt_cloud_messaging_bloc_base}/example/android/settings.gradle (100%) rename packages/{wyatt_notification_bloc => wyatt_cloud_messaging_bloc_base}/example/ios/.gitignore (100%) rename packages/{wyatt_notification_bloc => wyatt_cloud_messaging_bloc_base}/example/ios/Flutter/AppFrameworkInfo.plist (100%) rename packages/{wyatt_notification_bloc => wyatt_cloud_messaging_bloc_base}/example/ios/Flutter/Debug.xcconfig (100%) rename packages/{wyatt_notification_bloc => wyatt_cloud_messaging_bloc_base}/example/ios/Flutter/Release.xcconfig (100%) rename packages/{wyatt_notification_bloc => wyatt_cloud_messaging_bloc_base}/example/ios/Podfile (100%) rename packages/{wyatt_notification_bloc => wyatt_cloud_messaging_bloc_base}/example/ios/Podfile.lock (100%) rename packages/{wyatt_notification_bloc => wyatt_cloud_messaging_bloc_base}/example/ios/Runner.xcodeproj/project.pbxproj (100%) rename packages/{wyatt_notification_bloc => wyatt_cloud_messaging_bloc_base}/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata (100%) rename packages/{wyatt_notification_bloc => wyatt_cloud_messaging_bloc_base}/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist (100%) rename packages/{wyatt_notification_bloc => wyatt_cloud_messaging_bloc_base}/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme (100%) rename packages/{wyatt_notification_bloc => wyatt_cloud_messaging_bloc_base}/example/ios/Runner.xcworkspace/contents.xcworkspacedata (100%) rename packages/{wyatt_notification_bloc => wyatt_cloud_messaging_bloc_base}/example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist (100%) rename packages/{wyatt_notification_bloc => wyatt_cloud_messaging_bloc_base}/example/ios/Runner/AppDelegate.swift (100%) rename packages/{wyatt_notification_bloc => wyatt_cloud_messaging_bloc_base}/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json (100%) rename packages/{wyatt_notification_bloc => wyatt_cloud_messaging_bloc_base}/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png (100%) rename packages/{wyatt_notification_bloc => wyatt_cloud_messaging_bloc_base}/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png (100%) rename packages/{wyatt_notification_bloc => wyatt_cloud_messaging_bloc_base}/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png (100%) rename packages/{wyatt_notification_bloc => wyatt_cloud_messaging_bloc_base}/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png (100%) rename packages/{wyatt_notification_bloc => wyatt_cloud_messaging_bloc_base}/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png (100%) rename packages/{wyatt_notification_bloc => wyatt_cloud_messaging_bloc_base}/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png (100%) rename packages/{wyatt_notification_bloc => wyatt_cloud_messaging_bloc_base}/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png (100%) rename packages/{wyatt_notification_bloc => wyatt_cloud_messaging_bloc_base}/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png (100%) rename packages/{wyatt_notification_bloc => wyatt_cloud_messaging_bloc_base}/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png (100%) rename packages/{wyatt_notification_bloc => wyatt_cloud_messaging_bloc_base}/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png (100%) rename packages/{wyatt_notification_bloc => wyatt_cloud_messaging_bloc_base}/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png (100%) rename packages/{wyatt_notification_bloc => wyatt_cloud_messaging_bloc_base}/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png (100%) rename packages/{wyatt_notification_bloc => wyatt_cloud_messaging_bloc_base}/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png (100%) rename packages/{wyatt_notification_bloc => wyatt_cloud_messaging_bloc_base}/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png (100%) rename packages/{wyatt_notification_bloc => wyatt_cloud_messaging_bloc_base}/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png (100%) rename packages/{wyatt_notification_bloc => wyatt_cloud_messaging_bloc_base}/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json (100%) rename packages/{wyatt_notification_bloc => wyatt_cloud_messaging_bloc_base}/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png (100%) rename packages/{wyatt_notification_bloc => wyatt_cloud_messaging_bloc_base}/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png (100%) rename packages/{wyatt_notification_bloc => wyatt_cloud_messaging_bloc_base}/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png (100%) rename packages/{wyatt_notification_bloc => wyatt_cloud_messaging_bloc_base}/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md (100%) rename packages/{wyatt_notification_bloc => wyatt_cloud_messaging_bloc_base}/example/ios/Runner/Base.lproj/LaunchScreen.storyboard (100%) rename packages/{wyatt_notification_bloc => wyatt_cloud_messaging_bloc_base}/example/ios/Runner/Base.lproj/Main.storyboard (100%) rename packages/{wyatt_notification_bloc => wyatt_cloud_messaging_bloc_base}/example/ios/Runner/Info.plist (100%) rename packages/{wyatt_notification_bloc => wyatt_cloud_messaging_bloc_base}/example/ios/Runner/Runner-Bridging-Header.h (100%) rename packages/{wyatt_notification_bloc => wyatt_cloud_messaging_bloc_base}/example/ios/Runner/Runner.entitlements (100%) rename packages/{wyatt_notification_bloc => wyatt_cloud_messaging_bloc_base}/example/ios/firebase_app_id_file.json (100%) rename packages/{wyatt_notification_bloc => wyatt_cloud_messaging_bloc_base}/example/lib/firebase_options.dart (100%) rename packages/{wyatt_notification_bloc => wyatt_cloud_messaging_bloc_base}/example/lib/main.dart (100%) rename packages/{wyatt_notification_bloc => wyatt_cloud_messaging_bloc_base}/example/pubspec.yaml (99%) rename packages/{wyatt_notification_bloc => wyatt_cloud_messaging_bloc_base}/example/pushes/push.json (100%) rename packages/{wyatt_notification_bloc => wyatt_cloud_messaging_bloc_base}/example/scripts/package-lock.json (100%) rename packages/{wyatt_notification_bloc => wyatt_cloud_messaging_bloc_base}/example/scripts/package.json (100%) rename packages/{wyatt_notification_bloc => wyatt_cloud_messaging_bloc_base}/example/scripts/send-message.js (100%) rename packages/{wyatt_notification_bloc => wyatt_cloud_messaging_bloc_base}/example/scripts/wyatt-notification-example-firebase-adminsdk-aji7z-d74c5eb58d.json (100%) rename packages/{wyatt_notification_bloc => wyatt_cloud_messaging_bloc_base}/example/test/widget_test.dart (100%) rename packages/{wyatt_notification_bloc => wyatt_cloud_messaging_bloc_base}/lib/src/core/core.dart (100%) rename packages/{wyatt_notification_bloc => wyatt_cloud_messaging_bloc_base}/lib/src/core/exceptions/notification_exeption.dart (100%) rename packages/{wyatt_notification_bloc => wyatt_cloud_messaging_bloc_base}/lib/src/core/extensions/build_context_extension.dart (91%) rename packages/{wyatt_notification_bloc => wyatt_cloud_messaging_bloc_base}/lib/src/data/data.dart (100%) rename packages/{wyatt_notification_bloc => wyatt_cloud_messaging_bloc_base}/lib/src/data/repositories/notification_repository_impl.dart (89%) rename packages/{wyatt_notification_bloc => wyatt_cloud_messaging_bloc_base}/lib/src/domain/data_sources/remote/notification_remote_data_source.dart (92%) rename packages/{wyatt_notification_bloc => wyatt_cloud_messaging_bloc_base}/lib/src/domain/domain.dart (100%) rename packages/{wyatt_notification_bloc => wyatt_cloud_messaging_bloc_base}/lib/src/domain/entities/entities.dart (100%) rename packages/{wyatt_notification_bloc => wyatt_cloud_messaging_bloc_base}/lib/src/domain/entities/remote_notifications.dart (100%) rename packages/{wyatt_notification_bloc => wyatt_cloud_messaging_bloc_base}/lib/src/domain/repositories/notification_repository.dart (93%) rename packages/{wyatt_notification_bloc => wyatt_cloud_messaging_bloc_base}/lib/src/domain/repositories/repositories.dart (100%) rename packages/{wyatt_notification_bloc => wyatt_cloud_messaging_bloc_base}/lib/src/domain/usecases/get_cloud_messaging_token_use_case.dart (91%) rename packages/{wyatt_notification_bloc => wyatt_cloud_messaging_bloc_base}/lib/src/domain/usecases/init_cloud_messaging_use_case.dart (91%) rename packages/{wyatt_notification_bloc => wyatt_cloud_messaging_bloc_base}/lib/src/domain/usecases/listen_notification_use_case.dart (88%) rename packages/{wyatt_notification_bloc => wyatt_cloud_messaging_bloc_base}/lib/src/domain/usecases/request_cloud_messaging_permission_use_case.dart (91%) rename packages/{wyatt_notification_bloc => wyatt_cloud_messaging_bloc_base}/lib/src/domain/usecases/subscribe.dart (92%) rename packages/{wyatt_notification_bloc => wyatt_cloud_messaging_bloc_base}/lib/src/domain/usecases/unsubscribe.dart (92%) rename packages/{wyatt_notification_bloc => wyatt_cloud_messaging_bloc_base}/lib/src/domain/usecases/usecases.dart (100%) rename packages/{wyatt_notification_bloc => wyatt_cloud_messaging_bloc_base}/lib/src/features/notifications/bloc/cloud_messaging_cubit.dart (84%) rename packages/{wyatt_notification_bloc => wyatt_cloud_messaging_bloc_base}/lib/src/features/notifications/bloc/cloud_messaging_state.dart (100%) rename packages/{wyatt_notification_bloc => wyatt_cloud_messaging_bloc_base}/lib/src/src.dart (100%) rename packages/{wyatt_notification_bloc => wyatt_cloud_messaging_bloc_base}/lib/wyatt_cloud_messaging_bloc.dart (94%) rename packages/{wyatt_notification_bloc => wyatt_cloud_messaging_bloc_base}/pubspec.yaml (95%) delete mode 120000 packages/wyatt_notification_bloc/example/scripts/node_modules/.bin/acorn delete mode 120000 packages/wyatt_notification_bloc/example/scripts/node_modules/.bin/compileProtos delete mode 120000 packages/wyatt_notification_bloc/example/scripts/node_modules/.bin/escodegen delete mode 120000 packages/wyatt_notification_bloc/example/scripts/node_modules/.bin/esgenerate delete mode 120000 packages/wyatt_notification_bloc/example/scripts/node_modules/.bin/esparse delete mode 120000 packages/wyatt_notification_bloc/example/scripts/node_modules/.bin/esvalidate delete mode 120000 packages/wyatt_notification_bloc/example/scripts/node_modules/.bin/gp12-pem delete mode 120000 packages/wyatt_notification_bloc/example/scripts/node_modules/.bin/jsdoc delete mode 120000 packages/wyatt_notification_bloc/example/scripts/node_modules/.bin/markdown-it delete mode 120000 packages/wyatt_notification_bloc/example/scripts/node_modules/.bin/marked delete mode 120000 packages/wyatt_notification_bloc/example/scripts/node_modules/.bin/mime delete mode 120000 packages/wyatt_notification_bloc/example/scripts/node_modules/.bin/minifyProtoJson delete mode 120000 packages/wyatt_notification_bloc/example/scripts/node_modules/.bin/mkdirp delete mode 120000 packages/wyatt_notification_bloc/example/scripts/node_modules/.bin/parser delete mode 120000 packages/wyatt_notification_bloc/example/scripts/node_modules/.bin/pbjs delete mode 120000 packages/wyatt_notification_bloc/example/scripts/node_modules/.bin/pbts delete mode 120000 packages/wyatt_notification_bloc/example/scripts/node_modules/.bin/proto-loader-gen-types delete mode 120000 packages/wyatt_notification_bloc/example/scripts/node_modules/.bin/rimraf delete mode 120000 packages/wyatt_notification_bloc/example/scripts/node_modules/.bin/semver delete mode 120000 packages/wyatt_notification_bloc/example/scripts/node_modules/.bin/uglifyjs delete mode 120000 packages/wyatt_notification_bloc/example/scripts/node_modules/.bin/uuid delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/.package-lock.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@babel/parser/CHANGELOG.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@babel/parser/LICENSE delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@babel/parser/README.md delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@babel/parser/bin/babel-parser.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@babel/parser/index.cjs delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@babel/parser/lib/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@babel/parser/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@babel/parser/typings/babel-parser.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@babel/parser/typings/babel-parser.source.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@fastify/busboy/LICENSE delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@fastify/busboy/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@fastify/busboy/deps/dicer/LICENSE delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@fastify/busboy/deps/dicer/lib/Dicer.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@fastify/busboy/deps/dicer/lib/HeaderParser.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@fastify/busboy/deps/dicer/lib/PartStream.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@fastify/busboy/deps/dicer/lib/dicer.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@fastify/busboy/deps/streamsearch/sbmh.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@fastify/busboy/lib/main.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@fastify/busboy/lib/main.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@fastify/busboy/lib/types/multipart.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@fastify/busboy/lib/types/urlencoded.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@fastify/busboy/lib/utils.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@fastify/busboy/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/app-types/CHANGELOG.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/app-types/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/app-types/index.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/app-types/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/app-types/private.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/auth-interop-types/CHANGELOG.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/auth-interop-types/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/auth-interop-types/index.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/auth-interop-types/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/component/CHANGELOG.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/component/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/component/dist/esm/index.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/component/dist/esm/index.esm2017.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/component/dist/esm/index.esm5.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/component/dist/esm/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/component/dist/esm/src/component.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/component/dist/esm/src/component_container.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/component/dist/esm/src/component_container.test.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/component/dist/esm/src/constants.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/component/dist/esm/src/provider.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/component/dist/esm/src/provider.test.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/component/dist/esm/src/types.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/component/dist/esm/test/setup.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/component/dist/esm/test/util.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/component/dist/index.cjs.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/component/dist/index.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/component/dist/src/component.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/component/dist/src/component_container.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/component/dist/src/component_container.test.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/component/dist/src/constants.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/component/dist/src/provider.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/component/dist/src/provider.test.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/component/dist/src/types.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/component/dist/test/setup.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/component/dist/test/util.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/component/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/CHANGELOG.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/database-compat/src/api/Database.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/database-compat/src/api/Reference.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/database-compat/src/api/TransactionResult.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/database-compat/src/api/internal.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/database-compat/src/api/onDisconnect.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/database-compat/src/index.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/database-compat/src/index.node.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/database-compat/src/index.standalone.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/database-compat/src/util/util.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/database-compat/src/util/validation.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/database-compat/test/browser/crawler_support.test.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/database-compat/test/database.test.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/database-compat/test/datasnapshot.test.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/database-compat/test/helpers/events.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/database-compat/test/helpers/util.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/database-compat/test/info.test.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/database-compat/test/order.test.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/database-compat/test/order_by.test.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/database-compat/test/promise.test.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/database-compat/test/query.test.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/database-compat/test/servervalues.test.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/database-compat/test/transaction.test.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/index.esm2017.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/index.esm5.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/index.standalone.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/node-esm/database-compat/src/api/Database.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/node-esm/database-compat/src/api/Reference.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/node-esm/database-compat/src/api/TransactionResult.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/node-esm/database-compat/src/api/internal.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/node-esm/database-compat/src/api/onDisconnect.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/node-esm/database-compat/src/index.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/node-esm/database-compat/src/index.node.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/node-esm/database-compat/src/index.standalone.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/node-esm/database-compat/src/util/util.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/node-esm/database-compat/src/util/validation.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/node-esm/database-compat/test/browser/crawler_support.test.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/node-esm/database-compat/test/database.test.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/node-esm/database-compat/test/datasnapshot.test.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/node-esm/database-compat/test/helpers/events.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/node-esm/database-compat/test/helpers/util.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/node-esm/database-compat/test/info.test.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/node-esm/database-compat/test/order.test.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/node-esm/database-compat/test/order_by.test.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/node-esm/database-compat/test/promise.test.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/node-esm/database-compat/test/query.test.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/node-esm/database-compat/test/servervalues.test.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/node-esm/database-compat/test/transaction.test.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/node-esm/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/node-esm/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/standalone/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-types/CHANGELOG.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-types/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-types/index.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-types/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/CHANGELOG.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/index.esm2017.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/index.esm5.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/index.node.cjs.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/index.standalone.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/internal.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/index.node.esm.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/api.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/api.standalone.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/api/Database.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/api/OnDisconnect.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/api/Reference.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/api/Reference_impl.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/api/ServerValue.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/api/Transaction.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/api/test_access.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/AppCheckTokenProvider.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/AuthTokenProvider.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/CompoundWrite.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/PersistentConnection.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/ReadonlyRestClient.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/Repo.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/RepoInfo.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/ServerActions.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/SnapshotHolder.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/SparseSnapshotTree.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/SyncPoint.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/SyncTree.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/WriteTree.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/operation/AckUserWrite.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/operation/ListenComplete.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/operation/Merge.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/operation/Operation.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/operation/Overwrite.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/snap/ChildrenNode.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/snap/IndexMap.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/snap/LeafNode.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/snap/Node.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/snap/childSet.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/snap/comparators.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/snap/indexes/Index.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/snap/indexes/KeyIndex.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/snap/indexes/PathIndex.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/snap/indexes/PriorityIndex.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/snap/indexes/ValueIndex.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/snap/nodeFromJSON.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/snap/snap.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/stats/StatsCollection.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/stats/StatsListener.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/stats/StatsManager.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/stats/StatsReporter.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/storage/DOMStorageWrapper.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/storage/MemoryStorage.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/storage/storage.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/util/EventEmitter.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/util/ImmutableTree.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/util/NextPushId.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/util/OnlineMonitor.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/util/Path.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/util/ServerValues.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/util/SortedMap.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/util/Tree.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/util/VisibilityMonitor.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/util/libs/parser.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/util/misc.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/util/util.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/util/validation.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/version.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/view/CacheNode.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/view/Change.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/view/ChildChangeAccumulator.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/view/CompleteChildSource.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/view/Event.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/view/EventGenerator.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/view/EventQueue.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/view/EventRegistration.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/view/QueryParams.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/view/View.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/view/ViewCache.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/view/ViewProcessor.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/view/filter/IndexedFilter.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/view/filter/LimitedFilter.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/view/filter/NodeFilter.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/view/filter/RangedFilter.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/index.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/index.node.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/index.standalone.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/realtime/BrowserPollConnection.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/realtime/Connection.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/realtime/Constants.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/realtime/Transport.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/realtime/TransportManager.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/realtime/WebSocketConnection.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/realtime/polling/PacketReceiver.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/register.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/test/compound_write.test.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/test/connection.test.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/test/deno.test.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/test/exp/integration.test.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/test/helpers/EventAccumulator.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/test/helpers/syncpoint-util.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/test/helpers/util.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/test/node.test.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/test/parser.test.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/test/path.test.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/test/pushid.test.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/test/repoinfo.test.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/test/sortedmap.test.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/test/sparsesnapshottree.test.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/test/syncpoint.test.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/test/transport.test.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/test/websocketconnection.test.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/private.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/public.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/api.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/api.standalone.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/api/Database.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/api/OnDisconnect.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/api/Reference.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/api/Reference_impl.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/api/ServerValue.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/api/Transaction.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/api/test_access.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/AppCheckTokenProvider.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/AuthTokenProvider.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/CompoundWrite.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/PersistentConnection.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/ReadonlyRestClient.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/Repo.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/RepoInfo.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/ServerActions.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/SnapshotHolder.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/SparseSnapshotTree.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/SyncPoint.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/SyncTree.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/WriteTree.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/operation/AckUserWrite.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/operation/ListenComplete.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/operation/Merge.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/operation/Operation.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/operation/Overwrite.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/snap/ChildrenNode.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/snap/IndexMap.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/snap/LeafNode.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/snap/Node.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/snap/childSet.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/snap/comparators.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/snap/indexes/Index.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/snap/indexes/KeyIndex.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/snap/indexes/PathIndex.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/snap/indexes/PriorityIndex.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/snap/indexes/ValueIndex.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/snap/nodeFromJSON.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/snap/snap.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/stats/StatsCollection.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/stats/StatsListener.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/stats/StatsManager.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/stats/StatsReporter.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/storage/DOMStorageWrapper.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/storage/MemoryStorage.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/storage/storage.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/util/EventEmitter.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/util/ImmutableTree.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/util/NextPushId.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/util/OnlineMonitor.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/util/Path.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/util/ServerValues.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/util/SortedMap.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/util/Tree.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/util/VisibilityMonitor.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/util/libs/parser.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/util/misc.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/util/util.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/util/validation.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/version.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/view/CacheNode.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/view/Change.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/view/ChildChangeAccumulator.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/view/CompleteChildSource.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/view/Event.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/view/EventGenerator.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/view/EventQueue.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/view/EventRegistration.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/view/QueryParams.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/view/View.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/view/ViewCache.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/view/ViewProcessor.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/view/filter/IndexedFilter.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/view/filter/LimitedFilter.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/view/filter/NodeFilter.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/view/filter/RangedFilter.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/index.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/index.node.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/index.standalone.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/realtime/BrowserPollConnection.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/realtime/Connection.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/realtime/Constants.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/realtime/Transport.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/realtime/TransportManager.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/realtime/WebSocketConnection.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/realtime/polling/PacketReceiver.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/register.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/tsdoc-metadata.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/test/compound_write.test.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/test/connection.test.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/test/deno.test.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/test/exp/integration.test.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/test/helpers/EventAccumulator.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/test/helpers/syncpoint-util.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/test/helpers/util.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/test/node.test.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/test/parser.test.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/test/path.test.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/test/pushid.test.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/test/repoinfo.test.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/test/sortedmap.test.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/test/sparsesnapshottree.test.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/test/syncpoint.test.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/test/transport.test.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/test/websocketconnection.test.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/logger/CHANGELOG.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/logger/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/logger/dist/esm/index.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/logger/dist/esm/index.esm2017.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/logger/dist/esm/index.esm5.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/logger/dist/esm/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/logger/dist/esm/src/logger.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/logger/dist/esm/test/custom-logger.test.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/logger/dist/esm/test/logger.test.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/logger/dist/index.cjs.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/logger/dist/index.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/logger/dist/src/logger.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/logger/dist/test/custom-logger.test.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/logger/dist/test/logger.test.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/logger/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/CHANGELOG.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/index.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/index.esm2017.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/index.esm5.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/index.node.cjs.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/index.node.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/node-esm/index.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/node-esm/index.node.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/node-esm/index.node.esm.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/node-esm/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/node-esm/src/assert.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/node-esm/src/compat.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/node-esm/src/constants.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/node-esm/src/crypt.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/node-esm/src/deepCopy.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/node-esm/src/defaults.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/node-esm/src/deferred.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/node-esm/src/emulator.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/node-esm/src/environment.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/node-esm/src/errors.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/node-esm/src/exponential_backoff.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/node-esm/src/formatters.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/node-esm/src/json.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/node-esm/src/jwt.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/node-esm/src/obj.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/node-esm/src/promise.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/node-esm/src/query.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/node-esm/src/sha1.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/node-esm/src/subscribe.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/node-esm/src/utf8.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/node-esm/src/uuid.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/node-esm/src/validation.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/node-esm/test/base64.test.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/node-esm/test/compat.test.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/node-esm/test/deepCopy.test.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/node-esm/test/defaults.test.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/node-esm/test/emulator.test.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/node-esm/test/errors.test.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/node-esm/test/exponential_backoff.test.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/node-esm/test/object.test.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/node-esm/test/subscribe.test.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/src/assert.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/src/compat.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/src/constants.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/src/crypt.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/src/deepCopy.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/src/defaults.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/src/deferred.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/src/emulator.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/src/environment.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/src/errors.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/src/exponential_backoff.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/src/formatters.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/src/json.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/src/jwt.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/src/obj.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/src/promise.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/src/query.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/src/sha1.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/src/subscribe.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/src/utf8.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/src/uuid.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/src/validation.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/test/base64.test.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/test/compat.test.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/test/deepCopy.test.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/test/defaults.test.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/test/emulator.test.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/test/errors.test.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/test/exponential_backoff.test.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/test/object.test.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/test/subscribe.test.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/tsdoc-metadata.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/util-public.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/util.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/firestore/CHANGELOG.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/firestore/LICENSE delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/firestore/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/firestore/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/firestore/types/firestore.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/firestore/types/protos/firestore_admin_v1_proto_api.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/firestore/types/protos/firestore_v1_proto_api.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/firestore/types/protos/firestore_v1beta1_proto_api.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/firestore/types/v1/firestore_admin_client.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/firestore/types/v1/firestore_client.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/firestore/types/v1beta1/firestore_client.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/paginator/CHANGELOG.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/paginator/LICENSE delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/paginator/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/paginator/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/projectify/CHANGELOG.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/projectify/LICENSE delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/projectify/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/projectify/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/promisify/CHANGELOG.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/promisify/LICENSE delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/promisify/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/promisify/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/CHANGELOG.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/LICENSE delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/README.md delete mode 120000 packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/.bin/uuid delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/CHANGELOG.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/CONTRIBUTING.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/LICENSE.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/README.md delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/bin/uuid delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/esm-browser/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/esm-browser/md5.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/esm-browser/nil.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/esm-browser/parse.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/esm-browser/regex.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/esm-browser/rng.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/esm-browser/sha1.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/esm-browser/stringify.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/esm-browser/v1.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/esm-browser/v3.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/esm-browser/v35.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/esm-browser/v4.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/esm-browser/v5.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/esm-browser/validate.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/esm-browser/version.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/esm-node/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/esm-node/md5.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/esm-node/nil.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/esm-node/parse.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/esm-node/regex.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/esm-node/rng.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/esm-node/sha1.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/esm-node/stringify.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/esm-node/v1.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/esm-node/v3.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/esm-node/v35.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/esm-node/v4.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/esm-node/v5.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/esm-node/validate.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/esm-node/version.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/md5-browser.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/md5.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/nil.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/parse.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/regex.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/rng-browser.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/rng.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/sha1-browser.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/sha1.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/stringify.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/umd/uuid.min.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/umd/uuidNIL.min.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/umd/uuidParse.min.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/umd/uuidStringify.min.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/umd/uuidValidate.min.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/umd/uuidVersion.min.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/umd/uuidv1.min.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/umd/uuidv3.min.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/umd/uuidv4.min.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/umd/uuidv5.min.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/uuid-bin.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/v1.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/v3.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/v35.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/v4.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/v5.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/validate.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/version.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/wrapper.mjs delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/LICENSE delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/proto/channelz.proto delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/admin.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/backoff-timeout.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/call-credentials-filter.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/call-credentials.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/call-stream.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/call.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/channel-credentials.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/channel-options.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/channel.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/channelz.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/client-interceptors.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/client.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/compression-algorithms.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/compression-filter.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/connectivity-state.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/constants.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/deadline-filter.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/duration.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/events.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/experimental.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/filter-stack.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/filter.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/channelz.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/google/protobuf/Any.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/google/protobuf/BoolValue.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/google/protobuf/BytesValue.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/google/protobuf/DoubleValue.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/google/protobuf/Duration.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/google/protobuf/FloatValue.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/google/protobuf/Int32Value.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/google/protobuf/Int64Value.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/google/protobuf/StringValue.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/google/protobuf/Timestamp.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/google/protobuf/UInt32Value.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/google/protobuf/UInt64Value.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/grpc/channelz/v1/Address.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/grpc/channelz/v1/Channel.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/grpc/channelz/v1/ChannelConnectivityState.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/grpc/channelz/v1/ChannelData.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/grpc/channelz/v1/ChannelRef.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/grpc/channelz/v1/ChannelTrace.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/grpc/channelz/v1/ChannelTraceEvent.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/grpc/channelz/v1/Channelz.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/grpc/channelz/v1/GetChannelRequest.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/grpc/channelz/v1/GetChannelResponse.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/grpc/channelz/v1/GetServerRequest.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/grpc/channelz/v1/GetServerResponse.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/grpc/channelz/v1/GetServerSocketsRequest.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/grpc/channelz/v1/GetServerSocketsResponse.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/grpc/channelz/v1/GetServersRequest.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/grpc/channelz/v1/GetServersResponse.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/grpc/channelz/v1/GetSocketRequest.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/grpc/channelz/v1/GetSocketResponse.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/grpc/channelz/v1/GetSubchannelRequest.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/grpc/channelz/v1/GetSubchannelResponse.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/grpc/channelz/v1/GetTopChannelsRequest.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/grpc/channelz/v1/GetTopChannelsResponse.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/grpc/channelz/v1/Security.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/grpc/channelz/v1/Server.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/grpc/channelz/v1/ServerData.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/grpc/channelz/v1/ServerRef.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/grpc/channelz/v1/Socket.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/grpc/channelz/v1/SocketData.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/grpc/channelz/v1/SocketOption.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/grpc/channelz/v1/SocketOptionLinger.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/grpc/channelz/v1/SocketOptionTcpInfo.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/grpc/channelz/v1/SocketOptionTimeout.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/grpc/channelz/v1/SocketRef.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/grpc/channelz/v1/Subchannel.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/grpc/channelz/v1/SubchannelRef.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/http_proxy.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/index.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/load-balancer-child-handler.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/load-balancer-outlier-detection.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/load-balancer-pick-first.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/load-balancer-round-robin.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/load-balancer.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/logging.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/make-client.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/max-message-size-filter.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/metadata.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/object-stream.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/picker.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/resolver-dns.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/resolver-ip.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/resolver-uds.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/resolver.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/resolving-load-balancer.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/server-call.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/server-credentials.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/server.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/service-config.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/status-builder.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/stream-decoder.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/subchannel-address.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/subchannel-interface.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/subchannel-pool.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/subchannel.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/tls-helpers.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/uri-parser.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/proto-loader/LICENSE delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/proto-loader/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/proto-loader/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@panva/asn1.js/CHANGELOG.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@panva/asn1.js/LICENSE delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@panva/asn1.js/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@panva/asn1.js/lib/asn1.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@panva/asn1.js/lib/asn1/api.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@panva/asn1.js/lib/asn1/base/buffer.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@panva/asn1.js/lib/asn1/base/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@panva/asn1.js/lib/asn1/base/node.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@panva/asn1.js/lib/asn1/base/reporter.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@panva/asn1.js/lib/asn1/constants/der.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@panva/asn1.js/lib/asn1/constants/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@panva/asn1.js/lib/asn1/decoders/der.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@panva/asn1.js/lib/asn1/decoders/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@panva/asn1.js/lib/asn1/decoders/pem.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@panva/asn1.js/lib/asn1/encoders/der.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@panva/asn1.js/lib/asn1/encoders/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@panva/asn1.js/lib/asn1/encoders/pem.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@panva/asn1.js/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/aspromise/LICENSE delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/aspromise/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/aspromise/index.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/aspromise/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/aspromise/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/aspromise/tests/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/base64/LICENSE delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/base64/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/base64/index.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/base64/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/base64/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/base64/tests/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/codegen/LICENSE delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/codegen/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/codegen/index.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/codegen/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/codegen/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/codegen/tests/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/eventemitter/LICENSE delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/eventemitter/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/eventemitter/index.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/eventemitter/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/eventemitter/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/eventemitter/tests/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/fetch/LICENSE delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/fetch/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/fetch/index.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/fetch/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/fetch/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/fetch/tests/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/float/LICENSE delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/float/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/float/bench/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/float/bench/suite.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/float/index.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/float/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/float/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/float/tests/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/inquire/.npmignore delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/inquire/LICENSE delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/inquire/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/inquire/index.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/inquire/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/inquire/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/inquire/tests/data/array.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/inquire/tests/data/emptyArray.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/inquire/tests/data/emptyObject.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/inquire/tests/data/object.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/inquire/tests/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/path/LICENSE delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/path/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/path/index.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/path/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/path/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/path/tests/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/pool/.npmignore delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/pool/LICENSE delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/pool/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/pool/index.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/pool/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/pool/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/pool/tests/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/utf8/.npmignore delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/utf8/LICENSE delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/utf8/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/utf8/index.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/utf8/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/utf8/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/utf8/tests/data/utf8.txt delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/utf8/tests/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@tootallnate/once/LICENSE delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@tootallnate/once/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@tootallnate/once/dist/index.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@tootallnate/once/dist/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@tootallnate/once/dist/overloaded-parameters.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@tootallnate/once/dist/overloaded-parameters.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@tootallnate/once/dist/types.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@tootallnate/once/dist/types.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@tootallnate/once/package.json delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/body-parser/LICENSE delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/body-parser/README.md delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/body-parser/index.d.ts delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/body-parser/package.json delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/connect/LICENSE delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/connect/README.md delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/connect/index.d.ts delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/connect/package.json delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/express-serve-static-core/LICENSE delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/express-serve-static-core/README.md delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/express-serve-static-core/index.d.ts delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/express-serve-static-core/package.json delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/express/LICENSE delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/express/README.md delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/express/index.d.ts delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/express/package.json delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/jsonwebtoken/LICENSE delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/jsonwebtoken/README.md delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/jsonwebtoken/index.d.ts delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/jsonwebtoken/package.json delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/linkify-it/LICENSE delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/linkify-it/README.md delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/linkify-it/index.d.ts delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/linkify-it/package.json delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/long/LICENSE delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/long/README.md delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/long/index.d.ts delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/long/package.json delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/markdown-it/LICENSE delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/markdown-it/README.md delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/markdown-it/index.d.ts delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/markdown-it/lib/common/entities.d.ts delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/markdown-it/lib/common/html_blocks.d.ts delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/markdown-it/lib/common/html_re.d.ts delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/markdown-it/lib/common/utils.d.ts delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/markdown-it/lib/helpers/index.d.ts delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/markdown-it/lib/helpers/parse_link_destination.d.ts delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/markdown-it/lib/helpers/parse_link_label.d.ts delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/markdown-it/lib/helpers/parse_link_title.d.ts delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/markdown-it/lib/index.d.ts delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/markdown-it/lib/parser_block.d.ts delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/markdown-it/lib/parser_core.d.ts delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/markdown-it/lib/parser_inline.d.ts delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/markdown-it/lib/renderer.d.ts delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/markdown-it/lib/ruler.d.ts delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/markdown-it/lib/rules_block/state_block.d.ts delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/markdown-it/lib/rules_core/state_core.d.ts delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/markdown-it/lib/rules_inline/state_inline.d.ts delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/markdown-it/lib/token.d.ts delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/markdown-it/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/mdurl/LICENSE delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/mdurl/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/mdurl/decode.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/mdurl/encode.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/mdurl/format.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/mdurl/index.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/mdurl/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/mdurl/parse.d.ts delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/mime/LICENSE delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/mime/Mime.d.ts delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/mime/README.md delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/mime/index.d.ts delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/mime/lite.d.ts delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/mime/package.json delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/LICENSE delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/README.md delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/assert.d.ts delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/assert/strict.d.ts delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/async_hooks.d.ts delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/buffer.d.ts delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/child_process.d.ts delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/cluster.d.ts delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/console.d.ts delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/constants.d.ts delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/crypto.d.ts delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/dgram.d.ts delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/diagnostics_channel.d.ts delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/dns.d.ts delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/dns/promises.d.ts delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/dom-events.d.ts delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/domain.d.ts delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/events.d.ts delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/fs.d.ts delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/fs/promises.d.ts delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/globals.d.ts delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/globals.global.d.ts delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/http.d.ts delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/http2.d.ts delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/https.d.ts delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/index.d.ts delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/inspector.d.ts delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/module.d.ts delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/net.d.ts delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/os.d.ts delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/package.json delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/path.d.ts delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/perf_hooks.d.ts delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/process.d.ts delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/punycode.d.ts delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/querystring.d.ts delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/readline.d.ts delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/readline/promises.d.ts delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/repl.d.ts delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/stream.d.ts delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/stream/consumers.d.ts delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/stream/promises.d.ts delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/stream/web.d.ts delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/string_decoder.d.ts delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/test.d.ts delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/timers.d.ts delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/timers/promises.d.ts delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/tls.d.ts delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/trace_events.d.ts delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/assert.d.ts delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/assert/strict.d.ts delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/async_hooks.d.ts delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/buffer.d.ts delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/child_process.d.ts delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/cluster.d.ts delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/console.d.ts delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/constants.d.ts delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/crypto.d.ts delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/dgram.d.ts delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/diagnostics_channel.d.ts delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/dns.d.ts delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/dns/promises.d.ts delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/dom-events.d.ts delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/domain.d.ts delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/events.d.ts delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/fs.d.ts delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/fs/promises.d.ts delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/globals.d.ts delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/globals.global.d.ts delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/http.d.ts delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/http2.d.ts delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/https.d.ts delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/index.d.ts delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/inspector.d.ts delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/module.d.ts delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/net.d.ts delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/os.d.ts delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/path.d.ts delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/perf_hooks.d.ts delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/process.d.ts delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/punycode.d.ts delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/querystring.d.ts delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/readline.d.ts delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/readline/promises.d.ts delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/repl.d.ts delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/stream.d.ts delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/stream/consumers.d.ts delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/stream/promises.d.ts delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/stream/web.d.ts delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/string_decoder.d.ts delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/test.d.ts delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/timers.d.ts delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/timers/promises.d.ts delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/tls.d.ts delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/trace_events.d.ts delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/tty.d.ts delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/url.d.ts delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/util.d.ts delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/v8.d.ts delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/vm.d.ts delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/wasi.d.ts delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/worker_threads.d.ts delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/zlib.d.ts delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/tty.d.ts delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/url.d.ts delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/util.d.ts delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/v8.d.ts delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/vm.d.ts delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/wasi.d.ts delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/worker_threads.d.ts delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/zlib.d.ts delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/qs/LICENSE delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/qs/README.md delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/qs/index.d.ts delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/qs/package.json delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/range-parser/LICENSE delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/range-parser/README.md delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/range-parser/index.d.ts delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/range-parser/package.json delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/serve-static/LICENSE delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/serve-static/README.md delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/serve-static/index.d.ts delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/@types/serve-static/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/abort-controller/LICENSE delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/abort-controller/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/abort-controller/browser.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/abort-controller/browser.mjs delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/abort-controller/dist/abort-controller.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/abort-controller/dist/abort-controller.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/abort-controller/dist/abort-controller.mjs delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/abort-controller/dist/abort-controller.mjs.map delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/abort-controller/dist/abort-controller.umd.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/abort-controller/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/abort-controller/polyfill.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/abort-controller/polyfill.mjs delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/acorn-jsx/LICENSE delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/acorn-jsx/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/acorn-jsx/index.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/acorn-jsx/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/acorn-jsx/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/acorn-jsx/xhtml.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/acorn/CHANGELOG.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/acorn/LICENSE delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/acorn/README.md delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/acorn/bin/acorn delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/acorn/dist/acorn.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/acorn/dist/acorn.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/acorn/dist/acorn.mjs delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/acorn/dist/acorn.mjs.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/acorn/dist/bin.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/acorn/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/agent-base/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/agent-base/dist/src/index.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/agent-base/dist/src/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/agent-base/dist/src/promisify.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/agent-base/dist/src/promisify.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/agent-base/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/agent-base/src/index.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/agent-base/src/promisify.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/ansi-regex/index.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/ansi-regex/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/ansi-regex/license delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/ansi-regex/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/ansi-regex/readme.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/ansi-styles/index.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/ansi-styles/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/ansi-styles/license delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/ansi-styles/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/ansi-styles/readme.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/argparse/CHANGELOG.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/argparse/LICENSE delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/argparse/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/argparse/argparse.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/argparse/lib/sub.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/argparse/lib/textwrap.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/argparse/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/arrify/index.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/arrify/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/arrify/license delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/arrify/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/arrify/readme.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/async-retry/LICENSE.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/async-retry/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/async-retry/lib/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/async-retry/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/balanced-match/.github/FUNDING.yml delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/balanced-match/LICENSE.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/balanced-match/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/balanced-match/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/balanced-match/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/base64-js/LICENSE delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/base64-js/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/base64-js/base64js.min.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/base64-js/index.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/base64-js/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/base64-js/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/bignumber.js/CHANGELOG.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/bignumber.js/LICENCE.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/bignumber.js/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/bignumber.js/bignumber.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/bignumber.js/bignumber.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/bignumber.js/bignumber.mjs delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/bignumber.js/doc/API.html delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/bignumber.js/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/bluebird/LICENSE delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/bluebird/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/bluebird/changelog.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/bluebird/js/browser/bluebird.core.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/bluebird/js/browser/bluebird.core.min.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/bluebird/js/browser/bluebird.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/bluebird/js/browser/bluebird.min.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/bluebird/js/release/any.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/bluebird/js/release/assert.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/bluebird/js/release/async.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/bluebird/js/release/bind.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/bluebird/js/release/bluebird.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/bluebird/js/release/call_get.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/bluebird/js/release/cancel.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/bluebird/js/release/catch_filter.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/bluebird/js/release/context.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/bluebird/js/release/debuggability.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/bluebird/js/release/direct_resolve.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/bluebird/js/release/each.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/bluebird/js/release/errors.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/bluebird/js/release/es5.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/bluebird/js/release/filter.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/bluebird/js/release/finally.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/bluebird/js/release/generators.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/bluebird/js/release/join.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/bluebird/js/release/map.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/bluebird/js/release/method.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/bluebird/js/release/nodeback.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/bluebird/js/release/nodeify.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/bluebird/js/release/promise.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/bluebird/js/release/promise_array.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/bluebird/js/release/promisify.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/bluebird/js/release/props.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/bluebird/js/release/queue.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/bluebird/js/release/race.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/bluebird/js/release/reduce.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/bluebird/js/release/schedule.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/bluebird/js/release/settle.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/bluebird/js/release/some.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/bluebird/js/release/synchronous_inspection.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/bluebird/js/release/thenables.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/bluebird/js/release/timers.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/bluebird/js/release/using.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/bluebird/js/release/util.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/bluebird/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/brace-expansion/.github/FUNDING.yml delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/brace-expansion/LICENSE delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/brace-expansion/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/brace-expansion/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/brace-expansion/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/buffer-equal-constant-time/.npmignore delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/buffer-equal-constant-time/.travis.yml delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/buffer-equal-constant-time/LICENSE.txt delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/buffer-equal-constant-time/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/buffer-equal-constant-time/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/buffer-equal-constant-time/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/buffer-equal-constant-time/test.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/catharsis/LICENSE delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/catharsis/README.md delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/catharsis/bin/parse.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/catharsis/catharsis.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/catharsis/lib/describe.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/catharsis/lib/parser.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/catharsis/lib/schema.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/catharsis/lib/stringify.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/catharsis/lib/types.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/catharsis/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/catharsis/res/en.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/chalk/index.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/chalk/license delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/chalk/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/chalk/readme.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/chalk/source/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/chalk/source/templates.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/chalk/source/util.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/cliui/CHANGELOG.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/cliui/LICENSE.txt delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/cliui/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/cliui/index.mjs delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/cliui/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/color-convert/CHANGELOG.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/color-convert/LICENSE delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/color-convert/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/color-convert/conversions.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/color-convert/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/color-convert/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/color-convert/route.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/color-name/LICENSE delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/color-name/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/color-name/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/color-name/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/compressible/HISTORY.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/compressible/LICENSE delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/compressible/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/compressible/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/compressible/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/concat-map/.travis.yml delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/concat-map/LICENSE delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/concat-map/README.markdown delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/concat-map/example/map.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/concat-map/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/concat-map/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/concat-map/test/map.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/debug/LICENSE delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/debug/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/debug/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/debug/src/browser.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/debug/src/common.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/debug/src/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/debug/src/node.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/deep-is/.travis.yml delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/deep-is/LICENSE delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/deep-is/README.markdown delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/deep-is/example/cmp.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/deep-is/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/deep-is/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/deep-is/test/NaN.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/deep-is/test/cmp.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/deep-is/test/neg-vs-pos-0.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/duplexify/.travis.yml delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/duplexify/LICENSE delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/duplexify/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/duplexify/example.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/duplexify/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/duplexify/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/duplexify/test.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/ecdsa-sig-formatter/CODEOWNERS delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/ecdsa-sig-formatter/LICENSE delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/ecdsa-sig-formatter/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/ecdsa-sig-formatter/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/ecdsa-sig-formatter/src/ecdsa-sig-formatter.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/ecdsa-sig-formatter/src/ecdsa-sig-formatter.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/ecdsa-sig-formatter/src/param-bytes-for-alg.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/emoji-regex/LICENSE-MIT.txt delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/emoji-regex/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/emoji-regex/es2015/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/emoji-regex/es2015/text.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/emoji-regex/index.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/emoji-regex/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/emoji-regex/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/emoji-regex/text.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/end-of-stream/LICENSE delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/end-of-stream/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/end-of-stream/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/end-of-stream/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/ent/.npmignore delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/ent/.travis.yml delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/ent/LICENSE delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/ent/decode.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/ent/encode.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/ent/entities.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/ent/examples/simple.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/ent/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/ent/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/ent/readme.markdown delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/ent/reversed.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/ent/test/codes.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/ent/test/hex.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/ent/test/num.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/entities/LICENSE delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/entities/lib/decode.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/entities/lib/decode.d.ts.map delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/entities/lib/decode.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/entities/lib/decode_codepoint.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/entities/lib/decode_codepoint.d.ts.map delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/entities/lib/decode_codepoint.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/entities/lib/encode.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/entities/lib/encode.d.ts.map delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/entities/lib/encode.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/entities/lib/index.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/entities/lib/index.d.ts.map delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/entities/lib/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/entities/lib/maps/decode.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/entities/lib/maps/entities.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/entities/lib/maps/legacy.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/entities/lib/maps/xml.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/entities/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/entities/readme.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/escalade/dist/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/escalade/dist/index.mjs delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/escalade/index.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/escalade/license delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/escalade/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/escalade/readme.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/escalade/sync/index.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/escalade/sync/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/escalade/sync/index.mjs delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/escape-string-regexp/index.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/escape-string-regexp/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/escape-string-regexp/license delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/escape-string-regexp/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/escape-string-regexp/readme.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/escodegen/LICENSE.BSD delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/escodegen/README.md delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/escodegen/bin/escodegen.js delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/escodegen/bin/esgenerate.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/escodegen/escodegen.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/escodegen/node_modules/estraverse/.jshintrc delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/escodegen/node_modules/estraverse/LICENSE.BSD delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/escodegen/node_modules/estraverse/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/escodegen/node_modules/estraverse/estraverse.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/escodegen/node_modules/estraverse/gulpfile.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/escodegen/node_modules/estraverse/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/escodegen/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/eslint-visitor-keys/LICENSE delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/eslint-visitor-keys/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/eslint-visitor-keys/dist/eslint-visitor-keys.cjs delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/eslint-visitor-keys/dist/index.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/eslint-visitor-keys/dist/visitor-keys.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/eslint-visitor-keys/lib/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/eslint-visitor-keys/lib/visitor-keys.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/eslint-visitor-keys/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/espree/LICENSE delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/espree/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/espree/dist/espree.cjs delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/espree/espree.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/espree/lib/espree.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/espree/lib/features.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/espree/lib/options.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/espree/lib/token-translator.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/espree/lib/version.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/espree/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/esprima/ChangeLog delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/esprima/LICENSE.BSD delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/esprima/README.md delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/esprima/bin/esparse.js delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/esprima/bin/esvalidate.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/esprima/dist/esprima.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/esprima/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/estraverse/.jshintrc delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/estraverse/LICENSE.BSD delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/estraverse/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/estraverse/estraverse.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/estraverse/gulpfile.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/estraverse/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/esutils/LICENSE.BSD delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/esutils/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/esutils/lib/ast.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/esutils/lib/code.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/esutils/lib/keyword.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/esutils/lib/utils.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/esutils/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/event-target-shim/LICENSE delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/event-target-shim/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/event-target-shim/dist/event-target-shim.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/event-target-shim/dist/event-target-shim.mjs delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/event-target-shim/dist/event-target-shim.mjs.map delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/event-target-shim/dist/event-target-shim.umd.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/event-target-shim/index.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/event-target-shim/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/extend/.editorconfig delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/extend/.eslintrc delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/extend/.jscs.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/extend/.travis.yml delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/extend/CHANGELOG.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/extend/LICENSE delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/extend/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/extend/component.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/extend/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/extend/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/fast-deep-equal/LICENSE delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/fast-deep-equal/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/fast-deep-equal/es6/index.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/fast-deep-equal/es6/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/fast-deep-equal/es6/react.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/fast-deep-equal/es6/react.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/fast-deep-equal/index.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/fast-deep-equal/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/fast-deep-equal/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/fast-deep-equal/react.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/fast-deep-equal/react.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/fast-levenshtein/LICENSE.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/fast-levenshtein/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/fast-levenshtein/levenshtein.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/fast-levenshtein/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/fast-text-encoding/LICENSE delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/fast-text-encoding/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/fast-text-encoding/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/fast-text-encoding/text.min.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/faye-websocket/CHANGELOG.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/faye-websocket/LICENSE.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/faye-websocket/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/faye-websocket/lib/faye/eventsource.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/faye-websocket/lib/faye/websocket.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/faye-websocket/lib/faye/websocket/api.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/faye-websocket/lib/faye/websocket/api/event.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/faye-websocket/lib/faye/websocket/api/event_target.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/faye-websocket/lib/faye/websocket/client.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/faye-websocket/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/LICENSE delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/app-check/app-check-api-client-internal.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/app-check/app-check-api-client-internal.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/app-check/app-check-api.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/app-check/app-check-api.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/app-check/app-check-namespace.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/app-check/app-check-namespace.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/app-check/app-check.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/app-check/app-check.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/app-check/index.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/app-check/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/app-check/token-generator.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/app-check/token-generator.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/app-check/token-verifier.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/app-check/token-verifier.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/app/core.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/app/core.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/app/credential-factory.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/app/credential-factory.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/app/credential-internal.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/app/credential-internal.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/app/credential.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/app/credential.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/app/firebase-app.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/app/firebase-app.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/app/firebase-namespace.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/app/firebase-namespace.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/app/index.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/app/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/app/lifecycle.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/app/lifecycle.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/auth/action-code-settings-builder.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/auth/action-code-settings-builder.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/auth/auth-api-request.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/auth/auth-api-request.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/auth/auth-config.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/auth/auth-config.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/auth/auth-namespace.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/auth/auth-namespace.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/auth/auth.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/auth/auth.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/auth/base-auth.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/auth/base-auth.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/auth/identifier.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/auth/identifier.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/auth/index.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/auth/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/auth/project-config-manager.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/auth/project-config-manager.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/auth/project-config.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/auth/project-config.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/auth/tenant-manager.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/auth/tenant-manager.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/auth/tenant.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/auth/tenant.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/auth/token-generator.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/auth/token-generator.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/auth/token-verifier.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/auth/token-verifier.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/auth/user-import-builder.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/auth/user-import-builder.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/auth/user-record.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/auth/user-record.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/credential/index.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/credential/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/database/database-namespace.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/database/database-namespace.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/database/database.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/database/database.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/database/index.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/database/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/default-namespace.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/default-namespace.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/esm/app-check/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/esm/app/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/esm/auth/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/esm/database/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/esm/eventarc/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/esm/extensions/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/esm/firestore/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/esm/functions/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/esm/installations/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/esm/instance-id/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/esm/machine-learning/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/esm/messaging/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/esm/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/esm/project-management/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/esm/remote-config/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/esm/security-rules/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/esm/storage/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/eventarc/cloudevent.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/eventarc/cloudevent.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/eventarc/eventarc-client-internal.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/eventarc/eventarc-client-internal.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/eventarc/eventarc-utils.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/eventarc/eventarc-utils.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/eventarc/eventarc.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/eventarc/eventarc.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/eventarc/index.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/eventarc/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/extensions/extensions-api-client-internal.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/extensions/extensions-api-client-internal.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/extensions/extensions-api.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/extensions/extensions-api.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/extensions/extensions.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/extensions/extensions.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/extensions/index.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/extensions/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/firebase-namespace-api.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/firebase-namespace-api.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/firestore/firestore-internal.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/firestore/firestore-internal.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/firestore/firestore-namespace.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/firestore/firestore-namespace.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/firestore/index.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/firestore/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/functions/functions-api-client-internal.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/functions/functions-api-client-internal.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/functions/functions-api.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/functions/functions-api.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/functions/functions.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/functions/functions.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/functions/index.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/functions/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/index.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/installations/index.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/installations/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/installations/installations-namespace.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/installations/installations-namespace.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/installations/installations-request-handler.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/installations/installations-request-handler.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/installations/installations.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/installations/installations.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/instance-id/index.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/instance-id/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/instance-id/instance-id-namespace.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/instance-id/instance-id-namespace.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/instance-id/instance-id.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/instance-id/instance-id.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/machine-learning/index.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/machine-learning/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/machine-learning/machine-learning-api-client.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/machine-learning/machine-learning-api-client.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/machine-learning/machine-learning-namespace.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/machine-learning/machine-learning-namespace.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/machine-learning/machine-learning-utils.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/machine-learning/machine-learning-utils.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/machine-learning/machine-learning.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/machine-learning/machine-learning.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/messaging/batch-request-internal.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/messaging/batch-request-internal.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/messaging/index.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/messaging/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/messaging/messaging-api-request-internal.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/messaging/messaging-api-request-internal.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/messaging/messaging-api.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/messaging/messaging-api.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/messaging/messaging-errors-internal.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/messaging/messaging-errors-internal.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/messaging/messaging-internal.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/messaging/messaging-internal.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/messaging/messaging-namespace.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/messaging/messaging-namespace.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/messaging/messaging.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/messaging/messaging.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/project-management/android-app.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/project-management/android-app.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/project-management/app-metadata.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/project-management/app-metadata.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/project-management/index.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/project-management/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/project-management/ios-app.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/project-management/ios-app.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/project-management/project-management-api-request-internal.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/project-management/project-management-api-request-internal.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/project-management/project-management-namespace.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/project-management/project-management-namespace.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/project-management/project-management.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/project-management/project-management.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/remote-config/index.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/remote-config/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/remote-config/remote-config-api-client-internal.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/remote-config/remote-config-api-client-internal.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/remote-config/remote-config-api.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/remote-config/remote-config-api.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/remote-config/remote-config-namespace.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/remote-config/remote-config-namespace.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/remote-config/remote-config.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/remote-config/remote-config.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/security-rules/index.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/security-rules/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/security-rules/security-rules-api-client-internal.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/security-rules/security-rules-api-client-internal.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/security-rules/security-rules-internal.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/security-rules/security-rules-internal.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/security-rules/security-rules-namespace.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/security-rules/security-rules-namespace.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/security-rules/security-rules.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/security-rules/security-rules.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/storage/index.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/storage/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/storage/storage-namespace.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/storage/storage-namespace.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/storage/storage.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/storage/storage.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/utils/api-request.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/utils/api-request.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/utils/crypto-signer.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/utils/crypto-signer.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/utils/deep-copy.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/utils/deep-copy.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/utils/error.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/utils/error.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/utils/index.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/utils/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/utils/jwt.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/utils/jwt.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/utils/validator.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/lib/utils/validator.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/firebase-admin/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/fs.realpath/LICENSE delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/fs.realpath/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/fs.realpath/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/fs.realpath/old.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/fs.realpath/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/functional-red-black-tree/.npmignore delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/functional-red-black-tree/LICENSE delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/functional-red-black-tree/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/functional-red-black-tree/bench/test.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/functional-red-black-tree/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/functional-red-black-tree/rbtree.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/functional-red-black-tree/test/test.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/gaxios/CHANGELOG.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/gaxios/LICENSE delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/gaxios/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/gaxios/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/gcp-metadata/CHANGELOG.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/gcp-metadata/LICENSE delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/gcp-metadata/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/gcp-metadata/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/get-caller-file/LICENSE.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/get-caller-file/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/get-caller-file/index.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/get-caller-file/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/get-caller-file/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/glob/LICENSE delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/glob/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/glob/common.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/glob/glob.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/glob/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/glob/sync.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/google-auth-library/CHANGELOG.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/google-auth-library/LICENSE delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/google-auth-library/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/google-auth-library/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/google-gax/CHANGELOG.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/google-gax/LICENSE delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/google-gax/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/google-gax/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/google-p12-pem/CHANGELOG.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/google-p12-pem/LICENSE delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/google-p12-pem/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/google-p12-pem/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/graceful-fs/LICENSE delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/graceful-fs/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/graceful-fs/clone.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/graceful-fs/graceful-fs.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/graceful-fs/legacy-streams.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/graceful-fs/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/graceful-fs/polyfills.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/gtoken/CHANGELOG.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/gtoken/LICENSE delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/gtoken/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/gtoken/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/has-flag/index.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/has-flag/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/has-flag/license delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/has-flag/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/has-flag/readme.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/http-parser-js/LICENSE.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/http-parser-js/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/http-parser-js/http-parser.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/http-parser-js/http-parser.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/http-parser-js/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/http-proxy-agent/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/http-proxy-agent/dist/agent.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/http-proxy-agent/dist/agent.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/http-proxy-agent/dist/index.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/http-proxy-agent/dist/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/http-proxy-agent/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/https-proxy-agent/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/https-proxy-agent/dist/agent.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/https-proxy-agent/dist/agent.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/https-proxy-agent/dist/index.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/https-proxy-agent/dist/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/https-proxy-agent/dist/parse-proxy-response.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/https-proxy-agent/dist/parse-proxy-response.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/https-proxy-agent/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/inflight/LICENSE delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/inflight/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/inflight/inflight.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/inflight/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/inherits/LICENSE delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/inherits/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/inherits/inherits.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/inherits/inherits_browser.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/inherits/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/is-fullwidth-code-point/index.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/is-fullwidth-code-point/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/is-fullwidth-code-point/license delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/is-fullwidth-code-point/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/is-fullwidth-code-point/readme.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/is-stream-ended/index.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/is-stream-ended/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/is-stream-ended/license delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/is-stream-ended/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/is-stream-ended/readme.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/is-stream/index.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/is-stream/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/is-stream/license delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/is-stream/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/is-stream/readme.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jose/LICENSE.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jose/LICENSE_THIRD_PARTY delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jose/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jose/lib/errors.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jose/lib/help/asn1/algorithm_identifier.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jose/lib/help/asn1/ec_private_key.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jose/lib/help/asn1/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jose/lib/help/asn1/oids.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jose/lib/help/asn1/one_asymmetric_key.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jose/lib/help/asn1/private_key.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jose/lib/help/asn1/private_key_info.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jose/lib/help/asn1/public_key_info.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jose/lib/help/asn1/rsa_private_key.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jose/lib/help/asn1/rsa_public_key.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jose/lib/help/base64url.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jose/lib/help/consts.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jose/lib/help/deep_clone.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jose/lib/help/ecdsa_signatures.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jose/lib/help/epoch.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jose/lib/help/generate_iv.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jose/lib/help/get_key.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jose/lib/help/is_disjoint.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jose/lib/help/is_object.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jose/lib/help/key_object.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jose/lib/help/key_utils.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jose/lib/help/node_alg.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jose/lib/help/rsa_primes.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jose/lib/help/runtime_support.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jose/lib/help/secs.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jose/lib/help/timing_safe_equal.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jose/lib/help/uint64be.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jose/lib/help/validate_crit.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jose/lib/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jose/lib/index.mjs delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jose/lib/jwa/aes_cbc_hmac_sha2.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jose/lib/jwa/aes_gcm.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jose/lib/jwa/aes_gcm_kw.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jose/lib/jwa/aes_kw.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jose/lib/jwa/ecdh/compute_secret.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jose/lib/jwa/ecdh/derive.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jose/lib/jwa/ecdh/dir.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jose/lib/jwa/ecdh/kw.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jose/lib/jwa/ecdsa.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jose/lib/jwa/eddsa.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jose/lib/jwa/hmac.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jose/lib/jwa/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jose/lib/jwa/none.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jose/lib/jwa/pbes2.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jose/lib/jwa/rsaes.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jose/lib/jwa/rsassa.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jose/lib/jwa/rsassa_pss.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jose/lib/jwe/decrypt.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jose/lib/jwe/encrypt.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jose/lib/jwe/generate_cek.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jose/lib/jwe/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jose/lib/jwe/serializers.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jose/lib/jwe/validate_headers.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jose/lib/jwk/generate.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jose/lib/jwk/import.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jose/lib/jwk/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jose/lib/jwk/key/base.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jose/lib/jwk/key/ec.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jose/lib/jwk/key/embedded.jwk.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jose/lib/jwk/key/embedded.x5c.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jose/lib/jwk/key/none.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jose/lib/jwk/key/oct.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jose/lib/jwk/key/okp.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jose/lib/jwk/key/rsa.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jose/lib/jwk/thumbprint.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jose/lib/jwks/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jose/lib/jwks/keystore.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jose/lib/jws/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jose/lib/jws/serializers.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jose/lib/jws/sign.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jose/lib/jws/verify.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jose/lib/jwt/decode.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jose/lib/jwt/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jose/lib/jwt/profiles.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jose/lib/jwt/shared_validations.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jose/lib/jwt/sign.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jose/lib/jwt/verify.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jose/lib/registry/ec_curves.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jose/lib/registry/ecdh_derive_lengths.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jose/lib/registry/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jose/lib/registry/iv_lengths.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jose/lib/registry/jwa.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jose/lib/registry/jwk.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jose/lib/registry/key_lengths.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jose/lib/registry/okp_curves.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jose/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jose/types/index.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/js2xmlparser/CHANGES.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/js2xmlparser/LICENSE delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/js2xmlparser/NOTICE delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/js2xmlparser/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/js2xmlparser/lib/main.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/js2xmlparser/lib/main.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/js2xmlparser/lib/options.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/js2xmlparser/lib/options.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/js2xmlparser/lib/utils.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/js2xmlparser/lib/utils.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/js2xmlparser/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/Apache_License_2.0.txt delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/LICENSE.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/cli.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/conf.json.EXAMPLE delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/jsdoc.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/lib/jsdoc/app.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/lib/jsdoc/augment.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/lib/jsdoc/borrow.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/lib/jsdoc/config.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/lib/jsdoc/doclet.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/lib/jsdoc/env.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/lib/jsdoc/fs.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/lib/jsdoc/name.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/lib/jsdoc/opts/argparser.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/lib/jsdoc/opts/args.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/lib/jsdoc/package.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/lib/jsdoc/path.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/lib/jsdoc/plugins.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/lib/jsdoc/readme.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/lib/jsdoc/schema.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/lib/jsdoc/src/astbuilder.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/lib/jsdoc/src/astnode.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/lib/jsdoc/src/filter.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/lib/jsdoc/src/handlers.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/lib/jsdoc/src/parser.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/lib/jsdoc/src/scanner.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/lib/jsdoc/src/syntax.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/lib/jsdoc/src/visitor.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/lib/jsdoc/src/walker.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/lib/jsdoc/tag.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/lib/jsdoc/tag/dictionary.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/lib/jsdoc/tag/dictionary/definitions.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/lib/jsdoc/tag/inline.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/lib/jsdoc/tag/type.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/lib/jsdoc/tag/validator.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/lib/jsdoc/template.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/lib/jsdoc/tutorial.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/lib/jsdoc/tutorial/resolver.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/lib/jsdoc/util/cast.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/lib/jsdoc/util/doop.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/lib/jsdoc/util/dumper.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/lib/jsdoc/util/error.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/lib/jsdoc/util/logger.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/lib/jsdoc/util/markdown.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/lib/jsdoc/util/stripbom.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/lib/jsdoc/util/templateHelper.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/plugins/commentConvert.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/plugins/commentsOnly.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/plugins/escapeHtml.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/plugins/eventDumper.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/plugins/markdown.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/plugins/overloadHelper.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/plugins/partial.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/plugins/railsTemplate.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/plugins/shout.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/plugins/sourcetag.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/plugins/summarize.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/plugins/test/fixtures/markdown.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/plugins/test/fixtures/overloadHelper.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/plugins/test/fixtures/railsTemplate.js.erb delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/plugins/test/fixtures/underscore.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/plugins/test/specs/commentConvert.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/plugins/test/specs/escapeHtml.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/plugins/test/specs/markdown.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/plugins/test/specs/overloadHelper.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/plugins/test/specs/railsTemplate.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/plugins/test/specs/shout.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/plugins/test/specs/sourcetag.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/plugins/test/specs/summarize.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/plugins/test/specs/underscore.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/plugins/underscore.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/templates/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/templates/default/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/templates/default/publish.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/templates/default/static/fonts/OpenSans-Bold-webfont.eot delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/templates/default/static/fonts/OpenSans-Bold-webfont.svg delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/templates/default/static/fonts/OpenSans-Bold-webfont.woff delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/templates/default/static/fonts/OpenSans-BoldItalic-webfont.eot delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/templates/default/static/fonts/OpenSans-BoldItalic-webfont.svg delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/templates/default/static/fonts/OpenSans-BoldItalic-webfont.woff delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/templates/default/static/fonts/OpenSans-Italic-webfont.eot delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/templates/default/static/fonts/OpenSans-Italic-webfont.svg delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/templates/default/static/fonts/OpenSans-Italic-webfont.woff delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/templates/default/static/fonts/OpenSans-Light-webfont.eot delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/templates/default/static/fonts/OpenSans-Light-webfont.svg delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/templates/default/static/fonts/OpenSans-Light-webfont.woff delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/templates/default/static/fonts/OpenSans-LightItalic-webfont.eot delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/templates/default/static/fonts/OpenSans-LightItalic-webfont.svg delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/templates/default/static/fonts/OpenSans-LightItalic-webfont.woff delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/templates/default/static/fonts/OpenSans-Regular-webfont.eot delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/templates/default/static/fonts/OpenSans-Regular-webfont.svg delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/templates/default/static/fonts/OpenSans-Regular-webfont.woff delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/templates/default/static/scripts/linenumber.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/templates/default/static/scripts/prettify/Apache-License-2.0.txt delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/templates/default/static/scripts/prettify/lang-css.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/templates/default/static/scripts/prettify/prettify.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/templates/default/static/styles/jsdoc-default.css delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/templates/default/static/styles/prettify-jsdoc.css delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/templates/default/static/styles/prettify-tomorrow.css delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/templates/default/tmpl/augments.tmpl delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/templates/default/tmpl/container.tmpl delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/templates/default/tmpl/details.tmpl delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/templates/default/tmpl/example.tmpl delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/templates/default/tmpl/examples.tmpl delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/templates/default/tmpl/exceptions.tmpl delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/templates/default/tmpl/layout.tmpl delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/templates/default/tmpl/mainpage.tmpl delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/templates/default/tmpl/members.tmpl delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/templates/default/tmpl/method.tmpl delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/templates/default/tmpl/modifies.tmpl delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/templates/default/tmpl/params.tmpl delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/templates/default/tmpl/properties.tmpl delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/templates/default/tmpl/returns.tmpl delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/templates/default/tmpl/source.tmpl delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/templates/default/tmpl/tutorial.tmpl delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/templates/default/tmpl/type.tmpl delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/templates/haruki/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/templates/haruki/publish.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/templates/silent/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/templates/silent/publish.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/json-bigint/LICENSE delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/json-bigint/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/json-bigint/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/json-bigint/lib/parse.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/json-bigint/lib/stringify.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/json-bigint/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsonwebtoken/CHANGELOG.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsonwebtoken/LICENSE delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsonwebtoken/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsonwebtoken/decode.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsonwebtoken/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsonwebtoken/lib/JsonWebTokenError.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsonwebtoken/lib/NotBeforeError.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsonwebtoken/lib/TokenExpiredError.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsonwebtoken/lib/psSupported.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsonwebtoken/lib/timespan.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsonwebtoken/node_modules/jwa/LICENSE delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsonwebtoken/node_modules/jwa/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsonwebtoken/node_modules/jwa/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsonwebtoken/node_modules/jwa/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsonwebtoken/node_modules/jws/CHANGELOG.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsonwebtoken/node_modules/jws/LICENSE delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsonwebtoken/node_modules/jws/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsonwebtoken/node_modules/jws/lib/data-stream.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsonwebtoken/node_modules/jws/lib/sign-stream.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsonwebtoken/node_modules/jws/lib/tostring.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsonwebtoken/node_modules/jws/lib/verify-stream.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsonwebtoken/node_modules/jws/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsonwebtoken/node_modules/jws/readme.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsonwebtoken/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsonwebtoken/sign.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jsonwebtoken/verify.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jwa/LICENSE delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jwa/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jwa/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jwa/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jwks-rsa/LICENSE delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jwks-rsa/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jwks-rsa/index.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jwks-rsa/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jwks-rsa/src/JwksClient.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jwks-rsa/src/errors/ArgumentError.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jwks-rsa/src/errors/JwksError.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jwks-rsa/src/errors/JwksRateLimitError.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jwks-rsa/src/errors/SigningKeyNotFoundError.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jwks-rsa/src/errors/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jwks-rsa/src/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jwks-rsa/src/integrations/config.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jwks-rsa/src/integrations/express.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jwks-rsa/src/integrations/hapi.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jwks-rsa/src/integrations/koa.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jwks-rsa/src/integrations/passport.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jwks-rsa/src/utils.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jwks-rsa/src/wrappers/cache.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jwks-rsa/src/wrappers/callbackSupport.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jwks-rsa/src/wrappers/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jwks-rsa/src/wrappers/interceptor.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jwks-rsa/src/wrappers/rateLimit.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jwks-rsa/src/wrappers/request.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jws/CHANGELOG.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jws/LICENSE delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jws/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jws/lib/data-stream.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jws/lib/sign-stream.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jws/lib/tostring.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jws/lib/verify-stream.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jws/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/jws/readme.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/klaw/CHANGELOG.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/klaw/LICENSE delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/klaw/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/klaw/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/klaw/src/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/levn/LICENSE delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/levn/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/levn/lib/cast.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/levn/lib/coerce.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/levn/lib/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/levn/lib/parse-string.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/levn/lib/parse.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/levn/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/limiter/.travis.yml delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/limiter/LICENSE.txt delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/limiter/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/limiter/bower.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/limiter/index.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/limiter/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/limiter/lib/clock.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/limiter/lib/rateLimiter.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/limiter/lib/tokenBucket.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/limiter/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/limiter/test/ratelimiter-test.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/limiter/test/tokenbucket-test.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/linkify-it/CHANGELOG.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/linkify-it/LICENSE delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/linkify-it/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/linkify-it/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/linkify-it/lib/re.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/linkify-it/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash.camelcase/LICENSE delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash.camelcase/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash.camelcase/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash.camelcase/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash.clonedeep/LICENSE delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash.clonedeep/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash.clonedeep/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash.clonedeep/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash.includes/LICENSE delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash.includes/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash.includes/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash.includes/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash.isboolean/LICENSE delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash.isboolean/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash.isboolean/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash.isboolean/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash.isinteger/LICENSE delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash.isinteger/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash.isinteger/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash.isinteger/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash.isnumber/LICENSE delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash.isnumber/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash.isnumber/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash.isnumber/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash.isplainobject/LICENSE delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash.isplainobject/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash.isplainobject/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash.isplainobject/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash.isstring/LICENSE delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash.isstring/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash.isstring/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash.isstring/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash.once/LICENSE delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash.once/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash.once/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash.once/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/LICENSE delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_DataView.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_Hash.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_LazyWrapper.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_ListCache.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_LodashWrapper.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_Map.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_MapCache.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_Promise.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_Set.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_SetCache.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_Stack.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_Symbol.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_Uint8Array.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_WeakMap.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_apply.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_arrayAggregator.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_arrayEach.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_arrayEachRight.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_arrayEvery.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_arrayFilter.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_arrayIncludes.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_arrayIncludesWith.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_arrayLikeKeys.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_arrayMap.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_arrayPush.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_arrayReduce.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_arrayReduceRight.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_arraySample.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_arraySampleSize.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_arrayShuffle.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_arraySome.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_asciiSize.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_asciiToArray.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_asciiWords.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_assignMergeValue.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_assignValue.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_assocIndexOf.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseAggregator.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseAssign.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseAssignIn.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseAssignValue.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseAt.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseClamp.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseClone.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseConforms.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseConformsTo.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseCreate.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseDelay.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseDifference.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseEach.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseEachRight.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseEvery.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseExtremum.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseFill.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseFilter.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseFindIndex.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseFindKey.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseFlatten.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseFor.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseForOwn.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseForOwnRight.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseForRight.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseFunctions.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseGet.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseGetAllKeys.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseGetTag.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseGt.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseHas.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseHasIn.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseInRange.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseIndexOf.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseIndexOfWith.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseIntersection.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseInverter.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseInvoke.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseIsArguments.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseIsArrayBuffer.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseIsDate.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseIsEqual.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseIsEqualDeep.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseIsMap.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseIsMatch.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseIsNaN.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseIsNative.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseIsRegExp.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseIsSet.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseIsTypedArray.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseIteratee.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseKeys.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseKeysIn.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseLodash.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseLt.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseMap.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseMatches.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseMatchesProperty.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseMean.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseMerge.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseMergeDeep.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseNth.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseOrderBy.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_basePick.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_basePickBy.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseProperty.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_basePropertyDeep.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_basePropertyOf.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_basePullAll.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_basePullAt.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseRandom.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseRange.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseReduce.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseRepeat.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseRest.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseSample.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseSampleSize.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseSet.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseSetData.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseSetToString.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseShuffle.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseSlice.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseSome.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseSortBy.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseSortedIndex.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseSortedIndexBy.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseSortedUniq.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseSum.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseTimes.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseToNumber.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseToPairs.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseToString.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseTrim.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseUnary.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseUniq.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseUnset.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseUpdate.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseValues.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseWhile.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseWrapperValue.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseXor.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseZipObject.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_cacheHas.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_castArrayLikeObject.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_castFunction.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_castPath.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_castRest.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_castSlice.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_charsEndIndex.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_charsStartIndex.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_cloneArrayBuffer.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_cloneBuffer.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_cloneDataView.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_cloneRegExp.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_cloneSymbol.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_cloneTypedArray.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_compareAscending.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_compareMultiple.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_composeArgs.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_composeArgsRight.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_copyArray.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_copyObject.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_copySymbols.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_copySymbolsIn.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_coreJsData.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_countHolders.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_createAggregator.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_createAssigner.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_createBaseEach.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_createBaseFor.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_createBind.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_createCaseFirst.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_createCompounder.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_createCtor.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_createCurry.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_createFind.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_createFlow.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_createHybrid.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_createInverter.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_createMathOperation.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_createOver.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_createPadding.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_createPartial.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_createRange.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_createRecurry.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_createRelationalOperation.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_createRound.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_createSet.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_createToPairs.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_createWrap.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_customDefaultsAssignIn.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_customDefaultsMerge.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_customOmitClone.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_deburrLetter.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_defineProperty.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_equalArrays.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_equalByTag.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_equalObjects.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_escapeHtmlChar.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_escapeStringChar.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_flatRest.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_freeGlobal.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_getAllKeys.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_getAllKeysIn.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_getData.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_getFuncName.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_getHolder.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_getMapData.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_getMatchData.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_getNative.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_getPrototype.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_getRawTag.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_getSymbols.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_getSymbolsIn.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_getTag.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_getValue.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_getView.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_getWrapDetails.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_hasPath.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_hasUnicode.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_hasUnicodeWord.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_hashClear.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_hashDelete.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_hashGet.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_hashHas.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_hashSet.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_initCloneArray.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_initCloneByTag.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_initCloneObject.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_insertWrapDetails.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_isFlattenable.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_isIndex.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_isIterateeCall.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_isKey.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_isKeyable.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_isLaziable.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_isMaskable.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_isMasked.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_isPrototype.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_isStrictComparable.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_iteratorToArray.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_lazyClone.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_lazyReverse.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_lazyValue.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_listCacheClear.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_listCacheDelete.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_listCacheGet.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_listCacheHas.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_listCacheSet.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_mapCacheClear.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_mapCacheDelete.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_mapCacheGet.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_mapCacheHas.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_mapCacheSet.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_mapToArray.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_matchesStrictComparable.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_memoizeCapped.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_mergeData.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_metaMap.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_nativeCreate.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_nativeKeys.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_nativeKeysIn.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_nodeUtil.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_objectToString.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_overArg.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_overRest.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_parent.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_reEscape.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_reEvaluate.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_reInterpolate.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_realNames.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_reorder.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_replaceHolders.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_root.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_safeGet.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_setCacheAdd.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_setCacheHas.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_setData.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_setToArray.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_setToPairs.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_setToString.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_setWrapToString.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_shortOut.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_shuffleSelf.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_stackClear.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_stackDelete.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_stackGet.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_stackHas.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_stackSet.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_strictIndexOf.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_strictLastIndexOf.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_stringSize.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_stringToArray.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_stringToPath.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_toKey.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_toSource.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_trimmedEndIndex.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_unescapeHtmlChar.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_unicodeSize.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_unicodeToArray.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_unicodeWords.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_updateWrapDetails.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_wrapperClone.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/add.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/after.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/array.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/ary.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/assign.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/assignIn.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/assignInWith.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/assignWith.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/at.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/attempt.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/before.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/bind.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/bindAll.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/bindKey.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/camelCase.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/capitalize.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/castArray.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/ceil.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/chain.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/chunk.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/clamp.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/clone.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/cloneDeep.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/cloneDeepWith.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/cloneWith.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/collection.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/commit.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/compact.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/concat.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/cond.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/conforms.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/conformsTo.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/constant.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/core.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/core.min.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/countBy.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/create.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/curry.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/curryRight.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/date.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/debounce.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/deburr.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/defaultTo.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/defaults.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/defaultsDeep.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/defer.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/delay.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/difference.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/differenceBy.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/differenceWith.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/divide.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/drop.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/dropRight.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/dropRightWhile.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/dropWhile.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/each.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/eachRight.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/endsWith.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/entries.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/entriesIn.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/eq.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/escape.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/escapeRegExp.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/every.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/extend.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/extendWith.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fill.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/filter.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/find.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/findIndex.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/findKey.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/findLast.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/findLastIndex.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/findLastKey.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/first.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/flake.lock delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/flake.nix delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/flatMap.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/flatMapDeep.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/flatMapDepth.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/flatten.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/flattenDeep.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/flattenDepth.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/flip.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/floor.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/flow.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/flowRight.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/forEach.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/forEachRight.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/forIn.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/forInRight.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/forOwn.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/forOwnRight.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/F.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/T.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/__.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/_baseConvert.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/_convertBrowser.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/_falseOptions.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/_mapping.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/_util.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/add.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/after.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/all.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/allPass.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/always.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/any.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/anyPass.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/apply.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/array.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/ary.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/assign.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/assignAll.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/assignAllWith.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/assignIn.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/assignInAll.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/assignInAllWith.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/assignInWith.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/assignWith.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/assoc.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/assocPath.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/at.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/attempt.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/before.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/bind.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/bindAll.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/bindKey.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/camelCase.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/capitalize.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/castArray.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/ceil.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/chain.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/chunk.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/clamp.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/clone.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/cloneDeep.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/cloneDeepWith.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/cloneWith.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/collection.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/commit.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/compact.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/complement.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/compose.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/concat.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/cond.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/conforms.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/conformsTo.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/constant.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/contains.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/convert.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/countBy.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/create.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/curry.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/curryN.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/curryRight.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/curryRightN.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/date.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/debounce.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/deburr.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/defaultTo.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/defaults.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/defaultsAll.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/defaultsDeep.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/defaultsDeepAll.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/defer.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/delay.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/difference.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/differenceBy.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/differenceWith.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/dissoc.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/dissocPath.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/divide.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/drop.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/dropLast.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/dropLastWhile.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/dropRight.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/dropRightWhile.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/dropWhile.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/each.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/eachRight.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/endsWith.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/entries.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/entriesIn.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/eq.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/equals.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/escape.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/escapeRegExp.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/every.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/extend.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/extendAll.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/extendAllWith.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/extendWith.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/fill.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/filter.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/find.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/findFrom.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/findIndex.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/findIndexFrom.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/findKey.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/findLast.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/findLastFrom.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/findLastIndex.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/findLastIndexFrom.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/findLastKey.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/first.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/flatMap.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/flatMapDeep.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/flatMapDepth.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/flatten.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/flattenDeep.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/flattenDepth.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/flip.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/floor.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/flow.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/flowRight.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/forEach.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/forEachRight.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/forIn.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/forInRight.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/forOwn.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/forOwnRight.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/fromPairs.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/function.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/functions.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/functionsIn.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/get.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/getOr.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/groupBy.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/gt.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/gte.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/has.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/hasIn.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/head.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/identical.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/identity.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/inRange.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/includes.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/includesFrom.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/indexBy.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/indexOf.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/indexOfFrom.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/init.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/initial.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/intersection.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/intersectionBy.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/intersectionWith.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/invert.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/invertBy.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/invertObj.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/invoke.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/invokeArgs.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/invokeArgsMap.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/invokeMap.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isArguments.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isArray.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isArrayBuffer.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isArrayLike.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isArrayLikeObject.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isBoolean.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isBuffer.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isDate.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isElement.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isEmpty.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isEqual.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isEqualWith.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isError.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isFinite.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isFunction.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isInteger.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isLength.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isMap.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isMatch.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isMatchWith.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isNaN.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isNative.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isNil.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isNull.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isNumber.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isObject.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isObjectLike.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isPlainObject.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isRegExp.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isSafeInteger.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isSet.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isString.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isSymbol.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isTypedArray.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isUndefined.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isWeakMap.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isWeakSet.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/iteratee.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/join.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/juxt.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/kebabCase.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/keyBy.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/keys.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/keysIn.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/lang.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/last.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/lastIndexOf.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/lastIndexOfFrom.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/lowerCase.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/lowerFirst.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/lt.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/lte.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/map.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/mapKeys.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/mapValues.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/matches.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/matchesProperty.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/math.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/max.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/maxBy.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/mean.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/meanBy.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/memoize.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/merge.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/mergeAll.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/mergeAllWith.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/mergeWith.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/method.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/methodOf.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/min.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/minBy.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/mixin.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/multiply.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/nAry.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/negate.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/next.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/noop.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/now.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/nth.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/nthArg.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/number.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/object.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/omit.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/omitAll.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/omitBy.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/once.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/orderBy.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/over.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/overArgs.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/overEvery.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/overSome.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/pad.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/padChars.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/padCharsEnd.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/padCharsStart.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/padEnd.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/padStart.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/parseInt.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/partial.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/partialRight.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/partition.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/path.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/pathEq.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/pathOr.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/paths.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/pick.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/pickAll.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/pickBy.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/pipe.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/placeholder.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/plant.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/pluck.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/prop.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/propEq.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/propOr.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/property.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/propertyOf.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/props.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/pull.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/pullAll.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/pullAllBy.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/pullAllWith.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/pullAt.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/random.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/range.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/rangeRight.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/rangeStep.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/rangeStepRight.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/rearg.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/reduce.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/reduceRight.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/reject.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/remove.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/repeat.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/replace.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/rest.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/restFrom.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/result.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/reverse.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/round.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/sample.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/sampleSize.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/seq.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/set.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/setWith.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/shuffle.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/size.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/slice.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/snakeCase.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/some.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/sortBy.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/sortedIndex.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/sortedIndexBy.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/sortedIndexOf.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/sortedLastIndex.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/sortedLastIndexBy.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/sortedLastIndexOf.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/sortedUniq.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/sortedUniqBy.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/split.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/spread.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/spreadFrom.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/startCase.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/startsWith.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/string.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/stubArray.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/stubFalse.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/stubObject.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/stubString.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/stubTrue.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/subtract.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/sum.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/sumBy.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/symmetricDifference.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/symmetricDifferenceBy.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/symmetricDifferenceWith.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/tail.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/take.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/takeLast.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/takeLastWhile.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/takeRight.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/takeRightWhile.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/takeWhile.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/tap.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/template.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/templateSettings.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/throttle.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/thru.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/times.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/toArray.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/toFinite.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/toInteger.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/toIterator.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/toJSON.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/toLength.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/toLower.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/toNumber.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/toPairs.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/toPairsIn.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/toPath.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/toPlainObject.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/toSafeInteger.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/toString.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/toUpper.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/transform.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/trim.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/trimChars.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/trimCharsEnd.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/trimCharsStart.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/trimEnd.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/trimStart.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/truncate.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/unapply.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/unary.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/unescape.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/union.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/unionBy.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/unionWith.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/uniq.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/uniqBy.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/uniqWith.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/uniqueId.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/unnest.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/unset.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/unzip.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/unzipWith.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/update.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/updateWith.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/upperCase.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/upperFirst.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/useWith.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/util.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/value.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/valueOf.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/values.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/valuesIn.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/where.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/whereEq.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/without.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/words.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/wrap.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/wrapperAt.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/wrapperChain.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/wrapperLodash.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/wrapperReverse.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/wrapperValue.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/xor.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/xorBy.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/xorWith.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/zip.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/zipAll.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/zipObj.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/zipObject.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/zipObjectDeep.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/zipWith.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fromPairs.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/function.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/functions.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/functionsIn.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/get.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/groupBy.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/gt.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/gte.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/has.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/hasIn.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/head.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/identity.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/inRange.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/includes.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/indexOf.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/initial.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/intersection.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/intersectionBy.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/intersectionWith.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/invert.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/invertBy.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/invoke.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/invokeMap.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isArguments.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isArray.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isArrayBuffer.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isArrayLike.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isArrayLikeObject.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isBoolean.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isBuffer.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isDate.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isElement.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isEmpty.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isEqual.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isEqualWith.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isError.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isFinite.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isFunction.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isInteger.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isLength.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isMap.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isMatch.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isMatchWith.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isNaN.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isNative.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isNil.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isNull.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isNumber.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isObject.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isObjectLike.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isPlainObject.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isRegExp.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isSafeInteger.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isSet.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isString.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isSymbol.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isTypedArray.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isUndefined.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isWeakMap.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isWeakSet.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/iteratee.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/join.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/kebabCase.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/keyBy.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/keys.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/keysIn.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/lang.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/last.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/lastIndexOf.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/lodash.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/lodash.min.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/lowerCase.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/lowerFirst.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/lt.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/lte.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/map.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/mapKeys.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/mapValues.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/matches.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/matchesProperty.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/math.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/max.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/maxBy.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/mean.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/meanBy.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/memoize.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/merge.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/mergeWith.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/method.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/methodOf.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/min.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/minBy.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/mixin.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/multiply.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/negate.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/next.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/noop.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/now.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/nth.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/nthArg.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/number.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/object.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/omit.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/omitBy.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/once.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/orderBy.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/over.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/overArgs.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/overEvery.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/overSome.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/pad.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/padEnd.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/padStart.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/parseInt.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/partial.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/partialRight.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/partition.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/pick.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/pickBy.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/plant.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/property.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/propertyOf.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/pull.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/pullAll.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/pullAllBy.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/pullAllWith.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/pullAt.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/random.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/range.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/rangeRight.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/rearg.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/reduce.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/reduceRight.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/reject.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/release.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/remove.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/repeat.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/replace.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/rest.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/result.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/reverse.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/round.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/sample.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/sampleSize.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/seq.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/set.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/setWith.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/shuffle.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/size.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/slice.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/snakeCase.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/some.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/sortBy.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/sortedIndex.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/sortedIndexBy.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/sortedIndexOf.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/sortedLastIndex.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/sortedLastIndexBy.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/sortedLastIndexOf.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/sortedUniq.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/sortedUniqBy.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/split.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/spread.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/startCase.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/startsWith.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/string.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/stubArray.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/stubFalse.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/stubObject.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/stubString.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/stubTrue.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/subtract.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/sum.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/sumBy.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/tail.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/take.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/takeRight.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/takeRightWhile.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/takeWhile.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/tap.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/template.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/templateSettings.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/throttle.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/thru.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/times.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/toArray.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/toFinite.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/toInteger.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/toIterator.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/toJSON.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/toLength.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/toLower.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/toNumber.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/toPairs.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/toPairsIn.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/toPath.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/toPlainObject.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/toSafeInteger.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/toString.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/toUpper.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/transform.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/trim.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/trimEnd.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/trimStart.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/truncate.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/unary.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/unescape.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/union.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/unionBy.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/unionWith.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/uniq.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/uniqBy.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/uniqWith.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/uniqueId.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/unset.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/unzip.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/unzipWith.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/update.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/updateWith.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/upperCase.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/upperFirst.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/util.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/value.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/valueOf.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/values.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/valuesIn.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/without.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/words.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/wrap.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/wrapperAt.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/wrapperChain.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/wrapperLodash.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/wrapperReverse.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/wrapperValue.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/xor.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/xorBy.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/xorWith.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/zip.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/zipObject.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/zipObjectDeep.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/zipWith.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/long/LICENSE delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/long/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/long/dist/long.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/long/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/long/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/long/src/long.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lru-cache/LICENSE delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lru-cache/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lru-cache/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lru-cache/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lru-memoizer/.jshintrc delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lru-memoizer/LICENSE delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lru-memoizer/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lru-memoizer/lib/async.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lru-memoizer/lib/async.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lru-memoizer/lib/freeze.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lru-memoizer/lib/freeze.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lru-memoizer/lib/index.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lru-memoizer/lib/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lru-memoizer/lib/sync.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lru-memoizer/lib/sync.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lru-memoizer/lib/util.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lru-memoizer/lib/util.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lru-memoizer/node_modules/lru-cache/LICENSE delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lru-memoizer/node_modules/lru-cache/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lru-memoizer/node_modules/lru-cache/lib/lru-cache.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lru-memoizer/node_modules/lru-cache/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lru-memoizer/node_modules/yallist/LICENSE delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lru-memoizer/node_modules/yallist/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lru-memoizer/node_modules/yallist/iterator.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lru-memoizer/node_modules/yallist/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lru-memoizer/node_modules/yallist/yallist.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lru-memoizer/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lru-memoizer/test/lru-memoizer.bypass.test.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lru-memoizer/test/lru-memoizer.clone.test.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lru-memoizer/test/lru-memoizer.disable.test.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lru-memoizer/test/lru-memoizer.events.test.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lru-memoizer/test/lru-memoizer.freeze.test.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lru-memoizer/test/lru-memoizer.itemmaxage.test.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lru-memoizer/test/lru-memoizer.lock.test.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lru-memoizer/test/lru-memoizer.nokey.test.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lru-memoizer/test/lru-memoizer.queumaxage.test.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lru-memoizer/test/lru-memoizer.sync.clone.test.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lru-memoizer/test/lru-memoizer.sync.events.test.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lru-memoizer/test/lru-memoizer.sync.freeze.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lru-memoizer/test/lru-memoizer.sync.test.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lru-memoizer/test/lru-memoizer.test.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/lru-memoizer/tsconfig.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/markdown-it-anchor/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/markdown-it-anchor/UNLICENSE delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/markdown-it-anchor/dist/markdownItAnchor.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/markdown-it-anchor/dist/markdownItAnchor.mjs delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/markdown-it-anchor/dist/markdownItAnchor.mjs.map delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/markdown-it-anchor/dist/markdownItAnchor.modern.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/markdown-it-anchor/dist/markdownItAnchor.umd.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/markdown-it-anchor/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/markdown-it-anchor/runkit.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/markdown-it-anchor/types/index.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/markdown-it-anchor/types/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/markdown-it/LICENSE delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/markdown-it/README.md delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/markdown-it/bin/markdown-it.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/markdown-it/dist/markdown-it.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/markdown-it/dist/markdown-it.min.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/markdown-it/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/markdown-it/lib/common/entities.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/markdown-it/lib/common/html_blocks.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/markdown-it/lib/common/html_re.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/markdown-it/lib/common/utils.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/markdown-it/lib/helpers/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/markdown-it/lib/helpers/parse_link_destination.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/markdown-it/lib/helpers/parse_link_label.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/markdown-it/lib/helpers/parse_link_title.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/markdown-it/lib/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/markdown-it/lib/parser_block.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/markdown-it/lib/parser_core.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/markdown-it/lib/parser_inline.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/markdown-it/lib/presets/commonmark.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/markdown-it/lib/presets/default.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/markdown-it/lib/presets/zero.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/markdown-it/lib/renderer.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/markdown-it/lib/ruler.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/markdown-it/lib/rules_block/blockquote.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/markdown-it/lib/rules_block/code.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/markdown-it/lib/rules_block/fence.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/markdown-it/lib/rules_block/heading.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/markdown-it/lib/rules_block/hr.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/markdown-it/lib/rules_block/html_block.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/markdown-it/lib/rules_block/lheading.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/markdown-it/lib/rules_block/list.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/markdown-it/lib/rules_block/paragraph.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/markdown-it/lib/rules_block/reference.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/markdown-it/lib/rules_block/state_block.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/markdown-it/lib/rules_block/table.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/markdown-it/lib/rules_core/block.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/markdown-it/lib/rules_core/inline.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/markdown-it/lib/rules_core/linkify.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/markdown-it/lib/rules_core/normalize.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/markdown-it/lib/rules_core/replacements.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/markdown-it/lib/rules_core/smartquotes.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/markdown-it/lib/rules_core/state_core.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/markdown-it/lib/rules_inline/autolink.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/markdown-it/lib/rules_inline/backticks.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/markdown-it/lib/rules_inline/balance_pairs.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/markdown-it/lib/rules_inline/emphasis.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/markdown-it/lib/rules_inline/entity.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/markdown-it/lib/rules_inline/escape.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/markdown-it/lib/rules_inline/html_inline.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/markdown-it/lib/rules_inline/image.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/markdown-it/lib/rules_inline/link.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/markdown-it/lib/rules_inline/newline.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/markdown-it/lib/rules_inline/state_inline.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/markdown-it/lib/rules_inline/strikethrough.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/markdown-it/lib/rules_inline/text.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/markdown-it/lib/rules_inline/text_collapse.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/markdown-it/lib/token.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/markdown-it/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/marked/LICENSE.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/marked/README.md delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/marked/bin/marked.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/marked/lib/marked.cjs delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/marked/lib/marked.esm.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/marked/lib/marked.umd.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/marked/man/marked.1 delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/marked/man/marked.1.txt delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/marked/marked.min.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/marked/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/marked/src/Lexer.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/marked/src/Parser.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/marked/src/Renderer.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/marked/src/Slugger.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/marked/src/TextRenderer.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/marked/src/Tokenizer.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/marked/src/defaults.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/marked/src/helpers.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/marked/src/marked.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/marked/src/rules.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/mdurl/CHANGELOG.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/mdurl/LICENSE delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/mdurl/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/mdurl/decode.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/mdurl/encode.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/mdurl/format.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/mdurl/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/mdurl/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/mdurl/parse.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/mime-db/HISTORY.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/mime-db/LICENSE delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/mime-db/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/mime-db/db.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/mime-db/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/mime-db/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/mime-types/HISTORY.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/mime-types/LICENSE delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/mime-types/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/mime-types/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/mime-types/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/mime/CHANGELOG.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/mime/LICENSE delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/mime/Mime.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/mime/README.md delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/mime/cli.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/mime/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/mime/lite.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/mime/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/mime/types/other.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/mime/types/standard.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/minimatch/LICENSE delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/minimatch/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/minimatch/lib/path.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/minimatch/minimatch.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/minimatch/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/minimist/.eslintrc delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/minimist/.github/FUNDING.yml delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/minimist/.nycrc delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/minimist/CHANGELOG.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/minimist/LICENSE delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/minimist/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/minimist/example/parse.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/minimist/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/minimist/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/minimist/test/all_bool.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/minimist/test/bool.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/minimist/test/dash.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/minimist/test/default_bool.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/minimist/test/dotted.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/minimist/test/kv_short.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/minimist/test/long.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/minimist/test/num.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/minimist/test/parse.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/minimist/test/parse_modified.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/minimist/test/proto.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/minimist/test/short.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/minimist/test/stop_early.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/minimist/test/unknown.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/minimist/test/whitespace.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/mkdirp/CHANGELOG.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/mkdirp/LICENSE delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/mkdirp/bin/cmd.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/mkdirp/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/mkdirp/lib/find-made.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/mkdirp/lib/mkdirp-manual.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/mkdirp/lib/mkdirp-native.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/mkdirp/lib/opts-arg.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/mkdirp/lib/path-arg.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/mkdirp/lib/use-native.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/mkdirp/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/mkdirp/readme.markdown delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/ms/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/ms/license.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/ms/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/ms/readme.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/node-fetch/LICENSE.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/node-fetch/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/node-fetch/browser.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/node-fetch/lib/index.es.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/node-fetch/lib/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/node-fetch/lib/index.mjs delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/node-fetch/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/CHANGELOG.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/LICENSE delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/dist/forge.all.min.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/dist/forge.min.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/dist/prime.worker.min.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/flash/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/flash/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/flash/swf/SocketPool.swf delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/aes.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/aesCipherSuites.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/asn1-validator.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/asn1.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/baseN.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/cipher.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/cipherModes.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/des.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/ed25519.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/forge.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/form.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/hmac.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/http.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/index.all.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/jsbn.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/kem.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/log.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/md.all.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/md.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/md5.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/mgf.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/mgf1.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/oids.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/pbe.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/pbkdf2.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/pem.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/pkcs1.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/pkcs12.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/pkcs7.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/pkcs7asn1.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/pki.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/prime.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/prime.worker.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/prng.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/pss.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/random.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/rc2.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/rsa.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/sha1.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/sha256.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/sha512.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/socket.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/ssh.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/tls.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/tlssocket.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/util.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/x509.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/xhr.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/object-hash/LICENSE delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/object-hash/dist/object_hash.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/object-hash/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/object-hash/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/object-hash/readme.markdown delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/once/LICENSE delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/once/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/once/once.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/once/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/optionator/CHANGELOG.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/optionator/LICENSE delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/optionator/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/optionator/lib/help.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/optionator/lib/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/optionator/lib/util.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/optionator/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/p-limit/index.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/p-limit/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/p-limit/license delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/p-limit/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/p-limit/readme.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/path-is-absolute/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/path-is-absolute/license delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/path-is-absolute/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/path-is-absolute/readme.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/prelude-ls/CHANGELOG.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/prelude-ls/LICENSE delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/prelude-ls/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/prelude-ls/lib/Func.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/prelude-ls/lib/List.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/prelude-ls/lib/Num.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/prelude-ls/lib/Obj.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/prelude-ls/lib/Str.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/prelude-ls/lib/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/prelude-ls/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/proto3-json-serializer/CHANGELOG.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/proto3-json-serializer/LICENSE delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/proto3-json-serializer/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/proto3-json-serializer/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/CHANGELOG.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/LICENSE delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/README.md delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/bin/pbjs delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/bin/pbts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/index.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/lib/tsd-jsdoc.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/lib/tsd-jsdoc/LICENSE delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/lib/tsd-jsdoc/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/lib/tsd-jsdoc/plugin.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/lib/tsd-jsdoc/publish.js delete mode 120000 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/.bin/semver delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/LICENSE delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/README.md delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/bin/semver.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/classes/comparator.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/classes/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/classes/range.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/classes/semver.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/functions/clean.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/functions/cmp.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/functions/coerce.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/functions/compare-build.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/functions/compare-loose.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/functions/compare.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/functions/diff.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/functions/eq.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/functions/gt.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/functions/gte.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/functions/inc.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/functions/lt.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/functions/lte.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/functions/major.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/functions/minor.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/functions/neq.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/functions/parse.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/functions/patch.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/functions/prerelease.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/functions/rcompare.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/functions/rsort.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/functions/satisfies.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/functions/sort.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/functions/valid.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/internal/constants.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/internal/debug.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/internal/identifiers.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/internal/parse-options.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/internal/re.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/preload.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/range.bnf delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/ranges/gtr.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/ranges/intersects.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/ranges/ltr.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/ranges/max-satisfying.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/ranges/min-satisfying.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/ranges/min-version.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/ranges/outside.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/ranges/simplify.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/ranges/subset.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/ranges/to-comparators.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/ranges/valid.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/pbjs.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/pbjs.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/pbts.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/pbts.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/scripts/prepublish.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/targets/json-module.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/targets/json.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/targets/proto.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/targets/proto2.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/targets/proto3.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/targets/static-module.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/targets/static.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/util.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/wrappers/amd.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/wrappers/closure.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/wrappers/commonjs.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/wrappers/default.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/wrappers/es6.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/LICENSE delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/dist/light/protobuf.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/dist/light/protobuf.min.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/dist/minimal/protobuf.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/dist/minimal/protobuf.min.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/dist/protobuf.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/dist/protobuf.min.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/ext/debug/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/ext/debug/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/ext/descriptor/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/ext/descriptor/index.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/ext/descriptor/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/ext/descriptor/test.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/google/LICENSE delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/google/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/google/api/annotations.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/google/api/annotations.proto delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/google/api/http.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/google/api/http.proto delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/google/protobuf/api.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/google/protobuf/api.proto delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/google/protobuf/descriptor.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/google/protobuf/descriptor.proto delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/google/protobuf/source_context.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/google/protobuf/source_context.proto delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/google/protobuf/type.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/google/protobuf/type.proto delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/index.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/light.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/light.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/minimal.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/minimal.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/node_modules/long/LICENSE delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/node_modules/long/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/node_modules/long/index.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/node_modules/long/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/node_modules/long/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/node_modules/long/umd/index.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/node_modules/long/umd/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/node_modules/long/umd/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/scripts/postinstall.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/src/common.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/src/converter.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/src/decoder.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/src/encoder.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/src/enum.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/src/field.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/src/index-light.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/src/index-minimal.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/src/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/src/mapfield.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/src/message.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/src/method.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/src/namespace.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/src/object.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/src/oneof.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/src/parse.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/src/reader.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/src/reader_buffer.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/src/root.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/src/roots.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/src/rpc.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/src/rpc/service.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/src/service.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/src/tokenize.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/src/type.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/src/types.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/src/typescript.jsdoc delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/src/util.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/src/util/longbits.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/src/util/minimal.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/src/verifier.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/src/wrappers.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/src/writer.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/src/writer_buffer.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/tsconfig.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/pseudomap/LICENSE delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/pseudomap/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/pseudomap/map.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/pseudomap/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/pseudomap/pseudomap.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/pseudomap/test/basic.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/readable-stream/CONTRIBUTING.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/readable-stream/GOVERNANCE.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/readable-stream/LICENSE delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/readable-stream/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/readable-stream/errors-browser.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/readable-stream/errors.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/readable-stream/experimentalWarning.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/readable-stream/lib/_stream_duplex.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/readable-stream/lib/_stream_passthrough.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/readable-stream/lib/_stream_readable.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/readable-stream/lib/_stream_transform.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/readable-stream/lib/_stream_writable.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/readable-stream/lib/internal/streams/async_iterator.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/readable-stream/lib/internal/streams/buffer_list.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/readable-stream/lib/internal/streams/destroy.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/readable-stream/lib/internal/streams/end-of-stream.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/readable-stream/lib/internal/streams/from-browser.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/readable-stream/lib/internal/streams/from.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/readable-stream/lib/internal/streams/pipeline.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/readable-stream/lib/internal/streams/state.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/readable-stream/lib/internal/streams/stream-browser.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/readable-stream/lib/internal/streams/stream.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/readable-stream/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/readable-stream/readable-browser.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/readable-stream/readable.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/require-directory/.jshintrc delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/require-directory/.npmignore delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/require-directory/.travis.yml delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/require-directory/LICENSE delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/require-directory/README.markdown delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/require-directory/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/require-directory/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/requizzle/.editorconfig delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/requizzle/.travis.yml delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/requizzle/LICENSE delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/requizzle/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/requizzle/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/requizzle/lib/loader.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/requizzle/lib/requizzle.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/requizzle/lib/wrappers/extras.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/requizzle/lib/wrappers/requirepaths.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/requizzle/lib/wrappers/strict.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/requizzle/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/retry-request/CHANGELOG.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/retry-request/index.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/retry-request/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/retry-request/license delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/retry-request/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/retry-request/readme.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/retry/License delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/retry/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/retry/example/dns.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/retry/example/stop.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/retry/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/retry/lib/retry.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/retry/lib/retry_operation.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/retry/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/rimraf/CHANGELOG.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/rimraf/LICENSE delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/rimraf/README.md delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/rimraf/bin.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/rimraf/node_modules/brace-expansion/LICENSE delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/rimraf/node_modules/brace-expansion/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/rimraf/node_modules/brace-expansion/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/rimraf/node_modules/brace-expansion/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/rimraf/node_modules/glob/LICENSE delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/rimraf/node_modules/glob/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/rimraf/node_modules/glob/common.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/rimraf/node_modules/glob/glob.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/rimraf/node_modules/glob/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/rimraf/node_modules/glob/sync.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/rimraf/node_modules/minimatch/LICENSE delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/rimraf/node_modules/minimatch/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/rimraf/node_modules/minimatch/minimatch.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/rimraf/node_modules/minimatch/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/rimraf/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/rimraf/rimraf.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/safe-buffer/LICENSE delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/safe-buffer/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/safe-buffer/index.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/safe-buffer/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/safe-buffer/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/semver/CHANGELOG.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/semver/LICENSE delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/semver/README.md delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/semver/bin/semver delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/semver/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/semver/range.bnf delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/semver/semver.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/source-map/CHANGELOG.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/source-map/LICENSE delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/source-map/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/source-map/dist/source-map.debug.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/source-map/dist/source-map.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/source-map/dist/source-map.min.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/source-map/lib/array-set.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/source-map/lib/base64-vlq.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/source-map/lib/base64.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/source-map/lib/binary-search.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/source-map/lib/mapping-list.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/source-map/lib/quick-sort.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/source-map/lib/source-map-consumer.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/source-map/lib/source-map-generator.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/source-map/lib/source-node.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/source-map/lib/util.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/source-map/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/source-map/source-map.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/source-map/source-map.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/stream-events/index.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/stream-events/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/stream-events/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/stream-events/readme.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/stream-shift/.travis.yml delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/stream-shift/LICENSE delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/stream-shift/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/stream-shift/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/stream-shift/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/stream-shift/test.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/string-width/index.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/string-width/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/string-width/license delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/string-width/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/string-width/readme.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/string_decoder/LICENSE delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/string_decoder/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/string_decoder/lib/string_decoder.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/string_decoder/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/strip-ansi/index.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/strip-ansi/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/strip-ansi/license delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/strip-ansi/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/strip-ansi/readme.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/strip-json-comments/index.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/strip-json-comments/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/strip-json-comments/license delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/strip-json-comments/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/strip-json-comments/readme.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/stubs/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/stubs/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/stubs/readme.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/stubs/test.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/supports-color/browser.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/supports-color/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/supports-color/license delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/supports-color/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/supports-color/readme.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/taffydb/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/taffydb/taffy-test.html delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/taffydb/taffy.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/teeny-request/CHANGELOG.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/teeny-request/LICENSE delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/teeny-request/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/teeny-request/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/text-decoding/CHANGELOG.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/text-decoding/LICENSE delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/text-decoding/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/text-decoding/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/text-decoding/src/encoding-indexes.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/text-decoding/src/encodings.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/text-decoding/src/implementations/big5.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/text-decoding/src/implementations/euc-jp.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/text-decoding/src/implementations/euc-kr.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/text-decoding/src/implementations/gb18030.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/text-decoding/src/implementations/iso-2022-jp.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/text-decoding/src/implementations/shift-jis.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/text-decoding/src/implementations/single-byte.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/text-decoding/src/implementations/utf16.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/text-decoding/src/implementations/utf8.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/text-decoding/src/implementations/x-user-defined.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/text-decoding/src/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/text-decoding/src/indexes.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/text-decoding/src/lib/TextDecoder.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/text-decoding/src/lib/TextEncoder.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/text-decoding/src/lib/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/text-decoding/src/table.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/text-decoding/src/utils.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/text-decoding/types/externs.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/tmp/CHANGELOG.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/tmp/LICENSE delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/tmp/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/tmp/lib/tmp.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/tmp/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/tr46/.npmignore delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/tr46/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/tr46/lib/.gitkeep delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/tr46/lib/mappingTable.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/tr46/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/tslib/CopyrightNotice.txt delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/tslib/LICENSE.txt delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/tslib/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/tslib/SECURITY.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/tslib/modules/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/tslib/modules/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/tslib/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/tslib/tslib.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/tslib/tslib.es6.html delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/tslib/tslib.es6.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/tslib/tslib.html delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/tslib/tslib.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/type-check/LICENSE delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/type-check/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/type-check/lib/check.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/type-check/lib/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/type-check/lib/parse-type.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/type-check/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/uc.micro/CHANGELOG.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/uc.micro/LICENSE.txt delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/uc.micro/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/uc.micro/categories/Cc/regex.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/uc.micro/categories/Cf/regex.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/uc.micro/categories/P/regex.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/uc.micro/categories/Z/regex.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/uc.micro/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/uc.micro/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/uc.micro/properties/Any/regex.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/uglify-js/LICENSE delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/uglify-js/README.md delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/uglify-js/bin/uglifyjs delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/uglify-js/lib/ast.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/uglify-js/lib/compress.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/uglify-js/lib/minify.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/uglify-js/lib/mozilla-ast.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/uglify-js/lib/output.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/uglify-js/lib/parse.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/uglify-js/lib/propmangle.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/uglify-js/lib/scope.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/uglify-js/lib/sourcemap.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/uglify-js/lib/transform.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/uglify-js/lib/utils.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/uglify-js/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/uglify-js/tools/domprops.html delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/uglify-js/tools/domprops.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/uglify-js/tools/exports.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/uglify-js/tools/node.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/uglify-js/tools/tty.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/LICENSE delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/_baseCreate.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/_baseIteratee.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/_cb.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/_chainResult.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/_collectNonEnumProps.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/_createAssigner.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/_createEscaper.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/_createIndexFinder.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/_createPredicateIndexFinder.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/_createReduce.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/_createSizePropertyCheck.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/_deepGet.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/_escapeMap.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/_executeBound.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/_flatten.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/_getByteLength.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/_getLength.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/_group.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/_has.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/_hasObjectTag.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/_isArrayLike.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/_isBufferLike.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/_keyInObj.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/_methodFingerprint.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/_optimizeCb.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/_set.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/_setup.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/_shallowProperty.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/_stringTagBug.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/_tagTester.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/_toBufferView.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/_toPath.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/_unescapeMap.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/after.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/allKeys.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/before.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/bind.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/bindAll.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/chain.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/chunk.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/clone.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/compact.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/compose.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/constant.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/contains.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/countBy.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/create.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/debounce.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/defaults.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/defer.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/delay.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/difference.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/each.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/escape.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/every.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/extend.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/extendOwn.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/filter.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/find.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/findIndex.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/findKey.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/findLastIndex.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/findWhere.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/first.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/flatten.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/functions.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/get.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/groupBy.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/has.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/identity.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/index-default.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/indexBy.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/indexOf.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/initial.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/intersection.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/invert.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/invoke.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/isArguments.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/isArray.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/isArrayBuffer.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/isBoolean.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/isDataView.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/isDate.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/isElement.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/isEmpty.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/isEqual.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/isError.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/isFinite.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/isFunction.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/isMap.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/isMatch.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/isNaN.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/isNull.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/isNumber.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/isObject.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/isRegExp.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/isSet.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/isString.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/isSymbol.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/isTypedArray.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/isUndefined.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/isWeakMap.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/isWeakSet.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/iteratee.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/keys.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/last.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/lastIndexOf.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/map.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/mapObject.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/matcher.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/max.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/memoize.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/min.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/mixin.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/negate.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/noop.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/now.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/object.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/omit.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/once.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/pairs.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/partial.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/partition.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/pick.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/pluck.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/property.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/propertyOf.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/random.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/range.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/reduce.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/reduceRight.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/reject.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/rest.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/restArguments.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/result.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/sample.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/set.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/shuffle.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/size.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/some.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/sortBy.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/sortedIndex.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/tap.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/template.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/templateSettings.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/throttle.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/times.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/toArray.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/toPath.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/underscore-array-methods.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/underscore.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/unescape.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/union.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/uniq.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/uniqueId.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/unzip.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/values.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/where.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/without.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/wrap.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/zip.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/_baseCreate.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/_baseIteratee.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/_cb.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/_chainResult.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/_collectNonEnumProps.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/_createAssigner.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/_createEscaper.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/_createIndexFinder.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/_createPredicateIndexFinder.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/_createReduce.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/_createSizePropertyCheck.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/_deepGet.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/_escapeMap.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/_executeBound.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/_flatten.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/_getByteLength.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/_getLength.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/_group.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/_has.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/_hasObjectTag.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/_isArrayLike.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/_isBufferLike.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/_keyInObj.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/_methodFingerprint.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/_optimizeCb.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/_set.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/_setup.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/_shallowProperty.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/_stringTagBug.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/_tagTester.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/_toBufferView.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/_toPath.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/_unescapeMap.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/after.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/allKeys.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/before.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/bind.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/bindAll.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/chain.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/chunk.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/clone.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/compact.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/compose.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/constant.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/contains.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/countBy.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/create.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/debounce.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/defaults.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/defer.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/delay.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/difference.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/each.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/escape.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/every.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/extend.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/extendOwn.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/filter.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/find.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/findIndex.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/findKey.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/findLastIndex.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/findWhere.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/first.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/flatten.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/functions.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/get.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/groupBy.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/has.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/identity.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/index-default.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/indexBy.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/indexOf.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/initial.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/intersection.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/invert.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/invoke.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/isArguments.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/isArray.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/isArrayBuffer.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/isBoolean.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/isDataView.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/isDate.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/isElement.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/isEmpty.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/isEqual.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/isError.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/isFinite.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/isFunction.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/isMap.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/isMatch.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/isNaN.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/isNull.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/isNumber.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/isObject.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/isRegExp.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/isSet.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/isString.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/isSymbol.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/isTypedArray.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/isUndefined.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/isWeakMap.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/isWeakSet.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/iteratee.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/keys.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/last.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/lastIndexOf.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/map.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/mapObject.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/matcher.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/max.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/memoize.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/min.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/mixin.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/negate.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/noop.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/now.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/object.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/omit.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/once.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/pairs.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/partial.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/partition.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/pick.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/pluck.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/property.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/propertyOf.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/random.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/range.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/reduce.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/reduceRight.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/reject.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/rest.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/restArguments.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/result.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/sample.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/set.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/shuffle.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/size.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/some.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/sortBy.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/sortedIndex.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/tap.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/template.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/templateSettings.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/throttle.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/times.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/toArray.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/toPath.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/underscore-array-methods.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/underscore.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/unescape.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/union.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/uniq.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/uniqueId.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/unzip.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/values.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/where.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/without.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/wrap.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/zip.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/.eslintrc delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/_baseCreate.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/_baseIteratee.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/_cb.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/_chainResult.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/_collectNonEnumProps.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/_createAssigner.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/_createEscaper.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/_createIndexFinder.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/_createPredicateIndexFinder.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/_createReduce.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/_createSizePropertyCheck.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/_deepGet.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/_escapeMap.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/_executeBound.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/_flatten.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/_getByteLength.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/_getLength.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/_group.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/_has.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/_hasObjectTag.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/_isArrayLike.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/_isBufferLike.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/_keyInObj.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/_methodFingerprint.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/_optimizeCb.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/_setup.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/_shallowProperty.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/_stringTagBug.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/_tagTester.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/_toBufferView.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/_toPath.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/_unescapeMap.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/after.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/allKeys.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/before.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/bind.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/bindAll.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/chain.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/chunk.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/clone.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/compact.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/compose.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/constant.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/contains.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/countBy.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/create.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/debounce.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/defaults.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/defer.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/delay.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/difference.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/each.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/escape.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/every.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/extend.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/extendOwn.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/filter.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/find.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/findIndex.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/findKey.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/findLastIndex.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/findWhere.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/first.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/flatten.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/functions.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/get.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/groupBy.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/has.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/identity.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/index-all.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/index-default.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/indexBy.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/indexOf.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/initial.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/intersection.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/invert.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/invoke.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/isArguments.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/isArray.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/isArrayBuffer.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/isBoolean.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/isDataView.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/isDate.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/isElement.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/isEmpty.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/isEqual.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/isError.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/isFinite.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/isFunction.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/isMap.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/isMatch.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/isNaN.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/isNull.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/isNumber.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/isObject.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/isRegExp.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/isSet.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/isString.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/isSymbol.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/isTypedArray.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/isUndefined.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/isWeakMap.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/isWeakSet.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/iteratee.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/keys.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/last.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/lastIndexOf.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/map.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/mapObject.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/matcher.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/max.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/memoize.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/min.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/mixin.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/negate.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/noop.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/now.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/object.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/omit.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/once.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/pairs.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/partial.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/partition.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/pick.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/pluck.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/property.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/propertyOf.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/random.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/range.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/reduce.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/reduceRight.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/reject.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/rest.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/restArguments.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/result.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/sample.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/shuffle.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/size.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/some.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/sortBy.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/sortedIndex.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/tap.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/template.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/templateSettings.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/throttle.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/times.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/toArray.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/toPath.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/underscore-array-methods.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/underscore.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/unescape.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/union.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/uniq.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/uniqueId.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/unzip.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/values.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/where.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/without.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/wrap.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/zip.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/underscore-esm-min.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/underscore-esm.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/underscore-min.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/underscore-node-f.cjs delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/underscore-node-f.cjs.map delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/underscore-node.cjs delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/underscore-node.cjs.map delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/underscore-node.mjs delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/underscore-node.mjs.map delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/underscore-umd-min.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/underscore-umd.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/underscore.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/util-deprecate/History.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/util-deprecate/LICENSE delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/util-deprecate/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/util-deprecate/browser.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/util-deprecate/node.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/util-deprecate/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/CHANGELOG.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/CONTRIBUTING.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/LICENSE.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/README.md delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/bin/uuid delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/commonjs-browser/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/commonjs-browser/md5.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/commonjs-browser/native.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/commonjs-browser/nil.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/commonjs-browser/parse.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/commonjs-browser/regex.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/commonjs-browser/rng.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/commonjs-browser/sha1.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/commonjs-browser/stringify.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/commonjs-browser/v1.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/commonjs-browser/v3.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/commonjs-browser/v35.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/commonjs-browser/v4.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/commonjs-browser/v5.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/commonjs-browser/validate.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/commonjs-browser/version.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/esm-browser/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/esm-browser/md5.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/esm-browser/native.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/esm-browser/nil.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/esm-browser/parse.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/esm-browser/regex.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/esm-browser/rng.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/esm-browser/sha1.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/esm-browser/stringify.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/esm-browser/v1.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/esm-browser/v3.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/esm-browser/v35.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/esm-browser/v4.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/esm-browser/v5.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/esm-browser/validate.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/esm-browser/version.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/esm-node/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/esm-node/md5.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/esm-node/native.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/esm-node/nil.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/esm-node/parse.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/esm-node/regex.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/esm-node/rng.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/esm-node/sha1.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/esm-node/stringify.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/esm-node/v1.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/esm-node/v3.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/esm-node/v35.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/esm-node/v4.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/esm-node/v5.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/esm-node/validate.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/esm-node/version.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/md5-browser.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/md5.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/native-browser.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/native.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/nil.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/parse.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/regex.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/rng-browser.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/rng.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/sha1-browser.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/sha1.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/stringify.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/uuid-bin.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/v1.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/v3.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/v35.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/v4.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/v5.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/validate.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/version.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/wrapper.mjs delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/webidl-conversions/LICENSE.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/webidl-conversions/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/webidl-conversions/lib/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/webidl-conversions/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/websocket-driver/CHANGELOG.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/websocket-driver/LICENSE.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/websocket-driver/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/websocket-driver/lib/websocket/driver.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/websocket-driver/lib/websocket/driver/base.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/websocket-driver/lib/websocket/driver/client.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/websocket-driver/lib/websocket/driver/draft75.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/websocket-driver/lib/websocket/driver/draft76.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/websocket-driver/lib/websocket/driver/headers.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/websocket-driver/lib/websocket/driver/hybi.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/websocket-driver/lib/websocket/driver/hybi/frame.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/websocket-driver/lib/websocket/driver/hybi/message.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/websocket-driver/lib/websocket/driver/proxy.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/websocket-driver/lib/websocket/driver/server.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/websocket-driver/lib/websocket/driver/stream_reader.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/websocket-driver/lib/websocket/http_parser.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/websocket-driver/lib/websocket/streams.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/websocket-driver/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/websocket-extensions/CHANGELOG.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/websocket-extensions/LICENSE.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/websocket-extensions/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/websocket-extensions/lib/parser.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/websocket-extensions/lib/pipeline/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/websocket-extensions/lib/pipeline/cell.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/websocket-extensions/lib/pipeline/functor.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/websocket-extensions/lib/pipeline/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/websocket-extensions/lib/pipeline/pledge.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/websocket-extensions/lib/pipeline/ring_buffer.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/websocket-extensions/lib/websocket_extensions.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/websocket-extensions/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/whatwg-url/LICENSE.txt delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/whatwg-url/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/whatwg-url/lib/URL-impl.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/whatwg-url/lib/URL.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/whatwg-url/lib/public-api.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/whatwg-url/lib/url-state-machine.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/whatwg-url/lib/utils.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/whatwg-url/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/word-wrap/LICENSE delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/word-wrap/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/word-wrap/index.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/word-wrap/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/word-wrap/package.json delete mode 100755 packages/wyatt_notification_bloc/example/scripts/node_modules/wrap-ansi/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/wrap-ansi/license delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/wrap-ansi/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/wrap-ansi/readme.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/wrappy/LICENSE delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/wrappy/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/wrappy/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/wrappy/wrappy.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/CHANGES.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/LICENSE delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/NOTICE delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/error.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/error.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/escape.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/escape.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/main.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/main.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/nodes/XmlAttribute.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/nodes/XmlAttribute.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/nodes/XmlAttributeText.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/nodes/XmlAttributeText.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/nodes/XmlCdata.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/nodes/XmlCdata.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/nodes/XmlCharData.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/nodes/XmlCharData.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/nodes/XmlCharRef.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/nodes/XmlCharRef.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/nodes/XmlComment.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/nodes/XmlComment.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/nodes/XmlDecl.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/nodes/XmlDecl.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/nodes/XmlDocument.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/nodes/XmlDocument.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/nodes/XmlDtd.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/nodes/XmlDtd.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/nodes/XmlDtdAttlist.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/nodes/XmlDtdAttlist.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/nodes/XmlDtdElement.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/nodes/XmlDtdElement.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/nodes/XmlDtdEntity.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/nodes/XmlDtdEntity.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/nodes/XmlDtdNotation.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/nodes/XmlDtdNotation.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/nodes/XmlDtdParamEntityRef.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/nodes/XmlDtdParamEntityRef.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/nodes/XmlElement.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/nodes/XmlElement.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/nodes/XmlEntityRef.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/nodes/XmlEntityRef.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/nodes/XmlProcInst.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/nodes/XmlProcInst.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/options.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/options.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/validate.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/validate.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/y18n/CHANGELOG.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/y18n/LICENSE delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/y18n/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/y18n/index.mjs delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/y18n/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/yallist/LICENSE delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/yallist/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/yallist/iterator.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/yallist/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/yallist/yallist.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/yargs-parser/CHANGELOG.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/yargs-parser/LICENSE.txt delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/yargs-parser/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/yargs-parser/browser.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/yargs-parser/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/CHANGELOG.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/LICENSE delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/README.md delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/browser.mjs delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/helpers/helpers.mjs delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/helpers/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/helpers/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/index.cjs delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/index.mjs delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/lib/platform-shims/browser.mjs delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/lib/platform-shims/esm.mjs delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/locales/be.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/locales/de.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/locales/en.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/locales/es.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/locales/fi.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/locales/fr.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/locales/hi.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/locales/hu.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/locales/id.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/locales/it.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/locales/ja.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/locales/ko.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/locales/nb.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/locales/nl.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/locales/nn.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/locales/pirate.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/locales/pl.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/locales/pt.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/locales/pt_BR.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/locales/ru.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/locales/th.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/locales/tr.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/locales/zh_CN.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/locales/zh_TW.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/yargs delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/yocto-queue/index.d.ts delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/yocto-queue/index.js delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/yocto-queue/license delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/yocto-queue/package.json delete mode 100644 packages/wyatt_notification_bloc/example/scripts/node_modules/yocto-queue/readme.md diff --git a/packages/wyatt_notification_bloc/.gitignore b/packages/wyatt_cloud_messaging_bloc_base/.gitignore similarity index 100% rename from packages/wyatt_notification_bloc/.gitignore rename to packages/wyatt_cloud_messaging_bloc_base/.gitignore diff --git a/packages/wyatt_notification_bloc/.pubignore b/packages/wyatt_cloud_messaging_bloc_base/.pubignore similarity index 100% rename from packages/wyatt_notification_bloc/.pubignore rename to packages/wyatt_cloud_messaging_bloc_base/.pubignore diff --git a/packages/wyatt_notification_bloc/AUTHORS b/packages/wyatt_cloud_messaging_bloc_base/AUTHORS similarity index 100% rename from packages/wyatt_notification_bloc/AUTHORS rename to packages/wyatt_cloud_messaging_bloc_base/AUTHORS diff --git a/packages/wyatt_notification_bloc/CHANGELOG.md b/packages/wyatt_cloud_messaging_bloc_base/CHANGELOG.md similarity index 100% rename from packages/wyatt_notification_bloc/CHANGELOG.md rename to packages/wyatt_cloud_messaging_bloc_base/CHANGELOG.md diff --git a/packages/wyatt_notification_bloc/LICENSE b/packages/wyatt_cloud_messaging_bloc_base/LICENSE similarity index 100% rename from packages/wyatt_notification_bloc/LICENSE rename to packages/wyatt_cloud_messaging_bloc_base/LICENSE diff --git a/packages/wyatt_notification_bloc/README.md b/packages/wyatt_cloud_messaging_bloc_base/README.md similarity index 100% rename from packages/wyatt_notification_bloc/README.md rename to packages/wyatt_cloud_messaging_bloc_base/README.md diff --git a/packages/wyatt_notification_bloc/analysis_options.yaml b/packages/wyatt_cloud_messaging_bloc_base/analysis_options.yaml similarity index 100% rename from packages/wyatt_notification_bloc/analysis_options.yaml rename to packages/wyatt_cloud_messaging_bloc_base/analysis_options.yaml diff --git a/packages/wyatt_notification_bloc/example/.gitignore b/packages/wyatt_cloud_messaging_bloc_base/example/.gitignore similarity index 100% rename from packages/wyatt_notification_bloc/example/.gitignore rename to packages/wyatt_cloud_messaging_bloc_base/example/.gitignore diff --git a/packages/wyatt_notification_bloc/example/.metadata b/packages/wyatt_cloud_messaging_bloc_base/example/.metadata similarity index 100% rename from packages/wyatt_notification_bloc/example/.metadata rename to packages/wyatt_cloud_messaging_bloc_base/example/.metadata diff --git a/packages/wyatt_notification_bloc/example/README.md b/packages/wyatt_cloud_messaging_bloc_base/example/README.md similarity index 100% rename from packages/wyatt_notification_bloc/example/README.md rename to packages/wyatt_cloud_messaging_bloc_base/example/README.md diff --git a/packages/wyatt_notification_bloc/example/analysis_options.yaml b/packages/wyatt_cloud_messaging_bloc_base/example/analysis_options.yaml similarity index 100% rename from packages/wyatt_notification_bloc/example/analysis_options.yaml rename to packages/wyatt_cloud_messaging_bloc_base/example/analysis_options.yaml diff --git a/packages/wyatt_notification_bloc/example/android/.gitignore b/packages/wyatt_cloud_messaging_bloc_base/example/android/.gitignore similarity index 100% rename from packages/wyatt_notification_bloc/example/android/.gitignore rename to packages/wyatt_cloud_messaging_bloc_base/example/android/.gitignore diff --git a/packages/wyatt_notification_bloc/example/android/app/build.gradle b/packages/wyatt_cloud_messaging_bloc_base/example/android/app/build.gradle similarity index 100% rename from packages/wyatt_notification_bloc/example/android/app/build.gradle rename to packages/wyatt_cloud_messaging_bloc_base/example/android/app/build.gradle diff --git a/packages/wyatt_notification_bloc/example/android/app/src/debug/AndroidManifest.xml b/packages/wyatt_cloud_messaging_bloc_base/example/android/app/src/debug/AndroidManifest.xml similarity index 100% rename from packages/wyatt_notification_bloc/example/android/app/src/debug/AndroidManifest.xml rename to packages/wyatt_cloud_messaging_bloc_base/example/android/app/src/debug/AndroidManifest.xml diff --git a/packages/wyatt_notification_bloc/example/android/app/src/main/AndroidManifest.xml b/packages/wyatt_cloud_messaging_bloc_base/example/android/app/src/main/AndroidManifest.xml similarity index 100% rename from packages/wyatt_notification_bloc/example/android/app/src/main/AndroidManifest.xml rename to packages/wyatt_cloud_messaging_bloc_base/example/android/app/src/main/AndroidManifest.xml diff --git a/packages/wyatt_notification_bloc/example/android/app/src/main/kotlin/com/example/notification_bloc_example/MainActivity.kt b/packages/wyatt_cloud_messaging_bloc_base/example/android/app/src/main/kotlin/com/example/notification_bloc_example/MainActivity.kt similarity index 100% rename from packages/wyatt_notification_bloc/example/android/app/src/main/kotlin/com/example/notification_bloc_example/MainActivity.kt rename to packages/wyatt_cloud_messaging_bloc_base/example/android/app/src/main/kotlin/com/example/notification_bloc_example/MainActivity.kt diff --git a/packages/wyatt_notification_bloc/example/android/app/src/main/res/drawable-v21/launch_background.xml b/packages/wyatt_cloud_messaging_bloc_base/example/android/app/src/main/res/drawable-v21/launch_background.xml similarity index 100% rename from packages/wyatt_notification_bloc/example/android/app/src/main/res/drawable-v21/launch_background.xml rename to packages/wyatt_cloud_messaging_bloc_base/example/android/app/src/main/res/drawable-v21/launch_background.xml diff --git a/packages/wyatt_notification_bloc/example/android/app/src/main/res/drawable/launch_background.xml b/packages/wyatt_cloud_messaging_bloc_base/example/android/app/src/main/res/drawable/launch_background.xml similarity index 100% rename from packages/wyatt_notification_bloc/example/android/app/src/main/res/drawable/launch_background.xml rename to packages/wyatt_cloud_messaging_bloc_base/example/android/app/src/main/res/drawable/launch_background.xml diff --git a/packages/wyatt_notification_bloc/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/packages/wyatt_cloud_messaging_bloc_base/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png similarity index 100% rename from packages/wyatt_notification_bloc/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png rename to packages/wyatt_cloud_messaging_bloc_base/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png diff --git a/packages/wyatt_notification_bloc/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/packages/wyatt_cloud_messaging_bloc_base/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png similarity index 100% rename from packages/wyatt_notification_bloc/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png rename to packages/wyatt_cloud_messaging_bloc_base/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png diff --git a/packages/wyatt_notification_bloc/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/packages/wyatt_cloud_messaging_bloc_base/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png similarity index 100% rename from packages/wyatt_notification_bloc/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png rename to packages/wyatt_cloud_messaging_bloc_base/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png diff --git a/packages/wyatt_notification_bloc/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/packages/wyatt_cloud_messaging_bloc_base/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png similarity index 100% rename from packages/wyatt_notification_bloc/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png rename to packages/wyatt_cloud_messaging_bloc_base/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png diff --git a/packages/wyatt_notification_bloc/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/packages/wyatt_cloud_messaging_bloc_base/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png similarity index 100% rename from packages/wyatt_notification_bloc/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png rename to packages/wyatt_cloud_messaging_bloc_base/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png diff --git a/packages/wyatt_notification_bloc/example/android/app/src/main/res/values-night/styles.xml b/packages/wyatt_cloud_messaging_bloc_base/example/android/app/src/main/res/values-night/styles.xml similarity index 100% rename from packages/wyatt_notification_bloc/example/android/app/src/main/res/values-night/styles.xml rename to packages/wyatt_cloud_messaging_bloc_base/example/android/app/src/main/res/values-night/styles.xml diff --git a/packages/wyatt_notification_bloc/example/android/app/src/main/res/values/styles.xml b/packages/wyatt_cloud_messaging_bloc_base/example/android/app/src/main/res/values/styles.xml similarity index 100% rename from packages/wyatt_notification_bloc/example/android/app/src/main/res/values/styles.xml rename to packages/wyatt_cloud_messaging_bloc_base/example/android/app/src/main/res/values/styles.xml diff --git a/packages/wyatt_notification_bloc/example/android/app/src/profile/AndroidManifest.xml b/packages/wyatt_cloud_messaging_bloc_base/example/android/app/src/profile/AndroidManifest.xml similarity index 100% rename from packages/wyatt_notification_bloc/example/android/app/src/profile/AndroidManifest.xml rename to packages/wyatt_cloud_messaging_bloc_base/example/android/app/src/profile/AndroidManifest.xml diff --git a/packages/wyatt_notification_bloc/example/android/build.gradle b/packages/wyatt_cloud_messaging_bloc_base/example/android/build.gradle similarity index 100% rename from packages/wyatt_notification_bloc/example/android/build.gradle rename to packages/wyatt_cloud_messaging_bloc_base/example/android/build.gradle diff --git a/packages/wyatt_notification_bloc/example/android/gradle.properties b/packages/wyatt_cloud_messaging_bloc_base/example/android/gradle.properties similarity index 100% rename from packages/wyatt_notification_bloc/example/android/gradle.properties rename to packages/wyatt_cloud_messaging_bloc_base/example/android/gradle.properties diff --git a/packages/wyatt_notification_bloc/example/android/gradle/wrapper/gradle-wrapper.properties b/packages/wyatt_cloud_messaging_bloc_base/example/android/gradle/wrapper/gradle-wrapper.properties similarity index 100% rename from packages/wyatt_notification_bloc/example/android/gradle/wrapper/gradle-wrapper.properties rename to packages/wyatt_cloud_messaging_bloc_base/example/android/gradle/wrapper/gradle-wrapper.properties diff --git a/packages/wyatt_notification_bloc/example/android/settings.gradle b/packages/wyatt_cloud_messaging_bloc_base/example/android/settings.gradle similarity index 100% rename from packages/wyatt_notification_bloc/example/android/settings.gradle rename to packages/wyatt_cloud_messaging_bloc_base/example/android/settings.gradle diff --git a/packages/wyatt_notification_bloc/example/ios/.gitignore b/packages/wyatt_cloud_messaging_bloc_base/example/ios/.gitignore similarity index 100% rename from packages/wyatt_notification_bloc/example/ios/.gitignore rename to packages/wyatt_cloud_messaging_bloc_base/example/ios/.gitignore diff --git a/packages/wyatt_notification_bloc/example/ios/Flutter/AppFrameworkInfo.plist b/packages/wyatt_cloud_messaging_bloc_base/example/ios/Flutter/AppFrameworkInfo.plist similarity index 100% rename from packages/wyatt_notification_bloc/example/ios/Flutter/AppFrameworkInfo.plist rename to packages/wyatt_cloud_messaging_bloc_base/example/ios/Flutter/AppFrameworkInfo.plist diff --git a/packages/wyatt_notification_bloc/example/ios/Flutter/Debug.xcconfig b/packages/wyatt_cloud_messaging_bloc_base/example/ios/Flutter/Debug.xcconfig similarity index 100% rename from packages/wyatt_notification_bloc/example/ios/Flutter/Debug.xcconfig rename to packages/wyatt_cloud_messaging_bloc_base/example/ios/Flutter/Debug.xcconfig diff --git a/packages/wyatt_notification_bloc/example/ios/Flutter/Release.xcconfig b/packages/wyatt_cloud_messaging_bloc_base/example/ios/Flutter/Release.xcconfig similarity index 100% rename from packages/wyatt_notification_bloc/example/ios/Flutter/Release.xcconfig rename to packages/wyatt_cloud_messaging_bloc_base/example/ios/Flutter/Release.xcconfig diff --git a/packages/wyatt_notification_bloc/example/ios/Podfile b/packages/wyatt_cloud_messaging_bloc_base/example/ios/Podfile similarity index 100% rename from packages/wyatt_notification_bloc/example/ios/Podfile rename to packages/wyatt_cloud_messaging_bloc_base/example/ios/Podfile diff --git a/packages/wyatt_notification_bloc/example/ios/Podfile.lock b/packages/wyatt_cloud_messaging_bloc_base/example/ios/Podfile.lock similarity index 100% rename from packages/wyatt_notification_bloc/example/ios/Podfile.lock rename to packages/wyatt_cloud_messaging_bloc_base/example/ios/Podfile.lock diff --git a/packages/wyatt_notification_bloc/example/ios/Runner.xcodeproj/project.pbxproj b/packages/wyatt_cloud_messaging_bloc_base/example/ios/Runner.xcodeproj/project.pbxproj similarity index 100% rename from packages/wyatt_notification_bloc/example/ios/Runner.xcodeproj/project.pbxproj rename to packages/wyatt_cloud_messaging_bloc_base/example/ios/Runner.xcodeproj/project.pbxproj diff --git a/packages/wyatt_notification_bloc/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/packages/wyatt_cloud_messaging_bloc_base/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata similarity index 100% rename from packages/wyatt_notification_bloc/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata rename to packages/wyatt_cloud_messaging_bloc_base/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata diff --git a/packages/wyatt_notification_bloc/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/packages/wyatt_cloud_messaging_bloc_base/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist similarity index 100% rename from packages/wyatt_notification_bloc/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist rename to packages/wyatt_cloud_messaging_bloc_base/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist diff --git a/packages/wyatt_notification_bloc/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/packages/wyatt_cloud_messaging_bloc_base/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme similarity index 100% rename from packages/wyatt_notification_bloc/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme rename to packages/wyatt_cloud_messaging_bloc_base/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme diff --git a/packages/wyatt_notification_bloc/example/ios/Runner.xcworkspace/contents.xcworkspacedata b/packages/wyatt_cloud_messaging_bloc_base/example/ios/Runner.xcworkspace/contents.xcworkspacedata similarity index 100% rename from packages/wyatt_notification_bloc/example/ios/Runner.xcworkspace/contents.xcworkspacedata rename to packages/wyatt_cloud_messaging_bloc_base/example/ios/Runner.xcworkspace/contents.xcworkspacedata diff --git a/packages/wyatt_notification_bloc/example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/packages/wyatt_cloud_messaging_bloc_base/example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist similarity index 100% rename from packages/wyatt_notification_bloc/example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist rename to packages/wyatt_cloud_messaging_bloc_base/example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist diff --git a/packages/wyatt_notification_bloc/example/ios/Runner/AppDelegate.swift b/packages/wyatt_cloud_messaging_bloc_base/example/ios/Runner/AppDelegate.swift similarity index 100% rename from packages/wyatt_notification_bloc/example/ios/Runner/AppDelegate.swift rename to packages/wyatt_cloud_messaging_bloc_base/example/ios/Runner/AppDelegate.swift diff --git a/packages/wyatt_notification_bloc/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/packages/wyatt_cloud_messaging_bloc_base/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json similarity index 100% rename from packages/wyatt_notification_bloc/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json rename to packages/wyatt_cloud_messaging_bloc_base/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json diff --git a/packages/wyatt_notification_bloc/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png b/packages/wyatt_cloud_messaging_bloc_base/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png similarity index 100% rename from packages/wyatt_notification_bloc/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png rename to packages/wyatt_cloud_messaging_bloc_base/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png diff --git a/packages/wyatt_notification_bloc/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png b/packages/wyatt_cloud_messaging_bloc_base/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png similarity index 100% rename from packages/wyatt_notification_bloc/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png rename to packages/wyatt_cloud_messaging_bloc_base/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png diff --git a/packages/wyatt_notification_bloc/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png b/packages/wyatt_cloud_messaging_bloc_base/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png similarity index 100% rename from packages/wyatt_notification_bloc/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png rename to packages/wyatt_cloud_messaging_bloc_base/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png diff --git a/packages/wyatt_notification_bloc/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png b/packages/wyatt_cloud_messaging_bloc_base/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png similarity index 100% rename from packages/wyatt_notification_bloc/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png rename to packages/wyatt_cloud_messaging_bloc_base/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png diff --git a/packages/wyatt_notification_bloc/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png b/packages/wyatt_cloud_messaging_bloc_base/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png similarity index 100% rename from packages/wyatt_notification_bloc/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png rename to packages/wyatt_cloud_messaging_bloc_base/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png diff --git a/packages/wyatt_notification_bloc/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png b/packages/wyatt_cloud_messaging_bloc_base/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png similarity index 100% rename from packages/wyatt_notification_bloc/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png rename to packages/wyatt_cloud_messaging_bloc_base/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png diff --git a/packages/wyatt_notification_bloc/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png b/packages/wyatt_cloud_messaging_bloc_base/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png similarity index 100% rename from packages/wyatt_notification_bloc/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png rename to packages/wyatt_cloud_messaging_bloc_base/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png diff --git a/packages/wyatt_notification_bloc/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png b/packages/wyatt_cloud_messaging_bloc_base/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png similarity index 100% rename from packages/wyatt_notification_bloc/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png rename to packages/wyatt_cloud_messaging_bloc_base/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png diff --git a/packages/wyatt_notification_bloc/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png b/packages/wyatt_cloud_messaging_bloc_base/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png similarity index 100% rename from packages/wyatt_notification_bloc/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png rename to packages/wyatt_cloud_messaging_bloc_base/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png diff --git a/packages/wyatt_notification_bloc/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png b/packages/wyatt_cloud_messaging_bloc_base/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png similarity index 100% rename from packages/wyatt_notification_bloc/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png rename to packages/wyatt_cloud_messaging_bloc_base/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png diff --git a/packages/wyatt_notification_bloc/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png b/packages/wyatt_cloud_messaging_bloc_base/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png similarity index 100% rename from packages/wyatt_notification_bloc/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png rename to packages/wyatt_cloud_messaging_bloc_base/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png diff --git a/packages/wyatt_notification_bloc/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png b/packages/wyatt_cloud_messaging_bloc_base/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png similarity index 100% rename from packages/wyatt_notification_bloc/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png rename to packages/wyatt_cloud_messaging_bloc_base/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png diff --git a/packages/wyatt_notification_bloc/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png b/packages/wyatt_cloud_messaging_bloc_base/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png similarity index 100% rename from packages/wyatt_notification_bloc/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png rename to packages/wyatt_cloud_messaging_bloc_base/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png diff --git a/packages/wyatt_notification_bloc/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png b/packages/wyatt_cloud_messaging_bloc_base/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png similarity index 100% rename from packages/wyatt_notification_bloc/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png rename to packages/wyatt_cloud_messaging_bloc_base/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png diff --git a/packages/wyatt_notification_bloc/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png b/packages/wyatt_cloud_messaging_bloc_base/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png similarity index 100% rename from packages/wyatt_notification_bloc/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png rename to packages/wyatt_cloud_messaging_bloc_base/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png diff --git a/packages/wyatt_notification_bloc/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json b/packages/wyatt_cloud_messaging_bloc_base/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json similarity index 100% rename from packages/wyatt_notification_bloc/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json rename to packages/wyatt_cloud_messaging_bloc_base/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json diff --git a/packages/wyatt_notification_bloc/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png b/packages/wyatt_cloud_messaging_bloc_base/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png similarity index 100% rename from packages/wyatt_notification_bloc/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png rename to packages/wyatt_cloud_messaging_bloc_base/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png diff --git a/packages/wyatt_notification_bloc/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png b/packages/wyatt_cloud_messaging_bloc_base/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png similarity index 100% rename from packages/wyatt_notification_bloc/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png rename to packages/wyatt_cloud_messaging_bloc_base/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png diff --git a/packages/wyatt_notification_bloc/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png b/packages/wyatt_cloud_messaging_bloc_base/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png similarity index 100% rename from packages/wyatt_notification_bloc/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png rename to packages/wyatt_cloud_messaging_bloc_base/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png diff --git a/packages/wyatt_notification_bloc/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md b/packages/wyatt_cloud_messaging_bloc_base/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md similarity index 100% rename from packages/wyatt_notification_bloc/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md rename to packages/wyatt_cloud_messaging_bloc_base/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md diff --git a/packages/wyatt_notification_bloc/example/ios/Runner/Base.lproj/LaunchScreen.storyboard b/packages/wyatt_cloud_messaging_bloc_base/example/ios/Runner/Base.lproj/LaunchScreen.storyboard similarity index 100% rename from packages/wyatt_notification_bloc/example/ios/Runner/Base.lproj/LaunchScreen.storyboard rename to packages/wyatt_cloud_messaging_bloc_base/example/ios/Runner/Base.lproj/LaunchScreen.storyboard diff --git a/packages/wyatt_notification_bloc/example/ios/Runner/Base.lproj/Main.storyboard b/packages/wyatt_cloud_messaging_bloc_base/example/ios/Runner/Base.lproj/Main.storyboard similarity index 100% rename from packages/wyatt_notification_bloc/example/ios/Runner/Base.lproj/Main.storyboard rename to packages/wyatt_cloud_messaging_bloc_base/example/ios/Runner/Base.lproj/Main.storyboard diff --git a/packages/wyatt_notification_bloc/example/ios/Runner/Info.plist b/packages/wyatt_cloud_messaging_bloc_base/example/ios/Runner/Info.plist similarity index 100% rename from packages/wyatt_notification_bloc/example/ios/Runner/Info.plist rename to packages/wyatt_cloud_messaging_bloc_base/example/ios/Runner/Info.plist diff --git a/packages/wyatt_notification_bloc/example/ios/Runner/Runner-Bridging-Header.h b/packages/wyatt_cloud_messaging_bloc_base/example/ios/Runner/Runner-Bridging-Header.h similarity index 100% rename from packages/wyatt_notification_bloc/example/ios/Runner/Runner-Bridging-Header.h rename to packages/wyatt_cloud_messaging_bloc_base/example/ios/Runner/Runner-Bridging-Header.h diff --git a/packages/wyatt_notification_bloc/example/ios/Runner/Runner.entitlements b/packages/wyatt_cloud_messaging_bloc_base/example/ios/Runner/Runner.entitlements similarity index 100% rename from packages/wyatt_notification_bloc/example/ios/Runner/Runner.entitlements rename to packages/wyatt_cloud_messaging_bloc_base/example/ios/Runner/Runner.entitlements diff --git a/packages/wyatt_notification_bloc/example/ios/firebase_app_id_file.json b/packages/wyatt_cloud_messaging_bloc_base/example/ios/firebase_app_id_file.json similarity index 100% rename from packages/wyatt_notification_bloc/example/ios/firebase_app_id_file.json rename to packages/wyatt_cloud_messaging_bloc_base/example/ios/firebase_app_id_file.json diff --git a/packages/wyatt_notification_bloc/example/lib/firebase_options.dart b/packages/wyatt_cloud_messaging_bloc_base/example/lib/firebase_options.dart similarity index 100% rename from packages/wyatt_notification_bloc/example/lib/firebase_options.dart rename to packages/wyatt_cloud_messaging_bloc_base/example/lib/firebase_options.dart diff --git a/packages/wyatt_notification_bloc/example/lib/main.dart b/packages/wyatt_cloud_messaging_bloc_base/example/lib/main.dart similarity index 100% rename from packages/wyatt_notification_bloc/example/lib/main.dart rename to packages/wyatt_cloud_messaging_bloc_base/example/lib/main.dart diff --git a/packages/wyatt_notification_bloc/example/pubspec.yaml b/packages/wyatt_cloud_messaging_bloc_base/example/pubspec.yaml similarity index 99% rename from packages/wyatt_notification_bloc/example/pubspec.yaml rename to packages/wyatt_cloud_messaging_bloc_base/example/pubspec.yaml index 123161ad..108b9a41 100644 --- a/packages/wyatt_notification_bloc/example/pubspec.yaml +++ b/packages/wyatt_cloud_messaging_bloc_base/example/pubspec.yaml @@ -33,7 +33,7 @@ dependencies: sdk: flutter flutter_bloc: ^8.1.1 - wyatt_cloud_messaging_bloc: + wyatt_cloud_messaging_bloc_base: path: ../ diff --git a/packages/wyatt_notification_bloc/example/pushes/push.json b/packages/wyatt_cloud_messaging_bloc_base/example/pushes/push.json similarity index 100% rename from packages/wyatt_notification_bloc/example/pushes/push.json rename to packages/wyatt_cloud_messaging_bloc_base/example/pushes/push.json diff --git a/packages/wyatt_notification_bloc/example/scripts/package-lock.json b/packages/wyatt_cloud_messaging_bloc_base/example/scripts/package-lock.json similarity index 100% rename from packages/wyatt_notification_bloc/example/scripts/package-lock.json rename to packages/wyatt_cloud_messaging_bloc_base/example/scripts/package-lock.json diff --git a/packages/wyatt_notification_bloc/example/scripts/package.json b/packages/wyatt_cloud_messaging_bloc_base/example/scripts/package.json similarity index 100% rename from packages/wyatt_notification_bloc/example/scripts/package.json rename to packages/wyatt_cloud_messaging_bloc_base/example/scripts/package.json diff --git a/packages/wyatt_notification_bloc/example/scripts/send-message.js b/packages/wyatt_cloud_messaging_bloc_base/example/scripts/send-message.js similarity index 100% rename from packages/wyatt_notification_bloc/example/scripts/send-message.js rename to packages/wyatt_cloud_messaging_bloc_base/example/scripts/send-message.js diff --git a/packages/wyatt_notification_bloc/example/scripts/wyatt-notification-example-firebase-adminsdk-aji7z-d74c5eb58d.json b/packages/wyatt_cloud_messaging_bloc_base/example/scripts/wyatt-notification-example-firebase-adminsdk-aji7z-d74c5eb58d.json similarity index 100% rename from packages/wyatt_notification_bloc/example/scripts/wyatt-notification-example-firebase-adminsdk-aji7z-d74c5eb58d.json rename to packages/wyatt_cloud_messaging_bloc_base/example/scripts/wyatt-notification-example-firebase-adminsdk-aji7z-d74c5eb58d.json diff --git a/packages/wyatt_notification_bloc/example/test/widget_test.dart b/packages/wyatt_cloud_messaging_bloc_base/example/test/widget_test.dart similarity index 100% rename from packages/wyatt_notification_bloc/example/test/widget_test.dart rename to packages/wyatt_cloud_messaging_bloc_base/example/test/widget_test.dart diff --git a/packages/wyatt_notification_bloc/lib/src/core/core.dart b/packages/wyatt_cloud_messaging_bloc_base/lib/src/core/core.dart similarity index 100% rename from packages/wyatt_notification_bloc/lib/src/core/core.dart rename to packages/wyatt_cloud_messaging_bloc_base/lib/src/core/core.dart diff --git a/packages/wyatt_notification_bloc/lib/src/core/exceptions/notification_exeption.dart b/packages/wyatt_cloud_messaging_bloc_base/lib/src/core/exceptions/notification_exeption.dart similarity index 100% rename from packages/wyatt_notification_bloc/lib/src/core/exceptions/notification_exeption.dart rename to packages/wyatt_cloud_messaging_bloc_base/lib/src/core/exceptions/notification_exeption.dart diff --git a/packages/wyatt_notification_bloc/lib/src/core/extensions/build_context_extension.dart b/packages/wyatt_cloud_messaging_bloc_base/lib/src/core/extensions/build_context_extension.dart similarity index 91% rename from packages/wyatt_notification_bloc/lib/src/core/extensions/build_context_extension.dart rename to packages/wyatt_cloud_messaging_bloc_base/lib/src/core/extensions/build_context_extension.dart index 89a6bdc8..541a8842 100644 --- a/packages/wyatt_notification_bloc/lib/src/core/extensions/build_context_extension.dart +++ b/packages/wyatt_cloud_messaging_bloc_base/lib/src/core/extensions/build_context_extension.dart @@ -16,7 +16,7 @@ import 'package:flutter/widgets.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; -import 'package:wyatt_cloud_messaging_bloc/wyatt_cloud_messaging_bloc.dart'; +import 'package:wyatt_cloud_messaging_bloc_base/wyatt_cloud_messaging_bloc.dart'; extension BuildContextExtension on BuildContext { CloudmessagingCubit get cloudMessaging => read(); diff --git a/packages/wyatt_notification_bloc/lib/src/data/data.dart b/packages/wyatt_cloud_messaging_bloc_base/lib/src/data/data.dart similarity index 100% rename from packages/wyatt_notification_bloc/lib/src/data/data.dart rename to packages/wyatt_cloud_messaging_bloc_base/lib/src/data/data.dart diff --git a/packages/wyatt_notification_bloc/lib/src/data/repositories/notification_repository_impl.dart b/packages/wyatt_cloud_messaging_bloc_base/lib/src/data/repositories/notification_repository_impl.dart similarity index 89% rename from packages/wyatt_notification_bloc/lib/src/data/repositories/notification_repository_impl.dart rename to packages/wyatt_cloud_messaging_bloc_base/lib/src/data/repositories/notification_repository_impl.dart index e3fab677..ddcbdbaa 100644 --- a/packages/wyatt_notification_bloc/lib/src/data/repositories/notification_repository_impl.dart +++ b/packages/wyatt_cloud_messaging_bloc_base/lib/src/data/repositories/notification_repository_impl.dart @@ -15,10 +15,10 @@ // along with this program. If not, see . import 'package:wyatt_architecture/wyatt_architecture.dart'; -import 'package:wyatt_cloud_messaging_bloc/src/core/exceptions/notification_exeption.dart'; -import 'package:wyatt_cloud_messaging_bloc/src/domain/data_sources/remote/notification_remote_data_source.dart'; -import 'package:wyatt_cloud_messaging_bloc/src/domain/entities/remote_notifications.dart'; -import 'package:wyatt_cloud_messaging_bloc/src/domain/repositories/notification_repository.dart'; +import 'package:wyatt_cloud_messaging_bloc_base/src/core/exceptions/notification_exeption.dart'; +import 'package:wyatt_cloud_messaging_bloc_base/src/domain/data_sources/remote/notification_remote_data_source.dart'; +import 'package:wyatt_cloud_messaging_bloc_base/src/domain/entities/remote_notifications.dart'; +import 'package:wyatt_cloud_messaging_bloc_base/src/domain/repositories/notification_repository.dart'; import 'package:wyatt_type_utils/wyatt_type_utils.dart'; class NotificationRepositoryImpl extends NotificationRepository { diff --git a/packages/wyatt_notification_bloc/lib/src/domain/data_sources/remote/notification_remote_data_source.dart b/packages/wyatt_cloud_messaging_bloc_base/lib/src/domain/data_sources/remote/notification_remote_data_source.dart similarity index 92% rename from packages/wyatt_notification_bloc/lib/src/domain/data_sources/remote/notification_remote_data_source.dart rename to packages/wyatt_cloud_messaging_bloc_base/lib/src/domain/data_sources/remote/notification_remote_data_source.dart index 3ae88e8b..92d9fa89 100644 --- a/packages/wyatt_notification_bloc/lib/src/domain/data_sources/remote/notification_remote_data_source.dart +++ b/packages/wyatt_cloud_messaging_bloc_base/lib/src/domain/data_sources/remote/notification_remote_data_source.dart @@ -15,7 +15,7 @@ // along with this program. If not, see . import 'package:wyatt_architecture/wyatt_architecture.dart'; -import 'package:wyatt_cloud_messaging_bloc/src/domain/entities/remote_notifications.dart'; +import 'package:wyatt_cloud_messaging_bloc_base/src/domain/entities/remote_notifications.dart'; abstract class NotificationRemoteDataSource extends BaseRepository { Future register(); diff --git a/packages/wyatt_notification_bloc/lib/src/domain/domain.dart b/packages/wyatt_cloud_messaging_bloc_base/lib/src/domain/domain.dart similarity index 100% rename from packages/wyatt_notification_bloc/lib/src/domain/domain.dart rename to packages/wyatt_cloud_messaging_bloc_base/lib/src/domain/domain.dart diff --git a/packages/wyatt_notification_bloc/lib/src/domain/entities/entities.dart b/packages/wyatt_cloud_messaging_bloc_base/lib/src/domain/entities/entities.dart similarity index 100% rename from packages/wyatt_notification_bloc/lib/src/domain/entities/entities.dart rename to packages/wyatt_cloud_messaging_bloc_base/lib/src/domain/entities/entities.dart diff --git a/packages/wyatt_notification_bloc/lib/src/domain/entities/remote_notifications.dart b/packages/wyatt_cloud_messaging_bloc_base/lib/src/domain/entities/remote_notifications.dart similarity index 100% rename from packages/wyatt_notification_bloc/lib/src/domain/entities/remote_notifications.dart rename to packages/wyatt_cloud_messaging_bloc_base/lib/src/domain/entities/remote_notifications.dart diff --git a/packages/wyatt_notification_bloc/lib/src/domain/repositories/notification_repository.dart b/packages/wyatt_cloud_messaging_bloc_base/lib/src/domain/repositories/notification_repository.dart similarity index 93% rename from packages/wyatt_notification_bloc/lib/src/domain/repositories/notification_repository.dart rename to packages/wyatt_cloud_messaging_bloc_base/lib/src/domain/repositories/notification_repository.dart index 013694ec..ced478f7 100644 --- a/packages/wyatt_notification_bloc/lib/src/domain/repositories/notification_repository.dart +++ b/packages/wyatt_cloud_messaging_bloc_base/lib/src/domain/repositories/notification_repository.dart @@ -17,7 +17,7 @@ import 'dart:async'; import 'package:wyatt_architecture/wyatt_architecture.dart'; -import 'package:wyatt_cloud_messaging_bloc/src/domain/entities/remote_notifications.dart'; +import 'package:wyatt_cloud_messaging_bloc_base/src/domain/entities/remote_notifications.dart'; abstract class NotificationRepository extends BaseRepository { FutureOrResult register(); diff --git a/packages/wyatt_notification_bloc/lib/src/domain/repositories/repositories.dart b/packages/wyatt_cloud_messaging_bloc_base/lib/src/domain/repositories/repositories.dart similarity index 100% rename from packages/wyatt_notification_bloc/lib/src/domain/repositories/repositories.dart rename to packages/wyatt_cloud_messaging_bloc_base/lib/src/domain/repositories/repositories.dart diff --git a/packages/wyatt_notification_bloc/lib/src/domain/usecases/get_cloud_messaging_token_use_case.dart b/packages/wyatt_cloud_messaging_bloc_base/lib/src/domain/usecases/get_cloud_messaging_token_use_case.dart similarity index 91% rename from packages/wyatt_notification_bloc/lib/src/domain/usecases/get_cloud_messaging_token_use_case.dart rename to packages/wyatt_cloud_messaging_bloc_base/lib/src/domain/usecases/get_cloud_messaging_token_use_case.dart index 6a39d65f..f5db1b53 100644 --- a/packages/wyatt_notification_bloc/lib/src/domain/usecases/get_cloud_messaging_token_use_case.dart +++ b/packages/wyatt_cloud_messaging_bloc_base/lib/src/domain/usecases/get_cloud_messaging_token_use_case.dart @@ -15,7 +15,7 @@ // along with this program. If not, see . import 'package:wyatt_architecture/wyatt_architecture.dart'; -import 'package:wyatt_cloud_messaging_bloc/src/domain/repositories/notification_repository.dart'; +import 'package:wyatt_cloud_messaging_bloc_base/src/domain/repositories/notification_repository.dart'; class GetCloudMessagingTokenUseCase extends AsyncUseCase { final NotificationRepository _notificationRepository; diff --git a/packages/wyatt_notification_bloc/lib/src/domain/usecases/init_cloud_messaging_use_case.dart b/packages/wyatt_cloud_messaging_bloc_base/lib/src/domain/usecases/init_cloud_messaging_use_case.dart similarity index 91% rename from packages/wyatt_notification_bloc/lib/src/domain/usecases/init_cloud_messaging_use_case.dart rename to packages/wyatt_cloud_messaging_bloc_base/lib/src/domain/usecases/init_cloud_messaging_use_case.dart index 1499bc34..f18c8351 100644 --- a/packages/wyatt_notification_bloc/lib/src/domain/usecases/init_cloud_messaging_use_case.dart +++ b/packages/wyatt_cloud_messaging_bloc_base/lib/src/domain/usecases/init_cloud_messaging_use_case.dart @@ -15,7 +15,7 @@ // along with this program. If not, see . import 'package:wyatt_architecture/wyatt_architecture.dart'; -import 'package:wyatt_cloud_messaging_bloc/src/domain/repositories/notification_repository.dart'; +import 'package:wyatt_cloud_messaging_bloc_base/src/domain/repositories/notification_repository.dart'; class InitCloudmessagingUseCase extends AsyncUseCase { final NotificationRepository _notificationRepository; diff --git a/packages/wyatt_notification_bloc/lib/src/domain/usecases/listen_notification_use_case.dart b/packages/wyatt_cloud_messaging_bloc_base/lib/src/domain/usecases/listen_notification_use_case.dart similarity index 88% rename from packages/wyatt_notification_bloc/lib/src/domain/usecases/listen_notification_use_case.dart rename to packages/wyatt_cloud_messaging_bloc_base/lib/src/domain/usecases/listen_notification_use_case.dart index 49506386..46e90028 100644 --- a/packages/wyatt_notification_bloc/lib/src/domain/usecases/listen_notification_use_case.dart +++ b/packages/wyatt_cloud_messaging_bloc_base/lib/src/domain/usecases/listen_notification_use_case.dart @@ -18,9 +18,9 @@ import 'dart:async'; import 'package:rxdart/rxdart.dart'; import 'package:wyatt_architecture/wyatt_architecture.dart'; -import 'package:wyatt_cloud_messaging_bloc/src/core/exceptions/notification_exeption.dart'; -import 'package:wyatt_cloud_messaging_bloc/src/domain/entities/remote_notifications.dart'; -import 'package:wyatt_cloud_messaging_bloc/src/domain/repositories/notification_repository.dart'; +import 'package:wyatt_cloud_messaging_bloc_base/src/core/exceptions/notification_exeption.dart'; +import 'package:wyatt_cloud_messaging_bloc_base/src/domain/entities/remote_notifications.dart'; +import 'package:wyatt_cloud_messaging_bloc_base/src/domain/repositories/notification_repository.dart'; import 'package:wyatt_type_utils/wyatt_type_utils.dart'; class ListenNotification extends StreamUseCase { diff --git a/packages/wyatt_notification_bloc/lib/src/domain/usecases/request_cloud_messaging_permission_use_case.dart b/packages/wyatt_cloud_messaging_bloc_base/lib/src/domain/usecases/request_cloud_messaging_permission_use_case.dart similarity index 91% rename from packages/wyatt_notification_bloc/lib/src/domain/usecases/request_cloud_messaging_permission_use_case.dart rename to packages/wyatt_cloud_messaging_bloc_base/lib/src/domain/usecases/request_cloud_messaging_permission_use_case.dart index 9dc714ea..274113fa 100644 --- a/packages/wyatt_notification_bloc/lib/src/domain/usecases/request_cloud_messaging_permission_use_case.dart +++ b/packages/wyatt_cloud_messaging_bloc_base/lib/src/domain/usecases/request_cloud_messaging_permission_use_case.dart @@ -15,7 +15,7 @@ // along with this program. If not, see . import 'package:wyatt_architecture/wyatt_architecture.dart'; -import 'package:wyatt_cloud_messaging_bloc/src/domain/repositories/notification_repository.dart'; +import 'package:wyatt_cloud_messaging_bloc_base/src/domain/repositories/notification_repository.dart'; class RequestCloudMessagingPermissionUseCase extends AsyncUseCase { final NotificationRepository _notificationRepository; diff --git a/packages/wyatt_notification_bloc/lib/src/domain/usecases/subscribe.dart b/packages/wyatt_cloud_messaging_bloc_base/lib/src/domain/usecases/subscribe.dart similarity index 92% rename from packages/wyatt_notification_bloc/lib/src/domain/usecases/subscribe.dart rename to packages/wyatt_cloud_messaging_bloc_base/lib/src/domain/usecases/subscribe.dart index 590eeb6f..bd30209e 100644 --- a/packages/wyatt_notification_bloc/lib/src/domain/usecases/subscribe.dart +++ b/packages/wyatt_cloud_messaging_bloc_base/lib/src/domain/usecases/subscribe.dart @@ -17,7 +17,7 @@ import 'dart:async'; import 'package:wyatt_architecture/wyatt_architecture.dart'; -import 'package:wyatt_cloud_messaging_bloc/src/domain/repositories/notification_repository.dart'; +import 'package:wyatt_cloud_messaging_bloc_base/src/domain/repositories/notification_repository.dart'; class Subscribe extends AsyncUseCase { final NotificationRepository _notificationRepository; diff --git a/packages/wyatt_notification_bloc/lib/src/domain/usecases/unsubscribe.dart b/packages/wyatt_cloud_messaging_bloc_base/lib/src/domain/usecases/unsubscribe.dart similarity index 92% rename from packages/wyatt_notification_bloc/lib/src/domain/usecases/unsubscribe.dart rename to packages/wyatt_cloud_messaging_bloc_base/lib/src/domain/usecases/unsubscribe.dart index d685188b..e2d714cd 100644 --- a/packages/wyatt_notification_bloc/lib/src/domain/usecases/unsubscribe.dart +++ b/packages/wyatt_cloud_messaging_bloc_base/lib/src/domain/usecases/unsubscribe.dart @@ -17,7 +17,7 @@ import 'dart:async'; import 'package:wyatt_architecture/wyatt_architecture.dart'; -import 'package:wyatt_cloud_messaging_bloc/src/domain/repositories/notification_repository.dart'; +import 'package:wyatt_cloud_messaging_bloc_base/src/domain/repositories/notification_repository.dart'; class Unsubscribe extends AsyncUseCase { final NotificationRepository _notificationRepository; diff --git a/packages/wyatt_notification_bloc/lib/src/domain/usecases/usecases.dart b/packages/wyatt_cloud_messaging_bloc_base/lib/src/domain/usecases/usecases.dart similarity index 100% rename from packages/wyatt_notification_bloc/lib/src/domain/usecases/usecases.dart rename to packages/wyatt_cloud_messaging_bloc_base/lib/src/domain/usecases/usecases.dart diff --git a/packages/wyatt_notification_bloc/lib/src/features/notifications/bloc/cloud_messaging_cubit.dart b/packages/wyatt_cloud_messaging_bloc_base/lib/src/features/notifications/bloc/cloud_messaging_cubit.dart similarity index 84% rename from packages/wyatt_notification_bloc/lib/src/features/notifications/bloc/cloud_messaging_cubit.dart rename to packages/wyatt_cloud_messaging_bloc_base/lib/src/features/notifications/bloc/cloud_messaging_cubit.dart index 4c8e68eb..ec601339 100644 --- a/packages/wyatt_notification_bloc/lib/src/features/notifications/bloc/cloud_messaging_cubit.dart +++ b/packages/wyatt_cloud_messaging_bloc_base/lib/src/features/notifications/bloc/cloud_messaging_cubit.dart @@ -3,9 +3,9 @@ import 'dart:async'; import 'package:equatable/equatable.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:wyatt_architecture/wyatt_architecture.dart'; -import 'package:wyatt_cloud_messaging_bloc/src/domain/entities/remote_notifications.dart'; -import 'package:wyatt_cloud_messaging_bloc/src/domain/usecases/listen_notification_use_case.dart'; -import 'package:wyatt_cloud_messaging_bloc/src/domain/usecases/subscribe.dart'; +import 'package:wyatt_cloud_messaging_bloc_base/src/domain/entities/remote_notifications.dart'; +import 'package:wyatt_cloud_messaging_bloc_base/src/domain/usecases/listen_notification_use_case.dart'; +import 'package:wyatt_cloud_messaging_bloc_base/src/domain/usecases/subscribe.dart'; // Copyright (C) 2023 WYATT GROUP // Please see the AUTHORS file for details. // @@ -22,7 +22,7 @@ import 'package:wyatt_cloud_messaging_bloc/src/domain/usecases/subscribe.dart'; // You should have received a copy of the GNU General Public License // along with this program. If not, see . -import 'package:wyatt_cloud_messaging_bloc/src/domain/usecases/unsubscribe.dart'; +import 'package:wyatt_cloud_messaging_bloc_base/src/domain/usecases/unsubscribe.dart'; part 'cloud_messaging_state.dart'; diff --git a/packages/wyatt_notification_bloc/lib/src/features/notifications/bloc/cloud_messaging_state.dart b/packages/wyatt_cloud_messaging_bloc_base/lib/src/features/notifications/bloc/cloud_messaging_state.dart similarity index 100% rename from packages/wyatt_notification_bloc/lib/src/features/notifications/bloc/cloud_messaging_state.dart rename to packages/wyatt_cloud_messaging_bloc_base/lib/src/features/notifications/bloc/cloud_messaging_state.dart diff --git a/packages/wyatt_notification_bloc/lib/src/src.dart b/packages/wyatt_cloud_messaging_bloc_base/lib/src/src.dart similarity index 100% rename from packages/wyatt_notification_bloc/lib/src/src.dart rename to packages/wyatt_cloud_messaging_bloc_base/lib/src/src.dart diff --git a/packages/wyatt_notification_bloc/lib/wyatt_cloud_messaging_bloc.dart b/packages/wyatt_cloud_messaging_bloc_base/lib/wyatt_cloud_messaging_bloc.dart similarity index 94% rename from packages/wyatt_notification_bloc/lib/wyatt_cloud_messaging_bloc.dart rename to packages/wyatt_cloud_messaging_bloc_base/lib/wyatt_cloud_messaging_bloc.dart index f58724c3..4bec6b8b 100644 --- a/packages/wyatt_notification_bloc/lib/wyatt_cloud_messaging_bloc.dart +++ b/packages/wyatt_cloud_messaging_bloc_base/lib/wyatt_cloud_messaging_bloc.dart @@ -15,6 +15,6 @@ // along with this program. If not, see . /// An notification library for BLoC. -library wyatt_cloud_messaging_bloc; +library wyatt_cloud_messaging_bloc_base; export 'src/src.dart'; diff --git a/packages/wyatt_notification_bloc/pubspec.yaml b/packages/wyatt_cloud_messaging_bloc_base/pubspec.yaml similarity index 95% rename from packages/wyatt_notification_bloc/pubspec.yaml rename to packages/wyatt_cloud_messaging_bloc_base/pubspec.yaml index d1cd1a17..b37d4c57 100644 --- a/packages/wyatt_notification_bloc/pubspec.yaml +++ b/packages/wyatt_cloud_messaging_bloc_base/pubspec.yaml @@ -1,4 +1,4 @@ -name: wyatt_cloud_messaging_bloc +name: wyatt_cloud_messaging_bloc_base description: A starting point for Dart libraries or applications. repository: https://git.wyatt-studio.fr/Wyatt-FOSS/wyatt-packages/src/branch/master/packages/wyatt_notification_bloc version: 1.0.0 diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/.bin/acorn b/packages/wyatt_notification_bloc/example/scripts/node_modules/.bin/acorn deleted file mode 120000 index cf767603..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/.bin/acorn +++ /dev/null @@ -1 +0,0 @@ -../acorn/bin/acorn \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/.bin/compileProtos b/packages/wyatt_notification_bloc/example/scripts/node_modules/.bin/compileProtos deleted file mode 120000 index c2993b03..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/.bin/compileProtos +++ /dev/null @@ -1 +0,0 @@ -../google-gax/build/tools/compileProtos.js \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/.bin/escodegen b/packages/wyatt_notification_bloc/example/scripts/node_modules/.bin/escodegen deleted file mode 120000 index 01a7c325..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/.bin/escodegen +++ /dev/null @@ -1 +0,0 @@ -../escodegen/bin/escodegen.js \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/.bin/esgenerate b/packages/wyatt_notification_bloc/example/scripts/node_modules/.bin/esgenerate deleted file mode 120000 index 7d0293e6..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/.bin/esgenerate +++ /dev/null @@ -1 +0,0 @@ -../escodegen/bin/esgenerate.js \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/.bin/esparse b/packages/wyatt_notification_bloc/example/scripts/node_modules/.bin/esparse deleted file mode 120000 index 7423b18b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/.bin/esparse +++ /dev/null @@ -1 +0,0 @@ -../esprima/bin/esparse.js \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/.bin/esvalidate b/packages/wyatt_notification_bloc/example/scripts/node_modules/.bin/esvalidate deleted file mode 120000 index 16069eff..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/.bin/esvalidate +++ /dev/null @@ -1 +0,0 @@ -../esprima/bin/esvalidate.js \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/.bin/gp12-pem b/packages/wyatt_notification_bloc/example/scripts/node_modules/.bin/gp12-pem deleted file mode 120000 index cfbbf67b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/.bin/gp12-pem +++ /dev/null @@ -1 +0,0 @@ -../google-p12-pem/build/src/bin/gp12-pem.js \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/.bin/jsdoc b/packages/wyatt_notification_bloc/example/scripts/node_modules/.bin/jsdoc deleted file mode 120000 index 5c047775..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/.bin/jsdoc +++ /dev/null @@ -1 +0,0 @@ -../jsdoc/jsdoc.js \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/.bin/markdown-it b/packages/wyatt_notification_bloc/example/scripts/node_modules/.bin/markdown-it deleted file mode 120000 index 894bcdb6..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/.bin/markdown-it +++ /dev/null @@ -1 +0,0 @@ -../markdown-it/bin/markdown-it.js \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/.bin/marked b/packages/wyatt_notification_bloc/example/scripts/node_modules/.bin/marked deleted file mode 120000 index 6827ff33..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/.bin/marked +++ /dev/null @@ -1 +0,0 @@ -../marked/bin/marked.js \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/.bin/mime b/packages/wyatt_notification_bloc/example/scripts/node_modules/.bin/mime deleted file mode 120000 index fbb7ee0e..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/.bin/mime +++ /dev/null @@ -1 +0,0 @@ -../mime/cli.js \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/.bin/minifyProtoJson b/packages/wyatt_notification_bloc/example/scripts/node_modules/.bin/minifyProtoJson deleted file mode 120000 index 0ecb29c0..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/.bin/minifyProtoJson +++ /dev/null @@ -1 +0,0 @@ -../google-gax/build/tools/minify.js \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/.bin/mkdirp b/packages/wyatt_notification_bloc/example/scripts/node_modules/.bin/mkdirp deleted file mode 120000 index 017896ce..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/.bin/mkdirp +++ /dev/null @@ -1 +0,0 @@ -../mkdirp/bin/cmd.js \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/.bin/parser b/packages/wyatt_notification_bloc/example/scripts/node_modules/.bin/parser deleted file mode 120000 index ce7bf97e..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/.bin/parser +++ /dev/null @@ -1 +0,0 @@ -../@babel/parser/bin/babel-parser.js \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/.bin/pbjs b/packages/wyatt_notification_bloc/example/scripts/node_modules/.bin/pbjs deleted file mode 120000 index d7cc9039..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/.bin/pbjs +++ /dev/null @@ -1 +0,0 @@ -../protobufjs-cli/bin/pbjs \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/.bin/pbts b/packages/wyatt_notification_bloc/example/scripts/node_modules/.bin/pbts deleted file mode 120000 index 98ad9e3c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/.bin/pbts +++ /dev/null @@ -1 +0,0 @@ -../protobufjs-cli/bin/pbts \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/.bin/proto-loader-gen-types b/packages/wyatt_notification_bloc/example/scripts/node_modules/.bin/proto-loader-gen-types deleted file mode 120000 index d677436b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/.bin/proto-loader-gen-types +++ /dev/null @@ -1 +0,0 @@ -../@grpc/proto-loader/build/bin/proto-loader-gen-types.js \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/.bin/rimraf b/packages/wyatt_notification_bloc/example/scripts/node_modules/.bin/rimraf deleted file mode 120000 index 4cd49a49..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/.bin/rimraf +++ /dev/null @@ -1 +0,0 @@ -../rimraf/bin.js \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/.bin/semver b/packages/wyatt_notification_bloc/example/scripts/node_modules/.bin/semver deleted file mode 120000 index 317eb293..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/.bin/semver +++ /dev/null @@ -1 +0,0 @@ -../semver/bin/semver \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/.bin/uglifyjs b/packages/wyatt_notification_bloc/example/scripts/node_modules/.bin/uglifyjs deleted file mode 120000 index fef3468b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/.bin/uglifyjs +++ /dev/null @@ -1 +0,0 @@ -../uglify-js/bin/uglifyjs \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/.bin/uuid b/packages/wyatt_notification_bloc/example/scripts/node_modules/.bin/uuid deleted file mode 120000 index 588f70ec..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/.bin/uuid +++ /dev/null @@ -1 +0,0 @@ -../uuid/dist/bin/uuid \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/.package-lock.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/.package-lock.json deleted file mode 100644 index 34d58ae5..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/.package-lock.json +++ /dev/null @@ -1,2130 +0,0 @@ -{ - "name": "firebase-messaging-scripts", - "lockfileVersion": 2, - "requires": true, - "packages": { - "node_modules/@babel/parser": { - "version": "7.20.3", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.20.3.tgz", - "integrity": "sha512-OP/s5a94frIPXwjzEcv5S/tpQfc6XhxYUnmWpgdqMWGgYCuErA3SzozaRAMQgSZWKeTJxht9aWAkUY+0UzvOFg==", - "optional": true, - "bin": { - "parser": "bin/babel-parser.js" - }, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/@fastify/busboy": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@fastify/busboy/-/busboy-1.1.0.tgz", - "integrity": "sha512-Fv854f94v0CzIDllbY3i/0NJPNBRNLDawf3BTYVGCe9VrIIs3Wi7AFx24F9NzCxdf0wyx/x0Q9kEVnvDOPnlxA==", - "dependencies": { - "text-decoding": "^1.0.0" - }, - "engines": { - "node": ">=10.17.0" - } - }, - "node_modules/@firebase/app-types": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/@firebase/app-types/-/app-types-0.8.1.tgz", - "integrity": "sha512-p75Ow3QhB82kpMzmOntv866wH9eZ3b4+QbUY+8/DA5Zzdf1c8Nsk8B7kbFpzJt4wwHMdy5LTF5YUnoTc1JiWkw==" - }, - "node_modules/@firebase/auth-interop-types": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/@firebase/auth-interop-types/-/auth-interop-types-0.1.7.tgz", - "integrity": "sha512-yA/dTveGGPcc85JP8ZE/KZqfGQyQTBCV10THdI8HTlP1GDvNrhr//J5jAt58MlsCOaO3XmC4DqScPBbtIsR/EA==", - "peerDependencies": { - "@firebase/app-types": "0.x", - "@firebase/util": "1.x" - } - }, - "node_modules/@firebase/component": { - "version": "0.5.21", - "resolved": "https://registry.npmjs.org/@firebase/component/-/component-0.5.21.tgz", - "integrity": "sha512-12MMQ/ulfygKpEJpseYMR0HunJdlsLrwx2XcEs40M18jocy2+spyzHHEwegN3x/2/BLFBjR5247Etmz0G97Qpg==", - "dependencies": { - "@firebase/util": "1.7.3", - "tslib": "^2.1.0" - } - }, - "node_modules/@firebase/database": { - "version": "0.13.10", - "resolved": "https://registry.npmjs.org/@firebase/database/-/database-0.13.10.tgz", - "integrity": "sha512-KRucuzZ7ZHQsRdGEmhxId5jyM2yKsjsQWF9yv0dIhlxYg0D8rCVDZc/waoPKA5oV3/SEIoptF8F7R1Vfe7BCQA==", - "dependencies": { - "@firebase/auth-interop-types": "0.1.7", - "@firebase/component": "0.5.21", - "@firebase/logger": "0.3.4", - "@firebase/util": "1.7.3", - "faye-websocket": "0.11.4", - "tslib": "^2.1.0" - } - }, - "node_modules/@firebase/database-compat": { - "version": "0.2.10", - "resolved": "https://registry.npmjs.org/@firebase/database-compat/-/database-compat-0.2.10.tgz", - "integrity": "sha512-fK+IgUUqVKcWK/gltzDU+B1xauCOfY6vulO8lxoNTkcCGlSxuTtwsdqjGkFmgFRMYjXFWWJ6iFcJ/vXahzwCtA==", - "dependencies": { - "@firebase/component": "0.5.21", - "@firebase/database": "0.13.10", - "@firebase/database-types": "0.9.17", - "@firebase/logger": "0.3.4", - "@firebase/util": "1.7.3", - "tslib": "^2.1.0" - } - }, - "node_modules/@firebase/database-types": { - "version": "0.9.17", - "resolved": "https://registry.npmjs.org/@firebase/database-types/-/database-types-0.9.17.tgz", - "integrity": "sha512-YQm2tCZyxNtEnlS5qo5gd2PAYgKCy69tUKwioGhApCFThW+mIgZs7IeYeJo2M51i4LCixYUl+CvnOyAnb/c3XA==", - "dependencies": { - "@firebase/app-types": "0.8.1", - "@firebase/util": "1.7.3" - } - }, - "node_modules/@firebase/logger": { - "version": "0.3.4", - "resolved": "https://registry.npmjs.org/@firebase/logger/-/logger-0.3.4.tgz", - "integrity": "sha512-hlFglGRgZEwoyClZcGLx/Wd+zoLfGmbDkFx56mQt/jJ0XMbfPqwId1kiPl0zgdWZX+D8iH+gT6GuLPFsJWgiGw==", - "dependencies": { - "tslib": "^2.1.0" - } - }, - "node_modules/@firebase/util": { - "version": "1.7.3", - "resolved": "https://registry.npmjs.org/@firebase/util/-/util-1.7.3.tgz", - "integrity": "sha512-wxNqWbqokF551WrJ9BIFouU/V5SL1oYCGx1oudcirdhadnQRFH5v1sjgGL7cUV/UsekSycygphdrF2lxBxOYKg==", - "dependencies": { - "tslib": "^2.1.0" - } - }, - "node_modules/@google-cloud/firestore": { - "version": "6.4.1", - "resolved": "https://registry.npmjs.org/@google-cloud/firestore/-/firestore-6.4.1.tgz", - "integrity": "sha512-5q4sl1XCL8NH2y82KZ4WQGHDOPnrSMYq3JpIeKD5C0OCSb4MfckOTB9LeAQ3p5tlL+7UsVRHj0SyzKz27XZJjw==", - "optional": true, - "dependencies": { - "fast-deep-equal": "^3.1.1", - "functional-red-black-tree": "^1.0.1", - "google-gax": "^3.5.1", - "protobufjs": "^7.0.0" - }, - "engines": { - "node": ">=12.0.0" - } - }, - "node_modules/@google-cloud/paginator": { - "version": "3.0.7", - "resolved": "https://registry.npmjs.org/@google-cloud/paginator/-/paginator-3.0.7.tgz", - "integrity": "sha512-jJNutk0arIQhmpUUQJPJErsojqo834KcyB6X7a1mxuic8i1tKXxde8E69IZxNZawRIlZdIK2QY4WALvlK5MzYQ==", - "optional": true, - "dependencies": { - "arrify": "^2.0.0", - "extend": "^3.0.2" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/@google-cloud/projectify": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@google-cloud/projectify/-/projectify-3.0.0.tgz", - "integrity": "sha512-HRkZsNmjScY6Li8/kb70wjGlDDyLkVk3KvoEo9uIoxSjYLJasGiCch9+PqRVDOCGUFvEIqyogl+BeqILL4OJHA==", - "optional": true, - "engines": { - "node": ">=12.0.0" - } - }, - "node_modules/@google-cloud/promisify": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@google-cloud/promisify/-/promisify-3.0.1.tgz", - "integrity": "sha512-z1CjRjtQyBOYL+5Qr9DdYIfrdLBe746jRTYfaYU6MeXkqp7UfYs/jX16lFFVzZ7PGEJvqZNqYUEtb1mvDww4pA==", - "optional": true, - "engines": { - "node": ">=12" - } - }, - "node_modules/@google-cloud/storage": { - "version": "6.7.0", - "resolved": "https://registry.npmjs.org/@google-cloud/storage/-/storage-6.7.0.tgz", - "integrity": "sha512-iEit3dvUhGQV3pPC8aci/Y+F6K2QJ/UvcXhymj8gnO8IYQfZSZvFf361yX4BWNUlbHzanUQVQdF9RvgEM8fwpw==", - "optional": true, - "dependencies": { - "@google-cloud/paginator": "^3.0.7", - "@google-cloud/projectify": "^3.0.0", - "@google-cloud/promisify": "^3.0.0", - "abort-controller": "^3.0.0", - "async-retry": "^1.3.3", - "compressible": "^2.0.12", - "duplexify": "^4.0.0", - "ent": "^2.2.0", - "extend": "^3.0.2", - "gaxios": "^5.0.0", - "google-auth-library": "^8.0.1", - "mime": "^3.0.0", - "mime-types": "^2.0.8", - "p-limit": "^3.0.1", - "retry-request": "^5.0.0", - "teeny-request": "^8.0.0", - "uuid": "^8.0.0" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/@google-cloud/storage/node_modules/uuid": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", - "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", - "optional": true, - "bin": { - "uuid": "dist/bin/uuid" - } - }, - "node_modules/@grpc/grpc-js": { - "version": "1.7.3", - "resolved": "https://registry.npmjs.org/@grpc/grpc-js/-/grpc-js-1.7.3.tgz", - "integrity": "sha512-H9l79u4kJ2PVSxUNA08HMYAnUBLj9v6KjYQ7SQ71hOZcEXhShE/y5iQCesP8+6/Ik/7i2O0a10bPquIcYfufog==", - "optional": true, - "dependencies": { - "@grpc/proto-loader": "^0.7.0", - "@types/node": ">=12.12.47" - }, - "engines": { - "node": "^8.13.0 || >=10.10.0" - } - }, - "node_modules/@grpc/proto-loader": { - "version": "0.7.3", - "resolved": "https://registry.npmjs.org/@grpc/proto-loader/-/proto-loader-0.7.3.tgz", - "integrity": "sha512-5dAvoZwna2Py3Ef96Ux9jIkp3iZ62TUsV00p3wVBPNX5K178UbNi8Q7gQVqwXT1Yq9RejIGG9G2IPEo93T6RcA==", - "optional": true, - "dependencies": { - "@types/long": "^4.0.1", - "lodash.camelcase": "^4.3.0", - "long": "^4.0.0", - "protobufjs": "^7.0.0", - "yargs": "^16.2.0" - }, - "bin": { - "proto-loader-gen-types": "build/bin/proto-loader-gen-types.js" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/@panva/asn1.js": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@panva/asn1.js/-/asn1.js-1.0.0.tgz", - "integrity": "sha512-UdkG3mLEqXgnlKsWanWcgb6dOjUzJ+XC5f+aWw30qrtjxeNUSfKX1cd5FBzOaXQumoe9nIqeZUvrRJS03HCCtw==", - "engines": { - "node": ">=10.13.0" - } - }, - "node_modules/@protobufjs/aspromise": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz", - "integrity": "sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ==", - "optional": true - }, - "node_modules/@protobufjs/base64": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@protobufjs/base64/-/base64-1.1.2.tgz", - "integrity": "sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==", - "optional": true - }, - "node_modules/@protobufjs/codegen": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/@protobufjs/codegen/-/codegen-2.0.4.tgz", - "integrity": "sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg==", - "optional": true - }, - "node_modules/@protobufjs/eventemitter": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz", - "integrity": "sha512-j9ednRT81vYJ9OfVuXG6ERSTdEL1xVsNgqpkxMsbIabzSo3goCjDIveeGv5d03om39ML71RdmrGNjG5SReBP/Q==", - "optional": true - }, - "node_modules/@protobufjs/fetch": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.0.tgz", - "integrity": "sha512-lljVXpqXebpsijW71PZaCYeIcE5on1w5DlQy5WH6GLbFryLUrBD4932W/E2BSpfRJWseIL4v/KPgBFxDOIdKpQ==", - "optional": true, - "dependencies": { - "@protobufjs/aspromise": "^1.1.1", - "@protobufjs/inquire": "^1.1.0" - } - }, - "node_modules/@protobufjs/float": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz", - "integrity": "sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ==", - "optional": true - }, - "node_modules/@protobufjs/inquire": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/inquire/-/inquire-1.1.0.tgz", - "integrity": "sha512-kdSefcPdruJiFMVSbn801t4vFK7KB/5gd2fYvrxhuJYg8ILrmn9SKSX2tZdV6V+ksulWqS7aXjBcRXl3wHoD9Q==", - "optional": true - }, - "node_modules/@protobufjs/path": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz", - "integrity": "sha512-6JOcJ5Tm08dOHAbdR3GrvP+yUUfkjG5ePsHYczMFLq3ZmMkAD98cDgcT2iA1lJ9NVwFd4tH/iSSoe44YWkltEA==", - "optional": true - }, - "node_modules/@protobufjs/pool": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz", - "integrity": "sha512-0kELaGSIDBKvcgS4zkjz1PeddatrjYcmMWOlAuAPwAeccUrPHdUqo/J6LiymHHEiJT5NrF1UVwxY14f+fy4WQw==", - "optional": true - }, - "node_modules/@protobufjs/utf8": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz", - "integrity": "sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw==", - "optional": true - }, - "node_modules/@tootallnate/once": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-2.0.0.tgz", - "integrity": "sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A==", - "optional": true, - "engines": { - "node": ">= 10" - } - }, - "node_modules/@types/body-parser": { - "version": "1.19.2", - "resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.19.2.tgz", - "integrity": "sha512-ALYone6pm6QmwZoAgeyNksccT9Q4AWZQ6PvfwR37GT6r6FWUPguq6sUmNGSMV2Wr761oQoBxwGGa6DR5o1DC9g==", - "dependencies": { - "@types/connect": "*", - "@types/node": "*" - } - }, - "node_modules/@types/connect": { - "version": "3.4.35", - "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.35.tgz", - "integrity": "sha512-cdeYyv4KWoEgpBISTxWvqYsVy444DOqehiF3fM3ne10AmJ62RSyNkUnxMJXHQWRQQX2eR94m5y1IZyDwBjV9FQ==", - "dependencies": { - "@types/node": "*" - } - }, - "node_modules/@types/express": { - "version": "4.17.14", - "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.14.tgz", - "integrity": "sha512-TEbt+vaPFQ+xpxFLFssxUDXj5cWCxZJjIcB7Yg0k0GMHGtgtQgpvx/MUQUeAkNbA9AAGrwkAsoeItdTgS7FMyg==", - "dependencies": { - "@types/body-parser": "*", - "@types/express-serve-static-core": "^4.17.18", - "@types/qs": "*", - "@types/serve-static": "*" - } - }, - "node_modules/@types/express-serve-static-core": { - "version": "4.17.31", - "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.31.tgz", - "integrity": "sha512-DxMhY+NAsTwMMFHBTtJFNp5qiHKJ7TeqOo23zVEM9alT1Ml27Q3xcTH0xwxn7Q0BbMcVEJOs/7aQtUWupUQN3Q==", - "dependencies": { - "@types/node": "*", - "@types/qs": "*", - "@types/range-parser": "*" - } - }, - "node_modules/@types/jsonwebtoken": { - "version": "8.5.9", - "resolved": "https://registry.npmjs.org/@types/jsonwebtoken/-/jsonwebtoken-8.5.9.tgz", - "integrity": "sha512-272FMnFGzAVMGtu9tkr29hRL6bZj4Zs1KZNeHLnKqAvp06tAIcarTMwOh8/8bz4FmKRcMxZhZNeUAQsNLoiPhg==", - "dependencies": { - "@types/node": "*" - } - }, - "node_modules/@types/linkify-it": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/@types/linkify-it/-/linkify-it-3.0.2.tgz", - "integrity": "sha512-HZQYqbiFVWufzCwexrvh694SOim8z2d+xJl5UNamcvQFejLY/2YUtzXHYi3cHdI7PMlS8ejH2slRAOJQ32aNbA==", - "optional": true - }, - "node_modules/@types/long": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/@types/long/-/long-4.0.2.tgz", - "integrity": "sha512-MqTGEo5bj5t157U6fA/BiDynNkn0YknVdh48CMPkTSpFTVmvao5UQmm7uEF6xBEo7qIMAlY/JSleYaE6VOdpaA==", - "optional": true - }, - "node_modules/@types/markdown-it": { - "version": "12.2.3", - "resolved": "https://registry.npmjs.org/@types/markdown-it/-/markdown-it-12.2.3.tgz", - "integrity": "sha512-GKMHFfv3458yYy+v/N8gjufHO6MSZKCOXpZc5GXIWWy8uldwfmPn98vp81gZ5f9SVw8YYBctgfJ22a2d7AOMeQ==", - "optional": true, - "dependencies": { - "@types/linkify-it": "*", - "@types/mdurl": "*" - } - }, - "node_modules/@types/mdurl": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@types/mdurl/-/mdurl-1.0.2.tgz", - "integrity": "sha512-eC4U9MlIcu2q0KQmXszyn5Akca/0jrQmwDRgpAMJai7qBWq4amIQhZyNau4VYGtCeALvW1/NtjzJJ567aZxfKA==", - "optional": true - }, - "node_modules/@types/mime": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@types/mime/-/mime-3.0.1.tgz", - "integrity": "sha512-Y4XFY5VJAuw0FgAqPNd6NNoV44jbq9Bz2L7Rh/J6jLTiHBSBJa9fxqQIvkIld4GsoDOcCbvzOUAbLPsSKKg+uA==" - }, - "node_modules/@types/node": { - "version": "18.11.9", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.11.9.tgz", - "integrity": "sha512-CRpX21/kGdzjOpFsZSkcrXMGIBWMGNIHXXBVFSH+ggkftxg+XYP20TESbh+zFvFj3EQOl5byk0HTRn1IL6hbqg==" - }, - "node_modules/@types/qs": { - "version": "6.9.7", - "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.7.tgz", - "integrity": "sha512-FGa1F62FT09qcrueBA6qYTrJPVDzah9a+493+o2PCXsesWHIn27G98TsSMs3WPNbZIEj4+VJf6saSFpvD+3Zsw==" - }, - "node_modules/@types/range-parser": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.4.tgz", - "integrity": "sha512-EEhsLsD6UsDM1yFhAvy0Cjr6VwmpMWqFBCb9w07wVugF7w9nfajxLuVmngTIpgS6svCnm6Vaw+MZhoDCKnOfsw==" - }, - "node_modules/@types/serve-static": { - "version": "1.15.0", - "resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.15.0.tgz", - "integrity": "sha512-z5xyF6uh8CbjAu9760KDKsH2FcDxZ2tFCsA4HIMWE6IkiYMXfVoa+4f9KX+FN0ZLsaMw1WNG2ETLA6N+/YA+cg==", - "dependencies": { - "@types/mime": "*", - "@types/node": "*" - } - }, - "node_modules/abort-controller": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz", - "integrity": "sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==", - "optional": true, - "dependencies": { - "event-target-shim": "^5.0.0" - }, - "engines": { - "node": ">=6.5" - } - }, - "node_modules/acorn": { - "version": "8.8.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.1.tgz", - "integrity": "sha512-7zFpHzhnqYKrkYdUjF1HI1bzd0VygEGX8lFk4k5zVMqHEoES+P+7TKI+EvLO9WVMJ8eekdO0aDEK044xTXwPPA==", - "optional": true, - "bin": { - "acorn": "bin/acorn" - }, - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/acorn-jsx": { - "version": "5.3.2", - "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", - "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", - "optional": true, - "peerDependencies": { - "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" - } - }, - "node_modules/agent-base": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", - "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", - "optional": true, - "dependencies": { - "debug": "4" - }, - "engines": { - "node": ">= 6.0.0" - } - }, - "node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "optional": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "optional": true, - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/argparse": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", - "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", - "optional": true - }, - "node_modules/arrify": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/arrify/-/arrify-2.0.1.tgz", - "integrity": "sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug==", - "optional": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/async-retry": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/async-retry/-/async-retry-1.3.3.tgz", - "integrity": "sha512-wfr/jstw9xNi/0teMHrRW7dsz3Lt5ARhYNZ2ewpadnhaIp5mbALhOAP+EAdsC7t4Z6wqsDVv9+W6gm1Dk9mEyw==", - "optional": true, - "dependencies": { - "retry": "0.13.1" - } - }, - "node_modules/balanced-match": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", - "optional": true - }, - "node_modules/base64-js": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", - "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "optional": true - }, - "node_modules/bignumber.js": { - "version": "9.1.0", - "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.1.0.tgz", - "integrity": "sha512-4LwHK4nfDOraBCtst+wOWIHbu1vhvAPJK8g8nROd4iuc3PSEjWif/qwbkh8jwCJz6yDBvtU4KPynETgrfh7y3A==", - "optional": true, - "engines": { - "node": "*" - } - }, - "node_modules/bluebird": { - "version": "3.7.2", - "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz", - "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==", - "optional": true - }, - "node_modules/brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", - "optional": true, - "dependencies": { - "balanced-match": "^1.0.0" - } - }, - "node_modules/buffer-equal-constant-time": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz", - "integrity": "sha512-zRpUiDwd/xk6ADqPMATG8vc9VPrkck7T07OIx0gnjmJAnHnTVXNQG3vfvWNuiZIkwu9KrKdA1iJKfsfTVxE6NA==" - }, - "node_modules/catharsis": { - "version": "0.9.0", - "resolved": "https://registry.npmjs.org/catharsis/-/catharsis-0.9.0.tgz", - "integrity": "sha512-prMTQVpcns/tzFgFVkVp6ak6RykZyWb3gu8ckUpd6YkTlacOd3DXGJjIpD4Q6zJirizvaiAjSSHlOsA+6sNh2A==", - "optional": true, - "dependencies": { - "lodash": "^4.17.15" - }, - "engines": { - "node": ">= 10" - } - }, - "node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "optional": true, - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/cliui": { - "version": "7.0.4", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", - "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", - "optional": true, - "dependencies": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.0", - "wrap-ansi": "^7.0.0" - } - }, - "node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "optional": true, - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "optional": true - }, - "node_modules/compressible": { - "version": "2.0.18", - "resolved": "https://registry.npmjs.org/compressible/-/compressible-2.0.18.tgz", - "integrity": "sha512-AF3r7P5dWxL8MxyITRMlORQNaOA2IkAFaTr4k7BUumjPtRpGDTZpl0Pb1XCO6JeDCBdp126Cgs9sMxqSjgYyRg==", - "optional": true, - "dependencies": { - "mime-db": ">= 1.43.0 < 2" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", - "optional": true - }, - "node_modules/debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/deep-is": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", - "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", - "optional": true - }, - "node_modules/duplexify": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-4.1.2.tgz", - "integrity": "sha512-fz3OjcNCHmRP12MJoZMPglx8m4rrFP8rovnk4vT8Fs+aonZoCwGg10dSsQsfP/E62eZcPTMSMP6686fu9Qlqtw==", - "optional": true, - "dependencies": { - "end-of-stream": "^1.4.1", - "inherits": "^2.0.3", - "readable-stream": "^3.1.1", - "stream-shift": "^1.0.0" - } - }, - "node_modules/ecdsa-sig-formatter": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz", - "integrity": "sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ==", - "dependencies": { - "safe-buffer": "^5.0.1" - } - }, - "node_modules/emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "optional": true - }, - "node_modules/end-of-stream": { - "version": "1.4.4", - "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", - "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", - "optional": true, - "dependencies": { - "once": "^1.4.0" - } - }, - "node_modules/ent": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/ent/-/ent-2.2.0.tgz", - "integrity": "sha512-GHrMyVZQWvTIdDtpiEXdHZnFQKzeO09apj8Cbl4pKWy4i0Oprcq17usfDt5aO63swf0JOeMWjWQE/LzgSRuWpA==", - "optional": true - }, - "node_modules/entities": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/entities/-/entities-2.1.0.tgz", - "integrity": "sha512-hCx1oky9PFrJ611mf0ifBLBRW8lUUVRlFolb5gWRfIELabBlbp9xZvrqZLZAs+NxFnbfQoeGd8wDkygjg7U85w==", - "optional": true, - "funding": { - "url": "https://github.com/fb55/entities?sponsor=1" - } - }, - "node_modules/escalade": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", - "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", - "optional": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/escape-string-regexp": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz", - "integrity": "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==", - "optional": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/escodegen": { - "version": "1.14.3", - "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.14.3.tgz", - "integrity": "sha512-qFcX0XJkdg+PB3xjZZG/wKSuT1PnQWx57+TVSjIMmILd2yC/6ByYElPwJnslDsuWuSAp4AwJGumarAAmJch5Kw==", - "optional": true, - "dependencies": { - "esprima": "^4.0.1", - "estraverse": "^4.2.0", - "esutils": "^2.0.2", - "optionator": "^0.8.1" - }, - "bin": { - "escodegen": "bin/escodegen.js", - "esgenerate": "bin/esgenerate.js" - }, - "engines": { - "node": ">=4.0" - }, - "optionalDependencies": { - "source-map": "~0.6.1" - } - }, - "node_modules/escodegen/node_modules/estraverse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", - "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", - "optional": true, - "engines": { - "node": ">=4.0" - } - }, - "node_modules/eslint-visitor-keys": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.3.0.tgz", - "integrity": "sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA==", - "optional": true, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - } - }, - "node_modules/espree": { - "version": "9.4.1", - "resolved": "https://registry.npmjs.org/espree/-/espree-9.4.1.tgz", - "integrity": "sha512-XwctdmTO6SIvCzd9810yyNzIrOrqNYV9Koizx4C/mRhf9uq0o4yHoCEU/670pOxOL/MSraektvSAji79kX90Vg==", - "optional": true, - "dependencies": { - "acorn": "^8.8.0", - "acorn-jsx": "^5.3.2", - "eslint-visitor-keys": "^3.3.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "node_modules/esprima": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", - "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", - "optional": true, - "bin": { - "esparse": "bin/esparse.js", - "esvalidate": "bin/esvalidate.js" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/estraverse": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", - "optional": true, - "engines": { - "node": ">=4.0" - } - }, - "node_modules/esutils": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", - "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", - "optional": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/event-target-shim": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz", - "integrity": "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==", - "optional": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/extend": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", - "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", - "optional": true - }, - "node_modules/fast-deep-equal": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", - "optional": true - }, - "node_modules/fast-levenshtein": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", - "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", - "optional": true - }, - "node_modules/fast-text-encoding": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/fast-text-encoding/-/fast-text-encoding-1.0.6.tgz", - "integrity": "sha512-VhXlQgj9ioXCqGstD37E/HBeqEGV/qOD/kmbVG8h5xKBYvM1L3lR1Zn4555cQ8GkYbJa8aJSipLPndE1k6zK2w==", - "optional": true - }, - "node_modules/faye-websocket": { - "version": "0.11.4", - "resolved": "https://registry.npmjs.org/faye-websocket/-/faye-websocket-0.11.4.tgz", - "integrity": "sha512-CzbClwlXAuiRQAlUyfqPgvPoNKTckTPGfwZV4ZdAhVcP2lh9KUxJg2b5GkE7XbjKQ3YJnQ9z6D9ntLAlB+tP8g==", - "dependencies": { - "websocket-driver": ">=0.5.1" - }, - "engines": { - "node": ">=0.8.0" - } - }, - "node_modules/firebase-admin": { - "version": "11.3.0", - "resolved": "https://registry.npmjs.org/firebase-admin/-/firebase-admin-11.3.0.tgz", - "integrity": "sha512-8ENXUu9Lm6YTc5zzOqlF222M/KwsV/EDZ5UwwPPEU5XfCa1Ebj7K/SgLFdinjGu1NxkSnqu07UDpPhmAtW3b5w==", - "dependencies": { - "@fastify/busboy": "^1.1.0", - "@firebase/database-compat": "^0.2.6", - "@firebase/database-types": "^0.9.13", - "@types/node": ">=12.12.47", - "jsonwebtoken": "^8.5.1", - "jwks-rsa": "^2.1.4", - "node-forge": "^1.3.1", - "uuid": "^9.0.0" - }, - "engines": { - "node": ">=14" - }, - "optionalDependencies": { - "@google-cloud/firestore": "^6.4.0", - "@google-cloud/storage": "^6.5.2" - } - }, - "node_modules/fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", - "optional": true - }, - "node_modules/functional-red-black-tree": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", - "integrity": "sha512-dsKNQNdj6xA3T+QlADDA7mOSlX0qiMINjn0cgr+eGHGsbSHzTabcIogz2+p/iqP1Xs6EP/sS2SbqH+brGTbq0g==", - "optional": true - }, - "node_modules/gaxios": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/gaxios/-/gaxios-5.0.2.tgz", - "integrity": "sha512-TjtV2AJOZoMQqRYoy5eM8cCQogYwazWNYLQ72QB0kwa6vHHruYkGmhhyrlzbmgNHK1dNnuP2WSH81urfzyN2Og==", - "optional": true, - "dependencies": { - "extend": "^3.0.2", - "https-proxy-agent": "^5.0.0", - "is-stream": "^2.0.0", - "node-fetch": "^2.6.7" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/gcp-metadata": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/gcp-metadata/-/gcp-metadata-5.0.1.tgz", - "integrity": "sha512-jiRJ+Fk7e8FH68Z6TLaqwea307OktJpDjmYnU7/li6ziwvVvU2RlrCyQo5vkdeP94chm0kcSCOOszvmuaioq3g==", - "optional": true, - "dependencies": { - "gaxios": "^5.0.0", - "json-bigint": "^1.0.0" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/get-caller-file": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", - "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", - "optional": true, - "engines": { - "node": "6.* || 8.* || >= 10.*" - } - }, - "node_modules/glob": { - "version": "8.0.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-8.0.3.tgz", - "integrity": "sha512-ull455NHSHI/Y1FqGaaYFaLGkNMMJbavMrEGFXG/PGrg6y7sutWHUHrz6gy6WEBH6akM1M414dWKCNs+IhKdiQ==", - "optional": true, - "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^5.0.1", - "once": "^1.3.0" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/google-auth-library": { - "version": "8.7.0", - "resolved": "https://registry.npmjs.org/google-auth-library/-/google-auth-library-8.7.0.tgz", - "integrity": "sha512-1M0NG5VDIvJZEnstHbRdckLZESoJwguinwN8Dhae0j2ZKIQFIV63zxm6Fo6nM4xkgqUr2bbMtV5Dgo+Hy6oo0Q==", - "optional": true, - "dependencies": { - "arrify": "^2.0.0", - "base64-js": "^1.3.0", - "ecdsa-sig-formatter": "^1.0.11", - "fast-text-encoding": "^1.0.0", - "gaxios": "^5.0.0", - "gcp-metadata": "^5.0.0", - "gtoken": "^6.1.0", - "jws": "^4.0.0", - "lru-cache": "^6.0.0" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/google-gax": { - "version": "3.5.2", - "resolved": "https://registry.npmjs.org/google-gax/-/google-gax-3.5.2.tgz", - "integrity": "sha512-AyP53w0gHcWlzxm+jSgqCR3Xu4Ld7EpSjhtNBnNhzwwWaIUyphH9kBGNIEH+i4UGkTUXOY29K/Re8EiAvkBRGw==", - "optional": true, - "dependencies": { - "@grpc/grpc-js": "~1.7.0", - "@grpc/proto-loader": "^0.7.0", - "@types/long": "^4.0.0", - "abort-controller": "^3.0.0", - "duplexify": "^4.0.0", - "fast-text-encoding": "^1.0.3", - "google-auth-library": "^8.0.2", - "is-stream-ended": "^0.1.4", - "node-fetch": "^2.6.1", - "object-hash": "^3.0.0", - "proto3-json-serializer": "^1.0.0", - "protobufjs": "7.1.2", - "protobufjs-cli": "1.0.2", - "retry-request": "^5.0.0" - }, - "bin": { - "compileProtos": "build/tools/compileProtos.js", - "minifyProtoJson": "build/tools/minify.js" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/google-p12-pem": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/google-p12-pem/-/google-p12-pem-4.0.1.tgz", - "integrity": "sha512-WPkN4yGtz05WZ5EhtlxNDWPhC4JIic6G8ePitwUWy4l+XPVYec+a0j0Ts47PDtW59y3RwAhUd9/h9ZZ63px6RQ==", - "optional": true, - "dependencies": { - "node-forge": "^1.3.1" - }, - "bin": { - "gp12-pem": "build/src/bin/gp12-pem.js" - }, - "engines": { - "node": ">=12.0.0" - } - }, - "node_modules/graceful-fs": { - "version": "4.2.10", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz", - "integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==", - "optional": true - }, - "node_modules/gtoken": { - "version": "6.1.2", - "resolved": "https://registry.npmjs.org/gtoken/-/gtoken-6.1.2.tgz", - "integrity": "sha512-4ccGpzz7YAr7lxrT2neugmXQ3hP9ho2gcaityLVkiUecAiwiy60Ii8gRbZeOsXV19fYaRjgBSshs8kXw+NKCPQ==", - "optional": true, - "dependencies": { - "gaxios": "^5.0.1", - "google-p12-pem": "^4.0.0", - "jws": "^4.0.0" - }, - "engines": { - "node": ">=12.0.0" - } - }, - "node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "optional": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/http-parser-js": { - "version": "0.5.8", - "resolved": "https://registry.npmjs.org/http-parser-js/-/http-parser-js-0.5.8.tgz", - "integrity": "sha512-SGeBX54F94Wgu5RH3X5jsDtf4eHyRogWX1XGT3b4HuW3tQPM4AaBzoUji/4AAJNXCEOWZ5O0DgZmJw1947gD5Q==" - }, - "node_modules/http-proxy-agent": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-5.0.0.tgz", - "integrity": "sha512-n2hY8YdoRE1i7r6M0w9DIw5GgZN0G25P8zLCRQ8rjXtTU3vsNFBI/vWK/UIeE6g5MUUz6avwAPXmL6Fy9D/90w==", - "optional": true, - "dependencies": { - "@tootallnate/once": "2", - "agent-base": "6", - "debug": "4" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/https-proxy-agent": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", - "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", - "optional": true, - "dependencies": { - "agent-base": "6", - "debug": "4" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", - "optional": true, - "dependencies": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "node_modules/inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "optional": true - }, - "node_modules/is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "optional": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/is-stream": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", - "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", - "optional": true, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/is-stream-ended": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/is-stream-ended/-/is-stream-ended-0.1.4.tgz", - "integrity": "sha512-xj0XPvmr7bQFTvirqnFr50o0hQIh6ZItDqloxt5aJrR4NQsYeSsyFQERYGCAzfindAcnKjINnwEEgLx4IqVzQw==", - "optional": true - }, - "node_modules/jose": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/jose/-/jose-2.0.6.tgz", - "integrity": "sha512-FVoPY7SflDodE4lknJmbAHSUjLCzE2H1F6MS0RYKMQ8SR+lNccpMf8R4eqkNYyyUjR5qZReOzZo5C5YiHOCjjg==", - "dependencies": { - "@panva/asn1.js": "^1.0.0" - }, - "engines": { - "node": ">=10.13.0 < 13 || >=13.7.0" - }, - "funding": { - "url": "https://github.com/sponsors/panva" - } - }, - "node_modules/js2xmlparser": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/js2xmlparser/-/js2xmlparser-4.0.2.tgz", - "integrity": "sha512-6n4D8gLlLf1n5mNLQPRfViYzu9RATblzPEtm1SthMX1Pjao0r9YI9nw7ZIfRxQMERS87mcswrg+r/OYrPRX6jA==", - "optional": true, - "dependencies": { - "xmlcreate": "^2.0.4" - } - }, - "node_modules/jsdoc": { - "version": "3.6.11", - "resolved": "https://registry.npmjs.org/jsdoc/-/jsdoc-3.6.11.tgz", - "integrity": "sha512-8UCU0TYeIYD9KeLzEcAu2q8N/mx9O3phAGl32nmHlE0LpaJL71mMkP4d+QE5zWfNt50qheHtOZ0qoxVrsX5TUg==", - "optional": true, - "dependencies": { - "@babel/parser": "^7.9.4", - "@types/markdown-it": "^12.2.3", - "bluebird": "^3.7.2", - "catharsis": "^0.9.0", - "escape-string-regexp": "^2.0.0", - "js2xmlparser": "^4.0.2", - "klaw": "^3.0.0", - "markdown-it": "^12.3.2", - "markdown-it-anchor": "^8.4.1", - "marked": "^4.0.10", - "mkdirp": "^1.0.4", - "requizzle": "^0.2.3", - "strip-json-comments": "^3.1.0", - "taffydb": "2.6.2", - "underscore": "~1.13.2" - }, - "bin": { - "jsdoc": "jsdoc.js" - }, - "engines": { - "node": ">=12.0.0" - } - }, - "node_modules/json-bigint": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/json-bigint/-/json-bigint-1.0.0.tgz", - "integrity": "sha512-SiPv/8VpZuWbvLSMtTDU8hEfrZWg/mH/nV/b4o0CYbSxu1UIQPLdwKOCIyLQX+VIPO5vrLX3i8qtqFyhdPSUSQ==", - "optional": true, - "dependencies": { - "bignumber.js": "^9.0.0" - } - }, - "node_modules/jsonwebtoken": { - "version": "8.5.1", - "resolved": "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-8.5.1.tgz", - "integrity": "sha512-XjwVfRS6jTMsqYs0EsuJ4LGxXV14zQybNd4L2r0UvbVnSF9Af8x7p5MzbJ90Ioz/9TI41/hTCvznF/loiSzn8w==", - "dependencies": { - "jws": "^3.2.2", - "lodash.includes": "^4.3.0", - "lodash.isboolean": "^3.0.3", - "lodash.isinteger": "^4.0.4", - "lodash.isnumber": "^3.0.3", - "lodash.isplainobject": "^4.0.6", - "lodash.isstring": "^4.0.1", - "lodash.once": "^4.0.0", - "ms": "^2.1.1", - "semver": "^5.6.0" - }, - "engines": { - "node": ">=4", - "npm": ">=1.4.28" - } - }, - "node_modules/jsonwebtoken/node_modules/jwa": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/jwa/-/jwa-1.4.1.tgz", - "integrity": "sha512-qiLX/xhEEFKUAJ6FiBMbes3w9ATzyk5W7Hvzpa/SLYdxNtng+gcurvrI7TbACjIXlsJyr05/S1oUhZrc63evQA==", - "dependencies": { - "buffer-equal-constant-time": "1.0.1", - "ecdsa-sig-formatter": "1.0.11", - "safe-buffer": "^5.0.1" - } - }, - "node_modules/jsonwebtoken/node_modules/jws": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/jws/-/jws-3.2.2.tgz", - "integrity": "sha512-YHlZCB6lMTllWDtSPHz/ZXTsi8S00usEV6v1tjq8tOUZzw7DpSDWVXjXDre6ed1w/pd495ODpHZYSdkRTsa0HA==", - "dependencies": { - "jwa": "^1.4.1", - "safe-buffer": "^5.0.1" - } - }, - "node_modules/jwa": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/jwa/-/jwa-2.0.0.tgz", - "integrity": "sha512-jrZ2Qx916EA+fq9cEAeCROWPTfCwi1IVHqT2tapuqLEVVDKFDENFw1oL+MwrTvH6msKxsd1YTDVw6uKEcsrLEA==", - "optional": true, - "dependencies": { - "buffer-equal-constant-time": "1.0.1", - "ecdsa-sig-formatter": "1.0.11", - "safe-buffer": "^5.0.1" - } - }, - "node_modules/jwks-rsa": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/jwks-rsa/-/jwks-rsa-2.1.5.tgz", - "integrity": "sha512-IODtn1SwEm7n6GQZnQLY0oxKDrMh7n/jRH1MzE8mlxWMrh2NnMyOsXTebu8vJ1qCpmuTJcL4DdiE0E4h8jnwsA==", - "dependencies": { - "@types/express": "^4.17.14", - "@types/jsonwebtoken": "^8.5.9", - "debug": "^4.3.4", - "jose": "^2.0.6", - "limiter": "^1.1.5", - "lru-memoizer": "^2.1.4" - }, - "engines": { - "node": ">=10 < 13 || >=14" - } - }, - "node_modules/jws": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/jws/-/jws-4.0.0.tgz", - "integrity": "sha512-KDncfTmOZoOMTFG4mBlG0qUIOlc03fmzH+ru6RgYVZhPkyiy/92Owlt/8UEN+a4TXR1FQetfIpJE8ApdvdVxTg==", - "optional": true, - "dependencies": { - "jwa": "^2.0.0", - "safe-buffer": "^5.0.1" - } - }, - "node_modules/klaw": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/klaw/-/klaw-3.0.0.tgz", - "integrity": "sha512-0Fo5oir+O9jnXu5EefYbVK+mHMBeEVEy2cmctR1O1NECcCkPRreJKrS6Qt/j3KC2C148Dfo9i3pCmCMsdqGr0g==", - "optional": true, - "dependencies": { - "graceful-fs": "^4.1.9" - } - }, - "node_modules/levn": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", - "integrity": "sha512-0OO4y2iOHix2W6ujICbKIaEQXvFQHue65vUG3pb5EUomzPI90z9hsA1VsO/dbIIpC53J8gxM9Q4Oho0jrCM/yA==", - "optional": true, - "dependencies": { - "prelude-ls": "~1.1.2", - "type-check": "~0.3.2" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/limiter": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/limiter/-/limiter-1.1.5.tgz", - "integrity": "sha512-FWWMIEOxz3GwUI4Ts/IvgVy6LPvoMPgjMdQ185nN6psJyBJ4yOpzqm695/h5umdLJg2vW3GR5iG11MAkR2AzJA==" - }, - "node_modules/linkify-it": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-3.0.3.tgz", - "integrity": "sha512-ynTsyrFSdE5oZ/O9GEf00kPngmOfVwazR5GKDq6EYfhlpFug3J2zybX56a2PRRpc9P+FuSoGNAwjlbDs9jJBPQ==", - "optional": true, - "dependencies": { - "uc.micro": "^1.0.1" - } - }, - "node_modules/lodash": { - "version": "4.17.21", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", - "optional": true - }, - "node_modules/lodash.camelcase": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz", - "integrity": "sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA==", - "optional": true - }, - "node_modules/lodash.clonedeep": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz", - "integrity": "sha512-H5ZhCF25riFd9uB5UCkVKo61m3S/xZk1x4wA6yp/L3RFP6Z/eHH1ymQcGLo7J3GMPfm0V/7m1tryHuGVxpqEBQ==" - }, - "node_modules/lodash.includes": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/lodash.includes/-/lodash.includes-4.3.0.tgz", - "integrity": "sha512-W3Bx6mdkRTGtlJISOvVD/lbqjTlPPUDTMnlXZFnVwi9NKJ6tiAk6LVdlhZMm17VZisqhKcgzpO5Wz91PCt5b0w==" - }, - "node_modules/lodash.isboolean": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/lodash.isboolean/-/lodash.isboolean-3.0.3.tgz", - "integrity": "sha512-Bz5mupy2SVbPHURB98VAcw+aHh4vRV5IPNhILUCsOzRmsTmSQ17jIuqopAentWoehktxGd9e/hbIXq980/1QJg==" - }, - "node_modules/lodash.isinteger": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/lodash.isinteger/-/lodash.isinteger-4.0.4.tgz", - "integrity": "sha512-DBwtEWN2caHQ9/imiNeEA5ys1JoRtRfY3d7V9wkqtbycnAmTvRRmbHKDV4a0EYc678/dia0jrte4tjYwVBaZUA==" - }, - "node_modules/lodash.isnumber": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/lodash.isnumber/-/lodash.isnumber-3.0.3.tgz", - "integrity": "sha512-QYqzpfwO3/CWf3XP+Z+tkQsfaLL/EnUlXWVkIk5FUPc4sBdTehEqZONuyRt2P67PXAk+NXmTBcc97zw9t1FQrw==" - }, - "node_modules/lodash.isplainobject": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz", - "integrity": "sha512-oSXzaWypCMHkPC3NvBEaPHf0KsA5mvPrOPgQWDsbg8n7orZ290M0BmC/jgRZ4vcJ6DTAhjrsSYgdsW/F+MFOBA==" - }, - "node_modules/lodash.isstring": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/lodash.isstring/-/lodash.isstring-4.0.1.tgz", - "integrity": "sha512-0wJxfxH1wgO3GrbuP+dTTk7op+6L41QCXbGINEmD+ny/G/eCqGzxyCsh7159S+mgDDcoarnBw6PC1PS5+wUGgw==" - }, - "node_modules/lodash.once": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/lodash.once/-/lodash.once-4.1.1.tgz", - "integrity": "sha512-Sb487aTOCr9drQVL8pIxOzVhafOjZN9UU54hiN8PU3uAiSV7lx1yYNpbNmex2PK6dSJoNTSJUUswT651yww3Mg==" - }, - "node_modules/long": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/long/-/long-4.0.0.tgz", - "integrity": "sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==", - "optional": true - }, - "node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "optional": true, - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/lru-memoizer": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/lru-memoizer/-/lru-memoizer-2.1.4.tgz", - "integrity": "sha512-IXAq50s4qwrOBrXJklY+KhgZF+5y98PDaNo0gi/v2KQBFLyWr+JyFvijZXkGKjQj/h9c0OwoE+JZbwUXce76hQ==", - "dependencies": { - "lodash.clonedeep": "^4.5.0", - "lru-cache": "~4.0.0" - } - }, - "node_modules/lru-memoizer/node_modules/lru-cache": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.0.2.tgz", - "integrity": "sha512-uQw9OqphAGiZhkuPlpFGmdTU2tEuhxTourM/19qGJrxBPHAr/f8BT1a0i/lOclESnGatdJG/UCkP9kZB/Lh1iw==", - "dependencies": { - "pseudomap": "^1.0.1", - "yallist": "^2.0.0" - } - }, - "node_modules/lru-memoizer/node_modules/yallist": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", - "integrity": "sha512-ncTzHV7NvsQZkYe1DW7cbDLm0YpzHmZF5r/iyP3ZnQtMiJ+pjzisCiMNI+Sj+xQF5pXhSHxSB3uDbsBTzY/c2A==" - }, - "node_modules/markdown-it": { - "version": "12.3.2", - "resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-12.3.2.tgz", - "integrity": "sha512-TchMembfxfNVpHkbtriWltGWc+m3xszaRD0CZup7GFFhzIgQqxIfn3eGj1yZpfuflzPvfkt611B2Q/Bsk1YnGg==", - "optional": true, - "dependencies": { - "argparse": "^2.0.1", - "entities": "~2.1.0", - "linkify-it": "^3.0.1", - "mdurl": "^1.0.1", - "uc.micro": "^1.0.5" - }, - "bin": { - "markdown-it": "bin/markdown-it.js" - } - }, - "node_modules/markdown-it-anchor": { - "version": "8.6.5", - "resolved": "https://registry.npmjs.org/markdown-it-anchor/-/markdown-it-anchor-8.6.5.tgz", - "integrity": "sha512-PI1qEHHkTNWT+X6Ip9w+paonfIQ+QZP9sCeMYi47oqhH+EsW8CrJ8J7CzV19QVOj6il8ATGbK2nTECj22ZHGvQ==", - "optional": true, - "peerDependencies": { - "@types/markdown-it": "*", - "markdown-it": "*" - } - }, - "node_modules/marked": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/marked/-/marked-4.2.3.tgz", - "integrity": "sha512-slWRdJkbTZ+PjkyJnE30Uid64eHwbwa1Q25INCAYfZlK4o6ylagBy/Le9eWntqJFoFT93ikUKMv47GZ4gTwHkw==", - "optional": true, - "bin": { - "marked": "bin/marked.js" - }, - "engines": { - "node": ">= 12" - } - }, - "node_modules/mdurl": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/mdurl/-/mdurl-1.0.1.tgz", - "integrity": "sha512-/sKlQJCBYVY9Ers9hqzKou4H6V5UWc/M59TH2dvkt+84itfnq7uFOMLpOiOS4ujvHP4etln18fmIxA5R5fll0g==", - "optional": true - }, - "node_modules/mime": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/mime/-/mime-3.0.0.tgz", - "integrity": "sha512-jSCU7/VB1loIWBZe14aEYHU/+1UMEHoaO7qxCOVJOw9GgH72VAWppxNcjU+x9a2k3GSIBXNKxXQFqRvvZ7vr3A==", - "optional": true, - "bin": { - "mime": "cli.js" - }, - "engines": { - "node": ">=10.0.0" - } - }, - "node_modules/mime-db": { - "version": "1.52.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", - "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", - "optional": true, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/mime-types": { - "version": "2.1.35", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", - "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", - "optional": true, - "dependencies": { - "mime-db": "1.52.0" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/minimatch": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.0.tgz", - "integrity": "sha512-9TPBGGak4nHfGZsPBohm9AWg6NoT7QTCehS3BIJABslyZbzxfV78QM2Y6+i741OPZIafFAaiiEMh5OyIrJPgtg==", - "optional": true, - "dependencies": { - "brace-expansion": "^2.0.1" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/minimist": { - "version": "1.2.7", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.7.tgz", - "integrity": "sha512-bzfL1YUZsP41gmu/qjrEk0Q6i2ix/cVeAhbCbqH9u3zYutS1cLg00qhrD0M2MVdCcx4Sc0UpP2eBWo9rotpq6g==", - "optional": true, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/mkdirp": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", - "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", - "optional": true, - "bin": { - "mkdirp": "bin/cmd.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" - }, - "node_modules/node-fetch": { - "version": "2.6.7", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", - "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", - "optional": true, - "dependencies": { - "whatwg-url": "^5.0.0" - }, - "engines": { - "node": "4.x || >=6.0.0" - }, - "peerDependencies": { - "encoding": "^0.1.0" - }, - "peerDependenciesMeta": { - "encoding": { - "optional": true - } - } - }, - "node_modules/node-forge": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-1.3.1.tgz", - "integrity": "sha512-dPEtOeMvF9VMcYV/1Wb8CPoVAXtp6MKMlcbAt4ddqmGqUJ6fQZFXkNZNkNlfevtNkGtaSoXf/vNNNSvgrdXwtA==", - "engines": { - "node": ">= 6.13.0" - } - }, - "node_modules/object-hash": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/object-hash/-/object-hash-3.0.0.tgz", - "integrity": "sha512-RSn9F68PjH9HqtltsSnqYC1XXoWe9Bju5+213R98cNGttag9q9yAOTzdbsqvIa7aNm5WffBZFpWYr2aWrklWAw==", - "optional": true, - "engines": { - "node": ">= 6" - } - }, - "node_modules/once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", - "optional": true, - "dependencies": { - "wrappy": "1" - } - }, - "node_modules/optionator": { - "version": "0.8.3", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz", - "integrity": "sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==", - "optional": true, - "dependencies": { - "deep-is": "~0.1.3", - "fast-levenshtein": "~2.0.6", - "levn": "~0.3.0", - "prelude-ls": "~1.1.2", - "type-check": "~0.3.2", - "word-wrap": "~1.2.3" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/p-limit": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", - "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", - "optional": true, - "dependencies": { - "yocto-queue": "^0.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", - "optional": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/prelude-ls": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", - "integrity": "sha512-ESF23V4SKG6lVSGZgYNpbsiaAkdab6ZgOxe52p7+Kid3W3u3bxR4Vfd/o21dmN7jSt0IwgZ4v5MUd26FEtXE9w==", - "optional": true, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/proto3-json-serializer": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/proto3-json-serializer/-/proto3-json-serializer-1.1.0.tgz", - "integrity": "sha512-SjXwUWe/vANGs/mJJTbw5++7U67nwsymg7qsoPtw6GiXqw3kUy8ByojrlEdVE2efxAdKreX8WkDafxvYW95ZQg==", - "optional": true, - "dependencies": { - "protobufjs": "^7.0.0" - }, - "engines": { - "node": ">=12.0.0" - } - }, - "node_modules/protobufjs": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.1.2.tgz", - "integrity": "sha512-4ZPTPkXCdel3+L81yw3dG6+Kq3umdWKh7Dc7GW/CpNk4SX3hK58iPCWeCyhVTDrbkNeKrYNZ7EojM5WDaEWTLQ==", - "hasInstallScript": true, - "optional": true, - "dependencies": { - "@protobufjs/aspromise": "^1.1.2", - "@protobufjs/base64": "^1.1.2", - "@protobufjs/codegen": "^2.0.4", - "@protobufjs/eventemitter": "^1.1.0", - "@protobufjs/fetch": "^1.1.0", - "@protobufjs/float": "^1.0.2", - "@protobufjs/inquire": "^1.1.0", - "@protobufjs/path": "^1.1.2", - "@protobufjs/pool": "^1.1.0", - "@protobufjs/utf8": "^1.1.0", - "@types/node": ">=13.7.0", - "long": "^5.0.0" - }, - "engines": { - "node": ">=12.0.0" - } - }, - "node_modules/protobufjs-cli": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/protobufjs-cli/-/protobufjs-cli-1.0.2.tgz", - "integrity": "sha512-cz9Pq9p/Zs7okc6avH20W7QuyjTclwJPgqXG11jNaulfS3nbVisID8rC+prfgq0gbZE0w9LBFd1OKFF03kgFzg==", - "optional": true, - "dependencies": { - "chalk": "^4.0.0", - "escodegen": "^1.13.0", - "espree": "^9.0.0", - "estraverse": "^5.1.0", - "glob": "^8.0.0", - "jsdoc": "^3.6.3", - "minimist": "^1.2.0", - "semver": "^7.1.2", - "tmp": "^0.2.1", - "uglify-js": "^3.7.7" - }, - "bin": { - "pbjs": "bin/pbjs", - "pbts": "bin/pbts" - }, - "engines": { - "node": ">=12.0.0" - }, - "peerDependencies": { - "protobufjs": "^7.0.0" - } - }, - "node_modules/protobufjs-cli/node_modules/semver": { - "version": "7.3.8", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", - "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", - "optional": true, - "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/protobufjs/node_modules/long": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/long/-/long-5.2.1.tgz", - "integrity": "sha512-GKSNGeNAtw8IryjjkhZxuKB3JzlcLTwjtiQCHKvqQet81I93kXslhDQruGI/QsddO83mcDToBVy7GqGS/zYf/A==", - "optional": true - }, - "node_modules/pseudomap": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", - "integrity": "sha512-b/YwNhb8lk1Zz2+bXXpS/LK9OisiZZ1SNsSLxN1x2OXVEhW2Ckr/7mWE5vrC1ZTiJlD9g19jWszTmJsB+oEpFQ==" - }, - "node_modules/readable-stream": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", - "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", - "optional": true, - "dependencies": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/require-directory": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", - "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", - "optional": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/requizzle": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/requizzle/-/requizzle-0.2.3.tgz", - "integrity": "sha512-YanoyJjykPxGHii0fZP0uUPEXpvqfBDxWV7s6GKAiiOsiqhX6vHNyW3Qzdmqp/iq/ExbhaGbVrjB4ruEVSM4GQ==", - "optional": true, - "dependencies": { - "lodash": "^4.17.14" - } - }, - "node_modules/retry": { - "version": "0.13.1", - "resolved": "https://registry.npmjs.org/retry/-/retry-0.13.1.tgz", - "integrity": "sha512-XQBQ3I8W1Cge0Seh+6gjj03LbmRFWuoszgK9ooCpwYIrhhoO80pfq4cUkU5DkknwfOfFteRwlZ56PYOGYyFWdg==", - "optional": true, - "engines": { - "node": ">= 4" - } - }, - "node_modules/retry-request": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/retry-request/-/retry-request-5.0.2.tgz", - "integrity": "sha512-wfI3pk7EE80lCIXprqh7ym48IHYdwmAAzESdbU8Q9l7pnRCk9LEhpbOTNKjz6FARLm/Bl5m+4F0ABxOkYUujSQ==", - "optional": true, - "dependencies": { - "debug": "^4.1.1", - "extend": "^3.0.2" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "optional": true, - "dependencies": { - "glob": "^7.1.3" - }, - "bin": { - "rimraf": "bin.js" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/rimraf/node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "optional": true, - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "node_modules/rimraf/node_modules/glob": { - "version": "7.2.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", - "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", - "optional": true, - "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.1.1", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - }, - "engines": { - "node": "*" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/rimraf/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "optional": true, - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, - "node_modules/safe-buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "bin": { - "semver": "bin/semver" - } - }, - "node_modules/source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "optional": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/stream-events": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/stream-events/-/stream-events-1.0.5.tgz", - "integrity": "sha512-E1GUzBSgvct8Jsb3v2X15pjzN1tYebtbLaMg+eBOUOAxgbLoSbT2NS91ckc5lJD1KfLjId+jXJRgo0qnV5Nerg==", - "optional": true, - "dependencies": { - "stubs": "^3.0.0" - } - }, - "node_modules/stream-shift": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.1.tgz", - "integrity": "sha512-AiisoFqQ0vbGcZgQPY1cdP2I76glaVA/RauYR4G4thNFgkTqr90yXTo4LYX60Jl+sIlPNHHdGSwo01AvbKUSVQ==", - "optional": true - }, - "node_modules/string_decoder": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", - "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", - "optional": true, - "dependencies": { - "safe-buffer": "~5.2.0" - } - }, - "node_modules/string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "optional": true, - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "optional": true, - "dependencies": { - "ansi-regex": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/strip-json-comments": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", - "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", - "optional": true, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/stubs": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/stubs/-/stubs-3.0.0.tgz", - "integrity": "sha512-PdHt7hHUJKxvTCgbKX9C1V/ftOcjJQgz8BZwNfV5c4B6dcGqlpelTbJ999jBGZ2jYiPAwcX5dP6oBwVlBlUbxw==", - "optional": true - }, - "node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "optional": true, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/taffydb": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/taffydb/-/taffydb-2.6.2.tgz", - "integrity": "sha512-y3JaeRSplks6NYQuCOj3ZFMO3j60rTwbuKCvZxsAraGYH2epusatvZ0baZYA01WsGqJBq/Dl6vOrMUJqyMj8kA==", - "optional": true - }, - "node_modules/teeny-request": { - "version": "8.0.2", - "resolved": "https://registry.npmjs.org/teeny-request/-/teeny-request-8.0.2.tgz", - "integrity": "sha512-34pe0a4zASseXZCKdeTiIZqSKA8ETHb1EwItZr01PAR3CLPojeAKgSjzeNS4373gi59hNulyDrPKEbh2zO9sCg==", - "optional": true, - "dependencies": { - "http-proxy-agent": "^5.0.0", - "https-proxy-agent": "^5.0.0", - "node-fetch": "^2.6.1", - "stream-events": "^1.0.5", - "uuid": "^9.0.0" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/text-decoding": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/text-decoding/-/text-decoding-1.0.0.tgz", - "integrity": "sha512-/0TJD42KDnVwKmDK6jj3xP7E2MG7SHAOG4tyTgyUCRPdHwvkquYNLEQltmdMa3owq3TkddCVcTsoctJI8VQNKA==" - }, - "node_modules/tmp": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.1.tgz", - "integrity": "sha512-76SUhtfqR2Ijn+xllcI5P1oyannHNHByD80W1q447gU3mp9G9PSpGdWmjUOHRDPiHYacIk66W7ubDTuPF3BEtQ==", - "optional": true, - "dependencies": { - "rimraf": "^3.0.0" - }, - "engines": { - "node": ">=8.17.0" - } - }, - "node_modules/tr46": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", - "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==", - "optional": true - }, - "node_modules/tslib": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.1.tgz", - "integrity": "sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA==" - }, - "node_modules/type-check": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", - "integrity": "sha512-ZCmOJdvOWDBYJlzAoFkC+Q0+bUyEOS1ltgp1MGU03fqHG+dbi9tBFU2Rd9QKiDZFAYrhPh2JUf7rZRIuHRKtOg==", - "optional": true, - "dependencies": { - "prelude-ls": "~1.1.2" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/uc.micro": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-1.0.6.tgz", - "integrity": "sha512-8Y75pvTYkLJW2hWQHXxoqRgV7qb9B+9vFEtidML+7koHUFapnVJAZ6cKs+Qjz5Aw3aZWHMC6u0wJE3At+nSGwA==", - "optional": true - }, - "node_modules/uglify-js": { - "version": "3.17.4", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.17.4.tgz", - "integrity": "sha512-T9q82TJI9e/C1TAxYvfb16xO120tMVFZrGA3f9/P4424DNu6ypK103y0GPFVa17yotwSyZW5iYXgjYHkGrJW/g==", - "optional": true, - "bin": { - "uglifyjs": "bin/uglifyjs" - }, - "engines": { - "node": ">=0.8.0" - } - }, - "node_modules/underscore": { - "version": "1.13.6", - "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.13.6.tgz", - "integrity": "sha512-+A5Sja4HP1M08MaXya7p5LvjuM7K6q/2EaC0+iovj/wOcMsTzMvDFbasi/oSapiwOlt252IqsKqPjCl7huKS0A==", - "optional": true - }, - "node_modules/util-deprecate": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", - "optional": true - }, - "node_modules/uuid": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.0.tgz", - "integrity": "sha512-MXcSTerfPa4uqyzStbRoTgt5XIe3x5+42+q1sDuy3R5MDk66URdLMOZe5aPX/SQd+kuYAh0FdP/pO28IkQyTeg==", - "bin": { - "uuid": "dist/bin/uuid" - } - }, - "node_modules/webidl-conversions": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", - "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==", - "optional": true - }, - "node_modules/websocket-driver": { - "version": "0.7.4", - "resolved": "https://registry.npmjs.org/websocket-driver/-/websocket-driver-0.7.4.tgz", - "integrity": "sha512-b17KeDIQVjvb0ssuSDF2cYXSg2iztliJ4B9WdsuB6J952qCPKmnVq4DyW5motImXHDC1cBT/1UezrJVsKw5zjg==", - "dependencies": { - "http-parser-js": ">=0.5.1", - "safe-buffer": ">=5.1.0", - "websocket-extensions": ">=0.1.1" - }, - "engines": { - "node": ">=0.8.0" - } - }, - "node_modules/websocket-extensions": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/websocket-extensions/-/websocket-extensions-0.1.4.tgz", - "integrity": "sha512-OqedPIGOfsDlo31UNwYbCFMSaO9m9G/0faIHj5/dZFDMFqPTcx6UwqyOy3COEaEOg/9VsGIpdqn62W5KhoKSpg==", - "engines": { - "node": ">=0.8.0" - } - }, - "node_modules/whatwg-url": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", - "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", - "optional": true, - "dependencies": { - "tr46": "~0.0.3", - "webidl-conversions": "^3.0.0" - } - }, - "node_modules/word-wrap": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", - "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", - "optional": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/wrap-ansi": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", - "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", - "optional": true, - "dependencies": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/wrap-ansi?sponsor=1" - } - }, - "node_modules/wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", - "optional": true - }, - "node_modules/xmlcreate": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/xmlcreate/-/xmlcreate-2.0.4.tgz", - "integrity": "sha512-nquOebG4sngPmGPICTS5EnxqhKbCmz5Ox5hsszI2T6U5qdrJizBc+0ilYSEjTSzU0yZcmvppztXe/5Al5fUwdg==", - "optional": true - }, - "node_modules/y18n": { - "version": "5.0.8", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", - "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", - "optional": true, - "engines": { - "node": ">=10" - } - }, - "node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "optional": true - }, - "node_modules/yargs": { - "version": "16.2.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", - "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", - "optional": true, - "dependencies": { - "cliui": "^7.0.2", - "escalade": "^3.1.1", - "get-caller-file": "^2.0.5", - "require-directory": "^2.1.1", - "string-width": "^4.2.0", - "y18n": "^5.0.5", - "yargs-parser": "^20.2.2" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/yargs-parser": { - "version": "20.2.9", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", - "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", - "optional": true, - "engines": { - "node": ">=10" - } - }, - "node_modules/yocto-queue": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", - "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", - "optional": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - } - } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@babel/parser/CHANGELOG.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/@babel/parser/CHANGELOG.md deleted file mode 100644 index b3840ac8..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@babel/parser/CHANGELOG.md +++ /dev/null @@ -1,1073 +0,0 @@ -# Changelog - -> **Tags:** -> - :boom: [Breaking Change] -> - :eyeglasses: [Spec Compliance] -> - :rocket: [New Feature] -> - :bug: [Bug Fix] -> - :memo: [Documentation] -> - :house: [Internal] -> - :nail_care: [Polish] - -> Semver Policy: https://github.com/babel/babel/tree/main/packages/babel-parser#semver - -_Note: Gaps between patch versions are faulty, broken or test releases._ - -See the [Babel Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md) for the pre-6.8.0 version Changelog. - -## 6.17.1 (2017-05-10) - -### :bug: Bug Fix - * Fix typo in flow spread operator error (Brian Ng) - * Fixed invalid number literal parsing ([#473](https://github.com/babel/babylon/pull/473)) (Alex Kuzmenko) - * Fix number parser ([#433](https://github.com/babel/babylon/pull/433)) (Alex Kuzmenko) - * Ensure non pattern shorthand props are checked for reserved words ([#479](https://github.com/babel/babylon/pull/479)) (Brian Ng) - * Remove jsx context when parsing arrow functions ([#475](https://github.com/babel/babylon/pull/475)) (Brian Ng) - * Allow super in class properties ([#499](https://github.com/babel/babylon/pull/499)) (Brian Ng) - * Allow flow class field to be named constructor ([#510](https://github.com/babel/babylon/pull/510)) (Brian Ng) - -## 6.17.0 (2017-04-20) - -### :bug: Bug Fix - * Cherry-pick #418 to 6.x ([#476](https://github.com/babel/babylon/pull/476)) (Sebastian McKenzie) - * Add support for invalid escapes in tagged templates ([#274](https://github.com/babel/babylon/pull/274)) (Kevin Gibbons) - * Throw error if new.target is used outside of a function ([#402](https://github.com/babel/babylon/pull/402)) (Brian Ng) - * Fix parsing of class properties ([#351](https://github.com/babel/babylon/pull/351)) (Kevin Gibbons) - * Fix parsing yield with dynamicImport ([#383](https://github.com/babel/babylon/pull/383)) (Brian Ng) - * Ensure consistent start args for parseParenItem ([#386](https://github.com/babel/babylon/pull/386)) (Brian Ng) - -## 7.0.0-beta.8 (2017-04-04) - -### New Feature -* Add support for flow type spread (#418) (Conrad Buck) -* Allow statics in flow interfaces (#427) (Brian Ng) - -### Bug Fix -* Fix predicate attachment to match flow parser (#428) (Brian Ng) -* Add extra.raw back to JSXText and JSXAttribute (#344) (Alex Rattray) -* Fix rest parameters with array and objects (#424) (Brian Ng) -* Fix number parser (#433) (Alex Kuzmenko) - -### Docs -* Fix CONTRIBUTING.md [skip ci] (#432) (Alex Kuzmenko) - -### Internal -* Use babel-register script when running babel smoke tests (#442) (Brian Ng) - -## 7.0.0-beta.7 (2017-03-22) - -### Spec Compliance -* Remove babylon plugin for template revision since it's stage-4 (#426) (Henry Zhu) - -### Bug Fix - -* Fix push-pop logic in flow (#405) (Daniel Tschinder) - -## 7.0.0-beta.6 (2017-03-21) - -### New Feature -* Add support for invalid escapes in tagged templates (#274) (Kevin Gibbons) - -### Polish -* Improves error message when super is called outside of constructor (#408) (Arshabh Kumar Agarwal) - -### Docs - -* [7.0] Moved value field in spec from ObjectMember to ObjectProperty as ObjectMethod's don't have it (#415) [skip ci] (James Browning) - -## 7.0.0-beta.5 (2017-03-21) - -### Bug Fix -* Throw error if new.target is used outside of a function (#402) (Brian Ng) -* Fix parsing of class properties (#351) (Kevin Gibbons) - -### Other - * Test runner: Detect extra property in 'actual' but not in 'expected'. (#407) (Andy) - * Optimize travis builds (#419) (Daniel Tschinder) - * Update codecov to 2.0 (#412) (Daniel Tschinder) - * Fix spec for ClassMethod: It doesn't have a function, it *is* a function. (#406) [skip ci] (Andy) - * Changed Non-existent RestPattern to RestElement which is what is actually parsed (#409) [skip ci] (James Browning) - * Upgrade flow to 0.41 (Daniel Tschinder) - * Fix watch command (#403) (Brian Ng) - * Update yarn lock (Daniel Tschinder) - * Fix watch command (#403) (Brian Ng) - * chore(package): update flow-bin to version 0.41.0 (#395) (greenkeeper[bot]) - * Add estree test for correct order of directives (Daniel Tschinder) - * Add DoExpression to spec (#364) (Alex Kuzmenko) - * Mention cloning of repository in CONTRIBUTING.md (#391) [skip ci] (Sumedh Nimkarde) - * Explain how to run only one test (#389) [skip ci] (Aaron Ang) - - ## 7.0.0-beta.4 (2017-03-01) - -* Don't consume async when checking for async func decl (#377) (Brian Ng) -* add `ranges` option [skip ci] (Henry Zhu) -* Don't parse class properties without initializers when classProperties is disabled and Flow is enabled (#300) (Andrew Levine) - -## 7.0.0-beta.3 (2017-02-28) - -- [7.0] Change RestProperty/SpreadProperty to RestElement/SpreadElement (#384) -- Merge changes from 6.x - -## 7.0.0-beta.2 (2017-02-20) - -- estree: correctly change literals in all cases (#368) (Daniel Tschinder) - -## 7.0.0-beta.1 (2017-02-20) - -- Fix negative number literal typeannotations (#366) (Daniel Tschinder) -- Update contributing with more test info [skip ci] (#355) (Brian Ng) - -## 7.0.0-beta.0 (2017-02-15) - -- Reintroduce Variance node (#333) (Daniel Tschinder) -- Rename NumericLiteralTypeAnnotation to NumberLiteralTypeAnnotation (#332) (Charles Pick) -- [7.0] Remove ForAwaitStatement, add await flag to ForOfStatement (#349) (Brandon Dail) -- chore(package): update ava to version 0.18.0 (#345) (greenkeeper[bot]) -- chore(package): update babel-plugin-istanbul to version 4.0.0 (#350) (greenkeeper[bot]) -- Change location of ObjectTypeIndexer to match flow (#228) (Daniel Tschinder) -- Rename flow AST Type ExistentialTypeParam to ExistsTypeAnnotation (#322) (Toru Kobayashi) -- Revert "Temporary rollback for erroring on trailing comma with spread (#154)" (#290) (Daniel Tschinder) -- Remove classConstructorCall plugin (#291) (Brian Ng) -- Update yarn.lock (Daniel Tschinder) -- Update cross-env to 3.x (Daniel Tschinder) -- [7.0] Remove node 0.10, 0.12 and 5 from Travis (#284) (Sergey Rubanov) -- Remove `String.fromCodePoint` shim (#279) (Mathias Bynens) - -## 6.16.1 (2017-02-23) - -### :bug: Regression - -- Revert "Fix export default async function to be FunctionDeclaration" ([#375](https://github.com/babel/babylon/pull/375)) - -Need to modify Babel for this AST node change, so moving to 7.0. - -- Revert "Don't parse class properties without initializers when classProperties plugin is disabled, and Flow is enabled" ([#376](https://github.com/babel/babylon/pull/376)) - -[react-native](https://github.com/facebook/react-native/issues/12542) broke with this so we reverted. - -## 6.16.0 (2017-02-23) - -### :rocket: New Feature - -***ESTree*** compatibility as plugin ([#277](https://github.com/babel/babylon/pull/277)) (Daniel Tschinder) - -We finally introduce a new compatibility layer for ESTree. To put babylon into ESTree-compatible mode the new plugin `estree` can be enabled. In this mode the parser will output an AST that is compliant to the specs of [ESTree](https://github.com/estree/estree/) - -We highly recommend everyone who uses babylon outside of babel to use this plugin. This will make it much easier for users to switch between different ESTree-compatible parsers. We so far tested several projects with different parsers and exchanged their parser to babylon and in nearly all cases it worked out of the box. Some other estree-compatible parsers include `acorn`, `esprima`, `espree`, `flow-parser`, etc. - -To enable `estree` mode simply add the plugin in the config: -```json -{ - "plugins": [ "estree" ] -} -``` - -If you want to migrate your project from non-ESTree mode to ESTree, have a look at our [Readme](https://github.com/babel/babylon/#output), where all deviations are mentioned. - -Add a parseExpression public method ([#213](https://github.com/babel/babylon/pull/213)) (jeromew) - -Babylon exports a new function to parse a single expression - -```js -import { parseExpression } from 'babylon'; - -const ast = parseExpression('x || y && z', options); -``` - -The returned AST will only consist of the expression. The options are the same as for `parse()` - -Add startLine option ([#346](https://github.com/babel/babylon/pull/346)) (Raphael Mu) - -A new option was added to babylon allowing to change the initial linenumber for the first line which is usually `1`. -Changing this for example to `100` will make line `1` of the input source to be marked as line `100`, line `2` as `101`, line `3` as `102`, ... - -Function predicate declaration ([#103](https://github.com/babel/babylon/pull/103)) (Panagiotis Vekris) - -Added support for function predicates which flow introduced in version 0.33.0 - -```js -declare function is_number(x: mixed): boolean %checks(typeof x === "number"); -``` - -Allow imports in declare module ([#315](https://github.com/babel/babylon/pull/315)) (Daniel Tschinder) - -Added support for imports within module declarations which flow introduced in version 0.37.0 - -```js -declare module "C" { - import type { DT } from "D"; - declare export type CT = { D: DT }; -} -``` - -### :eyeglasses: Spec Compliance - -Forbid semicolons after decorators in classes ([#352](https://github.com/babel/babylon/pull/352)) (Kevin Gibbons) - -This example now correctly throws an error when there is a semicolon after the decorator: - -```js -class A { -@a; -foo(){} -} -``` - -Keywords are not allowed as local specifier ([#307](https://github.com/babel/babylon/pull/307)) (Daniel Tschinder) - -Using keywords in imports is not allowed anymore: - -```js -import { default } from "foo"; -import { a as debugger } from "foo"; -``` - -Do not allow overwritting of primitive types ([#314](https://github.com/babel/babylon/pull/314)) (Daniel Tschinder) - -In flow it is now forbidden to overwrite the primitive types `"any"`, `"mixed"`, `"empty"`, `"bool"`, `"boolean"`, `"number"`, `"string"`, `"void"` and `"null"` with your own type declaration. - -Disallow import type { type a } from … ([#305](https://github.com/babel/babylon/pull/305)) (Daniel Tschinder) - -The following code now correctly throws an error - -```js -import type { type a } from "foo"; -``` - -Don't parse class properties without initializers when classProperties is disabled and Flow is enabled ([#300](https://github.com/babel/babylon/pull/300)) (Andrew Levine) - -Ensure that you enable the `classProperties` plugin in order to enable correct parsing of class properties. Prior to this version it was possible to parse them by enabling the `flow` plugin but this was not intended the behaviour. - -If you enable the flow plugin you can only define the type of the class properties, but not initialize them. - -Fix export default async function to be FunctionDeclaration ([#324](https://github.com/babel/babylon/pull/324)) (Daniel Tschinder) - -Parsing the following code now returns a `FunctionDeclaration` AST node instead of `FunctionExpression`. - -```js -export default async function bar() {}; -``` - -### :nail_care: Polish - -Improve error message on attempt to destructure named import ([#288](https://github.com/babel/babylon/pull/288)) (Brian Ng) - -### :bug: Bug Fix - -Fix negative number literal typeannotations ([#366](https://github.com/babel/babylon/pull/366)) (Daniel Tschinder) - -Ensure takeDecorators is called on exported class ([#358](https://github.com/babel/babylon/pull/358)) (Brian Ng) - -ESTree: correctly change literals in all cases ([#368](https://github.com/babel/babylon/pull/368)) (Daniel Tschinder) - -Correctly convert RestProperty to Assignable ([#339](https://github.com/babel/babylon/pull/339)) (Daniel Tschinder) - -Fix #321 by allowing question marks in type params ([#338](https://github.com/babel/babylon/pull/338)) (Daniel Tschinder) - -Fix #336 by correctly setting arrow-param ([#337](https://github.com/babel/babylon/pull/337)) (Daniel Tschinder) - -Fix parse error when destructuring `set` with default value ([#317](https://github.com/babel/babylon/pull/317)) (Brian Ng) - -Fix ObjectTypeCallProperty static ([#298](https://github.com/babel/babylon/pull/298)) (Dan Harper) - - -### :house: Internal - -Fix generator-method-with-computed-name spec ([#360](https://github.com/babel/babylon/pull/360)) (Alex Rattray) - -Fix flow type-parameter-declaration test with unintended semantic ([#361](https://github.com/babel/babylon/pull/361)) (Alex Rattray) - -Cleanup and splitup parser functions ([#295](https://github.com/babel/babylon/pull/295)) (Daniel Tschinder) - -chore(package): update flow-bin to version 0.38.0 ([#313](https://github.com/babel/babylon/pull/313)) (greenkeeper[bot]) - -Call inner function instead of 1:1 copy to plugin ([#294](https://github.com/babel/babylon/pull/294)) (Daniel Tschinder) - -Update eslint-config-babel to the latest version 🚀 ([#299](https://github.com/babel/babylon/pull/299)) (greenkeeper[bot]) - -Update eslint-config-babel to the latest version 🚀 ([#293](https://github.com/babel/babylon/pull/293)) (greenkeeper[bot]) - -devDeps: remove eslint-plugin-babel ([#292](https://github.com/babel/babylon/pull/292)) (Kai Cataldo) - -Correct indent eslint rule config ([#276](https://github.com/babel/babylon/pull/276)) (Daniel Tschinder) - -Fail tests that have expected.json and throws-option ([#285](https://github.com/babel/babylon/pull/285)) (Daniel Tschinder) - -### :memo: Documentation - -Update contributing with more test info [skip ci] ([#355](https://github.com/babel/babylon/pull/355)) (Brian Ng) - -Update API documentation ([#330](https://github.com/babel/babylon/pull/330)) (Timothy Gu) - -Added keywords to package.json ([#323](https://github.com/babel/babylon/pull/323)) (Dmytro) - -AST spec: fix casing of `RegExpLiteral` ([#318](https://github.com/babel/babylon/pull/318)) (Mathias Bynens) - -## 6.15.0 (2017-01-10) - -### :eyeglasses: Spec Compliance - -Add support for Flow shorthand import type ([#267](https://github.com/babel/babylon/pull/267)) (Jeff Morrison) - -This change implements flows new shorthand import syntax -and where previously you had to write this code: - -```js -import {someValue} from "blah"; -import type {someType} from "blah"; -import typeof {someOtherValue} from "blah"; -``` - -you can now write it like this: - -```js -import { - someValue, - type someType, - typeof someOtherValue, -} from "blah"; -``` - -For more information look at [this](https://github.com/facebook/flow/pull/2890) pull request. - -flow: allow leading pipes in all positions ([#256](https://github.com/babel/babylon/pull/256)) (Vladimir Kurchatkin) - -This change now allows a leading pipe everywhere types can be used: -```js -var f = (x): | 1 | 2 => 1; -``` - -Throw error when exporting non-declaration ([#241](https://github.com/babel/babylon/pull/241)) (Kai Cataldo) - -Previously babylon parsed the following exports, although they are not valid: -```js -export typeof foo; -export new Foo(); -export function() {}; -export for (;;); -export while(foo); -``` - -### :bug: Bug Fix - -Don't set inType flag when parsing property names ([#266](https://github.com/babel/babylon/pull/266)) (Vladimir Kurchatkin) - -This fixes parsing of this case: - -```js -const map = { - [age <= 17] : 'Too young' -}; -``` - -Fix source location for JSXEmptyExpression nodes (fixes #248) ([#249](https://github.com/babel/babylon/pull/249)) (James Long) - -The following case produced an invalid AST -```js -
{/* foo */}
-``` - -Use fromCodePoint to convert high value unicode entities ([#243](https://github.com/babel/babylon/pull/243)) (Ryan Duffy) - -When high value unicode entities (e.g. 💩) were used in the input source code they are now correctly encoded in the resulting AST. - -Rename folder to avoid Windows-illegal characters ([#281](https://github.com/babel/babylon/pull/281)) (Ryan Plant) - -Allow this.state.clone() when parsing decorators ([#262](https://github.com/babel/babylon/pull/262)) (Alex Rattray) - -### :house: Internal - -User external-helpers ([#254](https://github.com/babel/babylon/pull/254)) (Daniel Tschinder) - -Add watch script for dev ([#234](https://github.com/babel/babylon/pull/234)) (Kai Cataldo) - -Freeze current plugins list for "*" option, and remove from README.md ([#245](https://github.com/babel/babylon/pull/245)) (Andrew Levine) - -Prepare tests for multiple fixture runners. ([#240](https://github.com/babel/babylon/pull/240)) (Daniel Tschinder) - -Add some test coverage for decorators stage-0 plugin ([#250](https://github.com/babel/babylon/pull/250)) (Andrew Levine) - -Refactor tokenizer types file ([#263](https://github.com/babel/babylon/pull/263)) (Sven SAULEAU) - -Update eslint-config-babel to the latest version 🚀 ([#273](https://github.com/babel/babylon/pull/273)) (greenkeeper[bot]) - -chore(package): update rollup to version 0.41.0 ([#272](https://github.com/babel/babylon/pull/272)) (greenkeeper[bot]) - -chore(package): update flow-bin to version 0.37.0 ([#255](https://github.com/babel/babylon/pull/255)) (greenkeeper[bot]) - -## 6.14.1 (2016-11-17) - -### :bug: Bug Fix - -Allow `"plugins": ["*"]` ([#229](https://github.com/babel/babylon/pull/229)) (Daniel Tschinder) - -```js -{ - "plugins": ["*"] -} -``` - -Will include all parser plugins instead of specifying each one individually. Useful for tools like babel-eslint, jscodeshift, and ast-explorer. - -## 6.14.0 (2016-11-16) - -### :eyeglasses: Spec Compliance - -Throw error for reserved words `enum` and `await` ([#195](https://github.com/babel/babylon/pull/195)) (Kai Cataldo) - -[11.6.2.2 Future Reserved Words](http://www.ecma-international.org/ecma-262/6.0/#sec-future-reserved-words) - -Babylon will throw for more reserved words such as `enum` or `await` (in strict mode). - -``` -class enum {} // throws -class await {} // throws in strict mode (module) -``` - -Optional names for function types and object type indexers ([#197](https://github.com/babel/babylon/pull/197)) (Gabe Levi) - -So where you used to have to write - -```js -type A = (x: string, y: boolean) => number; -type B = (z: string) => number; -type C = { [key: string]: number }; -``` - -you can now write (with flow 0.34.0) - -```js -type A = (string, boolean) => number; -type B = string => number; -type C = { [string]: number }; -``` - -Parse flow nested array type annotations like `number[][]` ([#219](https://github.com/babel/babylon/pull/219)) (Bernhard Häussner) - -Supports these form now of specifying array types: - -```js -var a: number[][][][]; -var b: string[][]; -``` - -### :bug: Bug Fix - -Correctly eat semicolon at the end of `DelcareModuleExports` ([#223](https://github.com/babel/babylon/pull/223)) (Daniel Tschinder) - -``` -declare module "foo" { declare module.exports: number } -declare module "foo" { declare module.exports: number; } // also allowed now -``` - -### :house: Internal - - * Count Babel tests towards Babylon code coverage ([#182](https://github.com/babel/babylon/pull/182)) (Moti Zilberman) - * Fix strange line endings ([#214](https://github.com/babel/babylon/pull/214)) (Thomas Grainger) - * Add node 7 (Daniel Tschinder) - * chore(package): update flow-bin to version 0.34.0 ([#204](https://github.com/babel/babylon/pull/204)) (Greenkeeper) - -## v6.13.1 (2016-10-26) - -### :nail_care: Polish - -- Use rollup for bundling to speed up startup time ([#190](https://github.com/babel/babylon/pull/190)) ([@drewml](https://github.com/DrewML)) - -```js -const babylon = require('babylon'); -const ast = babylon.parse('var foo = "lol";'); -``` - -With that test case, there was a ~95ms savings by removing the need for node to build/traverse the dependency graph. - -**Without bundling** -![image](https://cloud.githubusercontent.com/assets/5233399/19420264/3133497e-93ad-11e6-9a6a-2da59c4f5c13.png) - -**With bundling** -![image](https://cloud.githubusercontent.com/assets/5233399/19420267/388f556e-93ad-11e6-813e-7c5c396be322.png) - -- add clean command [skip ci] ([#201](https://github.com/babel/babylon/pull/201)) (Henry Zhu) -- add ForAwaitStatement (async generator already added) [skip ci] ([#196](https://github.com/babel/babylon/pull/196)) (Henry Zhu) - -## v6.13.0 (2016-10-21) - -### :eyeglasses: Spec Compliance - -Property variance type annotations for Flow plugin ([#161](https://github.com/babel/babylon/pull/161)) (Sam Goldman) - -> See https://flowtype.org/docs/variance.html for more information - -```js -type T = { +p: T }; -interface T { -p: T }; -declare class T { +[k:K]: V }; -class T { -[k:K]: V }; -class C2 { +p: T = e }; -``` - -Raise error on duplicate definition of __proto__ ([#183](https://github.com/babel/babylon/pull/183)) (Moti Zilberman) - -```js -({ __proto__: 1, __proto__: 2 }) // Throws an error now -``` - -### :bug: Bug Fix - -Flow: Allow class properties to be named `static` ([#184](https://github.com/babel/babylon/pull/184)) (Moti Zilberman) - -```js -declare class A { - static: T; -} -``` - -Allow "async" as identifier for object literal property shorthand ([#187](https://github.com/babel/babylon/pull/187)) (Andrew Levine) - -```js -var foo = { async, bar }; -``` - -### :nail_care: Polish - -Fix flowtype and add inType to state ([#189](https://github.com/babel/babylon/pull/189)) (Daniel Tschinder) - -> This improves the performance slightly (because of hidden classes) - -### :house: Internal - -Fix .gitattributes line ending setting ([#191](https://github.com/babel/babylon/pull/191)) (Moti Zilberman) - -Increase test coverage ([#175](https://github.com/babel/babylon/pull/175) (Moti Zilberman) - -Readd missin .eslinignore for IDEs (Daniel Tschinder) - -Error on missing expected.json fixture in CI ([#188](https://github.com/babel/babylon/pull/188)) (Moti Zilberman) - -Add .gitattributes and .editorconfig for LF line endings ([#179](https://github.com/babel/babylon/pull/179)) (Moti Zilberman) - -Fixes two tests that are failing after the merge of #172 ([#177](https://github.com/babel/babylon/pull/177)) (Moti Zilberman) - -## v6.12.0 (2016-10-14) - -### :eyeglasses: Spec Compliance - -Implement import() syntax ([#163](https://github.com/babel/babylon/pull/163)) (Jordan Gensler) - -#### Dynamic Import - -- Proposal Repo: https://github.com/domenic/proposal-dynamic-import -- Championed by [@domenic](https://github.com/domenic) -- stage-2 -- [sept-28 tc39 notes](https://github.com/rwaldron/tc39-notes/blob/master/es7/2016-09/sept-28.md#113a-import) - -> This repository contains a proposal for adding a "function-like" import() module loading syntactic form to JavaScript - -```js -import(`./section-modules/${link.dataset.entryModule}.js`) -.then(module => { - module.loadPageInto(main); -}) -``` - -Add EmptyTypeAnnotation ([#171](https://github.com/babel/babylon/pull/171)) (Sam Goldman) - -#### EmptyTypeAnnotation - -Just wasn't covered before. - -```js -type T = empty; -``` - -### :bug: Bug Fix - -Fix crash when exporting with destructuring and sparse array ([#170](https://github.com/babel/babylon/pull/170)) (Jeroen Engels) - -```js -// was failing due to sparse array -export const { foo: [ ,, qux7 ] } = bar; -``` - -Allow keyword in Flow object declaration property names with type parameters ([#146](https://github.com/babel/babylon/pull/146)) (Dan Harper) - -```js -declare class X { - foobar(): void; - static foobar(): void; -} -``` - -Allow keyword in object/class property names with Flow type parameters ([#145](https://github.com/babel/babylon/pull/145)) (Dan Harper) - -```js -class Foo { - delete(item: T): T { - return item; - } -} -``` - -Allow typeAnnotations for yield expressions ([#174](https://github.com/babel/babylon/pull/174))) (Daniel Tschinder) - -```js -function *foo() { - const x = (yield 5: any); -} -``` - -### :nail_care: Polish - -Annotate more errors with expected token ([#172](https://github.com/babel/babylon/pull/172))) (Moti Zilberman) - -```js -// Unexpected token, expected ; (1:6) -{ set 1 } -``` - -### :house: Internal - -Remove kcheck ([#173](https://github.com/babel/babylon/pull/173))) (Daniel Tschinder) - -Also run flow, linting, babel tests on separate instances (add back node 0.10) - -## v6.11.6 (2016-10-12) - -### :bug: Bug Fix/Regression - -Fix crash when exporting with destructuring and sparse array ([#170](https://github.com/babel/babylon/pull/170)) (Jeroen Engels) - -```js -// was failing with `Cannot read property 'type' of null` because of null identifiers -export const { foo: [ ,, qux7 ] } = bar; -``` - -## v6.11.5 (2016-10-12) - -### :eyeglasses: Spec Compliance - -Fix: Check for duplicate named exports in exported destructuring assignments ([#144](https://github.com/babel/babylon/pull/144)) (Kai Cataldo) - -```js -// `foo` has already been exported. Exported identifiers must be unique. (2:20) -export function foo() {}; -export const { a: [{foo}] } = bar; -``` - -Fix: Check for duplicate named exports in exported rest elements/properties ([#164](https://github.com/babel/babylon/pull/164)) (Kai Cataldo) - -```js -// `foo` has already been exported. Exported identifiers must be unique. (2:22) -export const foo = 1; -export const [bar, ...foo] = baz; -``` - -### :bug: Bug Fix - -Fix: Allow identifier `async` for default param in arrow expression ([#165](https://github.com/babel/babylon/pull/165)) (Kai Cataldo) - -```js -// this is ok now -const test = ({async = true}) => {}; -``` - -### :nail_care: Polish - -Babylon will now print out the token it's expecting if there's a `SyntaxError` ([#150](https://github.com/babel/babylon/pull/150)) (Daniel Tschinder) - -```bash -# So in the case of a missing ending curly (`}`) -Module build failed: SyntaxError: Unexpected token, expected } (30:0) - 28 | } - 29 | -> 30 | - | ^ -``` - -## v6.11.4 (2016-10-03) - -Temporary rollback for erroring on trailing comma with spread (#154) (Henry Zhu) - -## v6.11.3 (2016-10-01) - -### :eyeglasses: Spec Compliance - -Add static errors for object rest (#149) ([@danez](https://github.com/danez)) - -> https://github.com/sebmarkbage/ecmascript-rest-spread - -Object rest copies the *rest* of properties from the right hand side `obj` starting from the left to right. - -```js -let { x, y, ...z } = { x: 1, y: 2, z: 3 }; -// x = 1 -// y = 2 -// z = { z: 3 } -``` - -#### New Syntax Errors: - -**SyntaxError**: The rest element has to be the last element when destructuring (1:10) -```bash -> 1 | let { ...x, y, z } = { x: 1, y: 2, z: 3}; - | ^ -# Previous behavior: -# x = { x: 1, y: 2, z: 3 } -# y = 2 -# z = 3 -``` - -Before, this was just a more verbose way of shallow copying `obj` since it doesn't actually do what you think. - -**SyntaxError**: Cannot have multiple rest elements when destructuring (1:13) - -```bash -> 1 | let { x, ...y, ...z } = { x: 1, y: 2, z: 3}; - | ^ -# Previous behavior: -# x = 1 -# y = { y: 2, z: 3 } -# z = { y: 2, z: 3 } -``` - -Before y and z would just be the same value anyway so there is no reason to need to have both. - -**SyntaxError**: A trailing comma is not permitted after the rest element (1:16) - -```js -let { x, y, ...z, } = obj; -``` - -The rationale for this is that the use case for trailing comma is that you can add something at the end without affecting the line above. Since a RestProperty always has to be the last property it doesn't make sense. - ---- - -get / set are valid property names in default assignment (#142) ([@jezell](https://github.com/jezell)) - -```js -// valid -function something({ set = null, get = null }) {} -``` - -## v6.11.2 (2016-09-23) - -### Bug Fix - -- [#139](https://github.com/babel/babylon/issues/139) Don't do the duplicate check if not an identifier (#140) @hzoo - -```js -// regression with duplicate export check -SyntaxError: ./typography.js: `undefined` has already been exported. Exported identifiers must be unique. (22:13) - 20 | - 21 | export const { rhythm } = typography; -> 22 | export const { TypographyStyle } = typography -``` - -Bail out for now, and make a change to account for destructuring in the next release. - -## 6.11.1 (2016-09-22) - -### Bug Fix -- [#137](https://github.com/babel/babylon/pull/137) - Fix a regression with duplicate exports - it was erroring on all keys in `Object.prototype`. @danez - -```javascript -export toString from './toString'; -``` - -```bash -`toString` has already been exported. Exported identifiers must be unique. (1:7) -> 1 | export toString from './toString'; - | ^ - 2 | -``` - -## 6.11.0 (2016-09-22) - -### Spec Compliance (will break CI) - -- Disallow duplicate named exports ([#107](https://github.com/babel/babylon/pull/107)) @kaicataldo - -```js -// Only one default export allowed per module. (2:9) -export default function() {}; -export { foo as default }; - -// Only one default export allowed per module. (2:0) -export default {}; -export default function() {}; - -// `Foo` has already been exported. Exported identifiers must be unique. (2:0) -export { Foo }; -export class Foo {}; -``` - -### New Feature (Syntax) - -- Add support for computed class property names ([#121](https://github.com/babel/babylon/pull/121)) @motiz88 - -```js -// AST -interface ClassProperty <: Node { - type: "ClassProperty"; - key: Identifier; - value: Expression; - computed: boolean; // added -} -``` - -```js -// with "plugins": ["classProperties"] -class Foo { - [x] - ['y'] -} - -class Bar { - [p] - [m] () {} -} - ``` - -### Bug Fix - -- Fix `static` property falling through in the declare class Flow AST ([#135](https://github.com/babel/babylon/pull/135)) @danharper - -```js -declare class X { - a: number; - static b: number; // static - c: number; // this was being marked as static in the AST as well -} -``` - -### Polish - -- Rephrase "assigning/binding to rvalue" errors to include context ([#119](https://github.com/babel/babylon/pull/119)) @motiz88 - -```js -// Used to error with: -// SyntaxError: Assigning to rvalue (1:0) - -// Now: -// Invalid left-hand side in assignment expression (1:0) -3 = 4 - -// Invalid left-hand side in for-in statement (1:5) -for (+i in {}); -``` - -### Internal - -- Fix call to `this.parseMaybeAssign` with correct arguments ([#133](https://github.com/babel/babylon/pull/133)) @danez -- Add semver note to changelog ([#131](https://github.com/babel/babylon/pull/131)) @hzoo - -## 6.10.0 (2016-09-19) - -> We plan to include some spec compliance bugs in patch versions. An example was the multiple default exports issue. - -### Spec Compliance - -* Implement ES2016 check for simple parameter list in strict mode ([#106](https://github.com/babel/babylon/pull/106)) (Timothy Gu) - -> It is a Syntax Error if ContainsUseStrict of FunctionBody is true and IsSimpleParameterList of FormalParameters is false. https://tc39.github.io/ecma262/2016/#sec-function-definitions-static-semantics-early-errors - -More Context: [tc39-notes](https://github.com/rwaldron/tc39-notes/blob/master/es7/2015-07/july-29.md#611-the-scope-of-use-strict-with-respect-to-destructuring-in-parameter-lists) - -For example: - -```js -// this errors because it uses destructuring and default parameters -// in a function with a "use strict" directive -function a([ option1, option2 ] = []) { - "use strict"; -} - ``` - -The solution would be to use a top level "use strict" or to remove the destructuring or default parameters when using a function + "use strict" or to. - -### New Feature - -* Exact object type annotations for Flow plugin ([#104](https://github.com/babel/babylon/pull/104)) (Basil Hosmer) - -Added to flow in https://github.com/facebook/flow/commit/c710c40aa2a115435098d6c0dfeaadb023cd39b8 - -Looks like: - -```js -var a : {| x: number, y: string |} = { x: 0, y: 'foo' }; -``` - -### Bug Fixes - -* Include `typeParameter` location in `ArrowFunctionExpression` ([#126](https://github.com/babel/babylon/pull/126)) (Daniel Tschinder) -* Error on invalid flow type annotation with default assignment ([#122](https://github.com/babel/babylon/pull/122)) (Dan Harper) -* Fix Flow return types on arrow functions ([#124](https://github.com/babel/babylon/pull/124)) (Dan Harper) - -### Misc - -* Add tests for export extensions ([#127](https://github.com/babel/babylon/pull/127)) (Daniel Tschinder) -* Fix Contributing guidelines [skip ci] (Daniel Tschinder) - -## 6.9.2 (2016-09-09) - -The only change is to remove the `babel-runtime` dependency by compiling with Babel's ES2015 loose mode. So using babylon standalone should be smaller. - -## 6.9.1 (2016-08-23) - -This release contains mainly small bugfixes but also updates babylons default mode to es2017. The features for `exponentiationOperator`, `asyncFunctions` and `trailingFunctionCommas` which previously needed to be activated via plugin are now enabled by default and the plugins are now no-ops. - -### Bug Fixes - -- Fix issues with default object params in async functions ([#96](https://github.com/babel/babylon/pull/96)) @danez -- Fix issues with flow-types and async function ([#95](https://github.com/babel/babylon/pull/95)) @danez -- Fix arrow functions with destructuring, types & default value ([#94](https://github.com/babel/babylon/pull/94)) @danharper -- Fix declare class with qualified type identifier ([#97](https://github.com/babel/babylon/pull/97)) @danez -- Remove exponentiationOperator, asyncFunctions, trailingFunctionCommas plugins and enable them by default ([#98](https://github.com/babel/babylon/pull/98)) @danez - -## 6.9.0 (2016-08-16) - -### New syntax support - -- Add JSX spread children ([#42](https://github.com/babel/babylon/pull/42)) @calebmer - -(Be aware that React is not going to support this syntax) - -```js -
- {...todos.map(todo => )} -
-``` - -- Add support for declare module.exports ([#72](https://github.com/babel/babylon/pull/72)) @danez - -```js -declare module "foo" { - declare module.exports: {} -} -``` - -### New Features - -- If supplied, attach filename property to comment node loc. ([#80](https://github.com/babel/babylon/pull/80)) @divmain -- Add identifier name to node loc field ([#90](https://github.com/babel/babylon/pull/90)) @kittens - -### Bug Fixes - -- Fix exponential operator to behave according to spec ([#75](https://github.com/babel/babylon/pull/75)) @danez -- Fix lookahead to not add comments to arrays which are not cloned ([#76](https://github.com/babel/babylon/pull/76)) @danez -- Fix accidental fall-through in Flow type parsing. ([#82](https://github.com/babel/babylon/pull/82)) @xiemaisi -- Only allow declares inside declare module ([#73](https://github.com/babel/babylon/pull/73)) @danez -- Small fix for parsing type parameter declarations ([#83](https://github.com/babel/babylon/pull/83)) @gabelevi -- Fix arrow param locations with flow types ([#57](https://github.com/babel/babylon/pull/57)) @danez -- Fixes SyntaxError position with flow optional type ([#65](https://github.com/babel/babylon/pull/65)) @danez - -### Internal - -- Add codecoverage to tests @danez -- Fix tests to not save expected output if we expect the test to fail @danez -- Make a shallow clone of babel for testing @danez -- chore(package): update cross-env to version 2.0.0 ([#77](https://github.com/babel/babylon/pull/77)) @greenkeeperio-bot -- chore(package): update ava to version 0.16.0 ([#86](https://github.com/babel/babylon/pull/86)) @greenkeeperio-bot -- chore(package): update babel-plugin-istanbul to version 2.0.0 ([#89](https://github.com/babel/babylon/pull/89)) @greenkeeperio-bot -- chore(package): update nyc to version 8.0.0 ([#88](https://github.com/babel/babylon/pull/88)) @greenkeeperio-bot - -## 6.8.4 (2016-07-06) - -### Bug Fixes - -- Fix the location of params, when flow and default value used ([#68](https://github.com/babel/babylon/pull/68)) @danez - -## 6.8.3 (2016-07-02) - -### Bug Fixes - -- Fix performance regression introduced in 6.8.2 with conditionals ([#63](https://github.com/babel/babylon/pull/63)) @danez - -## 6.8.2 (2016-06-24) - -### Bug Fixes - -- Fix parse error with yielding jsx elements in generators `function* it() { yield ; }` ([#31](https://github.com/babel/babylon/pull/31)) @eldereal -- When cloning nodes do not clone its comments ([#24](https://github.com/babel/babylon/pull/24)) @danez -- Fix parse errors when using arrow functions with an spread element and return type `(...props): void => {}` ([#10](https://github.com/babel/babylon/pull/10)) @danez -- Fix leading comments added from previous node ([#23](https://github.com/babel/babylon/pull/23)) @danez -- Fix parse errors with flow's optional arguments `(arg?) => {}` ([#19](https://github.com/babel/babylon/pull/19)) @danez -- Support negative numeric type literals @kittens -- Remove line terminator restriction after await keyword @kittens -- Remove grouped type arrow restriction as it seems flow no longer has it @kittens -- Fix parse error with generic methods that have the name `get` or `set` `class foo { get() {} }` ([#55](https://github.com/babel/babylon/pull/55)) @vkurchatkin -- Fix parse error with arrow functions that have flow type parameter declarations `(x: T): T => x;` ([#54](https://github.com/babel/babylon/pull/54)) @gabelevi - -### Documentation - -- Document AST differences from ESTree ([#41](https://github.com/babel/babylon/pull/41)) @nene -- Move ast spec from babel/babel ([#46](https://github.com/babel/babylon/pull/46)) @hzoo - -### Internal - -- Enable skipped tests ([#16](https://github.com/babel/babylon/pull/16)) @danez -- Add script to test latest version of babylon with babel ([#21](https://github.com/babel/babylon/pull/21)) @danez -- Upgrade test runner ava @kittens -- Add missing generate-identifier-regex script @kittens -- Rename parser context types @kittens -- Add node v6 to travis testing @hzoo -- Update to Unicode v9 ([#45](https://github.com/babel/babylon/pull/45)) @mathiasbynens - -## 6.8.1 (2016-06-06) - -### New Feature - -- Parse type parameter declarations with defaults like `type Foo = T` - -### Bug Fixes -- Type parameter declarations need 1 or more type parameters. -- The existential type `*` is not a valid type parameter. -- The existential type `*` is a primary type - -### Spec Compliance -- The param list for type parameter declarations now consists of `TypeParameter` nodes -- New `TypeParameter` AST Node (replaces using the `Identifier` node before) - -``` -interface TypeParameter <: Node { - bound: TypeAnnotation; - default: TypeAnnotation; - name: string; - variance: "plus" | "minus"; -} -``` - -## 6.8.0 (2016-05-02) - -#### New Feature - -##### Parse Method Parameter Decorators ([#12](https://github.com/babel/babylon/pull/12)) - -> [Method Parameter Decorators](https://goo.gl/8MmCMG) is now a TC39 [stage 0 proposal](https://github.com/tc39/ecma262/blob/master/stage0.md). - -Examples: - -```js -class Foo { - constructor(@foo() x, @bar({ a: 123 }) @baz() y) {} -} - -export default function func(@foo() x, @bar({ a: 123 }) @baz() y) {} - -var obj = { - method(@foo() x, @bar({ a: 123 }) @baz() y) {} -}; -``` - -##### Parse for-await statements (w/ `asyncGenerators` plugin) ([#17](https://github.com/babel/babylon/pull/17)) - -There is also a new node type, `ForAwaitStatement`. - -> [Async generators and for-await](https://github.com/tc39/proposal-async-iteration) are now a [stage 2 proposal](https://github.com/tc39/ecma262#current-proposals). - -Example: - -```js -async function f() { - for await (let x of y); -} -``` diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@babel/parser/LICENSE b/packages/wyatt_notification_bloc/example/scripts/node_modules/@babel/parser/LICENSE deleted file mode 100644 index d4c7fc58..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@babel/parser/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (C) 2012-2014 by various contributors (see AUTHORS) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@babel/parser/README.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/@babel/parser/README.md deleted file mode 100644 index 513748c3..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@babel/parser/README.md +++ /dev/null @@ -1,19 +0,0 @@ -# @babel/parser - -> A JavaScript parser - -See our website [@babel/parser](https://babeljs.io/docs/en/babel-parser) for more information or the [issues](https://github.com/babel/babel/issues?utf8=%E2%9C%93&q=is%3Aissue+label%3A%22pkg%3A%20parser%20(babylon)%22+is%3Aopen) associated with this package. - -## Install - -Using npm: - -```sh -npm install --save-dev @babel/parser -``` - -or using yarn: - -```sh -yarn add @babel/parser --dev -``` diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@babel/parser/bin/babel-parser.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/@babel/parser/bin/babel-parser.js deleted file mode 100755 index 3aca3145..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@babel/parser/bin/babel-parser.js +++ /dev/null @@ -1,15 +0,0 @@ -#!/usr/bin/env node -/* eslint no-var: 0 */ - -var parser = require(".."); -var fs = require("fs"); - -var filename = process.argv[2]; -if (!filename) { - console.error("no filename specified"); -} else { - var file = fs.readFileSync(filename, "utf8"); - var ast = parser.parse(file); - - console.log(JSON.stringify(ast, null, " ")); -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@babel/parser/index.cjs b/packages/wyatt_notification_bloc/example/scripts/node_modules/@babel/parser/index.cjs deleted file mode 100644 index 89863a9f..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@babel/parser/index.cjs +++ /dev/null @@ -1,5 +0,0 @@ -try { - module.exports = require("./lib/index.cjs"); -} catch { - module.exports = require("./lib/index.js"); -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@babel/parser/lib/index.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/@babel/parser/lib/index.js deleted file mode 100644 index a7eb4788..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@babel/parser/lib/index.js +++ /dev/null @@ -1,14761 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, '__esModule', { value: true }); - -function _objectWithoutPropertiesLoose(source, excluded) { - if (source == null) return {}; - var target = {}; - var sourceKeys = Object.keys(source); - var key, i; - for (i = 0; i < sourceKeys.length; i++) { - key = sourceKeys[i]; - if (excluded.indexOf(key) >= 0) continue; - target[key] = source[key]; - } - return target; -} - -class Position { - constructor(line, col, index) { - this.line = void 0; - this.column = void 0; - this.index = void 0; - this.line = line; - this.column = col; - this.index = index; - } -} -class SourceLocation { - constructor(start, end) { - this.start = void 0; - this.end = void 0; - this.filename = void 0; - this.identifierName = void 0; - this.start = start; - this.end = end; - } -} - -function createPositionWithColumnOffset(position, columnOffset) { - const { - line, - column, - index - } = position; - return new Position(line, column + columnOffset, index + columnOffset); -} - -var ParseErrorCode = { - SyntaxError: "BABEL_PARSER_SYNTAX_ERROR", - SourceTypeModuleError: "BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED" -}; -const reflect = (keys, last = keys.length - 1) => ({ - get() { - return keys.reduce((object, key) => - object[key], this); - }, - set(value) { - keys.reduce( - (item, key, i) => i === last ? item[key] = value : item[key], this); - } -}); -const instantiate = (constructor, properties, descriptors) => Object.keys(descriptors).map(key => [key, descriptors[key]]).filter(([, descriptor]) => !!descriptor).map(([key, descriptor]) => [key, typeof descriptor === "function" ? { - value: descriptor, - enumerable: false -} : typeof descriptor.reflect === "string" ? Object.assign({}, descriptor, reflect(descriptor.reflect.split("."))) : descriptor]).reduce((instance, [key, descriptor]) => Object.defineProperty(instance, key, Object.assign({ - configurable: true -}, descriptor)), Object.assign(new constructor(), properties)); - -var ModuleErrors = { - ImportMetaOutsideModule: { - message: `import.meta may appear only with 'sourceType: "module"'`, - code: ParseErrorCode.SourceTypeModuleError - }, - ImportOutsideModule: { - message: `'import' and 'export' may appear only with 'sourceType: "module"'`, - code: ParseErrorCode.SourceTypeModuleError - } -}; - -const NodeDescriptions = { - ArrayPattern: "array destructuring pattern", - AssignmentExpression: "assignment expression", - AssignmentPattern: "assignment expression", - ArrowFunctionExpression: "arrow function expression", - ConditionalExpression: "conditional expression", - CatchClause: "catch clause", - ForOfStatement: "for-of statement", - ForInStatement: "for-in statement", - ForStatement: "for-loop", - FormalParameters: "function parameter list", - Identifier: "identifier", - ImportSpecifier: "import specifier", - ImportDefaultSpecifier: "import default specifier", - ImportNamespaceSpecifier: "import namespace specifier", - ObjectPattern: "object destructuring pattern", - ParenthesizedExpression: "parenthesized expression", - RestElement: "rest element", - UpdateExpression: { - true: "prefix operation", - false: "postfix operation" - }, - VariableDeclarator: "variable declaration", - YieldExpression: "yield expression" -}; -const toNodeDescription = ({ - type, - prefix -}) => type === "UpdateExpression" ? NodeDescriptions.UpdateExpression[String(prefix)] : NodeDescriptions[type]; - -var StandardErrors = { - AccessorIsGenerator: ({ - kind - }) => `A ${kind}ter cannot be a generator.`, - ArgumentsInClass: "'arguments' is only allowed in functions and class methods.", - AsyncFunctionInSingleStatementContext: "Async functions can only be declared at the top level or inside a block.", - AwaitBindingIdentifier: "Can not use 'await' as identifier inside an async function.", - AwaitBindingIdentifierInStaticBlock: "Can not use 'await' as identifier inside a static block.", - AwaitExpressionFormalParameter: "'await' is not allowed in async function parameters.", - AwaitNotInAsyncContext: "'await' is only allowed within async functions and at the top levels of modules.", - AwaitNotInAsyncFunction: "'await' is only allowed within async functions.", - BadGetterArity: "A 'get' accesor must not have any formal parameters.", - BadSetterArity: "A 'set' accesor must have exactly one formal parameter.", - BadSetterRestParameter: "A 'set' accesor function argument must not be a rest parameter.", - ConstructorClassField: "Classes may not have a field named 'constructor'.", - ConstructorClassPrivateField: "Classes may not have a private field named '#constructor'.", - ConstructorIsAccessor: "Class constructor may not be an accessor.", - ConstructorIsAsync: "Constructor can't be an async function.", - ConstructorIsGenerator: "Constructor can't be a generator.", - DeclarationMissingInitializer: ({ - kind - }) => `Missing initializer in ${kind} declaration.`, - DecoratorArgumentsOutsideParentheses: "Decorator arguments must be moved inside parentheses: use '@(decorator(args))' instead of '@(decorator)(args)'.", - DecoratorBeforeExport: "Decorators must be placed *before* the 'export' keyword. You can set the 'decoratorsBeforeExport' option to false to use the 'export @decorator class {}' syntax.", - DecoratorConstructor: "Decorators can't be used with a constructor. Did you mean '@dec class { ... }'?", - DecoratorExportClass: "Using the export keyword between a decorator and a class is not allowed. Please use `export @dec class` instead.", - DecoratorSemicolon: "Decorators must not be followed by a semicolon.", - DecoratorStaticBlock: "Decorators can't be used with a static block.", - DeletePrivateField: "Deleting a private field is not allowed.", - DestructureNamedImport: "ES2015 named imports do not destructure. Use another statement for destructuring after the import.", - DuplicateConstructor: "Duplicate constructor in the same class.", - DuplicateDefaultExport: "Only one default export allowed per module.", - DuplicateExport: ({ - exportName - }) => `\`${exportName}\` has already been exported. Exported identifiers must be unique.`, - DuplicateProto: "Redefinition of __proto__ property.", - DuplicateRegExpFlags: "Duplicate regular expression flag.", - ElementAfterRest: "Rest element must be last element.", - EscapedCharNotAnIdentifier: "Invalid Unicode escape.", - ExportBindingIsString: ({ - localName, - exportName - }) => `A string literal cannot be used as an exported binding without \`from\`.\n- Did you mean \`export { '${localName}' as '${exportName}' } from 'some-module'\`?`, - ExportDefaultFromAsIdentifier: "'from' is not allowed as an identifier after 'export default'.", - ForInOfLoopInitializer: ({ - type - }) => `'${type === "ForInStatement" ? "for-in" : "for-of"}' loop variable declaration may not have an initializer.`, - ForInUsing: "For-in loop may not start with 'using' declaration.", - ForOfAsync: "The left-hand side of a for-of loop may not be 'async'.", - ForOfLet: "The left-hand side of a for-of loop may not start with 'let'.", - GeneratorInSingleStatementContext: "Generators can only be declared at the top level or inside a block.", - IllegalBreakContinue: ({ - type - }) => `Unsyntactic ${type === "BreakStatement" ? "break" : "continue"}.`, - IllegalLanguageModeDirective: "Illegal 'use strict' directive in function with non-simple parameter list.", - IllegalReturn: "'return' outside of function.", - ImportBindingIsString: ({ - importName - }) => `A string literal cannot be used as an imported binding.\n- Did you mean \`import { "${importName}" as foo }\`?`, - ImportCallArgumentTrailingComma: "Trailing comma is disallowed inside import(...) arguments.", - ImportCallArity: ({ - maxArgumentCount - }) => `\`import()\` requires exactly ${maxArgumentCount === 1 ? "one argument" : "one or two arguments"}.`, - ImportCallNotNewExpression: "Cannot use new with import(...).", - ImportCallSpreadArgument: "`...` is not allowed in `import()`.", - ImportJSONBindingNotDefault: "A JSON module can only be imported with `default`.", - ImportReflectionHasAssertion: "`import module x` cannot have assertions.", - ImportReflectionNotBinding: 'Only `import module x from "./module"` is valid.', - IncompatibleRegExpUVFlags: "The 'u' and 'v' regular expression flags cannot be enabled at the same time.", - InvalidBigIntLiteral: "Invalid BigIntLiteral.", - InvalidCodePoint: "Code point out of bounds.", - InvalidCoverInitializedName: "Invalid shorthand property initializer.", - InvalidDecimal: "Invalid decimal.", - InvalidDigit: ({ - radix - }) => `Expected number in radix ${radix}.`, - InvalidEscapeSequence: "Bad character escape sequence.", - InvalidEscapeSequenceTemplate: "Invalid escape sequence in template.", - InvalidEscapedReservedWord: ({ - reservedWord - }) => `Escape sequence in keyword ${reservedWord}.`, - InvalidIdentifier: ({ - identifierName - }) => `Invalid identifier ${identifierName}.`, - InvalidLhs: ({ - ancestor - }) => `Invalid left-hand side in ${toNodeDescription(ancestor)}.`, - InvalidLhsBinding: ({ - ancestor - }) => `Binding invalid left-hand side in ${toNodeDescription(ancestor)}.`, - InvalidNumber: "Invalid number.", - InvalidOrMissingExponent: "Floating-point numbers require a valid exponent after the 'e'.", - InvalidOrUnexpectedToken: ({ - unexpected - }) => `Unexpected character '${unexpected}'.`, - InvalidParenthesizedAssignment: "Invalid parenthesized assignment pattern.", - InvalidPrivateFieldResolution: ({ - identifierName - }) => `Private name #${identifierName} is not defined.`, - InvalidPropertyBindingPattern: "Binding member expression.", - InvalidRecordProperty: "Only properties and spread elements are allowed in record definitions.", - InvalidRestAssignmentPattern: "Invalid rest operator's argument.", - LabelRedeclaration: ({ - labelName - }) => `Label '${labelName}' is already declared.`, - LetInLexicalBinding: "'let' is not allowed to be used as a name in 'let' or 'const' declarations.", - LineTerminatorBeforeArrow: "No line break is allowed before '=>'.", - MalformedRegExpFlags: "Invalid regular expression flag.", - MissingClassName: "A class name is required.", - MissingEqInAssignment: "Only '=' operator can be used for specifying default value.", - MissingSemicolon: "Missing semicolon.", - MissingPlugin: ({ - missingPlugin - }) => `This experimental syntax requires enabling the parser plugin: ${missingPlugin.map(name => JSON.stringify(name)).join(", ")}.`, - MissingOneOfPlugins: ({ - missingPlugin - }) => `This experimental syntax requires enabling one of the following parser plugin(s): ${missingPlugin.map(name => JSON.stringify(name)).join(", ")}.`, - MissingUnicodeEscape: "Expecting Unicode escape sequence \\uXXXX.", - MixingCoalesceWithLogical: "Nullish coalescing operator(??) requires parens when mixing with logical operators.", - ModuleAttributeDifferentFromType: "The only accepted module attribute is `type`.", - ModuleAttributeInvalidValue: "Only string literals are allowed as module attribute values.", - ModuleAttributesWithDuplicateKeys: ({ - key - }) => `Duplicate key "${key}" is not allowed in module attributes.`, - ModuleExportNameHasLoneSurrogate: ({ - surrogateCharCode - }) => `An export name cannot include a lone surrogate, found '\\u${surrogateCharCode.toString(16)}'.`, - ModuleExportUndefined: ({ - localName - }) => `Export '${localName}' is not defined.`, - MultipleDefaultsInSwitch: "Multiple default clauses.", - NewlineAfterThrow: "Illegal newline after throw.", - NoCatchOrFinally: "Missing catch or finally clause.", - NumberIdentifier: "Identifier directly after number.", - NumericSeparatorInEscapeSequence: "Numeric separators are not allowed inside unicode escape sequences or hex escape sequences.", - ObsoleteAwaitStar: "'await*' has been removed from the async functions proposal. Use Promise.all() instead.", - OptionalChainingNoNew: "Constructors in/after an Optional Chain are not allowed.", - OptionalChainingNoTemplate: "Tagged Template Literals are not allowed in optionalChain.", - OverrideOnConstructor: "'override' modifier cannot appear on a constructor declaration.", - ParamDupe: "Argument name clash.", - PatternHasAccessor: "Object pattern can't contain getter or setter.", - PatternHasMethod: "Object pattern can't contain methods.", - PrivateInExpectedIn: ({ - identifierName - }) => `Private names are only allowed in property accesses (\`obj.#${identifierName}\`) or in \`in\` expressions (\`#${identifierName} in obj\`).`, - PrivateNameRedeclaration: ({ - identifierName - }) => `Duplicate private name #${identifierName}.`, - RecordExpressionBarIncorrectEndSyntaxType: "Record expressions ending with '|}' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.", - RecordExpressionBarIncorrectStartSyntaxType: "Record expressions starting with '{|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.", - RecordExpressionHashIncorrectStartSyntaxType: "Record expressions starting with '#{' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'.", - RecordNoProto: "'__proto__' is not allowed in Record expressions.", - RestTrailingComma: "Unexpected trailing comma after rest element.", - SloppyFunction: "In non-strict mode code, functions can only be declared at top level, inside a block, or as the body of an if statement.", - StaticPrototype: "Classes may not have static property named prototype.", - SuperNotAllowed: "`super()` is only valid inside a class constructor of a subclass. Maybe a typo in the method name ('constructor') or not extending another class?", - SuperPrivateField: "Private fields can't be accessed on super.", - TrailingDecorator: "Decorators must be attached to a class element.", - TupleExpressionBarIncorrectEndSyntaxType: "Tuple expressions ending with '|]' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.", - TupleExpressionBarIncorrectStartSyntaxType: "Tuple expressions starting with '[|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.", - TupleExpressionHashIncorrectStartSyntaxType: "Tuple expressions starting with '#[' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'.", - UnexpectedArgumentPlaceholder: "Unexpected argument placeholder.", - UnexpectedAwaitAfterPipelineBody: 'Unexpected "await" after pipeline body; await must have parentheses in minimal proposal.', - UnexpectedDigitAfterHash: "Unexpected digit after hash token.", - UnexpectedImportExport: "'import' and 'export' may only appear at the top level.", - UnexpectedKeyword: ({ - keyword - }) => `Unexpected keyword '${keyword}'.`, - UnexpectedLeadingDecorator: "Leading decorators must be attached to a class declaration.", - UnexpectedLexicalDeclaration: "Lexical declaration cannot appear in a single-statement context.", - UnexpectedNewTarget: "`new.target` can only be used in functions or class properties.", - UnexpectedNumericSeparator: "A numeric separator is only allowed between two digits.", - UnexpectedPrivateField: "Unexpected private name.", - UnexpectedReservedWord: ({ - reservedWord - }) => `Unexpected reserved word '${reservedWord}'.`, - UnexpectedSuper: "'super' is only allowed in object methods and classes.", - UnexpectedToken: ({ - expected, - unexpected - }) => `Unexpected token${unexpected ? ` '${unexpected}'.` : ""}${expected ? `, expected "${expected}"` : ""}`, - UnexpectedTokenUnaryExponentiation: "Illegal expression. Wrap left hand side or entire exponentiation in parentheses.", - UnexpectedUsingDeclaration: "Using declaration cannot appear in the top level when source type is `script`.", - UnsupportedBind: "Binding should be performed on object property.", - UnsupportedDecoratorExport: "A decorated export must export a class declaration.", - UnsupportedDefaultExport: "Only expressions, functions or classes are allowed as the `default` export.", - UnsupportedImport: "`import` can only be used in `import()` or `import.meta`.", - UnsupportedMetaProperty: ({ - target, - onlyValidPropertyName - }) => `The only valid meta property for ${target} is ${target}.${onlyValidPropertyName}.`, - UnsupportedParameterDecorator: "Decorators cannot be used to decorate parameters.", - UnsupportedPropertyDecorator: "Decorators cannot be used to decorate object literal properties.", - UnsupportedSuper: "'super' can only be used with function calls (i.e. super()) or in property accesses (i.e. super.prop or super[prop]).", - UnterminatedComment: "Unterminated comment.", - UnterminatedRegExp: "Unterminated regular expression.", - UnterminatedString: "Unterminated string constant.", - UnterminatedTemplate: "Unterminated template.", - UsingDeclarationHasBindingPattern: "Using declaration cannot have destructuring patterns.", - VarRedeclaration: ({ - identifierName - }) => `Identifier '${identifierName}' has already been declared.`, - YieldBindingIdentifier: "Can not use 'yield' as identifier inside a generator.", - YieldInParameter: "Yield expression is not allowed in formal parameters.", - ZeroDigitNumericSeparator: "Numeric separator can not be used after leading 0." -}; - -var StrictModeErrors = { - StrictDelete: "Deleting local variable in strict mode.", - StrictEvalArguments: ({ - referenceName - }) => `Assigning to '${referenceName}' in strict mode.`, - StrictEvalArgumentsBinding: ({ - bindingName - }) => `Binding '${bindingName}' in strict mode.`, - StrictFunction: "In strict mode code, functions can only be declared at top level or inside a block.", - StrictNumericEscape: "The only valid numeric escape in strict mode is '\\0'.", - StrictOctalLiteral: "Legacy octal literals are not allowed in strict mode.", - StrictWith: "'with' in strict mode." -}; - -const UnparenthesizedPipeBodyDescriptions = new Set(["ArrowFunctionExpression", "AssignmentExpression", "ConditionalExpression", "YieldExpression"]); -var PipelineOperatorErrors = { - PipeBodyIsTighter: "Unexpected yield after pipeline body; any yield expression acting as Hack-style pipe body must be parenthesized due to its loose operator precedence.", - PipeTopicRequiresHackPipes: 'Topic reference is used, but the pipelineOperator plugin was not passed a "proposal": "hack" or "smart" option.', - PipeTopicUnbound: "Topic reference is unbound; it must be inside a pipe body.", - PipeTopicUnconfiguredToken: ({ - token - }) => `Invalid topic token ${token}. In order to use ${token} as a topic reference, the pipelineOperator plugin must be configured with { "proposal": "hack", "topicToken": "${token}" }.`, - PipeTopicUnused: "Hack-style pipe body does not contain a topic reference; Hack-style pipes must use topic at least once.", - PipeUnparenthesizedBody: ({ - type - }) => `Hack-style pipe body cannot be an unparenthesized ${toNodeDescription({ - type - })}; please wrap it in parentheses.`, - PipelineBodyNoArrow: 'Unexpected arrow "=>" after pipeline body; arrow function in pipeline body must be parenthesized.', - PipelineBodySequenceExpression: "Pipeline body may not be a comma-separated sequence expression.", - PipelineHeadSequenceExpression: "Pipeline head should not be a comma-separated sequence expression.", - PipelineTopicUnused: "Pipeline is in topic style but does not use topic reference.", - PrimaryTopicNotAllowed: "Topic reference was used in a lexical context without topic binding.", - PrimaryTopicRequiresSmartPipeline: 'Topic reference is used, but the pipelineOperator plugin was not passed a "proposal": "hack" or "smart" option.' -}; - -const _excluded$1 = ["toMessage"], - _excluded2$1 = ["message"]; -function toParseErrorConstructor(_ref) { - let { - toMessage - } = _ref, - properties = _objectWithoutPropertiesLoose(_ref, _excluded$1); - return function constructor({ - loc, - details - }) { - return instantiate(SyntaxError, Object.assign({}, properties, { - loc - }), { - clone(overrides = {}) { - const loc = overrides.loc || {}; - return constructor({ - loc: new Position("line" in loc ? loc.line : this.loc.line, "column" in loc ? loc.column : this.loc.column, "index" in loc ? loc.index : this.loc.index), - details: Object.assign({}, this.details, overrides.details) - }); - }, - details: { - value: details, - enumerable: false - }, - message: { - get() { - return `${toMessage(this.details)} (${this.loc.line}:${this.loc.column})`; - }, - set(value) { - Object.defineProperty(this, "message", { - value - }); - } - }, - pos: { - reflect: "loc.index", - enumerable: true - }, - missingPlugin: "missingPlugin" in details && { - reflect: "details.missingPlugin", - enumerable: true - } - }); - }; -} -function ParseErrorEnum(argument, syntaxPlugin) { - if (Array.isArray(argument)) { - return parseErrorTemplates => ParseErrorEnum(parseErrorTemplates, argument[0]); - } - const ParseErrorConstructors = {}; - for (const reasonCode of Object.keys(argument)) { - const template = argument[reasonCode]; - const _ref2 = typeof template === "string" ? { - message: () => template - } : typeof template === "function" ? { - message: template - } : template, - { - message - } = _ref2, - rest = _objectWithoutPropertiesLoose(_ref2, _excluded2$1); - const toMessage = typeof message === "string" ? () => message : message; - ParseErrorConstructors[reasonCode] = toParseErrorConstructor(Object.assign({ - code: ParseErrorCode.SyntaxError, - reasonCode, - toMessage - }, syntaxPlugin ? { - syntaxPlugin - } : {}, rest)); - } - return ParseErrorConstructors; -} -const Errors = Object.assign({}, ParseErrorEnum(ModuleErrors), ParseErrorEnum(StandardErrors), ParseErrorEnum(StrictModeErrors), ParseErrorEnum`pipelineOperator`(PipelineOperatorErrors)); - -const { - defineProperty -} = Object; -const toUnenumerable = (object, key) => defineProperty(object, key, { - enumerable: false, - value: object[key] -}); -function toESTreeLocation(node) { - node.loc.start && toUnenumerable(node.loc.start, "index"); - node.loc.end && toUnenumerable(node.loc.end, "index"); - return node; -} -var estree = (superClass => class ESTreeParserMixin extends superClass { - parse() { - const file = toESTreeLocation(super.parse()); - if (this.options.tokens) { - file.tokens = file.tokens.map(toESTreeLocation); - } - return file; - } - - parseRegExpLiteral({ - pattern, - flags - }) { - let regex = null; - try { - regex = new RegExp(pattern, flags); - } catch (e) { - } - const node = this.estreeParseLiteral(regex); - node.regex = { - pattern, - flags - }; - return node; - } - - parseBigIntLiteral(value) { - let bigInt; - try { - bigInt = BigInt(value); - } catch (_unused) { - bigInt = null; - } - const node = this.estreeParseLiteral(bigInt); - node.bigint = String(node.value || value); - return node; - } - - parseDecimalLiteral(value) { - const decimal = null; - const node = this.estreeParseLiteral(decimal); - node.decimal = String(node.value || value); - return node; - } - estreeParseLiteral(value) { - return this.parseLiteral(value, "Literal"); - } - - parseStringLiteral(value) { - return this.estreeParseLiteral(value); - } - parseNumericLiteral(value) { - return this.estreeParseLiteral(value); - } - - parseNullLiteral() { - return this.estreeParseLiteral(null); - } - parseBooleanLiteral(value) { - return this.estreeParseLiteral(value); - } - - directiveToStmt(directive) { - const expression = directive.value; - delete directive.value; - expression.type = "Literal"; - expression.raw = expression.extra.raw; - expression.value = expression.extra.expressionValue; - const stmt = directive; - stmt.type = "ExpressionStatement"; - stmt.expression = expression; - stmt.directive = expression.extra.rawValue; - delete expression.extra; - return stmt; - } - - initFunction(node, isAsync) { - super.initFunction(node, isAsync); - node.expression = false; - } - checkDeclaration(node) { - if (node != null && this.isObjectProperty(node)) { - this.checkDeclaration(node.value); - } else { - super.checkDeclaration(node); - } - } - getObjectOrClassMethodParams(method) { - return method.value.params; - } - isValidDirective(stmt) { - var _stmt$expression$extr; - return stmt.type === "ExpressionStatement" && stmt.expression.type === "Literal" && typeof stmt.expression.value === "string" && !((_stmt$expression$extr = stmt.expression.extra) != null && _stmt$expression$extr.parenthesized); - } - parseBlockBody(node, allowDirectives, topLevel, end, afterBlockParse) { - super.parseBlockBody(node, allowDirectives, topLevel, end, afterBlockParse); - const directiveStatements = node.directives.map(d => this.directiveToStmt(d)); - node.body = directiveStatements.concat(node.body); - delete node.directives; - } - pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper) { - this.parseMethod(method, isGenerator, isAsync, isConstructor, allowsDirectSuper, "ClassMethod", true); - if (method.typeParameters) { - method.value.typeParameters = method.typeParameters; - delete method.typeParameters; - } - classBody.body.push(method); - } - parsePrivateName() { - const node = super.parsePrivateName(); - { - if (!this.getPluginOption("estree", "classFeatures")) { - return node; - } - } - return this.convertPrivateNameToPrivateIdentifier(node); - } - convertPrivateNameToPrivateIdentifier(node) { - const name = super.getPrivateNameSV(node); - node = node; - delete node.id; - node.name = name; - node.type = "PrivateIdentifier"; - return node; - } - isPrivateName(node) { - { - if (!this.getPluginOption("estree", "classFeatures")) { - return super.isPrivateName(node); - } - } - return node.type === "PrivateIdentifier"; - } - getPrivateNameSV(node) { - { - if (!this.getPluginOption("estree", "classFeatures")) { - return super.getPrivateNameSV(node); - } - } - return node.name; - } - - parseLiteral(value, type) { - const node = super.parseLiteral(value, type); - node.raw = node.extra.raw; - delete node.extra; - return node; - } - parseFunctionBody(node, allowExpression, isMethod = false) { - super.parseFunctionBody(node, allowExpression, isMethod); - node.expression = node.body.type !== "BlockStatement"; - } - - parseMethod(node, isGenerator, isAsync, isConstructor, allowDirectSuper, type, inClassScope = false) { - let funcNode = this.startNode(); - funcNode.kind = node.kind; - funcNode = super.parseMethod( - funcNode, isGenerator, isAsync, isConstructor, allowDirectSuper, type, inClassScope); - funcNode.type = "FunctionExpression"; - delete funcNode.kind; - node.value = funcNode; - if (type === "ClassPrivateMethod") { - node.computed = false; - } - return this.finishNode( - node, "MethodDefinition"); - } - parseClassProperty(...args) { - const propertyNode = super.parseClassProperty(...args); - { - if (!this.getPluginOption("estree", "classFeatures")) { - return propertyNode; - } - } - propertyNode.type = "PropertyDefinition"; - return propertyNode; - } - parseClassPrivateProperty(...args) { - const propertyNode = super.parseClassPrivateProperty(...args); - { - if (!this.getPluginOption("estree", "classFeatures")) { - return propertyNode; - } - } - propertyNode.type = "PropertyDefinition"; - propertyNode.computed = false; - return propertyNode; - } - parseObjectMethod(prop, isGenerator, isAsync, isPattern, isAccessor) { - const node = super.parseObjectMethod(prop, isGenerator, isAsync, isPattern, isAccessor); - if (node) { - node.type = "Property"; - if (node.kind === "method") { - node.kind = "init"; - } - node.shorthand = false; - } - return node; - } - parseObjectProperty(prop, startLoc, isPattern, refExpressionErrors) { - const node = super.parseObjectProperty(prop, startLoc, isPattern, refExpressionErrors); - if (node) { - node.kind = "init"; - node.type = "Property"; - } - return node; - } - isValidLVal(type, isUnparenthesizedInAssign, binding) { - return type === "Property" ? "value" : super.isValidLVal(type, isUnparenthesizedInAssign, binding); - } - isAssignable(node, isBinding) { - if (node != null && this.isObjectProperty(node)) { - return this.isAssignable(node.value, isBinding); - } - return super.isAssignable(node, isBinding); - } - toAssignable(node, isLHS = false) { - if (node != null && this.isObjectProperty(node)) { - const { - key, - value - } = node; - if (this.isPrivateName(key)) { - this.classScope.usePrivateName(this.getPrivateNameSV(key), key.loc.start); - } - this.toAssignable(value, isLHS); - } else { - super.toAssignable(node, isLHS); - } - } - toAssignableObjectExpressionProp(prop, isLast, isLHS) { - if (prop.kind === "get" || prop.kind === "set") { - this.raise(Errors.PatternHasAccessor, { - at: prop.key - }); - } else if (prop.method) { - this.raise(Errors.PatternHasMethod, { - at: prop.key - }); - } else { - super.toAssignableObjectExpressionProp(prop, isLast, isLHS); - } - } - finishCallExpression(unfinished, optional) { - const node = super.finishCallExpression(unfinished, optional); - if (node.callee.type === "Import") { - node.type = "ImportExpression"; - node.source = node.arguments[0]; - if (this.hasPlugin("importAssertions")) { - var _node$arguments$; - node.attributes = (_node$arguments$ = node.arguments[1]) != null ? _node$arguments$ : null; - } - delete node.arguments; - delete node.callee; - } - return node; - } - toReferencedArguments(node - ) { - if (node.type === "ImportExpression") { - return; - } - super.toReferencedArguments(node); - } - parseExport(unfinished, decorators) { - const exportStartLoc = this.state.lastTokStartLoc; - const node = super.parseExport(unfinished, decorators); - switch (node.type) { - case "ExportAllDeclaration": - node.exported = null; - break; - case "ExportNamedDeclaration": - if (node.specifiers.length === 1 && - node.specifiers[0].type === "ExportNamespaceSpecifier") { - node.type = "ExportAllDeclaration"; - node.exported = node.specifiers[0].exported; - delete node.specifiers; - } - - case "ExportDefaultDeclaration": - { - var _declaration$decorato; - const { - declaration - } = node; - if ((declaration == null ? void 0 : declaration.type) === "ClassDeclaration" && ((_declaration$decorato = declaration.decorators) == null ? void 0 : _declaration$decorato.length) > 0 && - declaration.start === node.start) { - this.resetStartLocation(node, - exportStartLoc); - } - } - break; - } - return node; - } - parseSubscript(base, startLoc, noCalls, state) { - const node = super.parseSubscript(base, startLoc, noCalls, state); - if (state.optionalChainMember) { - if (node.type === "OptionalMemberExpression" || node.type === "OptionalCallExpression") { - node.type = node.type.substring(8); - } - - if (state.stop) { - const chain = this.startNodeAtNode(node); - chain.expression = node; - return this.finishNode(chain, "ChainExpression"); - } - } else if (node.type === "MemberExpression" || node.type === "CallExpression") { - node.optional = false; - } - return node; - } - hasPropertyAsPrivateName(node) { - if (node.type === "ChainExpression") { - node = node.expression; - } - return super.hasPropertyAsPrivateName(node); - } - isOptionalChain(node) { - return node.type === "ChainExpression"; - } - - isObjectProperty(node) { - return node.type === "Property" && node.kind === "init" && !node.method; - } - isObjectMethod(node) { - return node.method || node.kind === "get" || node.kind === "set"; - } - finishNodeAt(node, type, endLoc) { - return toESTreeLocation(super.finishNodeAt(node, type, endLoc)); - } - resetStartLocation(node, startLoc) { - super.resetStartLocation(node, startLoc); - toESTreeLocation(node); - } - resetEndLocation(node, endLoc = this.state.lastTokEndLoc) { - super.resetEndLocation(node, endLoc); - toESTreeLocation(node); - } -}); - -class TokContext { - constructor(token, preserveSpace) { - this.token = void 0; - this.preserveSpace = void 0; - this.token = token; - this.preserveSpace = !!preserveSpace; - } -} -const types = { - brace: new TokContext("{"), - j_oTag: new TokContext("...", true) -}; - -{ - types.template = new TokContext("`", true); -} - -const beforeExpr = true; -const startsExpr = true; -const isLoop = true; -const isAssign = true; -const prefix = true; -const postfix = true; -class ExportedTokenType { - constructor(label, conf = {}) { - this.label = void 0; - this.keyword = void 0; - this.beforeExpr = void 0; - this.startsExpr = void 0; - this.rightAssociative = void 0; - this.isLoop = void 0; - this.isAssign = void 0; - this.prefix = void 0; - this.postfix = void 0; - this.binop = void 0; - this.label = label; - this.keyword = conf.keyword; - this.beforeExpr = !!conf.beforeExpr; - this.startsExpr = !!conf.startsExpr; - this.rightAssociative = !!conf.rightAssociative; - this.isLoop = !!conf.isLoop; - this.isAssign = !!conf.isAssign; - this.prefix = !!conf.prefix; - this.postfix = !!conf.postfix; - this.binop = conf.binop != null ? conf.binop : null; - { - this.updateContext = null; - } - } -} - -const keywords$1 = new Map(); -function createKeyword(name, options = {}) { - options.keyword = name; - const token = createToken(name, options); - keywords$1.set(name, token); - return token; -} -function createBinop(name, binop) { - return createToken(name, { - beforeExpr, - binop - }); -} -let tokenTypeCounter = -1; -const tokenTypes = []; -const tokenLabels = []; -const tokenBinops = []; -const tokenBeforeExprs = []; -const tokenStartsExprs = []; -const tokenPrefixes = []; -function createToken(name, options = {}) { - var _options$binop, _options$beforeExpr, _options$startsExpr, _options$prefix; - ++tokenTypeCounter; - tokenLabels.push(name); - tokenBinops.push((_options$binop = options.binop) != null ? _options$binop : -1); - tokenBeforeExprs.push((_options$beforeExpr = options.beforeExpr) != null ? _options$beforeExpr : false); - tokenStartsExprs.push((_options$startsExpr = options.startsExpr) != null ? _options$startsExpr : false); - tokenPrefixes.push((_options$prefix = options.prefix) != null ? _options$prefix : false); - tokenTypes.push(new ExportedTokenType(name, options)); - return tokenTypeCounter; -} -function createKeywordLike(name, options = {}) { - var _options$binop2, _options$beforeExpr2, _options$startsExpr2, _options$prefix2; - ++tokenTypeCounter; - keywords$1.set(name, tokenTypeCounter); - tokenLabels.push(name); - tokenBinops.push((_options$binop2 = options.binop) != null ? _options$binop2 : -1); - tokenBeforeExprs.push((_options$beforeExpr2 = options.beforeExpr) != null ? _options$beforeExpr2 : false); - tokenStartsExprs.push((_options$startsExpr2 = options.startsExpr) != null ? _options$startsExpr2 : false); - tokenPrefixes.push((_options$prefix2 = options.prefix) != null ? _options$prefix2 : false); - tokenTypes.push(new ExportedTokenType("name", options)); - return tokenTypeCounter; -} - -const tt = { - bracketL: createToken("[", { - beforeExpr, - startsExpr - }), - bracketHashL: createToken("#[", { - beforeExpr, - startsExpr - }), - bracketBarL: createToken("[|", { - beforeExpr, - startsExpr - }), - bracketR: createToken("]"), - bracketBarR: createToken("|]"), - braceL: createToken("{", { - beforeExpr, - startsExpr - }), - braceBarL: createToken("{|", { - beforeExpr, - startsExpr - }), - braceHashL: createToken("#{", { - beforeExpr, - startsExpr - }), - braceR: createToken("}"), - braceBarR: createToken("|}"), - parenL: createToken("(", { - beforeExpr, - startsExpr - }), - parenR: createToken(")"), - comma: createToken(",", { - beforeExpr - }), - semi: createToken(";", { - beforeExpr - }), - colon: createToken(":", { - beforeExpr - }), - doubleColon: createToken("::", { - beforeExpr - }), - dot: createToken("."), - question: createToken("?", { - beforeExpr - }), - questionDot: createToken("?."), - arrow: createToken("=>", { - beforeExpr - }), - template: createToken("template"), - ellipsis: createToken("...", { - beforeExpr - }), - backQuote: createToken("`", { - startsExpr - }), - dollarBraceL: createToken("${", { - beforeExpr, - startsExpr - }), - templateTail: createToken("...`", { - startsExpr - }), - templateNonTail: createToken("...${", { - beforeExpr, - startsExpr - }), - at: createToken("@"), - hash: createToken("#", { - startsExpr - }), - interpreterDirective: createToken("#!..."), - - eq: createToken("=", { - beforeExpr, - isAssign - }), - assign: createToken("_=", { - beforeExpr, - isAssign - }), - slashAssign: createToken("_=", { - beforeExpr, - isAssign - }), - xorAssign: createToken("_=", { - beforeExpr, - isAssign - }), - moduloAssign: createToken("_=", { - beforeExpr, - isAssign - }), - - incDec: createToken("++/--", { - prefix, - postfix, - startsExpr - }), - bang: createToken("!", { - beforeExpr, - prefix, - startsExpr - }), - tilde: createToken("~", { - beforeExpr, - prefix, - startsExpr - }), - doubleCaret: createToken("^^", { - startsExpr - }), - doubleAt: createToken("@@", { - startsExpr - }), - pipeline: createBinop("|>", 0), - nullishCoalescing: createBinop("??", 1), - logicalOR: createBinop("||", 1), - logicalAND: createBinop("&&", 2), - bitwiseOR: createBinop("|", 3), - bitwiseXOR: createBinop("^", 4), - bitwiseAND: createBinop("&", 5), - equality: createBinop("==/!=/===/!==", 6), - lt: createBinop("/<=/>=", 7), - gt: createBinop("/<=/>=", 7), - relational: createBinop("/<=/>=", 7), - bitShift: createBinop("<>/>>>", 8), - bitShiftL: createBinop("<>/>>>", 8), - bitShiftR: createBinop("<>/>>>", 8), - plusMin: createToken("+/-", { - beforeExpr, - binop: 9, - prefix, - startsExpr - }), - modulo: createToken("%", { - binop: 10, - startsExpr - }), - star: createToken("*", { - binop: 10 - }), - slash: createBinop("/", 10), - exponent: createToken("**", { - beforeExpr, - binop: 11, - rightAssociative: true - }), - _in: createKeyword("in", { - beforeExpr, - binop: 7 - }), - _instanceof: createKeyword("instanceof", { - beforeExpr, - binop: 7 - }), - _break: createKeyword("break"), - _case: createKeyword("case", { - beforeExpr - }), - _catch: createKeyword("catch"), - _continue: createKeyword("continue"), - _debugger: createKeyword("debugger"), - _default: createKeyword("default", { - beforeExpr - }), - _else: createKeyword("else", { - beforeExpr - }), - _finally: createKeyword("finally"), - _function: createKeyword("function", { - startsExpr - }), - _if: createKeyword("if"), - _return: createKeyword("return", { - beforeExpr - }), - _switch: createKeyword("switch"), - _throw: createKeyword("throw", { - beforeExpr, - prefix, - startsExpr - }), - _try: createKeyword("try"), - _var: createKeyword("var"), - _const: createKeyword("const"), - _with: createKeyword("with"), - _new: createKeyword("new", { - beforeExpr, - startsExpr - }), - _this: createKeyword("this", { - startsExpr - }), - _super: createKeyword("super", { - startsExpr - }), - _class: createKeyword("class", { - startsExpr - }), - _extends: createKeyword("extends", { - beforeExpr - }), - _export: createKeyword("export"), - _import: createKeyword("import", { - startsExpr - }), - _null: createKeyword("null", { - startsExpr - }), - _true: createKeyword("true", { - startsExpr - }), - _false: createKeyword("false", { - startsExpr - }), - _typeof: createKeyword("typeof", { - beforeExpr, - prefix, - startsExpr - }), - _void: createKeyword("void", { - beforeExpr, - prefix, - startsExpr - }), - _delete: createKeyword("delete", { - beforeExpr, - prefix, - startsExpr - }), - _do: createKeyword("do", { - isLoop, - beforeExpr - }), - _for: createKeyword("for", { - isLoop - }), - _while: createKeyword("while", { - isLoop - }), - - _as: createKeywordLike("as", { - startsExpr - }), - _assert: createKeywordLike("assert", { - startsExpr - }), - _async: createKeywordLike("async", { - startsExpr - }), - _await: createKeywordLike("await", { - startsExpr - }), - _from: createKeywordLike("from", { - startsExpr - }), - _get: createKeywordLike("get", { - startsExpr - }), - _let: createKeywordLike("let", { - startsExpr - }), - _meta: createKeywordLike("meta", { - startsExpr - }), - _of: createKeywordLike("of", { - startsExpr - }), - _sent: createKeywordLike("sent", { - startsExpr - }), - _set: createKeywordLike("set", { - startsExpr - }), - _static: createKeywordLike("static", { - startsExpr - }), - _using: createKeywordLike("using", { - startsExpr - }), - _yield: createKeywordLike("yield", { - startsExpr - }), - _asserts: createKeywordLike("asserts", { - startsExpr - }), - _checks: createKeywordLike("checks", { - startsExpr - }), - _exports: createKeywordLike("exports", { - startsExpr - }), - _global: createKeywordLike("global", { - startsExpr - }), - _implements: createKeywordLike("implements", { - startsExpr - }), - _intrinsic: createKeywordLike("intrinsic", { - startsExpr - }), - _infer: createKeywordLike("infer", { - startsExpr - }), - _is: createKeywordLike("is", { - startsExpr - }), - _mixins: createKeywordLike("mixins", { - startsExpr - }), - _proto: createKeywordLike("proto", { - startsExpr - }), - _require: createKeywordLike("require", { - startsExpr - }), - _satisfies: createKeywordLike("satisfies", { - startsExpr - }), - _keyof: createKeywordLike("keyof", { - startsExpr - }), - _readonly: createKeywordLike("readonly", { - startsExpr - }), - _unique: createKeywordLike("unique", { - startsExpr - }), - _abstract: createKeywordLike("abstract", { - startsExpr - }), - _declare: createKeywordLike("declare", { - startsExpr - }), - _enum: createKeywordLike("enum", { - startsExpr - }), - _module: createKeywordLike("module", { - startsExpr - }), - _namespace: createKeywordLike("namespace", { - startsExpr - }), - _interface: createKeywordLike("interface", { - startsExpr - }), - _type: createKeywordLike("type", { - startsExpr - }), - _opaque: createKeywordLike("opaque", { - startsExpr - }), - name: createToken("name", { - startsExpr - }), - - string: createToken("string", { - startsExpr - }), - num: createToken("num", { - startsExpr - }), - bigint: createToken("bigint", { - startsExpr - }), - decimal: createToken("decimal", { - startsExpr - }), - regexp: createToken("regexp", { - startsExpr - }), - privateName: createToken("#name", { - startsExpr - }), - eof: createToken("eof"), - jsxName: createToken("jsxName"), - jsxText: createToken("jsxText", { - beforeExpr: true - }), - jsxTagStart: createToken("jsxTagStart", { - startsExpr: true - }), - jsxTagEnd: createToken("jsxTagEnd"), - placeholder: createToken("%%", { - startsExpr: true - }) -}; -function tokenIsIdentifier(token) { - return token >= 93 && token <= 130; -} -function tokenKeywordOrIdentifierIsKeyword(token) { - return token <= 92; -} -function tokenIsKeywordOrIdentifier(token) { - return token >= 58 && token <= 130; -} -function tokenIsLiteralPropertyName(token) { - return token >= 58 && token <= 134; -} -function tokenComesBeforeExpression(token) { - return tokenBeforeExprs[token]; -} -function tokenCanStartExpression(token) { - return tokenStartsExprs[token]; -} -function tokenIsAssignment(token) { - return token >= 29 && token <= 33; -} -function tokenIsFlowInterfaceOrTypeOrOpaque(token) { - return token >= 127 && token <= 129; -} -function tokenIsLoop(token) { - return token >= 90 && token <= 92; -} -function tokenIsKeyword(token) { - return token >= 58 && token <= 92; -} -function tokenIsOperator(token) { - return token >= 39 && token <= 59; -} -function tokenIsPostfix(token) { - return token === 34; -} -function tokenIsPrefix(token) { - return tokenPrefixes[token]; -} -function tokenIsTSTypeOperator(token) { - return token >= 119 && token <= 121; -} -function tokenIsTSDeclarationStart(token) { - return token >= 122 && token <= 128; -} -function tokenLabelName(token) { - return tokenLabels[token]; -} -function tokenOperatorPrecedence(token) { - return tokenBinops[token]; -} -function tokenIsRightAssociative(token) { - return token === 57; -} -function tokenIsTemplate(token) { - return token >= 24 && token <= 25; -} -function getExportedToken(token) { - return tokenTypes[token]; -} -{ - tokenTypes[8].updateContext = context => { - context.pop(); - }; - tokenTypes[5].updateContext = tokenTypes[7].updateContext = tokenTypes[23].updateContext = context => { - context.push(types.brace); - }; - tokenTypes[22].updateContext = context => { - if (context[context.length - 1] === types.template) { - context.pop(); - } else { - context.push(types.template); - } - }; - tokenTypes[140].updateContext = context => { - context.push(types.j_expr, types.j_oTag); - }; -} - -let nonASCIIidentifierStartChars = "\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u037f\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u052f\u0531-\u0556\u0559\u0560-\u0588\u05d0-\u05ea\u05ef-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u0860-\u086a\u0870-\u0887\u0889-\u088e\u08a0-\u08c9\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u09fc\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0af9\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c39\u0c3d\u0c58-\u0c5a\u0c5d\u0c60\u0c61\u0c80\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cdd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d04-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d54-\u0d56\u0d5f-\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e86-\u0e8a\u0e8c-\u0ea3\u0ea5\u0ea7-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f5\u13f8-\u13fd\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f8\u1700-\u1711\u171f-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1878\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191e\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19b0-\u19c9\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4c\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1c80-\u1c88\u1c90-\u1cba\u1cbd-\u1cbf\u1ce9-\u1cec\u1cee-\u1cf3\u1cf5\u1cf6\u1cfa\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2118-\u211d\u2124\u2126\u2128\u212a-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309b-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312f\u3131-\u318e\u31a0-\u31bf\u31f0-\u31ff\u3400-\u4dbf\u4e00-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua69d\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua7ca\ua7d0\ua7d1\ua7d3\ua7d5-\ua7d9\ua7f2-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua8fd\ua8fe\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\ua9e0-\ua9e4\ua9e6-\ua9ef\ua9fa-\ua9fe\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa7e-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uab30-\uab5a\uab5c-\uab69\uab70-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc"; -let nonASCIIidentifierChars = "\u200c\u200d\xb7\u0300-\u036f\u0387\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u0669\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7\u06e8\u06ea-\u06ed\u06f0-\u06f9\u0711\u0730-\u074a\u07a6-\u07b0\u07c0-\u07c9\u07eb-\u07f3\u07fd\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u0898-\u089f\u08ca-\u08e1\u08e3-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962\u0963\u0966-\u096f\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09cb-\u09cd\u09d7\u09e2\u09e3\u09e6-\u09ef\u09fe\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a66-\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2\u0ae3\u0ae6-\u0aef\u0afa-\u0aff\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b55-\u0b57\u0b62\u0b63\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c00-\u0c04\u0c3c\u0c3e-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0c66-\u0c6f\u0c81-\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0ce6-\u0cef\u0cf3\u0d00-\u0d03\u0d3b\u0d3c\u0d3e-\u0d44\u0d46-\u0d48\u0d4a-\u0d4d\u0d57\u0d62\u0d63\u0d66-\u0d6f\u0d81-\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0de6-\u0def\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0e50-\u0e59\u0eb1\u0eb4-\u0ebc\u0ec8-\u0ece\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e\u0f3f\u0f71-\u0f84\u0f86\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102b-\u103e\u1040-\u1049\u1056-\u1059\u105e-\u1060\u1062-\u1064\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17b4-\u17d3\u17dd\u17e0-\u17e9\u180b-\u180d\u180f-\u1819\u18a9\u1920-\u192b\u1930-\u193b\u1946-\u194f\u19d0-\u19da\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1ab0-\u1abd\u1abf-\u1ace\u1b00-\u1b04\u1b34-\u1b44\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1b82\u1ba1-\u1bad\u1bb0-\u1bb9\u1be6-\u1bf3\u1c24-\u1c37\u1c40-\u1c49\u1c50-\u1c59\u1cd0-\u1cd2\u1cd4-\u1ce8\u1ced\u1cf4\u1cf7-\u1cf9\u1dc0-\u1dff\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua620-\ua629\ua66f\ua674-\ua67d\ua69e\ua69f\ua6f0\ua6f1\ua802\ua806\ua80b\ua823-\ua827\ua82c\ua880\ua881\ua8b4-\ua8c5\ua8d0-\ua8d9\ua8e0-\ua8f1\ua8ff-\ua909\ua926-\ua92d\ua947-\ua953\ua980-\ua983\ua9b3-\ua9c0\ua9d0-\ua9d9\ua9e5\ua9f0-\ua9f9\uaa29-\uaa36\uaa43\uaa4c\uaa4d\uaa50-\uaa59\uaa7b-\uaa7d\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uaaeb-\uaaef\uaaf5\uaaf6\uabe3-\uabea\uabec\uabed\uabf0-\uabf9\ufb1e\ufe00-\ufe0f\ufe20-\ufe2f\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f"; -const nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]"); -const nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]"); -nonASCIIidentifierStartChars = nonASCIIidentifierChars = null; - -const astralIdentifierStartCodes = [0, 11, 2, 25, 2, 18, 2, 1, 2, 14, 3, 13, 35, 122, 70, 52, 268, 28, 4, 48, 48, 31, 14, 29, 6, 37, 11, 29, 3, 35, 5, 7, 2, 4, 43, 157, 19, 35, 5, 35, 5, 39, 9, 51, 13, 10, 2, 14, 2, 6, 2, 1, 2, 10, 2, 14, 2, 6, 2, 1, 68, 310, 10, 21, 11, 7, 25, 5, 2, 41, 2, 8, 70, 5, 3, 0, 2, 43, 2, 1, 4, 0, 3, 22, 11, 22, 10, 30, 66, 18, 2, 1, 11, 21, 11, 25, 71, 55, 7, 1, 65, 0, 16, 3, 2, 2, 2, 28, 43, 28, 4, 28, 36, 7, 2, 27, 28, 53, 11, 21, 11, 18, 14, 17, 111, 72, 56, 50, 14, 50, 14, 35, 349, 41, 7, 1, 79, 28, 11, 0, 9, 21, 43, 17, 47, 20, 28, 22, 13, 52, 58, 1, 3, 0, 14, 44, 33, 24, 27, 35, 30, 0, 3, 0, 9, 34, 4, 0, 13, 47, 15, 3, 22, 0, 2, 0, 36, 17, 2, 24, 20, 1, 64, 6, 2, 0, 2, 3, 2, 14, 2, 9, 8, 46, 39, 7, 3, 1, 3, 21, 2, 6, 2, 1, 2, 4, 4, 0, 19, 0, 13, 4, 159, 52, 19, 3, 21, 2, 31, 47, 21, 1, 2, 0, 185, 46, 42, 3, 37, 47, 21, 0, 60, 42, 14, 0, 72, 26, 38, 6, 186, 43, 117, 63, 32, 7, 3, 0, 3, 7, 2, 1, 2, 23, 16, 0, 2, 0, 95, 7, 3, 38, 17, 0, 2, 0, 29, 0, 11, 39, 8, 0, 22, 0, 12, 45, 20, 0, 19, 72, 264, 8, 2, 36, 18, 0, 50, 29, 113, 6, 2, 1, 2, 37, 22, 0, 26, 5, 2, 1, 2, 31, 15, 0, 328, 18, 16, 0, 2, 12, 2, 33, 125, 0, 80, 921, 103, 110, 18, 195, 2637, 96, 16, 1071, 18, 5, 4026, 582, 8634, 568, 8, 30, 18, 78, 18, 29, 19, 47, 17, 3, 32, 20, 6, 18, 689, 63, 129, 74, 6, 0, 67, 12, 65, 1, 2, 0, 29, 6135, 9, 1237, 43, 8, 8936, 3, 2, 6, 2, 1, 2, 290, 16, 0, 30, 2, 3, 0, 15, 3, 9, 395, 2309, 106, 6, 12, 4, 8, 8, 9, 5991, 84, 2, 70, 2, 1, 3, 0, 3, 1, 3, 3, 2, 11, 2, 0, 2, 6, 2, 64, 2, 3, 3, 7, 2, 6, 2, 27, 2, 3, 2, 4, 2, 0, 4, 6, 2, 339, 3, 24, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 7, 1845, 30, 7, 5, 262, 61, 147, 44, 11, 6, 17, 0, 322, 29, 19, 43, 485, 27, 757, 6, 2, 3, 2, 1, 2, 14, 2, 196, 60, 67, 8, 0, 1205, 3, 2, 26, 2, 1, 2, 0, 3, 0, 2, 9, 2, 3, 2, 0, 2, 0, 7, 0, 5, 0, 2, 0, 2, 0, 2, 2, 2, 1, 2, 0, 3, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 1, 2, 0, 3, 3, 2, 6, 2, 3, 2, 3, 2, 0, 2, 9, 2, 16, 6, 2, 2, 4, 2, 16, 4421, 42719, 33, 4153, 7, 221, 3, 5761, 15, 7472, 3104, 541, 1507, 4938, 6, 4191]; -const astralIdentifierCodes = [509, 0, 227, 0, 150, 4, 294, 9, 1368, 2, 2, 1, 6, 3, 41, 2, 5, 0, 166, 1, 574, 3, 9, 9, 370, 1, 81, 2, 71, 10, 50, 3, 123, 2, 54, 14, 32, 10, 3, 1, 11, 3, 46, 10, 8, 0, 46, 9, 7, 2, 37, 13, 2, 9, 6, 1, 45, 0, 13, 2, 49, 13, 9, 3, 2, 11, 83, 11, 7, 0, 3, 0, 158, 11, 6, 9, 7, 3, 56, 1, 2, 6, 3, 1, 3, 2, 10, 0, 11, 1, 3, 6, 4, 4, 193, 17, 10, 9, 5, 0, 82, 19, 13, 9, 214, 6, 3, 8, 28, 1, 83, 16, 16, 9, 82, 12, 9, 9, 84, 14, 5, 9, 243, 14, 166, 9, 71, 5, 2, 1, 3, 3, 2, 0, 2, 1, 13, 9, 120, 6, 3, 6, 4, 0, 29, 9, 41, 6, 2, 3, 9, 0, 10, 10, 47, 15, 406, 7, 2, 7, 17, 9, 57, 21, 2, 13, 123, 5, 4, 0, 2, 1, 2, 6, 2, 0, 9, 9, 49, 4, 2, 1, 2, 4, 9, 9, 330, 3, 10, 1, 2, 0, 49, 6, 4, 4, 14, 9, 5351, 0, 7, 14, 13835, 9, 87, 9, 39, 4, 60, 6, 26, 9, 1014, 0, 2, 54, 8, 3, 82, 0, 12, 1, 19628, 1, 4706, 45, 3, 22, 543, 4, 4, 5, 9, 7, 3, 6, 31, 3, 149, 2, 1418, 49, 513, 54, 5, 49, 9, 0, 15, 0, 23, 4, 2, 14, 1361, 6, 2, 16, 3, 6, 2, 1, 2, 4, 101, 0, 161, 6, 10, 9, 357, 0, 62, 13, 499, 13, 983, 6, 110, 6, 6, 9, 4759, 9, 787719, 239]; - -function isInAstralSet(code, set) { - let pos = 0x10000; - for (let i = 0, length = set.length; i < length; i += 2) { - pos += set[i]; - if (pos > code) return false; - pos += set[i + 1]; - if (pos >= code) return true; - } - return false; -} - -function isIdentifierStart(code) { - if (code < 65) return code === 36; - if (code <= 90) return true; - if (code < 97) return code === 95; - if (code <= 122) return true; - if (code <= 0xffff) { - return code >= 0xaa && nonASCIIidentifierStart.test(String.fromCharCode(code)); - } - return isInAstralSet(code, astralIdentifierStartCodes); -} - -function isIdentifierChar(code) { - if (code < 48) return code === 36; - if (code < 58) return true; - if (code < 65) return false; - if (code <= 90) return true; - if (code < 97) return code === 95; - if (code <= 122) return true; - if (code <= 0xffff) { - return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code)); - } - return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes); -} - -const reservedWords = { - keyword: ["break", "case", "catch", "continue", "debugger", "default", "do", "else", "finally", "for", "function", "if", "return", "switch", "throw", "try", "var", "const", "while", "with", "new", "this", "super", "class", "extends", "export", "import", "null", "true", "false", "in", "instanceof", "typeof", "void", "delete"], - strict: ["implements", "interface", "let", "package", "private", "protected", "public", "static", "yield"], - strictBind: ["eval", "arguments"] -}; -const keywords = new Set(reservedWords.keyword); -const reservedWordsStrictSet = new Set(reservedWords.strict); -const reservedWordsStrictBindSet = new Set(reservedWords.strictBind); - -function isReservedWord(word, inModule) { - return inModule && word === "await" || word === "enum"; -} - -function isStrictReservedWord(word, inModule) { - return isReservedWord(word, inModule) || reservedWordsStrictSet.has(word); -} - -function isStrictBindOnlyReservedWord(word) { - return reservedWordsStrictBindSet.has(word); -} - -function isStrictBindReservedWord(word, inModule) { - return isStrictReservedWord(word, inModule) || isStrictBindOnlyReservedWord(word); -} -function isKeyword(word) { - return keywords.has(word); -} - -function isIteratorStart(current, next, next2) { - return current === 64 && next === 64 && isIdentifierStart(next2); -} - -const reservedWordLikeSet = new Set(["break", "case", "catch", "continue", "debugger", "default", "do", "else", "finally", "for", "function", "if", "return", "switch", "throw", "try", "var", "const", "while", "with", "new", "this", "super", "class", "extends", "export", "import", "null", "true", "false", "in", "instanceof", "typeof", "void", "delete", -"implements", "interface", "let", "package", "private", "protected", "public", "static", "yield", -"eval", "arguments", -"enum", "await"]); -function canBeReservedWord(word) { - return reservedWordLikeSet.has(word); -} - -const SCOPE_OTHER = 0b000000000, - SCOPE_PROGRAM = 0b000000001, - SCOPE_FUNCTION = 0b000000010, - SCOPE_ARROW = 0b000000100, - SCOPE_SIMPLE_CATCH = 0b000001000, - SCOPE_SUPER = 0b000010000, - SCOPE_DIRECT_SUPER = 0b000100000, - SCOPE_CLASS = 0b001000000, - SCOPE_STATIC_BLOCK = 0b010000000, - SCOPE_TS_MODULE = 0b100000000, - SCOPE_VAR = SCOPE_PROGRAM | SCOPE_FUNCTION | SCOPE_STATIC_BLOCK | SCOPE_TS_MODULE; -const BIND_KIND_VALUE = 0b000000000001, - BIND_KIND_TYPE = 0b000000000010, - BIND_SCOPE_VAR = 0b000000000100, - BIND_SCOPE_LEXICAL = 0b000000001000, - BIND_SCOPE_FUNCTION = 0b000000010000, - BIND_FLAGS_NONE = 0b0000001000000, - BIND_FLAGS_CLASS = 0b0000010000000, - BIND_FLAGS_TS_ENUM = 0b0000100000000, - BIND_FLAGS_TS_CONST_ENUM = 0b0001000000000, - BIND_FLAGS_TS_EXPORT_ONLY = 0b0010000000000, - BIND_FLAGS_FLOW_DECLARE_FN = 0b0100000000000, - BIND_FLAGS_TS_IMPORT = 0b1000000000000; - -const BIND_CLASS = BIND_KIND_VALUE | BIND_KIND_TYPE | BIND_SCOPE_LEXICAL | BIND_FLAGS_CLASS, - BIND_LEXICAL = BIND_KIND_VALUE | 0 | BIND_SCOPE_LEXICAL | 0, - BIND_VAR = BIND_KIND_VALUE | 0 | BIND_SCOPE_VAR | 0, - BIND_FUNCTION = BIND_KIND_VALUE | 0 | BIND_SCOPE_FUNCTION | 0, - BIND_TS_INTERFACE = 0 | BIND_KIND_TYPE | 0 | BIND_FLAGS_CLASS, - BIND_TS_TYPE = 0 | BIND_KIND_TYPE | 0 | 0, - BIND_TS_ENUM = BIND_KIND_VALUE | BIND_KIND_TYPE | BIND_SCOPE_LEXICAL | BIND_FLAGS_TS_ENUM, - BIND_TS_AMBIENT = 0 | 0 | 0 | BIND_FLAGS_TS_EXPORT_ONLY, - BIND_NONE = 0 | 0 | 0 | BIND_FLAGS_NONE, - BIND_OUTSIDE = BIND_KIND_VALUE | 0 | 0 | BIND_FLAGS_NONE, - BIND_TS_CONST_ENUM = BIND_TS_ENUM | BIND_FLAGS_TS_CONST_ENUM, - BIND_TS_NAMESPACE = 0 | 0 | 0 | BIND_FLAGS_TS_EXPORT_ONLY, - BIND_TS_TYPE_IMPORT = 0 | BIND_KIND_TYPE | 0 | BIND_FLAGS_TS_IMPORT, - BIND_FLOW_DECLARE_FN = BIND_FLAGS_FLOW_DECLARE_FN; -const CLASS_ELEMENT_FLAG_STATIC = 0b100, - CLASS_ELEMENT_KIND_GETTER = 0b010, - CLASS_ELEMENT_KIND_SETTER = 0b001, - CLASS_ELEMENT_KIND_ACCESSOR = CLASS_ELEMENT_KIND_GETTER | CLASS_ELEMENT_KIND_SETTER; - -const CLASS_ELEMENT_STATIC_GETTER = CLASS_ELEMENT_KIND_GETTER | CLASS_ELEMENT_FLAG_STATIC, - CLASS_ELEMENT_STATIC_SETTER = CLASS_ELEMENT_KIND_SETTER | CLASS_ELEMENT_FLAG_STATIC, - CLASS_ELEMENT_INSTANCE_GETTER = CLASS_ELEMENT_KIND_GETTER, - CLASS_ELEMENT_INSTANCE_SETTER = CLASS_ELEMENT_KIND_SETTER, - CLASS_ELEMENT_OTHER = 0; - -class Scope { - - constructor(flags) { - this.var = new Set(); - this.lexical = new Set(); - this.functions = new Set(); - this.flags = flags; - } -} - -class ScopeHandler { - constructor(parser, inModule) { - this.parser = void 0; - this.scopeStack = []; - this.inModule = void 0; - this.undefinedExports = new Map(); - this.parser = parser; - this.inModule = inModule; - } - get inTopLevel() { - return (this.currentScope().flags & SCOPE_PROGRAM) > 0; - } - get inFunction() { - return (this.currentVarScopeFlags() & SCOPE_FUNCTION) > 0; - } - get allowSuper() { - return (this.currentThisScopeFlags() & SCOPE_SUPER) > 0; - } - get allowDirectSuper() { - return (this.currentThisScopeFlags() & SCOPE_DIRECT_SUPER) > 0; - } - get inClass() { - return (this.currentThisScopeFlags() & SCOPE_CLASS) > 0; - } - get inClassAndNotInNonArrowFunction() { - const flags = this.currentThisScopeFlags(); - return (flags & SCOPE_CLASS) > 0 && (flags & SCOPE_FUNCTION) === 0; - } - get inStaticBlock() { - for (let i = this.scopeStack.length - 1;; i--) { - const { - flags - } = this.scopeStack[i]; - if (flags & SCOPE_STATIC_BLOCK) { - return true; - } - if (flags & (SCOPE_VAR | SCOPE_CLASS)) { - return false; - } - } - } - get inNonArrowFunction() { - return (this.currentThisScopeFlags() & SCOPE_FUNCTION) > 0; - } - get treatFunctionsAsVar() { - return this.treatFunctionsAsVarInScope(this.currentScope()); - } - createScope(flags) { - return new Scope(flags); - } - enter(flags) { - this.scopeStack.push(this.createScope(flags)); - } - exit() { - const scope = this.scopeStack.pop(); - return scope.flags; - } - - treatFunctionsAsVarInScope(scope) { - return !!(scope.flags & (SCOPE_FUNCTION | SCOPE_STATIC_BLOCK) || !this.parser.inModule && scope.flags & SCOPE_PROGRAM); - } - declareName(name, bindingType, loc) { - let scope = this.currentScope(); - if (bindingType & BIND_SCOPE_LEXICAL || bindingType & BIND_SCOPE_FUNCTION) { - this.checkRedeclarationInScope(scope, name, bindingType, loc); - if (bindingType & BIND_SCOPE_FUNCTION) { - scope.functions.add(name); - } else { - scope.lexical.add(name); - } - if (bindingType & BIND_SCOPE_LEXICAL) { - this.maybeExportDefined(scope, name); - } - } else if (bindingType & BIND_SCOPE_VAR) { - for (let i = this.scopeStack.length - 1; i >= 0; --i) { - scope = this.scopeStack[i]; - this.checkRedeclarationInScope(scope, name, bindingType, loc); - scope.var.add(name); - this.maybeExportDefined(scope, name); - if (scope.flags & SCOPE_VAR) break; - } - } - if (this.parser.inModule && scope.flags & SCOPE_PROGRAM) { - this.undefinedExports.delete(name); - } - } - maybeExportDefined(scope, name) { - if (this.parser.inModule && scope.flags & SCOPE_PROGRAM) { - this.undefinedExports.delete(name); - } - } - checkRedeclarationInScope(scope, name, bindingType, loc) { - if (this.isRedeclaredInScope(scope, name, bindingType)) { - this.parser.raise(Errors.VarRedeclaration, { - at: loc, - identifierName: name - }); - } - } - isRedeclaredInScope(scope, name, bindingType) { - if (!(bindingType & BIND_KIND_VALUE)) return false; - if (bindingType & BIND_SCOPE_LEXICAL) { - return scope.lexical.has(name) || scope.functions.has(name) || scope.var.has(name); - } - if (bindingType & BIND_SCOPE_FUNCTION) { - return scope.lexical.has(name) || !this.treatFunctionsAsVarInScope(scope) && scope.var.has(name); - } - return scope.lexical.has(name) && !(scope.flags & SCOPE_SIMPLE_CATCH && scope.lexical.values().next().value === name) || !this.treatFunctionsAsVarInScope(scope) && scope.functions.has(name); - } - checkLocalExport(id) { - const { - name - } = id; - const topLevelScope = this.scopeStack[0]; - if (!topLevelScope.lexical.has(name) && !topLevelScope.var.has(name) && - !topLevelScope.functions.has(name)) { - this.undefinedExports.set(name, id.loc.start); - } - } - currentScope() { - return this.scopeStack[this.scopeStack.length - 1]; - } - currentVarScopeFlags() { - for (let i = this.scopeStack.length - 1;; i--) { - const { - flags - } = this.scopeStack[i]; - if (flags & SCOPE_VAR) { - return flags; - } - } - } - - currentThisScopeFlags() { - for (let i = this.scopeStack.length - 1;; i--) { - const { - flags - } = this.scopeStack[i]; - if (flags & (SCOPE_VAR | SCOPE_CLASS) && !(flags & SCOPE_ARROW)) { - return flags; - } - } - } -} - -class FlowScope extends Scope { - constructor(...args) { - super(...args); - this.declareFunctions = new Set(); - } -} -class FlowScopeHandler extends ScopeHandler { - createScope(flags) { - return new FlowScope(flags); - } - declareName(name, bindingType, loc) { - const scope = this.currentScope(); - if (bindingType & BIND_FLAGS_FLOW_DECLARE_FN) { - this.checkRedeclarationInScope(scope, name, bindingType, loc); - this.maybeExportDefined(scope, name); - scope.declareFunctions.add(name); - return; - } - super.declareName(name, bindingType, loc); - } - isRedeclaredInScope(scope, name, bindingType) { - if (super.isRedeclaredInScope(scope, name, bindingType)) return true; - if (bindingType & BIND_FLAGS_FLOW_DECLARE_FN) { - return !scope.declareFunctions.has(name) && (scope.lexical.has(name) || scope.functions.has(name)); - } - return false; - } - checkLocalExport(id) { - if (!this.scopeStack[0].declareFunctions.has(id.name)) { - super.checkLocalExport(id); - } - } -} - -class BaseParser { - constructor() { - this.sawUnambiguousESM = false; - this.ambiguousScriptDifferentAst = false; - } - hasPlugin(pluginConfig) { - if (typeof pluginConfig === "string") { - return this.plugins.has(pluginConfig); - } else { - const [pluginName, pluginOptions] = pluginConfig; - if (!this.hasPlugin(pluginName)) { - return false; - } - const actualOptions = this.plugins.get(pluginName); - for (const key of Object.keys(pluginOptions)) { - if ((actualOptions == null ? void 0 : actualOptions[key]) !== pluginOptions[key]) { - return false; - } - } - return true; - } - } - getPluginOption(plugin, name) { - var _this$plugins$get; - return (_this$plugins$get = this.plugins.get(plugin)) == null ? void 0 : _this$plugins$get[name]; - } -} - -function setTrailingComments(node, comments) { - if (node.trailingComments === undefined) { - node.trailingComments = comments; - } else { - node.trailingComments.unshift(...comments); - } -} - -function setLeadingComments(node, comments) { - if (node.leadingComments === undefined) { - node.leadingComments = comments; - } else { - node.leadingComments.unshift(...comments); - } -} - -function setInnerComments(node, comments) { - if (node.innerComments === undefined) { - node.innerComments = comments; - } else { - node.innerComments.unshift(...comments); - } -} - -function adjustInnerComments(node, elements, commentWS) { - let lastElement = null; - let i = elements.length; - while (lastElement === null && i > 0) { - lastElement = elements[--i]; - } - if (lastElement === null || lastElement.start > commentWS.start) { - setInnerComments(node, commentWS.comments); - } else { - setTrailingComments(lastElement, commentWS.comments); - } -} - -class CommentsParser extends BaseParser { - addComment(comment) { - if (this.filename) comment.loc.filename = this.filename; - this.state.comments.push(comment); - } - - processComment(node) { - const { - commentStack - } = this.state; - const commentStackLength = commentStack.length; - if (commentStackLength === 0) return; - let i = commentStackLength - 1; - const lastCommentWS = commentStack[i]; - if (lastCommentWS.start === node.end) { - lastCommentWS.leadingNode = node; - i--; - } - const { - start: nodeStart - } = node; - for (; i >= 0; i--) { - const commentWS = commentStack[i]; - const commentEnd = commentWS.end; - if (commentEnd > nodeStart) { - commentWS.containingNode = node; - this.finalizeComment(commentWS); - commentStack.splice(i, 1); - } else { - if (commentEnd === nodeStart) { - commentWS.trailingNode = node; - } - break; - } - } - } - - finalizeComment(commentWS) { - const { - comments - } = commentWS; - if (commentWS.leadingNode !== null || commentWS.trailingNode !== null) { - if (commentWS.leadingNode !== null) { - setTrailingComments(commentWS.leadingNode, comments); - } - if (commentWS.trailingNode !== null) { - setLeadingComments(commentWS.trailingNode, comments); - } - } else { - const { - containingNode: node, - start: commentStart - } = commentWS; - if (this.input.charCodeAt(commentStart - 1) === 44) { - switch (node.type) { - case "ObjectExpression": - case "ObjectPattern": - case "RecordExpression": - adjustInnerComments(node, node.properties, commentWS); - break; - case "CallExpression": - case "OptionalCallExpression": - adjustInnerComments(node, node.arguments, commentWS); - break; - case "FunctionDeclaration": - case "FunctionExpression": - case "ArrowFunctionExpression": - case "ObjectMethod": - case "ClassMethod": - case "ClassPrivateMethod": - adjustInnerComments(node, node.params, commentWS); - break; - case "ArrayExpression": - case "ArrayPattern": - case "TupleExpression": - adjustInnerComments(node, node.elements, commentWS); - break; - case "ExportNamedDeclaration": - case "ImportDeclaration": - adjustInnerComments(node, node.specifiers, commentWS); - break; - default: - { - setInnerComments(node, comments); - } - } - } else { - setInnerComments(node, comments); - } - } - } - - finalizeRemainingComments() { - const { - commentStack - } = this.state; - for (let i = commentStack.length - 1; i >= 0; i--) { - this.finalizeComment(commentStack[i]); - } - this.state.commentStack = []; - } - - resetPreviousNodeTrailingComments(node) { - const { - commentStack - } = this.state; - const { - length - } = commentStack; - if (length === 0) return; - const commentWS = commentStack[length - 1]; - if (commentWS.leadingNode === node) { - commentWS.leadingNode = null; - } - } - - takeSurroundingComments(node, start, end) { - const { - commentStack - } = this.state; - const commentStackLength = commentStack.length; - if (commentStackLength === 0) return; - let i = commentStackLength - 1; - for (; i >= 0; i--) { - const commentWS = commentStack[i]; - const commentEnd = commentWS.end; - const commentStart = commentWS.start; - if (commentStart === end) { - commentWS.leadingNode = node; - } else if (commentEnd === start) { - commentWS.trailingNode = node; - } else if (commentEnd < start) { - break; - } - } - } -} - -const lineBreak = /\r\n?|[\n\u2028\u2029]/; -const lineBreakG = new RegExp(lineBreak.source, "g"); - -function isNewLine(code) { - switch (code) { - case 10: - case 13: - case 8232: - case 8233: - return true; - default: - return false; - } -} -const skipWhiteSpace = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g; -const skipWhiteSpaceInLine = /(?:[^\S\n\r\u2028\u2029]|\/\/.*|\/\*.*?\*\/)*/y; - -const skipWhiteSpaceToLineBreak = new RegExp( -"(?=(" + -skipWhiteSpaceInLine.source + "))\\1" + -/(?=[\n\r\u2028\u2029]|\/\*(?!.*?\*\/)|$)/.source, "y"); - -function isWhitespace(code) { - switch (code) { - case 0x0009: - case 0x000b: - case 0x000c: - case 32: - case 160: - case 5760: - case 0x2000: - case 0x2001: - case 0x2002: - case 0x2003: - case 0x2004: - case 0x2005: - case 0x2006: - case 0x2007: - case 0x2008: - case 0x2009: - case 0x200a: - case 0x202f: - case 0x205f: - case 0x3000: - case 0xfeff: - return true; - default: - return false; - } -} - -class State { - constructor() { - this.strict = void 0; - this.curLine = void 0; - this.lineStart = void 0; - this.startLoc = void 0; - this.endLoc = void 0; - this.errors = []; - this.potentialArrowAt = -1; - this.noArrowAt = []; - this.noArrowParamsConversionAt = []; - this.maybeInArrowParameters = false; - this.inType = false; - this.noAnonFunctionType = false; - this.hasFlowComment = false; - this.isAmbientContext = false; - this.inAbstractClass = false; - this.inDisallowConditionalTypesContext = false; - this.topicContext = { - maxNumOfResolvableTopics: 0, - maxTopicIndex: null - }; - this.soloAwait = false; - this.inFSharpPipelineDirectBody = false; - this.labels = []; - this.comments = []; - this.commentStack = []; - this.pos = 0; - this.type = 137; - this.value = null; - this.start = 0; - this.end = 0; - this.lastTokEndLoc = null; - this.lastTokStartLoc = null; - this.lastTokStart = 0; - this.context = [types.brace]; - this.canStartJSXElement = true; - this.containsEsc = false; - this.firstInvalidTemplateEscapePos = null; - this.strictErrors = new Map(); - this.tokensLength = 0; - } - init({ - strictMode, - sourceType, - startLine, - startColumn - }) { - this.strict = strictMode === false ? false : strictMode === true ? true : sourceType === "module"; - this.curLine = startLine; - this.lineStart = -startColumn; - this.startLoc = this.endLoc = new Position(startLine, startColumn, 0); - } - curPosition() { - return new Position(this.curLine, this.pos - this.lineStart, this.pos); - } - clone(skipArrays) { - const state = new State(); - const keys = Object.keys(this); - for (let i = 0, length = keys.length; i < length; i++) { - const key = keys[i]; - let val = this[key]; - if (!skipArrays && Array.isArray(val)) { - val = val.slice(); - } - - state[key] = val; - } - return state; - } -} - -var _isDigit = function isDigit(code) { - return code >= 48 && code <= 57; -}; -const forbiddenNumericSeparatorSiblings = { - decBinOct: new Set([46, 66, 69, 79, 95, 98, 101, 111]), - hex: new Set([46, 88, 95, 120]) -}; -const isAllowedNumericSeparatorSibling = { - bin: ch => ch === 48 || ch === 49, - oct: ch => ch >= 48 && ch <= 55, - dec: ch => ch >= 48 && ch <= 57, - hex: ch => ch >= 48 && ch <= 57 || ch >= 65 && ch <= 70 || ch >= 97 && ch <= 102 -}; -function readStringContents(type, input, pos, lineStart, curLine, errors) { - const initialPos = pos; - const initialLineStart = lineStart; - const initialCurLine = curLine; - let out = ""; - let firstInvalidLoc = null; - let chunkStart = pos; - const { - length - } = input; - for (;;) { - if (pos >= length) { - errors.unterminated(initialPos, initialLineStart, initialCurLine); - out += input.slice(chunkStart, pos); - break; - } - const ch = input.charCodeAt(pos); - if (isStringEnd(type, ch, input, pos)) { - out += input.slice(chunkStart, pos); - break; - } - if (ch === 92) { - out += input.slice(chunkStart, pos); - const res = readEscapedChar(input, pos, lineStart, curLine, type === "template", errors); - if (res.ch === null && !firstInvalidLoc) { - firstInvalidLoc = { - pos, - lineStart, - curLine - }; - } else { - out += res.ch; - } - ({ - pos, - lineStart, - curLine - } = res); - chunkStart = pos; - } else if (ch === 8232 || ch === 8233) { - ++pos; - ++curLine; - lineStart = pos; - } else if (ch === 10 || ch === 13) { - if (type === "template") { - out += input.slice(chunkStart, pos) + "\n"; - ++pos; - if (ch === 13 && input.charCodeAt(pos) === 10) { - ++pos; - } - ++curLine; - chunkStart = lineStart = pos; - } else { - errors.unterminated(initialPos, initialLineStart, initialCurLine); - } - } else { - ++pos; - } - } - return { - pos, - str: out, - firstInvalidLoc, - lineStart, - curLine, - containsInvalid: !!firstInvalidLoc - }; -} -function isStringEnd(type, ch, input, pos) { - if (type === "template") { - return ch === 96 || ch === 36 && input.charCodeAt(pos + 1) === 123; - } - return ch === (type === "double" ? 34 : 39); -} -function readEscapedChar(input, pos, lineStart, curLine, inTemplate, errors) { - const throwOnInvalid = !inTemplate; - pos++; - - const res = ch => ({ - pos, - ch, - lineStart, - curLine - }); - const ch = input.charCodeAt(pos++); - switch (ch) { - case 110: - return res("\n"); - case 114: - return res("\r"); - case 120: - { - let code; - ({ - code, - pos - } = readHexChar(input, pos, lineStart, curLine, 2, false, throwOnInvalid, errors)); - return res(code === null ? null : String.fromCharCode(code)); - } - case 117: - { - let code; - ({ - code, - pos - } = readCodePoint(input, pos, lineStart, curLine, throwOnInvalid, errors)); - return res(code === null ? null : String.fromCodePoint(code)); - } - case 116: - return res("\t"); - case 98: - return res("\b"); - case 118: - return res("\u000b"); - case 102: - return res("\f"); - case 13: - if (input.charCodeAt(pos) === 10) { - ++pos; - } - case 10: - lineStart = pos; - ++curLine; - case 8232: - case 8233: - return res(""); - case 56: - case 57: - if (inTemplate) { - return res(null); - } else { - errors.strictNumericEscape(pos - 1, lineStart, curLine); - } - default: - if (ch >= 48 && ch <= 55) { - const startPos = pos - 1; - const match = input.slice(startPos, pos + 2).match(/^[0-7]+/); - let octalStr = match[0]; - let octal = parseInt(octalStr, 8); - if (octal > 255) { - octalStr = octalStr.slice(0, -1); - octal = parseInt(octalStr, 8); - } - pos += octalStr.length - 1; - const next = input.charCodeAt(pos); - if (octalStr !== "0" || next === 56 || next === 57) { - if (inTemplate) { - return res(null); - } else { - errors.strictNumericEscape(startPos, lineStart, curLine); - } - } - return res(String.fromCharCode(octal)); - } - return res(String.fromCharCode(ch)); - } -} -function readHexChar(input, pos, lineStart, curLine, len, forceLen, throwOnInvalid, errors) { - const initialPos = pos; - let n; - ({ - n, - pos - } = readInt(input, pos, lineStart, curLine, 16, len, forceLen, false, errors, !throwOnInvalid)); - if (n === null) { - if (throwOnInvalid) { - errors.invalidEscapeSequence(initialPos, lineStart, curLine); - } else { - pos = initialPos - 1; - } - } - return { - code: n, - pos - }; -} -function readInt(input, pos, lineStart, curLine, radix, len, forceLen, allowNumSeparator, errors, bailOnError) { - const start = pos; - const forbiddenSiblings = radix === 16 ? forbiddenNumericSeparatorSiblings.hex : forbiddenNumericSeparatorSiblings.decBinOct; - const isAllowedSibling = radix === 16 ? isAllowedNumericSeparatorSibling.hex : radix === 10 ? isAllowedNumericSeparatorSibling.dec : radix === 8 ? isAllowedNumericSeparatorSibling.oct : isAllowedNumericSeparatorSibling.bin; - let invalid = false; - let total = 0; - for (let i = 0, e = len == null ? Infinity : len; i < e; ++i) { - const code = input.charCodeAt(pos); - let val; - if (code === 95 && allowNumSeparator !== "bail") { - const prev = input.charCodeAt(pos - 1); - const next = input.charCodeAt(pos + 1); - if (!allowNumSeparator) { - if (bailOnError) return { - n: null, - pos - }; - errors.numericSeparatorInEscapeSequence(pos, lineStart, curLine); - } else if (Number.isNaN(next) || !isAllowedSibling(next) || forbiddenSiblings.has(prev) || forbiddenSiblings.has(next)) { - if (bailOnError) return { - n: null, - pos - }; - errors.unexpectedNumericSeparator(pos, lineStart, curLine); - } - - ++pos; - continue; - } - if (code >= 97) { - val = code - 97 + 10; - } else if (code >= 65) { - val = code - 65 + 10; - } else if (_isDigit(code)) { - val = code - 48; - } else { - val = Infinity; - } - if (val >= radix) { - if (val <= 9 && bailOnError) { - return { - n: null, - pos - }; - } else if (val <= 9 && errors.invalidDigit(pos, lineStart, curLine, radix)) { - val = 0; - } else if (forceLen) { - val = 0; - invalid = true; - } else { - break; - } - } - ++pos; - total = total * radix + val; - } - if (pos === start || len != null && pos - start !== len || invalid) { - return { - n: null, - pos - }; - } - return { - n: total, - pos - }; -} -function readCodePoint(input, pos, lineStart, curLine, throwOnInvalid, errors) { - const ch = input.charCodeAt(pos); - let code; - if (ch === 123) { - ++pos; - ({ - code, - pos - } = readHexChar(input, pos, lineStart, curLine, input.indexOf("}", pos) - pos, true, throwOnInvalid, errors)); - ++pos; - if (code !== null && code > 0x10ffff) { - if (throwOnInvalid) { - errors.invalidCodePoint(pos, lineStart, curLine); - } else { - return { - code: null, - pos - }; - } - } - } else { - ({ - code, - pos - } = readHexChar(input, pos, lineStart, curLine, 4, false, throwOnInvalid, errors)); - } - return { - code, - pos - }; -} - -const _excluded = ["at"], - _excluded2 = ["at"]; -function buildPosition(pos, lineStart, curLine) { - return new Position(curLine, pos - lineStart, pos); -} -const VALID_REGEX_FLAGS = new Set([103, 109, 115, 105, 121, 117, 100, 118]); - -class Token { - constructor(state) { - this.type = state.type; - this.value = state.value; - this.start = state.start; - this.end = state.end; - this.loc = new SourceLocation(state.startLoc, state.endLoc); - } -} - -class Tokenizer extends CommentsParser { - - constructor(options, input) { - super(); - this.isLookahead = void 0; - this.tokens = []; - this.errorHandlers_readInt = { - invalidDigit: (pos, lineStart, curLine, radix) => { - if (!this.options.errorRecovery) return false; - this.raise(Errors.InvalidDigit, { - at: buildPosition(pos, lineStart, curLine), - radix - }); - return true; - }, - numericSeparatorInEscapeSequence: this.errorBuilder(Errors.NumericSeparatorInEscapeSequence), - unexpectedNumericSeparator: this.errorBuilder(Errors.UnexpectedNumericSeparator) - }; - this.errorHandlers_readCodePoint = Object.assign({}, this.errorHandlers_readInt, { - invalidEscapeSequence: this.errorBuilder(Errors.InvalidEscapeSequence), - invalidCodePoint: this.errorBuilder(Errors.InvalidCodePoint) - }); - this.errorHandlers_readStringContents_string = Object.assign({}, this.errorHandlers_readCodePoint, { - strictNumericEscape: (pos, lineStart, curLine) => { - this.recordStrictModeErrors(Errors.StrictNumericEscape, { - at: buildPosition(pos, lineStart, curLine) - }); - }, - unterminated: (pos, lineStart, curLine) => { - throw this.raise(Errors.UnterminatedString, { - at: buildPosition(pos - 1, lineStart, curLine) - }); - } - }); - this.errorHandlers_readStringContents_template = Object.assign({}, this.errorHandlers_readCodePoint, { - strictNumericEscape: this.errorBuilder(Errors.StrictNumericEscape), - unterminated: (pos, lineStart, curLine) => { - throw this.raise(Errors.UnterminatedTemplate, { - at: buildPosition(pos, lineStart, curLine) - }); - } - }); - this.state = new State(); - this.state.init(options); - this.input = input; - this.length = input.length; - this.isLookahead = false; - } - pushToken(token) { - this.tokens.length = this.state.tokensLength; - this.tokens.push(token); - ++this.state.tokensLength; - } - - next() { - this.checkKeywordEscapes(); - if (this.options.tokens) { - this.pushToken(new Token(this.state)); - } - this.state.lastTokStart = this.state.start; - this.state.lastTokEndLoc = this.state.endLoc; - this.state.lastTokStartLoc = this.state.startLoc; - this.nextToken(); - } - - eat(type) { - if (this.match(type)) { - this.next(); - return true; - } else { - return false; - } - } - - match(type) { - return this.state.type === type; - } - - createLookaheadState(state) { - return { - pos: state.pos, - value: null, - type: state.type, - start: state.start, - end: state.end, - context: [this.curContext()], - inType: state.inType, - startLoc: state.startLoc, - lastTokEndLoc: state.lastTokEndLoc, - curLine: state.curLine, - lineStart: state.lineStart, - curPosition: state.curPosition - }; - } - - lookahead() { - const old = this.state; - this.state = this.createLookaheadState(old); - this.isLookahead = true; - this.nextToken(); - this.isLookahead = false; - const curr = this.state; - this.state = old; - return curr; - } - nextTokenStart() { - return this.nextTokenStartSince(this.state.pos); - } - nextTokenStartSince(pos) { - skipWhiteSpace.lastIndex = pos; - return skipWhiteSpace.test(this.input) ? skipWhiteSpace.lastIndex : pos; - } - lookaheadCharCode() { - return this.input.charCodeAt(this.nextTokenStart()); - } - codePointAtPos(pos) { - let cp = this.input.charCodeAt(pos); - if ((cp & 0xfc00) === 0xd800 && ++pos < this.input.length) { - const trail = this.input.charCodeAt(pos); - if ((trail & 0xfc00) === 0xdc00) { - cp = 0x10000 + ((cp & 0x3ff) << 10) + (trail & 0x3ff); - } - } - return cp; - } - - setStrict(strict) { - this.state.strict = strict; - if (strict) { - this.state.strictErrors.forEach(([toParseError, at]) => this.raise(toParseError, { - at - })); - this.state.strictErrors.clear(); - } - } - curContext() { - return this.state.context[this.state.context.length - 1]; - } - - nextToken() { - this.skipSpace(); - this.state.start = this.state.pos; - if (!this.isLookahead) this.state.startLoc = this.state.curPosition(); - if (this.state.pos >= this.length) { - this.finishToken(137); - return; - } - this.getTokenFromCode(this.codePointAtPos(this.state.pos)); - } - - skipBlockComment(commentEnd) { - let startLoc; - if (!this.isLookahead) startLoc = this.state.curPosition(); - const start = this.state.pos; - const end = this.input.indexOf(commentEnd, start + 2); - if (end === -1) { - throw this.raise(Errors.UnterminatedComment, { - at: this.state.curPosition() - }); - } - this.state.pos = end + commentEnd.length; - lineBreakG.lastIndex = start + 2; - while (lineBreakG.test(this.input) && lineBreakG.lastIndex <= end) { - ++this.state.curLine; - this.state.lineStart = lineBreakG.lastIndex; - } - - if (this.isLookahead) return; - - const comment = { - type: "CommentBlock", - value: this.input.slice(start + 2, end), - start, - end: end + commentEnd.length, - loc: new SourceLocation(startLoc, this.state.curPosition()) - }; - if (this.options.tokens) this.pushToken(comment); - return comment; - } - skipLineComment(startSkip) { - const start = this.state.pos; - let startLoc; - if (!this.isLookahead) startLoc = this.state.curPosition(); - let ch = this.input.charCodeAt(this.state.pos += startSkip); - if (this.state.pos < this.length) { - while (!isNewLine(ch) && ++this.state.pos < this.length) { - ch = this.input.charCodeAt(this.state.pos); - } - } - - if (this.isLookahead) return; - - const end = this.state.pos; - const value = this.input.slice(start + startSkip, end); - const comment = { - type: "CommentLine", - value, - start, - end, - loc: new SourceLocation(startLoc, this.state.curPosition()) - }; - if (this.options.tokens) this.pushToken(comment); - return comment; - } - - skipSpace() { - const spaceStart = this.state.pos; - const comments = []; - loop: while (this.state.pos < this.length) { - const ch = this.input.charCodeAt(this.state.pos); - switch (ch) { - case 32: - case 160: - case 9: - ++this.state.pos; - break; - case 13: - if (this.input.charCodeAt(this.state.pos + 1) === 10) { - ++this.state.pos; - } - case 10: - case 8232: - case 8233: - ++this.state.pos; - ++this.state.curLine; - this.state.lineStart = this.state.pos; - break; - case 47: - switch (this.input.charCodeAt(this.state.pos + 1)) { - case 42: - { - const comment = this.skipBlockComment("*/"); - if (comment !== undefined) { - this.addComment(comment); - if (this.options.attachComment) comments.push(comment); - } - break; - } - case 47: - { - const comment = this.skipLineComment(2); - if (comment !== undefined) { - this.addComment(comment); - if (this.options.attachComment) comments.push(comment); - } - break; - } - default: - break loop; - } - break; - default: - if (isWhitespace(ch)) { - ++this.state.pos; - } else if (ch === 45 && !this.inModule) { - const pos = this.state.pos; - if (this.input.charCodeAt(pos + 1) === 45 && this.input.charCodeAt(pos + 2) === 62 && (spaceStart === 0 || this.state.lineStart > spaceStart)) { - const comment = this.skipLineComment(3); - if (comment !== undefined) { - this.addComment(comment); - if (this.options.attachComment) comments.push(comment); - } - } else { - break loop; - } - } else if (ch === 60 && !this.inModule) { - const pos = this.state.pos; - if (this.input.charCodeAt(pos + 1) === 33 && this.input.charCodeAt(pos + 2) === 45 && this.input.charCodeAt(pos + 3) === 45) { - const comment = this.skipLineComment(4); - if (comment !== undefined) { - this.addComment(comment); - if (this.options.attachComment) comments.push(comment); - } - } else { - break loop; - } - } else { - break loop; - } - } - } - if (comments.length > 0) { - const end = this.state.pos; - const commentWhitespace = { - start: spaceStart, - end, - comments, - leadingNode: null, - trailingNode: null, - containingNode: null - }; - this.state.commentStack.push(commentWhitespace); - } - } - - finishToken(type, val) { - this.state.end = this.state.pos; - this.state.endLoc = this.state.curPosition(); - const prevType = this.state.type; - this.state.type = type; - this.state.value = val; - if (!this.isLookahead) { - this.updateContext(prevType); - } - } - replaceToken(type) { - this.state.type = type; - this.updateContext(); - } - - readToken_numberSign() { - if (this.state.pos === 0 && this.readToken_interpreter()) { - return; - } - const nextPos = this.state.pos + 1; - const next = this.codePointAtPos(nextPos); - if (next >= 48 && next <= 57) { - throw this.raise(Errors.UnexpectedDigitAfterHash, { - at: this.state.curPosition() - }); - } - if (next === 123 || next === 91 && this.hasPlugin("recordAndTuple")) { - this.expectPlugin("recordAndTuple"); - if (this.getPluginOption("recordAndTuple", "syntaxType") === "bar") { - throw this.raise(next === 123 ? Errors.RecordExpressionHashIncorrectStartSyntaxType : Errors.TupleExpressionHashIncorrectStartSyntaxType, { - at: this.state.curPosition() - }); - } - this.state.pos += 2; - if (next === 123) { - this.finishToken(7); - } else { - this.finishToken(1); - } - } else if (isIdentifierStart(next)) { - ++this.state.pos; - this.finishToken(136, this.readWord1(next)); - } else if (next === 92) { - ++this.state.pos; - this.finishToken(136, this.readWord1()); - } else { - this.finishOp(27, 1); - } - } - readToken_dot() { - const next = this.input.charCodeAt(this.state.pos + 1); - if (next >= 48 && next <= 57) { - this.readNumber(true); - return; - } - if (next === 46 && this.input.charCodeAt(this.state.pos + 2) === 46) { - this.state.pos += 3; - this.finishToken(21); - } else { - ++this.state.pos; - this.finishToken(16); - } - } - readToken_slash() { - const next = this.input.charCodeAt(this.state.pos + 1); - if (next === 61) { - this.finishOp(31, 2); - } else { - this.finishOp(56, 1); - } - } - readToken_interpreter() { - if (this.state.pos !== 0 || this.length < 2) return false; - let ch = this.input.charCodeAt(this.state.pos + 1); - if (ch !== 33) return false; - const start = this.state.pos; - this.state.pos += 1; - while (!isNewLine(ch) && ++this.state.pos < this.length) { - ch = this.input.charCodeAt(this.state.pos); - } - const value = this.input.slice(start + 2, this.state.pos); - this.finishToken(28, value); - return true; - } - readToken_mult_modulo(code) { - let type = code === 42 ? 55 : 54; - let width = 1; - let next = this.input.charCodeAt(this.state.pos + 1); - - if (code === 42 && next === 42) { - width++; - next = this.input.charCodeAt(this.state.pos + 2); - type = 57; - } - - if (next === 61 && !this.state.inType) { - width++; - type = code === 37 ? 33 : 30; - } - this.finishOp(type, width); - } - readToken_pipe_amp(code) { - const next = this.input.charCodeAt(this.state.pos + 1); - if (next === code) { - if (this.input.charCodeAt(this.state.pos + 2) === 61) { - this.finishOp(30, 3); - } else { - this.finishOp(code === 124 ? 41 : 42, 2); - } - return; - } - if (code === 124) { - if (next === 62) { - this.finishOp(39, 2); - return; - } - if (this.hasPlugin("recordAndTuple") && next === 125) { - if (this.getPluginOption("recordAndTuple", "syntaxType") !== "bar") { - throw this.raise(Errors.RecordExpressionBarIncorrectEndSyntaxType, { - at: this.state.curPosition() - }); - } - this.state.pos += 2; - this.finishToken(9); - return; - } - - if (this.hasPlugin("recordAndTuple") && next === 93) { - if (this.getPluginOption("recordAndTuple", "syntaxType") !== "bar") { - throw this.raise(Errors.TupleExpressionBarIncorrectEndSyntaxType, { - at: this.state.curPosition() - }); - } - this.state.pos += 2; - this.finishToken(4); - return; - } - } - if (next === 61) { - this.finishOp(30, 2); - return; - } - this.finishOp(code === 124 ? 43 : 45, 1); - } - readToken_caret() { - const next = this.input.charCodeAt(this.state.pos + 1); - - if (next === 61 && !this.state.inType) { - this.finishOp(32, 2); - } - else if (next === 94 && - this.hasPlugin(["pipelineOperator", { - proposal: "hack", - topicToken: "^^" - }])) { - this.finishOp(37, 2); - - const lookaheadCh = this.input.codePointAt(this.state.pos); - if (lookaheadCh === 94) { - throw this.unexpected(); - } - } - else { - this.finishOp(44, 1); - } - } - readToken_atSign() { - const next = this.input.charCodeAt(this.state.pos + 1); - - if (next === 64 && this.hasPlugin(["pipelineOperator", { - proposal: "hack", - topicToken: "@@" - }])) { - this.finishOp(38, 2); - } - else { - this.finishOp(26, 1); - } - } - readToken_plus_min(code) { - const next = this.input.charCodeAt(this.state.pos + 1); - if (next === code) { - this.finishOp(34, 2); - return; - } - if (next === 61) { - this.finishOp(30, 2); - } else { - this.finishOp(53, 1); - } - } - readToken_lt() { - const { - pos - } = this.state; - const next = this.input.charCodeAt(pos + 1); - if (next === 60) { - if (this.input.charCodeAt(pos + 2) === 61) { - this.finishOp(30, 3); - return; - } - this.finishOp(51, 2); - return; - } - if (next === 61) { - this.finishOp(49, 2); - return; - } - this.finishOp(47, 1); - } - readToken_gt() { - const { - pos - } = this.state; - const next = this.input.charCodeAt(pos + 1); - if (next === 62) { - const size = this.input.charCodeAt(pos + 2) === 62 ? 3 : 2; - if (this.input.charCodeAt(pos + size) === 61) { - this.finishOp(30, size + 1); - return; - } - this.finishOp(52, size); - return; - } - if (next === 61) { - this.finishOp(49, 2); - return; - } - this.finishOp(48, 1); - } - readToken_eq_excl(code) { - const next = this.input.charCodeAt(this.state.pos + 1); - if (next === 61) { - this.finishOp(46, this.input.charCodeAt(this.state.pos + 2) === 61 ? 3 : 2); - return; - } - if (code === 61 && next === 62) { - this.state.pos += 2; - this.finishToken(19); - return; - } - this.finishOp(code === 61 ? 29 : 35, 1); - } - readToken_question() { - const next = this.input.charCodeAt(this.state.pos + 1); - const next2 = this.input.charCodeAt(this.state.pos + 2); - if (next === 63) { - if (next2 === 61) { - this.finishOp(30, 3); - } else { - this.finishOp(40, 2); - } - } else if (next === 46 && !(next2 >= 48 && next2 <= 57)) { - this.state.pos += 2; - this.finishToken(18); - } else { - ++this.state.pos; - this.finishToken(17); - } - } - getTokenFromCode(code) { - switch (code) { - - case 46: - this.readToken_dot(); - return; - - case 40: - ++this.state.pos; - this.finishToken(10); - return; - case 41: - ++this.state.pos; - this.finishToken(11); - return; - case 59: - ++this.state.pos; - this.finishToken(13); - return; - case 44: - ++this.state.pos; - this.finishToken(12); - return; - case 91: - if (this.hasPlugin("recordAndTuple") && this.input.charCodeAt(this.state.pos + 1) === 124) { - if (this.getPluginOption("recordAndTuple", "syntaxType") !== "bar") { - throw this.raise(Errors.TupleExpressionBarIncorrectStartSyntaxType, { - at: this.state.curPosition() - }); - } - - this.state.pos += 2; - this.finishToken(2); - } else { - ++this.state.pos; - this.finishToken(0); - } - return; - case 93: - ++this.state.pos; - this.finishToken(3); - return; - case 123: - if (this.hasPlugin("recordAndTuple") && this.input.charCodeAt(this.state.pos + 1) === 124) { - if (this.getPluginOption("recordAndTuple", "syntaxType") !== "bar") { - throw this.raise(Errors.RecordExpressionBarIncorrectStartSyntaxType, { - at: this.state.curPosition() - }); - } - - this.state.pos += 2; - this.finishToken(6); - } else { - ++this.state.pos; - this.finishToken(5); - } - return; - case 125: - ++this.state.pos; - this.finishToken(8); - return; - case 58: - if (this.hasPlugin("functionBind") && this.input.charCodeAt(this.state.pos + 1) === 58) { - this.finishOp(15, 2); - } else { - ++this.state.pos; - this.finishToken(14); - } - return; - case 63: - this.readToken_question(); - return; - case 96: - this.readTemplateToken(); - return; - case 48: - { - const next = this.input.charCodeAt(this.state.pos + 1); - if (next === 120 || next === 88) { - this.readRadixNumber(16); - return; - } - if (next === 111 || next === 79) { - this.readRadixNumber(8); - return; - } - if (next === 98 || next === 66) { - this.readRadixNumber(2); - return; - } - } - case 49: - case 50: - case 51: - case 52: - case 53: - case 54: - case 55: - case 56: - case 57: - this.readNumber(false); - return; - - case 34: - case 39: - this.readString(code); - return; - - case 47: - this.readToken_slash(); - return; - case 37: - case 42: - this.readToken_mult_modulo(code); - return; - case 124: - case 38: - this.readToken_pipe_amp(code); - return; - case 94: - this.readToken_caret(); - return; - case 43: - case 45: - this.readToken_plus_min(code); - return; - case 60: - this.readToken_lt(); - return; - case 62: - this.readToken_gt(); - return; - case 61: - case 33: - this.readToken_eq_excl(code); - return; - case 126: - this.finishOp(36, 1); - return; - case 64: - this.readToken_atSign(); - return; - case 35: - this.readToken_numberSign(); - return; - case 92: - this.readWord(); - return; - default: - if (isIdentifierStart(code)) { - this.readWord(code); - return; - } - } - throw this.raise(Errors.InvalidOrUnexpectedToken, { - at: this.state.curPosition(), - unexpected: String.fromCodePoint(code) - }); - } - finishOp(type, size) { - const str = this.input.slice(this.state.pos, this.state.pos + size); - this.state.pos += size; - this.finishToken(type, str); - } - readRegexp() { - const startLoc = this.state.startLoc; - const start = this.state.start + 1; - let escaped, inClass; - let { - pos - } = this.state; - for (;; ++pos) { - if (pos >= this.length) { - throw this.raise(Errors.UnterminatedRegExp, { - at: createPositionWithColumnOffset(startLoc, 1) - }); - } - const ch = this.input.charCodeAt(pos); - if (isNewLine(ch)) { - throw this.raise(Errors.UnterminatedRegExp, { - at: createPositionWithColumnOffset(startLoc, 1) - }); - } - if (escaped) { - escaped = false; - } else { - if (ch === 91) { - inClass = true; - } else if (ch === 93 && inClass) { - inClass = false; - } else if (ch === 47 && !inClass) { - break; - } - escaped = ch === 92; - } - } - const content = this.input.slice(start, pos); - ++pos; - let mods = ""; - const nextPos = () => - createPositionWithColumnOffset(startLoc, pos + 2 - start); - while (pos < this.length) { - const cp = this.codePointAtPos(pos); - const char = String.fromCharCode(cp); - - if (VALID_REGEX_FLAGS.has(cp)) { - if (cp === 118) { - this.expectPlugin("regexpUnicodeSets", nextPos()); - if (mods.includes("u")) { - this.raise(Errors.IncompatibleRegExpUVFlags, { - at: nextPos() - }); - } - } else if (cp === 117) { - if (mods.includes("v")) { - this.raise(Errors.IncompatibleRegExpUVFlags, { - at: nextPos() - }); - } - } - if (mods.includes(char)) { - this.raise(Errors.DuplicateRegExpFlags, { - at: nextPos() - }); - } - } else if (isIdentifierChar(cp) || cp === 92) { - this.raise(Errors.MalformedRegExpFlags, { - at: nextPos() - }); - } else { - break; - } - ++pos; - mods += char; - } - this.state.pos = pos; - this.finishToken(135, { - pattern: content, - flags: mods - }); - } - - readInt(radix, len, forceLen = false, allowNumSeparator = true) { - const { - n, - pos - } = readInt(this.input, this.state.pos, this.state.lineStart, this.state.curLine, radix, len, forceLen, allowNumSeparator, this.errorHandlers_readInt, false); - this.state.pos = pos; - return n; - } - readRadixNumber(radix) { - const startLoc = this.state.curPosition(); - let isBigInt = false; - this.state.pos += 2; - const val = this.readInt(radix); - if (val == null) { - this.raise(Errors.InvalidDigit, { - at: createPositionWithColumnOffset(startLoc, 2), - radix - }); - } - const next = this.input.charCodeAt(this.state.pos); - if (next === 110) { - ++this.state.pos; - isBigInt = true; - } else if (next === 109) { - throw this.raise(Errors.InvalidDecimal, { - at: startLoc - }); - } - if (isIdentifierStart(this.codePointAtPos(this.state.pos))) { - throw this.raise(Errors.NumberIdentifier, { - at: this.state.curPosition() - }); - } - if (isBigInt) { - const str = this.input.slice(startLoc.index, this.state.pos).replace(/[_n]/g, ""); - this.finishToken(133, str); - return; - } - this.finishToken(132, val); - } - - readNumber(startsWithDot) { - const start = this.state.pos; - const startLoc = this.state.curPosition(); - let isFloat = false; - let isBigInt = false; - let isDecimal = false; - let hasExponent = false; - let isOctal = false; - if (!startsWithDot && this.readInt(10) === null) { - this.raise(Errors.InvalidNumber, { - at: this.state.curPosition() - }); - } - const hasLeadingZero = this.state.pos - start >= 2 && this.input.charCodeAt(start) === 48; - if (hasLeadingZero) { - const integer = this.input.slice(start, this.state.pos); - this.recordStrictModeErrors(Errors.StrictOctalLiteral, { - at: startLoc - }); - if (!this.state.strict) { - const underscorePos = integer.indexOf("_"); - if (underscorePos > 0) { - this.raise(Errors.ZeroDigitNumericSeparator, { - at: createPositionWithColumnOffset(startLoc, underscorePos) - }); - } - } - isOctal = hasLeadingZero && !/[89]/.test(integer); - } - let next = this.input.charCodeAt(this.state.pos); - if (next === 46 && !isOctal) { - ++this.state.pos; - this.readInt(10); - isFloat = true; - next = this.input.charCodeAt(this.state.pos); - } - if ((next === 69 || next === 101) && !isOctal) { - next = this.input.charCodeAt(++this.state.pos); - if (next === 43 || next === 45) { - ++this.state.pos; - } - if (this.readInt(10) === null) { - this.raise(Errors.InvalidOrMissingExponent, { - at: startLoc - }); - } - isFloat = true; - hasExponent = true; - next = this.input.charCodeAt(this.state.pos); - } - if (next === 110) { - if (isFloat || hasLeadingZero) { - this.raise(Errors.InvalidBigIntLiteral, { - at: startLoc - }); - } - ++this.state.pos; - isBigInt = true; - } - if (next === 109) { - this.expectPlugin("decimal", this.state.curPosition()); - if (hasExponent || hasLeadingZero) { - this.raise(Errors.InvalidDecimal, { - at: startLoc - }); - } - ++this.state.pos; - isDecimal = true; - } - if (isIdentifierStart(this.codePointAtPos(this.state.pos))) { - throw this.raise(Errors.NumberIdentifier, { - at: this.state.curPosition() - }); - } - - const str = this.input.slice(start, this.state.pos).replace(/[_mn]/g, ""); - if (isBigInt) { - this.finishToken(133, str); - return; - } - if (isDecimal) { - this.finishToken(134, str); - return; - } - const val = isOctal ? parseInt(str, 8) : parseFloat(str); - this.finishToken(132, val); - } - - readCodePoint(throwOnInvalid) { - const { - code, - pos - } = readCodePoint(this.input, this.state.pos, this.state.lineStart, this.state.curLine, throwOnInvalid, this.errorHandlers_readCodePoint); - this.state.pos = pos; - return code; - } - readString(quote) { - const { - str, - pos, - curLine, - lineStart - } = readStringContents(quote === 34 ? "double" : "single", this.input, this.state.pos + 1, - this.state.lineStart, this.state.curLine, this.errorHandlers_readStringContents_string); - this.state.pos = pos + 1; - this.state.lineStart = lineStart; - this.state.curLine = curLine; - this.finishToken(131, str); - } - - readTemplateContinuation() { - if (!this.match(8)) { - this.unexpected(null, 8); - } - this.state.pos--; - this.readTemplateToken(); - } - - readTemplateToken() { - const opening = this.input[this.state.pos]; - const { - str, - firstInvalidLoc, - pos, - curLine, - lineStart - } = readStringContents("template", this.input, this.state.pos + 1, - this.state.lineStart, this.state.curLine, this.errorHandlers_readStringContents_template); - this.state.pos = pos + 1; - this.state.lineStart = lineStart; - this.state.curLine = curLine; - if (firstInvalidLoc) { - this.state.firstInvalidTemplateEscapePos = new Position(firstInvalidLoc.curLine, firstInvalidLoc.pos - firstInvalidLoc.lineStart, firstInvalidLoc.pos); - } - if (this.input.codePointAt(pos) === 96) { - this.finishToken(24, firstInvalidLoc ? null : opening + str + "`"); - } else { - this.state.pos++; - this.finishToken(25, firstInvalidLoc ? null : opening + str + "${"); - } - } - recordStrictModeErrors(toParseError, { - at - }) { - const index = at.index; - if (this.state.strict && !this.state.strictErrors.has(index)) { - this.raise(toParseError, { - at - }); - } else { - this.state.strictErrors.set(index, [toParseError, at]); - } - } - - readWord1(firstCode) { - this.state.containsEsc = false; - let word = ""; - const start = this.state.pos; - let chunkStart = this.state.pos; - if (firstCode !== undefined) { - this.state.pos += firstCode <= 0xffff ? 1 : 2; - } - while (this.state.pos < this.length) { - const ch = this.codePointAtPos(this.state.pos); - if (isIdentifierChar(ch)) { - this.state.pos += ch <= 0xffff ? 1 : 2; - } else if (ch === 92) { - this.state.containsEsc = true; - word += this.input.slice(chunkStart, this.state.pos); - const escStart = this.state.curPosition(); - const identifierCheck = this.state.pos === start ? isIdentifierStart : isIdentifierChar; - if (this.input.charCodeAt(++this.state.pos) !== 117) { - this.raise(Errors.MissingUnicodeEscape, { - at: this.state.curPosition() - }); - chunkStart = this.state.pos - 1; - continue; - } - ++this.state.pos; - const esc = this.readCodePoint(true); - if (esc !== null) { - if (!identifierCheck(esc)) { - this.raise(Errors.EscapedCharNotAnIdentifier, { - at: escStart - }); - } - word += String.fromCodePoint(esc); - } - chunkStart = this.state.pos; - } else { - break; - } - } - return word + this.input.slice(chunkStart, this.state.pos); - } - - readWord(firstCode) { - const word = this.readWord1(firstCode); - const type = keywords$1.get(word); - if (type !== undefined) { - this.finishToken(type, tokenLabelName(type)); - } else { - this.finishToken(130, word); - } - } - checkKeywordEscapes() { - const { - type - } = this.state; - if (tokenIsKeyword(type) && this.state.containsEsc) { - this.raise(Errors.InvalidEscapedReservedWord, { - at: this.state.startLoc, - reservedWord: tokenLabelName(type) - }); - } - } - - raise(toParseError, raiseProperties) { - const { - at - } = raiseProperties, - details = _objectWithoutPropertiesLoose(raiseProperties, _excluded); - const loc = at instanceof Position ? at : at.loc.start; - const error = toParseError({ - loc, - details - }); - if (!this.options.errorRecovery) throw error; - if (!this.isLookahead) this.state.errors.push(error); - return error; - } - - raiseOverwrite(toParseError, raiseProperties) { - const { - at - } = raiseProperties, - details = _objectWithoutPropertiesLoose(raiseProperties, _excluded2); - const loc = at instanceof Position ? at : at.loc.start; - const pos = loc.index; - const errors = this.state.errors; - for (let i = errors.length - 1; i >= 0; i--) { - const error = errors[i]; - if (error.loc.index === pos) { - return errors[i] = toParseError({ - loc, - details - }); - } - if (error.loc.index < pos) break; - } - return this.raise(toParseError, raiseProperties); - } - - updateContext(prevType) {} - - unexpected(loc, type) { - throw this.raise(Errors.UnexpectedToken, { - expected: type ? tokenLabelName(type) : null, - at: loc != null ? loc : this.state.startLoc - }); - } - expectPlugin(pluginName, loc) { - if (this.hasPlugin(pluginName)) { - return true; - } - throw this.raise(Errors.MissingPlugin, { - at: loc != null ? loc : this.state.startLoc, - missingPlugin: [pluginName] - }); - } - expectOnePlugin(pluginNames) { - if (!pluginNames.some(name => this.hasPlugin(name))) { - throw this.raise(Errors.MissingOneOfPlugins, { - at: this.state.startLoc, - missingPlugin: pluginNames - }); - } - } - errorBuilder(error) { - return (pos, lineStart, curLine) => { - this.raise(error, { - at: buildPosition(pos, lineStart, curLine) - }); - }; - } -} - -class ClassScope { - constructor() { - this.privateNames = new Set(); - this.loneAccessors = new Map(); - this.undefinedPrivateNames = new Map(); - } -} -class ClassScopeHandler { - constructor(parser) { - this.parser = void 0; - this.stack = []; - this.undefinedPrivateNames = new Map(); - this.parser = parser; - } - current() { - return this.stack[this.stack.length - 1]; - } - enter() { - this.stack.push(new ClassScope()); - } - exit() { - const oldClassScope = this.stack.pop(); - - const current = this.current(); - - for (const [name, loc] of Array.from(oldClassScope.undefinedPrivateNames)) { - if (current) { - if (!current.undefinedPrivateNames.has(name)) { - current.undefinedPrivateNames.set(name, loc); - } - } else { - this.parser.raise(Errors.InvalidPrivateFieldResolution, { - at: loc, - identifierName: name - }); - } - } - } - declarePrivateName(name, elementType, loc) { - const { - privateNames, - loneAccessors, - undefinedPrivateNames - } = this.current(); - let redefined = privateNames.has(name); - if (elementType & CLASS_ELEMENT_KIND_ACCESSOR) { - const accessor = redefined && loneAccessors.get(name); - if (accessor) { - const oldStatic = accessor & CLASS_ELEMENT_FLAG_STATIC; - const newStatic = elementType & CLASS_ELEMENT_FLAG_STATIC; - const oldKind = accessor & CLASS_ELEMENT_KIND_ACCESSOR; - const newKind = elementType & CLASS_ELEMENT_KIND_ACCESSOR; - - redefined = oldKind === newKind || oldStatic !== newStatic; - if (!redefined) loneAccessors.delete(name); - } else if (!redefined) { - loneAccessors.set(name, elementType); - } - } - if (redefined) { - this.parser.raise(Errors.PrivateNameRedeclaration, { - at: loc, - identifierName: name - }); - } - privateNames.add(name); - undefinedPrivateNames.delete(name); - } - usePrivateName(name, loc) { - let classScope; - for (classScope of this.stack) { - if (classScope.privateNames.has(name)) return; - } - if (classScope) { - classScope.undefinedPrivateNames.set(name, loc); - } else { - this.parser.raise(Errors.InvalidPrivateFieldResolution, { - at: loc, - identifierName: name - }); - } - } -} - -const kExpression = 0, - kMaybeArrowParameterDeclaration = 1, - kMaybeAsyncArrowParameterDeclaration = 2, - kParameterDeclaration = 3; -class ExpressionScope { - constructor(type = kExpression) { - this.type = void 0; - this.type = type; - } - canBeArrowParameterDeclaration() { - return this.type === kMaybeAsyncArrowParameterDeclaration || this.type === kMaybeArrowParameterDeclaration; - } - isCertainlyParameterDeclaration() { - return this.type === kParameterDeclaration; - } -} -class ArrowHeadParsingScope extends ExpressionScope { - constructor(type) { - super(type); - this.declarationErrors = new Map(); - } - recordDeclarationError(ParsingErrorClass, { - at - }) { - const index = at.index; - this.declarationErrors.set(index, [ParsingErrorClass, at]); - } - clearDeclarationError(index) { - this.declarationErrors.delete(index); - } - iterateErrors(iterator) { - this.declarationErrors.forEach(iterator); - } -} -class ExpressionScopeHandler { - constructor(parser) { - this.parser = void 0; - this.stack = [new ExpressionScope()]; - this.parser = parser; - } - enter(scope) { - this.stack.push(scope); - } - exit() { - this.stack.pop(); - } - - recordParameterInitializerError(toParseError, { - at: node - }) { - const origin = { - at: node.loc.start - }; - const { - stack - } = this; - let i = stack.length - 1; - let scope = stack[i]; - while (!scope.isCertainlyParameterDeclaration()) { - if (scope.canBeArrowParameterDeclaration()) { - scope.recordDeclarationError(toParseError, origin); - } else { - return; - } - scope = stack[--i]; - } - this.parser.raise(toParseError, origin); - } - - recordArrowParemeterBindingError(error, { - at: node - }) { - const { - stack - } = this; - const scope = stack[stack.length - 1]; - const origin = { - at: node.loc.start - }; - if (scope.isCertainlyParameterDeclaration()) { - this.parser.raise(error, origin); - } else if (scope.canBeArrowParameterDeclaration()) { - scope.recordDeclarationError(error, origin); - } else { - return; - } - } - - recordAsyncArrowParametersError({ - at - }) { - const { - stack - } = this; - let i = stack.length - 1; - let scope = stack[i]; - while (scope.canBeArrowParameterDeclaration()) { - if (scope.type === kMaybeAsyncArrowParameterDeclaration) { - scope.recordDeclarationError(Errors.AwaitBindingIdentifier, { - at - }); - } - scope = stack[--i]; - } - } - validateAsPattern() { - const { - stack - } = this; - const currentScope = stack[stack.length - 1]; - if (!currentScope.canBeArrowParameterDeclaration()) return; - currentScope.iterateErrors(([toParseError, loc]) => { - this.parser.raise(toParseError, { - at: loc - }); - let i = stack.length - 2; - let scope = stack[i]; - while (scope.canBeArrowParameterDeclaration()) { - scope.clearDeclarationError(loc.index); - scope = stack[--i]; - } - }); - } -} -function newParameterDeclarationScope() { - return new ExpressionScope(kParameterDeclaration); -} -function newArrowHeadScope() { - return new ArrowHeadParsingScope(kMaybeArrowParameterDeclaration); -} -function newAsyncArrowScope() { - return new ArrowHeadParsingScope(kMaybeAsyncArrowParameterDeclaration); -} -function newExpressionScope() { - return new ExpressionScope(); -} - -const - PARAM = 0b0000, - PARAM_YIELD = 0b0001, - PARAM_AWAIT = 0b0010, - PARAM_RETURN = 0b0100, - PARAM_IN = 0b1000; - -class ProductionParameterHandler { - constructor() { - this.stacks = []; - } - enter(flags) { - this.stacks.push(flags); - } - exit() { - this.stacks.pop(); - } - currentFlags() { - return this.stacks[this.stacks.length - 1]; - } - get hasAwait() { - return (this.currentFlags() & PARAM_AWAIT) > 0; - } - get hasYield() { - return (this.currentFlags() & PARAM_YIELD) > 0; - } - get hasReturn() { - return (this.currentFlags() & PARAM_RETURN) > 0; - } - get hasIn() { - return (this.currentFlags() & PARAM_IN) > 0; - } -} -function functionFlags(isAsync, isGenerator) { - return (isAsync ? PARAM_AWAIT : 0) | (isGenerator ? PARAM_YIELD : 0); -} - -class UtilParser extends Tokenizer { - - addExtra(node, key, value, enumerable = true) { - if (!node) return; - const extra = node.extra = node.extra || {}; - if (enumerable) { - extra[key] = value; - } else { - Object.defineProperty(extra, key, { - enumerable, - value - }); - } - } - - isContextual(token) { - return this.state.type === token && !this.state.containsEsc; - } - isUnparsedContextual(nameStart, name) { - const nameEnd = nameStart + name.length; - if (this.input.slice(nameStart, nameEnd) === name) { - const nextCh = this.input.charCodeAt(nameEnd); - return !(isIdentifierChar(nextCh) || - (nextCh & 0xfc00) === 0xd800); - } - return false; - } - isLookaheadContextual(name) { - const next = this.nextTokenStart(); - return this.isUnparsedContextual(next, name); - } - - eatContextual(token) { - if (this.isContextual(token)) { - this.next(); - return true; - } - return false; - } - - expectContextual(token, toParseError) { - if (!this.eatContextual(token)) { - if (toParseError != null) { - throw this.raise(toParseError, { - at: this.state.startLoc - }); - } - throw this.unexpected(null, token); - } - } - - canInsertSemicolon() { - return this.match(137) || this.match(8) || this.hasPrecedingLineBreak(); - } - hasPrecedingLineBreak() { - return lineBreak.test(this.input.slice(this.state.lastTokEndLoc.index, this.state.start)); - } - hasFollowingLineBreak() { - skipWhiteSpaceToLineBreak.lastIndex = this.state.end; - return skipWhiteSpaceToLineBreak.test(this.input); - } - - isLineTerminator() { - return this.eat(13) || this.canInsertSemicolon(); - } - - semicolon(allowAsi = true) { - if (allowAsi ? this.isLineTerminator() : this.eat(13)) return; - this.raise(Errors.MissingSemicolon, { - at: this.state.lastTokEndLoc - }); - } - - expect(type, loc) { - this.eat(type) || this.unexpected(loc, type); - } - - tryParse(fn, oldState = this.state.clone()) { - const abortSignal = { - node: null - }; - try { - const node = fn((node = null) => { - abortSignal.node = node; - throw abortSignal; - }); - if (this.state.errors.length > oldState.errors.length) { - const failState = this.state; - this.state = oldState; - this.state.tokensLength = failState.tokensLength; - return { - node, - error: failState.errors[oldState.errors.length], - thrown: false, - aborted: false, - failState - }; - } - return { - node, - error: null, - thrown: false, - aborted: false, - failState: null - }; - } catch (error) { - const failState = this.state; - this.state = oldState; - if (error instanceof SyntaxError) { - return { - node: null, - error, - thrown: true, - aborted: false, - failState - }; - } - if (error === abortSignal) { - return { - node: abortSignal.node, - error: null, - thrown: false, - aborted: true, - failState - }; - } - throw error; - } - } - checkExpressionErrors(refExpressionErrors, andThrow) { - if (!refExpressionErrors) return false; - const { - shorthandAssignLoc, - doubleProtoLoc, - privateKeyLoc, - optionalParametersLoc - } = refExpressionErrors; - const hasErrors = !!shorthandAssignLoc || !!doubleProtoLoc || !!optionalParametersLoc || !!privateKeyLoc; - if (!andThrow) { - return hasErrors; - } - if (shorthandAssignLoc != null) { - this.raise(Errors.InvalidCoverInitializedName, { - at: shorthandAssignLoc - }); - } - if (doubleProtoLoc != null) { - this.raise(Errors.DuplicateProto, { - at: doubleProtoLoc - }); - } - if (privateKeyLoc != null) { - this.raise(Errors.UnexpectedPrivateField, { - at: privateKeyLoc - }); - } - if (optionalParametersLoc != null) { - this.unexpected(optionalParametersLoc); - } - } - - isLiteralPropertyName() { - return tokenIsLiteralPropertyName(this.state.type); - } - - isPrivateName(node) { - return node.type === "PrivateName"; - } - - getPrivateNameSV(node) { - return node.id.name; - } - - hasPropertyAsPrivateName(node) { - return (node.type === "MemberExpression" || node.type === "OptionalMemberExpression") && this.isPrivateName(node.property); - } - isOptionalChain(node) { - return node.type === "OptionalMemberExpression" || node.type === "OptionalCallExpression"; - } - isObjectProperty(node) { - return node.type === "ObjectProperty"; - } - isObjectMethod(node) { - return node.type === "ObjectMethod"; - } - initializeScopes(inModule = this.options.sourceType === "module") { - const oldLabels = this.state.labels; - this.state.labels = []; - const oldExportedIdentifiers = this.exportedIdentifiers; - this.exportedIdentifiers = new Set(); - - const oldInModule = this.inModule; - this.inModule = inModule; - const oldScope = this.scope; - const ScopeHandler = this.getScopeHandler(); - this.scope = new ScopeHandler(this, inModule); - const oldProdParam = this.prodParam; - this.prodParam = new ProductionParameterHandler(); - const oldClassScope = this.classScope; - this.classScope = new ClassScopeHandler(this); - const oldExpressionScope = this.expressionScope; - this.expressionScope = new ExpressionScopeHandler(this); - return () => { - this.state.labels = oldLabels; - this.exportedIdentifiers = oldExportedIdentifiers; - - this.inModule = oldInModule; - this.scope = oldScope; - this.prodParam = oldProdParam; - this.classScope = oldClassScope; - this.expressionScope = oldExpressionScope; - }; - } - enterInitialScopes() { - let paramFlags = PARAM; - if (this.inModule) { - paramFlags |= PARAM_AWAIT; - } - this.scope.enter(SCOPE_PROGRAM); - this.prodParam.enter(paramFlags); - } - checkDestructuringPrivate(refExpressionErrors) { - const { - privateKeyLoc - } = refExpressionErrors; - if (privateKeyLoc !== null) { - this.expectPlugin("destructuringPrivate", privateKeyLoc); - } - } -} - -class ExpressionErrors { - constructor() { - this.shorthandAssignLoc = null; - this.doubleProtoLoc = null; - this.privateKeyLoc = null; - this.optionalParametersLoc = null; - } -} - -class Node { - constructor(parser, pos, loc) { - this.type = ""; - this.start = pos; - this.end = 0; - this.loc = new SourceLocation(loc); - if (parser != null && parser.options.ranges) this.range = [pos, 0]; - if (parser != null && parser.filename) this.loc.filename = parser.filename; - } -} -const NodePrototype = Node.prototype; -{ - NodePrototype.__clone = function () { - const newNode = new Node(undefined, this.start, this.loc.start); - const keys = Object.keys(this); - for (let i = 0, length = keys.length; i < length; i++) { - const key = keys[i]; - if (key !== "leadingComments" && key !== "trailingComments" && key !== "innerComments") { - newNode[key] = this[key]; - } - } - return newNode; - }; -} -function clonePlaceholder(node) { - return cloneIdentifier(node); -} -function cloneIdentifier(node) { - const { - type, - start, - end, - loc, - range, - extra, - name - } = node; - const cloned = Object.create(NodePrototype); - cloned.type = type; - cloned.start = start; - cloned.end = end; - cloned.loc = loc; - cloned.range = range; - cloned.extra = extra; - cloned.name = name; - if (type === "Placeholder") { - cloned.expectedNode = node.expectedNode; - } - return cloned; -} -function cloneStringLiteral(node) { - const { - type, - start, - end, - loc, - range, - extra - } = node; - if (type === "Placeholder") { - return clonePlaceholder(node); - } - const cloned = Object.create(NodePrototype); - cloned.type = type; - cloned.start = start; - cloned.end = end; - cloned.loc = loc; - cloned.range = range; - if (node.raw !== undefined) { - cloned.raw = node.raw; - } else { - cloned.extra = extra; - } - cloned.value = node.value; - return cloned; -} -class NodeUtils extends UtilParser { - startNode() { - return new Node(this, this.state.start, this.state.startLoc); - } - startNodeAt(loc) { - return new Node(this, loc.index, loc); - } - - startNodeAtNode(type) { - return this.startNodeAt(type.loc.start); - } - - finishNode(node, type) { - return this.finishNodeAt(node, type, this.state.lastTokEndLoc); - } - - finishNodeAt(node, type, endLoc) { - node.type = type; - node.end = endLoc.index; - node.loc.end = endLoc; - if (this.options.ranges) node.range[1] = endLoc.index; - if (this.options.attachComment) this.processComment(node); - return node; - } - resetStartLocation(node, startLoc) { - node.start = startLoc.index; - node.loc.start = startLoc; - if (this.options.ranges) node.range[0] = startLoc.index; - } - resetEndLocation(node, endLoc = this.state.lastTokEndLoc) { - node.end = endLoc.index; - node.loc.end = endLoc; - if (this.options.ranges) node.range[1] = endLoc.index; - } - - resetStartLocationFromNode(node, locationNode) { - this.resetStartLocation(node, locationNode.loc.start); - } -} - -const reservedTypes = new Set(["_", "any", "bool", "boolean", "empty", "extends", "false", "interface", "mixed", "null", "number", "static", "string", "true", "typeof", "void"]); - -const FlowErrors = ParseErrorEnum`flow`({ - AmbiguousConditionalArrow: "Ambiguous expression: wrap the arrow functions in parentheses to disambiguate.", - AmbiguousDeclareModuleKind: "Found both `declare module.exports` and `declare export` in the same module. Modules can only have 1 since they are either an ES module or they are a CommonJS module.", - AssignReservedType: ({ - reservedType - }) => `Cannot overwrite reserved type ${reservedType}.`, - DeclareClassElement: "The `declare` modifier can only appear on class fields.", - DeclareClassFieldInitializer: "Initializers are not allowed in fields with the `declare` modifier.", - DuplicateDeclareModuleExports: "Duplicate `declare module.exports` statement.", - EnumBooleanMemberNotInitialized: ({ - memberName, - enumName - }) => `Boolean enum members need to be initialized. Use either \`${memberName} = true,\` or \`${memberName} = false,\` in enum \`${enumName}\`.`, - EnumDuplicateMemberName: ({ - memberName, - enumName - }) => `Enum member names need to be unique, but the name \`${memberName}\` has already been used before in enum \`${enumName}\`.`, - EnumInconsistentMemberValues: ({ - enumName - }) => `Enum \`${enumName}\` has inconsistent member initializers. Either use no initializers, or consistently use literals (either booleans, numbers, or strings) for all member initializers.`, - EnumInvalidExplicitType: ({ - invalidEnumType, - enumName - }) => `Enum type \`${invalidEnumType}\` is not valid. Use one of \`boolean\`, \`number\`, \`string\`, or \`symbol\` in enum \`${enumName}\`.`, - EnumInvalidExplicitTypeUnknownSupplied: ({ - enumName - }) => `Supplied enum type is not valid. Use one of \`boolean\`, \`number\`, \`string\`, or \`symbol\` in enum \`${enumName}\`.`, - EnumInvalidMemberInitializerPrimaryType: ({ - enumName, - memberName, - explicitType - }) => `Enum \`${enumName}\` has type \`${explicitType}\`, so the initializer of \`${memberName}\` needs to be a ${explicitType} literal.`, - EnumInvalidMemberInitializerSymbolType: ({ - enumName, - memberName - }) => `Symbol enum members cannot be initialized. Use \`${memberName},\` in enum \`${enumName}\`.`, - EnumInvalidMemberInitializerUnknownType: ({ - enumName, - memberName - }) => `The enum member initializer for \`${memberName}\` needs to be a literal (either a boolean, number, or string) in enum \`${enumName}\`.`, - EnumInvalidMemberName: ({ - enumName, - memberName, - suggestion - }) => `Enum member names cannot start with lowercase 'a' through 'z'. Instead of using \`${memberName}\`, consider using \`${suggestion}\`, in enum \`${enumName}\`.`, - EnumNumberMemberNotInitialized: ({ - enumName, - memberName - }) => `Number enum members need to be initialized, e.g. \`${memberName} = 1\` in enum \`${enumName}\`.`, - EnumStringMemberInconsistentlyInitailized: ({ - enumName - }) => `String enum members need to consistently either all use initializers, or use no initializers, in enum \`${enumName}\`.`, - GetterMayNotHaveThisParam: "A getter cannot have a `this` parameter.", - ImportReflectionHasImportType: "An `import module` declaration can not use `type` or `typeof` keyword.", - ImportTypeShorthandOnlyInPureImport: "The `type` and `typeof` keywords on named imports can only be used on regular `import` statements. It cannot be used with `import type` or `import typeof` statements.", - InexactInsideExact: "Explicit inexact syntax cannot appear inside an explicit exact object type.", - InexactInsideNonObject: "Explicit inexact syntax cannot appear in class or interface definitions.", - InexactVariance: "Explicit inexact syntax cannot have variance.", - InvalidNonTypeImportInDeclareModule: "Imports within a `declare module` body must always be `import type` or `import typeof`.", - MissingTypeParamDefault: "Type parameter declaration needs a default, since a preceding type parameter declaration has a default.", - NestedDeclareModule: "`declare module` cannot be used inside another `declare module`.", - NestedFlowComment: "Cannot have a flow comment inside another flow comment.", - PatternIsOptional: Object.assign({ - message: "A binding pattern parameter cannot be optional in an implementation signature." - }, { - reasonCode: "OptionalBindingPattern" - }), - SetterMayNotHaveThisParam: "A setter cannot have a `this` parameter.", - SpreadVariance: "Spread properties cannot have variance.", - ThisParamAnnotationRequired: "A type annotation is required for the `this` parameter.", - ThisParamBannedInConstructor: "Constructors cannot have a `this` parameter; constructors don't bind `this` like other functions.", - ThisParamMayNotBeOptional: "The `this` parameter cannot be optional.", - ThisParamMustBeFirst: "The `this` parameter must be the first function parameter.", - ThisParamNoDefault: "The `this` parameter may not have a default value.", - TypeBeforeInitializer: "Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`.", - TypeCastInPattern: "The type cast expression is expected to be wrapped with parenthesis.", - UnexpectedExplicitInexactInObject: "Explicit inexact syntax must appear at the end of an inexact object.", - UnexpectedReservedType: ({ - reservedType - }) => `Unexpected reserved type ${reservedType}.`, - UnexpectedReservedUnderscore: "`_` is only allowed as a type argument to call or new.", - UnexpectedSpaceBetweenModuloChecks: "Spaces between `%` and `checks` are not allowed here.", - UnexpectedSpreadType: "Spread operator cannot appear in class or interface definitions.", - UnexpectedSubtractionOperand: 'Unexpected token, expected "number" or "bigint".', - UnexpectedTokenAfterTypeParameter: "Expected an arrow function after this type parameter declaration.", - UnexpectedTypeParameterBeforeAsyncArrowFunction: "Type parameters must come after the async keyword, e.g. instead of ` async () => {}`, use `async () => {}`.", - UnsupportedDeclareExportKind: ({ - unsupportedExportKind, - suggestion - }) => `\`declare export ${unsupportedExportKind}\` is not supported. Use \`${suggestion}\` instead.`, - UnsupportedStatementInDeclareModule: "Only declares and type imports are allowed inside declare module.", - UnterminatedFlowComment: "Unterminated flow-comment." -}); - -function isEsModuleType(bodyElement) { - return bodyElement.type === "DeclareExportAllDeclaration" || bodyElement.type === "DeclareExportDeclaration" && (!bodyElement.declaration || bodyElement.declaration.type !== "TypeAlias" && bodyElement.declaration.type !== "InterfaceDeclaration"); -} -function hasTypeImportKind(node) { - return node.importKind === "type" || node.importKind === "typeof"; -} -function isMaybeDefaultImport(type) { - return tokenIsKeywordOrIdentifier(type) && type !== 97; -} -const exportSuggestions = { - const: "declare export var", - let: "declare export var", - type: "export type", - interface: "export interface" -}; - -function partition(list, test) { - const list1 = []; - const list2 = []; - for (let i = 0; i < list.length; i++) { - (test(list[i], i, list) ? list1 : list2).push(list[i]); - } - return [list1, list2]; -} -const FLOW_PRAGMA_REGEX = /\*?\s*@((?:no)?flow)\b/; - -var flow = (superClass => class FlowParserMixin extends superClass { - constructor(...args) { - super(...args); - this.flowPragma = undefined; - } - getScopeHandler() { - return FlowScopeHandler; - } - shouldParseTypes() { - return this.getPluginOption("flow", "all") || this.flowPragma === "flow"; - } - shouldParseEnums() { - return !!this.getPluginOption("flow", "enums"); - } - finishToken(type, val) { - if (type !== 131 && type !== 13 && type !== 28) { - if (this.flowPragma === undefined) { - this.flowPragma = null; - } - } - return super.finishToken(type, val); - } - addComment(comment) { - if (this.flowPragma === undefined) { - const matches = FLOW_PRAGMA_REGEX.exec(comment.value); - if (!matches) ; else if (matches[1] === "flow") { - this.flowPragma = "flow"; - } else if (matches[1] === "noflow") { - this.flowPragma = "noflow"; - } else { - throw new Error("Unexpected flow pragma"); - } - } - return super.addComment(comment); - } - flowParseTypeInitialiser(tok) { - const oldInType = this.state.inType; - this.state.inType = true; - this.expect(tok || 14); - const type = this.flowParseType(); - this.state.inType = oldInType; - return type; - } - flowParsePredicate() { - const node = this.startNode(); - const moduloLoc = this.state.startLoc; - this.next(); - this.expectContextual(108); - if (this.state.lastTokStart > moduloLoc.index + 1) { - this.raise(FlowErrors.UnexpectedSpaceBetweenModuloChecks, { - at: moduloLoc - }); - } - if (this.eat(10)) { - node.value = super.parseExpression(); - this.expect(11); - return this.finishNode(node, "DeclaredPredicate"); - } else { - return this.finishNode(node, "InferredPredicate"); - } - } - flowParseTypeAndPredicateInitialiser() { - const oldInType = this.state.inType; - this.state.inType = true; - this.expect(14); - let type = null; - let predicate = null; - if (this.match(54)) { - this.state.inType = oldInType; - predicate = this.flowParsePredicate(); - } else { - type = this.flowParseType(); - this.state.inType = oldInType; - if (this.match(54)) { - predicate = this.flowParsePredicate(); - } - } - return [type, predicate]; - } - flowParseDeclareClass(node) { - this.next(); - this.flowParseInterfaceish(node, true); - return this.finishNode(node, "DeclareClass"); - } - flowParseDeclareFunction(node) { - this.next(); - const id = node.id = this.parseIdentifier(); - const typeNode = this.startNode(); - const typeContainer = this.startNode(); - if (this.match(47)) { - typeNode.typeParameters = this.flowParseTypeParameterDeclaration(); - } else { - typeNode.typeParameters = null; - } - this.expect(10); - const tmp = this.flowParseFunctionTypeParams(); - typeNode.params = tmp.params; - typeNode.rest = tmp.rest; - typeNode.this = tmp._this; - this.expect(11); - [typeNode.returnType, node.predicate] = this.flowParseTypeAndPredicateInitialiser(); - typeContainer.typeAnnotation = this.finishNode(typeNode, "FunctionTypeAnnotation"); - id.typeAnnotation = this.finishNode(typeContainer, "TypeAnnotation"); - this.resetEndLocation(id); - this.semicolon(); - this.scope.declareName(node.id.name, BIND_FLOW_DECLARE_FN, node.id.loc.start); - return this.finishNode(node, "DeclareFunction"); - } - flowParseDeclare(node, insideModule) { - if (this.match(80)) { - return this.flowParseDeclareClass(node); - } else if (this.match(68)) { - return this.flowParseDeclareFunction(node); - } else if (this.match(74)) { - return this.flowParseDeclareVariable(node); - } else if (this.eatContextual(125)) { - if (this.match(16)) { - return this.flowParseDeclareModuleExports(node); - } else { - if (insideModule) { - this.raise(FlowErrors.NestedDeclareModule, { - at: this.state.lastTokStartLoc - }); - } - return this.flowParseDeclareModule(node); - } - } else if (this.isContextual(128)) { - return this.flowParseDeclareTypeAlias(node); - } else if (this.isContextual(129)) { - return this.flowParseDeclareOpaqueType(node); - } else if (this.isContextual(127)) { - return this.flowParseDeclareInterface(node); - } else if (this.match(82)) { - return this.flowParseDeclareExportDeclaration(node, insideModule); - } else { - throw this.unexpected(); - } - } - flowParseDeclareVariable(node) { - this.next(); - node.id = this.flowParseTypeAnnotatableIdentifier(true); - this.scope.declareName(node.id.name, BIND_VAR, node.id.loc.start); - this.semicolon(); - return this.finishNode(node, "DeclareVariable"); - } - flowParseDeclareModule(node) { - this.scope.enter(SCOPE_OTHER); - if (this.match(131)) { - node.id = super.parseExprAtom(); - } else { - node.id = this.parseIdentifier(); - } - const bodyNode = node.body = this.startNode(); - const body = bodyNode.body = []; - this.expect(5); - while (!this.match(8)) { - let bodyNode = this.startNode(); - if (this.match(83)) { - this.next(); - if (!this.isContextual(128) && !this.match(87)) { - this.raise(FlowErrors.InvalidNonTypeImportInDeclareModule, { - at: this.state.lastTokStartLoc - }); - } - super.parseImport(bodyNode); - } else { - this.expectContextual(123, FlowErrors.UnsupportedStatementInDeclareModule); - bodyNode = this.flowParseDeclare(bodyNode, true); - } - body.push(bodyNode); - } - this.scope.exit(); - this.expect(8); - this.finishNode(bodyNode, "BlockStatement"); - let kind = null; - let hasModuleExport = false; - body.forEach(bodyElement => { - if (isEsModuleType(bodyElement)) { - if (kind === "CommonJS") { - this.raise(FlowErrors.AmbiguousDeclareModuleKind, { - at: bodyElement - }); - } - kind = "ES"; - } else if (bodyElement.type === "DeclareModuleExports") { - if (hasModuleExport) { - this.raise(FlowErrors.DuplicateDeclareModuleExports, { - at: bodyElement - }); - } - if (kind === "ES") { - this.raise(FlowErrors.AmbiguousDeclareModuleKind, { - at: bodyElement - }); - } - kind = "CommonJS"; - hasModuleExport = true; - } - }); - node.kind = kind || "CommonJS"; - return this.finishNode(node, "DeclareModule"); - } - flowParseDeclareExportDeclaration(node, insideModule) { - this.expect(82); - if (this.eat(65)) { - if (this.match(68) || this.match(80)) { - node.declaration = this.flowParseDeclare(this.startNode()); - } else { - node.declaration = this.flowParseType(); - this.semicolon(); - } - node.default = true; - return this.finishNode(node, "DeclareExportDeclaration"); - } else { - if (this.match(75) || this.isLet() || (this.isContextual(128) || this.isContextual(127)) && !insideModule) { - const label = this.state.value; - throw this.raise(FlowErrors.UnsupportedDeclareExportKind, { - at: this.state.startLoc, - unsupportedExportKind: label, - suggestion: exportSuggestions[label] - }); - } - if (this.match(74) || - this.match(68) || - this.match(80) || - this.isContextual(129)) { - node.declaration = this.flowParseDeclare(this.startNode()); - node.default = false; - return this.finishNode(node, "DeclareExportDeclaration"); - } else if (this.match(55) || - this.match(5) || - this.isContextual(127) || - this.isContextual(128) || - this.isContextual(129)) { - node = this.parseExport(node, null); - if (node.type === "ExportNamedDeclaration") { - node.type = "ExportDeclaration"; - node.default = false; - delete node.exportKind; - } - node.type = "Declare" + node.type; - return node; - } - } - throw this.unexpected(); - } - flowParseDeclareModuleExports(node) { - this.next(); - this.expectContextual(109); - node.typeAnnotation = this.flowParseTypeAnnotation(); - this.semicolon(); - return this.finishNode(node, "DeclareModuleExports"); - } - flowParseDeclareTypeAlias(node) { - this.next(); - const finished = this.flowParseTypeAlias(node); - finished.type = "DeclareTypeAlias"; - return finished; - } - flowParseDeclareOpaqueType(node) { - this.next(); - const finished = this.flowParseOpaqueType(node, true); - finished.type = "DeclareOpaqueType"; - return finished; - } - flowParseDeclareInterface(node) { - this.next(); - this.flowParseInterfaceish(node); - return this.finishNode(node, "DeclareInterface"); - } - - flowParseInterfaceish(node, isClass = false) { - node.id = this.flowParseRestrictedIdentifier(!isClass, true); - this.scope.declareName(node.id.name, isClass ? BIND_FUNCTION : BIND_LEXICAL, node.id.loc.start); - if (this.match(47)) { - node.typeParameters = this.flowParseTypeParameterDeclaration(); - } else { - node.typeParameters = null; - } - node.extends = []; - node.implements = []; - node.mixins = []; - if (this.eat(81)) { - do { - node.extends.push(this.flowParseInterfaceExtends()); - } while (!isClass && this.eat(12)); - } - if (this.isContextual(115)) { - this.next(); - do { - node.mixins.push(this.flowParseInterfaceExtends()); - } while (this.eat(12)); - } - if (this.isContextual(111)) { - this.next(); - do { - node.implements.push(this.flowParseInterfaceExtends()); - } while (this.eat(12)); - } - node.body = this.flowParseObjectType({ - allowStatic: isClass, - allowExact: false, - allowSpread: false, - allowProto: isClass, - allowInexact: false - }); - } - flowParseInterfaceExtends() { - const node = this.startNode(); - node.id = this.flowParseQualifiedTypeIdentifier(); - if (this.match(47)) { - node.typeParameters = this.flowParseTypeParameterInstantiation(); - } else { - node.typeParameters = null; - } - return this.finishNode(node, "InterfaceExtends"); - } - flowParseInterface(node) { - this.flowParseInterfaceish(node); - return this.finishNode(node, "InterfaceDeclaration"); - } - checkNotUnderscore(word) { - if (word === "_") { - this.raise(FlowErrors.UnexpectedReservedUnderscore, { - at: this.state.startLoc - }); - } - } - checkReservedType(word, startLoc, declaration) { - if (!reservedTypes.has(word)) return; - this.raise(declaration ? FlowErrors.AssignReservedType : FlowErrors.UnexpectedReservedType, { - at: startLoc, - reservedType: word - }); - } - flowParseRestrictedIdentifier(liberal, declaration) { - this.checkReservedType(this.state.value, this.state.startLoc, declaration); - return this.parseIdentifier(liberal); - } - - flowParseTypeAlias(node) { - node.id = this.flowParseRestrictedIdentifier(false, true); - this.scope.declareName(node.id.name, BIND_LEXICAL, node.id.loc.start); - if (this.match(47)) { - node.typeParameters = this.flowParseTypeParameterDeclaration(); - } else { - node.typeParameters = null; - } - node.right = this.flowParseTypeInitialiser(29); - this.semicolon(); - return this.finishNode(node, "TypeAlias"); - } - flowParseOpaqueType(node, declare) { - this.expectContextual(128); - node.id = this.flowParseRestrictedIdentifier(true, true); - this.scope.declareName(node.id.name, BIND_LEXICAL, node.id.loc.start); - if (this.match(47)) { - node.typeParameters = this.flowParseTypeParameterDeclaration(); - } else { - node.typeParameters = null; - } - - node.supertype = null; - if (this.match(14)) { - node.supertype = this.flowParseTypeInitialiser(14); - } - node.impltype = null; - if (!declare) { - node.impltype = this.flowParseTypeInitialiser(29); - } - this.semicolon(); - return this.finishNode(node, "OpaqueType"); - } - - flowParseTypeParameter(requireDefault = false) { - const nodeStartLoc = this.state.startLoc; - const node = this.startNode(); - const variance = this.flowParseVariance(); - const ident = this.flowParseTypeAnnotatableIdentifier(); - node.name = ident.name; - node.variance = variance; - node.bound = ident.typeAnnotation; - if (this.match(29)) { - this.eat(29); - node.default = this.flowParseType(); - } else { - if (requireDefault) { - this.raise(FlowErrors.MissingTypeParamDefault, { - at: nodeStartLoc - }); - } - } - return this.finishNode(node, "TypeParameter"); - } - flowParseTypeParameterDeclaration() { - const oldInType = this.state.inType; - const node = this.startNode(); - node.params = []; - this.state.inType = true; - - if (this.match(47) || this.match(140)) { - this.next(); - } else { - this.unexpected(); - } - let defaultRequired = false; - do { - const typeParameter = this.flowParseTypeParameter(defaultRequired); - node.params.push(typeParameter); - if (typeParameter.default) { - defaultRequired = true; - } - if (!this.match(48)) { - this.expect(12); - } - } while (!this.match(48)); - this.expect(48); - this.state.inType = oldInType; - return this.finishNode(node, "TypeParameterDeclaration"); - } - flowParseTypeParameterInstantiation() { - const node = this.startNode(); - const oldInType = this.state.inType; - node.params = []; - this.state.inType = true; - this.expect(47); - const oldNoAnonFunctionType = this.state.noAnonFunctionType; - this.state.noAnonFunctionType = false; - while (!this.match(48)) { - node.params.push(this.flowParseType()); - if (!this.match(48)) { - this.expect(12); - } - } - this.state.noAnonFunctionType = oldNoAnonFunctionType; - this.expect(48); - this.state.inType = oldInType; - return this.finishNode(node, "TypeParameterInstantiation"); - } - flowParseTypeParameterInstantiationCallOrNew() { - const node = this.startNode(); - const oldInType = this.state.inType; - node.params = []; - this.state.inType = true; - this.expect(47); - while (!this.match(48)) { - node.params.push(this.flowParseTypeOrImplicitInstantiation()); - if (!this.match(48)) { - this.expect(12); - } - } - this.expect(48); - this.state.inType = oldInType; - return this.finishNode(node, "TypeParameterInstantiation"); - } - flowParseInterfaceType() { - const node = this.startNode(); - this.expectContextual(127); - node.extends = []; - if (this.eat(81)) { - do { - node.extends.push(this.flowParseInterfaceExtends()); - } while (this.eat(12)); - } - node.body = this.flowParseObjectType({ - allowStatic: false, - allowExact: false, - allowSpread: false, - allowProto: false, - allowInexact: false - }); - return this.finishNode(node, "InterfaceTypeAnnotation"); - } - flowParseObjectPropertyKey() { - return this.match(132) || this.match(131) ? super.parseExprAtom() : this.parseIdentifier(true); - } - flowParseObjectTypeIndexer(node, isStatic, variance) { - node.static = isStatic; - - if (this.lookahead().type === 14) { - node.id = this.flowParseObjectPropertyKey(); - node.key = this.flowParseTypeInitialiser(); - } else { - node.id = null; - node.key = this.flowParseType(); - } - this.expect(3); - node.value = this.flowParseTypeInitialiser(); - node.variance = variance; - return this.finishNode(node, "ObjectTypeIndexer"); - } - flowParseObjectTypeInternalSlot(node, isStatic) { - node.static = isStatic; - node.id = this.flowParseObjectPropertyKey(); - this.expect(3); - this.expect(3); - if (this.match(47) || this.match(10)) { - node.method = true; - node.optional = false; - node.value = this.flowParseObjectTypeMethodish(this.startNodeAt(node.loc.start)); - } else { - node.method = false; - if (this.eat(17)) { - node.optional = true; - } - node.value = this.flowParseTypeInitialiser(); - } - return this.finishNode(node, "ObjectTypeInternalSlot"); - } - flowParseObjectTypeMethodish(node) { - node.params = []; - node.rest = null; - node.typeParameters = null; - node.this = null; - if (this.match(47)) { - node.typeParameters = this.flowParseTypeParameterDeclaration(); - } - this.expect(10); - if (this.match(78)) { - node.this = this.flowParseFunctionTypeParam(true); - node.this.name = null; - if (!this.match(11)) { - this.expect(12); - } - } - while (!this.match(11) && !this.match(21)) { - node.params.push(this.flowParseFunctionTypeParam(false)); - if (!this.match(11)) { - this.expect(12); - } - } - if (this.eat(21)) { - node.rest = this.flowParseFunctionTypeParam(false); - } - this.expect(11); - node.returnType = this.flowParseTypeInitialiser(); - return this.finishNode(node, "FunctionTypeAnnotation"); - } - flowParseObjectTypeCallProperty(node, isStatic) { - const valueNode = this.startNode(); - node.static = isStatic; - node.value = this.flowParseObjectTypeMethodish(valueNode); - return this.finishNode(node, "ObjectTypeCallProperty"); - } - flowParseObjectType({ - allowStatic, - allowExact, - allowSpread, - allowProto, - allowInexact - }) { - const oldInType = this.state.inType; - this.state.inType = true; - const nodeStart = this.startNode(); - nodeStart.callProperties = []; - nodeStart.properties = []; - nodeStart.indexers = []; - nodeStart.internalSlots = []; - let endDelim; - let exact; - let inexact = false; - if (allowExact && this.match(6)) { - this.expect(6); - endDelim = 9; - exact = true; - } else { - this.expect(5); - endDelim = 8; - exact = false; - } - nodeStart.exact = exact; - while (!this.match(endDelim)) { - let isStatic = false; - let protoStartLoc = null; - let inexactStartLoc = null; - const node = this.startNode(); - if (allowProto && this.isContextual(116)) { - const lookahead = this.lookahead(); - if (lookahead.type !== 14 && lookahead.type !== 17) { - this.next(); - protoStartLoc = this.state.startLoc; - allowStatic = false; - } - } - if (allowStatic && this.isContextual(104)) { - const lookahead = this.lookahead(); - - if (lookahead.type !== 14 && lookahead.type !== 17) { - this.next(); - isStatic = true; - } - } - const variance = this.flowParseVariance(); - if (this.eat(0)) { - if (protoStartLoc != null) { - this.unexpected(protoStartLoc); - } - if (this.eat(0)) { - if (variance) { - this.unexpected(variance.loc.start); - } - nodeStart.internalSlots.push(this.flowParseObjectTypeInternalSlot(node, isStatic)); - } else { - nodeStart.indexers.push(this.flowParseObjectTypeIndexer(node, isStatic, variance)); - } - } else if (this.match(10) || this.match(47)) { - if (protoStartLoc != null) { - this.unexpected(protoStartLoc); - } - if (variance) { - this.unexpected(variance.loc.start); - } - nodeStart.callProperties.push(this.flowParseObjectTypeCallProperty(node, isStatic)); - } else { - let kind = "init"; - if (this.isContextual(98) || this.isContextual(103)) { - const lookahead = this.lookahead(); - if (tokenIsLiteralPropertyName(lookahead.type)) { - kind = this.state.value; - this.next(); - } - } - const propOrInexact = this.flowParseObjectTypeProperty(node, isStatic, protoStartLoc, variance, kind, allowSpread, allowInexact != null ? allowInexact : !exact); - if (propOrInexact === null) { - inexact = true; - inexactStartLoc = this.state.lastTokStartLoc; - } else { - nodeStart.properties.push(propOrInexact); - } - } - this.flowObjectTypeSemicolon(); - if (inexactStartLoc && !this.match(8) && !this.match(9)) { - this.raise(FlowErrors.UnexpectedExplicitInexactInObject, { - at: inexactStartLoc - }); - } - } - this.expect(endDelim); - - if (allowSpread) { - nodeStart.inexact = inexact; - } - const out = this.finishNode(nodeStart, "ObjectTypeAnnotation"); - this.state.inType = oldInType; - return out; - } - flowParseObjectTypeProperty(node, isStatic, protoStartLoc, variance, kind, allowSpread, allowInexact) { - if (this.eat(21)) { - const isInexactToken = this.match(12) || this.match(13) || this.match(8) || this.match(9); - if (isInexactToken) { - if (!allowSpread) { - this.raise(FlowErrors.InexactInsideNonObject, { - at: this.state.lastTokStartLoc - }); - } else if (!allowInexact) { - this.raise(FlowErrors.InexactInsideExact, { - at: this.state.lastTokStartLoc - }); - } - if (variance) { - this.raise(FlowErrors.InexactVariance, { - at: variance - }); - } - return null; - } - if (!allowSpread) { - this.raise(FlowErrors.UnexpectedSpreadType, { - at: this.state.lastTokStartLoc - }); - } - if (protoStartLoc != null) { - this.unexpected(protoStartLoc); - } - if (variance) { - this.raise(FlowErrors.SpreadVariance, { - at: variance - }); - } - node.argument = this.flowParseType(); - return this.finishNode(node, "ObjectTypeSpreadProperty"); - } else { - node.key = this.flowParseObjectPropertyKey(); - node.static = isStatic; - node.proto = protoStartLoc != null; - node.kind = kind; - let optional = false; - if (this.match(47) || this.match(10)) { - node.method = true; - if (protoStartLoc != null) { - this.unexpected(protoStartLoc); - } - if (variance) { - this.unexpected(variance.loc.start); - } - node.value = this.flowParseObjectTypeMethodish(this.startNodeAt(node.loc.start)); - if (kind === "get" || kind === "set") { - this.flowCheckGetterSetterParams(node); - } - if (!allowSpread && node.key.name === "constructor" && node.value.this) { - this.raise(FlowErrors.ThisParamBannedInConstructor, { - at: node.value.this - }); - } - } else { - if (kind !== "init") this.unexpected(); - node.method = false; - if (this.eat(17)) { - optional = true; - } - node.value = this.flowParseTypeInitialiser(); - node.variance = variance; - } - node.optional = optional; - return this.finishNode(node, "ObjectTypeProperty"); - } - } - - flowCheckGetterSetterParams(property) { - const paramCount = property.kind === "get" ? 0 : 1; - const length = property.value.params.length + (property.value.rest ? 1 : 0); - if (property.value.this) { - this.raise(property.kind === "get" ? FlowErrors.GetterMayNotHaveThisParam : FlowErrors.SetterMayNotHaveThisParam, { - at: property.value.this - }); - } - if (length !== paramCount) { - this.raise(property.kind === "get" ? Errors.BadGetterArity : Errors.BadSetterArity, { - at: property - }); - } - if (property.kind === "set" && property.value.rest) { - this.raise(Errors.BadSetterRestParameter, { - at: property - }); - } - } - flowObjectTypeSemicolon() { - if (!this.eat(13) && !this.eat(12) && !this.match(8) && !this.match(9)) { - this.unexpected(); - } - } - flowParseQualifiedTypeIdentifier(startLoc, id) { - var _startLoc; - (_startLoc = startLoc) != null ? _startLoc : startLoc = this.state.startLoc; - let node = id || this.flowParseRestrictedIdentifier(true); - while (this.eat(16)) { - const node2 = this.startNodeAt(startLoc); - node2.qualification = node; - node2.id = this.flowParseRestrictedIdentifier(true); - node = this.finishNode(node2, "QualifiedTypeIdentifier"); - } - return node; - } - flowParseGenericType(startLoc, id) { - const node = this.startNodeAt(startLoc); - node.typeParameters = null; - node.id = this.flowParseQualifiedTypeIdentifier(startLoc, id); - if (this.match(47)) { - node.typeParameters = this.flowParseTypeParameterInstantiation(); - } - return this.finishNode(node, "GenericTypeAnnotation"); - } - flowParseTypeofType() { - const node = this.startNode(); - this.expect(87); - node.argument = this.flowParsePrimaryType(); - return this.finishNode(node, "TypeofTypeAnnotation"); - } - flowParseTupleType() { - const node = this.startNode(); - node.types = []; - this.expect(0); - while (this.state.pos < this.length && !this.match(3)) { - node.types.push(this.flowParseType()); - if (this.match(3)) break; - this.expect(12); - } - this.expect(3); - return this.finishNode(node, "TupleTypeAnnotation"); - } - flowParseFunctionTypeParam(first) { - let name = null; - let optional = false; - let typeAnnotation = null; - const node = this.startNode(); - const lh = this.lookahead(); - const isThis = this.state.type === 78; - if (lh.type === 14 || lh.type === 17) { - if (isThis && !first) { - this.raise(FlowErrors.ThisParamMustBeFirst, { - at: node - }); - } - name = this.parseIdentifier(isThis); - if (this.eat(17)) { - optional = true; - if (isThis) { - this.raise(FlowErrors.ThisParamMayNotBeOptional, { - at: node - }); - } - } - typeAnnotation = this.flowParseTypeInitialiser(); - } else { - typeAnnotation = this.flowParseType(); - } - node.name = name; - node.optional = optional; - node.typeAnnotation = typeAnnotation; - return this.finishNode(node, "FunctionTypeParam"); - } - reinterpretTypeAsFunctionTypeParam(type) { - const node = this.startNodeAt(type.loc.start); - node.name = null; - node.optional = false; - node.typeAnnotation = type; - return this.finishNode(node, "FunctionTypeParam"); - } - flowParseFunctionTypeParams(params = []) { - let rest = null; - let _this = null; - if (this.match(78)) { - _this = this.flowParseFunctionTypeParam(true); - _this.name = null; - if (!this.match(11)) { - this.expect(12); - } - } - while (!this.match(11) && !this.match(21)) { - params.push(this.flowParseFunctionTypeParam(false)); - if (!this.match(11)) { - this.expect(12); - } - } - if (this.eat(21)) { - rest = this.flowParseFunctionTypeParam(false); - } - return { - params, - rest, - _this - }; - } - flowIdentToTypeAnnotation(startLoc, node, id) { - switch (id.name) { - case "any": - return this.finishNode(node, "AnyTypeAnnotation"); - case "bool": - case "boolean": - return this.finishNode(node, "BooleanTypeAnnotation"); - case "mixed": - return this.finishNode(node, "MixedTypeAnnotation"); - case "empty": - return this.finishNode(node, "EmptyTypeAnnotation"); - case "number": - return this.finishNode(node, "NumberTypeAnnotation"); - case "string": - return this.finishNode(node, "StringTypeAnnotation"); - case "symbol": - return this.finishNode(node, "SymbolTypeAnnotation"); - default: - this.checkNotUnderscore(id.name); - return this.flowParseGenericType(startLoc, id); - } - } - - flowParsePrimaryType() { - const startLoc = this.state.startLoc; - const node = this.startNode(); - let tmp; - let type; - let isGroupedType = false; - const oldNoAnonFunctionType = this.state.noAnonFunctionType; - switch (this.state.type) { - case 5: - return this.flowParseObjectType({ - allowStatic: false, - allowExact: false, - allowSpread: true, - allowProto: false, - allowInexact: true - }); - case 6: - return this.flowParseObjectType({ - allowStatic: false, - allowExact: true, - allowSpread: true, - allowProto: false, - allowInexact: false - }); - case 0: - this.state.noAnonFunctionType = false; - type = this.flowParseTupleType(); - this.state.noAnonFunctionType = oldNoAnonFunctionType; - return type; - case 47: - node.typeParameters = this.flowParseTypeParameterDeclaration(); - this.expect(10); - tmp = this.flowParseFunctionTypeParams(); - node.params = tmp.params; - node.rest = tmp.rest; - node.this = tmp._this; - this.expect(11); - this.expect(19); - node.returnType = this.flowParseType(); - return this.finishNode(node, "FunctionTypeAnnotation"); - case 10: - this.next(); - - if (!this.match(11) && !this.match(21)) { - if (tokenIsIdentifier(this.state.type) || this.match(78)) { - const token = this.lookahead().type; - isGroupedType = token !== 17 && token !== 14; - } else { - isGroupedType = true; - } - } - if (isGroupedType) { - this.state.noAnonFunctionType = false; - type = this.flowParseType(); - this.state.noAnonFunctionType = oldNoAnonFunctionType; - - if (this.state.noAnonFunctionType || !(this.match(12) || this.match(11) && this.lookahead().type === 19)) { - this.expect(11); - return type; - } else { - this.eat(12); - } - } - if (type) { - tmp = this.flowParseFunctionTypeParams([this.reinterpretTypeAsFunctionTypeParam(type)]); - } else { - tmp = this.flowParseFunctionTypeParams(); - } - node.params = tmp.params; - node.rest = tmp.rest; - node.this = tmp._this; - this.expect(11); - this.expect(19); - node.returnType = this.flowParseType(); - node.typeParameters = null; - return this.finishNode(node, "FunctionTypeAnnotation"); - case 131: - return this.parseLiteral(this.state.value, "StringLiteralTypeAnnotation"); - case 85: - case 86: - node.value = this.match(85); - this.next(); - return this.finishNode(node, "BooleanLiteralTypeAnnotation"); - case 53: - if (this.state.value === "-") { - this.next(); - if (this.match(132)) { - return this.parseLiteralAtNode(-this.state.value, "NumberLiteralTypeAnnotation", node); - } - if (this.match(133)) { - return this.parseLiteralAtNode(-this.state.value, "BigIntLiteralTypeAnnotation", node); - } - throw this.raise(FlowErrors.UnexpectedSubtractionOperand, { - at: this.state.startLoc - }); - } - throw this.unexpected(); - case 132: - return this.parseLiteral(this.state.value, "NumberLiteralTypeAnnotation"); - case 133: - return this.parseLiteral(this.state.value, "BigIntLiteralTypeAnnotation"); - case 88: - this.next(); - return this.finishNode(node, "VoidTypeAnnotation"); - case 84: - this.next(); - return this.finishNode(node, "NullLiteralTypeAnnotation"); - case 78: - this.next(); - return this.finishNode(node, "ThisTypeAnnotation"); - case 55: - this.next(); - return this.finishNode(node, "ExistsTypeAnnotation"); - case 87: - return this.flowParseTypeofType(); - default: - if (tokenIsKeyword(this.state.type)) { - const label = tokenLabelName(this.state.type); - this.next(); - return super.createIdentifier(node, label); - } else if (tokenIsIdentifier(this.state.type)) { - if (this.isContextual(127)) { - return this.flowParseInterfaceType(); - } - return this.flowIdentToTypeAnnotation(startLoc, node, this.parseIdentifier()); - } - } - throw this.unexpected(); - } - flowParsePostfixType() { - const startLoc = this.state.startLoc; - let type = this.flowParsePrimaryType(); - let seenOptionalIndexedAccess = false; - while ((this.match(0) || this.match(18)) && !this.canInsertSemicolon()) { - const node = this.startNodeAt(startLoc); - const optional = this.eat(18); - seenOptionalIndexedAccess = seenOptionalIndexedAccess || optional; - this.expect(0); - if (!optional && this.match(3)) { - node.elementType = type; - this.next(); - type = this.finishNode(node, "ArrayTypeAnnotation"); - } else { - node.objectType = type; - node.indexType = this.flowParseType(); - this.expect(3); - if (seenOptionalIndexedAccess) { - node.optional = optional; - type = this.finishNode( - node, "OptionalIndexedAccessType"); - } else { - type = this.finishNode( - node, "IndexedAccessType"); - } - } - } - return type; - } - flowParsePrefixType() { - const node = this.startNode(); - if (this.eat(17)) { - node.typeAnnotation = this.flowParsePrefixType(); - return this.finishNode(node, "NullableTypeAnnotation"); - } else { - return this.flowParsePostfixType(); - } - } - flowParseAnonFunctionWithoutParens() { - const param = this.flowParsePrefixType(); - if (!this.state.noAnonFunctionType && this.eat(19)) { - const node = this.startNodeAt(param.loc.start); - node.params = [this.reinterpretTypeAsFunctionTypeParam(param)]; - node.rest = null; - node.this = null; - node.returnType = this.flowParseType(); - node.typeParameters = null; - return this.finishNode(node, "FunctionTypeAnnotation"); - } - return param; - } - flowParseIntersectionType() { - const node = this.startNode(); - this.eat(45); - const type = this.flowParseAnonFunctionWithoutParens(); - node.types = [type]; - while (this.eat(45)) { - node.types.push(this.flowParseAnonFunctionWithoutParens()); - } - return node.types.length === 1 ? type : this.finishNode(node, "IntersectionTypeAnnotation"); - } - flowParseUnionType() { - const node = this.startNode(); - this.eat(43); - const type = this.flowParseIntersectionType(); - node.types = [type]; - while (this.eat(43)) { - node.types.push(this.flowParseIntersectionType()); - } - return node.types.length === 1 ? type : this.finishNode(node, "UnionTypeAnnotation"); - } - flowParseType() { - const oldInType = this.state.inType; - this.state.inType = true; - const type = this.flowParseUnionType(); - this.state.inType = oldInType; - return type; - } - flowParseTypeOrImplicitInstantiation() { - if (this.state.type === 130 && this.state.value === "_") { - const startLoc = this.state.startLoc; - const node = this.parseIdentifier(); - return this.flowParseGenericType(startLoc, node); - } else { - return this.flowParseType(); - } - } - flowParseTypeAnnotation() { - const node = this.startNode(); - node.typeAnnotation = this.flowParseTypeInitialiser(); - return this.finishNode(node, "TypeAnnotation"); - } - flowParseTypeAnnotatableIdentifier(allowPrimitiveOverride) { - const ident = allowPrimitiveOverride ? this.parseIdentifier() : this.flowParseRestrictedIdentifier(); - if (this.match(14)) { - ident.typeAnnotation = this.flowParseTypeAnnotation(); - this.resetEndLocation(ident); - } - return ident; - } - typeCastToParameter(node) { - node.expression.typeAnnotation = node.typeAnnotation; - this.resetEndLocation(node.expression, node.typeAnnotation.loc.end); - return node.expression; - } - flowParseVariance() { - let variance = null; - if (this.match(53)) { - variance = this.startNode(); - if (this.state.value === "+") { - variance.kind = "plus"; - } else { - variance.kind = "minus"; - } - this.next(); - return this.finishNode(variance, "Variance"); - } - return variance; - } - - parseFunctionBody(node, allowExpressionBody, isMethod = false) { - if (allowExpressionBody) { - return this.forwardNoArrowParamsConversionAt(node, () => super.parseFunctionBody(node, true, isMethod)); - } - return super.parseFunctionBody(node, false, isMethod); - } - parseFunctionBodyAndFinish(node, type, isMethod = false) { - if (this.match(14)) { - const typeNode = this.startNode(); - [typeNode.typeAnnotation, - node.predicate] = this.flowParseTypeAndPredicateInitialiser(); - node.returnType = typeNode.typeAnnotation ? this.finishNode(typeNode, "TypeAnnotation") : null; - } - return super.parseFunctionBodyAndFinish(node, type, isMethod); - } - - parseStatement(context, topLevel) { - if (this.state.strict && this.isContextual(127)) { - const lookahead = this.lookahead(); - if (tokenIsKeywordOrIdentifier(lookahead.type)) { - const node = this.startNode(); - this.next(); - return this.flowParseInterface(node); - } - } else if (this.shouldParseEnums() && this.isContextual(124)) { - const node = this.startNode(); - this.next(); - return this.flowParseEnumDeclaration(node); - } - const stmt = super.parseStatement(context, topLevel); - if (this.flowPragma === undefined && !this.isValidDirective(stmt)) { - this.flowPragma = null; - } - return stmt; - } - - parseExpressionStatement(node, expr, decorators) { - if (expr.type === "Identifier") { - if (expr.name === "declare") { - if (this.match(80) || tokenIsIdentifier(this.state.type) || this.match(68) || this.match(74) || this.match(82)) { - return this.flowParseDeclare(node); - } - } else if (tokenIsIdentifier(this.state.type)) { - if (expr.name === "interface") { - return this.flowParseInterface(node); - } else if (expr.name === "type") { - return this.flowParseTypeAlias(node); - } else if (expr.name === "opaque") { - return this.flowParseOpaqueType(node, false); - } - } - } - return super.parseExpressionStatement(node, expr, decorators); - } - - shouldParseExportDeclaration() { - const { - type - } = this.state; - if (tokenIsFlowInterfaceOrTypeOrOpaque(type) || this.shouldParseEnums() && type === 124) { - return !this.state.containsEsc; - } - return super.shouldParseExportDeclaration(); - } - isExportDefaultSpecifier() { - const { - type - } = this.state; - if (tokenIsFlowInterfaceOrTypeOrOpaque(type) || this.shouldParseEnums() && type === 124) { - return this.state.containsEsc; - } - return super.isExportDefaultSpecifier(); - } - parseExportDefaultExpression() { - if (this.shouldParseEnums() && this.isContextual(124)) { - const node = this.startNode(); - this.next(); - return this.flowParseEnumDeclaration(node); - } - return super.parseExportDefaultExpression(); - } - parseConditional(expr, startLoc, refExpressionErrors) { - if (!this.match(17)) return expr; - if (this.state.maybeInArrowParameters) { - const nextCh = this.lookaheadCharCode(); - if (nextCh === 44 || - nextCh === 61 || - nextCh === 58 || - nextCh === 41) { - this.setOptionalParametersError(refExpressionErrors); - return expr; - } - } - this.expect(17); - const state = this.state.clone(); - const originalNoArrowAt = this.state.noArrowAt; - const node = this.startNodeAt(startLoc); - let { - consequent, - failed - } = this.tryParseConditionalConsequent(); - let [valid, invalid] = this.getArrowLikeExpressions(consequent); - if (failed || invalid.length > 0) { - const noArrowAt = [...originalNoArrowAt]; - if (invalid.length > 0) { - this.state = state; - this.state.noArrowAt = noArrowAt; - for (let i = 0; i < invalid.length; i++) { - noArrowAt.push(invalid[i].start); - } - ({ - consequent, - failed - } = this.tryParseConditionalConsequent()); - [valid, invalid] = this.getArrowLikeExpressions(consequent); - } - if (failed && valid.length > 1) { - this.raise(FlowErrors.AmbiguousConditionalArrow, { - at: state.startLoc - }); - } - if (failed && valid.length === 1) { - this.state = state; - noArrowAt.push(valid[0].start); - this.state.noArrowAt = noArrowAt; - ({ - consequent, - failed - } = this.tryParseConditionalConsequent()); - } - } - this.getArrowLikeExpressions(consequent, true); - this.state.noArrowAt = originalNoArrowAt; - this.expect(14); - node.test = expr; - node.consequent = consequent; - node.alternate = this.forwardNoArrowParamsConversionAt(node, () => this.parseMaybeAssign(undefined, undefined)); - return this.finishNode(node, "ConditionalExpression"); - } - tryParseConditionalConsequent() { - this.state.noArrowParamsConversionAt.push(this.state.start); - const consequent = this.parseMaybeAssignAllowIn(); - const failed = !this.match(14); - this.state.noArrowParamsConversionAt.pop(); - return { - consequent, - failed - }; - } - - getArrowLikeExpressions(node, disallowInvalid) { - const stack = [node]; - const arrows = []; - while (stack.length !== 0) { - const node = stack.pop(); - if (node.type === "ArrowFunctionExpression") { - if (node.typeParameters || !node.returnType) { - this.finishArrowValidation(node); - } else { - arrows.push(node); - } - stack.push(node.body); - } else if (node.type === "ConditionalExpression") { - stack.push(node.consequent); - stack.push(node.alternate); - } - } - if (disallowInvalid) { - arrows.forEach(node => this.finishArrowValidation(node)); - return [arrows, []]; - } - return partition(arrows, node => node.params.every(param => this.isAssignable(param, true))); - } - finishArrowValidation(node) { - var _node$extra; - this.toAssignableList( - node.params, (_node$extra = node.extra) == null ? void 0 : _node$extra.trailingCommaLoc, false); - this.scope.enter(SCOPE_FUNCTION | SCOPE_ARROW); - super.checkParams(node, false, true); - this.scope.exit(); - } - forwardNoArrowParamsConversionAt(node, parse) { - let result; - if (this.state.noArrowParamsConversionAt.indexOf(node.start) !== -1) { - this.state.noArrowParamsConversionAt.push(this.state.start); - result = parse(); - this.state.noArrowParamsConversionAt.pop(); - } else { - result = parse(); - } - return result; - } - parseParenItem(node, startLoc) { - node = super.parseParenItem(node, startLoc); - if (this.eat(17)) { - node.optional = true; - this.resetEndLocation(node); - } - if (this.match(14)) { - const typeCastNode = this.startNodeAt(startLoc); - typeCastNode.expression = node; - typeCastNode.typeAnnotation = this.flowParseTypeAnnotation(); - return this.finishNode(typeCastNode, "TypeCastExpression"); - } - return node; - } - assertModuleNodeAllowed(node) { - if (node.type === "ImportDeclaration" && (node.importKind === "type" || node.importKind === "typeof") || node.type === "ExportNamedDeclaration" && node.exportKind === "type" || node.type === "ExportAllDeclaration" && node.exportKind === "type") { - return; - } - super.assertModuleNodeAllowed(node); - } - parseExport(node, decorators) { - const decl = super.parseExport(node, decorators); - if (decl.type === "ExportNamedDeclaration" || decl.type === "ExportAllDeclaration") { - decl.exportKind = decl.exportKind || "value"; - } - return decl; - } - parseExportDeclaration(node) { - if (this.isContextual(128)) { - node.exportKind = "type"; - const declarationNode = this.startNode(); - this.next(); - if (this.match(5)) { - node.specifiers = this.parseExportSpecifiers(true); - super.parseExportFrom(node); - return null; - } else { - return this.flowParseTypeAlias(declarationNode); - } - } else if (this.isContextual(129)) { - node.exportKind = "type"; - const declarationNode = this.startNode(); - this.next(); - return this.flowParseOpaqueType(declarationNode, false); - } else if (this.isContextual(127)) { - node.exportKind = "type"; - const declarationNode = this.startNode(); - this.next(); - return this.flowParseInterface(declarationNode); - } else if (this.shouldParseEnums() && this.isContextual(124)) { - node.exportKind = "value"; - const declarationNode = this.startNode(); - this.next(); - return this.flowParseEnumDeclaration(declarationNode); - } else { - return super.parseExportDeclaration(node); - } - } - eatExportStar(node) { - if (super.eatExportStar(node)) return true; - if (this.isContextual(128) && this.lookahead().type === 55) { - node.exportKind = "type"; - this.next(); - this.next(); - return true; - } - return false; - } - maybeParseExportNamespaceSpecifier(node) { - const { - startLoc - } = this.state; - const hasNamespace = super.maybeParseExportNamespaceSpecifier(node); - if (hasNamespace && node.exportKind === "type") { - this.unexpected(startLoc); - } - return hasNamespace; - } - parseClassId(node, isStatement, optionalId) { - super.parseClassId(node, isStatement, optionalId); - if (this.match(47)) { - node.typeParameters = this.flowParseTypeParameterDeclaration(); - } - } - parseClassMember(classBody, member, state) { - const { - startLoc - } = this.state; - if (this.isContextual(123)) { - if (super.parseClassMemberFromModifier(classBody, member)) { - return; - } - member.declare = true; - } - super.parseClassMember(classBody, member, state); - if (member.declare) { - if (member.type !== "ClassProperty" && member.type !== "ClassPrivateProperty" && member.type !== "PropertyDefinition") { - this.raise(FlowErrors.DeclareClassElement, { - at: startLoc - }); - } else if (member.value) { - this.raise(FlowErrors.DeclareClassFieldInitializer, { - at: member.value - }); - } - } - } - isIterator(word) { - return word === "iterator" || word === "asyncIterator"; - } - readIterator() { - const word = super.readWord1(); - const fullWord = "@@" + word; - - if (!this.isIterator(word) || !this.state.inType) { - this.raise(Errors.InvalidIdentifier, { - at: this.state.curPosition(), - identifierName: fullWord - }); - } - this.finishToken(130, fullWord); - } - - getTokenFromCode(code) { - const next = this.input.charCodeAt(this.state.pos + 1); - if (code === 123 && next === 124) { - return this.finishOp(6, 2); - } else if (this.state.inType && (code === 62 || code === 60)) { - return this.finishOp(code === 62 ? 48 : 47, 1); - } else if (this.state.inType && code === 63) { - if (next === 46) { - return this.finishOp(18, 2); - } - return this.finishOp(17, 1); - } else if (isIteratorStart(code, next, this.input.charCodeAt(this.state.pos + 2))) { - this.state.pos += 2; - return this.readIterator(); - } else { - return super.getTokenFromCode(code); - } - } - isAssignable(node, isBinding) { - if (node.type === "TypeCastExpression") { - return this.isAssignable(node.expression, isBinding); - } else { - return super.isAssignable(node, isBinding); - } - } - toAssignable(node, isLHS = false) { - if (!isLHS && node.type === "AssignmentExpression" && node.left.type === "TypeCastExpression") { - node.left = this.typeCastToParameter(node.left); - } - super.toAssignable(node, isLHS); - } - - toAssignableList(exprList, trailingCommaLoc, isLHS) { - for (let i = 0; i < exprList.length; i++) { - const expr = exprList[i]; - if ((expr == null ? void 0 : expr.type) === "TypeCastExpression") { - exprList[i] = this.typeCastToParameter(expr); - } - } - super.toAssignableList(exprList, trailingCommaLoc, isLHS); - } - - toReferencedList(exprList, isParenthesizedExpr) { - for (let i = 0; i < exprList.length; i++) { - var _expr$extra; - const expr = exprList[i]; - if (expr && expr.type === "TypeCastExpression" && !((_expr$extra = expr.extra) != null && _expr$extra.parenthesized) && (exprList.length > 1 || !isParenthesizedExpr)) { - this.raise(FlowErrors.TypeCastInPattern, { - at: expr.typeAnnotation - }); - } - } - return exprList; - } - parseArrayLike(close, canBePattern, isTuple, refExpressionErrors) { - const node = super.parseArrayLike(close, canBePattern, isTuple, refExpressionErrors); - - if (canBePattern && !this.state.maybeInArrowParameters) { - this.toReferencedList(node.elements); - } - return node; - } - isValidLVal(type, isParenthesized, binding) { - return type === "TypeCastExpression" || super.isValidLVal(type, isParenthesized, binding); - } - - parseClassProperty(node) { - if (this.match(14)) { - node.typeAnnotation = this.flowParseTypeAnnotation(); - } - return super.parseClassProperty(node); - } - parseClassPrivateProperty(node) { - if (this.match(14)) { - node.typeAnnotation = this.flowParseTypeAnnotation(); - } - return super.parseClassPrivateProperty(node); - } - - isClassMethod() { - return this.match(47) || super.isClassMethod(); - } - - isClassProperty() { - return this.match(14) || super.isClassProperty(); - } - isNonstaticConstructor(method) { - return !this.match(14) && super.isNonstaticConstructor(method); - } - - pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper) { - if (method.variance) { - this.unexpected(method.variance.loc.start); - } - delete method.variance; - if (this.match(47)) { - method.typeParameters = this.flowParseTypeParameterDeclaration(); - } - super.pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper); - if (method.params && isConstructor) { - const params = method.params; - if (params.length > 0 && this.isThisParam(params[0])) { - this.raise(FlowErrors.ThisParamBannedInConstructor, { - at: method - }); - } - } else if ( - method.type === "MethodDefinition" && isConstructor && - method.value.params) { - const params = method.value.params; - if (params.length > 0 && this.isThisParam(params[0])) { - this.raise(FlowErrors.ThisParamBannedInConstructor, { - at: method - }); - } - } - } - pushClassPrivateMethod(classBody, method, isGenerator, isAsync) { - if (method.variance) { - this.unexpected(method.variance.loc.start); - } - delete method.variance; - if (this.match(47)) { - method.typeParameters = this.flowParseTypeParameterDeclaration(); - } - super.pushClassPrivateMethod(classBody, method, isGenerator, isAsync); - } - - parseClassSuper(node) { - super.parseClassSuper(node); - if (node.superClass && this.match(47)) { - node.superTypeParameters = this.flowParseTypeParameterInstantiation(); - } - if (this.isContextual(111)) { - this.next(); - const implemented = node.implements = []; - do { - const node = this.startNode(); - node.id = this.flowParseRestrictedIdentifier(true); - if (this.match(47)) { - node.typeParameters = this.flowParseTypeParameterInstantiation(); - } else { - node.typeParameters = null; - } - implemented.push(this.finishNode(node, "ClassImplements")); - } while (this.eat(12)); - } - } - checkGetterSetterParams(method) { - super.checkGetterSetterParams(method); - const params = this.getObjectOrClassMethodParams(method); - if (params.length > 0) { - const param = params[0]; - if (this.isThisParam(param) && method.kind === "get") { - this.raise(FlowErrors.GetterMayNotHaveThisParam, { - at: param - }); - } else if (this.isThisParam(param)) { - this.raise(FlowErrors.SetterMayNotHaveThisParam, { - at: param - }); - } - } - } - parsePropertyNamePrefixOperator(node) { - node.variance = this.flowParseVariance(); - } - - parseObjPropValue(prop, startLoc, isGenerator, isAsync, isPattern, isAccessor, refExpressionErrors) { - if (prop.variance) { - this.unexpected(prop.variance.loc.start); - } - delete prop.variance; - let typeParameters; - - if (this.match(47) && !isAccessor) { - typeParameters = this.flowParseTypeParameterDeclaration(); - if (!this.match(10)) this.unexpected(); - } - const result = super.parseObjPropValue(prop, startLoc, isGenerator, isAsync, isPattern, isAccessor, refExpressionErrors); - - if (typeParameters) { - (result.value || result).typeParameters = typeParameters; - } - return result; - } - parseAssignableListItemTypes(param) { - if (this.eat(17)) { - if (param.type !== "Identifier") { - this.raise(FlowErrors.PatternIsOptional, { - at: param - }); - } - if (this.isThisParam(param)) { - this.raise(FlowErrors.ThisParamMayNotBeOptional, { - at: param - }); - } - param.optional = true; - } - if (this.match(14)) { - param.typeAnnotation = this.flowParseTypeAnnotation(); - } else if (this.isThisParam(param)) { - this.raise(FlowErrors.ThisParamAnnotationRequired, { - at: param - }); - } - if (this.match(29) && this.isThisParam(param)) { - this.raise(FlowErrors.ThisParamNoDefault, { - at: param - }); - } - this.resetEndLocation(param); - return param; - } - parseMaybeDefault(startLoc, left) { - const node = super.parseMaybeDefault(startLoc, left); - if (node.type === "AssignmentPattern" && node.typeAnnotation && node.right.start < node.typeAnnotation.start) { - this.raise(FlowErrors.TypeBeforeInitializer, { - at: node.typeAnnotation - }); - } - return node; - } - shouldParseDefaultImport(node) { - if (!hasTypeImportKind(node)) { - return super.shouldParseDefaultImport(node); - } - return isMaybeDefaultImport(this.state.type); - } - checkImportReflection(node) { - super.checkImportReflection(node); - if (node.module && node.importKind !== "value") { - this.raise(FlowErrors.ImportReflectionHasImportType, { - at: node.specifiers[0].loc.start - }); - } - } - parseImportSpecifierLocal(node, specifier, type) { - specifier.local = hasTypeImportKind(node) ? this.flowParseRestrictedIdentifier(true, true) : this.parseIdentifier(); - node.specifiers.push(this.finishImportSpecifier(specifier, type)); - } - - maybeParseDefaultImportSpecifier(node) { - node.importKind = "value"; - let kind = null; - if (this.match(87)) { - kind = "typeof"; - } else if (this.isContextual(128)) { - kind = "type"; - } - if (kind) { - const lh = this.lookahead(); - const { - type - } = lh; - - if (kind === "type" && type === 55) { - this.unexpected(null, lh.type); - } - if (isMaybeDefaultImport(type) || type === 5 || type === 55) { - this.next(); - node.importKind = kind; - } - } - return super.maybeParseDefaultImportSpecifier(node); - } - - parseImportSpecifier(specifier, importedIsString, isInTypeOnlyImport, - isMaybeTypeOnly, - bindingType) { - const firstIdent = specifier.imported; - let specifierTypeKind = null; - if (firstIdent.type === "Identifier") { - if (firstIdent.name === "type") { - specifierTypeKind = "type"; - } else if (firstIdent.name === "typeof") { - specifierTypeKind = "typeof"; - } - } - let isBinding = false; - if (this.isContextual(93) && !this.isLookaheadContextual("as")) { - const as_ident = this.parseIdentifier(true); - if (specifierTypeKind !== null && !tokenIsKeywordOrIdentifier(this.state.type)) { - specifier.imported = as_ident; - specifier.importKind = specifierTypeKind; - specifier.local = cloneIdentifier(as_ident); - } else { - specifier.imported = firstIdent; - specifier.importKind = null; - specifier.local = this.parseIdentifier(); - } - } else { - if (specifierTypeKind !== null && tokenIsKeywordOrIdentifier(this.state.type)) { - specifier.imported = this.parseIdentifier(true); - specifier.importKind = specifierTypeKind; - } else { - if (importedIsString) { - throw this.raise(Errors.ImportBindingIsString, { - at: specifier, - importName: firstIdent.value - }); - } - specifier.imported = firstIdent; - specifier.importKind = null; - } - if (this.eatContextual(93)) { - specifier.local = this.parseIdentifier(); - } else { - isBinding = true; - specifier.local = cloneIdentifier(specifier.imported); - } - } - const specifierIsTypeImport = hasTypeImportKind(specifier); - if (isInTypeOnlyImport && specifierIsTypeImport) { - this.raise(FlowErrors.ImportTypeShorthandOnlyInPureImport, { - at: specifier - }); - } - if (isInTypeOnlyImport || specifierIsTypeImport) { - this.checkReservedType(specifier.local.name, specifier.local.loc.start, true); - } - if (isBinding && !isInTypeOnlyImport && !specifierIsTypeImport) { - this.checkReservedWord(specifier.local.name, specifier.loc.start, true, true); - } - return this.finishImportSpecifier(specifier, "ImportSpecifier"); - } - parseBindingAtom() { - switch (this.state.type) { - case 78: - return this.parseIdentifier(true); - default: - return super.parseBindingAtom(); - } - } - - parseFunctionParams(node, allowModifiers) { - const kind = node.kind; - if (kind !== "get" && kind !== "set" && this.match(47)) { - node.typeParameters = this.flowParseTypeParameterDeclaration(); - } - super.parseFunctionParams(node, allowModifiers); - } - - parseVarId(decl, kind) { - super.parseVarId(decl, kind); - if (this.match(14)) { - decl.id.typeAnnotation = this.flowParseTypeAnnotation(); - this.resetEndLocation(decl.id); - } - } - - parseAsyncArrowFromCallExpression(node, call) { - if (this.match(14)) { - const oldNoAnonFunctionType = this.state.noAnonFunctionType; - this.state.noAnonFunctionType = true; - node.returnType = this.flowParseTypeAnnotation(); - this.state.noAnonFunctionType = oldNoAnonFunctionType; - } - return super.parseAsyncArrowFromCallExpression(node, call); - } - - shouldParseAsyncArrow() { - return this.match(14) || super.shouldParseAsyncArrow(); - } - - parseMaybeAssign(refExpressionErrors, afterLeftParse) { - var _jsx; - let state = null; - let jsx; - if (this.hasPlugin("jsx") && (this.match(140) || this.match(47))) { - state = this.state.clone(); - jsx = this.tryParse(() => super.parseMaybeAssign(refExpressionErrors, afterLeftParse), state); - - if (!jsx.error) return jsx.node; - - const { - context - } = this.state; - const currentContext = context[context.length - 1]; - if (currentContext === types.j_oTag || currentContext === types.j_expr) { - context.pop(); - } - } - if ((_jsx = jsx) != null && _jsx.error || this.match(47)) { - var _jsx2, _jsx3; - state = state || this.state.clone(); - let typeParameters; - const arrow = this.tryParse(abort => { - var _arrowExpression$extr; - typeParameters = this.flowParseTypeParameterDeclaration(); - const arrowExpression = this.forwardNoArrowParamsConversionAt(typeParameters, () => { - const result = super.parseMaybeAssign(refExpressionErrors, afterLeftParse); - this.resetStartLocationFromNode(result, typeParameters); - return result; - }); - - if ((_arrowExpression$extr = arrowExpression.extra) != null && _arrowExpression$extr.parenthesized) abort(); - - const expr = this.maybeUnwrapTypeCastExpression(arrowExpression); - if (expr.type !== "ArrowFunctionExpression") abort(); - expr.typeParameters = typeParameters; - this.resetStartLocationFromNode(expr, typeParameters); - return arrowExpression; - }, state); - let arrowExpression = null; - if (arrow.node && - this.maybeUnwrapTypeCastExpression(arrow.node).type === "ArrowFunctionExpression") { - if (!arrow.error && !arrow.aborted) { - if (arrow.node.async) { - this.raise(FlowErrors.UnexpectedTypeParameterBeforeAsyncArrowFunction, { - at: typeParameters - }); - } - return arrow.node; - } - - arrowExpression = arrow.node; - } - - if ((_jsx2 = jsx) != null && _jsx2.node) { - this.state = jsx.failState; - return jsx.node; - } - if (arrowExpression) { - this.state = arrow.failState; - return arrowExpression; - } - if ((_jsx3 = jsx) != null && _jsx3.thrown) throw jsx.error; - if (arrow.thrown) throw arrow.error; - - throw this.raise(FlowErrors.UnexpectedTokenAfterTypeParameter, { - at: typeParameters - }); - } - return super.parseMaybeAssign(refExpressionErrors, afterLeftParse); - } - - parseArrow(node) { - if (this.match(14)) { - const result = this.tryParse(() => { - const oldNoAnonFunctionType = this.state.noAnonFunctionType; - this.state.noAnonFunctionType = true; - const typeNode = this.startNode(); - [typeNode.typeAnnotation, - node.predicate] = this.flowParseTypeAndPredicateInitialiser(); - this.state.noAnonFunctionType = oldNoAnonFunctionType; - if (this.canInsertSemicolon()) this.unexpected(); - if (!this.match(19)) this.unexpected(); - return typeNode; - }); - if (result.thrown) return null; - - if (result.error) this.state = result.failState; - - node.returnType = result.node.typeAnnotation ? this.finishNode(result.node, "TypeAnnotation") : null; - } - return super.parseArrow(node); - } - shouldParseArrow(params) { - return this.match(14) || super.shouldParseArrow(params); - } - setArrowFunctionParameters(node, params) { - if (this.state.noArrowParamsConversionAt.indexOf(node.start) !== -1) { - node.params = params; - } else { - super.setArrowFunctionParameters(node, params); - } - } - checkParams(node, allowDuplicates, isArrowFunction, strictModeChanged = true) { - if (isArrowFunction && this.state.noArrowParamsConversionAt.indexOf(node.start) !== -1) { - return; - } - - for (let i = 0; i < node.params.length; i++) { - if (this.isThisParam(node.params[i]) && i > 0) { - this.raise(FlowErrors.ThisParamMustBeFirst, { - at: node.params[i] - }); - } - } - return super.checkParams(node, allowDuplicates, isArrowFunction, strictModeChanged); - } - parseParenAndDistinguishExpression(canBeArrow) { - return super.parseParenAndDistinguishExpression(canBeArrow && this.state.noArrowAt.indexOf(this.state.start) === -1); - } - parseSubscripts(base, startLoc, noCalls) { - if (base.type === "Identifier" && base.name === "async" && this.state.noArrowAt.indexOf(startLoc.index) !== -1) { - this.next(); - const node = this.startNodeAt(startLoc); - node.callee = base; - node.arguments = super.parseCallExpressionArguments(11, false); - base = this.finishNode(node, "CallExpression"); - } else if (base.type === "Identifier" && base.name === "async" && this.match(47)) { - const state = this.state.clone(); - const arrow = this.tryParse(abort => this.parseAsyncArrowWithTypeParameters(startLoc) || abort(), state); - - if (!arrow.error && !arrow.aborted) return arrow.node; - const result = this.tryParse(() => super.parseSubscripts(base, startLoc, noCalls), state); - if (result.node && !result.error) return result.node; - if (arrow.node) { - this.state = arrow.failState; - return arrow.node; - } - if (result.node) { - this.state = result.failState; - return result.node; - } - throw arrow.error || result.error; - } - return super.parseSubscripts(base, startLoc, noCalls); - } - parseSubscript(base, startLoc, noCalls, subscriptState) { - if (this.match(18) && this.isLookaheadToken_lt()) { - subscriptState.optionalChainMember = true; - if (noCalls) { - subscriptState.stop = true; - return base; - } - this.next(); - const node = this.startNodeAt(startLoc); - node.callee = base; - node.typeArguments = this.flowParseTypeParameterInstantiation(); - this.expect(10); - node.arguments = this.parseCallExpressionArguments(11, false); - node.optional = true; - return this.finishCallExpression(node, true); - } else if (!noCalls && this.shouldParseTypes() && this.match(47)) { - const node = this.startNodeAt(startLoc); - node.callee = base; - const result = this.tryParse(() => { - node.typeArguments = this.flowParseTypeParameterInstantiationCallOrNew(); - this.expect(10); - node.arguments = super.parseCallExpressionArguments(11, false); - if (subscriptState.optionalChainMember) { - node.optional = false; - } - return this.finishCallExpression(node, subscriptState.optionalChainMember); - }); - if (result.node) { - if (result.error) this.state = result.failState; - return result.node; - } - } - return super.parseSubscript(base, startLoc, noCalls, subscriptState); - } - parseNewCallee(node) { - super.parseNewCallee(node); - let targs = null; - if (this.shouldParseTypes() && this.match(47)) { - targs = this.tryParse(() => this.flowParseTypeParameterInstantiationCallOrNew()).node; - } - node.typeArguments = targs; - } - parseAsyncArrowWithTypeParameters(startLoc) { - const node = this.startNodeAt(startLoc); - this.parseFunctionParams(node); - if (!this.parseArrow(node)) return; - return super.parseArrowExpression(node, undefined, true); - } - readToken_mult_modulo(code) { - const next = this.input.charCodeAt(this.state.pos + 1); - if (code === 42 && next === 47 && this.state.hasFlowComment) { - this.state.hasFlowComment = false; - this.state.pos += 2; - this.nextToken(); - return; - } - super.readToken_mult_modulo(code); - } - readToken_pipe_amp(code) { - const next = this.input.charCodeAt(this.state.pos + 1); - if (code === 124 && next === 125) { - this.finishOp(9, 2); - return; - } - super.readToken_pipe_amp(code); - } - parseTopLevel(file, program) { - const fileNode = super.parseTopLevel(file, program); - if (this.state.hasFlowComment) { - this.raise(FlowErrors.UnterminatedFlowComment, { - at: this.state.curPosition() - }); - } - return fileNode; - } - skipBlockComment() { - if (this.hasPlugin("flowComments") && this.skipFlowComment()) { - if (this.state.hasFlowComment) { - throw this.raise(FlowErrors.NestedFlowComment, { - at: this.state.startLoc - }); - } - this.hasFlowCommentCompletion(); - const commentSkip = this.skipFlowComment(); - if (commentSkip) { - this.state.pos += commentSkip; - this.state.hasFlowComment = true; - } - return; - } - return super.skipBlockComment(this.state.hasFlowComment ? "*-/" : "*/"); - } - skipFlowComment() { - const { - pos - } = this.state; - let shiftToFirstNonWhiteSpace = 2; - while ([32, 9].includes( - this.input.charCodeAt(pos + shiftToFirstNonWhiteSpace))) { - shiftToFirstNonWhiteSpace++; - } - const ch2 = this.input.charCodeAt(shiftToFirstNonWhiteSpace + pos); - const ch3 = this.input.charCodeAt(shiftToFirstNonWhiteSpace + pos + 1); - if (ch2 === 58 && ch3 === 58) { - return shiftToFirstNonWhiteSpace + 2; - } - - if (this.input.slice(shiftToFirstNonWhiteSpace + pos, shiftToFirstNonWhiteSpace + pos + 12) === "flow-include") { - return shiftToFirstNonWhiteSpace + 12; - } - - if (ch2 === 58 && ch3 !== 58) { - return shiftToFirstNonWhiteSpace; - } - - return false; - } - hasFlowCommentCompletion() { - const end = this.input.indexOf("*/", this.state.pos); - if (end === -1) { - throw this.raise(Errors.UnterminatedComment, { - at: this.state.curPosition() - }); - } - } - - flowEnumErrorBooleanMemberNotInitialized(loc, { - enumName, - memberName - }) { - this.raise(FlowErrors.EnumBooleanMemberNotInitialized, { - at: loc, - memberName, - enumName - }); - } - flowEnumErrorInvalidMemberInitializer(loc, enumContext) { - return this.raise(!enumContext.explicitType ? FlowErrors.EnumInvalidMemberInitializerUnknownType : enumContext.explicitType === "symbol" ? FlowErrors.EnumInvalidMemberInitializerSymbolType : FlowErrors.EnumInvalidMemberInitializerPrimaryType, Object.assign({ - at: loc - }, enumContext)); - } - flowEnumErrorNumberMemberNotInitialized(loc, { - enumName, - memberName - }) { - this.raise(FlowErrors.EnumNumberMemberNotInitialized, { - at: loc, - enumName, - memberName - }); - } - flowEnumErrorStringMemberInconsistentlyInitailized(node, { - enumName - }) { - this.raise(FlowErrors.EnumStringMemberInconsistentlyInitailized, { - at: node, - enumName - }); - } - flowEnumMemberInit() { - const startLoc = this.state.startLoc; - const endOfInit = () => this.match(12) || this.match(8); - switch (this.state.type) { - case 132: - { - const literal = this.parseNumericLiteral(this.state.value); - if (endOfInit()) { - return { - type: "number", - loc: literal.loc.start, - value: literal - }; - } - return { - type: "invalid", - loc: startLoc - }; - } - case 131: - { - const literal = this.parseStringLiteral(this.state.value); - if (endOfInit()) { - return { - type: "string", - loc: literal.loc.start, - value: literal - }; - } - return { - type: "invalid", - loc: startLoc - }; - } - case 85: - case 86: - { - const literal = this.parseBooleanLiteral(this.match(85)); - if (endOfInit()) { - return { - type: "boolean", - loc: literal.loc.start, - value: literal - }; - } - return { - type: "invalid", - loc: startLoc - }; - } - default: - return { - type: "invalid", - loc: startLoc - }; - } - } - flowEnumMemberRaw() { - const loc = this.state.startLoc; - const id = this.parseIdentifier(true); - const init = this.eat(29) ? this.flowEnumMemberInit() : { - type: "none", - loc - }; - return { - id, - init - }; - } - flowEnumCheckExplicitTypeMismatch(loc, context, expectedType) { - const { - explicitType - } = context; - if (explicitType === null) { - return; - } - if (explicitType !== expectedType) { - this.flowEnumErrorInvalidMemberInitializer(loc, context); - } - } - flowEnumMembers({ - enumName, - explicitType - }) { - const seenNames = new Set(); - const members = { - booleanMembers: [], - numberMembers: [], - stringMembers: [], - defaultedMembers: [] - }; - let hasUnknownMembers = false; - while (!this.match(8)) { - if (this.eat(21)) { - hasUnknownMembers = true; - break; - } - const memberNode = this.startNode(); - const { - id, - init - } = this.flowEnumMemberRaw(); - const memberName = id.name; - if (memberName === "") { - continue; - } - if (/^[a-z]/.test(memberName)) { - this.raise(FlowErrors.EnumInvalidMemberName, { - at: id, - memberName, - suggestion: memberName[0].toUpperCase() + memberName.slice(1), - enumName - }); - } - if (seenNames.has(memberName)) { - this.raise(FlowErrors.EnumDuplicateMemberName, { - at: id, - memberName, - enumName - }); - } - seenNames.add(memberName); - const context = { - enumName, - explicitType, - memberName - }; - memberNode.id = id; - switch (init.type) { - case "boolean": - { - this.flowEnumCheckExplicitTypeMismatch(init.loc, context, "boolean"); - memberNode.init = init.value; - members.booleanMembers.push(this.finishNode(memberNode, "EnumBooleanMember")); - break; - } - case "number": - { - this.flowEnumCheckExplicitTypeMismatch(init.loc, context, "number"); - memberNode.init = init.value; - members.numberMembers.push(this.finishNode(memberNode, "EnumNumberMember")); - break; - } - case "string": - { - this.flowEnumCheckExplicitTypeMismatch(init.loc, context, "string"); - memberNode.init = init.value; - members.stringMembers.push(this.finishNode(memberNode, "EnumStringMember")); - break; - } - case "invalid": - { - throw this.flowEnumErrorInvalidMemberInitializer(init.loc, context); - } - case "none": - { - switch (explicitType) { - case "boolean": - this.flowEnumErrorBooleanMemberNotInitialized(init.loc, context); - break; - case "number": - this.flowEnumErrorNumberMemberNotInitialized(init.loc, context); - break; - default: - members.defaultedMembers.push(this.finishNode(memberNode, "EnumDefaultedMember")); - } - } - } - if (!this.match(8)) { - this.expect(12); - } - } - return { - members, - hasUnknownMembers - }; - } - flowEnumStringMembers(initializedMembers, defaultedMembers, { - enumName - }) { - if (initializedMembers.length === 0) { - return defaultedMembers; - } else if (defaultedMembers.length === 0) { - return initializedMembers; - } else if (defaultedMembers.length > initializedMembers.length) { - for (const member of initializedMembers) { - this.flowEnumErrorStringMemberInconsistentlyInitailized(member, { - enumName - }); - } - return defaultedMembers; - } else { - for (const member of defaultedMembers) { - this.flowEnumErrorStringMemberInconsistentlyInitailized(member, { - enumName - }); - } - return initializedMembers; - } - } - flowEnumParseExplicitType({ - enumName - }) { - if (!this.eatContextual(101)) return null; - if (!tokenIsIdentifier(this.state.type)) { - throw this.raise(FlowErrors.EnumInvalidExplicitTypeUnknownSupplied, { - at: this.state.startLoc, - enumName - }); - } - const { - value - } = this.state; - this.next(); - if (value !== "boolean" && value !== "number" && value !== "string" && value !== "symbol") { - this.raise(FlowErrors.EnumInvalidExplicitType, { - at: this.state.startLoc, - enumName, - invalidEnumType: value - }); - } - return value; - } - flowEnumBody(node, id) { - const enumName = id.name; - const nameLoc = id.loc.start; - const explicitType = this.flowEnumParseExplicitType({ - enumName - }); - this.expect(5); - const { - members, - hasUnknownMembers - } = this.flowEnumMembers({ - enumName, - explicitType - }); - node.hasUnknownMembers = hasUnknownMembers; - switch (explicitType) { - case "boolean": - node.explicitType = true; - node.members = members.booleanMembers; - this.expect(8); - return this.finishNode(node, "EnumBooleanBody"); - case "number": - node.explicitType = true; - node.members = members.numberMembers; - this.expect(8); - return this.finishNode(node, "EnumNumberBody"); - case "string": - node.explicitType = true; - node.members = this.flowEnumStringMembers(members.stringMembers, members.defaultedMembers, { - enumName - }); - this.expect(8); - return this.finishNode(node, "EnumStringBody"); - case "symbol": - node.members = members.defaultedMembers; - this.expect(8); - return this.finishNode(node, "EnumSymbolBody"); - default: - { - const empty = () => { - node.members = []; - this.expect(8); - return this.finishNode(node, "EnumStringBody"); - }; - node.explicitType = false; - const boolsLen = members.booleanMembers.length; - const numsLen = members.numberMembers.length; - const strsLen = members.stringMembers.length; - const defaultedLen = members.defaultedMembers.length; - if (!boolsLen && !numsLen && !strsLen && !defaultedLen) { - return empty(); - } else if (!boolsLen && !numsLen) { - node.members = this.flowEnumStringMembers(members.stringMembers, members.defaultedMembers, { - enumName - }); - this.expect(8); - return this.finishNode(node, "EnumStringBody"); - } else if (!numsLen && !strsLen && boolsLen >= defaultedLen) { - for (const member of members.defaultedMembers) { - this.flowEnumErrorBooleanMemberNotInitialized(member.loc.start, { - enumName, - memberName: member.id.name - }); - } - node.members = members.booleanMembers; - this.expect(8); - return this.finishNode(node, "EnumBooleanBody"); - } else if (!boolsLen && !strsLen && numsLen >= defaultedLen) { - for (const member of members.defaultedMembers) { - this.flowEnumErrorNumberMemberNotInitialized(member.loc.start, { - enumName, - memberName: member.id.name - }); - } - node.members = members.numberMembers; - this.expect(8); - return this.finishNode(node, "EnumNumberBody"); - } else { - this.raise(FlowErrors.EnumInconsistentMemberValues, { - at: nameLoc, - enumName - }); - return empty(); - } - } - } - } - flowParseEnumDeclaration(node) { - const id = this.parseIdentifier(); - node.id = id; - node.body = this.flowEnumBody(this.startNode(), id); - return this.finishNode(node, "EnumDeclaration"); - } - - isLookaheadToken_lt() { - const next = this.nextTokenStart(); - if (this.input.charCodeAt(next) === 60) { - const afterNext = this.input.charCodeAt(next + 1); - return afterNext !== 60 && afterNext !== 61; - } - return false; - } - maybeUnwrapTypeCastExpression(node) { - return node.type === "TypeCastExpression" ? node.expression : node; - } -}); - -const entities = { - __proto__: null, - quot: "\u0022", - amp: "&", - apos: "\u0027", - lt: "<", - gt: ">", - nbsp: "\u00A0", - iexcl: "\u00A1", - cent: "\u00A2", - pound: "\u00A3", - curren: "\u00A4", - yen: "\u00A5", - brvbar: "\u00A6", - sect: "\u00A7", - uml: "\u00A8", - copy: "\u00A9", - ordf: "\u00AA", - laquo: "\u00AB", - not: "\u00AC", - shy: "\u00AD", - reg: "\u00AE", - macr: "\u00AF", - deg: "\u00B0", - plusmn: "\u00B1", - sup2: "\u00B2", - sup3: "\u00B3", - acute: "\u00B4", - micro: "\u00B5", - para: "\u00B6", - middot: "\u00B7", - cedil: "\u00B8", - sup1: "\u00B9", - ordm: "\u00BA", - raquo: "\u00BB", - frac14: "\u00BC", - frac12: "\u00BD", - frac34: "\u00BE", - iquest: "\u00BF", - Agrave: "\u00C0", - Aacute: "\u00C1", - Acirc: "\u00C2", - Atilde: "\u00C3", - Auml: "\u00C4", - Aring: "\u00C5", - AElig: "\u00C6", - Ccedil: "\u00C7", - Egrave: "\u00C8", - Eacute: "\u00C9", - Ecirc: "\u00CA", - Euml: "\u00CB", - Igrave: "\u00CC", - Iacute: "\u00CD", - Icirc: "\u00CE", - Iuml: "\u00CF", - ETH: "\u00D0", - Ntilde: "\u00D1", - Ograve: "\u00D2", - Oacute: "\u00D3", - Ocirc: "\u00D4", - Otilde: "\u00D5", - Ouml: "\u00D6", - times: "\u00D7", - Oslash: "\u00D8", - Ugrave: "\u00D9", - Uacute: "\u00DA", - Ucirc: "\u00DB", - Uuml: "\u00DC", - Yacute: "\u00DD", - THORN: "\u00DE", - szlig: "\u00DF", - agrave: "\u00E0", - aacute: "\u00E1", - acirc: "\u00E2", - atilde: "\u00E3", - auml: "\u00E4", - aring: "\u00E5", - aelig: "\u00E6", - ccedil: "\u00E7", - egrave: "\u00E8", - eacute: "\u00E9", - ecirc: "\u00EA", - euml: "\u00EB", - igrave: "\u00EC", - iacute: "\u00ED", - icirc: "\u00EE", - iuml: "\u00EF", - eth: "\u00F0", - ntilde: "\u00F1", - ograve: "\u00F2", - oacute: "\u00F3", - ocirc: "\u00F4", - otilde: "\u00F5", - ouml: "\u00F6", - divide: "\u00F7", - oslash: "\u00F8", - ugrave: "\u00F9", - uacute: "\u00FA", - ucirc: "\u00FB", - uuml: "\u00FC", - yacute: "\u00FD", - thorn: "\u00FE", - yuml: "\u00FF", - OElig: "\u0152", - oelig: "\u0153", - Scaron: "\u0160", - scaron: "\u0161", - Yuml: "\u0178", - fnof: "\u0192", - circ: "\u02C6", - tilde: "\u02DC", - Alpha: "\u0391", - Beta: "\u0392", - Gamma: "\u0393", - Delta: "\u0394", - Epsilon: "\u0395", - Zeta: "\u0396", - Eta: "\u0397", - Theta: "\u0398", - Iota: "\u0399", - Kappa: "\u039A", - Lambda: "\u039B", - Mu: "\u039C", - Nu: "\u039D", - Xi: "\u039E", - Omicron: "\u039F", - Pi: "\u03A0", - Rho: "\u03A1", - Sigma: "\u03A3", - Tau: "\u03A4", - Upsilon: "\u03A5", - Phi: "\u03A6", - Chi: "\u03A7", - Psi: "\u03A8", - Omega: "\u03A9", - alpha: "\u03B1", - beta: "\u03B2", - gamma: "\u03B3", - delta: "\u03B4", - epsilon: "\u03B5", - zeta: "\u03B6", - eta: "\u03B7", - theta: "\u03B8", - iota: "\u03B9", - kappa: "\u03BA", - lambda: "\u03BB", - mu: "\u03BC", - nu: "\u03BD", - xi: "\u03BE", - omicron: "\u03BF", - pi: "\u03C0", - rho: "\u03C1", - sigmaf: "\u03C2", - sigma: "\u03C3", - tau: "\u03C4", - upsilon: "\u03C5", - phi: "\u03C6", - chi: "\u03C7", - psi: "\u03C8", - omega: "\u03C9", - thetasym: "\u03D1", - upsih: "\u03D2", - piv: "\u03D6", - ensp: "\u2002", - emsp: "\u2003", - thinsp: "\u2009", - zwnj: "\u200C", - zwj: "\u200D", - lrm: "\u200E", - rlm: "\u200F", - ndash: "\u2013", - mdash: "\u2014", - lsquo: "\u2018", - rsquo: "\u2019", - sbquo: "\u201A", - ldquo: "\u201C", - rdquo: "\u201D", - bdquo: "\u201E", - dagger: "\u2020", - Dagger: "\u2021", - bull: "\u2022", - hellip: "\u2026", - permil: "\u2030", - prime: "\u2032", - Prime: "\u2033", - lsaquo: "\u2039", - rsaquo: "\u203A", - oline: "\u203E", - frasl: "\u2044", - euro: "\u20AC", - image: "\u2111", - weierp: "\u2118", - real: "\u211C", - trade: "\u2122", - alefsym: "\u2135", - larr: "\u2190", - uarr: "\u2191", - rarr: "\u2192", - darr: "\u2193", - harr: "\u2194", - crarr: "\u21B5", - lArr: "\u21D0", - uArr: "\u21D1", - rArr: "\u21D2", - dArr: "\u21D3", - hArr: "\u21D4", - forall: "\u2200", - part: "\u2202", - exist: "\u2203", - empty: "\u2205", - nabla: "\u2207", - isin: "\u2208", - notin: "\u2209", - ni: "\u220B", - prod: "\u220F", - sum: "\u2211", - minus: "\u2212", - lowast: "\u2217", - radic: "\u221A", - prop: "\u221D", - infin: "\u221E", - ang: "\u2220", - and: "\u2227", - or: "\u2228", - cap: "\u2229", - cup: "\u222A", - int: "\u222B", - there4: "\u2234", - sim: "\u223C", - cong: "\u2245", - asymp: "\u2248", - ne: "\u2260", - equiv: "\u2261", - le: "\u2264", - ge: "\u2265", - sub: "\u2282", - sup: "\u2283", - nsub: "\u2284", - sube: "\u2286", - supe: "\u2287", - oplus: "\u2295", - otimes: "\u2297", - perp: "\u22A5", - sdot: "\u22C5", - lceil: "\u2308", - rceil: "\u2309", - lfloor: "\u230A", - rfloor: "\u230B", - lang: "\u2329", - rang: "\u232A", - loz: "\u25CA", - spades: "\u2660", - clubs: "\u2663", - hearts: "\u2665", - diams: "\u2666" -}; - -const JsxErrors = ParseErrorEnum`jsx`({ - AttributeIsEmpty: "JSX attributes must only be assigned a non-empty expression.", - MissingClosingTagElement: ({ - openingTagName - }) => `Expected corresponding JSX closing tag for <${openingTagName}>.`, - MissingClosingTagFragment: "Expected corresponding JSX closing tag for <>.", - UnexpectedSequenceExpression: "Sequence expressions cannot be directly nested inside JSX. Did you mean to wrap it in parentheses (...)?", - UnexpectedToken: ({ - unexpected, - HTMLEntity - }) => `Unexpected token \`${unexpected}\`. Did you mean \`${HTMLEntity}\` or \`{'${unexpected}'}\`?`, - UnsupportedJsxValue: "JSX value should be either an expression or a quoted JSX text.", - UnterminatedJsxContent: "Unterminated JSX contents.", - UnwrappedAdjacentJSXElements: "Adjacent JSX elements must be wrapped in an enclosing tag. Did you want a JSX fragment <>...?" -}); - -function isFragment(object) { - return object ? object.type === "JSXOpeningFragment" || object.type === "JSXClosingFragment" : false; -} - -function getQualifiedJSXName(object) { - if (object.type === "JSXIdentifier") { - return object.name; - } - if (object.type === "JSXNamespacedName") { - return object.namespace.name + ":" + object.name.name; - } - if (object.type === "JSXMemberExpression") { - return getQualifiedJSXName(object.object) + "." + getQualifiedJSXName(object.property); - } - - throw new Error("Node had unexpected type: " + object.type); -} -var jsx = (superClass => class JSXParserMixin extends superClass { - - jsxReadToken() { - let out = ""; - let chunkStart = this.state.pos; - for (;;) { - if (this.state.pos >= this.length) { - throw this.raise(JsxErrors.UnterminatedJsxContent, { - at: this.state.startLoc - }); - } - const ch = this.input.charCodeAt(this.state.pos); - switch (ch) { - case 60: - case 123: - if (this.state.pos === this.state.start) { - if (ch === 60 && this.state.canStartJSXElement) { - ++this.state.pos; - return this.finishToken(140); - } - return super.getTokenFromCode(ch); - } - out += this.input.slice(chunkStart, this.state.pos); - return this.finishToken(139, out); - case 38: - out += this.input.slice(chunkStart, this.state.pos); - out += this.jsxReadEntity(); - chunkStart = this.state.pos; - break; - case 62: - case 125: - - default: - if (isNewLine(ch)) { - out += this.input.slice(chunkStart, this.state.pos); - out += this.jsxReadNewLine(true); - chunkStart = this.state.pos; - } else { - ++this.state.pos; - } - } - } - } - jsxReadNewLine(normalizeCRLF) { - const ch = this.input.charCodeAt(this.state.pos); - let out; - ++this.state.pos; - if (ch === 13 && this.input.charCodeAt(this.state.pos) === 10) { - ++this.state.pos; - out = normalizeCRLF ? "\n" : "\r\n"; - } else { - out = String.fromCharCode(ch); - } - ++this.state.curLine; - this.state.lineStart = this.state.pos; - return out; - } - jsxReadString(quote) { - let out = ""; - let chunkStart = ++this.state.pos; - for (;;) { - if (this.state.pos >= this.length) { - throw this.raise(Errors.UnterminatedString, { - at: this.state.startLoc - }); - } - const ch = this.input.charCodeAt(this.state.pos); - if (ch === quote) break; - if (ch === 38) { - out += this.input.slice(chunkStart, this.state.pos); - out += this.jsxReadEntity(); - chunkStart = this.state.pos; - } else if (isNewLine(ch)) { - out += this.input.slice(chunkStart, this.state.pos); - out += this.jsxReadNewLine(false); - chunkStart = this.state.pos; - } else { - ++this.state.pos; - } - } - out += this.input.slice(chunkStart, this.state.pos++); - return this.finishToken(131, out); - } - jsxReadEntity() { - const startPos = ++this.state.pos; - if (this.codePointAtPos(this.state.pos) === 35) { - ++this.state.pos; - let radix = 10; - if (this.codePointAtPos(this.state.pos) === 120) { - radix = 16; - ++this.state.pos; - } - const codePoint = this.readInt(radix, undefined, false, "bail"); - if (codePoint !== null && this.codePointAtPos(this.state.pos) === 59) { - ++this.state.pos; - return String.fromCodePoint(codePoint); - } - } else { - let count = 0; - let semi = false; - while (count++ < 10 && this.state.pos < this.length && !(semi = this.codePointAtPos(this.state.pos) == 59)) { - ++this.state.pos; - } - if (semi) { - const desc = this.input.slice(startPos, this.state.pos); - const entity = entities[desc]; - ++this.state.pos; - if (entity) { - return entity; - } - } - } - - this.state.pos = startPos; - return "&"; - } - - jsxReadWord() { - let ch; - const start = this.state.pos; - do { - ch = this.input.charCodeAt(++this.state.pos); - } while (isIdentifierChar(ch) || ch === 45); - return this.finishToken(138, this.input.slice(start, this.state.pos)); - } - - jsxParseIdentifier() { - const node = this.startNode(); - if (this.match(138)) { - node.name = this.state.value; - } else if (tokenIsKeyword(this.state.type)) { - node.name = tokenLabelName(this.state.type); - } else { - this.unexpected(); - } - this.next(); - return this.finishNode(node, "JSXIdentifier"); - } - - jsxParseNamespacedName() { - const startLoc = this.state.startLoc; - const name = this.jsxParseIdentifier(); - if (!this.eat(14)) return name; - const node = this.startNodeAt(startLoc); - node.namespace = name; - node.name = this.jsxParseIdentifier(); - return this.finishNode(node, "JSXNamespacedName"); - } - - jsxParseElementName() { - const startLoc = this.state.startLoc; - let node = this.jsxParseNamespacedName(); - if (node.type === "JSXNamespacedName") { - return node; - } - while (this.eat(16)) { - const newNode = this.startNodeAt(startLoc); - newNode.object = node; - newNode.property = this.jsxParseIdentifier(); - node = this.finishNode(newNode, "JSXMemberExpression"); - } - return node; - } - - jsxParseAttributeValue() { - let node; - switch (this.state.type) { - case 5: - node = this.startNode(); - this.setContext(types.brace); - this.next(); - node = this.jsxParseExpressionContainer(node, types.j_oTag); - if (node.expression.type === "JSXEmptyExpression") { - this.raise(JsxErrors.AttributeIsEmpty, { - at: node - }); - } - return node; - case 140: - case 131: - return this.parseExprAtom(); - default: - throw this.raise(JsxErrors.UnsupportedJsxValue, { - at: this.state.startLoc - }); - } - } - - jsxParseEmptyExpression() { - const node = this.startNodeAt(this.state.lastTokEndLoc); - return this.finishNodeAt(node, "JSXEmptyExpression", this.state.startLoc); - } - - jsxParseSpreadChild(node) { - this.next(); - node.expression = this.parseExpression(); - this.setContext(types.j_expr); - this.state.canStartJSXElement = true; - this.expect(8); - return this.finishNode(node, "JSXSpreadChild"); - } - - jsxParseExpressionContainer(node, previousContext) { - if (this.match(8)) { - node.expression = this.jsxParseEmptyExpression(); - } else { - const expression = this.parseExpression(); - node.expression = expression; - } - this.setContext(previousContext); - this.state.canStartJSXElement = true; - this.expect(8); - return this.finishNode(node, "JSXExpressionContainer"); - } - - jsxParseAttribute() { - const node = this.startNode(); - if (this.match(5)) { - this.setContext(types.brace); - this.next(); - this.expect(21); - node.argument = this.parseMaybeAssignAllowIn(); - this.setContext(types.j_oTag); - this.state.canStartJSXElement = true; - this.expect(8); - return this.finishNode(node, "JSXSpreadAttribute"); - } - node.name = this.jsxParseNamespacedName(); - node.value = this.eat(29) ? this.jsxParseAttributeValue() : null; - return this.finishNode(node, "JSXAttribute"); - } - - jsxParseOpeningElementAt(startLoc) { - const node = this.startNodeAt(startLoc); - if (this.eat(141)) { - return this.finishNode(node, "JSXOpeningFragment"); - } - node.name = this.jsxParseElementName(); - return this.jsxParseOpeningElementAfterName(node); - } - jsxParseOpeningElementAfterName(node) { - const attributes = []; - while (!this.match(56) && !this.match(141)) { - attributes.push(this.jsxParseAttribute()); - } - node.attributes = attributes; - node.selfClosing = this.eat(56); - this.expect(141); - return this.finishNode(node, "JSXOpeningElement"); - } - - jsxParseClosingElementAt(startLoc) { - const node = this.startNodeAt(startLoc); - if (this.eat(141)) { - return this.finishNode(node, "JSXClosingFragment"); - } - node.name = this.jsxParseElementName(); - this.expect(141); - return this.finishNode(node, "JSXClosingElement"); - } - - jsxParseElementAt(startLoc) { - const node = this.startNodeAt(startLoc); - const children = []; - const openingElement = this.jsxParseOpeningElementAt(startLoc); - let closingElement = null; - if (!openingElement.selfClosing) { - contents: for (;;) { - switch (this.state.type) { - case 140: - startLoc = this.state.startLoc; - this.next(); - if (this.eat(56)) { - closingElement = this.jsxParseClosingElementAt(startLoc); - break contents; - } - children.push(this.jsxParseElementAt(startLoc)); - break; - case 139: - children.push(this.parseExprAtom()); - break; - case 5: - { - const node = this.startNode(); - this.setContext(types.brace); - this.next(); - if (this.match(21)) { - children.push(this.jsxParseSpreadChild(node)); - } else { - children.push(this.jsxParseExpressionContainer(node, types.j_expr)); - } - break; - } - default: - throw this.unexpected(); - } - } - if (isFragment(openingElement) && !isFragment(closingElement) && closingElement !== null) { - this.raise(JsxErrors.MissingClosingTagFragment, { - at: closingElement - }); - } else if (!isFragment(openingElement) && isFragment(closingElement)) { - this.raise(JsxErrors.MissingClosingTagElement, { - at: closingElement, - openingTagName: getQualifiedJSXName(openingElement.name) - }); - } else if (!isFragment(openingElement) && !isFragment(closingElement)) { - if (getQualifiedJSXName(closingElement.name) !== getQualifiedJSXName(openingElement.name)) { - this.raise(JsxErrors.MissingClosingTagElement, { - at: closingElement, - openingTagName: getQualifiedJSXName(openingElement.name) - }); - } - } - } - if (isFragment(openingElement)) { - node.openingFragment = openingElement; - node.closingFragment = closingElement; - } else { - node.openingElement = openingElement; - node.closingElement = closingElement; - } - node.children = children; - if (this.match(47)) { - throw this.raise(JsxErrors.UnwrappedAdjacentJSXElements, { - at: this.state.startLoc - }); - } - return isFragment(openingElement) ? this.finishNode(node, "JSXFragment") : this.finishNode(node, "JSXElement"); - } - - jsxParseElement() { - const startLoc = this.state.startLoc; - this.next(); - return this.jsxParseElementAt(startLoc); - } - setContext(newContext) { - const { - context - } = this.state; - context[context.length - 1] = newContext; - } - - parseExprAtom(refExpressionErrors) { - if (this.match(139)) { - return this.parseLiteral(this.state.value, "JSXText"); - } else if (this.match(140)) { - return this.jsxParseElement(); - } else if (this.match(47) && this.input.charCodeAt(this.state.pos) !== 33) { - this.replaceToken(140); - return this.jsxParseElement(); - } else { - return super.parseExprAtom(refExpressionErrors); - } - } - skipSpace() { - const curContext = this.curContext(); - if (!curContext.preserveSpace) super.skipSpace(); - } - getTokenFromCode(code) { - const context = this.curContext(); - if (context === types.j_expr) { - return this.jsxReadToken(); - } - if (context === types.j_oTag || context === types.j_cTag) { - if (isIdentifierStart(code)) { - return this.jsxReadWord(); - } - if (code === 62) { - ++this.state.pos; - return this.finishToken(141); - } - if ((code === 34 || code === 39) && context === types.j_oTag) { - return this.jsxReadString(code); - } - } - if (code === 60 && this.state.canStartJSXElement && this.input.charCodeAt(this.state.pos + 1) !== 33) { - ++this.state.pos; - return this.finishToken(140); - } - return super.getTokenFromCode(code); - } - updateContext(prevType) { - const { - context, - type - } = this.state; - if (type === 56 && prevType === 140) { - context.splice(-2, 2, types.j_cTag); - this.state.canStartJSXElement = false; - } else if (type === 140) { - context.push(types.j_oTag); - } else if (type === 141) { - const out = context[context.length - 1]; - if (out === types.j_oTag && prevType === 56 || out === types.j_cTag) { - context.pop(); - this.state.canStartJSXElement = context[context.length - 1] === types.j_expr; - } else { - this.setContext(types.j_expr); - this.state.canStartJSXElement = true; - } - } else { - this.state.canStartJSXElement = tokenComesBeforeExpression(type); - } - } -}); - -class TypeScriptScope extends Scope { - constructor(...args) { - super(...args); - this.types = new Set(); - this.enums = new Set(); - this.constEnums = new Set(); - this.classes = new Set(); - this.exportOnlyBindings = new Set(); - } -} - -class TypeScriptScopeHandler extends ScopeHandler { - constructor(...args) { - super(...args); - this.importsStack = []; - } - createScope(flags) { - this.importsStack.push(new Set()); - - return new TypeScriptScope(flags); - } - enter(flags) { - if (flags == SCOPE_TS_MODULE) { - this.importsStack.push(new Set()); - } - super.enter(flags); - } - exit() { - const flags = super.exit(); - if (flags == SCOPE_TS_MODULE) { - this.importsStack.pop(); - } - return flags; - } - hasImport(name, allowShadow) { - const len = this.importsStack.length; - if (this.importsStack[len - 1].has(name)) { - return true; - } - if (!allowShadow && len > 1) { - for (let i = 0; i < len - 1; i++) { - if (this.importsStack[i].has(name)) return true; - } - } - return false; - } - declareName(name, bindingType, loc) { - if (bindingType & BIND_FLAGS_TS_IMPORT) { - if (this.hasImport(name, true)) { - this.parser.raise(Errors.VarRedeclaration, { - at: loc, - identifierName: name - }); - } - this.importsStack[this.importsStack.length - 1].add(name); - return; - } - const scope = this.currentScope(); - if (bindingType & BIND_FLAGS_TS_EXPORT_ONLY) { - this.maybeExportDefined(scope, name); - scope.exportOnlyBindings.add(name); - return; - } - super.declareName(name, bindingType, loc); - if (bindingType & BIND_KIND_TYPE) { - if (!(bindingType & BIND_KIND_VALUE)) { - this.checkRedeclarationInScope(scope, name, bindingType, loc); - this.maybeExportDefined(scope, name); - } - scope.types.add(name); - } - if (bindingType & BIND_FLAGS_TS_ENUM) scope.enums.add(name); - if (bindingType & BIND_FLAGS_TS_CONST_ENUM) scope.constEnums.add(name); - if (bindingType & BIND_FLAGS_CLASS) scope.classes.add(name); - } - isRedeclaredInScope(scope, name, bindingType) { - if (scope.enums.has(name)) { - if (bindingType & BIND_FLAGS_TS_ENUM) { - const isConst = !!(bindingType & BIND_FLAGS_TS_CONST_ENUM); - const wasConst = scope.constEnums.has(name); - return isConst !== wasConst; - } - return true; - } - if (bindingType & BIND_FLAGS_CLASS && scope.classes.has(name)) { - if (scope.lexical.has(name)) { - return !!(bindingType & BIND_KIND_VALUE); - } else { - return false; - } - } - if (bindingType & BIND_KIND_TYPE && scope.types.has(name)) { - return true; - } - return super.isRedeclaredInScope(scope, name, bindingType); - } - checkLocalExport(id) { - const { - name - } = id; - if (this.hasImport(name)) return; - const len = this.scopeStack.length; - for (let i = len - 1; i >= 0; i--) { - const scope = this.scopeStack[i]; - if (scope.types.has(name) || scope.exportOnlyBindings.has(name)) return; - } - super.checkLocalExport(id); - } -} - -const getOwn$1 = (object, key) => Object.hasOwnProperty.call(object, key) && object[key]; -function nonNull(x) { - if (x == null) { - throw new Error(`Unexpected ${x} value.`); - } - return x; -} -function assert(x) { - if (!x) { - throw new Error("Assert fail"); - } -} -const TSErrors = ParseErrorEnum`typescript`({ - AbstractMethodHasImplementation: ({ - methodName - }) => `Method '${methodName}' cannot have an implementation because it is marked abstract.`, - AbstractPropertyHasInitializer: ({ - propertyName - }) => `Property '${propertyName}' cannot have an initializer because it is marked abstract.`, - AccesorCannotDeclareThisParameter: "'get' and 'set' accessors cannot declare 'this' parameters.", - AccesorCannotHaveTypeParameters: "An accessor cannot have type parameters.", - ClassMethodHasDeclare: "Class methods cannot have the 'declare' modifier.", - ClassMethodHasReadonly: "Class methods cannot have the 'readonly' modifier.", - ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference: "A 'const' initializer in an ambient context must be a string or numeric literal or literal enum reference.", - ConstructorHasTypeParameters: "Type parameters cannot appear on a constructor declaration.", - DeclareAccessor: ({ - kind - }) => `'declare' is not allowed in ${kind}ters.`, - DeclareClassFieldHasInitializer: "Initializers are not allowed in ambient contexts.", - DeclareFunctionHasImplementation: "An implementation cannot be declared in ambient contexts.", - DuplicateAccessibilityModifier: - ({ - modifier - }) => `Accessibility modifier already seen.`, - DuplicateModifier: ({ - modifier - }) => `Duplicate modifier: '${modifier}'.`, - EmptyHeritageClauseType: ({ - token - }) => `'${token}' list cannot be empty.`, - EmptyTypeArguments: "Type argument list cannot be empty.", - EmptyTypeParameters: "Type parameter list cannot be empty.", - ExpectedAmbientAfterExportDeclare: "'export declare' must be followed by an ambient declaration.", - ImportAliasHasImportType: "An import alias can not use 'import type'.", - ImportReflectionHasImportType: "An `import module` declaration can not use `type` modifier", - IncompatibleModifiers: ({ - modifiers - }) => `'${modifiers[0]}' modifier cannot be used with '${modifiers[1]}' modifier.`, - IndexSignatureHasAbstract: "Index signatures cannot have the 'abstract' modifier.", - IndexSignatureHasAccessibility: ({ - modifier - }) => `Index signatures cannot have an accessibility modifier ('${modifier}').`, - IndexSignatureHasDeclare: "Index signatures cannot have the 'declare' modifier.", - IndexSignatureHasOverride: "'override' modifier cannot appear on an index signature.", - IndexSignatureHasStatic: "Index signatures cannot have the 'static' modifier.", - InitializerNotAllowedInAmbientContext: "Initializers are not allowed in ambient contexts.", - InvalidModifierOnTypeMember: ({ - modifier - }) => `'${modifier}' modifier cannot appear on a type member.`, - InvalidModifierOnTypeParameter: ({ - modifier - }) => `'${modifier}' modifier cannot appear on a type parameter.`, - InvalidModifierOnTypeParameterPositions: ({ - modifier - }) => `'${modifier}' modifier can only appear on a type parameter of a class, interface or type alias.`, - InvalidModifiersOrder: ({ - orderedModifiers - }) => `'${orderedModifiers[0]}' modifier must precede '${orderedModifiers[1]}' modifier.`, - InvalidPropertyAccessAfterInstantiationExpression: "Invalid property access after an instantiation expression. " + "You can either wrap the instantiation expression in parentheses, or delete the type arguments.", - InvalidTupleMemberLabel: "Tuple members must be labeled with a simple identifier.", - MissingInterfaceName: "'interface' declarations must be followed by an identifier.", - MixedLabeledAndUnlabeledElements: "Tuple members must all have names or all not have names.", - NonAbstractClassHasAbstractMethod: "Abstract methods can only appear within an abstract class.", - NonClassMethodPropertyHasAbstractModifer: "'abstract' modifier can only appear on a class, method, or property declaration.", - OptionalTypeBeforeRequired: "A required element cannot follow an optional element.", - OverrideNotInSubClass: "This member cannot have an 'override' modifier because its containing class does not extend another class.", - PatternIsOptional: "A binding pattern parameter cannot be optional in an implementation signature.", - PrivateElementHasAbstract: "Private elements cannot have the 'abstract' modifier.", - PrivateElementHasAccessibility: ({ - modifier - }) => `Private elements cannot have an accessibility modifier ('${modifier}').`, - ReadonlyForMethodSignature: "'readonly' modifier can only appear on a property declaration or index signature.", - ReservedArrowTypeParam: "This syntax is reserved in files with the .mts or .cts extension. Add a trailing comma, as in `() => ...`.", - ReservedTypeAssertion: "This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead.", - SetAccesorCannotHaveOptionalParameter: "A 'set' accessor cannot have an optional parameter.", - SetAccesorCannotHaveRestParameter: "A 'set' accessor cannot have rest parameter.", - SetAccesorCannotHaveReturnType: "A 'set' accessor cannot have a return type annotation.", - SingleTypeParameterWithoutTrailingComma: ({ - typeParameterName - }) => `Single type parameter ${typeParameterName} should have a trailing comma. Example usage: <${typeParameterName},>.`, - StaticBlockCannotHaveModifier: "Static class blocks cannot have any modifier.", - TypeAnnotationAfterAssign: "Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`.", - TypeImportCannotSpecifyDefaultAndNamed: "A type-only import can specify a default import or named bindings, but not both.", - TypeModifierIsUsedInTypeExports: "The 'type' modifier cannot be used on a named export when 'export type' is used on its export statement.", - TypeModifierIsUsedInTypeImports: "The 'type' modifier cannot be used on a named import when 'import type' is used on its import statement.", - UnexpectedParameterModifier: "A parameter property is only allowed in a constructor implementation.", - UnexpectedReadonly: "'readonly' type modifier is only permitted on array and tuple literal types.", - UnexpectedTypeAnnotation: "Did not expect a type annotation here.", - UnexpectedTypeCastInParameter: "Unexpected type cast in parameter position.", - UnsupportedImportTypeArgument: "Argument in a type import must be a string literal.", - UnsupportedParameterPropertyKind: "A parameter property may not be declared using a binding pattern.", - UnsupportedSignatureParameterKind: ({ - type - }) => `Name in a signature must be an Identifier, ObjectPattern or ArrayPattern, instead got ${type}.` -}); - -function keywordTypeFromName(value) { - switch (value) { - case "any": - return "TSAnyKeyword"; - case "boolean": - return "TSBooleanKeyword"; - case "bigint": - return "TSBigIntKeyword"; - case "never": - return "TSNeverKeyword"; - case "number": - return "TSNumberKeyword"; - case "object": - return "TSObjectKeyword"; - case "string": - return "TSStringKeyword"; - case "symbol": - return "TSSymbolKeyword"; - case "undefined": - return "TSUndefinedKeyword"; - case "unknown": - return "TSUnknownKeyword"; - default: - return undefined; - } -} -function tsIsAccessModifier(modifier) { - return modifier === "private" || modifier === "public" || modifier === "protected"; -} -function tsIsVarianceAnnotations(modifier) { - return modifier === "in" || modifier === "out"; -} -var typescript = (superClass => class TypeScriptParserMixin extends superClass { - getScopeHandler() { - return TypeScriptScopeHandler; - } - tsIsIdentifier() { - return tokenIsIdentifier(this.state.type); - } - tsTokenCanFollowModifier() { - return (this.match(0) || this.match(5) || this.match(55) || this.match(21) || this.match(136) || this.isLiteralPropertyName()) && !this.hasPrecedingLineBreak(); - } - tsNextTokenCanFollowModifier() { - this.next(); - return this.tsTokenCanFollowModifier(); - } - - tsParseModifier(allowedModifiers, stopOnStartOfClassStaticBlock) { - if (!tokenIsIdentifier(this.state.type) && this.state.type !== 58) { - return undefined; - } - const modifier = this.state.value; - if (allowedModifiers.indexOf(modifier) !== -1) { - if (stopOnStartOfClassStaticBlock && this.tsIsStartOfStaticBlocks()) { - return undefined; - } - if (this.tsTryParse(this.tsNextTokenCanFollowModifier.bind(this))) { - return modifier; - } - } - return undefined; - } - - tsParseModifiers({ - modified, - allowedModifiers, - disallowedModifiers, - stopOnStartOfClassStaticBlock, - errorTemplate = TSErrors.InvalidModifierOnTypeMember - }) { - const enforceOrder = (loc, modifier, before, after) => { - if (modifier === before && modified[after]) { - this.raise(TSErrors.InvalidModifiersOrder, { - at: loc, - orderedModifiers: [before, after] - }); - } - }; - const incompatible = (loc, modifier, mod1, mod2) => { - if (modified[mod1] && modifier === mod2 || modified[mod2] && modifier === mod1) { - this.raise(TSErrors.IncompatibleModifiers, { - at: loc, - modifiers: [mod1, mod2] - }); - } - }; - for (;;) { - const { - startLoc - } = this.state; - const modifier = this.tsParseModifier(allowedModifiers.concat(disallowedModifiers != null ? disallowedModifiers : []), stopOnStartOfClassStaticBlock); - if (!modifier) break; - if (tsIsAccessModifier(modifier)) { - if (modified.accessibility) { - this.raise(TSErrors.DuplicateAccessibilityModifier, { - at: startLoc, - modifier - }); - } else { - enforceOrder(startLoc, modifier, modifier, "override"); - enforceOrder(startLoc, modifier, modifier, "static"); - enforceOrder(startLoc, modifier, modifier, "readonly"); - modified.accessibility = modifier; - } - } else if (tsIsVarianceAnnotations(modifier)) { - if (modified[modifier]) { - this.raise(TSErrors.DuplicateModifier, { - at: startLoc, - modifier - }); - } - modified[modifier] = true; - enforceOrder(startLoc, modifier, "in", "out"); - } else { - if (Object.hasOwnProperty.call(modified, modifier)) { - this.raise(TSErrors.DuplicateModifier, { - at: startLoc, - modifier - }); - } else { - enforceOrder(startLoc, modifier, "static", "readonly"); - enforceOrder(startLoc, modifier, "static", "override"); - enforceOrder(startLoc, modifier, "override", "readonly"); - enforceOrder(startLoc, modifier, "abstract", "override"); - incompatible(startLoc, modifier, "declare", "override"); - incompatible(startLoc, modifier, "static", "abstract"); - } - modified[modifier] = true; - } - if (disallowedModifiers != null && disallowedModifiers.includes(modifier)) { - this.raise(errorTemplate, { - at: startLoc, - modifier - }); - } - } - } - tsIsListTerminator(kind) { - switch (kind) { - case "EnumMembers": - case "TypeMembers": - return this.match(8); - case "HeritageClauseElement": - return this.match(5); - case "TupleElementTypes": - return this.match(3); - case "TypeParametersOrArguments": - return this.match(48); - } - throw new Error("Unreachable"); - } - tsParseList(kind, parseElement) { - const result = []; - while (!this.tsIsListTerminator(kind)) { - result.push(parseElement()); - } - return result; - } - tsParseDelimitedList(kind, parseElement, refTrailingCommaPos) { - return nonNull(this.tsParseDelimitedListWorker(kind, parseElement, true, refTrailingCommaPos)); - } - - tsParseDelimitedListWorker(kind, parseElement, expectSuccess, refTrailingCommaPos) { - const result = []; - let trailingCommaPos = -1; - for (;;) { - if (this.tsIsListTerminator(kind)) { - break; - } - trailingCommaPos = -1; - const element = parseElement(); - if (element == null) { - return undefined; - } - result.push(element); - if (this.eat(12)) { - trailingCommaPos = this.state.lastTokStart; - continue; - } - if (this.tsIsListTerminator(kind)) { - break; - } - if (expectSuccess) { - this.expect(12); - } - return undefined; - } - if (refTrailingCommaPos) { - refTrailingCommaPos.value = trailingCommaPos; - } - return result; - } - tsParseBracketedList(kind, parseElement, bracket, skipFirstToken, refTrailingCommaPos) { - if (!skipFirstToken) { - if (bracket) { - this.expect(0); - } else { - this.expect(47); - } - } - const result = this.tsParseDelimitedList(kind, parseElement, refTrailingCommaPos); - if (bracket) { - this.expect(3); - } else { - this.expect(48); - } - return result; - } - tsParseImportType() { - const node = this.startNode(); - this.expect(83); - this.expect(10); - if (!this.match(131)) { - this.raise(TSErrors.UnsupportedImportTypeArgument, { - at: this.state.startLoc - }); - } - - node.argument = super.parseExprAtom(); - this.expect(11); - if (this.eat(16)) { - node.qualifier = this.tsParseEntityName(); - } - if (this.match(47)) { - node.typeParameters = this.tsParseTypeArguments(); - } - return this.finishNode(node, "TSImportType"); - } - tsParseEntityName(allowReservedWords = true) { - let entity = this.parseIdentifier(allowReservedWords); - while (this.eat(16)) { - const node = this.startNodeAtNode(entity); - node.left = entity; - node.right = this.parseIdentifier(allowReservedWords); - entity = this.finishNode(node, "TSQualifiedName"); - } - return entity; - } - tsParseTypeReference() { - const node = this.startNode(); - node.typeName = this.tsParseEntityName(); - if (!this.hasPrecedingLineBreak() && this.match(47)) { - node.typeParameters = this.tsParseTypeArguments(); - } - return this.finishNode(node, "TSTypeReference"); - } - tsParseThisTypePredicate(lhs) { - this.next(); - const node = this.startNodeAtNode(lhs); - node.parameterName = lhs; - node.typeAnnotation = this.tsParseTypeAnnotation(false); - node.asserts = false; - return this.finishNode(node, "TSTypePredicate"); - } - tsParseThisTypeNode() { - const node = this.startNode(); - this.next(); - return this.finishNode(node, "TSThisType"); - } - tsParseTypeQuery() { - const node = this.startNode(); - this.expect(87); - if (this.match(83)) { - node.exprName = this.tsParseImportType(); - } else { - node.exprName = this.tsParseEntityName(); - } - if (!this.hasPrecedingLineBreak() && this.match(47)) { - node.typeParameters = this.tsParseTypeArguments(); - } - return this.finishNode(node, "TSTypeQuery"); - } - tsParseInOutModifiers(node) { - this.tsParseModifiers({ - modified: node, - allowedModifiers: ["in", "out"], - disallowedModifiers: ["public", "private", "protected", "readonly", "declare", "abstract", "override"], - errorTemplate: TSErrors.InvalidModifierOnTypeParameter - }); - } - - tsParseNoneModifiers(node) { - this.tsParseModifiers({ - modified: node, - allowedModifiers: [], - disallowedModifiers: ["in", "out"], - errorTemplate: TSErrors.InvalidModifierOnTypeParameterPositions - }); - } - tsParseTypeParameter(parseModifiers = this.tsParseNoneModifiers.bind(this)) { - const node = this.startNode(); - parseModifiers(node); - node.name = this.tsParseTypeParameterName(); - node.constraint = this.tsEatThenParseType(81); - node.default = this.tsEatThenParseType(29); - return this.finishNode(node, "TSTypeParameter"); - } - tsTryParseTypeParameters(parseModifiers) { - if (this.match(47)) { - return this.tsParseTypeParameters(parseModifiers); - } - } - tsParseTypeParameters(parseModifiers) { - const node = this.startNode(); - if (this.match(47) || this.match(140)) { - this.next(); - } else { - this.unexpected(); - } - const refTrailingCommaPos = { - value: -1 - }; - node.params = this.tsParseBracketedList("TypeParametersOrArguments", - this.tsParseTypeParameter.bind(this, parseModifiers), false, true, refTrailingCommaPos); - if (node.params.length === 0) { - this.raise(TSErrors.EmptyTypeParameters, { - at: node - }); - } - if (refTrailingCommaPos.value !== -1) { - this.addExtra(node, "trailingComma", refTrailingCommaPos.value); - } - return this.finishNode(node, "TSTypeParameterDeclaration"); - } - - tsFillSignature(returnToken, signature) { - const returnTokenRequired = returnToken === 19; - - const paramsKey = "parameters"; - const returnTypeKey = "typeAnnotation"; - signature.typeParameters = this.tsTryParseTypeParameters(); - this.expect(10); - signature[paramsKey] = this.tsParseBindingListForSignature(); - if (returnTokenRequired) { - signature[returnTypeKey] = this.tsParseTypeOrTypePredicateAnnotation(returnToken); - } else if (this.match(returnToken)) { - signature[returnTypeKey] = this.tsParseTypeOrTypePredicateAnnotation(returnToken); - } - } - tsParseBindingListForSignature() { - return super.parseBindingList(11, 41).map(pattern => { - if (pattern.type !== "Identifier" && pattern.type !== "RestElement" && pattern.type !== "ObjectPattern" && pattern.type !== "ArrayPattern") { - this.raise(TSErrors.UnsupportedSignatureParameterKind, { - at: pattern, - type: pattern.type - }); - } - return pattern; - }); - } - tsParseTypeMemberSemicolon() { - if (!this.eat(12) && !this.isLineTerminator()) { - this.expect(13); - } - } - tsParseSignatureMember(kind, node) { - this.tsFillSignature(14, node); - this.tsParseTypeMemberSemicolon(); - return this.finishNode(node, kind); - } - tsIsUnambiguouslyIndexSignature() { - this.next(); - if (tokenIsIdentifier(this.state.type)) { - this.next(); - return this.match(14); - } - return false; - } - tsTryParseIndexSignature(node) { - if (!(this.match(0) && this.tsLookAhead(this.tsIsUnambiguouslyIndexSignature.bind(this)))) { - return undefined; - } - this.expect(0); - const id = this.parseIdentifier(); - id.typeAnnotation = this.tsParseTypeAnnotation(); - this.resetEndLocation(id); - - this.expect(3); - node.parameters = [id]; - const type = this.tsTryParseTypeAnnotation(); - if (type) node.typeAnnotation = type; - this.tsParseTypeMemberSemicolon(); - return this.finishNode(node, "TSIndexSignature"); - } - tsParsePropertyOrMethodSignature(node, readonly) { - if (this.eat(17)) node.optional = true; - const nodeAny = node; - if (this.match(10) || this.match(47)) { - if (readonly) { - this.raise(TSErrors.ReadonlyForMethodSignature, { - at: node - }); - } - const method = nodeAny; - if (method.kind && this.match(47)) { - this.raise(TSErrors.AccesorCannotHaveTypeParameters, { - at: this.state.curPosition() - }); - } - this.tsFillSignature(14, method); - this.tsParseTypeMemberSemicolon(); - const paramsKey = "parameters"; - const returnTypeKey = "typeAnnotation"; - if (method.kind === "get") { - if (method[paramsKey].length > 0) { - this.raise(Errors.BadGetterArity, { - at: this.state.curPosition() - }); - if (this.isThisParam(method[paramsKey][0])) { - this.raise(TSErrors.AccesorCannotDeclareThisParameter, { - at: this.state.curPosition() - }); - } - } - } else if (method.kind === "set") { - if (method[paramsKey].length !== 1) { - this.raise(Errors.BadSetterArity, { - at: this.state.curPosition() - }); - } else { - const firstParameter = method[paramsKey][0]; - if (this.isThisParam(firstParameter)) { - this.raise(TSErrors.AccesorCannotDeclareThisParameter, { - at: this.state.curPosition() - }); - } - if (firstParameter.type === "Identifier" && firstParameter.optional) { - this.raise(TSErrors.SetAccesorCannotHaveOptionalParameter, { - at: this.state.curPosition() - }); - } - if (firstParameter.type === "RestElement") { - this.raise(TSErrors.SetAccesorCannotHaveRestParameter, { - at: this.state.curPosition() - }); - } - } - if (method[returnTypeKey]) { - this.raise(TSErrors.SetAccesorCannotHaveReturnType, { - at: method[returnTypeKey] - }); - } - } else { - method.kind = "method"; - } - return this.finishNode(method, "TSMethodSignature"); - } else { - const property = nodeAny; - if (readonly) property.readonly = true; - const type = this.tsTryParseTypeAnnotation(); - if (type) property.typeAnnotation = type; - this.tsParseTypeMemberSemicolon(); - return this.finishNode(property, "TSPropertySignature"); - } - } - tsParseTypeMember() { - const node = this.startNode(); - if (this.match(10) || this.match(47)) { - return this.tsParseSignatureMember("TSCallSignatureDeclaration", node); - } - if (this.match(77)) { - const id = this.startNode(); - this.next(); - if (this.match(10) || this.match(47)) { - return this.tsParseSignatureMember("TSConstructSignatureDeclaration", node); - } else { - node.key = this.createIdentifier(id, "new"); - return this.tsParsePropertyOrMethodSignature(node, false); - } - } - this.tsParseModifiers({ - modified: node, - allowedModifiers: ["readonly"], - disallowedModifiers: ["declare", "abstract", "private", "protected", "public", "static", "override"] - }); - const idx = this.tsTryParseIndexSignature(node); - if (idx) { - return idx; - } - super.parsePropertyName(node); - if (!node.computed && node.key.type === "Identifier" && (node.key.name === "get" || node.key.name === "set") && this.tsTokenCanFollowModifier()) { - node.kind = node.key.name; - super.parsePropertyName(node); - } - return this.tsParsePropertyOrMethodSignature(node, !!node.readonly); - } - tsParseTypeLiteral() { - const node = this.startNode(); - node.members = this.tsParseObjectTypeMembers(); - return this.finishNode(node, "TSTypeLiteral"); - } - tsParseObjectTypeMembers() { - this.expect(5); - const members = this.tsParseList("TypeMembers", this.tsParseTypeMember.bind(this)); - this.expect(8); - return members; - } - tsIsStartOfMappedType() { - this.next(); - if (this.eat(53)) { - return this.isContextual(120); - } - if (this.isContextual(120)) { - this.next(); - } - if (!this.match(0)) { - return false; - } - this.next(); - if (!this.tsIsIdentifier()) { - return false; - } - this.next(); - return this.match(58); - } - tsParseMappedTypeParameter() { - const node = this.startNode(); - node.name = this.tsParseTypeParameterName(); - node.constraint = this.tsExpectThenParseType(58); - return this.finishNode(node, "TSTypeParameter"); - } - tsParseMappedType() { - const node = this.startNode(); - this.expect(5); - if (this.match(53)) { - node.readonly = this.state.value; - this.next(); - this.expectContextual(120); - } else if (this.eatContextual(120)) { - node.readonly = true; - } - this.expect(0); - node.typeParameter = this.tsParseMappedTypeParameter(); - node.nameType = this.eatContextual(93) ? this.tsParseType() : null; - this.expect(3); - if (this.match(53)) { - node.optional = this.state.value; - this.next(); - this.expect(17); - } else if (this.eat(17)) { - node.optional = true; - } - node.typeAnnotation = this.tsTryParseType(); - this.semicolon(); - this.expect(8); - return this.finishNode(node, "TSMappedType"); - } - tsParseTupleType() { - const node = this.startNode(); - node.elementTypes = this.tsParseBracketedList("TupleElementTypes", this.tsParseTupleElementType.bind(this), true, false); - - let seenOptionalElement = false; - let labeledElements = null; - node.elementTypes.forEach(elementNode => { - var _labeledElements; - const { - type - } = elementNode; - if (seenOptionalElement && type !== "TSRestType" && type !== "TSOptionalType" && !(type === "TSNamedTupleMember" && elementNode.optional)) { - this.raise(TSErrors.OptionalTypeBeforeRequired, { - at: elementNode - }); - } - seenOptionalElement || (seenOptionalElement = type === "TSNamedTupleMember" && elementNode.optional || type === "TSOptionalType"); - - let checkType = type; - if (type === "TSRestType") { - elementNode = elementNode.typeAnnotation; - checkType = elementNode.type; - } - const isLabeled = checkType === "TSNamedTupleMember"; - (_labeledElements = labeledElements) != null ? _labeledElements : labeledElements = isLabeled; - if (labeledElements !== isLabeled) { - this.raise(TSErrors.MixedLabeledAndUnlabeledElements, { - at: elementNode - }); - } - }); - return this.finishNode(node, "TSTupleType"); - } - tsParseTupleElementType() { - - const { - startLoc - } = this.state; - const rest = this.eat(21); - let type = this.tsParseType(); - const optional = this.eat(17); - const labeled = this.eat(14); - if (labeled) { - const labeledNode = this.startNodeAtNode(type); - labeledNode.optional = optional; - if (type.type === "TSTypeReference" && !type.typeParameters && type.typeName.type === "Identifier") { - labeledNode.label = type.typeName; - } else { - this.raise(TSErrors.InvalidTupleMemberLabel, { - at: type - }); - labeledNode.label = type; - } - labeledNode.elementType = this.tsParseType(); - type = this.finishNode(labeledNode, "TSNamedTupleMember"); - } else if (optional) { - const optionalTypeNode = this.startNodeAtNode(type); - optionalTypeNode.typeAnnotation = type; - type = this.finishNode(optionalTypeNode, "TSOptionalType"); - } - if (rest) { - const restNode = this.startNodeAt(startLoc); - restNode.typeAnnotation = type; - type = this.finishNode(restNode, "TSRestType"); - } - return type; - } - tsParseParenthesizedType() { - const node = this.startNode(); - this.expect(10); - node.typeAnnotation = this.tsParseType(); - this.expect(11); - return this.finishNode(node, "TSParenthesizedType"); - } - tsParseFunctionOrConstructorType(type, abstract) { - const node = this.startNode(); - if (type === "TSConstructorType") { - node.abstract = !!abstract; - if (abstract) this.next(); - this.next(); - } - - this.tsInAllowConditionalTypesContext(() => this.tsFillSignature(19, node)); - return this.finishNode(node, type); - } - tsParseLiteralTypeNode() { - const node = this.startNode(); - node.literal = (() => { - switch (this.state.type) { - case 132: - case 133: - case 131: - case 85: - case 86: - return super.parseExprAtom(); - default: - throw this.unexpected(); - } - })(); - return this.finishNode(node, "TSLiteralType"); - } - tsParseTemplateLiteralType() { - const node = this.startNode(); - node.literal = super.parseTemplate(false); - return this.finishNode(node, "TSLiteralType"); - } - parseTemplateSubstitution() { - if (this.state.inType) return this.tsParseType(); - return super.parseTemplateSubstitution(); - } - tsParseThisTypeOrThisTypePredicate() { - const thisKeyword = this.tsParseThisTypeNode(); - if (this.isContextual(114) && !this.hasPrecedingLineBreak()) { - return this.tsParseThisTypePredicate(thisKeyword); - } else { - return thisKeyword; - } - } - tsParseNonArrayType() { - switch (this.state.type) { - case 131: - case 132: - case 133: - case 85: - case 86: - return this.tsParseLiteralTypeNode(); - case 53: - if (this.state.value === "-") { - const node = this.startNode(); - const nextToken = this.lookahead(); - if (nextToken.type !== 132 && nextToken.type !== 133) { - throw this.unexpected(); - } - node.literal = this.parseMaybeUnary(); - return this.finishNode(node, "TSLiteralType"); - } - break; - case 78: - return this.tsParseThisTypeOrThisTypePredicate(); - case 87: - return this.tsParseTypeQuery(); - case 83: - return this.tsParseImportType(); - case 5: - return this.tsLookAhead(this.tsIsStartOfMappedType.bind(this)) ? this.tsParseMappedType() : this.tsParseTypeLiteral(); - case 0: - return this.tsParseTupleType(); - case 10: - return this.tsParseParenthesizedType(); - case 25: - case 24: - return this.tsParseTemplateLiteralType(); - default: - { - const { - type - } = this.state; - if (tokenIsIdentifier(type) || type === 88 || type === 84) { - const nodeType = type === 88 ? "TSVoidKeyword" : type === 84 ? "TSNullKeyword" : keywordTypeFromName(this.state.value); - if (nodeType !== undefined && this.lookaheadCharCode() !== 46) { - const node = this.startNode(); - this.next(); - return this.finishNode(node, nodeType); - } - return this.tsParseTypeReference(); - } - } - } - throw this.unexpected(); - } - tsParseArrayTypeOrHigher() { - let type = this.tsParseNonArrayType(); - while (!this.hasPrecedingLineBreak() && this.eat(0)) { - if (this.match(3)) { - const node = this.startNodeAtNode(type); - node.elementType = type; - this.expect(3); - type = this.finishNode(node, "TSArrayType"); - } else { - const node = this.startNodeAtNode(type); - node.objectType = type; - node.indexType = this.tsParseType(); - this.expect(3); - type = this.finishNode(node, "TSIndexedAccessType"); - } - } - return type; - } - tsParseTypeOperator() { - const node = this.startNode(); - const operator = this.state.value; - this.next(); - node.operator = operator; - node.typeAnnotation = this.tsParseTypeOperatorOrHigher(); - if (operator === "readonly") { - this.tsCheckTypeAnnotationForReadOnly( - node); - } - return this.finishNode(node, "TSTypeOperator"); - } - tsCheckTypeAnnotationForReadOnly(node) { - switch (node.typeAnnotation.type) { - case "TSTupleType": - case "TSArrayType": - return; - default: - this.raise(TSErrors.UnexpectedReadonly, { - at: node - }); - } - } - tsParseInferType() { - const node = this.startNode(); - this.expectContextual(113); - const typeParameter = this.startNode(); - typeParameter.name = this.tsParseTypeParameterName(); - typeParameter.constraint = this.tsTryParse(() => this.tsParseConstraintForInferType()); - node.typeParameter = this.finishNode(typeParameter, "TSTypeParameter"); - return this.finishNode(node, "TSInferType"); - } - tsParseConstraintForInferType() { - if (this.eat(81)) { - const constraint = this.tsInDisallowConditionalTypesContext(() => this.tsParseType()); - if (this.state.inDisallowConditionalTypesContext || !this.match(17)) { - return constraint; - } - } - } - tsParseTypeOperatorOrHigher() { - const isTypeOperator = tokenIsTSTypeOperator(this.state.type) && !this.state.containsEsc; - return isTypeOperator ? this.tsParseTypeOperator() : this.isContextual(113) ? this.tsParseInferType() : this.tsInAllowConditionalTypesContext(() => this.tsParseArrayTypeOrHigher()); - } - tsParseUnionOrIntersectionType(kind, parseConstituentType, operator) { - const node = this.startNode(); - const hasLeadingOperator = this.eat(operator); - const types = []; - do { - types.push(parseConstituentType()); - } while (this.eat(operator)); - if (types.length === 1 && !hasLeadingOperator) { - return types[0]; - } - node.types = types; - return this.finishNode(node, kind); - } - tsParseIntersectionTypeOrHigher() { - return this.tsParseUnionOrIntersectionType("TSIntersectionType", this.tsParseTypeOperatorOrHigher.bind(this), 45); - } - tsParseUnionTypeOrHigher() { - return this.tsParseUnionOrIntersectionType("TSUnionType", this.tsParseIntersectionTypeOrHigher.bind(this), 43); - } - tsIsStartOfFunctionType() { - if (this.match(47)) { - return true; - } - return this.match(10) && this.tsLookAhead(this.tsIsUnambiguouslyStartOfFunctionType.bind(this)); - } - tsSkipParameterStart() { - if (tokenIsIdentifier(this.state.type) || this.match(78)) { - this.next(); - return true; - } - if (this.match(5)) { - const { - errors - } = this.state; - const previousErrorCount = errors.length; - try { - this.parseObjectLike(8, true); - return errors.length === previousErrorCount; - } catch (_unused) { - return false; - } - } - if (this.match(0)) { - this.next(); - const { - errors - } = this.state; - const previousErrorCount = errors.length; - try { - super.parseBindingList(3, 93, true); - return errors.length === previousErrorCount; - } catch (_unused2) { - return false; - } - } - return false; - } - tsIsUnambiguouslyStartOfFunctionType() { - this.next(); - if (this.match(11) || this.match(21)) { - return true; - } - if (this.tsSkipParameterStart()) { - if (this.match(14) || this.match(12) || this.match(17) || this.match(29)) { - return true; - } - if (this.match(11)) { - this.next(); - if (this.match(19)) { - return true; - } - } - } - return false; - } - tsParseTypeOrTypePredicateAnnotation(returnToken) { - return this.tsInType(() => { - const t = this.startNode(); - this.expect(returnToken); - const node = this.startNode(); - const asserts = !!this.tsTryParse(this.tsParseTypePredicateAsserts.bind(this)); - if (asserts && this.match(78)) { - let thisTypePredicate = this.tsParseThisTypeOrThisTypePredicate(); - if (thisTypePredicate.type === "TSThisType") { - node.parameterName = thisTypePredicate; - node.asserts = true; - node.typeAnnotation = null; - thisTypePredicate = this.finishNode(node, "TSTypePredicate"); - } else { - this.resetStartLocationFromNode(thisTypePredicate, node); - thisTypePredicate.asserts = true; - } - t.typeAnnotation = thisTypePredicate; - return this.finishNode(t, "TSTypeAnnotation"); - } - const typePredicateVariable = this.tsIsIdentifier() && this.tsTryParse(this.tsParseTypePredicatePrefix.bind(this)); - if (!typePredicateVariable) { - if (!asserts) { - return this.tsParseTypeAnnotation(false, t); - } - - node.parameterName = this.parseIdentifier(); - node.asserts = asserts; - node.typeAnnotation = null; - t.typeAnnotation = this.finishNode(node, "TSTypePredicate"); - return this.finishNode(t, "TSTypeAnnotation"); - } - - const type = this.tsParseTypeAnnotation(false); - node.parameterName = typePredicateVariable; - node.typeAnnotation = type; - node.asserts = asserts; - t.typeAnnotation = this.finishNode(node, "TSTypePredicate"); - return this.finishNode(t, "TSTypeAnnotation"); - }); - } - tsTryParseTypeOrTypePredicateAnnotation() { - return this.match(14) ? this.tsParseTypeOrTypePredicateAnnotation(14) : undefined; - } - tsTryParseTypeAnnotation() { - return this.match(14) ? this.tsParseTypeAnnotation() : undefined; - } - tsTryParseType() { - return this.tsEatThenParseType(14); - } - tsParseTypePredicatePrefix() { - const id = this.parseIdentifier(); - if (this.isContextual(114) && !this.hasPrecedingLineBreak()) { - this.next(); - return id; - } - } - tsParseTypePredicateAsserts() { - if (this.state.type !== 107) { - return false; - } - const containsEsc = this.state.containsEsc; - this.next(); - if (!tokenIsIdentifier(this.state.type) && !this.match(78)) { - return false; - } - if (containsEsc) { - this.raise(Errors.InvalidEscapedReservedWord, { - at: this.state.lastTokStartLoc, - reservedWord: "asserts" - }); - } - return true; - } - tsParseTypeAnnotation(eatColon = true, t = this.startNode()) { - this.tsInType(() => { - if (eatColon) this.expect(14); - t.typeAnnotation = this.tsParseType(); - }); - return this.finishNode(t, "TSTypeAnnotation"); - } - - tsParseType() { - assert(this.state.inType); - const type = this.tsParseNonConditionalType(); - if (this.state.inDisallowConditionalTypesContext || this.hasPrecedingLineBreak() || !this.eat(81)) { - return type; - } - const node = this.startNodeAtNode(type); - node.checkType = type; - node.extendsType = this.tsInDisallowConditionalTypesContext(() => this.tsParseNonConditionalType()); - this.expect(17); - node.trueType = this.tsInAllowConditionalTypesContext(() => this.tsParseType()); - this.expect(14); - node.falseType = this.tsInAllowConditionalTypesContext(() => this.tsParseType()); - return this.finishNode(node, "TSConditionalType"); - } - isAbstractConstructorSignature() { - return this.isContextual(122) && this.lookahead().type === 77; - } - tsParseNonConditionalType() { - if (this.tsIsStartOfFunctionType()) { - return this.tsParseFunctionOrConstructorType("TSFunctionType"); - } - if (this.match(77)) { - return this.tsParseFunctionOrConstructorType("TSConstructorType"); - } else if (this.isAbstractConstructorSignature()) { - return this.tsParseFunctionOrConstructorType("TSConstructorType", true); - } - return this.tsParseUnionTypeOrHigher(); - } - tsParseTypeAssertion() { - if (this.getPluginOption("typescript", "disallowAmbiguousJSXLike")) { - this.raise(TSErrors.ReservedTypeAssertion, { - at: this.state.startLoc - }); - } - const node = this.startNode(); - node.typeAnnotation = this.tsInType(() => { - this.next(); - return this.match(75) ? this.tsParseTypeReference() : this.tsParseType(); - }); - this.expect(48); - node.expression = this.parseMaybeUnary(); - return this.finishNode(node, "TSTypeAssertion"); - } - tsParseHeritageClause(token) { - const originalStartLoc = this.state.startLoc; - const delimitedList = this.tsParseDelimitedList("HeritageClauseElement", () => { - const node = this.startNode(); - node.expression = this.tsParseEntityName(); - if (this.match(47)) { - node.typeParameters = this.tsParseTypeArguments(); - } - return this.finishNode(node, "TSExpressionWithTypeArguments"); - }); - if (!delimitedList.length) { - this.raise(TSErrors.EmptyHeritageClauseType, { - at: originalStartLoc, - token - }); - } - return delimitedList; - } - tsParseInterfaceDeclaration(node, properties = {}) { - if (this.hasFollowingLineBreak()) return null; - this.expectContextual(127); - if (properties.declare) node.declare = true; - if (tokenIsIdentifier(this.state.type)) { - node.id = this.parseIdentifier(); - this.checkIdentifier(node.id, BIND_TS_INTERFACE); - } else { - node.id = null; - this.raise(TSErrors.MissingInterfaceName, { - at: this.state.startLoc - }); - } - node.typeParameters = this.tsTryParseTypeParameters(this.tsParseInOutModifiers.bind(this)); - if (this.eat(81)) { - node.extends = this.tsParseHeritageClause("extends"); - } - const body = this.startNode(); - body.body = this.tsInType(this.tsParseObjectTypeMembers.bind(this)); - node.body = this.finishNode(body, "TSInterfaceBody"); - return this.finishNode(node, "TSInterfaceDeclaration"); - } - tsParseTypeAliasDeclaration(node) { - node.id = this.parseIdentifier(); - this.checkIdentifier(node.id, BIND_TS_TYPE); - node.typeAnnotation = this.tsInType(() => { - node.typeParameters = this.tsTryParseTypeParameters(this.tsParseInOutModifiers.bind(this)); - this.expect(29); - if (this.isContextual(112) && this.lookahead().type !== 16) { - const node = this.startNode(); - this.next(); - return this.finishNode(node, "TSIntrinsicKeyword"); - } - return this.tsParseType(); - }); - this.semicolon(); - return this.finishNode(node, "TSTypeAliasDeclaration"); - } - tsInNoContext(cb) { - const oldContext = this.state.context; - this.state.context = [oldContext[0]]; - try { - return cb(); - } finally { - this.state.context = oldContext; - } - } - - tsInType(cb) { - const oldInType = this.state.inType; - this.state.inType = true; - try { - return cb(); - } finally { - this.state.inType = oldInType; - } - } - tsInDisallowConditionalTypesContext(cb) { - const oldInDisallowConditionalTypesContext = this.state.inDisallowConditionalTypesContext; - this.state.inDisallowConditionalTypesContext = true; - try { - return cb(); - } finally { - this.state.inDisallowConditionalTypesContext = oldInDisallowConditionalTypesContext; - } - } - tsInAllowConditionalTypesContext(cb) { - const oldInDisallowConditionalTypesContext = this.state.inDisallowConditionalTypesContext; - this.state.inDisallowConditionalTypesContext = false; - try { - return cb(); - } finally { - this.state.inDisallowConditionalTypesContext = oldInDisallowConditionalTypesContext; - } - } - tsEatThenParseType(token) { - return !this.match(token) ? undefined : this.tsNextThenParseType(); - } - tsExpectThenParseType(token) { - return this.tsDoThenParseType(() => this.expect(token)); - } - tsNextThenParseType() { - return this.tsDoThenParseType(() => this.next()); - } - tsDoThenParseType(cb) { - return this.tsInType(() => { - cb(); - return this.tsParseType(); - }); - } - tsParseEnumMember() { - const node = this.startNode(); - node.id = this.match(131) ? super.parseStringLiteral(this.state.value) : this.parseIdentifier(true); - if (this.eat(29)) { - node.initializer = super.parseMaybeAssignAllowIn(); - } - return this.finishNode(node, "TSEnumMember"); - } - tsParseEnumDeclaration(node, properties = {}) { - if (properties.const) node.const = true; - if (properties.declare) node.declare = true; - this.expectContextual(124); - node.id = this.parseIdentifier(); - this.checkIdentifier(node.id, node.const ? BIND_TS_CONST_ENUM : BIND_TS_ENUM); - this.expect(5); - node.members = this.tsParseDelimitedList("EnumMembers", this.tsParseEnumMember.bind(this)); - this.expect(8); - return this.finishNode(node, "TSEnumDeclaration"); - } - tsParseModuleBlock() { - const node = this.startNode(); - this.scope.enter(SCOPE_OTHER); - this.expect(5); - super.parseBlockOrModuleBlockBody(node.body = [], undefined, true, 8); - this.scope.exit(); - return this.finishNode(node, "TSModuleBlock"); - } - tsParseModuleOrNamespaceDeclaration(node, nested = false) { - node.id = this.parseIdentifier(); - if (!nested) { - this.checkIdentifier(node.id, BIND_TS_NAMESPACE); - } - if (this.eat(16)) { - const inner = this.startNode(); - this.tsParseModuleOrNamespaceDeclaration(inner, true); - node.body = inner; - } else { - this.scope.enter(SCOPE_TS_MODULE); - this.prodParam.enter(PARAM); - node.body = this.tsParseModuleBlock(); - this.prodParam.exit(); - this.scope.exit(); - } - return this.finishNode(node, "TSModuleDeclaration"); - } - tsParseAmbientExternalModuleDeclaration(node) { - if (this.isContextual(110)) { - node.global = true; - node.id = this.parseIdentifier(); - } else if (this.match(131)) { - node.id = super.parseStringLiteral(this.state.value); - } else { - this.unexpected(); - } - if (this.match(5)) { - this.scope.enter(SCOPE_TS_MODULE); - this.prodParam.enter(PARAM); - node.body = this.tsParseModuleBlock(); - this.prodParam.exit(); - this.scope.exit(); - } else { - this.semicolon(); - } - return this.finishNode(node, "TSModuleDeclaration"); - } - tsParseImportEqualsDeclaration(node, isExport) { - node.isExport = isExport || false; - node.id = this.parseIdentifier(); - this.checkIdentifier(node.id, BIND_FLAGS_TS_IMPORT); - this.expect(29); - const moduleReference = this.tsParseModuleReference(); - if (node.importKind === "type" && moduleReference.type !== "TSExternalModuleReference") { - this.raise(TSErrors.ImportAliasHasImportType, { - at: moduleReference - }); - } - node.moduleReference = moduleReference; - this.semicolon(); - return this.finishNode(node, "TSImportEqualsDeclaration"); - } - tsIsExternalModuleReference() { - return this.isContextual(117) && this.lookaheadCharCode() === 40; - } - tsParseModuleReference() { - return this.tsIsExternalModuleReference() ? this.tsParseExternalModuleReference() : this.tsParseEntityName(false); - } - tsParseExternalModuleReference() { - const node = this.startNode(); - this.expectContextual(117); - this.expect(10); - if (!this.match(131)) { - throw this.unexpected(); - } - node.expression = super.parseExprAtom(); - this.expect(11); - return this.finishNode(node, "TSExternalModuleReference"); - } - - tsLookAhead(f) { - const state = this.state.clone(); - const res = f(); - this.state = state; - return res; - } - tsTryParseAndCatch(f) { - const result = this.tryParse(abort => - f() || abort()); - if (result.aborted || !result.node) return undefined; - if (result.error) this.state = result.failState; - return result.node; - } - tsTryParse(f) { - const state = this.state.clone(); - const result = f(); - if (result !== undefined && result !== false) { - return result; - } else { - this.state = state; - return undefined; - } - } - tsTryParseDeclare(nany) { - if (this.isLineTerminator()) { - return; - } - let starttype = this.state.type; - let kind; - if (this.isContextual(99)) { - starttype = 74; - kind = "let"; - } - - return this.tsInAmbientContext(() => { - if (starttype === 68) { - nany.declare = true; - return super.parseFunctionStatement(nany, false, true); - } - if (starttype === 80) { - nany.declare = true; - return this.parseClass(nany, true, false); - } - if (starttype === 124) { - return this.tsParseEnumDeclaration(nany, { - declare: true - }); - } - if (starttype === 110) { - return this.tsParseAmbientExternalModuleDeclaration(nany); - } - if (starttype === 75 || starttype === 74) { - if (!this.match(75) || !this.isLookaheadContextual("enum")) { - nany.declare = true; - return this.parseVarStatement(nany, kind || this.state.value, true); - } - - this.expect(75); - return this.tsParseEnumDeclaration(nany, { - const: true, - declare: true - }); - } - if (starttype === 127) { - const result = this.tsParseInterfaceDeclaration(nany, { - declare: true - }); - if (result) return result; - } - if (tokenIsIdentifier(starttype)) { - return this.tsParseDeclaration(nany, this.state.value, true, null); - } - }); - } - - tsTryParseExportDeclaration() { - return this.tsParseDeclaration(this.startNode(), this.state.value, true, null); - } - tsParseExpressionStatement(node, expr, decorators) { - switch (expr.name) { - case "declare": - { - const declaration = this.tsTryParseDeclare(node); - if (declaration) { - declaration.declare = true; - return declaration; - } - break; - } - case "global": - if (this.match(5)) { - this.scope.enter(SCOPE_TS_MODULE); - this.prodParam.enter(PARAM); - const mod = node; - mod.global = true; - mod.id = expr; - mod.body = this.tsParseModuleBlock(); - this.scope.exit(); - this.prodParam.exit(); - return this.finishNode(mod, "TSModuleDeclaration"); - } - break; - default: - return this.tsParseDeclaration(node, expr.name, false, decorators); - } - } - - tsParseDeclaration(node, value, next, decorators) { - switch (value) { - case "abstract": - if (this.tsCheckLineTerminator(next) && (this.match(80) || tokenIsIdentifier(this.state.type))) { - return this.tsParseAbstractDeclaration(node, decorators); - } - break; - case "module": - if (this.tsCheckLineTerminator(next)) { - if (this.match(131)) { - return this.tsParseAmbientExternalModuleDeclaration(node); - } else if (tokenIsIdentifier(this.state.type)) { - return this.tsParseModuleOrNamespaceDeclaration(node); - } - } - break; - case "namespace": - if (this.tsCheckLineTerminator(next) && tokenIsIdentifier(this.state.type)) { - return this.tsParseModuleOrNamespaceDeclaration(node); - } - break; - case "type": - if (this.tsCheckLineTerminator(next) && tokenIsIdentifier(this.state.type)) { - return this.tsParseTypeAliasDeclaration(node); - } - break; - } - } - tsCheckLineTerminator(next) { - if (next) { - if (this.hasFollowingLineBreak()) return false; - this.next(); - return true; - } - return !this.isLineTerminator(); - } - tsTryParseGenericAsyncArrowFunction(startLoc) { - if (!this.match(47)) { - return undefined; - } - const oldMaybeInArrowParameters = this.state.maybeInArrowParameters; - this.state.maybeInArrowParameters = true; - const res = this.tsTryParseAndCatch(() => { - const node = this.startNodeAt(startLoc); - node.typeParameters = this.tsParseTypeParameters(); - super.parseFunctionParams(node); - node.returnType = this.tsTryParseTypeOrTypePredicateAnnotation(); - this.expect(19); - return node; - }); - this.state.maybeInArrowParameters = oldMaybeInArrowParameters; - if (!res) { - return undefined; - } - return super.parseArrowExpression(res, null, true); - } - - tsParseTypeArgumentsInExpression() { - if (this.reScan_lt() !== 47) { - return undefined; - } - return this.tsParseTypeArguments(); - } - tsParseTypeArguments() { - const node = this.startNode(); - node.params = this.tsInType(() => - this.tsInNoContext(() => { - this.expect(47); - return this.tsParseDelimitedList("TypeParametersOrArguments", this.tsParseType.bind(this)); - })); - if (node.params.length === 0) { - this.raise(TSErrors.EmptyTypeArguments, { - at: node - }); - } - this.expect(48); - return this.finishNode(node, "TSTypeParameterInstantiation"); - } - tsIsDeclarationStart() { - return tokenIsTSDeclarationStart(this.state.type); - } - - isExportDefaultSpecifier() { - if (this.tsIsDeclarationStart()) return false; - return super.isExportDefaultSpecifier(); - } - parseAssignableListItem(allowModifiers, decorators) { - const startLoc = this.state.startLoc; - let accessibility; - let readonly = false; - let override = false; - if (allowModifiers !== undefined) { - const modified = {}; - this.tsParseModifiers({ - modified, - allowedModifiers: ["public", "private", "protected", "override", "readonly"] - }); - accessibility = modified.accessibility; - override = modified.override; - readonly = modified.readonly; - if (allowModifiers === false && (accessibility || readonly || override)) { - this.raise(TSErrors.UnexpectedParameterModifier, { - at: startLoc - }); - } - } - const left = this.parseMaybeDefault(); - this.parseAssignableListItemTypes(left); - const elt = this.parseMaybeDefault(left.loc.start, left); - if (accessibility || readonly || override) { - const pp = this.startNodeAt(startLoc); - if (decorators.length) { - pp.decorators = decorators; - } - if (accessibility) pp.accessibility = accessibility; - if (readonly) pp.readonly = readonly; - if (override) pp.override = override; - if (elt.type !== "Identifier" && elt.type !== "AssignmentPattern") { - this.raise(TSErrors.UnsupportedParameterPropertyKind, { - at: pp - }); - } - pp.parameter = elt; - return this.finishNode(pp, "TSParameterProperty"); - } - if (decorators.length) { - left.decorators = decorators; - } - return elt; - } - isSimpleParameter(node) { - return node.type === "TSParameterProperty" && super.isSimpleParameter(node.parameter) || super.isSimpleParameter(node); - } - parseFunctionBodyAndFinish(node, type, isMethod = false) { - if (this.match(14)) { - node.returnType = this.tsParseTypeOrTypePredicateAnnotation(14); - } - const bodilessType = type === "FunctionDeclaration" ? "TSDeclareFunction" : type === "ClassMethod" || type === "ClassPrivateMethod" ? "TSDeclareMethod" : undefined; - if (bodilessType && !this.match(5) && this.isLineTerminator()) { - return this.finishNode(node, bodilessType); - } - if (bodilessType === "TSDeclareFunction" && this.state.isAmbientContext) { - this.raise(TSErrors.DeclareFunctionHasImplementation, { - at: node - }); - if (node.declare) { - return super.parseFunctionBodyAndFinish(node, bodilessType, isMethod); - } - } - return super.parseFunctionBodyAndFinish(node, type, isMethod); - } - registerFunctionStatementId(node) { - if (!node.body && node.id) { - this.checkIdentifier(node.id, BIND_TS_AMBIENT); - } else { - super.registerFunctionStatementId(node); - } - } - tsCheckForInvalidTypeCasts(items) { - items.forEach(node => { - if ((node == null ? void 0 : node.type) === "TSTypeCastExpression") { - this.raise(TSErrors.UnexpectedTypeAnnotation, { - at: node.typeAnnotation - }); - } - }); - } - toReferencedList(exprList, - isInParens) { - this.tsCheckForInvalidTypeCasts(exprList); - return exprList; - } - parseArrayLike(close, canBePattern, isTuple, refExpressionErrors) { - const node = super.parseArrayLike(close, canBePattern, isTuple, refExpressionErrors); - if (node.type === "ArrayExpression") { - this.tsCheckForInvalidTypeCasts(node.elements); - } - return node; - } - parseSubscript(base, startLoc, noCalls, state) { - if (!this.hasPrecedingLineBreak() && this.match(35)) { - this.state.canStartJSXElement = false; - this.next(); - const nonNullExpression = this.startNodeAt(startLoc); - nonNullExpression.expression = base; - return this.finishNode(nonNullExpression, "TSNonNullExpression"); - } - let isOptionalCall = false; - if (this.match(18) && this.lookaheadCharCode() === 60) { - if (noCalls) { - state.stop = true; - return base; - } - state.optionalChainMember = isOptionalCall = true; - this.next(); - } - - if (this.match(47) || this.match(51)) { - let missingParenErrorLoc; - const result = this.tsTryParseAndCatch(() => { - if (!noCalls && this.atPossibleAsyncArrow(base)) { - const asyncArrowFn = this.tsTryParseGenericAsyncArrowFunction(startLoc); - if (asyncArrowFn) { - return asyncArrowFn; - } - } - const typeArguments = this.tsParseTypeArgumentsInExpression(); - if (!typeArguments) return; - if (isOptionalCall && !this.match(10)) { - missingParenErrorLoc = this.state.curPosition(); - return; - } - if (tokenIsTemplate(this.state.type)) { - const result = super.parseTaggedTemplateExpression(base, startLoc, state); - result.typeParameters = typeArguments; - return result; - } - if (!noCalls && this.eat(10)) { - const node = this.startNodeAt(startLoc); - node.callee = base; - node.arguments = this.parseCallExpressionArguments(11, false); - - this.tsCheckForInvalidTypeCasts(node.arguments); - node.typeParameters = typeArguments; - if (state.optionalChainMember) { - node.optional = isOptionalCall; - } - return this.finishCallExpression(node, state.optionalChainMember); - } - const tokenType = this.state.type; - if ( - tokenType === 48 || - tokenType === 52 || - tokenType !== 10 && tokenCanStartExpression(tokenType) && !this.hasPrecedingLineBreak()) { - return; - } - const node = this.startNodeAt(startLoc); - node.expression = base; - node.typeParameters = typeArguments; - return this.finishNode(node, "TSInstantiationExpression"); - }); - if (missingParenErrorLoc) { - this.unexpected(missingParenErrorLoc, 10); - } - if (result) { - if (result.type === "TSInstantiationExpression" && (this.match(16) || this.match(18) && this.lookaheadCharCode() !== 40)) { - this.raise(TSErrors.InvalidPropertyAccessAfterInstantiationExpression, { - at: this.state.startLoc - }); - } - return result; - } - } - return super.parseSubscript(base, startLoc, noCalls, state); - } - parseNewCallee(node) { - var _callee$extra; - super.parseNewCallee(node); - const { - callee - } = node; - if (callee.type === "TSInstantiationExpression" && !((_callee$extra = callee.extra) != null && _callee$extra.parenthesized)) { - node.typeParameters = callee.typeParameters; - node.callee = callee.expression; - } - } - parseExprOp(left, leftStartLoc, minPrec) { - let isSatisfies; - if (tokenOperatorPrecedence(58) > minPrec && !this.hasPrecedingLineBreak() && (this.isContextual(93) || (isSatisfies = this.isContextual(118)))) { - const node = this.startNodeAt(leftStartLoc); - node.expression = left; - node.typeAnnotation = this.tsInType(() => { - this.next(); - if (this.match(75)) { - if (isSatisfies) { - this.raise(Errors.UnexpectedKeyword, { - at: this.state.startLoc, - keyword: "const" - }); - } - return this.tsParseTypeReference(); - } - return this.tsParseType(); - }); - this.finishNode(node, isSatisfies ? "TSSatisfiesExpression" : "TSAsExpression"); - this.reScan_lt_gt(); - return this.parseExprOp( - node, leftStartLoc, minPrec); - } - return super.parseExprOp(left, leftStartLoc, minPrec); - } - checkReservedWord(word, startLoc, checkKeywords, isBinding) { - if (!this.state.isAmbientContext) { - super.checkReservedWord(word, startLoc, checkKeywords, isBinding); - } - } - checkImportReflection(node) { - super.checkImportReflection(node); - if (node.module && node.importKind !== "value") { - this.raise(TSErrors.ImportReflectionHasImportType, { - at: node.specifiers[0].loc.start - }); - } - } - - checkDuplicateExports() {} - parseImport(node) { - node.importKind = "value"; - if (tokenIsIdentifier(this.state.type) || this.match(55) || this.match(5)) { - let ahead = this.lookahead(); - if (this.isContextual(128) && - ahead.type !== 12 && - ahead.type !== 97 && - ahead.type !== 29) { - node.importKind = "type"; - this.next(); - ahead = this.lookahead(); - } - if (tokenIsIdentifier(this.state.type) && ahead.type === 29) { - return this.tsParseImportEqualsDeclaration(node); - } - } - const importNode = super.parseImport(node); - - if (importNode.importKind === "type" && - importNode.specifiers.length > 1 && - importNode.specifiers[0].type === "ImportDefaultSpecifier") { - this.raise(TSErrors.TypeImportCannotSpecifyDefaultAndNamed, { - at: importNode - }); - } - return importNode; - } - parseExport(node, decorators) { - if (this.match(83)) { - this.next(); - if (this.isContextual(128) && this.lookaheadCharCode() !== 61) { - node.importKind = "type"; - this.next(); - } else { - node.importKind = "value"; - } - return this.tsParseImportEqualsDeclaration(node, true); - } else if (this.eat(29)) { - const assign = node; - assign.expression = super.parseExpression(); - this.semicolon(); - return this.finishNode(assign, "TSExportAssignment"); - } else if (this.eatContextual(93)) { - const decl = node; - this.expectContextual(126); - decl.id = this.parseIdentifier(); - this.semicolon(); - return this.finishNode(decl, "TSNamespaceExportDeclaration"); - } else { - if (this.isContextual(128) && this.lookahead().type === 5) { - this.next(); - node.exportKind = "type"; - } else { - node.exportKind = "value"; - } - return super.parseExport(node, decorators); - } - } - isAbstractClass() { - return this.isContextual(122) && this.lookahead().type === 80; - } - parseExportDefaultExpression() { - if (this.isAbstractClass()) { - const cls = this.startNode(); - this.next(); - cls.abstract = true; - return this.parseClass(cls, true, true); - } - - if (this.match(127)) { - const result = this.tsParseInterfaceDeclaration(this.startNode()); - if (result) return result; - } - return super.parseExportDefaultExpression(); - } - parseVarStatement(node, kind, allowMissingInitializer = false) { - const { - isAmbientContext - } = this.state; - const declaration = super.parseVarStatement(node, kind, allowMissingInitializer || isAmbientContext); - if (!isAmbientContext) return declaration; - for (const { - id, - init - } of declaration.declarations) { - if (!init) continue; - - if (kind !== "const" || !!id.typeAnnotation) { - this.raise(TSErrors.InitializerNotAllowedInAmbientContext, { - at: init - }); - } else if (init.type !== "StringLiteral" && init.type !== "BooleanLiteral" && init.type !== "NumericLiteral" && init.type !== "BigIntLiteral" && (init.type !== "TemplateLiteral" || init.expressions.length > 0) && !isPossiblyLiteralEnum(init)) { - this.raise(TSErrors.ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference, { - at: init - }); - } - } - return declaration; - } - parseStatementContent(context, topLevel, decorators) { - if (this.match(75) && this.isLookaheadContextual("enum")) { - const node = this.startNode(); - this.expect(75); - return this.tsParseEnumDeclaration(node, { - const: true - }); - } - if (this.isContextual(124)) { - return this.tsParseEnumDeclaration(this.startNode()); - } - if (this.isContextual(127)) { - const result = this.tsParseInterfaceDeclaration(this.startNode()); - if (result) return result; - } - return super.parseStatementContent(context, topLevel, decorators); - } - parseAccessModifier() { - return this.tsParseModifier(["public", "protected", "private"]); - } - tsHasSomeModifiers(member, modifiers) { - return modifiers.some(modifier => { - if (tsIsAccessModifier(modifier)) { - return member.accessibility === modifier; - } - return !!member[modifier]; - }); - } - tsIsStartOfStaticBlocks() { - return this.isContextual(104) && this.lookaheadCharCode() === 123; - } - parseClassMember(classBody, member, state) { - const modifiers = ["declare", "private", "public", "protected", "override", "abstract", "readonly", "static"]; - this.tsParseModifiers({ - modified: member, - allowedModifiers: modifiers, - disallowedModifiers: ["in", "out"], - stopOnStartOfClassStaticBlock: true, - errorTemplate: TSErrors.InvalidModifierOnTypeParameterPositions - }); - const callParseClassMemberWithIsStatic = () => { - if (this.tsIsStartOfStaticBlocks()) { - this.next(); - this.next(); - if (this.tsHasSomeModifiers(member, modifiers)) { - this.raise(TSErrors.StaticBlockCannotHaveModifier, { - at: this.state.curPosition() - }); - } - super.parseClassStaticBlock(classBody, member); - } else { - this.parseClassMemberWithIsStatic(classBody, member, state, !!member.static); - } - }; - if (member.declare) { - this.tsInAmbientContext(callParseClassMemberWithIsStatic); - } else { - callParseClassMemberWithIsStatic(); - } - } - parseClassMemberWithIsStatic(classBody, member, state, isStatic) { - const idx = this.tsTryParseIndexSignature(member); - if (idx) { - classBody.body.push(idx); - if (member.abstract) { - this.raise(TSErrors.IndexSignatureHasAbstract, { - at: member - }); - } - if (member.accessibility) { - this.raise(TSErrors.IndexSignatureHasAccessibility, { - at: member, - modifier: member.accessibility - }); - } - if (member.declare) { - this.raise(TSErrors.IndexSignatureHasDeclare, { - at: member - }); - } - if (member.override) { - this.raise(TSErrors.IndexSignatureHasOverride, { - at: member - }); - } - return; - } - if (!this.state.inAbstractClass && member.abstract) { - this.raise(TSErrors.NonAbstractClassHasAbstractMethod, { - at: member - }); - } - if (member.override) { - if (!state.hadSuperClass) { - this.raise(TSErrors.OverrideNotInSubClass, { - at: member - }); - } - } - - super.parseClassMemberWithIsStatic(classBody, member, state, isStatic); - } - parsePostMemberNameModifiers(methodOrProp) { - const optional = this.eat(17); - if (optional) methodOrProp.optional = true; - if (methodOrProp.readonly && this.match(10)) { - this.raise(TSErrors.ClassMethodHasReadonly, { - at: methodOrProp - }); - } - if (methodOrProp.declare && this.match(10)) { - this.raise(TSErrors.ClassMethodHasDeclare, { - at: methodOrProp - }); - } - } - - parseExpressionStatement(node, expr, decorators) { - const decl = expr.type === "Identifier" ? - this.tsParseExpressionStatement(node, expr, decorators) : undefined; - return decl || super.parseExpressionStatement(node, expr, decorators); - } - - shouldParseExportDeclaration() { - if (this.tsIsDeclarationStart()) return true; - return super.shouldParseExportDeclaration(); - } - - parseConditional(expr, startLoc, refExpressionErrors) { - if (!this.state.maybeInArrowParameters || !this.match(17)) { - return super.parseConditional(expr, startLoc, refExpressionErrors); - } - const result = this.tryParse(() => super.parseConditional(expr, startLoc)); - if (!result.node) { - if (result.error) { - super.setOptionalParametersError(refExpressionErrors, result.error); - } - return expr; - } - if (result.error) this.state = result.failState; - return result.node; - } - - parseParenItem(node, startLoc) { - node = super.parseParenItem(node, startLoc); - if (this.eat(17)) { - node.optional = true; - this.resetEndLocation(node); - } - if (this.match(14)) { - const typeCastNode = this.startNodeAt(startLoc); - typeCastNode.expression = node; - typeCastNode.typeAnnotation = this.tsParseTypeAnnotation(); - return this.finishNode(typeCastNode, "TSTypeCastExpression"); - } - return node; - } - parseExportDeclaration(node) { - if (!this.state.isAmbientContext && this.isContextual(123)) { - return this.tsInAmbientContext(() => this.parseExportDeclaration(node)); - } - - const startLoc = this.state.startLoc; - const isDeclare = this.eatContextual(123); - if (isDeclare && (this.isContextual(123) || !this.shouldParseExportDeclaration())) { - throw this.raise(TSErrors.ExpectedAmbientAfterExportDeclare, { - at: this.state.startLoc - }); - } - const isIdentifier = tokenIsIdentifier(this.state.type); - const declaration = isIdentifier && this.tsTryParseExportDeclaration() || super.parseExportDeclaration(node); - if (!declaration) return null; - if (declaration.type === "TSInterfaceDeclaration" || declaration.type === "TSTypeAliasDeclaration" || isDeclare) { - node.exportKind = "type"; - } - if (isDeclare) { - this.resetStartLocation(declaration, startLoc); - declaration.declare = true; - } - return declaration; - } - parseClassId(node, isStatement, optionalId, - bindingType) { - if ((!isStatement || optionalId) && this.isContextual(111)) { - return; - } - super.parseClassId(node, isStatement, optionalId, node.declare ? BIND_TS_AMBIENT : BIND_CLASS); - const typeParameters = this.tsTryParseTypeParameters(this.tsParseInOutModifiers.bind(this)); - if (typeParameters) node.typeParameters = typeParameters; - } - parseClassPropertyAnnotation(node) { - if (!node.optional && this.eat(35)) { - node.definite = true; - } - const type = this.tsTryParseTypeAnnotation(); - if (type) node.typeAnnotation = type; - } - parseClassProperty(node) { - this.parseClassPropertyAnnotation(node); - if (this.state.isAmbientContext && !(node.readonly && !node.typeAnnotation) && this.match(29)) { - this.raise(TSErrors.DeclareClassFieldHasInitializer, { - at: this.state.startLoc - }); - } - if (node.abstract && this.match(29)) { - const { - key - } = node; - this.raise(TSErrors.AbstractPropertyHasInitializer, { - at: this.state.startLoc, - propertyName: key.type === "Identifier" && !node.computed ? key.name : `[${this.input.slice(key.start, key.end)}]` - }); - } - return super.parseClassProperty(node); - } - parseClassPrivateProperty(node) { - if (node.abstract) { - this.raise(TSErrors.PrivateElementHasAbstract, { - at: node - }); - } - - if (node.accessibility) { - this.raise(TSErrors.PrivateElementHasAccessibility, { - at: node, - modifier: node.accessibility - }); - } - this.parseClassPropertyAnnotation(node); - return super.parseClassPrivateProperty(node); - } - pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper) { - const typeParameters = this.tsTryParseTypeParameters(); - if (typeParameters && isConstructor) { - this.raise(TSErrors.ConstructorHasTypeParameters, { - at: typeParameters - }); - } - - const { - declare = false, - kind - } = method; - if (declare && (kind === "get" || kind === "set")) { - this.raise(TSErrors.DeclareAccessor, { - at: method, - kind - }); - } - if (typeParameters) method.typeParameters = typeParameters; - super.pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper); - } - pushClassPrivateMethod(classBody, method, isGenerator, isAsync) { - const typeParameters = this.tsTryParseTypeParameters(); - if (typeParameters) method.typeParameters = typeParameters; - super.pushClassPrivateMethod(classBody, method, isGenerator, isAsync); - } - declareClassPrivateMethodInScope(node, kind) { - if (node.type === "TSDeclareMethod") return; - if (node.type === "MethodDefinition" && !node.value.body) return; - super.declareClassPrivateMethodInScope(node, kind); - } - parseClassSuper(node) { - super.parseClassSuper(node); - if (node.superClass && (this.match(47) || this.match(51))) { - node.superTypeParameters = this.tsParseTypeArgumentsInExpression(); - } - if (this.eatContextual(111)) { - node.implements = this.tsParseHeritageClause("implements"); - } - } - parseObjPropValue(prop, startLoc, isGenerator, isAsync, isPattern, isAccessor, refExpressionErrors) { - const typeParameters = this.tsTryParseTypeParameters(); - if (typeParameters) prop.typeParameters = typeParameters; - return super.parseObjPropValue(prop, startLoc, isGenerator, isAsync, isPattern, isAccessor, refExpressionErrors); - } - parseFunctionParams(node, allowModifiers) { - const typeParameters = this.tsTryParseTypeParameters(); - if (typeParameters) node.typeParameters = typeParameters; - super.parseFunctionParams(node, allowModifiers); - } - - parseVarId(decl, kind) { - super.parseVarId(decl, kind); - if (decl.id.type === "Identifier" && !this.hasPrecedingLineBreak() && this.eat(35)) { - decl.definite = true; - } - const type = this.tsTryParseTypeAnnotation(); - if (type) { - decl.id.typeAnnotation = type; - this.resetEndLocation(decl.id); - } - } - - parseAsyncArrowFromCallExpression(node, call) { - if (this.match(14)) { - node.returnType = this.tsParseTypeAnnotation(); - } - return super.parseAsyncArrowFromCallExpression(node, call); - } - parseMaybeAssign(refExpressionErrors, afterLeftParse) { - var _jsx, _jsx2, _typeCast, _jsx3, _typeCast2, _jsx4, _typeCast3; - - let state; - let jsx; - let typeCast; - if (this.hasPlugin("jsx") && (this.match(140) || this.match(47))) { - state = this.state.clone(); - jsx = this.tryParse(() => super.parseMaybeAssign(refExpressionErrors, afterLeftParse), state); - - if (!jsx.error) return jsx.node; - - const { - context - } = this.state; - const currentContext = context[context.length - 1]; - if (currentContext === types.j_oTag || currentContext === types.j_expr) { - context.pop(); - } - } - if (!((_jsx = jsx) != null && _jsx.error) && !this.match(47)) { - return super.parseMaybeAssign(refExpressionErrors, afterLeftParse); - } - - if (!state || state === this.state) state = this.state.clone(); - let typeParameters; - const arrow = this.tryParse(abort => { - var _expr$extra, _typeParameters; - typeParameters = this.tsParseTypeParameters(); - const expr = super.parseMaybeAssign(refExpressionErrors, afterLeftParse); - if (expr.type !== "ArrowFunctionExpression" || (_expr$extra = expr.extra) != null && _expr$extra.parenthesized) { - abort(); - } - - if (((_typeParameters = typeParameters) == null ? void 0 : _typeParameters.params.length) !== 0) { - this.resetStartLocationFromNode(expr, typeParameters); - } - expr.typeParameters = typeParameters; - return expr; - }, state); - - if (!arrow.error && !arrow.aborted) { - if (typeParameters) this.reportReservedArrowTypeParam(typeParameters); - return arrow.node; - } - if (!jsx) { - assert(!this.hasPlugin("jsx")); - - typeCast = this.tryParse(() => super.parseMaybeAssign(refExpressionErrors, afterLeftParse), state); - if (!typeCast.error) return typeCast.node; - } - if ((_jsx2 = jsx) != null && _jsx2.node) { - this.state = jsx.failState; - return jsx.node; - } - if (arrow.node) { - this.state = arrow.failState; - if (typeParameters) this.reportReservedArrowTypeParam(typeParameters); - return arrow.node; - } - if ((_typeCast = typeCast) != null && _typeCast.node) { - this.state = typeCast.failState; - return typeCast.node; - } - if ((_jsx3 = jsx) != null && _jsx3.thrown) throw jsx.error; - if (arrow.thrown) throw arrow.error; - if ((_typeCast2 = typeCast) != null && _typeCast2.thrown) throw typeCast.error; - throw ((_jsx4 = jsx) == null ? void 0 : _jsx4.error) || arrow.error || ((_typeCast3 = typeCast) == null ? void 0 : _typeCast3.error); - } - reportReservedArrowTypeParam(node) { - var _node$extra; - if (node.params.length === 1 && !((_node$extra = node.extra) != null && _node$extra.trailingComma) && this.getPluginOption("typescript", "disallowAmbiguousJSXLike")) { - this.raise(TSErrors.ReservedArrowTypeParam, { - at: node - }); - } - } - - parseMaybeUnary(refExpressionErrors, sawUnary) { - if (!this.hasPlugin("jsx") && this.match(47)) { - return this.tsParseTypeAssertion(); - } else { - return super.parseMaybeUnary(refExpressionErrors, sawUnary); - } - } - parseArrow(node) { - if (this.match(14)) { - - const result = this.tryParse(abort => { - const returnType = this.tsParseTypeOrTypePredicateAnnotation(14); - if (this.canInsertSemicolon() || !this.match(19)) abort(); - return returnType; - }); - if (result.aborted) return; - if (!result.thrown) { - if (result.error) this.state = result.failState; - node.returnType = result.node; - } - } - return super.parseArrow(node); - } - - parseAssignableListItemTypes(param) { - if (this.eat(17)) { - if (param.type !== "Identifier" && !this.state.isAmbientContext && !this.state.inType) { - this.raise(TSErrors.PatternIsOptional, { - at: param - }); - } - param.optional = true; - } - const type = this.tsTryParseTypeAnnotation(); - if (type) param.typeAnnotation = type; - this.resetEndLocation(param); - return param; - } - isAssignable(node, isBinding) { - switch (node.type) { - case "TSTypeCastExpression": - return this.isAssignable(node.expression, isBinding); - case "TSParameterProperty": - return true; - default: - return super.isAssignable(node, isBinding); - } - } - toAssignable(node, isLHS = false) { - switch (node.type) { - case "ParenthesizedExpression": - this.toAssignableParenthesizedExpression(node, isLHS); - break; - case "TSAsExpression": - case "TSSatisfiesExpression": - case "TSNonNullExpression": - case "TSTypeAssertion": - if (isLHS) { - this.expressionScope.recordArrowParemeterBindingError(TSErrors.UnexpectedTypeCastInParameter, { - at: node - }); - } else { - this.raise(TSErrors.UnexpectedTypeCastInParameter, { - at: node - }); - } - this.toAssignable(node.expression, isLHS); - break; - case "AssignmentExpression": - if (!isLHS && node.left.type === "TSTypeCastExpression") { - node.left = this.typeCastToParameter(node.left); - } - default: - super.toAssignable(node, isLHS); - } - } - toAssignableParenthesizedExpression(node, isLHS) { - switch (node.expression.type) { - case "TSAsExpression": - case "TSSatisfiesExpression": - case "TSNonNullExpression": - case "TSTypeAssertion": - case "ParenthesizedExpression": - this.toAssignable(node.expression, isLHS); - break; - default: - super.toAssignable(node, isLHS); - } - } - checkToRestConversion(node, allowPattern) { - switch (node.type) { - case "TSAsExpression": - case "TSSatisfiesExpression": - case "TSTypeAssertion": - case "TSNonNullExpression": - this.checkToRestConversion(node.expression, false); - break; - default: - super.checkToRestConversion(node, allowPattern); - } - } - - isValidLVal(type, isUnparenthesizedInAssign, binding) { - return getOwn$1({ - TSTypeCastExpression: true, - TSParameterProperty: "parameter", - TSNonNullExpression: "expression", - TSAsExpression: (binding !== BIND_NONE || !isUnparenthesizedInAssign) && ["expression", true], - TSSatisfiesExpression: (binding !== BIND_NONE || !isUnparenthesizedInAssign) && ["expression", true], - TSTypeAssertion: (binding !== BIND_NONE || !isUnparenthesizedInAssign) && ["expression", true] - }, type) || super.isValidLVal(type, isUnparenthesizedInAssign, binding); - } - parseBindingAtom() { - switch (this.state.type) { - case 78: - return this.parseIdentifier(true); - default: - return super.parseBindingAtom(); - } - } - parseMaybeDecoratorArguments(expr) { - if (this.match(47) || this.match(51)) { - const typeArguments = this.tsParseTypeArgumentsInExpression(); - if (this.match(10)) { - const call = super.parseMaybeDecoratorArguments(expr); - call.typeParameters = typeArguments; - return call; - } - this.unexpected(null, 10); - } - return super.parseMaybeDecoratorArguments(expr); - } - checkCommaAfterRest(close) { - if (this.state.isAmbientContext && this.match(12) && this.lookaheadCharCode() === close) { - this.next(); - return false; - } else { - return super.checkCommaAfterRest(close); - } - } - - isClassMethod() { - return this.match(47) || super.isClassMethod(); - } - isClassProperty() { - return this.match(35) || this.match(14) || super.isClassProperty(); - } - parseMaybeDefault(startLoc, left) { - const node = super.parseMaybeDefault(startLoc, left); - if (node.type === "AssignmentPattern" && node.typeAnnotation && node.right.start < node.typeAnnotation.start) { - this.raise(TSErrors.TypeAnnotationAfterAssign, { - at: node.typeAnnotation - }); - } - return node; - } - - getTokenFromCode(code) { - if (this.state.inType) { - if (code === 62) { - return this.finishOp(48, 1); - } - if (code === 60) { - return this.finishOp(47, 1); - } - } - return super.getTokenFromCode(code); - } - - reScan_lt_gt() { - const { - type - } = this.state; - if (type === 47) { - this.state.pos -= 1; - this.readToken_lt(); - } else if (type === 48) { - this.state.pos -= 1; - this.readToken_gt(); - } - } - reScan_lt() { - const { - type - } = this.state; - if (type === 51) { - this.state.pos -= 2; - this.finishOp(47, 1); - return 47; - } - return type; - } - toAssignableList(exprList, trailingCommaLoc, isLHS) { - for (let i = 0; i < exprList.length; i++) { - const expr = exprList[i]; - if ((expr == null ? void 0 : expr.type) === "TSTypeCastExpression") { - exprList[i] = this.typeCastToParameter(expr); - } - } - super.toAssignableList(exprList, trailingCommaLoc, isLHS); - } - typeCastToParameter(node) { - node.expression.typeAnnotation = node.typeAnnotation; - this.resetEndLocation(node.expression, node.typeAnnotation.loc.end); - return node.expression; - } - shouldParseArrow(params) { - if (this.match(14)) { - return params.every(expr => this.isAssignable(expr, true)); - } - return super.shouldParseArrow(params); - } - shouldParseAsyncArrow() { - return this.match(14) || super.shouldParseAsyncArrow(); - } - canHaveLeadingDecorator() { - return super.canHaveLeadingDecorator() || this.isAbstractClass(); - } - jsxParseOpeningElementAfterName(node) { - if (this.match(47) || this.match(51)) { - const typeArguments = this.tsTryParseAndCatch(() => - this.tsParseTypeArgumentsInExpression()); - if (typeArguments) node.typeParameters = typeArguments; - } - return super.jsxParseOpeningElementAfterName(node); - } - getGetterSetterExpectedParamCount(method) { - const baseCount = super.getGetterSetterExpectedParamCount(method); - const params = this.getObjectOrClassMethodParams(method); - const firstParam = params[0]; - const hasContextParam = firstParam && this.isThisParam(firstParam); - return hasContextParam ? baseCount + 1 : baseCount; - } - parseCatchClauseParam() { - const param = super.parseCatchClauseParam(); - const type = this.tsTryParseTypeAnnotation(); - if (type) { - param.typeAnnotation = type; - this.resetEndLocation(param); - } - return param; - } - tsInAmbientContext(cb) { - const oldIsAmbientContext = this.state.isAmbientContext; - this.state.isAmbientContext = true; - try { - return cb(); - } finally { - this.state.isAmbientContext = oldIsAmbientContext; - } - } - parseClass(node, isStatement, optionalId) { - const oldInAbstractClass = this.state.inAbstractClass; - this.state.inAbstractClass = !!node.abstract; - try { - return super.parseClass(node, isStatement, optionalId); - } finally { - this.state.inAbstractClass = oldInAbstractClass; - } - } - tsParseAbstractDeclaration(node, decorators) { - if (this.match(80)) { - node.abstract = true; - return this.maybeTakeDecorators(decorators, this.parseClass(node, true, false)); - } else if (this.isContextual(127)) { - - if (!this.hasFollowingLineBreak()) { - node.abstract = true; - this.raise(TSErrors.NonClassMethodPropertyHasAbstractModifer, { - at: node - }); - return this.tsParseInterfaceDeclaration(node); - } - } else { - this.unexpected(null, 80); - } - } - parseMethod(node, isGenerator, isAsync, isConstructor, allowDirectSuper, type, inClassScope) { - const method = super.parseMethod(node, isGenerator, isAsync, isConstructor, allowDirectSuper, type, inClassScope); - if (method.abstract) { - const hasBody = this.hasPlugin("estree") ? - !!method.value.body : !!method.body; - if (hasBody) { - const { - key - } = method; - this.raise(TSErrors.AbstractMethodHasImplementation, { - at: method, - methodName: key.type === "Identifier" && !method.computed ? key.name : `[${this.input.slice(key.start, key.end)}]` - }); - } - } - return method; - } - tsParseTypeParameterName() { - const typeName = this.parseIdentifier(); - return typeName.name; - } - shouldParseAsAmbientContext() { - return !!this.getPluginOption("typescript", "dts"); - } - parse() { - if (this.shouldParseAsAmbientContext()) { - this.state.isAmbientContext = true; - } - return super.parse(); - } - getExpression() { - if (this.shouldParseAsAmbientContext()) { - this.state.isAmbientContext = true; - } - return super.getExpression(); - } - parseExportSpecifier(node, isString, isInTypeExport, isMaybeTypeOnly) { - if (!isString && isMaybeTypeOnly) { - this.parseTypeOnlyImportExportSpecifier(node, false, isInTypeExport); - return this.finishNode(node, "ExportSpecifier"); - } - node.exportKind = "value"; - return super.parseExportSpecifier(node, isString, isInTypeExport, isMaybeTypeOnly); - } - parseImportSpecifier(specifier, importedIsString, isInTypeOnlyImport, isMaybeTypeOnly, - bindingType) { - if (!importedIsString && isMaybeTypeOnly) { - this.parseTypeOnlyImportExportSpecifier(specifier, true, isInTypeOnlyImport); - return this.finishNode(specifier, "ImportSpecifier"); - } - specifier.importKind = "value"; - return super.parseImportSpecifier(specifier, importedIsString, isInTypeOnlyImport, isMaybeTypeOnly, isInTypeOnlyImport ? BIND_TS_TYPE_IMPORT : BIND_FLAGS_TS_IMPORT); - } - parseTypeOnlyImportExportSpecifier(node, isImport, isInTypeOnlyImportExport) { - const leftOfAsKey = isImport ? "imported" : "local"; - const rightOfAsKey = isImport ? "local" : "exported"; - let leftOfAs = node[leftOfAsKey]; - let rightOfAs; - let hasTypeSpecifier = false; - let canParseAsKeyword = true; - const loc = leftOfAs.loc.start; - - if (this.isContextual(93)) { - const firstAs = this.parseIdentifier(); - if (this.isContextual(93)) { - const secondAs = this.parseIdentifier(); - if (tokenIsKeywordOrIdentifier(this.state.type)) { - hasTypeSpecifier = true; - leftOfAs = firstAs; - rightOfAs = isImport ? this.parseIdentifier() : this.parseModuleExportName(); - canParseAsKeyword = false; - } else { - rightOfAs = secondAs; - canParseAsKeyword = false; - } - } else if (tokenIsKeywordOrIdentifier(this.state.type)) { - canParseAsKeyword = false; - rightOfAs = isImport ? this.parseIdentifier() : this.parseModuleExportName(); - } else { - hasTypeSpecifier = true; - leftOfAs = firstAs; - } - } else if (tokenIsKeywordOrIdentifier(this.state.type)) { - hasTypeSpecifier = true; - if (isImport) { - leftOfAs = this.parseIdentifier(true); - if (!this.isContextual(93)) { - this.checkReservedWord(leftOfAs.name, leftOfAs.loc.start, true, true); - } - } else { - leftOfAs = this.parseModuleExportName(); - } - } - if (hasTypeSpecifier && isInTypeOnlyImportExport) { - this.raise(isImport ? TSErrors.TypeModifierIsUsedInTypeImports : TSErrors.TypeModifierIsUsedInTypeExports, { - at: loc - }); - } - node[leftOfAsKey] = leftOfAs; - node[rightOfAsKey] = rightOfAs; - const kindKey = isImport ? "importKind" : "exportKind"; - node[kindKey] = hasTypeSpecifier ? "type" : "value"; - if (canParseAsKeyword && this.eatContextual(93)) { - node[rightOfAsKey] = isImport ? this.parseIdentifier() : this.parseModuleExportName(); - } - if (!node[rightOfAsKey]) { - node[rightOfAsKey] = cloneIdentifier(node[leftOfAsKey]); - } - if (isImport) { - this.checkIdentifier(node[rightOfAsKey], hasTypeSpecifier ? BIND_TS_TYPE_IMPORT : BIND_FLAGS_TS_IMPORT); - } - } -}); -function isPossiblyLiteralEnum(expression) { - if (expression.type !== "MemberExpression") return false; - const { - computed, - property - } = expression; - if (computed && property.type !== "StringLiteral" && (property.type !== "TemplateLiteral" || property.expressions.length > 0)) { - return false; - } - return isUncomputedMemberExpressionChain(expression.object); -} -function isUncomputedMemberExpressionChain(expression) { - if (expression.type === "Identifier") return true; - if (expression.type !== "MemberExpression") return false; - if (expression.computed) return false; - return isUncomputedMemberExpressionChain(expression.object); -} - -const PlaceholderErrors = ParseErrorEnum`placeholders`({ - ClassNameIsRequired: "A class name is required.", - UnexpectedSpace: "Unexpected space in placeholder." -}); - -var placeholders = (superClass => class PlaceholdersParserMixin extends superClass { - parsePlaceholder(expectedNode) { - if (this.match(142)) { - const node = this.startNode(); - this.next(); - this.assertNoSpace(); - - node.name = super.parseIdentifier(true); - this.assertNoSpace(); - this.expect(142); - return this.finishPlaceholder(node, expectedNode); - } - } - finishPlaceholder(node, expectedNode) { - const isFinished = !!(node.expectedNode && node.type === "Placeholder"); - node.expectedNode = expectedNode; - - return isFinished ? node : this.finishNode(node, "Placeholder"); - } - - getTokenFromCode(code) { - if (code === 37 && this.input.charCodeAt(this.state.pos + 1) === 37) { - return this.finishOp(142, 2); - } - return super.getTokenFromCode(code); - } - - parseExprAtom(refExpressionErrors) { - return this.parsePlaceholder("Expression") || super.parseExprAtom(refExpressionErrors); - } - parseIdentifier(liberal) { - return this.parsePlaceholder("Identifier") || super.parseIdentifier(liberal); - } - checkReservedWord(word, startLoc, checkKeywords, isBinding) { - if (word !== undefined) { - super.checkReservedWord(word, startLoc, checkKeywords, isBinding); - } - } - - parseBindingAtom() { - return this.parsePlaceholder("Pattern") || super.parseBindingAtom(); - } - isValidLVal(type, isParenthesized, binding) { - return type === "Placeholder" || super.isValidLVal(type, isParenthesized, binding); - } - toAssignable(node, isLHS) { - if (node && node.type === "Placeholder" && node.expectedNode === "Expression") { - node.expectedNode = "Pattern"; - } else { - super.toAssignable(node, isLHS); - } - } - - hasFollowingIdentifier(context) { - if (super.hasFollowingIdentifier(context)) { - return true; - } - if (context) return false; - - const nextToken = this.lookahead(); - if (nextToken.type === 142) { - return true; - } - return false; - } - verifyBreakContinue(node, isBreak) { - if (node.label && node.label.type === "Placeholder") return; - super.verifyBreakContinue(node, isBreak); - } - - parseExpressionStatement(node, expr) { - if (expr.type !== "Placeholder" || expr.extra && expr.extra.parenthesized) { - return super.parseExpressionStatement(node, expr); - } - if (this.match(14)) { - const stmt = node; - stmt.label = this.finishPlaceholder(expr, "Identifier"); - this.next(); - stmt.body = super.parseStatement("label"); - return this.finishNode(stmt, "LabeledStatement"); - } - this.semicolon(); - node.name = expr.name; - return this.finishPlaceholder(node, "Statement"); - } - parseBlock(allowDirectives, createNewLexicalScope, afterBlockParse) { - return this.parsePlaceholder("BlockStatement") || super.parseBlock(allowDirectives, createNewLexicalScope, afterBlockParse); - } - parseFunctionId(requireId) { - return this.parsePlaceholder("Identifier") || super.parseFunctionId(requireId); - } - parseClass(node, isStatement, optionalId) { - const type = isStatement ? "ClassDeclaration" : "ClassExpression"; - this.next(); - const oldStrict = this.state.strict; - const placeholder = this.parsePlaceholder("Identifier"); - if (placeholder) { - if (this.match(81) || this.match(142) || this.match(5)) { - node.id = placeholder; - } else if (optionalId || !isStatement) { - node.id = null; - node.body = this.finishPlaceholder(placeholder, "ClassBody"); - return this.finishNode(node, type); - } else { - throw this.raise(PlaceholderErrors.ClassNameIsRequired, { - at: this.state.startLoc - }); - } - } else { - this.parseClassId(node, isStatement, optionalId); - } - super.parseClassSuper(node); - node.body = this.parsePlaceholder("ClassBody") || super.parseClassBody(!!node.superClass, oldStrict); - return this.finishNode(node, type); - } - parseExport(node, decorators) { - const placeholder = this.parsePlaceholder("Identifier"); - if (!placeholder) return super.parseExport(node, decorators); - if (!this.isContextual(97) && !this.match(12)) { - node.specifiers = []; - node.source = null; - node.declaration = this.finishPlaceholder(placeholder, "Declaration"); - return this.finishNode(node, "ExportNamedDeclaration"); - } - - this.expectPlugin("exportDefaultFrom"); - const specifier = this.startNode(); - specifier.exported = placeholder; - node.specifiers = [this.finishNode(specifier, "ExportDefaultSpecifier")]; - return super.parseExport(node, decorators); - } - isExportDefaultSpecifier() { - if (this.match(65)) { - const next = this.nextTokenStart(); - if (this.isUnparsedContextual(next, "from")) { - if (this.input.startsWith(tokenLabelName(142), this.nextTokenStartSince(next + 4))) { - return true; - } - } - } - return super.isExportDefaultSpecifier(); - } - maybeParseExportDefaultSpecifier(node) { - if (node.specifiers && node.specifiers.length > 0) { - return true; - } - return super.maybeParseExportDefaultSpecifier(node); - } - checkExport(node) { - const { - specifiers - } = node; - if (specifiers != null && specifiers.length) { - node.specifiers = specifiers.filter( - node => node.exported.type === "Placeholder"); - } - super.checkExport(node); - node.specifiers = specifiers; - } - parseImport(node) { - const placeholder = this.parsePlaceholder("Identifier"); - if (!placeholder) return super.parseImport(node); - node.specifiers = []; - if (!this.isContextual(97) && !this.match(12)) { - node.source = this.finishPlaceholder(placeholder, "StringLiteral"); - this.semicolon(); - return this.finishNode(node, "ImportDeclaration"); - } - - const specifier = this.startNodeAtNode(placeholder); - specifier.local = placeholder; - node.specifiers.push(this.finishNode(specifier, "ImportDefaultSpecifier")); - if (this.eat(12)) { - const hasStarImport = this.maybeParseStarImportSpecifier(node); - - if (!hasStarImport) this.parseNamedImportSpecifiers(node); - } - this.expectContextual(97); - node.source = this.parseImportSource(); - this.semicolon(); - return this.finishNode(node, "ImportDeclaration"); - } - parseImportSource() { - - return this.parsePlaceholder("StringLiteral") || super.parseImportSource(); - } - - assertNoSpace() { - if (this.state.start > this.state.lastTokEndLoc.index) { - this.raise(PlaceholderErrors.UnexpectedSpace, { - at: this.state.lastTokEndLoc - }); - } - } -}); - -var v8intrinsic = (superClass => class V8IntrinsicMixin extends superClass { - parseV8Intrinsic() { - if (this.match(54)) { - const v8IntrinsicStartLoc = this.state.startLoc; - const node = this.startNode(); - this.next(); - if (tokenIsIdentifier(this.state.type)) { - const name = this.parseIdentifierName(); - const identifier = this.createIdentifier(node, name); - identifier.type = "V8IntrinsicIdentifier"; - if (this.match(10)) { - return identifier; - } - } - this.unexpected(v8IntrinsicStartLoc); - } - } - - parseExprAtom(refExpressionErrors) { - return this.parseV8Intrinsic() || super.parseExprAtom(refExpressionErrors); - } -}); - -function hasPlugin(plugins, expectedConfig) { - const [expectedName, expectedOptions] = typeof expectedConfig === "string" ? [expectedConfig, {}] : expectedConfig; - const expectedKeys = Object.keys(expectedOptions); - const expectedOptionsIsEmpty = expectedKeys.length === 0; - return plugins.some(p => { - if (typeof p === "string") { - return expectedOptionsIsEmpty && p === expectedName; - } else { - const [pluginName, pluginOptions] = p; - if (pluginName !== expectedName) { - return false; - } - for (const key of expectedKeys) { - if (pluginOptions[key] !== expectedOptions[key]) { - return false; - } - } - return true; - } - }); -} -function getPluginOption(plugins, name, option) { - const plugin = plugins.find(plugin => { - if (Array.isArray(plugin)) { - return plugin[0] === name; - } else { - return plugin === name; - } - }); - if (plugin && Array.isArray(plugin) && plugin.length > 1) { - return plugin[1][option]; - } - return null; -} -const PIPELINE_PROPOSALS = ["minimal", "fsharp", "hack", "smart"]; -const TOPIC_TOKENS = ["^^", "@@", "^", "%", "#"]; -const RECORD_AND_TUPLE_SYNTAX_TYPES = ["hash", "bar"]; -function validatePlugins(plugins) { - if (hasPlugin(plugins, "decorators")) { - if (hasPlugin(plugins, "decorators-legacy")) { - throw new Error("Cannot use the decorators and decorators-legacy plugin together"); - } - const decoratorsBeforeExport = getPluginOption(plugins, "decorators", "decoratorsBeforeExport"); - if (decoratorsBeforeExport != null && typeof decoratorsBeforeExport !== "boolean") { - throw new Error("'decoratorsBeforeExport' must be a boolean."); - } - const allowCallParenthesized = getPluginOption(plugins, "decorators", "allowCallParenthesized"); - if (allowCallParenthesized != null && typeof allowCallParenthesized !== "boolean") { - throw new Error("'allowCallParenthesized' must be a boolean."); - } - } - if (hasPlugin(plugins, "flow") && hasPlugin(plugins, "typescript")) { - throw new Error("Cannot combine flow and typescript plugins."); - } - if (hasPlugin(plugins, "placeholders") && hasPlugin(plugins, "v8intrinsic")) { - throw new Error("Cannot combine placeholders and v8intrinsic plugins."); - } - if (hasPlugin(plugins, "pipelineOperator")) { - const proposal = getPluginOption(plugins, "pipelineOperator", "proposal"); - if (!PIPELINE_PROPOSALS.includes(proposal)) { - const proposalList = PIPELINE_PROPOSALS.map(p => `"${p}"`).join(", "); - throw new Error(`"pipelineOperator" requires "proposal" option whose value must be one of: ${proposalList}.`); - } - const tupleSyntaxIsHash = hasPlugin(plugins, ["recordAndTuple", { - syntaxType: "hash" - }]); - if (proposal === "hack") { - if (hasPlugin(plugins, "placeholders")) { - throw new Error("Cannot combine placeholders plugin and Hack-style pipes."); - } - if (hasPlugin(plugins, "v8intrinsic")) { - throw new Error("Cannot combine v8intrinsic plugin and Hack-style pipes."); - } - const topicToken = getPluginOption(plugins, "pipelineOperator", "topicToken"); - if (!TOPIC_TOKENS.includes(topicToken)) { - const tokenList = TOPIC_TOKENS.map(t => `"${t}"`).join(", "); - throw new Error(`"pipelineOperator" in "proposal": "hack" mode also requires a "topicToken" option whose value must be one of: ${tokenList}.`); - } - if (topicToken === "#" && tupleSyntaxIsHash) { - throw new Error('Plugin conflict between `["pipelineOperator", { proposal: "hack", topicToken: "#" }]` and `["recordAndtuple", { syntaxType: "hash"}]`.'); - } - } else if (proposal === "smart" && tupleSyntaxIsHash) { - throw new Error('Plugin conflict between `["pipelineOperator", { proposal: "smart" }]` and `["recordAndtuple", { syntaxType: "hash"}]`.'); - } - } - if (hasPlugin(plugins, "moduleAttributes")) { - { - if (hasPlugin(plugins, "importAssertions")) { - throw new Error("Cannot combine importAssertions and moduleAttributes plugins."); - } - const moduleAttributesVersionPluginOption = getPluginOption(plugins, "moduleAttributes", "version"); - if (moduleAttributesVersionPluginOption !== "may-2020") { - throw new Error("The 'moduleAttributes' plugin requires a 'version' option," + " representing the last proposal update. Currently, the" + " only supported value is 'may-2020'."); - } - } - } - if (hasPlugin(plugins, "recordAndTuple") && getPluginOption(plugins, "recordAndTuple", "syntaxType") != null && !RECORD_AND_TUPLE_SYNTAX_TYPES.includes(getPluginOption(plugins, "recordAndTuple", "syntaxType"))) { - throw new Error("The 'syntaxType' option of the 'recordAndTuple' plugin must be one of: " + RECORD_AND_TUPLE_SYNTAX_TYPES.map(p => `'${p}'`).join(", ")); - } - if (hasPlugin(plugins, "asyncDoExpressions") && !hasPlugin(plugins, "doExpressions")) { - const error = new Error("'asyncDoExpressions' requires 'doExpressions', please add 'doExpressions' to parser plugins."); - error.missingPlugins = "doExpressions"; - throw error; - } -} - -const mixinPlugins = { - estree, - jsx, - flow, - typescript, - v8intrinsic, - placeholders -}; -const mixinPluginNames = Object.keys(mixinPlugins); - -const defaultOptions = { - sourceType: "script", - sourceFilename: undefined, - startColumn: 0, - startLine: 1, - allowAwaitOutsideFunction: false, - allowReturnOutsideFunction: false, - allowImportExportEverywhere: false, - allowSuperOutsideMethod: false, - allowUndeclaredExports: false, - plugins: [], - strictMode: null, - ranges: false, - tokens: false, - createParenthesizedExpressions: false, - errorRecovery: false, - attachComment: true -}; - -function getOptions(opts) { - const options = {}; - for (const key of Object.keys(defaultOptions)) { - options[key] = opts && opts[key] != null ? opts[key] : defaultOptions[key]; - } - return options; -} - -const getOwn = (object, key) => Object.hasOwnProperty.call(object, key) && object[key]; -const unwrapParenthesizedExpression = node => { - return node.type === "ParenthesizedExpression" ? unwrapParenthesizedExpression(node.expression) : node; -}; -class LValParser extends NodeUtils { - - toAssignable(node, isLHS = false) { - var _node$extra, _node$extra3; - let parenthesized = undefined; - if (node.type === "ParenthesizedExpression" || (_node$extra = node.extra) != null && _node$extra.parenthesized) { - parenthesized = unwrapParenthesizedExpression(node); - if (isLHS) { - if (parenthesized.type === "Identifier") { - this.expressionScope.recordArrowParemeterBindingError(Errors.InvalidParenthesizedAssignment, { - at: node - }); - } else if (parenthesized.type !== "MemberExpression") { - this.raise(Errors.InvalidParenthesizedAssignment, { - at: node - }); - } - } else { - this.raise(Errors.InvalidParenthesizedAssignment, { - at: node - }); - } - } - switch (node.type) { - case "Identifier": - case "ObjectPattern": - case "ArrayPattern": - case "AssignmentPattern": - case "RestElement": - break; - case "ObjectExpression": - node.type = "ObjectPattern"; - for (let i = 0, length = node.properties.length, last = length - 1; i < length; i++) { - var _node$extra2; - const prop = node.properties[i]; - const isLast = i === last; - this.toAssignableObjectExpressionProp(prop, isLast, isLHS); - if (isLast && prop.type === "RestElement" && (_node$extra2 = node.extra) != null && _node$extra2.trailingCommaLoc) { - this.raise(Errors.RestTrailingComma, { - at: node.extra.trailingCommaLoc - }); - } - } - break; - case "ObjectProperty": - { - const { - key, - value - } = node; - if (this.isPrivateName(key)) { - this.classScope.usePrivateName(this.getPrivateNameSV(key), key.loc.start); - } - this.toAssignable(value, isLHS); - break; - } - case "SpreadElement": - { - throw new Error("Internal @babel/parser error (this is a bug, please report it)." + " SpreadElement should be converted by .toAssignable's caller."); - } - case "ArrayExpression": - node.type = "ArrayPattern"; - this.toAssignableList(node.elements, (_node$extra3 = node.extra) == null ? void 0 : _node$extra3.trailingCommaLoc, isLHS); - break; - case "AssignmentExpression": - if (node.operator !== "=") { - this.raise(Errors.MissingEqInAssignment, { - at: node.left.loc.end - }); - } - node.type = "AssignmentPattern"; - delete node.operator; - this.toAssignable(node.left, isLHS); - break; - case "ParenthesizedExpression": - this.toAssignable(parenthesized, isLHS); - break; - } - } - - toAssignableObjectExpressionProp(prop, isLast, isLHS) { - if (prop.type === "ObjectMethod") { - this.raise(prop.kind === "get" || prop.kind === "set" ? Errors.PatternHasAccessor : Errors.PatternHasMethod, { - at: prop.key - }); - } else if (prop.type === "SpreadElement") { - prop.type = "RestElement"; - const arg = prop.argument; - this.checkToRestConversion(arg, false); - this.toAssignable(arg, isLHS); - if (!isLast) { - this.raise(Errors.RestTrailingComma, { - at: prop - }); - } - } else { - this.toAssignable(prop, isLHS); - } - } - - toAssignableList(exprList, trailingCommaLoc, isLHS) { - const end = exprList.length - 1; - for (let i = 0; i <= end; i++) { - const elt = exprList[i]; - if (!elt) continue; - if (elt.type === "SpreadElement") { - elt.type = "RestElement"; - const arg = elt.argument; - this.checkToRestConversion(arg, true); - this.toAssignable(arg, isLHS); - } else { - this.toAssignable(elt, isLHS); - } - if (elt.type === "RestElement") { - if (i < end) { - this.raise(Errors.RestTrailingComma, { - at: elt - }); - } else if (trailingCommaLoc) { - this.raise(Errors.RestTrailingComma, { - at: trailingCommaLoc - }); - } - } - } - } - isAssignable(node, isBinding) { - switch (node.type) { - case "Identifier": - case "ObjectPattern": - case "ArrayPattern": - case "AssignmentPattern": - case "RestElement": - return true; - case "ObjectExpression": - { - const last = node.properties.length - 1; - return node.properties.every((prop, i) => { - return prop.type !== "ObjectMethod" && (i === last || prop.type !== "SpreadElement") && this.isAssignable(prop); - }); - } - case "ObjectProperty": - return this.isAssignable(node.value); - case "SpreadElement": - return this.isAssignable(node.argument); - case "ArrayExpression": - return node.elements.every(element => element === null || this.isAssignable(element)); - case "AssignmentExpression": - return node.operator === "="; - case "ParenthesizedExpression": - return this.isAssignable(node.expression); - case "MemberExpression": - case "OptionalMemberExpression": - return !isBinding; - default: - return false; - } - } - - toReferencedList(exprList, - isParenthesizedExpr) { - return exprList; - } - toReferencedListDeep(exprList, isParenthesizedExpr) { - this.toReferencedList(exprList, isParenthesizedExpr); - for (const expr of exprList) { - if ((expr == null ? void 0 : expr.type) === "ArrayExpression") { - this.toReferencedListDeep(expr.elements); - } - } - } - - parseSpread(refExpressionErrors) { - const node = this.startNode(); - this.next(); - node.argument = this.parseMaybeAssignAllowIn(refExpressionErrors, undefined); - return this.finishNode(node, "SpreadElement"); - } - - parseRestBinding() { - const node = this.startNode(); - this.next(); - node.argument = this.parseBindingAtom(); - return this.finishNode(node, "RestElement"); - } - - parseBindingAtom() { - switch (this.state.type) { - case 0: - { - const node = this.startNode(); - this.next(); - node.elements = this.parseBindingList(3, 93, true); - return this.finishNode(node, "ArrayPattern"); - } - case 5: - return this.parseObjectLike(8, true); - } - - return this.parseIdentifier(); - } - - parseBindingList(close, closeCharCode, allowEmpty, allowModifiers) { - const elts = []; - let first = true; - while (!this.eat(close)) { - if (first) { - first = false; - } else { - this.expect(12); - } - if (allowEmpty && this.match(12)) { - elts.push(null); - } else if (this.eat(close)) { - break; - } else if (this.match(21)) { - elts.push(this.parseAssignableListItemTypes(this.parseRestBinding())); - if (!this.checkCommaAfterRest(closeCharCode)) { - this.expect(close); - break; - } - } else { - const decorators = []; - if (this.match(26) && this.hasPlugin("decorators")) { - this.raise(Errors.UnsupportedParameterDecorator, { - at: this.state.startLoc - }); - } - while (this.match(26)) { - decorators.push(this.parseDecorator()); - } - elts.push(this.parseAssignableListItem(allowModifiers, decorators)); - } - } - return elts; - } - - parseBindingRestProperty(prop) { - this.next(); - prop.argument = this.parseIdentifier(); - this.checkCommaAfterRest(125); - return this.finishNode(prop, "RestElement"); - } - - parseBindingProperty() { - const prop = this.startNode(); - const { - type, - startLoc - } = this.state; - if (type === 21) { - return this.parseBindingRestProperty(prop); - } else if (type === 136) { - this.expectPlugin("destructuringPrivate", startLoc); - this.classScope.usePrivateName(this.state.value, startLoc); - prop.key = this.parsePrivateName(); - } else { - this.parsePropertyName(prop); - } - prop.method = false; - return this.parseObjPropValue(prop, startLoc, false, false, true, false); - } - - parseAssignableListItem(allowModifiers, decorators) { - const left = this.parseMaybeDefault(); - this.parseAssignableListItemTypes(left); - const elt = this.parseMaybeDefault(left.loc.start, left); - if (decorators.length) { - left.decorators = decorators; - } - return elt; - } - - parseAssignableListItemTypes(param) { - return param; - } - - parseMaybeDefault(startLoc, left) { - var _startLoc, _left; - (_startLoc = startLoc) != null ? _startLoc : startLoc = this.state.startLoc; - left = (_left = left) != null ? _left : this.parseBindingAtom(); - if (!this.eat(29)) return left; - const node = this.startNodeAt(startLoc); - node.left = left; - node.right = this.parseMaybeAssignAllowIn(); - return this.finishNode(node, "AssignmentPattern"); - } - isValidLVal(type, - isUnparenthesizedInAssign, - binding) { - return getOwn({ - AssignmentPattern: "left", - RestElement: "argument", - ObjectProperty: "value", - ParenthesizedExpression: "expression", - ArrayPattern: "elements", - ObjectPattern: "properties" - }, - type); - } - - checkLVal(expression, { - in: ancestor, - binding = BIND_NONE, - checkClashes = false, - strictModeChanged = false, - allowingSloppyLetBinding = !(binding & BIND_SCOPE_LEXICAL), - hasParenthesizedAncestor = false - }) { - var _expression$extra; - const type = expression.type; - - if (this.isObjectMethod(expression)) return; - if (type === "MemberExpression") { - if (binding !== BIND_NONE) { - this.raise(Errors.InvalidPropertyBindingPattern, { - at: expression - }); - } - return; - } - if (expression.type === "Identifier") { - this.checkIdentifier(expression, binding, strictModeChanged, allowingSloppyLetBinding); - const { - name - } = expression; - if (checkClashes) { - if (checkClashes.has(name)) { - this.raise(Errors.ParamDupe, { - at: expression - }); - } else { - checkClashes.add(name); - } - } - return; - } - const validity = this.isValidLVal(expression.type, !(hasParenthesizedAncestor || (_expression$extra = expression.extra) != null && _expression$extra.parenthesized) && ancestor.type === "AssignmentExpression", binding); - if (validity === true) return; - if (validity === false) { - const ParseErrorClass = binding === BIND_NONE ? Errors.InvalidLhs : Errors.InvalidLhsBinding; - this.raise(ParseErrorClass, { - at: expression, - ancestor: ancestor.type === "UpdateExpression" ? { - type: "UpdateExpression", - prefix: ancestor.prefix - } : { - type: ancestor.type - } - }); - return; - } - const [key, isParenthesizedExpression] = Array.isArray(validity) ? validity : [validity, type === "ParenthesizedExpression"]; - const nextAncestor = expression.type === "ArrayPattern" || expression.type === "ObjectPattern" || expression.type === "ParenthesizedExpression" ? expression : ancestor; - - for (const child of [].concat(expression[key])) { - if (child) { - this.checkLVal(child, { - in: nextAncestor, - binding, - checkClashes, - allowingSloppyLetBinding, - strictModeChanged, - hasParenthesizedAncestor: isParenthesizedExpression - }); - } - } - } - checkIdentifier(at, bindingType, strictModeChanged = false, allowLetBinding = !(bindingType & BIND_SCOPE_LEXICAL)) { - if (this.state.strict && (strictModeChanged ? isStrictBindReservedWord(at.name, this.inModule) : isStrictBindOnlyReservedWord(at.name))) { - if (bindingType === BIND_NONE) { - this.raise(Errors.StrictEvalArguments, { - at, - referenceName: at.name - }); - } else { - this.raise(Errors.StrictEvalArgumentsBinding, { - at, - bindingName: at.name - }); - } - } - if (!allowLetBinding && at.name === "let") { - this.raise(Errors.LetInLexicalBinding, { - at - }); - } - if (!(bindingType & BIND_NONE)) { - this.declareNameFromIdentifier(at, bindingType); - } - } - declareNameFromIdentifier(identifier, binding) { - this.scope.declareName(identifier.name, binding, identifier.loc.start); - } - checkToRestConversion(node, allowPattern) { - switch (node.type) { - case "ParenthesizedExpression": - this.checkToRestConversion(node.expression, allowPattern); - break; - case "Identifier": - case "MemberExpression": - break; - case "ArrayExpression": - case "ObjectExpression": - if (allowPattern) break; - default: - this.raise(Errors.InvalidRestAssignmentPattern, { - at: node - }); - } - } - checkCommaAfterRest(close) { - if (!this.match(12)) { - return false; - } - this.raise(this.lookaheadCharCode() === close ? Errors.RestTrailingComma : Errors.ElementAfterRest, { - at: this.state.startLoc - }); - return true; - } -} - -class ExpressionParser extends LValParser { - - checkProto(prop, isRecord, protoRef, refExpressionErrors) { - if (prop.type === "SpreadElement" || this.isObjectMethod(prop) || prop.computed || - prop.shorthand) { - return; - } - const key = prop.key; - const name = key.type === "Identifier" ? key.name : key.value; - if (name === "__proto__") { - if (isRecord) { - this.raise(Errors.RecordNoProto, { - at: key - }); - return; - } - if (protoRef.used) { - if (refExpressionErrors) { - if (refExpressionErrors.doubleProtoLoc === null) { - refExpressionErrors.doubleProtoLoc = key.loc.start; - } - } else { - this.raise(Errors.DuplicateProto, { - at: key - }); - } - } - protoRef.used = true; - } - } - shouldExitDescending(expr, potentialArrowAt) { - return expr.type === "ArrowFunctionExpression" && expr.start === potentialArrowAt; - } - - getExpression() { - this.enterInitialScopes(); - this.nextToken(); - const expr = this.parseExpression(); - if (!this.match(137)) { - this.unexpected(); - } - this.finalizeRemainingComments(); - expr.comments = this.state.comments; - expr.errors = this.state.errors; - if (this.options.tokens) { - expr.tokens = this.tokens; - } - return expr; - } - - parseExpression(disallowIn, refExpressionErrors) { - if (disallowIn) { - return this.disallowInAnd(() => this.parseExpressionBase(refExpressionErrors)); - } - return this.allowInAnd(() => this.parseExpressionBase(refExpressionErrors)); - } - - parseExpressionBase(refExpressionErrors) { - const startLoc = this.state.startLoc; - const expr = this.parseMaybeAssign(refExpressionErrors); - if (this.match(12)) { - const node = this.startNodeAt(startLoc); - node.expressions = [expr]; - while (this.eat(12)) { - node.expressions.push(this.parseMaybeAssign(refExpressionErrors)); - } - this.toReferencedList(node.expressions); - return this.finishNode(node, "SequenceExpression"); - } - return expr; - } - - parseMaybeAssignDisallowIn(refExpressionErrors, afterLeftParse) { - return this.disallowInAnd(() => this.parseMaybeAssign(refExpressionErrors, afterLeftParse)); - } - - parseMaybeAssignAllowIn(refExpressionErrors, afterLeftParse) { - return this.allowInAnd(() => this.parseMaybeAssign(refExpressionErrors, afterLeftParse)); - } - - setOptionalParametersError(refExpressionErrors, resultError) { - var _resultError$loc; - refExpressionErrors.optionalParametersLoc = (_resultError$loc = resultError == null ? void 0 : resultError.loc) != null ? _resultError$loc : this.state.startLoc; - } - - parseMaybeAssign(refExpressionErrors, afterLeftParse) { - const startLoc = this.state.startLoc; - if (this.isContextual(106)) { - if (this.prodParam.hasYield) { - let left = this.parseYield(); - if (afterLeftParse) { - left = afterLeftParse.call(this, left, startLoc); - } - return left; - } - } - let ownExpressionErrors; - if (refExpressionErrors) { - ownExpressionErrors = false; - } else { - refExpressionErrors = new ExpressionErrors(); - ownExpressionErrors = true; - } - const { - type - } = this.state; - if (type === 10 || tokenIsIdentifier(type)) { - this.state.potentialArrowAt = this.state.start; - } - let left = this.parseMaybeConditional(refExpressionErrors); - if (afterLeftParse) { - left = afterLeftParse.call(this, left, startLoc); - } - if (tokenIsAssignment(this.state.type)) { - const node = this.startNodeAt(startLoc); - const operator = this.state.value; - node.operator = operator; - if (this.match(29)) { - this.toAssignable(left, true); - node.left = left; - const startIndex = startLoc.index; - if (refExpressionErrors.doubleProtoLoc != null && refExpressionErrors.doubleProtoLoc.index >= startIndex) { - refExpressionErrors.doubleProtoLoc = null; - } - - if (refExpressionErrors.shorthandAssignLoc != null && refExpressionErrors.shorthandAssignLoc.index >= startIndex) { - refExpressionErrors.shorthandAssignLoc = null; - } - - if (refExpressionErrors.privateKeyLoc != null && refExpressionErrors.privateKeyLoc.index >= startIndex) { - this.checkDestructuringPrivate(refExpressionErrors); - refExpressionErrors.privateKeyLoc = null; - } - } else { - node.left = left; - } - this.next(); - node.right = this.parseMaybeAssign(); - this.checkLVal(left, { - in: this.finishNode(node, "AssignmentExpression") - }); - return node; - } else if (ownExpressionErrors) { - this.checkExpressionErrors(refExpressionErrors, true); - } - return left; - } - - parseMaybeConditional(refExpressionErrors) { - const startLoc = this.state.startLoc; - const potentialArrowAt = this.state.potentialArrowAt; - const expr = this.parseExprOps(refExpressionErrors); - if (this.shouldExitDescending(expr, potentialArrowAt)) { - return expr; - } - return this.parseConditional(expr, startLoc, refExpressionErrors); - } - parseConditional(expr, startLoc, - refExpressionErrors) { - if (this.eat(17)) { - const node = this.startNodeAt(startLoc); - node.test = expr; - node.consequent = this.parseMaybeAssignAllowIn(); - this.expect(14); - node.alternate = this.parseMaybeAssign(); - return this.finishNode(node, "ConditionalExpression"); - } - return expr; - } - parseMaybeUnaryOrPrivate(refExpressionErrors) { - return this.match(136) ? this.parsePrivateName() : this.parseMaybeUnary(refExpressionErrors); - } - - parseExprOps(refExpressionErrors) { - const startLoc = this.state.startLoc; - const potentialArrowAt = this.state.potentialArrowAt; - const expr = this.parseMaybeUnaryOrPrivate(refExpressionErrors); - if (this.shouldExitDescending(expr, potentialArrowAt)) { - return expr; - } - return this.parseExprOp(expr, startLoc, -1); - } - - parseExprOp(left, leftStartLoc, minPrec) { - if (this.isPrivateName(left)) { - - const value = this.getPrivateNameSV(left); - if (minPrec >= tokenOperatorPrecedence(58) || !this.prodParam.hasIn || !this.match(58)) { - this.raise(Errors.PrivateInExpectedIn, { - at: left, - identifierName: value - }); - } - this.classScope.usePrivateName(value, left.loc.start); - } - const op = this.state.type; - if (tokenIsOperator(op) && (this.prodParam.hasIn || !this.match(58))) { - let prec = tokenOperatorPrecedence(op); - if (prec > minPrec) { - if (op === 39) { - this.expectPlugin("pipelineOperator"); - if (this.state.inFSharpPipelineDirectBody) { - return left; - } - this.checkPipelineAtInfixOperator(left, leftStartLoc); - } - const node = this.startNodeAt(leftStartLoc); - node.left = left; - node.operator = this.state.value; - const logical = op === 41 || op === 42; - const coalesce = op === 40; - if (coalesce) { - prec = tokenOperatorPrecedence(42); - } - this.next(); - if (op === 39 && this.hasPlugin(["pipelineOperator", { - proposal: "minimal" - }])) { - if (this.state.type === 96 && this.prodParam.hasAwait) { - throw this.raise(Errors.UnexpectedAwaitAfterPipelineBody, { - at: this.state.startLoc - }); - } - } - node.right = this.parseExprOpRightExpr(op, prec); - const finishedNode = this.finishNode(node, logical || coalesce ? "LogicalExpression" : "BinaryExpression"); - const nextOp = this.state.type; - if (coalesce && (nextOp === 41 || nextOp === 42) || logical && nextOp === 40) { - throw this.raise(Errors.MixingCoalesceWithLogical, { - at: this.state.startLoc - }); - } - return this.parseExprOp(finishedNode, leftStartLoc, minPrec); - } - } - return left; - } - - parseExprOpRightExpr(op, prec) { - const startLoc = this.state.startLoc; - switch (op) { - case 39: - switch (this.getPluginOption("pipelineOperator", "proposal")) { - case "hack": - return this.withTopicBindingContext(() => { - return this.parseHackPipeBody(); - }); - case "smart": - return this.withTopicBindingContext(() => { - if (this.prodParam.hasYield && this.isContextual(106)) { - throw this.raise(Errors.PipeBodyIsTighter, { - at: this.state.startLoc - }); - } - return this.parseSmartPipelineBodyInStyle(this.parseExprOpBaseRightExpr(op, prec), startLoc); - }); - case "fsharp": - return this.withSoloAwaitPermittingContext(() => { - return this.parseFSharpPipelineBody(prec); - }); - } - - default: - return this.parseExprOpBaseRightExpr(op, prec); - } - } - - parseExprOpBaseRightExpr(op, prec) { - const startLoc = this.state.startLoc; - return this.parseExprOp(this.parseMaybeUnaryOrPrivate(), startLoc, tokenIsRightAssociative(op) ? prec - 1 : prec); - } - parseHackPipeBody() { - var _body$extra; - const { - startLoc - } = this.state; - const body = this.parseMaybeAssign(); - const requiredParentheses = UnparenthesizedPipeBodyDescriptions.has( - body.type); - - if (requiredParentheses && !((_body$extra = body.extra) != null && _body$extra.parenthesized)) { - this.raise(Errors.PipeUnparenthesizedBody, { - at: startLoc, - type: body.type - }); - } - if (!this.topicReferenceWasUsedInCurrentContext()) { - this.raise(Errors.PipeTopicUnused, { - at: startLoc - }); - } - return body; - } - checkExponentialAfterUnary(node) { - if (this.match(57)) { - this.raise(Errors.UnexpectedTokenUnaryExponentiation, { - at: node.argument - }); - } - } - - parseMaybeUnary(refExpressionErrors, sawUnary) { - const startLoc = this.state.startLoc; - const isAwait = this.isContextual(96); - if (isAwait && this.isAwaitAllowed()) { - this.next(); - const expr = this.parseAwait(startLoc); - if (!sawUnary) this.checkExponentialAfterUnary(expr); - return expr; - } - const update = this.match(34); - const node = this.startNode(); - if (tokenIsPrefix(this.state.type)) { - node.operator = this.state.value; - node.prefix = true; - if (this.match(72)) { - this.expectPlugin("throwExpressions"); - } - const isDelete = this.match(89); - this.next(); - node.argument = this.parseMaybeUnary(null, true); - this.checkExpressionErrors(refExpressionErrors, true); - if (this.state.strict && isDelete) { - const arg = node.argument; - if (arg.type === "Identifier") { - this.raise(Errors.StrictDelete, { - at: node - }); - } else if (this.hasPropertyAsPrivateName(arg)) { - this.raise(Errors.DeletePrivateField, { - at: node - }); - } - } - if (!update) { - if (!sawUnary) { - this.checkExponentialAfterUnary(node); - } - return this.finishNode(node, "UnaryExpression"); - } - } - const expr = this.parseUpdate( - node, update, refExpressionErrors); - if (isAwait) { - const { - type - } = this.state; - const startsExpr = this.hasPlugin("v8intrinsic") ? tokenCanStartExpression(type) : tokenCanStartExpression(type) && !this.match(54); - if (startsExpr && !this.isAmbiguousAwait()) { - this.raiseOverwrite(Errors.AwaitNotInAsyncContext, { - at: startLoc - }); - return this.parseAwait(startLoc); - } - } - return expr; - } - - parseUpdate(node, update, refExpressionErrors) { - if (update) { - const updateExpressionNode = node; - this.checkLVal(updateExpressionNode.argument, { - in: this.finishNode(updateExpressionNode, "UpdateExpression") - }); - return node; - } - const startLoc = this.state.startLoc; - let expr = this.parseExprSubscripts(refExpressionErrors); - if (this.checkExpressionErrors(refExpressionErrors, false)) return expr; - while (tokenIsPostfix(this.state.type) && !this.canInsertSemicolon()) { - const node = this.startNodeAt(startLoc); - node.operator = this.state.value; - node.prefix = false; - node.argument = expr; - this.next(); - this.checkLVal(expr, { - in: expr = this.finishNode(node, "UpdateExpression") - }); - } - return expr; - } - - parseExprSubscripts(refExpressionErrors) { - const startLoc = this.state.startLoc; - const potentialArrowAt = this.state.potentialArrowAt; - const expr = this.parseExprAtom(refExpressionErrors); - if (this.shouldExitDescending(expr, potentialArrowAt)) { - return expr; - } - return this.parseSubscripts(expr, startLoc); - } - parseSubscripts(base, startLoc, noCalls) { - const state = { - optionalChainMember: false, - maybeAsyncArrow: this.atPossibleAsyncArrow(base), - stop: false - }; - do { - base = this.parseSubscript(base, startLoc, noCalls, state); - - state.maybeAsyncArrow = false; - } while (!state.stop); - return base; - } - - parseSubscript(base, startLoc, noCalls, state) { - const { - type - } = this.state; - if (!noCalls && type === 15) { - return this.parseBind(base, startLoc, noCalls, state); - } else if (tokenIsTemplate(type)) { - return this.parseTaggedTemplateExpression(base, startLoc, state); - } - let optional = false; - if (type === 18) { - if (noCalls && this.lookaheadCharCode() === 40) { - state.stop = true; - return base; - } - state.optionalChainMember = optional = true; - this.next(); - } - if (!noCalls && this.match(10)) { - return this.parseCoverCallAndAsyncArrowHead(base, startLoc, state, optional); - } else { - const computed = this.eat(0); - if (computed || optional || this.eat(16)) { - return this.parseMember(base, startLoc, state, computed, optional); - } else { - state.stop = true; - return base; - } - } - } - - parseMember(base, startLoc, state, computed, optional) { - const node = this.startNodeAt(startLoc); - node.object = base; - node.computed = computed; - if (computed) { - node.property = this.parseExpression(); - this.expect(3); - } else if (this.match(136)) { - if (base.type === "Super") { - this.raise(Errors.SuperPrivateField, { - at: startLoc - }); - } - this.classScope.usePrivateName(this.state.value, this.state.startLoc); - node.property = this.parsePrivateName(); - } else { - node.property = this.parseIdentifier(true); - } - if (state.optionalChainMember) { - node.optional = optional; - return this.finishNode(node, "OptionalMemberExpression"); - } else { - return this.finishNode(node, "MemberExpression"); - } - } - - parseBind(base, startLoc, noCalls, state) { - const node = this.startNodeAt(startLoc); - node.object = base; - this.next(); - node.callee = this.parseNoCallExpr(); - state.stop = true; - return this.parseSubscripts(this.finishNode(node, "BindExpression"), startLoc, noCalls); - } - - parseCoverCallAndAsyncArrowHead(base, startLoc, state, optional) { - const oldMaybeInArrowParameters = this.state.maybeInArrowParameters; - let refExpressionErrors = null; - this.state.maybeInArrowParameters = true; - this.next(); - - const node = this.startNodeAt(startLoc); - node.callee = base; - const { - maybeAsyncArrow, - optionalChainMember - } = state; - if (maybeAsyncArrow) { - this.expressionScope.enter(newAsyncArrowScope()); - refExpressionErrors = new ExpressionErrors(); - } - if (optionalChainMember) { - node.optional = optional; - } - if (optional) { - node.arguments = this.parseCallExpressionArguments(11); - } else { - node.arguments = this.parseCallExpressionArguments(11, base.type === "Import", base.type !== "Super", - node, refExpressionErrors); - } - let finishedNode = this.finishCallExpression(node, optionalChainMember); - if (maybeAsyncArrow && this.shouldParseAsyncArrow() && !optional) { - state.stop = true; - this.checkDestructuringPrivate(refExpressionErrors); - this.expressionScope.validateAsPattern(); - this.expressionScope.exit(); - finishedNode = this.parseAsyncArrowFromCallExpression(this.startNodeAt(startLoc), finishedNode); - } else { - if (maybeAsyncArrow) { - this.checkExpressionErrors(refExpressionErrors, true); - this.expressionScope.exit(); - } - this.toReferencedArguments(finishedNode); - } - this.state.maybeInArrowParameters = oldMaybeInArrowParameters; - return finishedNode; - } - toReferencedArguments(node, isParenthesizedExpr) { - this.toReferencedListDeep(node.arguments, isParenthesizedExpr); - } - - parseTaggedTemplateExpression(base, startLoc, state) { - const node = this.startNodeAt(startLoc); - node.tag = base; - node.quasi = this.parseTemplate(true); - if (state.optionalChainMember) { - this.raise(Errors.OptionalChainingNoTemplate, { - at: startLoc - }); - } - return this.finishNode(node, "TaggedTemplateExpression"); - } - atPossibleAsyncArrow(base) { - return base.type === "Identifier" && base.name === "async" && this.state.lastTokEndLoc.index === base.end && !this.canInsertSemicolon() && - base.end - base.start === 5 && base.start === this.state.potentialArrowAt; - } - finishCallExpression(node, optional) { - if (node.callee.type === "Import") { - if (node.arguments.length === 2) { - { - if (!this.hasPlugin("moduleAttributes")) { - this.expectPlugin("importAssertions"); - } - } - } - if (node.arguments.length === 0 || node.arguments.length > 2) { - this.raise(Errors.ImportCallArity, { - at: node, - maxArgumentCount: this.hasPlugin("importAssertions") || this.hasPlugin("moduleAttributes") ? 2 : 1 - }); - } else { - for (const arg of node.arguments) { - if (arg.type === "SpreadElement") { - this.raise(Errors.ImportCallSpreadArgument, { - at: arg - }); - } - } - } - } - return this.finishNode(node, optional ? "OptionalCallExpression" : "CallExpression"); - } - parseCallExpressionArguments(close, dynamicImport, allowPlaceholder, nodeForExtra, refExpressionErrors) { - const elts = []; - let first = true; - const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody; - this.state.inFSharpPipelineDirectBody = false; - while (!this.eat(close)) { - if (first) { - first = false; - } else { - this.expect(12); - if (this.match(close)) { - if (dynamicImport && !this.hasPlugin("importAssertions") && !this.hasPlugin("moduleAttributes")) { - this.raise(Errors.ImportCallArgumentTrailingComma, { - at: this.state.lastTokStartLoc - }); - } - if (nodeForExtra) { - this.addTrailingCommaExtraToNode(nodeForExtra); - } - this.next(); - break; - } - } - elts.push(this.parseExprListItem(false, refExpressionErrors, allowPlaceholder)); - } - this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody; - return elts; - } - shouldParseAsyncArrow() { - return this.match(19) && !this.canInsertSemicolon(); - } - parseAsyncArrowFromCallExpression(node, call) { - var _call$extra; - this.resetPreviousNodeTrailingComments(call); - this.expect(19); - this.parseArrowExpression(node, call.arguments, true, (_call$extra = call.extra) == null ? void 0 : _call$extra.trailingCommaLoc); - if (call.innerComments) { - setInnerComments(node, call.innerComments); - } - if (call.callee.trailingComments) { - setInnerComments(node, call.callee.trailingComments); - } - return node; - } - - parseNoCallExpr() { - const startLoc = this.state.startLoc; - return this.parseSubscripts(this.parseExprAtom(), startLoc, true); - } - - parseExprAtom(refExpressionErrors) { - let node; - let decorators = null; - const { - type - } = this.state; - switch (type) { - case 79: - return this.parseSuper(); - case 83: - node = this.startNode(); - this.next(); - if (this.match(16)) { - return this.parseImportMetaProperty(node); - } - if (!this.match(10)) { - this.raise(Errors.UnsupportedImport, { - at: this.state.lastTokStartLoc - }); - } - return this.finishNode(node, "Import"); - case 78: - node = this.startNode(); - this.next(); - return this.finishNode(node, "ThisExpression"); - case 90: - { - return this.parseDo(this.startNode(), false); - } - case 56: - case 31: - { - this.readRegexp(); - return this.parseRegExpLiteral(this.state.value); - } - case 132: - return this.parseNumericLiteral(this.state.value); - case 133: - return this.parseBigIntLiteral(this.state.value); - case 134: - return this.parseDecimalLiteral(this.state.value); - case 131: - return this.parseStringLiteral(this.state.value); - case 84: - return this.parseNullLiteral(); - case 85: - return this.parseBooleanLiteral(true); - case 86: - return this.parseBooleanLiteral(false); - case 10: - { - const canBeArrow = this.state.potentialArrowAt === this.state.start; - return this.parseParenAndDistinguishExpression(canBeArrow); - } - case 2: - case 1: - { - return this.parseArrayLike(this.state.type === 2 ? 4 : 3, false, true); - } - case 0: - { - return this.parseArrayLike(3, true, false, refExpressionErrors); - } - case 6: - case 7: - { - return this.parseObjectLike(this.state.type === 6 ? 9 : 8, false, true); - } - case 5: - { - return this.parseObjectLike(8, false, false, refExpressionErrors); - } - case 68: - return this.parseFunctionOrFunctionSent(); - case 26: - decorators = this.parseDecorators(); - case 80: - return this.parseClass(this.maybeTakeDecorators(decorators, this.startNode()), false); - case 77: - return this.parseNewOrNewTarget(); - case 25: - case 24: - return this.parseTemplate(false); - - case 15: - { - node = this.startNode(); - this.next(); - node.object = null; - const callee = node.callee = this.parseNoCallExpr(); - if (callee.type === "MemberExpression") { - return this.finishNode(node, "BindExpression"); - } else { - throw this.raise(Errors.UnsupportedBind, { - at: callee - }); - } - } - case 136: - { - this.raise(Errors.PrivateInExpectedIn, { - at: this.state.startLoc, - identifierName: this.state.value - }); - return this.parsePrivateName(); - } - case 33: - { - return this.parseTopicReferenceThenEqualsSign(54, "%"); - } - case 32: - { - return this.parseTopicReferenceThenEqualsSign(44, "^"); - } - case 37: - case 38: - { - return this.parseTopicReference("hack"); - } - case 44: - case 54: - case 27: - { - const pipeProposal = this.getPluginOption("pipelineOperator", "proposal"); - if (pipeProposal) { - return this.parseTopicReference(pipeProposal); - } else { - throw this.unexpected(); - } - } - case 47: - { - const lookaheadCh = this.input.codePointAt(this.nextTokenStart()); - if (isIdentifierStart(lookaheadCh) || - lookaheadCh === 62) { - this.expectOnePlugin(["jsx", "flow", "typescript"]); - break; - } else { - throw this.unexpected(); - } - } - default: - if (tokenIsIdentifier(type)) { - if (this.isContextual(125) && this.lookaheadCharCode() === 123 && !this.hasFollowingLineBreak()) { - return this.parseModuleExpression(); - } - const canBeArrow = this.state.potentialArrowAt === this.state.start; - const containsEsc = this.state.containsEsc; - const id = this.parseIdentifier(); - if (!containsEsc && id.name === "async" && !this.canInsertSemicolon()) { - const { - type - } = this.state; - if (type === 68) { - this.resetPreviousNodeTrailingComments(id); - this.next(); - return this.parseFunction(this.startNodeAtNode(id), undefined, true); - } else if (tokenIsIdentifier(type)) { - if (this.lookaheadCharCode() === 61) { - return this.parseAsyncArrowUnaryFunction(this.startNodeAtNode(id)); - } else { - return id; - } - } else if (type === 90) { - this.resetPreviousNodeTrailingComments(id); - return this.parseDo(this.startNodeAtNode(id), true); - } - } - if (canBeArrow && this.match(19) && !this.canInsertSemicolon()) { - this.next(); - return this.parseArrowExpression(this.startNodeAtNode(id), [id], false); - } - return id; - } else { - throw this.unexpected(); - } - } - } - - parseTopicReferenceThenEqualsSign(topicTokenType, topicTokenValue) { - const pipeProposal = this.getPluginOption("pipelineOperator", "proposal"); - if (pipeProposal) { - this.state.type = topicTokenType; - this.state.value = topicTokenValue; - this.state.pos--; - this.state.end--; - this.state.endLoc = createPositionWithColumnOffset(this.state.endLoc, -1); - return this.parseTopicReference(pipeProposal); - } else { - throw this.unexpected(); - } - } - - parseTopicReference(pipeProposal) { - const node = this.startNode(); - const startLoc = this.state.startLoc; - const tokenType = this.state.type; - - this.next(); - - return this.finishTopicReference(node, startLoc, pipeProposal, tokenType); - } - - finishTopicReference(node, startLoc, pipeProposal, tokenType) { - if (this.testTopicReferenceConfiguration(pipeProposal, startLoc, tokenType)) { - - const nodeType = pipeProposal === "smart" ? "PipelinePrimaryTopicReference" : - "TopicReference"; - if (!this.topicReferenceIsAllowedInCurrentContext()) { - this.raise( - pipeProposal === "smart" ? Errors.PrimaryTopicNotAllowed : - Errors.PipeTopicUnbound, { - at: startLoc - }); - } - - this.registerTopicReference(); - return this.finishNode(node, nodeType); - } else { - throw this.raise(Errors.PipeTopicUnconfiguredToken, { - at: startLoc, - token: tokenLabelName(tokenType) - }); - } - } - - testTopicReferenceConfiguration(pipeProposal, startLoc, tokenType) { - switch (pipeProposal) { - case "hack": - { - return this.hasPlugin(["pipelineOperator", { - topicToken: tokenLabelName(tokenType) - }]); - } - case "smart": - return tokenType === 27; - default: - throw this.raise(Errors.PipeTopicRequiresHackPipes, { - at: startLoc - }); - } - } - - parseAsyncArrowUnaryFunction(node) { - this.prodParam.enter(functionFlags(true, this.prodParam.hasYield)); - const params = [this.parseIdentifier()]; - this.prodParam.exit(); - if (this.hasPrecedingLineBreak()) { - this.raise(Errors.LineTerminatorBeforeArrow, { - at: this.state.curPosition() - }); - } - this.expect(19); - return this.parseArrowExpression(node, params, true); - } - - parseDo(node, isAsync) { - this.expectPlugin("doExpressions"); - if (isAsync) { - this.expectPlugin("asyncDoExpressions"); - } - node.async = isAsync; - this.next(); - const oldLabels = this.state.labels; - this.state.labels = []; - if (isAsync) { - this.prodParam.enter(PARAM_AWAIT); - node.body = this.parseBlock(); - this.prodParam.exit(); - } else { - node.body = this.parseBlock(); - } - this.state.labels = oldLabels; - return this.finishNode(node, "DoExpression"); - } - - parseSuper() { - const node = this.startNode(); - this.next(); - if (this.match(10) && !this.scope.allowDirectSuper && !this.options.allowSuperOutsideMethod) { - this.raise(Errors.SuperNotAllowed, { - at: node - }); - } else if (!this.scope.allowSuper && !this.options.allowSuperOutsideMethod) { - this.raise(Errors.UnexpectedSuper, { - at: node - }); - } - if (!this.match(10) && !this.match(0) && !this.match(16)) { - this.raise(Errors.UnsupportedSuper, { - at: node - }); - } - return this.finishNode(node, "Super"); - } - parsePrivateName() { - const node = this.startNode(); - const id = this.startNodeAt( - createPositionWithColumnOffset(this.state.startLoc, 1)); - const name = this.state.value; - this.next(); - node.id = this.createIdentifier(id, name); - return this.finishNode(node, "PrivateName"); - } - parseFunctionOrFunctionSent() { - const node = this.startNode(); - - this.next(); - - if (this.prodParam.hasYield && this.match(16)) { - const meta = this.createIdentifier(this.startNodeAtNode(node), "function"); - this.next(); - if (this.match(102)) { - this.expectPlugin("functionSent"); - } else if (!this.hasPlugin("functionSent")) { - this.unexpected(); - } - return this.parseMetaProperty(node, meta, "sent"); - } - return this.parseFunction(node); - } - parseMetaProperty(node, meta, propertyName) { - node.meta = meta; - const containsEsc = this.state.containsEsc; - node.property = this.parseIdentifier(true); - if (node.property.name !== propertyName || containsEsc) { - this.raise(Errors.UnsupportedMetaProperty, { - at: node.property, - target: meta.name, - onlyValidPropertyName: propertyName - }); - } - return this.finishNode(node, "MetaProperty"); - } - - parseImportMetaProperty(node) { - const id = this.createIdentifier(this.startNodeAtNode(node), "import"); - this.next(); - - if (this.isContextual(100)) { - if (!this.inModule) { - this.raise(Errors.ImportMetaOutsideModule, { - at: id - }); - } - this.sawUnambiguousESM = true; - } - return this.parseMetaProperty(node, id, "meta"); - } - parseLiteralAtNode(value, type, node) { - this.addExtra(node, "rawValue", value); - this.addExtra(node, "raw", this.input.slice(node.start, this.state.end)); - node.value = value; - this.next(); - return this.finishNode(node, type); - } - parseLiteral(value, type) { - const node = this.startNode(); - return this.parseLiteralAtNode(value, type, node); - } - parseStringLiteral(value) { - return this.parseLiteral(value, "StringLiteral"); - } - parseNumericLiteral(value) { - return this.parseLiteral(value, "NumericLiteral"); - } - parseBigIntLiteral(value) { - return this.parseLiteral(value, "BigIntLiteral"); - } - parseDecimalLiteral(value) { - return this.parseLiteral(value, "DecimalLiteral"); - } - parseRegExpLiteral(value) { - const node = this.parseLiteral(value.value, "RegExpLiteral"); - node.pattern = value.pattern; - node.flags = value.flags; - return node; - } - parseBooleanLiteral(value) { - const node = this.startNode(); - node.value = value; - this.next(); - return this.finishNode(node, "BooleanLiteral"); - } - parseNullLiteral() { - const node = this.startNode(); - this.next(); - return this.finishNode(node, "NullLiteral"); - } - - parseParenAndDistinguishExpression(canBeArrow) { - const startLoc = this.state.startLoc; - let val; - this.next(); - this.expressionScope.enter(newArrowHeadScope()); - const oldMaybeInArrowParameters = this.state.maybeInArrowParameters; - const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody; - this.state.maybeInArrowParameters = true; - this.state.inFSharpPipelineDirectBody = false; - const innerStartLoc = this.state.startLoc; - const exprList = []; - const refExpressionErrors = new ExpressionErrors(); - let first = true; - let spreadStartLoc; - let optionalCommaStartLoc; - while (!this.match(11)) { - if (first) { - first = false; - } else { - this.expect(12, refExpressionErrors.optionalParametersLoc === null ? null : refExpressionErrors.optionalParametersLoc); - if (this.match(11)) { - optionalCommaStartLoc = this.state.startLoc; - break; - } - } - if (this.match(21)) { - const spreadNodeStartLoc = this.state.startLoc; - spreadStartLoc = this.state.startLoc; - exprList.push(this.parseParenItem(this.parseRestBinding(), spreadNodeStartLoc)); - if (!this.checkCommaAfterRest(41)) { - break; - } - } else { - exprList.push(this.parseMaybeAssignAllowIn(refExpressionErrors, this.parseParenItem)); - } - } - const innerEndLoc = this.state.lastTokEndLoc; - this.expect(11); - this.state.maybeInArrowParameters = oldMaybeInArrowParameters; - this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody; - let arrowNode = this.startNodeAt(startLoc); - if (canBeArrow && this.shouldParseArrow(exprList) && (arrowNode = this.parseArrow(arrowNode))) { - this.checkDestructuringPrivate(refExpressionErrors); - this.expressionScope.validateAsPattern(); - this.expressionScope.exit(); - this.parseArrowExpression(arrowNode, exprList, false); - return arrowNode; - } - this.expressionScope.exit(); - if (!exprList.length) { - this.unexpected(this.state.lastTokStartLoc); - } - if (optionalCommaStartLoc) this.unexpected(optionalCommaStartLoc); - if (spreadStartLoc) this.unexpected(spreadStartLoc); - this.checkExpressionErrors(refExpressionErrors, true); - this.toReferencedListDeep(exprList, true); - if (exprList.length > 1) { - val = this.startNodeAt(innerStartLoc); - val.expressions = exprList; - this.finishNode(val, "SequenceExpression"); - this.resetEndLocation(val, innerEndLoc); - } else { - val = exprList[0]; - } - return this.wrapParenthesis(startLoc, - val); - } - wrapParenthesis(startLoc, expression) { - if (!this.options.createParenthesizedExpressions) { - this.addExtra(expression, "parenthesized", true); - this.addExtra(expression, "parenStart", startLoc.index); - this.takeSurroundingComments(expression, startLoc.index, this.state.lastTokEndLoc.index); - return expression; - } - const parenExpression = this.startNodeAt(startLoc); - parenExpression.expression = expression; - return this.finishNode(parenExpression, "ParenthesizedExpression"); - } - - shouldParseArrow(params) { - return !this.canInsertSemicolon(); - } - parseArrow(node) { - if (this.eat(19)) { - return node; - } - } - parseParenItem(node, - startLoc) { - return node; - } - parseNewOrNewTarget() { - const node = this.startNode(); - this.next(); - if (this.match(16)) { - const meta = this.createIdentifier(this.startNodeAtNode(node), "new"); - this.next(); - const metaProp = this.parseMetaProperty(node, meta, "target"); - if (!this.scope.inNonArrowFunction && !this.scope.inClass) { - this.raise(Errors.UnexpectedNewTarget, { - at: metaProp - }); - } - return metaProp; - } - return this.parseNew(node); - } - - parseNew(node) { - this.parseNewCallee(node); - if (this.eat(10)) { - const args = this.parseExprList(11); - this.toReferencedList(args); - node.arguments = args; - } else { - node.arguments = []; - } - return this.finishNode(node, "NewExpression"); - } - parseNewCallee(node) { - node.callee = this.parseNoCallExpr(); - if (node.callee.type === "Import") { - this.raise(Errors.ImportCallNotNewExpression, { - at: node.callee - }); - } else if (this.isOptionalChain(node.callee)) { - this.raise(Errors.OptionalChainingNoNew, { - at: this.state.lastTokEndLoc - }); - } else if (this.eat(18)) { - this.raise(Errors.OptionalChainingNoNew, { - at: this.state.startLoc - }); - } - } - - parseTemplateElement(isTagged) { - const { - start, - startLoc, - end, - value - } = this.state; - const elemStart = start + 1; - const elem = this.startNodeAt(createPositionWithColumnOffset(startLoc, 1)); - if (value === null) { - if (!isTagged) { - this.raise(Errors.InvalidEscapeSequenceTemplate, { - at: createPositionWithColumnOffset(this.state.firstInvalidTemplateEscapePos, 1) - }); - } - } - const isTail = this.match(24); - const endOffset = isTail ? -1 : -2; - const elemEnd = end + endOffset; - elem.value = { - raw: this.input.slice(elemStart, elemEnd).replace(/\r\n?/g, "\n"), - cooked: value === null ? null : value.slice(1, endOffset) - }; - elem.tail = isTail; - this.next(); - const finishedNode = this.finishNode(elem, "TemplateElement"); - this.resetEndLocation(finishedNode, createPositionWithColumnOffset(this.state.lastTokEndLoc, endOffset)); - return finishedNode; - } - - parseTemplate(isTagged) { - const node = this.startNode(); - node.expressions = []; - let curElt = this.parseTemplateElement(isTagged); - node.quasis = [curElt]; - while (!curElt.tail) { - node.expressions.push(this.parseTemplateSubstitution()); - this.readTemplateContinuation(); - node.quasis.push(curElt = this.parseTemplateElement(isTagged)); - } - return this.finishNode(node, "TemplateLiteral"); - } - - parseTemplateSubstitution() { - return this.parseExpression(); - } - - parseObjectLike(close, isPattern, isRecord, refExpressionErrors) { - if (isRecord) { - this.expectPlugin("recordAndTuple"); - } - const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody; - this.state.inFSharpPipelineDirectBody = false; - const propHash = Object.create(null); - let first = true; - const node = this.startNode(); - node.properties = []; - this.next(); - while (!this.match(close)) { - if (first) { - first = false; - } else { - this.expect(12); - if (this.match(close)) { - this.addTrailingCommaExtraToNode( - node); - break; - } - } - let prop; - if (isPattern) { - prop = this.parseBindingProperty(); - } else { - prop = this.parsePropertyDefinition(refExpressionErrors); - this.checkProto(prop, isRecord, propHash, refExpressionErrors); - } - if (isRecord && !this.isObjectProperty(prop) && prop.type !== "SpreadElement") { - this.raise(Errors.InvalidRecordProperty, { - at: prop - }); - } - - if (prop.shorthand) { - this.addExtra(prop, "shorthand", true); - } - - node.properties.push(prop); - } - this.next(); - this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody; - let type = "ObjectExpression"; - if (isPattern) { - type = "ObjectPattern"; - } else if (isRecord) { - type = "RecordExpression"; - } - return this.finishNode(node, type); - } - addTrailingCommaExtraToNode(node) { - this.addExtra(node, "trailingComma", this.state.lastTokStart); - this.addExtra(node, "trailingCommaLoc", this.state.lastTokStartLoc, false); - } - - maybeAsyncOrAccessorProp(prop) { - return !prop.computed && prop.key.type === "Identifier" && (this.isLiteralPropertyName() || this.match(0) || this.match(55)); - } - - parsePropertyDefinition(refExpressionErrors) { - let decorators = []; - if (this.match(26)) { - if (this.hasPlugin("decorators")) { - this.raise(Errors.UnsupportedPropertyDecorator, { - at: this.state.startLoc - }); - } - - while (this.match(26)) { - decorators.push(this.parseDecorator()); - } - } - const prop = this.startNode(); - let isAsync = false; - let isAccessor = false; - let startLoc; - if (this.match(21)) { - if (decorators.length) this.unexpected(); - return this.parseSpread(); - } - if (decorators.length) { - prop.decorators = decorators; - decorators = []; - } - prop.method = false; - if (refExpressionErrors) { - startLoc = this.state.startLoc; - } - let isGenerator = this.eat(55); - this.parsePropertyNamePrefixOperator(prop); - const containsEsc = this.state.containsEsc; - const key = this.parsePropertyName(prop, refExpressionErrors); - if (!isGenerator && !containsEsc && this.maybeAsyncOrAccessorProp(prop)) { - const keyName = key.name; - if (keyName === "async" && !this.hasPrecedingLineBreak()) { - isAsync = true; - this.resetPreviousNodeTrailingComments(key); - isGenerator = this.eat(55); - this.parsePropertyName(prop); - } - if (keyName === "get" || keyName === "set") { - isAccessor = true; - this.resetPreviousNodeTrailingComments(key); - prop.kind = keyName; - if (this.match(55)) { - isGenerator = true; - this.raise(Errors.AccessorIsGenerator, { - at: this.state.curPosition(), - kind: keyName - }); - this.next(); - } - this.parsePropertyName(prop); - } - } - return this.parseObjPropValue(prop, startLoc, isGenerator, isAsync, false, isAccessor, refExpressionErrors); - } - getGetterSetterExpectedParamCount(method) { - return method.kind === "get" ? 0 : 1; - } - - getObjectOrClassMethodParams(method) { - return method.params; - } - - checkGetterSetterParams(method) { - var _params; - const paramCount = this.getGetterSetterExpectedParamCount(method); - const params = this.getObjectOrClassMethodParams(method); - if (params.length !== paramCount) { - this.raise(method.kind === "get" ? Errors.BadGetterArity : Errors.BadSetterArity, { - at: method - }); - } - if (method.kind === "set" && ((_params = params[params.length - 1]) == null ? void 0 : _params.type) === "RestElement") { - this.raise(Errors.BadSetterRestParameter, { - at: method - }); - } - } - - parseObjectMethod(prop, isGenerator, isAsync, isPattern, isAccessor) { - if (isAccessor) { - const finishedProp = this.parseMethod(prop, - isGenerator, false, false, false, "ObjectMethod"); - this.checkGetterSetterParams(finishedProp); - return finishedProp; - } - if (isAsync || isGenerator || this.match(10)) { - if (isPattern) this.unexpected(); - prop.kind = "method"; - prop.method = true; - return this.parseMethod(prop, isGenerator, isAsync, false, false, "ObjectMethod"); - } - } - - parseObjectProperty(prop, startLoc, isPattern, refExpressionErrors) { - prop.shorthand = false; - if (this.eat(14)) { - prop.value = isPattern ? this.parseMaybeDefault(this.state.startLoc) : this.parseMaybeAssignAllowIn(refExpressionErrors); - return this.finishNode(prop, "ObjectProperty"); - } - if (!prop.computed && prop.key.type === "Identifier") { - this.checkReservedWord(prop.key.name, prop.key.loc.start, true, false); - if (isPattern) { - prop.value = this.parseMaybeDefault(startLoc, cloneIdentifier(prop.key)); - } else if (this.match(29)) { - const shorthandAssignLoc = this.state.startLoc; - if (refExpressionErrors != null) { - if (refExpressionErrors.shorthandAssignLoc === null) { - refExpressionErrors.shorthandAssignLoc = shorthandAssignLoc; - } - } else { - this.raise(Errors.InvalidCoverInitializedName, { - at: shorthandAssignLoc - }); - } - prop.value = this.parseMaybeDefault(startLoc, cloneIdentifier(prop.key)); - } else { - prop.value = cloneIdentifier(prop.key); - } - prop.shorthand = true; - return this.finishNode(prop, "ObjectProperty"); - } - } - parseObjPropValue(prop, startLoc, isGenerator, isAsync, isPattern, isAccessor, refExpressionErrors) { - const node = this.parseObjectMethod(prop, isGenerator, isAsync, isPattern, isAccessor) || this.parseObjectProperty(prop, startLoc, isPattern, refExpressionErrors); - if (!node) this.unexpected(); - return node; - } - - parsePropertyName(prop, refExpressionErrors) { - if (this.eat(0)) { - prop.computed = true; - prop.key = this.parseMaybeAssignAllowIn(); - this.expect(3); - } else { - const { - type, - value - } = this.state; - let key; - if (tokenIsKeywordOrIdentifier(type)) { - key = this.parseIdentifier(true); - } else { - switch (type) { - case 132: - key = this.parseNumericLiteral(value); - break; - case 131: - key = this.parseStringLiteral(value); - break; - case 133: - key = this.parseBigIntLiteral(value); - break; - case 134: - key = this.parseDecimalLiteral(value); - break; - case 136: - { - const privateKeyLoc = this.state.startLoc; - if (refExpressionErrors != null) { - if (refExpressionErrors.privateKeyLoc === null) { - refExpressionErrors.privateKeyLoc = privateKeyLoc; - } - } else { - this.raise(Errors.UnexpectedPrivateField, { - at: privateKeyLoc - }); - } - key = this.parsePrivateName(); - break; - } - default: - throw this.unexpected(); - } - } - prop.key = key; - if (type !== 136) { - prop.computed = false; - } - } - return prop.key; - } - - initFunction(node, isAsync) { - node.id = null; - node.generator = false; - node.async = !!isAsync; - } - - parseMethod(node, isGenerator, isAsync, isConstructor, allowDirectSuper, type, inClassScope = false) { - this.initFunction(node, isAsync); - node.generator = !!isGenerator; - const allowModifiers = isConstructor; - this.scope.enter(SCOPE_FUNCTION | SCOPE_SUPER | (inClassScope ? SCOPE_CLASS : 0) | (allowDirectSuper ? SCOPE_DIRECT_SUPER : 0)); - this.prodParam.enter(functionFlags(isAsync, node.generator)); - this.parseFunctionParams(node, allowModifiers); - const finishedNode = this.parseFunctionBodyAndFinish(node, type, true); - this.prodParam.exit(); - this.scope.exit(); - return finishedNode; - } - - parseArrayLike(close, canBePattern, isTuple, refExpressionErrors) { - if (isTuple) { - this.expectPlugin("recordAndTuple"); - } - const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody; - this.state.inFSharpPipelineDirectBody = false; - const node = this.startNode(); - this.next(); - node.elements = this.parseExprList(close, !isTuple, refExpressionErrors, - node); - this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody; - return this.finishNode(node, isTuple ? "TupleExpression" : "ArrayExpression"); - } - - parseArrowExpression(node, params, isAsync, trailingCommaLoc) { - this.scope.enter(SCOPE_FUNCTION | SCOPE_ARROW); - let flags = functionFlags(isAsync, false); - if (!this.match(5) && this.prodParam.hasIn) { - flags |= PARAM_IN; - } - this.prodParam.enter(flags); - this.initFunction(node, isAsync); - const oldMaybeInArrowParameters = this.state.maybeInArrowParameters; - if (params) { - this.state.maybeInArrowParameters = true; - this.setArrowFunctionParameters(node, params, trailingCommaLoc); - } - this.state.maybeInArrowParameters = false; - this.parseFunctionBody(node, true); - this.prodParam.exit(); - this.scope.exit(); - this.state.maybeInArrowParameters = oldMaybeInArrowParameters; - return this.finishNode(node, "ArrowFunctionExpression"); - } - setArrowFunctionParameters(node, params, trailingCommaLoc) { - this.toAssignableList(params, trailingCommaLoc, false); - node.params = params; - } - parseFunctionBodyAndFinish(node, type, isMethod = false) { - this.parseFunctionBody(node, false, isMethod); - return this.finishNode(node, type); - } - - parseFunctionBody(node, allowExpression, isMethod = false) { - const isExpression = allowExpression && !this.match(5); - this.expressionScope.enter(newExpressionScope()); - if (isExpression) { - node.body = this.parseMaybeAssign(); - this.checkParams(node, false, allowExpression, false); - } else { - const oldStrict = this.state.strict; - const oldLabels = this.state.labels; - this.state.labels = []; - - this.prodParam.enter(this.prodParam.currentFlags() | PARAM_RETURN); - node.body = this.parseBlock(true, false, - hasStrictModeDirective => { - const nonSimple = !this.isSimpleParamList(node.params); - if (hasStrictModeDirective && nonSimple) { - this.raise(Errors.IllegalLanguageModeDirective, { - at: - (node.kind === "method" || node.kind === "constructor") && - !!node.key ? - node.key.loc.end : node - }); - } - const strictModeChanged = !oldStrict && this.state.strict; - - this.checkParams(node, !this.state.strict && !allowExpression && !isMethod && !nonSimple, allowExpression, strictModeChanged); - - if (this.state.strict && node.id) { - this.checkIdentifier(node.id, BIND_OUTSIDE, strictModeChanged); - } - }); - this.prodParam.exit(); - this.state.labels = oldLabels; - } - this.expressionScope.exit(); - } - isSimpleParameter(node) { - return node.type === "Identifier"; - } - isSimpleParamList(params) { - for (let i = 0, len = params.length; i < len; i++) { - if (!this.isSimpleParameter(params[i])) return false; - } - return true; - } - checkParams(node, allowDuplicates, - isArrowFunction, strictModeChanged = true) { - const checkClashes = !allowDuplicates && new Set(); - const formalParameters = { - type: "FormalParameters" - }; - for (const param of node.params) { - this.checkLVal(param, { - in: formalParameters, - binding: BIND_VAR, - checkClashes, - strictModeChanged - }); - } - } - - parseExprList(close, allowEmpty, refExpressionErrors, nodeForExtra) { - const elts = []; - let first = true; - while (!this.eat(close)) { - if (first) { - first = false; - } else { - this.expect(12); - if (this.match(close)) { - if (nodeForExtra) { - this.addTrailingCommaExtraToNode(nodeForExtra); - } - this.next(); - break; - } - } - elts.push(this.parseExprListItem(allowEmpty, refExpressionErrors)); - } - return elts; - } - parseExprListItem(allowEmpty, refExpressionErrors, allowPlaceholder) { - let elt; - if (this.match(12)) { - if (!allowEmpty) { - this.raise(Errors.UnexpectedToken, { - at: this.state.curPosition(), - unexpected: "," - }); - } - elt = null; - } else if (this.match(21)) { - const spreadNodeStartLoc = this.state.startLoc; - elt = this.parseParenItem(this.parseSpread(refExpressionErrors), spreadNodeStartLoc); - } else if (this.match(17)) { - this.expectPlugin("partialApplication"); - if (!allowPlaceholder) { - this.raise(Errors.UnexpectedArgumentPlaceholder, { - at: this.state.startLoc - }); - } - const node = this.startNode(); - this.next(); - elt = this.finishNode(node, "ArgumentPlaceholder"); - } else { - elt = this.parseMaybeAssignAllowIn(refExpressionErrors, this.parseParenItem); - } - return elt; - } - - parseIdentifier(liberal) { - const node = this.startNode(); - const name = this.parseIdentifierName(liberal); - return this.createIdentifier(node, name); - } - createIdentifier(node, name) { - node.name = name; - node.loc.identifierName = name; - return this.finishNode(node, "Identifier"); - } - parseIdentifierName(liberal) { - let name; - const { - startLoc, - type - } = this.state; - if (tokenIsKeywordOrIdentifier(type)) { - name = this.state.value; - } else { - throw this.unexpected(); - } - const tokenIsKeyword = tokenKeywordOrIdentifierIsKeyword(type); - if (liberal) { - if (tokenIsKeyword) { - this.replaceToken(130); - } - } else { - this.checkReservedWord(name, startLoc, tokenIsKeyword, false); - } - this.next(); - return name; - } - checkReservedWord(word, startLoc, checkKeywords, isBinding) { - if (word.length > 10) { - return; - } - if (!canBeReservedWord(word)) { - return; - } - if (word === "yield") { - if (this.prodParam.hasYield) { - this.raise(Errors.YieldBindingIdentifier, { - at: startLoc - }); - return; - } - } else if (word === "await") { - if (this.prodParam.hasAwait) { - this.raise(Errors.AwaitBindingIdentifier, { - at: startLoc - }); - return; - } - if (this.scope.inStaticBlock) { - this.raise(Errors.AwaitBindingIdentifierInStaticBlock, { - at: startLoc - }); - return; - } - this.expressionScope.recordAsyncArrowParametersError({ - at: startLoc - }); - } else if (word === "arguments") { - if (this.scope.inClassAndNotInNonArrowFunction) { - this.raise(Errors.ArgumentsInClass, { - at: startLoc - }); - return; - } - } - if (checkKeywords && isKeyword(word)) { - this.raise(Errors.UnexpectedKeyword, { - at: startLoc, - keyword: word - }); - return; - } - const reservedTest = !this.state.strict ? isReservedWord : isBinding ? isStrictBindReservedWord : isStrictReservedWord; - if (reservedTest(word, this.inModule)) { - this.raise(Errors.UnexpectedReservedWord, { - at: startLoc, - reservedWord: word - }); - } - } - isAwaitAllowed() { - if (this.prodParam.hasAwait) return true; - if (this.options.allowAwaitOutsideFunction && !this.scope.inFunction) { - return true; - } - return false; - } - - parseAwait(startLoc) { - const node = this.startNodeAt(startLoc); - this.expressionScope.recordParameterInitializerError(Errors.AwaitExpressionFormalParameter, { - at: node - }); - if (this.eat(55)) { - this.raise(Errors.ObsoleteAwaitStar, { - at: node - }); - } - if (!this.scope.inFunction && !this.options.allowAwaitOutsideFunction) { - if (this.isAmbiguousAwait()) { - this.ambiguousScriptDifferentAst = true; - } else { - this.sawUnambiguousESM = true; - } - } - if (!this.state.soloAwait) { - node.argument = this.parseMaybeUnary(null, true); - } - return this.finishNode(node, "AwaitExpression"); - } - isAmbiguousAwait() { - if (this.hasPrecedingLineBreak()) return true; - const { - type - } = this.state; - return ( - type === 53 || type === 10 || type === 0 || tokenIsTemplate(type) || type === 101 && !this.state.containsEsc || - type === 135 || type === 56 || - this.hasPlugin("v8intrinsic") && type === 54 - ); - } - - parseYield() { - const node = this.startNode(); - this.expressionScope.recordParameterInitializerError(Errors.YieldInParameter, { - at: node - }); - this.next(); - let delegating = false; - let argument = null; - if (!this.hasPrecedingLineBreak()) { - delegating = this.eat(55); - switch (this.state.type) { - case 13: - case 137: - case 8: - case 11: - case 3: - case 9: - case 14: - case 12: - if (!delegating) break; - default: - argument = this.parseMaybeAssign(); - } - } - node.delegate = delegating; - node.argument = argument; - return this.finishNode(node, "YieldExpression"); - } - - checkPipelineAtInfixOperator(left, leftStartLoc) { - if (this.hasPlugin(["pipelineOperator", { - proposal: "smart" - }])) { - if (left.type === "SequenceExpression") { - this.raise(Errors.PipelineHeadSequenceExpression, { - at: leftStartLoc - }); - } - } - } - parseSmartPipelineBodyInStyle(childExpr, startLoc) { - if (this.isSimpleReference(childExpr)) { - const bodyNode = this.startNodeAt(startLoc); - bodyNode.callee = childExpr; - return this.finishNode(bodyNode, "PipelineBareFunction"); - } else { - const bodyNode = this.startNodeAt(startLoc); - this.checkSmartPipeTopicBodyEarlyErrors(startLoc); - bodyNode.expression = childExpr; - return this.finishNode(bodyNode, "PipelineTopicExpression"); - } - } - isSimpleReference(expression) { - switch (expression.type) { - case "MemberExpression": - return !expression.computed && this.isSimpleReference(expression.object); - case "Identifier": - return true; - default: - return false; - } - } - - checkSmartPipeTopicBodyEarlyErrors(startLoc) { - if (this.match(19)) { - throw this.raise(Errors.PipelineBodyNoArrow, { - at: this.state.startLoc - }); - } - - if (!this.topicReferenceWasUsedInCurrentContext()) { - this.raise(Errors.PipelineTopicUnused, { - at: startLoc - }); - } - } - - withTopicBindingContext(callback) { - const outerContextTopicState = this.state.topicContext; - this.state.topicContext = { - maxNumOfResolvableTopics: 1, - maxTopicIndex: null - }; - try { - return callback(); - } finally { - this.state.topicContext = outerContextTopicState; - } - } - - withSmartMixTopicForbiddingContext(callback) { - if (this.hasPlugin(["pipelineOperator", { - proposal: "smart" - }])) { - const outerContextTopicState = this.state.topicContext; - this.state.topicContext = { - maxNumOfResolvableTopics: 0, - maxTopicIndex: null - }; - try { - return callback(); - } finally { - this.state.topicContext = outerContextTopicState; - } - } else { - return callback(); - } - } - withSoloAwaitPermittingContext(callback) { - const outerContextSoloAwaitState = this.state.soloAwait; - this.state.soloAwait = true; - try { - return callback(); - } finally { - this.state.soloAwait = outerContextSoloAwaitState; - } - } - allowInAnd(callback) { - const flags = this.prodParam.currentFlags(); - const prodParamToSet = PARAM_IN & ~flags; - if (prodParamToSet) { - this.prodParam.enter(flags | PARAM_IN); - try { - return callback(); - } finally { - this.prodParam.exit(); - } - } - return callback(); - } - disallowInAnd(callback) { - const flags = this.prodParam.currentFlags(); - const prodParamToClear = PARAM_IN & flags; - if (prodParamToClear) { - this.prodParam.enter(flags & ~PARAM_IN); - try { - return callback(); - } finally { - this.prodParam.exit(); - } - } - return callback(); - } - - registerTopicReference() { - this.state.topicContext.maxTopicIndex = 0; - } - topicReferenceIsAllowedInCurrentContext() { - return this.state.topicContext.maxNumOfResolvableTopics >= 1; - } - topicReferenceWasUsedInCurrentContext() { - return this.state.topicContext.maxTopicIndex != null && this.state.topicContext.maxTopicIndex >= 0; - } - parseFSharpPipelineBody(prec) { - const startLoc = this.state.startLoc; - this.state.potentialArrowAt = this.state.start; - const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody; - this.state.inFSharpPipelineDirectBody = true; - const ret = this.parseExprOp(this.parseMaybeUnaryOrPrivate(), startLoc, prec); - this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody; - return ret; - } - - parseModuleExpression() { - this.expectPlugin("moduleBlocks"); - const node = this.startNode(); - this.next(); - if (!this.match(5)) { - this.unexpected(null, 5); - } - const program = this.startNodeAt(this.state.endLoc); - this.next(); - - const revertScopes = this.initializeScopes(true); - this.enterInitialScopes(); - try { - node.body = this.parseProgram(program, 8, "module"); - } finally { - revertScopes(); - } - return this.finishNode(node, "ModuleExpression"); - } - - parsePropertyNamePrefixOperator( - prop) {} -} - -const loopLabel = { - kind: "loop" - }, - switchLabel = { - kind: "switch" - }; -const FUNC_NO_FLAGS = 0b000, - FUNC_STATEMENT = 0b001, - FUNC_HANGING_STATEMENT = 0b010, - FUNC_NULLABLE_ID = 0b100; -const loneSurrogate = /[\uD800-\uDFFF]/u; -const keywordRelationalOperator = /in(?:stanceof)?/y; - -function babel7CompatTokens(tokens, input) { - for (let i = 0; i < tokens.length; i++) { - const token = tokens[i]; - const { - type - } = token; - if (typeof type === "number") { - { - if (type === 136) { - const { - loc, - start, - value, - end - } = token; - const hashEndPos = start + 1; - const hashEndLoc = createPositionWithColumnOffset(loc.start, 1); - tokens.splice(i, 1, new Token({ - type: getExportedToken(27), - value: "#", - start: start, - end: hashEndPos, - startLoc: loc.start, - endLoc: hashEndLoc - }), new Token({ - type: getExportedToken(130), - value: value, - start: hashEndPos, - end: end, - startLoc: hashEndLoc, - endLoc: loc.end - })); - i++; - continue; - } - if (tokenIsTemplate(type)) { - const { - loc, - start, - value, - end - } = token; - const backquoteEnd = start + 1; - const backquoteEndLoc = createPositionWithColumnOffset(loc.start, 1); - let startToken; - if (input.charCodeAt(start) === 96) { - startToken = new Token({ - type: getExportedToken(22), - value: "`", - start: start, - end: backquoteEnd, - startLoc: loc.start, - endLoc: backquoteEndLoc - }); - } else { - startToken = new Token({ - type: getExportedToken(8), - value: "}", - start: start, - end: backquoteEnd, - startLoc: loc.start, - endLoc: backquoteEndLoc - }); - } - let templateValue, templateElementEnd, templateElementEndLoc, endToken; - if (type === 24) { - templateElementEnd = end - 1; - templateElementEndLoc = createPositionWithColumnOffset(loc.end, -1); - templateValue = value === null ? null : value.slice(1, -1); - endToken = new Token({ - type: getExportedToken(22), - value: "`", - start: templateElementEnd, - end: end, - startLoc: templateElementEndLoc, - endLoc: loc.end - }); - } else { - templateElementEnd = end - 2; - templateElementEndLoc = createPositionWithColumnOffset(loc.end, -2); - templateValue = value === null ? null : value.slice(1, -2); - endToken = new Token({ - type: getExportedToken(23), - value: "${", - start: templateElementEnd, - end: end, - startLoc: templateElementEndLoc, - endLoc: loc.end - }); - } - tokens.splice(i, 1, startToken, new Token({ - type: getExportedToken(20), - value: templateValue, - start: backquoteEnd, - end: templateElementEnd, - startLoc: backquoteEndLoc, - endLoc: templateElementEndLoc - }), endToken); - i += 2; - continue; - } - } - token.type = getExportedToken(type); - } - } - return tokens; -} -class StatementParser extends ExpressionParser { - - parseTopLevel(file, program) { - file.program = this.parseProgram(program); - file.comments = this.state.comments; - if (this.options.tokens) { - file.tokens = babel7CompatTokens(this.tokens, this.input); - } - return this.finishNode(file, "File"); - } - parseProgram(program, end = 137, sourceType = this.options.sourceType) { - program.sourceType = sourceType; - program.interpreter = this.parseInterpreterDirective(); - this.parseBlockBody(program, true, true, end); - if (this.inModule && !this.options.allowUndeclaredExports && this.scope.undefinedExports.size > 0) { - for (const [localName, at] of Array.from(this.scope.undefinedExports)) { - this.raise(Errors.ModuleExportUndefined, { - at, - localName - }); - } - } - let finishedProgram; - if (end === 137) { - finishedProgram = this.finishNode(program, "Program"); - } else { - finishedProgram = this.finishNodeAt(program, "Program", createPositionWithColumnOffset(this.state.startLoc, -1)); - } - return finishedProgram; - } - - stmtToDirective(stmt) { - const directive = stmt; - directive.type = "Directive"; - directive.value = directive.expression; - delete directive.expression; - const directiveLiteral = directive.value; - const expressionValue = directiveLiteral.value; - const raw = this.input.slice(directiveLiteral.start, directiveLiteral.end); - const val = directiveLiteral.value = raw.slice(1, -1); - - this.addExtra(directiveLiteral, "raw", raw); - this.addExtra(directiveLiteral, "rawValue", val); - this.addExtra(directiveLiteral, "expressionValue", expressionValue); - directiveLiteral.type = "DirectiveLiteral"; - return directive; - } - parseInterpreterDirective() { - if (!this.match(28)) { - return null; - } - const node = this.startNode(); - node.value = this.state.value; - this.next(); - return this.finishNode(node, "InterpreterDirective"); - } - isLet(context) { - if (!this.isContextual(99)) { - return false; - } - return this.hasFollowingIdentifier(context); - } - - hasFollowingIdentifier(context) { - const next = this.nextTokenStart(); - const nextCh = this.codePointAtPos(next); - if (nextCh === 92 || nextCh === 91) { - return true; - } - if (context) return false; - if (nextCh === 123) return true; - if (isIdentifierStart(nextCh)) { - keywordRelationalOperator.lastIndex = next; - if (keywordRelationalOperator.test(this.input)) { - const endCh = this.codePointAtPos(keywordRelationalOperator.lastIndex); - if (!isIdentifierChar(endCh) && endCh !== 92) { - return false; - } - } - return true; - } - return false; - } - startsUsingForOf() { - const lookahead = this.lookahead(); - if (lookahead.type === 101 && !lookahead.containsEsc) { - return false; - } else { - this.expectPlugin("explicitResourceManagement"); - return true; - } - } - - parseStatement(context, topLevel) { - let decorators = null; - if (this.match(26)) { - decorators = this.parseDecorators(true); - } - return this.parseStatementContent(context, topLevel, decorators); - } - parseStatementContent(context, topLevel, decorators) { - const starttype = this.state.type; - const node = this.startNode(); - - switch (starttype) { - case 60: - return this.parseBreakContinueStatement(node, true); - case 63: - return this.parseBreakContinueStatement(node, false); - case 64: - return this.parseDebuggerStatement(node); - case 90: - return this.parseDoStatement(node); - case 91: - return this.parseForStatement(node); - case 68: - if (this.lookaheadCharCode() === 46) break; - if (context) { - if (this.state.strict) { - this.raise(Errors.StrictFunction, { - at: this.state.startLoc - }); - } else if (context !== "if" && context !== "label") { - this.raise(Errors.SloppyFunction, { - at: this.state.startLoc - }); - } - } - return this.parseFunctionStatement(node, false, !context); - case 80: - if (context) this.unexpected(); - return this.parseClass(this.maybeTakeDecorators(decorators, node), true); - case 69: - return this.parseIfStatement(node); - case 70: - return this.parseReturnStatement(node); - case 71: - return this.parseSwitchStatement(node); - case 72: - return this.parseThrowStatement(node); - case 73: - return this.parseTryStatement(node); - case 105: - if (this.hasFollowingLineBreak()) { - break; - } - case 99: - if (this.state.containsEsc || !this.hasFollowingIdentifier(context)) { - break; - } - case 75: - case 74: - { - const kind = this.state.value; - if (kind === "using") { - this.expectPlugin("explicitResourceManagement"); - if (!this.scope.inModule && this.scope.inTopLevel) { - this.raise(Errors.UnexpectedUsingDeclaration, { - at: this.state.startLoc - }); - } - } - if (context && kind !== "var") { - this.raise(Errors.UnexpectedLexicalDeclaration, { - at: this.state.startLoc - }); - } - return this.parseVarStatement(node, kind); - } - case 92: - return this.parseWhileStatement(node); - case 76: - return this.parseWithStatement(node); - case 5: - return this.parseBlock(); - case 13: - return this.parseEmptyStatement(node); - case 83: - { - const nextTokenCharCode = this.lookaheadCharCode(); - if (nextTokenCharCode === 40 || - nextTokenCharCode === 46) { - break; - } - } - case 82: - { - if (!this.options.allowImportExportEverywhere && !topLevel) { - this.raise(Errors.UnexpectedImportExport, { - at: this.state.startLoc - }); - } - this.next(); - - let result; - if (starttype === 83) { - result = this.parseImport(node); - if (result.type === "ImportDeclaration" && (!result.importKind || result.importKind === "value")) { - this.sawUnambiguousESM = true; - } - } else { - result = this.parseExport(node, decorators); - if (result.type === "ExportNamedDeclaration" && (!result.exportKind || result.exportKind === "value") || result.type === "ExportAllDeclaration" && (!result.exportKind || result.exportKind === "value") || result.type === "ExportDefaultDeclaration") { - this.sawUnambiguousESM = true; - } - } - this.assertModuleNodeAllowed(result); - return result; - } - default: - { - if (this.isAsyncFunction()) { - if (context) { - this.raise(Errors.AsyncFunctionInSingleStatementContext, { - at: this.state.startLoc - }); - } - this.next(); - return this.parseFunctionStatement(node, true, !context); - } - } - } - - const maybeName = this.state.value; - const expr = this.parseExpression(); - if (tokenIsIdentifier(starttype) && expr.type === "Identifier" && this.eat(14)) { - return this.parseLabeledStatement(node, maybeName, - expr, context); - } else { - return this.parseExpressionStatement(node, expr, decorators); - } - } - assertModuleNodeAllowed(node) { - if (!this.options.allowImportExportEverywhere && !this.inModule) { - this.raise(Errors.ImportOutsideModule, { - at: node - }); - } - } - decoratorsEnabledBeforeExport() { - if (this.hasPlugin("decorators-legacy")) return true; - return this.hasPlugin("decorators") && !!this.getPluginOption("decorators", "decoratorsBeforeExport"); - } - - maybeTakeDecorators(maybeDecorators, classNode, exportNode) { - if (maybeDecorators) { - classNode.decorators = maybeDecorators; - this.resetStartLocationFromNode(classNode, maybeDecorators[0]); - if (exportNode) this.resetStartLocationFromNode(exportNode, classNode); - } - return classNode; - } - canHaveLeadingDecorator() { - return this.match(80); - } - parseDecorators(allowExport) { - const decorators = []; - do { - decorators.push(this.parseDecorator()); - } while (this.match(26)); - if (this.match(82)) { - if (!allowExport) { - this.unexpected(); - } - if (!this.decoratorsEnabledBeforeExport()) { - this.raise(Errors.DecoratorExportClass, { - at: this.state.startLoc - }); - } - } else if (!this.canHaveLeadingDecorator()) { - throw this.raise(Errors.UnexpectedLeadingDecorator, { - at: this.state.startLoc - }); - } - return decorators; - } - parseDecorator() { - this.expectOnePlugin(["decorators", "decorators-legacy"]); - const node = this.startNode(); - this.next(); - if (this.hasPlugin("decorators")) { - const startLoc = this.state.startLoc; - let expr; - if (this.match(10)) { - const startLoc = this.state.startLoc; - this.next(); - expr = this.parseExpression(); - this.expect(11); - expr = this.wrapParenthesis(startLoc, expr); - const paramsStartLoc = this.state.startLoc; - node.expression = this.parseMaybeDecoratorArguments(expr); - if (this.getPluginOption("decorators", "allowCallParenthesized") === false && node.expression !== expr) { - this.raise(Errors.DecoratorArgumentsOutsideParentheses, { - at: paramsStartLoc - }); - } - } else { - expr = this.parseIdentifier(false); - while (this.eat(16)) { - const node = this.startNodeAt(startLoc); - node.object = expr; - if (this.match(136)) { - this.classScope.usePrivateName(this.state.value, this.state.startLoc); - node.property = this.parsePrivateName(); - } else { - node.property = this.parseIdentifier(true); - } - node.computed = false; - expr = this.finishNode(node, "MemberExpression"); - } - node.expression = this.parseMaybeDecoratorArguments(expr); - } - } else { - node.expression = this.parseExprSubscripts(); - } - return this.finishNode(node, "Decorator"); - } - parseMaybeDecoratorArguments(expr) { - if (this.eat(10)) { - const node = this.startNodeAtNode(expr); - node.callee = expr; - node.arguments = this.parseCallExpressionArguments(11, false); - this.toReferencedList(node.arguments); - return this.finishNode(node, "CallExpression"); - } - return expr; - } - parseBreakContinueStatement(node, isBreak) { - this.next(); - if (this.isLineTerminator()) { - node.label = null; - } else { - node.label = this.parseIdentifier(); - this.semicolon(); - } - this.verifyBreakContinue(node, isBreak); - return this.finishNode(node, isBreak ? "BreakStatement" : "ContinueStatement"); - } - verifyBreakContinue(node, isBreak) { - let i; - for (i = 0; i < this.state.labels.length; ++i) { - const lab = this.state.labels[i]; - if (node.label == null || lab.name === node.label.name) { - if (lab.kind != null && (isBreak || lab.kind === "loop")) break; - if (node.label && isBreak) break; - } - } - if (i === this.state.labels.length) { - const type = isBreak ? "BreakStatement" : "ContinueStatement"; - this.raise(Errors.IllegalBreakContinue, { - at: node, - type - }); - } - } - parseDebuggerStatement(node) { - this.next(); - this.semicolon(); - return this.finishNode(node, "DebuggerStatement"); - } - parseHeaderExpression() { - this.expect(10); - const val = this.parseExpression(); - this.expect(11); - return val; - } - parseDoStatement(node) { - this.next(); - this.state.labels.push(loopLabel); - - node.body = - this.withSmartMixTopicForbiddingContext(() => - this.parseStatement("do")); - this.state.labels.pop(); - this.expect(92); - node.test = this.parseHeaderExpression(); - this.eat(13); - return this.finishNode(node, "DoWhileStatement"); - } - - parseForStatement(node) { - this.next(); - this.state.labels.push(loopLabel); - let awaitAt = null; - if (this.isAwaitAllowed() && this.eatContextual(96)) { - awaitAt = this.state.lastTokStartLoc; - } - this.scope.enter(SCOPE_OTHER); - this.expect(10); - if (this.match(13)) { - if (awaitAt !== null) { - this.unexpected(awaitAt); - } - return this.parseFor(node, null); - } - const startsWithLet = this.isContextual(99); - const startsWithUsing = this.isContextual(105) && !this.hasFollowingLineBreak(); - const isLetOrUsing = startsWithLet && this.hasFollowingIdentifier() || startsWithUsing && this.hasFollowingIdentifier() && this.startsUsingForOf(); - if (this.match(74) || this.match(75) || isLetOrUsing) { - const initNode = this.startNode(); - const kind = this.state.value; - this.next(); - this.parseVar(initNode, true, kind); - const init = this.finishNode(initNode, "VariableDeclaration"); - const isForIn = this.match(58); - if (isForIn && startsWithUsing) { - this.raise(Errors.ForInUsing, { - at: init - }); - } - if ((isForIn || this.isContextual(101)) && init.declarations.length === 1) { - return this.parseForIn(node, init, awaitAt); - } - if (awaitAt !== null) { - this.unexpected(awaitAt); - } - return this.parseFor(node, init); - } - - const startsWithAsync = this.isContextual(95); - const refExpressionErrors = new ExpressionErrors(); - const init = this.parseExpression(true, refExpressionErrors); - const isForOf = this.isContextual(101); - if (isForOf) { - if (startsWithLet) { - this.raise(Errors.ForOfLet, { - at: init - }); - } - if ( - awaitAt === null && startsWithAsync && init.type === "Identifier") { - this.raise(Errors.ForOfAsync, { - at: init - }); - } - } - if (isForOf || this.match(58)) { - this.checkDestructuringPrivate(refExpressionErrors); - this.toAssignable(init, true); - const type = isForOf ? "ForOfStatement" : "ForInStatement"; - this.checkLVal(init, { - in: { - type - } - }); - return this.parseForIn(node, - init, awaitAt); - } else { - this.checkExpressionErrors(refExpressionErrors, true); - } - if (awaitAt !== null) { - this.unexpected(awaitAt); - } - return this.parseFor(node, init); - } - parseFunctionStatement(node, isAsync, declarationPosition) { - this.next(); - return this.parseFunction(node, FUNC_STATEMENT | (declarationPosition ? 0 : FUNC_HANGING_STATEMENT), isAsync); - } - parseIfStatement(node) { - this.next(); - node.test = this.parseHeaderExpression(); - node.consequent = this.parseStatement("if"); - node.alternate = this.eat(66) ? this.parseStatement("if") : null; - return this.finishNode(node, "IfStatement"); - } - parseReturnStatement(node) { - if (!this.prodParam.hasReturn && !this.options.allowReturnOutsideFunction) { - this.raise(Errors.IllegalReturn, { - at: this.state.startLoc - }); - } - this.next(); - - if (this.isLineTerminator()) { - node.argument = null; - } else { - node.argument = this.parseExpression(); - this.semicolon(); - } - return this.finishNode(node, "ReturnStatement"); - } - parseSwitchStatement(node) { - this.next(); - node.discriminant = this.parseHeaderExpression(); - const cases = node.cases = []; - this.expect(5); - this.state.labels.push(switchLabel); - this.scope.enter(SCOPE_OTHER); - - let cur; - for (let sawDefault; !this.match(8);) { - if (this.match(61) || this.match(65)) { - const isCase = this.match(61); - if (cur) this.finishNode(cur, "SwitchCase"); - cases.push(cur = this.startNode()); - cur.consequent = []; - this.next(); - if (isCase) { - cur.test = this.parseExpression(); - } else { - if (sawDefault) { - this.raise(Errors.MultipleDefaultsInSwitch, { - at: this.state.lastTokStartLoc - }); - } - sawDefault = true; - cur.test = null; - } - this.expect(14); - } else { - if (cur) { - cur.consequent.push(this.parseStatement(null)); - } else { - this.unexpected(); - } - } - } - this.scope.exit(); - if (cur) this.finishNode(cur, "SwitchCase"); - this.next(); - this.state.labels.pop(); - return this.finishNode(node, "SwitchStatement"); - } - parseThrowStatement(node) { - this.next(); - if (this.hasPrecedingLineBreak()) { - this.raise(Errors.NewlineAfterThrow, { - at: this.state.lastTokEndLoc - }); - } - node.argument = this.parseExpression(); - this.semicolon(); - return this.finishNode(node, "ThrowStatement"); - } - parseCatchClauseParam() { - const param = this.parseBindingAtom(); - const simple = param.type === "Identifier"; - this.scope.enter(simple ? SCOPE_SIMPLE_CATCH : 0); - this.checkLVal(param, { - in: { - type: "CatchClause" - }, - binding: BIND_LEXICAL, - allowingSloppyLetBinding: true - }); - return param; - } - parseTryStatement(node) { - this.next(); - node.block = this.parseBlock(); - node.handler = null; - if (this.match(62)) { - const clause = this.startNode(); - this.next(); - if (this.match(10)) { - this.expect(10); - clause.param = this.parseCatchClauseParam(); - this.expect(11); - } else { - clause.param = null; - this.scope.enter(SCOPE_OTHER); - } - - clause.body = - this.withSmartMixTopicForbiddingContext(() => - this.parseBlock(false, false)); - this.scope.exit(); - node.handler = this.finishNode(clause, "CatchClause"); - } - node.finalizer = this.eat(67) ? this.parseBlock() : null; - if (!node.handler && !node.finalizer) { - this.raise(Errors.NoCatchOrFinally, { - at: node - }); - } - return this.finishNode(node, "TryStatement"); - } - parseVarStatement(node, kind, allowMissingInitializer = false) { - this.next(); - this.parseVar(node, false, kind, allowMissingInitializer); - this.semicolon(); - return this.finishNode(node, "VariableDeclaration"); - } - parseWhileStatement(node) { - this.next(); - node.test = this.parseHeaderExpression(); - this.state.labels.push(loopLabel); - - node.body = - this.withSmartMixTopicForbiddingContext(() => - this.parseStatement("while")); - this.state.labels.pop(); - return this.finishNode(node, "WhileStatement"); - } - parseWithStatement(node) { - if (this.state.strict) { - this.raise(Errors.StrictWith, { - at: this.state.startLoc - }); - } - this.next(); - node.object = this.parseHeaderExpression(); - - node.body = - this.withSmartMixTopicForbiddingContext(() => - this.parseStatement("with")); - return this.finishNode(node, "WithStatement"); - } - parseEmptyStatement(node) { - this.next(); - return this.finishNode(node, "EmptyStatement"); - } - parseLabeledStatement(node, maybeName, expr, context) { - for (const label of this.state.labels) { - if (label.name === maybeName) { - this.raise(Errors.LabelRedeclaration, { - at: expr, - labelName: maybeName - }); - } - } - const kind = tokenIsLoop(this.state.type) ? "loop" : this.match(71) ? "switch" : null; - for (let i = this.state.labels.length - 1; i >= 0; i--) { - const label = this.state.labels[i]; - if (label.statementStart === node.start) { - label.statementStart = this.state.start; - label.kind = kind; - } else { - break; - } - } - this.state.labels.push({ - name: maybeName, - kind: kind, - statementStart: this.state.start - }); - node.body = this.parseStatement(context ? context.indexOf("label") === -1 ? context + "label" : context : "label"); - this.state.labels.pop(); - node.label = expr; - return this.finishNode(node, "LabeledStatement"); - } - parseExpressionStatement(node, expr, - decorators) { - node.expression = expr; - this.semicolon(); - return this.finishNode(node, "ExpressionStatement"); - } - - parseBlock(allowDirectives = false, createNewLexicalScope = true, afterBlockParse) { - const node = this.startNode(); - if (allowDirectives) { - this.state.strictErrors.clear(); - } - this.expect(5); - if (createNewLexicalScope) { - this.scope.enter(SCOPE_OTHER); - } - this.parseBlockBody(node, allowDirectives, false, 8, afterBlockParse); - if (createNewLexicalScope) { - this.scope.exit(); - } - return this.finishNode(node, "BlockStatement"); - } - isValidDirective(stmt) { - return stmt.type === "ExpressionStatement" && stmt.expression.type === "StringLiteral" && !stmt.expression.extra.parenthesized; - } - parseBlockBody(node, allowDirectives, topLevel, end, afterBlockParse) { - const body = node.body = []; - const directives = node.directives = []; - this.parseBlockOrModuleBlockBody(body, allowDirectives ? directives : undefined, topLevel, end, afterBlockParse); - } - - parseBlockOrModuleBlockBody(body, directives, topLevel, end, afterBlockParse) { - const oldStrict = this.state.strict; - let hasStrictModeDirective = false; - let parsedNonDirective = false; - while (!this.match(end)) { - const stmt = this.parseStatement(null, topLevel); - if (directives && !parsedNonDirective) { - if (this.isValidDirective(stmt)) { - const directive = this.stmtToDirective(stmt); - directives.push(directive); - if (!hasStrictModeDirective && directive.value.value === "use strict") { - hasStrictModeDirective = true; - this.setStrict(true); - } - continue; - } - parsedNonDirective = true; - this.state.strictErrors.clear(); - } - body.push(stmt); - } - if (afterBlockParse) { - afterBlockParse.call(this, hasStrictModeDirective); - } - if (!oldStrict) { - this.setStrict(false); - } - this.next(); - } - - parseFor(node, init) { - node.init = init; - this.semicolon(false); - node.test = this.match(13) ? null : this.parseExpression(); - this.semicolon(false); - node.update = this.match(11) ? null : this.parseExpression(); - this.expect(11); - - node.body = - this.withSmartMixTopicForbiddingContext(() => - this.parseStatement("for")); - this.scope.exit(); - this.state.labels.pop(); - return this.finishNode(node, "ForStatement"); - } - - parseForIn(node, init, awaitAt) { - const isForIn = this.match(58); - this.next(); - if (isForIn) { - if (awaitAt !== null) this.unexpected(awaitAt); - } else { - node.await = awaitAt !== null; - } - if (init.type === "VariableDeclaration" && init.declarations[0].init != null && (!isForIn || this.state.strict || init.kind !== "var" || init.declarations[0].id.type !== "Identifier")) { - this.raise(Errors.ForInOfLoopInitializer, { - at: init, - type: isForIn ? "ForInStatement" : "ForOfStatement" - }); - } - if (init.type === "AssignmentPattern") { - this.raise(Errors.InvalidLhs, { - at: init, - ancestor: { - type: "ForStatement" - } - }); - } - node.left = init; - node.right = isForIn ? this.parseExpression() : this.parseMaybeAssignAllowIn(); - this.expect(11); - - node.body = - this.withSmartMixTopicForbiddingContext(() => - this.parseStatement("for")); - this.scope.exit(); - this.state.labels.pop(); - return this.finishNode(node, isForIn ? "ForInStatement" : "ForOfStatement"); - } - - parseVar(node, isFor, kind, allowMissingInitializer = false) { - const declarations = node.declarations = []; - node.kind = kind; - for (;;) { - const decl = this.startNode(); - this.parseVarId(decl, kind); - decl.init = !this.eat(29) ? null : isFor ? this.parseMaybeAssignDisallowIn() : this.parseMaybeAssignAllowIn(); - if (decl.init === null && !allowMissingInitializer) { - if (decl.id.type !== "Identifier" && !(isFor && (this.match(58) || this.isContextual(101)))) { - this.raise(Errors.DeclarationMissingInitializer, { - at: this.state.lastTokEndLoc, - kind: "destructuring" - }); - } else if (kind === "const" && !(this.match(58) || this.isContextual(101))) { - this.raise(Errors.DeclarationMissingInitializer, { - at: this.state.lastTokEndLoc, - kind: "const" - }); - } - } - declarations.push(this.finishNode(decl, "VariableDeclarator")); - if (!this.eat(12)) break; - } - return node; - } - parseVarId(decl, kind) { - const id = this.parseBindingAtom(); - if (kind === "using" && id.type !== "Identifier") { - this.raise(Errors.UsingDeclarationHasBindingPattern, { - at: id - }); - } - this.checkLVal(id, { - in: { - type: "VariableDeclarator" - }, - binding: kind === "var" ? BIND_VAR : BIND_LEXICAL - }); - decl.id = id; - } - - parseFunction(node, statement = FUNC_NO_FLAGS, isAsync = false) { - const isStatement = statement & FUNC_STATEMENT; - const isHangingStatement = statement & FUNC_HANGING_STATEMENT; - const requireId = !!isStatement && !(statement & FUNC_NULLABLE_ID); - this.initFunction(node, isAsync); - if (this.match(55) && isHangingStatement) { - this.raise(Errors.GeneratorInSingleStatementContext, { - at: this.state.startLoc - }); - } - node.generator = this.eat(55); - if (isStatement) { - node.id = this.parseFunctionId(requireId); - } - const oldMaybeInArrowParameters = this.state.maybeInArrowParameters; - this.state.maybeInArrowParameters = false; - this.scope.enter(SCOPE_FUNCTION); - this.prodParam.enter(functionFlags(isAsync, node.generator)); - if (!isStatement) { - node.id = this.parseFunctionId(); - } - this.parseFunctionParams(node, false); - - this.withSmartMixTopicForbiddingContext(() => { - this.parseFunctionBodyAndFinish(node, isStatement ? "FunctionDeclaration" : "FunctionExpression"); - }); - this.prodParam.exit(); - this.scope.exit(); - if (isStatement && !isHangingStatement) { - this.registerFunctionStatementId(node); - } - this.state.maybeInArrowParameters = oldMaybeInArrowParameters; - return node; - } - parseFunctionId(requireId) { - return requireId || tokenIsIdentifier(this.state.type) ? this.parseIdentifier() : null; - } - parseFunctionParams(node, allowModifiers) { - this.expect(10); - this.expressionScope.enter(newParameterDeclarationScope()); - node.params = this.parseBindingList(11, 41, false, allowModifiers); - this.expressionScope.exit(); - } - registerFunctionStatementId(node) { - if (!node.id) return; - - this.scope.declareName(node.id.name, this.state.strict || node.generator || node.async ? this.scope.treatFunctionsAsVar ? BIND_VAR : BIND_LEXICAL : BIND_FUNCTION, node.id.loc.start); - } - - parseClass(node, isStatement, optionalId) { - this.next(); - - const oldStrict = this.state.strict; - this.state.strict = true; - this.parseClassId(node, isStatement, optionalId); - this.parseClassSuper(node); - node.body = this.parseClassBody(!!node.superClass, oldStrict); - return this.finishNode(node, isStatement ? "ClassDeclaration" : "ClassExpression"); - } - isClassProperty() { - return this.match(29) || this.match(13) || this.match(8); - } - isClassMethod() { - return this.match(10); - } - isNonstaticConstructor(method) { - return !method.computed && !method.static && (method.key.name === "constructor" || - method.key.value === "constructor"); - } - - parseClassBody(hadSuperClass, oldStrict) { - this.classScope.enter(); - const state = { - hadConstructor: false, - hadSuperClass - }; - let decorators = []; - const classBody = this.startNode(); - classBody.body = []; - this.expect(5); - - this.withSmartMixTopicForbiddingContext(() => { - while (!this.match(8)) { - if (this.eat(13)) { - if (decorators.length > 0) { - throw this.raise(Errors.DecoratorSemicolon, { - at: this.state.lastTokEndLoc - }); - } - continue; - } - if (this.match(26)) { - decorators.push(this.parseDecorator()); - continue; - } - const member = this.startNode(); - - if (decorators.length) { - member.decorators = decorators; - this.resetStartLocationFromNode(member, decorators[0]); - decorators = []; - } - this.parseClassMember(classBody, member, state); - if ( - member.kind === "constructor" && - member.decorators && - member.decorators.length > 0) { - this.raise(Errors.DecoratorConstructor, { - at: member - }); - } - } - }); - this.state.strict = oldStrict; - this.next(); - - if (decorators.length) { - throw this.raise(Errors.TrailingDecorator, { - at: this.state.startLoc - }); - } - this.classScope.exit(); - return this.finishNode(classBody, "ClassBody"); - } - - parseClassMemberFromModifier(classBody, member) { - const key = this.parseIdentifier(true); - - if (this.isClassMethod()) { - const method = member; - - method.kind = "method"; - method.computed = false; - method.key = key; - method.static = false; - this.pushClassMethod(classBody, method, false, false, false, false); - return true; - } else if (this.isClassProperty()) { - const prop = member; - - prop.computed = false; - prop.key = key; - prop.static = false; - classBody.body.push(this.parseClassProperty(prop)); - return true; - } - this.resetPreviousNodeTrailingComments(key); - return false; - } - parseClassMember(classBody, member, state) { - const isStatic = this.isContextual(104); - if (isStatic) { - if (this.parseClassMemberFromModifier(classBody, member)) { - return; - } - if (this.eat(5)) { - this.parseClassStaticBlock(classBody, member); - return; - } - } - this.parseClassMemberWithIsStatic(classBody, member, state, isStatic); - } - parseClassMemberWithIsStatic(classBody, member, state, isStatic) { - const publicMethod = member; - const privateMethod = member; - const publicProp = member; - const privateProp = member; - const accessorProp = member; - const method = publicMethod; - const publicMember = publicMethod; - member.static = isStatic; - this.parsePropertyNamePrefixOperator(member); - if (this.eat(55)) { - method.kind = "method"; - const isPrivateName = this.match(136); - this.parseClassElementName(method); - if (isPrivateName) { - this.pushClassPrivateMethod(classBody, privateMethod, true, false); - return; - } - if (this.isNonstaticConstructor(publicMethod)) { - this.raise(Errors.ConstructorIsGenerator, { - at: publicMethod.key - }); - } - this.pushClassMethod(classBody, publicMethod, true, false, false, false); - return; - } - const isContextual = tokenIsIdentifier(this.state.type) && !this.state.containsEsc; - const isPrivate = this.match(136); - const key = this.parseClassElementName(member); - const maybeQuestionTokenStartLoc = this.state.startLoc; - this.parsePostMemberNameModifiers(publicMember); - if (this.isClassMethod()) { - method.kind = "method"; - if (isPrivate) { - this.pushClassPrivateMethod(classBody, privateMethod, false, false); - return; - } - - const isConstructor = this.isNonstaticConstructor(publicMethod); - let allowsDirectSuper = false; - if (isConstructor) { - publicMethod.kind = "constructor"; - - if (state.hadConstructor && !this.hasPlugin("typescript")) { - this.raise(Errors.DuplicateConstructor, { - at: key - }); - } - if (isConstructor && this.hasPlugin("typescript") && member.override) { - this.raise(Errors.OverrideOnConstructor, { - at: key - }); - } - state.hadConstructor = true; - allowsDirectSuper = state.hadSuperClass; - } - this.pushClassMethod(classBody, publicMethod, false, false, isConstructor, allowsDirectSuper); - } else if (this.isClassProperty()) { - if (isPrivate) { - this.pushClassPrivateProperty(classBody, privateProp); - } else { - this.pushClassProperty(classBody, publicProp); - } - } else if (isContextual && key.name === "async" && !this.isLineTerminator()) { - this.resetPreviousNodeTrailingComments(key); - const isGenerator = this.eat(55); - if (publicMember.optional) { - this.unexpected(maybeQuestionTokenStartLoc); - } - method.kind = "method"; - const isPrivate = this.match(136); - this.parseClassElementName(method); - this.parsePostMemberNameModifiers(publicMember); - if (isPrivate) { - this.pushClassPrivateMethod(classBody, privateMethod, isGenerator, true); - } else { - if (this.isNonstaticConstructor(publicMethod)) { - this.raise(Errors.ConstructorIsAsync, { - at: publicMethod.key - }); - } - this.pushClassMethod(classBody, publicMethod, isGenerator, true, false, false); - } - } else if (isContextual && (key.name === "get" || key.name === "set") && !(this.match(55) && this.isLineTerminator())) { - this.resetPreviousNodeTrailingComments(key); - method.kind = key.name; - const isPrivate = this.match(136); - this.parseClassElementName(publicMethod); - if (isPrivate) { - this.pushClassPrivateMethod(classBody, privateMethod, false, false); - } else { - if (this.isNonstaticConstructor(publicMethod)) { - this.raise(Errors.ConstructorIsAccessor, { - at: publicMethod.key - }); - } - this.pushClassMethod(classBody, publicMethod, false, false, false, false); - } - this.checkGetterSetterParams(publicMethod); - } else if (isContextual && key.name === "accessor" && !this.isLineTerminator()) { - this.expectPlugin("decoratorAutoAccessors"); - this.resetPreviousNodeTrailingComments(key); - - const isPrivate = this.match(136); - this.parseClassElementName(publicProp); - this.pushClassAccessorProperty(classBody, accessorProp, isPrivate); - } else if (this.isLineTerminator()) { - if (isPrivate) { - this.pushClassPrivateProperty(classBody, privateProp); - } else { - this.pushClassProperty(classBody, publicProp); - } - } else { - this.unexpected(); - } - } - - parseClassElementName(member) { - const { - type, - value - } = this.state; - if ((type === 130 || type === 131) && member.static && value === "prototype") { - this.raise(Errors.StaticPrototype, { - at: this.state.startLoc - }); - } - if (type === 136) { - if (value === "constructor") { - this.raise(Errors.ConstructorClassPrivateField, { - at: this.state.startLoc - }); - } - const key = this.parsePrivateName(); - member.key = key; - return key; - } - return this.parsePropertyName(member); - } - parseClassStaticBlock(classBody, member) { - var _member$decorators; - this.scope.enter(SCOPE_CLASS | SCOPE_STATIC_BLOCK | SCOPE_SUPER); - const oldLabels = this.state.labels; - this.state.labels = []; - this.prodParam.enter(PARAM); - const body = member.body = []; - this.parseBlockOrModuleBlockBody(body, undefined, false, 8); - this.prodParam.exit(); - this.scope.exit(); - this.state.labels = oldLabels; - classBody.body.push(this.finishNode(member, "StaticBlock")); - if ((_member$decorators = member.decorators) != null && _member$decorators.length) { - this.raise(Errors.DecoratorStaticBlock, { - at: member - }); - } - } - pushClassProperty(classBody, prop) { - if (!prop.computed && (prop.key.name === "constructor" || prop.key.value === "constructor")) { - this.raise(Errors.ConstructorClassField, { - at: prop.key - }); - } - classBody.body.push(this.parseClassProperty(prop)); - } - pushClassPrivateProperty(classBody, prop) { - const node = this.parseClassPrivateProperty(prop); - classBody.body.push(node); - this.classScope.declarePrivateName(this.getPrivateNameSV(node.key), CLASS_ELEMENT_OTHER, node.key.loc.start); - } - pushClassAccessorProperty(classBody, prop, isPrivate) { - if (!isPrivate && !prop.computed) { - const key = prop.key; - if (key.name === "constructor" || key.value === "constructor") { - this.raise(Errors.ConstructorClassField, { - at: key - }); - } - } - const node = this.parseClassAccessorProperty(prop); - classBody.body.push(node); - if (isPrivate) { - this.classScope.declarePrivateName(this.getPrivateNameSV(node.key), CLASS_ELEMENT_OTHER, node.key.loc.start); - } - } - pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper) { - classBody.body.push(this.parseMethod(method, isGenerator, isAsync, isConstructor, allowsDirectSuper, "ClassMethod", true)); - } - pushClassPrivateMethod(classBody, method, isGenerator, isAsync) { - const node = this.parseMethod(method, isGenerator, isAsync, false, false, "ClassPrivateMethod", true); - classBody.body.push(node); - const kind = node.kind === "get" ? node.static ? CLASS_ELEMENT_STATIC_GETTER : CLASS_ELEMENT_INSTANCE_GETTER : node.kind === "set" ? node.static ? CLASS_ELEMENT_STATIC_SETTER : CLASS_ELEMENT_INSTANCE_SETTER : CLASS_ELEMENT_OTHER; - this.declareClassPrivateMethodInScope(node, kind); - } - declareClassPrivateMethodInScope(node, kind) { - this.classScope.declarePrivateName(this.getPrivateNameSV(node.key), kind, node.key.loc.start); - } - - parsePostMemberNameModifiers( - methodOrProp) {} - - parseClassPrivateProperty(node) { - this.parseInitializer(node); - this.semicolon(); - return this.finishNode(node, "ClassPrivateProperty"); - } - - parseClassProperty(node) { - this.parseInitializer(node); - this.semicolon(); - return this.finishNode(node, "ClassProperty"); - } - parseClassAccessorProperty(node) { - this.parseInitializer(node); - this.semicolon(); - return this.finishNode(node, "ClassAccessorProperty"); - } - - parseInitializer(node) { - this.scope.enter(SCOPE_CLASS | SCOPE_SUPER); - this.expressionScope.enter(newExpressionScope()); - this.prodParam.enter(PARAM); - node.value = this.eat(29) ? this.parseMaybeAssignAllowIn() : null; - this.expressionScope.exit(); - this.prodParam.exit(); - this.scope.exit(); - } - parseClassId(node, isStatement, optionalId, bindingType = BIND_CLASS) { - if (tokenIsIdentifier(this.state.type)) { - node.id = this.parseIdentifier(); - if (isStatement) { - this.declareNameFromIdentifier(node.id, bindingType); - } - } else { - if (optionalId || !isStatement) { - node.id = null; - } else { - throw this.raise(Errors.MissingClassName, { - at: this.state.startLoc - }); - } - } - } - - parseClassSuper(node) { - node.superClass = this.eat(81) ? this.parseExprSubscripts() : null; - } - - parseExport(node, decorators) { - const hasDefault = this.maybeParseExportDefaultSpecifier( - node); - const parseAfterDefault = !hasDefault || this.eat(12); - const hasStar = parseAfterDefault && this.eatExportStar( - node); - const hasNamespace = hasStar && this.maybeParseExportNamespaceSpecifier( - node); - const parseAfterNamespace = parseAfterDefault && (!hasNamespace || this.eat(12)); - const isFromRequired = hasDefault || hasStar; - if (hasStar && !hasNamespace) { - if (hasDefault) this.unexpected(); - if (decorators) { - throw this.raise(Errors.UnsupportedDecoratorExport, { - at: node - }); - } - this.parseExportFrom(node, true); - return this.finishNode(node, "ExportAllDeclaration"); - } - const hasSpecifiers = this.maybeParseExportNamedSpecifiers( - node); - if (hasDefault && parseAfterDefault && !hasStar && !hasSpecifiers || hasNamespace && parseAfterNamespace && !hasSpecifiers) { - throw this.unexpected(null, 5); - } - let hasDeclaration; - if (isFromRequired || hasSpecifiers) { - hasDeclaration = false; - if (decorators) { - throw this.raise(Errors.UnsupportedDecoratorExport, { - at: node - }); - } - this.parseExportFrom(node, isFromRequired); - } else { - hasDeclaration = this.maybeParseExportDeclaration(node); - } - if (isFromRequired || hasSpecifiers || hasDeclaration) { - var _node2$declaration; - const node2 = node; - this.checkExport(node2, true, false, !!node2.source); - if (((_node2$declaration = node2.declaration) == null ? void 0 : _node2$declaration.type) === "ClassDeclaration") { - this.maybeTakeDecorators(decorators, node2.declaration, node2); - } else if (decorators) { - throw this.raise(Errors.UnsupportedDecoratorExport, { - at: node - }); - } - return this.finishNode(node2, "ExportNamedDeclaration"); - } - if (this.eat(65)) { - const node2 = node; - const decl = this.parseExportDefaultExpression(); - node2.declaration = decl; - if (decl.type === "ClassDeclaration") { - this.maybeTakeDecorators(decorators, decl, node2); - } else if (decorators) { - throw this.raise(Errors.UnsupportedDecoratorExport, { - at: node - }); - } - this.checkExport(node2, true, true); - return this.finishNode(node2, "ExportDefaultDeclaration"); - } - throw this.unexpected(null, 5); - } - - eatExportStar(node) { - return this.eat(55); - } - maybeParseExportDefaultSpecifier(node) { - if (this.isExportDefaultSpecifier()) { - this.expectPlugin("exportDefaultFrom"); - const specifier = this.startNode(); - specifier.exported = this.parseIdentifier(true); - node.specifiers = [this.finishNode(specifier, "ExportDefaultSpecifier")]; - return true; - } - return false; - } - maybeParseExportNamespaceSpecifier(node) { - if (this.isContextual(93)) { - if (!node.specifiers) node.specifiers = []; - const specifier = this.startNodeAt(this.state.lastTokStartLoc); - this.next(); - specifier.exported = this.parseModuleExportName(); - node.specifiers.push(this.finishNode(specifier, "ExportNamespaceSpecifier")); - return true; - } - return false; - } - maybeParseExportNamedSpecifiers(node) { - if (this.match(5)) { - if (!node.specifiers) node.specifiers = []; - const isTypeExport = node.exportKind === "type"; - node.specifiers.push(...this.parseExportSpecifiers(isTypeExport)); - node.source = null; - node.declaration = null; - if (this.hasPlugin("importAssertions")) { - node.assertions = []; - } - return true; - } - return false; - } - maybeParseExportDeclaration(node) { - if (this.shouldParseExportDeclaration()) { - node.specifiers = []; - node.source = null; - if (this.hasPlugin("importAssertions")) { - node.assertions = []; - } - node.declaration = this.parseExportDeclaration(node); - return true; - } - return false; - } - isAsyncFunction() { - if (!this.isContextual(95)) return false; - const next = this.nextTokenStart(); - return !lineBreak.test(this.input.slice(this.state.pos, next)) && this.isUnparsedContextual(next, "function"); - } - parseExportDefaultExpression() { - const expr = this.startNode(); - const isAsync = this.isAsyncFunction(); - if (this.match(68) || isAsync) { - this.next(); - if (isAsync) { - this.next(); - } - return this.parseFunction(expr, FUNC_STATEMENT | FUNC_NULLABLE_ID, isAsync); - } - if (this.match(80)) { - return this.parseClass(expr, true, true); - } - if (this.match(26)) { - if (this.hasPlugin("decorators") && this.getPluginOption("decorators", "decoratorsBeforeExport")) { - this.raise(Errors.DecoratorBeforeExport, { - at: this.state.startLoc - }); - } - return this.parseClass(this.maybeTakeDecorators(this.parseDecorators(false), this.startNode()), true, true); - } - if (this.match(75) || this.match(74) || this.isLet()) { - throw this.raise(Errors.UnsupportedDefaultExport, { - at: this.state.startLoc - }); - } - const res = this.parseMaybeAssignAllowIn(); - this.semicolon(); - return res; - } - parseExportDeclaration( - node) { - if (this.match(80)) { - const node = this.parseClass(this.startNode(), true, false); - return node; - } - return this.parseStatement(null); - } - isExportDefaultSpecifier() { - const { - type - } = this.state; - if (tokenIsIdentifier(type)) { - if (type === 95 && !this.state.containsEsc || type === 99) { - return false; - } - if ((type === 128 || type === 127) && !this.state.containsEsc) { - const { - type: nextType - } = this.lookahead(); - if (tokenIsIdentifier(nextType) && nextType !== 97 || nextType === 5) { - this.expectOnePlugin(["flow", "typescript"]); - return false; - } - } - } else if (!this.match(65)) { - return false; - } - const next = this.nextTokenStart(); - const hasFrom = this.isUnparsedContextual(next, "from"); - if (this.input.charCodeAt(next) === 44 || tokenIsIdentifier(this.state.type) && hasFrom) { - return true; - } - if (this.match(65) && hasFrom) { - const nextAfterFrom = this.input.charCodeAt(this.nextTokenStartSince(next + 4)); - return nextAfterFrom === 34 || nextAfterFrom === 39; - } - return false; - } - parseExportFrom(node, expect) { - if (this.eatContextual(97)) { - node.source = this.parseImportSource(); - this.checkExport(node); - const assertions = this.maybeParseImportAssertions(); - if (assertions) { - node.assertions = assertions; - this.checkJSONModuleImport(node); - } - } else if (expect) { - this.unexpected(); - } - this.semicolon(); - } - shouldParseExportDeclaration() { - const { - type - } = this.state; - if (type === 26) { - this.expectOnePlugin(["decorators", "decorators-legacy"]); - if (this.hasPlugin("decorators")) { - if (this.getPluginOption("decorators", "decoratorsBeforeExport")) { - throw this.raise(Errors.DecoratorBeforeExport, { - at: this.state.startLoc - }); - } - return true; - } - } - return type === 74 || type === 75 || type === 68 || type === 80 || this.isLet() || this.isAsyncFunction(); - } - checkExport(node, checkNames, isDefault, isFrom) { - if (checkNames) { - if (isDefault) { - this.checkDuplicateExports(node, "default"); - if (this.hasPlugin("exportDefaultFrom")) { - var _declaration$extra; - const declaration = node.declaration; - if (declaration.type === "Identifier" && declaration.name === "from" && declaration.end - declaration.start === 4 && - !((_declaration$extra = declaration.extra) != null && _declaration$extra.parenthesized)) { - this.raise(Errors.ExportDefaultFromAsIdentifier, { - at: declaration - }); - } - } - } else if (node.specifiers && node.specifiers.length) { - for (const specifier of node.specifiers) { - const { - exported - } = specifier; - const exportName = exported.type === "Identifier" ? exported.name : exported.value; - this.checkDuplicateExports(specifier, exportName); - if (!isFrom && specifier.local) { - const { - local - } = specifier; - if (local.type !== "Identifier") { - this.raise(Errors.ExportBindingIsString, { - at: specifier, - localName: local.value, - exportName - }); - } else { - this.checkReservedWord(local.name, local.loc.start, true, false); - this.scope.checkLocalExport(local); - } - } - } - } else if (node.declaration) { - if (node.declaration.type === "FunctionDeclaration" || node.declaration.type === "ClassDeclaration") { - const id = node.declaration.id; - if (!id) throw new Error("Assertion failure"); - this.checkDuplicateExports(node, id.name); - } else if (node.declaration.type === "VariableDeclaration") { - for (const declaration of node.declaration.declarations) { - this.checkDeclaration(declaration.id); - } - } - } - } - } - checkDeclaration(node) { - if (node.type === "Identifier") { - this.checkDuplicateExports(node, node.name); - } else if (node.type === "ObjectPattern") { - for (const prop of node.properties) { - this.checkDeclaration(prop); - } - } else if (node.type === "ArrayPattern") { - for (const elem of node.elements) { - if (elem) { - this.checkDeclaration(elem); - } - } - } else if (node.type === "ObjectProperty") { - this.checkDeclaration(node.value); - } else if (node.type === "RestElement") { - this.checkDeclaration(node.argument); - } else if (node.type === "AssignmentPattern") { - this.checkDeclaration(node.left); - } - } - checkDuplicateExports(node, exportName) { - if (this.exportedIdentifiers.has(exportName)) { - if (exportName === "default") { - this.raise(Errors.DuplicateDefaultExport, { - at: node - }); - } else { - this.raise(Errors.DuplicateExport, { - at: node, - exportName - }); - } - } - this.exportedIdentifiers.add(exportName); - } - - parseExportSpecifiers(isInTypeExport) { - const nodes = []; - let first = true; - - this.expect(5); - while (!this.eat(8)) { - if (first) { - first = false; - } else { - this.expect(12); - if (this.eat(8)) break; - } - const isMaybeTypeOnly = this.isContextual(128); - const isString = this.match(131); - const node = this.startNode(); - node.local = this.parseModuleExportName(); - nodes.push(this.parseExportSpecifier(node, isString, isInTypeExport, isMaybeTypeOnly)); - } - return nodes; - } - parseExportSpecifier(node, isString, - isInTypeExport, isMaybeTypeOnly - ) { - if (this.eatContextual(93)) { - node.exported = this.parseModuleExportName(); - } else if (isString) { - node.exported = cloneStringLiteral(node.local); - } else if (!node.exported) { - node.exported = cloneIdentifier(node.local); - } - return this.finishNode(node, "ExportSpecifier"); - } - - parseModuleExportName() { - if (this.match(131)) { - const result = this.parseStringLiteral(this.state.value); - const surrogate = result.value.match(loneSurrogate); - if (surrogate) { - this.raise(Errors.ModuleExportNameHasLoneSurrogate, { - at: result, - surrogateCharCode: surrogate[0].charCodeAt(0) - }); - } - return result; - } - return this.parseIdentifier(true); - } - isJSONModuleImport(node) { - if (node.assertions != null) { - return node.assertions.some(({ - key, - value - }) => { - return value.value === "json" && (key.type === "Identifier" ? key.name === "type" : key.value === "type"); - }); - } - return false; - } - checkImportReflection(node) { - if (node.module) { - var _node$assertions; - if (node.specifiers.length !== 1 || node.specifiers[0].type !== "ImportDefaultSpecifier") { - this.raise(Errors.ImportReflectionNotBinding, { - at: node.specifiers[0].loc.start - }); - } - if (((_node$assertions = node.assertions) == null ? void 0 : _node$assertions.length) > 0) { - this.raise(Errors.ImportReflectionHasAssertion, { - at: node.specifiers[0].loc.start - }); - } - } - } - checkJSONModuleImport(node) { - if (this.isJSONModuleImport(node) && node.type !== "ExportAllDeclaration") { - const { - specifiers - } = node; - if (specifiers != null) { - const nonDefaultNamedSpecifier = specifiers.find(specifier => { - let imported; - if (specifier.type === "ExportSpecifier") { - imported = specifier.local; - } else if (specifier.type === "ImportSpecifier") { - imported = specifier.imported; - } - if (imported !== undefined) { - return imported.type === "Identifier" ? imported.name !== "default" : imported.value !== "default"; - } - }); - if (nonDefaultNamedSpecifier !== undefined) { - this.raise(Errors.ImportJSONBindingNotDefault, { - at: nonDefaultNamedSpecifier.loc.start - }); - } - } - } - } - parseMaybeImportReflection(node) { - let isImportReflection = false; - if (this.isContextual(125)) { - const lookahead = this.lookahead(); - if (tokenIsIdentifier(lookahead.type)) { - if (lookahead.type !== 97) { - isImportReflection = true; - } else { - const nextNextTokenFirstChar = this.input.charCodeAt(this.nextTokenStartSince(lookahead.end)); - if (nextNextTokenFirstChar === 102) { - isImportReflection = true; - } - } - } else { - isImportReflection = true; - } - } - if (isImportReflection) { - this.expectPlugin("importReflection"); - this.next(); - node.module = true; - } else if (this.hasPlugin("importReflection")) { - node.module = false; - } - } - - parseImport(node) { - node.specifiers = []; - if (!this.match(131)) { - this.parseMaybeImportReflection(node); - const hasDefault = this.maybeParseDefaultImportSpecifier(node); - const parseNext = !hasDefault || this.eat(12); - const hasStar = parseNext && this.maybeParseStarImportSpecifier(node); - if (parseNext && !hasStar) this.parseNamedImportSpecifiers(node); - this.expectContextual(97); - } - node.source = this.parseImportSource(); - const assertions = this.maybeParseImportAssertions(); - if (assertions) { - node.assertions = assertions; - } else { - const attributes = this.maybeParseModuleAttributes(); - if (attributes) { - node.attributes = attributes; - } - } - this.checkImportReflection(node); - this.checkJSONModuleImport(node); - this.semicolon(); - return this.finishNode(node, "ImportDeclaration"); - } - parseImportSource() { - if (!this.match(131)) this.unexpected(); - return this.parseExprAtom(); - } - - shouldParseDefaultImport(node) { - return tokenIsIdentifier(this.state.type); - } - parseImportSpecifierLocal(node, specifier, type) { - specifier.local = this.parseIdentifier(); - node.specifiers.push(this.finishImportSpecifier(specifier, type)); - } - finishImportSpecifier(specifier, type, bindingType = BIND_LEXICAL) { - this.checkLVal(specifier.local, { - in: specifier, - binding: bindingType - }); - return this.finishNode(specifier, type); - } - - parseAssertEntries() { - const attrs = []; - const attrNames = new Set(); - do { - if (this.match(8)) { - break; - } - const node = this.startNode(); - - const keyName = this.state.value; - if (attrNames.has(keyName)) { - this.raise(Errors.ModuleAttributesWithDuplicateKeys, { - at: this.state.startLoc, - key: keyName - }); - } - attrNames.add(keyName); - if (this.match(131)) { - node.key = this.parseStringLiteral(keyName); - } else { - node.key = this.parseIdentifier(true); - } - this.expect(14); - if (!this.match(131)) { - throw this.raise(Errors.ModuleAttributeInvalidValue, { - at: this.state.startLoc - }); - } - node.value = this.parseStringLiteral(this.state.value); - attrs.push(this.finishNode(node, "ImportAttribute")); - } while (this.eat(12)); - return attrs; - } - - maybeParseModuleAttributes() { - if (this.match(76) && !this.hasPrecedingLineBreak()) { - this.expectPlugin("moduleAttributes"); - this.next(); - } else { - if (this.hasPlugin("moduleAttributes")) return []; - return null; - } - const attrs = []; - const attributes = new Set(); - do { - const node = this.startNode(); - node.key = this.parseIdentifier(true); - if (node.key.name !== "type") { - this.raise(Errors.ModuleAttributeDifferentFromType, { - at: node.key - }); - } - if (attributes.has(node.key.name)) { - this.raise(Errors.ModuleAttributesWithDuplicateKeys, { - at: node.key, - key: node.key.name - }); - } - attributes.add(node.key.name); - this.expect(14); - if (!this.match(131)) { - throw this.raise(Errors.ModuleAttributeInvalidValue, { - at: this.state.startLoc - }); - } - node.value = this.parseStringLiteral(this.state.value); - this.finishNode(node, "ImportAttribute"); - attrs.push(node); - } while (this.eat(12)); - return attrs; - } - maybeParseImportAssertions() { - if (this.isContextual(94) && !this.hasPrecedingLineBreak()) { - this.expectPlugin("importAssertions"); - this.next(); - } else { - if (this.hasPlugin("importAssertions")) return []; - return null; - } - this.eat(5); - const attrs = this.parseAssertEntries(); - this.eat(8); - return attrs; - } - maybeParseDefaultImportSpecifier(node) { - if (this.shouldParseDefaultImport(node)) { - this.parseImportSpecifierLocal(node, this.startNode(), "ImportDefaultSpecifier"); - return true; - } - return false; - } - maybeParseStarImportSpecifier(node) { - if (this.match(55)) { - const specifier = this.startNode(); - this.next(); - this.expectContextual(93); - this.parseImportSpecifierLocal(node, specifier, "ImportNamespaceSpecifier"); - return true; - } - return false; - } - parseNamedImportSpecifiers(node) { - let first = true; - this.expect(5); - while (!this.eat(8)) { - if (first) { - first = false; - } else { - if (this.eat(14)) { - throw this.raise(Errors.DestructureNamedImport, { - at: this.state.startLoc - }); - } - this.expect(12); - if (this.eat(8)) break; - } - const specifier = this.startNode(); - const importedIsString = this.match(131); - const isMaybeTypeOnly = this.isContextual(128); - specifier.imported = this.parseModuleExportName(); - const importSpecifier = this.parseImportSpecifier(specifier, importedIsString, node.importKind === "type" || node.importKind === "typeof", isMaybeTypeOnly, undefined); - node.specifiers.push(importSpecifier); - } - } - - parseImportSpecifier(specifier, importedIsString, - isInTypeOnlyImport, isMaybeTypeOnly, bindingType - ) { - if (this.eatContextual(93)) { - specifier.local = this.parseIdentifier(); - } else { - const { - imported - } = specifier; - if (importedIsString) { - throw this.raise(Errors.ImportBindingIsString, { - at: specifier, - importName: imported.value - }); - } - this.checkReservedWord(imported.name, specifier.loc.start, true, true); - if (!specifier.local) { - specifier.local = cloneIdentifier(imported); - } - } - return this.finishImportSpecifier(specifier, "ImportSpecifier", bindingType); - } - - isThisParam(param) { - return param.type === "Identifier" && param.name === "this"; - } -} - -class Parser extends StatementParser { - - constructor(options, input) { - options = getOptions(options); - super(options, input); - this.options = options; - this.initializeScopes(); - this.plugins = pluginsMap(this.options.plugins); - this.filename = options.sourceFilename; - } - - getScopeHandler() { - return ScopeHandler; - } - parse() { - this.enterInitialScopes(); - const file = this.startNode(); - const program = this.startNode(); - this.nextToken(); - file.errors = null; - this.parseTopLevel(file, program); - file.errors = this.state.errors; - return file; - } -} -function pluginsMap(plugins) { - const pluginMap = new Map(); - for (const plugin of plugins) { - const [name, options] = Array.isArray(plugin) ? plugin : [plugin, {}]; - if (!pluginMap.has(name)) pluginMap.set(name, options || {}); - } - return pluginMap; -} - -function parse(input, options) { - var _options; - if (((_options = options) == null ? void 0 : _options.sourceType) === "unambiguous") { - options = Object.assign({}, options); - try { - options.sourceType = "module"; - const parser = getParser(options, input); - const ast = parser.parse(); - if (parser.sawUnambiguousESM) { - return ast; - } - if (parser.ambiguousScriptDifferentAst) { - try { - options.sourceType = "script"; - return getParser(options, input).parse(); - } catch (_unused) {} - } else { - ast.program.sourceType = "script"; - } - return ast; - } catch (moduleError) { - try { - options.sourceType = "script"; - return getParser(options, input).parse(); - } catch (_unused2) {} - throw moduleError; - } - } else { - return getParser(options, input).parse(); - } -} -function parseExpression(input, options) { - const parser = getParser(options, input); - if (parser.options.strictMode) { - parser.state.strict = true; - } - return parser.getExpression(); -} -function generateExportedTokenTypes(internalTokenTypes) { - const tokenTypes = {}; - for (const typeName of Object.keys(internalTokenTypes)) { - tokenTypes[typeName] = getExportedToken(internalTokenTypes[typeName]); - } - return tokenTypes; -} -const tokTypes = generateExportedTokenTypes(tt); -function getParser(options, input) { - let cls = Parser; - if (options != null && options.plugins) { - validatePlugins(options.plugins); - cls = getParserClass(options.plugins); - } - return new cls(options, input); -} -const parserClassCache = {}; - -function getParserClass(pluginsFromOptions) { - const pluginList = mixinPluginNames.filter(name => hasPlugin(pluginsFromOptions, name)); - const key = pluginList.join("/"); - let cls = parserClassCache[key]; - if (!cls) { - cls = Parser; - for (const plugin of pluginList) { - cls = mixinPlugins[plugin](cls); - } - parserClassCache[key] = cls; - } - return cls; -} - -exports.parse = parse; -exports.parseExpression = parseExpression; -exports.tokTypes = tokTypes; -//# sourceMappingURL=index.js.map diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@babel/parser/package.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/@babel/parser/package.json deleted file mode 100644 index e6a06682..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@babel/parser/package.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "name": "@babel/parser", - "version": "7.20.3", - "description": "A JavaScript parser", - "author": "The Babel Team (https://babel.dev/team)", - "homepage": "https://babel.dev/docs/en/next/babel-parser", - "bugs": "https://github.com/babel/babel/issues?utf8=%E2%9C%93&q=is%3Aissue+label%3A%22pkg%3A+parser+%28babylon%29%22+is%3Aopen", - "license": "MIT", - "publishConfig": { - "access": "public" - }, - "keywords": [ - "babel", - "javascript", - "parser", - "tc39", - "ecmascript", - "@babel/parser" - ], - "repository": { - "type": "git", - "url": "https://github.com/babel/babel.git", - "directory": "packages/babel-parser" - }, - "main": "./lib/index.js", - "types": "./typings/babel-parser.d.ts", - "files": [ - "bin", - "lib", - "typings", - "index.cjs" - ], - "engines": { - "node": ">=6.0.0" - }, - "devDependencies": { - "@babel/code-frame": "^7.18.6", - "@babel/helper-check-duplicate-nodes": "^7.18.6", - "@babel/helper-fixtures": "^7.19.4", - "@babel/helper-string-parser": "^7.19.4", - "@babel/helper-validator-identifier": "^7.19.1", - "charcodes": "^0.2.0" - }, - "bin": "./bin/babel-parser.js", - "type": "commonjs" -} \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@babel/parser/typings/babel-parser.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@babel/parser/typings/babel-parser.d.ts deleted file mode 100644 index b806352d..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@babel/parser/typings/babel-parser.d.ts +++ /dev/null @@ -1,227 +0,0 @@ -// This file is auto-generated! Do not modify it directly. -/* eslint-disable import/no-extraneous-dependencies, @typescript-eslint/consistent-type-imports, prettier/prettier */ -import * as _babel_types from '@babel/types'; - -type Plugin = - | "asyncDoExpressions" - | "asyncGenerators" - | "bigInt" - | "classPrivateMethods" - | "classPrivateProperties" - | "classProperties" - | "classStaticBlock" // Enabled by default - | "decimal" - | "decorators-legacy" - | "decoratorAutoAccessors" - | "destructuringPrivate" - | "doExpressions" - | "dynamicImport" - | "explicitResourceManagement" - | "exportDefaultFrom" - | "exportNamespaceFrom" // deprecated - | "flow" - | "flowComments" - | "functionBind" - | "functionSent" - | "importMeta" - | "jsx" - | "logicalAssignment" - | "importAssertions" - | "importReflection" - | "moduleBlocks" - | "moduleStringNames" - | "nullishCoalescingOperator" - | "numericSeparator" - | "objectRestSpread" - | "optionalCatchBinding" - | "optionalChaining" - | "partialApplication" - | "placeholders" - | "privateIn" // Enabled by default - | "regexpUnicodeSets" - | "throwExpressions" - | "topLevelAwait" - | "v8intrinsic" - | ParserPluginWithOptions[0]; - -type ParserPluginWithOptions = - | ["decorators", DecoratorsPluginOptions] - | ["estree", { classFeatures?: boolean }] - // @deprecated - | ["moduleAttributes", { version: "may-2020" }] - | ["pipelineOperator", PipelineOperatorPluginOptions] - | ["recordAndTuple", RecordAndTuplePluginOptions] - | ["flow", FlowPluginOptions] - | ["typescript", TypeScriptPluginOptions]; - -type PluginConfig = Plugin | ParserPluginWithOptions; - -interface DecoratorsPluginOptions { - decoratorsBeforeExport?: boolean; - allowCallParenthesized?: boolean; -} - -interface PipelineOperatorPluginOptions { - proposal: "minimal" | "fsharp" | "hack" | "smart"; - topicToken?: "%" | "#" | "@@" | "^^" | "^"; -} - -interface RecordAndTuplePluginOptions { - syntaxType: "bar" | "hash"; -} - -interface FlowPluginOptions { - all?: boolean; - enums?: boolean; -} - -interface TypeScriptPluginOptions { - dts?: boolean; - disallowAmbiguousJSXLike?: boolean; -} - -// Type definitions for @babel/parser -// Project: https://github.com/babel/babel/tree/main/packages/babel-parser -// Definitions by: Troy Gerwien -// Marvin Hagemeister -// Avi Vahl -// TypeScript Version: 2.9 - -/** - * Parse the provided code as an entire ECMAScript program. - */ -declare function parse( - input: string, - options?: ParserOptions -): ParseResult<_babel_types.File>; - -/** - * Parse the provided code as a single expression. - */ -declare function parseExpression( - input: string, - options?: ParserOptions -): ParseResult<_babel_types.Expression>; - -interface ParserOptions { - /** - * By default, import and export declarations can only appear at a program's top level. - * Setting this option to true allows them anywhere where a statement is allowed. - */ - allowImportExportEverywhere?: boolean; - - /** - * By default, await use is not allowed outside of an async function. - * Set this to true to accept such code. - */ - allowAwaitOutsideFunction?: boolean; - - /** - * By default, a return statement at the top level raises an error. - * Set this to true to accept such code. - */ - allowReturnOutsideFunction?: boolean; - - allowSuperOutsideMethod?: boolean; - - /** - * By default, exported identifiers must refer to a declared variable. - * Set this to true to allow export statements to reference undeclared variables. - */ - allowUndeclaredExports?: boolean; - - /** - * By default, Babel attaches comments to adjacent AST nodes. - * When this option is set to false, comments are not attached. - * It can provide up to 30% performance improvement when the input code has many comments. - * @babel/eslint-parser will set it for you. - * It is not recommended to use attachComment: false with Babel transform, - * as doing so removes all the comments in output code, and renders annotations such as - * /* istanbul ignore next *\/ nonfunctional. - */ - attachComment?: boolean; - - /** - * By default, Babel always throws an error when it finds some invalid code. - * When this option is set to true, it will store the parsing error and - * try to continue parsing the invalid input file. - */ - errorRecovery?: boolean; - - /** - * Indicate the mode the code should be parsed in. - * Can be one of "script", "module", or "unambiguous". Defaults to "script". - * "unambiguous" will make @babel/parser attempt to guess, based on the presence - * of ES6 import or export statements. - * Files with ES6 imports and exports are considered "module" and are otherwise "script". - */ - sourceType?: "script" | "module" | "unambiguous"; - - /** - * Correlate output AST nodes with their source filename. - * Useful when generating code and source maps from the ASTs of multiple input files. - */ - sourceFilename?: string; - - /** - * By default, the first line of code parsed is treated as line 1. - * You can provide a line number to alternatively start with. - * Useful for integration with other source tools. - */ - startLine?: number; - - /** - * By default, the parsed code is treated as if it starts from line 1, column 0. - * You can provide a column number to alternatively start with. - * Useful for integration with other source tools. - */ - startColumn?: number; - - /** - * Array containing the plugins that you want to enable. - */ - plugins?: ParserPlugin[]; - - /** - * Should the parser work in strict mode. - * Defaults to true if sourceType === 'module'. Otherwise, false. - */ - strictMode?: boolean; - - /** - * Adds a ranges property to each node: [node.start, node.end] - */ - ranges?: boolean; - - /** - * Adds all parsed tokens to a tokens property on the File node. - */ - tokens?: boolean; - - /** - * By default, the parser adds information about parentheses by setting - * `extra.parenthesized` to `true` as needed. - * When this option is `true` the parser creates `ParenthesizedExpression` - * AST nodes instead of using the `extra` property. - */ - createParenthesizedExpressions?: boolean; -} - -type ParserPlugin = PluginConfig; - - -declare const tokTypes: { - // todo(flow->ts) real token type - [name: string]: any; -}; - -interface ParseError { - code: string; - reasonCode: string; -} - -type ParseResult = Result & { - errors: ParseError[]; -}; - -export { DecoratorsPluginOptions, FlowPluginOptions, ParseError, ParserOptions, ParserPlugin, ParserPluginWithOptions, PipelineOperatorPluginOptions, RecordAndTuplePluginOptions, TypeScriptPluginOptions, parse, parseExpression, tokTypes }; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@babel/parser/typings/babel-parser.source.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@babel/parser/typings/babel-parser.source.d.ts deleted file mode 100644 index 0bcbefe6..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@babel/parser/typings/babel-parser.source.d.ts +++ /dev/null @@ -1,151 +0,0 @@ -// Type definitions for @babel/parser -// Project: https://github.com/babel/babel/tree/main/packages/babel-parser -// Definitions by: Troy Gerwien -// Marvin Hagemeister -// Avi Vahl -// TypeScript Version: 2.9 - -/** - * Parse the provided code as an entire ECMAScript program. - */ -export function parse( - input: string, - options?: ParserOptions -): ParseResult; - -/** - * Parse the provided code as a single expression. - */ -export function parseExpression( - input: string, - options?: ParserOptions -): ParseResult; - -export interface ParserOptions { - /** - * By default, import and export declarations can only appear at a program's top level. - * Setting this option to true allows them anywhere where a statement is allowed. - */ - allowImportExportEverywhere?: boolean; - - /** - * By default, await use is not allowed outside of an async function. - * Set this to true to accept such code. - */ - allowAwaitOutsideFunction?: boolean; - - /** - * By default, a return statement at the top level raises an error. - * Set this to true to accept such code. - */ - allowReturnOutsideFunction?: boolean; - - allowSuperOutsideMethod?: boolean; - - /** - * By default, exported identifiers must refer to a declared variable. - * Set this to true to allow export statements to reference undeclared variables. - */ - allowUndeclaredExports?: boolean; - - /** - * By default, Babel attaches comments to adjacent AST nodes. - * When this option is set to false, comments are not attached. - * It can provide up to 30% performance improvement when the input code has many comments. - * @babel/eslint-parser will set it for you. - * It is not recommended to use attachComment: false with Babel transform, - * as doing so removes all the comments in output code, and renders annotations such as - * /* istanbul ignore next *\/ nonfunctional. - */ - attachComment?: boolean; - - /** - * By default, Babel always throws an error when it finds some invalid code. - * When this option is set to true, it will store the parsing error and - * try to continue parsing the invalid input file. - */ - errorRecovery?: boolean; - - /** - * Indicate the mode the code should be parsed in. - * Can be one of "script", "module", or "unambiguous". Defaults to "script". - * "unambiguous" will make @babel/parser attempt to guess, based on the presence - * of ES6 import or export statements. - * Files with ES6 imports and exports are considered "module" and are otherwise "script". - */ - sourceType?: "script" | "module" | "unambiguous"; - - /** - * Correlate output AST nodes with their source filename. - * Useful when generating code and source maps from the ASTs of multiple input files. - */ - sourceFilename?: string; - - /** - * By default, the first line of code parsed is treated as line 1. - * You can provide a line number to alternatively start with. - * Useful for integration with other source tools. - */ - startLine?: number; - - /** - * By default, the parsed code is treated as if it starts from line 1, column 0. - * You can provide a column number to alternatively start with. - * Useful for integration with other source tools. - */ - startColumn?: number; - - /** - * Array containing the plugins that you want to enable. - */ - plugins?: ParserPlugin[]; - - /** - * Should the parser work in strict mode. - * Defaults to true if sourceType === 'module'. Otherwise, false. - */ - strictMode?: boolean; - - /** - * Adds a ranges property to each node: [node.start, node.end] - */ - ranges?: boolean; - - /** - * Adds all parsed tokens to a tokens property on the File node. - */ - tokens?: boolean; - - /** - * By default, the parser adds information about parentheses by setting - * `extra.parenthesized` to `true` as needed. - * When this option is `true` the parser creates `ParenthesizedExpression` - * AST nodes instead of using the `extra` property. - */ - createParenthesizedExpressions?: boolean; -} - -export type ParserPlugin = import("../src/typings").PluginConfig; - -export type { - ParserPluginWithOptions, - DecoratorsPluginOptions, - PipelineOperatorPluginOptions, - RecordAndTuplePluginOptions, - FlowPluginOptions, - TypeScriptPluginOptions, -} from "../src/typings"; - -export const tokTypes: { - // todo(flow->ts) real token type - [name: string]: any; -}; - -export interface ParseError { - code: string; - reasonCode: string; -} - -type ParseResult = Result & { - errors: ParseError[]; -}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@fastify/busboy/LICENSE b/packages/wyatt_notification_bloc/example/scripts/node_modules/@fastify/busboy/LICENSE deleted file mode 100644 index 290762e9..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@fastify/busboy/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright Brian White. All rights reserved. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to -deal in the Software without restriction, including without limitation the -rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -sell copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -IN THE SOFTWARE. \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@fastify/busboy/README.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/@fastify/busboy/README.md deleted file mode 100644 index 70e04663..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@fastify/busboy/README.md +++ /dev/null @@ -1,271 +0,0 @@ -# busboy - -
- -[![Build Status](https://github.com/fastify/busboy/workflows/ci/badge.svg)](https://github.com/fastify/busboy/actions) -[![Coverage Status](https://coveralls.io/repos/fastify/busboy/badge.svg?branch=master)](https://coveralls.io/r/fastify/busboy?branch=master) -[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](https://standardjs.com/) -[![Security Responsible Disclosure](https://img.shields.io/badge/Security-Responsible%20Disclosure-yellow.svg)](https://github.com/nodejs/security-wg/blob/HEAD/processes/responsible_disclosure_template.md) - -
- -
- -[![NPM version](https://img.shields.io/npm/v/@fastify/busboy.svg?style=flat)](https://www.npmjs.com/package/@fastify/busboy) -[![NPM downloads](https://img.shields.io/npm/dm/@fastify/busboy.svg?style=flat)](https://www.npmjs.com/package/@fastify/busboy) - -
- -Description -=========== - -A Node.js module for parsing incoming HTML form data. - -This is an officially supported fork by [fastify](https://github.com/fastify/) organization of the amazing library [originally created](https://github.com/mscdex/busboy) by Brian White, -aimed at addressing long-standing issues with it. - -Benchmark (Mean time for 500 Kb payload, 2000 cycles, 1000 cycle warmup): - -| Library | Version | Mean time in nanoseconds (less is better) | -|-----------------------|---------|-------------------------------------------| -| busboy | 0.3.1 | `340114` | -| @fastify/busboy | 1.0.0 | `270984` | - -[Changelog](https://github.com/fastify/busboy/blob/master/CHANGELOG.md) since busboy 0.31. - -Requirements -============ - -* [Node.js](http://nodejs.org/) 10+ - - -Install -======= - - npm install @fastify/busboy - - -Examples -======== - -* Parsing (multipart) with default options: - -```javascript -const http = require('http'); -const { inspect } = require('util'); -const Busboy = require('busboy'); - -http.createServer((req, res) => { - if (req.method === 'POST') { - const busboy = new Busboy({ headers: req.headers }); - busboy.on('file', (fieldname, file, filename, encoding, mimetype) => { - console.log(`File [${fieldname}]: filename: ${filename}, encoding: ${encoding}, mimetype: ${mimetype}`); - file.on('data', data => { - console.log(`File [${fieldname}] got ${data.length} bytes`); - }); - file.on('end', () => { - console.log(`File [${fieldname}] Finished`); - }); - }); - busboy.on('field', (fieldname, val, fieldnameTruncated, valTruncated, encoding, mimetype) => { - console.log(`Field [${fieldname}]: value: ${inspect(val)}`); - }); - busboy.on('finish', () => { - console.log('Done parsing form!'); - res.writeHead(303, { Connection: 'close', Location: '/' }); - res.end(); - }); - req.pipe(busboy); - } else if (req.method === 'GET') { - res.writeHead(200, { Connection: 'close' }); - res.end(` -
-
-
- -
- `); - } -}).listen(8000, () => { - console.log('Listening for requests'); -}); - -// Example output, using http://nodejs.org/images/ryan-speaker.jpg as the file: -// -// Listening for requests -// File [filefield]: filename: ryan-speaker.jpg, encoding: binary -// File [filefield] got 11971 bytes -// Field [textfield]: value: 'testing! :-)' -// File [filefield] Finished -// Done parsing form! -``` - -* Save all incoming files to disk: - -```javascript -const http = require('http'); -const path = require('path'); -const os = require('os'); -const fs = require('fs'); - -const Busboy = require('busboy'); - -http.createServer(function(req, res) { - if (req.method === 'POST') { - const busboy = new Busboy({ headers: req.headers }); - busboy.on('file', function(fieldname, file, filename, encoding, mimetype) { - var saveTo = path.join(os.tmpdir(), path.basename(fieldname)); - file.pipe(fs.createWriteStream(saveTo)); - }); - busboy.on('finish', function() { - res.writeHead(200, { 'Connection': 'close' }); - res.end("That's all folks!"); - }); - return req.pipe(busboy); - } - res.writeHead(404); - res.end(); -}).listen(8000, function() { - console.log('Listening for requests'); -}); -``` - -* Parsing (urlencoded) with default options: - -```javascript -const http = require('http'); -const { inspect } = require('util'); - -const Busboy = require('busboy'); - -http.createServer(function(req, res) { - if (req.method === 'POST') { - const busboy = new Busboy({ headers: req.headers }); - busboy.on('file', function(fieldname, file, filename, encoding, mimetype) { - console.log('File [' + fieldname + ']: filename: ' + filename); - file.on('data', function(data) { - console.log('File [' + fieldname + '] got ' + data.length + ' bytes'); - }); - file.on('end', function() { - console.log('File [' + fieldname + '] Finished'); - }); - }); - busboy.on('field', function(fieldname, val, fieldnameTruncated, valTruncated) { - console.log('Field [' + fieldname + ']: value: ' + inspect(val)); - }); - busboy.on('finish', function() { - console.log('Done parsing form!'); - res.writeHead(303, { Connection: 'close', Location: '/' }); - res.end(); - }); - req.pipe(busboy); - } else if (req.method === 'GET') { - res.writeHead(200, { Connection: 'close' }); - res.end('\ -
\ -
\ -
\ - Node.js rules!
\ - \ -
\ - '); - } -}).listen(8000, function() { - console.log('Listening for requests'); -}); - -// Example output: -// -// Listening for requests -// Field [textfield]: value: 'testing! :-)' -// Field [selectfield]: value: '9001' -// Field [checkfield]: value: 'on' -// Done parsing form! -``` - - -API -=== - -_Busboy_ is a _Writable_ stream - -Busboy (special) events ------------------------ - -* **file**(< _string_ >fieldname, < _ReadableStream_ >stream, < _string_ >filename, < _string_ >transferEncoding, < _string_ >mimeType) - Emitted for each new file form field found. `transferEncoding` contains the 'Content-Transfer-Encoding' value for the file stream. `mimeType` contains the 'Content-Type' value for the file stream. - * Note: if you listen for this event, you should always handle the `stream` no matter if you care about the file contents or not (e.g. you can simply just do `stream.resume();` if you want to discard the contents), otherwise the 'finish' event will never fire on the Busboy instance. However, if you don't care about **any** incoming files, you can simply not listen for the 'file' event at all and any/all files will be automatically and safely discarded (these discarded files do still count towards `files` and `parts` limits). - * If a configured file size limit was reached, `stream` will both have a boolean property `truncated` (best checked at the end of the stream) and emit a 'limit' event to notify you when this happens. - * The property `bytesRead` informs about the number of bytes that have been read so far. - -* **field**(< _string_ >fieldname, < _string_ >value, < _boolean_ >fieldnameTruncated, < _boolean_ >valueTruncated, < _string_ >transferEncoding, < _string_ >mimeType) - Emitted for each new non-file field found. - -* **partsLimit**() - Emitted when specified `parts` limit has been reached. No more 'file' or 'field' events will be emitted. - -* **filesLimit**() - Emitted when specified `files` limit has been reached. No more 'file' events will be emitted. - -* **fieldsLimit**() - Emitted when specified `fields` limit has been reached. No more 'field' events will be emitted. - - -Busboy methods --------------- - -* **(constructor)**(< _object_ >config) - Creates and returns a new Busboy instance. - - * The constructor takes the following valid `config` settings: - - * **headers** - _object_ - These are the HTTP headers of the incoming request, which are used by individual parsers. - - * **autoDestroy** - _boolean_ - Whether this stream should automatically call .destroy() on itself after ending. (Default: false). - - * **highWaterMark** - _integer_ - highWaterMark to use for this Busboy instance (Default: WritableStream default). - - * **fileHwm** - _integer_ - highWaterMark to use for file streams (Default: ReadableStream default). - - * **defCharset** - _string_ - Default character set to use when one isn't defined (Default: 'utf8'). - - * **preservePath** - _boolean_ - If paths in the multipart 'filename' field shall be preserved. (Default: false). - - * **isPartAFile** - __function__ - Use this function to override the default file detection functionality. It has following parameters: - - * fieldName - __string__ The name of the field. - - * contentType - __string__ The content-type of the part, e.g. `text/plain`, `image/jpeg`, `application/octet-stream` - - * fileName - __string__ The name of a file supplied by the part. - - (Default: `(fieldName, contentType, fileName) => (contentType === 'application/octet-stream' || fileName !== undefined)`) - - * **limits** - _object_ - Various limits on incoming data. Valid properties are: - - * **fieldNameSize** - _integer_ - Max field name size (in bytes) (Default: 100 bytes). - - * **fieldSize** - _integer_ - Max field value size (in bytes) (Default: 1 MiB, which is 1024 x 1024 bytes). - - * **fields** - _integer_ - Max number of non-file fields (Default: Infinity). - - * **fileSize** - _integer_ - For multipart forms, the max file size (in bytes) (Default: Infinity). - - * **files** - _integer_ - For multipart forms, the max number of file fields (Default: Infinity). - - * **parts** - _integer_ - For multipart forms, the max number of parts (fields + files) (Default: Infinity). - - * **headerPairs** - _integer_ - For multipart forms, the max number of header key=>value pairs to parse **Default:** 2000 - - * **headerSize** - _integer_ - For multipart forms, the max size of a multipart header **Default:** 81920. - - * The constructor can throw errors: - - * **Busboy expected an options-Object.** - Busboy expected an Object as first parameters. - - * **Busboy expected an options-Object with headers-attribute.** - The first parameter is lacking of a headers-attribute. - - * **Limit $limit is not a valid number** - Busboy expected the desired limit to be of type number. Busboy throws this Error to prevent a potential security issue by falling silently back to the Busboy-defaults. Potential source for this Error can be the direct use of environment variables without transforming them to the type number. - - * **Unsupported Content-Type.** - The `Content-Type` isn't one Busboy can parse. - - * **Missing Content-Type-header.** - The provided headers don't include `Content-Type` at all. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@fastify/busboy/deps/dicer/LICENSE b/packages/wyatt_notification_bloc/example/scripts/node_modules/@fastify/busboy/deps/dicer/LICENSE deleted file mode 100644 index 290762e9..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@fastify/busboy/deps/dicer/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright Brian White. All rights reserved. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to -deal in the Software without restriction, including without limitation the -rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -sell copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -IN THE SOFTWARE. \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@fastify/busboy/deps/dicer/lib/Dicer.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/@fastify/busboy/deps/dicer/lib/Dicer.js deleted file mode 100644 index fc50a509..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@fastify/busboy/deps/dicer/lib/Dicer.js +++ /dev/null @@ -1,205 +0,0 @@ -const WritableStream = require('stream').Writable -const inherits = require('util').inherits - -const StreamSearch = require('../../streamsearch/sbmh') - -const PartStream = require('./PartStream') -const HeaderParser = require('./HeaderParser') - -const DASH = 45 -const B_ONEDASH = Buffer.from('-') -const B_CRLF = Buffer.from('\r\n') -const EMPTY_FN = function () {} - -function Dicer (cfg) { - if (!(this instanceof Dicer)) { return new Dicer(cfg) } - WritableStream.call(this, cfg) - - if (!cfg || (!cfg.headerFirst && typeof cfg.boundary !== 'string')) { throw new TypeError('Boundary required') } - - if (typeof cfg.boundary === 'string') { this.setBoundary(cfg.boundary) } else { this._bparser = undefined } - - this._headerFirst = cfg.headerFirst - - this._dashes = 0 - this._parts = 0 - this._finished = false - this._realFinish = false - this._isPreamble = true - this._justMatched = false - this._firstWrite = true - this._inHeader = true - this._part = undefined - this._cb = undefined - this._ignoreData = false - this._partOpts = { highWaterMark: cfg.partHwm } - this._pause = false - - const self = this - this._hparser = new HeaderParser(cfg) - this._hparser.on('header', function (header) { - self._inHeader = false - self._part.emit('header', header) - }) -} -inherits(Dicer, WritableStream) - -Dicer.prototype.emit = function (ev) { - if (ev === 'finish' && !this._realFinish) { - if (!this._finished) { - const self = this - process.nextTick(function () { - self.emit('error', new Error('Unexpected end of multipart data')) - if (self._part && !self._ignoreData) { - const type = (self._isPreamble ? 'Preamble' : 'Part') - self._part.emit('error', new Error(type + ' terminated early due to unexpected end of multipart data')) - self._part.push(null) - process.nextTick(function () { - self._realFinish = true - self.emit('finish') - self._realFinish = false - }) - return - } - self._realFinish = true - self.emit('finish') - self._realFinish = false - }) - } - } else { WritableStream.prototype.emit.apply(this, arguments) } -} - -Dicer.prototype._write = function (data, encoding, cb) { - // ignore unexpected data (e.g. extra trailer data after finished) - if (!this._hparser && !this._bparser) { return cb() } - - if (this._headerFirst && this._isPreamble) { - if (!this._part) { - this._part = new PartStream(this._partOpts) - if (this._events.preamble) { this.emit('preamble', this._part) } else { this._ignore() } - } - const r = this._hparser.push(data) - if (!this._inHeader && r !== undefined && r < data.length) { data = data.slice(r) } else { return cb() } - } - - // allows for "easier" testing - if (this._firstWrite) { - this._bparser.push(B_CRLF) - this._firstWrite = false - } - - this._bparser.push(data) - - if (this._pause) { this._cb = cb } else { cb() } -} - -Dicer.prototype.reset = function () { - this._part = undefined - this._bparser = undefined - this._hparser = undefined -} - -Dicer.prototype.setBoundary = function (boundary) { - const self = this - this._bparser = new StreamSearch('\r\n--' + boundary) - this._bparser.on('info', function (isMatch, data, start, end) { - self._oninfo(isMatch, data, start, end) - }) -} - -Dicer.prototype._ignore = function () { - if (this._part && !this._ignoreData) { - this._ignoreData = true - this._part.on('error', EMPTY_FN) - // we must perform some kind of read on the stream even though we are - // ignoring the data, otherwise node's Readable stream will not emit 'end' - // after pushing null to the stream - this._part.resume() - } -} - -Dicer.prototype._oninfo = function (isMatch, data, start, end) { - let buf; const self = this; let i = 0; let r; let shouldWriteMore = true - - if (!this._part && this._justMatched && data) { - while (this._dashes < 2 && (start + i) < end) { - if (data[start + i] === DASH) { - ++i - ++this._dashes - } else { - if (this._dashes) { buf = B_ONEDASH } - this._dashes = 0 - break - } - } - if (this._dashes === 2) { - if ((start + i) < end && this._events.trailer) { this.emit('trailer', data.slice(start + i, end)) } - this.reset() - this._finished = true - // no more parts will be added - if (self._parts === 0) { - self._realFinish = true - self.emit('finish') - self._realFinish = false - } - } - if (this._dashes) { return } - } - if (this._justMatched) { this._justMatched = false } - if (!this._part) { - this._part = new PartStream(this._partOpts) - this._part._read = function (n) { - self._unpause() - } - if (this._isPreamble && this._events.preamble) { this.emit('preamble', this._part) } else if (this._isPreamble !== true && this._events.part) { this.emit('part', this._part) } else { this._ignore() } - if (!this._isPreamble) { this._inHeader = true } - } - if (data && start < end && !this._ignoreData) { - if (this._isPreamble || !this._inHeader) { - if (buf) { shouldWriteMore = this._part.push(buf) } - shouldWriteMore = this._part.push(data.slice(start, end)) - if (!shouldWriteMore) { this._pause = true } - } else if (!this._isPreamble && this._inHeader) { - if (buf) { this._hparser.push(buf) } - r = this._hparser.push(data.slice(start, end)) - if (!this._inHeader && r !== undefined && r < end) { this._oninfo(false, data, start + r, end) } - } - } - if (isMatch) { - this._hparser.reset() - if (this._isPreamble) { this._isPreamble = false } else { - if (start !== end) { - ++this._parts - this._part.on('end', function () { - if (--self._parts === 0) { - if (self._finished) { - self._realFinish = true - self.emit('finish') - self._realFinish = false - } else { - self._unpause() - } - } - }) - } - } - this._part.push(null) - this._part = undefined - this._ignoreData = false - this._justMatched = true - this._dashes = 0 - } -} - -Dicer.prototype._unpause = function () { - if (!this._pause) { return } - - this._pause = false - if (this._cb) { - const cb = this._cb - this._cb = undefined - cb() - } -} - -module.exports = Dicer diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@fastify/busboy/deps/dicer/lib/HeaderParser.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/@fastify/busboy/deps/dicer/lib/HeaderParser.js deleted file mode 100644 index a11fd908..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@fastify/busboy/deps/dicer/lib/HeaderParser.js +++ /dev/null @@ -1,98 +0,0 @@ -const EventEmitter = require('events').EventEmitter -const inherits = require('util').inherits -const getLimit = require('../../../lib/utils').getLimit - -const StreamSearch = require('../../streamsearch/sbmh') - -const B_DCRLF = Buffer.from('\r\n\r\n') -const RE_CRLF = /\r\n/g -const RE_HDR = /^([^:]+):[ \t]?([\x00-\xFF]+)?$/ // eslint-disable-line no-control-regex - -function HeaderParser (cfg) { - EventEmitter.call(this) - - cfg = cfg || {} - const self = this - this.nread = 0 - this.maxed = false - this.npairs = 0 - this.maxHeaderPairs = getLimit(cfg, 'maxHeaderPairs', 2000) - this.maxHeaderSize = getLimit(cfg, 'maxHeaderSize', 80 * 1024) - this.buffer = '' - this.header = {} - this.finished = false - this.ss = new StreamSearch(B_DCRLF) - this.ss.on('info', function (isMatch, data, start, end) { - if (data && !self.maxed) { - if (self.nread + end - start >= self.maxHeaderSize) { - end = self.maxHeaderSize - self.nread + start - self.nread = self.maxHeaderSize - self.maxed = true - } else { self.nread += (end - start) } - - self.buffer += data.toString('binary', start, end) - } - if (isMatch) { self._finish() } - }) -} -inherits(HeaderParser, EventEmitter) - -HeaderParser.prototype.push = function (data) { - const r = this.ss.push(data) - if (this.finished) { return r } -} - -HeaderParser.prototype.reset = function () { - this.finished = false - this.buffer = '' - this.header = {} - this.ss.reset() -} - -HeaderParser.prototype._finish = function () { - if (this.buffer) { this._parseHeader() } - this.ss.matches = this.ss.maxMatches - const header = this.header - this.header = {} - this.buffer = '' - this.finished = true - this.nread = this.npairs = 0 - this.maxed = false - this.emit('header', header) -} - -HeaderParser.prototype._parseHeader = function () { - if (this.npairs === this.maxHeaderPairs) { return } - - const lines = this.buffer.split(RE_CRLF) - const len = lines.length - let m, h - - for (var i = 0; i < len; ++i) { // eslint-disable-line no-var - if (lines[i].length === 0) { continue } - if (lines[i][0] === '\t' || lines[i][0] === ' ') { - // folded header content - // RFC2822 says to just remove the CRLF and not the whitespace following - // it, so we follow the RFC and include the leading whitespace ... - if (h) { - this.header[h][this.header[h].length - 1] += lines[i] - continue - } - } - - const posColon = lines[i].indexOf(':') - if ( - posColon === -1 || - posColon === 0 - ) { - return - } - m = RE_HDR.exec(lines[i]) - h = m[1].toLowerCase() - this.header[h] = this.header[h] || [] - this.header[h].push((m[2] || '')) - if (++this.npairs === this.maxHeaderPairs) { break } - } -} - -module.exports = HeaderParser diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@fastify/busboy/deps/dicer/lib/PartStream.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/@fastify/busboy/deps/dicer/lib/PartStream.js deleted file mode 100644 index c969bdad..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@fastify/busboy/deps/dicer/lib/PartStream.js +++ /dev/null @@ -1,11 +0,0 @@ -const inherits = require('util').inherits -const ReadableStream = require('stream').Readable - -function PartStream (opts) { - ReadableStream.call(this, opts) -} -inherits(PartStream, ReadableStream) - -PartStream.prototype._read = function (n) {} - -module.exports = PartStream diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@fastify/busboy/deps/dicer/lib/dicer.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@fastify/busboy/deps/dicer/lib/dicer.d.ts deleted file mode 100644 index 3c5b8962..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@fastify/busboy/deps/dicer/lib/dicer.d.ts +++ /dev/null @@ -1,164 +0,0 @@ -// Type definitions for dicer 0.2 -// Project: https://github.com/mscdex/dicer -// Definitions by: BendingBender -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.2 -/// - -import stream = require("stream"); - -// tslint:disable:unified-signatures - -/** - * A very fast streaming multipart parser for node.js. - * Dicer is a WritableStream - * - * Dicer (special) events: - * - on('finish', ()) - Emitted when all parts have been parsed and the Dicer instance has been ended. - * - on('part', (stream: PartStream)) - Emitted when a new part has been found. - * - on('preamble', (stream: PartStream)) - Emitted for preamble if you should happen to need it (can usually be ignored). - * - on('trailer', (data: Buffer)) - Emitted when trailing data was found after the terminating boundary (as with the preamble, this can usually be ignored too). - */ -export class Dicer extends stream.Writable { - /** - * Creates and returns a new Dicer instance with the following valid config settings: - * - * @param config The configuration to use - */ - constructor(config: Dicer.Config); - /** - * Sets the boundary to use for parsing and performs some initialization needed for parsing. - * You should only need to use this if you set headerFirst to true in the constructor and are parsing the boundary from the preamble header. - * - * @param boundary The boundary to use - */ - setBoundary(boundary: string): void; - addListener(event: "finish", listener: () => void): this; - addListener(event: "part", listener: (stream: Dicer.PartStream) => void): this; - addListener(event: "preamble", listener: (stream: Dicer.PartStream) => void): this; - addListener(event: "trailer", listener: (data: Buffer) => void): this; - addListener(event: "close", listener: () => void): this; - addListener(event: "drain", listener: () => void): this; - addListener(event: "error", listener: (err: Error) => void): this; - addListener(event: "pipe", listener: (src: stream.Readable) => void): this; - addListener(event: "unpipe", listener: (src: stream.Readable) => void): this; - addListener(event: string, listener: (...args: any[]) => void): this; - on(event: "finish", listener: () => void): this; - on(event: "part", listener: (stream: Dicer.PartStream) => void): this; - on(event: "preamble", listener: (stream: Dicer.PartStream) => void): this; - on(event: "trailer", listener: (data: Buffer) => void): this; - on(event: "close", listener: () => void): this; - on(event: "drain", listener: () => void): this; - on(event: "error", listener: (err: Error) => void): this; - on(event: "pipe", listener: (src: stream.Readable) => void): this; - on(event: "unpipe", listener: (src: stream.Readable) => void): this; - on(event: string, listener: (...args: any[]) => void): this; - once(event: "finish", listener: () => void): this; - once(event: "part", listener: (stream: Dicer.PartStream) => void): this; - once(event: "preamble", listener: (stream: Dicer.PartStream) => void): this; - once(event: "trailer", listener: (data: Buffer) => void): this; - once(event: "close", listener: () => void): this; - once(event: "drain", listener: () => void): this; - once(event: "error", listener: (err: Error) => void): this; - once(event: "pipe", listener: (src: stream.Readable) => void): this; - once(event: "unpipe", listener: (src: stream.Readable) => void): this; - once(event: string, listener: (...args: any[]) => void): this; - prependListener(event: "finish", listener: () => void): this; - prependListener(event: "part", listener: (stream: Dicer.PartStream) => void): this; - prependListener(event: "preamble", listener: (stream: Dicer.PartStream) => void): this; - prependListener(event: "trailer", listener: (data: Buffer) => void): this; - prependListener(event: "close", listener: () => void): this; - prependListener(event: "drain", listener: () => void): this; - prependListener(event: "error", listener: (err: Error) => void): this; - prependListener(event: "pipe", listener: (src: stream.Readable) => void): this; - prependListener(event: "unpipe", listener: (src: stream.Readable) => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: "finish", listener: () => void): this; - prependOnceListener(event: "part", listener: (stream: Dicer.PartStream) => void): this; - prependOnceListener(event: "preamble", listener: (stream: Dicer.PartStream) => void): this; - prependOnceListener(event: "trailer", listener: (data: Buffer) => void): this; - prependOnceListener(event: "close", listener: () => void): this; - prependOnceListener(event: "drain", listener: () => void): this; - prependOnceListener(event: "error", listener: (err: Error) => void): this; - prependOnceListener(event: "pipe", listener: (src: stream.Readable) => void): this; - prependOnceListener(event: "unpipe", listener: (src: stream.Readable) => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - removeListener(event: "finish", listener: () => void): this; - removeListener(event: "part", listener: (stream: Dicer.PartStream) => void): this; - removeListener(event: "preamble", listener: (stream: Dicer.PartStream) => void): this; - removeListener(event: "trailer", listener: (data: Buffer) => void): this; - removeListener(event: "close", listener: () => void): this; - removeListener(event: "drain", listener: () => void): this; - removeListener(event: "error", listener: (err: Error) => void): this; - removeListener(event: "pipe", listener: (src: stream.Readable) => void): this; - removeListener(event: "unpipe", listener: (src: stream.Readable) => void): this; - removeListener(event: string, listener: (...args: any[]) => void): this; -} - -declare namespace Dicer { - interface Config { - /** - * This is the boundary used to detect the beginning of a new part. - */ - boundary?: string | undefined; - /** - * If true, preamble header parsing will be performed first. - */ - headerFirst?: boolean | undefined; - /** - * The maximum number of header key=>value pairs to parse Default: 2000 (same as node's http). - */ - maxHeaderPairs?: number | undefined; - } - - /** - * PartStream is a _ReadableStream_ - * - * PartStream (special) events: - * - on('header', (header: object)) - An object containing the header for this particular part. Each property value is an array of one or more string values. - */ - interface PartStream extends stream.Readable { - addListener(event: "header", listener: (header: object) => void): this; - addListener(event: "close", listener: () => void): this; - addListener(event: "data", listener: (chunk: Buffer | string) => void): this; - addListener(event: "end", listener: () => void): this; - addListener(event: "readable", listener: () => void): this; - addListener(event: "error", listener: (err: Error) => void): this; - addListener(event: string, listener: (...args: any[]) => void): this; - on(event: "header", listener: (header: object) => void): this; - on(event: "close", listener: () => void): this; - on(event: "data", listener: (chunk: Buffer | string) => void): this; - on(event: "end", listener: () => void): this; - on(event: "readable", listener: () => void): this; - on(event: "error", listener: (err: Error) => void): this; - on(event: string, listener: (...args: any[]) => void): this; - once(event: "header", listener: (header: object) => void): this; - once(event: "close", listener: () => void): this; - once(event: "data", listener: (chunk: Buffer | string) => void): this; - once(event: "end", listener: () => void): this; - once(event: "readable", listener: () => void): this; - once(event: "error", listener: (err: Error) => void): this; - once(event: string, listener: (...args: any[]) => void): this; - prependListener(event: "header", listener: (header: object) => void): this; - prependListener(event: "close", listener: () => void): this; - prependListener(event: "data", listener: (chunk: Buffer | string) => void): this; - prependListener(event: "end", listener: () => void): this; - prependListener(event: "readable", listener: () => void): this; - prependListener(event: "error", listener: (err: Error) => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: "header", listener: (header: object) => void): this; - prependOnceListener(event: "close", listener: () => void): this; - prependOnceListener(event: "data", listener: (chunk: Buffer | string) => void): this; - prependOnceListener(event: "end", listener: () => void): this; - prependOnceListener(event: "readable", listener: () => void): this; - prependOnceListener(event: "error", listener: (err: Error) => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - removeListener(event: "header", listener: (header: object) => void): this; - removeListener(event: "close", listener: () => void): this; - removeListener(event: "data", listener: (chunk: Buffer | string) => void): this; - removeListener(event: "end", listener: () => void): this; - removeListener(event: "readable", listener: () => void): this; - removeListener(event: "error", listener: (err: Error) => void): this; - removeListener(event: string, listener: (...args: any[]) => void): this; - } -} \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@fastify/busboy/deps/streamsearch/sbmh.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/@fastify/busboy/deps/streamsearch/sbmh.js deleted file mode 100644 index 7f79e598..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@fastify/busboy/deps/streamsearch/sbmh.js +++ /dev/null @@ -1,226 +0,0 @@ -/** - * Copyright Brian White. All rights reserved. - * - * @see https://github.com/mscdex/streamsearch - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to - * deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS - * IN THE SOFTWARE. - * - * Based heavily on the Streaming Boyer-Moore-Horspool C++ implementation - * by Hongli Lai at: https://github.com/FooBarWidget/boyer-moore-horspool - */ -const EventEmitter = require('events').EventEmitter -const inherits = require('util').inherits - -function SBMH (needle) { - if (typeof needle === 'string') { - needle = Buffer.from(needle) - } - - if (!Buffer.isBuffer(needle)) { - throw new TypeError('The needle has to be a String or a Buffer.') - } - - const needleLength = needle.length - - if (needleLength === 0) { - throw new Error('The needle cannot be an empty String/Buffer.') - } - - if (needleLength > 256) { - throw new Error('The needle cannot have a length bigger than 256.') - } - - this.maxMatches = Infinity - this.matches = 0 - - this._occ = new Array(256) - .fill(needleLength) // Initialize occurrence table. - this._lookbehind_size = 0 - this._needle = needle - this._bufpos = 0 - - this._lookbehind = Buffer.alloc(needleLength) - - // Populate occurrence table with analysis of the needle, - // ignoring last letter. - for (var i = 0; i < needleLength - 1; ++i) { // eslint-disable-line no-var - this._occ[needle[i]] = needleLength - 1 - i - } -} -inherits(SBMH, EventEmitter) - -SBMH.prototype.reset = function () { - this._lookbehind_size = 0 - this.matches = 0 - this._bufpos = 0 -} - -SBMH.prototype.push = function (chunk, pos) { - if (!Buffer.isBuffer(chunk)) { - chunk = Buffer.from(chunk, 'binary') - } - const chlen = chunk.length - this._bufpos = pos || 0 - let r - while (r !== chlen && this.matches < this.maxMatches) { r = this._sbmh_feed(chunk) } - return r -} - -SBMH.prototype._sbmh_feed = function (data) { - const len = data.length - const needle = this._needle - const needleLength = needle.length - const lastNeedleChar = needle[needleLength - 1] - - // Positive: points to a position in `data` - // pos == 3 points to data[3] - // Negative: points to a position in the lookbehind buffer - // pos == -2 points to lookbehind[lookbehind_size - 2] - let pos = -this._lookbehind_size - let ch - - if (pos < 0) { - // Lookbehind buffer is not empty. Perform Boyer-Moore-Horspool - // search with character lookup code that considers both the - // lookbehind buffer and the current round's haystack data. - // - // Loop until - // there is a match. - // or until - // we've moved past the position that requires the - // lookbehind buffer. In this case we switch to the - // optimized loop. - // or until - // the character to look at lies outside the haystack. - while (pos < 0 && pos <= len - needleLength) { - ch = this._sbmh_lookup_char(data, pos + needleLength - 1) - - if ( - ch === lastNeedleChar && - this._sbmh_memcmp(data, pos, needleLength - 1) - ) { - this._lookbehind_size = 0 - ++this.matches - this.emit('info', true) - - return (this._bufpos = pos + needleLength) - } - pos += this._occ[ch] - } - - // No match. - - if (pos < 0) { - // There's too few data for Boyer-Moore-Horspool to run, - // so let's use a different algorithm to skip as much as - // we can. - // Forward pos until - // the trailing part of lookbehind + data - // looks like the beginning of the needle - // or until - // pos == 0 - while (pos < 0 && !this._sbmh_memcmp(data, pos, len - pos)) { ++pos } - } - - if (pos >= 0) { - // Discard lookbehind buffer. - this.emit('info', false, this._lookbehind, 0, this._lookbehind_size) - this._lookbehind_size = 0 - } else { - // Cut off part of the lookbehind buffer that has - // been processed and append the entire haystack - // into it. - const bytesToCutOff = this._lookbehind_size + pos - if (bytesToCutOff > 0) { - // The cut off data is guaranteed not to contain the needle. - this.emit('info', false, this._lookbehind, 0, bytesToCutOff) - } - - this._lookbehind.copy(this._lookbehind, 0, bytesToCutOff, - this._lookbehind_size - bytesToCutOff) - this._lookbehind_size -= bytesToCutOff - - data.copy(this._lookbehind, this._lookbehind_size) - this._lookbehind_size += len - - this._bufpos = len - return len - } - } - - pos += (pos >= 0) * this._bufpos - - // Lookbehind buffer is now empty. We only need to check if the - // needle is in the haystack. - if (data.indexOf(needle, pos) !== -1) { - pos = data.indexOf(needle, pos) - ++this.matches - if (pos > 0) { this.emit('info', true, data, this._bufpos, pos) } else { this.emit('info', true) } - - return (this._bufpos = pos + needleLength) - } else { - pos = len - needleLength - } - - // There was no match. If there's trailing haystack data that we cannot - // match yet using the Boyer-Moore-Horspool algorithm (because the trailing - // data is less than the needle size) then match using a modified - // algorithm that starts matching from the beginning instead of the end. - // Whatever trailing data is left after running this algorithm is added to - // the lookbehind buffer. - while ( - pos < len && - ( - data[pos] !== needle[0] || - ( - (Buffer.compare( - data.subarray(pos, pos + len - pos), - needle.subarray(0, len - pos) - ) !== 0) - ) - ) - ) { - ++pos - } - if (pos < len) { - data.copy(this._lookbehind, 0, pos, pos + (len - pos)) - this._lookbehind_size = len - pos - } - - // Everything until pos is guaranteed not to contain needle data. - if (pos > 0) { this.emit('info', false, data, this._bufpos, pos < len ? pos : len) } - - this._bufpos = len - return len -} - -SBMH.prototype._sbmh_lookup_char = function (data, pos) { - return (pos < 0) - ? this._lookbehind[this._lookbehind_size + pos] - : data[pos] -} - -SBMH.prototype._sbmh_memcmp = function (data, pos, len) { - for (var i = 0; i < len; ++i) { // eslint-disable-line no-var - if (this._sbmh_lookup_char(data, pos + i) !== this._needle[i]) { return false } - } - return true -} - -module.exports = SBMH diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@fastify/busboy/lib/main.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@fastify/busboy/lib/main.d.ts deleted file mode 100644 index 91b64483..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@fastify/busboy/lib/main.d.ts +++ /dev/null @@ -1,196 +0,0 @@ -// Definitions by: Jacob Baskin -// BendingBender -// Igor Savin - -/// - -import * as http from 'http'; -import { Readable, Writable } from 'stream'; -export { Dicer } from "../deps/dicer/lib/dicer"; - -export const Busboy: BusboyConstructor; -export default Busboy; - -export interface BusboyConfig { - /** - * These are the HTTP headers of the incoming request, which are used by individual parsers. - */ - headers: BusboyHeaders; - /** - * `highWaterMark` to use for this Busboy instance. - * @default WritableStream default. - */ - highWaterMark?: number | undefined; - /** - * highWaterMark to use for file streams. - * @default ReadableStream default. - */ - fileHwm?: number | undefined; - /** - * Default character set to use when one isn't defined. - * @default 'utf8' - */ - defCharset?: string | undefined; - /** - * Detect if a Part is a file. - * - * By default a file is detected if contentType - * is application/octet-stream or fileName is not - * undefined. - * - * Modify this to handle e.g. Blobs. - */ - isPartAFile?: (fieldName: string | undefined, contentType: string | undefined, fileName: string | undefined) => boolean; - /** - * If paths in the multipart 'filename' field shall be preserved. - * @default false - */ - preservePath?: boolean | undefined; - /** - * Various limits on incoming data. - */ - limits?: - | { - /** - * Max field name size (in bytes) - * @default 100 bytes - */ - fieldNameSize?: number | undefined; - /** - * Max field value size (in bytes) - * @default 1MB - */ - fieldSize?: number | undefined; - /** - * Max number of non-file fields - * @default Infinity - */ - fields?: number | undefined; - /** - * For multipart forms, the max file size (in bytes) - * @default Infinity - */ - fileSize?: number | undefined; - /** - * For multipart forms, the max number of file fields - * @default Infinity - */ - files?: number | undefined; - /** - * For multipart forms, the max number of parts (fields + files) - * @default Infinity - */ - parts?: number | undefined; - /** - * For multipart forms, the max number of header key=>value pairs to parse - * @default 2000 - */ - headerPairs?: number | undefined; - - /** - * For multipart forms, the max size of a header part - * @default 81920 - */ - headerSize?: number | undefined; - } - | undefined; -} - -export type BusboyHeaders = { 'content-type': string } & http.IncomingHttpHeaders; - -export interface BusboyFileStream extends - Readable { - - truncated: boolean; - - /** - * The number of bytes that have been read so far. - */ - bytesRead: number; -} - -export interface Busboy extends Writable { - addListener(event: Event, listener: BusboyEvents[Event]): this; - - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - - on(event: Event, listener: BusboyEvents[Event]): this; - - on(event: string | symbol, listener: (...args: any[]) => void): this; - - once(event: Event, listener: BusboyEvents[Event]): this; - - once(event: string | symbol, listener: (...args: any[]) => void): this; - - removeListener(event: Event, listener: BusboyEvents[Event]): this; - - removeListener(event: string | symbol, listener: (...args: any[]) => void): this; - - off(event: Event, listener: BusboyEvents[Event]): this; - - off(event: string | symbol, listener: (...args: any[]) => void): this; - - prependListener(event: Event, listener: BusboyEvents[Event]): this; - - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - - prependOnceListener(event: Event, listener: BusboyEvents[Event]): this; - - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; -} - -export interface BusboyEvents { - /** - * Emitted for each new file form field found. - * - * * Note: if you listen for this event, you should always handle the `stream` no matter if you care about the - * file contents or not (e.g. you can simply just do `stream.resume();` if you want to discard the contents), - * otherwise the 'finish' event will never fire on the Busboy instance. However, if you don't care about **any** - * incoming files, you can simply not listen for the 'file' event at all and any/all files will be automatically - * and safely discarded (these discarded files do still count towards `files` and `parts` limits). - * * If a configured file size limit was reached, `stream` will both have a boolean property `truncated` - * (best checked at the end of the stream) and emit a 'limit' event to notify you when this happens. - * - * @param listener.transferEncoding Contains the 'Content-Transfer-Encoding' value for the file stream. - * @param listener.mimeType Contains the 'Content-Type' value for the file stream. - */ - file: ( - fieldname: string, - stream: BusboyFileStream, - filename: string, - transferEncoding: string, - mimeType: string, - ) => void; - /** - * Emitted for each new non-file field found. - */ - field: ( - fieldname: string, - value: string, - fieldnameTruncated: boolean, - valueTruncated: boolean, - transferEncoding: string, - mimeType: string, - ) => void; - finish: () => void; - /** - * Emitted when specified `parts` limit has been reached. No more 'file' or 'field' events will be emitted. - */ - partsLimit: () => void; - /** - * Emitted when specified `files` limit has been reached. No more 'file' events will be emitted. - */ - filesLimit: () => void; - /** - * Emitted when specified `fields` limit has been reached. No more 'field' events will be emitted. - */ - fieldsLimit: () => void; - error: (error: unknown) => void; -} - -export interface BusboyConstructor { - (options: BusboyConfig): Busboy; - - new(options: BusboyConfig): Busboy; -} - diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@fastify/busboy/lib/main.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/@fastify/busboy/lib/main.js deleted file mode 100644 index b0fa9f67..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@fastify/busboy/lib/main.js +++ /dev/null @@ -1,83 +0,0 @@ -const WritableStream = require('stream').Writable -const { inherits } = require('util') -const Dicer = require('../deps/dicer/lib/Dicer') - -const MultipartParser = require('./types/multipart') -const UrlencodedParser = require('./types/urlencoded') -const parseParams = require('./utils').parseParams - -function Busboy (opts) { - if (!(this instanceof Busboy)) { return new Busboy(opts) } - - if (typeof opts !== 'object') { - throw new TypeError('Busboy expected an options-Object.') - } - if (typeof opts.headers !== 'object') { - throw new TypeError('Busboy expected an options-Object with headers-attribute.') - } - if (typeof opts.headers['content-type'] !== 'string') { - throw new TypeError('Missing Content-Type-header.') - } - - const { - headers, - ...streamOptions - } = opts - - this.opts = { - autoDestroy: false, - ...streamOptions - } - WritableStream.call(this, this.opts) - - this._done = false - this._parser = this.getParserByHeaders(headers) - this._finished = false -} -inherits(Busboy, WritableStream) - -Busboy.prototype.emit = function (ev) { - if (ev === 'finish') { - if (!this._done) { - this._parser && this._parser.end() - return - } else if (this._finished) { - return - } - this._finished = true - } - WritableStream.prototype.emit.apply(this, arguments) -} - -Busboy.prototype.getParserByHeaders = function (headers) { - const parsed = parseParams(headers['content-type']) - - const cfg = { - defCharset: this.opts.defCharset, - fileHwm: this.opts.fileHwm, - headers, - highWaterMark: this.opts.highWaterMark, - isPartAFile: this.opts.isPartAFile, - limits: this.opts.limits, - parsedConType: parsed, - preservePath: this.opts.preservePath - } - - if (MultipartParser.detect.test(parsed[0])) { - return new MultipartParser(this, cfg) - } - if (UrlencodedParser.detect.test(parsed[0])) { - return new UrlencodedParser(this, cfg) - } - throw new Error('Unsupported Content-Type.') -} - -Busboy.prototype._write = function (chunk, encoding, cb) { - this._parser.write(chunk, cb) -} - -module.exports = Busboy -module.exports.default = Busboy -module.exports.Busboy = Busboy - -module.exports.Dicer = Dicer diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@fastify/busboy/lib/types/multipart.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/@fastify/busboy/lib/types/multipart.js deleted file mode 100644 index e02b9d9b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@fastify/busboy/lib/types/multipart.js +++ /dev/null @@ -1,301 +0,0 @@ -// TODO: -// * support 1 nested multipart level -// (see second multipart example here: -// http://www.w3.org/TR/html401/interact/forms.html#didx-multipartform-data) -// * support limits.fieldNameSize -// -- this will require modifications to utils.parseParams - -const ReadableStream = require('stream').Readable -const inherits = require('util').inherits - -const Dicer = require('../../deps/dicer/lib/Dicer') - -const parseParams = require('../utils').parseParams -const decodeText = require('../utils').decodeText -const basename = require('../utils').basename -const getLimit = require('../utils').getLimit - -const RE_BOUNDARY = /^boundary$/i -const RE_FIELD = /^form-data$/i -const RE_CHARSET = /^charset$/i -const RE_FILENAME = /^filename$/i -const RE_NAME = /^name$/i - -Multipart.detect = /^multipart\/form-data/i -function Multipart (boy, cfg) { - let i - let len - const self = this - let boundary - const limits = cfg.limits - const isPartAFile = cfg.isPartAFile || ((fieldName, contentType, fileName) => (contentType === 'application/octet-stream' || fileName !== undefined)) - const parsedConType = cfg.parsedConType || [] - const defCharset = cfg.defCharset || 'utf8' - const preservePath = cfg.preservePath - const fileOpts = { highWaterMark: cfg.fileHwm } - - for (i = 0, len = parsedConType.length; i < len; ++i) { - if (Array.isArray(parsedConType[i]) && - RE_BOUNDARY.test(parsedConType[i][0])) { - boundary = parsedConType[i][1] - break - } - } - - function checkFinished () { - if (nends === 0 && finished && !boy._done) { - finished = false - process.nextTick(function () { - boy._done = true - boy.emit('finish') - }) - } - } - - if (typeof boundary !== 'string') { throw new Error('Multipart: Boundary not found') } - - const fieldSizeLimit = getLimit(limits, 'fieldSize', 1 * 1024 * 1024) - const fileSizeLimit = getLimit(limits, 'fileSize', Infinity) - const filesLimit = getLimit(limits, 'files', Infinity) - const fieldsLimit = getLimit(limits, 'fields', Infinity) - const partsLimit = getLimit(limits, 'parts', Infinity) - const headerPairsLimit = getLimit(limits, 'headerPairs', 2000) - const headerSizeLimit = getLimit(limits, 'headerSize', 80 * 1024) - - let nfiles = 0 - let nfields = 0 - let nends = 0 - let curFile - let curField - let finished = false - - this._needDrain = false - this._pause = false - this._cb = undefined - this._nparts = 0 - this._boy = boy - - const parserCfg = { - boundary, - maxHeaderPairs: headerPairsLimit, - maxHeaderSize: headerSizeLimit, - partHwm: fileOpts.highWaterMark, - highWaterMark: cfg.highWaterMark - } - - this.parser = new Dicer(parserCfg) - this.parser.on('drain', function () { - self._needDrain = false - if (self._cb && !self._pause) { - const cb = self._cb - self._cb = undefined - cb() - } - }).on('part', function onPart (part) { - if (++self._nparts > partsLimit) { - self.parser.removeListener('part', onPart) - self.parser.on('part', skipPart) - boy.hitPartsLimit = true - boy.emit('partsLimit') - return skipPart(part) - } - - // hack because streams2 _always_ doesn't emit 'end' until nextTick, so let - // us emit 'end' early since we know the part has ended if we are already - // seeing the next part - if (curField) { - const field = curField - field.emit('end') - field.removeAllListeners('end') - } - - part.on('header', function (header) { - let contype - let fieldname - let parsed - let charset - let encoding - let filename - let nsize = 0 - - if (header['content-type']) { - parsed = parseParams(header['content-type'][0]) - if (parsed[0]) { - contype = parsed[0].toLowerCase() - for (i = 0, len = parsed.length; i < len; ++i) { - if (RE_CHARSET.test(parsed[i][0])) { - charset = parsed[i][1].toLowerCase() - break - } - } - } - } - - if (contype === undefined) { contype = 'text/plain' } - if (charset === undefined) { charset = defCharset } - - if (header['content-disposition']) { - parsed = parseParams(header['content-disposition'][0]) - if (!RE_FIELD.test(parsed[0])) { return skipPart(part) } - for (i = 0, len = parsed.length; i < len; ++i) { - if (RE_NAME.test(parsed[i][0])) { - fieldname = parsed[i][1] - } else if (RE_FILENAME.test(parsed[i][0])) { - filename = parsed[i][1] - if (!preservePath) { filename = basename(filename) } - } - } - } else { return skipPart(part) } - - if (header['content-transfer-encoding']) { encoding = header['content-transfer-encoding'][0].toLowerCase() } else { encoding = '7bit' } - - let onData, - onEnd - - if (isPartAFile(fieldname, contype, filename)) { - // file/binary field - if (nfiles === filesLimit) { - if (!boy.hitFilesLimit) { - boy.hitFilesLimit = true - boy.emit('filesLimit') - } - return skipPart(part) - } - - ++nfiles - - if (!boy._events.file) { - self.parser._ignore() - return - } - - ++nends - const file = new FileStream(fileOpts) - curFile = file - file.on('end', function () { - --nends - self._pause = false - checkFinished() - if (self._cb && !self._needDrain) { - const cb = self._cb - self._cb = undefined - cb() - } - }) - file._read = function (n) { - if (!self._pause) { return } - self._pause = false - if (self._cb && !self._needDrain) { - const cb = self._cb - self._cb = undefined - cb() - } - } - boy.emit('file', fieldname, file, filename, encoding, contype) - - onData = function (data) { - if ((nsize += data.length) > fileSizeLimit) { - const extralen = fileSizeLimit - nsize + data.length - if (extralen > 0) { file.push(data.slice(0, extralen)) } - file.truncated = true - file.bytesRead = fileSizeLimit - part.removeAllListeners('data') - file.emit('limit') - return - } else if (!file.push(data)) { self._pause = true } - - file.bytesRead = nsize - } - - onEnd = function () { - curFile = undefined - file.push(null) - } - } else { - // non-file field - if (nfields === fieldsLimit) { - if (!boy.hitFieldsLimit) { - boy.hitFieldsLimit = true - boy.emit('fieldsLimit') - } - return skipPart(part) - } - - ++nfields - ++nends - let buffer = '' - let truncated = false - curField = part - - onData = function (data) { - if ((nsize += data.length) > fieldSizeLimit) { - const extralen = (fieldSizeLimit - (nsize - data.length)) - buffer += data.toString('binary', 0, extralen) - truncated = true - part.removeAllListeners('data') - } else { buffer += data.toString('binary') } - } - - onEnd = function () { - curField = undefined - if (buffer.length) { buffer = decodeText(buffer, 'binary', charset) } - boy.emit('field', fieldname, buffer, false, truncated, encoding, contype) - --nends - checkFinished() - } - } - - /* As of node@2efe4ab761666 (v0.10.29+/v0.11.14+), busboy had become - broken. Streams2/streams3 is a huge black box of confusion, but - somehow overriding the sync state seems to fix things again (and still - seems to work for previous node versions). - */ - part._readableState.sync = false - - part.on('data', onData) - part.on('end', onEnd) - }).on('error', function (err) { - if (curFile) { curFile.emit('error', err) } - }) - }).on('error', function (err) { - boy.emit('error', err) - }).on('finish', function () { - finished = true - checkFinished() - }) -} - -Multipart.prototype.write = function (chunk, cb) { - let r - if ((r = this.parser.write(chunk)) && !this._pause) { cb() } else { - this._needDrain = !r - this._cb = cb - } -} - -Multipart.prototype.end = function () { - const self = this - if (this._nparts === 0 && !self._boy._done) { - process.nextTick(function () { - self._boy._done = true - self._boy.emit('finish') - }) - } else if (this.parser.writable) { this.parser.end() } -} - -function skipPart (part) { - part.resume() -} - -function FileStream (opts) { - ReadableStream.call(this, opts) - - this.bytesRead = 0 - - this.truncated = false -} -inherits(FileStream, ReadableStream) - -FileStream.prototype._read = function (n) { } - -module.exports = Multipart diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@fastify/busboy/lib/types/urlencoded.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/@fastify/busboy/lib/types/urlencoded.js deleted file mode 100644 index a83684e8..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@fastify/busboy/lib/types/urlencoded.js +++ /dev/null @@ -1,188 +0,0 @@ -const Decoder = require('../utils').Decoder -const decodeText = require('../utils').decodeText -const getLimit = require('../utils').getLimit - -const RE_CHARSET = /^charset$/i - -UrlEncoded.detect = /^application\/x-www-form-urlencoded/i -function UrlEncoded (boy, cfg) { - const limits = cfg.limits - const parsedConType = cfg.parsedConType - this.boy = boy - - this.fieldSizeLimit = getLimit(limits, 'fieldSize', 1 * 1024 * 1024) - this.fieldNameSizeLimit = getLimit(limits, 'fieldNameSize', 100) - this.fieldsLimit = getLimit(limits, 'fields', Infinity) - - let charset - for (var i = 0, len = parsedConType.length; i < len; ++i) { // eslint-disable-line no-var - if (Array.isArray(parsedConType[i]) && - RE_CHARSET.test(parsedConType[i][0])) { - charset = parsedConType[i][1].toLowerCase() - break - } - } - - if (charset === undefined) { charset = cfg.defCharset || 'utf8' } - - this.decoder = new Decoder() - this.charset = charset - this._fields = 0 - this._state = 'key' - this._checkingBytes = true - this._bytesKey = 0 - this._bytesVal = 0 - this._key = '' - this._val = '' - this._keyTrunc = false - this._valTrunc = false - this._hitLimit = false -} - -UrlEncoded.prototype.write = function (data, cb) { - if (this._fields === this.fieldsLimit) { - if (!this.boy.hitFieldsLimit) { - this.boy.hitFieldsLimit = true - this.boy.emit('fieldsLimit') - } - return cb() - } - - let idxeq; let idxamp; let i; let p = 0; const len = data.length - - while (p < len) { - if (this._state === 'key') { - idxeq = idxamp = undefined - for (i = p; i < len; ++i) { - if (!this._checkingBytes) { ++p } - if (data[i] === 0x3D/* = */) { - idxeq = i - break - } else if (data[i] === 0x26/* & */) { - idxamp = i - break - } - if (this._checkingBytes && this._bytesKey === this.fieldNameSizeLimit) { - this._hitLimit = true - break - } else if (this._checkingBytes) { ++this._bytesKey } - } - - if (idxeq !== undefined) { - // key with assignment - if (idxeq > p) { this._key += this.decoder.write(data.toString('binary', p, idxeq)) } - this._state = 'val' - - this._hitLimit = false - this._checkingBytes = true - this._val = '' - this._bytesVal = 0 - this._valTrunc = false - this.decoder.reset() - - p = idxeq + 1 - } else if (idxamp !== undefined) { - // key with no assignment - ++this._fields - let key; const keyTrunc = this._keyTrunc - if (idxamp > p) { key = (this._key += this.decoder.write(data.toString('binary', p, idxamp))) } else { key = this._key } - - this._hitLimit = false - this._checkingBytes = true - this._key = '' - this._bytesKey = 0 - this._keyTrunc = false - this.decoder.reset() - - if (key.length) { - this.boy.emit('field', decodeText(key, 'binary', this.charset), - '', - keyTrunc, - false) - } - - p = idxamp + 1 - if (this._fields === this.fieldsLimit) { return cb() } - } else if (this._hitLimit) { - // we may not have hit the actual limit if there are encoded bytes... - if (i > p) { this._key += this.decoder.write(data.toString('binary', p, i)) } - p = i - if ((this._bytesKey = this._key.length) === this.fieldNameSizeLimit) { - // yep, we actually did hit the limit - this._checkingBytes = false - this._keyTrunc = true - } - } else { - if (p < len) { this._key += this.decoder.write(data.toString('binary', p)) } - p = len - } - } else { - idxamp = undefined - for (i = p; i < len; ++i) { - if (!this._checkingBytes) { ++p } - if (data[i] === 0x26/* & */) { - idxamp = i - break - } - if (this._checkingBytes && this._bytesVal === this.fieldSizeLimit) { - this._hitLimit = true - break - } else if (this._checkingBytes) { ++this._bytesVal } - } - - if (idxamp !== undefined) { - ++this._fields - if (idxamp > p) { this._val += this.decoder.write(data.toString('binary', p, idxamp)) } - this.boy.emit('field', decodeText(this._key, 'binary', this.charset), - decodeText(this._val, 'binary', this.charset), - this._keyTrunc, - this._valTrunc) - this._state = 'key' - - this._hitLimit = false - this._checkingBytes = true - this._key = '' - this._bytesKey = 0 - this._keyTrunc = false - this.decoder.reset() - - p = idxamp + 1 - if (this._fields === this.fieldsLimit) { return cb() } - } else if (this._hitLimit) { - // we may not have hit the actual limit if there are encoded bytes... - if (i > p) { this._val += this.decoder.write(data.toString('binary', p, i)) } - p = i - if ((this._val === '' && this.fieldSizeLimit === 0) || - (this._bytesVal = this._val.length) === this.fieldSizeLimit) { - // yep, we actually did hit the limit - this._checkingBytes = false - this._valTrunc = true - } - } else { - if (p < len) { this._val += this.decoder.write(data.toString('binary', p)) } - p = len - } - } - } - cb() -} - -UrlEncoded.prototype.end = function () { - if (this.boy._done) { return } - - if (this._state === 'key' && this._key.length > 0) { - this.boy.emit('field', decodeText(this._key, 'binary', this.charset), - '', - this._keyTrunc, - false) - } else if (this._state === 'val') { - this.boy.emit('field', decodeText(this._key, 'binary', this.charset), - decodeText(this._val, 'binary', this.charset), - this._keyTrunc, - this._valTrunc) - } - this.boy._done = true - this.boy.emit('finish') -} - -module.exports = UrlEncoded diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@fastify/busboy/lib/utils.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/@fastify/busboy/lib/utils.js deleted file mode 100644 index 1b2bd5c7..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@fastify/busboy/lib/utils.js +++ /dev/null @@ -1,198 +0,0 @@ -const { TextDecoder } = require('util') -const { TextDecoder: PolyfillTextDecoder, getEncoding } = require('text-decoding') - -const RE_ENCODED = /%([a-fA-F0-9]{2})/g -const RE_PLUS = /\+/g - -const HEX = [ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 -] - -// Node has always utf-8 -const textDecoders = new Map() -textDecoders.set('utf-8', new TextDecoder('utf-8')) -textDecoders.set('utf8', textDecoders.get('utf-8')) - -function encodedReplacer (match, byte) { - return String.fromCharCode(parseInt(byte, 16)) -} - -function parseParams (str) { - const res = [] - let state = 'key' - let charset = '' - let inquote = false - let escaping = false - let p = 0 - let tmp = '' - - for (var i = 0, len = str.length; i < len; ++i) { // eslint-disable-line no-var - const char = str[i] - if (char === '\\' && inquote) { - if (escaping) { escaping = false } else { - escaping = true - continue - } - } else if (char === '"') { - if (!escaping) { - if (inquote) { - inquote = false - state = 'key' - } else { inquote = true } - continue - } else { escaping = false } - } else { - if (escaping && inquote) { tmp += '\\' } - escaping = false - if ((state === 'charset' || state === 'lang') && char === "'") { - if (state === 'charset') { - state = 'lang' - charset = tmp.substring(1) - } else { state = 'value' } - tmp = '' - continue - } else if (state === 'key' && - (char === '*' || char === '=') && - res.length) { - if (char === '*') { state = 'charset' } else { state = 'value' } - res[p] = [tmp, undefined] - tmp = '' - continue - } else if (!inquote && char === ';') { - state = 'key' - if (charset) { - if (tmp.length) { - tmp = decodeText(tmp.replace(RE_ENCODED, encodedReplacer), - 'binary', - charset) - } - charset = '' - } else if (tmp.length) { - tmp = decodeText(tmp, 'binary', 'utf8') - } - if (res[p] === undefined) { res[p] = tmp } else { res[p][1] = tmp } - tmp = '' - ++p - continue - } else if (!inquote && (char === ' ' || char === '\t')) { continue } - } - tmp += char - } - if (charset && tmp.length) { - tmp = decodeText(tmp.replace(RE_ENCODED, encodedReplacer), - 'binary', - charset) - } else if (tmp) { - tmp = decodeText(tmp, 'binary', 'utf8') - } - - if (res[p] === undefined) { - if (tmp) { res[p] = tmp } - } else { res[p][1] = tmp } - - return res -} - -function decodeText (text, textEncoding, destEncoding) { - if (text) { - if (textDecoders.has(destEncoding)) { - try { - return textDecoders.get(destEncoding).decode(Buffer.from(text, textEncoding)) - } catch (e) { } - } else { - try { - textDecoders.set(destEncoding, new TextDecoder(destEncoding)) - return textDecoders.get(destEncoding).decode(Buffer.from(text, textEncoding)) - } catch (e) { - if (getEncoding(destEncoding)) { - try { - textDecoders.set(destEncoding, new PolyfillTextDecoder(destEncoding)) - return textDecoders.get(destEncoding).decode(Buffer.from(text, textEncoding)) - } catch (e) { } - } - } - } - } - return text -} - -function Decoder () { - this.buffer = undefined -} -Decoder.prototype.write = function (str) { - // Replace '+' with ' ' before decoding - str = str.replace(RE_PLUS, ' ') - let res = '' - let i = 0; let p = 0; const len = str.length - for (; i < len; ++i) { - if (this.buffer !== undefined) { - if (!HEX[str.charCodeAt(i)]) { - res += '%' + this.buffer - this.buffer = undefined - --i // retry character - } else { - this.buffer += str[i] - ++p - if (this.buffer.length === 2) { - res += String.fromCharCode(parseInt(this.buffer, 16)) - this.buffer = undefined - } - } - } else if (str[i] === '%') { - if (i > p) { - res += str.substring(p, i) - p = i - } - this.buffer = '' - ++p - } - } - if (p < len && this.buffer === undefined) { res += str.substring(p) } - return res -} -Decoder.prototype.reset = function () { - this.buffer = undefined -} - -function basename (path) { - if (typeof path !== 'string') { return '' } - for (var i = path.length - 1; i >= 0; --i) { // eslint-disable-line no-var - switch (path.charCodeAt(i)) { - case 0x2F: // '/' - case 0x5C: // '\' - path = path.slice(i + 1) - return (path === '..' || path === '.' ? '' : path) - } - } - return (path === '..' || path === '.' ? '' : path) -} - -function getLimit (limits, name, defaultLimit) { - if ( - !limits || - limits[name] === undefined || - limits[name] === null - ) { return defaultLimit } - - if ( - typeof limits[name] !== 'number' || - isNaN(limits[name]) - ) { throw new TypeError('Limit ' + name + ' is not a valid number') } - - return limits[name] -} - -module.exports = { - Decoder, - basename, - getLimit, - parseParams, - decodeText -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@fastify/busboy/package.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/@fastify/busboy/package.json deleted file mode 100644 index 5b6e8e88..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@fastify/busboy/package.json +++ /dev/null @@ -1,92 +0,0 @@ -{ - "name": "@fastify/busboy", - "version": "1.1.0", - "private": false, - "author": "Brian White ", - "contributors": [ - { - "name": "Igor Savin", - "email": "kibertoad@gmail.com", - "url": "https://github.com/kibertoad" - }, - { - "name": "Aras Abbasi", - "email": "aras.abbasi@gmail.com", - "url": "https://github.com/uzlopak" - } - ], - "description": "A streaming parser for HTML form data for node.js", - "main": "lib/main", - "types": "lib/main.d.ts", - "scripts": { - "bench:busboy": "cd benchmarks && npm install && npm run benchmark-fastify", - "bench:dicer": "node bench/dicer/dicer-bench-multipart-parser.js", - "coveralls": "nyc report --reporter=lcov", - "lint": "npm run lint:standard", - "lint:everything": "npm run lint && npm run test:types", - "lint:fix": "standard --fix", - "lint:standard": "standard --verbose | snazzy", - "test:mocha": "mocha test", - "test:types": "tsd", - "test:coverage": "nyc npm run test", - "test": "npm run test:mocha" - }, - "engines": { - "node": ">=10.17.0" - }, - "dependencies": { - "text-decoding": "^1.0.0" - }, - "devDependencies": { - "@types/node": "^17.0.0", - "busboy": "^1.0.0", - "chai": "^4.3.4", - "eslint": "^7.32.0", - "eslint-config-standard": "^16.0.3", - "eslint-plugin-node": "^11.1.0", - "mocha": "^10.0.0", - "nyc": "^15.1.0", - "photofinish": "^1.8.0", - "snazzy": "^9.0.0", - "standard": "^17.0.0", - "tsd": "^0.20.0", - "typescript": "^4.5.2" - }, - "keywords": [ - "uploads", - "forms", - "multipart", - "form-data" - ], - "license": "MIT", - "repository": { - "type": "git", - "url": "https://github.com/fastify/busboy.git" - }, - "tsd": { - "directory": "test/types", - "compilerOptions": { - "esModuleInterop": false, - "module": "commonjs", - "target": "ES2017" - } - }, - "standard": { - "globals": [ - "describe", - "it" - ], - "ignore": [ - "bench" - ] - }, - "files": [ - "README.md", - "LICENSE", - "lib/*", - "deps/encoding/*", - "deps/dicer/lib", - "deps/streamsearch/", - "deps/dicer/LICENSE" - ] -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/app-types/CHANGELOG.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/app-types/CHANGELOG.md deleted file mode 100644 index aa18299f..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/app-types/CHANGELOG.md +++ /dev/null @@ -1,31 +0,0 @@ -# @firebase/app-types - -## 0.8.1 - -### Patch Changes - -- [`4af28c1a4`](https://github.com/firebase/firebase-js-sdk/commit/4af28c1a42bd25ce2353f694ca1724c6101cbce5) [#6682](https://github.com/firebase/firebase-js-sdk/pull/6682) - Upgrade TypeScript to 4.7.4. - -## 0.8.0 - -### Minor Changes - -- [`fdd4ab464`](https://github.com/firebase/firebase-js-sdk/commit/fdd4ab464b59a107bdcc195df3f01e32efd89ed4) [#6526](https://github.com/firebase/firebase-js-sdk/pull/6526) - Add functionality to auto-initialize project config and emulator settings from global defaults provided by framework tooling. - -## 0.7.0 - -### Minor Changes - -- [`cdada6c68`](https://github.com/firebase/firebase-js-sdk/commit/cdada6c68f9740d13dd6674bcb658e28e68253b6) [#5345](https://github.com/firebase/firebase-js-sdk/pull/5345) (fixes [#5015](https://github.com/firebase/firebase-js-sdk/issues/5015)) - Release modularized SDKs - -## 0.6.3 - -### Patch Changes - -- [`3d10d33bc`](https://github.com/firebase/firebase-js-sdk/commit/3d10d33bc167177fecbf86d2a6574af2e4e210f9) [#5144](https://github.com/firebase/firebase-js-sdk/pull/5144) - Add @firebase/logger as a dependency to @firebase/app-types to ensure that it can be resolved when compiling the package in a strict yarn PnP environment. - -## 0.6.2 - -### Patch Changes - -- [`f24d8961b`](https://github.com/firebase/firebase-js-sdk/commit/f24d8961b3b87821413297688803fc85113086b3) [#4714](https://github.com/firebase/firebase-js-sdk/pull/4714) - Internal typing changes diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/app-types/README.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/app-types/README.md deleted file mode 100644 index 931932c2..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/app-types/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# @firebase/app-types - -**This package is not intended for direct usage, and should only be used via the officially supported [firebase](https://www.npmjs.com/package/firebase) package.** diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/app-types/index.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/app-types/index.d.ts deleted file mode 100644 index 72b8fa68..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/app-types/index.d.ts +++ /dev/null @@ -1,129 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { LogCallback, LogLevelString, LogOptions } from '@firebase/logger'; - -export type FirebaseOptions = { - apiKey?: string; - authDomain?: string; - databaseURL?: string; - projectId?: string; - storageBucket?: string; - messagingSenderId?: string; - appId?: string; - measurementId?: string; -}; - -export interface FirebaseAppConfig { - name?: string; - automaticDataCollectionEnabled?: boolean; -} - -export class FirebaseApp { - /** - * The (read-only) name (identifier) for this App. '[DEFAULT]' is the default - * App. - */ - name: string; - - /** - * The (read-only) configuration options from the app initialization. - */ - options: FirebaseOptions; - - /** - * The settable config flag for GDPR opt-in/opt-out - */ - automaticDataCollectionEnabled: boolean; - - /** - * Make the given App unusable and free resources. - */ - delete(): Promise; -} - -export interface FirebaseNamespace { - /** - * Create (and initialize) a FirebaseApp. - * - * @param options Options to configure the services used in the App. - * @param config The optional config for your firebase app - */ - initializeApp( - options: FirebaseOptions, - config?: FirebaseAppConfig - ): FirebaseApp; - /** - * Create (and initialize) a FirebaseApp. - * - * @param options Options to configure the services used in the App. - * @param name The optional name of the app to initialize ('[DEFAULT]' if - * omitted) - */ - initializeApp(options: FirebaseOptions, name?: string): FirebaseApp; - - app: { - /** - * Retrieve an instance of a FirebaseApp. - * - * Usage: firebase.app() - * - * @param name The optional name of the app to return ('[DEFAULT]' if omitted) - */ - (name?: string): FirebaseApp; - - /** - * For testing FirebaseApp instances: - * app() instanceof firebase.app.App - * - * DO NOT call this constuctor directly (use firebase.app() instead). - */ - App: typeof FirebaseApp; - }; - - /** - * A (read-only) array of all the initialized Apps. - */ - apps: FirebaseApp[]; - - /** - * Registers a library's name and version for platform logging purposes. - * @param library Name of 1p or 3p library (e.g. firestore, angularfire) - * @param version Current version of that library. - */ - registerVersion(library: string, version: string, variant?: string): void; - - // Sets log level for all Firebase components. - setLogLevel(logLevel: LogLevelString): void; - - // Sets log handler for all Firebase components. - onLog(logCallback: LogCallback, options?: LogOptions): void; - - // The current SDK version. - SDK_VERSION: string; -} - -export interface VersionService { - library: string; - version: string; -} - -declare module '@firebase/component' { - interface NameServiceMapping { - 'app-version': VersionService; - 'platform-identifier': VersionService; - } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/app-types/package.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/app-types/package.json deleted file mode 100644 index 99644d83..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/app-types/package.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "name": "@firebase/app-types", - "version": "0.8.1", - "description": "@firebase/app Types", - "author": "Firebase (https://firebase.google.com/)", - "license": "Apache-2.0", - "scripts": { - "test": "tsc", - "test:ci": "node ../../scripts/run_tests_in_ci.js" - }, - "files": [ - "index.d.ts", - "private.d.ts" - ], - "repository": { - "directory": "packages/app-types", - "type": "git", - "url": "https://github.com/firebase/firebase-js-sdk.git" - }, - "bugs": { - "url": "https://github.com/firebase/firebase-js-sdk/issues" - }, - "dependency": { - "@firebase/logger": "0.2.6" - }, - "devDependencies": { - "typescript": "4.2.2" - } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/app-types/private.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/app-types/private.d.ts deleted file mode 100644 index 410eece1..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/app-types/private.d.ts +++ /dev/null @@ -1,165 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * THIS FILE IS FOR INTERNAL USAGE ONLY, IF YOU ARE NOT DEVELOPING THE FIREBASE - * SDKs, PLEASE DO NOT REFERENCE THIS FILE AS IT MAY CHANGE WITHOUT WARNING - */ - -import { FirebaseApp, FirebaseNamespace } from '@firebase/app-types'; -import { Observer, Subscribe } from '@firebase/util'; -import { FirebaseError, ErrorFactory } from '@firebase/util'; -import { Component, ComponentContainer, Name } from '@firebase/component'; - -export interface FirebaseServiceInternals { - /** - * Delete the service and free it's resources - called from - * app.delete(). - */ - delete(): Promise; -} - -// Services are exposed through instances - each of which is associated with a -// FirebaseApp. -export interface FirebaseService { - app: FirebaseApp; - INTERNAL?: FirebaseServiceInternals; -} - -export type AppHook = (event: string, app: FirebaseApp) => void; - -/** - * Firebase Services create instances given a Firebase App instance and can - * optionally add properties and methods to each FirebaseApp via the extendApp() - * function. - */ -export interface FirebaseServiceFactory { - ( - app: FirebaseApp, - extendApp?: (props: { [prop: string]: any }) => void, - instanceString?: string - ): FirebaseService; -} - -export interface PlatformLoggerService { - getPlatformInfoString(): string; -} - -/** - * All ServiceNamespaces extend from FirebaseServiceNamespace - */ -export interface FirebaseServiceNamespace { - (app?: FirebaseApp): T; -} - -export interface FirebaseAuthTokenData { - accessToken: string; -} - -export interface FirebaseAppInternals { - getToken(refreshToken?: boolean): Promise; - getUid(): string | null; - addAuthTokenListener(fn: (token: string | null) => void): void; - removeAuthTokenListener(fn: (token: string | null) => void): void; - analytics: { - logEvent: ( - eventName: string, - eventParams: { [key: string]: any }, - options?: { global: boolean } - ) => void; - }; -} - -export interface _FirebaseApp extends FirebaseApp { - container: ComponentContainer; - _addComponent(component: Component): void; - _addOrOverwriteComponent(component: Component): void; - _removeServiceInstance(name: string, instanceIdentifier?: string): void; -} -export interface _FirebaseNamespace extends FirebaseNamespace { - INTERNAL: { - /** - * Internal API to register a Firebase Service into the firebase namespace. - * - * Each service will create a child namespace (firebase.) which acts as - * both a namespace for service specific properties, and also as a service - * accessor function (firebase.() or firebase.(app)). - * - * @param name The Firebase Service being registered. - * @param createService Factory function to create a service instance. - * @param serviceProperties Properties to copy to the service's namespace. - * @param appHook All appHooks called before initializeApp returns to caller. - * @param allowMultipleInstances Whether the registered service supports - * multiple instances per app. If not specified, the default is false. - */ - registerComponent( - component: Component - ): FirebaseServiceNamespace | null; - - /** - * Just used for testing to start from a fresh namespace. - */ - createFirebaseNamespace(): FirebaseNamespace; - - /** - * Internal API to install properties on the top-level firebase namespace. - * @prop props The top level properties of this object are copied to the - * namespace. - */ - extendNamespace(props: { [prop: string]: any }): void; - - /** - * Create a Subscribe function. A proxy Observer is created so that - * events can be sent to single Observer to be fanned out automatically. - */ - createSubscribe( - executor: (observer: Observer) => void, - onNoObservers?: (observer: Observer) => void - ): Subscribe; - - /** - * Utility exposed for internal testing. - */ - deepExtend(target: any, source: any): any; - - /** - * Internal API to remove an app from the list of registered apps. - */ - removeApp(name: string): void; - - /** - * registered components. - */ - components: Map; - - /* - * Convert service name to factory name to use. - */ - useAsService(app: FirebaseApp, serviceName: string): string | null; - - /** - * Use to construct all thrown FirebaseError's. - */ - ErrorFactory: typeof ErrorFactory; - }; -} - -declare module '@firebase/component' { - interface NameServiceMapping { - 'platform-logger': PlatformLoggerService; - } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/auth-interop-types/CHANGELOG.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/auth-interop-types/CHANGELOG.md deleted file mode 100644 index 0b762a99..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/auth-interop-types/CHANGELOG.md +++ /dev/null @@ -1,13 +0,0 @@ -# @firebase/auth-interop-types - -## 0.1.7 - -### Patch Changes - -- [`4af28c1a4`](https://github.com/firebase/firebase-js-sdk/commit/4af28c1a42bd25ce2353f694ca1724c6101cbce5) [#6682](https://github.com/firebase/firebase-js-sdk/pull/6682) - Upgrade TypeScript to 4.7.4. - -## 0.1.6 - -### Patch Changes - -- [`3f370215a`](https://github.com/firebase/firebase-js-sdk/commit/3f370215aa571db6b41b92a7d8a9aaad2ea0ecd0) [#4808](https://github.com/firebase/firebase-js-sdk/pull/4808) (fixes [#4789](https://github.com/firebase/firebase-js-sdk/issues/4789)) - Update peerDependencies diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/auth-interop-types/README.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/auth-interop-types/README.md deleted file mode 100644 index 67ed6389..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/auth-interop-types/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# @firebase/auth-interop-types - -**This package is not intended for direct usage, and should only be used via the officially supported [firebase](https://www.npmjs.com/package/firebase) package.** diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/auth-interop-types/index.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/auth-interop-types/index.d.ts deleted file mode 100644 index 6c9eb3d2..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/auth-interop-types/index.d.ts +++ /dev/null @@ -1,35 +0,0 @@ -/** - * @license - * Copyright 2019 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export interface FirebaseAuthTokenData { - accessToken: string; -} - -export interface FirebaseAuthInternal { - getToken(refreshToken?: boolean): Promise; - getUid(): string | null; - addAuthTokenListener(fn: (token: string | null) => void): void; - removeAuthTokenListener(fn: (token: string | null) => void): void; -} - -export type FirebaseAuthInternalName = 'auth-internal'; - -declare module '@firebase/component' { - interface NameServiceMapping { - 'auth-internal': FirebaseAuthInternal; - } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/auth-interop-types/package.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/auth-interop-types/package.json deleted file mode 100644 index 7fe958a2..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/auth-interop-types/package.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "name": "@firebase/auth-interop-types", - "version": "0.1.7", - "description": "@firebase/auth interop Types", - "author": "Firebase (https://firebase.google.com/)", - "license": "Apache-2.0", - "scripts": { - "test": "tsc", - "test:ci": "node ../../scripts/run_tests_in_ci.js" - }, - "files": [ - "index.d.ts" - ], - "peerDependencies": { - "@firebase/app-types": "0.x", - "@firebase/util": "1.x" - }, - "repository": { - "directory": "packages/auth-types", - "type": "git", - "url": "https://github.com/firebase/firebase-js-sdk.git" - }, - "bugs": { - "url": "https://github.com/firebase/firebase-js-sdk/issues" - }, - "devDependencies": { - "typescript": "4.2.2" - } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/component/CHANGELOG.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/component/CHANGELOG.md deleted file mode 100644 index 7e10e710..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/component/CHANGELOG.md +++ /dev/null @@ -1,261 +0,0 @@ -# @firebase/component - -## 0.5.21 - -### Patch Changes - -- [`4af28c1a4`](https://github.com/firebase/firebase-js-sdk/commit/4af28c1a42bd25ce2353f694ca1724c6101cbce5) [#6682](https://github.com/firebase/firebase-js-sdk/pull/6682) - Upgrade TypeScript to 4.7.4. - -- Updated dependencies [[`4af28c1a4`](https://github.com/firebase/firebase-js-sdk/commit/4af28c1a42bd25ce2353f694ca1724c6101cbce5)]: - - @firebase/util@1.7.3 - -## 0.5.20 - -### Patch Changes - -- Updated dependencies [[`807f06aa2`](https://github.com/firebase/firebase-js-sdk/commit/807f06aa26438a91aaea08fd38efb6c706bb8a5d)]: - - @firebase/util@1.7.2 - -## 0.5.19 - -### Patch Changes - -- Updated dependencies [[`171b78b76`](https://github.com/firebase/firebase-js-sdk/commit/171b78b762826a640d267dd4dd172ad9459c4561), [`29d034072`](https://github.com/firebase/firebase-js-sdk/commit/29d034072c20af394ce384e42aa10a37d5dfcb18)]: - - @firebase/util@1.7.1 - -## 0.5.18 - -### Patch Changes - -- Updated dependencies [[`fdd4ab464`](https://github.com/firebase/firebase-js-sdk/commit/fdd4ab464b59a107bdcc195df3f01e32efd89ed4)]: - - @firebase/util@1.7.0 - -## 0.5.17 - -### Patch Changes - -- Updated dependencies [[`b12af44a5`](https://github.com/firebase/firebase-js-sdk/commit/b12af44a5c7500e1192d6cc1a4afc4d77efadbaf)]: - - @firebase/util@1.6.3 - -## 0.5.16 - -### Patch Changes - -- Updated dependencies [[`efe2000fc`](https://github.com/firebase/firebase-js-sdk/commit/efe2000fc499e2c85c4e5e0fef6741ff3bad2eb0)]: - - @firebase/util@1.6.2 - -## 0.5.15 - -### Patch Changes - -- [`2cd1cc76f`](https://github.com/firebase/firebase-js-sdk/commit/2cd1cc76f2a308135cd60f424fe09084a34b5cb5) [#6307](https://github.com/firebase/firebase-js-sdk/pull/6307) (fixes [#6300](https://github.com/firebase/firebase-js-sdk/issues/6300)) - fix: add type declarations to exports field - -- Updated dependencies [[`2cd1cc76f`](https://github.com/firebase/firebase-js-sdk/commit/2cd1cc76f2a308135cd60f424fe09084a34b5cb5)]: - - @firebase/util@1.6.1 - -## 0.5.14 - -### Patch Changes - -- Updated dependencies [[`9c5c9c36d`](https://github.com/firebase/firebase-js-sdk/commit/9c5c9c36da80b98b73cfd60ef2e2965087e9f801)]: - - @firebase/util@1.6.0 - -## 0.5.13 - -### Patch Changes - -- Updated dependencies [[`e9e5f6b3c`](https://github.com/firebase/firebase-js-sdk/commit/e9e5f6b3ca9d61323b22f87986d9959f5297ec59)]: - - @firebase/util@1.5.2 - -## 0.5.12 - -### Patch Changes - -- Updated dependencies [[`3198d58dc`](https://github.com/firebase/firebase-js-sdk/commit/3198d58dcedbf7583914dbcc76984f6f7df8d2ef)]: - - @firebase/util@1.5.1 - -## 0.5.11 - -### Patch Changes - -- Updated dependencies [[`2d672cead`](https://github.com/firebase/firebase-js-sdk/commit/2d672cead167187cb714cd89b638c0884ba58f03)]: - - @firebase/util@1.5.0 - -## 0.5.10 - -### Patch Changes - -- Updated dependencies [[`3b481f572`](https://github.com/firebase/firebase-js-sdk/commit/3b481f572456e1eab3435bfc25717770d95a8c49)]: - - @firebase/util@1.4.3 - -## 0.5.9 - -### Patch Changes - -- [`3281315fa`](https://github.com/firebase/firebase-js-sdk/commit/3281315fae9c6f535f9d5052ee17d60861ea569a) [#5708](https://github.com/firebase/firebase-js-sdk/pull/5708) (fixes [#1487](https://github.com/firebase/firebase-js-sdk/issues/1487)) - Update build scripts to work with the exports field - -- Updated dependencies [[`3281315fa`](https://github.com/firebase/firebase-js-sdk/commit/3281315fae9c6f535f9d5052ee17d60861ea569a)]: - - @firebase/util@1.4.2 - -## 0.5.8 - -### Patch Changes - -- [`2322b6023`](https://github.com/firebase/firebase-js-sdk/commit/2322b6023c628cd9f4f4172767c17d215dd91684) [#5693](https://github.com/firebase/firebase-js-sdk/pull/5693) - Add exports field to all packages - -- Updated dependencies [[`2322b6023`](https://github.com/firebase/firebase-js-sdk/commit/2322b6023c628cd9f4f4172767c17d215dd91684)]: - - @firebase/util@1.4.1 - -## 0.5.7 - -### Patch Changes - -- Updated dependencies [[`a99943fe3`](https://github.com/firebase/firebase-js-sdk/commit/a99943fe3bd5279761aa29d138ec91272b06df39), [`b835b4cba`](https://github.com/firebase/firebase-js-sdk/commit/b835b4cbabc4b7b180ae38b908c49205ce31a422)]: - - @firebase/util@1.4.0 - -## 0.5.6 - -### Patch Changes - -- [`bb6b5abff`](https://github.com/firebase/firebase-js-sdk/commit/bb6b5abff6f89ce9ec1bd66ff4e795a059a98eec) [#5272](https://github.com/firebase/firebase-js-sdk/pull/5272) - Store instance initialization options on the Provider. - -- Updated dependencies [[`3c6a11c8d`](https://github.com/firebase/firebase-js-sdk/commit/3c6a11c8d0b35afddb50e9c3e0c4d2e30f642131)]: - - @firebase/util@1.3.0 - -## 0.5.5 - -### Patch Changes - -- Updated dependencies [[`a3cbe719b`](https://github.com/firebase/firebase-js-sdk/commit/a3cbe719b1bd733a5c4c15ee0d0e6388d512054c)]: - - @firebase/util@1.2.0 - -## 0.5.4 - -### Patch Changes - -- [`56a6a9d4a`](https://github.com/firebase/firebase-js-sdk/commit/56a6a9d4af2766154584a0f66d3c4d8024d74ba5) [#5071](https://github.com/firebase/firebase-js-sdk/pull/5071) (fixes [#4932](https://github.com/firebase/firebase-js-sdk/issues/4932)) - Auto initialize `auth-internal` after `auth` has been initialized. - -## 0.5.3 - -### Patch Changes - -- [`725ab4684`](https://github.com/firebase/firebase-js-sdk/commit/725ab4684ef0999a12f71e704c204a00fb030e5d) [#5023](https://github.com/firebase/firebase-js-sdk/pull/5023) (fixes [#5018](https://github.com/firebase/firebase-js-sdk/issues/5018)) - Pass the instance to onInit callback - -## 0.5.2 - -### Patch Changes - -- [`4c4b6aed9`](https://github.com/firebase/firebase-js-sdk/commit/4c4b6aed9757c9a7e75fb698a15e53274f93880b) [#4971](https://github.com/firebase/firebase-js-sdk/pull/4971) - Fixes a regression that prevented Firestore from detecting Auth during its initial initialization, which could cause some writes to not be send. - -## 0.5.1 - -### Patch Changes - -- [`5fbc5fb01`](https://github.com/firebase/firebase-js-sdk/commit/5fbc5fb0140d7da980fd7ebbfbae810f8c64ae19) [#4911](https://github.com/firebase/firebase-js-sdk/pull/4911) - handle `undefined` correctly from input. - -## 0.5.0 - -### Minor Changes - -- [`c34ac7a92`](https://github.com/firebase/firebase-js-sdk/commit/c34ac7a92a616915f38d192654db7770d81747ae) [#4866](https://github.com/firebase/firebase-js-sdk/pull/4866) - Support onInit callback in provider - -### Patch Changes - -- Updated dependencies [[`ac4ad08a2`](https://github.com/firebase/firebase-js-sdk/commit/ac4ad08a284397ec966e991dd388bb1fba857467)]: - - @firebase/util@1.1.0 - -## 0.4.1 - -### Patch Changes - -- Updated dependencies [[`7354a0ed4`](https://github.com/firebase/firebase-js-sdk/commit/7354a0ed438f4e3df6577e4927e8c8f8f1fbbfda)]: - - @firebase/util@1.0.0 - -## 0.4.0 - -### Minor Changes - -- [`f24d8961b`](https://github.com/firebase/firebase-js-sdk/commit/f24d8961b3b87821413297688803fc85113086b3) [#4714](https://github.com/firebase/firebase-js-sdk/pull/4714) - Support new instantiation mode `EXPLICIT` - -## 0.3.1 - -### Patch Changes - -- Updated dependencies [[`de5f90501`](https://github.com/firebase/firebase-js-sdk/commit/de5f9050137acc9ed1490082e5aa429b5de3cb2a)]: - - @firebase/util@0.4.1 - -## 0.3.0 - -### Minor Changes - -- [`5c1a83ed7`](https://github.com/firebase/firebase-js-sdk/commit/5c1a83ed70bae979322bd8751c0885d683ce4bf3) [#4595](https://github.com/firebase/firebase-js-sdk/pull/4595) - Component facotry now takes an options object. And added `Provider.initialize()` that can be used to pass an options object to the component factory. - -## 0.2.1 - -### Patch Changes - -- Updated dependencies [[`ec95df3d0`](https://github.com/firebase/firebase-js-sdk/commit/ec95df3d07e5f091f2a7f7327e46417f64d04b4e)]: - - @firebase/util@0.4.0 - -## 0.2.0 - -### Minor Changes - -- [`6afe42613`](https://github.com/firebase/firebase-js-sdk/commit/6afe42613ed3d7a842d378dc1a09a795811db2ac) [#4495](https://github.com/firebase/firebase-js-sdk/pull/4495) - Added isInitialized() method to Provider - -## 0.1.21 - -### Patch Changes - -- Updated dependencies [[`9cf727fcc`](https://github.com/firebase/firebase-js-sdk/commit/9cf727fcc3d049551b16ae0698ac33dc2fe45ada)]: - - @firebase/util@0.3.4 - -## 0.1.20 - -### Patch Changes - -- [`a5768b0aa`](https://github.com/firebase/firebase-js-sdk/commit/a5768b0aa7d7ce732279931aa436e988c9f36487) [#3932](https://github.com/firebase/firebase-js-sdk/pull/3932) - Point browser field to esm build. Now you need to use default import instead of namespace import to import firebase. - - Before this change - - ``` - import * as firebase from 'firebase/app'; - ``` - - After this change - - ``` - import firebase from 'firebase/app'; - ``` - -- Updated dependencies [[`a5768b0aa`](https://github.com/firebase/firebase-js-sdk/commit/a5768b0aa7d7ce732279931aa436e988c9f36487), [`7d916d905`](https://github.com/firebase/firebase-js-sdk/commit/7d916d905ba16816ac8ac7c8748c83831ff614ce)]: - - @firebase/util@0.3.3 - -## 0.1.19 - -### Patch Changes - -- [`da1c7df79`](https://github.com/firebase/firebase-js-sdk/commit/da1c7df7982b08bbef82fcc8d93255f3e2d23cca) [#3601](https://github.com/firebase/firebase-js-sdk/pull/3601) - Correctly delete services created by modular SDKs when calling provider.delete() - -- Updated dependencies [[`fb3b095e4`](https://github.com/firebase/firebase-js-sdk/commit/fb3b095e4b7c8f57fdb3172bc039c84576abf290)]: - - @firebase/util@0.3.2 - -## 0.1.18 - -### Patch Changes - -- Updated dependencies [[`d4ca3da0`](https://github.com/firebase/firebase-js-sdk/commit/d4ca3da0a59fcea1261ba69d7eb663bba38d3089)]: - - @firebase/util@0.3.1 - -## 0.1.17 - -### Patch Changes - -- Updated dependencies [[`a87676b8`](https://github.com/firebase/firebase-js-sdk/commit/a87676b84b78ccc2f057a22eb947a5d13402949c)]: - - @firebase/util@0.3.0 - -## 0.1.16 - -### Patch Changes - -- [`a754645e`](https://github.com/firebase/firebase-js-sdk/commit/a754645ec2be1b8c205f25f510196eee298b0d6e) [#3297](https://github.com/firebase/firebase-js-sdk/pull/3297) Thanks [@renovate](https://github.com/apps/renovate)! - Update dependency typescript to v3.9.5 diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/component/README.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/component/README.md deleted file mode 100644 index 242dacbf..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/component/README.md +++ /dev/null @@ -1,12 +0,0 @@ -# @firebase/component - -_NOTE: This is specifically tailored for Firebase JS SDK usage, if you are not a -member of the Firebase team, please avoid using this package_ - -## Usage - -**ES Modules** - -```javascript -import { Component } from '@firebase/component'; -``` diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/component/dist/esm/index.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/component/dist/esm/index.d.ts deleted file mode 100644 index 2dd3de91..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/component/dist/esm/index.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export { Component } from './src/component'; -export { ComponentContainer } from './src/component_container'; -export { Provider } from './src/provider'; -export { ComponentType, InstanceFactory, InstantiationMode, NameServiceMapping, Name, InstanceFactoryOptions } from './src/types'; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/component/dist/esm/index.esm2017.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/component/dist/esm/index.esm2017.js deleted file mode 100644 index 12d9e7e9..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/component/dist/esm/index.esm2017.js +++ /dev/null @@ -1,409 +0,0 @@ -import { Deferred } from '@firebase/util'; - -/** - * Component for service name T, e.g. `auth`, `auth-internal` - */ -class Component { - /** - * - * @param name The public service name, e.g. app, auth, firestore, database - * @param instanceFactory Service factory responsible for creating the public interface - * @param type whether the service provided by the component is public or private - */ - constructor(name, instanceFactory, type) { - this.name = name; - this.instanceFactory = instanceFactory; - this.type = type; - this.multipleInstances = false; - /** - * Properties to be added to the service namespace - */ - this.serviceProps = {}; - this.instantiationMode = "LAZY" /* LAZY */; - this.onInstanceCreated = null; - } - setInstantiationMode(mode) { - this.instantiationMode = mode; - return this; - } - setMultipleInstances(multipleInstances) { - this.multipleInstances = multipleInstances; - return this; - } - setServiceProps(props) { - this.serviceProps = props; - return this; - } - setInstanceCreatedCallback(callback) { - this.onInstanceCreated = callback; - return this; - } -} - -/** - * @license - * Copyright 2019 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -const DEFAULT_ENTRY_NAME = '[DEFAULT]'; - -/** - * @license - * Copyright 2019 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Provider for instance for service name T, e.g. 'auth', 'auth-internal' - * NameServiceMapping[T] is an alias for the type of the instance - */ -class Provider { - constructor(name, container) { - this.name = name; - this.container = container; - this.component = null; - this.instances = new Map(); - this.instancesDeferred = new Map(); - this.instancesOptions = new Map(); - this.onInitCallbacks = new Map(); - } - /** - * @param identifier A provider can provide mulitple instances of a service - * if this.component.multipleInstances is true. - */ - get(identifier) { - // if multipleInstances is not supported, use the default name - const normalizedIdentifier = this.normalizeInstanceIdentifier(identifier); - if (!this.instancesDeferred.has(normalizedIdentifier)) { - const deferred = new Deferred(); - this.instancesDeferred.set(normalizedIdentifier, deferred); - if (this.isInitialized(normalizedIdentifier) || - this.shouldAutoInitialize()) { - // initialize the service if it can be auto-initialized - try { - const instance = this.getOrInitializeService({ - instanceIdentifier: normalizedIdentifier - }); - if (instance) { - deferred.resolve(instance); - } - } - catch (e) { - // when the instance factory throws an exception during get(), it should not cause - // a fatal error. We just return the unresolved promise in this case. - } - } - } - return this.instancesDeferred.get(normalizedIdentifier).promise; - } - getImmediate(options) { - var _a; - // if multipleInstances is not supported, use the default name - const normalizedIdentifier = this.normalizeInstanceIdentifier(options === null || options === void 0 ? void 0 : options.identifier); - const optional = (_a = options === null || options === void 0 ? void 0 : options.optional) !== null && _a !== void 0 ? _a : false; - if (this.isInitialized(normalizedIdentifier) || - this.shouldAutoInitialize()) { - try { - return this.getOrInitializeService({ - instanceIdentifier: normalizedIdentifier - }); - } - catch (e) { - if (optional) { - return null; - } - else { - throw e; - } - } - } - else { - // In case a component is not initialized and should/can not be auto-initialized at the moment, return null if the optional flag is set, or throw - if (optional) { - return null; - } - else { - throw Error(`Service ${this.name} is not available`); - } - } - } - getComponent() { - return this.component; - } - setComponent(component) { - if (component.name !== this.name) { - throw Error(`Mismatching Component ${component.name} for Provider ${this.name}.`); - } - if (this.component) { - throw Error(`Component for ${this.name} has already been provided`); - } - this.component = component; - // return early without attempting to initialize the component if the component requires explicit initialization (calling `Provider.initialize()`) - if (!this.shouldAutoInitialize()) { - return; - } - // if the service is eager, initialize the default instance - if (isComponentEager(component)) { - try { - this.getOrInitializeService({ instanceIdentifier: DEFAULT_ENTRY_NAME }); - } - catch (e) { - // when the instance factory for an eager Component throws an exception during the eager - // initialization, it should not cause a fatal error. - // TODO: Investigate if we need to make it configurable, because some component may want to cause - // a fatal error in this case? - } - } - // Create service instances for the pending promises and resolve them - // NOTE: if this.multipleInstances is false, only the default instance will be created - // and all promises with resolve with it regardless of the identifier. - for (const [instanceIdentifier, instanceDeferred] of this.instancesDeferred.entries()) { - const normalizedIdentifier = this.normalizeInstanceIdentifier(instanceIdentifier); - try { - // `getOrInitializeService()` should always return a valid instance since a component is guaranteed. use ! to make typescript happy. - const instance = this.getOrInitializeService({ - instanceIdentifier: normalizedIdentifier - }); - instanceDeferred.resolve(instance); - } - catch (e) { - // when the instance factory throws an exception, it should not cause - // a fatal error. We just leave the promise unresolved. - } - } - } - clearInstance(identifier = DEFAULT_ENTRY_NAME) { - this.instancesDeferred.delete(identifier); - this.instancesOptions.delete(identifier); - this.instances.delete(identifier); - } - // app.delete() will call this method on every provider to delete the services - // TODO: should we mark the provider as deleted? - async delete() { - const services = Array.from(this.instances.values()); - await Promise.all([ - ...services - .filter(service => 'INTERNAL' in service) // legacy services - // eslint-disable-next-line @typescript-eslint/no-explicit-any - .map(service => service.INTERNAL.delete()), - ...services - .filter(service => '_delete' in service) // modularized services - // eslint-disable-next-line @typescript-eslint/no-explicit-any - .map(service => service._delete()) - ]); - } - isComponentSet() { - return this.component != null; - } - isInitialized(identifier = DEFAULT_ENTRY_NAME) { - return this.instances.has(identifier); - } - getOptions(identifier = DEFAULT_ENTRY_NAME) { - return this.instancesOptions.get(identifier) || {}; - } - initialize(opts = {}) { - const { options = {} } = opts; - const normalizedIdentifier = this.normalizeInstanceIdentifier(opts.instanceIdentifier); - if (this.isInitialized(normalizedIdentifier)) { - throw Error(`${this.name}(${normalizedIdentifier}) has already been initialized`); - } - if (!this.isComponentSet()) { - throw Error(`Component ${this.name} has not been registered yet`); - } - const instance = this.getOrInitializeService({ - instanceIdentifier: normalizedIdentifier, - options - }); - // resolve any pending promise waiting for the service instance - for (const [instanceIdentifier, instanceDeferred] of this.instancesDeferred.entries()) { - const normalizedDeferredIdentifier = this.normalizeInstanceIdentifier(instanceIdentifier); - if (normalizedIdentifier === normalizedDeferredIdentifier) { - instanceDeferred.resolve(instance); - } - } - return instance; - } - /** - * - * @param callback - a function that will be invoked after the provider has been initialized by calling provider.initialize(). - * The function is invoked SYNCHRONOUSLY, so it should not execute any longrunning tasks in order to not block the program. - * - * @param identifier An optional instance identifier - * @returns a function to unregister the callback - */ - onInit(callback, identifier) { - var _a; - const normalizedIdentifier = this.normalizeInstanceIdentifier(identifier); - const existingCallbacks = (_a = this.onInitCallbacks.get(normalizedIdentifier)) !== null && _a !== void 0 ? _a : new Set(); - existingCallbacks.add(callback); - this.onInitCallbacks.set(normalizedIdentifier, existingCallbacks); - const existingInstance = this.instances.get(normalizedIdentifier); - if (existingInstance) { - callback(existingInstance, normalizedIdentifier); - } - return () => { - existingCallbacks.delete(callback); - }; - } - /** - * Invoke onInit callbacks synchronously - * @param instance the service instance` - */ - invokeOnInitCallbacks(instance, identifier) { - const callbacks = this.onInitCallbacks.get(identifier); - if (!callbacks) { - return; - } - for (const callback of callbacks) { - try { - callback(instance, identifier); - } - catch (_a) { - // ignore errors in the onInit callback - } - } - } - getOrInitializeService({ instanceIdentifier, options = {} }) { - let instance = this.instances.get(instanceIdentifier); - if (!instance && this.component) { - instance = this.component.instanceFactory(this.container, { - instanceIdentifier: normalizeIdentifierForFactory(instanceIdentifier), - options - }); - this.instances.set(instanceIdentifier, instance); - this.instancesOptions.set(instanceIdentifier, options); - /** - * Invoke onInit listeners. - * Note this.component.onInstanceCreated is different, which is used by the component creator, - * while onInit listeners are registered by consumers of the provider. - */ - this.invokeOnInitCallbacks(instance, instanceIdentifier); - /** - * Order is important - * onInstanceCreated() should be called after this.instances.set(instanceIdentifier, instance); which - * makes `isInitialized()` return true. - */ - if (this.component.onInstanceCreated) { - try { - this.component.onInstanceCreated(this.container, instanceIdentifier, instance); - } - catch (_a) { - // ignore errors in the onInstanceCreatedCallback - } - } - } - return instance || null; - } - normalizeInstanceIdentifier(identifier = DEFAULT_ENTRY_NAME) { - if (this.component) { - return this.component.multipleInstances ? identifier : DEFAULT_ENTRY_NAME; - } - else { - return identifier; // assume multiple instances are supported before the component is provided. - } - } - shouldAutoInitialize() { - return (!!this.component && - this.component.instantiationMode !== "EXPLICIT" /* EXPLICIT */); - } -} -// undefined should be passed to the service factory for the default instance -function normalizeIdentifierForFactory(identifier) { - return identifier === DEFAULT_ENTRY_NAME ? undefined : identifier; -} -function isComponentEager(component) { - return component.instantiationMode === "EAGER" /* EAGER */; -} - -/** - * @license - * Copyright 2019 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * ComponentContainer that provides Providers for service name T, e.g. `auth`, `auth-internal` - */ -class ComponentContainer { - constructor(name) { - this.name = name; - this.providers = new Map(); - } - /** - * - * @param component Component being added - * @param overwrite When a component with the same name has already been registered, - * if overwrite is true: overwrite the existing component with the new component and create a new - * provider with the new component. It can be useful in tests where you want to use different mocks - * for different tests. - * if overwrite is false: throw an exception - */ - addComponent(component) { - const provider = this.getProvider(component.name); - if (provider.isComponentSet()) { - throw new Error(`Component ${component.name} has already been registered with ${this.name}`); - } - provider.setComponent(component); - } - addOrOverwriteComponent(component) { - const provider = this.getProvider(component.name); - if (provider.isComponentSet()) { - // delete the existing provider from the container, so we can register the new component - this.providers.delete(component.name); - } - this.addComponent(component); - } - /** - * getProvider provides a type safe interface where it can only be called with a field name - * present in NameServiceMapping interface. - * - * Firebase SDKs providing services should extend NameServiceMapping interface to register - * themselves. - */ - getProvider(name) { - if (this.providers.has(name)) { - return this.providers.get(name); - } - // create a Provider for a service that hasn't registered with Firebase - const provider = new Provider(name, this); - this.providers.set(name, provider); - return provider; - } - getProviders() { - return Array.from(this.providers.values()); - } -} - -export { Component, ComponentContainer, Provider }; -//# sourceMappingURL=index.esm2017.js.map diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/component/dist/esm/index.esm5.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/component/dist/esm/index.esm5.js deleted file mode 100644 index 07e0adae..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/component/dist/esm/index.esm5.js +++ /dev/null @@ -1,460 +0,0 @@ -import { __values, __read, __awaiter, __generator, __spreadArray } from 'tslib'; -import { Deferred } from '@firebase/util'; - -/** - * Component for service name T, e.g. `auth`, `auth-internal` - */ -var Component = /** @class */ (function () { - /** - * - * @param name The public service name, e.g. app, auth, firestore, database - * @param instanceFactory Service factory responsible for creating the public interface - * @param type whether the service provided by the component is public or private - */ - function Component(name, instanceFactory, type) { - this.name = name; - this.instanceFactory = instanceFactory; - this.type = type; - this.multipleInstances = false; - /** - * Properties to be added to the service namespace - */ - this.serviceProps = {}; - this.instantiationMode = "LAZY" /* LAZY */; - this.onInstanceCreated = null; - } - Component.prototype.setInstantiationMode = function (mode) { - this.instantiationMode = mode; - return this; - }; - Component.prototype.setMultipleInstances = function (multipleInstances) { - this.multipleInstances = multipleInstances; - return this; - }; - Component.prototype.setServiceProps = function (props) { - this.serviceProps = props; - return this; - }; - Component.prototype.setInstanceCreatedCallback = function (callback) { - this.onInstanceCreated = callback; - return this; - }; - return Component; -}()); - -/** - * @license - * Copyright 2019 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var DEFAULT_ENTRY_NAME = '[DEFAULT]'; - -/** - * @license - * Copyright 2019 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Provider for instance for service name T, e.g. 'auth', 'auth-internal' - * NameServiceMapping[T] is an alias for the type of the instance - */ -var Provider = /** @class */ (function () { - function Provider(name, container) { - this.name = name; - this.container = container; - this.component = null; - this.instances = new Map(); - this.instancesDeferred = new Map(); - this.instancesOptions = new Map(); - this.onInitCallbacks = new Map(); - } - /** - * @param identifier A provider can provide mulitple instances of a service - * if this.component.multipleInstances is true. - */ - Provider.prototype.get = function (identifier) { - // if multipleInstances is not supported, use the default name - var normalizedIdentifier = this.normalizeInstanceIdentifier(identifier); - if (!this.instancesDeferred.has(normalizedIdentifier)) { - var deferred = new Deferred(); - this.instancesDeferred.set(normalizedIdentifier, deferred); - if (this.isInitialized(normalizedIdentifier) || - this.shouldAutoInitialize()) { - // initialize the service if it can be auto-initialized - try { - var instance = this.getOrInitializeService({ - instanceIdentifier: normalizedIdentifier - }); - if (instance) { - deferred.resolve(instance); - } - } - catch (e) { - // when the instance factory throws an exception during get(), it should not cause - // a fatal error. We just return the unresolved promise in this case. - } - } - } - return this.instancesDeferred.get(normalizedIdentifier).promise; - }; - Provider.prototype.getImmediate = function (options) { - var _a; - // if multipleInstances is not supported, use the default name - var normalizedIdentifier = this.normalizeInstanceIdentifier(options === null || options === void 0 ? void 0 : options.identifier); - var optional = (_a = options === null || options === void 0 ? void 0 : options.optional) !== null && _a !== void 0 ? _a : false; - if (this.isInitialized(normalizedIdentifier) || - this.shouldAutoInitialize()) { - try { - return this.getOrInitializeService({ - instanceIdentifier: normalizedIdentifier - }); - } - catch (e) { - if (optional) { - return null; - } - else { - throw e; - } - } - } - else { - // In case a component is not initialized and should/can not be auto-initialized at the moment, return null if the optional flag is set, or throw - if (optional) { - return null; - } - else { - throw Error("Service " + this.name + " is not available"); - } - } - }; - Provider.prototype.getComponent = function () { - return this.component; - }; - Provider.prototype.setComponent = function (component) { - var e_1, _a; - if (component.name !== this.name) { - throw Error("Mismatching Component " + component.name + " for Provider " + this.name + "."); - } - if (this.component) { - throw Error("Component for " + this.name + " has already been provided"); - } - this.component = component; - // return early without attempting to initialize the component if the component requires explicit initialization (calling `Provider.initialize()`) - if (!this.shouldAutoInitialize()) { - return; - } - // if the service is eager, initialize the default instance - if (isComponentEager(component)) { - try { - this.getOrInitializeService({ instanceIdentifier: DEFAULT_ENTRY_NAME }); - } - catch (e) { - // when the instance factory for an eager Component throws an exception during the eager - // initialization, it should not cause a fatal error. - // TODO: Investigate if we need to make it configurable, because some component may want to cause - // a fatal error in this case? - } - } - try { - // Create service instances for the pending promises and resolve them - // NOTE: if this.multipleInstances is false, only the default instance will be created - // and all promises with resolve with it regardless of the identifier. - for (var _b = __values(this.instancesDeferred.entries()), _c = _b.next(); !_c.done; _c = _b.next()) { - var _d = __read(_c.value, 2), instanceIdentifier = _d[0], instanceDeferred = _d[1]; - var normalizedIdentifier = this.normalizeInstanceIdentifier(instanceIdentifier); - try { - // `getOrInitializeService()` should always return a valid instance since a component is guaranteed. use ! to make typescript happy. - var instance = this.getOrInitializeService({ - instanceIdentifier: normalizedIdentifier - }); - instanceDeferred.resolve(instance); - } - catch (e) { - // when the instance factory throws an exception, it should not cause - // a fatal error. We just leave the promise unresolved. - } - } - } - catch (e_1_1) { e_1 = { error: e_1_1 }; } - finally { - try { - if (_c && !_c.done && (_a = _b.return)) _a.call(_b); - } - finally { if (e_1) throw e_1.error; } - } - }; - Provider.prototype.clearInstance = function (identifier) { - if (identifier === void 0) { identifier = DEFAULT_ENTRY_NAME; } - this.instancesDeferred.delete(identifier); - this.instancesOptions.delete(identifier); - this.instances.delete(identifier); - }; - // app.delete() will call this method on every provider to delete the services - // TODO: should we mark the provider as deleted? - Provider.prototype.delete = function () { - return __awaiter(this, void 0, void 0, function () { - var services; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - services = Array.from(this.instances.values()); - return [4 /*yield*/, Promise.all(__spreadArray(__spreadArray([], __read(services - .filter(function (service) { return 'INTERNAL' in service; }) // legacy services - // eslint-disable-next-line @typescript-eslint/no-explicit-any - .map(function (service) { return service.INTERNAL.delete(); }))), __read(services - .filter(function (service) { return '_delete' in service; }) // modularized services - // eslint-disable-next-line @typescript-eslint/no-explicit-any - .map(function (service) { return service._delete(); }))))]; - case 1: - _a.sent(); - return [2 /*return*/]; - } - }); - }); - }; - Provider.prototype.isComponentSet = function () { - return this.component != null; - }; - Provider.prototype.isInitialized = function (identifier) { - if (identifier === void 0) { identifier = DEFAULT_ENTRY_NAME; } - return this.instances.has(identifier); - }; - Provider.prototype.getOptions = function (identifier) { - if (identifier === void 0) { identifier = DEFAULT_ENTRY_NAME; } - return this.instancesOptions.get(identifier) || {}; - }; - Provider.prototype.initialize = function (opts) { - var e_2, _a; - if (opts === void 0) { opts = {}; } - var _b = opts.options, options = _b === void 0 ? {} : _b; - var normalizedIdentifier = this.normalizeInstanceIdentifier(opts.instanceIdentifier); - if (this.isInitialized(normalizedIdentifier)) { - throw Error(this.name + "(" + normalizedIdentifier + ") has already been initialized"); - } - if (!this.isComponentSet()) { - throw Error("Component " + this.name + " has not been registered yet"); - } - var instance = this.getOrInitializeService({ - instanceIdentifier: normalizedIdentifier, - options: options - }); - try { - // resolve any pending promise waiting for the service instance - for (var _c = __values(this.instancesDeferred.entries()), _d = _c.next(); !_d.done; _d = _c.next()) { - var _e = __read(_d.value, 2), instanceIdentifier = _e[0], instanceDeferred = _e[1]; - var normalizedDeferredIdentifier = this.normalizeInstanceIdentifier(instanceIdentifier); - if (normalizedIdentifier === normalizedDeferredIdentifier) { - instanceDeferred.resolve(instance); - } - } - } - catch (e_2_1) { e_2 = { error: e_2_1 }; } - finally { - try { - if (_d && !_d.done && (_a = _c.return)) _a.call(_c); - } - finally { if (e_2) throw e_2.error; } - } - return instance; - }; - /** - * - * @param callback - a function that will be invoked after the provider has been initialized by calling provider.initialize(). - * The function is invoked SYNCHRONOUSLY, so it should not execute any longrunning tasks in order to not block the program. - * - * @param identifier An optional instance identifier - * @returns a function to unregister the callback - */ - Provider.prototype.onInit = function (callback, identifier) { - var _a; - var normalizedIdentifier = this.normalizeInstanceIdentifier(identifier); - var existingCallbacks = (_a = this.onInitCallbacks.get(normalizedIdentifier)) !== null && _a !== void 0 ? _a : new Set(); - existingCallbacks.add(callback); - this.onInitCallbacks.set(normalizedIdentifier, existingCallbacks); - var existingInstance = this.instances.get(normalizedIdentifier); - if (existingInstance) { - callback(existingInstance, normalizedIdentifier); - } - return function () { - existingCallbacks.delete(callback); - }; - }; - /** - * Invoke onInit callbacks synchronously - * @param instance the service instance` - */ - Provider.prototype.invokeOnInitCallbacks = function (instance, identifier) { - var e_3, _a; - var callbacks = this.onInitCallbacks.get(identifier); - if (!callbacks) { - return; - } - try { - for (var callbacks_1 = __values(callbacks), callbacks_1_1 = callbacks_1.next(); !callbacks_1_1.done; callbacks_1_1 = callbacks_1.next()) { - var callback = callbacks_1_1.value; - try { - callback(instance, identifier); - } - catch (_b) { - // ignore errors in the onInit callback - } - } - } - catch (e_3_1) { e_3 = { error: e_3_1 }; } - finally { - try { - if (callbacks_1_1 && !callbacks_1_1.done && (_a = callbacks_1.return)) _a.call(callbacks_1); - } - finally { if (e_3) throw e_3.error; } - } - }; - Provider.prototype.getOrInitializeService = function (_a) { - var instanceIdentifier = _a.instanceIdentifier, _b = _a.options, options = _b === void 0 ? {} : _b; - var instance = this.instances.get(instanceIdentifier); - if (!instance && this.component) { - instance = this.component.instanceFactory(this.container, { - instanceIdentifier: normalizeIdentifierForFactory(instanceIdentifier), - options: options - }); - this.instances.set(instanceIdentifier, instance); - this.instancesOptions.set(instanceIdentifier, options); - /** - * Invoke onInit listeners. - * Note this.component.onInstanceCreated is different, which is used by the component creator, - * while onInit listeners are registered by consumers of the provider. - */ - this.invokeOnInitCallbacks(instance, instanceIdentifier); - /** - * Order is important - * onInstanceCreated() should be called after this.instances.set(instanceIdentifier, instance); which - * makes `isInitialized()` return true. - */ - if (this.component.onInstanceCreated) { - try { - this.component.onInstanceCreated(this.container, instanceIdentifier, instance); - } - catch (_c) { - // ignore errors in the onInstanceCreatedCallback - } - } - } - return instance || null; - }; - Provider.prototype.normalizeInstanceIdentifier = function (identifier) { - if (identifier === void 0) { identifier = DEFAULT_ENTRY_NAME; } - if (this.component) { - return this.component.multipleInstances ? identifier : DEFAULT_ENTRY_NAME; - } - else { - return identifier; // assume multiple instances are supported before the component is provided. - } - }; - Provider.prototype.shouldAutoInitialize = function () { - return (!!this.component && - this.component.instantiationMode !== "EXPLICIT" /* EXPLICIT */); - }; - return Provider; -}()); -// undefined should be passed to the service factory for the default instance -function normalizeIdentifierForFactory(identifier) { - return identifier === DEFAULT_ENTRY_NAME ? undefined : identifier; -} -function isComponentEager(component) { - return component.instantiationMode === "EAGER" /* EAGER */; -} - -/** - * @license - * Copyright 2019 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * ComponentContainer that provides Providers for service name T, e.g. `auth`, `auth-internal` - */ -var ComponentContainer = /** @class */ (function () { - function ComponentContainer(name) { - this.name = name; - this.providers = new Map(); - } - /** - * - * @param component Component being added - * @param overwrite When a component with the same name has already been registered, - * if overwrite is true: overwrite the existing component with the new component and create a new - * provider with the new component. It can be useful in tests where you want to use different mocks - * for different tests. - * if overwrite is false: throw an exception - */ - ComponentContainer.prototype.addComponent = function (component) { - var provider = this.getProvider(component.name); - if (provider.isComponentSet()) { - throw new Error("Component " + component.name + " has already been registered with " + this.name); - } - provider.setComponent(component); - }; - ComponentContainer.prototype.addOrOverwriteComponent = function (component) { - var provider = this.getProvider(component.name); - if (provider.isComponentSet()) { - // delete the existing provider from the container, so we can register the new component - this.providers.delete(component.name); - } - this.addComponent(component); - }; - /** - * getProvider provides a type safe interface where it can only be called with a field name - * present in NameServiceMapping interface. - * - * Firebase SDKs providing services should extend NameServiceMapping interface to register - * themselves. - */ - ComponentContainer.prototype.getProvider = function (name) { - if (this.providers.has(name)) { - return this.providers.get(name); - } - // create a Provider for a service that hasn't registered with Firebase - var provider = new Provider(name, this); - this.providers.set(name, provider); - return provider; - }; - ComponentContainer.prototype.getProviders = function () { - return Array.from(this.providers.values()); - }; - return ComponentContainer; -}()); - -export { Component, ComponentContainer, Provider }; -//# sourceMappingURL=index.esm5.js.map diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/component/dist/esm/package.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/component/dist/esm/package.json deleted file mode 100644 index 7c34deb5..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/component/dist/esm/package.json +++ /dev/null @@ -1 +0,0 @@ -{"type":"module"} \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/component/dist/esm/src/component.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/component/dist/esm/src/component.d.ts deleted file mode 100644 index 6364195c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/component/dist/esm/src/component.d.ts +++ /dev/null @@ -1,43 +0,0 @@ -/** - * @license - * Copyright 2019 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { InstantiationMode, InstanceFactory, ComponentType, Dictionary, Name, onInstanceCreatedCallback } from './types'; -/** - * Component for service name T, e.g. `auth`, `auth-internal` - */ -export declare class Component { - readonly name: T; - readonly instanceFactory: InstanceFactory; - readonly type: ComponentType; - multipleInstances: boolean; - /** - * Properties to be added to the service namespace - */ - serviceProps: Dictionary; - instantiationMode: InstantiationMode; - onInstanceCreated: onInstanceCreatedCallback | null; - /** - * - * @param name The public service name, e.g. app, auth, firestore, database - * @param instanceFactory Service factory responsible for creating the public interface - * @param type whether the service provided by the component is public or private - */ - constructor(name: T, instanceFactory: InstanceFactory, type: ComponentType); - setInstantiationMode(mode: InstantiationMode): this; - setMultipleInstances(multipleInstances: boolean): this; - setServiceProps(props: Dictionary): this; - setInstanceCreatedCallback(callback: onInstanceCreatedCallback): this; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/component/dist/esm/src/component_container.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/component/dist/esm/src/component_container.d.ts deleted file mode 100644 index b3adb581..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/component/dist/esm/src/component_container.d.ts +++ /dev/null @@ -1,47 +0,0 @@ -/** - * @license - * Copyright 2019 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { Provider } from './provider'; -import { Component } from './component'; -import { Name } from './types'; -/** - * ComponentContainer that provides Providers for service name T, e.g. `auth`, `auth-internal` - */ -export declare class ComponentContainer { - private readonly name; - private readonly providers; - constructor(name: string); - /** - * - * @param component Component being added - * @param overwrite When a component with the same name has already been registered, - * if overwrite is true: overwrite the existing component with the new component and create a new - * provider with the new component. It can be useful in tests where you want to use different mocks - * for different tests. - * if overwrite is false: throw an exception - */ - addComponent(component: Component): void; - addOrOverwriteComponent(component: Component): void; - /** - * getProvider provides a type safe interface where it can only be called with a field name - * present in NameServiceMapping interface. - * - * Firebase SDKs providing services should extend NameServiceMapping interface to register - * themselves. - */ - getProvider(name: T): Provider; - getProviders(): Array>; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/component/dist/esm/src/component_container.test.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/component/dist/esm/src/component_container.test.d.ts deleted file mode 100644 index 6eb451dd..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/component/dist/esm/src/component_container.test.d.ts +++ /dev/null @@ -1,24 +0,0 @@ -/** - * @license - * Copyright 2019 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import '../test/setup'; -declare module './types' { - interface NameServiceMapping { - rocket: {}; - ship: {}; - fireball: {}; - } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/component/dist/esm/src/constants.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/component/dist/esm/src/constants.d.ts deleted file mode 100644 index 336fb41c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/component/dist/esm/src/constants.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * @license - * Copyright 2019 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export declare const DEFAULT_ENTRY_NAME = "[DEFAULT]"; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/component/dist/esm/src/provider.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/component/dist/esm/src/provider.d.ts deleted file mode 100644 index 54ef0a6f..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/component/dist/esm/src/provider.d.ts +++ /dev/null @@ -1,79 +0,0 @@ -/** - * @license - * Copyright 2019 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { ComponentContainer } from './component_container'; -import { InitializeOptions, Name, NameServiceMapping, OnInitCallBack } from './types'; -import { Component } from './component'; -/** - * Provider for instance for service name T, e.g. 'auth', 'auth-internal' - * NameServiceMapping[T] is an alias for the type of the instance - */ -export declare class Provider { - private readonly name; - private readonly container; - private component; - private readonly instances; - private readonly instancesDeferred; - private readonly instancesOptions; - private onInitCallbacks; - constructor(name: T, container: ComponentContainer); - /** - * @param identifier A provider can provide mulitple instances of a service - * if this.component.multipleInstances is true. - */ - get(identifier?: string): Promise; - /** - * - * @param options.identifier A provider can provide mulitple instances of a service - * if this.component.multipleInstances is true. - * @param options.optional If optional is false or not provided, the method throws an error when - * the service is not immediately available. - * If optional is true, the method returns null if the service is not immediately available. - */ - getImmediate(options: { - identifier?: string; - optional: true; - }): NameServiceMapping[T] | null; - getImmediate(options?: { - identifier?: string; - optional?: false; - }): NameServiceMapping[T]; - getComponent(): Component | null; - setComponent(component: Component): void; - clearInstance(identifier?: string): void; - delete(): Promise; - isComponentSet(): boolean; - isInitialized(identifier?: string): boolean; - getOptions(identifier?: string): Record; - initialize(opts?: InitializeOptions): NameServiceMapping[T]; - /** - * - * @param callback - a function that will be invoked after the provider has been initialized by calling provider.initialize(). - * The function is invoked SYNCHRONOUSLY, so it should not execute any longrunning tasks in order to not block the program. - * - * @param identifier An optional instance identifier - * @returns a function to unregister the callback - */ - onInit(callback: OnInitCallBack, identifier?: string): () => void; - /** - * Invoke onInit callbacks synchronously - * @param instance the service instance` - */ - private invokeOnInitCallbacks; - private getOrInitializeService; - private normalizeInstanceIdentifier; - private shouldAutoInitialize; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/component/dist/esm/src/provider.test.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/component/dist/esm/src/provider.test.d.ts deleted file mode 100644 index 76029647..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/component/dist/esm/src/provider.test.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -/** - * @license - * Copyright 2019 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import '../test/setup'; -declare module './types' { - interface NameServiceMapping { - test: {}; - badtest: {}; - } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/component/dist/esm/src/types.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/component/dist/esm/src/types.d.ts deleted file mode 100644 index e6818133..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/component/dist/esm/src/types.d.ts +++ /dev/null @@ -1,62 +0,0 @@ -/** - * @license - * Copyright 2019 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { ComponentContainer } from './component_container'; -export declare const enum InstantiationMode { - LAZY = "LAZY", - EAGER = "EAGER", - EXPLICIT = "EXPLICIT" -} -/** - * PUBLIC: A public component provides a set of public APIs to customers. A service namespace will be patched - * onto `firebase` namespace. Assume the component name is `test`, customers will be able - * to get the service by calling `firebase.test()` or `app.test()` where `app` is a `FirebaseApp` instance. - * - * PRIVATE: A private component provides a set of private APIs that are used internally by other - * Firebase SDKs. No serivce namespace is created in `firebase` namespace and customers have no way to get them. - */ -export declare const enum ComponentType { - PUBLIC = "PUBLIC", - PRIVATE = "PRIVATE", - VERSION = "VERSION" -} -export interface InstanceFactoryOptions { - instanceIdentifier?: string; - options?: {}; -} -export declare type InitializeOptions = InstanceFactoryOptions; -/** - * Factory to create an instance of type T, given a ComponentContainer. - * ComponentContainer is the IOC container that provides {@link Provider} - * for dependencies. - * - * NOTE: The container only provides {@link Provider} rather than the actual instances of dependencies. - * It is useful for lazily loaded dependencies and optional dependencies. - */ -export declare type InstanceFactory = (container: ComponentContainer, options: InstanceFactoryOptions) => NameServiceMapping[T]; -export declare type onInstanceCreatedCallback = (container: ComponentContainer, instanceIdentifier: string, instance: NameServiceMapping[T]) => void; -export interface Dictionary { - [key: string]: unknown; -} -/** - * This interface will be extended by Firebase SDKs to provide service name and service type mapping. - * It is used as a generic constraint to ensure type safety. - */ -export interface NameServiceMapping { -} -export declare type Name = keyof NameServiceMapping; -export declare type Service = NameServiceMapping[Name]; -export declare type OnInitCallBack = (instance: NameServiceMapping[T], identifier: string) => void; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/component/dist/esm/test/setup.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/component/dist/esm/test/setup.d.ts deleted file mode 100644 index 05e43f18..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/component/dist/esm/test/setup.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * @license - * Copyright 2019 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export {}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/component/dist/esm/test/util.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/component/dist/esm/test/util.d.ts deleted file mode 100644 index 06853a9e..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/component/dist/esm/test/util.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { FirebaseApp } from '@firebase/app-types'; -import { InstanceFactory, InstantiationMode, Name } from '../src/types'; -import { Component } from '../src/component'; -export declare function getFakeApp(appName?: string): FirebaseApp; -export declare function getFakeComponent(name: T, factory: InstanceFactory, multipleInstance?: boolean, instantiationMode?: InstantiationMode): Component; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/component/dist/index.cjs.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/component/dist/index.cjs.js deleted file mode 100644 index 9f3a274f..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/component/dist/index.cjs.js +++ /dev/null @@ -1,466 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, '__esModule', { value: true }); - -var tslib = require('tslib'); -var util = require('@firebase/util'); - -/** - * Component for service name T, e.g. `auth`, `auth-internal` - */ -var Component = /** @class */ (function () { - /** - * - * @param name The public service name, e.g. app, auth, firestore, database - * @param instanceFactory Service factory responsible for creating the public interface - * @param type whether the service provided by the component is public or private - */ - function Component(name, instanceFactory, type) { - this.name = name; - this.instanceFactory = instanceFactory; - this.type = type; - this.multipleInstances = false; - /** - * Properties to be added to the service namespace - */ - this.serviceProps = {}; - this.instantiationMode = "LAZY" /* LAZY */; - this.onInstanceCreated = null; - } - Component.prototype.setInstantiationMode = function (mode) { - this.instantiationMode = mode; - return this; - }; - Component.prototype.setMultipleInstances = function (multipleInstances) { - this.multipleInstances = multipleInstances; - return this; - }; - Component.prototype.setServiceProps = function (props) { - this.serviceProps = props; - return this; - }; - Component.prototype.setInstanceCreatedCallback = function (callback) { - this.onInstanceCreated = callback; - return this; - }; - return Component; -}()); - -/** - * @license - * Copyright 2019 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var DEFAULT_ENTRY_NAME = '[DEFAULT]'; - -/** - * @license - * Copyright 2019 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Provider for instance for service name T, e.g. 'auth', 'auth-internal' - * NameServiceMapping[T] is an alias for the type of the instance - */ -var Provider = /** @class */ (function () { - function Provider(name, container) { - this.name = name; - this.container = container; - this.component = null; - this.instances = new Map(); - this.instancesDeferred = new Map(); - this.instancesOptions = new Map(); - this.onInitCallbacks = new Map(); - } - /** - * @param identifier A provider can provide mulitple instances of a service - * if this.component.multipleInstances is true. - */ - Provider.prototype.get = function (identifier) { - // if multipleInstances is not supported, use the default name - var normalizedIdentifier = this.normalizeInstanceIdentifier(identifier); - if (!this.instancesDeferred.has(normalizedIdentifier)) { - var deferred = new util.Deferred(); - this.instancesDeferred.set(normalizedIdentifier, deferred); - if (this.isInitialized(normalizedIdentifier) || - this.shouldAutoInitialize()) { - // initialize the service if it can be auto-initialized - try { - var instance = this.getOrInitializeService({ - instanceIdentifier: normalizedIdentifier - }); - if (instance) { - deferred.resolve(instance); - } - } - catch (e) { - // when the instance factory throws an exception during get(), it should not cause - // a fatal error. We just return the unresolved promise in this case. - } - } - } - return this.instancesDeferred.get(normalizedIdentifier).promise; - }; - Provider.prototype.getImmediate = function (options) { - var _a; - // if multipleInstances is not supported, use the default name - var normalizedIdentifier = this.normalizeInstanceIdentifier(options === null || options === void 0 ? void 0 : options.identifier); - var optional = (_a = options === null || options === void 0 ? void 0 : options.optional) !== null && _a !== void 0 ? _a : false; - if (this.isInitialized(normalizedIdentifier) || - this.shouldAutoInitialize()) { - try { - return this.getOrInitializeService({ - instanceIdentifier: normalizedIdentifier - }); - } - catch (e) { - if (optional) { - return null; - } - else { - throw e; - } - } - } - else { - // In case a component is not initialized and should/can not be auto-initialized at the moment, return null if the optional flag is set, or throw - if (optional) { - return null; - } - else { - throw Error("Service " + this.name + " is not available"); - } - } - }; - Provider.prototype.getComponent = function () { - return this.component; - }; - Provider.prototype.setComponent = function (component) { - var e_1, _a; - if (component.name !== this.name) { - throw Error("Mismatching Component " + component.name + " for Provider " + this.name + "."); - } - if (this.component) { - throw Error("Component for " + this.name + " has already been provided"); - } - this.component = component; - // return early without attempting to initialize the component if the component requires explicit initialization (calling `Provider.initialize()`) - if (!this.shouldAutoInitialize()) { - return; - } - // if the service is eager, initialize the default instance - if (isComponentEager(component)) { - try { - this.getOrInitializeService({ instanceIdentifier: DEFAULT_ENTRY_NAME }); - } - catch (e) { - // when the instance factory for an eager Component throws an exception during the eager - // initialization, it should not cause a fatal error. - // TODO: Investigate if we need to make it configurable, because some component may want to cause - // a fatal error in this case? - } - } - try { - // Create service instances for the pending promises and resolve them - // NOTE: if this.multipleInstances is false, only the default instance will be created - // and all promises with resolve with it regardless of the identifier. - for (var _b = tslib.__values(this.instancesDeferred.entries()), _c = _b.next(); !_c.done; _c = _b.next()) { - var _d = tslib.__read(_c.value, 2), instanceIdentifier = _d[0], instanceDeferred = _d[1]; - var normalizedIdentifier = this.normalizeInstanceIdentifier(instanceIdentifier); - try { - // `getOrInitializeService()` should always return a valid instance since a component is guaranteed. use ! to make typescript happy. - var instance = this.getOrInitializeService({ - instanceIdentifier: normalizedIdentifier - }); - instanceDeferred.resolve(instance); - } - catch (e) { - // when the instance factory throws an exception, it should not cause - // a fatal error. We just leave the promise unresolved. - } - } - } - catch (e_1_1) { e_1 = { error: e_1_1 }; } - finally { - try { - if (_c && !_c.done && (_a = _b.return)) _a.call(_b); - } - finally { if (e_1) throw e_1.error; } - } - }; - Provider.prototype.clearInstance = function (identifier) { - if (identifier === void 0) { identifier = DEFAULT_ENTRY_NAME; } - this.instancesDeferred.delete(identifier); - this.instancesOptions.delete(identifier); - this.instances.delete(identifier); - }; - // app.delete() will call this method on every provider to delete the services - // TODO: should we mark the provider as deleted? - Provider.prototype.delete = function () { - return tslib.__awaiter(this, void 0, void 0, function () { - var services; - return tslib.__generator(this, function (_a) { - switch (_a.label) { - case 0: - services = Array.from(this.instances.values()); - return [4 /*yield*/, Promise.all(tslib.__spreadArray(tslib.__spreadArray([], tslib.__read(services - .filter(function (service) { return 'INTERNAL' in service; }) // legacy services - // eslint-disable-next-line @typescript-eslint/no-explicit-any - .map(function (service) { return service.INTERNAL.delete(); }))), tslib.__read(services - .filter(function (service) { return '_delete' in service; }) // modularized services - // eslint-disable-next-line @typescript-eslint/no-explicit-any - .map(function (service) { return service._delete(); }))))]; - case 1: - _a.sent(); - return [2 /*return*/]; - } - }); - }); - }; - Provider.prototype.isComponentSet = function () { - return this.component != null; - }; - Provider.prototype.isInitialized = function (identifier) { - if (identifier === void 0) { identifier = DEFAULT_ENTRY_NAME; } - return this.instances.has(identifier); - }; - Provider.prototype.getOptions = function (identifier) { - if (identifier === void 0) { identifier = DEFAULT_ENTRY_NAME; } - return this.instancesOptions.get(identifier) || {}; - }; - Provider.prototype.initialize = function (opts) { - var e_2, _a; - if (opts === void 0) { opts = {}; } - var _b = opts.options, options = _b === void 0 ? {} : _b; - var normalizedIdentifier = this.normalizeInstanceIdentifier(opts.instanceIdentifier); - if (this.isInitialized(normalizedIdentifier)) { - throw Error(this.name + "(" + normalizedIdentifier + ") has already been initialized"); - } - if (!this.isComponentSet()) { - throw Error("Component " + this.name + " has not been registered yet"); - } - var instance = this.getOrInitializeService({ - instanceIdentifier: normalizedIdentifier, - options: options - }); - try { - // resolve any pending promise waiting for the service instance - for (var _c = tslib.__values(this.instancesDeferred.entries()), _d = _c.next(); !_d.done; _d = _c.next()) { - var _e = tslib.__read(_d.value, 2), instanceIdentifier = _e[0], instanceDeferred = _e[1]; - var normalizedDeferredIdentifier = this.normalizeInstanceIdentifier(instanceIdentifier); - if (normalizedIdentifier === normalizedDeferredIdentifier) { - instanceDeferred.resolve(instance); - } - } - } - catch (e_2_1) { e_2 = { error: e_2_1 }; } - finally { - try { - if (_d && !_d.done && (_a = _c.return)) _a.call(_c); - } - finally { if (e_2) throw e_2.error; } - } - return instance; - }; - /** - * - * @param callback - a function that will be invoked after the provider has been initialized by calling provider.initialize(). - * The function is invoked SYNCHRONOUSLY, so it should not execute any longrunning tasks in order to not block the program. - * - * @param identifier An optional instance identifier - * @returns a function to unregister the callback - */ - Provider.prototype.onInit = function (callback, identifier) { - var _a; - var normalizedIdentifier = this.normalizeInstanceIdentifier(identifier); - var existingCallbacks = (_a = this.onInitCallbacks.get(normalizedIdentifier)) !== null && _a !== void 0 ? _a : new Set(); - existingCallbacks.add(callback); - this.onInitCallbacks.set(normalizedIdentifier, existingCallbacks); - var existingInstance = this.instances.get(normalizedIdentifier); - if (existingInstance) { - callback(existingInstance, normalizedIdentifier); - } - return function () { - existingCallbacks.delete(callback); - }; - }; - /** - * Invoke onInit callbacks synchronously - * @param instance the service instance` - */ - Provider.prototype.invokeOnInitCallbacks = function (instance, identifier) { - var e_3, _a; - var callbacks = this.onInitCallbacks.get(identifier); - if (!callbacks) { - return; - } - try { - for (var callbacks_1 = tslib.__values(callbacks), callbacks_1_1 = callbacks_1.next(); !callbacks_1_1.done; callbacks_1_1 = callbacks_1.next()) { - var callback = callbacks_1_1.value; - try { - callback(instance, identifier); - } - catch (_b) { - // ignore errors in the onInit callback - } - } - } - catch (e_3_1) { e_3 = { error: e_3_1 }; } - finally { - try { - if (callbacks_1_1 && !callbacks_1_1.done && (_a = callbacks_1.return)) _a.call(callbacks_1); - } - finally { if (e_3) throw e_3.error; } - } - }; - Provider.prototype.getOrInitializeService = function (_a) { - var instanceIdentifier = _a.instanceIdentifier, _b = _a.options, options = _b === void 0 ? {} : _b; - var instance = this.instances.get(instanceIdentifier); - if (!instance && this.component) { - instance = this.component.instanceFactory(this.container, { - instanceIdentifier: normalizeIdentifierForFactory(instanceIdentifier), - options: options - }); - this.instances.set(instanceIdentifier, instance); - this.instancesOptions.set(instanceIdentifier, options); - /** - * Invoke onInit listeners. - * Note this.component.onInstanceCreated is different, which is used by the component creator, - * while onInit listeners are registered by consumers of the provider. - */ - this.invokeOnInitCallbacks(instance, instanceIdentifier); - /** - * Order is important - * onInstanceCreated() should be called after this.instances.set(instanceIdentifier, instance); which - * makes `isInitialized()` return true. - */ - if (this.component.onInstanceCreated) { - try { - this.component.onInstanceCreated(this.container, instanceIdentifier, instance); - } - catch (_c) { - // ignore errors in the onInstanceCreatedCallback - } - } - } - return instance || null; - }; - Provider.prototype.normalizeInstanceIdentifier = function (identifier) { - if (identifier === void 0) { identifier = DEFAULT_ENTRY_NAME; } - if (this.component) { - return this.component.multipleInstances ? identifier : DEFAULT_ENTRY_NAME; - } - else { - return identifier; // assume multiple instances are supported before the component is provided. - } - }; - Provider.prototype.shouldAutoInitialize = function () { - return (!!this.component && - this.component.instantiationMode !== "EXPLICIT" /* EXPLICIT */); - }; - return Provider; -}()); -// undefined should be passed to the service factory for the default instance -function normalizeIdentifierForFactory(identifier) { - return identifier === DEFAULT_ENTRY_NAME ? undefined : identifier; -} -function isComponentEager(component) { - return component.instantiationMode === "EAGER" /* EAGER */; -} - -/** - * @license - * Copyright 2019 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * ComponentContainer that provides Providers for service name T, e.g. `auth`, `auth-internal` - */ -var ComponentContainer = /** @class */ (function () { - function ComponentContainer(name) { - this.name = name; - this.providers = new Map(); - } - /** - * - * @param component Component being added - * @param overwrite When a component with the same name has already been registered, - * if overwrite is true: overwrite the existing component with the new component and create a new - * provider with the new component. It can be useful in tests where you want to use different mocks - * for different tests. - * if overwrite is false: throw an exception - */ - ComponentContainer.prototype.addComponent = function (component) { - var provider = this.getProvider(component.name); - if (provider.isComponentSet()) { - throw new Error("Component " + component.name + " has already been registered with " + this.name); - } - provider.setComponent(component); - }; - ComponentContainer.prototype.addOrOverwriteComponent = function (component) { - var provider = this.getProvider(component.name); - if (provider.isComponentSet()) { - // delete the existing provider from the container, so we can register the new component - this.providers.delete(component.name); - } - this.addComponent(component); - }; - /** - * getProvider provides a type safe interface where it can only be called with a field name - * present in NameServiceMapping interface. - * - * Firebase SDKs providing services should extend NameServiceMapping interface to register - * themselves. - */ - ComponentContainer.prototype.getProvider = function (name) { - if (this.providers.has(name)) { - return this.providers.get(name); - } - // create a Provider for a service that hasn't registered with Firebase - var provider = new Provider(name, this); - this.providers.set(name, provider); - return provider; - }; - ComponentContainer.prototype.getProviders = function () { - return Array.from(this.providers.values()); - }; - return ComponentContainer; -}()); - -exports.Component = Component; -exports.ComponentContainer = ComponentContainer; -exports.Provider = Provider; -//# sourceMappingURL=index.cjs.js.map diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/component/dist/index.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/component/dist/index.d.ts deleted file mode 100644 index 2dd3de91..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/component/dist/index.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export { Component } from './src/component'; -export { ComponentContainer } from './src/component_container'; -export { Provider } from './src/provider'; -export { ComponentType, InstanceFactory, InstantiationMode, NameServiceMapping, Name, InstanceFactoryOptions } from './src/types'; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/component/dist/src/component.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/component/dist/src/component.d.ts deleted file mode 100644 index 6364195c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/component/dist/src/component.d.ts +++ /dev/null @@ -1,43 +0,0 @@ -/** - * @license - * Copyright 2019 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { InstantiationMode, InstanceFactory, ComponentType, Dictionary, Name, onInstanceCreatedCallback } from './types'; -/** - * Component for service name T, e.g. `auth`, `auth-internal` - */ -export declare class Component { - readonly name: T; - readonly instanceFactory: InstanceFactory; - readonly type: ComponentType; - multipleInstances: boolean; - /** - * Properties to be added to the service namespace - */ - serviceProps: Dictionary; - instantiationMode: InstantiationMode; - onInstanceCreated: onInstanceCreatedCallback | null; - /** - * - * @param name The public service name, e.g. app, auth, firestore, database - * @param instanceFactory Service factory responsible for creating the public interface - * @param type whether the service provided by the component is public or private - */ - constructor(name: T, instanceFactory: InstanceFactory, type: ComponentType); - setInstantiationMode(mode: InstantiationMode): this; - setMultipleInstances(multipleInstances: boolean): this; - setServiceProps(props: Dictionary): this; - setInstanceCreatedCallback(callback: onInstanceCreatedCallback): this; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/component/dist/src/component_container.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/component/dist/src/component_container.d.ts deleted file mode 100644 index b3adb581..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/component/dist/src/component_container.d.ts +++ /dev/null @@ -1,47 +0,0 @@ -/** - * @license - * Copyright 2019 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { Provider } from './provider'; -import { Component } from './component'; -import { Name } from './types'; -/** - * ComponentContainer that provides Providers for service name T, e.g. `auth`, `auth-internal` - */ -export declare class ComponentContainer { - private readonly name; - private readonly providers; - constructor(name: string); - /** - * - * @param component Component being added - * @param overwrite When a component with the same name has already been registered, - * if overwrite is true: overwrite the existing component with the new component and create a new - * provider with the new component. It can be useful in tests where you want to use different mocks - * for different tests. - * if overwrite is false: throw an exception - */ - addComponent(component: Component): void; - addOrOverwriteComponent(component: Component): void; - /** - * getProvider provides a type safe interface where it can only be called with a field name - * present in NameServiceMapping interface. - * - * Firebase SDKs providing services should extend NameServiceMapping interface to register - * themselves. - */ - getProvider(name: T): Provider; - getProviders(): Array>; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/component/dist/src/component_container.test.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/component/dist/src/component_container.test.d.ts deleted file mode 100644 index 6eb451dd..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/component/dist/src/component_container.test.d.ts +++ /dev/null @@ -1,24 +0,0 @@ -/** - * @license - * Copyright 2019 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import '../test/setup'; -declare module './types' { - interface NameServiceMapping { - rocket: {}; - ship: {}; - fireball: {}; - } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/component/dist/src/constants.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/component/dist/src/constants.d.ts deleted file mode 100644 index 336fb41c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/component/dist/src/constants.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * @license - * Copyright 2019 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export declare const DEFAULT_ENTRY_NAME = "[DEFAULT]"; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/component/dist/src/provider.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/component/dist/src/provider.d.ts deleted file mode 100644 index 54ef0a6f..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/component/dist/src/provider.d.ts +++ /dev/null @@ -1,79 +0,0 @@ -/** - * @license - * Copyright 2019 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { ComponentContainer } from './component_container'; -import { InitializeOptions, Name, NameServiceMapping, OnInitCallBack } from './types'; -import { Component } from './component'; -/** - * Provider for instance for service name T, e.g. 'auth', 'auth-internal' - * NameServiceMapping[T] is an alias for the type of the instance - */ -export declare class Provider { - private readonly name; - private readonly container; - private component; - private readonly instances; - private readonly instancesDeferred; - private readonly instancesOptions; - private onInitCallbacks; - constructor(name: T, container: ComponentContainer); - /** - * @param identifier A provider can provide mulitple instances of a service - * if this.component.multipleInstances is true. - */ - get(identifier?: string): Promise; - /** - * - * @param options.identifier A provider can provide mulitple instances of a service - * if this.component.multipleInstances is true. - * @param options.optional If optional is false or not provided, the method throws an error when - * the service is not immediately available. - * If optional is true, the method returns null if the service is not immediately available. - */ - getImmediate(options: { - identifier?: string; - optional: true; - }): NameServiceMapping[T] | null; - getImmediate(options?: { - identifier?: string; - optional?: false; - }): NameServiceMapping[T]; - getComponent(): Component | null; - setComponent(component: Component): void; - clearInstance(identifier?: string): void; - delete(): Promise; - isComponentSet(): boolean; - isInitialized(identifier?: string): boolean; - getOptions(identifier?: string): Record; - initialize(opts?: InitializeOptions): NameServiceMapping[T]; - /** - * - * @param callback - a function that will be invoked after the provider has been initialized by calling provider.initialize(). - * The function is invoked SYNCHRONOUSLY, so it should not execute any longrunning tasks in order to not block the program. - * - * @param identifier An optional instance identifier - * @returns a function to unregister the callback - */ - onInit(callback: OnInitCallBack, identifier?: string): () => void; - /** - * Invoke onInit callbacks synchronously - * @param instance the service instance` - */ - private invokeOnInitCallbacks; - private getOrInitializeService; - private normalizeInstanceIdentifier; - private shouldAutoInitialize; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/component/dist/src/provider.test.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/component/dist/src/provider.test.d.ts deleted file mode 100644 index 76029647..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/component/dist/src/provider.test.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -/** - * @license - * Copyright 2019 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import '../test/setup'; -declare module './types' { - interface NameServiceMapping { - test: {}; - badtest: {}; - } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/component/dist/src/types.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/component/dist/src/types.d.ts deleted file mode 100644 index e6818133..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/component/dist/src/types.d.ts +++ /dev/null @@ -1,62 +0,0 @@ -/** - * @license - * Copyright 2019 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { ComponentContainer } from './component_container'; -export declare const enum InstantiationMode { - LAZY = "LAZY", - EAGER = "EAGER", - EXPLICIT = "EXPLICIT" -} -/** - * PUBLIC: A public component provides a set of public APIs to customers. A service namespace will be patched - * onto `firebase` namespace. Assume the component name is `test`, customers will be able - * to get the service by calling `firebase.test()` or `app.test()` where `app` is a `FirebaseApp` instance. - * - * PRIVATE: A private component provides a set of private APIs that are used internally by other - * Firebase SDKs. No serivce namespace is created in `firebase` namespace and customers have no way to get them. - */ -export declare const enum ComponentType { - PUBLIC = "PUBLIC", - PRIVATE = "PRIVATE", - VERSION = "VERSION" -} -export interface InstanceFactoryOptions { - instanceIdentifier?: string; - options?: {}; -} -export declare type InitializeOptions = InstanceFactoryOptions; -/** - * Factory to create an instance of type T, given a ComponentContainer. - * ComponentContainer is the IOC container that provides {@link Provider} - * for dependencies. - * - * NOTE: The container only provides {@link Provider} rather than the actual instances of dependencies. - * It is useful for lazily loaded dependencies and optional dependencies. - */ -export declare type InstanceFactory = (container: ComponentContainer, options: InstanceFactoryOptions) => NameServiceMapping[T]; -export declare type onInstanceCreatedCallback = (container: ComponentContainer, instanceIdentifier: string, instance: NameServiceMapping[T]) => void; -export interface Dictionary { - [key: string]: unknown; -} -/** - * This interface will be extended by Firebase SDKs to provide service name and service type mapping. - * It is used as a generic constraint to ensure type safety. - */ -export interface NameServiceMapping { -} -export declare type Name = keyof NameServiceMapping; -export declare type Service = NameServiceMapping[Name]; -export declare type OnInitCallBack = (instance: NameServiceMapping[T], identifier: string) => void; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/component/dist/test/setup.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/component/dist/test/setup.d.ts deleted file mode 100644 index 05e43f18..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/component/dist/test/setup.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * @license - * Copyright 2019 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export {}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/component/dist/test/util.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/component/dist/test/util.d.ts deleted file mode 100644 index 06853a9e..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/component/dist/test/util.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { FirebaseApp } from '@firebase/app-types'; -import { InstanceFactory, InstantiationMode, Name } from '../src/types'; -import { Component } from '../src/component'; -export declare function getFakeApp(appName?: string): FirebaseApp; -export declare function getFakeComponent(name: T, factory: InstanceFactory, multipleInstance?: boolean, instantiationMode?: InstantiationMode): Component; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/component/package.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/component/package.json deleted file mode 100644 index 41360f48..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/component/package.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "name": "@firebase/component", - "version": "0.5.21", - "description": "Firebase Component Platform", - "author": "Firebase (https://firebase.google.com/)", - "main": "dist/index.cjs.js", - "browser": "dist/esm/index.esm2017.js", - "module": "dist/esm/index.esm2017.js", - "esm5": "dist/esm/index.esm5.js", - "exports": { - ".": { - "types": "./dist/index.d.ts", - "require": "./dist/index.cjs.js", - "esm5": "./dist/esm/index.esm5.js", - "default": "./dist/esm/index.esm2017.js" - }, - "./package.json": "./package.json" - }, - "files": [ - "dist" - ], - "scripts": { - "lint": "eslint -c .eslintrc.js '**/*.ts' --ignore-path '../../.gitignore'", - "lint:fix": "eslint --fix -c .eslintrc.js '**/*.ts' --ignore-path '../../.gitignore'", - "build": "rollup -c", - "build:deps": "lerna run --scope @firebase/component --include-dependencies build", - "dev": "rollup -c -w", - "test": "run-p lint test:all", - "test:all": "run-p test:browser test:node", - "test:ci": "node ../../scripts/run_tests_in_ci.js -s test:all", - "test:browser": "karma start --single-run", - "test:node": "TS_NODE_COMPILER_OPTIONS='{\"module\":\"commonjs\"}' nyc --reporter lcovonly -- mocha src/**/*.test.ts --config ../../config/mocharc.node.js" - }, - "dependencies": { - "@firebase/util": "1.7.3", - "tslib": "^2.1.0" - }, - "license": "Apache-2.0", - "devDependencies": { - "rollup": "2.79.1", - "rollup-plugin-typescript2": "0.31.2", - "typescript": "4.2.2" - }, - "repository": { - "directory": "packages/component", - "type": "git", - "url": "https://github.com/firebase/firebase-js-sdk.git" - }, - "bugs": { - "url": "https://github.com/firebase/firebase-js-sdk/issues" - }, - "typings": "dist/index.d.ts", - "nyc": { - "extension": [ - ".ts" - ], - "reportDir": "./coverage/node" - } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/CHANGELOG.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/CHANGELOG.md deleted file mode 100644 index b6a39aa1..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/CHANGELOG.md +++ /dev/null @@ -1,224 +0,0 @@ -# @firebase/database-compat - -## 0.2.10 - -### Patch Changes - -- [`4af28c1a4`](https://github.com/firebase/firebase-js-sdk/commit/4af28c1a42bd25ce2353f694ca1724c6101cbce5) [#6682](https://github.com/firebase/firebase-js-sdk/pull/6682) - Upgrade TypeScript to 4.7.4. - -- Updated dependencies [[`4af28c1a4`](https://github.com/firebase/firebase-js-sdk/commit/4af28c1a42bd25ce2353f694ca1724c6101cbce5)]: - - @firebase/component@0.5.21 - - @firebase/database@0.13.10 - - @firebase/database-types@0.9.17 - - @firebase/logger@0.3.4 - - @firebase/util@1.7.3 - -## 0.2.9 - -### Patch Changes - -- Updated dependencies [[`807f06aa2`](https://github.com/firebase/firebase-js-sdk/commit/807f06aa26438a91aaea08fd38efb6c706bb8a5d)]: - - @firebase/util@1.7.2 - - @firebase/component@0.5.20 - - @firebase/database@0.13.9 - - @firebase/database-types@0.9.16 - -## 0.2.8 - -### Patch Changes - -- Updated dependencies [[`5aa48d0ab`](https://github.com/firebase/firebase-js-sdk/commit/5aa48d0ab432002ccf49d65bf2ff637e82a2b402), [`171b78b76`](https://github.com/firebase/firebase-js-sdk/commit/171b78b762826a640d267dd4dd172ad9459c4561), [`29d034072`](https://github.com/firebase/firebase-js-sdk/commit/29d034072c20af394ce384e42aa10a37d5dfcb18)]: - - @firebase/database@0.13.8 - - @firebase/util@1.7.1 - - @firebase/component@0.5.19 - - @firebase/database-types@0.9.15 - -## 0.2.7 - -### Patch Changes - -- Updated dependencies [[`fdd4ab464`](https://github.com/firebase/firebase-js-sdk/commit/fdd4ab464b59a107bdcc195df3f01e32efd89ed4)]: - - @firebase/util@1.7.0 - - @firebase/database@0.13.7 - - @firebase/database-types@0.9.14 - - @firebase/component@0.5.18 - -## 0.2.6 - -### Patch Changes - -- Updated dependencies [[`f35533594`](https://github.com/firebase/firebase-js-sdk/commit/f355335942b874ba390bcbf3be6de44a3d33dce8)]: - - @firebase/database@0.13.6 - -## 0.2.5 - -### Patch Changes - -- [`9f1e3c667`](https://github.com/firebase/firebase-js-sdk/commit/9f1e3c66747126c8e24894d73f7fa27480bec08d) [#6536](https://github.com/firebase/firebase-js-sdk/pull/6536) - Revert "Updated type of action parameter for DataSnapshot#forEach" - -* [`fcd4b8ac3`](https://github.com/firebase/firebase-js-sdk/commit/fcd4b8ac36636a60d83cd3370969ff9192f9e6ad) [#6508](https://github.com/firebase/firebase-js-sdk/pull/6508) - Fixed faulty transaction bug causing filtered index queries to override default queries. - -* Updated dependencies [[`9f1e3c667`](https://github.com/firebase/firebase-js-sdk/commit/9f1e3c66747126c8e24894d73f7fa27480bec08d), [`a5d9e1083`](https://github.com/firebase/firebase-js-sdk/commit/a5d9e10831c2877e9d15c8a33b15557e4251c4de), [`fcd4b8ac3`](https://github.com/firebase/firebase-js-sdk/commit/fcd4b8ac36636a60d83cd3370969ff9192f9e6ad)]: - - @firebase/database-types@0.9.13 - - @firebase/database@0.13.5 - -## 0.2.4 - -### Patch Changes - -- [`65838089d`](https://github.com/firebase/firebase-js-sdk/commit/65838089da47965e5e39e58c76a81a74666b215e) [#6374](https://github.com/firebase/firebase-js-sdk/pull/6374) (fixes [#6368](https://github.com/firebase/firebase-js-sdk/issues/6368)) - Updated type of action parameter for DataSnapshot#forEach - -- Updated dependencies [[`65838089d`](https://github.com/firebase/firebase-js-sdk/commit/65838089da47965e5e39e58c76a81a74666b215e)]: - - @firebase/database@0.13.4 - - @firebase/database-types@0.9.12 - -## 0.2.3 - -### Patch Changes - -- Updated dependencies [[`c187446a2`](https://github.com/firebase/firebase-js-sdk/commit/c187446a202d881f55800be167cdb37b4d0e4a13), [`b12af44a5`](https://github.com/firebase/firebase-js-sdk/commit/b12af44a5c7500e1192d6cc1a4afc4d77efadbaf), [`6a8be1337`](https://github.com/firebase/firebase-js-sdk/commit/6a8be1337f19a49db40e0c757f571f42b5b4d494)]: - - @firebase/database@0.13.3 - - @firebase/util@1.6.3 - - @firebase/component@0.5.17 - - @firebase/database-types@0.9.11 - -## 0.2.2 - -### Patch Changes - -- Updated dependencies [[`578dc5836`](https://github.com/firebase/firebase-js-sdk/commit/578dc58365c6c71d8ad01dd8b9dbe829e76de068), [`efe2000fc`](https://github.com/firebase/firebase-js-sdk/commit/efe2000fc499e2c85c4e5e0fef6741ff3bad2eb0)]: - - @firebase/database@0.13.2 - - @firebase/util@1.6.2 - - @firebase/component@0.5.16 - - @firebase/database-types@0.9.10 - -## 0.2.1 - -### Patch Changes - -- [`2cd1cc76f`](https://github.com/firebase/firebase-js-sdk/commit/2cd1cc76f2a308135cd60f424fe09084a34b5cb5) [#6307](https://github.com/firebase/firebase-js-sdk/pull/6307) (fixes [#6300](https://github.com/firebase/firebase-js-sdk/issues/6300)) - fix: add type declarations to exports field - -* [`497d34c84`](https://github.com/firebase/firebase-js-sdk/commit/497d34c8472a19cb8baca56985c98346e5a4727d) [#6319](https://github.com/firebase/firebase-js-sdk/pull/6319) - Remove app-compat from peerDependencies to avoid npm install warning in firebase-admin. - -* Updated dependencies [[`2cd1cc76f`](https://github.com/firebase/firebase-js-sdk/commit/2cd1cc76f2a308135cd60f424fe09084a34b5cb5)]: - - @firebase/component@0.5.15 - - @firebase/database@0.13.1 - - @firebase/logger@0.3.3 - - @firebase/util@1.6.1 - - @firebase/database-types@0.9.9 - -## 0.2.0 - -### Minor Changes - -- [`9c6808fea`](https://github.com/firebase/firebase-js-sdk/commit/9c6808fea231d1ab6de6f6ab548c67b751a12a78) [#6171](https://github.com/firebase/firebase-js-sdk/pull/6171) - Add `forceWebSockets()` and `forceLongPolling()` - -### Patch Changes - -- Updated dependencies [[`874cdbbcc`](https://github.com/firebase/firebase-js-sdk/commit/874cdbbccbc2bf8f4ee18abe220e87dc52e6a8db), [`9c5c9c36d`](https://github.com/firebase/firebase-js-sdk/commit/9c5c9c36da80b98b73cfd60ef2e2965087e9f801), [`9c6808fea`](https://github.com/firebase/firebase-js-sdk/commit/9c6808fea231d1ab6de6f6ab548c67b751a12a78)]: - - @firebase/database@0.13.0 - - @firebase/util@1.6.0 - - @firebase/component@0.5.14 - - @firebase/database-types@0.9.8 - -## 0.1.8 - -### Patch Changes - -- Updated dependencies [[`1c37b5e96`](https://github.com/firebase/firebase-js-sdk/commit/1c37b5e965978d796c46ff6b9f52051cf6070751), [`e9e5f6b3c`](https://github.com/firebase/firebase-js-sdk/commit/e9e5f6b3ca9d61323b22f87986d9959f5297ec59), [`7a4e65cef`](https://github.com/firebase/firebase-js-sdk/commit/7a4e65cef9468a20fb32dc112aa7113345bc76c5)]: - - @firebase/database-types@0.9.7 - - @firebase/util@1.5.2 - - @firebase/database@0.12.8 - - @firebase/component@0.5.13 - -## 0.1.7 - -### Patch Changes - -- Updated dependencies [[`3198d58dc`](https://github.com/firebase/firebase-js-sdk/commit/3198d58dcedbf7583914dbcc76984f6f7df8d2ef)]: - - @firebase/util@1.5.1 - - @firebase/component@0.5.12 - - @firebase/database@0.12.7 - - @firebase/database-types@0.9.6 - -## 0.1.6 - -### Patch Changes - -- Updated dependencies [[`2d672cead`](https://github.com/firebase/firebase-js-sdk/commit/2d672cead167187cb714cd89b638c0884ba58f03)]: - - @firebase/util@1.5.0 - - @firebase/database@0.12.6 - - @firebase/component@0.5.11 - - @firebase/database-types@0.9.5 - -## 0.1.5 - -### Patch Changes - -- Updated dependencies [[`3b481f572`](https://github.com/firebase/firebase-js-sdk/commit/3b481f572456e1eab3435bfc25717770d95a8c49)]: - - @firebase/util@1.4.3 - - @firebase/component@0.5.10 - - @firebase/database@0.12.5 - - @firebase/database-types@0.9.4 - -## 0.1.4 - -### Patch Changes - -- [`3281315fa`](https://github.com/firebase/firebase-js-sdk/commit/3281315fae9c6f535f9d5052ee17d60861ea569a) [#5708](https://github.com/firebase/firebase-js-sdk/pull/5708) (fixes [#1487](https://github.com/firebase/firebase-js-sdk/issues/1487)) - Update build scripts to work with the exports field - -- Updated dependencies [[`3281315fa`](https://github.com/firebase/firebase-js-sdk/commit/3281315fae9c6f535f9d5052ee17d60861ea569a)]: - - @firebase/component@0.5.9 - - @firebase/database@0.12.4 - - @firebase/logger@0.3.2 - - @firebase/util@1.4.2 - - @firebase/database-types@0.9.3 - -## 0.1.3 - -### Patch Changes - -- [`2322b6023`](https://github.com/firebase/firebase-js-sdk/commit/2322b6023c628cd9f4f4172767c17d215dd91684) [#5693](https://github.com/firebase/firebase-js-sdk/pull/5693) - Add exports field to all packages - -- Updated dependencies [[`2322b6023`](https://github.com/firebase/firebase-js-sdk/commit/2322b6023c628cd9f4f4172767c17d215dd91684)]: - - @firebase/component@0.5.8 - - @firebase/database@0.12.3 - - @firebase/logger@0.3.1 - - @firebase/util@1.4.1 - - @firebase/database-types@0.9.2 - -## 0.1.2 - -### Patch Changes - -- [`352cc2647`](https://github.com/firebase/firebase-js-sdk/commit/352cc26476a0c249f89d19eb371ecdcbbd067e5f) [#5587](https://github.com/firebase/firebase-js-sdk/pull/5587) - Add "repository" field to package.json files that were missing it. - -- Updated dependencies [[`93795c780`](https://github.com/firebase/firebase-js-sdk/commit/93795c7801d6b28ccbbe5855fd2f3fc377b1db5f)]: - - @firebase/database@0.12.2 - -## 0.1.1 - -### Patch Changes - -- [`dfe65ff9b`](https://github.com/firebase/firebase-js-sdk/commit/dfe65ff9bfa66d318d45e2a666e302867ae53a01) [#5537](https://github.com/firebase/firebase-js-sdk/pull/5537) - Added an entry point `@firebase/database-compat/standalone` to share code with Admin SDK properly - -* [`b79bd33e4`](https://github.com/firebase/firebase-js-sdk/commit/b79bd33e4d3fe6c051b29a85d5141fcb8dcc8d2d) [#5531](https://github.com/firebase/firebase-js-sdk/pull/5531) - export types from @firebase/database-compat for admin SDK - -* Updated dependencies [[`dfe65ff9b`](https://github.com/firebase/firebase-js-sdk/commit/dfe65ff9bfa66d318d45e2a666e302867ae53a01), [`a99943fe3`](https://github.com/firebase/firebase-js-sdk/commit/a99943fe3bd5279761aa29d138ec91272b06df39), [`b835b4cba`](https://github.com/firebase/firebase-js-sdk/commit/b835b4cbabc4b7b180ae38b908c49205ce31a422)]: - - @firebase/database@0.12.1 - - @firebase/logger@0.3.0 - - @firebase/util@1.4.0 - - @firebase/component@0.5.7 - - @firebase/database-types@0.9.1 - -## 0.1.0 - -### Minor Changes - -- [`cdada6c68`](https://github.com/firebase/firebase-js-sdk/commit/cdada6c68f9740d13dd6674bcb658e28e68253b6) [#5345](https://github.com/firebase/firebase-js-sdk/pull/5345) (fixes [#5015](https://github.com/firebase/firebase-js-sdk/issues/5015)) - Release modularized SDKs - -### Patch Changes - -- Updated dependencies [[`cdada6c68`](https://github.com/firebase/firebase-js-sdk/commit/cdada6c68f9740d13dd6674bcb658e28e68253b6)]: - - @firebase/database@0.12.0 - - @firebase/database-types@0.9.0 diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/README.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/README.md deleted file mode 100644 index 656ab839..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# @firebase/database-compat - -This is the compatibility layer for the Firebase Realtime Database component of the Firebase JS SDK. - -**This package is not intended for direct usage, and should only be used via the officially supported [firebase](https://www.npmjs.com/package/firebase) package.** diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/database-compat/src/api/Database.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/database-compat/src/api/Database.d.ts deleted file mode 100644 index 0ec2668a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/database-compat/src/api/Database.d.ts +++ /dev/null @@ -1,74 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { FirebaseApp } from '@firebase/app-types'; -import { FirebaseService } from '@firebase/app-types/private'; -import { forceLongPolling, forceWebSockets, Database as ModularDatabase } from '@firebase/database'; -import { Compat, EmulatorMockTokenOptions } from '@firebase/util'; -import { Reference } from './Reference'; -/** - * Class representing a firebase database. - */ -export declare class Database implements FirebaseService, Compat { - readonly _delegate: ModularDatabase; - readonly app: FirebaseApp; - static readonly ServerValue: { - TIMESTAMP: object; - increment: (delta: number) => object; - }; - /** - * The constructor should not be called by users of our public API. - */ - constructor(_delegate: ModularDatabase, app: FirebaseApp); - INTERNAL: { - delete: () => Promise; - forceWebSockets: typeof forceWebSockets; - forceLongPolling: typeof forceLongPolling; - }; - /** - * Modify this instance to communicate with the Realtime Database emulator. - * - *

Note: This method must be called before performing any other operation. - * - * @param host - the emulator host (ex: localhost) - * @param port - the emulator port (ex: 8080) - * @param options.mockUserToken - the mock auth token to use for unit testing Security Rules - */ - useEmulator(host: string, port: number, options?: { - mockUserToken?: EmulatorMockTokenOptions; - }): void; - /** - * Returns a reference to the root or to the path specified in the provided - * argument. - * - * @param path - The relative string path or an existing Reference to a database - * location. - * @throws If a Reference is provided, throws if it does not belong to the - * same project. - * @returns Firebase reference. - */ - ref(path?: string): Reference; - ref(path?: Reference): Reference; - /** - * Returns a reference to the root or the path specified in url. - * We throw a exception if the url is not in the same domain as the - * current repo. - * @returns Firebase reference. - */ - refFromURL(url: string): Reference; - goOffline(): void; - goOnline(): void; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/database-compat/src/api/Reference.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/database-compat/src/api/Reference.d.ts deleted file mode 100644 index 75adc85a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/database-compat/src/api/Reference.d.ts +++ /dev/null @@ -1,201 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { DataSnapshot as ModularDataSnapshot, Query as ExpQuery, DatabaseReference as ModularReference } from '@firebase/database'; -import { Compat } from '@firebase/util'; -import { Database } from './Database'; -import { OnDisconnect } from './onDisconnect'; -import { TransactionResult } from './TransactionResult'; -/** - * Class representing a firebase data snapshot. It wraps a SnapshotNode and - * surfaces the public methods (val, forEach, etc.) we want to expose. - */ -export declare class DataSnapshot implements Compat { - readonly _database: Database; - readonly _delegate: ModularDataSnapshot; - constructor(_database: Database, _delegate: ModularDataSnapshot); - /** - * Retrieves the snapshot contents as JSON. Returns null if the snapshot is - * empty. - * - * @returns JSON representation of the DataSnapshot contents, or null if empty. - */ - val(): unknown; - /** - * Returns the snapshot contents as JSON, including priorities of node. Suitable for exporting - * the entire node contents. - * @returns JSON representation of the DataSnapshot contents, or null if empty. - */ - exportVal(): unknown; - toJSON(): unknown; - /** - * Returns whether the snapshot contains a non-null value. - * - * @returns Whether the snapshot contains a non-null value, or is empty. - */ - exists(): boolean; - /** - * Returns a DataSnapshot of the specified child node's contents. - * - * @param path - Path to a child. - * @returns DataSnapshot for child node. - */ - child(path: string): DataSnapshot; - /** - * Returns whether the snapshot contains a child at the specified path. - * - * @param path - Path to a child. - * @returns Whether the child exists. - */ - hasChild(path: string): boolean; - /** - * Returns the priority of the object, or null if no priority was set. - * - * @returns The priority. - */ - getPriority(): string | number | null; - /** - * Iterates through child nodes and calls the specified action for each one. - * - * @param action - Callback function to be called - * for each child. - * @returns True if forEach was canceled by action returning true for - * one of the child nodes. - */ - forEach(action: (snapshot: DataSnapshot) => boolean | void): boolean; - /** - * Returns whether this DataSnapshot has children. - * @returns True if the DataSnapshot contains 1 or more child nodes. - */ - hasChildren(): boolean; - get key(): string; - /** - * Returns the number of children for this DataSnapshot. - * @returns The number of children that this DataSnapshot contains. - */ - numChildren(): number; - /** - * @returns The Firebase reference for the location this snapshot's data came - * from. - */ - getRef(): Reference; - get ref(): Reference; -} -export interface SnapshotCallback { - (dataSnapshot: DataSnapshot, previousChildName?: string | null): unknown; -} -/** - * A Query represents a filter to be applied to a firebase location. This object purely represents the - * query expression (and exposes our public API to build the query). The actual query logic is in ViewBase.js. - * - * Since every Firebase reference is a query, Firebase inherits from this object. - */ -export declare class Query implements Compat { - readonly database: Database; - readonly _delegate: ExpQuery; - constructor(database: Database, _delegate: ExpQuery); - on(eventType: string, callback: SnapshotCallback, cancelCallbackOrContext?: ((a: Error) => unknown) | object | null, context?: object | null): SnapshotCallback; - off(eventType?: string, callback?: SnapshotCallback, context?: object | null): void; - /** - * Get the server-value for this query, or return a cached value if not connected. - */ - get(): Promise; - /** - * Attaches a listener, waits for the first event, and then removes the listener - */ - once(eventType: string, callback?: SnapshotCallback, failureCallbackOrContext?: ((a: Error) => void) | object | null, context?: object | null): Promise; - /** - * Set a limit and anchor it to the start of the window. - */ - limitToFirst(limit: number): Query; - /** - * Set a limit and anchor it to the end of the window. - */ - limitToLast(limit: number): Query; - /** - * Given a child path, return a new query ordered by the specified grandchild path. - */ - orderByChild(path: string): Query; - /** - * Return a new query ordered by the KeyIndex - */ - orderByKey(): Query; - /** - * Return a new query ordered by the PriorityIndex - */ - orderByPriority(): Query; - /** - * Return a new query ordered by the ValueIndex - */ - orderByValue(): Query; - startAt(value?: number | string | boolean | null, name?: string | null): Query; - startAfter(value?: number | string | boolean | null, name?: string | null): Query; - endAt(value?: number | string | boolean | null, name?: string | null): Query; - endBefore(value?: number | string | boolean | null, name?: string | null): Query; - /** - * Load the selection of children with exactly the specified value, and, optionally, - * the specified name. - */ - equalTo(value: number | string | boolean | null, name?: string): Query; - /** - * @returns URL for this location. - */ - toString(): string; - toJSON(): string; - /** - * Return true if this query and the provided query are equivalent; otherwise, return false. - */ - isEqual(other: Query): boolean; - /** - * Helper used by .on and .once to extract the context and or cancel arguments. - * @param fnName - The function name (on or once) - * - */ - private static getCancelAndContextArgs_; - get ref(): Reference; -} -export declare class Reference extends Query implements Compat { - readonly database: Database; - readonly _delegate: ModularReference; - then: Promise['then']; - catch: Promise['catch']; - /** - * Call options: - * new Reference(Repo, Path) or - * new Reference(url: string, string|RepoManager) - * - * Externally - this is the firebase.database.Reference type. - */ - constructor(database: Database, _delegate: ModularReference); - /** @returns {?string} */ - getKey(): string | null; - child(pathString: string): Reference; - /** @returns {?Reference} */ - getParent(): Reference | null; - /** @returns {!Reference} */ - getRoot(): Reference; - set(newVal: unknown, onComplete?: (error: Error | null) => void): Promise; - update(values: object, onComplete?: (a: Error | null) => void): Promise; - setWithPriority(newVal: unknown, newPriority: string | number | null, onComplete?: (a: Error | null) => void): Promise; - remove(onComplete?: (a: Error | null) => void): Promise; - transaction(transactionUpdate: (currentData: unknown) => unknown, onComplete?: (error: Error | null, committed: boolean, dataSnapshot: DataSnapshot | null) => void, applyLocally?: boolean): Promise; - setPriority(priority: string | number | null, onComplete?: (a: Error | null) => void): Promise; - push(value?: unknown, onComplete?: (a: Error | null) => void): Reference; - onDisconnect(): OnDisconnect; - get key(): string | null; - get parent(): Reference | null; - get root(): Reference; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/database-compat/src/api/TransactionResult.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/database-compat/src/api/TransactionResult.d.ts deleted file mode 100644 index 2fac36e1..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/database-compat/src/api/TransactionResult.d.ts +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { DataSnapshot } from './Reference'; -export declare class TransactionResult { - committed: boolean; - snapshot: DataSnapshot; - /** - * A type for the resolve value of Firebase.transaction. - */ - constructor(committed: boolean, snapshot: DataSnapshot); - toJSON(): object; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/database-compat/src/api/internal.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/database-compat/src/api/internal.d.ts deleted file mode 100644 index 234da3ea..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/database-compat/src/api/internal.d.ts +++ /dev/null @@ -1,39 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { FirebaseApp } from '@firebase/app-types'; -import { FirebaseAuthInternal } from '@firebase/auth-interop-types'; -import * as types from '@firebase/database-types'; -/** - * Used by console to create a database based on the app, - * passed database URL and a custom auth implementation. - * - * @param app - A valid FirebaseApp-like object - * @param url - A valid Firebase databaseURL - * @param version - custom version e.g. firebase-admin version - * @param customAuthImpl - custom auth implementation - */ -export declare function initStandalone({ app, url, version, customAuthImpl, namespace, nodeAdmin }: { - app: FirebaseApp; - url: string; - version: string; - customAuthImpl: FirebaseAuthInternal; - namespace: T; - nodeAdmin?: boolean; -}): { - instance: types.Database; - namespace: T; -}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/database-compat/src/api/onDisconnect.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/database-compat/src/api/onDisconnect.d.ts deleted file mode 100644 index 5932a8ad..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/database-compat/src/api/onDisconnect.d.ts +++ /dev/null @@ -1,27 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { OnDisconnect as ModularOnDisconnect } from '@firebase/database'; -import { Compat } from '@firebase/util'; -export declare class OnDisconnect implements Compat { - readonly _delegate: ModularOnDisconnect; - constructor(_delegate: ModularOnDisconnect); - cancel(onComplete?: (a: Error | null) => void): Promise; - remove(onComplete?: (a: Error | null) => void): Promise; - set(value: unknown, onComplete?: (a: Error | null) => void): Promise; - setWithPriority(value: unknown, priority: number | string | null, onComplete?: (a: Error | null) => void): Promise; - update(objectToMerge: Record, onComplete?: (a: Error | null) => void): Promise; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/database-compat/src/index.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/database-compat/src/index.d.ts deleted file mode 100644 index 8fc1cdbc..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/database-compat/src/index.d.ts +++ /dev/null @@ -1,72 +0,0 @@ -/** - * @license - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { FirebaseNamespace } from '@firebase/app-compat'; -import * as types from '@firebase/database-types'; -export declare function registerDatabase(instance: FirebaseNamespace): void; -declare module '@firebase/app-compat' { - interface FirebaseNamespace { - database?: { - (app?: FirebaseApp): types.FirebaseDatabase; - enableLogging: typeof types.enableLogging; - ServerValue: types.ServerValue; - Database: typeof types.FirebaseDatabase; - }; - } - interface FirebaseApp { - database?(databaseURL?: string): types.FirebaseDatabase; - } -} - -import { FirebaseApp as FirebaseAppCompat } from "@firebase/app-compat"; -import { type DatabaseReference, type EmulatorMockTokenOptions, type DataSnapshot, type Database, type EventType, type Unsubscribe, type ListenOptions, type OnDisconnect, type ThenableReference, type QueryConstraint, type Query, type TransactionOptions, type TransactionResult } from "@firebase/database"; -declare module "@firebase/database" { - function child(parent: types.Reference, path: string): DatabaseReference; - function connectDatabaseEmulator(db: types.FirebaseDatabase, host: string, port: number, options?: { - mockUserToken?: EmulatorMockTokenOptions | string; - }): void; - function get(query: types.Query): Promise; - function getDatabase(app?: FirebaseAppCompat, url?: string): Database; - function goOffline(db: types.FirebaseDatabase): void; - function goOnline(db: types.FirebaseDatabase): void; - function off(query: types.Query, eventType?: EventType, callback?: (snapshot: DataSnapshot, previousChildName?: string | null) => unknown): void; - function onChildAdded(query: types.Query, callback: (snapshot: DataSnapshot, previousChildName?: string | null) => unknown, cancelCallback?: (error: Error) => unknown): Unsubscribe; - function onChildAdded(query: types.Query, callback: (snapshot: DataSnapshot, previousChildName: string | null) => unknown, options: ListenOptions): Unsubscribe; - function onChildAdded(query: types.Query, callback: (snapshot: DataSnapshot, previousChildName: string | null) => unknown, cancelCallback: (error: Error) => unknown, options: ListenOptions): Unsubscribe; - function onChildChanged(query: types.Query, callback: (snapshot: DataSnapshot, previousChildName: string | null) => unknown, cancelCallback?: (error: Error) => unknown): Unsubscribe; - function onChildChanged(query: types.Query, callback: (snapshot: DataSnapshot, previousChildName: string | null) => unknown, options: ListenOptions): Unsubscribe; - function onChildChanged(query: types.Query, callback: (snapshot: DataSnapshot, previousChildName: string | null) => unknown, cancelCallback: (error: Error) => unknown, options: ListenOptions): Unsubscribe; - function onChildMoved(query: types.Query, callback: (snapshot: DataSnapshot, previousChildName: string | null) => unknown, cancelCallback?: (error: Error) => unknown): Unsubscribe; - function onChildMoved(query: types.Query, callback: (snapshot: DataSnapshot, previousChildName: string | null) => unknown, options: ListenOptions): Unsubscribe; - function onChildMoved(query: types.Query, callback: (snapshot: DataSnapshot, previousChildName: string | null) => unknown, cancelCallback: (error: Error) => unknown, options: ListenOptions): Unsubscribe; - function onChildRemoved(query: types.Query, callback: (snapshot: DataSnapshot) => unknown, cancelCallback?: (error: Error) => unknown): Unsubscribe; - function onChildRemoved(query: types.Query, callback: (snapshot: DataSnapshot) => unknown, options: ListenOptions): Unsubscribe; - function onChildRemoved(query: types.Query, callback: (snapshot: DataSnapshot) => unknown, cancelCallback: (error: Error) => unknown, options: ListenOptions): Unsubscribe; - function onDisconnect(ref: types.Reference): OnDisconnect; - function onValue(query: types.Query, callback: (snapshot: DataSnapshot) => unknown, cancelCallback?: (error: Error) => unknown): Unsubscribe; - function onValue(query: types.Query, callback: (snapshot: DataSnapshot) => unknown, options: ListenOptions): Unsubscribe; - function onValue(query: types.Query, callback: (snapshot: DataSnapshot) => unknown, cancelCallback: (error: Error) => unknown, options: ListenOptions): Unsubscribe; - function push(parent: types.Reference, value?: unknown): ThenableReference; - function query(query: types.Query, ...queryConstraints: QueryConstraint[]): Query; - function ref(db: types.FirebaseDatabase, path?: string): DatabaseReference; - function refFromURL(db: types.FirebaseDatabase, url: string): DatabaseReference; - function remove(ref: types.Reference): Promise; - function runTransaction(ref: types.Reference, transactionUpdate: (currentData: any) => unknown, options?: TransactionOptions): Promise; - function set(ref: types.Reference, value: unknown): Promise; - function setPriority(ref: types.Reference, priority: string | number | null): Promise; - function setWithPriority(ref: types.Reference, value: unknown, priority: string | number | null): Promise; - function update(ref: types.Reference, values: object): Promise; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/database-compat/src/index.node.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/database-compat/src/index.node.d.ts deleted file mode 100644 index bb8c84ef..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/database-compat/src/index.node.d.ts +++ /dev/null @@ -1,30 +0,0 @@ -/** - * @license - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import * as types from '@firebase/database-types'; -declare module '@firebase/app-compat' { - interface FirebaseNamespace { - database?: { - (app?: FirebaseApp): types.FirebaseDatabase; - enableLogging: typeof types.enableLogging; - ServerValue: types.ServerValue; - Database: typeof types.FirebaseDatabase; - }; - } - interface FirebaseApp { - database?(): types.FirebaseDatabase; - } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/database-compat/src/index.standalone.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/database-compat/src/index.standalone.d.ts deleted file mode 100644 index 9d01344a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/database-compat/src/index.standalone.d.ts +++ /dev/null @@ -1,52 +0,0 @@ -/** - * @license - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { FirebaseApp } from '@firebase/app-types'; -import { enableLogging } from '@firebase/database'; -import { Database } from './api/Database'; -import * as INTERNAL from './api/internal'; -import { DataSnapshot, Query, Reference } from './api/Reference'; -declare const ServerValue: { - TIMESTAMP: object; - increment: (delta: number) => object; -}; -/** - * A one off register function which returns a database based on the app and - * passed database URL. (Used by the Admin SDK) - * - * @param app - A valid FirebaseApp-like object - * @param url - A valid Firebase databaseURL - * @param version - custom version e.g. firebase-admin version - * @param nodeAdmin - true if the SDK is being initialized from Firebase Admin. - */ -export declare function initStandalone(app: FirebaseApp, url: string, version: string, nodeAdmin?: boolean): { - instance: import("@firebase/database-types").Database; - namespace: { - Reference: typeof Reference; - Query: typeof Query; - Database: typeof Database; - DataSnapshot: typeof DataSnapshot; - enableLogging: typeof enableLogging; - INTERNAL: typeof INTERNAL; - ServerValue: { - TIMESTAMP: object; - increment: (delta: number) => object; - }; - }; -}; -export { Database, Query, Reference, enableLogging, ServerValue }; -export { OnDisconnect } from '@firebase/database'; -export { DataSnapshot } from './api/Reference'; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/database-compat/src/util/util.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/database-compat/src/util/util.d.ts deleted file mode 100644 index 2d0e3a74..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/database-compat/src/util/util.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * @license - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export declare const warn: (msg: string) => void; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/database-compat/src/util/validation.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/database-compat/src/util/validation.d.ts deleted file mode 100644 index 52a06df3..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/database-compat/src/util/validation.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -/** - * @license - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export declare const validateBoolean: (fnName: string, argumentName: string, bool: unknown, optional: boolean) => void; -export declare const validateEventType: (fnName: string, eventType: string, optional: boolean) => void; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/database-compat/test/browser/crawler_support.test.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/database-compat/test/browser/crawler_support.test.d.ts deleted file mode 100644 index cd6aeb9b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/database-compat/test/browser/crawler_support.test.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export {}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/database-compat/test/database.test.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/database-compat/test/database.test.d.ts deleted file mode 100644 index 4835a03b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/database-compat/test/database.test.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import '../src/index'; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/database-compat/test/datasnapshot.test.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/database-compat/test/datasnapshot.test.d.ts deleted file mode 100644 index cd6aeb9b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/database-compat/test/datasnapshot.test.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export {}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/database-compat/test/helpers/events.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/database-compat/test/helpers/events.d.ts deleted file mode 100644 index 5c7fb307..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/database-compat/test/helpers/events.d.ts +++ /dev/null @@ -1,34 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * A set of functions to clean up event handlers. - */ -export declare let eventCleanupHandlers: any[]; -/** Clean up outstanding event handlers */ -export declare function eventCleanup(): void; -/** - * Creates a struct which waits for many events. - * @param pathAndEvents - an array of tuples of [Firebase, [event type strings]] - */ -export declare function eventTestHelper(pathAndEvents: any, helperName?: any): { - promise: Promise; - initPromise: Promise; - waiter: () => boolean; - watchesInitializedWaiter: () => boolean; - unregister: () => void; - addExpectedEvents(moreEvents: any): void; -}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/database-compat/test/helpers/util.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/database-compat/test/helpers/util.d.ts deleted file mode 100644 index 887635a0..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/database-compat/test/helpers/util.d.ts +++ /dev/null @@ -1,42 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import '../../src/index'; -import { Path } from '../../../database/src/core/util/Path'; -import { Query, Reference } from '../../src/api/Reference'; -export declare const TEST_PROJECT: any; -export declare const DATABASE_ADDRESS: any; -export declare const DATABASE_URL: any; -export declare function createTestApp(): import("@firebase/app-compat").FirebaseApp; -/** - * Gets or creates a root node to the test namespace. All calls sharing the - * value of opt_i will share an app context. - */ -export declare function getRootNode(i?: number, ref?: string): any; -/** - * Create multiple refs to the same top level - * push key - each on it's own Firebase.Context. - */ -export declare function getRandomNode(numNodes?: any): Reference | Reference[]; -export declare function getQueryValue(query: Query): Promise; -export declare function pause(milliseconds: number): Promise; -export declare function getPath(query: Query): string; -export declare function shuffle(arr: any, randFn?: () => number): void; -export declare function getFreshRepo(path: Path): any; -export declare function getFreshRepoFromReference(ref: any): any; -export declare function getSnap(path: any): any; -export declare function getVal(path: any): any; -export declare function canCreateExtraConnections(): boolean; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/database-compat/test/info.test.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/database-compat/test/info.test.d.ts deleted file mode 100644 index cd6aeb9b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/database-compat/test/info.test.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export {}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/database-compat/test/order.test.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/database-compat/test/order.test.d.ts deleted file mode 100644 index cd6aeb9b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/database-compat/test/order.test.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export {}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/database-compat/test/order_by.test.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/database-compat/test/order_by.test.d.ts deleted file mode 100644 index cd6aeb9b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/database-compat/test/order_by.test.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export {}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/database-compat/test/promise.test.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/database-compat/test/promise.test.d.ts deleted file mode 100644 index cd6aeb9b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/database-compat/test/promise.test.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export {}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/database-compat/test/query.test.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/database-compat/test/query.test.d.ts deleted file mode 100644 index cd6aeb9b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/database-compat/test/query.test.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export {}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/database-compat/test/servervalues.test.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/database-compat/test/servervalues.test.d.ts deleted file mode 100644 index 05e43f18..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/database-compat/test/servervalues.test.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * @license - * Copyright 2019 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export {}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/database-compat/test/transaction.test.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/database-compat/test/transaction.test.d.ts deleted file mode 100644 index 4835a03b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/database-compat/test/transaction.test.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import '../src/index'; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/index.esm2017.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/index.esm2017.js deleted file mode 100644 index bbd5c336..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/index.esm2017.js +++ /dev/null @@ -1,872 +0,0 @@ -import firebase from '@firebase/app-compat'; -import { Provider, ComponentContainer, Component } from '@firebase/component'; -import { _validatePathString, onChildMoved, onChildChanged, onChildRemoved, onChildAdded, onValue, off, get, query, limitToFirst, limitToLast, orderByChild, orderByKey, orderByPriority, orderByValue, startAt, startAfter, endAt, endBefore, equalTo, _ReferenceImpl, _QueryImpl, _QueryParams, child, set, _validateWritablePath, update, setWithPriority, remove, runTransaction, setPriority, push, OnDisconnect as OnDisconnect$1, forceWebSockets, forceLongPolling, connectDatabaseEmulator, refFromURL, ref, goOffline, goOnline, serverTimestamp, increment, _setSDKVersion, _repoManagerDatabaseFromApp, enableLogging } from '@firebase/database'; -import { errorPrefix, validateArgCount, validateCallback, validateContextObject, Deferred } from '@firebase/util'; -import { Logger } from '@firebase/logger'; - -const name = "@firebase/database-compat"; -const version = "0.2.10"; - -/** - * @license - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -const logClient = new Logger('@firebase/database-compat'); -const warn = function (msg) { - const message = 'FIREBASE WARNING: ' + msg; - logClient.warn(message); -}; - -/** - * @license - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -const validateBoolean = function (fnName, argumentName, bool, optional) { - if (optional && bool === undefined) { - return; - } - if (typeof bool !== 'boolean') { - throw new Error(errorPrefix(fnName, argumentName) + 'must be a boolean.'); - } -}; -const validateEventType = function (fnName, eventType, optional) { - if (optional && eventType === undefined) { - return; - } - switch (eventType) { - case 'value': - case 'child_added': - case 'child_removed': - case 'child_changed': - case 'child_moved': - break; - default: - throw new Error(errorPrefix(fnName, 'eventType') + - 'must be a valid event type = "value", "child_added", "child_removed", ' + - '"child_changed", or "child_moved".'); - } -}; - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -class OnDisconnect { - constructor(_delegate) { - this._delegate = _delegate; - } - cancel(onComplete) { - validateArgCount('OnDisconnect.cancel', 0, 1, arguments.length); - validateCallback('OnDisconnect.cancel', 'onComplete', onComplete, true); - const result = this._delegate.cancel(); - if (onComplete) { - result.then(() => onComplete(null), error => onComplete(error)); - } - return result; - } - remove(onComplete) { - validateArgCount('OnDisconnect.remove', 0, 1, arguments.length); - validateCallback('OnDisconnect.remove', 'onComplete', onComplete, true); - const result = this._delegate.remove(); - if (onComplete) { - result.then(() => onComplete(null), error => onComplete(error)); - } - return result; - } - set(value, onComplete) { - validateArgCount('OnDisconnect.set', 1, 2, arguments.length); - validateCallback('OnDisconnect.set', 'onComplete', onComplete, true); - const result = this._delegate.set(value); - if (onComplete) { - result.then(() => onComplete(null), error => onComplete(error)); - } - return result; - } - setWithPriority(value, priority, onComplete) { - validateArgCount('OnDisconnect.setWithPriority', 2, 3, arguments.length); - validateCallback('OnDisconnect.setWithPriority', 'onComplete', onComplete, true); - const result = this._delegate.setWithPriority(value, priority); - if (onComplete) { - result.then(() => onComplete(null), error => onComplete(error)); - } - return result; - } - update(objectToMerge, onComplete) { - validateArgCount('OnDisconnect.update', 1, 2, arguments.length); - if (Array.isArray(objectToMerge)) { - const newObjectToMerge = {}; - for (let i = 0; i < objectToMerge.length; ++i) { - newObjectToMerge['' + i] = objectToMerge[i]; - } - objectToMerge = newObjectToMerge; - warn('Passing an Array to firebase.database.onDisconnect().update() is deprecated. Use set() if you want to overwrite the ' + - 'existing data, or an Object with integer keys if you really do want to only update some of the children.'); - } - validateCallback('OnDisconnect.update', 'onComplete', onComplete, true); - const result = this._delegate.update(objectToMerge); - if (onComplete) { - result.then(() => onComplete(null), error => onComplete(error)); - } - return result; - } -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -class TransactionResult { - /** - * A type for the resolve value of Firebase.transaction. - */ - constructor(committed, snapshot) { - this.committed = committed; - this.snapshot = snapshot; - } - // Do not create public documentation. This is intended to make JSON serialization work but is otherwise unnecessary - // for end-users - toJSON() { - validateArgCount('TransactionResult.toJSON', 0, 1, arguments.length); - return { committed: this.committed, snapshot: this.snapshot.toJSON() }; - } -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Class representing a firebase data snapshot. It wraps a SnapshotNode and - * surfaces the public methods (val, forEach, etc.) we want to expose. - */ -class DataSnapshot { - constructor(_database, _delegate) { - this._database = _database; - this._delegate = _delegate; - } - /** - * Retrieves the snapshot contents as JSON. Returns null if the snapshot is - * empty. - * - * @returns JSON representation of the DataSnapshot contents, or null if empty. - */ - val() { - validateArgCount('DataSnapshot.val', 0, 0, arguments.length); - return this._delegate.val(); - } - /** - * Returns the snapshot contents as JSON, including priorities of node. Suitable for exporting - * the entire node contents. - * @returns JSON representation of the DataSnapshot contents, or null if empty. - */ - exportVal() { - validateArgCount('DataSnapshot.exportVal', 0, 0, arguments.length); - return this._delegate.exportVal(); - } - // Do not create public documentation. This is intended to make JSON serialization work but is otherwise unnecessary - // for end-users - toJSON() { - // Optional spacer argument is unnecessary because we're depending on recursion rather than stringifying the content - validateArgCount('DataSnapshot.toJSON', 0, 1, arguments.length); - return this._delegate.toJSON(); - } - /** - * Returns whether the snapshot contains a non-null value. - * - * @returns Whether the snapshot contains a non-null value, or is empty. - */ - exists() { - validateArgCount('DataSnapshot.exists', 0, 0, arguments.length); - return this._delegate.exists(); - } - /** - * Returns a DataSnapshot of the specified child node's contents. - * - * @param path - Path to a child. - * @returns DataSnapshot for child node. - */ - child(path) { - validateArgCount('DataSnapshot.child', 0, 1, arguments.length); - // Ensure the childPath is a string (can be a number) - path = String(path); - _validatePathString('DataSnapshot.child', 'path', path, false); - return new DataSnapshot(this._database, this._delegate.child(path)); - } - /** - * Returns whether the snapshot contains a child at the specified path. - * - * @param path - Path to a child. - * @returns Whether the child exists. - */ - hasChild(path) { - validateArgCount('DataSnapshot.hasChild', 1, 1, arguments.length); - _validatePathString('DataSnapshot.hasChild', 'path', path, false); - return this._delegate.hasChild(path); - } - /** - * Returns the priority of the object, or null if no priority was set. - * - * @returns The priority. - */ - getPriority() { - validateArgCount('DataSnapshot.getPriority', 0, 0, arguments.length); - return this._delegate.priority; - } - /** - * Iterates through child nodes and calls the specified action for each one. - * - * @param action - Callback function to be called - * for each child. - * @returns True if forEach was canceled by action returning true for - * one of the child nodes. - */ - forEach(action) { - validateArgCount('DataSnapshot.forEach', 1, 1, arguments.length); - validateCallback('DataSnapshot.forEach', 'action', action, false); - return this._delegate.forEach(expDataSnapshot => action(new DataSnapshot(this._database, expDataSnapshot))); - } - /** - * Returns whether this DataSnapshot has children. - * @returns True if the DataSnapshot contains 1 or more child nodes. - */ - hasChildren() { - validateArgCount('DataSnapshot.hasChildren', 0, 0, arguments.length); - return this._delegate.hasChildren(); - } - get key() { - return this._delegate.key; - } - /** - * Returns the number of children for this DataSnapshot. - * @returns The number of children that this DataSnapshot contains. - */ - numChildren() { - validateArgCount('DataSnapshot.numChildren', 0, 0, arguments.length); - return this._delegate.size; - } - /** - * @returns The Firebase reference for the location this snapshot's data came - * from. - */ - getRef() { - validateArgCount('DataSnapshot.ref', 0, 0, arguments.length); - return new Reference(this._database, this._delegate.ref); - } - get ref() { - return this.getRef(); - } -} -/** - * A Query represents a filter to be applied to a firebase location. This object purely represents the - * query expression (and exposes our public API to build the query). The actual query logic is in ViewBase.js. - * - * Since every Firebase reference is a query, Firebase inherits from this object. - */ -class Query { - constructor(database, _delegate) { - this.database = database; - this._delegate = _delegate; - } - on(eventType, callback, cancelCallbackOrContext, context) { - var _a; - validateArgCount('Query.on', 2, 4, arguments.length); - validateCallback('Query.on', 'callback', callback, false); - const ret = Query.getCancelAndContextArgs_('Query.on', cancelCallbackOrContext, context); - const valueCallback = (expSnapshot, previousChildName) => { - callback.call(ret.context, new DataSnapshot(this.database, expSnapshot), previousChildName); - }; - valueCallback.userCallback = callback; - valueCallback.context = ret.context; - const cancelCallback = (_a = ret.cancel) === null || _a === void 0 ? void 0 : _a.bind(ret.context); - switch (eventType) { - case 'value': - onValue(this._delegate, valueCallback, cancelCallback); - return callback; - case 'child_added': - onChildAdded(this._delegate, valueCallback, cancelCallback); - return callback; - case 'child_removed': - onChildRemoved(this._delegate, valueCallback, cancelCallback); - return callback; - case 'child_changed': - onChildChanged(this._delegate, valueCallback, cancelCallback); - return callback; - case 'child_moved': - onChildMoved(this._delegate, valueCallback, cancelCallback); - return callback; - default: - throw new Error(errorPrefix('Query.on', 'eventType') + - 'must be a valid event type = "value", "child_added", "child_removed", ' + - '"child_changed", or "child_moved".'); - } - } - off(eventType, callback, context) { - validateArgCount('Query.off', 0, 3, arguments.length); - validateEventType('Query.off', eventType, true); - validateCallback('Query.off', 'callback', callback, true); - validateContextObject('Query.off', 'context', context, true); - if (callback) { - const valueCallback = () => { }; - valueCallback.userCallback = callback; - valueCallback.context = context; - off(this._delegate, eventType, valueCallback); - } - else { - off(this._delegate, eventType); - } - } - /** - * Get the server-value for this query, or return a cached value if not connected. - */ - get() { - return get(this._delegate).then(expSnapshot => { - return new DataSnapshot(this.database, expSnapshot); - }); - } - /** - * Attaches a listener, waits for the first event, and then removes the listener - */ - once(eventType, callback, failureCallbackOrContext, context) { - validateArgCount('Query.once', 1, 4, arguments.length); - validateCallback('Query.once', 'callback', callback, true); - const ret = Query.getCancelAndContextArgs_('Query.once', failureCallbackOrContext, context); - const deferred = new Deferred(); - const valueCallback = (expSnapshot, previousChildName) => { - const result = new DataSnapshot(this.database, expSnapshot); - if (callback) { - callback.call(ret.context, result, previousChildName); - } - deferred.resolve(result); - }; - valueCallback.userCallback = callback; - valueCallback.context = ret.context; - const cancelCallback = (error) => { - if (ret.cancel) { - ret.cancel.call(ret.context, error); - } - deferred.reject(error); - }; - switch (eventType) { - case 'value': - onValue(this._delegate, valueCallback, cancelCallback, { - onlyOnce: true - }); - break; - case 'child_added': - onChildAdded(this._delegate, valueCallback, cancelCallback, { - onlyOnce: true - }); - break; - case 'child_removed': - onChildRemoved(this._delegate, valueCallback, cancelCallback, { - onlyOnce: true - }); - break; - case 'child_changed': - onChildChanged(this._delegate, valueCallback, cancelCallback, { - onlyOnce: true - }); - break; - case 'child_moved': - onChildMoved(this._delegate, valueCallback, cancelCallback, { - onlyOnce: true - }); - break; - default: - throw new Error(errorPrefix('Query.once', 'eventType') + - 'must be a valid event type = "value", "child_added", "child_removed", ' + - '"child_changed", or "child_moved".'); - } - return deferred.promise; - } - /** - * Set a limit and anchor it to the start of the window. - */ - limitToFirst(limit) { - validateArgCount('Query.limitToFirst', 1, 1, arguments.length); - return new Query(this.database, query(this._delegate, limitToFirst(limit))); - } - /** - * Set a limit and anchor it to the end of the window. - */ - limitToLast(limit) { - validateArgCount('Query.limitToLast', 1, 1, arguments.length); - return new Query(this.database, query(this._delegate, limitToLast(limit))); - } - /** - * Given a child path, return a new query ordered by the specified grandchild path. - */ - orderByChild(path) { - validateArgCount('Query.orderByChild', 1, 1, arguments.length); - return new Query(this.database, query(this._delegate, orderByChild(path))); - } - /** - * Return a new query ordered by the KeyIndex - */ - orderByKey() { - validateArgCount('Query.orderByKey', 0, 0, arguments.length); - return new Query(this.database, query(this._delegate, orderByKey())); - } - /** - * Return a new query ordered by the PriorityIndex - */ - orderByPriority() { - validateArgCount('Query.orderByPriority', 0, 0, arguments.length); - return new Query(this.database, query(this._delegate, orderByPriority())); - } - /** - * Return a new query ordered by the ValueIndex - */ - orderByValue() { - validateArgCount('Query.orderByValue', 0, 0, arguments.length); - return new Query(this.database, query(this._delegate, orderByValue())); - } - startAt(value = null, name) { - validateArgCount('Query.startAt', 0, 2, arguments.length); - return new Query(this.database, query(this._delegate, startAt(value, name))); - } - startAfter(value = null, name) { - validateArgCount('Query.startAfter', 0, 2, arguments.length); - return new Query(this.database, query(this._delegate, startAfter(value, name))); - } - endAt(value = null, name) { - validateArgCount('Query.endAt', 0, 2, arguments.length); - return new Query(this.database, query(this._delegate, endAt(value, name))); - } - endBefore(value = null, name) { - validateArgCount('Query.endBefore', 0, 2, arguments.length); - return new Query(this.database, query(this._delegate, endBefore(value, name))); - } - /** - * Load the selection of children with exactly the specified value, and, optionally, - * the specified name. - */ - equalTo(value, name) { - validateArgCount('Query.equalTo', 1, 2, arguments.length); - return new Query(this.database, query(this._delegate, equalTo(value, name))); - } - /** - * @returns URL for this location. - */ - toString() { - validateArgCount('Query.toString', 0, 0, arguments.length); - return this._delegate.toString(); - } - // Do not create public documentation. This is intended to make JSON serialization work but is otherwise unnecessary - // for end-users. - toJSON() { - // An optional spacer argument is unnecessary for a string. - validateArgCount('Query.toJSON', 0, 1, arguments.length); - return this._delegate.toJSON(); - } - /** - * Return true if this query and the provided query are equivalent; otherwise, return false. - */ - isEqual(other) { - validateArgCount('Query.isEqual', 1, 1, arguments.length); - if (!(other instanceof Query)) { - const error = 'Query.isEqual failed: First argument must be an instance of firebase.database.Query.'; - throw new Error(error); - } - return this._delegate.isEqual(other._delegate); - } - /** - * Helper used by .on and .once to extract the context and or cancel arguments. - * @param fnName - The function name (on or once) - * - */ - static getCancelAndContextArgs_(fnName, cancelOrContext, context) { - const ret = { cancel: undefined, context: undefined }; - if (cancelOrContext && context) { - ret.cancel = cancelOrContext; - validateCallback(fnName, 'cancel', ret.cancel, true); - ret.context = context; - validateContextObject(fnName, 'context', ret.context, true); - } - else if (cancelOrContext) { - // we have either a cancel callback or a context. - if (typeof cancelOrContext === 'object' && cancelOrContext !== null) { - // it's a context! - ret.context = cancelOrContext; - } - else if (typeof cancelOrContext === 'function') { - ret.cancel = cancelOrContext; - } - else { - throw new Error(errorPrefix(fnName, 'cancelOrContext') + - ' must either be a cancel callback or a context object.'); - } - } - return ret; - } - get ref() { - return new Reference(this.database, new _ReferenceImpl(this._delegate._repo, this._delegate._path)); - } -} -class Reference extends Query { - /** - * Call options: - * new Reference(Repo, Path) or - * new Reference(url: string, string|RepoManager) - * - * Externally - this is the firebase.database.Reference type. - */ - constructor(database, _delegate) { - super(database, new _QueryImpl(_delegate._repo, _delegate._path, new _QueryParams(), false)); - this.database = database; - this._delegate = _delegate; - } - /** @returns {?string} */ - getKey() { - validateArgCount('Reference.key', 0, 0, arguments.length); - return this._delegate.key; - } - child(pathString) { - validateArgCount('Reference.child', 1, 1, arguments.length); - if (typeof pathString === 'number') { - pathString = String(pathString); - } - return new Reference(this.database, child(this._delegate, pathString)); - } - /** @returns {?Reference} */ - getParent() { - validateArgCount('Reference.parent', 0, 0, arguments.length); - const parent = this._delegate.parent; - return parent ? new Reference(this.database, parent) : null; - } - /** @returns {!Reference} */ - getRoot() { - validateArgCount('Reference.root', 0, 0, arguments.length); - return new Reference(this.database, this._delegate.root); - } - set(newVal, onComplete) { - validateArgCount('Reference.set', 1, 2, arguments.length); - validateCallback('Reference.set', 'onComplete', onComplete, true); - const result = set(this._delegate, newVal); - if (onComplete) { - result.then(() => onComplete(null), error => onComplete(error)); - } - return result; - } - update(values, onComplete) { - validateArgCount('Reference.update', 1, 2, arguments.length); - if (Array.isArray(values)) { - const newObjectToMerge = {}; - for (let i = 0; i < values.length; ++i) { - newObjectToMerge['' + i] = values[i]; - } - values = newObjectToMerge; - warn('Passing an Array to Firebase.update() is deprecated. ' + - 'Use set() if you want to overwrite the existing data, or ' + - 'an Object with integer keys if you really do want to ' + - 'only update some of the children.'); - } - _validateWritablePath('Reference.update', this._delegate._path); - validateCallback('Reference.update', 'onComplete', onComplete, true); - const result = update(this._delegate, values); - if (onComplete) { - result.then(() => onComplete(null), error => onComplete(error)); - } - return result; - } - setWithPriority(newVal, newPriority, onComplete) { - validateArgCount('Reference.setWithPriority', 2, 3, arguments.length); - validateCallback('Reference.setWithPriority', 'onComplete', onComplete, true); - const result = setWithPriority(this._delegate, newVal, newPriority); - if (onComplete) { - result.then(() => onComplete(null), error => onComplete(error)); - } - return result; - } - remove(onComplete) { - validateArgCount('Reference.remove', 0, 1, arguments.length); - validateCallback('Reference.remove', 'onComplete', onComplete, true); - const result = remove(this._delegate); - if (onComplete) { - result.then(() => onComplete(null), error => onComplete(error)); - } - return result; - } - transaction(transactionUpdate, onComplete, applyLocally) { - validateArgCount('Reference.transaction', 1, 3, arguments.length); - validateCallback('Reference.transaction', 'transactionUpdate', transactionUpdate, false); - validateCallback('Reference.transaction', 'onComplete', onComplete, true); - validateBoolean('Reference.transaction', 'applyLocally', applyLocally, true); - const result = runTransaction(this._delegate, transactionUpdate, { - applyLocally - }).then(transactionResult => new TransactionResult(transactionResult.committed, new DataSnapshot(this.database, transactionResult.snapshot))); - if (onComplete) { - result.then(transactionResult => onComplete(null, transactionResult.committed, transactionResult.snapshot), error => onComplete(error, false, null)); - } - return result; - } - setPriority(priority, onComplete) { - validateArgCount('Reference.setPriority', 1, 2, arguments.length); - validateCallback('Reference.setPriority', 'onComplete', onComplete, true); - const result = setPriority(this._delegate, priority); - if (onComplete) { - result.then(() => onComplete(null), error => onComplete(error)); - } - return result; - } - push(value, onComplete) { - validateArgCount('Reference.push', 0, 2, arguments.length); - validateCallback('Reference.push', 'onComplete', onComplete, true); - const expPromise = push(this._delegate, value); - const promise = expPromise.then(expRef => new Reference(this.database, expRef)); - if (onComplete) { - promise.then(() => onComplete(null), error => onComplete(error)); - } - const result = new Reference(this.database, expPromise); - result.then = promise.then.bind(promise); - result.catch = promise.catch.bind(promise, undefined); - return result; - } - onDisconnect() { - _validateWritablePath('Reference.onDisconnect', this._delegate._path); - return new OnDisconnect(new OnDisconnect$1(this._delegate._repo, this._delegate._path)); - } - get key() { - return this.getKey(); - } - get parent() { - return this.getParent(); - } - get root() { - return this.getRoot(); - } -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Class representing a firebase database. - */ -class Database { - /** - * The constructor should not be called by users of our public API. - */ - constructor(_delegate, app) { - this._delegate = _delegate; - this.app = app; - this.INTERNAL = { - delete: () => this._delegate._delete(), - forceWebSockets, - forceLongPolling - }; - } - /** - * Modify this instance to communicate with the Realtime Database emulator. - * - *

Note: This method must be called before performing any other operation. - * - * @param host - the emulator host (ex: localhost) - * @param port - the emulator port (ex: 8080) - * @param options.mockUserToken - the mock auth token to use for unit testing Security Rules - */ - useEmulator(host, port, options = {}) { - connectDatabaseEmulator(this._delegate, host, port, options); - } - ref(path) { - validateArgCount('database.ref', 0, 1, arguments.length); - if (path instanceof Reference) { - const childRef = refFromURL(this._delegate, path.toString()); - return new Reference(this, childRef); - } - else { - const childRef = ref(this._delegate, path); - return new Reference(this, childRef); - } - } - /** - * Returns a reference to the root or the path specified in url. - * We throw a exception if the url is not in the same domain as the - * current repo. - * @returns Firebase reference. - */ - refFromURL(url) { - const apiName = 'database.refFromURL'; - validateArgCount(apiName, 1, 1, arguments.length); - const childRef = refFromURL(this._delegate, url); - return new Reference(this, childRef); - } - // Make individual repo go offline. - goOffline() { - validateArgCount('database.goOffline', 0, 0, arguments.length); - return goOffline(this._delegate); - } - goOnline() { - validateArgCount('database.goOnline', 0, 0, arguments.length); - return goOnline(this._delegate); - } -} -Database.ServerValue = { - TIMESTAMP: serverTimestamp(), - increment: (delta) => increment(delta) -}; - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Used by console to create a database based on the app, - * passed database URL and a custom auth implementation. - * - * @param app - A valid FirebaseApp-like object - * @param url - A valid Firebase databaseURL - * @param version - custom version e.g. firebase-admin version - * @param customAuthImpl - custom auth implementation - */ -function initStandalone({ app, url, version, customAuthImpl, namespace, nodeAdmin = false }) { - _setSDKVersion(version); - /** - * ComponentContainer('database-standalone') is just a placeholder that doesn't perform - * any actual function. - */ - const authProvider = new Provider('auth-internal', new ComponentContainer('database-standalone')); - authProvider.setComponent(new Component('auth-internal', () => customAuthImpl, "PRIVATE" /* ComponentType.PRIVATE */)); - return { - instance: new Database(_repoManagerDatabaseFromApp(app, authProvider, - /* appCheckProvider= */ undefined, url, nodeAdmin), app), - namespace - }; -} - -var INTERNAL = /*#__PURE__*/Object.freeze({ - __proto__: null, - initStandalone: initStandalone -}); - -/** - * @license - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -const ServerValue = Database.ServerValue; -function registerDatabase(instance) { - // Register the Database Service with the 'firebase' namespace. - instance.INTERNAL.registerComponent(new Component('database-compat', (container, { instanceIdentifier: url }) => { - /* Dependencies */ - // getImmediate for FirebaseApp will always succeed - const app = container.getProvider('app-compat').getImmediate(); - const databaseExp = container - .getProvider('database') - .getImmediate({ identifier: url }); - return new Database(databaseExp, app); - }, "PUBLIC" /* ComponentType.PUBLIC */) - .setServiceProps( - // firebase.database namespace properties - { - Reference, - Query, - Database, - DataSnapshot, - enableLogging, - INTERNAL, - ServerValue - }) - .setMultipleInstances(true)); - instance.registerVersion(name, version); -} -registerDatabase(firebase); - -export { registerDatabase }; -//# sourceMappingURL=index.esm2017.js.map diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/index.esm5.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/index.esm5.js deleted file mode 100644 index fa15229a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/index.esm5.js +++ /dev/null @@ -1,925 +0,0 @@ -import firebase from '@firebase/app-compat'; -import { Provider, ComponentContainer, Component } from '@firebase/component'; -import { _validatePathString, onChildMoved, onChildChanged, onChildRemoved, onChildAdded, onValue, off, get, query, limitToFirst, limitToLast, orderByChild, orderByKey, orderByPriority, orderByValue, startAt, startAfter, endAt, endBefore, equalTo, _ReferenceImpl, _QueryImpl, _QueryParams, child, set, _validateWritablePath, update, setWithPriority, remove, runTransaction, setPriority, push, OnDisconnect as OnDisconnect$1, connectDatabaseEmulator, refFromURL, ref, goOffline, goOnline, serverTimestamp, increment, forceWebSockets, forceLongPolling, _setSDKVersion, _repoManagerDatabaseFromApp, enableLogging } from '@firebase/database'; -import { errorPrefix, validateArgCount, validateCallback, validateContextObject, Deferred } from '@firebase/util'; -import { __extends } from 'tslib'; -import { Logger } from '@firebase/logger'; - -var name = "@firebase/database-compat"; -var version = "0.2.10"; - -/** - * @license - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var logClient = new Logger('@firebase/database-compat'); -var warn = function (msg) { - var message = 'FIREBASE WARNING: ' + msg; - logClient.warn(message); -}; - -/** - * @license - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var validateBoolean = function (fnName, argumentName, bool, optional) { - if (optional && bool === undefined) { - return; - } - if (typeof bool !== 'boolean') { - throw new Error(errorPrefix(fnName, argumentName) + 'must be a boolean.'); - } -}; -var validateEventType = function (fnName, eventType, optional) { - if (optional && eventType === undefined) { - return; - } - switch (eventType) { - case 'value': - case 'child_added': - case 'child_removed': - case 'child_changed': - case 'child_moved': - break; - default: - throw new Error(errorPrefix(fnName, 'eventType') + - 'must be a valid event type = "value", "child_added", "child_removed", ' + - '"child_changed", or "child_moved".'); - } -}; - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var OnDisconnect = /** @class */ (function () { - function OnDisconnect(_delegate) { - this._delegate = _delegate; - } - OnDisconnect.prototype.cancel = function (onComplete) { - validateArgCount('OnDisconnect.cancel', 0, 1, arguments.length); - validateCallback('OnDisconnect.cancel', 'onComplete', onComplete, true); - var result = this._delegate.cancel(); - if (onComplete) { - result.then(function () { return onComplete(null); }, function (error) { return onComplete(error); }); - } - return result; - }; - OnDisconnect.prototype.remove = function (onComplete) { - validateArgCount('OnDisconnect.remove', 0, 1, arguments.length); - validateCallback('OnDisconnect.remove', 'onComplete', onComplete, true); - var result = this._delegate.remove(); - if (onComplete) { - result.then(function () { return onComplete(null); }, function (error) { return onComplete(error); }); - } - return result; - }; - OnDisconnect.prototype.set = function (value, onComplete) { - validateArgCount('OnDisconnect.set', 1, 2, arguments.length); - validateCallback('OnDisconnect.set', 'onComplete', onComplete, true); - var result = this._delegate.set(value); - if (onComplete) { - result.then(function () { return onComplete(null); }, function (error) { return onComplete(error); }); - } - return result; - }; - OnDisconnect.prototype.setWithPriority = function (value, priority, onComplete) { - validateArgCount('OnDisconnect.setWithPriority', 2, 3, arguments.length); - validateCallback('OnDisconnect.setWithPriority', 'onComplete', onComplete, true); - var result = this._delegate.setWithPriority(value, priority); - if (onComplete) { - result.then(function () { return onComplete(null); }, function (error) { return onComplete(error); }); - } - return result; - }; - OnDisconnect.prototype.update = function (objectToMerge, onComplete) { - validateArgCount('OnDisconnect.update', 1, 2, arguments.length); - if (Array.isArray(objectToMerge)) { - var newObjectToMerge = {}; - for (var i = 0; i < objectToMerge.length; ++i) { - newObjectToMerge['' + i] = objectToMerge[i]; - } - objectToMerge = newObjectToMerge; - warn('Passing an Array to firebase.database.onDisconnect().update() is deprecated. Use set() if you want to overwrite the ' + - 'existing data, or an Object with integer keys if you really do want to only update some of the children.'); - } - validateCallback('OnDisconnect.update', 'onComplete', onComplete, true); - var result = this._delegate.update(objectToMerge); - if (onComplete) { - result.then(function () { return onComplete(null); }, function (error) { return onComplete(error); }); - } - return result; - }; - return OnDisconnect; -}()); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var TransactionResult = /** @class */ (function () { - /** - * A type for the resolve value of Firebase.transaction. - */ - function TransactionResult(committed, snapshot) { - this.committed = committed; - this.snapshot = snapshot; - } - // Do not create public documentation. This is intended to make JSON serialization work but is otherwise unnecessary - // for end-users - TransactionResult.prototype.toJSON = function () { - validateArgCount('TransactionResult.toJSON', 0, 1, arguments.length); - return { committed: this.committed, snapshot: this.snapshot.toJSON() }; - }; - return TransactionResult; -}()); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Class representing a firebase data snapshot. It wraps a SnapshotNode and - * surfaces the public methods (val, forEach, etc.) we want to expose. - */ -var DataSnapshot = /** @class */ (function () { - function DataSnapshot(_database, _delegate) { - this._database = _database; - this._delegate = _delegate; - } - /** - * Retrieves the snapshot contents as JSON. Returns null if the snapshot is - * empty. - * - * @returns JSON representation of the DataSnapshot contents, or null if empty. - */ - DataSnapshot.prototype.val = function () { - validateArgCount('DataSnapshot.val', 0, 0, arguments.length); - return this._delegate.val(); - }; - /** - * Returns the snapshot contents as JSON, including priorities of node. Suitable for exporting - * the entire node contents. - * @returns JSON representation of the DataSnapshot contents, or null if empty. - */ - DataSnapshot.prototype.exportVal = function () { - validateArgCount('DataSnapshot.exportVal', 0, 0, arguments.length); - return this._delegate.exportVal(); - }; - // Do not create public documentation. This is intended to make JSON serialization work but is otherwise unnecessary - // for end-users - DataSnapshot.prototype.toJSON = function () { - // Optional spacer argument is unnecessary because we're depending on recursion rather than stringifying the content - validateArgCount('DataSnapshot.toJSON', 0, 1, arguments.length); - return this._delegate.toJSON(); - }; - /** - * Returns whether the snapshot contains a non-null value. - * - * @returns Whether the snapshot contains a non-null value, or is empty. - */ - DataSnapshot.prototype.exists = function () { - validateArgCount('DataSnapshot.exists', 0, 0, arguments.length); - return this._delegate.exists(); - }; - /** - * Returns a DataSnapshot of the specified child node's contents. - * - * @param path - Path to a child. - * @returns DataSnapshot for child node. - */ - DataSnapshot.prototype.child = function (path) { - validateArgCount('DataSnapshot.child', 0, 1, arguments.length); - // Ensure the childPath is a string (can be a number) - path = String(path); - _validatePathString('DataSnapshot.child', 'path', path, false); - return new DataSnapshot(this._database, this._delegate.child(path)); - }; - /** - * Returns whether the snapshot contains a child at the specified path. - * - * @param path - Path to a child. - * @returns Whether the child exists. - */ - DataSnapshot.prototype.hasChild = function (path) { - validateArgCount('DataSnapshot.hasChild', 1, 1, arguments.length); - _validatePathString('DataSnapshot.hasChild', 'path', path, false); - return this._delegate.hasChild(path); - }; - /** - * Returns the priority of the object, or null if no priority was set. - * - * @returns The priority. - */ - DataSnapshot.prototype.getPriority = function () { - validateArgCount('DataSnapshot.getPriority', 0, 0, arguments.length); - return this._delegate.priority; - }; - /** - * Iterates through child nodes and calls the specified action for each one. - * - * @param action - Callback function to be called - * for each child. - * @returns True if forEach was canceled by action returning true for - * one of the child nodes. - */ - DataSnapshot.prototype.forEach = function (action) { - var _this = this; - validateArgCount('DataSnapshot.forEach', 1, 1, arguments.length); - validateCallback('DataSnapshot.forEach', 'action', action, false); - return this._delegate.forEach(function (expDataSnapshot) { - return action(new DataSnapshot(_this._database, expDataSnapshot)); - }); - }; - /** - * Returns whether this DataSnapshot has children. - * @returns True if the DataSnapshot contains 1 or more child nodes. - */ - DataSnapshot.prototype.hasChildren = function () { - validateArgCount('DataSnapshot.hasChildren', 0, 0, arguments.length); - return this._delegate.hasChildren(); - }; - Object.defineProperty(DataSnapshot.prototype, "key", { - get: function () { - return this._delegate.key; - }, - enumerable: false, - configurable: true - }); - /** - * Returns the number of children for this DataSnapshot. - * @returns The number of children that this DataSnapshot contains. - */ - DataSnapshot.prototype.numChildren = function () { - validateArgCount('DataSnapshot.numChildren', 0, 0, arguments.length); - return this._delegate.size; - }; - /** - * @returns The Firebase reference for the location this snapshot's data came - * from. - */ - DataSnapshot.prototype.getRef = function () { - validateArgCount('DataSnapshot.ref', 0, 0, arguments.length); - return new Reference(this._database, this._delegate.ref); - }; - Object.defineProperty(DataSnapshot.prototype, "ref", { - get: function () { - return this.getRef(); - }, - enumerable: false, - configurable: true - }); - return DataSnapshot; -}()); -/** - * A Query represents a filter to be applied to a firebase location. This object purely represents the - * query expression (and exposes our public API to build the query). The actual query logic is in ViewBase.js. - * - * Since every Firebase reference is a query, Firebase inherits from this object. - */ -var Query = /** @class */ (function () { - function Query(database, _delegate) { - this.database = database; - this._delegate = _delegate; - } - Query.prototype.on = function (eventType, callback, cancelCallbackOrContext, context) { - var _this = this; - var _a; - validateArgCount('Query.on', 2, 4, arguments.length); - validateCallback('Query.on', 'callback', callback, false); - var ret = Query.getCancelAndContextArgs_('Query.on', cancelCallbackOrContext, context); - var valueCallback = function (expSnapshot, previousChildName) { - callback.call(ret.context, new DataSnapshot(_this.database, expSnapshot), previousChildName); - }; - valueCallback.userCallback = callback; - valueCallback.context = ret.context; - var cancelCallback = (_a = ret.cancel) === null || _a === void 0 ? void 0 : _a.bind(ret.context); - switch (eventType) { - case 'value': - onValue(this._delegate, valueCallback, cancelCallback); - return callback; - case 'child_added': - onChildAdded(this._delegate, valueCallback, cancelCallback); - return callback; - case 'child_removed': - onChildRemoved(this._delegate, valueCallback, cancelCallback); - return callback; - case 'child_changed': - onChildChanged(this._delegate, valueCallback, cancelCallback); - return callback; - case 'child_moved': - onChildMoved(this._delegate, valueCallback, cancelCallback); - return callback; - default: - throw new Error(errorPrefix('Query.on', 'eventType') + - 'must be a valid event type = "value", "child_added", "child_removed", ' + - '"child_changed", or "child_moved".'); - } - }; - Query.prototype.off = function (eventType, callback, context) { - validateArgCount('Query.off', 0, 3, arguments.length); - validateEventType('Query.off', eventType, true); - validateCallback('Query.off', 'callback', callback, true); - validateContextObject('Query.off', 'context', context, true); - if (callback) { - var valueCallback = function () { }; - valueCallback.userCallback = callback; - valueCallback.context = context; - off(this._delegate, eventType, valueCallback); - } - else { - off(this._delegate, eventType); - } - }; - /** - * Get the server-value for this query, or return a cached value if not connected. - */ - Query.prototype.get = function () { - var _this = this; - return get(this._delegate).then(function (expSnapshot) { - return new DataSnapshot(_this.database, expSnapshot); - }); - }; - /** - * Attaches a listener, waits for the first event, and then removes the listener - */ - Query.prototype.once = function (eventType, callback, failureCallbackOrContext, context) { - var _this = this; - validateArgCount('Query.once', 1, 4, arguments.length); - validateCallback('Query.once', 'callback', callback, true); - var ret = Query.getCancelAndContextArgs_('Query.once', failureCallbackOrContext, context); - var deferred = new Deferred(); - var valueCallback = function (expSnapshot, previousChildName) { - var result = new DataSnapshot(_this.database, expSnapshot); - if (callback) { - callback.call(ret.context, result, previousChildName); - } - deferred.resolve(result); - }; - valueCallback.userCallback = callback; - valueCallback.context = ret.context; - var cancelCallback = function (error) { - if (ret.cancel) { - ret.cancel.call(ret.context, error); - } - deferred.reject(error); - }; - switch (eventType) { - case 'value': - onValue(this._delegate, valueCallback, cancelCallback, { - onlyOnce: true - }); - break; - case 'child_added': - onChildAdded(this._delegate, valueCallback, cancelCallback, { - onlyOnce: true - }); - break; - case 'child_removed': - onChildRemoved(this._delegate, valueCallback, cancelCallback, { - onlyOnce: true - }); - break; - case 'child_changed': - onChildChanged(this._delegate, valueCallback, cancelCallback, { - onlyOnce: true - }); - break; - case 'child_moved': - onChildMoved(this._delegate, valueCallback, cancelCallback, { - onlyOnce: true - }); - break; - default: - throw new Error(errorPrefix('Query.once', 'eventType') + - 'must be a valid event type = "value", "child_added", "child_removed", ' + - '"child_changed", or "child_moved".'); - } - return deferred.promise; - }; - /** - * Set a limit and anchor it to the start of the window. - */ - Query.prototype.limitToFirst = function (limit) { - validateArgCount('Query.limitToFirst', 1, 1, arguments.length); - return new Query(this.database, query(this._delegate, limitToFirst(limit))); - }; - /** - * Set a limit and anchor it to the end of the window. - */ - Query.prototype.limitToLast = function (limit) { - validateArgCount('Query.limitToLast', 1, 1, arguments.length); - return new Query(this.database, query(this._delegate, limitToLast(limit))); - }; - /** - * Given a child path, return a new query ordered by the specified grandchild path. - */ - Query.prototype.orderByChild = function (path) { - validateArgCount('Query.orderByChild', 1, 1, arguments.length); - return new Query(this.database, query(this._delegate, orderByChild(path))); - }; - /** - * Return a new query ordered by the KeyIndex - */ - Query.prototype.orderByKey = function () { - validateArgCount('Query.orderByKey', 0, 0, arguments.length); - return new Query(this.database, query(this._delegate, orderByKey())); - }; - /** - * Return a new query ordered by the PriorityIndex - */ - Query.prototype.orderByPriority = function () { - validateArgCount('Query.orderByPriority', 0, 0, arguments.length); - return new Query(this.database, query(this._delegate, orderByPriority())); - }; - /** - * Return a new query ordered by the ValueIndex - */ - Query.prototype.orderByValue = function () { - validateArgCount('Query.orderByValue', 0, 0, arguments.length); - return new Query(this.database, query(this._delegate, orderByValue())); - }; - Query.prototype.startAt = function (value, name) { - if (value === void 0) { value = null; } - validateArgCount('Query.startAt', 0, 2, arguments.length); - return new Query(this.database, query(this._delegate, startAt(value, name))); - }; - Query.prototype.startAfter = function (value, name) { - if (value === void 0) { value = null; } - validateArgCount('Query.startAfter', 0, 2, arguments.length); - return new Query(this.database, query(this._delegate, startAfter(value, name))); - }; - Query.prototype.endAt = function (value, name) { - if (value === void 0) { value = null; } - validateArgCount('Query.endAt', 0, 2, arguments.length); - return new Query(this.database, query(this._delegate, endAt(value, name))); - }; - Query.prototype.endBefore = function (value, name) { - if (value === void 0) { value = null; } - validateArgCount('Query.endBefore', 0, 2, arguments.length); - return new Query(this.database, query(this._delegate, endBefore(value, name))); - }; - /** - * Load the selection of children with exactly the specified value, and, optionally, - * the specified name. - */ - Query.prototype.equalTo = function (value, name) { - validateArgCount('Query.equalTo', 1, 2, arguments.length); - return new Query(this.database, query(this._delegate, equalTo(value, name))); - }; - /** - * @returns URL for this location. - */ - Query.prototype.toString = function () { - validateArgCount('Query.toString', 0, 0, arguments.length); - return this._delegate.toString(); - }; - // Do not create public documentation. This is intended to make JSON serialization work but is otherwise unnecessary - // for end-users. - Query.prototype.toJSON = function () { - // An optional spacer argument is unnecessary for a string. - validateArgCount('Query.toJSON', 0, 1, arguments.length); - return this._delegate.toJSON(); - }; - /** - * Return true if this query and the provided query are equivalent; otherwise, return false. - */ - Query.prototype.isEqual = function (other) { - validateArgCount('Query.isEqual', 1, 1, arguments.length); - if (!(other instanceof Query)) { - var error = 'Query.isEqual failed: First argument must be an instance of firebase.database.Query.'; - throw new Error(error); - } - return this._delegate.isEqual(other._delegate); - }; - /** - * Helper used by .on and .once to extract the context and or cancel arguments. - * @param fnName - The function name (on or once) - * - */ - Query.getCancelAndContextArgs_ = function (fnName, cancelOrContext, context) { - var ret = { cancel: undefined, context: undefined }; - if (cancelOrContext && context) { - ret.cancel = cancelOrContext; - validateCallback(fnName, 'cancel', ret.cancel, true); - ret.context = context; - validateContextObject(fnName, 'context', ret.context, true); - } - else if (cancelOrContext) { - // we have either a cancel callback or a context. - if (typeof cancelOrContext === 'object' && cancelOrContext !== null) { - // it's a context! - ret.context = cancelOrContext; - } - else if (typeof cancelOrContext === 'function') { - ret.cancel = cancelOrContext; - } - else { - throw new Error(errorPrefix(fnName, 'cancelOrContext') + - ' must either be a cancel callback or a context object.'); - } - } - return ret; - }; - Object.defineProperty(Query.prototype, "ref", { - get: function () { - return new Reference(this.database, new _ReferenceImpl(this._delegate._repo, this._delegate._path)); - }, - enumerable: false, - configurable: true - }); - return Query; -}()); -var Reference = /** @class */ (function (_super) { - __extends(Reference, _super); - /** - * Call options: - * new Reference(Repo, Path) or - * new Reference(url: string, string|RepoManager) - * - * Externally - this is the firebase.database.Reference type. - */ - function Reference(database, _delegate) { - var _this = _super.call(this, database, new _QueryImpl(_delegate._repo, _delegate._path, new _QueryParams(), false)) || this; - _this.database = database; - _this._delegate = _delegate; - return _this; - } - /** @returns {?string} */ - Reference.prototype.getKey = function () { - validateArgCount('Reference.key', 0, 0, arguments.length); - return this._delegate.key; - }; - Reference.prototype.child = function (pathString) { - validateArgCount('Reference.child', 1, 1, arguments.length); - if (typeof pathString === 'number') { - pathString = String(pathString); - } - return new Reference(this.database, child(this._delegate, pathString)); - }; - /** @returns {?Reference} */ - Reference.prototype.getParent = function () { - validateArgCount('Reference.parent', 0, 0, arguments.length); - var parent = this._delegate.parent; - return parent ? new Reference(this.database, parent) : null; - }; - /** @returns {!Reference} */ - Reference.prototype.getRoot = function () { - validateArgCount('Reference.root', 0, 0, arguments.length); - return new Reference(this.database, this._delegate.root); - }; - Reference.prototype.set = function (newVal, onComplete) { - validateArgCount('Reference.set', 1, 2, arguments.length); - validateCallback('Reference.set', 'onComplete', onComplete, true); - var result = set(this._delegate, newVal); - if (onComplete) { - result.then(function () { return onComplete(null); }, function (error) { return onComplete(error); }); - } - return result; - }; - Reference.prototype.update = function (values, onComplete) { - validateArgCount('Reference.update', 1, 2, arguments.length); - if (Array.isArray(values)) { - var newObjectToMerge = {}; - for (var i = 0; i < values.length; ++i) { - newObjectToMerge['' + i] = values[i]; - } - values = newObjectToMerge; - warn('Passing an Array to Firebase.update() is deprecated. ' + - 'Use set() if you want to overwrite the existing data, or ' + - 'an Object with integer keys if you really do want to ' + - 'only update some of the children.'); - } - _validateWritablePath('Reference.update', this._delegate._path); - validateCallback('Reference.update', 'onComplete', onComplete, true); - var result = update(this._delegate, values); - if (onComplete) { - result.then(function () { return onComplete(null); }, function (error) { return onComplete(error); }); - } - return result; - }; - Reference.prototype.setWithPriority = function (newVal, newPriority, onComplete) { - validateArgCount('Reference.setWithPriority', 2, 3, arguments.length); - validateCallback('Reference.setWithPriority', 'onComplete', onComplete, true); - var result = setWithPriority(this._delegate, newVal, newPriority); - if (onComplete) { - result.then(function () { return onComplete(null); }, function (error) { return onComplete(error); }); - } - return result; - }; - Reference.prototype.remove = function (onComplete) { - validateArgCount('Reference.remove', 0, 1, arguments.length); - validateCallback('Reference.remove', 'onComplete', onComplete, true); - var result = remove(this._delegate); - if (onComplete) { - result.then(function () { return onComplete(null); }, function (error) { return onComplete(error); }); - } - return result; - }; - Reference.prototype.transaction = function (transactionUpdate, onComplete, applyLocally) { - var _this = this; - validateArgCount('Reference.transaction', 1, 3, arguments.length); - validateCallback('Reference.transaction', 'transactionUpdate', transactionUpdate, false); - validateCallback('Reference.transaction', 'onComplete', onComplete, true); - validateBoolean('Reference.transaction', 'applyLocally', applyLocally, true); - var result = runTransaction(this._delegate, transactionUpdate, { - applyLocally: applyLocally - }).then(function (transactionResult) { - return new TransactionResult(transactionResult.committed, new DataSnapshot(_this.database, transactionResult.snapshot)); - }); - if (onComplete) { - result.then(function (transactionResult) { - return onComplete(null, transactionResult.committed, transactionResult.snapshot); - }, function (error) { return onComplete(error, false, null); }); - } - return result; - }; - Reference.prototype.setPriority = function (priority, onComplete) { - validateArgCount('Reference.setPriority', 1, 2, arguments.length); - validateCallback('Reference.setPriority', 'onComplete', onComplete, true); - var result = setPriority(this._delegate, priority); - if (onComplete) { - result.then(function () { return onComplete(null); }, function (error) { return onComplete(error); }); - } - return result; - }; - Reference.prototype.push = function (value, onComplete) { - var _this = this; - validateArgCount('Reference.push', 0, 2, arguments.length); - validateCallback('Reference.push', 'onComplete', onComplete, true); - var expPromise = push(this._delegate, value); - var promise = expPromise.then(function (expRef) { return new Reference(_this.database, expRef); }); - if (onComplete) { - promise.then(function () { return onComplete(null); }, function (error) { return onComplete(error); }); - } - var result = new Reference(this.database, expPromise); - result.then = promise.then.bind(promise); - result.catch = promise.catch.bind(promise, undefined); - return result; - }; - Reference.prototype.onDisconnect = function () { - _validateWritablePath('Reference.onDisconnect', this._delegate._path); - return new OnDisconnect(new OnDisconnect$1(this._delegate._repo, this._delegate._path)); - }; - Object.defineProperty(Reference.prototype, "key", { - get: function () { - return this.getKey(); - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(Reference.prototype, "parent", { - get: function () { - return this.getParent(); - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(Reference.prototype, "root", { - get: function () { - return this.getRoot(); - }, - enumerable: false, - configurable: true - }); - return Reference; -}(Query)); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Class representing a firebase database. - */ -var Database = /** @class */ (function () { - /** - * The constructor should not be called by users of our public API. - */ - function Database(_delegate, app) { - var _this = this; - this._delegate = _delegate; - this.app = app; - this.INTERNAL = { - delete: function () { return _this._delegate._delete(); }, - forceWebSockets: forceWebSockets, - forceLongPolling: forceLongPolling - }; - } - /** - * Modify this instance to communicate with the Realtime Database emulator. - * - *

Note: This method must be called before performing any other operation. - * - * @param host - the emulator host (ex: localhost) - * @param port - the emulator port (ex: 8080) - * @param options.mockUserToken - the mock auth token to use for unit testing Security Rules - */ - Database.prototype.useEmulator = function (host, port, options) { - if (options === void 0) { options = {}; } - connectDatabaseEmulator(this._delegate, host, port, options); - }; - Database.prototype.ref = function (path) { - validateArgCount('database.ref', 0, 1, arguments.length); - if (path instanceof Reference) { - var childRef = refFromURL(this._delegate, path.toString()); - return new Reference(this, childRef); - } - else { - var childRef = ref(this._delegate, path); - return new Reference(this, childRef); - } - }; - /** - * Returns a reference to the root or the path specified in url. - * We throw a exception if the url is not in the same domain as the - * current repo. - * @returns Firebase reference. - */ - Database.prototype.refFromURL = function (url) { - var apiName = 'database.refFromURL'; - validateArgCount(apiName, 1, 1, arguments.length); - var childRef = refFromURL(this._delegate, url); - return new Reference(this, childRef); - }; - // Make individual repo go offline. - Database.prototype.goOffline = function () { - validateArgCount('database.goOffline', 0, 0, arguments.length); - return goOffline(this._delegate); - }; - Database.prototype.goOnline = function () { - validateArgCount('database.goOnline', 0, 0, arguments.length); - return goOnline(this._delegate); - }; - Database.ServerValue = { - TIMESTAMP: serverTimestamp(), - increment: function (delta) { return increment(delta); } - }; - return Database; -}()); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Used by console to create a database based on the app, - * passed database URL and a custom auth implementation. - * - * @param app - A valid FirebaseApp-like object - * @param url - A valid Firebase databaseURL - * @param version - custom version e.g. firebase-admin version - * @param customAuthImpl - custom auth implementation - */ -function initStandalone(_a) { - var app = _a.app, url = _a.url, version = _a.version, customAuthImpl = _a.customAuthImpl, namespace = _a.namespace, _b = _a.nodeAdmin, nodeAdmin = _b === void 0 ? false : _b; - _setSDKVersion(version); - /** - * ComponentContainer('database-standalone') is just a placeholder that doesn't perform - * any actual function. - */ - var authProvider = new Provider('auth-internal', new ComponentContainer('database-standalone')); - authProvider.setComponent(new Component('auth-internal', function () { return customAuthImpl; }, "PRIVATE" /* ComponentType.PRIVATE */)); - return { - instance: new Database(_repoManagerDatabaseFromApp(app, authProvider, - /* appCheckProvider= */ undefined, url, nodeAdmin), app), - namespace: namespace - }; -} - -var INTERNAL = /*#__PURE__*/Object.freeze({ - __proto__: null, - initStandalone: initStandalone -}); - -/** - * @license - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var ServerValue = Database.ServerValue; -function registerDatabase(instance) { - // Register the Database Service with the 'firebase' namespace. - instance.INTERNAL.registerComponent(new Component('database-compat', function (container, _a) { - var url = _a.instanceIdentifier; - /* Dependencies */ - // getImmediate for FirebaseApp will always succeed - var app = container.getProvider('app-compat').getImmediate(); - var databaseExp = container - .getProvider('database') - .getImmediate({ identifier: url }); - return new Database(databaseExp, app); - }, "PUBLIC" /* ComponentType.PUBLIC */) - .setServiceProps( - // firebase.database namespace properties - { - Reference: Reference, - Query: Query, - Database: Database, - DataSnapshot: DataSnapshot, - enableLogging: enableLogging, - INTERNAL: INTERNAL, - ServerValue: ServerValue - }) - .setMultipleInstances(true)); - instance.registerVersion(name, version); -} -registerDatabase(firebase); - -export { registerDatabase }; -//# sourceMappingURL=index.esm5.js.map diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/index.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/index.js deleted file mode 100644 index 1cf1b159..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/index.js +++ /dev/null @@ -1,929 +0,0 @@ -'use strict'; - -var firebase = require('@firebase/app-compat'); -var component = require('@firebase/component'); -var database = require('@firebase/database'); -var util = require('@firebase/util'); -var tslib = require('tslib'); -var logger = require('@firebase/logger'); - -function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } - -var firebase__default = /*#__PURE__*/_interopDefaultLegacy(firebase); - -var name = "@firebase/database-compat"; -var version = "0.2.10"; - -/** - * @license - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var logClient = new logger.Logger('@firebase/database-compat'); -var warn = function (msg) { - var message = 'FIREBASE WARNING: ' + msg; - logClient.warn(message); -}; - -/** - * @license - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var validateBoolean = function (fnName, argumentName, bool, optional) { - if (optional && bool === undefined) { - return; - } - if (typeof bool !== 'boolean') { - throw new Error(util.errorPrefix(fnName, argumentName) + 'must be a boolean.'); - } -}; -var validateEventType = function (fnName, eventType, optional) { - if (optional && eventType === undefined) { - return; - } - switch (eventType) { - case 'value': - case 'child_added': - case 'child_removed': - case 'child_changed': - case 'child_moved': - break; - default: - throw new Error(util.errorPrefix(fnName, 'eventType') + - 'must be a valid event type = "value", "child_added", "child_removed", ' + - '"child_changed", or "child_moved".'); - } -}; - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var OnDisconnect = /** @class */ (function () { - function OnDisconnect(_delegate) { - this._delegate = _delegate; - } - OnDisconnect.prototype.cancel = function (onComplete) { - util.validateArgCount('OnDisconnect.cancel', 0, 1, arguments.length); - util.validateCallback('OnDisconnect.cancel', 'onComplete', onComplete, true); - var result = this._delegate.cancel(); - if (onComplete) { - result.then(function () { return onComplete(null); }, function (error) { return onComplete(error); }); - } - return result; - }; - OnDisconnect.prototype.remove = function (onComplete) { - util.validateArgCount('OnDisconnect.remove', 0, 1, arguments.length); - util.validateCallback('OnDisconnect.remove', 'onComplete', onComplete, true); - var result = this._delegate.remove(); - if (onComplete) { - result.then(function () { return onComplete(null); }, function (error) { return onComplete(error); }); - } - return result; - }; - OnDisconnect.prototype.set = function (value, onComplete) { - util.validateArgCount('OnDisconnect.set', 1, 2, arguments.length); - util.validateCallback('OnDisconnect.set', 'onComplete', onComplete, true); - var result = this._delegate.set(value); - if (onComplete) { - result.then(function () { return onComplete(null); }, function (error) { return onComplete(error); }); - } - return result; - }; - OnDisconnect.prototype.setWithPriority = function (value, priority, onComplete) { - util.validateArgCount('OnDisconnect.setWithPriority', 2, 3, arguments.length); - util.validateCallback('OnDisconnect.setWithPriority', 'onComplete', onComplete, true); - var result = this._delegate.setWithPriority(value, priority); - if (onComplete) { - result.then(function () { return onComplete(null); }, function (error) { return onComplete(error); }); - } - return result; - }; - OnDisconnect.prototype.update = function (objectToMerge, onComplete) { - util.validateArgCount('OnDisconnect.update', 1, 2, arguments.length); - if (Array.isArray(objectToMerge)) { - var newObjectToMerge = {}; - for (var i = 0; i < objectToMerge.length; ++i) { - newObjectToMerge['' + i] = objectToMerge[i]; - } - objectToMerge = newObjectToMerge; - warn('Passing an Array to firebase.database.onDisconnect().update() is deprecated. Use set() if you want to overwrite the ' + - 'existing data, or an Object with integer keys if you really do want to only update some of the children.'); - } - util.validateCallback('OnDisconnect.update', 'onComplete', onComplete, true); - var result = this._delegate.update(objectToMerge); - if (onComplete) { - result.then(function () { return onComplete(null); }, function (error) { return onComplete(error); }); - } - return result; - }; - return OnDisconnect; -}()); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var TransactionResult = /** @class */ (function () { - /** - * A type for the resolve value of Firebase.transaction. - */ - function TransactionResult(committed, snapshot) { - this.committed = committed; - this.snapshot = snapshot; - } - // Do not create public documentation. This is intended to make JSON serialization work but is otherwise unnecessary - // for end-users - TransactionResult.prototype.toJSON = function () { - util.validateArgCount('TransactionResult.toJSON', 0, 1, arguments.length); - return { committed: this.committed, snapshot: this.snapshot.toJSON() }; - }; - return TransactionResult; -}()); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Class representing a firebase data snapshot. It wraps a SnapshotNode and - * surfaces the public methods (val, forEach, etc.) we want to expose. - */ -var DataSnapshot = /** @class */ (function () { - function DataSnapshot(_database, _delegate) { - this._database = _database; - this._delegate = _delegate; - } - /** - * Retrieves the snapshot contents as JSON. Returns null if the snapshot is - * empty. - * - * @returns JSON representation of the DataSnapshot contents, or null if empty. - */ - DataSnapshot.prototype.val = function () { - util.validateArgCount('DataSnapshot.val', 0, 0, arguments.length); - return this._delegate.val(); - }; - /** - * Returns the snapshot contents as JSON, including priorities of node. Suitable for exporting - * the entire node contents. - * @returns JSON representation of the DataSnapshot contents, or null if empty. - */ - DataSnapshot.prototype.exportVal = function () { - util.validateArgCount('DataSnapshot.exportVal', 0, 0, arguments.length); - return this._delegate.exportVal(); - }; - // Do not create public documentation. This is intended to make JSON serialization work but is otherwise unnecessary - // for end-users - DataSnapshot.prototype.toJSON = function () { - // Optional spacer argument is unnecessary because we're depending on recursion rather than stringifying the content - util.validateArgCount('DataSnapshot.toJSON', 0, 1, arguments.length); - return this._delegate.toJSON(); - }; - /** - * Returns whether the snapshot contains a non-null value. - * - * @returns Whether the snapshot contains a non-null value, or is empty. - */ - DataSnapshot.prototype.exists = function () { - util.validateArgCount('DataSnapshot.exists', 0, 0, arguments.length); - return this._delegate.exists(); - }; - /** - * Returns a DataSnapshot of the specified child node's contents. - * - * @param path - Path to a child. - * @returns DataSnapshot for child node. - */ - DataSnapshot.prototype.child = function (path) { - util.validateArgCount('DataSnapshot.child', 0, 1, arguments.length); - // Ensure the childPath is a string (can be a number) - path = String(path); - database._validatePathString('DataSnapshot.child', 'path', path, false); - return new DataSnapshot(this._database, this._delegate.child(path)); - }; - /** - * Returns whether the snapshot contains a child at the specified path. - * - * @param path - Path to a child. - * @returns Whether the child exists. - */ - DataSnapshot.prototype.hasChild = function (path) { - util.validateArgCount('DataSnapshot.hasChild', 1, 1, arguments.length); - database._validatePathString('DataSnapshot.hasChild', 'path', path, false); - return this._delegate.hasChild(path); - }; - /** - * Returns the priority of the object, or null if no priority was set. - * - * @returns The priority. - */ - DataSnapshot.prototype.getPriority = function () { - util.validateArgCount('DataSnapshot.getPriority', 0, 0, arguments.length); - return this._delegate.priority; - }; - /** - * Iterates through child nodes and calls the specified action for each one. - * - * @param action - Callback function to be called - * for each child. - * @returns True if forEach was canceled by action returning true for - * one of the child nodes. - */ - DataSnapshot.prototype.forEach = function (action) { - var _this = this; - util.validateArgCount('DataSnapshot.forEach', 1, 1, arguments.length); - util.validateCallback('DataSnapshot.forEach', 'action', action, false); - return this._delegate.forEach(function (expDataSnapshot) { - return action(new DataSnapshot(_this._database, expDataSnapshot)); - }); - }; - /** - * Returns whether this DataSnapshot has children. - * @returns True if the DataSnapshot contains 1 or more child nodes. - */ - DataSnapshot.prototype.hasChildren = function () { - util.validateArgCount('DataSnapshot.hasChildren', 0, 0, arguments.length); - return this._delegate.hasChildren(); - }; - Object.defineProperty(DataSnapshot.prototype, "key", { - get: function () { - return this._delegate.key; - }, - enumerable: false, - configurable: true - }); - /** - * Returns the number of children for this DataSnapshot. - * @returns The number of children that this DataSnapshot contains. - */ - DataSnapshot.prototype.numChildren = function () { - util.validateArgCount('DataSnapshot.numChildren', 0, 0, arguments.length); - return this._delegate.size; - }; - /** - * @returns The Firebase reference for the location this snapshot's data came - * from. - */ - DataSnapshot.prototype.getRef = function () { - util.validateArgCount('DataSnapshot.ref', 0, 0, arguments.length); - return new Reference(this._database, this._delegate.ref); - }; - Object.defineProperty(DataSnapshot.prototype, "ref", { - get: function () { - return this.getRef(); - }, - enumerable: false, - configurable: true - }); - return DataSnapshot; -}()); -/** - * A Query represents a filter to be applied to a firebase location. This object purely represents the - * query expression (and exposes our public API to build the query). The actual query logic is in ViewBase.js. - * - * Since every Firebase reference is a query, Firebase inherits from this object. - */ -var Query = /** @class */ (function () { - function Query(database, _delegate) { - this.database = database; - this._delegate = _delegate; - } - Query.prototype.on = function (eventType, callback, cancelCallbackOrContext, context) { - var _this = this; - var _a; - util.validateArgCount('Query.on', 2, 4, arguments.length); - util.validateCallback('Query.on', 'callback', callback, false); - var ret = Query.getCancelAndContextArgs_('Query.on', cancelCallbackOrContext, context); - var valueCallback = function (expSnapshot, previousChildName) { - callback.call(ret.context, new DataSnapshot(_this.database, expSnapshot), previousChildName); - }; - valueCallback.userCallback = callback; - valueCallback.context = ret.context; - var cancelCallback = (_a = ret.cancel) === null || _a === void 0 ? void 0 : _a.bind(ret.context); - switch (eventType) { - case 'value': - database.onValue(this._delegate, valueCallback, cancelCallback); - return callback; - case 'child_added': - database.onChildAdded(this._delegate, valueCallback, cancelCallback); - return callback; - case 'child_removed': - database.onChildRemoved(this._delegate, valueCallback, cancelCallback); - return callback; - case 'child_changed': - database.onChildChanged(this._delegate, valueCallback, cancelCallback); - return callback; - case 'child_moved': - database.onChildMoved(this._delegate, valueCallback, cancelCallback); - return callback; - default: - throw new Error(util.errorPrefix('Query.on', 'eventType') + - 'must be a valid event type = "value", "child_added", "child_removed", ' + - '"child_changed", or "child_moved".'); - } - }; - Query.prototype.off = function (eventType, callback, context) { - util.validateArgCount('Query.off', 0, 3, arguments.length); - validateEventType('Query.off', eventType, true); - util.validateCallback('Query.off', 'callback', callback, true); - util.validateContextObject('Query.off', 'context', context, true); - if (callback) { - var valueCallback = function () { }; - valueCallback.userCallback = callback; - valueCallback.context = context; - database.off(this._delegate, eventType, valueCallback); - } - else { - database.off(this._delegate, eventType); - } - }; - /** - * Get the server-value for this query, or return a cached value if not connected. - */ - Query.prototype.get = function () { - var _this = this; - return database.get(this._delegate).then(function (expSnapshot) { - return new DataSnapshot(_this.database, expSnapshot); - }); - }; - /** - * Attaches a listener, waits for the first event, and then removes the listener - */ - Query.prototype.once = function (eventType, callback, failureCallbackOrContext, context) { - var _this = this; - util.validateArgCount('Query.once', 1, 4, arguments.length); - util.validateCallback('Query.once', 'callback', callback, true); - var ret = Query.getCancelAndContextArgs_('Query.once', failureCallbackOrContext, context); - var deferred = new util.Deferred(); - var valueCallback = function (expSnapshot, previousChildName) { - var result = new DataSnapshot(_this.database, expSnapshot); - if (callback) { - callback.call(ret.context, result, previousChildName); - } - deferred.resolve(result); - }; - valueCallback.userCallback = callback; - valueCallback.context = ret.context; - var cancelCallback = function (error) { - if (ret.cancel) { - ret.cancel.call(ret.context, error); - } - deferred.reject(error); - }; - switch (eventType) { - case 'value': - database.onValue(this._delegate, valueCallback, cancelCallback, { - onlyOnce: true - }); - break; - case 'child_added': - database.onChildAdded(this._delegate, valueCallback, cancelCallback, { - onlyOnce: true - }); - break; - case 'child_removed': - database.onChildRemoved(this._delegate, valueCallback, cancelCallback, { - onlyOnce: true - }); - break; - case 'child_changed': - database.onChildChanged(this._delegate, valueCallback, cancelCallback, { - onlyOnce: true - }); - break; - case 'child_moved': - database.onChildMoved(this._delegate, valueCallback, cancelCallback, { - onlyOnce: true - }); - break; - default: - throw new Error(util.errorPrefix('Query.once', 'eventType') + - 'must be a valid event type = "value", "child_added", "child_removed", ' + - '"child_changed", or "child_moved".'); - } - return deferred.promise; - }; - /** - * Set a limit and anchor it to the start of the window. - */ - Query.prototype.limitToFirst = function (limit) { - util.validateArgCount('Query.limitToFirst', 1, 1, arguments.length); - return new Query(this.database, database.query(this._delegate, database.limitToFirst(limit))); - }; - /** - * Set a limit and anchor it to the end of the window. - */ - Query.prototype.limitToLast = function (limit) { - util.validateArgCount('Query.limitToLast', 1, 1, arguments.length); - return new Query(this.database, database.query(this._delegate, database.limitToLast(limit))); - }; - /** - * Given a child path, return a new query ordered by the specified grandchild path. - */ - Query.prototype.orderByChild = function (path) { - util.validateArgCount('Query.orderByChild', 1, 1, arguments.length); - return new Query(this.database, database.query(this._delegate, database.orderByChild(path))); - }; - /** - * Return a new query ordered by the KeyIndex - */ - Query.prototype.orderByKey = function () { - util.validateArgCount('Query.orderByKey', 0, 0, arguments.length); - return new Query(this.database, database.query(this._delegate, database.orderByKey())); - }; - /** - * Return a new query ordered by the PriorityIndex - */ - Query.prototype.orderByPriority = function () { - util.validateArgCount('Query.orderByPriority', 0, 0, arguments.length); - return new Query(this.database, database.query(this._delegate, database.orderByPriority())); - }; - /** - * Return a new query ordered by the ValueIndex - */ - Query.prototype.orderByValue = function () { - util.validateArgCount('Query.orderByValue', 0, 0, arguments.length); - return new Query(this.database, database.query(this._delegate, database.orderByValue())); - }; - Query.prototype.startAt = function (value, name) { - if (value === void 0) { value = null; } - util.validateArgCount('Query.startAt', 0, 2, arguments.length); - return new Query(this.database, database.query(this._delegate, database.startAt(value, name))); - }; - Query.prototype.startAfter = function (value, name) { - if (value === void 0) { value = null; } - util.validateArgCount('Query.startAfter', 0, 2, arguments.length); - return new Query(this.database, database.query(this._delegate, database.startAfter(value, name))); - }; - Query.prototype.endAt = function (value, name) { - if (value === void 0) { value = null; } - util.validateArgCount('Query.endAt', 0, 2, arguments.length); - return new Query(this.database, database.query(this._delegate, database.endAt(value, name))); - }; - Query.prototype.endBefore = function (value, name) { - if (value === void 0) { value = null; } - util.validateArgCount('Query.endBefore', 0, 2, arguments.length); - return new Query(this.database, database.query(this._delegate, database.endBefore(value, name))); - }; - /** - * Load the selection of children with exactly the specified value, and, optionally, - * the specified name. - */ - Query.prototype.equalTo = function (value, name) { - util.validateArgCount('Query.equalTo', 1, 2, arguments.length); - return new Query(this.database, database.query(this._delegate, database.equalTo(value, name))); - }; - /** - * @returns URL for this location. - */ - Query.prototype.toString = function () { - util.validateArgCount('Query.toString', 0, 0, arguments.length); - return this._delegate.toString(); - }; - // Do not create public documentation. This is intended to make JSON serialization work but is otherwise unnecessary - // for end-users. - Query.prototype.toJSON = function () { - // An optional spacer argument is unnecessary for a string. - util.validateArgCount('Query.toJSON', 0, 1, arguments.length); - return this._delegate.toJSON(); - }; - /** - * Return true if this query and the provided query are equivalent; otherwise, return false. - */ - Query.prototype.isEqual = function (other) { - util.validateArgCount('Query.isEqual', 1, 1, arguments.length); - if (!(other instanceof Query)) { - var error = 'Query.isEqual failed: First argument must be an instance of firebase.database.Query.'; - throw new Error(error); - } - return this._delegate.isEqual(other._delegate); - }; - /** - * Helper used by .on and .once to extract the context and or cancel arguments. - * @param fnName - The function name (on or once) - * - */ - Query.getCancelAndContextArgs_ = function (fnName, cancelOrContext, context) { - var ret = { cancel: undefined, context: undefined }; - if (cancelOrContext && context) { - ret.cancel = cancelOrContext; - util.validateCallback(fnName, 'cancel', ret.cancel, true); - ret.context = context; - util.validateContextObject(fnName, 'context', ret.context, true); - } - else if (cancelOrContext) { - // we have either a cancel callback or a context. - if (typeof cancelOrContext === 'object' && cancelOrContext !== null) { - // it's a context! - ret.context = cancelOrContext; - } - else if (typeof cancelOrContext === 'function') { - ret.cancel = cancelOrContext; - } - else { - throw new Error(util.errorPrefix(fnName, 'cancelOrContext') + - ' must either be a cancel callback or a context object.'); - } - } - return ret; - }; - Object.defineProperty(Query.prototype, "ref", { - get: function () { - return new Reference(this.database, new database._ReferenceImpl(this._delegate._repo, this._delegate._path)); - }, - enumerable: false, - configurable: true - }); - return Query; -}()); -var Reference = /** @class */ (function (_super) { - tslib.__extends(Reference, _super); - /** - * Call options: - * new Reference(Repo, Path) or - * new Reference(url: string, string|RepoManager) - * - * Externally - this is the firebase.database.Reference type. - */ - function Reference(database$1, _delegate) { - var _this = _super.call(this, database$1, new database._QueryImpl(_delegate._repo, _delegate._path, new database._QueryParams(), false)) || this; - _this.database = database$1; - _this._delegate = _delegate; - return _this; - } - /** @returns {?string} */ - Reference.prototype.getKey = function () { - util.validateArgCount('Reference.key', 0, 0, arguments.length); - return this._delegate.key; - }; - Reference.prototype.child = function (pathString) { - util.validateArgCount('Reference.child', 1, 1, arguments.length); - if (typeof pathString === 'number') { - pathString = String(pathString); - } - return new Reference(this.database, database.child(this._delegate, pathString)); - }; - /** @returns {?Reference} */ - Reference.prototype.getParent = function () { - util.validateArgCount('Reference.parent', 0, 0, arguments.length); - var parent = this._delegate.parent; - return parent ? new Reference(this.database, parent) : null; - }; - /** @returns {!Reference} */ - Reference.prototype.getRoot = function () { - util.validateArgCount('Reference.root', 0, 0, arguments.length); - return new Reference(this.database, this._delegate.root); - }; - Reference.prototype.set = function (newVal, onComplete) { - util.validateArgCount('Reference.set', 1, 2, arguments.length); - util.validateCallback('Reference.set', 'onComplete', onComplete, true); - var result = database.set(this._delegate, newVal); - if (onComplete) { - result.then(function () { return onComplete(null); }, function (error) { return onComplete(error); }); - } - return result; - }; - Reference.prototype.update = function (values, onComplete) { - util.validateArgCount('Reference.update', 1, 2, arguments.length); - if (Array.isArray(values)) { - var newObjectToMerge = {}; - for (var i = 0; i < values.length; ++i) { - newObjectToMerge['' + i] = values[i]; - } - values = newObjectToMerge; - warn('Passing an Array to Firebase.update() is deprecated. ' + - 'Use set() if you want to overwrite the existing data, or ' + - 'an Object with integer keys if you really do want to ' + - 'only update some of the children.'); - } - database._validateWritablePath('Reference.update', this._delegate._path); - util.validateCallback('Reference.update', 'onComplete', onComplete, true); - var result = database.update(this._delegate, values); - if (onComplete) { - result.then(function () { return onComplete(null); }, function (error) { return onComplete(error); }); - } - return result; - }; - Reference.prototype.setWithPriority = function (newVal, newPriority, onComplete) { - util.validateArgCount('Reference.setWithPriority', 2, 3, arguments.length); - util.validateCallback('Reference.setWithPriority', 'onComplete', onComplete, true); - var result = database.setWithPriority(this._delegate, newVal, newPriority); - if (onComplete) { - result.then(function () { return onComplete(null); }, function (error) { return onComplete(error); }); - } - return result; - }; - Reference.prototype.remove = function (onComplete) { - util.validateArgCount('Reference.remove', 0, 1, arguments.length); - util.validateCallback('Reference.remove', 'onComplete', onComplete, true); - var result = database.remove(this._delegate); - if (onComplete) { - result.then(function () { return onComplete(null); }, function (error) { return onComplete(error); }); - } - return result; - }; - Reference.prototype.transaction = function (transactionUpdate, onComplete, applyLocally) { - var _this = this; - util.validateArgCount('Reference.transaction', 1, 3, arguments.length); - util.validateCallback('Reference.transaction', 'transactionUpdate', transactionUpdate, false); - util.validateCallback('Reference.transaction', 'onComplete', onComplete, true); - validateBoolean('Reference.transaction', 'applyLocally', applyLocally, true); - var result = database.runTransaction(this._delegate, transactionUpdate, { - applyLocally: applyLocally - }).then(function (transactionResult) { - return new TransactionResult(transactionResult.committed, new DataSnapshot(_this.database, transactionResult.snapshot)); - }); - if (onComplete) { - result.then(function (transactionResult) { - return onComplete(null, transactionResult.committed, transactionResult.snapshot); - }, function (error) { return onComplete(error, false, null); }); - } - return result; - }; - Reference.prototype.setPriority = function (priority, onComplete) { - util.validateArgCount('Reference.setPriority', 1, 2, arguments.length); - util.validateCallback('Reference.setPriority', 'onComplete', onComplete, true); - var result = database.setPriority(this._delegate, priority); - if (onComplete) { - result.then(function () { return onComplete(null); }, function (error) { return onComplete(error); }); - } - return result; - }; - Reference.prototype.push = function (value, onComplete) { - var _this = this; - util.validateArgCount('Reference.push', 0, 2, arguments.length); - util.validateCallback('Reference.push', 'onComplete', onComplete, true); - var expPromise = database.push(this._delegate, value); - var promise = expPromise.then(function (expRef) { return new Reference(_this.database, expRef); }); - if (onComplete) { - promise.then(function () { return onComplete(null); }, function (error) { return onComplete(error); }); - } - var result = new Reference(this.database, expPromise); - result.then = promise.then.bind(promise); - result.catch = promise.catch.bind(promise, undefined); - return result; - }; - Reference.prototype.onDisconnect = function () { - database._validateWritablePath('Reference.onDisconnect', this._delegate._path); - return new OnDisconnect(new database.OnDisconnect(this._delegate._repo, this._delegate._path)); - }; - Object.defineProperty(Reference.prototype, "key", { - get: function () { - return this.getKey(); - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(Reference.prototype, "parent", { - get: function () { - return this.getParent(); - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(Reference.prototype, "root", { - get: function () { - return this.getRoot(); - }, - enumerable: false, - configurable: true - }); - return Reference; -}(Query)); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Class representing a firebase database. - */ -var Database = /** @class */ (function () { - /** - * The constructor should not be called by users of our public API. - */ - function Database(_delegate, app) { - var _this = this; - this._delegate = _delegate; - this.app = app; - this.INTERNAL = { - delete: function () { return _this._delegate._delete(); }, - forceWebSockets: database.forceWebSockets, - forceLongPolling: database.forceLongPolling - }; - } - /** - * Modify this instance to communicate with the Realtime Database emulator. - * - *

Note: This method must be called before performing any other operation. - * - * @param host - the emulator host (ex: localhost) - * @param port - the emulator port (ex: 8080) - * @param options.mockUserToken - the mock auth token to use for unit testing Security Rules - */ - Database.prototype.useEmulator = function (host, port, options) { - if (options === void 0) { options = {}; } - database.connectDatabaseEmulator(this._delegate, host, port, options); - }; - Database.prototype.ref = function (path) { - util.validateArgCount('database.ref', 0, 1, arguments.length); - if (path instanceof Reference) { - var childRef = database.refFromURL(this._delegate, path.toString()); - return new Reference(this, childRef); - } - else { - var childRef = database.ref(this._delegate, path); - return new Reference(this, childRef); - } - }; - /** - * Returns a reference to the root or the path specified in url. - * We throw a exception if the url is not in the same domain as the - * current repo. - * @returns Firebase reference. - */ - Database.prototype.refFromURL = function (url) { - var apiName = 'database.refFromURL'; - util.validateArgCount(apiName, 1, 1, arguments.length); - var childRef = database.refFromURL(this._delegate, url); - return new Reference(this, childRef); - }; - // Make individual repo go offline. - Database.prototype.goOffline = function () { - util.validateArgCount('database.goOffline', 0, 0, arguments.length); - return database.goOffline(this._delegate); - }; - Database.prototype.goOnline = function () { - util.validateArgCount('database.goOnline', 0, 0, arguments.length); - return database.goOnline(this._delegate); - }; - Database.ServerValue = { - TIMESTAMP: database.serverTimestamp(), - increment: function (delta) { return database.increment(delta); } - }; - return Database; -}()); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Used by console to create a database based on the app, - * passed database URL and a custom auth implementation. - * - * @param app - A valid FirebaseApp-like object - * @param url - A valid Firebase databaseURL - * @param version - custom version e.g. firebase-admin version - * @param customAuthImpl - custom auth implementation - */ -function initStandalone(_a) { - var app = _a.app, url = _a.url, version = _a.version, customAuthImpl = _a.customAuthImpl, namespace = _a.namespace, _b = _a.nodeAdmin, nodeAdmin = _b === void 0 ? false : _b; - database._setSDKVersion(version); - /** - * ComponentContainer('database-standalone') is just a placeholder that doesn't perform - * any actual function. - */ - var authProvider = new component.Provider('auth-internal', new component.ComponentContainer('database-standalone')); - authProvider.setComponent(new component.Component('auth-internal', function () { return customAuthImpl; }, "PRIVATE" /* ComponentType.PRIVATE */)); - return { - instance: new Database(database._repoManagerDatabaseFromApp(app, authProvider, - /* appCheckProvider= */ undefined, url, nodeAdmin), app), - namespace: namespace - }; -} - -var INTERNAL = /*#__PURE__*/Object.freeze({ - __proto__: null, - initStandalone: initStandalone -}); - -/** - * @license - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var ServerValue = Database.ServerValue; -function registerDatabase(instance) { - // Register the Database Service with the 'firebase' namespace. - instance.INTERNAL.registerComponent(new component.Component('database-compat', function (container, _a) { - var url = _a.instanceIdentifier; - /* Dependencies */ - // getImmediate for FirebaseApp will always succeed - var app = container.getProvider('app-compat').getImmediate(); - var databaseExp = container - .getProvider('database') - .getImmediate({ identifier: url }); - return new Database(databaseExp, app); - }, "PUBLIC" /* ComponentType.PUBLIC */) - .setServiceProps( - // firebase.database namespace properties - { - Reference: Reference, - Query: Query, - Database: Database, - DataSnapshot: DataSnapshot, - enableLogging: database.enableLogging, - INTERNAL: INTERNAL, - ServerValue: ServerValue - }) - .setMultipleInstances(true)); - instance.registerVersion(name, version, 'node'); -} -registerDatabase(firebase__default["default"]); -//# sourceMappingURL=index.js.map diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/index.standalone.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/index.standalone.js deleted file mode 100644 index 2c83e743..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/index.standalone.js +++ /dev/null @@ -1,18776 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, '__esModule', { value: true }); - -var require$$2 = require('util'); -var require$$0 = require('buffer'); -var require$$1 = require('events'); -var require$$0$1 = require('stream'); -var require$$1$1 = require('crypto'); -var require$$2$1 = require('url'); -var require$$0$2 = require('assert'); -var require$$1$2 = require('net'); -var require$$2$2 = require('tls'); -var require$$1$3 = require('@firebase/util'); -var require$$2$3 = require('tslib'); -var require$$3 = require('@firebase/logger'); -var component = require('@firebase/component'); - -function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } - -var require$$2__default = /*#__PURE__*/_interopDefaultLegacy(require$$2); -var require$$0__default = /*#__PURE__*/_interopDefaultLegacy(require$$0); -var require$$1__default = /*#__PURE__*/_interopDefaultLegacy(require$$1); -var require$$0__default$1 = /*#__PURE__*/_interopDefaultLegacy(require$$0$1); -var require$$1__default$1 = /*#__PURE__*/_interopDefaultLegacy(require$$1$1); -var require$$2__default$1 = /*#__PURE__*/_interopDefaultLegacy(require$$2$1); -var require$$0__default$2 = /*#__PURE__*/_interopDefaultLegacy(require$$0$2); -var require$$1__default$2 = /*#__PURE__*/_interopDefaultLegacy(require$$1$2); -var require$$2__default$2 = /*#__PURE__*/_interopDefaultLegacy(require$$2$2); -var require$$1__default$3 = /*#__PURE__*/_interopDefaultLegacy(require$$1$3); -var require$$2__default$3 = /*#__PURE__*/_interopDefaultLegacy(require$$2$3); -var require$$3__default = /*#__PURE__*/_interopDefaultLegacy(require$$3); - -var index_standalone = {}; - -var safeBuffer = {exports: {}}; - -/*! safe-buffer. MIT License. Feross Aboukhadijeh */ - -(function (module, exports) { -/* eslint-disable node/no-deprecated-api */ -var buffer = require$$0__default["default"]; -var Buffer = buffer.Buffer; - -// alternative to using Object.keys for old browsers -function copyProps (src, dst) { - for (var key in src) { - dst[key] = src[key]; - } -} -if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) { - module.exports = buffer; -} else { - // Copy properties from require('buffer') - copyProps(buffer, exports); - exports.Buffer = SafeBuffer; -} - -function SafeBuffer (arg, encodingOrOffset, length) { - return Buffer(arg, encodingOrOffset, length) -} - -SafeBuffer.prototype = Object.create(Buffer.prototype); - -// Copy static methods from Buffer -copyProps(Buffer, SafeBuffer); - -SafeBuffer.from = function (arg, encodingOrOffset, length) { - if (typeof arg === 'number') { - throw new TypeError('Argument must not be a number') - } - return Buffer(arg, encodingOrOffset, length) -}; - -SafeBuffer.alloc = function (size, fill, encoding) { - if (typeof size !== 'number') { - throw new TypeError('Argument must be a number') - } - var buf = Buffer(size); - if (fill !== undefined) { - if (typeof encoding === 'string') { - buf.fill(fill, encoding); - } else { - buf.fill(fill); - } - } else { - buf.fill(0); - } - return buf -}; - -SafeBuffer.allocUnsafe = function (size) { - if (typeof size !== 'number') { - throw new TypeError('Argument must be a number') - } - return Buffer(size) -}; - -SafeBuffer.allocUnsafeSlow = function (size) { - if (typeof size !== 'number') { - throw new TypeError('Argument must be a number') - } - return buffer.SlowBuffer(size) -}; -}(safeBuffer, safeBuffer.exports)); - -var streams$1 = {}; - -/** - -Streams in a WebSocket connection ---------------------------------- - -We model a WebSocket as two duplex streams: one stream is for the wire protocol -over an I/O socket, and the other is for incoming/outgoing messages. - - - +----------+ +---------+ +----------+ - [1] write(chunk) -->| ~~~~~~~~ +----->| parse() +----->| ~~~~~~~~ +--> emit('data') [2] - | | +----+----+ | | - | | | | | - | IO | | [5] | Messages | - | | V | | - | | +---------+ | | - [4] emit('data') <--+ ~~~~~~~~ |<-----+ frame() |<-----+ ~~~~~~~~ |<-- write(chunk) [3] - +----------+ +---------+ +----------+ - - -Message transfer in each direction is simple: IO receives a byte stream [1] and -sends this stream for parsing. The parser will periodically emit a complete -message text on the Messages stream [2]. Similarly, when messages are written -to the Messages stream [3], they are framed using the WebSocket wire format and -emitted via IO [4]. - -There is a feedback loop via [5] since some input from [1] will be things like -ping, pong and close frames. In these cases the protocol responds by emitting -responses directly back to [4] rather than emitting messages via [2]. - -For the purposes of flow control, we consider the sources of each Readable -stream to be as follows: - -* [2] receives input from [1] -* [4] receives input from [1] and [3] - -The classes below express the relationships described above without prescribing -anything about how parse() and frame() work, other than assuming they emit -'data' events to the IO and Messages streams. They will work with any protocol -driver having these two methods. -**/ - - -var Stream$3 = require$$0__default$1["default"].Stream, - util$c = require$$2__default["default"]; - - -var IO = function(driver) { - this.readable = this.writable = true; - this._paused = false; - this._driver = driver; -}; -util$c.inherits(IO, Stream$3); - -// The IO pause() and resume() methods will be called when the socket we are -// piping to gets backed up and drains. Since IO output [4] comes from IO input -// [1] and Messages input [3], we need to tell both of those to return false -// from write() when this stream is paused. - -IO.prototype.pause = function() { - this._paused = true; - this._driver.messages._paused = true; -}; - -IO.prototype.resume = function() { - this._paused = false; - this.emit('drain'); - - var messages = this._driver.messages; - messages._paused = false; - messages.emit('drain'); -}; - -// When we receive input from a socket, send it to the parser and tell the -// source whether to back off. -IO.prototype.write = function(chunk) { - if (!this.writable) return false; - this._driver.parse(chunk); - return !this._paused; -}; - -// The IO end() method will be called when the socket piping into it emits -// 'close' or 'end', i.e. the socket is closed. In this situation the Messages -// stream will not emit any more data so we emit 'end'. -IO.prototype.end = function(chunk) { - if (!this.writable) return; - if (chunk !== undefined) this.write(chunk); - this.writable = false; - - var messages = this._driver.messages; - if (messages.readable) { - messages.readable = messages.writable = false; - messages.emit('end'); - } -}; - -IO.prototype.destroy = function() { - this.end(); -}; - - -var Messages = function(driver) { - this.readable = this.writable = true; - this._paused = false; - this._driver = driver; -}; -util$c.inherits(Messages, Stream$3); - -// The Messages pause() and resume() methods will be called when the app that's -// processing the messages gets backed up and drains. If we're emitting -// messages too fast we should tell the source to slow down. Message output [2] -// comes from IO input [1]. - -Messages.prototype.pause = function() { - this._driver.io._paused = true; -}; - -Messages.prototype.resume = function() { - this._driver.io._paused = false; - this._driver.io.emit('drain'); -}; - -// When we receive messages from the user, send them to the formatter and tell -// the source whether to back off. -Messages.prototype.write = function(message) { - if (!this.writable) return false; - if (typeof message === 'string') this._driver.text(message); - else this._driver.binary(message); - return !this._paused; -}; - -// The Messages end() method will be called when a stream piping into it emits -// 'end'. Many streams may be piped into the WebSocket and one of them ending -// does not mean the whole socket is done, so just process the input and move -// on leaving the socket open. -Messages.prototype.end = function(message) { - if (message !== undefined) this.write(message); -}; - -Messages.prototype.destroy = function() {}; - - -streams$1.IO = IO; -streams$1.Messages = Messages; - -var Headers$3 = function() { - this.clear(); -}; - -Headers$3.prototype.ALLOWED_DUPLICATES = ['set-cookie', 'set-cookie2', 'warning', 'www-authenticate']; - -Headers$3.prototype.clear = function() { - this._sent = {}; - this._lines = []; -}; - -Headers$3.prototype.set = function(name, value) { - if (value === undefined) return; - - name = this._strip(name); - value = this._strip(value); - - var key = name.toLowerCase(); - if (!this._sent.hasOwnProperty(key) || this.ALLOWED_DUPLICATES.indexOf(key) >= 0) { - this._sent[key] = true; - this._lines.push(name + ': ' + value + '\r\n'); - } -}; - -Headers$3.prototype.toString = function() { - return this._lines.join(''); -}; - -Headers$3.prototype._strip = function(string) { - return string.toString().replace(/^ */, '').replace(/ *$/, ''); -}; - -var headers = Headers$3; - -var Buffer$9 = safeBuffer.exports.Buffer; - -var StreamReader = function() { - this._queue = []; - this._queueSize = 0; - this._offset = 0; -}; - -StreamReader.prototype.put = function(buffer) { - if (!buffer || buffer.length === 0) return; - if (!Buffer$9.isBuffer(buffer)) buffer = Buffer$9.from(buffer); - this._queue.push(buffer); - this._queueSize += buffer.length; -}; - -StreamReader.prototype.read = function(length) { - if (length > this._queueSize) return null; - if (length === 0) return Buffer$9.alloc(0); - - this._queueSize -= length; - - var queue = this._queue, - remain = length, - first = queue[0], - buffers, buffer; - - if (first.length >= length) { - if (first.length === length) { - return queue.shift(); - } else { - buffer = first.slice(0, length); - queue[0] = first.slice(length); - return buffer; - } - } - - for (var i = 0, n = queue.length; i < n; i++) { - if (remain < queue[i].length) break; - remain -= queue[i].length; - } - buffers = queue.splice(0, i); - - if (remain > 0 && queue.length > 0) { - buffers.push(queue[0].slice(0, remain)); - queue[0] = queue[0].slice(remain); - } - return Buffer$9.concat(buffers, length); -}; - -StreamReader.prototype.eachByte = function(callback, context) { - var buffer, n, index; - - while (this._queue.length > 0) { - buffer = this._queue[0]; - n = buffer.length; - - while (this._offset < n) { - index = this._offset; - this._offset += 1; - callback.call(context, buffer[index]); - } - this._offset = 0; - this._queue.shift(); - } -}; - -var stream_reader = StreamReader; - -var Buffer$8 = safeBuffer.exports.Buffer, - Emitter = require$$1__default["default"].EventEmitter, - util$b = require$$2__default["default"], - streams = streams$1, - Headers$2 = headers, - Reader = stream_reader; - -var Base$7 = function(request, url, options) { - Emitter.call(this); - Base$7.validateOptions(options || {}, ['maxLength', 'masking', 'requireMasking', 'protocols']); - - this._request = request; - this._reader = new Reader(); - this._options = options || {}; - this._maxLength = this._options.maxLength || this.MAX_LENGTH; - this._headers = new Headers$2(); - this.__queue = []; - this.readyState = 0; - this.url = url; - - this.io = new streams.IO(this); - this.messages = new streams.Messages(this); - this._bindEventListeners(); -}; -util$b.inherits(Base$7, Emitter); - -Base$7.isWebSocket = function(request) { - var connection = request.headers.connection || '', - upgrade = request.headers.upgrade || ''; - - return request.method === 'GET' && - connection.toLowerCase().split(/ *, */).indexOf('upgrade') >= 0 && - upgrade.toLowerCase() === 'websocket'; -}; - -Base$7.validateOptions = function(options, validKeys) { - for (var key in options) { - if (validKeys.indexOf(key) < 0) - throw new Error('Unrecognized option: ' + key); - } -}; - -var instance$b = { - // This is 64MB, small enough for an average VPS to handle without - // crashing from process out of memory - MAX_LENGTH: 0x3ffffff, - - STATES: ['connecting', 'open', 'closing', 'closed'], - - _bindEventListeners: function() { - var self = this; - - // Protocol errors are informational and do not have to be handled - this.messages.on('error', function() {}); - - this.on('message', function(event) { - var messages = self.messages; - if (messages.readable) messages.emit('data', event.data); - }); - - this.on('error', function(error) { - var messages = self.messages; - if (messages.readable) messages.emit('error', error); - }); - - this.on('close', function() { - var messages = self.messages; - if (!messages.readable) return; - messages.readable = messages.writable = false; - messages.emit('end'); - }); - }, - - getState: function() { - return this.STATES[this.readyState] || null; - }, - - addExtension: function(extension) { - return false; - }, - - setHeader: function(name, value) { - if (this.readyState > 0) return false; - this._headers.set(name, value); - return true; - }, - - start: function() { - if (this.readyState !== 0) return false; - - if (!Base$7.isWebSocket(this._request)) - return this._failHandshake(new Error('Not a WebSocket request')); - - var response; - - try { - response = this._handshakeResponse(); - } catch (error) { - return this._failHandshake(error); - } - - this._write(response); - if (this._stage !== -1) this._open(); - return true; - }, - - _failHandshake: function(error) { - var headers = new Headers$2(); - headers.set('Content-Type', 'text/plain'); - headers.set('Content-Length', Buffer$8.byteLength(error.message, 'utf8')); - - headers = ['HTTP/1.1 400 Bad Request', headers.toString(), error.message]; - this._write(Buffer$8.from(headers.join('\r\n'), 'utf8')); - this._fail('protocol_error', error.message); - - return false; - }, - - text: function(message) { - return this.frame(message); - }, - - binary: function(message) { - return false; - }, - - ping: function() { - return false; - }, - - pong: function() { - return false; - }, - - close: function(reason, code) { - if (this.readyState !== 1) return false; - this.readyState = 3; - this.emit('close', new Base$7.CloseEvent(null, null)); - return true; - }, - - _open: function() { - this.readyState = 1; - this.__queue.forEach(function(args) { this.frame.apply(this, args); }, this); - this.__queue = []; - this.emit('open', new Base$7.OpenEvent()); - }, - - _queue: function(message) { - this.__queue.push(message); - return true; - }, - - _write: function(chunk) { - var io = this.io; - if (io.readable) io.emit('data', chunk); - }, - - _fail: function(type, message) { - this.readyState = 2; - this.emit('error', new Error(message)); - this.close(); - } -}; - -for (var key$b in instance$b) - Base$7.prototype[key$b] = instance$b[key$b]; - - -Base$7.ConnectEvent = function() {}; - -Base$7.OpenEvent = function() {}; - -Base$7.CloseEvent = function(code, reason) { - this.code = code; - this.reason = reason; -}; - -Base$7.MessageEvent = function(data) { - this.data = data; -}; - -Base$7.PingEvent = function(data) { - this.data = data; -}; - -Base$7.PongEvent = function(data) { - this.data = data; -}; - -var base = Base$7; - -var httpParser = {}; - -/*jshint node:true */ -var assert = require$$0__default$2["default"]; - -httpParser.HTTPParser = HTTPParser; -function HTTPParser(type) { - assert.ok(type === HTTPParser.REQUEST || type === HTTPParser.RESPONSE || type === undefined); - if (type === undefined) ; else { - this.initialize(type); - } -} -HTTPParser.prototype.initialize = function (type, async_resource) { - assert.ok(type === HTTPParser.REQUEST || type === HTTPParser.RESPONSE); - this.type = type; - this.state = type + '_LINE'; - this.info = { - headers: [], - upgrade: false - }; - this.trailers = []; - this.line = ''; - this.isChunked = false; - this.connection = ''; - this.headerSize = 0; // for preventing too big headers - this.body_bytes = null; - this.isUserCall = false; - this.hadError = false; -}; - -HTTPParser.encoding = 'ascii'; -HTTPParser.maxHeaderSize = 80 * 1024; // maxHeaderSize (in bytes) is configurable, but 80kb by default; -HTTPParser.REQUEST = 'REQUEST'; -HTTPParser.RESPONSE = 'RESPONSE'; - -// Note: *not* starting with kOnHeaders=0 line the Node parser, because any -// newly added constants (kOnTimeout in Node v12.19.0) will overwrite 0! -var kOnHeaders = HTTPParser.kOnHeaders = 1; -var kOnHeadersComplete = HTTPParser.kOnHeadersComplete = 2; -var kOnBody = HTTPParser.kOnBody = 3; -var kOnMessageComplete = HTTPParser.kOnMessageComplete = 4; - -// Some handler stubs, needed for compatibility -HTTPParser.prototype[kOnHeaders] = -HTTPParser.prototype[kOnHeadersComplete] = -HTTPParser.prototype[kOnBody] = -HTTPParser.prototype[kOnMessageComplete] = function () {}; - -var compatMode0_12 = true; -Object.defineProperty(HTTPParser, 'kOnExecute', { - get: function () { - // hack for backward compatibility - compatMode0_12 = false; - return 99; - } - }); - -var methods = httpParser.methods = HTTPParser.methods = [ - 'DELETE', - 'GET', - 'HEAD', - 'POST', - 'PUT', - 'CONNECT', - 'OPTIONS', - 'TRACE', - 'COPY', - 'LOCK', - 'MKCOL', - 'MOVE', - 'PROPFIND', - 'PROPPATCH', - 'SEARCH', - 'UNLOCK', - 'BIND', - 'REBIND', - 'UNBIND', - 'ACL', - 'REPORT', - 'MKACTIVITY', - 'CHECKOUT', - 'MERGE', - 'M-SEARCH', - 'NOTIFY', - 'SUBSCRIBE', - 'UNSUBSCRIBE', - 'PATCH', - 'PURGE', - 'MKCALENDAR', - 'LINK', - 'UNLINK' -]; -var method_connect = methods.indexOf('CONNECT'); -HTTPParser.prototype.reinitialize = HTTPParser; -HTTPParser.prototype.close = -HTTPParser.prototype.pause = -HTTPParser.prototype.resume = -HTTPParser.prototype.free = function () {}; -HTTPParser.prototype._compatMode0_11 = false; -HTTPParser.prototype.getAsyncId = function() { return 0; }; - -var headerState = { - REQUEST_LINE: true, - RESPONSE_LINE: true, - HEADER: true -}; -HTTPParser.prototype.execute = function (chunk, start, length) { - if (!(this instanceof HTTPParser)) { - throw new TypeError('not a HTTPParser'); - } - - // backward compat to node < 0.11.4 - // Note: the start and length params were removed in newer version - start = start || 0; - length = typeof length === 'number' ? length : chunk.length; - - this.chunk = chunk; - this.offset = start; - var end = this.end = start + length; - try { - while (this.offset < end) { - if (this[this.state]()) { - break; - } - } - } catch (err) { - if (this.isUserCall) { - throw err; - } - this.hadError = true; - return err; - } - this.chunk = null; - length = this.offset - start; - if (headerState[this.state]) { - this.headerSize += length; - if (this.headerSize > HTTPParser.maxHeaderSize) { - return new Error('max header size exceeded'); - } - } - return length; -}; - -var stateFinishAllowed = { - REQUEST_LINE: true, - RESPONSE_LINE: true, - BODY_RAW: true -}; -HTTPParser.prototype.finish = function () { - if (this.hadError) { - return; - } - if (!stateFinishAllowed[this.state]) { - return new Error('invalid state for EOF'); - } - if (this.state === 'BODY_RAW') { - this.userCall()(this[kOnMessageComplete]()); - } -}; - -// These three methods are used for an internal speed optimization, and it also -// works if theses are noops. Basically consume() asks us to read the bytes -// ourselves, but if we don't do it we get them through execute(). -HTTPParser.prototype.consume = -HTTPParser.prototype.unconsume = -HTTPParser.prototype.getCurrentBuffer = function () {}; - -//For correct error handling - see HTTPParser#execute -//Usage: this.userCall()(userFunction('arg')); -HTTPParser.prototype.userCall = function () { - this.isUserCall = true; - var self = this; - return function (ret) { - self.isUserCall = false; - return ret; - }; -}; - -HTTPParser.prototype.nextRequest = function () { - this.userCall()(this[kOnMessageComplete]()); - this.reinitialize(this.type); -}; - -HTTPParser.prototype.consumeLine = function () { - var end = this.end, - chunk = this.chunk; - for (var i = this.offset; i < end; i++) { - if (chunk[i] === 0x0a) { // \n - var line = this.line + chunk.toString(HTTPParser.encoding, this.offset, i); - if (line.charAt(line.length - 1) === '\r') { - line = line.substr(0, line.length - 1); - } - this.line = ''; - this.offset = i + 1; - return line; - } - } - //line split over multiple chunks - this.line += chunk.toString(HTTPParser.encoding, this.offset, this.end); - this.offset = this.end; -}; - -var headerExp = /^([^: \t]+):[ \t]*((?:.*[^ \t])|)/; -var headerContinueExp = /^[ \t]+(.*[^ \t])/; -HTTPParser.prototype.parseHeader = function (line, headers) { - if (line.indexOf('\r') !== -1) { - throw parseErrorCode('HPE_LF_EXPECTED'); - } - - var match = headerExp.exec(line); - var k = match && match[1]; - if (k) { // skip empty string (malformed header) - headers.push(k); - headers.push(match[2]); - } else { - var matchContinue = headerContinueExp.exec(line); - if (matchContinue && headers.length) { - if (headers[headers.length - 1]) { - headers[headers.length - 1] += ' '; - } - headers[headers.length - 1] += matchContinue[1]; - } - } -}; - -var requestExp = /^([A-Z-]+) ([^ ]+) HTTP\/(\d)\.(\d)$/; -HTTPParser.prototype.REQUEST_LINE = function () { - var line = this.consumeLine(); - if (!line) { - return; - } - var match = requestExp.exec(line); - if (match === null) { - throw parseErrorCode('HPE_INVALID_CONSTANT'); - } - this.info.method = this._compatMode0_11 ? match[1] : methods.indexOf(match[1]); - if (this.info.method === -1) { - throw new Error('invalid request method'); - } - this.info.url = match[2]; - this.info.versionMajor = +match[3]; - this.info.versionMinor = +match[4]; - this.body_bytes = 0; - this.state = 'HEADER'; -}; - -var responseExp = /^HTTP\/(\d)\.(\d) (\d{3}) ?(.*)$/; -HTTPParser.prototype.RESPONSE_LINE = function () { - var line = this.consumeLine(); - if (!line) { - return; - } - var match = responseExp.exec(line); - if (match === null) { - throw parseErrorCode('HPE_INVALID_CONSTANT'); - } - this.info.versionMajor = +match[1]; - this.info.versionMinor = +match[2]; - var statusCode = this.info.statusCode = +match[3]; - this.info.statusMessage = match[4]; - // Implied zero length. - if ((statusCode / 100 | 0) === 1 || statusCode === 204 || statusCode === 304) { - this.body_bytes = 0; - } - this.state = 'HEADER'; -}; - -HTTPParser.prototype.shouldKeepAlive = function () { - if (this.info.versionMajor > 0 && this.info.versionMinor > 0) { - if (this.connection.indexOf('close') !== -1) { - return false; - } - } else if (this.connection.indexOf('keep-alive') === -1) { - return false; - } - if (this.body_bytes !== null || this.isChunked) { // || skipBody - return true; - } - return false; -}; - -HTTPParser.prototype.HEADER = function () { - var line = this.consumeLine(); - if (line === undefined) { - return; - } - var info = this.info; - if (line) { - this.parseHeader(line, info.headers); - } else { - var headers = info.headers; - var hasContentLength = false; - var currentContentLengthValue; - var hasUpgradeHeader = false; - for (var i = 0; i < headers.length; i += 2) { - switch (headers[i].toLowerCase()) { - case 'transfer-encoding': - this.isChunked = headers[i + 1].toLowerCase() === 'chunked'; - break; - case 'content-length': - currentContentLengthValue = +headers[i + 1]; - if (hasContentLength) { - // Fix duplicate Content-Length header with same values. - // Throw error only if values are different. - // Known issues: - // https://github.com/request/request/issues/2091#issuecomment-328715113 - // https://github.com/nodejs/node/issues/6517#issuecomment-216263771 - if (currentContentLengthValue !== this.body_bytes) { - throw parseErrorCode('HPE_UNEXPECTED_CONTENT_LENGTH'); - } - } else { - hasContentLength = true; - this.body_bytes = currentContentLengthValue; - } - break; - case 'connection': - this.connection += headers[i + 1].toLowerCase(); - break; - case 'upgrade': - hasUpgradeHeader = true; - break; - } - } - - // if both isChunked and hasContentLength, isChunked wins - // This is required so the body is parsed using the chunked method, and matches - // Chrome's behavior. We could, maybe, ignore them both (would get chunked - // encoding into the body), and/or disable shouldKeepAlive to be more - // resilient. - if (this.isChunked && hasContentLength) { - hasContentLength = false; - this.body_bytes = null; - } - - // Logic from https://github.com/nodejs/http-parser/blob/921d5585515a153fa00e411cf144280c59b41f90/http_parser.c#L1727-L1737 - // "For responses, "Upgrade: foo" and "Connection: upgrade" are - // mandatory only when it is a 101 Switching Protocols response, - // otherwise it is purely informational, to announce support. - if (hasUpgradeHeader && this.connection.indexOf('upgrade') != -1) { - info.upgrade = this.type === HTTPParser.REQUEST || info.statusCode === 101; - } else { - info.upgrade = info.method === method_connect; - } - - if (this.isChunked && info.upgrade) { - this.isChunked = false; - } - - info.shouldKeepAlive = this.shouldKeepAlive(); - //problem which also exists in original node: we should know skipBody before calling onHeadersComplete - var skipBody; - if (compatMode0_12) { - skipBody = this.userCall()(this[kOnHeadersComplete](info)); - } else { - skipBody = this.userCall()(this[kOnHeadersComplete](info.versionMajor, - info.versionMinor, info.headers, info.method, info.url, info.statusCode, - info.statusMessage, info.upgrade, info.shouldKeepAlive)); - } - if (skipBody === 2) { - this.nextRequest(); - return true; - } else if (this.isChunked && !skipBody) { - this.state = 'BODY_CHUNKHEAD'; - } else if (skipBody || this.body_bytes === 0) { - this.nextRequest(); - // For older versions of node (v6.x and older?), that return skipBody=1 or skipBody=true, - // need this "return true;" if it's an upgrade request. - return info.upgrade; - } else if (this.body_bytes === null) { - this.state = 'BODY_RAW'; - } else { - this.state = 'BODY_SIZED'; - } - } -}; - -HTTPParser.prototype.BODY_CHUNKHEAD = function () { - var line = this.consumeLine(); - if (line === undefined) { - return; - } - this.body_bytes = parseInt(line, 16); - if (!this.body_bytes) { - this.state = 'BODY_CHUNKTRAILERS'; - } else { - this.state = 'BODY_CHUNK'; - } -}; - -HTTPParser.prototype.BODY_CHUNK = function () { - var length = Math.min(this.end - this.offset, this.body_bytes); - this.userCall()(this[kOnBody](this.chunk, this.offset, length)); - this.offset += length; - this.body_bytes -= length; - if (!this.body_bytes) { - this.state = 'BODY_CHUNKEMPTYLINE'; - } -}; - -HTTPParser.prototype.BODY_CHUNKEMPTYLINE = function () { - var line = this.consumeLine(); - if (line === undefined) { - return; - } - assert.equal(line, ''); - this.state = 'BODY_CHUNKHEAD'; -}; - -HTTPParser.prototype.BODY_CHUNKTRAILERS = function () { - var line = this.consumeLine(); - if (line === undefined) { - return; - } - if (line) { - this.parseHeader(line, this.trailers); - } else { - if (this.trailers.length) { - this.userCall()(this[kOnHeaders](this.trailers, '')); - } - this.nextRequest(); - } -}; - -HTTPParser.prototype.BODY_RAW = function () { - var length = this.end - this.offset; - this.userCall()(this[kOnBody](this.chunk, this.offset, length)); - this.offset = this.end; -}; - -HTTPParser.prototype.BODY_SIZED = function () { - var length = Math.min(this.end - this.offset, this.body_bytes); - this.userCall()(this[kOnBody](this.chunk, this.offset, length)); - this.offset += length; - this.body_bytes -= length; - if (!this.body_bytes) { - this.nextRequest(); - } -}; - -// backward compat to node < 0.11.6 -['Headers', 'HeadersComplete', 'Body', 'MessageComplete'].forEach(function (name) { - var k = HTTPParser['kOn' + name]; - Object.defineProperty(HTTPParser.prototype, 'on' + name, { - get: function () { - return this[k]; - }, - set: function (to) { - // hack for backward compatibility - this._compatMode0_11 = true; - method_connect = 'CONNECT'; - return (this[k] = to); - } - }); -}); - -function parseErrorCode(code) { - var err = new Error('Parse Error'); - err.code = code; - return err; -} - -var NodeHTTPParser = httpParser.HTTPParser, - Buffer$7 = safeBuffer.exports.Buffer; - -var TYPES = { - request: NodeHTTPParser.REQUEST || 'request', - response: NodeHTTPParser.RESPONSE || 'response' -}; - -var HttpParser$3 = function(type) { - this._type = type; - this._parser = new NodeHTTPParser(TYPES[type]); - this._complete = false; - this.headers = {}; - - var current = null, - self = this; - - this._parser.onHeaderField = function(b, start, length) { - current = b.toString('utf8', start, start + length).toLowerCase(); - }; - - this._parser.onHeaderValue = function(b, start, length) { - var value = b.toString('utf8', start, start + length); - - if (self.headers.hasOwnProperty(current)) - self.headers[current] += ', ' + value; - else - self.headers[current] = value; - }; - - this._parser.onHeadersComplete = this._parser[NodeHTTPParser.kOnHeadersComplete] = - function(majorVersion, minorVersion, headers, method, pathname, statusCode) { - var info = arguments[0]; - - if (typeof info === 'object') { - method = info.method; - pathname = info.url; - statusCode = info.statusCode; - headers = info.headers; - } - - self.method = (typeof method === 'number') ? HttpParser$3.METHODS[method] : method; - self.statusCode = statusCode; - self.url = pathname; - - if (!headers) return; - - for (var i = 0, n = headers.length, key, value; i < n; i += 2) { - key = headers[i].toLowerCase(); - value = headers[i+1]; - if (self.headers.hasOwnProperty(key)) - self.headers[key] += ', ' + value; - else - self.headers[key] = value; - } - - self._complete = true; - }; -}; - -HttpParser$3.METHODS = { - 0: 'DELETE', - 1: 'GET', - 2: 'HEAD', - 3: 'POST', - 4: 'PUT', - 5: 'CONNECT', - 6: 'OPTIONS', - 7: 'TRACE', - 8: 'COPY', - 9: 'LOCK', - 10: 'MKCOL', - 11: 'MOVE', - 12: 'PROPFIND', - 13: 'PROPPATCH', - 14: 'SEARCH', - 15: 'UNLOCK', - 16: 'BIND', - 17: 'REBIND', - 18: 'UNBIND', - 19: 'ACL', - 20: 'REPORT', - 21: 'MKACTIVITY', - 22: 'CHECKOUT', - 23: 'MERGE', - 24: 'M-SEARCH', - 25: 'NOTIFY', - 26: 'SUBSCRIBE', - 27: 'UNSUBSCRIBE', - 28: 'PATCH', - 29: 'PURGE', - 30: 'MKCALENDAR', - 31: 'LINK', - 32: 'UNLINK' -}; - -var VERSION = process.version - ? process.version.match(/[0-9]+/g).map(function(n) { return parseInt(n, 10) }) - : []; - -if (VERSION[0] === 0 && VERSION[1] === 12) { - HttpParser$3.METHODS[16] = 'REPORT'; - HttpParser$3.METHODS[17] = 'MKACTIVITY'; - HttpParser$3.METHODS[18] = 'CHECKOUT'; - HttpParser$3.METHODS[19] = 'MERGE'; - HttpParser$3.METHODS[20] = 'M-SEARCH'; - HttpParser$3.METHODS[21] = 'NOTIFY'; - HttpParser$3.METHODS[22] = 'SUBSCRIBE'; - HttpParser$3.METHODS[23] = 'UNSUBSCRIBE'; - HttpParser$3.METHODS[24] = 'PATCH'; - HttpParser$3.METHODS[25] = 'PURGE'; -} - -HttpParser$3.prototype.isComplete = function() { - return this._complete; -}; - -HttpParser$3.prototype.parse = function(chunk) { - var consumed = this._parser.execute(chunk, 0, chunk.length); - - if (typeof consumed !== 'number') { - this.error = consumed; - this._complete = true; - return; - } - - if (this._complete) - this.body = (consumed < chunk.length) - ? chunk.slice(consumed) - : Buffer$7.alloc(0); -}; - -var http_parser = HttpParser$3; - -var TOKEN = /([!#\$%&'\*\+\-\.\^_`\|~0-9A-Za-z]+)/, - NOTOKEN = /([^!#\$%&'\*\+\-\.\^_`\|~0-9A-Za-z])/g, - QUOTED = /"((?:\\[\x00-\x7f]|[^\x00-\x08\x0a-\x1f\x7f"\\])*)"/, - PARAM = new RegExp(TOKEN.source + '(?:=(?:' + TOKEN.source + '|' + QUOTED.source + '))?'), - EXT = new RegExp(TOKEN.source + '(?: *; *' + PARAM.source + ')*', 'g'), - EXT_LIST = new RegExp('^' + EXT.source + '(?: *, *' + EXT.source + ')*$'), - NUMBER = /^-?(0|[1-9][0-9]*)(\.[0-9]+)?$/; - -var hasOwnProperty = Object.prototype.hasOwnProperty; - -var Parser$1 = { - parseHeader: function(header) { - var offers = new Offers(); - if (header === '' || header === undefined) return offers; - - if (!EXT_LIST.test(header)) - throw new SyntaxError('Invalid Sec-WebSocket-Extensions header: ' + header); - - var values = header.match(EXT); - - values.forEach(function(value) { - var params = value.match(new RegExp(PARAM.source, 'g')), - name = params.shift(), - offer = {}; - - params.forEach(function(param) { - var args = param.match(PARAM), key = args[1], data; - - if (args[2] !== undefined) { - data = args[2]; - } else if (args[3] !== undefined) { - data = args[3].replace(/\\/g, ''); - } else { - data = true; - } - if (NUMBER.test(data)) data = parseFloat(data); - - if (hasOwnProperty.call(offer, key)) { - offer[key] = [].concat(offer[key]); - offer[key].push(data); - } else { - offer[key] = data; - } - }, this); - offers.push(name, offer); - }, this); - - return offers; - }, - - serializeParams: function(name, params) { - var values = []; - - var print = function(key, value) { - if (value instanceof Array) { - value.forEach(function(v) { print(key, v); }); - } else if (value === true) { - values.push(key); - } else if (typeof value === 'number') { - values.push(key + '=' + value); - } else if (NOTOKEN.test(value)) { - values.push(key + '="' + value.replace(/"/g, '\\"') + '"'); - } else { - values.push(key + '=' + value); - } - }; - - for (var key in params) print(key, params[key]); - - return [name].concat(values).join('; '); - } -}; - -var Offers = function() { - this._byName = {}; - this._inOrder = []; -}; - -Offers.prototype.push = function(name, params) { - if (!hasOwnProperty.call(this._byName, name)) - this._byName[name] = []; - - this._byName[name].push(params); - this._inOrder.push({ name: name, params: params }); -}; - -Offers.prototype.eachOffer = function(callback, context) { - var list = this._inOrder; - for (var i = 0, n = list.length; i < n; i++) - callback.call(context, list[i].name, list[i].params); -}; - -Offers.prototype.byName = function(name) { - return this._byName[name] || []; -}; - -Offers.prototype.toArray = function() { - return this._inOrder.slice(); -}; - -var parser = Parser$1; - -var RingBuffer$2 = function(bufferSize) { - this._bufferSize = bufferSize; - this.clear(); -}; - -RingBuffer$2.prototype.clear = function() { - this._buffer = new Array(this._bufferSize); - this._ringOffset = 0; - this._ringSize = this._bufferSize; - this._head = 0; - this._tail = 0; - this.length = 0; -}; - -RingBuffer$2.prototype.push = function(value) { - var expandBuffer = false, - expandRing = false; - - if (this._ringSize < this._bufferSize) { - expandBuffer = (this._tail === 0); - } else if (this._ringOffset === this._ringSize) { - expandBuffer = true; - expandRing = (this._tail === 0); - } - - if (expandBuffer) { - this._tail = this._bufferSize; - this._buffer = this._buffer.concat(new Array(this._bufferSize)); - this._bufferSize = this._buffer.length; - - if (expandRing) - this._ringSize = this._bufferSize; - } - - this._buffer[this._tail] = value; - this.length += 1; - if (this._tail < this._ringSize) this._ringOffset += 1; - this._tail = (this._tail + 1) % this._bufferSize; -}; - -RingBuffer$2.prototype.peek = function() { - if (this.length === 0) return void 0; - return this._buffer[this._head]; -}; - -RingBuffer$2.prototype.shift = function() { - if (this.length === 0) return void 0; - - var value = this._buffer[this._head]; - this._buffer[this._head] = void 0; - this.length -= 1; - this._ringOffset -= 1; - - if (this._ringOffset === 0 && this.length > 0) { - this._head = this._ringSize; - this._ringOffset = this.length; - this._ringSize = this._bufferSize; - } else { - this._head = (this._head + 1) % this._ringSize; - } - return value; -}; - -var ring_buffer = RingBuffer$2; - -var RingBuffer$1 = ring_buffer; - -var Functor$1 = function(session, method) { - this._session = session; - this._method = method; - this._queue = new RingBuffer$1(Functor$1.QUEUE_SIZE); - this._stopped = false; - this.pending = 0; -}; - -Functor$1.QUEUE_SIZE = 8; - -Functor$1.prototype.call = function(error, message, callback, context) { - if (this._stopped) return; - - var record = { error: error, message: message, callback: callback, context: context, done: false }, - called = false, - self = this; - - this._queue.push(record); - - if (record.error) { - record.done = true; - this._stop(); - return this._flushQueue(); - } - - var handler = function(err, msg) { - if (!(called ^ (called = true))) return; - - if (err) { - self._stop(); - record.error = err; - record.message = null; - } else { - record.message = msg; - } - - record.done = true; - self._flushQueue(); - }; - - try { - this._session[this._method](message, handler); - } catch (err) { - handler(err); - } -}; - -Functor$1.prototype._stop = function() { - this.pending = this._queue.length; - this._stopped = true; -}; - -Functor$1.prototype._flushQueue = function() { - var queue = this._queue, record; - - while (queue.length > 0 && queue.peek().done) { - record = queue.shift(); - if (record.error) { - this.pending = 0; - queue.clear(); - } else { - this.pending -= 1; - } - record.callback.call(record.context, record.error, record.message); - } -}; - -var functor = Functor$1; - -var RingBuffer = ring_buffer; - -var Pledge$2 = function() { - this._complete = false; - this._callbacks = new RingBuffer(Pledge$2.QUEUE_SIZE); -}; - -Pledge$2.QUEUE_SIZE = 4; - -Pledge$2.all = function(list) { - var pledge = new Pledge$2(), - pending = list.length, - n = pending; - - if (pending === 0) pledge.done(); - - while (n--) list[n].then(function() { - pending -= 1; - if (pending === 0) pledge.done(); - }); - return pledge; -}; - -Pledge$2.prototype.then = function(callback) { - if (this._complete) callback(); - else this._callbacks.push(callback); -}; - -Pledge$2.prototype.done = function() { - this._complete = true; - var callbacks = this._callbacks, callback; - while (callback = callbacks.shift()) callback(); -}; - -var pledge = Pledge$2; - -var Functor = functor, - Pledge$1 = pledge; - -var Cell$1 = function(tuple) { - this._ext = tuple[0]; - this._session = tuple[1]; - - this._functors = { - incoming: new Functor(this._session, 'processIncomingMessage'), - outgoing: new Functor(this._session, 'processOutgoingMessage') - }; -}; - -Cell$1.prototype.pending = function(direction) { - var functor = this._functors[direction]; - if (!functor._stopped) functor.pending += 1; -}; - -Cell$1.prototype.incoming = function(error, message, callback, context) { - this._exec('incoming', error, message, callback, context); -}; - -Cell$1.prototype.outgoing = function(error, message, callback, context) { - this._exec('outgoing', error, message, callback, context); -}; - -Cell$1.prototype.close = function() { - this._closed = this._closed || new Pledge$1(); - this._doClose(); - return this._closed; -}; - -Cell$1.prototype._exec = function(direction, error, message, callback, context) { - this._functors[direction].call(error, message, function(err, msg) { - if (err) err.message = this._ext.name + ': ' + err.message; - callback.call(context, err, msg); - this._doClose(); - }, this); -}; - -Cell$1.prototype._doClose = function() { - var fin = this._functors.incoming, - fout = this._functors.outgoing; - - if (!this._closed || fin.pending + fout.pending !== 0) return; - if (this._session) this._session.close(); - this._session = null; - this._closed.done(); -}; - -var cell = Cell$1; - -var Cell = cell, - Pledge = pledge; - -var Pipeline$1 = function(sessions) { - this._cells = sessions.map(function(session) { return new Cell(session) }); - this._stopped = { incoming: false, outgoing: false }; -}; - -Pipeline$1.prototype.processIncomingMessage = function(message, callback, context) { - if (this._stopped.incoming) return; - this._loop('incoming', this._cells.length - 1, -1, -1, message, callback, context); -}; - -Pipeline$1.prototype.processOutgoingMessage = function(message, callback, context) { - if (this._stopped.outgoing) return; - this._loop('outgoing', 0, this._cells.length, 1, message, callback, context); -}; - -Pipeline$1.prototype.close = function(callback, context) { - this._stopped = { incoming: true, outgoing: true }; - - var closed = this._cells.map(function(a) { return a.close() }); - if (callback) - Pledge.all(closed).then(function() { callback.call(context); }); -}; - -Pipeline$1.prototype._loop = function(direction, start, end, step, message, callback, context) { - var cells = this._cells, - n = cells.length, - self = this; - - while (n--) cells[n].pending(direction); - - var pipe = function(index, error, msg) { - if (index === end) return callback.call(context, error, msg); - - cells[index][direction](error, msg, function(err, m) { - if (err) self._stopped[direction] = true; - pipe(index + step, err, m); - }); - }; - pipe(start, null, message); -}; - -var pipeline = Pipeline$1; - -var Parser = parser, - Pipeline = pipeline; - -var Extensions$1 = function() { - this._rsv1 = this._rsv2 = this._rsv3 = null; - - this._byName = {}; - this._inOrder = []; - this._sessions = []; - this._index = {}; -}; - -Extensions$1.MESSAGE_OPCODES = [1, 2]; - -var instance$a = { - add: function(ext) { - if (typeof ext.name !== 'string') throw new TypeError('extension.name must be a string'); - if (ext.type !== 'permessage') throw new TypeError('extension.type must be "permessage"'); - - if (typeof ext.rsv1 !== 'boolean') throw new TypeError('extension.rsv1 must be true or false'); - if (typeof ext.rsv2 !== 'boolean') throw new TypeError('extension.rsv2 must be true or false'); - if (typeof ext.rsv3 !== 'boolean') throw new TypeError('extension.rsv3 must be true or false'); - - if (this._byName.hasOwnProperty(ext.name)) - throw new TypeError('An extension with name "' + ext.name + '" is already registered'); - - this._byName[ext.name] = ext; - this._inOrder.push(ext); - }, - - generateOffer: function() { - var sessions = [], - offer = [], - index = {}; - - this._inOrder.forEach(function(ext) { - var session = ext.createClientSession(); - if (!session) return; - - var record = [ext, session]; - sessions.push(record); - index[ext.name] = record; - - var offers = session.generateOffer(); - offers = offers ? [].concat(offers) : []; - - offers.forEach(function(off) { - offer.push(Parser.serializeParams(ext.name, off)); - }, this); - }, this); - - this._sessions = sessions; - this._index = index; - - return offer.length > 0 ? offer.join(', ') : null; - }, - - activate: function(header) { - var responses = Parser.parseHeader(header), - sessions = []; - - responses.eachOffer(function(name, params) { - var record = this._index[name]; - - if (!record) - throw new Error('Server sent an extension response for unknown extension "' + name + '"'); - - var ext = record[0], - session = record[1], - reserved = this._reserved(ext); - - if (reserved) - throw new Error('Server sent two extension responses that use the RSV' + - reserved[0] + ' bit: "' + - reserved[1] + '" and "' + ext.name + '"'); - - if (session.activate(params) !== true) - throw new Error('Server sent unacceptable extension parameters: ' + - Parser.serializeParams(name, params)); - - this._reserve(ext); - sessions.push(record); - }, this); - - this._sessions = sessions; - this._pipeline = new Pipeline(sessions); - }, - - generateResponse: function(header) { - var sessions = [], - response = [], - offers = Parser.parseHeader(header); - - this._inOrder.forEach(function(ext) { - var offer = offers.byName(ext.name); - if (offer.length === 0 || this._reserved(ext)) return; - - var session = ext.createServerSession(offer); - if (!session) return; - - this._reserve(ext); - sessions.push([ext, session]); - response.push(Parser.serializeParams(ext.name, session.generateResponse())); - }, this); - - this._sessions = sessions; - this._pipeline = new Pipeline(sessions); - - return response.length > 0 ? response.join(', ') : null; - }, - - validFrameRsv: function(frame) { - var allowed = { rsv1: false, rsv2: false, rsv3: false }, - ext; - - if (Extensions$1.MESSAGE_OPCODES.indexOf(frame.opcode) >= 0) { - for (var i = 0, n = this._sessions.length; i < n; i++) { - ext = this._sessions[i][0]; - allowed.rsv1 = allowed.rsv1 || ext.rsv1; - allowed.rsv2 = allowed.rsv2 || ext.rsv2; - allowed.rsv3 = allowed.rsv3 || ext.rsv3; - } - } - - return (allowed.rsv1 || !frame.rsv1) && - (allowed.rsv2 || !frame.rsv2) && - (allowed.rsv3 || !frame.rsv3); - }, - - processIncomingMessage: function(message, callback, context) { - this._pipeline.processIncomingMessage(message, callback, context); - }, - - processOutgoingMessage: function(message, callback, context) { - this._pipeline.processOutgoingMessage(message, callback, context); - }, - - close: function(callback, context) { - if (!this._pipeline) return callback.call(context); - this._pipeline.close(callback, context); - }, - - _reserve: function(ext) { - this._rsv1 = this._rsv1 || (ext.rsv1 && ext.name); - this._rsv2 = this._rsv2 || (ext.rsv2 && ext.name); - this._rsv3 = this._rsv3 || (ext.rsv3 && ext.name); - }, - - _reserved: function(ext) { - if (this._rsv1 && ext.rsv1) return [1, this._rsv1]; - if (this._rsv2 && ext.rsv2) return [2, this._rsv2]; - if (this._rsv3 && ext.rsv3) return [3, this._rsv3]; - return false; - } -}; - -for (var key$a in instance$a) - Extensions$1.prototype[key$a] = instance$a[key$a]; - -var websocket_extensions = Extensions$1; - -var Frame$1 = function() {}; - -var instance$9 = { - final: false, - rsv1: false, - rsv2: false, - rsv3: false, - opcode: null, - masked: false, - maskingKey: null, - lengthBytes: 1, - length: 0, - payload: null -}; - -for (var key$9 in instance$9) - Frame$1.prototype[key$9] = instance$9[key$9]; - -var frame = Frame$1; - -var Buffer$6 = safeBuffer.exports.Buffer; - -var Message$1 = function() { - this.rsv1 = false; - this.rsv2 = false; - this.rsv3 = false; - this.opcode = null; - this.length = 0; - this._chunks = []; -}; - -var instance$8 = { - read: function() { - return this.data = this.data || Buffer$6.concat(this._chunks, this.length); - }, - - pushFrame: function(frame) { - this.rsv1 = this.rsv1 || frame.rsv1; - this.rsv2 = this.rsv2 || frame.rsv2; - this.rsv3 = this.rsv3 || frame.rsv3; - - if (this.opcode === null) this.opcode = frame.opcode; - - this._chunks.push(frame.payload); - this.length += frame.length; - } -}; - -for (var key$8 in instance$8) - Message$1.prototype[key$8] = instance$8[key$8]; - -var message = Message$1; - -var Buffer$5 = safeBuffer.exports.Buffer, - crypto$2 = require$$1__default$1["default"], - util$a = require$$2__default["default"], - Extensions = websocket_extensions, - Base$6 = base, - Frame = frame, - Message = message; - -var Hybi$2 = function(request, url, options) { - Base$6.apply(this, arguments); - - this._extensions = new Extensions(); - this._stage = 0; - this._masking = this._options.masking; - this._protocols = this._options.protocols || []; - this._requireMasking = this._options.requireMasking; - this._pingCallbacks = {}; - - if (typeof this._protocols === 'string') - this._protocols = this._protocols.split(/ *, */); - - if (!this._request) return; - - var protos = this._request.headers['sec-websocket-protocol'], - supported = this._protocols; - - if (protos !== undefined) { - if (typeof protos === 'string') protos = protos.split(/ *, */); - this.protocol = protos.filter(function(p) { return supported.indexOf(p) >= 0 })[0]; - } - - this.version = 'hybi-' + Hybi$2.VERSION; -}; -util$a.inherits(Hybi$2, Base$6); - -Hybi$2.VERSION = '13'; - -Hybi$2.mask = function(payload, mask, offset) { - if (!mask || mask.length === 0) return payload; - offset = offset || 0; - - for (var i = 0, n = payload.length - offset; i < n; i++) { - payload[offset + i] = payload[offset + i] ^ mask[i % 4]; - } - return payload; -}; - -Hybi$2.generateAccept = function(key) { - var sha1 = crypto$2.createHash('sha1'); - sha1.update(key + Hybi$2.GUID); - return sha1.digest('base64'); -}; - -Hybi$2.GUID = '258EAFA5-E914-47DA-95CA-C5AB0DC85B11'; - -var instance$7 = { - FIN: 0x80, - MASK: 0x80, - RSV1: 0x40, - RSV2: 0x20, - RSV3: 0x10, - OPCODE: 0x0F, - LENGTH: 0x7F, - - OPCODES: { - continuation: 0, - text: 1, - binary: 2, - close: 8, - ping: 9, - pong: 10 - }, - - OPCODE_CODES: [0, 1, 2, 8, 9, 10], - MESSAGE_OPCODES: [0, 1, 2], - OPENING_OPCODES: [1, 2], - - ERRORS: { - normal_closure: 1000, - going_away: 1001, - protocol_error: 1002, - unacceptable: 1003, - encoding_error: 1007, - policy_violation: 1008, - too_large: 1009, - extension_error: 1010, - unexpected_condition: 1011 - }, - - ERROR_CODES: [1000, 1001, 1002, 1003, 1007, 1008, 1009, 1010, 1011], - DEFAULT_ERROR_CODE: 1000, - MIN_RESERVED_ERROR: 3000, - MAX_RESERVED_ERROR: 4999, - - // http://www.w3.org/International/questions/qa-forms-utf-8.en.php - UTF8_MATCH: /^([\x00-\x7F]|[\xC2-\xDF][\x80-\xBF]|\xE0[\xA0-\xBF][\x80-\xBF]|[\xE1-\xEC\xEE\xEF][\x80-\xBF]{2}|\xED[\x80-\x9F][\x80-\xBF]|\xF0[\x90-\xBF][\x80-\xBF]{2}|[\xF1-\xF3][\x80-\xBF]{3}|\xF4[\x80-\x8F][\x80-\xBF]{2})*$/, - - addExtension: function(extension) { - this._extensions.add(extension); - return true; - }, - - parse: function(chunk) { - this._reader.put(chunk); - var buffer = true; - while (buffer) { - switch (this._stage) { - case 0: - buffer = this._reader.read(1); - if (buffer) this._parseOpcode(buffer[0]); - break; - - case 1: - buffer = this._reader.read(1); - if (buffer) this._parseLength(buffer[0]); - break; - - case 2: - buffer = this._reader.read(this._frame.lengthBytes); - if (buffer) this._parseExtendedLength(buffer); - break; - - case 3: - buffer = this._reader.read(4); - if (buffer) { - this._stage = 4; - this._frame.maskingKey = buffer; - } - break; - - case 4: - buffer = this._reader.read(this._frame.length); - if (buffer) { - this._stage = 0; - this._emitFrame(buffer); - } - break; - - default: - buffer = null; - } - } - }, - - text: function(message) { - if (this.readyState > 1) return false; - return this.frame(message, 'text'); - }, - - binary: function(message) { - if (this.readyState > 1) return false; - return this.frame(message, 'binary'); - }, - - ping: function(message, callback) { - if (this.readyState > 1) return false; - message = message || ''; - if (callback) this._pingCallbacks[message] = callback; - return this.frame(message, 'ping'); - }, - - pong: function(message) { - if (this.readyState > 1) return false; - message = message ||''; - return this.frame(message, 'pong'); - }, - - close: function(reason, code) { - reason = reason || ''; - code = code || this.ERRORS.normal_closure; - - if (this.readyState <= 0) { - this.readyState = 3; - this.emit('close', new Base$6.CloseEvent(code, reason)); - return true; - } else if (this.readyState === 1) { - this.readyState = 2; - this._extensions.close(function() { this.frame(reason, 'close', code); }, this); - return true; - } else { - return false; - } - }, - - frame: function(buffer, type, code) { - if (this.readyState <= 0) return this._queue([buffer, type, code]); - if (this.readyState > 2) return false; - - if (buffer instanceof Array) buffer = Buffer$5.from(buffer); - if (typeof buffer === 'number') buffer = buffer.toString(); - - var message = new Message(), - isText = (typeof buffer === 'string'), - payload, copy; - - message.rsv1 = message.rsv2 = message.rsv3 = false; - message.opcode = this.OPCODES[type || (isText ? 'text' : 'binary')]; - - payload = isText ? Buffer$5.from(buffer, 'utf8') : buffer; - - if (code) { - copy = payload; - payload = Buffer$5.allocUnsafe(2 + copy.length); - payload.writeUInt16BE(code, 0); - copy.copy(payload, 2); - } - message.data = payload; - - var onMessageReady = function(message) { - var frame = new Frame(); - - frame.final = true; - frame.rsv1 = message.rsv1; - frame.rsv2 = message.rsv2; - frame.rsv3 = message.rsv3; - frame.opcode = message.opcode; - frame.masked = !!this._masking; - frame.length = message.data.length; - frame.payload = message.data; - - if (frame.masked) frame.maskingKey = crypto$2.randomBytes(4); - - this._sendFrame(frame); - }; - - if (this.MESSAGE_OPCODES.indexOf(message.opcode) >= 0) - this._extensions.processOutgoingMessage(message, function(error, message) { - if (error) return this._fail('extension_error', error.message); - onMessageReady.call(this, message); - }, this); - else - onMessageReady.call(this, message); - - return true; - }, - - _sendFrame: function(frame) { - var length = frame.length, - header = (length <= 125) ? 2 : (length <= 65535 ? 4 : 10), - offset = header + (frame.masked ? 4 : 0), - buffer = Buffer$5.allocUnsafe(offset + length), - masked = frame.masked ? this.MASK : 0; - - buffer[0] = (frame.final ? this.FIN : 0) | - (frame.rsv1 ? this.RSV1 : 0) | - (frame.rsv2 ? this.RSV2 : 0) | - (frame.rsv3 ? this.RSV3 : 0) | - frame.opcode; - - if (length <= 125) { - buffer[1] = masked | length; - } else if (length <= 65535) { - buffer[1] = masked | 126; - buffer.writeUInt16BE(length, 2); - } else { - buffer[1] = masked | 127; - buffer.writeUInt32BE(Math.floor(length / 0x100000000), 2); - buffer.writeUInt32BE(length % 0x100000000, 6); - } - - frame.payload.copy(buffer, offset); - - if (frame.masked) { - frame.maskingKey.copy(buffer, header); - Hybi$2.mask(buffer, frame.maskingKey, offset); - } - - this._write(buffer); - }, - - _handshakeResponse: function() { - var secKey = this._request.headers['sec-websocket-key'], - version = this._request.headers['sec-websocket-version']; - - if (version !== Hybi$2.VERSION) - throw new Error('Unsupported WebSocket version: ' + version); - - if (typeof secKey !== 'string') - throw new Error('Missing handshake request header: Sec-WebSocket-Key'); - - this._headers.set('Upgrade', 'websocket'); - this._headers.set('Connection', 'Upgrade'); - this._headers.set('Sec-WebSocket-Accept', Hybi$2.generateAccept(secKey)); - - if (this.protocol) this._headers.set('Sec-WebSocket-Protocol', this.protocol); - - var extensions = this._extensions.generateResponse(this._request.headers['sec-websocket-extensions']); - if (extensions) this._headers.set('Sec-WebSocket-Extensions', extensions); - - var start = 'HTTP/1.1 101 Switching Protocols', - headers = [start, this._headers.toString(), '']; - - return Buffer$5.from(headers.join('\r\n'), 'utf8'); - }, - - _shutdown: function(code, reason, error) { - delete this._frame; - delete this._message; - this._stage = 5; - - var sendCloseFrame = (this.readyState === 1); - this.readyState = 2; - - this._extensions.close(function() { - if (sendCloseFrame) this.frame(reason, 'close', code); - this.readyState = 3; - if (error) this.emit('error', new Error(reason)); - this.emit('close', new Base$6.CloseEvent(code, reason)); - }, this); - }, - - _fail: function(type, message) { - if (this.readyState > 1) return; - this._shutdown(this.ERRORS[type], message, true); - }, - - _parseOpcode: function(octet) { - var rsvs = [this.RSV1, this.RSV2, this.RSV3].map(function(rsv) { - return (octet & rsv) === rsv; - }); - - var frame = this._frame = new Frame(); - - frame.final = (octet & this.FIN) === this.FIN; - frame.rsv1 = rsvs[0]; - frame.rsv2 = rsvs[1]; - frame.rsv3 = rsvs[2]; - frame.opcode = (octet & this.OPCODE); - - this._stage = 1; - - if (!this._extensions.validFrameRsv(frame)) - return this._fail('protocol_error', - 'One or more reserved bits are on: reserved1 = ' + (frame.rsv1 ? 1 : 0) + - ', reserved2 = ' + (frame.rsv2 ? 1 : 0) + - ', reserved3 = ' + (frame.rsv3 ? 1 : 0)); - - if (this.OPCODE_CODES.indexOf(frame.opcode) < 0) - return this._fail('protocol_error', 'Unrecognized frame opcode: ' + frame.opcode); - - if (this.MESSAGE_OPCODES.indexOf(frame.opcode) < 0 && !frame.final) - return this._fail('protocol_error', 'Received fragmented control frame: opcode = ' + frame.opcode); - - if (this._message && this.OPENING_OPCODES.indexOf(frame.opcode) >= 0) - return this._fail('protocol_error', 'Received new data frame but previous continuous frame is unfinished'); - }, - - _parseLength: function(octet) { - var frame = this._frame; - frame.masked = (octet & this.MASK) === this.MASK; - frame.length = (octet & this.LENGTH); - - if (frame.length >= 0 && frame.length <= 125) { - this._stage = frame.masked ? 3 : 4; - if (!this._checkFrameLength()) return; - } else { - this._stage = 2; - frame.lengthBytes = (frame.length === 126 ? 2 : 8); - } - - if (this._requireMasking && !frame.masked) - return this._fail('unacceptable', 'Received unmasked frame but masking is required'); - }, - - _parseExtendedLength: function(buffer) { - var frame = this._frame; - frame.length = this._readUInt(buffer); - - this._stage = frame.masked ? 3 : 4; - - if (this.MESSAGE_OPCODES.indexOf(frame.opcode) < 0 && frame.length > 125) - return this._fail('protocol_error', 'Received control frame having too long payload: ' + frame.length); - - if (!this._checkFrameLength()) return; - }, - - _checkFrameLength: function() { - var length = this._message ? this._message.length : 0; - - if (length + this._frame.length > this._maxLength) { - this._fail('too_large', 'WebSocket frame length too large'); - return false; - } else { - return true; - } - }, - - _emitFrame: function(buffer) { - var frame = this._frame, - payload = frame.payload = Hybi$2.mask(buffer, frame.maskingKey), - opcode = frame.opcode, - message, - code, reason, - callbacks, callback; - - delete this._frame; - - if (opcode === this.OPCODES.continuation) { - if (!this._message) return this._fail('protocol_error', 'Received unexpected continuation frame'); - this._message.pushFrame(frame); - } - - if (opcode === this.OPCODES.text || opcode === this.OPCODES.binary) { - this._message = new Message(); - this._message.pushFrame(frame); - } - - if (frame.final && this.MESSAGE_OPCODES.indexOf(opcode) >= 0) - return this._emitMessage(this._message); - - if (opcode === this.OPCODES.close) { - code = (payload.length >= 2) ? payload.readUInt16BE(0) : null; - reason = (payload.length > 2) ? this._encode(payload.slice(2)) : null; - - if (!(payload.length === 0) && - !(code !== null && code >= this.MIN_RESERVED_ERROR && code <= this.MAX_RESERVED_ERROR) && - this.ERROR_CODES.indexOf(code) < 0) - code = this.ERRORS.protocol_error; - - if (payload.length > 125 || (payload.length > 2 && !reason)) - code = this.ERRORS.protocol_error; - - this._shutdown(code || this.DEFAULT_ERROR_CODE, reason || ''); - } - - if (opcode === this.OPCODES.ping) { - this.frame(payload, 'pong'); - this.emit('ping', new Base$6.PingEvent(payload.toString())); - } - - if (opcode === this.OPCODES.pong) { - callbacks = this._pingCallbacks; - message = this._encode(payload); - callback = callbacks[message]; - - delete callbacks[message]; - if (callback) callback(); - - this.emit('pong', new Base$6.PongEvent(payload.toString())); - } - }, - - _emitMessage: function(message) { - var message = this._message; - message.read(); - - delete this._message; - - this._extensions.processIncomingMessage(message, function(error, message) { - if (error) return this._fail('extension_error', error.message); - - var payload = message.data; - if (message.opcode === this.OPCODES.text) payload = this._encode(payload); - - if (payload === null) - return this._fail('encoding_error', 'Could not decode a text frame as UTF-8'); - else - this.emit('message', new Base$6.MessageEvent(payload)); - }, this); - }, - - _encode: function(buffer) { - try { - var string = buffer.toString('binary', 0, buffer.length); - if (!this.UTF8_MATCH.test(string)) return null; - } catch (e) {} - return buffer.toString('utf8', 0, buffer.length); - }, - - _readUInt: function(buffer) { - if (buffer.length === 2) return buffer.readUInt16BE(0); - - return buffer.readUInt32BE(0) * 0x100000000 + - buffer.readUInt32BE(4); - } -}; - -for (var key$7 in instance$7) - Hybi$2.prototype[key$7] = instance$7[key$7]; - -var hybi = Hybi$2; - -var Buffer$4 = safeBuffer.exports.Buffer, - Stream$2 = require$$0__default$1["default"].Stream, - url$2 = require$$2__default$1["default"], - util$9 = require$$2__default["default"], - Base$5 = base, - Headers$1 = headers, - HttpParser$2 = http_parser; - -var PORTS = { 'ws:': 80, 'wss:': 443 }; - -var Proxy$1 = function(client, origin, options) { - this._client = client; - this._http = new HttpParser$2('response'); - this._origin = (typeof client.url === 'object') ? client.url : url$2.parse(client.url); - this._url = (typeof origin === 'object') ? origin : url$2.parse(origin); - this._options = options || {}; - this._state = 0; - - this.readable = this.writable = true; - this._paused = false; - - this._headers = new Headers$1(); - this._headers.set('Host', this._origin.host); - this._headers.set('Connection', 'keep-alive'); - this._headers.set('Proxy-Connection', 'keep-alive'); - - var auth = this._url.auth && Buffer$4.from(this._url.auth, 'utf8').toString('base64'); - if (auth) this._headers.set('Proxy-Authorization', 'Basic ' + auth); -}; -util$9.inherits(Proxy$1, Stream$2); - -var instance$6 = { - setHeader: function(name, value) { - if (this._state !== 0) return false; - this._headers.set(name, value); - return true; - }, - - start: function() { - if (this._state !== 0) return false; - this._state = 1; - - var origin = this._origin, - port = origin.port || PORTS[origin.protocol], - start = 'CONNECT ' + origin.hostname + ':' + port + ' HTTP/1.1'; - - var headers = [start, this._headers.toString(), '']; - - this.emit('data', Buffer$4.from(headers.join('\r\n'), 'utf8')); - return true; - }, - - pause: function() { - this._paused = true; - }, - - resume: function() { - this._paused = false; - this.emit('drain'); - }, - - write: function(chunk) { - if (!this.writable) return false; - - this._http.parse(chunk); - if (!this._http.isComplete()) return !this._paused; - - this.statusCode = this._http.statusCode; - this.headers = this._http.headers; - - if (this.statusCode === 200) { - this.emit('connect', new Base$5.ConnectEvent()); - } else { - var message = "Can't establish a connection to the server at " + this._origin.href; - this.emit('error', new Error(message)); - } - this.end(); - return !this._paused; - }, - - end: function(chunk) { - if (!this.writable) return; - if (chunk !== undefined) this.write(chunk); - this.readable = this.writable = false; - this.emit('close'); - this.emit('end'); - }, - - destroy: function() { - this.end(); - } -}; - -for (var key$6 in instance$6) - Proxy$1.prototype[key$6] = instance$6[key$6]; - -var proxy = Proxy$1; - -var Buffer$3 = safeBuffer.exports.Buffer, - crypto$1 = require$$1__default$1["default"], - url$1 = require$$2__default$1["default"], - util$8 = require$$2__default["default"], - HttpParser$1 = http_parser, - Base$4 = base, - Hybi$1 = hybi, - Proxy = proxy; - -var Client$2 = function(_url, options) { - this.version = 'hybi-' + Hybi$1.VERSION; - Hybi$1.call(this, null, _url, options); - - this.readyState = -1; - this._key = Client$2.generateKey(); - this._accept = Hybi$1.generateAccept(this._key); - this._http = new HttpParser$1('response'); - - var uri = url$1.parse(this.url), - auth = uri.auth && Buffer$3.from(uri.auth, 'utf8').toString('base64'); - - if (this.VALID_PROTOCOLS.indexOf(uri.protocol) < 0) - throw new Error(this.url + ' is not a valid WebSocket URL'); - - this._pathname = (uri.pathname || '/') + (uri.search || ''); - - this._headers.set('Host', uri.host); - this._headers.set('Upgrade', 'websocket'); - this._headers.set('Connection', 'Upgrade'); - this._headers.set('Sec-WebSocket-Key', this._key); - this._headers.set('Sec-WebSocket-Version', Hybi$1.VERSION); - - if (this._protocols.length > 0) - this._headers.set('Sec-WebSocket-Protocol', this._protocols.join(', ')); - - if (auth) - this._headers.set('Authorization', 'Basic ' + auth); -}; -util$8.inherits(Client$2, Hybi$1); - -Client$2.generateKey = function() { - return crypto$1.randomBytes(16).toString('base64'); -}; - -var instance$5 = { - VALID_PROTOCOLS: ['ws:', 'wss:'], - - proxy: function(origin, options) { - return new Proxy(this, origin, options); - }, - - start: function() { - if (this.readyState !== -1) return false; - this._write(this._handshakeRequest()); - this.readyState = 0; - return true; - }, - - parse: function(chunk) { - if (this.readyState === 3) return; - if (this.readyState > 0) return Hybi$1.prototype.parse.call(this, chunk); - - this._http.parse(chunk); - if (!this._http.isComplete()) return; - - this._validateHandshake(); - if (this.readyState === 3) return; - - this._open(); - this.parse(this._http.body); - }, - - _handshakeRequest: function() { - var extensions = this._extensions.generateOffer(); - if (extensions) - this._headers.set('Sec-WebSocket-Extensions', extensions); - - var start = 'GET ' + this._pathname + ' HTTP/1.1', - headers = [start, this._headers.toString(), '']; - - return Buffer$3.from(headers.join('\r\n'), 'utf8'); - }, - - _failHandshake: function(message) { - message = 'Error during WebSocket handshake: ' + message; - this.readyState = 3; - this.emit('error', new Error(message)); - this.emit('close', new Base$4.CloseEvent(this.ERRORS.protocol_error, message)); - }, - - _validateHandshake: function() { - this.statusCode = this._http.statusCode; - this.headers = this._http.headers; - - if (this._http.error) - return this._failHandshake(this._http.error.message); - - if (this._http.statusCode !== 101) - return this._failHandshake('Unexpected response code: ' + this._http.statusCode); - - var headers = this._http.headers, - upgrade = headers['upgrade'] || '', - connection = headers['connection'] || '', - accept = headers['sec-websocket-accept'] || '', - protocol = headers['sec-websocket-protocol'] || ''; - - if (upgrade === '') - return this._failHandshake("'Upgrade' header is missing"); - if (upgrade.toLowerCase() !== 'websocket') - return this._failHandshake("'Upgrade' header value is not 'WebSocket'"); - - if (connection === '') - return this._failHandshake("'Connection' header is missing"); - if (connection.toLowerCase() !== 'upgrade') - return this._failHandshake("'Connection' header value is not 'Upgrade'"); - - if (accept !== this._accept) - return this._failHandshake('Sec-WebSocket-Accept mismatch'); - - this.protocol = null; - - if (protocol !== '') { - if (this._protocols.indexOf(protocol) < 0) - return this._failHandshake('Sec-WebSocket-Protocol mismatch'); - else - this.protocol = protocol; - } - - try { - this._extensions.activate(this.headers['sec-websocket-extensions']); - } catch (e) { - return this._failHandshake(e.message); - } - } -}; - -for (var key$5 in instance$5) - Client$2.prototype[key$5] = instance$5[key$5]; - -var client$1 = Client$2; - -var Buffer$2 = safeBuffer.exports.Buffer, - Base$3 = base, - util$7 = require$$2__default["default"]; - -var Draft75$2 = function(request, url, options) { - Base$3.apply(this, arguments); - this._stage = 0; - this.version = 'hixie-75'; - - this._headers.set('Upgrade', 'WebSocket'); - this._headers.set('Connection', 'Upgrade'); - this._headers.set('WebSocket-Origin', this._request.headers.origin); - this._headers.set('WebSocket-Location', this.url); -}; -util$7.inherits(Draft75$2, Base$3); - -var instance$4 = { - close: function() { - if (this.readyState === 3) return false; - this.readyState = 3; - this.emit('close', new Base$3.CloseEvent(null, null)); - return true; - }, - - parse: function(chunk) { - if (this.readyState > 1) return; - - this._reader.put(chunk); - - this._reader.eachByte(function(octet) { - var message; - - switch (this._stage) { - case -1: - this._body.push(octet); - this._sendHandshakeBody(); - break; - - case 0: - this._parseLeadingByte(octet); - break; - - case 1: - this._length = (octet & 0x7F) + 128 * this._length; - - if (this._closing && this._length === 0) { - return this.close(); - } - else if ((octet & 0x80) !== 0x80) { - if (this._length === 0) { - this._stage = 0; - } - else { - this._skipped = 0; - this._stage = 2; - } - } - break; - - case 2: - if (octet === 0xFF) { - this._stage = 0; - message = Buffer$2.from(this._buffer).toString('utf8', 0, this._buffer.length); - this.emit('message', new Base$3.MessageEvent(message)); - } - else { - if (this._length) { - this._skipped += 1; - if (this._skipped === this._length) - this._stage = 0; - } else { - this._buffer.push(octet); - if (this._buffer.length > this._maxLength) return this.close(); - } - } - break; - } - }, this); - }, - - frame: function(buffer) { - if (this.readyState === 0) return this._queue([buffer]); - if (this.readyState > 1) return false; - - if (typeof buffer !== 'string') buffer = buffer.toString(); - - var length = Buffer$2.byteLength(buffer), - frame = Buffer$2.allocUnsafe(length + 2); - - frame[0] = 0x00; - frame.write(buffer, 1); - frame[frame.length - 1] = 0xFF; - - this._write(frame); - return true; - }, - - _handshakeResponse: function() { - var start = 'HTTP/1.1 101 Web Socket Protocol Handshake', - headers = [start, this._headers.toString(), '']; - - return Buffer$2.from(headers.join('\r\n'), 'utf8'); - }, - - _parseLeadingByte: function(octet) { - if ((octet & 0x80) === 0x80) { - this._length = 0; - this._stage = 1; - } else { - delete this._length; - delete this._skipped; - this._buffer = []; - this._stage = 2; - } - } -}; - -for (var key$4 in instance$4) - Draft75$2.prototype[key$4] = instance$4[key$4]; - -var draft75 = Draft75$2; - -var Buffer$1 = safeBuffer.exports.Buffer, - Base$2 = base, - Draft75$1 = draft75, - crypto = require$$1__default$1["default"], - util$6 = require$$2__default["default"]; - - -var numberFromKey = function(key) { - return parseInt((key.match(/[0-9]/g) || []).join(''), 10); -}; - -var spacesInKey = function(key) { - return (key.match(/ /g) || []).length; -}; - - -var Draft76$1 = function(request, url, options) { - Draft75$1.apply(this, arguments); - this._stage = -1; - this._body = []; - this.version = 'hixie-76'; - - this._headers.clear(); - - this._headers.set('Upgrade', 'WebSocket'); - this._headers.set('Connection', 'Upgrade'); - this._headers.set('Sec-WebSocket-Origin', this._request.headers.origin); - this._headers.set('Sec-WebSocket-Location', this.url); -}; -util$6.inherits(Draft76$1, Draft75$1); - -var instance$3 = { - BODY_SIZE: 8, - - start: function() { - if (!Draft75$1.prototype.start.call(this)) return false; - this._started = true; - this._sendHandshakeBody(); - return true; - }, - - close: function() { - if (this.readyState === 3) return false; - if (this.readyState === 1) this._write(Buffer$1.from([0xFF, 0x00])); - this.readyState = 3; - this.emit('close', new Base$2.CloseEvent(null, null)); - return true; - }, - - _handshakeResponse: function() { - var headers = this._request.headers, - key1 = headers['sec-websocket-key1'], - key2 = headers['sec-websocket-key2']; - - if (!key1) throw new Error('Missing required header: Sec-WebSocket-Key1'); - if (!key2) throw new Error('Missing required header: Sec-WebSocket-Key2'); - - var number1 = numberFromKey(key1), - spaces1 = spacesInKey(key1), - - number2 = numberFromKey(key2), - spaces2 = spacesInKey(key2); - - if (number1 % spaces1 !== 0 || number2 % spaces2 !== 0) - throw new Error('Client sent invalid Sec-WebSocket-Key headers'); - - this._keyValues = [number1 / spaces1, number2 / spaces2]; - - var start = 'HTTP/1.1 101 WebSocket Protocol Handshake', - headers = [start, this._headers.toString(), '']; - - return Buffer$1.from(headers.join('\r\n'), 'binary'); - }, - - _handshakeSignature: function() { - if (this._body.length < this.BODY_SIZE) return null; - - var md5 = crypto.createHash('md5'), - buffer = Buffer$1.allocUnsafe(8 + this.BODY_SIZE); - - buffer.writeUInt32BE(this._keyValues[0], 0); - buffer.writeUInt32BE(this._keyValues[1], 4); - Buffer$1.from(this._body).copy(buffer, 8, 0, this.BODY_SIZE); - - md5.update(buffer); - return Buffer$1.from(md5.digest('binary'), 'binary'); - }, - - _sendHandshakeBody: function() { - if (!this._started) return; - var signature = this._handshakeSignature(); - if (!signature) return; - - this._write(signature); - this._stage = 0; - this._open(); - - if (this._body.length > this.BODY_SIZE) - this.parse(this._body.slice(this.BODY_SIZE)); - }, - - _parseLeadingByte: function(octet) { - if (octet !== 0xFF) - return Draft75$1.prototype._parseLeadingByte.call(this, octet); - - this._closing = true; - this._length = 0; - this._stage = 1; - } -}; - -for (var key$3 in instance$3) - Draft76$1.prototype[key$3] = instance$3[key$3]; - -var draft76 = Draft76$1; - -var util$5 = require$$2__default["default"], - HttpParser = http_parser, - Base$1 = base, - Draft75 = draft75, - Draft76 = draft76, - Hybi = hybi; - -var Server$1 = function(options) { - Base$1.call(this, null, null, options); - this._http = new HttpParser('request'); -}; -util$5.inherits(Server$1, Base$1); - -var instance$2 = { - EVENTS: ['open', 'message', 'error', 'close', 'ping', 'pong'], - - _bindEventListeners: function() { - this.messages.on('error', function() {}); - this.on('error', function() {}); - }, - - parse: function(chunk) { - if (this._delegate) return this._delegate.parse(chunk); - - this._http.parse(chunk); - if (!this._http.isComplete()) return; - - this.method = this._http.method; - this.url = this._http.url; - this.headers = this._http.headers; - this.body = this._http.body; - - var self = this; - this._delegate = Server$1.http(this, this._options); - this._delegate.messages = this.messages; - this._delegate.io = this.io; - this._open(); - - this.EVENTS.forEach(function(event) { - this._delegate.on(event, function(e) { self.emit(event, e); }); - }, this); - - this.protocol = this._delegate.protocol; - this.version = this._delegate.version; - - this.parse(this._http.body); - this.emit('connect', new Base$1.ConnectEvent()); - }, - - _open: function() { - this.__queue.forEach(function(msg) { - this._delegate[msg[0]].apply(this._delegate, msg[1]); - }, this); - this.__queue = []; - } -}; - -['addExtension', 'setHeader', 'start', 'frame', 'text', 'binary', 'ping', 'close'].forEach(function(method) { - instance$2[method] = function() { - if (this._delegate) { - return this._delegate[method].apply(this._delegate, arguments); - } else { - this.__queue.push([method, arguments]); - return true; - } - }; -}); - -for (var key$2 in instance$2) - Server$1.prototype[key$2] = instance$2[key$2]; - -Server$1.isSecureRequest = function(request) { - if (request.connection && request.connection.authorized !== undefined) return true; - if (request.socket && request.socket.secure) return true; - - var headers = request.headers; - if (!headers) return false; - if (headers['https'] === 'on') return true; - if (headers['x-forwarded-ssl'] === 'on') return true; - if (headers['x-forwarded-scheme'] === 'https') return true; - if (headers['x-forwarded-proto'] === 'https') return true; - - return false; -}; - -Server$1.determineUrl = function(request) { - var scheme = this.isSecureRequest(request) ? 'wss:' : 'ws:'; - return scheme + '//' + request.headers.host + request.url; -}; - -Server$1.http = function(request, options) { - options = options || {}; - if (options.requireMasking === undefined) options.requireMasking = true; - - var headers = request.headers, - version = headers['sec-websocket-version'], - key = headers['sec-websocket-key'], - key1 = headers['sec-websocket-key1'], - key2 = headers['sec-websocket-key2'], - url = this.determineUrl(request); - - if (version || key) - return new Hybi(request, url, options); - else if (key1 || key2) - return new Draft76(request, url, options); - else - return new Draft75(request, url, options); -}; - -var server = Server$1; - -// Protocol references: -// -// * http://tools.ietf.org/html/draft-hixie-thewebsocketprotocol-75 -// * http://tools.ietf.org/html/draft-hixie-thewebsocketprotocol-76 -// * http://tools.ietf.org/html/draft-ietf-hybi-thewebsocketprotocol-17 - -var Base = base, - Client$1 = client$1, - Server = server; - -var Driver = { - client: function(url, options) { - options = options || {}; - if (options.masking === undefined) options.masking = true; - return new Client$1(url, options); - }, - - server: function(options) { - options = options || {}; - if (options.requireMasking === undefined) options.requireMasking = true; - return new Server(options); - }, - - http: function() { - return Server.http.apply(Server, arguments); - }, - - isSecureRequest: function(request) { - return Server.isSecureRequest(request); - }, - - isWebSocket: function(request) { - return Base.isWebSocket(request); - }, - - validateOptions: function(options, validKeys) { - Base.validateOptions(options, validKeys); - } -}; - -var driver$4 = Driver; - -var Event$3 = function(eventType, options) { - this.type = eventType; - for (var key in options) - this[key] = options[key]; -}; - -Event$3.prototype.initEvent = function(eventType, canBubble, cancelable) { - this.type = eventType; - this.bubbles = canBubble; - this.cancelable = cancelable; -}; - -Event$3.prototype.stopPropagation = function() {}; -Event$3.prototype.preventDefault = function() {}; - -Event$3.CAPTURING_PHASE = 1; -Event$3.AT_TARGET = 2; -Event$3.BUBBLING_PHASE = 3; - -var event = Event$3; - -var Event$2 = event; - -var EventTarget$2 = { - onopen: null, - onmessage: null, - onerror: null, - onclose: null, - - addEventListener: function(eventType, listener, useCapture) { - this.on(eventType, listener); - }, - - removeEventListener: function(eventType, listener, useCapture) { - this.removeListener(eventType, listener); - }, - - dispatchEvent: function(event) { - event.target = event.currentTarget = this; - event.eventPhase = Event$2.AT_TARGET; - - if (this['on' + event.type]) - this['on' + event.type](event); - - this.emit(event.type, event); - } -}; - -var event_target = EventTarget$2; - -var Stream$1 = require$$0__default$1["default"].Stream, - util$4 = require$$2__default["default"], - driver$3 = driver$4, - EventTarget$1 = event_target, - Event$1 = event; - -var API$3 = function(options) { - options = options || {}; - driver$3.validateOptions(options, ['headers', 'extensions', 'maxLength', 'ping', 'proxy', 'tls', 'ca']); - - this.readable = this.writable = true; - - var headers = options.headers; - if (headers) { - for (var name in headers) this._driver.setHeader(name, headers[name]); - } - - var extensions = options.extensions; - if (extensions) { - [].concat(extensions).forEach(this._driver.addExtension, this._driver); - } - - this._ping = options.ping; - this._pingId = 0; - this.readyState = API$3.CONNECTING; - this.bufferedAmount = 0; - this.protocol = ''; - this.url = this._driver.url; - this.version = this._driver.version; - - var self = this; - - this._driver.on('open', function(e) { self._open(); }); - this._driver.on('message', function(e) { self._receiveMessage(e.data); }); - this._driver.on('close', function(e) { self._beginClose(e.reason, e.code); }); - - this._driver.on('error', function(error) { - self._emitError(error.message); - }); - this.on('error', function() {}); - - this._driver.messages.on('drain', function() { - self.emit('drain'); - }); - - if (this._ping) - this._pingTimer = setInterval(function() { - self._pingId += 1; - self.ping(self._pingId.toString()); - }, this._ping * 1000); - - this._configureStream(); - - if (!this._proxy) { - this._stream.pipe(this._driver.io); - this._driver.io.pipe(this._stream); - } -}; -util$4.inherits(API$3, Stream$1); - -API$3.CONNECTING = 0; -API$3.OPEN = 1; -API$3.CLOSING = 2; -API$3.CLOSED = 3; - -API$3.CLOSE_TIMEOUT = 30000; - -var instance$1 = { - write: function(data) { - return this.send(data); - }, - - end: function(data) { - if (data !== undefined) this.send(data); - this.close(); - }, - - pause: function() { - return this._driver.messages.pause(); - }, - - resume: function() { - return this._driver.messages.resume(); - }, - - send: function(data) { - if (this.readyState > API$3.OPEN) return false; - if (!(data instanceof Buffer)) data = String(data); - return this._driver.messages.write(data); - }, - - ping: function(message, callback) { - if (this.readyState > API$3.OPEN) return false; - return this._driver.ping(message, callback); - }, - - close: function(code, reason) { - if (code === undefined) code = 1000; - if (reason === undefined) reason = ''; - - if (code !== 1000 && (code < 3000 || code > 4999)) - throw new Error("Failed to execute 'close' on WebSocket: " + - "The code must be either 1000, or between 3000 and 4999. " + - code + " is neither."); - - if (this.readyState < API$3.CLOSING) { - var self = this; - this._closeTimer = setTimeout(function() { - self._beginClose('', 1006); - }, API$3.CLOSE_TIMEOUT); - } - - if (this.readyState !== API$3.CLOSED) this.readyState = API$3.CLOSING; - - this._driver.close(reason, code); - }, - - _configureStream: function() { - var self = this; - - this._stream.setTimeout(0); - this._stream.setNoDelay(true); - - ['close', 'end'].forEach(function(event) { - this._stream.on(event, function() { self._finalizeClose(); }); - }, this); - - this._stream.on('error', function(error) { - self._emitError('Network error: ' + self.url + ': ' + error.message); - self._finalizeClose(); - }); - }, - - _open: function() { - if (this.readyState !== API$3.CONNECTING) return; - - this.readyState = API$3.OPEN; - this.protocol = this._driver.protocol || ''; - - var event = new Event$1('open'); - event.initEvent('open', false, false); - this.dispatchEvent(event); - }, - - _receiveMessage: function(data) { - if (this.readyState > API$3.OPEN) return false; - - if (this.readable) this.emit('data', data); - - var event = new Event$1('message', { data: data }); - event.initEvent('message', false, false); - this.dispatchEvent(event); - }, - - _emitError: function(message) { - if (this.readyState >= API$3.CLOSING) return; - - var event = new Event$1('error', { message: message }); - event.initEvent('error', false, false); - this.dispatchEvent(event); - }, - - _beginClose: function(reason, code) { - if (this.readyState === API$3.CLOSED) return; - this.readyState = API$3.CLOSING; - this._closeParams = [reason, code]; - - if (this._stream) { - this._stream.destroy(); - if (!this._stream.readable) this._finalizeClose(); - } - }, - - _finalizeClose: function() { - if (this.readyState === API$3.CLOSED) return; - this.readyState = API$3.CLOSED; - - if (this._closeTimer) clearTimeout(this._closeTimer); - if (this._pingTimer) clearInterval(this._pingTimer); - if (this._stream) this._stream.end(); - - if (this.readable) this.emit('end'); - this.readable = this.writable = false; - - var reason = this._closeParams ? this._closeParams[0] : '', - code = this._closeParams ? this._closeParams[1] : 1006; - - var event = new Event$1('close', { code: code, reason: reason }); - event.initEvent('close', false, false); - this.dispatchEvent(event); - } -}; - -for (var method$1 in instance$1) API$3.prototype[method$1] = instance$1[method$1]; -for (var key$1 in EventTarget$1) API$3.prototype[key$1] = EventTarget$1[key$1]; - -var api = API$3; - -var util$3 = require$$2__default["default"], - net = require$$1__default$2["default"], - tls = require$$2__default$2["default"], - url = require$$2__default$1["default"], - driver$2 = driver$4, - API$2 = api; - -var DEFAULT_PORTS = { 'http:': 80, 'https:': 443, 'ws:':80, 'wss:': 443 }, - SECURE_PROTOCOLS = ['https:', 'wss:']; - -var Client = function(_url, protocols, options) { - options = options || {}; - - this.url = _url; - this._driver = driver$2.client(this.url, { maxLength: options.maxLength, protocols: protocols }); - - ['open', 'error'].forEach(function(event) { - this._driver.on(event, function() { - self.headers = self._driver.headers; - self.statusCode = self._driver.statusCode; - }); - }, this); - - var proxy = options.proxy || {}, - endpoint = url.parse(proxy.origin || this.url), - port = endpoint.port || DEFAULT_PORTS[endpoint.protocol], - secure = SECURE_PROTOCOLS.indexOf(endpoint.protocol) >= 0, - onConnect = function() { self._onConnect(); }, - netOptions = options.net || {}, - originTLS = options.tls || {}, - socketTLS = proxy.origin ? (proxy.tls || {}) : originTLS, - self = this; - - netOptions.host = socketTLS.host = endpoint.hostname; - netOptions.port = socketTLS.port = port; - - originTLS.ca = originTLS.ca || options.ca; - socketTLS.servername = socketTLS.servername || endpoint.hostname; - - this._stream = secure - ? tls.connect(socketTLS, onConnect) - : net.connect(netOptions, onConnect); - - if (proxy.origin) this._configureProxy(proxy, originTLS); - - API$2.call(this, options); -}; -util$3.inherits(Client, API$2); - -Client.prototype._onConnect = function() { - var worker = this._proxy || this._driver; - worker.start(); -}; - -Client.prototype._configureProxy = function(proxy, originTLS) { - var uri = url.parse(this.url), - secure = SECURE_PROTOCOLS.indexOf(uri.protocol) >= 0, - self = this, - name; - - this._proxy = this._driver.proxy(proxy.origin); - - if (proxy.headers) { - for (name in proxy.headers) this._proxy.setHeader(name, proxy.headers[name]); - } - - this._proxy.pipe(this._stream, { end: false }); - this._stream.pipe(this._proxy); - - this._proxy.on('connect', function() { - if (secure) { - var options = { socket: self._stream, servername: uri.hostname }; - for (name in originTLS) options[name] = originTLS[name]; - self._stream = tls.connect(options); - self._configureStream(); - } - self._driver.io.pipe(self._stream); - self._stream.pipe(self._driver.io); - self._driver.start(); - }); - - this._proxy.on('error', function(error) { - self._driver.emit('error', error); - }); -}; - -var client = Client; - -var Stream = require$$0__default$1["default"].Stream, - util$2 = require$$2__default["default"], - driver$1 = driver$4, - Headers = headers, - API$1 = api, - EventTarget = event_target, - Event = event; - -var EventSource = function(request, response, options) { - this.writable = true; - options = options || {}; - - this._stream = response.socket; - this._ping = options.ping || this.DEFAULT_PING; - this._retry = options.retry || this.DEFAULT_RETRY; - - var scheme = driver$1.isSecureRequest(request) ? 'https:' : 'http:'; - this.url = scheme + '//' + request.headers.host + request.url; - this.lastEventId = request.headers['last-event-id'] || ''; - this.readyState = API$1.CONNECTING; - - var headers = new Headers(), - self = this; - - if (options.headers) { - for (var key in options.headers) headers.set(key, options.headers[key]); - } - - if (!this._stream || !this._stream.writable) return; - process.nextTick(function() { self._open(); }); - - this._stream.setTimeout(0); - this._stream.setNoDelay(true); - - var handshake = 'HTTP/1.1 200 OK\r\n' + - 'Content-Type: text/event-stream\r\n' + - 'Cache-Control: no-cache, no-store\r\n' + - 'Connection: close\r\n' + - headers.toString() + - '\r\n' + - 'retry: ' + Math.floor(this._retry * 1000) + '\r\n\r\n'; - - this._write(handshake); - - this._stream.on('drain', function() { self.emit('drain'); }); - - if (this._ping) - this._pingTimer = setInterval(function() { self.ping(); }, this._ping * 1000); - - ['error', 'end'].forEach(function(event) { - self._stream.on(event, function() { self.close(); }); - }); -}; -util$2.inherits(EventSource, Stream); - -EventSource.isEventSource = function(request) { - if (request.method !== 'GET') return false; - var accept = (request.headers.accept || '').split(/\s*,\s*/); - return accept.indexOf('text/event-stream') >= 0; -}; - -var instance = { - DEFAULT_PING: 10, - DEFAULT_RETRY: 5, - - _write: function(chunk) { - if (!this.writable) return false; - try { - return this._stream.write(chunk, 'utf8'); - } catch (e) { - return false; - } - }, - - _open: function() { - if (this.readyState !== API$1.CONNECTING) return; - - this.readyState = API$1.OPEN; - - var event = new Event('open'); - event.initEvent('open', false, false); - this.dispatchEvent(event); - }, - - write: function(message) { - return this.send(message); - }, - - end: function(message) { - if (message !== undefined) this.write(message); - this.close(); - }, - - send: function(message, options) { - if (this.readyState > API$1.OPEN) return false; - - message = String(message).replace(/(\r\n|\r|\n)/g, '$1data: '); - options = options || {}; - - var frame = ''; - if (options.event) frame += 'event: ' + options.event + '\r\n'; - if (options.id) frame += 'id: ' + options.id + '\r\n'; - frame += 'data: ' + message + '\r\n\r\n'; - - return this._write(frame); - }, - - ping: function() { - return this._write(':\r\n\r\n'); - }, - - close: function() { - if (this.readyState > API$1.OPEN) return false; - - this.readyState = API$1.CLOSED; - this.writable = false; - if (this._pingTimer) clearInterval(this._pingTimer); - if (this._stream) this._stream.end(); - - var event = new Event('close'); - event.initEvent('close', false, false); - this.dispatchEvent(event); - - return true; - } -}; - -for (var method in instance) EventSource.prototype[method] = instance[method]; -for (var key in EventTarget) EventSource.prototype[key] = EventTarget[key]; - -var eventsource = EventSource; - -var util$1 = require$$2__default["default"], - driver = driver$4, - API = api; - -var WebSocket$1 = function(request, socket, body, protocols, options) { - options = options || {}; - - this._stream = socket; - this._driver = driver.http(request, { maxLength: options.maxLength, protocols: protocols }); - - var self = this; - if (!this._stream || !this._stream.writable) return; - if (!this._stream.readable) return this._stream.end(); - - var catchup = function() { self._stream.removeListener('data', catchup); }; - this._stream.on('data', catchup); - - API.call(this, options); - - process.nextTick(function() { - self._driver.start(); - self._driver.io.write(body); - }); -}; -util$1.inherits(WebSocket$1, API); - -WebSocket$1.isWebSocket = function(request) { - return driver.isWebSocket(request); -}; - -WebSocket$1.validateOptions = function(options, validKeys) { - driver.validateOptions(options, validKeys); -}; - -WebSocket$1.WebSocket = WebSocket$1; -WebSocket$1.Client = client; -WebSocket$1.EventSource = eventsource; - -var websocket = WebSocket$1; - -Object.defineProperty(index_standalone, '__esModule', { value: true }); - -var Websocket = websocket; -var util = require$$1__default$3["default"]; -var tslib = require$$2__default$3["default"]; -var logger$1 = require$$3__default["default"]; - -function _interopDefaultLegacy$1 (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } - -var Websocket__default = /*#__PURE__*/_interopDefaultLegacy$1(Websocket); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var PROTOCOL_VERSION = '5'; -var VERSION_PARAM = 'v'; -var TRANSPORT_SESSION_PARAM = 's'; -var REFERER_PARAM = 'r'; -var FORGE_REF = 'f'; -// Matches console.firebase.google.com, firebase-console-*.corp.google.com and -// firebase.corp.google.com -var FORGE_DOMAIN_RE = /(console\.firebase|firebase-console-\w+\.corp|firebase\.corp)\.google\.com/; -var LAST_SESSION_PARAM = 'ls'; -var APPLICATION_ID_PARAM = 'p'; -var APP_CHECK_TOKEN_PARAM = 'ac'; -var WEBSOCKET = 'websocket'; -var LONG_POLLING = 'long_polling'; - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Wraps a DOM Storage object and: - * - automatically encode objects as JSON strings before storing them to allow us to store arbitrary types. - * - prefixes names with "firebase:" to avoid collisions with app data. - * - * We automatically (see storage.js) create two such wrappers, one for sessionStorage, - * and one for localStorage. - * - */ -var DOMStorageWrapper = /** @class */ (function () { - /** - * @param domStorage_ - The underlying storage object (e.g. localStorage or sessionStorage) - */ - function DOMStorageWrapper(domStorage_) { - this.domStorage_ = domStorage_; - // Use a prefix to avoid collisions with other stuff saved by the app. - this.prefix_ = 'firebase:'; - } - /** - * @param key - The key to save the value under - * @param value - The value being stored, or null to remove the key. - */ - DOMStorageWrapper.prototype.set = function (key, value) { - if (value == null) { - this.domStorage_.removeItem(this.prefixedName_(key)); - } - else { - this.domStorage_.setItem(this.prefixedName_(key), util.stringify(value)); - } - }; - /** - * @returns The value that was stored under this key, or null - */ - DOMStorageWrapper.prototype.get = function (key) { - var storedVal = this.domStorage_.getItem(this.prefixedName_(key)); - if (storedVal == null) { - return null; - } - else { - return util.jsonEval(storedVal); - } - }; - DOMStorageWrapper.prototype.remove = function (key) { - this.domStorage_.removeItem(this.prefixedName_(key)); - }; - DOMStorageWrapper.prototype.prefixedName_ = function (name) { - return this.prefix_ + name; - }; - DOMStorageWrapper.prototype.toString = function () { - return this.domStorage_.toString(); - }; - return DOMStorageWrapper; -}()); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * An in-memory storage implementation that matches the API of DOMStorageWrapper - * (TODO: create interface for both to implement). - */ -var MemoryStorage = /** @class */ (function () { - function MemoryStorage() { - this.cache_ = {}; - this.isInMemoryStorage = true; - } - MemoryStorage.prototype.set = function (key, value) { - if (value == null) { - delete this.cache_[key]; - } - else { - this.cache_[key] = value; - } - }; - MemoryStorage.prototype.get = function (key) { - if (util.contains(this.cache_, key)) { - return this.cache_[key]; - } - return null; - }; - MemoryStorage.prototype.remove = function (key) { - delete this.cache_[key]; - }; - return MemoryStorage; -}()); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Helper to create a DOMStorageWrapper or else fall back to MemoryStorage. - * TODO: Once MemoryStorage and DOMStorageWrapper have a shared interface this method annotation should change - * to reflect this type - * - * @param domStorageName - Name of the underlying storage object - * (e.g. 'localStorage' or 'sessionStorage'). - * @returns Turning off type information until a common interface is defined. - */ -var createStoragefor = function (domStorageName) { - try { - // NOTE: just accessing "localStorage" or "window['localStorage']" may throw a security exception, - // so it must be inside the try/catch. - if (typeof window !== 'undefined' && - typeof window[domStorageName] !== 'undefined') { - // Need to test cache. Just because it's here doesn't mean it works - var domStorage = window[domStorageName]; - domStorage.setItem('firebase:sentinel', 'cache'); - domStorage.removeItem('firebase:sentinel'); - return new DOMStorageWrapper(domStorage); - } - } - catch (e) { } - // Failed to create wrapper. Just return in-memory storage. - // TODO: log? - return new MemoryStorage(); -}; -/** A storage object that lasts across sessions */ -var PersistentStorage = createStoragefor('localStorage'); -/** A storage object that only lasts one session */ -var SessionStorage = createStoragefor('sessionStorage'); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var logClient$1 = new logger$1.Logger('@firebase/database'); -/** - * Returns a locally-unique ID (generated by just incrementing up from 0 each time its called). - */ -var LUIDGenerator = (function () { - var id = 1; - return function () { - return id++; - }; -})(); -/** - * Sha1 hash of the input string - * @param str - The string to hash - * @returns {!string} The resulting hash - */ -var sha1 = function (str) { - var utf8Bytes = util.stringToByteArray(str); - var sha1 = new util.Sha1(); - sha1.update(utf8Bytes); - var sha1Bytes = sha1.digest(); - return util.base64.encodeByteArray(sha1Bytes); -}; -var buildLogMessage_ = function () { - var varArgs = []; - for (var _i = 0; _i < arguments.length; _i++) { - varArgs[_i] = arguments[_i]; - } - var message = ''; - for (var i = 0; i < varArgs.length; i++) { - var arg = varArgs[i]; - if (Array.isArray(arg) || - (arg && - typeof arg === 'object' && - // eslint-disable-next-line @typescript-eslint/no-explicit-any - typeof arg.length === 'number')) { - message += buildLogMessage_.apply(null, arg); - } - else if (typeof arg === 'object') { - message += util.stringify(arg); - } - else { - message += arg; - } - message += ' '; - } - return message; -}; -/** - * Use this for all debug messages in Firebase. - */ -var logger = null; -/** - * Flag to check for log availability on first log message - */ -var firstLog_ = true; -/** - * The implementation of Firebase.enableLogging (defined here to break dependencies) - * @param logger_ - A flag to turn on logging, or a custom logger - * @param persistent - Whether or not to persist logging settings across refreshes - */ -var enableLogging$1 = function (logger_, persistent) { - util.assert(!persistent || logger_ === true || logger_ === false, "Can't turn on custom loggers persistently."); - if (logger_ === true) { - logClient$1.logLevel = logger$1.LogLevel.VERBOSE; - logger = logClient$1.log.bind(logClient$1); - if (persistent) { - SessionStorage.set('logging_enabled', true); - } - } - else if (typeof logger_ === 'function') { - logger = logger_; - } - else { - logger = null; - SessionStorage.remove('logging_enabled'); - } -}; -var log = function () { - var varArgs = []; - for (var _i = 0; _i < arguments.length; _i++) { - varArgs[_i] = arguments[_i]; - } - if (firstLog_ === true) { - firstLog_ = false; - if (logger === null && SessionStorage.get('logging_enabled') === true) { - enableLogging$1(true); - } - } - if (logger) { - var message = buildLogMessage_.apply(null, varArgs); - logger(message); - } -}; -var logWrapper = function (prefix) { - return function () { - var varArgs = []; - for (var _i = 0; _i < arguments.length; _i++) { - varArgs[_i] = arguments[_i]; - } - log.apply(void 0, tslib.__spreadArray([prefix], tslib.__read(varArgs))); - }; -}; -var error = function () { - var varArgs = []; - for (var _i = 0; _i < arguments.length; _i++) { - varArgs[_i] = arguments[_i]; - } - var message = 'FIREBASE INTERNAL ERROR: ' + buildLogMessage_.apply(void 0, tslib.__spreadArray([], tslib.__read(varArgs))); - logClient$1.error(message); -}; -var fatal = function () { - var varArgs = []; - for (var _i = 0; _i < arguments.length; _i++) { - varArgs[_i] = arguments[_i]; - } - var message = "FIREBASE FATAL ERROR: " + buildLogMessage_.apply(void 0, tslib.__spreadArray([], tslib.__read(varArgs))); - logClient$1.error(message); - throw new Error(message); -}; -var warn$1 = function () { - var varArgs = []; - for (var _i = 0; _i < arguments.length; _i++) { - varArgs[_i] = arguments[_i]; - } - var message = 'FIREBASE WARNING: ' + buildLogMessage_.apply(void 0, tslib.__spreadArray([], tslib.__read(varArgs))); - logClient$1.warn(message); -}; -/** - * Logs a warning if the containing page uses https. Called when a call to new Firebase - * does not use https. - */ -var warnIfPageIsSecure = function () { - // Be very careful accessing browser globals. Who knows what may or may not exist. - if (typeof window !== 'undefined' && - window.location && - window.location.protocol && - window.location.protocol.indexOf('https:') !== -1) { - warn$1('Insecure Firebase access from a secure page. ' + - 'Please use https in calls to new Firebase().'); - } -}; -/** - * Returns true if data is NaN, or +/- Infinity. - */ -var isInvalidJSONNumber = function (data) { - return (typeof data === 'number' && - (data !== data || // NaN - data === Number.POSITIVE_INFINITY || - data === Number.NEGATIVE_INFINITY)); -}; -var executeWhenDOMReady = function (fn) { - if (util.isNodeSdk() || document.readyState === 'complete') { - fn(); - } - else { - // Modeled after jQuery. Try DOMContentLoaded and onreadystatechange (which - // fire before onload), but fall back to onload. - var called_1 = false; - var wrappedFn_1 = function () { - if (!document.body) { - setTimeout(wrappedFn_1, Math.floor(10)); - return; - } - if (!called_1) { - called_1 = true; - fn(); - } - }; - if (document.addEventListener) { - document.addEventListener('DOMContentLoaded', wrappedFn_1, false); - // fallback to onload. - window.addEventListener('load', wrappedFn_1, false); - // eslint-disable-next-line @typescript-eslint/no-explicit-any - } - else if (document.attachEvent) { - // IE. - // eslint-disable-next-line @typescript-eslint/no-explicit-any - document.attachEvent('onreadystatechange', function () { - if (document.readyState === 'complete') { - wrappedFn_1(); - } - }); - // fallback to onload. - // eslint-disable-next-line @typescript-eslint/no-explicit-any - window.attachEvent('onload', wrappedFn_1); - // jQuery has an extra hack for IE that we could employ (based on - // http://javascript.nwbox.com/IEContentLoaded/) But it looks really old. - // I'm hoping we don't need it. - } - } -}; -/** - * Minimum key name. Invalid for actual data, used as a marker to sort before any valid names - */ -var MIN_NAME = '[MIN_NAME]'; -/** - * Maximum key name. Invalid for actual data, used as a marker to sort above any valid names - */ -var MAX_NAME = '[MAX_NAME]'; -/** - * Compares valid Firebase key names, plus min and max name - */ -var nameCompare = function (a, b) { - if (a === b) { - return 0; - } - else if (a === MIN_NAME || b === MAX_NAME) { - return -1; - } - else if (b === MIN_NAME || a === MAX_NAME) { - return 1; - } - else { - var aAsInt = tryParseInt(a), bAsInt = tryParseInt(b); - if (aAsInt !== null) { - if (bAsInt !== null) { - return aAsInt - bAsInt === 0 ? a.length - b.length : aAsInt - bAsInt; - } - else { - return -1; - } - } - else if (bAsInt !== null) { - return 1; - } - else { - return a < b ? -1 : 1; - } - } -}; -/** - * @returns {!number} comparison result. - */ -var stringCompare = function (a, b) { - if (a === b) { - return 0; - } - else if (a < b) { - return -1; - } - else { - return 1; - } -}; -var requireKey = function (key, obj) { - if (obj && key in obj) { - return obj[key]; - } - else { - throw new Error('Missing required key (' + key + ') in object: ' + util.stringify(obj)); - } -}; -var ObjectToUniqueKey = function (obj) { - if (typeof obj !== 'object' || obj === null) { - return util.stringify(obj); - } - var keys = []; - // eslint-disable-next-line guard-for-in - for (var k in obj) { - keys.push(k); - } - // Export as json, but with the keys sorted. - keys.sort(); - var key = '{'; - for (var i = 0; i < keys.length; i++) { - if (i !== 0) { - key += ','; - } - key += util.stringify(keys[i]); - key += ':'; - key += ObjectToUniqueKey(obj[keys[i]]); - } - key += '}'; - return key; -}; -/** - * Splits a string into a number of smaller segments of maximum size - * @param str - The string - * @param segsize - The maximum number of chars in the string. - * @returns The string, split into appropriately-sized chunks - */ -var splitStringBySize = function (str, segsize) { - var len = str.length; - if (len <= segsize) { - return [str]; - } - var dataSegs = []; - for (var c = 0; c < len; c += segsize) { - if (c + segsize > len) { - dataSegs.push(str.substring(c, len)); - } - else { - dataSegs.push(str.substring(c, c + segsize)); - } - } - return dataSegs; -}; -/** - * Apply a function to each (key, value) pair in an object or - * apply a function to each (index, value) pair in an array - * @param obj - The object or array to iterate over - * @param fn - The function to apply - */ -function each(obj, fn) { - for (var key in obj) { - if (obj.hasOwnProperty(key)) { - fn(key, obj[key]); - } - } -} -/** - * Borrowed from http://hg.secondlife.com/llsd/src/tip/js/typedarray.js (MIT License) - * I made one modification at the end and removed the NaN / Infinity - * handling (since it seemed broken [caused an overflow] and we don't need it). See MJL comments. - * @param v - A double - * - */ -var doubleToIEEE754String = function (v) { - util.assert(!isInvalidJSONNumber(v), 'Invalid JSON number'); // MJL - var ebits = 11, fbits = 52; - var bias = (1 << (ebits - 1)) - 1; - var s, e, f, ln, i; - // Compute sign, exponent, fraction - // Skip NaN / Infinity handling --MJL. - if (v === 0) { - e = 0; - f = 0; - s = 1 / v === -Infinity ? 1 : 0; - } - else { - s = v < 0; - v = Math.abs(v); - if (v >= Math.pow(2, 1 - bias)) { - // Normalized - ln = Math.min(Math.floor(Math.log(v) / Math.LN2), bias); - e = ln + bias; - f = Math.round(v * Math.pow(2, fbits - ln) - Math.pow(2, fbits)); - } - else { - // Denormalized - e = 0; - f = Math.round(v / Math.pow(2, 1 - bias - fbits)); - } - } - // Pack sign, exponent, fraction - var bits = []; - for (i = fbits; i; i -= 1) { - bits.push(f % 2 ? 1 : 0); - f = Math.floor(f / 2); - } - for (i = ebits; i; i -= 1) { - bits.push(e % 2 ? 1 : 0); - e = Math.floor(e / 2); - } - bits.push(s ? 1 : 0); - bits.reverse(); - var str = bits.join(''); - // Return the data as a hex string. --MJL - var hexByteString = ''; - for (i = 0; i < 64; i += 8) { - var hexByte = parseInt(str.substr(i, 8), 2).toString(16); - if (hexByte.length === 1) { - hexByte = '0' + hexByte; - } - hexByteString = hexByteString + hexByte; - } - return hexByteString.toLowerCase(); -}; -/** - * Used to detect if we're in a Chrome content script (which executes in an - * isolated environment where long-polling doesn't work). - */ -var isChromeExtensionContentScript = function () { - return !!(typeof window === 'object' && - window['chrome'] && - window['chrome']['extension'] && - !/^chrome/.test(window.location.href)); -}; -/** - * Used to detect if we're in a Windows 8 Store app. - */ -var isWindowsStoreApp = function () { - // Check for the presence of a couple WinRT globals - return typeof Windows === 'object' && typeof Windows.UI === 'object'; -}; -/** - * Converts a server error code to a Javascript Error - */ -function errorForServerCode(code, query) { - var reason = 'Unknown Error'; - if (code === 'too_big') { - reason = - 'The data requested exceeds the maximum size ' + - 'that can be accessed with a single request.'; - } - else if (code === 'permission_denied') { - reason = "Client doesn't have permission to access the desired data."; - } - else if (code === 'unavailable') { - reason = 'The service is unavailable'; - } - var error = new Error(code + ' at ' + query._path.toString() + ': ' + reason); - // eslint-disable-next-line @typescript-eslint/no-explicit-any - error.code = code.toUpperCase(); - return error; -} -/** - * Used to test for integer-looking strings - */ -var INTEGER_REGEXP_ = new RegExp('^-?(0*)\\d{1,10}$'); -/** - * For use in keys, the minimum possible 32-bit integer. - */ -var INTEGER_32_MIN = -2147483648; -/** - * For use in kyes, the maximum possible 32-bit integer. - */ -var INTEGER_32_MAX = 2147483647; -/** - * If the string contains a 32-bit integer, return it. Else return null. - */ -var tryParseInt = function (str) { - if (INTEGER_REGEXP_.test(str)) { - var intVal = Number(str); - if (intVal >= INTEGER_32_MIN && intVal <= INTEGER_32_MAX) { - return intVal; - } - } - return null; -}; -/** - * Helper to run some code but catch any exceptions and re-throw them later. - * Useful for preventing user callbacks from breaking internal code. - * - * Re-throwing the exception from a setTimeout is a little evil, but it's very - * convenient (we don't have to try to figure out when is a safe point to - * re-throw it), and the behavior seems reasonable: - * - * * If you aren't pausing on exceptions, you get an error in the console with - * the correct stack trace. - * * If you're pausing on all exceptions, the debugger will pause on your - * exception and then again when we rethrow it. - * * If you're only pausing on uncaught exceptions, the debugger will only pause - * on us re-throwing it. - * - * @param fn - The code to guard. - */ -var exceptionGuard = function (fn) { - try { - fn(); - } - catch (e) { - // Re-throw exception when it's safe. - setTimeout(function () { - // It used to be that "throw e" would result in a good console error with - // relevant context, but as of Chrome 39, you just get the firebase.js - // file/line number where we re-throw it, which is useless. So we log - // e.stack explicitly. - var stack = e.stack || ''; - warn$1('Exception was thrown by user callback.', stack); - throw e; - }, Math.floor(0)); - } -}; -/** - * @returns {boolean} true if we think we're currently being crawled. - */ -var beingCrawled = function () { - var userAgent = (typeof window === 'object' && - window['navigator'] && - window['navigator']['userAgent']) || - ''; - // For now we whitelist the most popular crawlers. We should refine this to be the set of crawlers we - // believe to support JavaScript/AJAX rendering. - // NOTE: Google Webmaster Tools doesn't really belong, but their "This is how a visitor to your website - // would have seen the page" is flaky if we don't treat it as a crawler. - return (userAgent.search(/googlebot|google webmaster tools|bingbot|yahoo! slurp|baiduspider|yandexbot|duckduckbot/i) >= 0); -}; -/** - * Same as setTimeout() except on Node.JS it will /not/ prevent the process from exiting. - * - * It is removed with clearTimeout() as normal. - * - * @param fn - Function to run. - * @param time - Milliseconds to wait before running. - * @returns The setTimeout() return value. - */ -var setTimeoutNonBlocking = function (fn, time) { - var timeout = setTimeout(fn, time); - // Note: at the time of this comment, unrefTimer is under the unstable set of APIs. Run with --unstable to enable the API. - if (typeof timeout === 'number' && - // @ts-ignore Is only defined in Deno environments. - typeof Deno !== 'undefined' && - // @ts-ignore Deno and unrefTimer are only defined in Deno environments. - Deno['unrefTimer']) { - // @ts-ignore Deno and unrefTimer are only defined in Deno environments. - Deno.unrefTimer(timeout); - // eslint-disable-next-line @typescript-eslint/no-explicit-any - } - else if (typeof timeout === 'object' && timeout['unref']) { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - timeout['unref'](); - } - return timeout; -}; - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * A class that holds metadata about a Repo object - */ -var RepoInfo = /** @class */ (function () { - /** - * @param host - Hostname portion of the url for the repo - * @param secure - Whether or not this repo is accessed over ssl - * @param namespace - The namespace represented by the repo - * @param webSocketOnly - Whether to prefer websockets over all other transports (used by Nest). - * @param nodeAdmin - Whether this instance uses Admin SDK credentials - * @param persistenceKey - Override the default session persistence storage key - */ - function RepoInfo(host, secure, namespace, webSocketOnly, nodeAdmin, persistenceKey, includeNamespaceInQueryParams) { - if (nodeAdmin === void 0) { nodeAdmin = false; } - if (persistenceKey === void 0) { persistenceKey = ''; } - if (includeNamespaceInQueryParams === void 0) { includeNamespaceInQueryParams = false; } - this.secure = secure; - this.namespace = namespace; - this.webSocketOnly = webSocketOnly; - this.nodeAdmin = nodeAdmin; - this.persistenceKey = persistenceKey; - this.includeNamespaceInQueryParams = includeNamespaceInQueryParams; - this._host = host.toLowerCase(); - this._domain = this._host.substr(this._host.indexOf('.') + 1); - this.internalHost = - PersistentStorage.get('host:' + host) || this._host; - } - RepoInfo.prototype.isCacheableHost = function () { - return this.internalHost.substr(0, 2) === 's-'; - }; - RepoInfo.prototype.isCustomHost = function () { - return (this._domain !== 'firebaseio.com' && - this._domain !== 'firebaseio-demo.com'); - }; - Object.defineProperty(RepoInfo.prototype, "host", { - get: function () { - return this._host; - }, - set: function (newHost) { - if (newHost !== this.internalHost) { - this.internalHost = newHost; - if (this.isCacheableHost()) { - PersistentStorage.set('host:' + this._host, this.internalHost); - } - } - }, - enumerable: false, - configurable: true - }); - RepoInfo.prototype.toString = function () { - var str = this.toURLString(); - if (this.persistenceKey) { - str += '<' + this.persistenceKey + '>'; - } - return str; - }; - RepoInfo.prototype.toURLString = function () { - var protocol = this.secure ? 'https://' : 'http://'; - var query = this.includeNamespaceInQueryParams - ? "?ns=" + this.namespace - : ''; - return "" + protocol + this.host + "/" + query; - }; - return RepoInfo; -}()); -function repoInfoNeedsQueryParam(repoInfo) { - return (repoInfo.host !== repoInfo.internalHost || - repoInfo.isCustomHost() || - repoInfo.includeNamespaceInQueryParams); -} -/** - * Returns the websocket URL for this repo - * @param repoInfo - RepoInfo object - * @param type - of connection - * @param params - list - * @returns The URL for this repo - */ -function repoInfoConnectionURL(repoInfo, type, params) { - util.assert(typeof type === 'string', 'typeof type must == string'); - util.assert(typeof params === 'object', 'typeof params must == object'); - var connURL; - if (type === WEBSOCKET) { - connURL = - (repoInfo.secure ? 'wss://' : 'ws://') + repoInfo.internalHost + '/.ws?'; - } - else if (type === LONG_POLLING) { - connURL = - (repoInfo.secure ? 'https://' : 'http://') + - repoInfo.internalHost + - '/.lp?'; - } - else { - throw new Error('Unknown connection type: ' + type); - } - if (repoInfoNeedsQueryParam(repoInfo)) { - params['ns'] = repoInfo.namespace; - } - var pairs = []; - each(params, function (key, value) { - pairs.push(key + '=' + value); - }); - return connURL + pairs.join('&'); -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Tracks a collection of stats. - */ -var StatsCollection = /** @class */ (function () { - function StatsCollection() { - this.counters_ = {}; - } - StatsCollection.prototype.incrementCounter = function (name, amount) { - if (amount === void 0) { amount = 1; } - if (!util.contains(this.counters_, name)) { - this.counters_[name] = 0; - } - this.counters_[name] += amount; - }; - StatsCollection.prototype.get = function () { - return util.deepCopy(this.counters_); - }; - return StatsCollection; -}()); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var collections = {}; -var reporters = {}; -function statsManagerGetCollection(repoInfo) { - var hashString = repoInfo.toString(); - if (!collections[hashString]) { - collections[hashString] = new StatsCollection(); - } - return collections[hashString]; -} -function statsManagerGetOrCreateReporter(repoInfo, creatorFunction) { - var hashString = repoInfo.toString(); - if (!reporters[hashString]) { - reporters[hashString] = creatorFunction(); - } - return reporters[hashString]; -} - -/** - * @license - * Copyright 2019 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** The semver (www.semver.org) version of the SDK. */ -var SDK_VERSION = ''; -/** - * SDK_VERSION should be set before any database instance is created - * @internal - */ -function setSDKVersion(version) { - SDK_VERSION = version; -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var WEBSOCKET_MAX_FRAME_SIZE = 16384; -var WEBSOCKET_KEEPALIVE_INTERVAL = 45000; -var WebSocketImpl = null; -if (typeof MozWebSocket !== 'undefined') { - WebSocketImpl = MozWebSocket; -} -else if (typeof WebSocket !== 'undefined') { - WebSocketImpl = WebSocket; -} -function setWebSocketImpl(impl) { - WebSocketImpl = impl; -} -/** - * Create a new websocket connection with the given callbacks. - */ -var WebSocketConnection = /** @class */ (function () { - /** - * @param connId identifier for this transport - * @param repoInfo The info for the websocket endpoint. - * @param applicationId The Firebase App ID for this project. - * @param appCheckToken The App Check Token for this client. - * @param authToken The Auth Token for this client. - * @param transportSessionId Optional transportSessionId if this is connecting - * to an existing transport session - * @param lastSessionId Optional lastSessionId if there was a previous - * connection - */ - function WebSocketConnection(connId, repoInfo, applicationId, appCheckToken, authToken, transportSessionId, lastSessionId) { - this.connId = connId; - this.applicationId = applicationId; - this.appCheckToken = appCheckToken; - this.authToken = authToken; - this.keepaliveTimer = null; - this.frames = null; - this.totalFrames = 0; - this.bytesSent = 0; - this.bytesReceived = 0; - this.log_ = logWrapper(this.connId); - this.stats_ = statsManagerGetCollection(repoInfo); - this.connURL = WebSocketConnection.connectionURL_(repoInfo, transportSessionId, lastSessionId, appCheckToken, applicationId); - this.nodeAdmin = repoInfo.nodeAdmin; - } - /** - * @param repoInfo - The info for the websocket endpoint. - * @param transportSessionId - Optional transportSessionId if this is connecting to an existing transport - * session - * @param lastSessionId - Optional lastSessionId if there was a previous connection - * @returns connection url - */ - WebSocketConnection.connectionURL_ = function (repoInfo, transportSessionId, lastSessionId, appCheckToken, applicationId) { - var urlParams = {}; - urlParams[VERSION_PARAM] = PROTOCOL_VERSION; - if (!util.isNodeSdk() && - typeof location !== 'undefined' && - location.hostname && - FORGE_DOMAIN_RE.test(location.hostname)) { - urlParams[REFERER_PARAM] = FORGE_REF; - } - if (transportSessionId) { - urlParams[TRANSPORT_SESSION_PARAM] = transportSessionId; - } - if (lastSessionId) { - urlParams[LAST_SESSION_PARAM] = lastSessionId; - } - if (appCheckToken) { - urlParams[APP_CHECK_TOKEN_PARAM] = appCheckToken; - } - if (applicationId) { - urlParams[APPLICATION_ID_PARAM] = applicationId; - } - return repoInfoConnectionURL(repoInfo, WEBSOCKET, urlParams); - }; - /** - * @param onMessage - Callback when messages arrive - * @param onDisconnect - Callback with connection lost. - */ - WebSocketConnection.prototype.open = function (onMessage, onDisconnect) { - var _this = this; - this.onDisconnect = onDisconnect; - this.onMessage = onMessage; - this.log_('Websocket connecting to ' + this.connURL); - this.everConnected_ = false; - // Assume failure until proven otherwise. - PersistentStorage.set('previous_websocket_failure', true); - try { - var options = void 0; - if (util.isNodeSdk()) { - var device = this.nodeAdmin ? 'AdminNode' : 'Node'; - // UA Format: Firebase//// - options = { - headers: { - 'User-Agent': "Firebase/" + PROTOCOL_VERSION + "/" + SDK_VERSION + "/" + process.platform + "/" + device, - 'X-Firebase-GMPID': this.applicationId || '' - } - }; - // If using Node with admin creds, AppCheck-related checks are unnecessary. - // Note that we send the credentials here even if they aren't admin credentials, which is - // not a problem. - // Note that this header is just used to bypass appcheck, and the token should still be sent - // through the websocket connection once it is established. - if (this.authToken) { - options.headers['Authorization'] = "Bearer " + this.authToken; - } - if (this.appCheckToken) { - options.headers['X-Firebase-AppCheck'] = this.appCheckToken; - } - // Plumb appropriate http_proxy environment variable into faye-websocket if it exists. - var env = process['env']; - var proxy = this.connURL.indexOf('wss://') === 0 - ? env['HTTPS_PROXY'] || env['https_proxy'] - : env['HTTP_PROXY'] || env['http_proxy']; - if (proxy) { - options['proxy'] = { origin: proxy }; - } - } - this.mySock = new WebSocketImpl(this.connURL, [], options); - } - catch (e) { - this.log_('Error instantiating WebSocket.'); - var error = e.message || e.data; - if (error) { - this.log_(error); - } - this.onClosed_(); - return; - } - this.mySock.onopen = function () { - _this.log_('Websocket connected.'); - _this.everConnected_ = true; - }; - this.mySock.onclose = function () { - _this.log_('Websocket connection was disconnected.'); - _this.mySock = null; - _this.onClosed_(); - }; - this.mySock.onmessage = function (m) { - _this.handleIncomingFrame(m); - }; - this.mySock.onerror = function (e) { - _this.log_('WebSocket error. Closing connection.'); - // eslint-disable-next-line @typescript-eslint/no-explicit-any - var error = e.message || e.data; - if (error) { - _this.log_(error); - } - _this.onClosed_(); - }; - }; - /** - * No-op for websockets, we don't need to do anything once the connection is confirmed as open - */ - WebSocketConnection.prototype.start = function () { }; - WebSocketConnection.forceDisallow = function () { - WebSocketConnection.forceDisallow_ = true; - }; - WebSocketConnection.isAvailable = function () { - var isOldAndroid = false; - if (typeof navigator !== 'undefined' && navigator.userAgent) { - var oldAndroidRegex = /Android ([0-9]{0,}\.[0-9]{0,})/; - var oldAndroidMatch = navigator.userAgent.match(oldAndroidRegex); - if (oldAndroidMatch && oldAndroidMatch.length > 1) { - if (parseFloat(oldAndroidMatch[1]) < 4.4) { - isOldAndroid = true; - } - } - } - return (!isOldAndroid && - WebSocketImpl !== null && - !WebSocketConnection.forceDisallow_); - }; - /** - * Returns true if we previously failed to connect with this transport. - */ - WebSocketConnection.previouslyFailed = function () { - // If our persistent storage is actually only in-memory storage, - // we default to assuming that it previously failed to be safe. - return (PersistentStorage.isInMemoryStorage || - PersistentStorage.get('previous_websocket_failure') === true); - }; - WebSocketConnection.prototype.markConnectionHealthy = function () { - PersistentStorage.remove('previous_websocket_failure'); - }; - WebSocketConnection.prototype.appendFrame_ = function (data) { - this.frames.push(data); - if (this.frames.length === this.totalFrames) { - var fullMess = this.frames.join(''); - this.frames = null; - var jsonMess = util.jsonEval(fullMess); - //handle the message - this.onMessage(jsonMess); - } - }; - /** - * @param frameCount - The number of frames we are expecting from the server - */ - WebSocketConnection.prototype.handleNewFrameCount_ = function (frameCount) { - this.totalFrames = frameCount; - this.frames = []; - }; - /** - * Attempts to parse a frame count out of some text. If it can't, assumes a value of 1 - * @returns Any remaining data to be process, or null if there is none - */ - WebSocketConnection.prototype.extractFrameCount_ = function (data) { - util.assert(this.frames === null, 'We already have a frame buffer'); - // TODO: The server is only supposed to send up to 9999 frames (i.e. length <= 4), but that isn't being enforced - // currently. So allowing larger frame counts (length <= 6). See https://app.asana.com/0/search/8688598998380/8237608042508 - if (data.length <= 6) { - var frameCount = Number(data); - if (!isNaN(frameCount)) { - this.handleNewFrameCount_(frameCount); - return null; - } - } - this.handleNewFrameCount_(1); - return data; - }; - /** - * Process a websocket frame that has arrived from the server. - * @param mess - The frame data - */ - WebSocketConnection.prototype.handleIncomingFrame = function (mess) { - if (this.mySock === null) { - return; // Chrome apparently delivers incoming packets even after we .close() the connection sometimes. - } - var data = mess['data']; - this.bytesReceived += data.length; - this.stats_.incrementCounter('bytes_received', data.length); - this.resetKeepAlive(); - if (this.frames !== null) { - // we're buffering - this.appendFrame_(data); - } - else { - // try to parse out a frame count, otherwise, assume 1 and process it - var remainingData = this.extractFrameCount_(data); - if (remainingData !== null) { - this.appendFrame_(remainingData); - } - } - }; - /** - * Send a message to the server - * @param data - The JSON object to transmit - */ - WebSocketConnection.prototype.send = function (data) { - this.resetKeepAlive(); - var dataStr = util.stringify(data); - this.bytesSent += dataStr.length; - this.stats_.incrementCounter('bytes_sent', dataStr.length); - //We can only fit a certain amount in each websocket frame, so we need to split this request - //up into multiple pieces if it doesn't fit in one request. - var dataSegs = splitStringBySize(dataStr, WEBSOCKET_MAX_FRAME_SIZE); - //Send the length header - if (dataSegs.length > 1) { - this.sendString_(String(dataSegs.length)); - } - //Send the actual data in segments. - for (var i = 0; i < dataSegs.length; i++) { - this.sendString_(dataSegs[i]); - } - }; - WebSocketConnection.prototype.shutdown_ = function () { - this.isClosed_ = true; - if (this.keepaliveTimer) { - clearInterval(this.keepaliveTimer); - this.keepaliveTimer = null; - } - if (this.mySock) { - this.mySock.close(); - this.mySock = null; - } - }; - WebSocketConnection.prototype.onClosed_ = function () { - if (!this.isClosed_) { - this.log_('WebSocket is closing itself'); - this.shutdown_(); - // since this is an internal close, trigger the close listener - if (this.onDisconnect) { - this.onDisconnect(this.everConnected_); - this.onDisconnect = null; - } - } - }; - /** - * External-facing close handler. - * Close the websocket and kill the connection. - */ - WebSocketConnection.prototype.close = function () { - if (!this.isClosed_) { - this.log_('WebSocket is being closed'); - this.shutdown_(); - } - }; - /** - * Kill the current keepalive timer and start a new one, to ensure that it always fires N seconds after - * the last activity. - */ - WebSocketConnection.prototype.resetKeepAlive = function () { - var _this = this; - clearInterval(this.keepaliveTimer); - this.keepaliveTimer = setInterval(function () { - //If there has been no websocket activity for a while, send a no-op - if (_this.mySock) { - _this.sendString_('0'); - } - _this.resetKeepAlive(); - // eslint-disable-next-line @typescript-eslint/no-explicit-any - }, Math.floor(WEBSOCKET_KEEPALIVE_INTERVAL)); - }; - /** - * Send a string over the websocket. - * - * @param str - String to send. - */ - WebSocketConnection.prototype.sendString_ = function (str) { - // Firefox seems to sometimes throw exceptions (NS_ERROR_UNEXPECTED) from websocket .send() - // calls for some unknown reason. We treat these as an error and disconnect. - // See https://app.asana.com/0/58926111402292/68021340250410 - try { - this.mySock.send(str); - } - catch (e) { - this.log_('Exception thrown from WebSocket.send():', e.message || e.data, 'Closing connection.'); - setTimeout(this.onClosed_.bind(this), 0); - } - }; - /** - * Number of response before we consider the connection "healthy." - */ - WebSocketConnection.responsesRequiredToBeHealthy = 2; - /** - * Time to wait for the connection te become healthy before giving up. - */ - WebSocketConnection.healthyTimeout = 30000; - return WebSocketConnection; -}()); - -/** - * @license - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Abstraction around AppCheck's token fetching capabilities. - */ -var AppCheckTokenProvider = /** @class */ (function () { - function AppCheckTokenProvider(appName_, appCheckProvider) { - var _this = this; - this.appName_ = appName_; - this.appCheckProvider = appCheckProvider; - this.appCheck = appCheckProvider === null || appCheckProvider === void 0 ? void 0 : appCheckProvider.getImmediate({ optional: true }); - if (!this.appCheck) { - appCheckProvider === null || appCheckProvider === void 0 ? void 0 : appCheckProvider.get().then(function (appCheck) { return (_this.appCheck = appCheck); }); - } - } - AppCheckTokenProvider.prototype.getToken = function (forceRefresh) { - var _this = this; - if (!this.appCheck) { - return new Promise(function (resolve, reject) { - // Support delayed initialization of FirebaseAppCheck. This allows our - // customers to initialize the RTDB SDK before initializing Firebase - // AppCheck and ensures that all requests are authenticated if a token - // becomes available before the timoeout below expires. - setTimeout(function () { - if (_this.appCheck) { - _this.getToken(forceRefresh).then(resolve, reject); - } - else { - resolve(null); - } - }, 0); - }); - } - return this.appCheck.getToken(forceRefresh); - }; - AppCheckTokenProvider.prototype.addTokenChangeListener = function (listener) { - var _a; - (_a = this.appCheckProvider) === null || _a === void 0 ? void 0 : _a.get().then(function (appCheck) { return appCheck.addTokenListener(listener); }); - }; - AppCheckTokenProvider.prototype.notifyForInvalidToken = function () { - warn$1("Provided AppCheck credentials for the app named \"" + this.appName_ + "\" " + - 'are invalid. This usually indicates your app was not initialized correctly.'); - }; - return AppCheckTokenProvider; -}()); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Abstraction around FirebaseApp's token fetching capabilities. - */ -var FirebaseAuthTokenProvider = /** @class */ (function () { - function FirebaseAuthTokenProvider(appName_, firebaseOptions_, authProvider_) { - var _this = this; - this.appName_ = appName_; - this.firebaseOptions_ = firebaseOptions_; - this.authProvider_ = authProvider_; - this.auth_ = null; - this.auth_ = authProvider_.getImmediate({ optional: true }); - if (!this.auth_) { - authProvider_.onInit(function (auth) { return (_this.auth_ = auth); }); - } - } - FirebaseAuthTokenProvider.prototype.getToken = function (forceRefresh) { - var _this = this; - if (!this.auth_) { - return new Promise(function (resolve, reject) { - // Support delayed initialization of FirebaseAuth. This allows our - // customers to initialize the RTDB SDK before initializing Firebase - // Auth and ensures that all requests are authenticated if a token - // becomes available before the timoeout below expires. - setTimeout(function () { - if (_this.auth_) { - _this.getToken(forceRefresh).then(resolve, reject); - } - else { - resolve(null); - } - }, 0); - }); - } - return this.auth_.getToken(forceRefresh).catch(function (error) { - // TODO: Need to figure out all the cases this is raised and whether - // this makes sense. - if (error && error.code === 'auth/token-not-initialized') { - log('Got auth/token-not-initialized error. Treating as null token.'); - return null; - } - else { - return Promise.reject(error); - } - }); - }; - FirebaseAuthTokenProvider.prototype.addTokenChangeListener = function (listener) { - // TODO: We might want to wrap the listener and call it with no args to - // avoid a leaky abstraction, but that makes removing the listener harder. - if (this.auth_) { - this.auth_.addAuthTokenListener(listener); - } - else { - this.authProvider_ - .get() - .then(function (auth) { return auth.addAuthTokenListener(listener); }); - } - }; - FirebaseAuthTokenProvider.prototype.removeTokenChangeListener = function (listener) { - this.authProvider_ - .get() - .then(function (auth) { return auth.removeAuthTokenListener(listener); }); - }; - FirebaseAuthTokenProvider.prototype.notifyForInvalidToken = function () { - var errorMessage = 'Provided authentication credentials for the app named "' + - this.appName_ + - '" are invalid. This usually indicates your app was not ' + - 'initialized correctly. '; - if ('credential' in this.firebaseOptions_) { - errorMessage += - 'Make sure the "credential" property provided to initializeApp() ' + - 'is authorized to access the specified "databaseURL" and is from the correct ' + - 'project.'; - } - else if ('serviceAccount' in this.firebaseOptions_) { - errorMessage += - 'Make sure the "serviceAccount" property provided to initializeApp() ' + - 'is authorized to access the specified "databaseURL" and is from the correct ' + - 'project.'; - } - else { - errorMessage += - 'Make sure the "apiKey" and "databaseURL" properties provided to ' + - 'initializeApp() match the values provided for your app at ' + - 'https://console.firebase.google.com/.'; - } - warn$1(errorMessage); - }; - return FirebaseAuthTokenProvider; -}()); -/* AuthTokenProvider that supplies a constant token. Used by Admin SDK or mockUserToken with emulators. */ -var EmulatorTokenProvider = /** @class */ (function () { - function EmulatorTokenProvider(accessToken) { - this.accessToken = accessToken; - } - EmulatorTokenProvider.prototype.getToken = function (forceRefresh) { - return Promise.resolve({ - accessToken: this.accessToken - }); - }; - EmulatorTokenProvider.prototype.addTokenChangeListener = function (listener) { - // Invoke the listener immediately to match the behavior in Firebase Auth - // (see packages/auth/src/auth.js#L1807) - listener(this.accessToken); - }; - EmulatorTokenProvider.prototype.removeTokenChangeListener = function (listener) { }; - EmulatorTokenProvider.prototype.notifyForInvalidToken = function () { }; - /** A string that is treated as an admin access token by the RTDB emulator. Used by Admin SDK. */ - EmulatorTokenProvider.OWNER = 'owner'; - return EmulatorTokenProvider; -}()); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * This class ensures the packets from the server arrive in order - * This class takes data from the server and ensures it gets passed into the callbacks in order. - */ -var PacketReceiver = /** @class */ (function () { - /** - * @param onMessage_ - */ - function PacketReceiver(onMessage_) { - this.onMessage_ = onMessage_; - this.pendingResponses = []; - this.currentResponseNum = 0; - this.closeAfterResponse = -1; - this.onClose = null; - } - PacketReceiver.prototype.closeAfter = function (responseNum, callback) { - this.closeAfterResponse = responseNum; - this.onClose = callback; - if (this.closeAfterResponse < this.currentResponseNum) { - this.onClose(); - this.onClose = null; - } - }; - /** - * Each message from the server comes with a response number, and an array of data. The responseNumber - * allows us to ensure that we process them in the right order, since we can't be guaranteed that all - * browsers will respond in the same order as the requests we sent - */ - PacketReceiver.prototype.handleResponse = function (requestNum, data) { - var _this = this; - this.pendingResponses[requestNum] = data; - var _loop_1 = function () { - var toProcess = this_1.pendingResponses[this_1.currentResponseNum]; - delete this_1.pendingResponses[this_1.currentResponseNum]; - var _loop_2 = function (i) { - if (toProcess[i]) { - exceptionGuard(function () { - _this.onMessage_(toProcess[i]); - }); - } - }; - for (var i = 0; i < toProcess.length; ++i) { - _loop_2(i); - } - if (this_1.currentResponseNum === this_1.closeAfterResponse) { - if (this_1.onClose) { - this_1.onClose(); - this_1.onClose = null; - } - return "break"; - } - this_1.currentResponseNum++; - }; - var this_1 = this; - while (this.pendingResponses[this.currentResponseNum]) { - var state_1 = _loop_1(); - if (state_1 === "break") - break; - } - }; - return PacketReceiver; -}()); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// URL query parameters associated with longpolling -var FIREBASE_LONGPOLL_START_PARAM = 'start'; -var FIREBASE_LONGPOLL_CLOSE_COMMAND = 'close'; -var FIREBASE_LONGPOLL_COMMAND_CB_NAME = 'pLPCommand'; -var FIREBASE_LONGPOLL_DATA_CB_NAME = 'pRTLPCB'; -var FIREBASE_LONGPOLL_ID_PARAM = 'id'; -var FIREBASE_LONGPOLL_PW_PARAM = 'pw'; -var FIREBASE_LONGPOLL_SERIAL_PARAM = 'ser'; -var FIREBASE_LONGPOLL_CALLBACK_ID_PARAM = 'cb'; -var FIREBASE_LONGPOLL_SEGMENT_NUM_PARAM = 'seg'; -var FIREBASE_LONGPOLL_SEGMENTS_IN_PACKET = 'ts'; -var FIREBASE_LONGPOLL_DATA_PARAM = 'd'; -var FIREBASE_LONGPOLL_DISCONN_FRAME_REQUEST_PARAM = 'dframe'; -//Data size constants. -//TODO: Perf: the maximum length actually differs from browser to browser. -// We should check what browser we're on and set accordingly. -var MAX_URL_DATA_SIZE = 1870; -var SEG_HEADER_SIZE = 30; //ie: &seg=8299234&ts=982389123&d= -var MAX_PAYLOAD_SIZE = MAX_URL_DATA_SIZE - SEG_HEADER_SIZE; -/** - * Keepalive period - * send a fresh request at minimum every 25 seconds. Opera has a maximum request - * length of 30 seconds that we can't exceed. - */ -var KEEPALIVE_REQUEST_INTERVAL = 25000; -/** - * How long to wait before aborting a long-polling connection attempt. - */ -var LP_CONNECT_TIMEOUT = 30000; -/** - * This class manages a single long-polling connection. - */ -var BrowserPollConnection = /** @class */ (function () { - /** - * @param connId An identifier for this connection, used for logging - * @param repoInfo The info for the endpoint to send data to. - * @param applicationId The Firebase App ID for this project. - * @param appCheckToken The AppCheck token for this client. - * @param authToken The AuthToken to use for this connection. - * @param transportSessionId Optional transportSessionid if we are - * reconnecting for an existing transport session - * @param lastSessionId Optional lastSessionId if the PersistentConnection has - * already created a connection previously - */ - function BrowserPollConnection(connId, repoInfo, applicationId, appCheckToken, authToken, transportSessionId, lastSessionId) { - var _this = this; - this.connId = connId; - this.repoInfo = repoInfo; - this.applicationId = applicationId; - this.appCheckToken = appCheckToken; - this.authToken = authToken; - this.transportSessionId = transportSessionId; - this.lastSessionId = lastSessionId; - this.bytesSent = 0; - this.bytesReceived = 0; - this.everConnected_ = false; - this.log_ = logWrapper(connId); - this.stats_ = statsManagerGetCollection(repoInfo); - this.urlFn = function (params) { - // Always add the token if we have one. - if (_this.appCheckToken) { - params[APP_CHECK_TOKEN_PARAM] = _this.appCheckToken; - } - return repoInfoConnectionURL(repoInfo, LONG_POLLING, params); - }; - } - /** - * @param onMessage - Callback when messages arrive - * @param onDisconnect - Callback with connection lost. - */ - BrowserPollConnection.prototype.open = function (onMessage, onDisconnect) { - var _this = this; - this.curSegmentNum = 0; - this.onDisconnect_ = onDisconnect; - this.myPacketOrderer = new PacketReceiver(onMessage); - this.isClosed_ = false; - this.connectTimeoutTimer_ = setTimeout(function () { - _this.log_('Timed out trying to connect.'); - // Make sure we clear the host cache - _this.onClosed_(); - _this.connectTimeoutTimer_ = null; - // eslint-disable-next-line @typescript-eslint/no-explicit-any - }, Math.floor(LP_CONNECT_TIMEOUT)); - // Ensure we delay the creation of the iframe until the DOM is loaded. - executeWhenDOMReady(function () { - if (_this.isClosed_) { - return; - } - //Set up a callback that gets triggered once a connection is set up. - _this.scriptTagHolder = new FirebaseIFrameScriptHolder(function () { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - var _a = tslib.__read(args, 5), command = _a[0], arg1 = _a[1], arg2 = _a[2]; _a[3]; _a[4]; - _this.incrementIncomingBytes_(args); - if (!_this.scriptTagHolder) { - return; // we closed the connection. - } - if (_this.connectTimeoutTimer_) { - clearTimeout(_this.connectTimeoutTimer_); - _this.connectTimeoutTimer_ = null; - } - _this.everConnected_ = true; - if (command === FIREBASE_LONGPOLL_START_PARAM) { - _this.id = arg1; - _this.password = arg2; - } - else if (command === FIREBASE_LONGPOLL_CLOSE_COMMAND) { - // Don't clear the host cache. We got a response from the server, so we know it's reachable - if (arg1) { - // We aren't expecting any more data (other than what the server's already in the process of sending us - // through our already open polls), so don't send any more. - _this.scriptTagHolder.sendNewPolls = false; - // arg1 in this case is the last response number sent by the server. We should try to receive - // all of the responses up to this one before closing - _this.myPacketOrderer.closeAfter(arg1, function () { - _this.onClosed_(); - }); - } - else { - _this.onClosed_(); - } - } - else { - throw new Error('Unrecognized command received: ' + command); - } - }, function () { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - var _a = tslib.__read(args, 2), pN = _a[0], data = _a[1]; - _this.incrementIncomingBytes_(args); - _this.myPacketOrderer.handleResponse(pN, data); - }, function () { - _this.onClosed_(); - }, _this.urlFn); - //Send the initial request to connect. The serial number is simply to keep the browser from pulling previous results - //from cache. - var urlParams = {}; - urlParams[FIREBASE_LONGPOLL_START_PARAM] = 't'; - urlParams[FIREBASE_LONGPOLL_SERIAL_PARAM] = Math.floor(Math.random() * 100000000); - if (_this.scriptTagHolder.uniqueCallbackIdentifier) { - urlParams[FIREBASE_LONGPOLL_CALLBACK_ID_PARAM] = - _this.scriptTagHolder.uniqueCallbackIdentifier; - } - urlParams[VERSION_PARAM] = PROTOCOL_VERSION; - if (_this.transportSessionId) { - urlParams[TRANSPORT_SESSION_PARAM] = _this.transportSessionId; - } - if (_this.lastSessionId) { - urlParams[LAST_SESSION_PARAM] = _this.lastSessionId; - } - if (_this.applicationId) { - urlParams[APPLICATION_ID_PARAM] = _this.applicationId; - } - if (_this.appCheckToken) { - urlParams[APP_CHECK_TOKEN_PARAM] = _this.appCheckToken; - } - if (typeof location !== 'undefined' && - location.hostname && - FORGE_DOMAIN_RE.test(location.hostname)) { - urlParams[REFERER_PARAM] = FORGE_REF; - } - var connectURL = _this.urlFn(urlParams); - _this.log_('Connecting via long-poll to ' + connectURL); - _this.scriptTagHolder.addTag(connectURL, function () { - /* do nothing */ - }); - }); - }; - /** - * Call this when a handshake has completed successfully and we want to consider the connection established - */ - BrowserPollConnection.prototype.start = function () { - this.scriptTagHolder.startLongPoll(this.id, this.password); - this.addDisconnectPingFrame(this.id, this.password); - }; - /** - * Forces long polling to be considered as a potential transport - */ - BrowserPollConnection.forceAllow = function () { - BrowserPollConnection.forceAllow_ = true; - }; - /** - * Forces longpolling to not be considered as a potential transport - */ - BrowserPollConnection.forceDisallow = function () { - BrowserPollConnection.forceDisallow_ = true; - }; - // Static method, use string literal so it can be accessed in a generic way - BrowserPollConnection.isAvailable = function () { - if (util.isNodeSdk()) { - return false; - } - else if (BrowserPollConnection.forceAllow_) { - return true; - } - else { - // NOTE: In React-Native there's normally no 'document', but if you debug a React-Native app in - // the Chrome debugger, 'document' is defined, but document.createElement is null (2015/06/08). - return (!BrowserPollConnection.forceDisallow_ && - typeof document !== 'undefined' && - document.createElement != null && - !isChromeExtensionContentScript() && - !isWindowsStoreApp()); - } - }; - /** - * No-op for polling - */ - BrowserPollConnection.prototype.markConnectionHealthy = function () { }; - /** - * Stops polling and cleans up the iframe - */ - BrowserPollConnection.prototype.shutdown_ = function () { - this.isClosed_ = true; - if (this.scriptTagHolder) { - this.scriptTagHolder.close(); - this.scriptTagHolder = null; - } - //remove the disconnect frame, which will trigger an XHR call to the server to tell it we're leaving. - if (this.myDisconnFrame) { - document.body.removeChild(this.myDisconnFrame); - this.myDisconnFrame = null; - } - if (this.connectTimeoutTimer_) { - clearTimeout(this.connectTimeoutTimer_); - this.connectTimeoutTimer_ = null; - } - }; - /** - * Triggered when this transport is closed - */ - BrowserPollConnection.prototype.onClosed_ = function () { - if (!this.isClosed_) { - this.log_('Longpoll is closing itself'); - this.shutdown_(); - if (this.onDisconnect_) { - this.onDisconnect_(this.everConnected_); - this.onDisconnect_ = null; - } - } - }; - /** - * External-facing close handler. RealTime has requested we shut down. Kill our connection and tell the server - * that we've left. - */ - BrowserPollConnection.prototype.close = function () { - if (!this.isClosed_) { - this.log_('Longpoll is being closed.'); - this.shutdown_(); - } - }; - /** - * Send the JSON object down to the server. It will need to be stringified, base64 encoded, and then - * broken into chunks (since URLs have a small maximum length). - * @param data - The JSON data to transmit. - */ - BrowserPollConnection.prototype.send = function (data) { - var dataStr = util.stringify(data); - this.bytesSent += dataStr.length; - this.stats_.incrementCounter('bytes_sent', dataStr.length); - //first, lets get the base64-encoded data - var base64data = util.base64Encode(dataStr); - //We can only fit a certain amount in each URL, so we need to split this request - //up into multiple pieces if it doesn't fit in one request. - var dataSegs = splitStringBySize(base64data, MAX_PAYLOAD_SIZE); - //Enqueue each segment for transmission. We assign each chunk a sequential ID and a total number - //of segments so that we can reassemble the packet on the server. - for (var i = 0; i < dataSegs.length; i++) { - this.scriptTagHolder.enqueueSegment(this.curSegmentNum, dataSegs.length, dataSegs[i]); - this.curSegmentNum++; - } - }; - /** - * This is how we notify the server that we're leaving. - * We aren't able to send requests with DHTML on a window close event, but we can - * trigger XHR requests in some browsers (everything but Opera basically). - */ - BrowserPollConnection.prototype.addDisconnectPingFrame = function (id, pw) { - if (util.isNodeSdk()) { - return; - } - this.myDisconnFrame = document.createElement('iframe'); - var urlParams = {}; - urlParams[FIREBASE_LONGPOLL_DISCONN_FRAME_REQUEST_PARAM] = 't'; - urlParams[FIREBASE_LONGPOLL_ID_PARAM] = id; - urlParams[FIREBASE_LONGPOLL_PW_PARAM] = pw; - this.myDisconnFrame.src = this.urlFn(urlParams); - this.myDisconnFrame.style.display = 'none'; - document.body.appendChild(this.myDisconnFrame); - }; - /** - * Used to track the bytes received by this client - */ - BrowserPollConnection.prototype.incrementIncomingBytes_ = function (args) { - // TODO: This is an annoying perf hit just to track the number of incoming bytes. Maybe it should be opt-in. - var bytesReceived = util.stringify(args).length; - this.bytesReceived += bytesReceived; - this.stats_.incrementCounter('bytes_received', bytesReceived); - }; - return BrowserPollConnection; -}()); -/********************************************************************************************* - * A wrapper around an iframe that is used as a long-polling script holder. - *********************************************************************************************/ -var FirebaseIFrameScriptHolder = /** @class */ (function () { - /** - * @param commandCB - The callback to be called when control commands are recevied from the server. - * @param onMessageCB - The callback to be triggered when responses arrive from the server. - * @param onDisconnect - The callback to be triggered when this tag holder is closed - * @param urlFn - A function that provides the URL of the endpoint to send data to. - */ - function FirebaseIFrameScriptHolder(commandCB, onMessageCB, onDisconnect, urlFn) { - this.onDisconnect = onDisconnect; - this.urlFn = urlFn; - //We maintain a count of all of the outstanding requests, because if we have too many active at once it can cause - //problems in some browsers. - this.outstandingRequests = new Set(); - //A queue of the pending segments waiting for transmission to the server. - this.pendingSegs = []; - //A serial number. We use this for two things: - // 1) A way to ensure the browser doesn't cache responses to polls - // 2) A way to make the server aware when long-polls arrive in a different order than we started them. The - // server needs to release both polls in this case or it will cause problems in Opera since Opera can only execute - // JSONP code in the order it was added to the iframe. - this.currentSerial = Math.floor(Math.random() * 100000000); - // This gets set to false when we're "closing down" the connection (e.g. we're switching transports but there's still - // incoming data from the server that we're waiting for). - this.sendNewPolls = true; - if (!util.isNodeSdk()) { - //Each script holder registers a couple of uniquely named callbacks with the window. These are called from the - //iframes where we put the long-polling script tags. We have two callbacks: - // 1) Command Callback - Triggered for control issues, like starting a connection. - // 2) Message Callback - Triggered when new data arrives. - this.uniqueCallbackIdentifier = LUIDGenerator(); - window[FIREBASE_LONGPOLL_COMMAND_CB_NAME + this.uniqueCallbackIdentifier] = commandCB; - window[FIREBASE_LONGPOLL_DATA_CB_NAME + this.uniqueCallbackIdentifier] = - onMessageCB; - //Create an iframe for us to add script tags to. - this.myIFrame = FirebaseIFrameScriptHolder.createIFrame_(); - // Set the iframe's contents. - var script = ''; - // if we set a javascript url, it's IE and we need to set the document domain. The javascript url is sufficient - // for ie9, but ie8 needs to do it again in the document itself. - if (this.myIFrame.src && - this.myIFrame.src.substr(0, 'javascript:'.length) === 'javascript:') { - var currentDomain = document.domain; - script = ''; - } - var iframeContents = '' + script + ''; - try { - this.myIFrame.doc.open(); - this.myIFrame.doc.write(iframeContents); - this.myIFrame.doc.close(); - } - catch (e) { - log('frame writing exception'); - if (e.stack) { - log(e.stack); - } - log(e); - } - } - else { - this.commandCB = commandCB; - this.onMessageCB = onMessageCB; - } - } - /** - * Each browser has its own funny way to handle iframes. Here we mush them all together into one object that I can - * actually use. - */ - FirebaseIFrameScriptHolder.createIFrame_ = function () { - var iframe = document.createElement('iframe'); - iframe.style.display = 'none'; - // This is necessary in order to initialize the document inside the iframe - if (document.body) { - document.body.appendChild(iframe); - try { - // If document.domain has been modified in IE, this will throw an error, and we need to set the - // domain of the iframe's document manually. We can do this via a javascript: url as the src attribute - // Also note that we must do this *after* the iframe has been appended to the page. Otherwise it doesn't work. - var a = iframe.contentWindow.document; - if (!a) { - // Apologies for the log-spam, I need to do something to keep closure from optimizing out the assignment above. - log('No IE domain setting required'); - } - } - catch (e) { - var domain = document.domain; - iframe.src = - "javascript:void((function(){document.open();document.domain='" + - domain + - "';document.close();})())"; - } - } - else { - // LongPollConnection attempts to delay initialization until the document is ready, so hopefully this - // never gets hit. - throw 'Document body has not initialized. Wait to initialize Firebase until after the document is ready.'; - } - // Get the document of the iframe in a browser-specific way. - if (iframe.contentDocument) { - iframe.doc = iframe.contentDocument; // Firefox, Opera, Safari - } - else if (iframe.contentWindow) { - iframe.doc = iframe.contentWindow.document; // Internet Explorer - // eslint-disable-next-line @typescript-eslint/no-explicit-any - } - else if (iframe.document) { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - iframe.doc = iframe.document; //others? - } - return iframe; - }; - /** - * Cancel all outstanding queries and remove the frame. - */ - FirebaseIFrameScriptHolder.prototype.close = function () { - var _this = this; - //Mark this iframe as dead, so no new requests are sent. - this.alive = false; - if (this.myIFrame) { - //We have to actually remove all of the html inside this iframe before removing it from the - //window, or IE will continue loading and executing the script tags we've already added, which - //can lead to some errors being thrown. Setting innerHTML seems to be the easiest way to do this. - this.myIFrame.doc.body.innerHTML = ''; - setTimeout(function () { - if (_this.myIFrame !== null) { - document.body.removeChild(_this.myIFrame); - _this.myIFrame = null; - } - }, Math.floor(0)); - } - // Protect from being called recursively. - var onDisconnect = this.onDisconnect; - if (onDisconnect) { - this.onDisconnect = null; - onDisconnect(); - } - }; - /** - * Actually start the long-polling session by adding the first script tag(s) to the iframe. - * @param id - The ID of this connection - * @param pw - The password for this connection - */ - FirebaseIFrameScriptHolder.prototype.startLongPoll = function (id, pw) { - this.myID = id; - this.myPW = pw; - this.alive = true; - //send the initial request. If there are requests queued, make sure that we transmit as many as we are currently able to. - while (this.newRequest_()) { } - }; - /** - * This is called any time someone might want a script tag to be added. It adds a script tag when there aren't - * too many outstanding requests and we are still alive. - * - * If there are outstanding packet segments to send, it sends one. If there aren't, it sends a long-poll anyways if - * needed. - */ - FirebaseIFrameScriptHolder.prototype.newRequest_ = function () { - // We keep one outstanding request open all the time to receive data, but if we need to send data - // (pendingSegs.length > 0) then we create a new request to send the data. The server will automatically - // close the old request. - if (this.alive && - this.sendNewPolls && - this.outstandingRequests.size < (this.pendingSegs.length > 0 ? 2 : 1)) { - //construct our url - this.currentSerial++; - var urlParams = {}; - urlParams[FIREBASE_LONGPOLL_ID_PARAM] = this.myID; - urlParams[FIREBASE_LONGPOLL_PW_PARAM] = this.myPW; - urlParams[FIREBASE_LONGPOLL_SERIAL_PARAM] = this.currentSerial; - var theURL = this.urlFn(urlParams); - //Now add as much data as we can. - var curDataString = ''; - var i = 0; - while (this.pendingSegs.length > 0) { - //first, lets see if the next segment will fit. - var nextSeg = this.pendingSegs[0]; - if (nextSeg.d.length + - SEG_HEADER_SIZE + - curDataString.length <= - MAX_URL_DATA_SIZE) { - //great, the segment will fit. Lets append it. - var theSeg = this.pendingSegs.shift(); - curDataString = - curDataString + - '&' + - FIREBASE_LONGPOLL_SEGMENT_NUM_PARAM + - i + - '=' + - theSeg.seg + - '&' + - FIREBASE_LONGPOLL_SEGMENTS_IN_PACKET + - i + - '=' + - theSeg.ts + - '&' + - FIREBASE_LONGPOLL_DATA_PARAM + - i + - '=' + - theSeg.d; - i++; - } - else { - break; - } - } - theURL = theURL + curDataString; - this.addLongPollTag_(theURL, this.currentSerial); - return true; - } - else { - return false; - } - }; - /** - * Queue a packet for transmission to the server. - * @param segnum - A sequential id for this packet segment used for reassembly - * @param totalsegs - The total number of segments in this packet - * @param data - The data for this segment. - */ - FirebaseIFrameScriptHolder.prototype.enqueueSegment = function (segnum, totalsegs, data) { - //add this to the queue of segments to send. - this.pendingSegs.push({ seg: segnum, ts: totalsegs, d: data }); - //send the data immediately if there isn't already data being transmitted, unless - //startLongPoll hasn't been called yet. - if (this.alive) { - this.newRequest_(); - } - }; - /** - * Add a script tag for a regular long-poll request. - * @param url - The URL of the script tag. - * @param serial - The serial number of the request. - */ - FirebaseIFrameScriptHolder.prototype.addLongPollTag_ = function (url, serial) { - var _this = this; - //remember that we sent this request. - this.outstandingRequests.add(serial); - var doNewRequest = function () { - _this.outstandingRequests.delete(serial); - _this.newRequest_(); - }; - // If this request doesn't return on its own accord (by the server sending us some data), we'll - // create a new one after the KEEPALIVE interval to make sure we always keep a fresh request open. - var keepaliveTimeout = setTimeout(doNewRequest, Math.floor(KEEPALIVE_REQUEST_INTERVAL)); - var readyStateCB = function () { - // Request completed. Cancel the keepalive. - clearTimeout(keepaliveTimeout); - // Trigger a new request so we can continue receiving data. - doNewRequest(); - }; - this.addTag(url, readyStateCB); - }; - /** - * Add an arbitrary script tag to the iframe. - * @param url - The URL for the script tag source. - * @param loadCB - A callback to be triggered once the script has loaded. - */ - FirebaseIFrameScriptHolder.prototype.addTag = function (url, loadCB) { - var _this = this; - if (util.isNodeSdk()) { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - this.doNodeLongPoll(url, loadCB); - } - else { - setTimeout(function () { - try { - // if we're already closed, don't add this poll - if (!_this.sendNewPolls) { - return; - } - var newScript_1 = _this.myIFrame.doc.createElement('script'); - newScript_1.type = 'text/javascript'; - newScript_1.async = true; - newScript_1.src = url; - // eslint-disable-next-line @typescript-eslint/no-explicit-any - newScript_1.onload = newScript_1.onreadystatechange = - function () { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - var rstate = newScript_1.readyState; - if (!rstate || rstate === 'loaded' || rstate === 'complete') { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - newScript_1.onload = newScript_1.onreadystatechange = null; - if (newScript_1.parentNode) { - newScript_1.parentNode.removeChild(newScript_1); - } - loadCB(); - } - }; - newScript_1.onerror = function () { - log('Long-poll script failed to load: ' + url); - _this.sendNewPolls = false; - _this.close(); - }; - _this.myIFrame.doc.body.appendChild(newScript_1); - } - catch (e) { - // TODO: we should make this error visible somehow - } - }, Math.floor(1)); - } - }; - return FirebaseIFrameScriptHolder; -}()); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Currently simplistic, this class manages what transport a Connection should use at various stages of its - * lifecycle. - * - * It starts with longpolling in a browser, and httppolling on node. It then upgrades to websockets if - * they are available. - */ -var TransportManager = /** @class */ (function () { - /** - * @param repoInfo - Metadata around the namespace we're connecting to - */ - function TransportManager(repoInfo) { - this.initTransports_(repoInfo); - } - Object.defineProperty(TransportManager, "ALL_TRANSPORTS", { - get: function () { - return [BrowserPollConnection, WebSocketConnection]; - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(TransportManager, "IS_TRANSPORT_INITIALIZED", { - /** - * Returns whether transport has been selected to ensure WebSocketConnection or BrowserPollConnection are not called after - * TransportManager has already set up transports_ - */ - get: function () { - return this.globalTransportInitialized_; - }, - enumerable: false, - configurable: true - }); - TransportManager.prototype.initTransports_ = function (repoInfo) { - var e_1, _a; - var isWebSocketsAvailable = WebSocketConnection && WebSocketConnection['isAvailable'](); - var isSkipPollConnection = isWebSocketsAvailable && !WebSocketConnection.previouslyFailed(); - if (repoInfo.webSocketOnly) { - if (!isWebSocketsAvailable) { - warn$1("wss:// URL used, but browser isn't known to support websockets. Trying anyway."); - } - isSkipPollConnection = true; - } - if (isSkipPollConnection) { - this.transports_ = [WebSocketConnection]; - } - else { - var transports = (this.transports_ = []); - try { - for (var _b = tslib.__values(TransportManager.ALL_TRANSPORTS), _c = _b.next(); !_c.done; _c = _b.next()) { - var transport = _c.value; - if (transport && transport['isAvailable']()) { - transports.push(transport); - } - } - } - catch (e_1_1) { e_1 = { error: e_1_1 }; } - finally { - try { - if (_c && !_c.done && (_a = _b.return)) _a.call(_b); - } - finally { if (e_1) throw e_1.error; } - } - TransportManager.globalTransportInitialized_ = true; - } - }; - /** - * @returns The constructor for the initial transport to use - */ - TransportManager.prototype.initialTransport = function () { - if (this.transports_.length > 0) { - return this.transports_[0]; - } - else { - throw new Error('No transports available'); - } - }; - /** - * @returns The constructor for the next transport, or null - */ - TransportManager.prototype.upgradeTransport = function () { - if (this.transports_.length > 1) { - return this.transports_[1]; - } - else { - return null; - } - }; - // Keeps track of whether the TransportManager has already chosen a transport to use - TransportManager.globalTransportInitialized_ = false; - return TransportManager; -}()); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Abort upgrade attempt if it takes longer than 60s. -var UPGRADE_TIMEOUT = 60000; -// For some transports (WebSockets), we need to "validate" the transport by exchanging a few requests and responses. -// If we haven't sent enough requests within 5s, we'll start sending noop ping requests. -var DELAY_BEFORE_SENDING_EXTRA_REQUESTS = 5000; -// If the initial data sent triggers a lot of bandwidth (i.e. it's a large put or a listen for a large amount of data) -// then we may not be able to exchange our ping/pong requests within the healthy timeout. So if we reach the timeout -// but we've sent/received enough bytes, we don't cancel the connection. -var BYTES_SENT_HEALTHY_OVERRIDE = 10 * 1024; -var BYTES_RECEIVED_HEALTHY_OVERRIDE = 100 * 1024; -var MESSAGE_TYPE = 't'; -var MESSAGE_DATA = 'd'; -var CONTROL_SHUTDOWN = 's'; -var CONTROL_RESET = 'r'; -var CONTROL_ERROR = 'e'; -var CONTROL_PONG = 'o'; -var SWITCH_ACK = 'a'; -var END_TRANSMISSION = 'n'; -var PING = 'p'; -var SERVER_HELLO = 'h'; -/** - * Creates a new real-time connection to the server using whichever method works - * best in the current browser. - */ -var Connection = /** @class */ (function () { - /** - * @param id - an id for this connection - * @param repoInfo_ - the info for the endpoint to connect to - * @param applicationId_ - the Firebase App ID for this project - * @param appCheckToken_ - The App Check Token for this device. - * @param authToken_ - The auth token for this session. - * @param onMessage_ - the callback to be triggered when a server-push message arrives - * @param onReady_ - the callback to be triggered when this connection is ready to send messages. - * @param onDisconnect_ - the callback to be triggered when a connection was lost - * @param onKill_ - the callback to be triggered when this connection has permanently shut down. - * @param lastSessionId - last session id in persistent connection. is used to clean up old session in real-time server - */ - function Connection(id, repoInfo_, applicationId_, appCheckToken_, authToken_, onMessage_, onReady_, onDisconnect_, onKill_, lastSessionId) { - this.id = id; - this.repoInfo_ = repoInfo_; - this.applicationId_ = applicationId_; - this.appCheckToken_ = appCheckToken_; - this.authToken_ = authToken_; - this.onMessage_ = onMessage_; - this.onReady_ = onReady_; - this.onDisconnect_ = onDisconnect_; - this.onKill_ = onKill_; - this.lastSessionId = lastSessionId; - this.connectionCount = 0; - this.pendingDataMessages = []; - this.state_ = 0 /* CONNECTING */; - this.log_ = logWrapper('c:' + this.id + ':'); - this.transportManager_ = new TransportManager(repoInfo_); - this.log_('Connection created'); - this.start_(); - } - /** - * Starts a connection attempt - */ - Connection.prototype.start_ = function () { - var _this = this; - var conn = this.transportManager_.initialTransport(); - this.conn_ = new conn(this.nextTransportId_(), this.repoInfo_, this.applicationId_, this.appCheckToken_, this.authToken_, null, this.lastSessionId); - // For certain transports (WebSockets), we need to send and receive several messages back and forth before we - // can consider the transport healthy. - this.primaryResponsesRequired_ = conn['responsesRequiredToBeHealthy'] || 0; - var onMessageReceived = this.connReceiver_(this.conn_); - var onConnectionLost = this.disconnReceiver_(this.conn_); - this.tx_ = this.conn_; - this.rx_ = this.conn_; - this.secondaryConn_ = null; - this.isHealthy_ = false; - /* - * Firefox doesn't like when code from one iframe tries to create another iframe by way of the parent frame. - * This can occur in the case of a redirect, i.e. we guessed wrong on what server to connect to and received a reset. - * Somehow, setTimeout seems to make this ok. That doesn't make sense from a security perspective, since you should - * still have the context of your originating frame. - */ - setTimeout(function () { - // this.conn_ gets set to null in some of the tests. Check to make sure it still exists before using it - _this.conn_ && _this.conn_.open(onMessageReceived, onConnectionLost); - }, Math.floor(0)); - var healthyTimeoutMS = conn['healthyTimeout'] || 0; - if (healthyTimeoutMS > 0) { - this.healthyTimeout_ = setTimeoutNonBlocking(function () { - _this.healthyTimeout_ = null; - if (!_this.isHealthy_) { - if (_this.conn_ && - _this.conn_.bytesReceived > BYTES_RECEIVED_HEALTHY_OVERRIDE) { - _this.log_('Connection exceeded healthy timeout but has received ' + - _this.conn_.bytesReceived + - ' bytes. Marking connection healthy.'); - _this.isHealthy_ = true; - _this.conn_.markConnectionHealthy(); - } - else if (_this.conn_ && - _this.conn_.bytesSent > BYTES_SENT_HEALTHY_OVERRIDE) { - _this.log_('Connection exceeded healthy timeout but has sent ' + - _this.conn_.bytesSent + - ' bytes. Leaving connection alive.'); - // NOTE: We don't want to mark it healthy, since we have no guarantee that the bytes have made it to - // the server. - } - else { - _this.log_('Closing unhealthy connection after timeout.'); - _this.close(); - } - } - // eslint-disable-next-line @typescript-eslint/no-explicit-any - }, Math.floor(healthyTimeoutMS)); - } - }; - Connection.prototype.nextTransportId_ = function () { - return 'c:' + this.id + ':' + this.connectionCount++; - }; - Connection.prototype.disconnReceiver_ = function (conn) { - var _this = this; - return function (everConnected) { - if (conn === _this.conn_) { - _this.onConnectionLost_(everConnected); - } - else if (conn === _this.secondaryConn_) { - _this.log_('Secondary connection lost.'); - _this.onSecondaryConnectionLost_(); - } - else { - _this.log_('closing an old connection'); - } - }; - }; - Connection.prototype.connReceiver_ = function (conn) { - var _this = this; - return function (message) { - if (_this.state_ !== 2 /* DISCONNECTED */) { - if (conn === _this.rx_) { - _this.onPrimaryMessageReceived_(message); - } - else if (conn === _this.secondaryConn_) { - _this.onSecondaryMessageReceived_(message); - } - else { - _this.log_('message on old connection'); - } - } - }; - }; - /** - * @param dataMsg - An arbitrary data message to be sent to the server - */ - Connection.prototype.sendRequest = function (dataMsg) { - // wrap in a data message envelope and send it on - var msg = { t: 'd', d: dataMsg }; - this.sendData_(msg); - }; - Connection.prototype.tryCleanupConnection = function () { - if (this.tx_ === this.secondaryConn_ && this.rx_ === this.secondaryConn_) { - this.log_('cleaning up and promoting a connection: ' + this.secondaryConn_.connId); - this.conn_ = this.secondaryConn_; - this.secondaryConn_ = null; - // the server will shutdown the old connection - } - }; - Connection.prototype.onSecondaryControl_ = function (controlData) { - if (MESSAGE_TYPE in controlData) { - var cmd = controlData[MESSAGE_TYPE]; - if (cmd === SWITCH_ACK) { - this.upgradeIfSecondaryHealthy_(); - } - else if (cmd === CONTROL_RESET) { - // Most likely the session wasn't valid. Abandon the switch attempt - this.log_('Got a reset on secondary, closing it'); - this.secondaryConn_.close(); - // If we were already using this connection for something, than we need to fully close - if (this.tx_ === this.secondaryConn_ || - this.rx_ === this.secondaryConn_) { - this.close(); - } - } - else if (cmd === CONTROL_PONG) { - this.log_('got pong on secondary.'); - this.secondaryResponsesRequired_--; - this.upgradeIfSecondaryHealthy_(); - } - } - }; - Connection.prototype.onSecondaryMessageReceived_ = function (parsedData) { - var layer = requireKey('t', parsedData); - var data = requireKey('d', parsedData); - if (layer === 'c') { - this.onSecondaryControl_(data); - } - else if (layer === 'd') { - // got a data message, but we're still second connection. Need to buffer it up - this.pendingDataMessages.push(data); - } - else { - throw new Error('Unknown protocol layer: ' + layer); - } - }; - Connection.prototype.upgradeIfSecondaryHealthy_ = function () { - if (this.secondaryResponsesRequired_ <= 0) { - this.log_('Secondary connection is healthy.'); - this.isHealthy_ = true; - this.secondaryConn_.markConnectionHealthy(); - this.proceedWithUpgrade_(); - } - else { - // Send a ping to make sure the connection is healthy. - this.log_('sending ping on secondary.'); - this.secondaryConn_.send({ t: 'c', d: { t: PING, d: {} } }); - } - }; - Connection.prototype.proceedWithUpgrade_ = function () { - // tell this connection to consider itself open - this.secondaryConn_.start(); - // send ack - this.log_('sending client ack on secondary'); - this.secondaryConn_.send({ t: 'c', d: { t: SWITCH_ACK, d: {} } }); - // send end packet on primary transport, switch to sending on this one - // can receive on this one, buffer responses until end received on primary transport - this.log_('Ending transmission on primary'); - this.conn_.send({ t: 'c', d: { t: END_TRANSMISSION, d: {} } }); - this.tx_ = this.secondaryConn_; - this.tryCleanupConnection(); - }; - Connection.prototype.onPrimaryMessageReceived_ = function (parsedData) { - // Must refer to parsedData properties in quotes, so closure doesn't touch them. - var layer = requireKey('t', parsedData); - var data = requireKey('d', parsedData); - if (layer === 'c') { - this.onControl_(data); - } - else if (layer === 'd') { - this.onDataMessage_(data); - } - }; - Connection.prototype.onDataMessage_ = function (message) { - this.onPrimaryResponse_(); - // We don't do anything with data messages, just kick them up a level - this.onMessage_(message); - }; - Connection.prototype.onPrimaryResponse_ = function () { - if (!this.isHealthy_) { - this.primaryResponsesRequired_--; - if (this.primaryResponsesRequired_ <= 0) { - this.log_('Primary connection is healthy.'); - this.isHealthy_ = true; - this.conn_.markConnectionHealthy(); - } - } - }; - Connection.prototype.onControl_ = function (controlData) { - var cmd = requireKey(MESSAGE_TYPE, controlData); - if (MESSAGE_DATA in controlData) { - var payload = controlData[MESSAGE_DATA]; - if (cmd === SERVER_HELLO) { - this.onHandshake_(payload); - } - else if (cmd === END_TRANSMISSION) { - this.log_('recvd end transmission on primary'); - this.rx_ = this.secondaryConn_; - for (var i = 0; i < this.pendingDataMessages.length; ++i) { - this.onDataMessage_(this.pendingDataMessages[i]); - } - this.pendingDataMessages = []; - this.tryCleanupConnection(); - } - else if (cmd === CONTROL_SHUTDOWN) { - // This was previously the 'onKill' callback passed to the lower-level connection - // payload in this case is the reason for the shutdown. Generally a human-readable error - this.onConnectionShutdown_(payload); - } - else if (cmd === CONTROL_RESET) { - // payload in this case is the host we should contact - this.onReset_(payload); - } - else if (cmd === CONTROL_ERROR) { - error('Server Error: ' + payload); - } - else if (cmd === CONTROL_PONG) { - this.log_('got pong on primary.'); - this.onPrimaryResponse_(); - this.sendPingOnPrimaryIfNecessary_(); - } - else { - error('Unknown control packet command: ' + cmd); - } - } - }; - /** - * @param handshake - The handshake data returned from the server - */ - Connection.prototype.onHandshake_ = function (handshake) { - var timestamp = handshake.ts; - var version = handshake.v; - var host = handshake.h; - this.sessionId = handshake.s; - this.repoInfo_.host = host; - // if we've already closed the connection, then don't bother trying to progress further - if (this.state_ === 0 /* CONNECTING */) { - this.conn_.start(); - this.onConnectionEstablished_(this.conn_, timestamp); - if (PROTOCOL_VERSION !== version) { - warn$1('Protocol version mismatch detected'); - } - // TODO: do we want to upgrade? when? maybe a delay? - this.tryStartUpgrade_(); - } - }; - Connection.prototype.tryStartUpgrade_ = function () { - var conn = this.transportManager_.upgradeTransport(); - if (conn) { - this.startUpgrade_(conn); - } - }; - Connection.prototype.startUpgrade_ = function (conn) { - var _this = this; - this.secondaryConn_ = new conn(this.nextTransportId_(), this.repoInfo_, this.applicationId_, this.appCheckToken_, this.authToken_, this.sessionId); - // For certain transports (WebSockets), we need to send and receive several messages back and forth before we - // can consider the transport healthy. - this.secondaryResponsesRequired_ = - conn['responsesRequiredToBeHealthy'] || 0; - var onMessage = this.connReceiver_(this.secondaryConn_); - var onDisconnect = this.disconnReceiver_(this.secondaryConn_); - this.secondaryConn_.open(onMessage, onDisconnect); - // If we haven't successfully upgraded after UPGRADE_TIMEOUT, give up and kill the secondary. - setTimeoutNonBlocking(function () { - if (_this.secondaryConn_) { - _this.log_('Timed out trying to upgrade.'); - _this.secondaryConn_.close(); - } - }, Math.floor(UPGRADE_TIMEOUT)); - }; - Connection.prototype.onReset_ = function (host) { - this.log_('Reset packet received. New host: ' + host); - this.repoInfo_.host = host; - // TODO: if we're already "connected", we need to trigger a disconnect at the next layer up. - // We don't currently support resets after the connection has already been established - if (this.state_ === 1 /* CONNECTED */) { - this.close(); - } - else { - // Close whatever connections we have open and start again. - this.closeConnections_(); - this.start_(); - } - }; - Connection.prototype.onConnectionEstablished_ = function (conn, timestamp) { - var _this = this; - this.log_('Realtime connection established.'); - this.conn_ = conn; - this.state_ = 1 /* CONNECTED */; - if (this.onReady_) { - this.onReady_(timestamp, this.sessionId); - this.onReady_ = null; - } - // If after 5 seconds we haven't sent enough requests to the server to get the connection healthy, - // send some pings. - if (this.primaryResponsesRequired_ === 0) { - this.log_('Primary connection is healthy.'); - this.isHealthy_ = true; - } - else { - setTimeoutNonBlocking(function () { - _this.sendPingOnPrimaryIfNecessary_(); - }, Math.floor(DELAY_BEFORE_SENDING_EXTRA_REQUESTS)); - } - }; - Connection.prototype.sendPingOnPrimaryIfNecessary_ = function () { - // If the connection isn't considered healthy yet, we'll send a noop ping packet request. - if (!this.isHealthy_ && this.state_ === 1 /* CONNECTED */) { - this.log_('sending ping on primary.'); - this.sendData_({ t: 'c', d: { t: PING, d: {} } }); - } - }; - Connection.prototype.onSecondaryConnectionLost_ = function () { - var conn = this.secondaryConn_; - this.secondaryConn_ = null; - if (this.tx_ === conn || this.rx_ === conn) { - // we are relying on this connection already in some capacity. Therefore, a failure is real - this.close(); - } - }; - /** - * @param everConnected - Whether or not the connection ever reached a server. Used to determine if - * we should flush the host cache - */ - Connection.prototype.onConnectionLost_ = function (everConnected) { - this.conn_ = null; - // NOTE: IF you're seeing a Firefox error for this line, I think it might be because it's getting - // called on window close and RealtimeState.CONNECTING is no longer defined. Just a guess. - if (!everConnected && this.state_ === 0 /* CONNECTING */) { - this.log_('Realtime connection failed.'); - // Since we failed to connect at all, clear any cached entry for this namespace in case the machine went away - if (this.repoInfo_.isCacheableHost()) { - PersistentStorage.remove('host:' + this.repoInfo_.host); - // reset the internal host to what we would show the user, i.e. .firebaseio.com - this.repoInfo_.internalHost = this.repoInfo_.host; - } - } - else if (this.state_ === 1 /* CONNECTED */) { - this.log_('Realtime connection lost.'); - } - this.close(); - }; - Connection.prototype.onConnectionShutdown_ = function (reason) { - this.log_('Connection shutdown command received. Shutting down...'); - if (this.onKill_) { - this.onKill_(reason); - this.onKill_ = null; - } - // We intentionally don't want to fire onDisconnect (kill is a different case), - // so clear the callback. - this.onDisconnect_ = null; - this.close(); - }; - Connection.prototype.sendData_ = function (data) { - if (this.state_ !== 1 /* CONNECTED */) { - throw 'Connection is not connected'; - } - else { - this.tx_.send(data); - } - }; - /** - * Cleans up this connection, calling the appropriate callbacks - */ - Connection.prototype.close = function () { - if (this.state_ !== 2 /* DISCONNECTED */) { - this.log_('Closing realtime connection.'); - this.state_ = 2 /* DISCONNECTED */; - this.closeConnections_(); - if (this.onDisconnect_) { - this.onDisconnect_(); - this.onDisconnect_ = null; - } - } - }; - Connection.prototype.closeConnections_ = function () { - this.log_('Shutting down all connections'); - if (this.conn_) { - this.conn_.close(); - this.conn_ = null; - } - if (this.secondaryConn_) { - this.secondaryConn_.close(); - this.secondaryConn_ = null; - } - if (this.healthyTimeout_) { - clearTimeout(this.healthyTimeout_); - this.healthyTimeout_ = null; - } - }; - return Connection; -}()); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Interface defining the set of actions that can be performed against the Firebase server - * (basically corresponds to our wire protocol). - * - * @interface - */ -var ServerActions = /** @class */ (function () { - function ServerActions() { - } - ServerActions.prototype.put = function (pathString, data, onComplete, hash) { }; - ServerActions.prototype.merge = function (pathString, data, onComplete, hash) { }; - /** - * Refreshes the auth token for the current connection. - * @param token - The authentication token - */ - ServerActions.prototype.refreshAuthToken = function (token) { }; - /** - * Refreshes the app check token for the current connection. - * @param token The app check token - */ - ServerActions.prototype.refreshAppCheckToken = function (token) { }; - ServerActions.prototype.onDisconnectPut = function (pathString, data, onComplete) { }; - ServerActions.prototype.onDisconnectMerge = function (pathString, data, onComplete) { }; - ServerActions.prototype.onDisconnectCancel = function (pathString, onComplete) { }; - ServerActions.prototype.reportStats = function (stats) { }; - return ServerActions; -}()); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Base class to be used if you want to emit events. Call the constructor with - * the set of allowed event names. - */ -var EventEmitter = /** @class */ (function () { - function EventEmitter(allowedEvents_) { - this.allowedEvents_ = allowedEvents_; - this.listeners_ = {}; - util.assert(Array.isArray(allowedEvents_) && allowedEvents_.length > 0, 'Requires a non-empty array'); - } - /** - * To be called by derived classes to trigger events. - */ - EventEmitter.prototype.trigger = function (eventType) { - var varArgs = []; - for (var _i = 1; _i < arguments.length; _i++) { - varArgs[_i - 1] = arguments[_i]; - } - if (Array.isArray(this.listeners_[eventType])) { - // Clone the list, since callbacks could add/remove listeners. - var listeners = tslib.__spreadArray([], tslib.__read(this.listeners_[eventType])); - for (var i = 0; i < listeners.length; i++) { - listeners[i].callback.apply(listeners[i].context, varArgs); - } - } - }; - EventEmitter.prototype.on = function (eventType, callback, context) { - this.validateEventType_(eventType); - this.listeners_[eventType] = this.listeners_[eventType] || []; - this.listeners_[eventType].push({ callback: callback, context: context }); - var eventData = this.getInitialEvent(eventType); - if (eventData) { - callback.apply(context, eventData); - } - }; - EventEmitter.prototype.off = function (eventType, callback, context) { - this.validateEventType_(eventType); - var listeners = this.listeners_[eventType] || []; - for (var i = 0; i < listeners.length; i++) { - if (listeners[i].callback === callback && - (!context || context === listeners[i].context)) { - listeners.splice(i, 1); - return; - } - } - }; - EventEmitter.prototype.validateEventType_ = function (eventType) { - util.assert(this.allowedEvents_.find(function (et) { - return et === eventType; - }), 'Unknown event: ' + eventType); - }; - return EventEmitter; -}()); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Monitors online state (as reported by window.online/offline events). - * - * The expectation is that this could have many false positives (thinks we are online - * when we're not), but no false negatives. So we can safely use it to determine when - * we definitely cannot reach the internet. - */ -var OnlineMonitor = /** @class */ (function (_super) { - tslib.__extends(OnlineMonitor, _super); - function OnlineMonitor() { - var _this = _super.call(this, ['online']) || this; - _this.online_ = true; - // We've had repeated complaints that Cordova apps can get stuck "offline", e.g. - // https://forum.ionicframework.com/t/firebase-connection-is-lost-and-never-come-back/43810 - // It would seem that the 'online' event does not always fire consistently. So we disable it - // for Cordova. - if (typeof window !== 'undefined' && - typeof window.addEventListener !== 'undefined' && - !util.isMobileCordova()) { - window.addEventListener('online', function () { - if (!_this.online_) { - _this.online_ = true; - _this.trigger('online', true); - } - }, false); - window.addEventListener('offline', function () { - if (_this.online_) { - _this.online_ = false; - _this.trigger('online', false); - } - }, false); - } - return _this; - } - OnlineMonitor.getInstance = function () { - return new OnlineMonitor(); - }; - OnlineMonitor.prototype.getInitialEvent = function (eventType) { - util.assert(eventType === 'online', 'Unknown event type: ' + eventType); - return [this.online_]; - }; - OnlineMonitor.prototype.currentlyOnline = function () { - return this.online_; - }; - return OnlineMonitor; -}(EventEmitter)); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** Maximum key depth. */ -var MAX_PATH_DEPTH = 32; -/** Maximum number of (UTF8) bytes in a Firebase path. */ -var MAX_PATH_LENGTH_BYTES = 768; -/** - * An immutable object representing a parsed path. It's immutable so that you - * can pass them around to other functions without worrying about them changing - * it. - */ -var Path = /** @class */ (function () { - /** - * @param pathOrString - Path string to parse, or another path, or the raw - * tokens array - */ - function Path(pathOrString, pieceNum) { - if (pieceNum === void 0) { - this.pieces_ = pathOrString.split('/'); - // Remove empty pieces. - var copyTo = 0; - for (var i = 0; i < this.pieces_.length; i++) { - if (this.pieces_[i].length > 0) { - this.pieces_[copyTo] = this.pieces_[i]; - copyTo++; - } - } - this.pieces_.length = copyTo; - this.pieceNum_ = 0; - } - else { - this.pieces_ = pathOrString; - this.pieceNum_ = pieceNum; - } - } - Path.prototype.toString = function () { - var pathString = ''; - for (var i = this.pieceNum_; i < this.pieces_.length; i++) { - if (this.pieces_[i] !== '') { - pathString += '/' + this.pieces_[i]; - } - } - return pathString || '/'; - }; - return Path; -}()); -function newEmptyPath() { - return new Path(''); -} -function pathGetFront(path) { - if (path.pieceNum_ >= path.pieces_.length) { - return null; - } - return path.pieces_[path.pieceNum_]; -} -/** - * @returns The number of segments in this path - */ -function pathGetLength(path) { - return path.pieces_.length - path.pieceNum_; -} -function pathPopFront(path) { - var pieceNum = path.pieceNum_; - if (pieceNum < path.pieces_.length) { - pieceNum++; - } - return new Path(path.pieces_, pieceNum); -} -function pathGetBack(path) { - if (path.pieceNum_ < path.pieces_.length) { - return path.pieces_[path.pieces_.length - 1]; - } - return null; -} -function pathToUrlEncodedString(path) { - var pathString = ''; - for (var i = path.pieceNum_; i < path.pieces_.length; i++) { - if (path.pieces_[i] !== '') { - pathString += '/' + encodeURIComponent(String(path.pieces_[i])); - } - } - return pathString || '/'; -} -/** - * Shallow copy of the parts of the path. - * - */ -function pathSlice(path, begin) { - if (begin === void 0) { begin = 0; } - return path.pieces_.slice(path.pieceNum_ + begin); -} -function pathParent(path) { - if (path.pieceNum_ >= path.pieces_.length) { - return null; - } - var pieces = []; - for (var i = path.pieceNum_; i < path.pieces_.length - 1; i++) { - pieces.push(path.pieces_[i]); - } - return new Path(pieces, 0); -} -function pathChild(path, childPathObj) { - var pieces = []; - for (var i = path.pieceNum_; i < path.pieces_.length; i++) { - pieces.push(path.pieces_[i]); - } - if (childPathObj instanceof Path) { - for (var i = childPathObj.pieceNum_; i < childPathObj.pieces_.length; i++) { - pieces.push(childPathObj.pieces_[i]); - } - } - else { - var childPieces = childPathObj.split('/'); - for (var i = 0; i < childPieces.length; i++) { - if (childPieces[i].length > 0) { - pieces.push(childPieces[i]); - } - } - } - return new Path(pieces, 0); -} -/** - * @returns True if there are no segments in this path - */ -function pathIsEmpty(path) { - return path.pieceNum_ >= path.pieces_.length; -} -/** - * @returns The path from outerPath to innerPath - */ -function newRelativePath(outerPath, innerPath) { - var outer = pathGetFront(outerPath), inner = pathGetFront(innerPath); - if (outer === null) { - return innerPath; - } - else if (outer === inner) { - return newRelativePath(pathPopFront(outerPath), pathPopFront(innerPath)); - } - else { - throw new Error('INTERNAL ERROR: innerPath (' + - innerPath + - ') is not within ' + - 'outerPath (' + - outerPath + - ')'); - } -} -/** - * @returns -1, 0, 1 if left is less, equal, or greater than the right. - */ -function pathCompare(left, right) { - var leftKeys = pathSlice(left, 0); - var rightKeys = pathSlice(right, 0); - for (var i = 0; i < leftKeys.length && i < rightKeys.length; i++) { - var cmp = nameCompare(leftKeys[i], rightKeys[i]); - if (cmp !== 0) { - return cmp; - } - } - if (leftKeys.length === rightKeys.length) { - return 0; - } - return leftKeys.length < rightKeys.length ? -1 : 1; -} -/** - * @returns true if paths are the same. - */ -function pathEquals(path, other) { - if (pathGetLength(path) !== pathGetLength(other)) { - return false; - } - for (var i = path.pieceNum_, j = other.pieceNum_; i <= path.pieces_.length; i++, j++) { - if (path.pieces_[i] !== other.pieces_[j]) { - return false; - } - } - return true; -} -/** - * @returns True if this path is a parent of (or the same as) other - */ -function pathContains(path, other) { - var i = path.pieceNum_; - var j = other.pieceNum_; - if (pathGetLength(path) > pathGetLength(other)) { - return false; - } - while (i < path.pieces_.length) { - if (path.pieces_[i] !== other.pieces_[j]) { - return false; - } - ++i; - ++j; - } - return true; -} -/** - * Dynamic (mutable) path used to count path lengths. - * - * This class is used to efficiently check paths for valid - * length (in UTF8 bytes) and depth (used in path validation). - * - * Throws Error exception if path is ever invalid. - * - * The definition of a path always begins with '/'. - */ -var ValidationPath = /** @class */ (function () { - /** - * @param path - Initial Path. - * @param errorPrefix_ - Prefix for any error messages. - */ - function ValidationPath(path, errorPrefix_) { - this.errorPrefix_ = errorPrefix_; - this.parts_ = pathSlice(path, 0); - /** Initialize to number of '/' chars needed in path. */ - this.byteLength_ = Math.max(1, this.parts_.length); - for (var i = 0; i < this.parts_.length; i++) { - this.byteLength_ += util.stringLength(this.parts_[i]); - } - validationPathCheckValid(this); - } - return ValidationPath; -}()); -function validationPathPush(validationPath, child) { - // Count the needed '/' - if (validationPath.parts_.length > 0) { - validationPath.byteLength_ += 1; - } - validationPath.parts_.push(child); - validationPath.byteLength_ += util.stringLength(child); - validationPathCheckValid(validationPath); -} -function validationPathPop(validationPath) { - var last = validationPath.parts_.pop(); - validationPath.byteLength_ -= util.stringLength(last); - // Un-count the previous '/' - if (validationPath.parts_.length > 0) { - validationPath.byteLength_ -= 1; - } -} -function validationPathCheckValid(validationPath) { - if (validationPath.byteLength_ > MAX_PATH_LENGTH_BYTES) { - throw new Error(validationPath.errorPrefix_ + - 'has a key path longer than ' + - MAX_PATH_LENGTH_BYTES + - ' bytes (' + - validationPath.byteLength_ + - ').'); - } - if (validationPath.parts_.length > MAX_PATH_DEPTH) { - throw new Error(validationPath.errorPrefix_ + - 'path specified exceeds the maximum depth that can be written (' + - MAX_PATH_DEPTH + - ') or object contains a cycle ' + - validationPathToErrorString(validationPath)); - } -} -/** - * String for use in error messages - uses '.' notation for path. - */ -function validationPathToErrorString(validationPath) { - if (validationPath.parts_.length === 0) { - return ''; - } - return "in property '" + validationPath.parts_.join('.') + "'"; -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var VisibilityMonitor = /** @class */ (function (_super) { - tslib.__extends(VisibilityMonitor, _super); - function VisibilityMonitor() { - var _this = _super.call(this, ['visible']) || this; - var hidden; - var visibilityChange; - if (typeof document !== 'undefined' && - typeof document.addEventListener !== 'undefined') { - if (typeof document['hidden'] !== 'undefined') { - // Opera 12.10 and Firefox 18 and later support - visibilityChange = 'visibilitychange'; - hidden = 'hidden'; - } - else if (typeof document['mozHidden'] !== 'undefined') { - visibilityChange = 'mozvisibilitychange'; - hidden = 'mozHidden'; - } - else if (typeof document['msHidden'] !== 'undefined') { - visibilityChange = 'msvisibilitychange'; - hidden = 'msHidden'; - } - else if (typeof document['webkitHidden'] !== 'undefined') { - visibilityChange = 'webkitvisibilitychange'; - hidden = 'webkitHidden'; - } - } - // Initially, we always assume we are visible. This ensures that in browsers - // without page visibility support or in cases where we are never visible - // (e.g. chrome extension), we act as if we are visible, i.e. don't delay - // reconnects - _this.visible_ = true; - if (visibilityChange) { - document.addEventListener(visibilityChange, function () { - var visible = !document[hidden]; - if (visible !== _this.visible_) { - _this.visible_ = visible; - _this.trigger('visible', visible); - } - }, false); - } - return _this; - } - VisibilityMonitor.getInstance = function () { - return new VisibilityMonitor(); - }; - VisibilityMonitor.prototype.getInitialEvent = function (eventType) { - util.assert(eventType === 'visible', 'Unknown event type: ' + eventType); - return [this.visible_]; - }; - return VisibilityMonitor; -}(EventEmitter)); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var RECONNECT_MIN_DELAY = 1000; -var RECONNECT_MAX_DELAY_DEFAULT = 60 * 5 * 1000; // 5 minutes in milliseconds (Case: 1858) -var RECONNECT_MAX_DELAY_FOR_ADMINS = 30 * 1000; // 30 seconds for admin clients (likely to be a backend server) -var RECONNECT_DELAY_MULTIPLIER = 1.3; -var RECONNECT_DELAY_RESET_TIMEOUT = 30000; // Reset delay back to MIN_DELAY after being connected for 30sec. -var SERVER_KILL_INTERRUPT_REASON = 'server_kill'; -// If auth fails repeatedly, we'll assume something is wrong and log a warning / back off. -var INVALID_TOKEN_THRESHOLD = 3; -/** - * Firebase connection. Abstracts wire protocol and handles reconnecting. - * - * NOTE: All JSON objects sent to the realtime connection must have property names enclosed - * in quotes to make sure the closure compiler does not minify them. - */ -var PersistentConnection = /** @class */ (function (_super) { - tslib.__extends(PersistentConnection, _super); - /** - * @param repoInfo_ - Data about the namespace we are connecting to - * @param applicationId_ - The Firebase App ID for this project - * @param onDataUpdate_ - A callback for new data from the server - */ - function PersistentConnection(repoInfo_, applicationId_, onDataUpdate_, onConnectStatus_, onServerInfoUpdate_, authTokenProvider_, appCheckTokenProvider_, authOverride_) { - var _this = _super.call(this) || this; - _this.repoInfo_ = repoInfo_; - _this.applicationId_ = applicationId_; - _this.onDataUpdate_ = onDataUpdate_; - _this.onConnectStatus_ = onConnectStatus_; - _this.onServerInfoUpdate_ = onServerInfoUpdate_; - _this.authTokenProvider_ = authTokenProvider_; - _this.appCheckTokenProvider_ = appCheckTokenProvider_; - _this.authOverride_ = authOverride_; - // Used for diagnostic logging. - _this.id = PersistentConnection.nextPersistentConnectionId_++; - _this.log_ = logWrapper('p:' + _this.id + ':'); - _this.interruptReasons_ = {}; - _this.listens = new Map(); - _this.outstandingPuts_ = []; - _this.outstandingGets_ = []; - _this.outstandingPutCount_ = 0; - _this.outstandingGetCount_ = 0; - _this.onDisconnectRequestQueue_ = []; - _this.connected_ = false; - _this.reconnectDelay_ = RECONNECT_MIN_DELAY; - _this.maxReconnectDelay_ = RECONNECT_MAX_DELAY_DEFAULT; - _this.securityDebugCallback_ = null; - _this.lastSessionId = null; - _this.establishConnectionTimer_ = null; - _this.visible_ = false; - // Before we get connected, we keep a queue of pending messages to send. - _this.requestCBHash_ = {}; - _this.requestNumber_ = 0; - _this.realtime_ = null; - _this.authToken_ = null; - _this.appCheckToken_ = null; - _this.forceTokenRefresh_ = false; - _this.invalidAuthTokenCount_ = 0; - _this.invalidAppCheckTokenCount_ = 0; - _this.firstConnection_ = true; - _this.lastConnectionAttemptTime_ = null; - _this.lastConnectionEstablishedTime_ = null; - if (authOverride_ && !util.isNodeSdk()) { - throw new Error('Auth override specified in options, but not supported on non Node.js platforms'); - } - VisibilityMonitor.getInstance().on('visible', _this.onVisible_, _this); - if (repoInfo_.host.indexOf('fblocal') === -1) { - OnlineMonitor.getInstance().on('online', _this.onOnline_, _this); - } - return _this; - } - PersistentConnection.prototype.sendRequest = function (action, body, onResponse) { - var curReqNum = ++this.requestNumber_; - var msg = { r: curReqNum, a: action, b: body }; - this.log_(util.stringify(msg)); - util.assert(this.connected_, "sendRequest call when we're not connected not allowed."); - this.realtime_.sendRequest(msg); - if (onResponse) { - this.requestCBHash_[curReqNum] = onResponse; - } - }; - PersistentConnection.prototype.get = function (query) { - this.initConnection_(); - var deferred = new util.Deferred(); - var request = { - p: query._path.toString(), - q: query._queryObject - }; - var outstandingGet = { - action: 'g', - request: request, - onComplete: function (message) { - var payload = message['d']; - if (message['s'] === 'ok') { - deferred.resolve(payload); - } - else { - deferred.reject(payload); - } - } - }; - this.outstandingGets_.push(outstandingGet); - this.outstandingGetCount_++; - var index = this.outstandingGets_.length - 1; - if (this.connected_) { - this.sendGet_(index); - } - return deferred.promise; - }; - PersistentConnection.prototype.listen = function (query, currentHashFn, tag, onComplete) { - this.initConnection_(); - var queryId = query._queryIdentifier; - var pathString = query._path.toString(); - this.log_('Listen called for ' + pathString + ' ' + queryId); - if (!this.listens.has(pathString)) { - this.listens.set(pathString, new Map()); - } - util.assert(query._queryParams.isDefault() || !query._queryParams.loadsAllData(), 'listen() called for non-default but complete query'); - util.assert(!this.listens.get(pathString).has(queryId), "listen() called twice for same path/queryId."); - var listenSpec = { - onComplete: onComplete, - hashFn: currentHashFn, - query: query, - tag: tag - }; - this.listens.get(pathString).set(queryId, listenSpec); - if (this.connected_) { - this.sendListen_(listenSpec); - } - }; - PersistentConnection.prototype.sendGet_ = function (index) { - var _this = this; - var get = this.outstandingGets_[index]; - this.sendRequest('g', get.request, function (message) { - delete _this.outstandingGets_[index]; - _this.outstandingGetCount_--; - if (_this.outstandingGetCount_ === 0) { - _this.outstandingGets_ = []; - } - if (get.onComplete) { - get.onComplete(message); - } - }); - }; - PersistentConnection.prototype.sendListen_ = function (listenSpec) { - var _this = this; - var query = listenSpec.query; - var pathString = query._path.toString(); - var queryId = query._queryIdentifier; - this.log_('Listen on ' + pathString + ' for ' + queryId); - var req = { /*path*/ p: pathString }; - var action = 'q'; - // Only bother to send query if it's non-default. - if (listenSpec.tag) { - req['q'] = query._queryObject; - req['t'] = listenSpec.tag; - } - req[ /*hash*/'h'] = listenSpec.hashFn(); - this.sendRequest(action, req, function (message) { - var payload = message[ /*data*/'d']; - var status = message[ /*status*/'s']; - // print warnings in any case... - PersistentConnection.warnOnListenWarnings_(payload, query); - var currentListenSpec = _this.listens.get(pathString) && - _this.listens.get(pathString).get(queryId); - // only trigger actions if the listen hasn't been removed and readded - if (currentListenSpec === listenSpec) { - _this.log_('listen response', message); - if (status !== 'ok') { - _this.removeListen_(pathString, queryId); - } - if (listenSpec.onComplete) { - listenSpec.onComplete(status, payload); - } - } - }); - }; - PersistentConnection.warnOnListenWarnings_ = function (payload, query) { - if (payload && typeof payload === 'object' && util.contains(payload, 'w')) { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - var warnings = util.safeGet(payload, 'w'); - if (Array.isArray(warnings) && ~warnings.indexOf('no_index')) { - var indexSpec = '".indexOn": "' + query._queryParams.getIndex().toString() + '"'; - var indexPath = query._path.toString(); - warn$1("Using an unspecified index. Your data will be downloaded and " + - ("filtered on the client. Consider adding " + indexSpec + " at ") + - (indexPath + " to your security rules for better performance.")); - } - } - }; - PersistentConnection.prototype.refreshAuthToken = function (token) { - this.authToken_ = token; - this.log_('Auth token refreshed'); - if (this.authToken_) { - this.tryAuth(); - } - else { - //If we're connected we want to let the server know to unauthenticate us. If we're not connected, simply delete - //the credential so we dont become authenticated next time we connect. - if (this.connected_) { - this.sendRequest('unauth', {}, function () { }); - } - } - this.reduceReconnectDelayIfAdminCredential_(token); - }; - PersistentConnection.prototype.reduceReconnectDelayIfAdminCredential_ = function (credential) { - // NOTE: This isn't intended to be bulletproof (a malicious developer can always just modify the client). - // Additionally, we don't bother resetting the max delay back to the default if auth fails / expires. - var isFirebaseSecret = credential && credential.length === 40; - if (isFirebaseSecret || util.isAdmin(credential)) { - this.log_('Admin auth credential detected. Reducing max reconnect time.'); - this.maxReconnectDelay_ = RECONNECT_MAX_DELAY_FOR_ADMINS; - } - }; - PersistentConnection.prototype.refreshAppCheckToken = function (token) { - this.appCheckToken_ = token; - this.log_('App check token refreshed'); - if (this.appCheckToken_) { - this.tryAppCheck(); - } - else { - //If we're connected we want to let the server know to unauthenticate us. - //If we're not connected, simply delete the credential so we dont become - // authenticated next time we connect. - if (this.connected_) { - this.sendRequest('unappeck', {}, function () { }); - } - } - }; - /** - * Attempts to authenticate with the given credentials. If the authentication attempt fails, it's triggered like - * a auth revoked (the connection is closed). - */ - PersistentConnection.prototype.tryAuth = function () { - var _this = this; - if (this.connected_ && this.authToken_) { - var token_1 = this.authToken_; - var authMethod = util.isValidFormat(token_1) ? 'auth' : 'gauth'; - var requestData = { cred: token_1 }; - if (this.authOverride_ === null) { - requestData['noauth'] = true; - } - else if (typeof this.authOverride_ === 'object') { - requestData['authvar'] = this.authOverride_; - } - this.sendRequest(authMethod, requestData, function (res) { - var status = res[ /*status*/'s']; - var data = res[ /*data*/'d'] || 'error'; - if (_this.authToken_ === token_1) { - if (status === 'ok') { - _this.invalidAuthTokenCount_ = 0; - } - else { - // Triggers reconnect and force refresh for auth token - _this.onAuthRevoked_(status, data); - } - } - }); - } - }; - /** - * Attempts to authenticate with the given token. If the authentication - * attempt fails, it's triggered like the token was revoked (the connection is - * closed). - */ - PersistentConnection.prototype.tryAppCheck = function () { - var _this = this; - if (this.connected_ && this.appCheckToken_) { - this.sendRequest('appcheck', { 'token': this.appCheckToken_ }, function (res) { - var status = res[ /*status*/'s']; - var data = res[ /*data*/'d'] || 'error'; - if (status === 'ok') { - _this.invalidAppCheckTokenCount_ = 0; - } - else { - _this.onAppCheckRevoked_(status, data); - } - }); - } - }; - /** - * @inheritDoc - */ - PersistentConnection.prototype.unlisten = function (query, tag) { - var pathString = query._path.toString(); - var queryId = query._queryIdentifier; - this.log_('Unlisten called for ' + pathString + ' ' + queryId); - util.assert(query._queryParams.isDefault() || !query._queryParams.loadsAllData(), 'unlisten() called for non-default but complete query'); - var listen = this.removeListen_(pathString, queryId); - if (listen && this.connected_) { - this.sendUnlisten_(pathString, queryId, query._queryObject, tag); - } - }; - PersistentConnection.prototype.sendUnlisten_ = function (pathString, queryId, queryObj, tag) { - this.log_('Unlisten on ' + pathString + ' for ' + queryId); - var req = { /*path*/ p: pathString }; - var action = 'n'; - // Only bother sending queryId if it's non-default. - if (tag) { - req['q'] = queryObj; - req['t'] = tag; - } - this.sendRequest(action, req); - }; - PersistentConnection.prototype.onDisconnectPut = function (pathString, data, onComplete) { - this.initConnection_(); - if (this.connected_) { - this.sendOnDisconnect_('o', pathString, data, onComplete); - } - else { - this.onDisconnectRequestQueue_.push({ - pathString: pathString, - action: 'o', - data: data, - onComplete: onComplete - }); - } - }; - PersistentConnection.prototype.onDisconnectMerge = function (pathString, data, onComplete) { - this.initConnection_(); - if (this.connected_) { - this.sendOnDisconnect_('om', pathString, data, onComplete); - } - else { - this.onDisconnectRequestQueue_.push({ - pathString: pathString, - action: 'om', - data: data, - onComplete: onComplete - }); - } - }; - PersistentConnection.prototype.onDisconnectCancel = function (pathString, onComplete) { - this.initConnection_(); - if (this.connected_) { - this.sendOnDisconnect_('oc', pathString, null, onComplete); - } - else { - this.onDisconnectRequestQueue_.push({ - pathString: pathString, - action: 'oc', - data: null, - onComplete: onComplete - }); - } - }; - PersistentConnection.prototype.sendOnDisconnect_ = function (action, pathString, data, onComplete) { - var request = { /*path*/ p: pathString, /*data*/ d: data }; - this.log_('onDisconnect ' + action, request); - this.sendRequest(action, request, function (response) { - if (onComplete) { - setTimeout(function () { - onComplete(response[ /*status*/'s'], response[ /* data */'d']); - }, Math.floor(0)); - } - }); - }; - PersistentConnection.prototype.put = function (pathString, data, onComplete, hash) { - this.putInternal('p', pathString, data, onComplete, hash); - }; - PersistentConnection.prototype.merge = function (pathString, data, onComplete, hash) { - this.putInternal('m', pathString, data, onComplete, hash); - }; - PersistentConnection.prototype.putInternal = function (action, pathString, data, onComplete, hash) { - this.initConnection_(); - var request = { - /*path*/ p: pathString, - /*data*/ d: data - }; - if (hash !== undefined) { - request[ /*hash*/'h'] = hash; - } - // TODO: Only keep track of the most recent put for a given path? - this.outstandingPuts_.push({ - action: action, - request: request, - onComplete: onComplete - }); - this.outstandingPutCount_++; - var index = this.outstandingPuts_.length - 1; - if (this.connected_) { - this.sendPut_(index); - } - else { - this.log_('Buffering put: ' + pathString); - } - }; - PersistentConnection.prototype.sendPut_ = function (index) { - var _this = this; - var action = this.outstandingPuts_[index].action; - var request = this.outstandingPuts_[index].request; - var onComplete = this.outstandingPuts_[index].onComplete; - this.outstandingPuts_[index].queued = this.connected_; - this.sendRequest(action, request, function (message) { - _this.log_(action + ' response', message); - delete _this.outstandingPuts_[index]; - _this.outstandingPutCount_--; - // Clean up array occasionally. - if (_this.outstandingPutCount_ === 0) { - _this.outstandingPuts_ = []; - } - if (onComplete) { - onComplete(message[ /*status*/'s'], message[ /* data */'d']); - } - }); - }; - PersistentConnection.prototype.reportStats = function (stats) { - var _this = this; - // If we're not connected, we just drop the stats. - if (this.connected_) { - var request = { /*counters*/ c: stats }; - this.log_('reportStats', request); - this.sendRequest(/*stats*/ 's', request, function (result) { - var status = result[ /*status*/'s']; - if (status !== 'ok') { - var errorReason = result[ /* data */'d']; - _this.log_('reportStats', 'Error sending stats: ' + errorReason); - } - }); - } - }; - PersistentConnection.prototype.onDataMessage_ = function (message) { - if ('r' in message) { - // this is a response - this.log_('from server: ' + util.stringify(message)); - var reqNum = message['r']; - var onResponse = this.requestCBHash_[reqNum]; - if (onResponse) { - delete this.requestCBHash_[reqNum]; - onResponse(message[ /*body*/'b']); - } - } - else if ('error' in message) { - throw 'A server-side error has occurred: ' + message['error']; - } - else if ('a' in message) { - // a and b are action and body, respectively - this.onDataPush_(message['a'], message['b']); - } - }; - PersistentConnection.prototype.onDataPush_ = function (action, body) { - this.log_('handleServerMessage', action, body); - if (action === 'd') { - this.onDataUpdate_(body[ /*path*/'p'], body[ /*data*/'d'], - /*isMerge*/ false, body['t']); - } - else if (action === 'm') { - this.onDataUpdate_(body[ /*path*/'p'], body[ /*data*/'d'], - /*isMerge=*/ true, body['t']); - } - else if (action === 'c') { - this.onListenRevoked_(body[ /*path*/'p'], body[ /*query*/'q']); - } - else if (action === 'ac') { - this.onAuthRevoked_(body[ /*status code*/'s'], body[ /* explanation */'d']); - } - else if (action === 'apc') { - this.onAppCheckRevoked_(body[ /*status code*/'s'], body[ /* explanation */'d']); - } - else if (action === 'sd') { - this.onSecurityDebugPacket_(body); - } - else { - error('Unrecognized action received from server: ' + - util.stringify(action) + - '\nAre you using the latest client?'); - } - }; - PersistentConnection.prototype.onReady_ = function (timestamp, sessionId) { - this.log_('connection ready'); - this.connected_ = true; - this.lastConnectionEstablishedTime_ = new Date().getTime(); - this.handleTimestamp_(timestamp); - this.lastSessionId = sessionId; - if (this.firstConnection_) { - this.sendConnectStats_(); - } - this.restoreState_(); - this.firstConnection_ = false; - this.onConnectStatus_(true); - }; - PersistentConnection.prototype.scheduleConnect_ = function (timeout) { - var _this = this; - util.assert(!this.realtime_, "Scheduling a connect when we're already connected/ing?"); - if (this.establishConnectionTimer_) { - clearTimeout(this.establishConnectionTimer_); - } - // NOTE: Even when timeout is 0, it's important to do a setTimeout to work around an infuriating "Security Error" in - // Firefox when trying to write to our long-polling iframe in some scenarios (e.g. Forge or our unit tests). - this.establishConnectionTimer_ = setTimeout(function () { - _this.establishConnectionTimer_ = null; - _this.establishConnection_(); - // eslint-disable-next-line @typescript-eslint/no-explicit-any - }, Math.floor(timeout)); - }; - PersistentConnection.prototype.initConnection_ = function () { - if (!this.realtime_ && this.firstConnection_) { - this.scheduleConnect_(0); - } - }; - PersistentConnection.prototype.onVisible_ = function (visible) { - // NOTE: Tabbing away and back to a window will defeat our reconnect backoff, but I think that's fine. - if (visible && - !this.visible_ && - this.reconnectDelay_ === this.maxReconnectDelay_) { - this.log_('Window became visible. Reducing delay.'); - this.reconnectDelay_ = RECONNECT_MIN_DELAY; - if (!this.realtime_) { - this.scheduleConnect_(0); - } - } - this.visible_ = visible; - }; - PersistentConnection.prototype.onOnline_ = function (online) { - if (online) { - this.log_('Browser went online.'); - this.reconnectDelay_ = RECONNECT_MIN_DELAY; - if (!this.realtime_) { - this.scheduleConnect_(0); - } - } - else { - this.log_('Browser went offline. Killing connection.'); - if (this.realtime_) { - this.realtime_.close(); - } - } - }; - PersistentConnection.prototype.onRealtimeDisconnect_ = function () { - this.log_('data client disconnected'); - this.connected_ = false; - this.realtime_ = null; - // Since we don't know if our sent transactions succeeded or not, we need to cancel them. - this.cancelSentTransactions_(); - // Clear out the pending requests. - this.requestCBHash_ = {}; - if (this.shouldReconnect_()) { - if (!this.visible_) { - this.log_("Window isn't visible. Delaying reconnect."); - this.reconnectDelay_ = this.maxReconnectDelay_; - this.lastConnectionAttemptTime_ = new Date().getTime(); - } - else if (this.lastConnectionEstablishedTime_) { - // If we've been connected long enough, reset reconnect delay to minimum. - var timeSinceLastConnectSucceeded = new Date().getTime() - this.lastConnectionEstablishedTime_; - if (timeSinceLastConnectSucceeded > RECONNECT_DELAY_RESET_TIMEOUT) { - this.reconnectDelay_ = RECONNECT_MIN_DELAY; - } - this.lastConnectionEstablishedTime_ = null; - } - var timeSinceLastConnectAttempt = new Date().getTime() - this.lastConnectionAttemptTime_; - var reconnectDelay = Math.max(0, this.reconnectDelay_ - timeSinceLastConnectAttempt); - reconnectDelay = Math.random() * reconnectDelay; - this.log_('Trying to reconnect in ' + reconnectDelay + 'ms'); - this.scheduleConnect_(reconnectDelay); - // Adjust reconnect delay for next time. - this.reconnectDelay_ = Math.min(this.maxReconnectDelay_, this.reconnectDelay_ * RECONNECT_DELAY_MULTIPLIER); - } - this.onConnectStatus_(false); - }; - PersistentConnection.prototype.establishConnection_ = function () { - return tslib.__awaiter(this, void 0, void 0, function () { - var onDataMessage, onReady, onDisconnect_1, connId, lastSessionId, canceled_1, connection_1, closeFn, sendRequestFn, forceRefresh, _a, authToken, appCheckToken, error_1; - var _this = this; - return tslib.__generator(this, function (_b) { - switch (_b.label) { - case 0: - if (!this.shouldReconnect_()) return [3 /*break*/, 4]; - this.log_('Making a connection attempt'); - this.lastConnectionAttemptTime_ = new Date().getTime(); - this.lastConnectionEstablishedTime_ = null; - onDataMessage = this.onDataMessage_.bind(this); - onReady = this.onReady_.bind(this); - onDisconnect_1 = this.onRealtimeDisconnect_.bind(this); - connId = this.id + ':' + PersistentConnection.nextConnectionId_++; - lastSessionId = this.lastSessionId; - canceled_1 = false; - connection_1 = null; - closeFn = function () { - if (connection_1) { - connection_1.close(); - } - else { - canceled_1 = true; - onDisconnect_1(); - } - }; - sendRequestFn = function (msg) { - util.assert(connection_1, "sendRequest call when we're not connected not allowed."); - connection_1.sendRequest(msg); - }; - this.realtime_ = { - close: closeFn, - sendRequest: sendRequestFn - }; - forceRefresh = this.forceTokenRefresh_; - this.forceTokenRefresh_ = false; - _b.label = 1; - case 1: - _b.trys.push([1, 3, , 4]); - return [4 /*yield*/, Promise.all([ - this.authTokenProvider_.getToken(forceRefresh), - this.appCheckTokenProvider_.getToken(forceRefresh) - ])]; - case 2: - _a = tslib.__read.apply(void 0, [_b.sent(), 2]), authToken = _a[0], appCheckToken = _a[1]; - if (!canceled_1) { - log('getToken() completed. Creating connection.'); - this.authToken_ = authToken && authToken.accessToken; - this.appCheckToken_ = appCheckToken && appCheckToken.token; - connection_1 = new Connection(connId, this.repoInfo_, this.applicationId_, this.appCheckToken_, this.authToken_, onDataMessage, onReady, onDisconnect_1, - /* onKill= */ function (reason) { - warn$1(reason + ' (' + _this.repoInfo_.toString() + ')'); - _this.interrupt(SERVER_KILL_INTERRUPT_REASON); - }, lastSessionId); - } - else { - log('getToken() completed but was canceled'); - } - return [3 /*break*/, 4]; - case 3: - error_1 = _b.sent(); - this.log_('Failed to get token: ' + error_1); - if (!canceled_1) { - if (this.repoInfo_.nodeAdmin) { - // This may be a critical error for the Admin Node.js SDK, so log a warning. - // But getToken() may also just have temporarily failed, so we still want to - // continue retrying. - warn$1(error_1); - } - closeFn(); - } - return [3 /*break*/, 4]; - case 4: return [2 /*return*/]; - } - }); - }); - }; - PersistentConnection.prototype.interrupt = function (reason) { - log('Interrupting connection for reason: ' + reason); - this.interruptReasons_[reason] = true; - if (this.realtime_) { - this.realtime_.close(); - } - else { - if (this.establishConnectionTimer_) { - clearTimeout(this.establishConnectionTimer_); - this.establishConnectionTimer_ = null; - } - if (this.connected_) { - this.onRealtimeDisconnect_(); - } - } - }; - PersistentConnection.prototype.resume = function (reason) { - log('Resuming connection for reason: ' + reason); - delete this.interruptReasons_[reason]; - if (util.isEmpty(this.interruptReasons_)) { - this.reconnectDelay_ = RECONNECT_MIN_DELAY; - if (!this.realtime_) { - this.scheduleConnect_(0); - } - } - }; - PersistentConnection.prototype.handleTimestamp_ = function (timestamp) { - var delta = timestamp - new Date().getTime(); - this.onServerInfoUpdate_({ serverTimeOffset: delta }); - }; - PersistentConnection.prototype.cancelSentTransactions_ = function () { - for (var i = 0; i < this.outstandingPuts_.length; i++) { - var put = this.outstandingPuts_[i]; - if (put && /*hash*/ 'h' in put.request && put.queued) { - if (put.onComplete) { - put.onComplete('disconnect'); - } - delete this.outstandingPuts_[i]; - this.outstandingPutCount_--; - } - } - // Clean up array occasionally. - if (this.outstandingPutCount_ === 0) { - this.outstandingPuts_ = []; - } - }; - PersistentConnection.prototype.onListenRevoked_ = function (pathString, query) { - // Remove the listen and manufacture a "permission_denied" error for the failed listen. - var queryId; - if (!query) { - queryId = 'default'; - } - else { - queryId = query.map(function (q) { return ObjectToUniqueKey(q); }).join('$'); - } - var listen = this.removeListen_(pathString, queryId); - if (listen && listen.onComplete) { - listen.onComplete('permission_denied'); - } - }; - PersistentConnection.prototype.removeListen_ = function (pathString, queryId) { - var normalizedPathString = new Path(pathString).toString(); // normalize path. - var listen; - if (this.listens.has(normalizedPathString)) { - var map = this.listens.get(normalizedPathString); - listen = map.get(queryId); - map.delete(queryId); - if (map.size === 0) { - this.listens.delete(normalizedPathString); - } - } - else { - // all listens for this path has already been removed - listen = undefined; - } - return listen; - }; - PersistentConnection.prototype.onAuthRevoked_ = function (statusCode, explanation) { - log('Auth token revoked: ' + statusCode + '/' + explanation); - this.authToken_ = null; - this.forceTokenRefresh_ = true; - this.realtime_.close(); - if (statusCode === 'invalid_token' || statusCode === 'permission_denied') { - // We'll wait a couple times before logging the warning / increasing the - // retry period since oauth tokens will report as "invalid" if they're - // just expired. Plus there may be transient issues that resolve themselves. - this.invalidAuthTokenCount_++; - if (this.invalidAuthTokenCount_ >= INVALID_TOKEN_THRESHOLD) { - // Set a long reconnect delay because recovery is unlikely - this.reconnectDelay_ = RECONNECT_MAX_DELAY_FOR_ADMINS; - // Notify the auth token provider that the token is invalid, which will log - // a warning - this.authTokenProvider_.notifyForInvalidToken(); - } - } - }; - PersistentConnection.prototype.onAppCheckRevoked_ = function (statusCode, explanation) { - log('App check token revoked: ' + statusCode + '/' + explanation); - this.appCheckToken_ = null; - this.forceTokenRefresh_ = true; - // Note: We don't close the connection as the developer may not have - // enforcement enabled. The backend closes connections with enforcements. - if (statusCode === 'invalid_token' || statusCode === 'permission_denied') { - // We'll wait a couple times before logging the warning / increasing the - // retry period since oauth tokens will report as "invalid" if they're - // just expired. Plus there may be transient issues that resolve themselves. - this.invalidAppCheckTokenCount_++; - if (this.invalidAppCheckTokenCount_ >= INVALID_TOKEN_THRESHOLD) { - this.appCheckTokenProvider_.notifyForInvalidToken(); - } - } - }; - PersistentConnection.prototype.onSecurityDebugPacket_ = function (body) { - if (this.securityDebugCallback_) { - this.securityDebugCallback_(body); - } - else { - if ('msg' in body) { - console.log('FIREBASE: ' + body['msg'].replace('\n', '\nFIREBASE: ')); - } - } - }; - PersistentConnection.prototype.restoreState_ = function () { - var e_1, _a, e_2, _b; - //Re-authenticate ourselves if we have a credential stored. - this.tryAuth(); - this.tryAppCheck(); - try { - // Puts depend on having received the corresponding data update from the server before they complete, so we must - // make sure to send listens before puts. - for (var _c = tslib.__values(this.listens.values()), _d = _c.next(); !_d.done; _d = _c.next()) { - var queries = _d.value; - try { - for (var _e = (e_2 = void 0, tslib.__values(queries.values())), _f = _e.next(); !_f.done; _f = _e.next()) { - var listenSpec = _f.value; - this.sendListen_(listenSpec); - } - } - catch (e_2_1) { e_2 = { error: e_2_1 }; } - finally { - try { - if (_f && !_f.done && (_b = _e.return)) _b.call(_e); - } - finally { if (e_2) throw e_2.error; } - } - } - } - catch (e_1_1) { e_1 = { error: e_1_1 }; } - finally { - try { - if (_d && !_d.done && (_a = _c.return)) _a.call(_c); - } - finally { if (e_1) throw e_1.error; } - } - for (var i = 0; i < this.outstandingPuts_.length; i++) { - if (this.outstandingPuts_[i]) { - this.sendPut_(i); - } - } - while (this.onDisconnectRequestQueue_.length) { - var request = this.onDisconnectRequestQueue_.shift(); - this.sendOnDisconnect_(request.action, request.pathString, request.data, request.onComplete); - } - for (var i = 0; i < this.outstandingGets_.length; i++) { - if (this.outstandingGets_[i]) { - this.sendGet_(i); - } - } - }; - /** - * Sends client stats for first connection - */ - PersistentConnection.prototype.sendConnectStats_ = function () { - var stats = {}; - var clientName = 'js'; - if (util.isNodeSdk()) { - if (this.repoInfo_.nodeAdmin) { - clientName = 'admin_node'; - } - else { - clientName = 'node'; - } - } - stats['sdk.' + clientName + '.' + SDK_VERSION.replace(/\./g, '-')] = 1; - if (util.isMobileCordova()) { - stats['framework.cordova'] = 1; - } - else if (util.isReactNative()) { - stats['framework.reactnative'] = 1; - } - this.reportStats(stats); - }; - PersistentConnection.prototype.shouldReconnect_ = function () { - var online = OnlineMonitor.getInstance().currentlyOnline(); - return util.isEmpty(this.interruptReasons_) && online; - }; - PersistentConnection.nextPersistentConnectionId_ = 0; - /** - * Counter for number of connections created. Mainly used for tagging in the logs - */ - PersistentConnection.nextConnectionId_ = 0; - return PersistentConnection; -}(ServerActions)); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var NamedNode = /** @class */ (function () { - function NamedNode(name, node) { - this.name = name; - this.node = node; - } - NamedNode.Wrap = function (name, node) { - return new NamedNode(name, node); - }; - return NamedNode; -}()); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var Index = /** @class */ (function () { - function Index() { - } - /** - * @returns A standalone comparison function for - * this index - */ - Index.prototype.getCompare = function () { - return this.compare.bind(this); - }; - /** - * Given a before and after value for a node, determine if the indexed value has changed. Even if they are different, - * it's possible that the changes are isolated to parts of the snapshot that are not indexed. - * - * - * @returns True if the portion of the snapshot being indexed changed between oldNode and newNode - */ - Index.prototype.indexedValueChanged = function (oldNode, newNode) { - var oldWrapped = new NamedNode(MIN_NAME, oldNode); - var newWrapped = new NamedNode(MIN_NAME, newNode); - return this.compare(oldWrapped, newWrapped) !== 0; - }; - /** - * @returns a node wrapper that will sort equal to or less than - * any other node wrapper, using this index - */ - Index.prototype.minPost = function () { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - return NamedNode.MIN; - }; - return Index; -}()); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var __EMPTY_NODE; -var KeyIndex = /** @class */ (function (_super) { - tslib.__extends(KeyIndex, _super); - function KeyIndex() { - return _super !== null && _super.apply(this, arguments) || this; - } - Object.defineProperty(KeyIndex, "__EMPTY_NODE", { - get: function () { - return __EMPTY_NODE; - }, - set: function (val) { - __EMPTY_NODE = val; - }, - enumerable: false, - configurable: true - }); - KeyIndex.prototype.compare = function (a, b) { - return nameCompare(a.name, b.name); - }; - KeyIndex.prototype.isDefinedOn = function (node) { - // We could probably return true here (since every node has a key), but it's never called - // so just leaving unimplemented for now. - throw util.assertionError('KeyIndex.isDefinedOn not expected to be called.'); - }; - KeyIndex.prototype.indexedValueChanged = function (oldNode, newNode) { - return false; // The key for a node never changes. - }; - KeyIndex.prototype.minPost = function () { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - return NamedNode.MIN; - }; - KeyIndex.prototype.maxPost = function () { - // TODO: This should really be created once and cached in a static property, but - // NamedNode isn't defined yet, so I can't use it in a static. Bleh. - return new NamedNode(MAX_NAME, __EMPTY_NODE); - }; - KeyIndex.prototype.makePost = function (indexValue, name) { - util.assert(typeof indexValue === 'string', 'KeyIndex indexValue must always be a string.'); - // We just use empty node, but it'll never be compared, since our comparator only looks at name. - return new NamedNode(indexValue, __EMPTY_NODE); - }; - /** - * @returns String representation for inclusion in a query spec - */ - KeyIndex.prototype.toString = function () { - return '.key'; - }; - return KeyIndex; -}(Index)); -var KEY_INDEX = new KeyIndex(); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * An iterator over an LLRBNode. - */ -var SortedMapIterator = /** @class */ (function () { - /** - * @param node - Node to iterate. - * @param isReverse_ - Whether or not to iterate in reverse - */ - function SortedMapIterator(node, startKey, comparator, isReverse_, resultGenerator_) { - if (resultGenerator_ === void 0) { resultGenerator_ = null; } - this.isReverse_ = isReverse_; - this.resultGenerator_ = resultGenerator_; - this.nodeStack_ = []; - var cmp = 1; - while (!node.isEmpty()) { - node = node; - cmp = startKey ? comparator(node.key, startKey) : 1; - // flip the comparison if we're going in reverse - if (isReverse_) { - cmp *= -1; - } - if (cmp < 0) { - // This node is less than our start key. ignore it - if (this.isReverse_) { - node = node.left; - } - else { - node = node.right; - } - } - else if (cmp === 0) { - // This node is exactly equal to our start key. Push it on the stack, but stop iterating; - this.nodeStack_.push(node); - break; - } - else { - // This node is greater than our start key, add it to the stack and move to the next one - this.nodeStack_.push(node); - if (this.isReverse_) { - node = node.right; - } - else { - node = node.left; - } - } - } - } - SortedMapIterator.prototype.getNext = function () { - if (this.nodeStack_.length === 0) { - return null; - } - var node = this.nodeStack_.pop(); - var result; - if (this.resultGenerator_) { - result = this.resultGenerator_(node.key, node.value); - } - else { - result = { key: node.key, value: node.value }; - } - if (this.isReverse_) { - node = node.left; - while (!node.isEmpty()) { - this.nodeStack_.push(node); - node = node.right; - } - } - else { - node = node.right; - while (!node.isEmpty()) { - this.nodeStack_.push(node); - node = node.left; - } - } - return result; - }; - SortedMapIterator.prototype.hasNext = function () { - return this.nodeStack_.length > 0; - }; - SortedMapIterator.prototype.peek = function () { - if (this.nodeStack_.length === 0) { - return null; - } - var node = this.nodeStack_[this.nodeStack_.length - 1]; - if (this.resultGenerator_) { - return this.resultGenerator_(node.key, node.value); - } - else { - return { key: node.key, value: node.value }; - } - }; - return SortedMapIterator; -}()); -/** - * Represents a node in a Left-leaning Red-Black tree. - */ -var LLRBNode = /** @class */ (function () { - /** - * @param key - Key associated with this node. - * @param value - Value associated with this node. - * @param color - Whether this node is red. - * @param left - Left child. - * @param right - Right child. - */ - function LLRBNode(key, value, color, left, right) { - this.key = key; - this.value = value; - this.color = color != null ? color : LLRBNode.RED; - this.left = - left != null ? left : SortedMap.EMPTY_NODE; - this.right = - right != null ? right : SortedMap.EMPTY_NODE; - } - /** - * Returns a copy of the current node, optionally replacing pieces of it. - * - * @param key - New key for the node, or null. - * @param value - New value for the node, or null. - * @param color - New color for the node, or null. - * @param left - New left child for the node, or null. - * @param right - New right child for the node, or null. - * @returns The node copy. - */ - LLRBNode.prototype.copy = function (key, value, color, left, right) { - return new LLRBNode(key != null ? key : this.key, value != null ? value : this.value, color != null ? color : this.color, left != null ? left : this.left, right != null ? right : this.right); - }; - /** - * @returns The total number of nodes in the tree. - */ - LLRBNode.prototype.count = function () { - return this.left.count() + 1 + this.right.count(); - }; - /** - * @returns True if the tree is empty. - */ - LLRBNode.prototype.isEmpty = function () { - return false; - }; - /** - * Traverses the tree in key order and calls the specified action function - * for each node. - * - * @param action - Callback function to be called for each - * node. If it returns true, traversal is aborted. - * @returns The first truthy value returned by action, or the last falsey - * value returned by action - */ - LLRBNode.prototype.inorderTraversal = function (action) { - return (this.left.inorderTraversal(action) || - !!action(this.key, this.value) || - this.right.inorderTraversal(action)); - }; - /** - * Traverses the tree in reverse key order and calls the specified action function - * for each node. - * - * @param action - Callback function to be called for each - * node. If it returns true, traversal is aborted. - * @returns True if traversal was aborted. - */ - LLRBNode.prototype.reverseTraversal = function (action) { - return (this.right.reverseTraversal(action) || - action(this.key, this.value) || - this.left.reverseTraversal(action)); - }; - /** - * @returns The minimum node in the tree. - */ - LLRBNode.prototype.min_ = function () { - if (this.left.isEmpty()) { - return this; - } - else { - return this.left.min_(); - } - }; - /** - * @returns The maximum key in the tree. - */ - LLRBNode.prototype.minKey = function () { - return this.min_().key; - }; - /** - * @returns The maximum key in the tree. - */ - LLRBNode.prototype.maxKey = function () { - if (this.right.isEmpty()) { - return this.key; - } - else { - return this.right.maxKey(); - } - }; - /** - * @param key - Key to insert. - * @param value - Value to insert. - * @param comparator - Comparator. - * @returns New tree, with the key/value added. - */ - LLRBNode.prototype.insert = function (key, value, comparator) { - var n = this; - var cmp = comparator(key, n.key); - if (cmp < 0) { - n = n.copy(null, null, null, n.left.insert(key, value, comparator), null); - } - else if (cmp === 0) { - n = n.copy(null, value, null, null, null); - } - else { - n = n.copy(null, null, null, null, n.right.insert(key, value, comparator)); - } - return n.fixUp_(); - }; - /** - * @returns New tree, with the minimum key removed. - */ - LLRBNode.prototype.removeMin_ = function () { - if (this.left.isEmpty()) { - return SortedMap.EMPTY_NODE; - } - var n = this; - if (!n.left.isRed_() && !n.left.left.isRed_()) { - n = n.moveRedLeft_(); - } - n = n.copy(null, null, null, n.left.removeMin_(), null); - return n.fixUp_(); - }; - /** - * @param key - The key of the item to remove. - * @param comparator - Comparator. - * @returns New tree, with the specified item removed. - */ - LLRBNode.prototype.remove = function (key, comparator) { - var n, smallest; - n = this; - if (comparator(key, n.key) < 0) { - if (!n.left.isEmpty() && !n.left.isRed_() && !n.left.left.isRed_()) { - n = n.moveRedLeft_(); - } - n = n.copy(null, null, null, n.left.remove(key, comparator), null); - } - else { - if (n.left.isRed_()) { - n = n.rotateRight_(); - } - if (!n.right.isEmpty() && !n.right.isRed_() && !n.right.left.isRed_()) { - n = n.moveRedRight_(); - } - if (comparator(key, n.key) === 0) { - if (n.right.isEmpty()) { - return SortedMap.EMPTY_NODE; - } - else { - smallest = n.right.min_(); - n = n.copy(smallest.key, smallest.value, null, null, n.right.removeMin_()); - } - } - n = n.copy(null, null, null, null, n.right.remove(key, comparator)); - } - return n.fixUp_(); - }; - /** - * @returns Whether this is a RED node. - */ - LLRBNode.prototype.isRed_ = function () { - return this.color; - }; - /** - * @returns New tree after performing any needed rotations. - */ - LLRBNode.prototype.fixUp_ = function () { - var n = this; - if (n.right.isRed_() && !n.left.isRed_()) { - n = n.rotateLeft_(); - } - if (n.left.isRed_() && n.left.left.isRed_()) { - n = n.rotateRight_(); - } - if (n.left.isRed_() && n.right.isRed_()) { - n = n.colorFlip_(); - } - return n; - }; - /** - * @returns New tree, after moveRedLeft. - */ - LLRBNode.prototype.moveRedLeft_ = function () { - var n = this.colorFlip_(); - if (n.right.left.isRed_()) { - n = n.copy(null, null, null, null, n.right.rotateRight_()); - n = n.rotateLeft_(); - n = n.colorFlip_(); - } - return n; - }; - /** - * @returns New tree, after moveRedRight. - */ - LLRBNode.prototype.moveRedRight_ = function () { - var n = this.colorFlip_(); - if (n.left.left.isRed_()) { - n = n.rotateRight_(); - n = n.colorFlip_(); - } - return n; - }; - /** - * @returns New tree, after rotateLeft. - */ - LLRBNode.prototype.rotateLeft_ = function () { - var nl = this.copy(null, null, LLRBNode.RED, null, this.right.left); - return this.right.copy(null, null, this.color, nl, null); - }; - /** - * @returns New tree, after rotateRight. - */ - LLRBNode.prototype.rotateRight_ = function () { - var nr = this.copy(null, null, LLRBNode.RED, this.left.right, null); - return this.left.copy(null, null, this.color, null, nr); - }; - /** - * @returns Newt ree, after colorFlip. - */ - LLRBNode.prototype.colorFlip_ = function () { - var left = this.left.copy(null, null, !this.left.color, null, null); - var right = this.right.copy(null, null, !this.right.color, null, null); - return this.copy(null, null, !this.color, left, right); - }; - /** - * For testing. - * - * @returns True if all is well. - */ - LLRBNode.prototype.checkMaxDepth_ = function () { - var blackDepth = this.check_(); - return Math.pow(2.0, blackDepth) <= this.count() + 1; - }; - LLRBNode.prototype.check_ = function () { - if (this.isRed_() && this.left.isRed_()) { - throw new Error('Red node has red child(' + this.key + ',' + this.value + ')'); - } - if (this.right.isRed_()) { - throw new Error('Right child of (' + this.key + ',' + this.value + ') is red'); - } - var blackDepth = this.left.check_(); - if (blackDepth !== this.right.check_()) { - throw new Error('Black depths differ'); - } - else { - return blackDepth + (this.isRed_() ? 0 : 1); - } - }; - LLRBNode.RED = true; - LLRBNode.BLACK = false; - return LLRBNode; -}()); -/** - * Represents an empty node (a leaf node in the Red-Black Tree). - */ -var LLRBEmptyNode = /** @class */ (function () { - function LLRBEmptyNode() { - } - /** - * Returns a copy of the current node. - * - * @returns The node copy. - */ - LLRBEmptyNode.prototype.copy = function (key, value, color, left, right) { - return this; - }; - /** - * Returns a copy of the tree, with the specified key/value added. - * - * @param key - Key to be added. - * @param value - Value to be added. - * @param comparator - Comparator. - * @returns New tree, with item added. - */ - LLRBEmptyNode.prototype.insert = function (key, value, comparator) { - return new LLRBNode(key, value, null); - }; - /** - * Returns a copy of the tree, with the specified key removed. - * - * @param key - The key to remove. - * @param comparator - Comparator. - * @returns New tree, with item removed. - */ - LLRBEmptyNode.prototype.remove = function (key, comparator) { - return this; - }; - /** - * @returns The total number of nodes in the tree. - */ - LLRBEmptyNode.prototype.count = function () { - return 0; - }; - /** - * @returns True if the tree is empty. - */ - LLRBEmptyNode.prototype.isEmpty = function () { - return true; - }; - /** - * Traverses the tree in key order and calls the specified action function - * for each node. - * - * @param action - Callback function to be called for each - * node. If it returns true, traversal is aborted. - * @returns True if traversal was aborted. - */ - LLRBEmptyNode.prototype.inorderTraversal = function (action) { - return false; - }; - /** - * Traverses the tree in reverse key order and calls the specified action function - * for each node. - * - * @param action - Callback function to be called for each - * node. If it returns true, traversal is aborted. - * @returns True if traversal was aborted. - */ - LLRBEmptyNode.prototype.reverseTraversal = function (action) { - return false; - }; - LLRBEmptyNode.prototype.minKey = function () { - return null; - }; - LLRBEmptyNode.prototype.maxKey = function () { - return null; - }; - LLRBEmptyNode.prototype.check_ = function () { - return 0; - }; - /** - * @returns Whether this node is red. - */ - LLRBEmptyNode.prototype.isRed_ = function () { - return false; - }; - return LLRBEmptyNode; -}()); -/** - * An immutable sorted map implementation, based on a Left-leaning Red-Black - * tree. - */ -var SortedMap = /** @class */ (function () { - /** - * @param comparator_ - Key comparator. - * @param root_ - Optional root node for the map. - */ - function SortedMap(comparator_, root_) { - if (root_ === void 0) { root_ = SortedMap.EMPTY_NODE; } - this.comparator_ = comparator_; - this.root_ = root_; - } - /** - * Returns a copy of the map, with the specified key/value added or replaced. - * (TODO: We should perhaps rename this method to 'put') - * - * @param key - Key to be added. - * @param value - Value to be added. - * @returns New map, with item added. - */ - SortedMap.prototype.insert = function (key, value) { - return new SortedMap(this.comparator_, this.root_ - .insert(key, value, this.comparator_) - .copy(null, null, LLRBNode.BLACK, null, null)); - }; - /** - * Returns a copy of the map, with the specified key removed. - * - * @param key - The key to remove. - * @returns New map, with item removed. - */ - SortedMap.prototype.remove = function (key) { - return new SortedMap(this.comparator_, this.root_ - .remove(key, this.comparator_) - .copy(null, null, LLRBNode.BLACK, null, null)); - }; - /** - * Returns the value of the node with the given key, or null. - * - * @param key - The key to look up. - * @returns The value of the node with the given key, or null if the - * key doesn't exist. - */ - SortedMap.prototype.get = function (key) { - var cmp; - var node = this.root_; - while (!node.isEmpty()) { - cmp = this.comparator_(key, node.key); - if (cmp === 0) { - return node.value; - } - else if (cmp < 0) { - node = node.left; - } - else if (cmp > 0) { - node = node.right; - } - } - return null; - }; - /** - * Returns the key of the item *before* the specified key, or null if key is the first item. - * @param key - The key to find the predecessor of - * @returns The predecessor key. - */ - SortedMap.prototype.getPredecessorKey = function (key) { - var cmp, node = this.root_, rightParent = null; - while (!node.isEmpty()) { - cmp = this.comparator_(key, node.key); - if (cmp === 0) { - if (!node.left.isEmpty()) { - node = node.left; - while (!node.right.isEmpty()) { - node = node.right; - } - return node.key; - } - else if (rightParent) { - return rightParent.key; - } - else { - return null; // first item. - } - } - else if (cmp < 0) { - node = node.left; - } - else if (cmp > 0) { - rightParent = node; - node = node.right; - } - } - throw new Error('Attempted to find predecessor key for a nonexistent key. What gives?'); - }; - /** - * @returns True if the map is empty. - */ - SortedMap.prototype.isEmpty = function () { - return this.root_.isEmpty(); - }; - /** - * @returns The total number of nodes in the map. - */ - SortedMap.prototype.count = function () { - return this.root_.count(); - }; - /** - * @returns The minimum key in the map. - */ - SortedMap.prototype.minKey = function () { - return this.root_.minKey(); - }; - /** - * @returns The maximum key in the map. - */ - SortedMap.prototype.maxKey = function () { - return this.root_.maxKey(); - }; - /** - * Traverses the map in key order and calls the specified action function - * for each key/value pair. - * - * @param action - Callback function to be called - * for each key/value pair. If action returns true, traversal is aborted. - * @returns The first truthy value returned by action, or the last falsey - * value returned by action - */ - SortedMap.prototype.inorderTraversal = function (action) { - return this.root_.inorderTraversal(action); - }; - /** - * Traverses the map in reverse key order and calls the specified action function - * for each key/value pair. - * - * @param action - Callback function to be called - * for each key/value pair. If action returns true, traversal is aborted. - * @returns True if the traversal was aborted. - */ - SortedMap.prototype.reverseTraversal = function (action) { - return this.root_.reverseTraversal(action); - }; - /** - * Returns an iterator over the SortedMap. - * @returns The iterator. - */ - SortedMap.prototype.getIterator = function (resultGenerator) { - return new SortedMapIterator(this.root_, null, this.comparator_, false, resultGenerator); - }; - SortedMap.prototype.getIteratorFrom = function (key, resultGenerator) { - return new SortedMapIterator(this.root_, key, this.comparator_, false, resultGenerator); - }; - SortedMap.prototype.getReverseIteratorFrom = function (key, resultGenerator) { - return new SortedMapIterator(this.root_, key, this.comparator_, true, resultGenerator); - }; - SortedMap.prototype.getReverseIterator = function (resultGenerator) { - return new SortedMapIterator(this.root_, null, this.comparator_, true, resultGenerator); - }; - /** - * Always use the same empty node, to reduce memory. - */ - SortedMap.EMPTY_NODE = new LLRBEmptyNode(); - return SortedMap; -}()); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -function NAME_ONLY_COMPARATOR(left, right) { - return nameCompare(left.name, right.name); -} -function NAME_COMPARATOR(left, right) { - return nameCompare(left, right); -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var MAX_NODE$2; -function setMaxNode$1(val) { - MAX_NODE$2 = val; -} -var priorityHashText = function (priority) { - if (typeof priority === 'number') { - return 'number:' + doubleToIEEE754String(priority); - } - else { - return 'string:' + priority; - } -}; -/** - * Validates that a priority snapshot Node is valid. - */ -var validatePriorityNode = function (priorityNode) { - if (priorityNode.isLeafNode()) { - var val = priorityNode.val(); - util.assert(typeof val === 'string' || - typeof val === 'number' || - (typeof val === 'object' && util.contains(val, '.sv')), 'Priority must be a string or number.'); - } - else { - util.assert(priorityNode === MAX_NODE$2 || priorityNode.isEmpty(), 'priority of unexpected type.'); - } - // Don't call getPriority() on MAX_NODE to avoid hitting assertion. - util.assert(priorityNode === MAX_NODE$2 || priorityNode.getPriority().isEmpty(), "Priority nodes can't have a priority of their own."); -}; - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var __childrenNodeConstructor; -/** - * LeafNode is a class for storing leaf nodes in a DataSnapshot. It - * implements Node and stores the value of the node (a string, - * number, or boolean) accessible via getValue(). - */ -var LeafNode = /** @class */ (function () { - /** - * @param value_ - The value to store in this leaf node. The object type is - * possible in the event of a deferred value - * @param priorityNode_ - The priority of this node. - */ - function LeafNode(value_, priorityNode_) { - if (priorityNode_ === void 0) { priorityNode_ = LeafNode.__childrenNodeConstructor.EMPTY_NODE; } - this.value_ = value_; - this.priorityNode_ = priorityNode_; - this.lazyHash_ = null; - util.assert(this.value_ !== undefined && this.value_ !== null, "LeafNode shouldn't be created with null/undefined value."); - validatePriorityNode(this.priorityNode_); - } - Object.defineProperty(LeafNode, "__childrenNodeConstructor", { - get: function () { - return __childrenNodeConstructor; - }, - set: function (val) { - __childrenNodeConstructor = val; - }, - enumerable: false, - configurable: true - }); - /** @inheritDoc */ - LeafNode.prototype.isLeafNode = function () { - return true; - }; - /** @inheritDoc */ - LeafNode.prototype.getPriority = function () { - return this.priorityNode_; - }; - /** @inheritDoc */ - LeafNode.prototype.updatePriority = function (newPriorityNode) { - return new LeafNode(this.value_, newPriorityNode); - }; - /** @inheritDoc */ - LeafNode.prototype.getImmediateChild = function (childName) { - // Hack to treat priority as a regular child - if (childName === '.priority') { - return this.priorityNode_; - } - else { - return LeafNode.__childrenNodeConstructor.EMPTY_NODE; - } - }; - /** @inheritDoc */ - LeafNode.prototype.getChild = function (path) { - if (pathIsEmpty(path)) { - return this; - } - else if (pathGetFront(path) === '.priority') { - return this.priorityNode_; - } - else { - return LeafNode.__childrenNodeConstructor.EMPTY_NODE; - } - }; - LeafNode.prototype.hasChild = function () { - return false; - }; - /** @inheritDoc */ - LeafNode.prototype.getPredecessorChildName = function (childName, childNode) { - return null; - }; - /** @inheritDoc */ - LeafNode.prototype.updateImmediateChild = function (childName, newChildNode) { - if (childName === '.priority') { - return this.updatePriority(newChildNode); - } - else if (newChildNode.isEmpty() && childName !== '.priority') { - return this; - } - else { - return LeafNode.__childrenNodeConstructor.EMPTY_NODE.updateImmediateChild(childName, newChildNode).updatePriority(this.priorityNode_); - } - }; - /** @inheritDoc */ - LeafNode.prototype.updateChild = function (path, newChildNode) { - var front = pathGetFront(path); - if (front === null) { - return newChildNode; - } - else if (newChildNode.isEmpty() && front !== '.priority') { - return this; - } - else { - util.assert(front !== '.priority' || pathGetLength(path) === 1, '.priority must be the last token in a path'); - return this.updateImmediateChild(front, LeafNode.__childrenNodeConstructor.EMPTY_NODE.updateChild(pathPopFront(path), newChildNode)); - } - }; - /** @inheritDoc */ - LeafNode.prototype.isEmpty = function () { - return false; - }; - /** @inheritDoc */ - LeafNode.prototype.numChildren = function () { - return 0; - }; - /** @inheritDoc */ - LeafNode.prototype.forEachChild = function (index, action) { - return false; - }; - LeafNode.prototype.val = function (exportFormat) { - if (exportFormat && !this.getPriority().isEmpty()) { - return { - '.value': this.getValue(), - '.priority': this.getPriority().val() - }; - } - else { - return this.getValue(); - } - }; - /** @inheritDoc */ - LeafNode.prototype.hash = function () { - if (this.lazyHash_ === null) { - var toHash = ''; - if (!this.priorityNode_.isEmpty()) { - toHash += - 'priority:' + - priorityHashText(this.priorityNode_.val()) + - ':'; - } - var type = typeof this.value_; - toHash += type + ':'; - if (type === 'number') { - toHash += doubleToIEEE754String(this.value_); - } - else { - toHash += this.value_; - } - this.lazyHash_ = sha1(toHash); - } - return this.lazyHash_; - }; - /** - * Returns the value of the leaf node. - * @returns The value of the node. - */ - LeafNode.prototype.getValue = function () { - return this.value_; - }; - LeafNode.prototype.compareTo = function (other) { - if (other === LeafNode.__childrenNodeConstructor.EMPTY_NODE) { - return 1; - } - else if (other instanceof LeafNode.__childrenNodeConstructor) { - return -1; - } - else { - util.assert(other.isLeafNode(), 'Unknown node type'); - return this.compareToLeafNode_(other); - } - }; - /** - * Comparison specifically for two leaf nodes - */ - LeafNode.prototype.compareToLeafNode_ = function (otherLeaf) { - var otherLeafType = typeof otherLeaf.value_; - var thisLeafType = typeof this.value_; - var otherIndex = LeafNode.VALUE_TYPE_ORDER.indexOf(otherLeafType); - var thisIndex = LeafNode.VALUE_TYPE_ORDER.indexOf(thisLeafType); - util.assert(otherIndex >= 0, 'Unknown leaf type: ' + otherLeafType); - util.assert(thisIndex >= 0, 'Unknown leaf type: ' + thisLeafType); - if (otherIndex === thisIndex) { - // Same type, compare values - if (thisLeafType === 'object') { - // Deferred value nodes are all equal, but we should also never get to this point... - return 0; - } - else { - // Note that this works because true > false, all others are number or string comparisons - if (this.value_ < otherLeaf.value_) { - return -1; - } - else if (this.value_ === otherLeaf.value_) { - return 0; - } - else { - return 1; - } - } - } - else { - return thisIndex - otherIndex; - } - }; - LeafNode.prototype.withIndex = function () { - return this; - }; - LeafNode.prototype.isIndexed = function () { - return true; - }; - LeafNode.prototype.equals = function (other) { - if (other === this) { - return true; - } - else if (other.isLeafNode()) { - var otherLeaf = other; - return (this.value_ === otherLeaf.value_ && - this.priorityNode_.equals(otherLeaf.priorityNode_)); - } - else { - return false; - } - }; - /** - * The sort order for comparing leaf nodes of different types. If two leaf nodes have - * the same type, the comparison falls back to their value - */ - LeafNode.VALUE_TYPE_ORDER = ['object', 'boolean', 'number', 'string']; - return LeafNode; -}()); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var nodeFromJSON$1; -var MAX_NODE$1; -function setNodeFromJSON(val) { - nodeFromJSON$1 = val; -} -function setMaxNode(val) { - MAX_NODE$1 = val; -} -var PriorityIndex = /** @class */ (function (_super) { - tslib.__extends(PriorityIndex, _super); - function PriorityIndex() { - return _super !== null && _super.apply(this, arguments) || this; - } - PriorityIndex.prototype.compare = function (a, b) { - var aPriority = a.node.getPriority(); - var bPriority = b.node.getPriority(); - var indexCmp = aPriority.compareTo(bPriority); - if (indexCmp === 0) { - return nameCompare(a.name, b.name); - } - else { - return indexCmp; - } - }; - PriorityIndex.prototype.isDefinedOn = function (node) { - return !node.getPriority().isEmpty(); - }; - PriorityIndex.prototype.indexedValueChanged = function (oldNode, newNode) { - return !oldNode.getPriority().equals(newNode.getPriority()); - }; - PriorityIndex.prototype.minPost = function () { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - return NamedNode.MIN; - }; - PriorityIndex.prototype.maxPost = function () { - return new NamedNode(MAX_NAME, new LeafNode('[PRIORITY-POST]', MAX_NODE$1)); - }; - PriorityIndex.prototype.makePost = function (indexValue, name) { - var priorityNode = nodeFromJSON$1(indexValue); - return new NamedNode(name, new LeafNode('[PRIORITY-POST]', priorityNode)); - }; - /** - * @returns String representation for inclusion in a query spec - */ - PriorityIndex.prototype.toString = function () { - return '.priority'; - }; - return PriorityIndex; -}(Index)); -var PRIORITY_INDEX = new PriorityIndex(); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var LOG_2 = Math.log(2); -var Base12Num = /** @class */ (function () { - function Base12Num(length) { - var logBase2 = function (num) { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - return parseInt((Math.log(num) / LOG_2), 10); - }; - var bitMask = function (bits) { return parseInt(Array(bits + 1).join('1'), 2); }; - this.count = logBase2(length + 1); - this.current_ = this.count - 1; - var mask = bitMask(this.count); - this.bits_ = (length + 1) & mask; - } - Base12Num.prototype.nextBitIsOne = function () { - //noinspection JSBitwiseOperatorUsage - var result = !(this.bits_ & (0x1 << this.current_)); - this.current_--; - return result; - }; - return Base12Num; -}()); -/** - * Takes a list of child nodes and constructs a SortedSet using the given comparison - * function - * - * Uses the algorithm described in the paper linked here: - * http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.46.1458 - * - * @param childList - Unsorted list of children - * @param cmp - The comparison method to be used - * @param keyFn - An optional function to extract K from a node wrapper, if K's - * type is not NamedNode - * @param mapSortFn - An optional override for comparator used by the generated sorted map - */ -var buildChildSet = function (childList, cmp, keyFn, mapSortFn) { - childList.sort(cmp); - var buildBalancedTree = function (low, high) { - var length = high - low; - var namedNode; - var key; - if (length === 0) { - return null; - } - else if (length === 1) { - namedNode = childList[low]; - key = keyFn ? keyFn(namedNode) : namedNode; - return new LLRBNode(key, namedNode.node, LLRBNode.BLACK, null, null); - } - else { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - var middle = parseInt((length / 2), 10) + low; - var left = buildBalancedTree(low, middle); - var right = buildBalancedTree(middle + 1, high); - namedNode = childList[middle]; - key = keyFn ? keyFn(namedNode) : namedNode; - return new LLRBNode(key, namedNode.node, LLRBNode.BLACK, left, right); - } - }; - var buildFrom12Array = function (base12) { - var node = null; - var root = null; - var index = childList.length; - var buildPennant = function (chunkSize, color) { - var low = index - chunkSize; - var high = index; - index -= chunkSize; - var childTree = buildBalancedTree(low + 1, high); - var namedNode = childList[low]; - var key = keyFn ? keyFn(namedNode) : namedNode; - attachPennant(new LLRBNode(key, namedNode.node, color, null, childTree)); - }; - var attachPennant = function (pennant) { - if (node) { - node.left = pennant; - node = pennant; - } - else { - root = pennant; - node = pennant; - } - }; - for (var i = 0; i < base12.count; ++i) { - var isOne = base12.nextBitIsOne(); - // The number of nodes taken in each slice is 2^(arr.length - (i + 1)) - var chunkSize = Math.pow(2, base12.count - (i + 1)); - if (isOne) { - buildPennant(chunkSize, LLRBNode.BLACK); - } - else { - // current == 2 - buildPennant(chunkSize, LLRBNode.BLACK); - buildPennant(chunkSize, LLRBNode.RED); - } - } - return root; - }; - var base12 = new Base12Num(childList.length); - var root = buildFrom12Array(base12); - // eslint-disable-next-line @typescript-eslint/no-explicit-any - return new SortedMap(mapSortFn || cmp, root); -}; - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var _defaultIndexMap; -var fallbackObject = {}; -var IndexMap = /** @class */ (function () { - function IndexMap(indexes_, indexSet_) { - this.indexes_ = indexes_; - this.indexSet_ = indexSet_; - } - Object.defineProperty(IndexMap, "Default", { - /** - * The default IndexMap for nodes without a priority - */ - get: function () { - util.assert(fallbackObject && PRIORITY_INDEX, 'ChildrenNode.ts has not been loaded'); - _defaultIndexMap = - _defaultIndexMap || - new IndexMap({ '.priority': fallbackObject }, { '.priority': PRIORITY_INDEX }); - return _defaultIndexMap; - }, - enumerable: false, - configurable: true - }); - IndexMap.prototype.get = function (indexKey) { - var sortedMap = util.safeGet(this.indexes_, indexKey); - if (!sortedMap) { - throw new Error('No index defined for ' + indexKey); - } - if (sortedMap instanceof SortedMap) { - return sortedMap; - } - else { - // The index exists, but it falls back to just name comparison. Return null so that the calling code uses the - // regular child map - return null; - } - }; - IndexMap.prototype.hasIndex = function (indexDefinition) { - return util.contains(this.indexSet_, indexDefinition.toString()); - }; - IndexMap.prototype.addIndex = function (indexDefinition, existingChildren) { - util.assert(indexDefinition !== KEY_INDEX, "KeyIndex always exists and isn't meant to be added to the IndexMap."); - var childList = []; - var sawIndexedValue = false; - var iter = existingChildren.getIterator(NamedNode.Wrap); - var next = iter.getNext(); - while (next) { - sawIndexedValue = - sawIndexedValue || indexDefinition.isDefinedOn(next.node); - childList.push(next); - next = iter.getNext(); - } - var newIndex; - if (sawIndexedValue) { - newIndex = buildChildSet(childList, indexDefinition.getCompare()); - } - else { - newIndex = fallbackObject; - } - var indexName = indexDefinition.toString(); - var newIndexSet = tslib.__assign({}, this.indexSet_); - newIndexSet[indexName] = indexDefinition; - var newIndexes = tslib.__assign({}, this.indexes_); - newIndexes[indexName] = newIndex; - return new IndexMap(newIndexes, newIndexSet); - }; - /** - * Ensure that this node is properly tracked in any indexes that we're maintaining - */ - IndexMap.prototype.addToIndexes = function (namedNode, existingChildren) { - var _this = this; - var newIndexes = util.map(this.indexes_, function (indexedChildren, indexName) { - var index = util.safeGet(_this.indexSet_, indexName); - util.assert(index, 'Missing index implementation for ' + indexName); - if (indexedChildren === fallbackObject) { - // Check to see if we need to index everything - if (index.isDefinedOn(namedNode.node)) { - // We need to build this index - var childList = []; - var iter = existingChildren.getIterator(NamedNode.Wrap); - var next = iter.getNext(); - while (next) { - if (next.name !== namedNode.name) { - childList.push(next); - } - next = iter.getNext(); - } - childList.push(namedNode); - return buildChildSet(childList, index.getCompare()); - } - else { - // No change, this remains a fallback - return fallbackObject; - } - } - else { - var existingSnap = existingChildren.get(namedNode.name); - var newChildren = indexedChildren; - if (existingSnap) { - newChildren = newChildren.remove(new NamedNode(namedNode.name, existingSnap)); - } - return newChildren.insert(namedNode, namedNode.node); - } - }); - return new IndexMap(newIndexes, this.indexSet_); - }; - /** - * Create a new IndexMap instance with the given value removed - */ - IndexMap.prototype.removeFromIndexes = function (namedNode, existingChildren) { - var newIndexes = util.map(this.indexes_, function (indexedChildren) { - if (indexedChildren === fallbackObject) { - // This is the fallback. Just return it, nothing to do in this case - return indexedChildren; - } - else { - var existingSnap = existingChildren.get(namedNode.name); - if (existingSnap) { - return indexedChildren.remove(new NamedNode(namedNode.name, existingSnap)); - } - else { - // No record of this child - return indexedChildren; - } - } - }); - return new IndexMap(newIndexes, this.indexSet_); - }; - return IndexMap; -}()); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// TODO: For memory savings, don't store priorityNode_ if it's empty. -var EMPTY_NODE; -/** - * ChildrenNode is a class for storing internal nodes in a DataSnapshot - * (i.e. nodes with children). It implements Node and stores the - * list of children in the children property, sorted by child name. - */ -var ChildrenNode = /** @class */ (function () { - /** - * @param children_ - List of children of this node.. - * @param priorityNode_ - The priority of this node (as a snapshot node). - */ - function ChildrenNode(children_, priorityNode_, indexMap_) { - this.children_ = children_; - this.priorityNode_ = priorityNode_; - this.indexMap_ = indexMap_; - this.lazyHash_ = null; - /** - * Note: The only reason we allow null priority is for EMPTY_NODE, since we can't use - * EMPTY_NODE as the priority of EMPTY_NODE. We might want to consider making EMPTY_NODE its own - * class instead of an empty ChildrenNode. - */ - if (this.priorityNode_) { - validatePriorityNode(this.priorityNode_); - } - if (this.children_.isEmpty()) { - util.assert(!this.priorityNode_ || this.priorityNode_.isEmpty(), 'An empty node cannot have a priority'); - } - } - Object.defineProperty(ChildrenNode, "EMPTY_NODE", { - get: function () { - return (EMPTY_NODE || - (EMPTY_NODE = new ChildrenNode(new SortedMap(NAME_COMPARATOR), null, IndexMap.Default))); - }, - enumerable: false, - configurable: true - }); - /** @inheritDoc */ - ChildrenNode.prototype.isLeafNode = function () { - return false; - }; - /** @inheritDoc */ - ChildrenNode.prototype.getPriority = function () { - return this.priorityNode_ || EMPTY_NODE; - }; - /** @inheritDoc */ - ChildrenNode.prototype.updatePriority = function (newPriorityNode) { - if (this.children_.isEmpty()) { - // Don't allow priorities on empty nodes - return this; - } - else { - return new ChildrenNode(this.children_, newPriorityNode, this.indexMap_); - } - }; - /** @inheritDoc */ - ChildrenNode.prototype.getImmediateChild = function (childName) { - // Hack to treat priority as a regular child - if (childName === '.priority') { - return this.getPriority(); - } - else { - var child = this.children_.get(childName); - return child === null ? EMPTY_NODE : child; - } - }; - /** @inheritDoc */ - ChildrenNode.prototype.getChild = function (path) { - var front = pathGetFront(path); - if (front === null) { - return this; - } - return this.getImmediateChild(front).getChild(pathPopFront(path)); - }; - /** @inheritDoc */ - ChildrenNode.prototype.hasChild = function (childName) { - return this.children_.get(childName) !== null; - }; - /** @inheritDoc */ - ChildrenNode.prototype.updateImmediateChild = function (childName, newChildNode) { - util.assert(newChildNode, 'We should always be passing snapshot nodes'); - if (childName === '.priority') { - return this.updatePriority(newChildNode); - } - else { - var namedNode = new NamedNode(childName, newChildNode); - var newChildren = void 0, newIndexMap = void 0; - if (newChildNode.isEmpty()) { - newChildren = this.children_.remove(childName); - newIndexMap = this.indexMap_.removeFromIndexes(namedNode, this.children_); - } - else { - newChildren = this.children_.insert(childName, newChildNode); - newIndexMap = this.indexMap_.addToIndexes(namedNode, this.children_); - } - var newPriority = newChildren.isEmpty() - ? EMPTY_NODE - : this.priorityNode_; - return new ChildrenNode(newChildren, newPriority, newIndexMap); - } - }; - /** @inheritDoc */ - ChildrenNode.prototype.updateChild = function (path, newChildNode) { - var front = pathGetFront(path); - if (front === null) { - return newChildNode; - } - else { - util.assert(pathGetFront(path) !== '.priority' || pathGetLength(path) === 1, '.priority must be the last token in a path'); - var newImmediateChild = this.getImmediateChild(front).updateChild(pathPopFront(path), newChildNode); - return this.updateImmediateChild(front, newImmediateChild); - } - }; - /** @inheritDoc */ - ChildrenNode.prototype.isEmpty = function () { - return this.children_.isEmpty(); - }; - /** @inheritDoc */ - ChildrenNode.prototype.numChildren = function () { - return this.children_.count(); - }; - /** @inheritDoc */ - ChildrenNode.prototype.val = function (exportFormat) { - if (this.isEmpty()) { - return null; - } - var obj = {}; - var numKeys = 0, maxKey = 0, allIntegerKeys = true; - this.forEachChild(PRIORITY_INDEX, function (key, childNode) { - obj[key] = childNode.val(exportFormat); - numKeys++; - if (allIntegerKeys && ChildrenNode.INTEGER_REGEXP_.test(key)) { - maxKey = Math.max(maxKey, Number(key)); - } - else { - allIntegerKeys = false; - } - }); - if (!exportFormat && allIntegerKeys && maxKey < 2 * numKeys) { - // convert to array. - var array = []; - // eslint-disable-next-line guard-for-in - for (var key in obj) { - array[key] = obj[key]; - } - return array; - } - else { - if (exportFormat && !this.getPriority().isEmpty()) { - obj['.priority'] = this.getPriority().val(); - } - return obj; - } - }; - /** @inheritDoc */ - ChildrenNode.prototype.hash = function () { - if (this.lazyHash_ === null) { - var toHash_1 = ''; - if (!this.getPriority().isEmpty()) { - toHash_1 += - 'priority:' + - priorityHashText(this.getPriority().val()) + - ':'; - } - this.forEachChild(PRIORITY_INDEX, function (key, childNode) { - var childHash = childNode.hash(); - if (childHash !== '') { - toHash_1 += ':' + key + ':' + childHash; - } - }); - this.lazyHash_ = toHash_1 === '' ? '' : sha1(toHash_1); - } - return this.lazyHash_; - }; - /** @inheritDoc */ - ChildrenNode.prototype.getPredecessorChildName = function (childName, childNode, index) { - var idx = this.resolveIndex_(index); - if (idx) { - var predecessor = idx.getPredecessorKey(new NamedNode(childName, childNode)); - return predecessor ? predecessor.name : null; - } - else { - return this.children_.getPredecessorKey(childName); - } - }; - ChildrenNode.prototype.getFirstChildName = function (indexDefinition) { - var idx = this.resolveIndex_(indexDefinition); - if (idx) { - var minKey = idx.minKey(); - return minKey && minKey.name; - } - else { - return this.children_.minKey(); - } - }; - ChildrenNode.prototype.getFirstChild = function (indexDefinition) { - var minKey = this.getFirstChildName(indexDefinition); - if (minKey) { - return new NamedNode(minKey, this.children_.get(minKey)); - } - else { - return null; - } - }; - /** - * Given an index, return the key name of the largest value we have, according to that index - */ - ChildrenNode.prototype.getLastChildName = function (indexDefinition) { - var idx = this.resolveIndex_(indexDefinition); - if (idx) { - var maxKey = idx.maxKey(); - return maxKey && maxKey.name; - } - else { - return this.children_.maxKey(); - } - }; - ChildrenNode.prototype.getLastChild = function (indexDefinition) { - var maxKey = this.getLastChildName(indexDefinition); - if (maxKey) { - return new NamedNode(maxKey, this.children_.get(maxKey)); - } - else { - return null; - } - }; - ChildrenNode.prototype.forEachChild = function (index, action) { - var idx = this.resolveIndex_(index); - if (idx) { - return idx.inorderTraversal(function (wrappedNode) { - return action(wrappedNode.name, wrappedNode.node); - }); - } - else { - return this.children_.inorderTraversal(action); - } - }; - ChildrenNode.prototype.getIterator = function (indexDefinition) { - return this.getIteratorFrom(indexDefinition.minPost(), indexDefinition); - }; - ChildrenNode.prototype.getIteratorFrom = function (startPost, indexDefinition) { - var idx = this.resolveIndex_(indexDefinition); - if (idx) { - return idx.getIteratorFrom(startPost, function (key) { return key; }); - } - else { - var iterator = this.children_.getIteratorFrom(startPost.name, NamedNode.Wrap); - var next = iterator.peek(); - while (next != null && indexDefinition.compare(next, startPost) < 0) { - iterator.getNext(); - next = iterator.peek(); - } - return iterator; - } - }; - ChildrenNode.prototype.getReverseIterator = function (indexDefinition) { - return this.getReverseIteratorFrom(indexDefinition.maxPost(), indexDefinition); - }; - ChildrenNode.prototype.getReverseIteratorFrom = function (endPost, indexDefinition) { - var idx = this.resolveIndex_(indexDefinition); - if (idx) { - return idx.getReverseIteratorFrom(endPost, function (key) { - return key; - }); - } - else { - var iterator = this.children_.getReverseIteratorFrom(endPost.name, NamedNode.Wrap); - var next = iterator.peek(); - while (next != null && indexDefinition.compare(next, endPost) > 0) { - iterator.getNext(); - next = iterator.peek(); - } - return iterator; - } - }; - ChildrenNode.prototype.compareTo = function (other) { - if (this.isEmpty()) { - if (other.isEmpty()) { - return 0; - } - else { - return -1; - } - } - else if (other.isLeafNode() || other.isEmpty()) { - return 1; - } - else if (other === MAX_NODE) { - return -1; - } - else { - // Must be another node with children. - return 0; - } - }; - ChildrenNode.prototype.withIndex = function (indexDefinition) { - if (indexDefinition === KEY_INDEX || - this.indexMap_.hasIndex(indexDefinition)) { - return this; - } - else { - var newIndexMap = this.indexMap_.addIndex(indexDefinition, this.children_); - return new ChildrenNode(this.children_, this.priorityNode_, newIndexMap); - } - }; - ChildrenNode.prototype.isIndexed = function (index) { - return index === KEY_INDEX || this.indexMap_.hasIndex(index); - }; - ChildrenNode.prototype.equals = function (other) { - if (other === this) { - return true; - } - else if (other.isLeafNode()) { - return false; - } - else { - var otherChildrenNode = other; - if (!this.getPriority().equals(otherChildrenNode.getPriority())) { - return false; - } - else if (this.children_.count() === otherChildrenNode.children_.count()) { - var thisIter = this.getIterator(PRIORITY_INDEX); - var otherIter = otherChildrenNode.getIterator(PRIORITY_INDEX); - var thisCurrent = thisIter.getNext(); - var otherCurrent = otherIter.getNext(); - while (thisCurrent && otherCurrent) { - if (thisCurrent.name !== otherCurrent.name || - !thisCurrent.node.equals(otherCurrent.node)) { - return false; - } - thisCurrent = thisIter.getNext(); - otherCurrent = otherIter.getNext(); - } - return thisCurrent === null && otherCurrent === null; - } - else { - return false; - } - } - }; - /** - * Returns a SortedMap ordered by index, or null if the default (by-key) ordering can be used - * instead. - * - */ - ChildrenNode.prototype.resolveIndex_ = function (indexDefinition) { - if (indexDefinition === KEY_INDEX) { - return null; - } - else { - return this.indexMap_.get(indexDefinition.toString()); - } - }; - ChildrenNode.INTEGER_REGEXP_ = /^(0|[1-9]\d*)$/; - return ChildrenNode; -}()); -var MaxNode = /** @class */ (function (_super) { - tslib.__extends(MaxNode, _super); - function MaxNode() { - return _super.call(this, new SortedMap(NAME_COMPARATOR), ChildrenNode.EMPTY_NODE, IndexMap.Default) || this; - } - MaxNode.prototype.compareTo = function (other) { - if (other === this) { - return 0; - } - else { - return 1; - } - }; - MaxNode.prototype.equals = function (other) { - // Not that we every compare it, but MAX_NODE is only ever equal to itself - return other === this; - }; - MaxNode.prototype.getPriority = function () { - return this; - }; - MaxNode.prototype.getImmediateChild = function (childName) { - return ChildrenNode.EMPTY_NODE; - }; - MaxNode.prototype.isEmpty = function () { - return false; - }; - return MaxNode; -}(ChildrenNode)); -/** - * Marker that will sort higher than any other snapshot. - */ -var MAX_NODE = new MaxNode(); -Object.defineProperties(NamedNode, { - MIN: { - value: new NamedNode(MIN_NAME, ChildrenNode.EMPTY_NODE) - }, - MAX: { - value: new NamedNode(MAX_NAME, MAX_NODE) - } -}); -/** - * Reference Extensions - */ -KeyIndex.__EMPTY_NODE = ChildrenNode.EMPTY_NODE; -LeafNode.__childrenNodeConstructor = ChildrenNode; -setMaxNode$1(MAX_NODE); -setMaxNode(MAX_NODE); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var USE_HINZE = true; -/** - * Constructs a snapshot node representing the passed JSON and returns it. - * @param json - JSON to create a node for. - * @param priority - Optional priority to use. This will be ignored if the - * passed JSON contains a .priority property. - */ -function nodeFromJSON(json, priority) { - if (priority === void 0) { priority = null; } - if (json === null) { - return ChildrenNode.EMPTY_NODE; - } - if (typeof json === 'object' && '.priority' in json) { - priority = json['.priority']; - } - util.assert(priority === null || - typeof priority === 'string' || - typeof priority === 'number' || - (typeof priority === 'object' && '.sv' in priority), 'Invalid priority type found: ' + typeof priority); - if (typeof json === 'object' && '.value' in json && json['.value'] !== null) { - json = json['.value']; - } - // Valid leaf nodes include non-objects or server-value wrapper objects - if (typeof json !== 'object' || '.sv' in json) { - var jsonLeaf = json; - return new LeafNode(jsonLeaf, nodeFromJSON(priority)); - } - if (!(json instanceof Array) && USE_HINZE) { - var children_1 = []; - var childrenHavePriority_1 = false; - var hinzeJsonObj = json; - each(hinzeJsonObj, function (key, child) { - if (key.substring(0, 1) !== '.') { - // Ignore metadata nodes - var childNode = nodeFromJSON(child); - if (!childNode.isEmpty()) { - childrenHavePriority_1 = - childrenHavePriority_1 || !childNode.getPriority().isEmpty(); - children_1.push(new NamedNode(key, childNode)); - } - } - }); - if (children_1.length === 0) { - return ChildrenNode.EMPTY_NODE; - } - var childSet = buildChildSet(children_1, NAME_ONLY_COMPARATOR, function (namedNode) { return namedNode.name; }, NAME_COMPARATOR); - if (childrenHavePriority_1) { - var sortedChildSet = buildChildSet(children_1, PRIORITY_INDEX.getCompare()); - return new ChildrenNode(childSet, nodeFromJSON(priority), new IndexMap({ '.priority': sortedChildSet }, { '.priority': PRIORITY_INDEX })); - } - else { - return new ChildrenNode(childSet, nodeFromJSON(priority), IndexMap.Default); - } - } - else { - var node_1 = ChildrenNode.EMPTY_NODE; - each(json, function (key, childData) { - if (util.contains(json, key)) { - if (key.substring(0, 1) !== '.') { - // ignore metadata nodes. - var childNode = nodeFromJSON(childData); - if (childNode.isLeafNode() || !childNode.isEmpty()) { - node_1 = node_1.updateImmediateChild(key, childNode); - } - } - } - }); - return node_1.updatePriority(nodeFromJSON(priority)); - } -} -setNodeFromJSON(nodeFromJSON); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var PathIndex = /** @class */ (function (_super) { - tslib.__extends(PathIndex, _super); - function PathIndex(indexPath_) { - var _this = _super.call(this) || this; - _this.indexPath_ = indexPath_; - util.assert(!pathIsEmpty(indexPath_) && pathGetFront(indexPath_) !== '.priority', "Can't create PathIndex with empty path or .priority key"); - return _this; - } - PathIndex.prototype.extractChild = function (snap) { - return snap.getChild(this.indexPath_); - }; - PathIndex.prototype.isDefinedOn = function (node) { - return !node.getChild(this.indexPath_).isEmpty(); - }; - PathIndex.prototype.compare = function (a, b) { - var aChild = this.extractChild(a.node); - var bChild = this.extractChild(b.node); - var indexCmp = aChild.compareTo(bChild); - if (indexCmp === 0) { - return nameCompare(a.name, b.name); - } - else { - return indexCmp; - } - }; - PathIndex.prototype.makePost = function (indexValue, name) { - var valueNode = nodeFromJSON(indexValue); - var node = ChildrenNode.EMPTY_NODE.updateChild(this.indexPath_, valueNode); - return new NamedNode(name, node); - }; - PathIndex.prototype.maxPost = function () { - var node = ChildrenNode.EMPTY_NODE.updateChild(this.indexPath_, MAX_NODE); - return new NamedNode(MAX_NAME, node); - }; - PathIndex.prototype.toString = function () { - return pathSlice(this.indexPath_, 0).join('/'); - }; - return PathIndex; -}(Index)); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var ValueIndex = /** @class */ (function (_super) { - tslib.__extends(ValueIndex, _super); - function ValueIndex() { - return _super !== null && _super.apply(this, arguments) || this; - } - ValueIndex.prototype.compare = function (a, b) { - var indexCmp = a.node.compareTo(b.node); - if (indexCmp === 0) { - return nameCompare(a.name, b.name); - } - else { - return indexCmp; - } - }; - ValueIndex.prototype.isDefinedOn = function (node) { - return true; - }; - ValueIndex.prototype.indexedValueChanged = function (oldNode, newNode) { - return !oldNode.equals(newNode); - }; - ValueIndex.prototype.minPost = function () { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - return NamedNode.MIN; - }; - ValueIndex.prototype.maxPost = function () { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - return NamedNode.MAX; - }; - ValueIndex.prototype.makePost = function (indexValue, name) { - var valueNode = nodeFromJSON(indexValue); - return new NamedNode(name, valueNode); - }; - /** - * @returns String representation for inclusion in a query spec - */ - ValueIndex.prototype.toString = function () { - return '.value'; - }; - return ValueIndex; -}(Index)); -var VALUE_INDEX = new ValueIndex(); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Modeled after base64 web-safe chars, but ordered by ASCII. -var PUSH_CHARS = '-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz'; -var MIN_PUSH_CHAR = '-'; -var MAX_PUSH_CHAR = 'z'; -var MAX_KEY_LEN = 786; -/** - * Fancy ID generator that creates 20-character string identifiers with the - * following properties: - * - * 1. They're based on timestamp so that they sort *after* any existing ids. - * 2. They contain 72-bits of random data after the timestamp so that IDs won't - * collide with other clients' IDs. - * 3. They sort *lexicographically* (so the timestamp is converted to characters - * that will sort properly). - * 4. They're monotonically increasing. Even if you generate more than one in - * the same timestamp, the latter ones will sort after the former ones. We do - * this by using the previous random bits but "incrementing" them by 1 (only - * in the case of a timestamp collision). - */ -var nextPushId = (function () { - // Timestamp of last push, used to prevent local collisions if you push twice - // in one ms. - var lastPushTime = 0; - // We generate 72-bits of randomness which get turned into 12 characters and - // appended to the timestamp to prevent collisions with other clients. We - // store the last characters we generated because in the event of a collision, - // we'll use those same characters except "incremented" by one. - var lastRandChars = []; - return function (now) { - var duplicateTime = now === lastPushTime; - lastPushTime = now; - var i; - var timeStampChars = new Array(8); - for (i = 7; i >= 0; i--) { - timeStampChars[i] = PUSH_CHARS.charAt(now % 64); - // NOTE: Can't use << here because javascript will convert to int and lose - // the upper bits. - now = Math.floor(now / 64); - } - util.assert(now === 0, 'Cannot push at time == 0'); - var id = timeStampChars.join(''); - if (!duplicateTime) { - for (i = 0; i < 12; i++) { - lastRandChars[i] = Math.floor(Math.random() * 64); - } - } - else { - // If the timestamp hasn't changed since last push, use the same random - // number, except incremented by 1. - for (i = 11; i >= 0 && lastRandChars[i] === 63; i--) { - lastRandChars[i] = 0; - } - lastRandChars[i]++; - } - for (i = 0; i < 12; i++) { - id += PUSH_CHARS.charAt(lastRandChars[i]); - } - util.assert(id.length === 20, 'nextPushId: Length should be 20.'); - return id; - }; -})(); -var successor = function (key) { - if (key === '' + INTEGER_32_MAX) { - // See https://firebase.google.com/docs/database/web/lists-of-data#data-order - return MIN_PUSH_CHAR; - } - var keyAsInt = tryParseInt(key); - if (keyAsInt != null) { - return '' + (keyAsInt + 1); - } - var next = new Array(key.length); - for (var i_1 = 0; i_1 < next.length; i_1++) { - next[i_1] = key.charAt(i_1); - } - if (next.length < MAX_KEY_LEN) { - next.push(MIN_PUSH_CHAR); - return next.join(''); - } - var i = next.length - 1; - while (i >= 0 && next[i] === MAX_PUSH_CHAR) { - i--; - } - // `successor` was called on the largest possible key, so return the - // MAX_NAME, which sorts larger than all keys. - if (i === -1) { - return MAX_NAME; - } - var source = next[i]; - var sourcePlusOne = PUSH_CHARS.charAt(PUSH_CHARS.indexOf(source) + 1); - next[i] = sourcePlusOne; - return next.slice(0, i + 1).join(''); -}; -// `key` is assumed to be non-empty. -var predecessor = function (key) { - if (key === '' + INTEGER_32_MIN) { - return MIN_NAME; - } - var keyAsInt = tryParseInt(key); - if (keyAsInt != null) { - return '' + (keyAsInt - 1); - } - var next = new Array(key.length); - for (var i = 0; i < next.length; i++) { - next[i] = key.charAt(i); - } - // If `key` ends in `MIN_PUSH_CHAR`, the largest key lexicographically - // smaller than `key`, is `key[0:key.length - 1]`. The next key smaller - // than that, `predecessor(predecessor(key))`, is - // - // `key[0:key.length - 2] + (key[key.length - 1] - 1) + \ - // { MAX_PUSH_CHAR repeated MAX_KEY_LEN - (key.length - 1) times } - // - // analogous to increment/decrement for base-10 integers. - // - // This works because lexigographic comparison works character-by-character, - // using length as a tie-breaker if one key is a prefix of the other. - if (next[next.length - 1] === MIN_PUSH_CHAR) { - if (next.length === 1) { - // See https://firebase.google.com/docs/database/web/lists-of-data#orderbykey - return '' + INTEGER_32_MAX; - } - delete next[next.length - 1]; - return next.join(''); - } - // Replace the last character with it's immediate predecessor, and - // fill the suffix of the key with MAX_PUSH_CHAR. This is the - // lexicographically largest possible key smaller than `key`. - next[next.length - 1] = PUSH_CHARS.charAt(PUSH_CHARS.indexOf(next[next.length - 1]) - 1); - return next.join('') + MAX_PUSH_CHAR.repeat(MAX_KEY_LEN - next.length); -}; - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -function changeValue(snapshotNode) { - return { type: "value" /* VALUE */, snapshotNode: snapshotNode }; -} -function changeChildAdded(childName, snapshotNode) { - return { type: "child_added" /* CHILD_ADDED */, snapshotNode: snapshotNode, childName: childName }; -} -function changeChildRemoved(childName, snapshotNode) { - return { type: "child_removed" /* CHILD_REMOVED */, snapshotNode: snapshotNode, childName: childName }; -} -function changeChildChanged(childName, snapshotNode, oldSnap) { - return { - type: "child_changed" /* CHILD_CHANGED */, - snapshotNode: snapshotNode, - childName: childName, - oldSnap: oldSnap - }; -} -function changeChildMoved(childName, snapshotNode) { - return { type: "child_moved" /* CHILD_MOVED */, snapshotNode: snapshotNode, childName: childName }; -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Doesn't really filter nodes but applies an index to the node and keeps track of any changes - */ -var IndexedFilter = /** @class */ (function () { - function IndexedFilter(index_) { - this.index_ = index_; - } - IndexedFilter.prototype.updateChild = function (snap, key, newChild, affectedPath, source, optChangeAccumulator) { - util.assert(snap.isIndexed(this.index_), 'A node must be indexed if only a child is updated'); - var oldChild = snap.getImmediateChild(key); - // Check if anything actually changed. - if (oldChild.getChild(affectedPath).equals(newChild.getChild(affectedPath))) { - // There's an edge case where a child can enter or leave the view because affectedPath was set to null. - // In this case, affectedPath will appear null in both the old and new snapshots. So we need - // to avoid treating these cases as "nothing changed." - if (oldChild.isEmpty() === newChild.isEmpty()) { - // Nothing changed. - // This assert should be valid, but it's expensive (can dominate perf testing) so don't actually do it. - //assert(oldChild.equals(newChild), 'Old and new snapshots should be equal.'); - return snap; - } - } - if (optChangeAccumulator != null) { - if (newChild.isEmpty()) { - if (snap.hasChild(key)) { - optChangeAccumulator.trackChildChange(changeChildRemoved(key, oldChild)); - } - else { - util.assert(snap.isLeafNode(), 'A child remove without an old child only makes sense on a leaf node'); - } - } - else if (oldChild.isEmpty()) { - optChangeAccumulator.trackChildChange(changeChildAdded(key, newChild)); - } - else { - optChangeAccumulator.trackChildChange(changeChildChanged(key, newChild, oldChild)); - } - } - if (snap.isLeafNode() && newChild.isEmpty()) { - return snap; - } - else { - // Make sure the node is indexed - return snap.updateImmediateChild(key, newChild).withIndex(this.index_); - } - }; - IndexedFilter.prototype.updateFullNode = function (oldSnap, newSnap, optChangeAccumulator) { - if (optChangeAccumulator != null) { - if (!oldSnap.isLeafNode()) { - oldSnap.forEachChild(PRIORITY_INDEX, function (key, childNode) { - if (!newSnap.hasChild(key)) { - optChangeAccumulator.trackChildChange(changeChildRemoved(key, childNode)); - } - }); - } - if (!newSnap.isLeafNode()) { - newSnap.forEachChild(PRIORITY_INDEX, function (key, childNode) { - if (oldSnap.hasChild(key)) { - var oldChild = oldSnap.getImmediateChild(key); - if (!oldChild.equals(childNode)) { - optChangeAccumulator.trackChildChange(changeChildChanged(key, childNode, oldChild)); - } - } - else { - optChangeAccumulator.trackChildChange(changeChildAdded(key, childNode)); - } - }); - } - } - return newSnap.withIndex(this.index_); - }; - IndexedFilter.prototype.updatePriority = function (oldSnap, newPriority) { - if (oldSnap.isEmpty()) { - return ChildrenNode.EMPTY_NODE; - } - else { - return oldSnap.updatePriority(newPriority); - } - }; - IndexedFilter.prototype.filtersNodes = function () { - return false; - }; - IndexedFilter.prototype.getIndexedFilter = function () { - return this; - }; - IndexedFilter.prototype.getIndex = function () { - return this.index_; - }; - return IndexedFilter; -}()); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Filters nodes by range and uses an IndexFilter to track any changes after filtering the node - */ -var RangedFilter = /** @class */ (function () { - function RangedFilter(params) { - this.indexedFilter_ = new IndexedFilter(params.getIndex()); - this.index_ = params.getIndex(); - this.startPost_ = RangedFilter.getStartPost_(params); - this.endPost_ = RangedFilter.getEndPost_(params); - } - RangedFilter.prototype.getStartPost = function () { - return this.startPost_; - }; - RangedFilter.prototype.getEndPost = function () { - return this.endPost_; - }; - RangedFilter.prototype.matches = function (node) { - return (this.index_.compare(this.getStartPost(), node) <= 0 && - this.index_.compare(node, this.getEndPost()) <= 0); - }; - RangedFilter.prototype.updateChild = function (snap, key, newChild, affectedPath, source, optChangeAccumulator) { - if (!this.matches(new NamedNode(key, newChild))) { - newChild = ChildrenNode.EMPTY_NODE; - } - return this.indexedFilter_.updateChild(snap, key, newChild, affectedPath, source, optChangeAccumulator); - }; - RangedFilter.prototype.updateFullNode = function (oldSnap, newSnap, optChangeAccumulator) { - if (newSnap.isLeafNode()) { - // Make sure we have a children node with the correct index, not a leaf node; - newSnap = ChildrenNode.EMPTY_NODE; - } - var filtered = newSnap.withIndex(this.index_); - // Don't support priorities on queries - filtered = filtered.updatePriority(ChildrenNode.EMPTY_NODE); - var self = this; - newSnap.forEachChild(PRIORITY_INDEX, function (key, childNode) { - if (!self.matches(new NamedNode(key, childNode))) { - filtered = filtered.updateImmediateChild(key, ChildrenNode.EMPTY_NODE); - } - }); - return this.indexedFilter_.updateFullNode(oldSnap, filtered, optChangeAccumulator); - }; - RangedFilter.prototype.updatePriority = function (oldSnap, newPriority) { - // Don't support priorities on queries - return oldSnap; - }; - RangedFilter.prototype.filtersNodes = function () { - return true; - }; - RangedFilter.prototype.getIndexedFilter = function () { - return this.indexedFilter_; - }; - RangedFilter.prototype.getIndex = function () { - return this.index_; - }; - RangedFilter.getStartPost_ = function (params) { - if (params.hasStart()) { - var startName = params.getIndexStartName(); - return params.getIndex().makePost(params.getIndexStartValue(), startName); - } - else { - return params.getIndex().minPost(); - } - }; - RangedFilter.getEndPost_ = function (params) { - if (params.hasEnd()) { - var endName = params.getIndexEndName(); - return params.getIndex().makePost(params.getIndexEndValue(), endName); - } - else { - return params.getIndex().maxPost(); - } - }; - return RangedFilter; -}()); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Applies a limit and a range to a node and uses RangedFilter to do the heavy lifting where possible - */ -var LimitedFilter = /** @class */ (function () { - function LimitedFilter(params) { - this.rangedFilter_ = new RangedFilter(params); - this.index_ = params.getIndex(); - this.limit_ = params.getLimit(); - this.reverse_ = !params.isViewFromLeft(); - } - LimitedFilter.prototype.updateChild = function (snap, key, newChild, affectedPath, source, optChangeAccumulator) { - if (!this.rangedFilter_.matches(new NamedNode(key, newChild))) { - newChild = ChildrenNode.EMPTY_NODE; - } - if (snap.getImmediateChild(key).equals(newChild)) { - // No change - return snap; - } - else if (snap.numChildren() < this.limit_) { - return this.rangedFilter_ - .getIndexedFilter() - .updateChild(snap, key, newChild, affectedPath, source, optChangeAccumulator); - } - else { - return this.fullLimitUpdateChild_(snap, key, newChild, source, optChangeAccumulator); - } - }; - LimitedFilter.prototype.updateFullNode = function (oldSnap, newSnap, optChangeAccumulator) { - var filtered; - if (newSnap.isLeafNode() || newSnap.isEmpty()) { - // Make sure we have a children node with the correct index, not a leaf node; - filtered = ChildrenNode.EMPTY_NODE.withIndex(this.index_); - } - else { - if (this.limit_ * 2 < newSnap.numChildren() && - newSnap.isIndexed(this.index_)) { - // Easier to build up a snapshot, since what we're given has more than twice the elements we want - filtered = ChildrenNode.EMPTY_NODE.withIndex(this.index_); - // anchor to the startPost, endPost, or last element as appropriate - var iterator = void 0; - if (this.reverse_) { - iterator = newSnap.getReverseIteratorFrom(this.rangedFilter_.getEndPost(), this.index_); - } - else { - iterator = newSnap.getIteratorFrom(this.rangedFilter_.getStartPost(), this.index_); - } - var count = 0; - while (iterator.hasNext() && count < this.limit_) { - var next = iterator.getNext(); - var inRange = void 0; - if (this.reverse_) { - inRange = - this.index_.compare(this.rangedFilter_.getStartPost(), next) <= 0; - } - else { - inRange = - this.index_.compare(next, this.rangedFilter_.getEndPost()) <= 0; - } - if (inRange) { - filtered = filtered.updateImmediateChild(next.name, next.node); - count++; - } - else { - // if we have reached the end post, we cannot keep adding elemments - break; - } - } - } - else { - // The snap contains less than twice the limit. Faster to delete from the snap than build up a new one - filtered = newSnap.withIndex(this.index_); - // Don't support priorities on queries - filtered = filtered.updatePriority(ChildrenNode.EMPTY_NODE); - var startPost = void 0; - var endPost = void 0; - var cmp = void 0; - var iterator = void 0; - if (this.reverse_) { - iterator = filtered.getReverseIterator(this.index_); - startPost = this.rangedFilter_.getEndPost(); - endPost = this.rangedFilter_.getStartPost(); - var indexCompare_1 = this.index_.getCompare(); - cmp = function (a, b) { return indexCompare_1(b, a); }; - } - else { - iterator = filtered.getIterator(this.index_); - startPost = this.rangedFilter_.getStartPost(); - endPost = this.rangedFilter_.getEndPost(); - cmp = this.index_.getCompare(); - } - var count = 0; - var foundStartPost = false; - while (iterator.hasNext()) { - var next = iterator.getNext(); - if (!foundStartPost && cmp(startPost, next) <= 0) { - // start adding - foundStartPost = true; - } - var inRange = foundStartPost && count < this.limit_ && cmp(next, endPost) <= 0; - if (inRange) { - count++; - } - else { - filtered = filtered.updateImmediateChild(next.name, ChildrenNode.EMPTY_NODE); - } - } - } - } - return this.rangedFilter_ - .getIndexedFilter() - .updateFullNode(oldSnap, filtered, optChangeAccumulator); - }; - LimitedFilter.prototype.updatePriority = function (oldSnap, newPriority) { - // Don't support priorities on queries - return oldSnap; - }; - LimitedFilter.prototype.filtersNodes = function () { - return true; - }; - LimitedFilter.prototype.getIndexedFilter = function () { - return this.rangedFilter_.getIndexedFilter(); - }; - LimitedFilter.prototype.getIndex = function () { - return this.index_; - }; - LimitedFilter.prototype.fullLimitUpdateChild_ = function (snap, childKey, childSnap, source, changeAccumulator) { - // TODO: rename all cache stuff etc to general snap terminology - var cmp; - if (this.reverse_) { - var indexCmp_1 = this.index_.getCompare(); - cmp = function (a, b) { return indexCmp_1(b, a); }; - } - else { - cmp = this.index_.getCompare(); - } - var oldEventCache = snap; - util.assert(oldEventCache.numChildren() === this.limit_, ''); - var newChildNamedNode = new NamedNode(childKey, childSnap); - var windowBoundary = this.reverse_ - ? oldEventCache.getFirstChild(this.index_) - : oldEventCache.getLastChild(this.index_); - var inRange = this.rangedFilter_.matches(newChildNamedNode); - if (oldEventCache.hasChild(childKey)) { - var oldChildSnap = oldEventCache.getImmediateChild(childKey); - var nextChild = source.getChildAfterChild(this.index_, windowBoundary, this.reverse_); - while (nextChild != null && - (nextChild.name === childKey || oldEventCache.hasChild(nextChild.name))) { - // There is a weird edge case where a node is updated as part of a merge in the write tree, but hasn't - // been applied to the limited filter yet. Ignore this next child which will be updated later in - // the limited filter... - nextChild = source.getChildAfterChild(this.index_, nextChild, this.reverse_); - } - var compareNext = nextChild == null ? 1 : cmp(nextChild, newChildNamedNode); - var remainsInWindow = inRange && !childSnap.isEmpty() && compareNext >= 0; - if (remainsInWindow) { - if (changeAccumulator != null) { - changeAccumulator.trackChildChange(changeChildChanged(childKey, childSnap, oldChildSnap)); - } - return oldEventCache.updateImmediateChild(childKey, childSnap); - } - else { - if (changeAccumulator != null) { - changeAccumulator.trackChildChange(changeChildRemoved(childKey, oldChildSnap)); - } - var newEventCache = oldEventCache.updateImmediateChild(childKey, ChildrenNode.EMPTY_NODE); - var nextChildInRange = nextChild != null && this.rangedFilter_.matches(nextChild); - if (nextChildInRange) { - if (changeAccumulator != null) { - changeAccumulator.trackChildChange(changeChildAdded(nextChild.name, nextChild.node)); - } - return newEventCache.updateImmediateChild(nextChild.name, nextChild.node); - } - else { - return newEventCache; - } - } - } - else if (childSnap.isEmpty()) { - // we're deleting a node, but it was not in the window, so ignore it - return snap; - } - else if (inRange) { - if (cmp(windowBoundary, newChildNamedNode) >= 0) { - if (changeAccumulator != null) { - changeAccumulator.trackChildChange(changeChildRemoved(windowBoundary.name, windowBoundary.node)); - changeAccumulator.trackChildChange(changeChildAdded(childKey, childSnap)); - } - return oldEventCache - .updateImmediateChild(childKey, childSnap) - .updateImmediateChild(windowBoundary.name, ChildrenNode.EMPTY_NODE); - } - else { - return snap; - } - } - else { - return snap; - } - }; - return LimitedFilter; -}()); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * This class is an immutable-from-the-public-api struct containing a set of query parameters defining a - * range to be returned for a particular location. It is assumed that validation of parameters is done at the - * user-facing API level, so it is not done here. - * - * @internal - */ -var QueryParams = /** @class */ (function () { - function QueryParams() { - this.limitSet_ = false; - this.startSet_ = false; - this.startNameSet_ = false; - this.startAfterSet_ = false; - this.endSet_ = false; - this.endNameSet_ = false; - this.endBeforeSet_ = false; - this.limit_ = 0; - this.viewFrom_ = ''; - this.indexStartValue_ = null; - this.indexStartName_ = ''; - this.indexEndValue_ = null; - this.indexEndName_ = ''; - this.index_ = PRIORITY_INDEX; - } - QueryParams.prototype.hasStart = function () { - return this.startSet_; - }; - QueryParams.prototype.hasStartAfter = function () { - return this.startAfterSet_; - }; - QueryParams.prototype.hasEndBefore = function () { - return this.endBeforeSet_; - }; - /** - * @returns True if it would return from left. - */ - QueryParams.prototype.isViewFromLeft = function () { - if (this.viewFrom_ === '') { - // limit(), rather than limitToFirst or limitToLast was called. - // This means that only one of startSet_ and endSet_ is true. Use them - // to calculate which side of the view to anchor to. If neither is set, - // anchor to the end. - return this.startSet_; - } - else { - return this.viewFrom_ === "l" /* VIEW_FROM_LEFT */; - } - }; - /** - * Only valid to call if hasStart() returns true - */ - QueryParams.prototype.getIndexStartValue = function () { - util.assert(this.startSet_, 'Only valid if start has been set'); - return this.indexStartValue_; - }; - /** - * Only valid to call if hasStart() returns true. - * Returns the starting key name for the range defined by these query parameters - */ - QueryParams.prototype.getIndexStartName = function () { - util.assert(this.startSet_, 'Only valid if start has been set'); - if (this.startNameSet_) { - return this.indexStartName_; - } - else { - return MIN_NAME; - } - }; - QueryParams.prototype.hasEnd = function () { - return this.endSet_; - }; - /** - * Only valid to call if hasEnd() returns true. - */ - QueryParams.prototype.getIndexEndValue = function () { - util.assert(this.endSet_, 'Only valid if end has been set'); - return this.indexEndValue_; - }; - /** - * Only valid to call if hasEnd() returns true. - * Returns the end key name for the range defined by these query parameters - */ - QueryParams.prototype.getIndexEndName = function () { - util.assert(this.endSet_, 'Only valid if end has been set'); - if (this.endNameSet_) { - return this.indexEndName_; - } - else { - return MAX_NAME; - } - }; - QueryParams.prototype.hasLimit = function () { - return this.limitSet_; - }; - /** - * @returns True if a limit has been set and it has been explicitly anchored - */ - QueryParams.prototype.hasAnchoredLimit = function () { - return this.limitSet_ && this.viewFrom_ !== ''; - }; - /** - * Only valid to call if hasLimit() returns true - */ - QueryParams.prototype.getLimit = function () { - util.assert(this.limitSet_, 'Only valid if limit has been set'); - return this.limit_; - }; - QueryParams.prototype.getIndex = function () { - return this.index_; - }; - QueryParams.prototype.loadsAllData = function () { - return !(this.startSet_ || this.endSet_ || this.limitSet_); - }; - QueryParams.prototype.isDefault = function () { - return this.loadsAllData() && this.index_ === PRIORITY_INDEX; - }; - QueryParams.prototype.copy = function () { - var copy = new QueryParams(); - copy.limitSet_ = this.limitSet_; - copy.limit_ = this.limit_; - copy.startSet_ = this.startSet_; - copy.indexStartValue_ = this.indexStartValue_; - copy.startNameSet_ = this.startNameSet_; - copy.indexStartName_ = this.indexStartName_; - copy.endSet_ = this.endSet_; - copy.indexEndValue_ = this.indexEndValue_; - copy.endNameSet_ = this.endNameSet_; - copy.indexEndName_ = this.indexEndName_; - copy.index_ = this.index_; - copy.viewFrom_ = this.viewFrom_; - return copy; - }; - return QueryParams; -}()); -function queryParamsGetNodeFilter(queryParams) { - if (queryParams.loadsAllData()) { - return new IndexedFilter(queryParams.getIndex()); - } - else if (queryParams.hasLimit()) { - return new LimitedFilter(queryParams); - } - else { - return new RangedFilter(queryParams); - } -} -function queryParamsLimitToFirst(queryParams, newLimit) { - var newParams = queryParams.copy(); - newParams.limitSet_ = true; - newParams.limit_ = newLimit; - newParams.viewFrom_ = "l" /* VIEW_FROM_LEFT */; - return newParams; -} -function queryParamsLimitToLast(queryParams, newLimit) { - var newParams = queryParams.copy(); - newParams.limitSet_ = true; - newParams.limit_ = newLimit; - newParams.viewFrom_ = "r" /* VIEW_FROM_RIGHT */; - return newParams; -} -function queryParamsStartAt(queryParams, indexValue, key) { - var newParams = queryParams.copy(); - newParams.startSet_ = true; - if (indexValue === undefined) { - indexValue = null; - } - newParams.indexStartValue_ = indexValue; - if (key != null) { - newParams.startNameSet_ = true; - newParams.indexStartName_ = key; - } - else { - newParams.startNameSet_ = false; - newParams.indexStartName_ = ''; - } - return newParams; -} -function queryParamsStartAfter(queryParams, indexValue, key) { - var params; - if (queryParams.index_ === KEY_INDEX) { - if (typeof indexValue === 'string') { - indexValue = successor(indexValue); - } - params = queryParamsStartAt(queryParams, indexValue, key); - } - else { - var childKey = void 0; - if (key == null) { - childKey = MAX_NAME; - } - else { - childKey = successor(key); - } - params = queryParamsStartAt(queryParams, indexValue, childKey); - } - params.startAfterSet_ = true; - return params; -} -function queryParamsEndAt(queryParams, indexValue, key) { - var newParams = queryParams.copy(); - newParams.endSet_ = true; - if (indexValue === undefined) { - indexValue = null; - } - newParams.indexEndValue_ = indexValue; - if (key !== undefined) { - newParams.endNameSet_ = true; - newParams.indexEndName_ = key; - } - else { - newParams.endNameSet_ = false; - newParams.indexEndName_ = ''; - } - return newParams; -} -function queryParamsEndBefore(queryParams, indexValue, key) { - var childKey; - var params; - if (queryParams.index_ === KEY_INDEX) { - if (typeof indexValue === 'string') { - indexValue = predecessor(indexValue); - } - params = queryParamsEndAt(queryParams, indexValue, key); - } - else { - if (key == null) { - childKey = MIN_NAME; - } - else { - childKey = predecessor(key); - } - params = queryParamsEndAt(queryParams, indexValue, childKey); - } - params.endBeforeSet_ = true; - return params; -} -function queryParamsOrderBy(queryParams, index) { - var newParams = queryParams.copy(); - newParams.index_ = index; - return newParams; -} -/** - * Returns a set of REST query string parameters representing this query. - * - * @returns query string parameters - */ -function queryParamsToRestQueryStringParameters(queryParams) { - var qs = {}; - if (queryParams.isDefault()) { - return qs; - } - var orderBy; - if (queryParams.index_ === PRIORITY_INDEX) { - orderBy = "$priority" /* PRIORITY_INDEX */; - } - else if (queryParams.index_ === VALUE_INDEX) { - orderBy = "$value" /* VALUE_INDEX */; - } - else if (queryParams.index_ === KEY_INDEX) { - orderBy = "$key" /* KEY_INDEX */; - } - else { - util.assert(queryParams.index_ instanceof PathIndex, 'Unrecognized index type!'); - orderBy = queryParams.index_.toString(); - } - qs["orderBy" /* ORDER_BY */] = util.stringify(orderBy); - if (queryParams.startSet_) { - qs["startAt" /* START_AT */] = util.stringify(queryParams.indexStartValue_); - if (queryParams.startNameSet_) { - qs["startAt" /* START_AT */] += - ',' + util.stringify(queryParams.indexStartName_); - } - } - if (queryParams.endSet_) { - qs["endAt" /* END_AT */] = util.stringify(queryParams.indexEndValue_); - if (queryParams.endNameSet_) { - qs["endAt" /* END_AT */] += - ',' + util.stringify(queryParams.indexEndName_); - } - } - if (queryParams.limitSet_) { - if (queryParams.isViewFromLeft()) { - qs["limitToFirst" /* LIMIT_TO_FIRST */] = queryParams.limit_; - } - else { - qs["limitToLast" /* LIMIT_TO_LAST */] = queryParams.limit_; - } - } - return qs; -} -function queryParamsGetQueryObject(queryParams) { - var obj = {}; - if (queryParams.startSet_) { - obj["sp" /* INDEX_START_VALUE */] = - queryParams.indexStartValue_; - if (queryParams.startNameSet_) { - obj["sn" /* INDEX_START_NAME */] = - queryParams.indexStartName_; - } - } - if (queryParams.endSet_) { - obj["ep" /* INDEX_END_VALUE */] = queryParams.indexEndValue_; - if (queryParams.endNameSet_) { - obj["en" /* INDEX_END_NAME */] = queryParams.indexEndName_; - } - } - if (queryParams.limitSet_) { - obj["l" /* LIMIT */] = queryParams.limit_; - var viewFrom = queryParams.viewFrom_; - if (viewFrom === '') { - if (queryParams.isViewFromLeft()) { - viewFrom = "l" /* VIEW_FROM_LEFT */; - } - else { - viewFrom = "r" /* VIEW_FROM_RIGHT */; - } - } - obj["vf" /* VIEW_FROM */] = viewFrom; - } - // For now, priority index is the default, so we only specify if it's some other index - if (queryParams.index_ !== PRIORITY_INDEX) { - obj["i" /* INDEX */] = queryParams.index_.toString(); - } - return obj; -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * An implementation of ServerActions that communicates with the server via REST requests. - * This is mostly useful for compatibility with crawlers, where we don't want to spin up a full - * persistent connection (using WebSockets or long-polling) - */ -var ReadonlyRestClient = /** @class */ (function (_super) { - tslib.__extends(ReadonlyRestClient, _super); - /** - * @param repoInfo_ - Data about the namespace we are connecting to - * @param onDataUpdate_ - A callback for new data from the server - */ - function ReadonlyRestClient(repoInfo_, onDataUpdate_, authTokenProvider_, appCheckTokenProvider_) { - var _this = _super.call(this) || this; - _this.repoInfo_ = repoInfo_; - _this.onDataUpdate_ = onDataUpdate_; - _this.authTokenProvider_ = authTokenProvider_; - _this.appCheckTokenProvider_ = appCheckTokenProvider_; - /** @private {function(...[*])} */ - _this.log_ = logWrapper('p:rest:'); - /** - * We don't actually need to track listens, except to prevent us calling an onComplete for a listen - * that's been removed. :-/ - */ - _this.listens_ = {}; - return _this; - } - ReadonlyRestClient.prototype.reportStats = function (stats) { - throw new Error('Method not implemented.'); - }; - ReadonlyRestClient.getListenId_ = function (query, tag) { - if (tag !== undefined) { - return 'tag$' + tag; - } - else { - util.assert(query._queryParams.isDefault(), "should have a tag if it's not a default query."); - return query._path.toString(); - } - }; - /** @inheritDoc */ - ReadonlyRestClient.prototype.listen = function (query, currentHashFn, tag, onComplete) { - var _this = this; - var pathString = query._path.toString(); - this.log_('Listen called for ' + pathString + ' ' + query._queryIdentifier); - // Mark this listener so we can tell if it's removed. - var listenId = ReadonlyRestClient.getListenId_(query, tag); - var thisListen = {}; - this.listens_[listenId] = thisListen; - var queryStringParameters = queryParamsToRestQueryStringParameters(query._queryParams); - this.restRequest_(pathString + '.json', queryStringParameters, function (error, result) { - var data = result; - if (error === 404) { - data = null; - error = null; - } - if (error === null) { - _this.onDataUpdate_(pathString, data, /*isMerge=*/ false, tag); - } - if (util.safeGet(_this.listens_, listenId) === thisListen) { - var status_1; - if (!error) { - status_1 = 'ok'; - } - else if (error === 401) { - status_1 = 'permission_denied'; - } - else { - status_1 = 'rest_error:' + error; - } - onComplete(status_1, null); - } - }); - }; - /** @inheritDoc */ - ReadonlyRestClient.prototype.unlisten = function (query, tag) { - var listenId = ReadonlyRestClient.getListenId_(query, tag); - delete this.listens_[listenId]; - }; - ReadonlyRestClient.prototype.get = function (query) { - var _this = this; - var queryStringParameters = queryParamsToRestQueryStringParameters(query._queryParams); - var pathString = query._path.toString(); - var deferred = new util.Deferred(); - this.restRequest_(pathString + '.json', queryStringParameters, function (error, result) { - var data = result; - if (error === 404) { - data = null; - error = null; - } - if (error === null) { - _this.onDataUpdate_(pathString, data, - /*isMerge=*/ false, - /*tag=*/ null); - deferred.resolve(data); - } - else { - deferred.reject(new Error(data)); - } - }); - return deferred.promise; - }; - /** @inheritDoc */ - ReadonlyRestClient.prototype.refreshAuthToken = function (token) { - // no-op since we just always call getToken. - }; - /** - * Performs a REST request to the given path, with the provided query string parameters, - * and any auth credentials we have. - */ - ReadonlyRestClient.prototype.restRequest_ = function (pathString, queryStringParameters, callback) { - var _this = this; - if (queryStringParameters === void 0) { queryStringParameters = {}; } - queryStringParameters['format'] = 'export'; - return Promise.all([ - this.authTokenProvider_.getToken(/*forceRefresh=*/ false), - this.appCheckTokenProvider_.getToken(/*forceRefresh=*/ false) - ]).then(function (_a) { - var _b = tslib.__read(_a, 2), authToken = _b[0], appCheckToken = _b[1]; - if (authToken && authToken.accessToken) { - queryStringParameters['auth'] = authToken.accessToken; - } - if (appCheckToken && appCheckToken.token) { - queryStringParameters['ac'] = appCheckToken.token; - } - var url = (_this.repoInfo_.secure ? 'https://' : 'http://') + - _this.repoInfo_.host + - pathString + - '?' + - 'ns=' + - _this.repoInfo_.namespace + - util.querystring(queryStringParameters); - _this.log_('Sending REST request for ' + url); - var xhr = new XMLHttpRequest(); - xhr.onreadystatechange = function () { - if (callback && xhr.readyState === 4) { - _this.log_('REST Response for ' + url + ' received. status:', xhr.status, 'response:', xhr.responseText); - var res = null; - if (xhr.status >= 200 && xhr.status < 300) { - try { - res = util.jsonEval(xhr.responseText); - } - catch (e) { - warn$1('Failed to parse JSON response for ' + - url + - ': ' + - xhr.responseText); - } - callback(null, res); - } - else { - // 401 and 404 are expected. - if (xhr.status !== 401 && xhr.status !== 404) { - warn$1('Got unsuccessful REST response for ' + - url + - ' Status: ' + - xhr.status); - } - callback(xhr.status); - } - callback = null; - } - }; - xhr.open('GET', url, /*asynchronous=*/ true); - xhr.send(); - }); - }; - return ReadonlyRestClient; -}(ServerActions)); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Mutable object which basically just stores a reference to the "latest" immutable snapshot. - */ -var SnapshotHolder = /** @class */ (function () { - function SnapshotHolder() { - this.rootNode_ = ChildrenNode.EMPTY_NODE; - } - SnapshotHolder.prototype.getNode = function (path) { - return this.rootNode_.getChild(path); - }; - SnapshotHolder.prototype.updateSnapshot = function (path, newSnapshotNode) { - this.rootNode_ = this.rootNode_.updateChild(path, newSnapshotNode); - }; - return SnapshotHolder; -}()); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -function newSparseSnapshotTree() { - return { - value: null, - children: new Map() - }; -} -/** - * Stores the given node at the specified path. If there is already a node - * at a shallower path, it merges the new data into that snapshot node. - * - * @param path - Path to look up snapshot for. - * @param data - The new data, or null. - */ -function sparseSnapshotTreeRemember(sparseSnapshotTree, path, data) { - if (pathIsEmpty(path)) { - sparseSnapshotTree.value = data; - sparseSnapshotTree.children.clear(); - } - else if (sparseSnapshotTree.value !== null) { - sparseSnapshotTree.value = sparseSnapshotTree.value.updateChild(path, data); - } - else { - var childKey = pathGetFront(path); - if (!sparseSnapshotTree.children.has(childKey)) { - sparseSnapshotTree.children.set(childKey, newSparseSnapshotTree()); - } - var child = sparseSnapshotTree.children.get(childKey); - path = pathPopFront(path); - sparseSnapshotTreeRemember(child, path, data); - } -} -/** - * Purge the data at path from the cache. - * - * @param path - Path to look up snapshot for. - * @returns True if this node should now be removed. - */ -function sparseSnapshotTreeForget(sparseSnapshotTree, path) { - if (pathIsEmpty(path)) { - sparseSnapshotTree.value = null; - sparseSnapshotTree.children.clear(); - return true; - } - else { - if (sparseSnapshotTree.value !== null) { - if (sparseSnapshotTree.value.isLeafNode()) { - // We're trying to forget a node that doesn't exist - return false; - } - else { - var value = sparseSnapshotTree.value; - sparseSnapshotTree.value = null; - value.forEachChild(PRIORITY_INDEX, function (key, tree) { - sparseSnapshotTreeRemember(sparseSnapshotTree, new Path(key), tree); - }); - return sparseSnapshotTreeForget(sparseSnapshotTree, path); - } - } - else if (sparseSnapshotTree.children.size > 0) { - var childKey = pathGetFront(path); - path = pathPopFront(path); - if (sparseSnapshotTree.children.has(childKey)) { - var safeToRemove = sparseSnapshotTreeForget(sparseSnapshotTree.children.get(childKey), path); - if (safeToRemove) { - sparseSnapshotTree.children.delete(childKey); - } - } - return sparseSnapshotTree.children.size === 0; - } - else { - return true; - } - } -} -/** - * Recursively iterates through all of the stored tree and calls the - * callback on each one. - * - * @param prefixPath - Path to look up node for. - * @param func - The function to invoke for each tree. - */ -function sparseSnapshotTreeForEachTree(sparseSnapshotTree, prefixPath, func) { - if (sparseSnapshotTree.value !== null) { - func(prefixPath, sparseSnapshotTree.value); - } - else { - sparseSnapshotTreeForEachChild(sparseSnapshotTree, function (key, tree) { - var path = new Path(prefixPath.toString() + '/' + key); - sparseSnapshotTreeForEachTree(tree, path, func); - }); - } -} -/** - * Iterates through each immediate child and triggers the callback. - * Only seems to be used in tests. - * - * @param func - The function to invoke for each child. - */ -function sparseSnapshotTreeForEachChild(sparseSnapshotTree, func) { - sparseSnapshotTree.children.forEach(function (tree, key) { - func(key, tree); - }); -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Returns the delta from the previous call to get stats. - * - * @param collection_ - The collection to "listen" to. - */ -var StatsListener = /** @class */ (function () { - function StatsListener(collection_) { - this.collection_ = collection_; - this.last_ = null; - } - StatsListener.prototype.get = function () { - var newStats = this.collection_.get(); - var delta = tslib.__assign({}, newStats); - if (this.last_) { - each(this.last_, function (stat, value) { - delta[stat] = delta[stat] - value; - }); - } - this.last_ = newStats; - return delta; - }; - return StatsListener; -}()); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Assuming some apps may have a short amount of time on page, and a bulk of firebase operations probably -// happen on page load, we try to report our first set of stats pretty quickly, but we wait at least 10 -// seconds to try to ensure the Firebase connection is established / settled. -var FIRST_STATS_MIN_TIME = 10 * 1000; -var FIRST_STATS_MAX_TIME = 30 * 1000; -// We'll continue to report stats on average every 5 minutes. -var REPORT_STATS_INTERVAL = 5 * 60 * 1000; -var StatsReporter = /** @class */ (function () { - function StatsReporter(collection, server_) { - this.server_ = server_; - this.statsToReport_ = {}; - this.statsListener_ = new StatsListener(collection); - var timeout = FIRST_STATS_MIN_TIME + - (FIRST_STATS_MAX_TIME - FIRST_STATS_MIN_TIME) * Math.random(); - setTimeoutNonBlocking(this.reportStats_.bind(this), Math.floor(timeout)); - } - StatsReporter.prototype.reportStats_ = function () { - var _this = this; - var stats = this.statsListener_.get(); - var reportedStats = {}; - var haveStatsToReport = false; - each(stats, function (stat, value) { - if (value > 0 && util.contains(_this.statsToReport_, stat)) { - reportedStats[stat] = value; - haveStatsToReport = true; - } - }); - if (haveStatsToReport) { - this.server_.reportStats(reportedStats); - } - // queue our next run. - setTimeoutNonBlocking(this.reportStats_.bind(this), Math.floor(Math.random() * 2 * REPORT_STATS_INTERVAL)); - }; - return StatsReporter; -}()); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * - * @enum - */ -var OperationType; -(function (OperationType) { - OperationType[OperationType["OVERWRITE"] = 0] = "OVERWRITE"; - OperationType[OperationType["MERGE"] = 1] = "MERGE"; - OperationType[OperationType["ACK_USER_WRITE"] = 2] = "ACK_USER_WRITE"; - OperationType[OperationType["LISTEN_COMPLETE"] = 3] = "LISTEN_COMPLETE"; -})(OperationType || (OperationType = {})); -function newOperationSourceUser() { - return { - fromUser: true, - fromServer: false, - queryId: null, - tagged: false - }; -} -function newOperationSourceServer() { - return { - fromUser: false, - fromServer: true, - queryId: null, - tagged: false - }; -} -function newOperationSourceServerTaggedQuery(queryId) { - return { - fromUser: false, - fromServer: true, - queryId: queryId, - tagged: true - }; -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var AckUserWrite = /** @class */ (function () { - /** - * @param affectedTree - A tree containing true for each affected path. Affected paths can't overlap. - */ - function AckUserWrite( - /** @inheritDoc */ path, - /** @inheritDoc */ affectedTree, - /** @inheritDoc */ revert) { - this.path = path; - this.affectedTree = affectedTree; - this.revert = revert; - /** @inheritDoc */ - this.type = OperationType.ACK_USER_WRITE; - /** @inheritDoc */ - this.source = newOperationSourceUser(); - } - AckUserWrite.prototype.operationForChild = function (childName) { - if (!pathIsEmpty(this.path)) { - util.assert(pathGetFront(this.path) === childName, 'operationForChild called for unrelated child.'); - return new AckUserWrite(pathPopFront(this.path), this.affectedTree, this.revert); - } - else if (this.affectedTree.value != null) { - util.assert(this.affectedTree.children.isEmpty(), 'affectedTree should not have overlapping affected paths.'); - // All child locations are affected as well; just return same operation. - return this; - } - else { - var childTree = this.affectedTree.subtree(new Path(childName)); - return new AckUserWrite(newEmptyPath(), childTree, this.revert); - } - }; - return AckUserWrite; -}()); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var ListenComplete = /** @class */ (function () { - function ListenComplete(source, path) { - this.source = source; - this.path = path; - /** @inheritDoc */ - this.type = OperationType.LISTEN_COMPLETE; - } - ListenComplete.prototype.operationForChild = function (childName) { - if (pathIsEmpty(this.path)) { - return new ListenComplete(this.source, newEmptyPath()); - } - else { - return new ListenComplete(this.source, pathPopFront(this.path)); - } - }; - return ListenComplete; -}()); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var Overwrite = /** @class */ (function () { - function Overwrite(source, path, snap) { - this.source = source; - this.path = path; - this.snap = snap; - /** @inheritDoc */ - this.type = OperationType.OVERWRITE; - } - Overwrite.prototype.operationForChild = function (childName) { - if (pathIsEmpty(this.path)) { - return new Overwrite(this.source, newEmptyPath(), this.snap.getImmediateChild(childName)); - } - else { - return new Overwrite(this.source, pathPopFront(this.path), this.snap); - } - }; - return Overwrite; -}()); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var Merge = /** @class */ (function () { - function Merge( - /** @inheritDoc */ source, - /** @inheritDoc */ path, - /** @inheritDoc */ children) { - this.source = source; - this.path = path; - this.children = children; - /** @inheritDoc */ - this.type = OperationType.MERGE; - } - Merge.prototype.operationForChild = function (childName) { - if (pathIsEmpty(this.path)) { - var childTree = this.children.subtree(new Path(childName)); - if (childTree.isEmpty()) { - // This child is unaffected - return null; - } - else if (childTree.value) { - // We have a snapshot for the child in question. This becomes an overwrite of the child. - return new Overwrite(this.source, newEmptyPath(), childTree.value); - } - else { - // This is a merge at a deeper level - return new Merge(this.source, newEmptyPath(), childTree); - } - } - else { - util.assert(pathGetFront(this.path) === childName, "Can't get a merge for a child not on the path of the operation"); - return new Merge(this.source, pathPopFront(this.path), this.children); - } - }; - Merge.prototype.toString = function () { - return ('Operation(' + - this.path + - ': ' + - this.source.toString() + - ' merge: ' + - this.children.toString() + - ')'); - }; - return Merge; -}()); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * A cache node only stores complete children. Additionally it holds a flag whether the node can be considered fully - * initialized in the sense that we know at one point in time this represented a valid state of the world, e.g. - * initialized with data from the server, or a complete overwrite by the client. The filtered flag also tracks - * whether a node potentially had children removed due to a filter. - */ -var CacheNode = /** @class */ (function () { - function CacheNode(node_, fullyInitialized_, filtered_) { - this.node_ = node_; - this.fullyInitialized_ = fullyInitialized_; - this.filtered_ = filtered_; - } - /** - * Returns whether this node was fully initialized with either server data or a complete overwrite by the client - */ - CacheNode.prototype.isFullyInitialized = function () { - return this.fullyInitialized_; - }; - /** - * Returns whether this node is potentially missing children due to a filter applied to the node - */ - CacheNode.prototype.isFiltered = function () { - return this.filtered_; - }; - CacheNode.prototype.isCompleteForPath = function (path) { - if (pathIsEmpty(path)) { - return this.isFullyInitialized() && !this.filtered_; - } - var childKey = pathGetFront(path); - return this.isCompleteForChild(childKey); - }; - CacheNode.prototype.isCompleteForChild = function (key) { - return ((this.isFullyInitialized() && !this.filtered_) || this.node_.hasChild(key)); - }; - CacheNode.prototype.getNode = function () { - return this.node_; - }; - return CacheNode; -}()); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * An EventGenerator is used to convert "raw" changes (Change) as computed by the - * CacheDiffer into actual events (Event) that can be raised. See generateEventsForChanges() - * for details. - * - */ -var EventGenerator = /** @class */ (function () { - function EventGenerator(query_) { - this.query_ = query_; - this.index_ = this.query_._queryParams.getIndex(); - } - return EventGenerator; -}()); -/** - * Given a set of raw changes (no moved events and prevName not specified yet), and a set of - * EventRegistrations that should be notified of these changes, generate the actual events to be raised. - * - * Notes: - * - child_moved events will be synthesized at this time for any child_changed events that affect - * our index. - * - prevName will be calculated based on the index ordering. - */ -function eventGeneratorGenerateEventsForChanges(eventGenerator, changes, eventCache, eventRegistrations) { - var events = []; - var moves = []; - changes.forEach(function (change) { - if (change.type === "child_changed" /* CHILD_CHANGED */ && - eventGenerator.index_.indexedValueChanged(change.oldSnap, change.snapshotNode)) { - moves.push(changeChildMoved(change.childName, change.snapshotNode)); - } - }); - eventGeneratorGenerateEventsForType(eventGenerator, events, "child_removed" /* CHILD_REMOVED */, changes, eventRegistrations, eventCache); - eventGeneratorGenerateEventsForType(eventGenerator, events, "child_added" /* CHILD_ADDED */, changes, eventRegistrations, eventCache); - eventGeneratorGenerateEventsForType(eventGenerator, events, "child_moved" /* CHILD_MOVED */, moves, eventRegistrations, eventCache); - eventGeneratorGenerateEventsForType(eventGenerator, events, "child_changed" /* CHILD_CHANGED */, changes, eventRegistrations, eventCache); - eventGeneratorGenerateEventsForType(eventGenerator, events, "value" /* VALUE */, changes, eventRegistrations, eventCache); - return events; -} -/** - * Given changes of a single change type, generate the corresponding events. - */ -function eventGeneratorGenerateEventsForType(eventGenerator, events, eventType, changes, registrations, eventCache) { - var filteredChanges = changes.filter(function (change) { return change.type === eventType; }); - filteredChanges.sort(function (a, b) { - return eventGeneratorCompareChanges(eventGenerator, a, b); - }); - filteredChanges.forEach(function (change) { - var materializedChange = eventGeneratorMaterializeSingleChange(eventGenerator, change, eventCache); - registrations.forEach(function (registration) { - if (registration.respondsTo(change.type)) { - events.push(registration.createEvent(materializedChange, eventGenerator.query_)); - } - }); - }); -} -function eventGeneratorMaterializeSingleChange(eventGenerator, change, eventCache) { - if (change.type === 'value' || change.type === 'child_removed') { - return change; - } - else { - change.prevName = eventCache.getPredecessorChildName(change.childName, change.snapshotNode, eventGenerator.index_); - return change; - } -} -function eventGeneratorCompareChanges(eventGenerator, a, b) { - if (a.childName == null || b.childName == null) { - throw util.assertionError('Should only compare child_ events.'); - } - var aWrapped = new NamedNode(a.childName, a.snapshotNode); - var bWrapped = new NamedNode(b.childName, b.snapshotNode); - return eventGenerator.index_.compare(aWrapped, bWrapped); -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -function newViewCache(eventCache, serverCache) { - return { eventCache: eventCache, serverCache: serverCache }; -} -function viewCacheUpdateEventSnap(viewCache, eventSnap, complete, filtered) { - return newViewCache(new CacheNode(eventSnap, complete, filtered), viewCache.serverCache); -} -function viewCacheUpdateServerSnap(viewCache, serverSnap, complete, filtered) { - return newViewCache(viewCache.eventCache, new CacheNode(serverSnap, complete, filtered)); -} -function viewCacheGetCompleteEventSnap(viewCache) { - return viewCache.eventCache.isFullyInitialized() - ? viewCache.eventCache.getNode() - : null; -} -function viewCacheGetCompleteServerSnap(viewCache) { - return viewCache.serverCache.isFullyInitialized() - ? viewCache.serverCache.getNode() - : null; -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var emptyChildrenSingleton; -/** - * Singleton empty children collection. - * - */ -var EmptyChildren = function () { - if (!emptyChildrenSingleton) { - emptyChildrenSingleton = new SortedMap(stringCompare); - } - return emptyChildrenSingleton; -}; -/** - * A tree with immutable elements. - */ -var ImmutableTree = /** @class */ (function () { - function ImmutableTree(value, children) { - if (children === void 0) { children = EmptyChildren(); } - this.value = value; - this.children = children; - } - ImmutableTree.fromObject = function (obj) { - var tree = new ImmutableTree(null); - each(obj, function (childPath, childSnap) { - tree = tree.set(new Path(childPath), childSnap); - }); - return tree; - }; - /** - * True if the value is empty and there are no children - */ - ImmutableTree.prototype.isEmpty = function () { - return this.value === null && this.children.isEmpty(); - }; - /** - * Given a path and predicate, return the first node and the path to that node - * where the predicate returns true. - * - * TODO Do a perf test -- If we're creating a bunch of `{path: value:}` - * objects on the way back out, it may be better to pass down a pathSoFar obj. - * - * @param relativePath - The remainder of the path - * @param predicate - The predicate to satisfy to return a node - */ - ImmutableTree.prototype.findRootMostMatchingPathAndValue = function (relativePath, predicate) { - if (this.value != null && predicate(this.value)) { - return { path: newEmptyPath(), value: this.value }; - } - else { - if (pathIsEmpty(relativePath)) { - return null; - } - else { - var front = pathGetFront(relativePath); - var child = this.children.get(front); - if (child !== null) { - var childExistingPathAndValue = child.findRootMostMatchingPathAndValue(pathPopFront(relativePath), predicate); - if (childExistingPathAndValue != null) { - var fullPath = pathChild(new Path(front), childExistingPathAndValue.path); - return { path: fullPath, value: childExistingPathAndValue.value }; - } - else { - return null; - } - } - else { - return null; - } - } - } - }; - /** - * Find, if it exists, the shortest subpath of the given path that points a defined - * value in the tree - */ - ImmutableTree.prototype.findRootMostValueAndPath = function (relativePath) { - return this.findRootMostMatchingPathAndValue(relativePath, function () { return true; }); - }; - /** - * @returns The subtree at the given path - */ - ImmutableTree.prototype.subtree = function (relativePath) { - if (pathIsEmpty(relativePath)) { - return this; - } - else { - var front = pathGetFront(relativePath); - var childTree = this.children.get(front); - if (childTree !== null) { - return childTree.subtree(pathPopFront(relativePath)); - } - else { - return new ImmutableTree(null); - } - } - }; - /** - * Sets a value at the specified path. - * - * @param relativePath - Path to set value at. - * @param toSet - Value to set. - * @returns Resulting tree. - */ - ImmutableTree.prototype.set = function (relativePath, toSet) { - if (pathIsEmpty(relativePath)) { - return new ImmutableTree(toSet, this.children); - } - else { - var front = pathGetFront(relativePath); - var child = this.children.get(front) || new ImmutableTree(null); - var newChild = child.set(pathPopFront(relativePath), toSet); - var newChildren = this.children.insert(front, newChild); - return new ImmutableTree(this.value, newChildren); - } - }; - /** - * Removes the value at the specified path. - * - * @param relativePath - Path to value to remove. - * @returns Resulting tree. - */ - ImmutableTree.prototype.remove = function (relativePath) { - if (pathIsEmpty(relativePath)) { - if (this.children.isEmpty()) { - return new ImmutableTree(null); - } - else { - return new ImmutableTree(null, this.children); - } - } - else { - var front = pathGetFront(relativePath); - var child = this.children.get(front); - if (child) { - var newChild = child.remove(pathPopFront(relativePath)); - var newChildren = void 0; - if (newChild.isEmpty()) { - newChildren = this.children.remove(front); - } - else { - newChildren = this.children.insert(front, newChild); - } - if (this.value === null && newChildren.isEmpty()) { - return new ImmutableTree(null); - } - else { - return new ImmutableTree(this.value, newChildren); - } - } - else { - return this; - } - } - }; - /** - * Gets a value from the tree. - * - * @param relativePath - Path to get value for. - * @returns Value at path, or null. - */ - ImmutableTree.prototype.get = function (relativePath) { - if (pathIsEmpty(relativePath)) { - return this.value; - } - else { - var front = pathGetFront(relativePath); - var child = this.children.get(front); - if (child) { - return child.get(pathPopFront(relativePath)); - } - else { - return null; - } - } - }; - /** - * Replace the subtree at the specified path with the given new tree. - * - * @param relativePath - Path to replace subtree for. - * @param newTree - New tree. - * @returns Resulting tree. - */ - ImmutableTree.prototype.setTree = function (relativePath, newTree) { - if (pathIsEmpty(relativePath)) { - return newTree; - } - else { - var front = pathGetFront(relativePath); - var child = this.children.get(front) || new ImmutableTree(null); - var newChild = child.setTree(pathPopFront(relativePath), newTree); - var newChildren = void 0; - if (newChild.isEmpty()) { - newChildren = this.children.remove(front); - } - else { - newChildren = this.children.insert(front, newChild); - } - return new ImmutableTree(this.value, newChildren); - } - }; - /** - * Performs a depth first fold on this tree. Transforms a tree into a single - * value, given a function that operates on the path to a node, an optional - * current value, and a map of child names to folded subtrees - */ - ImmutableTree.prototype.fold = function (fn) { - return this.fold_(newEmptyPath(), fn); - }; - /** - * Recursive helper for public-facing fold() method - */ - ImmutableTree.prototype.fold_ = function (pathSoFar, fn) { - var accum = {}; - this.children.inorderTraversal(function (childKey, childTree) { - accum[childKey] = childTree.fold_(pathChild(pathSoFar, childKey), fn); - }); - return fn(pathSoFar, this.value, accum); - }; - /** - * Find the first matching value on the given path. Return the result of applying f to it. - */ - ImmutableTree.prototype.findOnPath = function (path, f) { - return this.findOnPath_(path, newEmptyPath(), f); - }; - ImmutableTree.prototype.findOnPath_ = function (pathToFollow, pathSoFar, f) { - var result = this.value ? f(pathSoFar, this.value) : false; - if (result) { - return result; - } - else { - if (pathIsEmpty(pathToFollow)) { - return null; - } - else { - var front = pathGetFront(pathToFollow); - var nextChild = this.children.get(front); - if (nextChild) { - return nextChild.findOnPath_(pathPopFront(pathToFollow), pathChild(pathSoFar, front), f); - } - else { - return null; - } - } - } - }; - ImmutableTree.prototype.foreachOnPath = function (path, f) { - return this.foreachOnPath_(path, newEmptyPath(), f); - }; - ImmutableTree.prototype.foreachOnPath_ = function (pathToFollow, currentRelativePath, f) { - if (pathIsEmpty(pathToFollow)) { - return this; - } - else { - if (this.value) { - f(currentRelativePath, this.value); - } - var front = pathGetFront(pathToFollow); - var nextChild = this.children.get(front); - if (nextChild) { - return nextChild.foreachOnPath_(pathPopFront(pathToFollow), pathChild(currentRelativePath, front), f); - } - else { - return new ImmutableTree(null); - } - } - }; - /** - * Calls the given function for each node in the tree that has a value. - * - * @param f - A function to be called with the path from the root of the tree to - * a node, and the value at that node. Called in depth-first order. - */ - ImmutableTree.prototype.foreach = function (f) { - this.foreach_(newEmptyPath(), f); - }; - ImmutableTree.prototype.foreach_ = function (currentRelativePath, f) { - this.children.inorderTraversal(function (childName, childTree) { - childTree.foreach_(pathChild(currentRelativePath, childName), f); - }); - if (this.value) { - f(currentRelativePath, this.value); - } - }; - ImmutableTree.prototype.foreachChild = function (f) { - this.children.inorderTraversal(function (childName, childTree) { - if (childTree.value) { - f(childName, childTree.value); - } - }); - }; - return ImmutableTree; -}()); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * This class holds a collection of writes that can be applied to nodes in unison. It abstracts away the logic with - * dealing with priority writes and multiple nested writes. At any given path there is only allowed to be one write - * modifying that path. Any write to an existing path or shadowing an existing path will modify that existing write - * to reflect the write added. - */ -var CompoundWrite = /** @class */ (function () { - function CompoundWrite(writeTree_) { - this.writeTree_ = writeTree_; - } - CompoundWrite.empty = function () { - return new CompoundWrite(new ImmutableTree(null)); - }; - return CompoundWrite; -}()); -function compoundWriteAddWrite(compoundWrite, path, node) { - if (pathIsEmpty(path)) { - return new CompoundWrite(new ImmutableTree(node)); - } - else { - var rootmost = compoundWrite.writeTree_.findRootMostValueAndPath(path); - if (rootmost != null) { - var rootMostPath = rootmost.path; - var value = rootmost.value; - var relativePath = newRelativePath(rootMostPath, path); - value = value.updateChild(relativePath, node); - return new CompoundWrite(compoundWrite.writeTree_.set(rootMostPath, value)); - } - else { - var subtree = new ImmutableTree(node); - var newWriteTree = compoundWrite.writeTree_.setTree(path, subtree); - return new CompoundWrite(newWriteTree); - } - } -} -function compoundWriteAddWrites(compoundWrite, path, updates) { - var newWrite = compoundWrite; - each(updates, function (childKey, node) { - newWrite = compoundWriteAddWrite(newWrite, pathChild(path, childKey), node); - }); - return newWrite; -} -/** - * Will remove a write at the given path and deeper paths. This will not modify a write at a higher - * location, which must be removed by calling this method with that path. - * - * @param compoundWrite - The CompoundWrite to remove. - * @param path - The path at which a write and all deeper writes should be removed - * @returns The new CompoundWrite with the removed path - */ -function compoundWriteRemoveWrite(compoundWrite, path) { - if (pathIsEmpty(path)) { - return CompoundWrite.empty(); - } - else { - var newWriteTree = compoundWrite.writeTree_.setTree(path, new ImmutableTree(null)); - return new CompoundWrite(newWriteTree); - } -} -/** - * Returns whether this CompoundWrite will fully overwrite a node at a given location and can therefore be - * considered "complete". - * - * @param compoundWrite - The CompoundWrite to check. - * @param path - The path to check for - * @returns Whether there is a complete write at that path - */ -function compoundWriteHasCompleteWrite(compoundWrite, path) { - return compoundWriteGetCompleteNode(compoundWrite, path) != null; -} -/** - * Returns a node for a path if and only if the node is a "complete" overwrite at that path. This will not aggregate - * writes from deeper paths, but will return child nodes from a more shallow path. - * - * @param compoundWrite - The CompoundWrite to get the node from. - * @param path - The path to get a complete write - * @returns The node if complete at that path, or null otherwise. - */ -function compoundWriteGetCompleteNode(compoundWrite, path) { - var rootmost = compoundWrite.writeTree_.findRootMostValueAndPath(path); - if (rootmost != null) { - return compoundWrite.writeTree_ - .get(rootmost.path) - .getChild(newRelativePath(rootmost.path, path)); - } - else { - return null; - } -} -/** - * Returns all children that are guaranteed to be a complete overwrite. - * - * @param compoundWrite - The CompoundWrite to get children from. - * @returns A list of all complete children. - */ -function compoundWriteGetCompleteChildren(compoundWrite) { - var children = []; - var node = compoundWrite.writeTree_.value; - if (node != null) { - // If it's a leaf node, it has no children; so nothing to do. - if (!node.isLeafNode()) { - node.forEachChild(PRIORITY_INDEX, function (childName, childNode) { - children.push(new NamedNode(childName, childNode)); - }); - } - } - else { - compoundWrite.writeTree_.children.inorderTraversal(function (childName, childTree) { - if (childTree.value != null) { - children.push(new NamedNode(childName, childTree.value)); - } - }); - } - return children; -} -function compoundWriteChildCompoundWrite(compoundWrite, path) { - if (pathIsEmpty(path)) { - return compoundWrite; - } - else { - var shadowingNode = compoundWriteGetCompleteNode(compoundWrite, path); - if (shadowingNode != null) { - return new CompoundWrite(new ImmutableTree(shadowingNode)); - } - else { - return new CompoundWrite(compoundWrite.writeTree_.subtree(path)); - } - } -} -/** - * Returns true if this CompoundWrite is empty and therefore does not modify any nodes. - * @returns Whether this CompoundWrite is empty - */ -function compoundWriteIsEmpty(compoundWrite) { - return compoundWrite.writeTree_.isEmpty(); -} -/** - * Applies this CompoundWrite to a node. The node is returned with all writes from this CompoundWrite applied to the - * node - * @param node - The node to apply this CompoundWrite to - * @returns The node with all writes applied - */ -function compoundWriteApply(compoundWrite, node) { - return applySubtreeWrite(newEmptyPath(), compoundWrite.writeTree_, node); -} -function applySubtreeWrite(relativePath, writeTree, node) { - if (writeTree.value != null) { - // Since there a write is always a leaf, we're done here - return node.updateChild(relativePath, writeTree.value); - } - else { - var priorityWrite_1 = null; - writeTree.children.inorderTraversal(function (childKey, childTree) { - if (childKey === '.priority') { - // Apply priorities at the end so we don't update priorities for either empty nodes or forget - // to apply priorities to empty nodes that are later filled - util.assert(childTree.value !== null, 'Priority writes must always be leaf nodes'); - priorityWrite_1 = childTree.value; - } - else { - node = applySubtreeWrite(pathChild(relativePath, childKey), childTree, node); - } - }); - // If there was a priority write, we only apply it if the node is not empty - if (!node.getChild(relativePath).isEmpty() && priorityWrite_1 !== null) { - node = node.updateChild(pathChild(relativePath, '.priority'), priorityWrite_1); - } - return node; - } -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Create a new WriteTreeRef for the given path. For use with a new sync point at the given path. - * - */ -function writeTreeChildWrites(writeTree, path) { - return newWriteTreeRef(path, writeTree); -} -/** - * Record a new overwrite from user code. - * - * @param visible - This is set to false by some transactions. It should be excluded from event caches - */ -function writeTreeAddOverwrite(writeTree, path, snap, writeId, visible) { - util.assert(writeId > writeTree.lastWriteId, 'Stacking an older write on top of newer ones'); - if (visible === undefined) { - visible = true; - } - writeTree.allWrites.push({ - path: path, - snap: snap, - writeId: writeId, - visible: visible - }); - if (visible) { - writeTree.visibleWrites = compoundWriteAddWrite(writeTree.visibleWrites, path, snap); - } - writeTree.lastWriteId = writeId; -} -/** - * Record a new merge from user code. - */ -function writeTreeAddMerge(writeTree, path, changedChildren, writeId) { - util.assert(writeId > writeTree.lastWriteId, 'Stacking an older merge on top of newer ones'); - writeTree.allWrites.push({ - path: path, - children: changedChildren, - writeId: writeId, - visible: true - }); - writeTree.visibleWrites = compoundWriteAddWrites(writeTree.visibleWrites, path, changedChildren); - writeTree.lastWriteId = writeId; -} -function writeTreeGetWrite(writeTree, writeId) { - for (var i = 0; i < writeTree.allWrites.length; i++) { - var record = writeTree.allWrites[i]; - if (record.writeId === writeId) { - return record; - } - } - return null; -} -/** - * Remove a write (either an overwrite or merge) that has been successfully acknowledge by the server. Recalculates - * the tree if necessary. We return true if it may have been visible, meaning views need to reevaluate. - * - * @returns true if the write may have been visible (meaning we'll need to reevaluate / raise - * events as a result). - */ -function writeTreeRemoveWrite(writeTree, writeId) { - // Note: disabling this check. It could be a transaction that preempted another transaction, and thus was applied - // out of order. - //const validClear = revert || this.allWrites_.length === 0 || writeId <= this.allWrites_[0].writeId; - //assert(validClear, "Either we don't have this write, or it's the first one in the queue"); - var idx = writeTree.allWrites.findIndex(function (s) { - return s.writeId === writeId; - }); - util.assert(idx >= 0, 'removeWrite called with nonexistent writeId.'); - var writeToRemove = writeTree.allWrites[idx]; - writeTree.allWrites.splice(idx, 1); - var removedWriteWasVisible = writeToRemove.visible; - var removedWriteOverlapsWithOtherWrites = false; - var i = writeTree.allWrites.length - 1; - while (removedWriteWasVisible && i >= 0) { - var currentWrite = writeTree.allWrites[i]; - if (currentWrite.visible) { - if (i >= idx && - writeTreeRecordContainsPath_(currentWrite, writeToRemove.path)) { - // The removed write was completely shadowed by a subsequent write. - removedWriteWasVisible = false; - } - else if (pathContains(writeToRemove.path, currentWrite.path)) { - // Either we're covering some writes or they're covering part of us (depending on which came first). - removedWriteOverlapsWithOtherWrites = true; - } - } - i--; - } - if (!removedWriteWasVisible) { - return false; - } - else if (removedWriteOverlapsWithOtherWrites) { - // There's some shadowing going on. Just rebuild the visible writes from scratch. - writeTreeResetTree_(writeTree); - return true; - } - else { - // There's no shadowing. We can safely just remove the write(s) from visibleWrites. - if (writeToRemove.snap) { - writeTree.visibleWrites = compoundWriteRemoveWrite(writeTree.visibleWrites, writeToRemove.path); - } - else { - var children = writeToRemove.children; - each(children, function (childName) { - writeTree.visibleWrites = compoundWriteRemoveWrite(writeTree.visibleWrites, pathChild(writeToRemove.path, childName)); - }); - } - return true; - } -} -function writeTreeRecordContainsPath_(writeRecord, path) { - if (writeRecord.snap) { - return pathContains(writeRecord.path, path); - } - else { - for (var childName in writeRecord.children) { - if (writeRecord.children.hasOwnProperty(childName) && - pathContains(pathChild(writeRecord.path, childName), path)) { - return true; - } - } - return false; - } -} -/** - * Re-layer the writes and merges into a tree so we can efficiently calculate event snapshots - */ -function writeTreeResetTree_(writeTree) { - writeTree.visibleWrites = writeTreeLayerTree_(writeTree.allWrites, writeTreeDefaultFilter_, newEmptyPath()); - if (writeTree.allWrites.length > 0) { - writeTree.lastWriteId = - writeTree.allWrites[writeTree.allWrites.length - 1].writeId; - } - else { - writeTree.lastWriteId = -1; - } -} -/** - * The default filter used when constructing the tree. Keep everything that's visible. - */ -function writeTreeDefaultFilter_(write) { - return write.visible; -} -/** - * Static method. Given an array of WriteRecords, a filter for which ones to include, and a path, construct the tree of - * event data at that path. - */ -function writeTreeLayerTree_(writes, filter, treeRoot) { - var compoundWrite = CompoundWrite.empty(); - for (var i = 0; i < writes.length; ++i) { - var write = writes[i]; - // Theory, a later set will either: - // a) abort a relevant transaction, so no need to worry about excluding it from calculating that transaction - // b) not be relevant to a transaction (separate branch), so again will not affect the data for that transaction - if (filter(write)) { - var writePath = write.path; - var relativePath = void 0; - if (write.snap) { - if (pathContains(treeRoot, writePath)) { - relativePath = newRelativePath(treeRoot, writePath); - compoundWrite = compoundWriteAddWrite(compoundWrite, relativePath, write.snap); - } - else if (pathContains(writePath, treeRoot)) { - relativePath = newRelativePath(writePath, treeRoot); - compoundWrite = compoundWriteAddWrite(compoundWrite, newEmptyPath(), write.snap.getChild(relativePath)); - } - else ; - } - else if (write.children) { - if (pathContains(treeRoot, writePath)) { - relativePath = newRelativePath(treeRoot, writePath); - compoundWrite = compoundWriteAddWrites(compoundWrite, relativePath, write.children); - } - else if (pathContains(writePath, treeRoot)) { - relativePath = newRelativePath(writePath, treeRoot); - if (pathIsEmpty(relativePath)) { - compoundWrite = compoundWriteAddWrites(compoundWrite, newEmptyPath(), write.children); - } - else { - var child = util.safeGet(write.children, pathGetFront(relativePath)); - if (child) { - // There exists a child in this node that matches the root path - var deepNode = child.getChild(pathPopFront(relativePath)); - compoundWrite = compoundWriteAddWrite(compoundWrite, newEmptyPath(), deepNode); - } - } - } - else ; - } - else { - throw util.assertionError('WriteRecord should have .snap or .children'); - } - } - } - return compoundWrite; -} -/** - * Given optional, underlying server data, and an optional set of constraints (exclude some sets, include hidden - * writes), attempt to calculate a complete snapshot for the given path - * - * @param writeIdsToExclude - An optional set to be excluded - * @param includeHiddenWrites - Defaults to false, whether or not to layer on writes with visible set to false - */ -function writeTreeCalcCompleteEventCache(writeTree, treePath, completeServerCache, writeIdsToExclude, includeHiddenWrites) { - if (!writeIdsToExclude && !includeHiddenWrites) { - var shadowingNode = compoundWriteGetCompleteNode(writeTree.visibleWrites, treePath); - if (shadowingNode != null) { - return shadowingNode; - } - else { - var subMerge = compoundWriteChildCompoundWrite(writeTree.visibleWrites, treePath); - if (compoundWriteIsEmpty(subMerge)) { - return completeServerCache; - } - else if (completeServerCache == null && - !compoundWriteHasCompleteWrite(subMerge, newEmptyPath())) { - // We wouldn't have a complete snapshot, since there's no underlying data and no complete shadow - return null; - } - else { - var layeredCache = completeServerCache || ChildrenNode.EMPTY_NODE; - return compoundWriteApply(subMerge, layeredCache); - } - } - } - else { - var merge = compoundWriteChildCompoundWrite(writeTree.visibleWrites, treePath); - if (!includeHiddenWrites && compoundWriteIsEmpty(merge)) { - return completeServerCache; - } - else { - // If the server cache is null, and we don't have a complete cache, we need to return null - if (!includeHiddenWrites && - completeServerCache == null && - !compoundWriteHasCompleteWrite(merge, newEmptyPath())) { - return null; - } - else { - var filter = function (write) { - return ((write.visible || includeHiddenWrites) && - (!writeIdsToExclude || - !~writeIdsToExclude.indexOf(write.writeId)) && - (pathContains(write.path, treePath) || - pathContains(treePath, write.path))); - }; - var mergeAtPath = writeTreeLayerTree_(writeTree.allWrites, filter, treePath); - var layeredCache = completeServerCache || ChildrenNode.EMPTY_NODE; - return compoundWriteApply(mergeAtPath, layeredCache); - } - } - } -} -/** - * With optional, underlying server data, attempt to return a children node of children that we have complete data for. - * Used when creating new views, to pre-fill their complete event children snapshot. - */ -function writeTreeCalcCompleteEventChildren(writeTree, treePath, completeServerChildren) { - var completeChildren = ChildrenNode.EMPTY_NODE; - var topLevelSet = compoundWriteGetCompleteNode(writeTree.visibleWrites, treePath); - if (topLevelSet) { - if (!topLevelSet.isLeafNode()) { - // we're shadowing everything. Return the children. - topLevelSet.forEachChild(PRIORITY_INDEX, function (childName, childSnap) { - completeChildren = completeChildren.updateImmediateChild(childName, childSnap); - }); - } - return completeChildren; - } - else if (completeServerChildren) { - // Layer any children we have on top of this - // We know we don't have a top-level set, so just enumerate existing children - var merge_1 = compoundWriteChildCompoundWrite(writeTree.visibleWrites, treePath); - completeServerChildren.forEachChild(PRIORITY_INDEX, function (childName, childNode) { - var node = compoundWriteApply(compoundWriteChildCompoundWrite(merge_1, new Path(childName)), childNode); - completeChildren = completeChildren.updateImmediateChild(childName, node); - }); - // Add any complete children we have from the set - compoundWriteGetCompleteChildren(merge_1).forEach(function (namedNode) { - completeChildren = completeChildren.updateImmediateChild(namedNode.name, namedNode.node); - }); - return completeChildren; - } - else { - // We don't have anything to layer on top of. Layer on any children we have - // Note that we can return an empty snap if we have a defined delete - var merge = compoundWriteChildCompoundWrite(writeTree.visibleWrites, treePath); - compoundWriteGetCompleteChildren(merge).forEach(function (namedNode) { - completeChildren = completeChildren.updateImmediateChild(namedNode.name, namedNode.node); - }); - return completeChildren; - } -} -/** - * Given that the underlying server data has updated, determine what, if anything, needs to be - * applied to the event cache. - * - * Possibilities: - * - * 1. No writes are shadowing. Events should be raised, the snap to be applied comes from the server data - * - * 2. Some write is completely shadowing. No events to be raised - * - * 3. Is partially shadowed. Events - * - * Either existingEventSnap or existingServerSnap must exist - */ -function writeTreeCalcEventCacheAfterServerOverwrite(writeTree, treePath, childPath, existingEventSnap, existingServerSnap) { - util.assert(existingEventSnap || existingServerSnap, 'Either existingEventSnap or existingServerSnap must exist'); - var path = pathChild(treePath, childPath); - if (compoundWriteHasCompleteWrite(writeTree.visibleWrites, path)) { - // At this point we can probably guarantee that we're in case 2, meaning no events - // May need to check visibility while doing the findRootMostValueAndPath call - return null; - } - else { - // No complete shadowing. We're either partially shadowing or not shadowing at all. - var childMerge = compoundWriteChildCompoundWrite(writeTree.visibleWrites, path); - if (compoundWriteIsEmpty(childMerge)) { - // We're not shadowing at all. Case 1 - return existingServerSnap.getChild(childPath); - } - else { - // This could be more efficient if the serverNode + updates doesn't change the eventSnap - // However this is tricky to find out, since user updates don't necessary change the server - // snap, e.g. priority updates on empty nodes, or deep deletes. Another special case is if the server - // adds nodes, but doesn't change any existing writes. It is therefore not enough to - // only check if the updates change the serverNode. - // Maybe check if the merge tree contains these special cases and only do a full overwrite in that case? - return compoundWriteApply(childMerge, existingServerSnap.getChild(childPath)); - } - } -} -/** - * Returns a complete child for a given server snap after applying all user writes or null if there is no - * complete child for this ChildKey. - */ -function writeTreeCalcCompleteChild(writeTree, treePath, childKey, existingServerSnap) { - var path = pathChild(treePath, childKey); - var shadowingNode = compoundWriteGetCompleteNode(writeTree.visibleWrites, path); - if (shadowingNode != null) { - return shadowingNode; - } - else { - if (existingServerSnap.isCompleteForChild(childKey)) { - var childMerge = compoundWriteChildCompoundWrite(writeTree.visibleWrites, path); - return compoundWriteApply(childMerge, existingServerSnap.getNode().getImmediateChild(childKey)); - } - else { - return null; - } - } -} -/** - * Returns a node if there is a complete overwrite for this path. More specifically, if there is a write at - * a higher path, this will return the child of that write relative to the write and this path. - * Returns null if there is no write at this path. - */ -function writeTreeShadowingWrite(writeTree, path) { - return compoundWriteGetCompleteNode(writeTree.visibleWrites, path); -} -/** - * This method is used when processing child remove events on a query. If we can, we pull in children that were outside - * the window, but may now be in the window. - */ -function writeTreeCalcIndexedSlice(writeTree, treePath, completeServerData, startPost, count, reverse, index) { - var toIterate; - var merge = compoundWriteChildCompoundWrite(writeTree.visibleWrites, treePath); - var shadowingNode = compoundWriteGetCompleteNode(merge, newEmptyPath()); - if (shadowingNode != null) { - toIterate = shadowingNode; - } - else if (completeServerData != null) { - toIterate = compoundWriteApply(merge, completeServerData); - } - else { - // no children to iterate on - return []; - } - toIterate = toIterate.withIndex(index); - if (!toIterate.isEmpty() && !toIterate.isLeafNode()) { - var nodes = []; - var cmp = index.getCompare(); - var iter = reverse - ? toIterate.getReverseIteratorFrom(startPost, index) - : toIterate.getIteratorFrom(startPost, index); - var next = iter.getNext(); - while (next && nodes.length < count) { - if (cmp(next, startPost) !== 0) { - nodes.push(next); - } - next = iter.getNext(); - } - return nodes; - } - else { - return []; - } -} -function newWriteTree() { - return { - visibleWrites: CompoundWrite.empty(), - allWrites: [], - lastWriteId: -1 - }; -} -/** - * If possible, returns a complete event cache, using the underlying server data if possible. In addition, can be used - * to get a cache that includes hidden writes, and excludes arbitrary writes. Note that customizing the returned node - * can lead to a more expensive calculation. - * - * @param writeIdsToExclude - Optional writes to exclude. - * @param includeHiddenWrites - Defaults to false, whether or not to layer on writes with visible set to false - */ -function writeTreeRefCalcCompleteEventCache(writeTreeRef, completeServerCache, writeIdsToExclude, includeHiddenWrites) { - return writeTreeCalcCompleteEventCache(writeTreeRef.writeTree, writeTreeRef.treePath, completeServerCache, writeIdsToExclude, includeHiddenWrites); -} -/** - * If possible, returns a children node containing all of the complete children we have data for. The returned data is a - * mix of the given server data and write data. - * - */ -function writeTreeRefCalcCompleteEventChildren(writeTreeRef, completeServerChildren) { - return writeTreeCalcCompleteEventChildren(writeTreeRef.writeTree, writeTreeRef.treePath, completeServerChildren); -} -/** - * Given that either the underlying server data has updated or the outstanding writes have updated, determine what, - * if anything, needs to be applied to the event cache. - * - * Possibilities: - * - * 1. No writes are shadowing. Events should be raised, the snap to be applied comes from the server data - * - * 2. Some write is completely shadowing. No events to be raised - * - * 3. Is partially shadowed. Events should be raised - * - * Either existingEventSnap or existingServerSnap must exist, this is validated via an assert - * - * - */ -function writeTreeRefCalcEventCacheAfterServerOverwrite(writeTreeRef, path, existingEventSnap, existingServerSnap) { - return writeTreeCalcEventCacheAfterServerOverwrite(writeTreeRef.writeTree, writeTreeRef.treePath, path, existingEventSnap, existingServerSnap); -} -/** - * Returns a node if there is a complete overwrite for this path. More specifically, if there is a write at - * a higher path, this will return the child of that write relative to the write and this path. - * Returns null if there is no write at this path. - * - */ -function writeTreeRefShadowingWrite(writeTreeRef, path) { - return writeTreeShadowingWrite(writeTreeRef.writeTree, pathChild(writeTreeRef.treePath, path)); -} -/** - * This method is used when processing child remove events on a query. If we can, we pull in children that were outside - * the window, but may now be in the window - */ -function writeTreeRefCalcIndexedSlice(writeTreeRef, completeServerData, startPost, count, reverse, index) { - return writeTreeCalcIndexedSlice(writeTreeRef.writeTree, writeTreeRef.treePath, completeServerData, startPost, count, reverse, index); -} -/** - * Returns a complete child for a given server snap after applying all user writes or null if there is no - * complete child for this ChildKey. - */ -function writeTreeRefCalcCompleteChild(writeTreeRef, childKey, existingServerCache) { - return writeTreeCalcCompleteChild(writeTreeRef.writeTree, writeTreeRef.treePath, childKey, existingServerCache); -} -/** - * Return a WriteTreeRef for a child. - */ -function writeTreeRefChild(writeTreeRef, childName) { - return newWriteTreeRef(pathChild(writeTreeRef.treePath, childName), writeTreeRef.writeTree); -} -function newWriteTreeRef(path, writeTree) { - return { - treePath: path, - writeTree: writeTree - }; -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var ChildChangeAccumulator = /** @class */ (function () { - function ChildChangeAccumulator() { - this.changeMap = new Map(); - } - ChildChangeAccumulator.prototype.trackChildChange = function (change) { - var type = change.type; - var childKey = change.childName; - util.assert(type === "child_added" /* CHILD_ADDED */ || - type === "child_changed" /* CHILD_CHANGED */ || - type === "child_removed" /* CHILD_REMOVED */, 'Only child changes supported for tracking'); - util.assert(childKey !== '.priority', 'Only non-priority child changes can be tracked.'); - var oldChange = this.changeMap.get(childKey); - if (oldChange) { - var oldType = oldChange.type; - if (type === "child_added" /* CHILD_ADDED */ && - oldType === "child_removed" /* CHILD_REMOVED */) { - this.changeMap.set(childKey, changeChildChanged(childKey, change.snapshotNode, oldChange.snapshotNode)); - } - else if (type === "child_removed" /* CHILD_REMOVED */ && - oldType === "child_added" /* CHILD_ADDED */) { - this.changeMap.delete(childKey); - } - else if (type === "child_removed" /* CHILD_REMOVED */ && - oldType === "child_changed" /* CHILD_CHANGED */) { - this.changeMap.set(childKey, changeChildRemoved(childKey, oldChange.oldSnap)); - } - else if (type === "child_changed" /* CHILD_CHANGED */ && - oldType === "child_added" /* CHILD_ADDED */) { - this.changeMap.set(childKey, changeChildAdded(childKey, change.snapshotNode)); - } - else if (type === "child_changed" /* CHILD_CHANGED */ && - oldType === "child_changed" /* CHILD_CHANGED */) { - this.changeMap.set(childKey, changeChildChanged(childKey, change.snapshotNode, oldChange.oldSnap)); - } - else { - throw util.assertionError('Illegal combination of changes: ' + - change + - ' occurred after ' + - oldChange); - } - } - else { - this.changeMap.set(childKey, change); - } - }; - ChildChangeAccumulator.prototype.getChanges = function () { - return Array.from(this.changeMap.values()); - }; - return ChildChangeAccumulator; -}()); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * An implementation of CompleteChildSource that never returns any additional children - */ -// eslint-disable-next-line @typescript-eslint/naming-convention -var NoCompleteChildSource_ = /** @class */ (function () { - function NoCompleteChildSource_() { - } - NoCompleteChildSource_.prototype.getCompleteChild = function (childKey) { - return null; - }; - NoCompleteChildSource_.prototype.getChildAfterChild = function (index, child, reverse) { - return null; - }; - return NoCompleteChildSource_; -}()); -/** - * Singleton instance. - */ -var NO_COMPLETE_CHILD_SOURCE = new NoCompleteChildSource_(); -/** - * An implementation of CompleteChildSource that uses a WriteTree in addition to any other server data or - * old event caches available to calculate complete children. - */ -var WriteTreeCompleteChildSource = /** @class */ (function () { - function WriteTreeCompleteChildSource(writes_, viewCache_, optCompleteServerCache_) { - if (optCompleteServerCache_ === void 0) { optCompleteServerCache_ = null; } - this.writes_ = writes_; - this.viewCache_ = viewCache_; - this.optCompleteServerCache_ = optCompleteServerCache_; - } - WriteTreeCompleteChildSource.prototype.getCompleteChild = function (childKey) { - var node = this.viewCache_.eventCache; - if (node.isCompleteForChild(childKey)) { - return node.getNode().getImmediateChild(childKey); - } - else { - var serverNode = this.optCompleteServerCache_ != null - ? new CacheNode(this.optCompleteServerCache_, true, false) - : this.viewCache_.serverCache; - return writeTreeRefCalcCompleteChild(this.writes_, childKey, serverNode); - } - }; - WriteTreeCompleteChildSource.prototype.getChildAfterChild = function (index, child, reverse) { - var completeServerData = this.optCompleteServerCache_ != null - ? this.optCompleteServerCache_ - : viewCacheGetCompleteServerSnap(this.viewCache_); - var nodes = writeTreeRefCalcIndexedSlice(this.writes_, completeServerData, child, 1, reverse, index); - if (nodes.length === 0) { - return null; - } - else { - return nodes[0]; - } - }; - return WriteTreeCompleteChildSource; -}()); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -function newViewProcessor(filter) { - return { filter: filter }; -} -function viewProcessorAssertIndexed(viewProcessor, viewCache) { - util.assert(viewCache.eventCache.getNode().isIndexed(viewProcessor.filter.getIndex()), 'Event snap not indexed'); - util.assert(viewCache.serverCache.getNode().isIndexed(viewProcessor.filter.getIndex()), 'Server snap not indexed'); -} -function viewProcessorApplyOperation(viewProcessor, oldViewCache, operation, writesCache, completeCache) { - var accumulator = new ChildChangeAccumulator(); - var newViewCache, filterServerNode; - if (operation.type === OperationType.OVERWRITE) { - var overwrite = operation; - if (overwrite.source.fromUser) { - newViewCache = viewProcessorApplyUserOverwrite(viewProcessor, oldViewCache, overwrite.path, overwrite.snap, writesCache, completeCache, accumulator); - } - else { - util.assert(overwrite.source.fromServer, 'Unknown source.'); - // We filter the node if it's a tagged update or the node has been previously filtered and the - // update is not at the root in which case it is ok (and necessary) to mark the node unfiltered - // again - filterServerNode = - overwrite.source.tagged || - (oldViewCache.serverCache.isFiltered() && !pathIsEmpty(overwrite.path)); - newViewCache = viewProcessorApplyServerOverwrite(viewProcessor, oldViewCache, overwrite.path, overwrite.snap, writesCache, completeCache, filterServerNode, accumulator); - } - } - else if (operation.type === OperationType.MERGE) { - var merge = operation; - if (merge.source.fromUser) { - newViewCache = viewProcessorApplyUserMerge(viewProcessor, oldViewCache, merge.path, merge.children, writesCache, completeCache, accumulator); - } - else { - util.assert(merge.source.fromServer, 'Unknown source.'); - // We filter the node if it's a tagged update or the node has been previously filtered - filterServerNode = - merge.source.tagged || oldViewCache.serverCache.isFiltered(); - newViewCache = viewProcessorApplyServerMerge(viewProcessor, oldViewCache, merge.path, merge.children, writesCache, completeCache, filterServerNode, accumulator); - } - } - else if (operation.type === OperationType.ACK_USER_WRITE) { - var ackUserWrite = operation; - if (!ackUserWrite.revert) { - newViewCache = viewProcessorAckUserWrite(viewProcessor, oldViewCache, ackUserWrite.path, ackUserWrite.affectedTree, writesCache, completeCache, accumulator); - } - else { - newViewCache = viewProcessorRevertUserWrite(viewProcessor, oldViewCache, ackUserWrite.path, writesCache, completeCache, accumulator); - } - } - else if (operation.type === OperationType.LISTEN_COMPLETE) { - newViewCache = viewProcessorListenComplete(viewProcessor, oldViewCache, operation.path, writesCache, accumulator); - } - else { - throw util.assertionError('Unknown operation type: ' + operation.type); - } - var changes = accumulator.getChanges(); - viewProcessorMaybeAddValueEvent(oldViewCache, newViewCache, changes); - return { viewCache: newViewCache, changes: changes }; -} -function viewProcessorMaybeAddValueEvent(oldViewCache, newViewCache, accumulator) { - var eventSnap = newViewCache.eventCache; - if (eventSnap.isFullyInitialized()) { - var isLeafOrEmpty = eventSnap.getNode().isLeafNode() || eventSnap.getNode().isEmpty(); - var oldCompleteSnap = viewCacheGetCompleteEventSnap(oldViewCache); - if (accumulator.length > 0 || - !oldViewCache.eventCache.isFullyInitialized() || - (isLeafOrEmpty && !eventSnap.getNode().equals(oldCompleteSnap)) || - !eventSnap.getNode().getPriority().equals(oldCompleteSnap.getPriority())) { - accumulator.push(changeValue(viewCacheGetCompleteEventSnap(newViewCache))); - } - } -} -function viewProcessorGenerateEventCacheAfterServerEvent(viewProcessor, viewCache, changePath, writesCache, source, accumulator) { - var oldEventSnap = viewCache.eventCache; - if (writeTreeRefShadowingWrite(writesCache, changePath) != null) { - // we have a shadowing write, ignore changes - return viewCache; - } - else { - var newEventCache = void 0, serverNode = void 0; - if (pathIsEmpty(changePath)) { - // TODO: figure out how this plays with "sliding ack windows" - util.assert(viewCache.serverCache.isFullyInitialized(), 'If change path is empty, we must have complete server data'); - if (viewCache.serverCache.isFiltered()) { - // We need to special case this, because we need to only apply writes to complete children, or - // we might end up raising events for incomplete children. If the server data is filtered deep - // writes cannot be guaranteed to be complete - var serverCache = viewCacheGetCompleteServerSnap(viewCache); - var completeChildren = serverCache instanceof ChildrenNode - ? serverCache - : ChildrenNode.EMPTY_NODE; - var completeEventChildren = writeTreeRefCalcCompleteEventChildren(writesCache, completeChildren); - newEventCache = viewProcessor.filter.updateFullNode(viewCache.eventCache.getNode(), completeEventChildren, accumulator); - } - else { - var completeNode = writeTreeRefCalcCompleteEventCache(writesCache, viewCacheGetCompleteServerSnap(viewCache)); - newEventCache = viewProcessor.filter.updateFullNode(viewCache.eventCache.getNode(), completeNode, accumulator); - } - } - else { - var childKey = pathGetFront(changePath); - if (childKey === '.priority') { - util.assert(pathGetLength(changePath) === 1, "Can't have a priority with additional path components"); - var oldEventNode = oldEventSnap.getNode(); - serverNode = viewCache.serverCache.getNode(); - // we might have overwrites for this priority - var updatedPriority = writeTreeRefCalcEventCacheAfterServerOverwrite(writesCache, changePath, oldEventNode, serverNode); - if (updatedPriority != null) { - newEventCache = viewProcessor.filter.updatePriority(oldEventNode, updatedPriority); - } - else { - // priority didn't change, keep old node - newEventCache = oldEventSnap.getNode(); - } - } - else { - var childChangePath = pathPopFront(changePath); - // update child - var newEventChild = void 0; - if (oldEventSnap.isCompleteForChild(childKey)) { - serverNode = viewCache.serverCache.getNode(); - var eventChildUpdate = writeTreeRefCalcEventCacheAfterServerOverwrite(writesCache, changePath, oldEventSnap.getNode(), serverNode); - if (eventChildUpdate != null) { - newEventChild = oldEventSnap - .getNode() - .getImmediateChild(childKey) - .updateChild(childChangePath, eventChildUpdate); - } - else { - // Nothing changed, just keep the old child - newEventChild = oldEventSnap.getNode().getImmediateChild(childKey); - } - } - else { - newEventChild = writeTreeRefCalcCompleteChild(writesCache, childKey, viewCache.serverCache); - } - if (newEventChild != null) { - newEventCache = viewProcessor.filter.updateChild(oldEventSnap.getNode(), childKey, newEventChild, childChangePath, source, accumulator); - } - else { - // no complete child available or no change - newEventCache = oldEventSnap.getNode(); - } - } - } - return viewCacheUpdateEventSnap(viewCache, newEventCache, oldEventSnap.isFullyInitialized() || pathIsEmpty(changePath), viewProcessor.filter.filtersNodes()); - } -} -function viewProcessorApplyServerOverwrite(viewProcessor, oldViewCache, changePath, changedSnap, writesCache, completeCache, filterServerNode, accumulator) { - var oldServerSnap = oldViewCache.serverCache; - var newServerCache; - var serverFilter = filterServerNode - ? viewProcessor.filter - : viewProcessor.filter.getIndexedFilter(); - if (pathIsEmpty(changePath)) { - newServerCache = serverFilter.updateFullNode(oldServerSnap.getNode(), changedSnap, null); - } - else if (serverFilter.filtersNodes() && !oldServerSnap.isFiltered()) { - // we want to filter the server node, but we didn't filter the server node yet, so simulate a full update - var newServerNode = oldServerSnap - .getNode() - .updateChild(changePath, changedSnap); - newServerCache = serverFilter.updateFullNode(oldServerSnap.getNode(), newServerNode, null); - } - else { - var childKey = pathGetFront(changePath); - if (!oldServerSnap.isCompleteForPath(changePath) && - pathGetLength(changePath) > 1) { - // We don't update incomplete nodes with updates intended for other listeners - return oldViewCache; - } - var childChangePath = pathPopFront(changePath); - var childNode = oldServerSnap.getNode().getImmediateChild(childKey); - var newChildNode = childNode.updateChild(childChangePath, changedSnap); - if (childKey === '.priority') { - newServerCache = serverFilter.updatePriority(oldServerSnap.getNode(), newChildNode); - } - else { - newServerCache = serverFilter.updateChild(oldServerSnap.getNode(), childKey, newChildNode, childChangePath, NO_COMPLETE_CHILD_SOURCE, null); - } - } - var newViewCache = viewCacheUpdateServerSnap(oldViewCache, newServerCache, oldServerSnap.isFullyInitialized() || pathIsEmpty(changePath), serverFilter.filtersNodes()); - var source = new WriteTreeCompleteChildSource(writesCache, newViewCache, completeCache); - return viewProcessorGenerateEventCacheAfterServerEvent(viewProcessor, newViewCache, changePath, writesCache, source, accumulator); -} -function viewProcessorApplyUserOverwrite(viewProcessor, oldViewCache, changePath, changedSnap, writesCache, completeCache, accumulator) { - var oldEventSnap = oldViewCache.eventCache; - var newViewCache, newEventCache; - var source = new WriteTreeCompleteChildSource(writesCache, oldViewCache, completeCache); - if (pathIsEmpty(changePath)) { - newEventCache = viewProcessor.filter.updateFullNode(oldViewCache.eventCache.getNode(), changedSnap, accumulator); - newViewCache = viewCacheUpdateEventSnap(oldViewCache, newEventCache, true, viewProcessor.filter.filtersNodes()); - } - else { - var childKey = pathGetFront(changePath); - if (childKey === '.priority') { - newEventCache = viewProcessor.filter.updatePriority(oldViewCache.eventCache.getNode(), changedSnap); - newViewCache = viewCacheUpdateEventSnap(oldViewCache, newEventCache, oldEventSnap.isFullyInitialized(), oldEventSnap.isFiltered()); - } - else { - var childChangePath = pathPopFront(changePath); - var oldChild = oldEventSnap.getNode().getImmediateChild(childKey); - var newChild = void 0; - if (pathIsEmpty(childChangePath)) { - // Child overwrite, we can replace the child - newChild = changedSnap; - } - else { - var childNode = source.getCompleteChild(childKey); - if (childNode != null) { - if (pathGetBack(childChangePath) === '.priority' && - childNode.getChild(pathParent(childChangePath)).isEmpty()) { - // This is a priority update on an empty node. If this node exists on the server, the - // server will send down the priority in the update, so ignore for now - newChild = childNode; - } - else { - newChild = childNode.updateChild(childChangePath, changedSnap); - } - } - else { - // There is no complete child node available - newChild = ChildrenNode.EMPTY_NODE; - } - } - if (!oldChild.equals(newChild)) { - var newEventSnap = viewProcessor.filter.updateChild(oldEventSnap.getNode(), childKey, newChild, childChangePath, source, accumulator); - newViewCache = viewCacheUpdateEventSnap(oldViewCache, newEventSnap, oldEventSnap.isFullyInitialized(), viewProcessor.filter.filtersNodes()); - } - else { - newViewCache = oldViewCache; - } - } - } - return newViewCache; -} -function viewProcessorCacheHasChild(viewCache, childKey) { - return viewCache.eventCache.isCompleteForChild(childKey); -} -function viewProcessorApplyUserMerge(viewProcessor, viewCache, path, changedChildren, writesCache, serverCache, accumulator) { - // HACK: In the case of a limit query, there may be some changes that bump things out of the - // window leaving room for new items. It's important we process these changes first, so we - // iterate the changes twice, first processing any that affect items currently in view. - // TODO: I consider an item "in view" if cacheHasChild is true, which checks both the server - // and event snap. I'm not sure if this will result in edge cases when a child is in one but - // not the other. - var curViewCache = viewCache; - changedChildren.foreach(function (relativePath, childNode) { - var writePath = pathChild(path, relativePath); - if (viewProcessorCacheHasChild(viewCache, pathGetFront(writePath))) { - curViewCache = viewProcessorApplyUserOverwrite(viewProcessor, curViewCache, writePath, childNode, writesCache, serverCache, accumulator); - } - }); - changedChildren.foreach(function (relativePath, childNode) { - var writePath = pathChild(path, relativePath); - if (!viewProcessorCacheHasChild(viewCache, pathGetFront(writePath))) { - curViewCache = viewProcessorApplyUserOverwrite(viewProcessor, curViewCache, writePath, childNode, writesCache, serverCache, accumulator); - } - }); - return curViewCache; -} -function viewProcessorApplyMerge(viewProcessor, node, merge) { - merge.foreach(function (relativePath, childNode) { - node = node.updateChild(relativePath, childNode); - }); - return node; -} -function viewProcessorApplyServerMerge(viewProcessor, viewCache, path, changedChildren, writesCache, serverCache, filterServerNode, accumulator) { - // If we don't have a cache yet, this merge was intended for a previously listen in the same location. Ignore it and - // wait for the complete data update coming soon. - if (viewCache.serverCache.getNode().isEmpty() && - !viewCache.serverCache.isFullyInitialized()) { - return viewCache; - } - // HACK: In the case of a limit query, there may be some changes that bump things out of the - // window leaving room for new items. It's important we process these changes first, so we - // iterate the changes twice, first processing any that affect items currently in view. - // TODO: I consider an item "in view" if cacheHasChild is true, which checks both the server - // and event snap. I'm not sure if this will result in edge cases when a child is in one but - // not the other. - var curViewCache = viewCache; - var viewMergeTree; - if (pathIsEmpty(path)) { - viewMergeTree = changedChildren; - } - else { - viewMergeTree = new ImmutableTree(null).setTree(path, changedChildren); - } - var serverNode = viewCache.serverCache.getNode(); - viewMergeTree.children.inorderTraversal(function (childKey, childTree) { - if (serverNode.hasChild(childKey)) { - var serverChild = viewCache.serverCache - .getNode() - .getImmediateChild(childKey); - var newChild = viewProcessorApplyMerge(viewProcessor, serverChild, childTree); - curViewCache = viewProcessorApplyServerOverwrite(viewProcessor, curViewCache, new Path(childKey), newChild, writesCache, serverCache, filterServerNode, accumulator); - } - }); - viewMergeTree.children.inorderTraversal(function (childKey, childMergeTree) { - var isUnknownDeepMerge = !viewCache.serverCache.isCompleteForChild(childKey) && - childMergeTree.value === null; - if (!serverNode.hasChild(childKey) && !isUnknownDeepMerge) { - var serverChild = viewCache.serverCache - .getNode() - .getImmediateChild(childKey); - var newChild = viewProcessorApplyMerge(viewProcessor, serverChild, childMergeTree); - curViewCache = viewProcessorApplyServerOverwrite(viewProcessor, curViewCache, new Path(childKey), newChild, writesCache, serverCache, filterServerNode, accumulator); - } - }); - return curViewCache; -} -function viewProcessorAckUserWrite(viewProcessor, viewCache, ackPath, affectedTree, writesCache, completeCache, accumulator) { - if (writeTreeRefShadowingWrite(writesCache, ackPath) != null) { - return viewCache; - } - // Only filter server node if it is currently filtered - var filterServerNode = viewCache.serverCache.isFiltered(); - // Essentially we'll just get our existing server cache for the affected paths and re-apply it as a server update - // now that it won't be shadowed. - var serverCache = viewCache.serverCache; - if (affectedTree.value != null) { - // This is an overwrite. - if ((pathIsEmpty(ackPath) && serverCache.isFullyInitialized()) || - serverCache.isCompleteForPath(ackPath)) { - return viewProcessorApplyServerOverwrite(viewProcessor, viewCache, ackPath, serverCache.getNode().getChild(ackPath), writesCache, completeCache, filterServerNode, accumulator); - } - else if (pathIsEmpty(ackPath)) { - // This is a goofy edge case where we are acking data at this location but don't have full data. We - // should just re-apply whatever we have in our cache as a merge. - var changedChildren_1 = new ImmutableTree(null); - serverCache.getNode().forEachChild(KEY_INDEX, function (name, node) { - changedChildren_1 = changedChildren_1.set(new Path(name), node); - }); - return viewProcessorApplyServerMerge(viewProcessor, viewCache, ackPath, changedChildren_1, writesCache, completeCache, filterServerNode, accumulator); - } - else { - return viewCache; - } - } - else { - // This is a merge. - var changedChildren_2 = new ImmutableTree(null); - affectedTree.foreach(function (mergePath, value) { - var serverCachePath = pathChild(ackPath, mergePath); - if (serverCache.isCompleteForPath(serverCachePath)) { - changedChildren_2 = changedChildren_2.set(mergePath, serverCache.getNode().getChild(serverCachePath)); - } - }); - return viewProcessorApplyServerMerge(viewProcessor, viewCache, ackPath, changedChildren_2, writesCache, completeCache, filterServerNode, accumulator); - } -} -function viewProcessorListenComplete(viewProcessor, viewCache, path, writesCache, accumulator) { - var oldServerNode = viewCache.serverCache; - var newViewCache = viewCacheUpdateServerSnap(viewCache, oldServerNode.getNode(), oldServerNode.isFullyInitialized() || pathIsEmpty(path), oldServerNode.isFiltered()); - return viewProcessorGenerateEventCacheAfterServerEvent(viewProcessor, newViewCache, path, writesCache, NO_COMPLETE_CHILD_SOURCE, accumulator); -} -function viewProcessorRevertUserWrite(viewProcessor, viewCache, path, writesCache, completeServerCache, accumulator) { - var complete; - if (writeTreeRefShadowingWrite(writesCache, path) != null) { - return viewCache; - } - else { - var source = new WriteTreeCompleteChildSource(writesCache, viewCache, completeServerCache); - var oldEventCache = viewCache.eventCache.getNode(); - var newEventCache = void 0; - if (pathIsEmpty(path) || pathGetFront(path) === '.priority') { - var newNode = void 0; - if (viewCache.serverCache.isFullyInitialized()) { - newNode = writeTreeRefCalcCompleteEventCache(writesCache, viewCacheGetCompleteServerSnap(viewCache)); - } - else { - var serverChildren = viewCache.serverCache.getNode(); - util.assert(serverChildren instanceof ChildrenNode, 'serverChildren would be complete if leaf node'); - newNode = writeTreeRefCalcCompleteEventChildren(writesCache, serverChildren); - } - newNode = newNode; - newEventCache = viewProcessor.filter.updateFullNode(oldEventCache, newNode, accumulator); - } - else { - var childKey = pathGetFront(path); - var newChild = writeTreeRefCalcCompleteChild(writesCache, childKey, viewCache.serverCache); - if (newChild == null && - viewCache.serverCache.isCompleteForChild(childKey)) { - newChild = oldEventCache.getImmediateChild(childKey); - } - if (newChild != null) { - newEventCache = viewProcessor.filter.updateChild(oldEventCache, childKey, newChild, pathPopFront(path), source, accumulator); - } - else if (viewCache.eventCache.getNode().hasChild(childKey)) { - // No complete child available, delete the existing one, if any - newEventCache = viewProcessor.filter.updateChild(oldEventCache, childKey, ChildrenNode.EMPTY_NODE, pathPopFront(path), source, accumulator); - } - else { - newEventCache = oldEventCache; - } - if (newEventCache.isEmpty() && - viewCache.serverCache.isFullyInitialized()) { - // We might have reverted all child writes. Maybe the old event was a leaf node - complete = writeTreeRefCalcCompleteEventCache(writesCache, viewCacheGetCompleteServerSnap(viewCache)); - if (complete.isLeafNode()) { - newEventCache = viewProcessor.filter.updateFullNode(newEventCache, complete, accumulator); - } - } - } - complete = - viewCache.serverCache.isFullyInitialized() || - writeTreeRefShadowingWrite(writesCache, newEmptyPath()) != null; - return viewCacheUpdateEventSnap(viewCache, newEventCache, complete, viewProcessor.filter.filtersNodes()); - } -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * A view represents a specific location and query that has 1 or more event registrations. - * - * It does several things: - * - Maintains the list of event registrations for this location/query. - * - Maintains a cache of the data visible for this location/query. - * - Applies new operations (via applyOperation), updates the cache, and based on the event - * registrations returns the set of events to be raised. - */ -var View = /** @class */ (function () { - function View(query_, initialViewCache) { - this.query_ = query_; - this.eventRegistrations_ = []; - var params = this.query_._queryParams; - var indexFilter = new IndexedFilter(params.getIndex()); - var filter = queryParamsGetNodeFilter(params); - this.processor_ = newViewProcessor(filter); - var initialServerCache = initialViewCache.serverCache; - var initialEventCache = initialViewCache.eventCache; - // Don't filter server node with other filter than index, wait for tagged listen - var serverSnap = indexFilter.updateFullNode(ChildrenNode.EMPTY_NODE, initialServerCache.getNode(), null); - var eventSnap = filter.updateFullNode(ChildrenNode.EMPTY_NODE, initialEventCache.getNode(), null); - var newServerCache = new CacheNode(serverSnap, initialServerCache.isFullyInitialized(), indexFilter.filtersNodes()); - var newEventCache = new CacheNode(eventSnap, initialEventCache.isFullyInitialized(), filter.filtersNodes()); - this.viewCache_ = newViewCache(newEventCache, newServerCache); - this.eventGenerator_ = new EventGenerator(this.query_); - } - Object.defineProperty(View.prototype, "query", { - get: function () { - return this.query_; - }, - enumerable: false, - configurable: true - }); - return View; -}()); -function viewGetServerCache(view) { - return view.viewCache_.serverCache.getNode(); -} -function viewGetCompleteNode(view) { - return viewCacheGetCompleteEventSnap(view.viewCache_); -} -function viewGetCompleteServerCache(view, path) { - var cache = viewCacheGetCompleteServerSnap(view.viewCache_); - if (cache) { - // If this isn't a "loadsAllData" view, then cache isn't actually a complete cache and - // we need to see if it contains the child we're interested in. - if (view.query._queryParams.loadsAllData() || - (!pathIsEmpty(path) && - !cache.getImmediateChild(pathGetFront(path)).isEmpty())) { - return cache.getChild(path); - } - } - return null; -} -function viewIsEmpty(view) { - return view.eventRegistrations_.length === 0; -} -function viewAddEventRegistration(view, eventRegistration) { - view.eventRegistrations_.push(eventRegistration); -} -/** - * @param eventRegistration - If null, remove all callbacks. - * @param cancelError - If a cancelError is provided, appropriate cancel events will be returned. - * @returns Cancel events, if cancelError was provided. - */ -function viewRemoveEventRegistration(view, eventRegistration, cancelError) { - var cancelEvents = []; - if (cancelError) { - util.assert(eventRegistration == null, 'A cancel should cancel all event registrations.'); - var path_1 = view.query._path; - view.eventRegistrations_.forEach(function (registration) { - var maybeEvent = registration.createCancelEvent(cancelError, path_1); - if (maybeEvent) { - cancelEvents.push(maybeEvent); - } - }); - } - if (eventRegistration) { - var remaining = []; - for (var i = 0; i < view.eventRegistrations_.length; ++i) { - var existing = view.eventRegistrations_[i]; - if (!existing.matches(eventRegistration)) { - remaining.push(existing); - } - else if (eventRegistration.hasAnyCallback()) { - // We're removing just this one - remaining = remaining.concat(view.eventRegistrations_.slice(i + 1)); - break; - } - } - view.eventRegistrations_ = remaining; - } - else { - view.eventRegistrations_ = []; - } - return cancelEvents; -} -/** - * Applies the given Operation, updates our cache, and returns the appropriate events. - */ -function viewApplyOperation(view, operation, writesCache, completeServerCache) { - if (operation.type === OperationType.MERGE && - operation.source.queryId !== null) { - util.assert(viewCacheGetCompleteServerSnap(view.viewCache_), 'We should always have a full cache before handling merges'); - util.assert(viewCacheGetCompleteEventSnap(view.viewCache_), 'Missing event cache, even though we have a server cache'); - } - var oldViewCache = view.viewCache_; - var result = viewProcessorApplyOperation(view.processor_, oldViewCache, operation, writesCache, completeServerCache); - viewProcessorAssertIndexed(view.processor_, result.viewCache); - util.assert(result.viewCache.serverCache.isFullyInitialized() || - !oldViewCache.serverCache.isFullyInitialized(), 'Once a server snap is complete, it should never go back'); - view.viewCache_ = result.viewCache; - return viewGenerateEventsForChanges_(view, result.changes, result.viewCache.eventCache.getNode(), null); -} -function viewGetInitialEvents(view, registration) { - var eventSnap = view.viewCache_.eventCache; - var initialChanges = []; - if (!eventSnap.getNode().isLeafNode()) { - var eventNode = eventSnap.getNode(); - eventNode.forEachChild(PRIORITY_INDEX, function (key, childNode) { - initialChanges.push(changeChildAdded(key, childNode)); - }); - } - if (eventSnap.isFullyInitialized()) { - initialChanges.push(changeValue(eventSnap.getNode())); - } - return viewGenerateEventsForChanges_(view, initialChanges, eventSnap.getNode(), registration); -} -function viewGenerateEventsForChanges_(view, changes, eventCache, eventRegistration) { - var registrations = eventRegistration - ? [eventRegistration] - : view.eventRegistrations_; - return eventGeneratorGenerateEventsForChanges(view.eventGenerator_, changes, eventCache, registrations); -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var referenceConstructor$1; -/** - * SyncPoint represents a single location in a SyncTree with 1 or more event registrations, meaning we need to - * maintain 1 or more Views at this location to cache server data and raise appropriate events for server changes - * and user writes (set, transaction, update). - * - * It's responsible for: - * - Maintaining the set of 1 or more views necessary at this location (a SyncPoint with 0 views should be removed). - * - Proxying user / server operations to the views as appropriate (i.e. applyServerOverwrite, - * applyUserOverwrite, etc.) - */ -var SyncPoint = /** @class */ (function () { - function SyncPoint() { - /** - * The Views being tracked at this location in the tree, stored as a map where the key is a - * queryId and the value is the View for that query. - * - * NOTE: This list will be quite small (usually 1, but perhaps 2 or 3; any more is an odd use case). - */ - this.views = new Map(); - } - return SyncPoint; -}()); -function syncPointSetReferenceConstructor(val) { - util.assert(!referenceConstructor$1, '__referenceConstructor has already been defined'); - referenceConstructor$1 = val; -} -function syncPointGetReferenceConstructor() { - util.assert(referenceConstructor$1, 'Reference.ts has not been loaded'); - return referenceConstructor$1; -} -function syncPointIsEmpty(syncPoint) { - return syncPoint.views.size === 0; -} -function syncPointApplyOperation(syncPoint, operation, writesCache, optCompleteServerCache) { - var e_1, _a; - var queryId = operation.source.queryId; - if (queryId !== null) { - var view = syncPoint.views.get(queryId); - util.assert(view != null, 'SyncTree gave us an op for an invalid query.'); - return viewApplyOperation(view, operation, writesCache, optCompleteServerCache); - } - else { - var events = []; - try { - for (var _b = tslib.__values(syncPoint.views.values()), _c = _b.next(); !_c.done; _c = _b.next()) { - var view = _c.value; - events = events.concat(viewApplyOperation(view, operation, writesCache, optCompleteServerCache)); - } - } - catch (e_1_1) { e_1 = { error: e_1_1 }; } - finally { - try { - if (_c && !_c.done && (_a = _b.return)) _a.call(_b); - } - finally { if (e_1) throw e_1.error; } - } - return events; - } -} -/** - * Get a view for the specified query. - * - * @param query - The query to return a view for - * @param writesCache - * @param serverCache - * @param serverCacheComplete - * @returns Events to raise. - */ -function syncPointGetView(syncPoint, query, writesCache, serverCache, serverCacheComplete) { - var queryId = query._queryIdentifier; - var view = syncPoint.views.get(queryId); - if (!view) { - // TODO: make writesCache take flag for complete server node - var eventCache = writeTreeRefCalcCompleteEventCache(writesCache, serverCacheComplete ? serverCache : null); - var eventCacheComplete = false; - if (eventCache) { - eventCacheComplete = true; - } - else if (serverCache instanceof ChildrenNode) { - eventCache = writeTreeRefCalcCompleteEventChildren(writesCache, serverCache); - eventCacheComplete = false; - } - else { - eventCache = ChildrenNode.EMPTY_NODE; - eventCacheComplete = false; - } - var viewCache = newViewCache(new CacheNode(eventCache, eventCacheComplete, false), new CacheNode(serverCache, serverCacheComplete, false)); - return new View(query, viewCache); - } - return view; -} -/** - * Add an event callback for the specified query. - * - * @param query - * @param eventRegistration - * @param writesCache - * @param serverCache - Complete server cache, if we have it. - * @param serverCacheComplete - * @returns Events to raise. - */ -function syncPointAddEventRegistration(syncPoint, query, eventRegistration, writesCache, serverCache, serverCacheComplete) { - var view = syncPointGetView(syncPoint, query, writesCache, serverCache, serverCacheComplete); - if (!syncPoint.views.has(query._queryIdentifier)) { - syncPoint.views.set(query._queryIdentifier, view); - } - // This is guaranteed to exist now, we just created anything that was missing - viewAddEventRegistration(view, eventRegistration); - return viewGetInitialEvents(view, eventRegistration); -} -/** - * Remove event callback(s). Return cancelEvents if a cancelError is specified. - * - * If query is the default query, we'll check all views for the specified eventRegistration. - * If eventRegistration is null, we'll remove all callbacks for the specified view(s). - * - * @param eventRegistration - If null, remove all callbacks. - * @param cancelError - If a cancelError is provided, appropriate cancel events will be returned. - * @returns removed queries and any cancel events - */ -function syncPointRemoveEventRegistration(syncPoint, query, eventRegistration, cancelError) { - var e_2, _a; - var queryId = query._queryIdentifier; - var removed = []; - var cancelEvents = []; - var hadCompleteView = syncPointHasCompleteView(syncPoint); - if (queryId === 'default') { - try { - // When you do ref.off(...), we search all views for the registration to remove. - for (var _b = tslib.__values(syncPoint.views.entries()), _c = _b.next(); !_c.done; _c = _b.next()) { - var _d = tslib.__read(_c.value, 2), viewQueryId = _d[0], view = _d[1]; - cancelEvents = cancelEvents.concat(viewRemoveEventRegistration(view, eventRegistration, cancelError)); - if (viewIsEmpty(view)) { - syncPoint.views.delete(viewQueryId); - // We'll deal with complete views later. - if (!view.query._queryParams.loadsAllData()) { - removed.push(view.query); - } - } - } - } - catch (e_2_1) { e_2 = { error: e_2_1 }; } - finally { - try { - if (_c && !_c.done && (_a = _b.return)) _a.call(_b); - } - finally { if (e_2) throw e_2.error; } - } - } - else { - // remove the callback from the specific view. - var view = syncPoint.views.get(queryId); - if (view) { - cancelEvents = cancelEvents.concat(viewRemoveEventRegistration(view, eventRegistration, cancelError)); - if (viewIsEmpty(view)) { - syncPoint.views.delete(queryId); - // We'll deal with complete views later. - if (!view.query._queryParams.loadsAllData()) { - removed.push(view.query); - } - } - } - } - if (hadCompleteView && !syncPointHasCompleteView(syncPoint)) { - // We removed our last complete view. - removed.push(new (syncPointGetReferenceConstructor())(query._repo, query._path)); - } - return { removed: removed, events: cancelEvents }; -} -function syncPointGetQueryViews(syncPoint) { - var e_3, _a; - var result = []; - try { - for (var _b = tslib.__values(syncPoint.views.values()), _c = _b.next(); !_c.done; _c = _b.next()) { - var view = _c.value; - if (!view.query._queryParams.loadsAllData()) { - result.push(view); - } - } - } - catch (e_3_1) { e_3 = { error: e_3_1 }; } - finally { - try { - if (_c && !_c.done && (_a = _b.return)) _a.call(_b); - } - finally { if (e_3) throw e_3.error; } - } - return result; -} -/** - * @param path - The path to the desired complete snapshot - * @returns A complete cache, if it exists - */ -function syncPointGetCompleteServerCache(syncPoint, path) { - var e_4, _a; - var serverCache = null; - try { - for (var _b = tslib.__values(syncPoint.views.values()), _c = _b.next(); !_c.done; _c = _b.next()) { - var view = _c.value; - serverCache = serverCache || viewGetCompleteServerCache(view, path); - } - } - catch (e_4_1) { e_4 = { error: e_4_1 }; } - finally { - try { - if (_c && !_c.done && (_a = _b.return)) _a.call(_b); - } - finally { if (e_4) throw e_4.error; } - } - return serverCache; -} -function syncPointViewForQuery(syncPoint, query) { - var params = query._queryParams; - if (params.loadsAllData()) { - return syncPointGetCompleteView(syncPoint); - } - else { - var queryId = query._queryIdentifier; - return syncPoint.views.get(queryId); - } -} -function syncPointViewExistsForQuery(syncPoint, query) { - return syncPointViewForQuery(syncPoint, query) != null; -} -function syncPointHasCompleteView(syncPoint) { - return syncPointGetCompleteView(syncPoint) != null; -} -function syncPointGetCompleteView(syncPoint) { - var e_5, _a; - try { - for (var _b = tslib.__values(syncPoint.views.values()), _c = _b.next(); !_c.done; _c = _b.next()) { - var view = _c.value; - if (view.query._queryParams.loadsAllData()) { - return view; - } - } - } - catch (e_5_1) { e_5 = { error: e_5_1 }; } - finally { - try { - if (_c && !_c.done && (_a = _b.return)) _a.call(_b); - } - finally { if (e_5) throw e_5.error; } - } - return null; -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var referenceConstructor; -function syncTreeSetReferenceConstructor(val) { - util.assert(!referenceConstructor, '__referenceConstructor has already been defined'); - referenceConstructor = val; -} -function syncTreeGetReferenceConstructor() { - util.assert(referenceConstructor, 'Reference.ts has not been loaded'); - return referenceConstructor; -} -/** - * Static tracker for next query tag. - */ -var syncTreeNextQueryTag_ = 1; -/** - * SyncTree is the central class for managing event callback registration, data caching, views - * (query processing), and event generation. There are typically two SyncTree instances for - * each Repo, one for the normal Firebase data, and one for the .info data. - * - * It has a number of responsibilities, including: - * - Tracking all user event callbacks (registered via addEventRegistration() and removeEventRegistration()). - * - Applying and caching data changes for user set(), transaction(), and update() calls - * (applyUserOverwrite(), applyUserMerge()). - * - Applying and caching data changes for server data changes (applyServerOverwrite(), - * applyServerMerge()). - * - Generating user-facing events for server and user changes (all of the apply* methods - * return the set of events that need to be raised as a result). - * - Maintaining the appropriate set of server listens to ensure we are always subscribed - * to the correct set of paths and queries to satisfy the current set of user event - * callbacks (listens are started/stopped using the provided listenProvider). - * - * NOTE: Although SyncTree tracks event callbacks and calculates events to raise, the actual - * events are returned to the caller rather than raised synchronously. - * - */ -var SyncTree = /** @class */ (function () { - /** - * @param listenProvider_ - Used by SyncTree to start / stop listening - * to server data. - */ - function SyncTree(listenProvider_) { - this.listenProvider_ = listenProvider_; - /** - * Tree of SyncPoints. There's a SyncPoint at any location that has 1 or more views. - */ - this.syncPointTree_ = new ImmutableTree(null); - /** - * A tree of all pending user writes (user-initiated set()'s, transaction()'s, update()'s, etc.). - */ - this.pendingWriteTree_ = newWriteTree(); - this.tagToQueryMap = new Map(); - this.queryToTagMap = new Map(); - } - return SyncTree; -}()); -/** - * Apply the data changes for a user-generated set() or transaction() call. - * - * @returns Events to raise. - */ -function syncTreeApplyUserOverwrite(syncTree, path, newData, writeId, visible) { - // Record pending write. - writeTreeAddOverwrite(syncTree.pendingWriteTree_, path, newData, writeId, visible); - if (!visible) { - return []; - } - else { - return syncTreeApplyOperationToSyncPoints_(syncTree, new Overwrite(newOperationSourceUser(), path, newData)); - } -} -/** - * Apply the data from a user-generated update() call - * - * @returns Events to raise. - */ -function syncTreeApplyUserMerge(syncTree, path, changedChildren, writeId) { - // Record pending merge. - writeTreeAddMerge(syncTree.pendingWriteTree_, path, changedChildren, writeId); - var changeTree = ImmutableTree.fromObject(changedChildren); - return syncTreeApplyOperationToSyncPoints_(syncTree, new Merge(newOperationSourceUser(), path, changeTree)); -} -/** - * Acknowledge a pending user write that was previously registered with applyUserOverwrite() or applyUserMerge(). - * - * @param revert - True if the given write failed and needs to be reverted - * @returns Events to raise. - */ -function syncTreeAckUserWrite(syncTree, writeId, revert) { - if (revert === void 0) { revert = false; } - var write = writeTreeGetWrite(syncTree.pendingWriteTree_, writeId); - var needToReevaluate = writeTreeRemoveWrite(syncTree.pendingWriteTree_, writeId); - if (!needToReevaluate) { - return []; - } - else { - var affectedTree_1 = new ImmutableTree(null); - if (write.snap != null) { - // overwrite - affectedTree_1 = affectedTree_1.set(newEmptyPath(), true); - } - else { - each(write.children, function (pathString) { - affectedTree_1 = affectedTree_1.set(new Path(pathString), true); - }); - } - return syncTreeApplyOperationToSyncPoints_(syncTree, new AckUserWrite(write.path, affectedTree_1, revert)); - } -} -/** - * Apply new server data for the specified path.. - * - * @returns Events to raise. - */ -function syncTreeApplyServerOverwrite(syncTree, path, newData) { - return syncTreeApplyOperationToSyncPoints_(syncTree, new Overwrite(newOperationSourceServer(), path, newData)); -} -/** - * Apply new server data to be merged in at the specified path. - * - * @returns Events to raise. - */ -function syncTreeApplyServerMerge(syncTree, path, changedChildren) { - var changeTree = ImmutableTree.fromObject(changedChildren); - return syncTreeApplyOperationToSyncPoints_(syncTree, new Merge(newOperationSourceServer(), path, changeTree)); -} -/** - * Apply a listen complete for a query - * - * @returns Events to raise. - */ -function syncTreeApplyListenComplete(syncTree, path) { - return syncTreeApplyOperationToSyncPoints_(syncTree, new ListenComplete(newOperationSourceServer(), path)); -} -/** - * Apply a listen complete for a tagged query - * - * @returns Events to raise. - */ -function syncTreeApplyTaggedListenComplete(syncTree, path, tag) { - var queryKey = syncTreeQueryKeyForTag_(syncTree, tag); - if (queryKey) { - var r = syncTreeParseQueryKey_(queryKey); - var queryPath = r.path, queryId = r.queryId; - var relativePath = newRelativePath(queryPath, path); - var op = new ListenComplete(newOperationSourceServerTaggedQuery(queryId), relativePath); - return syncTreeApplyTaggedOperation_(syncTree, queryPath, op); - } - else { - // We've already removed the query. No big deal, ignore the update - return []; - } -} -/** - * Remove event callback(s). - * - * If query is the default query, we'll check all queries for the specified eventRegistration. - * If eventRegistration is null, we'll remove all callbacks for the specified query/queries. - * - * @param eventRegistration - If null, all callbacks are removed. - * @param cancelError - If a cancelError is provided, appropriate cancel events will be returned. - * @param skipListenerDedup - When performing a `get()`, we don't add any new listeners, so no - * deduping needs to take place. This flag allows toggling of that behavior - * @returns Cancel events, if cancelError was provided. - */ -function syncTreeRemoveEventRegistration(syncTree, query, eventRegistration, cancelError, skipListenerDedup) { - if (skipListenerDedup === void 0) { skipListenerDedup = false; } - // Find the syncPoint first. Then deal with whether or not it has matching listeners - var path = query._path; - var maybeSyncPoint = syncTree.syncPointTree_.get(path); - var cancelEvents = []; - // A removal on a default query affects all queries at that location. A removal on an indexed query, even one without - // other query constraints, does *not* affect all queries at that location. So this check must be for 'default', and - // not loadsAllData(). - if (maybeSyncPoint && - (query._queryIdentifier === 'default' || - syncPointViewExistsForQuery(maybeSyncPoint, query))) { - var removedAndEvents = syncPointRemoveEventRegistration(maybeSyncPoint, query, eventRegistration, cancelError); - if (syncPointIsEmpty(maybeSyncPoint)) { - syncTree.syncPointTree_ = syncTree.syncPointTree_.remove(path); - } - var removed = removedAndEvents.removed; - cancelEvents = removedAndEvents.events; - if (!skipListenerDedup) { - /** - * We may have just removed one of many listeners and can short-circuit this whole process - * We may also not have removed a default listener, in which case all of the descendant listeners should already be - * properly set up. - */ - // Since indexed queries can shadow if they don't have other query constraints, check for loadsAllData(), instead of - // queryId === 'default' - var removingDefault = -1 !== - removed.findIndex(function (query) { - return query._queryParams.loadsAllData(); - }); - var covered = syncTree.syncPointTree_.findOnPath(path, function (relativePath, parentSyncPoint) { - return syncPointHasCompleteView(parentSyncPoint); - }); - if (removingDefault && !covered) { - var subtree = syncTree.syncPointTree_.subtree(path); - // There are potentially child listeners. Determine what if any listens we need to send before executing the - // removal - if (!subtree.isEmpty()) { - // We need to fold over our subtree and collect the listeners to send - var newViews = syncTreeCollectDistinctViewsForSubTree_(subtree); - // Ok, we've collected all the listens we need. Set them up. - for (var i = 0; i < newViews.length; ++i) { - var view = newViews[i], newQuery = view.query; - var listener = syncTreeCreateListenerForView_(syncTree, view); - syncTree.listenProvider_.startListening(syncTreeQueryForListening_(newQuery), syncTreeTagForQuery(syncTree, newQuery), listener.hashFn, listener.onComplete); - } - } - // Otherwise there's nothing below us, so nothing we need to start listening on - } - // If we removed anything and we're not covered by a higher up listen, we need to stop listening on this query - // The above block has us covered in terms of making sure we're set up on listens lower in the tree. - // Also, note that if we have a cancelError, it's already been removed at the provider level. - if (!covered && removed.length > 0 && !cancelError) { - // If we removed a default, then we weren't listening on any of the other queries here. Just cancel the one - // default. Otherwise, we need to iterate through and cancel each individual query - if (removingDefault) { - // We don't tag default listeners - var defaultTag = null; - syncTree.listenProvider_.stopListening(syncTreeQueryForListening_(query), defaultTag); - } - else { - removed.forEach(function (queryToRemove) { - var tagToRemove = syncTree.queryToTagMap.get(syncTreeMakeQueryKey_(queryToRemove)); - syncTree.listenProvider_.stopListening(syncTreeQueryForListening_(queryToRemove), tagToRemove); - }); - } - } - } - // Now, clear all of the tags we're tracking for the removed listens - syncTreeRemoveTags_(syncTree, removed); - } - return cancelEvents; -} -/** - * Apply new server data for the specified tagged query. - * - * @returns Events to raise. - */ -function syncTreeApplyTaggedQueryOverwrite(syncTree, path, snap, tag) { - var queryKey = syncTreeQueryKeyForTag_(syncTree, tag); - if (queryKey != null) { - var r = syncTreeParseQueryKey_(queryKey); - var queryPath = r.path, queryId = r.queryId; - var relativePath = newRelativePath(queryPath, path); - var op = new Overwrite(newOperationSourceServerTaggedQuery(queryId), relativePath, snap); - return syncTreeApplyTaggedOperation_(syncTree, queryPath, op); - } - else { - // Query must have been removed already - return []; - } -} -/** - * Apply server data to be merged in for the specified tagged query. - * - * @returns Events to raise. - */ -function syncTreeApplyTaggedQueryMerge(syncTree, path, changedChildren, tag) { - var queryKey = syncTreeQueryKeyForTag_(syncTree, tag); - if (queryKey) { - var r = syncTreeParseQueryKey_(queryKey); - var queryPath = r.path, queryId = r.queryId; - var relativePath = newRelativePath(queryPath, path); - var changeTree = ImmutableTree.fromObject(changedChildren); - var op = new Merge(newOperationSourceServerTaggedQuery(queryId), relativePath, changeTree); - return syncTreeApplyTaggedOperation_(syncTree, queryPath, op); - } - else { - // We've already removed the query. No big deal, ignore the update - return []; - } -} -/** - * Add an event callback for the specified query. - * - * @returns Events to raise. - */ -function syncTreeAddEventRegistration(syncTree, query, eventRegistration, skipSetupListener) { - if (skipSetupListener === void 0) { skipSetupListener = false; } - var path = query._path; - var serverCache = null; - var foundAncestorDefaultView = false; - // Any covering writes will necessarily be at the root, so really all we need to find is the server cache. - // Consider optimizing this once there's a better understanding of what actual behavior will be. - syncTree.syncPointTree_.foreachOnPath(path, function (pathToSyncPoint, sp) { - var relativePath = newRelativePath(pathToSyncPoint, path); - serverCache = - serverCache || syncPointGetCompleteServerCache(sp, relativePath); - foundAncestorDefaultView = - foundAncestorDefaultView || syncPointHasCompleteView(sp); - }); - var syncPoint = syncTree.syncPointTree_.get(path); - if (!syncPoint) { - syncPoint = new SyncPoint(); - syncTree.syncPointTree_ = syncTree.syncPointTree_.set(path, syncPoint); - } - else { - foundAncestorDefaultView = - foundAncestorDefaultView || syncPointHasCompleteView(syncPoint); - serverCache = - serverCache || syncPointGetCompleteServerCache(syncPoint, newEmptyPath()); - } - var serverCacheComplete; - if (serverCache != null) { - serverCacheComplete = true; - } - else { - serverCacheComplete = false; - serverCache = ChildrenNode.EMPTY_NODE; - var subtree = syncTree.syncPointTree_.subtree(path); - subtree.foreachChild(function (childName, childSyncPoint) { - var completeCache = syncPointGetCompleteServerCache(childSyncPoint, newEmptyPath()); - if (completeCache) { - serverCache = serverCache.updateImmediateChild(childName, completeCache); - } - }); - } - var viewAlreadyExists = syncPointViewExistsForQuery(syncPoint, query); - if (!viewAlreadyExists && !query._queryParams.loadsAllData()) { - // We need to track a tag for this query - var queryKey = syncTreeMakeQueryKey_(query); - util.assert(!syncTree.queryToTagMap.has(queryKey), 'View does not exist, but we have a tag'); - var tag = syncTreeGetNextQueryTag_(); - syncTree.queryToTagMap.set(queryKey, tag); - syncTree.tagToQueryMap.set(tag, queryKey); - } - var writesCache = writeTreeChildWrites(syncTree.pendingWriteTree_, path); - var events = syncPointAddEventRegistration(syncPoint, query, eventRegistration, writesCache, serverCache, serverCacheComplete); - if (!viewAlreadyExists && !foundAncestorDefaultView && !skipSetupListener) { - var view = syncPointViewForQuery(syncPoint, query); - events = events.concat(syncTreeSetupListener_(syncTree, query, view)); - } - return events; -} -/** - * Returns a complete cache, if we have one, of the data at a particular path. If the location does not have a - * listener above it, we will get a false "null". This shouldn't be a problem because transactions will always - * have a listener above, and atomic operations would correctly show a jitter of -> - * as the write is applied locally and then acknowledged at the server. - * - * Note: this method will *include* hidden writes from transaction with applyLocally set to false. - * - * @param path - The path to the data we want - * @param writeIdsToExclude - A specific set to be excluded - */ -function syncTreeCalcCompleteEventCache(syncTree, path, writeIdsToExclude) { - var includeHiddenSets = true; - var writeTree = syncTree.pendingWriteTree_; - var serverCache = syncTree.syncPointTree_.findOnPath(path, function (pathSoFar, syncPoint) { - var relativePath = newRelativePath(pathSoFar, path); - var serverCache = syncPointGetCompleteServerCache(syncPoint, relativePath); - if (serverCache) { - return serverCache; - } - }); - return writeTreeCalcCompleteEventCache(writeTree, path, serverCache, writeIdsToExclude, includeHiddenSets); -} -function syncTreeGetServerValue(syncTree, query) { - var path = query._path; - var serverCache = null; - // Any covering writes will necessarily be at the root, so really all we need to find is the server cache. - // Consider optimizing this once there's a better understanding of what actual behavior will be. - syncTree.syncPointTree_.foreachOnPath(path, function (pathToSyncPoint, sp) { - var relativePath = newRelativePath(pathToSyncPoint, path); - serverCache = - serverCache || syncPointGetCompleteServerCache(sp, relativePath); - }); - var syncPoint = syncTree.syncPointTree_.get(path); - if (!syncPoint) { - syncPoint = new SyncPoint(); - syncTree.syncPointTree_ = syncTree.syncPointTree_.set(path, syncPoint); - } - else { - serverCache = - serverCache || syncPointGetCompleteServerCache(syncPoint, newEmptyPath()); - } - var serverCacheComplete = serverCache != null; - var serverCacheNode = serverCacheComplete - ? new CacheNode(serverCache, true, false) - : null; - var writesCache = writeTreeChildWrites(syncTree.pendingWriteTree_, query._path); - var view = syncPointGetView(syncPoint, query, writesCache, serverCacheComplete ? serverCacheNode.getNode() : ChildrenNode.EMPTY_NODE, serverCacheComplete); - return viewGetCompleteNode(view); -} -/** - * A helper method that visits all descendant and ancestor SyncPoints, applying the operation. - * - * NOTES: - * - Descendant SyncPoints will be visited first (since we raise events depth-first). - * - * - We call applyOperation() on each SyncPoint passing three things: - * 1. A version of the Operation that has been made relative to the SyncPoint location. - * 2. A WriteTreeRef of any writes we have cached at the SyncPoint location. - * 3. A snapshot Node with cached server data, if we have it. - * - * - We concatenate all of the events returned by each SyncPoint and return the result. - */ -function syncTreeApplyOperationToSyncPoints_(syncTree, operation) { - return syncTreeApplyOperationHelper_(operation, syncTree.syncPointTree_, - /*serverCache=*/ null, writeTreeChildWrites(syncTree.pendingWriteTree_, newEmptyPath())); -} -/** - * Recursive helper for applyOperationToSyncPoints_ - */ -function syncTreeApplyOperationHelper_(operation, syncPointTree, serverCache, writesCache) { - if (pathIsEmpty(operation.path)) { - return syncTreeApplyOperationDescendantsHelper_(operation, syncPointTree, serverCache, writesCache); - } - else { - var syncPoint = syncPointTree.get(newEmptyPath()); - // If we don't have cached server data, see if we can get it from this SyncPoint. - if (serverCache == null && syncPoint != null) { - serverCache = syncPointGetCompleteServerCache(syncPoint, newEmptyPath()); - } - var events = []; - var childName = pathGetFront(operation.path); - var childOperation = operation.operationForChild(childName); - var childTree = syncPointTree.children.get(childName); - if (childTree && childOperation) { - var childServerCache = serverCache - ? serverCache.getImmediateChild(childName) - : null; - var childWritesCache = writeTreeRefChild(writesCache, childName); - events = events.concat(syncTreeApplyOperationHelper_(childOperation, childTree, childServerCache, childWritesCache)); - } - if (syncPoint) { - events = events.concat(syncPointApplyOperation(syncPoint, operation, writesCache, serverCache)); - } - return events; - } -} -/** - * Recursive helper for applyOperationToSyncPoints_ - */ -function syncTreeApplyOperationDescendantsHelper_(operation, syncPointTree, serverCache, writesCache) { - var syncPoint = syncPointTree.get(newEmptyPath()); - // If we don't have cached server data, see if we can get it from this SyncPoint. - if (serverCache == null && syncPoint != null) { - serverCache = syncPointGetCompleteServerCache(syncPoint, newEmptyPath()); - } - var events = []; - syncPointTree.children.inorderTraversal(function (childName, childTree) { - var childServerCache = serverCache - ? serverCache.getImmediateChild(childName) - : null; - var childWritesCache = writeTreeRefChild(writesCache, childName); - var childOperation = operation.operationForChild(childName); - if (childOperation) { - events = events.concat(syncTreeApplyOperationDescendantsHelper_(childOperation, childTree, childServerCache, childWritesCache)); - } - }); - if (syncPoint) { - events = events.concat(syncPointApplyOperation(syncPoint, operation, writesCache, serverCache)); - } - return events; -} -function syncTreeCreateListenerForView_(syncTree, view) { - var query = view.query; - var tag = syncTreeTagForQuery(syncTree, query); - return { - hashFn: function () { - var cache = viewGetServerCache(view) || ChildrenNode.EMPTY_NODE; - return cache.hash(); - }, - onComplete: function (status) { - if (status === 'ok') { - if (tag) { - return syncTreeApplyTaggedListenComplete(syncTree, query._path, tag); - } - else { - return syncTreeApplyListenComplete(syncTree, query._path); - } - } - else { - // If a listen failed, kill all of the listeners here, not just the one that triggered the error. - // Note that this may need to be scoped to just this listener if we change permissions on filtered children - var error = errorForServerCode(status, query); - return syncTreeRemoveEventRegistration(syncTree, query, - /*eventRegistration*/ null, error); - } - } - }; -} -/** - * Return the tag associated with the given query. - */ -function syncTreeTagForQuery(syncTree, query) { - var queryKey = syncTreeMakeQueryKey_(query); - return syncTree.queryToTagMap.get(queryKey); -} -/** - * Given a query, computes a "queryKey" suitable for use in our queryToTagMap_. - */ -function syncTreeMakeQueryKey_(query) { - return query._path.toString() + '$' + query._queryIdentifier; -} -/** - * Return the query associated with the given tag, if we have one - */ -function syncTreeQueryKeyForTag_(syncTree, tag) { - return syncTree.tagToQueryMap.get(tag); -} -/** - * Given a queryKey (created by makeQueryKey), parse it back into a path and queryId. - */ -function syncTreeParseQueryKey_(queryKey) { - var splitIndex = queryKey.indexOf('$'); - util.assert(splitIndex !== -1 && splitIndex < queryKey.length - 1, 'Bad queryKey.'); - return { - queryId: queryKey.substr(splitIndex + 1), - path: new Path(queryKey.substr(0, splitIndex)) - }; -} -/** - * A helper method to apply tagged operations - */ -function syncTreeApplyTaggedOperation_(syncTree, queryPath, operation) { - var syncPoint = syncTree.syncPointTree_.get(queryPath); - util.assert(syncPoint, "Missing sync point for query tag that we're tracking"); - var writesCache = writeTreeChildWrites(syncTree.pendingWriteTree_, queryPath); - return syncPointApplyOperation(syncPoint, operation, writesCache, null); -} -/** - * This collapses multiple unfiltered views into a single view, since we only need a single - * listener for them. - */ -function syncTreeCollectDistinctViewsForSubTree_(subtree) { - return subtree.fold(function (relativePath, maybeChildSyncPoint, childMap) { - if (maybeChildSyncPoint && syncPointHasCompleteView(maybeChildSyncPoint)) { - var completeView = syncPointGetCompleteView(maybeChildSyncPoint); - return [completeView]; - } - else { - // No complete view here, flatten any deeper listens into an array - var views_1 = []; - if (maybeChildSyncPoint) { - views_1 = syncPointGetQueryViews(maybeChildSyncPoint); - } - each(childMap, function (_key, childViews) { - views_1 = views_1.concat(childViews); - }); - return views_1; - } - }); -} -/** - * Normalizes a query to a query we send the server for listening - * - * @returns The normalized query - */ -function syncTreeQueryForListening_(query) { - if (query._queryParams.loadsAllData() && !query._queryParams.isDefault()) { - // We treat queries that load all data as default queries - // Cast is necessary because ref() technically returns Firebase which is actually fb.api.Firebase which inherits - // from Query - return new (syncTreeGetReferenceConstructor())(query._repo, query._path); - } - else { - return query; - } -} -function syncTreeRemoveTags_(syncTree, queries) { - for (var j = 0; j < queries.length; ++j) { - var removedQuery = queries[j]; - if (!removedQuery._queryParams.loadsAllData()) { - // We should have a tag for this - var removedQueryKey = syncTreeMakeQueryKey_(removedQuery); - var removedQueryTag = syncTree.queryToTagMap.get(removedQueryKey); - syncTree.queryToTagMap.delete(removedQueryKey); - syncTree.tagToQueryMap.delete(removedQueryTag); - } - } -} -/** - * Static accessor for query tags. - */ -function syncTreeGetNextQueryTag_() { - return syncTreeNextQueryTag_++; -} -/** - * For a given new listen, manage the de-duplication of outstanding subscriptions. - * - * @returns This method can return events to support synchronous data sources - */ -function syncTreeSetupListener_(syncTree, query, view) { - var path = query._path; - var tag = syncTreeTagForQuery(syncTree, query); - var listener = syncTreeCreateListenerForView_(syncTree, view); - var events = syncTree.listenProvider_.startListening(syncTreeQueryForListening_(query), tag, listener.hashFn, listener.onComplete); - var subtree = syncTree.syncPointTree_.subtree(path); - // The root of this subtree has our query. We're here because we definitely need to send a listen for that, but we - // may need to shadow other listens as well. - if (tag) { - util.assert(!syncPointHasCompleteView(subtree.value), "If we're adding a query, it shouldn't be shadowed"); - } - else { - // Shadow everything at or below this location, this is a default listener. - var queriesToStop = subtree.fold(function (relativePath, maybeChildSyncPoint, childMap) { - if (!pathIsEmpty(relativePath) && - maybeChildSyncPoint && - syncPointHasCompleteView(maybeChildSyncPoint)) { - return [syncPointGetCompleteView(maybeChildSyncPoint).query]; - } - else { - // No default listener here, flatten any deeper queries into an array - var queries_1 = []; - if (maybeChildSyncPoint) { - queries_1 = queries_1.concat(syncPointGetQueryViews(maybeChildSyncPoint).map(function (view) { return view.query; })); - } - each(childMap, function (_key, childQueries) { - queries_1 = queries_1.concat(childQueries); - }); - return queries_1; - } - }); - for (var i = 0; i < queriesToStop.length; ++i) { - var queryToStop = queriesToStop[i]; - syncTree.listenProvider_.stopListening(syncTreeQueryForListening_(queryToStop), syncTreeTagForQuery(syncTree, queryToStop)); - } - } - return events; -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var ExistingValueProvider = /** @class */ (function () { - function ExistingValueProvider(node_) { - this.node_ = node_; - } - ExistingValueProvider.prototype.getImmediateChild = function (childName) { - var child = this.node_.getImmediateChild(childName); - return new ExistingValueProvider(child); - }; - ExistingValueProvider.prototype.node = function () { - return this.node_; - }; - return ExistingValueProvider; -}()); -var DeferredValueProvider = /** @class */ (function () { - function DeferredValueProvider(syncTree, path) { - this.syncTree_ = syncTree; - this.path_ = path; - } - DeferredValueProvider.prototype.getImmediateChild = function (childName) { - var childPath = pathChild(this.path_, childName); - return new DeferredValueProvider(this.syncTree_, childPath); - }; - DeferredValueProvider.prototype.node = function () { - return syncTreeCalcCompleteEventCache(this.syncTree_, this.path_); - }; - return DeferredValueProvider; -}()); -/** - * Generate placeholders for deferred values. - */ -var generateWithValues = function (values) { - values = values || {}; - values['timestamp'] = values['timestamp'] || new Date().getTime(); - return values; -}; -/** - * Value to use when firing local events. When writing server values, fire - * local events with an approximate value, otherwise return value as-is. - */ -var resolveDeferredLeafValue = function (value, existingVal, serverValues) { - if (!value || typeof value !== 'object') { - return value; - } - util.assert('.sv' in value, 'Unexpected leaf node or priority contents'); - if (typeof value['.sv'] === 'string') { - return resolveScalarDeferredValue(value['.sv'], existingVal, serverValues); - } - else if (typeof value['.sv'] === 'object') { - return resolveComplexDeferredValue(value['.sv'], existingVal); - } - else { - util.assert(false, 'Unexpected server value: ' + JSON.stringify(value, null, 2)); - } -}; -var resolveScalarDeferredValue = function (op, existing, serverValues) { - switch (op) { - case 'timestamp': - return serverValues['timestamp']; - default: - util.assert(false, 'Unexpected server value: ' + op); - } -}; -var resolveComplexDeferredValue = function (op, existing, unused) { - if (!op.hasOwnProperty('increment')) { - util.assert(false, 'Unexpected server value: ' + JSON.stringify(op, null, 2)); - } - var delta = op['increment']; - if (typeof delta !== 'number') { - util.assert(false, 'Unexpected increment value: ' + delta); - } - var existingNode = existing.node(); - util.assert(existingNode !== null && typeof existingNode !== 'undefined', 'Expected ChildrenNode.EMPTY_NODE for nulls'); - // Incrementing a non-number sets the value to the incremented amount - if (!existingNode.isLeafNode()) { - return delta; - } - var leaf = existingNode; - var existingVal = leaf.getValue(); - if (typeof existingVal !== 'number') { - return delta; - } - // No need to do over/underflow arithmetic here because JS only handles floats under the covers - return existingVal + delta; -}; -/** - * Recursively replace all deferred values and priorities in the tree with the - * specified generated replacement values. - * @param path - path to which write is relative - * @param node - new data written at path - * @param syncTree - current data - */ -var resolveDeferredValueTree = function (path, node, syncTree, serverValues) { - return resolveDeferredValue(node, new DeferredValueProvider(syncTree, path), serverValues); -}; -/** - * Recursively replace all deferred values and priorities in the node with the - * specified generated replacement values. If there are no server values in the node, - * it'll be returned as-is. - */ -var resolveDeferredValueSnapshot = function (node, existing, serverValues) { - return resolveDeferredValue(node, new ExistingValueProvider(existing), serverValues); -}; -function resolveDeferredValue(node, existingVal, serverValues) { - var rawPri = node.getPriority().val(); - var priority = resolveDeferredLeafValue(rawPri, existingVal.getImmediateChild('.priority'), serverValues); - var newNode; - if (node.isLeafNode()) { - var leafNode = node; - var value = resolveDeferredLeafValue(leafNode.getValue(), existingVal, serverValues); - if (value !== leafNode.getValue() || - priority !== leafNode.getPriority().val()) { - return new LeafNode(value, nodeFromJSON(priority)); - } - else { - return node; - } - } - else { - var childrenNode = node; - newNode = childrenNode; - if (priority !== childrenNode.getPriority().val()) { - newNode = newNode.updatePriority(new LeafNode(priority)); - } - childrenNode.forEachChild(PRIORITY_INDEX, function (childName, childNode) { - var newChildNode = resolveDeferredValue(childNode, existingVal.getImmediateChild(childName), serverValues); - if (newChildNode !== childNode) { - newNode = newNode.updateImmediateChild(childName, newChildNode); - } - }); - return newNode; - } -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * A light-weight tree, traversable by path. Nodes can have both values and children. - * Nodes are not enumerated (by forEachChild) unless they have a value or non-empty - * children. - */ -var Tree = /** @class */ (function () { - /** - * @param name - Optional name of the node. - * @param parent - Optional parent node. - * @param node - Optional node to wrap. - */ - function Tree(name, parent, node) { - if (name === void 0) { name = ''; } - if (parent === void 0) { parent = null; } - if (node === void 0) { node = { children: {}, childCount: 0 }; } - this.name = name; - this.parent = parent; - this.node = node; - } - return Tree; -}()); -/** - * Returns a sub-Tree for the given path. - * - * @param pathObj - Path to look up. - * @returns Tree for path. - */ -function treeSubTree(tree, pathObj) { - // TODO: Require pathObj to be Path? - var path = pathObj instanceof Path ? pathObj : new Path(pathObj); - var child = tree, next = pathGetFront(path); - while (next !== null) { - var childNode = util.safeGet(child.node.children, next) || { - children: {}, - childCount: 0 - }; - child = new Tree(next, child, childNode); - path = pathPopFront(path); - next = pathGetFront(path); - } - return child; -} -/** - * Returns the data associated with this tree node. - * - * @returns The data or null if no data exists. - */ -function treeGetValue(tree) { - return tree.node.value; -} -/** - * Sets data to this tree node. - * - * @param value - Value to set. - */ -function treeSetValue(tree, value) { - tree.node.value = value; - treeUpdateParents(tree); -} -/** - * @returns Whether the tree has any children. - */ -function treeHasChildren(tree) { - return tree.node.childCount > 0; -} -/** - * @returns Whethe rthe tree is empty (no value or children). - */ -function treeIsEmpty(tree) { - return treeGetValue(tree) === undefined && !treeHasChildren(tree); -} -/** - * Calls action for each child of this tree node. - * - * @param action - Action to be called for each child. - */ -function treeForEachChild(tree, action) { - each(tree.node.children, function (child, childTree) { - action(new Tree(child, tree, childTree)); - }); -} -/** - * Does a depth-first traversal of this node's descendants, calling action for each one. - * - * @param action - Action to be called for each child. - * @param includeSelf - Whether to call action on this node as well. Defaults to - * false. - * @param childrenFirst - Whether to call action on children before calling it on - * parent. - */ -function treeForEachDescendant(tree, action, includeSelf, childrenFirst) { - if (includeSelf && !childrenFirst) { - action(tree); - } - treeForEachChild(tree, function (child) { - treeForEachDescendant(child, action, true, childrenFirst); - }); - if (includeSelf && childrenFirst) { - action(tree); - } -} -/** - * Calls action on each ancestor node. - * - * @param action - Action to be called on each parent; return - * true to abort. - * @param includeSelf - Whether to call action on this node as well. - * @returns true if the action callback returned true. - */ -function treeForEachAncestor(tree, action, includeSelf) { - var node = includeSelf ? tree : tree.parent; - while (node !== null) { - if (action(node)) { - return true; - } - node = node.parent; - } - return false; -} -/** - * @returns The path of this tree node, as a Path. - */ -function treeGetPath(tree) { - return new Path(tree.parent === null - ? tree.name - : treeGetPath(tree.parent) + '/' + tree.name); -} -/** - * Adds or removes this child from its parent based on whether it's empty or not. - */ -function treeUpdateParents(tree) { - if (tree.parent !== null) { - treeUpdateChild(tree.parent, tree.name, tree); - } -} -/** - * Adds or removes the passed child to this tree node, depending on whether it's empty. - * - * @param childName - The name of the child to update. - * @param child - The child to update. - */ -function treeUpdateChild(tree, childName, child) { - var childEmpty = treeIsEmpty(child); - var childExists = util.contains(tree.node.children, childName); - if (childEmpty && childExists) { - delete tree.node.children[childName]; - tree.node.childCount--; - treeUpdateParents(tree); - } - else if (!childEmpty && !childExists) { - tree.node.children[childName] = child.node; - tree.node.childCount++; - treeUpdateParents(tree); - } -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * True for invalid Firebase keys - */ -var INVALID_KEY_REGEX_ = /[\[\].#$\/\u0000-\u001F\u007F]/; -/** - * True for invalid Firebase paths. - * Allows '/' in paths. - */ -var INVALID_PATH_REGEX_ = /[\[\].#$\u0000-\u001F\u007F]/; -/** - * Maximum number of characters to allow in leaf value - */ -var MAX_LEAF_SIZE_ = 10 * 1024 * 1024; -var isValidKey = function (key) { - return (typeof key === 'string' && key.length !== 0 && !INVALID_KEY_REGEX_.test(key)); -}; -var isValidPathString = function (pathString) { - return (typeof pathString === 'string' && - pathString.length !== 0 && - !INVALID_PATH_REGEX_.test(pathString)); -}; -var isValidRootPathString = function (pathString) { - if (pathString) { - // Allow '/.info/' at the beginning. - pathString = pathString.replace(/^\/*\.info(\/|$)/, '/'); - } - return isValidPathString(pathString); -}; -var isValidPriority = function (priority) { - return (priority === null || - typeof priority === 'string' || - (typeof priority === 'number' && !isInvalidJSONNumber(priority)) || - (priority && - typeof priority === 'object' && - // eslint-disable-next-line @typescript-eslint/no-explicit-any - util.contains(priority, '.sv'))); -}; -/** - * Pre-validate a datum passed as an argument to Firebase function. - */ -var validateFirebaseDataArg = function (fnName, value, path, optional) { - if (optional && value === undefined) { - return; - } - validateFirebaseData(util.errorPrefix(fnName, 'value'), value, path); -}; -/** - * Validate a data object client-side before sending to server. - */ -var validateFirebaseData = function (errorPrefix, data, path_) { - var path = path_ instanceof Path ? new ValidationPath(path_, errorPrefix) : path_; - if (data === undefined) { - throw new Error(errorPrefix + 'contains undefined ' + validationPathToErrorString(path)); - } - if (typeof data === 'function') { - throw new Error(errorPrefix + - 'contains a function ' + - validationPathToErrorString(path) + - ' with contents = ' + - data.toString()); - } - if (isInvalidJSONNumber(data)) { - throw new Error(errorPrefix + - 'contains ' + - data.toString() + - ' ' + - validationPathToErrorString(path)); - } - // Check max leaf size, but try to avoid the utf8 conversion if we can. - if (typeof data === 'string' && - data.length > MAX_LEAF_SIZE_ / 3 && - util.stringLength(data) > MAX_LEAF_SIZE_) { - throw new Error(errorPrefix + - 'contains a string greater than ' + - MAX_LEAF_SIZE_ + - ' utf8 bytes ' + - validationPathToErrorString(path) + - " ('" + - data.substring(0, 50) + - "...')"); - } - // TODO = Perf = Consider combining the recursive validation of keys into NodeFromJSON - // to save extra walking of large objects. - if (data && typeof data === 'object') { - var hasDotValue_1 = false; - var hasActualChild_1 = false; - each(data, function (key, value) { - if (key === '.value') { - hasDotValue_1 = true; - } - else if (key !== '.priority' && key !== '.sv') { - hasActualChild_1 = true; - if (!isValidKey(key)) { - throw new Error(errorPrefix + - ' contains an invalid key (' + - key + - ') ' + - validationPathToErrorString(path) + - '. Keys must be non-empty strings ' + - 'and can\'t contain ".", "#", "$", "/", "[", or "]"'); - } - } - validationPathPush(path, key); - validateFirebaseData(errorPrefix, value, path); - validationPathPop(path); - }); - if (hasDotValue_1 && hasActualChild_1) { - throw new Error(errorPrefix + - ' contains ".value" child ' + - validationPathToErrorString(path) + - ' in addition to actual children.'); - } - } -}; -/** - * Pre-validate paths passed in the firebase function. - */ -var validateFirebaseMergePaths = function (errorPrefix, mergePaths) { - var i, curPath; - for (i = 0; i < mergePaths.length; i++) { - curPath = mergePaths[i]; - var keys = pathSlice(curPath); - for (var j = 0; j < keys.length; j++) { - if (keys[j] === '.priority' && j === keys.length - 1) ; - else if (!isValidKey(keys[j])) { - throw new Error(errorPrefix + - 'contains an invalid key (' + - keys[j] + - ') in path ' + - curPath.toString() + - '. Keys must be non-empty strings ' + - 'and can\'t contain ".", "#", "$", "/", "[", or "]"'); - } - } - } - // Check that update keys are not descendants of each other. - // We rely on the property that sorting guarantees that ancestors come - // right before descendants. - mergePaths.sort(pathCompare); - var prevPath = null; - for (i = 0; i < mergePaths.length; i++) { - curPath = mergePaths[i]; - if (prevPath !== null && pathContains(prevPath, curPath)) { - throw new Error(errorPrefix + - 'contains a path ' + - prevPath.toString() + - ' that is ancestor of another path ' + - curPath.toString()); - } - prevPath = curPath; - } -}; -/** - * pre-validate an object passed as an argument to firebase function ( - * must be an object - e.g. for firebase.update()). - */ -var validateFirebaseMergeDataArg = function (fnName, data, path, optional) { - if (optional && data === undefined) { - return; - } - var errorPrefix = util.errorPrefix(fnName, 'values'); - if (!(data && typeof data === 'object') || Array.isArray(data)) { - throw new Error(errorPrefix + ' must be an object containing the children to replace.'); - } - var mergePaths = []; - each(data, function (key, value) { - var curPath = new Path(key); - validateFirebaseData(errorPrefix, value, pathChild(path, curPath)); - if (pathGetBack(curPath) === '.priority') { - if (!isValidPriority(value)) { - throw new Error(errorPrefix + - "contains an invalid value for '" + - curPath.toString() + - "', which must be a valid " + - 'Firebase priority (a string, finite number, server value, or null).'); - } - } - mergePaths.push(curPath); - }); - validateFirebaseMergePaths(errorPrefix, mergePaths); -}; -var validatePriority = function (fnName, priority, optional) { - if (optional && priority === undefined) { - return; - } - if (isInvalidJSONNumber(priority)) { - throw new Error(util.errorPrefix(fnName, 'priority') + - 'is ' + - priority.toString() + - ', but must be a valid Firebase priority (a string, finite number, ' + - 'server value, or null).'); - } - // Special case to allow importing data with a .sv. - if (!isValidPriority(priority)) { - throw new Error(util.errorPrefix(fnName, 'priority') + - 'must be a valid Firebase priority ' + - '(a string, finite number, server value, or null).'); - } -}; -var validateKey = function (fnName, argumentName, key, optional) { - if (optional && key === undefined) { - return; - } - if (!isValidKey(key)) { - throw new Error(util.errorPrefix(fnName, argumentName) + - 'was an invalid key = "' + - key + - '". Firebase keys must be non-empty strings and ' + - 'can\'t contain ".", "#", "$", "/", "[", or "]").'); - } -}; -/** - * @internal - */ -var validatePathString = function (fnName, argumentName, pathString, optional) { - if (optional && pathString === undefined) { - return; - } - if (!isValidPathString(pathString)) { - throw new Error(util.errorPrefix(fnName, argumentName) + - 'was an invalid path = "' + - pathString + - '". Paths must be non-empty strings and ' + - 'can\'t contain ".", "#", "$", "[", or "]"'); - } -}; -var validateRootPathString = function (fnName, argumentName, pathString, optional) { - if (pathString) { - // Allow '/.info/' at the beginning. - pathString = pathString.replace(/^\/*\.info(\/|$)/, '/'); - } - validatePathString(fnName, argumentName, pathString, optional); -}; -/** - * @internal - */ -var validateWritablePath = function (fnName, path) { - if (pathGetFront(path) === '.info') { - throw new Error(fnName + " failed = Can't modify data under /.info/"); - } -}; -var validateUrl = function (fnName, parsedUrl) { - // TODO = Validate server better. - var pathString = parsedUrl.path.toString(); - if (!(typeof parsedUrl.repoInfo.host === 'string') || - parsedUrl.repoInfo.host.length === 0 || - (!isValidKey(parsedUrl.repoInfo.namespace) && - parsedUrl.repoInfo.host.split(':')[0] !== 'localhost') || - (pathString.length !== 0 && !isValidRootPathString(pathString))) { - throw new Error(util.errorPrefix(fnName, 'url') + - 'must be a valid firebase URL and ' + - 'the path can\'t contain ".", "#", "$", "[", or "]".'); - } -}; - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * The event queue serves a few purposes: - * 1. It ensures we maintain event order in the face of event callbacks doing operations that result in more - * events being queued. - * 2. raiseQueuedEvents() handles being called reentrantly nicely. That is, if in the course of raising events, - * raiseQueuedEvents() is called again, the "inner" call will pick up raising events where the "outer" call - * left off, ensuring that the events are still raised synchronously and in order. - * 3. You can use raiseEventsAtPath and raiseEventsForChangedPath to ensure only relevant previously-queued - * events are raised synchronously. - * - * NOTE: This can all go away if/when we move to async events. - * - */ -var EventQueue = /** @class */ (function () { - function EventQueue() { - this.eventLists_ = []; - /** - * Tracks recursion depth of raiseQueuedEvents_, for debugging purposes. - */ - this.recursionDepth_ = 0; - } - return EventQueue; -}()); -/** - * @param eventDataList - The new events to queue. - */ -function eventQueueQueueEvents(eventQueue, eventDataList) { - // We group events by path, storing them in a single EventList, to make it easier to skip over them quickly. - var currList = null; - for (var i = 0; i < eventDataList.length; i++) { - var data = eventDataList[i]; - var path = data.getPath(); - if (currList !== null && !pathEquals(path, currList.path)) { - eventQueue.eventLists_.push(currList); - currList = null; - } - if (currList === null) { - currList = { events: [], path: path }; - } - currList.events.push(data); - } - if (currList) { - eventQueue.eventLists_.push(currList); - } -} -/** - * Queues the specified events and synchronously raises all events (including previously queued ones) - * for the specified path. - * - * It is assumed that the new events are all for the specified path. - * - * @param path - The path to raise events for. - * @param eventDataList - The new events to raise. - */ -function eventQueueRaiseEventsAtPath(eventQueue, path, eventDataList) { - eventQueueQueueEvents(eventQueue, eventDataList); - eventQueueRaiseQueuedEventsMatchingPredicate(eventQueue, function (eventPath) { - return pathEquals(eventPath, path); - }); -} -/** - * Queues the specified events and synchronously raises all events (including previously queued ones) for - * locations related to the specified change path (i.e. all ancestors and descendants). - * - * It is assumed that the new events are all related (ancestor or descendant) to the specified path. - * - * @param changedPath - The path to raise events for. - * @param eventDataList - The events to raise - */ -function eventQueueRaiseEventsForChangedPath(eventQueue, changedPath, eventDataList) { - eventQueueQueueEvents(eventQueue, eventDataList); - eventQueueRaiseQueuedEventsMatchingPredicate(eventQueue, function (eventPath) { - return pathContains(eventPath, changedPath) || - pathContains(changedPath, eventPath); - }); -} -function eventQueueRaiseQueuedEventsMatchingPredicate(eventQueue, predicate) { - eventQueue.recursionDepth_++; - var sentAll = true; - for (var i = 0; i < eventQueue.eventLists_.length; i++) { - var eventList = eventQueue.eventLists_[i]; - if (eventList) { - var eventPath = eventList.path; - if (predicate(eventPath)) { - eventListRaise(eventQueue.eventLists_[i]); - eventQueue.eventLists_[i] = null; - } - else { - sentAll = false; - } - } - } - if (sentAll) { - eventQueue.eventLists_ = []; - } - eventQueue.recursionDepth_--; -} -/** - * Iterates through the list and raises each event - */ -function eventListRaise(eventList) { - for (var i = 0; i < eventList.events.length; i++) { - var eventData = eventList.events[i]; - if (eventData !== null) { - eventList.events[i] = null; - var eventFn = eventData.getEventRunner(); - if (logger) { - log('event: ' + eventData.toString()); - } - exceptionGuard(eventFn); - } - } -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var INTERRUPT_REASON = 'repo_interrupt'; -/** - * If a transaction does not succeed after 25 retries, we abort it. Among other - * things this ensure that if there's ever a bug causing a mismatch between - * client / server hashes for some data, we won't retry indefinitely. - */ -var MAX_TRANSACTION_RETRIES = 25; -/** - * A connection to a single data repository. - */ -var Repo = /** @class */ (function () { - function Repo(repoInfo_, forceRestClient_, authTokenProvider_, appCheckProvider_) { - this.repoInfo_ = repoInfo_; - this.forceRestClient_ = forceRestClient_; - this.authTokenProvider_ = authTokenProvider_; - this.appCheckProvider_ = appCheckProvider_; - this.dataUpdateCount = 0; - this.statsListener_ = null; - this.eventQueue_ = new EventQueue(); - this.nextWriteId_ = 1; - this.interceptServerDataCallback_ = null; - /** A list of data pieces and paths to be set when this client disconnects. */ - this.onDisconnect_ = newSparseSnapshotTree(); - /** Stores queues of outstanding transactions for Firebase locations. */ - this.transactionQueueTree_ = new Tree(); - // TODO: This should be @private but it's used by test_access.js and internal.js - this.persistentConnection_ = null; - // This key is intentionally not updated if RepoInfo is later changed or replaced - this.key = this.repoInfo_.toURLString(); - } - /** - * @returns The URL corresponding to the root of this Firebase. - */ - Repo.prototype.toString = function () { - return ((this.repoInfo_.secure ? 'https://' : 'http://') + this.repoInfo_.host); - }; - return Repo; -}()); -function repoStart(repo, appId, authOverride) { - repo.stats_ = statsManagerGetCollection(repo.repoInfo_); - if (repo.forceRestClient_ || beingCrawled()) { - repo.server_ = new ReadonlyRestClient(repo.repoInfo_, function (pathString, data, isMerge, tag) { - repoOnDataUpdate(repo, pathString, data, isMerge, tag); - }, repo.authTokenProvider_, repo.appCheckProvider_); - // Minor hack: Fire onConnect immediately, since there's no actual connection. - setTimeout(function () { return repoOnConnectStatus(repo, /* connectStatus= */ true); }, 0); - } - else { - // Validate authOverride - if (typeof authOverride !== 'undefined' && authOverride !== null) { - if (typeof authOverride !== 'object') { - throw new Error('Only objects are supported for option databaseAuthVariableOverride'); - } - try { - util.stringify(authOverride); - } - catch (e) { - throw new Error('Invalid authOverride provided: ' + e); - } - } - repo.persistentConnection_ = new PersistentConnection(repo.repoInfo_, appId, function (pathString, data, isMerge, tag) { - repoOnDataUpdate(repo, pathString, data, isMerge, tag); - }, function (connectStatus) { - repoOnConnectStatus(repo, connectStatus); - }, function (updates) { - repoOnServerInfoUpdate(repo, updates); - }, repo.authTokenProvider_, repo.appCheckProvider_, authOverride); - repo.server_ = repo.persistentConnection_; - } - repo.authTokenProvider_.addTokenChangeListener(function (token) { - repo.server_.refreshAuthToken(token); - }); - repo.appCheckProvider_.addTokenChangeListener(function (result) { - repo.server_.refreshAppCheckToken(result.token); - }); - // In the case of multiple Repos for the same repoInfo (i.e. there are multiple Firebase.Contexts being used), - // we only want to create one StatsReporter. As such, we'll report stats over the first Repo created. - repo.statsReporter_ = statsManagerGetOrCreateReporter(repo.repoInfo_, function () { return new StatsReporter(repo.stats_, repo.server_); }); - // Used for .info. - repo.infoData_ = new SnapshotHolder(); - repo.infoSyncTree_ = new SyncTree({ - startListening: function (query, tag, currentHashFn, onComplete) { - var infoEvents = []; - var node = repo.infoData_.getNode(query._path); - // This is possibly a hack, but we have different semantics for .info endpoints. We don't raise null events - // on initial data... - if (!node.isEmpty()) { - infoEvents = syncTreeApplyServerOverwrite(repo.infoSyncTree_, query._path, node); - setTimeout(function () { - onComplete('ok'); - }, 0); - } - return infoEvents; - }, - stopListening: function () { } - }); - repoUpdateInfo(repo, 'connected', false); - repo.serverSyncTree_ = new SyncTree({ - startListening: function (query, tag, currentHashFn, onComplete) { - repo.server_.listen(query, currentHashFn, tag, function (status, data) { - var events = onComplete(status, data); - eventQueueRaiseEventsForChangedPath(repo.eventQueue_, query._path, events); - }); - // No synchronous events for network-backed sync trees - return []; - }, - stopListening: function (query, tag) { - repo.server_.unlisten(query, tag); - } - }); -} -/** - * @returns The time in milliseconds, taking the server offset into account if we have one. - */ -function repoServerTime(repo) { - var offsetNode = repo.infoData_.getNode(new Path('.info/serverTimeOffset')); - var offset = offsetNode.val() || 0; - return new Date().getTime() + offset; -} -/** - * Generate ServerValues using some variables from the repo object. - */ -function repoGenerateServerValues(repo) { - return generateWithValues({ - timestamp: repoServerTime(repo) - }); -} -/** - * Called by realtime when we get new messages from the server. - */ -function repoOnDataUpdate(repo, pathString, data, isMerge, tag) { - // For testing. - repo.dataUpdateCount++; - var path = new Path(pathString); - data = repo.interceptServerDataCallback_ - ? repo.interceptServerDataCallback_(pathString, data) - : data; - var events = []; - if (tag) { - if (isMerge) { - var taggedChildren = util.map(data, function (raw) { return nodeFromJSON(raw); }); - events = syncTreeApplyTaggedQueryMerge(repo.serverSyncTree_, path, taggedChildren, tag); - } - else { - var taggedSnap = nodeFromJSON(data); - events = syncTreeApplyTaggedQueryOverwrite(repo.serverSyncTree_, path, taggedSnap, tag); - } - } - else if (isMerge) { - var changedChildren = util.map(data, function (raw) { return nodeFromJSON(raw); }); - events = syncTreeApplyServerMerge(repo.serverSyncTree_, path, changedChildren); - } - else { - var snap = nodeFromJSON(data); - events = syncTreeApplyServerOverwrite(repo.serverSyncTree_, path, snap); - } - var affectedPath = path; - if (events.length > 0) { - // Since we have a listener outstanding for each transaction, receiving any events - // is a proxy for some change having occurred. - affectedPath = repoRerunTransactions(repo, path); - } - eventQueueRaiseEventsForChangedPath(repo.eventQueue_, affectedPath, events); -} -function repoOnConnectStatus(repo, connectStatus) { - repoUpdateInfo(repo, 'connected', connectStatus); - if (connectStatus === false) { - repoRunOnDisconnectEvents(repo); - } -} -function repoOnServerInfoUpdate(repo, updates) { - each(updates, function (key, value) { - repoUpdateInfo(repo, key, value); - }); -} -function repoUpdateInfo(repo, pathString, value) { - var path = new Path('/.info/' + pathString); - var newNode = nodeFromJSON(value); - repo.infoData_.updateSnapshot(path, newNode); - var events = syncTreeApplyServerOverwrite(repo.infoSyncTree_, path, newNode); - eventQueueRaiseEventsForChangedPath(repo.eventQueue_, path, events); -} -function repoGetNextWriteId(repo) { - return repo.nextWriteId_++; -} -/** - * The purpose of `getValue` is to return the latest known value - * satisfying `query`. - * - * This method will first check for in-memory cached values - * belonging to active listeners. If they are found, such values - * are considered to be the most up-to-date. - * - * If the client is not connected, this method will wait until the - * repo has established a connection and then request the value for `query`. - * If the client is not able to retrieve the query result for another reason, - * it reports an error. - * - * @param query - The query to surface a value for. - */ -function repoGetValue(repo, query, eventRegistration) { - // Only active queries are cached. There is no persisted cache. - var cached = syncTreeGetServerValue(repo.serverSyncTree_, query); - if (cached != null) { - return Promise.resolve(cached); - } - return repo.server_.get(query).then(function (payload) { - var node = nodeFromJSON(payload).withIndex(query._queryParams.getIndex()); - /** - * Below we simulate the actions of an `onlyOnce` `onValue()` event where: - * Add an event registration, - * Update data at the path, - * Raise any events, - * Cleanup the SyncTree - */ - syncTreeAddEventRegistration(repo.serverSyncTree_, query, eventRegistration, true); - var events; - if (query._queryParams.loadsAllData()) { - events = syncTreeApplyServerOverwrite(repo.serverSyncTree_, query._path, node); - } - else { - var tag = syncTreeTagForQuery(repo.serverSyncTree_, query); - events = syncTreeApplyTaggedQueryOverwrite(repo.serverSyncTree_, query._path, node, tag); - } - /* - * We need to raise events in the scenario where `get()` is called at a parent path, and - * while the `get()` is pending, `onValue` is called at a child location. While get() is waiting - * for the data, `onValue` will register a new event. Then, get() will come back, and update the syncTree - * and its corresponding serverCache, including the child location where `onValue` is called. Then, - * `onValue` will receive the event from the server, but look at the syncTree and see that the data received - * from the server is already at the SyncPoint, and so the `onValue` callback will never get fired. - * Calling `eventQueueRaiseEventsForChangedPath()` is the correct way to propagate the events and - * ensure the corresponding child events will get fired. - */ - eventQueueRaiseEventsForChangedPath(repo.eventQueue_, query._path, events); - syncTreeRemoveEventRegistration(repo.serverSyncTree_, query, eventRegistration, null, true); - return node; - }, function (err) { - repoLog(repo, 'get for query ' + util.stringify(query) + ' failed: ' + err); - return Promise.reject(new Error(err)); - }); -} -function repoSetWithPriority(repo, path, newVal, newPriority, onComplete) { - repoLog(repo, 'set', { - path: path.toString(), - value: newVal, - priority: newPriority - }); - // TODO: Optimize this behavior to either (a) store flag to skip resolving where possible and / or - // (b) store unresolved paths on JSON parse - var serverValues = repoGenerateServerValues(repo); - var newNodeUnresolved = nodeFromJSON(newVal, newPriority); - var existing = syncTreeCalcCompleteEventCache(repo.serverSyncTree_, path); - var newNode = resolveDeferredValueSnapshot(newNodeUnresolved, existing, serverValues); - var writeId = repoGetNextWriteId(repo); - var events = syncTreeApplyUserOverwrite(repo.serverSyncTree_, path, newNode, writeId, true); - eventQueueQueueEvents(repo.eventQueue_, events); - repo.server_.put(path.toString(), newNodeUnresolved.val(/*export=*/ true), function (status, errorReason) { - var success = status === 'ok'; - if (!success) { - warn$1('set at ' + path + ' failed: ' + status); - } - var clearEvents = syncTreeAckUserWrite(repo.serverSyncTree_, writeId, !success); - eventQueueRaiseEventsForChangedPath(repo.eventQueue_, path, clearEvents); - repoCallOnCompleteCallback(repo, onComplete, status, errorReason); - }); - var affectedPath = repoAbortTransactions(repo, path); - repoRerunTransactions(repo, affectedPath); - // We queued the events above, so just flush the queue here - eventQueueRaiseEventsForChangedPath(repo.eventQueue_, affectedPath, []); -} -function repoUpdate(repo, path, childrenToMerge, onComplete) { - repoLog(repo, 'update', { path: path.toString(), value: childrenToMerge }); - // Start with our existing data and merge each child into it. - var empty = true; - var serverValues = repoGenerateServerValues(repo); - var changedChildren = {}; - each(childrenToMerge, function (changedKey, changedValue) { - empty = false; - changedChildren[changedKey] = resolveDeferredValueTree(pathChild(path, changedKey), nodeFromJSON(changedValue), repo.serverSyncTree_, serverValues); - }); - if (!empty) { - var writeId_1 = repoGetNextWriteId(repo); - var events = syncTreeApplyUserMerge(repo.serverSyncTree_, path, changedChildren, writeId_1); - eventQueueQueueEvents(repo.eventQueue_, events); - repo.server_.merge(path.toString(), childrenToMerge, function (status, errorReason) { - var success = status === 'ok'; - if (!success) { - warn$1('update at ' + path + ' failed: ' + status); - } - var clearEvents = syncTreeAckUserWrite(repo.serverSyncTree_, writeId_1, !success); - var affectedPath = clearEvents.length > 0 ? repoRerunTransactions(repo, path) : path; - eventQueueRaiseEventsForChangedPath(repo.eventQueue_, affectedPath, clearEvents); - repoCallOnCompleteCallback(repo, onComplete, status, errorReason); - }); - each(childrenToMerge, function (changedPath) { - var affectedPath = repoAbortTransactions(repo, pathChild(path, changedPath)); - repoRerunTransactions(repo, affectedPath); - }); - // We queued the events above, so just flush the queue here - eventQueueRaiseEventsForChangedPath(repo.eventQueue_, path, []); - } - else { - log("update() called with empty data. Don't do anything."); - repoCallOnCompleteCallback(repo, onComplete, 'ok', undefined); - } -} -/** - * Applies all of the changes stored up in the onDisconnect_ tree. - */ -function repoRunOnDisconnectEvents(repo) { - repoLog(repo, 'onDisconnectEvents'); - var serverValues = repoGenerateServerValues(repo); - var resolvedOnDisconnectTree = newSparseSnapshotTree(); - sparseSnapshotTreeForEachTree(repo.onDisconnect_, newEmptyPath(), function (path, node) { - var resolved = resolveDeferredValueTree(path, node, repo.serverSyncTree_, serverValues); - sparseSnapshotTreeRemember(resolvedOnDisconnectTree, path, resolved); - }); - var events = []; - sparseSnapshotTreeForEachTree(resolvedOnDisconnectTree, newEmptyPath(), function (path, snap) { - events = events.concat(syncTreeApplyServerOverwrite(repo.serverSyncTree_, path, snap)); - var affectedPath = repoAbortTransactions(repo, path); - repoRerunTransactions(repo, affectedPath); - }); - repo.onDisconnect_ = newSparseSnapshotTree(); - eventQueueRaiseEventsForChangedPath(repo.eventQueue_, newEmptyPath(), events); -} -function repoOnDisconnectCancel(repo, path, onComplete) { - repo.server_.onDisconnectCancel(path.toString(), function (status, errorReason) { - if (status === 'ok') { - sparseSnapshotTreeForget(repo.onDisconnect_, path); - } - repoCallOnCompleteCallback(repo, onComplete, status, errorReason); - }); -} -function repoOnDisconnectSet(repo, path, value, onComplete) { - var newNode = nodeFromJSON(value); - repo.server_.onDisconnectPut(path.toString(), newNode.val(/*export=*/ true), function (status, errorReason) { - if (status === 'ok') { - sparseSnapshotTreeRemember(repo.onDisconnect_, path, newNode); - } - repoCallOnCompleteCallback(repo, onComplete, status, errorReason); - }); -} -function repoOnDisconnectSetWithPriority(repo, path, value, priority, onComplete) { - var newNode = nodeFromJSON(value, priority); - repo.server_.onDisconnectPut(path.toString(), newNode.val(/*export=*/ true), function (status, errorReason) { - if (status === 'ok') { - sparseSnapshotTreeRemember(repo.onDisconnect_, path, newNode); - } - repoCallOnCompleteCallback(repo, onComplete, status, errorReason); - }); -} -function repoOnDisconnectUpdate(repo, path, childrenToMerge, onComplete) { - if (util.isEmpty(childrenToMerge)) { - log("onDisconnect().update() called with empty data. Don't do anything."); - repoCallOnCompleteCallback(repo, onComplete, 'ok', undefined); - return; - } - repo.server_.onDisconnectMerge(path.toString(), childrenToMerge, function (status, errorReason) { - if (status === 'ok') { - each(childrenToMerge, function (childName, childNode) { - var newChildNode = nodeFromJSON(childNode); - sparseSnapshotTreeRemember(repo.onDisconnect_, pathChild(path, childName), newChildNode); - }); - } - repoCallOnCompleteCallback(repo, onComplete, status, errorReason); - }); -} -function repoAddEventCallbackForQuery(repo, query, eventRegistration) { - var events; - if (pathGetFront(query._path) === '.info') { - events = syncTreeAddEventRegistration(repo.infoSyncTree_, query, eventRegistration); - } - else { - events = syncTreeAddEventRegistration(repo.serverSyncTree_, query, eventRegistration); - } - eventQueueRaiseEventsAtPath(repo.eventQueue_, query._path, events); -} -function repoRemoveEventCallbackForQuery(repo, query, eventRegistration) { - // These are guaranteed not to raise events, since we're not passing in a cancelError. However, we can future-proof - // a little bit by handling the return values anyways. - var events; - if (pathGetFront(query._path) === '.info') { - events = syncTreeRemoveEventRegistration(repo.infoSyncTree_, query, eventRegistration); - } - else { - events = syncTreeRemoveEventRegistration(repo.serverSyncTree_, query, eventRegistration); - } - eventQueueRaiseEventsAtPath(repo.eventQueue_, query._path, events); -} -function repoInterrupt(repo) { - if (repo.persistentConnection_) { - repo.persistentConnection_.interrupt(INTERRUPT_REASON); - } -} -function repoResume(repo) { - if (repo.persistentConnection_) { - repo.persistentConnection_.resume(INTERRUPT_REASON); - } -} -function repoLog(repo) { - var varArgs = []; - for (var _i = 1; _i < arguments.length; _i++) { - varArgs[_i - 1] = arguments[_i]; - } - var prefix = ''; - if (repo.persistentConnection_) { - prefix = repo.persistentConnection_.id + ':'; - } - log.apply(void 0, tslib.__spreadArray([prefix], tslib.__read(varArgs))); -} -function repoCallOnCompleteCallback(repo, callback, status, errorReason) { - if (callback) { - exceptionGuard(function () { - if (status === 'ok') { - callback(null); - } - else { - var code = (status || 'error').toUpperCase(); - var message = code; - if (errorReason) { - message += ': ' + errorReason; - } - var error = new Error(message); - // eslint-disable-next-line @typescript-eslint/no-explicit-any - error.code = code; - callback(error); - } - }); - } -} -/** - * Creates a new transaction, adds it to the transactions we're tracking, and - * sends it to the server if possible. - * - * @param path - Path at which to do transaction. - * @param transactionUpdate - Update callback. - * @param onComplete - Completion callback. - * @param unwatcher - Function that will be called when the transaction no longer - * need data updates for `path`. - * @param applyLocally - Whether or not to make intermediate results visible - */ -function repoStartTransaction(repo, path, transactionUpdate, onComplete, unwatcher, applyLocally) { - repoLog(repo, 'transaction on ' + path); - // Initialize transaction. - var transaction = { - path: path, - update: transactionUpdate, - onComplete: onComplete, - // One of TransactionStatus enums. - status: null, - // Used when combining transactions at different locations to figure out - // which one goes first. - order: LUIDGenerator(), - // Whether to raise local events for this transaction. - applyLocally: applyLocally, - // Count of how many times we've retried the transaction. - retryCount: 0, - // Function to call to clean up our .on() listener. - unwatcher: unwatcher, - // Stores why a transaction was aborted. - abortReason: null, - currentWriteId: null, - currentInputSnapshot: null, - currentOutputSnapshotRaw: null, - currentOutputSnapshotResolved: null - }; - // Run transaction initially. - var currentState = repoGetLatestState(repo, path, undefined); - transaction.currentInputSnapshot = currentState; - var newVal = transaction.update(currentState.val()); - if (newVal === undefined) { - // Abort transaction. - transaction.unwatcher(); - transaction.currentOutputSnapshotRaw = null; - transaction.currentOutputSnapshotResolved = null; - if (transaction.onComplete) { - transaction.onComplete(null, false, transaction.currentInputSnapshot); - } - } - else { - validateFirebaseData('transaction failed: Data returned ', newVal, transaction.path); - // Mark as run and add to our queue. - transaction.status = 0 /* RUN */; - var queueNode = treeSubTree(repo.transactionQueueTree_, path); - var nodeQueue = treeGetValue(queueNode) || []; - nodeQueue.push(transaction); - treeSetValue(queueNode, nodeQueue); - // Update visibleData and raise events - // Note: We intentionally raise events after updating all of our - // transaction state, since the user could start new transactions from the - // event callbacks. - var priorityForNode = void 0; - if (typeof newVal === 'object' && - newVal !== null && - util.contains(newVal, '.priority')) { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - priorityForNode = util.safeGet(newVal, '.priority'); - util.assert(isValidPriority(priorityForNode), 'Invalid priority returned by transaction. ' + - 'Priority must be a valid string, finite number, server value, or null.'); - } - else { - var currentNode = syncTreeCalcCompleteEventCache(repo.serverSyncTree_, path) || - ChildrenNode.EMPTY_NODE; - priorityForNode = currentNode.getPriority().val(); - } - var serverValues = repoGenerateServerValues(repo); - var newNodeUnresolved = nodeFromJSON(newVal, priorityForNode); - var newNode = resolveDeferredValueSnapshot(newNodeUnresolved, currentState, serverValues); - transaction.currentOutputSnapshotRaw = newNodeUnresolved; - transaction.currentOutputSnapshotResolved = newNode; - transaction.currentWriteId = repoGetNextWriteId(repo); - var events = syncTreeApplyUserOverwrite(repo.serverSyncTree_, path, newNode, transaction.currentWriteId, transaction.applyLocally); - eventQueueRaiseEventsForChangedPath(repo.eventQueue_, path, events); - repoSendReadyTransactions(repo, repo.transactionQueueTree_); - } -} -/** - * @param excludeSets - A specific set to exclude - */ -function repoGetLatestState(repo, path, excludeSets) { - return (syncTreeCalcCompleteEventCache(repo.serverSyncTree_, path, excludeSets) || - ChildrenNode.EMPTY_NODE); -} -/** - * Sends any already-run transactions that aren't waiting for outstanding - * transactions to complete. - * - * Externally it's called with no arguments, but it calls itself recursively - * with a particular transactionQueueTree node to recurse through the tree. - * - * @param node - transactionQueueTree node to start at. - */ -function repoSendReadyTransactions(repo, node) { - if (node === void 0) { node = repo.transactionQueueTree_; } - // Before recursing, make sure any completed transactions are removed. - if (!node) { - repoPruneCompletedTransactionsBelowNode(repo, node); - } - if (treeGetValue(node)) { - var queue = repoBuildTransactionQueue(repo, node); - util.assert(queue.length > 0, 'Sending zero length transaction queue'); - var allRun = queue.every(function (transaction) { return transaction.status === 0 /* RUN */; }); - // If they're all run (and not sent), we can send them. Else, we must wait. - if (allRun) { - repoSendTransactionQueue(repo, treeGetPath(node), queue); - } - } - else if (treeHasChildren(node)) { - treeForEachChild(node, function (childNode) { - repoSendReadyTransactions(repo, childNode); - }); - } -} -/** - * Given a list of run transactions, send them to the server and then handle - * the result (success or failure). - * - * @param path - The location of the queue. - * @param queue - Queue of transactions under the specified location. - */ -function repoSendTransactionQueue(repo, path, queue) { - // Mark transactions as sent and increment retry count! - var setsToIgnore = queue.map(function (txn) { - return txn.currentWriteId; - }); - var latestState = repoGetLatestState(repo, path, setsToIgnore); - var snapToSend = latestState; - var latestHash = latestState.hash(); - for (var i = 0; i < queue.length; i++) { - var txn = queue[i]; - util.assert(txn.status === 0 /* RUN */, 'tryToSendTransactionQueue_: items in queue should all be run.'); - txn.status = 1 /* SENT */; - txn.retryCount++; - var relativePath = newRelativePath(path, txn.path); - // If we've gotten to this point, the output snapshot must be defined. - snapToSend = snapToSend.updateChild(relativePath /** @type {!Node} */, txn.currentOutputSnapshotRaw); - } - var dataToSend = snapToSend.val(true); - var pathToSend = path; - // Send the put. - repo.server_.put(pathToSend.toString(), dataToSend, function (status) { - repoLog(repo, 'transaction put response', { - path: pathToSend.toString(), - status: status - }); - var events = []; - if (status === 'ok') { - // Queue up the callbacks and fire them after cleaning up all of our - // transaction state, since the callback could trigger more - // transactions or sets. - var callbacks = []; - var _loop_1 = function (i) { - queue[i].status = 2 /* COMPLETED */; - events = events.concat(syncTreeAckUserWrite(repo.serverSyncTree_, queue[i].currentWriteId)); - if (queue[i].onComplete) { - // We never unset the output snapshot, and given that this - // transaction is complete, it should be set - callbacks.push(function () { - return queue[i].onComplete(null, true, queue[i].currentOutputSnapshotResolved); - }); - } - queue[i].unwatcher(); - }; - for (var i = 0; i < queue.length; i++) { - _loop_1(i); - } - // Now remove the completed transactions. - repoPruneCompletedTransactionsBelowNode(repo, treeSubTree(repo.transactionQueueTree_, path)); - // There may be pending transactions that we can now send. - repoSendReadyTransactions(repo, repo.transactionQueueTree_); - eventQueueRaiseEventsForChangedPath(repo.eventQueue_, path, events); - // Finally, trigger onComplete callbacks. - for (var i = 0; i < callbacks.length; i++) { - exceptionGuard(callbacks[i]); - } - } - else { - // transactions are no longer sent. Update their status appropriately. - if (status === 'datastale') { - for (var i = 0; i < queue.length; i++) { - if (queue[i].status === 3 /* SENT_NEEDS_ABORT */) { - queue[i].status = 4 /* NEEDS_ABORT */; - } - else { - queue[i].status = 0 /* RUN */; - } - } - } - else { - warn$1('transaction at ' + pathToSend.toString() + ' failed: ' + status); - for (var i = 0; i < queue.length; i++) { - queue[i].status = 4 /* NEEDS_ABORT */; - queue[i].abortReason = status; - } - } - repoRerunTransactions(repo, path); - } - }, latestHash); -} -/** - * Finds all transactions dependent on the data at changedPath and reruns them. - * - * Should be called any time cached data changes. - * - * Return the highest path that was affected by rerunning transactions. This - * is the path at which events need to be raised for. - * - * @param changedPath - The path in mergedData that changed. - * @returns The rootmost path that was affected by rerunning transactions. - */ -function repoRerunTransactions(repo, changedPath) { - var rootMostTransactionNode = repoGetAncestorTransactionNode(repo, changedPath); - var path = treeGetPath(rootMostTransactionNode); - var queue = repoBuildTransactionQueue(repo, rootMostTransactionNode); - repoRerunTransactionQueue(repo, queue, path); - return path; -} -/** - * Does all the work of rerunning transactions (as well as cleans up aborted - * transactions and whatnot). - * - * @param queue - The queue of transactions to run. - * @param path - The path the queue is for. - */ -function repoRerunTransactionQueue(repo, queue, path) { - if (queue.length === 0) { - return; // Nothing to do! - } - // Queue up the callbacks and fire them after cleaning up all of our - // transaction state, since the callback could trigger more transactions or - // sets. - var callbacks = []; - var events = []; - // Ignore all of the sets we're going to re-run. - var txnsToRerun = queue.filter(function (q) { - return q.status === 0 /* RUN */; - }); - var setsToIgnore = txnsToRerun.map(function (q) { - return q.currentWriteId; - }); - var _loop_2 = function (i) { - var transaction = queue[i]; - var relativePath = newRelativePath(path, transaction.path); - var abortTransaction = false, abortReason; - util.assert(relativePath !== null, 'rerunTransactionsUnderNode_: relativePath should not be null.'); - if (transaction.status === 4 /* NEEDS_ABORT */) { - abortTransaction = true; - abortReason = transaction.abortReason; - events = events.concat(syncTreeAckUserWrite(repo.serverSyncTree_, transaction.currentWriteId, true)); - } - else if (transaction.status === 0 /* RUN */) { - if (transaction.retryCount >= MAX_TRANSACTION_RETRIES) { - abortTransaction = true; - abortReason = 'maxretry'; - events = events.concat(syncTreeAckUserWrite(repo.serverSyncTree_, transaction.currentWriteId, true)); - } - else { - // This code reruns a transaction - var currentNode = repoGetLatestState(repo, transaction.path, setsToIgnore); - transaction.currentInputSnapshot = currentNode; - var newData = queue[i].update(currentNode.val()); - if (newData !== undefined) { - validateFirebaseData('transaction failed: Data returned ', newData, transaction.path); - var newDataNode = nodeFromJSON(newData); - var hasExplicitPriority = typeof newData === 'object' && - newData != null && - util.contains(newData, '.priority'); - if (!hasExplicitPriority) { - // Keep the old priority if there wasn't a priority explicitly specified. - newDataNode = newDataNode.updatePriority(currentNode.getPriority()); - } - var oldWriteId = transaction.currentWriteId; - var serverValues = repoGenerateServerValues(repo); - var newNodeResolved = resolveDeferredValueSnapshot(newDataNode, currentNode, serverValues); - transaction.currentOutputSnapshotRaw = newDataNode; - transaction.currentOutputSnapshotResolved = newNodeResolved; - transaction.currentWriteId = repoGetNextWriteId(repo); - // Mutates setsToIgnore in place - setsToIgnore.splice(setsToIgnore.indexOf(oldWriteId), 1); - events = events.concat(syncTreeApplyUserOverwrite(repo.serverSyncTree_, transaction.path, newNodeResolved, transaction.currentWriteId, transaction.applyLocally)); - events = events.concat(syncTreeAckUserWrite(repo.serverSyncTree_, oldWriteId, true)); - } - else { - abortTransaction = true; - abortReason = 'nodata'; - events = events.concat(syncTreeAckUserWrite(repo.serverSyncTree_, transaction.currentWriteId, true)); - } - } - } - eventQueueRaiseEventsForChangedPath(repo.eventQueue_, path, events); - events = []; - if (abortTransaction) { - // Abort. - queue[i].status = 2 /* COMPLETED */; - // Removing a listener can trigger pruning which can muck with - // mergedData/visibleData (as it prunes data). So defer the unwatcher - // until we're done. - (function (unwatcher) { - setTimeout(unwatcher, Math.floor(0)); - })(queue[i].unwatcher); - if (queue[i].onComplete) { - if (abortReason === 'nodata') { - callbacks.push(function () { - return queue[i].onComplete(null, false, queue[i].currentInputSnapshot); - }); - } - else { - callbacks.push(function () { - return queue[i].onComplete(new Error(abortReason), false, null); - }); - } - } - } - }; - for (var i = 0; i < queue.length; i++) { - _loop_2(i); - } - // Clean up completed transactions. - repoPruneCompletedTransactionsBelowNode(repo, repo.transactionQueueTree_); - // Now fire callbacks, now that we're in a good, known state. - for (var i = 0; i < callbacks.length; i++) { - exceptionGuard(callbacks[i]); - } - // Try to send the transaction result to the server. - repoSendReadyTransactions(repo, repo.transactionQueueTree_); -} -/** - * Returns the rootmost ancestor node of the specified path that has a pending - * transaction on it, or just returns the node for the given path if there are - * no pending transactions on any ancestor. - * - * @param path - The location to start at. - * @returns The rootmost node with a transaction. - */ -function repoGetAncestorTransactionNode(repo, path) { - var front; - // Start at the root and walk deeper into the tree towards path until we - // find a node with pending transactions. - var transactionNode = repo.transactionQueueTree_; - front = pathGetFront(path); - while (front !== null && treeGetValue(transactionNode) === undefined) { - transactionNode = treeSubTree(transactionNode, front); - path = pathPopFront(path); - front = pathGetFront(path); - } - return transactionNode; -} -/** - * Builds the queue of all transactions at or below the specified - * transactionNode. - * - * @param transactionNode - * @returns The generated queue. - */ -function repoBuildTransactionQueue(repo, transactionNode) { - // Walk any child transaction queues and aggregate them into a single queue. - var transactionQueue = []; - repoAggregateTransactionQueuesForNode(repo, transactionNode, transactionQueue); - // Sort them by the order the transactions were created. - transactionQueue.sort(function (a, b) { return a.order - b.order; }); - return transactionQueue; -} -function repoAggregateTransactionQueuesForNode(repo, node, queue) { - var nodeQueue = treeGetValue(node); - if (nodeQueue) { - for (var i = 0; i < nodeQueue.length; i++) { - queue.push(nodeQueue[i]); - } - } - treeForEachChild(node, function (child) { - repoAggregateTransactionQueuesForNode(repo, child, queue); - }); -} -/** - * Remove COMPLETED transactions at or below this node in the transactionQueueTree_. - */ -function repoPruneCompletedTransactionsBelowNode(repo, node) { - var queue = treeGetValue(node); - if (queue) { - var to = 0; - for (var from = 0; from < queue.length; from++) { - if (queue[from].status !== 2 /* COMPLETED */) { - queue[to] = queue[from]; - to++; - } - } - queue.length = to; - treeSetValue(node, queue.length > 0 ? queue : undefined); - } - treeForEachChild(node, function (childNode) { - repoPruneCompletedTransactionsBelowNode(repo, childNode); - }); -} -/** - * Aborts all transactions on ancestors or descendants of the specified path. - * Called when doing a set() or update() since we consider them incompatible - * with transactions. - * - * @param path - Path for which we want to abort related transactions. - */ -function repoAbortTransactions(repo, path) { - var affectedPath = treeGetPath(repoGetAncestorTransactionNode(repo, path)); - var transactionNode = treeSubTree(repo.transactionQueueTree_, path); - treeForEachAncestor(transactionNode, function (node) { - repoAbortTransactionsOnNode(repo, node); - }); - repoAbortTransactionsOnNode(repo, transactionNode); - treeForEachDescendant(transactionNode, function (node) { - repoAbortTransactionsOnNode(repo, node); - }); - return affectedPath; -} -/** - * Abort transactions stored in this transaction queue node. - * - * @param node - Node to abort transactions for. - */ -function repoAbortTransactionsOnNode(repo, node) { - var queue = treeGetValue(node); - if (queue) { - // Queue up the callbacks and fire them after cleaning up all of our - // transaction state, since the callback could trigger more transactions - // or sets. - var callbacks = []; - // Go through queue. Any already-sent transactions must be marked for - // abort, while the unsent ones can be immediately aborted and removed. - var events = []; - var lastSent = -1; - for (var i = 0; i < queue.length; i++) { - if (queue[i].status === 3 /* SENT_NEEDS_ABORT */) ; - else if (queue[i].status === 1 /* SENT */) { - util.assert(lastSent === i - 1, 'All SENT items should be at beginning of queue.'); - lastSent = i; - // Mark transaction for abort when it comes back. - queue[i].status = 3 /* SENT_NEEDS_ABORT */; - queue[i].abortReason = 'set'; - } - else { - util.assert(queue[i].status === 0 /* RUN */, 'Unexpected transaction status in abort'); - // We can abort it immediately. - queue[i].unwatcher(); - events = events.concat(syncTreeAckUserWrite(repo.serverSyncTree_, queue[i].currentWriteId, true)); - if (queue[i].onComplete) { - callbacks.push(queue[i].onComplete.bind(null, new Error('set'), false, null)); - } - } - } - if (lastSent === -1) { - // We're not waiting for any sent transactions. We can clear the queue. - treeSetValue(node, undefined); - } - else { - // Remove the transactions we aborted. - queue.length = lastSent + 1; - } - // Now fire the callbacks. - eventQueueRaiseEventsForChangedPath(repo.eventQueue_, treeGetPath(node), events); - for (var i = 0; i < callbacks.length; i++) { - exceptionGuard(callbacks[i]); - } - } -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -function decodePath(pathString) { - var pathStringDecoded = ''; - var pieces = pathString.split('/'); - for (var i = 0; i < pieces.length; i++) { - if (pieces[i].length > 0) { - var piece = pieces[i]; - try { - piece = decodeURIComponent(piece.replace(/\+/g, ' ')); - } - catch (e) { } - pathStringDecoded += '/' + piece; - } - } - return pathStringDecoded; -} -/** - * @returns key value hash - */ -function decodeQuery(queryString) { - var e_1, _a; - var results = {}; - if (queryString.charAt(0) === '?') { - queryString = queryString.substring(1); - } - try { - for (var _b = tslib.__values(queryString.split('&')), _c = _b.next(); !_c.done; _c = _b.next()) { - var segment = _c.value; - if (segment.length === 0) { - continue; - } - var kv = segment.split('='); - if (kv.length === 2) { - results[decodeURIComponent(kv[0])] = decodeURIComponent(kv[1]); - } - else { - warn$1("Invalid query segment '" + segment + "' in query '" + queryString + "'"); - } - } - } - catch (e_1_1) { e_1 = { error: e_1_1 }; } - finally { - try { - if (_c && !_c.done && (_a = _b.return)) _a.call(_b); - } - finally { if (e_1) throw e_1.error; } - } - return results; -} -var parseRepoInfo = function (dataURL, nodeAdmin) { - var parsedUrl = parseDatabaseURL(dataURL), namespace = parsedUrl.namespace; - if (parsedUrl.domain === 'firebase.com') { - fatal(parsedUrl.host + - ' is no longer supported. ' + - 'Please use .firebaseio.com instead'); - } - // Catch common error of uninitialized namespace value. - if ((!namespace || namespace === 'undefined') && - parsedUrl.domain !== 'localhost') { - fatal('Cannot parse Firebase url. Please use https://.firebaseio.com'); - } - if (!parsedUrl.secure) { - warnIfPageIsSecure(); - } - var webSocketOnly = parsedUrl.scheme === 'ws' || parsedUrl.scheme === 'wss'; - return { - repoInfo: new RepoInfo(parsedUrl.host, parsedUrl.secure, namespace, webSocketOnly, nodeAdmin, - /*persistenceKey=*/ '', - /*includeNamespaceInQueryParams=*/ namespace !== parsedUrl.subdomain), - path: new Path(parsedUrl.pathString) - }; -}; -var parseDatabaseURL = function (dataURL) { - // Default to empty strings in the event of a malformed string. - var host = '', domain = '', subdomain = '', pathString = '', namespace = ''; - // Always default to SSL, unless otherwise specified. - var secure = true, scheme = 'https', port = 443; - // Don't do any validation here. The caller is responsible for validating the result of parsing. - if (typeof dataURL === 'string') { - // Parse scheme. - var colonInd = dataURL.indexOf('//'); - if (colonInd >= 0) { - scheme = dataURL.substring(0, colonInd - 1); - dataURL = dataURL.substring(colonInd + 2); - } - // Parse host, path, and query string. - var slashInd = dataURL.indexOf('/'); - if (slashInd === -1) { - slashInd = dataURL.length; - } - var questionMarkInd = dataURL.indexOf('?'); - if (questionMarkInd === -1) { - questionMarkInd = dataURL.length; - } - host = dataURL.substring(0, Math.min(slashInd, questionMarkInd)); - if (slashInd < questionMarkInd) { - // For pathString, questionMarkInd will always come after slashInd - pathString = decodePath(dataURL.substring(slashInd, questionMarkInd)); - } - var queryParams = decodeQuery(dataURL.substring(Math.min(dataURL.length, questionMarkInd))); - // If we have a port, use scheme for determining if it's secure. - colonInd = host.indexOf(':'); - if (colonInd >= 0) { - secure = scheme === 'https' || scheme === 'wss'; - port = parseInt(host.substring(colonInd + 1), 10); - } - else { - colonInd = host.length; - } - var hostWithoutPort = host.slice(0, colonInd); - if (hostWithoutPort.toLowerCase() === 'localhost') { - domain = 'localhost'; - } - else if (hostWithoutPort.split('.').length <= 2) { - domain = hostWithoutPort; - } - else { - // Interpret the subdomain of a 3 or more component URL as the namespace name. - var dotInd = host.indexOf('.'); - subdomain = host.substring(0, dotInd).toLowerCase(); - domain = host.substring(dotInd + 1); - // Normalize namespaces to lowercase to share storage / connection. - namespace = subdomain; - } - // Always treat the value of the `ns` as the namespace name if it is present. - if ('ns' in queryParams) { - namespace = queryParams['ns']; - } - } - return { - host: host, - port: port, - domain: domain, - subdomain: subdomain, - secure: secure, - scheme: scheme, - pathString: pathString, - namespace: namespace - }; -}; - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Encapsulates the data needed to raise an event - */ -var DataEvent = /** @class */ (function () { - /** - * @param eventType - One of: value, child_added, child_changed, child_moved, child_removed - * @param eventRegistration - The function to call to with the event data. User provided - * @param snapshot - The data backing the event - * @param prevName - Optional, the name of the previous child for child_* events. - */ - function DataEvent(eventType, eventRegistration, snapshot, prevName) { - this.eventType = eventType; - this.eventRegistration = eventRegistration; - this.snapshot = snapshot; - this.prevName = prevName; - } - DataEvent.prototype.getPath = function () { - var ref = this.snapshot.ref; - if (this.eventType === 'value') { - return ref._path; - } - else { - return ref.parent._path; - } - }; - DataEvent.prototype.getEventType = function () { - return this.eventType; - }; - DataEvent.prototype.getEventRunner = function () { - return this.eventRegistration.getEventRunner(this); - }; - DataEvent.prototype.toString = function () { - return (this.getPath().toString() + - ':' + - this.eventType + - ':' + - util.stringify(this.snapshot.exportVal())); - }; - return DataEvent; -}()); -var CancelEvent = /** @class */ (function () { - function CancelEvent(eventRegistration, error, path) { - this.eventRegistration = eventRegistration; - this.error = error; - this.path = path; - } - CancelEvent.prototype.getPath = function () { - return this.path; - }; - CancelEvent.prototype.getEventType = function () { - return 'cancel'; - }; - CancelEvent.prototype.getEventRunner = function () { - return this.eventRegistration.getEventRunner(this); - }; - CancelEvent.prototype.toString = function () { - return this.path.toString() + ':cancel'; - }; - return CancelEvent; -}()); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * A wrapper class that converts events from the database@exp SDK to the legacy - * Database SDK. Events are not converted directly as event registration relies - * on reference comparison of the original user callback (see `matches()`) and - * relies on equality of the legacy SDK's `context` object. - */ -var CallbackContext = /** @class */ (function () { - function CallbackContext(snapshotCallback, cancelCallback) { - this.snapshotCallback = snapshotCallback; - this.cancelCallback = cancelCallback; - } - CallbackContext.prototype.onValue = function (expDataSnapshot, previousChildName) { - this.snapshotCallback.call(null, expDataSnapshot, previousChildName); - }; - CallbackContext.prototype.onCancel = function (error) { - util.assert(this.hasCancelCallback, 'Raising a cancel event on a listener with no cancel callback'); - return this.cancelCallback.call(null, error); - }; - Object.defineProperty(CallbackContext.prototype, "hasCancelCallback", { - get: function () { - return !!this.cancelCallback; - }, - enumerable: false, - configurable: true - }); - CallbackContext.prototype.matches = function (other) { - return (this.snapshotCallback === other.snapshotCallback || - (this.snapshotCallback.userCallback !== undefined && - this.snapshotCallback.userCallback === - other.snapshotCallback.userCallback && - this.snapshotCallback.context === other.snapshotCallback.context)); - }; - return CallbackContext; -}()); - -/** - * @license - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * The `onDisconnect` class allows you to write or clear data when your client - * disconnects from the Database server. These updates occur whether your - * client disconnects cleanly or not, so you can rely on them to clean up data - * even if a connection is dropped or a client crashes. - * - * The `onDisconnect` class is most commonly used to manage presence in - * applications where it is useful to detect how many clients are connected and - * when other clients disconnect. See - * {@link https://firebase.google.com/docs/database/web/offline-capabilities | Enabling Offline Capabilities in JavaScript} - * for more information. - * - * To avoid problems when a connection is dropped before the requests can be - * transferred to the Database server, these functions should be called before - * writing any data. - * - * Note that `onDisconnect` operations are only triggered once. If you want an - * operation to occur each time a disconnect occurs, you'll need to re-establish - * the `onDisconnect` operations each time you reconnect. - */ -var OnDisconnect$1 = /** @class */ (function () { - /** @hideconstructor */ - function OnDisconnect(_repo, _path) { - this._repo = _repo; - this._path = _path; - } - /** - * Cancels all previously queued `onDisconnect()` set or update events for this - * location and all children. - * - * If a write has been queued for this location via a `set()` or `update()` at a - * parent location, the write at this location will be canceled, though writes - * to sibling locations will still occur. - * - * @returns Resolves when synchronization to the server is complete. - */ - OnDisconnect.prototype.cancel = function () { - var deferred = new util.Deferred(); - repoOnDisconnectCancel(this._repo, this._path, deferred.wrapCallback(function () { })); - return deferred.promise; - }; - /** - * Ensures the data at this location is deleted when the client is disconnected - * (due to closing the browser, navigating to a new page, or network issues). - * - * @returns Resolves when synchronization to the server is complete. - */ - OnDisconnect.prototype.remove = function () { - validateWritablePath('OnDisconnect.remove', this._path); - var deferred = new util.Deferred(); - repoOnDisconnectSet(this._repo, this._path, null, deferred.wrapCallback(function () { })); - return deferred.promise; - }; - /** - * Ensures the data at this location is set to the specified value when the - * client is disconnected (due to closing the browser, navigating to a new page, - * or network issues). - * - * `set()` is especially useful for implementing "presence" systems, where a - * value should be changed or cleared when a user disconnects so that they - * appear "offline" to other users. See - * {@link https://firebase.google.com/docs/database/web/offline-capabilities | Enabling Offline Capabilities in JavaScript} - * for more information. - * - * Note that `onDisconnect` operations are only triggered once. If you want an - * operation to occur each time a disconnect occurs, you'll need to re-establish - * the `onDisconnect` operations each time. - * - * @param value - The value to be written to this location on disconnect (can - * be an object, array, string, number, boolean, or null). - * @returns Resolves when synchronization to the Database is complete. - */ - OnDisconnect.prototype.set = function (value) { - validateWritablePath('OnDisconnect.set', this._path); - validateFirebaseDataArg('OnDisconnect.set', value, this._path, false); - var deferred = new util.Deferred(); - repoOnDisconnectSet(this._repo, this._path, value, deferred.wrapCallback(function () { })); - return deferred.promise; - }; - /** - * Ensures the data at this location is set to the specified value and priority - * when the client is disconnected (due to closing the browser, navigating to a - * new page, or network issues). - * - * @param value - The value to be written to this location on disconnect (can - * be an object, array, string, number, boolean, or null). - * @param priority - The priority to be written (string, number, or null). - * @returns Resolves when synchronization to the Database is complete. - */ - OnDisconnect.prototype.setWithPriority = function (value, priority) { - validateWritablePath('OnDisconnect.setWithPriority', this._path); - validateFirebaseDataArg('OnDisconnect.setWithPriority', value, this._path, false); - validatePriority('OnDisconnect.setWithPriority', priority, false); - var deferred = new util.Deferred(); - repoOnDisconnectSetWithPriority(this._repo, this._path, value, priority, deferred.wrapCallback(function () { })); - return deferred.promise; - }; - /** - * Writes multiple values at this location when the client is disconnected (due - * to closing the browser, navigating to a new page, or network issues). - * - * The `values` argument contains multiple property-value pairs that will be - * written to the Database together. Each child property can either be a simple - * property (for example, "name") or a relative path (for example, "name/first") - * from the current location to the data to update. - * - * As opposed to the `set()` method, `update()` can be use to selectively update - * only the referenced properties at the current location (instead of replacing - * all the child properties at the current location). - * - * @param values - Object containing multiple values. - * @returns Resolves when synchronization to the Database is complete. - */ - OnDisconnect.prototype.update = function (values) { - validateWritablePath('OnDisconnect.update', this._path); - validateFirebaseMergeDataArg('OnDisconnect.update', values, this._path, false); - var deferred = new util.Deferred(); - repoOnDisconnectUpdate(this._repo, this._path, values, deferred.wrapCallback(function () { })); - return deferred.promise; - }; - return OnDisconnect; -}()); - -/** - * @license - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * @internal - */ -var QueryImpl = /** @class */ (function () { - /** - * @hideconstructor - */ - function QueryImpl(_repo, _path, _queryParams, _orderByCalled) { - this._repo = _repo; - this._path = _path; - this._queryParams = _queryParams; - this._orderByCalled = _orderByCalled; - } - Object.defineProperty(QueryImpl.prototype, "key", { - get: function () { - if (pathIsEmpty(this._path)) { - return null; - } - else { - return pathGetBack(this._path); - } - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(QueryImpl.prototype, "ref", { - get: function () { - return new ReferenceImpl(this._repo, this._path); - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(QueryImpl.prototype, "_queryIdentifier", { - get: function () { - var obj = queryParamsGetQueryObject(this._queryParams); - var id = ObjectToUniqueKey(obj); - return id === '{}' ? 'default' : id; - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(QueryImpl.prototype, "_queryObject", { - /** - * An object representation of the query parameters used by this Query. - */ - get: function () { - return queryParamsGetQueryObject(this._queryParams); - }, - enumerable: false, - configurable: true - }); - QueryImpl.prototype.isEqual = function (other) { - other = util.getModularInstance(other); - if (!(other instanceof QueryImpl)) { - return false; - } - var sameRepo = this._repo === other._repo; - var samePath = pathEquals(this._path, other._path); - var sameQueryIdentifier = this._queryIdentifier === other._queryIdentifier; - return sameRepo && samePath && sameQueryIdentifier; - }; - QueryImpl.prototype.toJSON = function () { - return this.toString(); - }; - QueryImpl.prototype.toString = function () { - return this._repo.toString() + pathToUrlEncodedString(this._path); - }; - return QueryImpl; -}()); -/** - * Validates that no other order by call has been made - */ -function validateNoPreviousOrderByCall(query, fnName) { - if (query._orderByCalled === true) { - throw new Error(fnName + ": You can't combine multiple orderBy calls."); - } -} -/** - * Validates start/end values for queries. - */ -function validateQueryEndpoints(params) { - var startNode = null; - var endNode = null; - if (params.hasStart()) { - startNode = params.getIndexStartValue(); - } - if (params.hasEnd()) { - endNode = params.getIndexEndValue(); - } - if (params.getIndex() === KEY_INDEX) { - var tooManyArgsError = 'Query: When ordering by key, you may only pass one argument to ' + - 'startAt(), endAt(), or equalTo().'; - var wrongArgTypeError = 'Query: When ordering by key, the argument passed to startAt(), startAfter(), ' + - 'endAt(), endBefore(), or equalTo() must be a string.'; - if (params.hasStart()) { - var startName = params.getIndexStartName(); - if (startName !== MIN_NAME) { - throw new Error(tooManyArgsError); - } - else if (typeof startNode !== 'string') { - throw new Error(wrongArgTypeError); - } - } - if (params.hasEnd()) { - var endName = params.getIndexEndName(); - if (endName !== MAX_NAME) { - throw new Error(tooManyArgsError); - } - else if (typeof endNode !== 'string') { - throw new Error(wrongArgTypeError); - } - } - } - else if (params.getIndex() === PRIORITY_INDEX) { - if ((startNode != null && !isValidPriority(startNode)) || - (endNode != null && !isValidPriority(endNode))) { - throw new Error('Query: When ordering by priority, the first argument passed to startAt(), ' + - 'startAfter() endAt(), endBefore(), or equalTo() must be a valid priority value ' + - '(null, a number, or a string).'); - } - } - else { - util.assert(params.getIndex() instanceof PathIndex || - params.getIndex() === VALUE_INDEX, 'unknown index type.'); - if ((startNode != null && typeof startNode === 'object') || - (endNode != null && typeof endNode === 'object')) { - throw new Error('Query: First argument passed to startAt(), startAfter(), endAt(), endBefore(), or ' + - 'equalTo() cannot be an object.'); - } - } -} -/** - * Validates that limit* has been called with the correct combination of parameters - */ -function validateLimit(params) { - if (params.hasStart() && - params.hasEnd() && - params.hasLimit() && - !params.hasAnchoredLimit()) { - throw new Error("Query: Can't combine startAt(), startAfter(), endAt(), endBefore(), and limit(). Use " + - 'limitToFirst() or limitToLast() instead.'); - } -} -/** - * @internal - */ -var ReferenceImpl = /** @class */ (function (_super) { - tslib.__extends(ReferenceImpl, _super); - /** @hideconstructor */ - function ReferenceImpl(repo, path) { - return _super.call(this, repo, path, new QueryParams(), false) || this; - } - Object.defineProperty(ReferenceImpl.prototype, "parent", { - get: function () { - var parentPath = pathParent(this._path); - return parentPath === null - ? null - : new ReferenceImpl(this._repo, parentPath); - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(ReferenceImpl.prototype, "root", { - get: function () { - var ref = this; - while (ref.parent !== null) { - ref = ref.parent; - } - return ref; - }, - enumerable: false, - configurable: true - }); - return ReferenceImpl; -}(QueryImpl)); -/** - * A `DataSnapshot` contains data from a Database location. - * - * Any time you read data from the Database, you receive the data as a - * `DataSnapshot`. A `DataSnapshot` is passed to the event callbacks you attach - * with `on()` or `once()`. You can extract the contents of the snapshot as a - * JavaScript object by calling the `val()` method. Alternatively, you can - * traverse into the snapshot by calling `child()` to return child snapshots - * (which you could then call `val()` on). - * - * A `DataSnapshot` is an efficiently generated, immutable copy of the data at - * a Database location. It cannot be modified and will never change (to modify - * data, you always call the `set()` method on a `Reference` directly). - */ -var DataSnapshot$1 = /** @class */ (function () { - /** - * @param _node - A SnapshotNode to wrap. - * @param ref - The location this snapshot came from. - * @param _index - The iteration order for this snapshot - * @hideconstructor - */ - function DataSnapshot(_node, - /** - * The location of this DataSnapshot. - */ - ref, _index) { - this._node = _node; - this.ref = ref; - this._index = _index; - } - Object.defineProperty(DataSnapshot.prototype, "priority", { - /** - * Gets the priority value of the data in this `DataSnapshot`. - * - * Applications need not use priority but can order collections by - * ordinary properties (see - * {@link https://firebase.google.com/docs/database/web/lists-of-data#sorting_and_filtering_data |Sorting and filtering data} - * ). - */ - get: function () { - // typecast here because we never return deferred values or internal priorities (MAX_PRIORITY) - return this._node.getPriority().val(); - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(DataSnapshot.prototype, "key", { - /** - * The key (last part of the path) of the location of this `DataSnapshot`. - * - * The last token in a Database location is considered its key. For example, - * "ada" is the key for the /users/ada/ node. Accessing the key on any - * `DataSnapshot` will return the key for the location that generated it. - * However, accessing the key on the root URL of a Database will return - * `null`. - */ - get: function () { - return this.ref.key; - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(DataSnapshot.prototype, "size", { - /** Returns the number of child properties of this `DataSnapshot`. */ - get: function () { - return this._node.numChildren(); - }, - enumerable: false, - configurable: true - }); - /** - * Gets another `DataSnapshot` for the location at the specified relative path. - * - * Passing a relative path to the `child()` method of a DataSnapshot returns - * another `DataSnapshot` for the location at the specified relative path. The - * relative path can either be a simple child name (for example, "ada") or a - * deeper, slash-separated path (for example, "ada/name/first"). If the child - * location has no data, an empty `DataSnapshot` (that is, a `DataSnapshot` - * whose value is `null`) is returned. - * - * @param path - A relative path to the location of child data. - */ - DataSnapshot.prototype.child = function (path) { - var childPath = new Path(path); - var childRef = child(this.ref, path); - return new DataSnapshot(this._node.getChild(childPath), childRef, PRIORITY_INDEX); - }; - /** - * Returns true if this `DataSnapshot` contains any data. It is slightly more - * efficient than using `snapshot.val() !== null`. - */ - DataSnapshot.prototype.exists = function () { - return !this._node.isEmpty(); - }; - /** - * Exports the entire contents of the DataSnapshot as a JavaScript object. - * - * The `exportVal()` method is similar to `val()`, except priority information - * is included (if available), making it suitable for backing up your data. - * - * @returns The DataSnapshot's contents as a JavaScript value (Object, - * Array, string, number, boolean, or `null`). - */ - // eslint-disable-next-line @typescript-eslint/no-explicit-any - DataSnapshot.prototype.exportVal = function () { - return this._node.val(true); - }; - /** - * Enumerates the top-level children in the `DataSnapshot`. - * - * Because of the way JavaScript objects work, the ordering of data in the - * JavaScript object returned by `val()` is not guaranteed to match the - * ordering on the server nor the ordering of `onChildAdded()` events. That is - * where `forEach()` comes in handy. It guarantees the children of a - * `DataSnapshot` will be iterated in their query order. - * - * If no explicit `orderBy*()` method is used, results are returned - * ordered by key (unless priorities are used, in which case, results are - * returned by priority). - * - * @param action - A function that will be called for each child DataSnapshot. - * The callback can return true to cancel further enumeration. - * @returns true if enumeration was canceled due to your callback returning - * true. - */ - DataSnapshot.prototype.forEach = function (action) { - var _this = this; - if (this._node.isLeafNode()) { - return false; - } - var childrenNode = this._node; - // Sanitize the return value to a boolean. ChildrenNode.forEachChild has a weird return type... - return !!childrenNode.forEachChild(this._index, function (key, node) { - return action(new DataSnapshot(node, child(_this.ref, key), PRIORITY_INDEX)); - }); - }; - /** - * Returns true if the specified child path has (non-null) data. - * - * @param path - A relative path to the location of a potential child. - * @returns `true` if data exists at the specified child path; else - * `false`. - */ - DataSnapshot.prototype.hasChild = function (path) { - var childPath = new Path(path); - return !this._node.getChild(childPath).isEmpty(); - }; - /** - * Returns whether or not the `DataSnapshot` has any non-`null` child - * properties. - * - * You can use `hasChildren()` to determine if a `DataSnapshot` has any - * children. If it does, you can enumerate them using `forEach()`. If it - * doesn't, then either this snapshot contains a primitive value (which can be - * retrieved with `val()`) or it is empty (in which case, `val()` will return - * `null`). - * - * @returns true if this snapshot has any children; else false. - */ - DataSnapshot.prototype.hasChildren = function () { - if (this._node.isLeafNode()) { - return false; - } - else { - return !this._node.isEmpty(); - } - }; - /** - * Returns a JSON-serializable representation of this object. - */ - DataSnapshot.prototype.toJSON = function () { - return this.exportVal(); - }; - /** - * Extracts a JavaScript value from a `DataSnapshot`. - * - * Depending on the data in a `DataSnapshot`, the `val()` method may return a - * scalar type (string, number, or boolean), an array, or an object. It may - * also return null, indicating that the `DataSnapshot` is empty (contains no - * data). - * - * @returns The DataSnapshot's contents as a JavaScript value (Object, - * Array, string, number, boolean, or `null`). - */ - // eslint-disable-next-line @typescript-eslint/no-explicit-any - DataSnapshot.prototype.val = function () { - return this._node.val(); - }; - return DataSnapshot; -}()); -/** - * - * Returns a `Reference` representing the location in the Database - * corresponding to the provided path. If no path is provided, the `Reference` - * will point to the root of the Database. - * - * @param db - The database instance to obtain a reference for. - * @param path - Optional path representing the location the returned - * `Reference` will point. If not provided, the returned `Reference` will - * point to the root of the Database. - * @returns If a path is provided, a `Reference` - * pointing to the provided path. Otherwise, a `Reference` pointing to the - * root of the Database. - */ -function ref(db, path) { - db = util.getModularInstance(db); - db._checkNotDeleted('ref'); - return path !== undefined ? child(db._root, path) : db._root; -} -/** - * Returns a `Reference` representing the location in the Database - * corresponding to the provided Firebase URL. - * - * An exception is thrown if the URL is not a valid Firebase Database URL or it - * has a different domain than the current `Database` instance. - * - * Note that all query parameters (`orderBy`, `limitToLast`, etc.) are ignored - * and are not applied to the returned `Reference`. - * - * @param db - The database instance to obtain a reference for. - * @param url - The Firebase URL at which the returned `Reference` will - * point. - * @returns A `Reference` pointing to the provided - * Firebase URL. - */ -function refFromURL(db, url) { - db = util.getModularInstance(db); - db._checkNotDeleted('refFromURL'); - var parsedURL = parseRepoInfo(url, db._repo.repoInfo_.nodeAdmin); - validateUrl('refFromURL', parsedURL); - var repoInfo = parsedURL.repoInfo; - if (!db._repo.repoInfo_.isCustomHost() && - repoInfo.host !== db._repo.repoInfo_.host) { - fatal('refFromURL' + - ': Host name does not match the current database: ' + - '(found ' + - repoInfo.host + - ' but expected ' + - db._repo.repoInfo_.host + - ')'); - } - return ref(db, parsedURL.path.toString()); -} -/** - * Gets a `Reference` for the location at the specified relative path. - * - * The relative path can either be a simple child name (for example, "ada") or - * a deeper slash-separated path (for example, "ada/name/first"). - * - * @param parent - The parent location. - * @param path - A relative path from this location to the desired child - * location. - * @returns The specified child location. - */ -function child(parent, path) { - parent = util.getModularInstance(parent); - if (pathGetFront(parent._path) === null) { - validateRootPathString('child', 'path', path, false); - } - else { - validatePathString('child', 'path', path, false); - } - return new ReferenceImpl(parent._repo, pathChild(parent._path, path)); -} -/** - * Returns an `OnDisconnect` object - see - * {@link https://firebase.google.com/docs/database/web/offline-capabilities | Enabling Offline Capabilities in JavaScript} - * for more information on how to use it. - * - * @param ref - The reference to add OnDisconnect triggers for. - */ -function onDisconnect(ref) { - ref = util.getModularInstance(ref); - return new OnDisconnect$1(ref._repo, ref._path); -} -/** - * Generates a new child location using a unique key and returns its - * `Reference`. - * - * This is the most common pattern for adding data to a collection of items. - * - * If you provide a value to `push()`, the value is written to the - * generated location. If you don't pass a value, nothing is written to the - * database and the child remains empty (but you can use the `Reference` - * elsewhere). - * - * The unique keys generated by `push()` are ordered by the current time, so the - * resulting list of items is chronologically sorted. The keys are also - * designed to be unguessable (they contain 72 random bits of entropy). - * - * See {@link https://firebase.google.com/docs/database/web/lists-of-data#append_to_a_list_of_data | Append to a list of data}. - * See {@link https://firebase.googleblog.com/2015/02/the-2120-ways-to-ensure-unique_68.html | The 2^120 Ways to Ensure Unique Identifiers}. - * - * @param parent - The parent location. - * @param value - Optional value to be written at the generated location. - * @returns Combined `Promise` and `Reference`; resolves when write is complete, - * but can be used immediately as the `Reference` to the child location. - */ -function push(parent, value) { - parent = util.getModularInstance(parent); - validateWritablePath('push', parent._path); - validateFirebaseDataArg('push', value, parent._path, true); - var now = repoServerTime(parent._repo); - var name = nextPushId(now); - // push() returns a ThennableReference whose promise is fulfilled with a - // regular Reference. We use child() to create handles to two different - // references. The first is turned into a ThennableReference below by adding - // then() and catch() methods and is used as the return value of push(). The - // second remains a regular Reference and is used as the fulfilled value of - // the first ThennableReference. - var thennablePushRef = child(parent, name); - var pushRef = child(parent, name); - var promise; - if (value != null) { - promise = set(pushRef, value).then(function () { return pushRef; }); - } - else { - promise = Promise.resolve(pushRef); - } - thennablePushRef.then = promise.then.bind(promise); - thennablePushRef.catch = promise.then.bind(promise, undefined); - return thennablePushRef; -} -/** - * Removes the data at this Database location. - * - * Any data at child locations will also be deleted. - * - * The effect of the remove will be visible immediately and the corresponding - * event 'value' will be triggered. Synchronization of the remove to the - * Firebase servers will also be started, and the returned Promise will resolve - * when complete. If provided, the onComplete callback will be called - * asynchronously after synchronization has finished. - * - * @param ref - The location to remove. - * @returns Resolves when remove on server is complete. - */ -function remove(ref) { - validateWritablePath('remove', ref._path); - return set(ref, null); -} -/** - * Writes data to this Database location. - * - * This will overwrite any data at this location and all child locations. - * - * The effect of the write will be visible immediately, and the corresponding - * events ("value", "child_added", etc.) will be triggered. Synchronization of - * the data to the Firebase servers will also be started, and the returned - * Promise will resolve when complete. If provided, the `onComplete` callback - * will be called asynchronously after synchronization has finished. - * - * Passing `null` for the new value is equivalent to calling `remove()`; namely, - * all data at this location and all child locations will be deleted. - * - * `set()` will remove any priority stored at this location, so if priority is - * meant to be preserved, you need to use `setWithPriority()` instead. - * - * Note that modifying data with `set()` will cancel any pending transactions - * at that location, so extreme care should be taken if mixing `set()` and - * `transaction()` to modify the same data. - * - * A single `set()` will generate a single "value" event at the location where - * the `set()` was performed. - * - * @param ref - The location to write to. - * @param value - The value to be written (string, number, boolean, object, - * array, or null). - * @returns Resolves when write to server is complete. - */ -function set(ref, value) { - ref = util.getModularInstance(ref); - validateWritablePath('set', ref._path); - validateFirebaseDataArg('set', value, ref._path, false); - var deferred = new util.Deferred(); - repoSetWithPriority(ref._repo, ref._path, value, - /*priority=*/ null, deferred.wrapCallback(function () { })); - return deferred.promise; -} -/** - * Sets a priority for the data at this Database location. - * - * Applications need not use priority but can order collections by - * ordinary properties (see - * {@link https://firebase.google.com/docs/database/web/lists-of-data#sorting_and_filtering_data | Sorting and filtering data} - * ). - * - * @param ref - The location to write to. - * @param priority - The priority to be written (string, number, or null). - * @returns Resolves when write to server is complete. - */ -function setPriority(ref, priority) { - ref = util.getModularInstance(ref); - validateWritablePath('setPriority', ref._path); - validatePriority('setPriority', priority, false); - var deferred = new util.Deferred(); - repoSetWithPriority(ref._repo, pathChild(ref._path, '.priority'), priority, null, deferred.wrapCallback(function () { })); - return deferred.promise; -} -/** - * Writes data the Database location. Like `set()` but also specifies the - * priority for that data. - * - * Applications need not use priority but can order collections by - * ordinary properties (see - * {@link https://firebase.google.com/docs/database/web/lists-of-data#sorting_and_filtering_data | Sorting and filtering data} - * ). - * - * @param ref - The location to write to. - * @param value - The value to be written (string, number, boolean, object, - * array, or null). - * @param priority - The priority to be written (string, number, or null). - * @returns Resolves when write to server is complete. - */ -function setWithPriority(ref, value, priority) { - validateWritablePath('setWithPriority', ref._path); - validateFirebaseDataArg('setWithPriority', value, ref._path, false); - validatePriority('setWithPriority', priority, false); - if (ref.key === '.length' || ref.key === '.keys') { - throw 'setWithPriority failed: ' + ref.key + ' is a read-only object.'; - } - var deferred = new util.Deferred(); - repoSetWithPriority(ref._repo, ref._path, value, priority, deferred.wrapCallback(function () { })); - return deferred.promise; -} -/** - * Writes multiple values to the Database at once. - * - * The `values` argument contains multiple property-value pairs that will be - * written to the Database together. Each child property can either be a simple - * property (for example, "name") or a relative path (for example, - * "name/first") from the current location to the data to update. - * - * As opposed to the `set()` method, `update()` can be use to selectively update - * only the referenced properties at the current location (instead of replacing - * all the child properties at the current location). - * - * The effect of the write will be visible immediately, and the corresponding - * events ('value', 'child_added', etc.) will be triggered. Synchronization of - * the data to the Firebase servers will also be started, and the returned - * Promise will resolve when complete. If provided, the `onComplete` callback - * will be called asynchronously after synchronization has finished. - * - * A single `update()` will generate a single "value" event at the location - * where the `update()` was performed, regardless of how many children were - * modified. - * - * Note that modifying data with `update()` will cancel any pending - * transactions at that location, so extreme care should be taken if mixing - * `update()` and `transaction()` to modify the same data. - * - * Passing `null` to `update()` will remove the data at this location. - * - * See - * {@link https://firebase.googleblog.com/2015/09/introducing-multi-location-updates-and_86.html | Introducing multi-location updates and more}. - * - * @param ref - The location to write to. - * @param values - Object containing multiple values. - * @returns Resolves when update on server is complete. - */ -function update(ref, values) { - validateFirebaseMergeDataArg('update', values, ref._path, false); - var deferred = new util.Deferred(); - repoUpdate(ref._repo, ref._path, values, deferred.wrapCallback(function () { })); - return deferred.promise; -} -/** - * Gets the most up-to-date result for this query. - * - * @param query - The query to run. - * @returns A `Promise` which resolves to the resulting DataSnapshot if a value is - * available, or rejects if the client is unable to return a value (e.g., if the - * server is unreachable and there is nothing cached). - */ -function get(query) { - query = util.getModularInstance(query); - var callbackContext = new CallbackContext(function () { }); - var container = new ValueEventRegistration(callbackContext); - return repoGetValue(query._repo, query, container).then(function (node) { - return new DataSnapshot$1(node, new ReferenceImpl(query._repo, query._path), query._queryParams.getIndex()); - }); -} -/** - * Represents registration for 'value' events. - */ -var ValueEventRegistration = /** @class */ (function () { - function ValueEventRegistration(callbackContext) { - this.callbackContext = callbackContext; - } - ValueEventRegistration.prototype.respondsTo = function (eventType) { - return eventType === 'value'; - }; - ValueEventRegistration.prototype.createEvent = function (change, query) { - var index = query._queryParams.getIndex(); - return new DataEvent('value', this, new DataSnapshot$1(change.snapshotNode, new ReferenceImpl(query._repo, query._path), index)); - }; - ValueEventRegistration.prototype.getEventRunner = function (eventData) { - var _this = this; - if (eventData.getEventType() === 'cancel') { - return function () { - return _this.callbackContext.onCancel(eventData.error); - }; - } - else { - return function () { - return _this.callbackContext.onValue(eventData.snapshot, null); - }; - } - }; - ValueEventRegistration.prototype.createCancelEvent = function (error, path) { - if (this.callbackContext.hasCancelCallback) { - return new CancelEvent(this, error, path); - } - else { - return null; - } - }; - ValueEventRegistration.prototype.matches = function (other) { - if (!(other instanceof ValueEventRegistration)) { - return false; - } - else if (!other.callbackContext || !this.callbackContext) { - // If no callback specified, we consider it to match any callback. - return true; - } - else { - return other.callbackContext.matches(this.callbackContext); - } - }; - ValueEventRegistration.prototype.hasAnyCallback = function () { - return this.callbackContext !== null; - }; - return ValueEventRegistration; -}()); -/** - * Represents the registration of a child_x event. - */ -var ChildEventRegistration = /** @class */ (function () { - function ChildEventRegistration(eventType, callbackContext) { - this.eventType = eventType; - this.callbackContext = callbackContext; - } - ChildEventRegistration.prototype.respondsTo = function (eventType) { - var eventToCheck = eventType === 'children_added' ? 'child_added' : eventType; - eventToCheck = - eventToCheck === 'children_removed' ? 'child_removed' : eventToCheck; - return this.eventType === eventToCheck; - }; - ChildEventRegistration.prototype.createCancelEvent = function (error, path) { - if (this.callbackContext.hasCancelCallback) { - return new CancelEvent(this, error, path); - } - else { - return null; - } - }; - ChildEventRegistration.prototype.createEvent = function (change, query) { - util.assert(change.childName != null, 'Child events should have a childName.'); - var childRef = child(new ReferenceImpl(query._repo, query._path), change.childName); - var index = query._queryParams.getIndex(); - return new DataEvent(change.type, this, new DataSnapshot$1(change.snapshotNode, childRef, index), change.prevName); - }; - ChildEventRegistration.prototype.getEventRunner = function (eventData) { - var _this = this; - if (eventData.getEventType() === 'cancel') { - return function () { - return _this.callbackContext.onCancel(eventData.error); - }; - } - else { - return function () { - return _this.callbackContext.onValue(eventData.snapshot, eventData.prevName); - }; - } - }; - ChildEventRegistration.prototype.matches = function (other) { - if (other instanceof ChildEventRegistration) { - return (this.eventType === other.eventType && - (!this.callbackContext || - !other.callbackContext || - this.callbackContext.matches(other.callbackContext))); - } - return false; - }; - ChildEventRegistration.prototype.hasAnyCallback = function () { - return !!this.callbackContext; - }; - return ChildEventRegistration; -}()); -function addEventListener(query, eventType, callback, cancelCallbackOrListenOptions, options) { - var cancelCallback; - if (typeof cancelCallbackOrListenOptions === 'object') { - cancelCallback = undefined; - options = cancelCallbackOrListenOptions; - } - if (typeof cancelCallbackOrListenOptions === 'function') { - cancelCallback = cancelCallbackOrListenOptions; - } - if (options && options.onlyOnce) { - var userCallback_1 = callback; - var onceCallback = function (dataSnapshot, previousChildName) { - repoRemoveEventCallbackForQuery(query._repo, query, container); - userCallback_1(dataSnapshot, previousChildName); - }; - onceCallback.userCallback = callback.userCallback; - onceCallback.context = callback.context; - callback = onceCallback; - } - var callbackContext = new CallbackContext(callback, cancelCallback || undefined); - var container = eventType === 'value' - ? new ValueEventRegistration(callbackContext) - : new ChildEventRegistration(eventType, callbackContext); - repoAddEventCallbackForQuery(query._repo, query, container); - return function () { return repoRemoveEventCallbackForQuery(query._repo, query, container); }; -} -function onValue(query, callback, cancelCallbackOrListenOptions, options) { - return addEventListener(query, 'value', callback, cancelCallbackOrListenOptions, options); -} -function onChildAdded(query, callback, cancelCallbackOrListenOptions, options) { - return addEventListener(query, 'child_added', callback, cancelCallbackOrListenOptions, options); -} -function onChildChanged(query, callback, cancelCallbackOrListenOptions, options) { - return addEventListener(query, 'child_changed', callback, cancelCallbackOrListenOptions, options); -} -function onChildMoved(query, callback, cancelCallbackOrListenOptions, options) { - return addEventListener(query, 'child_moved', callback, cancelCallbackOrListenOptions, options); -} -function onChildRemoved(query, callback, cancelCallbackOrListenOptions, options) { - return addEventListener(query, 'child_removed', callback, cancelCallbackOrListenOptions, options); -} -/** - * Detaches a callback previously attached with the corresponding `on*()` (`onValue`, `onChildAdded`) listener. - * Note: This is not the recommended way to remove a listener. Instead, please use the returned callback function from - * the respective `on*` callbacks. - * - * Detach a callback previously attached with `on*()`. Calling `off()` on a parent listener - * will not automatically remove listeners registered on child nodes, `off()` - * must also be called on any child listeners to remove the callback. - * - * If a callback is not specified, all callbacks for the specified eventType - * will be removed. Similarly, if no eventType is specified, all callbacks - * for the `Reference` will be removed. - * - * Individual listeners can also be removed by invoking their unsubscribe - * callbacks. - * - * @param query - The query that the listener was registered with. - * @param eventType - One of the following strings: "value", "child_added", - * "child_changed", "child_removed", or "child_moved." If omitted, all callbacks - * for the `Reference` will be removed. - * @param callback - The callback function that was passed to `on()` or - * `undefined` to remove all callbacks. - */ -function off(query, eventType, callback) { - var container = null; - var expCallback = callback ? new CallbackContext(callback) : null; - if (eventType === 'value') { - container = new ValueEventRegistration(expCallback); - } - else if (eventType) { - container = new ChildEventRegistration(eventType, expCallback); - } - repoRemoveEventCallbackForQuery(query._repo, query, container); -} -/** - * A `QueryConstraint` is used to narrow the set of documents returned by a - * Database query. `QueryConstraint`s are created by invoking {@link endAt}, - * {@link endBefore}, {@link startAt}, {@link startAfter}, {@link - * limitToFirst}, {@link limitToLast}, {@link orderByChild}, - * {@link orderByChild}, {@link orderByKey} , {@link orderByPriority} , - * {@link orderByValue} or {@link equalTo} and - * can then be passed to {@link query} to create a new query instance that - * also contains this `QueryConstraint`. - */ -var QueryConstraint = /** @class */ (function () { - function QueryConstraint() { - } - return QueryConstraint; -}()); -var QueryEndAtConstraint = /** @class */ (function (_super) { - tslib.__extends(QueryEndAtConstraint, _super); - function QueryEndAtConstraint(_value, _key) { - var _this = _super.call(this) || this; - _this._value = _value; - _this._key = _key; - return _this; - } - QueryEndAtConstraint.prototype._apply = function (query) { - validateFirebaseDataArg('endAt', this._value, query._path, true); - var newParams = queryParamsEndAt(query._queryParams, this._value, this._key); - validateLimit(newParams); - validateQueryEndpoints(newParams); - if (query._queryParams.hasEnd()) { - throw new Error('endAt: Starting point was already set (by another call to endAt, ' + - 'endBefore or equalTo).'); - } - return new QueryImpl(query._repo, query._path, newParams, query._orderByCalled); - }; - return QueryEndAtConstraint; -}(QueryConstraint)); -/** - * Creates a `QueryConstraint` with the specified ending point. - * - * Using `startAt()`, `startAfter()`, `endBefore()`, `endAt()` and `equalTo()` - * allows you to choose arbitrary starting and ending points for your queries. - * - * The ending point is inclusive, so children with exactly the specified value - * will be included in the query. The optional key argument can be used to - * further limit the range of the query. If it is specified, then children that - * have exactly the specified value must also have a key name less than or equal - * to the specified key. - * - * You can read more about `endAt()` in - * {@link https://firebase.google.com/docs/database/web/lists-of-data#filtering_data | Filtering data}. - * - * @param value - The value to end at. The argument type depends on which - * `orderBy*()` function was used in this query. Specify a value that matches - * the `orderBy*()` type. When used in combination with `orderByKey()`, the - * value must be a string. - * @param key - The child key to end at, among the children with the previously - * specified priority. This argument is only allowed if ordering by child, - * value, or priority. - */ -function endAt(value, key) { - validateKey('endAt', 'key', key, true); - return new QueryEndAtConstraint(value, key); -} -var QueryEndBeforeConstraint = /** @class */ (function (_super) { - tslib.__extends(QueryEndBeforeConstraint, _super); - function QueryEndBeforeConstraint(_value, _key) { - var _this = _super.call(this) || this; - _this._value = _value; - _this._key = _key; - return _this; - } - QueryEndBeforeConstraint.prototype._apply = function (query) { - validateFirebaseDataArg('endBefore', this._value, query._path, false); - var newParams = queryParamsEndBefore(query._queryParams, this._value, this._key); - validateLimit(newParams); - validateQueryEndpoints(newParams); - if (query._queryParams.hasEnd()) { - throw new Error('endBefore: Starting point was already set (by another call to endAt, ' + - 'endBefore or equalTo).'); - } - return new QueryImpl(query._repo, query._path, newParams, query._orderByCalled); - }; - return QueryEndBeforeConstraint; -}(QueryConstraint)); -/** - * Creates a `QueryConstraint` with the specified ending point (exclusive). - * - * Using `startAt()`, `startAfter()`, `endBefore()`, `endAt()` and `equalTo()` - * allows you to choose arbitrary starting and ending points for your queries. - * - * The ending point is exclusive. If only a value is provided, children - * with a value less than the specified value will be included in the query. - * If a key is specified, then children must have a value less than or equal - * to the specified value and a key name less than the specified key. - * - * @param value - The value to end before. The argument type depends on which - * `orderBy*()` function was used in this query. Specify a value that matches - * the `orderBy*()` type. When used in combination with `orderByKey()`, the - * value must be a string. - * @param key - The child key to end before, among the children with the - * previously specified priority. This argument is only allowed if ordering by - * child, value, or priority. - */ -function endBefore(value, key) { - validateKey('endBefore', 'key', key, true); - return new QueryEndBeforeConstraint(value, key); -} -var QueryStartAtConstraint = /** @class */ (function (_super) { - tslib.__extends(QueryStartAtConstraint, _super); - function QueryStartAtConstraint(_value, _key) { - var _this = _super.call(this) || this; - _this._value = _value; - _this._key = _key; - return _this; - } - QueryStartAtConstraint.prototype._apply = function (query) { - validateFirebaseDataArg('startAt', this._value, query._path, true); - var newParams = queryParamsStartAt(query._queryParams, this._value, this._key); - validateLimit(newParams); - validateQueryEndpoints(newParams); - if (query._queryParams.hasStart()) { - throw new Error('startAt: Starting point was already set (by another call to startAt, ' + - 'startBefore or equalTo).'); - } - return new QueryImpl(query._repo, query._path, newParams, query._orderByCalled); - }; - return QueryStartAtConstraint; -}(QueryConstraint)); -/** - * Creates a `QueryConstraint` with the specified starting point. - * - * Using `startAt()`, `startAfter()`, `endBefore()`, `endAt()` and `equalTo()` - * allows you to choose arbitrary starting and ending points for your queries. - * - * The starting point is inclusive, so children with exactly the specified value - * will be included in the query. The optional key argument can be used to - * further limit the range of the query. If it is specified, then children that - * have exactly the specified value must also have a key name greater than or - * equal to the specified key. - * - * You can read more about `startAt()` in - * {@link https://firebase.google.com/docs/database/web/lists-of-data#filtering_data | Filtering data}. - * - * @param value - The value to start at. The argument type depends on which - * `orderBy*()` function was used in this query. Specify a value that matches - * the `orderBy*()` type. When used in combination with `orderByKey()`, the - * value must be a string. - * @param key - The child key to start at. This argument is only allowed if - * ordering by child, value, or priority. - */ -function startAt(value, key) { - if (value === void 0) { value = null; } - validateKey('startAt', 'key', key, true); - return new QueryStartAtConstraint(value, key); -} -var QueryStartAfterConstraint = /** @class */ (function (_super) { - tslib.__extends(QueryStartAfterConstraint, _super); - function QueryStartAfterConstraint(_value, _key) { - var _this = _super.call(this) || this; - _this._value = _value; - _this._key = _key; - return _this; - } - QueryStartAfterConstraint.prototype._apply = function (query) { - validateFirebaseDataArg('startAfter', this._value, query._path, false); - var newParams = queryParamsStartAfter(query._queryParams, this._value, this._key); - validateLimit(newParams); - validateQueryEndpoints(newParams); - if (query._queryParams.hasStart()) { - throw new Error('startAfter: Starting point was already set (by another call to startAt, ' + - 'startAfter, or equalTo).'); - } - return new QueryImpl(query._repo, query._path, newParams, query._orderByCalled); - }; - return QueryStartAfterConstraint; -}(QueryConstraint)); -/** - * Creates a `QueryConstraint` with the specified starting point (exclusive). - * - * Using `startAt()`, `startAfter()`, `endBefore()`, `endAt()` and `equalTo()` - * allows you to choose arbitrary starting and ending points for your queries. - * - * The starting point is exclusive. If only a value is provided, children - * with a value greater than the specified value will be included in the query. - * If a key is specified, then children must have a value greater than or equal - * to the specified value and a a key name greater than the specified key. - * - * @param value - The value to start after. The argument type depends on which - * `orderBy*()` function was used in this query. Specify a value that matches - * the `orderBy*()` type. When used in combination with `orderByKey()`, the - * value must be a string. - * @param key - The child key to start after. This argument is only allowed if - * ordering by child, value, or priority. - */ -function startAfter(value, key) { - validateKey('startAfter', 'key', key, true); - return new QueryStartAfterConstraint(value, key); -} -var QueryLimitToFirstConstraint = /** @class */ (function (_super) { - tslib.__extends(QueryLimitToFirstConstraint, _super); - function QueryLimitToFirstConstraint(_limit) { - var _this = _super.call(this) || this; - _this._limit = _limit; - return _this; - } - QueryLimitToFirstConstraint.prototype._apply = function (query) { - if (query._queryParams.hasLimit()) { - throw new Error('limitToFirst: Limit was already set (by another call to limitToFirst ' + - 'or limitToLast).'); - } - return new QueryImpl(query._repo, query._path, queryParamsLimitToFirst(query._queryParams, this._limit), query._orderByCalled); - }; - return QueryLimitToFirstConstraint; -}(QueryConstraint)); -/** - * Creates a new `QueryConstraint` that if limited to the first specific number - * of children. - * - * The `limitToFirst()` method is used to set a maximum number of children to be - * synced for a given callback. If we set a limit of 100, we will initially only - * receive up to 100 `child_added` events. If we have fewer than 100 messages - * stored in our Database, a `child_added` event will fire for each message. - * However, if we have over 100 messages, we will only receive a `child_added` - * event for the first 100 ordered messages. As items change, we will receive - * `child_removed` events for each item that drops out of the active list so - * that the total number stays at 100. - * - * You can read more about `limitToFirst()` in - * {@link https://firebase.google.com/docs/database/web/lists-of-data#filtering_data | Filtering data}. - * - * @param limit - The maximum number of nodes to include in this query. - */ -function limitToFirst(limit) { - if (typeof limit !== 'number' || Math.floor(limit) !== limit || limit <= 0) { - throw new Error('limitToFirst: First argument must be a positive integer.'); - } - return new QueryLimitToFirstConstraint(limit); -} -var QueryLimitToLastConstraint = /** @class */ (function (_super) { - tslib.__extends(QueryLimitToLastConstraint, _super); - function QueryLimitToLastConstraint(_limit) { - var _this = _super.call(this) || this; - _this._limit = _limit; - return _this; - } - QueryLimitToLastConstraint.prototype._apply = function (query) { - if (query._queryParams.hasLimit()) { - throw new Error('limitToLast: Limit was already set (by another call to limitToFirst ' + - 'or limitToLast).'); - } - return new QueryImpl(query._repo, query._path, queryParamsLimitToLast(query._queryParams, this._limit), query._orderByCalled); - }; - return QueryLimitToLastConstraint; -}(QueryConstraint)); -/** - * Creates a new `QueryConstraint` that is limited to return only the last - * specified number of children. - * - * The `limitToLast()` method is used to set a maximum number of children to be - * synced for a given callback. If we set a limit of 100, we will initially only - * receive up to 100 `child_added` events. If we have fewer than 100 messages - * stored in our Database, a `child_added` event will fire for each message. - * However, if we have over 100 messages, we will only receive a `child_added` - * event for the last 100 ordered messages. As items change, we will receive - * `child_removed` events for each item that drops out of the active list so - * that the total number stays at 100. - * - * You can read more about `limitToLast()` in - * {@link https://firebase.google.com/docs/database/web/lists-of-data#filtering_data | Filtering data}. - * - * @param limit - The maximum number of nodes to include in this query. - */ -function limitToLast(limit) { - if (typeof limit !== 'number' || Math.floor(limit) !== limit || limit <= 0) { - throw new Error('limitToLast: First argument must be a positive integer.'); - } - return new QueryLimitToLastConstraint(limit); -} -var QueryOrderByChildConstraint = /** @class */ (function (_super) { - tslib.__extends(QueryOrderByChildConstraint, _super); - function QueryOrderByChildConstraint(_path) { - var _this = _super.call(this) || this; - _this._path = _path; - return _this; - } - QueryOrderByChildConstraint.prototype._apply = function (query) { - validateNoPreviousOrderByCall(query, 'orderByChild'); - var parsedPath = new Path(this._path); - if (pathIsEmpty(parsedPath)) { - throw new Error('orderByChild: cannot pass in empty path. Use orderByValue() instead.'); - } - var index = new PathIndex(parsedPath); - var newParams = queryParamsOrderBy(query._queryParams, index); - validateQueryEndpoints(newParams); - return new QueryImpl(query._repo, query._path, newParams, - /*orderByCalled=*/ true); - }; - return QueryOrderByChildConstraint; -}(QueryConstraint)); -/** - * Creates a new `QueryConstraint` that orders by the specified child key. - * - * Queries can only order by one key at a time. Calling `orderByChild()` - * multiple times on the same query is an error. - * - * Firebase queries allow you to order your data by any child key on the fly. - * However, if you know in advance what your indexes will be, you can define - * them via the .indexOn rule in your Security Rules for better performance. See - * the{@link https://firebase.google.com/docs/database/security/indexing-data} - * rule for more information. - * - * You can read more about `orderByChild()` in - * {@link https://firebase.google.com/docs/database/web/lists-of-data#sort_data | Sort data}. - * - * @param path - The path to order by. - */ -function orderByChild(path) { - if (path === '$key') { - throw new Error('orderByChild: "$key" is invalid. Use orderByKey() instead.'); - } - else if (path === '$priority') { - throw new Error('orderByChild: "$priority" is invalid. Use orderByPriority() instead.'); - } - else if (path === '$value') { - throw new Error('orderByChild: "$value" is invalid. Use orderByValue() instead.'); - } - validatePathString('orderByChild', 'path', path, false); - return new QueryOrderByChildConstraint(path); -} -var QueryOrderByKeyConstraint = /** @class */ (function (_super) { - tslib.__extends(QueryOrderByKeyConstraint, _super); - function QueryOrderByKeyConstraint() { - return _super !== null && _super.apply(this, arguments) || this; - } - QueryOrderByKeyConstraint.prototype._apply = function (query) { - validateNoPreviousOrderByCall(query, 'orderByKey'); - var newParams = queryParamsOrderBy(query._queryParams, KEY_INDEX); - validateQueryEndpoints(newParams); - return new QueryImpl(query._repo, query._path, newParams, - /*orderByCalled=*/ true); - }; - return QueryOrderByKeyConstraint; -}(QueryConstraint)); -/** - * Creates a new `QueryConstraint` that orders by the key. - * - * Sorts the results of a query by their (ascending) key values. - * - * You can read more about `orderByKey()` in - * {@link https://firebase.google.com/docs/database/web/lists-of-data#sort_data | Sort data}. - */ -function orderByKey() { - return new QueryOrderByKeyConstraint(); -} -var QueryOrderByPriorityConstraint = /** @class */ (function (_super) { - tslib.__extends(QueryOrderByPriorityConstraint, _super); - function QueryOrderByPriorityConstraint() { - return _super !== null && _super.apply(this, arguments) || this; - } - QueryOrderByPriorityConstraint.prototype._apply = function (query) { - validateNoPreviousOrderByCall(query, 'orderByPriority'); - var newParams = queryParamsOrderBy(query._queryParams, PRIORITY_INDEX); - validateQueryEndpoints(newParams); - return new QueryImpl(query._repo, query._path, newParams, - /*orderByCalled=*/ true); - }; - return QueryOrderByPriorityConstraint; -}(QueryConstraint)); -/** - * Creates a new `QueryConstraint` that orders by priority. - * - * Applications need not use priority but can order collections by - * ordinary properties (see - * {@link https://firebase.google.com/docs/database/web/lists-of-data#sort_data | Sort data} - * for alternatives to priority. - */ -function orderByPriority() { - return new QueryOrderByPriorityConstraint(); -} -var QueryOrderByValueConstraint = /** @class */ (function (_super) { - tslib.__extends(QueryOrderByValueConstraint, _super); - function QueryOrderByValueConstraint() { - return _super !== null && _super.apply(this, arguments) || this; - } - QueryOrderByValueConstraint.prototype._apply = function (query) { - validateNoPreviousOrderByCall(query, 'orderByValue'); - var newParams = queryParamsOrderBy(query._queryParams, VALUE_INDEX); - validateQueryEndpoints(newParams); - return new QueryImpl(query._repo, query._path, newParams, - /*orderByCalled=*/ true); - }; - return QueryOrderByValueConstraint; -}(QueryConstraint)); -/** - * Creates a new `QueryConstraint` that orders by value. - * - * If the children of a query are all scalar values (string, number, or - * boolean), you can order the results by their (ascending) values. - * - * You can read more about `orderByValue()` in - * {@link https://firebase.google.com/docs/database/web/lists-of-data#sort_data | Sort data}. - */ -function orderByValue() { - return new QueryOrderByValueConstraint(); -} -var QueryEqualToValueConstraint = /** @class */ (function (_super) { - tslib.__extends(QueryEqualToValueConstraint, _super); - function QueryEqualToValueConstraint(_value, _key) { - var _this = _super.call(this) || this; - _this._value = _value; - _this._key = _key; - return _this; - } - QueryEqualToValueConstraint.prototype._apply = function (query) { - validateFirebaseDataArg('equalTo', this._value, query._path, false); - if (query._queryParams.hasStart()) { - throw new Error('equalTo: Starting point was already set (by another call to startAt/startAfter or ' + - 'equalTo).'); - } - if (query._queryParams.hasEnd()) { - throw new Error('equalTo: Ending point was already set (by another call to endAt/endBefore or ' + - 'equalTo).'); - } - return new QueryEndAtConstraint(this._value, this._key)._apply(new QueryStartAtConstraint(this._value, this._key)._apply(query)); - }; - return QueryEqualToValueConstraint; -}(QueryConstraint)); -/** - * Creates a `QueryConstraint` that includes children that match the specified - * value. - * - * Using `startAt()`, `startAfter()`, `endBefore()`, `endAt()` and `equalTo()` - * allows you to choose arbitrary starting and ending points for your queries. - * - * The optional key argument can be used to further limit the range of the - * query. If it is specified, then children that have exactly the specified - * value must also have exactly the specified key as their key name. This can be - * used to filter result sets with many matches for the same value. - * - * You can read more about `equalTo()` in - * {@link https://firebase.google.com/docs/database/web/lists-of-data#filtering_data | Filtering data}. - * - * @param value - The value to match for. The argument type depends on which - * `orderBy*()` function was used in this query. Specify a value that matches - * the `orderBy*()` type. When used in combination with `orderByKey()`, the - * value must be a string. - * @param key - The child key to start at, among the children with the - * previously specified priority. This argument is only allowed if ordering by - * child, value, or priority. - */ -function equalTo(value, key) { - validateKey('equalTo', 'key', key, true); - return new QueryEqualToValueConstraint(value, key); -} -/** - * Creates a new immutable instance of `Query` that is extended to also include - * additional query constraints. - * - * @param query - The Query instance to use as a base for the new constraints. - * @param queryConstraints - The list of `QueryConstraint`s to apply. - * @throws if any of the provided query constraints cannot be combined with the - * existing or new constraints. - */ -function query(query) { - var e_1, _a; - var queryConstraints = []; - for (var _i = 1; _i < arguments.length; _i++) { - queryConstraints[_i - 1] = arguments[_i]; - } - var queryImpl = util.getModularInstance(query); - try { - for (var queryConstraints_1 = tslib.__values(queryConstraints), queryConstraints_1_1 = queryConstraints_1.next(); !queryConstraints_1_1.done; queryConstraints_1_1 = queryConstraints_1.next()) { - var constraint = queryConstraints_1_1.value; - queryImpl = constraint._apply(queryImpl); - } - } - catch (e_1_1) { e_1 = { error: e_1_1 }; } - finally { - try { - if (queryConstraints_1_1 && !queryConstraints_1_1.done && (_a = queryConstraints_1.return)) _a.call(queryConstraints_1); - } - finally { if (e_1) throw e_1.error; } - } - return queryImpl; -} -/** - * Define reference constructor in various modules - * - * We are doing this here to avoid several circular - * dependency issues - */ -syncPointSetReferenceConstructor(ReferenceImpl); -syncTreeSetReferenceConstructor(ReferenceImpl); - -/** - * This variable is also defined in the firebase Node.js Admin SDK. Before - * modifying this definition, consult the definition in: - * - * https://github.com/firebase/firebase-admin-node - * - * and make sure the two are consistent. - */ -var FIREBASE_DATABASE_EMULATOR_HOST_VAR = 'FIREBASE_DATABASE_EMULATOR_HOST'; -/** - * Creates and caches `Repo` instances. - */ -var repos = {}; -/** - * If true, any new `Repo` will be created to use `ReadonlyRestClient` (for testing purposes). - */ -var useRestClient = false; -/** - * Update an existing `Repo` in place to point to a new host/port. - */ -function repoManagerApplyEmulatorSettings(repo, host, port, tokenProvider) { - repo.repoInfo_ = new RepoInfo(host + ":" + port, - /* secure= */ false, repo.repoInfo_.namespace, repo.repoInfo_.webSocketOnly, repo.repoInfo_.nodeAdmin, repo.repoInfo_.persistenceKey, repo.repoInfo_.includeNamespaceInQueryParams); - if (tokenProvider) { - repo.authTokenProvider_ = tokenProvider; - } -} -/** - * This function should only ever be called to CREATE a new database instance. - * @internal - */ -function repoManagerDatabaseFromApp(app, authProvider, appCheckProvider, url, nodeAdmin) { - var dbUrl = url || app.options.databaseURL; - if (dbUrl === undefined) { - if (!app.options.projectId) { - fatal("Can't determine Firebase Database URL. Be sure to include " + - ' a Project ID when calling firebase.initializeApp().'); - } - log('Using default host for project ', app.options.projectId); - dbUrl = app.options.projectId + "-default-rtdb.firebaseio.com"; - } - var parsedUrl = parseRepoInfo(dbUrl, nodeAdmin); - var repoInfo = parsedUrl.repoInfo; - var isEmulator; - var dbEmulatorHost = undefined; - if (typeof process !== 'undefined' && process.env) { - dbEmulatorHost = process.env[FIREBASE_DATABASE_EMULATOR_HOST_VAR]; - } - if (dbEmulatorHost) { - isEmulator = true; - dbUrl = "http://" + dbEmulatorHost + "?ns=" + repoInfo.namespace; - parsedUrl = parseRepoInfo(dbUrl, nodeAdmin); - repoInfo = parsedUrl.repoInfo; - } - else { - isEmulator = !parsedUrl.repoInfo.secure; - } - var authTokenProvider = nodeAdmin && isEmulator - ? new EmulatorTokenProvider(EmulatorTokenProvider.OWNER) - : new FirebaseAuthTokenProvider(app.name, app.options, authProvider); - validateUrl('Invalid Firebase Database URL', parsedUrl); - if (!pathIsEmpty(parsedUrl.path)) { - fatal('Database URL must point to the root of a Firebase Database ' + - '(not including a child path).'); - } - var repo = repoManagerCreateRepo(repoInfo, app, authTokenProvider, new AppCheckTokenProvider(app.name, appCheckProvider)); - return new Database$1(repo, app); -} -/** - * Remove the repo and make sure it is disconnected. - * - */ -function repoManagerDeleteRepo(repo, appName) { - var appRepos = repos[appName]; - // This should never happen... - if (!appRepos || appRepos[repo.key] !== repo) { - fatal("Database " + appName + "(" + repo.repoInfo_ + ") has already been deleted."); - } - repoInterrupt(repo); - delete appRepos[repo.key]; -} -/** - * Ensures a repo doesn't already exist and then creates one using the - * provided app. - * - * @param repoInfo - The metadata about the Repo - * @returns The Repo object for the specified server / repoName. - */ -function repoManagerCreateRepo(repoInfo, app, authTokenProvider, appCheckProvider) { - var appRepos = repos[app.name]; - if (!appRepos) { - appRepos = {}; - repos[app.name] = appRepos; - } - var repo = appRepos[repoInfo.toURLString()]; - if (repo) { - fatal('Database initialized multiple times. Please make sure the format of the database URL matches with each database() call.'); - } - repo = new Repo(repoInfo, useRestClient, authTokenProvider, appCheckProvider); - appRepos[repoInfo.toURLString()] = repo; - return repo; -} -/** - * Forces us to use ReadonlyRestClient instead of PersistentConnection for new Repos. - */ -function repoManagerForceRestClient(forceRestClient) { - useRestClient = forceRestClient; -} -/** - * Class representing a Firebase Realtime Database. - */ -var Database$1 = /** @class */ (function () { - /** @hideconstructor */ - function Database(_repoInternal, - /** The {@link @firebase/app#FirebaseApp} associated with this Realtime Database instance. */ - app) { - this._repoInternal = _repoInternal; - this.app = app; - /** Represents a `Database` instance. */ - this['type'] = 'database'; - /** Track if the instance has been used (root or repo accessed) */ - this._instanceStarted = false; - } - Object.defineProperty(Database.prototype, "_repo", { - get: function () { - if (!this._instanceStarted) { - repoStart(this._repoInternal, this.app.options.appId, this.app.options['databaseAuthVariableOverride']); - this._instanceStarted = true; - } - return this._repoInternal; - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(Database.prototype, "_root", { - get: function () { - if (!this._rootInternal) { - this._rootInternal = new ReferenceImpl(this._repo, newEmptyPath()); - } - return this._rootInternal; - }, - enumerable: false, - configurable: true - }); - Database.prototype._delete = function () { - if (this._rootInternal !== null) { - repoManagerDeleteRepo(this._repo, this.app.name); - this._repoInternal = null; - this._rootInternal = null; - } - return Promise.resolve(); - }; - Database.prototype._checkNotDeleted = function (apiName) { - if (this._rootInternal === null) { - fatal('Cannot call ' + apiName + ' on a deleted database.'); - } - }; - return Database; -}()); -function checkTransportInit() { - if (TransportManager.IS_TRANSPORT_INITIALIZED) { - warn$1('Transport has already been initialized. Please call this function before calling ref or setting up a listener'); - } -} -/** - * Force the use of websockets instead of longPolling. - */ -function forceWebSockets() { - checkTransportInit(); - BrowserPollConnection.forceDisallow(); -} -/** - * Force the use of longPolling instead of websockets. This will be ignored if websocket protocol is used in databaseURL. - */ -function forceLongPolling() { - checkTransportInit(); - WebSocketConnection.forceDisallow(); - BrowserPollConnection.forceAllow(); -} -/** - * Modify the provided instance to communicate with the Realtime Database - * emulator. - * - *

Note: This method must be called before performing any other operation. - * - * @param db - The instance to modify. - * @param host - The emulator host (ex: localhost) - * @param port - The emulator port (ex: 8080) - * @param options.mockUserToken - the mock auth token to use for unit testing Security Rules - */ -function connectDatabaseEmulator(db, host, port, options) { - if (options === void 0) { options = {}; } - db = util.getModularInstance(db); - db._checkNotDeleted('useEmulator'); - if (db._instanceStarted) { - fatal('Cannot call useEmulator() after instance has already been initialized.'); - } - var repo = db._repoInternal; - var tokenProvider = undefined; - if (repo.repoInfo_.nodeAdmin) { - if (options.mockUserToken) { - fatal('mockUserToken is not supported by the Admin SDK. For client access with mock users, please use the "firebase" package instead of "firebase-admin".'); - } - tokenProvider = new EmulatorTokenProvider(EmulatorTokenProvider.OWNER); - } - else if (options.mockUserToken) { - var token = typeof options.mockUserToken === 'string' - ? options.mockUserToken - : util.createMockUserToken(options.mockUserToken, db.app.options.projectId); - tokenProvider = new EmulatorTokenProvider(token); - } - // Modify the repo to apply emulator settings - repoManagerApplyEmulatorSettings(repo, host, port, tokenProvider); -} -/** - * Disconnects from the server (all Database operations will be completed - * offline). - * - * The client automatically maintains a persistent connection to the Database - * server, which will remain active indefinitely and reconnect when - * disconnected. However, the `goOffline()` and `goOnline()` methods may be used - * to control the client connection in cases where a persistent connection is - * undesirable. - * - * While offline, the client will no longer receive data updates from the - * Database. However, all Database operations performed locally will continue to - * immediately fire events, allowing your application to continue behaving - * normally. Additionally, each operation performed locally will automatically - * be queued and retried upon reconnection to the Database server. - * - * To reconnect to the Database and begin receiving remote events, see - * `goOnline()`. - * - * @param db - The instance to disconnect. - */ -function goOffline(db) { - db = util.getModularInstance(db); - db._checkNotDeleted('goOffline'); - repoInterrupt(db._repo); -} -/** - * Reconnects to the server and synchronizes the offline Database state - * with the server state. - * - * This method should be used after disabling the active connection with - * `goOffline()`. Once reconnected, the client will transmit the proper data - * and fire the appropriate events so that your client "catches up" - * automatically. - * - * @param db - The instance to reconnect. - */ -function goOnline(db) { - db = util.getModularInstance(db); - db._checkNotDeleted('goOnline'); - repoResume(db._repo); -} -function enableLogging(logger, persistent) { - enableLogging$1(logger, persistent); -} - -/** - * @license - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var SERVER_TIMESTAMP = { - '.sv': 'timestamp' -}; -/** - * Returns a placeholder value for auto-populating the current timestamp (time - * since the Unix epoch, in milliseconds) as determined by the Firebase - * servers. - */ -function serverTimestamp() { - return SERVER_TIMESTAMP; -} -/** - * Returns a placeholder value that can be used to atomically increment the - * current database value by the provided delta. - * - * @param delta - the amount to modify the current value atomically. - * @returns A placeholder value for modifying data atomically server-side. - */ -function increment(delta) { - return { - '.sv': { - 'increment': delta - } - }; -} - -/** - * @license - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * A type for the resolve value of {@link runTransaction}. - */ -var TransactionResult$1 = /** @class */ (function () { - /** @hideconstructor */ - function TransactionResult( - /** Whether the transaction was successfully committed. */ - committed, - /** The resulting data snapshot. */ - snapshot) { - this.committed = committed; - this.snapshot = snapshot; - } - /** Returns a JSON-serializable representation of this object. */ - TransactionResult.prototype.toJSON = function () { - return { committed: this.committed, snapshot: this.snapshot.toJSON() }; - }; - return TransactionResult; -}()); -/** - * Atomically modifies the data at this location. - * - * Atomically modify the data at this location. Unlike a normal `set()`, which - * just overwrites the data regardless of its previous value, `runTransaction()` is - * used to modify the existing value to a new value, ensuring there are no - * conflicts with other clients writing to the same location at the same time. - * - * To accomplish this, you pass `runTransaction()` an update function which is - * used to transform the current value into a new value. If another client - * writes to the location before your new value is successfully written, your - * update function will be called again with the new current value, and the - * write will be retried. This will happen repeatedly until your write succeeds - * without conflict or you abort the transaction by not returning a value from - * your update function. - * - * Note: Modifying data with `set()` will cancel any pending transactions at - * that location, so extreme care should be taken if mixing `set()` and - * `runTransaction()` to update the same data. - * - * Note: When using transactions with Security and Firebase Rules in place, be - * aware that a client needs `.read` access in addition to `.write` access in - * order to perform a transaction. This is because the client-side nature of - * transactions requires the client to read the data in order to transactionally - * update it. - * - * @param ref - The location to atomically modify. - * @param transactionUpdate - A developer-supplied function which will be passed - * the current data stored at this location (as a JavaScript object). The - * function should return the new value it would like written (as a JavaScript - * object). If `undefined` is returned (i.e. you return with no arguments) the - * transaction will be aborted and the data at this location will not be - * modified. - * @param options - An options object to configure transactions. - * @returns A `Promise` that can optionally be used instead of the `onComplete` - * callback to handle success and failure. - */ -function runTransaction(ref, -// eslint-disable-next-line @typescript-eslint/no-explicit-any -transactionUpdate, options) { - var _a; - ref = util.getModularInstance(ref); - validateWritablePath('Reference.transaction', ref._path); - if (ref.key === '.length' || ref.key === '.keys') { - throw ('Reference.transaction failed: ' + ref.key + ' is a read-only object.'); - } - var applyLocally = (_a = options === null || options === void 0 ? void 0 : options.applyLocally) !== null && _a !== void 0 ? _a : true; - var deferred = new util.Deferred(); - var promiseComplete = function (error, committed, node) { - var dataSnapshot = null; - if (error) { - deferred.reject(error); - } - else { - dataSnapshot = new DataSnapshot$1(node, new ReferenceImpl(ref._repo, ref._path), PRIORITY_INDEX); - deferred.resolve(new TransactionResult$1(committed, dataSnapshot)); - } - }; - // Add a watch to make sure we get server updates. - var unwatcher = onValue(ref, function () { }); - repoStartTransaction(ref._repo, ref._path, transactionUpdate, promiseComplete, unwatcher, applyLocally); - return deferred.promise; -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// eslint-disable-next-line @typescript-eslint/no-explicit-any -PersistentConnection.prototype.simpleListen = function (pathString, onComplete) { - this.sendRequest('q', { p: pathString }, onComplete); -}; -// eslint-disable-next-line @typescript-eslint/no-explicit-any -PersistentConnection.prototype.echo = function (data, onEcho) { - this.sendRequest('echo', { d: data }, onEcho); -}; -/** - * @internal - */ -var hijackHash = function (newHash) { - var oldPut = PersistentConnection.prototype.put; - PersistentConnection.prototype.put = function (pathString, data, onComplete, hash) { - if (hash !== undefined) { - hash = newHash(); - } - oldPut.call(this, pathString, data, onComplete, hash); - }; - return function () { - PersistentConnection.prototype.put = oldPut; - }; -}; -/** - * Forces the RepoManager to create Repos that use ReadonlyRestClient instead of PersistentConnection. - * @internal - */ -var forceRestClient = function (forceRestClient) { - repoManagerForceRestClient(forceRestClient); -}; - -/** - * @license - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -setWebSocketImpl(Websocket__default["default"].Client); - -index_standalone.DataSnapshot = DataSnapshot$1; -index_standalone.Database = Database$1; -var OnDisconnect_1 = index_standalone.OnDisconnect = OnDisconnect$1; -index_standalone.QueryConstraint = QueryConstraint; -index_standalone.TransactionResult = TransactionResult$1; -var _QueryImpl = index_standalone._QueryImpl = QueryImpl; -var _QueryParams = index_standalone._QueryParams = QueryParams; -var _ReferenceImpl = index_standalone._ReferenceImpl = ReferenceImpl; -index_standalone._TEST_ACCESS_forceRestClient = forceRestClient; -index_standalone._TEST_ACCESS_hijackHash = hijackHash; -var _repoManagerDatabaseFromApp = index_standalone._repoManagerDatabaseFromApp = repoManagerDatabaseFromApp; -var _setSDKVersion = index_standalone._setSDKVersion = setSDKVersion; -var _validatePathString = index_standalone._validatePathString = validatePathString; -var _validateWritablePath = index_standalone._validateWritablePath = validateWritablePath; -var child_1 = index_standalone.child = child; -var connectDatabaseEmulator_1 = index_standalone.connectDatabaseEmulator = connectDatabaseEmulator; -var enableLogging_1 = index_standalone.enableLogging = enableLogging; -var endAt_1 = index_standalone.endAt = endAt; -var endBefore_1 = index_standalone.endBefore = endBefore; -var equalTo_1 = index_standalone.equalTo = equalTo; -var forceLongPolling_1 = index_standalone.forceLongPolling = forceLongPolling; -var forceWebSockets_1 = index_standalone.forceWebSockets = forceWebSockets; -var get_1 = index_standalone.get = get; -var goOffline_1 = index_standalone.goOffline = goOffline; -var goOnline_1 = index_standalone.goOnline = goOnline; -var increment_1 = index_standalone.increment = increment; -var limitToFirst_1 = index_standalone.limitToFirst = limitToFirst; -var limitToLast_1 = index_standalone.limitToLast = limitToLast; -var off_1 = index_standalone.off = off; -var onChildAdded_1 = index_standalone.onChildAdded = onChildAdded; -var onChildChanged_1 = index_standalone.onChildChanged = onChildChanged; -var onChildMoved_1 = index_standalone.onChildMoved = onChildMoved; -var onChildRemoved_1 = index_standalone.onChildRemoved = onChildRemoved; -index_standalone.onDisconnect = onDisconnect; -var onValue_1 = index_standalone.onValue = onValue; -var orderByChild_1 = index_standalone.orderByChild = orderByChild; -var orderByKey_1 = index_standalone.orderByKey = orderByKey; -var orderByPriority_1 = index_standalone.orderByPriority = orderByPriority; -var orderByValue_1 = index_standalone.orderByValue = orderByValue; -var push_1 = index_standalone.push = push; -var query_1 = index_standalone.query = query; -var ref_1 = index_standalone.ref = ref; -var refFromURL_1 = index_standalone.refFromURL = refFromURL; -var remove_1 = index_standalone.remove = remove; -var runTransaction_1 = index_standalone.runTransaction = runTransaction; -var serverTimestamp_1 = index_standalone.serverTimestamp = serverTimestamp; -var set_1 = index_standalone.set = set; -var setPriority_1 = index_standalone.setPriority = setPriority; -var setWithPriority_1 = index_standalone.setWithPriority = setWithPriority; -var startAfter_1 = index_standalone.startAfter = startAfter; -var startAt_1 = index_standalone.startAt = startAt; -var update_1 = index_standalone.update = update; - -/** - * @license - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var logClient = new require$$3.Logger('@firebase/database-compat'); -var warn = function (msg) { - var message = 'FIREBASE WARNING: ' + msg; - logClient.warn(message); -}; - -/** - * @license - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var validateBoolean = function (fnName, argumentName, bool, optional) { - if (optional && bool === undefined) { - return; - } - if (typeof bool !== 'boolean') { - throw new Error(require$$1$3.errorPrefix(fnName, argumentName) + 'must be a boolean.'); - } -}; -var validateEventType = function (fnName, eventType, optional) { - if (optional && eventType === undefined) { - return; - } - switch (eventType) { - case 'value': - case 'child_added': - case 'child_removed': - case 'child_changed': - case 'child_moved': - break; - default: - throw new Error(require$$1$3.errorPrefix(fnName, 'eventType') + - 'must be a valid event type = "value", "child_added", "child_removed", ' + - '"child_changed", or "child_moved".'); - } -}; - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var OnDisconnect = /** @class */ (function () { - function OnDisconnect(_delegate) { - this._delegate = _delegate; - } - OnDisconnect.prototype.cancel = function (onComplete) { - require$$1$3.validateArgCount('OnDisconnect.cancel', 0, 1, arguments.length); - require$$1$3.validateCallback('OnDisconnect.cancel', 'onComplete', onComplete, true); - var result = this._delegate.cancel(); - if (onComplete) { - result.then(function () { return onComplete(null); }, function (error) { return onComplete(error); }); - } - return result; - }; - OnDisconnect.prototype.remove = function (onComplete) { - require$$1$3.validateArgCount('OnDisconnect.remove', 0, 1, arguments.length); - require$$1$3.validateCallback('OnDisconnect.remove', 'onComplete', onComplete, true); - var result = this._delegate.remove(); - if (onComplete) { - result.then(function () { return onComplete(null); }, function (error) { return onComplete(error); }); - } - return result; - }; - OnDisconnect.prototype.set = function (value, onComplete) { - require$$1$3.validateArgCount('OnDisconnect.set', 1, 2, arguments.length); - require$$1$3.validateCallback('OnDisconnect.set', 'onComplete', onComplete, true); - var result = this._delegate.set(value); - if (onComplete) { - result.then(function () { return onComplete(null); }, function (error) { return onComplete(error); }); - } - return result; - }; - OnDisconnect.prototype.setWithPriority = function (value, priority, onComplete) { - require$$1$3.validateArgCount('OnDisconnect.setWithPriority', 2, 3, arguments.length); - require$$1$3.validateCallback('OnDisconnect.setWithPriority', 'onComplete', onComplete, true); - var result = this._delegate.setWithPriority(value, priority); - if (onComplete) { - result.then(function () { return onComplete(null); }, function (error) { return onComplete(error); }); - } - return result; - }; - OnDisconnect.prototype.update = function (objectToMerge, onComplete) { - require$$1$3.validateArgCount('OnDisconnect.update', 1, 2, arguments.length); - if (Array.isArray(objectToMerge)) { - var newObjectToMerge = {}; - for (var i = 0; i < objectToMerge.length; ++i) { - newObjectToMerge['' + i] = objectToMerge[i]; - } - objectToMerge = newObjectToMerge; - warn('Passing an Array to firebase.database.onDisconnect().update() is deprecated. Use set() if you want to overwrite the ' + - 'existing data, or an Object with integer keys if you really do want to only update some of the children.'); - } - require$$1$3.validateCallback('OnDisconnect.update', 'onComplete', onComplete, true); - var result = this._delegate.update(objectToMerge); - if (onComplete) { - result.then(function () { return onComplete(null); }, function (error) { return onComplete(error); }); - } - return result; - }; - return OnDisconnect; -}()); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var TransactionResult = /** @class */ (function () { - /** - * A type for the resolve value of Firebase.transaction. - */ - function TransactionResult(committed, snapshot) { - this.committed = committed; - this.snapshot = snapshot; - } - // Do not create public documentation. This is intended to make JSON serialization work but is otherwise unnecessary - // for end-users - TransactionResult.prototype.toJSON = function () { - require$$1$3.validateArgCount('TransactionResult.toJSON', 0, 1, arguments.length); - return { committed: this.committed, snapshot: this.snapshot.toJSON() }; - }; - return TransactionResult; -}()); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Class representing a firebase data snapshot. It wraps a SnapshotNode and - * surfaces the public methods (val, forEach, etc.) we want to expose. - */ -var DataSnapshot = /** @class */ (function () { - function DataSnapshot(_database, _delegate) { - this._database = _database; - this._delegate = _delegate; - } - /** - * Retrieves the snapshot contents as JSON. Returns null if the snapshot is - * empty. - * - * @returns JSON representation of the DataSnapshot contents, or null if empty. - */ - DataSnapshot.prototype.val = function () { - require$$1$3.validateArgCount('DataSnapshot.val', 0, 0, arguments.length); - return this._delegate.val(); - }; - /** - * Returns the snapshot contents as JSON, including priorities of node. Suitable for exporting - * the entire node contents. - * @returns JSON representation of the DataSnapshot contents, or null if empty. - */ - DataSnapshot.prototype.exportVal = function () { - require$$1$3.validateArgCount('DataSnapshot.exportVal', 0, 0, arguments.length); - return this._delegate.exportVal(); - }; - // Do not create public documentation. This is intended to make JSON serialization work but is otherwise unnecessary - // for end-users - DataSnapshot.prototype.toJSON = function () { - // Optional spacer argument is unnecessary because we're depending on recursion rather than stringifying the content - require$$1$3.validateArgCount('DataSnapshot.toJSON', 0, 1, arguments.length); - return this._delegate.toJSON(); - }; - /** - * Returns whether the snapshot contains a non-null value. - * - * @returns Whether the snapshot contains a non-null value, or is empty. - */ - DataSnapshot.prototype.exists = function () { - require$$1$3.validateArgCount('DataSnapshot.exists', 0, 0, arguments.length); - return this._delegate.exists(); - }; - /** - * Returns a DataSnapshot of the specified child node's contents. - * - * @param path - Path to a child. - * @returns DataSnapshot for child node. - */ - DataSnapshot.prototype.child = function (path) { - require$$1$3.validateArgCount('DataSnapshot.child', 0, 1, arguments.length); - // Ensure the childPath is a string (can be a number) - path = String(path); - _validatePathString('DataSnapshot.child', 'path', path, false); - return new DataSnapshot(this._database, this._delegate.child(path)); - }; - /** - * Returns whether the snapshot contains a child at the specified path. - * - * @param path - Path to a child. - * @returns Whether the child exists. - */ - DataSnapshot.prototype.hasChild = function (path) { - require$$1$3.validateArgCount('DataSnapshot.hasChild', 1, 1, arguments.length); - _validatePathString('DataSnapshot.hasChild', 'path', path, false); - return this._delegate.hasChild(path); - }; - /** - * Returns the priority of the object, or null if no priority was set. - * - * @returns The priority. - */ - DataSnapshot.prototype.getPriority = function () { - require$$1$3.validateArgCount('DataSnapshot.getPriority', 0, 0, arguments.length); - return this._delegate.priority; - }; - /** - * Iterates through child nodes and calls the specified action for each one. - * - * @param action - Callback function to be called - * for each child. - * @returns True if forEach was canceled by action returning true for - * one of the child nodes. - */ - DataSnapshot.prototype.forEach = function (action) { - var _this = this; - require$$1$3.validateArgCount('DataSnapshot.forEach', 1, 1, arguments.length); - require$$1$3.validateCallback('DataSnapshot.forEach', 'action', action, false); - return this._delegate.forEach(function (expDataSnapshot) { - return action(new DataSnapshot(_this._database, expDataSnapshot)); - }); - }; - /** - * Returns whether this DataSnapshot has children. - * @returns True if the DataSnapshot contains 1 or more child nodes. - */ - DataSnapshot.prototype.hasChildren = function () { - require$$1$3.validateArgCount('DataSnapshot.hasChildren', 0, 0, arguments.length); - return this._delegate.hasChildren(); - }; - Object.defineProperty(DataSnapshot.prototype, "key", { - get: function () { - return this._delegate.key; - }, - enumerable: false, - configurable: true - }); - /** - * Returns the number of children for this DataSnapshot. - * @returns The number of children that this DataSnapshot contains. - */ - DataSnapshot.prototype.numChildren = function () { - require$$1$3.validateArgCount('DataSnapshot.numChildren', 0, 0, arguments.length); - return this._delegate.size; - }; - /** - * @returns The Firebase reference for the location this snapshot's data came - * from. - */ - DataSnapshot.prototype.getRef = function () { - require$$1$3.validateArgCount('DataSnapshot.ref', 0, 0, arguments.length); - return new Reference(this._database, this._delegate.ref); - }; - Object.defineProperty(DataSnapshot.prototype, "ref", { - get: function () { - return this.getRef(); - }, - enumerable: false, - configurable: true - }); - return DataSnapshot; -}()); -/** - * A Query represents a filter to be applied to a firebase location. This object purely represents the - * query expression (and exposes our public API to build the query). The actual query logic is in ViewBase.js. - * - * Since every Firebase reference is a query, Firebase inherits from this object. - */ -var Query = /** @class */ (function () { - function Query(database, _delegate) { - this.database = database; - this._delegate = _delegate; - } - Query.prototype.on = function (eventType, callback, cancelCallbackOrContext, context) { - var _this = this; - var _a; - require$$1$3.validateArgCount('Query.on', 2, 4, arguments.length); - require$$1$3.validateCallback('Query.on', 'callback', callback, false); - var ret = Query.getCancelAndContextArgs_('Query.on', cancelCallbackOrContext, context); - var valueCallback = function (expSnapshot, previousChildName) { - callback.call(ret.context, new DataSnapshot(_this.database, expSnapshot), previousChildName); - }; - valueCallback.userCallback = callback; - valueCallback.context = ret.context; - var cancelCallback = (_a = ret.cancel) === null || _a === void 0 ? void 0 : _a.bind(ret.context); - switch (eventType) { - case 'value': - onValue_1(this._delegate, valueCallback, cancelCallback); - return callback; - case 'child_added': - onChildAdded_1(this._delegate, valueCallback, cancelCallback); - return callback; - case 'child_removed': - onChildRemoved_1(this._delegate, valueCallback, cancelCallback); - return callback; - case 'child_changed': - onChildChanged_1(this._delegate, valueCallback, cancelCallback); - return callback; - case 'child_moved': - onChildMoved_1(this._delegate, valueCallback, cancelCallback); - return callback; - default: - throw new Error(require$$1$3.errorPrefix('Query.on', 'eventType') + - 'must be a valid event type = "value", "child_added", "child_removed", ' + - '"child_changed", or "child_moved".'); - } - }; - Query.prototype.off = function (eventType, callback, context) { - require$$1$3.validateArgCount('Query.off', 0, 3, arguments.length); - validateEventType('Query.off', eventType, true); - require$$1$3.validateCallback('Query.off', 'callback', callback, true); - require$$1$3.validateContextObject('Query.off', 'context', context, true); - if (callback) { - var valueCallback = function () { }; - valueCallback.userCallback = callback; - valueCallback.context = context; - off_1(this._delegate, eventType, valueCallback); - } - else { - off_1(this._delegate, eventType); - } - }; - /** - * Get the server-value for this query, or return a cached value if not connected. - */ - Query.prototype.get = function () { - var _this = this; - return get_1(this._delegate).then(function (expSnapshot) { - return new DataSnapshot(_this.database, expSnapshot); - }); - }; - /** - * Attaches a listener, waits for the first event, and then removes the listener - */ - Query.prototype.once = function (eventType, callback, failureCallbackOrContext, context) { - var _this = this; - require$$1$3.validateArgCount('Query.once', 1, 4, arguments.length); - require$$1$3.validateCallback('Query.once', 'callback', callback, true); - var ret = Query.getCancelAndContextArgs_('Query.once', failureCallbackOrContext, context); - var deferred = new require$$1$3.Deferred(); - var valueCallback = function (expSnapshot, previousChildName) { - var result = new DataSnapshot(_this.database, expSnapshot); - if (callback) { - callback.call(ret.context, result, previousChildName); - } - deferred.resolve(result); - }; - valueCallback.userCallback = callback; - valueCallback.context = ret.context; - var cancelCallback = function (error) { - if (ret.cancel) { - ret.cancel.call(ret.context, error); - } - deferred.reject(error); - }; - switch (eventType) { - case 'value': - onValue_1(this._delegate, valueCallback, cancelCallback, { - onlyOnce: true - }); - break; - case 'child_added': - onChildAdded_1(this._delegate, valueCallback, cancelCallback, { - onlyOnce: true - }); - break; - case 'child_removed': - onChildRemoved_1(this._delegate, valueCallback, cancelCallback, { - onlyOnce: true - }); - break; - case 'child_changed': - onChildChanged_1(this._delegate, valueCallback, cancelCallback, { - onlyOnce: true - }); - break; - case 'child_moved': - onChildMoved_1(this._delegate, valueCallback, cancelCallback, { - onlyOnce: true - }); - break; - default: - throw new Error(require$$1$3.errorPrefix('Query.once', 'eventType') + - 'must be a valid event type = "value", "child_added", "child_removed", ' + - '"child_changed", or "child_moved".'); - } - return deferred.promise; - }; - /** - * Set a limit and anchor it to the start of the window. - */ - Query.prototype.limitToFirst = function (limit) { - require$$1$3.validateArgCount('Query.limitToFirst', 1, 1, arguments.length); - return new Query(this.database, query_1(this._delegate, limitToFirst_1(limit))); - }; - /** - * Set a limit and anchor it to the end of the window. - */ - Query.prototype.limitToLast = function (limit) { - require$$1$3.validateArgCount('Query.limitToLast', 1, 1, arguments.length); - return new Query(this.database, query_1(this._delegate, limitToLast_1(limit))); - }; - /** - * Given a child path, return a new query ordered by the specified grandchild path. - */ - Query.prototype.orderByChild = function (path) { - require$$1$3.validateArgCount('Query.orderByChild', 1, 1, arguments.length); - return new Query(this.database, query_1(this._delegate, orderByChild_1(path))); - }; - /** - * Return a new query ordered by the KeyIndex - */ - Query.prototype.orderByKey = function () { - require$$1$3.validateArgCount('Query.orderByKey', 0, 0, arguments.length); - return new Query(this.database, query_1(this._delegate, orderByKey_1())); - }; - /** - * Return a new query ordered by the PriorityIndex - */ - Query.prototype.orderByPriority = function () { - require$$1$3.validateArgCount('Query.orderByPriority', 0, 0, arguments.length); - return new Query(this.database, query_1(this._delegate, orderByPriority_1())); - }; - /** - * Return a new query ordered by the ValueIndex - */ - Query.prototype.orderByValue = function () { - require$$1$3.validateArgCount('Query.orderByValue', 0, 0, arguments.length); - return new Query(this.database, query_1(this._delegate, orderByValue_1())); - }; - Query.prototype.startAt = function (value, name) { - if (value === void 0) { value = null; } - require$$1$3.validateArgCount('Query.startAt', 0, 2, arguments.length); - return new Query(this.database, query_1(this._delegate, startAt_1(value, name))); - }; - Query.prototype.startAfter = function (value, name) { - if (value === void 0) { value = null; } - require$$1$3.validateArgCount('Query.startAfter', 0, 2, arguments.length); - return new Query(this.database, query_1(this._delegate, startAfter_1(value, name))); - }; - Query.prototype.endAt = function (value, name) { - if (value === void 0) { value = null; } - require$$1$3.validateArgCount('Query.endAt', 0, 2, arguments.length); - return new Query(this.database, query_1(this._delegate, endAt_1(value, name))); - }; - Query.prototype.endBefore = function (value, name) { - if (value === void 0) { value = null; } - require$$1$3.validateArgCount('Query.endBefore', 0, 2, arguments.length); - return new Query(this.database, query_1(this._delegate, endBefore_1(value, name))); - }; - /** - * Load the selection of children with exactly the specified value, and, optionally, - * the specified name. - */ - Query.prototype.equalTo = function (value, name) { - require$$1$3.validateArgCount('Query.equalTo', 1, 2, arguments.length); - return new Query(this.database, query_1(this._delegate, equalTo_1(value, name))); - }; - /** - * @returns URL for this location. - */ - Query.prototype.toString = function () { - require$$1$3.validateArgCount('Query.toString', 0, 0, arguments.length); - return this._delegate.toString(); - }; - // Do not create public documentation. This is intended to make JSON serialization work but is otherwise unnecessary - // for end-users. - Query.prototype.toJSON = function () { - // An optional spacer argument is unnecessary for a string. - require$$1$3.validateArgCount('Query.toJSON', 0, 1, arguments.length); - return this._delegate.toJSON(); - }; - /** - * Return true if this query and the provided query are equivalent; otherwise, return false. - */ - Query.prototype.isEqual = function (other) { - require$$1$3.validateArgCount('Query.isEqual', 1, 1, arguments.length); - if (!(other instanceof Query)) { - var error = 'Query.isEqual failed: First argument must be an instance of firebase.database.Query.'; - throw new Error(error); - } - return this._delegate.isEqual(other._delegate); - }; - /** - * Helper used by .on and .once to extract the context and or cancel arguments. - * @param fnName - The function name (on or once) - * - */ - Query.getCancelAndContextArgs_ = function (fnName, cancelOrContext, context) { - var ret = { cancel: undefined, context: undefined }; - if (cancelOrContext && context) { - ret.cancel = cancelOrContext; - require$$1$3.validateCallback(fnName, 'cancel', ret.cancel, true); - ret.context = context; - require$$1$3.validateContextObject(fnName, 'context', ret.context, true); - } - else if (cancelOrContext) { - // we have either a cancel callback or a context. - if (typeof cancelOrContext === 'object' && cancelOrContext !== null) { - // it's a context! - ret.context = cancelOrContext; - } - else if (typeof cancelOrContext === 'function') { - ret.cancel = cancelOrContext; - } - else { - throw new Error(require$$1$3.errorPrefix(fnName, 'cancelOrContext') + - ' must either be a cancel callback or a context object.'); - } - } - return ret; - }; - Object.defineProperty(Query.prototype, "ref", { - get: function () { - return new Reference(this.database, new _ReferenceImpl(this._delegate._repo, this._delegate._path)); - }, - enumerable: false, - configurable: true - }); - return Query; -}()); -var Reference = /** @class */ (function (_super) { - require$$2$3.__extends(Reference, _super); - /** - * Call options: - * new Reference(Repo, Path) or - * new Reference(url: string, string|RepoManager) - * - * Externally - this is the firebase.database.Reference type. - */ - function Reference(database, _delegate) { - var _this = _super.call(this, database, new _QueryImpl(_delegate._repo, _delegate._path, new _QueryParams(), false)) || this; - _this.database = database; - _this._delegate = _delegate; - return _this; - } - /** @returns {?string} */ - Reference.prototype.getKey = function () { - require$$1$3.validateArgCount('Reference.key', 0, 0, arguments.length); - return this._delegate.key; - }; - Reference.prototype.child = function (pathString) { - require$$1$3.validateArgCount('Reference.child', 1, 1, arguments.length); - if (typeof pathString === 'number') { - pathString = String(pathString); - } - return new Reference(this.database, child_1(this._delegate, pathString)); - }; - /** @returns {?Reference} */ - Reference.prototype.getParent = function () { - require$$1$3.validateArgCount('Reference.parent', 0, 0, arguments.length); - var parent = this._delegate.parent; - return parent ? new Reference(this.database, parent) : null; - }; - /** @returns {!Reference} */ - Reference.prototype.getRoot = function () { - require$$1$3.validateArgCount('Reference.root', 0, 0, arguments.length); - return new Reference(this.database, this._delegate.root); - }; - Reference.prototype.set = function (newVal, onComplete) { - require$$1$3.validateArgCount('Reference.set', 1, 2, arguments.length); - require$$1$3.validateCallback('Reference.set', 'onComplete', onComplete, true); - var result = set_1(this._delegate, newVal); - if (onComplete) { - result.then(function () { return onComplete(null); }, function (error) { return onComplete(error); }); - } - return result; - }; - Reference.prototype.update = function (values, onComplete) { - require$$1$3.validateArgCount('Reference.update', 1, 2, arguments.length); - if (Array.isArray(values)) { - var newObjectToMerge = {}; - for (var i = 0; i < values.length; ++i) { - newObjectToMerge['' + i] = values[i]; - } - values = newObjectToMerge; - warn('Passing an Array to Firebase.update() is deprecated. ' + - 'Use set() if you want to overwrite the existing data, or ' + - 'an Object with integer keys if you really do want to ' + - 'only update some of the children.'); - } - _validateWritablePath('Reference.update', this._delegate._path); - require$$1$3.validateCallback('Reference.update', 'onComplete', onComplete, true); - var result = update_1(this._delegate, values); - if (onComplete) { - result.then(function () { return onComplete(null); }, function (error) { return onComplete(error); }); - } - return result; - }; - Reference.prototype.setWithPriority = function (newVal, newPriority, onComplete) { - require$$1$3.validateArgCount('Reference.setWithPriority', 2, 3, arguments.length); - require$$1$3.validateCallback('Reference.setWithPriority', 'onComplete', onComplete, true); - var result = setWithPriority_1(this._delegate, newVal, newPriority); - if (onComplete) { - result.then(function () { return onComplete(null); }, function (error) { return onComplete(error); }); - } - return result; - }; - Reference.prototype.remove = function (onComplete) { - require$$1$3.validateArgCount('Reference.remove', 0, 1, arguments.length); - require$$1$3.validateCallback('Reference.remove', 'onComplete', onComplete, true); - var result = remove_1(this._delegate); - if (onComplete) { - result.then(function () { return onComplete(null); }, function (error) { return onComplete(error); }); - } - return result; - }; - Reference.prototype.transaction = function (transactionUpdate, onComplete, applyLocally) { - var _this = this; - require$$1$3.validateArgCount('Reference.transaction', 1, 3, arguments.length); - require$$1$3.validateCallback('Reference.transaction', 'transactionUpdate', transactionUpdate, false); - require$$1$3.validateCallback('Reference.transaction', 'onComplete', onComplete, true); - validateBoolean('Reference.transaction', 'applyLocally', applyLocally, true); - var result = runTransaction_1(this._delegate, transactionUpdate, { - applyLocally: applyLocally - }).then(function (transactionResult) { - return new TransactionResult(transactionResult.committed, new DataSnapshot(_this.database, transactionResult.snapshot)); - }); - if (onComplete) { - result.then(function (transactionResult) { - return onComplete(null, transactionResult.committed, transactionResult.snapshot); - }, function (error) { return onComplete(error, false, null); }); - } - return result; - }; - Reference.prototype.setPriority = function (priority, onComplete) { - require$$1$3.validateArgCount('Reference.setPriority', 1, 2, arguments.length); - require$$1$3.validateCallback('Reference.setPriority', 'onComplete', onComplete, true); - var result = setPriority_1(this._delegate, priority); - if (onComplete) { - result.then(function () { return onComplete(null); }, function (error) { return onComplete(error); }); - } - return result; - }; - Reference.prototype.push = function (value, onComplete) { - var _this = this; - require$$1$3.validateArgCount('Reference.push', 0, 2, arguments.length); - require$$1$3.validateCallback('Reference.push', 'onComplete', onComplete, true); - var expPromise = push_1(this._delegate, value); - var promise = expPromise.then(function (expRef) { return new Reference(_this.database, expRef); }); - if (onComplete) { - promise.then(function () { return onComplete(null); }, function (error) { return onComplete(error); }); - } - var result = new Reference(this.database, expPromise); - result.then = promise.then.bind(promise); - result.catch = promise.catch.bind(promise, undefined); - return result; - }; - Reference.prototype.onDisconnect = function () { - _validateWritablePath('Reference.onDisconnect', this._delegate._path); - return new OnDisconnect(new OnDisconnect_1(this._delegate._repo, this._delegate._path)); - }; - Object.defineProperty(Reference.prototype, "key", { - get: function () { - return this.getKey(); - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(Reference.prototype, "parent", { - get: function () { - return this.getParent(); - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(Reference.prototype, "root", { - get: function () { - return this.getRoot(); - }, - enumerable: false, - configurable: true - }); - return Reference; -}(Query)); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Class representing a firebase database. - */ -var Database = /** @class */ (function () { - /** - * The constructor should not be called by users of our public API. - */ - function Database(_delegate, app) { - var _this = this; - this._delegate = _delegate; - this.app = app; - this.INTERNAL = { - delete: function () { return _this._delegate._delete(); }, - forceWebSockets: forceWebSockets_1, - forceLongPolling: forceLongPolling_1 - }; - } - /** - * Modify this instance to communicate with the Realtime Database emulator. - * - *

Note: This method must be called before performing any other operation. - * - * @param host - the emulator host (ex: localhost) - * @param port - the emulator port (ex: 8080) - * @param options.mockUserToken - the mock auth token to use for unit testing Security Rules - */ - Database.prototype.useEmulator = function (host, port, options) { - if (options === void 0) { options = {}; } - connectDatabaseEmulator_1(this._delegate, host, port, options); - }; - Database.prototype.ref = function (path) { - require$$1$3.validateArgCount('database.ref', 0, 1, arguments.length); - if (path instanceof Reference) { - var childRef = refFromURL_1(this._delegate, path.toString()); - return new Reference(this, childRef); - } - else { - var childRef = ref_1(this._delegate, path); - return new Reference(this, childRef); - } - }; - /** - * Returns a reference to the root or the path specified in url. - * We throw a exception if the url is not in the same domain as the - * current repo. - * @returns Firebase reference. - */ - Database.prototype.refFromURL = function (url) { - var apiName = 'database.refFromURL'; - require$$1$3.validateArgCount(apiName, 1, 1, arguments.length); - var childRef = refFromURL_1(this._delegate, url); - return new Reference(this, childRef); - }; - // Make individual repo go offline. - Database.prototype.goOffline = function () { - require$$1$3.validateArgCount('database.goOffline', 0, 0, arguments.length); - return goOffline_1(this._delegate); - }; - Database.prototype.goOnline = function () { - require$$1$3.validateArgCount('database.goOnline', 0, 0, arguments.length); - return goOnline_1(this._delegate); - }; - Database.ServerValue = { - TIMESTAMP: serverTimestamp_1(), - increment: function (delta) { return increment_1(delta); } - }; - return Database; -}()); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Used by console to create a database based on the app, - * passed database URL and a custom auth implementation. - * - * @param app - A valid FirebaseApp-like object - * @param url - A valid Firebase databaseURL - * @param version - custom version e.g. firebase-admin version - * @param customAuthImpl - custom auth implementation - */ -function initStandalone$1(_a) { - var app = _a.app, url = _a.url, version = _a.version, customAuthImpl = _a.customAuthImpl, namespace = _a.namespace, _b = _a.nodeAdmin, nodeAdmin = _b === void 0 ? false : _b; - _setSDKVersion(version); - /** - * ComponentContainer('database-standalone') is just a placeholder that doesn't perform - * any actual function. - */ - var authProvider = new component.Provider('auth-internal', new component.ComponentContainer('database-standalone')); - authProvider.setComponent(new component.Component('auth-internal', function () { return customAuthImpl; }, "PRIVATE" /* ComponentType.PRIVATE */)); - return { - instance: new Database(_repoManagerDatabaseFromApp(app, authProvider, - /* appCheckProvider= */ undefined, url, nodeAdmin), app), - namespace: namespace - }; -} - -var INTERNAL = /*#__PURE__*/Object.freeze({ - __proto__: null, - initStandalone: initStandalone$1 -}); - -/** - * @license - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var ServerValue = Database.ServerValue; -/** - * A one off register function which returns a database based on the app and - * passed database URL. (Used by the Admin SDK) - * - * @param app - A valid FirebaseApp-like object - * @param url - A valid Firebase databaseURL - * @param version - custom version e.g. firebase-admin version - * @param nodeAdmin - true if the SDK is being initialized from Firebase Admin. - */ -function initStandalone(app, url, version, nodeAdmin) { - if (nodeAdmin === void 0) { nodeAdmin = true; } - require$$1$3.CONSTANTS.NODE_ADMIN = nodeAdmin; - return initStandalone$1({ - app: app, - url: url, - version: version, - // firebase-admin-node's app.INTERNAL implements FirebaseAuthInternal interface - // eslint-disable-next-line @typescript-eslint/no-explicit-any - customAuthImpl: app.INTERNAL, - namespace: { - Reference: Reference, - Query: Query, - Database: Database, - DataSnapshot: DataSnapshot, - enableLogging: enableLogging_1, - INTERNAL: INTERNAL, - ServerValue: ServerValue - }, - nodeAdmin: nodeAdmin - }); -} - -exports.DataSnapshot = DataSnapshot; -exports.Database = Database; -exports.OnDisconnect = OnDisconnect_1; -exports.Query = Query; -exports.Reference = Reference; -exports.ServerValue = ServerValue; -exports.enableLogging = enableLogging_1; -exports.initStandalone = initStandalone; -//# sourceMappingURL=index.standalone.js.map diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/node-esm/database-compat/src/api/Database.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/node-esm/database-compat/src/api/Database.d.ts deleted file mode 100644 index 0ec2668a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/node-esm/database-compat/src/api/Database.d.ts +++ /dev/null @@ -1,74 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { FirebaseApp } from '@firebase/app-types'; -import { FirebaseService } from '@firebase/app-types/private'; -import { forceLongPolling, forceWebSockets, Database as ModularDatabase } from '@firebase/database'; -import { Compat, EmulatorMockTokenOptions } from '@firebase/util'; -import { Reference } from './Reference'; -/** - * Class representing a firebase database. - */ -export declare class Database implements FirebaseService, Compat { - readonly _delegate: ModularDatabase; - readonly app: FirebaseApp; - static readonly ServerValue: { - TIMESTAMP: object; - increment: (delta: number) => object; - }; - /** - * The constructor should not be called by users of our public API. - */ - constructor(_delegate: ModularDatabase, app: FirebaseApp); - INTERNAL: { - delete: () => Promise; - forceWebSockets: typeof forceWebSockets; - forceLongPolling: typeof forceLongPolling; - }; - /** - * Modify this instance to communicate with the Realtime Database emulator. - * - *

Note: This method must be called before performing any other operation. - * - * @param host - the emulator host (ex: localhost) - * @param port - the emulator port (ex: 8080) - * @param options.mockUserToken - the mock auth token to use for unit testing Security Rules - */ - useEmulator(host: string, port: number, options?: { - mockUserToken?: EmulatorMockTokenOptions; - }): void; - /** - * Returns a reference to the root or to the path specified in the provided - * argument. - * - * @param path - The relative string path or an existing Reference to a database - * location. - * @throws If a Reference is provided, throws if it does not belong to the - * same project. - * @returns Firebase reference. - */ - ref(path?: string): Reference; - ref(path?: Reference): Reference; - /** - * Returns a reference to the root or the path specified in url. - * We throw a exception if the url is not in the same domain as the - * current repo. - * @returns Firebase reference. - */ - refFromURL(url: string): Reference; - goOffline(): void; - goOnline(): void; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/node-esm/database-compat/src/api/Reference.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/node-esm/database-compat/src/api/Reference.d.ts deleted file mode 100644 index 75adc85a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/node-esm/database-compat/src/api/Reference.d.ts +++ /dev/null @@ -1,201 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { DataSnapshot as ModularDataSnapshot, Query as ExpQuery, DatabaseReference as ModularReference } from '@firebase/database'; -import { Compat } from '@firebase/util'; -import { Database } from './Database'; -import { OnDisconnect } from './onDisconnect'; -import { TransactionResult } from './TransactionResult'; -/** - * Class representing a firebase data snapshot. It wraps a SnapshotNode and - * surfaces the public methods (val, forEach, etc.) we want to expose. - */ -export declare class DataSnapshot implements Compat { - readonly _database: Database; - readonly _delegate: ModularDataSnapshot; - constructor(_database: Database, _delegate: ModularDataSnapshot); - /** - * Retrieves the snapshot contents as JSON. Returns null if the snapshot is - * empty. - * - * @returns JSON representation of the DataSnapshot contents, or null if empty. - */ - val(): unknown; - /** - * Returns the snapshot contents as JSON, including priorities of node. Suitable for exporting - * the entire node contents. - * @returns JSON representation of the DataSnapshot contents, or null if empty. - */ - exportVal(): unknown; - toJSON(): unknown; - /** - * Returns whether the snapshot contains a non-null value. - * - * @returns Whether the snapshot contains a non-null value, or is empty. - */ - exists(): boolean; - /** - * Returns a DataSnapshot of the specified child node's contents. - * - * @param path - Path to a child. - * @returns DataSnapshot for child node. - */ - child(path: string): DataSnapshot; - /** - * Returns whether the snapshot contains a child at the specified path. - * - * @param path - Path to a child. - * @returns Whether the child exists. - */ - hasChild(path: string): boolean; - /** - * Returns the priority of the object, or null if no priority was set. - * - * @returns The priority. - */ - getPriority(): string | number | null; - /** - * Iterates through child nodes and calls the specified action for each one. - * - * @param action - Callback function to be called - * for each child. - * @returns True if forEach was canceled by action returning true for - * one of the child nodes. - */ - forEach(action: (snapshot: DataSnapshot) => boolean | void): boolean; - /** - * Returns whether this DataSnapshot has children. - * @returns True if the DataSnapshot contains 1 or more child nodes. - */ - hasChildren(): boolean; - get key(): string; - /** - * Returns the number of children for this DataSnapshot. - * @returns The number of children that this DataSnapshot contains. - */ - numChildren(): number; - /** - * @returns The Firebase reference for the location this snapshot's data came - * from. - */ - getRef(): Reference; - get ref(): Reference; -} -export interface SnapshotCallback { - (dataSnapshot: DataSnapshot, previousChildName?: string | null): unknown; -} -/** - * A Query represents a filter to be applied to a firebase location. This object purely represents the - * query expression (and exposes our public API to build the query). The actual query logic is in ViewBase.js. - * - * Since every Firebase reference is a query, Firebase inherits from this object. - */ -export declare class Query implements Compat { - readonly database: Database; - readonly _delegate: ExpQuery; - constructor(database: Database, _delegate: ExpQuery); - on(eventType: string, callback: SnapshotCallback, cancelCallbackOrContext?: ((a: Error) => unknown) | object | null, context?: object | null): SnapshotCallback; - off(eventType?: string, callback?: SnapshotCallback, context?: object | null): void; - /** - * Get the server-value for this query, or return a cached value if not connected. - */ - get(): Promise; - /** - * Attaches a listener, waits for the first event, and then removes the listener - */ - once(eventType: string, callback?: SnapshotCallback, failureCallbackOrContext?: ((a: Error) => void) | object | null, context?: object | null): Promise; - /** - * Set a limit and anchor it to the start of the window. - */ - limitToFirst(limit: number): Query; - /** - * Set a limit and anchor it to the end of the window. - */ - limitToLast(limit: number): Query; - /** - * Given a child path, return a new query ordered by the specified grandchild path. - */ - orderByChild(path: string): Query; - /** - * Return a new query ordered by the KeyIndex - */ - orderByKey(): Query; - /** - * Return a new query ordered by the PriorityIndex - */ - orderByPriority(): Query; - /** - * Return a new query ordered by the ValueIndex - */ - orderByValue(): Query; - startAt(value?: number | string | boolean | null, name?: string | null): Query; - startAfter(value?: number | string | boolean | null, name?: string | null): Query; - endAt(value?: number | string | boolean | null, name?: string | null): Query; - endBefore(value?: number | string | boolean | null, name?: string | null): Query; - /** - * Load the selection of children with exactly the specified value, and, optionally, - * the specified name. - */ - equalTo(value: number | string | boolean | null, name?: string): Query; - /** - * @returns URL for this location. - */ - toString(): string; - toJSON(): string; - /** - * Return true if this query and the provided query are equivalent; otherwise, return false. - */ - isEqual(other: Query): boolean; - /** - * Helper used by .on and .once to extract the context and or cancel arguments. - * @param fnName - The function name (on or once) - * - */ - private static getCancelAndContextArgs_; - get ref(): Reference; -} -export declare class Reference extends Query implements Compat { - readonly database: Database; - readonly _delegate: ModularReference; - then: Promise['then']; - catch: Promise['catch']; - /** - * Call options: - * new Reference(Repo, Path) or - * new Reference(url: string, string|RepoManager) - * - * Externally - this is the firebase.database.Reference type. - */ - constructor(database: Database, _delegate: ModularReference); - /** @returns {?string} */ - getKey(): string | null; - child(pathString: string): Reference; - /** @returns {?Reference} */ - getParent(): Reference | null; - /** @returns {!Reference} */ - getRoot(): Reference; - set(newVal: unknown, onComplete?: (error: Error | null) => void): Promise; - update(values: object, onComplete?: (a: Error | null) => void): Promise; - setWithPriority(newVal: unknown, newPriority: string | number | null, onComplete?: (a: Error | null) => void): Promise; - remove(onComplete?: (a: Error | null) => void): Promise; - transaction(transactionUpdate: (currentData: unknown) => unknown, onComplete?: (error: Error | null, committed: boolean, dataSnapshot: DataSnapshot | null) => void, applyLocally?: boolean): Promise; - setPriority(priority: string | number | null, onComplete?: (a: Error | null) => void): Promise; - push(value?: unknown, onComplete?: (a: Error | null) => void): Reference; - onDisconnect(): OnDisconnect; - get key(): string | null; - get parent(): Reference | null; - get root(): Reference; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/node-esm/database-compat/src/api/TransactionResult.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/node-esm/database-compat/src/api/TransactionResult.d.ts deleted file mode 100644 index 2fac36e1..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/node-esm/database-compat/src/api/TransactionResult.d.ts +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { DataSnapshot } from './Reference'; -export declare class TransactionResult { - committed: boolean; - snapshot: DataSnapshot; - /** - * A type for the resolve value of Firebase.transaction. - */ - constructor(committed: boolean, snapshot: DataSnapshot); - toJSON(): object; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/node-esm/database-compat/src/api/internal.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/node-esm/database-compat/src/api/internal.d.ts deleted file mode 100644 index 234da3ea..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/node-esm/database-compat/src/api/internal.d.ts +++ /dev/null @@ -1,39 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { FirebaseApp } from '@firebase/app-types'; -import { FirebaseAuthInternal } from '@firebase/auth-interop-types'; -import * as types from '@firebase/database-types'; -/** - * Used by console to create a database based on the app, - * passed database URL and a custom auth implementation. - * - * @param app - A valid FirebaseApp-like object - * @param url - A valid Firebase databaseURL - * @param version - custom version e.g. firebase-admin version - * @param customAuthImpl - custom auth implementation - */ -export declare function initStandalone({ app, url, version, customAuthImpl, namespace, nodeAdmin }: { - app: FirebaseApp; - url: string; - version: string; - customAuthImpl: FirebaseAuthInternal; - namespace: T; - nodeAdmin?: boolean; -}): { - instance: types.Database; - namespace: T; -}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/node-esm/database-compat/src/api/onDisconnect.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/node-esm/database-compat/src/api/onDisconnect.d.ts deleted file mode 100644 index 5932a8ad..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/node-esm/database-compat/src/api/onDisconnect.d.ts +++ /dev/null @@ -1,27 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { OnDisconnect as ModularOnDisconnect } from '@firebase/database'; -import { Compat } from '@firebase/util'; -export declare class OnDisconnect implements Compat { - readonly _delegate: ModularOnDisconnect; - constructor(_delegate: ModularOnDisconnect); - cancel(onComplete?: (a: Error | null) => void): Promise; - remove(onComplete?: (a: Error | null) => void): Promise; - set(value: unknown, onComplete?: (a: Error | null) => void): Promise; - setWithPriority(value: unknown, priority: number | string | null, onComplete?: (a: Error | null) => void): Promise; - update(objectToMerge: Record, onComplete?: (a: Error | null) => void): Promise; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/node-esm/database-compat/src/index.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/node-esm/database-compat/src/index.d.ts deleted file mode 100644 index 0ff6e73a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/node-esm/database-compat/src/index.d.ts +++ /dev/null @@ -1,32 +0,0 @@ -/** - * @license - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { FirebaseNamespace } from '@firebase/app-compat'; -import * as types from '@firebase/database-types'; -export declare function registerDatabase(instance: FirebaseNamespace): void; -declare module '@firebase/app-compat' { - interface FirebaseNamespace { - database?: { - (app?: FirebaseApp): types.FirebaseDatabase; - enableLogging: typeof types.enableLogging; - ServerValue: types.ServerValue; - Database: typeof types.FirebaseDatabase; - }; - } - interface FirebaseApp { - database?(databaseURL?: string): types.FirebaseDatabase; - } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/node-esm/database-compat/src/index.node.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/node-esm/database-compat/src/index.node.d.ts deleted file mode 100644 index bb8c84ef..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/node-esm/database-compat/src/index.node.d.ts +++ /dev/null @@ -1,30 +0,0 @@ -/** - * @license - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import * as types from '@firebase/database-types'; -declare module '@firebase/app-compat' { - interface FirebaseNamespace { - database?: { - (app?: FirebaseApp): types.FirebaseDatabase; - enableLogging: typeof types.enableLogging; - ServerValue: types.ServerValue; - Database: typeof types.FirebaseDatabase; - }; - } - interface FirebaseApp { - database?(): types.FirebaseDatabase; - } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/node-esm/database-compat/src/index.standalone.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/node-esm/database-compat/src/index.standalone.d.ts deleted file mode 100644 index 9d01344a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/node-esm/database-compat/src/index.standalone.d.ts +++ /dev/null @@ -1,52 +0,0 @@ -/** - * @license - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { FirebaseApp } from '@firebase/app-types'; -import { enableLogging } from '@firebase/database'; -import { Database } from './api/Database'; -import * as INTERNAL from './api/internal'; -import { DataSnapshot, Query, Reference } from './api/Reference'; -declare const ServerValue: { - TIMESTAMP: object; - increment: (delta: number) => object; -}; -/** - * A one off register function which returns a database based on the app and - * passed database URL. (Used by the Admin SDK) - * - * @param app - A valid FirebaseApp-like object - * @param url - A valid Firebase databaseURL - * @param version - custom version e.g. firebase-admin version - * @param nodeAdmin - true if the SDK is being initialized from Firebase Admin. - */ -export declare function initStandalone(app: FirebaseApp, url: string, version: string, nodeAdmin?: boolean): { - instance: import("@firebase/database-types").Database; - namespace: { - Reference: typeof Reference; - Query: typeof Query; - Database: typeof Database; - DataSnapshot: typeof DataSnapshot; - enableLogging: typeof enableLogging; - INTERNAL: typeof INTERNAL; - ServerValue: { - TIMESTAMP: object; - increment: (delta: number) => object; - }; - }; -}; -export { Database, Query, Reference, enableLogging, ServerValue }; -export { OnDisconnect } from '@firebase/database'; -export { DataSnapshot } from './api/Reference'; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/node-esm/database-compat/src/util/util.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/node-esm/database-compat/src/util/util.d.ts deleted file mode 100644 index 2d0e3a74..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/node-esm/database-compat/src/util/util.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * @license - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export declare const warn: (msg: string) => void; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/node-esm/database-compat/src/util/validation.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/node-esm/database-compat/src/util/validation.d.ts deleted file mode 100644 index 52a06df3..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/node-esm/database-compat/src/util/validation.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -/** - * @license - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export declare const validateBoolean: (fnName: string, argumentName: string, bool: unknown, optional: boolean) => void; -export declare const validateEventType: (fnName: string, eventType: string, optional: boolean) => void; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/node-esm/database-compat/test/browser/crawler_support.test.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/node-esm/database-compat/test/browser/crawler_support.test.d.ts deleted file mode 100644 index cd6aeb9b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/node-esm/database-compat/test/browser/crawler_support.test.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export {}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/node-esm/database-compat/test/database.test.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/node-esm/database-compat/test/database.test.d.ts deleted file mode 100644 index 4835a03b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/node-esm/database-compat/test/database.test.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import '../src/index'; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/node-esm/database-compat/test/datasnapshot.test.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/node-esm/database-compat/test/datasnapshot.test.d.ts deleted file mode 100644 index cd6aeb9b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/node-esm/database-compat/test/datasnapshot.test.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export {}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/node-esm/database-compat/test/helpers/events.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/node-esm/database-compat/test/helpers/events.d.ts deleted file mode 100644 index 5c7fb307..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/node-esm/database-compat/test/helpers/events.d.ts +++ /dev/null @@ -1,34 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * A set of functions to clean up event handlers. - */ -export declare let eventCleanupHandlers: any[]; -/** Clean up outstanding event handlers */ -export declare function eventCleanup(): void; -/** - * Creates a struct which waits for many events. - * @param pathAndEvents - an array of tuples of [Firebase, [event type strings]] - */ -export declare function eventTestHelper(pathAndEvents: any, helperName?: any): { - promise: Promise; - initPromise: Promise; - waiter: () => boolean; - watchesInitializedWaiter: () => boolean; - unregister: () => void; - addExpectedEvents(moreEvents: any): void; -}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/node-esm/database-compat/test/helpers/util.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/node-esm/database-compat/test/helpers/util.d.ts deleted file mode 100644 index 887635a0..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/node-esm/database-compat/test/helpers/util.d.ts +++ /dev/null @@ -1,42 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import '../../src/index'; -import { Path } from '../../../database/src/core/util/Path'; -import { Query, Reference } from '../../src/api/Reference'; -export declare const TEST_PROJECT: any; -export declare const DATABASE_ADDRESS: any; -export declare const DATABASE_URL: any; -export declare function createTestApp(): import("@firebase/app-compat").FirebaseApp; -/** - * Gets or creates a root node to the test namespace. All calls sharing the - * value of opt_i will share an app context. - */ -export declare function getRootNode(i?: number, ref?: string): any; -/** - * Create multiple refs to the same top level - * push key - each on it's own Firebase.Context. - */ -export declare function getRandomNode(numNodes?: any): Reference | Reference[]; -export declare function getQueryValue(query: Query): Promise; -export declare function pause(milliseconds: number): Promise; -export declare function getPath(query: Query): string; -export declare function shuffle(arr: any, randFn?: () => number): void; -export declare function getFreshRepo(path: Path): any; -export declare function getFreshRepoFromReference(ref: any): any; -export declare function getSnap(path: any): any; -export declare function getVal(path: any): any; -export declare function canCreateExtraConnections(): boolean; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/node-esm/database-compat/test/info.test.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/node-esm/database-compat/test/info.test.d.ts deleted file mode 100644 index cd6aeb9b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/node-esm/database-compat/test/info.test.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export {}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/node-esm/database-compat/test/order.test.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/node-esm/database-compat/test/order.test.d.ts deleted file mode 100644 index cd6aeb9b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/node-esm/database-compat/test/order.test.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export {}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/node-esm/database-compat/test/order_by.test.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/node-esm/database-compat/test/order_by.test.d.ts deleted file mode 100644 index cd6aeb9b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/node-esm/database-compat/test/order_by.test.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export {}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/node-esm/database-compat/test/promise.test.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/node-esm/database-compat/test/promise.test.d.ts deleted file mode 100644 index cd6aeb9b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/node-esm/database-compat/test/promise.test.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export {}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/node-esm/database-compat/test/query.test.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/node-esm/database-compat/test/query.test.d.ts deleted file mode 100644 index cd6aeb9b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/node-esm/database-compat/test/query.test.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export {}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/node-esm/database-compat/test/servervalues.test.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/node-esm/database-compat/test/servervalues.test.d.ts deleted file mode 100644 index 05e43f18..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/node-esm/database-compat/test/servervalues.test.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * @license - * Copyright 2019 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export {}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/node-esm/database-compat/test/transaction.test.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/node-esm/database-compat/test/transaction.test.d.ts deleted file mode 100644 index 4835a03b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/node-esm/database-compat/test/transaction.test.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import '../src/index'; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/node-esm/index.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/node-esm/index.js deleted file mode 100644 index e756aaae..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/node-esm/index.js +++ /dev/null @@ -1,870 +0,0 @@ -import firebase from '@firebase/app-compat'; -import { Provider, ComponentContainer, Component } from '@firebase/component'; -import { _validatePathString, onChildMoved, onChildChanged, onChildRemoved, onChildAdded, onValue, off, get, query, limitToFirst, limitToLast, orderByChild, orderByKey, orderByPriority, orderByValue, startAt, startAfter, endAt, endBefore, equalTo, _ReferenceImpl, _QueryImpl, _QueryParams, child, set, _validateWritablePath, update, setWithPriority, remove, runTransaction, setPriority, push, OnDisconnect as OnDisconnect$1, forceWebSockets, forceLongPolling, connectDatabaseEmulator, refFromURL, ref, goOffline, goOnline, serverTimestamp, increment, _setSDKVersion, _repoManagerDatabaseFromApp, enableLogging } from '@firebase/database'; -import { errorPrefix, validateArgCount, validateCallback, validateContextObject, Deferred } from '@firebase/util'; -import { Logger } from '@firebase/logger'; - -const name = "@firebase/database-compat"; -const version = "0.2.10"; - -/** - * @license - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -const logClient = new Logger('@firebase/database-compat'); -const warn = function (msg) { - const message = 'FIREBASE WARNING: ' + msg; - logClient.warn(message); -}; - -/** - * @license - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -const validateBoolean = function (fnName, argumentName, bool, optional) { - if (optional && bool === undefined) { - return; - } - if (typeof bool !== 'boolean') { - throw new Error(errorPrefix(fnName, argumentName) + 'must be a boolean.'); - } -}; -const validateEventType = function (fnName, eventType, optional) { - if (optional && eventType === undefined) { - return; - } - switch (eventType) { - case 'value': - case 'child_added': - case 'child_removed': - case 'child_changed': - case 'child_moved': - break; - default: - throw new Error(errorPrefix(fnName, 'eventType') + - 'must be a valid event type = "value", "child_added", "child_removed", ' + - '"child_changed", or "child_moved".'); - } -}; - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -class OnDisconnect { - constructor(_delegate) { - this._delegate = _delegate; - } - cancel(onComplete) { - validateArgCount('OnDisconnect.cancel', 0, 1, arguments.length); - validateCallback('OnDisconnect.cancel', 'onComplete', onComplete, true); - const result = this._delegate.cancel(); - if (onComplete) { - result.then(() => onComplete(null), error => onComplete(error)); - } - return result; - } - remove(onComplete) { - validateArgCount('OnDisconnect.remove', 0, 1, arguments.length); - validateCallback('OnDisconnect.remove', 'onComplete', onComplete, true); - const result = this._delegate.remove(); - if (onComplete) { - result.then(() => onComplete(null), error => onComplete(error)); - } - return result; - } - set(value, onComplete) { - validateArgCount('OnDisconnect.set', 1, 2, arguments.length); - validateCallback('OnDisconnect.set', 'onComplete', onComplete, true); - const result = this._delegate.set(value); - if (onComplete) { - result.then(() => onComplete(null), error => onComplete(error)); - } - return result; - } - setWithPriority(value, priority, onComplete) { - validateArgCount('OnDisconnect.setWithPriority', 2, 3, arguments.length); - validateCallback('OnDisconnect.setWithPriority', 'onComplete', onComplete, true); - const result = this._delegate.setWithPriority(value, priority); - if (onComplete) { - result.then(() => onComplete(null), error => onComplete(error)); - } - return result; - } - update(objectToMerge, onComplete) { - validateArgCount('OnDisconnect.update', 1, 2, arguments.length); - if (Array.isArray(objectToMerge)) { - const newObjectToMerge = {}; - for (let i = 0; i < objectToMerge.length; ++i) { - newObjectToMerge['' + i] = objectToMerge[i]; - } - objectToMerge = newObjectToMerge; - warn('Passing an Array to firebase.database.onDisconnect().update() is deprecated. Use set() if you want to overwrite the ' + - 'existing data, or an Object with integer keys if you really do want to only update some of the children.'); - } - validateCallback('OnDisconnect.update', 'onComplete', onComplete, true); - const result = this._delegate.update(objectToMerge); - if (onComplete) { - result.then(() => onComplete(null), error => onComplete(error)); - } - return result; - } -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -class TransactionResult { - /** - * A type for the resolve value of Firebase.transaction. - */ - constructor(committed, snapshot) { - this.committed = committed; - this.snapshot = snapshot; - } - // Do not create public documentation. This is intended to make JSON serialization work but is otherwise unnecessary - // for end-users - toJSON() { - validateArgCount('TransactionResult.toJSON', 0, 1, arguments.length); - return { committed: this.committed, snapshot: this.snapshot.toJSON() }; - } -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Class representing a firebase data snapshot. It wraps a SnapshotNode and - * surfaces the public methods (val, forEach, etc.) we want to expose. - */ -class DataSnapshot { - constructor(_database, _delegate) { - this._database = _database; - this._delegate = _delegate; - } - /** - * Retrieves the snapshot contents as JSON. Returns null if the snapshot is - * empty. - * - * @returns JSON representation of the DataSnapshot contents, or null if empty. - */ - val() { - validateArgCount('DataSnapshot.val', 0, 0, arguments.length); - return this._delegate.val(); - } - /** - * Returns the snapshot contents as JSON, including priorities of node. Suitable for exporting - * the entire node contents. - * @returns JSON representation of the DataSnapshot contents, or null if empty. - */ - exportVal() { - validateArgCount('DataSnapshot.exportVal', 0, 0, arguments.length); - return this._delegate.exportVal(); - } - // Do not create public documentation. This is intended to make JSON serialization work but is otherwise unnecessary - // for end-users - toJSON() { - // Optional spacer argument is unnecessary because we're depending on recursion rather than stringifying the content - validateArgCount('DataSnapshot.toJSON', 0, 1, arguments.length); - return this._delegate.toJSON(); - } - /** - * Returns whether the snapshot contains a non-null value. - * - * @returns Whether the snapshot contains a non-null value, or is empty. - */ - exists() { - validateArgCount('DataSnapshot.exists', 0, 0, arguments.length); - return this._delegate.exists(); - } - /** - * Returns a DataSnapshot of the specified child node's contents. - * - * @param path - Path to a child. - * @returns DataSnapshot for child node. - */ - child(path) { - validateArgCount('DataSnapshot.child', 0, 1, arguments.length); - // Ensure the childPath is a string (can be a number) - path = String(path); - _validatePathString('DataSnapshot.child', 'path', path, false); - return new DataSnapshot(this._database, this._delegate.child(path)); - } - /** - * Returns whether the snapshot contains a child at the specified path. - * - * @param path - Path to a child. - * @returns Whether the child exists. - */ - hasChild(path) { - validateArgCount('DataSnapshot.hasChild', 1, 1, arguments.length); - _validatePathString('DataSnapshot.hasChild', 'path', path, false); - return this._delegate.hasChild(path); - } - /** - * Returns the priority of the object, or null if no priority was set. - * - * @returns The priority. - */ - getPriority() { - validateArgCount('DataSnapshot.getPriority', 0, 0, arguments.length); - return this._delegate.priority; - } - /** - * Iterates through child nodes and calls the specified action for each one. - * - * @param action - Callback function to be called - * for each child. - * @returns True if forEach was canceled by action returning true for - * one of the child nodes. - */ - forEach(action) { - validateArgCount('DataSnapshot.forEach', 1, 1, arguments.length); - validateCallback('DataSnapshot.forEach', 'action', action, false); - return this._delegate.forEach(expDataSnapshot => action(new DataSnapshot(this._database, expDataSnapshot))); - } - /** - * Returns whether this DataSnapshot has children. - * @returns True if the DataSnapshot contains 1 or more child nodes. - */ - hasChildren() { - validateArgCount('DataSnapshot.hasChildren', 0, 0, arguments.length); - return this._delegate.hasChildren(); - } - get key() { - return this._delegate.key; - } - /** - * Returns the number of children for this DataSnapshot. - * @returns The number of children that this DataSnapshot contains. - */ - numChildren() { - validateArgCount('DataSnapshot.numChildren', 0, 0, arguments.length); - return this._delegate.size; - } - /** - * @returns The Firebase reference for the location this snapshot's data came - * from. - */ - getRef() { - validateArgCount('DataSnapshot.ref', 0, 0, arguments.length); - return new Reference(this._database, this._delegate.ref); - } - get ref() { - return this.getRef(); - } -} -/** - * A Query represents a filter to be applied to a firebase location. This object purely represents the - * query expression (and exposes our public API to build the query). The actual query logic is in ViewBase.js. - * - * Since every Firebase reference is a query, Firebase inherits from this object. - */ -class Query { - constructor(database, _delegate) { - this.database = database; - this._delegate = _delegate; - } - on(eventType, callback, cancelCallbackOrContext, context) { - var _a; - validateArgCount('Query.on', 2, 4, arguments.length); - validateCallback('Query.on', 'callback', callback, false); - const ret = Query.getCancelAndContextArgs_('Query.on', cancelCallbackOrContext, context); - const valueCallback = (expSnapshot, previousChildName) => { - callback.call(ret.context, new DataSnapshot(this.database, expSnapshot), previousChildName); - }; - valueCallback.userCallback = callback; - valueCallback.context = ret.context; - const cancelCallback = (_a = ret.cancel) === null || _a === void 0 ? void 0 : _a.bind(ret.context); - switch (eventType) { - case 'value': - onValue(this._delegate, valueCallback, cancelCallback); - return callback; - case 'child_added': - onChildAdded(this._delegate, valueCallback, cancelCallback); - return callback; - case 'child_removed': - onChildRemoved(this._delegate, valueCallback, cancelCallback); - return callback; - case 'child_changed': - onChildChanged(this._delegate, valueCallback, cancelCallback); - return callback; - case 'child_moved': - onChildMoved(this._delegate, valueCallback, cancelCallback); - return callback; - default: - throw new Error(errorPrefix('Query.on', 'eventType') + - 'must be a valid event type = "value", "child_added", "child_removed", ' + - '"child_changed", or "child_moved".'); - } - } - off(eventType, callback, context) { - validateArgCount('Query.off', 0, 3, arguments.length); - validateEventType('Query.off', eventType, true); - validateCallback('Query.off', 'callback', callback, true); - validateContextObject('Query.off', 'context', context, true); - if (callback) { - const valueCallback = () => { }; - valueCallback.userCallback = callback; - valueCallback.context = context; - off(this._delegate, eventType, valueCallback); - } - else { - off(this._delegate, eventType); - } - } - /** - * Get the server-value for this query, or return a cached value if not connected. - */ - get() { - return get(this._delegate).then(expSnapshot => { - return new DataSnapshot(this.database, expSnapshot); - }); - } - /** - * Attaches a listener, waits for the first event, and then removes the listener - */ - once(eventType, callback, failureCallbackOrContext, context) { - validateArgCount('Query.once', 1, 4, arguments.length); - validateCallback('Query.once', 'callback', callback, true); - const ret = Query.getCancelAndContextArgs_('Query.once', failureCallbackOrContext, context); - const deferred = new Deferred(); - const valueCallback = (expSnapshot, previousChildName) => { - const result = new DataSnapshot(this.database, expSnapshot); - if (callback) { - callback.call(ret.context, result, previousChildName); - } - deferred.resolve(result); - }; - valueCallback.userCallback = callback; - valueCallback.context = ret.context; - const cancelCallback = (error) => { - if (ret.cancel) { - ret.cancel.call(ret.context, error); - } - deferred.reject(error); - }; - switch (eventType) { - case 'value': - onValue(this._delegate, valueCallback, cancelCallback, { - onlyOnce: true - }); - break; - case 'child_added': - onChildAdded(this._delegate, valueCallback, cancelCallback, { - onlyOnce: true - }); - break; - case 'child_removed': - onChildRemoved(this._delegate, valueCallback, cancelCallback, { - onlyOnce: true - }); - break; - case 'child_changed': - onChildChanged(this._delegate, valueCallback, cancelCallback, { - onlyOnce: true - }); - break; - case 'child_moved': - onChildMoved(this._delegate, valueCallback, cancelCallback, { - onlyOnce: true - }); - break; - default: - throw new Error(errorPrefix('Query.once', 'eventType') + - 'must be a valid event type = "value", "child_added", "child_removed", ' + - '"child_changed", or "child_moved".'); - } - return deferred.promise; - } - /** - * Set a limit and anchor it to the start of the window. - */ - limitToFirst(limit) { - validateArgCount('Query.limitToFirst', 1, 1, arguments.length); - return new Query(this.database, query(this._delegate, limitToFirst(limit))); - } - /** - * Set a limit and anchor it to the end of the window. - */ - limitToLast(limit) { - validateArgCount('Query.limitToLast', 1, 1, arguments.length); - return new Query(this.database, query(this._delegate, limitToLast(limit))); - } - /** - * Given a child path, return a new query ordered by the specified grandchild path. - */ - orderByChild(path) { - validateArgCount('Query.orderByChild', 1, 1, arguments.length); - return new Query(this.database, query(this._delegate, orderByChild(path))); - } - /** - * Return a new query ordered by the KeyIndex - */ - orderByKey() { - validateArgCount('Query.orderByKey', 0, 0, arguments.length); - return new Query(this.database, query(this._delegate, orderByKey())); - } - /** - * Return a new query ordered by the PriorityIndex - */ - orderByPriority() { - validateArgCount('Query.orderByPriority', 0, 0, arguments.length); - return new Query(this.database, query(this._delegate, orderByPriority())); - } - /** - * Return a new query ordered by the ValueIndex - */ - orderByValue() { - validateArgCount('Query.orderByValue', 0, 0, arguments.length); - return new Query(this.database, query(this._delegate, orderByValue())); - } - startAt(value = null, name) { - validateArgCount('Query.startAt', 0, 2, arguments.length); - return new Query(this.database, query(this._delegate, startAt(value, name))); - } - startAfter(value = null, name) { - validateArgCount('Query.startAfter', 0, 2, arguments.length); - return new Query(this.database, query(this._delegate, startAfter(value, name))); - } - endAt(value = null, name) { - validateArgCount('Query.endAt', 0, 2, arguments.length); - return new Query(this.database, query(this._delegate, endAt(value, name))); - } - endBefore(value = null, name) { - validateArgCount('Query.endBefore', 0, 2, arguments.length); - return new Query(this.database, query(this._delegate, endBefore(value, name))); - } - /** - * Load the selection of children with exactly the specified value, and, optionally, - * the specified name. - */ - equalTo(value, name) { - validateArgCount('Query.equalTo', 1, 2, arguments.length); - return new Query(this.database, query(this._delegate, equalTo(value, name))); - } - /** - * @returns URL for this location. - */ - toString() { - validateArgCount('Query.toString', 0, 0, arguments.length); - return this._delegate.toString(); - } - // Do not create public documentation. This is intended to make JSON serialization work but is otherwise unnecessary - // for end-users. - toJSON() { - // An optional spacer argument is unnecessary for a string. - validateArgCount('Query.toJSON', 0, 1, arguments.length); - return this._delegate.toJSON(); - } - /** - * Return true if this query and the provided query are equivalent; otherwise, return false. - */ - isEqual(other) { - validateArgCount('Query.isEqual', 1, 1, arguments.length); - if (!(other instanceof Query)) { - const error = 'Query.isEqual failed: First argument must be an instance of firebase.database.Query.'; - throw new Error(error); - } - return this._delegate.isEqual(other._delegate); - } - /** - * Helper used by .on and .once to extract the context and or cancel arguments. - * @param fnName - The function name (on or once) - * - */ - static getCancelAndContextArgs_(fnName, cancelOrContext, context) { - const ret = { cancel: undefined, context: undefined }; - if (cancelOrContext && context) { - ret.cancel = cancelOrContext; - validateCallback(fnName, 'cancel', ret.cancel, true); - ret.context = context; - validateContextObject(fnName, 'context', ret.context, true); - } - else if (cancelOrContext) { - // we have either a cancel callback or a context. - if (typeof cancelOrContext === 'object' && cancelOrContext !== null) { - // it's a context! - ret.context = cancelOrContext; - } - else if (typeof cancelOrContext === 'function') { - ret.cancel = cancelOrContext; - } - else { - throw new Error(errorPrefix(fnName, 'cancelOrContext') + - ' must either be a cancel callback or a context object.'); - } - } - return ret; - } - get ref() { - return new Reference(this.database, new _ReferenceImpl(this._delegate._repo, this._delegate._path)); - } -} -class Reference extends Query { - /** - * Call options: - * new Reference(Repo, Path) or - * new Reference(url: string, string|RepoManager) - * - * Externally - this is the firebase.database.Reference type. - */ - constructor(database, _delegate) { - super(database, new _QueryImpl(_delegate._repo, _delegate._path, new _QueryParams(), false)); - this.database = database; - this._delegate = _delegate; - } - /** @returns {?string} */ - getKey() { - validateArgCount('Reference.key', 0, 0, arguments.length); - return this._delegate.key; - } - child(pathString) { - validateArgCount('Reference.child', 1, 1, arguments.length); - if (typeof pathString === 'number') { - pathString = String(pathString); - } - return new Reference(this.database, child(this._delegate, pathString)); - } - /** @returns {?Reference} */ - getParent() { - validateArgCount('Reference.parent', 0, 0, arguments.length); - const parent = this._delegate.parent; - return parent ? new Reference(this.database, parent) : null; - } - /** @returns {!Reference} */ - getRoot() { - validateArgCount('Reference.root', 0, 0, arguments.length); - return new Reference(this.database, this._delegate.root); - } - set(newVal, onComplete) { - validateArgCount('Reference.set', 1, 2, arguments.length); - validateCallback('Reference.set', 'onComplete', onComplete, true); - const result = set(this._delegate, newVal); - if (onComplete) { - result.then(() => onComplete(null), error => onComplete(error)); - } - return result; - } - update(values, onComplete) { - validateArgCount('Reference.update', 1, 2, arguments.length); - if (Array.isArray(values)) { - const newObjectToMerge = {}; - for (let i = 0; i < values.length; ++i) { - newObjectToMerge['' + i] = values[i]; - } - values = newObjectToMerge; - warn('Passing an Array to Firebase.update() is deprecated. ' + - 'Use set() if you want to overwrite the existing data, or ' + - 'an Object with integer keys if you really do want to ' + - 'only update some of the children.'); - } - _validateWritablePath('Reference.update', this._delegate._path); - validateCallback('Reference.update', 'onComplete', onComplete, true); - const result = update(this._delegate, values); - if (onComplete) { - result.then(() => onComplete(null), error => onComplete(error)); - } - return result; - } - setWithPriority(newVal, newPriority, onComplete) { - validateArgCount('Reference.setWithPriority', 2, 3, arguments.length); - validateCallback('Reference.setWithPriority', 'onComplete', onComplete, true); - const result = setWithPriority(this._delegate, newVal, newPriority); - if (onComplete) { - result.then(() => onComplete(null), error => onComplete(error)); - } - return result; - } - remove(onComplete) { - validateArgCount('Reference.remove', 0, 1, arguments.length); - validateCallback('Reference.remove', 'onComplete', onComplete, true); - const result = remove(this._delegate); - if (onComplete) { - result.then(() => onComplete(null), error => onComplete(error)); - } - return result; - } - transaction(transactionUpdate, onComplete, applyLocally) { - validateArgCount('Reference.transaction', 1, 3, arguments.length); - validateCallback('Reference.transaction', 'transactionUpdate', transactionUpdate, false); - validateCallback('Reference.transaction', 'onComplete', onComplete, true); - validateBoolean('Reference.transaction', 'applyLocally', applyLocally, true); - const result = runTransaction(this._delegate, transactionUpdate, { - applyLocally - }).then(transactionResult => new TransactionResult(transactionResult.committed, new DataSnapshot(this.database, transactionResult.snapshot))); - if (onComplete) { - result.then(transactionResult => onComplete(null, transactionResult.committed, transactionResult.snapshot), error => onComplete(error, false, null)); - } - return result; - } - setPriority(priority, onComplete) { - validateArgCount('Reference.setPriority', 1, 2, arguments.length); - validateCallback('Reference.setPriority', 'onComplete', onComplete, true); - const result = setPriority(this._delegate, priority); - if (onComplete) { - result.then(() => onComplete(null), error => onComplete(error)); - } - return result; - } - push(value, onComplete) { - validateArgCount('Reference.push', 0, 2, arguments.length); - validateCallback('Reference.push', 'onComplete', onComplete, true); - const expPromise = push(this._delegate, value); - const promise = expPromise.then(expRef => new Reference(this.database, expRef)); - if (onComplete) { - promise.then(() => onComplete(null), error => onComplete(error)); - } - const result = new Reference(this.database, expPromise); - result.then = promise.then.bind(promise); - result.catch = promise.catch.bind(promise, undefined); - return result; - } - onDisconnect() { - _validateWritablePath('Reference.onDisconnect', this._delegate._path); - return new OnDisconnect(new OnDisconnect$1(this._delegate._repo, this._delegate._path)); - } - get key() { - return this.getKey(); - } - get parent() { - return this.getParent(); - } - get root() { - return this.getRoot(); - } -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Class representing a firebase database. - */ -class Database { - /** - * The constructor should not be called by users of our public API. - */ - constructor(_delegate, app) { - this._delegate = _delegate; - this.app = app; - this.INTERNAL = { - delete: () => this._delegate._delete(), - forceWebSockets, - forceLongPolling - }; - } - /** - * Modify this instance to communicate with the Realtime Database emulator. - * - *

Note: This method must be called before performing any other operation. - * - * @param host - the emulator host (ex: localhost) - * @param port - the emulator port (ex: 8080) - * @param options.mockUserToken - the mock auth token to use for unit testing Security Rules - */ - useEmulator(host, port, options = {}) { - connectDatabaseEmulator(this._delegate, host, port, options); - } - ref(path) { - validateArgCount('database.ref', 0, 1, arguments.length); - if (path instanceof Reference) { - const childRef = refFromURL(this._delegate, path.toString()); - return new Reference(this, childRef); - } - else { - const childRef = ref(this._delegate, path); - return new Reference(this, childRef); - } - } - /** - * Returns a reference to the root or the path specified in url. - * We throw a exception if the url is not in the same domain as the - * current repo. - * @returns Firebase reference. - */ - refFromURL(url) { - const apiName = 'database.refFromURL'; - validateArgCount(apiName, 1, 1, arguments.length); - const childRef = refFromURL(this._delegate, url); - return new Reference(this, childRef); - } - // Make individual repo go offline. - goOffline() { - validateArgCount('database.goOffline', 0, 0, arguments.length); - return goOffline(this._delegate); - } - goOnline() { - validateArgCount('database.goOnline', 0, 0, arguments.length); - return goOnline(this._delegate); - } -} -Database.ServerValue = { - TIMESTAMP: serverTimestamp(), - increment: (delta) => increment(delta) -}; - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Used by console to create a database based on the app, - * passed database URL and a custom auth implementation. - * - * @param app - A valid FirebaseApp-like object - * @param url - A valid Firebase databaseURL - * @param version - custom version e.g. firebase-admin version - * @param customAuthImpl - custom auth implementation - */ -function initStandalone({ app, url, version, customAuthImpl, namespace, nodeAdmin = false }) { - _setSDKVersion(version); - /** - * ComponentContainer('database-standalone') is just a placeholder that doesn't perform - * any actual function. - */ - const authProvider = new Provider('auth-internal', new ComponentContainer('database-standalone')); - authProvider.setComponent(new Component('auth-internal', () => customAuthImpl, "PRIVATE" /* ComponentType.PRIVATE */)); - return { - instance: new Database(_repoManagerDatabaseFromApp(app, authProvider, - /* appCheckProvider= */ undefined, url, nodeAdmin), app), - namespace - }; -} - -var INTERNAL = /*#__PURE__*/Object.freeze({ - __proto__: null, - initStandalone: initStandalone -}); - -/** - * @license - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -const ServerValue = Database.ServerValue; -function registerDatabase(instance) { - // Register the Database Service with the 'firebase' namespace. - instance.INTERNAL.registerComponent(new Component('database-compat', (container, { instanceIdentifier: url }) => { - /* Dependencies */ - // getImmediate for FirebaseApp will always succeed - const app = container.getProvider('app-compat').getImmediate(); - const databaseExp = container - .getProvider('database') - .getImmediate({ identifier: url }); - return new Database(databaseExp, app); - }, "PUBLIC" /* ComponentType.PUBLIC */) - .setServiceProps( - // firebase.database namespace properties - { - Reference, - Query, - Database, - DataSnapshot, - enableLogging, - INTERNAL, - ServerValue - }) - .setMultipleInstances(true)); - instance.registerVersion(name, version, 'node'); -} -registerDatabase(firebase); -//# sourceMappingURL=index.js.map diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/node-esm/package.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/node-esm/package.json deleted file mode 100644 index 7c34deb5..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/dist/node-esm/package.json +++ /dev/null @@ -1 +0,0 @@ -{"type":"module"} \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/package.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/package.json deleted file mode 100644 index da4605e9..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/package.json +++ /dev/null @@ -1,66 +0,0 @@ -{ - "name": "@firebase/database-compat", - "version": "0.2.10", - "description": "The Realtime Database component of the Firebase JS SDK.", - "author": "Firebase (https://firebase.google.com/)", - "main": "dist/index.js", - "browser": "dist/index.esm2017.js", - "module": "dist/index.esm2017.js", - "esm5": "dist/index.esm5.js", - "license": "Apache-2.0", - "typings": "dist/database-compat/src/index.d.ts", - "files": [ - "dist", - "standalone/package.json" - ], - "exports": { - ".": { - "types": "./dist/database-compat/src/index.d.ts", - "node": { - "types": "./dist/database-compat/src/index.node.d.ts", - "import": "./dist/node-esm/index.js", - "require": "./dist/index.js" - }, - "esm5": "./dist/index.esm5.js", - "default": "./dist/index.esm2017.js" - }, - "./standalone": { - "types": "./dist/database-compat/src/index.standalone.d.ts", - "node": "./dist/index.standalone.js" - }, - "./package.json": "./package.json" - }, - "scripts": { - "lint": "eslint -c .eslintrc.js '**/*.ts' --ignore-path '../../.gitignore'", - "lint:fix": "eslint --fix -c .eslintrc.js '**/*.ts' --ignore-path '../../.gitignore'", - "prettier": "prettier --write '*.js' '*.ts' '@(src|test)/**/*.ts'", - "build": "rollup -c rollup.config.js", - "build:release": "yarn build && yarn add-compat-overloads", - "build:deps": "lerna run --scope @firebase/database-compat --include-dependencies build", - "dev": "rollup -c -w", - "test": "run-p lint test:browser test:node", - "test:ci": "node ../../scripts/run_tests_in_ci.js -s test", - "test:browser": "karma start --single-run", - "test:node": "TS_NODE_FILES=true TS_NODE_CACHE=NO TS_NODE_COMPILER_OPTIONS='{\"module\":\"commonjs\"}' nyc --reporter lcovonly -- mocha 'test/{,!(browser)/**/}*.test.ts' --file src/index.node.ts --config ../../config/mocharc.node.js", - "add-compat-overloads": "ts-node-script ../../scripts/build/create-overloads.ts -i ../database/dist/public.d.ts -o dist/database-compat/src/index.d.ts -a -r Database:types.FirebaseDatabase -r Query:types.Query -r DatabaseReference:types.Reference -r FirebaseApp:FirebaseAppCompat --moduleToEnhance @firebase/database" - }, - "dependencies": { - "@firebase/database": "0.13.10", - "@firebase/database-types": "0.9.17", - "@firebase/logger": "0.3.4", - "@firebase/util": "1.7.3", - "@firebase/component": "0.5.21", - "tslib": "^2.1.0" - }, - "devDependencies": { - "@firebase/app-compat": "0.1.38" - }, - "repository": { - "directory": "packages/database-compat", - "type": "git", - "url": "https://github.com/firebase/firebase-js-sdk.git" - }, - "bugs": { - "url": "https://github.com/firebase/firebase-js-sdk/issues" - } -} \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/standalone/package.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/standalone/package.json deleted file mode 100644 index f9d39824..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-compat/standalone/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "@firebase/database-compat/standalone", - "description": "The entry point for sharing code with Admin SDK", - "main": "../dist/index.standalone.js", - "typings": "../dist/database-compat/src/index.standalone.d.ts", - "private": true -} \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-types/CHANGELOG.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-types/CHANGELOG.md deleted file mode 100644 index 6bb1fdfe..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-types/CHANGELOG.md +++ /dev/null @@ -1,194 +0,0 @@ -# @firebase/database-types - -## 0.9.17 - -### Patch Changes - -- [`4af28c1a4`](https://github.com/firebase/firebase-js-sdk/commit/4af28c1a42bd25ce2353f694ca1724c6101cbce5) [#6682](https://github.com/firebase/firebase-js-sdk/pull/6682) - Upgrade TypeScript to 4.7.4. - -- Updated dependencies [[`4af28c1a4`](https://github.com/firebase/firebase-js-sdk/commit/4af28c1a42bd25ce2353f694ca1724c6101cbce5)]: - - @firebase/app-types@0.8.1 - - @firebase/util@1.7.3 - -## 0.9.16 - -### Patch Changes - -- Updated dependencies [[`807f06aa2`](https://github.com/firebase/firebase-js-sdk/commit/807f06aa26438a91aaea08fd38efb6c706bb8a5d)]: - - @firebase/util@1.7.2 - -## 0.9.15 - -### Patch Changes - -- Updated dependencies [[`171b78b76`](https://github.com/firebase/firebase-js-sdk/commit/171b78b762826a640d267dd4dd172ad9459c4561), [`29d034072`](https://github.com/firebase/firebase-js-sdk/commit/29d034072c20af394ce384e42aa10a37d5dfcb18)]: - - @firebase/util@1.7.1 - -## 0.9.14 - -### Patch Changes - -- Updated dependencies [[`fdd4ab464`](https://github.com/firebase/firebase-js-sdk/commit/fdd4ab464b59a107bdcc195df3f01e32efd89ed4)]: - - @firebase/app-types@0.8.0 - - @firebase/util@1.7.0 - -## 0.9.13 - -### Patch Changes - -- [`9f1e3c667`](https://github.com/firebase/firebase-js-sdk/commit/9f1e3c66747126c8e24894d73f7fa27480bec08d) [#6536](https://github.com/firebase/firebase-js-sdk/pull/6536) - Revert "Updated type of action parameter for DataSnapshot#forEach" - -## 0.9.12 - -### Patch Changes - -- [`65838089d`](https://github.com/firebase/firebase-js-sdk/commit/65838089da47965e5e39e58c76a81a74666b215e) [#6374](https://github.com/firebase/firebase-js-sdk/pull/6374) (fixes [#6368](https://github.com/firebase/firebase-js-sdk/issues/6368)) - Updated type of action parameter for DataSnapshot#forEach - -## 0.9.11 - -### Patch Changes - -- Updated dependencies [[`b12af44a5`](https://github.com/firebase/firebase-js-sdk/commit/b12af44a5c7500e1192d6cc1a4afc4d77efadbaf)]: - - @firebase/util@1.6.3 - -## 0.9.10 - -### Patch Changes - -- Updated dependencies [[`efe2000fc`](https://github.com/firebase/firebase-js-sdk/commit/efe2000fc499e2c85c4e5e0fef6741ff3bad2eb0)]: - - @firebase/util@1.6.2 - -## 0.9.9 - -### Patch Changes - -- Updated dependencies [[`2cd1cc76f`](https://github.com/firebase/firebase-js-sdk/commit/2cd1cc76f2a308135cd60f424fe09084a34b5cb5)]: - - @firebase/util@1.6.1 - -## 0.9.8 - -### Patch Changes - -- Updated dependencies [[`9c5c9c36d`](https://github.com/firebase/firebase-js-sdk/commit/9c5c9c36da80b98b73cfd60ef2e2965087e9f801)]: - - @firebase/util@1.6.0 - -## 0.9.7 - -### Patch Changes - -- [`1c37b5e96`](https://github.com/firebase/firebase-js-sdk/commit/1c37b5e965978d796c46ff6b9f52051cf6070751) [#6090](https://github.com/firebase/firebase-js-sdk/pull/6090) (fixes [#6071](https://github.com/firebase/firebase-js-sdk/issues/6071)) - Updated typings for Reference methods - -- Updated dependencies [[`e9e5f6b3c`](https://github.com/firebase/firebase-js-sdk/commit/e9e5f6b3ca9d61323b22f87986d9959f5297ec59)]: - - @firebase/util@1.5.2 - -## 0.9.6 - -### Patch Changes - -- Updated dependencies [[`3198d58dc`](https://github.com/firebase/firebase-js-sdk/commit/3198d58dcedbf7583914dbcc76984f6f7df8d2ef)]: - - @firebase/util@1.5.1 - -## 0.9.5 - -### Patch Changes - -- Updated dependencies [[`2d672cead`](https://github.com/firebase/firebase-js-sdk/commit/2d672cead167187cb714cd89b638c0884ba58f03)]: - - @firebase/util@1.5.0 - -## 0.9.4 - -### Patch Changes - -- Updated dependencies [[`3b481f572`](https://github.com/firebase/firebase-js-sdk/commit/3b481f572456e1eab3435bfc25717770d95a8c49)]: - - @firebase/util@1.4.3 - -## 0.9.3 - -### Patch Changes - -- Updated dependencies [[`3281315fa`](https://github.com/firebase/firebase-js-sdk/commit/3281315fae9c6f535f9d5052ee17d60861ea569a)]: - - @firebase/util@1.4.2 - -## 0.9.2 - -### Patch Changes - -- Updated dependencies [[`2322b6023`](https://github.com/firebase/firebase-js-sdk/commit/2322b6023c628cd9f4f4172767c17d215dd91684)]: - - @firebase/util@1.4.1 - -## 0.9.1 - -### Patch Changes - -- Updated dependencies [[`a99943fe3`](https://github.com/firebase/firebase-js-sdk/commit/a99943fe3bd5279761aa29d138ec91272b06df39), [`b835b4cba`](https://github.com/firebase/firebase-js-sdk/commit/b835b4cbabc4b7b180ae38b908c49205ce31a422)]: - - @firebase/util@1.4.0 - -## 0.9.0 - -### Minor Changes - -- [`cdada6c68`](https://github.com/firebase/firebase-js-sdk/commit/cdada6c68f9740d13dd6674bcb658e28e68253b6) [#5345](https://github.com/firebase/firebase-js-sdk/pull/5345) (fixes [#5015](https://github.com/firebase/firebase-js-sdk/issues/5015)) - Release modularized SDKs - -### Patch Changes - -- Updated dependencies [[`cdada6c68`](https://github.com/firebase/firebase-js-sdk/commit/cdada6c68f9740d13dd6674bcb658e28e68253b6)]: - - @firebase/app-types@0.7.0 - -## 0.8.0 - -### Minor Changes - -- [`3c6a11c8d`](https://github.com/firebase/firebase-js-sdk/commit/3c6a11c8d0b35afddb50e9c3e0c4d2e30f642131) [#5282](https://github.com/firebase/firebase-js-sdk/pull/5282) - Implement mockUserToken for Storage and fix JWT format bugs. - -### Patch Changes - -- Updated dependencies [[`3c6a11c8d`](https://github.com/firebase/firebase-js-sdk/commit/3c6a11c8d0b35afddb50e9c3e0c4d2e30f642131)]: - - @firebase/util@1.3.0 - -## 0.7.3 - -### Patch Changes - -- Updated dependencies [[`3d10d33bc`](https://github.com/firebase/firebase-js-sdk/commit/3d10d33bc167177fecbf86d2a6574af2e4e210f9)]: - - @firebase/app-types@0.6.3 - -## 0.7.2 - -### Patch Changes - -- [`e46ebb743`](https://github.com/firebase/firebase-js-sdk/commit/e46ebb743f670f3b7d2160164addeddf918fb0cb) [#4765](https://github.com/firebase/firebase-js-sdk/pull/4765) - Update types to be consistent with the main index.d.ts - -## 0.7.1 - -### Patch Changes - -- Updated dependencies [[`f24d8961b`](https://github.com/firebase/firebase-js-sdk/commit/f24d8961b3b87821413297688803fc85113086b3)]: - - @firebase/app-types@0.6.2 - -## 0.7.0 - -### Minor Changes - -- [`05614aa86`](https://github.com/firebase/firebase-js-sdk/commit/05614aa86614994b69df154bd6ce34861fae37a5) [#4427](https://github.com/firebase/firebase-js-sdk/pull/4427) - Add `startAfter()` and `endBefore()` to the Realtime Database TypeScript definitions. - -## 0.6.1 - -### Patch Changes - -- [`4f6313262`](https://github.com/firebase/firebase-js-sdk/commit/4f63132622fa46ca7373ab93440c76bcb1822620) [#4096](https://github.com/firebase/firebase-js-sdk/pull/4096) - Add the missing type definition for 'Query.get()' for RTDB - -## 0.6.0 - -### Minor Changes - -- [`ef33328f7`](https://github.com/firebase/firebase-js-sdk/commit/ef33328f7cb7d585a1304ed39649f5b69a111b3c) [#3904](https://github.com/firebase/firebase-js-sdk/pull/3904) - Add a useEmulator(host, port) method to Realtime Database - -### Patch Changes - -- [`602ec18e9`](https://github.com/firebase/firebase-js-sdk/commit/602ec18e92fd365a3a6432ff3a5f6a31013eb1f5) [#3968](https://github.com/firebase/firebase-js-sdk/pull/3968) - Updated the type definition for `ThenableReference` to only implement `then` and `catch`, which matches the implementation. - -## 0.5.2 - -### Patch Changes - -- [`ef348fed`](https://github.com/firebase/firebase-js-sdk/commit/ef348fed291338351706a697cbb9fb17a9d06ff4) [#3511](https://github.com/firebase/firebase-js-sdk/pull/3511) - Added interface `Database` which is implemented by `FirebaseDatabase`. This allows consumer SDKs (such as the Firebase Admin SDK) to export the database types as an interface. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-types/README.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-types/README.md deleted file mode 100644 index 681f6b3b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-types/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# @firebase/database-types - -**This package is not intended for direct usage, and should only be used via the officially supported [firebase](https://www.npmjs.com/package/firebase) package.** diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-types/index.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-types/index.d.ts deleted file mode 100644 index 680a4a54..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-types/index.d.ts +++ /dev/null @@ -1,171 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { FirebaseApp } from '@firebase/app-types'; -import { EmulatorMockTokenOptions } from '@firebase/util'; - -export interface DataSnapshot { - child(path: string): DataSnapshot; - exists(): boolean; - exportVal(): any; - forEach(action: (a: DataSnapshot) => boolean | void): boolean; - getPriority(): string | number | null; - hasChild(path: string): boolean; - hasChildren(): boolean; - key: string | null; - numChildren(): number; - ref: Reference; - toJSON(): Object | null; - val(): any; -} - -export interface Database { - app: FirebaseApp; - useEmulator( - host: string, - port: number, - options?: { - mockUserToken?: EmulatorMockTokenOptions | string; - } - ): void; - goOffline(): void; - goOnline(): void; - ref(path?: string | Reference): Reference; - refFromURL(url: string): Reference; -} - -export class FirebaseDatabase implements Database { - private constructor(); - app: FirebaseApp; - useEmulator( - host: string, - port: number, - options?: { - mockUserToken?: EmulatorMockTokenOptions | string; - } - ): void; - goOffline(): void; - goOnline(): void; - ref(path?: string | Reference): Reference; - refFromURL(url: string): Reference; -} - -export interface OnDisconnect { - cancel(onComplete?: (a: Error | null) => any): Promise; - remove(onComplete?: (a: Error | null) => any): Promise; - set(value: any, onComplete?: (a: Error | null) => any): Promise; - setWithPriority( - value: any, - priority: number | string | null, - onComplete?: (a: Error | null) => any - ): Promise; - update(values: Object, onComplete?: (a: Error | null) => any): Promise; -} - -type EventType = - | 'value' - | 'child_added' - | 'child_changed' - | 'child_moved' - | 'child_removed'; - -export interface Query { - endBefore(value: number | string | boolean | null, key?: string): Query; - endAt(value: number | string | boolean | null, key?: string): Query; - equalTo(value: number | string | boolean | null, key?: string): Query; - isEqual(other: Query | null): boolean; - limitToFirst(limit: number): Query; - limitToLast(limit: number): Query; - off( - eventType?: EventType, - callback?: (a: DataSnapshot, b?: string | null) => any, - context?: Object | null - ): void; - get(): Promise; - on( - eventType: EventType, - callback: (a: DataSnapshot, b?: string | null) => any, - cancelCallbackOrContext?: ((a: Error) => any) | Object | null, - context?: Object | null - ): (a: DataSnapshot | null, b?: string | null) => any; - once( - eventType: EventType, - successCallback?: (a: DataSnapshot, b?: string | null) => any, - failureCallbackOrContext?: ((a: Error) => void) | Object | null, - context?: Object | null - ): Promise; - orderByChild(path: string): Query; - orderByKey(): Query; - orderByPriority(): Query; - orderByValue(): Query; - ref: Reference; - startAt(value: number | string | boolean | null, key?: string): Query; - startAfter(value: number | string | boolean | null, key?: string): Query; - toJSON(): Object; - toString(): string; -} - -export interface Reference extends Query { - child(path: string): Reference; - key: string | null; - onDisconnect(): OnDisconnect; - parent: Reference | null; - push(value?: any, onComplete?: (a: Error | null) => any): ThenableReference; - remove(onComplete?: (a: Error | null) => void): Promise; - root: Reference; - set(value: any, onComplete?: (a: Error | null) => void): Promise; - setPriority( - priority: string | number | null, - onComplete: (a: Error | null) => void - ): Promise; - setWithPriority( - newVal: any, - newPriority: string | number | null, - onComplete?: (a: Error | null) => void - ): Promise; - transaction( - transactionUpdate: (a: any) => any, - onComplete?: (a: Error | null, b: boolean, c: DataSnapshot | null) => void, - applyLocally?: boolean - ): Promise; - update(values: Object, onComplete?: (a: Error | null) => void): Promise; -} - -export interface ServerValue { - TIMESTAMP: Object; - increment(delta: number): Object; -} - -export interface TransactionResult { - committed: boolean; - snapshot: DataSnapshot; -} - -export interface ThenableReference - extends Reference, - Pick, 'then' | 'catch'> {} - -export function enableLogging( - logger?: boolean | ((a: string) => any), - persistent?: boolean -): any; - -declare module '@firebase/component' { - interface NameServiceMapping { - 'database-compat': FirebaseDatabase; - } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-types/package.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-types/package.json deleted file mode 100644 index fc87a852..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database-types/package.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "name": "@firebase/database-types", - "version": "0.9.17", - "description": "@firebase/database Types", - "author": "Firebase (https://firebase.google.com/)", - "license": "Apache-2.0", - "scripts": { - "test": "tsc", - "test:ci": "node ../../scripts/run_tests_in_ci.js" - }, - "files": [ - "index.d.ts" - ], - "dependencies": { - "@firebase/app-types": "0.8.1", - "@firebase/util": "1.7.3" - }, - "repository": { - "directory": "packages/database-types", - "type": "git", - "url": "https://github.com/firebase/firebase-js-sdk.git" - }, - "bugs": { - "url": "https://github.com/firebase/firebase-js-sdk/issues" - }, - "devDependencies": { - "typescript": "4.2.2" - } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/CHANGELOG.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/CHANGELOG.md deleted file mode 100644 index 882a6936..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/CHANGELOG.md +++ /dev/null @@ -1,534 +0,0 @@ -# Unreleased - -## 0.13.10 - -### Patch Changes - -- [`4af28c1a4`](https://github.com/firebase/firebase-js-sdk/commit/4af28c1a42bd25ce2353f694ca1724c6101cbce5) [#6682](https://github.com/firebase/firebase-js-sdk/pull/6682) - Upgrade TypeScript to 4.7.4. - -- Updated dependencies [[`4af28c1a4`](https://github.com/firebase/firebase-js-sdk/commit/4af28c1a42bd25ce2353f694ca1724c6101cbce5)]: - - @firebase/auth-interop-types@0.1.7 - - @firebase/component@0.5.21 - - @firebase/logger@0.3.4 - - @firebase/util@1.7.3 - -## 0.13.9 - -### Patch Changes - -- Updated dependencies [[`807f06aa2`](https://github.com/firebase/firebase-js-sdk/commit/807f06aa26438a91aaea08fd38efb6c706bb8a5d)]: - - @firebase/util@1.7.2 - - @firebase/component@0.5.20 - -## 0.13.8 - -### Patch Changes - -- [`5aa48d0ab`](https://github.com/firebase/firebase-js-sdk/commit/5aa48d0ab432002ccf49d65bf2ff637e82a2b402) [#6583](https://github.com/firebase/firebase-js-sdk/pull/6583) - Fixed `endBefore` and `push` documentation typos in RTDB - -* [`171b78b76`](https://github.com/firebase/firebase-js-sdk/commit/171b78b762826a640d267dd4dd172ad9459c4561) [#6673](https://github.com/firebase/firebase-js-sdk/pull/6673) - Handle IPv6 addresses in emulator autoinit. - -* Updated dependencies [[`171b78b76`](https://github.com/firebase/firebase-js-sdk/commit/171b78b762826a640d267dd4dd172ad9459c4561), [`29d034072`](https://github.com/firebase/firebase-js-sdk/commit/29d034072c20af394ce384e42aa10a37d5dfcb18)]: - - @firebase/util@1.7.1 - - @firebase/component@0.5.19 - -## 0.13.7 - -### Patch Changes - -- [`fdd4ab464`](https://github.com/firebase/firebase-js-sdk/commit/fdd4ab464b59a107bdcc195df3f01e32efd89ed4) [#6526](https://github.com/firebase/firebase-js-sdk/pull/6526) - Add functionality to auto-initialize project config and emulator settings from global defaults provided by framework tooling. - -- Updated dependencies [[`fdd4ab464`](https://github.com/firebase/firebase-js-sdk/commit/fdd4ab464b59a107bdcc195df3f01e32efd89ed4)]: - - @firebase/util@1.7.0 - - @firebase/component@0.5.18 - -## 0.13.6 - -### Patch Changes - -- [`f35533594`](https://github.com/firebase/firebase-js-sdk/commit/f355335942b874ba390bcbf3be6de44a3d33dce8) [#6560](https://github.com/firebase/firebase-js-sdk/pull/6560) - Included experimental support for Deno - -## 0.13.5 - -### Patch Changes - -- [`9f1e3c667`](https://github.com/firebase/firebase-js-sdk/commit/9f1e3c66747126c8e24894d73f7fa27480bec08d) [#6536](https://github.com/firebase/firebase-js-sdk/pull/6536) - Revert "Updated type of action parameter for DataSnapshot#forEach" - -* [`a5d9e1083`](https://github.com/firebase/firebase-js-sdk/commit/a5d9e10831c2877e9d15c8a33b15557e4251c4de) [#6497](https://github.com/firebase/firebase-js-sdk/pull/6497) - Fix issue with how get results for filtered queries are added to cache. - Fix issue with events not getting propagated to listeners by get. - -- [`fcd4b8ac3`](https://github.com/firebase/firebase-js-sdk/commit/fcd4b8ac36636a60d83cd3370969ff9192f9e6ad) [#6508](https://github.com/firebase/firebase-js-sdk/pull/6508) - Fixed faulty transaction bug causing filtered index queries to override default queries. - -## 0.13.4 - -### Patch Changes - -- [`65838089d`](https://github.com/firebase/firebase-js-sdk/commit/65838089da47965e5e39e58c76a81a74666b215e) [#6374](https://github.com/firebase/firebase-js-sdk/pull/6374) (fixes [#6368](https://github.com/firebase/firebase-js-sdk/issues/6368)) - Updated type of action parameter for DataSnapshot#forEach - -## 0.13.3 - -### Patch Changes - -- [`c187446a2`](https://github.com/firebase/firebase-js-sdk/commit/c187446a202d881f55800be167cdb37b4d0e4a13) [#6410](https://github.com/firebase/firebase-js-sdk/pull/6410) - Removed uuid as a dependency for @firebase/database - -* [`b12af44a5`](https://github.com/firebase/firebase-js-sdk/commit/b12af44a5c7500e1192d6cc1a4afc4d77efadbaf) [#6340](https://github.com/firebase/firebase-js-sdk/pull/6340) (fixes [#6036](https://github.com/firebase/firebase-js-sdk/issues/6036)) - Forced `get()` to wait until db is online to resolve. - -- [`6a8be1337`](https://github.com/firebase/firebase-js-sdk/commit/6a8be1337f19a49db40e0c757f571f42b5b4d494) [#6399](https://github.com/firebase/firebase-js-sdk/pull/6399) - Fix setting of headers on Node. - -- Updated dependencies [[`b12af44a5`](https://github.com/firebase/firebase-js-sdk/commit/b12af44a5c7500e1192d6cc1a4afc4d77efadbaf)]: - - @firebase/util@1.6.3 - - @firebase/component@0.5.17 - -## 0.13.2 - -### Patch Changes - -- [`578dc5836`](https://github.com/firebase/firebase-js-sdk/commit/578dc58365c6c71d8ad01dd8b9dbe829e76de068) [#6273](https://github.com/firebase/firebase-js-sdk/pull/6273) - Fixed issue where `get()` saved results incorrectly for non-default queries. - -* [`efe2000fc`](https://github.com/firebase/firebase-js-sdk/commit/efe2000fc499e2c85c4e5e0fef6741ff3bad2eb0) [#6363](https://github.com/firebase/firebase-js-sdk/pull/6363) - Extract uuid function into @firebase/util - -* Updated dependencies [[`efe2000fc`](https://github.com/firebase/firebase-js-sdk/commit/efe2000fc499e2c85c4e5e0fef6741ff3bad2eb0)]: - - @firebase/util@1.6.2 - - @firebase/component@0.5.16 - -## 0.13.1 - -### Patch Changes - -- [`2cd1cc76f`](https://github.com/firebase/firebase-js-sdk/commit/2cd1cc76f2a308135cd60f424fe09084a34b5cb5) [#6307](https://github.com/firebase/firebase-js-sdk/pull/6307) (fixes [#6300](https://github.com/firebase/firebase-js-sdk/issues/6300)) - fix: add type declarations to exports field - -- Updated dependencies [[`2cd1cc76f`](https://github.com/firebase/firebase-js-sdk/commit/2cd1cc76f2a308135cd60f424fe09084a34b5cb5)]: - - @firebase/component@0.5.15 - - @firebase/logger@0.3.3 - - @firebase/util@1.6.1 - -## 0.13.0 - -### Minor Changes - -- [`9c6808fea`](https://github.com/firebase/firebase-js-sdk/commit/9c6808fea231d1ab6de6f6ab548c67b751a12a78) [#6171](https://github.com/firebase/firebase-js-sdk/pull/6171) - Add `forceWebSockets()` and `forceLongPolling()` - -### Patch Changes - -- [`874cdbbcc`](https://github.com/firebase/firebase-js-sdk/commit/874cdbbccbc2bf8f4ee18abe220e87dc52e6a8db) [#6232](https://github.com/firebase/firebase-js-sdk/pull/6232) - Added GMPID to websocket connection. - -- Updated dependencies [[`9c5c9c36d`](https://github.com/firebase/firebase-js-sdk/commit/9c5c9c36da80b98b73cfd60ef2e2965087e9f801)]: - - @firebase/util@1.6.0 - - @firebase/component@0.5.14 - -## 0.12.8 - -### Patch Changes - -- [`7a4e65cef`](https://github.com/firebase/firebase-js-sdk/commit/7a4e65cef9468a20fb32dc112aa7113345bc76c5) [#6126](https://github.com/firebase/firebase-js-sdk/pull/6126) - Fix issue where if a websocket protocol was used in the databaseURL, `webSocketOnly` field was incorrectly set to undefined. (When using `wss` or `ws` protocols in the databaseURL, webSocketOnly will be true and longPolling will be disabled) - -- Updated dependencies [[`e9e5f6b3c`](https://github.com/firebase/firebase-js-sdk/commit/e9e5f6b3ca9d61323b22f87986d9959f5297ec59)]: - - @firebase/util@1.5.2 - - @firebase/component@0.5.13 - -## 0.12.7 - -### Patch Changes - -- Updated dependencies [[`3198d58dc`](https://github.com/firebase/firebase-js-sdk/commit/3198d58dcedbf7583914dbcc76984f6f7df8d2ef)]: - - @firebase/util@1.5.1 - - @firebase/component@0.5.12 - -## 0.12.6 - -### Patch Changes - -- Updated dependencies [[`2d672cead`](https://github.com/firebase/firebase-js-sdk/commit/2d672cead167187cb714cd89b638c0884ba58f03)]: - - @firebase/util@1.5.0 - - @firebase/component@0.5.11 - -## 0.12.5 - -### Patch Changes - -- Updated dependencies [[`3b481f572`](https://github.com/firebase/firebase-js-sdk/commit/3b481f572456e1eab3435bfc25717770d95a8c49)]: - - @firebase/util@1.4.3 - - @firebase/component@0.5.10 - -## 0.12.4 - -### Patch Changes - -- [`3281315fa`](https://github.com/firebase/firebase-js-sdk/commit/3281315fae9c6f535f9d5052ee17d60861ea569a) [#5708](https://github.com/firebase/firebase-js-sdk/pull/5708) (fixes [#1487](https://github.com/firebase/firebase-js-sdk/issues/1487)) - Update build scripts to work with the exports field - -- Updated dependencies [[`3281315fa`](https://github.com/firebase/firebase-js-sdk/commit/3281315fae9c6f535f9d5052ee17d60861ea569a)]: - - @firebase/component@0.5.9 - - @firebase/logger@0.3.2 - - @firebase/util@1.4.2 - -## 0.12.3 - -### Patch Changes - -- [`2322b6023`](https://github.com/firebase/firebase-js-sdk/commit/2322b6023c628cd9f4f4172767c17d215dd91684) [#5693](https://github.com/firebase/firebase-js-sdk/pull/5693) - Add exports field to all packages - -- Updated dependencies [[`2322b6023`](https://github.com/firebase/firebase-js-sdk/commit/2322b6023c628cd9f4f4172767c17d215dd91684)]: - - @firebase/component@0.5.8 - - @firebase/logger@0.3.1 - - @firebase/util@1.4.1 - -## 0.12.2 - -### Patch Changes - -- [`93795c780`](https://github.com/firebase/firebase-js-sdk/commit/93795c7801d6b28ccbbe5855fd2f3fc377b1db5f) [#5596](https://github.com/firebase/firebase-js-sdk/pull/5596) - report build variants for packages - -## 0.12.1 - -### Patch Changes - -- [`dfe65ff9b`](https://github.com/firebase/firebase-js-sdk/commit/dfe65ff9bfa66d318d45e2a666e302867ae53a01) [#5537](https://github.com/firebase/firebase-js-sdk/pull/5537) - Added an entry point `@firebase/database-compat/standalone` to share code with Admin SDK properly - -- Updated dependencies [[`a99943fe3`](https://github.com/firebase/firebase-js-sdk/commit/a99943fe3bd5279761aa29d138ec91272b06df39), [`b835b4cba`](https://github.com/firebase/firebase-js-sdk/commit/b835b4cbabc4b7b180ae38b908c49205ce31a422)]: - - @firebase/logger@0.3.0 - - @firebase/util@1.4.0 - - @firebase/component@0.5.7 - -## 0.12.0 - -### Minor Changes - -- [`cdada6c68`](https://github.com/firebase/firebase-js-sdk/commit/cdada6c68f9740d13dd6674bcb658e28e68253b6) [#5345](https://github.com/firebase/firebase-js-sdk/pull/5345) (fixes [#5015](https://github.com/firebase/firebase-js-sdk/issues/5015)) - Release modularized SDKs - -## 0.11.0 - -### Minor Changes - -- [`3c6a11c8d`](https://github.com/firebase/firebase-js-sdk/commit/3c6a11c8d0b35afddb50e9c3e0c4d2e30f642131) [#5282](https://github.com/firebase/firebase-js-sdk/pull/5282) - Implement mockUserToken for Storage and fix JWT format bugs. - -### Patch Changes - -- Updated dependencies [[`bb6b5abff`](https://github.com/firebase/firebase-js-sdk/commit/bb6b5abff6f89ce9ec1bd66ff4e795a059a98eec), [`3c6a11c8d`](https://github.com/firebase/firebase-js-sdk/commit/3c6a11c8d0b35afddb50e9c3e0c4d2e30f642131)]: - - @firebase/component@0.5.6 - - @firebase/database-types@0.8.0 - - @firebase/util@1.3.0 - -## 0.10.9 - -### Patch Changes - -- Updated dependencies [[`a3cbe719b`](https://github.com/firebase/firebase-js-sdk/commit/a3cbe719b1bd733a5c4c15ee0d0e6388d512054c)]: - - @firebase/util@1.2.0 - - @firebase/component@0.5.5 - - @firebase/database-types@0.7.3 - -## 0.10.8 - -### Patch Changes - -- [`fb3e35965`](https://github.com/firebase/firebase-js-sdk/commit/fb3e35965b23f88e318dd877fabade16cdcb6385) [#5146](https://github.com/firebase/firebase-js-sdk/pull/5146) - Fix sending of auth tokens on node. - -## 0.10.7 - -### Patch Changes - -- [`99414a51c`](https://github.com/firebase/firebase-js-sdk/commit/99414a51ca5cd25f69a96e4c9949ad5b84e3f64e) [#5082](https://github.com/firebase/firebase-js-sdk/pull/5082) - On Node, always send Auth and AppCheck tokens when they are available. - -## 0.10.6 - -### Patch Changes - -- Updated dependencies [[`56a6a9d4a`](https://github.com/firebase/firebase-js-sdk/commit/56a6a9d4af2766154584a0f66d3c4d8024d74ba5)]: - - @firebase/component@0.5.4 - -## 0.10.5 - -### Patch Changes - -- Updated dependencies [[`725ab4684`](https://github.com/firebase/firebase-js-sdk/commit/725ab4684ef0999a12f71e704c204a00fb030e5d)]: - - @firebase/component@0.5.3 - -## 0.10.4 - -### Patch Changes - -- Updated dependencies [[`4c4b6aed9`](https://github.com/firebase/firebase-js-sdk/commit/4c4b6aed9757c9a7e75fb698a15e53274f93880b)]: - - @firebase/component@0.5.2 - -## 0.10.3 - -### Patch Changes - -- Updated dependencies [[`5fbc5fb01`](https://github.com/firebase/firebase-js-sdk/commit/5fbc5fb0140d7da980fd7ebbfbae810f8c64ae19)]: - - @firebase/component@0.5.1 - -## 0.10.2 - -### Patch Changes - -- [`2a5039ee3`](https://github.com/firebase/firebase-js-sdk/commit/2a5039ee3242fb4109da9dee36ac978d78519334) [#4796](https://github.com/firebase/firebase-js-sdk/pull/4796) - Fix `index not defined` errors for orderByChild get requests - -## 0.10.1 - -### Patch Changes - -- [`5b202f852`](https://github.com/firebase/firebase-js-sdk/commit/5b202f852ca68b35b06b0ea17e4b6b8c446c651c) [#4864](https://github.com/firebase/firebase-js-sdk/pull/4864) - Fixed an issue that could cause `once()` to fire more than once if the value was modified inside its callback. - -## 0.10.0 - -### Minor Changes - -- [`ac4ad08a2`](https://github.com/firebase/firebase-js-sdk/commit/ac4ad08a284397ec966e991dd388bb1fba857467) [#4792](https://github.com/firebase/firebase-js-sdk/pull/4792) - Add mockUserToken support for database emulator. - -### Patch Changes - -- Updated dependencies [[`c34ac7a92`](https://github.com/firebase/firebase-js-sdk/commit/c34ac7a92a616915f38d192654db7770d81747ae), [`ac4ad08a2`](https://github.com/firebase/firebase-js-sdk/commit/ac4ad08a284397ec966e991dd388bb1fba857467)]: - - @firebase/component@0.5.0 - - @firebase/util@1.1.0 - -## 0.9.12 - -### Patch Changes - -- [`8d63eacf9`](https://github.com/firebase/firebase-js-sdk/commit/8d63eacf964c6e6b3b8ffe06bf682844ee430fbc) [#4832](https://github.com/firebase/firebase-js-sdk/pull/4832) (fixes [#4818](https://github.com/firebase/firebase-js-sdk/issues/4818)) - Fixes an issue that prevented the SDK from firing cancel events for Rules violations. - -* [`d422436d1`](https://github.com/firebase/firebase-js-sdk/commit/d422436d1d83f82aee8028e3a24c8e18d9d7c098) [#4828](https://github.com/firebase/firebase-js-sdk/pull/4828) (fixes [#4811](https://github.com/firebase/firebase-js-sdk/issues/4811)) - Fixes a regression introduced with 8.4.1 that broke `useEmulator()`. - -## 0.9.11 - -### Patch Changes - -- [`191184eb4`](https://github.com/firebase/firebase-js-sdk/commit/191184eb454109bff9198274fc416664b126d7ec) [#4801](https://github.com/firebase/firebase-js-sdk/pull/4801) - Fixes an internal conflict when using v8 and v9 SDKs in the same package. - -- Updated dependencies [[`3f370215a`](https://github.com/firebase/firebase-js-sdk/commit/3f370215aa571db6b41b92a7d8a9aaad2ea0ecd0)]: - - @firebase/auth-interop-types@0.1.6 - -## 0.9.10 - -### Patch Changes - -- [`74fa5064a`](https://github.com/firebase/firebase-js-sdk/commit/74fa5064ae6a183b229975dc858c5ee0f567d0d4) [#4777](https://github.com/firebase/firebase-js-sdk/pull/4777) - Fix a build issue that caused SDK breakage. - -## 0.9.9 - -### Patch Changes - -- [`7354a0ed4`](https://github.com/firebase/firebase-js-sdk/commit/7354a0ed438f4e3df6577e4927e8c8f8f1fbbfda) [#4720](https://github.com/firebase/firebase-js-sdk/pull/4720) - Internal changes to Database and Validation APIs. - -- Updated dependencies [[`e46ebb743`](https://github.com/firebase/firebase-js-sdk/commit/e46ebb743f670f3b7d2160164addeddf918fb0cb), [`7354a0ed4`](https://github.com/firebase/firebase-js-sdk/commit/7354a0ed438f4e3df6577e4927e8c8f8f1fbbfda)]: - - @firebase/database-types@0.7.2 - - @firebase/util@1.0.0 - - @firebase/component@0.4.1 - -## 0.9.8 - -### Patch Changes - -- Updated dependencies [[`f24d8961b`](https://github.com/firebase/firebase-js-sdk/commit/f24d8961b3b87821413297688803fc85113086b3)]: - - @firebase/component@0.4.0 - - @firebase/database-types@0.7.1 - -## 0.9.7 - -### Patch Changes - -- Updated dependencies [[`de5f90501`](https://github.com/firebase/firebase-js-sdk/commit/de5f9050137acc9ed1490082e5aa429b5de3cb2a)]: - - @firebase/util@0.4.1 - - @firebase/component@0.3.1 - -## 0.9.6 - -### Patch Changes - -- [`5c1a83ed7`](https://github.com/firebase/firebase-js-sdk/commit/5c1a83ed70bae979322bd8751c0885d683ce4bf3) [#4595](https://github.com/firebase/firebase-js-sdk/pull/4595) - Component facotry now takes an options object. And added `Provider.initialize()` that can be used to pass an options object to the component factory. - -- Updated dependencies [[`5c1a83ed7`](https://github.com/firebase/firebase-js-sdk/commit/5c1a83ed70bae979322bd8751c0885d683ce4bf3)]: - - @firebase/component@0.3.0 - -## 0.9.5 - -### Patch Changes - -- Updated dependencies [[`ec95df3d0`](https://github.com/firebase/firebase-js-sdk/commit/ec95df3d07e5f091f2a7f7327e46417f64d04b4e)]: - - @firebase/util@0.4.0 - - @firebase/component@0.2.1 - -## 0.9.4 - -### Patch Changes - -- Updated dependencies [[`6afe42613`](https://github.com/firebase/firebase-js-sdk/commit/6afe42613ed3d7a842d378dc1a09a795811db2ac)]: - - @firebase/component@0.2.0 - -## 0.9.3 - -### Patch Changes - -- [`318af5471`](https://github.com/firebase/firebase-js-sdk/commit/318af54715dc61a09897b144dd8841fec1abd8a3) [#4408](https://github.com/firebase/firebase-js-sdk/pull/4408) - Fixed an issue with `Query.get()` where Query filters are not applied to data in some cases. - -* [`05614aa86`](https://github.com/firebase/firebase-js-sdk/commit/05614aa86614994b69df154bd6ce34861fae37a5) [#4427](https://github.com/firebase/firebase-js-sdk/pull/4427) - Add `startAfter()` and `endBefore()` to the Realtime Database TypeScript definitions. - -* Updated dependencies [[`05614aa86`](https://github.com/firebase/firebase-js-sdk/commit/05614aa86614994b69df154bd6ce34861fae37a5)]: - - @firebase/database-types@0.7.0 - -## 0.9.2 - -### Patch Changes - -- [`0af2bdfc6`](https://github.com/firebase/firebase-js-sdk/commit/0af2bdfc6b8be3f362cd630e2a917c5a070c568e) [#4363](https://github.com/firebase/firebase-js-sdk/pull/4363) - Fixed an issue with startAfter/endBefore when used in orderByKey queries - -## 0.9.1 - -### Patch Changes - -- [`04a0fea9e`](https://github.com/firebase/firebase-js-sdk/commit/04a0fea9ef291a7da244665289a1aed32e4e7a3b) [#4299](https://github.com/firebase/firebase-js-sdk/pull/4299) - get()s issued for queries that are being listened to no longer send backend requests. - -## 0.9.0 - -### Minor Changes - -- [`cb835e723`](https://github.com/firebase/firebase-js-sdk/commit/cb835e723fab2a85a4e073a3f09354e3e6520dd1) [#4232](https://github.com/firebase/firebase-js-sdk/pull/4232) - Add `startAfter` and `endBefore` filters for paginating RTDB queries. - -## 0.8.3 - -### Patch Changes - -- [`50abe6c4d`](https://github.com/firebase/firebase-js-sdk/commit/50abe6c4d455693ef6a3a3c1bc8ef6ab5b8bd9ea) [#4199](https://github.com/firebase/firebase-js-sdk/pull/4199) - Fixes an issue that caused `refFromUrl()` to reject production database URLs when `useEmulator()` was used. - -## 0.8.2 - -### Patch Changes - -- [`487f8e1d2`](https://github.com/firebase/firebase-js-sdk/commit/487f8e1d2c6bd1a54305f2b0f148b4985f3cea8e) [#4247](https://github.com/firebase/firebase-js-sdk/pull/4247) (fixes [#3681](https://github.com/firebase/firebase-js-sdk/issues/3681)) - Fix issue with multiple database instances when using Realtime Database emulator (#3681) - -## 0.8.1 - -### Patch Changes - -- Updated dependencies [[`4f6313262`](https://github.com/firebase/firebase-js-sdk/commit/4f63132622fa46ca7373ab93440c76bcb1822620)]: - - @firebase/database-types@0.6.1 - -## 0.8.0 - -### Minor Changes - -- [`34973cde2`](https://github.com/firebase/firebase-js-sdk/commit/34973cde218e570baccd235d5bb6c6146559f80b) [#3812](https://github.com/firebase/firebase-js-sdk/pull/3812) - Add a `get` method for database queries that returns server result when connected - -## 0.7.1 - -### Patch Changes - -- Updated dependencies [[`9cf727fcc`](https://github.com/firebase/firebase-js-sdk/commit/9cf727fcc3d049551b16ae0698ac33dc2fe45ada)]: - - @firebase/util@0.3.4 - - @firebase/component@0.1.21 - -## 0.7.0 - -### Minor Changes - -- [`ef33328f7`](https://github.com/firebase/firebase-js-sdk/commit/ef33328f7cb7d585a1304ed39649f5b69a111b3c) [#3904](https://github.com/firebase/firebase-js-sdk/pull/3904) - Add a useEmulator(host, port) method to Realtime Database - -### Patch Changes - -- [`a5768b0aa`](https://github.com/firebase/firebase-js-sdk/commit/a5768b0aa7d7ce732279931aa436e988c9f36487) [#3932](https://github.com/firebase/firebase-js-sdk/pull/3932) - Point browser field to esm build. Now you need to use default import instead of namespace import to import firebase. - - Before this change - - ``` - import * as firebase from 'firebase/app'; - ``` - - After this change - - ``` - import firebase from 'firebase/app'; - ``` - -* [`602ec18e9`](https://github.com/firebase/firebase-js-sdk/commit/602ec18e92fd365a3a6432ff3a5f6a31013eb1f5) [#3968](https://github.com/firebase/firebase-js-sdk/pull/3968) - Updated the type definition for `ThenableReference` to only implement `then` and `catch`, which matches the implementation. - -* Updated dependencies [[`ef33328f7`](https://github.com/firebase/firebase-js-sdk/commit/ef33328f7cb7d585a1304ed39649f5b69a111b3c), [`a5768b0aa`](https://github.com/firebase/firebase-js-sdk/commit/a5768b0aa7d7ce732279931aa436e988c9f36487), [`7d916d905`](https://github.com/firebase/firebase-js-sdk/commit/7d916d905ba16816ac8ac7c8748c83831ff614ce), [`602ec18e9`](https://github.com/firebase/firebase-js-sdk/commit/602ec18e92fd365a3a6432ff3a5f6a31013eb1f5)]: - - @firebase/database-types@0.6.0 - - @firebase/component@0.1.20 - - @firebase/util@0.3.3 - -## 0.6.13 - -### Patch Changes - -- [`3d9b5a595`](https://github.com/firebase/firebase-js-sdk/commit/3d9b5a595813b6c4f7f6ef4e3625ae8856a9fa23) [#3736](https://github.com/firebase/firebase-js-sdk/pull/3736) - Fix detection of admin context in Realtime Database SDK - -## 0.6.12 - -### Patch Changes - -- [`d347c6ca1`](https://github.com/firebase/firebase-js-sdk/commit/d347c6ca1bcb7cd48ab2e4f7954cabafe761aea7) [#3650](https://github.com/firebase/firebase-js-sdk/pull/3650) - The SDK can now infer a default database URL if none is provided in the config. - -- Updated dependencies [[`da1c7df79`](https://github.com/firebase/firebase-js-sdk/commit/da1c7df7982b08bbef82fcc8d93255f3e2d23cca), [`fb3b095e4`](https://github.com/firebase/firebase-js-sdk/commit/fb3b095e4b7c8f57fdb3172bc039c84576abf290)]: - - @firebase/component@0.1.19 - - @firebase/util@0.3.2 - -## 0.6.11 - -### Patch Changes - -- Updated dependencies [[`d4ca3da0`](https://github.com/firebase/firebase-js-sdk/commit/d4ca3da0a59fcea1261ba69d7eb663bba38d3089)]: - - @firebase/util@0.3.1 - - @firebase/component@0.1.18 - -## 0.6.10 - -### Patch Changes - -- [`ef348fed`](https://github.com/firebase/firebase-js-sdk/commit/ef348fed291338351706a697cbb9fb17a9d06ff4) [#3511](https://github.com/firebase/firebase-js-sdk/pull/3511) - Added interface `Database` which is implemented by `FirebaseDatabase`. This allows consumer SDKs (such as the Firebase Admin SDK) to export the database types as an interface. - -- Updated dependencies [[`ef348fed`](https://github.com/firebase/firebase-js-sdk/commit/ef348fed291338351706a697cbb9fb17a9d06ff4)]: - - @firebase/database-types@0.5.2 - -## 0.6.9 - -### Patch Changes - -- Updated dependencies [[`a87676b8`](https://github.com/firebase/firebase-js-sdk/commit/a87676b84b78ccc2f057a22eb947a5d13402949c)]: - - @firebase/util@0.3.0 - - @firebase/component@0.1.17 - -## 0.6.8 - -### Patch Changes - -- [`c2b737b2`](https://github.com/firebase/firebase-js-sdk/commit/c2b737b2187cb525af4d926ca477102db7835420) [#3228](https://github.com/firebase/firebase-js-sdk/pull/3228) Thanks [@schmidt-sebastian](https://github.com/schmidt-sebastian)! - [fix] Instead of using production auth, the SDK will use test credentials - to connect to the Emulator when the RTDB SDK is used via the Firebase - Admin SDK. - -## 0.6.7 - -### Patch Changes - -- [`a754645e`](https://github.com/firebase/firebase-js-sdk/commit/a754645ec2be1b8c205f25f510196eee298b0d6e) [#3297](https://github.com/firebase/firebase-js-sdk/pull/3297) Thanks [@renovate](https://github.com/apps/renovate)! - Update dependency typescript to v3.9.5 - -- Updated dependencies [[`a754645e`](https://github.com/firebase/firebase-js-sdk/commit/a754645ec2be1b8c205f25f510196eee298b0d6e)]: - - @firebase/component@0.1.16 - - @firebase/logger@0.2.6 -- [changed] Added internal HTTP header to the WebSocket connection. -- [feature] Added ServerValue.increment() to support atomic field value increments - without transactions. -- [fixed] Fixed Realtime Database URL parsing bug to support domains with more than 3 components. - -## 0.5.6 - -- [fixed] Fixed an issue that caused large numeric values with leading zeros to - not always be sorted correctly. - -## 0.5.3 - -- [changed] Internal cleanup to Node.JS support. - -## 0.5.0 - -- [fixed] Fixed an issue that caused `.info/serverTimeOffset` events not to fire (#2043). -- [changed] Treat `ns` url query parameter as the default Realtime Database - namespace name. - -## 0.4.11 - -- [fixed] Fixed an issue where multi-byte UTF-8 characters would not be written correctly when using `firebase.js` or `firebase-database.js` (#2035). - -## 0.4.0 - -- [changed] Improved consistency between the type annotations for `Query.on`/`Reference.on`, - `Query.off`/`Reference.off` and `Query.once`/`Reference.once` (#1188, #1204). diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/README.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/README.md deleted file mode 100644 index 5fc92ccc..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# @firebase/database - -This is the Firebase Realtime Database component of the Firebase JS SDK. - -**This package is not intended for direct usage, and should only be used via the officially supported [firebase](https://www.npmjs.com/package/firebase) package.** diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/index.esm2017.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/index.esm2017.js deleted file mode 100644 index 06eb8069..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/index.esm2017.js +++ /dev/null @@ -1,14021 +0,0 @@ -import { _getProvider, getApp, SDK_VERSION as SDK_VERSION$1, _registerComponent, registerVersion } from '@firebase/app'; -import { Component } from '@firebase/component'; -import { stringify, jsonEval, contains, assert, isNodeSdk, stringToByteArray, Sha1, base64, deepCopy, base64Encode, isMobileCordova, stringLength, Deferred, safeGet, isAdmin, isValidFormat, isEmpty, isReactNative, assertionError, map, querystring, errorPrefix, getModularInstance, getDefaultEmulatorHostnameAndPort, createMockUserToken } from '@firebase/util'; -import { Logger, LogLevel } from '@firebase/logger'; - -const name = "@firebase/database"; -const version = "0.13.10"; - -/** - * @license - * Copyright 2019 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** The semver (www.semver.org) version of the SDK. */ -let SDK_VERSION = ''; -/** - * SDK_VERSION should be set before any database instance is created - * @internal - */ -function setSDKVersion(version) { - SDK_VERSION = version; -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Wraps a DOM Storage object and: - * - automatically encode objects as JSON strings before storing them to allow us to store arbitrary types. - * - prefixes names with "firebase:" to avoid collisions with app data. - * - * We automatically (see storage.js) create two such wrappers, one for sessionStorage, - * and one for localStorage. - * - */ -class DOMStorageWrapper { - /** - * @param domStorage_ - The underlying storage object (e.g. localStorage or sessionStorage) - */ - constructor(domStorage_) { - this.domStorage_ = domStorage_; - // Use a prefix to avoid collisions with other stuff saved by the app. - this.prefix_ = 'firebase:'; - } - /** - * @param key - The key to save the value under - * @param value - The value being stored, or null to remove the key. - */ - set(key, value) { - if (value == null) { - this.domStorage_.removeItem(this.prefixedName_(key)); - } - else { - this.domStorage_.setItem(this.prefixedName_(key), stringify(value)); - } - } - /** - * @returns The value that was stored under this key, or null - */ - get(key) { - const storedVal = this.domStorage_.getItem(this.prefixedName_(key)); - if (storedVal == null) { - return null; - } - else { - return jsonEval(storedVal); - } - } - remove(key) { - this.domStorage_.removeItem(this.prefixedName_(key)); - } - prefixedName_(name) { - return this.prefix_ + name; - } - toString() { - return this.domStorage_.toString(); - } -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * An in-memory storage implementation that matches the API of DOMStorageWrapper - * (TODO: create interface for both to implement). - */ -class MemoryStorage { - constructor() { - this.cache_ = {}; - this.isInMemoryStorage = true; - } - set(key, value) { - if (value == null) { - delete this.cache_[key]; - } - else { - this.cache_[key] = value; - } - } - get(key) { - if (contains(this.cache_, key)) { - return this.cache_[key]; - } - return null; - } - remove(key) { - delete this.cache_[key]; - } -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Helper to create a DOMStorageWrapper or else fall back to MemoryStorage. - * TODO: Once MemoryStorage and DOMStorageWrapper have a shared interface this method annotation should change - * to reflect this type - * - * @param domStorageName - Name of the underlying storage object - * (e.g. 'localStorage' or 'sessionStorage'). - * @returns Turning off type information until a common interface is defined. - */ -const createStoragefor = function (domStorageName) { - try { - // NOTE: just accessing "localStorage" or "window['localStorage']" may throw a security exception, - // so it must be inside the try/catch. - if (typeof window !== 'undefined' && - typeof window[domStorageName] !== 'undefined') { - // Need to test cache. Just because it's here doesn't mean it works - const domStorage = window[domStorageName]; - domStorage.setItem('firebase:sentinel', 'cache'); - domStorage.removeItem('firebase:sentinel'); - return new DOMStorageWrapper(domStorage); - } - } - catch (e) { } - // Failed to create wrapper. Just return in-memory storage. - // TODO: log? - return new MemoryStorage(); -}; -/** A storage object that lasts across sessions */ -const PersistentStorage = createStoragefor('localStorage'); -/** A storage object that only lasts one session */ -const SessionStorage = createStoragefor('sessionStorage'); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -const logClient = new Logger('@firebase/database'); -/** - * Returns a locally-unique ID (generated by just incrementing up from 0 each time its called). - */ -const LUIDGenerator = (function () { - let id = 1; - return function () { - return id++; - }; -})(); -/** - * Sha1 hash of the input string - * @param str - The string to hash - * @returns {!string} The resulting hash - */ -const sha1 = function (str) { - const utf8Bytes = stringToByteArray(str); - const sha1 = new Sha1(); - sha1.update(utf8Bytes); - const sha1Bytes = sha1.digest(); - return base64.encodeByteArray(sha1Bytes); -}; -const buildLogMessage_ = function (...varArgs) { - let message = ''; - for (let i = 0; i < varArgs.length; i++) { - const arg = varArgs[i]; - if (Array.isArray(arg) || - (arg && - typeof arg === 'object' && - // eslint-disable-next-line @typescript-eslint/no-explicit-any - typeof arg.length === 'number')) { - message += buildLogMessage_.apply(null, arg); - } - else if (typeof arg === 'object') { - message += stringify(arg); - } - else { - message += arg; - } - message += ' '; - } - return message; -}; -/** - * Use this for all debug messages in Firebase. - */ -let logger = null; -/** - * Flag to check for log availability on first log message - */ -let firstLog_ = true; -/** - * The implementation of Firebase.enableLogging (defined here to break dependencies) - * @param logger_ - A flag to turn on logging, or a custom logger - * @param persistent - Whether or not to persist logging settings across refreshes - */ -const enableLogging$1 = function (logger_, persistent) { - assert(!persistent || logger_ === true || logger_ === false, "Can't turn on custom loggers persistently."); - if (logger_ === true) { - logClient.logLevel = LogLevel.VERBOSE; - logger = logClient.log.bind(logClient); - if (persistent) { - SessionStorage.set('logging_enabled', true); - } - } - else if (typeof logger_ === 'function') { - logger = logger_; - } - else { - logger = null; - SessionStorage.remove('logging_enabled'); - } -}; -const log = function (...varArgs) { - if (firstLog_ === true) { - firstLog_ = false; - if (logger === null && SessionStorage.get('logging_enabled') === true) { - enableLogging$1(true); - } - } - if (logger) { - const message = buildLogMessage_.apply(null, varArgs); - logger(message); - } -}; -const logWrapper = function (prefix) { - return function (...varArgs) { - log(prefix, ...varArgs); - }; -}; -const error = function (...varArgs) { - const message = 'FIREBASE INTERNAL ERROR: ' + buildLogMessage_(...varArgs); - logClient.error(message); -}; -const fatal = function (...varArgs) { - const message = `FIREBASE FATAL ERROR: ${buildLogMessage_(...varArgs)}`; - logClient.error(message); - throw new Error(message); -}; -const warn = function (...varArgs) { - const message = 'FIREBASE WARNING: ' + buildLogMessage_(...varArgs); - logClient.warn(message); -}; -/** - * Logs a warning if the containing page uses https. Called when a call to new Firebase - * does not use https. - */ -const warnIfPageIsSecure = function () { - // Be very careful accessing browser globals. Who knows what may or may not exist. - if (typeof window !== 'undefined' && - window.location && - window.location.protocol && - window.location.protocol.indexOf('https:') !== -1) { - warn('Insecure Firebase access from a secure page. ' + - 'Please use https in calls to new Firebase().'); - } -}; -/** - * Returns true if data is NaN, or +/- Infinity. - */ -const isInvalidJSONNumber = function (data) { - return (typeof data === 'number' && - (data !== data || // NaN - data === Number.POSITIVE_INFINITY || - data === Number.NEGATIVE_INFINITY)); -}; -const executeWhenDOMReady = function (fn) { - if (isNodeSdk() || document.readyState === 'complete') { - fn(); - } - else { - // Modeled after jQuery. Try DOMContentLoaded and onreadystatechange (which - // fire before onload), but fall back to onload. - let called = false; - const wrappedFn = function () { - if (!document.body) { - setTimeout(wrappedFn, Math.floor(10)); - return; - } - if (!called) { - called = true; - fn(); - } - }; - if (document.addEventListener) { - document.addEventListener('DOMContentLoaded', wrappedFn, false); - // fallback to onload. - window.addEventListener('load', wrappedFn, false); - // eslint-disable-next-line @typescript-eslint/no-explicit-any - } - else if (document.attachEvent) { - // IE. - // eslint-disable-next-line @typescript-eslint/no-explicit-any - document.attachEvent('onreadystatechange', () => { - if (document.readyState === 'complete') { - wrappedFn(); - } - }); - // fallback to onload. - // eslint-disable-next-line @typescript-eslint/no-explicit-any - window.attachEvent('onload', wrappedFn); - // jQuery has an extra hack for IE that we could employ (based on - // http://javascript.nwbox.com/IEContentLoaded/) But it looks really old. - // I'm hoping we don't need it. - } - } -}; -/** - * Minimum key name. Invalid for actual data, used as a marker to sort before any valid names - */ -const MIN_NAME = '[MIN_NAME]'; -/** - * Maximum key name. Invalid for actual data, used as a marker to sort above any valid names - */ -const MAX_NAME = '[MAX_NAME]'; -/** - * Compares valid Firebase key names, plus min and max name - */ -const nameCompare = function (a, b) { - if (a === b) { - return 0; - } - else if (a === MIN_NAME || b === MAX_NAME) { - return -1; - } - else if (b === MIN_NAME || a === MAX_NAME) { - return 1; - } - else { - const aAsInt = tryParseInt(a), bAsInt = tryParseInt(b); - if (aAsInt !== null) { - if (bAsInt !== null) { - return aAsInt - bAsInt === 0 ? a.length - b.length : aAsInt - bAsInt; - } - else { - return -1; - } - } - else if (bAsInt !== null) { - return 1; - } - else { - return a < b ? -1 : 1; - } - } -}; -/** - * @returns {!number} comparison result. - */ -const stringCompare = function (a, b) { - if (a === b) { - return 0; - } - else if (a < b) { - return -1; - } - else { - return 1; - } -}; -const requireKey = function (key, obj) { - if (obj && key in obj) { - return obj[key]; - } - else { - throw new Error('Missing required key (' + key + ') in object: ' + stringify(obj)); - } -}; -const ObjectToUniqueKey = function (obj) { - if (typeof obj !== 'object' || obj === null) { - return stringify(obj); - } - const keys = []; - // eslint-disable-next-line guard-for-in - for (const k in obj) { - keys.push(k); - } - // Export as json, but with the keys sorted. - keys.sort(); - let key = '{'; - for (let i = 0; i < keys.length; i++) { - if (i !== 0) { - key += ','; - } - key += stringify(keys[i]); - key += ':'; - key += ObjectToUniqueKey(obj[keys[i]]); - } - key += '}'; - return key; -}; -/** - * Splits a string into a number of smaller segments of maximum size - * @param str - The string - * @param segsize - The maximum number of chars in the string. - * @returns The string, split into appropriately-sized chunks - */ -const splitStringBySize = function (str, segsize) { - const len = str.length; - if (len <= segsize) { - return [str]; - } - const dataSegs = []; - for (let c = 0; c < len; c += segsize) { - if (c + segsize > len) { - dataSegs.push(str.substring(c, len)); - } - else { - dataSegs.push(str.substring(c, c + segsize)); - } - } - return dataSegs; -}; -/** - * Apply a function to each (key, value) pair in an object or - * apply a function to each (index, value) pair in an array - * @param obj - The object or array to iterate over - * @param fn - The function to apply - */ -function each(obj, fn) { - for (const key in obj) { - if (obj.hasOwnProperty(key)) { - fn(key, obj[key]); - } - } -} -/** - * Borrowed from http://hg.secondlife.com/llsd/src/tip/js/typedarray.js (MIT License) - * I made one modification at the end and removed the NaN / Infinity - * handling (since it seemed broken [caused an overflow] and we don't need it). See MJL comments. - * @param v - A double - * - */ -const doubleToIEEE754String = function (v) { - assert(!isInvalidJSONNumber(v), 'Invalid JSON number'); // MJL - const ebits = 11, fbits = 52; - const bias = (1 << (ebits - 1)) - 1; - let s, e, f, ln, i; - // Compute sign, exponent, fraction - // Skip NaN / Infinity handling --MJL. - if (v === 0) { - e = 0; - f = 0; - s = 1 / v === -Infinity ? 1 : 0; - } - else { - s = v < 0; - v = Math.abs(v); - if (v >= Math.pow(2, 1 - bias)) { - // Normalized - ln = Math.min(Math.floor(Math.log(v) / Math.LN2), bias); - e = ln + bias; - f = Math.round(v * Math.pow(2, fbits - ln) - Math.pow(2, fbits)); - } - else { - // Denormalized - e = 0; - f = Math.round(v / Math.pow(2, 1 - bias - fbits)); - } - } - // Pack sign, exponent, fraction - const bits = []; - for (i = fbits; i; i -= 1) { - bits.push(f % 2 ? 1 : 0); - f = Math.floor(f / 2); - } - for (i = ebits; i; i -= 1) { - bits.push(e % 2 ? 1 : 0); - e = Math.floor(e / 2); - } - bits.push(s ? 1 : 0); - bits.reverse(); - const str = bits.join(''); - // Return the data as a hex string. --MJL - let hexByteString = ''; - for (i = 0; i < 64; i += 8) { - let hexByte = parseInt(str.substr(i, 8), 2).toString(16); - if (hexByte.length === 1) { - hexByte = '0' + hexByte; - } - hexByteString = hexByteString + hexByte; - } - return hexByteString.toLowerCase(); -}; -/** - * Used to detect if we're in a Chrome content script (which executes in an - * isolated environment where long-polling doesn't work). - */ -const isChromeExtensionContentScript = function () { - return !!(typeof window === 'object' && - window['chrome'] && - window['chrome']['extension'] && - !/^chrome/.test(window.location.href)); -}; -/** - * Used to detect if we're in a Windows 8 Store app. - */ -const isWindowsStoreApp = function () { - // Check for the presence of a couple WinRT globals - return typeof Windows === 'object' && typeof Windows.UI === 'object'; -}; -/** - * Converts a server error code to a Javascript Error - */ -function errorForServerCode(code, query) { - let reason = 'Unknown Error'; - if (code === 'too_big') { - reason = - 'The data requested exceeds the maximum size ' + - 'that can be accessed with a single request.'; - } - else if (code === 'permission_denied') { - reason = "Client doesn't have permission to access the desired data."; - } - else if (code === 'unavailable') { - reason = 'The service is unavailable'; - } - const error = new Error(code + ' at ' + query._path.toString() + ': ' + reason); - // eslint-disable-next-line @typescript-eslint/no-explicit-any - error.code = code.toUpperCase(); - return error; -} -/** - * Used to test for integer-looking strings - */ -const INTEGER_REGEXP_ = new RegExp('^-?(0*)\\d{1,10}$'); -/** - * For use in keys, the minimum possible 32-bit integer. - */ -const INTEGER_32_MIN = -2147483648; -/** - * For use in kyes, the maximum possible 32-bit integer. - */ -const INTEGER_32_MAX = 2147483647; -/** - * If the string contains a 32-bit integer, return it. Else return null. - */ -const tryParseInt = function (str) { - if (INTEGER_REGEXP_.test(str)) { - const intVal = Number(str); - if (intVal >= INTEGER_32_MIN && intVal <= INTEGER_32_MAX) { - return intVal; - } - } - return null; -}; -/** - * Helper to run some code but catch any exceptions and re-throw them later. - * Useful for preventing user callbacks from breaking internal code. - * - * Re-throwing the exception from a setTimeout is a little evil, but it's very - * convenient (we don't have to try to figure out when is a safe point to - * re-throw it), and the behavior seems reasonable: - * - * * If you aren't pausing on exceptions, you get an error in the console with - * the correct stack trace. - * * If you're pausing on all exceptions, the debugger will pause on your - * exception and then again when we rethrow it. - * * If you're only pausing on uncaught exceptions, the debugger will only pause - * on us re-throwing it. - * - * @param fn - The code to guard. - */ -const exceptionGuard = function (fn) { - try { - fn(); - } - catch (e) { - // Re-throw exception when it's safe. - setTimeout(() => { - // It used to be that "throw e" would result in a good console error with - // relevant context, but as of Chrome 39, you just get the firebase.js - // file/line number where we re-throw it, which is useless. So we log - // e.stack explicitly. - const stack = e.stack || ''; - warn('Exception was thrown by user callback.', stack); - throw e; - }, Math.floor(0)); - } -}; -/** - * @returns {boolean} true if we think we're currently being crawled. - */ -const beingCrawled = function () { - const userAgent = (typeof window === 'object' && - window['navigator'] && - window['navigator']['userAgent']) || - ''; - // For now we whitelist the most popular crawlers. We should refine this to be the set of crawlers we - // believe to support JavaScript/AJAX rendering. - // NOTE: Google Webmaster Tools doesn't really belong, but their "This is how a visitor to your website - // would have seen the page" is flaky if we don't treat it as a crawler. - return (userAgent.search(/googlebot|google webmaster tools|bingbot|yahoo! slurp|baiduspider|yandexbot|duckduckbot/i) >= 0); -}; -/** - * Same as setTimeout() except on Node.JS it will /not/ prevent the process from exiting. - * - * It is removed with clearTimeout() as normal. - * - * @param fn - Function to run. - * @param time - Milliseconds to wait before running. - * @returns The setTimeout() return value. - */ -const setTimeoutNonBlocking = function (fn, time) { - const timeout = setTimeout(fn, time); - // Note: at the time of this comment, unrefTimer is under the unstable set of APIs. Run with --unstable to enable the API. - if (typeof timeout === 'number' && - // @ts-ignore Is only defined in Deno environments. - typeof Deno !== 'undefined' && - // @ts-ignore Deno and unrefTimer are only defined in Deno environments. - Deno['unrefTimer']) { - // @ts-ignore Deno and unrefTimer are only defined in Deno environments. - Deno.unrefTimer(timeout); - // eslint-disable-next-line @typescript-eslint/no-explicit-any - } - else if (typeof timeout === 'object' && timeout['unref']) { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - timeout['unref'](); - } - return timeout; -}; - -/** - * @license - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Abstraction around AppCheck's token fetching capabilities. - */ -class AppCheckTokenProvider { - constructor(appName_, appCheckProvider) { - this.appName_ = appName_; - this.appCheckProvider = appCheckProvider; - this.appCheck = appCheckProvider === null || appCheckProvider === void 0 ? void 0 : appCheckProvider.getImmediate({ optional: true }); - if (!this.appCheck) { - appCheckProvider === null || appCheckProvider === void 0 ? void 0 : appCheckProvider.get().then(appCheck => (this.appCheck = appCheck)); - } - } - getToken(forceRefresh) { - if (!this.appCheck) { - return new Promise((resolve, reject) => { - // Support delayed initialization of FirebaseAppCheck. This allows our - // customers to initialize the RTDB SDK before initializing Firebase - // AppCheck and ensures that all requests are authenticated if a token - // becomes available before the timoeout below expires. - setTimeout(() => { - if (this.appCheck) { - this.getToken(forceRefresh).then(resolve, reject); - } - else { - resolve(null); - } - }, 0); - }); - } - return this.appCheck.getToken(forceRefresh); - } - addTokenChangeListener(listener) { - var _a; - (_a = this.appCheckProvider) === null || _a === void 0 ? void 0 : _a.get().then(appCheck => appCheck.addTokenListener(listener)); - } - notifyForInvalidToken() { - warn(`Provided AppCheck credentials for the app named "${this.appName_}" ` + - 'are invalid. This usually indicates your app was not initialized correctly.'); - } -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Abstraction around FirebaseApp's token fetching capabilities. - */ -class FirebaseAuthTokenProvider { - constructor(appName_, firebaseOptions_, authProvider_) { - this.appName_ = appName_; - this.firebaseOptions_ = firebaseOptions_; - this.authProvider_ = authProvider_; - this.auth_ = null; - this.auth_ = authProvider_.getImmediate({ optional: true }); - if (!this.auth_) { - authProvider_.onInit(auth => (this.auth_ = auth)); - } - } - getToken(forceRefresh) { - if (!this.auth_) { - return new Promise((resolve, reject) => { - // Support delayed initialization of FirebaseAuth. This allows our - // customers to initialize the RTDB SDK before initializing Firebase - // Auth and ensures that all requests are authenticated if a token - // becomes available before the timoeout below expires. - setTimeout(() => { - if (this.auth_) { - this.getToken(forceRefresh).then(resolve, reject); - } - else { - resolve(null); - } - }, 0); - }); - } - return this.auth_.getToken(forceRefresh).catch(error => { - // TODO: Need to figure out all the cases this is raised and whether - // this makes sense. - if (error && error.code === 'auth/token-not-initialized') { - log('Got auth/token-not-initialized error. Treating as null token.'); - return null; - } - else { - return Promise.reject(error); - } - }); - } - addTokenChangeListener(listener) { - // TODO: We might want to wrap the listener and call it with no args to - // avoid a leaky abstraction, but that makes removing the listener harder. - if (this.auth_) { - this.auth_.addAuthTokenListener(listener); - } - else { - this.authProvider_ - .get() - .then(auth => auth.addAuthTokenListener(listener)); - } - } - removeTokenChangeListener(listener) { - this.authProvider_ - .get() - .then(auth => auth.removeAuthTokenListener(listener)); - } - notifyForInvalidToken() { - let errorMessage = 'Provided authentication credentials for the app named "' + - this.appName_ + - '" are invalid. This usually indicates your app was not ' + - 'initialized correctly. '; - if ('credential' in this.firebaseOptions_) { - errorMessage += - 'Make sure the "credential" property provided to initializeApp() ' + - 'is authorized to access the specified "databaseURL" and is from the correct ' + - 'project.'; - } - else if ('serviceAccount' in this.firebaseOptions_) { - errorMessage += - 'Make sure the "serviceAccount" property provided to initializeApp() ' + - 'is authorized to access the specified "databaseURL" and is from the correct ' + - 'project.'; - } - else { - errorMessage += - 'Make sure the "apiKey" and "databaseURL" properties provided to ' + - 'initializeApp() match the values provided for your app at ' + - 'https://console.firebase.google.com/.'; - } - warn(errorMessage); - } -} -/* AuthTokenProvider that supplies a constant token. Used by Admin SDK or mockUserToken with emulators. */ -class EmulatorTokenProvider { - constructor(accessToken) { - this.accessToken = accessToken; - } - getToken(forceRefresh) { - return Promise.resolve({ - accessToken: this.accessToken - }); - } - addTokenChangeListener(listener) { - // Invoke the listener immediately to match the behavior in Firebase Auth - // (see packages/auth/src/auth.js#L1807) - listener(this.accessToken); - } - removeTokenChangeListener(listener) { } - notifyForInvalidToken() { } -} -/** A string that is treated as an admin access token by the RTDB emulator. Used by Admin SDK. */ -EmulatorTokenProvider.OWNER = 'owner'; - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -const PROTOCOL_VERSION = '5'; -const VERSION_PARAM = 'v'; -const TRANSPORT_SESSION_PARAM = 's'; -const REFERER_PARAM = 'r'; -const FORGE_REF = 'f'; -// Matches console.firebase.google.com, firebase-console-*.corp.google.com and -// firebase.corp.google.com -const FORGE_DOMAIN_RE = /(console\.firebase|firebase-console-\w+\.corp|firebase\.corp)\.google\.com/; -const LAST_SESSION_PARAM = 'ls'; -const APPLICATION_ID_PARAM = 'p'; -const APP_CHECK_TOKEN_PARAM = 'ac'; -const WEBSOCKET = 'websocket'; -const LONG_POLLING = 'long_polling'; - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * A class that holds metadata about a Repo object - */ -class RepoInfo { - /** - * @param host - Hostname portion of the url for the repo - * @param secure - Whether or not this repo is accessed over ssl - * @param namespace - The namespace represented by the repo - * @param webSocketOnly - Whether to prefer websockets over all other transports (used by Nest). - * @param nodeAdmin - Whether this instance uses Admin SDK credentials - * @param persistenceKey - Override the default session persistence storage key - */ - constructor(host, secure, namespace, webSocketOnly, nodeAdmin = false, persistenceKey = '', includeNamespaceInQueryParams = false) { - this.secure = secure; - this.namespace = namespace; - this.webSocketOnly = webSocketOnly; - this.nodeAdmin = nodeAdmin; - this.persistenceKey = persistenceKey; - this.includeNamespaceInQueryParams = includeNamespaceInQueryParams; - this._host = host.toLowerCase(); - this._domain = this._host.substr(this._host.indexOf('.') + 1); - this.internalHost = - PersistentStorage.get('host:' + host) || this._host; - } - isCacheableHost() { - return this.internalHost.substr(0, 2) === 's-'; - } - isCustomHost() { - return (this._domain !== 'firebaseio.com' && - this._domain !== 'firebaseio-demo.com'); - } - get host() { - return this._host; - } - set host(newHost) { - if (newHost !== this.internalHost) { - this.internalHost = newHost; - if (this.isCacheableHost()) { - PersistentStorage.set('host:' + this._host, this.internalHost); - } - } - } - toString() { - let str = this.toURLString(); - if (this.persistenceKey) { - str += '<' + this.persistenceKey + '>'; - } - return str; - } - toURLString() { - const protocol = this.secure ? 'https://' : 'http://'; - const query = this.includeNamespaceInQueryParams - ? `?ns=${this.namespace}` - : ''; - return `${protocol}${this.host}/${query}`; - } -} -function repoInfoNeedsQueryParam(repoInfo) { - return (repoInfo.host !== repoInfo.internalHost || - repoInfo.isCustomHost() || - repoInfo.includeNamespaceInQueryParams); -} -/** - * Returns the websocket URL for this repo - * @param repoInfo - RepoInfo object - * @param type - of connection - * @param params - list - * @returns The URL for this repo - */ -function repoInfoConnectionURL(repoInfo, type, params) { - assert(typeof type === 'string', 'typeof type must == string'); - assert(typeof params === 'object', 'typeof params must == object'); - let connURL; - if (type === WEBSOCKET) { - connURL = - (repoInfo.secure ? 'wss://' : 'ws://') + repoInfo.internalHost + '/.ws?'; - } - else if (type === LONG_POLLING) { - connURL = - (repoInfo.secure ? 'https://' : 'http://') + - repoInfo.internalHost + - '/.lp?'; - } - else { - throw new Error('Unknown connection type: ' + type); - } - if (repoInfoNeedsQueryParam(repoInfo)) { - params['ns'] = repoInfo.namespace; - } - const pairs = []; - each(params, (key, value) => { - pairs.push(key + '=' + value); - }); - return connURL + pairs.join('&'); -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Tracks a collection of stats. - */ -class StatsCollection { - constructor() { - this.counters_ = {}; - } - incrementCounter(name, amount = 1) { - if (!contains(this.counters_, name)) { - this.counters_[name] = 0; - } - this.counters_[name] += amount; - } - get() { - return deepCopy(this.counters_); - } -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -const collections = {}; -const reporters = {}; -function statsManagerGetCollection(repoInfo) { - const hashString = repoInfo.toString(); - if (!collections[hashString]) { - collections[hashString] = new StatsCollection(); - } - return collections[hashString]; -} -function statsManagerGetOrCreateReporter(repoInfo, creatorFunction) { - const hashString = repoInfo.toString(); - if (!reporters[hashString]) { - reporters[hashString] = creatorFunction(); - } - return reporters[hashString]; -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * This class ensures the packets from the server arrive in order - * This class takes data from the server and ensures it gets passed into the callbacks in order. - */ -class PacketReceiver { - /** - * @param onMessage_ - */ - constructor(onMessage_) { - this.onMessage_ = onMessage_; - this.pendingResponses = []; - this.currentResponseNum = 0; - this.closeAfterResponse = -1; - this.onClose = null; - } - closeAfter(responseNum, callback) { - this.closeAfterResponse = responseNum; - this.onClose = callback; - if (this.closeAfterResponse < this.currentResponseNum) { - this.onClose(); - this.onClose = null; - } - } - /** - * Each message from the server comes with a response number, and an array of data. The responseNumber - * allows us to ensure that we process them in the right order, since we can't be guaranteed that all - * browsers will respond in the same order as the requests we sent - */ - handleResponse(requestNum, data) { - this.pendingResponses[requestNum] = data; - while (this.pendingResponses[this.currentResponseNum]) { - const toProcess = this.pendingResponses[this.currentResponseNum]; - delete this.pendingResponses[this.currentResponseNum]; - for (let i = 0; i < toProcess.length; ++i) { - if (toProcess[i]) { - exceptionGuard(() => { - this.onMessage_(toProcess[i]); - }); - } - } - if (this.currentResponseNum === this.closeAfterResponse) { - if (this.onClose) { - this.onClose(); - this.onClose = null; - } - break; - } - this.currentResponseNum++; - } - } -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// URL query parameters associated with longpolling -const FIREBASE_LONGPOLL_START_PARAM = 'start'; -const FIREBASE_LONGPOLL_CLOSE_COMMAND = 'close'; -const FIREBASE_LONGPOLL_COMMAND_CB_NAME = 'pLPCommand'; -const FIREBASE_LONGPOLL_DATA_CB_NAME = 'pRTLPCB'; -const FIREBASE_LONGPOLL_ID_PARAM = 'id'; -const FIREBASE_LONGPOLL_PW_PARAM = 'pw'; -const FIREBASE_LONGPOLL_SERIAL_PARAM = 'ser'; -const FIREBASE_LONGPOLL_CALLBACK_ID_PARAM = 'cb'; -const FIREBASE_LONGPOLL_SEGMENT_NUM_PARAM = 'seg'; -const FIREBASE_LONGPOLL_SEGMENTS_IN_PACKET = 'ts'; -const FIREBASE_LONGPOLL_DATA_PARAM = 'd'; -const FIREBASE_LONGPOLL_DISCONN_FRAME_REQUEST_PARAM = 'dframe'; -//Data size constants. -//TODO: Perf: the maximum length actually differs from browser to browser. -// We should check what browser we're on and set accordingly. -const MAX_URL_DATA_SIZE = 1870; -const SEG_HEADER_SIZE = 30; //ie: &seg=8299234&ts=982389123&d= -const MAX_PAYLOAD_SIZE = MAX_URL_DATA_SIZE - SEG_HEADER_SIZE; -/** - * Keepalive period - * send a fresh request at minimum every 25 seconds. Opera has a maximum request - * length of 30 seconds that we can't exceed. - */ -const KEEPALIVE_REQUEST_INTERVAL = 25000; -/** - * How long to wait before aborting a long-polling connection attempt. - */ -const LP_CONNECT_TIMEOUT = 30000; -/** - * This class manages a single long-polling connection. - */ -class BrowserPollConnection { - /** - * @param connId An identifier for this connection, used for logging - * @param repoInfo The info for the endpoint to send data to. - * @param applicationId The Firebase App ID for this project. - * @param appCheckToken The AppCheck token for this client. - * @param authToken The AuthToken to use for this connection. - * @param transportSessionId Optional transportSessionid if we are - * reconnecting for an existing transport session - * @param lastSessionId Optional lastSessionId if the PersistentConnection has - * already created a connection previously - */ - constructor(connId, repoInfo, applicationId, appCheckToken, authToken, transportSessionId, lastSessionId) { - this.connId = connId; - this.repoInfo = repoInfo; - this.applicationId = applicationId; - this.appCheckToken = appCheckToken; - this.authToken = authToken; - this.transportSessionId = transportSessionId; - this.lastSessionId = lastSessionId; - this.bytesSent = 0; - this.bytesReceived = 0; - this.everConnected_ = false; - this.log_ = logWrapper(connId); - this.stats_ = statsManagerGetCollection(repoInfo); - this.urlFn = (params) => { - // Always add the token if we have one. - if (this.appCheckToken) { - params[APP_CHECK_TOKEN_PARAM] = this.appCheckToken; - } - return repoInfoConnectionURL(repoInfo, LONG_POLLING, params); - }; - } - /** - * @param onMessage - Callback when messages arrive - * @param onDisconnect - Callback with connection lost. - */ - open(onMessage, onDisconnect) { - this.curSegmentNum = 0; - this.onDisconnect_ = onDisconnect; - this.myPacketOrderer = new PacketReceiver(onMessage); - this.isClosed_ = false; - this.connectTimeoutTimer_ = setTimeout(() => { - this.log_('Timed out trying to connect.'); - // Make sure we clear the host cache - this.onClosed_(); - this.connectTimeoutTimer_ = null; - // eslint-disable-next-line @typescript-eslint/no-explicit-any - }, Math.floor(LP_CONNECT_TIMEOUT)); - // Ensure we delay the creation of the iframe until the DOM is loaded. - executeWhenDOMReady(() => { - if (this.isClosed_) { - return; - } - //Set up a callback that gets triggered once a connection is set up. - this.scriptTagHolder = new FirebaseIFrameScriptHolder((...args) => { - const [command, arg1, arg2, arg3, arg4] = args; - this.incrementIncomingBytes_(args); - if (!this.scriptTagHolder) { - return; // we closed the connection. - } - if (this.connectTimeoutTimer_) { - clearTimeout(this.connectTimeoutTimer_); - this.connectTimeoutTimer_ = null; - } - this.everConnected_ = true; - if (command === FIREBASE_LONGPOLL_START_PARAM) { - this.id = arg1; - this.password = arg2; - } - else if (command === FIREBASE_LONGPOLL_CLOSE_COMMAND) { - // Don't clear the host cache. We got a response from the server, so we know it's reachable - if (arg1) { - // We aren't expecting any more data (other than what the server's already in the process of sending us - // through our already open polls), so don't send any more. - this.scriptTagHolder.sendNewPolls = false; - // arg1 in this case is the last response number sent by the server. We should try to receive - // all of the responses up to this one before closing - this.myPacketOrderer.closeAfter(arg1, () => { - this.onClosed_(); - }); - } - else { - this.onClosed_(); - } - } - else { - throw new Error('Unrecognized command received: ' + command); - } - }, (...args) => { - const [pN, data] = args; - this.incrementIncomingBytes_(args); - this.myPacketOrderer.handleResponse(pN, data); - }, () => { - this.onClosed_(); - }, this.urlFn); - //Send the initial request to connect. The serial number is simply to keep the browser from pulling previous results - //from cache. - const urlParams = {}; - urlParams[FIREBASE_LONGPOLL_START_PARAM] = 't'; - urlParams[FIREBASE_LONGPOLL_SERIAL_PARAM] = Math.floor(Math.random() * 100000000); - if (this.scriptTagHolder.uniqueCallbackIdentifier) { - urlParams[FIREBASE_LONGPOLL_CALLBACK_ID_PARAM] = - this.scriptTagHolder.uniqueCallbackIdentifier; - } - urlParams[VERSION_PARAM] = PROTOCOL_VERSION; - if (this.transportSessionId) { - urlParams[TRANSPORT_SESSION_PARAM] = this.transportSessionId; - } - if (this.lastSessionId) { - urlParams[LAST_SESSION_PARAM] = this.lastSessionId; - } - if (this.applicationId) { - urlParams[APPLICATION_ID_PARAM] = this.applicationId; - } - if (this.appCheckToken) { - urlParams[APP_CHECK_TOKEN_PARAM] = this.appCheckToken; - } - if (typeof location !== 'undefined' && - location.hostname && - FORGE_DOMAIN_RE.test(location.hostname)) { - urlParams[REFERER_PARAM] = FORGE_REF; - } - const connectURL = this.urlFn(urlParams); - this.log_('Connecting via long-poll to ' + connectURL); - this.scriptTagHolder.addTag(connectURL, () => { - /* do nothing */ - }); - }); - } - /** - * Call this when a handshake has completed successfully and we want to consider the connection established - */ - start() { - this.scriptTagHolder.startLongPoll(this.id, this.password); - this.addDisconnectPingFrame(this.id, this.password); - } - /** - * Forces long polling to be considered as a potential transport - */ - static forceAllow() { - BrowserPollConnection.forceAllow_ = true; - } - /** - * Forces longpolling to not be considered as a potential transport - */ - static forceDisallow() { - BrowserPollConnection.forceDisallow_ = true; - } - // Static method, use string literal so it can be accessed in a generic way - static isAvailable() { - if (isNodeSdk()) { - return false; - } - else if (BrowserPollConnection.forceAllow_) { - return true; - } - else { - // NOTE: In React-Native there's normally no 'document', but if you debug a React-Native app in - // the Chrome debugger, 'document' is defined, but document.createElement is null (2015/06/08). - return (!BrowserPollConnection.forceDisallow_ && - typeof document !== 'undefined' && - document.createElement != null && - !isChromeExtensionContentScript() && - !isWindowsStoreApp()); - } - } - /** - * No-op for polling - */ - markConnectionHealthy() { } - /** - * Stops polling and cleans up the iframe - */ - shutdown_() { - this.isClosed_ = true; - if (this.scriptTagHolder) { - this.scriptTagHolder.close(); - this.scriptTagHolder = null; - } - //remove the disconnect frame, which will trigger an XHR call to the server to tell it we're leaving. - if (this.myDisconnFrame) { - document.body.removeChild(this.myDisconnFrame); - this.myDisconnFrame = null; - } - if (this.connectTimeoutTimer_) { - clearTimeout(this.connectTimeoutTimer_); - this.connectTimeoutTimer_ = null; - } - } - /** - * Triggered when this transport is closed - */ - onClosed_() { - if (!this.isClosed_) { - this.log_('Longpoll is closing itself'); - this.shutdown_(); - if (this.onDisconnect_) { - this.onDisconnect_(this.everConnected_); - this.onDisconnect_ = null; - } - } - } - /** - * External-facing close handler. RealTime has requested we shut down. Kill our connection and tell the server - * that we've left. - */ - close() { - if (!this.isClosed_) { - this.log_('Longpoll is being closed.'); - this.shutdown_(); - } - } - /** - * Send the JSON object down to the server. It will need to be stringified, base64 encoded, and then - * broken into chunks (since URLs have a small maximum length). - * @param data - The JSON data to transmit. - */ - send(data) { - const dataStr = stringify(data); - this.bytesSent += dataStr.length; - this.stats_.incrementCounter('bytes_sent', dataStr.length); - //first, lets get the base64-encoded data - const base64data = base64Encode(dataStr); - //We can only fit a certain amount in each URL, so we need to split this request - //up into multiple pieces if it doesn't fit in one request. - const dataSegs = splitStringBySize(base64data, MAX_PAYLOAD_SIZE); - //Enqueue each segment for transmission. We assign each chunk a sequential ID and a total number - //of segments so that we can reassemble the packet on the server. - for (let i = 0; i < dataSegs.length; i++) { - this.scriptTagHolder.enqueueSegment(this.curSegmentNum, dataSegs.length, dataSegs[i]); - this.curSegmentNum++; - } - } - /** - * This is how we notify the server that we're leaving. - * We aren't able to send requests with DHTML on a window close event, but we can - * trigger XHR requests in some browsers (everything but Opera basically). - */ - addDisconnectPingFrame(id, pw) { - if (isNodeSdk()) { - return; - } - this.myDisconnFrame = document.createElement('iframe'); - const urlParams = {}; - urlParams[FIREBASE_LONGPOLL_DISCONN_FRAME_REQUEST_PARAM] = 't'; - urlParams[FIREBASE_LONGPOLL_ID_PARAM] = id; - urlParams[FIREBASE_LONGPOLL_PW_PARAM] = pw; - this.myDisconnFrame.src = this.urlFn(urlParams); - this.myDisconnFrame.style.display = 'none'; - document.body.appendChild(this.myDisconnFrame); - } - /** - * Used to track the bytes received by this client - */ - incrementIncomingBytes_(args) { - // TODO: This is an annoying perf hit just to track the number of incoming bytes. Maybe it should be opt-in. - const bytesReceived = stringify(args).length; - this.bytesReceived += bytesReceived; - this.stats_.incrementCounter('bytes_received', bytesReceived); - } -} -/********************************************************************************************* - * A wrapper around an iframe that is used as a long-polling script holder. - *********************************************************************************************/ -class FirebaseIFrameScriptHolder { - /** - * @param commandCB - The callback to be called when control commands are recevied from the server. - * @param onMessageCB - The callback to be triggered when responses arrive from the server. - * @param onDisconnect - The callback to be triggered when this tag holder is closed - * @param urlFn - A function that provides the URL of the endpoint to send data to. - */ - constructor(commandCB, onMessageCB, onDisconnect, urlFn) { - this.onDisconnect = onDisconnect; - this.urlFn = urlFn; - //We maintain a count of all of the outstanding requests, because if we have too many active at once it can cause - //problems in some browsers. - this.outstandingRequests = new Set(); - //A queue of the pending segments waiting for transmission to the server. - this.pendingSegs = []; - //A serial number. We use this for two things: - // 1) A way to ensure the browser doesn't cache responses to polls - // 2) A way to make the server aware when long-polls arrive in a different order than we started them. The - // server needs to release both polls in this case or it will cause problems in Opera since Opera can only execute - // JSONP code in the order it was added to the iframe. - this.currentSerial = Math.floor(Math.random() * 100000000); - // This gets set to false when we're "closing down" the connection (e.g. we're switching transports but there's still - // incoming data from the server that we're waiting for). - this.sendNewPolls = true; - if (!isNodeSdk()) { - //Each script holder registers a couple of uniquely named callbacks with the window. These are called from the - //iframes where we put the long-polling script tags. We have two callbacks: - // 1) Command Callback - Triggered for control issues, like starting a connection. - // 2) Message Callback - Triggered when new data arrives. - this.uniqueCallbackIdentifier = LUIDGenerator(); - window[FIREBASE_LONGPOLL_COMMAND_CB_NAME + this.uniqueCallbackIdentifier] = commandCB; - window[FIREBASE_LONGPOLL_DATA_CB_NAME + this.uniqueCallbackIdentifier] = - onMessageCB; - //Create an iframe for us to add script tags to. - this.myIFrame = FirebaseIFrameScriptHolder.createIFrame_(); - // Set the iframe's contents. - let script = ''; - // if we set a javascript url, it's IE and we need to set the document domain. The javascript url is sufficient - // for ie9, but ie8 needs to do it again in the document itself. - if (this.myIFrame.src && - this.myIFrame.src.substr(0, 'javascript:'.length) === 'javascript:') { - const currentDomain = document.domain; - script = ''; - } - const iframeContents = '' + script + ''; - try { - this.myIFrame.doc.open(); - this.myIFrame.doc.write(iframeContents); - this.myIFrame.doc.close(); - } - catch (e) { - log('frame writing exception'); - if (e.stack) { - log(e.stack); - } - log(e); - } - } - else { - this.commandCB = commandCB; - this.onMessageCB = onMessageCB; - } - } - /** - * Each browser has its own funny way to handle iframes. Here we mush them all together into one object that I can - * actually use. - */ - static createIFrame_() { - const iframe = document.createElement('iframe'); - iframe.style.display = 'none'; - // This is necessary in order to initialize the document inside the iframe - if (document.body) { - document.body.appendChild(iframe); - try { - // If document.domain has been modified in IE, this will throw an error, and we need to set the - // domain of the iframe's document manually. We can do this via a javascript: url as the src attribute - // Also note that we must do this *after* the iframe has been appended to the page. Otherwise it doesn't work. - const a = iframe.contentWindow.document; - if (!a) { - // Apologies for the log-spam, I need to do something to keep closure from optimizing out the assignment above. - log('No IE domain setting required'); - } - } - catch (e) { - const domain = document.domain; - iframe.src = - "javascript:void((function(){document.open();document.domain='" + - domain + - "';document.close();})())"; - } - } - else { - // LongPollConnection attempts to delay initialization until the document is ready, so hopefully this - // never gets hit. - throw 'Document body has not initialized. Wait to initialize Firebase until after the document is ready.'; - } - // Get the document of the iframe in a browser-specific way. - if (iframe.contentDocument) { - iframe.doc = iframe.contentDocument; // Firefox, Opera, Safari - } - else if (iframe.contentWindow) { - iframe.doc = iframe.contentWindow.document; // Internet Explorer - // eslint-disable-next-line @typescript-eslint/no-explicit-any - } - else if (iframe.document) { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - iframe.doc = iframe.document; //others? - } - return iframe; - } - /** - * Cancel all outstanding queries and remove the frame. - */ - close() { - //Mark this iframe as dead, so no new requests are sent. - this.alive = false; - if (this.myIFrame) { - //We have to actually remove all of the html inside this iframe before removing it from the - //window, or IE will continue loading and executing the script tags we've already added, which - //can lead to some errors being thrown. Setting innerHTML seems to be the easiest way to do this. - this.myIFrame.doc.body.innerHTML = ''; - setTimeout(() => { - if (this.myIFrame !== null) { - document.body.removeChild(this.myIFrame); - this.myIFrame = null; - } - }, Math.floor(0)); - } - // Protect from being called recursively. - const onDisconnect = this.onDisconnect; - if (onDisconnect) { - this.onDisconnect = null; - onDisconnect(); - } - } - /** - * Actually start the long-polling session by adding the first script tag(s) to the iframe. - * @param id - The ID of this connection - * @param pw - The password for this connection - */ - startLongPoll(id, pw) { - this.myID = id; - this.myPW = pw; - this.alive = true; - //send the initial request. If there are requests queued, make sure that we transmit as many as we are currently able to. - while (this.newRequest_()) { } - } - /** - * This is called any time someone might want a script tag to be added. It adds a script tag when there aren't - * too many outstanding requests and we are still alive. - * - * If there are outstanding packet segments to send, it sends one. If there aren't, it sends a long-poll anyways if - * needed. - */ - newRequest_() { - // We keep one outstanding request open all the time to receive data, but if we need to send data - // (pendingSegs.length > 0) then we create a new request to send the data. The server will automatically - // close the old request. - if (this.alive && - this.sendNewPolls && - this.outstandingRequests.size < (this.pendingSegs.length > 0 ? 2 : 1)) { - //construct our url - this.currentSerial++; - const urlParams = {}; - urlParams[FIREBASE_LONGPOLL_ID_PARAM] = this.myID; - urlParams[FIREBASE_LONGPOLL_PW_PARAM] = this.myPW; - urlParams[FIREBASE_LONGPOLL_SERIAL_PARAM] = this.currentSerial; - let theURL = this.urlFn(urlParams); - //Now add as much data as we can. - let curDataString = ''; - let i = 0; - while (this.pendingSegs.length > 0) { - //first, lets see if the next segment will fit. - const nextSeg = this.pendingSegs[0]; - if (nextSeg.d.length + - SEG_HEADER_SIZE + - curDataString.length <= - MAX_URL_DATA_SIZE) { - //great, the segment will fit. Lets append it. - const theSeg = this.pendingSegs.shift(); - curDataString = - curDataString + - '&' + - FIREBASE_LONGPOLL_SEGMENT_NUM_PARAM + - i + - '=' + - theSeg.seg + - '&' + - FIREBASE_LONGPOLL_SEGMENTS_IN_PACKET + - i + - '=' + - theSeg.ts + - '&' + - FIREBASE_LONGPOLL_DATA_PARAM + - i + - '=' + - theSeg.d; - i++; - } - else { - break; - } - } - theURL = theURL + curDataString; - this.addLongPollTag_(theURL, this.currentSerial); - return true; - } - else { - return false; - } - } - /** - * Queue a packet for transmission to the server. - * @param segnum - A sequential id for this packet segment used for reassembly - * @param totalsegs - The total number of segments in this packet - * @param data - The data for this segment. - */ - enqueueSegment(segnum, totalsegs, data) { - //add this to the queue of segments to send. - this.pendingSegs.push({ seg: segnum, ts: totalsegs, d: data }); - //send the data immediately if there isn't already data being transmitted, unless - //startLongPoll hasn't been called yet. - if (this.alive) { - this.newRequest_(); - } - } - /** - * Add a script tag for a regular long-poll request. - * @param url - The URL of the script tag. - * @param serial - The serial number of the request. - */ - addLongPollTag_(url, serial) { - //remember that we sent this request. - this.outstandingRequests.add(serial); - const doNewRequest = () => { - this.outstandingRequests.delete(serial); - this.newRequest_(); - }; - // If this request doesn't return on its own accord (by the server sending us some data), we'll - // create a new one after the KEEPALIVE interval to make sure we always keep a fresh request open. - const keepaliveTimeout = setTimeout(doNewRequest, Math.floor(KEEPALIVE_REQUEST_INTERVAL)); - const readyStateCB = () => { - // Request completed. Cancel the keepalive. - clearTimeout(keepaliveTimeout); - // Trigger a new request so we can continue receiving data. - doNewRequest(); - }; - this.addTag(url, readyStateCB); - } - /** - * Add an arbitrary script tag to the iframe. - * @param url - The URL for the script tag source. - * @param loadCB - A callback to be triggered once the script has loaded. - */ - addTag(url, loadCB) { - if (isNodeSdk()) { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - this.doNodeLongPoll(url, loadCB); - } - else { - setTimeout(() => { - try { - // if we're already closed, don't add this poll - if (!this.sendNewPolls) { - return; - } - const newScript = this.myIFrame.doc.createElement('script'); - newScript.type = 'text/javascript'; - newScript.async = true; - newScript.src = url; - // eslint-disable-next-line @typescript-eslint/no-explicit-any - newScript.onload = newScript.onreadystatechange = - function () { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - const rstate = newScript.readyState; - if (!rstate || rstate === 'loaded' || rstate === 'complete') { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - newScript.onload = newScript.onreadystatechange = null; - if (newScript.parentNode) { - newScript.parentNode.removeChild(newScript); - } - loadCB(); - } - }; - newScript.onerror = () => { - log('Long-poll script failed to load: ' + url); - this.sendNewPolls = false; - this.close(); - }; - this.myIFrame.doc.body.appendChild(newScript); - } - catch (e) { - // TODO: we should make this error visible somehow - } - }, Math.floor(1)); - } - } -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -const WEBSOCKET_MAX_FRAME_SIZE = 16384; -const WEBSOCKET_KEEPALIVE_INTERVAL = 45000; -let WebSocketImpl = null; -if (typeof MozWebSocket !== 'undefined') { - WebSocketImpl = MozWebSocket; -} -else if (typeof WebSocket !== 'undefined') { - WebSocketImpl = WebSocket; -} -/** - * Create a new websocket connection with the given callbacks. - */ -class WebSocketConnection { - /** - * @param connId identifier for this transport - * @param repoInfo The info for the websocket endpoint. - * @param applicationId The Firebase App ID for this project. - * @param appCheckToken The App Check Token for this client. - * @param authToken The Auth Token for this client. - * @param transportSessionId Optional transportSessionId if this is connecting - * to an existing transport session - * @param lastSessionId Optional lastSessionId if there was a previous - * connection - */ - constructor(connId, repoInfo, applicationId, appCheckToken, authToken, transportSessionId, lastSessionId) { - this.connId = connId; - this.applicationId = applicationId; - this.appCheckToken = appCheckToken; - this.authToken = authToken; - this.keepaliveTimer = null; - this.frames = null; - this.totalFrames = 0; - this.bytesSent = 0; - this.bytesReceived = 0; - this.log_ = logWrapper(this.connId); - this.stats_ = statsManagerGetCollection(repoInfo); - this.connURL = WebSocketConnection.connectionURL_(repoInfo, transportSessionId, lastSessionId, appCheckToken, applicationId); - this.nodeAdmin = repoInfo.nodeAdmin; - } - /** - * @param repoInfo - The info for the websocket endpoint. - * @param transportSessionId - Optional transportSessionId if this is connecting to an existing transport - * session - * @param lastSessionId - Optional lastSessionId if there was a previous connection - * @returns connection url - */ - static connectionURL_(repoInfo, transportSessionId, lastSessionId, appCheckToken, applicationId) { - const urlParams = {}; - urlParams[VERSION_PARAM] = PROTOCOL_VERSION; - if (!isNodeSdk() && - typeof location !== 'undefined' && - location.hostname && - FORGE_DOMAIN_RE.test(location.hostname)) { - urlParams[REFERER_PARAM] = FORGE_REF; - } - if (transportSessionId) { - urlParams[TRANSPORT_SESSION_PARAM] = transportSessionId; - } - if (lastSessionId) { - urlParams[LAST_SESSION_PARAM] = lastSessionId; - } - if (appCheckToken) { - urlParams[APP_CHECK_TOKEN_PARAM] = appCheckToken; - } - if (applicationId) { - urlParams[APPLICATION_ID_PARAM] = applicationId; - } - return repoInfoConnectionURL(repoInfo, WEBSOCKET, urlParams); - } - /** - * @param onMessage - Callback when messages arrive - * @param onDisconnect - Callback with connection lost. - */ - open(onMessage, onDisconnect) { - this.onDisconnect = onDisconnect; - this.onMessage = onMessage; - this.log_('Websocket connecting to ' + this.connURL); - this.everConnected_ = false; - // Assume failure until proven otherwise. - PersistentStorage.set('previous_websocket_failure', true); - try { - let options; - if (isNodeSdk()) { - const device = this.nodeAdmin ? 'AdminNode' : 'Node'; - // UA Format: Firebase//// - options = { - headers: { - 'User-Agent': `Firebase/${PROTOCOL_VERSION}/${SDK_VERSION}/${process.platform}/${device}`, - 'X-Firebase-GMPID': this.applicationId || '' - } - }; - // If using Node with admin creds, AppCheck-related checks are unnecessary. - // Note that we send the credentials here even if they aren't admin credentials, which is - // not a problem. - // Note that this header is just used to bypass appcheck, and the token should still be sent - // through the websocket connection once it is established. - if (this.authToken) { - options.headers['Authorization'] = `Bearer ${this.authToken}`; - } - if (this.appCheckToken) { - options.headers['X-Firebase-AppCheck'] = this.appCheckToken; - } - // Plumb appropriate http_proxy environment variable into faye-websocket if it exists. - const env = process['env']; - const proxy = this.connURL.indexOf('wss://') === 0 - ? env['HTTPS_PROXY'] || env['https_proxy'] - : env['HTTP_PROXY'] || env['http_proxy']; - if (proxy) { - options['proxy'] = { origin: proxy }; - } - } - this.mySock = new WebSocketImpl(this.connURL, [], options); - } - catch (e) { - this.log_('Error instantiating WebSocket.'); - const error = e.message || e.data; - if (error) { - this.log_(error); - } - this.onClosed_(); - return; - } - this.mySock.onopen = () => { - this.log_('Websocket connected.'); - this.everConnected_ = true; - }; - this.mySock.onclose = () => { - this.log_('Websocket connection was disconnected.'); - this.mySock = null; - this.onClosed_(); - }; - this.mySock.onmessage = m => { - this.handleIncomingFrame(m); - }; - this.mySock.onerror = e => { - this.log_('WebSocket error. Closing connection.'); - // eslint-disable-next-line @typescript-eslint/no-explicit-any - const error = e.message || e.data; - if (error) { - this.log_(error); - } - this.onClosed_(); - }; - } - /** - * No-op for websockets, we don't need to do anything once the connection is confirmed as open - */ - start() { } - static forceDisallow() { - WebSocketConnection.forceDisallow_ = true; - } - static isAvailable() { - let isOldAndroid = false; - if (typeof navigator !== 'undefined' && navigator.userAgent) { - const oldAndroidRegex = /Android ([0-9]{0,}\.[0-9]{0,})/; - const oldAndroidMatch = navigator.userAgent.match(oldAndroidRegex); - if (oldAndroidMatch && oldAndroidMatch.length > 1) { - if (parseFloat(oldAndroidMatch[1]) < 4.4) { - isOldAndroid = true; - } - } - } - return (!isOldAndroid && - WebSocketImpl !== null && - !WebSocketConnection.forceDisallow_); - } - /** - * Returns true if we previously failed to connect with this transport. - */ - static previouslyFailed() { - // If our persistent storage is actually only in-memory storage, - // we default to assuming that it previously failed to be safe. - return (PersistentStorage.isInMemoryStorage || - PersistentStorage.get('previous_websocket_failure') === true); - } - markConnectionHealthy() { - PersistentStorage.remove('previous_websocket_failure'); - } - appendFrame_(data) { - this.frames.push(data); - if (this.frames.length === this.totalFrames) { - const fullMess = this.frames.join(''); - this.frames = null; - const jsonMess = jsonEval(fullMess); - //handle the message - this.onMessage(jsonMess); - } - } - /** - * @param frameCount - The number of frames we are expecting from the server - */ - handleNewFrameCount_(frameCount) { - this.totalFrames = frameCount; - this.frames = []; - } - /** - * Attempts to parse a frame count out of some text. If it can't, assumes a value of 1 - * @returns Any remaining data to be process, or null if there is none - */ - extractFrameCount_(data) { - assert(this.frames === null, 'We already have a frame buffer'); - // TODO: The server is only supposed to send up to 9999 frames (i.e. length <= 4), but that isn't being enforced - // currently. So allowing larger frame counts (length <= 6). See https://app.asana.com/0/search/8688598998380/8237608042508 - if (data.length <= 6) { - const frameCount = Number(data); - if (!isNaN(frameCount)) { - this.handleNewFrameCount_(frameCount); - return null; - } - } - this.handleNewFrameCount_(1); - return data; - } - /** - * Process a websocket frame that has arrived from the server. - * @param mess - The frame data - */ - handleIncomingFrame(mess) { - if (this.mySock === null) { - return; // Chrome apparently delivers incoming packets even after we .close() the connection sometimes. - } - const data = mess['data']; - this.bytesReceived += data.length; - this.stats_.incrementCounter('bytes_received', data.length); - this.resetKeepAlive(); - if (this.frames !== null) { - // we're buffering - this.appendFrame_(data); - } - else { - // try to parse out a frame count, otherwise, assume 1 and process it - const remainingData = this.extractFrameCount_(data); - if (remainingData !== null) { - this.appendFrame_(remainingData); - } - } - } - /** - * Send a message to the server - * @param data - The JSON object to transmit - */ - send(data) { - this.resetKeepAlive(); - const dataStr = stringify(data); - this.bytesSent += dataStr.length; - this.stats_.incrementCounter('bytes_sent', dataStr.length); - //We can only fit a certain amount in each websocket frame, so we need to split this request - //up into multiple pieces if it doesn't fit in one request. - const dataSegs = splitStringBySize(dataStr, WEBSOCKET_MAX_FRAME_SIZE); - //Send the length header - if (dataSegs.length > 1) { - this.sendString_(String(dataSegs.length)); - } - //Send the actual data in segments. - for (let i = 0; i < dataSegs.length; i++) { - this.sendString_(dataSegs[i]); - } - } - shutdown_() { - this.isClosed_ = true; - if (this.keepaliveTimer) { - clearInterval(this.keepaliveTimer); - this.keepaliveTimer = null; - } - if (this.mySock) { - this.mySock.close(); - this.mySock = null; - } - } - onClosed_() { - if (!this.isClosed_) { - this.log_('WebSocket is closing itself'); - this.shutdown_(); - // since this is an internal close, trigger the close listener - if (this.onDisconnect) { - this.onDisconnect(this.everConnected_); - this.onDisconnect = null; - } - } - } - /** - * External-facing close handler. - * Close the websocket and kill the connection. - */ - close() { - if (!this.isClosed_) { - this.log_('WebSocket is being closed'); - this.shutdown_(); - } - } - /** - * Kill the current keepalive timer and start a new one, to ensure that it always fires N seconds after - * the last activity. - */ - resetKeepAlive() { - clearInterval(this.keepaliveTimer); - this.keepaliveTimer = setInterval(() => { - //If there has been no websocket activity for a while, send a no-op - if (this.mySock) { - this.sendString_('0'); - } - this.resetKeepAlive(); - // eslint-disable-next-line @typescript-eslint/no-explicit-any - }, Math.floor(WEBSOCKET_KEEPALIVE_INTERVAL)); - } - /** - * Send a string over the websocket. - * - * @param str - String to send. - */ - sendString_(str) { - // Firefox seems to sometimes throw exceptions (NS_ERROR_UNEXPECTED) from websocket .send() - // calls for some unknown reason. We treat these as an error and disconnect. - // See https://app.asana.com/0/58926111402292/68021340250410 - try { - this.mySock.send(str); - } - catch (e) { - this.log_('Exception thrown from WebSocket.send():', e.message || e.data, 'Closing connection.'); - setTimeout(this.onClosed_.bind(this), 0); - } - } -} -/** - * Number of response before we consider the connection "healthy." - */ -WebSocketConnection.responsesRequiredToBeHealthy = 2; -/** - * Time to wait for the connection te become healthy before giving up. - */ -WebSocketConnection.healthyTimeout = 30000; - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Currently simplistic, this class manages what transport a Connection should use at various stages of its - * lifecycle. - * - * It starts with longpolling in a browser, and httppolling on node. It then upgrades to websockets if - * they are available. - */ -class TransportManager { - /** - * @param repoInfo - Metadata around the namespace we're connecting to - */ - constructor(repoInfo) { - this.initTransports_(repoInfo); - } - static get ALL_TRANSPORTS() { - return [BrowserPollConnection, WebSocketConnection]; - } - /** - * Returns whether transport has been selected to ensure WebSocketConnection or BrowserPollConnection are not called after - * TransportManager has already set up transports_ - */ - static get IS_TRANSPORT_INITIALIZED() { - return this.globalTransportInitialized_; - } - initTransports_(repoInfo) { - const isWebSocketsAvailable = WebSocketConnection && WebSocketConnection['isAvailable'](); - let isSkipPollConnection = isWebSocketsAvailable && !WebSocketConnection.previouslyFailed(); - if (repoInfo.webSocketOnly) { - if (!isWebSocketsAvailable) { - warn("wss:// URL used, but browser isn't known to support websockets. Trying anyway."); - } - isSkipPollConnection = true; - } - if (isSkipPollConnection) { - this.transports_ = [WebSocketConnection]; - } - else { - const transports = (this.transports_ = []); - for (const transport of TransportManager.ALL_TRANSPORTS) { - if (transport && transport['isAvailable']()) { - transports.push(transport); - } - } - TransportManager.globalTransportInitialized_ = true; - } - } - /** - * @returns The constructor for the initial transport to use - */ - initialTransport() { - if (this.transports_.length > 0) { - return this.transports_[0]; - } - else { - throw new Error('No transports available'); - } - } - /** - * @returns The constructor for the next transport, or null - */ - upgradeTransport() { - if (this.transports_.length > 1) { - return this.transports_[1]; - } - else { - return null; - } - } -} -// Keeps track of whether the TransportManager has already chosen a transport to use -TransportManager.globalTransportInitialized_ = false; - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Abort upgrade attempt if it takes longer than 60s. -const UPGRADE_TIMEOUT = 60000; -// For some transports (WebSockets), we need to "validate" the transport by exchanging a few requests and responses. -// If we haven't sent enough requests within 5s, we'll start sending noop ping requests. -const DELAY_BEFORE_SENDING_EXTRA_REQUESTS = 5000; -// If the initial data sent triggers a lot of bandwidth (i.e. it's a large put or a listen for a large amount of data) -// then we may not be able to exchange our ping/pong requests within the healthy timeout. So if we reach the timeout -// but we've sent/received enough bytes, we don't cancel the connection. -const BYTES_SENT_HEALTHY_OVERRIDE = 10 * 1024; -const BYTES_RECEIVED_HEALTHY_OVERRIDE = 100 * 1024; -const MESSAGE_TYPE = 't'; -const MESSAGE_DATA = 'd'; -const CONTROL_SHUTDOWN = 's'; -const CONTROL_RESET = 'r'; -const CONTROL_ERROR = 'e'; -const CONTROL_PONG = 'o'; -const SWITCH_ACK = 'a'; -const END_TRANSMISSION = 'n'; -const PING = 'p'; -const SERVER_HELLO = 'h'; -/** - * Creates a new real-time connection to the server using whichever method works - * best in the current browser. - */ -class Connection { - /** - * @param id - an id for this connection - * @param repoInfo_ - the info for the endpoint to connect to - * @param applicationId_ - the Firebase App ID for this project - * @param appCheckToken_ - The App Check Token for this device. - * @param authToken_ - The auth token for this session. - * @param onMessage_ - the callback to be triggered when a server-push message arrives - * @param onReady_ - the callback to be triggered when this connection is ready to send messages. - * @param onDisconnect_ - the callback to be triggered when a connection was lost - * @param onKill_ - the callback to be triggered when this connection has permanently shut down. - * @param lastSessionId - last session id in persistent connection. is used to clean up old session in real-time server - */ - constructor(id, repoInfo_, applicationId_, appCheckToken_, authToken_, onMessage_, onReady_, onDisconnect_, onKill_, lastSessionId) { - this.id = id; - this.repoInfo_ = repoInfo_; - this.applicationId_ = applicationId_; - this.appCheckToken_ = appCheckToken_; - this.authToken_ = authToken_; - this.onMessage_ = onMessage_; - this.onReady_ = onReady_; - this.onDisconnect_ = onDisconnect_; - this.onKill_ = onKill_; - this.lastSessionId = lastSessionId; - this.connectionCount = 0; - this.pendingDataMessages = []; - this.state_ = 0 /* CONNECTING */; - this.log_ = logWrapper('c:' + this.id + ':'); - this.transportManager_ = new TransportManager(repoInfo_); - this.log_('Connection created'); - this.start_(); - } - /** - * Starts a connection attempt - */ - start_() { - const conn = this.transportManager_.initialTransport(); - this.conn_ = new conn(this.nextTransportId_(), this.repoInfo_, this.applicationId_, this.appCheckToken_, this.authToken_, null, this.lastSessionId); - // For certain transports (WebSockets), we need to send and receive several messages back and forth before we - // can consider the transport healthy. - this.primaryResponsesRequired_ = conn['responsesRequiredToBeHealthy'] || 0; - const onMessageReceived = this.connReceiver_(this.conn_); - const onConnectionLost = this.disconnReceiver_(this.conn_); - this.tx_ = this.conn_; - this.rx_ = this.conn_; - this.secondaryConn_ = null; - this.isHealthy_ = false; - /* - * Firefox doesn't like when code from one iframe tries to create another iframe by way of the parent frame. - * This can occur in the case of a redirect, i.e. we guessed wrong on what server to connect to and received a reset. - * Somehow, setTimeout seems to make this ok. That doesn't make sense from a security perspective, since you should - * still have the context of your originating frame. - */ - setTimeout(() => { - // this.conn_ gets set to null in some of the tests. Check to make sure it still exists before using it - this.conn_ && this.conn_.open(onMessageReceived, onConnectionLost); - }, Math.floor(0)); - const healthyTimeoutMS = conn['healthyTimeout'] || 0; - if (healthyTimeoutMS > 0) { - this.healthyTimeout_ = setTimeoutNonBlocking(() => { - this.healthyTimeout_ = null; - if (!this.isHealthy_) { - if (this.conn_ && - this.conn_.bytesReceived > BYTES_RECEIVED_HEALTHY_OVERRIDE) { - this.log_('Connection exceeded healthy timeout but has received ' + - this.conn_.bytesReceived + - ' bytes. Marking connection healthy.'); - this.isHealthy_ = true; - this.conn_.markConnectionHealthy(); - } - else if (this.conn_ && - this.conn_.bytesSent > BYTES_SENT_HEALTHY_OVERRIDE) { - this.log_('Connection exceeded healthy timeout but has sent ' + - this.conn_.bytesSent + - ' bytes. Leaving connection alive.'); - // NOTE: We don't want to mark it healthy, since we have no guarantee that the bytes have made it to - // the server. - } - else { - this.log_('Closing unhealthy connection after timeout.'); - this.close(); - } - } - // eslint-disable-next-line @typescript-eslint/no-explicit-any - }, Math.floor(healthyTimeoutMS)); - } - } - nextTransportId_() { - return 'c:' + this.id + ':' + this.connectionCount++; - } - disconnReceiver_(conn) { - return everConnected => { - if (conn === this.conn_) { - this.onConnectionLost_(everConnected); - } - else if (conn === this.secondaryConn_) { - this.log_('Secondary connection lost.'); - this.onSecondaryConnectionLost_(); - } - else { - this.log_('closing an old connection'); - } - }; - } - connReceiver_(conn) { - return (message) => { - if (this.state_ !== 2 /* DISCONNECTED */) { - if (conn === this.rx_) { - this.onPrimaryMessageReceived_(message); - } - else if (conn === this.secondaryConn_) { - this.onSecondaryMessageReceived_(message); - } - else { - this.log_('message on old connection'); - } - } - }; - } - /** - * @param dataMsg - An arbitrary data message to be sent to the server - */ - sendRequest(dataMsg) { - // wrap in a data message envelope and send it on - const msg = { t: 'd', d: dataMsg }; - this.sendData_(msg); - } - tryCleanupConnection() { - if (this.tx_ === this.secondaryConn_ && this.rx_ === this.secondaryConn_) { - this.log_('cleaning up and promoting a connection: ' + this.secondaryConn_.connId); - this.conn_ = this.secondaryConn_; - this.secondaryConn_ = null; - // the server will shutdown the old connection - } - } - onSecondaryControl_(controlData) { - if (MESSAGE_TYPE in controlData) { - const cmd = controlData[MESSAGE_TYPE]; - if (cmd === SWITCH_ACK) { - this.upgradeIfSecondaryHealthy_(); - } - else if (cmd === CONTROL_RESET) { - // Most likely the session wasn't valid. Abandon the switch attempt - this.log_('Got a reset on secondary, closing it'); - this.secondaryConn_.close(); - // If we were already using this connection for something, than we need to fully close - if (this.tx_ === this.secondaryConn_ || - this.rx_ === this.secondaryConn_) { - this.close(); - } - } - else if (cmd === CONTROL_PONG) { - this.log_('got pong on secondary.'); - this.secondaryResponsesRequired_--; - this.upgradeIfSecondaryHealthy_(); - } - } - } - onSecondaryMessageReceived_(parsedData) { - const layer = requireKey('t', parsedData); - const data = requireKey('d', parsedData); - if (layer === 'c') { - this.onSecondaryControl_(data); - } - else if (layer === 'd') { - // got a data message, but we're still second connection. Need to buffer it up - this.pendingDataMessages.push(data); - } - else { - throw new Error('Unknown protocol layer: ' + layer); - } - } - upgradeIfSecondaryHealthy_() { - if (this.secondaryResponsesRequired_ <= 0) { - this.log_('Secondary connection is healthy.'); - this.isHealthy_ = true; - this.secondaryConn_.markConnectionHealthy(); - this.proceedWithUpgrade_(); - } - else { - // Send a ping to make sure the connection is healthy. - this.log_('sending ping on secondary.'); - this.secondaryConn_.send({ t: 'c', d: { t: PING, d: {} } }); - } - } - proceedWithUpgrade_() { - // tell this connection to consider itself open - this.secondaryConn_.start(); - // send ack - this.log_('sending client ack on secondary'); - this.secondaryConn_.send({ t: 'c', d: { t: SWITCH_ACK, d: {} } }); - // send end packet on primary transport, switch to sending on this one - // can receive on this one, buffer responses until end received on primary transport - this.log_('Ending transmission on primary'); - this.conn_.send({ t: 'c', d: { t: END_TRANSMISSION, d: {} } }); - this.tx_ = this.secondaryConn_; - this.tryCleanupConnection(); - } - onPrimaryMessageReceived_(parsedData) { - // Must refer to parsedData properties in quotes, so closure doesn't touch them. - const layer = requireKey('t', parsedData); - const data = requireKey('d', parsedData); - if (layer === 'c') { - this.onControl_(data); - } - else if (layer === 'd') { - this.onDataMessage_(data); - } - } - onDataMessage_(message) { - this.onPrimaryResponse_(); - // We don't do anything with data messages, just kick them up a level - this.onMessage_(message); - } - onPrimaryResponse_() { - if (!this.isHealthy_) { - this.primaryResponsesRequired_--; - if (this.primaryResponsesRequired_ <= 0) { - this.log_('Primary connection is healthy.'); - this.isHealthy_ = true; - this.conn_.markConnectionHealthy(); - } - } - } - onControl_(controlData) { - const cmd = requireKey(MESSAGE_TYPE, controlData); - if (MESSAGE_DATA in controlData) { - const payload = controlData[MESSAGE_DATA]; - if (cmd === SERVER_HELLO) { - this.onHandshake_(payload); - } - else if (cmd === END_TRANSMISSION) { - this.log_('recvd end transmission on primary'); - this.rx_ = this.secondaryConn_; - for (let i = 0; i < this.pendingDataMessages.length; ++i) { - this.onDataMessage_(this.pendingDataMessages[i]); - } - this.pendingDataMessages = []; - this.tryCleanupConnection(); - } - else if (cmd === CONTROL_SHUTDOWN) { - // This was previously the 'onKill' callback passed to the lower-level connection - // payload in this case is the reason for the shutdown. Generally a human-readable error - this.onConnectionShutdown_(payload); - } - else if (cmd === CONTROL_RESET) { - // payload in this case is the host we should contact - this.onReset_(payload); - } - else if (cmd === CONTROL_ERROR) { - error('Server Error: ' + payload); - } - else if (cmd === CONTROL_PONG) { - this.log_('got pong on primary.'); - this.onPrimaryResponse_(); - this.sendPingOnPrimaryIfNecessary_(); - } - else { - error('Unknown control packet command: ' + cmd); - } - } - } - /** - * @param handshake - The handshake data returned from the server - */ - onHandshake_(handshake) { - const timestamp = handshake.ts; - const version = handshake.v; - const host = handshake.h; - this.sessionId = handshake.s; - this.repoInfo_.host = host; - // if we've already closed the connection, then don't bother trying to progress further - if (this.state_ === 0 /* CONNECTING */) { - this.conn_.start(); - this.onConnectionEstablished_(this.conn_, timestamp); - if (PROTOCOL_VERSION !== version) { - warn('Protocol version mismatch detected'); - } - // TODO: do we want to upgrade? when? maybe a delay? - this.tryStartUpgrade_(); - } - } - tryStartUpgrade_() { - const conn = this.transportManager_.upgradeTransport(); - if (conn) { - this.startUpgrade_(conn); - } - } - startUpgrade_(conn) { - this.secondaryConn_ = new conn(this.nextTransportId_(), this.repoInfo_, this.applicationId_, this.appCheckToken_, this.authToken_, this.sessionId); - // For certain transports (WebSockets), we need to send and receive several messages back and forth before we - // can consider the transport healthy. - this.secondaryResponsesRequired_ = - conn['responsesRequiredToBeHealthy'] || 0; - const onMessage = this.connReceiver_(this.secondaryConn_); - const onDisconnect = this.disconnReceiver_(this.secondaryConn_); - this.secondaryConn_.open(onMessage, onDisconnect); - // If we haven't successfully upgraded after UPGRADE_TIMEOUT, give up and kill the secondary. - setTimeoutNonBlocking(() => { - if (this.secondaryConn_) { - this.log_('Timed out trying to upgrade.'); - this.secondaryConn_.close(); - } - }, Math.floor(UPGRADE_TIMEOUT)); - } - onReset_(host) { - this.log_('Reset packet received. New host: ' + host); - this.repoInfo_.host = host; - // TODO: if we're already "connected", we need to trigger a disconnect at the next layer up. - // We don't currently support resets after the connection has already been established - if (this.state_ === 1 /* CONNECTED */) { - this.close(); - } - else { - // Close whatever connections we have open and start again. - this.closeConnections_(); - this.start_(); - } - } - onConnectionEstablished_(conn, timestamp) { - this.log_('Realtime connection established.'); - this.conn_ = conn; - this.state_ = 1 /* CONNECTED */; - if (this.onReady_) { - this.onReady_(timestamp, this.sessionId); - this.onReady_ = null; - } - // If after 5 seconds we haven't sent enough requests to the server to get the connection healthy, - // send some pings. - if (this.primaryResponsesRequired_ === 0) { - this.log_('Primary connection is healthy.'); - this.isHealthy_ = true; - } - else { - setTimeoutNonBlocking(() => { - this.sendPingOnPrimaryIfNecessary_(); - }, Math.floor(DELAY_BEFORE_SENDING_EXTRA_REQUESTS)); - } - } - sendPingOnPrimaryIfNecessary_() { - // If the connection isn't considered healthy yet, we'll send a noop ping packet request. - if (!this.isHealthy_ && this.state_ === 1 /* CONNECTED */) { - this.log_('sending ping on primary.'); - this.sendData_({ t: 'c', d: { t: PING, d: {} } }); - } - } - onSecondaryConnectionLost_() { - const conn = this.secondaryConn_; - this.secondaryConn_ = null; - if (this.tx_ === conn || this.rx_ === conn) { - // we are relying on this connection already in some capacity. Therefore, a failure is real - this.close(); - } - } - /** - * @param everConnected - Whether or not the connection ever reached a server. Used to determine if - * we should flush the host cache - */ - onConnectionLost_(everConnected) { - this.conn_ = null; - // NOTE: IF you're seeing a Firefox error for this line, I think it might be because it's getting - // called on window close and RealtimeState.CONNECTING is no longer defined. Just a guess. - if (!everConnected && this.state_ === 0 /* CONNECTING */) { - this.log_('Realtime connection failed.'); - // Since we failed to connect at all, clear any cached entry for this namespace in case the machine went away - if (this.repoInfo_.isCacheableHost()) { - PersistentStorage.remove('host:' + this.repoInfo_.host); - // reset the internal host to what we would show the user, i.e. .firebaseio.com - this.repoInfo_.internalHost = this.repoInfo_.host; - } - } - else if (this.state_ === 1 /* CONNECTED */) { - this.log_('Realtime connection lost.'); - } - this.close(); - } - onConnectionShutdown_(reason) { - this.log_('Connection shutdown command received. Shutting down...'); - if (this.onKill_) { - this.onKill_(reason); - this.onKill_ = null; - } - // We intentionally don't want to fire onDisconnect (kill is a different case), - // so clear the callback. - this.onDisconnect_ = null; - this.close(); - } - sendData_(data) { - if (this.state_ !== 1 /* CONNECTED */) { - throw 'Connection is not connected'; - } - else { - this.tx_.send(data); - } - } - /** - * Cleans up this connection, calling the appropriate callbacks - */ - close() { - if (this.state_ !== 2 /* DISCONNECTED */) { - this.log_('Closing realtime connection.'); - this.state_ = 2 /* DISCONNECTED */; - this.closeConnections_(); - if (this.onDisconnect_) { - this.onDisconnect_(); - this.onDisconnect_ = null; - } - } - } - closeConnections_() { - this.log_('Shutting down all connections'); - if (this.conn_) { - this.conn_.close(); - this.conn_ = null; - } - if (this.secondaryConn_) { - this.secondaryConn_.close(); - this.secondaryConn_ = null; - } - if (this.healthyTimeout_) { - clearTimeout(this.healthyTimeout_); - this.healthyTimeout_ = null; - } - } -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Interface defining the set of actions that can be performed against the Firebase server - * (basically corresponds to our wire protocol). - * - * @interface - */ -class ServerActions { - put(pathString, data, onComplete, hash) { } - merge(pathString, data, onComplete, hash) { } - /** - * Refreshes the auth token for the current connection. - * @param token - The authentication token - */ - refreshAuthToken(token) { } - /** - * Refreshes the app check token for the current connection. - * @param token The app check token - */ - refreshAppCheckToken(token) { } - onDisconnectPut(pathString, data, onComplete) { } - onDisconnectMerge(pathString, data, onComplete) { } - onDisconnectCancel(pathString, onComplete) { } - reportStats(stats) { } -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Base class to be used if you want to emit events. Call the constructor with - * the set of allowed event names. - */ -class EventEmitter { - constructor(allowedEvents_) { - this.allowedEvents_ = allowedEvents_; - this.listeners_ = {}; - assert(Array.isArray(allowedEvents_) && allowedEvents_.length > 0, 'Requires a non-empty array'); - } - /** - * To be called by derived classes to trigger events. - */ - trigger(eventType, ...varArgs) { - if (Array.isArray(this.listeners_[eventType])) { - // Clone the list, since callbacks could add/remove listeners. - const listeners = [...this.listeners_[eventType]]; - for (let i = 0; i < listeners.length; i++) { - listeners[i].callback.apply(listeners[i].context, varArgs); - } - } - } - on(eventType, callback, context) { - this.validateEventType_(eventType); - this.listeners_[eventType] = this.listeners_[eventType] || []; - this.listeners_[eventType].push({ callback, context }); - const eventData = this.getInitialEvent(eventType); - if (eventData) { - callback.apply(context, eventData); - } - } - off(eventType, callback, context) { - this.validateEventType_(eventType); - const listeners = this.listeners_[eventType] || []; - for (let i = 0; i < listeners.length; i++) { - if (listeners[i].callback === callback && - (!context || context === listeners[i].context)) { - listeners.splice(i, 1); - return; - } - } - } - validateEventType_(eventType) { - assert(this.allowedEvents_.find(et => { - return et === eventType; - }), 'Unknown event: ' + eventType); - } -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Monitors online state (as reported by window.online/offline events). - * - * The expectation is that this could have many false positives (thinks we are online - * when we're not), but no false negatives. So we can safely use it to determine when - * we definitely cannot reach the internet. - */ -class OnlineMonitor extends EventEmitter { - constructor() { - super(['online']); - this.online_ = true; - // We've had repeated complaints that Cordova apps can get stuck "offline", e.g. - // https://forum.ionicframework.com/t/firebase-connection-is-lost-and-never-come-back/43810 - // It would seem that the 'online' event does not always fire consistently. So we disable it - // for Cordova. - if (typeof window !== 'undefined' && - typeof window.addEventListener !== 'undefined' && - !isMobileCordova()) { - window.addEventListener('online', () => { - if (!this.online_) { - this.online_ = true; - this.trigger('online', true); - } - }, false); - window.addEventListener('offline', () => { - if (this.online_) { - this.online_ = false; - this.trigger('online', false); - } - }, false); - } - } - static getInstance() { - return new OnlineMonitor(); - } - getInitialEvent(eventType) { - assert(eventType === 'online', 'Unknown event type: ' + eventType); - return [this.online_]; - } - currentlyOnline() { - return this.online_; - } -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** Maximum key depth. */ -const MAX_PATH_DEPTH = 32; -/** Maximum number of (UTF8) bytes in a Firebase path. */ -const MAX_PATH_LENGTH_BYTES = 768; -/** - * An immutable object representing a parsed path. It's immutable so that you - * can pass them around to other functions without worrying about them changing - * it. - */ -class Path { - /** - * @param pathOrString - Path string to parse, or another path, or the raw - * tokens array - */ - constructor(pathOrString, pieceNum) { - if (pieceNum === void 0) { - this.pieces_ = pathOrString.split('/'); - // Remove empty pieces. - let copyTo = 0; - for (let i = 0; i < this.pieces_.length; i++) { - if (this.pieces_[i].length > 0) { - this.pieces_[copyTo] = this.pieces_[i]; - copyTo++; - } - } - this.pieces_.length = copyTo; - this.pieceNum_ = 0; - } - else { - this.pieces_ = pathOrString; - this.pieceNum_ = pieceNum; - } - } - toString() { - let pathString = ''; - for (let i = this.pieceNum_; i < this.pieces_.length; i++) { - if (this.pieces_[i] !== '') { - pathString += '/' + this.pieces_[i]; - } - } - return pathString || '/'; - } -} -function newEmptyPath() { - return new Path(''); -} -function pathGetFront(path) { - if (path.pieceNum_ >= path.pieces_.length) { - return null; - } - return path.pieces_[path.pieceNum_]; -} -/** - * @returns The number of segments in this path - */ -function pathGetLength(path) { - return path.pieces_.length - path.pieceNum_; -} -function pathPopFront(path) { - let pieceNum = path.pieceNum_; - if (pieceNum < path.pieces_.length) { - pieceNum++; - } - return new Path(path.pieces_, pieceNum); -} -function pathGetBack(path) { - if (path.pieceNum_ < path.pieces_.length) { - return path.pieces_[path.pieces_.length - 1]; - } - return null; -} -function pathToUrlEncodedString(path) { - let pathString = ''; - for (let i = path.pieceNum_; i < path.pieces_.length; i++) { - if (path.pieces_[i] !== '') { - pathString += '/' + encodeURIComponent(String(path.pieces_[i])); - } - } - return pathString || '/'; -} -/** - * Shallow copy of the parts of the path. - * - */ -function pathSlice(path, begin = 0) { - return path.pieces_.slice(path.pieceNum_ + begin); -} -function pathParent(path) { - if (path.pieceNum_ >= path.pieces_.length) { - return null; - } - const pieces = []; - for (let i = path.pieceNum_; i < path.pieces_.length - 1; i++) { - pieces.push(path.pieces_[i]); - } - return new Path(pieces, 0); -} -function pathChild(path, childPathObj) { - const pieces = []; - for (let i = path.pieceNum_; i < path.pieces_.length; i++) { - pieces.push(path.pieces_[i]); - } - if (childPathObj instanceof Path) { - for (let i = childPathObj.pieceNum_; i < childPathObj.pieces_.length; i++) { - pieces.push(childPathObj.pieces_[i]); - } - } - else { - const childPieces = childPathObj.split('/'); - for (let i = 0; i < childPieces.length; i++) { - if (childPieces[i].length > 0) { - pieces.push(childPieces[i]); - } - } - } - return new Path(pieces, 0); -} -/** - * @returns True if there are no segments in this path - */ -function pathIsEmpty(path) { - return path.pieceNum_ >= path.pieces_.length; -} -/** - * @returns The path from outerPath to innerPath - */ -function newRelativePath(outerPath, innerPath) { - const outer = pathGetFront(outerPath), inner = pathGetFront(innerPath); - if (outer === null) { - return innerPath; - } - else if (outer === inner) { - return newRelativePath(pathPopFront(outerPath), pathPopFront(innerPath)); - } - else { - throw new Error('INTERNAL ERROR: innerPath (' + - innerPath + - ') is not within ' + - 'outerPath (' + - outerPath + - ')'); - } -} -/** - * @returns -1, 0, 1 if left is less, equal, or greater than the right. - */ -function pathCompare(left, right) { - const leftKeys = pathSlice(left, 0); - const rightKeys = pathSlice(right, 0); - for (let i = 0; i < leftKeys.length && i < rightKeys.length; i++) { - const cmp = nameCompare(leftKeys[i], rightKeys[i]); - if (cmp !== 0) { - return cmp; - } - } - if (leftKeys.length === rightKeys.length) { - return 0; - } - return leftKeys.length < rightKeys.length ? -1 : 1; -} -/** - * @returns true if paths are the same. - */ -function pathEquals(path, other) { - if (pathGetLength(path) !== pathGetLength(other)) { - return false; - } - for (let i = path.pieceNum_, j = other.pieceNum_; i <= path.pieces_.length; i++, j++) { - if (path.pieces_[i] !== other.pieces_[j]) { - return false; - } - } - return true; -} -/** - * @returns True if this path is a parent of (or the same as) other - */ -function pathContains(path, other) { - let i = path.pieceNum_; - let j = other.pieceNum_; - if (pathGetLength(path) > pathGetLength(other)) { - return false; - } - while (i < path.pieces_.length) { - if (path.pieces_[i] !== other.pieces_[j]) { - return false; - } - ++i; - ++j; - } - return true; -} -/** - * Dynamic (mutable) path used to count path lengths. - * - * This class is used to efficiently check paths for valid - * length (in UTF8 bytes) and depth (used in path validation). - * - * Throws Error exception if path is ever invalid. - * - * The definition of a path always begins with '/'. - */ -class ValidationPath { - /** - * @param path - Initial Path. - * @param errorPrefix_ - Prefix for any error messages. - */ - constructor(path, errorPrefix_) { - this.errorPrefix_ = errorPrefix_; - this.parts_ = pathSlice(path, 0); - /** Initialize to number of '/' chars needed in path. */ - this.byteLength_ = Math.max(1, this.parts_.length); - for (let i = 0; i < this.parts_.length; i++) { - this.byteLength_ += stringLength(this.parts_[i]); - } - validationPathCheckValid(this); - } -} -function validationPathPush(validationPath, child) { - // Count the needed '/' - if (validationPath.parts_.length > 0) { - validationPath.byteLength_ += 1; - } - validationPath.parts_.push(child); - validationPath.byteLength_ += stringLength(child); - validationPathCheckValid(validationPath); -} -function validationPathPop(validationPath) { - const last = validationPath.parts_.pop(); - validationPath.byteLength_ -= stringLength(last); - // Un-count the previous '/' - if (validationPath.parts_.length > 0) { - validationPath.byteLength_ -= 1; - } -} -function validationPathCheckValid(validationPath) { - if (validationPath.byteLength_ > MAX_PATH_LENGTH_BYTES) { - throw new Error(validationPath.errorPrefix_ + - 'has a key path longer than ' + - MAX_PATH_LENGTH_BYTES + - ' bytes (' + - validationPath.byteLength_ + - ').'); - } - if (validationPath.parts_.length > MAX_PATH_DEPTH) { - throw new Error(validationPath.errorPrefix_ + - 'path specified exceeds the maximum depth that can be written (' + - MAX_PATH_DEPTH + - ') or object contains a cycle ' + - validationPathToErrorString(validationPath)); - } -} -/** - * String for use in error messages - uses '.' notation for path. - */ -function validationPathToErrorString(validationPath) { - if (validationPath.parts_.length === 0) { - return ''; - } - return "in property '" + validationPath.parts_.join('.') + "'"; -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -class VisibilityMonitor extends EventEmitter { - constructor() { - super(['visible']); - let hidden; - let visibilityChange; - if (typeof document !== 'undefined' && - typeof document.addEventListener !== 'undefined') { - if (typeof document['hidden'] !== 'undefined') { - // Opera 12.10 and Firefox 18 and later support - visibilityChange = 'visibilitychange'; - hidden = 'hidden'; - } - else if (typeof document['mozHidden'] !== 'undefined') { - visibilityChange = 'mozvisibilitychange'; - hidden = 'mozHidden'; - } - else if (typeof document['msHidden'] !== 'undefined') { - visibilityChange = 'msvisibilitychange'; - hidden = 'msHidden'; - } - else if (typeof document['webkitHidden'] !== 'undefined') { - visibilityChange = 'webkitvisibilitychange'; - hidden = 'webkitHidden'; - } - } - // Initially, we always assume we are visible. This ensures that in browsers - // without page visibility support or in cases where we are never visible - // (e.g. chrome extension), we act as if we are visible, i.e. don't delay - // reconnects - this.visible_ = true; - if (visibilityChange) { - document.addEventListener(visibilityChange, () => { - const visible = !document[hidden]; - if (visible !== this.visible_) { - this.visible_ = visible; - this.trigger('visible', visible); - } - }, false); - } - } - static getInstance() { - return new VisibilityMonitor(); - } - getInitialEvent(eventType) { - assert(eventType === 'visible', 'Unknown event type: ' + eventType); - return [this.visible_]; - } -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -const RECONNECT_MIN_DELAY = 1000; -const RECONNECT_MAX_DELAY_DEFAULT = 60 * 5 * 1000; // 5 minutes in milliseconds (Case: 1858) -const RECONNECT_MAX_DELAY_FOR_ADMINS = 30 * 1000; // 30 seconds for admin clients (likely to be a backend server) -const RECONNECT_DELAY_MULTIPLIER = 1.3; -const RECONNECT_DELAY_RESET_TIMEOUT = 30000; // Reset delay back to MIN_DELAY after being connected for 30sec. -const SERVER_KILL_INTERRUPT_REASON = 'server_kill'; -// If auth fails repeatedly, we'll assume something is wrong and log a warning / back off. -const INVALID_TOKEN_THRESHOLD = 3; -/** - * Firebase connection. Abstracts wire protocol and handles reconnecting. - * - * NOTE: All JSON objects sent to the realtime connection must have property names enclosed - * in quotes to make sure the closure compiler does not minify them. - */ -class PersistentConnection extends ServerActions { - /** - * @param repoInfo_ - Data about the namespace we are connecting to - * @param applicationId_ - The Firebase App ID for this project - * @param onDataUpdate_ - A callback for new data from the server - */ - constructor(repoInfo_, applicationId_, onDataUpdate_, onConnectStatus_, onServerInfoUpdate_, authTokenProvider_, appCheckTokenProvider_, authOverride_) { - super(); - this.repoInfo_ = repoInfo_; - this.applicationId_ = applicationId_; - this.onDataUpdate_ = onDataUpdate_; - this.onConnectStatus_ = onConnectStatus_; - this.onServerInfoUpdate_ = onServerInfoUpdate_; - this.authTokenProvider_ = authTokenProvider_; - this.appCheckTokenProvider_ = appCheckTokenProvider_; - this.authOverride_ = authOverride_; - // Used for diagnostic logging. - this.id = PersistentConnection.nextPersistentConnectionId_++; - this.log_ = logWrapper('p:' + this.id + ':'); - this.interruptReasons_ = {}; - this.listens = new Map(); - this.outstandingPuts_ = []; - this.outstandingGets_ = []; - this.outstandingPutCount_ = 0; - this.outstandingGetCount_ = 0; - this.onDisconnectRequestQueue_ = []; - this.connected_ = false; - this.reconnectDelay_ = RECONNECT_MIN_DELAY; - this.maxReconnectDelay_ = RECONNECT_MAX_DELAY_DEFAULT; - this.securityDebugCallback_ = null; - this.lastSessionId = null; - this.establishConnectionTimer_ = null; - this.visible_ = false; - // Before we get connected, we keep a queue of pending messages to send. - this.requestCBHash_ = {}; - this.requestNumber_ = 0; - this.realtime_ = null; - this.authToken_ = null; - this.appCheckToken_ = null; - this.forceTokenRefresh_ = false; - this.invalidAuthTokenCount_ = 0; - this.invalidAppCheckTokenCount_ = 0; - this.firstConnection_ = true; - this.lastConnectionAttemptTime_ = null; - this.lastConnectionEstablishedTime_ = null; - if (authOverride_ && !isNodeSdk()) { - throw new Error('Auth override specified in options, but not supported on non Node.js platforms'); - } - VisibilityMonitor.getInstance().on('visible', this.onVisible_, this); - if (repoInfo_.host.indexOf('fblocal') === -1) { - OnlineMonitor.getInstance().on('online', this.onOnline_, this); - } - } - sendRequest(action, body, onResponse) { - const curReqNum = ++this.requestNumber_; - const msg = { r: curReqNum, a: action, b: body }; - this.log_(stringify(msg)); - assert(this.connected_, "sendRequest call when we're not connected not allowed."); - this.realtime_.sendRequest(msg); - if (onResponse) { - this.requestCBHash_[curReqNum] = onResponse; - } - } - get(query) { - this.initConnection_(); - const deferred = new Deferred(); - const request = { - p: query._path.toString(), - q: query._queryObject - }; - const outstandingGet = { - action: 'g', - request, - onComplete: (message) => { - const payload = message['d']; - if (message['s'] === 'ok') { - deferred.resolve(payload); - } - else { - deferred.reject(payload); - } - } - }; - this.outstandingGets_.push(outstandingGet); - this.outstandingGetCount_++; - const index = this.outstandingGets_.length - 1; - if (this.connected_) { - this.sendGet_(index); - } - return deferred.promise; - } - listen(query, currentHashFn, tag, onComplete) { - this.initConnection_(); - const queryId = query._queryIdentifier; - const pathString = query._path.toString(); - this.log_('Listen called for ' + pathString + ' ' + queryId); - if (!this.listens.has(pathString)) { - this.listens.set(pathString, new Map()); - } - assert(query._queryParams.isDefault() || !query._queryParams.loadsAllData(), 'listen() called for non-default but complete query'); - assert(!this.listens.get(pathString).has(queryId), `listen() called twice for same path/queryId.`); - const listenSpec = { - onComplete, - hashFn: currentHashFn, - query, - tag - }; - this.listens.get(pathString).set(queryId, listenSpec); - if (this.connected_) { - this.sendListen_(listenSpec); - } - } - sendGet_(index) { - const get = this.outstandingGets_[index]; - this.sendRequest('g', get.request, (message) => { - delete this.outstandingGets_[index]; - this.outstandingGetCount_--; - if (this.outstandingGetCount_ === 0) { - this.outstandingGets_ = []; - } - if (get.onComplete) { - get.onComplete(message); - } - }); - } - sendListen_(listenSpec) { - const query = listenSpec.query; - const pathString = query._path.toString(); - const queryId = query._queryIdentifier; - this.log_('Listen on ' + pathString + ' for ' + queryId); - const req = { /*path*/ p: pathString }; - const action = 'q'; - // Only bother to send query if it's non-default. - if (listenSpec.tag) { - req['q'] = query._queryObject; - req['t'] = listenSpec.tag; - } - req[ /*hash*/'h'] = listenSpec.hashFn(); - this.sendRequest(action, req, (message) => { - const payload = message[ /*data*/'d']; - const status = message[ /*status*/'s']; - // print warnings in any case... - PersistentConnection.warnOnListenWarnings_(payload, query); - const currentListenSpec = this.listens.get(pathString) && - this.listens.get(pathString).get(queryId); - // only trigger actions if the listen hasn't been removed and readded - if (currentListenSpec === listenSpec) { - this.log_('listen response', message); - if (status !== 'ok') { - this.removeListen_(pathString, queryId); - } - if (listenSpec.onComplete) { - listenSpec.onComplete(status, payload); - } - } - }); - } - static warnOnListenWarnings_(payload, query) { - if (payload && typeof payload === 'object' && contains(payload, 'w')) { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - const warnings = safeGet(payload, 'w'); - if (Array.isArray(warnings) && ~warnings.indexOf('no_index')) { - const indexSpec = '".indexOn": "' + query._queryParams.getIndex().toString() + '"'; - const indexPath = query._path.toString(); - warn(`Using an unspecified index. Your data will be downloaded and ` + - `filtered on the client. Consider adding ${indexSpec} at ` + - `${indexPath} to your security rules for better performance.`); - } - } - } - refreshAuthToken(token) { - this.authToken_ = token; - this.log_('Auth token refreshed'); - if (this.authToken_) { - this.tryAuth(); - } - else { - //If we're connected we want to let the server know to unauthenticate us. If we're not connected, simply delete - //the credential so we dont become authenticated next time we connect. - if (this.connected_) { - this.sendRequest('unauth', {}, () => { }); - } - } - this.reduceReconnectDelayIfAdminCredential_(token); - } - reduceReconnectDelayIfAdminCredential_(credential) { - // NOTE: This isn't intended to be bulletproof (a malicious developer can always just modify the client). - // Additionally, we don't bother resetting the max delay back to the default if auth fails / expires. - const isFirebaseSecret = credential && credential.length === 40; - if (isFirebaseSecret || isAdmin(credential)) { - this.log_('Admin auth credential detected. Reducing max reconnect time.'); - this.maxReconnectDelay_ = RECONNECT_MAX_DELAY_FOR_ADMINS; - } - } - refreshAppCheckToken(token) { - this.appCheckToken_ = token; - this.log_('App check token refreshed'); - if (this.appCheckToken_) { - this.tryAppCheck(); - } - else { - //If we're connected we want to let the server know to unauthenticate us. - //If we're not connected, simply delete the credential so we dont become - // authenticated next time we connect. - if (this.connected_) { - this.sendRequest('unappeck', {}, () => { }); - } - } - } - /** - * Attempts to authenticate with the given credentials. If the authentication attempt fails, it's triggered like - * a auth revoked (the connection is closed). - */ - tryAuth() { - if (this.connected_ && this.authToken_) { - const token = this.authToken_; - const authMethod = isValidFormat(token) ? 'auth' : 'gauth'; - const requestData = { cred: token }; - if (this.authOverride_ === null) { - requestData['noauth'] = true; - } - else if (typeof this.authOverride_ === 'object') { - requestData['authvar'] = this.authOverride_; - } - this.sendRequest(authMethod, requestData, (res) => { - const status = res[ /*status*/'s']; - const data = res[ /*data*/'d'] || 'error'; - if (this.authToken_ === token) { - if (status === 'ok') { - this.invalidAuthTokenCount_ = 0; - } - else { - // Triggers reconnect and force refresh for auth token - this.onAuthRevoked_(status, data); - } - } - }); - } - } - /** - * Attempts to authenticate with the given token. If the authentication - * attempt fails, it's triggered like the token was revoked (the connection is - * closed). - */ - tryAppCheck() { - if (this.connected_ && this.appCheckToken_) { - this.sendRequest('appcheck', { 'token': this.appCheckToken_ }, (res) => { - const status = res[ /*status*/'s']; - const data = res[ /*data*/'d'] || 'error'; - if (status === 'ok') { - this.invalidAppCheckTokenCount_ = 0; - } - else { - this.onAppCheckRevoked_(status, data); - } - }); - } - } - /** - * @inheritDoc - */ - unlisten(query, tag) { - const pathString = query._path.toString(); - const queryId = query._queryIdentifier; - this.log_('Unlisten called for ' + pathString + ' ' + queryId); - assert(query._queryParams.isDefault() || !query._queryParams.loadsAllData(), 'unlisten() called for non-default but complete query'); - const listen = this.removeListen_(pathString, queryId); - if (listen && this.connected_) { - this.sendUnlisten_(pathString, queryId, query._queryObject, tag); - } - } - sendUnlisten_(pathString, queryId, queryObj, tag) { - this.log_('Unlisten on ' + pathString + ' for ' + queryId); - const req = { /*path*/ p: pathString }; - const action = 'n'; - // Only bother sending queryId if it's non-default. - if (tag) { - req['q'] = queryObj; - req['t'] = tag; - } - this.sendRequest(action, req); - } - onDisconnectPut(pathString, data, onComplete) { - this.initConnection_(); - if (this.connected_) { - this.sendOnDisconnect_('o', pathString, data, onComplete); - } - else { - this.onDisconnectRequestQueue_.push({ - pathString, - action: 'o', - data, - onComplete - }); - } - } - onDisconnectMerge(pathString, data, onComplete) { - this.initConnection_(); - if (this.connected_) { - this.sendOnDisconnect_('om', pathString, data, onComplete); - } - else { - this.onDisconnectRequestQueue_.push({ - pathString, - action: 'om', - data, - onComplete - }); - } - } - onDisconnectCancel(pathString, onComplete) { - this.initConnection_(); - if (this.connected_) { - this.sendOnDisconnect_('oc', pathString, null, onComplete); - } - else { - this.onDisconnectRequestQueue_.push({ - pathString, - action: 'oc', - data: null, - onComplete - }); - } - } - sendOnDisconnect_(action, pathString, data, onComplete) { - const request = { /*path*/ p: pathString, /*data*/ d: data }; - this.log_('onDisconnect ' + action, request); - this.sendRequest(action, request, (response) => { - if (onComplete) { - setTimeout(() => { - onComplete(response[ /*status*/'s'], response[ /* data */'d']); - }, Math.floor(0)); - } - }); - } - put(pathString, data, onComplete, hash) { - this.putInternal('p', pathString, data, onComplete, hash); - } - merge(pathString, data, onComplete, hash) { - this.putInternal('m', pathString, data, onComplete, hash); - } - putInternal(action, pathString, data, onComplete, hash) { - this.initConnection_(); - const request = { - /*path*/ p: pathString, - /*data*/ d: data - }; - if (hash !== undefined) { - request[ /*hash*/'h'] = hash; - } - // TODO: Only keep track of the most recent put for a given path? - this.outstandingPuts_.push({ - action, - request, - onComplete - }); - this.outstandingPutCount_++; - const index = this.outstandingPuts_.length - 1; - if (this.connected_) { - this.sendPut_(index); - } - else { - this.log_('Buffering put: ' + pathString); - } - } - sendPut_(index) { - const action = this.outstandingPuts_[index].action; - const request = this.outstandingPuts_[index].request; - const onComplete = this.outstandingPuts_[index].onComplete; - this.outstandingPuts_[index].queued = this.connected_; - this.sendRequest(action, request, (message) => { - this.log_(action + ' response', message); - delete this.outstandingPuts_[index]; - this.outstandingPutCount_--; - // Clean up array occasionally. - if (this.outstandingPutCount_ === 0) { - this.outstandingPuts_ = []; - } - if (onComplete) { - onComplete(message[ /*status*/'s'], message[ /* data */'d']); - } - }); - } - reportStats(stats) { - // If we're not connected, we just drop the stats. - if (this.connected_) { - const request = { /*counters*/ c: stats }; - this.log_('reportStats', request); - this.sendRequest(/*stats*/ 's', request, result => { - const status = result[ /*status*/'s']; - if (status !== 'ok') { - const errorReason = result[ /* data */'d']; - this.log_('reportStats', 'Error sending stats: ' + errorReason); - } - }); - } - } - onDataMessage_(message) { - if ('r' in message) { - // this is a response - this.log_('from server: ' + stringify(message)); - const reqNum = message['r']; - const onResponse = this.requestCBHash_[reqNum]; - if (onResponse) { - delete this.requestCBHash_[reqNum]; - onResponse(message[ /*body*/'b']); - } - } - else if ('error' in message) { - throw 'A server-side error has occurred: ' + message['error']; - } - else if ('a' in message) { - // a and b are action and body, respectively - this.onDataPush_(message['a'], message['b']); - } - } - onDataPush_(action, body) { - this.log_('handleServerMessage', action, body); - if (action === 'd') { - this.onDataUpdate_(body[ /*path*/'p'], body[ /*data*/'d'], - /*isMerge*/ false, body['t']); - } - else if (action === 'm') { - this.onDataUpdate_(body[ /*path*/'p'], body[ /*data*/'d'], - /*isMerge=*/ true, body['t']); - } - else if (action === 'c') { - this.onListenRevoked_(body[ /*path*/'p'], body[ /*query*/'q']); - } - else if (action === 'ac') { - this.onAuthRevoked_(body[ /*status code*/'s'], body[ /* explanation */'d']); - } - else if (action === 'apc') { - this.onAppCheckRevoked_(body[ /*status code*/'s'], body[ /* explanation */'d']); - } - else if (action === 'sd') { - this.onSecurityDebugPacket_(body); - } - else { - error('Unrecognized action received from server: ' + - stringify(action) + - '\nAre you using the latest client?'); - } - } - onReady_(timestamp, sessionId) { - this.log_('connection ready'); - this.connected_ = true; - this.lastConnectionEstablishedTime_ = new Date().getTime(); - this.handleTimestamp_(timestamp); - this.lastSessionId = sessionId; - if (this.firstConnection_) { - this.sendConnectStats_(); - } - this.restoreState_(); - this.firstConnection_ = false; - this.onConnectStatus_(true); - } - scheduleConnect_(timeout) { - assert(!this.realtime_, "Scheduling a connect when we're already connected/ing?"); - if (this.establishConnectionTimer_) { - clearTimeout(this.establishConnectionTimer_); - } - // NOTE: Even when timeout is 0, it's important to do a setTimeout to work around an infuriating "Security Error" in - // Firefox when trying to write to our long-polling iframe in some scenarios (e.g. Forge or our unit tests). - this.establishConnectionTimer_ = setTimeout(() => { - this.establishConnectionTimer_ = null; - this.establishConnection_(); - // eslint-disable-next-line @typescript-eslint/no-explicit-any - }, Math.floor(timeout)); - } - initConnection_() { - if (!this.realtime_ && this.firstConnection_) { - this.scheduleConnect_(0); - } - } - onVisible_(visible) { - // NOTE: Tabbing away and back to a window will defeat our reconnect backoff, but I think that's fine. - if (visible && - !this.visible_ && - this.reconnectDelay_ === this.maxReconnectDelay_) { - this.log_('Window became visible. Reducing delay.'); - this.reconnectDelay_ = RECONNECT_MIN_DELAY; - if (!this.realtime_) { - this.scheduleConnect_(0); - } - } - this.visible_ = visible; - } - onOnline_(online) { - if (online) { - this.log_('Browser went online.'); - this.reconnectDelay_ = RECONNECT_MIN_DELAY; - if (!this.realtime_) { - this.scheduleConnect_(0); - } - } - else { - this.log_('Browser went offline. Killing connection.'); - if (this.realtime_) { - this.realtime_.close(); - } - } - } - onRealtimeDisconnect_() { - this.log_('data client disconnected'); - this.connected_ = false; - this.realtime_ = null; - // Since we don't know if our sent transactions succeeded or not, we need to cancel them. - this.cancelSentTransactions_(); - // Clear out the pending requests. - this.requestCBHash_ = {}; - if (this.shouldReconnect_()) { - if (!this.visible_) { - this.log_("Window isn't visible. Delaying reconnect."); - this.reconnectDelay_ = this.maxReconnectDelay_; - this.lastConnectionAttemptTime_ = new Date().getTime(); - } - else if (this.lastConnectionEstablishedTime_) { - // If we've been connected long enough, reset reconnect delay to minimum. - const timeSinceLastConnectSucceeded = new Date().getTime() - this.lastConnectionEstablishedTime_; - if (timeSinceLastConnectSucceeded > RECONNECT_DELAY_RESET_TIMEOUT) { - this.reconnectDelay_ = RECONNECT_MIN_DELAY; - } - this.lastConnectionEstablishedTime_ = null; - } - const timeSinceLastConnectAttempt = new Date().getTime() - this.lastConnectionAttemptTime_; - let reconnectDelay = Math.max(0, this.reconnectDelay_ - timeSinceLastConnectAttempt); - reconnectDelay = Math.random() * reconnectDelay; - this.log_('Trying to reconnect in ' + reconnectDelay + 'ms'); - this.scheduleConnect_(reconnectDelay); - // Adjust reconnect delay for next time. - this.reconnectDelay_ = Math.min(this.maxReconnectDelay_, this.reconnectDelay_ * RECONNECT_DELAY_MULTIPLIER); - } - this.onConnectStatus_(false); - } - async establishConnection_() { - if (this.shouldReconnect_()) { - this.log_('Making a connection attempt'); - this.lastConnectionAttemptTime_ = new Date().getTime(); - this.lastConnectionEstablishedTime_ = null; - const onDataMessage = this.onDataMessage_.bind(this); - const onReady = this.onReady_.bind(this); - const onDisconnect = this.onRealtimeDisconnect_.bind(this); - const connId = this.id + ':' + PersistentConnection.nextConnectionId_++; - const lastSessionId = this.lastSessionId; - let canceled = false; - let connection = null; - const closeFn = function () { - if (connection) { - connection.close(); - } - else { - canceled = true; - onDisconnect(); - } - }; - const sendRequestFn = function (msg) { - assert(connection, "sendRequest call when we're not connected not allowed."); - connection.sendRequest(msg); - }; - this.realtime_ = { - close: closeFn, - sendRequest: sendRequestFn - }; - const forceRefresh = this.forceTokenRefresh_; - this.forceTokenRefresh_ = false; - try { - // First fetch auth and app check token, and establish connection after - // fetching the token was successful - const [authToken, appCheckToken] = await Promise.all([ - this.authTokenProvider_.getToken(forceRefresh), - this.appCheckTokenProvider_.getToken(forceRefresh) - ]); - if (!canceled) { - log('getToken() completed. Creating connection.'); - this.authToken_ = authToken && authToken.accessToken; - this.appCheckToken_ = appCheckToken && appCheckToken.token; - connection = new Connection(connId, this.repoInfo_, this.applicationId_, this.appCheckToken_, this.authToken_, onDataMessage, onReady, onDisconnect, - /* onKill= */ reason => { - warn(reason + ' (' + this.repoInfo_.toString() + ')'); - this.interrupt(SERVER_KILL_INTERRUPT_REASON); - }, lastSessionId); - } - else { - log('getToken() completed but was canceled'); - } - } - catch (error) { - this.log_('Failed to get token: ' + error); - if (!canceled) { - if (this.repoInfo_.nodeAdmin) { - // This may be a critical error for the Admin Node.js SDK, so log a warning. - // But getToken() may also just have temporarily failed, so we still want to - // continue retrying. - warn(error); - } - closeFn(); - } - } - } - } - interrupt(reason) { - log('Interrupting connection for reason: ' + reason); - this.interruptReasons_[reason] = true; - if (this.realtime_) { - this.realtime_.close(); - } - else { - if (this.establishConnectionTimer_) { - clearTimeout(this.establishConnectionTimer_); - this.establishConnectionTimer_ = null; - } - if (this.connected_) { - this.onRealtimeDisconnect_(); - } - } - } - resume(reason) { - log('Resuming connection for reason: ' + reason); - delete this.interruptReasons_[reason]; - if (isEmpty(this.interruptReasons_)) { - this.reconnectDelay_ = RECONNECT_MIN_DELAY; - if (!this.realtime_) { - this.scheduleConnect_(0); - } - } - } - handleTimestamp_(timestamp) { - const delta = timestamp - new Date().getTime(); - this.onServerInfoUpdate_({ serverTimeOffset: delta }); - } - cancelSentTransactions_() { - for (let i = 0; i < this.outstandingPuts_.length; i++) { - const put = this.outstandingPuts_[i]; - if (put && /*hash*/ 'h' in put.request && put.queued) { - if (put.onComplete) { - put.onComplete('disconnect'); - } - delete this.outstandingPuts_[i]; - this.outstandingPutCount_--; - } - } - // Clean up array occasionally. - if (this.outstandingPutCount_ === 0) { - this.outstandingPuts_ = []; - } - } - onListenRevoked_(pathString, query) { - // Remove the listen and manufacture a "permission_denied" error for the failed listen. - let queryId; - if (!query) { - queryId = 'default'; - } - else { - queryId = query.map(q => ObjectToUniqueKey(q)).join('$'); - } - const listen = this.removeListen_(pathString, queryId); - if (listen && listen.onComplete) { - listen.onComplete('permission_denied'); - } - } - removeListen_(pathString, queryId) { - const normalizedPathString = new Path(pathString).toString(); // normalize path. - let listen; - if (this.listens.has(normalizedPathString)) { - const map = this.listens.get(normalizedPathString); - listen = map.get(queryId); - map.delete(queryId); - if (map.size === 0) { - this.listens.delete(normalizedPathString); - } - } - else { - // all listens for this path has already been removed - listen = undefined; - } - return listen; - } - onAuthRevoked_(statusCode, explanation) { - log('Auth token revoked: ' + statusCode + '/' + explanation); - this.authToken_ = null; - this.forceTokenRefresh_ = true; - this.realtime_.close(); - if (statusCode === 'invalid_token' || statusCode === 'permission_denied') { - // We'll wait a couple times before logging the warning / increasing the - // retry period since oauth tokens will report as "invalid" if they're - // just expired. Plus there may be transient issues that resolve themselves. - this.invalidAuthTokenCount_++; - if (this.invalidAuthTokenCount_ >= INVALID_TOKEN_THRESHOLD) { - // Set a long reconnect delay because recovery is unlikely - this.reconnectDelay_ = RECONNECT_MAX_DELAY_FOR_ADMINS; - // Notify the auth token provider that the token is invalid, which will log - // a warning - this.authTokenProvider_.notifyForInvalidToken(); - } - } - } - onAppCheckRevoked_(statusCode, explanation) { - log('App check token revoked: ' + statusCode + '/' + explanation); - this.appCheckToken_ = null; - this.forceTokenRefresh_ = true; - // Note: We don't close the connection as the developer may not have - // enforcement enabled. The backend closes connections with enforcements. - if (statusCode === 'invalid_token' || statusCode === 'permission_denied') { - // We'll wait a couple times before logging the warning / increasing the - // retry period since oauth tokens will report as "invalid" if they're - // just expired. Plus there may be transient issues that resolve themselves. - this.invalidAppCheckTokenCount_++; - if (this.invalidAppCheckTokenCount_ >= INVALID_TOKEN_THRESHOLD) { - this.appCheckTokenProvider_.notifyForInvalidToken(); - } - } - } - onSecurityDebugPacket_(body) { - if (this.securityDebugCallback_) { - this.securityDebugCallback_(body); - } - else { - if ('msg' in body) { - console.log('FIREBASE: ' + body['msg'].replace('\n', '\nFIREBASE: ')); - } - } - } - restoreState_() { - //Re-authenticate ourselves if we have a credential stored. - this.tryAuth(); - this.tryAppCheck(); - // Puts depend on having received the corresponding data update from the server before they complete, so we must - // make sure to send listens before puts. - for (const queries of this.listens.values()) { - for (const listenSpec of queries.values()) { - this.sendListen_(listenSpec); - } - } - for (let i = 0; i < this.outstandingPuts_.length; i++) { - if (this.outstandingPuts_[i]) { - this.sendPut_(i); - } - } - while (this.onDisconnectRequestQueue_.length) { - const request = this.onDisconnectRequestQueue_.shift(); - this.sendOnDisconnect_(request.action, request.pathString, request.data, request.onComplete); - } - for (let i = 0; i < this.outstandingGets_.length; i++) { - if (this.outstandingGets_[i]) { - this.sendGet_(i); - } - } - } - /** - * Sends client stats for first connection - */ - sendConnectStats_() { - const stats = {}; - let clientName = 'js'; - if (isNodeSdk()) { - if (this.repoInfo_.nodeAdmin) { - clientName = 'admin_node'; - } - else { - clientName = 'node'; - } - } - stats['sdk.' + clientName + '.' + SDK_VERSION.replace(/\./g, '-')] = 1; - if (isMobileCordova()) { - stats['framework.cordova'] = 1; - } - else if (isReactNative()) { - stats['framework.reactnative'] = 1; - } - this.reportStats(stats); - } - shouldReconnect_() { - const online = OnlineMonitor.getInstance().currentlyOnline(); - return isEmpty(this.interruptReasons_) && online; - } -} -PersistentConnection.nextPersistentConnectionId_ = 0; -/** - * Counter for number of connections created. Mainly used for tagging in the logs - */ -PersistentConnection.nextConnectionId_ = 0; - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -class NamedNode { - constructor(name, node) { - this.name = name; - this.node = node; - } - static Wrap(name, node) { - return new NamedNode(name, node); - } -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -class Index { - /** - * @returns A standalone comparison function for - * this index - */ - getCompare() { - return this.compare.bind(this); - } - /** - * Given a before and after value for a node, determine if the indexed value has changed. Even if they are different, - * it's possible that the changes are isolated to parts of the snapshot that are not indexed. - * - * - * @returns True if the portion of the snapshot being indexed changed between oldNode and newNode - */ - indexedValueChanged(oldNode, newNode) { - const oldWrapped = new NamedNode(MIN_NAME, oldNode); - const newWrapped = new NamedNode(MIN_NAME, newNode); - return this.compare(oldWrapped, newWrapped) !== 0; - } - /** - * @returns a node wrapper that will sort equal to or less than - * any other node wrapper, using this index - */ - minPost() { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - return NamedNode.MIN; - } -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -let __EMPTY_NODE; -class KeyIndex extends Index { - static get __EMPTY_NODE() { - return __EMPTY_NODE; - } - static set __EMPTY_NODE(val) { - __EMPTY_NODE = val; - } - compare(a, b) { - return nameCompare(a.name, b.name); - } - isDefinedOn(node) { - // We could probably return true here (since every node has a key), but it's never called - // so just leaving unimplemented for now. - throw assertionError('KeyIndex.isDefinedOn not expected to be called.'); - } - indexedValueChanged(oldNode, newNode) { - return false; // The key for a node never changes. - } - minPost() { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - return NamedNode.MIN; - } - maxPost() { - // TODO: This should really be created once and cached in a static property, but - // NamedNode isn't defined yet, so I can't use it in a static. Bleh. - return new NamedNode(MAX_NAME, __EMPTY_NODE); - } - makePost(indexValue, name) { - assert(typeof indexValue === 'string', 'KeyIndex indexValue must always be a string.'); - // We just use empty node, but it'll never be compared, since our comparator only looks at name. - return new NamedNode(indexValue, __EMPTY_NODE); - } - /** - * @returns String representation for inclusion in a query spec - */ - toString() { - return '.key'; - } -} -const KEY_INDEX = new KeyIndex(); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * An iterator over an LLRBNode. - */ -class SortedMapIterator { - /** - * @param node - Node to iterate. - * @param isReverse_ - Whether or not to iterate in reverse - */ - constructor(node, startKey, comparator, isReverse_, resultGenerator_ = null) { - this.isReverse_ = isReverse_; - this.resultGenerator_ = resultGenerator_; - this.nodeStack_ = []; - let cmp = 1; - while (!node.isEmpty()) { - node = node; - cmp = startKey ? comparator(node.key, startKey) : 1; - // flip the comparison if we're going in reverse - if (isReverse_) { - cmp *= -1; - } - if (cmp < 0) { - // This node is less than our start key. ignore it - if (this.isReverse_) { - node = node.left; - } - else { - node = node.right; - } - } - else if (cmp === 0) { - // This node is exactly equal to our start key. Push it on the stack, but stop iterating; - this.nodeStack_.push(node); - break; - } - else { - // This node is greater than our start key, add it to the stack and move to the next one - this.nodeStack_.push(node); - if (this.isReverse_) { - node = node.right; - } - else { - node = node.left; - } - } - } - } - getNext() { - if (this.nodeStack_.length === 0) { - return null; - } - let node = this.nodeStack_.pop(); - let result; - if (this.resultGenerator_) { - result = this.resultGenerator_(node.key, node.value); - } - else { - result = { key: node.key, value: node.value }; - } - if (this.isReverse_) { - node = node.left; - while (!node.isEmpty()) { - this.nodeStack_.push(node); - node = node.right; - } - } - else { - node = node.right; - while (!node.isEmpty()) { - this.nodeStack_.push(node); - node = node.left; - } - } - return result; - } - hasNext() { - return this.nodeStack_.length > 0; - } - peek() { - if (this.nodeStack_.length === 0) { - return null; - } - const node = this.nodeStack_[this.nodeStack_.length - 1]; - if (this.resultGenerator_) { - return this.resultGenerator_(node.key, node.value); - } - else { - return { key: node.key, value: node.value }; - } - } -} -/** - * Represents a node in a Left-leaning Red-Black tree. - */ -class LLRBNode { - /** - * @param key - Key associated with this node. - * @param value - Value associated with this node. - * @param color - Whether this node is red. - * @param left - Left child. - * @param right - Right child. - */ - constructor(key, value, color, left, right) { - this.key = key; - this.value = value; - this.color = color != null ? color : LLRBNode.RED; - this.left = - left != null ? left : SortedMap.EMPTY_NODE; - this.right = - right != null ? right : SortedMap.EMPTY_NODE; - } - /** - * Returns a copy of the current node, optionally replacing pieces of it. - * - * @param key - New key for the node, or null. - * @param value - New value for the node, or null. - * @param color - New color for the node, or null. - * @param left - New left child for the node, or null. - * @param right - New right child for the node, or null. - * @returns The node copy. - */ - copy(key, value, color, left, right) { - return new LLRBNode(key != null ? key : this.key, value != null ? value : this.value, color != null ? color : this.color, left != null ? left : this.left, right != null ? right : this.right); - } - /** - * @returns The total number of nodes in the tree. - */ - count() { - return this.left.count() + 1 + this.right.count(); - } - /** - * @returns True if the tree is empty. - */ - isEmpty() { - return false; - } - /** - * Traverses the tree in key order and calls the specified action function - * for each node. - * - * @param action - Callback function to be called for each - * node. If it returns true, traversal is aborted. - * @returns The first truthy value returned by action, or the last falsey - * value returned by action - */ - inorderTraversal(action) { - return (this.left.inorderTraversal(action) || - !!action(this.key, this.value) || - this.right.inorderTraversal(action)); - } - /** - * Traverses the tree in reverse key order and calls the specified action function - * for each node. - * - * @param action - Callback function to be called for each - * node. If it returns true, traversal is aborted. - * @returns True if traversal was aborted. - */ - reverseTraversal(action) { - return (this.right.reverseTraversal(action) || - action(this.key, this.value) || - this.left.reverseTraversal(action)); - } - /** - * @returns The minimum node in the tree. - */ - min_() { - if (this.left.isEmpty()) { - return this; - } - else { - return this.left.min_(); - } - } - /** - * @returns The maximum key in the tree. - */ - minKey() { - return this.min_().key; - } - /** - * @returns The maximum key in the tree. - */ - maxKey() { - if (this.right.isEmpty()) { - return this.key; - } - else { - return this.right.maxKey(); - } - } - /** - * @param key - Key to insert. - * @param value - Value to insert. - * @param comparator - Comparator. - * @returns New tree, with the key/value added. - */ - insert(key, value, comparator) { - let n = this; - const cmp = comparator(key, n.key); - if (cmp < 0) { - n = n.copy(null, null, null, n.left.insert(key, value, comparator), null); - } - else if (cmp === 0) { - n = n.copy(null, value, null, null, null); - } - else { - n = n.copy(null, null, null, null, n.right.insert(key, value, comparator)); - } - return n.fixUp_(); - } - /** - * @returns New tree, with the minimum key removed. - */ - removeMin_() { - if (this.left.isEmpty()) { - return SortedMap.EMPTY_NODE; - } - let n = this; - if (!n.left.isRed_() && !n.left.left.isRed_()) { - n = n.moveRedLeft_(); - } - n = n.copy(null, null, null, n.left.removeMin_(), null); - return n.fixUp_(); - } - /** - * @param key - The key of the item to remove. - * @param comparator - Comparator. - * @returns New tree, with the specified item removed. - */ - remove(key, comparator) { - let n, smallest; - n = this; - if (comparator(key, n.key) < 0) { - if (!n.left.isEmpty() && !n.left.isRed_() && !n.left.left.isRed_()) { - n = n.moveRedLeft_(); - } - n = n.copy(null, null, null, n.left.remove(key, comparator), null); - } - else { - if (n.left.isRed_()) { - n = n.rotateRight_(); - } - if (!n.right.isEmpty() && !n.right.isRed_() && !n.right.left.isRed_()) { - n = n.moveRedRight_(); - } - if (comparator(key, n.key) === 0) { - if (n.right.isEmpty()) { - return SortedMap.EMPTY_NODE; - } - else { - smallest = n.right.min_(); - n = n.copy(smallest.key, smallest.value, null, null, n.right.removeMin_()); - } - } - n = n.copy(null, null, null, null, n.right.remove(key, comparator)); - } - return n.fixUp_(); - } - /** - * @returns Whether this is a RED node. - */ - isRed_() { - return this.color; - } - /** - * @returns New tree after performing any needed rotations. - */ - fixUp_() { - let n = this; - if (n.right.isRed_() && !n.left.isRed_()) { - n = n.rotateLeft_(); - } - if (n.left.isRed_() && n.left.left.isRed_()) { - n = n.rotateRight_(); - } - if (n.left.isRed_() && n.right.isRed_()) { - n = n.colorFlip_(); - } - return n; - } - /** - * @returns New tree, after moveRedLeft. - */ - moveRedLeft_() { - let n = this.colorFlip_(); - if (n.right.left.isRed_()) { - n = n.copy(null, null, null, null, n.right.rotateRight_()); - n = n.rotateLeft_(); - n = n.colorFlip_(); - } - return n; - } - /** - * @returns New tree, after moveRedRight. - */ - moveRedRight_() { - let n = this.colorFlip_(); - if (n.left.left.isRed_()) { - n = n.rotateRight_(); - n = n.colorFlip_(); - } - return n; - } - /** - * @returns New tree, after rotateLeft. - */ - rotateLeft_() { - const nl = this.copy(null, null, LLRBNode.RED, null, this.right.left); - return this.right.copy(null, null, this.color, nl, null); - } - /** - * @returns New tree, after rotateRight. - */ - rotateRight_() { - const nr = this.copy(null, null, LLRBNode.RED, this.left.right, null); - return this.left.copy(null, null, this.color, null, nr); - } - /** - * @returns Newt ree, after colorFlip. - */ - colorFlip_() { - const left = this.left.copy(null, null, !this.left.color, null, null); - const right = this.right.copy(null, null, !this.right.color, null, null); - return this.copy(null, null, !this.color, left, right); - } - /** - * For testing. - * - * @returns True if all is well. - */ - checkMaxDepth_() { - const blackDepth = this.check_(); - return Math.pow(2.0, blackDepth) <= this.count() + 1; - } - check_() { - if (this.isRed_() && this.left.isRed_()) { - throw new Error('Red node has red child(' + this.key + ',' + this.value + ')'); - } - if (this.right.isRed_()) { - throw new Error('Right child of (' + this.key + ',' + this.value + ') is red'); - } - const blackDepth = this.left.check_(); - if (blackDepth !== this.right.check_()) { - throw new Error('Black depths differ'); - } - else { - return blackDepth + (this.isRed_() ? 0 : 1); - } - } -} -LLRBNode.RED = true; -LLRBNode.BLACK = false; -/** - * Represents an empty node (a leaf node in the Red-Black Tree). - */ -class LLRBEmptyNode { - /** - * Returns a copy of the current node. - * - * @returns The node copy. - */ - copy(key, value, color, left, right) { - return this; - } - /** - * Returns a copy of the tree, with the specified key/value added. - * - * @param key - Key to be added. - * @param value - Value to be added. - * @param comparator - Comparator. - * @returns New tree, with item added. - */ - insert(key, value, comparator) { - return new LLRBNode(key, value, null); - } - /** - * Returns a copy of the tree, with the specified key removed. - * - * @param key - The key to remove. - * @param comparator - Comparator. - * @returns New tree, with item removed. - */ - remove(key, comparator) { - return this; - } - /** - * @returns The total number of nodes in the tree. - */ - count() { - return 0; - } - /** - * @returns True if the tree is empty. - */ - isEmpty() { - return true; - } - /** - * Traverses the tree in key order and calls the specified action function - * for each node. - * - * @param action - Callback function to be called for each - * node. If it returns true, traversal is aborted. - * @returns True if traversal was aborted. - */ - inorderTraversal(action) { - return false; - } - /** - * Traverses the tree in reverse key order and calls the specified action function - * for each node. - * - * @param action - Callback function to be called for each - * node. If it returns true, traversal is aborted. - * @returns True if traversal was aborted. - */ - reverseTraversal(action) { - return false; - } - minKey() { - return null; - } - maxKey() { - return null; - } - check_() { - return 0; - } - /** - * @returns Whether this node is red. - */ - isRed_() { - return false; - } -} -/** - * An immutable sorted map implementation, based on a Left-leaning Red-Black - * tree. - */ -class SortedMap { - /** - * @param comparator_ - Key comparator. - * @param root_ - Optional root node for the map. - */ - constructor(comparator_, root_ = SortedMap.EMPTY_NODE) { - this.comparator_ = comparator_; - this.root_ = root_; - } - /** - * Returns a copy of the map, with the specified key/value added or replaced. - * (TODO: We should perhaps rename this method to 'put') - * - * @param key - Key to be added. - * @param value - Value to be added. - * @returns New map, with item added. - */ - insert(key, value) { - return new SortedMap(this.comparator_, this.root_ - .insert(key, value, this.comparator_) - .copy(null, null, LLRBNode.BLACK, null, null)); - } - /** - * Returns a copy of the map, with the specified key removed. - * - * @param key - The key to remove. - * @returns New map, with item removed. - */ - remove(key) { - return new SortedMap(this.comparator_, this.root_ - .remove(key, this.comparator_) - .copy(null, null, LLRBNode.BLACK, null, null)); - } - /** - * Returns the value of the node with the given key, or null. - * - * @param key - The key to look up. - * @returns The value of the node with the given key, or null if the - * key doesn't exist. - */ - get(key) { - let cmp; - let node = this.root_; - while (!node.isEmpty()) { - cmp = this.comparator_(key, node.key); - if (cmp === 0) { - return node.value; - } - else if (cmp < 0) { - node = node.left; - } - else if (cmp > 0) { - node = node.right; - } - } - return null; - } - /** - * Returns the key of the item *before* the specified key, or null if key is the first item. - * @param key - The key to find the predecessor of - * @returns The predecessor key. - */ - getPredecessorKey(key) { - let cmp, node = this.root_, rightParent = null; - while (!node.isEmpty()) { - cmp = this.comparator_(key, node.key); - if (cmp === 0) { - if (!node.left.isEmpty()) { - node = node.left; - while (!node.right.isEmpty()) { - node = node.right; - } - return node.key; - } - else if (rightParent) { - return rightParent.key; - } - else { - return null; // first item. - } - } - else if (cmp < 0) { - node = node.left; - } - else if (cmp > 0) { - rightParent = node; - node = node.right; - } - } - throw new Error('Attempted to find predecessor key for a nonexistent key. What gives?'); - } - /** - * @returns True if the map is empty. - */ - isEmpty() { - return this.root_.isEmpty(); - } - /** - * @returns The total number of nodes in the map. - */ - count() { - return this.root_.count(); - } - /** - * @returns The minimum key in the map. - */ - minKey() { - return this.root_.minKey(); - } - /** - * @returns The maximum key in the map. - */ - maxKey() { - return this.root_.maxKey(); - } - /** - * Traverses the map in key order and calls the specified action function - * for each key/value pair. - * - * @param action - Callback function to be called - * for each key/value pair. If action returns true, traversal is aborted. - * @returns The first truthy value returned by action, or the last falsey - * value returned by action - */ - inorderTraversal(action) { - return this.root_.inorderTraversal(action); - } - /** - * Traverses the map in reverse key order and calls the specified action function - * for each key/value pair. - * - * @param action - Callback function to be called - * for each key/value pair. If action returns true, traversal is aborted. - * @returns True if the traversal was aborted. - */ - reverseTraversal(action) { - return this.root_.reverseTraversal(action); - } - /** - * Returns an iterator over the SortedMap. - * @returns The iterator. - */ - getIterator(resultGenerator) { - return new SortedMapIterator(this.root_, null, this.comparator_, false, resultGenerator); - } - getIteratorFrom(key, resultGenerator) { - return new SortedMapIterator(this.root_, key, this.comparator_, false, resultGenerator); - } - getReverseIteratorFrom(key, resultGenerator) { - return new SortedMapIterator(this.root_, key, this.comparator_, true, resultGenerator); - } - getReverseIterator(resultGenerator) { - return new SortedMapIterator(this.root_, null, this.comparator_, true, resultGenerator); - } -} -/** - * Always use the same empty node, to reduce memory. - */ -SortedMap.EMPTY_NODE = new LLRBEmptyNode(); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -function NAME_ONLY_COMPARATOR(left, right) { - return nameCompare(left.name, right.name); -} -function NAME_COMPARATOR(left, right) { - return nameCompare(left, right); -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -let MAX_NODE$2; -function setMaxNode$1(val) { - MAX_NODE$2 = val; -} -const priorityHashText = function (priority) { - if (typeof priority === 'number') { - return 'number:' + doubleToIEEE754String(priority); - } - else { - return 'string:' + priority; - } -}; -/** - * Validates that a priority snapshot Node is valid. - */ -const validatePriorityNode = function (priorityNode) { - if (priorityNode.isLeafNode()) { - const val = priorityNode.val(); - assert(typeof val === 'string' || - typeof val === 'number' || - (typeof val === 'object' && contains(val, '.sv')), 'Priority must be a string or number.'); - } - else { - assert(priorityNode === MAX_NODE$2 || priorityNode.isEmpty(), 'priority of unexpected type.'); - } - // Don't call getPriority() on MAX_NODE to avoid hitting assertion. - assert(priorityNode === MAX_NODE$2 || priorityNode.getPriority().isEmpty(), "Priority nodes can't have a priority of their own."); -}; - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -let __childrenNodeConstructor; -/** - * LeafNode is a class for storing leaf nodes in a DataSnapshot. It - * implements Node and stores the value of the node (a string, - * number, or boolean) accessible via getValue(). - */ -class LeafNode { - /** - * @param value_ - The value to store in this leaf node. The object type is - * possible in the event of a deferred value - * @param priorityNode_ - The priority of this node. - */ - constructor(value_, priorityNode_ = LeafNode.__childrenNodeConstructor.EMPTY_NODE) { - this.value_ = value_; - this.priorityNode_ = priorityNode_; - this.lazyHash_ = null; - assert(this.value_ !== undefined && this.value_ !== null, "LeafNode shouldn't be created with null/undefined value."); - validatePriorityNode(this.priorityNode_); - } - static set __childrenNodeConstructor(val) { - __childrenNodeConstructor = val; - } - static get __childrenNodeConstructor() { - return __childrenNodeConstructor; - } - /** @inheritDoc */ - isLeafNode() { - return true; - } - /** @inheritDoc */ - getPriority() { - return this.priorityNode_; - } - /** @inheritDoc */ - updatePriority(newPriorityNode) { - return new LeafNode(this.value_, newPriorityNode); - } - /** @inheritDoc */ - getImmediateChild(childName) { - // Hack to treat priority as a regular child - if (childName === '.priority') { - return this.priorityNode_; - } - else { - return LeafNode.__childrenNodeConstructor.EMPTY_NODE; - } - } - /** @inheritDoc */ - getChild(path) { - if (pathIsEmpty(path)) { - return this; - } - else if (pathGetFront(path) === '.priority') { - return this.priorityNode_; - } - else { - return LeafNode.__childrenNodeConstructor.EMPTY_NODE; - } - } - hasChild() { - return false; - } - /** @inheritDoc */ - getPredecessorChildName(childName, childNode) { - return null; - } - /** @inheritDoc */ - updateImmediateChild(childName, newChildNode) { - if (childName === '.priority') { - return this.updatePriority(newChildNode); - } - else if (newChildNode.isEmpty() && childName !== '.priority') { - return this; - } - else { - return LeafNode.__childrenNodeConstructor.EMPTY_NODE.updateImmediateChild(childName, newChildNode).updatePriority(this.priorityNode_); - } - } - /** @inheritDoc */ - updateChild(path, newChildNode) { - const front = pathGetFront(path); - if (front === null) { - return newChildNode; - } - else if (newChildNode.isEmpty() && front !== '.priority') { - return this; - } - else { - assert(front !== '.priority' || pathGetLength(path) === 1, '.priority must be the last token in a path'); - return this.updateImmediateChild(front, LeafNode.__childrenNodeConstructor.EMPTY_NODE.updateChild(pathPopFront(path), newChildNode)); - } - } - /** @inheritDoc */ - isEmpty() { - return false; - } - /** @inheritDoc */ - numChildren() { - return 0; - } - /** @inheritDoc */ - forEachChild(index, action) { - return false; - } - val(exportFormat) { - if (exportFormat && !this.getPriority().isEmpty()) { - return { - '.value': this.getValue(), - '.priority': this.getPriority().val() - }; - } - else { - return this.getValue(); - } - } - /** @inheritDoc */ - hash() { - if (this.lazyHash_ === null) { - let toHash = ''; - if (!this.priorityNode_.isEmpty()) { - toHash += - 'priority:' + - priorityHashText(this.priorityNode_.val()) + - ':'; - } - const type = typeof this.value_; - toHash += type + ':'; - if (type === 'number') { - toHash += doubleToIEEE754String(this.value_); - } - else { - toHash += this.value_; - } - this.lazyHash_ = sha1(toHash); - } - return this.lazyHash_; - } - /** - * Returns the value of the leaf node. - * @returns The value of the node. - */ - getValue() { - return this.value_; - } - compareTo(other) { - if (other === LeafNode.__childrenNodeConstructor.EMPTY_NODE) { - return 1; - } - else if (other instanceof LeafNode.__childrenNodeConstructor) { - return -1; - } - else { - assert(other.isLeafNode(), 'Unknown node type'); - return this.compareToLeafNode_(other); - } - } - /** - * Comparison specifically for two leaf nodes - */ - compareToLeafNode_(otherLeaf) { - const otherLeafType = typeof otherLeaf.value_; - const thisLeafType = typeof this.value_; - const otherIndex = LeafNode.VALUE_TYPE_ORDER.indexOf(otherLeafType); - const thisIndex = LeafNode.VALUE_TYPE_ORDER.indexOf(thisLeafType); - assert(otherIndex >= 0, 'Unknown leaf type: ' + otherLeafType); - assert(thisIndex >= 0, 'Unknown leaf type: ' + thisLeafType); - if (otherIndex === thisIndex) { - // Same type, compare values - if (thisLeafType === 'object') { - // Deferred value nodes are all equal, but we should also never get to this point... - return 0; - } - else { - // Note that this works because true > false, all others are number or string comparisons - if (this.value_ < otherLeaf.value_) { - return -1; - } - else if (this.value_ === otherLeaf.value_) { - return 0; - } - else { - return 1; - } - } - } - else { - return thisIndex - otherIndex; - } - } - withIndex() { - return this; - } - isIndexed() { - return true; - } - equals(other) { - if (other === this) { - return true; - } - else if (other.isLeafNode()) { - const otherLeaf = other; - return (this.value_ === otherLeaf.value_ && - this.priorityNode_.equals(otherLeaf.priorityNode_)); - } - else { - return false; - } - } -} -/** - * The sort order for comparing leaf nodes of different types. If two leaf nodes have - * the same type, the comparison falls back to their value - */ -LeafNode.VALUE_TYPE_ORDER = ['object', 'boolean', 'number', 'string']; - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -let nodeFromJSON$1; -let MAX_NODE$1; -function setNodeFromJSON(val) { - nodeFromJSON$1 = val; -} -function setMaxNode(val) { - MAX_NODE$1 = val; -} -class PriorityIndex extends Index { - compare(a, b) { - const aPriority = a.node.getPriority(); - const bPriority = b.node.getPriority(); - const indexCmp = aPriority.compareTo(bPriority); - if (indexCmp === 0) { - return nameCompare(a.name, b.name); - } - else { - return indexCmp; - } - } - isDefinedOn(node) { - return !node.getPriority().isEmpty(); - } - indexedValueChanged(oldNode, newNode) { - return !oldNode.getPriority().equals(newNode.getPriority()); - } - minPost() { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - return NamedNode.MIN; - } - maxPost() { - return new NamedNode(MAX_NAME, new LeafNode('[PRIORITY-POST]', MAX_NODE$1)); - } - makePost(indexValue, name) { - const priorityNode = nodeFromJSON$1(indexValue); - return new NamedNode(name, new LeafNode('[PRIORITY-POST]', priorityNode)); - } - /** - * @returns String representation for inclusion in a query spec - */ - toString() { - return '.priority'; - } -} -const PRIORITY_INDEX = new PriorityIndex(); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -const LOG_2 = Math.log(2); -class Base12Num { - constructor(length) { - const logBase2 = (num) => - // eslint-disable-next-line @typescript-eslint/no-explicit-any - parseInt((Math.log(num) / LOG_2), 10); - const bitMask = (bits) => parseInt(Array(bits + 1).join('1'), 2); - this.count = logBase2(length + 1); - this.current_ = this.count - 1; - const mask = bitMask(this.count); - this.bits_ = (length + 1) & mask; - } - nextBitIsOne() { - //noinspection JSBitwiseOperatorUsage - const result = !(this.bits_ & (0x1 << this.current_)); - this.current_--; - return result; - } -} -/** - * Takes a list of child nodes and constructs a SortedSet using the given comparison - * function - * - * Uses the algorithm described in the paper linked here: - * http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.46.1458 - * - * @param childList - Unsorted list of children - * @param cmp - The comparison method to be used - * @param keyFn - An optional function to extract K from a node wrapper, if K's - * type is not NamedNode - * @param mapSortFn - An optional override for comparator used by the generated sorted map - */ -const buildChildSet = function (childList, cmp, keyFn, mapSortFn) { - childList.sort(cmp); - const buildBalancedTree = function (low, high) { - const length = high - low; - let namedNode; - let key; - if (length === 0) { - return null; - } - else if (length === 1) { - namedNode = childList[low]; - key = keyFn ? keyFn(namedNode) : namedNode; - return new LLRBNode(key, namedNode.node, LLRBNode.BLACK, null, null); - } - else { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - const middle = parseInt((length / 2), 10) + low; - const left = buildBalancedTree(low, middle); - const right = buildBalancedTree(middle + 1, high); - namedNode = childList[middle]; - key = keyFn ? keyFn(namedNode) : namedNode; - return new LLRBNode(key, namedNode.node, LLRBNode.BLACK, left, right); - } - }; - const buildFrom12Array = function (base12) { - let node = null; - let root = null; - let index = childList.length; - const buildPennant = function (chunkSize, color) { - const low = index - chunkSize; - const high = index; - index -= chunkSize; - const childTree = buildBalancedTree(low + 1, high); - const namedNode = childList[low]; - const key = keyFn ? keyFn(namedNode) : namedNode; - attachPennant(new LLRBNode(key, namedNode.node, color, null, childTree)); - }; - const attachPennant = function (pennant) { - if (node) { - node.left = pennant; - node = pennant; - } - else { - root = pennant; - node = pennant; - } - }; - for (let i = 0; i < base12.count; ++i) { - const isOne = base12.nextBitIsOne(); - // The number of nodes taken in each slice is 2^(arr.length - (i + 1)) - const chunkSize = Math.pow(2, base12.count - (i + 1)); - if (isOne) { - buildPennant(chunkSize, LLRBNode.BLACK); - } - else { - // current == 2 - buildPennant(chunkSize, LLRBNode.BLACK); - buildPennant(chunkSize, LLRBNode.RED); - } - } - return root; - }; - const base12 = new Base12Num(childList.length); - const root = buildFrom12Array(base12); - // eslint-disable-next-line @typescript-eslint/no-explicit-any - return new SortedMap(mapSortFn || cmp, root); -}; - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -let _defaultIndexMap; -const fallbackObject = {}; -class IndexMap { - constructor(indexes_, indexSet_) { - this.indexes_ = indexes_; - this.indexSet_ = indexSet_; - } - /** - * The default IndexMap for nodes without a priority - */ - static get Default() { - assert(fallbackObject && PRIORITY_INDEX, 'ChildrenNode.ts has not been loaded'); - _defaultIndexMap = - _defaultIndexMap || - new IndexMap({ '.priority': fallbackObject }, { '.priority': PRIORITY_INDEX }); - return _defaultIndexMap; - } - get(indexKey) { - const sortedMap = safeGet(this.indexes_, indexKey); - if (!sortedMap) { - throw new Error('No index defined for ' + indexKey); - } - if (sortedMap instanceof SortedMap) { - return sortedMap; - } - else { - // The index exists, but it falls back to just name comparison. Return null so that the calling code uses the - // regular child map - return null; - } - } - hasIndex(indexDefinition) { - return contains(this.indexSet_, indexDefinition.toString()); - } - addIndex(indexDefinition, existingChildren) { - assert(indexDefinition !== KEY_INDEX, "KeyIndex always exists and isn't meant to be added to the IndexMap."); - const childList = []; - let sawIndexedValue = false; - const iter = existingChildren.getIterator(NamedNode.Wrap); - let next = iter.getNext(); - while (next) { - sawIndexedValue = - sawIndexedValue || indexDefinition.isDefinedOn(next.node); - childList.push(next); - next = iter.getNext(); - } - let newIndex; - if (sawIndexedValue) { - newIndex = buildChildSet(childList, indexDefinition.getCompare()); - } - else { - newIndex = fallbackObject; - } - const indexName = indexDefinition.toString(); - const newIndexSet = Object.assign({}, this.indexSet_); - newIndexSet[indexName] = indexDefinition; - const newIndexes = Object.assign({}, this.indexes_); - newIndexes[indexName] = newIndex; - return new IndexMap(newIndexes, newIndexSet); - } - /** - * Ensure that this node is properly tracked in any indexes that we're maintaining - */ - addToIndexes(namedNode, existingChildren) { - const newIndexes = map(this.indexes_, (indexedChildren, indexName) => { - const index = safeGet(this.indexSet_, indexName); - assert(index, 'Missing index implementation for ' + indexName); - if (indexedChildren === fallbackObject) { - // Check to see if we need to index everything - if (index.isDefinedOn(namedNode.node)) { - // We need to build this index - const childList = []; - const iter = existingChildren.getIterator(NamedNode.Wrap); - let next = iter.getNext(); - while (next) { - if (next.name !== namedNode.name) { - childList.push(next); - } - next = iter.getNext(); - } - childList.push(namedNode); - return buildChildSet(childList, index.getCompare()); - } - else { - // No change, this remains a fallback - return fallbackObject; - } - } - else { - const existingSnap = existingChildren.get(namedNode.name); - let newChildren = indexedChildren; - if (existingSnap) { - newChildren = newChildren.remove(new NamedNode(namedNode.name, existingSnap)); - } - return newChildren.insert(namedNode, namedNode.node); - } - }); - return new IndexMap(newIndexes, this.indexSet_); - } - /** - * Create a new IndexMap instance with the given value removed - */ - removeFromIndexes(namedNode, existingChildren) { - const newIndexes = map(this.indexes_, (indexedChildren) => { - if (indexedChildren === fallbackObject) { - // This is the fallback. Just return it, nothing to do in this case - return indexedChildren; - } - else { - const existingSnap = existingChildren.get(namedNode.name); - if (existingSnap) { - return indexedChildren.remove(new NamedNode(namedNode.name, existingSnap)); - } - else { - // No record of this child - return indexedChildren; - } - } - }); - return new IndexMap(newIndexes, this.indexSet_); - } -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// TODO: For memory savings, don't store priorityNode_ if it's empty. -let EMPTY_NODE; -/** - * ChildrenNode is a class for storing internal nodes in a DataSnapshot - * (i.e. nodes with children). It implements Node and stores the - * list of children in the children property, sorted by child name. - */ -class ChildrenNode { - /** - * @param children_ - List of children of this node.. - * @param priorityNode_ - The priority of this node (as a snapshot node). - */ - constructor(children_, priorityNode_, indexMap_) { - this.children_ = children_; - this.priorityNode_ = priorityNode_; - this.indexMap_ = indexMap_; - this.lazyHash_ = null; - /** - * Note: The only reason we allow null priority is for EMPTY_NODE, since we can't use - * EMPTY_NODE as the priority of EMPTY_NODE. We might want to consider making EMPTY_NODE its own - * class instead of an empty ChildrenNode. - */ - if (this.priorityNode_) { - validatePriorityNode(this.priorityNode_); - } - if (this.children_.isEmpty()) { - assert(!this.priorityNode_ || this.priorityNode_.isEmpty(), 'An empty node cannot have a priority'); - } - } - static get EMPTY_NODE() { - return (EMPTY_NODE || - (EMPTY_NODE = new ChildrenNode(new SortedMap(NAME_COMPARATOR), null, IndexMap.Default))); - } - /** @inheritDoc */ - isLeafNode() { - return false; - } - /** @inheritDoc */ - getPriority() { - return this.priorityNode_ || EMPTY_NODE; - } - /** @inheritDoc */ - updatePriority(newPriorityNode) { - if (this.children_.isEmpty()) { - // Don't allow priorities on empty nodes - return this; - } - else { - return new ChildrenNode(this.children_, newPriorityNode, this.indexMap_); - } - } - /** @inheritDoc */ - getImmediateChild(childName) { - // Hack to treat priority as a regular child - if (childName === '.priority') { - return this.getPriority(); - } - else { - const child = this.children_.get(childName); - return child === null ? EMPTY_NODE : child; - } - } - /** @inheritDoc */ - getChild(path) { - const front = pathGetFront(path); - if (front === null) { - return this; - } - return this.getImmediateChild(front).getChild(pathPopFront(path)); - } - /** @inheritDoc */ - hasChild(childName) { - return this.children_.get(childName) !== null; - } - /** @inheritDoc */ - updateImmediateChild(childName, newChildNode) { - assert(newChildNode, 'We should always be passing snapshot nodes'); - if (childName === '.priority') { - return this.updatePriority(newChildNode); - } - else { - const namedNode = new NamedNode(childName, newChildNode); - let newChildren, newIndexMap; - if (newChildNode.isEmpty()) { - newChildren = this.children_.remove(childName); - newIndexMap = this.indexMap_.removeFromIndexes(namedNode, this.children_); - } - else { - newChildren = this.children_.insert(childName, newChildNode); - newIndexMap = this.indexMap_.addToIndexes(namedNode, this.children_); - } - const newPriority = newChildren.isEmpty() - ? EMPTY_NODE - : this.priorityNode_; - return new ChildrenNode(newChildren, newPriority, newIndexMap); - } - } - /** @inheritDoc */ - updateChild(path, newChildNode) { - const front = pathGetFront(path); - if (front === null) { - return newChildNode; - } - else { - assert(pathGetFront(path) !== '.priority' || pathGetLength(path) === 1, '.priority must be the last token in a path'); - const newImmediateChild = this.getImmediateChild(front).updateChild(pathPopFront(path), newChildNode); - return this.updateImmediateChild(front, newImmediateChild); - } - } - /** @inheritDoc */ - isEmpty() { - return this.children_.isEmpty(); - } - /** @inheritDoc */ - numChildren() { - return this.children_.count(); - } - /** @inheritDoc */ - val(exportFormat) { - if (this.isEmpty()) { - return null; - } - const obj = {}; - let numKeys = 0, maxKey = 0, allIntegerKeys = true; - this.forEachChild(PRIORITY_INDEX, (key, childNode) => { - obj[key] = childNode.val(exportFormat); - numKeys++; - if (allIntegerKeys && ChildrenNode.INTEGER_REGEXP_.test(key)) { - maxKey = Math.max(maxKey, Number(key)); - } - else { - allIntegerKeys = false; - } - }); - if (!exportFormat && allIntegerKeys && maxKey < 2 * numKeys) { - // convert to array. - const array = []; - // eslint-disable-next-line guard-for-in - for (const key in obj) { - array[key] = obj[key]; - } - return array; - } - else { - if (exportFormat && !this.getPriority().isEmpty()) { - obj['.priority'] = this.getPriority().val(); - } - return obj; - } - } - /** @inheritDoc */ - hash() { - if (this.lazyHash_ === null) { - let toHash = ''; - if (!this.getPriority().isEmpty()) { - toHash += - 'priority:' + - priorityHashText(this.getPriority().val()) + - ':'; - } - this.forEachChild(PRIORITY_INDEX, (key, childNode) => { - const childHash = childNode.hash(); - if (childHash !== '') { - toHash += ':' + key + ':' + childHash; - } - }); - this.lazyHash_ = toHash === '' ? '' : sha1(toHash); - } - return this.lazyHash_; - } - /** @inheritDoc */ - getPredecessorChildName(childName, childNode, index) { - const idx = this.resolveIndex_(index); - if (idx) { - const predecessor = idx.getPredecessorKey(new NamedNode(childName, childNode)); - return predecessor ? predecessor.name : null; - } - else { - return this.children_.getPredecessorKey(childName); - } - } - getFirstChildName(indexDefinition) { - const idx = this.resolveIndex_(indexDefinition); - if (idx) { - const minKey = idx.minKey(); - return minKey && minKey.name; - } - else { - return this.children_.minKey(); - } - } - getFirstChild(indexDefinition) { - const minKey = this.getFirstChildName(indexDefinition); - if (minKey) { - return new NamedNode(minKey, this.children_.get(minKey)); - } - else { - return null; - } - } - /** - * Given an index, return the key name of the largest value we have, according to that index - */ - getLastChildName(indexDefinition) { - const idx = this.resolveIndex_(indexDefinition); - if (idx) { - const maxKey = idx.maxKey(); - return maxKey && maxKey.name; - } - else { - return this.children_.maxKey(); - } - } - getLastChild(indexDefinition) { - const maxKey = this.getLastChildName(indexDefinition); - if (maxKey) { - return new NamedNode(maxKey, this.children_.get(maxKey)); - } - else { - return null; - } - } - forEachChild(index, action) { - const idx = this.resolveIndex_(index); - if (idx) { - return idx.inorderTraversal(wrappedNode => { - return action(wrappedNode.name, wrappedNode.node); - }); - } - else { - return this.children_.inorderTraversal(action); - } - } - getIterator(indexDefinition) { - return this.getIteratorFrom(indexDefinition.minPost(), indexDefinition); - } - getIteratorFrom(startPost, indexDefinition) { - const idx = this.resolveIndex_(indexDefinition); - if (idx) { - return idx.getIteratorFrom(startPost, key => key); - } - else { - const iterator = this.children_.getIteratorFrom(startPost.name, NamedNode.Wrap); - let next = iterator.peek(); - while (next != null && indexDefinition.compare(next, startPost) < 0) { - iterator.getNext(); - next = iterator.peek(); - } - return iterator; - } - } - getReverseIterator(indexDefinition) { - return this.getReverseIteratorFrom(indexDefinition.maxPost(), indexDefinition); - } - getReverseIteratorFrom(endPost, indexDefinition) { - const idx = this.resolveIndex_(indexDefinition); - if (idx) { - return idx.getReverseIteratorFrom(endPost, key => { - return key; - }); - } - else { - const iterator = this.children_.getReverseIteratorFrom(endPost.name, NamedNode.Wrap); - let next = iterator.peek(); - while (next != null && indexDefinition.compare(next, endPost) > 0) { - iterator.getNext(); - next = iterator.peek(); - } - return iterator; - } - } - compareTo(other) { - if (this.isEmpty()) { - if (other.isEmpty()) { - return 0; - } - else { - return -1; - } - } - else if (other.isLeafNode() || other.isEmpty()) { - return 1; - } - else if (other === MAX_NODE) { - return -1; - } - else { - // Must be another node with children. - return 0; - } - } - withIndex(indexDefinition) { - if (indexDefinition === KEY_INDEX || - this.indexMap_.hasIndex(indexDefinition)) { - return this; - } - else { - const newIndexMap = this.indexMap_.addIndex(indexDefinition, this.children_); - return new ChildrenNode(this.children_, this.priorityNode_, newIndexMap); - } - } - isIndexed(index) { - return index === KEY_INDEX || this.indexMap_.hasIndex(index); - } - equals(other) { - if (other === this) { - return true; - } - else if (other.isLeafNode()) { - return false; - } - else { - const otherChildrenNode = other; - if (!this.getPriority().equals(otherChildrenNode.getPriority())) { - return false; - } - else if (this.children_.count() === otherChildrenNode.children_.count()) { - const thisIter = this.getIterator(PRIORITY_INDEX); - const otherIter = otherChildrenNode.getIterator(PRIORITY_INDEX); - let thisCurrent = thisIter.getNext(); - let otherCurrent = otherIter.getNext(); - while (thisCurrent && otherCurrent) { - if (thisCurrent.name !== otherCurrent.name || - !thisCurrent.node.equals(otherCurrent.node)) { - return false; - } - thisCurrent = thisIter.getNext(); - otherCurrent = otherIter.getNext(); - } - return thisCurrent === null && otherCurrent === null; - } - else { - return false; - } - } - } - /** - * Returns a SortedMap ordered by index, or null if the default (by-key) ordering can be used - * instead. - * - */ - resolveIndex_(indexDefinition) { - if (indexDefinition === KEY_INDEX) { - return null; - } - else { - return this.indexMap_.get(indexDefinition.toString()); - } - } -} -ChildrenNode.INTEGER_REGEXP_ = /^(0|[1-9]\d*)$/; -class MaxNode extends ChildrenNode { - constructor() { - super(new SortedMap(NAME_COMPARATOR), ChildrenNode.EMPTY_NODE, IndexMap.Default); - } - compareTo(other) { - if (other === this) { - return 0; - } - else { - return 1; - } - } - equals(other) { - // Not that we every compare it, but MAX_NODE is only ever equal to itself - return other === this; - } - getPriority() { - return this; - } - getImmediateChild(childName) { - return ChildrenNode.EMPTY_NODE; - } - isEmpty() { - return false; - } -} -/** - * Marker that will sort higher than any other snapshot. - */ -const MAX_NODE = new MaxNode(); -Object.defineProperties(NamedNode, { - MIN: { - value: new NamedNode(MIN_NAME, ChildrenNode.EMPTY_NODE) - }, - MAX: { - value: new NamedNode(MAX_NAME, MAX_NODE) - } -}); -/** - * Reference Extensions - */ -KeyIndex.__EMPTY_NODE = ChildrenNode.EMPTY_NODE; -LeafNode.__childrenNodeConstructor = ChildrenNode; -setMaxNode$1(MAX_NODE); -setMaxNode(MAX_NODE); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -const USE_HINZE = true; -/** - * Constructs a snapshot node representing the passed JSON and returns it. - * @param json - JSON to create a node for. - * @param priority - Optional priority to use. This will be ignored if the - * passed JSON contains a .priority property. - */ -function nodeFromJSON(json, priority = null) { - if (json === null) { - return ChildrenNode.EMPTY_NODE; - } - if (typeof json === 'object' && '.priority' in json) { - priority = json['.priority']; - } - assert(priority === null || - typeof priority === 'string' || - typeof priority === 'number' || - (typeof priority === 'object' && '.sv' in priority), 'Invalid priority type found: ' + typeof priority); - if (typeof json === 'object' && '.value' in json && json['.value'] !== null) { - json = json['.value']; - } - // Valid leaf nodes include non-objects or server-value wrapper objects - if (typeof json !== 'object' || '.sv' in json) { - const jsonLeaf = json; - return new LeafNode(jsonLeaf, nodeFromJSON(priority)); - } - if (!(json instanceof Array) && USE_HINZE) { - const children = []; - let childrenHavePriority = false; - const hinzeJsonObj = json; - each(hinzeJsonObj, (key, child) => { - if (key.substring(0, 1) !== '.') { - // Ignore metadata nodes - const childNode = nodeFromJSON(child); - if (!childNode.isEmpty()) { - childrenHavePriority = - childrenHavePriority || !childNode.getPriority().isEmpty(); - children.push(new NamedNode(key, childNode)); - } - } - }); - if (children.length === 0) { - return ChildrenNode.EMPTY_NODE; - } - const childSet = buildChildSet(children, NAME_ONLY_COMPARATOR, namedNode => namedNode.name, NAME_COMPARATOR); - if (childrenHavePriority) { - const sortedChildSet = buildChildSet(children, PRIORITY_INDEX.getCompare()); - return new ChildrenNode(childSet, nodeFromJSON(priority), new IndexMap({ '.priority': sortedChildSet }, { '.priority': PRIORITY_INDEX })); - } - else { - return new ChildrenNode(childSet, nodeFromJSON(priority), IndexMap.Default); - } - } - else { - let node = ChildrenNode.EMPTY_NODE; - each(json, (key, childData) => { - if (contains(json, key)) { - if (key.substring(0, 1) !== '.') { - // ignore metadata nodes. - const childNode = nodeFromJSON(childData); - if (childNode.isLeafNode() || !childNode.isEmpty()) { - node = node.updateImmediateChild(key, childNode); - } - } - } - }); - return node.updatePriority(nodeFromJSON(priority)); - } -} -setNodeFromJSON(nodeFromJSON); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -class PathIndex extends Index { - constructor(indexPath_) { - super(); - this.indexPath_ = indexPath_; - assert(!pathIsEmpty(indexPath_) && pathGetFront(indexPath_) !== '.priority', "Can't create PathIndex with empty path or .priority key"); - } - extractChild(snap) { - return snap.getChild(this.indexPath_); - } - isDefinedOn(node) { - return !node.getChild(this.indexPath_).isEmpty(); - } - compare(a, b) { - const aChild = this.extractChild(a.node); - const bChild = this.extractChild(b.node); - const indexCmp = aChild.compareTo(bChild); - if (indexCmp === 0) { - return nameCompare(a.name, b.name); - } - else { - return indexCmp; - } - } - makePost(indexValue, name) { - const valueNode = nodeFromJSON(indexValue); - const node = ChildrenNode.EMPTY_NODE.updateChild(this.indexPath_, valueNode); - return new NamedNode(name, node); - } - maxPost() { - const node = ChildrenNode.EMPTY_NODE.updateChild(this.indexPath_, MAX_NODE); - return new NamedNode(MAX_NAME, node); - } - toString() { - return pathSlice(this.indexPath_, 0).join('/'); - } -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -class ValueIndex extends Index { - compare(a, b) { - const indexCmp = a.node.compareTo(b.node); - if (indexCmp === 0) { - return nameCompare(a.name, b.name); - } - else { - return indexCmp; - } - } - isDefinedOn(node) { - return true; - } - indexedValueChanged(oldNode, newNode) { - return !oldNode.equals(newNode); - } - minPost() { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - return NamedNode.MIN; - } - maxPost() { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - return NamedNode.MAX; - } - makePost(indexValue, name) { - const valueNode = nodeFromJSON(indexValue); - return new NamedNode(name, valueNode); - } - /** - * @returns String representation for inclusion in a query spec - */ - toString() { - return '.value'; - } -} -const VALUE_INDEX = new ValueIndex(); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Modeled after base64 web-safe chars, but ordered by ASCII. -const PUSH_CHARS = '-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz'; -const MIN_PUSH_CHAR = '-'; -const MAX_PUSH_CHAR = 'z'; -const MAX_KEY_LEN = 786; -/** - * Fancy ID generator that creates 20-character string identifiers with the - * following properties: - * - * 1. They're based on timestamp so that they sort *after* any existing ids. - * 2. They contain 72-bits of random data after the timestamp so that IDs won't - * collide with other clients' IDs. - * 3. They sort *lexicographically* (so the timestamp is converted to characters - * that will sort properly). - * 4. They're monotonically increasing. Even if you generate more than one in - * the same timestamp, the latter ones will sort after the former ones. We do - * this by using the previous random bits but "incrementing" them by 1 (only - * in the case of a timestamp collision). - */ -const nextPushId = (function () { - // Timestamp of last push, used to prevent local collisions if you push twice - // in one ms. - let lastPushTime = 0; - // We generate 72-bits of randomness which get turned into 12 characters and - // appended to the timestamp to prevent collisions with other clients. We - // store the last characters we generated because in the event of a collision, - // we'll use those same characters except "incremented" by one. - const lastRandChars = []; - return function (now) { - const duplicateTime = now === lastPushTime; - lastPushTime = now; - let i; - const timeStampChars = new Array(8); - for (i = 7; i >= 0; i--) { - timeStampChars[i] = PUSH_CHARS.charAt(now % 64); - // NOTE: Can't use << here because javascript will convert to int and lose - // the upper bits. - now = Math.floor(now / 64); - } - assert(now === 0, 'Cannot push at time == 0'); - let id = timeStampChars.join(''); - if (!duplicateTime) { - for (i = 0; i < 12; i++) { - lastRandChars[i] = Math.floor(Math.random() * 64); - } - } - else { - // If the timestamp hasn't changed since last push, use the same random - // number, except incremented by 1. - for (i = 11; i >= 0 && lastRandChars[i] === 63; i--) { - lastRandChars[i] = 0; - } - lastRandChars[i]++; - } - for (i = 0; i < 12; i++) { - id += PUSH_CHARS.charAt(lastRandChars[i]); - } - assert(id.length === 20, 'nextPushId: Length should be 20.'); - return id; - }; -})(); -const successor = function (key) { - if (key === '' + INTEGER_32_MAX) { - // See https://firebase.google.com/docs/database/web/lists-of-data#data-order - return MIN_PUSH_CHAR; - } - const keyAsInt = tryParseInt(key); - if (keyAsInt != null) { - return '' + (keyAsInt + 1); - } - const next = new Array(key.length); - for (let i = 0; i < next.length; i++) { - next[i] = key.charAt(i); - } - if (next.length < MAX_KEY_LEN) { - next.push(MIN_PUSH_CHAR); - return next.join(''); - } - let i = next.length - 1; - while (i >= 0 && next[i] === MAX_PUSH_CHAR) { - i--; - } - // `successor` was called on the largest possible key, so return the - // MAX_NAME, which sorts larger than all keys. - if (i === -1) { - return MAX_NAME; - } - const source = next[i]; - const sourcePlusOne = PUSH_CHARS.charAt(PUSH_CHARS.indexOf(source) + 1); - next[i] = sourcePlusOne; - return next.slice(0, i + 1).join(''); -}; -// `key` is assumed to be non-empty. -const predecessor = function (key) { - if (key === '' + INTEGER_32_MIN) { - return MIN_NAME; - } - const keyAsInt = tryParseInt(key); - if (keyAsInt != null) { - return '' + (keyAsInt - 1); - } - const next = new Array(key.length); - for (let i = 0; i < next.length; i++) { - next[i] = key.charAt(i); - } - // If `key` ends in `MIN_PUSH_CHAR`, the largest key lexicographically - // smaller than `key`, is `key[0:key.length - 1]`. The next key smaller - // than that, `predecessor(predecessor(key))`, is - // - // `key[0:key.length - 2] + (key[key.length - 1] - 1) + \ - // { MAX_PUSH_CHAR repeated MAX_KEY_LEN - (key.length - 1) times } - // - // analogous to increment/decrement for base-10 integers. - // - // This works because lexigographic comparison works character-by-character, - // using length as a tie-breaker if one key is a prefix of the other. - if (next[next.length - 1] === MIN_PUSH_CHAR) { - if (next.length === 1) { - // See https://firebase.google.com/docs/database/web/lists-of-data#orderbykey - return '' + INTEGER_32_MAX; - } - delete next[next.length - 1]; - return next.join(''); - } - // Replace the last character with it's immediate predecessor, and - // fill the suffix of the key with MAX_PUSH_CHAR. This is the - // lexicographically largest possible key smaller than `key`. - next[next.length - 1] = PUSH_CHARS.charAt(PUSH_CHARS.indexOf(next[next.length - 1]) - 1); - return next.join('') + MAX_PUSH_CHAR.repeat(MAX_KEY_LEN - next.length); -}; - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -function changeValue(snapshotNode) { - return { type: "value" /* VALUE */, snapshotNode }; -} -function changeChildAdded(childName, snapshotNode) { - return { type: "child_added" /* CHILD_ADDED */, snapshotNode, childName }; -} -function changeChildRemoved(childName, snapshotNode) { - return { type: "child_removed" /* CHILD_REMOVED */, snapshotNode, childName }; -} -function changeChildChanged(childName, snapshotNode, oldSnap) { - return { - type: "child_changed" /* CHILD_CHANGED */, - snapshotNode, - childName, - oldSnap - }; -} -function changeChildMoved(childName, snapshotNode) { - return { type: "child_moved" /* CHILD_MOVED */, snapshotNode, childName }; -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Doesn't really filter nodes but applies an index to the node and keeps track of any changes - */ -class IndexedFilter { - constructor(index_) { - this.index_ = index_; - } - updateChild(snap, key, newChild, affectedPath, source, optChangeAccumulator) { - assert(snap.isIndexed(this.index_), 'A node must be indexed if only a child is updated'); - const oldChild = snap.getImmediateChild(key); - // Check if anything actually changed. - if (oldChild.getChild(affectedPath).equals(newChild.getChild(affectedPath))) { - // There's an edge case where a child can enter or leave the view because affectedPath was set to null. - // In this case, affectedPath will appear null in both the old and new snapshots. So we need - // to avoid treating these cases as "nothing changed." - if (oldChild.isEmpty() === newChild.isEmpty()) { - // Nothing changed. - // This assert should be valid, but it's expensive (can dominate perf testing) so don't actually do it. - //assert(oldChild.equals(newChild), 'Old and new snapshots should be equal.'); - return snap; - } - } - if (optChangeAccumulator != null) { - if (newChild.isEmpty()) { - if (snap.hasChild(key)) { - optChangeAccumulator.trackChildChange(changeChildRemoved(key, oldChild)); - } - else { - assert(snap.isLeafNode(), 'A child remove without an old child only makes sense on a leaf node'); - } - } - else if (oldChild.isEmpty()) { - optChangeAccumulator.trackChildChange(changeChildAdded(key, newChild)); - } - else { - optChangeAccumulator.trackChildChange(changeChildChanged(key, newChild, oldChild)); - } - } - if (snap.isLeafNode() && newChild.isEmpty()) { - return snap; - } - else { - // Make sure the node is indexed - return snap.updateImmediateChild(key, newChild).withIndex(this.index_); - } - } - updateFullNode(oldSnap, newSnap, optChangeAccumulator) { - if (optChangeAccumulator != null) { - if (!oldSnap.isLeafNode()) { - oldSnap.forEachChild(PRIORITY_INDEX, (key, childNode) => { - if (!newSnap.hasChild(key)) { - optChangeAccumulator.trackChildChange(changeChildRemoved(key, childNode)); - } - }); - } - if (!newSnap.isLeafNode()) { - newSnap.forEachChild(PRIORITY_INDEX, (key, childNode) => { - if (oldSnap.hasChild(key)) { - const oldChild = oldSnap.getImmediateChild(key); - if (!oldChild.equals(childNode)) { - optChangeAccumulator.trackChildChange(changeChildChanged(key, childNode, oldChild)); - } - } - else { - optChangeAccumulator.trackChildChange(changeChildAdded(key, childNode)); - } - }); - } - } - return newSnap.withIndex(this.index_); - } - updatePriority(oldSnap, newPriority) { - if (oldSnap.isEmpty()) { - return ChildrenNode.EMPTY_NODE; - } - else { - return oldSnap.updatePriority(newPriority); - } - } - filtersNodes() { - return false; - } - getIndexedFilter() { - return this; - } - getIndex() { - return this.index_; - } -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Filters nodes by range and uses an IndexFilter to track any changes after filtering the node - */ -class RangedFilter { - constructor(params) { - this.indexedFilter_ = new IndexedFilter(params.getIndex()); - this.index_ = params.getIndex(); - this.startPost_ = RangedFilter.getStartPost_(params); - this.endPost_ = RangedFilter.getEndPost_(params); - } - getStartPost() { - return this.startPost_; - } - getEndPost() { - return this.endPost_; - } - matches(node) { - return (this.index_.compare(this.getStartPost(), node) <= 0 && - this.index_.compare(node, this.getEndPost()) <= 0); - } - updateChild(snap, key, newChild, affectedPath, source, optChangeAccumulator) { - if (!this.matches(new NamedNode(key, newChild))) { - newChild = ChildrenNode.EMPTY_NODE; - } - return this.indexedFilter_.updateChild(snap, key, newChild, affectedPath, source, optChangeAccumulator); - } - updateFullNode(oldSnap, newSnap, optChangeAccumulator) { - if (newSnap.isLeafNode()) { - // Make sure we have a children node with the correct index, not a leaf node; - newSnap = ChildrenNode.EMPTY_NODE; - } - let filtered = newSnap.withIndex(this.index_); - // Don't support priorities on queries - filtered = filtered.updatePriority(ChildrenNode.EMPTY_NODE); - const self = this; - newSnap.forEachChild(PRIORITY_INDEX, (key, childNode) => { - if (!self.matches(new NamedNode(key, childNode))) { - filtered = filtered.updateImmediateChild(key, ChildrenNode.EMPTY_NODE); - } - }); - return this.indexedFilter_.updateFullNode(oldSnap, filtered, optChangeAccumulator); - } - updatePriority(oldSnap, newPriority) { - // Don't support priorities on queries - return oldSnap; - } - filtersNodes() { - return true; - } - getIndexedFilter() { - return this.indexedFilter_; - } - getIndex() { - return this.index_; - } - static getStartPost_(params) { - if (params.hasStart()) { - const startName = params.getIndexStartName(); - return params.getIndex().makePost(params.getIndexStartValue(), startName); - } - else { - return params.getIndex().minPost(); - } - } - static getEndPost_(params) { - if (params.hasEnd()) { - const endName = params.getIndexEndName(); - return params.getIndex().makePost(params.getIndexEndValue(), endName); - } - else { - return params.getIndex().maxPost(); - } - } -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Applies a limit and a range to a node and uses RangedFilter to do the heavy lifting where possible - */ -class LimitedFilter { - constructor(params) { - this.rangedFilter_ = new RangedFilter(params); - this.index_ = params.getIndex(); - this.limit_ = params.getLimit(); - this.reverse_ = !params.isViewFromLeft(); - } - updateChild(snap, key, newChild, affectedPath, source, optChangeAccumulator) { - if (!this.rangedFilter_.matches(new NamedNode(key, newChild))) { - newChild = ChildrenNode.EMPTY_NODE; - } - if (snap.getImmediateChild(key).equals(newChild)) { - // No change - return snap; - } - else if (snap.numChildren() < this.limit_) { - return this.rangedFilter_ - .getIndexedFilter() - .updateChild(snap, key, newChild, affectedPath, source, optChangeAccumulator); - } - else { - return this.fullLimitUpdateChild_(snap, key, newChild, source, optChangeAccumulator); - } - } - updateFullNode(oldSnap, newSnap, optChangeAccumulator) { - let filtered; - if (newSnap.isLeafNode() || newSnap.isEmpty()) { - // Make sure we have a children node with the correct index, not a leaf node; - filtered = ChildrenNode.EMPTY_NODE.withIndex(this.index_); - } - else { - if (this.limit_ * 2 < newSnap.numChildren() && - newSnap.isIndexed(this.index_)) { - // Easier to build up a snapshot, since what we're given has more than twice the elements we want - filtered = ChildrenNode.EMPTY_NODE.withIndex(this.index_); - // anchor to the startPost, endPost, or last element as appropriate - let iterator; - if (this.reverse_) { - iterator = newSnap.getReverseIteratorFrom(this.rangedFilter_.getEndPost(), this.index_); - } - else { - iterator = newSnap.getIteratorFrom(this.rangedFilter_.getStartPost(), this.index_); - } - let count = 0; - while (iterator.hasNext() && count < this.limit_) { - const next = iterator.getNext(); - let inRange; - if (this.reverse_) { - inRange = - this.index_.compare(this.rangedFilter_.getStartPost(), next) <= 0; - } - else { - inRange = - this.index_.compare(next, this.rangedFilter_.getEndPost()) <= 0; - } - if (inRange) { - filtered = filtered.updateImmediateChild(next.name, next.node); - count++; - } - else { - // if we have reached the end post, we cannot keep adding elemments - break; - } - } - } - else { - // The snap contains less than twice the limit. Faster to delete from the snap than build up a new one - filtered = newSnap.withIndex(this.index_); - // Don't support priorities on queries - filtered = filtered.updatePriority(ChildrenNode.EMPTY_NODE); - let startPost; - let endPost; - let cmp; - let iterator; - if (this.reverse_) { - iterator = filtered.getReverseIterator(this.index_); - startPost = this.rangedFilter_.getEndPost(); - endPost = this.rangedFilter_.getStartPost(); - const indexCompare = this.index_.getCompare(); - cmp = (a, b) => indexCompare(b, a); - } - else { - iterator = filtered.getIterator(this.index_); - startPost = this.rangedFilter_.getStartPost(); - endPost = this.rangedFilter_.getEndPost(); - cmp = this.index_.getCompare(); - } - let count = 0; - let foundStartPost = false; - while (iterator.hasNext()) { - const next = iterator.getNext(); - if (!foundStartPost && cmp(startPost, next) <= 0) { - // start adding - foundStartPost = true; - } - const inRange = foundStartPost && count < this.limit_ && cmp(next, endPost) <= 0; - if (inRange) { - count++; - } - else { - filtered = filtered.updateImmediateChild(next.name, ChildrenNode.EMPTY_NODE); - } - } - } - } - return this.rangedFilter_ - .getIndexedFilter() - .updateFullNode(oldSnap, filtered, optChangeAccumulator); - } - updatePriority(oldSnap, newPriority) { - // Don't support priorities on queries - return oldSnap; - } - filtersNodes() { - return true; - } - getIndexedFilter() { - return this.rangedFilter_.getIndexedFilter(); - } - getIndex() { - return this.index_; - } - fullLimitUpdateChild_(snap, childKey, childSnap, source, changeAccumulator) { - // TODO: rename all cache stuff etc to general snap terminology - let cmp; - if (this.reverse_) { - const indexCmp = this.index_.getCompare(); - cmp = (a, b) => indexCmp(b, a); - } - else { - cmp = this.index_.getCompare(); - } - const oldEventCache = snap; - assert(oldEventCache.numChildren() === this.limit_, ''); - const newChildNamedNode = new NamedNode(childKey, childSnap); - const windowBoundary = this.reverse_ - ? oldEventCache.getFirstChild(this.index_) - : oldEventCache.getLastChild(this.index_); - const inRange = this.rangedFilter_.matches(newChildNamedNode); - if (oldEventCache.hasChild(childKey)) { - const oldChildSnap = oldEventCache.getImmediateChild(childKey); - let nextChild = source.getChildAfterChild(this.index_, windowBoundary, this.reverse_); - while (nextChild != null && - (nextChild.name === childKey || oldEventCache.hasChild(nextChild.name))) { - // There is a weird edge case where a node is updated as part of a merge in the write tree, but hasn't - // been applied to the limited filter yet. Ignore this next child which will be updated later in - // the limited filter... - nextChild = source.getChildAfterChild(this.index_, nextChild, this.reverse_); - } - const compareNext = nextChild == null ? 1 : cmp(nextChild, newChildNamedNode); - const remainsInWindow = inRange && !childSnap.isEmpty() && compareNext >= 0; - if (remainsInWindow) { - if (changeAccumulator != null) { - changeAccumulator.trackChildChange(changeChildChanged(childKey, childSnap, oldChildSnap)); - } - return oldEventCache.updateImmediateChild(childKey, childSnap); - } - else { - if (changeAccumulator != null) { - changeAccumulator.trackChildChange(changeChildRemoved(childKey, oldChildSnap)); - } - const newEventCache = oldEventCache.updateImmediateChild(childKey, ChildrenNode.EMPTY_NODE); - const nextChildInRange = nextChild != null && this.rangedFilter_.matches(nextChild); - if (nextChildInRange) { - if (changeAccumulator != null) { - changeAccumulator.trackChildChange(changeChildAdded(nextChild.name, nextChild.node)); - } - return newEventCache.updateImmediateChild(nextChild.name, nextChild.node); - } - else { - return newEventCache; - } - } - } - else if (childSnap.isEmpty()) { - // we're deleting a node, but it was not in the window, so ignore it - return snap; - } - else if (inRange) { - if (cmp(windowBoundary, newChildNamedNode) >= 0) { - if (changeAccumulator != null) { - changeAccumulator.trackChildChange(changeChildRemoved(windowBoundary.name, windowBoundary.node)); - changeAccumulator.trackChildChange(changeChildAdded(childKey, childSnap)); - } - return oldEventCache - .updateImmediateChild(childKey, childSnap) - .updateImmediateChild(windowBoundary.name, ChildrenNode.EMPTY_NODE); - } - else { - return snap; - } - } - else { - return snap; - } - } -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * This class is an immutable-from-the-public-api struct containing a set of query parameters defining a - * range to be returned for a particular location. It is assumed that validation of parameters is done at the - * user-facing API level, so it is not done here. - * - * @internal - */ -class QueryParams { - constructor() { - this.limitSet_ = false; - this.startSet_ = false; - this.startNameSet_ = false; - this.startAfterSet_ = false; - this.endSet_ = false; - this.endNameSet_ = false; - this.endBeforeSet_ = false; - this.limit_ = 0; - this.viewFrom_ = ''; - this.indexStartValue_ = null; - this.indexStartName_ = ''; - this.indexEndValue_ = null; - this.indexEndName_ = ''; - this.index_ = PRIORITY_INDEX; - } - hasStart() { - return this.startSet_; - } - hasStartAfter() { - return this.startAfterSet_; - } - hasEndBefore() { - return this.endBeforeSet_; - } - /** - * @returns True if it would return from left. - */ - isViewFromLeft() { - if (this.viewFrom_ === '') { - // limit(), rather than limitToFirst or limitToLast was called. - // This means that only one of startSet_ and endSet_ is true. Use them - // to calculate which side of the view to anchor to. If neither is set, - // anchor to the end. - return this.startSet_; - } - else { - return this.viewFrom_ === "l" /* VIEW_FROM_LEFT */; - } - } - /** - * Only valid to call if hasStart() returns true - */ - getIndexStartValue() { - assert(this.startSet_, 'Only valid if start has been set'); - return this.indexStartValue_; - } - /** - * Only valid to call if hasStart() returns true. - * Returns the starting key name for the range defined by these query parameters - */ - getIndexStartName() { - assert(this.startSet_, 'Only valid if start has been set'); - if (this.startNameSet_) { - return this.indexStartName_; - } - else { - return MIN_NAME; - } - } - hasEnd() { - return this.endSet_; - } - /** - * Only valid to call if hasEnd() returns true. - */ - getIndexEndValue() { - assert(this.endSet_, 'Only valid if end has been set'); - return this.indexEndValue_; - } - /** - * Only valid to call if hasEnd() returns true. - * Returns the end key name for the range defined by these query parameters - */ - getIndexEndName() { - assert(this.endSet_, 'Only valid if end has been set'); - if (this.endNameSet_) { - return this.indexEndName_; - } - else { - return MAX_NAME; - } - } - hasLimit() { - return this.limitSet_; - } - /** - * @returns True if a limit has been set and it has been explicitly anchored - */ - hasAnchoredLimit() { - return this.limitSet_ && this.viewFrom_ !== ''; - } - /** - * Only valid to call if hasLimit() returns true - */ - getLimit() { - assert(this.limitSet_, 'Only valid if limit has been set'); - return this.limit_; - } - getIndex() { - return this.index_; - } - loadsAllData() { - return !(this.startSet_ || this.endSet_ || this.limitSet_); - } - isDefault() { - return this.loadsAllData() && this.index_ === PRIORITY_INDEX; - } - copy() { - const copy = new QueryParams(); - copy.limitSet_ = this.limitSet_; - copy.limit_ = this.limit_; - copy.startSet_ = this.startSet_; - copy.indexStartValue_ = this.indexStartValue_; - copy.startNameSet_ = this.startNameSet_; - copy.indexStartName_ = this.indexStartName_; - copy.endSet_ = this.endSet_; - copy.indexEndValue_ = this.indexEndValue_; - copy.endNameSet_ = this.endNameSet_; - copy.indexEndName_ = this.indexEndName_; - copy.index_ = this.index_; - copy.viewFrom_ = this.viewFrom_; - return copy; - } -} -function queryParamsGetNodeFilter(queryParams) { - if (queryParams.loadsAllData()) { - return new IndexedFilter(queryParams.getIndex()); - } - else if (queryParams.hasLimit()) { - return new LimitedFilter(queryParams); - } - else { - return new RangedFilter(queryParams); - } -} -function queryParamsLimitToFirst(queryParams, newLimit) { - const newParams = queryParams.copy(); - newParams.limitSet_ = true; - newParams.limit_ = newLimit; - newParams.viewFrom_ = "l" /* VIEW_FROM_LEFT */; - return newParams; -} -function queryParamsLimitToLast(queryParams, newLimit) { - const newParams = queryParams.copy(); - newParams.limitSet_ = true; - newParams.limit_ = newLimit; - newParams.viewFrom_ = "r" /* VIEW_FROM_RIGHT */; - return newParams; -} -function queryParamsStartAt(queryParams, indexValue, key) { - const newParams = queryParams.copy(); - newParams.startSet_ = true; - if (indexValue === undefined) { - indexValue = null; - } - newParams.indexStartValue_ = indexValue; - if (key != null) { - newParams.startNameSet_ = true; - newParams.indexStartName_ = key; - } - else { - newParams.startNameSet_ = false; - newParams.indexStartName_ = ''; - } - return newParams; -} -function queryParamsStartAfter(queryParams, indexValue, key) { - let params; - if (queryParams.index_ === KEY_INDEX) { - if (typeof indexValue === 'string') { - indexValue = successor(indexValue); - } - params = queryParamsStartAt(queryParams, indexValue, key); - } - else { - let childKey; - if (key == null) { - childKey = MAX_NAME; - } - else { - childKey = successor(key); - } - params = queryParamsStartAt(queryParams, indexValue, childKey); - } - params.startAfterSet_ = true; - return params; -} -function queryParamsEndAt(queryParams, indexValue, key) { - const newParams = queryParams.copy(); - newParams.endSet_ = true; - if (indexValue === undefined) { - indexValue = null; - } - newParams.indexEndValue_ = indexValue; - if (key !== undefined) { - newParams.endNameSet_ = true; - newParams.indexEndName_ = key; - } - else { - newParams.endNameSet_ = false; - newParams.indexEndName_ = ''; - } - return newParams; -} -function queryParamsEndBefore(queryParams, indexValue, key) { - let childKey; - let params; - if (queryParams.index_ === KEY_INDEX) { - if (typeof indexValue === 'string') { - indexValue = predecessor(indexValue); - } - params = queryParamsEndAt(queryParams, indexValue, key); - } - else { - if (key == null) { - childKey = MIN_NAME; - } - else { - childKey = predecessor(key); - } - params = queryParamsEndAt(queryParams, indexValue, childKey); - } - params.endBeforeSet_ = true; - return params; -} -function queryParamsOrderBy(queryParams, index) { - const newParams = queryParams.copy(); - newParams.index_ = index; - return newParams; -} -/** - * Returns a set of REST query string parameters representing this query. - * - * @returns query string parameters - */ -function queryParamsToRestQueryStringParameters(queryParams) { - const qs = {}; - if (queryParams.isDefault()) { - return qs; - } - let orderBy; - if (queryParams.index_ === PRIORITY_INDEX) { - orderBy = "$priority" /* PRIORITY_INDEX */; - } - else if (queryParams.index_ === VALUE_INDEX) { - orderBy = "$value" /* VALUE_INDEX */; - } - else if (queryParams.index_ === KEY_INDEX) { - orderBy = "$key" /* KEY_INDEX */; - } - else { - assert(queryParams.index_ instanceof PathIndex, 'Unrecognized index type!'); - orderBy = queryParams.index_.toString(); - } - qs["orderBy" /* ORDER_BY */] = stringify(orderBy); - if (queryParams.startSet_) { - qs["startAt" /* START_AT */] = stringify(queryParams.indexStartValue_); - if (queryParams.startNameSet_) { - qs["startAt" /* START_AT */] += - ',' + stringify(queryParams.indexStartName_); - } - } - if (queryParams.endSet_) { - qs["endAt" /* END_AT */] = stringify(queryParams.indexEndValue_); - if (queryParams.endNameSet_) { - qs["endAt" /* END_AT */] += - ',' + stringify(queryParams.indexEndName_); - } - } - if (queryParams.limitSet_) { - if (queryParams.isViewFromLeft()) { - qs["limitToFirst" /* LIMIT_TO_FIRST */] = queryParams.limit_; - } - else { - qs["limitToLast" /* LIMIT_TO_LAST */] = queryParams.limit_; - } - } - return qs; -} -function queryParamsGetQueryObject(queryParams) { - const obj = {}; - if (queryParams.startSet_) { - obj["sp" /* INDEX_START_VALUE */] = - queryParams.indexStartValue_; - if (queryParams.startNameSet_) { - obj["sn" /* INDEX_START_NAME */] = - queryParams.indexStartName_; - } - } - if (queryParams.endSet_) { - obj["ep" /* INDEX_END_VALUE */] = queryParams.indexEndValue_; - if (queryParams.endNameSet_) { - obj["en" /* INDEX_END_NAME */] = queryParams.indexEndName_; - } - } - if (queryParams.limitSet_) { - obj["l" /* LIMIT */] = queryParams.limit_; - let viewFrom = queryParams.viewFrom_; - if (viewFrom === '') { - if (queryParams.isViewFromLeft()) { - viewFrom = "l" /* VIEW_FROM_LEFT */; - } - else { - viewFrom = "r" /* VIEW_FROM_RIGHT */; - } - } - obj["vf" /* VIEW_FROM */] = viewFrom; - } - // For now, priority index is the default, so we only specify if it's some other index - if (queryParams.index_ !== PRIORITY_INDEX) { - obj["i" /* INDEX */] = queryParams.index_.toString(); - } - return obj; -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * An implementation of ServerActions that communicates with the server via REST requests. - * This is mostly useful for compatibility with crawlers, where we don't want to spin up a full - * persistent connection (using WebSockets or long-polling) - */ -class ReadonlyRestClient extends ServerActions { - /** - * @param repoInfo_ - Data about the namespace we are connecting to - * @param onDataUpdate_ - A callback for new data from the server - */ - constructor(repoInfo_, onDataUpdate_, authTokenProvider_, appCheckTokenProvider_) { - super(); - this.repoInfo_ = repoInfo_; - this.onDataUpdate_ = onDataUpdate_; - this.authTokenProvider_ = authTokenProvider_; - this.appCheckTokenProvider_ = appCheckTokenProvider_; - /** @private {function(...[*])} */ - this.log_ = logWrapper('p:rest:'); - /** - * We don't actually need to track listens, except to prevent us calling an onComplete for a listen - * that's been removed. :-/ - */ - this.listens_ = {}; - } - reportStats(stats) { - throw new Error('Method not implemented.'); - } - static getListenId_(query, tag) { - if (tag !== undefined) { - return 'tag$' + tag; - } - else { - assert(query._queryParams.isDefault(), "should have a tag if it's not a default query."); - return query._path.toString(); - } - } - /** @inheritDoc */ - listen(query, currentHashFn, tag, onComplete) { - const pathString = query._path.toString(); - this.log_('Listen called for ' + pathString + ' ' + query._queryIdentifier); - // Mark this listener so we can tell if it's removed. - const listenId = ReadonlyRestClient.getListenId_(query, tag); - const thisListen = {}; - this.listens_[listenId] = thisListen; - const queryStringParameters = queryParamsToRestQueryStringParameters(query._queryParams); - this.restRequest_(pathString + '.json', queryStringParameters, (error, result) => { - let data = result; - if (error === 404) { - data = null; - error = null; - } - if (error === null) { - this.onDataUpdate_(pathString, data, /*isMerge=*/ false, tag); - } - if (safeGet(this.listens_, listenId) === thisListen) { - let status; - if (!error) { - status = 'ok'; - } - else if (error === 401) { - status = 'permission_denied'; - } - else { - status = 'rest_error:' + error; - } - onComplete(status, null); - } - }); - } - /** @inheritDoc */ - unlisten(query, tag) { - const listenId = ReadonlyRestClient.getListenId_(query, tag); - delete this.listens_[listenId]; - } - get(query) { - const queryStringParameters = queryParamsToRestQueryStringParameters(query._queryParams); - const pathString = query._path.toString(); - const deferred = new Deferred(); - this.restRequest_(pathString + '.json', queryStringParameters, (error, result) => { - let data = result; - if (error === 404) { - data = null; - error = null; - } - if (error === null) { - this.onDataUpdate_(pathString, data, - /*isMerge=*/ false, - /*tag=*/ null); - deferred.resolve(data); - } - else { - deferred.reject(new Error(data)); - } - }); - return deferred.promise; - } - /** @inheritDoc */ - refreshAuthToken(token) { - // no-op since we just always call getToken. - } - /** - * Performs a REST request to the given path, with the provided query string parameters, - * and any auth credentials we have. - */ - restRequest_(pathString, queryStringParameters = {}, callback) { - queryStringParameters['format'] = 'export'; - return Promise.all([ - this.authTokenProvider_.getToken(/*forceRefresh=*/ false), - this.appCheckTokenProvider_.getToken(/*forceRefresh=*/ false) - ]).then(([authToken, appCheckToken]) => { - if (authToken && authToken.accessToken) { - queryStringParameters['auth'] = authToken.accessToken; - } - if (appCheckToken && appCheckToken.token) { - queryStringParameters['ac'] = appCheckToken.token; - } - const url = (this.repoInfo_.secure ? 'https://' : 'http://') + - this.repoInfo_.host + - pathString + - '?' + - 'ns=' + - this.repoInfo_.namespace + - querystring(queryStringParameters); - this.log_('Sending REST request for ' + url); - const xhr = new XMLHttpRequest(); - xhr.onreadystatechange = () => { - if (callback && xhr.readyState === 4) { - this.log_('REST Response for ' + url + ' received. status:', xhr.status, 'response:', xhr.responseText); - let res = null; - if (xhr.status >= 200 && xhr.status < 300) { - try { - res = jsonEval(xhr.responseText); - } - catch (e) { - warn('Failed to parse JSON response for ' + - url + - ': ' + - xhr.responseText); - } - callback(null, res); - } - else { - // 401 and 404 are expected. - if (xhr.status !== 401 && xhr.status !== 404) { - warn('Got unsuccessful REST response for ' + - url + - ' Status: ' + - xhr.status); - } - callback(xhr.status); - } - callback = null; - } - }; - xhr.open('GET', url, /*asynchronous=*/ true); - xhr.send(); - }); - } -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Mutable object which basically just stores a reference to the "latest" immutable snapshot. - */ -class SnapshotHolder { - constructor() { - this.rootNode_ = ChildrenNode.EMPTY_NODE; - } - getNode(path) { - return this.rootNode_.getChild(path); - } - updateSnapshot(path, newSnapshotNode) { - this.rootNode_ = this.rootNode_.updateChild(path, newSnapshotNode); - } -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -function newSparseSnapshotTree() { - return { - value: null, - children: new Map() - }; -} -/** - * Stores the given node at the specified path. If there is already a node - * at a shallower path, it merges the new data into that snapshot node. - * - * @param path - Path to look up snapshot for. - * @param data - The new data, or null. - */ -function sparseSnapshotTreeRemember(sparseSnapshotTree, path, data) { - if (pathIsEmpty(path)) { - sparseSnapshotTree.value = data; - sparseSnapshotTree.children.clear(); - } - else if (sparseSnapshotTree.value !== null) { - sparseSnapshotTree.value = sparseSnapshotTree.value.updateChild(path, data); - } - else { - const childKey = pathGetFront(path); - if (!sparseSnapshotTree.children.has(childKey)) { - sparseSnapshotTree.children.set(childKey, newSparseSnapshotTree()); - } - const child = sparseSnapshotTree.children.get(childKey); - path = pathPopFront(path); - sparseSnapshotTreeRemember(child, path, data); - } -} -/** - * Purge the data at path from the cache. - * - * @param path - Path to look up snapshot for. - * @returns True if this node should now be removed. - */ -function sparseSnapshotTreeForget(sparseSnapshotTree, path) { - if (pathIsEmpty(path)) { - sparseSnapshotTree.value = null; - sparseSnapshotTree.children.clear(); - return true; - } - else { - if (sparseSnapshotTree.value !== null) { - if (sparseSnapshotTree.value.isLeafNode()) { - // We're trying to forget a node that doesn't exist - return false; - } - else { - const value = sparseSnapshotTree.value; - sparseSnapshotTree.value = null; - value.forEachChild(PRIORITY_INDEX, (key, tree) => { - sparseSnapshotTreeRemember(sparseSnapshotTree, new Path(key), tree); - }); - return sparseSnapshotTreeForget(sparseSnapshotTree, path); - } - } - else if (sparseSnapshotTree.children.size > 0) { - const childKey = pathGetFront(path); - path = pathPopFront(path); - if (sparseSnapshotTree.children.has(childKey)) { - const safeToRemove = sparseSnapshotTreeForget(sparseSnapshotTree.children.get(childKey), path); - if (safeToRemove) { - sparseSnapshotTree.children.delete(childKey); - } - } - return sparseSnapshotTree.children.size === 0; - } - else { - return true; - } - } -} -/** - * Recursively iterates through all of the stored tree and calls the - * callback on each one. - * - * @param prefixPath - Path to look up node for. - * @param func - The function to invoke for each tree. - */ -function sparseSnapshotTreeForEachTree(sparseSnapshotTree, prefixPath, func) { - if (sparseSnapshotTree.value !== null) { - func(prefixPath, sparseSnapshotTree.value); - } - else { - sparseSnapshotTreeForEachChild(sparseSnapshotTree, (key, tree) => { - const path = new Path(prefixPath.toString() + '/' + key); - sparseSnapshotTreeForEachTree(tree, path, func); - }); - } -} -/** - * Iterates through each immediate child and triggers the callback. - * Only seems to be used in tests. - * - * @param func - The function to invoke for each child. - */ -function sparseSnapshotTreeForEachChild(sparseSnapshotTree, func) { - sparseSnapshotTree.children.forEach((tree, key) => { - func(key, tree); - }); -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Returns the delta from the previous call to get stats. - * - * @param collection_ - The collection to "listen" to. - */ -class StatsListener { - constructor(collection_) { - this.collection_ = collection_; - this.last_ = null; - } - get() { - const newStats = this.collection_.get(); - const delta = Object.assign({}, newStats); - if (this.last_) { - each(this.last_, (stat, value) => { - delta[stat] = delta[stat] - value; - }); - } - this.last_ = newStats; - return delta; - } -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Assuming some apps may have a short amount of time on page, and a bulk of firebase operations probably -// happen on page load, we try to report our first set of stats pretty quickly, but we wait at least 10 -// seconds to try to ensure the Firebase connection is established / settled. -const FIRST_STATS_MIN_TIME = 10 * 1000; -const FIRST_STATS_MAX_TIME = 30 * 1000; -// We'll continue to report stats on average every 5 minutes. -const REPORT_STATS_INTERVAL = 5 * 60 * 1000; -class StatsReporter { - constructor(collection, server_) { - this.server_ = server_; - this.statsToReport_ = {}; - this.statsListener_ = new StatsListener(collection); - const timeout = FIRST_STATS_MIN_TIME + - (FIRST_STATS_MAX_TIME - FIRST_STATS_MIN_TIME) * Math.random(); - setTimeoutNonBlocking(this.reportStats_.bind(this), Math.floor(timeout)); - } - reportStats_() { - const stats = this.statsListener_.get(); - const reportedStats = {}; - let haveStatsToReport = false; - each(stats, (stat, value) => { - if (value > 0 && contains(this.statsToReport_, stat)) { - reportedStats[stat] = value; - haveStatsToReport = true; - } - }); - if (haveStatsToReport) { - this.server_.reportStats(reportedStats); - } - // queue our next run. - setTimeoutNonBlocking(this.reportStats_.bind(this), Math.floor(Math.random() * 2 * REPORT_STATS_INTERVAL)); - } -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * - * @enum - */ -var OperationType; -(function (OperationType) { - OperationType[OperationType["OVERWRITE"] = 0] = "OVERWRITE"; - OperationType[OperationType["MERGE"] = 1] = "MERGE"; - OperationType[OperationType["ACK_USER_WRITE"] = 2] = "ACK_USER_WRITE"; - OperationType[OperationType["LISTEN_COMPLETE"] = 3] = "LISTEN_COMPLETE"; -})(OperationType || (OperationType = {})); -function newOperationSourceUser() { - return { - fromUser: true, - fromServer: false, - queryId: null, - tagged: false - }; -} -function newOperationSourceServer() { - return { - fromUser: false, - fromServer: true, - queryId: null, - tagged: false - }; -} -function newOperationSourceServerTaggedQuery(queryId) { - return { - fromUser: false, - fromServer: true, - queryId, - tagged: true - }; -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -class AckUserWrite { - /** - * @param affectedTree - A tree containing true for each affected path. Affected paths can't overlap. - */ - constructor( - /** @inheritDoc */ path, - /** @inheritDoc */ affectedTree, - /** @inheritDoc */ revert) { - this.path = path; - this.affectedTree = affectedTree; - this.revert = revert; - /** @inheritDoc */ - this.type = OperationType.ACK_USER_WRITE; - /** @inheritDoc */ - this.source = newOperationSourceUser(); - } - operationForChild(childName) { - if (!pathIsEmpty(this.path)) { - assert(pathGetFront(this.path) === childName, 'operationForChild called for unrelated child.'); - return new AckUserWrite(pathPopFront(this.path), this.affectedTree, this.revert); - } - else if (this.affectedTree.value != null) { - assert(this.affectedTree.children.isEmpty(), 'affectedTree should not have overlapping affected paths.'); - // All child locations are affected as well; just return same operation. - return this; - } - else { - const childTree = this.affectedTree.subtree(new Path(childName)); - return new AckUserWrite(newEmptyPath(), childTree, this.revert); - } - } -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -class ListenComplete { - constructor(source, path) { - this.source = source; - this.path = path; - /** @inheritDoc */ - this.type = OperationType.LISTEN_COMPLETE; - } - operationForChild(childName) { - if (pathIsEmpty(this.path)) { - return new ListenComplete(this.source, newEmptyPath()); - } - else { - return new ListenComplete(this.source, pathPopFront(this.path)); - } - } -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -class Overwrite { - constructor(source, path, snap) { - this.source = source; - this.path = path; - this.snap = snap; - /** @inheritDoc */ - this.type = OperationType.OVERWRITE; - } - operationForChild(childName) { - if (pathIsEmpty(this.path)) { - return new Overwrite(this.source, newEmptyPath(), this.snap.getImmediateChild(childName)); - } - else { - return new Overwrite(this.source, pathPopFront(this.path), this.snap); - } - } -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -class Merge { - constructor( - /** @inheritDoc */ source, - /** @inheritDoc */ path, - /** @inheritDoc */ children) { - this.source = source; - this.path = path; - this.children = children; - /** @inheritDoc */ - this.type = OperationType.MERGE; - } - operationForChild(childName) { - if (pathIsEmpty(this.path)) { - const childTree = this.children.subtree(new Path(childName)); - if (childTree.isEmpty()) { - // This child is unaffected - return null; - } - else if (childTree.value) { - // We have a snapshot for the child in question. This becomes an overwrite of the child. - return new Overwrite(this.source, newEmptyPath(), childTree.value); - } - else { - // This is a merge at a deeper level - return new Merge(this.source, newEmptyPath(), childTree); - } - } - else { - assert(pathGetFront(this.path) === childName, "Can't get a merge for a child not on the path of the operation"); - return new Merge(this.source, pathPopFront(this.path), this.children); - } - } - toString() { - return ('Operation(' + - this.path + - ': ' + - this.source.toString() + - ' merge: ' + - this.children.toString() + - ')'); - } -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * A cache node only stores complete children. Additionally it holds a flag whether the node can be considered fully - * initialized in the sense that we know at one point in time this represented a valid state of the world, e.g. - * initialized with data from the server, or a complete overwrite by the client. The filtered flag also tracks - * whether a node potentially had children removed due to a filter. - */ -class CacheNode { - constructor(node_, fullyInitialized_, filtered_) { - this.node_ = node_; - this.fullyInitialized_ = fullyInitialized_; - this.filtered_ = filtered_; - } - /** - * Returns whether this node was fully initialized with either server data or a complete overwrite by the client - */ - isFullyInitialized() { - return this.fullyInitialized_; - } - /** - * Returns whether this node is potentially missing children due to a filter applied to the node - */ - isFiltered() { - return this.filtered_; - } - isCompleteForPath(path) { - if (pathIsEmpty(path)) { - return this.isFullyInitialized() && !this.filtered_; - } - const childKey = pathGetFront(path); - return this.isCompleteForChild(childKey); - } - isCompleteForChild(key) { - return ((this.isFullyInitialized() && !this.filtered_) || this.node_.hasChild(key)); - } - getNode() { - return this.node_; - } -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * An EventGenerator is used to convert "raw" changes (Change) as computed by the - * CacheDiffer into actual events (Event) that can be raised. See generateEventsForChanges() - * for details. - * - */ -class EventGenerator { - constructor(query_) { - this.query_ = query_; - this.index_ = this.query_._queryParams.getIndex(); - } -} -/** - * Given a set of raw changes (no moved events and prevName not specified yet), and a set of - * EventRegistrations that should be notified of these changes, generate the actual events to be raised. - * - * Notes: - * - child_moved events will be synthesized at this time for any child_changed events that affect - * our index. - * - prevName will be calculated based on the index ordering. - */ -function eventGeneratorGenerateEventsForChanges(eventGenerator, changes, eventCache, eventRegistrations) { - const events = []; - const moves = []; - changes.forEach(change => { - if (change.type === "child_changed" /* CHILD_CHANGED */ && - eventGenerator.index_.indexedValueChanged(change.oldSnap, change.snapshotNode)) { - moves.push(changeChildMoved(change.childName, change.snapshotNode)); - } - }); - eventGeneratorGenerateEventsForType(eventGenerator, events, "child_removed" /* CHILD_REMOVED */, changes, eventRegistrations, eventCache); - eventGeneratorGenerateEventsForType(eventGenerator, events, "child_added" /* CHILD_ADDED */, changes, eventRegistrations, eventCache); - eventGeneratorGenerateEventsForType(eventGenerator, events, "child_moved" /* CHILD_MOVED */, moves, eventRegistrations, eventCache); - eventGeneratorGenerateEventsForType(eventGenerator, events, "child_changed" /* CHILD_CHANGED */, changes, eventRegistrations, eventCache); - eventGeneratorGenerateEventsForType(eventGenerator, events, "value" /* VALUE */, changes, eventRegistrations, eventCache); - return events; -} -/** - * Given changes of a single change type, generate the corresponding events. - */ -function eventGeneratorGenerateEventsForType(eventGenerator, events, eventType, changes, registrations, eventCache) { - const filteredChanges = changes.filter(change => change.type === eventType); - filteredChanges.sort((a, b) => eventGeneratorCompareChanges(eventGenerator, a, b)); - filteredChanges.forEach(change => { - const materializedChange = eventGeneratorMaterializeSingleChange(eventGenerator, change, eventCache); - registrations.forEach(registration => { - if (registration.respondsTo(change.type)) { - events.push(registration.createEvent(materializedChange, eventGenerator.query_)); - } - }); - }); -} -function eventGeneratorMaterializeSingleChange(eventGenerator, change, eventCache) { - if (change.type === 'value' || change.type === 'child_removed') { - return change; - } - else { - change.prevName = eventCache.getPredecessorChildName(change.childName, change.snapshotNode, eventGenerator.index_); - return change; - } -} -function eventGeneratorCompareChanges(eventGenerator, a, b) { - if (a.childName == null || b.childName == null) { - throw assertionError('Should only compare child_ events.'); - } - const aWrapped = new NamedNode(a.childName, a.snapshotNode); - const bWrapped = new NamedNode(b.childName, b.snapshotNode); - return eventGenerator.index_.compare(aWrapped, bWrapped); -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -function newViewCache(eventCache, serverCache) { - return { eventCache, serverCache }; -} -function viewCacheUpdateEventSnap(viewCache, eventSnap, complete, filtered) { - return newViewCache(new CacheNode(eventSnap, complete, filtered), viewCache.serverCache); -} -function viewCacheUpdateServerSnap(viewCache, serverSnap, complete, filtered) { - return newViewCache(viewCache.eventCache, new CacheNode(serverSnap, complete, filtered)); -} -function viewCacheGetCompleteEventSnap(viewCache) { - return viewCache.eventCache.isFullyInitialized() - ? viewCache.eventCache.getNode() - : null; -} -function viewCacheGetCompleteServerSnap(viewCache) { - return viewCache.serverCache.isFullyInitialized() - ? viewCache.serverCache.getNode() - : null; -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -let emptyChildrenSingleton; -/** - * Singleton empty children collection. - * - */ -const EmptyChildren = () => { - if (!emptyChildrenSingleton) { - emptyChildrenSingleton = new SortedMap(stringCompare); - } - return emptyChildrenSingleton; -}; -/** - * A tree with immutable elements. - */ -class ImmutableTree { - constructor(value, children = EmptyChildren()) { - this.value = value; - this.children = children; - } - static fromObject(obj) { - let tree = new ImmutableTree(null); - each(obj, (childPath, childSnap) => { - tree = tree.set(new Path(childPath), childSnap); - }); - return tree; - } - /** - * True if the value is empty and there are no children - */ - isEmpty() { - return this.value === null && this.children.isEmpty(); - } - /** - * Given a path and predicate, return the first node and the path to that node - * where the predicate returns true. - * - * TODO Do a perf test -- If we're creating a bunch of `{path: value:}` - * objects on the way back out, it may be better to pass down a pathSoFar obj. - * - * @param relativePath - The remainder of the path - * @param predicate - The predicate to satisfy to return a node - */ - findRootMostMatchingPathAndValue(relativePath, predicate) { - if (this.value != null && predicate(this.value)) { - return { path: newEmptyPath(), value: this.value }; - } - else { - if (pathIsEmpty(relativePath)) { - return null; - } - else { - const front = pathGetFront(relativePath); - const child = this.children.get(front); - if (child !== null) { - const childExistingPathAndValue = child.findRootMostMatchingPathAndValue(pathPopFront(relativePath), predicate); - if (childExistingPathAndValue != null) { - const fullPath = pathChild(new Path(front), childExistingPathAndValue.path); - return { path: fullPath, value: childExistingPathAndValue.value }; - } - else { - return null; - } - } - else { - return null; - } - } - } - } - /** - * Find, if it exists, the shortest subpath of the given path that points a defined - * value in the tree - */ - findRootMostValueAndPath(relativePath) { - return this.findRootMostMatchingPathAndValue(relativePath, () => true); - } - /** - * @returns The subtree at the given path - */ - subtree(relativePath) { - if (pathIsEmpty(relativePath)) { - return this; - } - else { - const front = pathGetFront(relativePath); - const childTree = this.children.get(front); - if (childTree !== null) { - return childTree.subtree(pathPopFront(relativePath)); - } - else { - return new ImmutableTree(null); - } - } - } - /** - * Sets a value at the specified path. - * - * @param relativePath - Path to set value at. - * @param toSet - Value to set. - * @returns Resulting tree. - */ - set(relativePath, toSet) { - if (pathIsEmpty(relativePath)) { - return new ImmutableTree(toSet, this.children); - } - else { - const front = pathGetFront(relativePath); - const child = this.children.get(front) || new ImmutableTree(null); - const newChild = child.set(pathPopFront(relativePath), toSet); - const newChildren = this.children.insert(front, newChild); - return new ImmutableTree(this.value, newChildren); - } - } - /** - * Removes the value at the specified path. - * - * @param relativePath - Path to value to remove. - * @returns Resulting tree. - */ - remove(relativePath) { - if (pathIsEmpty(relativePath)) { - if (this.children.isEmpty()) { - return new ImmutableTree(null); - } - else { - return new ImmutableTree(null, this.children); - } - } - else { - const front = pathGetFront(relativePath); - const child = this.children.get(front); - if (child) { - const newChild = child.remove(pathPopFront(relativePath)); - let newChildren; - if (newChild.isEmpty()) { - newChildren = this.children.remove(front); - } - else { - newChildren = this.children.insert(front, newChild); - } - if (this.value === null && newChildren.isEmpty()) { - return new ImmutableTree(null); - } - else { - return new ImmutableTree(this.value, newChildren); - } - } - else { - return this; - } - } - } - /** - * Gets a value from the tree. - * - * @param relativePath - Path to get value for. - * @returns Value at path, or null. - */ - get(relativePath) { - if (pathIsEmpty(relativePath)) { - return this.value; - } - else { - const front = pathGetFront(relativePath); - const child = this.children.get(front); - if (child) { - return child.get(pathPopFront(relativePath)); - } - else { - return null; - } - } - } - /** - * Replace the subtree at the specified path with the given new tree. - * - * @param relativePath - Path to replace subtree for. - * @param newTree - New tree. - * @returns Resulting tree. - */ - setTree(relativePath, newTree) { - if (pathIsEmpty(relativePath)) { - return newTree; - } - else { - const front = pathGetFront(relativePath); - const child = this.children.get(front) || new ImmutableTree(null); - const newChild = child.setTree(pathPopFront(relativePath), newTree); - let newChildren; - if (newChild.isEmpty()) { - newChildren = this.children.remove(front); - } - else { - newChildren = this.children.insert(front, newChild); - } - return new ImmutableTree(this.value, newChildren); - } - } - /** - * Performs a depth first fold on this tree. Transforms a tree into a single - * value, given a function that operates on the path to a node, an optional - * current value, and a map of child names to folded subtrees - */ - fold(fn) { - return this.fold_(newEmptyPath(), fn); - } - /** - * Recursive helper for public-facing fold() method - */ - fold_(pathSoFar, fn) { - const accum = {}; - this.children.inorderTraversal((childKey, childTree) => { - accum[childKey] = childTree.fold_(pathChild(pathSoFar, childKey), fn); - }); - return fn(pathSoFar, this.value, accum); - } - /** - * Find the first matching value on the given path. Return the result of applying f to it. - */ - findOnPath(path, f) { - return this.findOnPath_(path, newEmptyPath(), f); - } - findOnPath_(pathToFollow, pathSoFar, f) { - const result = this.value ? f(pathSoFar, this.value) : false; - if (result) { - return result; - } - else { - if (pathIsEmpty(pathToFollow)) { - return null; - } - else { - const front = pathGetFront(pathToFollow); - const nextChild = this.children.get(front); - if (nextChild) { - return nextChild.findOnPath_(pathPopFront(pathToFollow), pathChild(pathSoFar, front), f); - } - else { - return null; - } - } - } - } - foreachOnPath(path, f) { - return this.foreachOnPath_(path, newEmptyPath(), f); - } - foreachOnPath_(pathToFollow, currentRelativePath, f) { - if (pathIsEmpty(pathToFollow)) { - return this; - } - else { - if (this.value) { - f(currentRelativePath, this.value); - } - const front = pathGetFront(pathToFollow); - const nextChild = this.children.get(front); - if (nextChild) { - return nextChild.foreachOnPath_(pathPopFront(pathToFollow), pathChild(currentRelativePath, front), f); - } - else { - return new ImmutableTree(null); - } - } - } - /** - * Calls the given function for each node in the tree that has a value. - * - * @param f - A function to be called with the path from the root of the tree to - * a node, and the value at that node. Called in depth-first order. - */ - foreach(f) { - this.foreach_(newEmptyPath(), f); - } - foreach_(currentRelativePath, f) { - this.children.inorderTraversal((childName, childTree) => { - childTree.foreach_(pathChild(currentRelativePath, childName), f); - }); - if (this.value) { - f(currentRelativePath, this.value); - } - } - foreachChild(f) { - this.children.inorderTraversal((childName, childTree) => { - if (childTree.value) { - f(childName, childTree.value); - } - }); - } -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * This class holds a collection of writes that can be applied to nodes in unison. It abstracts away the logic with - * dealing with priority writes and multiple nested writes. At any given path there is only allowed to be one write - * modifying that path. Any write to an existing path or shadowing an existing path will modify that existing write - * to reflect the write added. - */ -class CompoundWrite { - constructor(writeTree_) { - this.writeTree_ = writeTree_; - } - static empty() { - return new CompoundWrite(new ImmutableTree(null)); - } -} -function compoundWriteAddWrite(compoundWrite, path, node) { - if (pathIsEmpty(path)) { - return new CompoundWrite(new ImmutableTree(node)); - } - else { - const rootmost = compoundWrite.writeTree_.findRootMostValueAndPath(path); - if (rootmost != null) { - const rootMostPath = rootmost.path; - let value = rootmost.value; - const relativePath = newRelativePath(rootMostPath, path); - value = value.updateChild(relativePath, node); - return new CompoundWrite(compoundWrite.writeTree_.set(rootMostPath, value)); - } - else { - const subtree = new ImmutableTree(node); - const newWriteTree = compoundWrite.writeTree_.setTree(path, subtree); - return new CompoundWrite(newWriteTree); - } - } -} -function compoundWriteAddWrites(compoundWrite, path, updates) { - let newWrite = compoundWrite; - each(updates, (childKey, node) => { - newWrite = compoundWriteAddWrite(newWrite, pathChild(path, childKey), node); - }); - return newWrite; -} -/** - * Will remove a write at the given path and deeper paths. This will not modify a write at a higher - * location, which must be removed by calling this method with that path. - * - * @param compoundWrite - The CompoundWrite to remove. - * @param path - The path at which a write and all deeper writes should be removed - * @returns The new CompoundWrite with the removed path - */ -function compoundWriteRemoveWrite(compoundWrite, path) { - if (pathIsEmpty(path)) { - return CompoundWrite.empty(); - } - else { - const newWriteTree = compoundWrite.writeTree_.setTree(path, new ImmutableTree(null)); - return new CompoundWrite(newWriteTree); - } -} -/** - * Returns whether this CompoundWrite will fully overwrite a node at a given location and can therefore be - * considered "complete". - * - * @param compoundWrite - The CompoundWrite to check. - * @param path - The path to check for - * @returns Whether there is a complete write at that path - */ -function compoundWriteHasCompleteWrite(compoundWrite, path) { - return compoundWriteGetCompleteNode(compoundWrite, path) != null; -} -/** - * Returns a node for a path if and only if the node is a "complete" overwrite at that path. This will not aggregate - * writes from deeper paths, but will return child nodes from a more shallow path. - * - * @param compoundWrite - The CompoundWrite to get the node from. - * @param path - The path to get a complete write - * @returns The node if complete at that path, or null otherwise. - */ -function compoundWriteGetCompleteNode(compoundWrite, path) { - const rootmost = compoundWrite.writeTree_.findRootMostValueAndPath(path); - if (rootmost != null) { - return compoundWrite.writeTree_ - .get(rootmost.path) - .getChild(newRelativePath(rootmost.path, path)); - } - else { - return null; - } -} -/** - * Returns all children that are guaranteed to be a complete overwrite. - * - * @param compoundWrite - The CompoundWrite to get children from. - * @returns A list of all complete children. - */ -function compoundWriteGetCompleteChildren(compoundWrite) { - const children = []; - const node = compoundWrite.writeTree_.value; - if (node != null) { - // If it's a leaf node, it has no children; so nothing to do. - if (!node.isLeafNode()) { - node.forEachChild(PRIORITY_INDEX, (childName, childNode) => { - children.push(new NamedNode(childName, childNode)); - }); - } - } - else { - compoundWrite.writeTree_.children.inorderTraversal((childName, childTree) => { - if (childTree.value != null) { - children.push(new NamedNode(childName, childTree.value)); - } - }); - } - return children; -} -function compoundWriteChildCompoundWrite(compoundWrite, path) { - if (pathIsEmpty(path)) { - return compoundWrite; - } - else { - const shadowingNode = compoundWriteGetCompleteNode(compoundWrite, path); - if (shadowingNode != null) { - return new CompoundWrite(new ImmutableTree(shadowingNode)); - } - else { - return new CompoundWrite(compoundWrite.writeTree_.subtree(path)); - } - } -} -/** - * Returns true if this CompoundWrite is empty and therefore does not modify any nodes. - * @returns Whether this CompoundWrite is empty - */ -function compoundWriteIsEmpty(compoundWrite) { - return compoundWrite.writeTree_.isEmpty(); -} -/** - * Applies this CompoundWrite to a node. The node is returned with all writes from this CompoundWrite applied to the - * node - * @param node - The node to apply this CompoundWrite to - * @returns The node with all writes applied - */ -function compoundWriteApply(compoundWrite, node) { - return applySubtreeWrite(newEmptyPath(), compoundWrite.writeTree_, node); -} -function applySubtreeWrite(relativePath, writeTree, node) { - if (writeTree.value != null) { - // Since there a write is always a leaf, we're done here - return node.updateChild(relativePath, writeTree.value); - } - else { - let priorityWrite = null; - writeTree.children.inorderTraversal((childKey, childTree) => { - if (childKey === '.priority') { - // Apply priorities at the end so we don't update priorities for either empty nodes or forget - // to apply priorities to empty nodes that are later filled - assert(childTree.value !== null, 'Priority writes must always be leaf nodes'); - priorityWrite = childTree.value; - } - else { - node = applySubtreeWrite(pathChild(relativePath, childKey), childTree, node); - } - }); - // If there was a priority write, we only apply it if the node is not empty - if (!node.getChild(relativePath).isEmpty() && priorityWrite !== null) { - node = node.updateChild(pathChild(relativePath, '.priority'), priorityWrite); - } - return node; - } -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Create a new WriteTreeRef for the given path. For use with a new sync point at the given path. - * - */ -function writeTreeChildWrites(writeTree, path) { - return newWriteTreeRef(path, writeTree); -} -/** - * Record a new overwrite from user code. - * - * @param visible - This is set to false by some transactions. It should be excluded from event caches - */ -function writeTreeAddOverwrite(writeTree, path, snap, writeId, visible) { - assert(writeId > writeTree.lastWriteId, 'Stacking an older write on top of newer ones'); - if (visible === undefined) { - visible = true; - } - writeTree.allWrites.push({ - path, - snap, - writeId, - visible - }); - if (visible) { - writeTree.visibleWrites = compoundWriteAddWrite(writeTree.visibleWrites, path, snap); - } - writeTree.lastWriteId = writeId; -} -/** - * Record a new merge from user code. - */ -function writeTreeAddMerge(writeTree, path, changedChildren, writeId) { - assert(writeId > writeTree.lastWriteId, 'Stacking an older merge on top of newer ones'); - writeTree.allWrites.push({ - path, - children: changedChildren, - writeId, - visible: true - }); - writeTree.visibleWrites = compoundWriteAddWrites(writeTree.visibleWrites, path, changedChildren); - writeTree.lastWriteId = writeId; -} -function writeTreeGetWrite(writeTree, writeId) { - for (let i = 0; i < writeTree.allWrites.length; i++) { - const record = writeTree.allWrites[i]; - if (record.writeId === writeId) { - return record; - } - } - return null; -} -/** - * Remove a write (either an overwrite or merge) that has been successfully acknowledge by the server. Recalculates - * the tree if necessary. We return true if it may have been visible, meaning views need to reevaluate. - * - * @returns true if the write may have been visible (meaning we'll need to reevaluate / raise - * events as a result). - */ -function writeTreeRemoveWrite(writeTree, writeId) { - // Note: disabling this check. It could be a transaction that preempted another transaction, and thus was applied - // out of order. - //const validClear = revert || this.allWrites_.length === 0 || writeId <= this.allWrites_[0].writeId; - //assert(validClear, "Either we don't have this write, or it's the first one in the queue"); - const idx = writeTree.allWrites.findIndex(s => { - return s.writeId === writeId; - }); - assert(idx >= 0, 'removeWrite called with nonexistent writeId.'); - const writeToRemove = writeTree.allWrites[idx]; - writeTree.allWrites.splice(idx, 1); - let removedWriteWasVisible = writeToRemove.visible; - let removedWriteOverlapsWithOtherWrites = false; - let i = writeTree.allWrites.length - 1; - while (removedWriteWasVisible && i >= 0) { - const currentWrite = writeTree.allWrites[i]; - if (currentWrite.visible) { - if (i >= idx && - writeTreeRecordContainsPath_(currentWrite, writeToRemove.path)) { - // The removed write was completely shadowed by a subsequent write. - removedWriteWasVisible = false; - } - else if (pathContains(writeToRemove.path, currentWrite.path)) { - // Either we're covering some writes or they're covering part of us (depending on which came first). - removedWriteOverlapsWithOtherWrites = true; - } - } - i--; - } - if (!removedWriteWasVisible) { - return false; - } - else if (removedWriteOverlapsWithOtherWrites) { - // There's some shadowing going on. Just rebuild the visible writes from scratch. - writeTreeResetTree_(writeTree); - return true; - } - else { - // There's no shadowing. We can safely just remove the write(s) from visibleWrites. - if (writeToRemove.snap) { - writeTree.visibleWrites = compoundWriteRemoveWrite(writeTree.visibleWrites, writeToRemove.path); - } - else { - const children = writeToRemove.children; - each(children, (childName) => { - writeTree.visibleWrites = compoundWriteRemoveWrite(writeTree.visibleWrites, pathChild(writeToRemove.path, childName)); - }); - } - return true; - } -} -function writeTreeRecordContainsPath_(writeRecord, path) { - if (writeRecord.snap) { - return pathContains(writeRecord.path, path); - } - else { - for (const childName in writeRecord.children) { - if (writeRecord.children.hasOwnProperty(childName) && - pathContains(pathChild(writeRecord.path, childName), path)) { - return true; - } - } - return false; - } -} -/** - * Re-layer the writes and merges into a tree so we can efficiently calculate event snapshots - */ -function writeTreeResetTree_(writeTree) { - writeTree.visibleWrites = writeTreeLayerTree_(writeTree.allWrites, writeTreeDefaultFilter_, newEmptyPath()); - if (writeTree.allWrites.length > 0) { - writeTree.lastWriteId = - writeTree.allWrites[writeTree.allWrites.length - 1].writeId; - } - else { - writeTree.lastWriteId = -1; - } -} -/** - * The default filter used when constructing the tree. Keep everything that's visible. - */ -function writeTreeDefaultFilter_(write) { - return write.visible; -} -/** - * Static method. Given an array of WriteRecords, a filter for which ones to include, and a path, construct the tree of - * event data at that path. - */ -function writeTreeLayerTree_(writes, filter, treeRoot) { - let compoundWrite = CompoundWrite.empty(); - for (let i = 0; i < writes.length; ++i) { - const write = writes[i]; - // Theory, a later set will either: - // a) abort a relevant transaction, so no need to worry about excluding it from calculating that transaction - // b) not be relevant to a transaction (separate branch), so again will not affect the data for that transaction - if (filter(write)) { - const writePath = write.path; - let relativePath; - if (write.snap) { - if (pathContains(treeRoot, writePath)) { - relativePath = newRelativePath(treeRoot, writePath); - compoundWrite = compoundWriteAddWrite(compoundWrite, relativePath, write.snap); - } - else if (pathContains(writePath, treeRoot)) { - relativePath = newRelativePath(writePath, treeRoot); - compoundWrite = compoundWriteAddWrite(compoundWrite, newEmptyPath(), write.snap.getChild(relativePath)); - } - else ; - } - else if (write.children) { - if (pathContains(treeRoot, writePath)) { - relativePath = newRelativePath(treeRoot, writePath); - compoundWrite = compoundWriteAddWrites(compoundWrite, relativePath, write.children); - } - else if (pathContains(writePath, treeRoot)) { - relativePath = newRelativePath(writePath, treeRoot); - if (pathIsEmpty(relativePath)) { - compoundWrite = compoundWriteAddWrites(compoundWrite, newEmptyPath(), write.children); - } - else { - const child = safeGet(write.children, pathGetFront(relativePath)); - if (child) { - // There exists a child in this node that matches the root path - const deepNode = child.getChild(pathPopFront(relativePath)); - compoundWrite = compoundWriteAddWrite(compoundWrite, newEmptyPath(), deepNode); - } - } - } - else ; - } - else { - throw assertionError('WriteRecord should have .snap or .children'); - } - } - } - return compoundWrite; -} -/** - * Given optional, underlying server data, and an optional set of constraints (exclude some sets, include hidden - * writes), attempt to calculate a complete snapshot for the given path - * - * @param writeIdsToExclude - An optional set to be excluded - * @param includeHiddenWrites - Defaults to false, whether or not to layer on writes with visible set to false - */ -function writeTreeCalcCompleteEventCache(writeTree, treePath, completeServerCache, writeIdsToExclude, includeHiddenWrites) { - if (!writeIdsToExclude && !includeHiddenWrites) { - const shadowingNode = compoundWriteGetCompleteNode(writeTree.visibleWrites, treePath); - if (shadowingNode != null) { - return shadowingNode; - } - else { - const subMerge = compoundWriteChildCompoundWrite(writeTree.visibleWrites, treePath); - if (compoundWriteIsEmpty(subMerge)) { - return completeServerCache; - } - else if (completeServerCache == null && - !compoundWriteHasCompleteWrite(subMerge, newEmptyPath())) { - // We wouldn't have a complete snapshot, since there's no underlying data and no complete shadow - return null; - } - else { - const layeredCache = completeServerCache || ChildrenNode.EMPTY_NODE; - return compoundWriteApply(subMerge, layeredCache); - } - } - } - else { - const merge = compoundWriteChildCompoundWrite(writeTree.visibleWrites, treePath); - if (!includeHiddenWrites && compoundWriteIsEmpty(merge)) { - return completeServerCache; - } - else { - // If the server cache is null, and we don't have a complete cache, we need to return null - if (!includeHiddenWrites && - completeServerCache == null && - !compoundWriteHasCompleteWrite(merge, newEmptyPath())) { - return null; - } - else { - const filter = function (write) { - return ((write.visible || includeHiddenWrites) && - (!writeIdsToExclude || - !~writeIdsToExclude.indexOf(write.writeId)) && - (pathContains(write.path, treePath) || - pathContains(treePath, write.path))); - }; - const mergeAtPath = writeTreeLayerTree_(writeTree.allWrites, filter, treePath); - const layeredCache = completeServerCache || ChildrenNode.EMPTY_NODE; - return compoundWriteApply(mergeAtPath, layeredCache); - } - } - } -} -/** - * With optional, underlying server data, attempt to return a children node of children that we have complete data for. - * Used when creating new views, to pre-fill their complete event children snapshot. - */ -function writeTreeCalcCompleteEventChildren(writeTree, treePath, completeServerChildren) { - let completeChildren = ChildrenNode.EMPTY_NODE; - const topLevelSet = compoundWriteGetCompleteNode(writeTree.visibleWrites, treePath); - if (topLevelSet) { - if (!topLevelSet.isLeafNode()) { - // we're shadowing everything. Return the children. - topLevelSet.forEachChild(PRIORITY_INDEX, (childName, childSnap) => { - completeChildren = completeChildren.updateImmediateChild(childName, childSnap); - }); - } - return completeChildren; - } - else if (completeServerChildren) { - // Layer any children we have on top of this - // We know we don't have a top-level set, so just enumerate existing children - const merge = compoundWriteChildCompoundWrite(writeTree.visibleWrites, treePath); - completeServerChildren.forEachChild(PRIORITY_INDEX, (childName, childNode) => { - const node = compoundWriteApply(compoundWriteChildCompoundWrite(merge, new Path(childName)), childNode); - completeChildren = completeChildren.updateImmediateChild(childName, node); - }); - // Add any complete children we have from the set - compoundWriteGetCompleteChildren(merge).forEach(namedNode => { - completeChildren = completeChildren.updateImmediateChild(namedNode.name, namedNode.node); - }); - return completeChildren; - } - else { - // We don't have anything to layer on top of. Layer on any children we have - // Note that we can return an empty snap if we have a defined delete - const merge = compoundWriteChildCompoundWrite(writeTree.visibleWrites, treePath); - compoundWriteGetCompleteChildren(merge).forEach(namedNode => { - completeChildren = completeChildren.updateImmediateChild(namedNode.name, namedNode.node); - }); - return completeChildren; - } -} -/** - * Given that the underlying server data has updated, determine what, if anything, needs to be - * applied to the event cache. - * - * Possibilities: - * - * 1. No writes are shadowing. Events should be raised, the snap to be applied comes from the server data - * - * 2. Some write is completely shadowing. No events to be raised - * - * 3. Is partially shadowed. Events - * - * Either existingEventSnap or existingServerSnap must exist - */ -function writeTreeCalcEventCacheAfterServerOverwrite(writeTree, treePath, childPath, existingEventSnap, existingServerSnap) { - assert(existingEventSnap || existingServerSnap, 'Either existingEventSnap or existingServerSnap must exist'); - const path = pathChild(treePath, childPath); - if (compoundWriteHasCompleteWrite(writeTree.visibleWrites, path)) { - // At this point we can probably guarantee that we're in case 2, meaning no events - // May need to check visibility while doing the findRootMostValueAndPath call - return null; - } - else { - // No complete shadowing. We're either partially shadowing or not shadowing at all. - const childMerge = compoundWriteChildCompoundWrite(writeTree.visibleWrites, path); - if (compoundWriteIsEmpty(childMerge)) { - // We're not shadowing at all. Case 1 - return existingServerSnap.getChild(childPath); - } - else { - // This could be more efficient if the serverNode + updates doesn't change the eventSnap - // However this is tricky to find out, since user updates don't necessary change the server - // snap, e.g. priority updates on empty nodes, or deep deletes. Another special case is if the server - // adds nodes, but doesn't change any existing writes. It is therefore not enough to - // only check if the updates change the serverNode. - // Maybe check if the merge tree contains these special cases and only do a full overwrite in that case? - return compoundWriteApply(childMerge, existingServerSnap.getChild(childPath)); - } - } -} -/** - * Returns a complete child for a given server snap after applying all user writes or null if there is no - * complete child for this ChildKey. - */ -function writeTreeCalcCompleteChild(writeTree, treePath, childKey, existingServerSnap) { - const path = pathChild(treePath, childKey); - const shadowingNode = compoundWriteGetCompleteNode(writeTree.visibleWrites, path); - if (shadowingNode != null) { - return shadowingNode; - } - else { - if (existingServerSnap.isCompleteForChild(childKey)) { - const childMerge = compoundWriteChildCompoundWrite(writeTree.visibleWrites, path); - return compoundWriteApply(childMerge, existingServerSnap.getNode().getImmediateChild(childKey)); - } - else { - return null; - } - } -} -/** - * Returns a node if there is a complete overwrite for this path. More specifically, if there is a write at - * a higher path, this will return the child of that write relative to the write and this path. - * Returns null if there is no write at this path. - */ -function writeTreeShadowingWrite(writeTree, path) { - return compoundWriteGetCompleteNode(writeTree.visibleWrites, path); -} -/** - * This method is used when processing child remove events on a query. If we can, we pull in children that were outside - * the window, but may now be in the window. - */ -function writeTreeCalcIndexedSlice(writeTree, treePath, completeServerData, startPost, count, reverse, index) { - let toIterate; - const merge = compoundWriteChildCompoundWrite(writeTree.visibleWrites, treePath); - const shadowingNode = compoundWriteGetCompleteNode(merge, newEmptyPath()); - if (shadowingNode != null) { - toIterate = shadowingNode; - } - else if (completeServerData != null) { - toIterate = compoundWriteApply(merge, completeServerData); - } - else { - // no children to iterate on - return []; - } - toIterate = toIterate.withIndex(index); - if (!toIterate.isEmpty() && !toIterate.isLeafNode()) { - const nodes = []; - const cmp = index.getCompare(); - const iter = reverse - ? toIterate.getReverseIteratorFrom(startPost, index) - : toIterate.getIteratorFrom(startPost, index); - let next = iter.getNext(); - while (next && nodes.length < count) { - if (cmp(next, startPost) !== 0) { - nodes.push(next); - } - next = iter.getNext(); - } - return nodes; - } - else { - return []; - } -} -function newWriteTree() { - return { - visibleWrites: CompoundWrite.empty(), - allWrites: [], - lastWriteId: -1 - }; -} -/** - * If possible, returns a complete event cache, using the underlying server data if possible. In addition, can be used - * to get a cache that includes hidden writes, and excludes arbitrary writes. Note that customizing the returned node - * can lead to a more expensive calculation. - * - * @param writeIdsToExclude - Optional writes to exclude. - * @param includeHiddenWrites - Defaults to false, whether or not to layer on writes with visible set to false - */ -function writeTreeRefCalcCompleteEventCache(writeTreeRef, completeServerCache, writeIdsToExclude, includeHiddenWrites) { - return writeTreeCalcCompleteEventCache(writeTreeRef.writeTree, writeTreeRef.treePath, completeServerCache, writeIdsToExclude, includeHiddenWrites); -} -/** - * If possible, returns a children node containing all of the complete children we have data for. The returned data is a - * mix of the given server data and write data. - * - */ -function writeTreeRefCalcCompleteEventChildren(writeTreeRef, completeServerChildren) { - return writeTreeCalcCompleteEventChildren(writeTreeRef.writeTree, writeTreeRef.treePath, completeServerChildren); -} -/** - * Given that either the underlying server data has updated or the outstanding writes have updated, determine what, - * if anything, needs to be applied to the event cache. - * - * Possibilities: - * - * 1. No writes are shadowing. Events should be raised, the snap to be applied comes from the server data - * - * 2. Some write is completely shadowing. No events to be raised - * - * 3. Is partially shadowed. Events should be raised - * - * Either existingEventSnap or existingServerSnap must exist, this is validated via an assert - * - * - */ -function writeTreeRefCalcEventCacheAfterServerOverwrite(writeTreeRef, path, existingEventSnap, existingServerSnap) { - return writeTreeCalcEventCacheAfterServerOverwrite(writeTreeRef.writeTree, writeTreeRef.treePath, path, existingEventSnap, existingServerSnap); -} -/** - * Returns a node if there is a complete overwrite for this path. More specifically, if there is a write at - * a higher path, this will return the child of that write relative to the write and this path. - * Returns null if there is no write at this path. - * - */ -function writeTreeRefShadowingWrite(writeTreeRef, path) { - return writeTreeShadowingWrite(writeTreeRef.writeTree, pathChild(writeTreeRef.treePath, path)); -} -/** - * This method is used when processing child remove events on a query. If we can, we pull in children that were outside - * the window, but may now be in the window - */ -function writeTreeRefCalcIndexedSlice(writeTreeRef, completeServerData, startPost, count, reverse, index) { - return writeTreeCalcIndexedSlice(writeTreeRef.writeTree, writeTreeRef.treePath, completeServerData, startPost, count, reverse, index); -} -/** - * Returns a complete child for a given server snap after applying all user writes or null if there is no - * complete child for this ChildKey. - */ -function writeTreeRefCalcCompleteChild(writeTreeRef, childKey, existingServerCache) { - return writeTreeCalcCompleteChild(writeTreeRef.writeTree, writeTreeRef.treePath, childKey, existingServerCache); -} -/** - * Return a WriteTreeRef for a child. - */ -function writeTreeRefChild(writeTreeRef, childName) { - return newWriteTreeRef(pathChild(writeTreeRef.treePath, childName), writeTreeRef.writeTree); -} -function newWriteTreeRef(path, writeTree) { - return { - treePath: path, - writeTree - }; -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -class ChildChangeAccumulator { - constructor() { - this.changeMap = new Map(); - } - trackChildChange(change) { - const type = change.type; - const childKey = change.childName; - assert(type === "child_added" /* CHILD_ADDED */ || - type === "child_changed" /* CHILD_CHANGED */ || - type === "child_removed" /* CHILD_REMOVED */, 'Only child changes supported for tracking'); - assert(childKey !== '.priority', 'Only non-priority child changes can be tracked.'); - const oldChange = this.changeMap.get(childKey); - if (oldChange) { - const oldType = oldChange.type; - if (type === "child_added" /* CHILD_ADDED */ && - oldType === "child_removed" /* CHILD_REMOVED */) { - this.changeMap.set(childKey, changeChildChanged(childKey, change.snapshotNode, oldChange.snapshotNode)); - } - else if (type === "child_removed" /* CHILD_REMOVED */ && - oldType === "child_added" /* CHILD_ADDED */) { - this.changeMap.delete(childKey); - } - else if (type === "child_removed" /* CHILD_REMOVED */ && - oldType === "child_changed" /* CHILD_CHANGED */) { - this.changeMap.set(childKey, changeChildRemoved(childKey, oldChange.oldSnap)); - } - else if (type === "child_changed" /* CHILD_CHANGED */ && - oldType === "child_added" /* CHILD_ADDED */) { - this.changeMap.set(childKey, changeChildAdded(childKey, change.snapshotNode)); - } - else if (type === "child_changed" /* CHILD_CHANGED */ && - oldType === "child_changed" /* CHILD_CHANGED */) { - this.changeMap.set(childKey, changeChildChanged(childKey, change.snapshotNode, oldChange.oldSnap)); - } - else { - throw assertionError('Illegal combination of changes: ' + - change + - ' occurred after ' + - oldChange); - } - } - else { - this.changeMap.set(childKey, change); - } - } - getChanges() { - return Array.from(this.changeMap.values()); - } -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * An implementation of CompleteChildSource that never returns any additional children - */ -// eslint-disable-next-line @typescript-eslint/naming-convention -class NoCompleteChildSource_ { - getCompleteChild(childKey) { - return null; - } - getChildAfterChild(index, child, reverse) { - return null; - } -} -/** - * Singleton instance. - */ -const NO_COMPLETE_CHILD_SOURCE = new NoCompleteChildSource_(); -/** - * An implementation of CompleteChildSource that uses a WriteTree in addition to any other server data or - * old event caches available to calculate complete children. - */ -class WriteTreeCompleteChildSource { - constructor(writes_, viewCache_, optCompleteServerCache_ = null) { - this.writes_ = writes_; - this.viewCache_ = viewCache_; - this.optCompleteServerCache_ = optCompleteServerCache_; - } - getCompleteChild(childKey) { - const node = this.viewCache_.eventCache; - if (node.isCompleteForChild(childKey)) { - return node.getNode().getImmediateChild(childKey); - } - else { - const serverNode = this.optCompleteServerCache_ != null - ? new CacheNode(this.optCompleteServerCache_, true, false) - : this.viewCache_.serverCache; - return writeTreeRefCalcCompleteChild(this.writes_, childKey, serverNode); - } - } - getChildAfterChild(index, child, reverse) { - const completeServerData = this.optCompleteServerCache_ != null - ? this.optCompleteServerCache_ - : viewCacheGetCompleteServerSnap(this.viewCache_); - const nodes = writeTreeRefCalcIndexedSlice(this.writes_, completeServerData, child, 1, reverse, index); - if (nodes.length === 0) { - return null; - } - else { - return nodes[0]; - } - } -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -function newViewProcessor(filter) { - return { filter }; -} -function viewProcessorAssertIndexed(viewProcessor, viewCache) { - assert(viewCache.eventCache.getNode().isIndexed(viewProcessor.filter.getIndex()), 'Event snap not indexed'); - assert(viewCache.serverCache.getNode().isIndexed(viewProcessor.filter.getIndex()), 'Server snap not indexed'); -} -function viewProcessorApplyOperation(viewProcessor, oldViewCache, operation, writesCache, completeCache) { - const accumulator = new ChildChangeAccumulator(); - let newViewCache, filterServerNode; - if (operation.type === OperationType.OVERWRITE) { - const overwrite = operation; - if (overwrite.source.fromUser) { - newViewCache = viewProcessorApplyUserOverwrite(viewProcessor, oldViewCache, overwrite.path, overwrite.snap, writesCache, completeCache, accumulator); - } - else { - assert(overwrite.source.fromServer, 'Unknown source.'); - // We filter the node if it's a tagged update or the node has been previously filtered and the - // update is not at the root in which case it is ok (and necessary) to mark the node unfiltered - // again - filterServerNode = - overwrite.source.tagged || - (oldViewCache.serverCache.isFiltered() && !pathIsEmpty(overwrite.path)); - newViewCache = viewProcessorApplyServerOverwrite(viewProcessor, oldViewCache, overwrite.path, overwrite.snap, writesCache, completeCache, filterServerNode, accumulator); - } - } - else if (operation.type === OperationType.MERGE) { - const merge = operation; - if (merge.source.fromUser) { - newViewCache = viewProcessorApplyUserMerge(viewProcessor, oldViewCache, merge.path, merge.children, writesCache, completeCache, accumulator); - } - else { - assert(merge.source.fromServer, 'Unknown source.'); - // We filter the node if it's a tagged update or the node has been previously filtered - filterServerNode = - merge.source.tagged || oldViewCache.serverCache.isFiltered(); - newViewCache = viewProcessorApplyServerMerge(viewProcessor, oldViewCache, merge.path, merge.children, writesCache, completeCache, filterServerNode, accumulator); - } - } - else if (operation.type === OperationType.ACK_USER_WRITE) { - const ackUserWrite = operation; - if (!ackUserWrite.revert) { - newViewCache = viewProcessorAckUserWrite(viewProcessor, oldViewCache, ackUserWrite.path, ackUserWrite.affectedTree, writesCache, completeCache, accumulator); - } - else { - newViewCache = viewProcessorRevertUserWrite(viewProcessor, oldViewCache, ackUserWrite.path, writesCache, completeCache, accumulator); - } - } - else if (operation.type === OperationType.LISTEN_COMPLETE) { - newViewCache = viewProcessorListenComplete(viewProcessor, oldViewCache, operation.path, writesCache, accumulator); - } - else { - throw assertionError('Unknown operation type: ' + operation.type); - } - const changes = accumulator.getChanges(); - viewProcessorMaybeAddValueEvent(oldViewCache, newViewCache, changes); - return { viewCache: newViewCache, changes }; -} -function viewProcessorMaybeAddValueEvent(oldViewCache, newViewCache, accumulator) { - const eventSnap = newViewCache.eventCache; - if (eventSnap.isFullyInitialized()) { - const isLeafOrEmpty = eventSnap.getNode().isLeafNode() || eventSnap.getNode().isEmpty(); - const oldCompleteSnap = viewCacheGetCompleteEventSnap(oldViewCache); - if (accumulator.length > 0 || - !oldViewCache.eventCache.isFullyInitialized() || - (isLeafOrEmpty && !eventSnap.getNode().equals(oldCompleteSnap)) || - !eventSnap.getNode().getPriority().equals(oldCompleteSnap.getPriority())) { - accumulator.push(changeValue(viewCacheGetCompleteEventSnap(newViewCache))); - } - } -} -function viewProcessorGenerateEventCacheAfterServerEvent(viewProcessor, viewCache, changePath, writesCache, source, accumulator) { - const oldEventSnap = viewCache.eventCache; - if (writeTreeRefShadowingWrite(writesCache, changePath) != null) { - // we have a shadowing write, ignore changes - return viewCache; - } - else { - let newEventCache, serverNode; - if (pathIsEmpty(changePath)) { - // TODO: figure out how this plays with "sliding ack windows" - assert(viewCache.serverCache.isFullyInitialized(), 'If change path is empty, we must have complete server data'); - if (viewCache.serverCache.isFiltered()) { - // We need to special case this, because we need to only apply writes to complete children, or - // we might end up raising events for incomplete children. If the server data is filtered deep - // writes cannot be guaranteed to be complete - const serverCache = viewCacheGetCompleteServerSnap(viewCache); - const completeChildren = serverCache instanceof ChildrenNode - ? serverCache - : ChildrenNode.EMPTY_NODE; - const completeEventChildren = writeTreeRefCalcCompleteEventChildren(writesCache, completeChildren); - newEventCache = viewProcessor.filter.updateFullNode(viewCache.eventCache.getNode(), completeEventChildren, accumulator); - } - else { - const completeNode = writeTreeRefCalcCompleteEventCache(writesCache, viewCacheGetCompleteServerSnap(viewCache)); - newEventCache = viewProcessor.filter.updateFullNode(viewCache.eventCache.getNode(), completeNode, accumulator); - } - } - else { - const childKey = pathGetFront(changePath); - if (childKey === '.priority') { - assert(pathGetLength(changePath) === 1, "Can't have a priority with additional path components"); - const oldEventNode = oldEventSnap.getNode(); - serverNode = viewCache.serverCache.getNode(); - // we might have overwrites for this priority - const updatedPriority = writeTreeRefCalcEventCacheAfterServerOverwrite(writesCache, changePath, oldEventNode, serverNode); - if (updatedPriority != null) { - newEventCache = viewProcessor.filter.updatePriority(oldEventNode, updatedPriority); - } - else { - // priority didn't change, keep old node - newEventCache = oldEventSnap.getNode(); - } - } - else { - const childChangePath = pathPopFront(changePath); - // update child - let newEventChild; - if (oldEventSnap.isCompleteForChild(childKey)) { - serverNode = viewCache.serverCache.getNode(); - const eventChildUpdate = writeTreeRefCalcEventCacheAfterServerOverwrite(writesCache, changePath, oldEventSnap.getNode(), serverNode); - if (eventChildUpdate != null) { - newEventChild = oldEventSnap - .getNode() - .getImmediateChild(childKey) - .updateChild(childChangePath, eventChildUpdate); - } - else { - // Nothing changed, just keep the old child - newEventChild = oldEventSnap.getNode().getImmediateChild(childKey); - } - } - else { - newEventChild = writeTreeRefCalcCompleteChild(writesCache, childKey, viewCache.serverCache); - } - if (newEventChild != null) { - newEventCache = viewProcessor.filter.updateChild(oldEventSnap.getNode(), childKey, newEventChild, childChangePath, source, accumulator); - } - else { - // no complete child available or no change - newEventCache = oldEventSnap.getNode(); - } - } - } - return viewCacheUpdateEventSnap(viewCache, newEventCache, oldEventSnap.isFullyInitialized() || pathIsEmpty(changePath), viewProcessor.filter.filtersNodes()); - } -} -function viewProcessorApplyServerOverwrite(viewProcessor, oldViewCache, changePath, changedSnap, writesCache, completeCache, filterServerNode, accumulator) { - const oldServerSnap = oldViewCache.serverCache; - let newServerCache; - const serverFilter = filterServerNode - ? viewProcessor.filter - : viewProcessor.filter.getIndexedFilter(); - if (pathIsEmpty(changePath)) { - newServerCache = serverFilter.updateFullNode(oldServerSnap.getNode(), changedSnap, null); - } - else if (serverFilter.filtersNodes() && !oldServerSnap.isFiltered()) { - // we want to filter the server node, but we didn't filter the server node yet, so simulate a full update - const newServerNode = oldServerSnap - .getNode() - .updateChild(changePath, changedSnap); - newServerCache = serverFilter.updateFullNode(oldServerSnap.getNode(), newServerNode, null); - } - else { - const childKey = pathGetFront(changePath); - if (!oldServerSnap.isCompleteForPath(changePath) && - pathGetLength(changePath) > 1) { - // We don't update incomplete nodes with updates intended for other listeners - return oldViewCache; - } - const childChangePath = pathPopFront(changePath); - const childNode = oldServerSnap.getNode().getImmediateChild(childKey); - const newChildNode = childNode.updateChild(childChangePath, changedSnap); - if (childKey === '.priority') { - newServerCache = serverFilter.updatePriority(oldServerSnap.getNode(), newChildNode); - } - else { - newServerCache = serverFilter.updateChild(oldServerSnap.getNode(), childKey, newChildNode, childChangePath, NO_COMPLETE_CHILD_SOURCE, null); - } - } - const newViewCache = viewCacheUpdateServerSnap(oldViewCache, newServerCache, oldServerSnap.isFullyInitialized() || pathIsEmpty(changePath), serverFilter.filtersNodes()); - const source = new WriteTreeCompleteChildSource(writesCache, newViewCache, completeCache); - return viewProcessorGenerateEventCacheAfterServerEvent(viewProcessor, newViewCache, changePath, writesCache, source, accumulator); -} -function viewProcessorApplyUserOverwrite(viewProcessor, oldViewCache, changePath, changedSnap, writesCache, completeCache, accumulator) { - const oldEventSnap = oldViewCache.eventCache; - let newViewCache, newEventCache; - const source = new WriteTreeCompleteChildSource(writesCache, oldViewCache, completeCache); - if (pathIsEmpty(changePath)) { - newEventCache = viewProcessor.filter.updateFullNode(oldViewCache.eventCache.getNode(), changedSnap, accumulator); - newViewCache = viewCacheUpdateEventSnap(oldViewCache, newEventCache, true, viewProcessor.filter.filtersNodes()); - } - else { - const childKey = pathGetFront(changePath); - if (childKey === '.priority') { - newEventCache = viewProcessor.filter.updatePriority(oldViewCache.eventCache.getNode(), changedSnap); - newViewCache = viewCacheUpdateEventSnap(oldViewCache, newEventCache, oldEventSnap.isFullyInitialized(), oldEventSnap.isFiltered()); - } - else { - const childChangePath = pathPopFront(changePath); - const oldChild = oldEventSnap.getNode().getImmediateChild(childKey); - let newChild; - if (pathIsEmpty(childChangePath)) { - // Child overwrite, we can replace the child - newChild = changedSnap; - } - else { - const childNode = source.getCompleteChild(childKey); - if (childNode != null) { - if (pathGetBack(childChangePath) === '.priority' && - childNode.getChild(pathParent(childChangePath)).isEmpty()) { - // This is a priority update on an empty node. If this node exists on the server, the - // server will send down the priority in the update, so ignore for now - newChild = childNode; - } - else { - newChild = childNode.updateChild(childChangePath, changedSnap); - } - } - else { - // There is no complete child node available - newChild = ChildrenNode.EMPTY_NODE; - } - } - if (!oldChild.equals(newChild)) { - const newEventSnap = viewProcessor.filter.updateChild(oldEventSnap.getNode(), childKey, newChild, childChangePath, source, accumulator); - newViewCache = viewCacheUpdateEventSnap(oldViewCache, newEventSnap, oldEventSnap.isFullyInitialized(), viewProcessor.filter.filtersNodes()); - } - else { - newViewCache = oldViewCache; - } - } - } - return newViewCache; -} -function viewProcessorCacheHasChild(viewCache, childKey) { - return viewCache.eventCache.isCompleteForChild(childKey); -} -function viewProcessorApplyUserMerge(viewProcessor, viewCache, path, changedChildren, writesCache, serverCache, accumulator) { - // HACK: In the case of a limit query, there may be some changes that bump things out of the - // window leaving room for new items. It's important we process these changes first, so we - // iterate the changes twice, first processing any that affect items currently in view. - // TODO: I consider an item "in view" if cacheHasChild is true, which checks both the server - // and event snap. I'm not sure if this will result in edge cases when a child is in one but - // not the other. - let curViewCache = viewCache; - changedChildren.foreach((relativePath, childNode) => { - const writePath = pathChild(path, relativePath); - if (viewProcessorCacheHasChild(viewCache, pathGetFront(writePath))) { - curViewCache = viewProcessorApplyUserOverwrite(viewProcessor, curViewCache, writePath, childNode, writesCache, serverCache, accumulator); - } - }); - changedChildren.foreach((relativePath, childNode) => { - const writePath = pathChild(path, relativePath); - if (!viewProcessorCacheHasChild(viewCache, pathGetFront(writePath))) { - curViewCache = viewProcessorApplyUserOverwrite(viewProcessor, curViewCache, writePath, childNode, writesCache, serverCache, accumulator); - } - }); - return curViewCache; -} -function viewProcessorApplyMerge(viewProcessor, node, merge) { - merge.foreach((relativePath, childNode) => { - node = node.updateChild(relativePath, childNode); - }); - return node; -} -function viewProcessorApplyServerMerge(viewProcessor, viewCache, path, changedChildren, writesCache, serverCache, filterServerNode, accumulator) { - // If we don't have a cache yet, this merge was intended for a previously listen in the same location. Ignore it and - // wait for the complete data update coming soon. - if (viewCache.serverCache.getNode().isEmpty() && - !viewCache.serverCache.isFullyInitialized()) { - return viewCache; - } - // HACK: In the case of a limit query, there may be some changes that bump things out of the - // window leaving room for new items. It's important we process these changes first, so we - // iterate the changes twice, first processing any that affect items currently in view. - // TODO: I consider an item "in view" if cacheHasChild is true, which checks both the server - // and event snap. I'm not sure if this will result in edge cases when a child is in one but - // not the other. - let curViewCache = viewCache; - let viewMergeTree; - if (pathIsEmpty(path)) { - viewMergeTree = changedChildren; - } - else { - viewMergeTree = new ImmutableTree(null).setTree(path, changedChildren); - } - const serverNode = viewCache.serverCache.getNode(); - viewMergeTree.children.inorderTraversal((childKey, childTree) => { - if (serverNode.hasChild(childKey)) { - const serverChild = viewCache.serverCache - .getNode() - .getImmediateChild(childKey); - const newChild = viewProcessorApplyMerge(viewProcessor, serverChild, childTree); - curViewCache = viewProcessorApplyServerOverwrite(viewProcessor, curViewCache, new Path(childKey), newChild, writesCache, serverCache, filterServerNode, accumulator); - } - }); - viewMergeTree.children.inorderTraversal((childKey, childMergeTree) => { - const isUnknownDeepMerge = !viewCache.serverCache.isCompleteForChild(childKey) && - childMergeTree.value === null; - if (!serverNode.hasChild(childKey) && !isUnknownDeepMerge) { - const serverChild = viewCache.serverCache - .getNode() - .getImmediateChild(childKey); - const newChild = viewProcessorApplyMerge(viewProcessor, serverChild, childMergeTree); - curViewCache = viewProcessorApplyServerOverwrite(viewProcessor, curViewCache, new Path(childKey), newChild, writesCache, serverCache, filterServerNode, accumulator); - } - }); - return curViewCache; -} -function viewProcessorAckUserWrite(viewProcessor, viewCache, ackPath, affectedTree, writesCache, completeCache, accumulator) { - if (writeTreeRefShadowingWrite(writesCache, ackPath) != null) { - return viewCache; - } - // Only filter server node if it is currently filtered - const filterServerNode = viewCache.serverCache.isFiltered(); - // Essentially we'll just get our existing server cache for the affected paths and re-apply it as a server update - // now that it won't be shadowed. - const serverCache = viewCache.serverCache; - if (affectedTree.value != null) { - // This is an overwrite. - if ((pathIsEmpty(ackPath) && serverCache.isFullyInitialized()) || - serverCache.isCompleteForPath(ackPath)) { - return viewProcessorApplyServerOverwrite(viewProcessor, viewCache, ackPath, serverCache.getNode().getChild(ackPath), writesCache, completeCache, filterServerNode, accumulator); - } - else if (pathIsEmpty(ackPath)) { - // This is a goofy edge case where we are acking data at this location but don't have full data. We - // should just re-apply whatever we have in our cache as a merge. - let changedChildren = new ImmutableTree(null); - serverCache.getNode().forEachChild(KEY_INDEX, (name, node) => { - changedChildren = changedChildren.set(new Path(name), node); - }); - return viewProcessorApplyServerMerge(viewProcessor, viewCache, ackPath, changedChildren, writesCache, completeCache, filterServerNode, accumulator); - } - else { - return viewCache; - } - } - else { - // This is a merge. - let changedChildren = new ImmutableTree(null); - affectedTree.foreach((mergePath, value) => { - const serverCachePath = pathChild(ackPath, mergePath); - if (serverCache.isCompleteForPath(serverCachePath)) { - changedChildren = changedChildren.set(mergePath, serverCache.getNode().getChild(serverCachePath)); - } - }); - return viewProcessorApplyServerMerge(viewProcessor, viewCache, ackPath, changedChildren, writesCache, completeCache, filterServerNode, accumulator); - } -} -function viewProcessorListenComplete(viewProcessor, viewCache, path, writesCache, accumulator) { - const oldServerNode = viewCache.serverCache; - const newViewCache = viewCacheUpdateServerSnap(viewCache, oldServerNode.getNode(), oldServerNode.isFullyInitialized() || pathIsEmpty(path), oldServerNode.isFiltered()); - return viewProcessorGenerateEventCacheAfterServerEvent(viewProcessor, newViewCache, path, writesCache, NO_COMPLETE_CHILD_SOURCE, accumulator); -} -function viewProcessorRevertUserWrite(viewProcessor, viewCache, path, writesCache, completeServerCache, accumulator) { - let complete; - if (writeTreeRefShadowingWrite(writesCache, path) != null) { - return viewCache; - } - else { - const source = new WriteTreeCompleteChildSource(writesCache, viewCache, completeServerCache); - const oldEventCache = viewCache.eventCache.getNode(); - let newEventCache; - if (pathIsEmpty(path) || pathGetFront(path) === '.priority') { - let newNode; - if (viewCache.serverCache.isFullyInitialized()) { - newNode = writeTreeRefCalcCompleteEventCache(writesCache, viewCacheGetCompleteServerSnap(viewCache)); - } - else { - const serverChildren = viewCache.serverCache.getNode(); - assert(serverChildren instanceof ChildrenNode, 'serverChildren would be complete if leaf node'); - newNode = writeTreeRefCalcCompleteEventChildren(writesCache, serverChildren); - } - newNode = newNode; - newEventCache = viewProcessor.filter.updateFullNode(oldEventCache, newNode, accumulator); - } - else { - const childKey = pathGetFront(path); - let newChild = writeTreeRefCalcCompleteChild(writesCache, childKey, viewCache.serverCache); - if (newChild == null && - viewCache.serverCache.isCompleteForChild(childKey)) { - newChild = oldEventCache.getImmediateChild(childKey); - } - if (newChild != null) { - newEventCache = viewProcessor.filter.updateChild(oldEventCache, childKey, newChild, pathPopFront(path), source, accumulator); - } - else if (viewCache.eventCache.getNode().hasChild(childKey)) { - // No complete child available, delete the existing one, if any - newEventCache = viewProcessor.filter.updateChild(oldEventCache, childKey, ChildrenNode.EMPTY_NODE, pathPopFront(path), source, accumulator); - } - else { - newEventCache = oldEventCache; - } - if (newEventCache.isEmpty() && - viewCache.serverCache.isFullyInitialized()) { - // We might have reverted all child writes. Maybe the old event was a leaf node - complete = writeTreeRefCalcCompleteEventCache(writesCache, viewCacheGetCompleteServerSnap(viewCache)); - if (complete.isLeafNode()) { - newEventCache = viewProcessor.filter.updateFullNode(newEventCache, complete, accumulator); - } - } - } - complete = - viewCache.serverCache.isFullyInitialized() || - writeTreeRefShadowingWrite(writesCache, newEmptyPath()) != null; - return viewCacheUpdateEventSnap(viewCache, newEventCache, complete, viewProcessor.filter.filtersNodes()); - } -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * A view represents a specific location and query that has 1 or more event registrations. - * - * It does several things: - * - Maintains the list of event registrations for this location/query. - * - Maintains a cache of the data visible for this location/query. - * - Applies new operations (via applyOperation), updates the cache, and based on the event - * registrations returns the set of events to be raised. - */ -class View { - constructor(query_, initialViewCache) { - this.query_ = query_; - this.eventRegistrations_ = []; - const params = this.query_._queryParams; - const indexFilter = new IndexedFilter(params.getIndex()); - const filter = queryParamsGetNodeFilter(params); - this.processor_ = newViewProcessor(filter); - const initialServerCache = initialViewCache.serverCache; - const initialEventCache = initialViewCache.eventCache; - // Don't filter server node with other filter than index, wait for tagged listen - const serverSnap = indexFilter.updateFullNode(ChildrenNode.EMPTY_NODE, initialServerCache.getNode(), null); - const eventSnap = filter.updateFullNode(ChildrenNode.EMPTY_NODE, initialEventCache.getNode(), null); - const newServerCache = new CacheNode(serverSnap, initialServerCache.isFullyInitialized(), indexFilter.filtersNodes()); - const newEventCache = new CacheNode(eventSnap, initialEventCache.isFullyInitialized(), filter.filtersNodes()); - this.viewCache_ = newViewCache(newEventCache, newServerCache); - this.eventGenerator_ = new EventGenerator(this.query_); - } - get query() { - return this.query_; - } -} -function viewGetServerCache(view) { - return view.viewCache_.serverCache.getNode(); -} -function viewGetCompleteNode(view) { - return viewCacheGetCompleteEventSnap(view.viewCache_); -} -function viewGetCompleteServerCache(view, path) { - const cache = viewCacheGetCompleteServerSnap(view.viewCache_); - if (cache) { - // If this isn't a "loadsAllData" view, then cache isn't actually a complete cache and - // we need to see if it contains the child we're interested in. - if (view.query._queryParams.loadsAllData() || - (!pathIsEmpty(path) && - !cache.getImmediateChild(pathGetFront(path)).isEmpty())) { - return cache.getChild(path); - } - } - return null; -} -function viewIsEmpty(view) { - return view.eventRegistrations_.length === 0; -} -function viewAddEventRegistration(view, eventRegistration) { - view.eventRegistrations_.push(eventRegistration); -} -/** - * @param eventRegistration - If null, remove all callbacks. - * @param cancelError - If a cancelError is provided, appropriate cancel events will be returned. - * @returns Cancel events, if cancelError was provided. - */ -function viewRemoveEventRegistration(view, eventRegistration, cancelError) { - const cancelEvents = []; - if (cancelError) { - assert(eventRegistration == null, 'A cancel should cancel all event registrations.'); - const path = view.query._path; - view.eventRegistrations_.forEach(registration => { - const maybeEvent = registration.createCancelEvent(cancelError, path); - if (maybeEvent) { - cancelEvents.push(maybeEvent); - } - }); - } - if (eventRegistration) { - let remaining = []; - for (let i = 0; i < view.eventRegistrations_.length; ++i) { - const existing = view.eventRegistrations_[i]; - if (!existing.matches(eventRegistration)) { - remaining.push(existing); - } - else if (eventRegistration.hasAnyCallback()) { - // We're removing just this one - remaining = remaining.concat(view.eventRegistrations_.slice(i + 1)); - break; - } - } - view.eventRegistrations_ = remaining; - } - else { - view.eventRegistrations_ = []; - } - return cancelEvents; -} -/** - * Applies the given Operation, updates our cache, and returns the appropriate events. - */ -function viewApplyOperation(view, operation, writesCache, completeServerCache) { - if (operation.type === OperationType.MERGE && - operation.source.queryId !== null) { - assert(viewCacheGetCompleteServerSnap(view.viewCache_), 'We should always have a full cache before handling merges'); - assert(viewCacheGetCompleteEventSnap(view.viewCache_), 'Missing event cache, even though we have a server cache'); - } - const oldViewCache = view.viewCache_; - const result = viewProcessorApplyOperation(view.processor_, oldViewCache, operation, writesCache, completeServerCache); - viewProcessorAssertIndexed(view.processor_, result.viewCache); - assert(result.viewCache.serverCache.isFullyInitialized() || - !oldViewCache.serverCache.isFullyInitialized(), 'Once a server snap is complete, it should never go back'); - view.viewCache_ = result.viewCache; - return viewGenerateEventsForChanges_(view, result.changes, result.viewCache.eventCache.getNode(), null); -} -function viewGetInitialEvents(view, registration) { - const eventSnap = view.viewCache_.eventCache; - const initialChanges = []; - if (!eventSnap.getNode().isLeafNode()) { - const eventNode = eventSnap.getNode(); - eventNode.forEachChild(PRIORITY_INDEX, (key, childNode) => { - initialChanges.push(changeChildAdded(key, childNode)); - }); - } - if (eventSnap.isFullyInitialized()) { - initialChanges.push(changeValue(eventSnap.getNode())); - } - return viewGenerateEventsForChanges_(view, initialChanges, eventSnap.getNode(), registration); -} -function viewGenerateEventsForChanges_(view, changes, eventCache, eventRegistration) { - const registrations = eventRegistration - ? [eventRegistration] - : view.eventRegistrations_; - return eventGeneratorGenerateEventsForChanges(view.eventGenerator_, changes, eventCache, registrations); -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -let referenceConstructor$1; -/** - * SyncPoint represents a single location in a SyncTree with 1 or more event registrations, meaning we need to - * maintain 1 or more Views at this location to cache server data and raise appropriate events for server changes - * and user writes (set, transaction, update). - * - * It's responsible for: - * - Maintaining the set of 1 or more views necessary at this location (a SyncPoint with 0 views should be removed). - * - Proxying user / server operations to the views as appropriate (i.e. applyServerOverwrite, - * applyUserOverwrite, etc.) - */ -class SyncPoint { - constructor() { - /** - * The Views being tracked at this location in the tree, stored as a map where the key is a - * queryId and the value is the View for that query. - * - * NOTE: This list will be quite small (usually 1, but perhaps 2 or 3; any more is an odd use case). - */ - this.views = new Map(); - } -} -function syncPointSetReferenceConstructor(val) { - assert(!referenceConstructor$1, '__referenceConstructor has already been defined'); - referenceConstructor$1 = val; -} -function syncPointGetReferenceConstructor() { - assert(referenceConstructor$1, 'Reference.ts has not been loaded'); - return referenceConstructor$1; -} -function syncPointIsEmpty(syncPoint) { - return syncPoint.views.size === 0; -} -function syncPointApplyOperation(syncPoint, operation, writesCache, optCompleteServerCache) { - const queryId = operation.source.queryId; - if (queryId !== null) { - const view = syncPoint.views.get(queryId); - assert(view != null, 'SyncTree gave us an op for an invalid query.'); - return viewApplyOperation(view, operation, writesCache, optCompleteServerCache); - } - else { - let events = []; - for (const view of syncPoint.views.values()) { - events = events.concat(viewApplyOperation(view, operation, writesCache, optCompleteServerCache)); - } - return events; - } -} -/** - * Get a view for the specified query. - * - * @param query - The query to return a view for - * @param writesCache - * @param serverCache - * @param serverCacheComplete - * @returns Events to raise. - */ -function syncPointGetView(syncPoint, query, writesCache, serverCache, serverCacheComplete) { - const queryId = query._queryIdentifier; - const view = syncPoint.views.get(queryId); - if (!view) { - // TODO: make writesCache take flag for complete server node - let eventCache = writeTreeRefCalcCompleteEventCache(writesCache, serverCacheComplete ? serverCache : null); - let eventCacheComplete = false; - if (eventCache) { - eventCacheComplete = true; - } - else if (serverCache instanceof ChildrenNode) { - eventCache = writeTreeRefCalcCompleteEventChildren(writesCache, serverCache); - eventCacheComplete = false; - } - else { - eventCache = ChildrenNode.EMPTY_NODE; - eventCacheComplete = false; - } - const viewCache = newViewCache(new CacheNode(eventCache, eventCacheComplete, false), new CacheNode(serverCache, serverCacheComplete, false)); - return new View(query, viewCache); - } - return view; -} -/** - * Add an event callback for the specified query. - * - * @param query - * @param eventRegistration - * @param writesCache - * @param serverCache - Complete server cache, if we have it. - * @param serverCacheComplete - * @returns Events to raise. - */ -function syncPointAddEventRegistration(syncPoint, query, eventRegistration, writesCache, serverCache, serverCacheComplete) { - const view = syncPointGetView(syncPoint, query, writesCache, serverCache, serverCacheComplete); - if (!syncPoint.views.has(query._queryIdentifier)) { - syncPoint.views.set(query._queryIdentifier, view); - } - // This is guaranteed to exist now, we just created anything that was missing - viewAddEventRegistration(view, eventRegistration); - return viewGetInitialEvents(view, eventRegistration); -} -/** - * Remove event callback(s). Return cancelEvents if a cancelError is specified. - * - * If query is the default query, we'll check all views for the specified eventRegistration. - * If eventRegistration is null, we'll remove all callbacks for the specified view(s). - * - * @param eventRegistration - If null, remove all callbacks. - * @param cancelError - If a cancelError is provided, appropriate cancel events will be returned. - * @returns removed queries and any cancel events - */ -function syncPointRemoveEventRegistration(syncPoint, query, eventRegistration, cancelError) { - const queryId = query._queryIdentifier; - const removed = []; - let cancelEvents = []; - const hadCompleteView = syncPointHasCompleteView(syncPoint); - if (queryId === 'default') { - // When you do ref.off(...), we search all views for the registration to remove. - for (const [viewQueryId, view] of syncPoint.views.entries()) { - cancelEvents = cancelEvents.concat(viewRemoveEventRegistration(view, eventRegistration, cancelError)); - if (viewIsEmpty(view)) { - syncPoint.views.delete(viewQueryId); - // We'll deal with complete views later. - if (!view.query._queryParams.loadsAllData()) { - removed.push(view.query); - } - } - } - } - else { - // remove the callback from the specific view. - const view = syncPoint.views.get(queryId); - if (view) { - cancelEvents = cancelEvents.concat(viewRemoveEventRegistration(view, eventRegistration, cancelError)); - if (viewIsEmpty(view)) { - syncPoint.views.delete(queryId); - // We'll deal with complete views later. - if (!view.query._queryParams.loadsAllData()) { - removed.push(view.query); - } - } - } - } - if (hadCompleteView && !syncPointHasCompleteView(syncPoint)) { - // We removed our last complete view. - removed.push(new (syncPointGetReferenceConstructor())(query._repo, query._path)); - } - return { removed, events: cancelEvents }; -} -function syncPointGetQueryViews(syncPoint) { - const result = []; - for (const view of syncPoint.views.values()) { - if (!view.query._queryParams.loadsAllData()) { - result.push(view); - } - } - return result; -} -/** - * @param path - The path to the desired complete snapshot - * @returns A complete cache, if it exists - */ -function syncPointGetCompleteServerCache(syncPoint, path) { - let serverCache = null; - for (const view of syncPoint.views.values()) { - serverCache = serverCache || viewGetCompleteServerCache(view, path); - } - return serverCache; -} -function syncPointViewForQuery(syncPoint, query) { - const params = query._queryParams; - if (params.loadsAllData()) { - return syncPointGetCompleteView(syncPoint); - } - else { - const queryId = query._queryIdentifier; - return syncPoint.views.get(queryId); - } -} -function syncPointViewExistsForQuery(syncPoint, query) { - return syncPointViewForQuery(syncPoint, query) != null; -} -function syncPointHasCompleteView(syncPoint) { - return syncPointGetCompleteView(syncPoint) != null; -} -function syncPointGetCompleteView(syncPoint) { - for (const view of syncPoint.views.values()) { - if (view.query._queryParams.loadsAllData()) { - return view; - } - } - return null; -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -let referenceConstructor; -function syncTreeSetReferenceConstructor(val) { - assert(!referenceConstructor, '__referenceConstructor has already been defined'); - referenceConstructor = val; -} -function syncTreeGetReferenceConstructor() { - assert(referenceConstructor, 'Reference.ts has not been loaded'); - return referenceConstructor; -} -/** - * Static tracker for next query tag. - */ -let syncTreeNextQueryTag_ = 1; -/** - * SyncTree is the central class for managing event callback registration, data caching, views - * (query processing), and event generation. There are typically two SyncTree instances for - * each Repo, one for the normal Firebase data, and one for the .info data. - * - * It has a number of responsibilities, including: - * - Tracking all user event callbacks (registered via addEventRegistration() and removeEventRegistration()). - * - Applying and caching data changes for user set(), transaction(), and update() calls - * (applyUserOverwrite(), applyUserMerge()). - * - Applying and caching data changes for server data changes (applyServerOverwrite(), - * applyServerMerge()). - * - Generating user-facing events for server and user changes (all of the apply* methods - * return the set of events that need to be raised as a result). - * - Maintaining the appropriate set of server listens to ensure we are always subscribed - * to the correct set of paths and queries to satisfy the current set of user event - * callbacks (listens are started/stopped using the provided listenProvider). - * - * NOTE: Although SyncTree tracks event callbacks and calculates events to raise, the actual - * events are returned to the caller rather than raised synchronously. - * - */ -class SyncTree { - /** - * @param listenProvider_ - Used by SyncTree to start / stop listening - * to server data. - */ - constructor(listenProvider_) { - this.listenProvider_ = listenProvider_; - /** - * Tree of SyncPoints. There's a SyncPoint at any location that has 1 or more views. - */ - this.syncPointTree_ = new ImmutableTree(null); - /** - * A tree of all pending user writes (user-initiated set()'s, transaction()'s, update()'s, etc.). - */ - this.pendingWriteTree_ = newWriteTree(); - this.tagToQueryMap = new Map(); - this.queryToTagMap = new Map(); - } -} -/** - * Apply the data changes for a user-generated set() or transaction() call. - * - * @returns Events to raise. - */ -function syncTreeApplyUserOverwrite(syncTree, path, newData, writeId, visible) { - // Record pending write. - writeTreeAddOverwrite(syncTree.pendingWriteTree_, path, newData, writeId, visible); - if (!visible) { - return []; - } - else { - return syncTreeApplyOperationToSyncPoints_(syncTree, new Overwrite(newOperationSourceUser(), path, newData)); - } -} -/** - * Apply the data from a user-generated update() call - * - * @returns Events to raise. - */ -function syncTreeApplyUserMerge(syncTree, path, changedChildren, writeId) { - // Record pending merge. - writeTreeAddMerge(syncTree.pendingWriteTree_, path, changedChildren, writeId); - const changeTree = ImmutableTree.fromObject(changedChildren); - return syncTreeApplyOperationToSyncPoints_(syncTree, new Merge(newOperationSourceUser(), path, changeTree)); -} -/** - * Acknowledge a pending user write that was previously registered with applyUserOverwrite() or applyUserMerge(). - * - * @param revert - True if the given write failed and needs to be reverted - * @returns Events to raise. - */ -function syncTreeAckUserWrite(syncTree, writeId, revert = false) { - const write = writeTreeGetWrite(syncTree.pendingWriteTree_, writeId); - const needToReevaluate = writeTreeRemoveWrite(syncTree.pendingWriteTree_, writeId); - if (!needToReevaluate) { - return []; - } - else { - let affectedTree = new ImmutableTree(null); - if (write.snap != null) { - // overwrite - affectedTree = affectedTree.set(newEmptyPath(), true); - } - else { - each(write.children, (pathString) => { - affectedTree = affectedTree.set(new Path(pathString), true); - }); - } - return syncTreeApplyOperationToSyncPoints_(syncTree, new AckUserWrite(write.path, affectedTree, revert)); - } -} -/** - * Apply new server data for the specified path.. - * - * @returns Events to raise. - */ -function syncTreeApplyServerOverwrite(syncTree, path, newData) { - return syncTreeApplyOperationToSyncPoints_(syncTree, new Overwrite(newOperationSourceServer(), path, newData)); -} -/** - * Apply new server data to be merged in at the specified path. - * - * @returns Events to raise. - */ -function syncTreeApplyServerMerge(syncTree, path, changedChildren) { - const changeTree = ImmutableTree.fromObject(changedChildren); - return syncTreeApplyOperationToSyncPoints_(syncTree, new Merge(newOperationSourceServer(), path, changeTree)); -} -/** - * Apply a listen complete for a query - * - * @returns Events to raise. - */ -function syncTreeApplyListenComplete(syncTree, path) { - return syncTreeApplyOperationToSyncPoints_(syncTree, new ListenComplete(newOperationSourceServer(), path)); -} -/** - * Apply a listen complete for a tagged query - * - * @returns Events to raise. - */ -function syncTreeApplyTaggedListenComplete(syncTree, path, tag) { - const queryKey = syncTreeQueryKeyForTag_(syncTree, tag); - if (queryKey) { - const r = syncTreeParseQueryKey_(queryKey); - const queryPath = r.path, queryId = r.queryId; - const relativePath = newRelativePath(queryPath, path); - const op = new ListenComplete(newOperationSourceServerTaggedQuery(queryId), relativePath); - return syncTreeApplyTaggedOperation_(syncTree, queryPath, op); - } - else { - // We've already removed the query. No big deal, ignore the update - return []; - } -} -/** - * Remove event callback(s). - * - * If query is the default query, we'll check all queries for the specified eventRegistration. - * If eventRegistration is null, we'll remove all callbacks for the specified query/queries. - * - * @param eventRegistration - If null, all callbacks are removed. - * @param cancelError - If a cancelError is provided, appropriate cancel events will be returned. - * @param skipListenerDedup - When performing a `get()`, we don't add any new listeners, so no - * deduping needs to take place. This flag allows toggling of that behavior - * @returns Cancel events, if cancelError was provided. - */ -function syncTreeRemoveEventRegistration(syncTree, query, eventRegistration, cancelError, skipListenerDedup = false) { - // Find the syncPoint first. Then deal with whether or not it has matching listeners - const path = query._path; - const maybeSyncPoint = syncTree.syncPointTree_.get(path); - let cancelEvents = []; - // A removal on a default query affects all queries at that location. A removal on an indexed query, even one without - // other query constraints, does *not* affect all queries at that location. So this check must be for 'default', and - // not loadsAllData(). - if (maybeSyncPoint && - (query._queryIdentifier === 'default' || - syncPointViewExistsForQuery(maybeSyncPoint, query))) { - const removedAndEvents = syncPointRemoveEventRegistration(maybeSyncPoint, query, eventRegistration, cancelError); - if (syncPointIsEmpty(maybeSyncPoint)) { - syncTree.syncPointTree_ = syncTree.syncPointTree_.remove(path); - } - const removed = removedAndEvents.removed; - cancelEvents = removedAndEvents.events; - if (!skipListenerDedup) { - /** - * We may have just removed one of many listeners and can short-circuit this whole process - * We may also not have removed a default listener, in which case all of the descendant listeners should already be - * properly set up. - */ - // Since indexed queries can shadow if they don't have other query constraints, check for loadsAllData(), instead of - // queryId === 'default' - const removingDefault = -1 !== - removed.findIndex(query => { - return query._queryParams.loadsAllData(); - }); - const covered = syncTree.syncPointTree_.findOnPath(path, (relativePath, parentSyncPoint) => syncPointHasCompleteView(parentSyncPoint)); - if (removingDefault && !covered) { - const subtree = syncTree.syncPointTree_.subtree(path); - // There are potentially child listeners. Determine what if any listens we need to send before executing the - // removal - if (!subtree.isEmpty()) { - // We need to fold over our subtree and collect the listeners to send - const newViews = syncTreeCollectDistinctViewsForSubTree_(subtree); - // Ok, we've collected all the listens we need. Set them up. - for (let i = 0; i < newViews.length; ++i) { - const view = newViews[i], newQuery = view.query; - const listener = syncTreeCreateListenerForView_(syncTree, view); - syncTree.listenProvider_.startListening(syncTreeQueryForListening_(newQuery), syncTreeTagForQuery(syncTree, newQuery), listener.hashFn, listener.onComplete); - } - } - // Otherwise there's nothing below us, so nothing we need to start listening on - } - // If we removed anything and we're not covered by a higher up listen, we need to stop listening on this query - // The above block has us covered in terms of making sure we're set up on listens lower in the tree. - // Also, note that if we have a cancelError, it's already been removed at the provider level. - if (!covered && removed.length > 0 && !cancelError) { - // If we removed a default, then we weren't listening on any of the other queries here. Just cancel the one - // default. Otherwise, we need to iterate through and cancel each individual query - if (removingDefault) { - // We don't tag default listeners - const defaultTag = null; - syncTree.listenProvider_.stopListening(syncTreeQueryForListening_(query), defaultTag); - } - else { - removed.forEach((queryToRemove) => { - const tagToRemove = syncTree.queryToTagMap.get(syncTreeMakeQueryKey_(queryToRemove)); - syncTree.listenProvider_.stopListening(syncTreeQueryForListening_(queryToRemove), tagToRemove); - }); - } - } - } - // Now, clear all of the tags we're tracking for the removed listens - syncTreeRemoveTags_(syncTree, removed); - } - return cancelEvents; -} -/** - * Apply new server data for the specified tagged query. - * - * @returns Events to raise. - */ -function syncTreeApplyTaggedQueryOverwrite(syncTree, path, snap, tag) { - const queryKey = syncTreeQueryKeyForTag_(syncTree, tag); - if (queryKey != null) { - const r = syncTreeParseQueryKey_(queryKey); - const queryPath = r.path, queryId = r.queryId; - const relativePath = newRelativePath(queryPath, path); - const op = new Overwrite(newOperationSourceServerTaggedQuery(queryId), relativePath, snap); - return syncTreeApplyTaggedOperation_(syncTree, queryPath, op); - } - else { - // Query must have been removed already - return []; - } -} -/** - * Apply server data to be merged in for the specified tagged query. - * - * @returns Events to raise. - */ -function syncTreeApplyTaggedQueryMerge(syncTree, path, changedChildren, tag) { - const queryKey = syncTreeQueryKeyForTag_(syncTree, tag); - if (queryKey) { - const r = syncTreeParseQueryKey_(queryKey); - const queryPath = r.path, queryId = r.queryId; - const relativePath = newRelativePath(queryPath, path); - const changeTree = ImmutableTree.fromObject(changedChildren); - const op = new Merge(newOperationSourceServerTaggedQuery(queryId), relativePath, changeTree); - return syncTreeApplyTaggedOperation_(syncTree, queryPath, op); - } - else { - // We've already removed the query. No big deal, ignore the update - return []; - } -} -/** - * Add an event callback for the specified query. - * - * @returns Events to raise. - */ -function syncTreeAddEventRegistration(syncTree, query, eventRegistration, skipSetupListener = false) { - const path = query._path; - let serverCache = null; - let foundAncestorDefaultView = false; - // Any covering writes will necessarily be at the root, so really all we need to find is the server cache. - // Consider optimizing this once there's a better understanding of what actual behavior will be. - syncTree.syncPointTree_.foreachOnPath(path, (pathToSyncPoint, sp) => { - const relativePath = newRelativePath(pathToSyncPoint, path); - serverCache = - serverCache || syncPointGetCompleteServerCache(sp, relativePath); - foundAncestorDefaultView = - foundAncestorDefaultView || syncPointHasCompleteView(sp); - }); - let syncPoint = syncTree.syncPointTree_.get(path); - if (!syncPoint) { - syncPoint = new SyncPoint(); - syncTree.syncPointTree_ = syncTree.syncPointTree_.set(path, syncPoint); - } - else { - foundAncestorDefaultView = - foundAncestorDefaultView || syncPointHasCompleteView(syncPoint); - serverCache = - serverCache || syncPointGetCompleteServerCache(syncPoint, newEmptyPath()); - } - let serverCacheComplete; - if (serverCache != null) { - serverCacheComplete = true; - } - else { - serverCacheComplete = false; - serverCache = ChildrenNode.EMPTY_NODE; - const subtree = syncTree.syncPointTree_.subtree(path); - subtree.foreachChild((childName, childSyncPoint) => { - const completeCache = syncPointGetCompleteServerCache(childSyncPoint, newEmptyPath()); - if (completeCache) { - serverCache = serverCache.updateImmediateChild(childName, completeCache); - } - }); - } - const viewAlreadyExists = syncPointViewExistsForQuery(syncPoint, query); - if (!viewAlreadyExists && !query._queryParams.loadsAllData()) { - // We need to track a tag for this query - const queryKey = syncTreeMakeQueryKey_(query); - assert(!syncTree.queryToTagMap.has(queryKey), 'View does not exist, but we have a tag'); - const tag = syncTreeGetNextQueryTag_(); - syncTree.queryToTagMap.set(queryKey, tag); - syncTree.tagToQueryMap.set(tag, queryKey); - } - const writesCache = writeTreeChildWrites(syncTree.pendingWriteTree_, path); - let events = syncPointAddEventRegistration(syncPoint, query, eventRegistration, writesCache, serverCache, serverCacheComplete); - if (!viewAlreadyExists && !foundAncestorDefaultView && !skipSetupListener) { - const view = syncPointViewForQuery(syncPoint, query); - events = events.concat(syncTreeSetupListener_(syncTree, query, view)); - } - return events; -} -/** - * Returns a complete cache, if we have one, of the data at a particular path. If the location does not have a - * listener above it, we will get a false "null". This shouldn't be a problem because transactions will always - * have a listener above, and atomic operations would correctly show a jitter of -> - * as the write is applied locally and then acknowledged at the server. - * - * Note: this method will *include* hidden writes from transaction with applyLocally set to false. - * - * @param path - The path to the data we want - * @param writeIdsToExclude - A specific set to be excluded - */ -function syncTreeCalcCompleteEventCache(syncTree, path, writeIdsToExclude) { - const includeHiddenSets = true; - const writeTree = syncTree.pendingWriteTree_; - const serverCache = syncTree.syncPointTree_.findOnPath(path, (pathSoFar, syncPoint) => { - const relativePath = newRelativePath(pathSoFar, path); - const serverCache = syncPointGetCompleteServerCache(syncPoint, relativePath); - if (serverCache) { - return serverCache; - } - }); - return writeTreeCalcCompleteEventCache(writeTree, path, serverCache, writeIdsToExclude, includeHiddenSets); -} -function syncTreeGetServerValue(syncTree, query) { - const path = query._path; - let serverCache = null; - // Any covering writes will necessarily be at the root, so really all we need to find is the server cache. - // Consider optimizing this once there's a better understanding of what actual behavior will be. - syncTree.syncPointTree_.foreachOnPath(path, (pathToSyncPoint, sp) => { - const relativePath = newRelativePath(pathToSyncPoint, path); - serverCache = - serverCache || syncPointGetCompleteServerCache(sp, relativePath); - }); - let syncPoint = syncTree.syncPointTree_.get(path); - if (!syncPoint) { - syncPoint = new SyncPoint(); - syncTree.syncPointTree_ = syncTree.syncPointTree_.set(path, syncPoint); - } - else { - serverCache = - serverCache || syncPointGetCompleteServerCache(syncPoint, newEmptyPath()); - } - const serverCacheComplete = serverCache != null; - const serverCacheNode = serverCacheComplete - ? new CacheNode(serverCache, true, false) - : null; - const writesCache = writeTreeChildWrites(syncTree.pendingWriteTree_, query._path); - const view = syncPointGetView(syncPoint, query, writesCache, serverCacheComplete ? serverCacheNode.getNode() : ChildrenNode.EMPTY_NODE, serverCacheComplete); - return viewGetCompleteNode(view); -} -/** - * A helper method that visits all descendant and ancestor SyncPoints, applying the operation. - * - * NOTES: - * - Descendant SyncPoints will be visited first (since we raise events depth-first). - * - * - We call applyOperation() on each SyncPoint passing three things: - * 1. A version of the Operation that has been made relative to the SyncPoint location. - * 2. A WriteTreeRef of any writes we have cached at the SyncPoint location. - * 3. A snapshot Node with cached server data, if we have it. - * - * - We concatenate all of the events returned by each SyncPoint and return the result. - */ -function syncTreeApplyOperationToSyncPoints_(syncTree, operation) { - return syncTreeApplyOperationHelper_(operation, syncTree.syncPointTree_, - /*serverCache=*/ null, writeTreeChildWrites(syncTree.pendingWriteTree_, newEmptyPath())); -} -/** - * Recursive helper for applyOperationToSyncPoints_ - */ -function syncTreeApplyOperationHelper_(operation, syncPointTree, serverCache, writesCache) { - if (pathIsEmpty(operation.path)) { - return syncTreeApplyOperationDescendantsHelper_(operation, syncPointTree, serverCache, writesCache); - } - else { - const syncPoint = syncPointTree.get(newEmptyPath()); - // If we don't have cached server data, see if we can get it from this SyncPoint. - if (serverCache == null && syncPoint != null) { - serverCache = syncPointGetCompleteServerCache(syncPoint, newEmptyPath()); - } - let events = []; - const childName = pathGetFront(operation.path); - const childOperation = operation.operationForChild(childName); - const childTree = syncPointTree.children.get(childName); - if (childTree && childOperation) { - const childServerCache = serverCache - ? serverCache.getImmediateChild(childName) - : null; - const childWritesCache = writeTreeRefChild(writesCache, childName); - events = events.concat(syncTreeApplyOperationHelper_(childOperation, childTree, childServerCache, childWritesCache)); - } - if (syncPoint) { - events = events.concat(syncPointApplyOperation(syncPoint, operation, writesCache, serverCache)); - } - return events; - } -} -/** - * Recursive helper for applyOperationToSyncPoints_ - */ -function syncTreeApplyOperationDescendantsHelper_(operation, syncPointTree, serverCache, writesCache) { - const syncPoint = syncPointTree.get(newEmptyPath()); - // If we don't have cached server data, see if we can get it from this SyncPoint. - if (serverCache == null && syncPoint != null) { - serverCache = syncPointGetCompleteServerCache(syncPoint, newEmptyPath()); - } - let events = []; - syncPointTree.children.inorderTraversal((childName, childTree) => { - const childServerCache = serverCache - ? serverCache.getImmediateChild(childName) - : null; - const childWritesCache = writeTreeRefChild(writesCache, childName); - const childOperation = operation.operationForChild(childName); - if (childOperation) { - events = events.concat(syncTreeApplyOperationDescendantsHelper_(childOperation, childTree, childServerCache, childWritesCache)); - } - }); - if (syncPoint) { - events = events.concat(syncPointApplyOperation(syncPoint, operation, writesCache, serverCache)); - } - return events; -} -function syncTreeCreateListenerForView_(syncTree, view) { - const query = view.query; - const tag = syncTreeTagForQuery(syncTree, query); - return { - hashFn: () => { - const cache = viewGetServerCache(view) || ChildrenNode.EMPTY_NODE; - return cache.hash(); - }, - onComplete: (status) => { - if (status === 'ok') { - if (tag) { - return syncTreeApplyTaggedListenComplete(syncTree, query._path, tag); - } - else { - return syncTreeApplyListenComplete(syncTree, query._path); - } - } - else { - // If a listen failed, kill all of the listeners here, not just the one that triggered the error. - // Note that this may need to be scoped to just this listener if we change permissions on filtered children - const error = errorForServerCode(status, query); - return syncTreeRemoveEventRegistration(syncTree, query, - /*eventRegistration*/ null, error); - } - } - }; -} -/** - * Return the tag associated with the given query. - */ -function syncTreeTagForQuery(syncTree, query) { - const queryKey = syncTreeMakeQueryKey_(query); - return syncTree.queryToTagMap.get(queryKey); -} -/** - * Given a query, computes a "queryKey" suitable for use in our queryToTagMap_. - */ -function syncTreeMakeQueryKey_(query) { - return query._path.toString() + '$' + query._queryIdentifier; -} -/** - * Return the query associated with the given tag, if we have one - */ -function syncTreeQueryKeyForTag_(syncTree, tag) { - return syncTree.tagToQueryMap.get(tag); -} -/** - * Given a queryKey (created by makeQueryKey), parse it back into a path and queryId. - */ -function syncTreeParseQueryKey_(queryKey) { - const splitIndex = queryKey.indexOf('$'); - assert(splitIndex !== -1 && splitIndex < queryKey.length - 1, 'Bad queryKey.'); - return { - queryId: queryKey.substr(splitIndex + 1), - path: new Path(queryKey.substr(0, splitIndex)) - }; -} -/** - * A helper method to apply tagged operations - */ -function syncTreeApplyTaggedOperation_(syncTree, queryPath, operation) { - const syncPoint = syncTree.syncPointTree_.get(queryPath); - assert(syncPoint, "Missing sync point for query tag that we're tracking"); - const writesCache = writeTreeChildWrites(syncTree.pendingWriteTree_, queryPath); - return syncPointApplyOperation(syncPoint, operation, writesCache, null); -} -/** - * This collapses multiple unfiltered views into a single view, since we only need a single - * listener for them. - */ -function syncTreeCollectDistinctViewsForSubTree_(subtree) { - return subtree.fold((relativePath, maybeChildSyncPoint, childMap) => { - if (maybeChildSyncPoint && syncPointHasCompleteView(maybeChildSyncPoint)) { - const completeView = syncPointGetCompleteView(maybeChildSyncPoint); - return [completeView]; - } - else { - // No complete view here, flatten any deeper listens into an array - let views = []; - if (maybeChildSyncPoint) { - views = syncPointGetQueryViews(maybeChildSyncPoint); - } - each(childMap, (_key, childViews) => { - views = views.concat(childViews); - }); - return views; - } - }); -} -/** - * Normalizes a query to a query we send the server for listening - * - * @returns The normalized query - */ -function syncTreeQueryForListening_(query) { - if (query._queryParams.loadsAllData() && !query._queryParams.isDefault()) { - // We treat queries that load all data as default queries - // Cast is necessary because ref() technically returns Firebase which is actually fb.api.Firebase which inherits - // from Query - return new (syncTreeGetReferenceConstructor())(query._repo, query._path); - } - else { - return query; - } -} -function syncTreeRemoveTags_(syncTree, queries) { - for (let j = 0; j < queries.length; ++j) { - const removedQuery = queries[j]; - if (!removedQuery._queryParams.loadsAllData()) { - // We should have a tag for this - const removedQueryKey = syncTreeMakeQueryKey_(removedQuery); - const removedQueryTag = syncTree.queryToTagMap.get(removedQueryKey); - syncTree.queryToTagMap.delete(removedQueryKey); - syncTree.tagToQueryMap.delete(removedQueryTag); - } - } -} -/** - * Static accessor for query tags. - */ -function syncTreeGetNextQueryTag_() { - return syncTreeNextQueryTag_++; -} -/** - * For a given new listen, manage the de-duplication of outstanding subscriptions. - * - * @returns This method can return events to support synchronous data sources - */ -function syncTreeSetupListener_(syncTree, query, view) { - const path = query._path; - const tag = syncTreeTagForQuery(syncTree, query); - const listener = syncTreeCreateListenerForView_(syncTree, view); - const events = syncTree.listenProvider_.startListening(syncTreeQueryForListening_(query), tag, listener.hashFn, listener.onComplete); - const subtree = syncTree.syncPointTree_.subtree(path); - // The root of this subtree has our query. We're here because we definitely need to send a listen for that, but we - // may need to shadow other listens as well. - if (tag) { - assert(!syncPointHasCompleteView(subtree.value), "If we're adding a query, it shouldn't be shadowed"); - } - else { - // Shadow everything at or below this location, this is a default listener. - const queriesToStop = subtree.fold((relativePath, maybeChildSyncPoint, childMap) => { - if (!pathIsEmpty(relativePath) && - maybeChildSyncPoint && - syncPointHasCompleteView(maybeChildSyncPoint)) { - return [syncPointGetCompleteView(maybeChildSyncPoint).query]; - } - else { - // No default listener here, flatten any deeper queries into an array - let queries = []; - if (maybeChildSyncPoint) { - queries = queries.concat(syncPointGetQueryViews(maybeChildSyncPoint).map(view => view.query)); - } - each(childMap, (_key, childQueries) => { - queries = queries.concat(childQueries); - }); - return queries; - } - }); - for (let i = 0; i < queriesToStop.length; ++i) { - const queryToStop = queriesToStop[i]; - syncTree.listenProvider_.stopListening(syncTreeQueryForListening_(queryToStop), syncTreeTagForQuery(syncTree, queryToStop)); - } - } - return events; -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -class ExistingValueProvider { - constructor(node_) { - this.node_ = node_; - } - getImmediateChild(childName) { - const child = this.node_.getImmediateChild(childName); - return new ExistingValueProvider(child); - } - node() { - return this.node_; - } -} -class DeferredValueProvider { - constructor(syncTree, path) { - this.syncTree_ = syncTree; - this.path_ = path; - } - getImmediateChild(childName) { - const childPath = pathChild(this.path_, childName); - return new DeferredValueProvider(this.syncTree_, childPath); - } - node() { - return syncTreeCalcCompleteEventCache(this.syncTree_, this.path_); - } -} -/** - * Generate placeholders for deferred values. - */ -const generateWithValues = function (values) { - values = values || {}; - values['timestamp'] = values['timestamp'] || new Date().getTime(); - return values; -}; -/** - * Value to use when firing local events. When writing server values, fire - * local events with an approximate value, otherwise return value as-is. - */ -const resolveDeferredLeafValue = function (value, existingVal, serverValues) { - if (!value || typeof value !== 'object') { - return value; - } - assert('.sv' in value, 'Unexpected leaf node or priority contents'); - if (typeof value['.sv'] === 'string') { - return resolveScalarDeferredValue(value['.sv'], existingVal, serverValues); - } - else if (typeof value['.sv'] === 'object') { - return resolveComplexDeferredValue(value['.sv'], existingVal); - } - else { - assert(false, 'Unexpected server value: ' + JSON.stringify(value, null, 2)); - } -}; -const resolveScalarDeferredValue = function (op, existing, serverValues) { - switch (op) { - case 'timestamp': - return serverValues['timestamp']; - default: - assert(false, 'Unexpected server value: ' + op); - } -}; -const resolveComplexDeferredValue = function (op, existing, unused) { - if (!op.hasOwnProperty('increment')) { - assert(false, 'Unexpected server value: ' + JSON.stringify(op, null, 2)); - } - const delta = op['increment']; - if (typeof delta !== 'number') { - assert(false, 'Unexpected increment value: ' + delta); - } - const existingNode = existing.node(); - assert(existingNode !== null && typeof existingNode !== 'undefined', 'Expected ChildrenNode.EMPTY_NODE for nulls'); - // Incrementing a non-number sets the value to the incremented amount - if (!existingNode.isLeafNode()) { - return delta; - } - const leaf = existingNode; - const existingVal = leaf.getValue(); - if (typeof existingVal !== 'number') { - return delta; - } - // No need to do over/underflow arithmetic here because JS only handles floats under the covers - return existingVal + delta; -}; -/** - * Recursively replace all deferred values and priorities in the tree with the - * specified generated replacement values. - * @param path - path to which write is relative - * @param node - new data written at path - * @param syncTree - current data - */ -const resolveDeferredValueTree = function (path, node, syncTree, serverValues) { - return resolveDeferredValue(node, new DeferredValueProvider(syncTree, path), serverValues); -}; -/** - * Recursively replace all deferred values and priorities in the node with the - * specified generated replacement values. If there are no server values in the node, - * it'll be returned as-is. - */ -const resolveDeferredValueSnapshot = function (node, existing, serverValues) { - return resolveDeferredValue(node, new ExistingValueProvider(existing), serverValues); -}; -function resolveDeferredValue(node, existingVal, serverValues) { - const rawPri = node.getPriority().val(); - const priority = resolveDeferredLeafValue(rawPri, existingVal.getImmediateChild('.priority'), serverValues); - let newNode; - if (node.isLeafNode()) { - const leafNode = node; - const value = resolveDeferredLeafValue(leafNode.getValue(), existingVal, serverValues); - if (value !== leafNode.getValue() || - priority !== leafNode.getPriority().val()) { - return new LeafNode(value, nodeFromJSON(priority)); - } - else { - return node; - } - } - else { - const childrenNode = node; - newNode = childrenNode; - if (priority !== childrenNode.getPriority().val()) { - newNode = newNode.updatePriority(new LeafNode(priority)); - } - childrenNode.forEachChild(PRIORITY_INDEX, (childName, childNode) => { - const newChildNode = resolveDeferredValue(childNode, existingVal.getImmediateChild(childName), serverValues); - if (newChildNode !== childNode) { - newNode = newNode.updateImmediateChild(childName, newChildNode); - } - }); - return newNode; - } -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * A light-weight tree, traversable by path. Nodes can have both values and children. - * Nodes are not enumerated (by forEachChild) unless they have a value or non-empty - * children. - */ -class Tree { - /** - * @param name - Optional name of the node. - * @param parent - Optional parent node. - * @param node - Optional node to wrap. - */ - constructor(name = '', parent = null, node = { children: {}, childCount: 0 }) { - this.name = name; - this.parent = parent; - this.node = node; - } -} -/** - * Returns a sub-Tree for the given path. - * - * @param pathObj - Path to look up. - * @returns Tree for path. - */ -function treeSubTree(tree, pathObj) { - // TODO: Require pathObj to be Path? - let path = pathObj instanceof Path ? pathObj : new Path(pathObj); - let child = tree, next = pathGetFront(path); - while (next !== null) { - const childNode = safeGet(child.node.children, next) || { - children: {}, - childCount: 0 - }; - child = new Tree(next, child, childNode); - path = pathPopFront(path); - next = pathGetFront(path); - } - return child; -} -/** - * Returns the data associated with this tree node. - * - * @returns The data or null if no data exists. - */ -function treeGetValue(tree) { - return tree.node.value; -} -/** - * Sets data to this tree node. - * - * @param value - Value to set. - */ -function treeSetValue(tree, value) { - tree.node.value = value; - treeUpdateParents(tree); -} -/** - * @returns Whether the tree has any children. - */ -function treeHasChildren(tree) { - return tree.node.childCount > 0; -} -/** - * @returns Whethe rthe tree is empty (no value or children). - */ -function treeIsEmpty(tree) { - return treeGetValue(tree) === undefined && !treeHasChildren(tree); -} -/** - * Calls action for each child of this tree node. - * - * @param action - Action to be called for each child. - */ -function treeForEachChild(tree, action) { - each(tree.node.children, (child, childTree) => { - action(new Tree(child, tree, childTree)); - }); -} -/** - * Does a depth-first traversal of this node's descendants, calling action for each one. - * - * @param action - Action to be called for each child. - * @param includeSelf - Whether to call action on this node as well. Defaults to - * false. - * @param childrenFirst - Whether to call action on children before calling it on - * parent. - */ -function treeForEachDescendant(tree, action, includeSelf, childrenFirst) { - if (includeSelf && !childrenFirst) { - action(tree); - } - treeForEachChild(tree, child => { - treeForEachDescendant(child, action, true, childrenFirst); - }); - if (includeSelf && childrenFirst) { - action(tree); - } -} -/** - * Calls action on each ancestor node. - * - * @param action - Action to be called on each parent; return - * true to abort. - * @param includeSelf - Whether to call action on this node as well. - * @returns true if the action callback returned true. - */ -function treeForEachAncestor(tree, action, includeSelf) { - let node = includeSelf ? tree : tree.parent; - while (node !== null) { - if (action(node)) { - return true; - } - node = node.parent; - } - return false; -} -/** - * @returns The path of this tree node, as a Path. - */ -function treeGetPath(tree) { - return new Path(tree.parent === null - ? tree.name - : treeGetPath(tree.parent) + '/' + tree.name); -} -/** - * Adds or removes this child from its parent based on whether it's empty or not. - */ -function treeUpdateParents(tree) { - if (tree.parent !== null) { - treeUpdateChild(tree.parent, tree.name, tree); - } -} -/** - * Adds or removes the passed child to this tree node, depending on whether it's empty. - * - * @param childName - The name of the child to update. - * @param child - The child to update. - */ -function treeUpdateChild(tree, childName, child) { - const childEmpty = treeIsEmpty(child); - const childExists = contains(tree.node.children, childName); - if (childEmpty && childExists) { - delete tree.node.children[childName]; - tree.node.childCount--; - treeUpdateParents(tree); - } - else if (!childEmpty && !childExists) { - tree.node.children[childName] = child.node; - tree.node.childCount++; - treeUpdateParents(tree); - } -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * True for invalid Firebase keys - */ -const INVALID_KEY_REGEX_ = /[\[\].#$\/\u0000-\u001F\u007F]/; -/** - * True for invalid Firebase paths. - * Allows '/' in paths. - */ -const INVALID_PATH_REGEX_ = /[\[\].#$\u0000-\u001F\u007F]/; -/** - * Maximum number of characters to allow in leaf value - */ -const MAX_LEAF_SIZE_ = 10 * 1024 * 1024; -const isValidKey = function (key) { - return (typeof key === 'string' && key.length !== 0 && !INVALID_KEY_REGEX_.test(key)); -}; -const isValidPathString = function (pathString) { - return (typeof pathString === 'string' && - pathString.length !== 0 && - !INVALID_PATH_REGEX_.test(pathString)); -}; -const isValidRootPathString = function (pathString) { - if (pathString) { - // Allow '/.info/' at the beginning. - pathString = pathString.replace(/^\/*\.info(\/|$)/, '/'); - } - return isValidPathString(pathString); -}; -const isValidPriority = function (priority) { - return (priority === null || - typeof priority === 'string' || - (typeof priority === 'number' && !isInvalidJSONNumber(priority)) || - (priority && - typeof priority === 'object' && - // eslint-disable-next-line @typescript-eslint/no-explicit-any - contains(priority, '.sv'))); -}; -/** - * Pre-validate a datum passed as an argument to Firebase function. - */ -const validateFirebaseDataArg = function (fnName, value, path, optional) { - if (optional && value === undefined) { - return; - } - validateFirebaseData(errorPrefix(fnName, 'value'), value, path); -}; -/** - * Validate a data object client-side before sending to server. - */ -const validateFirebaseData = function (errorPrefix, data, path_) { - const path = path_ instanceof Path ? new ValidationPath(path_, errorPrefix) : path_; - if (data === undefined) { - throw new Error(errorPrefix + 'contains undefined ' + validationPathToErrorString(path)); - } - if (typeof data === 'function') { - throw new Error(errorPrefix + - 'contains a function ' + - validationPathToErrorString(path) + - ' with contents = ' + - data.toString()); - } - if (isInvalidJSONNumber(data)) { - throw new Error(errorPrefix + - 'contains ' + - data.toString() + - ' ' + - validationPathToErrorString(path)); - } - // Check max leaf size, but try to avoid the utf8 conversion if we can. - if (typeof data === 'string' && - data.length > MAX_LEAF_SIZE_ / 3 && - stringLength(data) > MAX_LEAF_SIZE_) { - throw new Error(errorPrefix + - 'contains a string greater than ' + - MAX_LEAF_SIZE_ + - ' utf8 bytes ' + - validationPathToErrorString(path) + - " ('" + - data.substring(0, 50) + - "...')"); - } - // TODO = Perf = Consider combining the recursive validation of keys into NodeFromJSON - // to save extra walking of large objects. - if (data && typeof data === 'object') { - let hasDotValue = false; - let hasActualChild = false; - each(data, (key, value) => { - if (key === '.value') { - hasDotValue = true; - } - else if (key !== '.priority' && key !== '.sv') { - hasActualChild = true; - if (!isValidKey(key)) { - throw new Error(errorPrefix + - ' contains an invalid key (' + - key + - ') ' + - validationPathToErrorString(path) + - '. Keys must be non-empty strings ' + - 'and can\'t contain ".", "#", "$", "/", "[", or "]"'); - } - } - validationPathPush(path, key); - validateFirebaseData(errorPrefix, value, path); - validationPathPop(path); - }); - if (hasDotValue && hasActualChild) { - throw new Error(errorPrefix + - ' contains ".value" child ' + - validationPathToErrorString(path) + - ' in addition to actual children.'); - } - } -}; -/** - * Pre-validate paths passed in the firebase function. - */ -const validateFirebaseMergePaths = function (errorPrefix, mergePaths) { - let i, curPath; - for (i = 0; i < mergePaths.length; i++) { - curPath = mergePaths[i]; - const keys = pathSlice(curPath); - for (let j = 0; j < keys.length; j++) { - if (keys[j] === '.priority' && j === keys.length - 1) ; - else if (!isValidKey(keys[j])) { - throw new Error(errorPrefix + - 'contains an invalid key (' + - keys[j] + - ') in path ' + - curPath.toString() + - '. Keys must be non-empty strings ' + - 'and can\'t contain ".", "#", "$", "/", "[", or "]"'); - } - } - } - // Check that update keys are not descendants of each other. - // We rely on the property that sorting guarantees that ancestors come - // right before descendants. - mergePaths.sort(pathCompare); - let prevPath = null; - for (i = 0; i < mergePaths.length; i++) { - curPath = mergePaths[i]; - if (prevPath !== null && pathContains(prevPath, curPath)) { - throw new Error(errorPrefix + - 'contains a path ' + - prevPath.toString() + - ' that is ancestor of another path ' + - curPath.toString()); - } - prevPath = curPath; - } -}; -/** - * pre-validate an object passed as an argument to firebase function ( - * must be an object - e.g. for firebase.update()). - */ -const validateFirebaseMergeDataArg = function (fnName, data, path, optional) { - if (optional && data === undefined) { - return; - } - const errorPrefix$1 = errorPrefix(fnName, 'values'); - if (!(data && typeof data === 'object') || Array.isArray(data)) { - throw new Error(errorPrefix$1 + ' must be an object containing the children to replace.'); - } - const mergePaths = []; - each(data, (key, value) => { - const curPath = new Path(key); - validateFirebaseData(errorPrefix$1, value, pathChild(path, curPath)); - if (pathGetBack(curPath) === '.priority') { - if (!isValidPriority(value)) { - throw new Error(errorPrefix$1 + - "contains an invalid value for '" + - curPath.toString() + - "', which must be a valid " + - 'Firebase priority (a string, finite number, server value, or null).'); - } - } - mergePaths.push(curPath); - }); - validateFirebaseMergePaths(errorPrefix$1, mergePaths); -}; -const validatePriority = function (fnName, priority, optional) { - if (optional && priority === undefined) { - return; - } - if (isInvalidJSONNumber(priority)) { - throw new Error(errorPrefix(fnName, 'priority') + - 'is ' + - priority.toString() + - ', but must be a valid Firebase priority (a string, finite number, ' + - 'server value, or null).'); - } - // Special case to allow importing data with a .sv. - if (!isValidPriority(priority)) { - throw new Error(errorPrefix(fnName, 'priority') + - 'must be a valid Firebase priority ' + - '(a string, finite number, server value, or null).'); - } -}; -const validateKey = function (fnName, argumentName, key, optional) { - if (optional && key === undefined) { - return; - } - if (!isValidKey(key)) { - throw new Error(errorPrefix(fnName, argumentName) + - 'was an invalid key = "' + - key + - '". Firebase keys must be non-empty strings and ' + - 'can\'t contain ".", "#", "$", "/", "[", or "]").'); - } -}; -/** - * @internal - */ -const validatePathString = function (fnName, argumentName, pathString, optional) { - if (optional && pathString === undefined) { - return; - } - if (!isValidPathString(pathString)) { - throw new Error(errorPrefix(fnName, argumentName) + - 'was an invalid path = "' + - pathString + - '". Paths must be non-empty strings and ' + - 'can\'t contain ".", "#", "$", "[", or "]"'); - } -}; -const validateRootPathString = function (fnName, argumentName, pathString, optional) { - if (pathString) { - // Allow '/.info/' at the beginning. - pathString = pathString.replace(/^\/*\.info(\/|$)/, '/'); - } - validatePathString(fnName, argumentName, pathString, optional); -}; -/** - * @internal - */ -const validateWritablePath = function (fnName, path) { - if (pathGetFront(path) === '.info') { - throw new Error(fnName + " failed = Can't modify data under /.info/"); - } -}; -const validateUrl = function (fnName, parsedUrl) { - // TODO = Validate server better. - const pathString = parsedUrl.path.toString(); - if (!(typeof parsedUrl.repoInfo.host === 'string') || - parsedUrl.repoInfo.host.length === 0 || - (!isValidKey(parsedUrl.repoInfo.namespace) && - parsedUrl.repoInfo.host.split(':')[0] !== 'localhost') || - (pathString.length !== 0 && !isValidRootPathString(pathString))) { - throw new Error(errorPrefix(fnName, 'url') + - 'must be a valid firebase URL and ' + - 'the path can\'t contain ".", "#", "$", "[", or "]".'); - } -}; - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * The event queue serves a few purposes: - * 1. It ensures we maintain event order in the face of event callbacks doing operations that result in more - * events being queued. - * 2. raiseQueuedEvents() handles being called reentrantly nicely. That is, if in the course of raising events, - * raiseQueuedEvents() is called again, the "inner" call will pick up raising events where the "outer" call - * left off, ensuring that the events are still raised synchronously and in order. - * 3. You can use raiseEventsAtPath and raiseEventsForChangedPath to ensure only relevant previously-queued - * events are raised synchronously. - * - * NOTE: This can all go away if/when we move to async events. - * - */ -class EventQueue { - constructor() { - this.eventLists_ = []; - /** - * Tracks recursion depth of raiseQueuedEvents_, for debugging purposes. - */ - this.recursionDepth_ = 0; - } -} -/** - * @param eventDataList - The new events to queue. - */ -function eventQueueQueueEvents(eventQueue, eventDataList) { - // We group events by path, storing them in a single EventList, to make it easier to skip over them quickly. - let currList = null; - for (let i = 0; i < eventDataList.length; i++) { - const data = eventDataList[i]; - const path = data.getPath(); - if (currList !== null && !pathEquals(path, currList.path)) { - eventQueue.eventLists_.push(currList); - currList = null; - } - if (currList === null) { - currList = { events: [], path }; - } - currList.events.push(data); - } - if (currList) { - eventQueue.eventLists_.push(currList); - } -} -/** - * Queues the specified events and synchronously raises all events (including previously queued ones) - * for the specified path. - * - * It is assumed that the new events are all for the specified path. - * - * @param path - The path to raise events for. - * @param eventDataList - The new events to raise. - */ -function eventQueueRaiseEventsAtPath(eventQueue, path, eventDataList) { - eventQueueQueueEvents(eventQueue, eventDataList); - eventQueueRaiseQueuedEventsMatchingPredicate(eventQueue, eventPath => pathEquals(eventPath, path)); -} -/** - * Queues the specified events and synchronously raises all events (including previously queued ones) for - * locations related to the specified change path (i.e. all ancestors and descendants). - * - * It is assumed that the new events are all related (ancestor or descendant) to the specified path. - * - * @param changedPath - The path to raise events for. - * @param eventDataList - The events to raise - */ -function eventQueueRaiseEventsForChangedPath(eventQueue, changedPath, eventDataList) { - eventQueueQueueEvents(eventQueue, eventDataList); - eventQueueRaiseQueuedEventsMatchingPredicate(eventQueue, eventPath => pathContains(eventPath, changedPath) || - pathContains(changedPath, eventPath)); -} -function eventQueueRaiseQueuedEventsMatchingPredicate(eventQueue, predicate) { - eventQueue.recursionDepth_++; - let sentAll = true; - for (let i = 0; i < eventQueue.eventLists_.length; i++) { - const eventList = eventQueue.eventLists_[i]; - if (eventList) { - const eventPath = eventList.path; - if (predicate(eventPath)) { - eventListRaise(eventQueue.eventLists_[i]); - eventQueue.eventLists_[i] = null; - } - else { - sentAll = false; - } - } - } - if (sentAll) { - eventQueue.eventLists_ = []; - } - eventQueue.recursionDepth_--; -} -/** - * Iterates through the list and raises each event - */ -function eventListRaise(eventList) { - for (let i = 0; i < eventList.events.length; i++) { - const eventData = eventList.events[i]; - if (eventData !== null) { - eventList.events[i] = null; - const eventFn = eventData.getEventRunner(); - if (logger) { - log('event: ' + eventData.toString()); - } - exceptionGuard(eventFn); - } - } -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -const INTERRUPT_REASON = 'repo_interrupt'; -/** - * If a transaction does not succeed after 25 retries, we abort it. Among other - * things this ensure that if there's ever a bug causing a mismatch between - * client / server hashes for some data, we won't retry indefinitely. - */ -const MAX_TRANSACTION_RETRIES = 25; -/** - * A connection to a single data repository. - */ -class Repo { - constructor(repoInfo_, forceRestClient_, authTokenProvider_, appCheckProvider_) { - this.repoInfo_ = repoInfo_; - this.forceRestClient_ = forceRestClient_; - this.authTokenProvider_ = authTokenProvider_; - this.appCheckProvider_ = appCheckProvider_; - this.dataUpdateCount = 0; - this.statsListener_ = null; - this.eventQueue_ = new EventQueue(); - this.nextWriteId_ = 1; - this.interceptServerDataCallback_ = null; - /** A list of data pieces and paths to be set when this client disconnects. */ - this.onDisconnect_ = newSparseSnapshotTree(); - /** Stores queues of outstanding transactions for Firebase locations. */ - this.transactionQueueTree_ = new Tree(); - // TODO: This should be @private but it's used by test_access.js and internal.js - this.persistentConnection_ = null; - // This key is intentionally not updated if RepoInfo is later changed or replaced - this.key = this.repoInfo_.toURLString(); - } - /** - * @returns The URL corresponding to the root of this Firebase. - */ - toString() { - return ((this.repoInfo_.secure ? 'https://' : 'http://') + this.repoInfo_.host); - } -} -function repoStart(repo, appId, authOverride) { - repo.stats_ = statsManagerGetCollection(repo.repoInfo_); - if (repo.forceRestClient_ || beingCrawled()) { - repo.server_ = new ReadonlyRestClient(repo.repoInfo_, (pathString, data, isMerge, tag) => { - repoOnDataUpdate(repo, pathString, data, isMerge, tag); - }, repo.authTokenProvider_, repo.appCheckProvider_); - // Minor hack: Fire onConnect immediately, since there's no actual connection. - setTimeout(() => repoOnConnectStatus(repo, /* connectStatus= */ true), 0); - } - else { - // Validate authOverride - if (typeof authOverride !== 'undefined' && authOverride !== null) { - if (typeof authOverride !== 'object') { - throw new Error('Only objects are supported for option databaseAuthVariableOverride'); - } - try { - stringify(authOverride); - } - catch (e) { - throw new Error('Invalid authOverride provided: ' + e); - } - } - repo.persistentConnection_ = new PersistentConnection(repo.repoInfo_, appId, (pathString, data, isMerge, tag) => { - repoOnDataUpdate(repo, pathString, data, isMerge, tag); - }, (connectStatus) => { - repoOnConnectStatus(repo, connectStatus); - }, (updates) => { - repoOnServerInfoUpdate(repo, updates); - }, repo.authTokenProvider_, repo.appCheckProvider_, authOverride); - repo.server_ = repo.persistentConnection_; - } - repo.authTokenProvider_.addTokenChangeListener(token => { - repo.server_.refreshAuthToken(token); - }); - repo.appCheckProvider_.addTokenChangeListener(result => { - repo.server_.refreshAppCheckToken(result.token); - }); - // In the case of multiple Repos for the same repoInfo (i.e. there are multiple Firebase.Contexts being used), - // we only want to create one StatsReporter. As such, we'll report stats over the first Repo created. - repo.statsReporter_ = statsManagerGetOrCreateReporter(repo.repoInfo_, () => new StatsReporter(repo.stats_, repo.server_)); - // Used for .info. - repo.infoData_ = new SnapshotHolder(); - repo.infoSyncTree_ = new SyncTree({ - startListening: (query, tag, currentHashFn, onComplete) => { - let infoEvents = []; - const node = repo.infoData_.getNode(query._path); - // This is possibly a hack, but we have different semantics for .info endpoints. We don't raise null events - // on initial data... - if (!node.isEmpty()) { - infoEvents = syncTreeApplyServerOverwrite(repo.infoSyncTree_, query._path, node); - setTimeout(() => { - onComplete('ok'); - }, 0); - } - return infoEvents; - }, - stopListening: () => { } - }); - repoUpdateInfo(repo, 'connected', false); - repo.serverSyncTree_ = new SyncTree({ - startListening: (query, tag, currentHashFn, onComplete) => { - repo.server_.listen(query, currentHashFn, tag, (status, data) => { - const events = onComplete(status, data); - eventQueueRaiseEventsForChangedPath(repo.eventQueue_, query._path, events); - }); - // No synchronous events for network-backed sync trees - return []; - }, - stopListening: (query, tag) => { - repo.server_.unlisten(query, tag); - } - }); -} -/** - * @returns The time in milliseconds, taking the server offset into account if we have one. - */ -function repoServerTime(repo) { - const offsetNode = repo.infoData_.getNode(new Path('.info/serverTimeOffset')); - const offset = offsetNode.val() || 0; - return new Date().getTime() + offset; -} -/** - * Generate ServerValues using some variables from the repo object. - */ -function repoGenerateServerValues(repo) { - return generateWithValues({ - timestamp: repoServerTime(repo) - }); -} -/** - * Called by realtime when we get new messages from the server. - */ -function repoOnDataUpdate(repo, pathString, data, isMerge, tag) { - // For testing. - repo.dataUpdateCount++; - const path = new Path(pathString); - data = repo.interceptServerDataCallback_ - ? repo.interceptServerDataCallback_(pathString, data) - : data; - let events = []; - if (tag) { - if (isMerge) { - const taggedChildren = map(data, (raw) => nodeFromJSON(raw)); - events = syncTreeApplyTaggedQueryMerge(repo.serverSyncTree_, path, taggedChildren, tag); - } - else { - const taggedSnap = nodeFromJSON(data); - events = syncTreeApplyTaggedQueryOverwrite(repo.serverSyncTree_, path, taggedSnap, tag); - } - } - else if (isMerge) { - const changedChildren = map(data, (raw) => nodeFromJSON(raw)); - events = syncTreeApplyServerMerge(repo.serverSyncTree_, path, changedChildren); - } - else { - const snap = nodeFromJSON(data); - events = syncTreeApplyServerOverwrite(repo.serverSyncTree_, path, snap); - } - let affectedPath = path; - if (events.length > 0) { - // Since we have a listener outstanding for each transaction, receiving any events - // is a proxy for some change having occurred. - affectedPath = repoRerunTransactions(repo, path); - } - eventQueueRaiseEventsForChangedPath(repo.eventQueue_, affectedPath, events); -} -function repoOnConnectStatus(repo, connectStatus) { - repoUpdateInfo(repo, 'connected', connectStatus); - if (connectStatus === false) { - repoRunOnDisconnectEvents(repo); - } -} -function repoOnServerInfoUpdate(repo, updates) { - each(updates, (key, value) => { - repoUpdateInfo(repo, key, value); - }); -} -function repoUpdateInfo(repo, pathString, value) { - const path = new Path('/.info/' + pathString); - const newNode = nodeFromJSON(value); - repo.infoData_.updateSnapshot(path, newNode); - const events = syncTreeApplyServerOverwrite(repo.infoSyncTree_, path, newNode); - eventQueueRaiseEventsForChangedPath(repo.eventQueue_, path, events); -} -function repoGetNextWriteId(repo) { - return repo.nextWriteId_++; -} -/** - * The purpose of `getValue` is to return the latest known value - * satisfying `query`. - * - * This method will first check for in-memory cached values - * belonging to active listeners. If they are found, such values - * are considered to be the most up-to-date. - * - * If the client is not connected, this method will wait until the - * repo has established a connection and then request the value for `query`. - * If the client is not able to retrieve the query result for another reason, - * it reports an error. - * - * @param query - The query to surface a value for. - */ -function repoGetValue(repo, query, eventRegistration) { - // Only active queries are cached. There is no persisted cache. - const cached = syncTreeGetServerValue(repo.serverSyncTree_, query); - if (cached != null) { - return Promise.resolve(cached); - } - return repo.server_.get(query).then(payload => { - const node = nodeFromJSON(payload).withIndex(query._queryParams.getIndex()); - /** - * Below we simulate the actions of an `onlyOnce` `onValue()` event where: - * Add an event registration, - * Update data at the path, - * Raise any events, - * Cleanup the SyncTree - */ - syncTreeAddEventRegistration(repo.serverSyncTree_, query, eventRegistration, true); - let events; - if (query._queryParams.loadsAllData()) { - events = syncTreeApplyServerOverwrite(repo.serverSyncTree_, query._path, node); - } - else { - const tag = syncTreeTagForQuery(repo.serverSyncTree_, query); - events = syncTreeApplyTaggedQueryOverwrite(repo.serverSyncTree_, query._path, node, tag); - } - /* - * We need to raise events in the scenario where `get()` is called at a parent path, and - * while the `get()` is pending, `onValue` is called at a child location. While get() is waiting - * for the data, `onValue` will register a new event. Then, get() will come back, and update the syncTree - * and its corresponding serverCache, including the child location where `onValue` is called. Then, - * `onValue` will receive the event from the server, but look at the syncTree and see that the data received - * from the server is already at the SyncPoint, and so the `onValue` callback will never get fired. - * Calling `eventQueueRaiseEventsForChangedPath()` is the correct way to propagate the events and - * ensure the corresponding child events will get fired. - */ - eventQueueRaiseEventsForChangedPath(repo.eventQueue_, query._path, events); - syncTreeRemoveEventRegistration(repo.serverSyncTree_, query, eventRegistration, null, true); - return node; - }, err => { - repoLog(repo, 'get for query ' + stringify(query) + ' failed: ' + err); - return Promise.reject(new Error(err)); - }); -} -function repoSetWithPriority(repo, path, newVal, newPriority, onComplete) { - repoLog(repo, 'set', { - path: path.toString(), - value: newVal, - priority: newPriority - }); - // TODO: Optimize this behavior to either (a) store flag to skip resolving where possible and / or - // (b) store unresolved paths on JSON parse - const serverValues = repoGenerateServerValues(repo); - const newNodeUnresolved = nodeFromJSON(newVal, newPriority); - const existing = syncTreeCalcCompleteEventCache(repo.serverSyncTree_, path); - const newNode = resolveDeferredValueSnapshot(newNodeUnresolved, existing, serverValues); - const writeId = repoGetNextWriteId(repo); - const events = syncTreeApplyUserOverwrite(repo.serverSyncTree_, path, newNode, writeId, true); - eventQueueQueueEvents(repo.eventQueue_, events); - repo.server_.put(path.toString(), newNodeUnresolved.val(/*export=*/ true), (status, errorReason) => { - const success = status === 'ok'; - if (!success) { - warn('set at ' + path + ' failed: ' + status); - } - const clearEvents = syncTreeAckUserWrite(repo.serverSyncTree_, writeId, !success); - eventQueueRaiseEventsForChangedPath(repo.eventQueue_, path, clearEvents); - repoCallOnCompleteCallback(repo, onComplete, status, errorReason); - }); - const affectedPath = repoAbortTransactions(repo, path); - repoRerunTransactions(repo, affectedPath); - // We queued the events above, so just flush the queue here - eventQueueRaiseEventsForChangedPath(repo.eventQueue_, affectedPath, []); -} -function repoUpdate(repo, path, childrenToMerge, onComplete) { - repoLog(repo, 'update', { path: path.toString(), value: childrenToMerge }); - // Start with our existing data and merge each child into it. - let empty = true; - const serverValues = repoGenerateServerValues(repo); - const changedChildren = {}; - each(childrenToMerge, (changedKey, changedValue) => { - empty = false; - changedChildren[changedKey] = resolveDeferredValueTree(pathChild(path, changedKey), nodeFromJSON(changedValue), repo.serverSyncTree_, serverValues); - }); - if (!empty) { - const writeId = repoGetNextWriteId(repo); - const events = syncTreeApplyUserMerge(repo.serverSyncTree_, path, changedChildren, writeId); - eventQueueQueueEvents(repo.eventQueue_, events); - repo.server_.merge(path.toString(), childrenToMerge, (status, errorReason) => { - const success = status === 'ok'; - if (!success) { - warn('update at ' + path + ' failed: ' + status); - } - const clearEvents = syncTreeAckUserWrite(repo.serverSyncTree_, writeId, !success); - const affectedPath = clearEvents.length > 0 ? repoRerunTransactions(repo, path) : path; - eventQueueRaiseEventsForChangedPath(repo.eventQueue_, affectedPath, clearEvents); - repoCallOnCompleteCallback(repo, onComplete, status, errorReason); - }); - each(childrenToMerge, (changedPath) => { - const affectedPath = repoAbortTransactions(repo, pathChild(path, changedPath)); - repoRerunTransactions(repo, affectedPath); - }); - // We queued the events above, so just flush the queue here - eventQueueRaiseEventsForChangedPath(repo.eventQueue_, path, []); - } - else { - log("update() called with empty data. Don't do anything."); - repoCallOnCompleteCallback(repo, onComplete, 'ok', undefined); - } -} -/** - * Applies all of the changes stored up in the onDisconnect_ tree. - */ -function repoRunOnDisconnectEvents(repo) { - repoLog(repo, 'onDisconnectEvents'); - const serverValues = repoGenerateServerValues(repo); - const resolvedOnDisconnectTree = newSparseSnapshotTree(); - sparseSnapshotTreeForEachTree(repo.onDisconnect_, newEmptyPath(), (path, node) => { - const resolved = resolveDeferredValueTree(path, node, repo.serverSyncTree_, serverValues); - sparseSnapshotTreeRemember(resolvedOnDisconnectTree, path, resolved); - }); - let events = []; - sparseSnapshotTreeForEachTree(resolvedOnDisconnectTree, newEmptyPath(), (path, snap) => { - events = events.concat(syncTreeApplyServerOverwrite(repo.serverSyncTree_, path, snap)); - const affectedPath = repoAbortTransactions(repo, path); - repoRerunTransactions(repo, affectedPath); - }); - repo.onDisconnect_ = newSparseSnapshotTree(); - eventQueueRaiseEventsForChangedPath(repo.eventQueue_, newEmptyPath(), events); -} -function repoOnDisconnectCancel(repo, path, onComplete) { - repo.server_.onDisconnectCancel(path.toString(), (status, errorReason) => { - if (status === 'ok') { - sparseSnapshotTreeForget(repo.onDisconnect_, path); - } - repoCallOnCompleteCallback(repo, onComplete, status, errorReason); - }); -} -function repoOnDisconnectSet(repo, path, value, onComplete) { - const newNode = nodeFromJSON(value); - repo.server_.onDisconnectPut(path.toString(), newNode.val(/*export=*/ true), (status, errorReason) => { - if (status === 'ok') { - sparseSnapshotTreeRemember(repo.onDisconnect_, path, newNode); - } - repoCallOnCompleteCallback(repo, onComplete, status, errorReason); - }); -} -function repoOnDisconnectSetWithPriority(repo, path, value, priority, onComplete) { - const newNode = nodeFromJSON(value, priority); - repo.server_.onDisconnectPut(path.toString(), newNode.val(/*export=*/ true), (status, errorReason) => { - if (status === 'ok') { - sparseSnapshotTreeRemember(repo.onDisconnect_, path, newNode); - } - repoCallOnCompleteCallback(repo, onComplete, status, errorReason); - }); -} -function repoOnDisconnectUpdate(repo, path, childrenToMerge, onComplete) { - if (isEmpty(childrenToMerge)) { - log("onDisconnect().update() called with empty data. Don't do anything."); - repoCallOnCompleteCallback(repo, onComplete, 'ok', undefined); - return; - } - repo.server_.onDisconnectMerge(path.toString(), childrenToMerge, (status, errorReason) => { - if (status === 'ok') { - each(childrenToMerge, (childName, childNode) => { - const newChildNode = nodeFromJSON(childNode); - sparseSnapshotTreeRemember(repo.onDisconnect_, pathChild(path, childName), newChildNode); - }); - } - repoCallOnCompleteCallback(repo, onComplete, status, errorReason); - }); -} -function repoAddEventCallbackForQuery(repo, query, eventRegistration) { - let events; - if (pathGetFront(query._path) === '.info') { - events = syncTreeAddEventRegistration(repo.infoSyncTree_, query, eventRegistration); - } - else { - events = syncTreeAddEventRegistration(repo.serverSyncTree_, query, eventRegistration); - } - eventQueueRaiseEventsAtPath(repo.eventQueue_, query._path, events); -} -function repoRemoveEventCallbackForQuery(repo, query, eventRegistration) { - // These are guaranteed not to raise events, since we're not passing in a cancelError. However, we can future-proof - // a little bit by handling the return values anyways. - let events; - if (pathGetFront(query._path) === '.info') { - events = syncTreeRemoveEventRegistration(repo.infoSyncTree_, query, eventRegistration); - } - else { - events = syncTreeRemoveEventRegistration(repo.serverSyncTree_, query, eventRegistration); - } - eventQueueRaiseEventsAtPath(repo.eventQueue_, query._path, events); -} -function repoInterrupt(repo) { - if (repo.persistentConnection_) { - repo.persistentConnection_.interrupt(INTERRUPT_REASON); - } -} -function repoResume(repo) { - if (repo.persistentConnection_) { - repo.persistentConnection_.resume(INTERRUPT_REASON); - } -} -function repoLog(repo, ...varArgs) { - let prefix = ''; - if (repo.persistentConnection_) { - prefix = repo.persistentConnection_.id + ':'; - } - log(prefix, ...varArgs); -} -function repoCallOnCompleteCallback(repo, callback, status, errorReason) { - if (callback) { - exceptionGuard(() => { - if (status === 'ok') { - callback(null); - } - else { - const code = (status || 'error').toUpperCase(); - let message = code; - if (errorReason) { - message += ': ' + errorReason; - } - const error = new Error(message); - // eslint-disable-next-line @typescript-eslint/no-explicit-any - error.code = code; - callback(error); - } - }); - } -} -/** - * Creates a new transaction, adds it to the transactions we're tracking, and - * sends it to the server if possible. - * - * @param path - Path at which to do transaction. - * @param transactionUpdate - Update callback. - * @param onComplete - Completion callback. - * @param unwatcher - Function that will be called when the transaction no longer - * need data updates for `path`. - * @param applyLocally - Whether or not to make intermediate results visible - */ -function repoStartTransaction(repo, path, transactionUpdate, onComplete, unwatcher, applyLocally) { - repoLog(repo, 'transaction on ' + path); - // Initialize transaction. - const transaction = { - path, - update: transactionUpdate, - onComplete, - // One of TransactionStatus enums. - status: null, - // Used when combining transactions at different locations to figure out - // which one goes first. - order: LUIDGenerator(), - // Whether to raise local events for this transaction. - applyLocally, - // Count of how many times we've retried the transaction. - retryCount: 0, - // Function to call to clean up our .on() listener. - unwatcher, - // Stores why a transaction was aborted. - abortReason: null, - currentWriteId: null, - currentInputSnapshot: null, - currentOutputSnapshotRaw: null, - currentOutputSnapshotResolved: null - }; - // Run transaction initially. - const currentState = repoGetLatestState(repo, path, undefined); - transaction.currentInputSnapshot = currentState; - const newVal = transaction.update(currentState.val()); - if (newVal === undefined) { - // Abort transaction. - transaction.unwatcher(); - transaction.currentOutputSnapshotRaw = null; - transaction.currentOutputSnapshotResolved = null; - if (transaction.onComplete) { - transaction.onComplete(null, false, transaction.currentInputSnapshot); - } - } - else { - validateFirebaseData('transaction failed: Data returned ', newVal, transaction.path); - // Mark as run and add to our queue. - transaction.status = 0 /* RUN */; - const queueNode = treeSubTree(repo.transactionQueueTree_, path); - const nodeQueue = treeGetValue(queueNode) || []; - nodeQueue.push(transaction); - treeSetValue(queueNode, nodeQueue); - // Update visibleData and raise events - // Note: We intentionally raise events after updating all of our - // transaction state, since the user could start new transactions from the - // event callbacks. - let priorityForNode; - if (typeof newVal === 'object' && - newVal !== null && - contains(newVal, '.priority')) { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - priorityForNode = safeGet(newVal, '.priority'); - assert(isValidPriority(priorityForNode), 'Invalid priority returned by transaction. ' + - 'Priority must be a valid string, finite number, server value, or null.'); - } - else { - const currentNode = syncTreeCalcCompleteEventCache(repo.serverSyncTree_, path) || - ChildrenNode.EMPTY_NODE; - priorityForNode = currentNode.getPriority().val(); - } - const serverValues = repoGenerateServerValues(repo); - const newNodeUnresolved = nodeFromJSON(newVal, priorityForNode); - const newNode = resolveDeferredValueSnapshot(newNodeUnresolved, currentState, serverValues); - transaction.currentOutputSnapshotRaw = newNodeUnresolved; - transaction.currentOutputSnapshotResolved = newNode; - transaction.currentWriteId = repoGetNextWriteId(repo); - const events = syncTreeApplyUserOverwrite(repo.serverSyncTree_, path, newNode, transaction.currentWriteId, transaction.applyLocally); - eventQueueRaiseEventsForChangedPath(repo.eventQueue_, path, events); - repoSendReadyTransactions(repo, repo.transactionQueueTree_); - } -} -/** - * @param excludeSets - A specific set to exclude - */ -function repoGetLatestState(repo, path, excludeSets) { - return (syncTreeCalcCompleteEventCache(repo.serverSyncTree_, path, excludeSets) || - ChildrenNode.EMPTY_NODE); -} -/** - * Sends any already-run transactions that aren't waiting for outstanding - * transactions to complete. - * - * Externally it's called with no arguments, but it calls itself recursively - * with a particular transactionQueueTree node to recurse through the tree. - * - * @param node - transactionQueueTree node to start at. - */ -function repoSendReadyTransactions(repo, node = repo.transactionQueueTree_) { - // Before recursing, make sure any completed transactions are removed. - if (!node) { - repoPruneCompletedTransactionsBelowNode(repo, node); - } - if (treeGetValue(node)) { - const queue = repoBuildTransactionQueue(repo, node); - assert(queue.length > 0, 'Sending zero length transaction queue'); - const allRun = queue.every((transaction) => transaction.status === 0 /* RUN */); - // If they're all run (and not sent), we can send them. Else, we must wait. - if (allRun) { - repoSendTransactionQueue(repo, treeGetPath(node), queue); - } - } - else if (treeHasChildren(node)) { - treeForEachChild(node, childNode => { - repoSendReadyTransactions(repo, childNode); - }); - } -} -/** - * Given a list of run transactions, send them to the server and then handle - * the result (success or failure). - * - * @param path - The location of the queue. - * @param queue - Queue of transactions under the specified location. - */ -function repoSendTransactionQueue(repo, path, queue) { - // Mark transactions as sent and increment retry count! - const setsToIgnore = queue.map(txn => { - return txn.currentWriteId; - }); - const latestState = repoGetLatestState(repo, path, setsToIgnore); - let snapToSend = latestState; - const latestHash = latestState.hash(); - for (let i = 0; i < queue.length; i++) { - const txn = queue[i]; - assert(txn.status === 0 /* RUN */, 'tryToSendTransactionQueue_: items in queue should all be run.'); - txn.status = 1 /* SENT */; - txn.retryCount++; - const relativePath = newRelativePath(path, txn.path); - // If we've gotten to this point, the output snapshot must be defined. - snapToSend = snapToSend.updateChild(relativePath /** @type {!Node} */, txn.currentOutputSnapshotRaw); - } - const dataToSend = snapToSend.val(true); - const pathToSend = path; - // Send the put. - repo.server_.put(pathToSend.toString(), dataToSend, (status) => { - repoLog(repo, 'transaction put response', { - path: pathToSend.toString(), - status - }); - let events = []; - if (status === 'ok') { - // Queue up the callbacks and fire them after cleaning up all of our - // transaction state, since the callback could trigger more - // transactions or sets. - const callbacks = []; - for (let i = 0; i < queue.length; i++) { - queue[i].status = 2 /* COMPLETED */; - events = events.concat(syncTreeAckUserWrite(repo.serverSyncTree_, queue[i].currentWriteId)); - if (queue[i].onComplete) { - // We never unset the output snapshot, and given that this - // transaction is complete, it should be set - callbacks.push(() => queue[i].onComplete(null, true, queue[i].currentOutputSnapshotResolved)); - } - queue[i].unwatcher(); - } - // Now remove the completed transactions. - repoPruneCompletedTransactionsBelowNode(repo, treeSubTree(repo.transactionQueueTree_, path)); - // There may be pending transactions that we can now send. - repoSendReadyTransactions(repo, repo.transactionQueueTree_); - eventQueueRaiseEventsForChangedPath(repo.eventQueue_, path, events); - // Finally, trigger onComplete callbacks. - for (let i = 0; i < callbacks.length; i++) { - exceptionGuard(callbacks[i]); - } - } - else { - // transactions are no longer sent. Update their status appropriately. - if (status === 'datastale') { - for (let i = 0; i < queue.length; i++) { - if (queue[i].status === 3 /* SENT_NEEDS_ABORT */) { - queue[i].status = 4 /* NEEDS_ABORT */; - } - else { - queue[i].status = 0 /* RUN */; - } - } - } - else { - warn('transaction at ' + pathToSend.toString() + ' failed: ' + status); - for (let i = 0; i < queue.length; i++) { - queue[i].status = 4 /* NEEDS_ABORT */; - queue[i].abortReason = status; - } - } - repoRerunTransactions(repo, path); - } - }, latestHash); -} -/** - * Finds all transactions dependent on the data at changedPath and reruns them. - * - * Should be called any time cached data changes. - * - * Return the highest path that was affected by rerunning transactions. This - * is the path at which events need to be raised for. - * - * @param changedPath - The path in mergedData that changed. - * @returns The rootmost path that was affected by rerunning transactions. - */ -function repoRerunTransactions(repo, changedPath) { - const rootMostTransactionNode = repoGetAncestorTransactionNode(repo, changedPath); - const path = treeGetPath(rootMostTransactionNode); - const queue = repoBuildTransactionQueue(repo, rootMostTransactionNode); - repoRerunTransactionQueue(repo, queue, path); - return path; -} -/** - * Does all the work of rerunning transactions (as well as cleans up aborted - * transactions and whatnot). - * - * @param queue - The queue of transactions to run. - * @param path - The path the queue is for. - */ -function repoRerunTransactionQueue(repo, queue, path) { - if (queue.length === 0) { - return; // Nothing to do! - } - // Queue up the callbacks and fire them after cleaning up all of our - // transaction state, since the callback could trigger more transactions or - // sets. - const callbacks = []; - let events = []; - // Ignore all of the sets we're going to re-run. - const txnsToRerun = queue.filter(q => { - return q.status === 0 /* RUN */; - }); - const setsToIgnore = txnsToRerun.map(q => { - return q.currentWriteId; - }); - for (let i = 0; i < queue.length; i++) { - const transaction = queue[i]; - const relativePath = newRelativePath(path, transaction.path); - let abortTransaction = false, abortReason; - assert(relativePath !== null, 'rerunTransactionsUnderNode_: relativePath should not be null.'); - if (transaction.status === 4 /* NEEDS_ABORT */) { - abortTransaction = true; - abortReason = transaction.abortReason; - events = events.concat(syncTreeAckUserWrite(repo.serverSyncTree_, transaction.currentWriteId, true)); - } - else if (transaction.status === 0 /* RUN */) { - if (transaction.retryCount >= MAX_TRANSACTION_RETRIES) { - abortTransaction = true; - abortReason = 'maxretry'; - events = events.concat(syncTreeAckUserWrite(repo.serverSyncTree_, transaction.currentWriteId, true)); - } - else { - // This code reruns a transaction - const currentNode = repoGetLatestState(repo, transaction.path, setsToIgnore); - transaction.currentInputSnapshot = currentNode; - const newData = queue[i].update(currentNode.val()); - if (newData !== undefined) { - validateFirebaseData('transaction failed: Data returned ', newData, transaction.path); - let newDataNode = nodeFromJSON(newData); - const hasExplicitPriority = typeof newData === 'object' && - newData != null && - contains(newData, '.priority'); - if (!hasExplicitPriority) { - // Keep the old priority if there wasn't a priority explicitly specified. - newDataNode = newDataNode.updatePriority(currentNode.getPriority()); - } - const oldWriteId = transaction.currentWriteId; - const serverValues = repoGenerateServerValues(repo); - const newNodeResolved = resolveDeferredValueSnapshot(newDataNode, currentNode, serverValues); - transaction.currentOutputSnapshotRaw = newDataNode; - transaction.currentOutputSnapshotResolved = newNodeResolved; - transaction.currentWriteId = repoGetNextWriteId(repo); - // Mutates setsToIgnore in place - setsToIgnore.splice(setsToIgnore.indexOf(oldWriteId), 1); - events = events.concat(syncTreeApplyUserOverwrite(repo.serverSyncTree_, transaction.path, newNodeResolved, transaction.currentWriteId, transaction.applyLocally)); - events = events.concat(syncTreeAckUserWrite(repo.serverSyncTree_, oldWriteId, true)); - } - else { - abortTransaction = true; - abortReason = 'nodata'; - events = events.concat(syncTreeAckUserWrite(repo.serverSyncTree_, transaction.currentWriteId, true)); - } - } - } - eventQueueRaiseEventsForChangedPath(repo.eventQueue_, path, events); - events = []; - if (abortTransaction) { - // Abort. - queue[i].status = 2 /* COMPLETED */; - // Removing a listener can trigger pruning which can muck with - // mergedData/visibleData (as it prunes data). So defer the unwatcher - // until we're done. - (function (unwatcher) { - setTimeout(unwatcher, Math.floor(0)); - })(queue[i].unwatcher); - if (queue[i].onComplete) { - if (abortReason === 'nodata') { - callbacks.push(() => queue[i].onComplete(null, false, queue[i].currentInputSnapshot)); - } - else { - callbacks.push(() => queue[i].onComplete(new Error(abortReason), false, null)); - } - } - } - } - // Clean up completed transactions. - repoPruneCompletedTransactionsBelowNode(repo, repo.transactionQueueTree_); - // Now fire callbacks, now that we're in a good, known state. - for (let i = 0; i < callbacks.length; i++) { - exceptionGuard(callbacks[i]); - } - // Try to send the transaction result to the server. - repoSendReadyTransactions(repo, repo.transactionQueueTree_); -} -/** - * Returns the rootmost ancestor node of the specified path that has a pending - * transaction on it, or just returns the node for the given path if there are - * no pending transactions on any ancestor. - * - * @param path - The location to start at. - * @returns The rootmost node with a transaction. - */ -function repoGetAncestorTransactionNode(repo, path) { - let front; - // Start at the root and walk deeper into the tree towards path until we - // find a node with pending transactions. - let transactionNode = repo.transactionQueueTree_; - front = pathGetFront(path); - while (front !== null && treeGetValue(transactionNode) === undefined) { - transactionNode = treeSubTree(transactionNode, front); - path = pathPopFront(path); - front = pathGetFront(path); - } - return transactionNode; -} -/** - * Builds the queue of all transactions at or below the specified - * transactionNode. - * - * @param transactionNode - * @returns The generated queue. - */ -function repoBuildTransactionQueue(repo, transactionNode) { - // Walk any child transaction queues and aggregate them into a single queue. - const transactionQueue = []; - repoAggregateTransactionQueuesForNode(repo, transactionNode, transactionQueue); - // Sort them by the order the transactions were created. - transactionQueue.sort((a, b) => a.order - b.order); - return transactionQueue; -} -function repoAggregateTransactionQueuesForNode(repo, node, queue) { - const nodeQueue = treeGetValue(node); - if (nodeQueue) { - for (let i = 0; i < nodeQueue.length; i++) { - queue.push(nodeQueue[i]); - } - } - treeForEachChild(node, child => { - repoAggregateTransactionQueuesForNode(repo, child, queue); - }); -} -/** - * Remove COMPLETED transactions at or below this node in the transactionQueueTree_. - */ -function repoPruneCompletedTransactionsBelowNode(repo, node) { - const queue = treeGetValue(node); - if (queue) { - let to = 0; - for (let from = 0; from < queue.length; from++) { - if (queue[from].status !== 2 /* COMPLETED */) { - queue[to] = queue[from]; - to++; - } - } - queue.length = to; - treeSetValue(node, queue.length > 0 ? queue : undefined); - } - treeForEachChild(node, childNode => { - repoPruneCompletedTransactionsBelowNode(repo, childNode); - }); -} -/** - * Aborts all transactions on ancestors or descendants of the specified path. - * Called when doing a set() or update() since we consider them incompatible - * with transactions. - * - * @param path - Path for which we want to abort related transactions. - */ -function repoAbortTransactions(repo, path) { - const affectedPath = treeGetPath(repoGetAncestorTransactionNode(repo, path)); - const transactionNode = treeSubTree(repo.transactionQueueTree_, path); - treeForEachAncestor(transactionNode, (node) => { - repoAbortTransactionsOnNode(repo, node); - }); - repoAbortTransactionsOnNode(repo, transactionNode); - treeForEachDescendant(transactionNode, (node) => { - repoAbortTransactionsOnNode(repo, node); - }); - return affectedPath; -} -/** - * Abort transactions stored in this transaction queue node. - * - * @param node - Node to abort transactions for. - */ -function repoAbortTransactionsOnNode(repo, node) { - const queue = treeGetValue(node); - if (queue) { - // Queue up the callbacks and fire them after cleaning up all of our - // transaction state, since the callback could trigger more transactions - // or sets. - const callbacks = []; - // Go through queue. Any already-sent transactions must be marked for - // abort, while the unsent ones can be immediately aborted and removed. - let events = []; - let lastSent = -1; - for (let i = 0; i < queue.length; i++) { - if (queue[i].status === 3 /* SENT_NEEDS_ABORT */) ; - else if (queue[i].status === 1 /* SENT */) { - assert(lastSent === i - 1, 'All SENT items should be at beginning of queue.'); - lastSent = i; - // Mark transaction for abort when it comes back. - queue[i].status = 3 /* SENT_NEEDS_ABORT */; - queue[i].abortReason = 'set'; - } - else { - assert(queue[i].status === 0 /* RUN */, 'Unexpected transaction status in abort'); - // We can abort it immediately. - queue[i].unwatcher(); - events = events.concat(syncTreeAckUserWrite(repo.serverSyncTree_, queue[i].currentWriteId, true)); - if (queue[i].onComplete) { - callbacks.push(queue[i].onComplete.bind(null, new Error('set'), false, null)); - } - } - } - if (lastSent === -1) { - // We're not waiting for any sent transactions. We can clear the queue. - treeSetValue(node, undefined); - } - else { - // Remove the transactions we aborted. - queue.length = lastSent + 1; - } - // Now fire the callbacks. - eventQueueRaiseEventsForChangedPath(repo.eventQueue_, treeGetPath(node), events); - for (let i = 0; i < callbacks.length; i++) { - exceptionGuard(callbacks[i]); - } - } -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -function decodePath(pathString) { - let pathStringDecoded = ''; - const pieces = pathString.split('/'); - for (let i = 0; i < pieces.length; i++) { - if (pieces[i].length > 0) { - let piece = pieces[i]; - try { - piece = decodeURIComponent(piece.replace(/\+/g, ' ')); - } - catch (e) { } - pathStringDecoded += '/' + piece; - } - } - return pathStringDecoded; -} -/** - * @returns key value hash - */ -function decodeQuery(queryString) { - const results = {}; - if (queryString.charAt(0) === '?') { - queryString = queryString.substring(1); - } - for (const segment of queryString.split('&')) { - if (segment.length === 0) { - continue; - } - const kv = segment.split('='); - if (kv.length === 2) { - results[decodeURIComponent(kv[0])] = decodeURIComponent(kv[1]); - } - else { - warn(`Invalid query segment '${segment}' in query '${queryString}'`); - } - } - return results; -} -const parseRepoInfo = function (dataURL, nodeAdmin) { - const parsedUrl = parseDatabaseURL(dataURL), namespace = parsedUrl.namespace; - if (parsedUrl.domain === 'firebase.com') { - fatal(parsedUrl.host + - ' is no longer supported. ' + - 'Please use .firebaseio.com instead'); - } - // Catch common error of uninitialized namespace value. - if ((!namespace || namespace === 'undefined') && - parsedUrl.domain !== 'localhost') { - fatal('Cannot parse Firebase url. Please use https://.firebaseio.com'); - } - if (!parsedUrl.secure) { - warnIfPageIsSecure(); - } - const webSocketOnly = parsedUrl.scheme === 'ws' || parsedUrl.scheme === 'wss'; - return { - repoInfo: new RepoInfo(parsedUrl.host, parsedUrl.secure, namespace, webSocketOnly, nodeAdmin, - /*persistenceKey=*/ '', - /*includeNamespaceInQueryParams=*/ namespace !== parsedUrl.subdomain), - path: new Path(parsedUrl.pathString) - }; -}; -const parseDatabaseURL = function (dataURL) { - // Default to empty strings in the event of a malformed string. - let host = '', domain = '', subdomain = '', pathString = '', namespace = ''; - // Always default to SSL, unless otherwise specified. - let secure = true, scheme = 'https', port = 443; - // Don't do any validation here. The caller is responsible for validating the result of parsing. - if (typeof dataURL === 'string') { - // Parse scheme. - let colonInd = dataURL.indexOf('//'); - if (colonInd >= 0) { - scheme = dataURL.substring(0, colonInd - 1); - dataURL = dataURL.substring(colonInd + 2); - } - // Parse host, path, and query string. - let slashInd = dataURL.indexOf('/'); - if (slashInd === -1) { - slashInd = dataURL.length; - } - let questionMarkInd = dataURL.indexOf('?'); - if (questionMarkInd === -1) { - questionMarkInd = dataURL.length; - } - host = dataURL.substring(0, Math.min(slashInd, questionMarkInd)); - if (slashInd < questionMarkInd) { - // For pathString, questionMarkInd will always come after slashInd - pathString = decodePath(dataURL.substring(slashInd, questionMarkInd)); - } - const queryParams = decodeQuery(dataURL.substring(Math.min(dataURL.length, questionMarkInd))); - // If we have a port, use scheme for determining if it's secure. - colonInd = host.indexOf(':'); - if (colonInd >= 0) { - secure = scheme === 'https' || scheme === 'wss'; - port = parseInt(host.substring(colonInd + 1), 10); - } - else { - colonInd = host.length; - } - const hostWithoutPort = host.slice(0, colonInd); - if (hostWithoutPort.toLowerCase() === 'localhost') { - domain = 'localhost'; - } - else if (hostWithoutPort.split('.').length <= 2) { - domain = hostWithoutPort; - } - else { - // Interpret the subdomain of a 3 or more component URL as the namespace name. - const dotInd = host.indexOf('.'); - subdomain = host.substring(0, dotInd).toLowerCase(); - domain = host.substring(dotInd + 1); - // Normalize namespaces to lowercase to share storage / connection. - namespace = subdomain; - } - // Always treat the value of the `ns` as the namespace name if it is present. - if ('ns' in queryParams) { - namespace = queryParams['ns']; - } - } - return { - host, - port, - domain, - subdomain, - secure, - scheme, - pathString, - namespace - }; -}; - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Encapsulates the data needed to raise an event - */ -class DataEvent { - /** - * @param eventType - One of: value, child_added, child_changed, child_moved, child_removed - * @param eventRegistration - The function to call to with the event data. User provided - * @param snapshot - The data backing the event - * @param prevName - Optional, the name of the previous child for child_* events. - */ - constructor(eventType, eventRegistration, snapshot, prevName) { - this.eventType = eventType; - this.eventRegistration = eventRegistration; - this.snapshot = snapshot; - this.prevName = prevName; - } - getPath() { - const ref = this.snapshot.ref; - if (this.eventType === 'value') { - return ref._path; - } - else { - return ref.parent._path; - } - } - getEventType() { - return this.eventType; - } - getEventRunner() { - return this.eventRegistration.getEventRunner(this); - } - toString() { - return (this.getPath().toString() + - ':' + - this.eventType + - ':' + - stringify(this.snapshot.exportVal())); - } -} -class CancelEvent { - constructor(eventRegistration, error, path) { - this.eventRegistration = eventRegistration; - this.error = error; - this.path = path; - } - getPath() { - return this.path; - } - getEventType() { - return 'cancel'; - } - getEventRunner() { - return this.eventRegistration.getEventRunner(this); - } - toString() { - return this.path.toString() + ':cancel'; - } -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * A wrapper class that converts events from the database@exp SDK to the legacy - * Database SDK. Events are not converted directly as event registration relies - * on reference comparison of the original user callback (see `matches()`) and - * relies on equality of the legacy SDK's `context` object. - */ -class CallbackContext { - constructor(snapshotCallback, cancelCallback) { - this.snapshotCallback = snapshotCallback; - this.cancelCallback = cancelCallback; - } - onValue(expDataSnapshot, previousChildName) { - this.snapshotCallback.call(null, expDataSnapshot, previousChildName); - } - onCancel(error) { - assert(this.hasCancelCallback, 'Raising a cancel event on a listener with no cancel callback'); - return this.cancelCallback.call(null, error); - } - get hasCancelCallback() { - return !!this.cancelCallback; - } - matches(other) { - return (this.snapshotCallback === other.snapshotCallback || - (this.snapshotCallback.userCallback !== undefined && - this.snapshotCallback.userCallback === - other.snapshotCallback.userCallback && - this.snapshotCallback.context === other.snapshotCallback.context)); - } -} - -/** - * @license - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * The `onDisconnect` class allows you to write or clear data when your client - * disconnects from the Database server. These updates occur whether your - * client disconnects cleanly or not, so you can rely on them to clean up data - * even if a connection is dropped or a client crashes. - * - * The `onDisconnect` class is most commonly used to manage presence in - * applications where it is useful to detect how many clients are connected and - * when other clients disconnect. See - * {@link https://firebase.google.com/docs/database/web/offline-capabilities | Enabling Offline Capabilities in JavaScript} - * for more information. - * - * To avoid problems when a connection is dropped before the requests can be - * transferred to the Database server, these functions should be called before - * writing any data. - * - * Note that `onDisconnect` operations are only triggered once. If you want an - * operation to occur each time a disconnect occurs, you'll need to re-establish - * the `onDisconnect` operations each time you reconnect. - */ -class OnDisconnect { - /** @hideconstructor */ - constructor(_repo, _path) { - this._repo = _repo; - this._path = _path; - } - /** - * Cancels all previously queued `onDisconnect()` set or update events for this - * location and all children. - * - * If a write has been queued for this location via a `set()` or `update()` at a - * parent location, the write at this location will be canceled, though writes - * to sibling locations will still occur. - * - * @returns Resolves when synchronization to the server is complete. - */ - cancel() { - const deferred = new Deferred(); - repoOnDisconnectCancel(this._repo, this._path, deferred.wrapCallback(() => { })); - return deferred.promise; - } - /** - * Ensures the data at this location is deleted when the client is disconnected - * (due to closing the browser, navigating to a new page, or network issues). - * - * @returns Resolves when synchronization to the server is complete. - */ - remove() { - validateWritablePath('OnDisconnect.remove', this._path); - const deferred = new Deferred(); - repoOnDisconnectSet(this._repo, this._path, null, deferred.wrapCallback(() => { })); - return deferred.promise; - } - /** - * Ensures the data at this location is set to the specified value when the - * client is disconnected (due to closing the browser, navigating to a new page, - * or network issues). - * - * `set()` is especially useful for implementing "presence" systems, where a - * value should be changed or cleared when a user disconnects so that they - * appear "offline" to other users. See - * {@link https://firebase.google.com/docs/database/web/offline-capabilities | Enabling Offline Capabilities in JavaScript} - * for more information. - * - * Note that `onDisconnect` operations are only triggered once. If you want an - * operation to occur each time a disconnect occurs, you'll need to re-establish - * the `onDisconnect` operations each time. - * - * @param value - The value to be written to this location on disconnect (can - * be an object, array, string, number, boolean, or null). - * @returns Resolves when synchronization to the Database is complete. - */ - set(value) { - validateWritablePath('OnDisconnect.set', this._path); - validateFirebaseDataArg('OnDisconnect.set', value, this._path, false); - const deferred = new Deferred(); - repoOnDisconnectSet(this._repo, this._path, value, deferred.wrapCallback(() => { })); - return deferred.promise; - } - /** - * Ensures the data at this location is set to the specified value and priority - * when the client is disconnected (due to closing the browser, navigating to a - * new page, or network issues). - * - * @param value - The value to be written to this location on disconnect (can - * be an object, array, string, number, boolean, or null). - * @param priority - The priority to be written (string, number, or null). - * @returns Resolves when synchronization to the Database is complete. - */ - setWithPriority(value, priority) { - validateWritablePath('OnDisconnect.setWithPriority', this._path); - validateFirebaseDataArg('OnDisconnect.setWithPriority', value, this._path, false); - validatePriority('OnDisconnect.setWithPriority', priority, false); - const deferred = new Deferred(); - repoOnDisconnectSetWithPriority(this._repo, this._path, value, priority, deferred.wrapCallback(() => { })); - return deferred.promise; - } - /** - * Writes multiple values at this location when the client is disconnected (due - * to closing the browser, navigating to a new page, or network issues). - * - * The `values` argument contains multiple property-value pairs that will be - * written to the Database together. Each child property can either be a simple - * property (for example, "name") or a relative path (for example, "name/first") - * from the current location to the data to update. - * - * As opposed to the `set()` method, `update()` can be use to selectively update - * only the referenced properties at the current location (instead of replacing - * all the child properties at the current location). - * - * @param values - Object containing multiple values. - * @returns Resolves when synchronization to the Database is complete. - */ - update(values) { - validateWritablePath('OnDisconnect.update', this._path); - validateFirebaseMergeDataArg('OnDisconnect.update', values, this._path, false); - const deferred = new Deferred(); - repoOnDisconnectUpdate(this._repo, this._path, values, deferred.wrapCallback(() => { })); - return deferred.promise; - } -} - -/** - * @license - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * @internal - */ -class QueryImpl { - /** - * @hideconstructor - */ - constructor(_repo, _path, _queryParams, _orderByCalled) { - this._repo = _repo; - this._path = _path; - this._queryParams = _queryParams; - this._orderByCalled = _orderByCalled; - } - get key() { - if (pathIsEmpty(this._path)) { - return null; - } - else { - return pathGetBack(this._path); - } - } - get ref() { - return new ReferenceImpl(this._repo, this._path); - } - get _queryIdentifier() { - const obj = queryParamsGetQueryObject(this._queryParams); - const id = ObjectToUniqueKey(obj); - return id === '{}' ? 'default' : id; - } - /** - * An object representation of the query parameters used by this Query. - */ - get _queryObject() { - return queryParamsGetQueryObject(this._queryParams); - } - isEqual(other) { - other = getModularInstance(other); - if (!(other instanceof QueryImpl)) { - return false; - } - const sameRepo = this._repo === other._repo; - const samePath = pathEquals(this._path, other._path); - const sameQueryIdentifier = this._queryIdentifier === other._queryIdentifier; - return sameRepo && samePath && sameQueryIdentifier; - } - toJSON() { - return this.toString(); - } - toString() { - return this._repo.toString() + pathToUrlEncodedString(this._path); - } -} -/** - * Validates that no other order by call has been made - */ -function validateNoPreviousOrderByCall(query, fnName) { - if (query._orderByCalled === true) { - throw new Error(fnName + ": You can't combine multiple orderBy calls."); - } -} -/** - * Validates start/end values for queries. - */ -function validateQueryEndpoints(params) { - let startNode = null; - let endNode = null; - if (params.hasStart()) { - startNode = params.getIndexStartValue(); - } - if (params.hasEnd()) { - endNode = params.getIndexEndValue(); - } - if (params.getIndex() === KEY_INDEX) { - const tooManyArgsError = 'Query: When ordering by key, you may only pass one argument to ' + - 'startAt(), endAt(), or equalTo().'; - const wrongArgTypeError = 'Query: When ordering by key, the argument passed to startAt(), startAfter(), ' + - 'endAt(), endBefore(), or equalTo() must be a string.'; - if (params.hasStart()) { - const startName = params.getIndexStartName(); - if (startName !== MIN_NAME) { - throw new Error(tooManyArgsError); - } - else if (typeof startNode !== 'string') { - throw new Error(wrongArgTypeError); - } - } - if (params.hasEnd()) { - const endName = params.getIndexEndName(); - if (endName !== MAX_NAME) { - throw new Error(tooManyArgsError); - } - else if (typeof endNode !== 'string') { - throw new Error(wrongArgTypeError); - } - } - } - else if (params.getIndex() === PRIORITY_INDEX) { - if ((startNode != null && !isValidPriority(startNode)) || - (endNode != null && !isValidPriority(endNode))) { - throw new Error('Query: When ordering by priority, the first argument passed to startAt(), ' + - 'startAfter() endAt(), endBefore(), or equalTo() must be a valid priority value ' + - '(null, a number, or a string).'); - } - } - else { - assert(params.getIndex() instanceof PathIndex || - params.getIndex() === VALUE_INDEX, 'unknown index type.'); - if ((startNode != null && typeof startNode === 'object') || - (endNode != null && typeof endNode === 'object')) { - throw new Error('Query: First argument passed to startAt(), startAfter(), endAt(), endBefore(), or ' + - 'equalTo() cannot be an object.'); - } - } -} -/** - * Validates that limit* has been called with the correct combination of parameters - */ -function validateLimit(params) { - if (params.hasStart() && - params.hasEnd() && - params.hasLimit() && - !params.hasAnchoredLimit()) { - throw new Error("Query: Can't combine startAt(), startAfter(), endAt(), endBefore(), and limit(). Use " + - 'limitToFirst() or limitToLast() instead.'); - } -} -/** - * @internal - */ -class ReferenceImpl extends QueryImpl { - /** @hideconstructor */ - constructor(repo, path) { - super(repo, path, new QueryParams(), false); - } - get parent() { - const parentPath = pathParent(this._path); - return parentPath === null - ? null - : new ReferenceImpl(this._repo, parentPath); - } - get root() { - let ref = this; - while (ref.parent !== null) { - ref = ref.parent; - } - return ref; - } -} -/** - * A `DataSnapshot` contains data from a Database location. - * - * Any time you read data from the Database, you receive the data as a - * `DataSnapshot`. A `DataSnapshot` is passed to the event callbacks you attach - * with `on()` or `once()`. You can extract the contents of the snapshot as a - * JavaScript object by calling the `val()` method. Alternatively, you can - * traverse into the snapshot by calling `child()` to return child snapshots - * (which you could then call `val()` on). - * - * A `DataSnapshot` is an efficiently generated, immutable copy of the data at - * a Database location. It cannot be modified and will never change (to modify - * data, you always call the `set()` method on a `Reference` directly). - */ -class DataSnapshot { - /** - * @param _node - A SnapshotNode to wrap. - * @param ref - The location this snapshot came from. - * @param _index - The iteration order for this snapshot - * @hideconstructor - */ - constructor(_node, - /** - * The location of this DataSnapshot. - */ - ref, _index) { - this._node = _node; - this.ref = ref; - this._index = _index; - } - /** - * Gets the priority value of the data in this `DataSnapshot`. - * - * Applications need not use priority but can order collections by - * ordinary properties (see - * {@link https://firebase.google.com/docs/database/web/lists-of-data#sorting_and_filtering_data |Sorting and filtering data} - * ). - */ - get priority() { - // typecast here because we never return deferred values or internal priorities (MAX_PRIORITY) - return this._node.getPriority().val(); - } - /** - * The key (last part of the path) of the location of this `DataSnapshot`. - * - * The last token in a Database location is considered its key. For example, - * "ada" is the key for the /users/ada/ node. Accessing the key on any - * `DataSnapshot` will return the key for the location that generated it. - * However, accessing the key on the root URL of a Database will return - * `null`. - */ - get key() { - return this.ref.key; - } - /** Returns the number of child properties of this `DataSnapshot`. */ - get size() { - return this._node.numChildren(); - } - /** - * Gets another `DataSnapshot` for the location at the specified relative path. - * - * Passing a relative path to the `child()` method of a DataSnapshot returns - * another `DataSnapshot` for the location at the specified relative path. The - * relative path can either be a simple child name (for example, "ada") or a - * deeper, slash-separated path (for example, "ada/name/first"). If the child - * location has no data, an empty `DataSnapshot` (that is, a `DataSnapshot` - * whose value is `null`) is returned. - * - * @param path - A relative path to the location of child data. - */ - child(path) { - const childPath = new Path(path); - const childRef = child(this.ref, path); - return new DataSnapshot(this._node.getChild(childPath), childRef, PRIORITY_INDEX); - } - /** - * Returns true if this `DataSnapshot` contains any data. It is slightly more - * efficient than using `snapshot.val() !== null`. - */ - exists() { - return !this._node.isEmpty(); - } - /** - * Exports the entire contents of the DataSnapshot as a JavaScript object. - * - * The `exportVal()` method is similar to `val()`, except priority information - * is included (if available), making it suitable for backing up your data. - * - * @returns The DataSnapshot's contents as a JavaScript value (Object, - * Array, string, number, boolean, or `null`). - */ - // eslint-disable-next-line @typescript-eslint/no-explicit-any - exportVal() { - return this._node.val(true); - } - /** - * Enumerates the top-level children in the `DataSnapshot`. - * - * Because of the way JavaScript objects work, the ordering of data in the - * JavaScript object returned by `val()` is not guaranteed to match the - * ordering on the server nor the ordering of `onChildAdded()` events. That is - * where `forEach()` comes in handy. It guarantees the children of a - * `DataSnapshot` will be iterated in their query order. - * - * If no explicit `orderBy*()` method is used, results are returned - * ordered by key (unless priorities are used, in which case, results are - * returned by priority). - * - * @param action - A function that will be called for each child DataSnapshot. - * The callback can return true to cancel further enumeration. - * @returns true if enumeration was canceled due to your callback returning - * true. - */ - forEach(action) { - if (this._node.isLeafNode()) { - return false; - } - const childrenNode = this._node; - // Sanitize the return value to a boolean. ChildrenNode.forEachChild has a weird return type... - return !!childrenNode.forEachChild(this._index, (key, node) => { - return action(new DataSnapshot(node, child(this.ref, key), PRIORITY_INDEX)); - }); - } - /** - * Returns true if the specified child path has (non-null) data. - * - * @param path - A relative path to the location of a potential child. - * @returns `true` if data exists at the specified child path; else - * `false`. - */ - hasChild(path) { - const childPath = new Path(path); - return !this._node.getChild(childPath).isEmpty(); - } - /** - * Returns whether or not the `DataSnapshot` has any non-`null` child - * properties. - * - * You can use `hasChildren()` to determine if a `DataSnapshot` has any - * children. If it does, you can enumerate them using `forEach()`. If it - * doesn't, then either this snapshot contains a primitive value (which can be - * retrieved with `val()`) or it is empty (in which case, `val()` will return - * `null`). - * - * @returns true if this snapshot has any children; else false. - */ - hasChildren() { - if (this._node.isLeafNode()) { - return false; - } - else { - return !this._node.isEmpty(); - } - } - /** - * Returns a JSON-serializable representation of this object. - */ - toJSON() { - return this.exportVal(); - } - /** - * Extracts a JavaScript value from a `DataSnapshot`. - * - * Depending on the data in a `DataSnapshot`, the `val()` method may return a - * scalar type (string, number, or boolean), an array, or an object. It may - * also return null, indicating that the `DataSnapshot` is empty (contains no - * data). - * - * @returns The DataSnapshot's contents as a JavaScript value (Object, - * Array, string, number, boolean, or `null`). - */ - // eslint-disable-next-line @typescript-eslint/no-explicit-any - val() { - return this._node.val(); - } -} -/** - * - * Returns a `Reference` representing the location in the Database - * corresponding to the provided path. If no path is provided, the `Reference` - * will point to the root of the Database. - * - * @param db - The database instance to obtain a reference for. - * @param path - Optional path representing the location the returned - * `Reference` will point. If not provided, the returned `Reference` will - * point to the root of the Database. - * @returns If a path is provided, a `Reference` - * pointing to the provided path. Otherwise, a `Reference` pointing to the - * root of the Database. - */ -function ref(db, path) { - db = getModularInstance(db); - db._checkNotDeleted('ref'); - return path !== undefined ? child(db._root, path) : db._root; -} -/** - * Returns a `Reference` representing the location in the Database - * corresponding to the provided Firebase URL. - * - * An exception is thrown if the URL is not a valid Firebase Database URL or it - * has a different domain than the current `Database` instance. - * - * Note that all query parameters (`orderBy`, `limitToLast`, etc.) are ignored - * and are not applied to the returned `Reference`. - * - * @param db - The database instance to obtain a reference for. - * @param url - The Firebase URL at which the returned `Reference` will - * point. - * @returns A `Reference` pointing to the provided - * Firebase URL. - */ -function refFromURL(db, url) { - db = getModularInstance(db); - db._checkNotDeleted('refFromURL'); - const parsedURL = parseRepoInfo(url, db._repo.repoInfo_.nodeAdmin); - validateUrl('refFromURL', parsedURL); - const repoInfo = parsedURL.repoInfo; - if (!db._repo.repoInfo_.isCustomHost() && - repoInfo.host !== db._repo.repoInfo_.host) { - fatal('refFromURL' + - ': Host name does not match the current database: ' + - '(found ' + - repoInfo.host + - ' but expected ' + - db._repo.repoInfo_.host + - ')'); - } - return ref(db, parsedURL.path.toString()); -} -/** - * Gets a `Reference` for the location at the specified relative path. - * - * The relative path can either be a simple child name (for example, "ada") or - * a deeper slash-separated path (for example, "ada/name/first"). - * - * @param parent - The parent location. - * @param path - A relative path from this location to the desired child - * location. - * @returns The specified child location. - */ -function child(parent, path) { - parent = getModularInstance(parent); - if (pathGetFront(parent._path) === null) { - validateRootPathString('child', 'path', path, false); - } - else { - validatePathString('child', 'path', path, false); - } - return new ReferenceImpl(parent._repo, pathChild(parent._path, path)); -} -/** - * Returns an `OnDisconnect` object - see - * {@link https://firebase.google.com/docs/database/web/offline-capabilities | Enabling Offline Capabilities in JavaScript} - * for more information on how to use it. - * - * @param ref - The reference to add OnDisconnect triggers for. - */ -function onDisconnect(ref) { - ref = getModularInstance(ref); - return new OnDisconnect(ref._repo, ref._path); -} -/** - * Generates a new child location using a unique key and returns its - * `Reference`. - * - * This is the most common pattern for adding data to a collection of items. - * - * If you provide a value to `push()`, the value is written to the - * generated location. If you don't pass a value, nothing is written to the - * database and the child remains empty (but you can use the `Reference` - * elsewhere). - * - * The unique keys generated by `push()` are ordered by the current time, so the - * resulting list of items is chronologically sorted. The keys are also - * designed to be unguessable (they contain 72 random bits of entropy). - * - * See {@link https://firebase.google.com/docs/database/web/lists-of-data#append_to_a_list_of_data | Append to a list of data}. - * See {@link https://firebase.googleblog.com/2015/02/the-2120-ways-to-ensure-unique_68.html | The 2^120 Ways to Ensure Unique Identifiers}. - * - * @param parent - The parent location. - * @param value - Optional value to be written at the generated location. - * @returns Combined `Promise` and `Reference`; resolves when write is complete, - * but can be used immediately as the `Reference` to the child location. - */ -function push(parent, value) { - parent = getModularInstance(parent); - validateWritablePath('push', parent._path); - validateFirebaseDataArg('push', value, parent._path, true); - const now = repoServerTime(parent._repo); - const name = nextPushId(now); - // push() returns a ThennableReference whose promise is fulfilled with a - // regular Reference. We use child() to create handles to two different - // references. The first is turned into a ThennableReference below by adding - // then() and catch() methods and is used as the return value of push(). The - // second remains a regular Reference and is used as the fulfilled value of - // the first ThennableReference. - const thennablePushRef = child(parent, name); - const pushRef = child(parent, name); - let promise; - if (value != null) { - promise = set(pushRef, value).then(() => pushRef); - } - else { - promise = Promise.resolve(pushRef); - } - thennablePushRef.then = promise.then.bind(promise); - thennablePushRef.catch = promise.then.bind(promise, undefined); - return thennablePushRef; -} -/** - * Removes the data at this Database location. - * - * Any data at child locations will also be deleted. - * - * The effect of the remove will be visible immediately and the corresponding - * event 'value' will be triggered. Synchronization of the remove to the - * Firebase servers will also be started, and the returned Promise will resolve - * when complete. If provided, the onComplete callback will be called - * asynchronously after synchronization has finished. - * - * @param ref - The location to remove. - * @returns Resolves when remove on server is complete. - */ -function remove(ref) { - validateWritablePath('remove', ref._path); - return set(ref, null); -} -/** - * Writes data to this Database location. - * - * This will overwrite any data at this location and all child locations. - * - * The effect of the write will be visible immediately, and the corresponding - * events ("value", "child_added", etc.) will be triggered. Synchronization of - * the data to the Firebase servers will also be started, and the returned - * Promise will resolve when complete. If provided, the `onComplete` callback - * will be called asynchronously after synchronization has finished. - * - * Passing `null` for the new value is equivalent to calling `remove()`; namely, - * all data at this location and all child locations will be deleted. - * - * `set()` will remove any priority stored at this location, so if priority is - * meant to be preserved, you need to use `setWithPriority()` instead. - * - * Note that modifying data with `set()` will cancel any pending transactions - * at that location, so extreme care should be taken if mixing `set()` and - * `transaction()` to modify the same data. - * - * A single `set()` will generate a single "value" event at the location where - * the `set()` was performed. - * - * @param ref - The location to write to. - * @param value - The value to be written (string, number, boolean, object, - * array, or null). - * @returns Resolves when write to server is complete. - */ -function set(ref, value) { - ref = getModularInstance(ref); - validateWritablePath('set', ref._path); - validateFirebaseDataArg('set', value, ref._path, false); - const deferred = new Deferred(); - repoSetWithPriority(ref._repo, ref._path, value, - /*priority=*/ null, deferred.wrapCallback(() => { })); - return deferred.promise; -} -/** - * Sets a priority for the data at this Database location. - * - * Applications need not use priority but can order collections by - * ordinary properties (see - * {@link https://firebase.google.com/docs/database/web/lists-of-data#sorting_and_filtering_data | Sorting and filtering data} - * ). - * - * @param ref - The location to write to. - * @param priority - The priority to be written (string, number, or null). - * @returns Resolves when write to server is complete. - */ -function setPriority(ref, priority) { - ref = getModularInstance(ref); - validateWritablePath('setPriority', ref._path); - validatePriority('setPriority', priority, false); - const deferred = new Deferred(); - repoSetWithPriority(ref._repo, pathChild(ref._path, '.priority'), priority, null, deferred.wrapCallback(() => { })); - return deferred.promise; -} -/** - * Writes data the Database location. Like `set()` but also specifies the - * priority for that data. - * - * Applications need not use priority but can order collections by - * ordinary properties (see - * {@link https://firebase.google.com/docs/database/web/lists-of-data#sorting_and_filtering_data | Sorting and filtering data} - * ). - * - * @param ref - The location to write to. - * @param value - The value to be written (string, number, boolean, object, - * array, or null). - * @param priority - The priority to be written (string, number, or null). - * @returns Resolves when write to server is complete. - */ -function setWithPriority(ref, value, priority) { - validateWritablePath('setWithPriority', ref._path); - validateFirebaseDataArg('setWithPriority', value, ref._path, false); - validatePriority('setWithPriority', priority, false); - if (ref.key === '.length' || ref.key === '.keys') { - throw 'setWithPriority failed: ' + ref.key + ' is a read-only object.'; - } - const deferred = new Deferred(); - repoSetWithPriority(ref._repo, ref._path, value, priority, deferred.wrapCallback(() => { })); - return deferred.promise; -} -/** - * Writes multiple values to the Database at once. - * - * The `values` argument contains multiple property-value pairs that will be - * written to the Database together. Each child property can either be a simple - * property (for example, "name") or a relative path (for example, - * "name/first") from the current location to the data to update. - * - * As opposed to the `set()` method, `update()` can be use to selectively update - * only the referenced properties at the current location (instead of replacing - * all the child properties at the current location). - * - * The effect of the write will be visible immediately, and the corresponding - * events ('value', 'child_added', etc.) will be triggered. Synchronization of - * the data to the Firebase servers will also be started, and the returned - * Promise will resolve when complete. If provided, the `onComplete` callback - * will be called asynchronously after synchronization has finished. - * - * A single `update()` will generate a single "value" event at the location - * where the `update()` was performed, regardless of how many children were - * modified. - * - * Note that modifying data with `update()` will cancel any pending - * transactions at that location, so extreme care should be taken if mixing - * `update()` and `transaction()` to modify the same data. - * - * Passing `null` to `update()` will remove the data at this location. - * - * See - * {@link https://firebase.googleblog.com/2015/09/introducing-multi-location-updates-and_86.html | Introducing multi-location updates and more}. - * - * @param ref - The location to write to. - * @param values - Object containing multiple values. - * @returns Resolves when update on server is complete. - */ -function update(ref, values) { - validateFirebaseMergeDataArg('update', values, ref._path, false); - const deferred = new Deferred(); - repoUpdate(ref._repo, ref._path, values, deferred.wrapCallback(() => { })); - return deferred.promise; -} -/** - * Gets the most up-to-date result for this query. - * - * @param query - The query to run. - * @returns A `Promise` which resolves to the resulting DataSnapshot if a value is - * available, or rejects if the client is unable to return a value (e.g., if the - * server is unreachable and there is nothing cached). - */ -function get(query) { - query = getModularInstance(query); - const callbackContext = new CallbackContext(() => { }); - const container = new ValueEventRegistration(callbackContext); - return repoGetValue(query._repo, query, container).then(node => { - return new DataSnapshot(node, new ReferenceImpl(query._repo, query._path), query._queryParams.getIndex()); - }); -} -/** - * Represents registration for 'value' events. - */ -class ValueEventRegistration { - constructor(callbackContext) { - this.callbackContext = callbackContext; - } - respondsTo(eventType) { - return eventType === 'value'; - } - createEvent(change, query) { - const index = query._queryParams.getIndex(); - return new DataEvent('value', this, new DataSnapshot(change.snapshotNode, new ReferenceImpl(query._repo, query._path), index)); - } - getEventRunner(eventData) { - if (eventData.getEventType() === 'cancel') { - return () => this.callbackContext.onCancel(eventData.error); - } - else { - return () => this.callbackContext.onValue(eventData.snapshot, null); - } - } - createCancelEvent(error, path) { - if (this.callbackContext.hasCancelCallback) { - return new CancelEvent(this, error, path); - } - else { - return null; - } - } - matches(other) { - if (!(other instanceof ValueEventRegistration)) { - return false; - } - else if (!other.callbackContext || !this.callbackContext) { - // If no callback specified, we consider it to match any callback. - return true; - } - else { - return other.callbackContext.matches(this.callbackContext); - } - } - hasAnyCallback() { - return this.callbackContext !== null; - } -} -/** - * Represents the registration of a child_x event. - */ -class ChildEventRegistration { - constructor(eventType, callbackContext) { - this.eventType = eventType; - this.callbackContext = callbackContext; - } - respondsTo(eventType) { - let eventToCheck = eventType === 'children_added' ? 'child_added' : eventType; - eventToCheck = - eventToCheck === 'children_removed' ? 'child_removed' : eventToCheck; - return this.eventType === eventToCheck; - } - createCancelEvent(error, path) { - if (this.callbackContext.hasCancelCallback) { - return new CancelEvent(this, error, path); - } - else { - return null; - } - } - createEvent(change, query) { - assert(change.childName != null, 'Child events should have a childName.'); - const childRef = child(new ReferenceImpl(query._repo, query._path), change.childName); - const index = query._queryParams.getIndex(); - return new DataEvent(change.type, this, new DataSnapshot(change.snapshotNode, childRef, index), change.prevName); - } - getEventRunner(eventData) { - if (eventData.getEventType() === 'cancel') { - return () => this.callbackContext.onCancel(eventData.error); - } - else { - return () => this.callbackContext.onValue(eventData.snapshot, eventData.prevName); - } - } - matches(other) { - if (other instanceof ChildEventRegistration) { - return (this.eventType === other.eventType && - (!this.callbackContext || - !other.callbackContext || - this.callbackContext.matches(other.callbackContext))); - } - return false; - } - hasAnyCallback() { - return !!this.callbackContext; - } -} -function addEventListener(query, eventType, callback, cancelCallbackOrListenOptions, options) { - let cancelCallback; - if (typeof cancelCallbackOrListenOptions === 'object') { - cancelCallback = undefined; - options = cancelCallbackOrListenOptions; - } - if (typeof cancelCallbackOrListenOptions === 'function') { - cancelCallback = cancelCallbackOrListenOptions; - } - if (options && options.onlyOnce) { - const userCallback = callback; - const onceCallback = (dataSnapshot, previousChildName) => { - repoRemoveEventCallbackForQuery(query._repo, query, container); - userCallback(dataSnapshot, previousChildName); - }; - onceCallback.userCallback = callback.userCallback; - onceCallback.context = callback.context; - callback = onceCallback; - } - const callbackContext = new CallbackContext(callback, cancelCallback || undefined); - const container = eventType === 'value' - ? new ValueEventRegistration(callbackContext) - : new ChildEventRegistration(eventType, callbackContext); - repoAddEventCallbackForQuery(query._repo, query, container); - return () => repoRemoveEventCallbackForQuery(query._repo, query, container); -} -function onValue(query, callback, cancelCallbackOrListenOptions, options) { - return addEventListener(query, 'value', callback, cancelCallbackOrListenOptions, options); -} -function onChildAdded(query, callback, cancelCallbackOrListenOptions, options) { - return addEventListener(query, 'child_added', callback, cancelCallbackOrListenOptions, options); -} -function onChildChanged(query, callback, cancelCallbackOrListenOptions, options) { - return addEventListener(query, 'child_changed', callback, cancelCallbackOrListenOptions, options); -} -function onChildMoved(query, callback, cancelCallbackOrListenOptions, options) { - return addEventListener(query, 'child_moved', callback, cancelCallbackOrListenOptions, options); -} -function onChildRemoved(query, callback, cancelCallbackOrListenOptions, options) { - return addEventListener(query, 'child_removed', callback, cancelCallbackOrListenOptions, options); -} -/** - * Detaches a callback previously attached with the corresponding `on*()` (`onValue`, `onChildAdded`) listener. - * Note: This is not the recommended way to remove a listener. Instead, please use the returned callback function from - * the respective `on*` callbacks. - * - * Detach a callback previously attached with `on*()`. Calling `off()` on a parent listener - * will not automatically remove listeners registered on child nodes, `off()` - * must also be called on any child listeners to remove the callback. - * - * If a callback is not specified, all callbacks for the specified eventType - * will be removed. Similarly, if no eventType is specified, all callbacks - * for the `Reference` will be removed. - * - * Individual listeners can also be removed by invoking their unsubscribe - * callbacks. - * - * @param query - The query that the listener was registered with. - * @param eventType - One of the following strings: "value", "child_added", - * "child_changed", "child_removed", or "child_moved." If omitted, all callbacks - * for the `Reference` will be removed. - * @param callback - The callback function that was passed to `on()` or - * `undefined` to remove all callbacks. - */ -function off(query, eventType, callback) { - let container = null; - const expCallback = callback ? new CallbackContext(callback) : null; - if (eventType === 'value') { - container = new ValueEventRegistration(expCallback); - } - else if (eventType) { - container = new ChildEventRegistration(eventType, expCallback); - } - repoRemoveEventCallbackForQuery(query._repo, query, container); -} -/** - * A `QueryConstraint` is used to narrow the set of documents returned by a - * Database query. `QueryConstraint`s are created by invoking {@link endAt}, - * {@link endBefore}, {@link startAt}, {@link startAfter}, {@link - * limitToFirst}, {@link limitToLast}, {@link orderByChild}, - * {@link orderByChild}, {@link orderByKey} , {@link orderByPriority} , - * {@link orderByValue} or {@link equalTo} and - * can then be passed to {@link query} to create a new query instance that - * also contains this `QueryConstraint`. - */ -class QueryConstraint { -} -class QueryEndAtConstraint extends QueryConstraint { - constructor(_value, _key) { - super(); - this._value = _value; - this._key = _key; - } - _apply(query) { - validateFirebaseDataArg('endAt', this._value, query._path, true); - const newParams = queryParamsEndAt(query._queryParams, this._value, this._key); - validateLimit(newParams); - validateQueryEndpoints(newParams); - if (query._queryParams.hasEnd()) { - throw new Error('endAt: Starting point was already set (by another call to endAt, ' + - 'endBefore or equalTo).'); - } - return new QueryImpl(query._repo, query._path, newParams, query._orderByCalled); - } -} -/** - * Creates a `QueryConstraint` with the specified ending point. - * - * Using `startAt()`, `startAfter()`, `endBefore()`, `endAt()` and `equalTo()` - * allows you to choose arbitrary starting and ending points for your queries. - * - * The ending point is inclusive, so children with exactly the specified value - * will be included in the query. The optional key argument can be used to - * further limit the range of the query. If it is specified, then children that - * have exactly the specified value must also have a key name less than or equal - * to the specified key. - * - * You can read more about `endAt()` in - * {@link https://firebase.google.com/docs/database/web/lists-of-data#filtering_data | Filtering data}. - * - * @param value - The value to end at. The argument type depends on which - * `orderBy*()` function was used in this query. Specify a value that matches - * the `orderBy*()` type. When used in combination with `orderByKey()`, the - * value must be a string. - * @param key - The child key to end at, among the children with the previously - * specified priority. This argument is only allowed if ordering by child, - * value, or priority. - */ -function endAt(value, key) { - validateKey('endAt', 'key', key, true); - return new QueryEndAtConstraint(value, key); -} -class QueryEndBeforeConstraint extends QueryConstraint { - constructor(_value, _key) { - super(); - this._value = _value; - this._key = _key; - } - _apply(query) { - validateFirebaseDataArg('endBefore', this._value, query._path, false); - const newParams = queryParamsEndBefore(query._queryParams, this._value, this._key); - validateLimit(newParams); - validateQueryEndpoints(newParams); - if (query._queryParams.hasEnd()) { - throw new Error('endBefore: Starting point was already set (by another call to endAt, ' + - 'endBefore or equalTo).'); - } - return new QueryImpl(query._repo, query._path, newParams, query._orderByCalled); - } -} -/** - * Creates a `QueryConstraint` with the specified ending point (exclusive). - * - * Using `startAt()`, `startAfter()`, `endBefore()`, `endAt()` and `equalTo()` - * allows you to choose arbitrary starting and ending points for your queries. - * - * The ending point is exclusive. If only a value is provided, children - * with a value less than the specified value will be included in the query. - * If a key is specified, then children must have a value less than or equal - * to the specified value and a key name less than the specified key. - * - * @param value - The value to end before. The argument type depends on which - * `orderBy*()` function was used in this query. Specify a value that matches - * the `orderBy*()` type. When used in combination with `orderByKey()`, the - * value must be a string. - * @param key - The child key to end before, among the children with the - * previously specified priority. This argument is only allowed if ordering by - * child, value, or priority. - */ -function endBefore(value, key) { - validateKey('endBefore', 'key', key, true); - return new QueryEndBeforeConstraint(value, key); -} -class QueryStartAtConstraint extends QueryConstraint { - constructor(_value, _key) { - super(); - this._value = _value; - this._key = _key; - } - _apply(query) { - validateFirebaseDataArg('startAt', this._value, query._path, true); - const newParams = queryParamsStartAt(query._queryParams, this._value, this._key); - validateLimit(newParams); - validateQueryEndpoints(newParams); - if (query._queryParams.hasStart()) { - throw new Error('startAt: Starting point was already set (by another call to startAt, ' + - 'startBefore or equalTo).'); - } - return new QueryImpl(query._repo, query._path, newParams, query._orderByCalled); - } -} -/** - * Creates a `QueryConstraint` with the specified starting point. - * - * Using `startAt()`, `startAfter()`, `endBefore()`, `endAt()` and `equalTo()` - * allows you to choose arbitrary starting and ending points for your queries. - * - * The starting point is inclusive, so children with exactly the specified value - * will be included in the query. The optional key argument can be used to - * further limit the range of the query. If it is specified, then children that - * have exactly the specified value must also have a key name greater than or - * equal to the specified key. - * - * You can read more about `startAt()` in - * {@link https://firebase.google.com/docs/database/web/lists-of-data#filtering_data | Filtering data}. - * - * @param value - The value to start at. The argument type depends on which - * `orderBy*()` function was used in this query. Specify a value that matches - * the `orderBy*()` type. When used in combination with `orderByKey()`, the - * value must be a string. - * @param key - The child key to start at. This argument is only allowed if - * ordering by child, value, or priority. - */ -function startAt(value = null, key) { - validateKey('startAt', 'key', key, true); - return new QueryStartAtConstraint(value, key); -} -class QueryStartAfterConstraint extends QueryConstraint { - constructor(_value, _key) { - super(); - this._value = _value; - this._key = _key; - } - _apply(query) { - validateFirebaseDataArg('startAfter', this._value, query._path, false); - const newParams = queryParamsStartAfter(query._queryParams, this._value, this._key); - validateLimit(newParams); - validateQueryEndpoints(newParams); - if (query._queryParams.hasStart()) { - throw new Error('startAfter: Starting point was already set (by another call to startAt, ' + - 'startAfter, or equalTo).'); - } - return new QueryImpl(query._repo, query._path, newParams, query._orderByCalled); - } -} -/** - * Creates a `QueryConstraint` with the specified starting point (exclusive). - * - * Using `startAt()`, `startAfter()`, `endBefore()`, `endAt()` and `equalTo()` - * allows you to choose arbitrary starting and ending points for your queries. - * - * The starting point is exclusive. If only a value is provided, children - * with a value greater than the specified value will be included in the query. - * If a key is specified, then children must have a value greater than or equal - * to the specified value and a a key name greater than the specified key. - * - * @param value - The value to start after. The argument type depends on which - * `orderBy*()` function was used in this query. Specify a value that matches - * the `orderBy*()` type. When used in combination with `orderByKey()`, the - * value must be a string. - * @param key - The child key to start after. This argument is only allowed if - * ordering by child, value, or priority. - */ -function startAfter(value, key) { - validateKey('startAfter', 'key', key, true); - return new QueryStartAfterConstraint(value, key); -} -class QueryLimitToFirstConstraint extends QueryConstraint { - constructor(_limit) { - super(); - this._limit = _limit; - } - _apply(query) { - if (query._queryParams.hasLimit()) { - throw new Error('limitToFirst: Limit was already set (by another call to limitToFirst ' + - 'or limitToLast).'); - } - return new QueryImpl(query._repo, query._path, queryParamsLimitToFirst(query._queryParams, this._limit), query._orderByCalled); - } -} -/** - * Creates a new `QueryConstraint` that if limited to the first specific number - * of children. - * - * The `limitToFirst()` method is used to set a maximum number of children to be - * synced for a given callback. If we set a limit of 100, we will initially only - * receive up to 100 `child_added` events. If we have fewer than 100 messages - * stored in our Database, a `child_added` event will fire for each message. - * However, if we have over 100 messages, we will only receive a `child_added` - * event for the first 100 ordered messages. As items change, we will receive - * `child_removed` events for each item that drops out of the active list so - * that the total number stays at 100. - * - * You can read more about `limitToFirst()` in - * {@link https://firebase.google.com/docs/database/web/lists-of-data#filtering_data | Filtering data}. - * - * @param limit - The maximum number of nodes to include in this query. - */ -function limitToFirst(limit) { - if (typeof limit !== 'number' || Math.floor(limit) !== limit || limit <= 0) { - throw new Error('limitToFirst: First argument must be a positive integer.'); - } - return new QueryLimitToFirstConstraint(limit); -} -class QueryLimitToLastConstraint extends QueryConstraint { - constructor(_limit) { - super(); - this._limit = _limit; - } - _apply(query) { - if (query._queryParams.hasLimit()) { - throw new Error('limitToLast: Limit was already set (by another call to limitToFirst ' + - 'or limitToLast).'); - } - return new QueryImpl(query._repo, query._path, queryParamsLimitToLast(query._queryParams, this._limit), query._orderByCalled); - } -} -/** - * Creates a new `QueryConstraint` that is limited to return only the last - * specified number of children. - * - * The `limitToLast()` method is used to set a maximum number of children to be - * synced for a given callback. If we set a limit of 100, we will initially only - * receive up to 100 `child_added` events. If we have fewer than 100 messages - * stored in our Database, a `child_added` event will fire for each message. - * However, if we have over 100 messages, we will only receive a `child_added` - * event for the last 100 ordered messages. As items change, we will receive - * `child_removed` events for each item that drops out of the active list so - * that the total number stays at 100. - * - * You can read more about `limitToLast()` in - * {@link https://firebase.google.com/docs/database/web/lists-of-data#filtering_data | Filtering data}. - * - * @param limit - The maximum number of nodes to include in this query. - */ -function limitToLast(limit) { - if (typeof limit !== 'number' || Math.floor(limit) !== limit || limit <= 0) { - throw new Error('limitToLast: First argument must be a positive integer.'); - } - return new QueryLimitToLastConstraint(limit); -} -class QueryOrderByChildConstraint extends QueryConstraint { - constructor(_path) { - super(); - this._path = _path; - } - _apply(query) { - validateNoPreviousOrderByCall(query, 'orderByChild'); - const parsedPath = new Path(this._path); - if (pathIsEmpty(parsedPath)) { - throw new Error('orderByChild: cannot pass in empty path. Use orderByValue() instead.'); - } - const index = new PathIndex(parsedPath); - const newParams = queryParamsOrderBy(query._queryParams, index); - validateQueryEndpoints(newParams); - return new QueryImpl(query._repo, query._path, newParams, - /*orderByCalled=*/ true); - } -} -/** - * Creates a new `QueryConstraint` that orders by the specified child key. - * - * Queries can only order by one key at a time. Calling `orderByChild()` - * multiple times on the same query is an error. - * - * Firebase queries allow you to order your data by any child key on the fly. - * However, if you know in advance what your indexes will be, you can define - * them via the .indexOn rule in your Security Rules for better performance. See - * the{@link https://firebase.google.com/docs/database/security/indexing-data} - * rule for more information. - * - * You can read more about `orderByChild()` in - * {@link https://firebase.google.com/docs/database/web/lists-of-data#sort_data | Sort data}. - * - * @param path - The path to order by. - */ -function orderByChild(path) { - if (path === '$key') { - throw new Error('orderByChild: "$key" is invalid. Use orderByKey() instead.'); - } - else if (path === '$priority') { - throw new Error('orderByChild: "$priority" is invalid. Use orderByPriority() instead.'); - } - else if (path === '$value') { - throw new Error('orderByChild: "$value" is invalid. Use orderByValue() instead.'); - } - validatePathString('orderByChild', 'path', path, false); - return new QueryOrderByChildConstraint(path); -} -class QueryOrderByKeyConstraint extends QueryConstraint { - _apply(query) { - validateNoPreviousOrderByCall(query, 'orderByKey'); - const newParams = queryParamsOrderBy(query._queryParams, KEY_INDEX); - validateQueryEndpoints(newParams); - return new QueryImpl(query._repo, query._path, newParams, - /*orderByCalled=*/ true); - } -} -/** - * Creates a new `QueryConstraint` that orders by the key. - * - * Sorts the results of a query by their (ascending) key values. - * - * You can read more about `orderByKey()` in - * {@link https://firebase.google.com/docs/database/web/lists-of-data#sort_data | Sort data}. - */ -function orderByKey() { - return new QueryOrderByKeyConstraint(); -} -class QueryOrderByPriorityConstraint extends QueryConstraint { - _apply(query) { - validateNoPreviousOrderByCall(query, 'orderByPriority'); - const newParams = queryParamsOrderBy(query._queryParams, PRIORITY_INDEX); - validateQueryEndpoints(newParams); - return new QueryImpl(query._repo, query._path, newParams, - /*orderByCalled=*/ true); - } -} -/** - * Creates a new `QueryConstraint` that orders by priority. - * - * Applications need not use priority but can order collections by - * ordinary properties (see - * {@link https://firebase.google.com/docs/database/web/lists-of-data#sort_data | Sort data} - * for alternatives to priority. - */ -function orderByPriority() { - return new QueryOrderByPriorityConstraint(); -} -class QueryOrderByValueConstraint extends QueryConstraint { - _apply(query) { - validateNoPreviousOrderByCall(query, 'orderByValue'); - const newParams = queryParamsOrderBy(query._queryParams, VALUE_INDEX); - validateQueryEndpoints(newParams); - return new QueryImpl(query._repo, query._path, newParams, - /*orderByCalled=*/ true); - } -} -/** - * Creates a new `QueryConstraint` that orders by value. - * - * If the children of a query are all scalar values (string, number, or - * boolean), you can order the results by their (ascending) values. - * - * You can read more about `orderByValue()` in - * {@link https://firebase.google.com/docs/database/web/lists-of-data#sort_data | Sort data}. - */ -function orderByValue() { - return new QueryOrderByValueConstraint(); -} -class QueryEqualToValueConstraint extends QueryConstraint { - constructor(_value, _key) { - super(); - this._value = _value; - this._key = _key; - } - _apply(query) { - validateFirebaseDataArg('equalTo', this._value, query._path, false); - if (query._queryParams.hasStart()) { - throw new Error('equalTo: Starting point was already set (by another call to startAt/startAfter or ' + - 'equalTo).'); - } - if (query._queryParams.hasEnd()) { - throw new Error('equalTo: Ending point was already set (by another call to endAt/endBefore or ' + - 'equalTo).'); - } - return new QueryEndAtConstraint(this._value, this._key)._apply(new QueryStartAtConstraint(this._value, this._key)._apply(query)); - } -} -/** - * Creates a `QueryConstraint` that includes children that match the specified - * value. - * - * Using `startAt()`, `startAfter()`, `endBefore()`, `endAt()` and `equalTo()` - * allows you to choose arbitrary starting and ending points for your queries. - * - * The optional key argument can be used to further limit the range of the - * query. If it is specified, then children that have exactly the specified - * value must also have exactly the specified key as their key name. This can be - * used to filter result sets with many matches for the same value. - * - * You can read more about `equalTo()` in - * {@link https://firebase.google.com/docs/database/web/lists-of-data#filtering_data | Filtering data}. - * - * @param value - The value to match for. The argument type depends on which - * `orderBy*()` function was used in this query. Specify a value that matches - * the `orderBy*()` type. When used in combination with `orderByKey()`, the - * value must be a string. - * @param key - The child key to start at, among the children with the - * previously specified priority. This argument is only allowed if ordering by - * child, value, or priority. - */ -function equalTo(value, key) { - validateKey('equalTo', 'key', key, true); - return new QueryEqualToValueConstraint(value, key); -} -/** - * Creates a new immutable instance of `Query` that is extended to also include - * additional query constraints. - * - * @param query - The Query instance to use as a base for the new constraints. - * @param queryConstraints - The list of `QueryConstraint`s to apply. - * @throws if any of the provided query constraints cannot be combined with the - * existing or new constraints. - */ -function query(query, ...queryConstraints) { - let queryImpl = getModularInstance(query); - for (const constraint of queryConstraints) { - queryImpl = constraint._apply(queryImpl); - } - return queryImpl; -} -/** - * Define reference constructor in various modules - * - * We are doing this here to avoid several circular - * dependency issues - */ -syncPointSetReferenceConstructor(ReferenceImpl); -syncTreeSetReferenceConstructor(ReferenceImpl); - -/** - * @license - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * This variable is also defined in the firebase Node.js Admin SDK. Before - * modifying this definition, consult the definition in: - * - * https://github.com/firebase/firebase-admin-node - * - * and make sure the two are consistent. - */ -const FIREBASE_DATABASE_EMULATOR_HOST_VAR = 'FIREBASE_DATABASE_EMULATOR_HOST'; -/** - * Creates and caches `Repo` instances. - */ -const repos = {}; -/** - * If true, any new `Repo` will be created to use `ReadonlyRestClient` (for testing purposes). - */ -let useRestClient = false; -/** - * Update an existing `Repo` in place to point to a new host/port. - */ -function repoManagerApplyEmulatorSettings(repo, host, port, tokenProvider) { - repo.repoInfo_ = new RepoInfo(`${host}:${port}`, - /* secure= */ false, repo.repoInfo_.namespace, repo.repoInfo_.webSocketOnly, repo.repoInfo_.nodeAdmin, repo.repoInfo_.persistenceKey, repo.repoInfo_.includeNamespaceInQueryParams); - if (tokenProvider) { - repo.authTokenProvider_ = tokenProvider; - } -} -/** - * This function should only ever be called to CREATE a new database instance. - * @internal - */ -function repoManagerDatabaseFromApp(app, authProvider, appCheckProvider, url, nodeAdmin) { - let dbUrl = url || app.options.databaseURL; - if (dbUrl === undefined) { - if (!app.options.projectId) { - fatal("Can't determine Firebase Database URL. Be sure to include " + - ' a Project ID when calling firebase.initializeApp().'); - } - log('Using default host for project ', app.options.projectId); - dbUrl = `${app.options.projectId}-default-rtdb.firebaseio.com`; - } - let parsedUrl = parseRepoInfo(dbUrl, nodeAdmin); - let repoInfo = parsedUrl.repoInfo; - let isEmulator; - let dbEmulatorHost = undefined; - if (typeof process !== 'undefined' && process.env) { - dbEmulatorHost = process.env[FIREBASE_DATABASE_EMULATOR_HOST_VAR]; - } - if (dbEmulatorHost) { - isEmulator = true; - dbUrl = `http://${dbEmulatorHost}?ns=${repoInfo.namespace}`; - parsedUrl = parseRepoInfo(dbUrl, nodeAdmin); - repoInfo = parsedUrl.repoInfo; - } - else { - isEmulator = !parsedUrl.repoInfo.secure; - } - const authTokenProvider = nodeAdmin && isEmulator - ? new EmulatorTokenProvider(EmulatorTokenProvider.OWNER) - : new FirebaseAuthTokenProvider(app.name, app.options, authProvider); - validateUrl('Invalid Firebase Database URL', parsedUrl); - if (!pathIsEmpty(parsedUrl.path)) { - fatal('Database URL must point to the root of a Firebase Database ' + - '(not including a child path).'); - } - const repo = repoManagerCreateRepo(repoInfo, app, authTokenProvider, new AppCheckTokenProvider(app.name, appCheckProvider)); - return new Database(repo, app); -} -/** - * Remove the repo and make sure it is disconnected. - * - */ -function repoManagerDeleteRepo(repo, appName) { - const appRepos = repos[appName]; - // This should never happen... - if (!appRepos || appRepos[repo.key] !== repo) { - fatal(`Database ${appName}(${repo.repoInfo_}) has already been deleted.`); - } - repoInterrupt(repo); - delete appRepos[repo.key]; -} -/** - * Ensures a repo doesn't already exist and then creates one using the - * provided app. - * - * @param repoInfo - The metadata about the Repo - * @returns The Repo object for the specified server / repoName. - */ -function repoManagerCreateRepo(repoInfo, app, authTokenProvider, appCheckProvider) { - let appRepos = repos[app.name]; - if (!appRepos) { - appRepos = {}; - repos[app.name] = appRepos; - } - let repo = appRepos[repoInfo.toURLString()]; - if (repo) { - fatal('Database initialized multiple times. Please make sure the format of the database URL matches with each database() call.'); - } - repo = new Repo(repoInfo, useRestClient, authTokenProvider, appCheckProvider); - appRepos[repoInfo.toURLString()] = repo; - return repo; -} -/** - * Forces us to use ReadonlyRestClient instead of PersistentConnection for new Repos. - */ -function repoManagerForceRestClient(forceRestClient) { - useRestClient = forceRestClient; -} -/** - * Class representing a Firebase Realtime Database. - */ -class Database { - /** @hideconstructor */ - constructor(_repoInternal, - /** The {@link @firebase/app#FirebaseApp} associated with this Realtime Database instance. */ - app) { - this._repoInternal = _repoInternal; - this.app = app; - /** Represents a `Database` instance. */ - this['type'] = 'database'; - /** Track if the instance has been used (root or repo accessed) */ - this._instanceStarted = false; - } - get _repo() { - if (!this._instanceStarted) { - repoStart(this._repoInternal, this.app.options.appId, this.app.options['databaseAuthVariableOverride']); - this._instanceStarted = true; - } - return this._repoInternal; - } - get _root() { - if (!this._rootInternal) { - this._rootInternal = new ReferenceImpl(this._repo, newEmptyPath()); - } - return this._rootInternal; - } - _delete() { - if (this._rootInternal !== null) { - repoManagerDeleteRepo(this._repo, this.app.name); - this._repoInternal = null; - this._rootInternal = null; - } - return Promise.resolve(); - } - _checkNotDeleted(apiName) { - if (this._rootInternal === null) { - fatal('Cannot call ' + apiName + ' on a deleted database.'); - } - } -} -function checkTransportInit() { - if (TransportManager.IS_TRANSPORT_INITIALIZED) { - warn('Transport has already been initialized. Please call this function before calling ref or setting up a listener'); - } -} -/** - * Force the use of websockets instead of longPolling. - */ -function forceWebSockets() { - checkTransportInit(); - BrowserPollConnection.forceDisallow(); -} -/** - * Force the use of longPolling instead of websockets. This will be ignored if websocket protocol is used in databaseURL. - */ -function forceLongPolling() { - checkTransportInit(); - WebSocketConnection.forceDisallow(); - BrowserPollConnection.forceAllow(); -} -/** - * Returns the instance of the Realtime Database SDK that is associated - * with the provided {@link @firebase/app#FirebaseApp}. Initializes a new instance with - * with default settings if no instance exists or if the existing instance uses - * a custom database URL. - * - * @param app - The {@link @firebase/app#FirebaseApp} instance that the returned Realtime - * Database instance is associated with. - * @param url - The URL of the Realtime Database instance to connect to. If not - * provided, the SDK connects to the default instance of the Firebase App. - * @returns The `Database` instance of the provided app. - */ -function getDatabase(app = getApp(), url) { - const db = _getProvider(app, 'database').getImmediate({ - identifier: url - }); - const emulator = getDefaultEmulatorHostnameAndPort('database'); - if (emulator) { - connectDatabaseEmulator(db, ...emulator); - } - return db; -} -/** - * Modify the provided instance to communicate with the Realtime Database - * emulator. - * - *

Note: This method must be called before performing any other operation. - * - * @param db - The instance to modify. - * @param host - The emulator host (ex: localhost) - * @param port - The emulator port (ex: 8080) - * @param options.mockUserToken - the mock auth token to use for unit testing Security Rules - */ -function connectDatabaseEmulator(db, host, port, options = {}) { - db = getModularInstance(db); - db._checkNotDeleted('useEmulator'); - if (db._instanceStarted) { - fatal('Cannot call useEmulator() after instance has already been initialized.'); - } - const repo = db._repoInternal; - let tokenProvider = undefined; - if (repo.repoInfo_.nodeAdmin) { - if (options.mockUserToken) { - fatal('mockUserToken is not supported by the Admin SDK. For client access with mock users, please use the "firebase" package instead of "firebase-admin".'); - } - tokenProvider = new EmulatorTokenProvider(EmulatorTokenProvider.OWNER); - } - else if (options.mockUserToken) { - const token = typeof options.mockUserToken === 'string' - ? options.mockUserToken - : createMockUserToken(options.mockUserToken, db.app.options.projectId); - tokenProvider = new EmulatorTokenProvider(token); - } - // Modify the repo to apply emulator settings - repoManagerApplyEmulatorSettings(repo, host, port, tokenProvider); -} -/** - * Disconnects from the server (all Database operations will be completed - * offline). - * - * The client automatically maintains a persistent connection to the Database - * server, which will remain active indefinitely and reconnect when - * disconnected. However, the `goOffline()` and `goOnline()` methods may be used - * to control the client connection in cases where a persistent connection is - * undesirable. - * - * While offline, the client will no longer receive data updates from the - * Database. However, all Database operations performed locally will continue to - * immediately fire events, allowing your application to continue behaving - * normally. Additionally, each operation performed locally will automatically - * be queued and retried upon reconnection to the Database server. - * - * To reconnect to the Database and begin receiving remote events, see - * `goOnline()`. - * - * @param db - The instance to disconnect. - */ -function goOffline(db) { - db = getModularInstance(db); - db._checkNotDeleted('goOffline'); - repoInterrupt(db._repo); -} -/** - * Reconnects to the server and synchronizes the offline Database state - * with the server state. - * - * This method should be used after disabling the active connection with - * `goOffline()`. Once reconnected, the client will transmit the proper data - * and fire the appropriate events so that your client "catches up" - * automatically. - * - * @param db - The instance to reconnect. - */ -function goOnline(db) { - db = getModularInstance(db); - db._checkNotDeleted('goOnline'); - repoResume(db._repo); -} -function enableLogging(logger, persistent) { - enableLogging$1(logger, persistent); -} - -/** - * @license - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -function registerDatabase(variant) { - setSDKVersion(SDK_VERSION$1); - _registerComponent(new Component('database', (container, { instanceIdentifier: url }) => { - const app = container.getProvider('app').getImmediate(); - const authProvider = container.getProvider('auth-internal'); - const appCheckProvider = container.getProvider('app-check-internal'); - return repoManagerDatabaseFromApp(app, authProvider, appCheckProvider, url); - }, "PUBLIC" /* PUBLIC */).setMultipleInstances(true)); - registerVersion(name, version, variant); - // BUILD_TARGET will be replaced by values like esm5, esm2017, cjs5, etc during the compilation - registerVersion(name, version, 'esm2017'); -} - -/** - * @license - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -const SERVER_TIMESTAMP = { - '.sv': 'timestamp' -}; -/** - * Returns a placeholder value for auto-populating the current timestamp (time - * since the Unix epoch, in milliseconds) as determined by the Firebase - * servers. - */ -function serverTimestamp() { - return SERVER_TIMESTAMP; -} -/** - * Returns a placeholder value that can be used to atomically increment the - * current database value by the provided delta. - * - * @param delta - the amount to modify the current value atomically. - * @returns A placeholder value for modifying data atomically server-side. - */ -function increment(delta) { - return { - '.sv': { - 'increment': delta - } - }; -} - -/** - * @license - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * A type for the resolve value of {@link runTransaction}. - */ -class TransactionResult { - /** @hideconstructor */ - constructor( - /** Whether the transaction was successfully committed. */ - committed, - /** The resulting data snapshot. */ - snapshot) { - this.committed = committed; - this.snapshot = snapshot; - } - /** Returns a JSON-serializable representation of this object. */ - toJSON() { - return { committed: this.committed, snapshot: this.snapshot.toJSON() }; - } -} -/** - * Atomically modifies the data at this location. - * - * Atomically modify the data at this location. Unlike a normal `set()`, which - * just overwrites the data regardless of its previous value, `runTransaction()` is - * used to modify the existing value to a new value, ensuring there are no - * conflicts with other clients writing to the same location at the same time. - * - * To accomplish this, you pass `runTransaction()` an update function which is - * used to transform the current value into a new value. If another client - * writes to the location before your new value is successfully written, your - * update function will be called again with the new current value, and the - * write will be retried. This will happen repeatedly until your write succeeds - * without conflict or you abort the transaction by not returning a value from - * your update function. - * - * Note: Modifying data with `set()` will cancel any pending transactions at - * that location, so extreme care should be taken if mixing `set()` and - * `runTransaction()` to update the same data. - * - * Note: When using transactions with Security and Firebase Rules in place, be - * aware that a client needs `.read` access in addition to `.write` access in - * order to perform a transaction. This is because the client-side nature of - * transactions requires the client to read the data in order to transactionally - * update it. - * - * @param ref - The location to atomically modify. - * @param transactionUpdate - A developer-supplied function which will be passed - * the current data stored at this location (as a JavaScript object). The - * function should return the new value it would like written (as a JavaScript - * object). If `undefined` is returned (i.e. you return with no arguments) the - * transaction will be aborted and the data at this location will not be - * modified. - * @param options - An options object to configure transactions. - * @returns A `Promise` that can optionally be used instead of the `onComplete` - * callback to handle success and failure. - */ -function runTransaction(ref, -// eslint-disable-next-line @typescript-eslint/no-explicit-any -transactionUpdate, options) { - var _a; - ref = getModularInstance(ref); - validateWritablePath('Reference.transaction', ref._path); - if (ref.key === '.length' || ref.key === '.keys') { - throw ('Reference.transaction failed: ' + ref.key + ' is a read-only object.'); - } - const applyLocally = (_a = options === null || options === void 0 ? void 0 : options.applyLocally) !== null && _a !== void 0 ? _a : true; - const deferred = new Deferred(); - const promiseComplete = (error, committed, node) => { - let dataSnapshot = null; - if (error) { - deferred.reject(error); - } - else { - dataSnapshot = new DataSnapshot(node, new ReferenceImpl(ref._repo, ref._path), PRIORITY_INDEX); - deferred.resolve(new TransactionResult(committed, dataSnapshot)); - } - }; - // Add a watch to make sure we get server updates. - const unwatcher = onValue(ref, () => { }); - repoStartTransaction(ref._repo, ref._path, transactionUpdate, promiseComplete, unwatcher, applyLocally); - return deferred.promise; -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -PersistentConnection; -// eslint-disable-next-line @typescript-eslint/no-explicit-any -PersistentConnection.prototype.simpleListen = function (pathString, onComplete) { - this.sendRequest('q', { p: pathString }, onComplete); -}; -// eslint-disable-next-line @typescript-eslint/no-explicit-any -PersistentConnection.prototype.echo = function (data, onEcho) { - this.sendRequest('echo', { d: data }, onEcho); -}; -// RealTimeConnection properties that we use in tests. -Connection; -/** - * @internal - */ -const hijackHash = function (newHash) { - const oldPut = PersistentConnection.prototype.put; - PersistentConnection.prototype.put = function (pathString, data, onComplete, hash) { - if (hash !== undefined) { - hash = newHash(); - } - oldPut.call(this, pathString, data, onComplete, hash); - }; - return function () { - PersistentConnection.prototype.put = oldPut; - }; -}; -RepoInfo; -/** - * Forces the RepoManager to create Repos that use ReadonlyRestClient instead of PersistentConnection. - * @internal - */ -const forceRestClient = function (forceRestClient) { - repoManagerForceRestClient(forceRestClient); -}; - -/** - * Firebase Realtime Database - * - * @packageDocumentation - */ -registerDatabase(); - -export { DataSnapshot, Database, OnDisconnect, QueryConstraint, TransactionResult, QueryImpl as _QueryImpl, QueryParams as _QueryParams, ReferenceImpl as _ReferenceImpl, forceRestClient as _TEST_ACCESS_forceRestClient, hijackHash as _TEST_ACCESS_hijackHash, repoManagerDatabaseFromApp as _repoManagerDatabaseFromApp, setSDKVersion as _setSDKVersion, validatePathString as _validatePathString, validateWritablePath as _validateWritablePath, child, connectDatabaseEmulator, enableLogging, endAt, endBefore, equalTo, forceLongPolling, forceWebSockets, get, getDatabase, goOffline, goOnline, increment, limitToFirst, limitToLast, off, onChildAdded, onChildChanged, onChildMoved, onChildRemoved, onDisconnect, onValue, orderByChild, orderByKey, orderByPriority, orderByValue, push, query, ref, refFromURL, remove, runTransaction, serverTimestamp, set, setPriority, setWithPriority, startAfter, startAt, update }; -//# sourceMappingURL=index.esm2017.js.map diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/index.esm5.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/index.esm5.js deleted file mode 100644 index fc14f061..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/index.esm5.js +++ /dev/null @@ -1,14488 +0,0 @@ -import { getApp, _getProvider, _registerComponent, registerVersion, SDK_VERSION as SDK_VERSION$1 } from '@firebase/app'; -import { Component } from '@firebase/component'; -import { __spreadArray, __read, __values, __extends, __awaiter, __generator, __assign } from 'tslib'; -import { stringify, jsonEval, contains, assert, isNodeSdk, stringToByteArray, Sha1, base64, deepCopy, base64Encode, isMobileCordova, stringLength, Deferred, safeGet, isAdmin, isValidFormat, isEmpty, isReactNative, assertionError, map, querystring, errorPrefix, getModularInstance, getDefaultEmulatorHostnameAndPort, createMockUserToken } from '@firebase/util'; -import { Logger, LogLevel } from '@firebase/logger'; - -var name = "@firebase/database"; -var version = "0.13.10"; - -/** - * @license - * Copyright 2019 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** The semver (www.semver.org) version of the SDK. */ -var SDK_VERSION = ''; -/** - * SDK_VERSION should be set before any database instance is created - * @internal - */ -function setSDKVersion(version) { - SDK_VERSION = version; -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Wraps a DOM Storage object and: - * - automatically encode objects as JSON strings before storing them to allow us to store arbitrary types. - * - prefixes names with "firebase:" to avoid collisions with app data. - * - * We automatically (see storage.js) create two such wrappers, one for sessionStorage, - * and one for localStorage. - * - */ -var DOMStorageWrapper = /** @class */ (function () { - /** - * @param domStorage_ - The underlying storage object (e.g. localStorage or sessionStorage) - */ - function DOMStorageWrapper(domStorage_) { - this.domStorage_ = domStorage_; - // Use a prefix to avoid collisions with other stuff saved by the app. - this.prefix_ = 'firebase:'; - } - /** - * @param key - The key to save the value under - * @param value - The value being stored, or null to remove the key. - */ - DOMStorageWrapper.prototype.set = function (key, value) { - if (value == null) { - this.domStorage_.removeItem(this.prefixedName_(key)); - } - else { - this.domStorage_.setItem(this.prefixedName_(key), stringify(value)); - } - }; - /** - * @returns The value that was stored under this key, or null - */ - DOMStorageWrapper.prototype.get = function (key) { - var storedVal = this.domStorage_.getItem(this.prefixedName_(key)); - if (storedVal == null) { - return null; - } - else { - return jsonEval(storedVal); - } - }; - DOMStorageWrapper.prototype.remove = function (key) { - this.domStorage_.removeItem(this.prefixedName_(key)); - }; - DOMStorageWrapper.prototype.prefixedName_ = function (name) { - return this.prefix_ + name; - }; - DOMStorageWrapper.prototype.toString = function () { - return this.domStorage_.toString(); - }; - return DOMStorageWrapper; -}()); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * An in-memory storage implementation that matches the API of DOMStorageWrapper - * (TODO: create interface for both to implement). - */ -var MemoryStorage = /** @class */ (function () { - function MemoryStorage() { - this.cache_ = {}; - this.isInMemoryStorage = true; - } - MemoryStorage.prototype.set = function (key, value) { - if (value == null) { - delete this.cache_[key]; - } - else { - this.cache_[key] = value; - } - }; - MemoryStorage.prototype.get = function (key) { - if (contains(this.cache_, key)) { - return this.cache_[key]; - } - return null; - }; - MemoryStorage.prototype.remove = function (key) { - delete this.cache_[key]; - }; - return MemoryStorage; -}()); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Helper to create a DOMStorageWrapper or else fall back to MemoryStorage. - * TODO: Once MemoryStorage and DOMStorageWrapper have a shared interface this method annotation should change - * to reflect this type - * - * @param domStorageName - Name of the underlying storage object - * (e.g. 'localStorage' or 'sessionStorage'). - * @returns Turning off type information until a common interface is defined. - */ -var createStoragefor = function (domStorageName) { - try { - // NOTE: just accessing "localStorage" or "window['localStorage']" may throw a security exception, - // so it must be inside the try/catch. - if (typeof window !== 'undefined' && - typeof window[domStorageName] !== 'undefined') { - // Need to test cache. Just because it's here doesn't mean it works - var domStorage = window[domStorageName]; - domStorage.setItem('firebase:sentinel', 'cache'); - domStorage.removeItem('firebase:sentinel'); - return new DOMStorageWrapper(domStorage); - } - } - catch (e) { } - // Failed to create wrapper. Just return in-memory storage. - // TODO: log? - return new MemoryStorage(); -}; -/** A storage object that lasts across sessions */ -var PersistentStorage = createStoragefor('localStorage'); -/** A storage object that only lasts one session */ -var SessionStorage = createStoragefor('sessionStorage'); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var logClient = new Logger('@firebase/database'); -/** - * Returns a locally-unique ID (generated by just incrementing up from 0 each time its called). - */ -var LUIDGenerator = (function () { - var id = 1; - return function () { - return id++; - }; -})(); -/** - * Sha1 hash of the input string - * @param str - The string to hash - * @returns {!string} The resulting hash - */ -var sha1 = function (str) { - var utf8Bytes = stringToByteArray(str); - var sha1 = new Sha1(); - sha1.update(utf8Bytes); - var sha1Bytes = sha1.digest(); - return base64.encodeByteArray(sha1Bytes); -}; -var buildLogMessage_ = function () { - var varArgs = []; - for (var _i = 0; _i < arguments.length; _i++) { - varArgs[_i] = arguments[_i]; - } - var message = ''; - for (var i = 0; i < varArgs.length; i++) { - var arg = varArgs[i]; - if (Array.isArray(arg) || - (arg && - typeof arg === 'object' && - // eslint-disable-next-line @typescript-eslint/no-explicit-any - typeof arg.length === 'number')) { - message += buildLogMessage_.apply(null, arg); - } - else if (typeof arg === 'object') { - message += stringify(arg); - } - else { - message += arg; - } - message += ' '; - } - return message; -}; -/** - * Use this for all debug messages in Firebase. - */ -var logger = null; -/** - * Flag to check for log availability on first log message - */ -var firstLog_ = true; -/** - * The implementation of Firebase.enableLogging (defined here to break dependencies) - * @param logger_ - A flag to turn on logging, or a custom logger - * @param persistent - Whether or not to persist logging settings across refreshes - */ -var enableLogging$1 = function (logger_, persistent) { - assert(!persistent || logger_ === true || logger_ === false, "Can't turn on custom loggers persistently."); - if (logger_ === true) { - logClient.logLevel = LogLevel.VERBOSE; - logger = logClient.log.bind(logClient); - if (persistent) { - SessionStorage.set('logging_enabled', true); - } - } - else if (typeof logger_ === 'function') { - logger = logger_; - } - else { - logger = null; - SessionStorage.remove('logging_enabled'); - } -}; -var log = function () { - var varArgs = []; - for (var _i = 0; _i < arguments.length; _i++) { - varArgs[_i] = arguments[_i]; - } - if (firstLog_ === true) { - firstLog_ = false; - if (logger === null && SessionStorage.get('logging_enabled') === true) { - enableLogging$1(true); - } - } - if (logger) { - var message = buildLogMessage_.apply(null, varArgs); - logger(message); - } -}; -var logWrapper = function (prefix) { - return function () { - var varArgs = []; - for (var _i = 0; _i < arguments.length; _i++) { - varArgs[_i] = arguments[_i]; - } - log.apply(void 0, __spreadArray([prefix], __read(varArgs))); - }; -}; -var error = function () { - var varArgs = []; - for (var _i = 0; _i < arguments.length; _i++) { - varArgs[_i] = arguments[_i]; - } - var message = 'FIREBASE INTERNAL ERROR: ' + buildLogMessage_.apply(void 0, __spreadArray([], __read(varArgs))); - logClient.error(message); -}; -var fatal = function () { - var varArgs = []; - for (var _i = 0; _i < arguments.length; _i++) { - varArgs[_i] = arguments[_i]; - } - var message = "FIREBASE FATAL ERROR: " + buildLogMessage_.apply(void 0, __spreadArray([], __read(varArgs))); - logClient.error(message); - throw new Error(message); -}; -var warn = function () { - var varArgs = []; - for (var _i = 0; _i < arguments.length; _i++) { - varArgs[_i] = arguments[_i]; - } - var message = 'FIREBASE WARNING: ' + buildLogMessage_.apply(void 0, __spreadArray([], __read(varArgs))); - logClient.warn(message); -}; -/** - * Logs a warning if the containing page uses https. Called when a call to new Firebase - * does not use https. - */ -var warnIfPageIsSecure = function () { - // Be very careful accessing browser globals. Who knows what may or may not exist. - if (typeof window !== 'undefined' && - window.location && - window.location.protocol && - window.location.protocol.indexOf('https:') !== -1) { - warn('Insecure Firebase access from a secure page. ' + - 'Please use https in calls to new Firebase().'); - } -}; -/** - * Returns true if data is NaN, or +/- Infinity. - */ -var isInvalidJSONNumber = function (data) { - return (typeof data === 'number' && - (data !== data || // NaN - data === Number.POSITIVE_INFINITY || - data === Number.NEGATIVE_INFINITY)); -}; -var executeWhenDOMReady = function (fn) { - if (isNodeSdk() || document.readyState === 'complete') { - fn(); - } - else { - // Modeled after jQuery. Try DOMContentLoaded and onreadystatechange (which - // fire before onload), but fall back to onload. - var called_1 = false; - var wrappedFn_1 = function () { - if (!document.body) { - setTimeout(wrappedFn_1, Math.floor(10)); - return; - } - if (!called_1) { - called_1 = true; - fn(); - } - }; - if (document.addEventListener) { - document.addEventListener('DOMContentLoaded', wrappedFn_1, false); - // fallback to onload. - window.addEventListener('load', wrappedFn_1, false); - // eslint-disable-next-line @typescript-eslint/no-explicit-any - } - else if (document.attachEvent) { - // IE. - // eslint-disable-next-line @typescript-eslint/no-explicit-any - document.attachEvent('onreadystatechange', function () { - if (document.readyState === 'complete') { - wrappedFn_1(); - } - }); - // fallback to onload. - // eslint-disable-next-line @typescript-eslint/no-explicit-any - window.attachEvent('onload', wrappedFn_1); - // jQuery has an extra hack for IE that we could employ (based on - // http://javascript.nwbox.com/IEContentLoaded/) But it looks really old. - // I'm hoping we don't need it. - } - } -}; -/** - * Minimum key name. Invalid for actual data, used as a marker to sort before any valid names - */ -var MIN_NAME = '[MIN_NAME]'; -/** - * Maximum key name. Invalid for actual data, used as a marker to sort above any valid names - */ -var MAX_NAME = '[MAX_NAME]'; -/** - * Compares valid Firebase key names, plus min and max name - */ -var nameCompare = function (a, b) { - if (a === b) { - return 0; - } - else if (a === MIN_NAME || b === MAX_NAME) { - return -1; - } - else if (b === MIN_NAME || a === MAX_NAME) { - return 1; - } - else { - var aAsInt = tryParseInt(a), bAsInt = tryParseInt(b); - if (aAsInt !== null) { - if (bAsInt !== null) { - return aAsInt - bAsInt === 0 ? a.length - b.length : aAsInt - bAsInt; - } - else { - return -1; - } - } - else if (bAsInt !== null) { - return 1; - } - else { - return a < b ? -1 : 1; - } - } -}; -/** - * @returns {!number} comparison result. - */ -var stringCompare = function (a, b) { - if (a === b) { - return 0; - } - else if (a < b) { - return -1; - } - else { - return 1; - } -}; -var requireKey = function (key, obj) { - if (obj && key in obj) { - return obj[key]; - } - else { - throw new Error('Missing required key (' + key + ') in object: ' + stringify(obj)); - } -}; -var ObjectToUniqueKey = function (obj) { - if (typeof obj !== 'object' || obj === null) { - return stringify(obj); - } - var keys = []; - // eslint-disable-next-line guard-for-in - for (var k in obj) { - keys.push(k); - } - // Export as json, but with the keys sorted. - keys.sort(); - var key = '{'; - for (var i = 0; i < keys.length; i++) { - if (i !== 0) { - key += ','; - } - key += stringify(keys[i]); - key += ':'; - key += ObjectToUniqueKey(obj[keys[i]]); - } - key += '}'; - return key; -}; -/** - * Splits a string into a number of smaller segments of maximum size - * @param str - The string - * @param segsize - The maximum number of chars in the string. - * @returns The string, split into appropriately-sized chunks - */ -var splitStringBySize = function (str, segsize) { - var len = str.length; - if (len <= segsize) { - return [str]; - } - var dataSegs = []; - for (var c = 0; c < len; c += segsize) { - if (c + segsize > len) { - dataSegs.push(str.substring(c, len)); - } - else { - dataSegs.push(str.substring(c, c + segsize)); - } - } - return dataSegs; -}; -/** - * Apply a function to each (key, value) pair in an object or - * apply a function to each (index, value) pair in an array - * @param obj - The object or array to iterate over - * @param fn - The function to apply - */ -function each(obj, fn) { - for (var key in obj) { - if (obj.hasOwnProperty(key)) { - fn(key, obj[key]); - } - } -} -/** - * Borrowed from http://hg.secondlife.com/llsd/src/tip/js/typedarray.js (MIT License) - * I made one modification at the end and removed the NaN / Infinity - * handling (since it seemed broken [caused an overflow] and we don't need it). See MJL comments. - * @param v - A double - * - */ -var doubleToIEEE754String = function (v) { - assert(!isInvalidJSONNumber(v), 'Invalid JSON number'); // MJL - var ebits = 11, fbits = 52; - var bias = (1 << (ebits - 1)) - 1; - var s, e, f, ln, i; - // Compute sign, exponent, fraction - // Skip NaN / Infinity handling --MJL. - if (v === 0) { - e = 0; - f = 0; - s = 1 / v === -Infinity ? 1 : 0; - } - else { - s = v < 0; - v = Math.abs(v); - if (v >= Math.pow(2, 1 - bias)) { - // Normalized - ln = Math.min(Math.floor(Math.log(v) / Math.LN2), bias); - e = ln + bias; - f = Math.round(v * Math.pow(2, fbits - ln) - Math.pow(2, fbits)); - } - else { - // Denormalized - e = 0; - f = Math.round(v / Math.pow(2, 1 - bias - fbits)); - } - } - // Pack sign, exponent, fraction - var bits = []; - for (i = fbits; i; i -= 1) { - bits.push(f % 2 ? 1 : 0); - f = Math.floor(f / 2); - } - for (i = ebits; i; i -= 1) { - bits.push(e % 2 ? 1 : 0); - e = Math.floor(e / 2); - } - bits.push(s ? 1 : 0); - bits.reverse(); - var str = bits.join(''); - // Return the data as a hex string. --MJL - var hexByteString = ''; - for (i = 0; i < 64; i += 8) { - var hexByte = parseInt(str.substr(i, 8), 2).toString(16); - if (hexByte.length === 1) { - hexByte = '0' + hexByte; - } - hexByteString = hexByteString + hexByte; - } - return hexByteString.toLowerCase(); -}; -/** - * Used to detect if we're in a Chrome content script (which executes in an - * isolated environment where long-polling doesn't work). - */ -var isChromeExtensionContentScript = function () { - return !!(typeof window === 'object' && - window['chrome'] && - window['chrome']['extension'] && - !/^chrome/.test(window.location.href)); -}; -/** - * Used to detect if we're in a Windows 8 Store app. - */ -var isWindowsStoreApp = function () { - // Check for the presence of a couple WinRT globals - return typeof Windows === 'object' && typeof Windows.UI === 'object'; -}; -/** - * Converts a server error code to a Javascript Error - */ -function errorForServerCode(code, query) { - var reason = 'Unknown Error'; - if (code === 'too_big') { - reason = - 'The data requested exceeds the maximum size ' + - 'that can be accessed with a single request.'; - } - else if (code === 'permission_denied') { - reason = "Client doesn't have permission to access the desired data."; - } - else if (code === 'unavailable') { - reason = 'The service is unavailable'; - } - var error = new Error(code + ' at ' + query._path.toString() + ': ' + reason); - // eslint-disable-next-line @typescript-eslint/no-explicit-any - error.code = code.toUpperCase(); - return error; -} -/** - * Used to test for integer-looking strings - */ -var INTEGER_REGEXP_ = new RegExp('^-?(0*)\\d{1,10}$'); -/** - * For use in keys, the minimum possible 32-bit integer. - */ -var INTEGER_32_MIN = -2147483648; -/** - * For use in kyes, the maximum possible 32-bit integer. - */ -var INTEGER_32_MAX = 2147483647; -/** - * If the string contains a 32-bit integer, return it. Else return null. - */ -var tryParseInt = function (str) { - if (INTEGER_REGEXP_.test(str)) { - var intVal = Number(str); - if (intVal >= INTEGER_32_MIN && intVal <= INTEGER_32_MAX) { - return intVal; - } - } - return null; -}; -/** - * Helper to run some code but catch any exceptions and re-throw them later. - * Useful for preventing user callbacks from breaking internal code. - * - * Re-throwing the exception from a setTimeout is a little evil, but it's very - * convenient (we don't have to try to figure out when is a safe point to - * re-throw it), and the behavior seems reasonable: - * - * * If you aren't pausing on exceptions, you get an error in the console with - * the correct stack trace. - * * If you're pausing on all exceptions, the debugger will pause on your - * exception and then again when we rethrow it. - * * If you're only pausing on uncaught exceptions, the debugger will only pause - * on us re-throwing it. - * - * @param fn - The code to guard. - */ -var exceptionGuard = function (fn) { - try { - fn(); - } - catch (e) { - // Re-throw exception when it's safe. - setTimeout(function () { - // It used to be that "throw e" would result in a good console error with - // relevant context, but as of Chrome 39, you just get the firebase.js - // file/line number where we re-throw it, which is useless. So we log - // e.stack explicitly. - var stack = e.stack || ''; - warn('Exception was thrown by user callback.', stack); - throw e; - }, Math.floor(0)); - } -}; -/** - * @returns {boolean} true if we think we're currently being crawled. - */ -var beingCrawled = function () { - var userAgent = (typeof window === 'object' && - window['navigator'] && - window['navigator']['userAgent']) || - ''; - // For now we whitelist the most popular crawlers. We should refine this to be the set of crawlers we - // believe to support JavaScript/AJAX rendering. - // NOTE: Google Webmaster Tools doesn't really belong, but their "This is how a visitor to your website - // would have seen the page" is flaky if we don't treat it as a crawler. - return (userAgent.search(/googlebot|google webmaster tools|bingbot|yahoo! slurp|baiduspider|yandexbot|duckduckbot/i) >= 0); -}; -/** - * Same as setTimeout() except on Node.JS it will /not/ prevent the process from exiting. - * - * It is removed with clearTimeout() as normal. - * - * @param fn - Function to run. - * @param time - Milliseconds to wait before running. - * @returns The setTimeout() return value. - */ -var setTimeoutNonBlocking = function (fn, time) { - var timeout = setTimeout(fn, time); - // Note: at the time of this comment, unrefTimer is under the unstable set of APIs. Run with --unstable to enable the API. - if (typeof timeout === 'number' && - // @ts-ignore Is only defined in Deno environments. - typeof Deno !== 'undefined' && - // @ts-ignore Deno and unrefTimer are only defined in Deno environments. - Deno['unrefTimer']) { - // @ts-ignore Deno and unrefTimer are only defined in Deno environments. - Deno.unrefTimer(timeout); - // eslint-disable-next-line @typescript-eslint/no-explicit-any - } - else if (typeof timeout === 'object' && timeout['unref']) { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - timeout['unref'](); - } - return timeout; -}; - -/** - * @license - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Abstraction around AppCheck's token fetching capabilities. - */ -var AppCheckTokenProvider = /** @class */ (function () { - function AppCheckTokenProvider(appName_, appCheckProvider) { - var _this = this; - this.appName_ = appName_; - this.appCheckProvider = appCheckProvider; - this.appCheck = appCheckProvider === null || appCheckProvider === void 0 ? void 0 : appCheckProvider.getImmediate({ optional: true }); - if (!this.appCheck) { - appCheckProvider === null || appCheckProvider === void 0 ? void 0 : appCheckProvider.get().then(function (appCheck) { return (_this.appCheck = appCheck); }); - } - } - AppCheckTokenProvider.prototype.getToken = function (forceRefresh) { - var _this = this; - if (!this.appCheck) { - return new Promise(function (resolve, reject) { - // Support delayed initialization of FirebaseAppCheck. This allows our - // customers to initialize the RTDB SDK before initializing Firebase - // AppCheck and ensures that all requests are authenticated if a token - // becomes available before the timoeout below expires. - setTimeout(function () { - if (_this.appCheck) { - _this.getToken(forceRefresh).then(resolve, reject); - } - else { - resolve(null); - } - }, 0); - }); - } - return this.appCheck.getToken(forceRefresh); - }; - AppCheckTokenProvider.prototype.addTokenChangeListener = function (listener) { - var _a; - (_a = this.appCheckProvider) === null || _a === void 0 ? void 0 : _a.get().then(function (appCheck) { return appCheck.addTokenListener(listener); }); - }; - AppCheckTokenProvider.prototype.notifyForInvalidToken = function () { - warn("Provided AppCheck credentials for the app named \"" + this.appName_ + "\" " + - 'are invalid. This usually indicates your app was not initialized correctly.'); - }; - return AppCheckTokenProvider; -}()); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Abstraction around FirebaseApp's token fetching capabilities. - */ -var FirebaseAuthTokenProvider = /** @class */ (function () { - function FirebaseAuthTokenProvider(appName_, firebaseOptions_, authProvider_) { - var _this = this; - this.appName_ = appName_; - this.firebaseOptions_ = firebaseOptions_; - this.authProvider_ = authProvider_; - this.auth_ = null; - this.auth_ = authProvider_.getImmediate({ optional: true }); - if (!this.auth_) { - authProvider_.onInit(function (auth) { return (_this.auth_ = auth); }); - } - } - FirebaseAuthTokenProvider.prototype.getToken = function (forceRefresh) { - var _this = this; - if (!this.auth_) { - return new Promise(function (resolve, reject) { - // Support delayed initialization of FirebaseAuth. This allows our - // customers to initialize the RTDB SDK before initializing Firebase - // Auth and ensures that all requests are authenticated if a token - // becomes available before the timoeout below expires. - setTimeout(function () { - if (_this.auth_) { - _this.getToken(forceRefresh).then(resolve, reject); - } - else { - resolve(null); - } - }, 0); - }); - } - return this.auth_.getToken(forceRefresh).catch(function (error) { - // TODO: Need to figure out all the cases this is raised and whether - // this makes sense. - if (error && error.code === 'auth/token-not-initialized') { - log('Got auth/token-not-initialized error. Treating as null token.'); - return null; - } - else { - return Promise.reject(error); - } - }); - }; - FirebaseAuthTokenProvider.prototype.addTokenChangeListener = function (listener) { - // TODO: We might want to wrap the listener and call it with no args to - // avoid a leaky abstraction, but that makes removing the listener harder. - if (this.auth_) { - this.auth_.addAuthTokenListener(listener); - } - else { - this.authProvider_ - .get() - .then(function (auth) { return auth.addAuthTokenListener(listener); }); - } - }; - FirebaseAuthTokenProvider.prototype.removeTokenChangeListener = function (listener) { - this.authProvider_ - .get() - .then(function (auth) { return auth.removeAuthTokenListener(listener); }); - }; - FirebaseAuthTokenProvider.prototype.notifyForInvalidToken = function () { - var errorMessage = 'Provided authentication credentials for the app named "' + - this.appName_ + - '" are invalid. This usually indicates your app was not ' + - 'initialized correctly. '; - if ('credential' in this.firebaseOptions_) { - errorMessage += - 'Make sure the "credential" property provided to initializeApp() ' + - 'is authorized to access the specified "databaseURL" and is from the correct ' + - 'project.'; - } - else if ('serviceAccount' in this.firebaseOptions_) { - errorMessage += - 'Make sure the "serviceAccount" property provided to initializeApp() ' + - 'is authorized to access the specified "databaseURL" and is from the correct ' + - 'project.'; - } - else { - errorMessage += - 'Make sure the "apiKey" and "databaseURL" properties provided to ' + - 'initializeApp() match the values provided for your app at ' + - 'https://console.firebase.google.com/.'; - } - warn(errorMessage); - }; - return FirebaseAuthTokenProvider; -}()); -/* AuthTokenProvider that supplies a constant token. Used by Admin SDK or mockUserToken with emulators. */ -var EmulatorTokenProvider = /** @class */ (function () { - function EmulatorTokenProvider(accessToken) { - this.accessToken = accessToken; - } - EmulatorTokenProvider.prototype.getToken = function (forceRefresh) { - return Promise.resolve({ - accessToken: this.accessToken - }); - }; - EmulatorTokenProvider.prototype.addTokenChangeListener = function (listener) { - // Invoke the listener immediately to match the behavior in Firebase Auth - // (see packages/auth/src/auth.js#L1807) - listener(this.accessToken); - }; - EmulatorTokenProvider.prototype.removeTokenChangeListener = function (listener) { }; - EmulatorTokenProvider.prototype.notifyForInvalidToken = function () { }; - /** A string that is treated as an admin access token by the RTDB emulator. Used by Admin SDK. */ - EmulatorTokenProvider.OWNER = 'owner'; - return EmulatorTokenProvider; -}()); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var PROTOCOL_VERSION = '5'; -var VERSION_PARAM = 'v'; -var TRANSPORT_SESSION_PARAM = 's'; -var REFERER_PARAM = 'r'; -var FORGE_REF = 'f'; -// Matches console.firebase.google.com, firebase-console-*.corp.google.com and -// firebase.corp.google.com -var FORGE_DOMAIN_RE = /(console\.firebase|firebase-console-\w+\.corp|firebase\.corp)\.google\.com/; -var LAST_SESSION_PARAM = 'ls'; -var APPLICATION_ID_PARAM = 'p'; -var APP_CHECK_TOKEN_PARAM = 'ac'; -var WEBSOCKET = 'websocket'; -var LONG_POLLING = 'long_polling'; - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * A class that holds metadata about a Repo object - */ -var RepoInfo = /** @class */ (function () { - /** - * @param host - Hostname portion of the url for the repo - * @param secure - Whether or not this repo is accessed over ssl - * @param namespace - The namespace represented by the repo - * @param webSocketOnly - Whether to prefer websockets over all other transports (used by Nest). - * @param nodeAdmin - Whether this instance uses Admin SDK credentials - * @param persistenceKey - Override the default session persistence storage key - */ - function RepoInfo(host, secure, namespace, webSocketOnly, nodeAdmin, persistenceKey, includeNamespaceInQueryParams) { - if (nodeAdmin === void 0) { nodeAdmin = false; } - if (persistenceKey === void 0) { persistenceKey = ''; } - if (includeNamespaceInQueryParams === void 0) { includeNamespaceInQueryParams = false; } - this.secure = secure; - this.namespace = namespace; - this.webSocketOnly = webSocketOnly; - this.nodeAdmin = nodeAdmin; - this.persistenceKey = persistenceKey; - this.includeNamespaceInQueryParams = includeNamespaceInQueryParams; - this._host = host.toLowerCase(); - this._domain = this._host.substr(this._host.indexOf('.') + 1); - this.internalHost = - PersistentStorage.get('host:' + host) || this._host; - } - RepoInfo.prototype.isCacheableHost = function () { - return this.internalHost.substr(0, 2) === 's-'; - }; - RepoInfo.prototype.isCustomHost = function () { - return (this._domain !== 'firebaseio.com' && - this._domain !== 'firebaseio-demo.com'); - }; - Object.defineProperty(RepoInfo.prototype, "host", { - get: function () { - return this._host; - }, - set: function (newHost) { - if (newHost !== this.internalHost) { - this.internalHost = newHost; - if (this.isCacheableHost()) { - PersistentStorage.set('host:' + this._host, this.internalHost); - } - } - }, - enumerable: false, - configurable: true - }); - RepoInfo.prototype.toString = function () { - var str = this.toURLString(); - if (this.persistenceKey) { - str += '<' + this.persistenceKey + '>'; - } - return str; - }; - RepoInfo.prototype.toURLString = function () { - var protocol = this.secure ? 'https://' : 'http://'; - var query = this.includeNamespaceInQueryParams - ? "?ns=" + this.namespace - : ''; - return "" + protocol + this.host + "/" + query; - }; - return RepoInfo; -}()); -function repoInfoNeedsQueryParam(repoInfo) { - return (repoInfo.host !== repoInfo.internalHost || - repoInfo.isCustomHost() || - repoInfo.includeNamespaceInQueryParams); -} -/** - * Returns the websocket URL for this repo - * @param repoInfo - RepoInfo object - * @param type - of connection - * @param params - list - * @returns The URL for this repo - */ -function repoInfoConnectionURL(repoInfo, type, params) { - assert(typeof type === 'string', 'typeof type must == string'); - assert(typeof params === 'object', 'typeof params must == object'); - var connURL; - if (type === WEBSOCKET) { - connURL = - (repoInfo.secure ? 'wss://' : 'ws://') + repoInfo.internalHost + '/.ws?'; - } - else if (type === LONG_POLLING) { - connURL = - (repoInfo.secure ? 'https://' : 'http://') + - repoInfo.internalHost + - '/.lp?'; - } - else { - throw new Error('Unknown connection type: ' + type); - } - if (repoInfoNeedsQueryParam(repoInfo)) { - params['ns'] = repoInfo.namespace; - } - var pairs = []; - each(params, function (key, value) { - pairs.push(key + '=' + value); - }); - return connURL + pairs.join('&'); -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Tracks a collection of stats. - */ -var StatsCollection = /** @class */ (function () { - function StatsCollection() { - this.counters_ = {}; - } - StatsCollection.prototype.incrementCounter = function (name, amount) { - if (amount === void 0) { amount = 1; } - if (!contains(this.counters_, name)) { - this.counters_[name] = 0; - } - this.counters_[name] += amount; - }; - StatsCollection.prototype.get = function () { - return deepCopy(this.counters_); - }; - return StatsCollection; -}()); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var collections = {}; -var reporters = {}; -function statsManagerGetCollection(repoInfo) { - var hashString = repoInfo.toString(); - if (!collections[hashString]) { - collections[hashString] = new StatsCollection(); - } - return collections[hashString]; -} -function statsManagerGetOrCreateReporter(repoInfo, creatorFunction) { - var hashString = repoInfo.toString(); - if (!reporters[hashString]) { - reporters[hashString] = creatorFunction(); - } - return reporters[hashString]; -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * This class ensures the packets from the server arrive in order - * This class takes data from the server and ensures it gets passed into the callbacks in order. - */ -var PacketReceiver = /** @class */ (function () { - /** - * @param onMessage_ - */ - function PacketReceiver(onMessage_) { - this.onMessage_ = onMessage_; - this.pendingResponses = []; - this.currentResponseNum = 0; - this.closeAfterResponse = -1; - this.onClose = null; - } - PacketReceiver.prototype.closeAfter = function (responseNum, callback) { - this.closeAfterResponse = responseNum; - this.onClose = callback; - if (this.closeAfterResponse < this.currentResponseNum) { - this.onClose(); - this.onClose = null; - } - }; - /** - * Each message from the server comes with a response number, and an array of data. The responseNumber - * allows us to ensure that we process them in the right order, since we can't be guaranteed that all - * browsers will respond in the same order as the requests we sent - */ - PacketReceiver.prototype.handleResponse = function (requestNum, data) { - var _this = this; - this.pendingResponses[requestNum] = data; - var _loop_1 = function () { - var toProcess = this_1.pendingResponses[this_1.currentResponseNum]; - delete this_1.pendingResponses[this_1.currentResponseNum]; - var _loop_2 = function (i) { - if (toProcess[i]) { - exceptionGuard(function () { - _this.onMessage_(toProcess[i]); - }); - } - }; - for (var i = 0; i < toProcess.length; ++i) { - _loop_2(i); - } - if (this_1.currentResponseNum === this_1.closeAfterResponse) { - if (this_1.onClose) { - this_1.onClose(); - this_1.onClose = null; - } - return "break"; - } - this_1.currentResponseNum++; - }; - var this_1 = this; - while (this.pendingResponses[this.currentResponseNum]) { - var state_1 = _loop_1(); - if (state_1 === "break") - break; - } - }; - return PacketReceiver; -}()); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// URL query parameters associated with longpolling -var FIREBASE_LONGPOLL_START_PARAM = 'start'; -var FIREBASE_LONGPOLL_CLOSE_COMMAND = 'close'; -var FIREBASE_LONGPOLL_COMMAND_CB_NAME = 'pLPCommand'; -var FIREBASE_LONGPOLL_DATA_CB_NAME = 'pRTLPCB'; -var FIREBASE_LONGPOLL_ID_PARAM = 'id'; -var FIREBASE_LONGPOLL_PW_PARAM = 'pw'; -var FIREBASE_LONGPOLL_SERIAL_PARAM = 'ser'; -var FIREBASE_LONGPOLL_CALLBACK_ID_PARAM = 'cb'; -var FIREBASE_LONGPOLL_SEGMENT_NUM_PARAM = 'seg'; -var FIREBASE_LONGPOLL_SEGMENTS_IN_PACKET = 'ts'; -var FIREBASE_LONGPOLL_DATA_PARAM = 'd'; -var FIREBASE_LONGPOLL_DISCONN_FRAME_REQUEST_PARAM = 'dframe'; -//Data size constants. -//TODO: Perf: the maximum length actually differs from browser to browser. -// We should check what browser we're on and set accordingly. -var MAX_URL_DATA_SIZE = 1870; -var SEG_HEADER_SIZE = 30; //ie: &seg=8299234&ts=982389123&d= -var MAX_PAYLOAD_SIZE = MAX_URL_DATA_SIZE - SEG_HEADER_SIZE; -/** - * Keepalive period - * send a fresh request at minimum every 25 seconds. Opera has a maximum request - * length of 30 seconds that we can't exceed. - */ -var KEEPALIVE_REQUEST_INTERVAL = 25000; -/** - * How long to wait before aborting a long-polling connection attempt. - */ -var LP_CONNECT_TIMEOUT = 30000; -/** - * This class manages a single long-polling connection. - */ -var BrowserPollConnection = /** @class */ (function () { - /** - * @param connId An identifier for this connection, used for logging - * @param repoInfo The info for the endpoint to send data to. - * @param applicationId The Firebase App ID for this project. - * @param appCheckToken The AppCheck token for this client. - * @param authToken The AuthToken to use for this connection. - * @param transportSessionId Optional transportSessionid if we are - * reconnecting for an existing transport session - * @param lastSessionId Optional lastSessionId if the PersistentConnection has - * already created a connection previously - */ - function BrowserPollConnection(connId, repoInfo, applicationId, appCheckToken, authToken, transportSessionId, lastSessionId) { - var _this = this; - this.connId = connId; - this.repoInfo = repoInfo; - this.applicationId = applicationId; - this.appCheckToken = appCheckToken; - this.authToken = authToken; - this.transportSessionId = transportSessionId; - this.lastSessionId = lastSessionId; - this.bytesSent = 0; - this.bytesReceived = 0; - this.everConnected_ = false; - this.log_ = logWrapper(connId); - this.stats_ = statsManagerGetCollection(repoInfo); - this.urlFn = function (params) { - // Always add the token if we have one. - if (_this.appCheckToken) { - params[APP_CHECK_TOKEN_PARAM] = _this.appCheckToken; - } - return repoInfoConnectionURL(repoInfo, LONG_POLLING, params); - }; - } - /** - * @param onMessage - Callback when messages arrive - * @param onDisconnect - Callback with connection lost. - */ - BrowserPollConnection.prototype.open = function (onMessage, onDisconnect) { - var _this = this; - this.curSegmentNum = 0; - this.onDisconnect_ = onDisconnect; - this.myPacketOrderer = new PacketReceiver(onMessage); - this.isClosed_ = false; - this.connectTimeoutTimer_ = setTimeout(function () { - _this.log_('Timed out trying to connect.'); - // Make sure we clear the host cache - _this.onClosed_(); - _this.connectTimeoutTimer_ = null; - // eslint-disable-next-line @typescript-eslint/no-explicit-any - }, Math.floor(LP_CONNECT_TIMEOUT)); - // Ensure we delay the creation of the iframe until the DOM is loaded. - executeWhenDOMReady(function () { - if (_this.isClosed_) { - return; - } - //Set up a callback that gets triggered once a connection is set up. - _this.scriptTagHolder = new FirebaseIFrameScriptHolder(function () { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - var _a = __read(args, 5), command = _a[0], arg1 = _a[1], arg2 = _a[2]; _a[3]; _a[4]; - _this.incrementIncomingBytes_(args); - if (!_this.scriptTagHolder) { - return; // we closed the connection. - } - if (_this.connectTimeoutTimer_) { - clearTimeout(_this.connectTimeoutTimer_); - _this.connectTimeoutTimer_ = null; - } - _this.everConnected_ = true; - if (command === FIREBASE_LONGPOLL_START_PARAM) { - _this.id = arg1; - _this.password = arg2; - } - else if (command === FIREBASE_LONGPOLL_CLOSE_COMMAND) { - // Don't clear the host cache. We got a response from the server, so we know it's reachable - if (arg1) { - // We aren't expecting any more data (other than what the server's already in the process of sending us - // through our already open polls), so don't send any more. - _this.scriptTagHolder.sendNewPolls = false; - // arg1 in this case is the last response number sent by the server. We should try to receive - // all of the responses up to this one before closing - _this.myPacketOrderer.closeAfter(arg1, function () { - _this.onClosed_(); - }); - } - else { - _this.onClosed_(); - } - } - else { - throw new Error('Unrecognized command received: ' + command); - } - }, function () { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - var _a = __read(args, 2), pN = _a[0], data = _a[1]; - _this.incrementIncomingBytes_(args); - _this.myPacketOrderer.handleResponse(pN, data); - }, function () { - _this.onClosed_(); - }, _this.urlFn); - //Send the initial request to connect. The serial number is simply to keep the browser from pulling previous results - //from cache. - var urlParams = {}; - urlParams[FIREBASE_LONGPOLL_START_PARAM] = 't'; - urlParams[FIREBASE_LONGPOLL_SERIAL_PARAM] = Math.floor(Math.random() * 100000000); - if (_this.scriptTagHolder.uniqueCallbackIdentifier) { - urlParams[FIREBASE_LONGPOLL_CALLBACK_ID_PARAM] = - _this.scriptTagHolder.uniqueCallbackIdentifier; - } - urlParams[VERSION_PARAM] = PROTOCOL_VERSION; - if (_this.transportSessionId) { - urlParams[TRANSPORT_SESSION_PARAM] = _this.transportSessionId; - } - if (_this.lastSessionId) { - urlParams[LAST_SESSION_PARAM] = _this.lastSessionId; - } - if (_this.applicationId) { - urlParams[APPLICATION_ID_PARAM] = _this.applicationId; - } - if (_this.appCheckToken) { - urlParams[APP_CHECK_TOKEN_PARAM] = _this.appCheckToken; - } - if (typeof location !== 'undefined' && - location.hostname && - FORGE_DOMAIN_RE.test(location.hostname)) { - urlParams[REFERER_PARAM] = FORGE_REF; - } - var connectURL = _this.urlFn(urlParams); - _this.log_('Connecting via long-poll to ' + connectURL); - _this.scriptTagHolder.addTag(connectURL, function () { - /* do nothing */ - }); - }); - }; - /** - * Call this when a handshake has completed successfully and we want to consider the connection established - */ - BrowserPollConnection.prototype.start = function () { - this.scriptTagHolder.startLongPoll(this.id, this.password); - this.addDisconnectPingFrame(this.id, this.password); - }; - /** - * Forces long polling to be considered as a potential transport - */ - BrowserPollConnection.forceAllow = function () { - BrowserPollConnection.forceAllow_ = true; - }; - /** - * Forces longpolling to not be considered as a potential transport - */ - BrowserPollConnection.forceDisallow = function () { - BrowserPollConnection.forceDisallow_ = true; - }; - // Static method, use string literal so it can be accessed in a generic way - BrowserPollConnection.isAvailable = function () { - if (isNodeSdk()) { - return false; - } - else if (BrowserPollConnection.forceAllow_) { - return true; - } - else { - // NOTE: In React-Native there's normally no 'document', but if you debug a React-Native app in - // the Chrome debugger, 'document' is defined, but document.createElement is null (2015/06/08). - return (!BrowserPollConnection.forceDisallow_ && - typeof document !== 'undefined' && - document.createElement != null && - !isChromeExtensionContentScript() && - !isWindowsStoreApp()); - } - }; - /** - * No-op for polling - */ - BrowserPollConnection.prototype.markConnectionHealthy = function () { }; - /** - * Stops polling and cleans up the iframe - */ - BrowserPollConnection.prototype.shutdown_ = function () { - this.isClosed_ = true; - if (this.scriptTagHolder) { - this.scriptTagHolder.close(); - this.scriptTagHolder = null; - } - //remove the disconnect frame, which will trigger an XHR call to the server to tell it we're leaving. - if (this.myDisconnFrame) { - document.body.removeChild(this.myDisconnFrame); - this.myDisconnFrame = null; - } - if (this.connectTimeoutTimer_) { - clearTimeout(this.connectTimeoutTimer_); - this.connectTimeoutTimer_ = null; - } - }; - /** - * Triggered when this transport is closed - */ - BrowserPollConnection.prototype.onClosed_ = function () { - if (!this.isClosed_) { - this.log_('Longpoll is closing itself'); - this.shutdown_(); - if (this.onDisconnect_) { - this.onDisconnect_(this.everConnected_); - this.onDisconnect_ = null; - } - } - }; - /** - * External-facing close handler. RealTime has requested we shut down. Kill our connection and tell the server - * that we've left. - */ - BrowserPollConnection.prototype.close = function () { - if (!this.isClosed_) { - this.log_('Longpoll is being closed.'); - this.shutdown_(); - } - }; - /** - * Send the JSON object down to the server. It will need to be stringified, base64 encoded, and then - * broken into chunks (since URLs have a small maximum length). - * @param data - The JSON data to transmit. - */ - BrowserPollConnection.prototype.send = function (data) { - var dataStr = stringify(data); - this.bytesSent += dataStr.length; - this.stats_.incrementCounter('bytes_sent', dataStr.length); - //first, lets get the base64-encoded data - var base64data = base64Encode(dataStr); - //We can only fit a certain amount in each URL, so we need to split this request - //up into multiple pieces if it doesn't fit in one request. - var dataSegs = splitStringBySize(base64data, MAX_PAYLOAD_SIZE); - //Enqueue each segment for transmission. We assign each chunk a sequential ID and a total number - //of segments so that we can reassemble the packet on the server. - for (var i = 0; i < dataSegs.length; i++) { - this.scriptTagHolder.enqueueSegment(this.curSegmentNum, dataSegs.length, dataSegs[i]); - this.curSegmentNum++; - } - }; - /** - * This is how we notify the server that we're leaving. - * We aren't able to send requests with DHTML on a window close event, but we can - * trigger XHR requests in some browsers (everything but Opera basically). - */ - BrowserPollConnection.prototype.addDisconnectPingFrame = function (id, pw) { - if (isNodeSdk()) { - return; - } - this.myDisconnFrame = document.createElement('iframe'); - var urlParams = {}; - urlParams[FIREBASE_LONGPOLL_DISCONN_FRAME_REQUEST_PARAM] = 't'; - urlParams[FIREBASE_LONGPOLL_ID_PARAM] = id; - urlParams[FIREBASE_LONGPOLL_PW_PARAM] = pw; - this.myDisconnFrame.src = this.urlFn(urlParams); - this.myDisconnFrame.style.display = 'none'; - document.body.appendChild(this.myDisconnFrame); - }; - /** - * Used to track the bytes received by this client - */ - BrowserPollConnection.prototype.incrementIncomingBytes_ = function (args) { - // TODO: This is an annoying perf hit just to track the number of incoming bytes. Maybe it should be opt-in. - var bytesReceived = stringify(args).length; - this.bytesReceived += bytesReceived; - this.stats_.incrementCounter('bytes_received', bytesReceived); - }; - return BrowserPollConnection; -}()); -/********************************************************************************************* - * A wrapper around an iframe that is used as a long-polling script holder. - *********************************************************************************************/ -var FirebaseIFrameScriptHolder = /** @class */ (function () { - /** - * @param commandCB - The callback to be called when control commands are recevied from the server. - * @param onMessageCB - The callback to be triggered when responses arrive from the server. - * @param onDisconnect - The callback to be triggered when this tag holder is closed - * @param urlFn - A function that provides the URL of the endpoint to send data to. - */ - function FirebaseIFrameScriptHolder(commandCB, onMessageCB, onDisconnect, urlFn) { - this.onDisconnect = onDisconnect; - this.urlFn = urlFn; - //We maintain a count of all of the outstanding requests, because if we have too many active at once it can cause - //problems in some browsers. - this.outstandingRequests = new Set(); - //A queue of the pending segments waiting for transmission to the server. - this.pendingSegs = []; - //A serial number. We use this for two things: - // 1) A way to ensure the browser doesn't cache responses to polls - // 2) A way to make the server aware when long-polls arrive in a different order than we started them. The - // server needs to release both polls in this case or it will cause problems in Opera since Opera can only execute - // JSONP code in the order it was added to the iframe. - this.currentSerial = Math.floor(Math.random() * 100000000); - // This gets set to false when we're "closing down" the connection (e.g. we're switching transports but there's still - // incoming data from the server that we're waiting for). - this.sendNewPolls = true; - if (!isNodeSdk()) { - //Each script holder registers a couple of uniquely named callbacks with the window. These are called from the - //iframes where we put the long-polling script tags. We have two callbacks: - // 1) Command Callback - Triggered for control issues, like starting a connection. - // 2) Message Callback - Triggered when new data arrives. - this.uniqueCallbackIdentifier = LUIDGenerator(); - window[FIREBASE_LONGPOLL_COMMAND_CB_NAME + this.uniqueCallbackIdentifier] = commandCB; - window[FIREBASE_LONGPOLL_DATA_CB_NAME + this.uniqueCallbackIdentifier] = - onMessageCB; - //Create an iframe for us to add script tags to. - this.myIFrame = FirebaseIFrameScriptHolder.createIFrame_(); - // Set the iframe's contents. - var script = ''; - // if we set a javascript url, it's IE and we need to set the document domain. The javascript url is sufficient - // for ie9, but ie8 needs to do it again in the document itself. - if (this.myIFrame.src && - this.myIFrame.src.substr(0, 'javascript:'.length) === 'javascript:') { - var currentDomain = document.domain; - script = ''; - } - var iframeContents = '' + script + ''; - try { - this.myIFrame.doc.open(); - this.myIFrame.doc.write(iframeContents); - this.myIFrame.doc.close(); - } - catch (e) { - log('frame writing exception'); - if (e.stack) { - log(e.stack); - } - log(e); - } - } - else { - this.commandCB = commandCB; - this.onMessageCB = onMessageCB; - } - } - /** - * Each browser has its own funny way to handle iframes. Here we mush them all together into one object that I can - * actually use. - */ - FirebaseIFrameScriptHolder.createIFrame_ = function () { - var iframe = document.createElement('iframe'); - iframe.style.display = 'none'; - // This is necessary in order to initialize the document inside the iframe - if (document.body) { - document.body.appendChild(iframe); - try { - // If document.domain has been modified in IE, this will throw an error, and we need to set the - // domain of the iframe's document manually. We can do this via a javascript: url as the src attribute - // Also note that we must do this *after* the iframe has been appended to the page. Otherwise it doesn't work. - var a = iframe.contentWindow.document; - if (!a) { - // Apologies for the log-spam, I need to do something to keep closure from optimizing out the assignment above. - log('No IE domain setting required'); - } - } - catch (e) { - var domain = document.domain; - iframe.src = - "javascript:void((function(){document.open();document.domain='" + - domain + - "';document.close();})())"; - } - } - else { - // LongPollConnection attempts to delay initialization until the document is ready, so hopefully this - // never gets hit. - throw 'Document body has not initialized. Wait to initialize Firebase until after the document is ready.'; - } - // Get the document of the iframe in a browser-specific way. - if (iframe.contentDocument) { - iframe.doc = iframe.contentDocument; // Firefox, Opera, Safari - } - else if (iframe.contentWindow) { - iframe.doc = iframe.contentWindow.document; // Internet Explorer - // eslint-disable-next-line @typescript-eslint/no-explicit-any - } - else if (iframe.document) { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - iframe.doc = iframe.document; //others? - } - return iframe; - }; - /** - * Cancel all outstanding queries and remove the frame. - */ - FirebaseIFrameScriptHolder.prototype.close = function () { - var _this = this; - //Mark this iframe as dead, so no new requests are sent. - this.alive = false; - if (this.myIFrame) { - //We have to actually remove all of the html inside this iframe before removing it from the - //window, or IE will continue loading and executing the script tags we've already added, which - //can lead to some errors being thrown. Setting innerHTML seems to be the easiest way to do this. - this.myIFrame.doc.body.innerHTML = ''; - setTimeout(function () { - if (_this.myIFrame !== null) { - document.body.removeChild(_this.myIFrame); - _this.myIFrame = null; - } - }, Math.floor(0)); - } - // Protect from being called recursively. - var onDisconnect = this.onDisconnect; - if (onDisconnect) { - this.onDisconnect = null; - onDisconnect(); - } - }; - /** - * Actually start the long-polling session by adding the first script tag(s) to the iframe. - * @param id - The ID of this connection - * @param pw - The password for this connection - */ - FirebaseIFrameScriptHolder.prototype.startLongPoll = function (id, pw) { - this.myID = id; - this.myPW = pw; - this.alive = true; - //send the initial request. If there are requests queued, make sure that we transmit as many as we are currently able to. - while (this.newRequest_()) { } - }; - /** - * This is called any time someone might want a script tag to be added. It adds a script tag when there aren't - * too many outstanding requests and we are still alive. - * - * If there are outstanding packet segments to send, it sends one. If there aren't, it sends a long-poll anyways if - * needed. - */ - FirebaseIFrameScriptHolder.prototype.newRequest_ = function () { - // We keep one outstanding request open all the time to receive data, but if we need to send data - // (pendingSegs.length > 0) then we create a new request to send the data. The server will automatically - // close the old request. - if (this.alive && - this.sendNewPolls && - this.outstandingRequests.size < (this.pendingSegs.length > 0 ? 2 : 1)) { - //construct our url - this.currentSerial++; - var urlParams = {}; - urlParams[FIREBASE_LONGPOLL_ID_PARAM] = this.myID; - urlParams[FIREBASE_LONGPOLL_PW_PARAM] = this.myPW; - urlParams[FIREBASE_LONGPOLL_SERIAL_PARAM] = this.currentSerial; - var theURL = this.urlFn(urlParams); - //Now add as much data as we can. - var curDataString = ''; - var i = 0; - while (this.pendingSegs.length > 0) { - //first, lets see if the next segment will fit. - var nextSeg = this.pendingSegs[0]; - if (nextSeg.d.length + - SEG_HEADER_SIZE + - curDataString.length <= - MAX_URL_DATA_SIZE) { - //great, the segment will fit. Lets append it. - var theSeg = this.pendingSegs.shift(); - curDataString = - curDataString + - '&' + - FIREBASE_LONGPOLL_SEGMENT_NUM_PARAM + - i + - '=' + - theSeg.seg + - '&' + - FIREBASE_LONGPOLL_SEGMENTS_IN_PACKET + - i + - '=' + - theSeg.ts + - '&' + - FIREBASE_LONGPOLL_DATA_PARAM + - i + - '=' + - theSeg.d; - i++; - } - else { - break; - } - } - theURL = theURL + curDataString; - this.addLongPollTag_(theURL, this.currentSerial); - return true; - } - else { - return false; - } - }; - /** - * Queue a packet for transmission to the server. - * @param segnum - A sequential id for this packet segment used for reassembly - * @param totalsegs - The total number of segments in this packet - * @param data - The data for this segment. - */ - FirebaseIFrameScriptHolder.prototype.enqueueSegment = function (segnum, totalsegs, data) { - //add this to the queue of segments to send. - this.pendingSegs.push({ seg: segnum, ts: totalsegs, d: data }); - //send the data immediately if there isn't already data being transmitted, unless - //startLongPoll hasn't been called yet. - if (this.alive) { - this.newRequest_(); - } - }; - /** - * Add a script tag for a regular long-poll request. - * @param url - The URL of the script tag. - * @param serial - The serial number of the request. - */ - FirebaseIFrameScriptHolder.prototype.addLongPollTag_ = function (url, serial) { - var _this = this; - //remember that we sent this request. - this.outstandingRequests.add(serial); - var doNewRequest = function () { - _this.outstandingRequests.delete(serial); - _this.newRequest_(); - }; - // If this request doesn't return on its own accord (by the server sending us some data), we'll - // create a new one after the KEEPALIVE interval to make sure we always keep a fresh request open. - var keepaliveTimeout = setTimeout(doNewRequest, Math.floor(KEEPALIVE_REQUEST_INTERVAL)); - var readyStateCB = function () { - // Request completed. Cancel the keepalive. - clearTimeout(keepaliveTimeout); - // Trigger a new request so we can continue receiving data. - doNewRequest(); - }; - this.addTag(url, readyStateCB); - }; - /** - * Add an arbitrary script tag to the iframe. - * @param url - The URL for the script tag source. - * @param loadCB - A callback to be triggered once the script has loaded. - */ - FirebaseIFrameScriptHolder.prototype.addTag = function (url, loadCB) { - var _this = this; - if (isNodeSdk()) { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - this.doNodeLongPoll(url, loadCB); - } - else { - setTimeout(function () { - try { - // if we're already closed, don't add this poll - if (!_this.sendNewPolls) { - return; - } - var newScript_1 = _this.myIFrame.doc.createElement('script'); - newScript_1.type = 'text/javascript'; - newScript_1.async = true; - newScript_1.src = url; - // eslint-disable-next-line @typescript-eslint/no-explicit-any - newScript_1.onload = newScript_1.onreadystatechange = - function () { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - var rstate = newScript_1.readyState; - if (!rstate || rstate === 'loaded' || rstate === 'complete') { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - newScript_1.onload = newScript_1.onreadystatechange = null; - if (newScript_1.parentNode) { - newScript_1.parentNode.removeChild(newScript_1); - } - loadCB(); - } - }; - newScript_1.onerror = function () { - log('Long-poll script failed to load: ' + url); - _this.sendNewPolls = false; - _this.close(); - }; - _this.myIFrame.doc.body.appendChild(newScript_1); - } - catch (e) { - // TODO: we should make this error visible somehow - } - }, Math.floor(1)); - } - }; - return FirebaseIFrameScriptHolder; -}()); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var WEBSOCKET_MAX_FRAME_SIZE = 16384; -var WEBSOCKET_KEEPALIVE_INTERVAL = 45000; -var WebSocketImpl = null; -if (typeof MozWebSocket !== 'undefined') { - WebSocketImpl = MozWebSocket; -} -else if (typeof WebSocket !== 'undefined') { - WebSocketImpl = WebSocket; -} -/** - * Create a new websocket connection with the given callbacks. - */ -var WebSocketConnection = /** @class */ (function () { - /** - * @param connId identifier for this transport - * @param repoInfo The info for the websocket endpoint. - * @param applicationId The Firebase App ID for this project. - * @param appCheckToken The App Check Token for this client. - * @param authToken The Auth Token for this client. - * @param transportSessionId Optional transportSessionId if this is connecting - * to an existing transport session - * @param lastSessionId Optional lastSessionId if there was a previous - * connection - */ - function WebSocketConnection(connId, repoInfo, applicationId, appCheckToken, authToken, transportSessionId, lastSessionId) { - this.connId = connId; - this.applicationId = applicationId; - this.appCheckToken = appCheckToken; - this.authToken = authToken; - this.keepaliveTimer = null; - this.frames = null; - this.totalFrames = 0; - this.bytesSent = 0; - this.bytesReceived = 0; - this.log_ = logWrapper(this.connId); - this.stats_ = statsManagerGetCollection(repoInfo); - this.connURL = WebSocketConnection.connectionURL_(repoInfo, transportSessionId, lastSessionId, appCheckToken, applicationId); - this.nodeAdmin = repoInfo.nodeAdmin; - } - /** - * @param repoInfo - The info for the websocket endpoint. - * @param transportSessionId - Optional transportSessionId if this is connecting to an existing transport - * session - * @param lastSessionId - Optional lastSessionId if there was a previous connection - * @returns connection url - */ - WebSocketConnection.connectionURL_ = function (repoInfo, transportSessionId, lastSessionId, appCheckToken, applicationId) { - var urlParams = {}; - urlParams[VERSION_PARAM] = PROTOCOL_VERSION; - if (!isNodeSdk() && - typeof location !== 'undefined' && - location.hostname && - FORGE_DOMAIN_RE.test(location.hostname)) { - urlParams[REFERER_PARAM] = FORGE_REF; - } - if (transportSessionId) { - urlParams[TRANSPORT_SESSION_PARAM] = transportSessionId; - } - if (lastSessionId) { - urlParams[LAST_SESSION_PARAM] = lastSessionId; - } - if (appCheckToken) { - urlParams[APP_CHECK_TOKEN_PARAM] = appCheckToken; - } - if (applicationId) { - urlParams[APPLICATION_ID_PARAM] = applicationId; - } - return repoInfoConnectionURL(repoInfo, WEBSOCKET, urlParams); - }; - /** - * @param onMessage - Callback when messages arrive - * @param onDisconnect - Callback with connection lost. - */ - WebSocketConnection.prototype.open = function (onMessage, onDisconnect) { - var _this = this; - this.onDisconnect = onDisconnect; - this.onMessage = onMessage; - this.log_('Websocket connecting to ' + this.connURL); - this.everConnected_ = false; - // Assume failure until proven otherwise. - PersistentStorage.set('previous_websocket_failure', true); - try { - var options = void 0; - if (isNodeSdk()) { - var device = this.nodeAdmin ? 'AdminNode' : 'Node'; - // UA Format: Firebase//// - options = { - headers: { - 'User-Agent': "Firebase/" + PROTOCOL_VERSION + "/" + SDK_VERSION + "/" + process.platform + "/" + device, - 'X-Firebase-GMPID': this.applicationId || '' - } - }; - // If using Node with admin creds, AppCheck-related checks are unnecessary. - // Note that we send the credentials here even if they aren't admin credentials, which is - // not a problem. - // Note that this header is just used to bypass appcheck, and the token should still be sent - // through the websocket connection once it is established. - if (this.authToken) { - options.headers['Authorization'] = "Bearer " + this.authToken; - } - if (this.appCheckToken) { - options.headers['X-Firebase-AppCheck'] = this.appCheckToken; - } - // Plumb appropriate http_proxy environment variable into faye-websocket if it exists. - var env = process['env']; - var proxy = this.connURL.indexOf('wss://') === 0 - ? env['HTTPS_PROXY'] || env['https_proxy'] - : env['HTTP_PROXY'] || env['http_proxy']; - if (proxy) { - options['proxy'] = { origin: proxy }; - } - } - this.mySock = new WebSocketImpl(this.connURL, [], options); - } - catch (e) { - this.log_('Error instantiating WebSocket.'); - var error = e.message || e.data; - if (error) { - this.log_(error); - } - this.onClosed_(); - return; - } - this.mySock.onopen = function () { - _this.log_('Websocket connected.'); - _this.everConnected_ = true; - }; - this.mySock.onclose = function () { - _this.log_('Websocket connection was disconnected.'); - _this.mySock = null; - _this.onClosed_(); - }; - this.mySock.onmessage = function (m) { - _this.handleIncomingFrame(m); - }; - this.mySock.onerror = function (e) { - _this.log_('WebSocket error. Closing connection.'); - // eslint-disable-next-line @typescript-eslint/no-explicit-any - var error = e.message || e.data; - if (error) { - _this.log_(error); - } - _this.onClosed_(); - }; - }; - /** - * No-op for websockets, we don't need to do anything once the connection is confirmed as open - */ - WebSocketConnection.prototype.start = function () { }; - WebSocketConnection.forceDisallow = function () { - WebSocketConnection.forceDisallow_ = true; - }; - WebSocketConnection.isAvailable = function () { - var isOldAndroid = false; - if (typeof navigator !== 'undefined' && navigator.userAgent) { - var oldAndroidRegex = /Android ([0-9]{0,}\.[0-9]{0,})/; - var oldAndroidMatch = navigator.userAgent.match(oldAndroidRegex); - if (oldAndroidMatch && oldAndroidMatch.length > 1) { - if (parseFloat(oldAndroidMatch[1]) < 4.4) { - isOldAndroid = true; - } - } - } - return (!isOldAndroid && - WebSocketImpl !== null && - !WebSocketConnection.forceDisallow_); - }; - /** - * Returns true if we previously failed to connect with this transport. - */ - WebSocketConnection.previouslyFailed = function () { - // If our persistent storage is actually only in-memory storage, - // we default to assuming that it previously failed to be safe. - return (PersistentStorage.isInMemoryStorage || - PersistentStorage.get('previous_websocket_failure') === true); - }; - WebSocketConnection.prototype.markConnectionHealthy = function () { - PersistentStorage.remove('previous_websocket_failure'); - }; - WebSocketConnection.prototype.appendFrame_ = function (data) { - this.frames.push(data); - if (this.frames.length === this.totalFrames) { - var fullMess = this.frames.join(''); - this.frames = null; - var jsonMess = jsonEval(fullMess); - //handle the message - this.onMessage(jsonMess); - } - }; - /** - * @param frameCount - The number of frames we are expecting from the server - */ - WebSocketConnection.prototype.handleNewFrameCount_ = function (frameCount) { - this.totalFrames = frameCount; - this.frames = []; - }; - /** - * Attempts to parse a frame count out of some text. If it can't, assumes a value of 1 - * @returns Any remaining data to be process, or null if there is none - */ - WebSocketConnection.prototype.extractFrameCount_ = function (data) { - assert(this.frames === null, 'We already have a frame buffer'); - // TODO: The server is only supposed to send up to 9999 frames (i.e. length <= 4), but that isn't being enforced - // currently. So allowing larger frame counts (length <= 6). See https://app.asana.com/0/search/8688598998380/8237608042508 - if (data.length <= 6) { - var frameCount = Number(data); - if (!isNaN(frameCount)) { - this.handleNewFrameCount_(frameCount); - return null; - } - } - this.handleNewFrameCount_(1); - return data; - }; - /** - * Process a websocket frame that has arrived from the server. - * @param mess - The frame data - */ - WebSocketConnection.prototype.handleIncomingFrame = function (mess) { - if (this.mySock === null) { - return; // Chrome apparently delivers incoming packets even after we .close() the connection sometimes. - } - var data = mess['data']; - this.bytesReceived += data.length; - this.stats_.incrementCounter('bytes_received', data.length); - this.resetKeepAlive(); - if (this.frames !== null) { - // we're buffering - this.appendFrame_(data); - } - else { - // try to parse out a frame count, otherwise, assume 1 and process it - var remainingData = this.extractFrameCount_(data); - if (remainingData !== null) { - this.appendFrame_(remainingData); - } - } - }; - /** - * Send a message to the server - * @param data - The JSON object to transmit - */ - WebSocketConnection.prototype.send = function (data) { - this.resetKeepAlive(); - var dataStr = stringify(data); - this.bytesSent += dataStr.length; - this.stats_.incrementCounter('bytes_sent', dataStr.length); - //We can only fit a certain amount in each websocket frame, so we need to split this request - //up into multiple pieces if it doesn't fit in one request. - var dataSegs = splitStringBySize(dataStr, WEBSOCKET_MAX_FRAME_SIZE); - //Send the length header - if (dataSegs.length > 1) { - this.sendString_(String(dataSegs.length)); - } - //Send the actual data in segments. - for (var i = 0; i < dataSegs.length; i++) { - this.sendString_(dataSegs[i]); - } - }; - WebSocketConnection.prototype.shutdown_ = function () { - this.isClosed_ = true; - if (this.keepaliveTimer) { - clearInterval(this.keepaliveTimer); - this.keepaliveTimer = null; - } - if (this.mySock) { - this.mySock.close(); - this.mySock = null; - } - }; - WebSocketConnection.prototype.onClosed_ = function () { - if (!this.isClosed_) { - this.log_('WebSocket is closing itself'); - this.shutdown_(); - // since this is an internal close, trigger the close listener - if (this.onDisconnect) { - this.onDisconnect(this.everConnected_); - this.onDisconnect = null; - } - } - }; - /** - * External-facing close handler. - * Close the websocket and kill the connection. - */ - WebSocketConnection.prototype.close = function () { - if (!this.isClosed_) { - this.log_('WebSocket is being closed'); - this.shutdown_(); - } - }; - /** - * Kill the current keepalive timer and start a new one, to ensure that it always fires N seconds after - * the last activity. - */ - WebSocketConnection.prototype.resetKeepAlive = function () { - var _this = this; - clearInterval(this.keepaliveTimer); - this.keepaliveTimer = setInterval(function () { - //If there has been no websocket activity for a while, send a no-op - if (_this.mySock) { - _this.sendString_('0'); - } - _this.resetKeepAlive(); - // eslint-disable-next-line @typescript-eslint/no-explicit-any - }, Math.floor(WEBSOCKET_KEEPALIVE_INTERVAL)); - }; - /** - * Send a string over the websocket. - * - * @param str - String to send. - */ - WebSocketConnection.prototype.sendString_ = function (str) { - // Firefox seems to sometimes throw exceptions (NS_ERROR_UNEXPECTED) from websocket .send() - // calls for some unknown reason. We treat these as an error and disconnect. - // See https://app.asana.com/0/58926111402292/68021340250410 - try { - this.mySock.send(str); - } - catch (e) { - this.log_('Exception thrown from WebSocket.send():', e.message || e.data, 'Closing connection.'); - setTimeout(this.onClosed_.bind(this), 0); - } - }; - /** - * Number of response before we consider the connection "healthy." - */ - WebSocketConnection.responsesRequiredToBeHealthy = 2; - /** - * Time to wait for the connection te become healthy before giving up. - */ - WebSocketConnection.healthyTimeout = 30000; - return WebSocketConnection; -}()); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Currently simplistic, this class manages what transport a Connection should use at various stages of its - * lifecycle. - * - * It starts with longpolling in a browser, and httppolling on node. It then upgrades to websockets if - * they are available. - */ -var TransportManager = /** @class */ (function () { - /** - * @param repoInfo - Metadata around the namespace we're connecting to - */ - function TransportManager(repoInfo) { - this.initTransports_(repoInfo); - } - Object.defineProperty(TransportManager, "ALL_TRANSPORTS", { - get: function () { - return [BrowserPollConnection, WebSocketConnection]; - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(TransportManager, "IS_TRANSPORT_INITIALIZED", { - /** - * Returns whether transport has been selected to ensure WebSocketConnection or BrowserPollConnection are not called after - * TransportManager has already set up transports_ - */ - get: function () { - return this.globalTransportInitialized_; - }, - enumerable: false, - configurable: true - }); - TransportManager.prototype.initTransports_ = function (repoInfo) { - var e_1, _a; - var isWebSocketsAvailable = WebSocketConnection && WebSocketConnection['isAvailable'](); - var isSkipPollConnection = isWebSocketsAvailable && !WebSocketConnection.previouslyFailed(); - if (repoInfo.webSocketOnly) { - if (!isWebSocketsAvailable) { - warn("wss:// URL used, but browser isn't known to support websockets. Trying anyway."); - } - isSkipPollConnection = true; - } - if (isSkipPollConnection) { - this.transports_ = [WebSocketConnection]; - } - else { - var transports = (this.transports_ = []); - try { - for (var _b = __values(TransportManager.ALL_TRANSPORTS), _c = _b.next(); !_c.done; _c = _b.next()) { - var transport = _c.value; - if (transport && transport['isAvailable']()) { - transports.push(transport); - } - } - } - catch (e_1_1) { e_1 = { error: e_1_1 }; } - finally { - try { - if (_c && !_c.done && (_a = _b.return)) _a.call(_b); - } - finally { if (e_1) throw e_1.error; } - } - TransportManager.globalTransportInitialized_ = true; - } - }; - /** - * @returns The constructor for the initial transport to use - */ - TransportManager.prototype.initialTransport = function () { - if (this.transports_.length > 0) { - return this.transports_[0]; - } - else { - throw new Error('No transports available'); - } - }; - /** - * @returns The constructor for the next transport, or null - */ - TransportManager.prototype.upgradeTransport = function () { - if (this.transports_.length > 1) { - return this.transports_[1]; - } - else { - return null; - } - }; - // Keeps track of whether the TransportManager has already chosen a transport to use - TransportManager.globalTransportInitialized_ = false; - return TransportManager; -}()); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Abort upgrade attempt if it takes longer than 60s. -var UPGRADE_TIMEOUT = 60000; -// For some transports (WebSockets), we need to "validate" the transport by exchanging a few requests and responses. -// If we haven't sent enough requests within 5s, we'll start sending noop ping requests. -var DELAY_BEFORE_SENDING_EXTRA_REQUESTS = 5000; -// If the initial data sent triggers a lot of bandwidth (i.e. it's a large put or a listen for a large amount of data) -// then we may not be able to exchange our ping/pong requests within the healthy timeout. So if we reach the timeout -// but we've sent/received enough bytes, we don't cancel the connection. -var BYTES_SENT_HEALTHY_OVERRIDE = 10 * 1024; -var BYTES_RECEIVED_HEALTHY_OVERRIDE = 100 * 1024; -var MESSAGE_TYPE = 't'; -var MESSAGE_DATA = 'd'; -var CONTROL_SHUTDOWN = 's'; -var CONTROL_RESET = 'r'; -var CONTROL_ERROR = 'e'; -var CONTROL_PONG = 'o'; -var SWITCH_ACK = 'a'; -var END_TRANSMISSION = 'n'; -var PING = 'p'; -var SERVER_HELLO = 'h'; -/** - * Creates a new real-time connection to the server using whichever method works - * best in the current browser. - */ -var Connection = /** @class */ (function () { - /** - * @param id - an id for this connection - * @param repoInfo_ - the info for the endpoint to connect to - * @param applicationId_ - the Firebase App ID for this project - * @param appCheckToken_ - The App Check Token for this device. - * @param authToken_ - The auth token for this session. - * @param onMessage_ - the callback to be triggered when a server-push message arrives - * @param onReady_ - the callback to be triggered when this connection is ready to send messages. - * @param onDisconnect_ - the callback to be triggered when a connection was lost - * @param onKill_ - the callback to be triggered when this connection has permanently shut down. - * @param lastSessionId - last session id in persistent connection. is used to clean up old session in real-time server - */ - function Connection(id, repoInfo_, applicationId_, appCheckToken_, authToken_, onMessage_, onReady_, onDisconnect_, onKill_, lastSessionId) { - this.id = id; - this.repoInfo_ = repoInfo_; - this.applicationId_ = applicationId_; - this.appCheckToken_ = appCheckToken_; - this.authToken_ = authToken_; - this.onMessage_ = onMessage_; - this.onReady_ = onReady_; - this.onDisconnect_ = onDisconnect_; - this.onKill_ = onKill_; - this.lastSessionId = lastSessionId; - this.connectionCount = 0; - this.pendingDataMessages = []; - this.state_ = 0 /* CONNECTING */; - this.log_ = logWrapper('c:' + this.id + ':'); - this.transportManager_ = new TransportManager(repoInfo_); - this.log_('Connection created'); - this.start_(); - } - /** - * Starts a connection attempt - */ - Connection.prototype.start_ = function () { - var _this = this; - var conn = this.transportManager_.initialTransport(); - this.conn_ = new conn(this.nextTransportId_(), this.repoInfo_, this.applicationId_, this.appCheckToken_, this.authToken_, null, this.lastSessionId); - // For certain transports (WebSockets), we need to send and receive several messages back and forth before we - // can consider the transport healthy. - this.primaryResponsesRequired_ = conn['responsesRequiredToBeHealthy'] || 0; - var onMessageReceived = this.connReceiver_(this.conn_); - var onConnectionLost = this.disconnReceiver_(this.conn_); - this.tx_ = this.conn_; - this.rx_ = this.conn_; - this.secondaryConn_ = null; - this.isHealthy_ = false; - /* - * Firefox doesn't like when code from one iframe tries to create another iframe by way of the parent frame. - * This can occur in the case of a redirect, i.e. we guessed wrong on what server to connect to and received a reset. - * Somehow, setTimeout seems to make this ok. That doesn't make sense from a security perspective, since you should - * still have the context of your originating frame. - */ - setTimeout(function () { - // this.conn_ gets set to null in some of the tests. Check to make sure it still exists before using it - _this.conn_ && _this.conn_.open(onMessageReceived, onConnectionLost); - }, Math.floor(0)); - var healthyTimeoutMS = conn['healthyTimeout'] || 0; - if (healthyTimeoutMS > 0) { - this.healthyTimeout_ = setTimeoutNonBlocking(function () { - _this.healthyTimeout_ = null; - if (!_this.isHealthy_) { - if (_this.conn_ && - _this.conn_.bytesReceived > BYTES_RECEIVED_HEALTHY_OVERRIDE) { - _this.log_('Connection exceeded healthy timeout but has received ' + - _this.conn_.bytesReceived + - ' bytes. Marking connection healthy.'); - _this.isHealthy_ = true; - _this.conn_.markConnectionHealthy(); - } - else if (_this.conn_ && - _this.conn_.bytesSent > BYTES_SENT_HEALTHY_OVERRIDE) { - _this.log_('Connection exceeded healthy timeout but has sent ' + - _this.conn_.bytesSent + - ' bytes. Leaving connection alive.'); - // NOTE: We don't want to mark it healthy, since we have no guarantee that the bytes have made it to - // the server. - } - else { - _this.log_('Closing unhealthy connection after timeout.'); - _this.close(); - } - } - // eslint-disable-next-line @typescript-eslint/no-explicit-any - }, Math.floor(healthyTimeoutMS)); - } - }; - Connection.prototype.nextTransportId_ = function () { - return 'c:' + this.id + ':' + this.connectionCount++; - }; - Connection.prototype.disconnReceiver_ = function (conn) { - var _this = this; - return function (everConnected) { - if (conn === _this.conn_) { - _this.onConnectionLost_(everConnected); - } - else if (conn === _this.secondaryConn_) { - _this.log_('Secondary connection lost.'); - _this.onSecondaryConnectionLost_(); - } - else { - _this.log_('closing an old connection'); - } - }; - }; - Connection.prototype.connReceiver_ = function (conn) { - var _this = this; - return function (message) { - if (_this.state_ !== 2 /* DISCONNECTED */) { - if (conn === _this.rx_) { - _this.onPrimaryMessageReceived_(message); - } - else if (conn === _this.secondaryConn_) { - _this.onSecondaryMessageReceived_(message); - } - else { - _this.log_('message on old connection'); - } - } - }; - }; - /** - * @param dataMsg - An arbitrary data message to be sent to the server - */ - Connection.prototype.sendRequest = function (dataMsg) { - // wrap in a data message envelope and send it on - var msg = { t: 'd', d: dataMsg }; - this.sendData_(msg); - }; - Connection.prototype.tryCleanupConnection = function () { - if (this.tx_ === this.secondaryConn_ && this.rx_ === this.secondaryConn_) { - this.log_('cleaning up and promoting a connection: ' + this.secondaryConn_.connId); - this.conn_ = this.secondaryConn_; - this.secondaryConn_ = null; - // the server will shutdown the old connection - } - }; - Connection.prototype.onSecondaryControl_ = function (controlData) { - if (MESSAGE_TYPE in controlData) { - var cmd = controlData[MESSAGE_TYPE]; - if (cmd === SWITCH_ACK) { - this.upgradeIfSecondaryHealthy_(); - } - else if (cmd === CONTROL_RESET) { - // Most likely the session wasn't valid. Abandon the switch attempt - this.log_('Got a reset on secondary, closing it'); - this.secondaryConn_.close(); - // If we were already using this connection for something, than we need to fully close - if (this.tx_ === this.secondaryConn_ || - this.rx_ === this.secondaryConn_) { - this.close(); - } - } - else if (cmd === CONTROL_PONG) { - this.log_('got pong on secondary.'); - this.secondaryResponsesRequired_--; - this.upgradeIfSecondaryHealthy_(); - } - } - }; - Connection.prototype.onSecondaryMessageReceived_ = function (parsedData) { - var layer = requireKey('t', parsedData); - var data = requireKey('d', parsedData); - if (layer === 'c') { - this.onSecondaryControl_(data); - } - else if (layer === 'd') { - // got a data message, but we're still second connection. Need to buffer it up - this.pendingDataMessages.push(data); - } - else { - throw new Error('Unknown protocol layer: ' + layer); - } - }; - Connection.prototype.upgradeIfSecondaryHealthy_ = function () { - if (this.secondaryResponsesRequired_ <= 0) { - this.log_('Secondary connection is healthy.'); - this.isHealthy_ = true; - this.secondaryConn_.markConnectionHealthy(); - this.proceedWithUpgrade_(); - } - else { - // Send a ping to make sure the connection is healthy. - this.log_('sending ping on secondary.'); - this.secondaryConn_.send({ t: 'c', d: { t: PING, d: {} } }); - } - }; - Connection.prototype.proceedWithUpgrade_ = function () { - // tell this connection to consider itself open - this.secondaryConn_.start(); - // send ack - this.log_('sending client ack on secondary'); - this.secondaryConn_.send({ t: 'c', d: { t: SWITCH_ACK, d: {} } }); - // send end packet on primary transport, switch to sending on this one - // can receive on this one, buffer responses until end received on primary transport - this.log_('Ending transmission on primary'); - this.conn_.send({ t: 'c', d: { t: END_TRANSMISSION, d: {} } }); - this.tx_ = this.secondaryConn_; - this.tryCleanupConnection(); - }; - Connection.prototype.onPrimaryMessageReceived_ = function (parsedData) { - // Must refer to parsedData properties in quotes, so closure doesn't touch them. - var layer = requireKey('t', parsedData); - var data = requireKey('d', parsedData); - if (layer === 'c') { - this.onControl_(data); - } - else if (layer === 'd') { - this.onDataMessage_(data); - } - }; - Connection.prototype.onDataMessage_ = function (message) { - this.onPrimaryResponse_(); - // We don't do anything with data messages, just kick them up a level - this.onMessage_(message); - }; - Connection.prototype.onPrimaryResponse_ = function () { - if (!this.isHealthy_) { - this.primaryResponsesRequired_--; - if (this.primaryResponsesRequired_ <= 0) { - this.log_('Primary connection is healthy.'); - this.isHealthy_ = true; - this.conn_.markConnectionHealthy(); - } - } - }; - Connection.prototype.onControl_ = function (controlData) { - var cmd = requireKey(MESSAGE_TYPE, controlData); - if (MESSAGE_DATA in controlData) { - var payload = controlData[MESSAGE_DATA]; - if (cmd === SERVER_HELLO) { - this.onHandshake_(payload); - } - else if (cmd === END_TRANSMISSION) { - this.log_('recvd end transmission on primary'); - this.rx_ = this.secondaryConn_; - for (var i = 0; i < this.pendingDataMessages.length; ++i) { - this.onDataMessage_(this.pendingDataMessages[i]); - } - this.pendingDataMessages = []; - this.tryCleanupConnection(); - } - else if (cmd === CONTROL_SHUTDOWN) { - // This was previously the 'onKill' callback passed to the lower-level connection - // payload in this case is the reason for the shutdown. Generally a human-readable error - this.onConnectionShutdown_(payload); - } - else if (cmd === CONTROL_RESET) { - // payload in this case is the host we should contact - this.onReset_(payload); - } - else if (cmd === CONTROL_ERROR) { - error('Server Error: ' + payload); - } - else if (cmd === CONTROL_PONG) { - this.log_('got pong on primary.'); - this.onPrimaryResponse_(); - this.sendPingOnPrimaryIfNecessary_(); - } - else { - error('Unknown control packet command: ' + cmd); - } - } - }; - /** - * @param handshake - The handshake data returned from the server - */ - Connection.prototype.onHandshake_ = function (handshake) { - var timestamp = handshake.ts; - var version = handshake.v; - var host = handshake.h; - this.sessionId = handshake.s; - this.repoInfo_.host = host; - // if we've already closed the connection, then don't bother trying to progress further - if (this.state_ === 0 /* CONNECTING */) { - this.conn_.start(); - this.onConnectionEstablished_(this.conn_, timestamp); - if (PROTOCOL_VERSION !== version) { - warn('Protocol version mismatch detected'); - } - // TODO: do we want to upgrade? when? maybe a delay? - this.tryStartUpgrade_(); - } - }; - Connection.prototype.tryStartUpgrade_ = function () { - var conn = this.transportManager_.upgradeTransport(); - if (conn) { - this.startUpgrade_(conn); - } - }; - Connection.prototype.startUpgrade_ = function (conn) { - var _this = this; - this.secondaryConn_ = new conn(this.nextTransportId_(), this.repoInfo_, this.applicationId_, this.appCheckToken_, this.authToken_, this.sessionId); - // For certain transports (WebSockets), we need to send and receive several messages back and forth before we - // can consider the transport healthy. - this.secondaryResponsesRequired_ = - conn['responsesRequiredToBeHealthy'] || 0; - var onMessage = this.connReceiver_(this.secondaryConn_); - var onDisconnect = this.disconnReceiver_(this.secondaryConn_); - this.secondaryConn_.open(onMessage, onDisconnect); - // If we haven't successfully upgraded after UPGRADE_TIMEOUT, give up and kill the secondary. - setTimeoutNonBlocking(function () { - if (_this.secondaryConn_) { - _this.log_('Timed out trying to upgrade.'); - _this.secondaryConn_.close(); - } - }, Math.floor(UPGRADE_TIMEOUT)); - }; - Connection.prototype.onReset_ = function (host) { - this.log_('Reset packet received. New host: ' + host); - this.repoInfo_.host = host; - // TODO: if we're already "connected", we need to trigger a disconnect at the next layer up. - // We don't currently support resets after the connection has already been established - if (this.state_ === 1 /* CONNECTED */) { - this.close(); - } - else { - // Close whatever connections we have open and start again. - this.closeConnections_(); - this.start_(); - } - }; - Connection.prototype.onConnectionEstablished_ = function (conn, timestamp) { - var _this = this; - this.log_('Realtime connection established.'); - this.conn_ = conn; - this.state_ = 1 /* CONNECTED */; - if (this.onReady_) { - this.onReady_(timestamp, this.sessionId); - this.onReady_ = null; - } - // If after 5 seconds we haven't sent enough requests to the server to get the connection healthy, - // send some pings. - if (this.primaryResponsesRequired_ === 0) { - this.log_('Primary connection is healthy.'); - this.isHealthy_ = true; - } - else { - setTimeoutNonBlocking(function () { - _this.sendPingOnPrimaryIfNecessary_(); - }, Math.floor(DELAY_BEFORE_SENDING_EXTRA_REQUESTS)); - } - }; - Connection.prototype.sendPingOnPrimaryIfNecessary_ = function () { - // If the connection isn't considered healthy yet, we'll send a noop ping packet request. - if (!this.isHealthy_ && this.state_ === 1 /* CONNECTED */) { - this.log_('sending ping on primary.'); - this.sendData_({ t: 'c', d: { t: PING, d: {} } }); - } - }; - Connection.prototype.onSecondaryConnectionLost_ = function () { - var conn = this.secondaryConn_; - this.secondaryConn_ = null; - if (this.tx_ === conn || this.rx_ === conn) { - // we are relying on this connection already in some capacity. Therefore, a failure is real - this.close(); - } - }; - /** - * @param everConnected - Whether or not the connection ever reached a server. Used to determine if - * we should flush the host cache - */ - Connection.prototype.onConnectionLost_ = function (everConnected) { - this.conn_ = null; - // NOTE: IF you're seeing a Firefox error for this line, I think it might be because it's getting - // called on window close and RealtimeState.CONNECTING is no longer defined. Just a guess. - if (!everConnected && this.state_ === 0 /* CONNECTING */) { - this.log_('Realtime connection failed.'); - // Since we failed to connect at all, clear any cached entry for this namespace in case the machine went away - if (this.repoInfo_.isCacheableHost()) { - PersistentStorage.remove('host:' + this.repoInfo_.host); - // reset the internal host to what we would show the user, i.e. .firebaseio.com - this.repoInfo_.internalHost = this.repoInfo_.host; - } - } - else if (this.state_ === 1 /* CONNECTED */) { - this.log_('Realtime connection lost.'); - } - this.close(); - }; - Connection.prototype.onConnectionShutdown_ = function (reason) { - this.log_('Connection shutdown command received. Shutting down...'); - if (this.onKill_) { - this.onKill_(reason); - this.onKill_ = null; - } - // We intentionally don't want to fire onDisconnect (kill is a different case), - // so clear the callback. - this.onDisconnect_ = null; - this.close(); - }; - Connection.prototype.sendData_ = function (data) { - if (this.state_ !== 1 /* CONNECTED */) { - throw 'Connection is not connected'; - } - else { - this.tx_.send(data); - } - }; - /** - * Cleans up this connection, calling the appropriate callbacks - */ - Connection.prototype.close = function () { - if (this.state_ !== 2 /* DISCONNECTED */) { - this.log_('Closing realtime connection.'); - this.state_ = 2 /* DISCONNECTED */; - this.closeConnections_(); - if (this.onDisconnect_) { - this.onDisconnect_(); - this.onDisconnect_ = null; - } - } - }; - Connection.prototype.closeConnections_ = function () { - this.log_('Shutting down all connections'); - if (this.conn_) { - this.conn_.close(); - this.conn_ = null; - } - if (this.secondaryConn_) { - this.secondaryConn_.close(); - this.secondaryConn_ = null; - } - if (this.healthyTimeout_) { - clearTimeout(this.healthyTimeout_); - this.healthyTimeout_ = null; - } - }; - return Connection; -}()); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Interface defining the set of actions that can be performed against the Firebase server - * (basically corresponds to our wire protocol). - * - * @interface - */ -var ServerActions = /** @class */ (function () { - function ServerActions() { - } - ServerActions.prototype.put = function (pathString, data, onComplete, hash) { }; - ServerActions.prototype.merge = function (pathString, data, onComplete, hash) { }; - /** - * Refreshes the auth token for the current connection. - * @param token - The authentication token - */ - ServerActions.prototype.refreshAuthToken = function (token) { }; - /** - * Refreshes the app check token for the current connection. - * @param token The app check token - */ - ServerActions.prototype.refreshAppCheckToken = function (token) { }; - ServerActions.prototype.onDisconnectPut = function (pathString, data, onComplete) { }; - ServerActions.prototype.onDisconnectMerge = function (pathString, data, onComplete) { }; - ServerActions.prototype.onDisconnectCancel = function (pathString, onComplete) { }; - ServerActions.prototype.reportStats = function (stats) { }; - return ServerActions; -}()); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Base class to be used if you want to emit events. Call the constructor with - * the set of allowed event names. - */ -var EventEmitter = /** @class */ (function () { - function EventEmitter(allowedEvents_) { - this.allowedEvents_ = allowedEvents_; - this.listeners_ = {}; - assert(Array.isArray(allowedEvents_) && allowedEvents_.length > 0, 'Requires a non-empty array'); - } - /** - * To be called by derived classes to trigger events. - */ - EventEmitter.prototype.trigger = function (eventType) { - var varArgs = []; - for (var _i = 1; _i < arguments.length; _i++) { - varArgs[_i - 1] = arguments[_i]; - } - if (Array.isArray(this.listeners_[eventType])) { - // Clone the list, since callbacks could add/remove listeners. - var listeners = __spreadArray([], __read(this.listeners_[eventType])); - for (var i = 0; i < listeners.length; i++) { - listeners[i].callback.apply(listeners[i].context, varArgs); - } - } - }; - EventEmitter.prototype.on = function (eventType, callback, context) { - this.validateEventType_(eventType); - this.listeners_[eventType] = this.listeners_[eventType] || []; - this.listeners_[eventType].push({ callback: callback, context: context }); - var eventData = this.getInitialEvent(eventType); - if (eventData) { - callback.apply(context, eventData); - } - }; - EventEmitter.prototype.off = function (eventType, callback, context) { - this.validateEventType_(eventType); - var listeners = this.listeners_[eventType] || []; - for (var i = 0; i < listeners.length; i++) { - if (listeners[i].callback === callback && - (!context || context === listeners[i].context)) { - listeners.splice(i, 1); - return; - } - } - }; - EventEmitter.prototype.validateEventType_ = function (eventType) { - assert(this.allowedEvents_.find(function (et) { - return et === eventType; - }), 'Unknown event: ' + eventType); - }; - return EventEmitter; -}()); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Monitors online state (as reported by window.online/offline events). - * - * The expectation is that this could have many false positives (thinks we are online - * when we're not), but no false negatives. So we can safely use it to determine when - * we definitely cannot reach the internet. - */ -var OnlineMonitor = /** @class */ (function (_super) { - __extends(OnlineMonitor, _super); - function OnlineMonitor() { - var _this = _super.call(this, ['online']) || this; - _this.online_ = true; - // We've had repeated complaints that Cordova apps can get stuck "offline", e.g. - // https://forum.ionicframework.com/t/firebase-connection-is-lost-and-never-come-back/43810 - // It would seem that the 'online' event does not always fire consistently. So we disable it - // for Cordova. - if (typeof window !== 'undefined' && - typeof window.addEventListener !== 'undefined' && - !isMobileCordova()) { - window.addEventListener('online', function () { - if (!_this.online_) { - _this.online_ = true; - _this.trigger('online', true); - } - }, false); - window.addEventListener('offline', function () { - if (_this.online_) { - _this.online_ = false; - _this.trigger('online', false); - } - }, false); - } - return _this; - } - OnlineMonitor.getInstance = function () { - return new OnlineMonitor(); - }; - OnlineMonitor.prototype.getInitialEvent = function (eventType) { - assert(eventType === 'online', 'Unknown event type: ' + eventType); - return [this.online_]; - }; - OnlineMonitor.prototype.currentlyOnline = function () { - return this.online_; - }; - return OnlineMonitor; -}(EventEmitter)); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** Maximum key depth. */ -var MAX_PATH_DEPTH = 32; -/** Maximum number of (UTF8) bytes in a Firebase path. */ -var MAX_PATH_LENGTH_BYTES = 768; -/** - * An immutable object representing a parsed path. It's immutable so that you - * can pass them around to other functions without worrying about them changing - * it. - */ -var Path = /** @class */ (function () { - /** - * @param pathOrString - Path string to parse, or another path, or the raw - * tokens array - */ - function Path(pathOrString, pieceNum) { - if (pieceNum === void 0) { - this.pieces_ = pathOrString.split('/'); - // Remove empty pieces. - var copyTo = 0; - for (var i = 0; i < this.pieces_.length; i++) { - if (this.pieces_[i].length > 0) { - this.pieces_[copyTo] = this.pieces_[i]; - copyTo++; - } - } - this.pieces_.length = copyTo; - this.pieceNum_ = 0; - } - else { - this.pieces_ = pathOrString; - this.pieceNum_ = pieceNum; - } - } - Path.prototype.toString = function () { - var pathString = ''; - for (var i = this.pieceNum_; i < this.pieces_.length; i++) { - if (this.pieces_[i] !== '') { - pathString += '/' + this.pieces_[i]; - } - } - return pathString || '/'; - }; - return Path; -}()); -function newEmptyPath() { - return new Path(''); -} -function pathGetFront(path) { - if (path.pieceNum_ >= path.pieces_.length) { - return null; - } - return path.pieces_[path.pieceNum_]; -} -/** - * @returns The number of segments in this path - */ -function pathGetLength(path) { - return path.pieces_.length - path.pieceNum_; -} -function pathPopFront(path) { - var pieceNum = path.pieceNum_; - if (pieceNum < path.pieces_.length) { - pieceNum++; - } - return new Path(path.pieces_, pieceNum); -} -function pathGetBack(path) { - if (path.pieceNum_ < path.pieces_.length) { - return path.pieces_[path.pieces_.length - 1]; - } - return null; -} -function pathToUrlEncodedString(path) { - var pathString = ''; - for (var i = path.pieceNum_; i < path.pieces_.length; i++) { - if (path.pieces_[i] !== '') { - pathString += '/' + encodeURIComponent(String(path.pieces_[i])); - } - } - return pathString || '/'; -} -/** - * Shallow copy of the parts of the path. - * - */ -function pathSlice(path, begin) { - if (begin === void 0) { begin = 0; } - return path.pieces_.slice(path.pieceNum_ + begin); -} -function pathParent(path) { - if (path.pieceNum_ >= path.pieces_.length) { - return null; - } - var pieces = []; - for (var i = path.pieceNum_; i < path.pieces_.length - 1; i++) { - pieces.push(path.pieces_[i]); - } - return new Path(pieces, 0); -} -function pathChild(path, childPathObj) { - var pieces = []; - for (var i = path.pieceNum_; i < path.pieces_.length; i++) { - pieces.push(path.pieces_[i]); - } - if (childPathObj instanceof Path) { - for (var i = childPathObj.pieceNum_; i < childPathObj.pieces_.length; i++) { - pieces.push(childPathObj.pieces_[i]); - } - } - else { - var childPieces = childPathObj.split('/'); - for (var i = 0; i < childPieces.length; i++) { - if (childPieces[i].length > 0) { - pieces.push(childPieces[i]); - } - } - } - return new Path(pieces, 0); -} -/** - * @returns True if there are no segments in this path - */ -function pathIsEmpty(path) { - return path.pieceNum_ >= path.pieces_.length; -} -/** - * @returns The path from outerPath to innerPath - */ -function newRelativePath(outerPath, innerPath) { - var outer = pathGetFront(outerPath), inner = pathGetFront(innerPath); - if (outer === null) { - return innerPath; - } - else if (outer === inner) { - return newRelativePath(pathPopFront(outerPath), pathPopFront(innerPath)); - } - else { - throw new Error('INTERNAL ERROR: innerPath (' + - innerPath + - ') is not within ' + - 'outerPath (' + - outerPath + - ')'); - } -} -/** - * @returns -1, 0, 1 if left is less, equal, or greater than the right. - */ -function pathCompare(left, right) { - var leftKeys = pathSlice(left, 0); - var rightKeys = pathSlice(right, 0); - for (var i = 0; i < leftKeys.length && i < rightKeys.length; i++) { - var cmp = nameCompare(leftKeys[i], rightKeys[i]); - if (cmp !== 0) { - return cmp; - } - } - if (leftKeys.length === rightKeys.length) { - return 0; - } - return leftKeys.length < rightKeys.length ? -1 : 1; -} -/** - * @returns true if paths are the same. - */ -function pathEquals(path, other) { - if (pathGetLength(path) !== pathGetLength(other)) { - return false; - } - for (var i = path.pieceNum_, j = other.pieceNum_; i <= path.pieces_.length; i++, j++) { - if (path.pieces_[i] !== other.pieces_[j]) { - return false; - } - } - return true; -} -/** - * @returns True if this path is a parent of (or the same as) other - */ -function pathContains(path, other) { - var i = path.pieceNum_; - var j = other.pieceNum_; - if (pathGetLength(path) > pathGetLength(other)) { - return false; - } - while (i < path.pieces_.length) { - if (path.pieces_[i] !== other.pieces_[j]) { - return false; - } - ++i; - ++j; - } - return true; -} -/** - * Dynamic (mutable) path used to count path lengths. - * - * This class is used to efficiently check paths for valid - * length (in UTF8 bytes) and depth (used in path validation). - * - * Throws Error exception if path is ever invalid. - * - * The definition of a path always begins with '/'. - */ -var ValidationPath = /** @class */ (function () { - /** - * @param path - Initial Path. - * @param errorPrefix_ - Prefix for any error messages. - */ - function ValidationPath(path, errorPrefix_) { - this.errorPrefix_ = errorPrefix_; - this.parts_ = pathSlice(path, 0); - /** Initialize to number of '/' chars needed in path. */ - this.byteLength_ = Math.max(1, this.parts_.length); - for (var i = 0; i < this.parts_.length; i++) { - this.byteLength_ += stringLength(this.parts_[i]); - } - validationPathCheckValid(this); - } - return ValidationPath; -}()); -function validationPathPush(validationPath, child) { - // Count the needed '/' - if (validationPath.parts_.length > 0) { - validationPath.byteLength_ += 1; - } - validationPath.parts_.push(child); - validationPath.byteLength_ += stringLength(child); - validationPathCheckValid(validationPath); -} -function validationPathPop(validationPath) { - var last = validationPath.parts_.pop(); - validationPath.byteLength_ -= stringLength(last); - // Un-count the previous '/' - if (validationPath.parts_.length > 0) { - validationPath.byteLength_ -= 1; - } -} -function validationPathCheckValid(validationPath) { - if (validationPath.byteLength_ > MAX_PATH_LENGTH_BYTES) { - throw new Error(validationPath.errorPrefix_ + - 'has a key path longer than ' + - MAX_PATH_LENGTH_BYTES + - ' bytes (' + - validationPath.byteLength_ + - ').'); - } - if (validationPath.parts_.length > MAX_PATH_DEPTH) { - throw new Error(validationPath.errorPrefix_ + - 'path specified exceeds the maximum depth that can be written (' + - MAX_PATH_DEPTH + - ') or object contains a cycle ' + - validationPathToErrorString(validationPath)); - } -} -/** - * String for use in error messages - uses '.' notation for path. - */ -function validationPathToErrorString(validationPath) { - if (validationPath.parts_.length === 0) { - return ''; - } - return "in property '" + validationPath.parts_.join('.') + "'"; -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var VisibilityMonitor = /** @class */ (function (_super) { - __extends(VisibilityMonitor, _super); - function VisibilityMonitor() { - var _this = _super.call(this, ['visible']) || this; - var hidden; - var visibilityChange; - if (typeof document !== 'undefined' && - typeof document.addEventListener !== 'undefined') { - if (typeof document['hidden'] !== 'undefined') { - // Opera 12.10 and Firefox 18 and later support - visibilityChange = 'visibilitychange'; - hidden = 'hidden'; - } - else if (typeof document['mozHidden'] !== 'undefined') { - visibilityChange = 'mozvisibilitychange'; - hidden = 'mozHidden'; - } - else if (typeof document['msHidden'] !== 'undefined') { - visibilityChange = 'msvisibilitychange'; - hidden = 'msHidden'; - } - else if (typeof document['webkitHidden'] !== 'undefined') { - visibilityChange = 'webkitvisibilitychange'; - hidden = 'webkitHidden'; - } - } - // Initially, we always assume we are visible. This ensures that in browsers - // without page visibility support or in cases where we are never visible - // (e.g. chrome extension), we act as if we are visible, i.e. don't delay - // reconnects - _this.visible_ = true; - if (visibilityChange) { - document.addEventListener(visibilityChange, function () { - var visible = !document[hidden]; - if (visible !== _this.visible_) { - _this.visible_ = visible; - _this.trigger('visible', visible); - } - }, false); - } - return _this; - } - VisibilityMonitor.getInstance = function () { - return new VisibilityMonitor(); - }; - VisibilityMonitor.prototype.getInitialEvent = function (eventType) { - assert(eventType === 'visible', 'Unknown event type: ' + eventType); - return [this.visible_]; - }; - return VisibilityMonitor; -}(EventEmitter)); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var RECONNECT_MIN_DELAY = 1000; -var RECONNECT_MAX_DELAY_DEFAULT = 60 * 5 * 1000; // 5 minutes in milliseconds (Case: 1858) -var RECONNECT_MAX_DELAY_FOR_ADMINS = 30 * 1000; // 30 seconds for admin clients (likely to be a backend server) -var RECONNECT_DELAY_MULTIPLIER = 1.3; -var RECONNECT_DELAY_RESET_TIMEOUT = 30000; // Reset delay back to MIN_DELAY after being connected for 30sec. -var SERVER_KILL_INTERRUPT_REASON = 'server_kill'; -// If auth fails repeatedly, we'll assume something is wrong and log a warning / back off. -var INVALID_TOKEN_THRESHOLD = 3; -/** - * Firebase connection. Abstracts wire protocol and handles reconnecting. - * - * NOTE: All JSON objects sent to the realtime connection must have property names enclosed - * in quotes to make sure the closure compiler does not minify them. - */ -var PersistentConnection = /** @class */ (function (_super) { - __extends(PersistentConnection, _super); - /** - * @param repoInfo_ - Data about the namespace we are connecting to - * @param applicationId_ - The Firebase App ID for this project - * @param onDataUpdate_ - A callback for new data from the server - */ - function PersistentConnection(repoInfo_, applicationId_, onDataUpdate_, onConnectStatus_, onServerInfoUpdate_, authTokenProvider_, appCheckTokenProvider_, authOverride_) { - var _this = _super.call(this) || this; - _this.repoInfo_ = repoInfo_; - _this.applicationId_ = applicationId_; - _this.onDataUpdate_ = onDataUpdate_; - _this.onConnectStatus_ = onConnectStatus_; - _this.onServerInfoUpdate_ = onServerInfoUpdate_; - _this.authTokenProvider_ = authTokenProvider_; - _this.appCheckTokenProvider_ = appCheckTokenProvider_; - _this.authOverride_ = authOverride_; - // Used for diagnostic logging. - _this.id = PersistentConnection.nextPersistentConnectionId_++; - _this.log_ = logWrapper('p:' + _this.id + ':'); - _this.interruptReasons_ = {}; - _this.listens = new Map(); - _this.outstandingPuts_ = []; - _this.outstandingGets_ = []; - _this.outstandingPutCount_ = 0; - _this.outstandingGetCount_ = 0; - _this.onDisconnectRequestQueue_ = []; - _this.connected_ = false; - _this.reconnectDelay_ = RECONNECT_MIN_DELAY; - _this.maxReconnectDelay_ = RECONNECT_MAX_DELAY_DEFAULT; - _this.securityDebugCallback_ = null; - _this.lastSessionId = null; - _this.establishConnectionTimer_ = null; - _this.visible_ = false; - // Before we get connected, we keep a queue of pending messages to send. - _this.requestCBHash_ = {}; - _this.requestNumber_ = 0; - _this.realtime_ = null; - _this.authToken_ = null; - _this.appCheckToken_ = null; - _this.forceTokenRefresh_ = false; - _this.invalidAuthTokenCount_ = 0; - _this.invalidAppCheckTokenCount_ = 0; - _this.firstConnection_ = true; - _this.lastConnectionAttemptTime_ = null; - _this.lastConnectionEstablishedTime_ = null; - if (authOverride_ && !isNodeSdk()) { - throw new Error('Auth override specified in options, but not supported on non Node.js platforms'); - } - VisibilityMonitor.getInstance().on('visible', _this.onVisible_, _this); - if (repoInfo_.host.indexOf('fblocal') === -1) { - OnlineMonitor.getInstance().on('online', _this.onOnline_, _this); - } - return _this; - } - PersistentConnection.prototype.sendRequest = function (action, body, onResponse) { - var curReqNum = ++this.requestNumber_; - var msg = { r: curReqNum, a: action, b: body }; - this.log_(stringify(msg)); - assert(this.connected_, "sendRequest call when we're not connected not allowed."); - this.realtime_.sendRequest(msg); - if (onResponse) { - this.requestCBHash_[curReqNum] = onResponse; - } - }; - PersistentConnection.prototype.get = function (query) { - this.initConnection_(); - var deferred = new Deferred(); - var request = { - p: query._path.toString(), - q: query._queryObject - }; - var outstandingGet = { - action: 'g', - request: request, - onComplete: function (message) { - var payload = message['d']; - if (message['s'] === 'ok') { - deferred.resolve(payload); - } - else { - deferred.reject(payload); - } - } - }; - this.outstandingGets_.push(outstandingGet); - this.outstandingGetCount_++; - var index = this.outstandingGets_.length - 1; - if (this.connected_) { - this.sendGet_(index); - } - return deferred.promise; - }; - PersistentConnection.prototype.listen = function (query, currentHashFn, tag, onComplete) { - this.initConnection_(); - var queryId = query._queryIdentifier; - var pathString = query._path.toString(); - this.log_('Listen called for ' + pathString + ' ' + queryId); - if (!this.listens.has(pathString)) { - this.listens.set(pathString, new Map()); - } - assert(query._queryParams.isDefault() || !query._queryParams.loadsAllData(), 'listen() called for non-default but complete query'); - assert(!this.listens.get(pathString).has(queryId), "listen() called twice for same path/queryId."); - var listenSpec = { - onComplete: onComplete, - hashFn: currentHashFn, - query: query, - tag: tag - }; - this.listens.get(pathString).set(queryId, listenSpec); - if (this.connected_) { - this.sendListen_(listenSpec); - } - }; - PersistentConnection.prototype.sendGet_ = function (index) { - var _this = this; - var get = this.outstandingGets_[index]; - this.sendRequest('g', get.request, function (message) { - delete _this.outstandingGets_[index]; - _this.outstandingGetCount_--; - if (_this.outstandingGetCount_ === 0) { - _this.outstandingGets_ = []; - } - if (get.onComplete) { - get.onComplete(message); - } - }); - }; - PersistentConnection.prototype.sendListen_ = function (listenSpec) { - var _this = this; - var query = listenSpec.query; - var pathString = query._path.toString(); - var queryId = query._queryIdentifier; - this.log_('Listen on ' + pathString + ' for ' + queryId); - var req = { /*path*/ p: pathString }; - var action = 'q'; - // Only bother to send query if it's non-default. - if (listenSpec.tag) { - req['q'] = query._queryObject; - req['t'] = listenSpec.tag; - } - req[ /*hash*/'h'] = listenSpec.hashFn(); - this.sendRequest(action, req, function (message) { - var payload = message[ /*data*/'d']; - var status = message[ /*status*/'s']; - // print warnings in any case... - PersistentConnection.warnOnListenWarnings_(payload, query); - var currentListenSpec = _this.listens.get(pathString) && - _this.listens.get(pathString).get(queryId); - // only trigger actions if the listen hasn't been removed and readded - if (currentListenSpec === listenSpec) { - _this.log_('listen response', message); - if (status !== 'ok') { - _this.removeListen_(pathString, queryId); - } - if (listenSpec.onComplete) { - listenSpec.onComplete(status, payload); - } - } - }); - }; - PersistentConnection.warnOnListenWarnings_ = function (payload, query) { - if (payload && typeof payload === 'object' && contains(payload, 'w')) { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - var warnings = safeGet(payload, 'w'); - if (Array.isArray(warnings) && ~warnings.indexOf('no_index')) { - var indexSpec = '".indexOn": "' + query._queryParams.getIndex().toString() + '"'; - var indexPath = query._path.toString(); - warn("Using an unspecified index. Your data will be downloaded and " + - ("filtered on the client. Consider adding " + indexSpec + " at ") + - (indexPath + " to your security rules for better performance.")); - } - } - }; - PersistentConnection.prototype.refreshAuthToken = function (token) { - this.authToken_ = token; - this.log_('Auth token refreshed'); - if (this.authToken_) { - this.tryAuth(); - } - else { - //If we're connected we want to let the server know to unauthenticate us. If we're not connected, simply delete - //the credential so we dont become authenticated next time we connect. - if (this.connected_) { - this.sendRequest('unauth', {}, function () { }); - } - } - this.reduceReconnectDelayIfAdminCredential_(token); - }; - PersistentConnection.prototype.reduceReconnectDelayIfAdminCredential_ = function (credential) { - // NOTE: This isn't intended to be bulletproof (a malicious developer can always just modify the client). - // Additionally, we don't bother resetting the max delay back to the default if auth fails / expires. - var isFirebaseSecret = credential && credential.length === 40; - if (isFirebaseSecret || isAdmin(credential)) { - this.log_('Admin auth credential detected. Reducing max reconnect time.'); - this.maxReconnectDelay_ = RECONNECT_MAX_DELAY_FOR_ADMINS; - } - }; - PersistentConnection.prototype.refreshAppCheckToken = function (token) { - this.appCheckToken_ = token; - this.log_('App check token refreshed'); - if (this.appCheckToken_) { - this.tryAppCheck(); - } - else { - //If we're connected we want to let the server know to unauthenticate us. - //If we're not connected, simply delete the credential so we dont become - // authenticated next time we connect. - if (this.connected_) { - this.sendRequest('unappeck', {}, function () { }); - } - } - }; - /** - * Attempts to authenticate with the given credentials. If the authentication attempt fails, it's triggered like - * a auth revoked (the connection is closed). - */ - PersistentConnection.prototype.tryAuth = function () { - var _this = this; - if (this.connected_ && this.authToken_) { - var token_1 = this.authToken_; - var authMethod = isValidFormat(token_1) ? 'auth' : 'gauth'; - var requestData = { cred: token_1 }; - if (this.authOverride_ === null) { - requestData['noauth'] = true; - } - else if (typeof this.authOverride_ === 'object') { - requestData['authvar'] = this.authOverride_; - } - this.sendRequest(authMethod, requestData, function (res) { - var status = res[ /*status*/'s']; - var data = res[ /*data*/'d'] || 'error'; - if (_this.authToken_ === token_1) { - if (status === 'ok') { - _this.invalidAuthTokenCount_ = 0; - } - else { - // Triggers reconnect and force refresh for auth token - _this.onAuthRevoked_(status, data); - } - } - }); - } - }; - /** - * Attempts to authenticate with the given token. If the authentication - * attempt fails, it's triggered like the token was revoked (the connection is - * closed). - */ - PersistentConnection.prototype.tryAppCheck = function () { - var _this = this; - if (this.connected_ && this.appCheckToken_) { - this.sendRequest('appcheck', { 'token': this.appCheckToken_ }, function (res) { - var status = res[ /*status*/'s']; - var data = res[ /*data*/'d'] || 'error'; - if (status === 'ok') { - _this.invalidAppCheckTokenCount_ = 0; - } - else { - _this.onAppCheckRevoked_(status, data); - } - }); - } - }; - /** - * @inheritDoc - */ - PersistentConnection.prototype.unlisten = function (query, tag) { - var pathString = query._path.toString(); - var queryId = query._queryIdentifier; - this.log_('Unlisten called for ' + pathString + ' ' + queryId); - assert(query._queryParams.isDefault() || !query._queryParams.loadsAllData(), 'unlisten() called for non-default but complete query'); - var listen = this.removeListen_(pathString, queryId); - if (listen && this.connected_) { - this.sendUnlisten_(pathString, queryId, query._queryObject, tag); - } - }; - PersistentConnection.prototype.sendUnlisten_ = function (pathString, queryId, queryObj, tag) { - this.log_('Unlisten on ' + pathString + ' for ' + queryId); - var req = { /*path*/ p: pathString }; - var action = 'n'; - // Only bother sending queryId if it's non-default. - if (tag) { - req['q'] = queryObj; - req['t'] = tag; - } - this.sendRequest(action, req); - }; - PersistentConnection.prototype.onDisconnectPut = function (pathString, data, onComplete) { - this.initConnection_(); - if (this.connected_) { - this.sendOnDisconnect_('o', pathString, data, onComplete); - } - else { - this.onDisconnectRequestQueue_.push({ - pathString: pathString, - action: 'o', - data: data, - onComplete: onComplete - }); - } - }; - PersistentConnection.prototype.onDisconnectMerge = function (pathString, data, onComplete) { - this.initConnection_(); - if (this.connected_) { - this.sendOnDisconnect_('om', pathString, data, onComplete); - } - else { - this.onDisconnectRequestQueue_.push({ - pathString: pathString, - action: 'om', - data: data, - onComplete: onComplete - }); - } - }; - PersistentConnection.prototype.onDisconnectCancel = function (pathString, onComplete) { - this.initConnection_(); - if (this.connected_) { - this.sendOnDisconnect_('oc', pathString, null, onComplete); - } - else { - this.onDisconnectRequestQueue_.push({ - pathString: pathString, - action: 'oc', - data: null, - onComplete: onComplete - }); - } - }; - PersistentConnection.prototype.sendOnDisconnect_ = function (action, pathString, data, onComplete) { - var request = { /*path*/ p: pathString, /*data*/ d: data }; - this.log_('onDisconnect ' + action, request); - this.sendRequest(action, request, function (response) { - if (onComplete) { - setTimeout(function () { - onComplete(response[ /*status*/'s'], response[ /* data */'d']); - }, Math.floor(0)); - } - }); - }; - PersistentConnection.prototype.put = function (pathString, data, onComplete, hash) { - this.putInternal('p', pathString, data, onComplete, hash); - }; - PersistentConnection.prototype.merge = function (pathString, data, onComplete, hash) { - this.putInternal('m', pathString, data, onComplete, hash); - }; - PersistentConnection.prototype.putInternal = function (action, pathString, data, onComplete, hash) { - this.initConnection_(); - var request = { - /*path*/ p: pathString, - /*data*/ d: data - }; - if (hash !== undefined) { - request[ /*hash*/'h'] = hash; - } - // TODO: Only keep track of the most recent put for a given path? - this.outstandingPuts_.push({ - action: action, - request: request, - onComplete: onComplete - }); - this.outstandingPutCount_++; - var index = this.outstandingPuts_.length - 1; - if (this.connected_) { - this.sendPut_(index); - } - else { - this.log_('Buffering put: ' + pathString); - } - }; - PersistentConnection.prototype.sendPut_ = function (index) { - var _this = this; - var action = this.outstandingPuts_[index].action; - var request = this.outstandingPuts_[index].request; - var onComplete = this.outstandingPuts_[index].onComplete; - this.outstandingPuts_[index].queued = this.connected_; - this.sendRequest(action, request, function (message) { - _this.log_(action + ' response', message); - delete _this.outstandingPuts_[index]; - _this.outstandingPutCount_--; - // Clean up array occasionally. - if (_this.outstandingPutCount_ === 0) { - _this.outstandingPuts_ = []; - } - if (onComplete) { - onComplete(message[ /*status*/'s'], message[ /* data */'d']); - } - }); - }; - PersistentConnection.prototype.reportStats = function (stats) { - var _this = this; - // If we're not connected, we just drop the stats. - if (this.connected_) { - var request = { /*counters*/ c: stats }; - this.log_('reportStats', request); - this.sendRequest(/*stats*/ 's', request, function (result) { - var status = result[ /*status*/'s']; - if (status !== 'ok') { - var errorReason = result[ /* data */'d']; - _this.log_('reportStats', 'Error sending stats: ' + errorReason); - } - }); - } - }; - PersistentConnection.prototype.onDataMessage_ = function (message) { - if ('r' in message) { - // this is a response - this.log_('from server: ' + stringify(message)); - var reqNum = message['r']; - var onResponse = this.requestCBHash_[reqNum]; - if (onResponse) { - delete this.requestCBHash_[reqNum]; - onResponse(message[ /*body*/'b']); - } - } - else if ('error' in message) { - throw 'A server-side error has occurred: ' + message['error']; - } - else if ('a' in message) { - // a and b are action and body, respectively - this.onDataPush_(message['a'], message['b']); - } - }; - PersistentConnection.prototype.onDataPush_ = function (action, body) { - this.log_('handleServerMessage', action, body); - if (action === 'd') { - this.onDataUpdate_(body[ /*path*/'p'], body[ /*data*/'d'], - /*isMerge*/ false, body['t']); - } - else if (action === 'm') { - this.onDataUpdate_(body[ /*path*/'p'], body[ /*data*/'d'], - /*isMerge=*/ true, body['t']); - } - else if (action === 'c') { - this.onListenRevoked_(body[ /*path*/'p'], body[ /*query*/'q']); - } - else if (action === 'ac') { - this.onAuthRevoked_(body[ /*status code*/'s'], body[ /* explanation */'d']); - } - else if (action === 'apc') { - this.onAppCheckRevoked_(body[ /*status code*/'s'], body[ /* explanation */'d']); - } - else if (action === 'sd') { - this.onSecurityDebugPacket_(body); - } - else { - error('Unrecognized action received from server: ' + - stringify(action) + - '\nAre you using the latest client?'); - } - }; - PersistentConnection.prototype.onReady_ = function (timestamp, sessionId) { - this.log_('connection ready'); - this.connected_ = true; - this.lastConnectionEstablishedTime_ = new Date().getTime(); - this.handleTimestamp_(timestamp); - this.lastSessionId = sessionId; - if (this.firstConnection_) { - this.sendConnectStats_(); - } - this.restoreState_(); - this.firstConnection_ = false; - this.onConnectStatus_(true); - }; - PersistentConnection.prototype.scheduleConnect_ = function (timeout) { - var _this = this; - assert(!this.realtime_, "Scheduling a connect when we're already connected/ing?"); - if (this.establishConnectionTimer_) { - clearTimeout(this.establishConnectionTimer_); - } - // NOTE: Even when timeout is 0, it's important to do a setTimeout to work around an infuriating "Security Error" in - // Firefox when trying to write to our long-polling iframe in some scenarios (e.g. Forge or our unit tests). - this.establishConnectionTimer_ = setTimeout(function () { - _this.establishConnectionTimer_ = null; - _this.establishConnection_(); - // eslint-disable-next-line @typescript-eslint/no-explicit-any - }, Math.floor(timeout)); - }; - PersistentConnection.prototype.initConnection_ = function () { - if (!this.realtime_ && this.firstConnection_) { - this.scheduleConnect_(0); - } - }; - PersistentConnection.prototype.onVisible_ = function (visible) { - // NOTE: Tabbing away and back to a window will defeat our reconnect backoff, but I think that's fine. - if (visible && - !this.visible_ && - this.reconnectDelay_ === this.maxReconnectDelay_) { - this.log_('Window became visible. Reducing delay.'); - this.reconnectDelay_ = RECONNECT_MIN_DELAY; - if (!this.realtime_) { - this.scheduleConnect_(0); - } - } - this.visible_ = visible; - }; - PersistentConnection.prototype.onOnline_ = function (online) { - if (online) { - this.log_('Browser went online.'); - this.reconnectDelay_ = RECONNECT_MIN_DELAY; - if (!this.realtime_) { - this.scheduleConnect_(0); - } - } - else { - this.log_('Browser went offline. Killing connection.'); - if (this.realtime_) { - this.realtime_.close(); - } - } - }; - PersistentConnection.prototype.onRealtimeDisconnect_ = function () { - this.log_('data client disconnected'); - this.connected_ = false; - this.realtime_ = null; - // Since we don't know if our sent transactions succeeded or not, we need to cancel them. - this.cancelSentTransactions_(); - // Clear out the pending requests. - this.requestCBHash_ = {}; - if (this.shouldReconnect_()) { - if (!this.visible_) { - this.log_("Window isn't visible. Delaying reconnect."); - this.reconnectDelay_ = this.maxReconnectDelay_; - this.lastConnectionAttemptTime_ = new Date().getTime(); - } - else if (this.lastConnectionEstablishedTime_) { - // If we've been connected long enough, reset reconnect delay to minimum. - var timeSinceLastConnectSucceeded = new Date().getTime() - this.lastConnectionEstablishedTime_; - if (timeSinceLastConnectSucceeded > RECONNECT_DELAY_RESET_TIMEOUT) { - this.reconnectDelay_ = RECONNECT_MIN_DELAY; - } - this.lastConnectionEstablishedTime_ = null; - } - var timeSinceLastConnectAttempt = new Date().getTime() - this.lastConnectionAttemptTime_; - var reconnectDelay = Math.max(0, this.reconnectDelay_ - timeSinceLastConnectAttempt); - reconnectDelay = Math.random() * reconnectDelay; - this.log_('Trying to reconnect in ' + reconnectDelay + 'ms'); - this.scheduleConnect_(reconnectDelay); - // Adjust reconnect delay for next time. - this.reconnectDelay_ = Math.min(this.maxReconnectDelay_, this.reconnectDelay_ * RECONNECT_DELAY_MULTIPLIER); - } - this.onConnectStatus_(false); - }; - PersistentConnection.prototype.establishConnection_ = function () { - return __awaiter(this, void 0, void 0, function () { - var onDataMessage, onReady, onDisconnect_1, connId, lastSessionId, canceled_1, connection_1, closeFn, sendRequestFn, forceRefresh, _a, authToken, appCheckToken, error_1; - var _this = this; - return __generator(this, function (_b) { - switch (_b.label) { - case 0: - if (!this.shouldReconnect_()) return [3 /*break*/, 4]; - this.log_('Making a connection attempt'); - this.lastConnectionAttemptTime_ = new Date().getTime(); - this.lastConnectionEstablishedTime_ = null; - onDataMessage = this.onDataMessage_.bind(this); - onReady = this.onReady_.bind(this); - onDisconnect_1 = this.onRealtimeDisconnect_.bind(this); - connId = this.id + ':' + PersistentConnection.nextConnectionId_++; - lastSessionId = this.lastSessionId; - canceled_1 = false; - connection_1 = null; - closeFn = function () { - if (connection_1) { - connection_1.close(); - } - else { - canceled_1 = true; - onDisconnect_1(); - } - }; - sendRequestFn = function (msg) { - assert(connection_1, "sendRequest call when we're not connected not allowed."); - connection_1.sendRequest(msg); - }; - this.realtime_ = { - close: closeFn, - sendRequest: sendRequestFn - }; - forceRefresh = this.forceTokenRefresh_; - this.forceTokenRefresh_ = false; - _b.label = 1; - case 1: - _b.trys.push([1, 3, , 4]); - return [4 /*yield*/, Promise.all([ - this.authTokenProvider_.getToken(forceRefresh), - this.appCheckTokenProvider_.getToken(forceRefresh) - ])]; - case 2: - _a = __read.apply(void 0, [_b.sent(), 2]), authToken = _a[0], appCheckToken = _a[1]; - if (!canceled_1) { - log('getToken() completed. Creating connection.'); - this.authToken_ = authToken && authToken.accessToken; - this.appCheckToken_ = appCheckToken && appCheckToken.token; - connection_1 = new Connection(connId, this.repoInfo_, this.applicationId_, this.appCheckToken_, this.authToken_, onDataMessage, onReady, onDisconnect_1, - /* onKill= */ function (reason) { - warn(reason + ' (' + _this.repoInfo_.toString() + ')'); - _this.interrupt(SERVER_KILL_INTERRUPT_REASON); - }, lastSessionId); - } - else { - log('getToken() completed but was canceled'); - } - return [3 /*break*/, 4]; - case 3: - error_1 = _b.sent(); - this.log_('Failed to get token: ' + error_1); - if (!canceled_1) { - if (this.repoInfo_.nodeAdmin) { - // This may be a critical error for the Admin Node.js SDK, so log a warning. - // But getToken() may also just have temporarily failed, so we still want to - // continue retrying. - warn(error_1); - } - closeFn(); - } - return [3 /*break*/, 4]; - case 4: return [2 /*return*/]; - } - }); - }); - }; - PersistentConnection.prototype.interrupt = function (reason) { - log('Interrupting connection for reason: ' + reason); - this.interruptReasons_[reason] = true; - if (this.realtime_) { - this.realtime_.close(); - } - else { - if (this.establishConnectionTimer_) { - clearTimeout(this.establishConnectionTimer_); - this.establishConnectionTimer_ = null; - } - if (this.connected_) { - this.onRealtimeDisconnect_(); - } - } - }; - PersistentConnection.prototype.resume = function (reason) { - log('Resuming connection for reason: ' + reason); - delete this.interruptReasons_[reason]; - if (isEmpty(this.interruptReasons_)) { - this.reconnectDelay_ = RECONNECT_MIN_DELAY; - if (!this.realtime_) { - this.scheduleConnect_(0); - } - } - }; - PersistentConnection.prototype.handleTimestamp_ = function (timestamp) { - var delta = timestamp - new Date().getTime(); - this.onServerInfoUpdate_({ serverTimeOffset: delta }); - }; - PersistentConnection.prototype.cancelSentTransactions_ = function () { - for (var i = 0; i < this.outstandingPuts_.length; i++) { - var put = this.outstandingPuts_[i]; - if (put && /*hash*/ 'h' in put.request && put.queued) { - if (put.onComplete) { - put.onComplete('disconnect'); - } - delete this.outstandingPuts_[i]; - this.outstandingPutCount_--; - } - } - // Clean up array occasionally. - if (this.outstandingPutCount_ === 0) { - this.outstandingPuts_ = []; - } - }; - PersistentConnection.prototype.onListenRevoked_ = function (pathString, query) { - // Remove the listen and manufacture a "permission_denied" error for the failed listen. - var queryId; - if (!query) { - queryId = 'default'; - } - else { - queryId = query.map(function (q) { return ObjectToUniqueKey(q); }).join('$'); - } - var listen = this.removeListen_(pathString, queryId); - if (listen && listen.onComplete) { - listen.onComplete('permission_denied'); - } - }; - PersistentConnection.prototype.removeListen_ = function (pathString, queryId) { - var normalizedPathString = new Path(pathString).toString(); // normalize path. - var listen; - if (this.listens.has(normalizedPathString)) { - var map = this.listens.get(normalizedPathString); - listen = map.get(queryId); - map.delete(queryId); - if (map.size === 0) { - this.listens.delete(normalizedPathString); - } - } - else { - // all listens for this path has already been removed - listen = undefined; - } - return listen; - }; - PersistentConnection.prototype.onAuthRevoked_ = function (statusCode, explanation) { - log('Auth token revoked: ' + statusCode + '/' + explanation); - this.authToken_ = null; - this.forceTokenRefresh_ = true; - this.realtime_.close(); - if (statusCode === 'invalid_token' || statusCode === 'permission_denied') { - // We'll wait a couple times before logging the warning / increasing the - // retry period since oauth tokens will report as "invalid" if they're - // just expired. Plus there may be transient issues that resolve themselves. - this.invalidAuthTokenCount_++; - if (this.invalidAuthTokenCount_ >= INVALID_TOKEN_THRESHOLD) { - // Set a long reconnect delay because recovery is unlikely - this.reconnectDelay_ = RECONNECT_MAX_DELAY_FOR_ADMINS; - // Notify the auth token provider that the token is invalid, which will log - // a warning - this.authTokenProvider_.notifyForInvalidToken(); - } - } - }; - PersistentConnection.prototype.onAppCheckRevoked_ = function (statusCode, explanation) { - log('App check token revoked: ' + statusCode + '/' + explanation); - this.appCheckToken_ = null; - this.forceTokenRefresh_ = true; - // Note: We don't close the connection as the developer may not have - // enforcement enabled. The backend closes connections with enforcements. - if (statusCode === 'invalid_token' || statusCode === 'permission_denied') { - // We'll wait a couple times before logging the warning / increasing the - // retry period since oauth tokens will report as "invalid" if they're - // just expired. Plus there may be transient issues that resolve themselves. - this.invalidAppCheckTokenCount_++; - if (this.invalidAppCheckTokenCount_ >= INVALID_TOKEN_THRESHOLD) { - this.appCheckTokenProvider_.notifyForInvalidToken(); - } - } - }; - PersistentConnection.prototype.onSecurityDebugPacket_ = function (body) { - if (this.securityDebugCallback_) { - this.securityDebugCallback_(body); - } - else { - if ('msg' in body) { - console.log('FIREBASE: ' + body['msg'].replace('\n', '\nFIREBASE: ')); - } - } - }; - PersistentConnection.prototype.restoreState_ = function () { - var e_1, _a, e_2, _b; - //Re-authenticate ourselves if we have a credential stored. - this.tryAuth(); - this.tryAppCheck(); - try { - // Puts depend on having received the corresponding data update from the server before they complete, so we must - // make sure to send listens before puts. - for (var _c = __values(this.listens.values()), _d = _c.next(); !_d.done; _d = _c.next()) { - var queries = _d.value; - try { - for (var _e = (e_2 = void 0, __values(queries.values())), _f = _e.next(); !_f.done; _f = _e.next()) { - var listenSpec = _f.value; - this.sendListen_(listenSpec); - } - } - catch (e_2_1) { e_2 = { error: e_2_1 }; } - finally { - try { - if (_f && !_f.done && (_b = _e.return)) _b.call(_e); - } - finally { if (e_2) throw e_2.error; } - } - } - } - catch (e_1_1) { e_1 = { error: e_1_1 }; } - finally { - try { - if (_d && !_d.done && (_a = _c.return)) _a.call(_c); - } - finally { if (e_1) throw e_1.error; } - } - for (var i = 0; i < this.outstandingPuts_.length; i++) { - if (this.outstandingPuts_[i]) { - this.sendPut_(i); - } - } - while (this.onDisconnectRequestQueue_.length) { - var request = this.onDisconnectRequestQueue_.shift(); - this.sendOnDisconnect_(request.action, request.pathString, request.data, request.onComplete); - } - for (var i = 0; i < this.outstandingGets_.length; i++) { - if (this.outstandingGets_[i]) { - this.sendGet_(i); - } - } - }; - /** - * Sends client stats for first connection - */ - PersistentConnection.prototype.sendConnectStats_ = function () { - var stats = {}; - var clientName = 'js'; - if (isNodeSdk()) { - if (this.repoInfo_.nodeAdmin) { - clientName = 'admin_node'; - } - else { - clientName = 'node'; - } - } - stats['sdk.' + clientName + '.' + SDK_VERSION.replace(/\./g, '-')] = 1; - if (isMobileCordova()) { - stats['framework.cordova'] = 1; - } - else if (isReactNative()) { - stats['framework.reactnative'] = 1; - } - this.reportStats(stats); - }; - PersistentConnection.prototype.shouldReconnect_ = function () { - var online = OnlineMonitor.getInstance().currentlyOnline(); - return isEmpty(this.interruptReasons_) && online; - }; - PersistentConnection.nextPersistentConnectionId_ = 0; - /** - * Counter for number of connections created. Mainly used for tagging in the logs - */ - PersistentConnection.nextConnectionId_ = 0; - return PersistentConnection; -}(ServerActions)); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var NamedNode = /** @class */ (function () { - function NamedNode(name, node) { - this.name = name; - this.node = node; - } - NamedNode.Wrap = function (name, node) { - return new NamedNode(name, node); - }; - return NamedNode; -}()); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var Index = /** @class */ (function () { - function Index() { - } - /** - * @returns A standalone comparison function for - * this index - */ - Index.prototype.getCompare = function () { - return this.compare.bind(this); - }; - /** - * Given a before and after value for a node, determine if the indexed value has changed. Even if they are different, - * it's possible that the changes are isolated to parts of the snapshot that are not indexed. - * - * - * @returns True if the portion of the snapshot being indexed changed between oldNode and newNode - */ - Index.prototype.indexedValueChanged = function (oldNode, newNode) { - var oldWrapped = new NamedNode(MIN_NAME, oldNode); - var newWrapped = new NamedNode(MIN_NAME, newNode); - return this.compare(oldWrapped, newWrapped) !== 0; - }; - /** - * @returns a node wrapper that will sort equal to or less than - * any other node wrapper, using this index - */ - Index.prototype.minPost = function () { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - return NamedNode.MIN; - }; - return Index; -}()); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var __EMPTY_NODE; -var KeyIndex = /** @class */ (function (_super) { - __extends(KeyIndex, _super); - function KeyIndex() { - return _super !== null && _super.apply(this, arguments) || this; - } - Object.defineProperty(KeyIndex, "__EMPTY_NODE", { - get: function () { - return __EMPTY_NODE; - }, - set: function (val) { - __EMPTY_NODE = val; - }, - enumerable: false, - configurable: true - }); - KeyIndex.prototype.compare = function (a, b) { - return nameCompare(a.name, b.name); - }; - KeyIndex.prototype.isDefinedOn = function (node) { - // We could probably return true here (since every node has a key), but it's never called - // so just leaving unimplemented for now. - throw assertionError('KeyIndex.isDefinedOn not expected to be called.'); - }; - KeyIndex.prototype.indexedValueChanged = function (oldNode, newNode) { - return false; // The key for a node never changes. - }; - KeyIndex.prototype.minPost = function () { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - return NamedNode.MIN; - }; - KeyIndex.prototype.maxPost = function () { - // TODO: This should really be created once and cached in a static property, but - // NamedNode isn't defined yet, so I can't use it in a static. Bleh. - return new NamedNode(MAX_NAME, __EMPTY_NODE); - }; - KeyIndex.prototype.makePost = function (indexValue, name) { - assert(typeof indexValue === 'string', 'KeyIndex indexValue must always be a string.'); - // We just use empty node, but it'll never be compared, since our comparator only looks at name. - return new NamedNode(indexValue, __EMPTY_NODE); - }; - /** - * @returns String representation for inclusion in a query spec - */ - KeyIndex.prototype.toString = function () { - return '.key'; - }; - return KeyIndex; -}(Index)); -var KEY_INDEX = new KeyIndex(); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * An iterator over an LLRBNode. - */ -var SortedMapIterator = /** @class */ (function () { - /** - * @param node - Node to iterate. - * @param isReverse_ - Whether or not to iterate in reverse - */ - function SortedMapIterator(node, startKey, comparator, isReverse_, resultGenerator_) { - if (resultGenerator_ === void 0) { resultGenerator_ = null; } - this.isReverse_ = isReverse_; - this.resultGenerator_ = resultGenerator_; - this.nodeStack_ = []; - var cmp = 1; - while (!node.isEmpty()) { - node = node; - cmp = startKey ? comparator(node.key, startKey) : 1; - // flip the comparison if we're going in reverse - if (isReverse_) { - cmp *= -1; - } - if (cmp < 0) { - // This node is less than our start key. ignore it - if (this.isReverse_) { - node = node.left; - } - else { - node = node.right; - } - } - else if (cmp === 0) { - // This node is exactly equal to our start key. Push it on the stack, but stop iterating; - this.nodeStack_.push(node); - break; - } - else { - // This node is greater than our start key, add it to the stack and move to the next one - this.nodeStack_.push(node); - if (this.isReverse_) { - node = node.right; - } - else { - node = node.left; - } - } - } - } - SortedMapIterator.prototype.getNext = function () { - if (this.nodeStack_.length === 0) { - return null; - } - var node = this.nodeStack_.pop(); - var result; - if (this.resultGenerator_) { - result = this.resultGenerator_(node.key, node.value); - } - else { - result = { key: node.key, value: node.value }; - } - if (this.isReverse_) { - node = node.left; - while (!node.isEmpty()) { - this.nodeStack_.push(node); - node = node.right; - } - } - else { - node = node.right; - while (!node.isEmpty()) { - this.nodeStack_.push(node); - node = node.left; - } - } - return result; - }; - SortedMapIterator.prototype.hasNext = function () { - return this.nodeStack_.length > 0; - }; - SortedMapIterator.prototype.peek = function () { - if (this.nodeStack_.length === 0) { - return null; - } - var node = this.nodeStack_[this.nodeStack_.length - 1]; - if (this.resultGenerator_) { - return this.resultGenerator_(node.key, node.value); - } - else { - return { key: node.key, value: node.value }; - } - }; - return SortedMapIterator; -}()); -/** - * Represents a node in a Left-leaning Red-Black tree. - */ -var LLRBNode = /** @class */ (function () { - /** - * @param key - Key associated with this node. - * @param value - Value associated with this node. - * @param color - Whether this node is red. - * @param left - Left child. - * @param right - Right child. - */ - function LLRBNode(key, value, color, left, right) { - this.key = key; - this.value = value; - this.color = color != null ? color : LLRBNode.RED; - this.left = - left != null ? left : SortedMap.EMPTY_NODE; - this.right = - right != null ? right : SortedMap.EMPTY_NODE; - } - /** - * Returns a copy of the current node, optionally replacing pieces of it. - * - * @param key - New key for the node, or null. - * @param value - New value for the node, or null. - * @param color - New color for the node, or null. - * @param left - New left child for the node, or null. - * @param right - New right child for the node, or null. - * @returns The node copy. - */ - LLRBNode.prototype.copy = function (key, value, color, left, right) { - return new LLRBNode(key != null ? key : this.key, value != null ? value : this.value, color != null ? color : this.color, left != null ? left : this.left, right != null ? right : this.right); - }; - /** - * @returns The total number of nodes in the tree. - */ - LLRBNode.prototype.count = function () { - return this.left.count() + 1 + this.right.count(); - }; - /** - * @returns True if the tree is empty. - */ - LLRBNode.prototype.isEmpty = function () { - return false; - }; - /** - * Traverses the tree in key order and calls the specified action function - * for each node. - * - * @param action - Callback function to be called for each - * node. If it returns true, traversal is aborted. - * @returns The first truthy value returned by action, or the last falsey - * value returned by action - */ - LLRBNode.prototype.inorderTraversal = function (action) { - return (this.left.inorderTraversal(action) || - !!action(this.key, this.value) || - this.right.inorderTraversal(action)); - }; - /** - * Traverses the tree in reverse key order and calls the specified action function - * for each node. - * - * @param action - Callback function to be called for each - * node. If it returns true, traversal is aborted. - * @returns True if traversal was aborted. - */ - LLRBNode.prototype.reverseTraversal = function (action) { - return (this.right.reverseTraversal(action) || - action(this.key, this.value) || - this.left.reverseTraversal(action)); - }; - /** - * @returns The minimum node in the tree. - */ - LLRBNode.prototype.min_ = function () { - if (this.left.isEmpty()) { - return this; - } - else { - return this.left.min_(); - } - }; - /** - * @returns The maximum key in the tree. - */ - LLRBNode.prototype.minKey = function () { - return this.min_().key; - }; - /** - * @returns The maximum key in the tree. - */ - LLRBNode.prototype.maxKey = function () { - if (this.right.isEmpty()) { - return this.key; - } - else { - return this.right.maxKey(); - } - }; - /** - * @param key - Key to insert. - * @param value - Value to insert. - * @param comparator - Comparator. - * @returns New tree, with the key/value added. - */ - LLRBNode.prototype.insert = function (key, value, comparator) { - var n = this; - var cmp = comparator(key, n.key); - if (cmp < 0) { - n = n.copy(null, null, null, n.left.insert(key, value, comparator), null); - } - else if (cmp === 0) { - n = n.copy(null, value, null, null, null); - } - else { - n = n.copy(null, null, null, null, n.right.insert(key, value, comparator)); - } - return n.fixUp_(); - }; - /** - * @returns New tree, with the minimum key removed. - */ - LLRBNode.prototype.removeMin_ = function () { - if (this.left.isEmpty()) { - return SortedMap.EMPTY_NODE; - } - var n = this; - if (!n.left.isRed_() && !n.left.left.isRed_()) { - n = n.moveRedLeft_(); - } - n = n.copy(null, null, null, n.left.removeMin_(), null); - return n.fixUp_(); - }; - /** - * @param key - The key of the item to remove. - * @param comparator - Comparator. - * @returns New tree, with the specified item removed. - */ - LLRBNode.prototype.remove = function (key, comparator) { - var n, smallest; - n = this; - if (comparator(key, n.key) < 0) { - if (!n.left.isEmpty() && !n.left.isRed_() && !n.left.left.isRed_()) { - n = n.moveRedLeft_(); - } - n = n.copy(null, null, null, n.left.remove(key, comparator), null); - } - else { - if (n.left.isRed_()) { - n = n.rotateRight_(); - } - if (!n.right.isEmpty() && !n.right.isRed_() && !n.right.left.isRed_()) { - n = n.moveRedRight_(); - } - if (comparator(key, n.key) === 0) { - if (n.right.isEmpty()) { - return SortedMap.EMPTY_NODE; - } - else { - smallest = n.right.min_(); - n = n.copy(smallest.key, smallest.value, null, null, n.right.removeMin_()); - } - } - n = n.copy(null, null, null, null, n.right.remove(key, comparator)); - } - return n.fixUp_(); - }; - /** - * @returns Whether this is a RED node. - */ - LLRBNode.prototype.isRed_ = function () { - return this.color; - }; - /** - * @returns New tree after performing any needed rotations. - */ - LLRBNode.prototype.fixUp_ = function () { - var n = this; - if (n.right.isRed_() && !n.left.isRed_()) { - n = n.rotateLeft_(); - } - if (n.left.isRed_() && n.left.left.isRed_()) { - n = n.rotateRight_(); - } - if (n.left.isRed_() && n.right.isRed_()) { - n = n.colorFlip_(); - } - return n; - }; - /** - * @returns New tree, after moveRedLeft. - */ - LLRBNode.prototype.moveRedLeft_ = function () { - var n = this.colorFlip_(); - if (n.right.left.isRed_()) { - n = n.copy(null, null, null, null, n.right.rotateRight_()); - n = n.rotateLeft_(); - n = n.colorFlip_(); - } - return n; - }; - /** - * @returns New tree, after moveRedRight. - */ - LLRBNode.prototype.moveRedRight_ = function () { - var n = this.colorFlip_(); - if (n.left.left.isRed_()) { - n = n.rotateRight_(); - n = n.colorFlip_(); - } - return n; - }; - /** - * @returns New tree, after rotateLeft. - */ - LLRBNode.prototype.rotateLeft_ = function () { - var nl = this.copy(null, null, LLRBNode.RED, null, this.right.left); - return this.right.copy(null, null, this.color, nl, null); - }; - /** - * @returns New tree, after rotateRight. - */ - LLRBNode.prototype.rotateRight_ = function () { - var nr = this.copy(null, null, LLRBNode.RED, this.left.right, null); - return this.left.copy(null, null, this.color, null, nr); - }; - /** - * @returns Newt ree, after colorFlip. - */ - LLRBNode.prototype.colorFlip_ = function () { - var left = this.left.copy(null, null, !this.left.color, null, null); - var right = this.right.copy(null, null, !this.right.color, null, null); - return this.copy(null, null, !this.color, left, right); - }; - /** - * For testing. - * - * @returns True if all is well. - */ - LLRBNode.prototype.checkMaxDepth_ = function () { - var blackDepth = this.check_(); - return Math.pow(2.0, blackDepth) <= this.count() + 1; - }; - LLRBNode.prototype.check_ = function () { - if (this.isRed_() && this.left.isRed_()) { - throw new Error('Red node has red child(' + this.key + ',' + this.value + ')'); - } - if (this.right.isRed_()) { - throw new Error('Right child of (' + this.key + ',' + this.value + ') is red'); - } - var blackDepth = this.left.check_(); - if (blackDepth !== this.right.check_()) { - throw new Error('Black depths differ'); - } - else { - return blackDepth + (this.isRed_() ? 0 : 1); - } - }; - LLRBNode.RED = true; - LLRBNode.BLACK = false; - return LLRBNode; -}()); -/** - * Represents an empty node (a leaf node in the Red-Black Tree). - */ -var LLRBEmptyNode = /** @class */ (function () { - function LLRBEmptyNode() { - } - /** - * Returns a copy of the current node. - * - * @returns The node copy. - */ - LLRBEmptyNode.prototype.copy = function (key, value, color, left, right) { - return this; - }; - /** - * Returns a copy of the tree, with the specified key/value added. - * - * @param key - Key to be added. - * @param value - Value to be added. - * @param comparator - Comparator. - * @returns New tree, with item added. - */ - LLRBEmptyNode.prototype.insert = function (key, value, comparator) { - return new LLRBNode(key, value, null); - }; - /** - * Returns a copy of the tree, with the specified key removed. - * - * @param key - The key to remove. - * @param comparator - Comparator. - * @returns New tree, with item removed. - */ - LLRBEmptyNode.prototype.remove = function (key, comparator) { - return this; - }; - /** - * @returns The total number of nodes in the tree. - */ - LLRBEmptyNode.prototype.count = function () { - return 0; - }; - /** - * @returns True if the tree is empty. - */ - LLRBEmptyNode.prototype.isEmpty = function () { - return true; - }; - /** - * Traverses the tree in key order and calls the specified action function - * for each node. - * - * @param action - Callback function to be called for each - * node. If it returns true, traversal is aborted. - * @returns True if traversal was aborted. - */ - LLRBEmptyNode.prototype.inorderTraversal = function (action) { - return false; - }; - /** - * Traverses the tree in reverse key order and calls the specified action function - * for each node. - * - * @param action - Callback function to be called for each - * node. If it returns true, traversal is aborted. - * @returns True if traversal was aborted. - */ - LLRBEmptyNode.prototype.reverseTraversal = function (action) { - return false; - }; - LLRBEmptyNode.prototype.minKey = function () { - return null; - }; - LLRBEmptyNode.prototype.maxKey = function () { - return null; - }; - LLRBEmptyNode.prototype.check_ = function () { - return 0; - }; - /** - * @returns Whether this node is red. - */ - LLRBEmptyNode.prototype.isRed_ = function () { - return false; - }; - return LLRBEmptyNode; -}()); -/** - * An immutable sorted map implementation, based on a Left-leaning Red-Black - * tree. - */ -var SortedMap = /** @class */ (function () { - /** - * @param comparator_ - Key comparator. - * @param root_ - Optional root node for the map. - */ - function SortedMap(comparator_, root_) { - if (root_ === void 0) { root_ = SortedMap.EMPTY_NODE; } - this.comparator_ = comparator_; - this.root_ = root_; - } - /** - * Returns a copy of the map, with the specified key/value added or replaced. - * (TODO: We should perhaps rename this method to 'put') - * - * @param key - Key to be added. - * @param value - Value to be added. - * @returns New map, with item added. - */ - SortedMap.prototype.insert = function (key, value) { - return new SortedMap(this.comparator_, this.root_ - .insert(key, value, this.comparator_) - .copy(null, null, LLRBNode.BLACK, null, null)); - }; - /** - * Returns a copy of the map, with the specified key removed. - * - * @param key - The key to remove. - * @returns New map, with item removed. - */ - SortedMap.prototype.remove = function (key) { - return new SortedMap(this.comparator_, this.root_ - .remove(key, this.comparator_) - .copy(null, null, LLRBNode.BLACK, null, null)); - }; - /** - * Returns the value of the node with the given key, or null. - * - * @param key - The key to look up. - * @returns The value of the node with the given key, or null if the - * key doesn't exist. - */ - SortedMap.prototype.get = function (key) { - var cmp; - var node = this.root_; - while (!node.isEmpty()) { - cmp = this.comparator_(key, node.key); - if (cmp === 0) { - return node.value; - } - else if (cmp < 0) { - node = node.left; - } - else if (cmp > 0) { - node = node.right; - } - } - return null; - }; - /** - * Returns the key of the item *before* the specified key, or null if key is the first item. - * @param key - The key to find the predecessor of - * @returns The predecessor key. - */ - SortedMap.prototype.getPredecessorKey = function (key) { - var cmp, node = this.root_, rightParent = null; - while (!node.isEmpty()) { - cmp = this.comparator_(key, node.key); - if (cmp === 0) { - if (!node.left.isEmpty()) { - node = node.left; - while (!node.right.isEmpty()) { - node = node.right; - } - return node.key; - } - else if (rightParent) { - return rightParent.key; - } - else { - return null; // first item. - } - } - else if (cmp < 0) { - node = node.left; - } - else if (cmp > 0) { - rightParent = node; - node = node.right; - } - } - throw new Error('Attempted to find predecessor key for a nonexistent key. What gives?'); - }; - /** - * @returns True if the map is empty. - */ - SortedMap.prototype.isEmpty = function () { - return this.root_.isEmpty(); - }; - /** - * @returns The total number of nodes in the map. - */ - SortedMap.prototype.count = function () { - return this.root_.count(); - }; - /** - * @returns The minimum key in the map. - */ - SortedMap.prototype.minKey = function () { - return this.root_.minKey(); - }; - /** - * @returns The maximum key in the map. - */ - SortedMap.prototype.maxKey = function () { - return this.root_.maxKey(); - }; - /** - * Traverses the map in key order and calls the specified action function - * for each key/value pair. - * - * @param action - Callback function to be called - * for each key/value pair. If action returns true, traversal is aborted. - * @returns The first truthy value returned by action, or the last falsey - * value returned by action - */ - SortedMap.prototype.inorderTraversal = function (action) { - return this.root_.inorderTraversal(action); - }; - /** - * Traverses the map in reverse key order and calls the specified action function - * for each key/value pair. - * - * @param action - Callback function to be called - * for each key/value pair. If action returns true, traversal is aborted. - * @returns True if the traversal was aborted. - */ - SortedMap.prototype.reverseTraversal = function (action) { - return this.root_.reverseTraversal(action); - }; - /** - * Returns an iterator over the SortedMap. - * @returns The iterator. - */ - SortedMap.prototype.getIterator = function (resultGenerator) { - return new SortedMapIterator(this.root_, null, this.comparator_, false, resultGenerator); - }; - SortedMap.prototype.getIteratorFrom = function (key, resultGenerator) { - return new SortedMapIterator(this.root_, key, this.comparator_, false, resultGenerator); - }; - SortedMap.prototype.getReverseIteratorFrom = function (key, resultGenerator) { - return new SortedMapIterator(this.root_, key, this.comparator_, true, resultGenerator); - }; - SortedMap.prototype.getReverseIterator = function (resultGenerator) { - return new SortedMapIterator(this.root_, null, this.comparator_, true, resultGenerator); - }; - /** - * Always use the same empty node, to reduce memory. - */ - SortedMap.EMPTY_NODE = new LLRBEmptyNode(); - return SortedMap; -}()); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -function NAME_ONLY_COMPARATOR(left, right) { - return nameCompare(left.name, right.name); -} -function NAME_COMPARATOR(left, right) { - return nameCompare(left, right); -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var MAX_NODE$2; -function setMaxNode$1(val) { - MAX_NODE$2 = val; -} -var priorityHashText = function (priority) { - if (typeof priority === 'number') { - return 'number:' + doubleToIEEE754String(priority); - } - else { - return 'string:' + priority; - } -}; -/** - * Validates that a priority snapshot Node is valid. - */ -var validatePriorityNode = function (priorityNode) { - if (priorityNode.isLeafNode()) { - var val = priorityNode.val(); - assert(typeof val === 'string' || - typeof val === 'number' || - (typeof val === 'object' && contains(val, '.sv')), 'Priority must be a string or number.'); - } - else { - assert(priorityNode === MAX_NODE$2 || priorityNode.isEmpty(), 'priority of unexpected type.'); - } - // Don't call getPriority() on MAX_NODE to avoid hitting assertion. - assert(priorityNode === MAX_NODE$2 || priorityNode.getPriority().isEmpty(), "Priority nodes can't have a priority of their own."); -}; - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var __childrenNodeConstructor; -/** - * LeafNode is a class for storing leaf nodes in a DataSnapshot. It - * implements Node and stores the value of the node (a string, - * number, or boolean) accessible via getValue(). - */ -var LeafNode = /** @class */ (function () { - /** - * @param value_ - The value to store in this leaf node. The object type is - * possible in the event of a deferred value - * @param priorityNode_ - The priority of this node. - */ - function LeafNode(value_, priorityNode_) { - if (priorityNode_ === void 0) { priorityNode_ = LeafNode.__childrenNodeConstructor.EMPTY_NODE; } - this.value_ = value_; - this.priorityNode_ = priorityNode_; - this.lazyHash_ = null; - assert(this.value_ !== undefined && this.value_ !== null, "LeafNode shouldn't be created with null/undefined value."); - validatePriorityNode(this.priorityNode_); - } - Object.defineProperty(LeafNode, "__childrenNodeConstructor", { - get: function () { - return __childrenNodeConstructor; - }, - set: function (val) { - __childrenNodeConstructor = val; - }, - enumerable: false, - configurable: true - }); - /** @inheritDoc */ - LeafNode.prototype.isLeafNode = function () { - return true; - }; - /** @inheritDoc */ - LeafNode.prototype.getPriority = function () { - return this.priorityNode_; - }; - /** @inheritDoc */ - LeafNode.prototype.updatePriority = function (newPriorityNode) { - return new LeafNode(this.value_, newPriorityNode); - }; - /** @inheritDoc */ - LeafNode.prototype.getImmediateChild = function (childName) { - // Hack to treat priority as a regular child - if (childName === '.priority') { - return this.priorityNode_; - } - else { - return LeafNode.__childrenNodeConstructor.EMPTY_NODE; - } - }; - /** @inheritDoc */ - LeafNode.prototype.getChild = function (path) { - if (pathIsEmpty(path)) { - return this; - } - else if (pathGetFront(path) === '.priority') { - return this.priorityNode_; - } - else { - return LeafNode.__childrenNodeConstructor.EMPTY_NODE; - } - }; - LeafNode.prototype.hasChild = function () { - return false; - }; - /** @inheritDoc */ - LeafNode.prototype.getPredecessorChildName = function (childName, childNode) { - return null; - }; - /** @inheritDoc */ - LeafNode.prototype.updateImmediateChild = function (childName, newChildNode) { - if (childName === '.priority') { - return this.updatePriority(newChildNode); - } - else if (newChildNode.isEmpty() && childName !== '.priority') { - return this; - } - else { - return LeafNode.__childrenNodeConstructor.EMPTY_NODE.updateImmediateChild(childName, newChildNode).updatePriority(this.priorityNode_); - } - }; - /** @inheritDoc */ - LeafNode.prototype.updateChild = function (path, newChildNode) { - var front = pathGetFront(path); - if (front === null) { - return newChildNode; - } - else if (newChildNode.isEmpty() && front !== '.priority') { - return this; - } - else { - assert(front !== '.priority' || pathGetLength(path) === 1, '.priority must be the last token in a path'); - return this.updateImmediateChild(front, LeafNode.__childrenNodeConstructor.EMPTY_NODE.updateChild(pathPopFront(path), newChildNode)); - } - }; - /** @inheritDoc */ - LeafNode.prototype.isEmpty = function () { - return false; - }; - /** @inheritDoc */ - LeafNode.prototype.numChildren = function () { - return 0; - }; - /** @inheritDoc */ - LeafNode.prototype.forEachChild = function (index, action) { - return false; - }; - LeafNode.prototype.val = function (exportFormat) { - if (exportFormat && !this.getPriority().isEmpty()) { - return { - '.value': this.getValue(), - '.priority': this.getPriority().val() - }; - } - else { - return this.getValue(); - } - }; - /** @inheritDoc */ - LeafNode.prototype.hash = function () { - if (this.lazyHash_ === null) { - var toHash = ''; - if (!this.priorityNode_.isEmpty()) { - toHash += - 'priority:' + - priorityHashText(this.priorityNode_.val()) + - ':'; - } - var type = typeof this.value_; - toHash += type + ':'; - if (type === 'number') { - toHash += doubleToIEEE754String(this.value_); - } - else { - toHash += this.value_; - } - this.lazyHash_ = sha1(toHash); - } - return this.lazyHash_; - }; - /** - * Returns the value of the leaf node. - * @returns The value of the node. - */ - LeafNode.prototype.getValue = function () { - return this.value_; - }; - LeafNode.prototype.compareTo = function (other) { - if (other === LeafNode.__childrenNodeConstructor.EMPTY_NODE) { - return 1; - } - else if (other instanceof LeafNode.__childrenNodeConstructor) { - return -1; - } - else { - assert(other.isLeafNode(), 'Unknown node type'); - return this.compareToLeafNode_(other); - } - }; - /** - * Comparison specifically for two leaf nodes - */ - LeafNode.prototype.compareToLeafNode_ = function (otherLeaf) { - var otherLeafType = typeof otherLeaf.value_; - var thisLeafType = typeof this.value_; - var otherIndex = LeafNode.VALUE_TYPE_ORDER.indexOf(otherLeafType); - var thisIndex = LeafNode.VALUE_TYPE_ORDER.indexOf(thisLeafType); - assert(otherIndex >= 0, 'Unknown leaf type: ' + otherLeafType); - assert(thisIndex >= 0, 'Unknown leaf type: ' + thisLeafType); - if (otherIndex === thisIndex) { - // Same type, compare values - if (thisLeafType === 'object') { - // Deferred value nodes are all equal, but we should also never get to this point... - return 0; - } - else { - // Note that this works because true > false, all others are number or string comparisons - if (this.value_ < otherLeaf.value_) { - return -1; - } - else if (this.value_ === otherLeaf.value_) { - return 0; - } - else { - return 1; - } - } - } - else { - return thisIndex - otherIndex; - } - }; - LeafNode.prototype.withIndex = function () { - return this; - }; - LeafNode.prototype.isIndexed = function () { - return true; - }; - LeafNode.prototype.equals = function (other) { - if (other === this) { - return true; - } - else if (other.isLeafNode()) { - var otherLeaf = other; - return (this.value_ === otherLeaf.value_ && - this.priorityNode_.equals(otherLeaf.priorityNode_)); - } - else { - return false; - } - }; - /** - * The sort order for comparing leaf nodes of different types. If two leaf nodes have - * the same type, the comparison falls back to their value - */ - LeafNode.VALUE_TYPE_ORDER = ['object', 'boolean', 'number', 'string']; - return LeafNode; -}()); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var nodeFromJSON$1; -var MAX_NODE$1; -function setNodeFromJSON(val) { - nodeFromJSON$1 = val; -} -function setMaxNode(val) { - MAX_NODE$1 = val; -} -var PriorityIndex = /** @class */ (function (_super) { - __extends(PriorityIndex, _super); - function PriorityIndex() { - return _super !== null && _super.apply(this, arguments) || this; - } - PriorityIndex.prototype.compare = function (a, b) { - var aPriority = a.node.getPriority(); - var bPriority = b.node.getPriority(); - var indexCmp = aPriority.compareTo(bPriority); - if (indexCmp === 0) { - return nameCompare(a.name, b.name); - } - else { - return indexCmp; - } - }; - PriorityIndex.prototype.isDefinedOn = function (node) { - return !node.getPriority().isEmpty(); - }; - PriorityIndex.prototype.indexedValueChanged = function (oldNode, newNode) { - return !oldNode.getPriority().equals(newNode.getPriority()); - }; - PriorityIndex.prototype.minPost = function () { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - return NamedNode.MIN; - }; - PriorityIndex.prototype.maxPost = function () { - return new NamedNode(MAX_NAME, new LeafNode('[PRIORITY-POST]', MAX_NODE$1)); - }; - PriorityIndex.prototype.makePost = function (indexValue, name) { - var priorityNode = nodeFromJSON$1(indexValue); - return new NamedNode(name, new LeafNode('[PRIORITY-POST]', priorityNode)); - }; - /** - * @returns String representation for inclusion in a query spec - */ - PriorityIndex.prototype.toString = function () { - return '.priority'; - }; - return PriorityIndex; -}(Index)); -var PRIORITY_INDEX = new PriorityIndex(); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var LOG_2 = Math.log(2); -var Base12Num = /** @class */ (function () { - function Base12Num(length) { - var logBase2 = function (num) { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - return parseInt((Math.log(num) / LOG_2), 10); - }; - var bitMask = function (bits) { return parseInt(Array(bits + 1).join('1'), 2); }; - this.count = logBase2(length + 1); - this.current_ = this.count - 1; - var mask = bitMask(this.count); - this.bits_ = (length + 1) & mask; - } - Base12Num.prototype.nextBitIsOne = function () { - //noinspection JSBitwiseOperatorUsage - var result = !(this.bits_ & (0x1 << this.current_)); - this.current_--; - return result; - }; - return Base12Num; -}()); -/** - * Takes a list of child nodes and constructs a SortedSet using the given comparison - * function - * - * Uses the algorithm described in the paper linked here: - * http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.46.1458 - * - * @param childList - Unsorted list of children - * @param cmp - The comparison method to be used - * @param keyFn - An optional function to extract K from a node wrapper, if K's - * type is not NamedNode - * @param mapSortFn - An optional override for comparator used by the generated sorted map - */ -var buildChildSet = function (childList, cmp, keyFn, mapSortFn) { - childList.sort(cmp); - var buildBalancedTree = function (low, high) { - var length = high - low; - var namedNode; - var key; - if (length === 0) { - return null; - } - else if (length === 1) { - namedNode = childList[low]; - key = keyFn ? keyFn(namedNode) : namedNode; - return new LLRBNode(key, namedNode.node, LLRBNode.BLACK, null, null); - } - else { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - var middle = parseInt((length / 2), 10) + low; - var left = buildBalancedTree(low, middle); - var right = buildBalancedTree(middle + 1, high); - namedNode = childList[middle]; - key = keyFn ? keyFn(namedNode) : namedNode; - return new LLRBNode(key, namedNode.node, LLRBNode.BLACK, left, right); - } - }; - var buildFrom12Array = function (base12) { - var node = null; - var root = null; - var index = childList.length; - var buildPennant = function (chunkSize, color) { - var low = index - chunkSize; - var high = index; - index -= chunkSize; - var childTree = buildBalancedTree(low + 1, high); - var namedNode = childList[low]; - var key = keyFn ? keyFn(namedNode) : namedNode; - attachPennant(new LLRBNode(key, namedNode.node, color, null, childTree)); - }; - var attachPennant = function (pennant) { - if (node) { - node.left = pennant; - node = pennant; - } - else { - root = pennant; - node = pennant; - } - }; - for (var i = 0; i < base12.count; ++i) { - var isOne = base12.nextBitIsOne(); - // The number of nodes taken in each slice is 2^(arr.length - (i + 1)) - var chunkSize = Math.pow(2, base12.count - (i + 1)); - if (isOne) { - buildPennant(chunkSize, LLRBNode.BLACK); - } - else { - // current == 2 - buildPennant(chunkSize, LLRBNode.BLACK); - buildPennant(chunkSize, LLRBNode.RED); - } - } - return root; - }; - var base12 = new Base12Num(childList.length); - var root = buildFrom12Array(base12); - // eslint-disable-next-line @typescript-eslint/no-explicit-any - return new SortedMap(mapSortFn || cmp, root); -}; - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var _defaultIndexMap; -var fallbackObject = {}; -var IndexMap = /** @class */ (function () { - function IndexMap(indexes_, indexSet_) { - this.indexes_ = indexes_; - this.indexSet_ = indexSet_; - } - Object.defineProperty(IndexMap, "Default", { - /** - * The default IndexMap for nodes without a priority - */ - get: function () { - assert(fallbackObject && PRIORITY_INDEX, 'ChildrenNode.ts has not been loaded'); - _defaultIndexMap = - _defaultIndexMap || - new IndexMap({ '.priority': fallbackObject }, { '.priority': PRIORITY_INDEX }); - return _defaultIndexMap; - }, - enumerable: false, - configurable: true - }); - IndexMap.prototype.get = function (indexKey) { - var sortedMap = safeGet(this.indexes_, indexKey); - if (!sortedMap) { - throw new Error('No index defined for ' + indexKey); - } - if (sortedMap instanceof SortedMap) { - return sortedMap; - } - else { - // The index exists, but it falls back to just name comparison. Return null so that the calling code uses the - // regular child map - return null; - } - }; - IndexMap.prototype.hasIndex = function (indexDefinition) { - return contains(this.indexSet_, indexDefinition.toString()); - }; - IndexMap.prototype.addIndex = function (indexDefinition, existingChildren) { - assert(indexDefinition !== KEY_INDEX, "KeyIndex always exists and isn't meant to be added to the IndexMap."); - var childList = []; - var sawIndexedValue = false; - var iter = existingChildren.getIterator(NamedNode.Wrap); - var next = iter.getNext(); - while (next) { - sawIndexedValue = - sawIndexedValue || indexDefinition.isDefinedOn(next.node); - childList.push(next); - next = iter.getNext(); - } - var newIndex; - if (sawIndexedValue) { - newIndex = buildChildSet(childList, indexDefinition.getCompare()); - } - else { - newIndex = fallbackObject; - } - var indexName = indexDefinition.toString(); - var newIndexSet = __assign({}, this.indexSet_); - newIndexSet[indexName] = indexDefinition; - var newIndexes = __assign({}, this.indexes_); - newIndexes[indexName] = newIndex; - return new IndexMap(newIndexes, newIndexSet); - }; - /** - * Ensure that this node is properly tracked in any indexes that we're maintaining - */ - IndexMap.prototype.addToIndexes = function (namedNode, existingChildren) { - var _this = this; - var newIndexes = map(this.indexes_, function (indexedChildren, indexName) { - var index = safeGet(_this.indexSet_, indexName); - assert(index, 'Missing index implementation for ' + indexName); - if (indexedChildren === fallbackObject) { - // Check to see if we need to index everything - if (index.isDefinedOn(namedNode.node)) { - // We need to build this index - var childList = []; - var iter = existingChildren.getIterator(NamedNode.Wrap); - var next = iter.getNext(); - while (next) { - if (next.name !== namedNode.name) { - childList.push(next); - } - next = iter.getNext(); - } - childList.push(namedNode); - return buildChildSet(childList, index.getCompare()); - } - else { - // No change, this remains a fallback - return fallbackObject; - } - } - else { - var existingSnap = existingChildren.get(namedNode.name); - var newChildren = indexedChildren; - if (existingSnap) { - newChildren = newChildren.remove(new NamedNode(namedNode.name, existingSnap)); - } - return newChildren.insert(namedNode, namedNode.node); - } - }); - return new IndexMap(newIndexes, this.indexSet_); - }; - /** - * Create a new IndexMap instance with the given value removed - */ - IndexMap.prototype.removeFromIndexes = function (namedNode, existingChildren) { - var newIndexes = map(this.indexes_, function (indexedChildren) { - if (indexedChildren === fallbackObject) { - // This is the fallback. Just return it, nothing to do in this case - return indexedChildren; - } - else { - var existingSnap = existingChildren.get(namedNode.name); - if (existingSnap) { - return indexedChildren.remove(new NamedNode(namedNode.name, existingSnap)); - } - else { - // No record of this child - return indexedChildren; - } - } - }); - return new IndexMap(newIndexes, this.indexSet_); - }; - return IndexMap; -}()); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// TODO: For memory savings, don't store priorityNode_ if it's empty. -var EMPTY_NODE; -/** - * ChildrenNode is a class for storing internal nodes in a DataSnapshot - * (i.e. nodes with children). It implements Node and stores the - * list of children in the children property, sorted by child name. - */ -var ChildrenNode = /** @class */ (function () { - /** - * @param children_ - List of children of this node.. - * @param priorityNode_ - The priority of this node (as a snapshot node). - */ - function ChildrenNode(children_, priorityNode_, indexMap_) { - this.children_ = children_; - this.priorityNode_ = priorityNode_; - this.indexMap_ = indexMap_; - this.lazyHash_ = null; - /** - * Note: The only reason we allow null priority is for EMPTY_NODE, since we can't use - * EMPTY_NODE as the priority of EMPTY_NODE. We might want to consider making EMPTY_NODE its own - * class instead of an empty ChildrenNode. - */ - if (this.priorityNode_) { - validatePriorityNode(this.priorityNode_); - } - if (this.children_.isEmpty()) { - assert(!this.priorityNode_ || this.priorityNode_.isEmpty(), 'An empty node cannot have a priority'); - } - } - Object.defineProperty(ChildrenNode, "EMPTY_NODE", { - get: function () { - return (EMPTY_NODE || - (EMPTY_NODE = new ChildrenNode(new SortedMap(NAME_COMPARATOR), null, IndexMap.Default))); - }, - enumerable: false, - configurable: true - }); - /** @inheritDoc */ - ChildrenNode.prototype.isLeafNode = function () { - return false; - }; - /** @inheritDoc */ - ChildrenNode.prototype.getPriority = function () { - return this.priorityNode_ || EMPTY_NODE; - }; - /** @inheritDoc */ - ChildrenNode.prototype.updatePriority = function (newPriorityNode) { - if (this.children_.isEmpty()) { - // Don't allow priorities on empty nodes - return this; - } - else { - return new ChildrenNode(this.children_, newPriorityNode, this.indexMap_); - } - }; - /** @inheritDoc */ - ChildrenNode.prototype.getImmediateChild = function (childName) { - // Hack to treat priority as a regular child - if (childName === '.priority') { - return this.getPriority(); - } - else { - var child = this.children_.get(childName); - return child === null ? EMPTY_NODE : child; - } - }; - /** @inheritDoc */ - ChildrenNode.prototype.getChild = function (path) { - var front = pathGetFront(path); - if (front === null) { - return this; - } - return this.getImmediateChild(front).getChild(pathPopFront(path)); - }; - /** @inheritDoc */ - ChildrenNode.prototype.hasChild = function (childName) { - return this.children_.get(childName) !== null; - }; - /** @inheritDoc */ - ChildrenNode.prototype.updateImmediateChild = function (childName, newChildNode) { - assert(newChildNode, 'We should always be passing snapshot nodes'); - if (childName === '.priority') { - return this.updatePriority(newChildNode); - } - else { - var namedNode = new NamedNode(childName, newChildNode); - var newChildren = void 0, newIndexMap = void 0; - if (newChildNode.isEmpty()) { - newChildren = this.children_.remove(childName); - newIndexMap = this.indexMap_.removeFromIndexes(namedNode, this.children_); - } - else { - newChildren = this.children_.insert(childName, newChildNode); - newIndexMap = this.indexMap_.addToIndexes(namedNode, this.children_); - } - var newPriority = newChildren.isEmpty() - ? EMPTY_NODE - : this.priorityNode_; - return new ChildrenNode(newChildren, newPriority, newIndexMap); - } - }; - /** @inheritDoc */ - ChildrenNode.prototype.updateChild = function (path, newChildNode) { - var front = pathGetFront(path); - if (front === null) { - return newChildNode; - } - else { - assert(pathGetFront(path) !== '.priority' || pathGetLength(path) === 1, '.priority must be the last token in a path'); - var newImmediateChild = this.getImmediateChild(front).updateChild(pathPopFront(path), newChildNode); - return this.updateImmediateChild(front, newImmediateChild); - } - }; - /** @inheritDoc */ - ChildrenNode.prototype.isEmpty = function () { - return this.children_.isEmpty(); - }; - /** @inheritDoc */ - ChildrenNode.prototype.numChildren = function () { - return this.children_.count(); - }; - /** @inheritDoc */ - ChildrenNode.prototype.val = function (exportFormat) { - if (this.isEmpty()) { - return null; - } - var obj = {}; - var numKeys = 0, maxKey = 0, allIntegerKeys = true; - this.forEachChild(PRIORITY_INDEX, function (key, childNode) { - obj[key] = childNode.val(exportFormat); - numKeys++; - if (allIntegerKeys && ChildrenNode.INTEGER_REGEXP_.test(key)) { - maxKey = Math.max(maxKey, Number(key)); - } - else { - allIntegerKeys = false; - } - }); - if (!exportFormat && allIntegerKeys && maxKey < 2 * numKeys) { - // convert to array. - var array = []; - // eslint-disable-next-line guard-for-in - for (var key in obj) { - array[key] = obj[key]; - } - return array; - } - else { - if (exportFormat && !this.getPriority().isEmpty()) { - obj['.priority'] = this.getPriority().val(); - } - return obj; - } - }; - /** @inheritDoc */ - ChildrenNode.prototype.hash = function () { - if (this.lazyHash_ === null) { - var toHash_1 = ''; - if (!this.getPriority().isEmpty()) { - toHash_1 += - 'priority:' + - priorityHashText(this.getPriority().val()) + - ':'; - } - this.forEachChild(PRIORITY_INDEX, function (key, childNode) { - var childHash = childNode.hash(); - if (childHash !== '') { - toHash_1 += ':' + key + ':' + childHash; - } - }); - this.lazyHash_ = toHash_1 === '' ? '' : sha1(toHash_1); - } - return this.lazyHash_; - }; - /** @inheritDoc */ - ChildrenNode.prototype.getPredecessorChildName = function (childName, childNode, index) { - var idx = this.resolveIndex_(index); - if (idx) { - var predecessor = idx.getPredecessorKey(new NamedNode(childName, childNode)); - return predecessor ? predecessor.name : null; - } - else { - return this.children_.getPredecessorKey(childName); - } - }; - ChildrenNode.prototype.getFirstChildName = function (indexDefinition) { - var idx = this.resolveIndex_(indexDefinition); - if (idx) { - var minKey = idx.minKey(); - return minKey && minKey.name; - } - else { - return this.children_.minKey(); - } - }; - ChildrenNode.prototype.getFirstChild = function (indexDefinition) { - var minKey = this.getFirstChildName(indexDefinition); - if (minKey) { - return new NamedNode(minKey, this.children_.get(minKey)); - } - else { - return null; - } - }; - /** - * Given an index, return the key name of the largest value we have, according to that index - */ - ChildrenNode.prototype.getLastChildName = function (indexDefinition) { - var idx = this.resolveIndex_(indexDefinition); - if (idx) { - var maxKey = idx.maxKey(); - return maxKey && maxKey.name; - } - else { - return this.children_.maxKey(); - } - }; - ChildrenNode.prototype.getLastChild = function (indexDefinition) { - var maxKey = this.getLastChildName(indexDefinition); - if (maxKey) { - return new NamedNode(maxKey, this.children_.get(maxKey)); - } - else { - return null; - } - }; - ChildrenNode.prototype.forEachChild = function (index, action) { - var idx = this.resolveIndex_(index); - if (idx) { - return idx.inorderTraversal(function (wrappedNode) { - return action(wrappedNode.name, wrappedNode.node); - }); - } - else { - return this.children_.inorderTraversal(action); - } - }; - ChildrenNode.prototype.getIterator = function (indexDefinition) { - return this.getIteratorFrom(indexDefinition.minPost(), indexDefinition); - }; - ChildrenNode.prototype.getIteratorFrom = function (startPost, indexDefinition) { - var idx = this.resolveIndex_(indexDefinition); - if (idx) { - return idx.getIteratorFrom(startPost, function (key) { return key; }); - } - else { - var iterator = this.children_.getIteratorFrom(startPost.name, NamedNode.Wrap); - var next = iterator.peek(); - while (next != null && indexDefinition.compare(next, startPost) < 0) { - iterator.getNext(); - next = iterator.peek(); - } - return iterator; - } - }; - ChildrenNode.prototype.getReverseIterator = function (indexDefinition) { - return this.getReverseIteratorFrom(indexDefinition.maxPost(), indexDefinition); - }; - ChildrenNode.prototype.getReverseIteratorFrom = function (endPost, indexDefinition) { - var idx = this.resolveIndex_(indexDefinition); - if (idx) { - return idx.getReverseIteratorFrom(endPost, function (key) { - return key; - }); - } - else { - var iterator = this.children_.getReverseIteratorFrom(endPost.name, NamedNode.Wrap); - var next = iterator.peek(); - while (next != null && indexDefinition.compare(next, endPost) > 0) { - iterator.getNext(); - next = iterator.peek(); - } - return iterator; - } - }; - ChildrenNode.prototype.compareTo = function (other) { - if (this.isEmpty()) { - if (other.isEmpty()) { - return 0; - } - else { - return -1; - } - } - else if (other.isLeafNode() || other.isEmpty()) { - return 1; - } - else if (other === MAX_NODE) { - return -1; - } - else { - // Must be another node with children. - return 0; - } - }; - ChildrenNode.prototype.withIndex = function (indexDefinition) { - if (indexDefinition === KEY_INDEX || - this.indexMap_.hasIndex(indexDefinition)) { - return this; - } - else { - var newIndexMap = this.indexMap_.addIndex(indexDefinition, this.children_); - return new ChildrenNode(this.children_, this.priorityNode_, newIndexMap); - } - }; - ChildrenNode.prototype.isIndexed = function (index) { - return index === KEY_INDEX || this.indexMap_.hasIndex(index); - }; - ChildrenNode.prototype.equals = function (other) { - if (other === this) { - return true; - } - else if (other.isLeafNode()) { - return false; - } - else { - var otherChildrenNode = other; - if (!this.getPriority().equals(otherChildrenNode.getPriority())) { - return false; - } - else if (this.children_.count() === otherChildrenNode.children_.count()) { - var thisIter = this.getIterator(PRIORITY_INDEX); - var otherIter = otherChildrenNode.getIterator(PRIORITY_INDEX); - var thisCurrent = thisIter.getNext(); - var otherCurrent = otherIter.getNext(); - while (thisCurrent && otherCurrent) { - if (thisCurrent.name !== otherCurrent.name || - !thisCurrent.node.equals(otherCurrent.node)) { - return false; - } - thisCurrent = thisIter.getNext(); - otherCurrent = otherIter.getNext(); - } - return thisCurrent === null && otherCurrent === null; - } - else { - return false; - } - } - }; - /** - * Returns a SortedMap ordered by index, or null if the default (by-key) ordering can be used - * instead. - * - */ - ChildrenNode.prototype.resolveIndex_ = function (indexDefinition) { - if (indexDefinition === KEY_INDEX) { - return null; - } - else { - return this.indexMap_.get(indexDefinition.toString()); - } - }; - ChildrenNode.INTEGER_REGEXP_ = /^(0|[1-9]\d*)$/; - return ChildrenNode; -}()); -var MaxNode = /** @class */ (function (_super) { - __extends(MaxNode, _super); - function MaxNode() { - return _super.call(this, new SortedMap(NAME_COMPARATOR), ChildrenNode.EMPTY_NODE, IndexMap.Default) || this; - } - MaxNode.prototype.compareTo = function (other) { - if (other === this) { - return 0; - } - else { - return 1; - } - }; - MaxNode.prototype.equals = function (other) { - // Not that we every compare it, but MAX_NODE is only ever equal to itself - return other === this; - }; - MaxNode.prototype.getPriority = function () { - return this; - }; - MaxNode.prototype.getImmediateChild = function (childName) { - return ChildrenNode.EMPTY_NODE; - }; - MaxNode.prototype.isEmpty = function () { - return false; - }; - return MaxNode; -}(ChildrenNode)); -/** - * Marker that will sort higher than any other snapshot. - */ -var MAX_NODE = new MaxNode(); -Object.defineProperties(NamedNode, { - MIN: { - value: new NamedNode(MIN_NAME, ChildrenNode.EMPTY_NODE) - }, - MAX: { - value: new NamedNode(MAX_NAME, MAX_NODE) - } -}); -/** - * Reference Extensions - */ -KeyIndex.__EMPTY_NODE = ChildrenNode.EMPTY_NODE; -LeafNode.__childrenNodeConstructor = ChildrenNode; -setMaxNode$1(MAX_NODE); -setMaxNode(MAX_NODE); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var USE_HINZE = true; -/** - * Constructs a snapshot node representing the passed JSON and returns it. - * @param json - JSON to create a node for. - * @param priority - Optional priority to use. This will be ignored if the - * passed JSON contains a .priority property. - */ -function nodeFromJSON(json, priority) { - if (priority === void 0) { priority = null; } - if (json === null) { - return ChildrenNode.EMPTY_NODE; - } - if (typeof json === 'object' && '.priority' in json) { - priority = json['.priority']; - } - assert(priority === null || - typeof priority === 'string' || - typeof priority === 'number' || - (typeof priority === 'object' && '.sv' in priority), 'Invalid priority type found: ' + typeof priority); - if (typeof json === 'object' && '.value' in json && json['.value'] !== null) { - json = json['.value']; - } - // Valid leaf nodes include non-objects or server-value wrapper objects - if (typeof json !== 'object' || '.sv' in json) { - var jsonLeaf = json; - return new LeafNode(jsonLeaf, nodeFromJSON(priority)); - } - if (!(json instanceof Array) && USE_HINZE) { - var children_1 = []; - var childrenHavePriority_1 = false; - var hinzeJsonObj = json; - each(hinzeJsonObj, function (key, child) { - if (key.substring(0, 1) !== '.') { - // Ignore metadata nodes - var childNode = nodeFromJSON(child); - if (!childNode.isEmpty()) { - childrenHavePriority_1 = - childrenHavePriority_1 || !childNode.getPriority().isEmpty(); - children_1.push(new NamedNode(key, childNode)); - } - } - }); - if (children_1.length === 0) { - return ChildrenNode.EMPTY_NODE; - } - var childSet = buildChildSet(children_1, NAME_ONLY_COMPARATOR, function (namedNode) { return namedNode.name; }, NAME_COMPARATOR); - if (childrenHavePriority_1) { - var sortedChildSet = buildChildSet(children_1, PRIORITY_INDEX.getCompare()); - return new ChildrenNode(childSet, nodeFromJSON(priority), new IndexMap({ '.priority': sortedChildSet }, { '.priority': PRIORITY_INDEX })); - } - else { - return new ChildrenNode(childSet, nodeFromJSON(priority), IndexMap.Default); - } - } - else { - var node_1 = ChildrenNode.EMPTY_NODE; - each(json, function (key, childData) { - if (contains(json, key)) { - if (key.substring(0, 1) !== '.') { - // ignore metadata nodes. - var childNode = nodeFromJSON(childData); - if (childNode.isLeafNode() || !childNode.isEmpty()) { - node_1 = node_1.updateImmediateChild(key, childNode); - } - } - } - }); - return node_1.updatePriority(nodeFromJSON(priority)); - } -} -setNodeFromJSON(nodeFromJSON); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var PathIndex = /** @class */ (function (_super) { - __extends(PathIndex, _super); - function PathIndex(indexPath_) { - var _this = _super.call(this) || this; - _this.indexPath_ = indexPath_; - assert(!pathIsEmpty(indexPath_) && pathGetFront(indexPath_) !== '.priority', "Can't create PathIndex with empty path or .priority key"); - return _this; - } - PathIndex.prototype.extractChild = function (snap) { - return snap.getChild(this.indexPath_); - }; - PathIndex.prototype.isDefinedOn = function (node) { - return !node.getChild(this.indexPath_).isEmpty(); - }; - PathIndex.prototype.compare = function (a, b) { - var aChild = this.extractChild(a.node); - var bChild = this.extractChild(b.node); - var indexCmp = aChild.compareTo(bChild); - if (indexCmp === 0) { - return nameCompare(a.name, b.name); - } - else { - return indexCmp; - } - }; - PathIndex.prototype.makePost = function (indexValue, name) { - var valueNode = nodeFromJSON(indexValue); - var node = ChildrenNode.EMPTY_NODE.updateChild(this.indexPath_, valueNode); - return new NamedNode(name, node); - }; - PathIndex.prototype.maxPost = function () { - var node = ChildrenNode.EMPTY_NODE.updateChild(this.indexPath_, MAX_NODE); - return new NamedNode(MAX_NAME, node); - }; - PathIndex.prototype.toString = function () { - return pathSlice(this.indexPath_, 0).join('/'); - }; - return PathIndex; -}(Index)); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var ValueIndex = /** @class */ (function (_super) { - __extends(ValueIndex, _super); - function ValueIndex() { - return _super !== null && _super.apply(this, arguments) || this; - } - ValueIndex.prototype.compare = function (a, b) { - var indexCmp = a.node.compareTo(b.node); - if (indexCmp === 0) { - return nameCompare(a.name, b.name); - } - else { - return indexCmp; - } - }; - ValueIndex.prototype.isDefinedOn = function (node) { - return true; - }; - ValueIndex.prototype.indexedValueChanged = function (oldNode, newNode) { - return !oldNode.equals(newNode); - }; - ValueIndex.prototype.minPost = function () { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - return NamedNode.MIN; - }; - ValueIndex.prototype.maxPost = function () { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - return NamedNode.MAX; - }; - ValueIndex.prototype.makePost = function (indexValue, name) { - var valueNode = nodeFromJSON(indexValue); - return new NamedNode(name, valueNode); - }; - /** - * @returns String representation for inclusion in a query spec - */ - ValueIndex.prototype.toString = function () { - return '.value'; - }; - return ValueIndex; -}(Index)); -var VALUE_INDEX = new ValueIndex(); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Modeled after base64 web-safe chars, but ordered by ASCII. -var PUSH_CHARS = '-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz'; -var MIN_PUSH_CHAR = '-'; -var MAX_PUSH_CHAR = 'z'; -var MAX_KEY_LEN = 786; -/** - * Fancy ID generator that creates 20-character string identifiers with the - * following properties: - * - * 1. They're based on timestamp so that they sort *after* any existing ids. - * 2. They contain 72-bits of random data after the timestamp so that IDs won't - * collide with other clients' IDs. - * 3. They sort *lexicographically* (so the timestamp is converted to characters - * that will sort properly). - * 4. They're monotonically increasing. Even if you generate more than one in - * the same timestamp, the latter ones will sort after the former ones. We do - * this by using the previous random bits but "incrementing" them by 1 (only - * in the case of a timestamp collision). - */ -var nextPushId = (function () { - // Timestamp of last push, used to prevent local collisions if you push twice - // in one ms. - var lastPushTime = 0; - // We generate 72-bits of randomness which get turned into 12 characters and - // appended to the timestamp to prevent collisions with other clients. We - // store the last characters we generated because in the event of a collision, - // we'll use those same characters except "incremented" by one. - var lastRandChars = []; - return function (now) { - var duplicateTime = now === lastPushTime; - lastPushTime = now; - var i; - var timeStampChars = new Array(8); - for (i = 7; i >= 0; i--) { - timeStampChars[i] = PUSH_CHARS.charAt(now % 64); - // NOTE: Can't use << here because javascript will convert to int and lose - // the upper bits. - now = Math.floor(now / 64); - } - assert(now === 0, 'Cannot push at time == 0'); - var id = timeStampChars.join(''); - if (!duplicateTime) { - for (i = 0; i < 12; i++) { - lastRandChars[i] = Math.floor(Math.random() * 64); - } - } - else { - // If the timestamp hasn't changed since last push, use the same random - // number, except incremented by 1. - for (i = 11; i >= 0 && lastRandChars[i] === 63; i--) { - lastRandChars[i] = 0; - } - lastRandChars[i]++; - } - for (i = 0; i < 12; i++) { - id += PUSH_CHARS.charAt(lastRandChars[i]); - } - assert(id.length === 20, 'nextPushId: Length should be 20.'); - return id; - }; -})(); -var successor = function (key) { - if (key === '' + INTEGER_32_MAX) { - // See https://firebase.google.com/docs/database/web/lists-of-data#data-order - return MIN_PUSH_CHAR; - } - var keyAsInt = tryParseInt(key); - if (keyAsInt != null) { - return '' + (keyAsInt + 1); - } - var next = new Array(key.length); - for (var i_1 = 0; i_1 < next.length; i_1++) { - next[i_1] = key.charAt(i_1); - } - if (next.length < MAX_KEY_LEN) { - next.push(MIN_PUSH_CHAR); - return next.join(''); - } - var i = next.length - 1; - while (i >= 0 && next[i] === MAX_PUSH_CHAR) { - i--; - } - // `successor` was called on the largest possible key, so return the - // MAX_NAME, which sorts larger than all keys. - if (i === -1) { - return MAX_NAME; - } - var source = next[i]; - var sourcePlusOne = PUSH_CHARS.charAt(PUSH_CHARS.indexOf(source) + 1); - next[i] = sourcePlusOne; - return next.slice(0, i + 1).join(''); -}; -// `key` is assumed to be non-empty. -var predecessor = function (key) { - if (key === '' + INTEGER_32_MIN) { - return MIN_NAME; - } - var keyAsInt = tryParseInt(key); - if (keyAsInt != null) { - return '' + (keyAsInt - 1); - } - var next = new Array(key.length); - for (var i = 0; i < next.length; i++) { - next[i] = key.charAt(i); - } - // If `key` ends in `MIN_PUSH_CHAR`, the largest key lexicographically - // smaller than `key`, is `key[0:key.length - 1]`. The next key smaller - // than that, `predecessor(predecessor(key))`, is - // - // `key[0:key.length - 2] + (key[key.length - 1] - 1) + \ - // { MAX_PUSH_CHAR repeated MAX_KEY_LEN - (key.length - 1) times } - // - // analogous to increment/decrement for base-10 integers. - // - // This works because lexigographic comparison works character-by-character, - // using length as a tie-breaker if one key is a prefix of the other. - if (next[next.length - 1] === MIN_PUSH_CHAR) { - if (next.length === 1) { - // See https://firebase.google.com/docs/database/web/lists-of-data#orderbykey - return '' + INTEGER_32_MAX; - } - delete next[next.length - 1]; - return next.join(''); - } - // Replace the last character with it's immediate predecessor, and - // fill the suffix of the key with MAX_PUSH_CHAR. This is the - // lexicographically largest possible key smaller than `key`. - next[next.length - 1] = PUSH_CHARS.charAt(PUSH_CHARS.indexOf(next[next.length - 1]) - 1); - return next.join('') + MAX_PUSH_CHAR.repeat(MAX_KEY_LEN - next.length); -}; - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -function changeValue(snapshotNode) { - return { type: "value" /* VALUE */, snapshotNode: snapshotNode }; -} -function changeChildAdded(childName, snapshotNode) { - return { type: "child_added" /* CHILD_ADDED */, snapshotNode: snapshotNode, childName: childName }; -} -function changeChildRemoved(childName, snapshotNode) { - return { type: "child_removed" /* CHILD_REMOVED */, snapshotNode: snapshotNode, childName: childName }; -} -function changeChildChanged(childName, snapshotNode, oldSnap) { - return { - type: "child_changed" /* CHILD_CHANGED */, - snapshotNode: snapshotNode, - childName: childName, - oldSnap: oldSnap - }; -} -function changeChildMoved(childName, snapshotNode) { - return { type: "child_moved" /* CHILD_MOVED */, snapshotNode: snapshotNode, childName: childName }; -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Doesn't really filter nodes but applies an index to the node and keeps track of any changes - */ -var IndexedFilter = /** @class */ (function () { - function IndexedFilter(index_) { - this.index_ = index_; - } - IndexedFilter.prototype.updateChild = function (snap, key, newChild, affectedPath, source, optChangeAccumulator) { - assert(snap.isIndexed(this.index_), 'A node must be indexed if only a child is updated'); - var oldChild = snap.getImmediateChild(key); - // Check if anything actually changed. - if (oldChild.getChild(affectedPath).equals(newChild.getChild(affectedPath))) { - // There's an edge case where a child can enter or leave the view because affectedPath was set to null. - // In this case, affectedPath will appear null in both the old and new snapshots. So we need - // to avoid treating these cases as "nothing changed." - if (oldChild.isEmpty() === newChild.isEmpty()) { - // Nothing changed. - // This assert should be valid, but it's expensive (can dominate perf testing) so don't actually do it. - //assert(oldChild.equals(newChild), 'Old and new snapshots should be equal.'); - return snap; - } - } - if (optChangeAccumulator != null) { - if (newChild.isEmpty()) { - if (snap.hasChild(key)) { - optChangeAccumulator.trackChildChange(changeChildRemoved(key, oldChild)); - } - else { - assert(snap.isLeafNode(), 'A child remove without an old child only makes sense on a leaf node'); - } - } - else if (oldChild.isEmpty()) { - optChangeAccumulator.trackChildChange(changeChildAdded(key, newChild)); - } - else { - optChangeAccumulator.trackChildChange(changeChildChanged(key, newChild, oldChild)); - } - } - if (snap.isLeafNode() && newChild.isEmpty()) { - return snap; - } - else { - // Make sure the node is indexed - return snap.updateImmediateChild(key, newChild).withIndex(this.index_); - } - }; - IndexedFilter.prototype.updateFullNode = function (oldSnap, newSnap, optChangeAccumulator) { - if (optChangeAccumulator != null) { - if (!oldSnap.isLeafNode()) { - oldSnap.forEachChild(PRIORITY_INDEX, function (key, childNode) { - if (!newSnap.hasChild(key)) { - optChangeAccumulator.trackChildChange(changeChildRemoved(key, childNode)); - } - }); - } - if (!newSnap.isLeafNode()) { - newSnap.forEachChild(PRIORITY_INDEX, function (key, childNode) { - if (oldSnap.hasChild(key)) { - var oldChild = oldSnap.getImmediateChild(key); - if (!oldChild.equals(childNode)) { - optChangeAccumulator.trackChildChange(changeChildChanged(key, childNode, oldChild)); - } - } - else { - optChangeAccumulator.trackChildChange(changeChildAdded(key, childNode)); - } - }); - } - } - return newSnap.withIndex(this.index_); - }; - IndexedFilter.prototype.updatePriority = function (oldSnap, newPriority) { - if (oldSnap.isEmpty()) { - return ChildrenNode.EMPTY_NODE; - } - else { - return oldSnap.updatePriority(newPriority); - } - }; - IndexedFilter.prototype.filtersNodes = function () { - return false; - }; - IndexedFilter.prototype.getIndexedFilter = function () { - return this; - }; - IndexedFilter.prototype.getIndex = function () { - return this.index_; - }; - return IndexedFilter; -}()); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Filters nodes by range and uses an IndexFilter to track any changes after filtering the node - */ -var RangedFilter = /** @class */ (function () { - function RangedFilter(params) { - this.indexedFilter_ = new IndexedFilter(params.getIndex()); - this.index_ = params.getIndex(); - this.startPost_ = RangedFilter.getStartPost_(params); - this.endPost_ = RangedFilter.getEndPost_(params); - } - RangedFilter.prototype.getStartPost = function () { - return this.startPost_; - }; - RangedFilter.prototype.getEndPost = function () { - return this.endPost_; - }; - RangedFilter.prototype.matches = function (node) { - return (this.index_.compare(this.getStartPost(), node) <= 0 && - this.index_.compare(node, this.getEndPost()) <= 0); - }; - RangedFilter.prototype.updateChild = function (snap, key, newChild, affectedPath, source, optChangeAccumulator) { - if (!this.matches(new NamedNode(key, newChild))) { - newChild = ChildrenNode.EMPTY_NODE; - } - return this.indexedFilter_.updateChild(snap, key, newChild, affectedPath, source, optChangeAccumulator); - }; - RangedFilter.prototype.updateFullNode = function (oldSnap, newSnap, optChangeAccumulator) { - if (newSnap.isLeafNode()) { - // Make sure we have a children node with the correct index, not a leaf node; - newSnap = ChildrenNode.EMPTY_NODE; - } - var filtered = newSnap.withIndex(this.index_); - // Don't support priorities on queries - filtered = filtered.updatePriority(ChildrenNode.EMPTY_NODE); - var self = this; - newSnap.forEachChild(PRIORITY_INDEX, function (key, childNode) { - if (!self.matches(new NamedNode(key, childNode))) { - filtered = filtered.updateImmediateChild(key, ChildrenNode.EMPTY_NODE); - } - }); - return this.indexedFilter_.updateFullNode(oldSnap, filtered, optChangeAccumulator); - }; - RangedFilter.prototype.updatePriority = function (oldSnap, newPriority) { - // Don't support priorities on queries - return oldSnap; - }; - RangedFilter.prototype.filtersNodes = function () { - return true; - }; - RangedFilter.prototype.getIndexedFilter = function () { - return this.indexedFilter_; - }; - RangedFilter.prototype.getIndex = function () { - return this.index_; - }; - RangedFilter.getStartPost_ = function (params) { - if (params.hasStart()) { - var startName = params.getIndexStartName(); - return params.getIndex().makePost(params.getIndexStartValue(), startName); - } - else { - return params.getIndex().minPost(); - } - }; - RangedFilter.getEndPost_ = function (params) { - if (params.hasEnd()) { - var endName = params.getIndexEndName(); - return params.getIndex().makePost(params.getIndexEndValue(), endName); - } - else { - return params.getIndex().maxPost(); - } - }; - return RangedFilter; -}()); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Applies a limit and a range to a node and uses RangedFilter to do the heavy lifting where possible - */ -var LimitedFilter = /** @class */ (function () { - function LimitedFilter(params) { - this.rangedFilter_ = new RangedFilter(params); - this.index_ = params.getIndex(); - this.limit_ = params.getLimit(); - this.reverse_ = !params.isViewFromLeft(); - } - LimitedFilter.prototype.updateChild = function (snap, key, newChild, affectedPath, source, optChangeAccumulator) { - if (!this.rangedFilter_.matches(new NamedNode(key, newChild))) { - newChild = ChildrenNode.EMPTY_NODE; - } - if (snap.getImmediateChild(key).equals(newChild)) { - // No change - return snap; - } - else if (snap.numChildren() < this.limit_) { - return this.rangedFilter_ - .getIndexedFilter() - .updateChild(snap, key, newChild, affectedPath, source, optChangeAccumulator); - } - else { - return this.fullLimitUpdateChild_(snap, key, newChild, source, optChangeAccumulator); - } - }; - LimitedFilter.prototype.updateFullNode = function (oldSnap, newSnap, optChangeAccumulator) { - var filtered; - if (newSnap.isLeafNode() || newSnap.isEmpty()) { - // Make sure we have a children node with the correct index, not a leaf node; - filtered = ChildrenNode.EMPTY_NODE.withIndex(this.index_); - } - else { - if (this.limit_ * 2 < newSnap.numChildren() && - newSnap.isIndexed(this.index_)) { - // Easier to build up a snapshot, since what we're given has more than twice the elements we want - filtered = ChildrenNode.EMPTY_NODE.withIndex(this.index_); - // anchor to the startPost, endPost, or last element as appropriate - var iterator = void 0; - if (this.reverse_) { - iterator = newSnap.getReverseIteratorFrom(this.rangedFilter_.getEndPost(), this.index_); - } - else { - iterator = newSnap.getIteratorFrom(this.rangedFilter_.getStartPost(), this.index_); - } - var count = 0; - while (iterator.hasNext() && count < this.limit_) { - var next = iterator.getNext(); - var inRange = void 0; - if (this.reverse_) { - inRange = - this.index_.compare(this.rangedFilter_.getStartPost(), next) <= 0; - } - else { - inRange = - this.index_.compare(next, this.rangedFilter_.getEndPost()) <= 0; - } - if (inRange) { - filtered = filtered.updateImmediateChild(next.name, next.node); - count++; - } - else { - // if we have reached the end post, we cannot keep adding elemments - break; - } - } - } - else { - // The snap contains less than twice the limit. Faster to delete from the snap than build up a new one - filtered = newSnap.withIndex(this.index_); - // Don't support priorities on queries - filtered = filtered.updatePriority(ChildrenNode.EMPTY_NODE); - var startPost = void 0; - var endPost = void 0; - var cmp = void 0; - var iterator = void 0; - if (this.reverse_) { - iterator = filtered.getReverseIterator(this.index_); - startPost = this.rangedFilter_.getEndPost(); - endPost = this.rangedFilter_.getStartPost(); - var indexCompare_1 = this.index_.getCompare(); - cmp = function (a, b) { return indexCompare_1(b, a); }; - } - else { - iterator = filtered.getIterator(this.index_); - startPost = this.rangedFilter_.getStartPost(); - endPost = this.rangedFilter_.getEndPost(); - cmp = this.index_.getCompare(); - } - var count = 0; - var foundStartPost = false; - while (iterator.hasNext()) { - var next = iterator.getNext(); - if (!foundStartPost && cmp(startPost, next) <= 0) { - // start adding - foundStartPost = true; - } - var inRange = foundStartPost && count < this.limit_ && cmp(next, endPost) <= 0; - if (inRange) { - count++; - } - else { - filtered = filtered.updateImmediateChild(next.name, ChildrenNode.EMPTY_NODE); - } - } - } - } - return this.rangedFilter_ - .getIndexedFilter() - .updateFullNode(oldSnap, filtered, optChangeAccumulator); - }; - LimitedFilter.prototype.updatePriority = function (oldSnap, newPriority) { - // Don't support priorities on queries - return oldSnap; - }; - LimitedFilter.prototype.filtersNodes = function () { - return true; - }; - LimitedFilter.prototype.getIndexedFilter = function () { - return this.rangedFilter_.getIndexedFilter(); - }; - LimitedFilter.prototype.getIndex = function () { - return this.index_; - }; - LimitedFilter.prototype.fullLimitUpdateChild_ = function (snap, childKey, childSnap, source, changeAccumulator) { - // TODO: rename all cache stuff etc to general snap terminology - var cmp; - if (this.reverse_) { - var indexCmp_1 = this.index_.getCompare(); - cmp = function (a, b) { return indexCmp_1(b, a); }; - } - else { - cmp = this.index_.getCompare(); - } - var oldEventCache = snap; - assert(oldEventCache.numChildren() === this.limit_, ''); - var newChildNamedNode = new NamedNode(childKey, childSnap); - var windowBoundary = this.reverse_ - ? oldEventCache.getFirstChild(this.index_) - : oldEventCache.getLastChild(this.index_); - var inRange = this.rangedFilter_.matches(newChildNamedNode); - if (oldEventCache.hasChild(childKey)) { - var oldChildSnap = oldEventCache.getImmediateChild(childKey); - var nextChild = source.getChildAfterChild(this.index_, windowBoundary, this.reverse_); - while (nextChild != null && - (nextChild.name === childKey || oldEventCache.hasChild(nextChild.name))) { - // There is a weird edge case where a node is updated as part of a merge in the write tree, but hasn't - // been applied to the limited filter yet. Ignore this next child which will be updated later in - // the limited filter... - nextChild = source.getChildAfterChild(this.index_, nextChild, this.reverse_); - } - var compareNext = nextChild == null ? 1 : cmp(nextChild, newChildNamedNode); - var remainsInWindow = inRange && !childSnap.isEmpty() && compareNext >= 0; - if (remainsInWindow) { - if (changeAccumulator != null) { - changeAccumulator.trackChildChange(changeChildChanged(childKey, childSnap, oldChildSnap)); - } - return oldEventCache.updateImmediateChild(childKey, childSnap); - } - else { - if (changeAccumulator != null) { - changeAccumulator.trackChildChange(changeChildRemoved(childKey, oldChildSnap)); - } - var newEventCache = oldEventCache.updateImmediateChild(childKey, ChildrenNode.EMPTY_NODE); - var nextChildInRange = nextChild != null && this.rangedFilter_.matches(nextChild); - if (nextChildInRange) { - if (changeAccumulator != null) { - changeAccumulator.trackChildChange(changeChildAdded(nextChild.name, nextChild.node)); - } - return newEventCache.updateImmediateChild(nextChild.name, nextChild.node); - } - else { - return newEventCache; - } - } - } - else if (childSnap.isEmpty()) { - // we're deleting a node, but it was not in the window, so ignore it - return snap; - } - else if (inRange) { - if (cmp(windowBoundary, newChildNamedNode) >= 0) { - if (changeAccumulator != null) { - changeAccumulator.trackChildChange(changeChildRemoved(windowBoundary.name, windowBoundary.node)); - changeAccumulator.trackChildChange(changeChildAdded(childKey, childSnap)); - } - return oldEventCache - .updateImmediateChild(childKey, childSnap) - .updateImmediateChild(windowBoundary.name, ChildrenNode.EMPTY_NODE); - } - else { - return snap; - } - } - else { - return snap; - } - }; - return LimitedFilter; -}()); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * This class is an immutable-from-the-public-api struct containing a set of query parameters defining a - * range to be returned for a particular location. It is assumed that validation of parameters is done at the - * user-facing API level, so it is not done here. - * - * @internal - */ -var QueryParams = /** @class */ (function () { - function QueryParams() { - this.limitSet_ = false; - this.startSet_ = false; - this.startNameSet_ = false; - this.startAfterSet_ = false; - this.endSet_ = false; - this.endNameSet_ = false; - this.endBeforeSet_ = false; - this.limit_ = 0; - this.viewFrom_ = ''; - this.indexStartValue_ = null; - this.indexStartName_ = ''; - this.indexEndValue_ = null; - this.indexEndName_ = ''; - this.index_ = PRIORITY_INDEX; - } - QueryParams.prototype.hasStart = function () { - return this.startSet_; - }; - QueryParams.prototype.hasStartAfter = function () { - return this.startAfterSet_; - }; - QueryParams.prototype.hasEndBefore = function () { - return this.endBeforeSet_; - }; - /** - * @returns True if it would return from left. - */ - QueryParams.prototype.isViewFromLeft = function () { - if (this.viewFrom_ === '') { - // limit(), rather than limitToFirst or limitToLast was called. - // This means that only one of startSet_ and endSet_ is true. Use them - // to calculate which side of the view to anchor to. If neither is set, - // anchor to the end. - return this.startSet_; - } - else { - return this.viewFrom_ === "l" /* VIEW_FROM_LEFT */; - } - }; - /** - * Only valid to call if hasStart() returns true - */ - QueryParams.prototype.getIndexStartValue = function () { - assert(this.startSet_, 'Only valid if start has been set'); - return this.indexStartValue_; - }; - /** - * Only valid to call if hasStart() returns true. - * Returns the starting key name for the range defined by these query parameters - */ - QueryParams.prototype.getIndexStartName = function () { - assert(this.startSet_, 'Only valid if start has been set'); - if (this.startNameSet_) { - return this.indexStartName_; - } - else { - return MIN_NAME; - } - }; - QueryParams.prototype.hasEnd = function () { - return this.endSet_; - }; - /** - * Only valid to call if hasEnd() returns true. - */ - QueryParams.prototype.getIndexEndValue = function () { - assert(this.endSet_, 'Only valid if end has been set'); - return this.indexEndValue_; - }; - /** - * Only valid to call if hasEnd() returns true. - * Returns the end key name for the range defined by these query parameters - */ - QueryParams.prototype.getIndexEndName = function () { - assert(this.endSet_, 'Only valid if end has been set'); - if (this.endNameSet_) { - return this.indexEndName_; - } - else { - return MAX_NAME; - } - }; - QueryParams.prototype.hasLimit = function () { - return this.limitSet_; - }; - /** - * @returns True if a limit has been set and it has been explicitly anchored - */ - QueryParams.prototype.hasAnchoredLimit = function () { - return this.limitSet_ && this.viewFrom_ !== ''; - }; - /** - * Only valid to call if hasLimit() returns true - */ - QueryParams.prototype.getLimit = function () { - assert(this.limitSet_, 'Only valid if limit has been set'); - return this.limit_; - }; - QueryParams.prototype.getIndex = function () { - return this.index_; - }; - QueryParams.prototype.loadsAllData = function () { - return !(this.startSet_ || this.endSet_ || this.limitSet_); - }; - QueryParams.prototype.isDefault = function () { - return this.loadsAllData() && this.index_ === PRIORITY_INDEX; - }; - QueryParams.prototype.copy = function () { - var copy = new QueryParams(); - copy.limitSet_ = this.limitSet_; - copy.limit_ = this.limit_; - copy.startSet_ = this.startSet_; - copy.indexStartValue_ = this.indexStartValue_; - copy.startNameSet_ = this.startNameSet_; - copy.indexStartName_ = this.indexStartName_; - copy.endSet_ = this.endSet_; - copy.indexEndValue_ = this.indexEndValue_; - copy.endNameSet_ = this.endNameSet_; - copy.indexEndName_ = this.indexEndName_; - copy.index_ = this.index_; - copy.viewFrom_ = this.viewFrom_; - return copy; - }; - return QueryParams; -}()); -function queryParamsGetNodeFilter(queryParams) { - if (queryParams.loadsAllData()) { - return new IndexedFilter(queryParams.getIndex()); - } - else if (queryParams.hasLimit()) { - return new LimitedFilter(queryParams); - } - else { - return new RangedFilter(queryParams); - } -} -function queryParamsLimitToFirst(queryParams, newLimit) { - var newParams = queryParams.copy(); - newParams.limitSet_ = true; - newParams.limit_ = newLimit; - newParams.viewFrom_ = "l" /* VIEW_FROM_LEFT */; - return newParams; -} -function queryParamsLimitToLast(queryParams, newLimit) { - var newParams = queryParams.copy(); - newParams.limitSet_ = true; - newParams.limit_ = newLimit; - newParams.viewFrom_ = "r" /* VIEW_FROM_RIGHT */; - return newParams; -} -function queryParamsStartAt(queryParams, indexValue, key) { - var newParams = queryParams.copy(); - newParams.startSet_ = true; - if (indexValue === undefined) { - indexValue = null; - } - newParams.indexStartValue_ = indexValue; - if (key != null) { - newParams.startNameSet_ = true; - newParams.indexStartName_ = key; - } - else { - newParams.startNameSet_ = false; - newParams.indexStartName_ = ''; - } - return newParams; -} -function queryParamsStartAfter(queryParams, indexValue, key) { - var params; - if (queryParams.index_ === KEY_INDEX) { - if (typeof indexValue === 'string') { - indexValue = successor(indexValue); - } - params = queryParamsStartAt(queryParams, indexValue, key); - } - else { - var childKey = void 0; - if (key == null) { - childKey = MAX_NAME; - } - else { - childKey = successor(key); - } - params = queryParamsStartAt(queryParams, indexValue, childKey); - } - params.startAfterSet_ = true; - return params; -} -function queryParamsEndAt(queryParams, indexValue, key) { - var newParams = queryParams.copy(); - newParams.endSet_ = true; - if (indexValue === undefined) { - indexValue = null; - } - newParams.indexEndValue_ = indexValue; - if (key !== undefined) { - newParams.endNameSet_ = true; - newParams.indexEndName_ = key; - } - else { - newParams.endNameSet_ = false; - newParams.indexEndName_ = ''; - } - return newParams; -} -function queryParamsEndBefore(queryParams, indexValue, key) { - var childKey; - var params; - if (queryParams.index_ === KEY_INDEX) { - if (typeof indexValue === 'string') { - indexValue = predecessor(indexValue); - } - params = queryParamsEndAt(queryParams, indexValue, key); - } - else { - if (key == null) { - childKey = MIN_NAME; - } - else { - childKey = predecessor(key); - } - params = queryParamsEndAt(queryParams, indexValue, childKey); - } - params.endBeforeSet_ = true; - return params; -} -function queryParamsOrderBy(queryParams, index) { - var newParams = queryParams.copy(); - newParams.index_ = index; - return newParams; -} -/** - * Returns a set of REST query string parameters representing this query. - * - * @returns query string parameters - */ -function queryParamsToRestQueryStringParameters(queryParams) { - var qs = {}; - if (queryParams.isDefault()) { - return qs; - } - var orderBy; - if (queryParams.index_ === PRIORITY_INDEX) { - orderBy = "$priority" /* PRIORITY_INDEX */; - } - else if (queryParams.index_ === VALUE_INDEX) { - orderBy = "$value" /* VALUE_INDEX */; - } - else if (queryParams.index_ === KEY_INDEX) { - orderBy = "$key" /* KEY_INDEX */; - } - else { - assert(queryParams.index_ instanceof PathIndex, 'Unrecognized index type!'); - orderBy = queryParams.index_.toString(); - } - qs["orderBy" /* ORDER_BY */] = stringify(orderBy); - if (queryParams.startSet_) { - qs["startAt" /* START_AT */] = stringify(queryParams.indexStartValue_); - if (queryParams.startNameSet_) { - qs["startAt" /* START_AT */] += - ',' + stringify(queryParams.indexStartName_); - } - } - if (queryParams.endSet_) { - qs["endAt" /* END_AT */] = stringify(queryParams.indexEndValue_); - if (queryParams.endNameSet_) { - qs["endAt" /* END_AT */] += - ',' + stringify(queryParams.indexEndName_); - } - } - if (queryParams.limitSet_) { - if (queryParams.isViewFromLeft()) { - qs["limitToFirst" /* LIMIT_TO_FIRST */] = queryParams.limit_; - } - else { - qs["limitToLast" /* LIMIT_TO_LAST */] = queryParams.limit_; - } - } - return qs; -} -function queryParamsGetQueryObject(queryParams) { - var obj = {}; - if (queryParams.startSet_) { - obj["sp" /* INDEX_START_VALUE */] = - queryParams.indexStartValue_; - if (queryParams.startNameSet_) { - obj["sn" /* INDEX_START_NAME */] = - queryParams.indexStartName_; - } - } - if (queryParams.endSet_) { - obj["ep" /* INDEX_END_VALUE */] = queryParams.indexEndValue_; - if (queryParams.endNameSet_) { - obj["en" /* INDEX_END_NAME */] = queryParams.indexEndName_; - } - } - if (queryParams.limitSet_) { - obj["l" /* LIMIT */] = queryParams.limit_; - var viewFrom = queryParams.viewFrom_; - if (viewFrom === '') { - if (queryParams.isViewFromLeft()) { - viewFrom = "l" /* VIEW_FROM_LEFT */; - } - else { - viewFrom = "r" /* VIEW_FROM_RIGHT */; - } - } - obj["vf" /* VIEW_FROM */] = viewFrom; - } - // For now, priority index is the default, so we only specify if it's some other index - if (queryParams.index_ !== PRIORITY_INDEX) { - obj["i" /* INDEX */] = queryParams.index_.toString(); - } - return obj; -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * An implementation of ServerActions that communicates with the server via REST requests. - * This is mostly useful for compatibility with crawlers, where we don't want to spin up a full - * persistent connection (using WebSockets or long-polling) - */ -var ReadonlyRestClient = /** @class */ (function (_super) { - __extends(ReadonlyRestClient, _super); - /** - * @param repoInfo_ - Data about the namespace we are connecting to - * @param onDataUpdate_ - A callback for new data from the server - */ - function ReadonlyRestClient(repoInfo_, onDataUpdate_, authTokenProvider_, appCheckTokenProvider_) { - var _this = _super.call(this) || this; - _this.repoInfo_ = repoInfo_; - _this.onDataUpdate_ = onDataUpdate_; - _this.authTokenProvider_ = authTokenProvider_; - _this.appCheckTokenProvider_ = appCheckTokenProvider_; - /** @private {function(...[*])} */ - _this.log_ = logWrapper('p:rest:'); - /** - * We don't actually need to track listens, except to prevent us calling an onComplete for a listen - * that's been removed. :-/ - */ - _this.listens_ = {}; - return _this; - } - ReadonlyRestClient.prototype.reportStats = function (stats) { - throw new Error('Method not implemented.'); - }; - ReadonlyRestClient.getListenId_ = function (query, tag) { - if (tag !== undefined) { - return 'tag$' + tag; - } - else { - assert(query._queryParams.isDefault(), "should have a tag if it's not a default query."); - return query._path.toString(); - } - }; - /** @inheritDoc */ - ReadonlyRestClient.prototype.listen = function (query, currentHashFn, tag, onComplete) { - var _this = this; - var pathString = query._path.toString(); - this.log_('Listen called for ' + pathString + ' ' + query._queryIdentifier); - // Mark this listener so we can tell if it's removed. - var listenId = ReadonlyRestClient.getListenId_(query, tag); - var thisListen = {}; - this.listens_[listenId] = thisListen; - var queryStringParameters = queryParamsToRestQueryStringParameters(query._queryParams); - this.restRequest_(pathString + '.json', queryStringParameters, function (error, result) { - var data = result; - if (error === 404) { - data = null; - error = null; - } - if (error === null) { - _this.onDataUpdate_(pathString, data, /*isMerge=*/ false, tag); - } - if (safeGet(_this.listens_, listenId) === thisListen) { - var status_1; - if (!error) { - status_1 = 'ok'; - } - else if (error === 401) { - status_1 = 'permission_denied'; - } - else { - status_1 = 'rest_error:' + error; - } - onComplete(status_1, null); - } - }); - }; - /** @inheritDoc */ - ReadonlyRestClient.prototype.unlisten = function (query, tag) { - var listenId = ReadonlyRestClient.getListenId_(query, tag); - delete this.listens_[listenId]; - }; - ReadonlyRestClient.prototype.get = function (query) { - var _this = this; - var queryStringParameters = queryParamsToRestQueryStringParameters(query._queryParams); - var pathString = query._path.toString(); - var deferred = new Deferred(); - this.restRequest_(pathString + '.json', queryStringParameters, function (error, result) { - var data = result; - if (error === 404) { - data = null; - error = null; - } - if (error === null) { - _this.onDataUpdate_(pathString, data, - /*isMerge=*/ false, - /*tag=*/ null); - deferred.resolve(data); - } - else { - deferred.reject(new Error(data)); - } - }); - return deferred.promise; - }; - /** @inheritDoc */ - ReadonlyRestClient.prototype.refreshAuthToken = function (token) { - // no-op since we just always call getToken. - }; - /** - * Performs a REST request to the given path, with the provided query string parameters, - * and any auth credentials we have. - */ - ReadonlyRestClient.prototype.restRequest_ = function (pathString, queryStringParameters, callback) { - var _this = this; - if (queryStringParameters === void 0) { queryStringParameters = {}; } - queryStringParameters['format'] = 'export'; - return Promise.all([ - this.authTokenProvider_.getToken(/*forceRefresh=*/ false), - this.appCheckTokenProvider_.getToken(/*forceRefresh=*/ false) - ]).then(function (_a) { - var _b = __read(_a, 2), authToken = _b[0], appCheckToken = _b[1]; - if (authToken && authToken.accessToken) { - queryStringParameters['auth'] = authToken.accessToken; - } - if (appCheckToken && appCheckToken.token) { - queryStringParameters['ac'] = appCheckToken.token; - } - var url = (_this.repoInfo_.secure ? 'https://' : 'http://') + - _this.repoInfo_.host + - pathString + - '?' + - 'ns=' + - _this.repoInfo_.namespace + - querystring(queryStringParameters); - _this.log_('Sending REST request for ' + url); - var xhr = new XMLHttpRequest(); - xhr.onreadystatechange = function () { - if (callback && xhr.readyState === 4) { - _this.log_('REST Response for ' + url + ' received. status:', xhr.status, 'response:', xhr.responseText); - var res = null; - if (xhr.status >= 200 && xhr.status < 300) { - try { - res = jsonEval(xhr.responseText); - } - catch (e) { - warn('Failed to parse JSON response for ' + - url + - ': ' + - xhr.responseText); - } - callback(null, res); - } - else { - // 401 and 404 are expected. - if (xhr.status !== 401 && xhr.status !== 404) { - warn('Got unsuccessful REST response for ' + - url + - ' Status: ' + - xhr.status); - } - callback(xhr.status); - } - callback = null; - } - }; - xhr.open('GET', url, /*asynchronous=*/ true); - xhr.send(); - }); - }; - return ReadonlyRestClient; -}(ServerActions)); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Mutable object which basically just stores a reference to the "latest" immutable snapshot. - */ -var SnapshotHolder = /** @class */ (function () { - function SnapshotHolder() { - this.rootNode_ = ChildrenNode.EMPTY_NODE; - } - SnapshotHolder.prototype.getNode = function (path) { - return this.rootNode_.getChild(path); - }; - SnapshotHolder.prototype.updateSnapshot = function (path, newSnapshotNode) { - this.rootNode_ = this.rootNode_.updateChild(path, newSnapshotNode); - }; - return SnapshotHolder; -}()); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -function newSparseSnapshotTree() { - return { - value: null, - children: new Map() - }; -} -/** - * Stores the given node at the specified path. If there is already a node - * at a shallower path, it merges the new data into that snapshot node. - * - * @param path - Path to look up snapshot for. - * @param data - The new data, or null. - */ -function sparseSnapshotTreeRemember(sparseSnapshotTree, path, data) { - if (pathIsEmpty(path)) { - sparseSnapshotTree.value = data; - sparseSnapshotTree.children.clear(); - } - else if (sparseSnapshotTree.value !== null) { - sparseSnapshotTree.value = sparseSnapshotTree.value.updateChild(path, data); - } - else { - var childKey = pathGetFront(path); - if (!sparseSnapshotTree.children.has(childKey)) { - sparseSnapshotTree.children.set(childKey, newSparseSnapshotTree()); - } - var child = sparseSnapshotTree.children.get(childKey); - path = pathPopFront(path); - sparseSnapshotTreeRemember(child, path, data); - } -} -/** - * Purge the data at path from the cache. - * - * @param path - Path to look up snapshot for. - * @returns True if this node should now be removed. - */ -function sparseSnapshotTreeForget(sparseSnapshotTree, path) { - if (pathIsEmpty(path)) { - sparseSnapshotTree.value = null; - sparseSnapshotTree.children.clear(); - return true; - } - else { - if (sparseSnapshotTree.value !== null) { - if (sparseSnapshotTree.value.isLeafNode()) { - // We're trying to forget a node that doesn't exist - return false; - } - else { - var value = sparseSnapshotTree.value; - sparseSnapshotTree.value = null; - value.forEachChild(PRIORITY_INDEX, function (key, tree) { - sparseSnapshotTreeRemember(sparseSnapshotTree, new Path(key), tree); - }); - return sparseSnapshotTreeForget(sparseSnapshotTree, path); - } - } - else if (sparseSnapshotTree.children.size > 0) { - var childKey = pathGetFront(path); - path = pathPopFront(path); - if (sparseSnapshotTree.children.has(childKey)) { - var safeToRemove = sparseSnapshotTreeForget(sparseSnapshotTree.children.get(childKey), path); - if (safeToRemove) { - sparseSnapshotTree.children.delete(childKey); - } - } - return sparseSnapshotTree.children.size === 0; - } - else { - return true; - } - } -} -/** - * Recursively iterates through all of the stored tree and calls the - * callback on each one. - * - * @param prefixPath - Path to look up node for. - * @param func - The function to invoke for each tree. - */ -function sparseSnapshotTreeForEachTree(sparseSnapshotTree, prefixPath, func) { - if (sparseSnapshotTree.value !== null) { - func(prefixPath, sparseSnapshotTree.value); - } - else { - sparseSnapshotTreeForEachChild(sparseSnapshotTree, function (key, tree) { - var path = new Path(prefixPath.toString() + '/' + key); - sparseSnapshotTreeForEachTree(tree, path, func); - }); - } -} -/** - * Iterates through each immediate child and triggers the callback. - * Only seems to be used in tests. - * - * @param func - The function to invoke for each child. - */ -function sparseSnapshotTreeForEachChild(sparseSnapshotTree, func) { - sparseSnapshotTree.children.forEach(function (tree, key) { - func(key, tree); - }); -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Returns the delta from the previous call to get stats. - * - * @param collection_ - The collection to "listen" to. - */ -var StatsListener = /** @class */ (function () { - function StatsListener(collection_) { - this.collection_ = collection_; - this.last_ = null; - } - StatsListener.prototype.get = function () { - var newStats = this.collection_.get(); - var delta = __assign({}, newStats); - if (this.last_) { - each(this.last_, function (stat, value) { - delta[stat] = delta[stat] - value; - }); - } - this.last_ = newStats; - return delta; - }; - return StatsListener; -}()); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Assuming some apps may have a short amount of time on page, and a bulk of firebase operations probably -// happen on page load, we try to report our first set of stats pretty quickly, but we wait at least 10 -// seconds to try to ensure the Firebase connection is established / settled. -var FIRST_STATS_MIN_TIME = 10 * 1000; -var FIRST_STATS_MAX_TIME = 30 * 1000; -// We'll continue to report stats on average every 5 minutes. -var REPORT_STATS_INTERVAL = 5 * 60 * 1000; -var StatsReporter = /** @class */ (function () { - function StatsReporter(collection, server_) { - this.server_ = server_; - this.statsToReport_ = {}; - this.statsListener_ = new StatsListener(collection); - var timeout = FIRST_STATS_MIN_TIME + - (FIRST_STATS_MAX_TIME - FIRST_STATS_MIN_TIME) * Math.random(); - setTimeoutNonBlocking(this.reportStats_.bind(this), Math.floor(timeout)); - } - StatsReporter.prototype.reportStats_ = function () { - var _this = this; - var stats = this.statsListener_.get(); - var reportedStats = {}; - var haveStatsToReport = false; - each(stats, function (stat, value) { - if (value > 0 && contains(_this.statsToReport_, stat)) { - reportedStats[stat] = value; - haveStatsToReport = true; - } - }); - if (haveStatsToReport) { - this.server_.reportStats(reportedStats); - } - // queue our next run. - setTimeoutNonBlocking(this.reportStats_.bind(this), Math.floor(Math.random() * 2 * REPORT_STATS_INTERVAL)); - }; - return StatsReporter; -}()); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * - * @enum - */ -var OperationType; -(function (OperationType) { - OperationType[OperationType["OVERWRITE"] = 0] = "OVERWRITE"; - OperationType[OperationType["MERGE"] = 1] = "MERGE"; - OperationType[OperationType["ACK_USER_WRITE"] = 2] = "ACK_USER_WRITE"; - OperationType[OperationType["LISTEN_COMPLETE"] = 3] = "LISTEN_COMPLETE"; -})(OperationType || (OperationType = {})); -function newOperationSourceUser() { - return { - fromUser: true, - fromServer: false, - queryId: null, - tagged: false - }; -} -function newOperationSourceServer() { - return { - fromUser: false, - fromServer: true, - queryId: null, - tagged: false - }; -} -function newOperationSourceServerTaggedQuery(queryId) { - return { - fromUser: false, - fromServer: true, - queryId: queryId, - tagged: true - }; -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var AckUserWrite = /** @class */ (function () { - /** - * @param affectedTree - A tree containing true for each affected path. Affected paths can't overlap. - */ - function AckUserWrite( - /** @inheritDoc */ path, - /** @inheritDoc */ affectedTree, - /** @inheritDoc */ revert) { - this.path = path; - this.affectedTree = affectedTree; - this.revert = revert; - /** @inheritDoc */ - this.type = OperationType.ACK_USER_WRITE; - /** @inheritDoc */ - this.source = newOperationSourceUser(); - } - AckUserWrite.prototype.operationForChild = function (childName) { - if (!pathIsEmpty(this.path)) { - assert(pathGetFront(this.path) === childName, 'operationForChild called for unrelated child.'); - return new AckUserWrite(pathPopFront(this.path), this.affectedTree, this.revert); - } - else if (this.affectedTree.value != null) { - assert(this.affectedTree.children.isEmpty(), 'affectedTree should not have overlapping affected paths.'); - // All child locations are affected as well; just return same operation. - return this; - } - else { - var childTree = this.affectedTree.subtree(new Path(childName)); - return new AckUserWrite(newEmptyPath(), childTree, this.revert); - } - }; - return AckUserWrite; -}()); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var ListenComplete = /** @class */ (function () { - function ListenComplete(source, path) { - this.source = source; - this.path = path; - /** @inheritDoc */ - this.type = OperationType.LISTEN_COMPLETE; - } - ListenComplete.prototype.operationForChild = function (childName) { - if (pathIsEmpty(this.path)) { - return new ListenComplete(this.source, newEmptyPath()); - } - else { - return new ListenComplete(this.source, pathPopFront(this.path)); - } - }; - return ListenComplete; -}()); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var Overwrite = /** @class */ (function () { - function Overwrite(source, path, snap) { - this.source = source; - this.path = path; - this.snap = snap; - /** @inheritDoc */ - this.type = OperationType.OVERWRITE; - } - Overwrite.prototype.operationForChild = function (childName) { - if (pathIsEmpty(this.path)) { - return new Overwrite(this.source, newEmptyPath(), this.snap.getImmediateChild(childName)); - } - else { - return new Overwrite(this.source, pathPopFront(this.path), this.snap); - } - }; - return Overwrite; -}()); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var Merge = /** @class */ (function () { - function Merge( - /** @inheritDoc */ source, - /** @inheritDoc */ path, - /** @inheritDoc */ children) { - this.source = source; - this.path = path; - this.children = children; - /** @inheritDoc */ - this.type = OperationType.MERGE; - } - Merge.prototype.operationForChild = function (childName) { - if (pathIsEmpty(this.path)) { - var childTree = this.children.subtree(new Path(childName)); - if (childTree.isEmpty()) { - // This child is unaffected - return null; - } - else if (childTree.value) { - // We have a snapshot for the child in question. This becomes an overwrite of the child. - return new Overwrite(this.source, newEmptyPath(), childTree.value); - } - else { - // This is a merge at a deeper level - return new Merge(this.source, newEmptyPath(), childTree); - } - } - else { - assert(pathGetFront(this.path) === childName, "Can't get a merge for a child not on the path of the operation"); - return new Merge(this.source, pathPopFront(this.path), this.children); - } - }; - Merge.prototype.toString = function () { - return ('Operation(' + - this.path + - ': ' + - this.source.toString() + - ' merge: ' + - this.children.toString() + - ')'); - }; - return Merge; -}()); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * A cache node only stores complete children. Additionally it holds a flag whether the node can be considered fully - * initialized in the sense that we know at one point in time this represented a valid state of the world, e.g. - * initialized with data from the server, or a complete overwrite by the client. The filtered flag also tracks - * whether a node potentially had children removed due to a filter. - */ -var CacheNode = /** @class */ (function () { - function CacheNode(node_, fullyInitialized_, filtered_) { - this.node_ = node_; - this.fullyInitialized_ = fullyInitialized_; - this.filtered_ = filtered_; - } - /** - * Returns whether this node was fully initialized with either server data or a complete overwrite by the client - */ - CacheNode.prototype.isFullyInitialized = function () { - return this.fullyInitialized_; - }; - /** - * Returns whether this node is potentially missing children due to a filter applied to the node - */ - CacheNode.prototype.isFiltered = function () { - return this.filtered_; - }; - CacheNode.prototype.isCompleteForPath = function (path) { - if (pathIsEmpty(path)) { - return this.isFullyInitialized() && !this.filtered_; - } - var childKey = pathGetFront(path); - return this.isCompleteForChild(childKey); - }; - CacheNode.prototype.isCompleteForChild = function (key) { - return ((this.isFullyInitialized() && !this.filtered_) || this.node_.hasChild(key)); - }; - CacheNode.prototype.getNode = function () { - return this.node_; - }; - return CacheNode; -}()); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * An EventGenerator is used to convert "raw" changes (Change) as computed by the - * CacheDiffer into actual events (Event) that can be raised. See generateEventsForChanges() - * for details. - * - */ -var EventGenerator = /** @class */ (function () { - function EventGenerator(query_) { - this.query_ = query_; - this.index_ = this.query_._queryParams.getIndex(); - } - return EventGenerator; -}()); -/** - * Given a set of raw changes (no moved events and prevName not specified yet), and a set of - * EventRegistrations that should be notified of these changes, generate the actual events to be raised. - * - * Notes: - * - child_moved events will be synthesized at this time for any child_changed events that affect - * our index. - * - prevName will be calculated based on the index ordering. - */ -function eventGeneratorGenerateEventsForChanges(eventGenerator, changes, eventCache, eventRegistrations) { - var events = []; - var moves = []; - changes.forEach(function (change) { - if (change.type === "child_changed" /* CHILD_CHANGED */ && - eventGenerator.index_.indexedValueChanged(change.oldSnap, change.snapshotNode)) { - moves.push(changeChildMoved(change.childName, change.snapshotNode)); - } - }); - eventGeneratorGenerateEventsForType(eventGenerator, events, "child_removed" /* CHILD_REMOVED */, changes, eventRegistrations, eventCache); - eventGeneratorGenerateEventsForType(eventGenerator, events, "child_added" /* CHILD_ADDED */, changes, eventRegistrations, eventCache); - eventGeneratorGenerateEventsForType(eventGenerator, events, "child_moved" /* CHILD_MOVED */, moves, eventRegistrations, eventCache); - eventGeneratorGenerateEventsForType(eventGenerator, events, "child_changed" /* CHILD_CHANGED */, changes, eventRegistrations, eventCache); - eventGeneratorGenerateEventsForType(eventGenerator, events, "value" /* VALUE */, changes, eventRegistrations, eventCache); - return events; -} -/** - * Given changes of a single change type, generate the corresponding events. - */ -function eventGeneratorGenerateEventsForType(eventGenerator, events, eventType, changes, registrations, eventCache) { - var filteredChanges = changes.filter(function (change) { return change.type === eventType; }); - filteredChanges.sort(function (a, b) { - return eventGeneratorCompareChanges(eventGenerator, a, b); - }); - filteredChanges.forEach(function (change) { - var materializedChange = eventGeneratorMaterializeSingleChange(eventGenerator, change, eventCache); - registrations.forEach(function (registration) { - if (registration.respondsTo(change.type)) { - events.push(registration.createEvent(materializedChange, eventGenerator.query_)); - } - }); - }); -} -function eventGeneratorMaterializeSingleChange(eventGenerator, change, eventCache) { - if (change.type === 'value' || change.type === 'child_removed') { - return change; - } - else { - change.prevName = eventCache.getPredecessorChildName(change.childName, change.snapshotNode, eventGenerator.index_); - return change; - } -} -function eventGeneratorCompareChanges(eventGenerator, a, b) { - if (a.childName == null || b.childName == null) { - throw assertionError('Should only compare child_ events.'); - } - var aWrapped = new NamedNode(a.childName, a.snapshotNode); - var bWrapped = new NamedNode(b.childName, b.snapshotNode); - return eventGenerator.index_.compare(aWrapped, bWrapped); -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -function newViewCache(eventCache, serverCache) { - return { eventCache: eventCache, serverCache: serverCache }; -} -function viewCacheUpdateEventSnap(viewCache, eventSnap, complete, filtered) { - return newViewCache(new CacheNode(eventSnap, complete, filtered), viewCache.serverCache); -} -function viewCacheUpdateServerSnap(viewCache, serverSnap, complete, filtered) { - return newViewCache(viewCache.eventCache, new CacheNode(serverSnap, complete, filtered)); -} -function viewCacheGetCompleteEventSnap(viewCache) { - return viewCache.eventCache.isFullyInitialized() - ? viewCache.eventCache.getNode() - : null; -} -function viewCacheGetCompleteServerSnap(viewCache) { - return viewCache.serverCache.isFullyInitialized() - ? viewCache.serverCache.getNode() - : null; -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var emptyChildrenSingleton; -/** - * Singleton empty children collection. - * - */ -var EmptyChildren = function () { - if (!emptyChildrenSingleton) { - emptyChildrenSingleton = new SortedMap(stringCompare); - } - return emptyChildrenSingleton; -}; -/** - * A tree with immutable elements. - */ -var ImmutableTree = /** @class */ (function () { - function ImmutableTree(value, children) { - if (children === void 0) { children = EmptyChildren(); } - this.value = value; - this.children = children; - } - ImmutableTree.fromObject = function (obj) { - var tree = new ImmutableTree(null); - each(obj, function (childPath, childSnap) { - tree = tree.set(new Path(childPath), childSnap); - }); - return tree; - }; - /** - * True if the value is empty and there are no children - */ - ImmutableTree.prototype.isEmpty = function () { - return this.value === null && this.children.isEmpty(); - }; - /** - * Given a path and predicate, return the first node and the path to that node - * where the predicate returns true. - * - * TODO Do a perf test -- If we're creating a bunch of `{path: value:}` - * objects on the way back out, it may be better to pass down a pathSoFar obj. - * - * @param relativePath - The remainder of the path - * @param predicate - The predicate to satisfy to return a node - */ - ImmutableTree.prototype.findRootMostMatchingPathAndValue = function (relativePath, predicate) { - if (this.value != null && predicate(this.value)) { - return { path: newEmptyPath(), value: this.value }; - } - else { - if (pathIsEmpty(relativePath)) { - return null; - } - else { - var front = pathGetFront(relativePath); - var child = this.children.get(front); - if (child !== null) { - var childExistingPathAndValue = child.findRootMostMatchingPathAndValue(pathPopFront(relativePath), predicate); - if (childExistingPathAndValue != null) { - var fullPath = pathChild(new Path(front), childExistingPathAndValue.path); - return { path: fullPath, value: childExistingPathAndValue.value }; - } - else { - return null; - } - } - else { - return null; - } - } - } - }; - /** - * Find, if it exists, the shortest subpath of the given path that points a defined - * value in the tree - */ - ImmutableTree.prototype.findRootMostValueAndPath = function (relativePath) { - return this.findRootMostMatchingPathAndValue(relativePath, function () { return true; }); - }; - /** - * @returns The subtree at the given path - */ - ImmutableTree.prototype.subtree = function (relativePath) { - if (pathIsEmpty(relativePath)) { - return this; - } - else { - var front = pathGetFront(relativePath); - var childTree = this.children.get(front); - if (childTree !== null) { - return childTree.subtree(pathPopFront(relativePath)); - } - else { - return new ImmutableTree(null); - } - } - }; - /** - * Sets a value at the specified path. - * - * @param relativePath - Path to set value at. - * @param toSet - Value to set. - * @returns Resulting tree. - */ - ImmutableTree.prototype.set = function (relativePath, toSet) { - if (pathIsEmpty(relativePath)) { - return new ImmutableTree(toSet, this.children); - } - else { - var front = pathGetFront(relativePath); - var child = this.children.get(front) || new ImmutableTree(null); - var newChild = child.set(pathPopFront(relativePath), toSet); - var newChildren = this.children.insert(front, newChild); - return new ImmutableTree(this.value, newChildren); - } - }; - /** - * Removes the value at the specified path. - * - * @param relativePath - Path to value to remove. - * @returns Resulting tree. - */ - ImmutableTree.prototype.remove = function (relativePath) { - if (pathIsEmpty(relativePath)) { - if (this.children.isEmpty()) { - return new ImmutableTree(null); - } - else { - return new ImmutableTree(null, this.children); - } - } - else { - var front = pathGetFront(relativePath); - var child = this.children.get(front); - if (child) { - var newChild = child.remove(pathPopFront(relativePath)); - var newChildren = void 0; - if (newChild.isEmpty()) { - newChildren = this.children.remove(front); - } - else { - newChildren = this.children.insert(front, newChild); - } - if (this.value === null && newChildren.isEmpty()) { - return new ImmutableTree(null); - } - else { - return new ImmutableTree(this.value, newChildren); - } - } - else { - return this; - } - } - }; - /** - * Gets a value from the tree. - * - * @param relativePath - Path to get value for. - * @returns Value at path, or null. - */ - ImmutableTree.prototype.get = function (relativePath) { - if (pathIsEmpty(relativePath)) { - return this.value; - } - else { - var front = pathGetFront(relativePath); - var child = this.children.get(front); - if (child) { - return child.get(pathPopFront(relativePath)); - } - else { - return null; - } - } - }; - /** - * Replace the subtree at the specified path with the given new tree. - * - * @param relativePath - Path to replace subtree for. - * @param newTree - New tree. - * @returns Resulting tree. - */ - ImmutableTree.prototype.setTree = function (relativePath, newTree) { - if (pathIsEmpty(relativePath)) { - return newTree; - } - else { - var front = pathGetFront(relativePath); - var child = this.children.get(front) || new ImmutableTree(null); - var newChild = child.setTree(pathPopFront(relativePath), newTree); - var newChildren = void 0; - if (newChild.isEmpty()) { - newChildren = this.children.remove(front); - } - else { - newChildren = this.children.insert(front, newChild); - } - return new ImmutableTree(this.value, newChildren); - } - }; - /** - * Performs a depth first fold on this tree. Transforms a tree into a single - * value, given a function that operates on the path to a node, an optional - * current value, and a map of child names to folded subtrees - */ - ImmutableTree.prototype.fold = function (fn) { - return this.fold_(newEmptyPath(), fn); - }; - /** - * Recursive helper for public-facing fold() method - */ - ImmutableTree.prototype.fold_ = function (pathSoFar, fn) { - var accum = {}; - this.children.inorderTraversal(function (childKey, childTree) { - accum[childKey] = childTree.fold_(pathChild(pathSoFar, childKey), fn); - }); - return fn(pathSoFar, this.value, accum); - }; - /** - * Find the first matching value on the given path. Return the result of applying f to it. - */ - ImmutableTree.prototype.findOnPath = function (path, f) { - return this.findOnPath_(path, newEmptyPath(), f); - }; - ImmutableTree.prototype.findOnPath_ = function (pathToFollow, pathSoFar, f) { - var result = this.value ? f(pathSoFar, this.value) : false; - if (result) { - return result; - } - else { - if (pathIsEmpty(pathToFollow)) { - return null; - } - else { - var front = pathGetFront(pathToFollow); - var nextChild = this.children.get(front); - if (nextChild) { - return nextChild.findOnPath_(pathPopFront(pathToFollow), pathChild(pathSoFar, front), f); - } - else { - return null; - } - } - } - }; - ImmutableTree.prototype.foreachOnPath = function (path, f) { - return this.foreachOnPath_(path, newEmptyPath(), f); - }; - ImmutableTree.prototype.foreachOnPath_ = function (pathToFollow, currentRelativePath, f) { - if (pathIsEmpty(pathToFollow)) { - return this; - } - else { - if (this.value) { - f(currentRelativePath, this.value); - } - var front = pathGetFront(pathToFollow); - var nextChild = this.children.get(front); - if (nextChild) { - return nextChild.foreachOnPath_(pathPopFront(pathToFollow), pathChild(currentRelativePath, front), f); - } - else { - return new ImmutableTree(null); - } - } - }; - /** - * Calls the given function for each node in the tree that has a value. - * - * @param f - A function to be called with the path from the root of the tree to - * a node, and the value at that node. Called in depth-first order. - */ - ImmutableTree.prototype.foreach = function (f) { - this.foreach_(newEmptyPath(), f); - }; - ImmutableTree.prototype.foreach_ = function (currentRelativePath, f) { - this.children.inorderTraversal(function (childName, childTree) { - childTree.foreach_(pathChild(currentRelativePath, childName), f); - }); - if (this.value) { - f(currentRelativePath, this.value); - } - }; - ImmutableTree.prototype.foreachChild = function (f) { - this.children.inorderTraversal(function (childName, childTree) { - if (childTree.value) { - f(childName, childTree.value); - } - }); - }; - return ImmutableTree; -}()); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * This class holds a collection of writes that can be applied to nodes in unison. It abstracts away the logic with - * dealing with priority writes and multiple nested writes. At any given path there is only allowed to be one write - * modifying that path. Any write to an existing path or shadowing an existing path will modify that existing write - * to reflect the write added. - */ -var CompoundWrite = /** @class */ (function () { - function CompoundWrite(writeTree_) { - this.writeTree_ = writeTree_; - } - CompoundWrite.empty = function () { - return new CompoundWrite(new ImmutableTree(null)); - }; - return CompoundWrite; -}()); -function compoundWriteAddWrite(compoundWrite, path, node) { - if (pathIsEmpty(path)) { - return new CompoundWrite(new ImmutableTree(node)); - } - else { - var rootmost = compoundWrite.writeTree_.findRootMostValueAndPath(path); - if (rootmost != null) { - var rootMostPath = rootmost.path; - var value = rootmost.value; - var relativePath = newRelativePath(rootMostPath, path); - value = value.updateChild(relativePath, node); - return new CompoundWrite(compoundWrite.writeTree_.set(rootMostPath, value)); - } - else { - var subtree = new ImmutableTree(node); - var newWriteTree = compoundWrite.writeTree_.setTree(path, subtree); - return new CompoundWrite(newWriteTree); - } - } -} -function compoundWriteAddWrites(compoundWrite, path, updates) { - var newWrite = compoundWrite; - each(updates, function (childKey, node) { - newWrite = compoundWriteAddWrite(newWrite, pathChild(path, childKey), node); - }); - return newWrite; -} -/** - * Will remove a write at the given path and deeper paths. This will not modify a write at a higher - * location, which must be removed by calling this method with that path. - * - * @param compoundWrite - The CompoundWrite to remove. - * @param path - The path at which a write and all deeper writes should be removed - * @returns The new CompoundWrite with the removed path - */ -function compoundWriteRemoveWrite(compoundWrite, path) { - if (pathIsEmpty(path)) { - return CompoundWrite.empty(); - } - else { - var newWriteTree = compoundWrite.writeTree_.setTree(path, new ImmutableTree(null)); - return new CompoundWrite(newWriteTree); - } -} -/** - * Returns whether this CompoundWrite will fully overwrite a node at a given location and can therefore be - * considered "complete". - * - * @param compoundWrite - The CompoundWrite to check. - * @param path - The path to check for - * @returns Whether there is a complete write at that path - */ -function compoundWriteHasCompleteWrite(compoundWrite, path) { - return compoundWriteGetCompleteNode(compoundWrite, path) != null; -} -/** - * Returns a node for a path if and only if the node is a "complete" overwrite at that path. This will not aggregate - * writes from deeper paths, but will return child nodes from a more shallow path. - * - * @param compoundWrite - The CompoundWrite to get the node from. - * @param path - The path to get a complete write - * @returns The node if complete at that path, or null otherwise. - */ -function compoundWriteGetCompleteNode(compoundWrite, path) { - var rootmost = compoundWrite.writeTree_.findRootMostValueAndPath(path); - if (rootmost != null) { - return compoundWrite.writeTree_ - .get(rootmost.path) - .getChild(newRelativePath(rootmost.path, path)); - } - else { - return null; - } -} -/** - * Returns all children that are guaranteed to be a complete overwrite. - * - * @param compoundWrite - The CompoundWrite to get children from. - * @returns A list of all complete children. - */ -function compoundWriteGetCompleteChildren(compoundWrite) { - var children = []; - var node = compoundWrite.writeTree_.value; - if (node != null) { - // If it's a leaf node, it has no children; so nothing to do. - if (!node.isLeafNode()) { - node.forEachChild(PRIORITY_INDEX, function (childName, childNode) { - children.push(new NamedNode(childName, childNode)); - }); - } - } - else { - compoundWrite.writeTree_.children.inorderTraversal(function (childName, childTree) { - if (childTree.value != null) { - children.push(new NamedNode(childName, childTree.value)); - } - }); - } - return children; -} -function compoundWriteChildCompoundWrite(compoundWrite, path) { - if (pathIsEmpty(path)) { - return compoundWrite; - } - else { - var shadowingNode = compoundWriteGetCompleteNode(compoundWrite, path); - if (shadowingNode != null) { - return new CompoundWrite(new ImmutableTree(shadowingNode)); - } - else { - return new CompoundWrite(compoundWrite.writeTree_.subtree(path)); - } - } -} -/** - * Returns true if this CompoundWrite is empty and therefore does not modify any nodes. - * @returns Whether this CompoundWrite is empty - */ -function compoundWriteIsEmpty(compoundWrite) { - return compoundWrite.writeTree_.isEmpty(); -} -/** - * Applies this CompoundWrite to a node. The node is returned with all writes from this CompoundWrite applied to the - * node - * @param node - The node to apply this CompoundWrite to - * @returns The node with all writes applied - */ -function compoundWriteApply(compoundWrite, node) { - return applySubtreeWrite(newEmptyPath(), compoundWrite.writeTree_, node); -} -function applySubtreeWrite(relativePath, writeTree, node) { - if (writeTree.value != null) { - // Since there a write is always a leaf, we're done here - return node.updateChild(relativePath, writeTree.value); - } - else { - var priorityWrite_1 = null; - writeTree.children.inorderTraversal(function (childKey, childTree) { - if (childKey === '.priority') { - // Apply priorities at the end so we don't update priorities for either empty nodes or forget - // to apply priorities to empty nodes that are later filled - assert(childTree.value !== null, 'Priority writes must always be leaf nodes'); - priorityWrite_1 = childTree.value; - } - else { - node = applySubtreeWrite(pathChild(relativePath, childKey), childTree, node); - } - }); - // If there was a priority write, we only apply it if the node is not empty - if (!node.getChild(relativePath).isEmpty() && priorityWrite_1 !== null) { - node = node.updateChild(pathChild(relativePath, '.priority'), priorityWrite_1); - } - return node; - } -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Create a new WriteTreeRef for the given path. For use with a new sync point at the given path. - * - */ -function writeTreeChildWrites(writeTree, path) { - return newWriteTreeRef(path, writeTree); -} -/** - * Record a new overwrite from user code. - * - * @param visible - This is set to false by some transactions. It should be excluded from event caches - */ -function writeTreeAddOverwrite(writeTree, path, snap, writeId, visible) { - assert(writeId > writeTree.lastWriteId, 'Stacking an older write on top of newer ones'); - if (visible === undefined) { - visible = true; - } - writeTree.allWrites.push({ - path: path, - snap: snap, - writeId: writeId, - visible: visible - }); - if (visible) { - writeTree.visibleWrites = compoundWriteAddWrite(writeTree.visibleWrites, path, snap); - } - writeTree.lastWriteId = writeId; -} -/** - * Record a new merge from user code. - */ -function writeTreeAddMerge(writeTree, path, changedChildren, writeId) { - assert(writeId > writeTree.lastWriteId, 'Stacking an older merge on top of newer ones'); - writeTree.allWrites.push({ - path: path, - children: changedChildren, - writeId: writeId, - visible: true - }); - writeTree.visibleWrites = compoundWriteAddWrites(writeTree.visibleWrites, path, changedChildren); - writeTree.lastWriteId = writeId; -} -function writeTreeGetWrite(writeTree, writeId) { - for (var i = 0; i < writeTree.allWrites.length; i++) { - var record = writeTree.allWrites[i]; - if (record.writeId === writeId) { - return record; - } - } - return null; -} -/** - * Remove a write (either an overwrite or merge) that has been successfully acknowledge by the server. Recalculates - * the tree if necessary. We return true if it may have been visible, meaning views need to reevaluate. - * - * @returns true if the write may have been visible (meaning we'll need to reevaluate / raise - * events as a result). - */ -function writeTreeRemoveWrite(writeTree, writeId) { - // Note: disabling this check. It could be a transaction that preempted another transaction, and thus was applied - // out of order. - //const validClear = revert || this.allWrites_.length === 0 || writeId <= this.allWrites_[0].writeId; - //assert(validClear, "Either we don't have this write, or it's the first one in the queue"); - var idx = writeTree.allWrites.findIndex(function (s) { - return s.writeId === writeId; - }); - assert(idx >= 0, 'removeWrite called with nonexistent writeId.'); - var writeToRemove = writeTree.allWrites[idx]; - writeTree.allWrites.splice(idx, 1); - var removedWriteWasVisible = writeToRemove.visible; - var removedWriteOverlapsWithOtherWrites = false; - var i = writeTree.allWrites.length - 1; - while (removedWriteWasVisible && i >= 0) { - var currentWrite = writeTree.allWrites[i]; - if (currentWrite.visible) { - if (i >= idx && - writeTreeRecordContainsPath_(currentWrite, writeToRemove.path)) { - // The removed write was completely shadowed by a subsequent write. - removedWriteWasVisible = false; - } - else if (pathContains(writeToRemove.path, currentWrite.path)) { - // Either we're covering some writes or they're covering part of us (depending on which came first). - removedWriteOverlapsWithOtherWrites = true; - } - } - i--; - } - if (!removedWriteWasVisible) { - return false; - } - else if (removedWriteOverlapsWithOtherWrites) { - // There's some shadowing going on. Just rebuild the visible writes from scratch. - writeTreeResetTree_(writeTree); - return true; - } - else { - // There's no shadowing. We can safely just remove the write(s) from visibleWrites. - if (writeToRemove.snap) { - writeTree.visibleWrites = compoundWriteRemoveWrite(writeTree.visibleWrites, writeToRemove.path); - } - else { - var children = writeToRemove.children; - each(children, function (childName) { - writeTree.visibleWrites = compoundWriteRemoveWrite(writeTree.visibleWrites, pathChild(writeToRemove.path, childName)); - }); - } - return true; - } -} -function writeTreeRecordContainsPath_(writeRecord, path) { - if (writeRecord.snap) { - return pathContains(writeRecord.path, path); - } - else { - for (var childName in writeRecord.children) { - if (writeRecord.children.hasOwnProperty(childName) && - pathContains(pathChild(writeRecord.path, childName), path)) { - return true; - } - } - return false; - } -} -/** - * Re-layer the writes and merges into a tree so we can efficiently calculate event snapshots - */ -function writeTreeResetTree_(writeTree) { - writeTree.visibleWrites = writeTreeLayerTree_(writeTree.allWrites, writeTreeDefaultFilter_, newEmptyPath()); - if (writeTree.allWrites.length > 0) { - writeTree.lastWriteId = - writeTree.allWrites[writeTree.allWrites.length - 1].writeId; - } - else { - writeTree.lastWriteId = -1; - } -} -/** - * The default filter used when constructing the tree. Keep everything that's visible. - */ -function writeTreeDefaultFilter_(write) { - return write.visible; -} -/** - * Static method. Given an array of WriteRecords, a filter for which ones to include, and a path, construct the tree of - * event data at that path. - */ -function writeTreeLayerTree_(writes, filter, treeRoot) { - var compoundWrite = CompoundWrite.empty(); - for (var i = 0; i < writes.length; ++i) { - var write = writes[i]; - // Theory, a later set will either: - // a) abort a relevant transaction, so no need to worry about excluding it from calculating that transaction - // b) not be relevant to a transaction (separate branch), so again will not affect the data for that transaction - if (filter(write)) { - var writePath = write.path; - var relativePath = void 0; - if (write.snap) { - if (pathContains(treeRoot, writePath)) { - relativePath = newRelativePath(treeRoot, writePath); - compoundWrite = compoundWriteAddWrite(compoundWrite, relativePath, write.snap); - } - else if (pathContains(writePath, treeRoot)) { - relativePath = newRelativePath(writePath, treeRoot); - compoundWrite = compoundWriteAddWrite(compoundWrite, newEmptyPath(), write.snap.getChild(relativePath)); - } - else ; - } - else if (write.children) { - if (pathContains(treeRoot, writePath)) { - relativePath = newRelativePath(treeRoot, writePath); - compoundWrite = compoundWriteAddWrites(compoundWrite, relativePath, write.children); - } - else if (pathContains(writePath, treeRoot)) { - relativePath = newRelativePath(writePath, treeRoot); - if (pathIsEmpty(relativePath)) { - compoundWrite = compoundWriteAddWrites(compoundWrite, newEmptyPath(), write.children); - } - else { - var child = safeGet(write.children, pathGetFront(relativePath)); - if (child) { - // There exists a child in this node that matches the root path - var deepNode = child.getChild(pathPopFront(relativePath)); - compoundWrite = compoundWriteAddWrite(compoundWrite, newEmptyPath(), deepNode); - } - } - } - else ; - } - else { - throw assertionError('WriteRecord should have .snap or .children'); - } - } - } - return compoundWrite; -} -/** - * Given optional, underlying server data, and an optional set of constraints (exclude some sets, include hidden - * writes), attempt to calculate a complete snapshot for the given path - * - * @param writeIdsToExclude - An optional set to be excluded - * @param includeHiddenWrites - Defaults to false, whether or not to layer on writes with visible set to false - */ -function writeTreeCalcCompleteEventCache(writeTree, treePath, completeServerCache, writeIdsToExclude, includeHiddenWrites) { - if (!writeIdsToExclude && !includeHiddenWrites) { - var shadowingNode = compoundWriteGetCompleteNode(writeTree.visibleWrites, treePath); - if (shadowingNode != null) { - return shadowingNode; - } - else { - var subMerge = compoundWriteChildCompoundWrite(writeTree.visibleWrites, treePath); - if (compoundWriteIsEmpty(subMerge)) { - return completeServerCache; - } - else if (completeServerCache == null && - !compoundWriteHasCompleteWrite(subMerge, newEmptyPath())) { - // We wouldn't have a complete snapshot, since there's no underlying data and no complete shadow - return null; - } - else { - var layeredCache = completeServerCache || ChildrenNode.EMPTY_NODE; - return compoundWriteApply(subMerge, layeredCache); - } - } - } - else { - var merge = compoundWriteChildCompoundWrite(writeTree.visibleWrites, treePath); - if (!includeHiddenWrites && compoundWriteIsEmpty(merge)) { - return completeServerCache; - } - else { - // If the server cache is null, and we don't have a complete cache, we need to return null - if (!includeHiddenWrites && - completeServerCache == null && - !compoundWriteHasCompleteWrite(merge, newEmptyPath())) { - return null; - } - else { - var filter = function (write) { - return ((write.visible || includeHiddenWrites) && - (!writeIdsToExclude || - !~writeIdsToExclude.indexOf(write.writeId)) && - (pathContains(write.path, treePath) || - pathContains(treePath, write.path))); - }; - var mergeAtPath = writeTreeLayerTree_(writeTree.allWrites, filter, treePath); - var layeredCache = completeServerCache || ChildrenNode.EMPTY_NODE; - return compoundWriteApply(mergeAtPath, layeredCache); - } - } - } -} -/** - * With optional, underlying server data, attempt to return a children node of children that we have complete data for. - * Used when creating new views, to pre-fill their complete event children snapshot. - */ -function writeTreeCalcCompleteEventChildren(writeTree, treePath, completeServerChildren) { - var completeChildren = ChildrenNode.EMPTY_NODE; - var topLevelSet = compoundWriteGetCompleteNode(writeTree.visibleWrites, treePath); - if (topLevelSet) { - if (!topLevelSet.isLeafNode()) { - // we're shadowing everything. Return the children. - topLevelSet.forEachChild(PRIORITY_INDEX, function (childName, childSnap) { - completeChildren = completeChildren.updateImmediateChild(childName, childSnap); - }); - } - return completeChildren; - } - else if (completeServerChildren) { - // Layer any children we have on top of this - // We know we don't have a top-level set, so just enumerate existing children - var merge_1 = compoundWriteChildCompoundWrite(writeTree.visibleWrites, treePath); - completeServerChildren.forEachChild(PRIORITY_INDEX, function (childName, childNode) { - var node = compoundWriteApply(compoundWriteChildCompoundWrite(merge_1, new Path(childName)), childNode); - completeChildren = completeChildren.updateImmediateChild(childName, node); - }); - // Add any complete children we have from the set - compoundWriteGetCompleteChildren(merge_1).forEach(function (namedNode) { - completeChildren = completeChildren.updateImmediateChild(namedNode.name, namedNode.node); - }); - return completeChildren; - } - else { - // We don't have anything to layer on top of. Layer on any children we have - // Note that we can return an empty snap if we have a defined delete - var merge = compoundWriteChildCompoundWrite(writeTree.visibleWrites, treePath); - compoundWriteGetCompleteChildren(merge).forEach(function (namedNode) { - completeChildren = completeChildren.updateImmediateChild(namedNode.name, namedNode.node); - }); - return completeChildren; - } -} -/** - * Given that the underlying server data has updated, determine what, if anything, needs to be - * applied to the event cache. - * - * Possibilities: - * - * 1. No writes are shadowing. Events should be raised, the snap to be applied comes from the server data - * - * 2. Some write is completely shadowing. No events to be raised - * - * 3. Is partially shadowed. Events - * - * Either existingEventSnap or existingServerSnap must exist - */ -function writeTreeCalcEventCacheAfterServerOverwrite(writeTree, treePath, childPath, existingEventSnap, existingServerSnap) { - assert(existingEventSnap || existingServerSnap, 'Either existingEventSnap or existingServerSnap must exist'); - var path = pathChild(treePath, childPath); - if (compoundWriteHasCompleteWrite(writeTree.visibleWrites, path)) { - // At this point we can probably guarantee that we're in case 2, meaning no events - // May need to check visibility while doing the findRootMostValueAndPath call - return null; - } - else { - // No complete shadowing. We're either partially shadowing or not shadowing at all. - var childMerge = compoundWriteChildCompoundWrite(writeTree.visibleWrites, path); - if (compoundWriteIsEmpty(childMerge)) { - // We're not shadowing at all. Case 1 - return existingServerSnap.getChild(childPath); - } - else { - // This could be more efficient if the serverNode + updates doesn't change the eventSnap - // However this is tricky to find out, since user updates don't necessary change the server - // snap, e.g. priority updates on empty nodes, or deep deletes. Another special case is if the server - // adds nodes, but doesn't change any existing writes. It is therefore not enough to - // only check if the updates change the serverNode. - // Maybe check if the merge tree contains these special cases and only do a full overwrite in that case? - return compoundWriteApply(childMerge, existingServerSnap.getChild(childPath)); - } - } -} -/** - * Returns a complete child for a given server snap after applying all user writes or null if there is no - * complete child for this ChildKey. - */ -function writeTreeCalcCompleteChild(writeTree, treePath, childKey, existingServerSnap) { - var path = pathChild(treePath, childKey); - var shadowingNode = compoundWriteGetCompleteNode(writeTree.visibleWrites, path); - if (shadowingNode != null) { - return shadowingNode; - } - else { - if (existingServerSnap.isCompleteForChild(childKey)) { - var childMerge = compoundWriteChildCompoundWrite(writeTree.visibleWrites, path); - return compoundWriteApply(childMerge, existingServerSnap.getNode().getImmediateChild(childKey)); - } - else { - return null; - } - } -} -/** - * Returns a node if there is a complete overwrite for this path. More specifically, if there is a write at - * a higher path, this will return the child of that write relative to the write and this path. - * Returns null if there is no write at this path. - */ -function writeTreeShadowingWrite(writeTree, path) { - return compoundWriteGetCompleteNode(writeTree.visibleWrites, path); -} -/** - * This method is used when processing child remove events on a query. If we can, we pull in children that were outside - * the window, but may now be in the window. - */ -function writeTreeCalcIndexedSlice(writeTree, treePath, completeServerData, startPost, count, reverse, index) { - var toIterate; - var merge = compoundWriteChildCompoundWrite(writeTree.visibleWrites, treePath); - var shadowingNode = compoundWriteGetCompleteNode(merge, newEmptyPath()); - if (shadowingNode != null) { - toIterate = shadowingNode; - } - else if (completeServerData != null) { - toIterate = compoundWriteApply(merge, completeServerData); - } - else { - // no children to iterate on - return []; - } - toIterate = toIterate.withIndex(index); - if (!toIterate.isEmpty() && !toIterate.isLeafNode()) { - var nodes = []; - var cmp = index.getCompare(); - var iter = reverse - ? toIterate.getReverseIteratorFrom(startPost, index) - : toIterate.getIteratorFrom(startPost, index); - var next = iter.getNext(); - while (next && nodes.length < count) { - if (cmp(next, startPost) !== 0) { - nodes.push(next); - } - next = iter.getNext(); - } - return nodes; - } - else { - return []; - } -} -function newWriteTree() { - return { - visibleWrites: CompoundWrite.empty(), - allWrites: [], - lastWriteId: -1 - }; -} -/** - * If possible, returns a complete event cache, using the underlying server data if possible. In addition, can be used - * to get a cache that includes hidden writes, and excludes arbitrary writes. Note that customizing the returned node - * can lead to a more expensive calculation. - * - * @param writeIdsToExclude - Optional writes to exclude. - * @param includeHiddenWrites - Defaults to false, whether or not to layer on writes with visible set to false - */ -function writeTreeRefCalcCompleteEventCache(writeTreeRef, completeServerCache, writeIdsToExclude, includeHiddenWrites) { - return writeTreeCalcCompleteEventCache(writeTreeRef.writeTree, writeTreeRef.treePath, completeServerCache, writeIdsToExclude, includeHiddenWrites); -} -/** - * If possible, returns a children node containing all of the complete children we have data for. The returned data is a - * mix of the given server data and write data. - * - */ -function writeTreeRefCalcCompleteEventChildren(writeTreeRef, completeServerChildren) { - return writeTreeCalcCompleteEventChildren(writeTreeRef.writeTree, writeTreeRef.treePath, completeServerChildren); -} -/** - * Given that either the underlying server data has updated or the outstanding writes have updated, determine what, - * if anything, needs to be applied to the event cache. - * - * Possibilities: - * - * 1. No writes are shadowing. Events should be raised, the snap to be applied comes from the server data - * - * 2. Some write is completely shadowing. No events to be raised - * - * 3. Is partially shadowed. Events should be raised - * - * Either existingEventSnap or existingServerSnap must exist, this is validated via an assert - * - * - */ -function writeTreeRefCalcEventCacheAfterServerOverwrite(writeTreeRef, path, existingEventSnap, existingServerSnap) { - return writeTreeCalcEventCacheAfterServerOverwrite(writeTreeRef.writeTree, writeTreeRef.treePath, path, existingEventSnap, existingServerSnap); -} -/** - * Returns a node if there is a complete overwrite for this path. More specifically, if there is a write at - * a higher path, this will return the child of that write relative to the write and this path. - * Returns null if there is no write at this path. - * - */ -function writeTreeRefShadowingWrite(writeTreeRef, path) { - return writeTreeShadowingWrite(writeTreeRef.writeTree, pathChild(writeTreeRef.treePath, path)); -} -/** - * This method is used when processing child remove events on a query. If we can, we pull in children that were outside - * the window, but may now be in the window - */ -function writeTreeRefCalcIndexedSlice(writeTreeRef, completeServerData, startPost, count, reverse, index) { - return writeTreeCalcIndexedSlice(writeTreeRef.writeTree, writeTreeRef.treePath, completeServerData, startPost, count, reverse, index); -} -/** - * Returns a complete child for a given server snap after applying all user writes or null if there is no - * complete child for this ChildKey. - */ -function writeTreeRefCalcCompleteChild(writeTreeRef, childKey, existingServerCache) { - return writeTreeCalcCompleteChild(writeTreeRef.writeTree, writeTreeRef.treePath, childKey, existingServerCache); -} -/** - * Return a WriteTreeRef for a child. - */ -function writeTreeRefChild(writeTreeRef, childName) { - return newWriteTreeRef(pathChild(writeTreeRef.treePath, childName), writeTreeRef.writeTree); -} -function newWriteTreeRef(path, writeTree) { - return { - treePath: path, - writeTree: writeTree - }; -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var ChildChangeAccumulator = /** @class */ (function () { - function ChildChangeAccumulator() { - this.changeMap = new Map(); - } - ChildChangeAccumulator.prototype.trackChildChange = function (change) { - var type = change.type; - var childKey = change.childName; - assert(type === "child_added" /* CHILD_ADDED */ || - type === "child_changed" /* CHILD_CHANGED */ || - type === "child_removed" /* CHILD_REMOVED */, 'Only child changes supported for tracking'); - assert(childKey !== '.priority', 'Only non-priority child changes can be tracked.'); - var oldChange = this.changeMap.get(childKey); - if (oldChange) { - var oldType = oldChange.type; - if (type === "child_added" /* CHILD_ADDED */ && - oldType === "child_removed" /* CHILD_REMOVED */) { - this.changeMap.set(childKey, changeChildChanged(childKey, change.snapshotNode, oldChange.snapshotNode)); - } - else if (type === "child_removed" /* CHILD_REMOVED */ && - oldType === "child_added" /* CHILD_ADDED */) { - this.changeMap.delete(childKey); - } - else if (type === "child_removed" /* CHILD_REMOVED */ && - oldType === "child_changed" /* CHILD_CHANGED */) { - this.changeMap.set(childKey, changeChildRemoved(childKey, oldChange.oldSnap)); - } - else if (type === "child_changed" /* CHILD_CHANGED */ && - oldType === "child_added" /* CHILD_ADDED */) { - this.changeMap.set(childKey, changeChildAdded(childKey, change.snapshotNode)); - } - else if (type === "child_changed" /* CHILD_CHANGED */ && - oldType === "child_changed" /* CHILD_CHANGED */) { - this.changeMap.set(childKey, changeChildChanged(childKey, change.snapshotNode, oldChange.oldSnap)); - } - else { - throw assertionError('Illegal combination of changes: ' + - change + - ' occurred after ' + - oldChange); - } - } - else { - this.changeMap.set(childKey, change); - } - }; - ChildChangeAccumulator.prototype.getChanges = function () { - return Array.from(this.changeMap.values()); - }; - return ChildChangeAccumulator; -}()); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * An implementation of CompleteChildSource that never returns any additional children - */ -// eslint-disable-next-line @typescript-eslint/naming-convention -var NoCompleteChildSource_ = /** @class */ (function () { - function NoCompleteChildSource_() { - } - NoCompleteChildSource_.prototype.getCompleteChild = function (childKey) { - return null; - }; - NoCompleteChildSource_.prototype.getChildAfterChild = function (index, child, reverse) { - return null; - }; - return NoCompleteChildSource_; -}()); -/** - * Singleton instance. - */ -var NO_COMPLETE_CHILD_SOURCE = new NoCompleteChildSource_(); -/** - * An implementation of CompleteChildSource that uses a WriteTree in addition to any other server data or - * old event caches available to calculate complete children. - */ -var WriteTreeCompleteChildSource = /** @class */ (function () { - function WriteTreeCompleteChildSource(writes_, viewCache_, optCompleteServerCache_) { - if (optCompleteServerCache_ === void 0) { optCompleteServerCache_ = null; } - this.writes_ = writes_; - this.viewCache_ = viewCache_; - this.optCompleteServerCache_ = optCompleteServerCache_; - } - WriteTreeCompleteChildSource.prototype.getCompleteChild = function (childKey) { - var node = this.viewCache_.eventCache; - if (node.isCompleteForChild(childKey)) { - return node.getNode().getImmediateChild(childKey); - } - else { - var serverNode = this.optCompleteServerCache_ != null - ? new CacheNode(this.optCompleteServerCache_, true, false) - : this.viewCache_.serverCache; - return writeTreeRefCalcCompleteChild(this.writes_, childKey, serverNode); - } - }; - WriteTreeCompleteChildSource.prototype.getChildAfterChild = function (index, child, reverse) { - var completeServerData = this.optCompleteServerCache_ != null - ? this.optCompleteServerCache_ - : viewCacheGetCompleteServerSnap(this.viewCache_); - var nodes = writeTreeRefCalcIndexedSlice(this.writes_, completeServerData, child, 1, reverse, index); - if (nodes.length === 0) { - return null; - } - else { - return nodes[0]; - } - }; - return WriteTreeCompleteChildSource; -}()); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -function newViewProcessor(filter) { - return { filter: filter }; -} -function viewProcessorAssertIndexed(viewProcessor, viewCache) { - assert(viewCache.eventCache.getNode().isIndexed(viewProcessor.filter.getIndex()), 'Event snap not indexed'); - assert(viewCache.serverCache.getNode().isIndexed(viewProcessor.filter.getIndex()), 'Server snap not indexed'); -} -function viewProcessorApplyOperation(viewProcessor, oldViewCache, operation, writesCache, completeCache) { - var accumulator = new ChildChangeAccumulator(); - var newViewCache, filterServerNode; - if (operation.type === OperationType.OVERWRITE) { - var overwrite = operation; - if (overwrite.source.fromUser) { - newViewCache = viewProcessorApplyUserOverwrite(viewProcessor, oldViewCache, overwrite.path, overwrite.snap, writesCache, completeCache, accumulator); - } - else { - assert(overwrite.source.fromServer, 'Unknown source.'); - // We filter the node if it's a tagged update or the node has been previously filtered and the - // update is not at the root in which case it is ok (and necessary) to mark the node unfiltered - // again - filterServerNode = - overwrite.source.tagged || - (oldViewCache.serverCache.isFiltered() && !pathIsEmpty(overwrite.path)); - newViewCache = viewProcessorApplyServerOverwrite(viewProcessor, oldViewCache, overwrite.path, overwrite.snap, writesCache, completeCache, filterServerNode, accumulator); - } - } - else if (operation.type === OperationType.MERGE) { - var merge = operation; - if (merge.source.fromUser) { - newViewCache = viewProcessorApplyUserMerge(viewProcessor, oldViewCache, merge.path, merge.children, writesCache, completeCache, accumulator); - } - else { - assert(merge.source.fromServer, 'Unknown source.'); - // We filter the node if it's a tagged update or the node has been previously filtered - filterServerNode = - merge.source.tagged || oldViewCache.serverCache.isFiltered(); - newViewCache = viewProcessorApplyServerMerge(viewProcessor, oldViewCache, merge.path, merge.children, writesCache, completeCache, filterServerNode, accumulator); - } - } - else if (operation.type === OperationType.ACK_USER_WRITE) { - var ackUserWrite = operation; - if (!ackUserWrite.revert) { - newViewCache = viewProcessorAckUserWrite(viewProcessor, oldViewCache, ackUserWrite.path, ackUserWrite.affectedTree, writesCache, completeCache, accumulator); - } - else { - newViewCache = viewProcessorRevertUserWrite(viewProcessor, oldViewCache, ackUserWrite.path, writesCache, completeCache, accumulator); - } - } - else if (operation.type === OperationType.LISTEN_COMPLETE) { - newViewCache = viewProcessorListenComplete(viewProcessor, oldViewCache, operation.path, writesCache, accumulator); - } - else { - throw assertionError('Unknown operation type: ' + operation.type); - } - var changes = accumulator.getChanges(); - viewProcessorMaybeAddValueEvent(oldViewCache, newViewCache, changes); - return { viewCache: newViewCache, changes: changes }; -} -function viewProcessorMaybeAddValueEvent(oldViewCache, newViewCache, accumulator) { - var eventSnap = newViewCache.eventCache; - if (eventSnap.isFullyInitialized()) { - var isLeafOrEmpty = eventSnap.getNode().isLeafNode() || eventSnap.getNode().isEmpty(); - var oldCompleteSnap = viewCacheGetCompleteEventSnap(oldViewCache); - if (accumulator.length > 0 || - !oldViewCache.eventCache.isFullyInitialized() || - (isLeafOrEmpty && !eventSnap.getNode().equals(oldCompleteSnap)) || - !eventSnap.getNode().getPriority().equals(oldCompleteSnap.getPriority())) { - accumulator.push(changeValue(viewCacheGetCompleteEventSnap(newViewCache))); - } - } -} -function viewProcessorGenerateEventCacheAfterServerEvent(viewProcessor, viewCache, changePath, writesCache, source, accumulator) { - var oldEventSnap = viewCache.eventCache; - if (writeTreeRefShadowingWrite(writesCache, changePath) != null) { - // we have a shadowing write, ignore changes - return viewCache; - } - else { - var newEventCache = void 0, serverNode = void 0; - if (pathIsEmpty(changePath)) { - // TODO: figure out how this plays with "sliding ack windows" - assert(viewCache.serverCache.isFullyInitialized(), 'If change path is empty, we must have complete server data'); - if (viewCache.serverCache.isFiltered()) { - // We need to special case this, because we need to only apply writes to complete children, or - // we might end up raising events for incomplete children. If the server data is filtered deep - // writes cannot be guaranteed to be complete - var serverCache = viewCacheGetCompleteServerSnap(viewCache); - var completeChildren = serverCache instanceof ChildrenNode - ? serverCache - : ChildrenNode.EMPTY_NODE; - var completeEventChildren = writeTreeRefCalcCompleteEventChildren(writesCache, completeChildren); - newEventCache = viewProcessor.filter.updateFullNode(viewCache.eventCache.getNode(), completeEventChildren, accumulator); - } - else { - var completeNode = writeTreeRefCalcCompleteEventCache(writesCache, viewCacheGetCompleteServerSnap(viewCache)); - newEventCache = viewProcessor.filter.updateFullNode(viewCache.eventCache.getNode(), completeNode, accumulator); - } - } - else { - var childKey = pathGetFront(changePath); - if (childKey === '.priority') { - assert(pathGetLength(changePath) === 1, "Can't have a priority with additional path components"); - var oldEventNode = oldEventSnap.getNode(); - serverNode = viewCache.serverCache.getNode(); - // we might have overwrites for this priority - var updatedPriority = writeTreeRefCalcEventCacheAfterServerOverwrite(writesCache, changePath, oldEventNode, serverNode); - if (updatedPriority != null) { - newEventCache = viewProcessor.filter.updatePriority(oldEventNode, updatedPriority); - } - else { - // priority didn't change, keep old node - newEventCache = oldEventSnap.getNode(); - } - } - else { - var childChangePath = pathPopFront(changePath); - // update child - var newEventChild = void 0; - if (oldEventSnap.isCompleteForChild(childKey)) { - serverNode = viewCache.serverCache.getNode(); - var eventChildUpdate = writeTreeRefCalcEventCacheAfterServerOverwrite(writesCache, changePath, oldEventSnap.getNode(), serverNode); - if (eventChildUpdate != null) { - newEventChild = oldEventSnap - .getNode() - .getImmediateChild(childKey) - .updateChild(childChangePath, eventChildUpdate); - } - else { - // Nothing changed, just keep the old child - newEventChild = oldEventSnap.getNode().getImmediateChild(childKey); - } - } - else { - newEventChild = writeTreeRefCalcCompleteChild(writesCache, childKey, viewCache.serverCache); - } - if (newEventChild != null) { - newEventCache = viewProcessor.filter.updateChild(oldEventSnap.getNode(), childKey, newEventChild, childChangePath, source, accumulator); - } - else { - // no complete child available or no change - newEventCache = oldEventSnap.getNode(); - } - } - } - return viewCacheUpdateEventSnap(viewCache, newEventCache, oldEventSnap.isFullyInitialized() || pathIsEmpty(changePath), viewProcessor.filter.filtersNodes()); - } -} -function viewProcessorApplyServerOverwrite(viewProcessor, oldViewCache, changePath, changedSnap, writesCache, completeCache, filterServerNode, accumulator) { - var oldServerSnap = oldViewCache.serverCache; - var newServerCache; - var serverFilter = filterServerNode - ? viewProcessor.filter - : viewProcessor.filter.getIndexedFilter(); - if (pathIsEmpty(changePath)) { - newServerCache = serverFilter.updateFullNode(oldServerSnap.getNode(), changedSnap, null); - } - else if (serverFilter.filtersNodes() && !oldServerSnap.isFiltered()) { - // we want to filter the server node, but we didn't filter the server node yet, so simulate a full update - var newServerNode = oldServerSnap - .getNode() - .updateChild(changePath, changedSnap); - newServerCache = serverFilter.updateFullNode(oldServerSnap.getNode(), newServerNode, null); - } - else { - var childKey = pathGetFront(changePath); - if (!oldServerSnap.isCompleteForPath(changePath) && - pathGetLength(changePath) > 1) { - // We don't update incomplete nodes with updates intended for other listeners - return oldViewCache; - } - var childChangePath = pathPopFront(changePath); - var childNode = oldServerSnap.getNode().getImmediateChild(childKey); - var newChildNode = childNode.updateChild(childChangePath, changedSnap); - if (childKey === '.priority') { - newServerCache = serverFilter.updatePriority(oldServerSnap.getNode(), newChildNode); - } - else { - newServerCache = serverFilter.updateChild(oldServerSnap.getNode(), childKey, newChildNode, childChangePath, NO_COMPLETE_CHILD_SOURCE, null); - } - } - var newViewCache = viewCacheUpdateServerSnap(oldViewCache, newServerCache, oldServerSnap.isFullyInitialized() || pathIsEmpty(changePath), serverFilter.filtersNodes()); - var source = new WriteTreeCompleteChildSource(writesCache, newViewCache, completeCache); - return viewProcessorGenerateEventCacheAfterServerEvent(viewProcessor, newViewCache, changePath, writesCache, source, accumulator); -} -function viewProcessorApplyUserOverwrite(viewProcessor, oldViewCache, changePath, changedSnap, writesCache, completeCache, accumulator) { - var oldEventSnap = oldViewCache.eventCache; - var newViewCache, newEventCache; - var source = new WriteTreeCompleteChildSource(writesCache, oldViewCache, completeCache); - if (pathIsEmpty(changePath)) { - newEventCache = viewProcessor.filter.updateFullNode(oldViewCache.eventCache.getNode(), changedSnap, accumulator); - newViewCache = viewCacheUpdateEventSnap(oldViewCache, newEventCache, true, viewProcessor.filter.filtersNodes()); - } - else { - var childKey = pathGetFront(changePath); - if (childKey === '.priority') { - newEventCache = viewProcessor.filter.updatePriority(oldViewCache.eventCache.getNode(), changedSnap); - newViewCache = viewCacheUpdateEventSnap(oldViewCache, newEventCache, oldEventSnap.isFullyInitialized(), oldEventSnap.isFiltered()); - } - else { - var childChangePath = pathPopFront(changePath); - var oldChild = oldEventSnap.getNode().getImmediateChild(childKey); - var newChild = void 0; - if (pathIsEmpty(childChangePath)) { - // Child overwrite, we can replace the child - newChild = changedSnap; - } - else { - var childNode = source.getCompleteChild(childKey); - if (childNode != null) { - if (pathGetBack(childChangePath) === '.priority' && - childNode.getChild(pathParent(childChangePath)).isEmpty()) { - // This is a priority update on an empty node. If this node exists on the server, the - // server will send down the priority in the update, so ignore for now - newChild = childNode; - } - else { - newChild = childNode.updateChild(childChangePath, changedSnap); - } - } - else { - // There is no complete child node available - newChild = ChildrenNode.EMPTY_NODE; - } - } - if (!oldChild.equals(newChild)) { - var newEventSnap = viewProcessor.filter.updateChild(oldEventSnap.getNode(), childKey, newChild, childChangePath, source, accumulator); - newViewCache = viewCacheUpdateEventSnap(oldViewCache, newEventSnap, oldEventSnap.isFullyInitialized(), viewProcessor.filter.filtersNodes()); - } - else { - newViewCache = oldViewCache; - } - } - } - return newViewCache; -} -function viewProcessorCacheHasChild(viewCache, childKey) { - return viewCache.eventCache.isCompleteForChild(childKey); -} -function viewProcessorApplyUserMerge(viewProcessor, viewCache, path, changedChildren, writesCache, serverCache, accumulator) { - // HACK: In the case of a limit query, there may be some changes that bump things out of the - // window leaving room for new items. It's important we process these changes first, so we - // iterate the changes twice, first processing any that affect items currently in view. - // TODO: I consider an item "in view" if cacheHasChild is true, which checks both the server - // and event snap. I'm not sure if this will result in edge cases when a child is in one but - // not the other. - var curViewCache = viewCache; - changedChildren.foreach(function (relativePath, childNode) { - var writePath = pathChild(path, relativePath); - if (viewProcessorCacheHasChild(viewCache, pathGetFront(writePath))) { - curViewCache = viewProcessorApplyUserOverwrite(viewProcessor, curViewCache, writePath, childNode, writesCache, serverCache, accumulator); - } - }); - changedChildren.foreach(function (relativePath, childNode) { - var writePath = pathChild(path, relativePath); - if (!viewProcessorCacheHasChild(viewCache, pathGetFront(writePath))) { - curViewCache = viewProcessorApplyUserOverwrite(viewProcessor, curViewCache, writePath, childNode, writesCache, serverCache, accumulator); - } - }); - return curViewCache; -} -function viewProcessorApplyMerge(viewProcessor, node, merge) { - merge.foreach(function (relativePath, childNode) { - node = node.updateChild(relativePath, childNode); - }); - return node; -} -function viewProcessorApplyServerMerge(viewProcessor, viewCache, path, changedChildren, writesCache, serverCache, filterServerNode, accumulator) { - // If we don't have a cache yet, this merge was intended for a previously listen in the same location. Ignore it and - // wait for the complete data update coming soon. - if (viewCache.serverCache.getNode().isEmpty() && - !viewCache.serverCache.isFullyInitialized()) { - return viewCache; - } - // HACK: In the case of a limit query, there may be some changes that bump things out of the - // window leaving room for new items. It's important we process these changes first, so we - // iterate the changes twice, first processing any that affect items currently in view. - // TODO: I consider an item "in view" if cacheHasChild is true, which checks both the server - // and event snap. I'm not sure if this will result in edge cases when a child is in one but - // not the other. - var curViewCache = viewCache; - var viewMergeTree; - if (pathIsEmpty(path)) { - viewMergeTree = changedChildren; - } - else { - viewMergeTree = new ImmutableTree(null).setTree(path, changedChildren); - } - var serverNode = viewCache.serverCache.getNode(); - viewMergeTree.children.inorderTraversal(function (childKey, childTree) { - if (serverNode.hasChild(childKey)) { - var serverChild = viewCache.serverCache - .getNode() - .getImmediateChild(childKey); - var newChild = viewProcessorApplyMerge(viewProcessor, serverChild, childTree); - curViewCache = viewProcessorApplyServerOverwrite(viewProcessor, curViewCache, new Path(childKey), newChild, writesCache, serverCache, filterServerNode, accumulator); - } - }); - viewMergeTree.children.inorderTraversal(function (childKey, childMergeTree) { - var isUnknownDeepMerge = !viewCache.serverCache.isCompleteForChild(childKey) && - childMergeTree.value === null; - if (!serverNode.hasChild(childKey) && !isUnknownDeepMerge) { - var serverChild = viewCache.serverCache - .getNode() - .getImmediateChild(childKey); - var newChild = viewProcessorApplyMerge(viewProcessor, serverChild, childMergeTree); - curViewCache = viewProcessorApplyServerOverwrite(viewProcessor, curViewCache, new Path(childKey), newChild, writesCache, serverCache, filterServerNode, accumulator); - } - }); - return curViewCache; -} -function viewProcessorAckUserWrite(viewProcessor, viewCache, ackPath, affectedTree, writesCache, completeCache, accumulator) { - if (writeTreeRefShadowingWrite(writesCache, ackPath) != null) { - return viewCache; - } - // Only filter server node if it is currently filtered - var filterServerNode = viewCache.serverCache.isFiltered(); - // Essentially we'll just get our existing server cache for the affected paths and re-apply it as a server update - // now that it won't be shadowed. - var serverCache = viewCache.serverCache; - if (affectedTree.value != null) { - // This is an overwrite. - if ((pathIsEmpty(ackPath) && serverCache.isFullyInitialized()) || - serverCache.isCompleteForPath(ackPath)) { - return viewProcessorApplyServerOverwrite(viewProcessor, viewCache, ackPath, serverCache.getNode().getChild(ackPath), writesCache, completeCache, filterServerNode, accumulator); - } - else if (pathIsEmpty(ackPath)) { - // This is a goofy edge case where we are acking data at this location but don't have full data. We - // should just re-apply whatever we have in our cache as a merge. - var changedChildren_1 = new ImmutableTree(null); - serverCache.getNode().forEachChild(KEY_INDEX, function (name, node) { - changedChildren_1 = changedChildren_1.set(new Path(name), node); - }); - return viewProcessorApplyServerMerge(viewProcessor, viewCache, ackPath, changedChildren_1, writesCache, completeCache, filterServerNode, accumulator); - } - else { - return viewCache; - } - } - else { - // This is a merge. - var changedChildren_2 = new ImmutableTree(null); - affectedTree.foreach(function (mergePath, value) { - var serverCachePath = pathChild(ackPath, mergePath); - if (serverCache.isCompleteForPath(serverCachePath)) { - changedChildren_2 = changedChildren_2.set(mergePath, serverCache.getNode().getChild(serverCachePath)); - } - }); - return viewProcessorApplyServerMerge(viewProcessor, viewCache, ackPath, changedChildren_2, writesCache, completeCache, filterServerNode, accumulator); - } -} -function viewProcessorListenComplete(viewProcessor, viewCache, path, writesCache, accumulator) { - var oldServerNode = viewCache.serverCache; - var newViewCache = viewCacheUpdateServerSnap(viewCache, oldServerNode.getNode(), oldServerNode.isFullyInitialized() || pathIsEmpty(path), oldServerNode.isFiltered()); - return viewProcessorGenerateEventCacheAfterServerEvent(viewProcessor, newViewCache, path, writesCache, NO_COMPLETE_CHILD_SOURCE, accumulator); -} -function viewProcessorRevertUserWrite(viewProcessor, viewCache, path, writesCache, completeServerCache, accumulator) { - var complete; - if (writeTreeRefShadowingWrite(writesCache, path) != null) { - return viewCache; - } - else { - var source = new WriteTreeCompleteChildSource(writesCache, viewCache, completeServerCache); - var oldEventCache = viewCache.eventCache.getNode(); - var newEventCache = void 0; - if (pathIsEmpty(path) || pathGetFront(path) === '.priority') { - var newNode = void 0; - if (viewCache.serverCache.isFullyInitialized()) { - newNode = writeTreeRefCalcCompleteEventCache(writesCache, viewCacheGetCompleteServerSnap(viewCache)); - } - else { - var serverChildren = viewCache.serverCache.getNode(); - assert(serverChildren instanceof ChildrenNode, 'serverChildren would be complete if leaf node'); - newNode = writeTreeRefCalcCompleteEventChildren(writesCache, serverChildren); - } - newNode = newNode; - newEventCache = viewProcessor.filter.updateFullNode(oldEventCache, newNode, accumulator); - } - else { - var childKey = pathGetFront(path); - var newChild = writeTreeRefCalcCompleteChild(writesCache, childKey, viewCache.serverCache); - if (newChild == null && - viewCache.serverCache.isCompleteForChild(childKey)) { - newChild = oldEventCache.getImmediateChild(childKey); - } - if (newChild != null) { - newEventCache = viewProcessor.filter.updateChild(oldEventCache, childKey, newChild, pathPopFront(path), source, accumulator); - } - else if (viewCache.eventCache.getNode().hasChild(childKey)) { - // No complete child available, delete the existing one, if any - newEventCache = viewProcessor.filter.updateChild(oldEventCache, childKey, ChildrenNode.EMPTY_NODE, pathPopFront(path), source, accumulator); - } - else { - newEventCache = oldEventCache; - } - if (newEventCache.isEmpty() && - viewCache.serverCache.isFullyInitialized()) { - // We might have reverted all child writes. Maybe the old event was a leaf node - complete = writeTreeRefCalcCompleteEventCache(writesCache, viewCacheGetCompleteServerSnap(viewCache)); - if (complete.isLeafNode()) { - newEventCache = viewProcessor.filter.updateFullNode(newEventCache, complete, accumulator); - } - } - } - complete = - viewCache.serverCache.isFullyInitialized() || - writeTreeRefShadowingWrite(writesCache, newEmptyPath()) != null; - return viewCacheUpdateEventSnap(viewCache, newEventCache, complete, viewProcessor.filter.filtersNodes()); - } -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * A view represents a specific location and query that has 1 or more event registrations. - * - * It does several things: - * - Maintains the list of event registrations for this location/query. - * - Maintains a cache of the data visible for this location/query. - * - Applies new operations (via applyOperation), updates the cache, and based on the event - * registrations returns the set of events to be raised. - */ -var View = /** @class */ (function () { - function View(query_, initialViewCache) { - this.query_ = query_; - this.eventRegistrations_ = []; - var params = this.query_._queryParams; - var indexFilter = new IndexedFilter(params.getIndex()); - var filter = queryParamsGetNodeFilter(params); - this.processor_ = newViewProcessor(filter); - var initialServerCache = initialViewCache.serverCache; - var initialEventCache = initialViewCache.eventCache; - // Don't filter server node with other filter than index, wait for tagged listen - var serverSnap = indexFilter.updateFullNode(ChildrenNode.EMPTY_NODE, initialServerCache.getNode(), null); - var eventSnap = filter.updateFullNode(ChildrenNode.EMPTY_NODE, initialEventCache.getNode(), null); - var newServerCache = new CacheNode(serverSnap, initialServerCache.isFullyInitialized(), indexFilter.filtersNodes()); - var newEventCache = new CacheNode(eventSnap, initialEventCache.isFullyInitialized(), filter.filtersNodes()); - this.viewCache_ = newViewCache(newEventCache, newServerCache); - this.eventGenerator_ = new EventGenerator(this.query_); - } - Object.defineProperty(View.prototype, "query", { - get: function () { - return this.query_; - }, - enumerable: false, - configurable: true - }); - return View; -}()); -function viewGetServerCache(view) { - return view.viewCache_.serverCache.getNode(); -} -function viewGetCompleteNode(view) { - return viewCacheGetCompleteEventSnap(view.viewCache_); -} -function viewGetCompleteServerCache(view, path) { - var cache = viewCacheGetCompleteServerSnap(view.viewCache_); - if (cache) { - // If this isn't a "loadsAllData" view, then cache isn't actually a complete cache and - // we need to see if it contains the child we're interested in. - if (view.query._queryParams.loadsAllData() || - (!pathIsEmpty(path) && - !cache.getImmediateChild(pathGetFront(path)).isEmpty())) { - return cache.getChild(path); - } - } - return null; -} -function viewIsEmpty(view) { - return view.eventRegistrations_.length === 0; -} -function viewAddEventRegistration(view, eventRegistration) { - view.eventRegistrations_.push(eventRegistration); -} -/** - * @param eventRegistration - If null, remove all callbacks. - * @param cancelError - If a cancelError is provided, appropriate cancel events will be returned. - * @returns Cancel events, if cancelError was provided. - */ -function viewRemoveEventRegistration(view, eventRegistration, cancelError) { - var cancelEvents = []; - if (cancelError) { - assert(eventRegistration == null, 'A cancel should cancel all event registrations.'); - var path_1 = view.query._path; - view.eventRegistrations_.forEach(function (registration) { - var maybeEvent = registration.createCancelEvent(cancelError, path_1); - if (maybeEvent) { - cancelEvents.push(maybeEvent); - } - }); - } - if (eventRegistration) { - var remaining = []; - for (var i = 0; i < view.eventRegistrations_.length; ++i) { - var existing = view.eventRegistrations_[i]; - if (!existing.matches(eventRegistration)) { - remaining.push(existing); - } - else if (eventRegistration.hasAnyCallback()) { - // We're removing just this one - remaining = remaining.concat(view.eventRegistrations_.slice(i + 1)); - break; - } - } - view.eventRegistrations_ = remaining; - } - else { - view.eventRegistrations_ = []; - } - return cancelEvents; -} -/** - * Applies the given Operation, updates our cache, and returns the appropriate events. - */ -function viewApplyOperation(view, operation, writesCache, completeServerCache) { - if (operation.type === OperationType.MERGE && - operation.source.queryId !== null) { - assert(viewCacheGetCompleteServerSnap(view.viewCache_), 'We should always have a full cache before handling merges'); - assert(viewCacheGetCompleteEventSnap(view.viewCache_), 'Missing event cache, even though we have a server cache'); - } - var oldViewCache = view.viewCache_; - var result = viewProcessorApplyOperation(view.processor_, oldViewCache, operation, writesCache, completeServerCache); - viewProcessorAssertIndexed(view.processor_, result.viewCache); - assert(result.viewCache.serverCache.isFullyInitialized() || - !oldViewCache.serverCache.isFullyInitialized(), 'Once a server snap is complete, it should never go back'); - view.viewCache_ = result.viewCache; - return viewGenerateEventsForChanges_(view, result.changes, result.viewCache.eventCache.getNode(), null); -} -function viewGetInitialEvents(view, registration) { - var eventSnap = view.viewCache_.eventCache; - var initialChanges = []; - if (!eventSnap.getNode().isLeafNode()) { - var eventNode = eventSnap.getNode(); - eventNode.forEachChild(PRIORITY_INDEX, function (key, childNode) { - initialChanges.push(changeChildAdded(key, childNode)); - }); - } - if (eventSnap.isFullyInitialized()) { - initialChanges.push(changeValue(eventSnap.getNode())); - } - return viewGenerateEventsForChanges_(view, initialChanges, eventSnap.getNode(), registration); -} -function viewGenerateEventsForChanges_(view, changes, eventCache, eventRegistration) { - var registrations = eventRegistration - ? [eventRegistration] - : view.eventRegistrations_; - return eventGeneratorGenerateEventsForChanges(view.eventGenerator_, changes, eventCache, registrations); -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var referenceConstructor$1; -/** - * SyncPoint represents a single location in a SyncTree with 1 or more event registrations, meaning we need to - * maintain 1 or more Views at this location to cache server data and raise appropriate events for server changes - * and user writes (set, transaction, update). - * - * It's responsible for: - * - Maintaining the set of 1 or more views necessary at this location (a SyncPoint with 0 views should be removed). - * - Proxying user / server operations to the views as appropriate (i.e. applyServerOverwrite, - * applyUserOverwrite, etc.) - */ -var SyncPoint = /** @class */ (function () { - function SyncPoint() { - /** - * The Views being tracked at this location in the tree, stored as a map where the key is a - * queryId and the value is the View for that query. - * - * NOTE: This list will be quite small (usually 1, but perhaps 2 or 3; any more is an odd use case). - */ - this.views = new Map(); - } - return SyncPoint; -}()); -function syncPointSetReferenceConstructor(val) { - assert(!referenceConstructor$1, '__referenceConstructor has already been defined'); - referenceConstructor$1 = val; -} -function syncPointGetReferenceConstructor() { - assert(referenceConstructor$1, 'Reference.ts has not been loaded'); - return referenceConstructor$1; -} -function syncPointIsEmpty(syncPoint) { - return syncPoint.views.size === 0; -} -function syncPointApplyOperation(syncPoint, operation, writesCache, optCompleteServerCache) { - var e_1, _a; - var queryId = operation.source.queryId; - if (queryId !== null) { - var view = syncPoint.views.get(queryId); - assert(view != null, 'SyncTree gave us an op for an invalid query.'); - return viewApplyOperation(view, operation, writesCache, optCompleteServerCache); - } - else { - var events = []; - try { - for (var _b = __values(syncPoint.views.values()), _c = _b.next(); !_c.done; _c = _b.next()) { - var view = _c.value; - events = events.concat(viewApplyOperation(view, operation, writesCache, optCompleteServerCache)); - } - } - catch (e_1_1) { e_1 = { error: e_1_1 }; } - finally { - try { - if (_c && !_c.done && (_a = _b.return)) _a.call(_b); - } - finally { if (e_1) throw e_1.error; } - } - return events; - } -} -/** - * Get a view for the specified query. - * - * @param query - The query to return a view for - * @param writesCache - * @param serverCache - * @param serverCacheComplete - * @returns Events to raise. - */ -function syncPointGetView(syncPoint, query, writesCache, serverCache, serverCacheComplete) { - var queryId = query._queryIdentifier; - var view = syncPoint.views.get(queryId); - if (!view) { - // TODO: make writesCache take flag for complete server node - var eventCache = writeTreeRefCalcCompleteEventCache(writesCache, serverCacheComplete ? serverCache : null); - var eventCacheComplete = false; - if (eventCache) { - eventCacheComplete = true; - } - else if (serverCache instanceof ChildrenNode) { - eventCache = writeTreeRefCalcCompleteEventChildren(writesCache, serverCache); - eventCacheComplete = false; - } - else { - eventCache = ChildrenNode.EMPTY_NODE; - eventCacheComplete = false; - } - var viewCache = newViewCache(new CacheNode(eventCache, eventCacheComplete, false), new CacheNode(serverCache, serverCacheComplete, false)); - return new View(query, viewCache); - } - return view; -} -/** - * Add an event callback for the specified query. - * - * @param query - * @param eventRegistration - * @param writesCache - * @param serverCache - Complete server cache, if we have it. - * @param serverCacheComplete - * @returns Events to raise. - */ -function syncPointAddEventRegistration(syncPoint, query, eventRegistration, writesCache, serverCache, serverCacheComplete) { - var view = syncPointGetView(syncPoint, query, writesCache, serverCache, serverCacheComplete); - if (!syncPoint.views.has(query._queryIdentifier)) { - syncPoint.views.set(query._queryIdentifier, view); - } - // This is guaranteed to exist now, we just created anything that was missing - viewAddEventRegistration(view, eventRegistration); - return viewGetInitialEvents(view, eventRegistration); -} -/** - * Remove event callback(s). Return cancelEvents if a cancelError is specified. - * - * If query is the default query, we'll check all views for the specified eventRegistration. - * If eventRegistration is null, we'll remove all callbacks for the specified view(s). - * - * @param eventRegistration - If null, remove all callbacks. - * @param cancelError - If a cancelError is provided, appropriate cancel events will be returned. - * @returns removed queries and any cancel events - */ -function syncPointRemoveEventRegistration(syncPoint, query, eventRegistration, cancelError) { - var e_2, _a; - var queryId = query._queryIdentifier; - var removed = []; - var cancelEvents = []; - var hadCompleteView = syncPointHasCompleteView(syncPoint); - if (queryId === 'default') { - try { - // When you do ref.off(...), we search all views for the registration to remove. - for (var _b = __values(syncPoint.views.entries()), _c = _b.next(); !_c.done; _c = _b.next()) { - var _d = __read(_c.value, 2), viewQueryId = _d[0], view = _d[1]; - cancelEvents = cancelEvents.concat(viewRemoveEventRegistration(view, eventRegistration, cancelError)); - if (viewIsEmpty(view)) { - syncPoint.views.delete(viewQueryId); - // We'll deal with complete views later. - if (!view.query._queryParams.loadsAllData()) { - removed.push(view.query); - } - } - } - } - catch (e_2_1) { e_2 = { error: e_2_1 }; } - finally { - try { - if (_c && !_c.done && (_a = _b.return)) _a.call(_b); - } - finally { if (e_2) throw e_2.error; } - } - } - else { - // remove the callback from the specific view. - var view = syncPoint.views.get(queryId); - if (view) { - cancelEvents = cancelEvents.concat(viewRemoveEventRegistration(view, eventRegistration, cancelError)); - if (viewIsEmpty(view)) { - syncPoint.views.delete(queryId); - // We'll deal with complete views later. - if (!view.query._queryParams.loadsAllData()) { - removed.push(view.query); - } - } - } - } - if (hadCompleteView && !syncPointHasCompleteView(syncPoint)) { - // We removed our last complete view. - removed.push(new (syncPointGetReferenceConstructor())(query._repo, query._path)); - } - return { removed: removed, events: cancelEvents }; -} -function syncPointGetQueryViews(syncPoint) { - var e_3, _a; - var result = []; - try { - for (var _b = __values(syncPoint.views.values()), _c = _b.next(); !_c.done; _c = _b.next()) { - var view = _c.value; - if (!view.query._queryParams.loadsAllData()) { - result.push(view); - } - } - } - catch (e_3_1) { e_3 = { error: e_3_1 }; } - finally { - try { - if (_c && !_c.done && (_a = _b.return)) _a.call(_b); - } - finally { if (e_3) throw e_3.error; } - } - return result; -} -/** - * @param path - The path to the desired complete snapshot - * @returns A complete cache, if it exists - */ -function syncPointGetCompleteServerCache(syncPoint, path) { - var e_4, _a; - var serverCache = null; - try { - for (var _b = __values(syncPoint.views.values()), _c = _b.next(); !_c.done; _c = _b.next()) { - var view = _c.value; - serverCache = serverCache || viewGetCompleteServerCache(view, path); - } - } - catch (e_4_1) { e_4 = { error: e_4_1 }; } - finally { - try { - if (_c && !_c.done && (_a = _b.return)) _a.call(_b); - } - finally { if (e_4) throw e_4.error; } - } - return serverCache; -} -function syncPointViewForQuery(syncPoint, query) { - var params = query._queryParams; - if (params.loadsAllData()) { - return syncPointGetCompleteView(syncPoint); - } - else { - var queryId = query._queryIdentifier; - return syncPoint.views.get(queryId); - } -} -function syncPointViewExistsForQuery(syncPoint, query) { - return syncPointViewForQuery(syncPoint, query) != null; -} -function syncPointHasCompleteView(syncPoint) { - return syncPointGetCompleteView(syncPoint) != null; -} -function syncPointGetCompleteView(syncPoint) { - var e_5, _a; - try { - for (var _b = __values(syncPoint.views.values()), _c = _b.next(); !_c.done; _c = _b.next()) { - var view = _c.value; - if (view.query._queryParams.loadsAllData()) { - return view; - } - } - } - catch (e_5_1) { e_5 = { error: e_5_1 }; } - finally { - try { - if (_c && !_c.done && (_a = _b.return)) _a.call(_b); - } - finally { if (e_5) throw e_5.error; } - } - return null; -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var referenceConstructor; -function syncTreeSetReferenceConstructor(val) { - assert(!referenceConstructor, '__referenceConstructor has already been defined'); - referenceConstructor = val; -} -function syncTreeGetReferenceConstructor() { - assert(referenceConstructor, 'Reference.ts has not been loaded'); - return referenceConstructor; -} -/** - * Static tracker for next query tag. - */ -var syncTreeNextQueryTag_ = 1; -/** - * SyncTree is the central class for managing event callback registration, data caching, views - * (query processing), and event generation. There are typically two SyncTree instances for - * each Repo, one for the normal Firebase data, and one for the .info data. - * - * It has a number of responsibilities, including: - * - Tracking all user event callbacks (registered via addEventRegistration() and removeEventRegistration()). - * - Applying and caching data changes for user set(), transaction(), and update() calls - * (applyUserOverwrite(), applyUserMerge()). - * - Applying and caching data changes for server data changes (applyServerOverwrite(), - * applyServerMerge()). - * - Generating user-facing events for server and user changes (all of the apply* methods - * return the set of events that need to be raised as a result). - * - Maintaining the appropriate set of server listens to ensure we are always subscribed - * to the correct set of paths and queries to satisfy the current set of user event - * callbacks (listens are started/stopped using the provided listenProvider). - * - * NOTE: Although SyncTree tracks event callbacks and calculates events to raise, the actual - * events are returned to the caller rather than raised synchronously. - * - */ -var SyncTree = /** @class */ (function () { - /** - * @param listenProvider_ - Used by SyncTree to start / stop listening - * to server data. - */ - function SyncTree(listenProvider_) { - this.listenProvider_ = listenProvider_; - /** - * Tree of SyncPoints. There's a SyncPoint at any location that has 1 or more views. - */ - this.syncPointTree_ = new ImmutableTree(null); - /** - * A tree of all pending user writes (user-initiated set()'s, transaction()'s, update()'s, etc.). - */ - this.pendingWriteTree_ = newWriteTree(); - this.tagToQueryMap = new Map(); - this.queryToTagMap = new Map(); - } - return SyncTree; -}()); -/** - * Apply the data changes for a user-generated set() or transaction() call. - * - * @returns Events to raise. - */ -function syncTreeApplyUserOverwrite(syncTree, path, newData, writeId, visible) { - // Record pending write. - writeTreeAddOverwrite(syncTree.pendingWriteTree_, path, newData, writeId, visible); - if (!visible) { - return []; - } - else { - return syncTreeApplyOperationToSyncPoints_(syncTree, new Overwrite(newOperationSourceUser(), path, newData)); - } -} -/** - * Apply the data from a user-generated update() call - * - * @returns Events to raise. - */ -function syncTreeApplyUserMerge(syncTree, path, changedChildren, writeId) { - // Record pending merge. - writeTreeAddMerge(syncTree.pendingWriteTree_, path, changedChildren, writeId); - var changeTree = ImmutableTree.fromObject(changedChildren); - return syncTreeApplyOperationToSyncPoints_(syncTree, new Merge(newOperationSourceUser(), path, changeTree)); -} -/** - * Acknowledge a pending user write that was previously registered with applyUserOverwrite() or applyUserMerge(). - * - * @param revert - True if the given write failed and needs to be reverted - * @returns Events to raise. - */ -function syncTreeAckUserWrite(syncTree, writeId, revert) { - if (revert === void 0) { revert = false; } - var write = writeTreeGetWrite(syncTree.pendingWriteTree_, writeId); - var needToReevaluate = writeTreeRemoveWrite(syncTree.pendingWriteTree_, writeId); - if (!needToReevaluate) { - return []; - } - else { - var affectedTree_1 = new ImmutableTree(null); - if (write.snap != null) { - // overwrite - affectedTree_1 = affectedTree_1.set(newEmptyPath(), true); - } - else { - each(write.children, function (pathString) { - affectedTree_1 = affectedTree_1.set(new Path(pathString), true); - }); - } - return syncTreeApplyOperationToSyncPoints_(syncTree, new AckUserWrite(write.path, affectedTree_1, revert)); - } -} -/** - * Apply new server data for the specified path.. - * - * @returns Events to raise. - */ -function syncTreeApplyServerOverwrite(syncTree, path, newData) { - return syncTreeApplyOperationToSyncPoints_(syncTree, new Overwrite(newOperationSourceServer(), path, newData)); -} -/** - * Apply new server data to be merged in at the specified path. - * - * @returns Events to raise. - */ -function syncTreeApplyServerMerge(syncTree, path, changedChildren) { - var changeTree = ImmutableTree.fromObject(changedChildren); - return syncTreeApplyOperationToSyncPoints_(syncTree, new Merge(newOperationSourceServer(), path, changeTree)); -} -/** - * Apply a listen complete for a query - * - * @returns Events to raise. - */ -function syncTreeApplyListenComplete(syncTree, path) { - return syncTreeApplyOperationToSyncPoints_(syncTree, new ListenComplete(newOperationSourceServer(), path)); -} -/** - * Apply a listen complete for a tagged query - * - * @returns Events to raise. - */ -function syncTreeApplyTaggedListenComplete(syncTree, path, tag) { - var queryKey = syncTreeQueryKeyForTag_(syncTree, tag); - if (queryKey) { - var r = syncTreeParseQueryKey_(queryKey); - var queryPath = r.path, queryId = r.queryId; - var relativePath = newRelativePath(queryPath, path); - var op = new ListenComplete(newOperationSourceServerTaggedQuery(queryId), relativePath); - return syncTreeApplyTaggedOperation_(syncTree, queryPath, op); - } - else { - // We've already removed the query. No big deal, ignore the update - return []; - } -} -/** - * Remove event callback(s). - * - * If query is the default query, we'll check all queries for the specified eventRegistration. - * If eventRegistration is null, we'll remove all callbacks for the specified query/queries. - * - * @param eventRegistration - If null, all callbacks are removed. - * @param cancelError - If a cancelError is provided, appropriate cancel events will be returned. - * @param skipListenerDedup - When performing a `get()`, we don't add any new listeners, so no - * deduping needs to take place. This flag allows toggling of that behavior - * @returns Cancel events, if cancelError was provided. - */ -function syncTreeRemoveEventRegistration(syncTree, query, eventRegistration, cancelError, skipListenerDedup) { - if (skipListenerDedup === void 0) { skipListenerDedup = false; } - // Find the syncPoint first. Then deal with whether or not it has matching listeners - var path = query._path; - var maybeSyncPoint = syncTree.syncPointTree_.get(path); - var cancelEvents = []; - // A removal on a default query affects all queries at that location. A removal on an indexed query, even one without - // other query constraints, does *not* affect all queries at that location. So this check must be for 'default', and - // not loadsAllData(). - if (maybeSyncPoint && - (query._queryIdentifier === 'default' || - syncPointViewExistsForQuery(maybeSyncPoint, query))) { - var removedAndEvents = syncPointRemoveEventRegistration(maybeSyncPoint, query, eventRegistration, cancelError); - if (syncPointIsEmpty(maybeSyncPoint)) { - syncTree.syncPointTree_ = syncTree.syncPointTree_.remove(path); - } - var removed = removedAndEvents.removed; - cancelEvents = removedAndEvents.events; - if (!skipListenerDedup) { - /** - * We may have just removed one of many listeners and can short-circuit this whole process - * We may also not have removed a default listener, in which case all of the descendant listeners should already be - * properly set up. - */ - // Since indexed queries can shadow if they don't have other query constraints, check for loadsAllData(), instead of - // queryId === 'default' - var removingDefault = -1 !== - removed.findIndex(function (query) { - return query._queryParams.loadsAllData(); - }); - var covered = syncTree.syncPointTree_.findOnPath(path, function (relativePath, parentSyncPoint) { - return syncPointHasCompleteView(parentSyncPoint); - }); - if (removingDefault && !covered) { - var subtree = syncTree.syncPointTree_.subtree(path); - // There are potentially child listeners. Determine what if any listens we need to send before executing the - // removal - if (!subtree.isEmpty()) { - // We need to fold over our subtree and collect the listeners to send - var newViews = syncTreeCollectDistinctViewsForSubTree_(subtree); - // Ok, we've collected all the listens we need. Set them up. - for (var i = 0; i < newViews.length; ++i) { - var view = newViews[i], newQuery = view.query; - var listener = syncTreeCreateListenerForView_(syncTree, view); - syncTree.listenProvider_.startListening(syncTreeQueryForListening_(newQuery), syncTreeTagForQuery(syncTree, newQuery), listener.hashFn, listener.onComplete); - } - } - // Otherwise there's nothing below us, so nothing we need to start listening on - } - // If we removed anything and we're not covered by a higher up listen, we need to stop listening on this query - // The above block has us covered in terms of making sure we're set up on listens lower in the tree. - // Also, note that if we have a cancelError, it's already been removed at the provider level. - if (!covered && removed.length > 0 && !cancelError) { - // If we removed a default, then we weren't listening on any of the other queries here. Just cancel the one - // default. Otherwise, we need to iterate through and cancel each individual query - if (removingDefault) { - // We don't tag default listeners - var defaultTag = null; - syncTree.listenProvider_.stopListening(syncTreeQueryForListening_(query), defaultTag); - } - else { - removed.forEach(function (queryToRemove) { - var tagToRemove = syncTree.queryToTagMap.get(syncTreeMakeQueryKey_(queryToRemove)); - syncTree.listenProvider_.stopListening(syncTreeQueryForListening_(queryToRemove), tagToRemove); - }); - } - } - } - // Now, clear all of the tags we're tracking for the removed listens - syncTreeRemoveTags_(syncTree, removed); - } - return cancelEvents; -} -/** - * Apply new server data for the specified tagged query. - * - * @returns Events to raise. - */ -function syncTreeApplyTaggedQueryOverwrite(syncTree, path, snap, tag) { - var queryKey = syncTreeQueryKeyForTag_(syncTree, tag); - if (queryKey != null) { - var r = syncTreeParseQueryKey_(queryKey); - var queryPath = r.path, queryId = r.queryId; - var relativePath = newRelativePath(queryPath, path); - var op = new Overwrite(newOperationSourceServerTaggedQuery(queryId), relativePath, snap); - return syncTreeApplyTaggedOperation_(syncTree, queryPath, op); - } - else { - // Query must have been removed already - return []; - } -} -/** - * Apply server data to be merged in for the specified tagged query. - * - * @returns Events to raise. - */ -function syncTreeApplyTaggedQueryMerge(syncTree, path, changedChildren, tag) { - var queryKey = syncTreeQueryKeyForTag_(syncTree, tag); - if (queryKey) { - var r = syncTreeParseQueryKey_(queryKey); - var queryPath = r.path, queryId = r.queryId; - var relativePath = newRelativePath(queryPath, path); - var changeTree = ImmutableTree.fromObject(changedChildren); - var op = new Merge(newOperationSourceServerTaggedQuery(queryId), relativePath, changeTree); - return syncTreeApplyTaggedOperation_(syncTree, queryPath, op); - } - else { - // We've already removed the query. No big deal, ignore the update - return []; - } -} -/** - * Add an event callback for the specified query. - * - * @returns Events to raise. - */ -function syncTreeAddEventRegistration(syncTree, query, eventRegistration, skipSetupListener) { - if (skipSetupListener === void 0) { skipSetupListener = false; } - var path = query._path; - var serverCache = null; - var foundAncestorDefaultView = false; - // Any covering writes will necessarily be at the root, so really all we need to find is the server cache. - // Consider optimizing this once there's a better understanding of what actual behavior will be. - syncTree.syncPointTree_.foreachOnPath(path, function (pathToSyncPoint, sp) { - var relativePath = newRelativePath(pathToSyncPoint, path); - serverCache = - serverCache || syncPointGetCompleteServerCache(sp, relativePath); - foundAncestorDefaultView = - foundAncestorDefaultView || syncPointHasCompleteView(sp); - }); - var syncPoint = syncTree.syncPointTree_.get(path); - if (!syncPoint) { - syncPoint = new SyncPoint(); - syncTree.syncPointTree_ = syncTree.syncPointTree_.set(path, syncPoint); - } - else { - foundAncestorDefaultView = - foundAncestorDefaultView || syncPointHasCompleteView(syncPoint); - serverCache = - serverCache || syncPointGetCompleteServerCache(syncPoint, newEmptyPath()); - } - var serverCacheComplete; - if (serverCache != null) { - serverCacheComplete = true; - } - else { - serverCacheComplete = false; - serverCache = ChildrenNode.EMPTY_NODE; - var subtree = syncTree.syncPointTree_.subtree(path); - subtree.foreachChild(function (childName, childSyncPoint) { - var completeCache = syncPointGetCompleteServerCache(childSyncPoint, newEmptyPath()); - if (completeCache) { - serverCache = serverCache.updateImmediateChild(childName, completeCache); - } - }); - } - var viewAlreadyExists = syncPointViewExistsForQuery(syncPoint, query); - if (!viewAlreadyExists && !query._queryParams.loadsAllData()) { - // We need to track a tag for this query - var queryKey = syncTreeMakeQueryKey_(query); - assert(!syncTree.queryToTagMap.has(queryKey), 'View does not exist, but we have a tag'); - var tag = syncTreeGetNextQueryTag_(); - syncTree.queryToTagMap.set(queryKey, tag); - syncTree.tagToQueryMap.set(tag, queryKey); - } - var writesCache = writeTreeChildWrites(syncTree.pendingWriteTree_, path); - var events = syncPointAddEventRegistration(syncPoint, query, eventRegistration, writesCache, serverCache, serverCacheComplete); - if (!viewAlreadyExists && !foundAncestorDefaultView && !skipSetupListener) { - var view = syncPointViewForQuery(syncPoint, query); - events = events.concat(syncTreeSetupListener_(syncTree, query, view)); - } - return events; -} -/** - * Returns a complete cache, if we have one, of the data at a particular path. If the location does not have a - * listener above it, we will get a false "null". This shouldn't be a problem because transactions will always - * have a listener above, and atomic operations would correctly show a jitter of -> - * as the write is applied locally and then acknowledged at the server. - * - * Note: this method will *include* hidden writes from transaction with applyLocally set to false. - * - * @param path - The path to the data we want - * @param writeIdsToExclude - A specific set to be excluded - */ -function syncTreeCalcCompleteEventCache(syncTree, path, writeIdsToExclude) { - var includeHiddenSets = true; - var writeTree = syncTree.pendingWriteTree_; - var serverCache = syncTree.syncPointTree_.findOnPath(path, function (pathSoFar, syncPoint) { - var relativePath = newRelativePath(pathSoFar, path); - var serverCache = syncPointGetCompleteServerCache(syncPoint, relativePath); - if (serverCache) { - return serverCache; - } - }); - return writeTreeCalcCompleteEventCache(writeTree, path, serverCache, writeIdsToExclude, includeHiddenSets); -} -function syncTreeGetServerValue(syncTree, query) { - var path = query._path; - var serverCache = null; - // Any covering writes will necessarily be at the root, so really all we need to find is the server cache. - // Consider optimizing this once there's a better understanding of what actual behavior will be. - syncTree.syncPointTree_.foreachOnPath(path, function (pathToSyncPoint, sp) { - var relativePath = newRelativePath(pathToSyncPoint, path); - serverCache = - serverCache || syncPointGetCompleteServerCache(sp, relativePath); - }); - var syncPoint = syncTree.syncPointTree_.get(path); - if (!syncPoint) { - syncPoint = new SyncPoint(); - syncTree.syncPointTree_ = syncTree.syncPointTree_.set(path, syncPoint); - } - else { - serverCache = - serverCache || syncPointGetCompleteServerCache(syncPoint, newEmptyPath()); - } - var serverCacheComplete = serverCache != null; - var serverCacheNode = serverCacheComplete - ? new CacheNode(serverCache, true, false) - : null; - var writesCache = writeTreeChildWrites(syncTree.pendingWriteTree_, query._path); - var view = syncPointGetView(syncPoint, query, writesCache, serverCacheComplete ? serverCacheNode.getNode() : ChildrenNode.EMPTY_NODE, serverCacheComplete); - return viewGetCompleteNode(view); -} -/** - * A helper method that visits all descendant and ancestor SyncPoints, applying the operation. - * - * NOTES: - * - Descendant SyncPoints will be visited first (since we raise events depth-first). - * - * - We call applyOperation() on each SyncPoint passing three things: - * 1. A version of the Operation that has been made relative to the SyncPoint location. - * 2. A WriteTreeRef of any writes we have cached at the SyncPoint location. - * 3. A snapshot Node with cached server data, if we have it. - * - * - We concatenate all of the events returned by each SyncPoint and return the result. - */ -function syncTreeApplyOperationToSyncPoints_(syncTree, operation) { - return syncTreeApplyOperationHelper_(operation, syncTree.syncPointTree_, - /*serverCache=*/ null, writeTreeChildWrites(syncTree.pendingWriteTree_, newEmptyPath())); -} -/** - * Recursive helper for applyOperationToSyncPoints_ - */ -function syncTreeApplyOperationHelper_(operation, syncPointTree, serverCache, writesCache) { - if (pathIsEmpty(operation.path)) { - return syncTreeApplyOperationDescendantsHelper_(operation, syncPointTree, serverCache, writesCache); - } - else { - var syncPoint = syncPointTree.get(newEmptyPath()); - // If we don't have cached server data, see if we can get it from this SyncPoint. - if (serverCache == null && syncPoint != null) { - serverCache = syncPointGetCompleteServerCache(syncPoint, newEmptyPath()); - } - var events = []; - var childName = pathGetFront(operation.path); - var childOperation = operation.operationForChild(childName); - var childTree = syncPointTree.children.get(childName); - if (childTree && childOperation) { - var childServerCache = serverCache - ? serverCache.getImmediateChild(childName) - : null; - var childWritesCache = writeTreeRefChild(writesCache, childName); - events = events.concat(syncTreeApplyOperationHelper_(childOperation, childTree, childServerCache, childWritesCache)); - } - if (syncPoint) { - events = events.concat(syncPointApplyOperation(syncPoint, operation, writesCache, serverCache)); - } - return events; - } -} -/** - * Recursive helper for applyOperationToSyncPoints_ - */ -function syncTreeApplyOperationDescendantsHelper_(operation, syncPointTree, serverCache, writesCache) { - var syncPoint = syncPointTree.get(newEmptyPath()); - // If we don't have cached server data, see if we can get it from this SyncPoint. - if (serverCache == null && syncPoint != null) { - serverCache = syncPointGetCompleteServerCache(syncPoint, newEmptyPath()); - } - var events = []; - syncPointTree.children.inorderTraversal(function (childName, childTree) { - var childServerCache = serverCache - ? serverCache.getImmediateChild(childName) - : null; - var childWritesCache = writeTreeRefChild(writesCache, childName); - var childOperation = operation.operationForChild(childName); - if (childOperation) { - events = events.concat(syncTreeApplyOperationDescendantsHelper_(childOperation, childTree, childServerCache, childWritesCache)); - } - }); - if (syncPoint) { - events = events.concat(syncPointApplyOperation(syncPoint, operation, writesCache, serverCache)); - } - return events; -} -function syncTreeCreateListenerForView_(syncTree, view) { - var query = view.query; - var tag = syncTreeTagForQuery(syncTree, query); - return { - hashFn: function () { - var cache = viewGetServerCache(view) || ChildrenNode.EMPTY_NODE; - return cache.hash(); - }, - onComplete: function (status) { - if (status === 'ok') { - if (tag) { - return syncTreeApplyTaggedListenComplete(syncTree, query._path, tag); - } - else { - return syncTreeApplyListenComplete(syncTree, query._path); - } - } - else { - // If a listen failed, kill all of the listeners here, not just the one that triggered the error. - // Note that this may need to be scoped to just this listener if we change permissions on filtered children - var error = errorForServerCode(status, query); - return syncTreeRemoveEventRegistration(syncTree, query, - /*eventRegistration*/ null, error); - } - } - }; -} -/** - * Return the tag associated with the given query. - */ -function syncTreeTagForQuery(syncTree, query) { - var queryKey = syncTreeMakeQueryKey_(query); - return syncTree.queryToTagMap.get(queryKey); -} -/** - * Given a query, computes a "queryKey" suitable for use in our queryToTagMap_. - */ -function syncTreeMakeQueryKey_(query) { - return query._path.toString() + '$' + query._queryIdentifier; -} -/** - * Return the query associated with the given tag, if we have one - */ -function syncTreeQueryKeyForTag_(syncTree, tag) { - return syncTree.tagToQueryMap.get(tag); -} -/** - * Given a queryKey (created by makeQueryKey), parse it back into a path and queryId. - */ -function syncTreeParseQueryKey_(queryKey) { - var splitIndex = queryKey.indexOf('$'); - assert(splitIndex !== -1 && splitIndex < queryKey.length - 1, 'Bad queryKey.'); - return { - queryId: queryKey.substr(splitIndex + 1), - path: new Path(queryKey.substr(0, splitIndex)) - }; -} -/** - * A helper method to apply tagged operations - */ -function syncTreeApplyTaggedOperation_(syncTree, queryPath, operation) { - var syncPoint = syncTree.syncPointTree_.get(queryPath); - assert(syncPoint, "Missing sync point for query tag that we're tracking"); - var writesCache = writeTreeChildWrites(syncTree.pendingWriteTree_, queryPath); - return syncPointApplyOperation(syncPoint, operation, writesCache, null); -} -/** - * This collapses multiple unfiltered views into a single view, since we only need a single - * listener for them. - */ -function syncTreeCollectDistinctViewsForSubTree_(subtree) { - return subtree.fold(function (relativePath, maybeChildSyncPoint, childMap) { - if (maybeChildSyncPoint && syncPointHasCompleteView(maybeChildSyncPoint)) { - var completeView = syncPointGetCompleteView(maybeChildSyncPoint); - return [completeView]; - } - else { - // No complete view here, flatten any deeper listens into an array - var views_1 = []; - if (maybeChildSyncPoint) { - views_1 = syncPointGetQueryViews(maybeChildSyncPoint); - } - each(childMap, function (_key, childViews) { - views_1 = views_1.concat(childViews); - }); - return views_1; - } - }); -} -/** - * Normalizes a query to a query we send the server for listening - * - * @returns The normalized query - */ -function syncTreeQueryForListening_(query) { - if (query._queryParams.loadsAllData() && !query._queryParams.isDefault()) { - // We treat queries that load all data as default queries - // Cast is necessary because ref() technically returns Firebase which is actually fb.api.Firebase which inherits - // from Query - return new (syncTreeGetReferenceConstructor())(query._repo, query._path); - } - else { - return query; - } -} -function syncTreeRemoveTags_(syncTree, queries) { - for (var j = 0; j < queries.length; ++j) { - var removedQuery = queries[j]; - if (!removedQuery._queryParams.loadsAllData()) { - // We should have a tag for this - var removedQueryKey = syncTreeMakeQueryKey_(removedQuery); - var removedQueryTag = syncTree.queryToTagMap.get(removedQueryKey); - syncTree.queryToTagMap.delete(removedQueryKey); - syncTree.tagToQueryMap.delete(removedQueryTag); - } - } -} -/** - * Static accessor for query tags. - */ -function syncTreeGetNextQueryTag_() { - return syncTreeNextQueryTag_++; -} -/** - * For a given new listen, manage the de-duplication of outstanding subscriptions. - * - * @returns This method can return events to support synchronous data sources - */ -function syncTreeSetupListener_(syncTree, query, view) { - var path = query._path; - var tag = syncTreeTagForQuery(syncTree, query); - var listener = syncTreeCreateListenerForView_(syncTree, view); - var events = syncTree.listenProvider_.startListening(syncTreeQueryForListening_(query), tag, listener.hashFn, listener.onComplete); - var subtree = syncTree.syncPointTree_.subtree(path); - // The root of this subtree has our query. We're here because we definitely need to send a listen for that, but we - // may need to shadow other listens as well. - if (tag) { - assert(!syncPointHasCompleteView(subtree.value), "If we're adding a query, it shouldn't be shadowed"); - } - else { - // Shadow everything at or below this location, this is a default listener. - var queriesToStop = subtree.fold(function (relativePath, maybeChildSyncPoint, childMap) { - if (!pathIsEmpty(relativePath) && - maybeChildSyncPoint && - syncPointHasCompleteView(maybeChildSyncPoint)) { - return [syncPointGetCompleteView(maybeChildSyncPoint).query]; - } - else { - // No default listener here, flatten any deeper queries into an array - var queries_1 = []; - if (maybeChildSyncPoint) { - queries_1 = queries_1.concat(syncPointGetQueryViews(maybeChildSyncPoint).map(function (view) { return view.query; })); - } - each(childMap, function (_key, childQueries) { - queries_1 = queries_1.concat(childQueries); - }); - return queries_1; - } - }); - for (var i = 0; i < queriesToStop.length; ++i) { - var queryToStop = queriesToStop[i]; - syncTree.listenProvider_.stopListening(syncTreeQueryForListening_(queryToStop), syncTreeTagForQuery(syncTree, queryToStop)); - } - } - return events; -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var ExistingValueProvider = /** @class */ (function () { - function ExistingValueProvider(node_) { - this.node_ = node_; - } - ExistingValueProvider.prototype.getImmediateChild = function (childName) { - var child = this.node_.getImmediateChild(childName); - return new ExistingValueProvider(child); - }; - ExistingValueProvider.prototype.node = function () { - return this.node_; - }; - return ExistingValueProvider; -}()); -var DeferredValueProvider = /** @class */ (function () { - function DeferredValueProvider(syncTree, path) { - this.syncTree_ = syncTree; - this.path_ = path; - } - DeferredValueProvider.prototype.getImmediateChild = function (childName) { - var childPath = pathChild(this.path_, childName); - return new DeferredValueProvider(this.syncTree_, childPath); - }; - DeferredValueProvider.prototype.node = function () { - return syncTreeCalcCompleteEventCache(this.syncTree_, this.path_); - }; - return DeferredValueProvider; -}()); -/** - * Generate placeholders for deferred values. - */ -var generateWithValues = function (values) { - values = values || {}; - values['timestamp'] = values['timestamp'] || new Date().getTime(); - return values; -}; -/** - * Value to use when firing local events. When writing server values, fire - * local events with an approximate value, otherwise return value as-is. - */ -var resolveDeferredLeafValue = function (value, existingVal, serverValues) { - if (!value || typeof value !== 'object') { - return value; - } - assert('.sv' in value, 'Unexpected leaf node or priority contents'); - if (typeof value['.sv'] === 'string') { - return resolveScalarDeferredValue(value['.sv'], existingVal, serverValues); - } - else if (typeof value['.sv'] === 'object') { - return resolveComplexDeferredValue(value['.sv'], existingVal); - } - else { - assert(false, 'Unexpected server value: ' + JSON.stringify(value, null, 2)); - } -}; -var resolveScalarDeferredValue = function (op, existing, serverValues) { - switch (op) { - case 'timestamp': - return serverValues['timestamp']; - default: - assert(false, 'Unexpected server value: ' + op); - } -}; -var resolveComplexDeferredValue = function (op, existing, unused) { - if (!op.hasOwnProperty('increment')) { - assert(false, 'Unexpected server value: ' + JSON.stringify(op, null, 2)); - } - var delta = op['increment']; - if (typeof delta !== 'number') { - assert(false, 'Unexpected increment value: ' + delta); - } - var existingNode = existing.node(); - assert(existingNode !== null && typeof existingNode !== 'undefined', 'Expected ChildrenNode.EMPTY_NODE for nulls'); - // Incrementing a non-number sets the value to the incremented amount - if (!existingNode.isLeafNode()) { - return delta; - } - var leaf = existingNode; - var existingVal = leaf.getValue(); - if (typeof existingVal !== 'number') { - return delta; - } - // No need to do over/underflow arithmetic here because JS only handles floats under the covers - return existingVal + delta; -}; -/** - * Recursively replace all deferred values and priorities in the tree with the - * specified generated replacement values. - * @param path - path to which write is relative - * @param node - new data written at path - * @param syncTree - current data - */ -var resolveDeferredValueTree = function (path, node, syncTree, serverValues) { - return resolveDeferredValue(node, new DeferredValueProvider(syncTree, path), serverValues); -}; -/** - * Recursively replace all deferred values and priorities in the node with the - * specified generated replacement values. If there are no server values in the node, - * it'll be returned as-is. - */ -var resolveDeferredValueSnapshot = function (node, existing, serverValues) { - return resolveDeferredValue(node, new ExistingValueProvider(existing), serverValues); -}; -function resolveDeferredValue(node, existingVal, serverValues) { - var rawPri = node.getPriority().val(); - var priority = resolveDeferredLeafValue(rawPri, existingVal.getImmediateChild('.priority'), serverValues); - var newNode; - if (node.isLeafNode()) { - var leafNode = node; - var value = resolveDeferredLeafValue(leafNode.getValue(), existingVal, serverValues); - if (value !== leafNode.getValue() || - priority !== leafNode.getPriority().val()) { - return new LeafNode(value, nodeFromJSON(priority)); - } - else { - return node; - } - } - else { - var childrenNode = node; - newNode = childrenNode; - if (priority !== childrenNode.getPriority().val()) { - newNode = newNode.updatePriority(new LeafNode(priority)); - } - childrenNode.forEachChild(PRIORITY_INDEX, function (childName, childNode) { - var newChildNode = resolveDeferredValue(childNode, existingVal.getImmediateChild(childName), serverValues); - if (newChildNode !== childNode) { - newNode = newNode.updateImmediateChild(childName, newChildNode); - } - }); - return newNode; - } -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * A light-weight tree, traversable by path. Nodes can have both values and children. - * Nodes are not enumerated (by forEachChild) unless they have a value or non-empty - * children. - */ -var Tree = /** @class */ (function () { - /** - * @param name - Optional name of the node. - * @param parent - Optional parent node. - * @param node - Optional node to wrap. - */ - function Tree(name, parent, node) { - if (name === void 0) { name = ''; } - if (parent === void 0) { parent = null; } - if (node === void 0) { node = { children: {}, childCount: 0 }; } - this.name = name; - this.parent = parent; - this.node = node; - } - return Tree; -}()); -/** - * Returns a sub-Tree for the given path. - * - * @param pathObj - Path to look up. - * @returns Tree for path. - */ -function treeSubTree(tree, pathObj) { - // TODO: Require pathObj to be Path? - var path = pathObj instanceof Path ? pathObj : new Path(pathObj); - var child = tree, next = pathGetFront(path); - while (next !== null) { - var childNode = safeGet(child.node.children, next) || { - children: {}, - childCount: 0 - }; - child = new Tree(next, child, childNode); - path = pathPopFront(path); - next = pathGetFront(path); - } - return child; -} -/** - * Returns the data associated with this tree node. - * - * @returns The data or null if no data exists. - */ -function treeGetValue(tree) { - return tree.node.value; -} -/** - * Sets data to this tree node. - * - * @param value - Value to set. - */ -function treeSetValue(tree, value) { - tree.node.value = value; - treeUpdateParents(tree); -} -/** - * @returns Whether the tree has any children. - */ -function treeHasChildren(tree) { - return tree.node.childCount > 0; -} -/** - * @returns Whethe rthe tree is empty (no value or children). - */ -function treeIsEmpty(tree) { - return treeGetValue(tree) === undefined && !treeHasChildren(tree); -} -/** - * Calls action for each child of this tree node. - * - * @param action - Action to be called for each child. - */ -function treeForEachChild(tree, action) { - each(tree.node.children, function (child, childTree) { - action(new Tree(child, tree, childTree)); - }); -} -/** - * Does a depth-first traversal of this node's descendants, calling action for each one. - * - * @param action - Action to be called for each child. - * @param includeSelf - Whether to call action on this node as well. Defaults to - * false. - * @param childrenFirst - Whether to call action on children before calling it on - * parent. - */ -function treeForEachDescendant(tree, action, includeSelf, childrenFirst) { - if (includeSelf && !childrenFirst) { - action(tree); - } - treeForEachChild(tree, function (child) { - treeForEachDescendant(child, action, true, childrenFirst); - }); - if (includeSelf && childrenFirst) { - action(tree); - } -} -/** - * Calls action on each ancestor node. - * - * @param action - Action to be called on each parent; return - * true to abort. - * @param includeSelf - Whether to call action on this node as well. - * @returns true if the action callback returned true. - */ -function treeForEachAncestor(tree, action, includeSelf) { - var node = includeSelf ? tree : tree.parent; - while (node !== null) { - if (action(node)) { - return true; - } - node = node.parent; - } - return false; -} -/** - * @returns The path of this tree node, as a Path. - */ -function treeGetPath(tree) { - return new Path(tree.parent === null - ? tree.name - : treeGetPath(tree.parent) + '/' + tree.name); -} -/** - * Adds or removes this child from its parent based on whether it's empty or not. - */ -function treeUpdateParents(tree) { - if (tree.parent !== null) { - treeUpdateChild(tree.parent, tree.name, tree); - } -} -/** - * Adds or removes the passed child to this tree node, depending on whether it's empty. - * - * @param childName - The name of the child to update. - * @param child - The child to update. - */ -function treeUpdateChild(tree, childName, child) { - var childEmpty = treeIsEmpty(child); - var childExists = contains(tree.node.children, childName); - if (childEmpty && childExists) { - delete tree.node.children[childName]; - tree.node.childCount--; - treeUpdateParents(tree); - } - else if (!childEmpty && !childExists) { - tree.node.children[childName] = child.node; - tree.node.childCount++; - treeUpdateParents(tree); - } -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * True for invalid Firebase keys - */ -var INVALID_KEY_REGEX_ = /[\[\].#$\/\u0000-\u001F\u007F]/; -/** - * True for invalid Firebase paths. - * Allows '/' in paths. - */ -var INVALID_PATH_REGEX_ = /[\[\].#$\u0000-\u001F\u007F]/; -/** - * Maximum number of characters to allow in leaf value - */ -var MAX_LEAF_SIZE_ = 10 * 1024 * 1024; -var isValidKey = function (key) { - return (typeof key === 'string' && key.length !== 0 && !INVALID_KEY_REGEX_.test(key)); -}; -var isValidPathString = function (pathString) { - return (typeof pathString === 'string' && - pathString.length !== 0 && - !INVALID_PATH_REGEX_.test(pathString)); -}; -var isValidRootPathString = function (pathString) { - if (pathString) { - // Allow '/.info/' at the beginning. - pathString = pathString.replace(/^\/*\.info(\/|$)/, '/'); - } - return isValidPathString(pathString); -}; -var isValidPriority = function (priority) { - return (priority === null || - typeof priority === 'string' || - (typeof priority === 'number' && !isInvalidJSONNumber(priority)) || - (priority && - typeof priority === 'object' && - // eslint-disable-next-line @typescript-eslint/no-explicit-any - contains(priority, '.sv'))); -}; -/** - * Pre-validate a datum passed as an argument to Firebase function. - */ -var validateFirebaseDataArg = function (fnName, value, path, optional) { - if (optional && value === undefined) { - return; - } - validateFirebaseData(errorPrefix(fnName, 'value'), value, path); -}; -/** - * Validate a data object client-side before sending to server. - */ -var validateFirebaseData = function (errorPrefix, data, path_) { - var path = path_ instanceof Path ? new ValidationPath(path_, errorPrefix) : path_; - if (data === undefined) { - throw new Error(errorPrefix + 'contains undefined ' + validationPathToErrorString(path)); - } - if (typeof data === 'function') { - throw new Error(errorPrefix + - 'contains a function ' + - validationPathToErrorString(path) + - ' with contents = ' + - data.toString()); - } - if (isInvalidJSONNumber(data)) { - throw new Error(errorPrefix + - 'contains ' + - data.toString() + - ' ' + - validationPathToErrorString(path)); - } - // Check max leaf size, but try to avoid the utf8 conversion if we can. - if (typeof data === 'string' && - data.length > MAX_LEAF_SIZE_ / 3 && - stringLength(data) > MAX_LEAF_SIZE_) { - throw new Error(errorPrefix + - 'contains a string greater than ' + - MAX_LEAF_SIZE_ + - ' utf8 bytes ' + - validationPathToErrorString(path) + - " ('" + - data.substring(0, 50) + - "...')"); - } - // TODO = Perf = Consider combining the recursive validation of keys into NodeFromJSON - // to save extra walking of large objects. - if (data && typeof data === 'object') { - var hasDotValue_1 = false; - var hasActualChild_1 = false; - each(data, function (key, value) { - if (key === '.value') { - hasDotValue_1 = true; - } - else if (key !== '.priority' && key !== '.sv') { - hasActualChild_1 = true; - if (!isValidKey(key)) { - throw new Error(errorPrefix + - ' contains an invalid key (' + - key + - ') ' + - validationPathToErrorString(path) + - '. Keys must be non-empty strings ' + - 'and can\'t contain ".", "#", "$", "/", "[", or "]"'); - } - } - validationPathPush(path, key); - validateFirebaseData(errorPrefix, value, path); - validationPathPop(path); - }); - if (hasDotValue_1 && hasActualChild_1) { - throw new Error(errorPrefix + - ' contains ".value" child ' + - validationPathToErrorString(path) + - ' in addition to actual children.'); - } - } -}; -/** - * Pre-validate paths passed in the firebase function. - */ -var validateFirebaseMergePaths = function (errorPrefix, mergePaths) { - var i, curPath; - for (i = 0; i < mergePaths.length; i++) { - curPath = mergePaths[i]; - var keys = pathSlice(curPath); - for (var j = 0; j < keys.length; j++) { - if (keys[j] === '.priority' && j === keys.length - 1) ; - else if (!isValidKey(keys[j])) { - throw new Error(errorPrefix + - 'contains an invalid key (' + - keys[j] + - ') in path ' + - curPath.toString() + - '. Keys must be non-empty strings ' + - 'and can\'t contain ".", "#", "$", "/", "[", or "]"'); - } - } - } - // Check that update keys are not descendants of each other. - // We rely on the property that sorting guarantees that ancestors come - // right before descendants. - mergePaths.sort(pathCompare); - var prevPath = null; - for (i = 0; i < mergePaths.length; i++) { - curPath = mergePaths[i]; - if (prevPath !== null && pathContains(prevPath, curPath)) { - throw new Error(errorPrefix + - 'contains a path ' + - prevPath.toString() + - ' that is ancestor of another path ' + - curPath.toString()); - } - prevPath = curPath; - } -}; -/** - * pre-validate an object passed as an argument to firebase function ( - * must be an object - e.g. for firebase.update()). - */ -var validateFirebaseMergeDataArg = function (fnName, data, path, optional) { - if (optional && data === undefined) { - return; - } - var errorPrefix$1 = errorPrefix(fnName, 'values'); - if (!(data && typeof data === 'object') || Array.isArray(data)) { - throw new Error(errorPrefix$1 + ' must be an object containing the children to replace.'); - } - var mergePaths = []; - each(data, function (key, value) { - var curPath = new Path(key); - validateFirebaseData(errorPrefix$1, value, pathChild(path, curPath)); - if (pathGetBack(curPath) === '.priority') { - if (!isValidPriority(value)) { - throw new Error(errorPrefix$1 + - "contains an invalid value for '" + - curPath.toString() + - "', which must be a valid " + - 'Firebase priority (a string, finite number, server value, or null).'); - } - } - mergePaths.push(curPath); - }); - validateFirebaseMergePaths(errorPrefix$1, mergePaths); -}; -var validatePriority = function (fnName, priority, optional) { - if (optional && priority === undefined) { - return; - } - if (isInvalidJSONNumber(priority)) { - throw new Error(errorPrefix(fnName, 'priority') + - 'is ' + - priority.toString() + - ', but must be a valid Firebase priority (a string, finite number, ' + - 'server value, or null).'); - } - // Special case to allow importing data with a .sv. - if (!isValidPriority(priority)) { - throw new Error(errorPrefix(fnName, 'priority') + - 'must be a valid Firebase priority ' + - '(a string, finite number, server value, or null).'); - } -}; -var validateKey = function (fnName, argumentName, key, optional) { - if (optional && key === undefined) { - return; - } - if (!isValidKey(key)) { - throw new Error(errorPrefix(fnName, argumentName) + - 'was an invalid key = "' + - key + - '". Firebase keys must be non-empty strings and ' + - 'can\'t contain ".", "#", "$", "/", "[", or "]").'); - } -}; -/** - * @internal - */ -var validatePathString = function (fnName, argumentName, pathString, optional) { - if (optional && pathString === undefined) { - return; - } - if (!isValidPathString(pathString)) { - throw new Error(errorPrefix(fnName, argumentName) + - 'was an invalid path = "' + - pathString + - '". Paths must be non-empty strings and ' + - 'can\'t contain ".", "#", "$", "[", or "]"'); - } -}; -var validateRootPathString = function (fnName, argumentName, pathString, optional) { - if (pathString) { - // Allow '/.info/' at the beginning. - pathString = pathString.replace(/^\/*\.info(\/|$)/, '/'); - } - validatePathString(fnName, argumentName, pathString, optional); -}; -/** - * @internal - */ -var validateWritablePath = function (fnName, path) { - if (pathGetFront(path) === '.info') { - throw new Error(fnName + " failed = Can't modify data under /.info/"); - } -}; -var validateUrl = function (fnName, parsedUrl) { - // TODO = Validate server better. - var pathString = parsedUrl.path.toString(); - if (!(typeof parsedUrl.repoInfo.host === 'string') || - parsedUrl.repoInfo.host.length === 0 || - (!isValidKey(parsedUrl.repoInfo.namespace) && - parsedUrl.repoInfo.host.split(':')[0] !== 'localhost') || - (pathString.length !== 0 && !isValidRootPathString(pathString))) { - throw new Error(errorPrefix(fnName, 'url') + - 'must be a valid firebase URL and ' + - 'the path can\'t contain ".", "#", "$", "[", or "]".'); - } -}; - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * The event queue serves a few purposes: - * 1. It ensures we maintain event order in the face of event callbacks doing operations that result in more - * events being queued. - * 2. raiseQueuedEvents() handles being called reentrantly nicely. That is, if in the course of raising events, - * raiseQueuedEvents() is called again, the "inner" call will pick up raising events where the "outer" call - * left off, ensuring that the events are still raised synchronously and in order. - * 3. You can use raiseEventsAtPath and raiseEventsForChangedPath to ensure only relevant previously-queued - * events are raised synchronously. - * - * NOTE: This can all go away if/when we move to async events. - * - */ -var EventQueue = /** @class */ (function () { - function EventQueue() { - this.eventLists_ = []; - /** - * Tracks recursion depth of raiseQueuedEvents_, for debugging purposes. - */ - this.recursionDepth_ = 0; - } - return EventQueue; -}()); -/** - * @param eventDataList - The new events to queue. - */ -function eventQueueQueueEvents(eventQueue, eventDataList) { - // We group events by path, storing them in a single EventList, to make it easier to skip over them quickly. - var currList = null; - for (var i = 0; i < eventDataList.length; i++) { - var data = eventDataList[i]; - var path = data.getPath(); - if (currList !== null && !pathEquals(path, currList.path)) { - eventQueue.eventLists_.push(currList); - currList = null; - } - if (currList === null) { - currList = { events: [], path: path }; - } - currList.events.push(data); - } - if (currList) { - eventQueue.eventLists_.push(currList); - } -} -/** - * Queues the specified events and synchronously raises all events (including previously queued ones) - * for the specified path. - * - * It is assumed that the new events are all for the specified path. - * - * @param path - The path to raise events for. - * @param eventDataList - The new events to raise. - */ -function eventQueueRaiseEventsAtPath(eventQueue, path, eventDataList) { - eventQueueQueueEvents(eventQueue, eventDataList); - eventQueueRaiseQueuedEventsMatchingPredicate(eventQueue, function (eventPath) { - return pathEquals(eventPath, path); - }); -} -/** - * Queues the specified events and synchronously raises all events (including previously queued ones) for - * locations related to the specified change path (i.e. all ancestors and descendants). - * - * It is assumed that the new events are all related (ancestor or descendant) to the specified path. - * - * @param changedPath - The path to raise events for. - * @param eventDataList - The events to raise - */ -function eventQueueRaiseEventsForChangedPath(eventQueue, changedPath, eventDataList) { - eventQueueQueueEvents(eventQueue, eventDataList); - eventQueueRaiseQueuedEventsMatchingPredicate(eventQueue, function (eventPath) { - return pathContains(eventPath, changedPath) || - pathContains(changedPath, eventPath); - }); -} -function eventQueueRaiseQueuedEventsMatchingPredicate(eventQueue, predicate) { - eventQueue.recursionDepth_++; - var sentAll = true; - for (var i = 0; i < eventQueue.eventLists_.length; i++) { - var eventList = eventQueue.eventLists_[i]; - if (eventList) { - var eventPath = eventList.path; - if (predicate(eventPath)) { - eventListRaise(eventQueue.eventLists_[i]); - eventQueue.eventLists_[i] = null; - } - else { - sentAll = false; - } - } - } - if (sentAll) { - eventQueue.eventLists_ = []; - } - eventQueue.recursionDepth_--; -} -/** - * Iterates through the list and raises each event - */ -function eventListRaise(eventList) { - for (var i = 0; i < eventList.events.length; i++) { - var eventData = eventList.events[i]; - if (eventData !== null) { - eventList.events[i] = null; - var eventFn = eventData.getEventRunner(); - if (logger) { - log('event: ' + eventData.toString()); - } - exceptionGuard(eventFn); - } - } -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var INTERRUPT_REASON = 'repo_interrupt'; -/** - * If a transaction does not succeed after 25 retries, we abort it. Among other - * things this ensure that if there's ever a bug causing a mismatch between - * client / server hashes for some data, we won't retry indefinitely. - */ -var MAX_TRANSACTION_RETRIES = 25; -/** - * A connection to a single data repository. - */ -var Repo = /** @class */ (function () { - function Repo(repoInfo_, forceRestClient_, authTokenProvider_, appCheckProvider_) { - this.repoInfo_ = repoInfo_; - this.forceRestClient_ = forceRestClient_; - this.authTokenProvider_ = authTokenProvider_; - this.appCheckProvider_ = appCheckProvider_; - this.dataUpdateCount = 0; - this.statsListener_ = null; - this.eventQueue_ = new EventQueue(); - this.nextWriteId_ = 1; - this.interceptServerDataCallback_ = null; - /** A list of data pieces and paths to be set when this client disconnects. */ - this.onDisconnect_ = newSparseSnapshotTree(); - /** Stores queues of outstanding transactions for Firebase locations. */ - this.transactionQueueTree_ = new Tree(); - // TODO: This should be @private but it's used by test_access.js and internal.js - this.persistentConnection_ = null; - // This key is intentionally not updated if RepoInfo is later changed or replaced - this.key = this.repoInfo_.toURLString(); - } - /** - * @returns The URL corresponding to the root of this Firebase. - */ - Repo.prototype.toString = function () { - return ((this.repoInfo_.secure ? 'https://' : 'http://') + this.repoInfo_.host); - }; - return Repo; -}()); -function repoStart(repo, appId, authOverride) { - repo.stats_ = statsManagerGetCollection(repo.repoInfo_); - if (repo.forceRestClient_ || beingCrawled()) { - repo.server_ = new ReadonlyRestClient(repo.repoInfo_, function (pathString, data, isMerge, tag) { - repoOnDataUpdate(repo, pathString, data, isMerge, tag); - }, repo.authTokenProvider_, repo.appCheckProvider_); - // Minor hack: Fire onConnect immediately, since there's no actual connection. - setTimeout(function () { return repoOnConnectStatus(repo, /* connectStatus= */ true); }, 0); - } - else { - // Validate authOverride - if (typeof authOverride !== 'undefined' && authOverride !== null) { - if (typeof authOverride !== 'object') { - throw new Error('Only objects are supported for option databaseAuthVariableOverride'); - } - try { - stringify(authOverride); - } - catch (e) { - throw new Error('Invalid authOverride provided: ' + e); - } - } - repo.persistentConnection_ = new PersistentConnection(repo.repoInfo_, appId, function (pathString, data, isMerge, tag) { - repoOnDataUpdate(repo, pathString, data, isMerge, tag); - }, function (connectStatus) { - repoOnConnectStatus(repo, connectStatus); - }, function (updates) { - repoOnServerInfoUpdate(repo, updates); - }, repo.authTokenProvider_, repo.appCheckProvider_, authOverride); - repo.server_ = repo.persistentConnection_; - } - repo.authTokenProvider_.addTokenChangeListener(function (token) { - repo.server_.refreshAuthToken(token); - }); - repo.appCheckProvider_.addTokenChangeListener(function (result) { - repo.server_.refreshAppCheckToken(result.token); - }); - // In the case of multiple Repos for the same repoInfo (i.e. there are multiple Firebase.Contexts being used), - // we only want to create one StatsReporter. As such, we'll report stats over the first Repo created. - repo.statsReporter_ = statsManagerGetOrCreateReporter(repo.repoInfo_, function () { return new StatsReporter(repo.stats_, repo.server_); }); - // Used for .info. - repo.infoData_ = new SnapshotHolder(); - repo.infoSyncTree_ = new SyncTree({ - startListening: function (query, tag, currentHashFn, onComplete) { - var infoEvents = []; - var node = repo.infoData_.getNode(query._path); - // This is possibly a hack, but we have different semantics for .info endpoints. We don't raise null events - // on initial data... - if (!node.isEmpty()) { - infoEvents = syncTreeApplyServerOverwrite(repo.infoSyncTree_, query._path, node); - setTimeout(function () { - onComplete('ok'); - }, 0); - } - return infoEvents; - }, - stopListening: function () { } - }); - repoUpdateInfo(repo, 'connected', false); - repo.serverSyncTree_ = new SyncTree({ - startListening: function (query, tag, currentHashFn, onComplete) { - repo.server_.listen(query, currentHashFn, tag, function (status, data) { - var events = onComplete(status, data); - eventQueueRaiseEventsForChangedPath(repo.eventQueue_, query._path, events); - }); - // No synchronous events for network-backed sync trees - return []; - }, - stopListening: function (query, tag) { - repo.server_.unlisten(query, tag); - } - }); -} -/** - * @returns The time in milliseconds, taking the server offset into account if we have one. - */ -function repoServerTime(repo) { - var offsetNode = repo.infoData_.getNode(new Path('.info/serverTimeOffset')); - var offset = offsetNode.val() || 0; - return new Date().getTime() + offset; -} -/** - * Generate ServerValues using some variables from the repo object. - */ -function repoGenerateServerValues(repo) { - return generateWithValues({ - timestamp: repoServerTime(repo) - }); -} -/** - * Called by realtime when we get new messages from the server. - */ -function repoOnDataUpdate(repo, pathString, data, isMerge, tag) { - // For testing. - repo.dataUpdateCount++; - var path = new Path(pathString); - data = repo.interceptServerDataCallback_ - ? repo.interceptServerDataCallback_(pathString, data) - : data; - var events = []; - if (tag) { - if (isMerge) { - var taggedChildren = map(data, function (raw) { return nodeFromJSON(raw); }); - events = syncTreeApplyTaggedQueryMerge(repo.serverSyncTree_, path, taggedChildren, tag); - } - else { - var taggedSnap = nodeFromJSON(data); - events = syncTreeApplyTaggedQueryOverwrite(repo.serverSyncTree_, path, taggedSnap, tag); - } - } - else if (isMerge) { - var changedChildren = map(data, function (raw) { return nodeFromJSON(raw); }); - events = syncTreeApplyServerMerge(repo.serverSyncTree_, path, changedChildren); - } - else { - var snap = nodeFromJSON(data); - events = syncTreeApplyServerOverwrite(repo.serverSyncTree_, path, snap); - } - var affectedPath = path; - if (events.length > 0) { - // Since we have a listener outstanding for each transaction, receiving any events - // is a proxy for some change having occurred. - affectedPath = repoRerunTransactions(repo, path); - } - eventQueueRaiseEventsForChangedPath(repo.eventQueue_, affectedPath, events); -} -function repoOnConnectStatus(repo, connectStatus) { - repoUpdateInfo(repo, 'connected', connectStatus); - if (connectStatus === false) { - repoRunOnDisconnectEvents(repo); - } -} -function repoOnServerInfoUpdate(repo, updates) { - each(updates, function (key, value) { - repoUpdateInfo(repo, key, value); - }); -} -function repoUpdateInfo(repo, pathString, value) { - var path = new Path('/.info/' + pathString); - var newNode = nodeFromJSON(value); - repo.infoData_.updateSnapshot(path, newNode); - var events = syncTreeApplyServerOverwrite(repo.infoSyncTree_, path, newNode); - eventQueueRaiseEventsForChangedPath(repo.eventQueue_, path, events); -} -function repoGetNextWriteId(repo) { - return repo.nextWriteId_++; -} -/** - * The purpose of `getValue` is to return the latest known value - * satisfying `query`. - * - * This method will first check for in-memory cached values - * belonging to active listeners. If they are found, such values - * are considered to be the most up-to-date. - * - * If the client is not connected, this method will wait until the - * repo has established a connection and then request the value for `query`. - * If the client is not able to retrieve the query result for another reason, - * it reports an error. - * - * @param query - The query to surface a value for. - */ -function repoGetValue(repo, query, eventRegistration) { - // Only active queries are cached. There is no persisted cache. - var cached = syncTreeGetServerValue(repo.serverSyncTree_, query); - if (cached != null) { - return Promise.resolve(cached); - } - return repo.server_.get(query).then(function (payload) { - var node = nodeFromJSON(payload).withIndex(query._queryParams.getIndex()); - /** - * Below we simulate the actions of an `onlyOnce` `onValue()` event where: - * Add an event registration, - * Update data at the path, - * Raise any events, - * Cleanup the SyncTree - */ - syncTreeAddEventRegistration(repo.serverSyncTree_, query, eventRegistration, true); - var events; - if (query._queryParams.loadsAllData()) { - events = syncTreeApplyServerOverwrite(repo.serverSyncTree_, query._path, node); - } - else { - var tag = syncTreeTagForQuery(repo.serverSyncTree_, query); - events = syncTreeApplyTaggedQueryOverwrite(repo.serverSyncTree_, query._path, node, tag); - } - /* - * We need to raise events in the scenario where `get()` is called at a parent path, and - * while the `get()` is pending, `onValue` is called at a child location. While get() is waiting - * for the data, `onValue` will register a new event. Then, get() will come back, and update the syncTree - * and its corresponding serverCache, including the child location where `onValue` is called. Then, - * `onValue` will receive the event from the server, but look at the syncTree and see that the data received - * from the server is already at the SyncPoint, and so the `onValue` callback will never get fired. - * Calling `eventQueueRaiseEventsForChangedPath()` is the correct way to propagate the events and - * ensure the corresponding child events will get fired. - */ - eventQueueRaiseEventsForChangedPath(repo.eventQueue_, query._path, events); - syncTreeRemoveEventRegistration(repo.serverSyncTree_, query, eventRegistration, null, true); - return node; - }, function (err) { - repoLog(repo, 'get for query ' + stringify(query) + ' failed: ' + err); - return Promise.reject(new Error(err)); - }); -} -function repoSetWithPriority(repo, path, newVal, newPriority, onComplete) { - repoLog(repo, 'set', { - path: path.toString(), - value: newVal, - priority: newPriority - }); - // TODO: Optimize this behavior to either (a) store flag to skip resolving where possible and / or - // (b) store unresolved paths on JSON parse - var serverValues = repoGenerateServerValues(repo); - var newNodeUnresolved = nodeFromJSON(newVal, newPriority); - var existing = syncTreeCalcCompleteEventCache(repo.serverSyncTree_, path); - var newNode = resolveDeferredValueSnapshot(newNodeUnresolved, existing, serverValues); - var writeId = repoGetNextWriteId(repo); - var events = syncTreeApplyUserOverwrite(repo.serverSyncTree_, path, newNode, writeId, true); - eventQueueQueueEvents(repo.eventQueue_, events); - repo.server_.put(path.toString(), newNodeUnresolved.val(/*export=*/ true), function (status, errorReason) { - var success = status === 'ok'; - if (!success) { - warn('set at ' + path + ' failed: ' + status); - } - var clearEvents = syncTreeAckUserWrite(repo.serverSyncTree_, writeId, !success); - eventQueueRaiseEventsForChangedPath(repo.eventQueue_, path, clearEvents); - repoCallOnCompleteCallback(repo, onComplete, status, errorReason); - }); - var affectedPath = repoAbortTransactions(repo, path); - repoRerunTransactions(repo, affectedPath); - // We queued the events above, so just flush the queue here - eventQueueRaiseEventsForChangedPath(repo.eventQueue_, affectedPath, []); -} -function repoUpdate(repo, path, childrenToMerge, onComplete) { - repoLog(repo, 'update', { path: path.toString(), value: childrenToMerge }); - // Start with our existing data and merge each child into it. - var empty = true; - var serverValues = repoGenerateServerValues(repo); - var changedChildren = {}; - each(childrenToMerge, function (changedKey, changedValue) { - empty = false; - changedChildren[changedKey] = resolveDeferredValueTree(pathChild(path, changedKey), nodeFromJSON(changedValue), repo.serverSyncTree_, serverValues); - }); - if (!empty) { - var writeId_1 = repoGetNextWriteId(repo); - var events = syncTreeApplyUserMerge(repo.serverSyncTree_, path, changedChildren, writeId_1); - eventQueueQueueEvents(repo.eventQueue_, events); - repo.server_.merge(path.toString(), childrenToMerge, function (status, errorReason) { - var success = status === 'ok'; - if (!success) { - warn('update at ' + path + ' failed: ' + status); - } - var clearEvents = syncTreeAckUserWrite(repo.serverSyncTree_, writeId_1, !success); - var affectedPath = clearEvents.length > 0 ? repoRerunTransactions(repo, path) : path; - eventQueueRaiseEventsForChangedPath(repo.eventQueue_, affectedPath, clearEvents); - repoCallOnCompleteCallback(repo, onComplete, status, errorReason); - }); - each(childrenToMerge, function (changedPath) { - var affectedPath = repoAbortTransactions(repo, pathChild(path, changedPath)); - repoRerunTransactions(repo, affectedPath); - }); - // We queued the events above, so just flush the queue here - eventQueueRaiseEventsForChangedPath(repo.eventQueue_, path, []); - } - else { - log("update() called with empty data. Don't do anything."); - repoCallOnCompleteCallback(repo, onComplete, 'ok', undefined); - } -} -/** - * Applies all of the changes stored up in the onDisconnect_ tree. - */ -function repoRunOnDisconnectEvents(repo) { - repoLog(repo, 'onDisconnectEvents'); - var serverValues = repoGenerateServerValues(repo); - var resolvedOnDisconnectTree = newSparseSnapshotTree(); - sparseSnapshotTreeForEachTree(repo.onDisconnect_, newEmptyPath(), function (path, node) { - var resolved = resolveDeferredValueTree(path, node, repo.serverSyncTree_, serverValues); - sparseSnapshotTreeRemember(resolvedOnDisconnectTree, path, resolved); - }); - var events = []; - sparseSnapshotTreeForEachTree(resolvedOnDisconnectTree, newEmptyPath(), function (path, snap) { - events = events.concat(syncTreeApplyServerOverwrite(repo.serverSyncTree_, path, snap)); - var affectedPath = repoAbortTransactions(repo, path); - repoRerunTransactions(repo, affectedPath); - }); - repo.onDisconnect_ = newSparseSnapshotTree(); - eventQueueRaiseEventsForChangedPath(repo.eventQueue_, newEmptyPath(), events); -} -function repoOnDisconnectCancel(repo, path, onComplete) { - repo.server_.onDisconnectCancel(path.toString(), function (status, errorReason) { - if (status === 'ok') { - sparseSnapshotTreeForget(repo.onDisconnect_, path); - } - repoCallOnCompleteCallback(repo, onComplete, status, errorReason); - }); -} -function repoOnDisconnectSet(repo, path, value, onComplete) { - var newNode = nodeFromJSON(value); - repo.server_.onDisconnectPut(path.toString(), newNode.val(/*export=*/ true), function (status, errorReason) { - if (status === 'ok') { - sparseSnapshotTreeRemember(repo.onDisconnect_, path, newNode); - } - repoCallOnCompleteCallback(repo, onComplete, status, errorReason); - }); -} -function repoOnDisconnectSetWithPriority(repo, path, value, priority, onComplete) { - var newNode = nodeFromJSON(value, priority); - repo.server_.onDisconnectPut(path.toString(), newNode.val(/*export=*/ true), function (status, errorReason) { - if (status === 'ok') { - sparseSnapshotTreeRemember(repo.onDisconnect_, path, newNode); - } - repoCallOnCompleteCallback(repo, onComplete, status, errorReason); - }); -} -function repoOnDisconnectUpdate(repo, path, childrenToMerge, onComplete) { - if (isEmpty(childrenToMerge)) { - log("onDisconnect().update() called with empty data. Don't do anything."); - repoCallOnCompleteCallback(repo, onComplete, 'ok', undefined); - return; - } - repo.server_.onDisconnectMerge(path.toString(), childrenToMerge, function (status, errorReason) { - if (status === 'ok') { - each(childrenToMerge, function (childName, childNode) { - var newChildNode = nodeFromJSON(childNode); - sparseSnapshotTreeRemember(repo.onDisconnect_, pathChild(path, childName), newChildNode); - }); - } - repoCallOnCompleteCallback(repo, onComplete, status, errorReason); - }); -} -function repoAddEventCallbackForQuery(repo, query, eventRegistration) { - var events; - if (pathGetFront(query._path) === '.info') { - events = syncTreeAddEventRegistration(repo.infoSyncTree_, query, eventRegistration); - } - else { - events = syncTreeAddEventRegistration(repo.serverSyncTree_, query, eventRegistration); - } - eventQueueRaiseEventsAtPath(repo.eventQueue_, query._path, events); -} -function repoRemoveEventCallbackForQuery(repo, query, eventRegistration) { - // These are guaranteed not to raise events, since we're not passing in a cancelError. However, we can future-proof - // a little bit by handling the return values anyways. - var events; - if (pathGetFront(query._path) === '.info') { - events = syncTreeRemoveEventRegistration(repo.infoSyncTree_, query, eventRegistration); - } - else { - events = syncTreeRemoveEventRegistration(repo.serverSyncTree_, query, eventRegistration); - } - eventQueueRaiseEventsAtPath(repo.eventQueue_, query._path, events); -} -function repoInterrupt(repo) { - if (repo.persistentConnection_) { - repo.persistentConnection_.interrupt(INTERRUPT_REASON); - } -} -function repoResume(repo) { - if (repo.persistentConnection_) { - repo.persistentConnection_.resume(INTERRUPT_REASON); - } -} -function repoLog(repo) { - var varArgs = []; - for (var _i = 1; _i < arguments.length; _i++) { - varArgs[_i - 1] = arguments[_i]; - } - var prefix = ''; - if (repo.persistentConnection_) { - prefix = repo.persistentConnection_.id + ':'; - } - log.apply(void 0, __spreadArray([prefix], __read(varArgs))); -} -function repoCallOnCompleteCallback(repo, callback, status, errorReason) { - if (callback) { - exceptionGuard(function () { - if (status === 'ok') { - callback(null); - } - else { - var code = (status || 'error').toUpperCase(); - var message = code; - if (errorReason) { - message += ': ' + errorReason; - } - var error = new Error(message); - // eslint-disable-next-line @typescript-eslint/no-explicit-any - error.code = code; - callback(error); - } - }); - } -} -/** - * Creates a new transaction, adds it to the transactions we're tracking, and - * sends it to the server if possible. - * - * @param path - Path at which to do transaction. - * @param transactionUpdate - Update callback. - * @param onComplete - Completion callback. - * @param unwatcher - Function that will be called when the transaction no longer - * need data updates for `path`. - * @param applyLocally - Whether or not to make intermediate results visible - */ -function repoStartTransaction(repo, path, transactionUpdate, onComplete, unwatcher, applyLocally) { - repoLog(repo, 'transaction on ' + path); - // Initialize transaction. - var transaction = { - path: path, - update: transactionUpdate, - onComplete: onComplete, - // One of TransactionStatus enums. - status: null, - // Used when combining transactions at different locations to figure out - // which one goes first. - order: LUIDGenerator(), - // Whether to raise local events for this transaction. - applyLocally: applyLocally, - // Count of how many times we've retried the transaction. - retryCount: 0, - // Function to call to clean up our .on() listener. - unwatcher: unwatcher, - // Stores why a transaction was aborted. - abortReason: null, - currentWriteId: null, - currentInputSnapshot: null, - currentOutputSnapshotRaw: null, - currentOutputSnapshotResolved: null - }; - // Run transaction initially. - var currentState = repoGetLatestState(repo, path, undefined); - transaction.currentInputSnapshot = currentState; - var newVal = transaction.update(currentState.val()); - if (newVal === undefined) { - // Abort transaction. - transaction.unwatcher(); - transaction.currentOutputSnapshotRaw = null; - transaction.currentOutputSnapshotResolved = null; - if (transaction.onComplete) { - transaction.onComplete(null, false, transaction.currentInputSnapshot); - } - } - else { - validateFirebaseData('transaction failed: Data returned ', newVal, transaction.path); - // Mark as run and add to our queue. - transaction.status = 0 /* RUN */; - var queueNode = treeSubTree(repo.transactionQueueTree_, path); - var nodeQueue = treeGetValue(queueNode) || []; - nodeQueue.push(transaction); - treeSetValue(queueNode, nodeQueue); - // Update visibleData and raise events - // Note: We intentionally raise events after updating all of our - // transaction state, since the user could start new transactions from the - // event callbacks. - var priorityForNode = void 0; - if (typeof newVal === 'object' && - newVal !== null && - contains(newVal, '.priority')) { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - priorityForNode = safeGet(newVal, '.priority'); - assert(isValidPriority(priorityForNode), 'Invalid priority returned by transaction. ' + - 'Priority must be a valid string, finite number, server value, or null.'); - } - else { - var currentNode = syncTreeCalcCompleteEventCache(repo.serverSyncTree_, path) || - ChildrenNode.EMPTY_NODE; - priorityForNode = currentNode.getPriority().val(); - } - var serverValues = repoGenerateServerValues(repo); - var newNodeUnresolved = nodeFromJSON(newVal, priorityForNode); - var newNode = resolveDeferredValueSnapshot(newNodeUnresolved, currentState, serverValues); - transaction.currentOutputSnapshotRaw = newNodeUnresolved; - transaction.currentOutputSnapshotResolved = newNode; - transaction.currentWriteId = repoGetNextWriteId(repo); - var events = syncTreeApplyUserOverwrite(repo.serverSyncTree_, path, newNode, transaction.currentWriteId, transaction.applyLocally); - eventQueueRaiseEventsForChangedPath(repo.eventQueue_, path, events); - repoSendReadyTransactions(repo, repo.transactionQueueTree_); - } -} -/** - * @param excludeSets - A specific set to exclude - */ -function repoGetLatestState(repo, path, excludeSets) { - return (syncTreeCalcCompleteEventCache(repo.serverSyncTree_, path, excludeSets) || - ChildrenNode.EMPTY_NODE); -} -/** - * Sends any already-run transactions that aren't waiting for outstanding - * transactions to complete. - * - * Externally it's called with no arguments, but it calls itself recursively - * with a particular transactionQueueTree node to recurse through the tree. - * - * @param node - transactionQueueTree node to start at. - */ -function repoSendReadyTransactions(repo, node) { - if (node === void 0) { node = repo.transactionQueueTree_; } - // Before recursing, make sure any completed transactions are removed. - if (!node) { - repoPruneCompletedTransactionsBelowNode(repo, node); - } - if (treeGetValue(node)) { - var queue = repoBuildTransactionQueue(repo, node); - assert(queue.length > 0, 'Sending zero length transaction queue'); - var allRun = queue.every(function (transaction) { return transaction.status === 0 /* RUN */; }); - // If they're all run (and not sent), we can send them. Else, we must wait. - if (allRun) { - repoSendTransactionQueue(repo, treeGetPath(node), queue); - } - } - else if (treeHasChildren(node)) { - treeForEachChild(node, function (childNode) { - repoSendReadyTransactions(repo, childNode); - }); - } -} -/** - * Given a list of run transactions, send them to the server and then handle - * the result (success or failure). - * - * @param path - The location of the queue. - * @param queue - Queue of transactions under the specified location. - */ -function repoSendTransactionQueue(repo, path, queue) { - // Mark transactions as sent and increment retry count! - var setsToIgnore = queue.map(function (txn) { - return txn.currentWriteId; - }); - var latestState = repoGetLatestState(repo, path, setsToIgnore); - var snapToSend = latestState; - var latestHash = latestState.hash(); - for (var i = 0; i < queue.length; i++) { - var txn = queue[i]; - assert(txn.status === 0 /* RUN */, 'tryToSendTransactionQueue_: items in queue should all be run.'); - txn.status = 1 /* SENT */; - txn.retryCount++; - var relativePath = newRelativePath(path, txn.path); - // If we've gotten to this point, the output snapshot must be defined. - snapToSend = snapToSend.updateChild(relativePath /** @type {!Node} */, txn.currentOutputSnapshotRaw); - } - var dataToSend = snapToSend.val(true); - var pathToSend = path; - // Send the put. - repo.server_.put(pathToSend.toString(), dataToSend, function (status) { - repoLog(repo, 'transaction put response', { - path: pathToSend.toString(), - status: status - }); - var events = []; - if (status === 'ok') { - // Queue up the callbacks and fire them after cleaning up all of our - // transaction state, since the callback could trigger more - // transactions or sets. - var callbacks = []; - var _loop_1 = function (i) { - queue[i].status = 2 /* COMPLETED */; - events = events.concat(syncTreeAckUserWrite(repo.serverSyncTree_, queue[i].currentWriteId)); - if (queue[i].onComplete) { - // We never unset the output snapshot, and given that this - // transaction is complete, it should be set - callbacks.push(function () { - return queue[i].onComplete(null, true, queue[i].currentOutputSnapshotResolved); - }); - } - queue[i].unwatcher(); - }; - for (var i = 0; i < queue.length; i++) { - _loop_1(i); - } - // Now remove the completed transactions. - repoPruneCompletedTransactionsBelowNode(repo, treeSubTree(repo.transactionQueueTree_, path)); - // There may be pending transactions that we can now send. - repoSendReadyTransactions(repo, repo.transactionQueueTree_); - eventQueueRaiseEventsForChangedPath(repo.eventQueue_, path, events); - // Finally, trigger onComplete callbacks. - for (var i = 0; i < callbacks.length; i++) { - exceptionGuard(callbacks[i]); - } - } - else { - // transactions are no longer sent. Update their status appropriately. - if (status === 'datastale') { - for (var i = 0; i < queue.length; i++) { - if (queue[i].status === 3 /* SENT_NEEDS_ABORT */) { - queue[i].status = 4 /* NEEDS_ABORT */; - } - else { - queue[i].status = 0 /* RUN */; - } - } - } - else { - warn('transaction at ' + pathToSend.toString() + ' failed: ' + status); - for (var i = 0; i < queue.length; i++) { - queue[i].status = 4 /* NEEDS_ABORT */; - queue[i].abortReason = status; - } - } - repoRerunTransactions(repo, path); - } - }, latestHash); -} -/** - * Finds all transactions dependent on the data at changedPath and reruns them. - * - * Should be called any time cached data changes. - * - * Return the highest path that was affected by rerunning transactions. This - * is the path at which events need to be raised for. - * - * @param changedPath - The path in mergedData that changed. - * @returns The rootmost path that was affected by rerunning transactions. - */ -function repoRerunTransactions(repo, changedPath) { - var rootMostTransactionNode = repoGetAncestorTransactionNode(repo, changedPath); - var path = treeGetPath(rootMostTransactionNode); - var queue = repoBuildTransactionQueue(repo, rootMostTransactionNode); - repoRerunTransactionQueue(repo, queue, path); - return path; -} -/** - * Does all the work of rerunning transactions (as well as cleans up aborted - * transactions and whatnot). - * - * @param queue - The queue of transactions to run. - * @param path - The path the queue is for. - */ -function repoRerunTransactionQueue(repo, queue, path) { - if (queue.length === 0) { - return; // Nothing to do! - } - // Queue up the callbacks and fire them after cleaning up all of our - // transaction state, since the callback could trigger more transactions or - // sets. - var callbacks = []; - var events = []; - // Ignore all of the sets we're going to re-run. - var txnsToRerun = queue.filter(function (q) { - return q.status === 0 /* RUN */; - }); - var setsToIgnore = txnsToRerun.map(function (q) { - return q.currentWriteId; - }); - var _loop_2 = function (i) { - var transaction = queue[i]; - var relativePath = newRelativePath(path, transaction.path); - var abortTransaction = false, abortReason; - assert(relativePath !== null, 'rerunTransactionsUnderNode_: relativePath should not be null.'); - if (transaction.status === 4 /* NEEDS_ABORT */) { - abortTransaction = true; - abortReason = transaction.abortReason; - events = events.concat(syncTreeAckUserWrite(repo.serverSyncTree_, transaction.currentWriteId, true)); - } - else if (transaction.status === 0 /* RUN */) { - if (transaction.retryCount >= MAX_TRANSACTION_RETRIES) { - abortTransaction = true; - abortReason = 'maxretry'; - events = events.concat(syncTreeAckUserWrite(repo.serverSyncTree_, transaction.currentWriteId, true)); - } - else { - // This code reruns a transaction - var currentNode = repoGetLatestState(repo, transaction.path, setsToIgnore); - transaction.currentInputSnapshot = currentNode; - var newData = queue[i].update(currentNode.val()); - if (newData !== undefined) { - validateFirebaseData('transaction failed: Data returned ', newData, transaction.path); - var newDataNode = nodeFromJSON(newData); - var hasExplicitPriority = typeof newData === 'object' && - newData != null && - contains(newData, '.priority'); - if (!hasExplicitPriority) { - // Keep the old priority if there wasn't a priority explicitly specified. - newDataNode = newDataNode.updatePriority(currentNode.getPriority()); - } - var oldWriteId = transaction.currentWriteId; - var serverValues = repoGenerateServerValues(repo); - var newNodeResolved = resolveDeferredValueSnapshot(newDataNode, currentNode, serverValues); - transaction.currentOutputSnapshotRaw = newDataNode; - transaction.currentOutputSnapshotResolved = newNodeResolved; - transaction.currentWriteId = repoGetNextWriteId(repo); - // Mutates setsToIgnore in place - setsToIgnore.splice(setsToIgnore.indexOf(oldWriteId), 1); - events = events.concat(syncTreeApplyUserOverwrite(repo.serverSyncTree_, transaction.path, newNodeResolved, transaction.currentWriteId, transaction.applyLocally)); - events = events.concat(syncTreeAckUserWrite(repo.serverSyncTree_, oldWriteId, true)); - } - else { - abortTransaction = true; - abortReason = 'nodata'; - events = events.concat(syncTreeAckUserWrite(repo.serverSyncTree_, transaction.currentWriteId, true)); - } - } - } - eventQueueRaiseEventsForChangedPath(repo.eventQueue_, path, events); - events = []; - if (abortTransaction) { - // Abort. - queue[i].status = 2 /* COMPLETED */; - // Removing a listener can trigger pruning which can muck with - // mergedData/visibleData (as it prunes data). So defer the unwatcher - // until we're done. - (function (unwatcher) { - setTimeout(unwatcher, Math.floor(0)); - })(queue[i].unwatcher); - if (queue[i].onComplete) { - if (abortReason === 'nodata') { - callbacks.push(function () { - return queue[i].onComplete(null, false, queue[i].currentInputSnapshot); - }); - } - else { - callbacks.push(function () { - return queue[i].onComplete(new Error(abortReason), false, null); - }); - } - } - } - }; - for (var i = 0; i < queue.length; i++) { - _loop_2(i); - } - // Clean up completed transactions. - repoPruneCompletedTransactionsBelowNode(repo, repo.transactionQueueTree_); - // Now fire callbacks, now that we're in a good, known state. - for (var i = 0; i < callbacks.length; i++) { - exceptionGuard(callbacks[i]); - } - // Try to send the transaction result to the server. - repoSendReadyTransactions(repo, repo.transactionQueueTree_); -} -/** - * Returns the rootmost ancestor node of the specified path that has a pending - * transaction on it, or just returns the node for the given path if there are - * no pending transactions on any ancestor. - * - * @param path - The location to start at. - * @returns The rootmost node with a transaction. - */ -function repoGetAncestorTransactionNode(repo, path) { - var front; - // Start at the root and walk deeper into the tree towards path until we - // find a node with pending transactions. - var transactionNode = repo.transactionQueueTree_; - front = pathGetFront(path); - while (front !== null && treeGetValue(transactionNode) === undefined) { - transactionNode = treeSubTree(transactionNode, front); - path = pathPopFront(path); - front = pathGetFront(path); - } - return transactionNode; -} -/** - * Builds the queue of all transactions at or below the specified - * transactionNode. - * - * @param transactionNode - * @returns The generated queue. - */ -function repoBuildTransactionQueue(repo, transactionNode) { - // Walk any child transaction queues and aggregate them into a single queue. - var transactionQueue = []; - repoAggregateTransactionQueuesForNode(repo, transactionNode, transactionQueue); - // Sort them by the order the transactions were created. - transactionQueue.sort(function (a, b) { return a.order - b.order; }); - return transactionQueue; -} -function repoAggregateTransactionQueuesForNode(repo, node, queue) { - var nodeQueue = treeGetValue(node); - if (nodeQueue) { - for (var i = 0; i < nodeQueue.length; i++) { - queue.push(nodeQueue[i]); - } - } - treeForEachChild(node, function (child) { - repoAggregateTransactionQueuesForNode(repo, child, queue); - }); -} -/** - * Remove COMPLETED transactions at or below this node in the transactionQueueTree_. - */ -function repoPruneCompletedTransactionsBelowNode(repo, node) { - var queue = treeGetValue(node); - if (queue) { - var to = 0; - for (var from = 0; from < queue.length; from++) { - if (queue[from].status !== 2 /* COMPLETED */) { - queue[to] = queue[from]; - to++; - } - } - queue.length = to; - treeSetValue(node, queue.length > 0 ? queue : undefined); - } - treeForEachChild(node, function (childNode) { - repoPruneCompletedTransactionsBelowNode(repo, childNode); - }); -} -/** - * Aborts all transactions on ancestors or descendants of the specified path. - * Called when doing a set() or update() since we consider them incompatible - * with transactions. - * - * @param path - Path for which we want to abort related transactions. - */ -function repoAbortTransactions(repo, path) { - var affectedPath = treeGetPath(repoGetAncestorTransactionNode(repo, path)); - var transactionNode = treeSubTree(repo.transactionQueueTree_, path); - treeForEachAncestor(transactionNode, function (node) { - repoAbortTransactionsOnNode(repo, node); - }); - repoAbortTransactionsOnNode(repo, transactionNode); - treeForEachDescendant(transactionNode, function (node) { - repoAbortTransactionsOnNode(repo, node); - }); - return affectedPath; -} -/** - * Abort transactions stored in this transaction queue node. - * - * @param node - Node to abort transactions for. - */ -function repoAbortTransactionsOnNode(repo, node) { - var queue = treeGetValue(node); - if (queue) { - // Queue up the callbacks and fire them after cleaning up all of our - // transaction state, since the callback could trigger more transactions - // or sets. - var callbacks = []; - // Go through queue. Any already-sent transactions must be marked for - // abort, while the unsent ones can be immediately aborted and removed. - var events = []; - var lastSent = -1; - for (var i = 0; i < queue.length; i++) { - if (queue[i].status === 3 /* SENT_NEEDS_ABORT */) ; - else if (queue[i].status === 1 /* SENT */) { - assert(lastSent === i - 1, 'All SENT items should be at beginning of queue.'); - lastSent = i; - // Mark transaction for abort when it comes back. - queue[i].status = 3 /* SENT_NEEDS_ABORT */; - queue[i].abortReason = 'set'; - } - else { - assert(queue[i].status === 0 /* RUN */, 'Unexpected transaction status in abort'); - // We can abort it immediately. - queue[i].unwatcher(); - events = events.concat(syncTreeAckUserWrite(repo.serverSyncTree_, queue[i].currentWriteId, true)); - if (queue[i].onComplete) { - callbacks.push(queue[i].onComplete.bind(null, new Error('set'), false, null)); - } - } - } - if (lastSent === -1) { - // We're not waiting for any sent transactions. We can clear the queue. - treeSetValue(node, undefined); - } - else { - // Remove the transactions we aborted. - queue.length = lastSent + 1; - } - // Now fire the callbacks. - eventQueueRaiseEventsForChangedPath(repo.eventQueue_, treeGetPath(node), events); - for (var i = 0; i < callbacks.length; i++) { - exceptionGuard(callbacks[i]); - } - } -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -function decodePath(pathString) { - var pathStringDecoded = ''; - var pieces = pathString.split('/'); - for (var i = 0; i < pieces.length; i++) { - if (pieces[i].length > 0) { - var piece = pieces[i]; - try { - piece = decodeURIComponent(piece.replace(/\+/g, ' ')); - } - catch (e) { } - pathStringDecoded += '/' + piece; - } - } - return pathStringDecoded; -} -/** - * @returns key value hash - */ -function decodeQuery(queryString) { - var e_1, _a; - var results = {}; - if (queryString.charAt(0) === '?') { - queryString = queryString.substring(1); - } - try { - for (var _b = __values(queryString.split('&')), _c = _b.next(); !_c.done; _c = _b.next()) { - var segment = _c.value; - if (segment.length === 0) { - continue; - } - var kv = segment.split('='); - if (kv.length === 2) { - results[decodeURIComponent(kv[0])] = decodeURIComponent(kv[1]); - } - else { - warn("Invalid query segment '" + segment + "' in query '" + queryString + "'"); - } - } - } - catch (e_1_1) { e_1 = { error: e_1_1 }; } - finally { - try { - if (_c && !_c.done && (_a = _b.return)) _a.call(_b); - } - finally { if (e_1) throw e_1.error; } - } - return results; -} -var parseRepoInfo = function (dataURL, nodeAdmin) { - var parsedUrl = parseDatabaseURL(dataURL), namespace = parsedUrl.namespace; - if (parsedUrl.domain === 'firebase.com') { - fatal(parsedUrl.host + - ' is no longer supported. ' + - 'Please use .firebaseio.com instead'); - } - // Catch common error of uninitialized namespace value. - if ((!namespace || namespace === 'undefined') && - parsedUrl.domain !== 'localhost') { - fatal('Cannot parse Firebase url. Please use https://.firebaseio.com'); - } - if (!parsedUrl.secure) { - warnIfPageIsSecure(); - } - var webSocketOnly = parsedUrl.scheme === 'ws' || parsedUrl.scheme === 'wss'; - return { - repoInfo: new RepoInfo(parsedUrl.host, parsedUrl.secure, namespace, webSocketOnly, nodeAdmin, - /*persistenceKey=*/ '', - /*includeNamespaceInQueryParams=*/ namespace !== parsedUrl.subdomain), - path: new Path(parsedUrl.pathString) - }; -}; -var parseDatabaseURL = function (dataURL) { - // Default to empty strings in the event of a malformed string. - var host = '', domain = '', subdomain = '', pathString = '', namespace = ''; - // Always default to SSL, unless otherwise specified. - var secure = true, scheme = 'https', port = 443; - // Don't do any validation here. The caller is responsible for validating the result of parsing. - if (typeof dataURL === 'string') { - // Parse scheme. - var colonInd = dataURL.indexOf('//'); - if (colonInd >= 0) { - scheme = dataURL.substring(0, colonInd - 1); - dataURL = dataURL.substring(colonInd + 2); - } - // Parse host, path, and query string. - var slashInd = dataURL.indexOf('/'); - if (slashInd === -1) { - slashInd = dataURL.length; - } - var questionMarkInd = dataURL.indexOf('?'); - if (questionMarkInd === -1) { - questionMarkInd = dataURL.length; - } - host = dataURL.substring(0, Math.min(slashInd, questionMarkInd)); - if (slashInd < questionMarkInd) { - // For pathString, questionMarkInd will always come after slashInd - pathString = decodePath(dataURL.substring(slashInd, questionMarkInd)); - } - var queryParams = decodeQuery(dataURL.substring(Math.min(dataURL.length, questionMarkInd))); - // If we have a port, use scheme for determining if it's secure. - colonInd = host.indexOf(':'); - if (colonInd >= 0) { - secure = scheme === 'https' || scheme === 'wss'; - port = parseInt(host.substring(colonInd + 1), 10); - } - else { - colonInd = host.length; - } - var hostWithoutPort = host.slice(0, colonInd); - if (hostWithoutPort.toLowerCase() === 'localhost') { - domain = 'localhost'; - } - else if (hostWithoutPort.split('.').length <= 2) { - domain = hostWithoutPort; - } - else { - // Interpret the subdomain of a 3 or more component URL as the namespace name. - var dotInd = host.indexOf('.'); - subdomain = host.substring(0, dotInd).toLowerCase(); - domain = host.substring(dotInd + 1); - // Normalize namespaces to lowercase to share storage / connection. - namespace = subdomain; - } - // Always treat the value of the `ns` as the namespace name if it is present. - if ('ns' in queryParams) { - namespace = queryParams['ns']; - } - } - return { - host: host, - port: port, - domain: domain, - subdomain: subdomain, - secure: secure, - scheme: scheme, - pathString: pathString, - namespace: namespace - }; -}; - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Encapsulates the data needed to raise an event - */ -var DataEvent = /** @class */ (function () { - /** - * @param eventType - One of: value, child_added, child_changed, child_moved, child_removed - * @param eventRegistration - The function to call to with the event data. User provided - * @param snapshot - The data backing the event - * @param prevName - Optional, the name of the previous child for child_* events. - */ - function DataEvent(eventType, eventRegistration, snapshot, prevName) { - this.eventType = eventType; - this.eventRegistration = eventRegistration; - this.snapshot = snapshot; - this.prevName = prevName; - } - DataEvent.prototype.getPath = function () { - var ref = this.snapshot.ref; - if (this.eventType === 'value') { - return ref._path; - } - else { - return ref.parent._path; - } - }; - DataEvent.prototype.getEventType = function () { - return this.eventType; - }; - DataEvent.prototype.getEventRunner = function () { - return this.eventRegistration.getEventRunner(this); - }; - DataEvent.prototype.toString = function () { - return (this.getPath().toString() + - ':' + - this.eventType + - ':' + - stringify(this.snapshot.exportVal())); - }; - return DataEvent; -}()); -var CancelEvent = /** @class */ (function () { - function CancelEvent(eventRegistration, error, path) { - this.eventRegistration = eventRegistration; - this.error = error; - this.path = path; - } - CancelEvent.prototype.getPath = function () { - return this.path; - }; - CancelEvent.prototype.getEventType = function () { - return 'cancel'; - }; - CancelEvent.prototype.getEventRunner = function () { - return this.eventRegistration.getEventRunner(this); - }; - CancelEvent.prototype.toString = function () { - return this.path.toString() + ':cancel'; - }; - return CancelEvent; -}()); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * A wrapper class that converts events from the database@exp SDK to the legacy - * Database SDK. Events are not converted directly as event registration relies - * on reference comparison of the original user callback (see `matches()`) and - * relies on equality of the legacy SDK's `context` object. - */ -var CallbackContext = /** @class */ (function () { - function CallbackContext(snapshotCallback, cancelCallback) { - this.snapshotCallback = snapshotCallback; - this.cancelCallback = cancelCallback; - } - CallbackContext.prototype.onValue = function (expDataSnapshot, previousChildName) { - this.snapshotCallback.call(null, expDataSnapshot, previousChildName); - }; - CallbackContext.prototype.onCancel = function (error) { - assert(this.hasCancelCallback, 'Raising a cancel event on a listener with no cancel callback'); - return this.cancelCallback.call(null, error); - }; - Object.defineProperty(CallbackContext.prototype, "hasCancelCallback", { - get: function () { - return !!this.cancelCallback; - }, - enumerable: false, - configurable: true - }); - CallbackContext.prototype.matches = function (other) { - return (this.snapshotCallback === other.snapshotCallback || - (this.snapshotCallback.userCallback !== undefined && - this.snapshotCallback.userCallback === - other.snapshotCallback.userCallback && - this.snapshotCallback.context === other.snapshotCallback.context)); - }; - return CallbackContext; -}()); - -/** - * @license - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * The `onDisconnect` class allows you to write or clear data when your client - * disconnects from the Database server. These updates occur whether your - * client disconnects cleanly or not, so you can rely on them to clean up data - * even if a connection is dropped or a client crashes. - * - * The `onDisconnect` class is most commonly used to manage presence in - * applications where it is useful to detect how many clients are connected and - * when other clients disconnect. See - * {@link https://firebase.google.com/docs/database/web/offline-capabilities | Enabling Offline Capabilities in JavaScript} - * for more information. - * - * To avoid problems when a connection is dropped before the requests can be - * transferred to the Database server, these functions should be called before - * writing any data. - * - * Note that `onDisconnect` operations are only triggered once. If you want an - * operation to occur each time a disconnect occurs, you'll need to re-establish - * the `onDisconnect` operations each time you reconnect. - */ -var OnDisconnect = /** @class */ (function () { - /** @hideconstructor */ - function OnDisconnect(_repo, _path) { - this._repo = _repo; - this._path = _path; - } - /** - * Cancels all previously queued `onDisconnect()` set or update events for this - * location and all children. - * - * If a write has been queued for this location via a `set()` or `update()` at a - * parent location, the write at this location will be canceled, though writes - * to sibling locations will still occur. - * - * @returns Resolves when synchronization to the server is complete. - */ - OnDisconnect.prototype.cancel = function () { - var deferred = new Deferred(); - repoOnDisconnectCancel(this._repo, this._path, deferred.wrapCallback(function () { })); - return deferred.promise; - }; - /** - * Ensures the data at this location is deleted when the client is disconnected - * (due to closing the browser, navigating to a new page, or network issues). - * - * @returns Resolves when synchronization to the server is complete. - */ - OnDisconnect.prototype.remove = function () { - validateWritablePath('OnDisconnect.remove', this._path); - var deferred = new Deferred(); - repoOnDisconnectSet(this._repo, this._path, null, deferred.wrapCallback(function () { })); - return deferred.promise; - }; - /** - * Ensures the data at this location is set to the specified value when the - * client is disconnected (due to closing the browser, navigating to a new page, - * or network issues). - * - * `set()` is especially useful for implementing "presence" systems, where a - * value should be changed or cleared when a user disconnects so that they - * appear "offline" to other users. See - * {@link https://firebase.google.com/docs/database/web/offline-capabilities | Enabling Offline Capabilities in JavaScript} - * for more information. - * - * Note that `onDisconnect` operations are only triggered once. If you want an - * operation to occur each time a disconnect occurs, you'll need to re-establish - * the `onDisconnect` operations each time. - * - * @param value - The value to be written to this location on disconnect (can - * be an object, array, string, number, boolean, or null). - * @returns Resolves when synchronization to the Database is complete. - */ - OnDisconnect.prototype.set = function (value) { - validateWritablePath('OnDisconnect.set', this._path); - validateFirebaseDataArg('OnDisconnect.set', value, this._path, false); - var deferred = new Deferred(); - repoOnDisconnectSet(this._repo, this._path, value, deferred.wrapCallback(function () { })); - return deferred.promise; - }; - /** - * Ensures the data at this location is set to the specified value and priority - * when the client is disconnected (due to closing the browser, navigating to a - * new page, or network issues). - * - * @param value - The value to be written to this location on disconnect (can - * be an object, array, string, number, boolean, or null). - * @param priority - The priority to be written (string, number, or null). - * @returns Resolves when synchronization to the Database is complete. - */ - OnDisconnect.prototype.setWithPriority = function (value, priority) { - validateWritablePath('OnDisconnect.setWithPriority', this._path); - validateFirebaseDataArg('OnDisconnect.setWithPriority', value, this._path, false); - validatePriority('OnDisconnect.setWithPriority', priority, false); - var deferred = new Deferred(); - repoOnDisconnectSetWithPriority(this._repo, this._path, value, priority, deferred.wrapCallback(function () { })); - return deferred.promise; - }; - /** - * Writes multiple values at this location when the client is disconnected (due - * to closing the browser, navigating to a new page, or network issues). - * - * The `values` argument contains multiple property-value pairs that will be - * written to the Database together. Each child property can either be a simple - * property (for example, "name") or a relative path (for example, "name/first") - * from the current location to the data to update. - * - * As opposed to the `set()` method, `update()` can be use to selectively update - * only the referenced properties at the current location (instead of replacing - * all the child properties at the current location). - * - * @param values - Object containing multiple values. - * @returns Resolves when synchronization to the Database is complete. - */ - OnDisconnect.prototype.update = function (values) { - validateWritablePath('OnDisconnect.update', this._path); - validateFirebaseMergeDataArg('OnDisconnect.update', values, this._path, false); - var deferred = new Deferred(); - repoOnDisconnectUpdate(this._repo, this._path, values, deferred.wrapCallback(function () { })); - return deferred.promise; - }; - return OnDisconnect; -}()); - -/** - * @license - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * @internal - */ -var QueryImpl = /** @class */ (function () { - /** - * @hideconstructor - */ - function QueryImpl(_repo, _path, _queryParams, _orderByCalled) { - this._repo = _repo; - this._path = _path; - this._queryParams = _queryParams; - this._orderByCalled = _orderByCalled; - } - Object.defineProperty(QueryImpl.prototype, "key", { - get: function () { - if (pathIsEmpty(this._path)) { - return null; - } - else { - return pathGetBack(this._path); - } - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(QueryImpl.prototype, "ref", { - get: function () { - return new ReferenceImpl(this._repo, this._path); - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(QueryImpl.prototype, "_queryIdentifier", { - get: function () { - var obj = queryParamsGetQueryObject(this._queryParams); - var id = ObjectToUniqueKey(obj); - return id === '{}' ? 'default' : id; - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(QueryImpl.prototype, "_queryObject", { - /** - * An object representation of the query parameters used by this Query. - */ - get: function () { - return queryParamsGetQueryObject(this._queryParams); - }, - enumerable: false, - configurable: true - }); - QueryImpl.prototype.isEqual = function (other) { - other = getModularInstance(other); - if (!(other instanceof QueryImpl)) { - return false; - } - var sameRepo = this._repo === other._repo; - var samePath = pathEquals(this._path, other._path); - var sameQueryIdentifier = this._queryIdentifier === other._queryIdentifier; - return sameRepo && samePath && sameQueryIdentifier; - }; - QueryImpl.prototype.toJSON = function () { - return this.toString(); - }; - QueryImpl.prototype.toString = function () { - return this._repo.toString() + pathToUrlEncodedString(this._path); - }; - return QueryImpl; -}()); -/** - * Validates that no other order by call has been made - */ -function validateNoPreviousOrderByCall(query, fnName) { - if (query._orderByCalled === true) { - throw new Error(fnName + ": You can't combine multiple orderBy calls."); - } -} -/** - * Validates start/end values for queries. - */ -function validateQueryEndpoints(params) { - var startNode = null; - var endNode = null; - if (params.hasStart()) { - startNode = params.getIndexStartValue(); - } - if (params.hasEnd()) { - endNode = params.getIndexEndValue(); - } - if (params.getIndex() === KEY_INDEX) { - var tooManyArgsError = 'Query: When ordering by key, you may only pass one argument to ' + - 'startAt(), endAt(), or equalTo().'; - var wrongArgTypeError = 'Query: When ordering by key, the argument passed to startAt(), startAfter(), ' + - 'endAt(), endBefore(), or equalTo() must be a string.'; - if (params.hasStart()) { - var startName = params.getIndexStartName(); - if (startName !== MIN_NAME) { - throw new Error(tooManyArgsError); - } - else if (typeof startNode !== 'string') { - throw new Error(wrongArgTypeError); - } - } - if (params.hasEnd()) { - var endName = params.getIndexEndName(); - if (endName !== MAX_NAME) { - throw new Error(tooManyArgsError); - } - else if (typeof endNode !== 'string') { - throw new Error(wrongArgTypeError); - } - } - } - else if (params.getIndex() === PRIORITY_INDEX) { - if ((startNode != null && !isValidPriority(startNode)) || - (endNode != null && !isValidPriority(endNode))) { - throw new Error('Query: When ordering by priority, the first argument passed to startAt(), ' + - 'startAfter() endAt(), endBefore(), or equalTo() must be a valid priority value ' + - '(null, a number, or a string).'); - } - } - else { - assert(params.getIndex() instanceof PathIndex || - params.getIndex() === VALUE_INDEX, 'unknown index type.'); - if ((startNode != null && typeof startNode === 'object') || - (endNode != null && typeof endNode === 'object')) { - throw new Error('Query: First argument passed to startAt(), startAfter(), endAt(), endBefore(), or ' + - 'equalTo() cannot be an object.'); - } - } -} -/** - * Validates that limit* has been called with the correct combination of parameters - */ -function validateLimit(params) { - if (params.hasStart() && - params.hasEnd() && - params.hasLimit() && - !params.hasAnchoredLimit()) { - throw new Error("Query: Can't combine startAt(), startAfter(), endAt(), endBefore(), and limit(). Use " + - 'limitToFirst() or limitToLast() instead.'); - } -} -/** - * @internal - */ -var ReferenceImpl = /** @class */ (function (_super) { - __extends(ReferenceImpl, _super); - /** @hideconstructor */ - function ReferenceImpl(repo, path) { - return _super.call(this, repo, path, new QueryParams(), false) || this; - } - Object.defineProperty(ReferenceImpl.prototype, "parent", { - get: function () { - var parentPath = pathParent(this._path); - return parentPath === null - ? null - : new ReferenceImpl(this._repo, parentPath); - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(ReferenceImpl.prototype, "root", { - get: function () { - var ref = this; - while (ref.parent !== null) { - ref = ref.parent; - } - return ref; - }, - enumerable: false, - configurable: true - }); - return ReferenceImpl; -}(QueryImpl)); -/** - * A `DataSnapshot` contains data from a Database location. - * - * Any time you read data from the Database, you receive the data as a - * `DataSnapshot`. A `DataSnapshot` is passed to the event callbacks you attach - * with `on()` or `once()`. You can extract the contents of the snapshot as a - * JavaScript object by calling the `val()` method. Alternatively, you can - * traverse into the snapshot by calling `child()` to return child snapshots - * (which you could then call `val()` on). - * - * A `DataSnapshot` is an efficiently generated, immutable copy of the data at - * a Database location. It cannot be modified and will never change (to modify - * data, you always call the `set()` method on a `Reference` directly). - */ -var DataSnapshot = /** @class */ (function () { - /** - * @param _node - A SnapshotNode to wrap. - * @param ref - The location this snapshot came from. - * @param _index - The iteration order for this snapshot - * @hideconstructor - */ - function DataSnapshot(_node, - /** - * The location of this DataSnapshot. - */ - ref, _index) { - this._node = _node; - this.ref = ref; - this._index = _index; - } - Object.defineProperty(DataSnapshot.prototype, "priority", { - /** - * Gets the priority value of the data in this `DataSnapshot`. - * - * Applications need not use priority but can order collections by - * ordinary properties (see - * {@link https://firebase.google.com/docs/database/web/lists-of-data#sorting_and_filtering_data |Sorting and filtering data} - * ). - */ - get: function () { - // typecast here because we never return deferred values or internal priorities (MAX_PRIORITY) - return this._node.getPriority().val(); - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(DataSnapshot.prototype, "key", { - /** - * The key (last part of the path) of the location of this `DataSnapshot`. - * - * The last token in a Database location is considered its key. For example, - * "ada" is the key for the /users/ada/ node. Accessing the key on any - * `DataSnapshot` will return the key for the location that generated it. - * However, accessing the key on the root URL of a Database will return - * `null`. - */ - get: function () { - return this.ref.key; - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(DataSnapshot.prototype, "size", { - /** Returns the number of child properties of this `DataSnapshot`. */ - get: function () { - return this._node.numChildren(); - }, - enumerable: false, - configurable: true - }); - /** - * Gets another `DataSnapshot` for the location at the specified relative path. - * - * Passing a relative path to the `child()` method of a DataSnapshot returns - * another `DataSnapshot` for the location at the specified relative path. The - * relative path can either be a simple child name (for example, "ada") or a - * deeper, slash-separated path (for example, "ada/name/first"). If the child - * location has no data, an empty `DataSnapshot` (that is, a `DataSnapshot` - * whose value is `null`) is returned. - * - * @param path - A relative path to the location of child data. - */ - DataSnapshot.prototype.child = function (path) { - var childPath = new Path(path); - var childRef = child(this.ref, path); - return new DataSnapshot(this._node.getChild(childPath), childRef, PRIORITY_INDEX); - }; - /** - * Returns true if this `DataSnapshot` contains any data. It is slightly more - * efficient than using `snapshot.val() !== null`. - */ - DataSnapshot.prototype.exists = function () { - return !this._node.isEmpty(); - }; - /** - * Exports the entire contents of the DataSnapshot as a JavaScript object. - * - * The `exportVal()` method is similar to `val()`, except priority information - * is included (if available), making it suitable for backing up your data. - * - * @returns The DataSnapshot's contents as a JavaScript value (Object, - * Array, string, number, boolean, or `null`). - */ - // eslint-disable-next-line @typescript-eslint/no-explicit-any - DataSnapshot.prototype.exportVal = function () { - return this._node.val(true); - }; - /** - * Enumerates the top-level children in the `DataSnapshot`. - * - * Because of the way JavaScript objects work, the ordering of data in the - * JavaScript object returned by `val()` is not guaranteed to match the - * ordering on the server nor the ordering of `onChildAdded()` events. That is - * where `forEach()` comes in handy. It guarantees the children of a - * `DataSnapshot` will be iterated in their query order. - * - * If no explicit `orderBy*()` method is used, results are returned - * ordered by key (unless priorities are used, in which case, results are - * returned by priority). - * - * @param action - A function that will be called for each child DataSnapshot. - * The callback can return true to cancel further enumeration. - * @returns true if enumeration was canceled due to your callback returning - * true. - */ - DataSnapshot.prototype.forEach = function (action) { - var _this = this; - if (this._node.isLeafNode()) { - return false; - } - var childrenNode = this._node; - // Sanitize the return value to a boolean. ChildrenNode.forEachChild has a weird return type... - return !!childrenNode.forEachChild(this._index, function (key, node) { - return action(new DataSnapshot(node, child(_this.ref, key), PRIORITY_INDEX)); - }); - }; - /** - * Returns true if the specified child path has (non-null) data. - * - * @param path - A relative path to the location of a potential child. - * @returns `true` if data exists at the specified child path; else - * `false`. - */ - DataSnapshot.prototype.hasChild = function (path) { - var childPath = new Path(path); - return !this._node.getChild(childPath).isEmpty(); - }; - /** - * Returns whether or not the `DataSnapshot` has any non-`null` child - * properties. - * - * You can use `hasChildren()` to determine if a `DataSnapshot` has any - * children. If it does, you can enumerate them using `forEach()`. If it - * doesn't, then either this snapshot contains a primitive value (which can be - * retrieved with `val()`) or it is empty (in which case, `val()` will return - * `null`). - * - * @returns true if this snapshot has any children; else false. - */ - DataSnapshot.prototype.hasChildren = function () { - if (this._node.isLeafNode()) { - return false; - } - else { - return !this._node.isEmpty(); - } - }; - /** - * Returns a JSON-serializable representation of this object. - */ - DataSnapshot.prototype.toJSON = function () { - return this.exportVal(); - }; - /** - * Extracts a JavaScript value from a `DataSnapshot`. - * - * Depending on the data in a `DataSnapshot`, the `val()` method may return a - * scalar type (string, number, or boolean), an array, or an object. It may - * also return null, indicating that the `DataSnapshot` is empty (contains no - * data). - * - * @returns The DataSnapshot's contents as a JavaScript value (Object, - * Array, string, number, boolean, or `null`). - */ - // eslint-disable-next-line @typescript-eslint/no-explicit-any - DataSnapshot.prototype.val = function () { - return this._node.val(); - }; - return DataSnapshot; -}()); -/** - * - * Returns a `Reference` representing the location in the Database - * corresponding to the provided path. If no path is provided, the `Reference` - * will point to the root of the Database. - * - * @param db - The database instance to obtain a reference for. - * @param path - Optional path representing the location the returned - * `Reference` will point. If not provided, the returned `Reference` will - * point to the root of the Database. - * @returns If a path is provided, a `Reference` - * pointing to the provided path. Otherwise, a `Reference` pointing to the - * root of the Database. - */ -function ref(db, path) { - db = getModularInstance(db); - db._checkNotDeleted('ref'); - return path !== undefined ? child(db._root, path) : db._root; -} -/** - * Returns a `Reference` representing the location in the Database - * corresponding to the provided Firebase URL. - * - * An exception is thrown if the URL is not a valid Firebase Database URL or it - * has a different domain than the current `Database` instance. - * - * Note that all query parameters (`orderBy`, `limitToLast`, etc.) are ignored - * and are not applied to the returned `Reference`. - * - * @param db - The database instance to obtain a reference for. - * @param url - The Firebase URL at which the returned `Reference` will - * point. - * @returns A `Reference` pointing to the provided - * Firebase URL. - */ -function refFromURL(db, url) { - db = getModularInstance(db); - db._checkNotDeleted('refFromURL'); - var parsedURL = parseRepoInfo(url, db._repo.repoInfo_.nodeAdmin); - validateUrl('refFromURL', parsedURL); - var repoInfo = parsedURL.repoInfo; - if (!db._repo.repoInfo_.isCustomHost() && - repoInfo.host !== db._repo.repoInfo_.host) { - fatal('refFromURL' + - ': Host name does not match the current database: ' + - '(found ' + - repoInfo.host + - ' but expected ' + - db._repo.repoInfo_.host + - ')'); - } - return ref(db, parsedURL.path.toString()); -} -/** - * Gets a `Reference` for the location at the specified relative path. - * - * The relative path can either be a simple child name (for example, "ada") or - * a deeper slash-separated path (for example, "ada/name/first"). - * - * @param parent - The parent location. - * @param path - A relative path from this location to the desired child - * location. - * @returns The specified child location. - */ -function child(parent, path) { - parent = getModularInstance(parent); - if (pathGetFront(parent._path) === null) { - validateRootPathString('child', 'path', path, false); - } - else { - validatePathString('child', 'path', path, false); - } - return new ReferenceImpl(parent._repo, pathChild(parent._path, path)); -} -/** - * Returns an `OnDisconnect` object - see - * {@link https://firebase.google.com/docs/database/web/offline-capabilities | Enabling Offline Capabilities in JavaScript} - * for more information on how to use it. - * - * @param ref - The reference to add OnDisconnect triggers for. - */ -function onDisconnect(ref) { - ref = getModularInstance(ref); - return new OnDisconnect(ref._repo, ref._path); -} -/** - * Generates a new child location using a unique key and returns its - * `Reference`. - * - * This is the most common pattern for adding data to a collection of items. - * - * If you provide a value to `push()`, the value is written to the - * generated location. If you don't pass a value, nothing is written to the - * database and the child remains empty (but you can use the `Reference` - * elsewhere). - * - * The unique keys generated by `push()` are ordered by the current time, so the - * resulting list of items is chronologically sorted. The keys are also - * designed to be unguessable (they contain 72 random bits of entropy). - * - * See {@link https://firebase.google.com/docs/database/web/lists-of-data#append_to_a_list_of_data | Append to a list of data}. - * See {@link https://firebase.googleblog.com/2015/02/the-2120-ways-to-ensure-unique_68.html | The 2^120 Ways to Ensure Unique Identifiers}. - * - * @param parent - The parent location. - * @param value - Optional value to be written at the generated location. - * @returns Combined `Promise` and `Reference`; resolves when write is complete, - * but can be used immediately as the `Reference` to the child location. - */ -function push(parent, value) { - parent = getModularInstance(parent); - validateWritablePath('push', parent._path); - validateFirebaseDataArg('push', value, parent._path, true); - var now = repoServerTime(parent._repo); - var name = nextPushId(now); - // push() returns a ThennableReference whose promise is fulfilled with a - // regular Reference. We use child() to create handles to two different - // references. The first is turned into a ThennableReference below by adding - // then() and catch() methods and is used as the return value of push(). The - // second remains a regular Reference and is used as the fulfilled value of - // the first ThennableReference. - var thennablePushRef = child(parent, name); - var pushRef = child(parent, name); - var promise; - if (value != null) { - promise = set(pushRef, value).then(function () { return pushRef; }); - } - else { - promise = Promise.resolve(pushRef); - } - thennablePushRef.then = promise.then.bind(promise); - thennablePushRef.catch = promise.then.bind(promise, undefined); - return thennablePushRef; -} -/** - * Removes the data at this Database location. - * - * Any data at child locations will also be deleted. - * - * The effect of the remove will be visible immediately and the corresponding - * event 'value' will be triggered. Synchronization of the remove to the - * Firebase servers will also be started, and the returned Promise will resolve - * when complete. If provided, the onComplete callback will be called - * asynchronously after synchronization has finished. - * - * @param ref - The location to remove. - * @returns Resolves when remove on server is complete. - */ -function remove(ref) { - validateWritablePath('remove', ref._path); - return set(ref, null); -} -/** - * Writes data to this Database location. - * - * This will overwrite any data at this location and all child locations. - * - * The effect of the write will be visible immediately, and the corresponding - * events ("value", "child_added", etc.) will be triggered. Synchronization of - * the data to the Firebase servers will also be started, and the returned - * Promise will resolve when complete. If provided, the `onComplete` callback - * will be called asynchronously after synchronization has finished. - * - * Passing `null` for the new value is equivalent to calling `remove()`; namely, - * all data at this location and all child locations will be deleted. - * - * `set()` will remove any priority stored at this location, so if priority is - * meant to be preserved, you need to use `setWithPriority()` instead. - * - * Note that modifying data with `set()` will cancel any pending transactions - * at that location, so extreme care should be taken if mixing `set()` and - * `transaction()` to modify the same data. - * - * A single `set()` will generate a single "value" event at the location where - * the `set()` was performed. - * - * @param ref - The location to write to. - * @param value - The value to be written (string, number, boolean, object, - * array, or null). - * @returns Resolves when write to server is complete. - */ -function set(ref, value) { - ref = getModularInstance(ref); - validateWritablePath('set', ref._path); - validateFirebaseDataArg('set', value, ref._path, false); - var deferred = new Deferred(); - repoSetWithPriority(ref._repo, ref._path, value, - /*priority=*/ null, deferred.wrapCallback(function () { })); - return deferred.promise; -} -/** - * Sets a priority for the data at this Database location. - * - * Applications need not use priority but can order collections by - * ordinary properties (see - * {@link https://firebase.google.com/docs/database/web/lists-of-data#sorting_and_filtering_data | Sorting and filtering data} - * ). - * - * @param ref - The location to write to. - * @param priority - The priority to be written (string, number, or null). - * @returns Resolves when write to server is complete. - */ -function setPriority(ref, priority) { - ref = getModularInstance(ref); - validateWritablePath('setPriority', ref._path); - validatePriority('setPriority', priority, false); - var deferred = new Deferred(); - repoSetWithPriority(ref._repo, pathChild(ref._path, '.priority'), priority, null, deferred.wrapCallback(function () { })); - return deferred.promise; -} -/** - * Writes data the Database location. Like `set()` but also specifies the - * priority for that data. - * - * Applications need not use priority but can order collections by - * ordinary properties (see - * {@link https://firebase.google.com/docs/database/web/lists-of-data#sorting_and_filtering_data | Sorting and filtering data} - * ). - * - * @param ref - The location to write to. - * @param value - The value to be written (string, number, boolean, object, - * array, or null). - * @param priority - The priority to be written (string, number, or null). - * @returns Resolves when write to server is complete. - */ -function setWithPriority(ref, value, priority) { - validateWritablePath('setWithPriority', ref._path); - validateFirebaseDataArg('setWithPriority', value, ref._path, false); - validatePriority('setWithPriority', priority, false); - if (ref.key === '.length' || ref.key === '.keys') { - throw 'setWithPriority failed: ' + ref.key + ' is a read-only object.'; - } - var deferred = new Deferred(); - repoSetWithPriority(ref._repo, ref._path, value, priority, deferred.wrapCallback(function () { })); - return deferred.promise; -} -/** - * Writes multiple values to the Database at once. - * - * The `values` argument contains multiple property-value pairs that will be - * written to the Database together. Each child property can either be a simple - * property (for example, "name") or a relative path (for example, - * "name/first") from the current location to the data to update. - * - * As opposed to the `set()` method, `update()` can be use to selectively update - * only the referenced properties at the current location (instead of replacing - * all the child properties at the current location). - * - * The effect of the write will be visible immediately, and the corresponding - * events ('value', 'child_added', etc.) will be triggered. Synchronization of - * the data to the Firebase servers will also be started, and the returned - * Promise will resolve when complete. If provided, the `onComplete` callback - * will be called asynchronously after synchronization has finished. - * - * A single `update()` will generate a single "value" event at the location - * where the `update()` was performed, regardless of how many children were - * modified. - * - * Note that modifying data with `update()` will cancel any pending - * transactions at that location, so extreme care should be taken if mixing - * `update()` and `transaction()` to modify the same data. - * - * Passing `null` to `update()` will remove the data at this location. - * - * See - * {@link https://firebase.googleblog.com/2015/09/introducing-multi-location-updates-and_86.html | Introducing multi-location updates and more}. - * - * @param ref - The location to write to. - * @param values - Object containing multiple values. - * @returns Resolves when update on server is complete. - */ -function update(ref, values) { - validateFirebaseMergeDataArg('update', values, ref._path, false); - var deferred = new Deferred(); - repoUpdate(ref._repo, ref._path, values, deferred.wrapCallback(function () { })); - return deferred.promise; -} -/** - * Gets the most up-to-date result for this query. - * - * @param query - The query to run. - * @returns A `Promise` which resolves to the resulting DataSnapshot if a value is - * available, or rejects if the client is unable to return a value (e.g., if the - * server is unreachable and there is nothing cached). - */ -function get(query) { - query = getModularInstance(query); - var callbackContext = new CallbackContext(function () { }); - var container = new ValueEventRegistration(callbackContext); - return repoGetValue(query._repo, query, container).then(function (node) { - return new DataSnapshot(node, new ReferenceImpl(query._repo, query._path), query._queryParams.getIndex()); - }); -} -/** - * Represents registration for 'value' events. - */ -var ValueEventRegistration = /** @class */ (function () { - function ValueEventRegistration(callbackContext) { - this.callbackContext = callbackContext; - } - ValueEventRegistration.prototype.respondsTo = function (eventType) { - return eventType === 'value'; - }; - ValueEventRegistration.prototype.createEvent = function (change, query) { - var index = query._queryParams.getIndex(); - return new DataEvent('value', this, new DataSnapshot(change.snapshotNode, new ReferenceImpl(query._repo, query._path), index)); - }; - ValueEventRegistration.prototype.getEventRunner = function (eventData) { - var _this = this; - if (eventData.getEventType() === 'cancel') { - return function () { - return _this.callbackContext.onCancel(eventData.error); - }; - } - else { - return function () { - return _this.callbackContext.onValue(eventData.snapshot, null); - }; - } - }; - ValueEventRegistration.prototype.createCancelEvent = function (error, path) { - if (this.callbackContext.hasCancelCallback) { - return new CancelEvent(this, error, path); - } - else { - return null; - } - }; - ValueEventRegistration.prototype.matches = function (other) { - if (!(other instanceof ValueEventRegistration)) { - return false; - } - else if (!other.callbackContext || !this.callbackContext) { - // If no callback specified, we consider it to match any callback. - return true; - } - else { - return other.callbackContext.matches(this.callbackContext); - } - }; - ValueEventRegistration.prototype.hasAnyCallback = function () { - return this.callbackContext !== null; - }; - return ValueEventRegistration; -}()); -/** - * Represents the registration of a child_x event. - */ -var ChildEventRegistration = /** @class */ (function () { - function ChildEventRegistration(eventType, callbackContext) { - this.eventType = eventType; - this.callbackContext = callbackContext; - } - ChildEventRegistration.prototype.respondsTo = function (eventType) { - var eventToCheck = eventType === 'children_added' ? 'child_added' : eventType; - eventToCheck = - eventToCheck === 'children_removed' ? 'child_removed' : eventToCheck; - return this.eventType === eventToCheck; - }; - ChildEventRegistration.prototype.createCancelEvent = function (error, path) { - if (this.callbackContext.hasCancelCallback) { - return new CancelEvent(this, error, path); - } - else { - return null; - } - }; - ChildEventRegistration.prototype.createEvent = function (change, query) { - assert(change.childName != null, 'Child events should have a childName.'); - var childRef = child(new ReferenceImpl(query._repo, query._path), change.childName); - var index = query._queryParams.getIndex(); - return new DataEvent(change.type, this, new DataSnapshot(change.snapshotNode, childRef, index), change.prevName); - }; - ChildEventRegistration.prototype.getEventRunner = function (eventData) { - var _this = this; - if (eventData.getEventType() === 'cancel') { - return function () { - return _this.callbackContext.onCancel(eventData.error); - }; - } - else { - return function () { - return _this.callbackContext.onValue(eventData.snapshot, eventData.prevName); - }; - } - }; - ChildEventRegistration.prototype.matches = function (other) { - if (other instanceof ChildEventRegistration) { - return (this.eventType === other.eventType && - (!this.callbackContext || - !other.callbackContext || - this.callbackContext.matches(other.callbackContext))); - } - return false; - }; - ChildEventRegistration.prototype.hasAnyCallback = function () { - return !!this.callbackContext; - }; - return ChildEventRegistration; -}()); -function addEventListener(query, eventType, callback, cancelCallbackOrListenOptions, options) { - var cancelCallback; - if (typeof cancelCallbackOrListenOptions === 'object') { - cancelCallback = undefined; - options = cancelCallbackOrListenOptions; - } - if (typeof cancelCallbackOrListenOptions === 'function') { - cancelCallback = cancelCallbackOrListenOptions; - } - if (options && options.onlyOnce) { - var userCallback_1 = callback; - var onceCallback = function (dataSnapshot, previousChildName) { - repoRemoveEventCallbackForQuery(query._repo, query, container); - userCallback_1(dataSnapshot, previousChildName); - }; - onceCallback.userCallback = callback.userCallback; - onceCallback.context = callback.context; - callback = onceCallback; - } - var callbackContext = new CallbackContext(callback, cancelCallback || undefined); - var container = eventType === 'value' - ? new ValueEventRegistration(callbackContext) - : new ChildEventRegistration(eventType, callbackContext); - repoAddEventCallbackForQuery(query._repo, query, container); - return function () { return repoRemoveEventCallbackForQuery(query._repo, query, container); }; -} -function onValue(query, callback, cancelCallbackOrListenOptions, options) { - return addEventListener(query, 'value', callback, cancelCallbackOrListenOptions, options); -} -function onChildAdded(query, callback, cancelCallbackOrListenOptions, options) { - return addEventListener(query, 'child_added', callback, cancelCallbackOrListenOptions, options); -} -function onChildChanged(query, callback, cancelCallbackOrListenOptions, options) { - return addEventListener(query, 'child_changed', callback, cancelCallbackOrListenOptions, options); -} -function onChildMoved(query, callback, cancelCallbackOrListenOptions, options) { - return addEventListener(query, 'child_moved', callback, cancelCallbackOrListenOptions, options); -} -function onChildRemoved(query, callback, cancelCallbackOrListenOptions, options) { - return addEventListener(query, 'child_removed', callback, cancelCallbackOrListenOptions, options); -} -/** - * Detaches a callback previously attached with the corresponding `on*()` (`onValue`, `onChildAdded`) listener. - * Note: This is not the recommended way to remove a listener. Instead, please use the returned callback function from - * the respective `on*` callbacks. - * - * Detach a callback previously attached with `on*()`. Calling `off()` on a parent listener - * will not automatically remove listeners registered on child nodes, `off()` - * must also be called on any child listeners to remove the callback. - * - * If a callback is not specified, all callbacks for the specified eventType - * will be removed. Similarly, if no eventType is specified, all callbacks - * for the `Reference` will be removed. - * - * Individual listeners can also be removed by invoking their unsubscribe - * callbacks. - * - * @param query - The query that the listener was registered with. - * @param eventType - One of the following strings: "value", "child_added", - * "child_changed", "child_removed", or "child_moved." If omitted, all callbacks - * for the `Reference` will be removed. - * @param callback - The callback function that was passed to `on()` or - * `undefined` to remove all callbacks. - */ -function off(query, eventType, callback) { - var container = null; - var expCallback = callback ? new CallbackContext(callback) : null; - if (eventType === 'value') { - container = new ValueEventRegistration(expCallback); - } - else if (eventType) { - container = new ChildEventRegistration(eventType, expCallback); - } - repoRemoveEventCallbackForQuery(query._repo, query, container); -} -/** - * A `QueryConstraint` is used to narrow the set of documents returned by a - * Database query. `QueryConstraint`s are created by invoking {@link endAt}, - * {@link endBefore}, {@link startAt}, {@link startAfter}, {@link - * limitToFirst}, {@link limitToLast}, {@link orderByChild}, - * {@link orderByChild}, {@link orderByKey} , {@link orderByPriority} , - * {@link orderByValue} or {@link equalTo} and - * can then be passed to {@link query} to create a new query instance that - * also contains this `QueryConstraint`. - */ -var QueryConstraint = /** @class */ (function () { - function QueryConstraint() { - } - return QueryConstraint; -}()); -var QueryEndAtConstraint = /** @class */ (function (_super) { - __extends(QueryEndAtConstraint, _super); - function QueryEndAtConstraint(_value, _key) { - var _this = _super.call(this) || this; - _this._value = _value; - _this._key = _key; - return _this; - } - QueryEndAtConstraint.prototype._apply = function (query) { - validateFirebaseDataArg('endAt', this._value, query._path, true); - var newParams = queryParamsEndAt(query._queryParams, this._value, this._key); - validateLimit(newParams); - validateQueryEndpoints(newParams); - if (query._queryParams.hasEnd()) { - throw new Error('endAt: Starting point was already set (by another call to endAt, ' + - 'endBefore or equalTo).'); - } - return new QueryImpl(query._repo, query._path, newParams, query._orderByCalled); - }; - return QueryEndAtConstraint; -}(QueryConstraint)); -/** - * Creates a `QueryConstraint` with the specified ending point. - * - * Using `startAt()`, `startAfter()`, `endBefore()`, `endAt()` and `equalTo()` - * allows you to choose arbitrary starting and ending points for your queries. - * - * The ending point is inclusive, so children with exactly the specified value - * will be included in the query. The optional key argument can be used to - * further limit the range of the query. If it is specified, then children that - * have exactly the specified value must also have a key name less than or equal - * to the specified key. - * - * You can read more about `endAt()` in - * {@link https://firebase.google.com/docs/database/web/lists-of-data#filtering_data | Filtering data}. - * - * @param value - The value to end at. The argument type depends on which - * `orderBy*()` function was used in this query. Specify a value that matches - * the `orderBy*()` type. When used in combination with `orderByKey()`, the - * value must be a string. - * @param key - The child key to end at, among the children with the previously - * specified priority. This argument is only allowed if ordering by child, - * value, or priority. - */ -function endAt(value, key) { - validateKey('endAt', 'key', key, true); - return new QueryEndAtConstraint(value, key); -} -var QueryEndBeforeConstraint = /** @class */ (function (_super) { - __extends(QueryEndBeforeConstraint, _super); - function QueryEndBeforeConstraint(_value, _key) { - var _this = _super.call(this) || this; - _this._value = _value; - _this._key = _key; - return _this; - } - QueryEndBeforeConstraint.prototype._apply = function (query) { - validateFirebaseDataArg('endBefore', this._value, query._path, false); - var newParams = queryParamsEndBefore(query._queryParams, this._value, this._key); - validateLimit(newParams); - validateQueryEndpoints(newParams); - if (query._queryParams.hasEnd()) { - throw new Error('endBefore: Starting point was already set (by another call to endAt, ' + - 'endBefore or equalTo).'); - } - return new QueryImpl(query._repo, query._path, newParams, query._orderByCalled); - }; - return QueryEndBeforeConstraint; -}(QueryConstraint)); -/** - * Creates a `QueryConstraint` with the specified ending point (exclusive). - * - * Using `startAt()`, `startAfter()`, `endBefore()`, `endAt()` and `equalTo()` - * allows you to choose arbitrary starting and ending points for your queries. - * - * The ending point is exclusive. If only a value is provided, children - * with a value less than the specified value will be included in the query. - * If a key is specified, then children must have a value less than or equal - * to the specified value and a key name less than the specified key. - * - * @param value - The value to end before. The argument type depends on which - * `orderBy*()` function was used in this query. Specify a value that matches - * the `orderBy*()` type. When used in combination with `orderByKey()`, the - * value must be a string. - * @param key - The child key to end before, among the children with the - * previously specified priority. This argument is only allowed if ordering by - * child, value, or priority. - */ -function endBefore(value, key) { - validateKey('endBefore', 'key', key, true); - return new QueryEndBeforeConstraint(value, key); -} -var QueryStartAtConstraint = /** @class */ (function (_super) { - __extends(QueryStartAtConstraint, _super); - function QueryStartAtConstraint(_value, _key) { - var _this = _super.call(this) || this; - _this._value = _value; - _this._key = _key; - return _this; - } - QueryStartAtConstraint.prototype._apply = function (query) { - validateFirebaseDataArg('startAt', this._value, query._path, true); - var newParams = queryParamsStartAt(query._queryParams, this._value, this._key); - validateLimit(newParams); - validateQueryEndpoints(newParams); - if (query._queryParams.hasStart()) { - throw new Error('startAt: Starting point was already set (by another call to startAt, ' + - 'startBefore or equalTo).'); - } - return new QueryImpl(query._repo, query._path, newParams, query._orderByCalled); - }; - return QueryStartAtConstraint; -}(QueryConstraint)); -/** - * Creates a `QueryConstraint` with the specified starting point. - * - * Using `startAt()`, `startAfter()`, `endBefore()`, `endAt()` and `equalTo()` - * allows you to choose arbitrary starting and ending points for your queries. - * - * The starting point is inclusive, so children with exactly the specified value - * will be included in the query. The optional key argument can be used to - * further limit the range of the query. If it is specified, then children that - * have exactly the specified value must also have a key name greater than or - * equal to the specified key. - * - * You can read more about `startAt()` in - * {@link https://firebase.google.com/docs/database/web/lists-of-data#filtering_data | Filtering data}. - * - * @param value - The value to start at. The argument type depends on which - * `orderBy*()` function was used in this query. Specify a value that matches - * the `orderBy*()` type. When used in combination with `orderByKey()`, the - * value must be a string. - * @param key - The child key to start at. This argument is only allowed if - * ordering by child, value, or priority. - */ -function startAt(value, key) { - if (value === void 0) { value = null; } - validateKey('startAt', 'key', key, true); - return new QueryStartAtConstraint(value, key); -} -var QueryStartAfterConstraint = /** @class */ (function (_super) { - __extends(QueryStartAfterConstraint, _super); - function QueryStartAfterConstraint(_value, _key) { - var _this = _super.call(this) || this; - _this._value = _value; - _this._key = _key; - return _this; - } - QueryStartAfterConstraint.prototype._apply = function (query) { - validateFirebaseDataArg('startAfter', this._value, query._path, false); - var newParams = queryParamsStartAfter(query._queryParams, this._value, this._key); - validateLimit(newParams); - validateQueryEndpoints(newParams); - if (query._queryParams.hasStart()) { - throw new Error('startAfter: Starting point was already set (by another call to startAt, ' + - 'startAfter, or equalTo).'); - } - return new QueryImpl(query._repo, query._path, newParams, query._orderByCalled); - }; - return QueryStartAfterConstraint; -}(QueryConstraint)); -/** - * Creates a `QueryConstraint` with the specified starting point (exclusive). - * - * Using `startAt()`, `startAfter()`, `endBefore()`, `endAt()` and `equalTo()` - * allows you to choose arbitrary starting and ending points for your queries. - * - * The starting point is exclusive. If only a value is provided, children - * with a value greater than the specified value will be included in the query. - * If a key is specified, then children must have a value greater than or equal - * to the specified value and a a key name greater than the specified key. - * - * @param value - The value to start after. The argument type depends on which - * `orderBy*()` function was used in this query. Specify a value that matches - * the `orderBy*()` type. When used in combination with `orderByKey()`, the - * value must be a string. - * @param key - The child key to start after. This argument is only allowed if - * ordering by child, value, or priority. - */ -function startAfter(value, key) { - validateKey('startAfter', 'key', key, true); - return new QueryStartAfterConstraint(value, key); -} -var QueryLimitToFirstConstraint = /** @class */ (function (_super) { - __extends(QueryLimitToFirstConstraint, _super); - function QueryLimitToFirstConstraint(_limit) { - var _this = _super.call(this) || this; - _this._limit = _limit; - return _this; - } - QueryLimitToFirstConstraint.prototype._apply = function (query) { - if (query._queryParams.hasLimit()) { - throw new Error('limitToFirst: Limit was already set (by another call to limitToFirst ' + - 'or limitToLast).'); - } - return new QueryImpl(query._repo, query._path, queryParamsLimitToFirst(query._queryParams, this._limit), query._orderByCalled); - }; - return QueryLimitToFirstConstraint; -}(QueryConstraint)); -/** - * Creates a new `QueryConstraint` that if limited to the first specific number - * of children. - * - * The `limitToFirst()` method is used to set a maximum number of children to be - * synced for a given callback. If we set a limit of 100, we will initially only - * receive up to 100 `child_added` events. If we have fewer than 100 messages - * stored in our Database, a `child_added` event will fire for each message. - * However, if we have over 100 messages, we will only receive a `child_added` - * event for the first 100 ordered messages. As items change, we will receive - * `child_removed` events for each item that drops out of the active list so - * that the total number stays at 100. - * - * You can read more about `limitToFirst()` in - * {@link https://firebase.google.com/docs/database/web/lists-of-data#filtering_data | Filtering data}. - * - * @param limit - The maximum number of nodes to include in this query. - */ -function limitToFirst(limit) { - if (typeof limit !== 'number' || Math.floor(limit) !== limit || limit <= 0) { - throw new Error('limitToFirst: First argument must be a positive integer.'); - } - return new QueryLimitToFirstConstraint(limit); -} -var QueryLimitToLastConstraint = /** @class */ (function (_super) { - __extends(QueryLimitToLastConstraint, _super); - function QueryLimitToLastConstraint(_limit) { - var _this = _super.call(this) || this; - _this._limit = _limit; - return _this; - } - QueryLimitToLastConstraint.prototype._apply = function (query) { - if (query._queryParams.hasLimit()) { - throw new Error('limitToLast: Limit was already set (by another call to limitToFirst ' + - 'or limitToLast).'); - } - return new QueryImpl(query._repo, query._path, queryParamsLimitToLast(query._queryParams, this._limit), query._orderByCalled); - }; - return QueryLimitToLastConstraint; -}(QueryConstraint)); -/** - * Creates a new `QueryConstraint` that is limited to return only the last - * specified number of children. - * - * The `limitToLast()` method is used to set a maximum number of children to be - * synced for a given callback. If we set a limit of 100, we will initially only - * receive up to 100 `child_added` events. If we have fewer than 100 messages - * stored in our Database, a `child_added` event will fire for each message. - * However, if we have over 100 messages, we will only receive a `child_added` - * event for the last 100 ordered messages. As items change, we will receive - * `child_removed` events for each item that drops out of the active list so - * that the total number stays at 100. - * - * You can read more about `limitToLast()` in - * {@link https://firebase.google.com/docs/database/web/lists-of-data#filtering_data | Filtering data}. - * - * @param limit - The maximum number of nodes to include in this query. - */ -function limitToLast(limit) { - if (typeof limit !== 'number' || Math.floor(limit) !== limit || limit <= 0) { - throw new Error('limitToLast: First argument must be a positive integer.'); - } - return new QueryLimitToLastConstraint(limit); -} -var QueryOrderByChildConstraint = /** @class */ (function (_super) { - __extends(QueryOrderByChildConstraint, _super); - function QueryOrderByChildConstraint(_path) { - var _this = _super.call(this) || this; - _this._path = _path; - return _this; - } - QueryOrderByChildConstraint.prototype._apply = function (query) { - validateNoPreviousOrderByCall(query, 'orderByChild'); - var parsedPath = new Path(this._path); - if (pathIsEmpty(parsedPath)) { - throw new Error('orderByChild: cannot pass in empty path. Use orderByValue() instead.'); - } - var index = new PathIndex(parsedPath); - var newParams = queryParamsOrderBy(query._queryParams, index); - validateQueryEndpoints(newParams); - return new QueryImpl(query._repo, query._path, newParams, - /*orderByCalled=*/ true); - }; - return QueryOrderByChildConstraint; -}(QueryConstraint)); -/** - * Creates a new `QueryConstraint` that orders by the specified child key. - * - * Queries can only order by one key at a time. Calling `orderByChild()` - * multiple times on the same query is an error. - * - * Firebase queries allow you to order your data by any child key on the fly. - * However, if you know in advance what your indexes will be, you can define - * them via the .indexOn rule in your Security Rules for better performance. See - * the{@link https://firebase.google.com/docs/database/security/indexing-data} - * rule for more information. - * - * You can read more about `orderByChild()` in - * {@link https://firebase.google.com/docs/database/web/lists-of-data#sort_data | Sort data}. - * - * @param path - The path to order by. - */ -function orderByChild(path) { - if (path === '$key') { - throw new Error('orderByChild: "$key" is invalid. Use orderByKey() instead.'); - } - else if (path === '$priority') { - throw new Error('orderByChild: "$priority" is invalid. Use orderByPriority() instead.'); - } - else if (path === '$value') { - throw new Error('orderByChild: "$value" is invalid. Use orderByValue() instead.'); - } - validatePathString('orderByChild', 'path', path, false); - return new QueryOrderByChildConstraint(path); -} -var QueryOrderByKeyConstraint = /** @class */ (function (_super) { - __extends(QueryOrderByKeyConstraint, _super); - function QueryOrderByKeyConstraint() { - return _super !== null && _super.apply(this, arguments) || this; - } - QueryOrderByKeyConstraint.prototype._apply = function (query) { - validateNoPreviousOrderByCall(query, 'orderByKey'); - var newParams = queryParamsOrderBy(query._queryParams, KEY_INDEX); - validateQueryEndpoints(newParams); - return new QueryImpl(query._repo, query._path, newParams, - /*orderByCalled=*/ true); - }; - return QueryOrderByKeyConstraint; -}(QueryConstraint)); -/** - * Creates a new `QueryConstraint` that orders by the key. - * - * Sorts the results of a query by their (ascending) key values. - * - * You can read more about `orderByKey()` in - * {@link https://firebase.google.com/docs/database/web/lists-of-data#sort_data | Sort data}. - */ -function orderByKey() { - return new QueryOrderByKeyConstraint(); -} -var QueryOrderByPriorityConstraint = /** @class */ (function (_super) { - __extends(QueryOrderByPriorityConstraint, _super); - function QueryOrderByPriorityConstraint() { - return _super !== null && _super.apply(this, arguments) || this; - } - QueryOrderByPriorityConstraint.prototype._apply = function (query) { - validateNoPreviousOrderByCall(query, 'orderByPriority'); - var newParams = queryParamsOrderBy(query._queryParams, PRIORITY_INDEX); - validateQueryEndpoints(newParams); - return new QueryImpl(query._repo, query._path, newParams, - /*orderByCalled=*/ true); - }; - return QueryOrderByPriorityConstraint; -}(QueryConstraint)); -/** - * Creates a new `QueryConstraint` that orders by priority. - * - * Applications need not use priority but can order collections by - * ordinary properties (see - * {@link https://firebase.google.com/docs/database/web/lists-of-data#sort_data | Sort data} - * for alternatives to priority. - */ -function orderByPriority() { - return new QueryOrderByPriorityConstraint(); -} -var QueryOrderByValueConstraint = /** @class */ (function (_super) { - __extends(QueryOrderByValueConstraint, _super); - function QueryOrderByValueConstraint() { - return _super !== null && _super.apply(this, arguments) || this; - } - QueryOrderByValueConstraint.prototype._apply = function (query) { - validateNoPreviousOrderByCall(query, 'orderByValue'); - var newParams = queryParamsOrderBy(query._queryParams, VALUE_INDEX); - validateQueryEndpoints(newParams); - return new QueryImpl(query._repo, query._path, newParams, - /*orderByCalled=*/ true); - }; - return QueryOrderByValueConstraint; -}(QueryConstraint)); -/** - * Creates a new `QueryConstraint` that orders by value. - * - * If the children of a query are all scalar values (string, number, or - * boolean), you can order the results by their (ascending) values. - * - * You can read more about `orderByValue()` in - * {@link https://firebase.google.com/docs/database/web/lists-of-data#sort_data | Sort data}. - */ -function orderByValue() { - return new QueryOrderByValueConstraint(); -} -var QueryEqualToValueConstraint = /** @class */ (function (_super) { - __extends(QueryEqualToValueConstraint, _super); - function QueryEqualToValueConstraint(_value, _key) { - var _this = _super.call(this) || this; - _this._value = _value; - _this._key = _key; - return _this; - } - QueryEqualToValueConstraint.prototype._apply = function (query) { - validateFirebaseDataArg('equalTo', this._value, query._path, false); - if (query._queryParams.hasStart()) { - throw new Error('equalTo: Starting point was already set (by another call to startAt/startAfter or ' + - 'equalTo).'); - } - if (query._queryParams.hasEnd()) { - throw new Error('equalTo: Ending point was already set (by another call to endAt/endBefore or ' + - 'equalTo).'); - } - return new QueryEndAtConstraint(this._value, this._key)._apply(new QueryStartAtConstraint(this._value, this._key)._apply(query)); - }; - return QueryEqualToValueConstraint; -}(QueryConstraint)); -/** - * Creates a `QueryConstraint` that includes children that match the specified - * value. - * - * Using `startAt()`, `startAfter()`, `endBefore()`, `endAt()` and `equalTo()` - * allows you to choose arbitrary starting and ending points for your queries. - * - * The optional key argument can be used to further limit the range of the - * query. If it is specified, then children that have exactly the specified - * value must also have exactly the specified key as their key name. This can be - * used to filter result sets with many matches for the same value. - * - * You can read more about `equalTo()` in - * {@link https://firebase.google.com/docs/database/web/lists-of-data#filtering_data | Filtering data}. - * - * @param value - The value to match for. The argument type depends on which - * `orderBy*()` function was used in this query. Specify a value that matches - * the `orderBy*()` type. When used in combination with `orderByKey()`, the - * value must be a string. - * @param key - The child key to start at, among the children with the - * previously specified priority. This argument is only allowed if ordering by - * child, value, or priority. - */ -function equalTo(value, key) { - validateKey('equalTo', 'key', key, true); - return new QueryEqualToValueConstraint(value, key); -} -/** - * Creates a new immutable instance of `Query` that is extended to also include - * additional query constraints. - * - * @param query - The Query instance to use as a base for the new constraints. - * @param queryConstraints - The list of `QueryConstraint`s to apply. - * @throws if any of the provided query constraints cannot be combined with the - * existing or new constraints. - */ -function query(query) { - var e_1, _a; - var queryConstraints = []; - for (var _i = 1; _i < arguments.length; _i++) { - queryConstraints[_i - 1] = arguments[_i]; - } - var queryImpl = getModularInstance(query); - try { - for (var queryConstraints_1 = __values(queryConstraints), queryConstraints_1_1 = queryConstraints_1.next(); !queryConstraints_1_1.done; queryConstraints_1_1 = queryConstraints_1.next()) { - var constraint = queryConstraints_1_1.value; - queryImpl = constraint._apply(queryImpl); - } - } - catch (e_1_1) { e_1 = { error: e_1_1 }; } - finally { - try { - if (queryConstraints_1_1 && !queryConstraints_1_1.done && (_a = queryConstraints_1.return)) _a.call(queryConstraints_1); - } - finally { if (e_1) throw e_1.error; } - } - return queryImpl; -} -/** - * Define reference constructor in various modules - * - * We are doing this here to avoid several circular - * dependency issues - */ -syncPointSetReferenceConstructor(ReferenceImpl); -syncTreeSetReferenceConstructor(ReferenceImpl); - -/** - * This variable is also defined in the firebase Node.js Admin SDK. Before - * modifying this definition, consult the definition in: - * - * https://github.com/firebase/firebase-admin-node - * - * and make sure the two are consistent. - */ -var FIREBASE_DATABASE_EMULATOR_HOST_VAR = 'FIREBASE_DATABASE_EMULATOR_HOST'; -/** - * Creates and caches `Repo` instances. - */ -var repos = {}; -/** - * If true, any new `Repo` will be created to use `ReadonlyRestClient` (for testing purposes). - */ -var useRestClient = false; -/** - * Update an existing `Repo` in place to point to a new host/port. - */ -function repoManagerApplyEmulatorSettings(repo, host, port, tokenProvider) { - repo.repoInfo_ = new RepoInfo(host + ":" + port, - /* secure= */ false, repo.repoInfo_.namespace, repo.repoInfo_.webSocketOnly, repo.repoInfo_.nodeAdmin, repo.repoInfo_.persistenceKey, repo.repoInfo_.includeNamespaceInQueryParams); - if (tokenProvider) { - repo.authTokenProvider_ = tokenProvider; - } -} -/** - * This function should only ever be called to CREATE a new database instance. - * @internal - */ -function repoManagerDatabaseFromApp(app, authProvider, appCheckProvider, url, nodeAdmin) { - var dbUrl = url || app.options.databaseURL; - if (dbUrl === undefined) { - if (!app.options.projectId) { - fatal("Can't determine Firebase Database URL. Be sure to include " + - ' a Project ID when calling firebase.initializeApp().'); - } - log('Using default host for project ', app.options.projectId); - dbUrl = app.options.projectId + "-default-rtdb.firebaseio.com"; - } - var parsedUrl = parseRepoInfo(dbUrl, nodeAdmin); - var repoInfo = parsedUrl.repoInfo; - var isEmulator; - var dbEmulatorHost = undefined; - if (typeof process !== 'undefined' && process.env) { - dbEmulatorHost = process.env[FIREBASE_DATABASE_EMULATOR_HOST_VAR]; - } - if (dbEmulatorHost) { - isEmulator = true; - dbUrl = "http://" + dbEmulatorHost + "?ns=" + repoInfo.namespace; - parsedUrl = parseRepoInfo(dbUrl, nodeAdmin); - repoInfo = parsedUrl.repoInfo; - } - else { - isEmulator = !parsedUrl.repoInfo.secure; - } - var authTokenProvider = nodeAdmin && isEmulator - ? new EmulatorTokenProvider(EmulatorTokenProvider.OWNER) - : new FirebaseAuthTokenProvider(app.name, app.options, authProvider); - validateUrl('Invalid Firebase Database URL', parsedUrl); - if (!pathIsEmpty(parsedUrl.path)) { - fatal('Database URL must point to the root of a Firebase Database ' + - '(not including a child path).'); - } - var repo = repoManagerCreateRepo(repoInfo, app, authTokenProvider, new AppCheckTokenProvider(app.name, appCheckProvider)); - return new Database(repo, app); -} -/** - * Remove the repo and make sure it is disconnected. - * - */ -function repoManagerDeleteRepo(repo, appName) { - var appRepos = repos[appName]; - // This should never happen... - if (!appRepos || appRepos[repo.key] !== repo) { - fatal("Database " + appName + "(" + repo.repoInfo_ + ") has already been deleted."); - } - repoInterrupt(repo); - delete appRepos[repo.key]; -} -/** - * Ensures a repo doesn't already exist and then creates one using the - * provided app. - * - * @param repoInfo - The metadata about the Repo - * @returns The Repo object for the specified server / repoName. - */ -function repoManagerCreateRepo(repoInfo, app, authTokenProvider, appCheckProvider) { - var appRepos = repos[app.name]; - if (!appRepos) { - appRepos = {}; - repos[app.name] = appRepos; - } - var repo = appRepos[repoInfo.toURLString()]; - if (repo) { - fatal('Database initialized multiple times. Please make sure the format of the database URL matches with each database() call.'); - } - repo = new Repo(repoInfo, useRestClient, authTokenProvider, appCheckProvider); - appRepos[repoInfo.toURLString()] = repo; - return repo; -} -/** - * Forces us to use ReadonlyRestClient instead of PersistentConnection for new Repos. - */ -function repoManagerForceRestClient(forceRestClient) { - useRestClient = forceRestClient; -} -/** - * Class representing a Firebase Realtime Database. - */ -var Database = /** @class */ (function () { - /** @hideconstructor */ - function Database(_repoInternal, - /** The {@link @firebase/app#FirebaseApp} associated with this Realtime Database instance. */ - app) { - this._repoInternal = _repoInternal; - this.app = app; - /** Represents a `Database` instance. */ - this['type'] = 'database'; - /** Track if the instance has been used (root or repo accessed) */ - this._instanceStarted = false; - } - Object.defineProperty(Database.prototype, "_repo", { - get: function () { - if (!this._instanceStarted) { - repoStart(this._repoInternal, this.app.options.appId, this.app.options['databaseAuthVariableOverride']); - this._instanceStarted = true; - } - return this._repoInternal; - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(Database.prototype, "_root", { - get: function () { - if (!this._rootInternal) { - this._rootInternal = new ReferenceImpl(this._repo, newEmptyPath()); - } - return this._rootInternal; - }, - enumerable: false, - configurable: true - }); - Database.prototype._delete = function () { - if (this._rootInternal !== null) { - repoManagerDeleteRepo(this._repo, this.app.name); - this._repoInternal = null; - this._rootInternal = null; - } - return Promise.resolve(); - }; - Database.prototype._checkNotDeleted = function (apiName) { - if (this._rootInternal === null) { - fatal('Cannot call ' + apiName + ' on a deleted database.'); - } - }; - return Database; -}()); -function checkTransportInit() { - if (TransportManager.IS_TRANSPORT_INITIALIZED) { - warn('Transport has already been initialized. Please call this function before calling ref or setting up a listener'); - } -} -/** - * Force the use of websockets instead of longPolling. - */ -function forceWebSockets() { - checkTransportInit(); - BrowserPollConnection.forceDisallow(); -} -/** - * Force the use of longPolling instead of websockets. This will be ignored if websocket protocol is used in databaseURL. - */ -function forceLongPolling() { - checkTransportInit(); - WebSocketConnection.forceDisallow(); - BrowserPollConnection.forceAllow(); -} -/** - * Returns the instance of the Realtime Database SDK that is associated - * with the provided {@link @firebase/app#FirebaseApp}. Initializes a new instance with - * with default settings if no instance exists or if the existing instance uses - * a custom database URL. - * - * @param app - The {@link @firebase/app#FirebaseApp} instance that the returned Realtime - * Database instance is associated with. - * @param url - The URL of the Realtime Database instance to connect to. If not - * provided, the SDK connects to the default instance of the Firebase App. - * @returns The `Database` instance of the provided app. - */ -function getDatabase(app, url) { - if (app === void 0) { app = getApp(); } - var db = _getProvider(app, 'database').getImmediate({ - identifier: url - }); - var emulator = getDefaultEmulatorHostnameAndPort('database'); - if (emulator) { - connectDatabaseEmulator.apply(void 0, __spreadArray([db], __read(emulator))); - } - return db; -} -/** - * Modify the provided instance to communicate with the Realtime Database - * emulator. - * - *

Note: This method must be called before performing any other operation. - * - * @param db - The instance to modify. - * @param host - The emulator host (ex: localhost) - * @param port - The emulator port (ex: 8080) - * @param options.mockUserToken - the mock auth token to use for unit testing Security Rules - */ -function connectDatabaseEmulator(db, host, port, options) { - if (options === void 0) { options = {}; } - db = getModularInstance(db); - db._checkNotDeleted('useEmulator'); - if (db._instanceStarted) { - fatal('Cannot call useEmulator() after instance has already been initialized.'); - } - var repo = db._repoInternal; - var tokenProvider = undefined; - if (repo.repoInfo_.nodeAdmin) { - if (options.mockUserToken) { - fatal('mockUserToken is not supported by the Admin SDK. For client access with mock users, please use the "firebase" package instead of "firebase-admin".'); - } - tokenProvider = new EmulatorTokenProvider(EmulatorTokenProvider.OWNER); - } - else if (options.mockUserToken) { - var token = typeof options.mockUserToken === 'string' - ? options.mockUserToken - : createMockUserToken(options.mockUserToken, db.app.options.projectId); - tokenProvider = new EmulatorTokenProvider(token); - } - // Modify the repo to apply emulator settings - repoManagerApplyEmulatorSettings(repo, host, port, tokenProvider); -} -/** - * Disconnects from the server (all Database operations will be completed - * offline). - * - * The client automatically maintains a persistent connection to the Database - * server, which will remain active indefinitely and reconnect when - * disconnected. However, the `goOffline()` and `goOnline()` methods may be used - * to control the client connection in cases where a persistent connection is - * undesirable. - * - * While offline, the client will no longer receive data updates from the - * Database. However, all Database operations performed locally will continue to - * immediately fire events, allowing your application to continue behaving - * normally. Additionally, each operation performed locally will automatically - * be queued and retried upon reconnection to the Database server. - * - * To reconnect to the Database and begin receiving remote events, see - * `goOnline()`. - * - * @param db - The instance to disconnect. - */ -function goOffline(db) { - db = getModularInstance(db); - db._checkNotDeleted('goOffline'); - repoInterrupt(db._repo); -} -/** - * Reconnects to the server and synchronizes the offline Database state - * with the server state. - * - * This method should be used after disabling the active connection with - * `goOffline()`. Once reconnected, the client will transmit the proper data - * and fire the appropriate events so that your client "catches up" - * automatically. - * - * @param db - The instance to reconnect. - */ -function goOnline(db) { - db = getModularInstance(db); - db._checkNotDeleted('goOnline'); - repoResume(db._repo); -} -function enableLogging(logger, persistent) { - enableLogging$1(logger, persistent); -} - -/** - * @license - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -function registerDatabase(variant) { - setSDKVersion(SDK_VERSION$1); - _registerComponent(new Component('database', function (container, _a) { - var url = _a.instanceIdentifier; - var app = container.getProvider('app').getImmediate(); - var authProvider = container.getProvider('auth-internal'); - var appCheckProvider = container.getProvider('app-check-internal'); - return repoManagerDatabaseFromApp(app, authProvider, appCheckProvider, url); - }, "PUBLIC" /* PUBLIC */).setMultipleInstances(true)); - registerVersion(name, version, variant); - // BUILD_TARGET will be replaced by values like esm5, esm2017, cjs5, etc during the compilation - registerVersion(name, version, 'esm5'); -} - -/** - * @license - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var SERVER_TIMESTAMP = { - '.sv': 'timestamp' -}; -/** - * Returns a placeholder value for auto-populating the current timestamp (time - * since the Unix epoch, in milliseconds) as determined by the Firebase - * servers. - */ -function serverTimestamp() { - return SERVER_TIMESTAMP; -} -/** - * Returns a placeholder value that can be used to atomically increment the - * current database value by the provided delta. - * - * @param delta - the amount to modify the current value atomically. - * @returns A placeholder value for modifying data atomically server-side. - */ -function increment(delta) { - return { - '.sv': { - 'increment': delta - } - }; -} - -/** - * @license - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * A type for the resolve value of {@link runTransaction}. - */ -var TransactionResult = /** @class */ (function () { - /** @hideconstructor */ - function TransactionResult( - /** Whether the transaction was successfully committed. */ - committed, - /** The resulting data snapshot. */ - snapshot) { - this.committed = committed; - this.snapshot = snapshot; - } - /** Returns a JSON-serializable representation of this object. */ - TransactionResult.prototype.toJSON = function () { - return { committed: this.committed, snapshot: this.snapshot.toJSON() }; - }; - return TransactionResult; -}()); -/** - * Atomically modifies the data at this location. - * - * Atomically modify the data at this location. Unlike a normal `set()`, which - * just overwrites the data regardless of its previous value, `runTransaction()` is - * used to modify the existing value to a new value, ensuring there are no - * conflicts with other clients writing to the same location at the same time. - * - * To accomplish this, you pass `runTransaction()` an update function which is - * used to transform the current value into a new value. If another client - * writes to the location before your new value is successfully written, your - * update function will be called again with the new current value, and the - * write will be retried. This will happen repeatedly until your write succeeds - * without conflict or you abort the transaction by not returning a value from - * your update function. - * - * Note: Modifying data with `set()` will cancel any pending transactions at - * that location, so extreme care should be taken if mixing `set()` and - * `runTransaction()` to update the same data. - * - * Note: When using transactions with Security and Firebase Rules in place, be - * aware that a client needs `.read` access in addition to `.write` access in - * order to perform a transaction. This is because the client-side nature of - * transactions requires the client to read the data in order to transactionally - * update it. - * - * @param ref - The location to atomically modify. - * @param transactionUpdate - A developer-supplied function which will be passed - * the current data stored at this location (as a JavaScript object). The - * function should return the new value it would like written (as a JavaScript - * object). If `undefined` is returned (i.e. you return with no arguments) the - * transaction will be aborted and the data at this location will not be - * modified. - * @param options - An options object to configure transactions. - * @returns A `Promise` that can optionally be used instead of the `onComplete` - * callback to handle success and failure. - */ -function runTransaction(ref, -// eslint-disable-next-line @typescript-eslint/no-explicit-any -transactionUpdate, options) { - var _a; - ref = getModularInstance(ref); - validateWritablePath('Reference.transaction', ref._path); - if (ref.key === '.length' || ref.key === '.keys') { - throw ('Reference.transaction failed: ' + ref.key + ' is a read-only object.'); - } - var applyLocally = (_a = options === null || options === void 0 ? void 0 : options.applyLocally) !== null && _a !== void 0 ? _a : true; - var deferred = new Deferred(); - var promiseComplete = function (error, committed, node) { - var dataSnapshot = null; - if (error) { - deferred.reject(error); - } - else { - dataSnapshot = new DataSnapshot(node, new ReferenceImpl(ref._repo, ref._path), PRIORITY_INDEX); - deferred.resolve(new TransactionResult(committed, dataSnapshot)); - } - }; - // Add a watch to make sure we get server updates. - var unwatcher = onValue(ref, function () { }); - repoStartTransaction(ref._repo, ref._path, transactionUpdate, promiseComplete, unwatcher, applyLocally); - return deferred.promise; -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// eslint-disable-next-line @typescript-eslint/no-explicit-any -PersistentConnection.prototype.simpleListen = function (pathString, onComplete) { - this.sendRequest('q', { p: pathString }, onComplete); -}; -// eslint-disable-next-line @typescript-eslint/no-explicit-any -PersistentConnection.prototype.echo = function (data, onEcho) { - this.sendRequest('echo', { d: data }, onEcho); -}; -/** - * @internal - */ -var hijackHash = function (newHash) { - var oldPut = PersistentConnection.prototype.put; - PersistentConnection.prototype.put = function (pathString, data, onComplete, hash) { - if (hash !== undefined) { - hash = newHash(); - } - oldPut.call(this, pathString, data, onComplete, hash); - }; - return function () { - PersistentConnection.prototype.put = oldPut; - }; -}; -/** - * Forces the RepoManager to create Repos that use ReadonlyRestClient instead of PersistentConnection. - * @internal - */ -var forceRestClient = function (forceRestClient) { - repoManagerForceRestClient(forceRestClient); -}; - -/** - * Firebase Realtime Database - * - * @packageDocumentation - */ -registerDatabase(); - -export { DataSnapshot, Database, OnDisconnect, QueryConstraint, TransactionResult, QueryImpl as _QueryImpl, QueryParams as _QueryParams, ReferenceImpl as _ReferenceImpl, forceRestClient as _TEST_ACCESS_forceRestClient, hijackHash as _TEST_ACCESS_hijackHash, repoManagerDatabaseFromApp as _repoManagerDatabaseFromApp, setSDKVersion as _setSDKVersion, validatePathString as _validatePathString, validateWritablePath as _validateWritablePath, child, connectDatabaseEmulator, enableLogging, endAt, endBefore, equalTo, forceLongPolling, forceWebSockets, get, getDatabase, goOffline, goOnline, increment, limitToFirst, limitToLast, off, onChildAdded, onChildChanged, onChildMoved, onChildRemoved, onDisconnect, onValue, orderByChild, orderByKey, orderByPriority, orderByValue, push, query, ref, refFromURL, remove, runTransaction, serverTimestamp, set, setPriority, setWithPriority, startAfter, startAt, update }; -//# sourceMappingURL=index.esm5.js.map diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/index.node.cjs.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/index.node.cjs.js deleted file mode 100644 index b5a51054..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/index.node.cjs.js +++ /dev/null @@ -1,14564 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, '__esModule', { value: true }); - -var Websocket = require('faye-websocket'); -var util = require('@firebase/util'); -var tslib = require('tslib'); -var logger$1 = require('@firebase/logger'); -var app = require('@firebase/app'); -var component = require('@firebase/component'); - -function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } - -var Websocket__default = /*#__PURE__*/_interopDefaultLegacy(Websocket); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var PROTOCOL_VERSION = '5'; -var VERSION_PARAM = 'v'; -var TRANSPORT_SESSION_PARAM = 's'; -var REFERER_PARAM = 'r'; -var FORGE_REF = 'f'; -// Matches console.firebase.google.com, firebase-console-*.corp.google.com and -// firebase.corp.google.com -var FORGE_DOMAIN_RE = /(console\.firebase|firebase-console-\w+\.corp|firebase\.corp)\.google\.com/; -var LAST_SESSION_PARAM = 'ls'; -var APPLICATION_ID_PARAM = 'p'; -var APP_CHECK_TOKEN_PARAM = 'ac'; -var WEBSOCKET = 'websocket'; -var LONG_POLLING = 'long_polling'; - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Wraps a DOM Storage object and: - * - automatically encode objects as JSON strings before storing them to allow us to store arbitrary types. - * - prefixes names with "firebase:" to avoid collisions with app data. - * - * We automatically (see storage.js) create two such wrappers, one for sessionStorage, - * and one for localStorage. - * - */ -var DOMStorageWrapper = /** @class */ (function () { - /** - * @param domStorage_ - The underlying storage object (e.g. localStorage or sessionStorage) - */ - function DOMStorageWrapper(domStorage_) { - this.domStorage_ = domStorage_; - // Use a prefix to avoid collisions with other stuff saved by the app. - this.prefix_ = 'firebase:'; - } - /** - * @param key - The key to save the value under - * @param value - The value being stored, or null to remove the key. - */ - DOMStorageWrapper.prototype.set = function (key, value) { - if (value == null) { - this.domStorage_.removeItem(this.prefixedName_(key)); - } - else { - this.domStorage_.setItem(this.prefixedName_(key), util.stringify(value)); - } - }; - /** - * @returns The value that was stored under this key, or null - */ - DOMStorageWrapper.prototype.get = function (key) { - var storedVal = this.domStorage_.getItem(this.prefixedName_(key)); - if (storedVal == null) { - return null; - } - else { - return util.jsonEval(storedVal); - } - }; - DOMStorageWrapper.prototype.remove = function (key) { - this.domStorage_.removeItem(this.prefixedName_(key)); - }; - DOMStorageWrapper.prototype.prefixedName_ = function (name) { - return this.prefix_ + name; - }; - DOMStorageWrapper.prototype.toString = function () { - return this.domStorage_.toString(); - }; - return DOMStorageWrapper; -}()); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * An in-memory storage implementation that matches the API of DOMStorageWrapper - * (TODO: create interface for both to implement). - */ -var MemoryStorage = /** @class */ (function () { - function MemoryStorage() { - this.cache_ = {}; - this.isInMemoryStorage = true; - } - MemoryStorage.prototype.set = function (key, value) { - if (value == null) { - delete this.cache_[key]; - } - else { - this.cache_[key] = value; - } - }; - MemoryStorage.prototype.get = function (key) { - if (util.contains(this.cache_, key)) { - return this.cache_[key]; - } - return null; - }; - MemoryStorage.prototype.remove = function (key) { - delete this.cache_[key]; - }; - return MemoryStorage; -}()); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Helper to create a DOMStorageWrapper or else fall back to MemoryStorage. - * TODO: Once MemoryStorage and DOMStorageWrapper have a shared interface this method annotation should change - * to reflect this type - * - * @param domStorageName - Name of the underlying storage object - * (e.g. 'localStorage' or 'sessionStorage'). - * @returns Turning off type information until a common interface is defined. - */ -var createStoragefor = function (domStorageName) { - try { - // NOTE: just accessing "localStorage" or "window['localStorage']" may throw a security exception, - // so it must be inside the try/catch. - if (typeof window !== 'undefined' && - typeof window[domStorageName] !== 'undefined') { - // Need to test cache. Just because it's here doesn't mean it works - var domStorage = window[domStorageName]; - domStorage.setItem('firebase:sentinel', 'cache'); - domStorage.removeItem('firebase:sentinel'); - return new DOMStorageWrapper(domStorage); - } - } - catch (e) { } - // Failed to create wrapper. Just return in-memory storage. - // TODO: log? - return new MemoryStorage(); -}; -/** A storage object that lasts across sessions */ -var PersistentStorage = createStoragefor('localStorage'); -/** A storage object that only lasts one session */ -var SessionStorage = createStoragefor('sessionStorage'); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var logClient = new logger$1.Logger('@firebase/database'); -/** - * Returns a locally-unique ID (generated by just incrementing up from 0 each time its called). - */ -var LUIDGenerator = (function () { - var id = 1; - return function () { - return id++; - }; -})(); -/** - * Sha1 hash of the input string - * @param str - The string to hash - * @returns {!string} The resulting hash - */ -var sha1 = function (str) { - var utf8Bytes = util.stringToByteArray(str); - var sha1 = new util.Sha1(); - sha1.update(utf8Bytes); - var sha1Bytes = sha1.digest(); - return util.base64.encodeByteArray(sha1Bytes); -}; -var buildLogMessage_ = function () { - var varArgs = []; - for (var _i = 0; _i < arguments.length; _i++) { - varArgs[_i] = arguments[_i]; - } - var message = ''; - for (var i = 0; i < varArgs.length; i++) { - var arg = varArgs[i]; - if (Array.isArray(arg) || - (arg && - typeof arg === 'object' && - // eslint-disable-next-line @typescript-eslint/no-explicit-any - typeof arg.length === 'number')) { - message += buildLogMessage_.apply(null, arg); - } - else if (typeof arg === 'object') { - message += util.stringify(arg); - } - else { - message += arg; - } - message += ' '; - } - return message; -}; -/** - * Use this for all debug messages in Firebase. - */ -var logger = null; -/** - * Flag to check for log availability on first log message - */ -var firstLog_ = true; -/** - * The implementation of Firebase.enableLogging (defined here to break dependencies) - * @param logger_ - A flag to turn on logging, or a custom logger - * @param persistent - Whether or not to persist logging settings across refreshes - */ -var enableLogging$1 = function (logger_, persistent) { - util.assert(!persistent || logger_ === true || logger_ === false, "Can't turn on custom loggers persistently."); - if (logger_ === true) { - logClient.logLevel = logger$1.LogLevel.VERBOSE; - logger = logClient.log.bind(logClient); - if (persistent) { - SessionStorage.set('logging_enabled', true); - } - } - else if (typeof logger_ === 'function') { - logger = logger_; - } - else { - logger = null; - SessionStorage.remove('logging_enabled'); - } -}; -var log = function () { - var varArgs = []; - for (var _i = 0; _i < arguments.length; _i++) { - varArgs[_i] = arguments[_i]; - } - if (firstLog_ === true) { - firstLog_ = false; - if (logger === null && SessionStorage.get('logging_enabled') === true) { - enableLogging$1(true); - } - } - if (logger) { - var message = buildLogMessage_.apply(null, varArgs); - logger(message); - } -}; -var logWrapper = function (prefix) { - return function () { - var varArgs = []; - for (var _i = 0; _i < arguments.length; _i++) { - varArgs[_i] = arguments[_i]; - } - log.apply(void 0, tslib.__spreadArray([prefix], tslib.__read(varArgs))); - }; -}; -var error = function () { - var varArgs = []; - for (var _i = 0; _i < arguments.length; _i++) { - varArgs[_i] = arguments[_i]; - } - var message = 'FIREBASE INTERNAL ERROR: ' + buildLogMessage_.apply(void 0, tslib.__spreadArray([], tslib.__read(varArgs))); - logClient.error(message); -}; -var fatal = function () { - var varArgs = []; - for (var _i = 0; _i < arguments.length; _i++) { - varArgs[_i] = arguments[_i]; - } - var message = "FIREBASE FATAL ERROR: " + buildLogMessage_.apply(void 0, tslib.__spreadArray([], tslib.__read(varArgs))); - logClient.error(message); - throw new Error(message); -}; -var warn = function () { - var varArgs = []; - for (var _i = 0; _i < arguments.length; _i++) { - varArgs[_i] = arguments[_i]; - } - var message = 'FIREBASE WARNING: ' + buildLogMessage_.apply(void 0, tslib.__spreadArray([], tslib.__read(varArgs))); - logClient.warn(message); -}; -/** - * Logs a warning if the containing page uses https. Called when a call to new Firebase - * does not use https. - */ -var warnIfPageIsSecure = function () { - // Be very careful accessing browser globals. Who knows what may or may not exist. - if (typeof window !== 'undefined' && - window.location && - window.location.protocol && - window.location.protocol.indexOf('https:') !== -1) { - warn('Insecure Firebase access from a secure page. ' + - 'Please use https in calls to new Firebase().'); - } -}; -/** - * Returns true if data is NaN, or +/- Infinity. - */ -var isInvalidJSONNumber = function (data) { - return (typeof data === 'number' && - (data !== data || // NaN - data === Number.POSITIVE_INFINITY || - data === Number.NEGATIVE_INFINITY)); -}; -var executeWhenDOMReady = function (fn) { - if (util.isNodeSdk() || document.readyState === 'complete') { - fn(); - } - else { - // Modeled after jQuery. Try DOMContentLoaded and onreadystatechange (which - // fire before onload), but fall back to onload. - var called_1 = false; - var wrappedFn_1 = function () { - if (!document.body) { - setTimeout(wrappedFn_1, Math.floor(10)); - return; - } - if (!called_1) { - called_1 = true; - fn(); - } - }; - if (document.addEventListener) { - document.addEventListener('DOMContentLoaded', wrappedFn_1, false); - // fallback to onload. - window.addEventListener('load', wrappedFn_1, false); - // eslint-disable-next-line @typescript-eslint/no-explicit-any - } - else if (document.attachEvent) { - // IE. - // eslint-disable-next-line @typescript-eslint/no-explicit-any - document.attachEvent('onreadystatechange', function () { - if (document.readyState === 'complete') { - wrappedFn_1(); - } - }); - // fallback to onload. - // eslint-disable-next-line @typescript-eslint/no-explicit-any - window.attachEvent('onload', wrappedFn_1); - // jQuery has an extra hack for IE that we could employ (based on - // http://javascript.nwbox.com/IEContentLoaded/) But it looks really old. - // I'm hoping we don't need it. - } - } -}; -/** - * Minimum key name. Invalid for actual data, used as a marker to sort before any valid names - */ -var MIN_NAME = '[MIN_NAME]'; -/** - * Maximum key name. Invalid for actual data, used as a marker to sort above any valid names - */ -var MAX_NAME = '[MAX_NAME]'; -/** - * Compares valid Firebase key names, plus min and max name - */ -var nameCompare = function (a, b) { - if (a === b) { - return 0; - } - else if (a === MIN_NAME || b === MAX_NAME) { - return -1; - } - else if (b === MIN_NAME || a === MAX_NAME) { - return 1; - } - else { - var aAsInt = tryParseInt(a), bAsInt = tryParseInt(b); - if (aAsInt !== null) { - if (bAsInt !== null) { - return aAsInt - bAsInt === 0 ? a.length - b.length : aAsInt - bAsInt; - } - else { - return -1; - } - } - else if (bAsInt !== null) { - return 1; - } - else { - return a < b ? -1 : 1; - } - } -}; -/** - * @returns {!number} comparison result. - */ -var stringCompare = function (a, b) { - if (a === b) { - return 0; - } - else if (a < b) { - return -1; - } - else { - return 1; - } -}; -var requireKey = function (key, obj) { - if (obj && key in obj) { - return obj[key]; - } - else { - throw new Error('Missing required key (' + key + ') in object: ' + util.stringify(obj)); - } -}; -var ObjectToUniqueKey = function (obj) { - if (typeof obj !== 'object' || obj === null) { - return util.stringify(obj); - } - var keys = []; - // eslint-disable-next-line guard-for-in - for (var k in obj) { - keys.push(k); - } - // Export as json, but with the keys sorted. - keys.sort(); - var key = '{'; - for (var i = 0; i < keys.length; i++) { - if (i !== 0) { - key += ','; - } - key += util.stringify(keys[i]); - key += ':'; - key += ObjectToUniqueKey(obj[keys[i]]); - } - key += '}'; - return key; -}; -/** - * Splits a string into a number of smaller segments of maximum size - * @param str - The string - * @param segsize - The maximum number of chars in the string. - * @returns The string, split into appropriately-sized chunks - */ -var splitStringBySize = function (str, segsize) { - var len = str.length; - if (len <= segsize) { - return [str]; - } - var dataSegs = []; - for (var c = 0; c < len; c += segsize) { - if (c + segsize > len) { - dataSegs.push(str.substring(c, len)); - } - else { - dataSegs.push(str.substring(c, c + segsize)); - } - } - return dataSegs; -}; -/** - * Apply a function to each (key, value) pair in an object or - * apply a function to each (index, value) pair in an array - * @param obj - The object or array to iterate over - * @param fn - The function to apply - */ -function each(obj, fn) { - for (var key in obj) { - if (obj.hasOwnProperty(key)) { - fn(key, obj[key]); - } - } -} -/** - * Borrowed from http://hg.secondlife.com/llsd/src/tip/js/typedarray.js (MIT License) - * I made one modification at the end and removed the NaN / Infinity - * handling (since it seemed broken [caused an overflow] and we don't need it). See MJL comments. - * @param v - A double - * - */ -var doubleToIEEE754String = function (v) { - util.assert(!isInvalidJSONNumber(v), 'Invalid JSON number'); // MJL - var ebits = 11, fbits = 52; - var bias = (1 << (ebits - 1)) - 1; - var s, e, f, ln, i; - // Compute sign, exponent, fraction - // Skip NaN / Infinity handling --MJL. - if (v === 0) { - e = 0; - f = 0; - s = 1 / v === -Infinity ? 1 : 0; - } - else { - s = v < 0; - v = Math.abs(v); - if (v >= Math.pow(2, 1 - bias)) { - // Normalized - ln = Math.min(Math.floor(Math.log(v) / Math.LN2), bias); - e = ln + bias; - f = Math.round(v * Math.pow(2, fbits - ln) - Math.pow(2, fbits)); - } - else { - // Denormalized - e = 0; - f = Math.round(v / Math.pow(2, 1 - bias - fbits)); - } - } - // Pack sign, exponent, fraction - var bits = []; - for (i = fbits; i; i -= 1) { - bits.push(f % 2 ? 1 : 0); - f = Math.floor(f / 2); - } - for (i = ebits; i; i -= 1) { - bits.push(e % 2 ? 1 : 0); - e = Math.floor(e / 2); - } - bits.push(s ? 1 : 0); - bits.reverse(); - var str = bits.join(''); - // Return the data as a hex string. --MJL - var hexByteString = ''; - for (i = 0; i < 64; i += 8) { - var hexByte = parseInt(str.substr(i, 8), 2).toString(16); - if (hexByte.length === 1) { - hexByte = '0' + hexByte; - } - hexByteString = hexByteString + hexByte; - } - return hexByteString.toLowerCase(); -}; -/** - * Used to detect if we're in a Chrome content script (which executes in an - * isolated environment where long-polling doesn't work). - */ -var isChromeExtensionContentScript = function () { - return !!(typeof window === 'object' && - window['chrome'] && - window['chrome']['extension'] && - !/^chrome/.test(window.location.href)); -}; -/** - * Used to detect if we're in a Windows 8 Store app. - */ -var isWindowsStoreApp = function () { - // Check for the presence of a couple WinRT globals - return typeof Windows === 'object' && typeof Windows.UI === 'object'; -}; -/** - * Converts a server error code to a Javascript Error - */ -function errorForServerCode(code, query) { - var reason = 'Unknown Error'; - if (code === 'too_big') { - reason = - 'The data requested exceeds the maximum size ' + - 'that can be accessed with a single request.'; - } - else if (code === 'permission_denied') { - reason = "Client doesn't have permission to access the desired data."; - } - else if (code === 'unavailable') { - reason = 'The service is unavailable'; - } - var error = new Error(code + ' at ' + query._path.toString() + ': ' + reason); - // eslint-disable-next-line @typescript-eslint/no-explicit-any - error.code = code.toUpperCase(); - return error; -} -/** - * Used to test for integer-looking strings - */ -var INTEGER_REGEXP_ = new RegExp('^-?(0*)\\d{1,10}$'); -/** - * For use in keys, the minimum possible 32-bit integer. - */ -var INTEGER_32_MIN = -2147483648; -/** - * For use in kyes, the maximum possible 32-bit integer. - */ -var INTEGER_32_MAX = 2147483647; -/** - * If the string contains a 32-bit integer, return it. Else return null. - */ -var tryParseInt = function (str) { - if (INTEGER_REGEXP_.test(str)) { - var intVal = Number(str); - if (intVal >= INTEGER_32_MIN && intVal <= INTEGER_32_MAX) { - return intVal; - } - } - return null; -}; -/** - * Helper to run some code but catch any exceptions and re-throw them later. - * Useful for preventing user callbacks from breaking internal code. - * - * Re-throwing the exception from a setTimeout is a little evil, but it's very - * convenient (we don't have to try to figure out when is a safe point to - * re-throw it), and the behavior seems reasonable: - * - * * If you aren't pausing on exceptions, you get an error in the console with - * the correct stack trace. - * * If you're pausing on all exceptions, the debugger will pause on your - * exception and then again when we rethrow it. - * * If you're only pausing on uncaught exceptions, the debugger will only pause - * on us re-throwing it. - * - * @param fn - The code to guard. - */ -var exceptionGuard = function (fn) { - try { - fn(); - } - catch (e) { - // Re-throw exception when it's safe. - setTimeout(function () { - // It used to be that "throw e" would result in a good console error with - // relevant context, but as of Chrome 39, you just get the firebase.js - // file/line number where we re-throw it, which is useless. So we log - // e.stack explicitly. - var stack = e.stack || ''; - warn('Exception was thrown by user callback.', stack); - throw e; - }, Math.floor(0)); - } -}; -/** - * @returns {boolean} true if we think we're currently being crawled. - */ -var beingCrawled = function () { - var userAgent = (typeof window === 'object' && - window['navigator'] && - window['navigator']['userAgent']) || - ''; - // For now we whitelist the most popular crawlers. We should refine this to be the set of crawlers we - // believe to support JavaScript/AJAX rendering. - // NOTE: Google Webmaster Tools doesn't really belong, but their "This is how a visitor to your website - // would have seen the page" is flaky if we don't treat it as a crawler. - return (userAgent.search(/googlebot|google webmaster tools|bingbot|yahoo! slurp|baiduspider|yandexbot|duckduckbot/i) >= 0); -}; -/** - * Same as setTimeout() except on Node.JS it will /not/ prevent the process from exiting. - * - * It is removed with clearTimeout() as normal. - * - * @param fn - Function to run. - * @param time - Milliseconds to wait before running. - * @returns The setTimeout() return value. - */ -var setTimeoutNonBlocking = function (fn, time) { - var timeout = setTimeout(fn, time); - // Note: at the time of this comment, unrefTimer is under the unstable set of APIs. Run with --unstable to enable the API. - if (typeof timeout === 'number' && - // @ts-ignore Is only defined in Deno environments. - typeof Deno !== 'undefined' && - // @ts-ignore Deno and unrefTimer are only defined in Deno environments. - Deno['unrefTimer']) { - // @ts-ignore Deno and unrefTimer are only defined in Deno environments. - Deno.unrefTimer(timeout); - // eslint-disable-next-line @typescript-eslint/no-explicit-any - } - else if (typeof timeout === 'object' && timeout['unref']) { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - timeout['unref'](); - } - return timeout; -}; - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * A class that holds metadata about a Repo object - */ -var RepoInfo = /** @class */ (function () { - /** - * @param host - Hostname portion of the url for the repo - * @param secure - Whether or not this repo is accessed over ssl - * @param namespace - The namespace represented by the repo - * @param webSocketOnly - Whether to prefer websockets over all other transports (used by Nest). - * @param nodeAdmin - Whether this instance uses Admin SDK credentials - * @param persistenceKey - Override the default session persistence storage key - */ - function RepoInfo(host, secure, namespace, webSocketOnly, nodeAdmin, persistenceKey, includeNamespaceInQueryParams) { - if (nodeAdmin === void 0) { nodeAdmin = false; } - if (persistenceKey === void 0) { persistenceKey = ''; } - if (includeNamespaceInQueryParams === void 0) { includeNamespaceInQueryParams = false; } - this.secure = secure; - this.namespace = namespace; - this.webSocketOnly = webSocketOnly; - this.nodeAdmin = nodeAdmin; - this.persistenceKey = persistenceKey; - this.includeNamespaceInQueryParams = includeNamespaceInQueryParams; - this._host = host.toLowerCase(); - this._domain = this._host.substr(this._host.indexOf('.') + 1); - this.internalHost = - PersistentStorage.get('host:' + host) || this._host; - } - RepoInfo.prototype.isCacheableHost = function () { - return this.internalHost.substr(0, 2) === 's-'; - }; - RepoInfo.prototype.isCustomHost = function () { - return (this._domain !== 'firebaseio.com' && - this._domain !== 'firebaseio-demo.com'); - }; - Object.defineProperty(RepoInfo.prototype, "host", { - get: function () { - return this._host; - }, - set: function (newHost) { - if (newHost !== this.internalHost) { - this.internalHost = newHost; - if (this.isCacheableHost()) { - PersistentStorage.set('host:' + this._host, this.internalHost); - } - } - }, - enumerable: false, - configurable: true - }); - RepoInfo.prototype.toString = function () { - var str = this.toURLString(); - if (this.persistenceKey) { - str += '<' + this.persistenceKey + '>'; - } - return str; - }; - RepoInfo.prototype.toURLString = function () { - var protocol = this.secure ? 'https://' : 'http://'; - var query = this.includeNamespaceInQueryParams - ? "?ns=" + this.namespace - : ''; - return "" + protocol + this.host + "/" + query; - }; - return RepoInfo; -}()); -function repoInfoNeedsQueryParam(repoInfo) { - return (repoInfo.host !== repoInfo.internalHost || - repoInfo.isCustomHost() || - repoInfo.includeNamespaceInQueryParams); -} -/** - * Returns the websocket URL for this repo - * @param repoInfo - RepoInfo object - * @param type - of connection - * @param params - list - * @returns The URL for this repo - */ -function repoInfoConnectionURL(repoInfo, type, params) { - util.assert(typeof type === 'string', 'typeof type must == string'); - util.assert(typeof params === 'object', 'typeof params must == object'); - var connURL; - if (type === WEBSOCKET) { - connURL = - (repoInfo.secure ? 'wss://' : 'ws://') + repoInfo.internalHost + '/.ws?'; - } - else if (type === LONG_POLLING) { - connURL = - (repoInfo.secure ? 'https://' : 'http://') + - repoInfo.internalHost + - '/.lp?'; - } - else { - throw new Error('Unknown connection type: ' + type); - } - if (repoInfoNeedsQueryParam(repoInfo)) { - params['ns'] = repoInfo.namespace; - } - var pairs = []; - each(params, function (key, value) { - pairs.push(key + '=' + value); - }); - return connURL + pairs.join('&'); -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Tracks a collection of stats. - */ -var StatsCollection = /** @class */ (function () { - function StatsCollection() { - this.counters_ = {}; - } - StatsCollection.prototype.incrementCounter = function (name, amount) { - if (amount === void 0) { amount = 1; } - if (!util.contains(this.counters_, name)) { - this.counters_[name] = 0; - } - this.counters_[name] += amount; - }; - StatsCollection.prototype.get = function () { - return util.deepCopy(this.counters_); - }; - return StatsCollection; -}()); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var collections = {}; -var reporters = {}; -function statsManagerGetCollection(repoInfo) { - var hashString = repoInfo.toString(); - if (!collections[hashString]) { - collections[hashString] = new StatsCollection(); - } - return collections[hashString]; -} -function statsManagerGetOrCreateReporter(repoInfo, creatorFunction) { - var hashString = repoInfo.toString(); - if (!reporters[hashString]) { - reporters[hashString] = creatorFunction(); - } - return reporters[hashString]; -} - -/** - * @license - * Copyright 2019 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** The semver (www.semver.org) version of the SDK. */ -var SDK_VERSION = ''; -/** - * SDK_VERSION should be set before any database instance is created - * @internal - */ -function setSDKVersion(version) { - SDK_VERSION = version; -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var WEBSOCKET_MAX_FRAME_SIZE = 16384; -var WEBSOCKET_KEEPALIVE_INTERVAL = 45000; -var WebSocketImpl = null; -if (typeof MozWebSocket !== 'undefined') { - WebSocketImpl = MozWebSocket; -} -else if (typeof WebSocket !== 'undefined') { - WebSocketImpl = WebSocket; -} -function setWebSocketImpl(impl) { - WebSocketImpl = impl; -} -/** - * Create a new websocket connection with the given callbacks. - */ -var WebSocketConnection = /** @class */ (function () { - /** - * @param connId identifier for this transport - * @param repoInfo The info for the websocket endpoint. - * @param applicationId The Firebase App ID for this project. - * @param appCheckToken The App Check Token for this client. - * @param authToken The Auth Token for this client. - * @param transportSessionId Optional transportSessionId if this is connecting - * to an existing transport session - * @param lastSessionId Optional lastSessionId if there was a previous - * connection - */ - function WebSocketConnection(connId, repoInfo, applicationId, appCheckToken, authToken, transportSessionId, lastSessionId) { - this.connId = connId; - this.applicationId = applicationId; - this.appCheckToken = appCheckToken; - this.authToken = authToken; - this.keepaliveTimer = null; - this.frames = null; - this.totalFrames = 0; - this.bytesSent = 0; - this.bytesReceived = 0; - this.log_ = logWrapper(this.connId); - this.stats_ = statsManagerGetCollection(repoInfo); - this.connURL = WebSocketConnection.connectionURL_(repoInfo, transportSessionId, lastSessionId, appCheckToken, applicationId); - this.nodeAdmin = repoInfo.nodeAdmin; - } - /** - * @param repoInfo - The info for the websocket endpoint. - * @param transportSessionId - Optional transportSessionId if this is connecting to an existing transport - * session - * @param lastSessionId - Optional lastSessionId if there was a previous connection - * @returns connection url - */ - WebSocketConnection.connectionURL_ = function (repoInfo, transportSessionId, lastSessionId, appCheckToken, applicationId) { - var urlParams = {}; - urlParams[VERSION_PARAM] = PROTOCOL_VERSION; - if (!util.isNodeSdk() && - typeof location !== 'undefined' && - location.hostname && - FORGE_DOMAIN_RE.test(location.hostname)) { - urlParams[REFERER_PARAM] = FORGE_REF; - } - if (transportSessionId) { - urlParams[TRANSPORT_SESSION_PARAM] = transportSessionId; - } - if (lastSessionId) { - urlParams[LAST_SESSION_PARAM] = lastSessionId; - } - if (appCheckToken) { - urlParams[APP_CHECK_TOKEN_PARAM] = appCheckToken; - } - if (applicationId) { - urlParams[APPLICATION_ID_PARAM] = applicationId; - } - return repoInfoConnectionURL(repoInfo, WEBSOCKET, urlParams); - }; - /** - * @param onMessage - Callback when messages arrive - * @param onDisconnect - Callback with connection lost. - */ - WebSocketConnection.prototype.open = function (onMessage, onDisconnect) { - var _this = this; - this.onDisconnect = onDisconnect; - this.onMessage = onMessage; - this.log_('Websocket connecting to ' + this.connURL); - this.everConnected_ = false; - // Assume failure until proven otherwise. - PersistentStorage.set('previous_websocket_failure', true); - try { - var options = void 0; - if (util.isNodeSdk()) { - var device = this.nodeAdmin ? 'AdminNode' : 'Node'; - // UA Format: Firebase//// - options = { - headers: { - 'User-Agent': "Firebase/" + PROTOCOL_VERSION + "/" + SDK_VERSION + "/" + process.platform + "/" + device, - 'X-Firebase-GMPID': this.applicationId || '' - } - }; - // If using Node with admin creds, AppCheck-related checks are unnecessary. - // Note that we send the credentials here even if they aren't admin credentials, which is - // not a problem. - // Note that this header is just used to bypass appcheck, and the token should still be sent - // through the websocket connection once it is established. - if (this.authToken) { - options.headers['Authorization'] = "Bearer " + this.authToken; - } - if (this.appCheckToken) { - options.headers['X-Firebase-AppCheck'] = this.appCheckToken; - } - // Plumb appropriate http_proxy environment variable into faye-websocket if it exists. - var env = process['env']; - var proxy = this.connURL.indexOf('wss://') === 0 - ? env['HTTPS_PROXY'] || env['https_proxy'] - : env['HTTP_PROXY'] || env['http_proxy']; - if (proxy) { - options['proxy'] = { origin: proxy }; - } - } - this.mySock = new WebSocketImpl(this.connURL, [], options); - } - catch (e) { - this.log_('Error instantiating WebSocket.'); - var error = e.message || e.data; - if (error) { - this.log_(error); - } - this.onClosed_(); - return; - } - this.mySock.onopen = function () { - _this.log_('Websocket connected.'); - _this.everConnected_ = true; - }; - this.mySock.onclose = function () { - _this.log_('Websocket connection was disconnected.'); - _this.mySock = null; - _this.onClosed_(); - }; - this.mySock.onmessage = function (m) { - _this.handleIncomingFrame(m); - }; - this.mySock.onerror = function (e) { - _this.log_('WebSocket error. Closing connection.'); - // eslint-disable-next-line @typescript-eslint/no-explicit-any - var error = e.message || e.data; - if (error) { - _this.log_(error); - } - _this.onClosed_(); - }; - }; - /** - * No-op for websockets, we don't need to do anything once the connection is confirmed as open - */ - WebSocketConnection.prototype.start = function () { }; - WebSocketConnection.forceDisallow = function () { - WebSocketConnection.forceDisallow_ = true; - }; - WebSocketConnection.isAvailable = function () { - var isOldAndroid = false; - if (typeof navigator !== 'undefined' && navigator.userAgent) { - var oldAndroidRegex = /Android ([0-9]{0,}\.[0-9]{0,})/; - var oldAndroidMatch = navigator.userAgent.match(oldAndroidRegex); - if (oldAndroidMatch && oldAndroidMatch.length > 1) { - if (parseFloat(oldAndroidMatch[1]) < 4.4) { - isOldAndroid = true; - } - } - } - return (!isOldAndroid && - WebSocketImpl !== null && - !WebSocketConnection.forceDisallow_); - }; - /** - * Returns true if we previously failed to connect with this transport. - */ - WebSocketConnection.previouslyFailed = function () { - // If our persistent storage is actually only in-memory storage, - // we default to assuming that it previously failed to be safe. - return (PersistentStorage.isInMemoryStorage || - PersistentStorage.get('previous_websocket_failure') === true); - }; - WebSocketConnection.prototype.markConnectionHealthy = function () { - PersistentStorage.remove('previous_websocket_failure'); - }; - WebSocketConnection.prototype.appendFrame_ = function (data) { - this.frames.push(data); - if (this.frames.length === this.totalFrames) { - var fullMess = this.frames.join(''); - this.frames = null; - var jsonMess = util.jsonEval(fullMess); - //handle the message - this.onMessage(jsonMess); - } - }; - /** - * @param frameCount - The number of frames we are expecting from the server - */ - WebSocketConnection.prototype.handleNewFrameCount_ = function (frameCount) { - this.totalFrames = frameCount; - this.frames = []; - }; - /** - * Attempts to parse a frame count out of some text. If it can't, assumes a value of 1 - * @returns Any remaining data to be process, or null if there is none - */ - WebSocketConnection.prototype.extractFrameCount_ = function (data) { - util.assert(this.frames === null, 'We already have a frame buffer'); - // TODO: The server is only supposed to send up to 9999 frames (i.e. length <= 4), but that isn't being enforced - // currently. So allowing larger frame counts (length <= 6). See https://app.asana.com/0/search/8688598998380/8237608042508 - if (data.length <= 6) { - var frameCount = Number(data); - if (!isNaN(frameCount)) { - this.handleNewFrameCount_(frameCount); - return null; - } - } - this.handleNewFrameCount_(1); - return data; - }; - /** - * Process a websocket frame that has arrived from the server. - * @param mess - The frame data - */ - WebSocketConnection.prototype.handleIncomingFrame = function (mess) { - if (this.mySock === null) { - return; // Chrome apparently delivers incoming packets even after we .close() the connection sometimes. - } - var data = mess['data']; - this.bytesReceived += data.length; - this.stats_.incrementCounter('bytes_received', data.length); - this.resetKeepAlive(); - if (this.frames !== null) { - // we're buffering - this.appendFrame_(data); - } - else { - // try to parse out a frame count, otherwise, assume 1 and process it - var remainingData = this.extractFrameCount_(data); - if (remainingData !== null) { - this.appendFrame_(remainingData); - } - } - }; - /** - * Send a message to the server - * @param data - The JSON object to transmit - */ - WebSocketConnection.prototype.send = function (data) { - this.resetKeepAlive(); - var dataStr = util.stringify(data); - this.bytesSent += dataStr.length; - this.stats_.incrementCounter('bytes_sent', dataStr.length); - //We can only fit a certain amount in each websocket frame, so we need to split this request - //up into multiple pieces if it doesn't fit in one request. - var dataSegs = splitStringBySize(dataStr, WEBSOCKET_MAX_FRAME_SIZE); - //Send the length header - if (dataSegs.length > 1) { - this.sendString_(String(dataSegs.length)); - } - //Send the actual data in segments. - for (var i = 0; i < dataSegs.length; i++) { - this.sendString_(dataSegs[i]); - } - }; - WebSocketConnection.prototype.shutdown_ = function () { - this.isClosed_ = true; - if (this.keepaliveTimer) { - clearInterval(this.keepaliveTimer); - this.keepaliveTimer = null; - } - if (this.mySock) { - this.mySock.close(); - this.mySock = null; - } - }; - WebSocketConnection.prototype.onClosed_ = function () { - if (!this.isClosed_) { - this.log_('WebSocket is closing itself'); - this.shutdown_(); - // since this is an internal close, trigger the close listener - if (this.onDisconnect) { - this.onDisconnect(this.everConnected_); - this.onDisconnect = null; - } - } - }; - /** - * External-facing close handler. - * Close the websocket and kill the connection. - */ - WebSocketConnection.prototype.close = function () { - if (!this.isClosed_) { - this.log_('WebSocket is being closed'); - this.shutdown_(); - } - }; - /** - * Kill the current keepalive timer and start a new one, to ensure that it always fires N seconds after - * the last activity. - */ - WebSocketConnection.prototype.resetKeepAlive = function () { - var _this = this; - clearInterval(this.keepaliveTimer); - this.keepaliveTimer = setInterval(function () { - //If there has been no websocket activity for a while, send a no-op - if (_this.mySock) { - _this.sendString_('0'); - } - _this.resetKeepAlive(); - // eslint-disable-next-line @typescript-eslint/no-explicit-any - }, Math.floor(WEBSOCKET_KEEPALIVE_INTERVAL)); - }; - /** - * Send a string over the websocket. - * - * @param str - String to send. - */ - WebSocketConnection.prototype.sendString_ = function (str) { - // Firefox seems to sometimes throw exceptions (NS_ERROR_UNEXPECTED) from websocket .send() - // calls for some unknown reason. We treat these as an error and disconnect. - // See https://app.asana.com/0/58926111402292/68021340250410 - try { - this.mySock.send(str); - } - catch (e) { - this.log_('Exception thrown from WebSocket.send():', e.message || e.data, 'Closing connection.'); - setTimeout(this.onClosed_.bind(this), 0); - } - }; - /** - * Number of response before we consider the connection "healthy." - */ - WebSocketConnection.responsesRequiredToBeHealthy = 2; - /** - * Time to wait for the connection te become healthy before giving up. - */ - WebSocketConnection.healthyTimeout = 30000; - return WebSocketConnection; -}()); - -var name = "@firebase/database"; -var version = "0.13.10"; - -/** - * @license - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Abstraction around AppCheck's token fetching capabilities. - */ -var AppCheckTokenProvider = /** @class */ (function () { - function AppCheckTokenProvider(appName_, appCheckProvider) { - var _this = this; - this.appName_ = appName_; - this.appCheckProvider = appCheckProvider; - this.appCheck = appCheckProvider === null || appCheckProvider === void 0 ? void 0 : appCheckProvider.getImmediate({ optional: true }); - if (!this.appCheck) { - appCheckProvider === null || appCheckProvider === void 0 ? void 0 : appCheckProvider.get().then(function (appCheck) { return (_this.appCheck = appCheck); }); - } - } - AppCheckTokenProvider.prototype.getToken = function (forceRefresh) { - var _this = this; - if (!this.appCheck) { - return new Promise(function (resolve, reject) { - // Support delayed initialization of FirebaseAppCheck. This allows our - // customers to initialize the RTDB SDK before initializing Firebase - // AppCheck and ensures that all requests are authenticated if a token - // becomes available before the timoeout below expires. - setTimeout(function () { - if (_this.appCheck) { - _this.getToken(forceRefresh).then(resolve, reject); - } - else { - resolve(null); - } - }, 0); - }); - } - return this.appCheck.getToken(forceRefresh); - }; - AppCheckTokenProvider.prototype.addTokenChangeListener = function (listener) { - var _a; - (_a = this.appCheckProvider) === null || _a === void 0 ? void 0 : _a.get().then(function (appCheck) { return appCheck.addTokenListener(listener); }); - }; - AppCheckTokenProvider.prototype.notifyForInvalidToken = function () { - warn("Provided AppCheck credentials for the app named \"" + this.appName_ + "\" " + - 'are invalid. This usually indicates your app was not initialized correctly.'); - }; - return AppCheckTokenProvider; -}()); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Abstraction around FirebaseApp's token fetching capabilities. - */ -var FirebaseAuthTokenProvider = /** @class */ (function () { - function FirebaseAuthTokenProvider(appName_, firebaseOptions_, authProvider_) { - var _this = this; - this.appName_ = appName_; - this.firebaseOptions_ = firebaseOptions_; - this.authProvider_ = authProvider_; - this.auth_ = null; - this.auth_ = authProvider_.getImmediate({ optional: true }); - if (!this.auth_) { - authProvider_.onInit(function (auth) { return (_this.auth_ = auth); }); - } - } - FirebaseAuthTokenProvider.prototype.getToken = function (forceRefresh) { - var _this = this; - if (!this.auth_) { - return new Promise(function (resolve, reject) { - // Support delayed initialization of FirebaseAuth. This allows our - // customers to initialize the RTDB SDK before initializing Firebase - // Auth and ensures that all requests are authenticated if a token - // becomes available before the timoeout below expires. - setTimeout(function () { - if (_this.auth_) { - _this.getToken(forceRefresh).then(resolve, reject); - } - else { - resolve(null); - } - }, 0); - }); - } - return this.auth_.getToken(forceRefresh).catch(function (error) { - // TODO: Need to figure out all the cases this is raised and whether - // this makes sense. - if (error && error.code === 'auth/token-not-initialized') { - log('Got auth/token-not-initialized error. Treating as null token.'); - return null; - } - else { - return Promise.reject(error); - } - }); - }; - FirebaseAuthTokenProvider.prototype.addTokenChangeListener = function (listener) { - // TODO: We might want to wrap the listener and call it with no args to - // avoid a leaky abstraction, but that makes removing the listener harder. - if (this.auth_) { - this.auth_.addAuthTokenListener(listener); - } - else { - this.authProvider_ - .get() - .then(function (auth) { return auth.addAuthTokenListener(listener); }); - } - }; - FirebaseAuthTokenProvider.prototype.removeTokenChangeListener = function (listener) { - this.authProvider_ - .get() - .then(function (auth) { return auth.removeAuthTokenListener(listener); }); - }; - FirebaseAuthTokenProvider.prototype.notifyForInvalidToken = function () { - var errorMessage = 'Provided authentication credentials for the app named "' + - this.appName_ + - '" are invalid. This usually indicates your app was not ' + - 'initialized correctly. '; - if ('credential' in this.firebaseOptions_) { - errorMessage += - 'Make sure the "credential" property provided to initializeApp() ' + - 'is authorized to access the specified "databaseURL" and is from the correct ' + - 'project.'; - } - else if ('serviceAccount' in this.firebaseOptions_) { - errorMessage += - 'Make sure the "serviceAccount" property provided to initializeApp() ' + - 'is authorized to access the specified "databaseURL" and is from the correct ' + - 'project.'; - } - else { - errorMessage += - 'Make sure the "apiKey" and "databaseURL" properties provided to ' + - 'initializeApp() match the values provided for your app at ' + - 'https://console.firebase.google.com/.'; - } - warn(errorMessage); - }; - return FirebaseAuthTokenProvider; -}()); -/* AuthTokenProvider that supplies a constant token. Used by Admin SDK or mockUserToken with emulators. */ -var EmulatorTokenProvider = /** @class */ (function () { - function EmulatorTokenProvider(accessToken) { - this.accessToken = accessToken; - } - EmulatorTokenProvider.prototype.getToken = function (forceRefresh) { - return Promise.resolve({ - accessToken: this.accessToken - }); - }; - EmulatorTokenProvider.prototype.addTokenChangeListener = function (listener) { - // Invoke the listener immediately to match the behavior in Firebase Auth - // (see packages/auth/src/auth.js#L1807) - listener(this.accessToken); - }; - EmulatorTokenProvider.prototype.removeTokenChangeListener = function (listener) { }; - EmulatorTokenProvider.prototype.notifyForInvalidToken = function () { }; - /** A string that is treated as an admin access token by the RTDB emulator. Used by Admin SDK. */ - EmulatorTokenProvider.OWNER = 'owner'; - return EmulatorTokenProvider; -}()); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * This class ensures the packets from the server arrive in order - * This class takes data from the server and ensures it gets passed into the callbacks in order. - */ -var PacketReceiver = /** @class */ (function () { - /** - * @param onMessage_ - */ - function PacketReceiver(onMessage_) { - this.onMessage_ = onMessage_; - this.pendingResponses = []; - this.currentResponseNum = 0; - this.closeAfterResponse = -1; - this.onClose = null; - } - PacketReceiver.prototype.closeAfter = function (responseNum, callback) { - this.closeAfterResponse = responseNum; - this.onClose = callback; - if (this.closeAfterResponse < this.currentResponseNum) { - this.onClose(); - this.onClose = null; - } - }; - /** - * Each message from the server comes with a response number, and an array of data. The responseNumber - * allows us to ensure that we process them in the right order, since we can't be guaranteed that all - * browsers will respond in the same order as the requests we sent - */ - PacketReceiver.prototype.handleResponse = function (requestNum, data) { - var _this = this; - this.pendingResponses[requestNum] = data; - var _loop_1 = function () { - var toProcess = this_1.pendingResponses[this_1.currentResponseNum]; - delete this_1.pendingResponses[this_1.currentResponseNum]; - var _loop_2 = function (i) { - if (toProcess[i]) { - exceptionGuard(function () { - _this.onMessage_(toProcess[i]); - }); - } - }; - for (var i = 0; i < toProcess.length; ++i) { - _loop_2(i); - } - if (this_1.currentResponseNum === this_1.closeAfterResponse) { - if (this_1.onClose) { - this_1.onClose(); - this_1.onClose = null; - } - return "break"; - } - this_1.currentResponseNum++; - }; - var this_1 = this; - while (this.pendingResponses[this.currentResponseNum]) { - var state_1 = _loop_1(); - if (state_1 === "break") - break; - } - }; - return PacketReceiver; -}()); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// URL query parameters associated with longpolling -var FIREBASE_LONGPOLL_START_PARAM = 'start'; -var FIREBASE_LONGPOLL_CLOSE_COMMAND = 'close'; -var FIREBASE_LONGPOLL_COMMAND_CB_NAME = 'pLPCommand'; -var FIREBASE_LONGPOLL_DATA_CB_NAME = 'pRTLPCB'; -var FIREBASE_LONGPOLL_ID_PARAM = 'id'; -var FIREBASE_LONGPOLL_PW_PARAM = 'pw'; -var FIREBASE_LONGPOLL_SERIAL_PARAM = 'ser'; -var FIREBASE_LONGPOLL_CALLBACK_ID_PARAM = 'cb'; -var FIREBASE_LONGPOLL_SEGMENT_NUM_PARAM = 'seg'; -var FIREBASE_LONGPOLL_SEGMENTS_IN_PACKET = 'ts'; -var FIREBASE_LONGPOLL_DATA_PARAM = 'd'; -var FIREBASE_LONGPOLL_DISCONN_FRAME_REQUEST_PARAM = 'dframe'; -//Data size constants. -//TODO: Perf: the maximum length actually differs from browser to browser. -// We should check what browser we're on and set accordingly. -var MAX_URL_DATA_SIZE = 1870; -var SEG_HEADER_SIZE = 30; //ie: &seg=8299234&ts=982389123&d= -var MAX_PAYLOAD_SIZE = MAX_URL_DATA_SIZE - SEG_HEADER_SIZE; -/** - * Keepalive period - * send a fresh request at minimum every 25 seconds. Opera has a maximum request - * length of 30 seconds that we can't exceed. - */ -var KEEPALIVE_REQUEST_INTERVAL = 25000; -/** - * How long to wait before aborting a long-polling connection attempt. - */ -var LP_CONNECT_TIMEOUT = 30000; -/** - * This class manages a single long-polling connection. - */ -var BrowserPollConnection = /** @class */ (function () { - /** - * @param connId An identifier for this connection, used for logging - * @param repoInfo The info for the endpoint to send data to. - * @param applicationId The Firebase App ID for this project. - * @param appCheckToken The AppCheck token for this client. - * @param authToken The AuthToken to use for this connection. - * @param transportSessionId Optional transportSessionid if we are - * reconnecting for an existing transport session - * @param lastSessionId Optional lastSessionId if the PersistentConnection has - * already created a connection previously - */ - function BrowserPollConnection(connId, repoInfo, applicationId, appCheckToken, authToken, transportSessionId, lastSessionId) { - var _this = this; - this.connId = connId; - this.repoInfo = repoInfo; - this.applicationId = applicationId; - this.appCheckToken = appCheckToken; - this.authToken = authToken; - this.transportSessionId = transportSessionId; - this.lastSessionId = lastSessionId; - this.bytesSent = 0; - this.bytesReceived = 0; - this.everConnected_ = false; - this.log_ = logWrapper(connId); - this.stats_ = statsManagerGetCollection(repoInfo); - this.urlFn = function (params) { - // Always add the token if we have one. - if (_this.appCheckToken) { - params[APP_CHECK_TOKEN_PARAM] = _this.appCheckToken; - } - return repoInfoConnectionURL(repoInfo, LONG_POLLING, params); - }; - } - /** - * @param onMessage - Callback when messages arrive - * @param onDisconnect - Callback with connection lost. - */ - BrowserPollConnection.prototype.open = function (onMessage, onDisconnect) { - var _this = this; - this.curSegmentNum = 0; - this.onDisconnect_ = onDisconnect; - this.myPacketOrderer = new PacketReceiver(onMessage); - this.isClosed_ = false; - this.connectTimeoutTimer_ = setTimeout(function () { - _this.log_('Timed out trying to connect.'); - // Make sure we clear the host cache - _this.onClosed_(); - _this.connectTimeoutTimer_ = null; - // eslint-disable-next-line @typescript-eslint/no-explicit-any - }, Math.floor(LP_CONNECT_TIMEOUT)); - // Ensure we delay the creation of the iframe until the DOM is loaded. - executeWhenDOMReady(function () { - if (_this.isClosed_) { - return; - } - //Set up a callback that gets triggered once a connection is set up. - _this.scriptTagHolder = new FirebaseIFrameScriptHolder(function () { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - var _a = tslib.__read(args, 5), command = _a[0], arg1 = _a[1], arg2 = _a[2]; _a[3]; _a[4]; - _this.incrementIncomingBytes_(args); - if (!_this.scriptTagHolder) { - return; // we closed the connection. - } - if (_this.connectTimeoutTimer_) { - clearTimeout(_this.connectTimeoutTimer_); - _this.connectTimeoutTimer_ = null; - } - _this.everConnected_ = true; - if (command === FIREBASE_LONGPOLL_START_PARAM) { - _this.id = arg1; - _this.password = arg2; - } - else if (command === FIREBASE_LONGPOLL_CLOSE_COMMAND) { - // Don't clear the host cache. We got a response from the server, so we know it's reachable - if (arg1) { - // We aren't expecting any more data (other than what the server's already in the process of sending us - // through our already open polls), so don't send any more. - _this.scriptTagHolder.sendNewPolls = false; - // arg1 in this case is the last response number sent by the server. We should try to receive - // all of the responses up to this one before closing - _this.myPacketOrderer.closeAfter(arg1, function () { - _this.onClosed_(); - }); - } - else { - _this.onClosed_(); - } - } - else { - throw new Error('Unrecognized command received: ' + command); - } - }, function () { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - var _a = tslib.__read(args, 2), pN = _a[0], data = _a[1]; - _this.incrementIncomingBytes_(args); - _this.myPacketOrderer.handleResponse(pN, data); - }, function () { - _this.onClosed_(); - }, _this.urlFn); - //Send the initial request to connect. The serial number is simply to keep the browser from pulling previous results - //from cache. - var urlParams = {}; - urlParams[FIREBASE_LONGPOLL_START_PARAM] = 't'; - urlParams[FIREBASE_LONGPOLL_SERIAL_PARAM] = Math.floor(Math.random() * 100000000); - if (_this.scriptTagHolder.uniqueCallbackIdentifier) { - urlParams[FIREBASE_LONGPOLL_CALLBACK_ID_PARAM] = - _this.scriptTagHolder.uniqueCallbackIdentifier; - } - urlParams[VERSION_PARAM] = PROTOCOL_VERSION; - if (_this.transportSessionId) { - urlParams[TRANSPORT_SESSION_PARAM] = _this.transportSessionId; - } - if (_this.lastSessionId) { - urlParams[LAST_SESSION_PARAM] = _this.lastSessionId; - } - if (_this.applicationId) { - urlParams[APPLICATION_ID_PARAM] = _this.applicationId; - } - if (_this.appCheckToken) { - urlParams[APP_CHECK_TOKEN_PARAM] = _this.appCheckToken; - } - if (typeof location !== 'undefined' && - location.hostname && - FORGE_DOMAIN_RE.test(location.hostname)) { - urlParams[REFERER_PARAM] = FORGE_REF; - } - var connectURL = _this.urlFn(urlParams); - _this.log_('Connecting via long-poll to ' + connectURL); - _this.scriptTagHolder.addTag(connectURL, function () { - /* do nothing */ - }); - }); - }; - /** - * Call this when a handshake has completed successfully and we want to consider the connection established - */ - BrowserPollConnection.prototype.start = function () { - this.scriptTagHolder.startLongPoll(this.id, this.password); - this.addDisconnectPingFrame(this.id, this.password); - }; - /** - * Forces long polling to be considered as a potential transport - */ - BrowserPollConnection.forceAllow = function () { - BrowserPollConnection.forceAllow_ = true; - }; - /** - * Forces longpolling to not be considered as a potential transport - */ - BrowserPollConnection.forceDisallow = function () { - BrowserPollConnection.forceDisallow_ = true; - }; - // Static method, use string literal so it can be accessed in a generic way - BrowserPollConnection.isAvailable = function () { - if (util.isNodeSdk()) { - return false; - } - else if (BrowserPollConnection.forceAllow_) { - return true; - } - else { - // NOTE: In React-Native there's normally no 'document', but if you debug a React-Native app in - // the Chrome debugger, 'document' is defined, but document.createElement is null (2015/06/08). - return (!BrowserPollConnection.forceDisallow_ && - typeof document !== 'undefined' && - document.createElement != null && - !isChromeExtensionContentScript() && - !isWindowsStoreApp()); - } - }; - /** - * No-op for polling - */ - BrowserPollConnection.prototype.markConnectionHealthy = function () { }; - /** - * Stops polling and cleans up the iframe - */ - BrowserPollConnection.prototype.shutdown_ = function () { - this.isClosed_ = true; - if (this.scriptTagHolder) { - this.scriptTagHolder.close(); - this.scriptTagHolder = null; - } - //remove the disconnect frame, which will trigger an XHR call to the server to tell it we're leaving. - if (this.myDisconnFrame) { - document.body.removeChild(this.myDisconnFrame); - this.myDisconnFrame = null; - } - if (this.connectTimeoutTimer_) { - clearTimeout(this.connectTimeoutTimer_); - this.connectTimeoutTimer_ = null; - } - }; - /** - * Triggered when this transport is closed - */ - BrowserPollConnection.prototype.onClosed_ = function () { - if (!this.isClosed_) { - this.log_('Longpoll is closing itself'); - this.shutdown_(); - if (this.onDisconnect_) { - this.onDisconnect_(this.everConnected_); - this.onDisconnect_ = null; - } - } - }; - /** - * External-facing close handler. RealTime has requested we shut down. Kill our connection and tell the server - * that we've left. - */ - BrowserPollConnection.prototype.close = function () { - if (!this.isClosed_) { - this.log_('Longpoll is being closed.'); - this.shutdown_(); - } - }; - /** - * Send the JSON object down to the server. It will need to be stringified, base64 encoded, and then - * broken into chunks (since URLs have a small maximum length). - * @param data - The JSON data to transmit. - */ - BrowserPollConnection.prototype.send = function (data) { - var dataStr = util.stringify(data); - this.bytesSent += dataStr.length; - this.stats_.incrementCounter('bytes_sent', dataStr.length); - //first, lets get the base64-encoded data - var base64data = util.base64Encode(dataStr); - //We can only fit a certain amount in each URL, so we need to split this request - //up into multiple pieces if it doesn't fit in one request. - var dataSegs = splitStringBySize(base64data, MAX_PAYLOAD_SIZE); - //Enqueue each segment for transmission. We assign each chunk a sequential ID and a total number - //of segments so that we can reassemble the packet on the server. - for (var i = 0; i < dataSegs.length; i++) { - this.scriptTagHolder.enqueueSegment(this.curSegmentNum, dataSegs.length, dataSegs[i]); - this.curSegmentNum++; - } - }; - /** - * This is how we notify the server that we're leaving. - * We aren't able to send requests with DHTML on a window close event, but we can - * trigger XHR requests in some browsers (everything but Opera basically). - */ - BrowserPollConnection.prototype.addDisconnectPingFrame = function (id, pw) { - if (util.isNodeSdk()) { - return; - } - this.myDisconnFrame = document.createElement('iframe'); - var urlParams = {}; - urlParams[FIREBASE_LONGPOLL_DISCONN_FRAME_REQUEST_PARAM] = 't'; - urlParams[FIREBASE_LONGPOLL_ID_PARAM] = id; - urlParams[FIREBASE_LONGPOLL_PW_PARAM] = pw; - this.myDisconnFrame.src = this.urlFn(urlParams); - this.myDisconnFrame.style.display = 'none'; - document.body.appendChild(this.myDisconnFrame); - }; - /** - * Used to track the bytes received by this client - */ - BrowserPollConnection.prototype.incrementIncomingBytes_ = function (args) { - // TODO: This is an annoying perf hit just to track the number of incoming bytes. Maybe it should be opt-in. - var bytesReceived = util.stringify(args).length; - this.bytesReceived += bytesReceived; - this.stats_.incrementCounter('bytes_received', bytesReceived); - }; - return BrowserPollConnection; -}()); -/********************************************************************************************* - * A wrapper around an iframe that is used as a long-polling script holder. - *********************************************************************************************/ -var FirebaseIFrameScriptHolder = /** @class */ (function () { - /** - * @param commandCB - The callback to be called when control commands are recevied from the server. - * @param onMessageCB - The callback to be triggered when responses arrive from the server. - * @param onDisconnect - The callback to be triggered when this tag holder is closed - * @param urlFn - A function that provides the URL of the endpoint to send data to. - */ - function FirebaseIFrameScriptHolder(commandCB, onMessageCB, onDisconnect, urlFn) { - this.onDisconnect = onDisconnect; - this.urlFn = urlFn; - //We maintain a count of all of the outstanding requests, because if we have too many active at once it can cause - //problems in some browsers. - this.outstandingRequests = new Set(); - //A queue of the pending segments waiting for transmission to the server. - this.pendingSegs = []; - //A serial number. We use this for two things: - // 1) A way to ensure the browser doesn't cache responses to polls - // 2) A way to make the server aware when long-polls arrive in a different order than we started them. The - // server needs to release both polls in this case or it will cause problems in Opera since Opera can only execute - // JSONP code in the order it was added to the iframe. - this.currentSerial = Math.floor(Math.random() * 100000000); - // This gets set to false when we're "closing down" the connection (e.g. we're switching transports but there's still - // incoming data from the server that we're waiting for). - this.sendNewPolls = true; - if (!util.isNodeSdk()) { - //Each script holder registers a couple of uniquely named callbacks with the window. These are called from the - //iframes where we put the long-polling script tags. We have two callbacks: - // 1) Command Callback - Triggered for control issues, like starting a connection. - // 2) Message Callback - Triggered when new data arrives. - this.uniqueCallbackIdentifier = LUIDGenerator(); - window[FIREBASE_LONGPOLL_COMMAND_CB_NAME + this.uniqueCallbackIdentifier] = commandCB; - window[FIREBASE_LONGPOLL_DATA_CB_NAME + this.uniqueCallbackIdentifier] = - onMessageCB; - //Create an iframe for us to add script tags to. - this.myIFrame = FirebaseIFrameScriptHolder.createIFrame_(); - // Set the iframe's contents. - var script = ''; - // if we set a javascript url, it's IE and we need to set the document domain. The javascript url is sufficient - // for ie9, but ie8 needs to do it again in the document itself. - if (this.myIFrame.src && - this.myIFrame.src.substr(0, 'javascript:'.length) === 'javascript:') { - var currentDomain = document.domain; - script = ''; - } - var iframeContents = '' + script + ''; - try { - this.myIFrame.doc.open(); - this.myIFrame.doc.write(iframeContents); - this.myIFrame.doc.close(); - } - catch (e) { - log('frame writing exception'); - if (e.stack) { - log(e.stack); - } - log(e); - } - } - else { - this.commandCB = commandCB; - this.onMessageCB = onMessageCB; - } - } - /** - * Each browser has its own funny way to handle iframes. Here we mush them all together into one object that I can - * actually use. - */ - FirebaseIFrameScriptHolder.createIFrame_ = function () { - var iframe = document.createElement('iframe'); - iframe.style.display = 'none'; - // This is necessary in order to initialize the document inside the iframe - if (document.body) { - document.body.appendChild(iframe); - try { - // If document.domain has been modified in IE, this will throw an error, and we need to set the - // domain of the iframe's document manually. We can do this via a javascript: url as the src attribute - // Also note that we must do this *after* the iframe has been appended to the page. Otherwise it doesn't work. - var a = iframe.contentWindow.document; - if (!a) { - // Apologies for the log-spam, I need to do something to keep closure from optimizing out the assignment above. - log('No IE domain setting required'); - } - } - catch (e) { - var domain = document.domain; - iframe.src = - "javascript:void((function(){document.open();document.domain='" + - domain + - "';document.close();})())"; - } - } - else { - // LongPollConnection attempts to delay initialization until the document is ready, so hopefully this - // never gets hit. - throw 'Document body has not initialized. Wait to initialize Firebase until after the document is ready.'; - } - // Get the document of the iframe in a browser-specific way. - if (iframe.contentDocument) { - iframe.doc = iframe.contentDocument; // Firefox, Opera, Safari - } - else if (iframe.contentWindow) { - iframe.doc = iframe.contentWindow.document; // Internet Explorer - // eslint-disable-next-line @typescript-eslint/no-explicit-any - } - else if (iframe.document) { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - iframe.doc = iframe.document; //others? - } - return iframe; - }; - /** - * Cancel all outstanding queries and remove the frame. - */ - FirebaseIFrameScriptHolder.prototype.close = function () { - var _this = this; - //Mark this iframe as dead, so no new requests are sent. - this.alive = false; - if (this.myIFrame) { - //We have to actually remove all of the html inside this iframe before removing it from the - //window, or IE will continue loading and executing the script tags we've already added, which - //can lead to some errors being thrown. Setting innerHTML seems to be the easiest way to do this. - this.myIFrame.doc.body.innerHTML = ''; - setTimeout(function () { - if (_this.myIFrame !== null) { - document.body.removeChild(_this.myIFrame); - _this.myIFrame = null; - } - }, Math.floor(0)); - } - // Protect from being called recursively. - var onDisconnect = this.onDisconnect; - if (onDisconnect) { - this.onDisconnect = null; - onDisconnect(); - } - }; - /** - * Actually start the long-polling session by adding the first script tag(s) to the iframe. - * @param id - The ID of this connection - * @param pw - The password for this connection - */ - FirebaseIFrameScriptHolder.prototype.startLongPoll = function (id, pw) { - this.myID = id; - this.myPW = pw; - this.alive = true; - //send the initial request. If there are requests queued, make sure that we transmit as many as we are currently able to. - while (this.newRequest_()) { } - }; - /** - * This is called any time someone might want a script tag to be added. It adds a script tag when there aren't - * too many outstanding requests and we are still alive. - * - * If there are outstanding packet segments to send, it sends one. If there aren't, it sends a long-poll anyways if - * needed. - */ - FirebaseIFrameScriptHolder.prototype.newRequest_ = function () { - // We keep one outstanding request open all the time to receive data, but if we need to send data - // (pendingSegs.length > 0) then we create a new request to send the data. The server will automatically - // close the old request. - if (this.alive && - this.sendNewPolls && - this.outstandingRequests.size < (this.pendingSegs.length > 0 ? 2 : 1)) { - //construct our url - this.currentSerial++; - var urlParams = {}; - urlParams[FIREBASE_LONGPOLL_ID_PARAM] = this.myID; - urlParams[FIREBASE_LONGPOLL_PW_PARAM] = this.myPW; - urlParams[FIREBASE_LONGPOLL_SERIAL_PARAM] = this.currentSerial; - var theURL = this.urlFn(urlParams); - //Now add as much data as we can. - var curDataString = ''; - var i = 0; - while (this.pendingSegs.length > 0) { - //first, lets see if the next segment will fit. - var nextSeg = this.pendingSegs[0]; - if (nextSeg.d.length + - SEG_HEADER_SIZE + - curDataString.length <= - MAX_URL_DATA_SIZE) { - //great, the segment will fit. Lets append it. - var theSeg = this.pendingSegs.shift(); - curDataString = - curDataString + - '&' + - FIREBASE_LONGPOLL_SEGMENT_NUM_PARAM + - i + - '=' + - theSeg.seg + - '&' + - FIREBASE_LONGPOLL_SEGMENTS_IN_PACKET + - i + - '=' + - theSeg.ts + - '&' + - FIREBASE_LONGPOLL_DATA_PARAM + - i + - '=' + - theSeg.d; - i++; - } - else { - break; - } - } - theURL = theURL + curDataString; - this.addLongPollTag_(theURL, this.currentSerial); - return true; - } - else { - return false; - } - }; - /** - * Queue a packet for transmission to the server. - * @param segnum - A sequential id for this packet segment used for reassembly - * @param totalsegs - The total number of segments in this packet - * @param data - The data for this segment. - */ - FirebaseIFrameScriptHolder.prototype.enqueueSegment = function (segnum, totalsegs, data) { - //add this to the queue of segments to send. - this.pendingSegs.push({ seg: segnum, ts: totalsegs, d: data }); - //send the data immediately if there isn't already data being transmitted, unless - //startLongPoll hasn't been called yet. - if (this.alive) { - this.newRequest_(); - } - }; - /** - * Add a script tag for a regular long-poll request. - * @param url - The URL of the script tag. - * @param serial - The serial number of the request. - */ - FirebaseIFrameScriptHolder.prototype.addLongPollTag_ = function (url, serial) { - var _this = this; - //remember that we sent this request. - this.outstandingRequests.add(serial); - var doNewRequest = function () { - _this.outstandingRequests.delete(serial); - _this.newRequest_(); - }; - // If this request doesn't return on its own accord (by the server sending us some data), we'll - // create a new one after the KEEPALIVE interval to make sure we always keep a fresh request open. - var keepaliveTimeout = setTimeout(doNewRequest, Math.floor(KEEPALIVE_REQUEST_INTERVAL)); - var readyStateCB = function () { - // Request completed. Cancel the keepalive. - clearTimeout(keepaliveTimeout); - // Trigger a new request so we can continue receiving data. - doNewRequest(); - }; - this.addTag(url, readyStateCB); - }; - /** - * Add an arbitrary script tag to the iframe. - * @param url - The URL for the script tag source. - * @param loadCB - A callback to be triggered once the script has loaded. - */ - FirebaseIFrameScriptHolder.prototype.addTag = function (url, loadCB) { - var _this = this; - if (util.isNodeSdk()) { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - this.doNodeLongPoll(url, loadCB); - } - else { - setTimeout(function () { - try { - // if we're already closed, don't add this poll - if (!_this.sendNewPolls) { - return; - } - var newScript_1 = _this.myIFrame.doc.createElement('script'); - newScript_1.type = 'text/javascript'; - newScript_1.async = true; - newScript_1.src = url; - // eslint-disable-next-line @typescript-eslint/no-explicit-any - newScript_1.onload = newScript_1.onreadystatechange = - function () { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - var rstate = newScript_1.readyState; - if (!rstate || rstate === 'loaded' || rstate === 'complete') { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - newScript_1.onload = newScript_1.onreadystatechange = null; - if (newScript_1.parentNode) { - newScript_1.parentNode.removeChild(newScript_1); - } - loadCB(); - } - }; - newScript_1.onerror = function () { - log('Long-poll script failed to load: ' + url); - _this.sendNewPolls = false; - _this.close(); - }; - _this.myIFrame.doc.body.appendChild(newScript_1); - } - catch (e) { - // TODO: we should make this error visible somehow - } - }, Math.floor(1)); - } - }; - return FirebaseIFrameScriptHolder; -}()); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Currently simplistic, this class manages what transport a Connection should use at various stages of its - * lifecycle. - * - * It starts with longpolling in a browser, and httppolling on node. It then upgrades to websockets if - * they are available. - */ -var TransportManager = /** @class */ (function () { - /** - * @param repoInfo - Metadata around the namespace we're connecting to - */ - function TransportManager(repoInfo) { - this.initTransports_(repoInfo); - } - Object.defineProperty(TransportManager, "ALL_TRANSPORTS", { - get: function () { - return [BrowserPollConnection, WebSocketConnection]; - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(TransportManager, "IS_TRANSPORT_INITIALIZED", { - /** - * Returns whether transport has been selected to ensure WebSocketConnection or BrowserPollConnection are not called after - * TransportManager has already set up transports_ - */ - get: function () { - return this.globalTransportInitialized_; - }, - enumerable: false, - configurable: true - }); - TransportManager.prototype.initTransports_ = function (repoInfo) { - var e_1, _a; - var isWebSocketsAvailable = WebSocketConnection && WebSocketConnection['isAvailable'](); - var isSkipPollConnection = isWebSocketsAvailable && !WebSocketConnection.previouslyFailed(); - if (repoInfo.webSocketOnly) { - if (!isWebSocketsAvailable) { - warn("wss:// URL used, but browser isn't known to support websockets. Trying anyway."); - } - isSkipPollConnection = true; - } - if (isSkipPollConnection) { - this.transports_ = [WebSocketConnection]; - } - else { - var transports = (this.transports_ = []); - try { - for (var _b = tslib.__values(TransportManager.ALL_TRANSPORTS), _c = _b.next(); !_c.done; _c = _b.next()) { - var transport = _c.value; - if (transport && transport['isAvailable']()) { - transports.push(transport); - } - } - } - catch (e_1_1) { e_1 = { error: e_1_1 }; } - finally { - try { - if (_c && !_c.done && (_a = _b.return)) _a.call(_b); - } - finally { if (e_1) throw e_1.error; } - } - TransportManager.globalTransportInitialized_ = true; - } - }; - /** - * @returns The constructor for the initial transport to use - */ - TransportManager.prototype.initialTransport = function () { - if (this.transports_.length > 0) { - return this.transports_[0]; - } - else { - throw new Error('No transports available'); - } - }; - /** - * @returns The constructor for the next transport, or null - */ - TransportManager.prototype.upgradeTransport = function () { - if (this.transports_.length > 1) { - return this.transports_[1]; - } - else { - return null; - } - }; - // Keeps track of whether the TransportManager has already chosen a transport to use - TransportManager.globalTransportInitialized_ = false; - return TransportManager; -}()); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Abort upgrade attempt if it takes longer than 60s. -var UPGRADE_TIMEOUT = 60000; -// For some transports (WebSockets), we need to "validate" the transport by exchanging a few requests and responses. -// If we haven't sent enough requests within 5s, we'll start sending noop ping requests. -var DELAY_BEFORE_SENDING_EXTRA_REQUESTS = 5000; -// If the initial data sent triggers a lot of bandwidth (i.e. it's a large put or a listen for a large amount of data) -// then we may not be able to exchange our ping/pong requests within the healthy timeout. So if we reach the timeout -// but we've sent/received enough bytes, we don't cancel the connection. -var BYTES_SENT_HEALTHY_OVERRIDE = 10 * 1024; -var BYTES_RECEIVED_HEALTHY_OVERRIDE = 100 * 1024; -var MESSAGE_TYPE = 't'; -var MESSAGE_DATA = 'd'; -var CONTROL_SHUTDOWN = 's'; -var CONTROL_RESET = 'r'; -var CONTROL_ERROR = 'e'; -var CONTROL_PONG = 'o'; -var SWITCH_ACK = 'a'; -var END_TRANSMISSION = 'n'; -var PING = 'p'; -var SERVER_HELLO = 'h'; -/** - * Creates a new real-time connection to the server using whichever method works - * best in the current browser. - */ -var Connection = /** @class */ (function () { - /** - * @param id - an id for this connection - * @param repoInfo_ - the info for the endpoint to connect to - * @param applicationId_ - the Firebase App ID for this project - * @param appCheckToken_ - The App Check Token for this device. - * @param authToken_ - The auth token for this session. - * @param onMessage_ - the callback to be triggered when a server-push message arrives - * @param onReady_ - the callback to be triggered when this connection is ready to send messages. - * @param onDisconnect_ - the callback to be triggered when a connection was lost - * @param onKill_ - the callback to be triggered when this connection has permanently shut down. - * @param lastSessionId - last session id in persistent connection. is used to clean up old session in real-time server - */ - function Connection(id, repoInfo_, applicationId_, appCheckToken_, authToken_, onMessage_, onReady_, onDisconnect_, onKill_, lastSessionId) { - this.id = id; - this.repoInfo_ = repoInfo_; - this.applicationId_ = applicationId_; - this.appCheckToken_ = appCheckToken_; - this.authToken_ = authToken_; - this.onMessage_ = onMessage_; - this.onReady_ = onReady_; - this.onDisconnect_ = onDisconnect_; - this.onKill_ = onKill_; - this.lastSessionId = lastSessionId; - this.connectionCount = 0; - this.pendingDataMessages = []; - this.state_ = 0 /* CONNECTING */; - this.log_ = logWrapper('c:' + this.id + ':'); - this.transportManager_ = new TransportManager(repoInfo_); - this.log_('Connection created'); - this.start_(); - } - /** - * Starts a connection attempt - */ - Connection.prototype.start_ = function () { - var _this = this; - var conn = this.transportManager_.initialTransport(); - this.conn_ = new conn(this.nextTransportId_(), this.repoInfo_, this.applicationId_, this.appCheckToken_, this.authToken_, null, this.lastSessionId); - // For certain transports (WebSockets), we need to send and receive several messages back and forth before we - // can consider the transport healthy. - this.primaryResponsesRequired_ = conn['responsesRequiredToBeHealthy'] || 0; - var onMessageReceived = this.connReceiver_(this.conn_); - var onConnectionLost = this.disconnReceiver_(this.conn_); - this.tx_ = this.conn_; - this.rx_ = this.conn_; - this.secondaryConn_ = null; - this.isHealthy_ = false; - /* - * Firefox doesn't like when code from one iframe tries to create another iframe by way of the parent frame. - * This can occur in the case of a redirect, i.e. we guessed wrong on what server to connect to and received a reset. - * Somehow, setTimeout seems to make this ok. That doesn't make sense from a security perspective, since you should - * still have the context of your originating frame. - */ - setTimeout(function () { - // this.conn_ gets set to null in some of the tests. Check to make sure it still exists before using it - _this.conn_ && _this.conn_.open(onMessageReceived, onConnectionLost); - }, Math.floor(0)); - var healthyTimeoutMS = conn['healthyTimeout'] || 0; - if (healthyTimeoutMS > 0) { - this.healthyTimeout_ = setTimeoutNonBlocking(function () { - _this.healthyTimeout_ = null; - if (!_this.isHealthy_) { - if (_this.conn_ && - _this.conn_.bytesReceived > BYTES_RECEIVED_HEALTHY_OVERRIDE) { - _this.log_('Connection exceeded healthy timeout but has received ' + - _this.conn_.bytesReceived + - ' bytes. Marking connection healthy.'); - _this.isHealthy_ = true; - _this.conn_.markConnectionHealthy(); - } - else if (_this.conn_ && - _this.conn_.bytesSent > BYTES_SENT_HEALTHY_OVERRIDE) { - _this.log_('Connection exceeded healthy timeout but has sent ' + - _this.conn_.bytesSent + - ' bytes. Leaving connection alive.'); - // NOTE: We don't want to mark it healthy, since we have no guarantee that the bytes have made it to - // the server. - } - else { - _this.log_('Closing unhealthy connection after timeout.'); - _this.close(); - } - } - // eslint-disable-next-line @typescript-eslint/no-explicit-any - }, Math.floor(healthyTimeoutMS)); - } - }; - Connection.prototype.nextTransportId_ = function () { - return 'c:' + this.id + ':' + this.connectionCount++; - }; - Connection.prototype.disconnReceiver_ = function (conn) { - var _this = this; - return function (everConnected) { - if (conn === _this.conn_) { - _this.onConnectionLost_(everConnected); - } - else if (conn === _this.secondaryConn_) { - _this.log_('Secondary connection lost.'); - _this.onSecondaryConnectionLost_(); - } - else { - _this.log_('closing an old connection'); - } - }; - }; - Connection.prototype.connReceiver_ = function (conn) { - var _this = this; - return function (message) { - if (_this.state_ !== 2 /* DISCONNECTED */) { - if (conn === _this.rx_) { - _this.onPrimaryMessageReceived_(message); - } - else if (conn === _this.secondaryConn_) { - _this.onSecondaryMessageReceived_(message); - } - else { - _this.log_('message on old connection'); - } - } - }; - }; - /** - * @param dataMsg - An arbitrary data message to be sent to the server - */ - Connection.prototype.sendRequest = function (dataMsg) { - // wrap in a data message envelope and send it on - var msg = { t: 'd', d: dataMsg }; - this.sendData_(msg); - }; - Connection.prototype.tryCleanupConnection = function () { - if (this.tx_ === this.secondaryConn_ && this.rx_ === this.secondaryConn_) { - this.log_('cleaning up and promoting a connection: ' + this.secondaryConn_.connId); - this.conn_ = this.secondaryConn_; - this.secondaryConn_ = null; - // the server will shutdown the old connection - } - }; - Connection.prototype.onSecondaryControl_ = function (controlData) { - if (MESSAGE_TYPE in controlData) { - var cmd = controlData[MESSAGE_TYPE]; - if (cmd === SWITCH_ACK) { - this.upgradeIfSecondaryHealthy_(); - } - else if (cmd === CONTROL_RESET) { - // Most likely the session wasn't valid. Abandon the switch attempt - this.log_('Got a reset on secondary, closing it'); - this.secondaryConn_.close(); - // If we were already using this connection for something, than we need to fully close - if (this.tx_ === this.secondaryConn_ || - this.rx_ === this.secondaryConn_) { - this.close(); - } - } - else if (cmd === CONTROL_PONG) { - this.log_('got pong on secondary.'); - this.secondaryResponsesRequired_--; - this.upgradeIfSecondaryHealthy_(); - } - } - }; - Connection.prototype.onSecondaryMessageReceived_ = function (parsedData) { - var layer = requireKey('t', parsedData); - var data = requireKey('d', parsedData); - if (layer === 'c') { - this.onSecondaryControl_(data); - } - else if (layer === 'd') { - // got a data message, but we're still second connection. Need to buffer it up - this.pendingDataMessages.push(data); - } - else { - throw new Error('Unknown protocol layer: ' + layer); - } - }; - Connection.prototype.upgradeIfSecondaryHealthy_ = function () { - if (this.secondaryResponsesRequired_ <= 0) { - this.log_('Secondary connection is healthy.'); - this.isHealthy_ = true; - this.secondaryConn_.markConnectionHealthy(); - this.proceedWithUpgrade_(); - } - else { - // Send a ping to make sure the connection is healthy. - this.log_('sending ping on secondary.'); - this.secondaryConn_.send({ t: 'c', d: { t: PING, d: {} } }); - } - }; - Connection.prototype.proceedWithUpgrade_ = function () { - // tell this connection to consider itself open - this.secondaryConn_.start(); - // send ack - this.log_('sending client ack on secondary'); - this.secondaryConn_.send({ t: 'c', d: { t: SWITCH_ACK, d: {} } }); - // send end packet on primary transport, switch to sending on this one - // can receive on this one, buffer responses until end received on primary transport - this.log_('Ending transmission on primary'); - this.conn_.send({ t: 'c', d: { t: END_TRANSMISSION, d: {} } }); - this.tx_ = this.secondaryConn_; - this.tryCleanupConnection(); - }; - Connection.prototype.onPrimaryMessageReceived_ = function (parsedData) { - // Must refer to parsedData properties in quotes, so closure doesn't touch them. - var layer = requireKey('t', parsedData); - var data = requireKey('d', parsedData); - if (layer === 'c') { - this.onControl_(data); - } - else if (layer === 'd') { - this.onDataMessage_(data); - } - }; - Connection.prototype.onDataMessage_ = function (message) { - this.onPrimaryResponse_(); - // We don't do anything with data messages, just kick them up a level - this.onMessage_(message); - }; - Connection.prototype.onPrimaryResponse_ = function () { - if (!this.isHealthy_) { - this.primaryResponsesRequired_--; - if (this.primaryResponsesRequired_ <= 0) { - this.log_('Primary connection is healthy.'); - this.isHealthy_ = true; - this.conn_.markConnectionHealthy(); - } - } - }; - Connection.prototype.onControl_ = function (controlData) { - var cmd = requireKey(MESSAGE_TYPE, controlData); - if (MESSAGE_DATA in controlData) { - var payload = controlData[MESSAGE_DATA]; - if (cmd === SERVER_HELLO) { - this.onHandshake_(payload); - } - else if (cmd === END_TRANSMISSION) { - this.log_('recvd end transmission on primary'); - this.rx_ = this.secondaryConn_; - for (var i = 0; i < this.pendingDataMessages.length; ++i) { - this.onDataMessage_(this.pendingDataMessages[i]); - } - this.pendingDataMessages = []; - this.tryCleanupConnection(); - } - else if (cmd === CONTROL_SHUTDOWN) { - // This was previously the 'onKill' callback passed to the lower-level connection - // payload in this case is the reason for the shutdown. Generally a human-readable error - this.onConnectionShutdown_(payload); - } - else if (cmd === CONTROL_RESET) { - // payload in this case is the host we should contact - this.onReset_(payload); - } - else if (cmd === CONTROL_ERROR) { - error('Server Error: ' + payload); - } - else if (cmd === CONTROL_PONG) { - this.log_('got pong on primary.'); - this.onPrimaryResponse_(); - this.sendPingOnPrimaryIfNecessary_(); - } - else { - error('Unknown control packet command: ' + cmd); - } - } - }; - /** - * @param handshake - The handshake data returned from the server - */ - Connection.prototype.onHandshake_ = function (handshake) { - var timestamp = handshake.ts; - var version = handshake.v; - var host = handshake.h; - this.sessionId = handshake.s; - this.repoInfo_.host = host; - // if we've already closed the connection, then don't bother trying to progress further - if (this.state_ === 0 /* CONNECTING */) { - this.conn_.start(); - this.onConnectionEstablished_(this.conn_, timestamp); - if (PROTOCOL_VERSION !== version) { - warn('Protocol version mismatch detected'); - } - // TODO: do we want to upgrade? when? maybe a delay? - this.tryStartUpgrade_(); - } - }; - Connection.prototype.tryStartUpgrade_ = function () { - var conn = this.transportManager_.upgradeTransport(); - if (conn) { - this.startUpgrade_(conn); - } - }; - Connection.prototype.startUpgrade_ = function (conn) { - var _this = this; - this.secondaryConn_ = new conn(this.nextTransportId_(), this.repoInfo_, this.applicationId_, this.appCheckToken_, this.authToken_, this.sessionId); - // For certain transports (WebSockets), we need to send and receive several messages back and forth before we - // can consider the transport healthy. - this.secondaryResponsesRequired_ = - conn['responsesRequiredToBeHealthy'] || 0; - var onMessage = this.connReceiver_(this.secondaryConn_); - var onDisconnect = this.disconnReceiver_(this.secondaryConn_); - this.secondaryConn_.open(onMessage, onDisconnect); - // If we haven't successfully upgraded after UPGRADE_TIMEOUT, give up and kill the secondary. - setTimeoutNonBlocking(function () { - if (_this.secondaryConn_) { - _this.log_('Timed out trying to upgrade.'); - _this.secondaryConn_.close(); - } - }, Math.floor(UPGRADE_TIMEOUT)); - }; - Connection.prototype.onReset_ = function (host) { - this.log_('Reset packet received. New host: ' + host); - this.repoInfo_.host = host; - // TODO: if we're already "connected", we need to trigger a disconnect at the next layer up. - // We don't currently support resets after the connection has already been established - if (this.state_ === 1 /* CONNECTED */) { - this.close(); - } - else { - // Close whatever connections we have open and start again. - this.closeConnections_(); - this.start_(); - } - }; - Connection.prototype.onConnectionEstablished_ = function (conn, timestamp) { - var _this = this; - this.log_('Realtime connection established.'); - this.conn_ = conn; - this.state_ = 1 /* CONNECTED */; - if (this.onReady_) { - this.onReady_(timestamp, this.sessionId); - this.onReady_ = null; - } - // If after 5 seconds we haven't sent enough requests to the server to get the connection healthy, - // send some pings. - if (this.primaryResponsesRequired_ === 0) { - this.log_('Primary connection is healthy.'); - this.isHealthy_ = true; - } - else { - setTimeoutNonBlocking(function () { - _this.sendPingOnPrimaryIfNecessary_(); - }, Math.floor(DELAY_BEFORE_SENDING_EXTRA_REQUESTS)); - } - }; - Connection.prototype.sendPingOnPrimaryIfNecessary_ = function () { - // If the connection isn't considered healthy yet, we'll send a noop ping packet request. - if (!this.isHealthy_ && this.state_ === 1 /* CONNECTED */) { - this.log_('sending ping on primary.'); - this.sendData_({ t: 'c', d: { t: PING, d: {} } }); - } - }; - Connection.prototype.onSecondaryConnectionLost_ = function () { - var conn = this.secondaryConn_; - this.secondaryConn_ = null; - if (this.tx_ === conn || this.rx_ === conn) { - // we are relying on this connection already in some capacity. Therefore, a failure is real - this.close(); - } - }; - /** - * @param everConnected - Whether or not the connection ever reached a server. Used to determine if - * we should flush the host cache - */ - Connection.prototype.onConnectionLost_ = function (everConnected) { - this.conn_ = null; - // NOTE: IF you're seeing a Firefox error for this line, I think it might be because it's getting - // called on window close and RealtimeState.CONNECTING is no longer defined. Just a guess. - if (!everConnected && this.state_ === 0 /* CONNECTING */) { - this.log_('Realtime connection failed.'); - // Since we failed to connect at all, clear any cached entry for this namespace in case the machine went away - if (this.repoInfo_.isCacheableHost()) { - PersistentStorage.remove('host:' + this.repoInfo_.host); - // reset the internal host to what we would show the user, i.e. .firebaseio.com - this.repoInfo_.internalHost = this.repoInfo_.host; - } - } - else if (this.state_ === 1 /* CONNECTED */) { - this.log_('Realtime connection lost.'); - } - this.close(); - }; - Connection.prototype.onConnectionShutdown_ = function (reason) { - this.log_('Connection shutdown command received. Shutting down...'); - if (this.onKill_) { - this.onKill_(reason); - this.onKill_ = null; - } - // We intentionally don't want to fire onDisconnect (kill is a different case), - // so clear the callback. - this.onDisconnect_ = null; - this.close(); - }; - Connection.prototype.sendData_ = function (data) { - if (this.state_ !== 1 /* CONNECTED */) { - throw 'Connection is not connected'; - } - else { - this.tx_.send(data); - } - }; - /** - * Cleans up this connection, calling the appropriate callbacks - */ - Connection.prototype.close = function () { - if (this.state_ !== 2 /* DISCONNECTED */) { - this.log_('Closing realtime connection.'); - this.state_ = 2 /* DISCONNECTED */; - this.closeConnections_(); - if (this.onDisconnect_) { - this.onDisconnect_(); - this.onDisconnect_ = null; - } - } - }; - Connection.prototype.closeConnections_ = function () { - this.log_('Shutting down all connections'); - if (this.conn_) { - this.conn_.close(); - this.conn_ = null; - } - if (this.secondaryConn_) { - this.secondaryConn_.close(); - this.secondaryConn_ = null; - } - if (this.healthyTimeout_) { - clearTimeout(this.healthyTimeout_); - this.healthyTimeout_ = null; - } - }; - return Connection; -}()); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Interface defining the set of actions that can be performed against the Firebase server - * (basically corresponds to our wire protocol). - * - * @interface - */ -var ServerActions = /** @class */ (function () { - function ServerActions() { - } - ServerActions.prototype.put = function (pathString, data, onComplete, hash) { }; - ServerActions.prototype.merge = function (pathString, data, onComplete, hash) { }; - /** - * Refreshes the auth token for the current connection. - * @param token - The authentication token - */ - ServerActions.prototype.refreshAuthToken = function (token) { }; - /** - * Refreshes the app check token for the current connection. - * @param token The app check token - */ - ServerActions.prototype.refreshAppCheckToken = function (token) { }; - ServerActions.prototype.onDisconnectPut = function (pathString, data, onComplete) { }; - ServerActions.prototype.onDisconnectMerge = function (pathString, data, onComplete) { }; - ServerActions.prototype.onDisconnectCancel = function (pathString, onComplete) { }; - ServerActions.prototype.reportStats = function (stats) { }; - return ServerActions; -}()); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Base class to be used if you want to emit events. Call the constructor with - * the set of allowed event names. - */ -var EventEmitter = /** @class */ (function () { - function EventEmitter(allowedEvents_) { - this.allowedEvents_ = allowedEvents_; - this.listeners_ = {}; - util.assert(Array.isArray(allowedEvents_) && allowedEvents_.length > 0, 'Requires a non-empty array'); - } - /** - * To be called by derived classes to trigger events. - */ - EventEmitter.prototype.trigger = function (eventType) { - var varArgs = []; - for (var _i = 1; _i < arguments.length; _i++) { - varArgs[_i - 1] = arguments[_i]; - } - if (Array.isArray(this.listeners_[eventType])) { - // Clone the list, since callbacks could add/remove listeners. - var listeners = tslib.__spreadArray([], tslib.__read(this.listeners_[eventType])); - for (var i = 0; i < listeners.length; i++) { - listeners[i].callback.apply(listeners[i].context, varArgs); - } - } - }; - EventEmitter.prototype.on = function (eventType, callback, context) { - this.validateEventType_(eventType); - this.listeners_[eventType] = this.listeners_[eventType] || []; - this.listeners_[eventType].push({ callback: callback, context: context }); - var eventData = this.getInitialEvent(eventType); - if (eventData) { - callback.apply(context, eventData); - } - }; - EventEmitter.prototype.off = function (eventType, callback, context) { - this.validateEventType_(eventType); - var listeners = this.listeners_[eventType] || []; - for (var i = 0; i < listeners.length; i++) { - if (listeners[i].callback === callback && - (!context || context === listeners[i].context)) { - listeners.splice(i, 1); - return; - } - } - }; - EventEmitter.prototype.validateEventType_ = function (eventType) { - util.assert(this.allowedEvents_.find(function (et) { - return et === eventType; - }), 'Unknown event: ' + eventType); - }; - return EventEmitter; -}()); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Monitors online state (as reported by window.online/offline events). - * - * The expectation is that this could have many false positives (thinks we are online - * when we're not), but no false negatives. So we can safely use it to determine when - * we definitely cannot reach the internet. - */ -var OnlineMonitor = /** @class */ (function (_super) { - tslib.__extends(OnlineMonitor, _super); - function OnlineMonitor() { - var _this = _super.call(this, ['online']) || this; - _this.online_ = true; - // We've had repeated complaints that Cordova apps can get stuck "offline", e.g. - // https://forum.ionicframework.com/t/firebase-connection-is-lost-and-never-come-back/43810 - // It would seem that the 'online' event does not always fire consistently. So we disable it - // for Cordova. - if (typeof window !== 'undefined' && - typeof window.addEventListener !== 'undefined' && - !util.isMobileCordova()) { - window.addEventListener('online', function () { - if (!_this.online_) { - _this.online_ = true; - _this.trigger('online', true); - } - }, false); - window.addEventListener('offline', function () { - if (_this.online_) { - _this.online_ = false; - _this.trigger('online', false); - } - }, false); - } - return _this; - } - OnlineMonitor.getInstance = function () { - return new OnlineMonitor(); - }; - OnlineMonitor.prototype.getInitialEvent = function (eventType) { - util.assert(eventType === 'online', 'Unknown event type: ' + eventType); - return [this.online_]; - }; - OnlineMonitor.prototype.currentlyOnline = function () { - return this.online_; - }; - return OnlineMonitor; -}(EventEmitter)); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** Maximum key depth. */ -var MAX_PATH_DEPTH = 32; -/** Maximum number of (UTF8) bytes in a Firebase path. */ -var MAX_PATH_LENGTH_BYTES = 768; -/** - * An immutable object representing a parsed path. It's immutable so that you - * can pass them around to other functions without worrying about them changing - * it. - */ -var Path = /** @class */ (function () { - /** - * @param pathOrString - Path string to parse, or another path, or the raw - * tokens array - */ - function Path(pathOrString, pieceNum) { - if (pieceNum === void 0) { - this.pieces_ = pathOrString.split('/'); - // Remove empty pieces. - var copyTo = 0; - for (var i = 0; i < this.pieces_.length; i++) { - if (this.pieces_[i].length > 0) { - this.pieces_[copyTo] = this.pieces_[i]; - copyTo++; - } - } - this.pieces_.length = copyTo; - this.pieceNum_ = 0; - } - else { - this.pieces_ = pathOrString; - this.pieceNum_ = pieceNum; - } - } - Path.prototype.toString = function () { - var pathString = ''; - for (var i = this.pieceNum_; i < this.pieces_.length; i++) { - if (this.pieces_[i] !== '') { - pathString += '/' + this.pieces_[i]; - } - } - return pathString || '/'; - }; - return Path; -}()); -function newEmptyPath() { - return new Path(''); -} -function pathGetFront(path) { - if (path.pieceNum_ >= path.pieces_.length) { - return null; - } - return path.pieces_[path.pieceNum_]; -} -/** - * @returns The number of segments in this path - */ -function pathGetLength(path) { - return path.pieces_.length - path.pieceNum_; -} -function pathPopFront(path) { - var pieceNum = path.pieceNum_; - if (pieceNum < path.pieces_.length) { - pieceNum++; - } - return new Path(path.pieces_, pieceNum); -} -function pathGetBack(path) { - if (path.pieceNum_ < path.pieces_.length) { - return path.pieces_[path.pieces_.length - 1]; - } - return null; -} -function pathToUrlEncodedString(path) { - var pathString = ''; - for (var i = path.pieceNum_; i < path.pieces_.length; i++) { - if (path.pieces_[i] !== '') { - pathString += '/' + encodeURIComponent(String(path.pieces_[i])); - } - } - return pathString || '/'; -} -/** - * Shallow copy of the parts of the path. - * - */ -function pathSlice(path, begin) { - if (begin === void 0) { begin = 0; } - return path.pieces_.slice(path.pieceNum_ + begin); -} -function pathParent(path) { - if (path.pieceNum_ >= path.pieces_.length) { - return null; - } - var pieces = []; - for (var i = path.pieceNum_; i < path.pieces_.length - 1; i++) { - pieces.push(path.pieces_[i]); - } - return new Path(pieces, 0); -} -function pathChild(path, childPathObj) { - var pieces = []; - for (var i = path.pieceNum_; i < path.pieces_.length; i++) { - pieces.push(path.pieces_[i]); - } - if (childPathObj instanceof Path) { - for (var i = childPathObj.pieceNum_; i < childPathObj.pieces_.length; i++) { - pieces.push(childPathObj.pieces_[i]); - } - } - else { - var childPieces = childPathObj.split('/'); - for (var i = 0; i < childPieces.length; i++) { - if (childPieces[i].length > 0) { - pieces.push(childPieces[i]); - } - } - } - return new Path(pieces, 0); -} -/** - * @returns True if there are no segments in this path - */ -function pathIsEmpty(path) { - return path.pieceNum_ >= path.pieces_.length; -} -/** - * @returns The path from outerPath to innerPath - */ -function newRelativePath(outerPath, innerPath) { - var outer = pathGetFront(outerPath), inner = pathGetFront(innerPath); - if (outer === null) { - return innerPath; - } - else if (outer === inner) { - return newRelativePath(pathPopFront(outerPath), pathPopFront(innerPath)); - } - else { - throw new Error('INTERNAL ERROR: innerPath (' + - innerPath + - ') is not within ' + - 'outerPath (' + - outerPath + - ')'); - } -} -/** - * @returns -1, 0, 1 if left is less, equal, or greater than the right. - */ -function pathCompare(left, right) { - var leftKeys = pathSlice(left, 0); - var rightKeys = pathSlice(right, 0); - for (var i = 0; i < leftKeys.length && i < rightKeys.length; i++) { - var cmp = nameCompare(leftKeys[i], rightKeys[i]); - if (cmp !== 0) { - return cmp; - } - } - if (leftKeys.length === rightKeys.length) { - return 0; - } - return leftKeys.length < rightKeys.length ? -1 : 1; -} -/** - * @returns true if paths are the same. - */ -function pathEquals(path, other) { - if (pathGetLength(path) !== pathGetLength(other)) { - return false; - } - for (var i = path.pieceNum_, j = other.pieceNum_; i <= path.pieces_.length; i++, j++) { - if (path.pieces_[i] !== other.pieces_[j]) { - return false; - } - } - return true; -} -/** - * @returns True if this path is a parent of (or the same as) other - */ -function pathContains(path, other) { - var i = path.pieceNum_; - var j = other.pieceNum_; - if (pathGetLength(path) > pathGetLength(other)) { - return false; - } - while (i < path.pieces_.length) { - if (path.pieces_[i] !== other.pieces_[j]) { - return false; - } - ++i; - ++j; - } - return true; -} -/** - * Dynamic (mutable) path used to count path lengths. - * - * This class is used to efficiently check paths for valid - * length (in UTF8 bytes) and depth (used in path validation). - * - * Throws Error exception if path is ever invalid. - * - * The definition of a path always begins with '/'. - */ -var ValidationPath = /** @class */ (function () { - /** - * @param path - Initial Path. - * @param errorPrefix_ - Prefix for any error messages. - */ - function ValidationPath(path, errorPrefix_) { - this.errorPrefix_ = errorPrefix_; - this.parts_ = pathSlice(path, 0); - /** Initialize to number of '/' chars needed in path. */ - this.byteLength_ = Math.max(1, this.parts_.length); - for (var i = 0; i < this.parts_.length; i++) { - this.byteLength_ += util.stringLength(this.parts_[i]); - } - validationPathCheckValid(this); - } - return ValidationPath; -}()); -function validationPathPush(validationPath, child) { - // Count the needed '/' - if (validationPath.parts_.length > 0) { - validationPath.byteLength_ += 1; - } - validationPath.parts_.push(child); - validationPath.byteLength_ += util.stringLength(child); - validationPathCheckValid(validationPath); -} -function validationPathPop(validationPath) { - var last = validationPath.parts_.pop(); - validationPath.byteLength_ -= util.stringLength(last); - // Un-count the previous '/' - if (validationPath.parts_.length > 0) { - validationPath.byteLength_ -= 1; - } -} -function validationPathCheckValid(validationPath) { - if (validationPath.byteLength_ > MAX_PATH_LENGTH_BYTES) { - throw new Error(validationPath.errorPrefix_ + - 'has a key path longer than ' + - MAX_PATH_LENGTH_BYTES + - ' bytes (' + - validationPath.byteLength_ + - ').'); - } - if (validationPath.parts_.length > MAX_PATH_DEPTH) { - throw new Error(validationPath.errorPrefix_ + - 'path specified exceeds the maximum depth that can be written (' + - MAX_PATH_DEPTH + - ') or object contains a cycle ' + - validationPathToErrorString(validationPath)); - } -} -/** - * String for use in error messages - uses '.' notation for path. - */ -function validationPathToErrorString(validationPath) { - if (validationPath.parts_.length === 0) { - return ''; - } - return "in property '" + validationPath.parts_.join('.') + "'"; -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var VisibilityMonitor = /** @class */ (function (_super) { - tslib.__extends(VisibilityMonitor, _super); - function VisibilityMonitor() { - var _this = _super.call(this, ['visible']) || this; - var hidden; - var visibilityChange; - if (typeof document !== 'undefined' && - typeof document.addEventListener !== 'undefined') { - if (typeof document['hidden'] !== 'undefined') { - // Opera 12.10 and Firefox 18 and later support - visibilityChange = 'visibilitychange'; - hidden = 'hidden'; - } - else if (typeof document['mozHidden'] !== 'undefined') { - visibilityChange = 'mozvisibilitychange'; - hidden = 'mozHidden'; - } - else if (typeof document['msHidden'] !== 'undefined') { - visibilityChange = 'msvisibilitychange'; - hidden = 'msHidden'; - } - else if (typeof document['webkitHidden'] !== 'undefined') { - visibilityChange = 'webkitvisibilitychange'; - hidden = 'webkitHidden'; - } - } - // Initially, we always assume we are visible. This ensures that in browsers - // without page visibility support or in cases where we are never visible - // (e.g. chrome extension), we act as if we are visible, i.e. don't delay - // reconnects - _this.visible_ = true; - if (visibilityChange) { - document.addEventListener(visibilityChange, function () { - var visible = !document[hidden]; - if (visible !== _this.visible_) { - _this.visible_ = visible; - _this.trigger('visible', visible); - } - }, false); - } - return _this; - } - VisibilityMonitor.getInstance = function () { - return new VisibilityMonitor(); - }; - VisibilityMonitor.prototype.getInitialEvent = function (eventType) { - util.assert(eventType === 'visible', 'Unknown event type: ' + eventType); - return [this.visible_]; - }; - return VisibilityMonitor; -}(EventEmitter)); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var RECONNECT_MIN_DELAY = 1000; -var RECONNECT_MAX_DELAY_DEFAULT = 60 * 5 * 1000; // 5 minutes in milliseconds (Case: 1858) -var RECONNECT_MAX_DELAY_FOR_ADMINS = 30 * 1000; // 30 seconds for admin clients (likely to be a backend server) -var RECONNECT_DELAY_MULTIPLIER = 1.3; -var RECONNECT_DELAY_RESET_TIMEOUT = 30000; // Reset delay back to MIN_DELAY after being connected for 30sec. -var SERVER_KILL_INTERRUPT_REASON = 'server_kill'; -// If auth fails repeatedly, we'll assume something is wrong and log a warning / back off. -var INVALID_TOKEN_THRESHOLD = 3; -/** - * Firebase connection. Abstracts wire protocol and handles reconnecting. - * - * NOTE: All JSON objects sent to the realtime connection must have property names enclosed - * in quotes to make sure the closure compiler does not minify them. - */ -var PersistentConnection = /** @class */ (function (_super) { - tslib.__extends(PersistentConnection, _super); - /** - * @param repoInfo_ - Data about the namespace we are connecting to - * @param applicationId_ - The Firebase App ID for this project - * @param onDataUpdate_ - A callback for new data from the server - */ - function PersistentConnection(repoInfo_, applicationId_, onDataUpdate_, onConnectStatus_, onServerInfoUpdate_, authTokenProvider_, appCheckTokenProvider_, authOverride_) { - var _this = _super.call(this) || this; - _this.repoInfo_ = repoInfo_; - _this.applicationId_ = applicationId_; - _this.onDataUpdate_ = onDataUpdate_; - _this.onConnectStatus_ = onConnectStatus_; - _this.onServerInfoUpdate_ = onServerInfoUpdate_; - _this.authTokenProvider_ = authTokenProvider_; - _this.appCheckTokenProvider_ = appCheckTokenProvider_; - _this.authOverride_ = authOverride_; - // Used for diagnostic logging. - _this.id = PersistentConnection.nextPersistentConnectionId_++; - _this.log_ = logWrapper('p:' + _this.id + ':'); - _this.interruptReasons_ = {}; - _this.listens = new Map(); - _this.outstandingPuts_ = []; - _this.outstandingGets_ = []; - _this.outstandingPutCount_ = 0; - _this.outstandingGetCount_ = 0; - _this.onDisconnectRequestQueue_ = []; - _this.connected_ = false; - _this.reconnectDelay_ = RECONNECT_MIN_DELAY; - _this.maxReconnectDelay_ = RECONNECT_MAX_DELAY_DEFAULT; - _this.securityDebugCallback_ = null; - _this.lastSessionId = null; - _this.establishConnectionTimer_ = null; - _this.visible_ = false; - // Before we get connected, we keep a queue of pending messages to send. - _this.requestCBHash_ = {}; - _this.requestNumber_ = 0; - _this.realtime_ = null; - _this.authToken_ = null; - _this.appCheckToken_ = null; - _this.forceTokenRefresh_ = false; - _this.invalidAuthTokenCount_ = 0; - _this.invalidAppCheckTokenCount_ = 0; - _this.firstConnection_ = true; - _this.lastConnectionAttemptTime_ = null; - _this.lastConnectionEstablishedTime_ = null; - if (authOverride_ && !util.isNodeSdk()) { - throw new Error('Auth override specified in options, but not supported on non Node.js platforms'); - } - VisibilityMonitor.getInstance().on('visible', _this.onVisible_, _this); - if (repoInfo_.host.indexOf('fblocal') === -1) { - OnlineMonitor.getInstance().on('online', _this.onOnline_, _this); - } - return _this; - } - PersistentConnection.prototype.sendRequest = function (action, body, onResponse) { - var curReqNum = ++this.requestNumber_; - var msg = { r: curReqNum, a: action, b: body }; - this.log_(util.stringify(msg)); - util.assert(this.connected_, "sendRequest call when we're not connected not allowed."); - this.realtime_.sendRequest(msg); - if (onResponse) { - this.requestCBHash_[curReqNum] = onResponse; - } - }; - PersistentConnection.prototype.get = function (query) { - this.initConnection_(); - var deferred = new util.Deferred(); - var request = { - p: query._path.toString(), - q: query._queryObject - }; - var outstandingGet = { - action: 'g', - request: request, - onComplete: function (message) { - var payload = message['d']; - if (message['s'] === 'ok') { - deferred.resolve(payload); - } - else { - deferred.reject(payload); - } - } - }; - this.outstandingGets_.push(outstandingGet); - this.outstandingGetCount_++; - var index = this.outstandingGets_.length - 1; - if (this.connected_) { - this.sendGet_(index); - } - return deferred.promise; - }; - PersistentConnection.prototype.listen = function (query, currentHashFn, tag, onComplete) { - this.initConnection_(); - var queryId = query._queryIdentifier; - var pathString = query._path.toString(); - this.log_('Listen called for ' + pathString + ' ' + queryId); - if (!this.listens.has(pathString)) { - this.listens.set(pathString, new Map()); - } - util.assert(query._queryParams.isDefault() || !query._queryParams.loadsAllData(), 'listen() called for non-default but complete query'); - util.assert(!this.listens.get(pathString).has(queryId), "listen() called twice for same path/queryId."); - var listenSpec = { - onComplete: onComplete, - hashFn: currentHashFn, - query: query, - tag: tag - }; - this.listens.get(pathString).set(queryId, listenSpec); - if (this.connected_) { - this.sendListen_(listenSpec); - } - }; - PersistentConnection.prototype.sendGet_ = function (index) { - var _this = this; - var get = this.outstandingGets_[index]; - this.sendRequest('g', get.request, function (message) { - delete _this.outstandingGets_[index]; - _this.outstandingGetCount_--; - if (_this.outstandingGetCount_ === 0) { - _this.outstandingGets_ = []; - } - if (get.onComplete) { - get.onComplete(message); - } - }); - }; - PersistentConnection.prototype.sendListen_ = function (listenSpec) { - var _this = this; - var query = listenSpec.query; - var pathString = query._path.toString(); - var queryId = query._queryIdentifier; - this.log_('Listen on ' + pathString + ' for ' + queryId); - var req = { /*path*/ p: pathString }; - var action = 'q'; - // Only bother to send query if it's non-default. - if (listenSpec.tag) { - req['q'] = query._queryObject; - req['t'] = listenSpec.tag; - } - req[ /*hash*/'h'] = listenSpec.hashFn(); - this.sendRequest(action, req, function (message) { - var payload = message[ /*data*/'d']; - var status = message[ /*status*/'s']; - // print warnings in any case... - PersistentConnection.warnOnListenWarnings_(payload, query); - var currentListenSpec = _this.listens.get(pathString) && - _this.listens.get(pathString).get(queryId); - // only trigger actions if the listen hasn't been removed and readded - if (currentListenSpec === listenSpec) { - _this.log_('listen response', message); - if (status !== 'ok') { - _this.removeListen_(pathString, queryId); - } - if (listenSpec.onComplete) { - listenSpec.onComplete(status, payload); - } - } - }); - }; - PersistentConnection.warnOnListenWarnings_ = function (payload, query) { - if (payload && typeof payload === 'object' && util.contains(payload, 'w')) { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - var warnings = util.safeGet(payload, 'w'); - if (Array.isArray(warnings) && ~warnings.indexOf('no_index')) { - var indexSpec = '".indexOn": "' + query._queryParams.getIndex().toString() + '"'; - var indexPath = query._path.toString(); - warn("Using an unspecified index. Your data will be downloaded and " + - ("filtered on the client. Consider adding " + indexSpec + " at ") + - (indexPath + " to your security rules for better performance.")); - } - } - }; - PersistentConnection.prototype.refreshAuthToken = function (token) { - this.authToken_ = token; - this.log_('Auth token refreshed'); - if (this.authToken_) { - this.tryAuth(); - } - else { - //If we're connected we want to let the server know to unauthenticate us. If we're not connected, simply delete - //the credential so we dont become authenticated next time we connect. - if (this.connected_) { - this.sendRequest('unauth', {}, function () { }); - } - } - this.reduceReconnectDelayIfAdminCredential_(token); - }; - PersistentConnection.prototype.reduceReconnectDelayIfAdminCredential_ = function (credential) { - // NOTE: This isn't intended to be bulletproof (a malicious developer can always just modify the client). - // Additionally, we don't bother resetting the max delay back to the default if auth fails / expires. - var isFirebaseSecret = credential && credential.length === 40; - if (isFirebaseSecret || util.isAdmin(credential)) { - this.log_('Admin auth credential detected. Reducing max reconnect time.'); - this.maxReconnectDelay_ = RECONNECT_MAX_DELAY_FOR_ADMINS; - } - }; - PersistentConnection.prototype.refreshAppCheckToken = function (token) { - this.appCheckToken_ = token; - this.log_('App check token refreshed'); - if (this.appCheckToken_) { - this.tryAppCheck(); - } - else { - //If we're connected we want to let the server know to unauthenticate us. - //If we're not connected, simply delete the credential so we dont become - // authenticated next time we connect. - if (this.connected_) { - this.sendRequest('unappeck', {}, function () { }); - } - } - }; - /** - * Attempts to authenticate with the given credentials. If the authentication attempt fails, it's triggered like - * a auth revoked (the connection is closed). - */ - PersistentConnection.prototype.tryAuth = function () { - var _this = this; - if (this.connected_ && this.authToken_) { - var token_1 = this.authToken_; - var authMethod = util.isValidFormat(token_1) ? 'auth' : 'gauth'; - var requestData = { cred: token_1 }; - if (this.authOverride_ === null) { - requestData['noauth'] = true; - } - else if (typeof this.authOverride_ === 'object') { - requestData['authvar'] = this.authOverride_; - } - this.sendRequest(authMethod, requestData, function (res) { - var status = res[ /*status*/'s']; - var data = res[ /*data*/'d'] || 'error'; - if (_this.authToken_ === token_1) { - if (status === 'ok') { - _this.invalidAuthTokenCount_ = 0; - } - else { - // Triggers reconnect and force refresh for auth token - _this.onAuthRevoked_(status, data); - } - } - }); - } - }; - /** - * Attempts to authenticate with the given token. If the authentication - * attempt fails, it's triggered like the token was revoked (the connection is - * closed). - */ - PersistentConnection.prototype.tryAppCheck = function () { - var _this = this; - if (this.connected_ && this.appCheckToken_) { - this.sendRequest('appcheck', { 'token': this.appCheckToken_ }, function (res) { - var status = res[ /*status*/'s']; - var data = res[ /*data*/'d'] || 'error'; - if (status === 'ok') { - _this.invalidAppCheckTokenCount_ = 0; - } - else { - _this.onAppCheckRevoked_(status, data); - } - }); - } - }; - /** - * @inheritDoc - */ - PersistentConnection.prototype.unlisten = function (query, tag) { - var pathString = query._path.toString(); - var queryId = query._queryIdentifier; - this.log_('Unlisten called for ' + pathString + ' ' + queryId); - util.assert(query._queryParams.isDefault() || !query._queryParams.loadsAllData(), 'unlisten() called for non-default but complete query'); - var listen = this.removeListen_(pathString, queryId); - if (listen && this.connected_) { - this.sendUnlisten_(pathString, queryId, query._queryObject, tag); - } - }; - PersistentConnection.prototype.sendUnlisten_ = function (pathString, queryId, queryObj, tag) { - this.log_('Unlisten on ' + pathString + ' for ' + queryId); - var req = { /*path*/ p: pathString }; - var action = 'n'; - // Only bother sending queryId if it's non-default. - if (tag) { - req['q'] = queryObj; - req['t'] = tag; - } - this.sendRequest(action, req); - }; - PersistentConnection.prototype.onDisconnectPut = function (pathString, data, onComplete) { - this.initConnection_(); - if (this.connected_) { - this.sendOnDisconnect_('o', pathString, data, onComplete); - } - else { - this.onDisconnectRequestQueue_.push({ - pathString: pathString, - action: 'o', - data: data, - onComplete: onComplete - }); - } - }; - PersistentConnection.prototype.onDisconnectMerge = function (pathString, data, onComplete) { - this.initConnection_(); - if (this.connected_) { - this.sendOnDisconnect_('om', pathString, data, onComplete); - } - else { - this.onDisconnectRequestQueue_.push({ - pathString: pathString, - action: 'om', - data: data, - onComplete: onComplete - }); - } - }; - PersistentConnection.prototype.onDisconnectCancel = function (pathString, onComplete) { - this.initConnection_(); - if (this.connected_) { - this.sendOnDisconnect_('oc', pathString, null, onComplete); - } - else { - this.onDisconnectRequestQueue_.push({ - pathString: pathString, - action: 'oc', - data: null, - onComplete: onComplete - }); - } - }; - PersistentConnection.prototype.sendOnDisconnect_ = function (action, pathString, data, onComplete) { - var request = { /*path*/ p: pathString, /*data*/ d: data }; - this.log_('onDisconnect ' + action, request); - this.sendRequest(action, request, function (response) { - if (onComplete) { - setTimeout(function () { - onComplete(response[ /*status*/'s'], response[ /* data */'d']); - }, Math.floor(0)); - } - }); - }; - PersistentConnection.prototype.put = function (pathString, data, onComplete, hash) { - this.putInternal('p', pathString, data, onComplete, hash); - }; - PersistentConnection.prototype.merge = function (pathString, data, onComplete, hash) { - this.putInternal('m', pathString, data, onComplete, hash); - }; - PersistentConnection.prototype.putInternal = function (action, pathString, data, onComplete, hash) { - this.initConnection_(); - var request = { - /*path*/ p: pathString, - /*data*/ d: data - }; - if (hash !== undefined) { - request[ /*hash*/'h'] = hash; - } - // TODO: Only keep track of the most recent put for a given path? - this.outstandingPuts_.push({ - action: action, - request: request, - onComplete: onComplete - }); - this.outstandingPutCount_++; - var index = this.outstandingPuts_.length - 1; - if (this.connected_) { - this.sendPut_(index); - } - else { - this.log_('Buffering put: ' + pathString); - } - }; - PersistentConnection.prototype.sendPut_ = function (index) { - var _this = this; - var action = this.outstandingPuts_[index].action; - var request = this.outstandingPuts_[index].request; - var onComplete = this.outstandingPuts_[index].onComplete; - this.outstandingPuts_[index].queued = this.connected_; - this.sendRequest(action, request, function (message) { - _this.log_(action + ' response', message); - delete _this.outstandingPuts_[index]; - _this.outstandingPutCount_--; - // Clean up array occasionally. - if (_this.outstandingPutCount_ === 0) { - _this.outstandingPuts_ = []; - } - if (onComplete) { - onComplete(message[ /*status*/'s'], message[ /* data */'d']); - } - }); - }; - PersistentConnection.prototype.reportStats = function (stats) { - var _this = this; - // If we're not connected, we just drop the stats. - if (this.connected_) { - var request = { /*counters*/ c: stats }; - this.log_('reportStats', request); - this.sendRequest(/*stats*/ 's', request, function (result) { - var status = result[ /*status*/'s']; - if (status !== 'ok') { - var errorReason = result[ /* data */'d']; - _this.log_('reportStats', 'Error sending stats: ' + errorReason); - } - }); - } - }; - PersistentConnection.prototype.onDataMessage_ = function (message) { - if ('r' in message) { - // this is a response - this.log_('from server: ' + util.stringify(message)); - var reqNum = message['r']; - var onResponse = this.requestCBHash_[reqNum]; - if (onResponse) { - delete this.requestCBHash_[reqNum]; - onResponse(message[ /*body*/'b']); - } - } - else if ('error' in message) { - throw 'A server-side error has occurred: ' + message['error']; - } - else if ('a' in message) { - // a and b are action and body, respectively - this.onDataPush_(message['a'], message['b']); - } - }; - PersistentConnection.prototype.onDataPush_ = function (action, body) { - this.log_('handleServerMessage', action, body); - if (action === 'd') { - this.onDataUpdate_(body[ /*path*/'p'], body[ /*data*/'d'], - /*isMerge*/ false, body['t']); - } - else if (action === 'm') { - this.onDataUpdate_(body[ /*path*/'p'], body[ /*data*/'d'], - /*isMerge=*/ true, body['t']); - } - else if (action === 'c') { - this.onListenRevoked_(body[ /*path*/'p'], body[ /*query*/'q']); - } - else if (action === 'ac') { - this.onAuthRevoked_(body[ /*status code*/'s'], body[ /* explanation */'d']); - } - else if (action === 'apc') { - this.onAppCheckRevoked_(body[ /*status code*/'s'], body[ /* explanation */'d']); - } - else if (action === 'sd') { - this.onSecurityDebugPacket_(body); - } - else { - error('Unrecognized action received from server: ' + - util.stringify(action) + - '\nAre you using the latest client?'); - } - }; - PersistentConnection.prototype.onReady_ = function (timestamp, sessionId) { - this.log_('connection ready'); - this.connected_ = true; - this.lastConnectionEstablishedTime_ = new Date().getTime(); - this.handleTimestamp_(timestamp); - this.lastSessionId = sessionId; - if (this.firstConnection_) { - this.sendConnectStats_(); - } - this.restoreState_(); - this.firstConnection_ = false; - this.onConnectStatus_(true); - }; - PersistentConnection.prototype.scheduleConnect_ = function (timeout) { - var _this = this; - util.assert(!this.realtime_, "Scheduling a connect when we're already connected/ing?"); - if (this.establishConnectionTimer_) { - clearTimeout(this.establishConnectionTimer_); - } - // NOTE: Even when timeout is 0, it's important to do a setTimeout to work around an infuriating "Security Error" in - // Firefox when trying to write to our long-polling iframe in some scenarios (e.g. Forge or our unit tests). - this.establishConnectionTimer_ = setTimeout(function () { - _this.establishConnectionTimer_ = null; - _this.establishConnection_(); - // eslint-disable-next-line @typescript-eslint/no-explicit-any - }, Math.floor(timeout)); - }; - PersistentConnection.prototype.initConnection_ = function () { - if (!this.realtime_ && this.firstConnection_) { - this.scheduleConnect_(0); - } - }; - PersistentConnection.prototype.onVisible_ = function (visible) { - // NOTE: Tabbing away and back to a window will defeat our reconnect backoff, but I think that's fine. - if (visible && - !this.visible_ && - this.reconnectDelay_ === this.maxReconnectDelay_) { - this.log_('Window became visible. Reducing delay.'); - this.reconnectDelay_ = RECONNECT_MIN_DELAY; - if (!this.realtime_) { - this.scheduleConnect_(0); - } - } - this.visible_ = visible; - }; - PersistentConnection.prototype.onOnline_ = function (online) { - if (online) { - this.log_('Browser went online.'); - this.reconnectDelay_ = RECONNECT_MIN_DELAY; - if (!this.realtime_) { - this.scheduleConnect_(0); - } - } - else { - this.log_('Browser went offline. Killing connection.'); - if (this.realtime_) { - this.realtime_.close(); - } - } - }; - PersistentConnection.prototype.onRealtimeDisconnect_ = function () { - this.log_('data client disconnected'); - this.connected_ = false; - this.realtime_ = null; - // Since we don't know if our sent transactions succeeded or not, we need to cancel them. - this.cancelSentTransactions_(); - // Clear out the pending requests. - this.requestCBHash_ = {}; - if (this.shouldReconnect_()) { - if (!this.visible_) { - this.log_("Window isn't visible. Delaying reconnect."); - this.reconnectDelay_ = this.maxReconnectDelay_; - this.lastConnectionAttemptTime_ = new Date().getTime(); - } - else if (this.lastConnectionEstablishedTime_) { - // If we've been connected long enough, reset reconnect delay to minimum. - var timeSinceLastConnectSucceeded = new Date().getTime() - this.lastConnectionEstablishedTime_; - if (timeSinceLastConnectSucceeded > RECONNECT_DELAY_RESET_TIMEOUT) { - this.reconnectDelay_ = RECONNECT_MIN_DELAY; - } - this.lastConnectionEstablishedTime_ = null; - } - var timeSinceLastConnectAttempt = new Date().getTime() - this.lastConnectionAttemptTime_; - var reconnectDelay = Math.max(0, this.reconnectDelay_ - timeSinceLastConnectAttempt); - reconnectDelay = Math.random() * reconnectDelay; - this.log_('Trying to reconnect in ' + reconnectDelay + 'ms'); - this.scheduleConnect_(reconnectDelay); - // Adjust reconnect delay for next time. - this.reconnectDelay_ = Math.min(this.maxReconnectDelay_, this.reconnectDelay_ * RECONNECT_DELAY_MULTIPLIER); - } - this.onConnectStatus_(false); - }; - PersistentConnection.prototype.establishConnection_ = function () { - return tslib.__awaiter(this, void 0, void 0, function () { - var onDataMessage, onReady, onDisconnect_1, connId, lastSessionId, canceled_1, connection_1, closeFn, sendRequestFn, forceRefresh, _a, authToken, appCheckToken, error_1; - var _this = this; - return tslib.__generator(this, function (_b) { - switch (_b.label) { - case 0: - if (!this.shouldReconnect_()) return [3 /*break*/, 4]; - this.log_('Making a connection attempt'); - this.lastConnectionAttemptTime_ = new Date().getTime(); - this.lastConnectionEstablishedTime_ = null; - onDataMessage = this.onDataMessage_.bind(this); - onReady = this.onReady_.bind(this); - onDisconnect_1 = this.onRealtimeDisconnect_.bind(this); - connId = this.id + ':' + PersistentConnection.nextConnectionId_++; - lastSessionId = this.lastSessionId; - canceled_1 = false; - connection_1 = null; - closeFn = function () { - if (connection_1) { - connection_1.close(); - } - else { - canceled_1 = true; - onDisconnect_1(); - } - }; - sendRequestFn = function (msg) { - util.assert(connection_1, "sendRequest call when we're not connected not allowed."); - connection_1.sendRequest(msg); - }; - this.realtime_ = { - close: closeFn, - sendRequest: sendRequestFn - }; - forceRefresh = this.forceTokenRefresh_; - this.forceTokenRefresh_ = false; - _b.label = 1; - case 1: - _b.trys.push([1, 3, , 4]); - return [4 /*yield*/, Promise.all([ - this.authTokenProvider_.getToken(forceRefresh), - this.appCheckTokenProvider_.getToken(forceRefresh) - ])]; - case 2: - _a = tslib.__read.apply(void 0, [_b.sent(), 2]), authToken = _a[0], appCheckToken = _a[1]; - if (!canceled_1) { - log('getToken() completed. Creating connection.'); - this.authToken_ = authToken && authToken.accessToken; - this.appCheckToken_ = appCheckToken && appCheckToken.token; - connection_1 = new Connection(connId, this.repoInfo_, this.applicationId_, this.appCheckToken_, this.authToken_, onDataMessage, onReady, onDisconnect_1, - /* onKill= */ function (reason) { - warn(reason + ' (' + _this.repoInfo_.toString() + ')'); - _this.interrupt(SERVER_KILL_INTERRUPT_REASON); - }, lastSessionId); - } - else { - log('getToken() completed but was canceled'); - } - return [3 /*break*/, 4]; - case 3: - error_1 = _b.sent(); - this.log_('Failed to get token: ' + error_1); - if (!canceled_1) { - if (this.repoInfo_.nodeAdmin) { - // This may be a critical error for the Admin Node.js SDK, so log a warning. - // But getToken() may also just have temporarily failed, so we still want to - // continue retrying. - warn(error_1); - } - closeFn(); - } - return [3 /*break*/, 4]; - case 4: return [2 /*return*/]; - } - }); - }); - }; - PersistentConnection.prototype.interrupt = function (reason) { - log('Interrupting connection for reason: ' + reason); - this.interruptReasons_[reason] = true; - if (this.realtime_) { - this.realtime_.close(); - } - else { - if (this.establishConnectionTimer_) { - clearTimeout(this.establishConnectionTimer_); - this.establishConnectionTimer_ = null; - } - if (this.connected_) { - this.onRealtimeDisconnect_(); - } - } - }; - PersistentConnection.prototype.resume = function (reason) { - log('Resuming connection for reason: ' + reason); - delete this.interruptReasons_[reason]; - if (util.isEmpty(this.interruptReasons_)) { - this.reconnectDelay_ = RECONNECT_MIN_DELAY; - if (!this.realtime_) { - this.scheduleConnect_(0); - } - } - }; - PersistentConnection.prototype.handleTimestamp_ = function (timestamp) { - var delta = timestamp - new Date().getTime(); - this.onServerInfoUpdate_({ serverTimeOffset: delta }); - }; - PersistentConnection.prototype.cancelSentTransactions_ = function () { - for (var i = 0; i < this.outstandingPuts_.length; i++) { - var put = this.outstandingPuts_[i]; - if (put && /*hash*/ 'h' in put.request && put.queued) { - if (put.onComplete) { - put.onComplete('disconnect'); - } - delete this.outstandingPuts_[i]; - this.outstandingPutCount_--; - } - } - // Clean up array occasionally. - if (this.outstandingPutCount_ === 0) { - this.outstandingPuts_ = []; - } - }; - PersistentConnection.prototype.onListenRevoked_ = function (pathString, query) { - // Remove the listen and manufacture a "permission_denied" error for the failed listen. - var queryId; - if (!query) { - queryId = 'default'; - } - else { - queryId = query.map(function (q) { return ObjectToUniqueKey(q); }).join('$'); - } - var listen = this.removeListen_(pathString, queryId); - if (listen && listen.onComplete) { - listen.onComplete('permission_denied'); - } - }; - PersistentConnection.prototype.removeListen_ = function (pathString, queryId) { - var normalizedPathString = new Path(pathString).toString(); // normalize path. - var listen; - if (this.listens.has(normalizedPathString)) { - var map = this.listens.get(normalizedPathString); - listen = map.get(queryId); - map.delete(queryId); - if (map.size === 0) { - this.listens.delete(normalizedPathString); - } - } - else { - // all listens for this path has already been removed - listen = undefined; - } - return listen; - }; - PersistentConnection.prototype.onAuthRevoked_ = function (statusCode, explanation) { - log('Auth token revoked: ' + statusCode + '/' + explanation); - this.authToken_ = null; - this.forceTokenRefresh_ = true; - this.realtime_.close(); - if (statusCode === 'invalid_token' || statusCode === 'permission_denied') { - // We'll wait a couple times before logging the warning / increasing the - // retry period since oauth tokens will report as "invalid" if they're - // just expired. Plus there may be transient issues that resolve themselves. - this.invalidAuthTokenCount_++; - if (this.invalidAuthTokenCount_ >= INVALID_TOKEN_THRESHOLD) { - // Set a long reconnect delay because recovery is unlikely - this.reconnectDelay_ = RECONNECT_MAX_DELAY_FOR_ADMINS; - // Notify the auth token provider that the token is invalid, which will log - // a warning - this.authTokenProvider_.notifyForInvalidToken(); - } - } - }; - PersistentConnection.prototype.onAppCheckRevoked_ = function (statusCode, explanation) { - log('App check token revoked: ' + statusCode + '/' + explanation); - this.appCheckToken_ = null; - this.forceTokenRefresh_ = true; - // Note: We don't close the connection as the developer may not have - // enforcement enabled. The backend closes connections with enforcements. - if (statusCode === 'invalid_token' || statusCode === 'permission_denied') { - // We'll wait a couple times before logging the warning / increasing the - // retry period since oauth tokens will report as "invalid" if they're - // just expired. Plus there may be transient issues that resolve themselves. - this.invalidAppCheckTokenCount_++; - if (this.invalidAppCheckTokenCount_ >= INVALID_TOKEN_THRESHOLD) { - this.appCheckTokenProvider_.notifyForInvalidToken(); - } - } - }; - PersistentConnection.prototype.onSecurityDebugPacket_ = function (body) { - if (this.securityDebugCallback_) { - this.securityDebugCallback_(body); - } - else { - if ('msg' in body) { - console.log('FIREBASE: ' + body['msg'].replace('\n', '\nFIREBASE: ')); - } - } - }; - PersistentConnection.prototype.restoreState_ = function () { - var e_1, _a, e_2, _b; - //Re-authenticate ourselves if we have a credential stored. - this.tryAuth(); - this.tryAppCheck(); - try { - // Puts depend on having received the corresponding data update from the server before they complete, so we must - // make sure to send listens before puts. - for (var _c = tslib.__values(this.listens.values()), _d = _c.next(); !_d.done; _d = _c.next()) { - var queries = _d.value; - try { - for (var _e = (e_2 = void 0, tslib.__values(queries.values())), _f = _e.next(); !_f.done; _f = _e.next()) { - var listenSpec = _f.value; - this.sendListen_(listenSpec); - } - } - catch (e_2_1) { e_2 = { error: e_2_1 }; } - finally { - try { - if (_f && !_f.done && (_b = _e.return)) _b.call(_e); - } - finally { if (e_2) throw e_2.error; } - } - } - } - catch (e_1_1) { e_1 = { error: e_1_1 }; } - finally { - try { - if (_d && !_d.done && (_a = _c.return)) _a.call(_c); - } - finally { if (e_1) throw e_1.error; } - } - for (var i = 0; i < this.outstandingPuts_.length; i++) { - if (this.outstandingPuts_[i]) { - this.sendPut_(i); - } - } - while (this.onDisconnectRequestQueue_.length) { - var request = this.onDisconnectRequestQueue_.shift(); - this.sendOnDisconnect_(request.action, request.pathString, request.data, request.onComplete); - } - for (var i = 0; i < this.outstandingGets_.length; i++) { - if (this.outstandingGets_[i]) { - this.sendGet_(i); - } - } - }; - /** - * Sends client stats for first connection - */ - PersistentConnection.prototype.sendConnectStats_ = function () { - var stats = {}; - var clientName = 'js'; - if (util.isNodeSdk()) { - if (this.repoInfo_.nodeAdmin) { - clientName = 'admin_node'; - } - else { - clientName = 'node'; - } - } - stats['sdk.' + clientName + '.' + SDK_VERSION.replace(/\./g, '-')] = 1; - if (util.isMobileCordova()) { - stats['framework.cordova'] = 1; - } - else if (util.isReactNative()) { - stats['framework.reactnative'] = 1; - } - this.reportStats(stats); - }; - PersistentConnection.prototype.shouldReconnect_ = function () { - var online = OnlineMonitor.getInstance().currentlyOnline(); - return util.isEmpty(this.interruptReasons_) && online; - }; - PersistentConnection.nextPersistentConnectionId_ = 0; - /** - * Counter for number of connections created. Mainly used for tagging in the logs - */ - PersistentConnection.nextConnectionId_ = 0; - return PersistentConnection; -}(ServerActions)); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var NamedNode = /** @class */ (function () { - function NamedNode(name, node) { - this.name = name; - this.node = node; - } - NamedNode.Wrap = function (name, node) { - return new NamedNode(name, node); - }; - return NamedNode; -}()); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var Index = /** @class */ (function () { - function Index() { - } - /** - * @returns A standalone comparison function for - * this index - */ - Index.prototype.getCompare = function () { - return this.compare.bind(this); - }; - /** - * Given a before and after value for a node, determine if the indexed value has changed. Even if they are different, - * it's possible that the changes are isolated to parts of the snapshot that are not indexed. - * - * - * @returns True if the portion of the snapshot being indexed changed between oldNode and newNode - */ - Index.prototype.indexedValueChanged = function (oldNode, newNode) { - var oldWrapped = new NamedNode(MIN_NAME, oldNode); - var newWrapped = new NamedNode(MIN_NAME, newNode); - return this.compare(oldWrapped, newWrapped) !== 0; - }; - /** - * @returns a node wrapper that will sort equal to or less than - * any other node wrapper, using this index - */ - Index.prototype.minPost = function () { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - return NamedNode.MIN; - }; - return Index; -}()); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var __EMPTY_NODE; -var KeyIndex = /** @class */ (function (_super) { - tslib.__extends(KeyIndex, _super); - function KeyIndex() { - return _super !== null && _super.apply(this, arguments) || this; - } - Object.defineProperty(KeyIndex, "__EMPTY_NODE", { - get: function () { - return __EMPTY_NODE; - }, - set: function (val) { - __EMPTY_NODE = val; - }, - enumerable: false, - configurable: true - }); - KeyIndex.prototype.compare = function (a, b) { - return nameCompare(a.name, b.name); - }; - KeyIndex.prototype.isDefinedOn = function (node) { - // We could probably return true here (since every node has a key), but it's never called - // so just leaving unimplemented for now. - throw util.assertionError('KeyIndex.isDefinedOn not expected to be called.'); - }; - KeyIndex.prototype.indexedValueChanged = function (oldNode, newNode) { - return false; // The key for a node never changes. - }; - KeyIndex.prototype.minPost = function () { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - return NamedNode.MIN; - }; - KeyIndex.prototype.maxPost = function () { - // TODO: This should really be created once and cached in a static property, but - // NamedNode isn't defined yet, so I can't use it in a static. Bleh. - return new NamedNode(MAX_NAME, __EMPTY_NODE); - }; - KeyIndex.prototype.makePost = function (indexValue, name) { - util.assert(typeof indexValue === 'string', 'KeyIndex indexValue must always be a string.'); - // We just use empty node, but it'll never be compared, since our comparator only looks at name. - return new NamedNode(indexValue, __EMPTY_NODE); - }; - /** - * @returns String representation for inclusion in a query spec - */ - KeyIndex.prototype.toString = function () { - return '.key'; - }; - return KeyIndex; -}(Index)); -var KEY_INDEX = new KeyIndex(); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * An iterator over an LLRBNode. - */ -var SortedMapIterator = /** @class */ (function () { - /** - * @param node - Node to iterate. - * @param isReverse_ - Whether or not to iterate in reverse - */ - function SortedMapIterator(node, startKey, comparator, isReverse_, resultGenerator_) { - if (resultGenerator_ === void 0) { resultGenerator_ = null; } - this.isReverse_ = isReverse_; - this.resultGenerator_ = resultGenerator_; - this.nodeStack_ = []; - var cmp = 1; - while (!node.isEmpty()) { - node = node; - cmp = startKey ? comparator(node.key, startKey) : 1; - // flip the comparison if we're going in reverse - if (isReverse_) { - cmp *= -1; - } - if (cmp < 0) { - // This node is less than our start key. ignore it - if (this.isReverse_) { - node = node.left; - } - else { - node = node.right; - } - } - else if (cmp === 0) { - // This node is exactly equal to our start key. Push it on the stack, but stop iterating; - this.nodeStack_.push(node); - break; - } - else { - // This node is greater than our start key, add it to the stack and move to the next one - this.nodeStack_.push(node); - if (this.isReverse_) { - node = node.right; - } - else { - node = node.left; - } - } - } - } - SortedMapIterator.prototype.getNext = function () { - if (this.nodeStack_.length === 0) { - return null; - } - var node = this.nodeStack_.pop(); - var result; - if (this.resultGenerator_) { - result = this.resultGenerator_(node.key, node.value); - } - else { - result = { key: node.key, value: node.value }; - } - if (this.isReverse_) { - node = node.left; - while (!node.isEmpty()) { - this.nodeStack_.push(node); - node = node.right; - } - } - else { - node = node.right; - while (!node.isEmpty()) { - this.nodeStack_.push(node); - node = node.left; - } - } - return result; - }; - SortedMapIterator.prototype.hasNext = function () { - return this.nodeStack_.length > 0; - }; - SortedMapIterator.prototype.peek = function () { - if (this.nodeStack_.length === 0) { - return null; - } - var node = this.nodeStack_[this.nodeStack_.length - 1]; - if (this.resultGenerator_) { - return this.resultGenerator_(node.key, node.value); - } - else { - return { key: node.key, value: node.value }; - } - }; - return SortedMapIterator; -}()); -/** - * Represents a node in a Left-leaning Red-Black tree. - */ -var LLRBNode = /** @class */ (function () { - /** - * @param key - Key associated with this node. - * @param value - Value associated with this node. - * @param color - Whether this node is red. - * @param left - Left child. - * @param right - Right child. - */ - function LLRBNode(key, value, color, left, right) { - this.key = key; - this.value = value; - this.color = color != null ? color : LLRBNode.RED; - this.left = - left != null ? left : SortedMap.EMPTY_NODE; - this.right = - right != null ? right : SortedMap.EMPTY_NODE; - } - /** - * Returns a copy of the current node, optionally replacing pieces of it. - * - * @param key - New key for the node, or null. - * @param value - New value for the node, or null. - * @param color - New color for the node, or null. - * @param left - New left child for the node, or null. - * @param right - New right child for the node, or null. - * @returns The node copy. - */ - LLRBNode.prototype.copy = function (key, value, color, left, right) { - return new LLRBNode(key != null ? key : this.key, value != null ? value : this.value, color != null ? color : this.color, left != null ? left : this.left, right != null ? right : this.right); - }; - /** - * @returns The total number of nodes in the tree. - */ - LLRBNode.prototype.count = function () { - return this.left.count() + 1 + this.right.count(); - }; - /** - * @returns True if the tree is empty. - */ - LLRBNode.prototype.isEmpty = function () { - return false; - }; - /** - * Traverses the tree in key order and calls the specified action function - * for each node. - * - * @param action - Callback function to be called for each - * node. If it returns true, traversal is aborted. - * @returns The first truthy value returned by action, or the last falsey - * value returned by action - */ - LLRBNode.prototype.inorderTraversal = function (action) { - return (this.left.inorderTraversal(action) || - !!action(this.key, this.value) || - this.right.inorderTraversal(action)); - }; - /** - * Traverses the tree in reverse key order and calls the specified action function - * for each node. - * - * @param action - Callback function to be called for each - * node. If it returns true, traversal is aborted. - * @returns True if traversal was aborted. - */ - LLRBNode.prototype.reverseTraversal = function (action) { - return (this.right.reverseTraversal(action) || - action(this.key, this.value) || - this.left.reverseTraversal(action)); - }; - /** - * @returns The minimum node in the tree. - */ - LLRBNode.prototype.min_ = function () { - if (this.left.isEmpty()) { - return this; - } - else { - return this.left.min_(); - } - }; - /** - * @returns The maximum key in the tree. - */ - LLRBNode.prototype.minKey = function () { - return this.min_().key; - }; - /** - * @returns The maximum key in the tree. - */ - LLRBNode.prototype.maxKey = function () { - if (this.right.isEmpty()) { - return this.key; - } - else { - return this.right.maxKey(); - } - }; - /** - * @param key - Key to insert. - * @param value - Value to insert. - * @param comparator - Comparator. - * @returns New tree, with the key/value added. - */ - LLRBNode.prototype.insert = function (key, value, comparator) { - var n = this; - var cmp = comparator(key, n.key); - if (cmp < 0) { - n = n.copy(null, null, null, n.left.insert(key, value, comparator), null); - } - else if (cmp === 0) { - n = n.copy(null, value, null, null, null); - } - else { - n = n.copy(null, null, null, null, n.right.insert(key, value, comparator)); - } - return n.fixUp_(); - }; - /** - * @returns New tree, with the minimum key removed. - */ - LLRBNode.prototype.removeMin_ = function () { - if (this.left.isEmpty()) { - return SortedMap.EMPTY_NODE; - } - var n = this; - if (!n.left.isRed_() && !n.left.left.isRed_()) { - n = n.moveRedLeft_(); - } - n = n.copy(null, null, null, n.left.removeMin_(), null); - return n.fixUp_(); - }; - /** - * @param key - The key of the item to remove. - * @param comparator - Comparator. - * @returns New tree, with the specified item removed. - */ - LLRBNode.prototype.remove = function (key, comparator) { - var n, smallest; - n = this; - if (comparator(key, n.key) < 0) { - if (!n.left.isEmpty() && !n.left.isRed_() && !n.left.left.isRed_()) { - n = n.moveRedLeft_(); - } - n = n.copy(null, null, null, n.left.remove(key, comparator), null); - } - else { - if (n.left.isRed_()) { - n = n.rotateRight_(); - } - if (!n.right.isEmpty() && !n.right.isRed_() && !n.right.left.isRed_()) { - n = n.moveRedRight_(); - } - if (comparator(key, n.key) === 0) { - if (n.right.isEmpty()) { - return SortedMap.EMPTY_NODE; - } - else { - smallest = n.right.min_(); - n = n.copy(smallest.key, smallest.value, null, null, n.right.removeMin_()); - } - } - n = n.copy(null, null, null, null, n.right.remove(key, comparator)); - } - return n.fixUp_(); - }; - /** - * @returns Whether this is a RED node. - */ - LLRBNode.prototype.isRed_ = function () { - return this.color; - }; - /** - * @returns New tree after performing any needed rotations. - */ - LLRBNode.prototype.fixUp_ = function () { - var n = this; - if (n.right.isRed_() && !n.left.isRed_()) { - n = n.rotateLeft_(); - } - if (n.left.isRed_() && n.left.left.isRed_()) { - n = n.rotateRight_(); - } - if (n.left.isRed_() && n.right.isRed_()) { - n = n.colorFlip_(); - } - return n; - }; - /** - * @returns New tree, after moveRedLeft. - */ - LLRBNode.prototype.moveRedLeft_ = function () { - var n = this.colorFlip_(); - if (n.right.left.isRed_()) { - n = n.copy(null, null, null, null, n.right.rotateRight_()); - n = n.rotateLeft_(); - n = n.colorFlip_(); - } - return n; - }; - /** - * @returns New tree, after moveRedRight. - */ - LLRBNode.prototype.moveRedRight_ = function () { - var n = this.colorFlip_(); - if (n.left.left.isRed_()) { - n = n.rotateRight_(); - n = n.colorFlip_(); - } - return n; - }; - /** - * @returns New tree, after rotateLeft. - */ - LLRBNode.prototype.rotateLeft_ = function () { - var nl = this.copy(null, null, LLRBNode.RED, null, this.right.left); - return this.right.copy(null, null, this.color, nl, null); - }; - /** - * @returns New tree, after rotateRight. - */ - LLRBNode.prototype.rotateRight_ = function () { - var nr = this.copy(null, null, LLRBNode.RED, this.left.right, null); - return this.left.copy(null, null, this.color, null, nr); - }; - /** - * @returns Newt ree, after colorFlip. - */ - LLRBNode.prototype.colorFlip_ = function () { - var left = this.left.copy(null, null, !this.left.color, null, null); - var right = this.right.copy(null, null, !this.right.color, null, null); - return this.copy(null, null, !this.color, left, right); - }; - /** - * For testing. - * - * @returns True if all is well. - */ - LLRBNode.prototype.checkMaxDepth_ = function () { - var blackDepth = this.check_(); - return Math.pow(2.0, blackDepth) <= this.count() + 1; - }; - LLRBNode.prototype.check_ = function () { - if (this.isRed_() && this.left.isRed_()) { - throw new Error('Red node has red child(' + this.key + ',' + this.value + ')'); - } - if (this.right.isRed_()) { - throw new Error('Right child of (' + this.key + ',' + this.value + ') is red'); - } - var blackDepth = this.left.check_(); - if (blackDepth !== this.right.check_()) { - throw new Error('Black depths differ'); - } - else { - return blackDepth + (this.isRed_() ? 0 : 1); - } - }; - LLRBNode.RED = true; - LLRBNode.BLACK = false; - return LLRBNode; -}()); -/** - * Represents an empty node (a leaf node in the Red-Black Tree). - */ -var LLRBEmptyNode = /** @class */ (function () { - function LLRBEmptyNode() { - } - /** - * Returns a copy of the current node. - * - * @returns The node copy. - */ - LLRBEmptyNode.prototype.copy = function (key, value, color, left, right) { - return this; - }; - /** - * Returns a copy of the tree, with the specified key/value added. - * - * @param key - Key to be added. - * @param value - Value to be added. - * @param comparator - Comparator. - * @returns New tree, with item added. - */ - LLRBEmptyNode.prototype.insert = function (key, value, comparator) { - return new LLRBNode(key, value, null); - }; - /** - * Returns a copy of the tree, with the specified key removed. - * - * @param key - The key to remove. - * @param comparator - Comparator. - * @returns New tree, with item removed. - */ - LLRBEmptyNode.prototype.remove = function (key, comparator) { - return this; - }; - /** - * @returns The total number of nodes in the tree. - */ - LLRBEmptyNode.prototype.count = function () { - return 0; - }; - /** - * @returns True if the tree is empty. - */ - LLRBEmptyNode.prototype.isEmpty = function () { - return true; - }; - /** - * Traverses the tree in key order and calls the specified action function - * for each node. - * - * @param action - Callback function to be called for each - * node. If it returns true, traversal is aborted. - * @returns True if traversal was aborted. - */ - LLRBEmptyNode.prototype.inorderTraversal = function (action) { - return false; - }; - /** - * Traverses the tree in reverse key order and calls the specified action function - * for each node. - * - * @param action - Callback function to be called for each - * node. If it returns true, traversal is aborted. - * @returns True if traversal was aborted. - */ - LLRBEmptyNode.prototype.reverseTraversal = function (action) { - return false; - }; - LLRBEmptyNode.prototype.minKey = function () { - return null; - }; - LLRBEmptyNode.prototype.maxKey = function () { - return null; - }; - LLRBEmptyNode.prototype.check_ = function () { - return 0; - }; - /** - * @returns Whether this node is red. - */ - LLRBEmptyNode.prototype.isRed_ = function () { - return false; - }; - return LLRBEmptyNode; -}()); -/** - * An immutable sorted map implementation, based on a Left-leaning Red-Black - * tree. - */ -var SortedMap = /** @class */ (function () { - /** - * @param comparator_ - Key comparator. - * @param root_ - Optional root node for the map. - */ - function SortedMap(comparator_, root_) { - if (root_ === void 0) { root_ = SortedMap.EMPTY_NODE; } - this.comparator_ = comparator_; - this.root_ = root_; - } - /** - * Returns a copy of the map, with the specified key/value added or replaced. - * (TODO: We should perhaps rename this method to 'put') - * - * @param key - Key to be added. - * @param value - Value to be added. - * @returns New map, with item added. - */ - SortedMap.prototype.insert = function (key, value) { - return new SortedMap(this.comparator_, this.root_ - .insert(key, value, this.comparator_) - .copy(null, null, LLRBNode.BLACK, null, null)); - }; - /** - * Returns a copy of the map, with the specified key removed. - * - * @param key - The key to remove. - * @returns New map, with item removed. - */ - SortedMap.prototype.remove = function (key) { - return new SortedMap(this.comparator_, this.root_ - .remove(key, this.comparator_) - .copy(null, null, LLRBNode.BLACK, null, null)); - }; - /** - * Returns the value of the node with the given key, or null. - * - * @param key - The key to look up. - * @returns The value of the node with the given key, or null if the - * key doesn't exist. - */ - SortedMap.prototype.get = function (key) { - var cmp; - var node = this.root_; - while (!node.isEmpty()) { - cmp = this.comparator_(key, node.key); - if (cmp === 0) { - return node.value; - } - else if (cmp < 0) { - node = node.left; - } - else if (cmp > 0) { - node = node.right; - } - } - return null; - }; - /** - * Returns the key of the item *before* the specified key, or null if key is the first item. - * @param key - The key to find the predecessor of - * @returns The predecessor key. - */ - SortedMap.prototype.getPredecessorKey = function (key) { - var cmp, node = this.root_, rightParent = null; - while (!node.isEmpty()) { - cmp = this.comparator_(key, node.key); - if (cmp === 0) { - if (!node.left.isEmpty()) { - node = node.left; - while (!node.right.isEmpty()) { - node = node.right; - } - return node.key; - } - else if (rightParent) { - return rightParent.key; - } - else { - return null; // first item. - } - } - else if (cmp < 0) { - node = node.left; - } - else if (cmp > 0) { - rightParent = node; - node = node.right; - } - } - throw new Error('Attempted to find predecessor key for a nonexistent key. What gives?'); - }; - /** - * @returns True if the map is empty. - */ - SortedMap.prototype.isEmpty = function () { - return this.root_.isEmpty(); - }; - /** - * @returns The total number of nodes in the map. - */ - SortedMap.prototype.count = function () { - return this.root_.count(); - }; - /** - * @returns The minimum key in the map. - */ - SortedMap.prototype.minKey = function () { - return this.root_.minKey(); - }; - /** - * @returns The maximum key in the map. - */ - SortedMap.prototype.maxKey = function () { - return this.root_.maxKey(); - }; - /** - * Traverses the map in key order and calls the specified action function - * for each key/value pair. - * - * @param action - Callback function to be called - * for each key/value pair. If action returns true, traversal is aborted. - * @returns The first truthy value returned by action, or the last falsey - * value returned by action - */ - SortedMap.prototype.inorderTraversal = function (action) { - return this.root_.inorderTraversal(action); - }; - /** - * Traverses the map in reverse key order and calls the specified action function - * for each key/value pair. - * - * @param action - Callback function to be called - * for each key/value pair. If action returns true, traversal is aborted. - * @returns True if the traversal was aborted. - */ - SortedMap.prototype.reverseTraversal = function (action) { - return this.root_.reverseTraversal(action); - }; - /** - * Returns an iterator over the SortedMap. - * @returns The iterator. - */ - SortedMap.prototype.getIterator = function (resultGenerator) { - return new SortedMapIterator(this.root_, null, this.comparator_, false, resultGenerator); - }; - SortedMap.prototype.getIteratorFrom = function (key, resultGenerator) { - return new SortedMapIterator(this.root_, key, this.comparator_, false, resultGenerator); - }; - SortedMap.prototype.getReverseIteratorFrom = function (key, resultGenerator) { - return new SortedMapIterator(this.root_, key, this.comparator_, true, resultGenerator); - }; - SortedMap.prototype.getReverseIterator = function (resultGenerator) { - return new SortedMapIterator(this.root_, null, this.comparator_, true, resultGenerator); - }; - /** - * Always use the same empty node, to reduce memory. - */ - SortedMap.EMPTY_NODE = new LLRBEmptyNode(); - return SortedMap; -}()); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -function NAME_ONLY_COMPARATOR(left, right) { - return nameCompare(left.name, right.name); -} -function NAME_COMPARATOR(left, right) { - return nameCompare(left, right); -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var MAX_NODE$2; -function setMaxNode$1(val) { - MAX_NODE$2 = val; -} -var priorityHashText = function (priority) { - if (typeof priority === 'number') { - return 'number:' + doubleToIEEE754String(priority); - } - else { - return 'string:' + priority; - } -}; -/** - * Validates that a priority snapshot Node is valid. - */ -var validatePriorityNode = function (priorityNode) { - if (priorityNode.isLeafNode()) { - var val = priorityNode.val(); - util.assert(typeof val === 'string' || - typeof val === 'number' || - (typeof val === 'object' && util.contains(val, '.sv')), 'Priority must be a string or number.'); - } - else { - util.assert(priorityNode === MAX_NODE$2 || priorityNode.isEmpty(), 'priority of unexpected type.'); - } - // Don't call getPriority() on MAX_NODE to avoid hitting assertion. - util.assert(priorityNode === MAX_NODE$2 || priorityNode.getPriority().isEmpty(), "Priority nodes can't have a priority of their own."); -}; - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var __childrenNodeConstructor; -/** - * LeafNode is a class for storing leaf nodes in a DataSnapshot. It - * implements Node and stores the value of the node (a string, - * number, or boolean) accessible via getValue(). - */ -var LeafNode = /** @class */ (function () { - /** - * @param value_ - The value to store in this leaf node. The object type is - * possible in the event of a deferred value - * @param priorityNode_ - The priority of this node. - */ - function LeafNode(value_, priorityNode_) { - if (priorityNode_ === void 0) { priorityNode_ = LeafNode.__childrenNodeConstructor.EMPTY_NODE; } - this.value_ = value_; - this.priorityNode_ = priorityNode_; - this.lazyHash_ = null; - util.assert(this.value_ !== undefined && this.value_ !== null, "LeafNode shouldn't be created with null/undefined value."); - validatePriorityNode(this.priorityNode_); - } - Object.defineProperty(LeafNode, "__childrenNodeConstructor", { - get: function () { - return __childrenNodeConstructor; - }, - set: function (val) { - __childrenNodeConstructor = val; - }, - enumerable: false, - configurable: true - }); - /** @inheritDoc */ - LeafNode.prototype.isLeafNode = function () { - return true; - }; - /** @inheritDoc */ - LeafNode.prototype.getPriority = function () { - return this.priorityNode_; - }; - /** @inheritDoc */ - LeafNode.prototype.updatePriority = function (newPriorityNode) { - return new LeafNode(this.value_, newPriorityNode); - }; - /** @inheritDoc */ - LeafNode.prototype.getImmediateChild = function (childName) { - // Hack to treat priority as a regular child - if (childName === '.priority') { - return this.priorityNode_; - } - else { - return LeafNode.__childrenNodeConstructor.EMPTY_NODE; - } - }; - /** @inheritDoc */ - LeafNode.prototype.getChild = function (path) { - if (pathIsEmpty(path)) { - return this; - } - else if (pathGetFront(path) === '.priority') { - return this.priorityNode_; - } - else { - return LeafNode.__childrenNodeConstructor.EMPTY_NODE; - } - }; - LeafNode.prototype.hasChild = function () { - return false; - }; - /** @inheritDoc */ - LeafNode.prototype.getPredecessorChildName = function (childName, childNode) { - return null; - }; - /** @inheritDoc */ - LeafNode.prototype.updateImmediateChild = function (childName, newChildNode) { - if (childName === '.priority') { - return this.updatePriority(newChildNode); - } - else if (newChildNode.isEmpty() && childName !== '.priority') { - return this; - } - else { - return LeafNode.__childrenNodeConstructor.EMPTY_NODE.updateImmediateChild(childName, newChildNode).updatePriority(this.priorityNode_); - } - }; - /** @inheritDoc */ - LeafNode.prototype.updateChild = function (path, newChildNode) { - var front = pathGetFront(path); - if (front === null) { - return newChildNode; - } - else if (newChildNode.isEmpty() && front !== '.priority') { - return this; - } - else { - util.assert(front !== '.priority' || pathGetLength(path) === 1, '.priority must be the last token in a path'); - return this.updateImmediateChild(front, LeafNode.__childrenNodeConstructor.EMPTY_NODE.updateChild(pathPopFront(path), newChildNode)); - } - }; - /** @inheritDoc */ - LeafNode.prototype.isEmpty = function () { - return false; - }; - /** @inheritDoc */ - LeafNode.prototype.numChildren = function () { - return 0; - }; - /** @inheritDoc */ - LeafNode.prototype.forEachChild = function (index, action) { - return false; - }; - LeafNode.prototype.val = function (exportFormat) { - if (exportFormat && !this.getPriority().isEmpty()) { - return { - '.value': this.getValue(), - '.priority': this.getPriority().val() - }; - } - else { - return this.getValue(); - } - }; - /** @inheritDoc */ - LeafNode.prototype.hash = function () { - if (this.lazyHash_ === null) { - var toHash = ''; - if (!this.priorityNode_.isEmpty()) { - toHash += - 'priority:' + - priorityHashText(this.priorityNode_.val()) + - ':'; - } - var type = typeof this.value_; - toHash += type + ':'; - if (type === 'number') { - toHash += doubleToIEEE754String(this.value_); - } - else { - toHash += this.value_; - } - this.lazyHash_ = sha1(toHash); - } - return this.lazyHash_; - }; - /** - * Returns the value of the leaf node. - * @returns The value of the node. - */ - LeafNode.prototype.getValue = function () { - return this.value_; - }; - LeafNode.prototype.compareTo = function (other) { - if (other === LeafNode.__childrenNodeConstructor.EMPTY_NODE) { - return 1; - } - else if (other instanceof LeafNode.__childrenNodeConstructor) { - return -1; - } - else { - util.assert(other.isLeafNode(), 'Unknown node type'); - return this.compareToLeafNode_(other); - } - }; - /** - * Comparison specifically for two leaf nodes - */ - LeafNode.prototype.compareToLeafNode_ = function (otherLeaf) { - var otherLeafType = typeof otherLeaf.value_; - var thisLeafType = typeof this.value_; - var otherIndex = LeafNode.VALUE_TYPE_ORDER.indexOf(otherLeafType); - var thisIndex = LeafNode.VALUE_TYPE_ORDER.indexOf(thisLeafType); - util.assert(otherIndex >= 0, 'Unknown leaf type: ' + otherLeafType); - util.assert(thisIndex >= 0, 'Unknown leaf type: ' + thisLeafType); - if (otherIndex === thisIndex) { - // Same type, compare values - if (thisLeafType === 'object') { - // Deferred value nodes are all equal, but we should also never get to this point... - return 0; - } - else { - // Note that this works because true > false, all others are number or string comparisons - if (this.value_ < otherLeaf.value_) { - return -1; - } - else if (this.value_ === otherLeaf.value_) { - return 0; - } - else { - return 1; - } - } - } - else { - return thisIndex - otherIndex; - } - }; - LeafNode.prototype.withIndex = function () { - return this; - }; - LeafNode.prototype.isIndexed = function () { - return true; - }; - LeafNode.prototype.equals = function (other) { - if (other === this) { - return true; - } - else if (other.isLeafNode()) { - var otherLeaf = other; - return (this.value_ === otherLeaf.value_ && - this.priorityNode_.equals(otherLeaf.priorityNode_)); - } - else { - return false; - } - }; - /** - * The sort order for comparing leaf nodes of different types. If two leaf nodes have - * the same type, the comparison falls back to their value - */ - LeafNode.VALUE_TYPE_ORDER = ['object', 'boolean', 'number', 'string']; - return LeafNode; -}()); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var nodeFromJSON$1; -var MAX_NODE$1; -function setNodeFromJSON(val) { - nodeFromJSON$1 = val; -} -function setMaxNode(val) { - MAX_NODE$1 = val; -} -var PriorityIndex = /** @class */ (function (_super) { - tslib.__extends(PriorityIndex, _super); - function PriorityIndex() { - return _super !== null && _super.apply(this, arguments) || this; - } - PriorityIndex.prototype.compare = function (a, b) { - var aPriority = a.node.getPriority(); - var bPriority = b.node.getPriority(); - var indexCmp = aPriority.compareTo(bPriority); - if (indexCmp === 0) { - return nameCompare(a.name, b.name); - } - else { - return indexCmp; - } - }; - PriorityIndex.prototype.isDefinedOn = function (node) { - return !node.getPriority().isEmpty(); - }; - PriorityIndex.prototype.indexedValueChanged = function (oldNode, newNode) { - return !oldNode.getPriority().equals(newNode.getPriority()); - }; - PriorityIndex.prototype.minPost = function () { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - return NamedNode.MIN; - }; - PriorityIndex.prototype.maxPost = function () { - return new NamedNode(MAX_NAME, new LeafNode('[PRIORITY-POST]', MAX_NODE$1)); - }; - PriorityIndex.prototype.makePost = function (indexValue, name) { - var priorityNode = nodeFromJSON$1(indexValue); - return new NamedNode(name, new LeafNode('[PRIORITY-POST]', priorityNode)); - }; - /** - * @returns String representation for inclusion in a query spec - */ - PriorityIndex.prototype.toString = function () { - return '.priority'; - }; - return PriorityIndex; -}(Index)); -var PRIORITY_INDEX = new PriorityIndex(); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var LOG_2 = Math.log(2); -var Base12Num = /** @class */ (function () { - function Base12Num(length) { - var logBase2 = function (num) { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - return parseInt((Math.log(num) / LOG_2), 10); - }; - var bitMask = function (bits) { return parseInt(Array(bits + 1).join('1'), 2); }; - this.count = logBase2(length + 1); - this.current_ = this.count - 1; - var mask = bitMask(this.count); - this.bits_ = (length + 1) & mask; - } - Base12Num.prototype.nextBitIsOne = function () { - //noinspection JSBitwiseOperatorUsage - var result = !(this.bits_ & (0x1 << this.current_)); - this.current_--; - return result; - }; - return Base12Num; -}()); -/** - * Takes a list of child nodes and constructs a SortedSet using the given comparison - * function - * - * Uses the algorithm described in the paper linked here: - * http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.46.1458 - * - * @param childList - Unsorted list of children - * @param cmp - The comparison method to be used - * @param keyFn - An optional function to extract K from a node wrapper, if K's - * type is not NamedNode - * @param mapSortFn - An optional override for comparator used by the generated sorted map - */ -var buildChildSet = function (childList, cmp, keyFn, mapSortFn) { - childList.sort(cmp); - var buildBalancedTree = function (low, high) { - var length = high - low; - var namedNode; - var key; - if (length === 0) { - return null; - } - else if (length === 1) { - namedNode = childList[low]; - key = keyFn ? keyFn(namedNode) : namedNode; - return new LLRBNode(key, namedNode.node, LLRBNode.BLACK, null, null); - } - else { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - var middle = parseInt((length / 2), 10) + low; - var left = buildBalancedTree(low, middle); - var right = buildBalancedTree(middle + 1, high); - namedNode = childList[middle]; - key = keyFn ? keyFn(namedNode) : namedNode; - return new LLRBNode(key, namedNode.node, LLRBNode.BLACK, left, right); - } - }; - var buildFrom12Array = function (base12) { - var node = null; - var root = null; - var index = childList.length; - var buildPennant = function (chunkSize, color) { - var low = index - chunkSize; - var high = index; - index -= chunkSize; - var childTree = buildBalancedTree(low + 1, high); - var namedNode = childList[low]; - var key = keyFn ? keyFn(namedNode) : namedNode; - attachPennant(new LLRBNode(key, namedNode.node, color, null, childTree)); - }; - var attachPennant = function (pennant) { - if (node) { - node.left = pennant; - node = pennant; - } - else { - root = pennant; - node = pennant; - } - }; - for (var i = 0; i < base12.count; ++i) { - var isOne = base12.nextBitIsOne(); - // The number of nodes taken in each slice is 2^(arr.length - (i + 1)) - var chunkSize = Math.pow(2, base12.count - (i + 1)); - if (isOne) { - buildPennant(chunkSize, LLRBNode.BLACK); - } - else { - // current == 2 - buildPennant(chunkSize, LLRBNode.BLACK); - buildPennant(chunkSize, LLRBNode.RED); - } - } - return root; - }; - var base12 = new Base12Num(childList.length); - var root = buildFrom12Array(base12); - // eslint-disable-next-line @typescript-eslint/no-explicit-any - return new SortedMap(mapSortFn || cmp, root); -}; - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var _defaultIndexMap; -var fallbackObject = {}; -var IndexMap = /** @class */ (function () { - function IndexMap(indexes_, indexSet_) { - this.indexes_ = indexes_; - this.indexSet_ = indexSet_; - } - Object.defineProperty(IndexMap, "Default", { - /** - * The default IndexMap for nodes without a priority - */ - get: function () { - util.assert(fallbackObject && PRIORITY_INDEX, 'ChildrenNode.ts has not been loaded'); - _defaultIndexMap = - _defaultIndexMap || - new IndexMap({ '.priority': fallbackObject }, { '.priority': PRIORITY_INDEX }); - return _defaultIndexMap; - }, - enumerable: false, - configurable: true - }); - IndexMap.prototype.get = function (indexKey) { - var sortedMap = util.safeGet(this.indexes_, indexKey); - if (!sortedMap) { - throw new Error('No index defined for ' + indexKey); - } - if (sortedMap instanceof SortedMap) { - return sortedMap; - } - else { - // The index exists, but it falls back to just name comparison. Return null so that the calling code uses the - // regular child map - return null; - } - }; - IndexMap.prototype.hasIndex = function (indexDefinition) { - return util.contains(this.indexSet_, indexDefinition.toString()); - }; - IndexMap.prototype.addIndex = function (indexDefinition, existingChildren) { - util.assert(indexDefinition !== KEY_INDEX, "KeyIndex always exists and isn't meant to be added to the IndexMap."); - var childList = []; - var sawIndexedValue = false; - var iter = existingChildren.getIterator(NamedNode.Wrap); - var next = iter.getNext(); - while (next) { - sawIndexedValue = - sawIndexedValue || indexDefinition.isDefinedOn(next.node); - childList.push(next); - next = iter.getNext(); - } - var newIndex; - if (sawIndexedValue) { - newIndex = buildChildSet(childList, indexDefinition.getCompare()); - } - else { - newIndex = fallbackObject; - } - var indexName = indexDefinition.toString(); - var newIndexSet = tslib.__assign({}, this.indexSet_); - newIndexSet[indexName] = indexDefinition; - var newIndexes = tslib.__assign({}, this.indexes_); - newIndexes[indexName] = newIndex; - return new IndexMap(newIndexes, newIndexSet); - }; - /** - * Ensure that this node is properly tracked in any indexes that we're maintaining - */ - IndexMap.prototype.addToIndexes = function (namedNode, existingChildren) { - var _this = this; - var newIndexes = util.map(this.indexes_, function (indexedChildren, indexName) { - var index = util.safeGet(_this.indexSet_, indexName); - util.assert(index, 'Missing index implementation for ' + indexName); - if (indexedChildren === fallbackObject) { - // Check to see if we need to index everything - if (index.isDefinedOn(namedNode.node)) { - // We need to build this index - var childList = []; - var iter = existingChildren.getIterator(NamedNode.Wrap); - var next = iter.getNext(); - while (next) { - if (next.name !== namedNode.name) { - childList.push(next); - } - next = iter.getNext(); - } - childList.push(namedNode); - return buildChildSet(childList, index.getCompare()); - } - else { - // No change, this remains a fallback - return fallbackObject; - } - } - else { - var existingSnap = existingChildren.get(namedNode.name); - var newChildren = indexedChildren; - if (existingSnap) { - newChildren = newChildren.remove(new NamedNode(namedNode.name, existingSnap)); - } - return newChildren.insert(namedNode, namedNode.node); - } - }); - return new IndexMap(newIndexes, this.indexSet_); - }; - /** - * Create a new IndexMap instance with the given value removed - */ - IndexMap.prototype.removeFromIndexes = function (namedNode, existingChildren) { - var newIndexes = util.map(this.indexes_, function (indexedChildren) { - if (indexedChildren === fallbackObject) { - // This is the fallback. Just return it, nothing to do in this case - return indexedChildren; - } - else { - var existingSnap = existingChildren.get(namedNode.name); - if (existingSnap) { - return indexedChildren.remove(new NamedNode(namedNode.name, existingSnap)); - } - else { - // No record of this child - return indexedChildren; - } - } - }); - return new IndexMap(newIndexes, this.indexSet_); - }; - return IndexMap; -}()); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// TODO: For memory savings, don't store priorityNode_ if it's empty. -var EMPTY_NODE; -/** - * ChildrenNode is a class for storing internal nodes in a DataSnapshot - * (i.e. nodes with children). It implements Node and stores the - * list of children in the children property, sorted by child name. - */ -var ChildrenNode = /** @class */ (function () { - /** - * @param children_ - List of children of this node.. - * @param priorityNode_ - The priority of this node (as a snapshot node). - */ - function ChildrenNode(children_, priorityNode_, indexMap_) { - this.children_ = children_; - this.priorityNode_ = priorityNode_; - this.indexMap_ = indexMap_; - this.lazyHash_ = null; - /** - * Note: The only reason we allow null priority is for EMPTY_NODE, since we can't use - * EMPTY_NODE as the priority of EMPTY_NODE. We might want to consider making EMPTY_NODE its own - * class instead of an empty ChildrenNode. - */ - if (this.priorityNode_) { - validatePriorityNode(this.priorityNode_); - } - if (this.children_.isEmpty()) { - util.assert(!this.priorityNode_ || this.priorityNode_.isEmpty(), 'An empty node cannot have a priority'); - } - } - Object.defineProperty(ChildrenNode, "EMPTY_NODE", { - get: function () { - return (EMPTY_NODE || - (EMPTY_NODE = new ChildrenNode(new SortedMap(NAME_COMPARATOR), null, IndexMap.Default))); - }, - enumerable: false, - configurable: true - }); - /** @inheritDoc */ - ChildrenNode.prototype.isLeafNode = function () { - return false; - }; - /** @inheritDoc */ - ChildrenNode.prototype.getPriority = function () { - return this.priorityNode_ || EMPTY_NODE; - }; - /** @inheritDoc */ - ChildrenNode.prototype.updatePriority = function (newPriorityNode) { - if (this.children_.isEmpty()) { - // Don't allow priorities on empty nodes - return this; - } - else { - return new ChildrenNode(this.children_, newPriorityNode, this.indexMap_); - } - }; - /** @inheritDoc */ - ChildrenNode.prototype.getImmediateChild = function (childName) { - // Hack to treat priority as a regular child - if (childName === '.priority') { - return this.getPriority(); - } - else { - var child = this.children_.get(childName); - return child === null ? EMPTY_NODE : child; - } - }; - /** @inheritDoc */ - ChildrenNode.prototype.getChild = function (path) { - var front = pathGetFront(path); - if (front === null) { - return this; - } - return this.getImmediateChild(front).getChild(pathPopFront(path)); - }; - /** @inheritDoc */ - ChildrenNode.prototype.hasChild = function (childName) { - return this.children_.get(childName) !== null; - }; - /** @inheritDoc */ - ChildrenNode.prototype.updateImmediateChild = function (childName, newChildNode) { - util.assert(newChildNode, 'We should always be passing snapshot nodes'); - if (childName === '.priority') { - return this.updatePriority(newChildNode); - } - else { - var namedNode = new NamedNode(childName, newChildNode); - var newChildren = void 0, newIndexMap = void 0; - if (newChildNode.isEmpty()) { - newChildren = this.children_.remove(childName); - newIndexMap = this.indexMap_.removeFromIndexes(namedNode, this.children_); - } - else { - newChildren = this.children_.insert(childName, newChildNode); - newIndexMap = this.indexMap_.addToIndexes(namedNode, this.children_); - } - var newPriority = newChildren.isEmpty() - ? EMPTY_NODE - : this.priorityNode_; - return new ChildrenNode(newChildren, newPriority, newIndexMap); - } - }; - /** @inheritDoc */ - ChildrenNode.prototype.updateChild = function (path, newChildNode) { - var front = pathGetFront(path); - if (front === null) { - return newChildNode; - } - else { - util.assert(pathGetFront(path) !== '.priority' || pathGetLength(path) === 1, '.priority must be the last token in a path'); - var newImmediateChild = this.getImmediateChild(front).updateChild(pathPopFront(path), newChildNode); - return this.updateImmediateChild(front, newImmediateChild); - } - }; - /** @inheritDoc */ - ChildrenNode.prototype.isEmpty = function () { - return this.children_.isEmpty(); - }; - /** @inheritDoc */ - ChildrenNode.prototype.numChildren = function () { - return this.children_.count(); - }; - /** @inheritDoc */ - ChildrenNode.prototype.val = function (exportFormat) { - if (this.isEmpty()) { - return null; - } - var obj = {}; - var numKeys = 0, maxKey = 0, allIntegerKeys = true; - this.forEachChild(PRIORITY_INDEX, function (key, childNode) { - obj[key] = childNode.val(exportFormat); - numKeys++; - if (allIntegerKeys && ChildrenNode.INTEGER_REGEXP_.test(key)) { - maxKey = Math.max(maxKey, Number(key)); - } - else { - allIntegerKeys = false; - } - }); - if (!exportFormat && allIntegerKeys && maxKey < 2 * numKeys) { - // convert to array. - var array = []; - // eslint-disable-next-line guard-for-in - for (var key in obj) { - array[key] = obj[key]; - } - return array; - } - else { - if (exportFormat && !this.getPriority().isEmpty()) { - obj['.priority'] = this.getPriority().val(); - } - return obj; - } - }; - /** @inheritDoc */ - ChildrenNode.prototype.hash = function () { - if (this.lazyHash_ === null) { - var toHash_1 = ''; - if (!this.getPriority().isEmpty()) { - toHash_1 += - 'priority:' + - priorityHashText(this.getPriority().val()) + - ':'; - } - this.forEachChild(PRIORITY_INDEX, function (key, childNode) { - var childHash = childNode.hash(); - if (childHash !== '') { - toHash_1 += ':' + key + ':' + childHash; - } - }); - this.lazyHash_ = toHash_1 === '' ? '' : sha1(toHash_1); - } - return this.lazyHash_; - }; - /** @inheritDoc */ - ChildrenNode.prototype.getPredecessorChildName = function (childName, childNode, index) { - var idx = this.resolveIndex_(index); - if (idx) { - var predecessor = idx.getPredecessorKey(new NamedNode(childName, childNode)); - return predecessor ? predecessor.name : null; - } - else { - return this.children_.getPredecessorKey(childName); - } - }; - ChildrenNode.prototype.getFirstChildName = function (indexDefinition) { - var idx = this.resolveIndex_(indexDefinition); - if (idx) { - var minKey = idx.minKey(); - return minKey && minKey.name; - } - else { - return this.children_.minKey(); - } - }; - ChildrenNode.prototype.getFirstChild = function (indexDefinition) { - var minKey = this.getFirstChildName(indexDefinition); - if (minKey) { - return new NamedNode(minKey, this.children_.get(minKey)); - } - else { - return null; - } - }; - /** - * Given an index, return the key name of the largest value we have, according to that index - */ - ChildrenNode.prototype.getLastChildName = function (indexDefinition) { - var idx = this.resolveIndex_(indexDefinition); - if (idx) { - var maxKey = idx.maxKey(); - return maxKey && maxKey.name; - } - else { - return this.children_.maxKey(); - } - }; - ChildrenNode.prototype.getLastChild = function (indexDefinition) { - var maxKey = this.getLastChildName(indexDefinition); - if (maxKey) { - return new NamedNode(maxKey, this.children_.get(maxKey)); - } - else { - return null; - } - }; - ChildrenNode.prototype.forEachChild = function (index, action) { - var idx = this.resolveIndex_(index); - if (idx) { - return idx.inorderTraversal(function (wrappedNode) { - return action(wrappedNode.name, wrappedNode.node); - }); - } - else { - return this.children_.inorderTraversal(action); - } - }; - ChildrenNode.prototype.getIterator = function (indexDefinition) { - return this.getIteratorFrom(indexDefinition.minPost(), indexDefinition); - }; - ChildrenNode.prototype.getIteratorFrom = function (startPost, indexDefinition) { - var idx = this.resolveIndex_(indexDefinition); - if (idx) { - return idx.getIteratorFrom(startPost, function (key) { return key; }); - } - else { - var iterator = this.children_.getIteratorFrom(startPost.name, NamedNode.Wrap); - var next = iterator.peek(); - while (next != null && indexDefinition.compare(next, startPost) < 0) { - iterator.getNext(); - next = iterator.peek(); - } - return iterator; - } - }; - ChildrenNode.prototype.getReverseIterator = function (indexDefinition) { - return this.getReverseIteratorFrom(indexDefinition.maxPost(), indexDefinition); - }; - ChildrenNode.prototype.getReverseIteratorFrom = function (endPost, indexDefinition) { - var idx = this.resolveIndex_(indexDefinition); - if (idx) { - return idx.getReverseIteratorFrom(endPost, function (key) { - return key; - }); - } - else { - var iterator = this.children_.getReverseIteratorFrom(endPost.name, NamedNode.Wrap); - var next = iterator.peek(); - while (next != null && indexDefinition.compare(next, endPost) > 0) { - iterator.getNext(); - next = iterator.peek(); - } - return iterator; - } - }; - ChildrenNode.prototype.compareTo = function (other) { - if (this.isEmpty()) { - if (other.isEmpty()) { - return 0; - } - else { - return -1; - } - } - else if (other.isLeafNode() || other.isEmpty()) { - return 1; - } - else if (other === MAX_NODE) { - return -1; - } - else { - // Must be another node with children. - return 0; - } - }; - ChildrenNode.prototype.withIndex = function (indexDefinition) { - if (indexDefinition === KEY_INDEX || - this.indexMap_.hasIndex(indexDefinition)) { - return this; - } - else { - var newIndexMap = this.indexMap_.addIndex(indexDefinition, this.children_); - return new ChildrenNode(this.children_, this.priorityNode_, newIndexMap); - } - }; - ChildrenNode.prototype.isIndexed = function (index) { - return index === KEY_INDEX || this.indexMap_.hasIndex(index); - }; - ChildrenNode.prototype.equals = function (other) { - if (other === this) { - return true; - } - else if (other.isLeafNode()) { - return false; - } - else { - var otherChildrenNode = other; - if (!this.getPriority().equals(otherChildrenNode.getPriority())) { - return false; - } - else if (this.children_.count() === otherChildrenNode.children_.count()) { - var thisIter = this.getIterator(PRIORITY_INDEX); - var otherIter = otherChildrenNode.getIterator(PRIORITY_INDEX); - var thisCurrent = thisIter.getNext(); - var otherCurrent = otherIter.getNext(); - while (thisCurrent && otherCurrent) { - if (thisCurrent.name !== otherCurrent.name || - !thisCurrent.node.equals(otherCurrent.node)) { - return false; - } - thisCurrent = thisIter.getNext(); - otherCurrent = otherIter.getNext(); - } - return thisCurrent === null && otherCurrent === null; - } - else { - return false; - } - } - }; - /** - * Returns a SortedMap ordered by index, or null if the default (by-key) ordering can be used - * instead. - * - */ - ChildrenNode.prototype.resolveIndex_ = function (indexDefinition) { - if (indexDefinition === KEY_INDEX) { - return null; - } - else { - return this.indexMap_.get(indexDefinition.toString()); - } - }; - ChildrenNode.INTEGER_REGEXP_ = /^(0|[1-9]\d*)$/; - return ChildrenNode; -}()); -var MaxNode = /** @class */ (function (_super) { - tslib.__extends(MaxNode, _super); - function MaxNode() { - return _super.call(this, new SortedMap(NAME_COMPARATOR), ChildrenNode.EMPTY_NODE, IndexMap.Default) || this; - } - MaxNode.prototype.compareTo = function (other) { - if (other === this) { - return 0; - } - else { - return 1; - } - }; - MaxNode.prototype.equals = function (other) { - // Not that we every compare it, but MAX_NODE is only ever equal to itself - return other === this; - }; - MaxNode.prototype.getPriority = function () { - return this; - }; - MaxNode.prototype.getImmediateChild = function (childName) { - return ChildrenNode.EMPTY_NODE; - }; - MaxNode.prototype.isEmpty = function () { - return false; - }; - return MaxNode; -}(ChildrenNode)); -/** - * Marker that will sort higher than any other snapshot. - */ -var MAX_NODE = new MaxNode(); -Object.defineProperties(NamedNode, { - MIN: { - value: new NamedNode(MIN_NAME, ChildrenNode.EMPTY_NODE) - }, - MAX: { - value: new NamedNode(MAX_NAME, MAX_NODE) - } -}); -/** - * Reference Extensions - */ -KeyIndex.__EMPTY_NODE = ChildrenNode.EMPTY_NODE; -LeafNode.__childrenNodeConstructor = ChildrenNode; -setMaxNode$1(MAX_NODE); -setMaxNode(MAX_NODE); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var USE_HINZE = true; -/** - * Constructs a snapshot node representing the passed JSON and returns it. - * @param json - JSON to create a node for. - * @param priority - Optional priority to use. This will be ignored if the - * passed JSON contains a .priority property. - */ -function nodeFromJSON(json, priority) { - if (priority === void 0) { priority = null; } - if (json === null) { - return ChildrenNode.EMPTY_NODE; - } - if (typeof json === 'object' && '.priority' in json) { - priority = json['.priority']; - } - util.assert(priority === null || - typeof priority === 'string' || - typeof priority === 'number' || - (typeof priority === 'object' && '.sv' in priority), 'Invalid priority type found: ' + typeof priority); - if (typeof json === 'object' && '.value' in json && json['.value'] !== null) { - json = json['.value']; - } - // Valid leaf nodes include non-objects or server-value wrapper objects - if (typeof json !== 'object' || '.sv' in json) { - var jsonLeaf = json; - return new LeafNode(jsonLeaf, nodeFromJSON(priority)); - } - if (!(json instanceof Array) && USE_HINZE) { - var children_1 = []; - var childrenHavePriority_1 = false; - var hinzeJsonObj = json; - each(hinzeJsonObj, function (key, child) { - if (key.substring(0, 1) !== '.') { - // Ignore metadata nodes - var childNode = nodeFromJSON(child); - if (!childNode.isEmpty()) { - childrenHavePriority_1 = - childrenHavePriority_1 || !childNode.getPriority().isEmpty(); - children_1.push(new NamedNode(key, childNode)); - } - } - }); - if (children_1.length === 0) { - return ChildrenNode.EMPTY_NODE; - } - var childSet = buildChildSet(children_1, NAME_ONLY_COMPARATOR, function (namedNode) { return namedNode.name; }, NAME_COMPARATOR); - if (childrenHavePriority_1) { - var sortedChildSet = buildChildSet(children_1, PRIORITY_INDEX.getCompare()); - return new ChildrenNode(childSet, nodeFromJSON(priority), new IndexMap({ '.priority': sortedChildSet }, { '.priority': PRIORITY_INDEX })); - } - else { - return new ChildrenNode(childSet, nodeFromJSON(priority), IndexMap.Default); - } - } - else { - var node_1 = ChildrenNode.EMPTY_NODE; - each(json, function (key, childData) { - if (util.contains(json, key)) { - if (key.substring(0, 1) !== '.') { - // ignore metadata nodes. - var childNode = nodeFromJSON(childData); - if (childNode.isLeafNode() || !childNode.isEmpty()) { - node_1 = node_1.updateImmediateChild(key, childNode); - } - } - } - }); - return node_1.updatePriority(nodeFromJSON(priority)); - } -} -setNodeFromJSON(nodeFromJSON); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var PathIndex = /** @class */ (function (_super) { - tslib.__extends(PathIndex, _super); - function PathIndex(indexPath_) { - var _this = _super.call(this) || this; - _this.indexPath_ = indexPath_; - util.assert(!pathIsEmpty(indexPath_) && pathGetFront(indexPath_) !== '.priority', "Can't create PathIndex with empty path or .priority key"); - return _this; - } - PathIndex.prototype.extractChild = function (snap) { - return snap.getChild(this.indexPath_); - }; - PathIndex.prototype.isDefinedOn = function (node) { - return !node.getChild(this.indexPath_).isEmpty(); - }; - PathIndex.prototype.compare = function (a, b) { - var aChild = this.extractChild(a.node); - var bChild = this.extractChild(b.node); - var indexCmp = aChild.compareTo(bChild); - if (indexCmp === 0) { - return nameCompare(a.name, b.name); - } - else { - return indexCmp; - } - }; - PathIndex.prototype.makePost = function (indexValue, name) { - var valueNode = nodeFromJSON(indexValue); - var node = ChildrenNode.EMPTY_NODE.updateChild(this.indexPath_, valueNode); - return new NamedNode(name, node); - }; - PathIndex.prototype.maxPost = function () { - var node = ChildrenNode.EMPTY_NODE.updateChild(this.indexPath_, MAX_NODE); - return new NamedNode(MAX_NAME, node); - }; - PathIndex.prototype.toString = function () { - return pathSlice(this.indexPath_, 0).join('/'); - }; - return PathIndex; -}(Index)); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var ValueIndex = /** @class */ (function (_super) { - tslib.__extends(ValueIndex, _super); - function ValueIndex() { - return _super !== null && _super.apply(this, arguments) || this; - } - ValueIndex.prototype.compare = function (a, b) { - var indexCmp = a.node.compareTo(b.node); - if (indexCmp === 0) { - return nameCompare(a.name, b.name); - } - else { - return indexCmp; - } - }; - ValueIndex.prototype.isDefinedOn = function (node) { - return true; - }; - ValueIndex.prototype.indexedValueChanged = function (oldNode, newNode) { - return !oldNode.equals(newNode); - }; - ValueIndex.prototype.minPost = function () { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - return NamedNode.MIN; - }; - ValueIndex.prototype.maxPost = function () { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - return NamedNode.MAX; - }; - ValueIndex.prototype.makePost = function (indexValue, name) { - var valueNode = nodeFromJSON(indexValue); - return new NamedNode(name, valueNode); - }; - /** - * @returns String representation for inclusion in a query spec - */ - ValueIndex.prototype.toString = function () { - return '.value'; - }; - return ValueIndex; -}(Index)); -var VALUE_INDEX = new ValueIndex(); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Modeled after base64 web-safe chars, but ordered by ASCII. -var PUSH_CHARS = '-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz'; -var MIN_PUSH_CHAR = '-'; -var MAX_PUSH_CHAR = 'z'; -var MAX_KEY_LEN = 786; -/** - * Fancy ID generator that creates 20-character string identifiers with the - * following properties: - * - * 1. They're based on timestamp so that they sort *after* any existing ids. - * 2. They contain 72-bits of random data after the timestamp so that IDs won't - * collide with other clients' IDs. - * 3. They sort *lexicographically* (so the timestamp is converted to characters - * that will sort properly). - * 4. They're monotonically increasing. Even if you generate more than one in - * the same timestamp, the latter ones will sort after the former ones. We do - * this by using the previous random bits but "incrementing" them by 1 (only - * in the case of a timestamp collision). - */ -var nextPushId = (function () { - // Timestamp of last push, used to prevent local collisions if you push twice - // in one ms. - var lastPushTime = 0; - // We generate 72-bits of randomness which get turned into 12 characters and - // appended to the timestamp to prevent collisions with other clients. We - // store the last characters we generated because in the event of a collision, - // we'll use those same characters except "incremented" by one. - var lastRandChars = []; - return function (now) { - var duplicateTime = now === lastPushTime; - lastPushTime = now; - var i; - var timeStampChars = new Array(8); - for (i = 7; i >= 0; i--) { - timeStampChars[i] = PUSH_CHARS.charAt(now % 64); - // NOTE: Can't use << here because javascript will convert to int and lose - // the upper bits. - now = Math.floor(now / 64); - } - util.assert(now === 0, 'Cannot push at time == 0'); - var id = timeStampChars.join(''); - if (!duplicateTime) { - for (i = 0; i < 12; i++) { - lastRandChars[i] = Math.floor(Math.random() * 64); - } - } - else { - // If the timestamp hasn't changed since last push, use the same random - // number, except incremented by 1. - for (i = 11; i >= 0 && lastRandChars[i] === 63; i--) { - lastRandChars[i] = 0; - } - lastRandChars[i]++; - } - for (i = 0; i < 12; i++) { - id += PUSH_CHARS.charAt(lastRandChars[i]); - } - util.assert(id.length === 20, 'nextPushId: Length should be 20.'); - return id; - }; -})(); -var successor = function (key) { - if (key === '' + INTEGER_32_MAX) { - // See https://firebase.google.com/docs/database/web/lists-of-data#data-order - return MIN_PUSH_CHAR; - } - var keyAsInt = tryParseInt(key); - if (keyAsInt != null) { - return '' + (keyAsInt + 1); - } - var next = new Array(key.length); - for (var i_1 = 0; i_1 < next.length; i_1++) { - next[i_1] = key.charAt(i_1); - } - if (next.length < MAX_KEY_LEN) { - next.push(MIN_PUSH_CHAR); - return next.join(''); - } - var i = next.length - 1; - while (i >= 0 && next[i] === MAX_PUSH_CHAR) { - i--; - } - // `successor` was called on the largest possible key, so return the - // MAX_NAME, which sorts larger than all keys. - if (i === -1) { - return MAX_NAME; - } - var source = next[i]; - var sourcePlusOne = PUSH_CHARS.charAt(PUSH_CHARS.indexOf(source) + 1); - next[i] = sourcePlusOne; - return next.slice(0, i + 1).join(''); -}; -// `key` is assumed to be non-empty. -var predecessor = function (key) { - if (key === '' + INTEGER_32_MIN) { - return MIN_NAME; - } - var keyAsInt = tryParseInt(key); - if (keyAsInt != null) { - return '' + (keyAsInt - 1); - } - var next = new Array(key.length); - for (var i = 0; i < next.length; i++) { - next[i] = key.charAt(i); - } - // If `key` ends in `MIN_PUSH_CHAR`, the largest key lexicographically - // smaller than `key`, is `key[0:key.length - 1]`. The next key smaller - // than that, `predecessor(predecessor(key))`, is - // - // `key[0:key.length - 2] + (key[key.length - 1] - 1) + \ - // { MAX_PUSH_CHAR repeated MAX_KEY_LEN - (key.length - 1) times } - // - // analogous to increment/decrement for base-10 integers. - // - // This works because lexigographic comparison works character-by-character, - // using length as a tie-breaker if one key is a prefix of the other. - if (next[next.length - 1] === MIN_PUSH_CHAR) { - if (next.length === 1) { - // See https://firebase.google.com/docs/database/web/lists-of-data#orderbykey - return '' + INTEGER_32_MAX; - } - delete next[next.length - 1]; - return next.join(''); - } - // Replace the last character with it's immediate predecessor, and - // fill the suffix of the key with MAX_PUSH_CHAR. This is the - // lexicographically largest possible key smaller than `key`. - next[next.length - 1] = PUSH_CHARS.charAt(PUSH_CHARS.indexOf(next[next.length - 1]) - 1); - return next.join('') + MAX_PUSH_CHAR.repeat(MAX_KEY_LEN - next.length); -}; - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -function changeValue(snapshotNode) { - return { type: "value" /* VALUE */, snapshotNode: snapshotNode }; -} -function changeChildAdded(childName, snapshotNode) { - return { type: "child_added" /* CHILD_ADDED */, snapshotNode: snapshotNode, childName: childName }; -} -function changeChildRemoved(childName, snapshotNode) { - return { type: "child_removed" /* CHILD_REMOVED */, snapshotNode: snapshotNode, childName: childName }; -} -function changeChildChanged(childName, snapshotNode, oldSnap) { - return { - type: "child_changed" /* CHILD_CHANGED */, - snapshotNode: snapshotNode, - childName: childName, - oldSnap: oldSnap - }; -} -function changeChildMoved(childName, snapshotNode) { - return { type: "child_moved" /* CHILD_MOVED */, snapshotNode: snapshotNode, childName: childName }; -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Doesn't really filter nodes but applies an index to the node and keeps track of any changes - */ -var IndexedFilter = /** @class */ (function () { - function IndexedFilter(index_) { - this.index_ = index_; - } - IndexedFilter.prototype.updateChild = function (snap, key, newChild, affectedPath, source, optChangeAccumulator) { - util.assert(snap.isIndexed(this.index_), 'A node must be indexed if only a child is updated'); - var oldChild = snap.getImmediateChild(key); - // Check if anything actually changed. - if (oldChild.getChild(affectedPath).equals(newChild.getChild(affectedPath))) { - // There's an edge case where a child can enter or leave the view because affectedPath was set to null. - // In this case, affectedPath will appear null in both the old and new snapshots. So we need - // to avoid treating these cases as "nothing changed." - if (oldChild.isEmpty() === newChild.isEmpty()) { - // Nothing changed. - // This assert should be valid, but it's expensive (can dominate perf testing) so don't actually do it. - //assert(oldChild.equals(newChild), 'Old and new snapshots should be equal.'); - return snap; - } - } - if (optChangeAccumulator != null) { - if (newChild.isEmpty()) { - if (snap.hasChild(key)) { - optChangeAccumulator.trackChildChange(changeChildRemoved(key, oldChild)); - } - else { - util.assert(snap.isLeafNode(), 'A child remove without an old child only makes sense on a leaf node'); - } - } - else if (oldChild.isEmpty()) { - optChangeAccumulator.trackChildChange(changeChildAdded(key, newChild)); - } - else { - optChangeAccumulator.trackChildChange(changeChildChanged(key, newChild, oldChild)); - } - } - if (snap.isLeafNode() && newChild.isEmpty()) { - return snap; - } - else { - // Make sure the node is indexed - return snap.updateImmediateChild(key, newChild).withIndex(this.index_); - } - }; - IndexedFilter.prototype.updateFullNode = function (oldSnap, newSnap, optChangeAccumulator) { - if (optChangeAccumulator != null) { - if (!oldSnap.isLeafNode()) { - oldSnap.forEachChild(PRIORITY_INDEX, function (key, childNode) { - if (!newSnap.hasChild(key)) { - optChangeAccumulator.trackChildChange(changeChildRemoved(key, childNode)); - } - }); - } - if (!newSnap.isLeafNode()) { - newSnap.forEachChild(PRIORITY_INDEX, function (key, childNode) { - if (oldSnap.hasChild(key)) { - var oldChild = oldSnap.getImmediateChild(key); - if (!oldChild.equals(childNode)) { - optChangeAccumulator.trackChildChange(changeChildChanged(key, childNode, oldChild)); - } - } - else { - optChangeAccumulator.trackChildChange(changeChildAdded(key, childNode)); - } - }); - } - } - return newSnap.withIndex(this.index_); - }; - IndexedFilter.prototype.updatePriority = function (oldSnap, newPriority) { - if (oldSnap.isEmpty()) { - return ChildrenNode.EMPTY_NODE; - } - else { - return oldSnap.updatePriority(newPriority); - } - }; - IndexedFilter.prototype.filtersNodes = function () { - return false; - }; - IndexedFilter.prototype.getIndexedFilter = function () { - return this; - }; - IndexedFilter.prototype.getIndex = function () { - return this.index_; - }; - return IndexedFilter; -}()); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Filters nodes by range and uses an IndexFilter to track any changes after filtering the node - */ -var RangedFilter = /** @class */ (function () { - function RangedFilter(params) { - this.indexedFilter_ = new IndexedFilter(params.getIndex()); - this.index_ = params.getIndex(); - this.startPost_ = RangedFilter.getStartPost_(params); - this.endPost_ = RangedFilter.getEndPost_(params); - } - RangedFilter.prototype.getStartPost = function () { - return this.startPost_; - }; - RangedFilter.prototype.getEndPost = function () { - return this.endPost_; - }; - RangedFilter.prototype.matches = function (node) { - return (this.index_.compare(this.getStartPost(), node) <= 0 && - this.index_.compare(node, this.getEndPost()) <= 0); - }; - RangedFilter.prototype.updateChild = function (snap, key, newChild, affectedPath, source, optChangeAccumulator) { - if (!this.matches(new NamedNode(key, newChild))) { - newChild = ChildrenNode.EMPTY_NODE; - } - return this.indexedFilter_.updateChild(snap, key, newChild, affectedPath, source, optChangeAccumulator); - }; - RangedFilter.prototype.updateFullNode = function (oldSnap, newSnap, optChangeAccumulator) { - if (newSnap.isLeafNode()) { - // Make sure we have a children node with the correct index, not a leaf node; - newSnap = ChildrenNode.EMPTY_NODE; - } - var filtered = newSnap.withIndex(this.index_); - // Don't support priorities on queries - filtered = filtered.updatePriority(ChildrenNode.EMPTY_NODE); - var self = this; - newSnap.forEachChild(PRIORITY_INDEX, function (key, childNode) { - if (!self.matches(new NamedNode(key, childNode))) { - filtered = filtered.updateImmediateChild(key, ChildrenNode.EMPTY_NODE); - } - }); - return this.indexedFilter_.updateFullNode(oldSnap, filtered, optChangeAccumulator); - }; - RangedFilter.prototype.updatePriority = function (oldSnap, newPriority) { - // Don't support priorities on queries - return oldSnap; - }; - RangedFilter.prototype.filtersNodes = function () { - return true; - }; - RangedFilter.prototype.getIndexedFilter = function () { - return this.indexedFilter_; - }; - RangedFilter.prototype.getIndex = function () { - return this.index_; - }; - RangedFilter.getStartPost_ = function (params) { - if (params.hasStart()) { - var startName = params.getIndexStartName(); - return params.getIndex().makePost(params.getIndexStartValue(), startName); - } - else { - return params.getIndex().minPost(); - } - }; - RangedFilter.getEndPost_ = function (params) { - if (params.hasEnd()) { - var endName = params.getIndexEndName(); - return params.getIndex().makePost(params.getIndexEndValue(), endName); - } - else { - return params.getIndex().maxPost(); - } - }; - return RangedFilter; -}()); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Applies a limit and a range to a node and uses RangedFilter to do the heavy lifting where possible - */ -var LimitedFilter = /** @class */ (function () { - function LimitedFilter(params) { - this.rangedFilter_ = new RangedFilter(params); - this.index_ = params.getIndex(); - this.limit_ = params.getLimit(); - this.reverse_ = !params.isViewFromLeft(); - } - LimitedFilter.prototype.updateChild = function (snap, key, newChild, affectedPath, source, optChangeAccumulator) { - if (!this.rangedFilter_.matches(new NamedNode(key, newChild))) { - newChild = ChildrenNode.EMPTY_NODE; - } - if (snap.getImmediateChild(key).equals(newChild)) { - // No change - return snap; - } - else if (snap.numChildren() < this.limit_) { - return this.rangedFilter_ - .getIndexedFilter() - .updateChild(snap, key, newChild, affectedPath, source, optChangeAccumulator); - } - else { - return this.fullLimitUpdateChild_(snap, key, newChild, source, optChangeAccumulator); - } - }; - LimitedFilter.prototype.updateFullNode = function (oldSnap, newSnap, optChangeAccumulator) { - var filtered; - if (newSnap.isLeafNode() || newSnap.isEmpty()) { - // Make sure we have a children node with the correct index, not a leaf node; - filtered = ChildrenNode.EMPTY_NODE.withIndex(this.index_); - } - else { - if (this.limit_ * 2 < newSnap.numChildren() && - newSnap.isIndexed(this.index_)) { - // Easier to build up a snapshot, since what we're given has more than twice the elements we want - filtered = ChildrenNode.EMPTY_NODE.withIndex(this.index_); - // anchor to the startPost, endPost, or last element as appropriate - var iterator = void 0; - if (this.reverse_) { - iterator = newSnap.getReverseIteratorFrom(this.rangedFilter_.getEndPost(), this.index_); - } - else { - iterator = newSnap.getIteratorFrom(this.rangedFilter_.getStartPost(), this.index_); - } - var count = 0; - while (iterator.hasNext() && count < this.limit_) { - var next = iterator.getNext(); - var inRange = void 0; - if (this.reverse_) { - inRange = - this.index_.compare(this.rangedFilter_.getStartPost(), next) <= 0; - } - else { - inRange = - this.index_.compare(next, this.rangedFilter_.getEndPost()) <= 0; - } - if (inRange) { - filtered = filtered.updateImmediateChild(next.name, next.node); - count++; - } - else { - // if we have reached the end post, we cannot keep adding elemments - break; - } - } - } - else { - // The snap contains less than twice the limit. Faster to delete from the snap than build up a new one - filtered = newSnap.withIndex(this.index_); - // Don't support priorities on queries - filtered = filtered.updatePriority(ChildrenNode.EMPTY_NODE); - var startPost = void 0; - var endPost = void 0; - var cmp = void 0; - var iterator = void 0; - if (this.reverse_) { - iterator = filtered.getReverseIterator(this.index_); - startPost = this.rangedFilter_.getEndPost(); - endPost = this.rangedFilter_.getStartPost(); - var indexCompare_1 = this.index_.getCompare(); - cmp = function (a, b) { return indexCompare_1(b, a); }; - } - else { - iterator = filtered.getIterator(this.index_); - startPost = this.rangedFilter_.getStartPost(); - endPost = this.rangedFilter_.getEndPost(); - cmp = this.index_.getCompare(); - } - var count = 0; - var foundStartPost = false; - while (iterator.hasNext()) { - var next = iterator.getNext(); - if (!foundStartPost && cmp(startPost, next) <= 0) { - // start adding - foundStartPost = true; - } - var inRange = foundStartPost && count < this.limit_ && cmp(next, endPost) <= 0; - if (inRange) { - count++; - } - else { - filtered = filtered.updateImmediateChild(next.name, ChildrenNode.EMPTY_NODE); - } - } - } - } - return this.rangedFilter_ - .getIndexedFilter() - .updateFullNode(oldSnap, filtered, optChangeAccumulator); - }; - LimitedFilter.prototype.updatePriority = function (oldSnap, newPriority) { - // Don't support priorities on queries - return oldSnap; - }; - LimitedFilter.prototype.filtersNodes = function () { - return true; - }; - LimitedFilter.prototype.getIndexedFilter = function () { - return this.rangedFilter_.getIndexedFilter(); - }; - LimitedFilter.prototype.getIndex = function () { - return this.index_; - }; - LimitedFilter.prototype.fullLimitUpdateChild_ = function (snap, childKey, childSnap, source, changeAccumulator) { - // TODO: rename all cache stuff etc to general snap terminology - var cmp; - if (this.reverse_) { - var indexCmp_1 = this.index_.getCompare(); - cmp = function (a, b) { return indexCmp_1(b, a); }; - } - else { - cmp = this.index_.getCompare(); - } - var oldEventCache = snap; - util.assert(oldEventCache.numChildren() === this.limit_, ''); - var newChildNamedNode = new NamedNode(childKey, childSnap); - var windowBoundary = this.reverse_ - ? oldEventCache.getFirstChild(this.index_) - : oldEventCache.getLastChild(this.index_); - var inRange = this.rangedFilter_.matches(newChildNamedNode); - if (oldEventCache.hasChild(childKey)) { - var oldChildSnap = oldEventCache.getImmediateChild(childKey); - var nextChild = source.getChildAfterChild(this.index_, windowBoundary, this.reverse_); - while (nextChild != null && - (nextChild.name === childKey || oldEventCache.hasChild(nextChild.name))) { - // There is a weird edge case where a node is updated as part of a merge in the write tree, but hasn't - // been applied to the limited filter yet. Ignore this next child which will be updated later in - // the limited filter... - nextChild = source.getChildAfterChild(this.index_, nextChild, this.reverse_); - } - var compareNext = nextChild == null ? 1 : cmp(nextChild, newChildNamedNode); - var remainsInWindow = inRange && !childSnap.isEmpty() && compareNext >= 0; - if (remainsInWindow) { - if (changeAccumulator != null) { - changeAccumulator.trackChildChange(changeChildChanged(childKey, childSnap, oldChildSnap)); - } - return oldEventCache.updateImmediateChild(childKey, childSnap); - } - else { - if (changeAccumulator != null) { - changeAccumulator.trackChildChange(changeChildRemoved(childKey, oldChildSnap)); - } - var newEventCache = oldEventCache.updateImmediateChild(childKey, ChildrenNode.EMPTY_NODE); - var nextChildInRange = nextChild != null && this.rangedFilter_.matches(nextChild); - if (nextChildInRange) { - if (changeAccumulator != null) { - changeAccumulator.trackChildChange(changeChildAdded(nextChild.name, nextChild.node)); - } - return newEventCache.updateImmediateChild(nextChild.name, nextChild.node); - } - else { - return newEventCache; - } - } - } - else if (childSnap.isEmpty()) { - // we're deleting a node, but it was not in the window, so ignore it - return snap; - } - else if (inRange) { - if (cmp(windowBoundary, newChildNamedNode) >= 0) { - if (changeAccumulator != null) { - changeAccumulator.trackChildChange(changeChildRemoved(windowBoundary.name, windowBoundary.node)); - changeAccumulator.trackChildChange(changeChildAdded(childKey, childSnap)); - } - return oldEventCache - .updateImmediateChild(childKey, childSnap) - .updateImmediateChild(windowBoundary.name, ChildrenNode.EMPTY_NODE); - } - else { - return snap; - } - } - else { - return snap; - } - }; - return LimitedFilter; -}()); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * This class is an immutable-from-the-public-api struct containing a set of query parameters defining a - * range to be returned for a particular location. It is assumed that validation of parameters is done at the - * user-facing API level, so it is not done here. - * - * @internal - */ -var QueryParams = /** @class */ (function () { - function QueryParams() { - this.limitSet_ = false; - this.startSet_ = false; - this.startNameSet_ = false; - this.startAfterSet_ = false; - this.endSet_ = false; - this.endNameSet_ = false; - this.endBeforeSet_ = false; - this.limit_ = 0; - this.viewFrom_ = ''; - this.indexStartValue_ = null; - this.indexStartName_ = ''; - this.indexEndValue_ = null; - this.indexEndName_ = ''; - this.index_ = PRIORITY_INDEX; - } - QueryParams.prototype.hasStart = function () { - return this.startSet_; - }; - QueryParams.prototype.hasStartAfter = function () { - return this.startAfterSet_; - }; - QueryParams.prototype.hasEndBefore = function () { - return this.endBeforeSet_; - }; - /** - * @returns True if it would return from left. - */ - QueryParams.prototype.isViewFromLeft = function () { - if (this.viewFrom_ === '') { - // limit(), rather than limitToFirst or limitToLast was called. - // This means that only one of startSet_ and endSet_ is true. Use them - // to calculate which side of the view to anchor to. If neither is set, - // anchor to the end. - return this.startSet_; - } - else { - return this.viewFrom_ === "l" /* VIEW_FROM_LEFT */; - } - }; - /** - * Only valid to call if hasStart() returns true - */ - QueryParams.prototype.getIndexStartValue = function () { - util.assert(this.startSet_, 'Only valid if start has been set'); - return this.indexStartValue_; - }; - /** - * Only valid to call if hasStart() returns true. - * Returns the starting key name for the range defined by these query parameters - */ - QueryParams.prototype.getIndexStartName = function () { - util.assert(this.startSet_, 'Only valid if start has been set'); - if (this.startNameSet_) { - return this.indexStartName_; - } - else { - return MIN_NAME; - } - }; - QueryParams.prototype.hasEnd = function () { - return this.endSet_; - }; - /** - * Only valid to call if hasEnd() returns true. - */ - QueryParams.prototype.getIndexEndValue = function () { - util.assert(this.endSet_, 'Only valid if end has been set'); - return this.indexEndValue_; - }; - /** - * Only valid to call if hasEnd() returns true. - * Returns the end key name for the range defined by these query parameters - */ - QueryParams.prototype.getIndexEndName = function () { - util.assert(this.endSet_, 'Only valid if end has been set'); - if (this.endNameSet_) { - return this.indexEndName_; - } - else { - return MAX_NAME; - } - }; - QueryParams.prototype.hasLimit = function () { - return this.limitSet_; - }; - /** - * @returns True if a limit has been set and it has been explicitly anchored - */ - QueryParams.prototype.hasAnchoredLimit = function () { - return this.limitSet_ && this.viewFrom_ !== ''; - }; - /** - * Only valid to call if hasLimit() returns true - */ - QueryParams.prototype.getLimit = function () { - util.assert(this.limitSet_, 'Only valid if limit has been set'); - return this.limit_; - }; - QueryParams.prototype.getIndex = function () { - return this.index_; - }; - QueryParams.prototype.loadsAllData = function () { - return !(this.startSet_ || this.endSet_ || this.limitSet_); - }; - QueryParams.prototype.isDefault = function () { - return this.loadsAllData() && this.index_ === PRIORITY_INDEX; - }; - QueryParams.prototype.copy = function () { - var copy = new QueryParams(); - copy.limitSet_ = this.limitSet_; - copy.limit_ = this.limit_; - copy.startSet_ = this.startSet_; - copy.indexStartValue_ = this.indexStartValue_; - copy.startNameSet_ = this.startNameSet_; - copy.indexStartName_ = this.indexStartName_; - copy.endSet_ = this.endSet_; - copy.indexEndValue_ = this.indexEndValue_; - copy.endNameSet_ = this.endNameSet_; - copy.indexEndName_ = this.indexEndName_; - copy.index_ = this.index_; - copy.viewFrom_ = this.viewFrom_; - return copy; - }; - return QueryParams; -}()); -function queryParamsGetNodeFilter(queryParams) { - if (queryParams.loadsAllData()) { - return new IndexedFilter(queryParams.getIndex()); - } - else if (queryParams.hasLimit()) { - return new LimitedFilter(queryParams); - } - else { - return new RangedFilter(queryParams); - } -} -function queryParamsLimitToFirst(queryParams, newLimit) { - var newParams = queryParams.copy(); - newParams.limitSet_ = true; - newParams.limit_ = newLimit; - newParams.viewFrom_ = "l" /* VIEW_FROM_LEFT */; - return newParams; -} -function queryParamsLimitToLast(queryParams, newLimit) { - var newParams = queryParams.copy(); - newParams.limitSet_ = true; - newParams.limit_ = newLimit; - newParams.viewFrom_ = "r" /* VIEW_FROM_RIGHT */; - return newParams; -} -function queryParamsStartAt(queryParams, indexValue, key) { - var newParams = queryParams.copy(); - newParams.startSet_ = true; - if (indexValue === undefined) { - indexValue = null; - } - newParams.indexStartValue_ = indexValue; - if (key != null) { - newParams.startNameSet_ = true; - newParams.indexStartName_ = key; - } - else { - newParams.startNameSet_ = false; - newParams.indexStartName_ = ''; - } - return newParams; -} -function queryParamsStartAfter(queryParams, indexValue, key) { - var params; - if (queryParams.index_ === KEY_INDEX) { - if (typeof indexValue === 'string') { - indexValue = successor(indexValue); - } - params = queryParamsStartAt(queryParams, indexValue, key); - } - else { - var childKey = void 0; - if (key == null) { - childKey = MAX_NAME; - } - else { - childKey = successor(key); - } - params = queryParamsStartAt(queryParams, indexValue, childKey); - } - params.startAfterSet_ = true; - return params; -} -function queryParamsEndAt(queryParams, indexValue, key) { - var newParams = queryParams.copy(); - newParams.endSet_ = true; - if (indexValue === undefined) { - indexValue = null; - } - newParams.indexEndValue_ = indexValue; - if (key !== undefined) { - newParams.endNameSet_ = true; - newParams.indexEndName_ = key; - } - else { - newParams.endNameSet_ = false; - newParams.indexEndName_ = ''; - } - return newParams; -} -function queryParamsEndBefore(queryParams, indexValue, key) { - var childKey; - var params; - if (queryParams.index_ === KEY_INDEX) { - if (typeof indexValue === 'string') { - indexValue = predecessor(indexValue); - } - params = queryParamsEndAt(queryParams, indexValue, key); - } - else { - if (key == null) { - childKey = MIN_NAME; - } - else { - childKey = predecessor(key); - } - params = queryParamsEndAt(queryParams, indexValue, childKey); - } - params.endBeforeSet_ = true; - return params; -} -function queryParamsOrderBy(queryParams, index) { - var newParams = queryParams.copy(); - newParams.index_ = index; - return newParams; -} -/** - * Returns a set of REST query string parameters representing this query. - * - * @returns query string parameters - */ -function queryParamsToRestQueryStringParameters(queryParams) { - var qs = {}; - if (queryParams.isDefault()) { - return qs; - } - var orderBy; - if (queryParams.index_ === PRIORITY_INDEX) { - orderBy = "$priority" /* PRIORITY_INDEX */; - } - else if (queryParams.index_ === VALUE_INDEX) { - orderBy = "$value" /* VALUE_INDEX */; - } - else if (queryParams.index_ === KEY_INDEX) { - orderBy = "$key" /* KEY_INDEX */; - } - else { - util.assert(queryParams.index_ instanceof PathIndex, 'Unrecognized index type!'); - orderBy = queryParams.index_.toString(); - } - qs["orderBy" /* ORDER_BY */] = util.stringify(orderBy); - if (queryParams.startSet_) { - qs["startAt" /* START_AT */] = util.stringify(queryParams.indexStartValue_); - if (queryParams.startNameSet_) { - qs["startAt" /* START_AT */] += - ',' + util.stringify(queryParams.indexStartName_); - } - } - if (queryParams.endSet_) { - qs["endAt" /* END_AT */] = util.stringify(queryParams.indexEndValue_); - if (queryParams.endNameSet_) { - qs["endAt" /* END_AT */] += - ',' + util.stringify(queryParams.indexEndName_); - } - } - if (queryParams.limitSet_) { - if (queryParams.isViewFromLeft()) { - qs["limitToFirst" /* LIMIT_TO_FIRST */] = queryParams.limit_; - } - else { - qs["limitToLast" /* LIMIT_TO_LAST */] = queryParams.limit_; - } - } - return qs; -} -function queryParamsGetQueryObject(queryParams) { - var obj = {}; - if (queryParams.startSet_) { - obj["sp" /* INDEX_START_VALUE */] = - queryParams.indexStartValue_; - if (queryParams.startNameSet_) { - obj["sn" /* INDEX_START_NAME */] = - queryParams.indexStartName_; - } - } - if (queryParams.endSet_) { - obj["ep" /* INDEX_END_VALUE */] = queryParams.indexEndValue_; - if (queryParams.endNameSet_) { - obj["en" /* INDEX_END_NAME */] = queryParams.indexEndName_; - } - } - if (queryParams.limitSet_) { - obj["l" /* LIMIT */] = queryParams.limit_; - var viewFrom = queryParams.viewFrom_; - if (viewFrom === '') { - if (queryParams.isViewFromLeft()) { - viewFrom = "l" /* VIEW_FROM_LEFT */; - } - else { - viewFrom = "r" /* VIEW_FROM_RIGHT */; - } - } - obj["vf" /* VIEW_FROM */] = viewFrom; - } - // For now, priority index is the default, so we only specify if it's some other index - if (queryParams.index_ !== PRIORITY_INDEX) { - obj["i" /* INDEX */] = queryParams.index_.toString(); - } - return obj; -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * An implementation of ServerActions that communicates with the server via REST requests. - * This is mostly useful for compatibility with crawlers, where we don't want to spin up a full - * persistent connection (using WebSockets or long-polling) - */ -var ReadonlyRestClient = /** @class */ (function (_super) { - tslib.__extends(ReadonlyRestClient, _super); - /** - * @param repoInfo_ - Data about the namespace we are connecting to - * @param onDataUpdate_ - A callback for new data from the server - */ - function ReadonlyRestClient(repoInfo_, onDataUpdate_, authTokenProvider_, appCheckTokenProvider_) { - var _this = _super.call(this) || this; - _this.repoInfo_ = repoInfo_; - _this.onDataUpdate_ = onDataUpdate_; - _this.authTokenProvider_ = authTokenProvider_; - _this.appCheckTokenProvider_ = appCheckTokenProvider_; - /** @private {function(...[*])} */ - _this.log_ = logWrapper('p:rest:'); - /** - * We don't actually need to track listens, except to prevent us calling an onComplete for a listen - * that's been removed. :-/ - */ - _this.listens_ = {}; - return _this; - } - ReadonlyRestClient.prototype.reportStats = function (stats) { - throw new Error('Method not implemented.'); - }; - ReadonlyRestClient.getListenId_ = function (query, tag) { - if (tag !== undefined) { - return 'tag$' + tag; - } - else { - util.assert(query._queryParams.isDefault(), "should have a tag if it's not a default query."); - return query._path.toString(); - } - }; - /** @inheritDoc */ - ReadonlyRestClient.prototype.listen = function (query, currentHashFn, tag, onComplete) { - var _this = this; - var pathString = query._path.toString(); - this.log_('Listen called for ' + pathString + ' ' + query._queryIdentifier); - // Mark this listener so we can tell if it's removed. - var listenId = ReadonlyRestClient.getListenId_(query, tag); - var thisListen = {}; - this.listens_[listenId] = thisListen; - var queryStringParameters = queryParamsToRestQueryStringParameters(query._queryParams); - this.restRequest_(pathString + '.json', queryStringParameters, function (error, result) { - var data = result; - if (error === 404) { - data = null; - error = null; - } - if (error === null) { - _this.onDataUpdate_(pathString, data, /*isMerge=*/ false, tag); - } - if (util.safeGet(_this.listens_, listenId) === thisListen) { - var status_1; - if (!error) { - status_1 = 'ok'; - } - else if (error === 401) { - status_1 = 'permission_denied'; - } - else { - status_1 = 'rest_error:' + error; - } - onComplete(status_1, null); - } - }); - }; - /** @inheritDoc */ - ReadonlyRestClient.prototype.unlisten = function (query, tag) { - var listenId = ReadonlyRestClient.getListenId_(query, tag); - delete this.listens_[listenId]; - }; - ReadonlyRestClient.prototype.get = function (query) { - var _this = this; - var queryStringParameters = queryParamsToRestQueryStringParameters(query._queryParams); - var pathString = query._path.toString(); - var deferred = new util.Deferred(); - this.restRequest_(pathString + '.json', queryStringParameters, function (error, result) { - var data = result; - if (error === 404) { - data = null; - error = null; - } - if (error === null) { - _this.onDataUpdate_(pathString, data, - /*isMerge=*/ false, - /*tag=*/ null); - deferred.resolve(data); - } - else { - deferred.reject(new Error(data)); - } - }); - return deferred.promise; - }; - /** @inheritDoc */ - ReadonlyRestClient.prototype.refreshAuthToken = function (token) { - // no-op since we just always call getToken. - }; - /** - * Performs a REST request to the given path, with the provided query string parameters, - * and any auth credentials we have. - */ - ReadonlyRestClient.prototype.restRequest_ = function (pathString, queryStringParameters, callback) { - var _this = this; - if (queryStringParameters === void 0) { queryStringParameters = {}; } - queryStringParameters['format'] = 'export'; - return Promise.all([ - this.authTokenProvider_.getToken(/*forceRefresh=*/ false), - this.appCheckTokenProvider_.getToken(/*forceRefresh=*/ false) - ]).then(function (_a) { - var _b = tslib.__read(_a, 2), authToken = _b[0], appCheckToken = _b[1]; - if (authToken && authToken.accessToken) { - queryStringParameters['auth'] = authToken.accessToken; - } - if (appCheckToken && appCheckToken.token) { - queryStringParameters['ac'] = appCheckToken.token; - } - var url = (_this.repoInfo_.secure ? 'https://' : 'http://') + - _this.repoInfo_.host + - pathString + - '?' + - 'ns=' + - _this.repoInfo_.namespace + - util.querystring(queryStringParameters); - _this.log_('Sending REST request for ' + url); - var xhr = new XMLHttpRequest(); - xhr.onreadystatechange = function () { - if (callback && xhr.readyState === 4) { - _this.log_('REST Response for ' + url + ' received. status:', xhr.status, 'response:', xhr.responseText); - var res = null; - if (xhr.status >= 200 && xhr.status < 300) { - try { - res = util.jsonEval(xhr.responseText); - } - catch (e) { - warn('Failed to parse JSON response for ' + - url + - ': ' + - xhr.responseText); - } - callback(null, res); - } - else { - // 401 and 404 are expected. - if (xhr.status !== 401 && xhr.status !== 404) { - warn('Got unsuccessful REST response for ' + - url + - ' Status: ' + - xhr.status); - } - callback(xhr.status); - } - callback = null; - } - }; - xhr.open('GET', url, /*asynchronous=*/ true); - xhr.send(); - }); - }; - return ReadonlyRestClient; -}(ServerActions)); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Mutable object which basically just stores a reference to the "latest" immutable snapshot. - */ -var SnapshotHolder = /** @class */ (function () { - function SnapshotHolder() { - this.rootNode_ = ChildrenNode.EMPTY_NODE; - } - SnapshotHolder.prototype.getNode = function (path) { - return this.rootNode_.getChild(path); - }; - SnapshotHolder.prototype.updateSnapshot = function (path, newSnapshotNode) { - this.rootNode_ = this.rootNode_.updateChild(path, newSnapshotNode); - }; - return SnapshotHolder; -}()); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -function newSparseSnapshotTree() { - return { - value: null, - children: new Map() - }; -} -/** - * Stores the given node at the specified path. If there is already a node - * at a shallower path, it merges the new data into that snapshot node. - * - * @param path - Path to look up snapshot for. - * @param data - The new data, or null. - */ -function sparseSnapshotTreeRemember(sparseSnapshotTree, path, data) { - if (pathIsEmpty(path)) { - sparseSnapshotTree.value = data; - sparseSnapshotTree.children.clear(); - } - else if (sparseSnapshotTree.value !== null) { - sparseSnapshotTree.value = sparseSnapshotTree.value.updateChild(path, data); - } - else { - var childKey = pathGetFront(path); - if (!sparseSnapshotTree.children.has(childKey)) { - sparseSnapshotTree.children.set(childKey, newSparseSnapshotTree()); - } - var child = sparseSnapshotTree.children.get(childKey); - path = pathPopFront(path); - sparseSnapshotTreeRemember(child, path, data); - } -} -/** - * Purge the data at path from the cache. - * - * @param path - Path to look up snapshot for. - * @returns True if this node should now be removed. - */ -function sparseSnapshotTreeForget(sparseSnapshotTree, path) { - if (pathIsEmpty(path)) { - sparseSnapshotTree.value = null; - sparseSnapshotTree.children.clear(); - return true; - } - else { - if (sparseSnapshotTree.value !== null) { - if (sparseSnapshotTree.value.isLeafNode()) { - // We're trying to forget a node that doesn't exist - return false; - } - else { - var value = sparseSnapshotTree.value; - sparseSnapshotTree.value = null; - value.forEachChild(PRIORITY_INDEX, function (key, tree) { - sparseSnapshotTreeRemember(sparseSnapshotTree, new Path(key), tree); - }); - return sparseSnapshotTreeForget(sparseSnapshotTree, path); - } - } - else if (sparseSnapshotTree.children.size > 0) { - var childKey = pathGetFront(path); - path = pathPopFront(path); - if (sparseSnapshotTree.children.has(childKey)) { - var safeToRemove = sparseSnapshotTreeForget(sparseSnapshotTree.children.get(childKey), path); - if (safeToRemove) { - sparseSnapshotTree.children.delete(childKey); - } - } - return sparseSnapshotTree.children.size === 0; - } - else { - return true; - } - } -} -/** - * Recursively iterates through all of the stored tree and calls the - * callback on each one. - * - * @param prefixPath - Path to look up node for. - * @param func - The function to invoke for each tree. - */ -function sparseSnapshotTreeForEachTree(sparseSnapshotTree, prefixPath, func) { - if (sparseSnapshotTree.value !== null) { - func(prefixPath, sparseSnapshotTree.value); - } - else { - sparseSnapshotTreeForEachChild(sparseSnapshotTree, function (key, tree) { - var path = new Path(prefixPath.toString() + '/' + key); - sparseSnapshotTreeForEachTree(tree, path, func); - }); - } -} -/** - * Iterates through each immediate child and triggers the callback. - * Only seems to be used in tests. - * - * @param func - The function to invoke for each child. - */ -function sparseSnapshotTreeForEachChild(sparseSnapshotTree, func) { - sparseSnapshotTree.children.forEach(function (tree, key) { - func(key, tree); - }); -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Returns the delta from the previous call to get stats. - * - * @param collection_ - The collection to "listen" to. - */ -var StatsListener = /** @class */ (function () { - function StatsListener(collection_) { - this.collection_ = collection_; - this.last_ = null; - } - StatsListener.prototype.get = function () { - var newStats = this.collection_.get(); - var delta = tslib.__assign({}, newStats); - if (this.last_) { - each(this.last_, function (stat, value) { - delta[stat] = delta[stat] - value; - }); - } - this.last_ = newStats; - return delta; - }; - return StatsListener; -}()); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Assuming some apps may have a short amount of time on page, and a bulk of firebase operations probably -// happen on page load, we try to report our first set of stats pretty quickly, but we wait at least 10 -// seconds to try to ensure the Firebase connection is established / settled. -var FIRST_STATS_MIN_TIME = 10 * 1000; -var FIRST_STATS_MAX_TIME = 30 * 1000; -// We'll continue to report stats on average every 5 minutes. -var REPORT_STATS_INTERVAL = 5 * 60 * 1000; -var StatsReporter = /** @class */ (function () { - function StatsReporter(collection, server_) { - this.server_ = server_; - this.statsToReport_ = {}; - this.statsListener_ = new StatsListener(collection); - var timeout = FIRST_STATS_MIN_TIME + - (FIRST_STATS_MAX_TIME - FIRST_STATS_MIN_TIME) * Math.random(); - setTimeoutNonBlocking(this.reportStats_.bind(this), Math.floor(timeout)); - } - StatsReporter.prototype.reportStats_ = function () { - var _this = this; - var stats = this.statsListener_.get(); - var reportedStats = {}; - var haveStatsToReport = false; - each(stats, function (stat, value) { - if (value > 0 && util.contains(_this.statsToReport_, stat)) { - reportedStats[stat] = value; - haveStatsToReport = true; - } - }); - if (haveStatsToReport) { - this.server_.reportStats(reportedStats); - } - // queue our next run. - setTimeoutNonBlocking(this.reportStats_.bind(this), Math.floor(Math.random() * 2 * REPORT_STATS_INTERVAL)); - }; - return StatsReporter; -}()); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * - * @enum - */ -var OperationType; -(function (OperationType) { - OperationType[OperationType["OVERWRITE"] = 0] = "OVERWRITE"; - OperationType[OperationType["MERGE"] = 1] = "MERGE"; - OperationType[OperationType["ACK_USER_WRITE"] = 2] = "ACK_USER_WRITE"; - OperationType[OperationType["LISTEN_COMPLETE"] = 3] = "LISTEN_COMPLETE"; -})(OperationType || (OperationType = {})); -function newOperationSourceUser() { - return { - fromUser: true, - fromServer: false, - queryId: null, - tagged: false - }; -} -function newOperationSourceServer() { - return { - fromUser: false, - fromServer: true, - queryId: null, - tagged: false - }; -} -function newOperationSourceServerTaggedQuery(queryId) { - return { - fromUser: false, - fromServer: true, - queryId: queryId, - tagged: true - }; -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var AckUserWrite = /** @class */ (function () { - /** - * @param affectedTree - A tree containing true for each affected path. Affected paths can't overlap. - */ - function AckUserWrite( - /** @inheritDoc */ path, - /** @inheritDoc */ affectedTree, - /** @inheritDoc */ revert) { - this.path = path; - this.affectedTree = affectedTree; - this.revert = revert; - /** @inheritDoc */ - this.type = OperationType.ACK_USER_WRITE; - /** @inheritDoc */ - this.source = newOperationSourceUser(); - } - AckUserWrite.prototype.operationForChild = function (childName) { - if (!pathIsEmpty(this.path)) { - util.assert(pathGetFront(this.path) === childName, 'operationForChild called for unrelated child.'); - return new AckUserWrite(pathPopFront(this.path), this.affectedTree, this.revert); - } - else if (this.affectedTree.value != null) { - util.assert(this.affectedTree.children.isEmpty(), 'affectedTree should not have overlapping affected paths.'); - // All child locations are affected as well; just return same operation. - return this; - } - else { - var childTree = this.affectedTree.subtree(new Path(childName)); - return new AckUserWrite(newEmptyPath(), childTree, this.revert); - } - }; - return AckUserWrite; -}()); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var ListenComplete = /** @class */ (function () { - function ListenComplete(source, path) { - this.source = source; - this.path = path; - /** @inheritDoc */ - this.type = OperationType.LISTEN_COMPLETE; - } - ListenComplete.prototype.operationForChild = function (childName) { - if (pathIsEmpty(this.path)) { - return new ListenComplete(this.source, newEmptyPath()); - } - else { - return new ListenComplete(this.source, pathPopFront(this.path)); - } - }; - return ListenComplete; -}()); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var Overwrite = /** @class */ (function () { - function Overwrite(source, path, snap) { - this.source = source; - this.path = path; - this.snap = snap; - /** @inheritDoc */ - this.type = OperationType.OVERWRITE; - } - Overwrite.prototype.operationForChild = function (childName) { - if (pathIsEmpty(this.path)) { - return new Overwrite(this.source, newEmptyPath(), this.snap.getImmediateChild(childName)); - } - else { - return new Overwrite(this.source, pathPopFront(this.path), this.snap); - } - }; - return Overwrite; -}()); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var Merge = /** @class */ (function () { - function Merge( - /** @inheritDoc */ source, - /** @inheritDoc */ path, - /** @inheritDoc */ children) { - this.source = source; - this.path = path; - this.children = children; - /** @inheritDoc */ - this.type = OperationType.MERGE; - } - Merge.prototype.operationForChild = function (childName) { - if (pathIsEmpty(this.path)) { - var childTree = this.children.subtree(new Path(childName)); - if (childTree.isEmpty()) { - // This child is unaffected - return null; - } - else if (childTree.value) { - // We have a snapshot for the child in question. This becomes an overwrite of the child. - return new Overwrite(this.source, newEmptyPath(), childTree.value); - } - else { - // This is a merge at a deeper level - return new Merge(this.source, newEmptyPath(), childTree); - } - } - else { - util.assert(pathGetFront(this.path) === childName, "Can't get a merge for a child not on the path of the operation"); - return new Merge(this.source, pathPopFront(this.path), this.children); - } - }; - Merge.prototype.toString = function () { - return ('Operation(' + - this.path + - ': ' + - this.source.toString() + - ' merge: ' + - this.children.toString() + - ')'); - }; - return Merge; -}()); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * A cache node only stores complete children. Additionally it holds a flag whether the node can be considered fully - * initialized in the sense that we know at one point in time this represented a valid state of the world, e.g. - * initialized with data from the server, or a complete overwrite by the client. The filtered flag also tracks - * whether a node potentially had children removed due to a filter. - */ -var CacheNode = /** @class */ (function () { - function CacheNode(node_, fullyInitialized_, filtered_) { - this.node_ = node_; - this.fullyInitialized_ = fullyInitialized_; - this.filtered_ = filtered_; - } - /** - * Returns whether this node was fully initialized with either server data or a complete overwrite by the client - */ - CacheNode.prototype.isFullyInitialized = function () { - return this.fullyInitialized_; - }; - /** - * Returns whether this node is potentially missing children due to a filter applied to the node - */ - CacheNode.prototype.isFiltered = function () { - return this.filtered_; - }; - CacheNode.prototype.isCompleteForPath = function (path) { - if (pathIsEmpty(path)) { - return this.isFullyInitialized() && !this.filtered_; - } - var childKey = pathGetFront(path); - return this.isCompleteForChild(childKey); - }; - CacheNode.prototype.isCompleteForChild = function (key) { - return ((this.isFullyInitialized() && !this.filtered_) || this.node_.hasChild(key)); - }; - CacheNode.prototype.getNode = function () { - return this.node_; - }; - return CacheNode; -}()); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * An EventGenerator is used to convert "raw" changes (Change) as computed by the - * CacheDiffer into actual events (Event) that can be raised. See generateEventsForChanges() - * for details. - * - */ -var EventGenerator = /** @class */ (function () { - function EventGenerator(query_) { - this.query_ = query_; - this.index_ = this.query_._queryParams.getIndex(); - } - return EventGenerator; -}()); -/** - * Given a set of raw changes (no moved events and prevName not specified yet), and a set of - * EventRegistrations that should be notified of these changes, generate the actual events to be raised. - * - * Notes: - * - child_moved events will be synthesized at this time for any child_changed events that affect - * our index. - * - prevName will be calculated based on the index ordering. - */ -function eventGeneratorGenerateEventsForChanges(eventGenerator, changes, eventCache, eventRegistrations) { - var events = []; - var moves = []; - changes.forEach(function (change) { - if (change.type === "child_changed" /* CHILD_CHANGED */ && - eventGenerator.index_.indexedValueChanged(change.oldSnap, change.snapshotNode)) { - moves.push(changeChildMoved(change.childName, change.snapshotNode)); - } - }); - eventGeneratorGenerateEventsForType(eventGenerator, events, "child_removed" /* CHILD_REMOVED */, changes, eventRegistrations, eventCache); - eventGeneratorGenerateEventsForType(eventGenerator, events, "child_added" /* CHILD_ADDED */, changes, eventRegistrations, eventCache); - eventGeneratorGenerateEventsForType(eventGenerator, events, "child_moved" /* CHILD_MOVED */, moves, eventRegistrations, eventCache); - eventGeneratorGenerateEventsForType(eventGenerator, events, "child_changed" /* CHILD_CHANGED */, changes, eventRegistrations, eventCache); - eventGeneratorGenerateEventsForType(eventGenerator, events, "value" /* VALUE */, changes, eventRegistrations, eventCache); - return events; -} -/** - * Given changes of a single change type, generate the corresponding events. - */ -function eventGeneratorGenerateEventsForType(eventGenerator, events, eventType, changes, registrations, eventCache) { - var filteredChanges = changes.filter(function (change) { return change.type === eventType; }); - filteredChanges.sort(function (a, b) { - return eventGeneratorCompareChanges(eventGenerator, a, b); - }); - filteredChanges.forEach(function (change) { - var materializedChange = eventGeneratorMaterializeSingleChange(eventGenerator, change, eventCache); - registrations.forEach(function (registration) { - if (registration.respondsTo(change.type)) { - events.push(registration.createEvent(materializedChange, eventGenerator.query_)); - } - }); - }); -} -function eventGeneratorMaterializeSingleChange(eventGenerator, change, eventCache) { - if (change.type === 'value' || change.type === 'child_removed') { - return change; - } - else { - change.prevName = eventCache.getPredecessorChildName(change.childName, change.snapshotNode, eventGenerator.index_); - return change; - } -} -function eventGeneratorCompareChanges(eventGenerator, a, b) { - if (a.childName == null || b.childName == null) { - throw util.assertionError('Should only compare child_ events.'); - } - var aWrapped = new NamedNode(a.childName, a.snapshotNode); - var bWrapped = new NamedNode(b.childName, b.snapshotNode); - return eventGenerator.index_.compare(aWrapped, bWrapped); -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -function newViewCache(eventCache, serverCache) { - return { eventCache: eventCache, serverCache: serverCache }; -} -function viewCacheUpdateEventSnap(viewCache, eventSnap, complete, filtered) { - return newViewCache(new CacheNode(eventSnap, complete, filtered), viewCache.serverCache); -} -function viewCacheUpdateServerSnap(viewCache, serverSnap, complete, filtered) { - return newViewCache(viewCache.eventCache, new CacheNode(serverSnap, complete, filtered)); -} -function viewCacheGetCompleteEventSnap(viewCache) { - return viewCache.eventCache.isFullyInitialized() - ? viewCache.eventCache.getNode() - : null; -} -function viewCacheGetCompleteServerSnap(viewCache) { - return viewCache.serverCache.isFullyInitialized() - ? viewCache.serverCache.getNode() - : null; -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var emptyChildrenSingleton; -/** - * Singleton empty children collection. - * - */ -var EmptyChildren = function () { - if (!emptyChildrenSingleton) { - emptyChildrenSingleton = new SortedMap(stringCompare); - } - return emptyChildrenSingleton; -}; -/** - * A tree with immutable elements. - */ -var ImmutableTree = /** @class */ (function () { - function ImmutableTree(value, children) { - if (children === void 0) { children = EmptyChildren(); } - this.value = value; - this.children = children; - } - ImmutableTree.fromObject = function (obj) { - var tree = new ImmutableTree(null); - each(obj, function (childPath, childSnap) { - tree = tree.set(new Path(childPath), childSnap); - }); - return tree; - }; - /** - * True if the value is empty and there are no children - */ - ImmutableTree.prototype.isEmpty = function () { - return this.value === null && this.children.isEmpty(); - }; - /** - * Given a path and predicate, return the first node and the path to that node - * where the predicate returns true. - * - * TODO Do a perf test -- If we're creating a bunch of `{path: value:}` - * objects on the way back out, it may be better to pass down a pathSoFar obj. - * - * @param relativePath - The remainder of the path - * @param predicate - The predicate to satisfy to return a node - */ - ImmutableTree.prototype.findRootMostMatchingPathAndValue = function (relativePath, predicate) { - if (this.value != null && predicate(this.value)) { - return { path: newEmptyPath(), value: this.value }; - } - else { - if (pathIsEmpty(relativePath)) { - return null; - } - else { - var front = pathGetFront(relativePath); - var child = this.children.get(front); - if (child !== null) { - var childExistingPathAndValue = child.findRootMostMatchingPathAndValue(pathPopFront(relativePath), predicate); - if (childExistingPathAndValue != null) { - var fullPath = pathChild(new Path(front), childExistingPathAndValue.path); - return { path: fullPath, value: childExistingPathAndValue.value }; - } - else { - return null; - } - } - else { - return null; - } - } - } - }; - /** - * Find, if it exists, the shortest subpath of the given path that points a defined - * value in the tree - */ - ImmutableTree.prototype.findRootMostValueAndPath = function (relativePath) { - return this.findRootMostMatchingPathAndValue(relativePath, function () { return true; }); - }; - /** - * @returns The subtree at the given path - */ - ImmutableTree.prototype.subtree = function (relativePath) { - if (pathIsEmpty(relativePath)) { - return this; - } - else { - var front = pathGetFront(relativePath); - var childTree = this.children.get(front); - if (childTree !== null) { - return childTree.subtree(pathPopFront(relativePath)); - } - else { - return new ImmutableTree(null); - } - } - }; - /** - * Sets a value at the specified path. - * - * @param relativePath - Path to set value at. - * @param toSet - Value to set. - * @returns Resulting tree. - */ - ImmutableTree.prototype.set = function (relativePath, toSet) { - if (pathIsEmpty(relativePath)) { - return new ImmutableTree(toSet, this.children); - } - else { - var front = pathGetFront(relativePath); - var child = this.children.get(front) || new ImmutableTree(null); - var newChild = child.set(pathPopFront(relativePath), toSet); - var newChildren = this.children.insert(front, newChild); - return new ImmutableTree(this.value, newChildren); - } - }; - /** - * Removes the value at the specified path. - * - * @param relativePath - Path to value to remove. - * @returns Resulting tree. - */ - ImmutableTree.prototype.remove = function (relativePath) { - if (pathIsEmpty(relativePath)) { - if (this.children.isEmpty()) { - return new ImmutableTree(null); - } - else { - return new ImmutableTree(null, this.children); - } - } - else { - var front = pathGetFront(relativePath); - var child = this.children.get(front); - if (child) { - var newChild = child.remove(pathPopFront(relativePath)); - var newChildren = void 0; - if (newChild.isEmpty()) { - newChildren = this.children.remove(front); - } - else { - newChildren = this.children.insert(front, newChild); - } - if (this.value === null && newChildren.isEmpty()) { - return new ImmutableTree(null); - } - else { - return new ImmutableTree(this.value, newChildren); - } - } - else { - return this; - } - } - }; - /** - * Gets a value from the tree. - * - * @param relativePath - Path to get value for. - * @returns Value at path, or null. - */ - ImmutableTree.prototype.get = function (relativePath) { - if (pathIsEmpty(relativePath)) { - return this.value; - } - else { - var front = pathGetFront(relativePath); - var child = this.children.get(front); - if (child) { - return child.get(pathPopFront(relativePath)); - } - else { - return null; - } - } - }; - /** - * Replace the subtree at the specified path with the given new tree. - * - * @param relativePath - Path to replace subtree for. - * @param newTree - New tree. - * @returns Resulting tree. - */ - ImmutableTree.prototype.setTree = function (relativePath, newTree) { - if (pathIsEmpty(relativePath)) { - return newTree; - } - else { - var front = pathGetFront(relativePath); - var child = this.children.get(front) || new ImmutableTree(null); - var newChild = child.setTree(pathPopFront(relativePath), newTree); - var newChildren = void 0; - if (newChild.isEmpty()) { - newChildren = this.children.remove(front); - } - else { - newChildren = this.children.insert(front, newChild); - } - return new ImmutableTree(this.value, newChildren); - } - }; - /** - * Performs a depth first fold on this tree. Transforms a tree into a single - * value, given a function that operates on the path to a node, an optional - * current value, and a map of child names to folded subtrees - */ - ImmutableTree.prototype.fold = function (fn) { - return this.fold_(newEmptyPath(), fn); - }; - /** - * Recursive helper for public-facing fold() method - */ - ImmutableTree.prototype.fold_ = function (pathSoFar, fn) { - var accum = {}; - this.children.inorderTraversal(function (childKey, childTree) { - accum[childKey] = childTree.fold_(pathChild(pathSoFar, childKey), fn); - }); - return fn(pathSoFar, this.value, accum); - }; - /** - * Find the first matching value on the given path. Return the result of applying f to it. - */ - ImmutableTree.prototype.findOnPath = function (path, f) { - return this.findOnPath_(path, newEmptyPath(), f); - }; - ImmutableTree.prototype.findOnPath_ = function (pathToFollow, pathSoFar, f) { - var result = this.value ? f(pathSoFar, this.value) : false; - if (result) { - return result; - } - else { - if (pathIsEmpty(pathToFollow)) { - return null; - } - else { - var front = pathGetFront(pathToFollow); - var nextChild = this.children.get(front); - if (nextChild) { - return nextChild.findOnPath_(pathPopFront(pathToFollow), pathChild(pathSoFar, front), f); - } - else { - return null; - } - } - } - }; - ImmutableTree.prototype.foreachOnPath = function (path, f) { - return this.foreachOnPath_(path, newEmptyPath(), f); - }; - ImmutableTree.prototype.foreachOnPath_ = function (pathToFollow, currentRelativePath, f) { - if (pathIsEmpty(pathToFollow)) { - return this; - } - else { - if (this.value) { - f(currentRelativePath, this.value); - } - var front = pathGetFront(pathToFollow); - var nextChild = this.children.get(front); - if (nextChild) { - return nextChild.foreachOnPath_(pathPopFront(pathToFollow), pathChild(currentRelativePath, front), f); - } - else { - return new ImmutableTree(null); - } - } - }; - /** - * Calls the given function for each node in the tree that has a value. - * - * @param f - A function to be called with the path from the root of the tree to - * a node, and the value at that node. Called in depth-first order. - */ - ImmutableTree.prototype.foreach = function (f) { - this.foreach_(newEmptyPath(), f); - }; - ImmutableTree.prototype.foreach_ = function (currentRelativePath, f) { - this.children.inorderTraversal(function (childName, childTree) { - childTree.foreach_(pathChild(currentRelativePath, childName), f); - }); - if (this.value) { - f(currentRelativePath, this.value); - } - }; - ImmutableTree.prototype.foreachChild = function (f) { - this.children.inorderTraversal(function (childName, childTree) { - if (childTree.value) { - f(childName, childTree.value); - } - }); - }; - return ImmutableTree; -}()); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * This class holds a collection of writes that can be applied to nodes in unison. It abstracts away the logic with - * dealing with priority writes and multiple nested writes. At any given path there is only allowed to be one write - * modifying that path. Any write to an existing path or shadowing an existing path will modify that existing write - * to reflect the write added. - */ -var CompoundWrite = /** @class */ (function () { - function CompoundWrite(writeTree_) { - this.writeTree_ = writeTree_; - } - CompoundWrite.empty = function () { - return new CompoundWrite(new ImmutableTree(null)); - }; - return CompoundWrite; -}()); -function compoundWriteAddWrite(compoundWrite, path, node) { - if (pathIsEmpty(path)) { - return new CompoundWrite(new ImmutableTree(node)); - } - else { - var rootmost = compoundWrite.writeTree_.findRootMostValueAndPath(path); - if (rootmost != null) { - var rootMostPath = rootmost.path; - var value = rootmost.value; - var relativePath = newRelativePath(rootMostPath, path); - value = value.updateChild(relativePath, node); - return new CompoundWrite(compoundWrite.writeTree_.set(rootMostPath, value)); - } - else { - var subtree = new ImmutableTree(node); - var newWriteTree = compoundWrite.writeTree_.setTree(path, subtree); - return new CompoundWrite(newWriteTree); - } - } -} -function compoundWriteAddWrites(compoundWrite, path, updates) { - var newWrite = compoundWrite; - each(updates, function (childKey, node) { - newWrite = compoundWriteAddWrite(newWrite, pathChild(path, childKey), node); - }); - return newWrite; -} -/** - * Will remove a write at the given path and deeper paths. This will not modify a write at a higher - * location, which must be removed by calling this method with that path. - * - * @param compoundWrite - The CompoundWrite to remove. - * @param path - The path at which a write and all deeper writes should be removed - * @returns The new CompoundWrite with the removed path - */ -function compoundWriteRemoveWrite(compoundWrite, path) { - if (pathIsEmpty(path)) { - return CompoundWrite.empty(); - } - else { - var newWriteTree = compoundWrite.writeTree_.setTree(path, new ImmutableTree(null)); - return new CompoundWrite(newWriteTree); - } -} -/** - * Returns whether this CompoundWrite will fully overwrite a node at a given location and can therefore be - * considered "complete". - * - * @param compoundWrite - The CompoundWrite to check. - * @param path - The path to check for - * @returns Whether there is a complete write at that path - */ -function compoundWriteHasCompleteWrite(compoundWrite, path) { - return compoundWriteGetCompleteNode(compoundWrite, path) != null; -} -/** - * Returns a node for a path if and only if the node is a "complete" overwrite at that path. This will not aggregate - * writes from deeper paths, but will return child nodes from a more shallow path. - * - * @param compoundWrite - The CompoundWrite to get the node from. - * @param path - The path to get a complete write - * @returns The node if complete at that path, or null otherwise. - */ -function compoundWriteGetCompleteNode(compoundWrite, path) { - var rootmost = compoundWrite.writeTree_.findRootMostValueAndPath(path); - if (rootmost != null) { - return compoundWrite.writeTree_ - .get(rootmost.path) - .getChild(newRelativePath(rootmost.path, path)); - } - else { - return null; - } -} -/** - * Returns all children that are guaranteed to be a complete overwrite. - * - * @param compoundWrite - The CompoundWrite to get children from. - * @returns A list of all complete children. - */ -function compoundWriteGetCompleteChildren(compoundWrite) { - var children = []; - var node = compoundWrite.writeTree_.value; - if (node != null) { - // If it's a leaf node, it has no children; so nothing to do. - if (!node.isLeafNode()) { - node.forEachChild(PRIORITY_INDEX, function (childName, childNode) { - children.push(new NamedNode(childName, childNode)); - }); - } - } - else { - compoundWrite.writeTree_.children.inorderTraversal(function (childName, childTree) { - if (childTree.value != null) { - children.push(new NamedNode(childName, childTree.value)); - } - }); - } - return children; -} -function compoundWriteChildCompoundWrite(compoundWrite, path) { - if (pathIsEmpty(path)) { - return compoundWrite; - } - else { - var shadowingNode = compoundWriteGetCompleteNode(compoundWrite, path); - if (shadowingNode != null) { - return new CompoundWrite(new ImmutableTree(shadowingNode)); - } - else { - return new CompoundWrite(compoundWrite.writeTree_.subtree(path)); - } - } -} -/** - * Returns true if this CompoundWrite is empty and therefore does not modify any nodes. - * @returns Whether this CompoundWrite is empty - */ -function compoundWriteIsEmpty(compoundWrite) { - return compoundWrite.writeTree_.isEmpty(); -} -/** - * Applies this CompoundWrite to a node. The node is returned with all writes from this CompoundWrite applied to the - * node - * @param node - The node to apply this CompoundWrite to - * @returns The node with all writes applied - */ -function compoundWriteApply(compoundWrite, node) { - return applySubtreeWrite(newEmptyPath(), compoundWrite.writeTree_, node); -} -function applySubtreeWrite(relativePath, writeTree, node) { - if (writeTree.value != null) { - // Since there a write is always a leaf, we're done here - return node.updateChild(relativePath, writeTree.value); - } - else { - var priorityWrite_1 = null; - writeTree.children.inorderTraversal(function (childKey, childTree) { - if (childKey === '.priority') { - // Apply priorities at the end so we don't update priorities for either empty nodes or forget - // to apply priorities to empty nodes that are later filled - util.assert(childTree.value !== null, 'Priority writes must always be leaf nodes'); - priorityWrite_1 = childTree.value; - } - else { - node = applySubtreeWrite(pathChild(relativePath, childKey), childTree, node); - } - }); - // If there was a priority write, we only apply it if the node is not empty - if (!node.getChild(relativePath).isEmpty() && priorityWrite_1 !== null) { - node = node.updateChild(pathChild(relativePath, '.priority'), priorityWrite_1); - } - return node; - } -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Create a new WriteTreeRef for the given path. For use with a new sync point at the given path. - * - */ -function writeTreeChildWrites(writeTree, path) { - return newWriteTreeRef(path, writeTree); -} -/** - * Record a new overwrite from user code. - * - * @param visible - This is set to false by some transactions. It should be excluded from event caches - */ -function writeTreeAddOverwrite(writeTree, path, snap, writeId, visible) { - util.assert(writeId > writeTree.lastWriteId, 'Stacking an older write on top of newer ones'); - if (visible === undefined) { - visible = true; - } - writeTree.allWrites.push({ - path: path, - snap: snap, - writeId: writeId, - visible: visible - }); - if (visible) { - writeTree.visibleWrites = compoundWriteAddWrite(writeTree.visibleWrites, path, snap); - } - writeTree.lastWriteId = writeId; -} -/** - * Record a new merge from user code. - */ -function writeTreeAddMerge(writeTree, path, changedChildren, writeId) { - util.assert(writeId > writeTree.lastWriteId, 'Stacking an older merge on top of newer ones'); - writeTree.allWrites.push({ - path: path, - children: changedChildren, - writeId: writeId, - visible: true - }); - writeTree.visibleWrites = compoundWriteAddWrites(writeTree.visibleWrites, path, changedChildren); - writeTree.lastWriteId = writeId; -} -function writeTreeGetWrite(writeTree, writeId) { - for (var i = 0; i < writeTree.allWrites.length; i++) { - var record = writeTree.allWrites[i]; - if (record.writeId === writeId) { - return record; - } - } - return null; -} -/** - * Remove a write (either an overwrite or merge) that has been successfully acknowledge by the server. Recalculates - * the tree if necessary. We return true if it may have been visible, meaning views need to reevaluate. - * - * @returns true if the write may have been visible (meaning we'll need to reevaluate / raise - * events as a result). - */ -function writeTreeRemoveWrite(writeTree, writeId) { - // Note: disabling this check. It could be a transaction that preempted another transaction, and thus was applied - // out of order. - //const validClear = revert || this.allWrites_.length === 0 || writeId <= this.allWrites_[0].writeId; - //assert(validClear, "Either we don't have this write, or it's the first one in the queue"); - var idx = writeTree.allWrites.findIndex(function (s) { - return s.writeId === writeId; - }); - util.assert(idx >= 0, 'removeWrite called with nonexistent writeId.'); - var writeToRemove = writeTree.allWrites[idx]; - writeTree.allWrites.splice(idx, 1); - var removedWriteWasVisible = writeToRemove.visible; - var removedWriteOverlapsWithOtherWrites = false; - var i = writeTree.allWrites.length - 1; - while (removedWriteWasVisible && i >= 0) { - var currentWrite = writeTree.allWrites[i]; - if (currentWrite.visible) { - if (i >= idx && - writeTreeRecordContainsPath_(currentWrite, writeToRemove.path)) { - // The removed write was completely shadowed by a subsequent write. - removedWriteWasVisible = false; - } - else if (pathContains(writeToRemove.path, currentWrite.path)) { - // Either we're covering some writes or they're covering part of us (depending on which came first). - removedWriteOverlapsWithOtherWrites = true; - } - } - i--; - } - if (!removedWriteWasVisible) { - return false; - } - else if (removedWriteOverlapsWithOtherWrites) { - // There's some shadowing going on. Just rebuild the visible writes from scratch. - writeTreeResetTree_(writeTree); - return true; - } - else { - // There's no shadowing. We can safely just remove the write(s) from visibleWrites. - if (writeToRemove.snap) { - writeTree.visibleWrites = compoundWriteRemoveWrite(writeTree.visibleWrites, writeToRemove.path); - } - else { - var children = writeToRemove.children; - each(children, function (childName) { - writeTree.visibleWrites = compoundWriteRemoveWrite(writeTree.visibleWrites, pathChild(writeToRemove.path, childName)); - }); - } - return true; - } -} -function writeTreeRecordContainsPath_(writeRecord, path) { - if (writeRecord.snap) { - return pathContains(writeRecord.path, path); - } - else { - for (var childName in writeRecord.children) { - if (writeRecord.children.hasOwnProperty(childName) && - pathContains(pathChild(writeRecord.path, childName), path)) { - return true; - } - } - return false; - } -} -/** - * Re-layer the writes and merges into a tree so we can efficiently calculate event snapshots - */ -function writeTreeResetTree_(writeTree) { - writeTree.visibleWrites = writeTreeLayerTree_(writeTree.allWrites, writeTreeDefaultFilter_, newEmptyPath()); - if (writeTree.allWrites.length > 0) { - writeTree.lastWriteId = - writeTree.allWrites[writeTree.allWrites.length - 1].writeId; - } - else { - writeTree.lastWriteId = -1; - } -} -/** - * The default filter used when constructing the tree. Keep everything that's visible. - */ -function writeTreeDefaultFilter_(write) { - return write.visible; -} -/** - * Static method. Given an array of WriteRecords, a filter for which ones to include, and a path, construct the tree of - * event data at that path. - */ -function writeTreeLayerTree_(writes, filter, treeRoot) { - var compoundWrite = CompoundWrite.empty(); - for (var i = 0; i < writes.length; ++i) { - var write = writes[i]; - // Theory, a later set will either: - // a) abort a relevant transaction, so no need to worry about excluding it from calculating that transaction - // b) not be relevant to a transaction (separate branch), so again will not affect the data for that transaction - if (filter(write)) { - var writePath = write.path; - var relativePath = void 0; - if (write.snap) { - if (pathContains(treeRoot, writePath)) { - relativePath = newRelativePath(treeRoot, writePath); - compoundWrite = compoundWriteAddWrite(compoundWrite, relativePath, write.snap); - } - else if (pathContains(writePath, treeRoot)) { - relativePath = newRelativePath(writePath, treeRoot); - compoundWrite = compoundWriteAddWrite(compoundWrite, newEmptyPath(), write.snap.getChild(relativePath)); - } - else ; - } - else if (write.children) { - if (pathContains(treeRoot, writePath)) { - relativePath = newRelativePath(treeRoot, writePath); - compoundWrite = compoundWriteAddWrites(compoundWrite, relativePath, write.children); - } - else if (pathContains(writePath, treeRoot)) { - relativePath = newRelativePath(writePath, treeRoot); - if (pathIsEmpty(relativePath)) { - compoundWrite = compoundWriteAddWrites(compoundWrite, newEmptyPath(), write.children); - } - else { - var child = util.safeGet(write.children, pathGetFront(relativePath)); - if (child) { - // There exists a child in this node that matches the root path - var deepNode = child.getChild(pathPopFront(relativePath)); - compoundWrite = compoundWriteAddWrite(compoundWrite, newEmptyPath(), deepNode); - } - } - } - else ; - } - else { - throw util.assertionError('WriteRecord should have .snap or .children'); - } - } - } - return compoundWrite; -} -/** - * Given optional, underlying server data, and an optional set of constraints (exclude some sets, include hidden - * writes), attempt to calculate a complete snapshot for the given path - * - * @param writeIdsToExclude - An optional set to be excluded - * @param includeHiddenWrites - Defaults to false, whether or not to layer on writes with visible set to false - */ -function writeTreeCalcCompleteEventCache(writeTree, treePath, completeServerCache, writeIdsToExclude, includeHiddenWrites) { - if (!writeIdsToExclude && !includeHiddenWrites) { - var shadowingNode = compoundWriteGetCompleteNode(writeTree.visibleWrites, treePath); - if (shadowingNode != null) { - return shadowingNode; - } - else { - var subMerge = compoundWriteChildCompoundWrite(writeTree.visibleWrites, treePath); - if (compoundWriteIsEmpty(subMerge)) { - return completeServerCache; - } - else if (completeServerCache == null && - !compoundWriteHasCompleteWrite(subMerge, newEmptyPath())) { - // We wouldn't have a complete snapshot, since there's no underlying data and no complete shadow - return null; - } - else { - var layeredCache = completeServerCache || ChildrenNode.EMPTY_NODE; - return compoundWriteApply(subMerge, layeredCache); - } - } - } - else { - var merge = compoundWriteChildCompoundWrite(writeTree.visibleWrites, treePath); - if (!includeHiddenWrites && compoundWriteIsEmpty(merge)) { - return completeServerCache; - } - else { - // If the server cache is null, and we don't have a complete cache, we need to return null - if (!includeHiddenWrites && - completeServerCache == null && - !compoundWriteHasCompleteWrite(merge, newEmptyPath())) { - return null; - } - else { - var filter = function (write) { - return ((write.visible || includeHiddenWrites) && - (!writeIdsToExclude || - !~writeIdsToExclude.indexOf(write.writeId)) && - (pathContains(write.path, treePath) || - pathContains(treePath, write.path))); - }; - var mergeAtPath = writeTreeLayerTree_(writeTree.allWrites, filter, treePath); - var layeredCache = completeServerCache || ChildrenNode.EMPTY_NODE; - return compoundWriteApply(mergeAtPath, layeredCache); - } - } - } -} -/** - * With optional, underlying server data, attempt to return a children node of children that we have complete data for. - * Used when creating new views, to pre-fill their complete event children snapshot. - */ -function writeTreeCalcCompleteEventChildren(writeTree, treePath, completeServerChildren) { - var completeChildren = ChildrenNode.EMPTY_NODE; - var topLevelSet = compoundWriteGetCompleteNode(writeTree.visibleWrites, treePath); - if (topLevelSet) { - if (!topLevelSet.isLeafNode()) { - // we're shadowing everything. Return the children. - topLevelSet.forEachChild(PRIORITY_INDEX, function (childName, childSnap) { - completeChildren = completeChildren.updateImmediateChild(childName, childSnap); - }); - } - return completeChildren; - } - else if (completeServerChildren) { - // Layer any children we have on top of this - // We know we don't have a top-level set, so just enumerate existing children - var merge_1 = compoundWriteChildCompoundWrite(writeTree.visibleWrites, treePath); - completeServerChildren.forEachChild(PRIORITY_INDEX, function (childName, childNode) { - var node = compoundWriteApply(compoundWriteChildCompoundWrite(merge_1, new Path(childName)), childNode); - completeChildren = completeChildren.updateImmediateChild(childName, node); - }); - // Add any complete children we have from the set - compoundWriteGetCompleteChildren(merge_1).forEach(function (namedNode) { - completeChildren = completeChildren.updateImmediateChild(namedNode.name, namedNode.node); - }); - return completeChildren; - } - else { - // We don't have anything to layer on top of. Layer on any children we have - // Note that we can return an empty snap if we have a defined delete - var merge = compoundWriteChildCompoundWrite(writeTree.visibleWrites, treePath); - compoundWriteGetCompleteChildren(merge).forEach(function (namedNode) { - completeChildren = completeChildren.updateImmediateChild(namedNode.name, namedNode.node); - }); - return completeChildren; - } -} -/** - * Given that the underlying server data has updated, determine what, if anything, needs to be - * applied to the event cache. - * - * Possibilities: - * - * 1. No writes are shadowing. Events should be raised, the snap to be applied comes from the server data - * - * 2. Some write is completely shadowing. No events to be raised - * - * 3. Is partially shadowed. Events - * - * Either existingEventSnap or existingServerSnap must exist - */ -function writeTreeCalcEventCacheAfterServerOverwrite(writeTree, treePath, childPath, existingEventSnap, existingServerSnap) { - util.assert(existingEventSnap || existingServerSnap, 'Either existingEventSnap or existingServerSnap must exist'); - var path = pathChild(treePath, childPath); - if (compoundWriteHasCompleteWrite(writeTree.visibleWrites, path)) { - // At this point we can probably guarantee that we're in case 2, meaning no events - // May need to check visibility while doing the findRootMostValueAndPath call - return null; - } - else { - // No complete shadowing. We're either partially shadowing or not shadowing at all. - var childMerge = compoundWriteChildCompoundWrite(writeTree.visibleWrites, path); - if (compoundWriteIsEmpty(childMerge)) { - // We're not shadowing at all. Case 1 - return existingServerSnap.getChild(childPath); - } - else { - // This could be more efficient if the serverNode + updates doesn't change the eventSnap - // However this is tricky to find out, since user updates don't necessary change the server - // snap, e.g. priority updates on empty nodes, or deep deletes. Another special case is if the server - // adds nodes, but doesn't change any existing writes. It is therefore not enough to - // only check if the updates change the serverNode. - // Maybe check if the merge tree contains these special cases and only do a full overwrite in that case? - return compoundWriteApply(childMerge, existingServerSnap.getChild(childPath)); - } - } -} -/** - * Returns a complete child for a given server snap after applying all user writes or null if there is no - * complete child for this ChildKey. - */ -function writeTreeCalcCompleteChild(writeTree, treePath, childKey, existingServerSnap) { - var path = pathChild(treePath, childKey); - var shadowingNode = compoundWriteGetCompleteNode(writeTree.visibleWrites, path); - if (shadowingNode != null) { - return shadowingNode; - } - else { - if (existingServerSnap.isCompleteForChild(childKey)) { - var childMerge = compoundWriteChildCompoundWrite(writeTree.visibleWrites, path); - return compoundWriteApply(childMerge, existingServerSnap.getNode().getImmediateChild(childKey)); - } - else { - return null; - } - } -} -/** - * Returns a node if there is a complete overwrite for this path. More specifically, if there is a write at - * a higher path, this will return the child of that write relative to the write and this path. - * Returns null if there is no write at this path. - */ -function writeTreeShadowingWrite(writeTree, path) { - return compoundWriteGetCompleteNode(writeTree.visibleWrites, path); -} -/** - * This method is used when processing child remove events on a query. If we can, we pull in children that were outside - * the window, but may now be in the window. - */ -function writeTreeCalcIndexedSlice(writeTree, treePath, completeServerData, startPost, count, reverse, index) { - var toIterate; - var merge = compoundWriteChildCompoundWrite(writeTree.visibleWrites, treePath); - var shadowingNode = compoundWriteGetCompleteNode(merge, newEmptyPath()); - if (shadowingNode != null) { - toIterate = shadowingNode; - } - else if (completeServerData != null) { - toIterate = compoundWriteApply(merge, completeServerData); - } - else { - // no children to iterate on - return []; - } - toIterate = toIterate.withIndex(index); - if (!toIterate.isEmpty() && !toIterate.isLeafNode()) { - var nodes = []; - var cmp = index.getCompare(); - var iter = reverse - ? toIterate.getReverseIteratorFrom(startPost, index) - : toIterate.getIteratorFrom(startPost, index); - var next = iter.getNext(); - while (next && nodes.length < count) { - if (cmp(next, startPost) !== 0) { - nodes.push(next); - } - next = iter.getNext(); - } - return nodes; - } - else { - return []; - } -} -function newWriteTree() { - return { - visibleWrites: CompoundWrite.empty(), - allWrites: [], - lastWriteId: -1 - }; -} -/** - * If possible, returns a complete event cache, using the underlying server data if possible. In addition, can be used - * to get a cache that includes hidden writes, and excludes arbitrary writes. Note that customizing the returned node - * can lead to a more expensive calculation. - * - * @param writeIdsToExclude - Optional writes to exclude. - * @param includeHiddenWrites - Defaults to false, whether or not to layer on writes with visible set to false - */ -function writeTreeRefCalcCompleteEventCache(writeTreeRef, completeServerCache, writeIdsToExclude, includeHiddenWrites) { - return writeTreeCalcCompleteEventCache(writeTreeRef.writeTree, writeTreeRef.treePath, completeServerCache, writeIdsToExclude, includeHiddenWrites); -} -/** - * If possible, returns a children node containing all of the complete children we have data for. The returned data is a - * mix of the given server data and write data. - * - */ -function writeTreeRefCalcCompleteEventChildren(writeTreeRef, completeServerChildren) { - return writeTreeCalcCompleteEventChildren(writeTreeRef.writeTree, writeTreeRef.treePath, completeServerChildren); -} -/** - * Given that either the underlying server data has updated or the outstanding writes have updated, determine what, - * if anything, needs to be applied to the event cache. - * - * Possibilities: - * - * 1. No writes are shadowing. Events should be raised, the snap to be applied comes from the server data - * - * 2. Some write is completely shadowing. No events to be raised - * - * 3. Is partially shadowed. Events should be raised - * - * Either existingEventSnap or existingServerSnap must exist, this is validated via an assert - * - * - */ -function writeTreeRefCalcEventCacheAfterServerOverwrite(writeTreeRef, path, existingEventSnap, existingServerSnap) { - return writeTreeCalcEventCacheAfterServerOverwrite(writeTreeRef.writeTree, writeTreeRef.treePath, path, existingEventSnap, existingServerSnap); -} -/** - * Returns a node if there is a complete overwrite for this path. More specifically, if there is a write at - * a higher path, this will return the child of that write relative to the write and this path. - * Returns null if there is no write at this path. - * - */ -function writeTreeRefShadowingWrite(writeTreeRef, path) { - return writeTreeShadowingWrite(writeTreeRef.writeTree, pathChild(writeTreeRef.treePath, path)); -} -/** - * This method is used when processing child remove events on a query. If we can, we pull in children that were outside - * the window, but may now be in the window - */ -function writeTreeRefCalcIndexedSlice(writeTreeRef, completeServerData, startPost, count, reverse, index) { - return writeTreeCalcIndexedSlice(writeTreeRef.writeTree, writeTreeRef.treePath, completeServerData, startPost, count, reverse, index); -} -/** - * Returns a complete child for a given server snap after applying all user writes or null if there is no - * complete child for this ChildKey. - */ -function writeTreeRefCalcCompleteChild(writeTreeRef, childKey, existingServerCache) { - return writeTreeCalcCompleteChild(writeTreeRef.writeTree, writeTreeRef.treePath, childKey, existingServerCache); -} -/** - * Return a WriteTreeRef for a child. - */ -function writeTreeRefChild(writeTreeRef, childName) { - return newWriteTreeRef(pathChild(writeTreeRef.treePath, childName), writeTreeRef.writeTree); -} -function newWriteTreeRef(path, writeTree) { - return { - treePath: path, - writeTree: writeTree - }; -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var ChildChangeAccumulator = /** @class */ (function () { - function ChildChangeAccumulator() { - this.changeMap = new Map(); - } - ChildChangeAccumulator.prototype.trackChildChange = function (change) { - var type = change.type; - var childKey = change.childName; - util.assert(type === "child_added" /* CHILD_ADDED */ || - type === "child_changed" /* CHILD_CHANGED */ || - type === "child_removed" /* CHILD_REMOVED */, 'Only child changes supported for tracking'); - util.assert(childKey !== '.priority', 'Only non-priority child changes can be tracked.'); - var oldChange = this.changeMap.get(childKey); - if (oldChange) { - var oldType = oldChange.type; - if (type === "child_added" /* CHILD_ADDED */ && - oldType === "child_removed" /* CHILD_REMOVED */) { - this.changeMap.set(childKey, changeChildChanged(childKey, change.snapshotNode, oldChange.snapshotNode)); - } - else if (type === "child_removed" /* CHILD_REMOVED */ && - oldType === "child_added" /* CHILD_ADDED */) { - this.changeMap.delete(childKey); - } - else if (type === "child_removed" /* CHILD_REMOVED */ && - oldType === "child_changed" /* CHILD_CHANGED */) { - this.changeMap.set(childKey, changeChildRemoved(childKey, oldChange.oldSnap)); - } - else if (type === "child_changed" /* CHILD_CHANGED */ && - oldType === "child_added" /* CHILD_ADDED */) { - this.changeMap.set(childKey, changeChildAdded(childKey, change.snapshotNode)); - } - else if (type === "child_changed" /* CHILD_CHANGED */ && - oldType === "child_changed" /* CHILD_CHANGED */) { - this.changeMap.set(childKey, changeChildChanged(childKey, change.snapshotNode, oldChange.oldSnap)); - } - else { - throw util.assertionError('Illegal combination of changes: ' + - change + - ' occurred after ' + - oldChange); - } - } - else { - this.changeMap.set(childKey, change); - } - }; - ChildChangeAccumulator.prototype.getChanges = function () { - return Array.from(this.changeMap.values()); - }; - return ChildChangeAccumulator; -}()); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * An implementation of CompleteChildSource that never returns any additional children - */ -// eslint-disable-next-line @typescript-eslint/naming-convention -var NoCompleteChildSource_ = /** @class */ (function () { - function NoCompleteChildSource_() { - } - NoCompleteChildSource_.prototype.getCompleteChild = function (childKey) { - return null; - }; - NoCompleteChildSource_.prototype.getChildAfterChild = function (index, child, reverse) { - return null; - }; - return NoCompleteChildSource_; -}()); -/** - * Singleton instance. - */ -var NO_COMPLETE_CHILD_SOURCE = new NoCompleteChildSource_(); -/** - * An implementation of CompleteChildSource that uses a WriteTree in addition to any other server data or - * old event caches available to calculate complete children. - */ -var WriteTreeCompleteChildSource = /** @class */ (function () { - function WriteTreeCompleteChildSource(writes_, viewCache_, optCompleteServerCache_) { - if (optCompleteServerCache_ === void 0) { optCompleteServerCache_ = null; } - this.writes_ = writes_; - this.viewCache_ = viewCache_; - this.optCompleteServerCache_ = optCompleteServerCache_; - } - WriteTreeCompleteChildSource.prototype.getCompleteChild = function (childKey) { - var node = this.viewCache_.eventCache; - if (node.isCompleteForChild(childKey)) { - return node.getNode().getImmediateChild(childKey); - } - else { - var serverNode = this.optCompleteServerCache_ != null - ? new CacheNode(this.optCompleteServerCache_, true, false) - : this.viewCache_.serverCache; - return writeTreeRefCalcCompleteChild(this.writes_, childKey, serverNode); - } - }; - WriteTreeCompleteChildSource.prototype.getChildAfterChild = function (index, child, reverse) { - var completeServerData = this.optCompleteServerCache_ != null - ? this.optCompleteServerCache_ - : viewCacheGetCompleteServerSnap(this.viewCache_); - var nodes = writeTreeRefCalcIndexedSlice(this.writes_, completeServerData, child, 1, reverse, index); - if (nodes.length === 0) { - return null; - } - else { - return nodes[0]; - } - }; - return WriteTreeCompleteChildSource; -}()); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -function newViewProcessor(filter) { - return { filter: filter }; -} -function viewProcessorAssertIndexed(viewProcessor, viewCache) { - util.assert(viewCache.eventCache.getNode().isIndexed(viewProcessor.filter.getIndex()), 'Event snap not indexed'); - util.assert(viewCache.serverCache.getNode().isIndexed(viewProcessor.filter.getIndex()), 'Server snap not indexed'); -} -function viewProcessorApplyOperation(viewProcessor, oldViewCache, operation, writesCache, completeCache) { - var accumulator = new ChildChangeAccumulator(); - var newViewCache, filterServerNode; - if (operation.type === OperationType.OVERWRITE) { - var overwrite = operation; - if (overwrite.source.fromUser) { - newViewCache = viewProcessorApplyUserOverwrite(viewProcessor, oldViewCache, overwrite.path, overwrite.snap, writesCache, completeCache, accumulator); - } - else { - util.assert(overwrite.source.fromServer, 'Unknown source.'); - // We filter the node if it's a tagged update or the node has been previously filtered and the - // update is not at the root in which case it is ok (and necessary) to mark the node unfiltered - // again - filterServerNode = - overwrite.source.tagged || - (oldViewCache.serverCache.isFiltered() && !pathIsEmpty(overwrite.path)); - newViewCache = viewProcessorApplyServerOverwrite(viewProcessor, oldViewCache, overwrite.path, overwrite.snap, writesCache, completeCache, filterServerNode, accumulator); - } - } - else if (operation.type === OperationType.MERGE) { - var merge = operation; - if (merge.source.fromUser) { - newViewCache = viewProcessorApplyUserMerge(viewProcessor, oldViewCache, merge.path, merge.children, writesCache, completeCache, accumulator); - } - else { - util.assert(merge.source.fromServer, 'Unknown source.'); - // We filter the node if it's a tagged update or the node has been previously filtered - filterServerNode = - merge.source.tagged || oldViewCache.serverCache.isFiltered(); - newViewCache = viewProcessorApplyServerMerge(viewProcessor, oldViewCache, merge.path, merge.children, writesCache, completeCache, filterServerNode, accumulator); - } - } - else if (operation.type === OperationType.ACK_USER_WRITE) { - var ackUserWrite = operation; - if (!ackUserWrite.revert) { - newViewCache = viewProcessorAckUserWrite(viewProcessor, oldViewCache, ackUserWrite.path, ackUserWrite.affectedTree, writesCache, completeCache, accumulator); - } - else { - newViewCache = viewProcessorRevertUserWrite(viewProcessor, oldViewCache, ackUserWrite.path, writesCache, completeCache, accumulator); - } - } - else if (operation.type === OperationType.LISTEN_COMPLETE) { - newViewCache = viewProcessorListenComplete(viewProcessor, oldViewCache, operation.path, writesCache, accumulator); - } - else { - throw util.assertionError('Unknown operation type: ' + operation.type); - } - var changes = accumulator.getChanges(); - viewProcessorMaybeAddValueEvent(oldViewCache, newViewCache, changes); - return { viewCache: newViewCache, changes: changes }; -} -function viewProcessorMaybeAddValueEvent(oldViewCache, newViewCache, accumulator) { - var eventSnap = newViewCache.eventCache; - if (eventSnap.isFullyInitialized()) { - var isLeafOrEmpty = eventSnap.getNode().isLeafNode() || eventSnap.getNode().isEmpty(); - var oldCompleteSnap = viewCacheGetCompleteEventSnap(oldViewCache); - if (accumulator.length > 0 || - !oldViewCache.eventCache.isFullyInitialized() || - (isLeafOrEmpty && !eventSnap.getNode().equals(oldCompleteSnap)) || - !eventSnap.getNode().getPriority().equals(oldCompleteSnap.getPriority())) { - accumulator.push(changeValue(viewCacheGetCompleteEventSnap(newViewCache))); - } - } -} -function viewProcessorGenerateEventCacheAfterServerEvent(viewProcessor, viewCache, changePath, writesCache, source, accumulator) { - var oldEventSnap = viewCache.eventCache; - if (writeTreeRefShadowingWrite(writesCache, changePath) != null) { - // we have a shadowing write, ignore changes - return viewCache; - } - else { - var newEventCache = void 0, serverNode = void 0; - if (pathIsEmpty(changePath)) { - // TODO: figure out how this plays with "sliding ack windows" - util.assert(viewCache.serverCache.isFullyInitialized(), 'If change path is empty, we must have complete server data'); - if (viewCache.serverCache.isFiltered()) { - // We need to special case this, because we need to only apply writes to complete children, or - // we might end up raising events for incomplete children. If the server data is filtered deep - // writes cannot be guaranteed to be complete - var serverCache = viewCacheGetCompleteServerSnap(viewCache); - var completeChildren = serverCache instanceof ChildrenNode - ? serverCache - : ChildrenNode.EMPTY_NODE; - var completeEventChildren = writeTreeRefCalcCompleteEventChildren(writesCache, completeChildren); - newEventCache = viewProcessor.filter.updateFullNode(viewCache.eventCache.getNode(), completeEventChildren, accumulator); - } - else { - var completeNode = writeTreeRefCalcCompleteEventCache(writesCache, viewCacheGetCompleteServerSnap(viewCache)); - newEventCache = viewProcessor.filter.updateFullNode(viewCache.eventCache.getNode(), completeNode, accumulator); - } - } - else { - var childKey = pathGetFront(changePath); - if (childKey === '.priority') { - util.assert(pathGetLength(changePath) === 1, "Can't have a priority with additional path components"); - var oldEventNode = oldEventSnap.getNode(); - serverNode = viewCache.serverCache.getNode(); - // we might have overwrites for this priority - var updatedPriority = writeTreeRefCalcEventCacheAfterServerOverwrite(writesCache, changePath, oldEventNode, serverNode); - if (updatedPriority != null) { - newEventCache = viewProcessor.filter.updatePriority(oldEventNode, updatedPriority); - } - else { - // priority didn't change, keep old node - newEventCache = oldEventSnap.getNode(); - } - } - else { - var childChangePath = pathPopFront(changePath); - // update child - var newEventChild = void 0; - if (oldEventSnap.isCompleteForChild(childKey)) { - serverNode = viewCache.serverCache.getNode(); - var eventChildUpdate = writeTreeRefCalcEventCacheAfterServerOverwrite(writesCache, changePath, oldEventSnap.getNode(), serverNode); - if (eventChildUpdate != null) { - newEventChild = oldEventSnap - .getNode() - .getImmediateChild(childKey) - .updateChild(childChangePath, eventChildUpdate); - } - else { - // Nothing changed, just keep the old child - newEventChild = oldEventSnap.getNode().getImmediateChild(childKey); - } - } - else { - newEventChild = writeTreeRefCalcCompleteChild(writesCache, childKey, viewCache.serverCache); - } - if (newEventChild != null) { - newEventCache = viewProcessor.filter.updateChild(oldEventSnap.getNode(), childKey, newEventChild, childChangePath, source, accumulator); - } - else { - // no complete child available or no change - newEventCache = oldEventSnap.getNode(); - } - } - } - return viewCacheUpdateEventSnap(viewCache, newEventCache, oldEventSnap.isFullyInitialized() || pathIsEmpty(changePath), viewProcessor.filter.filtersNodes()); - } -} -function viewProcessorApplyServerOverwrite(viewProcessor, oldViewCache, changePath, changedSnap, writesCache, completeCache, filterServerNode, accumulator) { - var oldServerSnap = oldViewCache.serverCache; - var newServerCache; - var serverFilter = filterServerNode - ? viewProcessor.filter - : viewProcessor.filter.getIndexedFilter(); - if (pathIsEmpty(changePath)) { - newServerCache = serverFilter.updateFullNode(oldServerSnap.getNode(), changedSnap, null); - } - else if (serverFilter.filtersNodes() && !oldServerSnap.isFiltered()) { - // we want to filter the server node, but we didn't filter the server node yet, so simulate a full update - var newServerNode = oldServerSnap - .getNode() - .updateChild(changePath, changedSnap); - newServerCache = serverFilter.updateFullNode(oldServerSnap.getNode(), newServerNode, null); - } - else { - var childKey = pathGetFront(changePath); - if (!oldServerSnap.isCompleteForPath(changePath) && - pathGetLength(changePath) > 1) { - // We don't update incomplete nodes with updates intended for other listeners - return oldViewCache; - } - var childChangePath = pathPopFront(changePath); - var childNode = oldServerSnap.getNode().getImmediateChild(childKey); - var newChildNode = childNode.updateChild(childChangePath, changedSnap); - if (childKey === '.priority') { - newServerCache = serverFilter.updatePriority(oldServerSnap.getNode(), newChildNode); - } - else { - newServerCache = serverFilter.updateChild(oldServerSnap.getNode(), childKey, newChildNode, childChangePath, NO_COMPLETE_CHILD_SOURCE, null); - } - } - var newViewCache = viewCacheUpdateServerSnap(oldViewCache, newServerCache, oldServerSnap.isFullyInitialized() || pathIsEmpty(changePath), serverFilter.filtersNodes()); - var source = new WriteTreeCompleteChildSource(writesCache, newViewCache, completeCache); - return viewProcessorGenerateEventCacheAfterServerEvent(viewProcessor, newViewCache, changePath, writesCache, source, accumulator); -} -function viewProcessorApplyUserOverwrite(viewProcessor, oldViewCache, changePath, changedSnap, writesCache, completeCache, accumulator) { - var oldEventSnap = oldViewCache.eventCache; - var newViewCache, newEventCache; - var source = new WriteTreeCompleteChildSource(writesCache, oldViewCache, completeCache); - if (pathIsEmpty(changePath)) { - newEventCache = viewProcessor.filter.updateFullNode(oldViewCache.eventCache.getNode(), changedSnap, accumulator); - newViewCache = viewCacheUpdateEventSnap(oldViewCache, newEventCache, true, viewProcessor.filter.filtersNodes()); - } - else { - var childKey = pathGetFront(changePath); - if (childKey === '.priority') { - newEventCache = viewProcessor.filter.updatePriority(oldViewCache.eventCache.getNode(), changedSnap); - newViewCache = viewCacheUpdateEventSnap(oldViewCache, newEventCache, oldEventSnap.isFullyInitialized(), oldEventSnap.isFiltered()); - } - else { - var childChangePath = pathPopFront(changePath); - var oldChild = oldEventSnap.getNode().getImmediateChild(childKey); - var newChild = void 0; - if (pathIsEmpty(childChangePath)) { - // Child overwrite, we can replace the child - newChild = changedSnap; - } - else { - var childNode = source.getCompleteChild(childKey); - if (childNode != null) { - if (pathGetBack(childChangePath) === '.priority' && - childNode.getChild(pathParent(childChangePath)).isEmpty()) { - // This is a priority update on an empty node. If this node exists on the server, the - // server will send down the priority in the update, so ignore for now - newChild = childNode; - } - else { - newChild = childNode.updateChild(childChangePath, changedSnap); - } - } - else { - // There is no complete child node available - newChild = ChildrenNode.EMPTY_NODE; - } - } - if (!oldChild.equals(newChild)) { - var newEventSnap = viewProcessor.filter.updateChild(oldEventSnap.getNode(), childKey, newChild, childChangePath, source, accumulator); - newViewCache = viewCacheUpdateEventSnap(oldViewCache, newEventSnap, oldEventSnap.isFullyInitialized(), viewProcessor.filter.filtersNodes()); - } - else { - newViewCache = oldViewCache; - } - } - } - return newViewCache; -} -function viewProcessorCacheHasChild(viewCache, childKey) { - return viewCache.eventCache.isCompleteForChild(childKey); -} -function viewProcessorApplyUserMerge(viewProcessor, viewCache, path, changedChildren, writesCache, serverCache, accumulator) { - // HACK: In the case of a limit query, there may be some changes that bump things out of the - // window leaving room for new items. It's important we process these changes first, so we - // iterate the changes twice, first processing any that affect items currently in view. - // TODO: I consider an item "in view" if cacheHasChild is true, which checks both the server - // and event snap. I'm not sure if this will result in edge cases when a child is in one but - // not the other. - var curViewCache = viewCache; - changedChildren.foreach(function (relativePath, childNode) { - var writePath = pathChild(path, relativePath); - if (viewProcessorCacheHasChild(viewCache, pathGetFront(writePath))) { - curViewCache = viewProcessorApplyUserOverwrite(viewProcessor, curViewCache, writePath, childNode, writesCache, serverCache, accumulator); - } - }); - changedChildren.foreach(function (relativePath, childNode) { - var writePath = pathChild(path, relativePath); - if (!viewProcessorCacheHasChild(viewCache, pathGetFront(writePath))) { - curViewCache = viewProcessorApplyUserOverwrite(viewProcessor, curViewCache, writePath, childNode, writesCache, serverCache, accumulator); - } - }); - return curViewCache; -} -function viewProcessorApplyMerge(viewProcessor, node, merge) { - merge.foreach(function (relativePath, childNode) { - node = node.updateChild(relativePath, childNode); - }); - return node; -} -function viewProcessorApplyServerMerge(viewProcessor, viewCache, path, changedChildren, writesCache, serverCache, filterServerNode, accumulator) { - // If we don't have a cache yet, this merge was intended for a previously listen in the same location. Ignore it and - // wait for the complete data update coming soon. - if (viewCache.serverCache.getNode().isEmpty() && - !viewCache.serverCache.isFullyInitialized()) { - return viewCache; - } - // HACK: In the case of a limit query, there may be some changes that bump things out of the - // window leaving room for new items. It's important we process these changes first, so we - // iterate the changes twice, first processing any that affect items currently in view. - // TODO: I consider an item "in view" if cacheHasChild is true, which checks both the server - // and event snap. I'm not sure if this will result in edge cases when a child is in one but - // not the other. - var curViewCache = viewCache; - var viewMergeTree; - if (pathIsEmpty(path)) { - viewMergeTree = changedChildren; - } - else { - viewMergeTree = new ImmutableTree(null).setTree(path, changedChildren); - } - var serverNode = viewCache.serverCache.getNode(); - viewMergeTree.children.inorderTraversal(function (childKey, childTree) { - if (serverNode.hasChild(childKey)) { - var serverChild = viewCache.serverCache - .getNode() - .getImmediateChild(childKey); - var newChild = viewProcessorApplyMerge(viewProcessor, serverChild, childTree); - curViewCache = viewProcessorApplyServerOverwrite(viewProcessor, curViewCache, new Path(childKey), newChild, writesCache, serverCache, filterServerNode, accumulator); - } - }); - viewMergeTree.children.inorderTraversal(function (childKey, childMergeTree) { - var isUnknownDeepMerge = !viewCache.serverCache.isCompleteForChild(childKey) && - childMergeTree.value === null; - if (!serverNode.hasChild(childKey) && !isUnknownDeepMerge) { - var serverChild = viewCache.serverCache - .getNode() - .getImmediateChild(childKey); - var newChild = viewProcessorApplyMerge(viewProcessor, serverChild, childMergeTree); - curViewCache = viewProcessorApplyServerOverwrite(viewProcessor, curViewCache, new Path(childKey), newChild, writesCache, serverCache, filterServerNode, accumulator); - } - }); - return curViewCache; -} -function viewProcessorAckUserWrite(viewProcessor, viewCache, ackPath, affectedTree, writesCache, completeCache, accumulator) { - if (writeTreeRefShadowingWrite(writesCache, ackPath) != null) { - return viewCache; - } - // Only filter server node if it is currently filtered - var filterServerNode = viewCache.serverCache.isFiltered(); - // Essentially we'll just get our existing server cache for the affected paths and re-apply it as a server update - // now that it won't be shadowed. - var serverCache = viewCache.serverCache; - if (affectedTree.value != null) { - // This is an overwrite. - if ((pathIsEmpty(ackPath) && serverCache.isFullyInitialized()) || - serverCache.isCompleteForPath(ackPath)) { - return viewProcessorApplyServerOverwrite(viewProcessor, viewCache, ackPath, serverCache.getNode().getChild(ackPath), writesCache, completeCache, filterServerNode, accumulator); - } - else if (pathIsEmpty(ackPath)) { - // This is a goofy edge case where we are acking data at this location but don't have full data. We - // should just re-apply whatever we have in our cache as a merge. - var changedChildren_1 = new ImmutableTree(null); - serverCache.getNode().forEachChild(KEY_INDEX, function (name, node) { - changedChildren_1 = changedChildren_1.set(new Path(name), node); - }); - return viewProcessorApplyServerMerge(viewProcessor, viewCache, ackPath, changedChildren_1, writesCache, completeCache, filterServerNode, accumulator); - } - else { - return viewCache; - } - } - else { - // This is a merge. - var changedChildren_2 = new ImmutableTree(null); - affectedTree.foreach(function (mergePath, value) { - var serverCachePath = pathChild(ackPath, mergePath); - if (serverCache.isCompleteForPath(serverCachePath)) { - changedChildren_2 = changedChildren_2.set(mergePath, serverCache.getNode().getChild(serverCachePath)); - } - }); - return viewProcessorApplyServerMerge(viewProcessor, viewCache, ackPath, changedChildren_2, writesCache, completeCache, filterServerNode, accumulator); - } -} -function viewProcessorListenComplete(viewProcessor, viewCache, path, writesCache, accumulator) { - var oldServerNode = viewCache.serverCache; - var newViewCache = viewCacheUpdateServerSnap(viewCache, oldServerNode.getNode(), oldServerNode.isFullyInitialized() || pathIsEmpty(path), oldServerNode.isFiltered()); - return viewProcessorGenerateEventCacheAfterServerEvent(viewProcessor, newViewCache, path, writesCache, NO_COMPLETE_CHILD_SOURCE, accumulator); -} -function viewProcessorRevertUserWrite(viewProcessor, viewCache, path, writesCache, completeServerCache, accumulator) { - var complete; - if (writeTreeRefShadowingWrite(writesCache, path) != null) { - return viewCache; - } - else { - var source = new WriteTreeCompleteChildSource(writesCache, viewCache, completeServerCache); - var oldEventCache = viewCache.eventCache.getNode(); - var newEventCache = void 0; - if (pathIsEmpty(path) || pathGetFront(path) === '.priority') { - var newNode = void 0; - if (viewCache.serverCache.isFullyInitialized()) { - newNode = writeTreeRefCalcCompleteEventCache(writesCache, viewCacheGetCompleteServerSnap(viewCache)); - } - else { - var serverChildren = viewCache.serverCache.getNode(); - util.assert(serverChildren instanceof ChildrenNode, 'serverChildren would be complete if leaf node'); - newNode = writeTreeRefCalcCompleteEventChildren(writesCache, serverChildren); - } - newNode = newNode; - newEventCache = viewProcessor.filter.updateFullNode(oldEventCache, newNode, accumulator); - } - else { - var childKey = pathGetFront(path); - var newChild = writeTreeRefCalcCompleteChild(writesCache, childKey, viewCache.serverCache); - if (newChild == null && - viewCache.serverCache.isCompleteForChild(childKey)) { - newChild = oldEventCache.getImmediateChild(childKey); - } - if (newChild != null) { - newEventCache = viewProcessor.filter.updateChild(oldEventCache, childKey, newChild, pathPopFront(path), source, accumulator); - } - else if (viewCache.eventCache.getNode().hasChild(childKey)) { - // No complete child available, delete the existing one, if any - newEventCache = viewProcessor.filter.updateChild(oldEventCache, childKey, ChildrenNode.EMPTY_NODE, pathPopFront(path), source, accumulator); - } - else { - newEventCache = oldEventCache; - } - if (newEventCache.isEmpty() && - viewCache.serverCache.isFullyInitialized()) { - // We might have reverted all child writes. Maybe the old event was a leaf node - complete = writeTreeRefCalcCompleteEventCache(writesCache, viewCacheGetCompleteServerSnap(viewCache)); - if (complete.isLeafNode()) { - newEventCache = viewProcessor.filter.updateFullNode(newEventCache, complete, accumulator); - } - } - } - complete = - viewCache.serverCache.isFullyInitialized() || - writeTreeRefShadowingWrite(writesCache, newEmptyPath()) != null; - return viewCacheUpdateEventSnap(viewCache, newEventCache, complete, viewProcessor.filter.filtersNodes()); - } -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * A view represents a specific location and query that has 1 or more event registrations. - * - * It does several things: - * - Maintains the list of event registrations for this location/query. - * - Maintains a cache of the data visible for this location/query. - * - Applies new operations (via applyOperation), updates the cache, and based on the event - * registrations returns the set of events to be raised. - */ -var View = /** @class */ (function () { - function View(query_, initialViewCache) { - this.query_ = query_; - this.eventRegistrations_ = []; - var params = this.query_._queryParams; - var indexFilter = new IndexedFilter(params.getIndex()); - var filter = queryParamsGetNodeFilter(params); - this.processor_ = newViewProcessor(filter); - var initialServerCache = initialViewCache.serverCache; - var initialEventCache = initialViewCache.eventCache; - // Don't filter server node with other filter than index, wait for tagged listen - var serverSnap = indexFilter.updateFullNode(ChildrenNode.EMPTY_NODE, initialServerCache.getNode(), null); - var eventSnap = filter.updateFullNode(ChildrenNode.EMPTY_NODE, initialEventCache.getNode(), null); - var newServerCache = new CacheNode(serverSnap, initialServerCache.isFullyInitialized(), indexFilter.filtersNodes()); - var newEventCache = new CacheNode(eventSnap, initialEventCache.isFullyInitialized(), filter.filtersNodes()); - this.viewCache_ = newViewCache(newEventCache, newServerCache); - this.eventGenerator_ = new EventGenerator(this.query_); - } - Object.defineProperty(View.prototype, "query", { - get: function () { - return this.query_; - }, - enumerable: false, - configurable: true - }); - return View; -}()); -function viewGetServerCache(view) { - return view.viewCache_.serverCache.getNode(); -} -function viewGetCompleteNode(view) { - return viewCacheGetCompleteEventSnap(view.viewCache_); -} -function viewGetCompleteServerCache(view, path) { - var cache = viewCacheGetCompleteServerSnap(view.viewCache_); - if (cache) { - // If this isn't a "loadsAllData" view, then cache isn't actually a complete cache and - // we need to see if it contains the child we're interested in. - if (view.query._queryParams.loadsAllData() || - (!pathIsEmpty(path) && - !cache.getImmediateChild(pathGetFront(path)).isEmpty())) { - return cache.getChild(path); - } - } - return null; -} -function viewIsEmpty(view) { - return view.eventRegistrations_.length === 0; -} -function viewAddEventRegistration(view, eventRegistration) { - view.eventRegistrations_.push(eventRegistration); -} -/** - * @param eventRegistration - If null, remove all callbacks. - * @param cancelError - If a cancelError is provided, appropriate cancel events will be returned. - * @returns Cancel events, if cancelError was provided. - */ -function viewRemoveEventRegistration(view, eventRegistration, cancelError) { - var cancelEvents = []; - if (cancelError) { - util.assert(eventRegistration == null, 'A cancel should cancel all event registrations.'); - var path_1 = view.query._path; - view.eventRegistrations_.forEach(function (registration) { - var maybeEvent = registration.createCancelEvent(cancelError, path_1); - if (maybeEvent) { - cancelEvents.push(maybeEvent); - } - }); - } - if (eventRegistration) { - var remaining = []; - for (var i = 0; i < view.eventRegistrations_.length; ++i) { - var existing = view.eventRegistrations_[i]; - if (!existing.matches(eventRegistration)) { - remaining.push(existing); - } - else if (eventRegistration.hasAnyCallback()) { - // We're removing just this one - remaining = remaining.concat(view.eventRegistrations_.slice(i + 1)); - break; - } - } - view.eventRegistrations_ = remaining; - } - else { - view.eventRegistrations_ = []; - } - return cancelEvents; -} -/** - * Applies the given Operation, updates our cache, and returns the appropriate events. - */ -function viewApplyOperation(view, operation, writesCache, completeServerCache) { - if (operation.type === OperationType.MERGE && - operation.source.queryId !== null) { - util.assert(viewCacheGetCompleteServerSnap(view.viewCache_), 'We should always have a full cache before handling merges'); - util.assert(viewCacheGetCompleteEventSnap(view.viewCache_), 'Missing event cache, even though we have a server cache'); - } - var oldViewCache = view.viewCache_; - var result = viewProcessorApplyOperation(view.processor_, oldViewCache, operation, writesCache, completeServerCache); - viewProcessorAssertIndexed(view.processor_, result.viewCache); - util.assert(result.viewCache.serverCache.isFullyInitialized() || - !oldViewCache.serverCache.isFullyInitialized(), 'Once a server snap is complete, it should never go back'); - view.viewCache_ = result.viewCache; - return viewGenerateEventsForChanges_(view, result.changes, result.viewCache.eventCache.getNode(), null); -} -function viewGetInitialEvents(view, registration) { - var eventSnap = view.viewCache_.eventCache; - var initialChanges = []; - if (!eventSnap.getNode().isLeafNode()) { - var eventNode = eventSnap.getNode(); - eventNode.forEachChild(PRIORITY_INDEX, function (key, childNode) { - initialChanges.push(changeChildAdded(key, childNode)); - }); - } - if (eventSnap.isFullyInitialized()) { - initialChanges.push(changeValue(eventSnap.getNode())); - } - return viewGenerateEventsForChanges_(view, initialChanges, eventSnap.getNode(), registration); -} -function viewGenerateEventsForChanges_(view, changes, eventCache, eventRegistration) { - var registrations = eventRegistration - ? [eventRegistration] - : view.eventRegistrations_; - return eventGeneratorGenerateEventsForChanges(view.eventGenerator_, changes, eventCache, registrations); -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var referenceConstructor$1; -/** - * SyncPoint represents a single location in a SyncTree with 1 or more event registrations, meaning we need to - * maintain 1 or more Views at this location to cache server data and raise appropriate events for server changes - * and user writes (set, transaction, update). - * - * It's responsible for: - * - Maintaining the set of 1 or more views necessary at this location (a SyncPoint with 0 views should be removed). - * - Proxying user / server operations to the views as appropriate (i.e. applyServerOverwrite, - * applyUserOverwrite, etc.) - */ -var SyncPoint = /** @class */ (function () { - function SyncPoint() { - /** - * The Views being tracked at this location in the tree, stored as a map where the key is a - * queryId and the value is the View for that query. - * - * NOTE: This list will be quite small (usually 1, but perhaps 2 or 3; any more is an odd use case). - */ - this.views = new Map(); - } - return SyncPoint; -}()); -function syncPointSetReferenceConstructor(val) { - util.assert(!referenceConstructor$1, '__referenceConstructor has already been defined'); - referenceConstructor$1 = val; -} -function syncPointGetReferenceConstructor() { - util.assert(referenceConstructor$1, 'Reference.ts has not been loaded'); - return referenceConstructor$1; -} -function syncPointIsEmpty(syncPoint) { - return syncPoint.views.size === 0; -} -function syncPointApplyOperation(syncPoint, operation, writesCache, optCompleteServerCache) { - var e_1, _a; - var queryId = operation.source.queryId; - if (queryId !== null) { - var view = syncPoint.views.get(queryId); - util.assert(view != null, 'SyncTree gave us an op for an invalid query.'); - return viewApplyOperation(view, operation, writesCache, optCompleteServerCache); - } - else { - var events = []; - try { - for (var _b = tslib.__values(syncPoint.views.values()), _c = _b.next(); !_c.done; _c = _b.next()) { - var view = _c.value; - events = events.concat(viewApplyOperation(view, operation, writesCache, optCompleteServerCache)); - } - } - catch (e_1_1) { e_1 = { error: e_1_1 }; } - finally { - try { - if (_c && !_c.done && (_a = _b.return)) _a.call(_b); - } - finally { if (e_1) throw e_1.error; } - } - return events; - } -} -/** - * Get a view for the specified query. - * - * @param query - The query to return a view for - * @param writesCache - * @param serverCache - * @param serverCacheComplete - * @returns Events to raise. - */ -function syncPointGetView(syncPoint, query, writesCache, serverCache, serverCacheComplete) { - var queryId = query._queryIdentifier; - var view = syncPoint.views.get(queryId); - if (!view) { - // TODO: make writesCache take flag for complete server node - var eventCache = writeTreeRefCalcCompleteEventCache(writesCache, serverCacheComplete ? serverCache : null); - var eventCacheComplete = false; - if (eventCache) { - eventCacheComplete = true; - } - else if (serverCache instanceof ChildrenNode) { - eventCache = writeTreeRefCalcCompleteEventChildren(writesCache, serverCache); - eventCacheComplete = false; - } - else { - eventCache = ChildrenNode.EMPTY_NODE; - eventCacheComplete = false; - } - var viewCache = newViewCache(new CacheNode(eventCache, eventCacheComplete, false), new CacheNode(serverCache, serverCacheComplete, false)); - return new View(query, viewCache); - } - return view; -} -/** - * Add an event callback for the specified query. - * - * @param query - * @param eventRegistration - * @param writesCache - * @param serverCache - Complete server cache, if we have it. - * @param serverCacheComplete - * @returns Events to raise. - */ -function syncPointAddEventRegistration(syncPoint, query, eventRegistration, writesCache, serverCache, serverCacheComplete) { - var view = syncPointGetView(syncPoint, query, writesCache, serverCache, serverCacheComplete); - if (!syncPoint.views.has(query._queryIdentifier)) { - syncPoint.views.set(query._queryIdentifier, view); - } - // This is guaranteed to exist now, we just created anything that was missing - viewAddEventRegistration(view, eventRegistration); - return viewGetInitialEvents(view, eventRegistration); -} -/** - * Remove event callback(s). Return cancelEvents if a cancelError is specified. - * - * If query is the default query, we'll check all views for the specified eventRegistration. - * If eventRegistration is null, we'll remove all callbacks for the specified view(s). - * - * @param eventRegistration - If null, remove all callbacks. - * @param cancelError - If a cancelError is provided, appropriate cancel events will be returned. - * @returns removed queries and any cancel events - */ -function syncPointRemoveEventRegistration(syncPoint, query, eventRegistration, cancelError) { - var e_2, _a; - var queryId = query._queryIdentifier; - var removed = []; - var cancelEvents = []; - var hadCompleteView = syncPointHasCompleteView(syncPoint); - if (queryId === 'default') { - try { - // When you do ref.off(...), we search all views for the registration to remove. - for (var _b = tslib.__values(syncPoint.views.entries()), _c = _b.next(); !_c.done; _c = _b.next()) { - var _d = tslib.__read(_c.value, 2), viewQueryId = _d[0], view = _d[1]; - cancelEvents = cancelEvents.concat(viewRemoveEventRegistration(view, eventRegistration, cancelError)); - if (viewIsEmpty(view)) { - syncPoint.views.delete(viewQueryId); - // We'll deal with complete views later. - if (!view.query._queryParams.loadsAllData()) { - removed.push(view.query); - } - } - } - } - catch (e_2_1) { e_2 = { error: e_2_1 }; } - finally { - try { - if (_c && !_c.done && (_a = _b.return)) _a.call(_b); - } - finally { if (e_2) throw e_2.error; } - } - } - else { - // remove the callback from the specific view. - var view = syncPoint.views.get(queryId); - if (view) { - cancelEvents = cancelEvents.concat(viewRemoveEventRegistration(view, eventRegistration, cancelError)); - if (viewIsEmpty(view)) { - syncPoint.views.delete(queryId); - // We'll deal with complete views later. - if (!view.query._queryParams.loadsAllData()) { - removed.push(view.query); - } - } - } - } - if (hadCompleteView && !syncPointHasCompleteView(syncPoint)) { - // We removed our last complete view. - removed.push(new (syncPointGetReferenceConstructor())(query._repo, query._path)); - } - return { removed: removed, events: cancelEvents }; -} -function syncPointGetQueryViews(syncPoint) { - var e_3, _a; - var result = []; - try { - for (var _b = tslib.__values(syncPoint.views.values()), _c = _b.next(); !_c.done; _c = _b.next()) { - var view = _c.value; - if (!view.query._queryParams.loadsAllData()) { - result.push(view); - } - } - } - catch (e_3_1) { e_3 = { error: e_3_1 }; } - finally { - try { - if (_c && !_c.done && (_a = _b.return)) _a.call(_b); - } - finally { if (e_3) throw e_3.error; } - } - return result; -} -/** - * @param path - The path to the desired complete snapshot - * @returns A complete cache, if it exists - */ -function syncPointGetCompleteServerCache(syncPoint, path) { - var e_4, _a; - var serverCache = null; - try { - for (var _b = tslib.__values(syncPoint.views.values()), _c = _b.next(); !_c.done; _c = _b.next()) { - var view = _c.value; - serverCache = serverCache || viewGetCompleteServerCache(view, path); - } - } - catch (e_4_1) { e_4 = { error: e_4_1 }; } - finally { - try { - if (_c && !_c.done && (_a = _b.return)) _a.call(_b); - } - finally { if (e_4) throw e_4.error; } - } - return serverCache; -} -function syncPointViewForQuery(syncPoint, query) { - var params = query._queryParams; - if (params.loadsAllData()) { - return syncPointGetCompleteView(syncPoint); - } - else { - var queryId = query._queryIdentifier; - return syncPoint.views.get(queryId); - } -} -function syncPointViewExistsForQuery(syncPoint, query) { - return syncPointViewForQuery(syncPoint, query) != null; -} -function syncPointHasCompleteView(syncPoint) { - return syncPointGetCompleteView(syncPoint) != null; -} -function syncPointGetCompleteView(syncPoint) { - var e_5, _a; - try { - for (var _b = tslib.__values(syncPoint.views.values()), _c = _b.next(); !_c.done; _c = _b.next()) { - var view = _c.value; - if (view.query._queryParams.loadsAllData()) { - return view; - } - } - } - catch (e_5_1) { e_5 = { error: e_5_1 }; } - finally { - try { - if (_c && !_c.done && (_a = _b.return)) _a.call(_b); - } - finally { if (e_5) throw e_5.error; } - } - return null; -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var referenceConstructor; -function syncTreeSetReferenceConstructor(val) { - util.assert(!referenceConstructor, '__referenceConstructor has already been defined'); - referenceConstructor = val; -} -function syncTreeGetReferenceConstructor() { - util.assert(referenceConstructor, 'Reference.ts has not been loaded'); - return referenceConstructor; -} -/** - * Static tracker for next query tag. - */ -var syncTreeNextQueryTag_ = 1; -/** - * SyncTree is the central class for managing event callback registration, data caching, views - * (query processing), and event generation. There are typically two SyncTree instances for - * each Repo, one for the normal Firebase data, and one for the .info data. - * - * It has a number of responsibilities, including: - * - Tracking all user event callbacks (registered via addEventRegistration() and removeEventRegistration()). - * - Applying and caching data changes for user set(), transaction(), and update() calls - * (applyUserOverwrite(), applyUserMerge()). - * - Applying and caching data changes for server data changes (applyServerOverwrite(), - * applyServerMerge()). - * - Generating user-facing events for server and user changes (all of the apply* methods - * return the set of events that need to be raised as a result). - * - Maintaining the appropriate set of server listens to ensure we are always subscribed - * to the correct set of paths and queries to satisfy the current set of user event - * callbacks (listens are started/stopped using the provided listenProvider). - * - * NOTE: Although SyncTree tracks event callbacks and calculates events to raise, the actual - * events are returned to the caller rather than raised synchronously. - * - */ -var SyncTree = /** @class */ (function () { - /** - * @param listenProvider_ - Used by SyncTree to start / stop listening - * to server data. - */ - function SyncTree(listenProvider_) { - this.listenProvider_ = listenProvider_; - /** - * Tree of SyncPoints. There's a SyncPoint at any location that has 1 or more views. - */ - this.syncPointTree_ = new ImmutableTree(null); - /** - * A tree of all pending user writes (user-initiated set()'s, transaction()'s, update()'s, etc.). - */ - this.pendingWriteTree_ = newWriteTree(); - this.tagToQueryMap = new Map(); - this.queryToTagMap = new Map(); - } - return SyncTree; -}()); -/** - * Apply the data changes for a user-generated set() or transaction() call. - * - * @returns Events to raise. - */ -function syncTreeApplyUserOverwrite(syncTree, path, newData, writeId, visible) { - // Record pending write. - writeTreeAddOverwrite(syncTree.pendingWriteTree_, path, newData, writeId, visible); - if (!visible) { - return []; - } - else { - return syncTreeApplyOperationToSyncPoints_(syncTree, new Overwrite(newOperationSourceUser(), path, newData)); - } -} -/** - * Apply the data from a user-generated update() call - * - * @returns Events to raise. - */ -function syncTreeApplyUserMerge(syncTree, path, changedChildren, writeId) { - // Record pending merge. - writeTreeAddMerge(syncTree.pendingWriteTree_, path, changedChildren, writeId); - var changeTree = ImmutableTree.fromObject(changedChildren); - return syncTreeApplyOperationToSyncPoints_(syncTree, new Merge(newOperationSourceUser(), path, changeTree)); -} -/** - * Acknowledge a pending user write that was previously registered with applyUserOverwrite() or applyUserMerge(). - * - * @param revert - True if the given write failed and needs to be reverted - * @returns Events to raise. - */ -function syncTreeAckUserWrite(syncTree, writeId, revert) { - if (revert === void 0) { revert = false; } - var write = writeTreeGetWrite(syncTree.pendingWriteTree_, writeId); - var needToReevaluate = writeTreeRemoveWrite(syncTree.pendingWriteTree_, writeId); - if (!needToReevaluate) { - return []; - } - else { - var affectedTree_1 = new ImmutableTree(null); - if (write.snap != null) { - // overwrite - affectedTree_1 = affectedTree_1.set(newEmptyPath(), true); - } - else { - each(write.children, function (pathString) { - affectedTree_1 = affectedTree_1.set(new Path(pathString), true); - }); - } - return syncTreeApplyOperationToSyncPoints_(syncTree, new AckUserWrite(write.path, affectedTree_1, revert)); - } -} -/** - * Apply new server data for the specified path.. - * - * @returns Events to raise. - */ -function syncTreeApplyServerOverwrite(syncTree, path, newData) { - return syncTreeApplyOperationToSyncPoints_(syncTree, new Overwrite(newOperationSourceServer(), path, newData)); -} -/** - * Apply new server data to be merged in at the specified path. - * - * @returns Events to raise. - */ -function syncTreeApplyServerMerge(syncTree, path, changedChildren) { - var changeTree = ImmutableTree.fromObject(changedChildren); - return syncTreeApplyOperationToSyncPoints_(syncTree, new Merge(newOperationSourceServer(), path, changeTree)); -} -/** - * Apply a listen complete for a query - * - * @returns Events to raise. - */ -function syncTreeApplyListenComplete(syncTree, path) { - return syncTreeApplyOperationToSyncPoints_(syncTree, new ListenComplete(newOperationSourceServer(), path)); -} -/** - * Apply a listen complete for a tagged query - * - * @returns Events to raise. - */ -function syncTreeApplyTaggedListenComplete(syncTree, path, tag) { - var queryKey = syncTreeQueryKeyForTag_(syncTree, tag); - if (queryKey) { - var r = syncTreeParseQueryKey_(queryKey); - var queryPath = r.path, queryId = r.queryId; - var relativePath = newRelativePath(queryPath, path); - var op = new ListenComplete(newOperationSourceServerTaggedQuery(queryId), relativePath); - return syncTreeApplyTaggedOperation_(syncTree, queryPath, op); - } - else { - // We've already removed the query. No big deal, ignore the update - return []; - } -} -/** - * Remove event callback(s). - * - * If query is the default query, we'll check all queries for the specified eventRegistration. - * If eventRegistration is null, we'll remove all callbacks for the specified query/queries. - * - * @param eventRegistration - If null, all callbacks are removed. - * @param cancelError - If a cancelError is provided, appropriate cancel events will be returned. - * @param skipListenerDedup - When performing a `get()`, we don't add any new listeners, so no - * deduping needs to take place. This flag allows toggling of that behavior - * @returns Cancel events, if cancelError was provided. - */ -function syncTreeRemoveEventRegistration(syncTree, query, eventRegistration, cancelError, skipListenerDedup) { - if (skipListenerDedup === void 0) { skipListenerDedup = false; } - // Find the syncPoint first. Then deal with whether or not it has matching listeners - var path = query._path; - var maybeSyncPoint = syncTree.syncPointTree_.get(path); - var cancelEvents = []; - // A removal on a default query affects all queries at that location. A removal on an indexed query, even one without - // other query constraints, does *not* affect all queries at that location. So this check must be for 'default', and - // not loadsAllData(). - if (maybeSyncPoint && - (query._queryIdentifier === 'default' || - syncPointViewExistsForQuery(maybeSyncPoint, query))) { - var removedAndEvents = syncPointRemoveEventRegistration(maybeSyncPoint, query, eventRegistration, cancelError); - if (syncPointIsEmpty(maybeSyncPoint)) { - syncTree.syncPointTree_ = syncTree.syncPointTree_.remove(path); - } - var removed = removedAndEvents.removed; - cancelEvents = removedAndEvents.events; - if (!skipListenerDedup) { - /** - * We may have just removed one of many listeners and can short-circuit this whole process - * We may also not have removed a default listener, in which case all of the descendant listeners should already be - * properly set up. - */ - // Since indexed queries can shadow if they don't have other query constraints, check for loadsAllData(), instead of - // queryId === 'default' - var removingDefault = -1 !== - removed.findIndex(function (query) { - return query._queryParams.loadsAllData(); - }); - var covered = syncTree.syncPointTree_.findOnPath(path, function (relativePath, parentSyncPoint) { - return syncPointHasCompleteView(parentSyncPoint); - }); - if (removingDefault && !covered) { - var subtree = syncTree.syncPointTree_.subtree(path); - // There are potentially child listeners. Determine what if any listens we need to send before executing the - // removal - if (!subtree.isEmpty()) { - // We need to fold over our subtree and collect the listeners to send - var newViews = syncTreeCollectDistinctViewsForSubTree_(subtree); - // Ok, we've collected all the listens we need. Set them up. - for (var i = 0; i < newViews.length; ++i) { - var view = newViews[i], newQuery = view.query; - var listener = syncTreeCreateListenerForView_(syncTree, view); - syncTree.listenProvider_.startListening(syncTreeQueryForListening_(newQuery), syncTreeTagForQuery(syncTree, newQuery), listener.hashFn, listener.onComplete); - } - } - // Otherwise there's nothing below us, so nothing we need to start listening on - } - // If we removed anything and we're not covered by a higher up listen, we need to stop listening on this query - // The above block has us covered in terms of making sure we're set up on listens lower in the tree. - // Also, note that if we have a cancelError, it's already been removed at the provider level. - if (!covered && removed.length > 0 && !cancelError) { - // If we removed a default, then we weren't listening on any of the other queries here. Just cancel the one - // default. Otherwise, we need to iterate through and cancel each individual query - if (removingDefault) { - // We don't tag default listeners - var defaultTag = null; - syncTree.listenProvider_.stopListening(syncTreeQueryForListening_(query), defaultTag); - } - else { - removed.forEach(function (queryToRemove) { - var tagToRemove = syncTree.queryToTagMap.get(syncTreeMakeQueryKey_(queryToRemove)); - syncTree.listenProvider_.stopListening(syncTreeQueryForListening_(queryToRemove), tagToRemove); - }); - } - } - } - // Now, clear all of the tags we're tracking for the removed listens - syncTreeRemoveTags_(syncTree, removed); - } - return cancelEvents; -} -/** - * Apply new server data for the specified tagged query. - * - * @returns Events to raise. - */ -function syncTreeApplyTaggedQueryOverwrite(syncTree, path, snap, tag) { - var queryKey = syncTreeQueryKeyForTag_(syncTree, tag); - if (queryKey != null) { - var r = syncTreeParseQueryKey_(queryKey); - var queryPath = r.path, queryId = r.queryId; - var relativePath = newRelativePath(queryPath, path); - var op = new Overwrite(newOperationSourceServerTaggedQuery(queryId), relativePath, snap); - return syncTreeApplyTaggedOperation_(syncTree, queryPath, op); - } - else { - // Query must have been removed already - return []; - } -} -/** - * Apply server data to be merged in for the specified tagged query. - * - * @returns Events to raise. - */ -function syncTreeApplyTaggedQueryMerge(syncTree, path, changedChildren, tag) { - var queryKey = syncTreeQueryKeyForTag_(syncTree, tag); - if (queryKey) { - var r = syncTreeParseQueryKey_(queryKey); - var queryPath = r.path, queryId = r.queryId; - var relativePath = newRelativePath(queryPath, path); - var changeTree = ImmutableTree.fromObject(changedChildren); - var op = new Merge(newOperationSourceServerTaggedQuery(queryId), relativePath, changeTree); - return syncTreeApplyTaggedOperation_(syncTree, queryPath, op); - } - else { - // We've already removed the query. No big deal, ignore the update - return []; - } -} -/** - * Add an event callback for the specified query. - * - * @returns Events to raise. - */ -function syncTreeAddEventRegistration(syncTree, query, eventRegistration, skipSetupListener) { - if (skipSetupListener === void 0) { skipSetupListener = false; } - var path = query._path; - var serverCache = null; - var foundAncestorDefaultView = false; - // Any covering writes will necessarily be at the root, so really all we need to find is the server cache. - // Consider optimizing this once there's a better understanding of what actual behavior will be. - syncTree.syncPointTree_.foreachOnPath(path, function (pathToSyncPoint, sp) { - var relativePath = newRelativePath(pathToSyncPoint, path); - serverCache = - serverCache || syncPointGetCompleteServerCache(sp, relativePath); - foundAncestorDefaultView = - foundAncestorDefaultView || syncPointHasCompleteView(sp); - }); - var syncPoint = syncTree.syncPointTree_.get(path); - if (!syncPoint) { - syncPoint = new SyncPoint(); - syncTree.syncPointTree_ = syncTree.syncPointTree_.set(path, syncPoint); - } - else { - foundAncestorDefaultView = - foundAncestorDefaultView || syncPointHasCompleteView(syncPoint); - serverCache = - serverCache || syncPointGetCompleteServerCache(syncPoint, newEmptyPath()); - } - var serverCacheComplete; - if (serverCache != null) { - serverCacheComplete = true; - } - else { - serverCacheComplete = false; - serverCache = ChildrenNode.EMPTY_NODE; - var subtree = syncTree.syncPointTree_.subtree(path); - subtree.foreachChild(function (childName, childSyncPoint) { - var completeCache = syncPointGetCompleteServerCache(childSyncPoint, newEmptyPath()); - if (completeCache) { - serverCache = serverCache.updateImmediateChild(childName, completeCache); - } - }); - } - var viewAlreadyExists = syncPointViewExistsForQuery(syncPoint, query); - if (!viewAlreadyExists && !query._queryParams.loadsAllData()) { - // We need to track a tag for this query - var queryKey = syncTreeMakeQueryKey_(query); - util.assert(!syncTree.queryToTagMap.has(queryKey), 'View does not exist, but we have a tag'); - var tag = syncTreeGetNextQueryTag_(); - syncTree.queryToTagMap.set(queryKey, tag); - syncTree.tagToQueryMap.set(tag, queryKey); - } - var writesCache = writeTreeChildWrites(syncTree.pendingWriteTree_, path); - var events = syncPointAddEventRegistration(syncPoint, query, eventRegistration, writesCache, serverCache, serverCacheComplete); - if (!viewAlreadyExists && !foundAncestorDefaultView && !skipSetupListener) { - var view = syncPointViewForQuery(syncPoint, query); - events = events.concat(syncTreeSetupListener_(syncTree, query, view)); - } - return events; -} -/** - * Returns a complete cache, if we have one, of the data at a particular path. If the location does not have a - * listener above it, we will get a false "null". This shouldn't be a problem because transactions will always - * have a listener above, and atomic operations would correctly show a jitter of -> - * as the write is applied locally and then acknowledged at the server. - * - * Note: this method will *include* hidden writes from transaction with applyLocally set to false. - * - * @param path - The path to the data we want - * @param writeIdsToExclude - A specific set to be excluded - */ -function syncTreeCalcCompleteEventCache(syncTree, path, writeIdsToExclude) { - var includeHiddenSets = true; - var writeTree = syncTree.pendingWriteTree_; - var serverCache = syncTree.syncPointTree_.findOnPath(path, function (pathSoFar, syncPoint) { - var relativePath = newRelativePath(pathSoFar, path); - var serverCache = syncPointGetCompleteServerCache(syncPoint, relativePath); - if (serverCache) { - return serverCache; - } - }); - return writeTreeCalcCompleteEventCache(writeTree, path, serverCache, writeIdsToExclude, includeHiddenSets); -} -function syncTreeGetServerValue(syncTree, query) { - var path = query._path; - var serverCache = null; - // Any covering writes will necessarily be at the root, so really all we need to find is the server cache. - // Consider optimizing this once there's a better understanding of what actual behavior will be. - syncTree.syncPointTree_.foreachOnPath(path, function (pathToSyncPoint, sp) { - var relativePath = newRelativePath(pathToSyncPoint, path); - serverCache = - serverCache || syncPointGetCompleteServerCache(sp, relativePath); - }); - var syncPoint = syncTree.syncPointTree_.get(path); - if (!syncPoint) { - syncPoint = new SyncPoint(); - syncTree.syncPointTree_ = syncTree.syncPointTree_.set(path, syncPoint); - } - else { - serverCache = - serverCache || syncPointGetCompleteServerCache(syncPoint, newEmptyPath()); - } - var serverCacheComplete = serverCache != null; - var serverCacheNode = serverCacheComplete - ? new CacheNode(serverCache, true, false) - : null; - var writesCache = writeTreeChildWrites(syncTree.pendingWriteTree_, query._path); - var view = syncPointGetView(syncPoint, query, writesCache, serverCacheComplete ? serverCacheNode.getNode() : ChildrenNode.EMPTY_NODE, serverCacheComplete); - return viewGetCompleteNode(view); -} -/** - * A helper method that visits all descendant and ancestor SyncPoints, applying the operation. - * - * NOTES: - * - Descendant SyncPoints will be visited first (since we raise events depth-first). - * - * - We call applyOperation() on each SyncPoint passing three things: - * 1. A version of the Operation that has been made relative to the SyncPoint location. - * 2. A WriteTreeRef of any writes we have cached at the SyncPoint location. - * 3. A snapshot Node with cached server data, if we have it. - * - * - We concatenate all of the events returned by each SyncPoint and return the result. - */ -function syncTreeApplyOperationToSyncPoints_(syncTree, operation) { - return syncTreeApplyOperationHelper_(operation, syncTree.syncPointTree_, - /*serverCache=*/ null, writeTreeChildWrites(syncTree.pendingWriteTree_, newEmptyPath())); -} -/** - * Recursive helper for applyOperationToSyncPoints_ - */ -function syncTreeApplyOperationHelper_(operation, syncPointTree, serverCache, writesCache) { - if (pathIsEmpty(operation.path)) { - return syncTreeApplyOperationDescendantsHelper_(operation, syncPointTree, serverCache, writesCache); - } - else { - var syncPoint = syncPointTree.get(newEmptyPath()); - // If we don't have cached server data, see if we can get it from this SyncPoint. - if (serverCache == null && syncPoint != null) { - serverCache = syncPointGetCompleteServerCache(syncPoint, newEmptyPath()); - } - var events = []; - var childName = pathGetFront(operation.path); - var childOperation = operation.operationForChild(childName); - var childTree = syncPointTree.children.get(childName); - if (childTree && childOperation) { - var childServerCache = serverCache - ? serverCache.getImmediateChild(childName) - : null; - var childWritesCache = writeTreeRefChild(writesCache, childName); - events = events.concat(syncTreeApplyOperationHelper_(childOperation, childTree, childServerCache, childWritesCache)); - } - if (syncPoint) { - events = events.concat(syncPointApplyOperation(syncPoint, operation, writesCache, serverCache)); - } - return events; - } -} -/** - * Recursive helper for applyOperationToSyncPoints_ - */ -function syncTreeApplyOperationDescendantsHelper_(operation, syncPointTree, serverCache, writesCache) { - var syncPoint = syncPointTree.get(newEmptyPath()); - // If we don't have cached server data, see if we can get it from this SyncPoint. - if (serverCache == null && syncPoint != null) { - serverCache = syncPointGetCompleteServerCache(syncPoint, newEmptyPath()); - } - var events = []; - syncPointTree.children.inorderTraversal(function (childName, childTree) { - var childServerCache = serverCache - ? serverCache.getImmediateChild(childName) - : null; - var childWritesCache = writeTreeRefChild(writesCache, childName); - var childOperation = operation.operationForChild(childName); - if (childOperation) { - events = events.concat(syncTreeApplyOperationDescendantsHelper_(childOperation, childTree, childServerCache, childWritesCache)); - } - }); - if (syncPoint) { - events = events.concat(syncPointApplyOperation(syncPoint, operation, writesCache, serverCache)); - } - return events; -} -function syncTreeCreateListenerForView_(syncTree, view) { - var query = view.query; - var tag = syncTreeTagForQuery(syncTree, query); - return { - hashFn: function () { - var cache = viewGetServerCache(view) || ChildrenNode.EMPTY_NODE; - return cache.hash(); - }, - onComplete: function (status) { - if (status === 'ok') { - if (tag) { - return syncTreeApplyTaggedListenComplete(syncTree, query._path, tag); - } - else { - return syncTreeApplyListenComplete(syncTree, query._path); - } - } - else { - // If a listen failed, kill all of the listeners here, not just the one that triggered the error. - // Note that this may need to be scoped to just this listener if we change permissions on filtered children - var error = errorForServerCode(status, query); - return syncTreeRemoveEventRegistration(syncTree, query, - /*eventRegistration*/ null, error); - } - } - }; -} -/** - * Return the tag associated with the given query. - */ -function syncTreeTagForQuery(syncTree, query) { - var queryKey = syncTreeMakeQueryKey_(query); - return syncTree.queryToTagMap.get(queryKey); -} -/** - * Given a query, computes a "queryKey" suitable for use in our queryToTagMap_. - */ -function syncTreeMakeQueryKey_(query) { - return query._path.toString() + '$' + query._queryIdentifier; -} -/** - * Return the query associated with the given tag, if we have one - */ -function syncTreeQueryKeyForTag_(syncTree, tag) { - return syncTree.tagToQueryMap.get(tag); -} -/** - * Given a queryKey (created by makeQueryKey), parse it back into a path and queryId. - */ -function syncTreeParseQueryKey_(queryKey) { - var splitIndex = queryKey.indexOf('$'); - util.assert(splitIndex !== -1 && splitIndex < queryKey.length - 1, 'Bad queryKey.'); - return { - queryId: queryKey.substr(splitIndex + 1), - path: new Path(queryKey.substr(0, splitIndex)) - }; -} -/** - * A helper method to apply tagged operations - */ -function syncTreeApplyTaggedOperation_(syncTree, queryPath, operation) { - var syncPoint = syncTree.syncPointTree_.get(queryPath); - util.assert(syncPoint, "Missing sync point for query tag that we're tracking"); - var writesCache = writeTreeChildWrites(syncTree.pendingWriteTree_, queryPath); - return syncPointApplyOperation(syncPoint, operation, writesCache, null); -} -/** - * This collapses multiple unfiltered views into a single view, since we only need a single - * listener for them. - */ -function syncTreeCollectDistinctViewsForSubTree_(subtree) { - return subtree.fold(function (relativePath, maybeChildSyncPoint, childMap) { - if (maybeChildSyncPoint && syncPointHasCompleteView(maybeChildSyncPoint)) { - var completeView = syncPointGetCompleteView(maybeChildSyncPoint); - return [completeView]; - } - else { - // No complete view here, flatten any deeper listens into an array - var views_1 = []; - if (maybeChildSyncPoint) { - views_1 = syncPointGetQueryViews(maybeChildSyncPoint); - } - each(childMap, function (_key, childViews) { - views_1 = views_1.concat(childViews); - }); - return views_1; - } - }); -} -/** - * Normalizes a query to a query we send the server for listening - * - * @returns The normalized query - */ -function syncTreeQueryForListening_(query) { - if (query._queryParams.loadsAllData() && !query._queryParams.isDefault()) { - // We treat queries that load all data as default queries - // Cast is necessary because ref() technically returns Firebase which is actually fb.api.Firebase which inherits - // from Query - return new (syncTreeGetReferenceConstructor())(query._repo, query._path); - } - else { - return query; - } -} -function syncTreeRemoveTags_(syncTree, queries) { - for (var j = 0; j < queries.length; ++j) { - var removedQuery = queries[j]; - if (!removedQuery._queryParams.loadsAllData()) { - // We should have a tag for this - var removedQueryKey = syncTreeMakeQueryKey_(removedQuery); - var removedQueryTag = syncTree.queryToTagMap.get(removedQueryKey); - syncTree.queryToTagMap.delete(removedQueryKey); - syncTree.tagToQueryMap.delete(removedQueryTag); - } - } -} -/** - * Static accessor for query tags. - */ -function syncTreeGetNextQueryTag_() { - return syncTreeNextQueryTag_++; -} -/** - * For a given new listen, manage the de-duplication of outstanding subscriptions. - * - * @returns This method can return events to support synchronous data sources - */ -function syncTreeSetupListener_(syncTree, query, view) { - var path = query._path; - var tag = syncTreeTagForQuery(syncTree, query); - var listener = syncTreeCreateListenerForView_(syncTree, view); - var events = syncTree.listenProvider_.startListening(syncTreeQueryForListening_(query), tag, listener.hashFn, listener.onComplete); - var subtree = syncTree.syncPointTree_.subtree(path); - // The root of this subtree has our query. We're here because we definitely need to send a listen for that, but we - // may need to shadow other listens as well. - if (tag) { - util.assert(!syncPointHasCompleteView(subtree.value), "If we're adding a query, it shouldn't be shadowed"); - } - else { - // Shadow everything at or below this location, this is a default listener. - var queriesToStop = subtree.fold(function (relativePath, maybeChildSyncPoint, childMap) { - if (!pathIsEmpty(relativePath) && - maybeChildSyncPoint && - syncPointHasCompleteView(maybeChildSyncPoint)) { - return [syncPointGetCompleteView(maybeChildSyncPoint).query]; - } - else { - // No default listener here, flatten any deeper queries into an array - var queries_1 = []; - if (maybeChildSyncPoint) { - queries_1 = queries_1.concat(syncPointGetQueryViews(maybeChildSyncPoint).map(function (view) { return view.query; })); - } - each(childMap, function (_key, childQueries) { - queries_1 = queries_1.concat(childQueries); - }); - return queries_1; - } - }); - for (var i = 0; i < queriesToStop.length; ++i) { - var queryToStop = queriesToStop[i]; - syncTree.listenProvider_.stopListening(syncTreeQueryForListening_(queryToStop), syncTreeTagForQuery(syncTree, queryToStop)); - } - } - return events; -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var ExistingValueProvider = /** @class */ (function () { - function ExistingValueProvider(node_) { - this.node_ = node_; - } - ExistingValueProvider.prototype.getImmediateChild = function (childName) { - var child = this.node_.getImmediateChild(childName); - return new ExistingValueProvider(child); - }; - ExistingValueProvider.prototype.node = function () { - return this.node_; - }; - return ExistingValueProvider; -}()); -var DeferredValueProvider = /** @class */ (function () { - function DeferredValueProvider(syncTree, path) { - this.syncTree_ = syncTree; - this.path_ = path; - } - DeferredValueProvider.prototype.getImmediateChild = function (childName) { - var childPath = pathChild(this.path_, childName); - return new DeferredValueProvider(this.syncTree_, childPath); - }; - DeferredValueProvider.prototype.node = function () { - return syncTreeCalcCompleteEventCache(this.syncTree_, this.path_); - }; - return DeferredValueProvider; -}()); -/** - * Generate placeholders for deferred values. - */ -var generateWithValues = function (values) { - values = values || {}; - values['timestamp'] = values['timestamp'] || new Date().getTime(); - return values; -}; -/** - * Value to use when firing local events. When writing server values, fire - * local events with an approximate value, otherwise return value as-is. - */ -var resolveDeferredLeafValue = function (value, existingVal, serverValues) { - if (!value || typeof value !== 'object') { - return value; - } - util.assert('.sv' in value, 'Unexpected leaf node or priority contents'); - if (typeof value['.sv'] === 'string') { - return resolveScalarDeferredValue(value['.sv'], existingVal, serverValues); - } - else if (typeof value['.sv'] === 'object') { - return resolveComplexDeferredValue(value['.sv'], existingVal); - } - else { - util.assert(false, 'Unexpected server value: ' + JSON.stringify(value, null, 2)); - } -}; -var resolveScalarDeferredValue = function (op, existing, serverValues) { - switch (op) { - case 'timestamp': - return serverValues['timestamp']; - default: - util.assert(false, 'Unexpected server value: ' + op); - } -}; -var resolveComplexDeferredValue = function (op, existing, unused) { - if (!op.hasOwnProperty('increment')) { - util.assert(false, 'Unexpected server value: ' + JSON.stringify(op, null, 2)); - } - var delta = op['increment']; - if (typeof delta !== 'number') { - util.assert(false, 'Unexpected increment value: ' + delta); - } - var existingNode = existing.node(); - util.assert(existingNode !== null && typeof existingNode !== 'undefined', 'Expected ChildrenNode.EMPTY_NODE for nulls'); - // Incrementing a non-number sets the value to the incremented amount - if (!existingNode.isLeafNode()) { - return delta; - } - var leaf = existingNode; - var existingVal = leaf.getValue(); - if (typeof existingVal !== 'number') { - return delta; - } - // No need to do over/underflow arithmetic here because JS only handles floats under the covers - return existingVal + delta; -}; -/** - * Recursively replace all deferred values and priorities in the tree with the - * specified generated replacement values. - * @param path - path to which write is relative - * @param node - new data written at path - * @param syncTree - current data - */ -var resolveDeferredValueTree = function (path, node, syncTree, serverValues) { - return resolveDeferredValue(node, new DeferredValueProvider(syncTree, path), serverValues); -}; -/** - * Recursively replace all deferred values and priorities in the node with the - * specified generated replacement values. If there are no server values in the node, - * it'll be returned as-is. - */ -var resolveDeferredValueSnapshot = function (node, existing, serverValues) { - return resolveDeferredValue(node, new ExistingValueProvider(existing), serverValues); -}; -function resolveDeferredValue(node, existingVal, serverValues) { - var rawPri = node.getPriority().val(); - var priority = resolveDeferredLeafValue(rawPri, existingVal.getImmediateChild('.priority'), serverValues); - var newNode; - if (node.isLeafNode()) { - var leafNode = node; - var value = resolveDeferredLeafValue(leafNode.getValue(), existingVal, serverValues); - if (value !== leafNode.getValue() || - priority !== leafNode.getPriority().val()) { - return new LeafNode(value, nodeFromJSON(priority)); - } - else { - return node; - } - } - else { - var childrenNode = node; - newNode = childrenNode; - if (priority !== childrenNode.getPriority().val()) { - newNode = newNode.updatePriority(new LeafNode(priority)); - } - childrenNode.forEachChild(PRIORITY_INDEX, function (childName, childNode) { - var newChildNode = resolveDeferredValue(childNode, existingVal.getImmediateChild(childName), serverValues); - if (newChildNode !== childNode) { - newNode = newNode.updateImmediateChild(childName, newChildNode); - } - }); - return newNode; - } -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * A light-weight tree, traversable by path. Nodes can have both values and children. - * Nodes are not enumerated (by forEachChild) unless they have a value or non-empty - * children. - */ -var Tree = /** @class */ (function () { - /** - * @param name - Optional name of the node. - * @param parent - Optional parent node. - * @param node - Optional node to wrap. - */ - function Tree(name, parent, node) { - if (name === void 0) { name = ''; } - if (parent === void 0) { parent = null; } - if (node === void 0) { node = { children: {}, childCount: 0 }; } - this.name = name; - this.parent = parent; - this.node = node; - } - return Tree; -}()); -/** - * Returns a sub-Tree for the given path. - * - * @param pathObj - Path to look up. - * @returns Tree for path. - */ -function treeSubTree(tree, pathObj) { - // TODO: Require pathObj to be Path? - var path = pathObj instanceof Path ? pathObj : new Path(pathObj); - var child = tree, next = pathGetFront(path); - while (next !== null) { - var childNode = util.safeGet(child.node.children, next) || { - children: {}, - childCount: 0 - }; - child = new Tree(next, child, childNode); - path = pathPopFront(path); - next = pathGetFront(path); - } - return child; -} -/** - * Returns the data associated with this tree node. - * - * @returns The data or null if no data exists. - */ -function treeGetValue(tree) { - return tree.node.value; -} -/** - * Sets data to this tree node. - * - * @param value - Value to set. - */ -function treeSetValue(tree, value) { - tree.node.value = value; - treeUpdateParents(tree); -} -/** - * @returns Whether the tree has any children. - */ -function treeHasChildren(tree) { - return tree.node.childCount > 0; -} -/** - * @returns Whethe rthe tree is empty (no value or children). - */ -function treeIsEmpty(tree) { - return treeGetValue(tree) === undefined && !treeHasChildren(tree); -} -/** - * Calls action for each child of this tree node. - * - * @param action - Action to be called for each child. - */ -function treeForEachChild(tree, action) { - each(tree.node.children, function (child, childTree) { - action(new Tree(child, tree, childTree)); - }); -} -/** - * Does a depth-first traversal of this node's descendants, calling action for each one. - * - * @param action - Action to be called for each child. - * @param includeSelf - Whether to call action on this node as well. Defaults to - * false. - * @param childrenFirst - Whether to call action on children before calling it on - * parent. - */ -function treeForEachDescendant(tree, action, includeSelf, childrenFirst) { - if (includeSelf && !childrenFirst) { - action(tree); - } - treeForEachChild(tree, function (child) { - treeForEachDescendant(child, action, true, childrenFirst); - }); - if (includeSelf && childrenFirst) { - action(tree); - } -} -/** - * Calls action on each ancestor node. - * - * @param action - Action to be called on each parent; return - * true to abort. - * @param includeSelf - Whether to call action on this node as well. - * @returns true if the action callback returned true. - */ -function treeForEachAncestor(tree, action, includeSelf) { - var node = includeSelf ? tree : tree.parent; - while (node !== null) { - if (action(node)) { - return true; - } - node = node.parent; - } - return false; -} -/** - * @returns The path of this tree node, as a Path. - */ -function treeGetPath(tree) { - return new Path(tree.parent === null - ? tree.name - : treeGetPath(tree.parent) + '/' + tree.name); -} -/** - * Adds or removes this child from its parent based on whether it's empty or not. - */ -function treeUpdateParents(tree) { - if (tree.parent !== null) { - treeUpdateChild(tree.parent, tree.name, tree); - } -} -/** - * Adds or removes the passed child to this tree node, depending on whether it's empty. - * - * @param childName - The name of the child to update. - * @param child - The child to update. - */ -function treeUpdateChild(tree, childName, child) { - var childEmpty = treeIsEmpty(child); - var childExists = util.contains(tree.node.children, childName); - if (childEmpty && childExists) { - delete tree.node.children[childName]; - tree.node.childCount--; - treeUpdateParents(tree); - } - else if (!childEmpty && !childExists) { - tree.node.children[childName] = child.node; - tree.node.childCount++; - treeUpdateParents(tree); - } -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * True for invalid Firebase keys - */ -var INVALID_KEY_REGEX_ = /[\[\].#$\/\u0000-\u001F\u007F]/; -/** - * True for invalid Firebase paths. - * Allows '/' in paths. - */ -var INVALID_PATH_REGEX_ = /[\[\].#$\u0000-\u001F\u007F]/; -/** - * Maximum number of characters to allow in leaf value - */ -var MAX_LEAF_SIZE_ = 10 * 1024 * 1024; -var isValidKey = function (key) { - return (typeof key === 'string' && key.length !== 0 && !INVALID_KEY_REGEX_.test(key)); -}; -var isValidPathString = function (pathString) { - return (typeof pathString === 'string' && - pathString.length !== 0 && - !INVALID_PATH_REGEX_.test(pathString)); -}; -var isValidRootPathString = function (pathString) { - if (pathString) { - // Allow '/.info/' at the beginning. - pathString = pathString.replace(/^\/*\.info(\/|$)/, '/'); - } - return isValidPathString(pathString); -}; -var isValidPriority = function (priority) { - return (priority === null || - typeof priority === 'string' || - (typeof priority === 'number' && !isInvalidJSONNumber(priority)) || - (priority && - typeof priority === 'object' && - // eslint-disable-next-line @typescript-eslint/no-explicit-any - util.contains(priority, '.sv'))); -}; -/** - * Pre-validate a datum passed as an argument to Firebase function. - */ -var validateFirebaseDataArg = function (fnName, value, path, optional) { - if (optional && value === undefined) { - return; - } - validateFirebaseData(util.errorPrefix(fnName, 'value'), value, path); -}; -/** - * Validate a data object client-side before sending to server. - */ -var validateFirebaseData = function (errorPrefix, data, path_) { - var path = path_ instanceof Path ? new ValidationPath(path_, errorPrefix) : path_; - if (data === undefined) { - throw new Error(errorPrefix + 'contains undefined ' + validationPathToErrorString(path)); - } - if (typeof data === 'function') { - throw new Error(errorPrefix + - 'contains a function ' + - validationPathToErrorString(path) + - ' with contents = ' + - data.toString()); - } - if (isInvalidJSONNumber(data)) { - throw new Error(errorPrefix + - 'contains ' + - data.toString() + - ' ' + - validationPathToErrorString(path)); - } - // Check max leaf size, but try to avoid the utf8 conversion if we can. - if (typeof data === 'string' && - data.length > MAX_LEAF_SIZE_ / 3 && - util.stringLength(data) > MAX_LEAF_SIZE_) { - throw new Error(errorPrefix + - 'contains a string greater than ' + - MAX_LEAF_SIZE_ + - ' utf8 bytes ' + - validationPathToErrorString(path) + - " ('" + - data.substring(0, 50) + - "...')"); - } - // TODO = Perf = Consider combining the recursive validation of keys into NodeFromJSON - // to save extra walking of large objects. - if (data && typeof data === 'object') { - var hasDotValue_1 = false; - var hasActualChild_1 = false; - each(data, function (key, value) { - if (key === '.value') { - hasDotValue_1 = true; - } - else if (key !== '.priority' && key !== '.sv') { - hasActualChild_1 = true; - if (!isValidKey(key)) { - throw new Error(errorPrefix + - ' contains an invalid key (' + - key + - ') ' + - validationPathToErrorString(path) + - '. Keys must be non-empty strings ' + - 'and can\'t contain ".", "#", "$", "/", "[", or "]"'); - } - } - validationPathPush(path, key); - validateFirebaseData(errorPrefix, value, path); - validationPathPop(path); - }); - if (hasDotValue_1 && hasActualChild_1) { - throw new Error(errorPrefix + - ' contains ".value" child ' + - validationPathToErrorString(path) + - ' in addition to actual children.'); - } - } -}; -/** - * Pre-validate paths passed in the firebase function. - */ -var validateFirebaseMergePaths = function (errorPrefix, mergePaths) { - var i, curPath; - for (i = 0; i < mergePaths.length; i++) { - curPath = mergePaths[i]; - var keys = pathSlice(curPath); - for (var j = 0; j < keys.length; j++) { - if (keys[j] === '.priority' && j === keys.length - 1) ; - else if (!isValidKey(keys[j])) { - throw new Error(errorPrefix + - 'contains an invalid key (' + - keys[j] + - ') in path ' + - curPath.toString() + - '. Keys must be non-empty strings ' + - 'and can\'t contain ".", "#", "$", "/", "[", or "]"'); - } - } - } - // Check that update keys are not descendants of each other. - // We rely on the property that sorting guarantees that ancestors come - // right before descendants. - mergePaths.sort(pathCompare); - var prevPath = null; - for (i = 0; i < mergePaths.length; i++) { - curPath = mergePaths[i]; - if (prevPath !== null && pathContains(prevPath, curPath)) { - throw new Error(errorPrefix + - 'contains a path ' + - prevPath.toString() + - ' that is ancestor of another path ' + - curPath.toString()); - } - prevPath = curPath; - } -}; -/** - * pre-validate an object passed as an argument to firebase function ( - * must be an object - e.g. for firebase.update()). - */ -var validateFirebaseMergeDataArg = function (fnName, data, path, optional) { - if (optional && data === undefined) { - return; - } - var errorPrefix = util.errorPrefix(fnName, 'values'); - if (!(data && typeof data === 'object') || Array.isArray(data)) { - throw new Error(errorPrefix + ' must be an object containing the children to replace.'); - } - var mergePaths = []; - each(data, function (key, value) { - var curPath = new Path(key); - validateFirebaseData(errorPrefix, value, pathChild(path, curPath)); - if (pathGetBack(curPath) === '.priority') { - if (!isValidPriority(value)) { - throw new Error(errorPrefix + - "contains an invalid value for '" + - curPath.toString() + - "', which must be a valid " + - 'Firebase priority (a string, finite number, server value, or null).'); - } - } - mergePaths.push(curPath); - }); - validateFirebaseMergePaths(errorPrefix, mergePaths); -}; -var validatePriority = function (fnName, priority, optional) { - if (optional && priority === undefined) { - return; - } - if (isInvalidJSONNumber(priority)) { - throw new Error(util.errorPrefix(fnName, 'priority') + - 'is ' + - priority.toString() + - ', but must be a valid Firebase priority (a string, finite number, ' + - 'server value, or null).'); - } - // Special case to allow importing data with a .sv. - if (!isValidPriority(priority)) { - throw new Error(util.errorPrefix(fnName, 'priority') + - 'must be a valid Firebase priority ' + - '(a string, finite number, server value, or null).'); - } -}; -var validateKey = function (fnName, argumentName, key, optional) { - if (optional && key === undefined) { - return; - } - if (!isValidKey(key)) { - throw new Error(util.errorPrefix(fnName, argumentName) + - 'was an invalid key = "' + - key + - '". Firebase keys must be non-empty strings and ' + - 'can\'t contain ".", "#", "$", "/", "[", or "]").'); - } -}; -/** - * @internal - */ -var validatePathString = function (fnName, argumentName, pathString, optional) { - if (optional && pathString === undefined) { - return; - } - if (!isValidPathString(pathString)) { - throw new Error(util.errorPrefix(fnName, argumentName) + - 'was an invalid path = "' + - pathString + - '". Paths must be non-empty strings and ' + - 'can\'t contain ".", "#", "$", "[", or "]"'); - } -}; -var validateRootPathString = function (fnName, argumentName, pathString, optional) { - if (pathString) { - // Allow '/.info/' at the beginning. - pathString = pathString.replace(/^\/*\.info(\/|$)/, '/'); - } - validatePathString(fnName, argumentName, pathString, optional); -}; -/** - * @internal - */ -var validateWritablePath = function (fnName, path) { - if (pathGetFront(path) === '.info') { - throw new Error(fnName + " failed = Can't modify data under /.info/"); - } -}; -var validateUrl = function (fnName, parsedUrl) { - // TODO = Validate server better. - var pathString = parsedUrl.path.toString(); - if (!(typeof parsedUrl.repoInfo.host === 'string') || - parsedUrl.repoInfo.host.length === 0 || - (!isValidKey(parsedUrl.repoInfo.namespace) && - parsedUrl.repoInfo.host.split(':')[0] !== 'localhost') || - (pathString.length !== 0 && !isValidRootPathString(pathString))) { - throw new Error(util.errorPrefix(fnName, 'url') + - 'must be a valid firebase URL and ' + - 'the path can\'t contain ".", "#", "$", "[", or "]".'); - } -}; - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * The event queue serves a few purposes: - * 1. It ensures we maintain event order in the face of event callbacks doing operations that result in more - * events being queued. - * 2. raiseQueuedEvents() handles being called reentrantly nicely. That is, if in the course of raising events, - * raiseQueuedEvents() is called again, the "inner" call will pick up raising events where the "outer" call - * left off, ensuring that the events are still raised synchronously and in order. - * 3. You can use raiseEventsAtPath and raiseEventsForChangedPath to ensure only relevant previously-queued - * events are raised synchronously. - * - * NOTE: This can all go away if/when we move to async events. - * - */ -var EventQueue = /** @class */ (function () { - function EventQueue() { - this.eventLists_ = []; - /** - * Tracks recursion depth of raiseQueuedEvents_, for debugging purposes. - */ - this.recursionDepth_ = 0; - } - return EventQueue; -}()); -/** - * @param eventDataList - The new events to queue. - */ -function eventQueueQueueEvents(eventQueue, eventDataList) { - // We group events by path, storing them in a single EventList, to make it easier to skip over them quickly. - var currList = null; - for (var i = 0; i < eventDataList.length; i++) { - var data = eventDataList[i]; - var path = data.getPath(); - if (currList !== null && !pathEquals(path, currList.path)) { - eventQueue.eventLists_.push(currList); - currList = null; - } - if (currList === null) { - currList = { events: [], path: path }; - } - currList.events.push(data); - } - if (currList) { - eventQueue.eventLists_.push(currList); - } -} -/** - * Queues the specified events and synchronously raises all events (including previously queued ones) - * for the specified path. - * - * It is assumed that the new events are all for the specified path. - * - * @param path - The path to raise events for. - * @param eventDataList - The new events to raise. - */ -function eventQueueRaiseEventsAtPath(eventQueue, path, eventDataList) { - eventQueueQueueEvents(eventQueue, eventDataList); - eventQueueRaiseQueuedEventsMatchingPredicate(eventQueue, function (eventPath) { - return pathEquals(eventPath, path); - }); -} -/** - * Queues the specified events and synchronously raises all events (including previously queued ones) for - * locations related to the specified change path (i.e. all ancestors and descendants). - * - * It is assumed that the new events are all related (ancestor or descendant) to the specified path. - * - * @param changedPath - The path to raise events for. - * @param eventDataList - The events to raise - */ -function eventQueueRaiseEventsForChangedPath(eventQueue, changedPath, eventDataList) { - eventQueueQueueEvents(eventQueue, eventDataList); - eventQueueRaiseQueuedEventsMatchingPredicate(eventQueue, function (eventPath) { - return pathContains(eventPath, changedPath) || - pathContains(changedPath, eventPath); - }); -} -function eventQueueRaiseQueuedEventsMatchingPredicate(eventQueue, predicate) { - eventQueue.recursionDepth_++; - var sentAll = true; - for (var i = 0; i < eventQueue.eventLists_.length; i++) { - var eventList = eventQueue.eventLists_[i]; - if (eventList) { - var eventPath = eventList.path; - if (predicate(eventPath)) { - eventListRaise(eventQueue.eventLists_[i]); - eventQueue.eventLists_[i] = null; - } - else { - sentAll = false; - } - } - } - if (sentAll) { - eventQueue.eventLists_ = []; - } - eventQueue.recursionDepth_--; -} -/** - * Iterates through the list and raises each event - */ -function eventListRaise(eventList) { - for (var i = 0; i < eventList.events.length; i++) { - var eventData = eventList.events[i]; - if (eventData !== null) { - eventList.events[i] = null; - var eventFn = eventData.getEventRunner(); - if (logger) { - log('event: ' + eventData.toString()); - } - exceptionGuard(eventFn); - } - } -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var INTERRUPT_REASON = 'repo_interrupt'; -/** - * If a transaction does not succeed after 25 retries, we abort it. Among other - * things this ensure that if there's ever a bug causing a mismatch between - * client / server hashes for some data, we won't retry indefinitely. - */ -var MAX_TRANSACTION_RETRIES = 25; -/** - * A connection to a single data repository. - */ -var Repo = /** @class */ (function () { - function Repo(repoInfo_, forceRestClient_, authTokenProvider_, appCheckProvider_) { - this.repoInfo_ = repoInfo_; - this.forceRestClient_ = forceRestClient_; - this.authTokenProvider_ = authTokenProvider_; - this.appCheckProvider_ = appCheckProvider_; - this.dataUpdateCount = 0; - this.statsListener_ = null; - this.eventQueue_ = new EventQueue(); - this.nextWriteId_ = 1; - this.interceptServerDataCallback_ = null; - /** A list of data pieces and paths to be set when this client disconnects. */ - this.onDisconnect_ = newSparseSnapshotTree(); - /** Stores queues of outstanding transactions for Firebase locations. */ - this.transactionQueueTree_ = new Tree(); - // TODO: This should be @private but it's used by test_access.js and internal.js - this.persistentConnection_ = null; - // This key is intentionally not updated if RepoInfo is later changed or replaced - this.key = this.repoInfo_.toURLString(); - } - /** - * @returns The URL corresponding to the root of this Firebase. - */ - Repo.prototype.toString = function () { - return ((this.repoInfo_.secure ? 'https://' : 'http://') + this.repoInfo_.host); - }; - return Repo; -}()); -function repoStart(repo, appId, authOverride) { - repo.stats_ = statsManagerGetCollection(repo.repoInfo_); - if (repo.forceRestClient_ || beingCrawled()) { - repo.server_ = new ReadonlyRestClient(repo.repoInfo_, function (pathString, data, isMerge, tag) { - repoOnDataUpdate(repo, pathString, data, isMerge, tag); - }, repo.authTokenProvider_, repo.appCheckProvider_); - // Minor hack: Fire onConnect immediately, since there's no actual connection. - setTimeout(function () { return repoOnConnectStatus(repo, /* connectStatus= */ true); }, 0); - } - else { - // Validate authOverride - if (typeof authOverride !== 'undefined' && authOverride !== null) { - if (typeof authOverride !== 'object') { - throw new Error('Only objects are supported for option databaseAuthVariableOverride'); - } - try { - util.stringify(authOverride); - } - catch (e) { - throw new Error('Invalid authOverride provided: ' + e); - } - } - repo.persistentConnection_ = new PersistentConnection(repo.repoInfo_, appId, function (pathString, data, isMerge, tag) { - repoOnDataUpdate(repo, pathString, data, isMerge, tag); - }, function (connectStatus) { - repoOnConnectStatus(repo, connectStatus); - }, function (updates) { - repoOnServerInfoUpdate(repo, updates); - }, repo.authTokenProvider_, repo.appCheckProvider_, authOverride); - repo.server_ = repo.persistentConnection_; - } - repo.authTokenProvider_.addTokenChangeListener(function (token) { - repo.server_.refreshAuthToken(token); - }); - repo.appCheckProvider_.addTokenChangeListener(function (result) { - repo.server_.refreshAppCheckToken(result.token); - }); - // In the case of multiple Repos for the same repoInfo (i.e. there are multiple Firebase.Contexts being used), - // we only want to create one StatsReporter. As such, we'll report stats over the first Repo created. - repo.statsReporter_ = statsManagerGetOrCreateReporter(repo.repoInfo_, function () { return new StatsReporter(repo.stats_, repo.server_); }); - // Used for .info. - repo.infoData_ = new SnapshotHolder(); - repo.infoSyncTree_ = new SyncTree({ - startListening: function (query, tag, currentHashFn, onComplete) { - var infoEvents = []; - var node = repo.infoData_.getNode(query._path); - // This is possibly a hack, but we have different semantics for .info endpoints. We don't raise null events - // on initial data... - if (!node.isEmpty()) { - infoEvents = syncTreeApplyServerOverwrite(repo.infoSyncTree_, query._path, node); - setTimeout(function () { - onComplete('ok'); - }, 0); - } - return infoEvents; - }, - stopListening: function () { } - }); - repoUpdateInfo(repo, 'connected', false); - repo.serverSyncTree_ = new SyncTree({ - startListening: function (query, tag, currentHashFn, onComplete) { - repo.server_.listen(query, currentHashFn, tag, function (status, data) { - var events = onComplete(status, data); - eventQueueRaiseEventsForChangedPath(repo.eventQueue_, query._path, events); - }); - // No synchronous events for network-backed sync trees - return []; - }, - stopListening: function (query, tag) { - repo.server_.unlisten(query, tag); - } - }); -} -/** - * @returns The time in milliseconds, taking the server offset into account if we have one. - */ -function repoServerTime(repo) { - var offsetNode = repo.infoData_.getNode(new Path('.info/serverTimeOffset')); - var offset = offsetNode.val() || 0; - return new Date().getTime() + offset; -} -/** - * Generate ServerValues using some variables from the repo object. - */ -function repoGenerateServerValues(repo) { - return generateWithValues({ - timestamp: repoServerTime(repo) - }); -} -/** - * Called by realtime when we get new messages from the server. - */ -function repoOnDataUpdate(repo, pathString, data, isMerge, tag) { - // For testing. - repo.dataUpdateCount++; - var path = new Path(pathString); - data = repo.interceptServerDataCallback_ - ? repo.interceptServerDataCallback_(pathString, data) - : data; - var events = []; - if (tag) { - if (isMerge) { - var taggedChildren = util.map(data, function (raw) { return nodeFromJSON(raw); }); - events = syncTreeApplyTaggedQueryMerge(repo.serverSyncTree_, path, taggedChildren, tag); - } - else { - var taggedSnap = nodeFromJSON(data); - events = syncTreeApplyTaggedQueryOverwrite(repo.serverSyncTree_, path, taggedSnap, tag); - } - } - else if (isMerge) { - var changedChildren = util.map(data, function (raw) { return nodeFromJSON(raw); }); - events = syncTreeApplyServerMerge(repo.serverSyncTree_, path, changedChildren); - } - else { - var snap = nodeFromJSON(data); - events = syncTreeApplyServerOverwrite(repo.serverSyncTree_, path, snap); - } - var affectedPath = path; - if (events.length > 0) { - // Since we have a listener outstanding for each transaction, receiving any events - // is a proxy for some change having occurred. - affectedPath = repoRerunTransactions(repo, path); - } - eventQueueRaiseEventsForChangedPath(repo.eventQueue_, affectedPath, events); -} -function repoOnConnectStatus(repo, connectStatus) { - repoUpdateInfo(repo, 'connected', connectStatus); - if (connectStatus === false) { - repoRunOnDisconnectEvents(repo); - } -} -function repoOnServerInfoUpdate(repo, updates) { - each(updates, function (key, value) { - repoUpdateInfo(repo, key, value); - }); -} -function repoUpdateInfo(repo, pathString, value) { - var path = new Path('/.info/' + pathString); - var newNode = nodeFromJSON(value); - repo.infoData_.updateSnapshot(path, newNode); - var events = syncTreeApplyServerOverwrite(repo.infoSyncTree_, path, newNode); - eventQueueRaiseEventsForChangedPath(repo.eventQueue_, path, events); -} -function repoGetNextWriteId(repo) { - return repo.nextWriteId_++; -} -/** - * The purpose of `getValue` is to return the latest known value - * satisfying `query`. - * - * This method will first check for in-memory cached values - * belonging to active listeners. If they are found, such values - * are considered to be the most up-to-date. - * - * If the client is not connected, this method will wait until the - * repo has established a connection and then request the value for `query`. - * If the client is not able to retrieve the query result for another reason, - * it reports an error. - * - * @param query - The query to surface a value for. - */ -function repoGetValue(repo, query, eventRegistration) { - // Only active queries are cached. There is no persisted cache. - var cached = syncTreeGetServerValue(repo.serverSyncTree_, query); - if (cached != null) { - return Promise.resolve(cached); - } - return repo.server_.get(query).then(function (payload) { - var node = nodeFromJSON(payload).withIndex(query._queryParams.getIndex()); - /** - * Below we simulate the actions of an `onlyOnce` `onValue()` event where: - * Add an event registration, - * Update data at the path, - * Raise any events, - * Cleanup the SyncTree - */ - syncTreeAddEventRegistration(repo.serverSyncTree_, query, eventRegistration, true); - var events; - if (query._queryParams.loadsAllData()) { - events = syncTreeApplyServerOverwrite(repo.serverSyncTree_, query._path, node); - } - else { - var tag = syncTreeTagForQuery(repo.serverSyncTree_, query); - events = syncTreeApplyTaggedQueryOverwrite(repo.serverSyncTree_, query._path, node, tag); - } - /* - * We need to raise events in the scenario where `get()` is called at a parent path, and - * while the `get()` is pending, `onValue` is called at a child location. While get() is waiting - * for the data, `onValue` will register a new event. Then, get() will come back, and update the syncTree - * and its corresponding serverCache, including the child location where `onValue` is called. Then, - * `onValue` will receive the event from the server, but look at the syncTree and see that the data received - * from the server is already at the SyncPoint, and so the `onValue` callback will never get fired. - * Calling `eventQueueRaiseEventsForChangedPath()` is the correct way to propagate the events and - * ensure the corresponding child events will get fired. - */ - eventQueueRaiseEventsForChangedPath(repo.eventQueue_, query._path, events); - syncTreeRemoveEventRegistration(repo.serverSyncTree_, query, eventRegistration, null, true); - return node; - }, function (err) { - repoLog(repo, 'get for query ' + util.stringify(query) + ' failed: ' + err); - return Promise.reject(new Error(err)); - }); -} -function repoSetWithPriority(repo, path, newVal, newPriority, onComplete) { - repoLog(repo, 'set', { - path: path.toString(), - value: newVal, - priority: newPriority - }); - // TODO: Optimize this behavior to either (a) store flag to skip resolving where possible and / or - // (b) store unresolved paths on JSON parse - var serverValues = repoGenerateServerValues(repo); - var newNodeUnresolved = nodeFromJSON(newVal, newPriority); - var existing = syncTreeCalcCompleteEventCache(repo.serverSyncTree_, path); - var newNode = resolveDeferredValueSnapshot(newNodeUnresolved, existing, serverValues); - var writeId = repoGetNextWriteId(repo); - var events = syncTreeApplyUserOverwrite(repo.serverSyncTree_, path, newNode, writeId, true); - eventQueueQueueEvents(repo.eventQueue_, events); - repo.server_.put(path.toString(), newNodeUnresolved.val(/*export=*/ true), function (status, errorReason) { - var success = status === 'ok'; - if (!success) { - warn('set at ' + path + ' failed: ' + status); - } - var clearEvents = syncTreeAckUserWrite(repo.serverSyncTree_, writeId, !success); - eventQueueRaiseEventsForChangedPath(repo.eventQueue_, path, clearEvents); - repoCallOnCompleteCallback(repo, onComplete, status, errorReason); - }); - var affectedPath = repoAbortTransactions(repo, path); - repoRerunTransactions(repo, affectedPath); - // We queued the events above, so just flush the queue here - eventQueueRaiseEventsForChangedPath(repo.eventQueue_, affectedPath, []); -} -function repoUpdate(repo, path, childrenToMerge, onComplete) { - repoLog(repo, 'update', { path: path.toString(), value: childrenToMerge }); - // Start with our existing data and merge each child into it. - var empty = true; - var serverValues = repoGenerateServerValues(repo); - var changedChildren = {}; - each(childrenToMerge, function (changedKey, changedValue) { - empty = false; - changedChildren[changedKey] = resolveDeferredValueTree(pathChild(path, changedKey), nodeFromJSON(changedValue), repo.serverSyncTree_, serverValues); - }); - if (!empty) { - var writeId_1 = repoGetNextWriteId(repo); - var events = syncTreeApplyUserMerge(repo.serverSyncTree_, path, changedChildren, writeId_1); - eventQueueQueueEvents(repo.eventQueue_, events); - repo.server_.merge(path.toString(), childrenToMerge, function (status, errorReason) { - var success = status === 'ok'; - if (!success) { - warn('update at ' + path + ' failed: ' + status); - } - var clearEvents = syncTreeAckUserWrite(repo.serverSyncTree_, writeId_1, !success); - var affectedPath = clearEvents.length > 0 ? repoRerunTransactions(repo, path) : path; - eventQueueRaiseEventsForChangedPath(repo.eventQueue_, affectedPath, clearEvents); - repoCallOnCompleteCallback(repo, onComplete, status, errorReason); - }); - each(childrenToMerge, function (changedPath) { - var affectedPath = repoAbortTransactions(repo, pathChild(path, changedPath)); - repoRerunTransactions(repo, affectedPath); - }); - // We queued the events above, so just flush the queue here - eventQueueRaiseEventsForChangedPath(repo.eventQueue_, path, []); - } - else { - log("update() called with empty data. Don't do anything."); - repoCallOnCompleteCallback(repo, onComplete, 'ok', undefined); - } -} -/** - * Applies all of the changes stored up in the onDisconnect_ tree. - */ -function repoRunOnDisconnectEvents(repo) { - repoLog(repo, 'onDisconnectEvents'); - var serverValues = repoGenerateServerValues(repo); - var resolvedOnDisconnectTree = newSparseSnapshotTree(); - sparseSnapshotTreeForEachTree(repo.onDisconnect_, newEmptyPath(), function (path, node) { - var resolved = resolveDeferredValueTree(path, node, repo.serverSyncTree_, serverValues); - sparseSnapshotTreeRemember(resolvedOnDisconnectTree, path, resolved); - }); - var events = []; - sparseSnapshotTreeForEachTree(resolvedOnDisconnectTree, newEmptyPath(), function (path, snap) { - events = events.concat(syncTreeApplyServerOverwrite(repo.serverSyncTree_, path, snap)); - var affectedPath = repoAbortTransactions(repo, path); - repoRerunTransactions(repo, affectedPath); - }); - repo.onDisconnect_ = newSparseSnapshotTree(); - eventQueueRaiseEventsForChangedPath(repo.eventQueue_, newEmptyPath(), events); -} -function repoOnDisconnectCancel(repo, path, onComplete) { - repo.server_.onDisconnectCancel(path.toString(), function (status, errorReason) { - if (status === 'ok') { - sparseSnapshotTreeForget(repo.onDisconnect_, path); - } - repoCallOnCompleteCallback(repo, onComplete, status, errorReason); - }); -} -function repoOnDisconnectSet(repo, path, value, onComplete) { - var newNode = nodeFromJSON(value); - repo.server_.onDisconnectPut(path.toString(), newNode.val(/*export=*/ true), function (status, errorReason) { - if (status === 'ok') { - sparseSnapshotTreeRemember(repo.onDisconnect_, path, newNode); - } - repoCallOnCompleteCallback(repo, onComplete, status, errorReason); - }); -} -function repoOnDisconnectSetWithPriority(repo, path, value, priority, onComplete) { - var newNode = nodeFromJSON(value, priority); - repo.server_.onDisconnectPut(path.toString(), newNode.val(/*export=*/ true), function (status, errorReason) { - if (status === 'ok') { - sparseSnapshotTreeRemember(repo.onDisconnect_, path, newNode); - } - repoCallOnCompleteCallback(repo, onComplete, status, errorReason); - }); -} -function repoOnDisconnectUpdate(repo, path, childrenToMerge, onComplete) { - if (util.isEmpty(childrenToMerge)) { - log("onDisconnect().update() called with empty data. Don't do anything."); - repoCallOnCompleteCallback(repo, onComplete, 'ok', undefined); - return; - } - repo.server_.onDisconnectMerge(path.toString(), childrenToMerge, function (status, errorReason) { - if (status === 'ok') { - each(childrenToMerge, function (childName, childNode) { - var newChildNode = nodeFromJSON(childNode); - sparseSnapshotTreeRemember(repo.onDisconnect_, pathChild(path, childName), newChildNode); - }); - } - repoCallOnCompleteCallback(repo, onComplete, status, errorReason); - }); -} -function repoAddEventCallbackForQuery(repo, query, eventRegistration) { - var events; - if (pathGetFront(query._path) === '.info') { - events = syncTreeAddEventRegistration(repo.infoSyncTree_, query, eventRegistration); - } - else { - events = syncTreeAddEventRegistration(repo.serverSyncTree_, query, eventRegistration); - } - eventQueueRaiseEventsAtPath(repo.eventQueue_, query._path, events); -} -function repoRemoveEventCallbackForQuery(repo, query, eventRegistration) { - // These are guaranteed not to raise events, since we're not passing in a cancelError. However, we can future-proof - // a little bit by handling the return values anyways. - var events; - if (pathGetFront(query._path) === '.info') { - events = syncTreeRemoveEventRegistration(repo.infoSyncTree_, query, eventRegistration); - } - else { - events = syncTreeRemoveEventRegistration(repo.serverSyncTree_, query, eventRegistration); - } - eventQueueRaiseEventsAtPath(repo.eventQueue_, query._path, events); -} -function repoInterrupt(repo) { - if (repo.persistentConnection_) { - repo.persistentConnection_.interrupt(INTERRUPT_REASON); - } -} -function repoResume(repo) { - if (repo.persistentConnection_) { - repo.persistentConnection_.resume(INTERRUPT_REASON); - } -} -function repoLog(repo) { - var varArgs = []; - for (var _i = 1; _i < arguments.length; _i++) { - varArgs[_i - 1] = arguments[_i]; - } - var prefix = ''; - if (repo.persistentConnection_) { - prefix = repo.persistentConnection_.id + ':'; - } - log.apply(void 0, tslib.__spreadArray([prefix], tslib.__read(varArgs))); -} -function repoCallOnCompleteCallback(repo, callback, status, errorReason) { - if (callback) { - exceptionGuard(function () { - if (status === 'ok') { - callback(null); - } - else { - var code = (status || 'error').toUpperCase(); - var message = code; - if (errorReason) { - message += ': ' + errorReason; - } - var error = new Error(message); - // eslint-disable-next-line @typescript-eslint/no-explicit-any - error.code = code; - callback(error); - } - }); - } -} -/** - * Creates a new transaction, adds it to the transactions we're tracking, and - * sends it to the server if possible. - * - * @param path - Path at which to do transaction. - * @param transactionUpdate - Update callback. - * @param onComplete - Completion callback. - * @param unwatcher - Function that will be called when the transaction no longer - * need data updates for `path`. - * @param applyLocally - Whether or not to make intermediate results visible - */ -function repoStartTransaction(repo, path, transactionUpdate, onComplete, unwatcher, applyLocally) { - repoLog(repo, 'transaction on ' + path); - // Initialize transaction. - var transaction = { - path: path, - update: transactionUpdate, - onComplete: onComplete, - // One of TransactionStatus enums. - status: null, - // Used when combining transactions at different locations to figure out - // which one goes first. - order: LUIDGenerator(), - // Whether to raise local events for this transaction. - applyLocally: applyLocally, - // Count of how many times we've retried the transaction. - retryCount: 0, - // Function to call to clean up our .on() listener. - unwatcher: unwatcher, - // Stores why a transaction was aborted. - abortReason: null, - currentWriteId: null, - currentInputSnapshot: null, - currentOutputSnapshotRaw: null, - currentOutputSnapshotResolved: null - }; - // Run transaction initially. - var currentState = repoGetLatestState(repo, path, undefined); - transaction.currentInputSnapshot = currentState; - var newVal = transaction.update(currentState.val()); - if (newVal === undefined) { - // Abort transaction. - transaction.unwatcher(); - transaction.currentOutputSnapshotRaw = null; - transaction.currentOutputSnapshotResolved = null; - if (transaction.onComplete) { - transaction.onComplete(null, false, transaction.currentInputSnapshot); - } - } - else { - validateFirebaseData('transaction failed: Data returned ', newVal, transaction.path); - // Mark as run and add to our queue. - transaction.status = 0 /* RUN */; - var queueNode = treeSubTree(repo.transactionQueueTree_, path); - var nodeQueue = treeGetValue(queueNode) || []; - nodeQueue.push(transaction); - treeSetValue(queueNode, nodeQueue); - // Update visibleData and raise events - // Note: We intentionally raise events after updating all of our - // transaction state, since the user could start new transactions from the - // event callbacks. - var priorityForNode = void 0; - if (typeof newVal === 'object' && - newVal !== null && - util.contains(newVal, '.priority')) { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - priorityForNode = util.safeGet(newVal, '.priority'); - util.assert(isValidPriority(priorityForNode), 'Invalid priority returned by transaction. ' + - 'Priority must be a valid string, finite number, server value, or null.'); - } - else { - var currentNode = syncTreeCalcCompleteEventCache(repo.serverSyncTree_, path) || - ChildrenNode.EMPTY_NODE; - priorityForNode = currentNode.getPriority().val(); - } - var serverValues = repoGenerateServerValues(repo); - var newNodeUnresolved = nodeFromJSON(newVal, priorityForNode); - var newNode = resolveDeferredValueSnapshot(newNodeUnresolved, currentState, serverValues); - transaction.currentOutputSnapshotRaw = newNodeUnresolved; - transaction.currentOutputSnapshotResolved = newNode; - transaction.currentWriteId = repoGetNextWriteId(repo); - var events = syncTreeApplyUserOverwrite(repo.serverSyncTree_, path, newNode, transaction.currentWriteId, transaction.applyLocally); - eventQueueRaiseEventsForChangedPath(repo.eventQueue_, path, events); - repoSendReadyTransactions(repo, repo.transactionQueueTree_); - } -} -/** - * @param excludeSets - A specific set to exclude - */ -function repoGetLatestState(repo, path, excludeSets) { - return (syncTreeCalcCompleteEventCache(repo.serverSyncTree_, path, excludeSets) || - ChildrenNode.EMPTY_NODE); -} -/** - * Sends any already-run transactions that aren't waiting for outstanding - * transactions to complete. - * - * Externally it's called with no arguments, but it calls itself recursively - * with a particular transactionQueueTree node to recurse through the tree. - * - * @param node - transactionQueueTree node to start at. - */ -function repoSendReadyTransactions(repo, node) { - if (node === void 0) { node = repo.transactionQueueTree_; } - // Before recursing, make sure any completed transactions are removed. - if (!node) { - repoPruneCompletedTransactionsBelowNode(repo, node); - } - if (treeGetValue(node)) { - var queue = repoBuildTransactionQueue(repo, node); - util.assert(queue.length > 0, 'Sending zero length transaction queue'); - var allRun = queue.every(function (transaction) { return transaction.status === 0 /* RUN */; }); - // If they're all run (and not sent), we can send them. Else, we must wait. - if (allRun) { - repoSendTransactionQueue(repo, treeGetPath(node), queue); - } - } - else if (treeHasChildren(node)) { - treeForEachChild(node, function (childNode) { - repoSendReadyTransactions(repo, childNode); - }); - } -} -/** - * Given a list of run transactions, send them to the server and then handle - * the result (success or failure). - * - * @param path - The location of the queue. - * @param queue - Queue of transactions under the specified location. - */ -function repoSendTransactionQueue(repo, path, queue) { - // Mark transactions as sent and increment retry count! - var setsToIgnore = queue.map(function (txn) { - return txn.currentWriteId; - }); - var latestState = repoGetLatestState(repo, path, setsToIgnore); - var snapToSend = latestState; - var latestHash = latestState.hash(); - for (var i = 0; i < queue.length; i++) { - var txn = queue[i]; - util.assert(txn.status === 0 /* RUN */, 'tryToSendTransactionQueue_: items in queue should all be run.'); - txn.status = 1 /* SENT */; - txn.retryCount++; - var relativePath = newRelativePath(path, txn.path); - // If we've gotten to this point, the output snapshot must be defined. - snapToSend = snapToSend.updateChild(relativePath /** @type {!Node} */, txn.currentOutputSnapshotRaw); - } - var dataToSend = snapToSend.val(true); - var pathToSend = path; - // Send the put. - repo.server_.put(pathToSend.toString(), dataToSend, function (status) { - repoLog(repo, 'transaction put response', { - path: pathToSend.toString(), - status: status - }); - var events = []; - if (status === 'ok') { - // Queue up the callbacks and fire them after cleaning up all of our - // transaction state, since the callback could trigger more - // transactions or sets. - var callbacks = []; - var _loop_1 = function (i) { - queue[i].status = 2 /* COMPLETED */; - events = events.concat(syncTreeAckUserWrite(repo.serverSyncTree_, queue[i].currentWriteId)); - if (queue[i].onComplete) { - // We never unset the output snapshot, and given that this - // transaction is complete, it should be set - callbacks.push(function () { - return queue[i].onComplete(null, true, queue[i].currentOutputSnapshotResolved); - }); - } - queue[i].unwatcher(); - }; - for (var i = 0; i < queue.length; i++) { - _loop_1(i); - } - // Now remove the completed transactions. - repoPruneCompletedTransactionsBelowNode(repo, treeSubTree(repo.transactionQueueTree_, path)); - // There may be pending transactions that we can now send. - repoSendReadyTransactions(repo, repo.transactionQueueTree_); - eventQueueRaiseEventsForChangedPath(repo.eventQueue_, path, events); - // Finally, trigger onComplete callbacks. - for (var i = 0; i < callbacks.length; i++) { - exceptionGuard(callbacks[i]); - } - } - else { - // transactions are no longer sent. Update their status appropriately. - if (status === 'datastale') { - for (var i = 0; i < queue.length; i++) { - if (queue[i].status === 3 /* SENT_NEEDS_ABORT */) { - queue[i].status = 4 /* NEEDS_ABORT */; - } - else { - queue[i].status = 0 /* RUN */; - } - } - } - else { - warn('transaction at ' + pathToSend.toString() + ' failed: ' + status); - for (var i = 0; i < queue.length; i++) { - queue[i].status = 4 /* NEEDS_ABORT */; - queue[i].abortReason = status; - } - } - repoRerunTransactions(repo, path); - } - }, latestHash); -} -/** - * Finds all transactions dependent on the data at changedPath and reruns them. - * - * Should be called any time cached data changes. - * - * Return the highest path that was affected by rerunning transactions. This - * is the path at which events need to be raised for. - * - * @param changedPath - The path in mergedData that changed. - * @returns The rootmost path that was affected by rerunning transactions. - */ -function repoRerunTransactions(repo, changedPath) { - var rootMostTransactionNode = repoGetAncestorTransactionNode(repo, changedPath); - var path = treeGetPath(rootMostTransactionNode); - var queue = repoBuildTransactionQueue(repo, rootMostTransactionNode); - repoRerunTransactionQueue(repo, queue, path); - return path; -} -/** - * Does all the work of rerunning transactions (as well as cleans up aborted - * transactions and whatnot). - * - * @param queue - The queue of transactions to run. - * @param path - The path the queue is for. - */ -function repoRerunTransactionQueue(repo, queue, path) { - if (queue.length === 0) { - return; // Nothing to do! - } - // Queue up the callbacks and fire them after cleaning up all of our - // transaction state, since the callback could trigger more transactions or - // sets. - var callbacks = []; - var events = []; - // Ignore all of the sets we're going to re-run. - var txnsToRerun = queue.filter(function (q) { - return q.status === 0 /* RUN */; - }); - var setsToIgnore = txnsToRerun.map(function (q) { - return q.currentWriteId; - }); - var _loop_2 = function (i) { - var transaction = queue[i]; - var relativePath = newRelativePath(path, transaction.path); - var abortTransaction = false, abortReason; - util.assert(relativePath !== null, 'rerunTransactionsUnderNode_: relativePath should not be null.'); - if (transaction.status === 4 /* NEEDS_ABORT */) { - abortTransaction = true; - abortReason = transaction.abortReason; - events = events.concat(syncTreeAckUserWrite(repo.serverSyncTree_, transaction.currentWriteId, true)); - } - else if (transaction.status === 0 /* RUN */) { - if (transaction.retryCount >= MAX_TRANSACTION_RETRIES) { - abortTransaction = true; - abortReason = 'maxretry'; - events = events.concat(syncTreeAckUserWrite(repo.serverSyncTree_, transaction.currentWriteId, true)); - } - else { - // This code reruns a transaction - var currentNode = repoGetLatestState(repo, transaction.path, setsToIgnore); - transaction.currentInputSnapshot = currentNode; - var newData = queue[i].update(currentNode.val()); - if (newData !== undefined) { - validateFirebaseData('transaction failed: Data returned ', newData, transaction.path); - var newDataNode = nodeFromJSON(newData); - var hasExplicitPriority = typeof newData === 'object' && - newData != null && - util.contains(newData, '.priority'); - if (!hasExplicitPriority) { - // Keep the old priority if there wasn't a priority explicitly specified. - newDataNode = newDataNode.updatePriority(currentNode.getPriority()); - } - var oldWriteId = transaction.currentWriteId; - var serverValues = repoGenerateServerValues(repo); - var newNodeResolved = resolveDeferredValueSnapshot(newDataNode, currentNode, serverValues); - transaction.currentOutputSnapshotRaw = newDataNode; - transaction.currentOutputSnapshotResolved = newNodeResolved; - transaction.currentWriteId = repoGetNextWriteId(repo); - // Mutates setsToIgnore in place - setsToIgnore.splice(setsToIgnore.indexOf(oldWriteId), 1); - events = events.concat(syncTreeApplyUserOverwrite(repo.serverSyncTree_, transaction.path, newNodeResolved, transaction.currentWriteId, transaction.applyLocally)); - events = events.concat(syncTreeAckUserWrite(repo.serverSyncTree_, oldWriteId, true)); - } - else { - abortTransaction = true; - abortReason = 'nodata'; - events = events.concat(syncTreeAckUserWrite(repo.serverSyncTree_, transaction.currentWriteId, true)); - } - } - } - eventQueueRaiseEventsForChangedPath(repo.eventQueue_, path, events); - events = []; - if (abortTransaction) { - // Abort. - queue[i].status = 2 /* COMPLETED */; - // Removing a listener can trigger pruning which can muck with - // mergedData/visibleData (as it prunes data). So defer the unwatcher - // until we're done. - (function (unwatcher) { - setTimeout(unwatcher, Math.floor(0)); - })(queue[i].unwatcher); - if (queue[i].onComplete) { - if (abortReason === 'nodata') { - callbacks.push(function () { - return queue[i].onComplete(null, false, queue[i].currentInputSnapshot); - }); - } - else { - callbacks.push(function () { - return queue[i].onComplete(new Error(abortReason), false, null); - }); - } - } - } - }; - for (var i = 0; i < queue.length; i++) { - _loop_2(i); - } - // Clean up completed transactions. - repoPruneCompletedTransactionsBelowNode(repo, repo.transactionQueueTree_); - // Now fire callbacks, now that we're in a good, known state. - for (var i = 0; i < callbacks.length; i++) { - exceptionGuard(callbacks[i]); - } - // Try to send the transaction result to the server. - repoSendReadyTransactions(repo, repo.transactionQueueTree_); -} -/** - * Returns the rootmost ancestor node of the specified path that has a pending - * transaction on it, or just returns the node for the given path if there are - * no pending transactions on any ancestor. - * - * @param path - The location to start at. - * @returns The rootmost node with a transaction. - */ -function repoGetAncestorTransactionNode(repo, path) { - var front; - // Start at the root and walk deeper into the tree towards path until we - // find a node with pending transactions. - var transactionNode = repo.transactionQueueTree_; - front = pathGetFront(path); - while (front !== null && treeGetValue(transactionNode) === undefined) { - transactionNode = treeSubTree(transactionNode, front); - path = pathPopFront(path); - front = pathGetFront(path); - } - return transactionNode; -} -/** - * Builds the queue of all transactions at or below the specified - * transactionNode. - * - * @param transactionNode - * @returns The generated queue. - */ -function repoBuildTransactionQueue(repo, transactionNode) { - // Walk any child transaction queues and aggregate them into a single queue. - var transactionQueue = []; - repoAggregateTransactionQueuesForNode(repo, transactionNode, transactionQueue); - // Sort them by the order the transactions were created. - transactionQueue.sort(function (a, b) { return a.order - b.order; }); - return transactionQueue; -} -function repoAggregateTransactionQueuesForNode(repo, node, queue) { - var nodeQueue = treeGetValue(node); - if (nodeQueue) { - for (var i = 0; i < nodeQueue.length; i++) { - queue.push(nodeQueue[i]); - } - } - treeForEachChild(node, function (child) { - repoAggregateTransactionQueuesForNode(repo, child, queue); - }); -} -/** - * Remove COMPLETED transactions at or below this node in the transactionQueueTree_. - */ -function repoPruneCompletedTransactionsBelowNode(repo, node) { - var queue = treeGetValue(node); - if (queue) { - var to = 0; - for (var from = 0; from < queue.length; from++) { - if (queue[from].status !== 2 /* COMPLETED */) { - queue[to] = queue[from]; - to++; - } - } - queue.length = to; - treeSetValue(node, queue.length > 0 ? queue : undefined); - } - treeForEachChild(node, function (childNode) { - repoPruneCompletedTransactionsBelowNode(repo, childNode); - }); -} -/** - * Aborts all transactions on ancestors or descendants of the specified path. - * Called when doing a set() or update() since we consider them incompatible - * with transactions. - * - * @param path - Path for which we want to abort related transactions. - */ -function repoAbortTransactions(repo, path) { - var affectedPath = treeGetPath(repoGetAncestorTransactionNode(repo, path)); - var transactionNode = treeSubTree(repo.transactionQueueTree_, path); - treeForEachAncestor(transactionNode, function (node) { - repoAbortTransactionsOnNode(repo, node); - }); - repoAbortTransactionsOnNode(repo, transactionNode); - treeForEachDescendant(transactionNode, function (node) { - repoAbortTransactionsOnNode(repo, node); - }); - return affectedPath; -} -/** - * Abort transactions stored in this transaction queue node. - * - * @param node - Node to abort transactions for. - */ -function repoAbortTransactionsOnNode(repo, node) { - var queue = treeGetValue(node); - if (queue) { - // Queue up the callbacks and fire them after cleaning up all of our - // transaction state, since the callback could trigger more transactions - // or sets. - var callbacks = []; - // Go through queue. Any already-sent transactions must be marked for - // abort, while the unsent ones can be immediately aborted and removed. - var events = []; - var lastSent = -1; - for (var i = 0; i < queue.length; i++) { - if (queue[i].status === 3 /* SENT_NEEDS_ABORT */) ; - else if (queue[i].status === 1 /* SENT */) { - util.assert(lastSent === i - 1, 'All SENT items should be at beginning of queue.'); - lastSent = i; - // Mark transaction for abort when it comes back. - queue[i].status = 3 /* SENT_NEEDS_ABORT */; - queue[i].abortReason = 'set'; - } - else { - util.assert(queue[i].status === 0 /* RUN */, 'Unexpected transaction status in abort'); - // We can abort it immediately. - queue[i].unwatcher(); - events = events.concat(syncTreeAckUserWrite(repo.serverSyncTree_, queue[i].currentWriteId, true)); - if (queue[i].onComplete) { - callbacks.push(queue[i].onComplete.bind(null, new Error('set'), false, null)); - } - } - } - if (lastSent === -1) { - // We're not waiting for any sent transactions. We can clear the queue. - treeSetValue(node, undefined); - } - else { - // Remove the transactions we aborted. - queue.length = lastSent + 1; - } - // Now fire the callbacks. - eventQueueRaiseEventsForChangedPath(repo.eventQueue_, treeGetPath(node), events); - for (var i = 0; i < callbacks.length; i++) { - exceptionGuard(callbacks[i]); - } - } -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -function decodePath(pathString) { - var pathStringDecoded = ''; - var pieces = pathString.split('/'); - for (var i = 0; i < pieces.length; i++) { - if (pieces[i].length > 0) { - var piece = pieces[i]; - try { - piece = decodeURIComponent(piece.replace(/\+/g, ' ')); - } - catch (e) { } - pathStringDecoded += '/' + piece; - } - } - return pathStringDecoded; -} -/** - * @returns key value hash - */ -function decodeQuery(queryString) { - var e_1, _a; - var results = {}; - if (queryString.charAt(0) === '?') { - queryString = queryString.substring(1); - } - try { - for (var _b = tslib.__values(queryString.split('&')), _c = _b.next(); !_c.done; _c = _b.next()) { - var segment = _c.value; - if (segment.length === 0) { - continue; - } - var kv = segment.split('='); - if (kv.length === 2) { - results[decodeURIComponent(kv[0])] = decodeURIComponent(kv[1]); - } - else { - warn("Invalid query segment '" + segment + "' in query '" + queryString + "'"); - } - } - } - catch (e_1_1) { e_1 = { error: e_1_1 }; } - finally { - try { - if (_c && !_c.done && (_a = _b.return)) _a.call(_b); - } - finally { if (e_1) throw e_1.error; } - } - return results; -} -var parseRepoInfo = function (dataURL, nodeAdmin) { - var parsedUrl = parseDatabaseURL(dataURL), namespace = parsedUrl.namespace; - if (parsedUrl.domain === 'firebase.com') { - fatal(parsedUrl.host + - ' is no longer supported. ' + - 'Please use .firebaseio.com instead'); - } - // Catch common error of uninitialized namespace value. - if ((!namespace || namespace === 'undefined') && - parsedUrl.domain !== 'localhost') { - fatal('Cannot parse Firebase url. Please use https://.firebaseio.com'); - } - if (!parsedUrl.secure) { - warnIfPageIsSecure(); - } - var webSocketOnly = parsedUrl.scheme === 'ws' || parsedUrl.scheme === 'wss'; - return { - repoInfo: new RepoInfo(parsedUrl.host, parsedUrl.secure, namespace, webSocketOnly, nodeAdmin, - /*persistenceKey=*/ '', - /*includeNamespaceInQueryParams=*/ namespace !== parsedUrl.subdomain), - path: new Path(parsedUrl.pathString) - }; -}; -var parseDatabaseURL = function (dataURL) { - // Default to empty strings in the event of a malformed string. - var host = '', domain = '', subdomain = '', pathString = '', namespace = ''; - // Always default to SSL, unless otherwise specified. - var secure = true, scheme = 'https', port = 443; - // Don't do any validation here. The caller is responsible for validating the result of parsing. - if (typeof dataURL === 'string') { - // Parse scheme. - var colonInd = dataURL.indexOf('//'); - if (colonInd >= 0) { - scheme = dataURL.substring(0, colonInd - 1); - dataURL = dataURL.substring(colonInd + 2); - } - // Parse host, path, and query string. - var slashInd = dataURL.indexOf('/'); - if (slashInd === -1) { - slashInd = dataURL.length; - } - var questionMarkInd = dataURL.indexOf('?'); - if (questionMarkInd === -1) { - questionMarkInd = dataURL.length; - } - host = dataURL.substring(0, Math.min(slashInd, questionMarkInd)); - if (slashInd < questionMarkInd) { - // For pathString, questionMarkInd will always come after slashInd - pathString = decodePath(dataURL.substring(slashInd, questionMarkInd)); - } - var queryParams = decodeQuery(dataURL.substring(Math.min(dataURL.length, questionMarkInd))); - // If we have a port, use scheme for determining if it's secure. - colonInd = host.indexOf(':'); - if (colonInd >= 0) { - secure = scheme === 'https' || scheme === 'wss'; - port = parseInt(host.substring(colonInd + 1), 10); - } - else { - colonInd = host.length; - } - var hostWithoutPort = host.slice(0, colonInd); - if (hostWithoutPort.toLowerCase() === 'localhost') { - domain = 'localhost'; - } - else if (hostWithoutPort.split('.').length <= 2) { - domain = hostWithoutPort; - } - else { - // Interpret the subdomain of a 3 or more component URL as the namespace name. - var dotInd = host.indexOf('.'); - subdomain = host.substring(0, dotInd).toLowerCase(); - domain = host.substring(dotInd + 1); - // Normalize namespaces to lowercase to share storage / connection. - namespace = subdomain; - } - // Always treat the value of the `ns` as the namespace name if it is present. - if ('ns' in queryParams) { - namespace = queryParams['ns']; - } - } - return { - host: host, - port: port, - domain: domain, - subdomain: subdomain, - secure: secure, - scheme: scheme, - pathString: pathString, - namespace: namespace - }; -}; - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Encapsulates the data needed to raise an event - */ -var DataEvent = /** @class */ (function () { - /** - * @param eventType - One of: value, child_added, child_changed, child_moved, child_removed - * @param eventRegistration - The function to call to with the event data. User provided - * @param snapshot - The data backing the event - * @param prevName - Optional, the name of the previous child for child_* events. - */ - function DataEvent(eventType, eventRegistration, snapshot, prevName) { - this.eventType = eventType; - this.eventRegistration = eventRegistration; - this.snapshot = snapshot; - this.prevName = prevName; - } - DataEvent.prototype.getPath = function () { - var ref = this.snapshot.ref; - if (this.eventType === 'value') { - return ref._path; - } - else { - return ref.parent._path; - } - }; - DataEvent.prototype.getEventType = function () { - return this.eventType; - }; - DataEvent.prototype.getEventRunner = function () { - return this.eventRegistration.getEventRunner(this); - }; - DataEvent.prototype.toString = function () { - return (this.getPath().toString() + - ':' + - this.eventType + - ':' + - util.stringify(this.snapshot.exportVal())); - }; - return DataEvent; -}()); -var CancelEvent = /** @class */ (function () { - function CancelEvent(eventRegistration, error, path) { - this.eventRegistration = eventRegistration; - this.error = error; - this.path = path; - } - CancelEvent.prototype.getPath = function () { - return this.path; - }; - CancelEvent.prototype.getEventType = function () { - return 'cancel'; - }; - CancelEvent.prototype.getEventRunner = function () { - return this.eventRegistration.getEventRunner(this); - }; - CancelEvent.prototype.toString = function () { - return this.path.toString() + ':cancel'; - }; - return CancelEvent; -}()); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * A wrapper class that converts events from the database@exp SDK to the legacy - * Database SDK. Events are not converted directly as event registration relies - * on reference comparison of the original user callback (see `matches()`) and - * relies on equality of the legacy SDK's `context` object. - */ -var CallbackContext = /** @class */ (function () { - function CallbackContext(snapshotCallback, cancelCallback) { - this.snapshotCallback = snapshotCallback; - this.cancelCallback = cancelCallback; - } - CallbackContext.prototype.onValue = function (expDataSnapshot, previousChildName) { - this.snapshotCallback.call(null, expDataSnapshot, previousChildName); - }; - CallbackContext.prototype.onCancel = function (error) { - util.assert(this.hasCancelCallback, 'Raising a cancel event on a listener with no cancel callback'); - return this.cancelCallback.call(null, error); - }; - Object.defineProperty(CallbackContext.prototype, "hasCancelCallback", { - get: function () { - return !!this.cancelCallback; - }, - enumerable: false, - configurable: true - }); - CallbackContext.prototype.matches = function (other) { - return (this.snapshotCallback === other.snapshotCallback || - (this.snapshotCallback.userCallback !== undefined && - this.snapshotCallback.userCallback === - other.snapshotCallback.userCallback && - this.snapshotCallback.context === other.snapshotCallback.context)); - }; - return CallbackContext; -}()); - -/** - * @license - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * The `onDisconnect` class allows you to write or clear data when your client - * disconnects from the Database server. These updates occur whether your - * client disconnects cleanly or not, so you can rely on them to clean up data - * even if a connection is dropped or a client crashes. - * - * The `onDisconnect` class is most commonly used to manage presence in - * applications where it is useful to detect how many clients are connected and - * when other clients disconnect. See - * {@link https://firebase.google.com/docs/database/web/offline-capabilities | Enabling Offline Capabilities in JavaScript} - * for more information. - * - * To avoid problems when a connection is dropped before the requests can be - * transferred to the Database server, these functions should be called before - * writing any data. - * - * Note that `onDisconnect` operations are only triggered once. If you want an - * operation to occur each time a disconnect occurs, you'll need to re-establish - * the `onDisconnect` operations each time you reconnect. - */ -var OnDisconnect = /** @class */ (function () { - /** @hideconstructor */ - function OnDisconnect(_repo, _path) { - this._repo = _repo; - this._path = _path; - } - /** - * Cancels all previously queued `onDisconnect()` set or update events for this - * location and all children. - * - * If a write has been queued for this location via a `set()` or `update()` at a - * parent location, the write at this location will be canceled, though writes - * to sibling locations will still occur. - * - * @returns Resolves when synchronization to the server is complete. - */ - OnDisconnect.prototype.cancel = function () { - var deferred = new util.Deferred(); - repoOnDisconnectCancel(this._repo, this._path, deferred.wrapCallback(function () { })); - return deferred.promise; - }; - /** - * Ensures the data at this location is deleted when the client is disconnected - * (due to closing the browser, navigating to a new page, or network issues). - * - * @returns Resolves when synchronization to the server is complete. - */ - OnDisconnect.prototype.remove = function () { - validateWritablePath('OnDisconnect.remove', this._path); - var deferred = new util.Deferred(); - repoOnDisconnectSet(this._repo, this._path, null, deferred.wrapCallback(function () { })); - return deferred.promise; - }; - /** - * Ensures the data at this location is set to the specified value when the - * client is disconnected (due to closing the browser, navigating to a new page, - * or network issues). - * - * `set()` is especially useful for implementing "presence" systems, where a - * value should be changed or cleared when a user disconnects so that they - * appear "offline" to other users. See - * {@link https://firebase.google.com/docs/database/web/offline-capabilities | Enabling Offline Capabilities in JavaScript} - * for more information. - * - * Note that `onDisconnect` operations are only triggered once. If you want an - * operation to occur each time a disconnect occurs, you'll need to re-establish - * the `onDisconnect` operations each time. - * - * @param value - The value to be written to this location on disconnect (can - * be an object, array, string, number, boolean, or null). - * @returns Resolves when synchronization to the Database is complete. - */ - OnDisconnect.prototype.set = function (value) { - validateWritablePath('OnDisconnect.set', this._path); - validateFirebaseDataArg('OnDisconnect.set', value, this._path, false); - var deferred = new util.Deferred(); - repoOnDisconnectSet(this._repo, this._path, value, deferred.wrapCallback(function () { })); - return deferred.promise; - }; - /** - * Ensures the data at this location is set to the specified value and priority - * when the client is disconnected (due to closing the browser, navigating to a - * new page, or network issues). - * - * @param value - The value to be written to this location on disconnect (can - * be an object, array, string, number, boolean, or null). - * @param priority - The priority to be written (string, number, or null). - * @returns Resolves when synchronization to the Database is complete. - */ - OnDisconnect.prototype.setWithPriority = function (value, priority) { - validateWritablePath('OnDisconnect.setWithPriority', this._path); - validateFirebaseDataArg('OnDisconnect.setWithPriority', value, this._path, false); - validatePriority('OnDisconnect.setWithPriority', priority, false); - var deferred = new util.Deferred(); - repoOnDisconnectSetWithPriority(this._repo, this._path, value, priority, deferred.wrapCallback(function () { })); - return deferred.promise; - }; - /** - * Writes multiple values at this location when the client is disconnected (due - * to closing the browser, navigating to a new page, or network issues). - * - * The `values` argument contains multiple property-value pairs that will be - * written to the Database together. Each child property can either be a simple - * property (for example, "name") or a relative path (for example, "name/first") - * from the current location to the data to update. - * - * As opposed to the `set()` method, `update()` can be use to selectively update - * only the referenced properties at the current location (instead of replacing - * all the child properties at the current location). - * - * @param values - Object containing multiple values. - * @returns Resolves when synchronization to the Database is complete. - */ - OnDisconnect.prototype.update = function (values) { - validateWritablePath('OnDisconnect.update', this._path); - validateFirebaseMergeDataArg('OnDisconnect.update', values, this._path, false); - var deferred = new util.Deferred(); - repoOnDisconnectUpdate(this._repo, this._path, values, deferred.wrapCallback(function () { })); - return deferred.promise; - }; - return OnDisconnect; -}()); - -/** - * @license - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * @internal - */ -var QueryImpl = /** @class */ (function () { - /** - * @hideconstructor - */ - function QueryImpl(_repo, _path, _queryParams, _orderByCalled) { - this._repo = _repo; - this._path = _path; - this._queryParams = _queryParams; - this._orderByCalled = _orderByCalled; - } - Object.defineProperty(QueryImpl.prototype, "key", { - get: function () { - if (pathIsEmpty(this._path)) { - return null; - } - else { - return pathGetBack(this._path); - } - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(QueryImpl.prototype, "ref", { - get: function () { - return new ReferenceImpl(this._repo, this._path); - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(QueryImpl.prototype, "_queryIdentifier", { - get: function () { - var obj = queryParamsGetQueryObject(this._queryParams); - var id = ObjectToUniqueKey(obj); - return id === '{}' ? 'default' : id; - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(QueryImpl.prototype, "_queryObject", { - /** - * An object representation of the query parameters used by this Query. - */ - get: function () { - return queryParamsGetQueryObject(this._queryParams); - }, - enumerable: false, - configurable: true - }); - QueryImpl.prototype.isEqual = function (other) { - other = util.getModularInstance(other); - if (!(other instanceof QueryImpl)) { - return false; - } - var sameRepo = this._repo === other._repo; - var samePath = pathEquals(this._path, other._path); - var sameQueryIdentifier = this._queryIdentifier === other._queryIdentifier; - return sameRepo && samePath && sameQueryIdentifier; - }; - QueryImpl.prototype.toJSON = function () { - return this.toString(); - }; - QueryImpl.prototype.toString = function () { - return this._repo.toString() + pathToUrlEncodedString(this._path); - }; - return QueryImpl; -}()); -/** - * Validates that no other order by call has been made - */ -function validateNoPreviousOrderByCall(query, fnName) { - if (query._orderByCalled === true) { - throw new Error(fnName + ": You can't combine multiple orderBy calls."); - } -} -/** - * Validates start/end values for queries. - */ -function validateQueryEndpoints(params) { - var startNode = null; - var endNode = null; - if (params.hasStart()) { - startNode = params.getIndexStartValue(); - } - if (params.hasEnd()) { - endNode = params.getIndexEndValue(); - } - if (params.getIndex() === KEY_INDEX) { - var tooManyArgsError = 'Query: When ordering by key, you may only pass one argument to ' + - 'startAt(), endAt(), or equalTo().'; - var wrongArgTypeError = 'Query: When ordering by key, the argument passed to startAt(), startAfter(), ' + - 'endAt(), endBefore(), or equalTo() must be a string.'; - if (params.hasStart()) { - var startName = params.getIndexStartName(); - if (startName !== MIN_NAME) { - throw new Error(tooManyArgsError); - } - else if (typeof startNode !== 'string') { - throw new Error(wrongArgTypeError); - } - } - if (params.hasEnd()) { - var endName = params.getIndexEndName(); - if (endName !== MAX_NAME) { - throw new Error(tooManyArgsError); - } - else if (typeof endNode !== 'string') { - throw new Error(wrongArgTypeError); - } - } - } - else if (params.getIndex() === PRIORITY_INDEX) { - if ((startNode != null && !isValidPriority(startNode)) || - (endNode != null && !isValidPriority(endNode))) { - throw new Error('Query: When ordering by priority, the first argument passed to startAt(), ' + - 'startAfter() endAt(), endBefore(), or equalTo() must be a valid priority value ' + - '(null, a number, or a string).'); - } - } - else { - util.assert(params.getIndex() instanceof PathIndex || - params.getIndex() === VALUE_INDEX, 'unknown index type.'); - if ((startNode != null && typeof startNode === 'object') || - (endNode != null && typeof endNode === 'object')) { - throw new Error('Query: First argument passed to startAt(), startAfter(), endAt(), endBefore(), or ' + - 'equalTo() cannot be an object.'); - } - } -} -/** - * Validates that limit* has been called with the correct combination of parameters - */ -function validateLimit(params) { - if (params.hasStart() && - params.hasEnd() && - params.hasLimit() && - !params.hasAnchoredLimit()) { - throw new Error("Query: Can't combine startAt(), startAfter(), endAt(), endBefore(), and limit(). Use " + - 'limitToFirst() or limitToLast() instead.'); - } -} -/** - * @internal - */ -var ReferenceImpl = /** @class */ (function (_super) { - tslib.__extends(ReferenceImpl, _super); - /** @hideconstructor */ - function ReferenceImpl(repo, path) { - return _super.call(this, repo, path, new QueryParams(), false) || this; - } - Object.defineProperty(ReferenceImpl.prototype, "parent", { - get: function () { - var parentPath = pathParent(this._path); - return parentPath === null - ? null - : new ReferenceImpl(this._repo, parentPath); - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(ReferenceImpl.prototype, "root", { - get: function () { - var ref = this; - while (ref.parent !== null) { - ref = ref.parent; - } - return ref; - }, - enumerable: false, - configurable: true - }); - return ReferenceImpl; -}(QueryImpl)); -/** - * A `DataSnapshot` contains data from a Database location. - * - * Any time you read data from the Database, you receive the data as a - * `DataSnapshot`. A `DataSnapshot` is passed to the event callbacks you attach - * with `on()` or `once()`. You can extract the contents of the snapshot as a - * JavaScript object by calling the `val()` method. Alternatively, you can - * traverse into the snapshot by calling `child()` to return child snapshots - * (which you could then call `val()` on). - * - * A `DataSnapshot` is an efficiently generated, immutable copy of the data at - * a Database location. It cannot be modified and will never change (to modify - * data, you always call the `set()` method on a `Reference` directly). - */ -var DataSnapshot = /** @class */ (function () { - /** - * @param _node - A SnapshotNode to wrap. - * @param ref - The location this snapshot came from. - * @param _index - The iteration order for this snapshot - * @hideconstructor - */ - function DataSnapshot(_node, - /** - * The location of this DataSnapshot. - */ - ref, _index) { - this._node = _node; - this.ref = ref; - this._index = _index; - } - Object.defineProperty(DataSnapshot.prototype, "priority", { - /** - * Gets the priority value of the data in this `DataSnapshot`. - * - * Applications need not use priority but can order collections by - * ordinary properties (see - * {@link https://firebase.google.com/docs/database/web/lists-of-data#sorting_and_filtering_data |Sorting and filtering data} - * ). - */ - get: function () { - // typecast here because we never return deferred values or internal priorities (MAX_PRIORITY) - return this._node.getPriority().val(); - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(DataSnapshot.prototype, "key", { - /** - * The key (last part of the path) of the location of this `DataSnapshot`. - * - * The last token in a Database location is considered its key. For example, - * "ada" is the key for the /users/ada/ node. Accessing the key on any - * `DataSnapshot` will return the key for the location that generated it. - * However, accessing the key on the root URL of a Database will return - * `null`. - */ - get: function () { - return this.ref.key; - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(DataSnapshot.prototype, "size", { - /** Returns the number of child properties of this `DataSnapshot`. */ - get: function () { - return this._node.numChildren(); - }, - enumerable: false, - configurable: true - }); - /** - * Gets another `DataSnapshot` for the location at the specified relative path. - * - * Passing a relative path to the `child()` method of a DataSnapshot returns - * another `DataSnapshot` for the location at the specified relative path. The - * relative path can either be a simple child name (for example, "ada") or a - * deeper, slash-separated path (for example, "ada/name/first"). If the child - * location has no data, an empty `DataSnapshot` (that is, a `DataSnapshot` - * whose value is `null`) is returned. - * - * @param path - A relative path to the location of child data. - */ - DataSnapshot.prototype.child = function (path) { - var childPath = new Path(path); - var childRef = child(this.ref, path); - return new DataSnapshot(this._node.getChild(childPath), childRef, PRIORITY_INDEX); - }; - /** - * Returns true if this `DataSnapshot` contains any data. It is slightly more - * efficient than using `snapshot.val() !== null`. - */ - DataSnapshot.prototype.exists = function () { - return !this._node.isEmpty(); - }; - /** - * Exports the entire contents of the DataSnapshot as a JavaScript object. - * - * The `exportVal()` method is similar to `val()`, except priority information - * is included (if available), making it suitable for backing up your data. - * - * @returns The DataSnapshot's contents as a JavaScript value (Object, - * Array, string, number, boolean, or `null`). - */ - // eslint-disable-next-line @typescript-eslint/no-explicit-any - DataSnapshot.prototype.exportVal = function () { - return this._node.val(true); - }; - /** - * Enumerates the top-level children in the `DataSnapshot`. - * - * Because of the way JavaScript objects work, the ordering of data in the - * JavaScript object returned by `val()` is not guaranteed to match the - * ordering on the server nor the ordering of `onChildAdded()` events. That is - * where `forEach()` comes in handy. It guarantees the children of a - * `DataSnapshot` will be iterated in their query order. - * - * If no explicit `orderBy*()` method is used, results are returned - * ordered by key (unless priorities are used, in which case, results are - * returned by priority). - * - * @param action - A function that will be called for each child DataSnapshot. - * The callback can return true to cancel further enumeration. - * @returns true if enumeration was canceled due to your callback returning - * true. - */ - DataSnapshot.prototype.forEach = function (action) { - var _this = this; - if (this._node.isLeafNode()) { - return false; - } - var childrenNode = this._node; - // Sanitize the return value to a boolean. ChildrenNode.forEachChild has a weird return type... - return !!childrenNode.forEachChild(this._index, function (key, node) { - return action(new DataSnapshot(node, child(_this.ref, key), PRIORITY_INDEX)); - }); - }; - /** - * Returns true if the specified child path has (non-null) data. - * - * @param path - A relative path to the location of a potential child. - * @returns `true` if data exists at the specified child path; else - * `false`. - */ - DataSnapshot.prototype.hasChild = function (path) { - var childPath = new Path(path); - return !this._node.getChild(childPath).isEmpty(); - }; - /** - * Returns whether or not the `DataSnapshot` has any non-`null` child - * properties. - * - * You can use `hasChildren()` to determine if a `DataSnapshot` has any - * children. If it does, you can enumerate them using `forEach()`. If it - * doesn't, then either this snapshot contains a primitive value (which can be - * retrieved with `val()`) or it is empty (in which case, `val()` will return - * `null`). - * - * @returns true if this snapshot has any children; else false. - */ - DataSnapshot.prototype.hasChildren = function () { - if (this._node.isLeafNode()) { - return false; - } - else { - return !this._node.isEmpty(); - } - }; - /** - * Returns a JSON-serializable representation of this object. - */ - DataSnapshot.prototype.toJSON = function () { - return this.exportVal(); - }; - /** - * Extracts a JavaScript value from a `DataSnapshot`. - * - * Depending on the data in a `DataSnapshot`, the `val()` method may return a - * scalar type (string, number, or boolean), an array, or an object. It may - * also return null, indicating that the `DataSnapshot` is empty (contains no - * data). - * - * @returns The DataSnapshot's contents as a JavaScript value (Object, - * Array, string, number, boolean, or `null`). - */ - // eslint-disable-next-line @typescript-eslint/no-explicit-any - DataSnapshot.prototype.val = function () { - return this._node.val(); - }; - return DataSnapshot; -}()); -/** - * - * Returns a `Reference` representing the location in the Database - * corresponding to the provided path. If no path is provided, the `Reference` - * will point to the root of the Database. - * - * @param db - The database instance to obtain a reference for. - * @param path - Optional path representing the location the returned - * `Reference` will point. If not provided, the returned `Reference` will - * point to the root of the Database. - * @returns If a path is provided, a `Reference` - * pointing to the provided path. Otherwise, a `Reference` pointing to the - * root of the Database. - */ -function ref(db, path) { - db = util.getModularInstance(db); - db._checkNotDeleted('ref'); - return path !== undefined ? child(db._root, path) : db._root; -} -/** - * Returns a `Reference` representing the location in the Database - * corresponding to the provided Firebase URL. - * - * An exception is thrown if the URL is not a valid Firebase Database URL or it - * has a different domain than the current `Database` instance. - * - * Note that all query parameters (`orderBy`, `limitToLast`, etc.) are ignored - * and are not applied to the returned `Reference`. - * - * @param db - The database instance to obtain a reference for. - * @param url - The Firebase URL at which the returned `Reference` will - * point. - * @returns A `Reference` pointing to the provided - * Firebase URL. - */ -function refFromURL(db, url) { - db = util.getModularInstance(db); - db._checkNotDeleted('refFromURL'); - var parsedURL = parseRepoInfo(url, db._repo.repoInfo_.nodeAdmin); - validateUrl('refFromURL', parsedURL); - var repoInfo = parsedURL.repoInfo; - if (!db._repo.repoInfo_.isCustomHost() && - repoInfo.host !== db._repo.repoInfo_.host) { - fatal('refFromURL' + - ': Host name does not match the current database: ' + - '(found ' + - repoInfo.host + - ' but expected ' + - db._repo.repoInfo_.host + - ')'); - } - return ref(db, parsedURL.path.toString()); -} -/** - * Gets a `Reference` for the location at the specified relative path. - * - * The relative path can either be a simple child name (for example, "ada") or - * a deeper slash-separated path (for example, "ada/name/first"). - * - * @param parent - The parent location. - * @param path - A relative path from this location to the desired child - * location. - * @returns The specified child location. - */ -function child(parent, path) { - parent = util.getModularInstance(parent); - if (pathGetFront(parent._path) === null) { - validateRootPathString('child', 'path', path, false); - } - else { - validatePathString('child', 'path', path, false); - } - return new ReferenceImpl(parent._repo, pathChild(parent._path, path)); -} -/** - * Returns an `OnDisconnect` object - see - * {@link https://firebase.google.com/docs/database/web/offline-capabilities | Enabling Offline Capabilities in JavaScript} - * for more information on how to use it. - * - * @param ref - The reference to add OnDisconnect triggers for. - */ -function onDisconnect(ref) { - ref = util.getModularInstance(ref); - return new OnDisconnect(ref._repo, ref._path); -} -/** - * Generates a new child location using a unique key and returns its - * `Reference`. - * - * This is the most common pattern for adding data to a collection of items. - * - * If you provide a value to `push()`, the value is written to the - * generated location. If you don't pass a value, nothing is written to the - * database and the child remains empty (but you can use the `Reference` - * elsewhere). - * - * The unique keys generated by `push()` are ordered by the current time, so the - * resulting list of items is chronologically sorted. The keys are also - * designed to be unguessable (they contain 72 random bits of entropy). - * - * See {@link https://firebase.google.com/docs/database/web/lists-of-data#append_to_a_list_of_data | Append to a list of data}. - * See {@link https://firebase.googleblog.com/2015/02/the-2120-ways-to-ensure-unique_68.html | The 2^120 Ways to Ensure Unique Identifiers}. - * - * @param parent - The parent location. - * @param value - Optional value to be written at the generated location. - * @returns Combined `Promise` and `Reference`; resolves when write is complete, - * but can be used immediately as the `Reference` to the child location. - */ -function push(parent, value) { - parent = util.getModularInstance(parent); - validateWritablePath('push', parent._path); - validateFirebaseDataArg('push', value, parent._path, true); - var now = repoServerTime(parent._repo); - var name = nextPushId(now); - // push() returns a ThennableReference whose promise is fulfilled with a - // regular Reference. We use child() to create handles to two different - // references. The first is turned into a ThennableReference below by adding - // then() and catch() methods and is used as the return value of push(). The - // second remains a regular Reference and is used as the fulfilled value of - // the first ThennableReference. - var thennablePushRef = child(parent, name); - var pushRef = child(parent, name); - var promise; - if (value != null) { - promise = set(pushRef, value).then(function () { return pushRef; }); - } - else { - promise = Promise.resolve(pushRef); - } - thennablePushRef.then = promise.then.bind(promise); - thennablePushRef.catch = promise.then.bind(promise, undefined); - return thennablePushRef; -} -/** - * Removes the data at this Database location. - * - * Any data at child locations will also be deleted. - * - * The effect of the remove will be visible immediately and the corresponding - * event 'value' will be triggered. Synchronization of the remove to the - * Firebase servers will also be started, and the returned Promise will resolve - * when complete. If provided, the onComplete callback will be called - * asynchronously after synchronization has finished. - * - * @param ref - The location to remove. - * @returns Resolves when remove on server is complete. - */ -function remove(ref) { - validateWritablePath('remove', ref._path); - return set(ref, null); -} -/** - * Writes data to this Database location. - * - * This will overwrite any data at this location and all child locations. - * - * The effect of the write will be visible immediately, and the corresponding - * events ("value", "child_added", etc.) will be triggered. Synchronization of - * the data to the Firebase servers will also be started, and the returned - * Promise will resolve when complete. If provided, the `onComplete` callback - * will be called asynchronously after synchronization has finished. - * - * Passing `null` for the new value is equivalent to calling `remove()`; namely, - * all data at this location and all child locations will be deleted. - * - * `set()` will remove any priority stored at this location, so if priority is - * meant to be preserved, you need to use `setWithPriority()` instead. - * - * Note that modifying data with `set()` will cancel any pending transactions - * at that location, so extreme care should be taken if mixing `set()` and - * `transaction()` to modify the same data. - * - * A single `set()` will generate a single "value" event at the location where - * the `set()` was performed. - * - * @param ref - The location to write to. - * @param value - The value to be written (string, number, boolean, object, - * array, or null). - * @returns Resolves when write to server is complete. - */ -function set(ref, value) { - ref = util.getModularInstance(ref); - validateWritablePath('set', ref._path); - validateFirebaseDataArg('set', value, ref._path, false); - var deferred = new util.Deferred(); - repoSetWithPriority(ref._repo, ref._path, value, - /*priority=*/ null, deferred.wrapCallback(function () { })); - return deferred.promise; -} -/** - * Sets a priority for the data at this Database location. - * - * Applications need not use priority but can order collections by - * ordinary properties (see - * {@link https://firebase.google.com/docs/database/web/lists-of-data#sorting_and_filtering_data | Sorting and filtering data} - * ). - * - * @param ref - The location to write to. - * @param priority - The priority to be written (string, number, or null). - * @returns Resolves when write to server is complete. - */ -function setPriority(ref, priority) { - ref = util.getModularInstance(ref); - validateWritablePath('setPriority', ref._path); - validatePriority('setPriority', priority, false); - var deferred = new util.Deferred(); - repoSetWithPriority(ref._repo, pathChild(ref._path, '.priority'), priority, null, deferred.wrapCallback(function () { })); - return deferred.promise; -} -/** - * Writes data the Database location. Like `set()` but also specifies the - * priority for that data. - * - * Applications need not use priority but can order collections by - * ordinary properties (see - * {@link https://firebase.google.com/docs/database/web/lists-of-data#sorting_and_filtering_data | Sorting and filtering data} - * ). - * - * @param ref - The location to write to. - * @param value - The value to be written (string, number, boolean, object, - * array, or null). - * @param priority - The priority to be written (string, number, or null). - * @returns Resolves when write to server is complete. - */ -function setWithPriority(ref, value, priority) { - validateWritablePath('setWithPriority', ref._path); - validateFirebaseDataArg('setWithPriority', value, ref._path, false); - validatePriority('setWithPriority', priority, false); - if (ref.key === '.length' || ref.key === '.keys') { - throw 'setWithPriority failed: ' + ref.key + ' is a read-only object.'; - } - var deferred = new util.Deferred(); - repoSetWithPriority(ref._repo, ref._path, value, priority, deferred.wrapCallback(function () { })); - return deferred.promise; -} -/** - * Writes multiple values to the Database at once. - * - * The `values` argument contains multiple property-value pairs that will be - * written to the Database together. Each child property can either be a simple - * property (for example, "name") or a relative path (for example, - * "name/first") from the current location to the data to update. - * - * As opposed to the `set()` method, `update()` can be use to selectively update - * only the referenced properties at the current location (instead of replacing - * all the child properties at the current location). - * - * The effect of the write will be visible immediately, and the corresponding - * events ('value', 'child_added', etc.) will be triggered. Synchronization of - * the data to the Firebase servers will also be started, and the returned - * Promise will resolve when complete. If provided, the `onComplete` callback - * will be called asynchronously after synchronization has finished. - * - * A single `update()` will generate a single "value" event at the location - * where the `update()` was performed, regardless of how many children were - * modified. - * - * Note that modifying data with `update()` will cancel any pending - * transactions at that location, so extreme care should be taken if mixing - * `update()` and `transaction()` to modify the same data. - * - * Passing `null` to `update()` will remove the data at this location. - * - * See - * {@link https://firebase.googleblog.com/2015/09/introducing-multi-location-updates-and_86.html | Introducing multi-location updates and more}. - * - * @param ref - The location to write to. - * @param values - Object containing multiple values. - * @returns Resolves when update on server is complete. - */ -function update(ref, values) { - validateFirebaseMergeDataArg('update', values, ref._path, false); - var deferred = new util.Deferred(); - repoUpdate(ref._repo, ref._path, values, deferred.wrapCallback(function () { })); - return deferred.promise; -} -/** - * Gets the most up-to-date result for this query. - * - * @param query - The query to run. - * @returns A `Promise` which resolves to the resulting DataSnapshot if a value is - * available, or rejects if the client is unable to return a value (e.g., if the - * server is unreachable and there is nothing cached). - */ -function get(query) { - query = util.getModularInstance(query); - var callbackContext = new CallbackContext(function () { }); - var container = new ValueEventRegistration(callbackContext); - return repoGetValue(query._repo, query, container).then(function (node) { - return new DataSnapshot(node, new ReferenceImpl(query._repo, query._path), query._queryParams.getIndex()); - }); -} -/** - * Represents registration for 'value' events. - */ -var ValueEventRegistration = /** @class */ (function () { - function ValueEventRegistration(callbackContext) { - this.callbackContext = callbackContext; - } - ValueEventRegistration.prototype.respondsTo = function (eventType) { - return eventType === 'value'; - }; - ValueEventRegistration.prototype.createEvent = function (change, query) { - var index = query._queryParams.getIndex(); - return new DataEvent('value', this, new DataSnapshot(change.snapshotNode, new ReferenceImpl(query._repo, query._path), index)); - }; - ValueEventRegistration.prototype.getEventRunner = function (eventData) { - var _this = this; - if (eventData.getEventType() === 'cancel') { - return function () { - return _this.callbackContext.onCancel(eventData.error); - }; - } - else { - return function () { - return _this.callbackContext.onValue(eventData.snapshot, null); - }; - } - }; - ValueEventRegistration.prototype.createCancelEvent = function (error, path) { - if (this.callbackContext.hasCancelCallback) { - return new CancelEvent(this, error, path); - } - else { - return null; - } - }; - ValueEventRegistration.prototype.matches = function (other) { - if (!(other instanceof ValueEventRegistration)) { - return false; - } - else if (!other.callbackContext || !this.callbackContext) { - // If no callback specified, we consider it to match any callback. - return true; - } - else { - return other.callbackContext.matches(this.callbackContext); - } - }; - ValueEventRegistration.prototype.hasAnyCallback = function () { - return this.callbackContext !== null; - }; - return ValueEventRegistration; -}()); -/** - * Represents the registration of a child_x event. - */ -var ChildEventRegistration = /** @class */ (function () { - function ChildEventRegistration(eventType, callbackContext) { - this.eventType = eventType; - this.callbackContext = callbackContext; - } - ChildEventRegistration.prototype.respondsTo = function (eventType) { - var eventToCheck = eventType === 'children_added' ? 'child_added' : eventType; - eventToCheck = - eventToCheck === 'children_removed' ? 'child_removed' : eventToCheck; - return this.eventType === eventToCheck; - }; - ChildEventRegistration.prototype.createCancelEvent = function (error, path) { - if (this.callbackContext.hasCancelCallback) { - return new CancelEvent(this, error, path); - } - else { - return null; - } - }; - ChildEventRegistration.prototype.createEvent = function (change, query) { - util.assert(change.childName != null, 'Child events should have a childName.'); - var childRef = child(new ReferenceImpl(query._repo, query._path), change.childName); - var index = query._queryParams.getIndex(); - return new DataEvent(change.type, this, new DataSnapshot(change.snapshotNode, childRef, index), change.prevName); - }; - ChildEventRegistration.prototype.getEventRunner = function (eventData) { - var _this = this; - if (eventData.getEventType() === 'cancel') { - return function () { - return _this.callbackContext.onCancel(eventData.error); - }; - } - else { - return function () { - return _this.callbackContext.onValue(eventData.snapshot, eventData.prevName); - }; - } - }; - ChildEventRegistration.prototype.matches = function (other) { - if (other instanceof ChildEventRegistration) { - return (this.eventType === other.eventType && - (!this.callbackContext || - !other.callbackContext || - this.callbackContext.matches(other.callbackContext))); - } - return false; - }; - ChildEventRegistration.prototype.hasAnyCallback = function () { - return !!this.callbackContext; - }; - return ChildEventRegistration; -}()); -function addEventListener(query, eventType, callback, cancelCallbackOrListenOptions, options) { - var cancelCallback; - if (typeof cancelCallbackOrListenOptions === 'object') { - cancelCallback = undefined; - options = cancelCallbackOrListenOptions; - } - if (typeof cancelCallbackOrListenOptions === 'function') { - cancelCallback = cancelCallbackOrListenOptions; - } - if (options && options.onlyOnce) { - var userCallback_1 = callback; - var onceCallback = function (dataSnapshot, previousChildName) { - repoRemoveEventCallbackForQuery(query._repo, query, container); - userCallback_1(dataSnapshot, previousChildName); - }; - onceCallback.userCallback = callback.userCallback; - onceCallback.context = callback.context; - callback = onceCallback; - } - var callbackContext = new CallbackContext(callback, cancelCallback || undefined); - var container = eventType === 'value' - ? new ValueEventRegistration(callbackContext) - : new ChildEventRegistration(eventType, callbackContext); - repoAddEventCallbackForQuery(query._repo, query, container); - return function () { return repoRemoveEventCallbackForQuery(query._repo, query, container); }; -} -function onValue(query, callback, cancelCallbackOrListenOptions, options) { - return addEventListener(query, 'value', callback, cancelCallbackOrListenOptions, options); -} -function onChildAdded(query, callback, cancelCallbackOrListenOptions, options) { - return addEventListener(query, 'child_added', callback, cancelCallbackOrListenOptions, options); -} -function onChildChanged(query, callback, cancelCallbackOrListenOptions, options) { - return addEventListener(query, 'child_changed', callback, cancelCallbackOrListenOptions, options); -} -function onChildMoved(query, callback, cancelCallbackOrListenOptions, options) { - return addEventListener(query, 'child_moved', callback, cancelCallbackOrListenOptions, options); -} -function onChildRemoved(query, callback, cancelCallbackOrListenOptions, options) { - return addEventListener(query, 'child_removed', callback, cancelCallbackOrListenOptions, options); -} -/** - * Detaches a callback previously attached with the corresponding `on*()` (`onValue`, `onChildAdded`) listener. - * Note: This is not the recommended way to remove a listener. Instead, please use the returned callback function from - * the respective `on*` callbacks. - * - * Detach a callback previously attached with `on*()`. Calling `off()` on a parent listener - * will not automatically remove listeners registered on child nodes, `off()` - * must also be called on any child listeners to remove the callback. - * - * If a callback is not specified, all callbacks for the specified eventType - * will be removed. Similarly, if no eventType is specified, all callbacks - * for the `Reference` will be removed. - * - * Individual listeners can also be removed by invoking their unsubscribe - * callbacks. - * - * @param query - The query that the listener was registered with. - * @param eventType - One of the following strings: "value", "child_added", - * "child_changed", "child_removed", or "child_moved." If omitted, all callbacks - * for the `Reference` will be removed. - * @param callback - The callback function that was passed to `on()` or - * `undefined` to remove all callbacks. - */ -function off(query, eventType, callback) { - var container = null; - var expCallback = callback ? new CallbackContext(callback) : null; - if (eventType === 'value') { - container = new ValueEventRegistration(expCallback); - } - else if (eventType) { - container = new ChildEventRegistration(eventType, expCallback); - } - repoRemoveEventCallbackForQuery(query._repo, query, container); -} -/** - * A `QueryConstraint` is used to narrow the set of documents returned by a - * Database query. `QueryConstraint`s are created by invoking {@link endAt}, - * {@link endBefore}, {@link startAt}, {@link startAfter}, {@link - * limitToFirst}, {@link limitToLast}, {@link orderByChild}, - * {@link orderByChild}, {@link orderByKey} , {@link orderByPriority} , - * {@link orderByValue} or {@link equalTo} and - * can then be passed to {@link query} to create a new query instance that - * also contains this `QueryConstraint`. - */ -var QueryConstraint = /** @class */ (function () { - function QueryConstraint() { - } - return QueryConstraint; -}()); -var QueryEndAtConstraint = /** @class */ (function (_super) { - tslib.__extends(QueryEndAtConstraint, _super); - function QueryEndAtConstraint(_value, _key) { - var _this = _super.call(this) || this; - _this._value = _value; - _this._key = _key; - return _this; - } - QueryEndAtConstraint.prototype._apply = function (query) { - validateFirebaseDataArg('endAt', this._value, query._path, true); - var newParams = queryParamsEndAt(query._queryParams, this._value, this._key); - validateLimit(newParams); - validateQueryEndpoints(newParams); - if (query._queryParams.hasEnd()) { - throw new Error('endAt: Starting point was already set (by another call to endAt, ' + - 'endBefore or equalTo).'); - } - return new QueryImpl(query._repo, query._path, newParams, query._orderByCalled); - }; - return QueryEndAtConstraint; -}(QueryConstraint)); -/** - * Creates a `QueryConstraint` with the specified ending point. - * - * Using `startAt()`, `startAfter()`, `endBefore()`, `endAt()` and `equalTo()` - * allows you to choose arbitrary starting and ending points for your queries. - * - * The ending point is inclusive, so children with exactly the specified value - * will be included in the query. The optional key argument can be used to - * further limit the range of the query. If it is specified, then children that - * have exactly the specified value must also have a key name less than or equal - * to the specified key. - * - * You can read more about `endAt()` in - * {@link https://firebase.google.com/docs/database/web/lists-of-data#filtering_data | Filtering data}. - * - * @param value - The value to end at. The argument type depends on which - * `orderBy*()` function was used in this query. Specify a value that matches - * the `orderBy*()` type. When used in combination with `orderByKey()`, the - * value must be a string. - * @param key - The child key to end at, among the children with the previously - * specified priority. This argument is only allowed if ordering by child, - * value, or priority. - */ -function endAt(value, key) { - validateKey('endAt', 'key', key, true); - return new QueryEndAtConstraint(value, key); -} -var QueryEndBeforeConstraint = /** @class */ (function (_super) { - tslib.__extends(QueryEndBeforeConstraint, _super); - function QueryEndBeforeConstraint(_value, _key) { - var _this = _super.call(this) || this; - _this._value = _value; - _this._key = _key; - return _this; - } - QueryEndBeforeConstraint.prototype._apply = function (query) { - validateFirebaseDataArg('endBefore', this._value, query._path, false); - var newParams = queryParamsEndBefore(query._queryParams, this._value, this._key); - validateLimit(newParams); - validateQueryEndpoints(newParams); - if (query._queryParams.hasEnd()) { - throw new Error('endBefore: Starting point was already set (by another call to endAt, ' + - 'endBefore or equalTo).'); - } - return new QueryImpl(query._repo, query._path, newParams, query._orderByCalled); - }; - return QueryEndBeforeConstraint; -}(QueryConstraint)); -/** - * Creates a `QueryConstraint` with the specified ending point (exclusive). - * - * Using `startAt()`, `startAfter()`, `endBefore()`, `endAt()` and `equalTo()` - * allows you to choose arbitrary starting and ending points for your queries. - * - * The ending point is exclusive. If only a value is provided, children - * with a value less than the specified value will be included in the query. - * If a key is specified, then children must have a value less than or equal - * to the specified value and a key name less than the specified key. - * - * @param value - The value to end before. The argument type depends on which - * `orderBy*()` function was used in this query. Specify a value that matches - * the `orderBy*()` type. When used in combination with `orderByKey()`, the - * value must be a string. - * @param key - The child key to end before, among the children with the - * previously specified priority. This argument is only allowed if ordering by - * child, value, or priority. - */ -function endBefore(value, key) { - validateKey('endBefore', 'key', key, true); - return new QueryEndBeforeConstraint(value, key); -} -var QueryStartAtConstraint = /** @class */ (function (_super) { - tslib.__extends(QueryStartAtConstraint, _super); - function QueryStartAtConstraint(_value, _key) { - var _this = _super.call(this) || this; - _this._value = _value; - _this._key = _key; - return _this; - } - QueryStartAtConstraint.prototype._apply = function (query) { - validateFirebaseDataArg('startAt', this._value, query._path, true); - var newParams = queryParamsStartAt(query._queryParams, this._value, this._key); - validateLimit(newParams); - validateQueryEndpoints(newParams); - if (query._queryParams.hasStart()) { - throw new Error('startAt: Starting point was already set (by another call to startAt, ' + - 'startBefore or equalTo).'); - } - return new QueryImpl(query._repo, query._path, newParams, query._orderByCalled); - }; - return QueryStartAtConstraint; -}(QueryConstraint)); -/** - * Creates a `QueryConstraint` with the specified starting point. - * - * Using `startAt()`, `startAfter()`, `endBefore()`, `endAt()` and `equalTo()` - * allows you to choose arbitrary starting and ending points for your queries. - * - * The starting point is inclusive, so children with exactly the specified value - * will be included in the query. The optional key argument can be used to - * further limit the range of the query. If it is specified, then children that - * have exactly the specified value must also have a key name greater than or - * equal to the specified key. - * - * You can read more about `startAt()` in - * {@link https://firebase.google.com/docs/database/web/lists-of-data#filtering_data | Filtering data}. - * - * @param value - The value to start at. The argument type depends on which - * `orderBy*()` function was used in this query. Specify a value that matches - * the `orderBy*()` type. When used in combination with `orderByKey()`, the - * value must be a string. - * @param key - The child key to start at. This argument is only allowed if - * ordering by child, value, or priority. - */ -function startAt(value, key) { - if (value === void 0) { value = null; } - validateKey('startAt', 'key', key, true); - return new QueryStartAtConstraint(value, key); -} -var QueryStartAfterConstraint = /** @class */ (function (_super) { - tslib.__extends(QueryStartAfterConstraint, _super); - function QueryStartAfterConstraint(_value, _key) { - var _this = _super.call(this) || this; - _this._value = _value; - _this._key = _key; - return _this; - } - QueryStartAfterConstraint.prototype._apply = function (query) { - validateFirebaseDataArg('startAfter', this._value, query._path, false); - var newParams = queryParamsStartAfter(query._queryParams, this._value, this._key); - validateLimit(newParams); - validateQueryEndpoints(newParams); - if (query._queryParams.hasStart()) { - throw new Error('startAfter: Starting point was already set (by another call to startAt, ' + - 'startAfter, or equalTo).'); - } - return new QueryImpl(query._repo, query._path, newParams, query._orderByCalled); - }; - return QueryStartAfterConstraint; -}(QueryConstraint)); -/** - * Creates a `QueryConstraint` with the specified starting point (exclusive). - * - * Using `startAt()`, `startAfter()`, `endBefore()`, `endAt()` and `equalTo()` - * allows you to choose arbitrary starting and ending points for your queries. - * - * The starting point is exclusive. If only a value is provided, children - * with a value greater than the specified value will be included in the query. - * If a key is specified, then children must have a value greater than or equal - * to the specified value and a a key name greater than the specified key. - * - * @param value - The value to start after. The argument type depends on which - * `orderBy*()` function was used in this query. Specify a value that matches - * the `orderBy*()` type. When used in combination with `orderByKey()`, the - * value must be a string. - * @param key - The child key to start after. This argument is only allowed if - * ordering by child, value, or priority. - */ -function startAfter(value, key) { - validateKey('startAfter', 'key', key, true); - return new QueryStartAfterConstraint(value, key); -} -var QueryLimitToFirstConstraint = /** @class */ (function (_super) { - tslib.__extends(QueryLimitToFirstConstraint, _super); - function QueryLimitToFirstConstraint(_limit) { - var _this = _super.call(this) || this; - _this._limit = _limit; - return _this; - } - QueryLimitToFirstConstraint.prototype._apply = function (query) { - if (query._queryParams.hasLimit()) { - throw new Error('limitToFirst: Limit was already set (by another call to limitToFirst ' + - 'or limitToLast).'); - } - return new QueryImpl(query._repo, query._path, queryParamsLimitToFirst(query._queryParams, this._limit), query._orderByCalled); - }; - return QueryLimitToFirstConstraint; -}(QueryConstraint)); -/** - * Creates a new `QueryConstraint` that if limited to the first specific number - * of children. - * - * The `limitToFirst()` method is used to set a maximum number of children to be - * synced for a given callback. If we set a limit of 100, we will initially only - * receive up to 100 `child_added` events. If we have fewer than 100 messages - * stored in our Database, a `child_added` event will fire for each message. - * However, if we have over 100 messages, we will only receive a `child_added` - * event for the first 100 ordered messages. As items change, we will receive - * `child_removed` events for each item that drops out of the active list so - * that the total number stays at 100. - * - * You can read more about `limitToFirst()` in - * {@link https://firebase.google.com/docs/database/web/lists-of-data#filtering_data | Filtering data}. - * - * @param limit - The maximum number of nodes to include in this query. - */ -function limitToFirst(limit) { - if (typeof limit !== 'number' || Math.floor(limit) !== limit || limit <= 0) { - throw new Error('limitToFirst: First argument must be a positive integer.'); - } - return new QueryLimitToFirstConstraint(limit); -} -var QueryLimitToLastConstraint = /** @class */ (function (_super) { - tslib.__extends(QueryLimitToLastConstraint, _super); - function QueryLimitToLastConstraint(_limit) { - var _this = _super.call(this) || this; - _this._limit = _limit; - return _this; - } - QueryLimitToLastConstraint.prototype._apply = function (query) { - if (query._queryParams.hasLimit()) { - throw new Error('limitToLast: Limit was already set (by another call to limitToFirst ' + - 'or limitToLast).'); - } - return new QueryImpl(query._repo, query._path, queryParamsLimitToLast(query._queryParams, this._limit), query._orderByCalled); - }; - return QueryLimitToLastConstraint; -}(QueryConstraint)); -/** - * Creates a new `QueryConstraint` that is limited to return only the last - * specified number of children. - * - * The `limitToLast()` method is used to set a maximum number of children to be - * synced for a given callback. If we set a limit of 100, we will initially only - * receive up to 100 `child_added` events. If we have fewer than 100 messages - * stored in our Database, a `child_added` event will fire for each message. - * However, if we have over 100 messages, we will only receive a `child_added` - * event for the last 100 ordered messages. As items change, we will receive - * `child_removed` events for each item that drops out of the active list so - * that the total number stays at 100. - * - * You can read more about `limitToLast()` in - * {@link https://firebase.google.com/docs/database/web/lists-of-data#filtering_data | Filtering data}. - * - * @param limit - The maximum number of nodes to include in this query. - */ -function limitToLast(limit) { - if (typeof limit !== 'number' || Math.floor(limit) !== limit || limit <= 0) { - throw new Error('limitToLast: First argument must be a positive integer.'); - } - return new QueryLimitToLastConstraint(limit); -} -var QueryOrderByChildConstraint = /** @class */ (function (_super) { - tslib.__extends(QueryOrderByChildConstraint, _super); - function QueryOrderByChildConstraint(_path) { - var _this = _super.call(this) || this; - _this._path = _path; - return _this; - } - QueryOrderByChildConstraint.prototype._apply = function (query) { - validateNoPreviousOrderByCall(query, 'orderByChild'); - var parsedPath = new Path(this._path); - if (pathIsEmpty(parsedPath)) { - throw new Error('orderByChild: cannot pass in empty path. Use orderByValue() instead.'); - } - var index = new PathIndex(parsedPath); - var newParams = queryParamsOrderBy(query._queryParams, index); - validateQueryEndpoints(newParams); - return new QueryImpl(query._repo, query._path, newParams, - /*orderByCalled=*/ true); - }; - return QueryOrderByChildConstraint; -}(QueryConstraint)); -/** - * Creates a new `QueryConstraint` that orders by the specified child key. - * - * Queries can only order by one key at a time. Calling `orderByChild()` - * multiple times on the same query is an error. - * - * Firebase queries allow you to order your data by any child key on the fly. - * However, if you know in advance what your indexes will be, you can define - * them via the .indexOn rule in your Security Rules for better performance. See - * the{@link https://firebase.google.com/docs/database/security/indexing-data} - * rule for more information. - * - * You can read more about `orderByChild()` in - * {@link https://firebase.google.com/docs/database/web/lists-of-data#sort_data | Sort data}. - * - * @param path - The path to order by. - */ -function orderByChild(path) { - if (path === '$key') { - throw new Error('orderByChild: "$key" is invalid. Use orderByKey() instead.'); - } - else if (path === '$priority') { - throw new Error('orderByChild: "$priority" is invalid. Use orderByPriority() instead.'); - } - else if (path === '$value') { - throw new Error('orderByChild: "$value" is invalid. Use orderByValue() instead.'); - } - validatePathString('orderByChild', 'path', path, false); - return new QueryOrderByChildConstraint(path); -} -var QueryOrderByKeyConstraint = /** @class */ (function (_super) { - tslib.__extends(QueryOrderByKeyConstraint, _super); - function QueryOrderByKeyConstraint() { - return _super !== null && _super.apply(this, arguments) || this; - } - QueryOrderByKeyConstraint.prototype._apply = function (query) { - validateNoPreviousOrderByCall(query, 'orderByKey'); - var newParams = queryParamsOrderBy(query._queryParams, KEY_INDEX); - validateQueryEndpoints(newParams); - return new QueryImpl(query._repo, query._path, newParams, - /*orderByCalled=*/ true); - }; - return QueryOrderByKeyConstraint; -}(QueryConstraint)); -/** - * Creates a new `QueryConstraint` that orders by the key. - * - * Sorts the results of a query by their (ascending) key values. - * - * You can read more about `orderByKey()` in - * {@link https://firebase.google.com/docs/database/web/lists-of-data#sort_data | Sort data}. - */ -function orderByKey() { - return new QueryOrderByKeyConstraint(); -} -var QueryOrderByPriorityConstraint = /** @class */ (function (_super) { - tslib.__extends(QueryOrderByPriorityConstraint, _super); - function QueryOrderByPriorityConstraint() { - return _super !== null && _super.apply(this, arguments) || this; - } - QueryOrderByPriorityConstraint.prototype._apply = function (query) { - validateNoPreviousOrderByCall(query, 'orderByPriority'); - var newParams = queryParamsOrderBy(query._queryParams, PRIORITY_INDEX); - validateQueryEndpoints(newParams); - return new QueryImpl(query._repo, query._path, newParams, - /*orderByCalled=*/ true); - }; - return QueryOrderByPriorityConstraint; -}(QueryConstraint)); -/** - * Creates a new `QueryConstraint` that orders by priority. - * - * Applications need not use priority but can order collections by - * ordinary properties (see - * {@link https://firebase.google.com/docs/database/web/lists-of-data#sort_data | Sort data} - * for alternatives to priority. - */ -function orderByPriority() { - return new QueryOrderByPriorityConstraint(); -} -var QueryOrderByValueConstraint = /** @class */ (function (_super) { - tslib.__extends(QueryOrderByValueConstraint, _super); - function QueryOrderByValueConstraint() { - return _super !== null && _super.apply(this, arguments) || this; - } - QueryOrderByValueConstraint.prototype._apply = function (query) { - validateNoPreviousOrderByCall(query, 'orderByValue'); - var newParams = queryParamsOrderBy(query._queryParams, VALUE_INDEX); - validateQueryEndpoints(newParams); - return new QueryImpl(query._repo, query._path, newParams, - /*orderByCalled=*/ true); - }; - return QueryOrderByValueConstraint; -}(QueryConstraint)); -/** - * Creates a new `QueryConstraint` that orders by value. - * - * If the children of a query are all scalar values (string, number, or - * boolean), you can order the results by their (ascending) values. - * - * You can read more about `orderByValue()` in - * {@link https://firebase.google.com/docs/database/web/lists-of-data#sort_data | Sort data}. - */ -function orderByValue() { - return new QueryOrderByValueConstraint(); -} -var QueryEqualToValueConstraint = /** @class */ (function (_super) { - tslib.__extends(QueryEqualToValueConstraint, _super); - function QueryEqualToValueConstraint(_value, _key) { - var _this = _super.call(this) || this; - _this._value = _value; - _this._key = _key; - return _this; - } - QueryEqualToValueConstraint.prototype._apply = function (query) { - validateFirebaseDataArg('equalTo', this._value, query._path, false); - if (query._queryParams.hasStart()) { - throw new Error('equalTo: Starting point was already set (by another call to startAt/startAfter or ' + - 'equalTo).'); - } - if (query._queryParams.hasEnd()) { - throw new Error('equalTo: Ending point was already set (by another call to endAt/endBefore or ' + - 'equalTo).'); - } - return new QueryEndAtConstraint(this._value, this._key)._apply(new QueryStartAtConstraint(this._value, this._key)._apply(query)); - }; - return QueryEqualToValueConstraint; -}(QueryConstraint)); -/** - * Creates a `QueryConstraint` that includes children that match the specified - * value. - * - * Using `startAt()`, `startAfter()`, `endBefore()`, `endAt()` and `equalTo()` - * allows you to choose arbitrary starting and ending points for your queries. - * - * The optional key argument can be used to further limit the range of the - * query. If it is specified, then children that have exactly the specified - * value must also have exactly the specified key as their key name. This can be - * used to filter result sets with many matches for the same value. - * - * You can read more about `equalTo()` in - * {@link https://firebase.google.com/docs/database/web/lists-of-data#filtering_data | Filtering data}. - * - * @param value - The value to match for. The argument type depends on which - * `orderBy*()` function was used in this query. Specify a value that matches - * the `orderBy*()` type. When used in combination with `orderByKey()`, the - * value must be a string. - * @param key - The child key to start at, among the children with the - * previously specified priority. This argument is only allowed if ordering by - * child, value, or priority. - */ -function equalTo(value, key) { - validateKey('equalTo', 'key', key, true); - return new QueryEqualToValueConstraint(value, key); -} -/** - * Creates a new immutable instance of `Query` that is extended to also include - * additional query constraints. - * - * @param query - The Query instance to use as a base for the new constraints. - * @param queryConstraints - The list of `QueryConstraint`s to apply. - * @throws if any of the provided query constraints cannot be combined with the - * existing or new constraints. - */ -function query(query) { - var e_1, _a; - var queryConstraints = []; - for (var _i = 1; _i < arguments.length; _i++) { - queryConstraints[_i - 1] = arguments[_i]; - } - var queryImpl = util.getModularInstance(query); - try { - for (var queryConstraints_1 = tslib.__values(queryConstraints), queryConstraints_1_1 = queryConstraints_1.next(); !queryConstraints_1_1.done; queryConstraints_1_1 = queryConstraints_1.next()) { - var constraint = queryConstraints_1_1.value; - queryImpl = constraint._apply(queryImpl); - } - } - catch (e_1_1) { e_1 = { error: e_1_1 }; } - finally { - try { - if (queryConstraints_1_1 && !queryConstraints_1_1.done && (_a = queryConstraints_1.return)) _a.call(queryConstraints_1); - } - finally { if (e_1) throw e_1.error; } - } - return queryImpl; -} -/** - * Define reference constructor in various modules - * - * We are doing this here to avoid several circular - * dependency issues - */ -syncPointSetReferenceConstructor(ReferenceImpl); -syncTreeSetReferenceConstructor(ReferenceImpl); - -/** - * This variable is also defined in the firebase Node.js Admin SDK. Before - * modifying this definition, consult the definition in: - * - * https://github.com/firebase/firebase-admin-node - * - * and make sure the two are consistent. - */ -var FIREBASE_DATABASE_EMULATOR_HOST_VAR = 'FIREBASE_DATABASE_EMULATOR_HOST'; -/** - * Creates and caches `Repo` instances. - */ -var repos = {}; -/** - * If true, any new `Repo` will be created to use `ReadonlyRestClient` (for testing purposes). - */ -var useRestClient = false; -/** - * Update an existing `Repo` in place to point to a new host/port. - */ -function repoManagerApplyEmulatorSettings(repo, host, port, tokenProvider) { - repo.repoInfo_ = new RepoInfo(host + ":" + port, - /* secure= */ false, repo.repoInfo_.namespace, repo.repoInfo_.webSocketOnly, repo.repoInfo_.nodeAdmin, repo.repoInfo_.persistenceKey, repo.repoInfo_.includeNamespaceInQueryParams); - if (tokenProvider) { - repo.authTokenProvider_ = tokenProvider; - } -} -/** - * This function should only ever be called to CREATE a new database instance. - * @internal - */ -function repoManagerDatabaseFromApp(app, authProvider, appCheckProvider, url, nodeAdmin) { - var dbUrl = url || app.options.databaseURL; - if (dbUrl === undefined) { - if (!app.options.projectId) { - fatal("Can't determine Firebase Database URL. Be sure to include " + - ' a Project ID when calling firebase.initializeApp().'); - } - log('Using default host for project ', app.options.projectId); - dbUrl = app.options.projectId + "-default-rtdb.firebaseio.com"; - } - var parsedUrl = parseRepoInfo(dbUrl, nodeAdmin); - var repoInfo = parsedUrl.repoInfo; - var isEmulator; - var dbEmulatorHost = undefined; - if (typeof process !== 'undefined' && process.env) { - dbEmulatorHost = process.env[FIREBASE_DATABASE_EMULATOR_HOST_VAR]; - } - if (dbEmulatorHost) { - isEmulator = true; - dbUrl = "http://" + dbEmulatorHost + "?ns=" + repoInfo.namespace; - parsedUrl = parseRepoInfo(dbUrl, nodeAdmin); - repoInfo = parsedUrl.repoInfo; - } - else { - isEmulator = !parsedUrl.repoInfo.secure; - } - var authTokenProvider = nodeAdmin && isEmulator - ? new EmulatorTokenProvider(EmulatorTokenProvider.OWNER) - : new FirebaseAuthTokenProvider(app.name, app.options, authProvider); - validateUrl('Invalid Firebase Database URL', parsedUrl); - if (!pathIsEmpty(parsedUrl.path)) { - fatal('Database URL must point to the root of a Firebase Database ' + - '(not including a child path).'); - } - var repo = repoManagerCreateRepo(repoInfo, app, authTokenProvider, new AppCheckTokenProvider(app.name, appCheckProvider)); - return new Database(repo, app); -} -/** - * Remove the repo and make sure it is disconnected. - * - */ -function repoManagerDeleteRepo(repo, appName) { - var appRepos = repos[appName]; - // This should never happen... - if (!appRepos || appRepos[repo.key] !== repo) { - fatal("Database " + appName + "(" + repo.repoInfo_ + ") has already been deleted."); - } - repoInterrupt(repo); - delete appRepos[repo.key]; -} -/** - * Ensures a repo doesn't already exist and then creates one using the - * provided app. - * - * @param repoInfo - The metadata about the Repo - * @returns The Repo object for the specified server / repoName. - */ -function repoManagerCreateRepo(repoInfo, app, authTokenProvider, appCheckProvider) { - var appRepos = repos[app.name]; - if (!appRepos) { - appRepos = {}; - repos[app.name] = appRepos; - } - var repo = appRepos[repoInfo.toURLString()]; - if (repo) { - fatal('Database initialized multiple times. Please make sure the format of the database URL matches with each database() call.'); - } - repo = new Repo(repoInfo, useRestClient, authTokenProvider, appCheckProvider); - appRepos[repoInfo.toURLString()] = repo; - return repo; -} -/** - * Forces us to use ReadonlyRestClient instead of PersistentConnection for new Repos. - */ -function repoManagerForceRestClient(forceRestClient) { - useRestClient = forceRestClient; -} -/** - * Class representing a Firebase Realtime Database. - */ -var Database = /** @class */ (function () { - /** @hideconstructor */ - function Database(_repoInternal, - /** The {@link @firebase/app#FirebaseApp} associated with this Realtime Database instance. */ - app) { - this._repoInternal = _repoInternal; - this.app = app; - /** Represents a `Database` instance. */ - this['type'] = 'database'; - /** Track if the instance has been used (root or repo accessed) */ - this._instanceStarted = false; - } - Object.defineProperty(Database.prototype, "_repo", { - get: function () { - if (!this._instanceStarted) { - repoStart(this._repoInternal, this.app.options.appId, this.app.options['databaseAuthVariableOverride']); - this._instanceStarted = true; - } - return this._repoInternal; - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(Database.prototype, "_root", { - get: function () { - if (!this._rootInternal) { - this._rootInternal = new ReferenceImpl(this._repo, newEmptyPath()); - } - return this._rootInternal; - }, - enumerable: false, - configurable: true - }); - Database.prototype._delete = function () { - if (this._rootInternal !== null) { - repoManagerDeleteRepo(this._repo, this.app.name); - this._repoInternal = null; - this._rootInternal = null; - } - return Promise.resolve(); - }; - Database.prototype._checkNotDeleted = function (apiName) { - if (this._rootInternal === null) { - fatal('Cannot call ' + apiName + ' on a deleted database.'); - } - }; - return Database; -}()); -function checkTransportInit() { - if (TransportManager.IS_TRANSPORT_INITIALIZED) { - warn('Transport has already been initialized. Please call this function before calling ref or setting up a listener'); - } -} -/** - * Force the use of websockets instead of longPolling. - */ -function forceWebSockets() { - checkTransportInit(); - BrowserPollConnection.forceDisallow(); -} -/** - * Force the use of longPolling instead of websockets. This will be ignored if websocket protocol is used in databaseURL. - */ -function forceLongPolling() { - checkTransportInit(); - WebSocketConnection.forceDisallow(); - BrowserPollConnection.forceAllow(); -} -/** - * Returns the instance of the Realtime Database SDK that is associated - * with the provided {@link @firebase/app#FirebaseApp}. Initializes a new instance with - * with default settings if no instance exists or if the existing instance uses - * a custom database URL. - * - * @param app - The {@link @firebase/app#FirebaseApp} instance that the returned Realtime - * Database instance is associated with. - * @param url - The URL of the Realtime Database instance to connect to. If not - * provided, the SDK connects to the default instance of the Firebase App. - * @returns The `Database` instance of the provided app. - */ -function getDatabase(app$1, url) { - if (app$1 === void 0) { app$1 = app.getApp(); } - var db = app._getProvider(app$1, 'database').getImmediate({ - identifier: url - }); - var emulator = util.getDefaultEmulatorHostnameAndPort('database'); - if (emulator) { - connectDatabaseEmulator.apply(void 0, tslib.__spreadArray([db], tslib.__read(emulator))); - } - return db; -} -/** - * Modify the provided instance to communicate with the Realtime Database - * emulator. - * - *

Note: This method must be called before performing any other operation. - * - * @param db - The instance to modify. - * @param host - The emulator host (ex: localhost) - * @param port - The emulator port (ex: 8080) - * @param options.mockUserToken - the mock auth token to use for unit testing Security Rules - */ -function connectDatabaseEmulator(db, host, port, options) { - if (options === void 0) { options = {}; } - db = util.getModularInstance(db); - db._checkNotDeleted('useEmulator'); - if (db._instanceStarted) { - fatal('Cannot call useEmulator() after instance has already been initialized.'); - } - var repo = db._repoInternal; - var tokenProvider = undefined; - if (repo.repoInfo_.nodeAdmin) { - if (options.mockUserToken) { - fatal('mockUserToken is not supported by the Admin SDK. For client access with mock users, please use the "firebase" package instead of "firebase-admin".'); - } - tokenProvider = new EmulatorTokenProvider(EmulatorTokenProvider.OWNER); - } - else if (options.mockUserToken) { - var token = typeof options.mockUserToken === 'string' - ? options.mockUserToken - : util.createMockUserToken(options.mockUserToken, db.app.options.projectId); - tokenProvider = new EmulatorTokenProvider(token); - } - // Modify the repo to apply emulator settings - repoManagerApplyEmulatorSettings(repo, host, port, tokenProvider); -} -/** - * Disconnects from the server (all Database operations will be completed - * offline). - * - * The client automatically maintains a persistent connection to the Database - * server, which will remain active indefinitely and reconnect when - * disconnected. However, the `goOffline()` and `goOnline()` methods may be used - * to control the client connection in cases where a persistent connection is - * undesirable. - * - * While offline, the client will no longer receive data updates from the - * Database. However, all Database operations performed locally will continue to - * immediately fire events, allowing your application to continue behaving - * normally. Additionally, each operation performed locally will automatically - * be queued and retried upon reconnection to the Database server. - * - * To reconnect to the Database and begin receiving remote events, see - * `goOnline()`. - * - * @param db - The instance to disconnect. - */ -function goOffline(db) { - db = util.getModularInstance(db); - db._checkNotDeleted('goOffline'); - repoInterrupt(db._repo); -} -/** - * Reconnects to the server and synchronizes the offline Database state - * with the server state. - * - * This method should be used after disabling the active connection with - * `goOffline()`. Once reconnected, the client will transmit the proper data - * and fire the appropriate events so that your client "catches up" - * automatically. - * - * @param db - The instance to reconnect. - */ -function goOnline(db) { - db = util.getModularInstance(db); - db._checkNotDeleted('goOnline'); - repoResume(db._repo); -} -function enableLogging(logger, persistent) { - enableLogging$1(logger, persistent); -} - -/** - * @license - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -function registerDatabase(variant) { - setSDKVersion(app.SDK_VERSION); - app._registerComponent(new component.Component('database', function (container, _a) { - var url = _a.instanceIdentifier; - var app = container.getProvider('app').getImmediate(); - var authProvider = container.getProvider('auth-internal'); - var appCheckProvider = container.getProvider('app-check-internal'); - return repoManagerDatabaseFromApp(app, authProvider, appCheckProvider, url); - }, "PUBLIC" /* PUBLIC */).setMultipleInstances(true)); - app.registerVersion(name, version, variant); - // BUILD_TARGET will be replaced by values like esm5, esm2017, cjs5, etc during the compilation - app.registerVersion(name, version, 'cjs5'); -} - -/** - * @license - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var SERVER_TIMESTAMP = { - '.sv': 'timestamp' -}; -/** - * Returns a placeholder value for auto-populating the current timestamp (time - * since the Unix epoch, in milliseconds) as determined by the Firebase - * servers. - */ -function serverTimestamp() { - return SERVER_TIMESTAMP; -} -/** - * Returns a placeholder value that can be used to atomically increment the - * current database value by the provided delta. - * - * @param delta - the amount to modify the current value atomically. - * @returns A placeholder value for modifying data atomically server-side. - */ -function increment(delta) { - return { - '.sv': { - 'increment': delta - } - }; -} - -/** - * @license - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * A type for the resolve value of {@link runTransaction}. - */ -var TransactionResult = /** @class */ (function () { - /** @hideconstructor */ - function TransactionResult( - /** Whether the transaction was successfully committed. */ - committed, - /** The resulting data snapshot. */ - snapshot) { - this.committed = committed; - this.snapshot = snapshot; - } - /** Returns a JSON-serializable representation of this object. */ - TransactionResult.prototype.toJSON = function () { - return { committed: this.committed, snapshot: this.snapshot.toJSON() }; - }; - return TransactionResult; -}()); -/** - * Atomically modifies the data at this location. - * - * Atomically modify the data at this location. Unlike a normal `set()`, which - * just overwrites the data regardless of its previous value, `runTransaction()` is - * used to modify the existing value to a new value, ensuring there are no - * conflicts with other clients writing to the same location at the same time. - * - * To accomplish this, you pass `runTransaction()` an update function which is - * used to transform the current value into a new value. If another client - * writes to the location before your new value is successfully written, your - * update function will be called again with the new current value, and the - * write will be retried. This will happen repeatedly until your write succeeds - * without conflict or you abort the transaction by not returning a value from - * your update function. - * - * Note: Modifying data with `set()` will cancel any pending transactions at - * that location, so extreme care should be taken if mixing `set()` and - * `runTransaction()` to update the same data. - * - * Note: When using transactions with Security and Firebase Rules in place, be - * aware that a client needs `.read` access in addition to `.write` access in - * order to perform a transaction. This is because the client-side nature of - * transactions requires the client to read the data in order to transactionally - * update it. - * - * @param ref - The location to atomically modify. - * @param transactionUpdate - A developer-supplied function which will be passed - * the current data stored at this location (as a JavaScript object). The - * function should return the new value it would like written (as a JavaScript - * object). If `undefined` is returned (i.e. you return with no arguments) the - * transaction will be aborted and the data at this location will not be - * modified. - * @param options - An options object to configure transactions. - * @returns A `Promise` that can optionally be used instead of the `onComplete` - * callback to handle success and failure. - */ -function runTransaction(ref, -// eslint-disable-next-line @typescript-eslint/no-explicit-any -transactionUpdate, options) { - var _a; - ref = util.getModularInstance(ref); - validateWritablePath('Reference.transaction', ref._path); - if (ref.key === '.length' || ref.key === '.keys') { - throw ('Reference.transaction failed: ' + ref.key + ' is a read-only object.'); - } - var applyLocally = (_a = options === null || options === void 0 ? void 0 : options.applyLocally) !== null && _a !== void 0 ? _a : true; - var deferred = new util.Deferred(); - var promiseComplete = function (error, committed, node) { - var dataSnapshot = null; - if (error) { - deferred.reject(error); - } - else { - dataSnapshot = new DataSnapshot(node, new ReferenceImpl(ref._repo, ref._path), PRIORITY_INDEX); - deferred.resolve(new TransactionResult(committed, dataSnapshot)); - } - }; - // Add a watch to make sure we get server updates. - var unwatcher = onValue(ref, function () { }); - repoStartTransaction(ref._repo, ref._path, transactionUpdate, promiseComplete, unwatcher, applyLocally); - return deferred.promise; -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// eslint-disable-next-line @typescript-eslint/no-explicit-any -PersistentConnection.prototype.simpleListen = function (pathString, onComplete) { - this.sendRequest('q', { p: pathString }, onComplete); -}; -// eslint-disable-next-line @typescript-eslint/no-explicit-any -PersistentConnection.prototype.echo = function (data, onEcho) { - this.sendRequest('echo', { d: data }, onEcho); -}; -/** - * @internal - */ -var hijackHash = function (newHash) { - var oldPut = PersistentConnection.prototype.put; - PersistentConnection.prototype.put = function (pathString, data, onComplete, hash) { - if (hash !== undefined) { - hash = newHash(); - } - oldPut.call(this, pathString, data, onComplete, hash); - }; - return function () { - PersistentConnection.prototype.put = oldPut; - }; -}; -/** - * Forces the RepoManager to create Repos that use ReadonlyRestClient instead of PersistentConnection. - * @internal - */ -var forceRestClient = function (forceRestClient) { - repoManagerForceRestClient(forceRestClient); -}; - -/** - * @license - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -setWebSocketImpl(Websocket__default["default"].Client); -registerDatabase('node'); - -exports.DataSnapshot = DataSnapshot; -exports.Database = Database; -exports.OnDisconnect = OnDisconnect; -exports.QueryConstraint = QueryConstraint; -exports.TransactionResult = TransactionResult; -exports._QueryImpl = QueryImpl; -exports._QueryParams = QueryParams; -exports._ReferenceImpl = ReferenceImpl; -exports._TEST_ACCESS_forceRestClient = forceRestClient; -exports._TEST_ACCESS_hijackHash = hijackHash; -exports._repoManagerDatabaseFromApp = repoManagerDatabaseFromApp; -exports._setSDKVersion = setSDKVersion; -exports._validatePathString = validatePathString; -exports._validateWritablePath = validateWritablePath; -exports.child = child; -exports.connectDatabaseEmulator = connectDatabaseEmulator; -exports.enableLogging = enableLogging; -exports.endAt = endAt; -exports.endBefore = endBefore; -exports.equalTo = equalTo; -exports.forceLongPolling = forceLongPolling; -exports.forceWebSockets = forceWebSockets; -exports.get = get; -exports.getDatabase = getDatabase; -exports.goOffline = goOffline; -exports.goOnline = goOnline; -exports.increment = increment; -exports.limitToFirst = limitToFirst; -exports.limitToLast = limitToLast; -exports.off = off; -exports.onChildAdded = onChildAdded; -exports.onChildChanged = onChildChanged; -exports.onChildMoved = onChildMoved; -exports.onChildRemoved = onChildRemoved; -exports.onDisconnect = onDisconnect; -exports.onValue = onValue; -exports.orderByChild = orderByChild; -exports.orderByKey = orderByKey; -exports.orderByPriority = orderByPriority; -exports.orderByValue = orderByValue; -exports.push = push; -exports.query = query; -exports.ref = ref; -exports.refFromURL = refFromURL; -exports.remove = remove; -exports.runTransaction = runTransaction; -exports.serverTimestamp = serverTimestamp; -exports.set = set; -exports.setPriority = setPriority; -exports.setWithPriority = setWithPriority; -exports.startAfter = startAfter; -exports.startAt = startAt; -exports.update = update; -//# sourceMappingURL=index.node.cjs.js.map diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/index.standalone.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/index.standalone.js deleted file mode 100644 index 7762481e..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/index.standalone.js +++ /dev/null @@ -1,14504 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, '__esModule', { value: true }); - -var Websocket = require('faye-websocket'); -var util = require('@firebase/util'); -var tslib = require('tslib'); -var logger$1 = require('@firebase/logger'); - -function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } - -var Websocket__default = /*#__PURE__*/_interopDefaultLegacy(Websocket); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var PROTOCOL_VERSION = '5'; -var VERSION_PARAM = 'v'; -var TRANSPORT_SESSION_PARAM = 's'; -var REFERER_PARAM = 'r'; -var FORGE_REF = 'f'; -// Matches console.firebase.google.com, firebase-console-*.corp.google.com and -// firebase.corp.google.com -var FORGE_DOMAIN_RE = /(console\.firebase|firebase-console-\w+\.corp|firebase\.corp)\.google\.com/; -var LAST_SESSION_PARAM = 'ls'; -var APPLICATION_ID_PARAM = 'p'; -var APP_CHECK_TOKEN_PARAM = 'ac'; -var WEBSOCKET = 'websocket'; -var LONG_POLLING = 'long_polling'; - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Wraps a DOM Storage object and: - * - automatically encode objects as JSON strings before storing them to allow us to store arbitrary types. - * - prefixes names with "firebase:" to avoid collisions with app data. - * - * We automatically (see storage.js) create two such wrappers, one for sessionStorage, - * and one for localStorage. - * - */ -var DOMStorageWrapper = /** @class */ (function () { - /** - * @param domStorage_ - The underlying storage object (e.g. localStorage or sessionStorage) - */ - function DOMStorageWrapper(domStorage_) { - this.domStorage_ = domStorage_; - // Use a prefix to avoid collisions with other stuff saved by the app. - this.prefix_ = 'firebase:'; - } - /** - * @param key - The key to save the value under - * @param value - The value being stored, or null to remove the key. - */ - DOMStorageWrapper.prototype.set = function (key, value) { - if (value == null) { - this.domStorage_.removeItem(this.prefixedName_(key)); - } - else { - this.domStorage_.setItem(this.prefixedName_(key), util.stringify(value)); - } - }; - /** - * @returns The value that was stored under this key, or null - */ - DOMStorageWrapper.prototype.get = function (key) { - var storedVal = this.domStorage_.getItem(this.prefixedName_(key)); - if (storedVal == null) { - return null; - } - else { - return util.jsonEval(storedVal); - } - }; - DOMStorageWrapper.prototype.remove = function (key) { - this.domStorage_.removeItem(this.prefixedName_(key)); - }; - DOMStorageWrapper.prototype.prefixedName_ = function (name) { - return this.prefix_ + name; - }; - DOMStorageWrapper.prototype.toString = function () { - return this.domStorage_.toString(); - }; - return DOMStorageWrapper; -}()); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * An in-memory storage implementation that matches the API of DOMStorageWrapper - * (TODO: create interface for both to implement). - */ -var MemoryStorage = /** @class */ (function () { - function MemoryStorage() { - this.cache_ = {}; - this.isInMemoryStorage = true; - } - MemoryStorage.prototype.set = function (key, value) { - if (value == null) { - delete this.cache_[key]; - } - else { - this.cache_[key] = value; - } - }; - MemoryStorage.prototype.get = function (key) { - if (util.contains(this.cache_, key)) { - return this.cache_[key]; - } - return null; - }; - MemoryStorage.prototype.remove = function (key) { - delete this.cache_[key]; - }; - return MemoryStorage; -}()); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Helper to create a DOMStorageWrapper or else fall back to MemoryStorage. - * TODO: Once MemoryStorage and DOMStorageWrapper have a shared interface this method annotation should change - * to reflect this type - * - * @param domStorageName - Name of the underlying storage object - * (e.g. 'localStorage' or 'sessionStorage'). - * @returns Turning off type information until a common interface is defined. - */ -var createStoragefor = function (domStorageName) { - try { - // NOTE: just accessing "localStorage" or "window['localStorage']" may throw a security exception, - // so it must be inside the try/catch. - if (typeof window !== 'undefined' && - typeof window[domStorageName] !== 'undefined') { - // Need to test cache. Just because it's here doesn't mean it works - var domStorage = window[domStorageName]; - domStorage.setItem('firebase:sentinel', 'cache'); - domStorage.removeItem('firebase:sentinel'); - return new DOMStorageWrapper(domStorage); - } - } - catch (e) { } - // Failed to create wrapper. Just return in-memory storage. - // TODO: log? - return new MemoryStorage(); -}; -/** A storage object that lasts across sessions */ -var PersistentStorage = createStoragefor('localStorage'); -/** A storage object that only lasts one session */ -var SessionStorage = createStoragefor('sessionStorage'); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var logClient = new logger$1.Logger('@firebase/database'); -/** - * Returns a locally-unique ID (generated by just incrementing up from 0 each time its called). - */ -var LUIDGenerator = (function () { - var id = 1; - return function () { - return id++; - }; -})(); -/** - * Sha1 hash of the input string - * @param str - The string to hash - * @returns {!string} The resulting hash - */ -var sha1 = function (str) { - var utf8Bytes = util.stringToByteArray(str); - var sha1 = new util.Sha1(); - sha1.update(utf8Bytes); - var sha1Bytes = sha1.digest(); - return util.base64.encodeByteArray(sha1Bytes); -}; -var buildLogMessage_ = function () { - var varArgs = []; - for (var _i = 0; _i < arguments.length; _i++) { - varArgs[_i] = arguments[_i]; - } - var message = ''; - for (var i = 0; i < varArgs.length; i++) { - var arg = varArgs[i]; - if (Array.isArray(arg) || - (arg && - typeof arg === 'object' && - // eslint-disable-next-line @typescript-eslint/no-explicit-any - typeof arg.length === 'number')) { - message += buildLogMessage_.apply(null, arg); - } - else if (typeof arg === 'object') { - message += util.stringify(arg); - } - else { - message += arg; - } - message += ' '; - } - return message; -}; -/** - * Use this for all debug messages in Firebase. - */ -var logger = null; -/** - * Flag to check for log availability on first log message - */ -var firstLog_ = true; -/** - * The implementation of Firebase.enableLogging (defined here to break dependencies) - * @param logger_ - A flag to turn on logging, or a custom logger - * @param persistent - Whether or not to persist logging settings across refreshes - */ -var enableLogging$1 = function (logger_, persistent) { - util.assert(!persistent || logger_ === true || logger_ === false, "Can't turn on custom loggers persistently."); - if (logger_ === true) { - logClient.logLevel = logger$1.LogLevel.VERBOSE; - logger = logClient.log.bind(logClient); - if (persistent) { - SessionStorage.set('logging_enabled', true); - } - } - else if (typeof logger_ === 'function') { - logger = logger_; - } - else { - logger = null; - SessionStorage.remove('logging_enabled'); - } -}; -var log = function () { - var varArgs = []; - for (var _i = 0; _i < arguments.length; _i++) { - varArgs[_i] = arguments[_i]; - } - if (firstLog_ === true) { - firstLog_ = false; - if (logger === null && SessionStorage.get('logging_enabled') === true) { - enableLogging$1(true); - } - } - if (logger) { - var message = buildLogMessage_.apply(null, varArgs); - logger(message); - } -}; -var logWrapper = function (prefix) { - return function () { - var varArgs = []; - for (var _i = 0; _i < arguments.length; _i++) { - varArgs[_i] = arguments[_i]; - } - log.apply(void 0, tslib.__spreadArray([prefix], tslib.__read(varArgs))); - }; -}; -var error = function () { - var varArgs = []; - for (var _i = 0; _i < arguments.length; _i++) { - varArgs[_i] = arguments[_i]; - } - var message = 'FIREBASE INTERNAL ERROR: ' + buildLogMessage_.apply(void 0, tslib.__spreadArray([], tslib.__read(varArgs))); - logClient.error(message); -}; -var fatal = function () { - var varArgs = []; - for (var _i = 0; _i < arguments.length; _i++) { - varArgs[_i] = arguments[_i]; - } - var message = "FIREBASE FATAL ERROR: " + buildLogMessage_.apply(void 0, tslib.__spreadArray([], tslib.__read(varArgs))); - logClient.error(message); - throw new Error(message); -}; -var warn = function () { - var varArgs = []; - for (var _i = 0; _i < arguments.length; _i++) { - varArgs[_i] = arguments[_i]; - } - var message = 'FIREBASE WARNING: ' + buildLogMessage_.apply(void 0, tslib.__spreadArray([], tslib.__read(varArgs))); - logClient.warn(message); -}; -/** - * Logs a warning if the containing page uses https. Called when a call to new Firebase - * does not use https. - */ -var warnIfPageIsSecure = function () { - // Be very careful accessing browser globals. Who knows what may or may not exist. - if (typeof window !== 'undefined' && - window.location && - window.location.protocol && - window.location.protocol.indexOf('https:') !== -1) { - warn('Insecure Firebase access from a secure page. ' + - 'Please use https in calls to new Firebase().'); - } -}; -/** - * Returns true if data is NaN, or +/- Infinity. - */ -var isInvalidJSONNumber = function (data) { - return (typeof data === 'number' && - (data !== data || // NaN - data === Number.POSITIVE_INFINITY || - data === Number.NEGATIVE_INFINITY)); -}; -var executeWhenDOMReady = function (fn) { - if (util.isNodeSdk() || document.readyState === 'complete') { - fn(); - } - else { - // Modeled after jQuery. Try DOMContentLoaded and onreadystatechange (which - // fire before onload), but fall back to onload. - var called_1 = false; - var wrappedFn_1 = function () { - if (!document.body) { - setTimeout(wrappedFn_1, Math.floor(10)); - return; - } - if (!called_1) { - called_1 = true; - fn(); - } - }; - if (document.addEventListener) { - document.addEventListener('DOMContentLoaded', wrappedFn_1, false); - // fallback to onload. - window.addEventListener('load', wrappedFn_1, false); - // eslint-disable-next-line @typescript-eslint/no-explicit-any - } - else if (document.attachEvent) { - // IE. - // eslint-disable-next-line @typescript-eslint/no-explicit-any - document.attachEvent('onreadystatechange', function () { - if (document.readyState === 'complete') { - wrappedFn_1(); - } - }); - // fallback to onload. - // eslint-disable-next-line @typescript-eslint/no-explicit-any - window.attachEvent('onload', wrappedFn_1); - // jQuery has an extra hack for IE that we could employ (based on - // http://javascript.nwbox.com/IEContentLoaded/) But it looks really old. - // I'm hoping we don't need it. - } - } -}; -/** - * Minimum key name. Invalid for actual data, used as a marker to sort before any valid names - */ -var MIN_NAME = '[MIN_NAME]'; -/** - * Maximum key name. Invalid for actual data, used as a marker to sort above any valid names - */ -var MAX_NAME = '[MAX_NAME]'; -/** - * Compares valid Firebase key names, plus min and max name - */ -var nameCompare = function (a, b) { - if (a === b) { - return 0; - } - else if (a === MIN_NAME || b === MAX_NAME) { - return -1; - } - else if (b === MIN_NAME || a === MAX_NAME) { - return 1; - } - else { - var aAsInt = tryParseInt(a), bAsInt = tryParseInt(b); - if (aAsInt !== null) { - if (bAsInt !== null) { - return aAsInt - bAsInt === 0 ? a.length - b.length : aAsInt - bAsInt; - } - else { - return -1; - } - } - else if (bAsInt !== null) { - return 1; - } - else { - return a < b ? -1 : 1; - } - } -}; -/** - * @returns {!number} comparison result. - */ -var stringCompare = function (a, b) { - if (a === b) { - return 0; - } - else if (a < b) { - return -1; - } - else { - return 1; - } -}; -var requireKey = function (key, obj) { - if (obj && key in obj) { - return obj[key]; - } - else { - throw new Error('Missing required key (' + key + ') in object: ' + util.stringify(obj)); - } -}; -var ObjectToUniqueKey = function (obj) { - if (typeof obj !== 'object' || obj === null) { - return util.stringify(obj); - } - var keys = []; - // eslint-disable-next-line guard-for-in - for (var k in obj) { - keys.push(k); - } - // Export as json, but with the keys sorted. - keys.sort(); - var key = '{'; - for (var i = 0; i < keys.length; i++) { - if (i !== 0) { - key += ','; - } - key += util.stringify(keys[i]); - key += ':'; - key += ObjectToUniqueKey(obj[keys[i]]); - } - key += '}'; - return key; -}; -/** - * Splits a string into a number of smaller segments of maximum size - * @param str - The string - * @param segsize - The maximum number of chars in the string. - * @returns The string, split into appropriately-sized chunks - */ -var splitStringBySize = function (str, segsize) { - var len = str.length; - if (len <= segsize) { - return [str]; - } - var dataSegs = []; - for (var c = 0; c < len; c += segsize) { - if (c + segsize > len) { - dataSegs.push(str.substring(c, len)); - } - else { - dataSegs.push(str.substring(c, c + segsize)); - } - } - return dataSegs; -}; -/** - * Apply a function to each (key, value) pair in an object or - * apply a function to each (index, value) pair in an array - * @param obj - The object or array to iterate over - * @param fn - The function to apply - */ -function each(obj, fn) { - for (var key in obj) { - if (obj.hasOwnProperty(key)) { - fn(key, obj[key]); - } - } -} -/** - * Borrowed from http://hg.secondlife.com/llsd/src/tip/js/typedarray.js (MIT License) - * I made one modification at the end and removed the NaN / Infinity - * handling (since it seemed broken [caused an overflow] and we don't need it). See MJL comments. - * @param v - A double - * - */ -var doubleToIEEE754String = function (v) { - util.assert(!isInvalidJSONNumber(v), 'Invalid JSON number'); // MJL - var ebits = 11, fbits = 52; - var bias = (1 << (ebits - 1)) - 1; - var s, e, f, ln, i; - // Compute sign, exponent, fraction - // Skip NaN / Infinity handling --MJL. - if (v === 0) { - e = 0; - f = 0; - s = 1 / v === -Infinity ? 1 : 0; - } - else { - s = v < 0; - v = Math.abs(v); - if (v >= Math.pow(2, 1 - bias)) { - // Normalized - ln = Math.min(Math.floor(Math.log(v) / Math.LN2), bias); - e = ln + bias; - f = Math.round(v * Math.pow(2, fbits - ln) - Math.pow(2, fbits)); - } - else { - // Denormalized - e = 0; - f = Math.round(v / Math.pow(2, 1 - bias - fbits)); - } - } - // Pack sign, exponent, fraction - var bits = []; - for (i = fbits; i; i -= 1) { - bits.push(f % 2 ? 1 : 0); - f = Math.floor(f / 2); - } - for (i = ebits; i; i -= 1) { - bits.push(e % 2 ? 1 : 0); - e = Math.floor(e / 2); - } - bits.push(s ? 1 : 0); - bits.reverse(); - var str = bits.join(''); - // Return the data as a hex string. --MJL - var hexByteString = ''; - for (i = 0; i < 64; i += 8) { - var hexByte = parseInt(str.substr(i, 8), 2).toString(16); - if (hexByte.length === 1) { - hexByte = '0' + hexByte; - } - hexByteString = hexByteString + hexByte; - } - return hexByteString.toLowerCase(); -}; -/** - * Used to detect if we're in a Chrome content script (which executes in an - * isolated environment where long-polling doesn't work). - */ -var isChromeExtensionContentScript = function () { - return !!(typeof window === 'object' && - window['chrome'] && - window['chrome']['extension'] && - !/^chrome/.test(window.location.href)); -}; -/** - * Used to detect if we're in a Windows 8 Store app. - */ -var isWindowsStoreApp = function () { - // Check for the presence of a couple WinRT globals - return typeof Windows === 'object' && typeof Windows.UI === 'object'; -}; -/** - * Converts a server error code to a Javascript Error - */ -function errorForServerCode(code, query) { - var reason = 'Unknown Error'; - if (code === 'too_big') { - reason = - 'The data requested exceeds the maximum size ' + - 'that can be accessed with a single request.'; - } - else if (code === 'permission_denied') { - reason = "Client doesn't have permission to access the desired data."; - } - else if (code === 'unavailable') { - reason = 'The service is unavailable'; - } - var error = new Error(code + ' at ' + query._path.toString() + ': ' + reason); - // eslint-disable-next-line @typescript-eslint/no-explicit-any - error.code = code.toUpperCase(); - return error; -} -/** - * Used to test for integer-looking strings - */ -var INTEGER_REGEXP_ = new RegExp('^-?(0*)\\d{1,10}$'); -/** - * For use in keys, the minimum possible 32-bit integer. - */ -var INTEGER_32_MIN = -2147483648; -/** - * For use in kyes, the maximum possible 32-bit integer. - */ -var INTEGER_32_MAX = 2147483647; -/** - * If the string contains a 32-bit integer, return it. Else return null. - */ -var tryParseInt = function (str) { - if (INTEGER_REGEXP_.test(str)) { - var intVal = Number(str); - if (intVal >= INTEGER_32_MIN && intVal <= INTEGER_32_MAX) { - return intVal; - } - } - return null; -}; -/** - * Helper to run some code but catch any exceptions and re-throw them later. - * Useful for preventing user callbacks from breaking internal code. - * - * Re-throwing the exception from a setTimeout is a little evil, but it's very - * convenient (we don't have to try to figure out when is a safe point to - * re-throw it), and the behavior seems reasonable: - * - * * If you aren't pausing on exceptions, you get an error in the console with - * the correct stack trace. - * * If you're pausing on all exceptions, the debugger will pause on your - * exception and then again when we rethrow it. - * * If you're only pausing on uncaught exceptions, the debugger will only pause - * on us re-throwing it. - * - * @param fn - The code to guard. - */ -var exceptionGuard = function (fn) { - try { - fn(); - } - catch (e) { - // Re-throw exception when it's safe. - setTimeout(function () { - // It used to be that "throw e" would result in a good console error with - // relevant context, but as of Chrome 39, you just get the firebase.js - // file/line number where we re-throw it, which is useless. So we log - // e.stack explicitly. - var stack = e.stack || ''; - warn('Exception was thrown by user callback.', stack); - throw e; - }, Math.floor(0)); - } -}; -/** - * @returns {boolean} true if we think we're currently being crawled. - */ -var beingCrawled = function () { - var userAgent = (typeof window === 'object' && - window['navigator'] && - window['navigator']['userAgent']) || - ''; - // For now we whitelist the most popular crawlers. We should refine this to be the set of crawlers we - // believe to support JavaScript/AJAX rendering. - // NOTE: Google Webmaster Tools doesn't really belong, but their "This is how a visitor to your website - // would have seen the page" is flaky if we don't treat it as a crawler. - return (userAgent.search(/googlebot|google webmaster tools|bingbot|yahoo! slurp|baiduspider|yandexbot|duckduckbot/i) >= 0); -}; -/** - * Same as setTimeout() except on Node.JS it will /not/ prevent the process from exiting. - * - * It is removed with clearTimeout() as normal. - * - * @param fn - Function to run. - * @param time - Milliseconds to wait before running. - * @returns The setTimeout() return value. - */ -var setTimeoutNonBlocking = function (fn, time) { - var timeout = setTimeout(fn, time); - // Note: at the time of this comment, unrefTimer is under the unstable set of APIs. Run with --unstable to enable the API. - if (typeof timeout === 'number' && - // @ts-ignore Is only defined in Deno environments. - typeof Deno !== 'undefined' && - // @ts-ignore Deno and unrefTimer are only defined in Deno environments. - Deno['unrefTimer']) { - // @ts-ignore Deno and unrefTimer are only defined in Deno environments. - Deno.unrefTimer(timeout); - // eslint-disable-next-line @typescript-eslint/no-explicit-any - } - else if (typeof timeout === 'object' && timeout['unref']) { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - timeout['unref'](); - } - return timeout; -}; - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * A class that holds metadata about a Repo object - */ -var RepoInfo = /** @class */ (function () { - /** - * @param host - Hostname portion of the url for the repo - * @param secure - Whether or not this repo is accessed over ssl - * @param namespace - The namespace represented by the repo - * @param webSocketOnly - Whether to prefer websockets over all other transports (used by Nest). - * @param nodeAdmin - Whether this instance uses Admin SDK credentials - * @param persistenceKey - Override the default session persistence storage key - */ - function RepoInfo(host, secure, namespace, webSocketOnly, nodeAdmin, persistenceKey, includeNamespaceInQueryParams) { - if (nodeAdmin === void 0) { nodeAdmin = false; } - if (persistenceKey === void 0) { persistenceKey = ''; } - if (includeNamespaceInQueryParams === void 0) { includeNamespaceInQueryParams = false; } - this.secure = secure; - this.namespace = namespace; - this.webSocketOnly = webSocketOnly; - this.nodeAdmin = nodeAdmin; - this.persistenceKey = persistenceKey; - this.includeNamespaceInQueryParams = includeNamespaceInQueryParams; - this._host = host.toLowerCase(); - this._domain = this._host.substr(this._host.indexOf('.') + 1); - this.internalHost = - PersistentStorage.get('host:' + host) || this._host; - } - RepoInfo.prototype.isCacheableHost = function () { - return this.internalHost.substr(0, 2) === 's-'; - }; - RepoInfo.prototype.isCustomHost = function () { - return (this._domain !== 'firebaseio.com' && - this._domain !== 'firebaseio-demo.com'); - }; - Object.defineProperty(RepoInfo.prototype, "host", { - get: function () { - return this._host; - }, - set: function (newHost) { - if (newHost !== this.internalHost) { - this.internalHost = newHost; - if (this.isCacheableHost()) { - PersistentStorage.set('host:' + this._host, this.internalHost); - } - } - }, - enumerable: false, - configurable: true - }); - RepoInfo.prototype.toString = function () { - var str = this.toURLString(); - if (this.persistenceKey) { - str += '<' + this.persistenceKey + '>'; - } - return str; - }; - RepoInfo.prototype.toURLString = function () { - var protocol = this.secure ? 'https://' : 'http://'; - var query = this.includeNamespaceInQueryParams - ? "?ns=" + this.namespace - : ''; - return "" + protocol + this.host + "/" + query; - }; - return RepoInfo; -}()); -function repoInfoNeedsQueryParam(repoInfo) { - return (repoInfo.host !== repoInfo.internalHost || - repoInfo.isCustomHost() || - repoInfo.includeNamespaceInQueryParams); -} -/** - * Returns the websocket URL for this repo - * @param repoInfo - RepoInfo object - * @param type - of connection - * @param params - list - * @returns The URL for this repo - */ -function repoInfoConnectionURL(repoInfo, type, params) { - util.assert(typeof type === 'string', 'typeof type must == string'); - util.assert(typeof params === 'object', 'typeof params must == object'); - var connURL; - if (type === WEBSOCKET) { - connURL = - (repoInfo.secure ? 'wss://' : 'ws://') + repoInfo.internalHost + '/.ws?'; - } - else if (type === LONG_POLLING) { - connURL = - (repoInfo.secure ? 'https://' : 'http://') + - repoInfo.internalHost + - '/.lp?'; - } - else { - throw new Error('Unknown connection type: ' + type); - } - if (repoInfoNeedsQueryParam(repoInfo)) { - params['ns'] = repoInfo.namespace; - } - var pairs = []; - each(params, function (key, value) { - pairs.push(key + '=' + value); - }); - return connURL + pairs.join('&'); -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Tracks a collection of stats. - */ -var StatsCollection = /** @class */ (function () { - function StatsCollection() { - this.counters_ = {}; - } - StatsCollection.prototype.incrementCounter = function (name, amount) { - if (amount === void 0) { amount = 1; } - if (!util.contains(this.counters_, name)) { - this.counters_[name] = 0; - } - this.counters_[name] += amount; - }; - StatsCollection.prototype.get = function () { - return util.deepCopy(this.counters_); - }; - return StatsCollection; -}()); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var collections = {}; -var reporters = {}; -function statsManagerGetCollection(repoInfo) { - var hashString = repoInfo.toString(); - if (!collections[hashString]) { - collections[hashString] = new StatsCollection(); - } - return collections[hashString]; -} -function statsManagerGetOrCreateReporter(repoInfo, creatorFunction) { - var hashString = repoInfo.toString(); - if (!reporters[hashString]) { - reporters[hashString] = creatorFunction(); - } - return reporters[hashString]; -} - -/** - * @license - * Copyright 2019 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** The semver (www.semver.org) version of the SDK. */ -var SDK_VERSION = ''; -/** - * SDK_VERSION should be set before any database instance is created - * @internal - */ -function setSDKVersion(version) { - SDK_VERSION = version; -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var WEBSOCKET_MAX_FRAME_SIZE = 16384; -var WEBSOCKET_KEEPALIVE_INTERVAL = 45000; -var WebSocketImpl = null; -if (typeof MozWebSocket !== 'undefined') { - WebSocketImpl = MozWebSocket; -} -else if (typeof WebSocket !== 'undefined') { - WebSocketImpl = WebSocket; -} -function setWebSocketImpl(impl) { - WebSocketImpl = impl; -} -/** - * Create a new websocket connection with the given callbacks. - */ -var WebSocketConnection = /** @class */ (function () { - /** - * @param connId identifier for this transport - * @param repoInfo The info for the websocket endpoint. - * @param applicationId The Firebase App ID for this project. - * @param appCheckToken The App Check Token for this client. - * @param authToken The Auth Token for this client. - * @param transportSessionId Optional transportSessionId if this is connecting - * to an existing transport session - * @param lastSessionId Optional lastSessionId if there was a previous - * connection - */ - function WebSocketConnection(connId, repoInfo, applicationId, appCheckToken, authToken, transportSessionId, lastSessionId) { - this.connId = connId; - this.applicationId = applicationId; - this.appCheckToken = appCheckToken; - this.authToken = authToken; - this.keepaliveTimer = null; - this.frames = null; - this.totalFrames = 0; - this.bytesSent = 0; - this.bytesReceived = 0; - this.log_ = logWrapper(this.connId); - this.stats_ = statsManagerGetCollection(repoInfo); - this.connURL = WebSocketConnection.connectionURL_(repoInfo, transportSessionId, lastSessionId, appCheckToken, applicationId); - this.nodeAdmin = repoInfo.nodeAdmin; - } - /** - * @param repoInfo - The info for the websocket endpoint. - * @param transportSessionId - Optional transportSessionId if this is connecting to an existing transport - * session - * @param lastSessionId - Optional lastSessionId if there was a previous connection - * @returns connection url - */ - WebSocketConnection.connectionURL_ = function (repoInfo, transportSessionId, lastSessionId, appCheckToken, applicationId) { - var urlParams = {}; - urlParams[VERSION_PARAM] = PROTOCOL_VERSION; - if (!util.isNodeSdk() && - typeof location !== 'undefined' && - location.hostname && - FORGE_DOMAIN_RE.test(location.hostname)) { - urlParams[REFERER_PARAM] = FORGE_REF; - } - if (transportSessionId) { - urlParams[TRANSPORT_SESSION_PARAM] = transportSessionId; - } - if (lastSessionId) { - urlParams[LAST_SESSION_PARAM] = lastSessionId; - } - if (appCheckToken) { - urlParams[APP_CHECK_TOKEN_PARAM] = appCheckToken; - } - if (applicationId) { - urlParams[APPLICATION_ID_PARAM] = applicationId; - } - return repoInfoConnectionURL(repoInfo, WEBSOCKET, urlParams); - }; - /** - * @param onMessage - Callback when messages arrive - * @param onDisconnect - Callback with connection lost. - */ - WebSocketConnection.prototype.open = function (onMessage, onDisconnect) { - var _this = this; - this.onDisconnect = onDisconnect; - this.onMessage = onMessage; - this.log_('Websocket connecting to ' + this.connURL); - this.everConnected_ = false; - // Assume failure until proven otherwise. - PersistentStorage.set('previous_websocket_failure', true); - try { - var options = void 0; - if (util.isNodeSdk()) { - var device = this.nodeAdmin ? 'AdminNode' : 'Node'; - // UA Format: Firebase//// - options = { - headers: { - 'User-Agent': "Firebase/" + PROTOCOL_VERSION + "/" + SDK_VERSION + "/" + process.platform + "/" + device, - 'X-Firebase-GMPID': this.applicationId || '' - } - }; - // If using Node with admin creds, AppCheck-related checks are unnecessary. - // Note that we send the credentials here even if they aren't admin credentials, which is - // not a problem. - // Note that this header is just used to bypass appcheck, and the token should still be sent - // through the websocket connection once it is established. - if (this.authToken) { - options.headers['Authorization'] = "Bearer " + this.authToken; - } - if (this.appCheckToken) { - options.headers['X-Firebase-AppCheck'] = this.appCheckToken; - } - // Plumb appropriate http_proxy environment variable into faye-websocket if it exists. - var env = process['env']; - var proxy = this.connURL.indexOf('wss://') === 0 - ? env['HTTPS_PROXY'] || env['https_proxy'] - : env['HTTP_PROXY'] || env['http_proxy']; - if (proxy) { - options['proxy'] = { origin: proxy }; - } - } - this.mySock = new WebSocketImpl(this.connURL, [], options); - } - catch (e) { - this.log_('Error instantiating WebSocket.'); - var error = e.message || e.data; - if (error) { - this.log_(error); - } - this.onClosed_(); - return; - } - this.mySock.onopen = function () { - _this.log_('Websocket connected.'); - _this.everConnected_ = true; - }; - this.mySock.onclose = function () { - _this.log_('Websocket connection was disconnected.'); - _this.mySock = null; - _this.onClosed_(); - }; - this.mySock.onmessage = function (m) { - _this.handleIncomingFrame(m); - }; - this.mySock.onerror = function (e) { - _this.log_('WebSocket error. Closing connection.'); - // eslint-disable-next-line @typescript-eslint/no-explicit-any - var error = e.message || e.data; - if (error) { - _this.log_(error); - } - _this.onClosed_(); - }; - }; - /** - * No-op for websockets, we don't need to do anything once the connection is confirmed as open - */ - WebSocketConnection.prototype.start = function () { }; - WebSocketConnection.forceDisallow = function () { - WebSocketConnection.forceDisallow_ = true; - }; - WebSocketConnection.isAvailable = function () { - var isOldAndroid = false; - if (typeof navigator !== 'undefined' && navigator.userAgent) { - var oldAndroidRegex = /Android ([0-9]{0,}\.[0-9]{0,})/; - var oldAndroidMatch = navigator.userAgent.match(oldAndroidRegex); - if (oldAndroidMatch && oldAndroidMatch.length > 1) { - if (parseFloat(oldAndroidMatch[1]) < 4.4) { - isOldAndroid = true; - } - } - } - return (!isOldAndroid && - WebSocketImpl !== null && - !WebSocketConnection.forceDisallow_); - }; - /** - * Returns true if we previously failed to connect with this transport. - */ - WebSocketConnection.previouslyFailed = function () { - // If our persistent storage is actually only in-memory storage, - // we default to assuming that it previously failed to be safe. - return (PersistentStorage.isInMemoryStorage || - PersistentStorage.get('previous_websocket_failure') === true); - }; - WebSocketConnection.prototype.markConnectionHealthy = function () { - PersistentStorage.remove('previous_websocket_failure'); - }; - WebSocketConnection.prototype.appendFrame_ = function (data) { - this.frames.push(data); - if (this.frames.length === this.totalFrames) { - var fullMess = this.frames.join(''); - this.frames = null; - var jsonMess = util.jsonEval(fullMess); - //handle the message - this.onMessage(jsonMess); - } - }; - /** - * @param frameCount - The number of frames we are expecting from the server - */ - WebSocketConnection.prototype.handleNewFrameCount_ = function (frameCount) { - this.totalFrames = frameCount; - this.frames = []; - }; - /** - * Attempts to parse a frame count out of some text. If it can't, assumes a value of 1 - * @returns Any remaining data to be process, or null if there is none - */ - WebSocketConnection.prototype.extractFrameCount_ = function (data) { - util.assert(this.frames === null, 'We already have a frame buffer'); - // TODO: The server is only supposed to send up to 9999 frames (i.e. length <= 4), but that isn't being enforced - // currently. So allowing larger frame counts (length <= 6). See https://app.asana.com/0/search/8688598998380/8237608042508 - if (data.length <= 6) { - var frameCount = Number(data); - if (!isNaN(frameCount)) { - this.handleNewFrameCount_(frameCount); - return null; - } - } - this.handleNewFrameCount_(1); - return data; - }; - /** - * Process a websocket frame that has arrived from the server. - * @param mess - The frame data - */ - WebSocketConnection.prototype.handleIncomingFrame = function (mess) { - if (this.mySock === null) { - return; // Chrome apparently delivers incoming packets even after we .close() the connection sometimes. - } - var data = mess['data']; - this.bytesReceived += data.length; - this.stats_.incrementCounter('bytes_received', data.length); - this.resetKeepAlive(); - if (this.frames !== null) { - // we're buffering - this.appendFrame_(data); - } - else { - // try to parse out a frame count, otherwise, assume 1 and process it - var remainingData = this.extractFrameCount_(data); - if (remainingData !== null) { - this.appendFrame_(remainingData); - } - } - }; - /** - * Send a message to the server - * @param data - The JSON object to transmit - */ - WebSocketConnection.prototype.send = function (data) { - this.resetKeepAlive(); - var dataStr = util.stringify(data); - this.bytesSent += dataStr.length; - this.stats_.incrementCounter('bytes_sent', dataStr.length); - //We can only fit a certain amount in each websocket frame, so we need to split this request - //up into multiple pieces if it doesn't fit in one request. - var dataSegs = splitStringBySize(dataStr, WEBSOCKET_MAX_FRAME_SIZE); - //Send the length header - if (dataSegs.length > 1) { - this.sendString_(String(dataSegs.length)); - } - //Send the actual data in segments. - for (var i = 0; i < dataSegs.length; i++) { - this.sendString_(dataSegs[i]); - } - }; - WebSocketConnection.prototype.shutdown_ = function () { - this.isClosed_ = true; - if (this.keepaliveTimer) { - clearInterval(this.keepaliveTimer); - this.keepaliveTimer = null; - } - if (this.mySock) { - this.mySock.close(); - this.mySock = null; - } - }; - WebSocketConnection.prototype.onClosed_ = function () { - if (!this.isClosed_) { - this.log_('WebSocket is closing itself'); - this.shutdown_(); - // since this is an internal close, trigger the close listener - if (this.onDisconnect) { - this.onDisconnect(this.everConnected_); - this.onDisconnect = null; - } - } - }; - /** - * External-facing close handler. - * Close the websocket and kill the connection. - */ - WebSocketConnection.prototype.close = function () { - if (!this.isClosed_) { - this.log_('WebSocket is being closed'); - this.shutdown_(); - } - }; - /** - * Kill the current keepalive timer and start a new one, to ensure that it always fires N seconds after - * the last activity. - */ - WebSocketConnection.prototype.resetKeepAlive = function () { - var _this = this; - clearInterval(this.keepaliveTimer); - this.keepaliveTimer = setInterval(function () { - //If there has been no websocket activity for a while, send a no-op - if (_this.mySock) { - _this.sendString_('0'); - } - _this.resetKeepAlive(); - // eslint-disable-next-line @typescript-eslint/no-explicit-any - }, Math.floor(WEBSOCKET_KEEPALIVE_INTERVAL)); - }; - /** - * Send a string over the websocket. - * - * @param str - String to send. - */ - WebSocketConnection.prototype.sendString_ = function (str) { - // Firefox seems to sometimes throw exceptions (NS_ERROR_UNEXPECTED) from websocket .send() - // calls for some unknown reason. We treat these as an error and disconnect. - // See https://app.asana.com/0/58926111402292/68021340250410 - try { - this.mySock.send(str); - } - catch (e) { - this.log_('Exception thrown from WebSocket.send():', e.message || e.data, 'Closing connection.'); - setTimeout(this.onClosed_.bind(this), 0); - } - }; - /** - * Number of response before we consider the connection "healthy." - */ - WebSocketConnection.responsesRequiredToBeHealthy = 2; - /** - * Time to wait for the connection te become healthy before giving up. - */ - WebSocketConnection.healthyTimeout = 30000; - return WebSocketConnection; -}()); - -/** - * @license - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Abstraction around AppCheck's token fetching capabilities. - */ -var AppCheckTokenProvider = /** @class */ (function () { - function AppCheckTokenProvider(appName_, appCheckProvider) { - var _this = this; - this.appName_ = appName_; - this.appCheckProvider = appCheckProvider; - this.appCheck = appCheckProvider === null || appCheckProvider === void 0 ? void 0 : appCheckProvider.getImmediate({ optional: true }); - if (!this.appCheck) { - appCheckProvider === null || appCheckProvider === void 0 ? void 0 : appCheckProvider.get().then(function (appCheck) { return (_this.appCheck = appCheck); }); - } - } - AppCheckTokenProvider.prototype.getToken = function (forceRefresh) { - var _this = this; - if (!this.appCheck) { - return new Promise(function (resolve, reject) { - // Support delayed initialization of FirebaseAppCheck. This allows our - // customers to initialize the RTDB SDK before initializing Firebase - // AppCheck and ensures that all requests are authenticated if a token - // becomes available before the timoeout below expires. - setTimeout(function () { - if (_this.appCheck) { - _this.getToken(forceRefresh).then(resolve, reject); - } - else { - resolve(null); - } - }, 0); - }); - } - return this.appCheck.getToken(forceRefresh); - }; - AppCheckTokenProvider.prototype.addTokenChangeListener = function (listener) { - var _a; - (_a = this.appCheckProvider) === null || _a === void 0 ? void 0 : _a.get().then(function (appCheck) { return appCheck.addTokenListener(listener); }); - }; - AppCheckTokenProvider.prototype.notifyForInvalidToken = function () { - warn("Provided AppCheck credentials for the app named \"" + this.appName_ + "\" " + - 'are invalid. This usually indicates your app was not initialized correctly.'); - }; - return AppCheckTokenProvider; -}()); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Abstraction around FirebaseApp's token fetching capabilities. - */ -var FirebaseAuthTokenProvider = /** @class */ (function () { - function FirebaseAuthTokenProvider(appName_, firebaseOptions_, authProvider_) { - var _this = this; - this.appName_ = appName_; - this.firebaseOptions_ = firebaseOptions_; - this.authProvider_ = authProvider_; - this.auth_ = null; - this.auth_ = authProvider_.getImmediate({ optional: true }); - if (!this.auth_) { - authProvider_.onInit(function (auth) { return (_this.auth_ = auth); }); - } - } - FirebaseAuthTokenProvider.prototype.getToken = function (forceRefresh) { - var _this = this; - if (!this.auth_) { - return new Promise(function (resolve, reject) { - // Support delayed initialization of FirebaseAuth. This allows our - // customers to initialize the RTDB SDK before initializing Firebase - // Auth and ensures that all requests are authenticated if a token - // becomes available before the timoeout below expires. - setTimeout(function () { - if (_this.auth_) { - _this.getToken(forceRefresh).then(resolve, reject); - } - else { - resolve(null); - } - }, 0); - }); - } - return this.auth_.getToken(forceRefresh).catch(function (error) { - // TODO: Need to figure out all the cases this is raised and whether - // this makes sense. - if (error && error.code === 'auth/token-not-initialized') { - log('Got auth/token-not-initialized error. Treating as null token.'); - return null; - } - else { - return Promise.reject(error); - } - }); - }; - FirebaseAuthTokenProvider.prototype.addTokenChangeListener = function (listener) { - // TODO: We might want to wrap the listener and call it with no args to - // avoid a leaky abstraction, but that makes removing the listener harder. - if (this.auth_) { - this.auth_.addAuthTokenListener(listener); - } - else { - this.authProvider_ - .get() - .then(function (auth) { return auth.addAuthTokenListener(listener); }); - } - }; - FirebaseAuthTokenProvider.prototype.removeTokenChangeListener = function (listener) { - this.authProvider_ - .get() - .then(function (auth) { return auth.removeAuthTokenListener(listener); }); - }; - FirebaseAuthTokenProvider.prototype.notifyForInvalidToken = function () { - var errorMessage = 'Provided authentication credentials for the app named "' + - this.appName_ + - '" are invalid. This usually indicates your app was not ' + - 'initialized correctly. '; - if ('credential' in this.firebaseOptions_) { - errorMessage += - 'Make sure the "credential" property provided to initializeApp() ' + - 'is authorized to access the specified "databaseURL" and is from the correct ' + - 'project.'; - } - else if ('serviceAccount' in this.firebaseOptions_) { - errorMessage += - 'Make sure the "serviceAccount" property provided to initializeApp() ' + - 'is authorized to access the specified "databaseURL" and is from the correct ' + - 'project.'; - } - else { - errorMessage += - 'Make sure the "apiKey" and "databaseURL" properties provided to ' + - 'initializeApp() match the values provided for your app at ' + - 'https://console.firebase.google.com/.'; - } - warn(errorMessage); - }; - return FirebaseAuthTokenProvider; -}()); -/* AuthTokenProvider that supplies a constant token. Used by Admin SDK or mockUserToken with emulators. */ -var EmulatorTokenProvider = /** @class */ (function () { - function EmulatorTokenProvider(accessToken) { - this.accessToken = accessToken; - } - EmulatorTokenProvider.prototype.getToken = function (forceRefresh) { - return Promise.resolve({ - accessToken: this.accessToken - }); - }; - EmulatorTokenProvider.prototype.addTokenChangeListener = function (listener) { - // Invoke the listener immediately to match the behavior in Firebase Auth - // (see packages/auth/src/auth.js#L1807) - listener(this.accessToken); - }; - EmulatorTokenProvider.prototype.removeTokenChangeListener = function (listener) { }; - EmulatorTokenProvider.prototype.notifyForInvalidToken = function () { }; - /** A string that is treated as an admin access token by the RTDB emulator. Used by Admin SDK. */ - EmulatorTokenProvider.OWNER = 'owner'; - return EmulatorTokenProvider; -}()); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * This class ensures the packets from the server arrive in order - * This class takes data from the server and ensures it gets passed into the callbacks in order. - */ -var PacketReceiver = /** @class */ (function () { - /** - * @param onMessage_ - */ - function PacketReceiver(onMessage_) { - this.onMessage_ = onMessage_; - this.pendingResponses = []; - this.currentResponseNum = 0; - this.closeAfterResponse = -1; - this.onClose = null; - } - PacketReceiver.prototype.closeAfter = function (responseNum, callback) { - this.closeAfterResponse = responseNum; - this.onClose = callback; - if (this.closeAfterResponse < this.currentResponseNum) { - this.onClose(); - this.onClose = null; - } - }; - /** - * Each message from the server comes with a response number, and an array of data. The responseNumber - * allows us to ensure that we process them in the right order, since we can't be guaranteed that all - * browsers will respond in the same order as the requests we sent - */ - PacketReceiver.prototype.handleResponse = function (requestNum, data) { - var _this = this; - this.pendingResponses[requestNum] = data; - var _loop_1 = function () { - var toProcess = this_1.pendingResponses[this_1.currentResponseNum]; - delete this_1.pendingResponses[this_1.currentResponseNum]; - var _loop_2 = function (i) { - if (toProcess[i]) { - exceptionGuard(function () { - _this.onMessage_(toProcess[i]); - }); - } - }; - for (var i = 0; i < toProcess.length; ++i) { - _loop_2(i); - } - if (this_1.currentResponseNum === this_1.closeAfterResponse) { - if (this_1.onClose) { - this_1.onClose(); - this_1.onClose = null; - } - return "break"; - } - this_1.currentResponseNum++; - }; - var this_1 = this; - while (this.pendingResponses[this.currentResponseNum]) { - var state_1 = _loop_1(); - if (state_1 === "break") - break; - } - }; - return PacketReceiver; -}()); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// URL query parameters associated with longpolling -var FIREBASE_LONGPOLL_START_PARAM = 'start'; -var FIREBASE_LONGPOLL_CLOSE_COMMAND = 'close'; -var FIREBASE_LONGPOLL_COMMAND_CB_NAME = 'pLPCommand'; -var FIREBASE_LONGPOLL_DATA_CB_NAME = 'pRTLPCB'; -var FIREBASE_LONGPOLL_ID_PARAM = 'id'; -var FIREBASE_LONGPOLL_PW_PARAM = 'pw'; -var FIREBASE_LONGPOLL_SERIAL_PARAM = 'ser'; -var FIREBASE_LONGPOLL_CALLBACK_ID_PARAM = 'cb'; -var FIREBASE_LONGPOLL_SEGMENT_NUM_PARAM = 'seg'; -var FIREBASE_LONGPOLL_SEGMENTS_IN_PACKET = 'ts'; -var FIREBASE_LONGPOLL_DATA_PARAM = 'd'; -var FIREBASE_LONGPOLL_DISCONN_FRAME_REQUEST_PARAM = 'dframe'; -//Data size constants. -//TODO: Perf: the maximum length actually differs from browser to browser. -// We should check what browser we're on and set accordingly. -var MAX_URL_DATA_SIZE = 1870; -var SEG_HEADER_SIZE = 30; //ie: &seg=8299234&ts=982389123&d= -var MAX_PAYLOAD_SIZE = MAX_URL_DATA_SIZE - SEG_HEADER_SIZE; -/** - * Keepalive period - * send a fresh request at minimum every 25 seconds. Opera has a maximum request - * length of 30 seconds that we can't exceed. - */ -var KEEPALIVE_REQUEST_INTERVAL = 25000; -/** - * How long to wait before aborting a long-polling connection attempt. - */ -var LP_CONNECT_TIMEOUT = 30000; -/** - * This class manages a single long-polling connection. - */ -var BrowserPollConnection = /** @class */ (function () { - /** - * @param connId An identifier for this connection, used for logging - * @param repoInfo The info for the endpoint to send data to. - * @param applicationId The Firebase App ID for this project. - * @param appCheckToken The AppCheck token for this client. - * @param authToken The AuthToken to use for this connection. - * @param transportSessionId Optional transportSessionid if we are - * reconnecting for an existing transport session - * @param lastSessionId Optional lastSessionId if the PersistentConnection has - * already created a connection previously - */ - function BrowserPollConnection(connId, repoInfo, applicationId, appCheckToken, authToken, transportSessionId, lastSessionId) { - var _this = this; - this.connId = connId; - this.repoInfo = repoInfo; - this.applicationId = applicationId; - this.appCheckToken = appCheckToken; - this.authToken = authToken; - this.transportSessionId = transportSessionId; - this.lastSessionId = lastSessionId; - this.bytesSent = 0; - this.bytesReceived = 0; - this.everConnected_ = false; - this.log_ = logWrapper(connId); - this.stats_ = statsManagerGetCollection(repoInfo); - this.urlFn = function (params) { - // Always add the token if we have one. - if (_this.appCheckToken) { - params[APP_CHECK_TOKEN_PARAM] = _this.appCheckToken; - } - return repoInfoConnectionURL(repoInfo, LONG_POLLING, params); - }; - } - /** - * @param onMessage - Callback when messages arrive - * @param onDisconnect - Callback with connection lost. - */ - BrowserPollConnection.prototype.open = function (onMessage, onDisconnect) { - var _this = this; - this.curSegmentNum = 0; - this.onDisconnect_ = onDisconnect; - this.myPacketOrderer = new PacketReceiver(onMessage); - this.isClosed_ = false; - this.connectTimeoutTimer_ = setTimeout(function () { - _this.log_('Timed out trying to connect.'); - // Make sure we clear the host cache - _this.onClosed_(); - _this.connectTimeoutTimer_ = null; - // eslint-disable-next-line @typescript-eslint/no-explicit-any - }, Math.floor(LP_CONNECT_TIMEOUT)); - // Ensure we delay the creation of the iframe until the DOM is loaded. - executeWhenDOMReady(function () { - if (_this.isClosed_) { - return; - } - //Set up a callback that gets triggered once a connection is set up. - _this.scriptTagHolder = new FirebaseIFrameScriptHolder(function () { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - var _a = tslib.__read(args, 5), command = _a[0], arg1 = _a[1], arg2 = _a[2]; _a[3]; _a[4]; - _this.incrementIncomingBytes_(args); - if (!_this.scriptTagHolder) { - return; // we closed the connection. - } - if (_this.connectTimeoutTimer_) { - clearTimeout(_this.connectTimeoutTimer_); - _this.connectTimeoutTimer_ = null; - } - _this.everConnected_ = true; - if (command === FIREBASE_LONGPOLL_START_PARAM) { - _this.id = arg1; - _this.password = arg2; - } - else if (command === FIREBASE_LONGPOLL_CLOSE_COMMAND) { - // Don't clear the host cache. We got a response from the server, so we know it's reachable - if (arg1) { - // We aren't expecting any more data (other than what the server's already in the process of sending us - // through our already open polls), so don't send any more. - _this.scriptTagHolder.sendNewPolls = false; - // arg1 in this case is the last response number sent by the server. We should try to receive - // all of the responses up to this one before closing - _this.myPacketOrderer.closeAfter(arg1, function () { - _this.onClosed_(); - }); - } - else { - _this.onClosed_(); - } - } - else { - throw new Error('Unrecognized command received: ' + command); - } - }, function () { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - var _a = tslib.__read(args, 2), pN = _a[0], data = _a[1]; - _this.incrementIncomingBytes_(args); - _this.myPacketOrderer.handleResponse(pN, data); - }, function () { - _this.onClosed_(); - }, _this.urlFn); - //Send the initial request to connect. The serial number is simply to keep the browser from pulling previous results - //from cache. - var urlParams = {}; - urlParams[FIREBASE_LONGPOLL_START_PARAM] = 't'; - urlParams[FIREBASE_LONGPOLL_SERIAL_PARAM] = Math.floor(Math.random() * 100000000); - if (_this.scriptTagHolder.uniqueCallbackIdentifier) { - urlParams[FIREBASE_LONGPOLL_CALLBACK_ID_PARAM] = - _this.scriptTagHolder.uniqueCallbackIdentifier; - } - urlParams[VERSION_PARAM] = PROTOCOL_VERSION; - if (_this.transportSessionId) { - urlParams[TRANSPORT_SESSION_PARAM] = _this.transportSessionId; - } - if (_this.lastSessionId) { - urlParams[LAST_SESSION_PARAM] = _this.lastSessionId; - } - if (_this.applicationId) { - urlParams[APPLICATION_ID_PARAM] = _this.applicationId; - } - if (_this.appCheckToken) { - urlParams[APP_CHECK_TOKEN_PARAM] = _this.appCheckToken; - } - if (typeof location !== 'undefined' && - location.hostname && - FORGE_DOMAIN_RE.test(location.hostname)) { - urlParams[REFERER_PARAM] = FORGE_REF; - } - var connectURL = _this.urlFn(urlParams); - _this.log_('Connecting via long-poll to ' + connectURL); - _this.scriptTagHolder.addTag(connectURL, function () { - /* do nothing */ - }); - }); - }; - /** - * Call this when a handshake has completed successfully and we want to consider the connection established - */ - BrowserPollConnection.prototype.start = function () { - this.scriptTagHolder.startLongPoll(this.id, this.password); - this.addDisconnectPingFrame(this.id, this.password); - }; - /** - * Forces long polling to be considered as a potential transport - */ - BrowserPollConnection.forceAllow = function () { - BrowserPollConnection.forceAllow_ = true; - }; - /** - * Forces longpolling to not be considered as a potential transport - */ - BrowserPollConnection.forceDisallow = function () { - BrowserPollConnection.forceDisallow_ = true; - }; - // Static method, use string literal so it can be accessed in a generic way - BrowserPollConnection.isAvailable = function () { - if (util.isNodeSdk()) { - return false; - } - else if (BrowserPollConnection.forceAllow_) { - return true; - } - else { - // NOTE: In React-Native there's normally no 'document', but if you debug a React-Native app in - // the Chrome debugger, 'document' is defined, but document.createElement is null (2015/06/08). - return (!BrowserPollConnection.forceDisallow_ && - typeof document !== 'undefined' && - document.createElement != null && - !isChromeExtensionContentScript() && - !isWindowsStoreApp()); - } - }; - /** - * No-op for polling - */ - BrowserPollConnection.prototype.markConnectionHealthy = function () { }; - /** - * Stops polling and cleans up the iframe - */ - BrowserPollConnection.prototype.shutdown_ = function () { - this.isClosed_ = true; - if (this.scriptTagHolder) { - this.scriptTagHolder.close(); - this.scriptTagHolder = null; - } - //remove the disconnect frame, which will trigger an XHR call to the server to tell it we're leaving. - if (this.myDisconnFrame) { - document.body.removeChild(this.myDisconnFrame); - this.myDisconnFrame = null; - } - if (this.connectTimeoutTimer_) { - clearTimeout(this.connectTimeoutTimer_); - this.connectTimeoutTimer_ = null; - } - }; - /** - * Triggered when this transport is closed - */ - BrowserPollConnection.prototype.onClosed_ = function () { - if (!this.isClosed_) { - this.log_('Longpoll is closing itself'); - this.shutdown_(); - if (this.onDisconnect_) { - this.onDisconnect_(this.everConnected_); - this.onDisconnect_ = null; - } - } - }; - /** - * External-facing close handler. RealTime has requested we shut down. Kill our connection and tell the server - * that we've left. - */ - BrowserPollConnection.prototype.close = function () { - if (!this.isClosed_) { - this.log_('Longpoll is being closed.'); - this.shutdown_(); - } - }; - /** - * Send the JSON object down to the server. It will need to be stringified, base64 encoded, and then - * broken into chunks (since URLs have a small maximum length). - * @param data - The JSON data to transmit. - */ - BrowserPollConnection.prototype.send = function (data) { - var dataStr = util.stringify(data); - this.bytesSent += dataStr.length; - this.stats_.incrementCounter('bytes_sent', dataStr.length); - //first, lets get the base64-encoded data - var base64data = util.base64Encode(dataStr); - //We can only fit a certain amount in each URL, so we need to split this request - //up into multiple pieces if it doesn't fit in one request. - var dataSegs = splitStringBySize(base64data, MAX_PAYLOAD_SIZE); - //Enqueue each segment for transmission. We assign each chunk a sequential ID and a total number - //of segments so that we can reassemble the packet on the server. - for (var i = 0; i < dataSegs.length; i++) { - this.scriptTagHolder.enqueueSegment(this.curSegmentNum, dataSegs.length, dataSegs[i]); - this.curSegmentNum++; - } - }; - /** - * This is how we notify the server that we're leaving. - * We aren't able to send requests with DHTML on a window close event, but we can - * trigger XHR requests in some browsers (everything but Opera basically). - */ - BrowserPollConnection.prototype.addDisconnectPingFrame = function (id, pw) { - if (util.isNodeSdk()) { - return; - } - this.myDisconnFrame = document.createElement('iframe'); - var urlParams = {}; - urlParams[FIREBASE_LONGPOLL_DISCONN_FRAME_REQUEST_PARAM] = 't'; - urlParams[FIREBASE_LONGPOLL_ID_PARAM] = id; - urlParams[FIREBASE_LONGPOLL_PW_PARAM] = pw; - this.myDisconnFrame.src = this.urlFn(urlParams); - this.myDisconnFrame.style.display = 'none'; - document.body.appendChild(this.myDisconnFrame); - }; - /** - * Used to track the bytes received by this client - */ - BrowserPollConnection.prototype.incrementIncomingBytes_ = function (args) { - // TODO: This is an annoying perf hit just to track the number of incoming bytes. Maybe it should be opt-in. - var bytesReceived = util.stringify(args).length; - this.bytesReceived += bytesReceived; - this.stats_.incrementCounter('bytes_received', bytesReceived); - }; - return BrowserPollConnection; -}()); -/********************************************************************************************* - * A wrapper around an iframe that is used as a long-polling script holder. - *********************************************************************************************/ -var FirebaseIFrameScriptHolder = /** @class */ (function () { - /** - * @param commandCB - The callback to be called when control commands are recevied from the server. - * @param onMessageCB - The callback to be triggered when responses arrive from the server. - * @param onDisconnect - The callback to be triggered when this tag holder is closed - * @param urlFn - A function that provides the URL of the endpoint to send data to. - */ - function FirebaseIFrameScriptHolder(commandCB, onMessageCB, onDisconnect, urlFn) { - this.onDisconnect = onDisconnect; - this.urlFn = urlFn; - //We maintain a count of all of the outstanding requests, because if we have too many active at once it can cause - //problems in some browsers. - this.outstandingRequests = new Set(); - //A queue of the pending segments waiting for transmission to the server. - this.pendingSegs = []; - //A serial number. We use this for two things: - // 1) A way to ensure the browser doesn't cache responses to polls - // 2) A way to make the server aware when long-polls arrive in a different order than we started them. The - // server needs to release both polls in this case or it will cause problems in Opera since Opera can only execute - // JSONP code in the order it was added to the iframe. - this.currentSerial = Math.floor(Math.random() * 100000000); - // This gets set to false when we're "closing down" the connection (e.g. we're switching transports but there's still - // incoming data from the server that we're waiting for). - this.sendNewPolls = true; - if (!util.isNodeSdk()) { - //Each script holder registers a couple of uniquely named callbacks with the window. These are called from the - //iframes where we put the long-polling script tags. We have two callbacks: - // 1) Command Callback - Triggered for control issues, like starting a connection. - // 2) Message Callback - Triggered when new data arrives. - this.uniqueCallbackIdentifier = LUIDGenerator(); - window[FIREBASE_LONGPOLL_COMMAND_CB_NAME + this.uniqueCallbackIdentifier] = commandCB; - window[FIREBASE_LONGPOLL_DATA_CB_NAME + this.uniqueCallbackIdentifier] = - onMessageCB; - //Create an iframe for us to add script tags to. - this.myIFrame = FirebaseIFrameScriptHolder.createIFrame_(); - // Set the iframe's contents. - var script = ''; - // if we set a javascript url, it's IE and we need to set the document domain. The javascript url is sufficient - // for ie9, but ie8 needs to do it again in the document itself. - if (this.myIFrame.src && - this.myIFrame.src.substr(0, 'javascript:'.length) === 'javascript:') { - var currentDomain = document.domain; - script = ''; - } - var iframeContents = '' + script + ''; - try { - this.myIFrame.doc.open(); - this.myIFrame.doc.write(iframeContents); - this.myIFrame.doc.close(); - } - catch (e) { - log('frame writing exception'); - if (e.stack) { - log(e.stack); - } - log(e); - } - } - else { - this.commandCB = commandCB; - this.onMessageCB = onMessageCB; - } - } - /** - * Each browser has its own funny way to handle iframes. Here we mush them all together into one object that I can - * actually use. - */ - FirebaseIFrameScriptHolder.createIFrame_ = function () { - var iframe = document.createElement('iframe'); - iframe.style.display = 'none'; - // This is necessary in order to initialize the document inside the iframe - if (document.body) { - document.body.appendChild(iframe); - try { - // If document.domain has been modified in IE, this will throw an error, and we need to set the - // domain of the iframe's document manually. We can do this via a javascript: url as the src attribute - // Also note that we must do this *after* the iframe has been appended to the page. Otherwise it doesn't work. - var a = iframe.contentWindow.document; - if (!a) { - // Apologies for the log-spam, I need to do something to keep closure from optimizing out the assignment above. - log('No IE domain setting required'); - } - } - catch (e) { - var domain = document.domain; - iframe.src = - "javascript:void((function(){document.open();document.domain='" + - domain + - "';document.close();})())"; - } - } - else { - // LongPollConnection attempts to delay initialization until the document is ready, so hopefully this - // never gets hit. - throw 'Document body has not initialized. Wait to initialize Firebase until after the document is ready.'; - } - // Get the document of the iframe in a browser-specific way. - if (iframe.contentDocument) { - iframe.doc = iframe.contentDocument; // Firefox, Opera, Safari - } - else if (iframe.contentWindow) { - iframe.doc = iframe.contentWindow.document; // Internet Explorer - // eslint-disable-next-line @typescript-eslint/no-explicit-any - } - else if (iframe.document) { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - iframe.doc = iframe.document; //others? - } - return iframe; - }; - /** - * Cancel all outstanding queries and remove the frame. - */ - FirebaseIFrameScriptHolder.prototype.close = function () { - var _this = this; - //Mark this iframe as dead, so no new requests are sent. - this.alive = false; - if (this.myIFrame) { - //We have to actually remove all of the html inside this iframe before removing it from the - //window, or IE will continue loading and executing the script tags we've already added, which - //can lead to some errors being thrown. Setting innerHTML seems to be the easiest way to do this. - this.myIFrame.doc.body.innerHTML = ''; - setTimeout(function () { - if (_this.myIFrame !== null) { - document.body.removeChild(_this.myIFrame); - _this.myIFrame = null; - } - }, Math.floor(0)); - } - // Protect from being called recursively. - var onDisconnect = this.onDisconnect; - if (onDisconnect) { - this.onDisconnect = null; - onDisconnect(); - } - }; - /** - * Actually start the long-polling session by adding the first script tag(s) to the iframe. - * @param id - The ID of this connection - * @param pw - The password for this connection - */ - FirebaseIFrameScriptHolder.prototype.startLongPoll = function (id, pw) { - this.myID = id; - this.myPW = pw; - this.alive = true; - //send the initial request. If there are requests queued, make sure that we transmit as many as we are currently able to. - while (this.newRequest_()) { } - }; - /** - * This is called any time someone might want a script tag to be added. It adds a script tag when there aren't - * too many outstanding requests and we are still alive. - * - * If there are outstanding packet segments to send, it sends one. If there aren't, it sends a long-poll anyways if - * needed. - */ - FirebaseIFrameScriptHolder.prototype.newRequest_ = function () { - // We keep one outstanding request open all the time to receive data, but if we need to send data - // (pendingSegs.length > 0) then we create a new request to send the data. The server will automatically - // close the old request. - if (this.alive && - this.sendNewPolls && - this.outstandingRequests.size < (this.pendingSegs.length > 0 ? 2 : 1)) { - //construct our url - this.currentSerial++; - var urlParams = {}; - urlParams[FIREBASE_LONGPOLL_ID_PARAM] = this.myID; - urlParams[FIREBASE_LONGPOLL_PW_PARAM] = this.myPW; - urlParams[FIREBASE_LONGPOLL_SERIAL_PARAM] = this.currentSerial; - var theURL = this.urlFn(urlParams); - //Now add as much data as we can. - var curDataString = ''; - var i = 0; - while (this.pendingSegs.length > 0) { - //first, lets see if the next segment will fit. - var nextSeg = this.pendingSegs[0]; - if (nextSeg.d.length + - SEG_HEADER_SIZE + - curDataString.length <= - MAX_URL_DATA_SIZE) { - //great, the segment will fit. Lets append it. - var theSeg = this.pendingSegs.shift(); - curDataString = - curDataString + - '&' + - FIREBASE_LONGPOLL_SEGMENT_NUM_PARAM + - i + - '=' + - theSeg.seg + - '&' + - FIREBASE_LONGPOLL_SEGMENTS_IN_PACKET + - i + - '=' + - theSeg.ts + - '&' + - FIREBASE_LONGPOLL_DATA_PARAM + - i + - '=' + - theSeg.d; - i++; - } - else { - break; - } - } - theURL = theURL + curDataString; - this.addLongPollTag_(theURL, this.currentSerial); - return true; - } - else { - return false; - } - }; - /** - * Queue a packet for transmission to the server. - * @param segnum - A sequential id for this packet segment used for reassembly - * @param totalsegs - The total number of segments in this packet - * @param data - The data for this segment. - */ - FirebaseIFrameScriptHolder.prototype.enqueueSegment = function (segnum, totalsegs, data) { - //add this to the queue of segments to send. - this.pendingSegs.push({ seg: segnum, ts: totalsegs, d: data }); - //send the data immediately if there isn't already data being transmitted, unless - //startLongPoll hasn't been called yet. - if (this.alive) { - this.newRequest_(); - } - }; - /** - * Add a script tag for a regular long-poll request. - * @param url - The URL of the script tag. - * @param serial - The serial number of the request. - */ - FirebaseIFrameScriptHolder.prototype.addLongPollTag_ = function (url, serial) { - var _this = this; - //remember that we sent this request. - this.outstandingRequests.add(serial); - var doNewRequest = function () { - _this.outstandingRequests.delete(serial); - _this.newRequest_(); - }; - // If this request doesn't return on its own accord (by the server sending us some data), we'll - // create a new one after the KEEPALIVE interval to make sure we always keep a fresh request open. - var keepaliveTimeout = setTimeout(doNewRequest, Math.floor(KEEPALIVE_REQUEST_INTERVAL)); - var readyStateCB = function () { - // Request completed. Cancel the keepalive. - clearTimeout(keepaliveTimeout); - // Trigger a new request so we can continue receiving data. - doNewRequest(); - }; - this.addTag(url, readyStateCB); - }; - /** - * Add an arbitrary script tag to the iframe. - * @param url - The URL for the script tag source. - * @param loadCB - A callback to be triggered once the script has loaded. - */ - FirebaseIFrameScriptHolder.prototype.addTag = function (url, loadCB) { - var _this = this; - if (util.isNodeSdk()) { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - this.doNodeLongPoll(url, loadCB); - } - else { - setTimeout(function () { - try { - // if we're already closed, don't add this poll - if (!_this.sendNewPolls) { - return; - } - var newScript_1 = _this.myIFrame.doc.createElement('script'); - newScript_1.type = 'text/javascript'; - newScript_1.async = true; - newScript_1.src = url; - // eslint-disable-next-line @typescript-eslint/no-explicit-any - newScript_1.onload = newScript_1.onreadystatechange = - function () { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - var rstate = newScript_1.readyState; - if (!rstate || rstate === 'loaded' || rstate === 'complete') { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - newScript_1.onload = newScript_1.onreadystatechange = null; - if (newScript_1.parentNode) { - newScript_1.parentNode.removeChild(newScript_1); - } - loadCB(); - } - }; - newScript_1.onerror = function () { - log('Long-poll script failed to load: ' + url); - _this.sendNewPolls = false; - _this.close(); - }; - _this.myIFrame.doc.body.appendChild(newScript_1); - } - catch (e) { - // TODO: we should make this error visible somehow - } - }, Math.floor(1)); - } - }; - return FirebaseIFrameScriptHolder; -}()); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Currently simplistic, this class manages what transport a Connection should use at various stages of its - * lifecycle. - * - * It starts with longpolling in a browser, and httppolling on node. It then upgrades to websockets if - * they are available. - */ -var TransportManager = /** @class */ (function () { - /** - * @param repoInfo - Metadata around the namespace we're connecting to - */ - function TransportManager(repoInfo) { - this.initTransports_(repoInfo); - } - Object.defineProperty(TransportManager, "ALL_TRANSPORTS", { - get: function () { - return [BrowserPollConnection, WebSocketConnection]; - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(TransportManager, "IS_TRANSPORT_INITIALIZED", { - /** - * Returns whether transport has been selected to ensure WebSocketConnection or BrowserPollConnection are not called after - * TransportManager has already set up transports_ - */ - get: function () { - return this.globalTransportInitialized_; - }, - enumerable: false, - configurable: true - }); - TransportManager.prototype.initTransports_ = function (repoInfo) { - var e_1, _a; - var isWebSocketsAvailable = WebSocketConnection && WebSocketConnection['isAvailable'](); - var isSkipPollConnection = isWebSocketsAvailable && !WebSocketConnection.previouslyFailed(); - if (repoInfo.webSocketOnly) { - if (!isWebSocketsAvailable) { - warn("wss:// URL used, but browser isn't known to support websockets. Trying anyway."); - } - isSkipPollConnection = true; - } - if (isSkipPollConnection) { - this.transports_ = [WebSocketConnection]; - } - else { - var transports = (this.transports_ = []); - try { - for (var _b = tslib.__values(TransportManager.ALL_TRANSPORTS), _c = _b.next(); !_c.done; _c = _b.next()) { - var transport = _c.value; - if (transport && transport['isAvailable']()) { - transports.push(transport); - } - } - } - catch (e_1_1) { e_1 = { error: e_1_1 }; } - finally { - try { - if (_c && !_c.done && (_a = _b.return)) _a.call(_b); - } - finally { if (e_1) throw e_1.error; } - } - TransportManager.globalTransportInitialized_ = true; - } - }; - /** - * @returns The constructor for the initial transport to use - */ - TransportManager.prototype.initialTransport = function () { - if (this.transports_.length > 0) { - return this.transports_[0]; - } - else { - throw new Error('No transports available'); - } - }; - /** - * @returns The constructor for the next transport, or null - */ - TransportManager.prototype.upgradeTransport = function () { - if (this.transports_.length > 1) { - return this.transports_[1]; - } - else { - return null; - } - }; - // Keeps track of whether the TransportManager has already chosen a transport to use - TransportManager.globalTransportInitialized_ = false; - return TransportManager; -}()); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Abort upgrade attempt if it takes longer than 60s. -var UPGRADE_TIMEOUT = 60000; -// For some transports (WebSockets), we need to "validate" the transport by exchanging a few requests and responses. -// If we haven't sent enough requests within 5s, we'll start sending noop ping requests. -var DELAY_BEFORE_SENDING_EXTRA_REQUESTS = 5000; -// If the initial data sent triggers a lot of bandwidth (i.e. it's a large put or a listen for a large amount of data) -// then we may not be able to exchange our ping/pong requests within the healthy timeout. So if we reach the timeout -// but we've sent/received enough bytes, we don't cancel the connection. -var BYTES_SENT_HEALTHY_OVERRIDE = 10 * 1024; -var BYTES_RECEIVED_HEALTHY_OVERRIDE = 100 * 1024; -var MESSAGE_TYPE = 't'; -var MESSAGE_DATA = 'd'; -var CONTROL_SHUTDOWN = 's'; -var CONTROL_RESET = 'r'; -var CONTROL_ERROR = 'e'; -var CONTROL_PONG = 'o'; -var SWITCH_ACK = 'a'; -var END_TRANSMISSION = 'n'; -var PING = 'p'; -var SERVER_HELLO = 'h'; -/** - * Creates a new real-time connection to the server using whichever method works - * best in the current browser. - */ -var Connection = /** @class */ (function () { - /** - * @param id - an id for this connection - * @param repoInfo_ - the info for the endpoint to connect to - * @param applicationId_ - the Firebase App ID for this project - * @param appCheckToken_ - The App Check Token for this device. - * @param authToken_ - The auth token for this session. - * @param onMessage_ - the callback to be triggered when a server-push message arrives - * @param onReady_ - the callback to be triggered when this connection is ready to send messages. - * @param onDisconnect_ - the callback to be triggered when a connection was lost - * @param onKill_ - the callback to be triggered when this connection has permanently shut down. - * @param lastSessionId - last session id in persistent connection. is used to clean up old session in real-time server - */ - function Connection(id, repoInfo_, applicationId_, appCheckToken_, authToken_, onMessage_, onReady_, onDisconnect_, onKill_, lastSessionId) { - this.id = id; - this.repoInfo_ = repoInfo_; - this.applicationId_ = applicationId_; - this.appCheckToken_ = appCheckToken_; - this.authToken_ = authToken_; - this.onMessage_ = onMessage_; - this.onReady_ = onReady_; - this.onDisconnect_ = onDisconnect_; - this.onKill_ = onKill_; - this.lastSessionId = lastSessionId; - this.connectionCount = 0; - this.pendingDataMessages = []; - this.state_ = 0 /* CONNECTING */; - this.log_ = logWrapper('c:' + this.id + ':'); - this.transportManager_ = new TransportManager(repoInfo_); - this.log_('Connection created'); - this.start_(); - } - /** - * Starts a connection attempt - */ - Connection.prototype.start_ = function () { - var _this = this; - var conn = this.transportManager_.initialTransport(); - this.conn_ = new conn(this.nextTransportId_(), this.repoInfo_, this.applicationId_, this.appCheckToken_, this.authToken_, null, this.lastSessionId); - // For certain transports (WebSockets), we need to send and receive several messages back and forth before we - // can consider the transport healthy. - this.primaryResponsesRequired_ = conn['responsesRequiredToBeHealthy'] || 0; - var onMessageReceived = this.connReceiver_(this.conn_); - var onConnectionLost = this.disconnReceiver_(this.conn_); - this.tx_ = this.conn_; - this.rx_ = this.conn_; - this.secondaryConn_ = null; - this.isHealthy_ = false; - /* - * Firefox doesn't like when code from one iframe tries to create another iframe by way of the parent frame. - * This can occur in the case of a redirect, i.e. we guessed wrong on what server to connect to and received a reset. - * Somehow, setTimeout seems to make this ok. That doesn't make sense from a security perspective, since you should - * still have the context of your originating frame. - */ - setTimeout(function () { - // this.conn_ gets set to null in some of the tests. Check to make sure it still exists before using it - _this.conn_ && _this.conn_.open(onMessageReceived, onConnectionLost); - }, Math.floor(0)); - var healthyTimeoutMS = conn['healthyTimeout'] || 0; - if (healthyTimeoutMS > 0) { - this.healthyTimeout_ = setTimeoutNonBlocking(function () { - _this.healthyTimeout_ = null; - if (!_this.isHealthy_) { - if (_this.conn_ && - _this.conn_.bytesReceived > BYTES_RECEIVED_HEALTHY_OVERRIDE) { - _this.log_('Connection exceeded healthy timeout but has received ' + - _this.conn_.bytesReceived + - ' bytes. Marking connection healthy.'); - _this.isHealthy_ = true; - _this.conn_.markConnectionHealthy(); - } - else if (_this.conn_ && - _this.conn_.bytesSent > BYTES_SENT_HEALTHY_OVERRIDE) { - _this.log_('Connection exceeded healthy timeout but has sent ' + - _this.conn_.bytesSent + - ' bytes. Leaving connection alive.'); - // NOTE: We don't want to mark it healthy, since we have no guarantee that the bytes have made it to - // the server. - } - else { - _this.log_('Closing unhealthy connection after timeout.'); - _this.close(); - } - } - // eslint-disable-next-line @typescript-eslint/no-explicit-any - }, Math.floor(healthyTimeoutMS)); - } - }; - Connection.prototype.nextTransportId_ = function () { - return 'c:' + this.id + ':' + this.connectionCount++; - }; - Connection.prototype.disconnReceiver_ = function (conn) { - var _this = this; - return function (everConnected) { - if (conn === _this.conn_) { - _this.onConnectionLost_(everConnected); - } - else if (conn === _this.secondaryConn_) { - _this.log_('Secondary connection lost.'); - _this.onSecondaryConnectionLost_(); - } - else { - _this.log_('closing an old connection'); - } - }; - }; - Connection.prototype.connReceiver_ = function (conn) { - var _this = this; - return function (message) { - if (_this.state_ !== 2 /* DISCONNECTED */) { - if (conn === _this.rx_) { - _this.onPrimaryMessageReceived_(message); - } - else if (conn === _this.secondaryConn_) { - _this.onSecondaryMessageReceived_(message); - } - else { - _this.log_('message on old connection'); - } - } - }; - }; - /** - * @param dataMsg - An arbitrary data message to be sent to the server - */ - Connection.prototype.sendRequest = function (dataMsg) { - // wrap in a data message envelope and send it on - var msg = { t: 'd', d: dataMsg }; - this.sendData_(msg); - }; - Connection.prototype.tryCleanupConnection = function () { - if (this.tx_ === this.secondaryConn_ && this.rx_ === this.secondaryConn_) { - this.log_('cleaning up and promoting a connection: ' + this.secondaryConn_.connId); - this.conn_ = this.secondaryConn_; - this.secondaryConn_ = null; - // the server will shutdown the old connection - } - }; - Connection.prototype.onSecondaryControl_ = function (controlData) { - if (MESSAGE_TYPE in controlData) { - var cmd = controlData[MESSAGE_TYPE]; - if (cmd === SWITCH_ACK) { - this.upgradeIfSecondaryHealthy_(); - } - else if (cmd === CONTROL_RESET) { - // Most likely the session wasn't valid. Abandon the switch attempt - this.log_('Got a reset on secondary, closing it'); - this.secondaryConn_.close(); - // If we were already using this connection for something, than we need to fully close - if (this.tx_ === this.secondaryConn_ || - this.rx_ === this.secondaryConn_) { - this.close(); - } - } - else if (cmd === CONTROL_PONG) { - this.log_('got pong on secondary.'); - this.secondaryResponsesRequired_--; - this.upgradeIfSecondaryHealthy_(); - } - } - }; - Connection.prototype.onSecondaryMessageReceived_ = function (parsedData) { - var layer = requireKey('t', parsedData); - var data = requireKey('d', parsedData); - if (layer === 'c') { - this.onSecondaryControl_(data); - } - else if (layer === 'd') { - // got a data message, but we're still second connection. Need to buffer it up - this.pendingDataMessages.push(data); - } - else { - throw new Error('Unknown protocol layer: ' + layer); - } - }; - Connection.prototype.upgradeIfSecondaryHealthy_ = function () { - if (this.secondaryResponsesRequired_ <= 0) { - this.log_('Secondary connection is healthy.'); - this.isHealthy_ = true; - this.secondaryConn_.markConnectionHealthy(); - this.proceedWithUpgrade_(); - } - else { - // Send a ping to make sure the connection is healthy. - this.log_('sending ping on secondary.'); - this.secondaryConn_.send({ t: 'c', d: { t: PING, d: {} } }); - } - }; - Connection.prototype.proceedWithUpgrade_ = function () { - // tell this connection to consider itself open - this.secondaryConn_.start(); - // send ack - this.log_('sending client ack on secondary'); - this.secondaryConn_.send({ t: 'c', d: { t: SWITCH_ACK, d: {} } }); - // send end packet on primary transport, switch to sending on this one - // can receive on this one, buffer responses until end received on primary transport - this.log_('Ending transmission on primary'); - this.conn_.send({ t: 'c', d: { t: END_TRANSMISSION, d: {} } }); - this.tx_ = this.secondaryConn_; - this.tryCleanupConnection(); - }; - Connection.prototype.onPrimaryMessageReceived_ = function (parsedData) { - // Must refer to parsedData properties in quotes, so closure doesn't touch them. - var layer = requireKey('t', parsedData); - var data = requireKey('d', parsedData); - if (layer === 'c') { - this.onControl_(data); - } - else if (layer === 'd') { - this.onDataMessage_(data); - } - }; - Connection.prototype.onDataMessage_ = function (message) { - this.onPrimaryResponse_(); - // We don't do anything with data messages, just kick them up a level - this.onMessage_(message); - }; - Connection.prototype.onPrimaryResponse_ = function () { - if (!this.isHealthy_) { - this.primaryResponsesRequired_--; - if (this.primaryResponsesRequired_ <= 0) { - this.log_('Primary connection is healthy.'); - this.isHealthy_ = true; - this.conn_.markConnectionHealthy(); - } - } - }; - Connection.prototype.onControl_ = function (controlData) { - var cmd = requireKey(MESSAGE_TYPE, controlData); - if (MESSAGE_DATA in controlData) { - var payload = controlData[MESSAGE_DATA]; - if (cmd === SERVER_HELLO) { - this.onHandshake_(payload); - } - else if (cmd === END_TRANSMISSION) { - this.log_('recvd end transmission on primary'); - this.rx_ = this.secondaryConn_; - for (var i = 0; i < this.pendingDataMessages.length; ++i) { - this.onDataMessage_(this.pendingDataMessages[i]); - } - this.pendingDataMessages = []; - this.tryCleanupConnection(); - } - else if (cmd === CONTROL_SHUTDOWN) { - // This was previously the 'onKill' callback passed to the lower-level connection - // payload in this case is the reason for the shutdown. Generally a human-readable error - this.onConnectionShutdown_(payload); - } - else if (cmd === CONTROL_RESET) { - // payload in this case is the host we should contact - this.onReset_(payload); - } - else if (cmd === CONTROL_ERROR) { - error('Server Error: ' + payload); - } - else if (cmd === CONTROL_PONG) { - this.log_('got pong on primary.'); - this.onPrimaryResponse_(); - this.sendPingOnPrimaryIfNecessary_(); - } - else { - error('Unknown control packet command: ' + cmd); - } - } - }; - /** - * @param handshake - The handshake data returned from the server - */ - Connection.prototype.onHandshake_ = function (handshake) { - var timestamp = handshake.ts; - var version = handshake.v; - var host = handshake.h; - this.sessionId = handshake.s; - this.repoInfo_.host = host; - // if we've already closed the connection, then don't bother trying to progress further - if (this.state_ === 0 /* CONNECTING */) { - this.conn_.start(); - this.onConnectionEstablished_(this.conn_, timestamp); - if (PROTOCOL_VERSION !== version) { - warn('Protocol version mismatch detected'); - } - // TODO: do we want to upgrade? when? maybe a delay? - this.tryStartUpgrade_(); - } - }; - Connection.prototype.tryStartUpgrade_ = function () { - var conn = this.transportManager_.upgradeTransport(); - if (conn) { - this.startUpgrade_(conn); - } - }; - Connection.prototype.startUpgrade_ = function (conn) { - var _this = this; - this.secondaryConn_ = new conn(this.nextTransportId_(), this.repoInfo_, this.applicationId_, this.appCheckToken_, this.authToken_, this.sessionId); - // For certain transports (WebSockets), we need to send and receive several messages back and forth before we - // can consider the transport healthy. - this.secondaryResponsesRequired_ = - conn['responsesRequiredToBeHealthy'] || 0; - var onMessage = this.connReceiver_(this.secondaryConn_); - var onDisconnect = this.disconnReceiver_(this.secondaryConn_); - this.secondaryConn_.open(onMessage, onDisconnect); - // If we haven't successfully upgraded after UPGRADE_TIMEOUT, give up and kill the secondary. - setTimeoutNonBlocking(function () { - if (_this.secondaryConn_) { - _this.log_('Timed out trying to upgrade.'); - _this.secondaryConn_.close(); - } - }, Math.floor(UPGRADE_TIMEOUT)); - }; - Connection.prototype.onReset_ = function (host) { - this.log_('Reset packet received. New host: ' + host); - this.repoInfo_.host = host; - // TODO: if we're already "connected", we need to trigger a disconnect at the next layer up. - // We don't currently support resets after the connection has already been established - if (this.state_ === 1 /* CONNECTED */) { - this.close(); - } - else { - // Close whatever connections we have open and start again. - this.closeConnections_(); - this.start_(); - } - }; - Connection.prototype.onConnectionEstablished_ = function (conn, timestamp) { - var _this = this; - this.log_('Realtime connection established.'); - this.conn_ = conn; - this.state_ = 1 /* CONNECTED */; - if (this.onReady_) { - this.onReady_(timestamp, this.sessionId); - this.onReady_ = null; - } - // If after 5 seconds we haven't sent enough requests to the server to get the connection healthy, - // send some pings. - if (this.primaryResponsesRequired_ === 0) { - this.log_('Primary connection is healthy.'); - this.isHealthy_ = true; - } - else { - setTimeoutNonBlocking(function () { - _this.sendPingOnPrimaryIfNecessary_(); - }, Math.floor(DELAY_BEFORE_SENDING_EXTRA_REQUESTS)); - } - }; - Connection.prototype.sendPingOnPrimaryIfNecessary_ = function () { - // If the connection isn't considered healthy yet, we'll send a noop ping packet request. - if (!this.isHealthy_ && this.state_ === 1 /* CONNECTED */) { - this.log_('sending ping on primary.'); - this.sendData_({ t: 'c', d: { t: PING, d: {} } }); - } - }; - Connection.prototype.onSecondaryConnectionLost_ = function () { - var conn = this.secondaryConn_; - this.secondaryConn_ = null; - if (this.tx_ === conn || this.rx_ === conn) { - // we are relying on this connection already in some capacity. Therefore, a failure is real - this.close(); - } - }; - /** - * @param everConnected - Whether or not the connection ever reached a server. Used to determine if - * we should flush the host cache - */ - Connection.prototype.onConnectionLost_ = function (everConnected) { - this.conn_ = null; - // NOTE: IF you're seeing a Firefox error for this line, I think it might be because it's getting - // called on window close and RealtimeState.CONNECTING is no longer defined. Just a guess. - if (!everConnected && this.state_ === 0 /* CONNECTING */) { - this.log_('Realtime connection failed.'); - // Since we failed to connect at all, clear any cached entry for this namespace in case the machine went away - if (this.repoInfo_.isCacheableHost()) { - PersistentStorage.remove('host:' + this.repoInfo_.host); - // reset the internal host to what we would show the user, i.e. .firebaseio.com - this.repoInfo_.internalHost = this.repoInfo_.host; - } - } - else if (this.state_ === 1 /* CONNECTED */) { - this.log_('Realtime connection lost.'); - } - this.close(); - }; - Connection.prototype.onConnectionShutdown_ = function (reason) { - this.log_('Connection shutdown command received. Shutting down...'); - if (this.onKill_) { - this.onKill_(reason); - this.onKill_ = null; - } - // We intentionally don't want to fire onDisconnect (kill is a different case), - // so clear the callback. - this.onDisconnect_ = null; - this.close(); - }; - Connection.prototype.sendData_ = function (data) { - if (this.state_ !== 1 /* CONNECTED */) { - throw 'Connection is not connected'; - } - else { - this.tx_.send(data); - } - }; - /** - * Cleans up this connection, calling the appropriate callbacks - */ - Connection.prototype.close = function () { - if (this.state_ !== 2 /* DISCONNECTED */) { - this.log_('Closing realtime connection.'); - this.state_ = 2 /* DISCONNECTED */; - this.closeConnections_(); - if (this.onDisconnect_) { - this.onDisconnect_(); - this.onDisconnect_ = null; - } - } - }; - Connection.prototype.closeConnections_ = function () { - this.log_('Shutting down all connections'); - if (this.conn_) { - this.conn_.close(); - this.conn_ = null; - } - if (this.secondaryConn_) { - this.secondaryConn_.close(); - this.secondaryConn_ = null; - } - if (this.healthyTimeout_) { - clearTimeout(this.healthyTimeout_); - this.healthyTimeout_ = null; - } - }; - return Connection; -}()); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Interface defining the set of actions that can be performed against the Firebase server - * (basically corresponds to our wire protocol). - * - * @interface - */ -var ServerActions = /** @class */ (function () { - function ServerActions() { - } - ServerActions.prototype.put = function (pathString, data, onComplete, hash) { }; - ServerActions.prototype.merge = function (pathString, data, onComplete, hash) { }; - /** - * Refreshes the auth token for the current connection. - * @param token - The authentication token - */ - ServerActions.prototype.refreshAuthToken = function (token) { }; - /** - * Refreshes the app check token for the current connection. - * @param token The app check token - */ - ServerActions.prototype.refreshAppCheckToken = function (token) { }; - ServerActions.prototype.onDisconnectPut = function (pathString, data, onComplete) { }; - ServerActions.prototype.onDisconnectMerge = function (pathString, data, onComplete) { }; - ServerActions.prototype.onDisconnectCancel = function (pathString, onComplete) { }; - ServerActions.prototype.reportStats = function (stats) { }; - return ServerActions; -}()); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Base class to be used if you want to emit events. Call the constructor with - * the set of allowed event names. - */ -var EventEmitter = /** @class */ (function () { - function EventEmitter(allowedEvents_) { - this.allowedEvents_ = allowedEvents_; - this.listeners_ = {}; - util.assert(Array.isArray(allowedEvents_) && allowedEvents_.length > 0, 'Requires a non-empty array'); - } - /** - * To be called by derived classes to trigger events. - */ - EventEmitter.prototype.trigger = function (eventType) { - var varArgs = []; - for (var _i = 1; _i < arguments.length; _i++) { - varArgs[_i - 1] = arguments[_i]; - } - if (Array.isArray(this.listeners_[eventType])) { - // Clone the list, since callbacks could add/remove listeners. - var listeners = tslib.__spreadArray([], tslib.__read(this.listeners_[eventType])); - for (var i = 0; i < listeners.length; i++) { - listeners[i].callback.apply(listeners[i].context, varArgs); - } - } - }; - EventEmitter.prototype.on = function (eventType, callback, context) { - this.validateEventType_(eventType); - this.listeners_[eventType] = this.listeners_[eventType] || []; - this.listeners_[eventType].push({ callback: callback, context: context }); - var eventData = this.getInitialEvent(eventType); - if (eventData) { - callback.apply(context, eventData); - } - }; - EventEmitter.prototype.off = function (eventType, callback, context) { - this.validateEventType_(eventType); - var listeners = this.listeners_[eventType] || []; - for (var i = 0; i < listeners.length; i++) { - if (listeners[i].callback === callback && - (!context || context === listeners[i].context)) { - listeners.splice(i, 1); - return; - } - } - }; - EventEmitter.prototype.validateEventType_ = function (eventType) { - util.assert(this.allowedEvents_.find(function (et) { - return et === eventType; - }), 'Unknown event: ' + eventType); - }; - return EventEmitter; -}()); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Monitors online state (as reported by window.online/offline events). - * - * The expectation is that this could have many false positives (thinks we are online - * when we're not), but no false negatives. So we can safely use it to determine when - * we definitely cannot reach the internet. - */ -var OnlineMonitor = /** @class */ (function (_super) { - tslib.__extends(OnlineMonitor, _super); - function OnlineMonitor() { - var _this = _super.call(this, ['online']) || this; - _this.online_ = true; - // We've had repeated complaints that Cordova apps can get stuck "offline", e.g. - // https://forum.ionicframework.com/t/firebase-connection-is-lost-and-never-come-back/43810 - // It would seem that the 'online' event does not always fire consistently. So we disable it - // for Cordova. - if (typeof window !== 'undefined' && - typeof window.addEventListener !== 'undefined' && - !util.isMobileCordova()) { - window.addEventListener('online', function () { - if (!_this.online_) { - _this.online_ = true; - _this.trigger('online', true); - } - }, false); - window.addEventListener('offline', function () { - if (_this.online_) { - _this.online_ = false; - _this.trigger('online', false); - } - }, false); - } - return _this; - } - OnlineMonitor.getInstance = function () { - return new OnlineMonitor(); - }; - OnlineMonitor.prototype.getInitialEvent = function (eventType) { - util.assert(eventType === 'online', 'Unknown event type: ' + eventType); - return [this.online_]; - }; - OnlineMonitor.prototype.currentlyOnline = function () { - return this.online_; - }; - return OnlineMonitor; -}(EventEmitter)); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** Maximum key depth. */ -var MAX_PATH_DEPTH = 32; -/** Maximum number of (UTF8) bytes in a Firebase path. */ -var MAX_PATH_LENGTH_BYTES = 768; -/** - * An immutable object representing a parsed path. It's immutable so that you - * can pass them around to other functions without worrying about them changing - * it. - */ -var Path = /** @class */ (function () { - /** - * @param pathOrString - Path string to parse, or another path, or the raw - * tokens array - */ - function Path(pathOrString, pieceNum) { - if (pieceNum === void 0) { - this.pieces_ = pathOrString.split('/'); - // Remove empty pieces. - var copyTo = 0; - for (var i = 0; i < this.pieces_.length; i++) { - if (this.pieces_[i].length > 0) { - this.pieces_[copyTo] = this.pieces_[i]; - copyTo++; - } - } - this.pieces_.length = copyTo; - this.pieceNum_ = 0; - } - else { - this.pieces_ = pathOrString; - this.pieceNum_ = pieceNum; - } - } - Path.prototype.toString = function () { - var pathString = ''; - for (var i = this.pieceNum_; i < this.pieces_.length; i++) { - if (this.pieces_[i] !== '') { - pathString += '/' + this.pieces_[i]; - } - } - return pathString || '/'; - }; - return Path; -}()); -function newEmptyPath() { - return new Path(''); -} -function pathGetFront(path) { - if (path.pieceNum_ >= path.pieces_.length) { - return null; - } - return path.pieces_[path.pieceNum_]; -} -/** - * @returns The number of segments in this path - */ -function pathGetLength(path) { - return path.pieces_.length - path.pieceNum_; -} -function pathPopFront(path) { - var pieceNum = path.pieceNum_; - if (pieceNum < path.pieces_.length) { - pieceNum++; - } - return new Path(path.pieces_, pieceNum); -} -function pathGetBack(path) { - if (path.pieceNum_ < path.pieces_.length) { - return path.pieces_[path.pieces_.length - 1]; - } - return null; -} -function pathToUrlEncodedString(path) { - var pathString = ''; - for (var i = path.pieceNum_; i < path.pieces_.length; i++) { - if (path.pieces_[i] !== '') { - pathString += '/' + encodeURIComponent(String(path.pieces_[i])); - } - } - return pathString || '/'; -} -/** - * Shallow copy of the parts of the path. - * - */ -function pathSlice(path, begin) { - if (begin === void 0) { begin = 0; } - return path.pieces_.slice(path.pieceNum_ + begin); -} -function pathParent(path) { - if (path.pieceNum_ >= path.pieces_.length) { - return null; - } - var pieces = []; - for (var i = path.pieceNum_; i < path.pieces_.length - 1; i++) { - pieces.push(path.pieces_[i]); - } - return new Path(pieces, 0); -} -function pathChild(path, childPathObj) { - var pieces = []; - for (var i = path.pieceNum_; i < path.pieces_.length; i++) { - pieces.push(path.pieces_[i]); - } - if (childPathObj instanceof Path) { - for (var i = childPathObj.pieceNum_; i < childPathObj.pieces_.length; i++) { - pieces.push(childPathObj.pieces_[i]); - } - } - else { - var childPieces = childPathObj.split('/'); - for (var i = 0; i < childPieces.length; i++) { - if (childPieces[i].length > 0) { - pieces.push(childPieces[i]); - } - } - } - return new Path(pieces, 0); -} -/** - * @returns True if there are no segments in this path - */ -function pathIsEmpty(path) { - return path.pieceNum_ >= path.pieces_.length; -} -/** - * @returns The path from outerPath to innerPath - */ -function newRelativePath(outerPath, innerPath) { - var outer = pathGetFront(outerPath), inner = pathGetFront(innerPath); - if (outer === null) { - return innerPath; - } - else if (outer === inner) { - return newRelativePath(pathPopFront(outerPath), pathPopFront(innerPath)); - } - else { - throw new Error('INTERNAL ERROR: innerPath (' + - innerPath + - ') is not within ' + - 'outerPath (' + - outerPath + - ')'); - } -} -/** - * @returns -1, 0, 1 if left is less, equal, or greater than the right. - */ -function pathCompare(left, right) { - var leftKeys = pathSlice(left, 0); - var rightKeys = pathSlice(right, 0); - for (var i = 0; i < leftKeys.length && i < rightKeys.length; i++) { - var cmp = nameCompare(leftKeys[i], rightKeys[i]); - if (cmp !== 0) { - return cmp; - } - } - if (leftKeys.length === rightKeys.length) { - return 0; - } - return leftKeys.length < rightKeys.length ? -1 : 1; -} -/** - * @returns true if paths are the same. - */ -function pathEquals(path, other) { - if (pathGetLength(path) !== pathGetLength(other)) { - return false; - } - for (var i = path.pieceNum_, j = other.pieceNum_; i <= path.pieces_.length; i++, j++) { - if (path.pieces_[i] !== other.pieces_[j]) { - return false; - } - } - return true; -} -/** - * @returns True if this path is a parent of (or the same as) other - */ -function pathContains(path, other) { - var i = path.pieceNum_; - var j = other.pieceNum_; - if (pathGetLength(path) > pathGetLength(other)) { - return false; - } - while (i < path.pieces_.length) { - if (path.pieces_[i] !== other.pieces_[j]) { - return false; - } - ++i; - ++j; - } - return true; -} -/** - * Dynamic (mutable) path used to count path lengths. - * - * This class is used to efficiently check paths for valid - * length (in UTF8 bytes) and depth (used in path validation). - * - * Throws Error exception if path is ever invalid. - * - * The definition of a path always begins with '/'. - */ -var ValidationPath = /** @class */ (function () { - /** - * @param path - Initial Path. - * @param errorPrefix_ - Prefix for any error messages. - */ - function ValidationPath(path, errorPrefix_) { - this.errorPrefix_ = errorPrefix_; - this.parts_ = pathSlice(path, 0); - /** Initialize to number of '/' chars needed in path. */ - this.byteLength_ = Math.max(1, this.parts_.length); - for (var i = 0; i < this.parts_.length; i++) { - this.byteLength_ += util.stringLength(this.parts_[i]); - } - validationPathCheckValid(this); - } - return ValidationPath; -}()); -function validationPathPush(validationPath, child) { - // Count the needed '/' - if (validationPath.parts_.length > 0) { - validationPath.byteLength_ += 1; - } - validationPath.parts_.push(child); - validationPath.byteLength_ += util.stringLength(child); - validationPathCheckValid(validationPath); -} -function validationPathPop(validationPath) { - var last = validationPath.parts_.pop(); - validationPath.byteLength_ -= util.stringLength(last); - // Un-count the previous '/' - if (validationPath.parts_.length > 0) { - validationPath.byteLength_ -= 1; - } -} -function validationPathCheckValid(validationPath) { - if (validationPath.byteLength_ > MAX_PATH_LENGTH_BYTES) { - throw new Error(validationPath.errorPrefix_ + - 'has a key path longer than ' + - MAX_PATH_LENGTH_BYTES + - ' bytes (' + - validationPath.byteLength_ + - ').'); - } - if (validationPath.parts_.length > MAX_PATH_DEPTH) { - throw new Error(validationPath.errorPrefix_ + - 'path specified exceeds the maximum depth that can be written (' + - MAX_PATH_DEPTH + - ') or object contains a cycle ' + - validationPathToErrorString(validationPath)); - } -} -/** - * String for use in error messages - uses '.' notation for path. - */ -function validationPathToErrorString(validationPath) { - if (validationPath.parts_.length === 0) { - return ''; - } - return "in property '" + validationPath.parts_.join('.') + "'"; -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var VisibilityMonitor = /** @class */ (function (_super) { - tslib.__extends(VisibilityMonitor, _super); - function VisibilityMonitor() { - var _this = _super.call(this, ['visible']) || this; - var hidden; - var visibilityChange; - if (typeof document !== 'undefined' && - typeof document.addEventListener !== 'undefined') { - if (typeof document['hidden'] !== 'undefined') { - // Opera 12.10 and Firefox 18 and later support - visibilityChange = 'visibilitychange'; - hidden = 'hidden'; - } - else if (typeof document['mozHidden'] !== 'undefined') { - visibilityChange = 'mozvisibilitychange'; - hidden = 'mozHidden'; - } - else if (typeof document['msHidden'] !== 'undefined') { - visibilityChange = 'msvisibilitychange'; - hidden = 'msHidden'; - } - else if (typeof document['webkitHidden'] !== 'undefined') { - visibilityChange = 'webkitvisibilitychange'; - hidden = 'webkitHidden'; - } - } - // Initially, we always assume we are visible. This ensures that in browsers - // without page visibility support or in cases where we are never visible - // (e.g. chrome extension), we act as if we are visible, i.e. don't delay - // reconnects - _this.visible_ = true; - if (visibilityChange) { - document.addEventListener(visibilityChange, function () { - var visible = !document[hidden]; - if (visible !== _this.visible_) { - _this.visible_ = visible; - _this.trigger('visible', visible); - } - }, false); - } - return _this; - } - VisibilityMonitor.getInstance = function () { - return new VisibilityMonitor(); - }; - VisibilityMonitor.prototype.getInitialEvent = function (eventType) { - util.assert(eventType === 'visible', 'Unknown event type: ' + eventType); - return [this.visible_]; - }; - return VisibilityMonitor; -}(EventEmitter)); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var RECONNECT_MIN_DELAY = 1000; -var RECONNECT_MAX_DELAY_DEFAULT = 60 * 5 * 1000; // 5 minutes in milliseconds (Case: 1858) -var RECONNECT_MAX_DELAY_FOR_ADMINS = 30 * 1000; // 30 seconds for admin clients (likely to be a backend server) -var RECONNECT_DELAY_MULTIPLIER = 1.3; -var RECONNECT_DELAY_RESET_TIMEOUT = 30000; // Reset delay back to MIN_DELAY after being connected for 30sec. -var SERVER_KILL_INTERRUPT_REASON = 'server_kill'; -// If auth fails repeatedly, we'll assume something is wrong and log a warning / back off. -var INVALID_TOKEN_THRESHOLD = 3; -/** - * Firebase connection. Abstracts wire protocol and handles reconnecting. - * - * NOTE: All JSON objects sent to the realtime connection must have property names enclosed - * in quotes to make sure the closure compiler does not minify them. - */ -var PersistentConnection = /** @class */ (function (_super) { - tslib.__extends(PersistentConnection, _super); - /** - * @param repoInfo_ - Data about the namespace we are connecting to - * @param applicationId_ - The Firebase App ID for this project - * @param onDataUpdate_ - A callback for new data from the server - */ - function PersistentConnection(repoInfo_, applicationId_, onDataUpdate_, onConnectStatus_, onServerInfoUpdate_, authTokenProvider_, appCheckTokenProvider_, authOverride_) { - var _this = _super.call(this) || this; - _this.repoInfo_ = repoInfo_; - _this.applicationId_ = applicationId_; - _this.onDataUpdate_ = onDataUpdate_; - _this.onConnectStatus_ = onConnectStatus_; - _this.onServerInfoUpdate_ = onServerInfoUpdate_; - _this.authTokenProvider_ = authTokenProvider_; - _this.appCheckTokenProvider_ = appCheckTokenProvider_; - _this.authOverride_ = authOverride_; - // Used for diagnostic logging. - _this.id = PersistentConnection.nextPersistentConnectionId_++; - _this.log_ = logWrapper('p:' + _this.id + ':'); - _this.interruptReasons_ = {}; - _this.listens = new Map(); - _this.outstandingPuts_ = []; - _this.outstandingGets_ = []; - _this.outstandingPutCount_ = 0; - _this.outstandingGetCount_ = 0; - _this.onDisconnectRequestQueue_ = []; - _this.connected_ = false; - _this.reconnectDelay_ = RECONNECT_MIN_DELAY; - _this.maxReconnectDelay_ = RECONNECT_MAX_DELAY_DEFAULT; - _this.securityDebugCallback_ = null; - _this.lastSessionId = null; - _this.establishConnectionTimer_ = null; - _this.visible_ = false; - // Before we get connected, we keep a queue of pending messages to send. - _this.requestCBHash_ = {}; - _this.requestNumber_ = 0; - _this.realtime_ = null; - _this.authToken_ = null; - _this.appCheckToken_ = null; - _this.forceTokenRefresh_ = false; - _this.invalidAuthTokenCount_ = 0; - _this.invalidAppCheckTokenCount_ = 0; - _this.firstConnection_ = true; - _this.lastConnectionAttemptTime_ = null; - _this.lastConnectionEstablishedTime_ = null; - if (authOverride_ && !util.isNodeSdk()) { - throw new Error('Auth override specified in options, but not supported on non Node.js platforms'); - } - VisibilityMonitor.getInstance().on('visible', _this.onVisible_, _this); - if (repoInfo_.host.indexOf('fblocal') === -1) { - OnlineMonitor.getInstance().on('online', _this.onOnline_, _this); - } - return _this; - } - PersistentConnection.prototype.sendRequest = function (action, body, onResponse) { - var curReqNum = ++this.requestNumber_; - var msg = { r: curReqNum, a: action, b: body }; - this.log_(util.stringify(msg)); - util.assert(this.connected_, "sendRequest call when we're not connected not allowed."); - this.realtime_.sendRequest(msg); - if (onResponse) { - this.requestCBHash_[curReqNum] = onResponse; - } - }; - PersistentConnection.prototype.get = function (query) { - this.initConnection_(); - var deferred = new util.Deferred(); - var request = { - p: query._path.toString(), - q: query._queryObject - }; - var outstandingGet = { - action: 'g', - request: request, - onComplete: function (message) { - var payload = message['d']; - if (message['s'] === 'ok') { - deferred.resolve(payload); - } - else { - deferred.reject(payload); - } - } - }; - this.outstandingGets_.push(outstandingGet); - this.outstandingGetCount_++; - var index = this.outstandingGets_.length - 1; - if (this.connected_) { - this.sendGet_(index); - } - return deferred.promise; - }; - PersistentConnection.prototype.listen = function (query, currentHashFn, tag, onComplete) { - this.initConnection_(); - var queryId = query._queryIdentifier; - var pathString = query._path.toString(); - this.log_('Listen called for ' + pathString + ' ' + queryId); - if (!this.listens.has(pathString)) { - this.listens.set(pathString, new Map()); - } - util.assert(query._queryParams.isDefault() || !query._queryParams.loadsAllData(), 'listen() called for non-default but complete query'); - util.assert(!this.listens.get(pathString).has(queryId), "listen() called twice for same path/queryId."); - var listenSpec = { - onComplete: onComplete, - hashFn: currentHashFn, - query: query, - tag: tag - }; - this.listens.get(pathString).set(queryId, listenSpec); - if (this.connected_) { - this.sendListen_(listenSpec); - } - }; - PersistentConnection.prototype.sendGet_ = function (index) { - var _this = this; - var get = this.outstandingGets_[index]; - this.sendRequest('g', get.request, function (message) { - delete _this.outstandingGets_[index]; - _this.outstandingGetCount_--; - if (_this.outstandingGetCount_ === 0) { - _this.outstandingGets_ = []; - } - if (get.onComplete) { - get.onComplete(message); - } - }); - }; - PersistentConnection.prototype.sendListen_ = function (listenSpec) { - var _this = this; - var query = listenSpec.query; - var pathString = query._path.toString(); - var queryId = query._queryIdentifier; - this.log_('Listen on ' + pathString + ' for ' + queryId); - var req = { /*path*/ p: pathString }; - var action = 'q'; - // Only bother to send query if it's non-default. - if (listenSpec.tag) { - req['q'] = query._queryObject; - req['t'] = listenSpec.tag; - } - req[ /*hash*/'h'] = listenSpec.hashFn(); - this.sendRequest(action, req, function (message) { - var payload = message[ /*data*/'d']; - var status = message[ /*status*/'s']; - // print warnings in any case... - PersistentConnection.warnOnListenWarnings_(payload, query); - var currentListenSpec = _this.listens.get(pathString) && - _this.listens.get(pathString).get(queryId); - // only trigger actions if the listen hasn't been removed and readded - if (currentListenSpec === listenSpec) { - _this.log_('listen response', message); - if (status !== 'ok') { - _this.removeListen_(pathString, queryId); - } - if (listenSpec.onComplete) { - listenSpec.onComplete(status, payload); - } - } - }); - }; - PersistentConnection.warnOnListenWarnings_ = function (payload, query) { - if (payload && typeof payload === 'object' && util.contains(payload, 'w')) { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - var warnings = util.safeGet(payload, 'w'); - if (Array.isArray(warnings) && ~warnings.indexOf('no_index')) { - var indexSpec = '".indexOn": "' + query._queryParams.getIndex().toString() + '"'; - var indexPath = query._path.toString(); - warn("Using an unspecified index. Your data will be downloaded and " + - ("filtered on the client. Consider adding " + indexSpec + " at ") + - (indexPath + " to your security rules for better performance.")); - } - } - }; - PersistentConnection.prototype.refreshAuthToken = function (token) { - this.authToken_ = token; - this.log_('Auth token refreshed'); - if (this.authToken_) { - this.tryAuth(); - } - else { - //If we're connected we want to let the server know to unauthenticate us. If we're not connected, simply delete - //the credential so we dont become authenticated next time we connect. - if (this.connected_) { - this.sendRequest('unauth', {}, function () { }); - } - } - this.reduceReconnectDelayIfAdminCredential_(token); - }; - PersistentConnection.prototype.reduceReconnectDelayIfAdminCredential_ = function (credential) { - // NOTE: This isn't intended to be bulletproof (a malicious developer can always just modify the client). - // Additionally, we don't bother resetting the max delay back to the default if auth fails / expires. - var isFirebaseSecret = credential && credential.length === 40; - if (isFirebaseSecret || util.isAdmin(credential)) { - this.log_('Admin auth credential detected. Reducing max reconnect time.'); - this.maxReconnectDelay_ = RECONNECT_MAX_DELAY_FOR_ADMINS; - } - }; - PersistentConnection.prototype.refreshAppCheckToken = function (token) { - this.appCheckToken_ = token; - this.log_('App check token refreshed'); - if (this.appCheckToken_) { - this.tryAppCheck(); - } - else { - //If we're connected we want to let the server know to unauthenticate us. - //If we're not connected, simply delete the credential so we dont become - // authenticated next time we connect. - if (this.connected_) { - this.sendRequest('unappeck', {}, function () { }); - } - } - }; - /** - * Attempts to authenticate with the given credentials. If the authentication attempt fails, it's triggered like - * a auth revoked (the connection is closed). - */ - PersistentConnection.prototype.tryAuth = function () { - var _this = this; - if (this.connected_ && this.authToken_) { - var token_1 = this.authToken_; - var authMethod = util.isValidFormat(token_1) ? 'auth' : 'gauth'; - var requestData = { cred: token_1 }; - if (this.authOverride_ === null) { - requestData['noauth'] = true; - } - else if (typeof this.authOverride_ === 'object') { - requestData['authvar'] = this.authOverride_; - } - this.sendRequest(authMethod, requestData, function (res) { - var status = res[ /*status*/'s']; - var data = res[ /*data*/'d'] || 'error'; - if (_this.authToken_ === token_1) { - if (status === 'ok') { - _this.invalidAuthTokenCount_ = 0; - } - else { - // Triggers reconnect and force refresh for auth token - _this.onAuthRevoked_(status, data); - } - } - }); - } - }; - /** - * Attempts to authenticate with the given token. If the authentication - * attempt fails, it's triggered like the token was revoked (the connection is - * closed). - */ - PersistentConnection.prototype.tryAppCheck = function () { - var _this = this; - if (this.connected_ && this.appCheckToken_) { - this.sendRequest('appcheck', { 'token': this.appCheckToken_ }, function (res) { - var status = res[ /*status*/'s']; - var data = res[ /*data*/'d'] || 'error'; - if (status === 'ok') { - _this.invalidAppCheckTokenCount_ = 0; - } - else { - _this.onAppCheckRevoked_(status, data); - } - }); - } - }; - /** - * @inheritDoc - */ - PersistentConnection.prototype.unlisten = function (query, tag) { - var pathString = query._path.toString(); - var queryId = query._queryIdentifier; - this.log_('Unlisten called for ' + pathString + ' ' + queryId); - util.assert(query._queryParams.isDefault() || !query._queryParams.loadsAllData(), 'unlisten() called for non-default but complete query'); - var listen = this.removeListen_(pathString, queryId); - if (listen && this.connected_) { - this.sendUnlisten_(pathString, queryId, query._queryObject, tag); - } - }; - PersistentConnection.prototype.sendUnlisten_ = function (pathString, queryId, queryObj, tag) { - this.log_('Unlisten on ' + pathString + ' for ' + queryId); - var req = { /*path*/ p: pathString }; - var action = 'n'; - // Only bother sending queryId if it's non-default. - if (tag) { - req['q'] = queryObj; - req['t'] = tag; - } - this.sendRequest(action, req); - }; - PersistentConnection.prototype.onDisconnectPut = function (pathString, data, onComplete) { - this.initConnection_(); - if (this.connected_) { - this.sendOnDisconnect_('o', pathString, data, onComplete); - } - else { - this.onDisconnectRequestQueue_.push({ - pathString: pathString, - action: 'o', - data: data, - onComplete: onComplete - }); - } - }; - PersistentConnection.prototype.onDisconnectMerge = function (pathString, data, onComplete) { - this.initConnection_(); - if (this.connected_) { - this.sendOnDisconnect_('om', pathString, data, onComplete); - } - else { - this.onDisconnectRequestQueue_.push({ - pathString: pathString, - action: 'om', - data: data, - onComplete: onComplete - }); - } - }; - PersistentConnection.prototype.onDisconnectCancel = function (pathString, onComplete) { - this.initConnection_(); - if (this.connected_) { - this.sendOnDisconnect_('oc', pathString, null, onComplete); - } - else { - this.onDisconnectRequestQueue_.push({ - pathString: pathString, - action: 'oc', - data: null, - onComplete: onComplete - }); - } - }; - PersistentConnection.prototype.sendOnDisconnect_ = function (action, pathString, data, onComplete) { - var request = { /*path*/ p: pathString, /*data*/ d: data }; - this.log_('onDisconnect ' + action, request); - this.sendRequest(action, request, function (response) { - if (onComplete) { - setTimeout(function () { - onComplete(response[ /*status*/'s'], response[ /* data */'d']); - }, Math.floor(0)); - } - }); - }; - PersistentConnection.prototype.put = function (pathString, data, onComplete, hash) { - this.putInternal('p', pathString, data, onComplete, hash); - }; - PersistentConnection.prototype.merge = function (pathString, data, onComplete, hash) { - this.putInternal('m', pathString, data, onComplete, hash); - }; - PersistentConnection.prototype.putInternal = function (action, pathString, data, onComplete, hash) { - this.initConnection_(); - var request = { - /*path*/ p: pathString, - /*data*/ d: data - }; - if (hash !== undefined) { - request[ /*hash*/'h'] = hash; - } - // TODO: Only keep track of the most recent put for a given path? - this.outstandingPuts_.push({ - action: action, - request: request, - onComplete: onComplete - }); - this.outstandingPutCount_++; - var index = this.outstandingPuts_.length - 1; - if (this.connected_) { - this.sendPut_(index); - } - else { - this.log_('Buffering put: ' + pathString); - } - }; - PersistentConnection.prototype.sendPut_ = function (index) { - var _this = this; - var action = this.outstandingPuts_[index].action; - var request = this.outstandingPuts_[index].request; - var onComplete = this.outstandingPuts_[index].onComplete; - this.outstandingPuts_[index].queued = this.connected_; - this.sendRequest(action, request, function (message) { - _this.log_(action + ' response', message); - delete _this.outstandingPuts_[index]; - _this.outstandingPutCount_--; - // Clean up array occasionally. - if (_this.outstandingPutCount_ === 0) { - _this.outstandingPuts_ = []; - } - if (onComplete) { - onComplete(message[ /*status*/'s'], message[ /* data */'d']); - } - }); - }; - PersistentConnection.prototype.reportStats = function (stats) { - var _this = this; - // If we're not connected, we just drop the stats. - if (this.connected_) { - var request = { /*counters*/ c: stats }; - this.log_('reportStats', request); - this.sendRequest(/*stats*/ 's', request, function (result) { - var status = result[ /*status*/'s']; - if (status !== 'ok') { - var errorReason = result[ /* data */'d']; - _this.log_('reportStats', 'Error sending stats: ' + errorReason); - } - }); - } - }; - PersistentConnection.prototype.onDataMessage_ = function (message) { - if ('r' in message) { - // this is a response - this.log_('from server: ' + util.stringify(message)); - var reqNum = message['r']; - var onResponse = this.requestCBHash_[reqNum]; - if (onResponse) { - delete this.requestCBHash_[reqNum]; - onResponse(message[ /*body*/'b']); - } - } - else if ('error' in message) { - throw 'A server-side error has occurred: ' + message['error']; - } - else if ('a' in message) { - // a and b are action and body, respectively - this.onDataPush_(message['a'], message['b']); - } - }; - PersistentConnection.prototype.onDataPush_ = function (action, body) { - this.log_('handleServerMessage', action, body); - if (action === 'd') { - this.onDataUpdate_(body[ /*path*/'p'], body[ /*data*/'d'], - /*isMerge*/ false, body['t']); - } - else if (action === 'm') { - this.onDataUpdate_(body[ /*path*/'p'], body[ /*data*/'d'], - /*isMerge=*/ true, body['t']); - } - else if (action === 'c') { - this.onListenRevoked_(body[ /*path*/'p'], body[ /*query*/'q']); - } - else if (action === 'ac') { - this.onAuthRevoked_(body[ /*status code*/'s'], body[ /* explanation */'d']); - } - else if (action === 'apc') { - this.onAppCheckRevoked_(body[ /*status code*/'s'], body[ /* explanation */'d']); - } - else if (action === 'sd') { - this.onSecurityDebugPacket_(body); - } - else { - error('Unrecognized action received from server: ' + - util.stringify(action) + - '\nAre you using the latest client?'); - } - }; - PersistentConnection.prototype.onReady_ = function (timestamp, sessionId) { - this.log_('connection ready'); - this.connected_ = true; - this.lastConnectionEstablishedTime_ = new Date().getTime(); - this.handleTimestamp_(timestamp); - this.lastSessionId = sessionId; - if (this.firstConnection_) { - this.sendConnectStats_(); - } - this.restoreState_(); - this.firstConnection_ = false; - this.onConnectStatus_(true); - }; - PersistentConnection.prototype.scheduleConnect_ = function (timeout) { - var _this = this; - util.assert(!this.realtime_, "Scheduling a connect when we're already connected/ing?"); - if (this.establishConnectionTimer_) { - clearTimeout(this.establishConnectionTimer_); - } - // NOTE: Even when timeout is 0, it's important to do a setTimeout to work around an infuriating "Security Error" in - // Firefox when trying to write to our long-polling iframe in some scenarios (e.g. Forge or our unit tests). - this.establishConnectionTimer_ = setTimeout(function () { - _this.establishConnectionTimer_ = null; - _this.establishConnection_(); - // eslint-disable-next-line @typescript-eslint/no-explicit-any - }, Math.floor(timeout)); - }; - PersistentConnection.prototype.initConnection_ = function () { - if (!this.realtime_ && this.firstConnection_) { - this.scheduleConnect_(0); - } - }; - PersistentConnection.prototype.onVisible_ = function (visible) { - // NOTE: Tabbing away and back to a window will defeat our reconnect backoff, but I think that's fine. - if (visible && - !this.visible_ && - this.reconnectDelay_ === this.maxReconnectDelay_) { - this.log_('Window became visible. Reducing delay.'); - this.reconnectDelay_ = RECONNECT_MIN_DELAY; - if (!this.realtime_) { - this.scheduleConnect_(0); - } - } - this.visible_ = visible; - }; - PersistentConnection.prototype.onOnline_ = function (online) { - if (online) { - this.log_('Browser went online.'); - this.reconnectDelay_ = RECONNECT_MIN_DELAY; - if (!this.realtime_) { - this.scheduleConnect_(0); - } - } - else { - this.log_('Browser went offline. Killing connection.'); - if (this.realtime_) { - this.realtime_.close(); - } - } - }; - PersistentConnection.prototype.onRealtimeDisconnect_ = function () { - this.log_('data client disconnected'); - this.connected_ = false; - this.realtime_ = null; - // Since we don't know if our sent transactions succeeded or not, we need to cancel them. - this.cancelSentTransactions_(); - // Clear out the pending requests. - this.requestCBHash_ = {}; - if (this.shouldReconnect_()) { - if (!this.visible_) { - this.log_("Window isn't visible. Delaying reconnect."); - this.reconnectDelay_ = this.maxReconnectDelay_; - this.lastConnectionAttemptTime_ = new Date().getTime(); - } - else if (this.lastConnectionEstablishedTime_) { - // If we've been connected long enough, reset reconnect delay to minimum. - var timeSinceLastConnectSucceeded = new Date().getTime() - this.lastConnectionEstablishedTime_; - if (timeSinceLastConnectSucceeded > RECONNECT_DELAY_RESET_TIMEOUT) { - this.reconnectDelay_ = RECONNECT_MIN_DELAY; - } - this.lastConnectionEstablishedTime_ = null; - } - var timeSinceLastConnectAttempt = new Date().getTime() - this.lastConnectionAttemptTime_; - var reconnectDelay = Math.max(0, this.reconnectDelay_ - timeSinceLastConnectAttempt); - reconnectDelay = Math.random() * reconnectDelay; - this.log_('Trying to reconnect in ' + reconnectDelay + 'ms'); - this.scheduleConnect_(reconnectDelay); - // Adjust reconnect delay for next time. - this.reconnectDelay_ = Math.min(this.maxReconnectDelay_, this.reconnectDelay_ * RECONNECT_DELAY_MULTIPLIER); - } - this.onConnectStatus_(false); - }; - PersistentConnection.prototype.establishConnection_ = function () { - return tslib.__awaiter(this, void 0, void 0, function () { - var onDataMessage, onReady, onDisconnect_1, connId, lastSessionId, canceled_1, connection_1, closeFn, sendRequestFn, forceRefresh, _a, authToken, appCheckToken, error_1; - var _this = this; - return tslib.__generator(this, function (_b) { - switch (_b.label) { - case 0: - if (!this.shouldReconnect_()) return [3 /*break*/, 4]; - this.log_('Making a connection attempt'); - this.lastConnectionAttemptTime_ = new Date().getTime(); - this.lastConnectionEstablishedTime_ = null; - onDataMessage = this.onDataMessage_.bind(this); - onReady = this.onReady_.bind(this); - onDisconnect_1 = this.onRealtimeDisconnect_.bind(this); - connId = this.id + ':' + PersistentConnection.nextConnectionId_++; - lastSessionId = this.lastSessionId; - canceled_1 = false; - connection_1 = null; - closeFn = function () { - if (connection_1) { - connection_1.close(); - } - else { - canceled_1 = true; - onDisconnect_1(); - } - }; - sendRequestFn = function (msg) { - util.assert(connection_1, "sendRequest call when we're not connected not allowed."); - connection_1.sendRequest(msg); - }; - this.realtime_ = { - close: closeFn, - sendRequest: sendRequestFn - }; - forceRefresh = this.forceTokenRefresh_; - this.forceTokenRefresh_ = false; - _b.label = 1; - case 1: - _b.trys.push([1, 3, , 4]); - return [4 /*yield*/, Promise.all([ - this.authTokenProvider_.getToken(forceRefresh), - this.appCheckTokenProvider_.getToken(forceRefresh) - ])]; - case 2: - _a = tslib.__read.apply(void 0, [_b.sent(), 2]), authToken = _a[0], appCheckToken = _a[1]; - if (!canceled_1) { - log('getToken() completed. Creating connection.'); - this.authToken_ = authToken && authToken.accessToken; - this.appCheckToken_ = appCheckToken && appCheckToken.token; - connection_1 = new Connection(connId, this.repoInfo_, this.applicationId_, this.appCheckToken_, this.authToken_, onDataMessage, onReady, onDisconnect_1, - /* onKill= */ function (reason) { - warn(reason + ' (' + _this.repoInfo_.toString() + ')'); - _this.interrupt(SERVER_KILL_INTERRUPT_REASON); - }, lastSessionId); - } - else { - log('getToken() completed but was canceled'); - } - return [3 /*break*/, 4]; - case 3: - error_1 = _b.sent(); - this.log_('Failed to get token: ' + error_1); - if (!canceled_1) { - if (this.repoInfo_.nodeAdmin) { - // This may be a critical error for the Admin Node.js SDK, so log a warning. - // But getToken() may also just have temporarily failed, so we still want to - // continue retrying. - warn(error_1); - } - closeFn(); - } - return [3 /*break*/, 4]; - case 4: return [2 /*return*/]; - } - }); - }); - }; - PersistentConnection.prototype.interrupt = function (reason) { - log('Interrupting connection for reason: ' + reason); - this.interruptReasons_[reason] = true; - if (this.realtime_) { - this.realtime_.close(); - } - else { - if (this.establishConnectionTimer_) { - clearTimeout(this.establishConnectionTimer_); - this.establishConnectionTimer_ = null; - } - if (this.connected_) { - this.onRealtimeDisconnect_(); - } - } - }; - PersistentConnection.prototype.resume = function (reason) { - log('Resuming connection for reason: ' + reason); - delete this.interruptReasons_[reason]; - if (util.isEmpty(this.interruptReasons_)) { - this.reconnectDelay_ = RECONNECT_MIN_DELAY; - if (!this.realtime_) { - this.scheduleConnect_(0); - } - } - }; - PersistentConnection.prototype.handleTimestamp_ = function (timestamp) { - var delta = timestamp - new Date().getTime(); - this.onServerInfoUpdate_({ serverTimeOffset: delta }); - }; - PersistentConnection.prototype.cancelSentTransactions_ = function () { - for (var i = 0; i < this.outstandingPuts_.length; i++) { - var put = this.outstandingPuts_[i]; - if (put && /*hash*/ 'h' in put.request && put.queued) { - if (put.onComplete) { - put.onComplete('disconnect'); - } - delete this.outstandingPuts_[i]; - this.outstandingPutCount_--; - } - } - // Clean up array occasionally. - if (this.outstandingPutCount_ === 0) { - this.outstandingPuts_ = []; - } - }; - PersistentConnection.prototype.onListenRevoked_ = function (pathString, query) { - // Remove the listen and manufacture a "permission_denied" error for the failed listen. - var queryId; - if (!query) { - queryId = 'default'; - } - else { - queryId = query.map(function (q) { return ObjectToUniqueKey(q); }).join('$'); - } - var listen = this.removeListen_(pathString, queryId); - if (listen && listen.onComplete) { - listen.onComplete('permission_denied'); - } - }; - PersistentConnection.prototype.removeListen_ = function (pathString, queryId) { - var normalizedPathString = new Path(pathString).toString(); // normalize path. - var listen; - if (this.listens.has(normalizedPathString)) { - var map = this.listens.get(normalizedPathString); - listen = map.get(queryId); - map.delete(queryId); - if (map.size === 0) { - this.listens.delete(normalizedPathString); - } - } - else { - // all listens for this path has already been removed - listen = undefined; - } - return listen; - }; - PersistentConnection.prototype.onAuthRevoked_ = function (statusCode, explanation) { - log('Auth token revoked: ' + statusCode + '/' + explanation); - this.authToken_ = null; - this.forceTokenRefresh_ = true; - this.realtime_.close(); - if (statusCode === 'invalid_token' || statusCode === 'permission_denied') { - // We'll wait a couple times before logging the warning / increasing the - // retry period since oauth tokens will report as "invalid" if they're - // just expired. Plus there may be transient issues that resolve themselves. - this.invalidAuthTokenCount_++; - if (this.invalidAuthTokenCount_ >= INVALID_TOKEN_THRESHOLD) { - // Set a long reconnect delay because recovery is unlikely - this.reconnectDelay_ = RECONNECT_MAX_DELAY_FOR_ADMINS; - // Notify the auth token provider that the token is invalid, which will log - // a warning - this.authTokenProvider_.notifyForInvalidToken(); - } - } - }; - PersistentConnection.prototype.onAppCheckRevoked_ = function (statusCode, explanation) { - log('App check token revoked: ' + statusCode + '/' + explanation); - this.appCheckToken_ = null; - this.forceTokenRefresh_ = true; - // Note: We don't close the connection as the developer may not have - // enforcement enabled. The backend closes connections with enforcements. - if (statusCode === 'invalid_token' || statusCode === 'permission_denied') { - // We'll wait a couple times before logging the warning / increasing the - // retry period since oauth tokens will report as "invalid" if they're - // just expired. Plus there may be transient issues that resolve themselves. - this.invalidAppCheckTokenCount_++; - if (this.invalidAppCheckTokenCount_ >= INVALID_TOKEN_THRESHOLD) { - this.appCheckTokenProvider_.notifyForInvalidToken(); - } - } - }; - PersistentConnection.prototype.onSecurityDebugPacket_ = function (body) { - if (this.securityDebugCallback_) { - this.securityDebugCallback_(body); - } - else { - if ('msg' in body) { - console.log('FIREBASE: ' + body['msg'].replace('\n', '\nFIREBASE: ')); - } - } - }; - PersistentConnection.prototype.restoreState_ = function () { - var e_1, _a, e_2, _b; - //Re-authenticate ourselves if we have a credential stored. - this.tryAuth(); - this.tryAppCheck(); - try { - // Puts depend on having received the corresponding data update from the server before they complete, so we must - // make sure to send listens before puts. - for (var _c = tslib.__values(this.listens.values()), _d = _c.next(); !_d.done; _d = _c.next()) { - var queries = _d.value; - try { - for (var _e = (e_2 = void 0, tslib.__values(queries.values())), _f = _e.next(); !_f.done; _f = _e.next()) { - var listenSpec = _f.value; - this.sendListen_(listenSpec); - } - } - catch (e_2_1) { e_2 = { error: e_2_1 }; } - finally { - try { - if (_f && !_f.done && (_b = _e.return)) _b.call(_e); - } - finally { if (e_2) throw e_2.error; } - } - } - } - catch (e_1_1) { e_1 = { error: e_1_1 }; } - finally { - try { - if (_d && !_d.done && (_a = _c.return)) _a.call(_c); - } - finally { if (e_1) throw e_1.error; } - } - for (var i = 0; i < this.outstandingPuts_.length; i++) { - if (this.outstandingPuts_[i]) { - this.sendPut_(i); - } - } - while (this.onDisconnectRequestQueue_.length) { - var request = this.onDisconnectRequestQueue_.shift(); - this.sendOnDisconnect_(request.action, request.pathString, request.data, request.onComplete); - } - for (var i = 0; i < this.outstandingGets_.length; i++) { - if (this.outstandingGets_[i]) { - this.sendGet_(i); - } - } - }; - /** - * Sends client stats for first connection - */ - PersistentConnection.prototype.sendConnectStats_ = function () { - var stats = {}; - var clientName = 'js'; - if (util.isNodeSdk()) { - if (this.repoInfo_.nodeAdmin) { - clientName = 'admin_node'; - } - else { - clientName = 'node'; - } - } - stats['sdk.' + clientName + '.' + SDK_VERSION.replace(/\./g, '-')] = 1; - if (util.isMobileCordova()) { - stats['framework.cordova'] = 1; - } - else if (util.isReactNative()) { - stats['framework.reactnative'] = 1; - } - this.reportStats(stats); - }; - PersistentConnection.prototype.shouldReconnect_ = function () { - var online = OnlineMonitor.getInstance().currentlyOnline(); - return util.isEmpty(this.interruptReasons_) && online; - }; - PersistentConnection.nextPersistentConnectionId_ = 0; - /** - * Counter for number of connections created. Mainly used for tagging in the logs - */ - PersistentConnection.nextConnectionId_ = 0; - return PersistentConnection; -}(ServerActions)); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var NamedNode = /** @class */ (function () { - function NamedNode(name, node) { - this.name = name; - this.node = node; - } - NamedNode.Wrap = function (name, node) { - return new NamedNode(name, node); - }; - return NamedNode; -}()); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var Index = /** @class */ (function () { - function Index() { - } - /** - * @returns A standalone comparison function for - * this index - */ - Index.prototype.getCompare = function () { - return this.compare.bind(this); - }; - /** - * Given a before and after value for a node, determine if the indexed value has changed. Even if they are different, - * it's possible that the changes are isolated to parts of the snapshot that are not indexed. - * - * - * @returns True if the portion of the snapshot being indexed changed between oldNode and newNode - */ - Index.prototype.indexedValueChanged = function (oldNode, newNode) { - var oldWrapped = new NamedNode(MIN_NAME, oldNode); - var newWrapped = new NamedNode(MIN_NAME, newNode); - return this.compare(oldWrapped, newWrapped) !== 0; - }; - /** - * @returns a node wrapper that will sort equal to or less than - * any other node wrapper, using this index - */ - Index.prototype.minPost = function () { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - return NamedNode.MIN; - }; - return Index; -}()); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var __EMPTY_NODE; -var KeyIndex = /** @class */ (function (_super) { - tslib.__extends(KeyIndex, _super); - function KeyIndex() { - return _super !== null && _super.apply(this, arguments) || this; - } - Object.defineProperty(KeyIndex, "__EMPTY_NODE", { - get: function () { - return __EMPTY_NODE; - }, - set: function (val) { - __EMPTY_NODE = val; - }, - enumerable: false, - configurable: true - }); - KeyIndex.prototype.compare = function (a, b) { - return nameCompare(a.name, b.name); - }; - KeyIndex.prototype.isDefinedOn = function (node) { - // We could probably return true here (since every node has a key), but it's never called - // so just leaving unimplemented for now. - throw util.assertionError('KeyIndex.isDefinedOn not expected to be called.'); - }; - KeyIndex.prototype.indexedValueChanged = function (oldNode, newNode) { - return false; // The key for a node never changes. - }; - KeyIndex.prototype.minPost = function () { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - return NamedNode.MIN; - }; - KeyIndex.prototype.maxPost = function () { - // TODO: This should really be created once and cached in a static property, but - // NamedNode isn't defined yet, so I can't use it in a static. Bleh. - return new NamedNode(MAX_NAME, __EMPTY_NODE); - }; - KeyIndex.prototype.makePost = function (indexValue, name) { - util.assert(typeof indexValue === 'string', 'KeyIndex indexValue must always be a string.'); - // We just use empty node, but it'll never be compared, since our comparator only looks at name. - return new NamedNode(indexValue, __EMPTY_NODE); - }; - /** - * @returns String representation for inclusion in a query spec - */ - KeyIndex.prototype.toString = function () { - return '.key'; - }; - return KeyIndex; -}(Index)); -var KEY_INDEX = new KeyIndex(); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * An iterator over an LLRBNode. - */ -var SortedMapIterator = /** @class */ (function () { - /** - * @param node - Node to iterate. - * @param isReverse_ - Whether or not to iterate in reverse - */ - function SortedMapIterator(node, startKey, comparator, isReverse_, resultGenerator_) { - if (resultGenerator_ === void 0) { resultGenerator_ = null; } - this.isReverse_ = isReverse_; - this.resultGenerator_ = resultGenerator_; - this.nodeStack_ = []; - var cmp = 1; - while (!node.isEmpty()) { - node = node; - cmp = startKey ? comparator(node.key, startKey) : 1; - // flip the comparison if we're going in reverse - if (isReverse_) { - cmp *= -1; - } - if (cmp < 0) { - // This node is less than our start key. ignore it - if (this.isReverse_) { - node = node.left; - } - else { - node = node.right; - } - } - else if (cmp === 0) { - // This node is exactly equal to our start key. Push it on the stack, but stop iterating; - this.nodeStack_.push(node); - break; - } - else { - // This node is greater than our start key, add it to the stack and move to the next one - this.nodeStack_.push(node); - if (this.isReverse_) { - node = node.right; - } - else { - node = node.left; - } - } - } - } - SortedMapIterator.prototype.getNext = function () { - if (this.nodeStack_.length === 0) { - return null; - } - var node = this.nodeStack_.pop(); - var result; - if (this.resultGenerator_) { - result = this.resultGenerator_(node.key, node.value); - } - else { - result = { key: node.key, value: node.value }; - } - if (this.isReverse_) { - node = node.left; - while (!node.isEmpty()) { - this.nodeStack_.push(node); - node = node.right; - } - } - else { - node = node.right; - while (!node.isEmpty()) { - this.nodeStack_.push(node); - node = node.left; - } - } - return result; - }; - SortedMapIterator.prototype.hasNext = function () { - return this.nodeStack_.length > 0; - }; - SortedMapIterator.prototype.peek = function () { - if (this.nodeStack_.length === 0) { - return null; - } - var node = this.nodeStack_[this.nodeStack_.length - 1]; - if (this.resultGenerator_) { - return this.resultGenerator_(node.key, node.value); - } - else { - return { key: node.key, value: node.value }; - } - }; - return SortedMapIterator; -}()); -/** - * Represents a node in a Left-leaning Red-Black tree. - */ -var LLRBNode = /** @class */ (function () { - /** - * @param key - Key associated with this node. - * @param value - Value associated with this node. - * @param color - Whether this node is red. - * @param left - Left child. - * @param right - Right child. - */ - function LLRBNode(key, value, color, left, right) { - this.key = key; - this.value = value; - this.color = color != null ? color : LLRBNode.RED; - this.left = - left != null ? left : SortedMap.EMPTY_NODE; - this.right = - right != null ? right : SortedMap.EMPTY_NODE; - } - /** - * Returns a copy of the current node, optionally replacing pieces of it. - * - * @param key - New key for the node, or null. - * @param value - New value for the node, or null. - * @param color - New color for the node, or null. - * @param left - New left child for the node, or null. - * @param right - New right child for the node, or null. - * @returns The node copy. - */ - LLRBNode.prototype.copy = function (key, value, color, left, right) { - return new LLRBNode(key != null ? key : this.key, value != null ? value : this.value, color != null ? color : this.color, left != null ? left : this.left, right != null ? right : this.right); - }; - /** - * @returns The total number of nodes in the tree. - */ - LLRBNode.prototype.count = function () { - return this.left.count() + 1 + this.right.count(); - }; - /** - * @returns True if the tree is empty. - */ - LLRBNode.prototype.isEmpty = function () { - return false; - }; - /** - * Traverses the tree in key order and calls the specified action function - * for each node. - * - * @param action - Callback function to be called for each - * node. If it returns true, traversal is aborted. - * @returns The first truthy value returned by action, or the last falsey - * value returned by action - */ - LLRBNode.prototype.inorderTraversal = function (action) { - return (this.left.inorderTraversal(action) || - !!action(this.key, this.value) || - this.right.inorderTraversal(action)); - }; - /** - * Traverses the tree in reverse key order and calls the specified action function - * for each node. - * - * @param action - Callback function to be called for each - * node. If it returns true, traversal is aborted. - * @returns True if traversal was aborted. - */ - LLRBNode.prototype.reverseTraversal = function (action) { - return (this.right.reverseTraversal(action) || - action(this.key, this.value) || - this.left.reverseTraversal(action)); - }; - /** - * @returns The minimum node in the tree. - */ - LLRBNode.prototype.min_ = function () { - if (this.left.isEmpty()) { - return this; - } - else { - return this.left.min_(); - } - }; - /** - * @returns The maximum key in the tree. - */ - LLRBNode.prototype.minKey = function () { - return this.min_().key; - }; - /** - * @returns The maximum key in the tree. - */ - LLRBNode.prototype.maxKey = function () { - if (this.right.isEmpty()) { - return this.key; - } - else { - return this.right.maxKey(); - } - }; - /** - * @param key - Key to insert. - * @param value - Value to insert. - * @param comparator - Comparator. - * @returns New tree, with the key/value added. - */ - LLRBNode.prototype.insert = function (key, value, comparator) { - var n = this; - var cmp = comparator(key, n.key); - if (cmp < 0) { - n = n.copy(null, null, null, n.left.insert(key, value, comparator), null); - } - else if (cmp === 0) { - n = n.copy(null, value, null, null, null); - } - else { - n = n.copy(null, null, null, null, n.right.insert(key, value, comparator)); - } - return n.fixUp_(); - }; - /** - * @returns New tree, with the minimum key removed. - */ - LLRBNode.prototype.removeMin_ = function () { - if (this.left.isEmpty()) { - return SortedMap.EMPTY_NODE; - } - var n = this; - if (!n.left.isRed_() && !n.left.left.isRed_()) { - n = n.moveRedLeft_(); - } - n = n.copy(null, null, null, n.left.removeMin_(), null); - return n.fixUp_(); - }; - /** - * @param key - The key of the item to remove. - * @param comparator - Comparator. - * @returns New tree, with the specified item removed. - */ - LLRBNode.prototype.remove = function (key, comparator) { - var n, smallest; - n = this; - if (comparator(key, n.key) < 0) { - if (!n.left.isEmpty() && !n.left.isRed_() && !n.left.left.isRed_()) { - n = n.moveRedLeft_(); - } - n = n.copy(null, null, null, n.left.remove(key, comparator), null); - } - else { - if (n.left.isRed_()) { - n = n.rotateRight_(); - } - if (!n.right.isEmpty() && !n.right.isRed_() && !n.right.left.isRed_()) { - n = n.moveRedRight_(); - } - if (comparator(key, n.key) === 0) { - if (n.right.isEmpty()) { - return SortedMap.EMPTY_NODE; - } - else { - smallest = n.right.min_(); - n = n.copy(smallest.key, smallest.value, null, null, n.right.removeMin_()); - } - } - n = n.copy(null, null, null, null, n.right.remove(key, comparator)); - } - return n.fixUp_(); - }; - /** - * @returns Whether this is a RED node. - */ - LLRBNode.prototype.isRed_ = function () { - return this.color; - }; - /** - * @returns New tree after performing any needed rotations. - */ - LLRBNode.prototype.fixUp_ = function () { - var n = this; - if (n.right.isRed_() && !n.left.isRed_()) { - n = n.rotateLeft_(); - } - if (n.left.isRed_() && n.left.left.isRed_()) { - n = n.rotateRight_(); - } - if (n.left.isRed_() && n.right.isRed_()) { - n = n.colorFlip_(); - } - return n; - }; - /** - * @returns New tree, after moveRedLeft. - */ - LLRBNode.prototype.moveRedLeft_ = function () { - var n = this.colorFlip_(); - if (n.right.left.isRed_()) { - n = n.copy(null, null, null, null, n.right.rotateRight_()); - n = n.rotateLeft_(); - n = n.colorFlip_(); - } - return n; - }; - /** - * @returns New tree, after moveRedRight. - */ - LLRBNode.prototype.moveRedRight_ = function () { - var n = this.colorFlip_(); - if (n.left.left.isRed_()) { - n = n.rotateRight_(); - n = n.colorFlip_(); - } - return n; - }; - /** - * @returns New tree, after rotateLeft. - */ - LLRBNode.prototype.rotateLeft_ = function () { - var nl = this.copy(null, null, LLRBNode.RED, null, this.right.left); - return this.right.copy(null, null, this.color, nl, null); - }; - /** - * @returns New tree, after rotateRight. - */ - LLRBNode.prototype.rotateRight_ = function () { - var nr = this.copy(null, null, LLRBNode.RED, this.left.right, null); - return this.left.copy(null, null, this.color, null, nr); - }; - /** - * @returns Newt ree, after colorFlip. - */ - LLRBNode.prototype.colorFlip_ = function () { - var left = this.left.copy(null, null, !this.left.color, null, null); - var right = this.right.copy(null, null, !this.right.color, null, null); - return this.copy(null, null, !this.color, left, right); - }; - /** - * For testing. - * - * @returns True if all is well. - */ - LLRBNode.prototype.checkMaxDepth_ = function () { - var blackDepth = this.check_(); - return Math.pow(2.0, blackDepth) <= this.count() + 1; - }; - LLRBNode.prototype.check_ = function () { - if (this.isRed_() && this.left.isRed_()) { - throw new Error('Red node has red child(' + this.key + ',' + this.value + ')'); - } - if (this.right.isRed_()) { - throw new Error('Right child of (' + this.key + ',' + this.value + ') is red'); - } - var blackDepth = this.left.check_(); - if (blackDepth !== this.right.check_()) { - throw new Error('Black depths differ'); - } - else { - return blackDepth + (this.isRed_() ? 0 : 1); - } - }; - LLRBNode.RED = true; - LLRBNode.BLACK = false; - return LLRBNode; -}()); -/** - * Represents an empty node (a leaf node in the Red-Black Tree). - */ -var LLRBEmptyNode = /** @class */ (function () { - function LLRBEmptyNode() { - } - /** - * Returns a copy of the current node. - * - * @returns The node copy. - */ - LLRBEmptyNode.prototype.copy = function (key, value, color, left, right) { - return this; - }; - /** - * Returns a copy of the tree, with the specified key/value added. - * - * @param key - Key to be added. - * @param value - Value to be added. - * @param comparator - Comparator. - * @returns New tree, with item added. - */ - LLRBEmptyNode.prototype.insert = function (key, value, comparator) { - return new LLRBNode(key, value, null); - }; - /** - * Returns a copy of the tree, with the specified key removed. - * - * @param key - The key to remove. - * @param comparator - Comparator. - * @returns New tree, with item removed. - */ - LLRBEmptyNode.prototype.remove = function (key, comparator) { - return this; - }; - /** - * @returns The total number of nodes in the tree. - */ - LLRBEmptyNode.prototype.count = function () { - return 0; - }; - /** - * @returns True if the tree is empty. - */ - LLRBEmptyNode.prototype.isEmpty = function () { - return true; - }; - /** - * Traverses the tree in key order and calls the specified action function - * for each node. - * - * @param action - Callback function to be called for each - * node. If it returns true, traversal is aborted. - * @returns True if traversal was aborted. - */ - LLRBEmptyNode.prototype.inorderTraversal = function (action) { - return false; - }; - /** - * Traverses the tree in reverse key order and calls the specified action function - * for each node. - * - * @param action - Callback function to be called for each - * node. If it returns true, traversal is aborted. - * @returns True if traversal was aborted. - */ - LLRBEmptyNode.prototype.reverseTraversal = function (action) { - return false; - }; - LLRBEmptyNode.prototype.minKey = function () { - return null; - }; - LLRBEmptyNode.prototype.maxKey = function () { - return null; - }; - LLRBEmptyNode.prototype.check_ = function () { - return 0; - }; - /** - * @returns Whether this node is red. - */ - LLRBEmptyNode.prototype.isRed_ = function () { - return false; - }; - return LLRBEmptyNode; -}()); -/** - * An immutable sorted map implementation, based on a Left-leaning Red-Black - * tree. - */ -var SortedMap = /** @class */ (function () { - /** - * @param comparator_ - Key comparator. - * @param root_ - Optional root node for the map. - */ - function SortedMap(comparator_, root_) { - if (root_ === void 0) { root_ = SortedMap.EMPTY_NODE; } - this.comparator_ = comparator_; - this.root_ = root_; - } - /** - * Returns a copy of the map, with the specified key/value added or replaced. - * (TODO: We should perhaps rename this method to 'put') - * - * @param key - Key to be added. - * @param value - Value to be added. - * @returns New map, with item added. - */ - SortedMap.prototype.insert = function (key, value) { - return new SortedMap(this.comparator_, this.root_ - .insert(key, value, this.comparator_) - .copy(null, null, LLRBNode.BLACK, null, null)); - }; - /** - * Returns a copy of the map, with the specified key removed. - * - * @param key - The key to remove. - * @returns New map, with item removed. - */ - SortedMap.prototype.remove = function (key) { - return new SortedMap(this.comparator_, this.root_ - .remove(key, this.comparator_) - .copy(null, null, LLRBNode.BLACK, null, null)); - }; - /** - * Returns the value of the node with the given key, or null. - * - * @param key - The key to look up. - * @returns The value of the node with the given key, or null if the - * key doesn't exist. - */ - SortedMap.prototype.get = function (key) { - var cmp; - var node = this.root_; - while (!node.isEmpty()) { - cmp = this.comparator_(key, node.key); - if (cmp === 0) { - return node.value; - } - else if (cmp < 0) { - node = node.left; - } - else if (cmp > 0) { - node = node.right; - } - } - return null; - }; - /** - * Returns the key of the item *before* the specified key, or null if key is the first item. - * @param key - The key to find the predecessor of - * @returns The predecessor key. - */ - SortedMap.prototype.getPredecessorKey = function (key) { - var cmp, node = this.root_, rightParent = null; - while (!node.isEmpty()) { - cmp = this.comparator_(key, node.key); - if (cmp === 0) { - if (!node.left.isEmpty()) { - node = node.left; - while (!node.right.isEmpty()) { - node = node.right; - } - return node.key; - } - else if (rightParent) { - return rightParent.key; - } - else { - return null; // first item. - } - } - else if (cmp < 0) { - node = node.left; - } - else if (cmp > 0) { - rightParent = node; - node = node.right; - } - } - throw new Error('Attempted to find predecessor key for a nonexistent key. What gives?'); - }; - /** - * @returns True if the map is empty. - */ - SortedMap.prototype.isEmpty = function () { - return this.root_.isEmpty(); - }; - /** - * @returns The total number of nodes in the map. - */ - SortedMap.prototype.count = function () { - return this.root_.count(); - }; - /** - * @returns The minimum key in the map. - */ - SortedMap.prototype.minKey = function () { - return this.root_.minKey(); - }; - /** - * @returns The maximum key in the map. - */ - SortedMap.prototype.maxKey = function () { - return this.root_.maxKey(); - }; - /** - * Traverses the map in key order and calls the specified action function - * for each key/value pair. - * - * @param action - Callback function to be called - * for each key/value pair. If action returns true, traversal is aborted. - * @returns The first truthy value returned by action, or the last falsey - * value returned by action - */ - SortedMap.prototype.inorderTraversal = function (action) { - return this.root_.inorderTraversal(action); - }; - /** - * Traverses the map in reverse key order and calls the specified action function - * for each key/value pair. - * - * @param action - Callback function to be called - * for each key/value pair. If action returns true, traversal is aborted. - * @returns True if the traversal was aborted. - */ - SortedMap.prototype.reverseTraversal = function (action) { - return this.root_.reverseTraversal(action); - }; - /** - * Returns an iterator over the SortedMap. - * @returns The iterator. - */ - SortedMap.prototype.getIterator = function (resultGenerator) { - return new SortedMapIterator(this.root_, null, this.comparator_, false, resultGenerator); - }; - SortedMap.prototype.getIteratorFrom = function (key, resultGenerator) { - return new SortedMapIterator(this.root_, key, this.comparator_, false, resultGenerator); - }; - SortedMap.prototype.getReverseIteratorFrom = function (key, resultGenerator) { - return new SortedMapIterator(this.root_, key, this.comparator_, true, resultGenerator); - }; - SortedMap.prototype.getReverseIterator = function (resultGenerator) { - return new SortedMapIterator(this.root_, null, this.comparator_, true, resultGenerator); - }; - /** - * Always use the same empty node, to reduce memory. - */ - SortedMap.EMPTY_NODE = new LLRBEmptyNode(); - return SortedMap; -}()); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -function NAME_ONLY_COMPARATOR(left, right) { - return nameCompare(left.name, right.name); -} -function NAME_COMPARATOR(left, right) { - return nameCompare(left, right); -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var MAX_NODE$2; -function setMaxNode$1(val) { - MAX_NODE$2 = val; -} -var priorityHashText = function (priority) { - if (typeof priority === 'number') { - return 'number:' + doubleToIEEE754String(priority); - } - else { - return 'string:' + priority; - } -}; -/** - * Validates that a priority snapshot Node is valid. - */ -var validatePriorityNode = function (priorityNode) { - if (priorityNode.isLeafNode()) { - var val = priorityNode.val(); - util.assert(typeof val === 'string' || - typeof val === 'number' || - (typeof val === 'object' && util.contains(val, '.sv')), 'Priority must be a string or number.'); - } - else { - util.assert(priorityNode === MAX_NODE$2 || priorityNode.isEmpty(), 'priority of unexpected type.'); - } - // Don't call getPriority() on MAX_NODE to avoid hitting assertion. - util.assert(priorityNode === MAX_NODE$2 || priorityNode.getPriority().isEmpty(), "Priority nodes can't have a priority of their own."); -}; - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var __childrenNodeConstructor; -/** - * LeafNode is a class for storing leaf nodes in a DataSnapshot. It - * implements Node and stores the value of the node (a string, - * number, or boolean) accessible via getValue(). - */ -var LeafNode = /** @class */ (function () { - /** - * @param value_ - The value to store in this leaf node. The object type is - * possible in the event of a deferred value - * @param priorityNode_ - The priority of this node. - */ - function LeafNode(value_, priorityNode_) { - if (priorityNode_ === void 0) { priorityNode_ = LeafNode.__childrenNodeConstructor.EMPTY_NODE; } - this.value_ = value_; - this.priorityNode_ = priorityNode_; - this.lazyHash_ = null; - util.assert(this.value_ !== undefined && this.value_ !== null, "LeafNode shouldn't be created with null/undefined value."); - validatePriorityNode(this.priorityNode_); - } - Object.defineProperty(LeafNode, "__childrenNodeConstructor", { - get: function () { - return __childrenNodeConstructor; - }, - set: function (val) { - __childrenNodeConstructor = val; - }, - enumerable: false, - configurable: true - }); - /** @inheritDoc */ - LeafNode.prototype.isLeafNode = function () { - return true; - }; - /** @inheritDoc */ - LeafNode.prototype.getPriority = function () { - return this.priorityNode_; - }; - /** @inheritDoc */ - LeafNode.prototype.updatePriority = function (newPriorityNode) { - return new LeafNode(this.value_, newPriorityNode); - }; - /** @inheritDoc */ - LeafNode.prototype.getImmediateChild = function (childName) { - // Hack to treat priority as a regular child - if (childName === '.priority') { - return this.priorityNode_; - } - else { - return LeafNode.__childrenNodeConstructor.EMPTY_NODE; - } - }; - /** @inheritDoc */ - LeafNode.prototype.getChild = function (path) { - if (pathIsEmpty(path)) { - return this; - } - else if (pathGetFront(path) === '.priority') { - return this.priorityNode_; - } - else { - return LeafNode.__childrenNodeConstructor.EMPTY_NODE; - } - }; - LeafNode.prototype.hasChild = function () { - return false; - }; - /** @inheritDoc */ - LeafNode.prototype.getPredecessorChildName = function (childName, childNode) { - return null; - }; - /** @inheritDoc */ - LeafNode.prototype.updateImmediateChild = function (childName, newChildNode) { - if (childName === '.priority') { - return this.updatePriority(newChildNode); - } - else if (newChildNode.isEmpty() && childName !== '.priority') { - return this; - } - else { - return LeafNode.__childrenNodeConstructor.EMPTY_NODE.updateImmediateChild(childName, newChildNode).updatePriority(this.priorityNode_); - } - }; - /** @inheritDoc */ - LeafNode.prototype.updateChild = function (path, newChildNode) { - var front = pathGetFront(path); - if (front === null) { - return newChildNode; - } - else if (newChildNode.isEmpty() && front !== '.priority') { - return this; - } - else { - util.assert(front !== '.priority' || pathGetLength(path) === 1, '.priority must be the last token in a path'); - return this.updateImmediateChild(front, LeafNode.__childrenNodeConstructor.EMPTY_NODE.updateChild(pathPopFront(path), newChildNode)); - } - }; - /** @inheritDoc */ - LeafNode.prototype.isEmpty = function () { - return false; - }; - /** @inheritDoc */ - LeafNode.prototype.numChildren = function () { - return 0; - }; - /** @inheritDoc */ - LeafNode.prototype.forEachChild = function (index, action) { - return false; - }; - LeafNode.prototype.val = function (exportFormat) { - if (exportFormat && !this.getPriority().isEmpty()) { - return { - '.value': this.getValue(), - '.priority': this.getPriority().val() - }; - } - else { - return this.getValue(); - } - }; - /** @inheritDoc */ - LeafNode.prototype.hash = function () { - if (this.lazyHash_ === null) { - var toHash = ''; - if (!this.priorityNode_.isEmpty()) { - toHash += - 'priority:' + - priorityHashText(this.priorityNode_.val()) + - ':'; - } - var type = typeof this.value_; - toHash += type + ':'; - if (type === 'number') { - toHash += doubleToIEEE754String(this.value_); - } - else { - toHash += this.value_; - } - this.lazyHash_ = sha1(toHash); - } - return this.lazyHash_; - }; - /** - * Returns the value of the leaf node. - * @returns The value of the node. - */ - LeafNode.prototype.getValue = function () { - return this.value_; - }; - LeafNode.prototype.compareTo = function (other) { - if (other === LeafNode.__childrenNodeConstructor.EMPTY_NODE) { - return 1; - } - else if (other instanceof LeafNode.__childrenNodeConstructor) { - return -1; - } - else { - util.assert(other.isLeafNode(), 'Unknown node type'); - return this.compareToLeafNode_(other); - } - }; - /** - * Comparison specifically for two leaf nodes - */ - LeafNode.prototype.compareToLeafNode_ = function (otherLeaf) { - var otherLeafType = typeof otherLeaf.value_; - var thisLeafType = typeof this.value_; - var otherIndex = LeafNode.VALUE_TYPE_ORDER.indexOf(otherLeafType); - var thisIndex = LeafNode.VALUE_TYPE_ORDER.indexOf(thisLeafType); - util.assert(otherIndex >= 0, 'Unknown leaf type: ' + otherLeafType); - util.assert(thisIndex >= 0, 'Unknown leaf type: ' + thisLeafType); - if (otherIndex === thisIndex) { - // Same type, compare values - if (thisLeafType === 'object') { - // Deferred value nodes are all equal, but we should also never get to this point... - return 0; - } - else { - // Note that this works because true > false, all others are number or string comparisons - if (this.value_ < otherLeaf.value_) { - return -1; - } - else if (this.value_ === otherLeaf.value_) { - return 0; - } - else { - return 1; - } - } - } - else { - return thisIndex - otherIndex; - } - }; - LeafNode.prototype.withIndex = function () { - return this; - }; - LeafNode.prototype.isIndexed = function () { - return true; - }; - LeafNode.prototype.equals = function (other) { - if (other === this) { - return true; - } - else if (other.isLeafNode()) { - var otherLeaf = other; - return (this.value_ === otherLeaf.value_ && - this.priorityNode_.equals(otherLeaf.priorityNode_)); - } - else { - return false; - } - }; - /** - * The sort order for comparing leaf nodes of different types. If two leaf nodes have - * the same type, the comparison falls back to their value - */ - LeafNode.VALUE_TYPE_ORDER = ['object', 'boolean', 'number', 'string']; - return LeafNode; -}()); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var nodeFromJSON$1; -var MAX_NODE$1; -function setNodeFromJSON(val) { - nodeFromJSON$1 = val; -} -function setMaxNode(val) { - MAX_NODE$1 = val; -} -var PriorityIndex = /** @class */ (function (_super) { - tslib.__extends(PriorityIndex, _super); - function PriorityIndex() { - return _super !== null && _super.apply(this, arguments) || this; - } - PriorityIndex.prototype.compare = function (a, b) { - var aPriority = a.node.getPriority(); - var bPriority = b.node.getPriority(); - var indexCmp = aPriority.compareTo(bPriority); - if (indexCmp === 0) { - return nameCompare(a.name, b.name); - } - else { - return indexCmp; - } - }; - PriorityIndex.prototype.isDefinedOn = function (node) { - return !node.getPriority().isEmpty(); - }; - PriorityIndex.prototype.indexedValueChanged = function (oldNode, newNode) { - return !oldNode.getPriority().equals(newNode.getPriority()); - }; - PriorityIndex.prototype.minPost = function () { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - return NamedNode.MIN; - }; - PriorityIndex.prototype.maxPost = function () { - return new NamedNode(MAX_NAME, new LeafNode('[PRIORITY-POST]', MAX_NODE$1)); - }; - PriorityIndex.prototype.makePost = function (indexValue, name) { - var priorityNode = nodeFromJSON$1(indexValue); - return new NamedNode(name, new LeafNode('[PRIORITY-POST]', priorityNode)); - }; - /** - * @returns String representation for inclusion in a query spec - */ - PriorityIndex.prototype.toString = function () { - return '.priority'; - }; - return PriorityIndex; -}(Index)); -var PRIORITY_INDEX = new PriorityIndex(); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var LOG_2 = Math.log(2); -var Base12Num = /** @class */ (function () { - function Base12Num(length) { - var logBase2 = function (num) { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - return parseInt((Math.log(num) / LOG_2), 10); - }; - var bitMask = function (bits) { return parseInt(Array(bits + 1).join('1'), 2); }; - this.count = logBase2(length + 1); - this.current_ = this.count - 1; - var mask = bitMask(this.count); - this.bits_ = (length + 1) & mask; - } - Base12Num.prototype.nextBitIsOne = function () { - //noinspection JSBitwiseOperatorUsage - var result = !(this.bits_ & (0x1 << this.current_)); - this.current_--; - return result; - }; - return Base12Num; -}()); -/** - * Takes a list of child nodes and constructs a SortedSet using the given comparison - * function - * - * Uses the algorithm described in the paper linked here: - * http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.46.1458 - * - * @param childList - Unsorted list of children - * @param cmp - The comparison method to be used - * @param keyFn - An optional function to extract K from a node wrapper, if K's - * type is not NamedNode - * @param mapSortFn - An optional override for comparator used by the generated sorted map - */ -var buildChildSet = function (childList, cmp, keyFn, mapSortFn) { - childList.sort(cmp); - var buildBalancedTree = function (low, high) { - var length = high - low; - var namedNode; - var key; - if (length === 0) { - return null; - } - else if (length === 1) { - namedNode = childList[low]; - key = keyFn ? keyFn(namedNode) : namedNode; - return new LLRBNode(key, namedNode.node, LLRBNode.BLACK, null, null); - } - else { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - var middle = parseInt((length / 2), 10) + low; - var left = buildBalancedTree(low, middle); - var right = buildBalancedTree(middle + 1, high); - namedNode = childList[middle]; - key = keyFn ? keyFn(namedNode) : namedNode; - return new LLRBNode(key, namedNode.node, LLRBNode.BLACK, left, right); - } - }; - var buildFrom12Array = function (base12) { - var node = null; - var root = null; - var index = childList.length; - var buildPennant = function (chunkSize, color) { - var low = index - chunkSize; - var high = index; - index -= chunkSize; - var childTree = buildBalancedTree(low + 1, high); - var namedNode = childList[low]; - var key = keyFn ? keyFn(namedNode) : namedNode; - attachPennant(new LLRBNode(key, namedNode.node, color, null, childTree)); - }; - var attachPennant = function (pennant) { - if (node) { - node.left = pennant; - node = pennant; - } - else { - root = pennant; - node = pennant; - } - }; - for (var i = 0; i < base12.count; ++i) { - var isOne = base12.nextBitIsOne(); - // The number of nodes taken in each slice is 2^(arr.length - (i + 1)) - var chunkSize = Math.pow(2, base12.count - (i + 1)); - if (isOne) { - buildPennant(chunkSize, LLRBNode.BLACK); - } - else { - // current == 2 - buildPennant(chunkSize, LLRBNode.BLACK); - buildPennant(chunkSize, LLRBNode.RED); - } - } - return root; - }; - var base12 = new Base12Num(childList.length); - var root = buildFrom12Array(base12); - // eslint-disable-next-line @typescript-eslint/no-explicit-any - return new SortedMap(mapSortFn || cmp, root); -}; - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var _defaultIndexMap; -var fallbackObject = {}; -var IndexMap = /** @class */ (function () { - function IndexMap(indexes_, indexSet_) { - this.indexes_ = indexes_; - this.indexSet_ = indexSet_; - } - Object.defineProperty(IndexMap, "Default", { - /** - * The default IndexMap for nodes without a priority - */ - get: function () { - util.assert(fallbackObject && PRIORITY_INDEX, 'ChildrenNode.ts has not been loaded'); - _defaultIndexMap = - _defaultIndexMap || - new IndexMap({ '.priority': fallbackObject }, { '.priority': PRIORITY_INDEX }); - return _defaultIndexMap; - }, - enumerable: false, - configurable: true - }); - IndexMap.prototype.get = function (indexKey) { - var sortedMap = util.safeGet(this.indexes_, indexKey); - if (!sortedMap) { - throw new Error('No index defined for ' + indexKey); - } - if (sortedMap instanceof SortedMap) { - return sortedMap; - } - else { - // The index exists, but it falls back to just name comparison. Return null so that the calling code uses the - // regular child map - return null; - } - }; - IndexMap.prototype.hasIndex = function (indexDefinition) { - return util.contains(this.indexSet_, indexDefinition.toString()); - }; - IndexMap.prototype.addIndex = function (indexDefinition, existingChildren) { - util.assert(indexDefinition !== KEY_INDEX, "KeyIndex always exists and isn't meant to be added to the IndexMap."); - var childList = []; - var sawIndexedValue = false; - var iter = existingChildren.getIterator(NamedNode.Wrap); - var next = iter.getNext(); - while (next) { - sawIndexedValue = - sawIndexedValue || indexDefinition.isDefinedOn(next.node); - childList.push(next); - next = iter.getNext(); - } - var newIndex; - if (sawIndexedValue) { - newIndex = buildChildSet(childList, indexDefinition.getCompare()); - } - else { - newIndex = fallbackObject; - } - var indexName = indexDefinition.toString(); - var newIndexSet = tslib.__assign({}, this.indexSet_); - newIndexSet[indexName] = indexDefinition; - var newIndexes = tslib.__assign({}, this.indexes_); - newIndexes[indexName] = newIndex; - return new IndexMap(newIndexes, newIndexSet); - }; - /** - * Ensure that this node is properly tracked in any indexes that we're maintaining - */ - IndexMap.prototype.addToIndexes = function (namedNode, existingChildren) { - var _this = this; - var newIndexes = util.map(this.indexes_, function (indexedChildren, indexName) { - var index = util.safeGet(_this.indexSet_, indexName); - util.assert(index, 'Missing index implementation for ' + indexName); - if (indexedChildren === fallbackObject) { - // Check to see if we need to index everything - if (index.isDefinedOn(namedNode.node)) { - // We need to build this index - var childList = []; - var iter = existingChildren.getIterator(NamedNode.Wrap); - var next = iter.getNext(); - while (next) { - if (next.name !== namedNode.name) { - childList.push(next); - } - next = iter.getNext(); - } - childList.push(namedNode); - return buildChildSet(childList, index.getCompare()); - } - else { - // No change, this remains a fallback - return fallbackObject; - } - } - else { - var existingSnap = existingChildren.get(namedNode.name); - var newChildren = indexedChildren; - if (existingSnap) { - newChildren = newChildren.remove(new NamedNode(namedNode.name, existingSnap)); - } - return newChildren.insert(namedNode, namedNode.node); - } - }); - return new IndexMap(newIndexes, this.indexSet_); - }; - /** - * Create a new IndexMap instance with the given value removed - */ - IndexMap.prototype.removeFromIndexes = function (namedNode, existingChildren) { - var newIndexes = util.map(this.indexes_, function (indexedChildren) { - if (indexedChildren === fallbackObject) { - // This is the fallback. Just return it, nothing to do in this case - return indexedChildren; - } - else { - var existingSnap = existingChildren.get(namedNode.name); - if (existingSnap) { - return indexedChildren.remove(new NamedNode(namedNode.name, existingSnap)); - } - else { - // No record of this child - return indexedChildren; - } - } - }); - return new IndexMap(newIndexes, this.indexSet_); - }; - return IndexMap; -}()); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// TODO: For memory savings, don't store priorityNode_ if it's empty. -var EMPTY_NODE; -/** - * ChildrenNode is a class for storing internal nodes in a DataSnapshot - * (i.e. nodes with children). It implements Node and stores the - * list of children in the children property, sorted by child name. - */ -var ChildrenNode = /** @class */ (function () { - /** - * @param children_ - List of children of this node.. - * @param priorityNode_ - The priority of this node (as a snapshot node). - */ - function ChildrenNode(children_, priorityNode_, indexMap_) { - this.children_ = children_; - this.priorityNode_ = priorityNode_; - this.indexMap_ = indexMap_; - this.lazyHash_ = null; - /** - * Note: The only reason we allow null priority is for EMPTY_NODE, since we can't use - * EMPTY_NODE as the priority of EMPTY_NODE. We might want to consider making EMPTY_NODE its own - * class instead of an empty ChildrenNode. - */ - if (this.priorityNode_) { - validatePriorityNode(this.priorityNode_); - } - if (this.children_.isEmpty()) { - util.assert(!this.priorityNode_ || this.priorityNode_.isEmpty(), 'An empty node cannot have a priority'); - } - } - Object.defineProperty(ChildrenNode, "EMPTY_NODE", { - get: function () { - return (EMPTY_NODE || - (EMPTY_NODE = new ChildrenNode(new SortedMap(NAME_COMPARATOR), null, IndexMap.Default))); - }, - enumerable: false, - configurable: true - }); - /** @inheritDoc */ - ChildrenNode.prototype.isLeafNode = function () { - return false; - }; - /** @inheritDoc */ - ChildrenNode.prototype.getPriority = function () { - return this.priorityNode_ || EMPTY_NODE; - }; - /** @inheritDoc */ - ChildrenNode.prototype.updatePriority = function (newPriorityNode) { - if (this.children_.isEmpty()) { - // Don't allow priorities on empty nodes - return this; - } - else { - return new ChildrenNode(this.children_, newPriorityNode, this.indexMap_); - } - }; - /** @inheritDoc */ - ChildrenNode.prototype.getImmediateChild = function (childName) { - // Hack to treat priority as a regular child - if (childName === '.priority') { - return this.getPriority(); - } - else { - var child = this.children_.get(childName); - return child === null ? EMPTY_NODE : child; - } - }; - /** @inheritDoc */ - ChildrenNode.prototype.getChild = function (path) { - var front = pathGetFront(path); - if (front === null) { - return this; - } - return this.getImmediateChild(front).getChild(pathPopFront(path)); - }; - /** @inheritDoc */ - ChildrenNode.prototype.hasChild = function (childName) { - return this.children_.get(childName) !== null; - }; - /** @inheritDoc */ - ChildrenNode.prototype.updateImmediateChild = function (childName, newChildNode) { - util.assert(newChildNode, 'We should always be passing snapshot nodes'); - if (childName === '.priority') { - return this.updatePriority(newChildNode); - } - else { - var namedNode = new NamedNode(childName, newChildNode); - var newChildren = void 0, newIndexMap = void 0; - if (newChildNode.isEmpty()) { - newChildren = this.children_.remove(childName); - newIndexMap = this.indexMap_.removeFromIndexes(namedNode, this.children_); - } - else { - newChildren = this.children_.insert(childName, newChildNode); - newIndexMap = this.indexMap_.addToIndexes(namedNode, this.children_); - } - var newPriority = newChildren.isEmpty() - ? EMPTY_NODE - : this.priorityNode_; - return new ChildrenNode(newChildren, newPriority, newIndexMap); - } - }; - /** @inheritDoc */ - ChildrenNode.prototype.updateChild = function (path, newChildNode) { - var front = pathGetFront(path); - if (front === null) { - return newChildNode; - } - else { - util.assert(pathGetFront(path) !== '.priority' || pathGetLength(path) === 1, '.priority must be the last token in a path'); - var newImmediateChild = this.getImmediateChild(front).updateChild(pathPopFront(path), newChildNode); - return this.updateImmediateChild(front, newImmediateChild); - } - }; - /** @inheritDoc */ - ChildrenNode.prototype.isEmpty = function () { - return this.children_.isEmpty(); - }; - /** @inheritDoc */ - ChildrenNode.prototype.numChildren = function () { - return this.children_.count(); - }; - /** @inheritDoc */ - ChildrenNode.prototype.val = function (exportFormat) { - if (this.isEmpty()) { - return null; - } - var obj = {}; - var numKeys = 0, maxKey = 0, allIntegerKeys = true; - this.forEachChild(PRIORITY_INDEX, function (key, childNode) { - obj[key] = childNode.val(exportFormat); - numKeys++; - if (allIntegerKeys && ChildrenNode.INTEGER_REGEXP_.test(key)) { - maxKey = Math.max(maxKey, Number(key)); - } - else { - allIntegerKeys = false; - } - }); - if (!exportFormat && allIntegerKeys && maxKey < 2 * numKeys) { - // convert to array. - var array = []; - // eslint-disable-next-line guard-for-in - for (var key in obj) { - array[key] = obj[key]; - } - return array; - } - else { - if (exportFormat && !this.getPriority().isEmpty()) { - obj['.priority'] = this.getPriority().val(); - } - return obj; - } - }; - /** @inheritDoc */ - ChildrenNode.prototype.hash = function () { - if (this.lazyHash_ === null) { - var toHash_1 = ''; - if (!this.getPriority().isEmpty()) { - toHash_1 += - 'priority:' + - priorityHashText(this.getPriority().val()) + - ':'; - } - this.forEachChild(PRIORITY_INDEX, function (key, childNode) { - var childHash = childNode.hash(); - if (childHash !== '') { - toHash_1 += ':' + key + ':' + childHash; - } - }); - this.lazyHash_ = toHash_1 === '' ? '' : sha1(toHash_1); - } - return this.lazyHash_; - }; - /** @inheritDoc */ - ChildrenNode.prototype.getPredecessorChildName = function (childName, childNode, index) { - var idx = this.resolveIndex_(index); - if (idx) { - var predecessor = idx.getPredecessorKey(new NamedNode(childName, childNode)); - return predecessor ? predecessor.name : null; - } - else { - return this.children_.getPredecessorKey(childName); - } - }; - ChildrenNode.prototype.getFirstChildName = function (indexDefinition) { - var idx = this.resolveIndex_(indexDefinition); - if (idx) { - var minKey = idx.minKey(); - return minKey && minKey.name; - } - else { - return this.children_.minKey(); - } - }; - ChildrenNode.prototype.getFirstChild = function (indexDefinition) { - var minKey = this.getFirstChildName(indexDefinition); - if (minKey) { - return new NamedNode(minKey, this.children_.get(minKey)); - } - else { - return null; - } - }; - /** - * Given an index, return the key name of the largest value we have, according to that index - */ - ChildrenNode.prototype.getLastChildName = function (indexDefinition) { - var idx = this.resolveIndex_(indexDefinition); - if (idx) { - var maxKey = idx.maxKey(); - return maxKey && maxKey.name; - } - else { - return this.children_.maxKey(); - } - }; - ChildrenNode.prototype.getLastChild = function (indexDefinition) { - var maxKey = this.getLastChildName(indexDefinition); - if (maxKey) { - return new NamedNode(maxKey, this.children_.get(maxKey)); - } - else { - return null; - } - }; - ChildrenNode.prototype.forEachChild = function (index, action) { - var idx = this.resolveIndex_(index); - if (idx) { - return idx.inorderTraversal(function (wrappedNode) { - return action(wrappedNode.name, wrappedNode.node); - }); - } - else { - return this.children_.inorderTraversal(action); - } - }; - ChildrenNode.prototype.getIterator = function (indexDefinition) { - return this.getIteratorFrom(indexDefinition.minPost(), indexDefinition); - }; - ChildrenNode.prototype.getIteratorFrom = function (startPost, indexDefinition) { - var idx = this.resolveIndex_(indexDefinition); - if (idx) { - return idx.getIteratorFrom(startPost, function (key) { return key; }); - } - else { - var iterator = this.children_.getIteratorFrom(startPost.name, NamedNode.Wrap); - var next = iterator.peek(); - while (next != null && indexDefinition.compare(next, startPost) < 0) { - iterator.getNext(); - next = iterator.peek(); - } - return iterator; - } - }; - ChildrenNode.prototype.getReverseIterator = function (indexDefinition) { - return this.getReverseIteratorFrom(indexDefinition.maxPost(), indexDefinition); - }; - ChildrenNode.prototype.getReverseIteratorFrom = function (endPost, indexDefinition) { - var idx = this.resolveIndex_(indexDefinition); - if (idx) { - return idx.getReverseIteratorFrom(endPost, function (key) { - return key; - }); - } - else { - var iterator = this.children_.getReverseIteratorFrom(endPost.name, NamedNode.Wrap); - var next = iterator.peek(); - while (next != null && indexDefinition.compare(next, endPost) > 0) { - iterator.getNext(); - next = iterator.peek(); - } - return iterator; - } - }; - ChildrenNode.prototype.compareTo = function (other) { - if (this.isEmpty()) { - if (other.isEmpty()) { - return 0; - } - else { - return -1; - } - } - else if (other.isLeafNode() || other.isEmpty()) { - return 1; - } - else if (other === MAX_NODE) { - return -1; - } - else { - // Must be another node with children. - return 0; - } - }; - ChildrenNode.prototype.withIndex = function (indexDefinition) { - if (indexDefinition === KEY_INDEX || - this.indexMap_.hasIndex(indexDefinition)) { - return this; - } - else { - var newIndexMap = this.indexMap_.addIndex(indexDefinition, this.children_); - return new ChildrenNode(this.children_, this.priorityNode_, newIndexMap); - } - }; - ChildrenNode.prototype.isIndexed = function (index) { - return index === KEY_INDEX || this.indexMap_.hasIndex(index); - }; - ChildrenNode.prototype.equals = function (other) { - if (other === this) { - return true; - } - else if (other.isLeafNode()) { - return false; - } - else { - var otherChildrenNode = other; - if (!this.getPriority().equals(otherChildrenNode.getPriority())) { - return false; - } - else if (this.children_.count() === otherChildrenNode.children_.count()) { - var thisIter = this.getIterator(PRIORITY_INDEX); - var otherIter = otherChildrenNode.getIterator(PRIORITY_INDEX); - var thisCurrent = thisIter.getNext(); - var otherCurrent = otherIter.getNext(); - while (thisCurrent && otherCurrent) { - if (thisCurrent.name !== otherCurrent.name || - !thisCurrent.node.equals(otherCurrent.node)) { - return false; - } - thisCurrent = thisIter.getNext(); - otherCurrent = otherIter.getNext(); - } - return thisCurrent === null && otherCurrent === null; - } - else { - return false; - } - } - }; - /** - * Returns a SortedMap ordered by index, or null if the default (by-key) ordering can be used - * instead. - * - */ - ChildrenNode.prototype.resolveIndex_ = function (indexDefinition) { - if (indexDefinition === KEY_INDEX) { - return null; - } - else { - return this.indexMap_.get(indexDefinition.toString()); - } - }; - ChildrenNode.INTEGER_REGEXP_ = /^(0|[1-9]\d*)$/; - return ChildrenNode; -}()); -var MaxNode = /** @class */ (function (_super) { - tslib.__extends(MaxNode, _super); - function MaxNode() { - return _super.call(this, new SortedMap(NAME_COMPARATOR), ChildrenNode.EMPTY_NODE, IndexMap.Default) || this; - } - MaxNode.prototype.compareTo = function (other) { - if (other === this) { - return 0; - } - else { - return 1; - } - }; - MaxNode.prototype.equals = function (other) { - // Not that we every compare it, but MAX_NODE is only ever equal to itself - return other === this; - }; - MaxNode.prototype.getPriority = function () { - return this; - }; - MaxNode.prototype.getImmediateChild = function (childName) { - return ChildrenNode.EMPTY_NODE; - }; - MaxNode.prototype.isEmpty = function () { - return false; - }; - return MaxNode; -}(ChildrenNode)); -/** - * Marker that will sort higher than any other snapshot. - */ -var MAX_NODE = new MaxNode(); -Object.defineProperties(NamedNode, { - MIN: { - value: new NamedNode(MIN_NAME, ChildrenNode.EMPTY_NODE) - }, - MAX: { - value: new NamedNode(MAX_NAME, MAX_NODE) - } -}); -/** - * Reference Extensions - */ -KeyIndex.__EMPTY_NODE = ChildrenNode.EMPTY_NODE; -LeafNode.__childrenNodeConstructor = ChildrenNode; -setMaxNode$1(MAX_NODE); -setMaxNode(MAX_NODE); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var USE_HINZE = true; -/** - * Constructs a snapshot node representing the passed JSON and returns it. - * @param json - JSON to create a node for. - * @param priority - Optional priority to use. This will be ignored if the - * passed JSON contains a .priority property. - */ -function nodeFromJSON(json, priority) { - if (priority === void 0) { priority = null; } - if (json === null) { - return ChildrenNode.EMPTY_NODE; - } - if (typeof json === 'object' && '.priority' in json) { - priority = json['.priority']; - } - util.assert(priority === null || - typeof priority === 'string' || - typeof priority === 'number' || - (typeof priority === 'object' && '.sv' in priority), 'Invalid priority type found: ' + typeof priority); - if (typeof json === 'object' && '.value' in json && json['.value'] !== null) { - json = json['.value']; - } - // Valid leaf nodes include non-objects or server-value wrapper objects - if (typeof json !== 'object' || '.sv' in json) { - var jsonLeaf = json; - return new LeafNode(jsonLeaf, nodeFromJSON(priority)); - } - if (!(json instanceof Array) && USE_HINZE) { - var children_1 = []; - var childrenHavePriority_1 = false; - var hinzeJsonObj = json; - each(hinzeJsonObj, function (key, child) { - if (key.substring(0, 1) !== '.') { - // Ignore metadata nodes - var childNode = nodeFromJSON(child); - if (!childNode.isEmpty()) { - childrenHavePriority_1 = - childrenHavePriority_1 || !childNode.getPriority().isEmpty(); - children_1.push(new NamedNode(key, childNode)); - } - } - }); - if (children_1.length === 0) { - return ChildrenNode.EMPTY_NODE; - } - var childSet = buildChildSet(children_1, NAME_ONLY_COMPARATOR, function (namedNode) { return namedNode.name; }, NAME_COMPARATOR); - if (childrenHavePriority_1) { - var sortedChildSet = buildChildSet(children_1, PRIORITY_INDEX.getCompare()); - return new ChildrenNode(childSet, nodeFromJSON(priority), new IndexMap({ '.priority': sortedChildSet }, { '.priority': PRIORITY_INDEX })); - } - else { - return new ChildrenNode(childSet, nodeFromJSON(priority), IndexMap.Default); - } - } - else { - var node_1 = ChildrenNode.EMPTY_NODE; - each(json, function (key, childData) { - if (util.contains(json, key)) { - if (key.substring(0, 1) !== '.') { - // ignore metadata nodes. - var childNode = nodeFromJSON(childData); - if (childNode.isLeafNode() || !childNode.isEmpty()) { - node_1 = node_1.updateImmediateChild(key, childNode); - } - } - } - }); - return node_1.updatePriority(nodeFromJSON(priority)); - } -} -setNodeFromJSON(nodeFromJSON); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var PathIndex = /** @class */ (function (_super) { - tslib.__extends(PathIndex, _super); - function PathIndex(indexPath_) { - var _this = _super.call(this) || this; - _this.indexPath_ = indexPath_; - util.assert(!pathIsEmpty(indexPath_) && pathGetFront(indexPath_) !== '.priority', "Can't create PathIndex with empty path or .priority key"); - return _this; - } - PathIndex.prototype.extractChild = function (snap) { - return snap.getChild(this.indexPath_); - }; - PathIndex.prototype.isDefinedOn = function (node) { - return !node.getChild(this.indexPath_).isEmpty(); - }; - PathIndex.prototype.compare = function (a, b) { - var aChild = this.extractChild(a.node); - var bChild = this.extractChild(b.node); - var indexCmp = aChild.compareTo(bChild); - if (indexCmp === 0) { - return nameCompare(a.name, b.name); - } - else { - return indexCmp; - } - }; - PathIndex.prototype.makePost = function (indexValue, name) { - var valueNode = nodeFromJSON(indexValue); - var node = ChildrenNode.EMPTY_NODE.updateChild(this.indexPath_, valueNode); - return new NamedNode(name, node); - }; - PathIndex.prototype.maxPost = function () { - var node = ChildrenNode.EMPTY_NODE.updateChild(this.indexPath_, MAX_NODE); - return new NamedNode(MAX_NAME, node); - }; - PathIndex.prototype.toString = function () { - return pathSlice(this.indexPath_, 0).join('/'); - }; - return PathIndex; -}(Index)); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var ValueIndex = /** @class */ (function (_super) { - tslib.__extends(ValueIndex, _super); - function ValueIndex() { - return _super !== null && _super.apply(this, arguments) || this; - } - ValueIndex.prototype.compare = function (a, b) { - var indexCmp = a.node.compareTo(b.node); - if (indexCmp === 0) { - return nameCompare(a.name, b.name); - } - else { - return indexCmp; - } - }; - ValueIndex.prototype.isDefinedOn = function (node) { - return true; - }; - ValueIndex.prototype.indexedValueChanged = function (oldNode, newNode) { - return !oldNode.equals(newNode); - }; - ValueIndex.prototype.minPost = function () { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - return NamedNode.MIN; - }; - ValueIndex.prototype.maxPost = function () { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - return NamedNode.MAX; - }; - ValueIndex.prototype.makePost = function (indexValue, name) { - var valueNode = nodeFromJSON(indexValue); - return new NamedNode(name, valueNode); - }; - /** - * @returns String representation for inclusion in a query spec - */ - ValueIndex.prototype.toString = function () { - return '.value'; - }; - return ValueIndex; -}(Index)); -var VALUE_INDEX = new ValueIndex(); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Modeled after base64 web-safe chars, but ordered by ASCII. -var PUSH_CHARS = '-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz'; -var MIN_PUSH_CHAR = '-'; -var MAX_PUSH_CHAR = 'z'; -var MAX_KEY_LEN = 786; -/** - * Fancy ID generator that creates 20-character string identifiers with the - * following properties: - * - * 1. They're based on timestamp so that they sort *after* any existing ids. - * 2. They contain 72-bits of random data after the timestamp so that IDs won't - * collide with other clients' IDs. - * 3. They sort *lexicographically* (so the timestamp is converted to characters - * that will sort properly). - * 4. They're monotonically increasing. Even if you generate more than one in - * the same timestamp, the latter ones will sort after the former ones. We do - * this by using the previous random bits but "incrementing" them by 1 (only - * in the case of a timestamp collision). - */ -var nextPushId = (function () { - // Timestamp of last push, used to prevent local collisions if you push twice - // in one ms. - var lastPushTime = 0; - // We generate 72-bits of randomness which get turned into 12 characters and - // appended to the timestamp to prevent collisions with other clients. We - // store the last characters we generated because in the event of a collision, - // we'll use those same characters except "incremented" by one. - var lastRandChars = []; - return function (now) { - var duplicateTime = now === lastPushTime; - lastPushTime = now; - var i; - var timeStampChars = new Array(8); - for (i = 7; i >= 0; i--) { - timeStampChars[i] = PUSH_CHARS.charAt(now % 64); - // NOTE: Can't use << here because javascript will convert to int and lose - // the upper bits. - now = Math.floor(now / 64); - } - util.assert(now === 0, 'Cannot push at time == 0'); - var id = timeStampChars.join(''); - if (!duplicateTime) { - for (i = 0; i < 12; i++) { - lastRandChars[i] = Math.floor(Math.random() * 64); - } - } - else { - // If the timestamp hasn't changed since last push, use the same random - // number, except incremented by 1. - for (i = 11; i >= 0 && lastRandChars[i] === 63; i--) { - lastRandChars[i] = 0; - } - lastRandChars[i]++; - } - for (i = 0; i < 12; i++) { - id += PUSH_CHARS.charAt(lastRandChars[i]); - } - util.assert(id.length === 20, 'nextPushId: Length should be 20.'); - return id; - }; -})(); -var successor = function (key) { - if (key === '' + INTEGER_32_MAX) { - // See https://firebase.google.com/docs/database/web/lists-of-data#data-order - return MIN_PUSH_CHAR; - } - var keyAsInt = tryParseInt(key); - if (keyAsInt != null) { - return '' + (keyAsInt + 1); - } - var next = new Array(key.length); - for (var i_1 = 0; i_1 < next.length; i_1++) { - next[i_1] = key.charAt(i_1); - } - if (next.length < MAX_KEY_LEN) { - next.push(MIN_PUSH_CHAR); - return next.join(''); - } - var i = next.length - 1; - while (i >= 0 && next[i] === MAX_PUSH_CHAR) { - i--; - } - // `successor` was called on the largest possible key, so return the - // MAX_NAME, which sorts larger than all keys. - if (i === -1) { - return MAX_NAME; - } - var source = next[i]; - var sourcePlusOne = PUSH_CHARS.charAt(PUSH_CHARS.indexOf(source) + 1); - next[i] = sourcePlusOne; - return next.slice(0, i + 1).join(''); -}; -// `key` is assumed to be non-empty. -var predecessor = function (key) { - if (key === '' + INTEGER_32_MIN) { - return MIN_NAME; - } - var keyAsInt = tryParseInt(key); - if (keyAsInt != null) { - return '' + (keyAsInt - 1); - } - var next = new Array(key.length); - for (var i = 0; i < next.length; i++) { - next[i] = key.charAt(i); - } - // If `key` ends in `MIN_PUSH_CHAR`, the largest key lexicographically - // smaller than `key`, is `key[0:key.length - 1]`. The next key smaller - // than that, `predecessor(predecessor(key))`, is - // - // `key[0:key.length - 2] + (key[key.length - 1] - 1) + \ - // { MAX_PUSH_CHAR repeated MAX_KEY_LEN - (key.length - 1) times } - // - // analogous to increment/decrement for base-10 integers. - // - // This works because lexigographic comparison works character-by-character, - // using length as a tie-breaker if one key is a prefix of the other. - if (next[next.length - 1] === MIN_PUSH_CHAR) { - if (next.length === 1) { - // See https://firebase.google.com/docs/database/web/lists-of-data#orderbykey - return '' + INTEGER_32_MAX; - } - delete next[next.length - 1]; - return next.join(''); - } - // Replace the last character with it's immediate predecessor, and - // fill the suffix of the key with MAX_PUSH_CHAR. This is the - // lexicographically largest possible key smaller than `key`. - next[next.length - 1] = PUSH_CHARS.charAt(PUSH_CHARS.indexOf(next[next.length - 1]) - 1); - return next.join('') + MAX_PUSH_CHAR.repeat(MAX_KEY_LEN - next.length); -}; - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -function changeValue(snapshotNode) { - return { type: "value" /* VALUE */, snapshotNode: snapshotNode }; -} -function changeChildAdded(childName, snapshotNode) { - return { type: "child_added" /* CHILD_ADDED */, snapshotNode: snapshotNode, childName: childName }; -} -function changeChildRemoved(childName, snapshotNode) { - return { type: "child_removed" /* CHILD_REMOVED */, snapshotNode: snapshotNode, childName: childName }; -} -function changeChildChanged(childName, snapshotNode, oldSnap) { - return { - type: "child_changed" /* CHILD_CHANGED */, - snapshotNode: snapshotNode, - childName: childName, - oldSnap: oldSnap - }; -} -function changeChildMoved(childName, snapshotNode) { - return { type: "child_moved" /* CHILD_MOVED */, snapshotNode: snapshotNode, childName: childName }; -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Doesn't really filter nodes but applies an index to the node and keeps track of any changes - */ -var IndexedFilter = /** @class */ (function () { - function IndexedFilter(index_) { - this.index_ = index_; - } - IndexedFilter.prototype.updateChild = function (snap, key, newChild, affectedPath, source, optChangeAccumulator) { - util.assert(snap.isIndexed(this.index_), 'A node must be indexed if only a child is updated'); - var oldChild = snap.getImmediateChild(key); - // Check if anything actually changed. - if (oldChild.getChild(affectedPath).equals(newChild.getChild(affectedPath))) { - // There's an edge case where a child can enter or leave the view because affectedPath was set to null. - // In this case, affectedPath will appear null in both the old and new snapshots. So we need - // to avoid treating these cases as "nothing changed." - if (oldChild.isEmpty() === newChild.isEmpty()) { - // Nothing changed. - // This assert should be valid, but it's expensive (can dominate perf testing) so don't actually do it. - //assert(oldChild.equals(newChild), 'Old and new snapshots should be equal.'); - return snap; - } - } - if (optChangeAccumulator != null) { - if (newChild.isEmpty()) { - if (snap.hasChild(key)) { - optChangeAccumulator.trackChildChange(changeChildRemoved(key, oldChild)); - } - else { - util.assert(snap.isLeafNode(), 'A child remove without an old child only makes sense on a leaf node'); - } - } - else if (oldChild.isEmpty()) { - optChangeAccumulator.trackChildChange(changeChildAdded(key, newChild)); - } - else { - optChangeAccumulator.trackChildChange(changeChildChanged(key, newChild, oldChild)); - } - } - if (snap.isLeafNode() && newChild.isEmpty()) { - return snap; - } - else { - // Make sure the node is indexed - return snap.updateImmediateChild(key, newChild).withIndex(this.index_); - } - }; - IndexedFilter.prototype.updateFullNode = function (oldSnap, newSnap, optChangeAccumulator) { - if (optChangeAccumulator != null) { - if (!oldSnap.isLeafNode()) { - oldSnap.forEachChild(PRIORITY_INDEX, function (key, childNode) { - if (!newSnap.hasChild(key)) { - optChangeAccumulator.trackChildChange(changeChildRemoved(key, childNode)); - } - }); - } - if (!newSnap.isLeafNode()) { - newSnap.forEachChild(PRIORITY_INDEX, function (key, childNode) { - if (oldSnap.hasChild(key)) { - var oldChild = oldSnap.getImmediateChild(key); - if (!oldChild.equals(childNode)) { - optChangeAccumulator.trackChildChange(changeChildChanged(key, childNode, oldChild)); - } - } - else { - optChangeAccumulator.trackChildChange(changeChildAdded(key, childNode)); - } - }); - } - } - return newSnap.withIndex(this.index_); - }; - IndexedFilter.prototype.updatePriority = function (oldSnap, newPriority) { - if (oldSnap.isEmpty()) { - return ChildrenNode.EMPTY_NODE; - } - else { - return oldSnap.updatePriority(newPriority); - } - }; - IndexedFilter.prototype.filtersNodes = function () { - return false; - }; - IndexedFilter.prototype.getIndexedFilter = function () { - return this; - }; - IndexedFilter.prototype.getIndex = function () { - return this.index_; - }; - return IndexedFilter; -}()); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Filters nodes by range and uses an IndexFilter to track any changes after filtering the node - */ -var RangedFilter = /** @class */ (function () { - function RangedFilter(params) { - this.indexedFilter_ = new IndexedFilter(params.getIndex()); - this.index_ = params.getIndex(); - this.startPost_ = RangedFilter.getStartPost_(params); - this.endPost_ = RangedFilter.getEndPost_(params); - } - RangedFilter.prototype.getStartPost = function () { - return this.startPost_; - }; - RangedFilter.prototype.getEndPost = function () { - return this.endPost_; - }; - RangedFilter.prototype.matches = function (node) { - return (this.index_.compare(this.getStartPost(), node) <= 0 && - this.index_.compare(node, this.getEndPost()) <= 0); - }; - RangedFilter.prototype.updateChild = function (snap, key, newChild, affectedPath, source, optChangeAccumulator) { - if (!this.matches(new NamedNode(key, newChild))) { - newChild = ChildrenNode.EMPTY_NODE; - } - return this.indexedFilter_.updateChild(snap, key, newChild, affectedPath, source, optChangeAccumulator); - }; - RangedFilter.prototype.updateFullNode = function (oldSnap, newSnap, optChangeAccumulator) { - if (newSnap.isLeafNode()) { - // Make sure we have a children node with the correct index, not a leaf node; - newSnap = ChildrenNode.EMPTY_NODE; - } - var filtered = newSnap.withIndex(this.index_); - // Don't support priorities on queries - filtered = filtered.updatePriority(ChildrenNode.EMPTY_NODE); - var self = this; - newSnap.forEachChild(PRIORITY_INDEX, function (key, childNode) { - if (!self.matches(new NamedNode(key, childNode))) { - filtered = filtered.updateImmediateChild(key, ChildrenNode.EMPTY_NODE); - } - }); - return this.indexedFilter_.updateFullNode(oldSnap, filtered, optChangeAccumulator); - }; - RangedFilter.prototype.updatePriority = function (oldSnap, newPriority) { - // Don't support priorities on queries - return oldSnap; - }; - RangedFilter.prototype.filtersNodes = function () { - return true; - }; - RangedFilter.prototype.getIndexedFilter = function () { - return this.indexedFilter_; - }; - RangedFilter.prototype.getIndex = function () { - return this.index_; - }; - RangedFilter.getStartPost_ = function (params) { - if (params.hasStart()) { - var startName = params.getIndexStartName(); - return params.getIndex().makePost(params.getIndexStartValue(), startName); - } - else { - return params.getIndex().minPost(); - } - }; - RangedFilter.getEndPost_ = function (params) { - if (params.hasEnd()) { - var endName = params.getIndexEndName(); - return params.getIndex().makePost(params.getIndexEndValue(), endName); - } - else { - return params.getIndex().maxPost(); - } - }; - return RangedFilter; -}()); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Applies a limit and a range to a node and uses RangedFilter to do the heavy lifting where possible - */ -var LimitedFilter = /** @class */ (function () { - function LimitedFilter(params) { - this.rangedFilter_ = new RangedFilter(params); - this.index_ = params.getIndex(); - this.limit_ = params.getLimit(); - this.reverse_ = !params.isViewFromLeft(); - } - LimitedFilter.prototype.updateChild = function (snap, key, newChild, affectedPath, source, optChangeAccumulator) { - if (!this.rangedFilter_.matches(new NamedNode(key, newChild))) { - newChild = ChildrenNode.EMPTY_NODE; - } - if (snap.getImmediateChild(key).equals(newChild)) { - // No change - return snap; - } - else if (snap.numChildren() < this.limit_) { - return this.rangedFilter_ - .getIndexedFilter() - .updateChild(snap, key, newChild, affectedPath, source, optChangeAccumulator); - } - else { - return this.fullLimitUpdateChild_(snap, key, newChild, source, optChangeAccumulator); - } - }; - LimitedFilter.prototype.updateFullNode = function (oldSnap, newSnap, optChangeAccumulator) { - var filtered; - if (newSnap.isLeafNode() || newSnap.isEmpty()) { - // Make sure we have a children node with the correct index, not a leaf node; - filtered = ChildrenNode.EMPTY_NODE.withIndex(this.index_); - } - else { - if (this.limit_ * 2 < newSnap.numChildren() && - newSnap.isIndexed(this.index_)) { - // Easier to build up a snapshot, since what we're given has more than twice the elements we want - filtered = ChildrenNode.EMPTY_NODE.withIndex(this.index_); - // anchor to the startPost, endPost, or last element as appropriate - var iterator = void 0; - if (this.reverse_) { - iterator = newSnap.getReverseIteratorFrom(this.rangedFilter_.getEndPost(), this.index_); - } - else { - iterator = newSnap.getIteratorFrom(this.rangedFilter_.getStartPost(), this.index_); - } - var count = 0; - while (iterator.hasNext() && count < this.limit_) { - var next = iterator.getNext(); - var inRange = void 0; - if (this.reverse_) { - inRange = - this.index_.compare(this.rangedFilter_.getStartPost(), next) <= 0; - } - else { - inRange = - this.index_.compare(next, this.rangedFilter_.getEndPost()) <= 0; - } - if (inRange) { - filtered = filtered.updateImmediateChild(next.name, next.node); - count++; - } - else { - // if we have reached the end post, we cannot keep adding elemments - break; - } - } - } - else { - // The snap contains less than twice the limit. Faster to delete from the snap than build up a new one - filtered = newSnap.withIndex(this.index_); - // Don't support priorities on queries - filtered = filtered.updatePriority(ChildrenNode.EMPTY_NODE); - var startPost = void 0; - var endPost = void 0; - var cmp = void 0; - var iterator = void 0; - if (this.reverse_) { - iterator = filtered.getReverseIterator(this.index_); - startPost = this.rangedFilter_.getEndPost(); - endPost = this.rangedFilter_.getStartPost(); - var indexCompare_1 = this.index_.getCompare(); - cmp = function (a, b) { return indexCompare_1(b, a); }; - } - else { - iterator = filtered.getIterator(this.index_); - startPost = this.rangedFilter_.getStartPost(); - endPost = this.rangedFilter_.getEndPost(); - cmp = this.index_.getCompare(); - } - var count = 0; - var foundStartPost = false; - while (iterator.hasNext()) { - var next = iterator.getNext(); - if (!foundStartPost && cmp(startPost, next) <= 0) { - // start adding - foundStartPost = true; - } - var inRange = foundStartPost && count < this.limit_ && cmp(next, endPost) <= 0; - if (inRange) { - count++; - } - else { - filtered = filtered.updateImmediateChild(next.name, ChildrenNode.EMPTY_NODE); - } - } - } - } - return this.rangedFilter_ - .getIndexedFilter() - .updateFullNode(oldSnap, filtered, optChangeAccumulator); - }; - LimitedFilter.prototype.updatePriority = function (oldSnap, newPriority) { - // Don't support priorities on queries - return oldSnap; - }; - LimitedFilter.prototype.filtersNodes = function () { - return true; - }; - LimitedFilter.prototype.getIndexedFilter = function () { - return this.rangedFilter_.getIndexedFilter(); - }; - LimitedFilter.prototype.getIndex = function () { - return this.index_; - }; - LimitedFilter.prototype.fullLimitUpdateChild_ = function (snap, childKey, childSnap, source, changeAccumulator) { - // TODO: rename all cache stuff etc to general snap terminology - var cmp; - if (this.reverse_) { - var indexCmp_1 = this.index_.getCompare(); - cmp = function (a, b) { return indexCmp_1(b, a); }; - } - else { - cmp = this.index_.getCompare(); - } - var oldEventCache = snap; - util.assert(oldEventCache.numChildren() === this.limit_, ''); - var newChildNamedNode = new NamedNode(childKey, childSnap); - var windowBoundary = this.reverse_ - ? oldEventCache.getFirstChild(this.index_) - : oldEventCache.getLastChild(this.index_); - var inRange = this.rangedFilter_.matches(newChildNamedNode); - if (oldEventCache.hasChild(childKey)) { - var oldChildSnap = oldEventCache.getImmediateChild(childKey); - var nextChild = source.getChildAfterChild(this.index_, windowBoundary, this.reverse_); - while (nextChild != null && - (nextChild.name === childKey || oldEventCache.hasChild(nextChild.name))) { - // There is a weird edge case where a node is updated as part of a merge in the write tree, but hasn't - // been applied to the limited filter yet. Ignore this next child which will be updated later in - // the limited filter... - nextChild = source.getChildAfterChild(this.index_, nextChild, this.reverse_); - } - var compareNext = nextChild == null ? 1 : cmp(nextChild, newChildNamedNode); - var remainsInWindow = inRange && !childSnap.isEmpty() && compareNext >= 0; - if (remainsInWindow) { - if (changeAccumulator != null) { - changeAccumulator.trackChildChange(changeChildChanged(childKey, childSnap, oldChildSnap)); - } - return oldEventCache.updateImmediateChild(childKey, childSnap); - } - else { - if (changeAccumulator != null) { - changeAccumulator.trackChildChange(changeChildRemoved(childKey, oldChildSnap)); - } - var newEventCache = oldEventCache.updateImmediateChild(childKey, ChildrenNode.EMPTY_NODE); - var nextChildInRange = nextChild != null && this.rangedFilter_.matches(nextChild); - if (nextChildInRange) { - if (changeAccumulator != null) { - changeAccumulator.trackChildChange(changeChildAdded(nextChild.name, nextChild.node)); - } - return newEventCache.updateImmediateChild(nextChild.name, nextChild.node); - } - else { - return newEventCache; - } - } - } - else if (childSnap.isEmpty()) { - // we're deleting a node, but it was not in the window, so ignore it - return snap; - } - else if (inRange) { - if (cmp(windowBoundary, newChildNamedNode) >= 0) { - if (changeAccumulator != null) { - changeAccumulator.trackChildChange(changeChildRemoved(windowBoundary.name, windowBoundary.node)); - changeAccumulator.trackChildChange(changeChildAdded(childKey, childSnap)); - } - return oldEventCache - .updateImmediateChild(childKey, childSnap) - .updateImmediateChild(windowBoundary.name, ChildrenNode.EMPTY_NODE); - } - else { - return snap; - } - } - else { - return snap; - } - }; - return LimitedFilter; -}()); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * This class is an immutable-from-the-public-api struct containing a set of query parameters defining a - * range to be returned for a particular location. It is assumed that validation of parameters is done at the - * user-facing API level, so it is not done here. - * - * @internal - */ -var QueryParams = /** @class */ (function () { - function QueryParams() { - this.limitSet_ = false; - this.startSet_ = false; - this.startNameSet_ = false; - this.startAfterSet_ = false; - this.endSet_ = false; - this.endNameSet_ = false; - this.endBeforeSet_ = false; - this.limit_ = 0; - this.viewFrom_ = ''; - this.indexStartValue_ = null; - this.indexStartName_ = ''; - this.indexEndValue_ = null; - this.indexEndName_ = ''; - this.index_ = PRIORITY_INDEX; - } - QueryParams.prototype.hasStart = function () { - return this.startSet_; - }; - QueryParams.prototype.hasStartAfter = function () { - return this.startAfterSet_; - }; - QueryParams.prototype.hasEndBefore = function () { - return this.endBeforeSet_; - }; - /** - * @returns True if it would return from left. - */ - QueryParams.prototype.isViewFromLeft = function () { - if (this.viewFrom_ === '') { - // limit(), rather than limitToFirst or limitToLast was called. - // This means that only one of startSet_ and endSet_ is true. Use them - // to calculate which side of the view to anchor to. If neither is set, - // anchor to the end. - return this.startSet_; - } - else { - return this.viewFrom_ === "l" /* VIEW_FROM_LEFT */; - } - }; - /** - * Only valid to call if hasStart() returns true - */ - QueryParams.prototype.getIndexStartValue = function () { - util.assert(this.startSet_, 'Only valid if start has been set'); - return this.indexStartValue_; - }; - /** - * Only valid to call if hasStart() returns true. - * Returns the starting key name for the range defined by these query parameters - */ - QueryParams.prototype.getIndexStartName = function () { - util.assert(this.startSet_, 'Only valid if start has been set'); - if (this.startNameSet_) { - return this.indexStartName_; - } - else { - return MIN_NAME; - } - }; - QueryParams.prototype.hasEnd = function () { - return this.endSet_; - }; - /** - * Only valid to call if hasEnd() returns true. - */ - QueryParams.prototype.getIndexEndValue = function () { - util.assert(this.endSet_, 'Only valid if end has been set'); - return this.indexEndValue_; - }; - /** - * Only valid to call if hasEnd() returns true. - * Returns the end key name for the range defined by these query parameters - */ - QueryParams.prototype.getIndexEndName = function () { - util.assert(this.endSet_, 'Only valid if end has been set'); - if (this.endNameSet_) { - return this.indexEndName_; - } - else { - return MAX_NAME; - } - }; - QueryParams.prototype.hasLimit = function () { - return this.limitSet_; - }; - /** - * @returns True if a limit has been set and it has been explicitly anchored - */ - QueryParams.prototype.hasAnchoredLimit = function () { - return this.limitSet_ && this.viewFrom_ !== ''; - }; - /** - * Only valid to call if hasLimit() returns true - */ - QueryParams.prototype.getLimit = function () { - util.assert(this.limitSet_, 'Only valid if limit has been set'); - return this.limit_; - }; - QueryParams.prototype.getIndex = function () { - return this.index_; - }; - QueryParams.prototype.loadsAllData = function () { - return !(this.startSet_ || this.endSet_ || this.limitSet_); - }; - QueryParams.prototype.isDefault = function () { - return this.loadsAllData() && this.index_ === PRIORITY_INDEX; - }; - QueryParams.prototype.copy = function () { - var copy = new QueryParams(); - copy.limitSet_ = this.limitSet_; - copy.limit_ = this.limit_; - copy.startSet_ = this.startSet_; - copy.indexStartValue_ = this.indexStartValue_; - copy.startNameSet_ = this.startNameSet_; - copy.indexStartName_ = this.indexStartName_; - copy.endSet_ = this.endSet_; - copy.indexEndValue_ = this.indexEndValue_; - copy.endNameSet_ = this.endNameSet_; - copy.indexEndName_ = this.indexEndName_; - copy.index_ = this.index_; - copy.viewFrom_ = this.viewFrom_; - return copy; - }; - return QueryParams; -}()); -function queryParamsGetNodeFilter(queryParams) { - if (queryParams.loadsAllData()) { - return new IndexedFilter(queryParams.getIndex()); - } - else if (queryParams.hasLimit()) { - return new LimitedFilter(queryParams); - } - else { - return new RangedFilter(queryParams); - } -} -function queryParamsLimitToFirst(queryParams, newLimit) { - var newParams = queryParams.copy(); - newParams.limitSet_ = true; - newParams.limit_ = newLimit; - newParams.viewFrom_ = "l" /* VIEW_FROM_LEFT */; - return newParams; -} -function queryParamsLimitToLast(queryParams, newLimit) { - var newParams = queryParams.copy(); - newParams.limitSet_ = true; - newParams.limit_ = newLimit; - newParams.viewFrom_ = "r" /* VIEW_FROM_RIGHT */; - return newParams; -} -function queryParamsStartAt(queryParams, indexValue, key) { - var newParams = queryParams.copy(); - newParams.startSet_ = true; - if (indexValue === undefined) { - indexValue = null; - } - newParams.indexStartValue_ = indexValue; - if (key != null) { - newParams.startNameSet_ = true; - newParams.indexStartName_ = key; - } - else { - newParams.startNameSet_ = false; - newParams.indexStartName_ = ''; - } - return newParams; -} -function queryParamsStartAfter(queryParams, indexValue, key) { - var params; - if (queryParams.index_ === KEY_INDEX) { - if (typeof indexValue === 'string') { - indexValue = successor(indexValue); - } - params = queryParamsStartAt(queryParams, indexValue, key); - } - else { - var childKey = void 0; - if (key == null) { - childKey = MAX_NAME; - } - else { - childKey = successor(key); - } - params = queryParamsStartAt(queryParams, indexValue, childKey); - } - params.startAfterSet_ = true; - return params; -} -function queryParamsEndAt(queryParams, indexValue, key) { - var newParams = queryParams.copy(); - newParams.endSet_ = true; - if (indexValue === undefined) { - indexValue = null; - } - newParams.indexEndValue_ = indexValue; - if (key !== undefined) { - newParams.endNameSet_ = true; - newParams.indexEndName_ = key; - } - else { - newParams.endNameSet_ = false; - newParams.indexEndName_ = ''; - } - return newParams; -} -function queryParamsEndBefore(queryParams, indexValue, key) { - var childKey; - var params; - if (queryParams.index_ === KEY_INDEX) { - if (typeof indexValue === 'string') { - indexValue = predecessor(indexValue); - } - params = queryParamsEndAt(queryParams, indexValue, key); - } - else { - if (key == null) { - childKey = MIN_NAME; - } - else { - childKey = predecessor(key); - } - params = queryParamsEndAt(queryParams, indexValue, childKey); - } - params.endBeforeSet_ = true; - return params; -} -function queryParamsOrderBy(queryParams, index) { - var newParams = queryParams.copy(); - newParams.index_ = index; - return newParams; -} -/** - * Returns a set of REST query string parameters representing this query. - * - * @returns query string parameters - */ -function queryParamsToRestQueryStringParameters(queryParams) { - var qs = {}; - if (queryParams.isDefault()) { - return qs; - } - var orderBy; - if (queryParams.index_ === PRIORITY_INDEX) { - orderBy = "$priority" /* PRIORITY_INDEX */; - } - else if (queryParams.index_ === VALUE_INDEX) { - orderBy = "$value" /* VALUE_INDEX */; - } - else if (queryParams.index_ === KEY_INDEX) { - orderBy = "$key" /* KEY_INDEX */; - } - else { - util.assert(queryParams.index_ instanceof PathIndex, 'Unrecognized index type!'); - orderBy = queryParams.index_.toString(); - } - qs["orderBy" /* ORDER_BY */] = util.stringify(orderBy); - if (queryParams.startSet_) { - qs["startAt" /* START_AT */] = util.stringify(queryParams.indexStartValue_); - if (queryParams.startNameSet_) { - qs["startAt" /* START_AT */] += - ',' + util.stringify(queryParams.indexStartName_); - } - } - if (queryParams.endSet_) { - qs["endAt" /* END_AT */] = util.stringify(queryParams.indexEndValue_); - if (queryParams.endNameSet_) { - qs["endAt" /* END_AT */] += - ',' + util.stringify(queryParams.indexEndName_); - } - } - if (queryParams.limitSet_) { - if (queryParams.isViewFromLeft()) { - qs["limitToFirst" /* LIMIT_TO_FIRST */] = queryParams.limit_; - } - else { - qs["limitToLast" /* LIMIT_TO_LAST */] = queryParams.limit_; - } - } - return qs; -} -function queryParamsGetQueryObject(queryParams) { - var obj = {}; - if (queryParams.startSet_) { - obj["sp" /* INDEX_START_VALUE */] = - queryParams.indexStartValue_; - if (queryParams.startNameSet_) { - obj["sn" /* INDEX_START_NAME */] = - queryParams.indexStartName_; - } - } - if (queryParams.endSet_) { - obj["ep" /* INDEX_END_VALUE */] = queryParams.indexEndValue_; - if (queryParams.endNameSet_) { - obj["en" /* INDEX_END_NAME */] = queryParams.indexEndName_; - } - } - if (queryParams.limitSet_) { - obj["l" /* LIMIT */] = queryParams.limit_; - var viewFrom = queryParams.viewFrom_; - if (viewFrom === '') { - if (queryParams.isViewFromLeft()) { - viewFrom = "l" /* VIEW_FROM_LEFT */; - } - else { - viewFrom = "r" /* VIEW_FROM_RIGHT */; - } - } - obj["vf" /* VIEW_FROM */] = viewFrom; - } - // For now, priority index is the default, so we only specify if it's some other index - if (queryParams.index_ !== PRIORITY_INDEX) { - obj["i" /* INDEX */] = queryParams.index_.toString(); - } - return obj; -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * An implementation of ServerActions that communicates with the server via REST requests. - * This is mostly useful for compatibility with crawlers, where we don't want to spin up a full - * persistent connection (using WebSockets or long-polling) - */ -var ReadonlyRestClient = /** @class */ (function (_super) { - tslib.__extends(ReadonlyRestClient, _super); - /** - * @param repoInfo_ - Data about the namespace we are connecting to - * @param onDataUpdate_ - A callback for new data from the server - */ - function ReadonlyRestClient(repoInfo_, onDataUpdate_, authTokenProvider_, appCheckTokenProvider_) { - var _this = _super.call(this) || this; - _this.repoInfo_ = repoInfo_; - _this.onDataUpdate_ = onDataUpdate_; - _this.authTokenProvider_ = authTokenProvider_; - _this.appCheckTokenProvider_ = appCheckTokenProvider_; - /** @private {function(...[*])} */ - _this.log_ = logWrapper('p:rest:'); - /** - * We don't actually need to track listens, except to prevent us calling an onComplete for a listen - * that's been removed. :-/ - */ - _this.listens_ = {}; - return _this; - } - ReadonlyRestClient.prototype.reportStats = function (stats) { - throw new Error('Method not implemented.'); - }; - ReadonlyRestClient.getListenId_ = function (query, tag) { - if (tag !== undefined) { - return 'tag$' + tag; - } - else { - util.assert(query._queryParams.isDefault(), "should have a tag if it's not a default query."); - return query._path.toString(); - } - }; - /** @inheritDoc */ - ReadonlyRestClient.prototype.listen = function (query, currentHashFn, tag, onComplete) { - var _this = this; - var pathString = query._path.toString(); - this.log_('Listen called for ' + pathString + ' ' + query._queryIdentifier); - // Mark this listener so we can tell if it's removed. - var listenId = ReadonlyRestClient.getListenId_(query, tag); - var thisListen = {}; - this.listens_[listenId] = thisListen; - var queryStringParameters = queryParamsToRestQueryStringParameters(query._queryParams); - this.restRequest_(pathString + '.json', queryStringParameters, function (error, result) { - var data = result; - if (error === 404) { - data = null; - error = null; - } - if (error === null) { - _this.onDataUpdate_(pathString, data, /*isMerge=*/ false, tag); - } - if (util.safeGet(_this.listens_, listenId) === thisListen) { - var status_1; - if (!error) { - status_1 = 'ok'; - } - else if (error === 401) { - status_1 = 'permission_denied'; - } - else { - status_1 = 'rest_error:' + error; - } - onComplete(status_1, null); - } - }); - }; - /** @inheritDoc */ - ReadonlyRestClient.prototype.unlisten = function (query, tag) { - var listenId = ReadonlyRestClient.getListenId_(query, tag); - delete this.listens_[listenId]; - }; - ReadonlyRestClient.prototype.get = function (query) { - var _this = this; - var queryStringParameters = queryParamsToRestQueryStringParameters(query._queryParams); - var pathString = query._path.toString(); - var deferred = new util.Deferred(); - this.restRequest_(pathString + '.json', queryStringParameters, function (error, result) { - var data = result; - if (error === 404) { - data = null; - error = null; - } - if (error === null) { - _this.onDataUpdate_(pathString, data, - /*isMerge=*/ false, - /*tag=*/ null); - deferred.resolve(data); - } - else { - deferred.reject(new Error(data)); - } - }); - return deferred.promise; - }; - /** @inheritDoc */ - ReadonlyRestClient.prototype.refreshAuthToken = function (token) { - // no-op since we just always call getToken. - }; - /** - * Performs a REST request to the given path, with the provided query string parameters, - * and any auth credentials we have. - */ - ReadonlyRestClient.prototype.restRequest_ = function (pathString, queryStringParameters, callback) { - var _this = this; - if (queryStringParameters === void 0) { queryStringParameters = {}; } - queryStringParameters['format'] = 'export'; - return Promise.all([ - this.authTokenProvider_.getToken(/*forceRefresh=*/ false), - this.appCheckTokenProvider_.getToken(/*forceRefresh=*/ false) - ]).then(function (_a) { - var _b = tslib.__read(_a, 2), authToken = _b[0], appCheckToken = _b[1]; - if (authToken && authToken.accessToken) { - queryStringParameters['auth'] = authToken.accessToken; - } - if (appCheckToken && appCheckToken.token) { - queryStringParameters['ac'] = appCheckToken.token; - } - var url = (_this.repoInfo_.secure ? 'https://' : 'http://') + - _this.repoInfo_.host + - pathString + - '?' + - 'ns=' + - _this.repoInfo_.namespace + - util.querystring(queryStringParameters); - _this.log_('Sending REST request for ' + url); - var xhr = new XMLHttpRequest(); - xhr.onreadystatechange = function () { - if (callback && xhr.readyState === 4) { - _this.log_('REST Response for ' + url + ' received. status:', xhr.status, 'response:', xhr.responseText); - var res = null; - if (xhr.status >= 200 && xhr.status < 300) { - try { - res = util.jsonEval(xhr.responseText); - } - catch (e) { - warn('Failed to parse JSON response for ' + - url + - ': ' + - xhr.responseText); - } - callback(null, res); - } - else { - // 401 and 404 are expected. - if (xhr.status !== 401 && xhr.status !== 404) { - warn('Got unsuccessful REST response for ' + - url + - ' Status: ' + - xhr.status); - } - callback(xhr.status); - } - callback = null; - } - }; - xhr.open('GET', url, /*asynchronous=*/ true); - xhr.send(); - }); - }; - return ReadonlyRestClient; -}(ServerActions)); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Mutable object which basically just stores a reference to the "latest" immutable snapshot. - */ -var SnapshotHolder = /** @class */ (function () { - function SnapshotHolder() { - this.rootNode_ = ChildrenNode.EMPTY_NODE; - } - SnapshotHolder.prototype.getNode = function (path) { - return this.rootNode_.getChild(path); - }; - SnapshotHolder.prototype.updateSnapshot = function (path, newSnapshotNode) { - this.rootNode_ = this.rootNode_.updateChild(path, newSnapshotNode); - }; - return SnapshotHolder; -}()); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -function newSparseSnapshotTree() { - return { - value: null, - children: new Map() - }; -} -/** - * Stores the given node at the specified path. If there is already a node - * at a shallower path, it merges the new data into that snapshot node. - * - * @param path - Path to look up snapshot for. - * @param data - The new data, or null. - */ -function sparseSnapshotTreeRemember(sparseSnapshotTree, path, data) { - if (pathIsEmpty(path)) { - sparseSnapshotTree.value = data; - sparseSnapshotTree.children.clear(); - } - else if (sparseSnapshotTree.value !== null) { - sparseSnapshotTree.value = sparseSnapshotTree.value.updateChild(path, data); - } - else { - var childKey = pathGetFront(path); - if (!sparseSnapshotTree.children.has(childKey)) { - sparseSnapshotTree.children.set(childKey, newSparseSnapshotTree()); - } - var child = sparseSnapshotTree.children.get(childKey); - path = pathPopFront(path); - sparseSnapshotTreeRemember(child, path, data); - } -} -/** - * Purge the data at path from the cache. - * - * @param path - Path to look up snapshot for. - * @returns True if this node should now be removed. - */ -function sparseSnapshotTreeForget(sparseSnapshotTree, path) { - if (pathIsEmpty(path)) { - sparseSnapshotTree.value = null; - sparseSnapshotTree.children.clear(); - return true; - } - else { - if (sparseSnapshotTree.value !== null) { - if (sparseSnapshotTree.value.isLeafNode()) { - // We're trying to forget a node that doesn't exist - return false; - } - else { - var value = sparseSnapshotTree.value; - sparseSnapshotTree.value = null; - value.forEachChild(PRIORITY_INDEX, function (key, tree) { - sparseSnapshotTreeRemember(sparseSnapshotTree, new Path(key), tree); - }); - return sparseSnapshotTreeForget(sparseSnapshotTree, path); - } - } - else if (sparseSnapshotTree.children.size > 0) { - var childKey = pathGetFront(path); - path = pathPopFront(path); - if (sparseSnapshotTree.children.has(childKey)) { - var safeToRemove = sparseSnapshotTreeForget(sparseSnapshotTree.children.get(childKey), path); - if (safeToRemove) { - sparseSnapshotTree.children.delete(childKey); - } - } - return sparseSnapshotTree.children.size === 0; - } - else { - return true; - } - } -} -/** - * Recursively iterates through all of the stored tree and calls the - * callback on each one. - * - * @param prefixPath - Path to look up node for. - * @param func - The function to invoke for each tree. - */ -function sparseSnapshotTreeForEachTree(sparseSnapshotTree, prefixPath, func) { - if (sparseSnapshotTree.value !== null) { - func(prefixPath, sparseSnapshotTree.value); - } - else { - sparseSnapshotTreeForEachChild(sparseSnapshotTree, function (key, tree) { - var path = new Path(prefixPath.toString() + '/' + key); - sparseSnapshotTreeForEachTree(tree, path, func); - }); - } -} -/** - * Iterates through each immediate child and triggers the callback. - * Only seems to be used in tests. - * - * @param func - The function to invoke for each child. - */ -function sparseSnapshotTreeForEachChild(sparseSnapshotTree, func) { - sparseSnapshotTree.children.forEach(function (tree, key) { - func(key, tree); - }); -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Returns the delta from the previous call to get stats. - * - * @param collection_ - The collection to "listen" to. - */ -var StatsListener = /** @class */ (function () { - function StatsListener(collection_) { - this.collection_ = collection_; - this.last_ = null; - } - StatsListener.prototype.get = function () { - var newStats = this.collection_.get(); - var delta = tslib.__assign({}, newStats); - if (this.last_) { - each(this.last_, function (stat, value) { - delta[stat] = delta[stat] - value; - }); - } - this.last_ = newStats; - return delta; - }; - return StatsListener; -}()); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Assuming some apps may have a short amount of time on page, and a bulk of firebase operations probably -// happen on page load, we try to report our first set of stats pretty quickly, but we wait at least 10 -// seconds to try to ensure the Firebase connection is established / settled. -var FIRST_STATS_MIN_TIME = 10 * 1000; -var FIRST_STATS_MAX_TIME = 30 * 1000; -// We'll continue to report stats on average every 5 minutes. -var REPORT_STATS_INTERVAL = 5 * 60 * 1000; -var StatsReporter = /** @class */ (function () { - function StatsReporter(collection, server_) { - this.server_ = server_; - this.statsToReport_ = {}; - this.statsListener_ = new StatsListener(collection); - var timeout = FIRST_STATS_MIN_TIME + - (FIRST_STATS_MAX_TIME - FIRST_STATS_MIN_TIME) * Math.random(); - setTimeoutNonBlocking(this.reportStats_.bind(this), Math.floor(timeout)); - } - StatsReporter.prototype.reportStats_ = function () { - var _this = this; - var stats = this.statsListener_.get(); - var reportedStats = {}; - var haveStatsToReport = false; - each(stats, function (stat, value) { - if (value > 0 && util.contains(_this.statsToReport_, stat)) { - reportedStats[stat] = value; - haveStatsToReport = true; - } - }); - if (haveStatsToReport) { - this.server_.reportStats(reportedStats); - } - // queue our next run. - setTimeoutNonBlocking(this.reportStats_.bind(this), Math.floor(Math.random() * 2 * REPORT_STATS_INTERVAL)); - }; - return StatsReporter; -}()); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * - * @enum - */ -var OperationType; -(function (OperationType) { - OperationType[OperationType["OVERWRITE"] = 0] = "OVERWRITE"; - OperationType[OperationType["MERGE"] = 1] = "MERGE"; - OperationType[OperationType["ACK_USER_WRITE"] = 2] = "ACK_USER_WRITE"; - OperationType[OperationType["LISTEN_COMPLETE"] = 3] = "LISTEN_COMPLETE"; -})(OperationType || (OperationType = {})); -function newOperationSourceUser() { - return { - fromUser: true, - fromServer: false, - queryId: null, - tagged: false - }; -} -function newOperationSourceServer() { - return { - fromUser: false, - fromServer: true, - queryId: null, - tagged: false - }; -} -function newOperationSourceServerTaggedQuery(queryId) { - return { - fromUser: false, - fromServer: true, - queryId: queryId, - tagged: true - }; -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var AckUserWrite = /** @class */ (function () { - /** - * @param affectedTree - A tree containing true for each affected path. Affected paths can't overlap. - */ - function AckUserWrite( - /** @inheritDoc */ path, - /** @inheritDoc */ affectedTree, - /** @inheritDoc */ revert) { - this.path = path; - this.affectedTree = affectedTree; - this.revert = revert; - /** @inheritDoc */ - this.type = OperationType.ACK_USER_WRITE; - /** @inheritDoc */ - this.source = newOperationSourceUser(); - } - AckUserWrite.prototype.operationForChild = function (childName) { - if (!pathIsEmpty(this.path)) { - util.assert(pathGetFront(this.path) === childName, 'operationForChild called for unrelated child.'); - return new AckUserWrite(pathPopFront(this.path), this.affectedTree, this.revert); - } - else if (this.affectedTree.value != null) { - util.assert(this.affectedTree.children.isEmpty(), 'affectedTree should not have overlapping affected paths.'); - // All child locations are affected as well; just return same operation. - return this; - } - else { - var childTree = this.affectedTree.subtree(new Path(childName)); - return new AckUserWrite(newEmptyPath(), childTree, this.revert); - } - }; - return AckUserWrite; -}()); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var ListenComplete = /** @class */ (function () { - function ListenComplete(source, path) { - this.source = source; - this.path = path; - /** @inheritDoc */ - this.type = OperationType.LISTEN_COMPLETE; - } - ListenComplete.prototype.operationForChild = function (childName) { - if (pathIsEmpty(this.path)) { - return new ListenComplete(this.source, newEmptyPath()); - } - else { - return new ListenComplete(this.source, pathPopFront(this.path)); - } - }; - return ListenComplete; -}()); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var Overwrite = /** @class */ (function () { - function Overwrite(source, path, snap) { - this.source = source; - this.path = path; - this.snap = snap; - /** @inheritDoc */ - this.type = OperationType.OVERWRITE; - } - Overwrite.prototype.operationForChild = function (childName) { - if (pathIsEmpty(this.path)) { - return new Overwrite(this.source, newEmptyPath(), this.snap.getImmediateChild(childName)); - } - else { - return new Overwrite(this.source, pathPopFront(this.path), this.snap); - } - }; - return Overwrite; -}()); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var Merge = /** @class */ (function () { - function Merge( - /** @inheritDoc */ source, - /** @inheritDoc */ path, - /** @inheritDoc */ children) { - this.source = source; - this.path = path; - this.children = children; - /** @inheritDoc */ - this.type = OperationType.MERGE; - } - Merge.prototype.operationForChild = function (childName) { - if (pathIsEmpty(this.path)) { - var childTree = this.children.subtree(new Path(childName)); - if (childTree.isEmpty()) { - // This child is unaffected - return null; - } - else if (childTree.value) { - // We have a snapshot for the child in question. This becomes an overwrite of the child. - return new Overwrite(this.source, newEmptyPath(), childTree.value); - } - else { - // This is a merge at a deeper level - return new Merge(this.source, newEmptyPath(), childTree); - } - } - else { - util.assert(pathGetFront(this.path) === childName, "Can't get a merge for a child not on the path of the operation"); - return new Merge(this.source, pathPopFront(this.path), this.children); - } - }; - Merge.prototype.toString = function () { - return ('Operation(' + - this.path + - ': ' + - this.source.toString() + - ' merge: ' + - this.children.toString() + - ')'); - }; - return Merge; -}()); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * A cache node only stores complete children. Additionally it holds a flag whether the node can be considered fully - * initialized in the sense that we know at one point in time this represented a valid state of the world, e.g. - * initialized with data from the server, or a complete overwrite by the client. The filtered flag also tracks - * whether a node potentially had children removed due to a filter. - */ -var CacheNode = /** @class */ (function () { - function CacheNode(node_, fullyInitialized_, filtered_) { - this.node_ = node_; - this.fullyInitialized_ = fullyInitialized_; - this.filtered_ = filtered_; - } - /** - * Returns whether this node was fully initialized with either server data or a complete overwrite by the client - */ - CacheNode.prototype.isFullyInitialized = function () { - return this.fullyInitialized_; - }; - /** - * Returns whether this node is potentially missing children due to a filter applied to the node - */ - CacheNode.prototype.isFiltered = function () { - return this.filtered_; - }; - CacheNode.prototype.isCompleteForPath = function (path) { - if (pathIsEmpty(path)) { - return this.isFullyInitialized() && !this.filtered_; - } - var childKey = pathGetFront(path); - return this.isCompleteForChild(childKey); - }; - CacheNode.prototype.isCompleteForChild = function (key) { - return ((this.isFullyInitialized() && !this.filtered_) || this.node_.hasChild(key)); - }; - CacheNode.prototype.getNode = function () { - return this.node_; - }; - return CacheNode; -}()); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * An EventGenerator is used to convert "raw" changes (Change) as computed by the - * CacheDiffer into actual events (Event) that can be raised. See generateEventsForChanges() - * for details. - * - */ -var EventGenerator = /** @class */ (function () { - function EventGenerator(query_) { - this.query_ = query_; - this.index_ = this.query_._queryParams.getIndex(); - } - return EventGenerator; -}()); -/** - * Given a set of raw changes (no moved events and prevName not specified yet), and a set of - * EventRegistrations that should be notified of these changes, generate the actual events to be raised. - * - * Notes: - * - child_moved events will be synthesized at this time for any child_changed events that affect - * our index. - * - prevName will be calculated based on the index ordering. - */ -function eventGeneratorGenerateEventsForChanges(eventGenerator, changes, eventCache, eventRegistrations) { - var events = []; - var moves = []; - changes.forEach(function (change) { - if (change.type === "child_changed" /* CHILD_CHANGED */ && - eventGenerator.index_.indexedValueChanged(change.oldSnap, change.snapshotNode)) { - moves.push(changeChildMoved(change.childName, change.snapshotNode)); - } - }); - eventGeneratorGenerateEventsForType(eventGenerator, events, "child_removed" /* CHILD_REMOVED */, changes, eventRegistrations, eventCache); - eventGeneratorGenerateEventsForType(eventGenerator, events, "child_added" /* CHILD_ADDED */, changes, eventRegistrations, eventCache); - eventGeneratorGenerateEventsForType(eventGenerator, events, "child_moved" /* CHILD_MOVED */, moves, eventRegistrations, eventCache); - eventGeneratorGenerateEventsForType(eventGenerator, events, "child_changed" /* CHILD_CHANGED */, changes, eventRegistrations, eventCache); - eventGeneratorGenerateEventsForType(eventGenerator, events, "value" /* VALUE */, changes, eventRegistrations, eventCache); - return events; -} -/** - * Given changes of a single change type, generate the corresponding events. - */ -function eventGeneratorGenerateEventsForType(eventGenerator, events, eventType, changes, registrations, eventCache) { - var filteredChanges = changes.filter(function (change) { return change.type === eventType; }); - filteredChanges.sort(function (a, b) { - return eventGeneratorCompareChanges(eventGenerator, a, b); - }); - filteredChanges.forEach(function (change) { - var materializedChange = eventGeneratorMaterializeSingleChange(eventGenerator, change, eventCache); - registrations.forEach(function (registration) { - if (registration.respondsTo(change.type)) { - events.push(registration.createEvent(materializedChange, eventGenerator.query_)); - } - }); - }); -} -function eventGeneratorMaterializeSingleChange(eventGenerator, change, eventCache) { - if (change.type === 'value' || change.type === 'child_removed') { - return change; - } - else { - change.prevName = eventCache.getPredecessorChildName(change.childName, change.snapshotNode, eventGenerator.index_); - return change; - } -} -function eventGeneratorCompareChanges(eventGenerator, a, b) { - if (a.childName == null || b.childName == null) { - throw util.assertionError('Should only compare child_ events.'); - } - var aWrapped = new NamedNode(a.childName, a.snapshotNode); - var bWrapped = new NamedNode(b.childName, b.snapshotNode); - return eventGenerator.index_.compare(aWrapped, bWrapped); -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -function newViewCache(eventCache, serverCache) { - return { eventCache: eventCache, serverCache: serverCache }; -} -function viewCacheUpdateEventSnap(viewCache, eventSnap, complete, filtered) { - return newViewCache(new CacheNode(eventSnap, complete, filtered), viewCache.serverCache); -} -function viewCacheUpdateServerSnap(viewCache, serverSnap, complete, filtered) { - return newViewCache(viewCache.eventCache, new CacheNode(serverSnap, complete, filtered)); -} -function viewCacheGetCompleteEventSnap(viewCache) { - return viewCache.eventCache.isFullyInitialized() - ? viewCache.eventCache.getNode() - : null; -} -function viewCacheGetCompleteServerSnap(viewCache) { - return viewCache.serverCache.isFullyInitialized() - ? viewCache.serverCache.getNode() - : null; -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var emptyChildrenSingleton; -/** - * Singleton empty children collection. - * - */ -var EmptyChildren = function () { - if (!emptyChildrenSingleton) { - emptyChildrenSingleton = new SortedMap(stringCompare); - } - return emptyChildrenSingleton; -}; -/** - * A tree with immutable elements. - */ -var ImmutableTree = /** @class */ (function () { - function ImmutableTree(value, children) { - if (children === void 0) { children = EmptyChildren(); } - this.value = value; - this.children = children; - } - ImmutableTree.fromObject = function (obj) { - var tree = new ImmutableTree(null); - each(obj, function (childPath, childSnap) { - tree = tree.set(new Path(childPath), childSnap); - }); - return tree; - }; - /** - * True if the value is empty and there are no children - */ - ImmutableTree.prototype.isEmpty = function () { - return this.value === null && this.children.isEmpty(); - }; - /** - * Given a path and predicate, return the first node and the path to that node - * where the predicate returns true. - * - * TODO Do a perf test -- If we're creating a bunch of `{path: value:}` - * objects on the way back out, it may be better to pass down a pathSoFar obj. - * - * @param relativePath - The remainder of the path - * @param predicate - The predicate to satisfy to return a node - */ - ImmutableTree.prototype.findRootMostMatchingPathAndValue = function (relativePath, predicate) { - if (this.value != null && predicate(this.value)) { - return { path: newEmptyPath(), value: this.value }; - } - else { - if (pathIsEmpty(relativePath)) { - return null; - } - else { - var front = pathGetFront(relativePath); - var child = this.children.get(front); - if (child !== null) { - var childExistingPathAndValue = child.findRootMostMatchingPathAndValue(pathPopFront(relativePath), predicate); - if (childExistingPathAndValue != null) { - var fullPath = pathChild(new Path(front), childExistingPathAndValue.path); - return { path: fullPath, value: childExistingPathAndValue.value }; - } - else { - return null; - } - } - else { - return null; - } - } - } - }; - /** - * Find, if it exists, the shortest subpath of the given path that points a defined - * value in the tree - */ - ImmutableTree.prototype.findRootMostValueAndPath = function (relativePath) { - return this.findRootMostMatchingPathAndValue(relativePath, function () { return true; }); - }; - /** - * @returns The subtree at the given path - */ - ImmutableTree.prototype.subtree = function (relativePath) { - if (pathIsEmpty(relativePath)) { - return this; - } - else { - var front = pathGetFront(relativePath); - var childTree = this.children.get(front); - if (childTree !== null) { - return childTree.subtree(pathPopFront(relativePath)); - } - else { - return new ImmutableTree(null); - } - } - }; - /** - * Sets a value at the specified path. - * - * @param relativePath - Path to set value at. - * @param toSet - Value to set. - * @returns Resulting tree. - */ - ImmutableTree.prototype.set = function (relativePath, toSet) { - if (pathIsEmpty(relativePath)) { - return new ImmutableTree(toSet, this.children); - } - else { - var front = pathGetFront(relativePath); - var child = this.children.get(front) || new ImmutableTree(null); - var newChild = child.set(pathPopFront(relativePath), toSet); - var newChildren = this.children.insert(front, newChild); - return new ImmutableTree(this.value, newChildren); - } - }; - /** - * Removes the value at the specified path. - * - * @param relativePath - Path to value to remove. - * @returns Resulting tree. - */ - ImmutableTree.prototype.remove = function (relativePath) { - if (pathIsEmpty(relativePath)) { - if (this.children.isEmpty()) { - return new ImmutableTree(null); - } - else { - return new ImmutableTree(null, this.children); - } - } - else { - var front = pathGetFront(relativePath); - var child = this.children.get(front); - if (child) { - var newChild = child.remove(pathPopFront(relativePath)); - var newChildren = void 0; - if (newChild.isEmpty()) { - newChildren = this.children.remove(front); - } - else { - newChildren = this.children.insert(front, newChild); - } - if (this.value === null && newChildren.isEmpty()) { - return new ImmutableTree(null); - } - else { - return new ImmutableTree(this.value, newChildren); - } - } - else { - return this; - } - } - }; - /** - * Gets a value from the tree. - * - * @param relativePath - Path to get value for. - * @returns Value at path, or null. - */ - ImmutableTree.prototype.get = function (relativePath) { - if (pathIsEmpty(relativePath)) { - return this.value; - } - else { - var front = pathGetFront(relativePath); - var child = this.children.get(front); - if (child) { - return child.get(pathPopFront(relativePath)); - } - else { - return null; - } - } - }; - /** - * Replace the subtree at the specified path with the given new tree. - * - * @param relativePath - Path to replace subtree for. - * @param newTree - New tree. - * @returns Resulting tree. - */ - ImmutableTree.prototype.setTree = function (relativePath, newTree) { - if (pathIsEmpty(relativePath)) { - return newTree; - } - else { - var front = pathGetFront(relativePath); - var child = this.children.get(front) || new ImmutableTree(null); - var newChild = child.setTree(pathPopFront(relativePath), newTree); - var newChildren = void 0; - if (newChild.isEmpty()) { - newChildren = this.children.remove(front); - } - else { - newChildren = this.children.insert(front, newChild); - } - return new ImmutableTree(this.value, newChildren); - } - }; - /** - * Performs a depth first fold on this tree. Transforms a tree into a single - * value, given a function that operates on the path to a node, an optional - * current value, and a map of child names to folded subtrees - */ - ImmutableTree.prototype.fold = function (fn) { - return this.fold_(newEmptyPath(), fn); - }; - /** - * Recursive helper for public-facing fold() method - */ - ImmutableTree.prototype.fold_ = function (pathSoFar, fn) { - var accum = {}; - this.children.inorderTraversal(function (childKey, childTree) { - accum[childKey] = childTree.fold_(pathChild(pathSoFar, childKey), fn); - }); - return fn(pathSoFar, this.value, accum); - }; - /** - * Find the first matching value on the given path. Return the result of applying f to it. - */ - ImmutableTree.prototype.findOnPath = function (path, f) { - return this.findOnPath_(path, newEmptyPath(), f); - }; - ImmutableTree.prototype.findOnPath_ = function (pathToFollow, pathSoFar, f) { - var result = this.value ? f(pathSoFar, this.value) : false; - if (result) { - return result; - } - else { - if (pathIsEmpty(pathToFollow)) { - return null; - } - else { - var front = pathGetFront(pathToFollow); - var nextChild = this.children.get(front); - if (nextChild) { - return nextChild.findOnPath_(pathPopFront(pathToFollow), pathChild(pathSoFar, front), f); - } - else { - return null; - } - } - } - }; - ImmutableTree.prototype.foreachOnPath = function (path, f) { - return this.foreachOnPath_(path, newEmptyPath(), f); - }; - ImmutableTree.prototype.foreachOnPath_ = function (pathToFollow, currentRelativePath, f) { - if (pathIsEmpty(pathToFollow)) { - return this; - } - else { - if (this.value) { - f(currentRelativePath, this.value); - } - var front = pathGetFront(pathToFollow); - var nextChild = this.children.get(front); - if (nextChild) { - return nextChild.foreachOnPath_(pathPopFront(pathToFollow), pathChild(currentRelativePath, front), f); - } - else { - return new ImmutableTree(null); - } - } - }; - /** - * Calls the given function for each node in the tree that has a value. - * - * @param f - A function to be called with the path from the root of the tree to - * a node, and the value at that node. Called in depth-first order. - */ - ImmutableTree.prototype.foreach = function (f) { - this.foreach_(newEmptyPath(), f); - }; - ImmutableTree.prototype.foreach_ = function (currentRelativePath, f) { - this.children.inorderTraversal(function (childName, childTree) { - childTree.foreach_(pathChild(currentRelativePath, childName), f); - }); - if (this.value) { - f(currentRelativePath, this.value); - } - }; - ImmutableTree.prototype.foreachChild = function (f) { - this.children.inorderTraversal(function (childName, childTree) { - if (childTree.value) { - f(childName, childTree.value); - } - }); - }; - return ImmutableTree; -}()); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * This class holds a collection of writes that can be applied to nodes in unison. It abstracts away the logic with - * dealing with priority writes and multiple nested writes. At any given path there is only allowed to be one write - * modifying that path. Any write to an existing path or shadowing an existing path will modify that existing write - * to reflect the write added. - */ -var CompoundWrite = /** @class */ (function () { - function CompoundWrite(writeTree_) { - this.writeTree_ = writeTree_; - } - CompoundWrite.empty = function () { - return new CompoundWrite(new ImmutableTree(null)); - }; - return CompoundWrite; -}()); -function compoundWriteAddWrite(compoundWrite, path, node) { - if (pathIsEmpty(path)) { - return new CompoundWrite(new ImmutableTree(node)); - } - else { - var rootmost = compoundWrite.writeTree_.findRootMostValueAndPath(path); - if (rootmost != null) { - var rootMostPath = rootmost.path; - var value = rootmost.value; - var relativePath = newRelativePath(rootMostPath, path); - value = value.updateChild(relativePath, node); - return new CompoundWrite(compoundWrite.writeTree_.set(rootMostPath, value)); - } - else { - var subtree = new ImmutableTree(node); - var newWriteTree = compoundWrite.writeTree_.setTree(path, subtree); - return new CompoundWrite(newWriteTree); - } - } -} -function compoundWriteAddWrites(compoundWrite, path, updates) { - var newWrite = compoundWrite; - each(updates, function (childKey, node) { - newWrite = compoundWriteAddWrite(newWrite, pathChild(path, childKey), node); - }); - return newWrite; -} -/** - * Will remove a write at the given path and deeper paths. This will not modify a write at a higher - * location, which must be removed by calling this method with that path. - * - * @param compoundWrite - The CompoundWrite to remove. - * @param path - The path at which a write and all deeper writes should be removed - * @returns The new CompoundWrite with the removed path - */ -function compoundWriteRemoveWrite(compoundWrite, path) { - if (pathIsEmpty(path)) { - return CompoundWrite.empty(); - } - else { - var newWriteTree = compoundWrite.writeTree_.setTree(path, new ImmutableTree(null)); - return new CompoundWrite(newWriteTree); - } -} -/** - * Returns whether this CompoundWrite will fully overwrite a node at a given location and can therefore be - * considered "complete". - * - * @param compoundWrite - The CompoundWrite to check. - * @param path - The path to check for - * @returns Whether there is a complete write at that path - */ -function compoundWriteHasCompleteWrite(compoundWrite, path) { - return compoundWriteGetCompleteNode(compoundWrite, path) != null; -} -/** - * Returns a node for a path if and only if the node is a "complete" overwrite at that path. This will not aggregate - * writes from deeper paths, but will return child nodes from a more shallow path. - * - * @param compoundWrite - The CompoundWrite to get the node from. - * @param path - The path to get a complete write - * @returns The node if complete at that path, or null otherwise. - */ -function compoundWriteGetCompleteNode(compoundWrite, path) { - var rootmost = compoundWrite.writeTree_.findRootMostValueAndPath(path); - if (rootmost != null) { - return compoundWrite.writeTree_ - .get(rootmost.path) - .getChild(newRelativePath(rootmost.path, path)); - } - else { - return null; - } -} -/** - * Returns all children that are guaranteed to be a complete overwrite. - * - * @param compoundWrite - The CompoundWrite to get children from. - * @returns A list of all complete children. - */ -function compoundWriteGetCompleteChildren(compoundWrite) { - var children = []; - var node = compoundWrite.writeTree_.value; - if (node != null) { - // If it's a leaf node, it has no children; so nothing to do. - if (!node.isLeafNode()) { - node.forEachChild(PRIORITY_INDEX, function (childName, childNode) { - children.push(new NamedNode(childName, childNode)); - }); - } - } - else { - compoundWrite.writeTree_.children.inorderTraversal(function (childName, childTree) { - if (childTree.value != null) { - children.push(new NamedNode(childName, childTree.value)); - } - }); - } - return children; -} -function compoundWriteChildCompoundWrite(compoundWrite, path) { - if (pathIsEmpty(path)) { - return compoundWrite; - } - else { - var shadowingNode = compoundWriteGetCompleteNode(compoundWrite, path); - if (shadowingNode != null) { - return new CompoundWrite(new ImmutableTree(shadowingNode)); - } - else { - return new CompoundWrite(compoundWrite.writeTree_.subtree(path)); - } - } -} -/** - * Returns true if this CompoundWrite is empty and therefore does not modify any nodes. - * @returns Whether this CompoundWrite is empty - */ -function compoundWriteIsEmpty(compoundWrite) { - return compoundWrite.writeTree_.isEmpty(); -} -/** - * Applies this CompoundWrite to a node. The node is returned with all writes from this CompoundWrite applied to the - * node - * @param node - The node to apply this CompoundWrite to - * @returns The node with all writes applied - */ -function compoundWriteApply(compoundWrite, node) { - return applySubtreeWrite(newEmptyPath(), compoundWrite.writeTree_, node); -} -function applySubtreeWrite(relativePath, writeTree, node) { - if (writeTree.value != null) { - // Since there a write is always a leaf, we're done here - return node.updateChild(relativePath, writeTree.value); - } - else { - var priorityWrite_1 = null; - writeTree.children.inorderTraversal(function (childKey, childTree) { - if (childKey === '.priority') { - // Apply priorities at the end so we don't update priorities for either empty nodes or forget - // to apply priorities to empty nodes that are later filled - util.assert(childTree.value !== null, 'Priority writes must always be leaf nodes'); - priorityWrite_1 = childTree.value; - } - else { - node = applySubtreeWrite(pathChild(relativePath, childKey), childTree, node); - } - }); - // If there was a priority write, we only apply it if the node is not empty - if (!node.getChild(relativePath).isEmpty() && priorityWrite_1 !== null) { - node = node.updateChild(pathChild(relativePath, '.priority'), priorityWrite_1); - } - return node; - } -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Create a new WriteTreeRef for the given path. For use with a new sync point at the given path. - * - */ -function writeTreeChildWrites(writeTree, path) { - return newWriteTreeRef(path, writeTree); -} -/** - * Record a new overwrite from user code. - * - * @param visible - This is set to false by some transactions. It should be excluded from event caches - */ -function writeTreeAddOverwrite(writeTree, path, snap, writeId, visible) { - util.assert(writeId > writeTree.lastWriteId, 'Stacking an older write on top of newer ones'); - if (visible === undefined) { - visible = true; - } - writeTree.allWrites.push({ - path: path, - snap: snap, - writeId: writeId, - visible: visible - }); - if (visible) { - writeTree.visibleWrites = compoundWriteAddWrite(writeTree.visibleWrites, path, snap); - } - writeTree.lastWriteId = writeId; -} -/** - * Record a new merge from user code. - */ -function writeTreeAddMerge(writeTree, path, changedChildren, writeId) { - util.assert(writeId > writeTree.lastWriteId, 'Stacking an older merge on top of newer ones'); - writeTree.allWrites.push({ - path: path, - children: changedChildren, - writeId: writeId, - visible: true - }); - writeTree.visibleWrites = compoundWriteAddWrites(writeTree.visibleWrites, path, changedChildren); - writeTree.lastWriteId = writeId; -} -function writeTreeGetWrite(writeTree, writeId) { - for (var i = 0; i < writeTree.allWrites.length; i++) { - var record = writeTree.allWrites[i]; - if (record.writeId === writeId) { - return record; - } - } - return null; -} -/** - * Remove a write (either an overwrite or merge) that has been successfully acknowledge by the server. Recalculates - * the tree if necessary. We return true if it may have been visible, meaning views need to reevaluate. - * - * @returns true if the write may have been visible (meaning we'll need to reevaluate / raise - * events as a result). - */ -function writeTreeRemoveWrite(writeTree, writeId) { - // Note: disabling this check. It could be a transaction that preempted another transaction, and thus was applied - // out of order. - //const validClear = revert || this.allWrites_.length === 0 || writeId <= this.allWrites_[0].writeId; - //assert(validClear, "Either we don't have this write, or it's the first one in the queue"); - var idx = writeTree.allWrites.findIndex(function (s) { - return s.writeId === writeId; - }); - util.assert(idx >= 0, 'removeWrite called with nonexistent writeId.'); - var writeToRemove = writeTree.allWrites[idx]; - writeTree.allWrites.splice(idx, 1); - var removedWriteWasVisible = writeToRemove.visible; - var removedWriteOverlapsWithOtherWrites = false; - var i = writeTree.allWrites.length - 1; - while (removedWriteWasVisible && i >= 0) { - var currentWrite = writeTree.allWrites[i]; - if (currentWrite.visible) { - if (i >= idx && - writeTreeRecordContainsPath_(currentWrite, writeToRemove.path)) { - // The removed write was completely shadowed by a subsequent write. - removedWriteWasVisible = false; - } - else if (pathContains(writeToRemove.path, currentWrite.path)) { - // Either we're covering some writes or they're covering part of us (depending on which came first). - removedWriteOverlapsWithOtherWrites = true; - } - } - i--; - } - if (!removedWriteWasVisible) { - return false; - } - else if (removedWriteOverlapsWithOtherWrites) { - // There's some shadowing going on. Just rebuild the visible writes from scratch. - writeTreeResetTree_(writeTree); - return true; - } - else { - // There's no shadowing. We can safely just remove the write(s) from visibleWrites. - if (writeToRemove.snap) { - writeTree.visibleWrites = compoundWriteRemoveWrite(writeTree.visibleWrites, writeToRemove.path); - } - else { - var children = writeToRemove.children; - each(children, function (childName) { - writeTree.visibleWrites = compoundWriteRemoveWrite(writeTree.visibleWrites, pathChild(writeToRemove.path, childName)); - }); - } - return true; - } -} -function writeTreeRecordContainsPath_(writeRecord, path) { - if (writeRecord.snap) { - return pathContains(writeRecord.path, path); - } - else { - for (var childName in writeRecord.children) { - if (writeRecord.children.hasOwnProperty(childName) && - pathContains(pathChild(writeRecord.path, childName), path)) { - return true; - } - } - return false; - } -} -/** - * Re-layer the writes and merges into a tree so we can efficiently calculate event snapshots - */ -function writeTreeResetTree_(writeTree) { - writeTree.visibleWrites = writeTreeLayerTree_(writeTree.allWrites, writeTreeDefaultFilter_, newEmptyPath()); - if (writeTree.allWrites.length > 0) { - writeTree.lastWriteId = - writeTree.allWrites[writeTree.allWrites.length - 1].writeId; - } - else { - writeTree.lastWriteId = -1; - } -} -/** - * The default filter used when constructing the tree. Keep everything that's visible. - */ -function writeTreeDefaultFilter_(write) { - return write.visible; -} -/** - * Static method. Given an array of WriteRecords, a filter for which ones to include, and a path, construct the tree of - * event data at that path. - */ -function writeTreeLayerTree_(writes, filter, treeRoot) { - var compoundWrite = CompoundWrite.empty(); - for (var i = 0; i < writes.length; ++i) { - var write = writes[i]; - // Theory, a later set will either: - // a) abort a relevant transaction, so no need to worry about excluding it from calculating that transaction - // b) not be relevant to a transaction (separate branch), so again will not affect the data for that transaction - if (filter(write)) { - var writePath = write.path; - var relativePath = void 0; - if (write.snap) { - if (pathContains(treeRoot, writePath)) { - relativePath = newRelativePath(treeRoot, writePath); - compoundWrite = compoundWriteAddWrite(compoundWrite, relativePath, write.snap); - } - else if (pathContains(writePath, treeRoot)) { - relativePath = newRelativePath(writePath, treeRoot); - compoundWrite = compoundWriteAddWrite(compoundWrite, newEmptyPath(), write.snap.getChild(relativePath)); - } - else ; - } - else if (write.children) { - if (pathContains(treeRoot, writePath)) { - relativePath = newRelativePath(treeRoot, writePath); - compoundWrite = compoundWriteAddWrites(compoundWrite, relativePath, write.children); - } - else if (pathContains(writePath, treeRoot)) { - relativePath = newRelativePath(writePath, treeRoot); - if (pathIsEmpty(relativePath)) { - compoundWrite = compoundWriteAddWrites(compoundWrite, newEmptyPath(), write.children); - } - else { - var child = util.safeGet(write.children, pathGetFront(relativePath)); - if (child) { - // There exists a child in this node that matches the root path - var deepNode = child.getChild(pathPopFront(relativePath)); - compoundWrite = compoundWriteAddWrite(compoundWrite, newEmptyPath(), deepNode); - } - } - } - else ; - } - else { - throw util.assertionError('WriteRecord should have .snap or .children'); - } - } - } - return compoundWrite; -} -/** - * Given optional, underlying server data, and an optional set of constraints (exclude some sets, include hidden - * writes), attempt to calculate a complete snapshot for the given path - * - * @param writeIdsToExclude - An optional set to be excluded - * @param includeHiddenWrites - Defaults to false, whether or not to layer on writes with visible set to false - */ -function writeTreeCalcCompleteEventCache(writeTree, treePath, completeServerCache, writeIdsToExclude, includeHiddenWrites) { - if (!writeIdsToExclude && !includeHiddenWrites) { - var shadowingNode = compoundWriteGetCompleteNode(writeTree.visibleWrites, treePath); - if (shadowingNode != null) { - return shadowingNode; - } - else { - var subMerge = compoundWriteChildCompoundWrite(writeTree.visibleWrites, treePath); - if (compoundWriteIsEmpty(subMerge)) { - return completeServerCache; - } - else if (completeServerCache == null && - !compoundWriteHasCompleteWrite(subMerge, newEmptyPath())) { - // We wouldn't have a complete snapshot, since there's no underlying data and no complete shadow - return null; - } - else { - var layeredCache = completeServerCache || ChildrenNode.EMPTY_NODE; - return compoundWriteApply(subMerge, layeredCache); - } - } - } - else { - var merge = compoundWriteChildCompoundWrite(writeTree.visibleWrites, treePath); - if (!includeHiddenWrites && compoundWriteIsEmpty(merge)) { - return completeServerCache; - } - else { - // If the server cache is null, and we don't have a complete cache, we need to return null - if (!includeHiddenWrites && - completeServerCache == null && - !compoundWriteHasCompleteWrite(merge, newEmptyPath())) { - return null; - } - else { - var filter = function (write) { - return ((write.visible || includeHiddenWrites) && - (!writeIdsToExclude || - !~writeIdsToExclude.indexOf(write.writeId)) && - (pathContains(write.path, treePath) || - pathContains(treePath, write.path))); - }; - var mergeAtPath = writeTreeLayerTree_(writeTree.allWrites, filter, treePath); - var layeredCache = completeServerCache || ChildrenNode.EMPTY_NODE; - return compoundWriteApply(mergeAtPath, layeredCache); - } - } - } -} -/** - * With optional, underlying server data, attempt to return a children node of children that we have complete data for. - * Used when creating new views, to pre-fill their complete event children snapshot. - */ -function writeTreeCalcCompleteEventChildren(writeTree, treePath, completeServerChildren) { - var completeChildren = ChildrenNode.EMPTY_NODE; - var topLevelSet = compoundWriteGetCompleteNode(writeTree.visibleWrites, treePath); - if (topLevelSet) { - if (!topLevelSet.isLeafNode()) { - // we're shadowing everything. Return the children. - topLevelSet.forEachChild(PRIORITY_INDEX, function (childName, childSnap) { - completeChildren = completeChildren.updateImmediateChild(childName, childSnap); - }); - } - return completeChildren; - } - else if (completeServerChildren) { - // Layer any children we have on top of this - // We know we don't have a top-level set, so just enumerate existing children - var merge_1 = compoundWriteChildCompoundWrite(writeTree.visibleWrites, treePath); - completeServerChildren.forEachChild(PRIORITY_INDEX, function (childName, childNode) { - var node = compoundWriteApply(compoundWriteChildCompoundWrite(merge_1, new Path(childName)), childNode); - completeChildren = completeChildren.updateImmediateChild(childName, node); - }); - // Add any complete children we have from the set - compoundWriteGetCompleteChildren(merge_1).forEach(function (namedNode) { - completeChildren = completeChildren.updateImmediateChild(namedNode.name, namedNode.node); - }); - return completeChildren; - } - else { - // We don't have anything to layer on top of. Layer on any children we have - // Note that we can return an empty snap if we have a defined delete - var merge = compoundWriteChildCompoundWrite(writeTree.visibleWrites, treePath); - compoundWriteGetCompleteChildren(merge).forEach(function (namedNode) { - completeChildren = completeChildren.updateImmediateChild(namedNode.name, namedNode.node); - }); - return completeChildren; - } -} -/** - * Given that the underlying server data has updated, determine what, if anything, needs to be - * applied to the event cache. - * - * Possibilities: - * - * 1. No writes are shadowing. Events should be raised, the snap to be applied comes from the server data - * - * 2. Some write is completely shadowing. No events to be raised - * - * 3. Is partially shadowed. Events - * - * Either existingEventSnap or existingServerSnap must exist - */ -function writeTreeCalcEventCacheAfterServerOverwrite(writeTree, treePath, childPath, existingEventSnap, existingServerSnap) { - util.assert(existingEventSnap || existingServerSnap, 'Either existingEventSnap or existingServerSnap must exist'); - var path = pathChild(treePath, childPath); - if (compoundWriteHasCompleteWrite(writeTree.visibleWrites, path)) { - // At this point we can probably guarantee that we're in case 2, meaning no events - // May need to check visibility while doing the findRootMostValueAndPath call - return null; - } - else { - // No complete shadowing. We're either partially shadowing or not shadowing at all. - var childMerge = compoundWriteChildCompoundWrite(writeTree.visibleWrites, path); - if (compoundWriteIsEmpty(childMerge)) { - // We're not shadowing at all. Case 1 - return existingServerSnap.getChild(childPath); - } - else { - // This could be more efficient if the serverNode + updates doesn't change the eventSnap - // However this is tricky to find out, since user updates don't necessary change the server - // snap, e.g. priority updates on empty nodes, or deep deletes. Another special case is if the server - // adds nodes, but doesn't change any existing writes. It is therefore not enough to - // only check if the updates change the serverNode. - // Maybe check if the merge tree contains these special cases and only do a full overwrite in that case? - return compoundWriteApply(childMerge, existingServerSnap.getChild(childPath)); - } - } -} -/** - * Returns a complete child for a given server snap after applying all user writes or null if there is no - * complete child for this ChildKey. - */ -function writeTreeCalcCompleteChild(writeTree, treePath, childKey, existingServerSnap) { - var path = pathChild(treePath, childKey); - var shadowingNode = compoundWriteGetCompleteNode(writeTree.visibleWrites, path); - if (shadowingNode != null) { - return shadowingNode; - } - else { - if (existingServerSnap.isCompleteForChild(childKey)) { - var childMerge = compoundWriteChildCompoundWrite(writeTree.visibleWrites, path); - return compoundWriteApply(childMerge, existingServerSnap.getNode().getImmediateChild(childKey)); - } - else { - return null; - } - } -} -/** - * Returns a node if there is a complete overwrite for this path. More specifically, if there is a write at - * a higher path, this will return the child of that write relative to the write and this path. - * Returns null if there is no write at this path. - */ -function writeTreeShadowingWrite(writeTree, path) { - return compoundWriteGetCompleteNode(writeTree.visibleWrites, path); -} -/** - * This method is used when processing child remove events on a query. If we can, we pull in children that were outside - * the window, but may now be in the window. - */ -function writeTreeCalcIndexedSlice(writeTree, treePath, completeServerData, startPost, count, reverse, index) { - var toIterate; - var merge = compoundWriteChildCompoundWrite(writeTree.visibleWrites, treePath); - var shadowingNode = compoundWriteGetCompleteNode(merge, newEmptyPath()); - if (shadowingNode != null) { - toIterate = shadowingNode; - } - else if (completeServerData != null) { - toIterate = compoundWriteApply(merge, completeServerData); - } - else { - // no children to iterate on - return []; - } - toIterate = toIterate.withIndex(index); - if (!toIterate.isEmpty() && !toIterate.isLeafNode()) { - var nodes = []; - var cmp = index.getCompare(); - var iter = reverse - ? toIterate.getReverseIteratorFrom(startPost, index) - : toIterate.getIteratorFrom(startPost, index); - var next = iter.getNext(); - while (next && nodes.length < count) { - if (cmp(next, startPost) !== 0) { - nodes.push(next); - } - next = iter.getNext(); - } - return nodes; - } - else { - return []; - } -} -function newWriteTree() { - return { - visibleWrites: CompoundWrite.empty(), - allWrites: [], - lastWriteId: -1 - }; -} -/** - * If possible, returns a complete event cache, using the underlying server data if possible. In addition, can be used - * to get a cache that includes hidden writes, and excludes arbitrary writes. Note that customizing the returned node - * can lead to a more expensive calculation. - * - * @param writeIdsToExclude - Optional writes to exclude. - * @param includeHiddenWrites - Defaults to false, whether or not to layer on writes with visible set to false - */ -function writeTreeRefCalcCompleteEventCache(writeTreeRef, completeServerCache, writeIdsToExclude, includeHiddenWrites) { - return writeTreeCalcCompleteEventCache(writeTreeRef.writeTree, writeTreeRef.treePath, completeServerCache, writeIdsToExclude, includeHiddenWrites); -} -/** - * If possible, returns a children node containing all of the complete children we have data for. The returned data is a - * mix of the given server data and write data. - * - */ -function writeTreeRefCalcCompleteEventChildren(writeTreeRef, completeServerChildren) { - return writeTreeCalcCompleteEventChildren(writeTreeRef.writeTree, writeTreeRef.treePath, completeServerChildren); -} -/** - * Given that either the underlying server data has updated or the outstanding writes have updated, determine what, - * if anything, needs to be applied to the event cache. - * - * Possibilities: - * - * 1. No writes are shadowing. Events should be raised, the snap to be applied comes from the server data - * - * 2. Some write is completely shadowing. No events to be raised - * - * 3. Is partially shadowed. Events should be raised - * - * Either existingEventSnap or existingServerSnap must exist, this is validated via an assert - * - * - */ -function writeTreeRefCalcEventCacheAfterServerOverwrite(writeTreeRef, path, existingEventSnap, existingServerSnap) { - return writeTreeCalcEventCacheAfterServerOverwrite(writeTreeRef.writeTree, writeTreeRef.treePath, path, existingEventSnap, existingServerSnap); -} -/** - * Returns a node if there is a complete overwrite for this path. More specifically, if there is a write at - * a higher path, this will return the child of that write relative to the write and this path. - * Returns null if there is no write at this path. - * - */ -function writeTreeRefShadowingWrite(writeTreeRef, path) { - return writeTreeShadowingWrite(writeTreeRef.writeTree, pathChild(writeTreeRef.treePath, path)); -} -/** - * This method is used when processing child remove events on a query. If we can, we pull in children that were outside - * the window, but may now be in the window - */ -function writeTreeRefCalcIndexedSlice(writeTreeRef, completeServerData, startPost, count, reverse, index) { - return writeTreeCalcIndexedSlice(writeTreeRef.writeTree, writeTreeRef.treePath, completeServerData, startPost, count, reverse, index); -} -/** - * Returns a complete child for a given server snap after applying all user writes or null if there is no - * complete child for this ChildKey. - */ -function writeTreeRefCalcCompleteChild(writeTreeRef, childKey, existingServerCache) { - return writeTreeCalcCompleteChild(writeTreeRef.writeTree, writeTreeRef.treePath, childKey, existingServerCache); -} -/** - * Return a WriteTreeRef for a child. - */ -function writeTreeRefChild(writeTreeRef, childName) { - return newWriteTreeRef(pathChild(writeTreeRef.treePath, childName), writeTreeRef.writeTree); -} -function newWriteTreeRef(path, writeTree) { - return { - treePath: path, - writeTree: writeTree - }; -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var ChildChangeAccumulator = /** @class */ (function () { - function ChildChangeAccumulator() { - this.changeMap = new Map(); - } - ChildChangeAccumulator.prototype.trackChildChange = function (change) { - var type = change.type; - var childKey = change.childName; - util.assert(type === "child_added" /* CHILD_ADDED */ || - type === "child_changed" /* CHILD_CHANGED */ || - type === "child_removed" /* CHILD_REMOVED */, 'Only child changes supported for tracking'); - util.assert(childKey !== '.priority', 'Only non-priority child changes can be tracked.'); - var oldChange = this.changeMap.get(childKey); - if (oldChange) { - var oldType = oldChange.type; - if (type === "child_added" /* CHILD_ADDED */ && - oldType === "child_removed" /* CHILD_REMOVED */) { - this.changeMap.set(childKey, changeChildChanged(childKey, change.snapshotNode, oldChange.snapshotNode)); - } - else if (type === "child_removed" /* CHILD_REMOVED */ && - oldType === "child_added" /* CHILD_ADDED */) { - this.changeMap.delete(childKey); - } - else if (type === "child_removed" /* CHILD_REMOVED */ && - oldType === "child_changed" /* CHILD_CHANGED */) { - this.changeMap.set(childKey, changeChildRemoved(childKey, oldChange.oldSnap)); - } - else if (type === "child_changed" /* CHILD_CHANGED */ && - oldType === "child_added" /* CHILD_ADDED */) { - this.changeMap.set(childKey, changeChildAdded(childKey, change.snapshotNode)); - } - else if (type === "child_changed" /* CHILD_CHANGED */ && - oldType === "child_changed" /* CHILD_CHANGED */) { - this.changeMap.set(childKey, changeChildChanged(childKey, change.snapshotNode, oldChange.oldSnap)); - } - else { - throw util.assertionError('Illegal combination of changes: ' + - change + - ' occurred after ' + - oldChange); - } - } - else { - this.changeMap.set(childKey, change); - } - }; - ChildChangeAccumulator.prototype.getChanges = function () { - return Array.from(this.changeMap.values()); - }; - return ChildChangeAccumulator; -}()); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * An implementation of CompleteChildSource that never returns any additional children - */ -// eslint-disable-next-line @typescript-eslint/naming-convention -var NoCompleteChildSource_ = /** @class */ (function () { - function NoCompleteChildSource_() { - } - NoCompleteChildSource_.prototype.getCompleteChild = function (childKey) { - return null; - }; - NoCompleteChildSource_.prototype.getChildAfterChild = function (index, child, reverse) { - return null; - }; - return NoCompleteChildSource_; -}()); -/** - * Singleton instance. - */ -var NO_COMPLETE_CHILD_SOURCE = new NoCompleteChildSource_(); -/** - * An implementation of CompleteChildSource that uses a WriteTree in addition to any other server data or - * old event caches available to calculate complete children. - */ -var WriteTreeCompleteChildSource = /** @class */ (function () { - function WriteTreeCompleteChildSource(writes_, viewCache_, optCompleteServerCache_) { - if (optCompleteServerCache_ === void 0) { optCompleteServerCache_ = null; } - this.writes_ = writes_; - this.viewCache_ = viewCache_; - this.optCompleteServerCache_ = optCompleteServerCache_; - } - WriteTreeCompleteChildSource.prototype.getCompleteChild = function (childKey) { - var node = this.viewCache_.eventCache; - if (node.isCompleteForChild(childKey)) { - return node.getNode().getImmediateChild(childKey); - } - else { - var serverNode = this.optCompleteServerCache_ != null - ? new CacheNode(this.optCompleteServerCache_, true, false) - : this.viewCache_.serverCache; - return writeTreeRefCalcCompleteChild(this.writes_, childKey, serverNode); - } - }; - WriteTreeCompleteChildSource.prototype.getChildAfterChild = function (index, child, reverse) { - var completeServerData = this.optCompleteServerCache_ != null - ? this.optCompleteServerCache_ - : viewCacheGetCompleteServerSnap(this.viewCache_); - var nodes = writeTreeRefCalcIndexedSlice(this.writes_, completeServerData, child, 1, reverse, index); - if (nodes.length === 0) { - return null; - } - else { - return nodes[0]; - } - }; - return WriteTreeCompleteChildSource; -}()); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -function newViewProcessor(filter) { - return { filter: filter }; -} -function viewProcessorAssertIndexed(viewProcessor, viewCache) { - util.assert(viewCache.eventCache.getNode().isIndexed(viewProcessor.filter.getIndex()), 'Event snap not indexed'); - util.assert(viewCache.serverCache.getNode().isIndexed(viewProcessor.filter.getIndex()), 'Server snap not indexed'); -} -function viewProcessorApplyOperation(viewProcessor, oldViewCache, operation, writesCache, completeCache) { - var accumulator = new ChildChangeAccumulator(); - var newViewCache, filterServerNode; - if (operation.type === OperationType.OVERWRITE) { - var overwrite = operation; - if (overwrite.source.fromUser) { - newViewCache = viewProcessorApplyUserOverwrite(viewProcessor, oldViewCache, overwrite.path, overwrite.snap, writesCache, completeCache, accumulator); - } - else { - util.assert(overwrite.source.fromServer, 'Unknown source.'); - // We filter the node if it's a tagged update or the node has been previously filtered and the - // update is not at the root in which case it is ok (and necessary) to mark the node unfiltered - // again - filterServerNode = - overwrite.source.tagged || - (oldViewCache.serverCache.isFiltered() && !pathIsEmpty(overwrite.path)); - newViewCache = viewProcessorApplyServerOverwrite(viewProcessor, oldViewCache, overwrite.path, overwrite.snap, writesCache, completeCache, filterServerNode, accumulator); - } - } - else if (operation.type === OperationType.MERGE) { - var merge = operation; - if (merge.source.fromUser) { - newViewCache = viewProcessorApplyUserMerge(viewProcessor, oldViewCache, merge.path, merge.children, writesCache, completeCache, accumulator); - } - else { - util.assert(merge.source.fromServer, 'Unknown source.'); - // We filter the node if it's a tagged update or the node has been previously filtered - filterServerNode = - merge.source.tagged || oldViewCache.serverCache.isFiltered(); - newViewCache = viewProcessorApplyServerMerge(viewProcessor, oldViewCache, merge.path, merge.children, writesCache, completeCache, filterServerNode, accumulator); - } - } - else if (operation.type === OperationType.ACK_USER_WRITE) { - var ackUserWrite = operation; - if (!ackUserWrite.revert) { - newViewCache = viewProcessorAckUserWrite(viewProcessor, oldViewCache, ackUserWrite.path, ackUserWrite.affectedTree, writesCache, completeCache, accumulator); - } - else { - newViewCache = viewProcessorRevertUserWrite(viewProcessor, oldViewCache, ackUserWrite.path, writesCache, completeCache, accumulator); - } - } - else if (operation.type === OperationType.LISTEN_COMPLETE) { - newViewCache = viewProcessorListenComplete(viewProcessor, oldViewCache, operation.path, writesCache, accumulator); - } - else { - throw util.assertionError('Unknown operation type: ' + operation.type); - } - var changes = accumulator.getChanges(); - viewProcessorMaybeAddValueEvent(oldViewCache, newViewCache, changes); - return { viewCache: newViewCache, changes: changes }; -} -function viewProcessorMaybeAddValueEvent(oldViewCache, newViewCache, accumulator) { - var eventSnap = newViewCache.eventCache; - if (eventSnap.isFullyInitialized()) { - var isLeafOrEmpty = eventSnap.getNode().isLeafNode() || eventSnap.getNode().isEmpty(); - var oldCompleteSnap = viewCacheGetCompleteEventSnap(oldViewCache); - if (accumulator.length > 0 || - !oldViewCache.eventCache.isFullyInitialized() || - (isLeafOrEmpty && !eventSnap.getNode().equals(oldCompleteSnap)) || - !eventSnap.getNode().getPriority().equals(oldCompleteSnap.getPriority())) { - accumulator.push(changeValue(viewCacheGetCompleteEventSnap(newViewCache))); - } - } -} -function viewProcessorGenerateEventCacheAfterServerEvent(viewProcessor, viewCache, changePath, writesCache, source, accumulator) { - var oldEventSnap = viewCache.eventCache; - if (writeTreeRefShadowingWrite(writesCache, changePath) != null) { - // we have a shadowing write, ignore changes - return viewCache; - } - else { - var newEventCache = void 0, serverNode = void 0; - if (pathIsEmpty(changePath)) { - // TODO: figure out how this plays with "sliding ack windows" - util.assert(viewCache.serverCache.isFullyInitialized(), 'If change path is empty, we must have complete server data'); - if (viewCache.serverCache.isFiltered()) { - // We need to special case this, because we need to only apply writes to complete children, or - // we might end up raising events for incomplete children. If the server data is filtered deep - // writes cannot be guaranteed to be complete - var serverCache = viewCacheGetCompleteServerSnap(viewCache); - var completeChildren = serverCache instanceof ChildrenNode - ? serverCache - : ChildrenNode.EMPTY_NODE; - var completeEventChildren = writeTreeRefCalcCompleteEventChildren(writesCache, completeChildren); - newEventCache = viewProcessor.filter.updateFullNode(viewCache.eventCache.getNode(), completeEventChildren, accumulator); - } - else { - var completeNode = writeTreeRefCalcCompleteEventCache(writesCache, viewCacheGetCompleteServerSnap(viewCache)); - newEventCache = viewProcessor.filter.updateFullNode(viewCache.eventCache.getNode(), completeNode, accumulator); - } - } - else { - var childKey = pathGetFront(changePath); - if (childKey === '.priority') { - util.assert(pathGetLength(changePath) === 1, "Can't have a priority with additional path components"); - var oldEventNode = oldEventSnap.getNode(); - serverNode = viewCache.serverCache.getNode(); - // we might have overwrites for this priority - var updatedPriority = writeTreeRefCalcEventCacheAfterServerOverwrite(writesCache, changePath, oldEventNode, serverNode); - if (updatedPriority != null) { - newEventCache = viewProcessor.filter.updatePriority(oldEventNode, updatedPriority); - } - else { - // priority didn't change, keep old node - newEventCache = oldEventSnap.getNode(); - } - } - else { - var childChangePath = pathPopFront(changePath); - // update child - var newEventChild = void 0; - if (oldEventSnap.isCompleteForChild(childKey)) { - serverNode = viewCache.serverCache.getNode(); - var eventChildUpdate = writeTreeRefCalcEventCacheAfterServerOverwrite(writesCache, changePath, oldEventSnap.getNode(), serverNode); - if (eventChildUpdate != null) { - newEventChild = oldEventSnap - .getNode() - .getImmediateChild(childKey) - .updateChild(childChangePath, eventChildUpdate); - } - else { - // Nothing changed, just keep the old child - newEventChild = oldEventSnap.getNode().getImmediateChild(childKey); - } - } - else { - newEventChild = writeTreeRefCalcCompleteChild(writesCache, childKey, viewCache.serverCache); - } - if (newEventChild != null) { - newEventCache = viewProcessor.filter.updateChild(oldEventSnap.getNode(), childKey, newEventChild, childChangePath, source, accumulator); - } - else { - // no complete child available or no change - newEventCache = oldEventSnap.getNode(); - } - } - } - return viewCacheUpdateEventSnap(viewCache, newEventCache, oldEventSnap.isFullyInitialized() || pathIsEmpty(changePath), viewProcessor.filter.filtersNodes()); - } -} -function viewProcessorApplyServerOverwrite(viewProcessor, oldViewCache, changePath, changedSnap, writesCache, completeCache, filterServerNode, accumulator) { - var oldServerSnap = oldViewCache.serverCache; - var newServerCache; - var serverFilter = filterServerNode - ? viewProcessor.filter - : viewProcessor.filter.getIndexedFilter(); - if (pathIsEmpty(changePath)) { - newServerCache = serverFilter.updateFullNode(oldServerSnap.getNode(), changedSnap, null); - } - else if (serverFilter.filtersNodes() && !oldServerSnap.isFiltered()) { - // we want to filter the server node, but we didn't filter the server node yet, so simulate a full update - var newServerNode = oldServerSnap - .getNode() - .updateChild(changePath, changedSnap); - newServerCache = serverFilter.updateFullNode(oldServerSnap.getNode(), newServerNode, null); - } - else { - var childKey = pathGetFront(changePath); - if (!oldServerSnap.isCompleteForPath(changePath) && - pathGetLength(changePath) > 1) { - // We don't update incomplete nodes with updates intended for other listeners - return oldViewCache; - } - var childChangePath = pathPopFront(changePath); - var childNode = oldServerSnap.getNode().getImmediateChild(childKey); - var newChildNode = childNode.updateChild(childChangePath, changedSnap); - if (childKey === '.priority') { - newServerCache = serverFilter.updatePriority(oldServerSnap.getNode(), newChildNode); - } - else { - newServerCache = serverFilter.updateChild(oldServerSnap.getNode(), childKey, newChildNode, childChangePath, NO_COMPLETE_CHILD_SOURCE, null); - } - } - var newViewCache = viewCacheUpdateServerSnap(oldViewCache, newServerCache, oldServerSnap.isFullyInitialized() || pathIsEmpty(changePath), serverFilter.filtersNodes()); - var source = new WriteTreeCompleteChildSource(writesCache, newViewCache, completeCache); - return viewProcessorGenerateEventCacheAfterServerEvent(viewProcessor, newViewCache, changePath, writesCache, source, accumulator); -} -function viewProcessorApplyUserOverwrite(viewProcessor, oldViewCache, changePath, changedSnap, writesCache, completeCache, accumulator) { - var oldEventSnap = oldViewCache.eventCache; - var newViewCache, newEventCache; - var source = new WriteTreeCompleteChildSource(writesCache, oldViewCache, completeCache); - if (pathIsEmpty(changePath)) { - newEventCache = viewProcessor.filter.updateFullNode(oldViewCache.eventCache.getNode(), changedSnap, accumulator); - newViewCache = viewCacheUpdateEventSnap(oldViewCache, newEventCache, true, viewProcessor.filter.filtersNodes()); - } - else { - var childKey = pathGetFront(changePath); - if (childKey === '.priority') { - newEventCache = viewProcessor.filter.updatePriority(oldViewCache.eventCache.getNode(), changedSnap); - newViewCache = viewCacheUpdateEventSnap(oldViewCache, newEventCache, oldEventSnap.isFullyInitialized(), oldEventSnap.isFiltered()); - } - else { - var childChangePath = pathPopFront(changePath); - var oldChild = oldEventSnap.getNode().getImmediateChild(childKey); - var newChild = void 0; - if (pathIsEmpty(childChangePath)) { - // Child overwrite, we can replace the child - newChild = changedSnap; - } - else { - var childNode = source.getCompleteChild(childKey); - if (childNode != null) { - if (pathGetBack(childChangePath) === '.priority' && - childNode.getChild(pathParent(childChangePath)).isEmpty()) { - // This is a priority update on an empty node. If this node exists on the server, the - // server will send down the priority in the update, so ignore for now - newChild = childNode; - } - else { - newChild = childNode.updateChild(childChangePath, changedSnap); - } - } - else { - // There is no complete child node available - newChild = ChildrenNode.EMPTY_NODE; - } - } - if (!oldChild.equals(newChild)) { - var newEventSnap = viewProcessor.filter.updateChild(oldEventSnap.getNode(), childKey, newChild, childChangePath, source, accumulator); - newViewCache = viewCacheUpdateEventSnap(oldViewCache, newEventSnap, oldEventSnap.isFullyInitialized(), viewProcessor.filter.filtersNodes()); - } - else { - newViewCache = oldViewCache; - } - } - } - return newViewCache; -} -function viewProcessorCacheHasChild(viewCache, childKey) { - return viewCache.eventCache.isCompleteForChild(childKey); -} -function viewProcessorApplyUserMerge(viewProcessor, viewCache, path, changedChildren, writesCache, serverCache, accumulator) { - // HACK: In the case of a limit query, there may be some changes that bump things out of the - // window leaving room for new items. It's important we process these changes first, so we - // iterate the changes twice, first processing any that affect items currently in view. - // TODO: I consider an item "in view" if cacheHasChild is true, which checks both the server - // and event snap. I'm not sure if this will result in edge cases when a child is in one but - // not the other. - var curViewCache = viewCache; - changedChildren.foreach(function (relativePath, childNode) { - var writePath = pathChild(path, relativePath); - if (viewProcessorCacheHasChild(viewCache, pathGetFront(writePath))) { - curViewCache = viewProcessorApplyUserOverwrite(viewProcessor, curViewCache, writePath, childNode, writesCache, serverCache, accumulator); - } - }); - changedChildren.foreach(function (relativePath, childNode) { - var writePath = pathChild(path, relativePath); - if (!viewProcessorCacheHasChild(viewCache, pathGetFront(writePath))) { - curViewCache = viewProcessorApplyUserOverwrite(viewProcessor, curViewCache, writePath, childNode, writesCache, serverCache, accumulator); - } - }); - return curViewCache; -} -function viewProcessorApplyMerge(viewProcessor, node, merge) { - merge.foreach(function (relativePath, childNode) { - node = node.updateChild(relativePath, childNode); - }); - return node; -} -function viewProcessorApplyServerMerge(viewProcessor, viewCache, path, changedChildren, writesCache, serverCache, filterServerNode, accumulator) { - // If we don't have a cache yet, this merge was intended for a previously listen in the same location. Ignore it and - // wait for the complete data update coming soon. - if (viewCache.serverCache.getNode().isEmpty() && - !viewCache.serverCache.isFullyInitialized()) { - return viewCache; - } - // HACK: In the case of a limit query, there may be some changes that bump things out of the - // window leaving room for new items. It's important we process these changes first, so we - // iterate the changes twice, first processing any that affect items currently in view. - // TODO: I consider an item "in view" if cacheHasChild is true, which checks both the server - // and event snap. I'm not sure if this will result in edge cases when a child is in one but - // not the other. - var curViewCache = viewCache; - var viewMergeTree; - if (pathIsEmpty(path)) { - viewMergeTree = changedChildren; - } - else { - viewMergeTree = new ImmutableTree(null).setTree(path, changedChildren); - } - var serverNode = viewCache.serverCache.getNode(); - viewMergeTree.children.inorderTraversal(function (childKey, childTree) { - if (serverNode.hasChild(childKey)) { - var serverChild = viewCache.serverCache - .getNode() - .getImmediateChild(childKey); - var newChild = viewProcessorApplyMerge(viewProcessor, serverChild, childTree); - curViewCache = viewProcessorApplyServerOverwrite(viewProcessor, curViewCache, new Path(childKey), newChild, writesCache, serverCache, filterServerNode, accumulator); - } - }); - viewMergeTree.children.inorderTraversal(function (childKey, childMergeTree) { - var isUnknownDeepMerge = !viewCache.serverCache.isCompleteForChild(childKey) && - childMergeTree.value === null; - if (!serverNode.hasChild(childKey) && !isUnknownDeepMerge) { - var serverChild = viewCache.serverCache - .getNode() - .getImmediateChild(childKey); - var newChild = viewProcessorApplyMerge(viewProcessor, serverChild, childMergeTree); - curViewCache = viewProcessorApplyServerOverwrite(viewProcessor, curViewCache, new Path(childKey), newChild, writesCache, serverCache, filterServerNode, accumulator); - } - }); - return curViewCache; -} -function viewProcessorAckUserWrite(viewProcessor, viewCache, ackPath, affectedTree, writesCache, completeCache, accumulator) { - if (writeTreeRefShadowingWrite(writesCache, ackPath) != null) { - return viewCache; - } - // Only filter server node if it is currently filtered - var filterServerNode = viewCache.serverCache.isFiltered(); - // Essentially we'll just get our existing server cache for the affected paths and re-apply it as a server update - // now that it won't be shadowed. - var serverCache = viewCache.serverCache; - if (affectedTree.value != null) { - // This is an overwrite. - if ((pathIsEmpty(ackPath) && serverCache.isFullyInitialized()) || - serverCache.isCompleteForPath(ackPath)) { - return viewProcessorApplyServerOverwrite(viewProcessor, viewCache, ackPath, serverCache.getNode().getChild(ackPath), writesCache, completeCache, filterServerNode, accumulator); - } - else if (pathIsEmpty(ackPath)) { - // This is a goofy edge case where we are acking data at this location but don't have full data. We - // should just re-apply whatever we have in our cache as a merge. - var changedChildren_1 = new ImmutableTree(null); - serverCache.getNode().forEachChild(KEY_INDEX, function (name, node) { - changedChildren_1 = changedChildren_1.set(new Path(name), node); - }); - return viewProcessorApplyServerMerge(viewProcessor, viewCache, ackPath, changedChildren_1, writesCache, completeCache, filterServerNode, accumulator); - } - else { - return viewCache; - } - } - else { - // This is a merge. - var changedChildren_2 = new ImmutableTree(null); - affectedTree.foreach(function (mergePath, value) { - var serverCachePath = pathChild(ackPath, mergePath); - if (serverCache.isCompleteForPath(serverCachePath)) { - changedChildren_2 = changedChildren_2.set(mergePath, serverCache.getNode().getChild(serverCachePath)); - } - }); - return viewProcessorApplyServerMerge(viewProcessor, viewCache, ackPath, changedChildren_2, writesCache, completeCache, filterServerNode, accumulator); - } -} -function viewProcessorListenComplete(viewProcessor, viewCache, path, writesCache, accumulator) { - var oldServerNode = viewCache.serverCache; - var newViewCache = viewCacheUpdateServerSnap(viewCache, oldServerNode.getNode(), oldServerNode.isFullyInitialized() || pathIsEmpty(path), oldServerNode.isFiltered()); - return viewProcessorGenerateEventCacheAfterServerEvent(viewProcessor, newViewCache, path, writesCache, NO_COMPLETE_CHILD_SOURCE, accumulator); -} -function viewProcessorRevertUserWrite(viewProcessor, viewCache, path, writesCache, completeServerCache, accumulator) { - var complete; - if (writeTreeRefShadowingWrite(writesCache, path) != null) { - return viewCache; - } - else { - var source = new WriteTreeCompleteChildSource(writesCache, viewCache, completeServerCache); - var oldEventCache = viewCache.eventCache.getNode(); - var newEventCache = void 0; - if (pathIsEmpty(path) || pathGetFront(path) === '.priority') { - var newNode = void 0; - if (viewCache.serverCache.isFullyInitialized()) { - newNode = writeTreeRefCalcCompleteEventCache(writesCache, viewCacheGetCompleteServerSnap(viewCache)); - } - else { - var serverChildren = viewCache.serverCache.getNode(); - util.assert(serverChildren instanceof ChildrenNode, 'serverChildren would be complete if leaf node'); - newNode = writeTreeRefCalcCompleteEventChildren(writesCache, serverChildren); - } - newNode = newNode; - newEventCache = viewProcessor.filter.updateFullNode(oldEventCache, newNode, accumulator); - } - else { - var childKey = pathGetFront(path); - var newChild = writeTreeRefCalcCompleteChild(writesCache, childKey, viewCache.serverCache); - if (newChild == null && - viewCache.serverCache.isCompleteForChild(childKey)) { - newChild = oldEventCache.getImmediateChild(childKey); - } - if (newChild != null) { - newEventCache = viewProcessor.filter.updateChild(oldEventCache, childKey, newChild, pathPopFront(path), source, accumulator); - } - else if (viewCache.eventCache.getNode().hasChild(childKey)) { - // No complete child available, delete the existing one, if any - newEventCache = viewProcessor.filter.updateChild(oldEventCache, childKey, ChildrenNode.EMPTY_NODE, pathPopFront(path), source, accumulator); - } - else { - newEventCache = oldEventCache; - } - if (newEventCache.isEmpty() && - viewCache.serverCache.isFullyInitialized()) { - // We might have reverted all child writes. Maybe the old event was a leaf node - complete = writeTreeRefCalcCompleteEventCache(writesCache, viewCacheGetCompleteServerSnap(viewCache)); - if (complete.isLeafNode()) { - newEventCache = viewProcessor.filter.updateFullNode(newEventCache, complete, accumulator); - } - } - } - complete = - viewCache.serverCache.isFullyInitialized() || - writeTreeRefShadowingWrite(writesCache, newEmptyPath()) != null; - return viewCacheUpdateEventSnap(viewCache, newEventCache, complete, viewProcessor.filter.filtersNodes()); - } -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * A view represents a specific location and query that has 1 or more event registrations. - * - * It does several things: - * - Maintains the list of event registrations for this location/query. - * - Maintains a cache of the data visible for this location/query. - * - Applies new operations (via applyOperation), updates the cache, and based on the event - * registrations returns the set of events to be raised. - */ -var View = /** @class */ (function () { - function View(query_, initialViewCache) { - this.query_ = query_; - this.eventRegistrations_ = []; - var params = this.query_._queryParams; - var indexFilter = new IndexedFilter(params.getIndex()); - var filter = queryParamsGetNodeFilter(params); - this.processor_ = newViewProcessor(filter); - var initialServerCache = initialViewCache.serverCache; - var initialEventCache = initialViewCache.eventCache; - // Don't filter server node with other filter than index, wait for tagged listen - var serverSnap = indexFilter.updateFullNode(ChildrenNode.EMPTY_NODE, initialServerCache.getNode(), null); - var eventSnap = filter.updateFullNode(ChildrenNode.EMPTY_NODE, initialEventCache.getNode(), null); - var newServerCache = new CacheNode(serverSnap, initialServerCache.isFullyInitialized(), indexFilter.filtersNodes()); - var newEventCache = new CacheNode(eventSnap, initialEventCache.isFullyInitialized(), filter.filtersNodes()); - this.viewCache_ = newViewCache(newEventCache, newServerCache); - this.eventGenerator_ = new EventGenerator(this.query_); - } - Object.defineProperty(View.prototype, "query", { - get: function () { - return this.query_; - }, - enumerable: false, - configurable: true - }); - return View; -}()); -function viewGetServerCache(view) { - return view.viewCache_.serverCache.getNode(); -} -function viewGetCompleteNode(view) { - return viewCacheGetCompleteEventSnap(view.viewCache_); -} -function viewGetCompleteServerCache(view, path) { - var cache = viewCacheGetCompleteServerSnap(view.viewCache_); - if (cache) { - // If this isn't a "loadsAllData" view, then cache isn't actually a complete cache and - // we need to see if it contains the child we're interested in. - if (view.query._queryParams.loadsAllData() || - (!pathIsEmpty(path) && - !cache.getImmediateChild(pathGetFront(path)).isEmpty())) { - return cache.getChild(path); - } - } - return null; -} -function viewIsEmpty(view) { - return view.eventRegistrations_.length === 0; -} -function viewAddEventRegistration(view, eventRegistration) { - view.eventRegistrations_.push(eventRegistration); -} -/** - * @param eventRegistration - If null, remove all callbacks. - * @param cancelError - If a cancelError is provided, appropriate cancel events will be returned. - * @returns Cancel events, if cancelError was provided. - */ -function viewRemoveEventRegistration(view, eventRegistration, cancelError) { - var cancelEvents = []; - if (cancelError) { - util.assert(eventRegistration == null, 'A cancel should cancel all event registrations.'); - var path_1 = view.query._path; - view.eventRegistrations_.forEach(function (registration) { - var maybeEvent = registration.createCancelEvent(cancelError, path_1); - if (maybeEvent) { - cancelEvents.push(maybeEvent); - } - }); - } - if (eventRegistration) { - var remaining = []; - for (var i = 0; i < view.eventRegistrations_.length; ++i) { - var existing = view.eventRegistrations_[i]; - if (!existing.matches(eventRegistration)) { - remaining.push(existing); - } - else if (eventRegistration.hasAnyCallback()) { - // We're removing just this one - remaining = remaining.concat(view.eventRegistrations_.slice(i + 1)); - break; - } - } - view.eventRegistrations_ = remaining; - } - else { - view.eventRegistrations_ = []; - } - return cancelEvents; -} -/** - * Applies the given Operation, updates our cache, and returns the appropriate events. - */ -function viewApplyOperation(view, operation, writesCache, completeServerCache) { - if (operation.type === OperationType.MERGE && - operation.source.queryId !== null) { - util.assert(viewCacheGetCompleteServerSnap(view.viewCache_), 'We should always have a full cache before handling merges'); - util.assert(viewCacheGetCompleteEventSnap(view.viewCache_), 'Missing event cache, even though we have a server cache'); - } - var oldViewCache = view.viewCache_; - var result = viewProcessorApplyOperation(view.processor_, oldViewCache, operation, writesCache, completeServerCache); - viewProcessorAssertIndexed(view.processor_, result.viewCache); - util.assert(result.viewCache.serverCache.isFullyInitialized() || - !oldViewCache.serverCache.isFullyInitialized(), 'Once a server snap is complete, it should never go back'); - view.viewCache_ = result.viewCache; - return viewGenerateEventsForChanges_(view, result.changes, result.viewCache.eventCache.getNode(), null); -} -function viewGetInitialEvents(view, registration) { - var eventSnap = view.viewCache_.eventCache; - var initialChanges = []; - if (!eventSnap.getNode().isLeafNode()) { - var eventNode = eventSnap.getNode(); - eventNode.forEachChild(PRIORITY_INDEX, function (key, childNode) { - initialChanges.push(changeChildAdded(key, childNode)); - }); - } - if (eventSnap.isFullyInitialized()) { - initialChanges.push(changeValue(eventSnap.getNode())); - } - return viewGenerateEventsForChanges_(view, initialChanges, eventSnap.getNode(), registration); -} -function viewGenerateEventsForChanges_(view, changes, eventCache, eventRegistration) { - var registrations = eventRegistration - ? [eventRegistration] - : view.eventRegistrations_; - return eventGeneratorGenerateEventsForChanges(view.eventGenerator_, changes, eventCache, registrations); -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var referenceConstructor$1; -/** - * SyncPoint represents a single location in a SyncTree with 1 or more event registrations, meaning we need to - * maintain 1 or more Views at this location to cache server data and raise appropriate events for server changes - * and user writes (set, transaction, update). - * - * It's responsible for: - * - Maintaining the set of 1 or more views necessary at this location (a SyncPoint with 0 views should be removed). - * - Proxying user / server operations to the views as appropriate (i.e. applyServerOverwrite, - * applyUserOverwrite, etc.) - */ -var SyncPoint = /** @class */ (function () { - function SyncPoint() { - /** - * The Views being tracked at this location in the tree, stored as a map where the key is a - * queryId and the value is the View for that query. - * - * NOTE: This list will be quite small (usually 1, but perhaps 2 or 3; any more is an odd use case). - */ - this.views = new Map(); - } - return SyncPoint; -}()); -function syncPointSetReferenceConstructor(val) { - util.assert(!referenceConstructor$1, '__referenceConstructor has already been defined'); - referenceConstructor$1 = val; -} -function syncPointGetReferenceConstructor() { - util.assert(referenceConstructor$1, 'Reference.ts has not been loaded'); - return referenceConstructor$1; -} -function syncPointIsEmpty(syncPoint) { - return syncPoint.views.size === 0; -} -function syncPointApplyOperation(syncPoint, operation, writesCache, optCompleteServerCache) { - var e_1, _a; - var queryId = operation.source.queryId; - if (queryId !== null) { - var view = syncPoint.views.get(queryId); - util.assert(view != null, 'SyncTree gave us an op for an invalid query.'); - return viewApplyOperation(view, operation, writesCache, optCompleteServerCache); - } - else { - var events = []; - try { - for (var _b = tslib.__values(syncPoint.views.values()), _c = _b.next(); !_c.done; _c = _b.next()) { - var view = _c.value; - events = events.concat(viewApplyOperation(view, operation, writesCache, optCompleteServerCache)); - } - } - catch (e_1_1) { e_1 = { error: e_1_1 }; } - finally { - try { - if (_c && !_c.done && (_a = _b.return)) _a.call(_b); - } - finally { if (e_1) throw e_1.error; } - } - return events; - } -} -/** - * Get a view for the specified query. - * - * @param query - The query to return a view for - * @param writesCache - * @param serverCache - * @param serverCacheComplete - * @returns Events to raise. - */ -function syncPointGetView(syncPoint, query, writesCache, serverCache, serverCacheComplete) { - var queryId = query._queryIdentifier; - var view = syncPoint.views.get(queryId); - if (!view) { - // TODO: make writesCache take flag for complete server node - var eventCache = writeTreeRefCalcCompleteEventCache(writesCache, serverCacheComplete ? serverCache : null); - var eventCacheComplete = false; - if (eventCache) { - eventCacheComplete = true; - } - else if (serverCache instanceof ChildrenNode) { - eventCache = writeTreeRefCalcCompleteEventChildren(writesCache, serverCache); - eventCacheComplete = false; - } - else { - eventCache = ChildrenNode.EMPTY_NODE; - eventCacheComplete = false; - } - var viewCache = newViewCache(new CacheNode(eventCache, eventCacheComplete, false), new CacheNode(serverCache, serverCacheComplete, false)); - return new View(query, viewCache); - } - return view; -} -/** - * Add an event callback for the specified query. - * - * @param query - * @param eventRegistration - * @param writesCache - * @param serverCache - Complete server cache, if we have it. - * @param serverCacheComplete - * @returns Events to raise. - */ -function syncPointAddEventRegistration(syncPoint, query, eventRegistration, writesCache, serverCache, serverCacheComplete) { - var view = syncPointGetView(syncPoint, query, writesCache, serverCache, serverCacheComplete); - if (!syncPoint.views.has(query._queryIdentifier)) { - syncPoint.views.set(query._queryIdentifier, view); - } - // This is guaranteed to exist now, we just created anything that was missing - viewAddEventRegistration(view, eventRegistration); - return viewGetInitialEvents(view, eventRegistration); -} -/** - * Remove event callback(s). Return cancelEvents if a cancelError is specified. - * - * If query is the default query, we'll check all views for the specified eventRegistration. - * If eventRegistration is null, we'll remove all callbacks for the specified view(s). - * - * @param eventRegistration - If null, remove all callbacks. - * @param cancelError - If a cancelError is provided, appropriate cancel events will be returned. - * @returns removed queries and any cancel events - */ -function syncPointRemoveEventRegistration(syncPoint, query, eventRegistration, cancelError) { - var e_2, _a; - var queryId = query._queryIdentifier; - var removed = []; - var cancelEvents = []; - var hadCompleteView = syncPointHasCompleteView(syncPoint); - if (queryId === 'default') { - try { - // When you do ref.off(...), we search all views for the registration to remove. - for (var _b = tslib.__values(syncPoint.views.entries()), _c = _b.next(); !_c.done; _c = _b.next()) { - var _d = tslib.__read(_c.value, 2), viewQueryId = _d[0], view = _d[1]; - cancelEvents = cancelEvents.concat(viewRemoveEventRegistration(view, eventRegistration, cancelError)); - if (viewIsEmpty(view)) { - syncPoint.views.delete(viewQueryId); - // We'll deal with complete views later. - if (!view.query._queryParams.loadsAllData()) { - removed.push(view.query); - } - } - } - } - catch (e_2_1) { e_2 = { error: e_2_1 }; } - finally { - try { - if (_c && !_c.done && (_a = _b.return)) _a.call(_b); - } - finally { if (e_2) throw e_2.error; } - } - } - else { - // remove the callback from the specific view. - var view = syncPoint.views.get(queryId); - if (view) { - cancelEvents = cancelEvents.concat(viewRemoveEventRegistration(view, eventRegistration, cancelError)); - if (viewIsEmpty(view)) { - syncPoint.views.delete(queryId); - // We'll deal with complete views later. - if (!view.query._queryParams.loadsAllData()) { - removed.push(view.query); - } - } - } - } - if (hadCompleteView && !syncPointHasCompleteView(syncPoint)) { - // We removed our last complete view. - removed.push(new (syncPointGetReferenceConstructor())(query._repo, query._path)); - } - return { removed: removed, events: cancelEvents }; -} -function syncPointGetQueryViews(syncPoint) { - var e_3, _a; - var result = []; - try { - for (var _b = tslib.__values(syncPoint.views.values()), _c = _b.next(); !_c.done; _c = _b.next()) { - var view = _c.value; - if (!view.query._queryParams.loadsAllData()) { - result.push(view); - } - } - } - catch (e_3_1) { e_3 = { error: e_3_1 }; } - finally { - try { - if (_c && !_c.done && (_a = _b.return)) _a.call(_b); - } - finally { if (e_3) throw e_3.error; } - } - return result; -} -/** - * @param path - The path to the desired complete snapshot - * @returns A complete cache, if it exists - */ -function syncPointGetCompleteServerCache(syncPoint, path) { - var e_4, _a; - var serverCache = null; - try { - for (var _b = tslib.__values(syncPoint.views.values()), _c = _b.next(); !_c.done; _c = _b.next()) { - var view = _c.value; - serverCache = serverCache || viewGetCompleteServerCache(view, path); - } - } - catch (e_4_1) { e_4 = { error: e_4_1 }; } - finally { - try { - if (_c && !_c.done && (_a = _b.return)) _a.call(_b); - } - finally { if (e_4) throw e_4.error; } - } - return serverCache; -} -function syncPointViewForQuery(syncPoint, query) { - var params = query._queryParams; - if (params.loadsAllData()) { - return syncPointGetCompleteView(syncPoint); - } - else { - var queryId = query._queryIdentifier; - return syncPoint.views.get(queryId); - } -} -function syncPointViewExistsForQuery(syncPoint, query) { - return syncPointViewForQuery(syncPoint, query) != null; -} -function syncPointHasCompleteView(syncPoint) { - return syncPointGetCompleteView(syncPoint) != null; -} -function syncPointGetCompleteView(syncPoint) { - var e_5, _a; - try { - for (var _b = tslib.__values(syncPoint.views.values()), _c = _b.next(); !_c.done; _c = _b.next()) { - var view = _c.value; - if (view.query._queryParams.loadsAllData()) { - return view; - } - } - } - catch (e_5_1) { e_5 = { error: e_5_1 }; } - finally { - try { - if (_c && !_c.done && (_a = _b.return)) _a.call(_b); - } - finally { if (e_5) throw e_5.error; } - } - return null; -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var referenceConstructor; -function syncTreeSetReferenceConstructor(val) { - util.assert(!referenceConstructor, '__referenceConstructor has already been defined'); - referenceConstructor = val; -} -function syncTreeGetReferenceConstructor() { - util.assert(referenceConstructor, 'Reference.ts has not been loaded'); - return referenceConstructor; -} -/** - * Static tracker for next query tag. - */ -var syncTreeNextQueryTag_ = 1; -/** - * SyncTree is the central class for managing event callback registration, data caching, views - * (query processing), and event generation. There are typically two SyncTree instances for - * each Repo, one for the normal Firebase data, and one for the .info data. - * - * It has a number of responsibilities, including: - * - Tracking all user event callbacks (registered via addEventRegistration() and removeEventRegistration()). - * - Applying and caching data changes for user set(), transaction(), and update() calls - * (applyUserOverwrite(), applyUserMerge()). - * - Applying and caching data changes for server data changes (applyServerOverwrite(), - * applyServerMerge()). - * - Generating user-facing events for server and user changes (all of the apply* methods - * return the set of events that need to be raised as a result). - * - Maintaining the appropriate set of server listens to ensure we are always subscribed - * to the correct set of paths and queries to satisfy the current set of user event - * callbacks (listens are started/stopped using the provided listenProvider). - * - * NOTE: Although SyncTree tracks event callbacks and calculates events to raise, the actual - * events are returned to the caller rather than raised synchronously. - * - */ -var SyncTree = /** @class */ (function () { - /** - * @param listenProvider_ - Used by SyncTree to start / stop listening - * to server data. - */ - function SyncTree(listenProvider_) { - this.listenProvider_ = listenProvider_; - /** - * Tree of SyncPoints. There's a SyncPoint at any location that has 1 or more views. - */ - this.syncPointTree_ = new ImmutableTree(null); - /** - * A tree of all pending user writes (user-initiated set()'s, transaction()'s, update()'s, etc.). - */ - this.pendingWriteTree_ = newWriteTree(); - this.tagToQueryMap = new Map(); - this.queryToTagMap = new Map(); - } - return SyncTree; -}()); -/** - * Apply the data changes for a user-generated set() or transaction() call. - * - * @returns Events to raise. - */ -function syncTreeApplyUserOverwrite(syncTree, path, newData, writeId, visible) { - // Record pending write. - writeTreeAddOverwrite(syncTree.pendingWriteTree_, path, newData, writeId, visible); - if (!visible) { - return []; - } - else { - return syncTreeApplyOperationToSyncPoints_(syncTree, new Overwrite(newOperationSourceUser(), path, newData)); - } -} -/** - * Apply the data from a user-generated update() call - * - * @returns Events to raise. - */ -function syncTreeApplyUserMerge(syncTree, path, changedChildren, writeId) { - // Record pending merge. - writeTreeAddMerge(syncTree.pendingWriteTree_, path, changedChildren, writeId); - var changeTree = ImmutableTree.fromObject(changedChildren); - return syncTreeApplyOperationToSyncPoints_(syncTree, new Merge(newOperationSourceUser(), path, changeTree)); -} -/** - * Acknowledge a pending user write that was previously registered with applyUserOverwrite() or applyUserMerge(). - * - * @param revert - True if the given write failed and needs to be reverted - * @returns Events to raise. - */ -function syncTreeAckUserWrite(syncTree, writeId, revert) { - if (revert === void 0) { revert = false; } - var write = writeTreeGetWrite(syncTree.pendingWriteTree_, writeId); - var needToReevaluate = writeTreeRemoveWrite(syncTree.pendingWriteTree_, writeId); - if (!needToReevaluate) { - return []; - } - else { - var affectedTree_1 = new ImmutableTree(null); - if (write.snap != null) { - // overwrite - affectedTree_1 = affectedTree_1.set(newEmptyPath(), true); - } - else { - each(write.children, function (pathString) { - affectedTree_1 = affectedTree_1.set(new Path(pathString), true); - }); - } - return syncTreeApplyOperationToSyncPoints_(syncTree, new AckUserWrite(write.path, affectedTree_1, revert)); - } -} -/** - * Apply new server data for the specified path.. - * - * @returns Events to raise. - */ -function syncTreeApplyServerOverwrite(syncTree, path, newData) { - return syncTreeApplyOperationToSyncPoints_(syncTree, new Overwrite(newOperationSourceServer(), path, newData)); -} -/** - * Apply new server data to be merged in at the specified path. - * - * @returns Events to raise. - */ -function syncTreeApplyServerMerge(syncTree, path, changedChildren) { - var changeTree = ImmutableTree.fromObject(changedChildren); - return syncTreeApplyOperationToSyncPoints_(syncTree, new Merge(newOperationSourceServer(), path, changeTree)); -} -/** - * Apply a listen complete for a query - * - * @returns Events to raise. - */ -function syncTreeApplyListenComplete(syncTree, path) { - return syncTreeApplyOperationToSyncPoints_(syncTree, new ListenComplete(newOperationSourceServer(), path)); -} -/** - * Apply a listen complete for a tagged query - * - * @returns Events to raise. - */ -function syncTreeApplyTaggedListenComplete(syncTree, path, tag) { - var queryKey = syncTreeQueryKeyForTag_(syncTree, tag); - if (queryKey) { - var r = syncTreeParseQueryKey_(queryKey); - var queryPath = r.path, queryId = r.queryId; - var relativePath = newRelativePath(queryPath, path); - var op = new ListenComplete(newOperationSourceServerTaggedQuery(queryId), relativePath); - return syncTreeApplyTaggedOperation_(syncTree, queryPath, op); - } - else { - // We've already removed the query. No big deal, ignore the update - return []; - } -} -/** - * Remove event callback(s). - * - * If query is the default query, we'll check all queries for the specified eventRegistration. - * If eventRegistration is null, we'll remove all callbacks for the specified query/queries. - * - * @param eventRegistration - If null, all callbacks are removed. - * @param cancelError - If a cancelError is provided, appropriate cancel events will be returned. - * @param skipListenerDedup - When performing a `get()`, we don't add any new listeners, so no - * deduping needs to take place. This flag allows toggling of that behavior - * @returns Cancel events, if cancelError was provided. - */ -function syncTreeRemoveEventRegistration(syncTree, query, eventRegistration, cancelError, skipListenerDedup) { - if (skipListenerDedup === void 0) { skipListenerDedup = false; } - // Find the syncPoint first. Then deal with whether or not it has matching listeners - var path = query._path; - var maybeSyncPoint = syncTree.syncPointTree_.get(path); - var cancelEvents = []; - // A removal on a default query affects all queries at that location. A removal on an indexed query, even one without - // other query constraints, does *not* affect all queries at that location. So this check must be for 'default', and - // not loadsAllData(). - if (maybeSyncPoint && - (query._queryIdentifier === 'default' || - syncPointViewExistsForQuery(maybeSyncPoint, query))) { - var removedAndEvents = syncPointRemoveEventRegistration(maybeSyncPoint, query, eventRegistration, cancelError); - if (syncPointIsEmpty(maybeSyncPoint)) { - syncTree.syncPointTree_ = syncTree.syncPointTree_.remove(path); - } - var removed = removedAndEvents.removed; - cancelEvents = removedAndEvents.events; - if (!skipListenerDedup) { - /** - * We may have just removed one of many listeners and can short-circuit this whole process - * We may also not have removed a default listener, in which case all of the descendant listeners should already be - * properly set up. - */ - // Since indexed queries can shadow if they don't have other query constraints, check for loadsAllData(), instead of - // queryId === 'default' - var removingDefault = -1 !== - removed.findIndex(function (query) { - return query._queryParams.loadsAllData(); - }); - var covered = syncTree.syncPointTree_.findOnPath(path, function (relativePath, parentSyncPoint) { - return syncPointHasCompleteView(parentSyncPoint); - }); - if (removingDefault && !covered) { - var subtree = syncTree.syncPointTree_.subtree(path); - // There are potentially child listeners. Determine what if any listens we need to send before executing the - // removal - if (!subtree.isEmpty()) { - // We need to fold over our subtree and collect the listeners to send - var newViews = syncTreeCollectDistinctViewsForSubTree_(subtree); - // Ok, we've collected all the listens we need. Set them up. - for (var i = 0; i < newViews.length; ++i) { - var view = newViews[i], newQuery = view.query; - var listener = syncTreeCreateListenerForView_(syncTree, view); - syncTree.listenProvider_.startListening(syncTreeQueryForListening_(newQuery), syncTreeTagForQuery(syncTree, newQuery), listener.hashFn, listener.onComplete); - } - } - // Otherwise there's nothing below us, so nothing we need to start listening on - } - // If we removed anything and we're not covered by a higher up listen, we need to stop listening on this query - // The above block has us covered in terms of making sure we're set up on listens lower in the tree. - // Also, note that if we have a cancelError, it's already been removed at the provider level. - if (!covered && removed.length > 0 && !cancelError) { - // If we removed a default, then we weren't listening on any of the other queries here. Just cancel the one - // default. Otherwise, we need to iterate through and cancel each individual query - if (removingDefault) { - // We don't tag default listeners - var defaultTag = null; - syncTree.listenProvider_.stopListening(syncTreeQueryForListening_(query), defaultTag); - } - else { - removed.forEach(function (queryToRemove) { - var tagToRemove = syncTree.queryToTagMap.get(syncTreeMakeQueryKey_(queryToRemove)); - syncTree.listenProvider_.stopListening(syncTreeQueryForListening_(queryToRemove), tagToRemove); - }); - } - } - } - // Now, clear all of the tags we're tracking for the removed listens - syncTreeRemoveTags_(syncTree, removed); - } - return cancelEvents; -} -/** - * Apply new server data for the specified tagged query. - * - * @returns Events to raise. - */ -function syncTreeApplyTaggedQueryOverwrite(syncTree, path, snap, tag) { - var queryKey = syncTreeQueryKeyForTag_(syncTree, tag); - if (queryKey != null) { - var r = syncTreeParseQueryKey_(queryKey); - var queryPath = r.path, queryId = r.queryId; - var relativePath = newRelativePath(queryPath, path); - var op = new Overwrite(newOperationSourceServerTaggedQuery(queryId), relativePath, snap); - return syncTreeApplyTaggedOperation_(syncTree, queryPath, op); - } - else { - // Query must have been removed already - return []; - } -} -/** - * Apply server data to be merged in for the specified tagged query. - * - * @returns Events to raise. - */ -function syncTreeApplyTaggedQueryMerge(syncTree, path, changedChildren, tag) { - var queryKey = syncTreeQueryKeyForTag_(syncTree, tag); - if (queryKey) { - var r = syncTreeParseQueryKey_(queryKey); - var queryPath = r.path, queryId = r.queryId; - var relativePath = newRelativePath(queryPath, path); - var changeTree = ImmutableTree.fromObject(changedChildren); - var op = new Merge(newOperationSourceServerTaggedQuery(queryId), relativePath, changeTree); - return syncTreeApplyTaggedOperation_(syncTree, queryPath, op); - } - else { - // We've already removed the query. No big deal, ignore the update - return []; - } -} -/** - * Add an event callback for the specified query. - * - * @returns Events to raise. - */ -function syncTreeAddEventRegistration(syncTree, query, eventRegistration, skipSetupListener) { - if (skipSetupListener === void 0) { skipSetupListener = false; } - var path = query._path; - var serverCache = null; - var foundAncestorDefaultView = false; - // Any covering writes will necessarily be at the root, so really all we need to find is the server cache. - // Consider optimizing this once there's a better understanding of what actual behavior will be. - syncTree.syncPointTree_.foreachOnPath(path, function (pathToSyncPoint, sp) { - var relativePath = newRelativePath(pathToSyncPoint, path); - serverCache = - serverCache || syncPointGetCompleteServerCache(sp, relativePath); - foundAncestorDefaultView = - foundAncestorDefaultView || syncPointHasCompleteView(sp); - }); - var syncPoint = syncTree.syncPointTree_.get(path); - if (!syncPoint) { - syncPoint = new SyncPoint(); - syncTree.syncPointTree_ = syncTree.syncPointTree_.set(path, syncPoint); - } - else { - foundAncestorDefaultView = - foundAncestorDefaultView || syncPointHasCompleteView(syncPoint); - serverCache = - serverCache || syncPointGetCompleteServerCache(syncPoint, newEmptyPath()); - } - var serverCacheComplete; - if (serverCache != null) { - serverCacheComplete = true; - } - else { - serverCacheComplete = false; - serverCache = ChildrenNode.EMPTY_NODE; - var subtree = syncTree.syncPointTree_.subtree(path); - subtree.foreachChild(function (childName, childSyncPoint) { - var completeCache = syncPointGetCompleteServerCache(childSyncPoint, newEmptyPath()); - if (completeCache) { - serverCache = serverCache.updateImmediateChild(childName, completeCache); - } - }); - } - var viewAlreadyExists = syncPointViewExistsForQuery(syncPoint, query); - if (!viewAlreadyExists && !query._queryParams.loadsAllData()) { - // We need to track a tag for this query - var queryKey = syncTreeMakeQueryKey_(query); - util.assert(!syncTree.queryToTagMap.has(queryKey), 'View does not exist, but we have a tag'); - var tag = syncTreeGetNextQueryTag_(); - syncTree.queryToTagMap.set(queryKey, tag); - syncTree.tagToQueryMap.set(tag, queryKey); - } - var writesCache = writeTreeChildWrites(syncTree.pendingWriteTree_, path); - var events = syncPointAddEventRegistration(syncPoint, query, eventRegistration, writesCache, serverCache, serverCacheComplete); - if (!viewAlreadyExists && !foundAncestorDefaultView && !skipSetupListener) { - var view = syncPointViewForQuery(syncPoint, query); - events = events.concat(syncTreeSetupListener_(syncTree, query, view)); - } - return events; -} -/** - * Returns a complete cache, if we have one, of the data at a particular path. If the location does not have a - * listener above it, we will get a false "null". This shouldn't be a problem because transactions will always - * have a listener above, and atomic operations would correctly show a jitter of -> - * as the write is applied locally and then acknowledged at the server. - * - * Note: this method will *include* hidden writes from transaction with applyLocally set to false. - * - * @param path - The path to the data we want - * @param writeIdsToExclude - A specific set to be excluded - */ -function syncTreeCalcCompleteEventCache(syncTree, path, writeIdsToExclude) { - var includeHiddenSets = true; - var writeTree = syncTree.pendingWriteTree_; - var serverCache = syncTree.syncPointTree_.findOnPath(path, function (pathSoFar, syncPoint) { - var relativePath = newRelativePath(pathSoFar, path); - var serverCache = syncPointGetCompleteServerCache(syncPoint, relativePath); - if (serverCache) { - return serverCache; - } - }); - return writeTreeCalcCompleteEventCache(writeTree, path, serverCache, writeIdsToExclude, includeHiddenSets); -} -function syncTreeGetServerValue(syncTree, query) { - var path = query._path; - var serverCache = null; - // Any covering writes will necessarily be at the root, so really all we need to find is the server cache. - // Consider optimizing this once there's a better understanding of what actual behavior will be. - syncTree.syncPointTree_.foreachOnPath(path, function (pathToSyncPoint, sp) { - var relativePath = newRelativePath(pathToSyncPoint, path); - serverCache = - serverCache || syncPointGetCompleteServerCache(sp, relativePath); - }); - var syncPoint = syncTree.syncPointTree_.get(path); - if (!syncPoint) { - syncPoint = new SyncPoint(); - syncTree.syncPointTree_ = syncTree.syncPointTree_.set(path, syncPoint); - } - else { - serverCache = - serverCache || syncPointGetCompleteServerCache(syncPoint, newEmptyPath()); - } - var serverCacheComplete = serverCache != null; - var serverCacheNode = serverCacheComplete - ? new CacheNode(serverCache, true, false) - : null; - var writesCache = writeTreeChildWrites(syncTree.pendingWriteTree_, query._path); - var view = syncPointGetView(syncPoint, query, writesCache, serverCacheComplete ? serverCacheNode.getNode() : ChildrenNode.EMPTY_NODE, serverCacheComplete); - return viewGetCompleteNode(view); -} -/** - * A helper method that visits all descendant and ancestor SyncPoints, applying the operation. - * - * NOTES: - * - Descendant SyncPoints will be visited first (since we raise events depth-first). - * - * - We call applyOperation() on each SyncPoint passing three things: - * 1. A version of the Operation that has been made relative to the SyncPoint location. - * 2. A WriteTreeRef of any writes we have cached at the SyncPoint location. - * 3. A snapshot Node with cached server data, if we have it. - * - * - We concatenate all of the events returned by each SyncPoint and return the result. - */ -function syncTreeApplyOperationToSyncPoints_(syncTree, operation) { - return syncTreeApplyOperationHelper_(operation, syncTree.syncPointTree_, - /*serverCache=*/ null, writeTreeChildWrites(syncTree.pendingWriteTree_, newEmptyPath())); -} -/** - * Recursive helper for applyOperationToSyncPoints_ - */ -function syncTreeApplyOperationHelper_(operation, syncPointTree, serverCache, writesCache) { - if (pathIsEmpty(operation.path)) { - return syncTreeApplyOperationDescendantsHelper_(operation, syncPointTree, serverCache, writesCache); - } - else { - var syncPoint = syncPointTree.get(newEmptyPath()); - // If we don't have cached server data, see if we can get it from this SyncPoint. - if (serverCache == null && syncPoint != null) { - serverCache = syncPointGetCompleteServerCache(syncPoint, newEmptyPath()); - } - var events = []; - var childName = pathGetFront(operation.path); - var childOperation = operation.operationForChild(childName); - var childTree = syncPointTree.children.get(childName); - if (childTree && childOperation) { - var childServerCache = serverCache - ? serverCache.getImmediateChild(childName) - : null; - var childWritesCache = writeTreeRefChild(writesCache, childName); - events = events.concat(syncTreeApplyOperationHelper_(childOperation, childTree, childServerCache, childWritesCache)); - } - if (syncPoint) { - events = events.concat(syncPointApplyOperation(syncPoint, operation, writesCache, serverCache)); - } - return events; - } -} -/** - * Recursive helper for applyOperationToSyncPoints_ - */ -function syncTreeApplyOperationDescendantsHelper_(operation, syncPointTree, serverCache, writesCache) { - var syncPoint = syncPointTree.get(newEmptyPath()); - // If we don't have cached server data, see if we can get it from this SyncPoint. - if (serverCache == null && syncPoint != null) { - serverCache = syncPointGetCompleteServerCache(syncPoint, newEmptyPath()); - } - var events = []; - syncPointTree.children.inorderTraversal(function (childName, childTree) { - var childServerCache = serverCache - ? serverCache.getImmediateChild(childName) - : null; - var childWritesCache = writeTreeRefChild(writesCache, childName); - var childOperation = operation.operationForChild(childName); - if (childOperation) { - events = events.concat(syncTreeApplyOperationDescendantsHelper_(childOperation, childTree, childServerCache, childWritesCache)); - } - }); - if (syncPoint) { - events = events.concat(syncPointApplyOperation(syncPoint, operation, writesCache, serverCache)); - } - return events; -} -function syncTreeCreateListenerForView_(syncTree, view) { - var query = view.query; - var tag = syncTreeTagForQuery(syncTree, query); - return { - hashFn: function () { - var cache = viewGetServerCache(view) || ChildrenNode.EMPTY_NODE; - return cache.hash(); - }, - onComplete: function (status) { - if (status === 'ok') { - if (tag) { - return syncTreeApplyTaggedListenComplete(syncTree, query._path, tag); - } - else { - return syncTreeApplyListenComplete(syncTree, query._path); - } - } - else { - // If a listen failed, kill all of the listeners here, not just the one that triggered the error. - // Note that this may need to be scoped to just this listener if we change permissions on filtered children - var error = errorForServerCode(status, query); - return syncTreeRemoveEventRegistration(syncTree, query, - /*eventRegistration*/ null, error); - } - } - }; -} -/** - * Return the tag associated with the given query. - */ -function syncTreeTagForQuery(syncTree, query) { - var queryKey = syncTreeMakeQueryKey_(query); - return syncTree.queryToTagMap.get(queryKey); -} -/** - * Given a query, computes a "queryKey" suitable for use in our queryToTagMap_. - */ -function syncTreeMakeQueryKey_(query) { - return query._path.toString() + '$' + query._queryIdentifier; -} -/** - * Return the query associated with the given tag, if we have one - */ -function syncTreeQueryKeyForTag_(syncTree, tag) { - return syncTree.tagToQueryMap.get(tag); -} -/** - * Given a queryKey (created by makeQueryKey), parse it back into a path and queryId. - */ -function syncTreeParseQueryKey_(queryKey) { - var splitIndex = queryKey.indexOf('$'); - util.assert(splitIndex !== -1 && splitIndex < queryKey.length - 1, 'Bad queryKey.'); - return { - queryId: queryKey.substr(splitIndex + 1), - path: new Path(queryKey.substr(0, splitIndex)) - }; -} -/** - * A helper method to apply tagged operations - */ -function syncTreeApplyTaggedOperation_(syncTree, queryPath, operation) { - var syncPoint = syncTree.syncPointTree_.get(queryPath); - util.assert(syncPoint, "Missing sync point for query tag that we're tracking"); - var writesCache = writeTreeChildWrites(syncTree.pendingWriteTree_, queryPath); - return syncPointApplyOperation(syncPoint, operation, writesCache, null); -} -/** - * This collapses multiple unfiltered views into a single view, since we only need a single - * listener for them. - */ -function syncTreeCollectDistinctViewsForSubTree_(subtree) { - return subtree.fold(function (relativePath, maybeChildSyncPoint, childMap) { - if (maybeChildSyncPoint && syncPointHasCompleteView(maybeChildSyncPoint)) { - var completeView = syncPointGetCompleteView(maybeChildSyncPoint); - return [completeView]; - } - else { - // No complete view here, flatten any deeper listens into an array - var views_1 = []; - if (maybeChildSyncPoint) { - views_1 = syncPointGetQueryViews(maybeChildSyncPoint); - } - each(childMap, function (_key, childViews) { - views_1 = views_1.concat(childViews); - }); - return views_1; - } - }); -} -/** - * Normalizes a query to a query we send the server for listening - * - * @returns The normalized query - */ -function syncTreeQueryForListening_(query) { - if (query._queryParams.loadsAllData() && !query._queryParams.isDefault()) { - // We treat queries that load all data as default queries - // Cast is necessary because ref() technically returns Firebase which is actually fb.api.Firebase which inherits - // from Query - return new (syncTreeGetReferenceConstructor())(query._repo, query._path); - } - else { - return query; - } -} -function syncTreeRemoveTags_(syncTree, queries) { - for (var j = 0; j < queries.length; ++j) { - var removedQuery = queries[j]; - if (!removedQuery._queryParams.loadsAllData()) { - // We should have a tag for this - var removedQueryKey = syncTreeMakeQueryKey_(removedQuery); - var removedQueryTag = syncTree.queryToTagMap.get(removedQueryKey); - syncTree.queryToTagMap.delete(removedQueryKey); - syncTree.tagToQueryMap.delete(removedQueryTag); - } - } -} -/** - * Static accessor for query tags. - */ -function syncTreeGetNextQueryTag_() { - return syncTreeNextQueryTag_++; -} -/** - * For a given new listen, manage the de-duplication of outstanding subscriptions. - * - * @returns This method can return events to support synchronous data sources - */ -function syncTreeSetupListener_(syncTree, query, view) { - var path = query._path; - var tag = syncTreeTagForQuery(syncTree, query); - var listener = syncTreeCreateListenerForView_(syncTree, view); - var events = syncTree.listenProvider_.startListening(syncTreeQueryForListening_(query), tag, listener.hashFn, listener.onComplete); - var subtree = syncTree.syncPointTree_.subtree(path); - // The root of this subtree has our query. We're here because we definitely need to send a listen for that, but we - // may need to shadow other listens as well. - if (tag) { - util.assert(!syncPointHasCompleteView(subtree.value), "If we're adding a query, it shouldn't be shadowed"); - } - else { - // Shadow everything at or below this location, this is a default listener. - var queriesToStop = subtree.fold(function (relativePath, maybeChildSyncPoint, childMap) { - if (!pathIsEmpty(relativePath) && - maybeChildSyncPoint && - syncPointHasCompleteView(maybeChildSyncPoint)) { - return [syncPointGetCompleteView(maybeChildSyncPoint).query]; - } - else { - // No default listener here, flatten any deeper queries into an array - var queries_1 = []; - if (maybeChildSyncPoint) { - queries_1 = queries_1.concat(syncPointGetQueryViews(maybeChildSyncPoint).map(function (view) { return view.query; })); - } - each(childMap, function (_key, childQueries) { - queries_1 = queries_1.concat(childQueries); - }); - return queries_1; - } - }); - for (var i = 0; i < queriesToStop.length; ++i) { - var queryToStop = queriesToStop[i]; - syncTree.listenProvider_.stopListening(syncTreeQueryForListening_(queryToStop), syncTreeTagForQuery(syncTree, queryToStop)); - } - } - return events; -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var ExistingValueProvider = /** @class */ (function () { - function ExistingValueProvider(node_) { - this.node_ = node_; - } - ExistingValueProvider.prototype.getImmediateChild = function (childName) { - var child = this.node_.getImmediateChild(childName); - return new ExistingValueProvider(child); - }; - ExistingValueProvider.prototype.node = function () { - return this.node_; - }; - return ExistingValueProvider; -}()); -var DeferredValueProvider = /** @class */ (function () { - function DeferredValueProvider(syncTree, path) { - this.syncTree_ = syncTree; - this.path_ = path; - } - DeferredValueProvider.prototype.getImmediateChild = function (childName) { - var childPath = pathChild(this.path_, childName); - return new DeferredValueProvider(this.syncTree_, childPath); - }; - DeferredValueProvider.prototype.node = function () { - return syncTreeCalcCompleteEventCache(this.syncTree_, this.path_); - }; - return DeferredValueProvider; -}()); -/** - * Generate placeholders for deferred values. - */ -var generateWithValues = function (values) { - values = values || {}; - values['timestamp'] = values['timestamp'] || new Date().getTime(); - return values; -}; -/** - * Value to use when firing local events. When writing server values, fire - * local events with an approximate value, otherwise return value as-is. - */ -var resolveDeferredLeafValue = function (value, existingVal, serverValues) { - if (!value || typeof value !== 'object') { - return value; - } - util.assert('.sv' in value, 'Unexpected leaf node or priority contents'); - if (typeof value['.sv'] === 'string') { - return resolveScalarDeferredValue(value['.sv'], existingVal, serverValues); - } - else if (typeof value['.sv'] === 'object') { - return resolveComplexDeferredValue(value['.sv'], existingVal); - } - else { - util.assert(false, 'Unexpected server value: ' + JSON.stringify(value, null, 2)); - } -}; -var resolveScalarDeferredValue = function (op, existing, serverValues) { - switch (op) { - case 'timestamp': - return serverValues['timestamp']; - default: - util.assert(false, 'Unexpected server value: ' + op); - } -}; -var resolveComplexDeferredValue = function (op, existing, unused) { - if (!op.hasOwnProperty('increment')) { - util.assert(false, 'Unexpected server value: ' + JSON.stringify(op, null, 2)); - } - var delta = op['increment']; - if (typeof delta !== 'number') { - util.assert(false, 'Unexpected increment value: ' + delta); - } - var existingNode = existing.node(); - util.assert(existingNode !== null && typeof existingNode !== 'undefined', 'Expected ChildrenNode.EMPTY_NODE for nulls'); - // Incrementing a non-number sets the value to the incremented amount - if (!existingNode.isLeafNode()) { - return delta; - } - var leaf = existingNode; - var existingVal = leaf.getValue(); - if (typeof existingVal !== 'number') { - return delta; - } - // No need to do over/underflow arithmetic here because JS only handles floats under the covers - return existingVal + delta; -}; -/** - * Recursively replace all deferred values and priorities in the tree with the - * specified generated replacement values. - * @param path - path to which write is relative - * @param node - new data written at path - * @param syncTree - current data - */ -var resolveDeferredValueTree = function (path, node, syncTree, serverValues) { - return resolveDeferredValue(node, new DeferredValueProvider(syncTree, path), serverValues); -}; -/** - * Recursively replace all deferred values and priorities in the node with the - * specified generated replacement values. If there are no server values in the node, - * it'll be returned as-is. - */ -var resolveDeferredValueSnapshot = function (node, existing, serverValues) { - return resolveDeferredValue(node, new ExistingValueProvider(existing), serverValues); -}; -function resolveDeferredValue(node, existingVal, serverValues) { - var rawPri = node.getPriority().val(); - var priority = resolveDeferredLeafValue(rawPri, existingVal.getImmediateChild('.priority'), serverValues); - var newNode; - if (node.isLeafNode()) { - var leafNode = node; - var value = resolveDeferredLeafValue(leafNode.getValue(), existingVal, serverValues); - if (value !== leafNode.getValue() || - priority !== leafNode.getPriority().val()) { - return new LeafNode(value, nodeFromJSON(priority)); - } - else { - return node; - } - } - else { - var childrenNode = node; - newNode = childrenNode; - if (priority !== childrenNode.getPriority().val()) { - newNode = newNode.updatePriority(new LeafNode(priority)); - } - childrenNode.forEachChild(PRIORITY_INDEX, function (childName, childNode) { - var newChildNode = resolveDeferredValue(childNode, existingVal.getImmediateChild(childName), serverValues); - if (newChildNode !== childNode) { - newNode = newNode.updateImmediateChild(childName, newChildNode); - } - }); - return newNode; - } -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * A light-weight tree, traversable by path. Nodes can have both values and children. - * Nodes are not enumerated (by forEachChild) unless they have a value or non-empty - * children. - */ -var Tree = /** @class */ (function () { - /** - * @param name - Optional name of the node. - * @param parent - Optional parent node. - * @param node - Optional node to wrap. - */ - function Tree(name, parent, node) { - if (name === void 0) { name = ''; } - if (parent === void 0) { parent = null; } - if (node === void 0) { node = { children: {}, childCount: 0 }; } - this.name = name; - this.parent = parent; - this.node = node; - } - return Tree; -}()); -/** - * Returns a sub-Tree for the given path. - * - * @param pathObj - Path to look up. - * @returns Tree for path. - */ -function treeSubTree(tree, pathObj) { - // TODO: Require pathObj to be Path? - var path = pathObj instanceof Path ? pathObj : new Path(pathObj); - var child = tree, next = pathGetFront(path); - while (next !== null) { - var childNode = util.safeGet(child.node.children, next) || { - children: {}, - childCount: 0 - }; - child = new Tree(next, child, childNode); - path = pathPopFront(path); - next = pathGetFront(path); - } - return child; -} -/** - * Returns the data associated with this tree node. - * - * @returns The data or null if no data exists. - */ -function treeGetValue(tree) { - return tree.node.value; -} -/** - * Sets data to this tree node. - * - * @param value - Value to set. - */ -function treeSetValue(tree, value) { - tree.node.value = value; - treeUpdateParents(tree); -} -/** - * @returns Whether the tree has any children. - */ -function treeHasChildren(tree) { - return tree.node.childCount > 0; -} -/** - * @returns Whethe rthe tree is empty (no value or children). - */ -function treeIsEmpty(tree) { - return treeGetValue(tree) === undefined && !treeHasChildren(tree); -} -/** - * Calls action for each child of this tree node. - * - * @param action - Action to be called for each child. - */ -function treeForEachChild(tree, action) { - each(tree.node.children, function (child, childTree) { - action(new Tree(child, tree, childTree)); - }); -} -/** - * Does a depth-first traversal of this node's descendants, calling action for each one. - * - * @param action - Action to be called for each child. - * @param includeSelf - Whether to call action on this node as well. Defaults to - * false. - * @param childrenFirst - Whether to call action on children before calling it on - * parent. - */ -function treeForEachDescendant(tree, action, includeSelf, childrenFirst) { - if (includeSelf && !childrenFirst) { - action(tree); - } - treeForEachChild(tree, function (child) { - treeForEachDescendant(child, action, true, childrenFirst); - }); - if (includeSelf && childrenFirst) { - action(tree); - } -} -/** - * Calls action on each ancestor node. - * - * @param action - Action to be called on each parent; return - * true to abort. - * @param includeSelf - Whether to call action on this node as well. - * @returns true if the action callback returned true. - */ -function treeForEachAncestor(tree, action, includeSelf) { - var node = includeSelf ? tree : tree.parent; - while (node !== null) { - if (action(node)) { - return true; - } - node = node.parent; - } - return false; -} -/** - * @returns The path of this tree node, as a Path. - */ -function treeGetPath(tree) { - return new Path(tree.parent === null - ? tree.name - : treeGetPath(tree.parent) + '/' + tree.name); -} -/** - * Adds or removes this child from its parent based on whether it's empty or not. - */ -function treeUpdateParents(tree) { - if (tree.parent !== null) { - treeUpdateChild(tree.parent, tree.name, tree); - } -} -/** - * Adds or removes the passed child to this tree node, depending on whether it's empty. - * - * @param childName - The name of the child to update. - * @param child - The child to update. - */ -function treeUpdateChild(tree, childName, child) { - var childEmpty = treeIsEmpty(child); - var childExists = util.contains(tree.node.children, childName); - if (childEmpty && childExists) { - delete tree.node.children[childName]; - tree.node.childCount--; - treeUpdateParents(tree); - } - else if (!childEmpty && !childExists) { - tree.node.children[childName] = child.node; - tree.node.childCount++; - treeUpdateParents(tree); - } -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * True for invalid Firebase keys - */ -var INVALID_KEY_REGEX_ = /[\[\].#$\/\u0000-\u001F\u007F]/; -/** - * True for invalid Firebase paths. - * Allows '/' in paths. - */ -var INVALID_PATH_REGEX_ = /[\[\].#$\u0000-\u001F\u007F]/; -/** - * Maximum number of characters to allow in leaf value - */ -var MAX_LEAF_SIZE_ = 10 * 1024 * 1024; -var isValidKey = function (key) { - return (typeof key === 'string' && key.length !== 0 && !INVALID_KEY_REGEX_.test(key)); -}; -var isValidPathString = function (pathString) { - return (typeof pathString === 'string' && - pathString.length !== 0 && - !INVALID_PATH_REGEX_.test(pathString)); -}; -var isValidRootPathString = function (pathString) { - if (pathString) { - // Allow '/.info/' at the beginning. - pathString = pathString.replace(/^\/*\.info(\/|$)/, '/'); - } - return isValidPathString(pathString); -}; -var isValidPriority = function (priority) { - return (priority === null || - typeof priority === 'string' || - (typeof priority === 'number' && !isInvalidJSONNumber(priority)) || - (priority && - typeof priority === 'object' && - // eslint-disable-next-line @typescript-eslint/no-explicit-any - util.contains(priority, '.sv'))); -}; -/** - * Pre-validate a datum passed as an argument to Firebase function. - */ -var validateFirebaseDataArg = function (fnName, value, path, optional) { - if (optional && value === undefined) { - return; - } - validateFirebaseData(util.errorPrefix(fnName, 'value'), value, path); -}; -/** - * Validate a data object client-side before sending to server. - */ -var validateFirebaseData = function (errorPrefix, data, path_) { - var path = path_ instanceof Path ? new ValidationPath(path_, errorPrefix) : path_; - if (data === undefined) { - throw new Error(errorPrefix + 'contains undefined ' + validationPathToErrorString(path)); - } - if (typeof data === 'function') { - throw new Error(errorPrefix + - 'contains a function ' + - validationPathToErrorString(path) + - ' with contents = ' + - data.toString()); - } - if (isInvalidJSONNumber(data)) { - throw new Error(errorPrefix + - 'contains ' + - data.toString() + - ' ' + - validationPathToErrorString(path)); - } - // Check max leaf size, but try to avoid the utf8 conversion if we can. - if (typeof data === 'string' && - data.length > MAX_LEAF_SIZE_ / 3 && - util.stringLength(data) > MAX_LEAF_SIZE_) { - throw new Error(errorPrefix + - 'contains a string greater than ' + - MAX_LEAF_SIZE_ + - ' utf8 bytes ' + - validationPathToErrorString(path) + - " ('" + - data.substring(0, 50) + - "...')"); - } - // TODO = Perf = Consider combining the recursive validation of keys into NodeFromJSON - // to save extra walking of large objects. - if (data && typeof data === 'object') { - var hasDotValue_1 = false; - var hasActualChild_1 = false; - each(data, function (key, value) { - if (key === '.value') { - hasDotValue_1 = true; - } - else if (key !== '.priority' && key !== '.sv') { - hasActualChild_1 = true; - if (!isValidKey(key)) { - throw new Error(errorPrefix + - ' contains an invalid key (' + - key + - ') ' + - validationPathToErrorString(path) + - '. Keys must be non-empty strings ' + - 'and can\'t contain ".", "#", "$", "/", "[", or "]"'); - } - } - validationPathPush(path, key); - validateFirebaseData(errorPrefix, value, path); - validationPathPop(path); - }); - if (hasDotValue_1 && hasActualChild_1) { - throw new Error(errorPrefix + - ' contains ".value" child ' + - validationPathToErrorString(path) + - ' in addition to actual children.'); - } - } -}; -/** - * Pre-validate paths passed in the firebase function. - */ -var validateFirebaseMergePaths = function (errorPrefix, mergePaths) { - var i, curPath; - for (i = 0; i < mergePaths.length; i++) { - curPath = mergePaths[i]; - var keys = pathSlice(curPath); - for (var j = 0; j < keys.length; j++) { - if (keys[j] === '.priority' && j === keys.length - 1) ; - else if (!isValidKey(keys[j])) { - throw new Error(errorPrefix + - 'contains an invalid key (' + - keys[j] + - ') in path ' + - curPath.toString() + - '. Keys must be non-empty strings ' + - 'and can\'t contain ".", "#", "$", "/", "[", or "]"'); - } - } - } - // Check that update keys are not descendants of each other. - // We rely on the property that sorting guarantees that ancestors come - // right before descendants. - mergePaths.sort(pathCompare); - var prevPath = null; - for (i = 0; i < mergePaths.length; i++) { - curPath = mergePaths[i]; - if (prevPath !== null && pathContains(prevPath, curPath)) { - throw new Error(errorPrefix + - 'contains a path ' + - prevPath.toString() + - ' that is ancestor of another path ' + - curPath.toString()); - } - prevPath = curPath; - } -}; -/** - * pre-validate an object passed as an argument to firebase function ( - * must be an object - e.g. for firebase.update()). - */ -var validateFirebaseMergeDataArg = function (fnName, data, path, optional) { - if (optional && data === undefined) { - return; - } - var errorPrefix = util.errorPrefix(fnName, 'values'); - if (!(data && typeof data === 'object') || Array.isArray(data)) { - throw new Error(errorPrefix + ' must be an object containing the children to replace.'); - } - var mergePaths = []; - each(data, function (key, value) { - var curPath = new Path(key); - validateFirebaseData(errorPrefix, value, pathChild(path, curPath)); - if (pathGetBack(curPath) === '.priority') { - if (!isValidPriority(value)) { - throw new Error(errorPrefix + - "contains an invalid value for '" + - curPath.toString() + - "', which must be a valid " + - 'Firebase priority (a string, finite number, server value, or null).'); - } - } - mergePaths.push(curPath); - }); - validateFirebaseMergePaths(errorPrefix, mergePaths); -}; -var validatePriority = function (fnName, priority, optional) { - if (optional && priority === undefined) { - return; - } - if (isInvalidJSONNumber(priority)) { - throw new Error(util.errorPrefix(fnName, 'priority') + - 'is ' + - priority.toString() + - ', but must be a valid Firebase priority (a string, finite number, ' + - 'server value, or null).'); - } - // Special case to allow importing data with a .sv. - if (!isValidPriority(priority)) { - throw new Error(util.errorPrefix(fnName, 'priority') + - 'must be a valid Firebase priority ' + - '(a string, finite number, server value, or null).'); - } -}; -var validateKey = function (fnName, argumentName, key, optional) { - if (optional && key === undefined) { - return; - } - if (!isValidKey(key)) { - throw new Error(util.errorPrefix(fnName, argumentName) + - 'was an invalid key = "' + - key + - '". Firebase keys must be non-empty strings and ' + - 'can\'t contain ".", "#", "$", "/", "[", or "]").'); - } -}; -/** - * @internal - */ -var validatePathString = function (fnName, argumentName, pathString, optional) { - if (optional && pathString === undefined) { - return; - } - if (!isValidPathString(pathString)) { - throw new Error(util.errorPrefix(fnName, argumentName) + - 'was an invalid path = "' + - pathString + - '". Paths must be non-empty strings and ' + - 'can\'t contain ".", "#", "$", "[", or "]"'); - } -}; -var validateRootPathString = function (fnName, argumentName, pathString, optional) { - if (pathString) { - // Allow '/.info/' at the beginning. - pathString = pathString.replace(/^\/*\.info(\/|$)/, '/'); - } - validatePathString(fnName, argumentName, pathString, optional); -}; -/** - * @internal - */ -var validateWritablePath = function (fnName, path) { - if (pathGetFront(path) === '.info') { - throw new Error(fnName + " failed = Can't modify data under /.info/"); - } -}; -var validateUrl = function (fnName, parsedUrl) { - // TODO = Validate server better. - var pathString = parsedUrl.path.toString(); - if (!(typeof parsedUrl.repoInfo.host === 'string') || - parsedUrl.repoInfo.host.length === 0 || - (!isValidKey(parsedUrl.repoInfo.namespace) && - parsedUrl.repoInfo.host.split(':')[0] !== 'localhost') || - (pathString.length !== 0 && !isValidRootPathString(pathString))) { - throw new Error(util.errorPrefix(fnName, 'url') + - 'must be a valid firebase URL and ' + - 'the path can\'t contain ".", "#", "$", "[", or "]".'); - } -}; - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * The event queue serves a few purposes: - * 1. It ensures we maintain event order in the face of event callbacks doing operations that result in more - * events being queued. - * 2. raiseQueuedEvents() handles being called reentrantly nicely. That is, if in the course of raising events, - * raiseQueuedEvents() is called again, the "inner" call will pick up raising events where the "outer" call - * left off, ensuring that the events are still raised synchronously and in order. - * 3. You can use raiseEventsAtPath and raiseEventsForChangedPath to ensure only relevant previously-queued - * events are raised synchronously. - * - * NOTE: This can all go away if/when we move to async events. - * - */ -var EventQueue = /** @class */ (function () { - function EventQueue() { - this.eventLists_ = []; - /** - * Tracks recursion depth of raiseQueuedEvents_, for debugging purposes. - */ - this.recursionDepth_ = 0; - } - return EventQueue; -}()); -/** - * @param eventDataList - The new events to queue. - */ -function eventQueueQueueEvents(eventQueue, eventDataList) { - // We group events by path, storing them in a single EventList, to make it easier to skip over them quickly. - var currList = null; - for (var i = 0; i < eventDataList.length; i++) { - var data = eventDataList[i]; - var path = data.getPath(); - if (currList !== null && !pathEquals(path, currList.path)) { - eventQueue.eventLists_.push(currList); - currList = null; - } - if (currList === null) { - currList = { events: [], path: path }; - } - currList.events.push(data); - } - if (currList) { - eventQueue.eventLists_.push(currList); - } -} -/** - * Queues the specified events and synchronously raises all events (including previously queued ones) - * for the specified path. - * - * It is assumed that the new events are all for the specified path. - * - * @param path - The path to raise events for. - * @param eventDataList - The new events to raise. - */ -function eventQueueRaiseEventsAtPath(eventQueue, path, eventDataList) { - eventQueueQueueEvents(eventQueue, eventDataList); - eventQueueRaiseQueuedEventsMatchingPredicate(eventQueue, function (eventPath) { - return pathEquals(eventPath, path); - }); -} -/** - * Queues the specified events and synchronously raises all events (including previously queued ones) for - * locations related to the specified change path (i.e. all ancestors and descendants). - * - * It is assumed that the new events are all related (ancestor or descendant) to the specified path. - * - * @param changedPath - The path to raise events for. - * @param eventDataList - The events to raise - */ -function eventQueueRaiseEventsForChangedPath(eventQueue, changedPath, eventDataList) { - eventQueueQueueEvents(eventQueue, eventDataList); - eventQueueRaiseQueuedEventsMatchingPredicate(eventQueue, function (eventPath) { - return pathContains(eventPath, changedPath) || - pathContains(changedPath, eventPath); - }); -} -function eventQueueRaiseQueuedEventsMatchingPredicate(eventQueue, predicate) { - eventQueue.recursionDepth_++; - var sentAll = true; - for (var i = 0; i < eventQueue.eventLists_.length; i++) { - var eventList = eventQueue.eventLists_[i]; - if (eventList) { - var eventPath = eventList.path; - if (predicate(eventPath)) { - eventListRaise(eventQueue.eventLists_[i]); - eventQueue.eventLists_[i] = null; - } - else { - sentAll = false; - } - } - } - if (sentAll) { - eventQueue.eventLists_ = []; - } - eventQueue.recursionDepth_--; -} -/** - * Iterates through the list and raises each event - */ -function eventListRaise(eventList) { - for (var i = 0; i < eventList.events.length; i++) { - var eventData = eventList.events[i]; - if (eventData !== null) { - eventList.events[i] = null; - var eventFn = eventData.getEventRunner(); - if (logger) { - log('event: ' + eventData.toString()); - } - exceptionGuard(eventFn); - } - } -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var INTERRUPT_REASON = 'repo_interrupt'; -/** - * If a transaction does not succeed after 25 retries, we abort it. Among other - * things this ensure that if there's ever a bug causing a mismatch between - * client / server hashes for some data, we won't retry indefinitely. - */ -var MAX_TRANSACTION_RETRIES = 25; -/** - * A connection to a single data repository. - */ -var Repo = /** @class */ (function () { - function Repo(repoInfo_, forceRestClient_, authTokenProvider_, appCheckProvider_) { - this.repoInfo_ = repoInfo_; - this.forceRestClient_ = forceRestClient_; - this.authTokenProvider_ = authTokenProvider_; - this.appCheckProvider_ = appCheckProvider_; - this.dataUpdateCount = 0; - this.statsListener_ = null; - this.eventQueue_ = new EventQueue(); - this.nextWriteId_ = 1; - this.interceptServerDataCallback_ = null; - /** A list of data pieces and paths to be set when this client disconnects. */ - this.onDisconnect_ = newSparseSnapshotTree(); - /** Stores queues of outstanding transactions for Firebase locations. */ - this.transactionQueueTree_ = new Tree(); - // TODO: This should be @private but it's used by test_access.js and internal.js - this.persistentConnection_ = null; - // This key is intentionally not updated if RepoInfo is later changed or replaced - this.key = this.repoInfo_.toURLString(); - } - /** - * @returns The URL corresponding to the root of this Firebase. - */ - Repo.prototype.toString = function () { - return ((this.repoInfo_.secure ? 'https://' : 'http://') + this.repoInfo_.host); - }; - return Repo; -}()); -function repoStart(repo, appId, authOverride) { - repo.stats_ = statsManagerGetCollection(repo.repoInfo_); - if (repo.forceRestClient_ || beingCrawled()) { - repo.server_ = new ReadonlyRestClient(repo.repoInfo_, function (pathString, data, isMerge, tag) { - repoOnDataUpdate(repo, pathString, data, isMerge, tag); - }, repo.authTokenProvider_, repo.appCheckProvider_); - // Minor hack: Fire onConnect immediately, since there's no actual connection. - setTimeout(function () { return repoOnConnectStatus(repo, /* connectStatus= */ true); }, 0); - } - else { - // Validate authOverride - if (typeof authOverride !== 'undefined' && authOverride !== null) { - if (typeof authOverride !== 'object') { - throw new Error('Only objects are supported for option databaseAuthVariableOverride'); - } - try { - util.stringify(authOverride); - } - catch (e) { - throw new Error('Invalid authOverride provided: ' + e); - } - } - repo.persistentConnection_ = new PersistentConnection(repo.repoInfo_, appId, function (pathString, data, isMerge, tag) { - repoOnDataUpdate(repo, pathString, data, isMerge, tag); - }, function (connectStatus) { - repoOnConnectStatus(repo, connectStatus); - }, function (updates) { - repoOnServerInfoUpdate(repo, updates); - }, repo.authTokenProvider_, repo.appCheckProvider_, authOverride); - repo.server_ = repo.persistentConnection_; - } - repo.authTokenProvider_.addTokenChangeListener(function (token) { - repo.server_.refreshAuthToken(token); - }); - repo.appCheckProvider_.addTokenChangeListener(function (result) { - repo.server_.refreshAppCheckToken(result.token); - }); - // In the case of multiple Repos for the same repoInfo (i.e. there are multiple Firebase.Contexts being used), - // we only want to create one StatsReporter. As such, we'll report stats over the first Repo created. - repo.statsReporter_ = statsManagerGetOrCreateReporter(repo.repoInfo_, function () { return new StatsReporter(repo.stats_, repo.server_); }); - // Used for .info. - repo.infoData_ = new SnapshotHolder(); - repo.infoSyncTree_ = new SyncTree({ - startListening: function (query, tag, currentHashFn, onComplete) { - var infoEvents = []; - var node = repo.infoData_.getNode(query._path); - // This is possibly a hack, but we have different semantics for .info endpoints. We don't raise null events - // on initial data... - if (!node.isEmpty()) { - infoEvents = syncTreeApplyServerOverwrite(repo.infoSyncTree_, query._path, node); - setTimeout(function () { - onComplete('ok'); - }, 0); - } - return infoEvents; - }, - stopListening: function () { } - }); - repoUpdateInfo(repo, 'connected', false); - repo.serverSyncTree_ = new SyncTree({ - startListening: function (query, tag, currentHashFn, onComplete) { - repo.server_.listen(query, currentHashFn, tag, function (status, data) { - var events = onComplete(status, data); - eventQueueRaiseEventsForChangedPath(repo.eventQueue_, query._path, events); - }); - // No synchronous events for network-backed sync trees - return []; - }, - stopListening: function (query, tag) { - repo.server_.unlisten(query, tag); - } - }); -} -/** - * @returns The time in milliseconds, taking the server offset into account if we have one. - */ -function repoServerTime(repo) { - var offsetNode = repo.infoData_.getNode(new Path('.info/serverTimeOffset')); - var offset = offsetNode.val() || 0; - return new Date().getTime() + offset; -} -/** - * Generate ServerValues using some variables from the repo object. - */ -function repoGenerateServerValues(repo) { - return generateWithValues({ - timestamp: repoServerTime(repo) - }); -} -/** - * Called by realtime when we get new messages from the server. - */ -function repoOnDataUpdate(repo, pathString, data, isMerge, tag) { - // For testing. - repo.dataUpdateCount++; - var path = new Path(pathString); - data = repo.interceptServerDataCallback_ - ? repo.interceptServerDataCallback_(pathString, data) - : data; - var events = []; - if (tag) { - if (isMerge) { - var taggedChildren = util.map(data, function (raw) { return nodeFromJSON(raw); }); - events = syncTreeApplyTaggedQueryMerge(repo.serverSyncTree_, path, taggedChildren, tag); - } - else { - var taggedSnap = nodeFromJSON(data); - events = syncTreeApplyTaggedQueryOverwrite(repo.serverSyncTree_, path, taggedSnap, tag); - } - } - else if (isMerge) { - var changedChildren = util.map(data, function (raw) { return nodeFromJSON(raw); }); - events = syncTreeApplyServerMerge(repo.serverSyncTree_, path, changedChildren); - } - else { - var snap = nodeFromJSON(data); - events = syncTreeApplyServerOverwrite(repo.serverSyncTree_, path, snap); - } - var affectedPath = path; - if (events.length > 0) { - // Since we have a listener outstanding for each transaction, receiving any events - // is a proxy for some change having occurred. - affectedPath = repoRerunTransactions(repo, path); - } - eventQueueRaiseEventsForChangedPath(repo.eventQueue_, affectedPath, events); -} -function repoOnConnectStatus(repo, connectStatus) { - repoUpdateInfo(repo, 'connected', connectStatus); - if (connectStatus === false) { - repoRunOnDisconnectEvents(repo); - } -} -function repoOnServerInfoUpdate(repo, updates) { - each(updates, function (key, value) { - repoUpdateInfo(repo, key, value); - }); -} -function repoUpdateInfo(repo, pathString, value) { - var path = new Path('/.info/' + pathString); - var newNode = nodeFromJSON(value); - repo.infoData_.updateSnapshot(path, newNode); - var events = syncTreeApplyServerOverwrite(repo.infoSyncTree_, path, newNode); - eventQueueRaiseEventsForChangedPath(repo.eventQueue_, path, events); -} -function repoGetNextWriteId(repo) { - return repo.nextWriteId_++; -} -/** - * The purpose of `getValue` is to return the latest known value - * satisfying `query`. - * - * This method will first check for in-memory cached values - * belonging to active listeners. If they are found, such values - * are considered to be the most up-to-date. - * - * If the client is not connected, this method will wait until the - * repo has established a connection and then request the value for `query`. - * If the client is not able to retrieve the query result for another reason, - * it reports an error. - * - * @param query - The query to surface a value for. - */ -function repoGetValue(repo, query, eventRegistration) { - // Only active queries are cached. There is no persisted cache. - var cached = syncTreeGetServerValue(repo.serverSyncTree_, query); - if (cached != null) { - return Promise.resolve(cached); - } - return repo.server_.get(query).then(function (payload) { - var node = nodeFromJSON(payload).withIndex(query._queryParams.getIndex()); - /** - * Below we simulate the actions of an `onlyOnce` `onValue()` event where: - * Add an event registration, - * Update data at the path, - * Raise any events, - * Cleanup the SyncTree - */ - syncTreeAddEventRegistration(repo.serverSyncTree_, query, eventRegistration, true); - var events; - if (query._queryParams.loadsAllData()) { - events = syncTreeApplyServerOverwrite(repo.serverSyncTree_, query._path, node); - } - else { - var tag = syncTreeTagForQuery(repo.serverSyncTree_, query); - events = syncTreeApplyTaggedQueryOverwrite(repo.serverSyncTree_, query._path, node, tag); - } - /* - * We need to raise events in the scenario where `get()` is called at a parent path, and - * while the `get()` is pending, `onValue` is called at a child location. While get() is waiting - * for the data, `onValue` will register a new event. Then, get() will come back, and update the syncTree - * and its corresponding serverCache, including the child location where `onValue` is called. Then, - * `onValue` will receive the event from the server, but look at the syncTree and see that the data received - * from the server is already at the SyncPoint, and so the `onValue` callback will never get fired. - * Calling `eventQueueRaiseEventsForChangedPath()` is the correct way to propagate the events and - * ensure the corresponding child events will get fired. - */ - eventQueueRaiseEventsForChangedPath(repo.eventQueue_, query._path, events); - syncTreeRemoveEventRegistration(repo.serverSyncTree_, query, eventRegistration, null, true); - return node; - }, function (err) { - repoLog(repo, 'get for query ' + util.stringify(query) + ' failed: ' + err); - return Promise.reject(new Error(err)); - }); -} -function repoSetWithPriority(repo, path, newVal, newPriority, onComplete) { - repoLog(repo, 'set', { - path: path.toString(), - value: newVal, - priority: newPriority - }); - // TODO: Optimize this behavior to either (a) store flag to skip resolving where possible and / or - // (b) store unresolved paths on JSON parse - var serverValues = repoGenerateServerValues(repo); - var newNodeUnresolved = nodeFromJSON(newVal, newPriority); - var existing = syncTreeCalcCompleteEventCache(repo.serverSyncTree_, path); - var newNode = resolveDeferredValueSnapshot(newNodeUnresolved, existing, serverValues); - var writeId = repoGetNextWriteId(repo); - var events = syncTreeApplyUserOverwrite(repo.serverSyncTree_, path, newNode, writeId, true); - eventQueueQueueEvents(repo.eventQueue_, events); - repo.server_.put(path.toString(), newNodeUnresolved.val(/*export=*/ true), function (status, errorReason) { - var success = status === 'ok'; - if (!success) { - warn('set at ' + path + ' failed: ' + status); - } - var clearEvents = syncTreeAckUserWrite(repo.serverSyncTree_, writeId, !success); - eventQueueRaiseEventsForChangedPath(repo.eventQueue_, path, clearEvents); - repoCallOnCompleteCallback(repo, onComplete, status, errorReason); - }); - var affectedPath = repoAbortTransactions(repo, path); - repoRerunTransactions(repo, affectedPath); - // We queued the events above, so just flush the queue here - eventQueueRaiseEventsForChangedPath(repo.eventQueue_, affectedPath, []); -} -function repoUpdate(repo, path, childrenToMerge, onComplete) { - repoLog(repo, 'update', { path: path.toString(), value: childrenToMerge }); - // Start with our existing data and merge each child into it. - var empty = true; - var serverValues = repoGenerateServerValues(repo); - var changedChildren = {}; - each(childrenToMerge, function (changedKey, changedValue) { - empty = false; - changedChildren[changedKey] = resolveDeferredValueTree(pathChild(path, changedKey), nodeFromJSON(changedValue), repo.serverSyncTree_, serverValues); - }); - if (!empty) { - var writeId_1 = repoGetNextWriteId(repo); - var events = syncTreeApplyUserMerge(repo.serverSyncTree_, path, changedChildren, writeId_1); - eventQueueQueueEvents(repo.eventQueue_, events); - repo.server_.merge(path.toString(), childrenToMerge, function (status, errorReason) { - var success = status === 'ok'; - if (!success) { - warn('update at ' + path + ' failed: ' + status); - } - var clearEvents = syncTreeAckUserWrite(repo.serverSyncTree_, writeId_1, !success); - var affectedPath = clearEvents.length > 0 ? repoRerunTransactions(repo, path) : path; - eventQueueRaiseEventsForChangedPath(repo.eventQueue_, affectedPath, clearEvents); - repoCallOnCompleteCallback(repo, onComplete, status, errorReason); - }); - each(childrenToMerge, function (changedPath) { - var affectedPath = repoAbortTransactions(repo, pathChild(path, changedPath)); - repoRerunTransactions(repo, affectedPath); - }); - // We queued the events above, so just flush the queue here - eventQueueRaiseEventsForChangedPath(repo.eventQueue_, path, []); - } - else { - log("update() called with empty data. Don't do anything."); - repoCallOnCompleteCallback(repo, onComplete, 'ok', undefined); - } -} -/** - * Applies all of the changes stored up in the onDisconnect_ tree. - */ -function repoRunOnDisconnectEvents(repo) { - repoLog(repo, 'onDisconnectEvents'); - var serverValues = repoGenerateServerValues(repo); - var resolvedOnDisconnectTree = newSparseSnapshotTree(); - sparseSnapshotTreeForEachTree(repo.onDisconnect_, newEmptyPath(), function (path, node) { - var resolved = resolveDeferredValueTree(path, node, repo.serverSyncTree_, serverValues); - sparseSnapshotTreeRemember(resolvedOnDisconnectTree, path, resolved); - }); - var events = []; - sparseSnapshotTreeForEachTree(resolvedOnDisconnectTree, newEmptyPath(), function (path, snap) { - events = events.concat(syncTreeApplyServerOverwrite(repo.serverSyncTree_, path, snap)); - var affectedPath = repoAbortTransactions(repo, path); - repoRerunTransactions(repo, affectedPath); - }); - repo.onDisconnect_ = newSparseSnapshotTree(); - eventQueueRaiseEventsForChangedPath(repo.eventQueue_, newEmptyPath(), events); -} -function repoOnDisconnectCancel(repo, path, onComplete) { - repo.server_.onDisconnectCancel(path.toString(), function (status, errorReason) { - if (status === 'ok') { - sparseSnapshotTreeForget(repo.onDisconnect_, path); - } - repoCallOnCompleteCallback(repo, onComplete, status, errorReason); - }); -} -function repoOnDisconnectSet(repo, path, value, onComplete) { - var newNode = nodeFromJSON(value); - repo.server_.onDisconnectPut(path.toString(), newNode.val(/*export=*/ true), function (status, errorReason) { - if (status === 'ok') { - sparseSnapshotTreeRemember(repo.onDisconnect_, path, newNode); - } - repoCallOnCompleteCallback(repo, onComplete, status, errorReason); - }); -} -function repoOnDisconnectSetWithPriority(repo, path, value, priority, onComplete) { - var newNode = nodeFromJSON(value, priority); - repo.server_.onDisconnectPut(path.toString(), newNode.val(/*export=*/ true), function (status, errorReason) { - if (status === 'ok') { - sparseSnapshotTreeRemember(repo.onDisconnect_, path, newNode); - } - repoCallOnCompleteCallback(repo, onComplete, status, errorReason); - }); -} -function repoOnDisconnectUpdate(repo, path, childrenToMerge, onComplete) { - if (util.isEmpty(childrenToMerge)) { - log("onDisconnect().update() called with empty data. Don't do anything."); - repoCallOnCompleteCallback(repo, onComplete, 'ok', undefined); - return; - } - repo.server_.onDisconnectMerge(path.toString(), childrenToMerge, function (status, errorReason) { - if (status === 'ok') { - each(childrenToMerge, function (childName, childNode) { - var newChildNode = nodeFromJSON(childNode); - sparseSnapshotTreeRemember(repo.onDisconnect_, pathChild(path, childName), newChildNode); - }); - } - repoCallOnCompleteCallback(repo, onComplete, status, errorReason); - }); -} -function repoAddEventCallbackForQuery(repo, query, eventRegistration) { - var events; - if (pathGetFront(query._path) === '.info') { - events = syncTreeAddEventRegistration(repo.infoSyncTree_, query, eventRegistration); - } - else { - events = syncTreeAddEventRegistration(repo.serverSyncTree_, query, eventRegistration); - } - eventQueueRaiseEventsAtPath(repo.eventQueue_, query._path, events); -} -function repoRemoveEventCallbackForQuery(repo, query, eventRegistration) { - // These are guaranteed not to raise events, since we're not passing in a cancelError. However, we can future-proof - // a little bit by handling the return values anyways. - var events; - if (pathGetFront(query._path) === '.info') { - events = syncTreeRemoveEventRegistration(repo.infoSyncTree_, query, eventRegistration); - } - else { - events = syncTreeRemoveEventRegistration(repo.serverSyncTree_, query, eventRegistration); - } - eventQueueRaiseEventsAtPath(repo.eventQueue_, query._path, events); -} -function repoInterrupt(repo) { - if (repo.persistentConnection_) { - repo.persistentConnection_.interrupt(INTERRUPT_REASON); - } -} -function repoResume(repo) { - if (repo.persistentConnection_) { - repo.persistentConnection_.resume(INTERRUPT_REASON); - } -} -function repoLog(repo) { - var varArgs = []; - for (var _i = 1; _i < arguments.length; _i++) { - varArgs[_i - 1] = arguments[_i]; - } - var prefix = ''; - if (repo.persistentConnection_) { - prefix = repo.persistentConnection_.id + ':'; - } - log.apply(void 0, tslib.__spreadArray([prefix], tslib.__read(varArgs))); -} -function repoCallOnCompleteCallback(repo, callback, status, errorReason) { - if (callback) { - exceptionGuard(function () { - if (status === 'ok') { - callback(null); - } - else { - var code = (status || 'error').toUpperCase(); - var message = code; - if (errorReason) { - message += ': ' + errorReason; - } - var error = new Error(message); - // eslint-disable-next-line @typescript-eslint/no-explicit-any - error.code = code; - callback(error); - } - }); - } -} -/** - * Creates a new transaction, adds it to the transactions we're tracking, and - * sends it to the server if possible. - * - * @param path - Path at which to do transaction. - * @param transactionUpdate - Update callback. - * @param onComplete - Completion callback. - * @param unwatcher - Function that will be called when the transaction no longer - * need data updates for `path`. - * @param applyLocally - Whether or not to make intermediate results visible - */ -function repoStartTransaction(repo, path, transactionUpdate, onComplete, unwatcher, applyLocally) { - repoLog(repo, 'transaction on ' + path); - // Initialize transaction. - var transaction = { - path: path, - update: transactionUpdate, - onComplete: onComplete, - // One of TransactionStatus enums. - status: null, - // Used when combining transactions at different locations to figure out - // which one goes first. - order: LUIDGenerator(), - // Whether to raise local events for this transaction. - applyLocally: applyLocally, - // Count of how many times we've retried the transaction. - retryCount: 0, - // Function to call to clean up our .on() listener. - unwatcher: unwatcher, - // Stores why a transaction was aborted. - abortReason: null, - currentWriteId: null, - currentInputSnapshot: null, - currentOutputSnapshotRaw: null, - currentOutputSnapshotResolved: null - }; - // Run transaction initially. - var currentState = repoGetLatestState(repo, path, undefined); - transaction.currentInputSnapshot = currentState; - var newVal = transaction.update(currentState.val()); - if (newVal === undefined) { - // Abort transaction. - transaction.unwatcher(); - transaction.currentOutputSnapshotRaw = null; - transaction.currentOutputSnapshotResolved = null; - if (transaction.onComplete) { - transaction.onComplete(null, false, transaction.currentInputSnapshot); - } - } - else { - validateFirebaseData('transaction failed: Data returned ', newVal, transaction.path); - // Mark as run and add to our queue. - transaction.status = 0 /* RUN */; - var queueNode = treeSubTree(repo.transactionQueueTree_, path); - var nodeQueue = treeGetValue(queueNode) || []; - nodeQueue.push(transaction); - treeSetValue(queueNode, nodeQueue); - // Update visibleData and raise events - // Note: We intentionally raise events after updating all of our - // transaction state, since the user could start new transactions from the - // event callbacks. - var priorityForNode = void 0; - if (typeof newVal === 'object' && - newVal !== null && - util.contains(newVal, '.priority')) { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - priorityForNode = util.safeGet(newVal, '.priority'); - util.assert(isValidPriority(priorityForNode), 'Invalid priority returned by transaction. ' + - 'Priority must be a valid string, finite number, server value, or null.'); - } - else { - var currentNode = syncTreeCalcCompleteEventCache(repo.serverSyncTree_, path) || - ChildrenNode.EMPTY_NODE; - priorityForNode = currentNode.getPriority().val(); - } - var serverValues = repoGenerateServerValues(repo); - var newNodeUnresolved = nodeFromJSON(newVal, priorityForNode); - var newNode = resolveDeferredValueSnapshot(newNodeUnresolved, currentState, serverValues); - transaction.currentOutputSnapshotRaw = newNodeUnresolved; - transaction.currentOutputSnapshotResolved = newNode; - transaction.currentWriteId = repoGetNextWriteId(repo); - var events = syncTreeApplyUserOverwrite(repo.serverSyncTree_, path, newNode, transaction.currentWriteId, transaction.applyLocally); - eventQueueRaiseEventsForChangedPath(repo.eventQueue_, path, events); - repoSendReadyTransactions(repo, repo.transactionQueueTree_); - } -} -/** - * @param excludeSets - A specific set to exclude - */ -function repoGetLatestState(repo, path, excludeSets) { - return (syncTreeCalcCompleteEventCache(repo.serverSyncTree_, path, excludeSets) || - ChildrenNode.EMPTY_NODE); -} -/** - * Sends any already-run transactions that aren't waiting for outstanding - * transactions to complete. - * - * Externally it's called with no arguments, but it calls itself recursively - * with a particular transactionQueueTree node to recurse through the tree. - * - * @param node - transactionQueueTree node to start at. - */ -function repoSendReadyTransactions(repo, node) { - if (node === void 0) { node = repo.transactionQueueTree_; } - // Before recursing, make sure any completed transactions are removed. - if (!node) { - repoPruneCompletedTransactionsBelowNode(repo, node); - } - if (treeGetValue(node)) { - var queue = repoBuildTransactionQueue(repo, node); - util.assert(queue.length > 0, 'Sending zero length transaction queue'); - var allRun = queue.every(function (transaction) { return transaction.status === 0 /* RUN */; }); - // If they're all run (and not sent), we can send them. Else, we must wait. - if (allRun) { - repoSendTransactionQueue(repo, treeGetPath(node), queue); - } - } - else if (treeHasChildren(node)) { - treeForEachChild(node, function (childNode) { - repoSendReadyTransactions(repo, childNode); - }); - } -} -/** - * Given a list of run transactions, send them to the server and then handle - * the result (success or failure). - * - * @param path - The location of the queue. - * @param queue - Queue of transactions under the specified location. - */ -function repoSendTransactionQueue(repo, path, queue) { - // Mark transactions as sent and increment retry count! - var setsToIgnore = queue.map(function (txn) { - return txn.currentWriteId; - }); - var latestState = repoGetLatestState(repo, path, setsToIgnore); - var snapToSend = latestState; - var latestHash = latestState.hash(); - for (var i = 0; i < queue.length; i++) { - var txn = queue[i]; - util.assert(txn.status === 0 /* RUN */, 'tryToSendTransactionQueue_: items in queue should all be run.'); - txn.status = 1 /* SENT */; - txn.retryCount++; - var relativePath = newRelativePath(path, txn.path); - // If we've gotten to this point, the output snapshot must be defined. - snapToSend = snapToSend.updateChild(relativePath /** @type {!Node} */, txn.currentOutputSnapshotRaw); - } - var dataToSend = snapToSend.val(true); - var pathToSend = path; - // Send the put. - repo.server_.put(pathToSend.toString(), dataToSend, function (status) { - repoLog(repo, 'transaction put response', { - path: pathToSend.toString(), - status: status - }); - var events = []; - if (status === 'ok') { - // Queue up the callbacks and fire them after cleaning up all of our - // transaction state, since the callback could trigger more - // transactions or sets. - var callbacks = []; - var _loop_1 = function (i) { - queue[i].status = 2 /* COMPLETED */; - events = events.concat(syncTreeAckUserWrite(repo.serverSyncTree_, queue[i].currentWriteId)); - if (queue[i].onComplete) { - // We never unset the output snapshot, and given that this - // transaction is complete, it should be set - callbacks.push(function () { - return queue[i].onComplete(null, true, queue[i].currentOutputSnapshotResolved); - }); - } - queue[i].unwatcher(); - }; - for (var i = 0; i < queue.length; i++) { - _loop_1(i); - } - // Now remove the completed transactions. - repoPruneCompletedTransactionsBelowNode(repo, treeSubTree(repo.transactionQueueTree_, path)); - // There may be pending transactions that we can now send. - repoSendReadyTransactions(repo, repo.transactionQueueTree_); - eventQueueRaiseEventsForChangedPath(repo.eventQueue_, path, events); - // Finally, trigger onComplete callbacks. - for (var i = 0; i < callbacks.length; i++) { - exceptionGuard(callbacks[i]); - } - } - else { - // transactions are no longer sent. Update their status appropriately. - if (status === 'datastale') { - for (var i = 0; i < queue.length; i++) { - if (queue[i].status === 3 /* SENT_NEEDS_ABORT */) { - queue[i].status = 4 /* NEEDS_ABORT */; - } - else { - queue[i].status = 0 /* RUN */; - } - } - } - else { - warn('transaction at ' + pathToSend.toString() + ' failed: ' + status); - for (var i = 0; i < queue.length; i++) { - queue[i].status = 4 /* NEEDS_ABORT */; - queue[i].abortReason = status; - } - } - repoRerunTransactions(repo, path); - } - }, latestHash); -} -/** - * Finds all transactions dependent on the data at changedPath and reruns them. - * - * Should be called any time cached data changes. - * - * Return the highest path that was affected by rerunning transactions. This - * is the path at which events need to be raised for. - * - * @param changedPath - The path in mergedData that changed. - * @returns The rootmost path that was affected by rerunning transactions. - */ -function repoRerunTransactions(repo, changedPath) { - var rootMostTransactionNode = repoGetAncestorTransactionNode(repo, changedPath); - var path = treeGetPath(rootMostTransactionNode); - var queue = repoBuildTransactionQueue(repo, rootMostTransactionNode); - repoRerunTransactionQueue(repo, queue, path); - return path; -} -/** - * Does all the work of rerunning transactions (as well as cleans up aborted - * transactions and whatnot). - * - * @param queue - The queue of transactions to run. - * @param path - The path the queue is for. - */ -function repoRerunTransactionQueue(repo, queue, path) { - if (queue.length === 0) { - return; // Nothing to do! - } - // Queue up the callbacks and fire them after cleaning up all of our - // transaction state, since the callback could trigger more transactions or - // sets. - var callbacks = []; - var events = []; - // Ignore all of the sets we're going to re-run. - var txnsToRerun = queue.filter(function (q) { - return q.status === 0 /* RUN */; - }); - var setsToIgnore = txnsToRerun.map(function (q) { - return q.currentWriteId; - }); - var _loop_2 = function (i) { - var transaction = queue[i]; - var relativePath = newRelativePath(path, transaction.path); - var abortTransaction = false, abortReason; - util.assert(relativePath !== null, 'rerunTransactionsUnderNode_: relativePath should not be null.'); - if (transaction.status === 4 /* NEEDS_ABORT */) { - abortTransaction = true; - abortReason = transaction.abortReason; - events = events.concat(syncTreeAckUserWrite(repo.serverSyncTree_, transaction.currentWriteId, true)); - } - else if (transaction.status === 0 /* RUN */) { - if (transaction.retryCount >= MAX_TRANSACTION_RETRIES) { - abortTransaction = true; - abortReason = 'maxretry'; - events = events.concat(syncTreeAckUserWrite(repo.serverSyncTree_, transaction.currentWriteId, true)); - } - else { - // This code reruns a transaction - var currentNode = repoGetLatestState(repo, transaction.path, setsToIgnore); - transaction.currentInputSnapshot = currentNode; - var newData = queue[i].update(currentNode.val()); - if (newData !== undefined) { - validateFirebaseData('transaction failed: Data returned ', newData, transaction.path); - var newDataNode = nodeFromJSON(newData); - var hasExplicitPriority = typeof newData === 'object' && - newData != null && - util.contains(newData, '.priority'); - if (!hasExplicitPriority) { - // Keep the old priority if there wasn't a priority explicitly specified. - newDataNode = newDataNode.updatePriority(currentNode.getPriority()); - } - var oldWriteId = transaction.currentWriteId; - var serverValues = repoGenerateServerValues(repo); - var newNodeResolved = resolveDeferredValueSnapshot(newDataNode, currentNode, serverValues); - transaction.currentOutputSnapshotRaw = newDataNode; - transaction.currentOutputSnapshotResolved = newNodeResolved; - transaction.currentWriteId = repoGetNextWriteId(repo); - // Mutates setsToIgnore in place - setsToIgnore.splice(setsToIgnore.indexOf(oldWriteId), 1); - events = events.concat(syncTreeApplyUserOverwrite(repo.serverSyncTree_, transaction.path, newNodeResolved, transaction.currentWriteId, transaction.applyLocally)); - events = events.concat(syncTreeAckUserWrite(repo.serverSyncTree_, oldWriteId, true)); - } - else { - abortTransaction = true; - abortReason = 'nodata'; - events = events.concat(syncTreeAckUserWrite(repo.serverSyncTree_, transaction.currentWriteId, true)); - } - } - } - eventQueueRaiseEventsForChangedPath(repo.eventQueue_, path, events); - events = []; - if (abortTransaction) { - // Abort. - queue[i].status = 2 /* COMPLETED */; - // Removing a listener can trigger pruning which can muck with - // mergedData/visibleData (as it prunes data). So defer the unwatcher - // until we're done. - (function (unwatcher) { - setTimeout(unwatcher, Math.floor(0)); - })(queue[i].unwatcher); - if (queue[i].onComplete) { - if (abortReason === 'nodata') { - callbacks.push(function () { - return queue[i].onComplete(null, false, queue[i].currentInputSnapshot); - }); - } - else { - callbacks.push(function () { - return queue[i].onComplete(new Error(abortReason), false, null); - }); - } - } - } - }; - for (var i = 0; i < queue.length; i++) { - _loop_2(i); - } - // Clean up completed transactions. - repoPruneCompletedTransactionsBelowNode(repo, repo.transactionQueueTree_); - // Now fire callbacks, now that we're in a good, known state. - for (var i = 0; i < callbacks.length; i++) { - exceptionGuard(callbacks[i]); - } - // Try to send the transaction result to the server. - repoSendReadyTransactions(repo, repo.transactionQueueTree_); -} -/** - * Returns the rootmost ancestor node of the specified path that has a pending - * transaction on it, or just returns the node for the given path if there are - * no pending transactions on any ancestor. - * - * @param path - The location to start at. - * @returns The rootmost node with a transaction. - */ -function repoGetAncestorTransactionNode(repo, path) { - var front; - // Start at the root and walk deeper into the tree towards path until we - // find a node with pending transactions. - var transactionNode = repo.transactionQueueTree_; - front = pathGetFront(path); - while (front !== null && treeGetValue(transactionNode) === undefined) { - transactionNode = treeSubTree(transactionNode, front); - path = pathPopFront(path); - front = pathGetFront(path); - } - return transactionNode; -} -/** - * Builds the queue of all transactions at or below the specified - * transactionNode. - * - * @param transactionNode - * @returns The generated queue. - */ -function repoBuildTransactionQueue(repo, transactionNode) { - // Walk any child transaction queues and aggregate them into a single queue. - var transactionQueue = []; - repoAggregateTransactionQueuesForNode(repo, transactionNode, transactionQueue); - // Sort them by the order the transactions were created. - transactionQueue.sort(function (a, b) { return a.order - b.order; }); - return transactionQueue; -} -function repoAggregateTransactionQueuesForNode(repo, node, queue) { - var nodeQueue = treeGetValue(node); - if (nodeQueue) { - for (var i = 0; i < nodeQueue.length; i++) { - queue.push(nodeQueue[i]); - } - } - treeForEachChild(node, function (child) { - repoAggregateTransactionQueuesForNode(repo, child, queue); - }); -} -/** - * Remove COMPLETED transactions at or below this node in the transactionQueueTree_. - */ -function repoPruneCompletedTransactionsBelowNode(repo, node) { - var queue = treeGetValue(node); - if (queue) { - var to = 0; - for (var from = 0; from < queue.length; from++) { - if (queue[from].status !== 2 /* COMPLETED */) { - queue[to] = queue[from]; - to++; - } - } - queue.length = to; - treeSetValue(node, queue.length > 0 ? queue : undefined); - } - treeForEachChild(node, function (childNode) { - repoPruneCompletedTransactionsBelowNode(repo, childNode); - }); -} -/** - * Aborts all transactions on ancestors or descendants of the specified path. - * Called when doing a set() or update() since we consider them incompatible - * with transactions. - * - * @param path - Path for which we want to abort related transactions. - */ -function repoAbortTransactions(repo, path) { - var affectedPath = treeGetPath(repoGetAncestorTransactionNode(repo, path)); - var transactionNode = treeSubTree(repo.transactionQueueTree_, path); - treeForEachAncestor(transactionNode, function (node) { - repoAbortTransactionsOnNode(repo, node); - }); - repoAbortTransactionsOnNode(repo, transactionNode); - treeForEachDescendant(transactionNode, function (node) { - repoAbortTransactionsOnNode(repo, node); - }); - return affectedPath; -} -/** - * Abort transactions stored in this transaction queue node. - * - * @param node - Node to abort transactions for. - */ -function repoAbortTransactionsOnNode(repo, node) { - var queue = treeGetValue(node); - if (queue) { - // Queue up the callbacks and fire them after cleaning up all of our - // transaction state, since the callback could trigger more transactions - // or sets. - var callbacks = []; - // Go through queue. Any already-sent transactions must be marked for - // abort, while the unsent ones can be immediately aborted and removed. - var events = []; - var lastSent = -1; - for (var i = 0; i < queue.length; i++) { - if (queue[i].status === 3 /* SENT_NEEDS_ABORT */) ; - else if (queue[i].status === 1 /* SENT */) { - util.assert(lastSent === i - 1, 'All SENT items should be at beginning of queue.'); - lastSent = i; - // Mark transaction for abort when it comes back. - queue[i].status = 3 /* SENT_NEEDS_ABORT */; - queue[i].abortReason = 'set'; - } - else { - util.assert(queue[i].status === 0 /* RUN */, 'Unexpected transaction status in abort'); - // We can abort it immediately. - queue[i].unwatcher(); - events = events.concat(syncTreeAckUserWrite(repo.serverSyncTree_, queue[i].currentWriteId, true)); - if (queue[i].onComplete) { - callbacks.push(queue[i].onComplete.bind(null, new Error('set'), false, null)); - } - } - } - if (lastSent === -1) { - // We're not waiting for any sent transactions. We can clear the queue. - treeSetValue(node, undefined); - } - else { - // Remove the transactions we aborted. - queue.length = lastSent + 1; - } - // Now fire the callbacks. - eventQueueRaiseEventsForChangedPath(repo.eventQueue_, treeGetPath(node), events); - for (var i = 0; i < callbacks.length; i++) { - exceptionGuard(callbacks[i]); - } - } -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -function decodePath(pathString) { - var pathStringDecoded = ''; - var pieces = pathString.split('/'); - for (var i = 0; i < pieces.length; i++) { - if (pieces[i].length > 0) { - var piece = pieces[i]; - try { - piece = decodeURIComponent(piece.replace(/\+/g, ' ')); - } - catch (e) { } - pathStringDecoded += '/' + piece; - } - } - return pathStringDecoded; -} -/** - * @returns key value hash - */ -function decodeQuery(queryString) { - var e_1, _a; - var results = {}; - if (queryString.charAt(0) === '?') { - queryString = queryString.substring(1); - } - try { - for (var _b = tslib.__values(queryString.split('&')), _c = _b.next(); !_c.done; _c = _b.next()) { - var segment = _c.value; - if (segment.length === 0) { - continue; - } - var kv = segment.split('='); - if (kv.length === 2) { - results[decodeURIComponent(kv[0])] = decodeURIComponent(kv[1]); - } - else { - warn("Invalid query segment '" + segment + "' in query '" + queryString + "'"); - } - } - } - catch (e_1_1) { e_1 = { error: e_1_1 }; } - finally { - try { - if (_c && !_c.done && (_a = _b.return)) _a.call(_b); - } - finally { if (e_1) throw e_1.error; } - } - return results; -} -var parseRepoInfo = function (dataURL, nodeAdmin) { - var parsedUrl = parseDatabaseURL(dataURL), namespace = parsedUrl.namespace; - if (parsedUrl.domain === 'firebase.com') { - fatal(parsedUrl.host + - ' is no longer supported. ' + - 'Please use .firebaseio.com instead'); - } - // Catch common error of uninitialized namespace value. - if ((!namespace || namespace === 'undefined') && - parsedUrl.domain !== 'localhost') { - fatal('Cannot parse Firebase url. Please use https://.firebaseio.com'); - } - if (!parsedUrl.secure) { - warnIfPageIsSecure(); - } - var webSocketOnly = parsedUrl.scheme === 'ws' || parsedUrl.scheme === 'wss'; - return { - repoInfo: new RepoInfo(parsedUrl.host, parsedUrl.secure, namespace, webSocketOnly, nodeAdmin, - /*persistenceKey=*/ '', - /*includeNamespaceInQueryParams=*/ namespace !== parsedUrl.subdomain), - path: new Path(parsedUrl.pathString) - }; -}; -var parseDatabaseURL = function (dataURL) { - // Default to empty strings in the event of a malformed string. - var host = '', domain = '', subdomain = '', pathString = '', namespace = ''; - // Always default to SSL, unless otherwise specified. - var secure = true, scheme = 'https', port = 443; - // Don't do any validation here. The caller is responsible for validating the result of parsing. - if (typeof dataURL === 'string') { - // Parse scheme. - var colonInd = dataURL.indexOf('//'); - if (colonInd >= 0) { - scheme = dataURL.substring(0, colonInd - 1); - dataURL = dataURL.substring(colonInd + 2); - } - // Parse host, path, and query string. - var slashInd = dataURL.indexOf('/'); - if (slashInd === -1) { - slashInd = dataURL.length; - } - var questionMarkInd = dataURL.indexOf('?'); - if (questionMarkInd === -1) { - questionMarkInd = dataURL.length; - } - host = dataURL.substring(0, Math.min(slashInd, questionMarkInd)); - if (slashInd < questionMarkInd) { - // For pathString, questionMarkInd will always come after slashInd - pathString = decodePath(dataURL.substring(slashInd, questionMarkInd)); - } - var queryParams = decodeQuery(dataURL.substring(Math.min(dataURL.length, questionMarkInd))); - // If we have a port, use scheme for determining if it's secure. - colonInd = host.indexOf(':'); - if (colonInd >= 0) { - secure = scheme === 'https' || scheme === 'wss'; - port = parseInt(host.substring(colonInd + 1), 10); - } - else { - colonInd = host.length; - } - var hostWithoutPort = host.slice(0, colonInd); - if (hostWithoutPort.toLowerCase() === 'localhost') { - domain = 'localhost'; - } - else if (hostWithoutPort.split('.').length <= 2) { - domain = hostWithoutPort; - } - else { - // Interpret the subdomain of a 3 or more component URL as the namespace name. - var dotInd = host.indexOf('.'); - subdomain = host.substring(0, dotInd).toLowerCase(); - domain = host.substring(dotInd + 1); - // Normalize namespaces to lowercase to share storage / connection. - namespace = subdomain; - } - // Always treat the value of the `ns` as the namespace name if it is present. - if ('ns' in queryParams) { - namespace = queryParams['ns']; - } - } - return { - host: host, - port: port, - domain: domain, - subdomain: subdomain, - secure: secure, - scheme: scheme, - pathString: pathString, - namespace: namespace - }; -}; - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Encapsulates the data needed to raise an event - */ -var DataEvent = /** @class */ (function () { - /** - * @param eventType - One of: value, child_added, child_changed, child_moved, child_removed - * @param eventRegistration - The function to call to with the event data. User provided - * @param snapshot - The data backing the event - * @param prevName - Optional, the name of the previous child for child_* events. - */ - function DataEvent(eventType, eventRegistration, snapshot, prevName) { - this.eventType = eventType; - this.eventRegistration = eventRegistration; - this.snapshot = snapshot; - this.prevName = prevName; - } - DataEvent.prototype.getPath = function () { - var ref = this.snapshot.ref; - if (this.eventType === 'value') { - return ref._path; - } - else { - return ref.parent._path; - } - }; - DataEvent.prototype.getEventType = function () { - return this.eventType; - }; - DataEvent.prototype.getEventRunner = function () { - return this.eventRegistration.getEventRunner(this); - }; - DataEvent.prototype.toString = function () { - return (this.getPath().toString() + - ':' + - this.eventType + - ':' + - util.stringify(this.snapshot.exportVal())); - }; - return DataEvent; -}()); -var CancelEvent = /** @class */ (function () { - function CancelEvent(eventRegistration, error, path) { - this.eventRegistration = eventRegistration; - this.error = error; - this.path = path; - } - CancelEvent.prototype.getPath = function () { - return this.path; - }; - CancelEvent.prototype.getEventType = function () { - return 'cancel'; - }; - CancelEvent.prototype.getEventRunner = function () { - return this.eventRegistration.getEventRunner(this); - }; - CancelEvent.prototype.toString = function () { - return this.path.toString() + ':cancel'; - }; - return CancelEvent; -}()); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * A wrapper class that converts events from the database@exp SDK to the legacy - * Database SDK. Events are not converted directly as event registration relies - * on reference comparison of the original user callback (see `matches()`) and - * relies on equality of the legacy SDK's `context` object. - */ -var CallbackContext = /** @class */ (function () { - function CallbackContext(snapshotCallback, cancelCallback) { - this.snapshotCallback = snapshotCallback; - this.cancelCallback = cancelCallback; - } - CallbackContext.prototype.onValue = function (expDataSnapshot, previousChildName) { - this.snapshotCallback.call(null, expDataSnapshot, previousChildName); - }; - CallbackContext.prototype.onCancel = function (error) { - util.assert(this.hasCancelCallback, 'Raising a cancel event on a listener with no cancel callback'); - return this.cancelCallback.call(null, error); - }; - Object.defineProperty(CallbackContext.prototype, "hasCancelCallback", { - get: function () { - return !!this.cancelCallback; - }, - enumerable: false, - configurable: true - }); - CallbackContext.prototype.matches = function (other) { - return (this.snapshotCallback === other.snapshotCallback || - (this.snapshotCallback.userCallback !== undefined && - this.snapshotCallback.userCallback === - other.snapshotCallback.userCallback && - this.snapshotCallback.context === other.snapshotCallback.context)); - }; - return CallbackContext; -}()); - -/** - * @license - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * The `onDisconnect` class allows you to write or clear data when your client - * disconnects from the Database server. These updates occur whether your - * client disconnects cleanly or not, so you can rely on them to clean up data - * even if a connection is dropped or a client crashes. - * - * The `onDisconnect` class is most commonly used to manage presence in - * applications where it is useful to detect how many clients are connected and - * when other clients disconnect. See - * {@link https://firebase.google.com/docs/database/web/offline-capabilities | Enabling Offline Capabilities in JavaScript} - * for more information. - * - * To avoid problems when a connection is dropped before the requests can be - * transferred to the Database server, these functions should be called before - * writing any data. - * - * Note that `onDisconnect` operations are only triggered once. If you want an - * operation to occur each time a disconnect occurs, you'll need to re-establish - * the `onDisconnect` operations each time you reconnect. - */ -var OnDisconnect = /** @class */ (function () { - /** @hideconstructor */ - function OnDisconnect(_repo, _path) { - this._repo = _repo; - this._path = _path; - } - /** - * Cancels all previously queued `onDisconnect()` set or update events for this - * location and all children. - * - * If a write has been queued for this location via a `set()` or `update()` at a - * parent location, the write at this location will be canceled, though writes - * to sibling locations will still occur. - * - * @returns Resolves when synchronization to the server is complete. - */ - OnDisconnect.prototype.cancel = function () { - var deferred = new util.Deferred(); - repoOnDisconnectCancel(this._repo, this._path, deferred.wrapCallback(function () { })); - return deferred.promise; - }; - /** - * Ensures the data at this location is deleted when the client is disconnected - * (due to closing the browser, navigating to a new page, or network issues). - * - * @returns Resolves when synchronization to the server is complete. - */ - OnDisconnect.prototype.remove = function () { - validateWritablePath('OnDisconnect.remove', this._path); - var deferred = new util.Deferred(); - repoOnDisconnectSet(this._repo, this._path, null, deferred.wrapCallback(function () { })); - return deferred.promise; - }; - /** - * Ensures the data at this location is set to the specified value when the - * client is disconnected (due to closing the browser, navigating to a new page, - * or network issues). - * - * `set()` is especially useful for implementing "presence" systems, where a - * value should be changed or cleared when a user disconnects so that they - * appear "offline" to other users. See - * {@link https://firebase.google.com/docs/database/web/offline-capabilities | Enabling Offline Capabilities in JavaScript} - * for more information. - * - * Note that `onDisconnect` operations are only triggered once. If you want an - * operation to occur each time a disconnect occurs, you'll need to re-establish - * the `onDisconnect` operations each time. - * - * @param value - The value to be written to this location on disconnect (can - * be an object, array, string, number, boolean, or null). - * @returns Resolves when synchronization to the Database is complete. - */ - OnDisconnect.prototype.set = function (value) { - validateWritablePath('OnDisconnect.set', this._path); - validateFirebaseDataArg('OnDisconnect.set', value, this._path, false); - var deferred = new util.Deferred(); - repoOnDisconnectSet(this._repo, this._path, value, deferred.wrapCallback(function () { })); - return deferred.promise; - }; - /** - * Ensures the data at this location is set to the specified value and priority - * when the client is disconnected (due to closing the browser, navigating to a - * new page, or network issues). - * - * @param value - The value to be written to this location on disconnect (can - * be an object, array, string, number, boolean, or null). - * @param priority - The priority to be written (string, number, or null). - * @returns Resolves when synchronization to the Database is complete. - */ - OnDisconnect.prototype.setWithPriority = function (value, priority) { - validateWritablePath('OnDisconnect.setWithPriority', this._path); - validateFirebaseDataArg('OnDisconnect.setWithPriority', value, this._path, false); - validatePriority('OnDisconnect.setWithPriority', priority, false); - var deferred = new util.Deferred(); - repoOnDisconnectSetWithPriority(this._repo, this._path, value, priority, deferred.wrapCallback(function () { })); - return deferred.promise; - }; - /** - * Writes multiple values at this location when the client is disconnected (due - * to closing the browser, navigating to a new page, or network issues). - * - * The `values` argument contains multiple property-value pairs that will be - * written to the Database together. Each child property can either be a simple - * property (for example, "name") or a relative path (for example, "name/first") - * from the current location to the data to update. - * - * As opposed to the `set()` method, `update()` can be use to selectively update - * only the referenced properties at the current location (instead of replacing - * all the child properties at the current location). - * - * @param values - Object containing multiple values. - * @returns Resolves when synchronization to the Database is complete. - */ - OnDisconnect.prototype.update = function (values) { - validateWritablePath('OnDisconnect.update', this._path); - validateFirebaseMergeDataArg('OnDisconnect.update', values, this._path, false); - var deferred = new util.Deferred(); - repoOnDisconnectUpdate(this._repo, this._path, values, deferred.wrapCallback(function () { })); - return deferred.promise; - }; - return OnDisconnect; -}()); - -/** - * @license - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * @internal - */ -var QueryImpl = /** @class */ (function () { - /** - * @hideconstructor - */ - function QueryImpl(_repo, _path, _queryParams, _orderByCalled) { - this._repo = _repo; - this._path = _path; - this._queryParams = _queryParams; - this._orderByCalled = _orderByCalled; - } - Object.defineProperty(QueryImpl.prototype, "key", { - get: function () { - if (pathIsEmpty(this._path)) { - return null; - } - else { - return pathGetBack(this._path); - } - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(QueryImpl.prototype, "ref", { - get: function () { - return new ReferenceImpl(this._repo, this._path); - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(QueryImpl.prototype, "_queryIdentifier", { - get: function () { - var obj = queryParamsGetQueryObject(this._queryParams); - var id = ObjectToUniqueKey(obj); - return id === '{}' ? 'default' : id; - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(QueryImpl.prototype, "_queryObject", { - /** - * An object representation of the query parameters used by this Query. - */ - get: function () { - return queryParamsGetQueryObject(this._queryParams); - }, - enumerable: false, - configurable: true - }); - QueryImpl.prototype.isEqual = function (other) { - other = util.getModularInstance(other); - if (!(other instanceof QueryImpl)) { - return false; - } - var sameRepo = this._repo === other._repo; - var samePath = pathEquals(this._path, other._path); - var sameQueryIdentifier = this._queryIdentifier === other._queryIdentifier; - return sameRepo && samePath && sameQueryIdentifier; - }; - QueryImpl.prototype.toJSON = function () { - return this.toString(); - }; - QueryImpl.prototype.toString = function () { - return this._repo.toString() + pathToUrlEncodedString(this._path); - }; - return QueryImpl; -}()); -/** - * Validates that no other order by call has been made - */ -function validateNoPreviousOrderByCall(query, fnName) { - if (query._orderByCalled === true) { - throw new Error(fnName + ": You can't combine multiple orderBy calls."); - } -} -/** - * Validates start/end values for queries. - */ -function validateQueryEndpoints(params) { - var startNode = null; - var endNode = null; - if (params.hasStart()) { - startNode = params.getIndexStartValue(); - } - if (params.hasEnd()) { - endNode = params.getIndexEndValue(); - } - if (params.getIndex() === KEY_INDEX) { - var tooManyArgsError = 'Query: When ordering by key, you may only pass one argument to ' + - 'startAt(), endAt(), or equalTo().'; - var wrongArgTypeError = 'Query: When ordering by key, the argument passed to startAt(), startAfter(), ' + - 'endAt(), endBefore(), or equalTo() must be a string.'; - if (params.hasStart()) { - var startName = params.getIndexStartName(); - if (startName !== MIN_NAME) { - throw new Error(tooManyArgsError); - } - else if (typeof startNode !== 'string') { - throw new Error(wrongArgTypeError); - } - } - if (params.hasEnd()) { - var endName = params.getIndexEndName(); - if (endName !== MAX_NAME) { - throw new Error(tooManyArgsError); - } - else if (typeof endNode !== 'string') { - throw new Error(wrongArgTypeError); - } - } - } - else if (params.getIndex() === PRIORITY_INDEX) { - if ((startNode != null && !isValidPriority(startNode)) || - (endNode != null && !isValidPriority(endNode))) { - throw new Error('Query: When ordering by priority, the first argument passed to startAt(), ' + - 'startAfter() endAt(), endBefore(), or equalTo() must be a valid priority value ' + - '(null, a number, or a string).'); - } - } - else { - util.assert(params.getIndex() instanceof PathIndex || - params.getIndex() === VALUE_INDEX, 'unknown index type.'); - if ((startNode != null && typeof startNode === 'object') || - (endNode != null && typeof endNode === 'object')) { - throw new Error('Query: First argument passed to startAt(), startAfter(), endAt(), endBefore(), or ' + - 'equalTo() cannot be an object.'); - } - } -} -/** - * Validates that limit* has been called with the correct combination of parameters - */ -function validateLimit(params) { - if (params.hasStart() && - params.hasEnd() && - params.hasLimit() && - !params.hasAnchoredLimit()) { - throw new Error("Query: Can't combine startAt(), startAfter(), endAt(), endBefore(), and limit(). Use " + - 'limitToFirst() or limitToLast() instead.'); - } -} -/** - * @internal - */ -var ReferenceImpl = /** @class */ (function (_super) { - tslib.__extends(ReferenceImpl, _super); - /** @hideconstructor */ - function ReferenceImpl(repo, path) { - return _super.call(this, repo, path, new QueryParams(), false) || this; - } - Object.defineProperty(ReferenceImpl.prototype, "parent", { - get: function () { - var parentPath = pathParent(this._path); - return parentPath === null - ? null - : new ReferenceImpl(this._repo, parentPath); - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(ReferenceImpl.prototype, "root", { - get: function () { - var ref = this; - while (ref.parent !== null) { - ref = ref.parent; - } - return ref; - }, - enumerable: false, - configurable: true - }); - return ReferenceImpl; -}(QueryImpl)); -/** - * A `DataSnapshot` contains data from a Database location. - * - * Any time you read data from the Database, you receive the data as a - * `DataSnapshot`. A `DataSnapshot` is passed to the event callbacks you attach - * with `on()` or `once()`. You can extract the contents of the snapshot as a - * JavaScript object by calling the `val()` method. Alternatively, you can - * traverse into the snapshot by calling `child()` to return child snapshots - * (which you could then call `val()` on). - * - * A `DataSnapshot` is an efficiently generated, immutable copy of the data at - * a Database location. It cannot be modified and will never change (to modify - * data, you always call the `set()` method on a `Reference` directly). - */ -var DataSnapshot = /** @class */ (function () { - /** - * @param _node - A SnapshotNode to wrap. - * @param ref - The location this snapshot came from. - * @param _index - The iteration order for this snapshot - * @hideconstructor - */ - function DataSnapshot(_node, - /** - * The location of this DataSnapshot. - */ - ref, _index) { - this._node = _node; - this.ref = ref; - this._index = _index; - } - Object.defineProperty(DataSnapshot.prototype, "priority", { - /** - * Gets the priority value of the data in this `DataSnapshot`. - * - * Applications need not use priority but can order collections by - * ordinary properties (see - * {@link https://firebase.google.com/docs/database/web/lists-of-data#sorting_and_filtering_data |Sorting and filtering data} - * ). - */ - get: function () { - // typecast here because we never return deferred values or internal priorities (MAX_PRIORITY) - return this._node.getPriority().val(); - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(DataSnapshot.prototype, "key", { - /** - * The key (last part of the path) of the location of this `DataSnapshot`. - * - * The last token in a Database location is considered its key. For example, - * "ada" is the key for the /users/ada/ node. Accessing the key on any - * `DataSnapshot` will return the key for the location that generated it. - * However, accessing the key on the root URL of a Database will return - * `null`. - */ - get: function () { - return this.ref.key; - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(DataSnapshot.prototype, "size", { - /** Returns the number of child properties of this `DataSnapshot`. */ - get: function () { - return this._node.numChildren(); - }, - enumerable: false, - configurable: true - }); - /** - * Gets another `DataSnapshot` for the location at the specified relative path. - * - * Passing a relative path to the `child()` method of a DataSnapshot returns - * another `DataSnapshot` for the location at the specified relative path. The - * relative path can either be a simple child name (for example, "ada") or a - * deeper, slash-separated path (for example, "ada/name/first"). If the child - * location has no data, an empty `DataSnapshot` (that is, a `DataSnapshot` - * whose value is `null`) is returned. - * - * @param path - A relative path to the location of child data. - */ - DataSnapshot.prototype.child = function (path) { - var childPath = new Path(path); - var childRef = child(this.ref, path); - return new DataSnapshot(this._node.getChild(childPath), childRef, PRIORITY_INDEX); - }; - /** - * Returns true if this `DataSnapshot` contains any data. It is slightly more - * efficient than using `snapshot.val() !== null`. - */ - DataSnapshot.prototype.exists = function () { - return !this._node.isEmpty(); - }; - /** - * Exports the entire contents of the DataSnapshot as a JavaScript object. - * - * The `exportVal()` method is similar to `val()`, except priority information - * is included (if available), making it suitable for backing up your data. - * - * @returns The DataSnapshot's contents as a JavaScript value (Object, - * Array, string, number, boolean, or `null`). - */ - // eslint-disable-next-line @typescript-eslint/no-explicit-any - DataSnapshot.prototype.exportVal = function () { - return this._node.val(true); - }; - /** - * Enumerates the top-level children in the `DataSnapshot`. - * - * Because of the way JavaScript objects work, the ordering of data in the - * JavaScript object returned by `val()` is not guaranteed to match the - * ordering on the server nor the ordering of `onChildAdded()` events. That is - * where `forEach()` comes in handy. It guarantees the children of a - * `DataSnapshot` will be iterated in their query order. - * - * If no explicit `orderBy*()` method is used, results are returned - * ordered by key (unless priorities are used, in which case, results are - * returned by priority). - * - * @param action - A function that will be called for each child DataSnapshot. - * The callback can return true to cancel further enumeration. - * @returns true if enumeration was canceled due to your callback returning - * true. - */ - DataSnapshot.prototype.forEach = function (action) { - var _this = this; - if (this._node.isLeafNode()) { - return false; - } - var childrenNode = this._node; - // Sanitize the return value to a boolean. ChildrenNode.forEachChild has a weird return type... - return !!childrenNode.forEachChild(this._index, function (key, node) { - return action(new DataSnapshot(node, child(_this.ref, key), PRIORITY_INDEX)); - }); - }; - /** - * Returns true if the specified child path has (non-null) data. - * - * @param path - A relative path to the location of a potential child. - * @returns `true` if data exists at the specified child path; else - * `false`. - */ - DataSnapshot.prototype.hasChild = function (path) { - var childPath = new Path(path); - return !this._node.getChild(childPath).isEmpty(); - }; - /** - * Returns whether or not the `DataSnapshot` has any non-`null` child - * properties. - * - * You can use `hasChildren()` to determine if a `DataSnapshot` has any - * children. If it does, you can enumerate them using `forEach()`. If it - * doesn't, then either this snapshot contains a primitive value (which can be - * retrieved with `val()`) or it is empty (in which case, `val()` will return - * `null`). - * - * @returns true if this snapshot has any children; else false. - */ - DataSnapshot.prototype.hasChildren = function () { - if (this._node.isLeafNode()) { - return false; - } - else { - return !this._node.isEmpty(); - } - }; - /** - * Returns a JSON-serializable representation of this object. - */ - DataSnapshot.prototype.toJSON = function () { - return this.exportVal(); - }; - /** - * Extracts a JavaScript value from a `DataSnapshot`. - * - * Depending on the data in a `DataSnapshot`, the `val()` method may return a - * scalar type (string, number, or boolean), an array, or an object. It may - * also return null, indicating that the `DataSnapshot` is empty (contains no - * data). - * - * @returns The DataSnapshot's contents as a JavaScript value (Object, - * Array, string, number, boolean, or `null`). - */ - // eslint-disable-next-line @typescript-eslint/no-explicit-any - DataSnapshot.prototype.val = function () { - return this._node.val(); - }; - return DataSnapshot; -}()); -/** - * - * Returns a `Reference` representing the location in the Database - * corresponding to the provided path. If no path is provided, the `Reference` - * will point to the root of the Database. - * - * @param db - The database instance to obtain a reference for. - * @param path - Optional path representing the location the returned - * `Reference` will point. If not provided, the returned `Reference` will - * point to the root of the Database. - * @returns If a path is provided, a `Reference` - * pointing to the provided path. Otherwise, a `Reference` pointing to the - * root of the Database. - */ -function ref(db, path) { - db = util.getModularInstance(db); - db._checkNotDeleted('ref'); - return path !== undefined ? child(db._root, path) : db._root; -} -/** - * Returns a `Reference` representing the location in the Database - * corresponding to the provided Firebase URL. - * - * An exception is thrown if the URL is not a valid Firebase Database URL or it - * has a different domain than the current `Database` instance. - * - * Note that all query parameters (`orderBy`, `limitToLast`, etc.) are ignored - * and are not applied to the returned `Reference`. - * - * @param db - The database instance to obtain a reference for. - * @param url - The Firebase URL at which the returned `Reference` will - * point. - * @returns A `Reference` pointing to the provided - * Firebase URL. - */ -function refFromURL(db, url) { - db = util.getModularInstance(db); - db._checkNotDeleted('refFromURL'); - var parsedURL = parseRepoInfo(url, db._repo.repoInfo_.nodeAdmin); - validateUrl('refFromURL', parsedURL); - var repoInfo = parsedURL.repoInfo; - if (!db._repo.repoInfo_.isCustomHost() && - repoInfo.host !== db._repo.repoInfo_.host) { - fatal('refFromURL' + - ': Host name does not match the current database: ' + - '(found ' + - repoInfo.host + - ' but expected ' + - db._repo.repoInfo_.host + - ')'); - } - return ref(db, parsedURL.path.toString()); -} -/** - * Gets a `Reference` for the location at the specified relative path. - * - * The relative path can either be a simple child name (for example, "ada") or - * a deeper slash-separated path (for example, "ada/name/first"). - * - * @param parent - The parent location. - * @param path - A relative path from this location to the desired child - * location. - * @returns The specified child location. - */ -function child(parent, path) { - parent = util.getModularInstance(parent); - if (pathGetFront(parent._path) === null) { - validateRootPathString('child', 'path', path, false); - } - else { - validatePathString('child', 'path', path, false); - } - return new ReferenceImpl(parent._repo, pathChild(parent._path, path)); -} -/** - * Returns an `OnDisconnect` object - see - * {@link https://firebase.google.com/docs/database/web/offline-capabilities | Enabling Offline Capabilities in JavaScript} - * for more information on how to use it. - * - * @param ref - The reference to add OnDisconnect triggers for. - */ -function onDisconnect(ref) { - ref = util.getModularInstance(ref); - return new OnDisconnect(ref._repo, ref._path); -} -/** - * Generates a new child location using a unique key and returns its - * `Reference`. - * - * This is the most common pattern for adding data to a collection of items. - * - * If you provide a value to `push()`, the value is written to the - * generated location. If you don't pass a value, nothing is written to the - * database and the child remains empty (but you can use the `Reference` - * elsewhere). - * - * The unique keys generated by `push()` are ordered by the current time, so the - * resulting list of items is chronologically sorted. The keys are also - * designed to be unguessable (they contain 72 random bits of entropy). - * - * See {@link https://firebase.google.com/docs/database/web/lists-of-data#append_to_a_list_of_data | Append to a list of data}. - * See {@link https://firebase.googleblog.com/2015/02/the-2120-ways-to-ensure-unique_68.html | The 2^120 Ways to Ensure Unique Identifiers}. - * - * @param parent - The parent location. - * @param value - Optional value to be written at the generated location. - * @returns Combined `Promise` and `Reference`; resolves when write is complete, - * but can be used immediately as the `Reference` to the child location. - */ -function push(parent, value) { - parent = util.getModularInstance(parent); - validateWritablePath('push', parent._path); - validateFirebaseDataArg('push', value, parent._path, true); - var now = repoServerTime(parent._repo); - var name = nextPushId(now); - // push() returns a ThennableReference whose promise is fulfilled with a - // regular Reference. We use child() to create handles to two different - // references. The first is turned into a ThennableReference below by adding - // then() and catch() methods and is used as the return value of push(). The - // second remains a regular Reference and is used as the fulfilled value of - // the first ThennableReference. - var thennablePushRef = child(parent, name); - var pushRef = child(parent, name); - var promise; - if (value != null) { - promise = set(pushRef, value).then(function () { return pushRef; }); - } - else { - promise = Promise.resolve(pushRef); - } - thennablePushRef.then = promise.then.bind(promise); - thennablePushRef.catch = promise.then.bind(promise, undefined); - return thennablePushRef; -} -/** - * Removes the data at this Database location. - * - * Any data at child locations will also be deleted. - * - * The effect of the remove will be visible immediately and the corresponding - * event 'value' will be triggered. Synchronization of the remove to the - * Firebase servers will also be started, and the returned Promise will resolve - * when complete. If provided, the onComplete callback will be called - * asynchronously after synchronization has finished. - * - * @param ref - The location to remove. - * @returns Resolves when remove on server is complete. - */ -function remove(ref) { - validateWritablePath('remove', ref._path); - return set(ref, null); -} -/** - * Writes data to this Database location. - * - * This will overwrite any data at this location and all child locations. - * - * The effect of the write will be visible immediately, and the corresponding - * events ("value", "child_added", etc.) will be triggered. Synchronization of - * the data to the Firebase servers will also be started, and the returned - * Promise will resolve when complete. If provided, the `onComplete` callback - * will be called asynchronously after synchronization has finished. - * - * Passing `null` for the new value is equivalent to calling `remove()`; namely, - * all data at this location and all child locations will be deleted. - * - * `set()` will remove any priority stored at this location, so if priority is - * meant to be preserved, you need to use `setWithPriority()` instead. - * - * Note that modifying data with `set()` will cancel any pending transactions - * at that location, so extreme care should be taken if mixing `set()` and - * `transaction()` to modify the same data. - * - * A single `set()` will generate a single "value" event at the location where - * the `set()` was performed. - * - * @param ref - The location to write to. - * @param value - The value to be written (string, number, boolean, object, - * array, or null). - * @returns Resolves when write to server is complete. - */ -function set(ref, value) { - ref = util.getModularInstance(ref); - validateWritablePath('set', ref._path); - validateFirebaseDataArg('set', value, ref._path, false); - var deferred = new util.Deferred(); - repoSetWithPriority(ref._repo, ref._path, value, - /*priority=*/ null, deferred.wrapCallback(function () { })); - return deferred.promise; -} -/** - * Sets a priority for the data at this Database location. - * - * Applications need not use priority but can order collections by - * ordinary properties (see - * {@link https://firebase.google.com/docs/database/web/lists-of-data#sorting_and_filtering_data | Sorting and filtering data} - * ). - * - * @param ref - The location to write to. - * @param priority - The priority to be written (string, number, or null). - * @returns Resolves when write to server is complete. - */ -function setPriority(ref, priority) { - ref = util.getModularInstance(ref); - validateWritablePath('setPriority', ref._path); - validatePriority('setPriority', priority, false); - var deferred = new util.Deferred(); - repoSetWithPriority(ref._repo, pathChild(ref._path, '.priority'), priority, null, deferred.wrapCallback(function () { })); - return deferred.promise; -} -/** - * Writes data the Database location. Like `set()` but also specifies the - * priority for that data. - * - * Applications need not use priority but can order collections by - * ordinary properties (see - * {@link https://firebase.google.com/docs/database/web/lists-of-data#sorting_and_filtering_data | Sorting and filtering data} - * ). - * - * @param ref - The location to write to. - * @param value - The value to be written (string, number, boolean, object, - * array, or null). - * @param priority - The priority to be written (string, number, or null). - * @returns Resolves when write to server is complete. - */ -function setWithPriority(ref, value, priority) { - validateWritablePath('setWithPriority', ref._path); - validateFirebaseDataArg('setWithPriority', value, ref._path, false); - validatePriority('setWithPriority', priority, false); - if (ref.key === '.length' || ref.key === '.keys') { - throw 'setWithPriority failed: ' + ref.key + ' is a read-only object.'; - } - var deferred = new util.Deferred(); - repoSetWithPriority(ref._repo, ref._path, value, priority, deferred.wrapCallback(function () { })); - return deferred.promise; -} -/** - * Writes multiple values to the Database at once. - * - * The `values` argument contains multiple property-value pairs that will be - * written to the Database together. Each child property can either be a simple - * property (for example, "name") or a relative path (for example, - * "name/first") from the current location to the data to update. - * - * As opposed to the `set()` method, `update()` can be use to selectively update - * only the referenced properties at the current location (instead of replacing - * all the child properties at the current location). - * - * The effect of the write will be visible immediately, and the corresponding - * events ('value', 'child_added', etc.) will be triggered. Synchronization of - * the data to the Firebase servers will also be started, and the returned - * Promise will resolve when complete. If provided, the `onComplete` callback - * will be called asynchronously after synchronization has finished. - * - * A single `update()` will generate a single "value" event at the location - * where the `update()` was performed, regardless of how many children were - * modified. - * - * Note that modifying data with `update()` will cancel any pending - * transactions at that location, so extreme care should be taken if mixing - * `update()` and `transaction()` to modify the same data. - * - * Passing `null` to `update()` will remove the data at this location. - * - * See - * {@link https://firebase.googleblog.com/2015/09/introducing-multi-location-updates-and_86.html | Introducing multi-location updates and more}. - * - * @param ref - The location to write to. - * @param values - Object containing multiple values. - * @returns Resolves when update on server is complete. - */ -function update(ref, values) { - validateFirebaseMergeDataArg('update', values, ref._path, false); - var deferred = new util.Deferred(); - repoUpdate(ref._repo, ref._path, values, deferred.wrapCallback(function () { })); - return deferred.promise; -} -/** - * Gets the most up-to-date result for this query. - * - * @param query - The query to run. - * @returns A `Promise` which resolves to the resulting DataSnapshot if a value is - * available, or rejects if the client is unable to return a value (e.g., if the - * server is unreachable and there is nothing cached). - */ -function get(query) { - query = util.getModularInstance(query); - var callbackContext = new CallbackContext(function () { }); - var container = new ValueEventRegistration(callbackContext); - return repoGetValue(query._repo, query, container).then(function (node) { - return new DataSnapshot(node, new ReferenceImpl(query._repo, query._path), query._queryParams.getIndex()); - }); -} -/** - * Represents registration for 'value' events. - */ -var ValueEventRegistration = /** @class */ (function () { - function ValueEventRegistration(callbackContext) { - this.callbackContext = callbackContext; - } - ValueEventRegistration.prototype.respondsTo = function (eventType) { - return eventType === 'value'; - }; - ValueEventRegistration.prototype.createEvent = function (change, query) { - var index = query._queryParams.getIndex(); - return new DataEvent('value', this, new DataSnapshot(change.snapshotNode, new ReferenceImpl(query._repo, query._path), index)); - }; - ValueEventRegistration.prototype.getEventRunner = function (eventData) { - var _this = this; - if (eventData.getEventType() === 'cancel') { - return function () { - return _this.callbackContext.onCancel(eventData.error); - }; - } - else { - return function () { - return _this.callbackContext.onValue(eventData.snapshot, null); - }; - } - }; - ValueEventRegistration.prototype.createCancelEvent = function (error, path) { - if (this.callbackContext.hasCancelCallback) { - return new CancelEvent(this, error, path); - } - else { - return null; - } - }; - ValueEventRegistration.prototype.matches = function (other) { - if (!(other instanceof ValueEventRegistration)) { - return false; - } - else if (!other.callbackContext || !this.callbackContext) { - // If no callback specified, we consider it to match any callback. - return true; - } - else { - return other.callbackContext.matches(this.callbackContext); - } - }; - ValueEventRegistration.prototype.hasAnyCallback = function () { - return this.callbackContext !== null; - }; - return ValueEventRegistration; -}()); -/** - * Represents the registration of a child_x event. - */ -var ChildEventRegistration = /** @class */ (function () { - function ChildEventRegistration(eventType, callbackContext) { - this.eventType = eventType; - this.callbackContext = callbackContext; - } - ChildEventRegistration.prototype.respondsTo = function (eventType) { - var eventToCheck = eventType === 'children_added' ? 'child_added' : eventType; - eventToCheck = - eventToCheck === 'children_removed' ? 'child_removed' : eventToCheck; - return this.eventType === eventToCheck; - }; - ChildEventRegistration.prototype.createCancelEvent = function (error, path) { - if (this.callbackContext.hasCancelCallback) { - return new CancelEvent(this, error, path); - } - else { - return null; - } - }; - ChildEventRegistration.prototype.createEvent = function (change, query) { - util.assert(change.childName != null, 'Child events should have a childName.'); - var childRef = child(new ReferenceImpl(query._repo, query._path), change.childName); - var index = query._queryParams.getIndex(); - return new DataEvent(change.type, this, new DataSnapshot(change.snapshotNode, childRef, index), change.prevName); - }; - ChildEventRegistration.prototype.getEventRunner = function (eventData) { - var _this = this; - if (eventData.getEventType() === 'cancel') { - return function () { - return _this.callbackContext.onCancel(eventData.error); - }; - } - else { - return function () { - return _this.callbackContext.onValue(eventData.snapshot, eventData.prevName); - }; - } - }; - ChildEventRegistration.prototype.matches = function (other) { - if (other instanceof ChildEventRegistration) { - return (this.eventType === other.eventType && - (!this.callbackContext || - !other.callbackContext || - this.callbackContext.matches(other.callbackContext))); - } - return false; - }; - ChildEventRegistration.prototype.hasAnyCallback = function () { - return !!this.callbackContext; - }; - return ChildEventRegistration; -}()); -function addEventListener(query, eventType, callback, cancelCallbackOrListenOptions, options) { - var cancelCallback; - if (typeof cancelCallbackOrListenOptions === 'object') { - cancelCallback = undefined; - options = cancelCallbackOrListenOptions; - } - if (typeof cancelCallbackOrListenOptions === 'function') { - cancelCallback = cancelCallbackOrListenOptions; - } - if (options && options.onlyOnce) { - var userCallback_1 = callback; - var onceCallback = function (dataSnapshot, previousChildName) { - repoRemoveEventCallbackForQuery(query._repo, query, container); - userCallback_1(dataSnapshot, previousChildName); - }; - onceCallback.userCallback = callback.userCallback; - onceCallback.context = callback.context; - callback = onceCallback; - } - var callbackContext = new CallbackContext(callback, cancelCallback || undefined); - var container = eventType === 'value' - ? new ValueEventRegistration(callbackContext) - : new ChildEventRegistration(eventType, callbackContext); - repoAddEventCallbackForQuery(query._repo, query, container); - return function () { return repoRemoveEventCallbackForQuery(query._repo, query, container); }; -} -function onValue(query, callback, cancelCallbackOrListenOptions, options) { - return addEventListener(query, 'value', callback, cancelCallbackOrListenOptions, options); -} -function onChildAdded(query, callback, cancelCallbackOrListenOptions, options) { - return addEventListener(query, 'child_added', callback, cancelCallbackOrListenOptions, options); -} -function onChildChanged(query, callback, cancelCallbackOrListenOptions, options) { - return addEventListener(query, 'child_changed', callback, cancelCallbackOrListenOptions, options); -} -function onChildMoved(query, callback, cancelCallbackOrListenOptions, options) { - return addEventListener(query, 'child_moved', callback, cancelCallbackOrListenOptions, options); -} -function onChildRemoved(query, callback, cancelCallbackOrListenOptions, options) { - return addEventListener(query, 'child_removed', callback, cancelCallbackOrListenOptions, options); -} -/** - * Detaches a callback previously attached with the corresponding `on*()` (`onValue`, `onChildAdded`) listener. - * Note: This is not the recommended way to remove a listener. Instead, please use the returned callback function from - * the respective `on*` callbacks. - * - * Detach a callback previously attached with `on*()`. Calling `off()` on a parent listener - * will not automatically remove listeners registered on child nodes, `off()` - * must also be called on any child listeners to remove the callback. - * - * If a callback is not specified, all callbacks for the specified eventType - * will be removed. Similarly, if no eventType is specified, all callbacks - * for the `Reference` will be removed. - * - * Individual listeners can also be removed by invoking their unsubscribe - * callbacks. - * - * @param query - The query that the listener was registered with. - * @param eventType - One of the following strings: "value", "child_added", - * "child_changed", "child_removed", or "child_moved." If omitted, all callbacks - * for the `Reference` will be removed. - * @param callback - The callback function that was passed to `on()` or - * `undefined` to remove all callbacks. - */ -function off(query, eventType, callback) { - var container = null; - var expCallback = callback ? new CallbackContext(callback) : null; - if (eventType === 'value') { - container = new ValueEventRegistration(expCallback); - } - else if (eventType) { - container = new ChildEventRegistration(eventType, expCallback); - } - repoRemoveEventCallbackForQuery(query._repo, query, container); -} -/** - * A `QueryConstraint` is used to narrow the set of documents returned by a - * Database query. `QueryConstraint`s are created by invoking {@link endAt}, - * {@link endBefore}, {@link startAt}, {@link startAfter}, {@link - * limitToFirst}, {@link limitToLast}, {@link orderByChild}, - * {@link orderByChild}, {@link orderByKey} , {@link orderByPriority} , - * {@link orderByValue} or {@link equalTo} and - * can then be passed to {@link query} to create a new query instance that - * also contains this `QueryConstraint`. - */ -var QueryConstraint = /** @class */ (function () { - function QueryConstraint() { - } - return QueryConstraint; -}()); -var QueryEndAtConstraint = /** @class */ (function (_super) { - tslib.__extends(QueryEndAtConstraint, _super); - function QueryEndAtConstraint(_value, _key) { - var _this = _super.call(this) || this; - _this._value = _value; - _this._key = _key; - return _this; - } - QueryEndAtConstraint.prototype._apply = function (query) { - validateFirebaseDataArg('endAt', this._value, query._path, true); - var newParams = queryParamsEndAt(query._queryParams, this._value, this._key); - validateLimit(newParams); - validateQueryEndpoints(newParams); - if (query._queryParams.hasEnd()) { - throw new Error('endAt: Starting point was already set (by another call to endAt, ' + - 'endBefore or equalTo).'); - } - return new QueryImpl(query._repo, query._path, newParams, query._orderByCalled); - }; - return QueryEndAtConstraint; -}(QueryConstraint)); -/** - * Creates a `QueryConstraint` with the specified ending point. - * - * Using `startAt()`, `startAfter()`, `endBefore()`, `endAt()` and `equalTo()` - * allows you to choose arbitrary starting and ending points for your queries. - * - * The ending point is inclusive, so children with exactly the specified value - * will be included in the query. The optional key argument can be used to - * further limit the range of the query. If it is specified, then children that - * have exactly the specified value must also have a key name less than or equal - * to the specified key. - * - * You can read more about `endAt()` in - * {@link https://firebase.google.com/docs/database/web/lists-of-data#filtering_data | Filtering data}. - * - * @param value - The value to end at. The argument type depends on which - * `orderBy*()` function was used in this query. Specify a value that matches - * the `orderBy*()` type. When used in combination with `orderByKey()`, the - * value must be a string. - * @param key - The child key to end at, among the children with the previously - * specified priority. This argument is only allowed if ordering by child, - * value, or priority. - */ -function endAt(value, key) { - validateKey('endAt', 'key', key, true); - return new QueryEndAtConstraint(value, key); -} -var QueryEndBeforeConstraint = /** @class */ (function (_super) { - tslib.__extends(QueryEndBeforeConstraint, _super); - function QueryEndBeforeConstraint(_value, _key) { - var _this = _super.call(this) || this; - _this._value = _value; - _this._key = _key; - return _this; - } - QueryEndBeforeConstraint.prototype._apply = function (query) { - validateFirebaseDataArg('endBefore', this._value, query._path, false); - var newParams = queryParamsEndBefore(query._queryParams, this._value, this._key); - validateLimit(newParams); - validateQueryEndpoints(newParams); - if (query._queryParams.hasEnd()) { - throw new Error('endBefore: Starting point was already set (by another call to endAt, ' + - 'endBefore or equalTo).'); - } - return new QueryImpl(query._repo, query._path, newParams, query._orderByCalled); - }; - return QueryEndBeforeConstraint; -}(QueryConstraint)); -/** - * Creates a `QueryConstraint` with the specified ending point (exclusive). - * - * Using `startAt()`, `startAfter()`, `endBefore()`, `endAt()` and `equalTo()` - * allows you to choose arbitrary starting and ending points for your queries. - * - * The ending point is exclusive. If only a value is provided, children - * with a value less than the specified value will be included in the query. - * If a key is specified, then children must have a value less than or equal - * to the specified value and a key name less than the specified key. - * - * @param value - The value to end before. The argument type depends on which - * `orderBy*()` function was used in this query. Specify a value that matches - * the `orderBy*()` type. When used in combination with `orderByKey()`, the - * value must be a string. - * @param key - The child key to end before, among the children with the - * previously specified priority. This argument is only allowed if ordering by - * child, value, or priority. - */ -function endBefore(value, key) { - validateKey('endBefore', 'key', key, true); - return new QueryEndBeforeConstraint(value, key); -} -var QueryStartAtConstraint = /** @class */ (function (_super) { - tslib.__extends(QueryStartAtConstraint, _super); - function QueryStartAtConstraint(_value, _key) { - var _this = _super.call(this) || this; - _this._value = _value; - _this._key = _key; - return _this; - } - QueryStartAtConstraint.prototype._apply = function (query) { - validateFirebaseDataArg('startAt', this._value, query._path, true); - var newParams = queryParamsStartAt(query._queryParams, this._value, this._key); - validateLimit(newParams); - validateQueryEndpoints(newParams); - if (query._queryParams.hasStart()) { - throw new Error('startAt: Starting point was already set (by another call to startAt, ' + - 'startBefore or equalTo).'); - } - return new QueryImpl(query._repo, query._path, newParams, query._orderByCalled); - }; - return QueryStartAtConstraint; -}(QueryConstraint)); -/** - * Creates a `QueryConstraint` with the specified starting point. - * - * Using `startAt()`, `startAfter()`, `endBefore()`, `endAt()` and `equalTo()` - * allows you to choose arbitrary starting and ending points for your queries. - * - * The starting point is inclusive, so children with exactly the specified value - * will be included in the query. The optional key argument can be used to - * further limit the range of the query. If it is specified, then children that - * have exactly the specified value must also have a key name greater than or - * equal to the specified key. - * - * You can read more about `startAt()` in - * {@link https://firebase.google.com/docs/database/web/lists-of-data#filtering_data | Filtering data}. - * - * @param value - The value to start at. The argument type depends on which - * `orderBy*()` function was used in this query. Specify a value that matches - * the `orderBy*()` type. When used in combination with `orderByKey()`, the - * value must be a string. - * @param key - The child key to start at. This argument is only allowed if - * ordering by child, value, or priority. - */ -function startAt(value, key) { - if (value === void 0) { value = null; } - validateKey('startAt', 'key', key, true); - return new QueryStartAtConstraint(value, key); -} -var QueryStartAfterConstraint = /** @class */ (function (_super) { - tslib.__extends(QueryStartAfterConstraint, _super); - function QueryStartAfterConstraint(_value, _key) { - var _this = _super.call(this) || this; - _this._value = _value; - _this._key = _key; - return _this; - } - QueryStartAfterConstraint.prototype._apply = function (query) { - validateFirebaseDataArg('startAfter', this._value, query._path, false); - var newParams = queryParamsStartAfter(query._queryParams, this._value, this._key); - validateLimit(newParams); - validateQueryEndpoints(newParams); - if (query._queryParams.hasStart()) { - throw new Error('startAfter: Starting point was already set (by another call to startAt, ' + - 'startAfter, or equalTo).'); - } - return new QueryImpl(query._repo, query._path, newParams, query._orderByCalled); - }; - return QueryStartAfterConstraint; -}(QueryConstraint)); -/** - * Creates a `QueryConstraint` with the specified starting point (exclusive). - * - * Using `startAt()`, `startAfter()`, `endBefore()`, `endAt()` and `equalTo()` - * allows you to choose arbitrary starting and ending points for your queries. - * - * The starting point is exclusive. If only a value is provided, children - * with a value greater than the specified value will be included in the query. - * If a key is specified, then children must have a value greater than or equal - * to the specified value and a a key name greater than the specified key. - * - * @param value - The value to start after. The argument type depends on which - * `orderBy*()` function was used in this query. Specify a value that matches - * the `orderBy*()` type. When used in combination with `orderByKey()`, the - * value must be a string. - * @param key - The child key to start after. This argument is only allowed if - * ordering by child, value, or priority. - */ -function startAfter(value, key) { - validateKey('startAfter', 'key', key, true); - return new QueryStartAfterConstraint(value, key); -} -var QueryLimitToFirstConstraint = /** @class */ (function (_super) { - tslib.__extends(QueryLimitToFirstConstraint, _super); - function QueryLimitToFirstConstraint(_limit) { - var _this = _super.call(this) || this; - _this._limit = _limit; - return _this; - } - QueryLimitToFirstConstraint.prototype._apply = function (query) { - if (query._queryParams.hasLimit()) { - throw new Error('limitToFirst: Limit was already set (by another call to limitToFirst ' + - 'or limitToLast).'); - } - return new QueryImpl(query._repo, query._path, queryParamsLimitToFirst(query._queryParams, this._limit), query._orderByCalled); - }; - return QueryLimitToFirstConstraint; -}(QueryConstraint)); -/** - * Creates a new `QueryConstraint` that if limited to the first specific number - * of children. - * - * The `limitToFirst()` method is used to set a maximum number of children to be - * synced for a given callback. If we set a limit of 100, we will initially only - * receive up to 100 `child_added` events. If we have fewer than 100 messages - * stored in our Database, a `child_added` event will fire for each message. - * However, if we have over 100 messages, we will only receive a `child_added` - * event for the first 100 ordered messages. As items change, we will receive - * `child_removed` events for each item that drops out of the active list so - * that the total number stays at 100. - * - * You can read more about `limitToFirst()` in - * {@link https://firebase.google.com/docs/database/web/lists-of-data#filtering_data | Filtering data}. - * - * @param limit - The maximum number of nodes to include in this query. - */ -function limitToFirst(limit) { - if (typeof limit !== 'number' || Math.floor(limit) !== limit || limit <= 0) { - throw new Error('limitToFirst: First argument must be a positive integer.'); - } - return new QueryLimitToFirstConstraint(limit); -} -var QueryLimitToLastConstraint = /** @class */ (function (_super) { - tslib.__extends(QueryLimitToLastConstraint, _super); - function QueryLimitToLastConstraint(_limit) { - var _this = _super.call(this) || this; - _this._limit = _limit; - return _this; - } - QueryLimitToLastConstraint.prototype._apply = function (query) { - if (query._queryParams.hasLimit()) { - throw new Error('limitToLast: Limit was already set (by another call to limitToFirst ' + - 'or limitToLast).'); - } - return new QueryImpl(query._repo, query._path, queryParamsLimitToLast(query._queryParams, this._limit), query._orderByCalled); - }; - return QueryLimitToLastConstraint; -}(QueryConstraint)); -/** - * Creates a new `QueryConstraint` that is limited to return only the last - * specified number of children. - * - * The `limitToLast()` method is used to set a maximum number of children to be - * synced for a given callback. If we set a limit of 100, we will initially only - * receive up to 100 `child_added` events. If we have fewer than 100 messages - * stored in our Database, a `child_added` event will fire for each message. - * However, if we have over 100 messages, we will only receive a `child_added` - * event for the last 100 ordered messages. As items change, we will receive - * `child_removed` events for each item that drops out of the active list so - * that the total number stays at 100. - * - * You can read more about `limitToLast()` in - * {@link https://firebase.google.com/docs/database/web/lists-of-data#filtering_data | Filtering data}. - * - * @param limit - The maximum number of nodes to include in this query. - */ -function limitToLast(limit) { - if (typeof limit !== 'number' || Math.floor(limit) !== limit || limit <= 0) { - throw new Error('limitToLast: First argument must be a positive integer.'); - } - return new QueryLimitToLastConstraint(limit); -} -var QueryOrderByChildConstraint = /** @class */ (function (_super) { - tslib.__extends(QueryOrderByChildConstraint, _super); - function QueryOrderByChildConstraint(_path) { - var _this = _super.call(this) || this; - _this._path = _path; - return _this; - } - QueryOrderByChildConstraint.prototype._apply = function (query) { - validateNoPreviousOrderByCall(query, 'orderByChild'); - var parsedPath = new Path(this._path); - if (pathIsEmpty(parsedPath)) { - throw new Error('orderByChild: cannot pass in empty path. Use orderByValue() instead.'); - } - var index = new PathIndex(parsedPath); - var newParams = queryParamsOrderBy(query._queryParams, index); - validateQueryEndpoints(newParams); - return new QueryImpl(query._repo, query._path, newParams, - /*orderByCalled=*/ true); - }; - return QueryOrderByChildConstraint; -}(QueryConstraint)); -/** - * Creates a new `QueryConstraint` that orders by the specified child key. - * - * Queries can only order by one key at a time. Calling `orderByChild()` - * multiple times on the same query is an error. - * - * Firebase queries allow you to order your data by any child key on the fly. - * However, if you know in advance what your indexes will be, you can define - * them via the .indexOn rule in your Security Rules for better performance. See - * the{@link https://firebase.google.com/docs/database/security/indexing-data} - * rule for more information. - * - * You can read more about `orderByChild()` in - * {@link https://firebase.google.com/docs/database/web/lists-of-data#sort_data | Sort data}. - * - * @param path - The path to order by. - */ -function orderByChild(path) { - if (path === '$key') { - throw new Error('orderByChild: "$key" is invalid. Use orderByKey() instead.'); - } - else if (path === '$priority') { - throw new Error('orderByChild: "$priority" is invalid. Use orderByPriority() instead.'); - } - else if (path === '$value') { - throw new Error('orderByChild: "$value" is invalid. Use orderByValue() instead.'); - } - validatePathString('orderByChild', 'path', path, false); - return new QueryOrderByChildConstraint(path); -} -var QueryOrderByKeyConstraint = /** @class */ (function (_super) { - tslib.__extends(QueryOrderByKeyConstraint, _super); - function QueryOrderByKeyConstraint() { - return _super !== null && _super.apply(this, arguments) || this; - } - QueryOrderByKeyConstraint.prototype._apply = function (query) { - validateNoPreviousOrderByCall(query, 'orderByKey'); - var newParams = queryParamsOrderBy(query._queryParams, KEY_INDEX); - validateQueryEndpoints(newParams); - return new QueryImpl(query._repo, query._path, newParams, - /*orderByCalled=*/ true); - }; - return QueryOrderByKeyConstraint; -}(QueryConstraint)); -/** - * Creates a new `QueryConstraint` that orders by the key. - * - * Sorts the results of a query by their (ascending) key values. - * - * You can read more about `orderByKey()` in - * {@link https://firebase.google.com/docs/database/web/lists-of-data#sort_data | Sort data}. - */ -function orderByKey() { - return new QueryOrderByKeyConstraint(); -} -var QueryOrderByPriorityConstraint = /** @class */ (function (_super) { - tslib.__extends(QueryOrderByPriorityConstraint, _super); - function QueryOrderByPriorityConstraint() { - return _super !== null && _super.apply(this, arguments) || this; - } - QueryOrderByPriorityConstraint.prototype._apply = function (query) { - validateNoPreviousOrderByCall(query, 'orderByPriority'); - var newParams = queryParamsOrderBy(query._queryParams, PRIORITY_INDEX); - validateQueryEndpoints(newParams); - return new QueryImpl(query._repo, query._path, newParams, - /*orderByCalled=*/ true); - }; - return QueryOrderByPriorityConstraint; -}(QueryConstraint)); -/** - * Creates a new `QueryConstraint` that orders by priority. - * - * Applications need not use priority but can order collections by - * ordinary properties (see - * {@link https://firebase.google.com/docs/database/web/lists-of-data#sort_data | Sort data} - * for alternatives to priority. - */ -function orderByPriority() { - return new QueryOrderByPriorityConstraint(); -} -var QueryOrderByValueConstraint = /** @class */ (function (_super) { - tslib.__extends(QueryOrderByValueConstraint, _super); - function QueryOrderByValueConstraint() { - return _super !== null && _super.apply(this, arguments) || this; - } - QueryOrderByValueConstraint.prototype._apply = function (query) { - validateNoPreviousOrderByCall(query, 'orderByValue'); - var newParams = queryParamsOrderBy(query._queryParams, VALUE_INDEX); - validateQueryEndpoints(newParams); - return new QueryImpl(query._repo, query._path, newParams, - /*orderByCalled=*/ true); - }; - return QueryOrderByValueConstraint; -}(QueryConstraint)); -/** - * Creates a new `QueryConstraint` that orders by value. - * - * If the children of a query are all scalar values (string, number, or - * boolean), you can order the results by their (ascending) values. - * - * You can read more about `orderByValue()` in - * {@link https://firebase.google.com/docs/database/web/lists-of-data#sort_data | Sort data}. - */ -function orderByValue() { - return new QueryOrderByValueConstraint(); -} -var QueryEqualToValueConstraint = /** @class */ (function (_super) { - tslib.__extends(QueryEqualToValueConstraint, _super); - function QueryEqualToValueConstraint(_value, _key) { - var _this = _super.call(this) || this; - _this._value = _value; - _this._key = _key; - return _this; - } - QueryEqualToValueConstraint.prototype._apply = function (query) { - validateFirebaseDataArg('equalTo', this._value, query._path, false); - if (query._queryParams.hasStart()) { - throw new Error('equalTo: Starting point was already set (by another call to startAt/startAfter or ' + - 'equalTo).'); - } - if (query._queryParams.hasEnd()) { - throw new Error('equalTo: Ending point was already set (by another call to endAt/endBefore or ' + - 'equalTo).'); - } - return new QueryEndAtConstraint(this._value, this._key)._apply(new QueryStartAtConstraint(this._value, this._key)._apply(query)); - }; - return QueryEqualToValueConstraint; -}(QueryConstraint)); -/** - * Creates a `QueryConstraint` that includes children that match the specified - * value. - * - * Using `startAt()`, `startAfter()`, `endBefore()`, `endAt()` and `equalTo()` - * allows you to choose arbitrary starting and ending points for your queries. - * - * The optional key argument can be used to further limit the range of the - * query. If it is specified, then children that have exactly the specified - * value must also have exactly the specified key as their key name. This can be - * used to filter result sets with many matches for the same value. - * - * You can read more about `equalTo()` in - * {@link https://firebase.google.com/docs/database/web/lists-of-data#filtering_data | Filtering data}. - * - * @param value - The value to match for. The argument type depends on which - * `orderBy*()` function was used in this query. Specify a value that matches - * the `orderBy*()` type. When used in combination with `orderByKey()`, the - * value must be a string. - * @param key - The child key to start at, among the children with the - * previously specified priority. This argument is only allowed if ordering by - * child, value, or priority. - */ -function equalTo(value, key) { - validateKey('equalTo', 'key', key, true); - return new QueryEqualToValueConstraint(value, key); -} -/** - * Creates a new immutable instance of `Query` that is extended to also include - * additional query constraints. - * - * @param query - The Query instance to use as a base for the new constraints. - * @param queryConstraints - The list of `QueryConstraint`s to apply. - * @throws if any of the provided query constraints cannot be combined with the - * existing or new constraints. - */ -function query(query) { - var e_1, _a; - var queryConstraints = []; - for (var _i = 1; _i < arguments.length; _i++) { - queryConstraints[_i - 1] = arguments[_i]; - } - var queryImpl = util.getModularInstance(query); - try { - for (var queryConstraints_1 = tslib.__values(queryConstraints), queryConstraints_1_1 = queryConstraints_1.next(); !queryConstraints_1_1.done; queryConstraints_1_1 = queryConstraints_1.next()) { - var constraint = queryConstraints_1_1.value; - queryImpl = constraint._apply(queryImpl); - } - } - catch (e_1_1) { e_1 = { error: e_1_1 }; } - finally { - try { - if (queryConstraints_1_1 && !queryConstraints_1_1.done && (_a = queryConstraints_1.return)) _a.call(queryConstraints_1); - } - finally { if (e_1) throw e_1.error; } - } - return queryImpl; -} -/** - * Define reference constructor in various modules - * - * We are doing this here to avoid several circular - * dependency issues - */ -syncPointSetReferenceConstructor(ReferenceImpl); -syncTreeSetReferenceConstructor(ReferenceImpl); - -/** - * This variable is also defined in the firebase Node.js Admin SDK. Before - * modifying this definition, consult the definition in: - * - * https://github.com/firebase/firebase-admin-node - * - * and make sure the two are consistent. - */ -var FIREBASE_DATABASE_EMULATOR_HOST_VAR = 'FIREBASE_DATABASE_EMULATOR_HOST'; -/** - * Creates and caches `Repo` instances. - */ -var repos = {}; -/** - * If true, any new `Repo` will be created to use `ReadonlyRestClient` (for testing purposes). - */ -var useRestClient = false; -/** - * Update an existing `Repo` in place to point to a new host/port. - */ -function repoManagerApplyEmulatorSettings(repo, host, port, tokenProvider) { - repo.repoInfo_ = new RepoInfo(host + ":" + port, - /* secure= */ false, repo.repoInfo_.namespace, repo.repoInfo_.webSocketOnly, repo.repoInfo_.nodeAdmin, repo.repoInfo_.persistenceKey, repo.repoInfo_.includeNamespaceInQueryParams); - if (tokenProvider) { - repo.authTokenProvider_ = tokenProvider; - } -} -/** - * This function should only ever be called to CREATE a new database instance. - * @internal - */ -function repoManagerDatabaseFromApp(app, authProvider, appCheckProvider, url, nodeAdmin) { - var dbUrl = url || app.options.databaseURL; - if (dbUrl === undefined) { - if (!app.options.projectId) { - fatal("Can't determine Firebase Database URL. Be sure to include " + - ' a Project ID when calling firebase.initializeApp().'); - } - log('Using default host for project ', app.options.projectId); - dbUrl = app.options.projectId + "-default-rtdb.firebaseio.com"; - } - var parsedUrl = parseRepoInfo(dbUrl, nodeAdmin); - var repoInfo = parsedUrl.repoInfo; - var isEmulator; - var dbEmulatorHost = undefined; - if (typeof process !== 'undefined' && process.env) { - dbEmulatorHost = process.env[FIREBASE_DATABASE_EMULATOR_HOST_VAR]; - } - if (dbEmulatorHost) { - isEmulator = true; - dbUrl = "http://" + dbEmulatorHost + "?ns=" + repoInfo.namespace; - parsedUrl = parseRepoInfo(dbUrl, nodeAdmin); - repoInfo = parsedUrl.repoInfo; - } - else { - isEmulator = !parsedUrl.repoInfo.secure; - } - var authTokenProvider = nodeAdmin && isEmulator - ? new EmulatorTokenProvider(EmulatorTokenProvider.OWNER) - : new FirebaseAuthTokenProvider(app.name, app.options, authProvider); - validateUrl('Invalid Firebase Database URL', parsedUrl); - if (!pathIsEmpty(parsedUrl.path)) { - fatal('Database URL must point to the root of a Firebase Database ' + - '(not including a child path).'); - } - var repo = repoManagerCreateRepo(repoInfo, app, authTokenProvider, new AppCheckTokenProvider(app.name, appCheckProvider)); - return new Database(repo, app); -} -/** - * Remove the repo and make sure it is disconnected. - * - */ -function repoManagerDeleteRepo(repo, appName) { - var appRepos = repos[appName]; - // This should never happen... - if (!appRepos || appRepos[repo.key] !== repo) { - fatal("Database " + appName + "(" + repo.repoInfo_ + ") has already been deleted."); - } - repoInterrupt(repo); - delete appRepos[repo.key]; -} -/** - * Ensures a repo doesn't already exist and then creates one using the - * provided app. - * - * @param repoInfo - The metadata about the Repo - * @returns The Repo object for the specified server / repoName. - */ -function repoManagerCreateRepo(repoInfo, app, authTokenProvider, appCheckProvider) { - var appRepos = repos[app.name]; - if (!appRepos) { - appRepos = {}; - repos[app.name] = appRepos; - } - var repo = appRepos[repoInfo.toURLString()]; - if (repo) { - fatal('Database initialized multiple times. Please make sure the format of the database URL matches with each database() call.'); - } - repo = new Repo(repoInfo, useRestClient, authTokenProvider, appCheckProvider); - appRepos[repoInfo.toURLString()] = repo; - return repo; -} -/** - * Forces us to use ReadonlyRestClient instead of PersistentConnection for new Repos. - */ -function repoManagerForceRestClient(forceRestClient) { - useRestClient = forceRestClient; -} -/** - * Class representing a Firebase Realtime Database. - */ -var Database = /** @class */ (function () { - /** @hideconstructor */ - function Database(_repoInternal, - /** The {@link @firebase/app#FirebaseApp} associated with this Realtime Database instance. */ - app) { - this._repoInternal = _repoInternal; - this.app = app; - /** Represents a `Database` instance. */ - this['type'] = 'database'; - /** Track if the instance has been used (root or repo accessed) */ - this._instanceStarted = false; - } - Object.defineProperty(Database.prototype, "_repo", { - get: function () { - if (!this._instanceStarted) { - repoStart(this._repoInternal, this.app.options.appId, this.app.options['databaseAuthVariableOverride']); - this._instanceStarted = true; - } - return this._repoInternal; - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(Database.prototype, "_root", { - get: function () { - if (!this._rootInternal) { - this._rootInternal = new ReferenceImpl(this._repo, newEmptyPath()); - } - return this._rootInternal; - }, - enumerable: false, - configurable: true - }); - Database.prototype._delete = function () { - if (this._rootInternal !== null) { - repoManagerDeleteRepo(this._repo, this.app.name); - this._repoInternal = null; - this._rootInternal = null; - } - return Promise.resolve(); - }; - Database.prototype._checkNotDeleted = function (apiName) { - if (this._rootInternal === null) { - fatal('Cannot call ' + apiName + ' on a deleted database.'); - } - }; - return Database; -}()); -function checkTransportInit() { - if (TransportManager.IS_TRANSPORT_INITIALIZED) { - warn('Transport has already been initialized. Please call this function before calling ref or setting up a listener'); - } -} -/** - * Force the use of websockets instead of longPolling. - */ -function forceWebSockets() { - checkTransportInit(); - BrowserPollConnection.forceDisallow(); -} -/** - * Force the use of longPolling instead of websockets. This will be ignored if websocket protocol is used in databaseURL. - */ -function forceLongPolling() { - checkTransportInit(); - WebSocketConnection.forceDisallow(); - BrowserPollConnection.forceAllow(); -} -/** - * Modify the provided instance to communicate with the Realtime Database - * emulator. - * - *

Note: This method must be called before performing any other operation. - * - * @param db - The instance to modify. - * @param host - The emulator host (ex: localhost) - * @param port - The emulator port (ex: 8080) - * @param options.mockUserToken - the mock auth token to use for unit testing Security Rules - */ -function connectDatabaseEmulator(db, host, port, options) { - if (options === void 0) { options = {}; } - db = util.getModularInstance(db); - db._checkNotDeleted('useEmulator'); - if (db._instanceStarted) { - fatal('Cannot call useEmulator() after instance has already been initialized.'); - } - var repo = db._repoInternal; - var tokenProvider = undefined; - if (repo.repoInfo_.nodeAdmin) { - if (options.mockUserToken) { - fatal('mockUserToken is not supported by the Admin SDK. For client access with mock users, please use the "firebase" package instead of "firebase-admin".'); - } - tokenProvider = new EmulatorTokenProvider(EmulatorTokenProvider.OWNER); - } - else if (options.mockUserToken) { - var token = typeof options.mockUserToken === 'string' - ? options.mockUserToken - : util.createMockUserToken(options.mockUserToken, db.app.options.projectId); - tokenProvider = new EmulatorTokenProvider(token); - } - // Modify the repo to apply emulator settings - repoManagerApplyEmulatorSettings(repo, host, port, tokenProvider); -} -/** - * Disconnects from the server (all Database operations will be completed - * offline). - * - * The client automatically maintains a persistent connection to the Database - * server, which will remain active indefinitely and reconnect when - * disconnected. However, the `goOffline()` and `goOnline()` methods may be used - * to control the client connection in cases where a persistent connection is - * undesirable. - * - * While offline, the client will no longer receive data updates from the - * Database. However, all Database operations performed locally will continue to - * immediately fire events, allowing your application to continue behaving - * normally. Additionally, each operation performed locally will automatically - * be queued and retried upon reconnection to the Database server. - * - * To reconnect to the Database and begin receiving remote events, see - * `goOnline()`. - * - * @param db - The instance to disconnect. - */ -function goOffline(db) { - db = util.getModularInstance(db); - db._checkNotDeleted('goOffline'); - repoInterrupt(db._repo); -} -/** - * Reconnects to the server and synchronizes the offline Database state - * with the server state. - * - * This method should be used after disabling the active connection with - * `goOffline()`. Once reconnected, the client will transmit the proper data - * and fire the appropriate events so that your client "catches up" - * automatically. - * - * @param db - The instance to reconnect. - */ -function goOnline(db) { - db = util.getModularInstance(db); - db._checkNotDeleted('goOnline'); - repoResume(db._repo); -} -function enableLogging(logger, persistent) { - enableLogging$1(logger, persistent); -} - -/** - * @license - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var SERVER_TIMESTAMP = { - '.sv': 'timestamp' -}; -/** - * Returns a placeholder value for auto-populating the current timestamp (time - * since the Unix epoch, in milliseconds) as determined by the Firebase - * servers. - */ -function serverTimestamp() { - return SERVER_TIMESTAMP; -} -/** - * Returns a placeholder value that can be used to atomically increment the - * current database value by the provided delta. - * - * @param delta - the amount to modify the current value atomically. - * @returns A placeholder value for modifying data atomically server-side. - */ -function increment(delta) { - return { - '.sv': { - 'increment': delta - } - }; -} - -/** - * @license - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * A type for the resolve value of {@link runTransaction}. - */ -var TransactionResult = /** @class */ (function () { - /** @hideconstructor */ - function TransactionResult( - /** Whether the transaction was successfully committed. */ - committed, - /** The resulting data snapshot. */ - snapshot) { - this.committed = committed; - this.snapshot = snapshot; - } - /** Returns a JSON-serializable representation of this object. */ - TransactionResult.prototype.toJSON = function () { - return { committed: this.committed, snapshot: this.snapshot.toJSON() }; - }; - return TransactionResult; -}()); -/** - * Atomically modifies the data at this location. - * - * Atomically modify the data at this location. Unlike a normal `set()`, which - * just overwrites the data regardless of its previous value, `runTransaction()` is - * used to modify the existing value to a new value, ensuring there are no - * conflicts with other clients writing to the same location at the same time. - * - * To accomplish this, you pass `runTransaction()` an update function which is - * used to transform the current value into a new value. If another client - * writes to the location before your new value is successfully written, your - * update function will be called again with the new current value, and the - * write will be retried. This will happen repeatedly until your write succeeds - * without conflict or you abort the transaction by not returning a value from - * your update function. - * - * Note: Modifying data with `set()` will cancel any pending transactions at - * that location, so extreme care should be taken if mixing `set()` and - * `runTransaction()` to update the same data. - * - * Note: When using transactions with Security and Firebase Rules in place, be - * aware that a client needs `.read` access in addition to `.write` access in - * order to perform a transaction. This is because the client-side nature of - * transactions requires the client to read the data in order to transactionally - * update it. - * - * @param ref - The location to atomically modify. - * @param transactionUpdate - A developer-supplied function which will be passed - * the current data stored at this location (as a JavaScript object). The - * function should return the new value it would like written (as a JavaScript - * object). If `undefined` is returned (i.e. you return with no arguments) the - * transaction will be aborted and the data at this location will not be - * modified. - * @param options - An options object to configure transactions. - * @returns A `Promise` that can optionally be used instead of the `onComplete` - * callback to handle success and failure. - */ -function runTransaction(ref, -// eslint-disable-next-line @typescript-eslint/no-explicit-any -transactionUpdate, options) { - var _a; - ref = util.getModularInstance(ref); - validateWritablePath('Reference.transaction', ref._path); - if (ref.key === '.length' || ref.key === '.keys') { - throw ('Reference.transaction failed: ' + ref.key + ' is a read-only object.'); - } - var applyLocally = (_a = options === null || options === void 0 ? void 0 : options.applyLocally) !== null && _a !== void 0 ? _a : true; - var deferred = new util.Deferred(); - var promiseComplete = function (error, committed, node) { - var dataSnapshot = null; - if (error) { - deferred.reject(error); - } - else { - dataSnapshot = new DataSnapshot(node, new ReferenceImpl(ref._repo, ref._path), PRIORITY_INDEX); - deferred.resolve(new TransactionResult(committed, dataSnapshot)); - } - }; - // Add a watch to make sure we get server updates. - var unwatcher = onValue(ref, function () { }); - repoStartTransaction(ref._repo, ref._path, transactionUpdate, promiseComplete, unwatcher, applyLocally); - return deferred.promise; -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// eslint-disable-next-line @typescript-eslint/no-explicit-any -PersistentConnection.prototype.simpleListen = function (pathString, onComplete) { - this.sendRequest('q', { p: pathString }, onComplete); -}; -// eslint-disable-next-line @typescript-eslint/no-explicit-any -PersistentConnection.prototype.echo = function (data, onEcho) { - this.sendRequest('echo', { d: data }, onEcho); -}; -/** - * @internal - */ -var hijackHash = function (newHash) { - var oldPut = PersistentConnection.prototype.put; - PersistentConnection.prototype.put = function (pathString, data, onComplete, hash) { - if (hash !== undefined) { - hash = newHash(); - } - oldPut.call(this, pathString, data, onComplete, hash); - }; - return function () { - PersistentConnection.prototype.put = oldPut; - }; -}; -/** - * Forces the RepoManager to create Repos that use ReadonlyRestClient instead of PersistentConnection. - * @internal - */ -var forceRestClient = function (forceRestClient) { - repoManagerForceRestClient(forceRestClient); -}; - -/** - * @license - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -setWebSocketImpl(Websocket__default["default"].Client); - -exports.DataSnapshot = DataSnapshot; -exports.Database = Database; -exports.OnDisconnect = OnDisconnect; -exports.QueryConstraint = QueryConstraint; -exports.TransactionResult = TransactionResult; -exports._QueryImpl = QueryImpl; -exports._QueryParams = QueryParams; -exports._ReferenceImpl = ReferenceImpl; -exports._TEST_ACCESS_forceRestClient = forceRestClient; -exports._TEST_ACCESS_hijackHash = hijackHash; -exports._repoManagerDatabaseFromApp = repoManagerDatabaseFromApp; -exports._setSDKVersion = setSDKVersion; -exports._validatePathString = validatePathString; -exports._validateWritablePath = validateWritablePath; -exports.child = child; -exports.connectDatabaseEmulator = connectDatabaseEmulator; -exports.enableLogging = enableLogging; -exports.endAt = endAt; -exports.endBefore = endBefore; -exports.equalTo = equalTo; -exports.forceLongPolling = forceLongPolling; -exports.forceWebSockets = forceWebSockets; -exports.get = get; -exports.goOffline = goOffline; -exports.goOnline = goOnline; -exports.increment = increment; -exports.limitToFirst = limitToFirst; -exports.limitToLast = limitToLast; -exports.off = off; -exports.onChildAdded = onChildAdded; -exports.onChildChanged = onChildChanged; -exports.onChildMoved = onChildMoved; -exports.onChildRemoved = onChildRemoved; -exports.onDisconnect = onDisconnect; -exports.onValue = onValue; -exports.orderByChild = orderByChild; -exports.orderByKey = orderByKey; -exports.orderByPriority = orderByPriority; -exports.orderByValue = orderByValue; -exports.push = push; -exports.query = query; -exports.ref = ref; -exports.refFromURL = refFromURL; -exports.remove = remove; -exports.runTransaction = runTransaction; -exports.serverTimestamp = serverTimestamp; -exports.set = set; -exports.setPriority = setPriority; -exports.setWithPriority = setWithPriority; -exports.startAfter = startAfter; -exports.startAt = startAt; -exports.update = update; -//# sourceMappingURL=index.standalone.js.map diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/internal.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/internal.d.ts deleted file mode 100644 index 89eadefe..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/internal.d.ts +++ /dev/null @@ -1,2972 +0,0 @@ -/** - * Firebase Realtime Database - * - * @packageDocumentation - */ - -import { AppCheckInternalComponentName } from '@firebase/app-check-interop-types'; -import { AppCheckTokenListener } from '@firebase/app-check-interop-types'; -import { AppCheckTokenResult } from '@firebase/app-check-interop-types'; -import { EmulatorMockTokenOptions } from '@firebase/util'; -import { FirebaseApp } from '@firebase/app'; -import { FirebaseAuthInternalName } from '@firebase/auth-interop-types'; -import { FirebaseAuthTokenData } from '@firebase/app-types/private'; -import { _FirebaseService } from '@firebase/app'; -import { Provider } from '@firebase/component'; - -/** - * Abstraction around AppCheck's token fetching capabilities. - */ -declare class AppCheckTokenProvider { - private appName_; - private appCheckProvider?; - private appCheck?; - constructor(appName_: string, appCheckProvider?: Provider); - getToken(forceRefresh?: boolean): Promise; - addTokenChangeListener(listener: AppCheckTokenListener): void; - notifyForInvalidToken(): void; -} - -declare interface AuthTokenProvider { - getToken(forceRefresh: boolean): Promise; - addTokenChangeListener(listener: (token: string | null) => void): void; - removeTokenChangeListener(listener: (token: string | null) => void): void; - notifyForInvalidToken(): void; -} - -/** - * A cache node only stores complete children. Additionally it holds a flag whether the node can be considered fully - * initialized in the sense that we know at one point in time this represented a valid state of the world, e.g. - * initialized with data from the server, or a complete overwrite by the client. The filtered flag also tracks - * whether a node potentially had children removed due to a filter. - */ -declare class CacheNode { - private node_; - private fullyInitialized_; - private filtered_; - constructor(node_: Node_2, fullyInitialized_: boolean, filtered_: boolean); - /** - * Returns whether this node was fully initialized with either server data or a complete overwrite by the client - */ - isFullyInitialized(): boolean; - /** - * Returns whether this node is potentially missing children due to a filter applied to the node - */ - isFiltered(): boolean; - isCompleteForPath(path: Path): boolean; - isCompleteForChild(key: string): boolean; - getNode(): Node_2; -} - -declare class CancelEvent implements Event_2 { - eventRegistration: EventRegistration; - error: Error; - path: Path; - constructor(eventRegistration: EventRegistration, error: Error, path: Path); - getPath(): Path; - getEventType(): string; - getEventRunner(): () => void; - toString(): string; -} - -declare interface Change { - /** @param type - The event type */ - type: ChangeType; - /** @param snapshotNode - The data */ - snapshotNode: Node_2; - /** @param childName - The name for this child, if it's a child even */ - childName?: string; - /** @param oldSnap - Used for intermediate processing of child changed events */ - oldSnap?: Node_2; - /** * @param prevName - The name for the previous child, if applicable */ - prevName?: string | null; -} - -declare const enum ChangeType { - /** Event type for a child added */ - CHILD_ADDED = "child_added", - /** Event type for a child removed */ - CHILD_REMOVED = "child_removed", - /** Event type for a child changed */ - CHILD_CHANGED = "child_changed", - /** Event type for a child moved */ - CHILD_MOVED = "child_moved", - /** Event type for a value change */ - VALUE = "value" -} - -/** - * Gets a `Reference` for the location at the specified relative path. - * - * The relative path can either be a simple child name (for example, "ada") or - * a deeper slash-separated path (for example, "ada/name/first"). - * - * @param parent - The parent location. - * @param path - A relative path from this location to the desired child - * location. - * @returns The specified child location. - */ -export declare function child(parent: DatabaseReference, path: string): DatabaseReference; - -declare class ChildChangeAccumulator { - private readonly changeMap; - trackChildChange(change: Change): void; - getChanges(): Change[]; -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * @fileoverview Implementation of an immutable SortedMap using a Left-leaning - * Red-Black Tree, adapted from the implementation in Mugs - * (http://mads379.github.com/mugs/) by Mads Hartmann Jensen - * (mads379\@gmail.com). - * - * Original paper on Left-leaning Red-Black Trees: - * http://www.cs.princeton.edu/~rs/talks/LLRB/LLRB.pdf - * - * Invariant 1: No red node has a red child - * Invariant 2: Every leaf path has the same number of black nodes - * Invariant 3: Only the left child can be red (left leaning) - */ -declare type Comparator = (key1: K, key2: K) => number; - -/** - * Since updates to filtered nodes might require nodes to be pulled in from "outside" the node, this interface - * can help to get complete children that can be pulled in. - * A class implementing this interface takes potentially multiple sources (e.g. user writes, server data from - * other views etc.) to try it's best to get a complete child that might be useful in pulling into the view. - * - * @interface - */ -declare interface CompleteChildSource { - getCompleteChild(childKey: string): Node_2 | null; - getChildAfterChild(index: Index, child: NamedNode, reverse: boolean): NamedNode | null; -} - -/** - * This class holds a collection of writes that can be applied to nodes in unison. It abstracts away the logic with - * dealing with priority writes and multiple nested writes. At any given path there is only allowed to be one write - * modifying that path. Any write to an existing path or shadowing an existing path will modify that existing write - * to reflect the write added. - */ -declare class CompoundWrite { - writeTree_: ImmutableTree; - constructor(writeTree_: ImmutableTree); - static empty(): CompoundWrite; -} - -/** - * Modify the provided instance to communicate with the Realtime Database - * emulator. - * - *

Note: This method must be called before performing any other operation. - * - * @param db - The instance to modify. - * @param host - The emulator host (ex: localhost) - * @param port - The emulator port (ex: 8080) - * @param options.mockUserToken - the mock auth token to use for unit testing Security Rules - */ -export declare function connectDatabaseEmulator(db: Database, host: string, port: number, options?: { - mockUserToken?: EmulatorMockTokenOptions | string; -}): void; - -/** - * Class representing a Firebase Realtime Database. - */ -export declare class Database implements _FirebaseService { - _repoInternal: Repo; - /** The {@link @firebase/app#FirebaseApp} associated with this Realtime Database instance. */ - readonly app: FirebaseApp; - /** Represents a `Database` instance. */ - readonly 'type' = "database"; - /** Track if the instance has been used (root or repo accessed) */ - _instanceStarted: boolean; - /** Backing state for root_ */ - private _rootInternal?; - /** @hideconstructor */ - constructor(_repoInternal: Repo, - /** The {@link @firebase/app#FirebaseApp} associated with this Realtime Database instance. */ - app: FirebaseApp); - get _repo(): Repo; - get _root(): _ReferenceImpl; - _delete(): Promise; - _checkNotDeleted(apiName: string): void; -} - -/** - * A `DatabaseReference` represents a specific location in your Database and can be used - * for reading or writing data to that Database location. - * - * You can reference the root or child location in your Database by calling - * `ref()` or `ref("child/path")`. - * - * Writing is done with the `set()` method and reading can be done with the - * `on*()` method. See {@link - * https://firebase.google.com/docs/database/web/read-and-write} - */ -export declare interface DatabaseReference extends Query { - /** - * The last part of the `DatabaseReference`'s path. - * - * For example, `"ada"` is the key for - * `https://.firebaseio.com/users/ada`. - * - * The key of a root `DatabaseReference` is `null`. - */ - readonly key: string | null; - /** - * The parent location of a `DatabaseReference`. - * - * The parent of a root `DatabaseReference` is `null`. - */ - readonly parent: DatabaseReference | null; - /** The root `DatabaseReference` of the Database. */ - readonly root: DatabaseReference; -} - -/** - * A `DataSnapshot` contains data from a Database location. - * - * Any time you read data from the Database, you receive the data as a - * `DataSnapshot`. A `DataSnapshot` is passed to the event callbacks you attach - * with `on()` or `once()`. You can extract the contents of the snapshot as a - * JavaScript object by calling the `val()` method. Alternatively, you can - * traverse into the snapshot by calling `child()` to return child snapshots - * (which you could then call `val()` on). - * - * A `DataSnapshot` is an efficiently generated, immutable copy of the data at - * a Database location. It cannot be modified and will never change (to modify - * data, you always call the `set()` method on a `Reference` directly). - */ -export declare class DataSnapshot { - readonly _node: Node_2; - /** - * The location of this DataSnapshot. - */ - readonly ref: DatabaseReference; - readonly _index: Index; - /** - * @param _node - A SnapshotNode to wrap. - * @param ref - The location this snapshot came from. - * @param _index - The iteration order for this snapshot - * @hideconstructor - */ - constructor(_node: Node_2, - /** - * The location of this DataSnapshot. - */ - ref: DatabaseReference, _index: Index); - /** - * Gets the priority value of the data in this `DataSnapshot`. - * - * Applications need not use priority but can order collections by - * ordinary properties (see - * {@link https://firebase.google.com/docs/database/web/lists-of-data#sorting_and_filtering_data |Sorting and filtering data} - * ). - */ - get priority(): string | number | null; - /** - * The key (last part of the path) of the location of this `DataSnapshot`. - * - * The last token in a Database location is considered its key. For example, - * "ada" is the key for the /users/ada/ node. Accessing the key on any - * `DataSnapshot` will return the key for the location that generated it. - * However, accessing the key on the root URL of a Database will return - * `null`. - */ - get key(): string | null; - /** Returns the number of child properties of this `DataSnapshot`. */ - get size(): number; - /** - * Gets another `DataSnapshot` for the location at the specified relative path. - * - * Passing a relative path to the `child()` method of a DataSnapshot returns - * another `DataSnapshot` for the location at the specified relative path. The - * relative path can either be a simple child name (for example, "ada") or a - * deeper, slash-separated path (for example, "ada/name/first"). If the child - * location has no data, an empty `DataSnapshot` (that is, a `DataSnapshot` - * whose value is `null`) is returned. - * - * @param path - A relative path to the location of child data. - */ - child(path: string): DataSnapshot; - /** - * Returns true if this `DataSnapshot` contains any data. It is slightly more - * efficient than using `snapshot.val() !== null`. - */ - exists(): boolean; - /** - * Exports the entire contents of the DataSnapshot as a JavaScript object. - * - * The `exportVal()` method is similar to `val()`, except priority information - * is included (if available), making it suitable for backing up your data. - * - * @returns The DataSnapshot's contents as a JavaScript value (Object, - * Array, string, number, boolean, or `null`). - */ - exportVal(): any; - /** - * Enumerates the top-level children in the `DataSnapshot`. - * - * Because of the way JavaScript objects work, the ordering of data in the - * JavaScript object returned by `val()` is not guaranteed to match the - * ordering on the server nor the ordering of `onChildAdded()` events. That is - * where `forEach()` comes in handy. It guarantees the children of a - * `DataSnapshot` will be iterated in their query order. - * - * If no explicit `orderBy*()` method is used, results are returned - * ordered by key (unless priorities are used, in which case, results are - * returned by priority). - * - * @param action - A function that will be called for each child DataSnapshot. - * The callback can return true to cancel further enumeration. - * @returns true if enumeration was canceled due to your callback returning - * true. - */ - forEach(action: (child: DataSnapshot) => boolean | void): boolean; - /** - * Returns true if the specified child path has (non-null) data. - * - * @param path - A relative path to the location of a potential child. - * @returns `true` if data exists at the specified child path; else - * `false`. - */ - hasChild(path: string): boolean; - /** - * Returns whether or not the `DataSnapshot` has any non-`null` child - * properties. - * - * You can use `hasChildren()` to determine if a `DataSnapshot` has any - * children. If it does, you can enumerate them using `forEach()`. If it - * doesn't, then either this snapshot contains a primitive value (which can be - * retrieved with `val()`) or it is empty (in which case, `val()` will return - * `null`). - * - * @returns true if this snapshot has any children; else false. - */ - hasChildren(): boolean; - /** - * Returns a JSON-serializable representation of this object. - */ - toJSON(): object | null; - /** - * Extracts a JavaScript value from a `DataSnapshot`. - * - * Depending on the data in a `DataSnapshot`, the `val()` method may return a - * scalar type (string, number, or boolean), an array, or an object. It may - * also return null, indicating that the `DataSnapshot` is empty (contains no - * data). - * - * @returns The DataSnapshot's contents as a JavaScript value (Object, - * Array, string, number, boolean, or `null`). - */ - val(): any; -} -export { EmulatorMockTokenOptions } - -/** - * Logs debugging information to the console. - * - * @param enabled - Enables logging if `true`, disables logging if `false`. - * @param persistent - Remembers the logging state between page refreshes if - * `true`. - */ -export declare function enableLogging(enabled: boolean, persistent?: boolean): any; - -/** - * Logs debugging information to the console. - * - * @param logger - A custom logger function to control how things get logged. - */ -export declare function enableLogging(logger: (message: string) => unknown): any; - -/** - * Creates a `QueryConstraint` with the specified ending point. - * - * Using `startAt()`, `startAfter()`, `endBefore()`, `endAt()` and `equalTo()` - * allows you to choose arbitrary starting and ending points for your queries. - * - * The ending point is inclusive, so children with exactly the specified value - * will be included in the query. The optional key argument can be used to - * further limit the range of the query. If it is specified, then children that - * have exactly the specified value must also have a key name less than or equal - * to the specified key. - * - * You can read more about `endAt()` in - * {@link https://firebase.google.com/docs/database/web/lists-of-data#filtering_data | Filtering data}. - * - * @param value - The value to end at. The argument type depends on which - * `orderBy*()` function was used in this query. Specify a value that matches - * the `orderBy*()` type. When used in combination with `orderByKey()`, the - * value must be a string. - * @param key - The child key to end at, among the children with the previously - * specified priority. This argument is only allowed if ordering by child, - * value, or priority. - */ -export declare function endAt(value: number | string | boolean | null, key?: string): QueryConstraint; - -/** - * Creates a `QueryConstraint` with the specified ending point (exclusive). - * - * Using `startAt()`, `startAfter()`, `endBefore()`, `endAt()` and `equalTo()` - * allows you to choose arbitrary starting and ending points for your queries. - * - * The ending point is exclusive. If only a value is provided, children - * with a value less than the specified value will be included in the query. - * If a key is specified, then children must have a value less than or equal - * to the specified value and a key name less than the specified key. - * - * @param value - The value to end before. The argument type depends on which - * `orderBy*()` function was used in this query. Specify a value that matches - * the `orderBy*()` type. When used in combination with `orderByKey()`, the - * value must be a string. - * @param key - The child key to end before, among the children with the - * previously specified priority. This argument is only allowed if ordering by - * child, value, or priority. - */ -export declare function endBefore(value: number | string | boolean | null, key?: string): QueryConstraint; - -/** - * Creates a `QueryConstraint` that includes children that match the specified - * value. - * - * Using `startAt()`, `startAfter()`, `endBefore()`, `endAt()` and `equalTo()` - * allows you to choose arbitrary starting and ending points for your queries. - * - * The optional key argument can be used to further limit the range of the - * query. If it is specified, then children that have exactly the specified - * value must also have exactly the specified key as their key name. This can be - * used to filter result sets with many matches for the same value. - * - * You can read more about `equalTo()` in - * {@link https://firebase.google.com/docs/database/web/lists-of-data#filtering_data | Filtering data}. - * - * @param value - The value to match for. The argument type depends on which - * `orderBy*()` function was used in this query. Specify a value that matches - * the `orderBy*()` type. When used in combination with `orderByKey()`, the - * value must be a string. - * @param key - The child key to start at, among the children with the - * previously specified priority. This argument is only allowed if ordering by - * child, value, or priority. - */ -export declare function equalTo(value: number | string | boolean | null, key?: string): QueryConstraint; - -/** - * Encapsulates the data needed to raise an event - * @interface - */ -declare interface Event_2 { - getPath(): Path; - getEventType(): string; - getEventRunner(): () => void; - toString(): string; -} - -/** - * An EventGenerator is used to convert "raw" changes (Change) as computed by the - * CacheDiffer into actual events (Event) that can be raised. See generateEventsForChanges() - * for details. - * - */ -declare class EventGenerator { - query_: QueryContext; - index_: Index; - constructor(query_: QueryContext); -} - -declare interface EventList { - events: Event_2[]; - path: Path; -} - -/** - * The event queue serves a few purposes: - * 1. It ensures we maintain event order in the face of event callbacks doing operations that result in more - * events being queued. - * 2. raiseQueuedEvents() handles being called reentrantly nicely. That is, if in the course of raising events, - * raiseQueuedEvents() is called again, the "inner" call will pick up raising events where the "outer" call - * left off, ensuring that the events are still raised synchronously and in order. - * 3. You can use raiseEventsAtPath and raiseEventsForChangedPath to ensure only relevant previously-queued - * events are raised synchronously. - * - * NOTE: This can all go away if/when we move to async events. - * - */ -declare class EventQueue { - eventLists_: EventList[]; - /** - * Tracks recursion depth of raiseQueuedEvents_, for debugging purposes. - */ - recursionDepth_: number; -} - -/** - * An EventRegistration is basically an event type ('value', 'child_added', etc.) and a callback - * to be notified of that type of event. - * - * That said, it can also contain a cancel callback to be notified if the event is canceled. And - * currently, this code is organized around the idea that you would register multiple child_ callbacks - * together, as a single EventRegistration. Though currently we don't do that. - */ -declare interface EventRegistration { - /** - * True if this container has a callback to trigger for this event type - */ - respondsTo(eventType: string): boolean; - createEvent(change: Change, query: QueryContext): Event_2; - /** - * Given event data, return a function to trigger the user's callback - */ - getEventRunner(eventData: Event_2): () => void; - createCancelEvent(error: Error, path: Path): CancelEvent | null; - matches(other: EventRegistration): boolean; - /** - * False basically means this is a "dummy" callback container being used as a sentinel - * to remove all callback containers of a particular type. (e.g. if the user does - * ref.off('value') without specifying a specific callback). - * - * (TODO: Rework this, since it's hacky) - * - */ - hasAnyCallback(): boolean; -} - -/** - * One of the following strings: "value", "child_added", "child_changed", - * "child_removed", or "child_moved." - */ -export declare type EventType = 'value' | 'child_added' | 'child_changed' | 'child_moved' | 'child_removed'; - -/** - * Force the use of longPolling instead of websockets. This will be ignored if websocket protocol is used in databaseURL. - */ -export declare function forceLongPolling(): void; - -/** - * Force the use of websockets instead of longPolling. - */ -export declare function forceWebSockets(): void; - -/** - * Gets the most up-to-date result for this query. - * - * @param query - The query to run. - * @returns A `Promise` which resolves to the resulting DataSnapshot if a value is - * available, or rejects if the client is unable to return a value (e.g., if the - * server is unreachable and there is nothing cached). - */ -export declare function get(query: Query): Promise; - -/** - * Returns the instance of the Realtime Database SDK that is associated - * with the provided {@link @firebase/app#FirebaseApp}. Initializes a new instance with - * with default settings if no instance exists or if the existing instance uses - * a custom database URL. - * - * @param app - The {@link @firebase/app#FirebaseApp} instance that the returned Realtime - * Database instance is associated with. - * @param url - The URL of the Realtime Database instance to connect to. If not - * provided, the SDK connects to the default instance of the Firebase App. - * @returns The `Database` instance of the provided app. - */ -export declare function getDatabase(app?: FirebaseApp, url?: string): Database; - -/** - * Disconnects from the server (all Database operations will be completed - * offline). - * - * The client automatically maintains a persistent connection to the Database - * server, which will remain active indefinitely and reconnect when - * disconnected. However, the `goOffline()` and `goOnline()` methods may be used - * to control the client connection in cases where a persistent connection is - * undesirable. - * - * While offline, the client will no longer receive data updates from the - * Database. However, all Database operations performed locally will continue to - * immediately fire events, allowing your application to continue behaving - * normally. Additionally, each operation performed locally will automatically - * be queued and retried upon reconnection to the Database server. - * - * To reconnect to the Database and begin receiving remote events, see - * `goOnline()`. - * - * @param db - The instance to disconnect. - */ -export declare function goOffline(db: Database): void; - -/** - * Reconnects to the server and synchronizes the offline Database state - * with the server state. - * - * This method should be used after disabling the active connection with - * `goOffline()`. Once reconnected, the client will transmit the proper data - * and fire the appropriate events so that your client "catches up" - * automatically. - * - * @param db - The instance to reconnect. - */ -export declare function goOnline(db: Database): void; - -/** - * A tree with immutable elements. - */ -declare class ImmutableTree { - readonly value: T | null; - readonly children: SortedMap>; - static fromObject(obj: { - [k: string]: T; - }): ImmutableTree; - constructor(value: T | null, children?: SortedMap>); - /** - * True if the value is empty and there are no children - */ - isEmpty(): boolean; - /** - * Given a path and predicate, return the first node and the path to that node - * where the predicate returns true. - * - * TODO Do a perf test -- If we're creating a bunch of `{path: value:}` - * objects on the way back out, it may be better to pass down a pathSoFar obj. - * - * @param relativePath - The remainder of the path - * @param predicate - The predicate to satisfy to return a node - */ - findRootMostMatchingPathAndValue(relativePath: Path, predicate: (a: T) => boolean): { - path: Path; - value: T; - } | null; - /** - * Find, if it exists, the shortest subpath of the given path that points a defined - * value in the tree - */ - findRootMostValueAndPath(relativePath: Path): { - path: Path; - value: T; - } | null; - /** - * @returns The subtree at the given path - */ - subtree(relativePath: Path): ImmutableTree; - /** - * Sets a value at the specified path. - * - * @param relativePath - Path to set value at. - * @param toSet - Value to set. - * @returns Resulting tree. - */ - set(relativePath: Path, toSet: T | null): ImmutableTree; - /** - * Removes the value at the specified path. - * - * @param relativePath - Path to value to remove. - * @returns Resulting tree. - */ - remove(relativePath: Path): ImmutableTree; - /** - * Gets a value from the tree. - * - * @param relativePath - Path to get value for. - * @returns Value at path, or null. - */ - get(relativePath: Path): T | null; - /** - * Replace the subtree at the specified path with the given new tree. - * - * @param relativePath - Path to replace subtree for. - * @param newTree - New tree. - * @returns Resulting tree. - */ - setTree(relativePath: Path, newTree: ImmutableTree): ImmutableTree; - /** - * Performs a depth first fold on this tree. Transforms a tree into a single - * value, given a function that operates on the path to a node, an optional - * current value, and a map of child names to folded subtrees - */ - fold(fn: (path: Path, value: T, children: { - [k: string]: V; - }) => V): V; - /** - * Recursive helper for public-facing fold() method - */ - private fold_; - /** - * Find the first matching value on the given path. Return the result of applying f to it. - */ - findOnPath(path: Path, f: (path: Path, value: T) => V | null): V | null; - private findOnPath_; - foreachOnPath(path: Path, f: (path: Path, value: T) => void): ImmutableTree; - private foreachOnPath_; - /** - * Calls the given function for each node in the tree that has a value. - * - * @param f - A function to be called with the path from the root of the tree to - * a node, and the value at that node. Called in depth-first order. - */ - foreach(f: (path: Path, value: T) => void): void; - private foreach_; - foreachChild(f: (name: string, value: T) => void): void; -} - -/** - * Returns a placeholder value that can be used to atomically increment the - * current database value by the provided delta. - * - * @param delta - the amount to modify the current value atomically. - * @returns A placeholder value for modifying data atomically server-side. - */ -export declare function increment(delta: number): object; - -declare abstract class Index { - abstract compare(a: NamedNode, b: NamedNode): number; - abstract isDefinedOn(node: Node_2): boolean; - /** - * @returns A standalone comparison function for - * this index - */ - getCompare(): Comparator; - /** - * Given a before and after value for a node, determine if the indexed value has changed. Even if they are different, - * it's possible that the changes are isolated to parts of the snapshot that are not indexed. - * - * - * @returns True if the portion of the snapshot being indexed changed between oldNode and newNode - */ - indexedValueChanged(oldNode: Node_2, newNode: Node_2): boolean; - /** - * @returns a node wrapper that will sort equal to or less than - * any other node wrapper, using this index - */ - minPost(): NamedNode; - /** - * @returns a node wrapper that will sort greater than or equal to - * any other node wrapper, using this index - */ - abstract maxPost(): NamedNode; - abstract makePost(indexValue: unknown, name: string): NamedNode; - /** - * @returns String representation for inclusion in a query spec - */ - abstract toString(): string; -} - -/** - * Creates a new `QueryConstraint` that if limited to the first specific number - * of children. - * - * The `limitToFirst()` method is used to set a maximum number of children to be - * synced for a given callback. If we set a limit of 100, we will initially only - * receive up to 100 `child_added` events. If we have fewer than 100 messages - * stored in our Database, a `child_added` event will fire for each message. - * However, if we have over 100 messages, we will only receive a `child_added` - * event for the first 100 ordered messages. As items change, we will receive - * `child_removed` events for each item that drops out of the active list so - * that the total number stays at 100. - * - * You can read more about `limitToFirst()` in - * {@link https://firebase.google.com/docs/database/web/lists-of-data#filtering_data | Filtering data}. - * - * @param limit - The maximum number of nodes to include in this query. - */ -export declare function limitToFirst(limit: number): QueryConstraint; - -/** - * Creates a new `QueryConstraint` that is limited to return only the last - * specified number of children. - * - * The `limitToLast()` method is used to set a maximum number of children to be - * synced for a given callback. If we set a limit of 100, we will initially only - * receive up to 100 `child_added` events. If we have fewer than 100 messages - * stored in our Database, a `child_added` event will fire for each message. - * However, if we have over 100 messages, we will only receive a `child_added` - * event for the last 100 ordered messages. As items change, we will receive - * `child_removed` events for each item that drops out of the active list so - * that the total number stays at 100. - * - * You can read more about `limitToLast()` in - * {@link https://firebase.google.com/docs/database/web/lists-of-data#filtering_data | Filtering data}. - * - * @param limit - The maximum number of nodes to include in this query. - */ -export declare function limitToLast(limit: number): QueryConstraint; - -/** An options objects that can be used to customize a listener. */ -export declare interface ListenOptions { - /** Whether to remove the listener after its first invocation. */ - readonly onlyOnce?: boolean; -} - -declare interface ListenProvider { - startListening(query: QueryContext, tag: number | null, hashFn: () => string, onComplete: (a: string, b?: unknown) => Event_2[]): Event_2[]; - stopListening(a: QueryContext, b: number | null): void; -} - -/** - * Represents an empty node (a leaf node in the Red-Black Tree). - */ -declare class LLRBEmptyNode { - key: K; - value: V; - left: LLRBNode | LLRBEmptyNode; - right: LLRBNode | LLRBEmptyNode; - color: boolean; - /** - * Returns a copy of the current node. - * - * @returns The node copy. - */ - copy(key: K | null, value: V | null, color: boolean | null, left: LLRBNode | LLRBEmptyNode | null, right: LLRBNode | LLRBEmptyNode | null): LLRBEmptyNode; - /** - * Returns a copy of the tree, with the specified key/value added. - * - * @param key - Key to be added. - * @param value - Value to be added. - * @param comparator - Comparator. - * @returns New tree, with item added. - */ - insert(key: K, value: V, comparator: Comparator): LLRBNode; - /** - * Returns a copy of the tree, with the specified key removed. - * - * @param key - The key to remove. - * @param comparator - Comparator. - * @returns New tree, with item removed. - */ - remove(key: K, comparator: Comparator): LLRBEmptyNode; - /** - * @returns The total number of nodes in the tree. - */ - count(): number; - /** - * @returns True if the tree is empty. - */ - isEmpty(): boolean; - /** - * Traverses the tree in key order and calls the specified action function - * for each node. - * - * @param action - Callback function to be called for each - * node. If it returns true, traversal is aborted. - * @returns True if traversal was aborted. - */ - inorderTraversal(action: (k: K, v: V) => unknown): boolean; - /** - * Traverses the tree in reverse key order and calls the specified action function - * for each node. - * - * @param action - Callback function to be called for each - * node. If it returns true, traversal is aborted. - * @returns True if traversal was aborted. - */ - reverseTraversal(action: (k: K, v: V) => void): boolean; - minKey(): null; - maxKey(): null; - check_(): number; - /** - * @returns Whether this node is red. - */ - isRed_(): boolean; -} - -/** - * Represents a node in a Left-leaning Red-Black tree. - */ -declare class LLRBNode { - key: K; - value: V; - color: boolean; - left: LLRBNode | LLRBEmptyNode; - right: LLRBNode | LLRBEmptyNode; - /** - * @param key - Key associated with this node. - * @param value - Value associated with this node. - * @param color - Whether this node is red. - * @param left - Left child. - * @param right - Right child. - */ - constructor(key: K, value: V, color: boolean | null, left?: LLRBNode | LLRBEmptyNode | null, right?: LLRBNode | LLRBEmptyNode | null); - static RED: boolean; - static BLACK: boolean; - /** - * Returns a copy of the current node, optionally replacing pieces of it. - * - * @param key - New key for the node, or null. - * @param value - New value for the node, or null. - * @param color - New color for the node, or null. - * @param left - New left child for the node, or null. - * @param right - New right child for the node, or null. - * @returns The node copy. - */ - copy(key: K | null, value: V | null, color: boolean | null, left: LLRBNode | LLRBEmptyNode | null, right: LLRBNode | LLRBEmptyNode | null): LLRBNode; - /** - * @returns The total number of nodes in the tree. - */ - count(): number; - /** - * @returns True if the tree is empty. - */ - isEmpty(): boolean; - /** - * Traverses the tree in key order and calls the specified action function - * for each node. - * - * @param action - Callback function to be called for each - * node. If it returns true, traversal is aborted. - * @returns The first truthy value returned by action, or the last falsey - * value returned by action - */ - inorderTraversal(action: (k: K, v: V) => unknown): boolean; - /** - * Traverses the tree in reverse key order and calls the specified action function - * for each node. - * - * @param action - Callback function to be called for each - * node. If it returns true, traversal is aborted. - * @returns True if traversal was aborted. - */ - reverseTraversal(action: (k: K, v: V) => void): boolean; - /** - * @returns The minimum node in the tree. - */ - private min_; - /** - * @returns The maximum key in the tree. - */ - minKey(): K; - /** - * @returns The maximum key in the tree. - */ - maxKey(): K; - /** - * @param key - Key to insert. - * @param value - Value to insert. - * @param comparator - Comparator. - * @returns New tree, with the key/value added. - */ - insert(key: K, value: V, comparator: Comparator): LLRBNode; - /** - * @returns New tree, with the minimum key removed. - */ - private removeMin_; - /** - * @param key - The key of the item to remove. - * @param comparator - Comparator. - * @returns New tree, with the specified item removed. - */ - remove(key: K, comparator: Comparator): LLRBNode | LLRBEmptyNode; - /** - * @returns Whether this is a RED node. - */ - isRed_(): boolean; - /** - * @returns New tree after performing any needed rotations. - */ - private fixUp_; - /** - * @returns New tree, after moveRedLeft. - */ - private moveRedLeft_; - /** - * @returns New tree, after moveRedRight. - */ - private moveRedRight_; - /** - * @returns New tree, after rotateLeft. - */ - private rotateLeft_; - /** - * @returns New tree, after rotateRight. - */ - private rotateRight_; - /** - * @returns Newt ree, after colorFlip. - */ - private colorFlip_; - /** - * For testing. - * - * @returns True if all is well. - */ - private checkMaxDepth_; - check_(): number; -} - -declare class NamedNode { - name: string; - node: Node_2; - constructor(name: string, node: Node_2); - static Wrap(name: string, node: Node_2): NamedNode; -} - -/** - * Node is an interface defining the common functionality for nodes in - * a DataSnapshot. - * - * @interface - */ -declare interface Node_2 { - /** - * Whether this node is a leaf node. - * @returns Whether this is a leaf node. - */ - isLeafNode(): boolean; - /** - * Gets the priority of the node. - * @returns The priority of the node. - */ - getPriority(): Node_2; - /** - * Returns a duplicate node with the new priority. - * @param newPriorityNode - New priority to set for the node. - * @returns Node with new priority. - */ - updatePriority(newPriorityNode: Node_2): Node_2; - /** - * Returns the specified immediate child, or null if it doesn't exist. - * @param childName - The name of the child to retrieve. - * @returns The retrieved child, or an empty node. - */ - getImmediateChild(childName: string): Node_2; - /** - * Returns a child by path, or null if it doesn't exist. - * @param path - The path of the child to retrieve. - * @returns The retrieved child or an empty node. - */ - getChild(path: Path): Node_2; - /** - * Returns the name of the child immediately prior to the specified childNode, or null. - * @param childName - The name of the child to find the predecessor of. - * @param childNode - The node to find the predecessor of. - * @param index - The index to use to determine the predecessor - * @returns The name of the predecessor child, or null if childNode is the first child. - */ - getPredecessorChildName(childName: string, childNode: Node_2, index: Index): string | null; - /** - * Returns a duplicate node, with the specified immediate child updated. - * Any value in the node will be removed. - * @param childName - The name of the child to update. - * @param newChildNode - The new child node - * @returns The updated node. - */ - updateImmediateChild(childName: string, newChildNode: Node_2): Node_2; - /** - * Returns a duplicate node, with the specified child updated. Any value will - * be removed. - * @param path - The path of the child to update. - * @param newChildNode - The new child node, which may be an empty node - * @returns The updated node. - */ - updateChild(path: Path, newChildNode: Node_2): Node_2; - /** - * True if the immediate child specified exists - */ - hasChild(childName: string): boolean; - /** - * @returns True if this node has no value or children. - */ - isEmpty(): boolean; - /** - * @returns The number of children of this node. - */ - numChildren(): number; - /** - * Calls action for each child. - * @param action - Action to be called for - * each child. It's passed the child name and the child node. - * @returns The first truthy value return by action, or the last falsey one - */ - forEachChild(index: Index, action: (a: string, b: Node_2) => void): unknown; - /** - * @param exportFormat - True for export format (also wire protocol format). - * @returns Value of this node as JSON. - */ - val(exportFormat?: boolean): unknown; - /** - * @returns hash representing the node contents. - */ - hash(): string; - /** - * @param other - Another node - * @returns -1 for less than, 0 for equal, 1 for greater than other - */ - compareTo(other: Node_2): number; - /** - * @returns Whether or not this snapshot equals other - */ - equals(other: Node_2): boolean; - /** - * @returns This node, with the specified index now available - */ - withIndex(indexDefinition: Index): Node_2; - isIndexed(indexDefinition: Index): boolean; -} - -/** - * NodeFilter is used to update nodes and complete children of nodes while applying queries on the fly and keeping - * track of any child changes. This class does not track value changes as value changes depend on more - * than just the node itself. Different kind of queries require different kind of implementations of this interface. - * @interface - */ -declare interface NodeFilter_2 { - /** - * Update a single complete child in the snap. If the child equals the old child in the snap, this is a no-op. - * The method expects an indexed snap. - */ - updateChild(snap: Node_2, key: string, newChild: Node_2, affectedPath: Path, source: CompleteChildSource, optChangeAccumulator: ChildChangeAccumulator | null): Node_2; - /** - * Update a node in full and output any resulting change from this complete update. - */ - updateFullNode(oldSnap: Node_2, newSnap: Node_2, optChangeAccumulator: ChildChangeAccumulator | null): Node_2; - /** - * Update the priority of the root node - */ - updatePriority(oldSnap: Node_2, newPriority: Node_2): Node_2; - /** - * Returns true if children might be filtered due to query criteria - */ - filtersNodes(): boolean; - /** - * Returns the index filter that this filter uses to get a NodeFilter that doesn't filter any children. - */ - getIndexedFilter(): NodeFilter_2; - /** - * Returns the index that this filter uses - */ - getIndex(): Index; -} - -/** - * Detaches a callback previously attached with the corresponding `on*()` (`onValue`, `onChildAdded`) listener. - * Note: This is not the recommended way to remove a listener. Instead, please use the returned callback function from - * the respective `on*` callbacks. - * - * Detach a callback previously attached with `on*()`. Calling `off()` on a parent listener - * will not automatically remove listeners registered on child nodes, `off()` - * must also be called on any child listeners to remove the callback. - * - * If a callback is not specified, all callbacks for the specified eventType - * will be removed. Similarly, if no eventType is specified, all callbacks - * for the `Reference` will be removed. - * - * Individual listeners can also be removed by invoking their unsubscribe - * callbacks. - * - * @param query - The query that the listener was registered with. - * @param eventType - One of the following strings: "value", "child_added", - * "child_changed", "child_removed", or "child_moved." If omitted, all callbacks - * for the `Reference` will be removed. - * @param callback - The callback function that was passed to `on()` or - * `undefined` to remove all callbacks. - */ -export declare function off(query: Query, eventType?: EventType, callback?: (snapshot: DataSnapshot, previousChildName?: string | null) => unknown): void; - -/** - * Listens for data changes at a particular location. - * - * This is the primary way to read data from a Database. Your callback - * will be triggered for the initial data and again whenever the data changes. - * Invoke the returned unsubscribe callback to stop receiving updates. See - * {@link https://firebase.google.com/docs/database/web/retrieve-data | Retrieve Data on the Web} - * for more details. - * - * An `onChildAdded` event will be triggered once for each initial child at this - * location, and it will be triggered again every time a new child is added. The - * `DataSnapshot` passed into the callback will reflect the data for the - * relevant child. For ordering purposes, it is passed a second argument which - * is a string containing the key of the previous sibling child by sort order, - * or `null` if it is the first child. - * - * @param query - The query to run. - * @param callback - A callback that fires when the specified event occurs. - * The callback will be passed a DataSnapshot and a string containing the key of - * the previous child, by sort order, or `null` if it is the first child. - * @param cancelCallback - An optional callback that will be notified if your - * event subscription is ever canceled because your client does not have - * permission to read this data (or it had permission but has now lost it). - * This callback will be passed an `Error` object indicating why the failure - * occurred. - * @returns A function that can be invoked to remove the listener. - */ -export declare function onChildAdded(query: Query, callback: (snapshot: DataSnapshot, previousChildName?: string | null) => unknown, cancelCallback?: (error: Error) => unknown): Unsubscribe; - -/** - * Listens for data changes at a particular location. - * - * This is the primary way to read data from a Database. Your callback - * will be triggered for the initial data and again whenever the data changes. - * Invoke the returned unsubscribe callback to stop receiving updates. See - * {@link https://firebase.google.com/docs/database/web/retrieve-data | Retrieve Data on the Web} - * for more details. - * - * An `onChildAdded` event will be triggered once for each initial child at this - * location, and it will be triggered again every time a new child is added. The - * `DataSnapshot` passed into the callback will reflect the data for the - * relevant child. For ordering purposes, it is passed a second argument which - * is a string containing the key of the previous sibling child by sort order, - * or `null` if it is the first child. - * - * @param query - The query to run. - * @param callback - A callback that fires when the specified event occurs. - * The callback will be passed a DataSnapshot and a string containing the key of - * the previous child, by sort order, or `null` if it is the first child. - * @param options - An object that can be used to configure `onlyOnce`, which - * then removes the listener after its first invocation. - * @returns A function that can be invoked to remove the listener. - */ -export declare function onChildAdded(query: Query, callback: (snapshot: DataSnapshot, previousChildName: string | null) => unknown, options: ListenOptions): Unsubscribe; - -/** - * Listens for data changes at a particular location. - * - * This is the primary way to read data from a Database. Your callback - * will be triggered for the initial data and again whenever the data changes. - * Invoke the returned unsubscribe callback to stop receiving updates. See - * {@link https://firebase.google.com/docs/database/web/retrieve-data | Retrieve Data on the Web} - * for more details. - * - * An `onChildAdded` event will be triggered once for each initial child at this - * location, and it will be triggered again every time a new child is added. The - * `DataSnapshot` passed into the callback will reflect the data for the - * relevant child. For ordering purposes, it is passed a second argument which - * is a string containing the key of the previous sibling child by sort order, - * or `null` if it is the first child. - * - * @param query - The query to run. - * @param callback - A callback that fires when the specified event occurs. - * The callback will be passed a DataSnapshot and a string containing the key of - * the previous child, by sort order, or `null` if it is the first child. - * @param cancelCallback - An optional callback that will be notified if your - * event subscription is ever canceled because your client does not have - * permission to read this data (or it had permission but has now lost it). - * This callback will be passed an `Error` object indicating why the failure - * occurred. - * @param options - An object that can be used to configure `onlyOnce`, which - * then removes the listener after its first invocation. - * @returns A function that can be invoked to remove the listener. - */ -export declare function onChildAdded(query: Query, callback: (snapshot: DataSnapshot, previousChildName: string | null) => unknown, cancelCallback: (error: Error) => unknown, options: ListenOptions): Unsubscribe; - -/** - * Listens for data changes at a particular location. - * - * This is the primary way to read data from a Database. Your callback - * will be triggered for the initial data and again whenever the data changes. - * Invoke the returned unsubscribe callback to stop receiving updates. See - * {@link https://firebase.google.com/docs/database/web/retrieve-data | Retrieve Data on the Web} - * for more details. - * - * An `onChildChanged` event will be triggered when the data stored in a child - * (or any of its descendants) changes. Note that a single `child_changed` event - * may represent multiple changes to the child. The `DataSnapshot` passed to the - * callback will contain the new child contents. For ordering purposes, the - * callback is also passed a second argument which is a string containing the - * key of the previous sibling child by sort order, or `null` if it is the first - * child. - * - * @param query - The query to run. - * @param callback - A callback that fires when the specified event occurs. - * The callback will be passed a DataSnapshot and a string containing the key of - * the previous child, by sort order, or `null` if it is the first child. - * @param cancelCallback - An optional callback that will be notified if your - * event subscription is ever canceled because your client does not have - * permission to read this data (or it had permission but has now lost it). - * This callback will be passed an `Error` object indicating why the failure - * occurred. - * @returns A function that can be invoked to remove the listener. - */ -export declare function onChildChanged(query: Query, callback: (snapshot: DataSnapshot, previousChildName: string | null) => unknown, cancelCallback?: (error: Error) => unknown): Unsubscribe; - -/** - * Listens for data changes at a particular location. - * - * This is the primary way to read data from a Database. Your callback - * will be triggered for the initial data and again whenever the data changes. - * Invoke the returned unsubscribe callback to stop receiving updates. See - * {@link https://firebase.google.com/docs/database/web/retrieve-data | Retrieve Data on the Web} - * for more details. - * - * An `onChildChanged` event will be triggered when the data stored in a child - * (or any of its descendants) changes. Note that a single `child_changed` event - * may represent multiple changes to the child. The `DataSnapshot` passed to the - * callback will contain the new child contents. For ordering purposes, the - * callback is also passed a second argument which is a string containing the - * key of the previous sibling child by sort order, or `null` if it is the first - * child. - * - * @param query - The query to run. - * @param callback - A callback that fires when the specified event occurs. - * The callback will be passed a DataSnapshot and a string containing the key of - * the previous child, by sort order, or `null` if it is the first child. - * @param options - An object that can be used to configure `onlyOnce`, which - * then removes the listener after its first invocation. - * @returns A function that can be invoked to remove the listener. - */ -export declare function onChildChanged(query: Query, callback: (snapshot: DataSnapshot, previousChildName: string | null) => unknown, options: ListenOptions): Unsubscribe; - -/** - * Listens for data changes at a particular location. - * - * This is the primary way to read data from a Database. Your callback - * will be triggered for the initial data and again whenever the data changes. - * Invoke the returned unsubscribe callback to stop receiving updates. See - * {@link https://firebase.google.com/docs/database/web/retrieve-data | Retrieve Data on the Web} - * for more details. - * - * An `onChildChanged` event will be triggered when the data stored in a child - * (or any of its descendants) changes. Note that a single `child_changed` event - * may represent multiple changes to the child. The `DataSnapshot` passed to the - * callback will contain the new child contents. For ordering purposes, the - * callback is also passed a second argument which is a string containing the - * key of the previous sibling child by sort order, or `null` if it is the first - * child. - * - * @param query - The query to run. - * @param callback - A callback that fires when the specified event occurs. - * The callback will be passed a DataSnapshot and a string containing the key of - * the previous child, by sort order, or `null` if it is the first child. - * @param cancelCallback - An optional callback that will be notified if your - * event subscription is ever canceled because your client does not have - * permission to read this data (or it had permission but has now lost it). - * This callback will be passed an `Error` object indicating why the failure - * occurred. - * @param options - An object that can be used to configure `onlyOnce`, which - * then removes the listener after its first invocation. - * @returns A function that can be invoked to remove the listener. - */ -export declare function onChildChanged(query: Query, callback: (snapshot: DataSnapshot, previousChildName: string | null) => unknown, cancelCallback: (error: Error) => unknown, options: ListenOptions): Unsubscribe; - -/** - * Listens for data changes at a particular location. - * - * This is the primary way to read data from a Database. Your callback - * will be triggered for the initial data and again whenever the data changes. - * Invoke the returned unsubscribe callback to stop receiving updates. See - * {@link https://firebase.google.com/docs/database/web/retrieve-data | Retrieve Data on the Web} - * for more details. - * - * An `onChildMoved` event will be triggered when a child's sort order changes - * such that its position relative to its siblings changes. The `DataSnapshot` - * passed to the callback will be for the data of the child that has moved. It - * is also passed a second argument which is a string containing the key of the - * previous sibling child by sort order, or `null` if it is the first child. - * - * @param query - The query to run. - * @param callback - A callback that fires when the specified event occurs. - * The callback will be passed a DataSnapshot and a string containing the key of - * the previous child, by sort order, or `null` if it is the first child. - * @param cancelCallback - An optional callback that will be notified if your - * event subscription is ever canceled because your client does not have - * permission to read this data (or it had permission but has now lost it). - * This callback will be passed an `Error` object indicating why the failure - * occurred. - * @returns A function that can be invoked to remove the listener. - */ -export declare function onChildMoved(query: Query, callback: (snapshot: DataSnapshot, previousChildName: string | null) => unknown, cancelCallback?: (error: Error) => unknown): Unsubscribe; - -/** - * Listens for data changes at a particular location. - * - * This is the primary way to read data from a Database. Your callback - * will be triggered for the initial data and again whenever the data changes. - * Invoke the returned unsubscribe callback to stop receiving updates. See - * {@link https://firebase.google.com/docs/database/web/retrieve-data | Retrieve Data on the Web} - * for more details. - * - * An `onChildMoved` event will be triggered when a child's sort order changes - * such that its position relative to its siblings changes. The `DataSnapshot` - * passed to the callback will be for the data of the child that has moved. It - * is also passed a second argument which is a string containing the key of the - * previous sibling child by sort order, or `null` if it is the first child. - * - * @param query - The query to run. - * @param callback - A callback that fires when the specified event occurs. - * The callback will be passed a DataSnapshot and a string containing the key of - * the previous child, by sort order, or `null` if it is the first child. - * @param options - An object that can be used to configure `onlyOnce`, which - * then removes the listener after its first invocation. - * @returns A function that can be invoked to remove the listener. - */ -export declare function onChildMoved(query: Query, callback: (snapshot: DataSnapshot, previousChildName: string | null) => unknown, options: ListenOptions): Unsubscribe; - -/** - * Listens for data changes at a particular location. - * - * This is the primary way to read data from a Database. Your callback - * will be triggered for the initial data and again whenever the data changes. - * Invoke the returned unsubscribe callback to stop receiving updates. See - * {@link https://firebase.google.com/docs/database/web/retrieve-data | Retrieve Data on the Web} - * for more details. - * - * An `onChildMoved` event will be triggered when a child's sort order changes - * such that its position relative to its siblings changes. The `DataSnapshot` - * passed to the callback will be for the data of the child that has moved. It - * is also passed a second argument which is a string containing the key of the - * previous sibling child by sort order, or `null` if it is the first child. - * - * @param query - The query to run. - * @param callback - A callback that fires when the specified event occurs. - * The callback will be passed a DataSnapshot and a string containing the key of - * the previous child, by sort order, or `null` if it is the first child. - * @param cancelCallback - An optional callback that will be notified if your - * event subscription is ever canceled because your client does not have - * permission to read this data (or it had permission but has now lost it). - * This callback will be passed an `Error` object indicating why the failure - * occurred. - * @param options - An object that can be used to configure `onlyOnce`, which - * then removes the listener after its first invocation. - * @returns A function that can be invoked to remove the listener. - */ -export declare function onChildMoved(query: Query, callback: (snapshot: DataSnapshot, previousChildName: string | null) => unknown, cancelCallback: (error: Error) => unknown, options: ListenOptions): Unsubscribe; - -/** - * Listens for data changes at a particular location. - * - * This is the primary way to read data from a Database. Your callback - * will be triggered for the initial data and again whenever the data changes. - * Invoke the returned unsubscribe callback to stop receiving updates. See - * {@link https://firebase.google.com/docs/database/web/retrieve-data | Retrieve Data on the Web} - * for more details. - * - * An `onChildRemoved` event will be triggered once every time a child is - * removed. The `DataSnapshot` passed into the callback will be the old data for - * the child that was removed. A child will get removed when either: - * - * - a client explicitly calls `remove()` on that child or one of its ancestors - * - a client calls `set(null)` on that child or one of its ancestors - * - that child has all of its children removed - * - there is a query in effect which now filters out the child (because it's - * sort order changed or the max limit was hit) - * - * @param query - The query to run. - * @param callback - A callback that fires when the specified event occurs. - * The callback will be passed a DataSnapshot and a string containing the key of - * the previous child, by sort order, or `null` if it is the first child. - * @param cancelCallback - An optional callback that will be notified if your - * event subscription is ever canceled because your client does not have - * permission to read this data (or it had permission but has now lost it). - * This callback will be passed an `Error` object indicating why the failure - * occurred. - * @returns A function that can be invoked to remove the listener. - */ -export declare function onChildRemoved(query: Query, callback: (snapshot: DataSnapshot) => unknown, cancelCallback?: (error: Error) => unknown): Unsubscribe; - -/** - * Listens for data changes at a particular location. - * - * This is the primary way to read data from a Database. Your callback - * will be triggered for the initial data and again whenever the data changes. - * Invoke the returned unsubscribe callback to stop receiving updates. See - * {@link https://firebase.google.com/docs/database/web/retrieve-data | Retrieve Data on the Web} - * for more details. - * - * An `onChildRemoved` event will be triggered once every time a child is - * removed. The `DataSnapshot` passed into the callback will be the old data for - * the child that was removed. A child will get removed when either: - * - * - a client explicitly calls `remove()` on that child or one of its ancestors - * - a client calls `set(null)` on that child or one of its ancestors - * - that child has all of its children removed - * - there is a query in effect which now filters out the child (because it's - * sort order changed or the max limit was hit) - * - * @param query - The query to run. - * @param callback - A callback that fires when the specified event occurs. - * The callback will be passed a DataSnapshot and a string containing the key of - * the previous child, by sort order, or `null` if it is the first child. - * @param options - An object that can be used to configure `onlyOnce`, which - * then removes the listener after its first invocation. - * @returns A function that can be invoked to remove the listener. - */ -export declare function onChildRemoved(query: Query, callback: (snapshot: DataSnapshot) => unknown, options: ListenOptions): Unsubscribe; - -/** - * Listens for data changes at a particular location. - * - * This is the primary way to read data from a Database. Your callback - * will be triggered for the initial data and again whenever the data changes. - * Invoke the returned unsubscribe callback to stop receiving updates. See - * {@link https://firebase.google.com/docs/database/web/retrieve-data | Retrieve Data on the Web} - * for more details. - * - * An `onChildRemoved` event will be triggered once every time a child is - * removed. The `DataSnapshot` passed into the callback will be the old data for - * the child that was removed. A child will get removed when either: - * - * - a client explicitly calls `remove()` on that child or one of its ancestors - * - a client calls `set(null)` on that child or one of its ancestors - * - that child has all of its children removed - * - there is a query in effect which now filters out the child (because it's - * sort order changed or the max limit was hit) - * - * @param query - The query to run. - * @param callback - A callback that fires when the specified event occurs. - * The callback will be passed a DataSnapshot and a string containing the key of - * the previous child, by sort order, or `null` if it is the first child. - * @param cancelCallback - An optional callback that will be notified if your - * event subscription is ever canceled because your client does not have - * permission to read this data (or it had permission but has now lost it). - * This callback will be passed an `Error` object indicating why the failure - * occurred. - * @param options - An object that can be used to configure `onlyOnce`, which - * then removes the listener after its first invocation. - * @returns A function that can be invoked to remove the listener. - */ -export declare function onChildRemoved(query: Query, callback: (snapshot: DataSnapshot) => unknown, cancelCallback: (error: Error) => unknown, options: ListenOptions): Unsubscribe; - -/** - * The `onDisconnect` class allows you to write or clear data when your client - * disconnects from the Database server. These updates occur whether your - * client disconnects cleanly or not, so you can rely on them to clean up data - * even if a connection is dropped or a client crashes. - * - * The `onDisconnect` class is most commonly used to manage presence in - * applications where it is useful to detect how many clients are connected and - * when other clients disconnect. See - * {@link https://firebase.google.com/docs/database/web/offline-capabilities | Enabling Offline Capabilities in JavaScript} - * for more information. - * - * To avoid problems when a connection is dropped before the requests can be - * transferred to the Database server, these functions should be called before - * writing any data. - * - * Note that `onDisconnect` operations are only triggered once. If you want an - * operation to occur each time a disconnect occurs, you'll need to re-establish - * the `onDisconnect` operations each time you reconnect. - */ -export declare class OnDisconnect { - private _repo; - private _path; - /** @hideconstructor */ - constructor(_repo: Repo, _path: Path); - /** - * Cancels all previously queued `onDisconnect()` set or update events for this - * location and all children. - * - * If a write has been queued for this location via a `set()` or `update()` at a - * parent location, the write at this location will be canceled, though writes - * to sibling locations will still occur. - * - * @returns Resolves when synchronization to the server is complete. - */ - cancel(): Promise; - /** - * Ensures the data at this location is deleted when the client is disconnected - * (due to closing the browser, navigating to a new page, or network issues). - * - * @returns Resolves when synchronization to the server is complete. - */ - remove(): Promise; - /** - * Ensures the data at this location is set to the specified value when the - * client is disconnected (due to closing the browser, navigating to a new page, - * or network issues). - * - * `set()` is especially useful for implementing "presence" systems, where a - * value should be changed or cleared when a user disconnects so that they - * appear "offline" to other users. See - * {@link https://firebase.google.com/docs/database/web/offline-capabilities | Enabling Offline Capabilities in JavaScript} - * for more information. - * - * Note that `onDisconnect` operations are only triggered once. If you want an - * operation to occur each time a disconnect occurs, you'll need to re-establish - * the `onDisconnect` operations each time. - * - * @param value - The value to be written to this location on disconnect (can - * be an object, array, string, number, boolean, or null). - * @returns Resolves when synchronization to the Database is complete. - */ - set(value: unknown): Promise; - /** - * Ensures the data at this location is set to the specified value and priority - * when the client is disconnected (due to closing the browser, navigating to a - * new page, or network issues). - * - * @param value - The value to be written to this location on disconnect (can - * be an object, array, string, number, boolean, or null). - * @param priority - The priority to be written (string, number, or null). - * @returns Resolves when synchronization to the Database is complete. - */ - setWithPriority(value: unknown, priority: number | string | null): Promise; - /** - * Writes multiple values at this location when the client is disconnected (due - * to closing the browser, navigating to a new page, or network issues). - * - * The `values` argument contains multiple property-value pairs that will be - * written to the Database together. Each child property can either be a simple - * property (for example, "name") or a relative path (for example, "name/first") - * from the current location to the data to update. - * - * As opposed to the `set()` method, `update()` can be use to selectively update - * only the referenced properties at the current location (instead of replacing - * all the child properties at the current location). - * - * @param values - Object containing multiple values. - * @returns Resolves when synchronization to the Database is complete. - */ - update(values: object): Promise; -} - -/** - * Returns an `OnDisconnect` object - see - * {@link https://firebase.google.com/docs/database/web/offline-capabilities | Enabling Offline Capabilities in JavaScript} - * for more information on how to use it. - * - * @param ref - The reference to add OnDisconnect triggers for. - */ -export declare function onDisconnect(ref: DatabaseReference): OnDisconnect; - -/** - * Listens for data changes at a particular location. - * - * This is the primary way to read data from a Database. Your callback - * will be triggered for the initial data and again whenever the data changes. - * Invoke the returned unsubscribe callback to stop receiving updates. See - * {@link https://firebase.google.com/docs/database/web/retrieve-data | Retrieve Data on the Web} - * for more details. - * - * An `onValue` event will trigger once with the initial data stored at this - * location, and then trigger again each time the data changes. The - * `DataSnapshot` passed to the callback will be for the location at which - * `on()` was called. It won't trigger until the entire contents has been - * synchronized. If the location has no data, it will be triggered with an empty - * `DataSnapshot` (`val()` will return `null`). - * - * @param query - The query to run. - * @param callback - A callback that fires when the specified event occurs. The - * callback will be passed a DataSnapshot. - * @param cancelCallback - An optional callback that will be notified if your - * event subscription is ever canceled because your client does not have - * permission to read this data (or it had permission but has now lost it). - * This callback will be passed an `Error` object indicating why the failure - * occurred. - * @returns A function that can be invoked to remove the listener. - */ -export declare function onValue(query: Query, callback: (snapshot: DataSnapshot) => unknown, cancelCallback?: (error: Error) => unknown): Unsubscribe; - -/** - * Listens for data changes at a particular location. - * - * This is the primary way to read data from a Database. Your callback - * will be triggered for the initial data and again whenever the data changes. - * Invoke the returned unsubscribe callback to stop receiving updates. See - * {@link https://firebase.google.com/docs/database/web/retrieve-data | Retrieve Data on the Web} - * for more details. - * - * An `onValue` event will trigger once with the initial data stored at this - * location, and then trigger again each time the data changes. The - * `DataSnapshot` passed to the callback will be for the location at which - * `on()` was called. It won't trigger until the entire contents has been - * synchronized. If the location has no data, it will be triggered with an empty - * `DataSnapshot` (`val()` will return `null`). - * - * @param query - The query to run. - * @param callback - A callback that fires when the specified event occurs. The - * callback will be passed a DataSnapshot. - * @param options - An object that can be used to configure `onlyOnce`, which - * then removes the listener after its first invocation. - * @returns A function that can be invoked to remove the listener. - */ -export declare function onValue(query: Query, callback: (snapshot: DataSnapshot) => unknown, options: ListenOptions): Unsubscribe; - -/** - * Listens for data changes at a particular location. - * - * This is the primary way to read data from a Database. Your callback - * will be triggered for the initial data and again whenever the data changes. - * Invoke the returned unsubscribe callback to stop receiving updates. See - * {@link https://firebase.google.com/docs/database/web/retrieve-data | Retrieve Data on the Web} - * for more details. - * - * An `onValue` event will trigger once with the initial data stored at this - * location, and then trigger again each time the data changes. The - * `DataSnapshot` passed to the callback will be for the location at which - * `on()` was called. It won't trigger until the entire contents has been - * synchronized. If the location has no data, it will be triggered with an empty - * `DataSnapshot` (`val()` will return `null`). - * - * @param query - The query to run. - * @param callback - A callback that fires when the specified event occurs. The - * callback will be passed a DataSnapshot. - * @param cancelCallback - An optional callback that will be notified if your - * event subscription is ever canceled because your client does not have - * permission to read this data (or it had permission but has now lost it). - * This callback will be passed an `Error` object indicating why the failure - * occurred. - * @param options - An object that can be used to configure `onlyOnce`, which - * then removes the listener after its first invocation. - * @returns A function that can be invoked to remove the listener. - */ -export declare function onValue(query: Query, callback: (snapshot: DataSnapshot) => unknown, cancelCallback: (error: Error) => unknown, options: ListenOptions): Unsubscribe; - -/** - * Creates a new `QueryConstraint` that orders by the specified child key. - * - * Queries can only order by one key at a time. Calling `orderByChild()` - * multiple times on the same query is an error. - * - * Firebase queries allow you to order your data by any child key on the fly. - * However, if you know in advance what your indexes will be, you can define - * them via the .indexOn rule in your Security Rules for better performance. See - * the{@link https://firebase.google.com/docs/database/security/indexing-data} - * rule for more information. - * - * You can read more about `orderByChild()` in - * {@link https://firebase.google.com/docs/database/web/lists-of-data#sort_data | Sort data}. - * - * @param path - The path to order by. - */ -export declare function orderByChild(path: string): QueryConstraint; - -/** - * Creates a new `QueryConstraint` that orders by the key. - * - * Sorts the results of a query by their (ascending) key values. - * - * You can read more about `orderByKey()` in - * {@link https://firebase.google.com/docs/database/web/lists-of-data#sort_data | Sort data}. - */ -export declare function orderByKey(): QueryConstraint; - -/** - * Creates a new `QueryConstraint` that orders by priority. - * - * Applications need not use priority but can order collections by - * ordinary properties (see - * {@link https://firebase.google.com/docs/database/web/lists-of-data#sort_data | Sort data} - * for alternatives to priority. - */ -export declare function orderByPriority(): QueryConstraint; - -/** - * Creates a new `QueryConstraint` that orders by value. - * - * If the children of a query are all scalar values (string, number, or - * boolean), you can order the results by their (ascending) values. - * - * You can read more about `orderByValue()` in - * {@link https://firebase.google.com/docs/database/web/lists-of-data#sort_data | Sort data}. - */ -export declare function orderByValue(): QueryConstraint; - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * An immutable object representing a parsed path. It's immutable so that you - * can pass them around to other functions without worrying about them changing - * it. - */ -declare class Path { - pieces_: string[]; - pieceNum_: number; - /** - * @param pathOrString - Path string to parse, or another path, or the raw - * tokens array - */ - constructor(pathOrString: string | string[], pieceNum?: number); - toString(): string; -} - -/** - * Firebase connection. Abstracts wire protocol and handles reconnecting. - * - * NOTE: All JSON objects sent to the realtime connection must have property names enclosed - * in quotes to make sure the closure compiler does not minify them. - */ -declare class PersistentConnection extends ServerActions { - private repoInfo_; - private applicationId_; - private onDataUpdate_; - private onConnectStatus_; - private onServerInfoUpdate_; - private authTokenProvider_; - private appCheckTokenProvider_; - private authOverride_?; - id: number; - private log_; - private interruptReasons_; - private readonly listens; - private outstandingPuts_; - private outstandingGets_; - private outstandingPutCount_; - private outstandingGetCount_; - private onDisconnectRequestQueue_; - private connected_; - private reconnectDelay_; - private maxReconnectDelay_; - private securityDebugCallback_; - lastSessionId: string | null; - private establishConnectionTimer_; - private visible_; - private requestCBHash_; - private requestNumber_; - private realtime_; - private authToken_; - private appCheckToken_; - private forceTokenRefresh_; - private invalidAuthTokenCount_; - private invalidAppCheckTokenCount_; - private firstConnection_; - private lastConnectionAttemptTime_; - private lastConnectionEstablishedTime_; - private static nextPersistentConnectionId_; - /** - * Counter for number of connections created. Mainly used for tagging in the logs - */ - private static nextConnectionId_; - /** - * @param repoInfo_ - Data about the namespace we are connecting to - * @param applicationId_ - The Firebase App ID for this project - * @param onDataUpdate_ - A callback for new data from the server - */ - constructor(repoInfo_: RepoInfo, applicationId_: string, onDataUpdate_: (a: string, b: unknown, c: boolean, d: number | null) => void, onConnectStatus_: (a: boolean) => void, onServerInfoUpdate_: (a: unknown) => void, authTokenProvider_: AuthTokenProvider, appCheckTokenProvider_: AppCheckTokenProvider, authOverride_?: object | null); - protected sendRequest(action: string, body: unknown, onResponse?: (a: unknown) => void): void; - get(query: QueryContext): Promise; - listen(query: QueryContext, currentHashFn: () => string, tag: number | null, onComplete: (a: string, b: unknown) => void): void; - private sendGet_; - private sendListen_; - private static warnOnListenWarnings_; - refreshAuthToken(token: string): void; - private reduceReconnectDelayIfAdminCredential_; - refreshAppCheckToken(token: string | null): void; - /** - * Attempts to authenticate with the given credentials. If the authentication attempt fails, it's triggered like - * a auth revoked (the connection is closed). - */ - tryAuth(): void; - /** - * Attempts to authenticate with the given token. If the authentication - * attempt fails, it's triggered like the token was revoked (the connection is - * closed). - */ - tryAppCheck(): void; - /** - * @inheritDoc - */ - unlisten(query: QueryContext, tag: number | null): void; - private sendUnlisten_; - onDisconnectPut(pathString: string, data: unknown, onComplete?: (a: string, b: string) => void): void; - onDisconnectMerge(pathString: string, data: unknown, onComplete?: (a: string, b: string) => void): void; - onDisconnectCancel(pathString: string, onComplete?: (a: string, b: string) => void): void; - private sendOnDisconnect_; - put(pathString: string, data: unknown, onComplete?: (a: string, b: string) => void, hash?: string): void; - merge(pathString: string, data: unknown, onComplete: (a: string, b: string | null) => void, hash?: string): void; - putInternal(action: string, pathString: string, data: unknown, onComplete: (a: string, b: string | null) => void, hash?: string): void; - private sendPut_; - reportStats(stats: { - [k: string]: unknown; - }): void; - private onDataMessage_; - private onDataPush_; - private onReady_; - private scheduleConnect_; - private initConnection_; - private onVisible_; - private onOnline_; - private onRealtimeDisconnect_; - private establishConnection_; - interrupt(reason: string): void; - resume(reason: string): void; - private handleTimestamp_; - private cancelSentTransactions_; - private onListenRevoked_; - private removeListen_; - private onAuthRevoked_; - private onAppCheckRevoked_; - private onSecurityDebugPacket_; - private restoreState_; - /** - * Sends client stats for first connection - */ - private sendConnectStats_; - private shouldReconnect_; -} - -declare class PriorityIndex extends Index { - compare(a: NamedNode, b: NamedNode): number; - isDefinedOn(node: Node_2): boolean; - indexedValueChanged(oldNode: Node_2, newNode: Node_2): boolean; - minPost(): NamedNode; - maxPost(): NamedNode; - makePost(indexValue: unknown, name: string): NamedNode; - /** - * @returns String representation for inclusion in a query spec - */ - toString(): string; -} - -/** - * Generates a new child location using a unique key and returns its - * `Reference`. - * - * This is the most common pattern for adding data to a collection of items. - * - * If you provide a value to `push()`, the value is written to the - * generated location. If you don't pass a value, nothing is written to the - * database and the child remains empty (but you can use the `Reference` - * elsewhere). - * - * The unique keys generated by `push()` are ordered by the current time, so the - * resulting list of items is chronologically sorted. The keys are also - * designed to be unguessable (they contain 72 random bits of entropy). - * - * See {@link https://firebase.google.com/docs/database/web/lists-of-data#append_to_a_list_of_data | Append to a list of data}. - * See {@link https://firebase.googleblog.com/2015/02/the-2120-ways-to-ensure-unique_68.html | The 2^120 Ways to Ensure Unique Identifiers}. - * - * @param parent - The parent location. - * @param value - Optional value to be written at the generated location. - * @returns Combined `Promise` and `Reference`; resolves when write is complete, - * but can be used immediately as the `Reference` to the child location. - */ -export declare function push(parent: DatabaseReference, value?: unknown): ThenableReference; - -/** - * @license - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * A `Query` sorts and filters the data at a Database location so only a subset - * of the child data is included. This can be used to order a collection of - * data by some attribute (for example, height of dinosaurs) as well as to - * restrict a large list of items (for example, chat messages) down to a number - * suitable for synchronizing to the client. Queries are created by chaining - * together one or more of the filter methods defined here. - * - * Just as with a `DatabaseReference`, you can receive data from a `Query` by using the - * `on*()` methods. You will only receive events and `DataSnapshot`s for the - * subset of the data that matches your query. - * - * See {@link https://firebase.google.com/docs/database/web/lists-of-data#sorting_and_filtering_data} - * for more information. - */ -export declare interface Query extends QueryContext { - /** The `DatabaseReference` for the `Query`'s location. */ - readonly ref: DatabaseReference; - /** - * Returns whether or not the current and provided queries represent the same - * location, have the same query parameters, and are from the same instance of - * `FirebaseApp`. - * - * Two `DatabaseReference` objects are equivalent if they represent the same location - * and are from the same instance of `FirebaseApp`. - * - * Two `Query` objects are equivalent if they represent the same location, - * have the same query parameters, and are from the same instance of - * `FirebaseApp`. Equivalent queries share the same sort order, limits, and - * starting and ending points. - * - * @param other - The query to compare against. - * @returns Whether or not the current and provided queries are equivalent. - */ - isEqual(other: Query | null): boolean; - /** - * Returns a JSON-serializable representation of this object. - * - * @returns A JSON-serializable representation of this object. - */ - toJSON(): string; - /** - * Gets the absolute URL for this location. - * - * The `toString()` method returns a URL that is ready to be put into a - * browser, curl command, or a `refFromURL()` call. Since all of those expect - * the URL to be url-encoded, `toString()` returns an encoded URL. - * - * Append '.json' to the returned URL when typed into a browser to download - * JSON-formatted data. If the location is secured (that is, not publicly - * readable), you will get a permission-denied error. - * - * @returns The absolute URL for this location. - */ - toString(): string; -} - -/** - * Creates a new immutable instance of `Query` that is extended to also include - * additional query constraints. - * - * @param query - The Query instance to use as a base for the new constraints. - * @param queryConstraints - The list of `QueryConstraint`s to apply. - * @throws if any of the provided query constraints cannot be combined with the - * existing or new constraints. - */ -export declare function query(query: Query, ...queryConstraints: QueryConstraint[]): Query; - -/** - * A `QueryConstraint` is used to narrow the set of documents returned by a - * Database query. `QueryConstraint`s are created by invoking {@link endAt}, - * {@link endBefore}, {@link startAt}, {@link startAfter}, {@link - * limitToFirst}, {@link limitToLast}, {@link orderByChild}, - * {@link orderByChild}, {@link orderByKey} , {@link orderByPriority} , - * {@link orderByValue} or {@link equalTo} and - * can then be passed to {@link query} to create a new query instance that - * also contains this `QueryConstraint`. - */ -export declare abstract class QueryConstraint { - /** The type of this query constraints */ - abstract readonly type: QueryConstraintType; - /** - * Takes the provided `Query` and returns a copy of the `Query` with this - * `QueryConstraint` applied. - */ - abstract _apply(query: _QueryImpl): _QueryImpl; -} - -/** Describes the different query constraints available in this SDK. */ -export declare type QueryConstraintType = 'endAt' | 'endBefore' | 'startAt' | 'startAfter' | 'limitToFirst' | 'limitToLast' | 'orderByChild' | 'orderByKey' | 'orderByPriority' | 'orderByValue' | 'equalTo'; - -declare interface QueryContext { - readonly _queryIdentifier: string; - readonly _queryObject: object; - readonly _repo: Repo; - readonly _path: Path; - readonly _queryParams: _QueryParams; -} - -/** - * @internal - */ -export declare class _QueryImpl implements Query, QueryContext { - readonly _repo: Repo; - readonly _path: Path; - readonly _queryParams: _QueryParams; - readonly _orderByCalled: boolean; - /** - * @hideconstructor - */ - constructor(_repo: Repo, _path: Path, _queryParams: _QueryParams, _orderByCalled: boolean); - get key(): string | null; - get ref(): DatabaseReference; - get _queryIdentifier(): string; - /** - * An object representation of the query parameters used by this Query. - */ - get _queryObject(): object; - isEqual(other: _QueryImpl | null): boolean; - toJSON(): string; - toString(): string; -} - -/** - * This class is an immutable-from-the-public-api struct containing a set of query parameters defining a - * range to be returned for a particular location. It is assumed that validation of parameters is done at the - * user-facing API level, so it is not done here. - * - * @internal - */ -export declare class _QueryParams { - limitSet_: boolean; - startSet_: boolean; - startNameSet_: boolean; - startAfterSet_: boolean; - endSet_: boolean; - endNameSet_: boolean; - endBeforeSet_: boolean; - limit_: number; - viewFrom_: string; - indexStartValue_: unknown | null; - indexStartName_: string; - indexEndValue_: unknown | null; - indexEndName_: string; - index_: PriorityIndex; - hasStart(): boolean; - hasStartAfter(): boolean; - hasEndBefore(): boolean; - /** - * @returns True if it would return from left. - */ - isViewFromLeft(): boolean; - /** - * Only valid to call if hasStart() returns true - */ - getIndexStartValue(): unknown; - /** - * Only valid to call if hasStart() returns true. - * Returns the starting key name for the range defined by these query parameters - */ - getIndexStartName(): string; - hasEnd(): boolean; - /** - * Only valid to call if hasEnd() returns true. - */ - getIndexEndValue(): unknown; - /** - * Only valid to call if hasEnd() returns true. - * Returns the end key name for the range defined by these query parameters - */ - getIndexEndName(): string; - hasLimit(): boolean; - /** - * @returns True if a limit has been set and it has been explicitly anchored - */ - hasAnchoredLimit(): boolean; - /** - * Only valid to call if hasLimit() returns true - */ - getLimit(): number; - getIndex(): Index; - loadsAllData(): boolean; - isDefault(): boolean; - copy(): _QueryParams; -} - -/** - * - * Returns a `Reference` representing the location in the Database - * corresponding to the provided path. If no path is provided, the `Reference` - * will point to the root of the Database. - * - * @param db - The database instance to obtain a reference for. - * @param path - Optional path representing the location the returned - * `Reference` will point. If not provided, the returned `Reference` will - * point to the root of the Database. - * @returns If a path is provided, a `Reference` - * pointing to the provided path. Otherwise, a `Reference` pointing to the - * root of the Database. - */ -export declare function ref(db: Database, path?: string): DatabaseReference; - -/** - * @internal - */ -export declare class _ReferenceImpl extends _QueryImpl implements DatabaseReference { - /** @hideconstructor */ - constructor(repo: Repo, path: Path); - get parent(): _ReferenceImpl | null; - get root(): _ReferenceImpl; -} - -/** - * Returns a `Reference` representing the location in the Database - * corresponding to the provided Firebase URL. - * - * An exception is thrown if the URL is not a valid Firebase Database URL or it - * has a different domain than the current `Database` instance. - * - * Note that all query parameters (`orderBy`, `limitToLast`, etc.) are ignored - * and are not applied to the returned `Reference`. - * - * @param db - The database instance to obtain a reference for. - * @param url - The Firebase URL at which the returned `Reference` will - * point. - * @returns A `Reference` pointing to the provided - * Firebase URL. - */ -export declare function refFromURL(db: Database, url: string): DatabaseReference; - -/** - * Removes the data at this Database location. - * - * Any data at child locations will also be deleted. - * - * The effect of the remove will be visible immediately and the corresponding - * event 'value' will be triggered. Synchronization of the remove to the - * Firebase servers will also be started, and the returned Promise will resolve - * when complete. If provided, the onComplete callback will be called - * asynchronously after synchronization has finished. - * - * @param ref - The location to remove. - * @returns Resolves when remove on server is complete. - */ -export declare function remove(ref: DatabaseReference): Promise; - -/** - * A connection to a single data repository. - */ -declare class Repo { - repoInfo_: RepoInfo; - forceRestClient_: boolean; - authTokenProvider_: AuthTokenProvider; - appCheckProvider_: AppCheckTokenProvider; - /** Key for uniquely identifying this repo, used in RepoManager */ - readonly key: string; - dataUpdateCount: number; - infoSyncTree_: SyncTree; - serverSyncTree_: SyncTree; - stats_: StatsCollection; - statsListener_: StatsListener | null; - eventQueue_: EventQueue; - nextWriteId_: number; - server_: ServerActions; - statsReporter_: StatsReporter; - infoData_: SnapshotHolder; - interceptServerDataCallback_: ((a: string, b: unknown) => void) | null; - /** A list of data pieces and paths to be set when this client disconnects. */ - onDisconnect_: SparseSnapshotTree; - /** Stores queues of outstanding transactions for Firebase locations. */ - transactionQueueTree_: Tree; - persistentConnection_: PersistentConnection | null; - constructor(repoInfo_: RepoInfo, forceRestClient_: boolean, authTokenProvider_: AuthTokenProvider, appCheckProvider_: AppCheckTokenProvider); - /** - * @returns The URL corresponding to the root of this Firebase. - */ - toString(): string; -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * A class that holds metadata about a Repo object - */ -declare class RepoInfo { - readonly secure: boolean; - readonly namespace: string; - readonly webSocketOnly: boolean; - readonly nodeAdmin: boolean; - readonly persistenceKey: string; - readonly includeNamespaceInQueryParams: boolean; - private _host; - private _domain; - internalHost: string; - /** - * @param host - Hostname portion of the url for the repo - * @param secure - Whether or not this repo is accessed over ssl - * @param namespace - The namespace represented by the repo - * @param webSocketOnly - Whether to prefer websockets over all other transports (used by Nest). - * @param nodeAdmin - Whether this instance uses Admin SDK credentials - * @param persistenceKey - Override the default session persistence storage key - */ - constructor(host: string, secure: boolean, namespace: string, webSocketOnly: boolean, nodeAdmin?: boolean, persistenceKey?: string, includeNamespaceInQueryParams?: boolean); - isCacheableHost(): boolean; - isCustomHost(): boolean; - get host(): string; - set host(newHost: string); - toString(): string; - toURLString(): string; -} - -/** - * This function should only ever be called to CREATE a new database instance. - * @internal - */ -export declare function _repoManagerDatabaseFromApp(app: FirebaseApp, authProvider: Provider, appCheckProvider?: Provider, url?: string, nodeAdmin?: boolean): Database; - -/** - * Atomically modifies the data at this location. - * - * Atomically modify the data at this location. Unlike a normal `set()`, which - * just overwrites the data regardless of its previous value, `runTransaction()` is - * used to modify the existing value to a new value, ensuring there are no - * conflicts with other clients writing to the same location at the same time. - * - * To accomplish this, you pass `runTransaction()` an update function which is - * used to transform the current value into a new value. If another client - * writes to the location before your new value is successfully written, your - * update function will be called again with the new current value, and the - * write will be retried. This will happen repeatedly until your write succeeds - * without conflict or you abort the transaction by not returning a value from - * your update function. - * - * Note: Modifying data with `set()` will cancel any pending transactions at - * that location, so extreme care should be taken if mixing `set()` and - * `runTransaction()` to update the same data. - * - * Note: When using transactions with Security and Firebase Rules in place, be - * aware that a client needs `.read` access in addition to `.write` access in - * order to perform a transaction. This is because the client-side nature of - * transactions requires the client to read the data in order to transactionally - * update it. - * - * @param ref - The location to atomically modify. - * @param transactionUpdate - A developer-supplied function which will be passed - * the current data stored at this location (as a JavaScript object). The - * function should return the new value it would like written (as a JavaScript - * object). If `undefined` is returned (i.e. you return with no arguments) the - * transaction will be aborted and the data at this location will not be - * modified. - * @param options - An options object to configure transactions. - * @returns A `Promise` that can optionally be used instead of the `onComplete` - * callback to handle success and failure. - */ -export declare function runTransaction(ref: DatabaseReference, transactionUpdate: (currentData: any) => unknown, options?: TransactionOptions): Promise; - -/** - * Interface defining the set of actions that can be performed against the Firebase server - * (basically corresponds to our wire protocol). - * - * @interface - */ -declare abstract class ServerActions { - abstract listen(query: QueryContext, currentHashFn: () => string, tag: number | null, onComplete: (a: string, b: unknown) => void): void; - /** - * Remove a listen. - */ - abstract unlisten(query: QueryContext, tag: number | null): void; - /** - * Get the server value satisfying this query. - */ - abstract get(query: QueryContext): Promise; - put(pathString: string, data: unknown, onComplete?: (a: string, b: string) => void, hash?: string): void; - merge(pathString: string, data: unknown, onComplete: (a: string, b: string | null) => void, hash?: string): void; - /** - * Refreshes the auth token for the current connection. - * @param token - The authentication token - */ - refreshAuthToken(token: string): void; - /** - * Refreshes the app check token for the current connection. - * @param token The app check token - */ - refreshAppCheckToken(token: string): void; - onDisconnectPut(pathString: string, data: unknown, onComplete?: (a: string, b: string) => void): void; - onDisconnectMerge(pathString: string, data: unknown, onComplete?: (a: string, b: string) => void): void; - onDisconnectCancel(pathString: string, onComplete?: (a: string, b: string) => void): void; - reportStats(stats: { - [k: string]: unknown; - }): void; -} - -/** - * @license - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Returns a placeholder value for auto-populating the current timestamp (time - * since the Unix epoch, in milliseconds) as determined by the Firebase - * servers. - */ -export declare function serverTimestamp(): object; - -/** - * Writes data to this Database location. - * - * This will overwrite any data at this location and all child locations. - * - * The effect of the write will be visible immediately, and the corresponding - * events ("value", "child_added", etc.) will be triggered. Synchronization of - * the data to the Firebase servers will also be started, and the returned - * Promise will resolve when complete. If provided, the `onComplete` callback - * will be called asynchronously after synchronization has finished. - * - * Passing `null` for the new value is equivalent to calling `remove()`; namely, - * all data at this location and all child locations will be deleted. - * - * `set()` will remove any priority stored at this location, so if priority is - * meant to be preserved, you need to use `setWithPriority()` instead. - * - * Note that modifying data with `set()` will cancel any pending transactions - * at that location, so extreme care should be taken if mixing `set()` and - * `transaction()` to modify the same data. - * - * A single `set()` will generate a single "value" event at the location where - * the `set()` was performed. - * - * @param ref - The location to write to. - * @param value - The value to be written (string, number, boolean, object, - * array, or null). - * @returns Resolves when write to server is complete. - */ -export declare function set(ref: DatabaseReference, value: unknown): Promise; - -/** - * Sets a priority for the data at this Database location. - * - * Applications need not use priority but can order collections by - * ordinary properties (see - * {@link https://firebase.google.com/docs/database/web/lists-of-data#sorting_and_filtering_data | Sorting and filtering data} - * ). - * - * @param ref - The location to write to. - * @param priority - The priority to be written (string, number, or null). - * @returns Resolves when write to server is complete. - */ -export declare function setPriority(ref: DatabaseReference, priority: string | number | null): Promise; - -/** - * SDK_VERSION should be set before any database instance is created - * @internal - */ -export declare function _setSDKVersion(version: string): void; - -/** - * Writes data the Database location. Like `set()` but also specifies the - * priority for that data. - * - * Applications need not use priority but can order collections by - * ordinary properties (see - * {@link https://firebase.google.com/docs/database/web/lists-of-data#sorting_and_filtering_data | Sorting and filtering data} - * ). - * - * @param ref - The location to write to. - * @param value - The value to be written (string, number, boolean, object, - * array, or null). - * @param priority - The priority to be written (string, number, or null). - * @returns Resolves when write to server is complete. - */ -export declare function setWithPriority(ref: DatabaseReference, value: unknown, priority: string | number | null): Promise; - -/** - * Mutable object which basically just stores a reference to the "latest" immutable snapshot. - */ -declare class SnapshotHolder { - private rootNode_; - getNode(path: Path): Node_2; - updateSnapshot(path: Path, newSnapshotNode: Node_2): void; -} - -/** - * An immutable sorted map implementation, based on a Left-leaning Red-Black - * tree. - */ -declare class SortedMap { - private comparator_; - private root_; - /** - * Always use the same empty node, to reduce memory. - */ - static EMPTY_NODE: LLRBEmptyNode; - /** - * @param comparator_ - Key comparator. - * @param root_ - Optional root node for the map. - */ - constructor(comparator_: Comparator, root_?: LLRBNode | LLRBEmptyNode); - /** - * Returns a copy of the map, with the specified key/value added or replaced. - * (TODO: We should perhaps rename this method to 'put') - * - * @param key - Key to be added. - * @param value - Value to be added. - * @returns New map, with item added. - */ - insert(key: K, value: V): SortedMap; - /** - * Returns a copy of the map, with the specified key removed. - * - * @param key - The key to remove. - * @returns New map, with item removed. - */ - remove(key: K): SortedMap; - /** - * Returns the value of the node with the given key, or null. - * - * @param key - The key to look up. - * @returns The value of the node with the given key, or null if the - * key doesn't exist. - */ - get(key: K): V | null; - /** - * Returns the key of the item *before* the specified key, or null if key is the first item. - * @param key - The key to find the predecessor of - * @returns The predecessor key. - */ - getPredecessorKey(key: K): K | null; - /** - * @returns True if the map is empty. - */ - isEmpty(): boolean; - /** - * @returns The total number of nodes in the map. - */ - count(): number; - /** - * @returns The minimum key in the map. - */ - minKey(): K | null; - /** - * @returns The maximum key in the map. - */ - maxKey(): K | null; - /** - * Traverses the map in key order and calls the specified action function - * for each key/value pair. - * - * @param action - Callback function to be called - * for each key/value pair. If action returns true, traversal is aborted. - * @returns The first truthy value returned by action, or the last falsey - * value returned by action - */ - inorderTraversal(action: (k: K, v: V) => unknown): boolean; - /** - * Traverses the map in reverse key order and calls the specified action function - * for each key/value pair. - * - * @param action - Callback function to be called - * for each key/value pair. If action returns true, traversal is aborted. - * @returns True if the traversal was aborted. - */ - reverseTraversal(action: (k: K, v: V) => void): boolean; - /** - * Returns an iterator over the SortedMap. - * @returns The iterator. - */ - getIterator(resultGenerator?: (k: K, v: V) => T): SortedMapIterator; - getIteratorFrom(key: K, resultGenerator?: (k: K, v: V) => T): SortedMapIterator; - getReverseIteratorFrom(key: K, resultGenerator?: (k: K, v: V) => T): SortedMapIterator; - getReverseIterator(resultGenerator?: (k: K, v: V) => T): SortedMapIterator; -} - -/** - * An iterator over an LLRBNode. - */ -declare class SortedMapIterator { - private isReverse_; - private resultGenerator_; - private nodeStack_; - /** - * @param node - Node to iterate. - * @param isReverse_ - Whether or not to iterate in reverse - */ - constructor(node: LLRBNode | LLRBEmptyNode, startKey: K | null, comparator: Comparator, isReverse_: boolean, resultGenerator_?: ((k: K, v: V) => T) | null); - getNext(): T; - hasNext(): boolean; - peek(): T; -} - -/** - * Helper class to store a sparse set of snapshots. - */ -declare interface SparseSnapshotTree { - value: Node_2 | null; - readonly children: Map; -} - -/** - * Creates a `QueryConstraint` with the specified starting point (exclusive). - * - * Using `startAt()`, `startAfter()`, `endBefore()`, `endAt()` and `equalTo()` - * allows you to choose arbitrary starting and ending points for your queries. - * - * The starting point is exclusive. If only a value is provided, children - * with a value greater than the specified value will be included in the query. - * If a key is specified, then children must have a value greater than or equal - * to the specified value and a a key name greater than the specified key. - * - * @param value - The value to start after. The argument type depends on which - * `orderBy*()` function was used in this query. Specify a value that matches - * the `orderBy*()` type. When used in combination with `orderByKey()`, the - * value must be a string. - * @param key - The child key to start after. This argument is only allowed if - * ordering by child, value, or priority. - */ -export declare function startAfter(value: number | string | boolean | null, key?: string): QueryConstraint; - -/** - * Creates a `QueryConstraint` with the specified starting point. - * - * Using `startAt()`, `startAfter()`, `endBefore()`, `endAt()` and `equalTo()` - * allows you to choose arbitrary starting and ending points for your queries. - * - * The starting point is inclusive, so children with exactly the specified value - * will be included in the query. The optional key argument can be used to - * further limit the range of the query. If it is specified, then children that - * have exactly the specified value must also have a key name greater than or - * equal to the specified key. - * - * You can read more about `startAt()` in - * {@link https://firebase.google.com/docs/database/web/lists-of-data#filtering_data | Filtering data}. - * - * @param value - The value to start at. The argument type depends on which - * `orderBy*()` function was used in this query. Specify a value that matches - * the `orderBy*()` type. When used in combination with `orderByKey()`, the - * value must be a string. - * @param key - The child key to start at. This argument is only allowed if - * ordering by child, value, or priority. - */ -export declare function startAt(value?: number | string | boolean | null, key?: string): QueryConstraint; - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Tracks a collection of stats. - */ -declare class StatsCollection { - private counters_; - incrementCounter(name: string, amount?: number): void; - get(): { - [k: string]: number; - }; -} - -/** - * Returns the delta from the previous call to get stats. - * - * @param collection_ - The collection to "listen" to. - */ -declare class StatsListener { - private collection_; - private last_; - constructor(collection_: StatsCollection); - get(): { - [k: string]: number; - }; -} - -declare class StatsReporter { - private server_; - private statsListener_; - statsToReport_: { - [k: string]: boolean; - }; - constructor(collection: StatsCollection, server_: ServerActions); - private reportStats_; -} - -/** - * SyncPoint represents a single location in a SyncTree with 1 or more event registrations, meaning we need to - * maintain 1 or more Views at this location to cache server data and raise appropriate events for server changes - * and user writes (set, transaction, update). - * - * It's responsible for: - * - Maintaining the set of 1 or more views necessary at this location (a SyncPoint with 0 views should be removed). - * - Proxying user / server operations to the views as appropriate (i.e. applyServerOverwrite, - * applyUserOverwrite, etc.) - */ -declare class SyncPoint { - /** - * The Views being tracked at this location in the tree, stored as a map where the key is a - * queryId and the value is the View for that query. - * - * NOTE: This list will be quite small (usually 1, but perhaps 2 or 3; any more is an odd use case). - */ - readonly views: Map; -} - -/** - * SyncTree is the central class for managing event callback registration, data caching, views - * (query processing), and event generation. There are typically two SyncTree instances for - * each Repo, one for the normal Firebase data, and one for the .info data. - * - * It has a number of responsibilities, including: - * - Tracking all user event callbacks (registered via addEventRegistration() and removeEventRegistration()). - * - Applying and caching data changes for user set(), transaction(), and update() calls - * (applyUserOverwrite(), applyUserMerge()). - * - Applying and caching data changes for server data changes (applyServerOverwrite(), - * applyServerMerge()). - * - Generating user-facing events for server and user changes (all of the apply* methods - * return the set of events that need to be raised as a result). - * - Maintaining the appropriate set of server listens to ensure we are always subscribed - * to the correct set of paths and queries to satisfy the current set of user event - * callbacks (listens are started/stopped using the provided listenProvider). - * - * NOTE: Although SyncTree tracks event callbacks and calculates events to raise, the actual - * events are returned to the caller rather than raised synchronously. - * - */ -declare class SyncTree { - listenProvider_: ListenProvider; - /** - * Tree of SyncPoints. There's a SyncPoint at any location that has 1 or more views. - */ - syncPointTree_: ImmutableTree; - /** - * A tree of all pending user writes (user-initiated set()'s, transaction()'s, update()'s, etc.). - */ - pendingWriteTree_: WriteTree; - readonly tagToQueryMap: Map; - readonly queryToTagMap: Map; - /** - * @param listenProvider_ - Used by SyncTree to start / stop listening - * to server data. - */ - constructor(listenProvider_: ListenProvider); -} - -/** - * Forces the RepoManager to create Repos that use ReadonlyRestClient instead of PersistentConnection. - * @internal - */ -export declare const _TEST_ACCESS_forceRestClient: (forceRestClient: boolean) => void; - -/** - * @internal - */ -export declare const _TEST_ACCESS_hijackHash: (newHash: () => string) => () => void; - -/** - * A `Promise` that can also act as a `DatabaseReference` when returned by - * {@link push}. The reference is available immediately and the `Promise` resolves - * as the write to the backend completes. - */ -export declare interface ThenableReference extends DatabaseReference, Pick, 'then' | 'catch'> { -} - -declare interface Transaction { - path: Path; - update: (a: unknown) => unknown; - onComplete: (error: Error | null, committed: boolean, node: Node_2 | null) => void; - status: TransactionStatus; - order: number; - applyLocally: boolean; - retryCount: number; - unwatcher: () => void; - abortReason: string | null; - currentWriteId: number; - currentInputSnapshot: Node_2 | null; - currentOutputSnapshotRaw: Node_2 | null; - currentOutputSnapshotResolved: Node_2 | null; -} - -/** An options object to configure transactions. */ -export declare interface TransactionOptions { - /** - * By default, events are raised each time the transaction update function - * runs. So if it is run multiple times, you may see intermediate states. You - * can set this to false to suppress these intermediate states and instead - * wait until the transaction has completed before events are raised. - */ - readonly applyLocally?: boolean; -} - -/** - * A type for the resolve value of {@link runTransaction}. - */ -export declare class TransactionResult { - /** Whether the transaction was successfully committed. */ - readonly committed: boolean; - /** The resulting data snapshot. */ - readonly snapshot: DataSnapshot; - /** @hideconstructor */ - constructor( - /** Whether the transaction was successfully committed. */ - committed: boolean, - /** The resulting data snapshot. */ - snapshot: DataSnapshot); - /** Returns a JSON-serializable representation of this object. */ - toJSON(): object; -} - -declare const enum TransactionStatus { - RUN = 0, - SENT = 1, - COMPLETED = 2, - SENT_NEEDS_ABORT = 3, - NEEDS_ABORT = 4 -} - -/** - * A light-weight tree, traversable by path. Nodes can have both values and children. - * Nodes are not enumerated (by forEachChild) unless they have a value or non-empty - * children. - */ -declare class Tree { - readonly name: string; - readonly parent: Tree | null; - node: TreeNode; - /** - * @param name - Optional name of the node. - * @param parent - Optional parent node. - * @param node - Optional node to wrap. - */ - constructor(name?: string, parent?: Tree | null, node?: TreeNode); -} - -/** - * Node in a Tree. - */ -declare interface TreeNode { - children: Record>; - childCount: number; - value?: T; -} - -/** A callback that can invoked to remove a listener. */ -export declare type Unsubscribe = () => void; - -/** - * Writes multiple values to the Database at once. - * - * The `values` argument contains multiple property-value pairs that will be - * written to the Database together. Each child property can either be a simple - * property (for example, "name") or a relative path (for example, - * "name/first") from the current location to the data to update. - * - * As opposed to the `set()` method, `update()` can be use to selectively update - * only the referenced properties at the current location (instead of replacing - * all the child properties at the current location). - * - * The effect of the write will be visible immediately, and the corresponding - * events ('value', 'child_added', etc.) will be triggered. Synchronization of - * the data to the Firebase servers will also be started, and the returned - * Promise will resolve when complete. If provided, the `onComplete` callback - * will be called asynchronously after synchronization has finished. - * - * A single `update()` will generate a single "value" event at the location - * where the `update()` was performed, regardless of how many children were - * modified. - * - * Note that modifying data with `update()` will cancel any pending - * transactions at that location, so extreme care should be taken if mixing - * `update()` and `transaction()` to modify the same data. - * - * Passing `null` to `update()` will remove the data at this location. - * - * See - * {@link https://firebase.googleblog.com/2015/09/introducing-multi-location-updates-and_86.html | Introducing multi-location updates and more}. - * - * @param ref - The location to write to. - * @param values - Object containing multiple values. - * @returns Resolves when update on server is complete. - */ -export declare function update(ref: DatabaseReference, values: object): Promise; - -/** - * A user callback. Callbacks issues from the Legacy SDK maintain references - * to the original user-issued callbacks, which allows equality - * comparison by reference even though this callbacks are wrapped before - * they can be passed to the firebase@exp SDK. - * - * @internal - */ -export declare interface _UserCallback { - (dataSnapshot: DataSnapshot, previousChildName?: string | null): unknown; - userCallback?: unknown; - context?: object | null; -} - -/** - * @internal - */ -export declare const _validatePathString: (fnName: string, argumentName: string, pathString: string, optional: boolean) => void; - -/** - * @internal - */ -export declare const _validateWritablePath: (fnName: string, path: Path) => void; - -/** - * A view represents a specific location and query that has 1 or more event registrations. - * - * It does several things: - * - Maintains the list of event registrations for this location/query. - * - Maintains a cache of the data visible for this location/query. - * - Applies new operations (via applyOperation), updates the cache, and based on the event - * registrations returns the set of events to be raised. - */ -declare class View { - private query_; - processor_: ViewProcessor; - viewCache_: ViewCache; - eventRegistrations_: EventRegistration[]; - eventGenerator_: EventGenerator; - constructor(query_: QueryContext, initialViewCache: ViewCache); - get query(): QueryContext; -} - -/** - * Stores the data we have cached for a view. - * - * serverSnap is the cached server data, eventSnap is the cached event data (server data plus any local writes). - */ -declare interface ViewCache { - readonly eventCache: CacheNode; - readonly serverCache: CacheNode; -} - -declare interface ViewProcessor { - readonly filter: NodeFilter_2; -} - -/** - * Defines a single user-initiated write operation. May be the result of a set(), transaction(), or update() call. In - * the case of a set() or transaction, snap wil be non-null. In the case of an update(), children will be non-null. - */ -declare interface WriteRecord { - writeId: number; - path: Path; - snap?: Node_2 | null; - children?: { - [k: string]: Node_2; - } | null; - visible: boolean; -} - -/** - * WriteTree tracks all pending user-initiated writes and has methods to calculate the result of merging them - * with underlying server data (to create "event cache" data). Pending writes are added with addOverwrite() - * and addMerge(), and removed with removeWrite(). - */ -declare interface WriteTree { - /** - * A tree tracking the result of applying all visible writes. This does not include transactions with - * applyLocally=false or writes that are completely shadowed by other writes. - */ - visibleWrites: CompoundWrite; - /** - * A list of all pending writes, regardless of visibility and shadowed-ness. Used to calculate arbitrary - * sets of the changed data, such as hidden writes (from transactions) or changes with certain writes excluded (also - * used by transactions). - */ - allWrites: WriteRecord[]; - lastWriteId: number; -} - -export { } diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/index.node.esm.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/index.node.esm.js deleted file mode 100644 index 7d048b5b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/index.node.esm.js +++ /dev/null @@ -1,14037 +0,0 @@ -import Websocket from 'faye-websocket'; -import { stringify, jsonEval, contains, assert, isNodeSdk, stringToByteArray, Sha1, base64, deepCopy, base64Encode, isMobileCordova, stringLength, Deferred, safeGet, isAdmin, isValidFormat, isEmpty, isReactNative, assertionError, map, querystring, errorPrefix, getModularInstance, getDefaultEmulatorHostnameAndPort, createMockUserToken } from '@firebase/util'; -import { Logger, LogLevel } from '@firebase/logger'; -import { _getProvider, getApp, SDK_VERSION as SDK_VERSION$1, _registerComponent, registerVersion } from '@firebase/app'; -import { Component } from '@firebase/component'; - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -const PROTOCOL_VERSION = '5'; -const VERSION_PARAM = 'v'; -const TRANSPORT_SESSION_PARAM = 's'; -const REFERER_PARAM = 'r'; -const FORGE_REF = 'f'; -// Matches console.firebase.google.com, firebase-console-*.corp.google.com and -// firebase.corp.google.com -const FORGE_DOMAIN_RE = /(console\.firebase|firebase-console-\w+\.corp|firebase\.corp)\.google\.com/; -const LAST_SESSION_PARAM = 'ls'; -const APPLICATION_ID_PARAM = 'p'; -const APP_CHECK_TOKEN_PARAM = 'ac'; -const WEBSOCKET = 'websocket'; -const LONG_POLLING = 'long_polling'; - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Wraps a DOM Storage object and: - * - automatically encode objects as JSON strings before storing them to allow us to store arbitrary types. - * - prefixes names with "firebase:" to avoid collisions with app data. - * - * We automatically (see storage.js) create two such wrappers, one for sessionStorage, - * and one for localStorage. - * - */ -class DOMStorageWrapper { - /** - * @param domStorage_ - The underlying storage object (e.g. localStorage or sessionStorage) - */ - constructor(domStorage_) { - this.domStorage_ = domStorage_; - // Use a prefix to avoid collisions with other stuff saved by the app. - this.prefix_ = 'firebase:'; - } - /** - * @param key - The key to save the value under - * @param value - The value being stored, or null to remove the key. - */ - set(key, value) { - if (value == null) { - this.domStorage_.removeItem(this.prefixedName_(key)); - } - else { - this.domStorage_.setItem(this.prefixedName_(key), stringify(value)); - } - } - /** - * @returns The value that was stored under this key, or null - */ - get(key) { - const storedVal = this.domStorage_.getItem(this.prefixedName_(key)); - if (storedVal == null) { - return null; - } - else { - return jsonEval(storedVal); - } - } - remove(key) { - this.domStorage_.removeItem(this.prefixedName_(key)); - } - prefixedName_(name) { - return this.prefix_ + name; - } - toString() { - return this.domStorage_.toString(); - } -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * An in-memory storage implementation that matches the API of DOMStorageWrapper - * (TODO: create interface for both to implement). - */ -class MemoryStorage { - constructor() { - this.cache_ = {}; - this.isInMemoryStorage = true; - } - set(key, value) { - if (value == null) { - delete this.cache_[key]; - } - else { - this.cache_[key] = value; - } - } - get(key) { - if (contains(this.cache_, key)) { - return this.cache_[key]; - } - return null; - } - remove(key) { - delete this.cache_[key]; - } -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Helper to create a DOMStorageWrapper or else fall back to MemoryStorage. - * TODO: Once MemoryStorage and DOMStorageWrapper have a shared interface this method annotation should change - * to reflect this type - * - * @param domStorageName - Name of the underlying storage object - * (e.g. 'localStorage' or 'sessionStorage'). - * @returns Turning off type information until a common interface is defined. - */ -const createStoragefor = function (domStorageName) { - try { - // NOTE: just accessing "localStorage" or "window['localStorage']" may throw a security exception, - // so it must be inside the try/catch. - if (typeof window !== 'undefined' && - typeof window[domStorageName] !== 'undefined') { - // Need to test cache. Just because it's here doesn't mean it works - const domStorage = window[domStorageName]; - domStorage.setItem('firebase:sentinel', 'cache'); - domStorage.removeItem('firebase:sentinel'); - return new DOMStorageWrapper(domStorage); - } - } - catch (e) { } - // Failed to create wrapper. Just return in-memory storage. - // TODO: log? - return new MemoryStorage(); -}; -/** A storage object that lasts across sessions */ -const PersistentStorage = createStoragefor('localStorage'); -/** A storage object that only lasts one session */ -const SessionStorage = createStoragefor('sessionStorage'); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -const logClient = new Logger('@firebase/database'); -/** - * Returns a locally-unique ID (generated by just incrementing up from 0 each time its called). - */ -const LUIDGenerator = (function () { - let id = 1; - return function () { - return id++; - }; -})(); -/** - * Sha1 hash of the input string - * @param str - The string to hash - * @returns {!string} The resulting hash - */ -const sha1 = function (str) { - const utf8Bytes = stringToByteArray(str); - const sha1 = new Sha1(); - sha1.update(utf8Bytes); - const sha1Bytes = sha1.digest(); - return base64.encodeByteArray(sha1Bytes); -}; -const buildLogMessage_ = function (...varArgs) { - let message = ''; - for (let i = 0; i < varArgs.length; i++) { - const arg = varArgs[i]; - if (Array.isArray(arg) || - (arg && - typeof arg === 'object' && - // eslint-disable-next-line @typescript-eslint/no-explicit-any - typeof arg.length === 'number')) { - message += buildLogMessage_.apply(null, arg); - } - else if (typeof arg === 'object') { - message += stringify(arg); - } - else { - message += arg; - } - message += ' '; - } - return message; -}; -/** - * Use this for all debug messages in Firebase. - */ -let logger = null; -/** - * Flag to check for log availability on first log message - */ -let firstLog_ = true; -/** - * The implementation of Firebase.enableLogging (defined here to break dependencies) - * @param logger_ - A flag to turn on logging, or a custom logger - * @param persistent - Whether or not to persist logging settings across refreshes - */ -const enableLogging$1 = function (logger_, persistent) { - assert(!persistent || logger_ === true || logger_ === false, "Can't turn on custom loggers persistently."); - if (logger_ === true) { - logClient.logLevel = LogLevel.VERBOSE; - logger = logClient.log.bind(logClient); - if (persistent) { - SessionStorage.set('logging_enabled', true); - } - } - else if (typeof logger_ === 'function') { - logger = logger_; - } - else { - logger = null; - SessionStorage.remove('logging_enabled'); - } -}; -const log = function (...varArgs) { - if (firstLog_ === true) { - firstLog_ = false; - if (logger === null && SessionStorage.get('logging_enabled') === true) { - enableLogging$1(true); - } - } - if (logger) { - const message = buildLogMessage_.apply(null, varArgs); - logger(message); - } -}; -const logWrapper = function (prefix) { - return function (...varArgs) { - log(prefix, ...varArgs); - }; -}; -const error = function (...varArgs) { - const message = 'FIREBASE INTERNAL ERROR: ' + buildLogMessage_(...varArgs); - logClient.error(message); -}; -const fatal = function (...varArgs) { - const message = `FIREBASE FATAL ERROR: ${buildLogMessage_(...varArgs)}`; - logClient.error(message); - throw new Error(message); -}; -const warn = function (...varArgs) { - const message = 'FIREBASE WARNING: ' + buildLogMessage_(...varArgs); - logClient.warn(message); -}; -/** - * Logs a warning if the containing page uses https. Called when a call to new Firebase - * does not use https. - */ -const warnIfPageIsSecure = function () { - // Be very careful accessing browser globals. Who knows what may or may not exist. - if (typeof window !== 'undefined' && - window.location && - window.location.protocol && - window.location.protocol.indexOf('https:') !== -1) { - warn('Insecure Firebase access from a secure page. ' + - 'Please use https in calls to new Firebase().'); - } -}; -/** - * Returns true if data is NaN, or +/- Infinity. - */ -const isInvalidJSONNumber = function (data) { - return (typeof data === 'number' && - (data !== data || // NaN - data === Number.POSITIVE_INFINITY || - data === Number.NEGATIVE_INFINITY)); -}; -const executeWhenDOMReady = function (fn) { - if (isNodeSdk() || document.readyState === 'complete') { - fn(); - } - else { - // Modeled after jQuery. Try DOMContentLoaded and onreadystatechange (which - // fire before onload), but fall back to onload. - let called = false; - const wrappedFn = function () { - if (!document.body) { - setTimeout(wrappedFn, Math.floor(10)); - return; - } - if (!called) { - called = true; - fn(); - } - }; - if (document.addEventListener) { - document.addEventListener('DOMContentLoaded', wrappedFn, false); - // fallback to onload. - window.addEventListener('load', wrappedFn, false); - // eslint-disable-next-line @typescript-eslint/no-explicit-any - } - else if (document.attachEvent) { - // IE. - // eslint-disable-next-line @typescript-eslint/no-explicit-any - document.attachEvent('onreadystatechange', () => { - if (document.readyState === 'complete') { - wrappedFn(); - } - }); - // fallback to onload. - // eslint-disable-next-line @typescript-eslint/no-explicit-any - window.attachEvent('onload', wrappedFn); - // jQuery has an extra hack for IE that we could employ (based on - // http://javascript.nwbox.com/IEContentLoaded/) But it looks really old. - // I'm hoping we don't need it. - } - } -}; -/** - * Minimum key name. Invalid for actual data, used as a marker to sort before any valid names - */ -const MIN_NAME = '[MIN_NAME]'; -/** - * Maximum key name. Invalid for actual data, used as a marker to sort above any valid names - */ -const MAX_NAME = '[MAX_NAME]'; -/** - * Compares valid Firebase key names, plus min and max name - */ -const nameCompare = function (a, b) { - if (a === b) { - return 0; - } - else if (a === MIN_NAME || b === MAX_NAME) { - return -1; - } - else if (b === MIN_NAME || a === MAX_NAME) { - return 1; - } - else { - const aAsInt = tryParseInt(a), bAsInt = tryParseInt(b); - if (aAsInt !== null) { - if (bAsInt !== null) { - return aAsInt - bAsInt === 0 ? a.length - b.length : aAsInt - bAsInt; - } - else { - return -1; - } - } - else if (bAsInt !== null) { - return 1; - } - else { - return a < b ? -1 : 1; - } - } -}; -/** - * @returns {!number} comparison result. - */ -const stringCompare = function (a, b) { - if (a === b) { - return 0; - } - else if (a < b) { - return -1; - } - else { - return 1; - } -}; -const requireKey = function (key, obj) { - if (obj && key in obj) { - return obj[key]; - } - else { - throw new Error('Missing required key (' + key + ') in object: ' + stringify(obj)); - } -}; -const ObjectToUniqueKey = function (obj) { - if (typeof obj !== 'object' || obj === null) { - return stringify(obj); - } - const keys = []; - // eslint-disable-next-line guard-for-in - for (const k in obj) { - keys.push(k); - } - // Export as json, but with the keys sorted. - keys.sort(); - let key = '{'; - for (let i = 0; i < keys.length; i++) { - if (i !== 0) { - key += ','; - } - key += stringify(keys[i]); - key += ':'; - key += ObjectToUniqueKey(obj[keys[i]]); - } - key += '}'; - return key; -}; -/** - * Splits a string into a number of smaller segments of maximum size - * @param str - The string - * @param segsize - The maximum number of chars in the string. - * @returns The string, split into appropriately-sized chunks - */ -const splitStringBySize = function (str, segsize) { - const len = str.length; - if (len <= segsize) { - return [str]; - } - const dataSegs = []; - for (let c = 0; c < len; c += segsize) { - if (c + segsize > len) { - dataSegs.push(str.substring(c, len)); - } - else { - dataSegs.push(str.substring(c, c + segsize)); - } - } - return dataSegs; -}; -/** - * Apply a function to each (key, value) pair in an object or - * apply a function to each (index, value) pair in an array - * @param obj - The object or array to iterate over - * @param fn - The function to apply - */ -function each(obj, fn) { - for (const key in obj) { - if (obj.hasOwnProperty(key)) { - fn(key, obj[key]); - } - } -} -/** - * Borrowed from http://hg.secondlife.com/llsd/src/tip/js/typedarray.js (MIT License) - * I made one modification at the end and removed the NaN / Infinity - * handling (since it seemed broken [caused an overflow] and we don't need it). See MJL comments. - * @param v - A double - * - */ -const doubleToIEEE754String = function (v) { - assert(!isInvalidJSONNumber(v), 'Invalid JSON number'); // MJL - const ebits = 11, fbits = 52; - const bias = (1 << (ebits - 1)) - 1; - let s, e, f, ln, i; - // Compute sign, exponent, fraction - // Skip NaN / Infinity handling --MJL. - if (v === 0) { - e = 0; - f = 0; - s = 1 / v === -Infinity ? 1 : 0; - } - else { - s = v < 0; - v = Math.abs(v); - if (v >= Math.pow(2, 1 - bias)) { - // Normalized - ln = Math.min(Math.floor(Math.log(v) / Math.LN2), bias); - e = ln + bias; - f = Math.round(v * Math.pow(2, fbits - ln) - Math.pow(2, fbits)); - } - else { - // Denormalized - e = 0; - f = Math.round(v / Math.pow(2, 1 - bias - fbits)); - } - } - // Pack sign, exponent, fraction - const bits = []; - for (i = fbits; i; i -= 1) { - bits.push(f % 2 ? 1 : 0); - f = Math.floor(f / 2); - } - for (i = ebits; i; i -= 1) { - bits.push(e % 2 ? 1 : 0); - e = Math.floor(e / 2); - } - bits.push(s ? 1 : 0); - bits.reverse(); - const str = bits.join(''); - // Return the data as a hex string. --MJL - let hexByteString = ''; - for (i = 0; i < 64; i += 8) { - let hexByte = parseInt(str.substr(i, 8), 2).toString(16); - if (hexByte.length === 1) { - hexByte = '0' + hexByte; - } - hexByteString = hexByteString + hexByte; - } - return hexByteString.toLowerCase(); -}; -/** - * Used to detect if we're in a Chrome content script (which executes in an - * isolated environment where long-polling doesn't work). - */ -const isChromeExtensionContentScript = function () { - return !!(typeof window === 'object' && - window['chrome'] && - window['chrome']['extension'] && - !/^chrome/.test(window.location.href)); -}; -/** - * Used to detect if we're in a Windows 8 Store app. - */ -const isWindowsStoreApp = function () { - // Check for the presence of a couple WinRT globals - return typeof Windows === 'object' && typeof Windows.UI === 'object'; -}; -/** - * Converts a server error code to a Javascript Error - */ -function errorForServerCode(code, query) { - let reason = 'Unknown Error'; - if (code === 'too_big') { - reason = - 'The data requested exceeds the maximum size ' + - 'that can be accessed with a single request.'; - } - else if (code === 'permission_denied') { - reason = "Client doesn't have permission to access the desired data."; - } - else if (code === 'unavailable') { - reason = 'The service is unavailable'; - } - const error = new Error(code + ' at ' + query._path.toString() + ': ' + reason); - // eslint-disable-next-line @typescript-eslint/no-explicit-any - error.code = code.toUpperCase(); - return error; -} -/** - * Used to test for integer-looking strings - */ -const INTEGER_REGEXP_ = new RegExp('^-?(0*)\\d{1,10}$'); -/** - * For use in keys, the minimum possible 32-bit integer. - */ -const INTEGER_32_MIN = -2147483648; -/** - * For use in kyes, the maximum possible 32-bit integer. - */ -const INTEGER_32_MAX = 2147483647; -/** - * If the string contains a 32-bit integer, return it. Else return null. - */ -const tryParseInt = function (str) { - if (INTEGER_REGEXP_.test(str)) { - const intVal = Number(str); - if (intVal >= INTEGER_32_MIN && intVal <= INTEGER_32_MAX) { - return intVal; - } - } - return null; -}; -/** - * Helper to run some code but catch any exceptions and re-throw them later. - * Useful for preventing user callbacks from breaking internal code. - * - * Re-throwing the exception from a setTimeout is a little evil, but it's very - * convenient (we don't have to try to figure out when is a safe point to - * re-throw it), and the behavior seems reasonable: - * - * * If you aren't pausing on exceptions, you get an error in the console with - * the correct stack trace. - * * If you're pausing on all exceptions, the debugger will pause on your - * exception and then again when we rethrow it. - * * If you're only pausing on uncaught exceptions, the debugger will only pause - * on us re-throwing it. - * - * @param fn - The code to guard. - */ -const exceptionGuard = function (fn) { - try { - fn(); - } - catch (e) { - // Re-throw exception when it's safe. - setTimeout(() => { - // It used to be that "throw e" would result in a good console error with - // relevant context, but as of Chrome 39, you just get the firebase.js - // file/line number where we re-throw it, which is useless. So we log - // e.stack explicitly. - const stack = e.stack || ''; - warn('Exception was thrown by user callback.', stack); - throw e; - }, Math.floor(0)); - } -}; -/** - * @returns {boolean} true if we think we're currently being crawled. - */ -const beingCrawled = function () { - const userAgent = (typeof window === 'object' && - window['navigator'] && - window['navigator']['userAgent']) || - ''; - // For now we whitelist the most popular crawlers. We should refine this to be the set of crawlers we - // believe to support JavaScript/AJAX rendering. - // NOTE: Google Webmaster Tools doesn't really belong, but their "This is how a visitor to your website - // would have seen the page" is flaky if we don't treat it as a crawler. - return (userAgent.search(/googlebot|google webmaster tools|bingbot|yahoo! slurp|baiduspider|yandexbot|duckduckbot/i) >= 0); -}; -/** - * Same as setTimeout() except on Node.JS it will /not/ prevent the process from exiting. - * - * It is removed with clearTimeout() as normal. - * - * @param fn - Function to run. - * @param time - Milliseconds to wait before running. - * @returns The setTimeout() return value. - */ -const setTimeoutNonBlocking = function (fn, time) { - const timeout = setTimeout(fn, time); - // Note: at the time of this comment, unrefTimer is under the unstable set of APIs. Run with --unstable to enable the API. - if (typeof timeout === 'number' && - // @ts-ignore Is only defined in Deno environments. - typeof Deno !== 'undefined' && - // @ts-ignore Deno and unrefTimer are only defined in Deno environments. - Deno['unrefTimer']) { - // @ts-ignore Deno and unrefTimer are only defined in Deno environments. - Deno.unrefTimer(timeout); - // eslint-disable-next-line @typescript-eslint/no-explicit-any - } - else if (typeof timeout === 'object' && timeout['unref']) { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - timeout['unref'](); - } - return timeout; -}; - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * A class that holds metadata about a Repo object - */ -class RepoInfo { - /** - * @param host - Hostname portion of the url for the repo - * @param secure - Whether or not this repo is accessed over ssl - * @param namespace - The namespace represented by the repo - * @param webSocketOnly - Whether to prefer websockets over all other transports (used by Nest). - * @param nodeAdmin - Whether this instance uses Admin SDK credentials - * @param persistenceKey - Override the default session persistence storage key - */ - constructor(host, secure, namespace, webSocketOnly, nodeAdmin = false, persistenceKey = '', includeNamespaceInQueryParams = false) { - this.secure = secure; - this.namespace = namespace; - this.webSocketOnly = webSocketOnly; - this.nodeAdmin = nodeAdmin; - this.persistenceKey = persistenceKey; - this.includeNamespaceInQueryParams = includeNamespaceInQueryParams; - this._host = host.toLowerCase(); - this._domain = this._host.substr(this._host.indexOf('.') + 1); - this.internalHost = - PersistentStorage.get('host:' + host) || this._host; - } - isCacheableHost() { - return this.internalHost.substr(0, 2) === 's-'; - } - isCustomHost() { - return (this._domain !== 'firebaseio.com' && - this._domain !== 'firebaseio-demo.com'); - } - get host() { - return this._host; - } - set host(newHost) { - if (newHost !== this.internalHost) { - this.internalHost = newHost; - if (this.isCacheableHost()) { - PersistentStorage.set('host:' + this._host, this.internalHost); - } - } - } - toString() { - let str = this.toURLString(); - if (this.persistenceKey) { - str += '<' + this.persistenceKey + '>'; - } - return str; - } - toURLString() { - const protocol = this.secure ? 'https://' : 'http://'; - const query = this.includeNamespaceInQueryParams - ? `?ns=${this.namespace}` - : ''; - return `${protocol}${this.host}/${query}`; - } -} -function repoInfoNeedsQueryParam(repoInfo) { - return (repoInfo.host !== repoInfo.internalHost || - repoInfo.isCustomHost() || - repoInfo.includeNamespaceInQueryParams); -} -/** - * Returns the websocket URL for this repo - * @param repoInfo - RepoInfo object - * @param type - of connection - * @param params - list - * @returns The URL for this repo - */ -function repoInfoConnectionURL(repoInfo, type, params) { - assert(typeof type === 'string', 'typeof type must == string'); - assert(typeof params === 'object', 'typeof params must == object'); - let connURL; - if (type === WEBSOCKET) { - connURL = - (repoInfo.secure ? 'wss://' : 'ws://') + repoInfo.internalHost + '/.ws?'; - } - else if (type === LONG_POLLING) { - connURL = - (repoInfo.secure ? 'https://' : 'http://') + - repoInfo.internalHost + - '/.lp?'; - } - else { - throw new Error('Unknown connection type: ' + type); - } - if (repoInfoNeedsQueryParam(repoInfo)) { - params['ns'] = repoInfo.namespace; - } - const pairs = []; - each(params, (key, value) => { - pairs.push(key + '=' + value); - }); - return connURL + pairs.join('&'); -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Tracks a collection of stats. - */ -class StatsCollection { - constructor() { - this.counters_ = {}; - } - incrementCounter(name, amount = 1) { - if (!contains(this.counters_, name)) { - this.counters_[name] = 0; - } - this.counters_[name] += amount; - } - get() { - return deepCopy(this.counters_); - } -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -const collections = {}; -const reporters = {}; -function statsManagerGetCollection(repoInfo) { - const hashString = repoInfo.toString(); - if (!collections[hashString]) { - collections[hashString] = new StatsCollection(); - } - return collections[hashString]; -} -function statsManagerGetOrCreateReporter(repoInfo, creatorFunction) { - const hashString = repoInfo.toString(); - if (!reporters[hashString]) { - reporters[hashString] = creatorFunction(); - } - return reporters[hashString]; -} - -/** - * @license - * Copyright 2019 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** The semver (www.semver.org) version of the SDK. */ -let SDK_VERSION = ''; -/** - * SDK_VERSION should be set before any database instance is created - * @internal - */ -function setSDKVersion(version) { - SDK_VERSION = version; -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -const WEBSOCKET_MAX_FRAME_SIZE = 16384; -const WEBSOCKET_KEEPALIVE_INTERVAL = 45000; -let WebSocketImpl = null; -if (typeof MozWebSocket !== 'undefined') { - WebSocketImpl = MozWebSocket; -} -else if (typeof WebSocket !== 'undefined') { - WebSocketImpl = WebSocket; -} -function setWebSocketImpl(impl) { - WebSocketImpl = impl; -} -/** - * Create a new websocket connection with the given callbacks. - */ -class WebSocketConnection { - /** - * @param connId identifier for this transport - * @param repoInfo The info for the websocket endpoint. - * @param applicationId The Firebase App ID for this project. - * @param appCheckToken The App Check Token for this client. - * @param authToken The Auth Token for this client. - * @param transportSessionId Optional transportSessionId if this is connecting - * to an existing transport session - * @param lastSessionId Optional lastSessionId if there was a previous - * connection - */ - constructor(connId, repoInfo, applicationId, appCheckToken, authToken, transportSessionId, lastSessionId) { - this.connId = connId; - this.applicationId = applicationId; - this.appCheckToken = appCheckToken; - this.authToken = authToken; - this.keepaliveTimer = null; - this.frames = null; - this.totalFrames = 0; - this.bytesSent = 0; - this.bytesReceived = 0; - this.log_ = logWrapper(this.connId); - this.stats_ = statsManagerGetCollection(repoInfo); - this.connURL = WebSocketConnection.connectionURL_(repoInfo, transportSessionId, lastSessionId, appCheckToken, applicationId); - this.nodeAdmin = repoInfo.nodeAdmin; - } - /** - * @param repoInfo - The info for the websocket endpoint. - * @param transportSessionId - Optional transportSessionId if this is connecting to an existing transport - * session - * @param lastSessionId - Optional lastSessionId if there was a previous connection - * @returns connection url - */ - static connectionURL_(repoInfo, transportSessionId, lastSessionId, appCheckToken, applicationId) { - const urlParams = {}; - urlParams[VERSION_PARAM] = PROTOCOL_VERSION; - if (!isNodeSdk() && - typeof location !== 'undefined' && - location.hostname && - FORGE_DOMAIN_RE.test(location.hostname)) { - urlParams[REFERER_PARAM] = FORGE_REF; - } - if (transportSessionId) { - urlParams[TRANSPORT_SESSION_PARAM] = transportSessionId; - } - if (lastSessionId) { - urlParams[LAST_SESSION_PARAM] = lastSessionId; - } - if (appCheckToken) { - urlParams[APP_CHECK_TOKEN_PARAM] = appCheckToken; - } - if (applicationId) { - urlParams[APPLICATION_ID_PARAM] = applicationId; - } - return repoInfoConnectionURL(repoInfo, WEBSOCKET, urlParams); - } - /** - * @param onMessage - Callback when messages arrive - * @param onDisconnect - Callback with connection lost. - */ - open(onMessage, onDisconnect) { - this.onDisconnect = onDisconnect; - this.onMessage = onMessage; - this.log_('Websocket connecting to ' + this.connURL); - this.everConnected_ = false; - // Assume failure until proven otherwise. - PersistentStorage.set('previous_websocket_failure', true); - try { - let options; - if (isNodeSdk()) { - const device = this.nodeAdmin ? 'AdminNode' : 'Node'; - // UA Format: Firebase//// - options = { - headers: { - 'User-Agent': `Firebase/${PROTOCOL_VERSION}/${SDK_VERSION}/${process.platform}/${device}`, - 'X-Firebase-GMPID': this.applicationId || '' - } - }; - // If using Node with admin creds, AppCheck-related checks are unnecessary. - // Note that we send the credentials here even if they aren't admin credentials, which is - // not a problem. - // Note that this header is just used to bypass appcheck, and the token should still be sent - // through the websocket connection once it is established. - if (this.authToken) { - options.headers['Authorization'] = `Bearer ${this.authToken}`; - } - if (this.appCheckToken) { - options.headers['X-Firebase-AppCheck'] = this.appCheckToken; - } - // Plumb appropriate http_proxy environment variable into faye-websocket if it exists. - const env = process['env']; - const proxy = this.connURL.indexOf('wss://') === 0 - ? env['HTTPS_PROXY'] || env['https_proxy'] - : env['HTTP_PROXY'] || env['http_proxy']; - if (proxy) { - options['proxy'] = { origin: proxy }; - } - } - this.mySock = new WebSocketImpl(this.connURL, [], options); - } - catch (e) { - this.log_('Error instantiating WebSocket.'); - const error = e.message || e.data; - if (error) { - this.log_(error); - } - this.onClosed_(); - return; - } - this.mySock.onopen = () => { - this.log_('Websocket connected.'); - this.everConnected_ = true; - }; - this.mySock.onclose = () => { - this.log_('Websocket connection was disconnected.'); - this.mySock = null; - this.onClosed_(); - }; - this.mySock.onmessage = m => { - this.handleIncomingFrame(m); - }; - this.mySock.onerror = e => { - this.log_('WebSocket error. Closing connection.'); - // eslint-disable-next-line @typescript-eslint/no-explicit-any - const error = e.message || e.data; - if (error) { - this.log_(error); - } - this.onClosed_(); - }; - } - /** - * No-op for websockets, we don't need to do anything once the connection is confirmed as open - */ - start() { } - static forceDisallow() { - WebSocketConnection.forceDisallow_ = true; - } - static isAvailable() { - let isOldAndroid = false; - if (typeof navigator !== 'undefined' && navigator.userAgent) { - const oldAndroidRegex = /Android ([0-9]{0,}\.[0-9]{0,})/; - const oldAndroidMatch = navigator.userAgent.match(oldAndroidRegex); - if (oldAndroidMatch && oldAndroidMatch.length > 1) { - if (parseFloat(oldAndroidMatch[1]) < 4.4) { - isOldAndroid = true; - } - } - } - return (!isOldAndroid && - WebSocketImpl !== null && - !WebSocketConnection.forceDisallow_); - } - /** - * Returns true if we previously failed to connect with this transport. - */ - static previouslyFailed() { - // If our persistent storage is actually only in-memory storage, - // we default to assuming that it previously failed to be safe. - return (PersistentStorage.isInMemoryStorage || - PersistentStorage.get('previous_websocket_failure') === true); - } - markConnectionHealthy() { - PersistentStorage.remove('previous_websocket_failure'); - } - appendFrame_(data) { - this.frames.push(data); - if (this.frames.length === this.totalFrames) { - const fullMess = this.frames.join(''); - this.frames = null; - const jsonMess = jsonEval(fullMess); - //handle the message - this.onMessage(jsonMess); - } - } - /** - * @param frameCount - The number of frames we are expecting from the server - */ - handleNewFrameCount_(frameCount) { - this.totalFrames = frameCount; - this.frames = []; - } - /** - * Attempts to parse a frame count out of some text. If it can't, assumes a value of 1 - * @returns Any remaining data to be process, or null if there is none - */ - extractFrameCount_(data) { - assert(this.frames === null, 'We already have a frame buffer'); - // TODO: The server is only supposed to send up to 9999 frames (i.e. length <= 4), but that isn't being enforced - // currently. So allowing larger frame counts (length <= 6). See https://app.asana.com/0/search/8688598998380/8237608042508 - if (data.length <= 6) { - const frameCount = Number(data); - if (!isNaN(frameCount)) { - this.handleNewFrameCount_(frameCount); - return null; - } - } - this.handleNewFrameCount_(1); - return data; - } - /** - * Process a websocket frame that has arrived from the server. - * @param mess - The frame data - */ - handleIncomingFrame(mess) { - if (this.mySock === null) { - return; // Chrome apparently delivers incoming packets even after we .close() the connection sometimes. - } - const data = mess['data']; - this.bytesReceived += data.length; - this.stats_.incrementCounter('bytes_received', data.length); - this.resetKeepAlive(); - if (this.frames !== null) { - // we're buffering - this.appendFrame_(data); - } - else { - // try to parse out a frame count, otherwise, assume 1 and process it - const remainingData = this.extractFrameCount_(data); - if (remainingData !== null) { - this.appendFrame_(remainingData); - } - } - } - /** - * Send a message to the server - * @param data - The JSON object to transmit - */ - send(data) { - this.resetKeepAlive(); - const dataStr = stringify(data); - this.bytesSent += dataStr.length; - this.stats_.incrementCounter('bytes_sent', dataStr.length); - //We can only fit a certain amount in each websocket frame, so we need to split this request - //up into multiple pieces if it doesn't fit in one request. - const dataSegs = splitStringBySize(dataStr, WEBSOCKET_MAX_FRAME_SIZE); - //Send the length header - if (dataSegs.length > 1) { - this.sendString_(String(dataSegs.length)); - } - //Send the actual data in segments. - for (let i = 0; i < dataSegs.length; i++) { - this.sendString_(dataSegs[i]); - } - } - shutdown_() { - this.isClosed_ = true; - if (this.keepaliveTimer) { - clearInterval(this.keepaliveTimer); - this.keepaliveTimer = null; - } - if (this.mySock) { - this.mySock.close(); - this.mySock = null; - } - } - onClosed_() { - if (!this.isClosed_) { - this.log_('WebSocket is closing itself'); - this.shutdown_(); - // since this is an internal close, trigger the close listener - if (this.onDisconnect) { - this.onDisconnect(this.everConnected_); - this.onDisconnect = null; - } - } - } - /** - * External-facing close handler. - * Close the websocket and kill the connection. - */ - close() { - if (!this.isClosed_) { - this.log_('WebSocket is being closed'); - this.shutdown_(); - } - } - /** - * Kill the current keepalive timer and start a new one, to ensure that it always fires N seconds after - * the last activity. - */ - resetKeepAlive() { - clearInterval(this.keepaliveTimer); - this.keepaliveTimer = setInterval(() => { - //If there has been no websocket activity for a while, send a no-op - if (this.mySock) { - this.sendString_('0'); - } - this.resetKeepAlive(); - // eslint-disable-next-line @typescript-eslint/no-explicit-any - }, Math.floor(WEBSOCKET_KEEPALIVE_INTERVAL)); - } - /** - * Send a string over the websocket. - * - * @param str - String to send. - */ - sendString_(str) { - // Firefox seems to sometimes throw exceptions (NS_ERROR_UNEXPECTED) from websocket .send() - // calls for some unknown reason. We treat these as an error and disconnect. - // See https://app.asana.com/0/58926111402292/68021340250410 - try { - this.mySock.send(str); - } - catch (e) { - this.log_('Exception thrown from WebSocket.send():', e.message || e.data, 'Closing connection.'); - setTimeout(this.onClosed_.bind(this), 0); - } - } -} -/** - * Number of response before we consider the connection "healthy." - */ -WebSocketConnection.responsesRequiredToBeHealthy = 2; -/** - * Time to wait for the connection te become healthy before giving up. - */ -WebSocketConnection.healthyTimeout = 30000; - -const name = "@firebase/database"; -const version = "0.13.10"; - -/** - * @license - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Abstraction around AppCheck's token fetching capabilities. - */ -class AppCheckTokenProvider { - constructor(appName_, appCheckProvider) { - this.appName_ = appName_; - this.appCheckProvider = appCheckProvider; - this.appCheck = appCheckProvider === null || appCheckProvider === void 0 ? void 0 : appCheckProvider.getImmediate({ optional: true }); - if (!this.appCheck) { - appCheckProvider === null || appCheckProvider === void 0 ? void 0 : appCheckProvider.get().then(appCheck => (this.appCheck = appCheck)); - } - } - getToken(forceRefresh) { - if (!this.appCheck) { - return new Promise((resolve, reject) => { - // Support delayed initialization of FirebaseAppCheck. This allows our - // customers to initialize the RTDB SDK before initializing Firebase - // AppCheck and ensures that all requests are authenticated if a token - // becomes available before the timoeout below expires. - setTimeout(() => { - if (this.appCheck) { - this.getToken(forceRefresh).then(resolve, reject); - } - else { - resolve(null); - } - }, 0); - }); - } - return this.appCheck.getToken(forceRefresh); - } - addTokenChangeListener(listener) { - var _a; - (_a = this.appCheckProvider) === null || _a === void 0 ? void 0 : _a.get().then(appCheck => appCheck.addTokenListener(listener)); - } - notifyForInvalidToken() { - warn(`Provided AppCheck credentials for the app named "${this.appName_}" ` + - 'are invalid. This usually indicates your app was not initialized correctly.'); - } -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Abstraction around FirebaseApp's token fetching capabilities. - */ -class FirebaseAuthTokenProvider { - constructor(appName_, firebaseOptions_, authProvider_) { - this.appName_ = appName_; - this.firebaseOptions_ = firebaseOptions_; - this.authProvider_ = authProvider_; - this.auth_ = null; - this.auth_ = authProvider_.getImmediate({ optional: true }); - if (!this.auth_) { - authProvider_.onInit(auth => (this.auth_ = auth)); - } - } - getToken(forceRefresh) { - if (!this.auth_) { - return new Promise((resolve, reject) => { - // Support delayed initialization of FirebaseAuth. This allows our - // customers to initialize the RTDB SDK before initializing Firebase - // Auth and ensures that all requests are authenticated if a token - // becomes available before the timoeout below expires. - setTimeout(() => { - if (this.auth_) { - this.getToken(forceRefresh).then(resolve, reject); - } - else { - resolve(null); - } - }, 0); - }); - } - return this.auth_.getToken(forceRefresh).catch(error => { - // TODO: Need to figure out all the cases this is raised and whether - // this makes sense. - if (error && error.code === 'auth/token-not-initialized') { - log('Got auth/token-not-initialized error. Treating as null token.'); - return null; - } - else { - return Promise.reject(error); - } - }); - } - addTokenChangeListener(listener) { - // TODO: We might want to wrap the listener and call it with no args to - // avoid a leaky abstraction, but that makes removing the listener harder. - if (this.auth_) { - this.auth_.addAuthTokenListener(listener); - } - else { - this.authProvider_ - .get() - .then(auth => auth.addAuthTokenListener(listener)); - } - } - removeTokenChangeListener(listener) { - this.authProvider_ - .get() - .then(auth => auth.removeAuthTokenListener(listener)); - } - notifyForInvalidToken() { - let errorMessage = 'Provided authentication credentials for the app named "' + - this.appName_ + - '" are invalid. This usually indicates your app was not ' + - 'initialized correctly. '; - if ('credential' in this.firebaseOptions_) { - errorMessage += - 'Make sure the "credential" property provided to initializeApp() ' + - 'is authorized to access the specified "databaseURL" and is from the correct ' + - 'project.'; - } - else if ('serviceAccount' in this.firebaseOptions_) { - errorMessage += - 'Make sure the "serviceAccount" property provided to initializeApp() ' + - 'is authorized to access the specified "databaseURL" and is from the correct ' + - 'project.'; - } - else { - errorMessage += - 'Make sure the "apiKey" and "databaseURL" properties provided to ' + - 'initializeApp() match the values provided for your app at ' + - 'https://console.firebase.google.com/.'; - } - warn(errorMessage); - } -} -/* AuthTokenProvider that supplies a constant token. Used by Admin SDK or mockUserToken with emulators. */ -class EmulatorTokenProvider { - constructor(accessToken) { - this.accessToken = accessToken; - } - getToken(forceRefresh) { - return Promise.resolve({ - accessToken: this.accessToken - }); - } - addTokenChangeListener(listener) { - // Invoke the listener immediately to match the behavior in Firebase Auth - // (see packages/auth/src/auth.js#L1807) - listener(this.accessToken); - } - removeTokenChangeListener(listener) { } - notifyForInvalidToken() { } -} -/** A string that is treated as an admin access token by the RTDB emulator. Used by Admin SDK. */ -EmulatorTokenProvider.OWNER = 'owner'; - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * This class ensures the packets from the server arrive in order - * This class takes data from the server and ensures it gets passed into the callbacks in order. - */ -class PacketReceiver { - /** - * @param onMessage_ - */ - constructor(onMessage_) { - this.onMessage_ = onMessage_; - this.pendingResponses = []; - this.currentResponseNum = 0; - this.closeAfterResponse = -1; - this.onClose = null; - } - closeAfter(responseNum, callback) { - this.closeAfterResponse = responseNum; - this.onClose = callback; - if (this.closeAfterResponse < this.currentResponseNum) { - this.onClose(); - this.onClose = null; - } - } - /** - * Each message from the server comes with a response number, and an array of data. The responseNumber - * allows us to ensure that we process them in the right order, since we can't be guaranteed that all - * browsers will respond in the same order as the requests we sent - */ - handleResponse(requestNum, data) { - this.pendingResponses[requestNum] = data; - while (this.pendingResponses[this.currentResponseNum]) { - const toProcess = this.pendingResponses[this.currentResponseNum]; - delete this.pendingResponses[this.currentResponseNum]; - for (let i = 0; i < toProcess.length; ++i) { - if (toProcess[i]) { - exceptionGuard(() => { - this.onMessage_(toProcess[i]); - }); - } - } - if (this.currentResponseNum === this.closeAfterResponse) { - if (this.onClose) { - this.onClose(); - this.onClose = null; - } - break; - } - this.currentResponseNum++; - } - } -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// URL query parameters associated with longpolling -const FIREBASE_LONGPOLL_START_PARAM = 'start'; -const FIREBASE_LONGPOLL_CLOSE_COMMAND = 'close'; -const FIREBASE_LONGPOLL_COMMAND_CB_NAME = 'pLPCommand'; -const FIREBASE_LONGPOLL_DATA_CB_NAME = 'pRTLPCB'; -const FIREBASE_LONGPOLL_ID_PARAM = 'id'; -const FIREBASE_LONGPOLL_PW_PARAM = 'pw'; -const FIREBASE_LONGPOLL_SERIAL_PARAM = 'ser'; -const FIREBASE_LONGPOLL_CALLBACK_ID_PARAM = 'cb'; -const FIREBASE_LONGPOLL_SEGMENT_NUM_PARAM = 'seg'; -const FIREBASE_LONGPOLL_SEGMENTS_IN_PACKET = 'ts'; -const FIREBASE_LONGPOLL_DATA_PARAM = 'd'; -const FIREBASE_LONGPOLL_DISCONN_FRAME_REQUEST_PARAM = 'dframe'; -//Data size constants. -//TODO: Perf: the maximum length actually differs from browser to browser. -// We should check what browser we're on and set accordingly. -const MAX_URL_DATA_SIZE = 1870; -const SEG_HEADER_SIZE = 30; //ie: &seg=8299234&ts=982389123&d= -const MAX_PAYLOAD_SIZE = MAX_URL_DATA_SIZE - SEG_HEADER_SIZE; -/** - * Keepalive period - * send a fresh request at minimum every 25 seconds. Opera has a maximum request - * length of 30 seconds that we can't exceed. - */ -const KEEPALIVE_REQUEST_INTERVAL = 25000; -/** - * How long to wait before aborting a long-polling connection attempt. - */ -const LP_CONNECT_TIMEOUT = 30000; -/** - * This class manages a single long-polling connection. - */ -class BrowserPollConnection { - /** - * @param connId An identifier for this connection, used for logging - * @param repoInfo The info for the endpoint to send data to. - * @param applicationId The Firebase App ID for this project. - * @param appCheckToken The AppCheck token for this client. - * @param authToken The AuthToken to use for this connection. - * @param transportSessionId Optional transportSessionid if we are - * reconnecting for an existing transport session - * @param lastSessionId Optional lastSessionId if the PersistentConnection has - * already created a connection previously - */ - constructor(connId, repoInfo, applicationId, appCheckToken, authToken, transportSessionId, lastSessionId) { - this.connId = connId; - this.repoInfo = repoInfo; - this.applicationId = applicationId; - this.appCheckToken = appCheckToken; - this.authToken = authToken; - this.transportSessionId = transportSessionId; - this.lastSessionId = lastSessionId; - this.bytesSent = 0; - this.bytesReceived = 0; - this.everConnected_ = false; - this.log_ = logWrapper(connId); - this.stats_ = statsManagerGetCollection(repoInfo); - this.urlFn = (params) => { - // Always add the token if we have one. - if (this.appCheckToken) { - params[APP_CHECK_TOKEN_PARAM] = this.appCheckToken; - } - return repoInfoConnectionURL(repoInfo, LONG_POLLING, params); - }; - } - /** - * @param onMessage - Callback when messages arrive - * @param onDisconnect - Callback with connection lost. - */ - open(onMessage, onDisconnect) { - this.curSegmentNum = 0; - this.onDisconnect_ = onDisconnect; - this.myPacketOrderer = new PacketReceiver(onMessage); - this.isClosed_ = false; - this.connectTimeoutTimer_ = setTimeout(() => { - this.log_('Timed out trying to connect.'); - // Make sure we clear the host cache - this.onClosed_(); - this.connectTimeoutTimer_ = null; - // eslint-disable-next-line @typescript-eslint/no-explicit-any - }, Math.floor(LP_CONNECT_TIMEOUT)); - // Ensure we delay the creation of the iframe until the DOM is loaded. - executeWhenDOMReady(() => { - if (this.isClosed_) { - return; - } - //Set up a callback that gets triggered once a connection is set up. - this.scriptTagHolder = new FirebaseIFrameScriptHolder((...args) => { - const [command, arg1, arg2, arg3, arg4] = args; - this.incrementIncomingBytes_(args); - if (!this.scriptTagHolder) { - return; // we closed the connection. - } - if (this.connectTimeoutTimer_) { - clearTimeout(this.connectTimeoutTimer_); - this.connectTimeoutTimer_ = null; - } - this.everConnected_ = true; - if (command === FIREBASE_LONGPOLL_START_PARAM) { - this.id = arg1; - this.password = arg2; - } - else if (command === FIREBASE_LONGPOLL_CLOSE_COMMAND) { - // Don't clear the host cache. We got a response from the server, so we know it's reachable - if (arg1) { - // We aren't expecting any more data (other than what the server's already in the process of sending us - // through our already open polls), so don't send any more. - this.scriptTagHolder.sendNewPolls = false; - // arg1 in this case is the last response number sent by the server. We should try to receive - // all of the responses up to this one before closing - this.myPacketOrderer.closeAfter(arg1, () => { - this.onClosed_(); - }); - } - else { - this.onClosed_(); - } - } - else { - throw new Error('Unrecognized command received: ' + command); - } - }, (...args) => { - const [pN, data] = args; - this.incrementIncomingBytes_(args); - this.myPacketOrderer.handleResponse(pN, data); - }, () => { - this.onClosed_(); - }, this.urlFn); - //Send the initial request to connect. The serial number is simply to keep the browser from pulling previous results - //from cache. - const urlParams = {}; - urlParams[FIREBASE_LONGPOLL_START_PARAM] = 't'; - urlParams[FIREBASE_LONGPOLL_SERIAL_PARAM] = Math.floor(Math.random() * 100000000); - if (this.scriptTagHolder.uniqueCallbackIdentifier) { - urlParams[FIREBASE_LONGPOLL_CALLBACK_ID_PARAM] = - this.scriptTagHolder.uniqueCallbackIdentifier; - } - urlParams[VERSION_PARAM] = PROTOCOL_VERSION; - if (this.transportSessionId) { - urlParams[TRANSPORT_SESSION_PARAM] = this.transportSessionId; - } - if (this.lastSessionId) { - urlParams[LAST_SESSION_PARAM] = this.lastSessionId; - } - if (this.applicationId) { - urlParams[APPLICATION_ID_PARAM] = this.applicationId; - } - if (this.appCheckToken) { - urlParams[APP_CHECK_TOKEN_PARAM] = this.appCheckToken; - } - if (typeof location !== 'undefined' && - location.hostname && - FORGE_DOMAIN_RE.test(location.hostname)) { - urlParams[REFERER_PARAM] = FORGE_REF; - } - const connectURL = this.urlFn(urlParams); - this.log_('Connecting via long-poll to ' + connectURL); - this.scriptTagHolder.addTag(connectURL, () => { - /* do nothing */ - }); - }); - } - /** - * Call this when a handshake has completed successfully and we want to consider the connection established - */ - start() { - this.scriptTagHolder.startLongPoll(this.id, this.password); - this.addDisconnectPingFrame(this.id, this.password); - } - /** - * Forces long polling to be considered as a potential transport - */ - static forceAllow() { - BrowserPollConnection.forceAllow_ = true; - } - /** - * Forces longpolling to not be considered as a potential transport - */ - static forceDisallow() { - BrowserPollConnection.forceDisallow_ = true; - } - // Static method, use string literal so it can be accessed in a generic way - static isAvailable() { - if (isNodeSdk()) { - return false; - } - else if (BrowserPollConnection.forceAllow_) { - return true; - } - else { - // NOTE: In React-Native there's normally no 'document', but if you debug a React-Native app in - // the Chrome debugger, 'document' is defined, but document.createElement is null (2015/06/08). - return (!BrowserPollConnection.forceDisallow_ && - typeof document !== 'undefined' && - document.createElement != null && - !isChromeExtensionContentScript() && - !isWindowsStoreApp()); - } - } - /** - * No-op for polling - */ - markConnectionHealthy() { } - /** - * Stops polling and cleans up the iframe - */ - shutdown_() { - this.isClosed_ = true; - if (this.scriptTagHolder) { - this.scriptTagHolder.close(); - this.scriptTagHolder = null; - } - //remove the disconnect frame, which will trigger an XHR call to the server to tell it we're leaving. - if (this.myDisconnFrame) { - document.body.removeChild(this.myDisconnFrame); - this.myDisconnFrame = null; - } - if (this.connectTimeoutTimer_) { - clearTimeout(this.connectTimeoutTimer_); - this.connectTimeoutTimer_ = null; - } - } - /** - * Triggered when this transport is closed - */ - onClosed_() { - if (!this.isClosed_) { - this.log_('Longpoll is closing itself'); - this.shutdown_(); - if (this.onDisconnect_) { - this.onDisconnect_(this.everConnected_); - this.onDisconnect_ = null; - } - } - } - /** - * External-facing close handler. RealTime has requested we shut down. Kill our connection and tell the server - * that we've left. - */ - close() { - if (!this.isClosed_) { - this.log_('Longpoll is being closed.'); - this.shutdown_(); - } - } - /** - * Send the JSON object down to the server. It will need to be stringified, base64 encoded, and then - * broken into chunks (since URLs have a small maximum length). - * @param data - The JSON data to transmit. - */ - send(data) { - const dataStr = stringify(data); - this.bytesSent += dataStr.length; - this.stats_.incrementCounter('bytes_sent', dataStr.length); - //first, lets get the base64-encoded data - const base64data = base64Encode(dataStr); - //We can only fit a certain amount in each URL, so we need to split this request - //up into multiple pieces if it doesn't fit in one request. - const dataSegs = splitStringBySize(base64data, MAX_PAYLOAD_SIZE); - //Enqueue each segment for transmission. We assign each chunk a sequential ID and a total number - //of segments so that we can reassemble the packet on the server. - for (let i = 0; i < dataSegs.length; i++) { - this.scriptTagHolder.enqueueSegment(this.curSegmentNum, dataSegs.length, dataSegs[i]); - this.curSegmentNum++; - } - } - /** - * This is how we notify the server that we're leaving. - * We aren't able to send requests with DHTML on a window close event, but we can - * trigger XHR requests in some browsers (everything but Opera basically). - */ - addDisconnectPingFrame(id, pw) { - if (isNodeSdk()) { - return; - } - this.myDisconnFrame = document.createElement('iframe'); - const urlParams = {}; - urlParams[FIREBASE_LONGPOLL_DISCONN_FRAME_REQUEST_PARAM] = 't'; - urlParams[FIREBASE_LONGPOLL_ID_PARAM] = id; - urlParams[FIREBASE_LONGPOLL_PW_PARAM] = pw; - this.myDisconnFrame.src = this.urlFn(urlParams); - this.myDisconnFrame.style.display = 'none'; - document.body.appendChild(this.myDisconnFrame); - } - /** - * Used to track the bytes received by this client - */ - incrementIncomingBytes_(args) { - // TODO: This is an annoying perf hit just to track the number of incoming bytes. Maybe it should be opt-in. - const bytesReceived = stringify(args).length; - this.bytesReceived += bytesReceived; - this.stats_.incrementCounter('bytes_received', bytesReceived); - } -} -/********************************************************************************************* - * A wrapper around an iframe that is used as a long-polling script holder. - *********************************************************************************************/ -class FirebaseIFrameScriptHolder { - /** - * @param commandCB - The callback to be called when control commands are recevied from the server. - * @param onMessageCB - The callback to be triggered when responses arrive from the server. - * @param onDisconnect - The callback to be triggered when this tag holder is closed - * @param urlFn - A function that provides the URL of the endpoint to send data to. - */ - constructor(commandCB, onMessageCB, onDisconnect, urlFn) { - this.onDisconnect = onDisconnect; - this.urlFn = urlFn; - //We maintain a count of all of the outstanding requests, because if we have too many active at once it can cause - //problems in some browsers. - this.outstandingRequests = new Set(); - //A queue of the pending segments waiting for transmission to the server. - this.pendingSegs = []; - //A serial number. We use this for two things: - // 1) A way to ensure the browser doesn't cache responses to polls - // 2) A way to make the server aware when long-polls arrive in a different order than we started them. The - // server needs to release both polls in this case or it will cause problems in Opera since Opera can only execute - // JSONP code in the order it was added to the iframe. - this.currentSerial = Math.floor(Math.random() * 100000000); - // This gets set to false when we're "closing down" the connection (e.g. we're switching transports but there's still - // incoming data from the server that we're waiting for). - this.sendNewPolls = true; - if (!isNodeSdk()) { - //Each script holder registers a couple of uniquely named callbacks with the window. These are called from the - //iframes where we put the long-polling script tags. We have two callbacks: - // 1) Command Callback - Triggered for control issues, like starting a connection. - // 2) Message Callback - Triggered when new data arrives. - this.uniqueCallbackIdentifier = LUIDGenerator(); - window[FIREBASE_LONGPOLL_COMMAND_CB_NAME + this.uniqueCallbackIdentifier] = commandCB; - window[FIREBASE_LONGPOLL_DATA_CB_NAME + this.uniqueCallbackIdentifier] = - onMessageCB; - //Create an iframe for us to add script tags to. - this.myIFrame = FirebaseIFrameScriptHolder.createIFrame_(); - // Set the iframe's contents. - let script = ''; - // if we set a javascript url, it's IE and we need to set the document domain. The javascript url is sufficient - // for ie9, but ie8 needs to do it again in the document itself. - if (this.myIFrame.src && - this.myIFrame.src.substr(0, 'javascript:'.length) === 'javascript:') { - const currentDomain = document.domain; - script = ''; - } - const iframeContents = '' + script + ''; - try { - this.myIFrame.doc.open(); - this.myIFrame.doc.write(iframeContents); - this.myIFrame.doc.close(); - } - catch (e) { - log('frame writing exception'); - if (e.stack) { - log(e.stack); - } - log(e); - } - } - else { - this.commandCB = commandCB; - this.onMessageCB = onMessageCB; - } - } - /** - * Each browser has its own funny way to handle iframes. Here we mush them all together into one object that I can - * actually use. - */ - static createIFrame_() { - const iframe = document.createElement('iframe'); - iframe.style.display = 'none'; - // This is necessary in order to initialize the document inside the iframe - if (document.body) { - document.body.appendChild(iframe); - try { - // If document.domain has been modified in IE, this will throw an error, and we need to set the - // domain of the iframe's document manually. We can do this via a javascript: url as the src attribute - // Also note that we must do this *after* the iframe has been appended to the page. Otherwise it doesn't work. - const a = iframe.contentWindow.document; - if (!a) { - // Apologies for the log-spam, I need to do something to keep closure from optimizing out the assignment above. - log('No IE domain setting required'); - } - } - catch (e) { - const domain = document.domain; - iframe.src = - "javascript:void((function(){document.open();document.domain='" + - domain + - "';document.close();})())"; - } - } - else { - // LongPollConnection attempts to delay initialization until the document is ready, so hopefully this - // never gets hit. - throw 'Document body has not initialized. Wait to initialize Firebase until after the document is ready.'; - } - // Get the document of the iframe in a browser-specific way. - if (iframe.contentDocument) { - iframe.doc = iframe.contentDocument; // Firefox, Opera, Safari - } - else if (iframe.contentWindow) { - iframe.doc = iframe.contentWindow.document; // Internet Explorer - // eslint-disable-next-line @typescript-eslint/no-explicit-any - } - else if (iframe.document) { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - iframe.doc = iframe.document; //others? - } - return iframe; - } - /** - * Cancel all outstanding queries and remove the frame. - */ - close() { - //Mark this iframe as dead, so no new requests are sent. - this.alive = false; - if (this.myIFrame) { - //We have to actually remove all of the html inside this iframe before removing it from the - //window, or IE will continue loading and executing the script tags we've already added, which - //can lead to some errors being thrown. Setting innerHTML seems to be the easiest way to do this. - this.myIFrame.doc.body.innerHTML = ''; - setTimeout(() => { - if (this.myIFrame !== null) { - document.body.removeChild(this.myIFrame); - this.myIFrame = null; - } - }, Math.floor(0)); - } - // Protect from being called recursively. - const onDisconnect = this.onDisconnect; - if (onDisconnect) { - this.onDisconnect = null; - onDisconnect(); - } - } - /** - * Actually start the long-polling session by adding the first script tag(s) to the iframe. - * @param id - The ID of this connection - * @param pw - The password for this connection - */ - startLongPoll(id, pw) { - this.myID = id; - this.myPW = pw; - this.alive = true; - //send the initial request. If there are requests queued, make sure that we transmit as many as we are currently able to. - while (this.newRequest_()) { } - } - /** - * This is called any time someone might want a script tag to be added. It adds a script tag when there aren't - * too many outstanding requests and we are still alive. - * - * If there are outstanding packet segments to send, it sends one. If there aren't, it sends a long-poll anyways if - * needed. - */ - newRequest_() { - // We keep one outstanding request open all the time to receive data, but if we need to send data - // (pendingSegs.length > 0) then we create a new request to send the data. The server will automatically - // close the old request. - if (this.alive && - this.sendNewPolls && - this.outstandingRequests.size < (this.pendingSegs.length > 0 ? 2 : 1)) { - //construct our url - this.currentSerial++; - const urlParams = {}; - urlParams[FIREBASE_LONGPOLL_ID_PARAM] = this.myID; - urlParams[FIREBASE_LONGPOLL_PW_PARAM] = this.myPW; - urlParams[FIREBASE_LONGPOLL_SERIAL_PARAM] = this.currentSerial; - let theURL = this.urlFn(urlParams); - //Now add as much data as we can. - let curDataString = ''; - let i = 0; - while (this.pendingSegs.length > 0) { - //first, lets see if the next segment will fit. - const nextSeg = this.pendingSegs[0]; - if (nextSeg.d.length + - SEG_HEADER_SIZE + - curDataString.length <= - MAX_URL_DATA_SIZE) { - //great, the segment will fit. Lets append it. - const theSeg = this.pendingSegs.shift(); - curDataString = - curDataString + - '&' + - FIREBASE_LONGPOLL_SEGMENT_NUM_PARAM + - i + - '=' + - theSeg.seg + - '&' + - FIREBASE_LONGPOLL_SEGMENTS_IN_PACKET + - i + - '=' + - theSeg.ts + - '&' + - FIREBASE_LONGPOLL_DATA_PARAM + - i + - '=' + - theSeg.d; - i++; - } - else { - break; - } - } - theURL = theURL + curDataString; - this.addLongPollTag_(theURL, this.currentSerial); - return true; - } - else { - return false; - } - } - /** - * Queue a packet for transmission to the server. - * @param segnum - A sequential id for this packet segment used for reassembly - * @param totalsegs - The total number of segments in this packet - * @param data - The data for this segment. - */ - enqueueSegment(segnum, totalsegs, data) { - //add this to the queue of segments to send. - this.pendingSegs.push({ seg: segnum, ts: totalsegs, d: data }); - //send the data immediately if there isn't already data being transmitted, unless - //startLongPoll hasn't been called yet. - if (this.alive) { - this.newRequest_(); - } - } - /** - * Add a script tag for a regular long-poll request. - * @param url - The URL of the script tag. - * @param serial - The serial number of the request. - */ - addLongPollTag_(url, serial) { - //remember that we sent this request. - this.outstandingRequests.add(serial); - const doNewRequest = () => { - this.outstandingRequests.delete(serial); - this.newRequest_(); - }; - // If this request doesn't return on its own accord (by the server sending us some data), we'll - // create a new one after the KEEPALIVE interval to make sure we always keep a fresh request open. - const keepaliveTimeout = setTimeout(doNewRequest, Math.floor(KEEPALIVE_REQUEST_INTERVAL)); - const readyStateCB = () => { - // Request completed. Cancel the keepalive. - clearTimeout(keepaliveTimeout); - // Trigger a new request so we can continue receiving data. - doNewRequest(); - }; - this.addTag(url, readyStateCB); - } - /** - * Add an arbitrary script tag to the iframe. - * @param url - The URL for the script tag source. - * @param loadCB - A callback to be triggered once the script has loaded. - */ - addTag(url, loadCB) { - if (isNodeSdk()) { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - this.doNodeLongPoll(url, loadCB); - } - else { - setTimeout(() => { - try { - // if we're already closed, don't add this poll - if (!this.sendNewPolls) { - return; - } - const newScript = this.myIFrame.doc.createElement('script'); - newScript.type = 'text/javascript'; - newScript.async = true; - newScript.src = url; - // eslint-disable-next-line @typescript-eslint/no-explicit-any - newScript.onload = newScript.onreadystatechange = - function () { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - const rstate = newScript.readyState; - if (!rstate || rstate === 'loaded' || rstate === 'complete') { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - newScript.onload = newScript.onreadystatechange = null; - if (newScript.parentNode) { - newScript.parentNode.removeChild(newScript); - } - loadCB(); - } - }; - newScript.onerror = () => { - log('Long-poll script failed to load: ' + url); - this.sendNewPolls = false; - this.close(); - }; - this.myIFrame.doc.body.appendChild(newScript); - } - catch (e) { - // TODO: we should make this error visible somehow - } - }, Math.floor(1)); - } - } -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Currently simplistic, this class manages what transport a Connection should use at various stages of its - * lifecycle. - * - * It starts with longpolling in a browser, and httppolling on node. It then upgrades to websockets if - * they are available. - */ -class TransportManager { - /** - * @param repoInfo - Metadata around the namespace we're connecting to - */ - constructor(repoInfo) { - this.initTransports_(repoInfo); - } - static get ALL_TRANSPORTS() { - return [BrowserPollConnection, WebSocketConnection]; - } - /** - * Returns whether transport has been selected to ensure WebSocketConnection or BrowserPollConnection are not called after - * TransportManager has already set up transports_ - */ - static get IS_TRANSPORT_INITIALIZED() { - return this.globalTransportInitialized_; - } - initTransports_(repoInfo) { - const isWebSocketsAvailable = WebSocketConnection && WebSocketConnection['isAvailable'](); - let isSkipPollConnection = isWebSocketsAvailable && !WebSocketConnection.previouslyFailed(); - if (repoInfo.webSocketOnly) { - if (!isWebSocketsAvailable) { - warn("wss:// URL used, but browser isn't known to support websockets. Trying anyway."); - } - isSkipPollConnection = true; - } - if (isSkipPollConnection) { - this.transports_ = [WebSocketConnection]; - } - else { - const transports = (this.transports_ = []); - for (const transport of TransportManager.ALL_TRANSPORTS) { - if (transport && transport['isAvailable']()) { - transports.push(transport); - } - } - TransportManager.globalTransportInitialized_ = true; - } - } - /** - * @returns The constructor for the initial transport to use - */ - initialTransport() { - if (this.transports_.length > 0) { - return this.transports_[0]; - } - else { - throw new Error('No transports available'); - } - } - /** - * @returns The constructor for the next transport, or null - */ - upgradeTransport() { - if (this.transports_.length > 1) { - return this.transports_[1]; - } - else { - return null; - } - } -} -// Keeps track of whether the TransportManager has already chosen a transport to use -TransportManager.globalTransportInitialized_ = false; - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Abort upgrade attempt if it takes longer than 60s. -const UPGRADE_TIMEOUT = 60000; -// For some transports (WebSockets), we need to "validate" the transport by exchanging a few requests and responses. -// If we haven't sent enough requests within 5s, we'll start sending noop ping requests. -const DELAY_BEFORE_SENDING_EXTRA_REQUESTS = 5000; -// If the initial data sent triggers a lot of bandwidth (i.e. it's a large put or a listen for a large amount of data) -// then we may not be able to exchange our ping/pong requests within the healthy timeout. So if we reach the timeout -// but we've sent/received enough bytes, we don't cancel the connection. -const BYTES_SENT_HEALTHY_OVERRIDE = 10 * 1024; -const BYTES_RECEIVED_HEALTHY_OVERRIDE = 100 * 1024; -const MESSAGE_TYPE = 't'; -const MESSAGE_DATA = 'd'; -const CONTROL_SHUTDOWN = 's'; -const CONTROL_RESET = 'r'; -const CONTROL_ERROR = 'e'; -const CONTROL_PONG = 'o'; -const SWITCH_ACK = 'a'; -const END_TRANSMISSION = 'n'; -const PING = 'p'; -const SERVER_HELLO = 'h'; -/** - * Creates a new real-time connection to the server using whichever method works - * best in the current browser. - */ -class Connection { - /** - * @param id - an id for this connection - * @param repoInfo_ - the info for the endpoint to connect to - * @param applicationId_ - the Firebase App ID for this project - * @param appCheckToken_ - The App Check Token for this device. - * @param authToken_ - The auth token for this session. - * @param onMessage_ - the callback to be triggered when a server-push message arrives - * @param onReady_ - the callback to be triggered when this connection is ready to send messages. - * @param onDisconnect_ - the callback to be triggered when a connection was lost - * @param onKill_ - the callback to be triggered when this connection has permanently shut down. - * @param lastSessionId - last session id in persistent connection. is used to clean up old session in real-time server - */ - constructor(id, repoInfo_, applicationId_, appCheckToken_, authToken_, onMessage_, onReady_, onDisconnect_, onKill_, lastSessionId) { - this.id = id; - this.repoInfo_ = repoInfo_; - this.applicationId_ = applicationId_; - this.appCheckToken_ = appCheckToken_; - this.authToken_ = authToken_; - this.onMessage_ = onMessage_; - this.onReady_ = onReady_; - this.onDisconnect_ = onDisconnect_; - this.onKill_ = onKill_; - this.lastSessionId = lastSessionId; - this.connectionCount = 0; - this.pendingDataMessages = []; - this.state_ = 0 /* CONNECTING */; - this.log_ = logWrapper('c:' + this.id + ':'); - this.transportManager_ = new TransportManager(repoInfo_); - this.log_('Connection created'); - this.start_(); - } - /** - * Starts a connection attempt - */ - start_() { - const conn = this.transportManager_.initialTransport(); - this.conn_ = new conn(this.nextTransportId_(), this.repoInfo_, this.applicationId_, this.appCheckToken_, this.authToken_, null, this.lastSessionId); - // For certain transports (WebSockets), we need to send and receive several messages back and forth before we - // can consider the transport healthy. - this.primaryResponsesRequired_ = conn['responsesRequiredToBeHealthy'] || 0; - const onMessageReceived = this.connReceiver_(this.conn_); - const onConnectionLost = this.disconnReceiver_(this.conn_); - this.tx_ = this.conn_; - this.rx_ = this.conn_; - this.secondaryConn_ = null; - this.isHealthy_ = false; - /* - * Firefox doesn't like when code from one iframe tries to create another iframe by way of the parent frame. - * This can occur in the case of a redirect, i.e. we guessed wrong on what server to connect to and received a reset. - * Somehow, setTimeout seems to make this ok. That doesn't make sense from a security perspective, since you should - * still have the context of your originating frame. - */ - setTimeout(() => { - // this.conn_ gets set to null in some of the tests. Check to make sure it still exists before using it - this.conn_ && this.conn_.open(onMessageReceived, onConnectionLost); - }, Math.floor(0)); - const healthyTimeoutMS = conn['healthyTimeout'] || 0; - if (healthyTimeoutMS > 0) { - this.healthyTimeout_ = setTimeoutNonBlocking(() => { - this.healthyTimeout_ = null; - if (!this.isHealthy_) { - if (this.conn_ && - this.conn_.bytesReceived > BYTES_RECEIVED_HEALTHY_OVERRIDE) { - this.log_('Connection exceeded healthy timeout but has received ' + - this.conn_.bytesReceived + - ' bytes. Marking connection healthy.'); - this.isHealthy_ = true; - this.conn_.markConnectionHealthy(); - } - else if (this.conn_ && - this.conn_.bytesSent > BYTES_SENT_HEALTHY_OVERRIDE) { - this.log_('Connection exceeded healthy timeout but has sent ' + - this.conn_.bytesSent + - ' bytes. Leaving connection alive.'); - // NOTE: We don't want to mark it healthy, since we have no guarantee that the bytes have made it to - // the server. - } - else { - this.log_('Closing unhealthy connection after timeout.'); - this.close(); - } - } - // eslint-disable-next-line @typescript-eslint/no-explicit-any - }, Math.floor(healthyTimeoutMS)); - } - } - nextTransportId_() { - return 'c:' + this.id + ':' + this.connectionCount++; - } - disconnReceiver_(conn) { - return everConnected => { - if (conn === this.conn_) { - this.onConnectionLost_(everConnected); - } - else if (conn === this.secondaryConn_) { - this.log_('Secondary connection lost.'); - this.onSecondaryConnectionLost_(); - } - else { - this.log_('closing an old connection'); - } - }; - } - connReceiver_(conn) { - return (message) => { - if (this.state_ !== 2 /* DISCONNECTED */) { - if (conn === this.rx_) { - this.onPrimaryMessageReceived_(message); - } - else if (conn === this.secondaryConn_) { - this.onSecondaryMessageReceived_(message); - } - else { - this.log_('message on old connection'); - } - } - }; - } - /** - * @param dataMsg - An arbitrary data message to be sent to the server - */ - sendRequest(dataMsg) { - // wrap in a data message envelope and send it on - const msg = { t: 'd', d: dataMsg }; - this.sendData_(msg); - } - tryCleanupConnection() { - if (this.tx_ === this.secondaryConn_ && this.rx_ === this.secondaryConn_) { - this.log_('cleaning up and promoting a connection: ' + this.secondaryConn_.connId); - this.conn_ = this.secondaryConn_; - this.secondaryConn_ = null; - // the server will shutdown the old connection - } - } - onSecondaryControl_(controlData) { - if (MESSAGE_TYPE in controlData) { - const cmd = controlData[MESSAGE_TYPE]; - if (cmd === SWITCH_ACK) { - this.upgradeIfSecondaryHealthy_(); - } - else if (cmd === CONTROL_RESET) { - // Most likely the session wasn't valid. Abandon the switch attempt - this.log_('Got a reset on secondary, closing it'); - this.secondaryConn_.close(); - // If we were already using this connection for something, than we need to fully close - if (this.tx_ === this.secondaryConn_ || - this.rx_ === this.secondaryConn_) { - this.close(); - } - } - else if (cmd === CONTROL_PONG) { - this.log_('got pong on secondary.'); - this.secondaryResponsesRequired_--; - this.upgradeIfSecondaryHealthy_(); - } - } - } - onSecondaryMessageReceived_(parsedData) { - const layer = requireKey('t', parsedData); - const data = requireKey('d', parsedData); - if (layer === 'c') { - this.onSecondaryControl_(data); - } - else if (layer === 'd') { - // got a data message, but we're still second connection. Need to buffer it up - this.pendingDataMessages.push(data); - } - else { - throw new Error('Unknown protocol layer: ' + layer); - } - } - upgradeIfSecondaryHealthy_() { - if (this.secondaryResponsesRequired_ <= 0) { - this.log_('Secondary connection is healthy.'); - this.isHealthy_ = true; - this.secondaryConn_.markConnectionHealthy(); - this.proceedWithUpgrade_(); - } - else { - // Send a ping to make sure the connection is healthy. - this.log_('sending ping on secondary.'); - this.secondaryConn_.send({ t: 'c', d: { t: PING, d: {} } }); - } - } - proceedWithUpgrade_() { - // tell this connection to consider itself open - this.secondaryConn_.start(); - // send ack - this.log_('sending client ack on secondary'); - this.secondaryConn_.send({ t: 'c', d: { t: SWITCH_ACK, d: {} } }); - // send end packet on primary transport, switch to sending on this one - // can receive on this one, buffer responses until end received on primary transport - this.log_('Ending transmission on primary'); - this.conn_.send({ t: 'c', d: { t: END_TRANSMISSION, d: {} } }); - this.tx_ = this.secondaryConn_; - this.tryCleanupConnection(); - } - onPrimaryMessageReceived_(parsedData) { - // Must refer to parsedData properties in quotes, so closure doesn't touch them. - const layer = requireKey('t', parsedData); - const data = requireKey('d', parsedData); - if (layer === 'c') { - this.onControl_(data); - } - else if (layer === 'd') { - this.onDataMessage_(data); - } - } - onDataMessage_(message) { - this.onPrimaryResponse_(); - // We don't do anything with data messages, just kick them up a level - this.onMessage_(message); - } - onPrimaryResponse_() { - if (!this.isHealthy_) { - this.primaryResponsesRequired_--; - if (this.primaryResponsesRequired_ <= 0) { - this.log_('Primary connection is healthy.'); - this.isHealthy_ = true; - this.conn_.markConnectionHealthy(); - } - } - } - onControl_(controlData) { - const cmd = requireKey(MESSAGE_TYPE, controlData); - if (MESSAGE_DATA in controlData) { - const payload = controlData[MESSAGE_DATA]; - if (cmd === SERVER_HELLO) { - this.onHandshake_(payload); - } - else if (cmd === END_TRANSMISSION) { - this.log_('recvd end transmission on primary'); - this.rx_ = this.secondaryConn_; - for (let i = 0; i < this.pendingDataMessages.length; ++i) { - this.onDataMessage_(this.pendingDataMessages[i]); - } - this.pendingDataMessages = []; - this.tryCleanupConnection(); - } - else if (cmd === CONTROL_SHUTDOWN) { - // This was previously the 'onKill' callback passed to the lower-level connection - // payload in this case is the reason for the shutdown. Generally a human-readable error - this.onConnectionShutdown_(payload); - } - else if (cmd === CONTROL_RESET) { - // payload in this case is the host we should contact - this.onReset_(payload); - } - else if (cmd === CONTROL_ERROR) { - error('Server Error: ' + payload); - } - else if (cmd === CONTROL_PONG) { - this.log_('got pong on primary.'); - this.onPrimaryResponse_(); - this.sendPingOnPrimaryIfNecessary_(); - } - else { - error('Unknown control packet command: ' + cmd); - } - } - } - /** - * @param handshake - The handshake data returned from the server - */ - onHandshake_(handshake) { - const timestamp = handshake.ts; - const version = handshake.v; - const host = handshake.h; - this.sessionId = handshake.s; - this.repoInfo_.host = host; - // if we've already closed the connection, then don't bother trying to progress further - if (this.state_ === 0 /* CONNECTING */) { - this.conn_.start(); - this.onConnectionEstablished_(this.conn_, timestamp); - if (PROTOCOL_VERSION !== version) { - warn('Protocol version mismatch detected'); - } - // TODO: do we want to upgrade? when? maybe a delay? - this.tryStartUpgrade_(); - } - } - tryStartUpgrade_() { - const conn = this.transportManager_.upgradeTransport(); - if (conn) { - this.startUpgrade_(conn); - } - } - startUpgrade_(conn) { - this.secondaryConn_ = new conn(this.nextTransportId_(), this.repoInfo_, this.applicationId_, this.appCheckToken_, this.authToken_, this.sessionId); - // For certain transports (WebSockets), we need to send and receive several messages back and forth before we - // can consider the transport healthy. - this.secondaryResponsesRequired_ = - conn['responsesRequiredToBeHealthy'] || 0; - const onMessage = this.connReceiver_(this.secondaryConn_); - const onDisconnect = this.disconnReceiver_(this.secondaryConn_); - this.secondaryConn_.open(onMessage, onDisconnect); - // If we haven't successfully upgraded after UPGRADE_TIMEOUT, give up and kill the secondary. - setTimeoutNonBlocking(() => { - if (this.secondaryConn_) { - this.log_('Timed out trying to upgrade.'); - this.secondaryConn_.close(); - } - }, Math.floor(UPGRADE_TIMEOUT)); - } - onReset_(host) { - this.log_('Reset packet received. New host: ' + host); - this.repoInfo_.host = host; - // TODO: if we're already "connected", we need to trigger a disconnect at the next layer up. - // We don't currently support resets after the connection has already been established - if (this.state_ === 1 /* CONNECTED */) { - this.close(); - } - else { - // Close whatever connections we have open and start again. - this.closeConnections_(); - this.start_(); - } - } - onConnectionEstablished_(conn, timestamp) { - this.log_('Realtime connection established.'); - this.conn_ = conn; - this.state_ = 1 /* CONNECTED */; - if (this.onReady_) { - this.onReady_(timestamp, this.sessionId); - this.onReady_ = null; - } - // If after 5 seconds we haven't sent enough requests to the server to get the connection healthy, - // send some pings. - if (this.primaryResponsesRequired_ === 0) { - this.log_('Primary connection is healthy.'); - this.isHealthy_ = true; - } - else { - setTimeoutNonBlocking(() => { - this.sendPingOnPrimaryIfNecessary_(); - }, Math.floor(DELAY_BEFORE_SENDING_EXTRA_REQUESTS)); - } - } - sendPingOnPrimaryIfNecessary_() { - // If the connection isn't considered healthy yet, we'll send a noop ping packet request. - if (!this.isHealthy_ && this.state_ === 1 /* CONNECTED */) { - this.log_('sending ping on primary.'); - this.sendData_({ t: 'c', d: { t: PING, d: {} } }); - } - } - onSecondaryConnectionLost_() { - const conn = this.secondaryConn_; - this.secondaryConn_ = null; - if (this.tx_ === conn || this.rx_ === conn) { - // we are relying on this connection already in some capacity. Therefore, a failure is real - this.close(); - } - } - /** - * @param everConnected - Whether or not the connection ever reached a server. Used to determine if - * we should flush the host cache - */ - onConnectionLost_(everConnected) { - this.conn_ = null; - // NOTE: IF you're seeing a Firefox error for this line, I think it might be because it's getting - // called on window close and RealtimeState.CONNECTING is no longer defined. Just a guess. - if (!everConnected && this.state_ === 0 /* CONNECTING */) { - this.log_('Realtime connection failed.'); - // Since we failed to connect at all, clear any cached entry for this namespace in case the machine went away - if (this.repoInfo_.isCacheableHost()) { - PersistentStorage.remove('host:' + this.repoInfo_.host); - // reset the internal host to what we would show the user, i.e. .firebaseio.com - this.repoInfo_.internalHost = this.repoInfo_.host; - } - } - else if (this.state_ === 1 /* CONNECTED */) { - this.log_('Realtime connection lost.'); - } - this.close(); - } - onConnectionShutdown_(reason) { - this.log_('Connection shutdown command received. Shutting down...'); - if (this.onKill_) { - this.onKill_(reason); - this.onKill_ = null; - } - // We intentionally don't want to fire onDisconnect (kill is a different case), - // so clear the callback. - this.onDisconnect_ = null; - this.close(); - } - sendData_(data) { - if (this.state_ !== 1 /* CONNECTED */) { - throw 'Connection is not connected'; - } - else { - this.tx_.send(data); - } - } - /** - * Cleans up this connection, calling the appropriate callbacks - */ - close() { - if (this.state_ !== 2 /* DISCONNECTED */) { - this.log_('Closing realtime connection.'); - this.state_ = 2 /* DISCONNECTED */; - this.closeConnections_(); - if (this.onDisconnect_) { - this.onDisconnect_(); - this.onDisconnect_ = null; - } - } - } - closeConnections_() { - this.log_('Shutting down all connections'); - if (this.conn_) { - this.conn_.close(); - this.conn_ = null; - } - if (this.secondaryConn_) { - this.secondaryConn_.close(); - this.secondaryConn_ = null; - } - if (this.healthyTimeout_) { - clearTimeout(this.healthyTimeout_); - this.healthyTimeout_ = null; - } - } -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Interface defining the set of actions that can be performed against the Firebase server - * (basically corresponds to our wire protocol). - * - * @interface - */ -class ServerActions { - put(pathString, data, onComplete, hash) { } - merge(pathString, data, onComplete, hash) { } - /** - * Refreshes the auth token for the current connection. - * @param token - The authentication token - */ - refreshAuthToken(token) { } - /** - * Refreshes the app check token for the current connection. - * @param token The app check token - */ - refreshAppCheckToken(token) { } - onDisconnectPut(pathString, data, onComplete) { } - onDisconnectMerge(pathString, data, onComplete) { } - onDisconnectCancel(pathString, onComplete) { } - reportStats(stats) { } -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Base class to be used if you want to emit events. Call the constructor with - * the set of allowed event names. - */ -class EventEmitter { - constructor(allowedEvents_) { - this.allowedEvents_ = allowedEvents_; - this.listeners_ = {}; - assert(Array.isArray(allowedEvents_) && allowedEvents_.length > 0, 'Requires a non-empty array'); - } - /** - * To be called by derived classes to trigger events. - */ - trigger(eventType, ...varArgs) { - if (Array.isArray(this.listeners_[eventType])) { - // Clone the list, since callbacks could add/remove listeners. - const listeners = [...this.listeners_[eventType]]; - for (let i = 0; i < listeners.length; i++) { - listeners[i].callback.apply(listeners[i].context, varArgs); - } - } - } - on(eventType, callback, context) { - this.validateEventType_(eventType); - this.listeners_[eventType] = this.listeners_[eventType] || []; - this.listeners_[eventType].push({ callback, context }); - const eventData = this.getInitialEvent(eventType); - if (eventData) { - callback.apply(context, eventData); - } - } - off(eventType, callback, context) { - this.validateEventType_(eventType); - const listeners = this.listeners_[eventType] || []; - for (let i = 0; i < listeners.length; i++) { - if (listeners[i].callback === callback && - (!context || context === listeners[i].context)) { - listeners.splice(i, 1); - return; - } - } - } - validateEventType_(eventType) { - assert(this.allowedEvents_.find(et => { - return et === eventType; - }), 'Unknown event: ' + eventType); - } -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Monitors online state (as reported by window.online/offline events). - * - * The expectation is that this could have many false positives (thinks we are online - * when we're not), but no false negatives. So we can safely use it to determine when - * we definitely cannot reach the internet. - */ -class OnlineMonitor extends EventEmitter { - constructor() { - super(['online']); - this.online_ = true; - // We've had repeated complaints that Cordova apps can get stuck "offline", e.g. - // https://forum.ionicframework.com/t/firebase-connection-is-lost-and-never-come-back/43810 - // It would seem that the 'online' event does not always fire consistently. So we disable it - // for Cordova. - if (typeof window !== 'undefined' && - typeof window.addEventListener !== 'undefined' && - !isMobileCordova()) { - window.addEventListener('online', () => { - if (!this.online_) { - this.online_ = true; - this.trigger('online', true); - } - }, false); - window.addEventListener('offline', () => { - if (this.online_) { - this.online_ = false; - this.trigger('online', false); - } - }, false); - } - } - static getInstance() { - return new OnlineMonitor(); - } - getInitialEvent(eventType) { - assert(eventType === 'online', 'Unknown event type: ' + eventType); - return [this.online_]; - } - currentlyOnline() { - return this.online_; - } -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** Maximum key depth. */ -const MAX_PATH_DEPTH = 32; -/** Maximum number of (UTF8) bytes in a Firebase path. */ -const MAX_PATH_LENGTH_BYTES = 768; -/** - * An immutable object representing a parsed path. It's immutable so that you - * can pass them around to other functions without worrying about them changing - * it. - */ -class Path { - /** - * @param pathOrString - Path string to parse, or another path, or the raw - * tokens array - */ - constructor(pathOrString, pieceNum) { - if (pieceNum === void 0) { - this.pieces_ = pathOrString.split('/'); - // Remove empty pieces. - let copyTo = 0; - for (let i = 0; i < this.pieces_.length; i++) { - if (this.pieces_[i].length > 0) { - this.pieces_[copyTo] = this.pieces_[i]; - copyTo++; - } - } - this.pieces_.length = copyTo; - this.pieceNum_ = 0; - } - else { - this.pieces_ = pathOrString; - this.pieceNum_ = pieceNum; - } - } - toString() { - let pathString = ''; - for (let i = this.pieceNum_; i < this.pieces_.length; i++) { - if (this.pieces_[i] !== '') { - pathString += '/' + this.pieces_[i]; - } - } - return pathString || '/'; - } -} -function newEmptyPath() { - return new Path(''); -} -function pathGetFront(path) { - if (path.pieceNum_ >= path.pieces_.length) { - return null; - } - return path.pieces_[path.pieceNum_]; -} -/** - * @returns The number of segments in this path - */ -function pathGetLength(path) { - return path.pieces_.length - path.pieceNum_; -} -function pathPopFront(path) { - let pieceNum = path.pieceNum_; - if (pieceNum < path.pieces_.length) { - pieceNum++; - } - return new Path(path.pieces_, pieceNum); -} -function pathGetBack(path) { - if (path.pieceNum_ < path.pieces_.length) { - return path.pieces_[path.pieces_.length - 1]; - } - return null; -} -function pathToUrlEncodedString(path) { - let pathString = ''; - for (let i = path.pieceNum_; i < path.pieces_.length; i++) { - if (path.pieces_[i] !== '') { - pathString += '/' + encodeURIComponent(String(path.pieces_[i])); - } - } - return pathString || '/'; -} -/** - * Shallow copy of the parts of the path. - * - */ -function pathSlice(path, begin = 0) { - return path.pieces_.slice(path.pieceNum_ + begin); -} -function pathParent(path) { - if (path.pieceNum_ >= path.pieces_.length) { - return null; - } - const pieces = []; - for (let i = path.pieceNum_; i < path.pieces_.length - 1; i++) { - pieces.push(path.pieces_[i]); - } - return new Path(pieces, 0); -} -function pathChild(path, childPathObj) { - const pieces = []; - for (let i = path.pieceNum_; i < path.pieces_.length; i++) { - pieces.push(path.pieces_[i]); - } - if (childPathObj instanceof Path) { - for (let i = childPathObj.pieceNum_; i < childPathObj.pieces_.length; i++) { - pieces.push(childPathObj.pieces_[i]); - } - } - else { - const childPieces = childPathObj.split('/'); - for (let i = 0; i < childPieces.length; i++) { - if (childPieces[i].length > 0) { - pieces.push(childPieces[i]); - } - } - } - return new Path(pieces, 0); -} -/** - * @returns True if there are no segments in this path - */ -function pathIsEmpty(path) { - return path.pieceNum_ >= path.pieces_.length; -} -/** - * @returns The path from outerPath to innerPath - */ -function newRelativePath(outerPath, innerPath) { - const outer = pathGetFront(outerPath), inner = pathGetFront(innerPath); - if (outer === null) { - return innerPath; - } - else if (outer === inner) { - return newRelativePath(pathPopFront(outerPath), pathPopFront(innerPath)); - } - else { - throw new Error('INTERNAL ERROR: innerPath (' + - innerPath + - ') is not within ' + - 'outerPath (' + - outerPath + - ')'); - } -} -/** - * @returns -1, 0, 1 if left is less, equal, or greater than the right. - */ -function pathCompare(left, right) { - const leftKeys = pathSlice(left, 0); - const rightKeys = pathSlice(right, 0); - for (let i = 0; i < leftKeys.length && i < rightKeys.length; i++) { - const cmp = nameCompare(leftKeys[i], rightKeys[i]); - if (cmp !== 0) { - return cmp; - } - } - if (leftKeys.length === rightKeys.length) { - return 0; - } - return leftKeys.length < rightKeys.length ? -1 : 1; -} -/** - * @returns true if paths are the same. - */ -function pathEquals(path, other) { - if (pathGetLength(path) !== pathGetLength(other)) { - return false; - } - for (let i = path.pieceNum_, j = other.pieceNum_; i <= path.pieces_.length; i++, j++) { - if (path.pieces_[i] !== other.pieces_[j]) { - return false; - } - } - return true; -} -/** - * @returns True if this path is a parent of (or the same as) other - */ -function pathContains(path, other) { - let i = path.pieceNum_; - let j = other.pieceNum_; - if (pathGetLength(path) > pathGetLength(other)) { - return false; - } - while (i < path.pieces_.length) { - if (path.pieces_[i] !== other.pieces_[j]) { - return false; - } - ++i; - ++j; - } - return true; -} -/** - * Dynamic (mutable) path used to count path lengths. - * - * This class is used to efficiently check paths for valid - * length (in UTF8 bytes) and depth (used in path validation). - * - * Throws Error exception if path is ever invalid. - * - * The definition of a path always begins with '/'. - */ -class ValidationPath { - /** - * @param path - Initial Path. - * @param errorPrefix_ - Prefix for any error messages. - */ - constructor(path, errorPrefix_) { - this.errorPrefix_ = errorPrefix_; - this.parts_ = pathSlice(path, 0); - /** Initialize to number of '/' chars needed in path. */ - this.byteLength_ = Math.max(1, this.parts_.length); - for (let i = 0; i < this.parts_.length; i++) { - this.byteLength_ += stringLength(this.parts_[i]); - } - validationPathCheckValid(this); - } -} -function validationPathPush(validationPath, child) { - // Count the needed '/' - if (validationPath.parts_.length > 0) { - validationPath.byteLength_ += 1; - } - validationPath.parts_.push(child); - validationPath.byteLength_ += stringLength(child); - validationPathCheckValid(validationPath); -} -function validationPathPop(validationPath) { - const last = validationPath.parts_.pop(); - validationPath.byteLength_ -= stringLength(last); - // Un-count the previous '/' - if (validationPath.parts_.length > 0) { - validationPath.byteLength_ -= 1; - } -} -function validationPathCheckValid(validationPath) { - if (validationPath.byteLength_ > MAX_PATH_LENGTH_BYTES) { - throw new Error(validationPath.errorPrefix_ + - 'has a key path longer than ' + - MAX_PATH_LENGTH_BYTES + - ' bytes (' + - validationPath.byteLength_ + - ').'); - } - if (validationPath.parts_.length > MAX_PATH_DEPTH) { - throw new Error(validationPath.errorPrefix_ + - 'path specified exceeds the maximum depth that can be written (' + - MAX_PATH_DEPTH + - ') or object contains a cycle ' + - validationPathToErrorString(validationPath)); - } -} -/** - * String for use in error messages - uses '.' notation for path. - */ -function validationPathToErrorString(validationPath) { - if (validationPath.parts_.length === 0) { - return ''; - } - return "in property '" + validationPath.parts_.join('.') + "'"; -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -class VisibilityMonitor extends EventEmitter { - constructor() { - super(['visible']); - let hidden; - let visibilityChange; - if (typeof document !== 'undefined' && - typeof document.addEventListener !== 'undefined') { - if (typeof document['hidden'] !== 'undefined') { - // Opera 12.10 and Firefox 18 and later support - visibilityChange = 'visibilitychange'; - hidden = 'hidden'; - } - else if (typeof document['mozHidden'] !== 'undefined') { - visibilityChange = 'mozvisibilitychange'; - hidden = 'mozHidden'; - } - else if (typeof document['msHidden'] !== 'undefined') { - visibilityChange = 'msvisibilitychange'; - hidden = 'msHidden'; - } - else if (typeof document['webkitHidden'] !== 'undefined') { - visibilityChange = 'webkitvisibilitychange'; - hidden = 'webkitHidden'; - } - } - // Initially, we always assume we are visible. This ensures that in browsers - // without page visibility support or in cases where we are never visible - // (e.g. chrome extension), we act as if we are visible, i.e. don't delay - // reconnects - this.visible_ = true; - if (visibilityChange) { - document.addEventListener(visibilityChange, () => { - const visible = !document[hidden]; - if (visible !== this.visible_) { - this.visible_ = visible; - this.trigger('visible', visible); - } - }, false); - } - } - static getInstance() { - return new VisibilityMonitor(); - } - getInitialEvent(eventType) { - assert(eventType === 'visible', 'Unknown event type: ' + eventType); - return [this.visible_]; - } -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -const RECONNECT_MIN_DELAY = 1000; -const RECONNECT_MAX_DELAY_DEFAULT = 60 * 5 * 1000; // 5 minutes in milliseconds (Case: 1858) -const RECONNECT_MAX_DELAY_FOR_ADMINS = 30 * 1000; // 30 seconds for admin clients (likely to be a backend server) -const RECONNECT_DELAY_MULTIPLIER = 1.3; -const RECONNECT_DELAY_RESET_TIMEOUT = 30000; // Reset delay back to MIN_DELAY after being connected for 30sec. -const SERVER_KILL_INTERRUPT_REASON = 'server_kill'; -// If auth fails repeatedly, we'll assume something is wrong and log a warning / back off. -const INVALID_TOKEN_THRESHOLD = 3; -/** - * Firebase connection. Abstracts wire protocol and handles reconnecting. - * - * NOTE: All JSON objects sent to the realtime connection must have property names enclosed - * in quotes to make sure the closure compiler does not minify them. - */ -class PersistentConnection extends ServerActions { - /** - * @param repoInfo_ - Data about the namespace we are connecting to - * @param applicationId_ - The Firebase App ID for this project - * @param onDataUpdate_ - A callback for new data from the server - */ - constructor(repoInfo_, applicationId_, onDataUpdate_, onConnectStatus_, onServerInfoUpdate_, authTokenProvider_, appCheckTokenProvider_, authOverride_) { - super(); - this.repoInfo_ = repoInfo_; - this.applicationId_ = applicationId_; - this.onDataUpdate_ = onDataUpdate_; - this.onConnectStatus_ = onConnectStatus_; - this.onServerInfoUpdate_ = onServerInfoUpdate_; - this.authTokenProvider_ = authTokenProvider_; - this.appCheckTokenProvider_ = appCheckTokenProvider_; - this.authOverride_ = authOverride_; - // Used for diagnostic logging. - this.id = PersistentConnection.nextPersistentConnectionId_++; - this.log_ = logWrapper('p:' + this.id + ':'); - this.interruptReasons_ = {}; - this.listens = new Map(); - this.outstandingPuts_ = []; - this.outstandingGets_ = []; - this.outstandingPutCount_ = 0; - this.outstandingGetCount_ = 0; - this.onDisconnectRequestQueue_ = []; - this.connected_ = false; - this.reconnectDelay_ = RECONNECT_MIN_DELAY; - this.maxReconnectDelay_ = RECONNECT_MAX_DELAY_DEFAULT; - this.securityDebugCallback_ = null; - this.lastSessionId = null; - this.establishConnectionTimer_ = null; - this.visible_ = false; - // Before we get connected, we keep a queue of pending messages to send. - this.requestCBHash_ = {}; - this.requestNumber_ = 0; - this.realtime_ = null; - this.authToken_ = null; - this.appCheckToken_ = null; - this.forceTokenRefresh_ = false; - this.invalidAuthTokenCount_ = 0; - this.invalidAppCheckTokenCount_ = 0; - this.firstConnection_ = true; - this.lastConnectionAttemptTime_ = null; - this.lastConnectionEstablishedTime_ = null; - if (authOverride_ && !isNodeSdk()) { - throw new Error('Auth override specified in options, but not supported on non Node.js platforms'); - } - VisibilityMonitor.getInstance().on('visible', this.onVisible_, this); - if (repoInfo_.host.indexOf('fblocal') === -1) { - OnlineMonitor.getInstance().on('online', this.onOnline_, this); - } - } - sendRequest(action, body, onResponse) { - const curReqNum = ++this.requestNumber_; - const msg = { r: curReqNum, a: action, b: body }; - this.log_(stringify(msg)); - assert(this.connected_, "sendRequest call when we're not connected not allowed."); - this.realtime_.sendRequest(msg); - if (onResponse) { - this.requestCBHash_[curReqNum] = onResponse; - } - } - get(query) { - this.initConnection_(); - const deferred = new Deferred(); - const request = { - p: query._path.toString(), - q: query._queryObject - }; - const outstandingGet = { - action: 'g', - request, - onComplete: (message) => { - const payload = message['d']; - if (message['s'] === 'ok') { - deferred.resolve(payload); - } - else { - deferred.reject(payload); - } - } - }; - this.outstandingGets_.push(outstandingGet); - this.outstandingGetCount_++; - const index = this.outstandingGets_.length - 1; - if (this.connected_) { - this.sendGet_(index); - } - return deferred.promise; - } - listen(query, currentHashFn, tag, onComplete) { - this.initConnection_(); - const queryId = query._queryIdentifier; - const pathString = query._path.toString(); - this.log_('Listen called for ' + pathString + ' ' + queryId); - if (!this.listens.has(pathString)) { - this.listens.set(pathString, new Map()); - } - assert(query._queryParams.isDefault() || !query._queryParams.loadsAllData(), 'listen() called for non-default but complete query'); - assert(!this.listens.get(pathString).has(queryId), `listen() called twice for same path/queryId.`); - const listenSpec = { - onComplete, - hashFn: currentHashFn, - query, - tag - }; - this.listens.get(pathString).set(queryId, listenSpec); - if (this.connected_) { - this.sendListen_(listenSpec); - } - } - sendGet_(index) { - const get = this.outstandingGets_[index]; - this.sendRequest('g', get.request, (message) => { - delete this.outstandingGets_[index]; - this.outstandingGetCount_--; - if (this.outstandingGetCount_ === 0) { - this.outstandingGets_ = []; - } - if (get.onComplete) { - get.onComplete(message); - } - }); - } - sendListen_(listenSpec) { - const query = listenSpec.query; - const pathString = query._path.toString(); - const queryId = query._queryIdentifier; - this.log_('Listen on ' + pathString + ' for ' + queryId); - const req = { /*path*/ p: pathString }; - const action = 'q'; - // Only bother to send query if it's non-default. - if (listenSpec.tag) { - req['q'] = query._queryObject; - req['t'] = listenSpec.tag; - } - req[ /*hash*/'h'] = listenSpec.hashFn(); - this.sendRequest(action, req, (message) => { - const payload = message[ /*data*/'d']; - const status = message[ /*status*/'s']; - // print warnings in any case... - PersistentConnection.warnOnListenWarnings_(payload, query); - const currentListenSpec = this.listens.get(pathString) && - this.listens.get(pathString).get(queryId); - // only trigger actions if the listen hasn't been removed and readded - if (currentListenSpec === listenSpec) { - this.log_('listen response', message); - if (status !== 'ok') { - this.removeListen_(pathString, queryId); - } - if (listenSpec.onComplete) { - listenSpec.onComplete(status, payload); - } - } - }); - } - static warnOnListenWarnings_(payload, query) { - if (payload && typeof payload === 'object' && contains(payload, 'w')) { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - const warnings = safeGet(payload, 'w'); - if (Array.isArray(warnings) && ~warnings.indexOf('no_index')) { - const indexSpec = '".indexOn": "' + query._queryParams.getIndex().toString() + '"'; - const indexPath = query._path.toString(); - warn(`Using an unspecified index. Your data will be downloaded and ` + - `filtered on the client. Consider adding ${indexSpec} at ` + - `${indexPath} to your security rules for better performance.`); - } - } - } - refreshAuthToken(token) { - this.authToken_ = token; - this.log_('Auth token refreshed'); - if (this.authToken_) { - this.tryAuth(); - } - else { - //If we're connected we want to let the server know to unauthenticate us. If we're not connected, simply delete - //the credential so we dont become authenticated next time we connect. - if (this.connected_) { - this.sendRequest('unauth', {}, () => { }); - } - } - this.reduceReconnectDelayIfAdminCredential_(token); - } - reduceReconnectDelayIfAdminCredential_(credential) { - // NOTE: This isn't intended to be bulletproof (a malicious developer can always just modify the client). - // Additionally, we don't bother resetting the max delay back to the default if auth fails / expires. - const isFirebaseSecret = credential && credential.length === 40; - if (isFirebaseSecret || isAdmin(credential)) { - this.log_('Admin auth credential detected. Reducing max reconnect time.'); - this.maxReconnectDelay_ = RECONNECT_MAX_DELAY_FOR_ADMINS; - } - } - refreshAppCheckToken(token) { - this.appCheckToken_ = token; - this.log_('App check token refreshed'); - if (this.appCheckToken_) { - this.tryAppCheck(); - } - else { - //If we're connected we want to let the server know to unauthenticate us. - //If we're not connected, simply delete the credential so we dont become - // authenticated next time we connect. - if (this.connected_) { - this.sendRequest('unappeck', {}, () => { }); - } - } - } - /** - * Attempts to authenticate with the given credentials. If the authentication attempt fails, it's triggered like - * a auth revoked (the connection is closed). - */ - tryAuth() { - if (this.connected_ && this.authToken_) { - const token = this.authToken_; - const authMethod = isValidFormat(token) ? 'auth' : 'gauth'; - const requestData = { cred: token }; - if (this.authOverride_ === null) { - requestData['noauth'] = true; - } - else if (typeof this.authOverride_ === 'object') { - requestData['authvar'] = this.authOverride_; - } - this.sendRequest(authMethod, requestData, (res) => { - const status = res[ /*status*/'s']; - const data = res[ /*data*/'d'] || 'error'; - if (this.authToken_ === token) { - if (status === 'ok') { - this.invalidAuthTokenCount_ = 0; - } - else { - // Triggers reconnect and force refresh for auth token - this.onAuthRevoked_(status, data); - } - } - }); - } - } - /** - * Attempts to authenticate with the given token. If the authentication - * attempt fails, it's triggered like the token was revoked (the connection is - * closed). - */ - tryAppCheck() { - if (this.connected_ && this.appCheckToken_) { - this.sendRequest('appcheck', { 'token': this.appCheckToken_ }, (res) => { - const status = res[ /*status*/'s']; - const data = res[ /*data*/'d'] || 'error'; - if (status === 'ok') { - this.invalidAppCheckTokenCount_ = 0; - } - else { - this.onAppCheckRevoked_(status, data); - } - }); - } - } - /** - * @inheritDoc - */ - unlisten(query, tag) { - const pathString = query._path.toString(); - const queryId = query._queryIdentifier; - this.log_('Unlisten called for ' + pathString + ' ' + queryId); - assert(query._queryParams.isDefault() || !query._queryParams.loadsAllData(), 'unlisten() called for non-default but complete query'); - const listen = this.removeListen_(pathString, queryId); - if (listen && this.connected_) { - this.sendUnlisten_(pathString, queryId, query._queryObject, tag); - } - } - sendUnlisten_(pathString, queryId, queryObj, tag) { - this.log_('Unlisten on ' + pathString + ' for ' + queryId); - const req = { /*path*/ p: pathString }; - const action = 'n'; - // Only bother sending queryId if it's non-default. - if (tag) { - req['q'] = queryObj; - req['t'] = tag; - } - this.sendRequest(action, req); - } - onDisconnectPut(pathString, data, onComplete) { - this.initConnection_(); - if (this.connected_) { - this.sendOnDisconnect_('o', pathString, data, onComplete); - } - else { - this.onDisconnectRequestQueue_.push({ - pathString, - action: 'o', - data, - onComplete - }); - } - } - onDisconnectMerge(pathString, data, onComplete) { - this.initConnection_(); - if (this.connected_) { - this.sendOnDisconnect_('om', pathString, data, onComplete); - } - else { - this.onDisconnectRequestQueue_.push({ - pathString, - action: 'om', - data, - onComplete - }); - } - } - onDisconnectCancel(pathString, onComplete) { - this.initConnection_(); - if (this.connected_) { - this.sendOnDisconnect_('oc', pathString, null, onComplete); - } - else { - this.onDisconnectRequestQueue_.push({ - pathString, - action: 'oc', - data: null, - onComplete - }); - } - } - sendOnDisconnect_(action, pathString, data, onComplete) { - const request = { /*path*/ p: pathString, /*data*/ d: data }; - this.log_('onDisconnect ' + action, request); - this.sendRequest(action, request, (response) => { - if (onComplete) { - setTimeout(() => { - onComplete(response[ /*status*/'s'], response[ /* data */'d']); - }, Math.floor(0)); - } - }); - } - put(pathString, data, onComplete, hash) { - this.putInternal('p', pathString, data, onComplete, hash); - } - merge(pathString, data, onComplete, hash) { - this.putInternal('m', pathString, data, onComplete, hash); - } - putInternal(action, pathString, data, onComplete, hash) { - this.initConnection_(); - const request = { - /*path*/ p: pathString, - /*data*/ d: data - }; - if (hash !== undefined) { - request[ /*hash*/'h'] = hash; - } - // TODO: Only keep track of the most recent put for a given path? - this.outstandingPuts_.push({ - action, - request, - onComplete - }); - this.outstandingPutCount_++; - const index = this.outstandingPuts_.length - 1; - if (this.connected_) { - this.sendPut_(index); - } - else { - this.log_('Buffering put: ' + pathString); - } - } - sendPut_(index) { - const action = this.outstandingPuts_[index].action; - const request = this.outstandingPuts_[index].request; - const onComplete = this.outstandingPuts_[index].onComplete; - this.outstandingPuts_[index].queued = this.connected_; - this.sendRequest(action, request, (message) => { - this.log_(action + ' response', message); - delete this.outstandingPuts_[index]; - this.outstandingPutCount_--; - // Clean up array occasionally. - if (this.outstandingPutCount_ === 0) { - this.outstandingPuts_ = []; - } - if (onComplete) { - onComplete(message[ /*status*/'s'], message[ /* data */'d']); - } - }); - } - reportStats(stats) { - // If we're not connected, we just drop the stats. - if (this.connected_) { - const request = { /*counters*/ c: stats }; - this.log_('reportStats', request); - this.sendRequest(/*stats*/ 's', request, result => { - const status = result[ /*status*/'s']; - if (status !== 'ok') { - const errorReason = result[ /* data */'d']; - this.log_('reportStats', 'Error sending stats: ' + errorReason); - } - }); - } - } - onDataMessage_(message) { - if ('r' in message) { - // this is a response - this.log_('from server: ' + stringify(message)); - const reqNum = message['r']; - const onResponse = this.requestCBHash_[reqNum]; - if (onResponse) { - delete this.requestCBHash_[reqNum]; - onResponse(message[ /*body*/'b']); - } - } - else if ('error' in message) { - throw 'A server-side error has occurred: ' + message['error']; - } - else if ('a' in message) { - // a and b are action and body, respectively - this.onDataPush_(message['a'], message['b']); - } - } - onDataPush_(action, body) { - this.log_('handleServerMessage', action, body); - if (action === 'd') { - this.onDataUpdate_(body[ /*path*/'p'], body[ /*data*/'d'], - /*isMerge*/ false, body['t']); - } - else if (action === 'm') { - this.onDataUpdate_(body[ /*path*/'p'], body[ /*data*/'d'], - /*isMerge=*/ true, body['t']); - } - else if (action === 'c') { - this.onListenRevoked_(body[ /*path*/'p'], body[ /*query*/'q']); - } - else if (action === 'ac') { - this.onAuthRevoked_(body[ /*status code*/'s'], body[ /* explanation */'d']); - } - else if (action === 'apc') { - this.onAppCheckRevoked_(body[ /*status code*/'s'], body[ /* explanation */'d']); - } - else if (action === 'sd') { - this.onSecurityDebugPacket_(body); - } - else { - error('Unrecognized action received from server: ' + - stringify(action) + - '\nAre you using the latest client?'); - } - } - onReady_(timestamp, sessionId) { - this.log_('connection ready'); - this.connected_ = true; - this.lastConnectionEstablishedTime_ = new Date().getTime(); - this.handleTimestamp_(timestamp); - this.lastSessionId = sessionId; - if (this.firstConnection_) { - this.sendConnectStats_(); - } - this.restoreState_(); - this.firstConnection_ = false; - this.onConnectStatus_(true); - } - scheduleConnect_(timeout) { - assert(!this.realtime_, "Scheduling a connect when we're already connected/ing?"); - if (this.establishConnectionTimer_) { - clearTimeout(this.establishConnectionTimer_); - } - // NOTE: Even when timeout is 0, it's important to do a setTimeout to work around an infuriating "Security Error" in - // Firefox when trying to write to our long-polling iframe in some scenarios (e.g. Forge or our unit tests). - this.establishConnectionTimer_ = setTimeout(() => { - this.establishConnectionTimer_ = null; - this.establishConnection_(); - // eslint-disable-next-line @typescript-eslint/no-explicit-any - }, Math.floor(timeout)); - } - initConnection_() { - if (!this.realtime_ && this.firstConnection_) { - this.scheduleConnect_(0); - } - } - onVisible_(visible) { - // NOTE: Tabbing away and back to a window will defeat our reconnect backoff, but I think that's fine. - if (visible && - !this.visible_ && - this.reconnectDelay_ === this.maxReconnectDelay_) { - this.log_('Window became visible. Reducing delay.'); - this.reconnectDelay_ = RECONNECT_MIN_DELAY; - if (!this.realtime_) { - this.scheduleConnect_(0); - } - } - this.visible_ = visible; - } - onOnline_(online) { - if (online) { - this.log_('Browser went online.'); - this.reconnectDelay_ = RECONNECT_MIN_DELAY; - if (!this.realtime_) { - this.scheduleConnect_(0); - } - } - else { - this.log_('Browser went offline. Killing connection.'); - if (this.realtime_) { - this.realtime_.close(); - } - } - } - onRealtimeDisconnect_() { - this.log_('data client disconnected'); - this.connected_ = false; - this.realtime_ = null; - // Since we don't know if our sent transactions succeeded or not, we need to cancel them. - this.cancelSentTransactions_(); - // Clear out the pending requests. - this.requestCBHash_ = {}; - if (this.shouldReconnect_()) { - if (!this.visible_) { - this.log_("Window isn't visible. Delaying reconnect."); - this.reconnectDelay_ = this.maxReconnectDelay_; - this.lastConnectionAttemptTime_ = new Date().getTime(); - } - else if (this.lastConnectionEstablishedTime_) { - // If we've been connected long enough, reset reconnect delay to minimum. - const timeSinceLastConnectSucceeded = new Date().getTime() - this.lastConnectionEstablishedTime_; - if (timeSinceLastConnectSucceeded > RECONNECT_DELAY_RESET_TIMEOUT) { - this.reconnectDelay_ = RECONNECT_MIN_DELAY; - } - this.lastConnectionEstablishedTime_ = null; - } - const timeSinceLastConnectAttempt = new Date().getTime() - this.lastConnectionAttemptTime_; - let reconnectDelay = Math.max(0, this.reconnectDelay_ - timeSinceLastConnectAttempt); - reconnectDelay = Math.random() * reconnectDelay; - this.log_('Trying to reconnect in ' + reconnectDelay + 'ms'); - this.scheduleConnect_(reconnectDelay); - // Adjust reconnect delay for next time. - this.reconnectDelay_ = Math.min(this.maxReconnectDelay_, this.reconnectDelay_ * RECONNECT_DELAY_MULTIPLIER); - } - this.onConnectStatus_(false); - } - async establishConnection_() { - if (this.shouldReconnect_()) { - this.log_('Making a connection attempt'); - this.lastConnectionAttemptTime_ = new Date().getTime(); - this.lastConnectionEstablishedTime_ = null; - const onDataMessage = this.onDataMessage_.bind(this); - const onReady = this.onReady_.bind(this); - const onDisconnect = this.onRealtimeDisconnect_.bind(this); - const connId = this.id + ':' + PersistentConnection.nextConnectionId_++; - const lastSessionId = this.lastSessionId; - let canceled = false; - let connection = null; - const closeFn = function () { - if (connection) { - connection.close(); - } - else { - canceled = true; - onDisconnect(); - } - }; - const sendRequestFn = function (msg) { - assert(connection, "sendRequest call when we're not connected not allowed."); - connection.sendRequest(msg); - }; - this.realtime_ = { - close: closeFn, - sendRequest: sendRequestFn - }; - const forceRefresh = this.forceTokenRefresh_; - this.forceTokenRefresh_ = false; - try { - // First fetch auth and app check token, and establish connection after - // fetching the token was successful - const [authToken, appCheckToken] = await Promise.all([ - this.authTokenProvider_.getToken(forceRefresh), - this.appCheckTokenProvider_.getToken(forceRefresh) - ]); - if (!canceled) { - log('getToken() completed. Creating connection.'); - this.authToken_ = authToken && authToken.accessToken; - this.appCheckToken_ = appCheckToken && appCheckToken.token; - connection = new Connection(connId, this.repoInfo_, this.applicationId_, this.appCheckToken_, this.authToken_, onDataMessage, onReady, onDisconnect, - /* onKill= */ reason => { - warn(reason + ' (' + this.repoInfo_.toString() + ')'); - this.interrupt(SERVER_KILL_INTERRUPT_REASON); - }, lastSessionId); - } - else { - log('getToken() completed but was canceled'); - } - } - catch (error) { - this.log_('Failed to get token: ' + error); - if (!canceled) { - if (this.repoInfo_.nodeAdmin) { - // This may be a critical error for the Admin Node.js SDK, so log a warning. - // But getToken() may also just have temporarily failed, so we still want to - // continue retrying. - warn(error); - } - closeFn(); - } - } - } - } - interrupt(reason) { - log('Interrupting connection for reason: ' + reason); - this.interruptReasons_[reason] = true; - if (this.realtime_) { - this.realtime_.close(); - } - else { - if (this.establishConnectionTimer_) { - clearTimeout(this.establishConnectionTimer_); - this.establishConnectionTimer_ = null; - } - if (this.connected_) { - this.onRealtimeDisconnect_(); - } - } - } - resume(reason) { - log('Resuming connection for reason: ' + reason); - delete this.interruptReasons_[reason]; - if (isEmpty(this.interruptReasons_)) { - this.reconnectDelay_ = RECONNECT_MIN_DELAY; - if (!this.realtime_) { - this.scheduleConnect_(0); - } - } - } - handleTimestamp_(timestamp) { - const delta = timestamp - new Date().getTime(); - this.onServerInfoUpdate_({ serverTimeOffset: delta }); - } - cancelSentTransactions_() { - for (let i = 0; i < this.outstandingPuts_.length; i++) { - const put = this.outstandingPuts_[i]; - if (put && /*hash*/ 'h' in put.request && put.queued) { - if (put.onComplete) { - put.onComplete('disconnect'); - } - delete this.outstandingPuts_[i]; - this.outstandingPutCount_--; - } - } - // Clean up array occasionally. - if (this.outstandingPutCount_ === 0) { - this.outstandingPuts_ = []; - } - } - onListenRevoked_(pathString, query) { - // Remove the listen and manufacture a "permission_denied" error for the failed listen. - let queryId; - if (!query) { - queryId = 'default'; - } - else { - queryId = query.map(q => ObjectToUniqueKey(q)).join('$'); - } - const listen = this.removeListen_(pathString, queryId); - if (listen && listen.onComplete) { - listen.onComplete('permission_denied'); - } - } - removeListen_(pathString, queryId) { - const normalizedPathString = new Path(pathString).toString(); // normalize path. - let listen; - if (this.listens.has(normalizedPathString)) { - const map = this.listens.get(normalizedPathString); - listen = map.get(queryId); - map.delete(queryId); - if (map.size === 0) { - this.listens.delete(normalizedPathString); - } - } - else { - // all listens for this path has already been removed - listen = undefined; - } - return listen; - } - onAuthRevoked_(statusCode, explanation) { - log('Auth token revoked: ' + statusCode + '/' + explanation); - this.authToken_ = null; - this.forceTokenRefresh_ = true; - this.realtime_.close(); - if (statusCode === 'invalid_token' || statusCode === 'permission_denied') { - // We'll wait a couple times before logging the warning / increasing the - // retry period since oauth tokens will report as "invalid" if they're - // just expired. Plus there may be transient issues that resolve themselves. - this.invalidAuthTokenCount_++; - if (this.invalidAuthTokenCount_ >= INVALID_TOKEN_THRESHOLD) { - // Set a long reconnect delay because recovery is unlikely - this.reconnectDelay_ = RECONNECT_MAX_DELAY_FOR_ADMINS; - // Notify the auth token provider that the token is invalid, which will log - // a warning - this.authTokenProvider_.notifyForInvalidToken(); - } - } - } - onAppCheckRevoked_(statusCode, explanation) { - log('App check token revoked: ' + statusCode + '/' + explanation); - this.appCheckToken_ = null; - this.forceTokenRefresh_ = true; - // Note: We don't close the connection as the developer may not have - // enforcement enabled. The backend closes connections with enforcements. - if (statusCode === 'invalid_token' || statusCode === 'permission_denied') { - // We'll wait a couple times before logging the warning / increasing the - // retry period since oauth tokens will report as "invalid" if they're - // just expired. Plus there may be transient issues that resolve themselves. - this.invalidAppCheckTokenCount_++; - if (this.invalidAppCheckTokenCount_ >= INVALID_TOKEN_THRESHOLD) { - this.appCheckTokenProvider_.notifyForInvalidToken(); - } - } - } - onSecurityDebugPacket_(body) { - if (this.securityDebugCallback_) { - this.securityDebugCallback_(body); - } - else { - if ('msg' in body) { - console.log('FIREBASE: ' + body['msg'].replace('\n', '\nFIREBASE: ')); - } - } - } - restoreState_() { - //Re-authenticate ourselves if we have a credential stored. - this.tryAuth(); - this.tryAppCheck(); - // Puts depend on having received the corresponding data update from the server before they complete, so we must - // make sure to send listens before puts. - for (const queries of this.listens.values()) { - for (const listenSpec of queries.values()) { - this.sendListen_(listenSpec); - } - } - for (let i = 0; i < this.outstandingPuts_.length; i++) { - if (this.outstandingPuts_[i]) { - this.sendPut_(i); - } - } - while (this.onDisconnectRequestQueue_.length) { - const request = this.onDisconnectRequestQueue_.shift(); - this.sendOnDisconnect_(request.action, request.pathString, request.data, request.onComplete); - } - for (let i = 0; i < this.outstandingGets_.length; i++) { - if (this.outstandingGets_[i]) { - this.sendGet_(i); - } - } - } - /** - * Sends client stats for first connection - */ - sendConnectStats_() { - const stats = {}; - let clientName = 'js'; - if (isNodeSdk()) { - if (this.repoInfo_.nodeAdmin) { - clientName = 'admin_node'; - } - else { - clientName = 'node'; - } - } - stats['sdk.' + clientName + '.' + SDK_VERSION.replace(/\./g, '-')] = 1; - if (isMobileCordova()) { - stats['framework.cordova'] = 1; - } - else if (isReactNative()) { - stats['framework.reactnative'] = 1; - } - this.reportStats(stats); - } - shouldReconnect_() { - const online = OnlineMonitor.getInstance().currentlyOnline(); - return isEmpty(this.interruptReasons_) && online; - } -} -PersistentConnection.nextPersistentConnectionId_ = 0; -/** - * Counter for number of connections created. Mainly used for tagging in the logs - */ -PersistentConnection.nextConnectionId_ = 0; - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -class NamedNode { - constructor(name, node) { - this.name = name; - this.node = node; - } - static Wrap(name, node) { - return new NamedNode(name, node); - } -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -class Index { - /** - * @returns A standalone comparison function for - * this index - */ - getCompare() { - return this.compare.bind(this); - } - /** - * Given a before and after value for a node, determine if the indexed value has changed. Even if they are different, - * it's possible that the changes are isolated to parts of the snapshot that are not indexed. - * - * - * @returns True if the portion of the snapshot being indexed changed between oldNode and newNode - */ - indexedValueChanged(oldNode, newNode) { - const oldWrapped = new NamedNode(MIN_NAME, oldNode); - const newWrapped = new NamedNode(MIN_NAME, newNode); - return this.compare(oldWrapped, newWrapped) !== 0; - } - /** - * @returns a node wrapper that will sort equal to or less than - * any other node wrapper, using this index - */ - minPost() { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - return NamedNode.MIN; - } -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -let __EMPTY_NODE; -class KeyIndex extends Index { - static get __EMPTY_NODE() { - return __EMPTY_NODE; - } - static set __EMPTY_NODE(val) { - __EMPTY_NODE = val; - } - compare(a, b) { - return nameCompare(a.name, b.name); - } - isDefinedOn(node) { - // We could probably return true here (since every node has a key), but it's never called - // so just leaving unimplemented for now. - throw assertionError('KeyIndex.isDefinedOn not expected to be called.'); - } - indexedValueChanged(oldNode, newNode) { - return false; // The key for a node never changes. - } - minPost() { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - return NamedNode.MIN; - } - maxPost() { - // TODO: This should really be created once and cached in a static property, but - // NamedNode isn't defined yet, so I can't use it in a static. Bleh. - return new NamedNode(MAX_NAME, __EMPTY_NODE); - } - makePost(indexValue, name) { - assert(typeof indexValue === 'string', 'KeyIndex indexValue must always be a string.'); - // We just use empty node, but it'll never be compared, since our comparator only looks at name. - return new NamedNode(indexValue, __EMPTY_NODE); - } - /** - * @returns String representation for inclusion in a query spec - */ - toString() { - return '.key'; - } -} -const KEY_INDEX = new KeyIndex(); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * An iterator over an LLRBNode. - */ -class SortedMapIterator { - /** - * @param node - Node to iterate. - * @param isReverse_ - Whether or not to iterate in reverse - */ - constructor(node, startKey, comparator, isReverse_, resultGenerator_ = null) { - this.isReverse_ = isReverse_; - this.resultGenerator_ = resultGenerator_; - this.nodeStack_ = []; - let cmp = 1; - while (!node.isEmpty()) { - node = node; - cmp = startKey ? comparator(node.key, startKey) : 1; - // flip the comparison if we're going in reverse - if (isReverse_) { - cmp *= -1; - } - if (cmp < 0) { - // This node is less than our start key. ignore it - if (this.isReverse_) { - node = node.left; - } - else { - node = node.right; - } - } - else if (cmp === 0) { - // This node is exactly equal to our start key. Push it on the stack, but stop iterating; - this.nodeStack_.push(node); - break; - } - else { - // This node is greater than our start key, add it to the stack and move to the next one - this.nodeStack_.push(node); - if (this.isReverse_) { - node = node.right; - } - else { - node = node.left; - } - } - } - } - getNext() { - if (this.nodeStack_.length === 0) { - return null; - } - let node = this.nodeStack_.pop(); - let result; - if (this.resultGenerator_) { - result = this.resultGenerator_(node.key, node.value); - } - else { - result = { key: node.key, value: node.value }; - } - if (this.isReverse_) { - node = node.left; - while (!node.isEmpty()) { - this.nodeStack_.push(node); - node = node.right; - } - } - else { - node = node.right; - while (!node.isEmpty()) { - this.nodeStack_.push(node); - node = node.left; - } - } - return result; - } - hasNext() { - return this.nodeStack_.length > 0; - } - peek() { - if (this.nodeStack_.length === 0) { - return null; - } - const node = this.nodeStack_[this.nodeStack_.length - 1]; - if (this.resultGenerator_) { - return this.resultGenerator_(node.key, node.value); - } - else { - return { key: node.key, value: node.value }; - } - } -} -/** - * Represents a node in a Left-leaning Red-Black tree. - */ -class LLRBNode { - /** - * @param key - Key associated with this node. - * @param value - Value associated with this node. - * @param color - Whether this node is red. - * @param left - Left child. - * @param right - Right child. - */ - constructor(key, value, color, left, right) { - this.key = key; - this.value = value; - this.color = color != null ? color : LLRBNode.RED; - this.left = - left != null ? left : SortedMap.EMPTY_NODE; - this.right = - right != null ? right : SortedMap.EMPTY_NODE; - } - /** - * Returns a copy of the current node, optionally replacing pieces of it. - * - * @param key - New key for the node, or null. - * @param value - New value for the node, or null. - * @param color - New color for the node, or null. - * @param left - New left child for the node, or null. - * @param right - New right child for the node, or null. - * @returns The node copy. - */ - copy(key, value, color, left, right) { - return new LLRBNode(key != null ? key : this.key, value != null ? value : this.value, color != null ? color : this.color, left != null ? left : this.left, right != null ? right : this.right); - } - /** - * @returns The total number of nodes in the tree. - */ - count() { - return this.left.count() + 1 + this.right.count(); - } - /** - * @returns True if the tree is empty. - */ - isEmpty() { - return false; - } - /** - * Traverses the tree in key order and calls the specified action function - * for each node. - * - * @param action - Callback function to be called for each - * node. If it returns true, traversal is aborted. - * @returns The first truthy value returned by action, or the last falsey - * value returned by action - */ - inorderTraversal(action) { - return (this.left.inorderTraversal(action) || - !!action(this.key, this.value) || - this.right.inorderTraversal(action)); - } - /** - * Traverses the tree in reverse key order and calls the specified action function - * for each node. - * - * @param action - Callback function to be called for each - * node. If it returns true, traversal is aborted. - * @returns True if traversal was aborted. - */ - reverseTraversal(action) { - return (this.right.reverseTraversal(action) || - action(this.key, this.value) || - this.left.reverseTraversal(action)); - } - /** - * @returns The minimum node in the tree. - */ - min_() { - if (this.left.isEmpty()) { - return this; - } - else { - return this.left.min_(); - } - } - /** - * @returns The maximum key in the tree. - */ - minKey() { - return this.min_().key; - } - /** - * @returns The maximum key in the tree. - */ - maxKey() { - if (this.right.isEmpty()) { - return this.key; - } - else { - return this.right.maxKey(); - } - } - /** - * @param key - Key to insert. - * @param value - Value to insert. - * @param comparator - Comparator. - * @returns New tree, with the key/value added. - */ - insert(key, value, comparator) { - let n = this; - const cmp = comparator(key, n.key); - if (cmp < 0) { - n = n.copy(null, null, null, n.left.insert(key, value, comparator), null); - } - else if (cmp === 0) { - n = n.copy(null, value, null, null, null); - } - else { - n = n.copy(null, null, null, null, n.right.insert(key, value, comparator)); - } - return n.fixUp_(); - } - /** - * @returns New tree, with the minimum key removed. - */ - removeMin_() { - if (this.left.isEmpty()) { - return SortedMap.EMPTY_NODE; - } - let n = this; - if (!n.left.isRed_() && !n.left.left.isRed_()) { - n = n.moveRedLeft_(); - } - n = n.copy(null, null, null, n.left.removeMin_(), null); - return n.fixUp_(); - } - /** - * @param key - The key of the item to remove. - * @param comparator - Comparator. - * @returns New tree, with the specified item removed. - */ - remove(key, comparator) { - let n, smallest; - n = this; - if (comparator(key, n.key) < 0) { - if (!n.left.isEmpty() && !n.left.isRed_() && !n.left.left.isRed_()) { - n = n.moveRedLeft_(); - } - n = n.copy(null, null, null, n.left.remove(key, comparator), null); - } - else { - if (n.left.isRed_()) { - n = n.rotateRight_(); - } - if (!n.right.isEmpty() && !n.right.isRed_() && !n.right.left.isRed_()) { - n = n.moveRedRight_(); - } - if (comparator(key, n.key) === 0) { - if (n.right.isEmpty()) { - return SortedMap.EMPTY_NODE; - } - else { - smallest = n.right.min_(); - n = n.copy(smallest.key, smallest.value, null, null, n.right.removeMin_()); - } - } - n = n.copy(null, null, null, null, n.right.remove(key, comparator)); - } - return n.fixUp_(); - } - /** - * @returns Whether this is a RED node. - */ - isRed_() { - return this.color; - } - /** - * @returns New tree after performing any needed rotations. - */ - fixUp_() { - let n = this; - if (n.right.isRed_() && !n.left.isRed_()) { - n = n.rotateLeft_(); - } - if (n.left.isRed_() && n.left.left.isRed_()) { - n = n.rotateRight_(); - } - if (n.left.isRed_() && n.right.isRed_()) { - n = n.colorFlip_(); - } - return n; - } - /** - * @returns New tree, after moveRedLeft. - */ - moveRedLeft_() { - let n = this.colorFlip_(); - if (n.right.left.isRed_()) { - n = n.copy(null, null, null, null, n.right.rotateRight_()); - n = n.rotateLeft_(); - n = n.colorFlip_(); - } - return n; - } - /** - * @returns New tree, after moveRedRight. - */ - moveRedRight_() { - let n = this.colorFlip_(); - if (n.left.left.isRed_()) { - n = n.rotateRight_(); - n = n.colorFlip_(); - } - return n; - } - /** - * @returns New tree, after rotateLeft. - */ - rotateLeft_() { - const nl = this.copy(null, null, LLRBNode.RED, null, this.right.left); - return this.right.copy(null, null, this.color, nl, null); - } - /** - * @returns New tree, after rotateRight. - */ - rotateRight_() { - const nr = this.copy(null, null, LLRBNode.RED, this.left.right, null); - return this.left.copy(null, null, this.color, null, nr); - } - /** - * @returns Newt ree, after colorFlip. - */ - colorFlip_() { - const left = this.left.copy(null, null, !this.left.color, null, null); - const right = this.right.copy(null, null, !this.right.color, null, null); - return this.copy(null, null, !this.color, left, right); - } - /** - * For testing. - * - * @returns True if all is well. - */ - checkMaxDepth_() { - const blackDepth = this.check_(); - return Math.pow(2.0, blackDepth) <= this.count() + 1; - } - check_() { - if (this.isRed_() && this.left.isRed_()) { - throw new Error('Red node has red child(' + this.key + ',' + this.value + ')'); - } - if (this.right.isRed_()) { - throw new Error('Right child of (' + this.key + ',' + this.value + ') is red'); - } - const blackDepth = this.left.check_(); - if (blackDepth !== this.right.check_()) { - throw new Error('Black depths differ'); - } - else { - return blackDepth + (this.isRed_() ? 0 : 1); - } - } -} -LLRBNode.RED = true; -LLRBNode.BLACK = false; -/** - * Represents an empty node (a leaf node in the Red-Black Tree). - */ -class LLRBEmptyNode { - /** - * Returns a copy of the current node. - * - * @returns The node copy. - */ - copy(key, value, color, left, right) { - return this; - } - /** - * Returns a copy of the tree, with the specified key/value added. - * - * @param key - Key to be added. - * @param value - Value to be added. - * @param comparator - Comparator. - * @returns New tree, with item added. - */ - insert(key, value, comparator) { - return new LLRBNode(key, value, null); - } - /** - * Returns a copy of the tree, with the specified key removed. - * - * @param key - The key to remove. - * @param comparator - Comparator. - * @returns New tree, with item removed. - */ - remove(key, comparator) { - return this; - } - /** - * @returns The total number of nodes in the tree. - */ - count() { - return 0; - } - /** - * @returns True if the tree is empty. - */ - isEmpty() { - return true; - } - /** - * Traverses the tree in key order and calls the specified action function - * for each node. - * - * @param action - Callback function to be called for each - * node. If it returns true, traversal is aborted. - * @returns True if traversal was aborted. - */ - inorderTraversal(action) { - return false; - } - /** - * Traverses the tree in reverse key order and calls the specified action function - * for each node. - * - * @param action - Callback function to be called for each - * node. If it returns true, traversal is aborted. - * @returns True if traversal was aborted. - */ - reverseTraversal(action) { - return false; - } - minKey() { - return null; - } - maxKey() { - return null; - } - check_() { - return 0; - } - /** - * @returns Whether this node is red. - */ - isRed_() { - return false; - } -} -/** - * An immutable sorted map implementation, based on a Left-leaning Red-Black - * tree. - */ -class SortedMap { - /** - * @param comparator_ - Key comparator. - * @param root_ - Optional root node for the map. - */ - constructor(comparator_, root_ = SortedMap.EMPTY_NODE) { - this.comparator_ = comparator_; - this.root_ = root_; - } - /** - * Returns a copy of the map, with the specified key/value added or replaced. - * (TODO: We should perhaps rename this method to 'put') - * - * @param key - Key to be added. - * @param value - Value to be added. - * @returns New map, with item added. - */ - insert(key, value) { - return new SortedMap(this.comparator_, this.root_ - .insert(key, value, this.comparator_) - .copy(null, null, LLRBNode.BLACK, null, null)); - } - /** - * Returns a copy of the map, with the specified key removed. - * - * @param key - The key to remove. - * @returns New map, with item removed. - */ - remove(key) { - return new SortedMap(this.comparator_, this.root_ - .remove(key, this.comparator_) - .copy(null, null, LLRBNode.BLACK, null, null)); - } - /** - * Returns the value of the node with the given key, or null. - * - * @param key - The key to look up. - * @returns The value of the node with the given key, or null if the - * key doesn't exist. - */ - get(key) { - let cmp; - let node = this.root_; - while (!node.isEmpty()) { - cmp = this.comparator_(key, node.key); - if (cmp === 0) { - return node.value; - } - else if (cmp < 0) { - node = node.left; - } - else if (cmp > 0) { - node = node.right; - } - } - return null; - } - /** - * Returns the key of the item *before* the specified key, or null if key is the first item. - * @param key - The key to find the predecessor of - * @returns The predecessor key. - */ - getPredecessorKey(key) { - let cmp, node = this.root_, rightParent = null; - while (!node.isEmpty()) { - cmp = this.comparator_(key, node.key); - if (cmp === 0) { - if (!node.left.isEmpty()) { - node = node.left; - while (!node.right.isEmpty()) { - node = node.right; - } - return node.key; - } - else if (rightParent) { - return rightParent.key; - } - else { - return null; // first item. - } - } - else if (cmp < 0) { - node = node.left; - } - else if (cmp > 0) { - rightParent = node; - node = node.right; - } - } - throw new Error('Attempted to find predecessor key for a nonexistent key. What gives?'); - } - /** - * @returns True if the map is empty. - */ - isEmpty() { - return this.root_.isEmpty(); - } - /** - * @returns The total number of nodes in the map. - */ - count() { - return this.root_.count(); - } - /** - * @returns The minimum key in the map. - */ - minKey() { - return this.root_.minKey(); - } - /** - * @returns The maximum key in the map. - */ - maxKey() { - return this.root_.maxKey(); - } - /** - * Traverses the map in key order and calls the specified action function - * for each key/value pair. - * - * @param action - Callback function to be called - * for each key/value pair. If action returns true, traversal is aborted. - * @returns The first truthy value returned by action, or the last falsey - * value returned by action - */ - inorderTraversal(action) { - return this.root_.inorderTraversal(action); - } - /** - * Traverses the map in reverse key order and calls the specified action function - * for each key/value pair. - * - * @param action - Callback function to be called - * for each key/value pair. If action returns true, traversal is aborted. - * @returns True if the traversal was aborted. - */ - reverseTraversal(action) { - return this.root_.reverseTraversal(action); - } - /** - * Returns an iterator over the SortedMap. - * @returns The iterator. - */ - getIterator(resultGenerator) { - return new SortedMapIterator(this.root_, null, this.comparator_, false, resultGenerator); - } - getIteratorFrom(key, resultGenerator) { - return new SortedMapIterator(this.root_, key, this.comparator_, false, resultGenerator); - } - getReverseIteratorFrom(key, resultGenerator) { - return new SortedMapIterator(this.root_, key, this.comparator_, true, resultGenerator); - } - getReverseIterator(resultGenerator) { - return new SortedMapIterator(this.root_, null, this.comparator_, true, resultGenerator); - } -} -/** - * Always use the same empty node, to reduce memory. - */ -SortedMap.EMPTY_NODE = new LLRBEmptyNode(); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -function NAME_ONLY_COMPARATOR(left, right) { - return nameCompare(left.name, right.name); -} -function NAME_COMPARATOR(left, right) { - return nameCompare(left, right); -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -let MAX_NODE$2; -function setMaxNode$1(val) { - MAX_NODE$2 = val; -} -const priorityHashText = function (priority) { - if (typeof priority === 'number') { - return 'number:' + doubleToIEEE754String(priority); - } - else { - return 'string:' + priority; - } -}; -/** - * Validates that a priority snapshot Node is valid. - */ -const validatePriorityNode = function (priorityNode) { - if (priorityNode.isLeafNode()) { - const val = priorityNode.val(); - assert(typeof val === 'string' || - typeof val === 'number' || - (typeof val === 'object' && contains(val, '.sv')), 'Priority must be a string or number.'); - } - else { - assert(priorityNode === MAX_NODE$2 || priorityNode.isEmpty(), 'priority of unexpected type.'); - } - // Don't call getPriority() on MAX_NODE to avoid hitting assertion. - assert(priorityNode === MAX_NODE$2 || priorityNode.getPriority().isEmpty(), "Priority nodes can't have a priority of their own."); -}; - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -let __childrenNodeConstructor; -/** - * LeafNode is a class for storing leaf nodes in a DataSnapshot. It - * implements Node and stores the value of the node (a string, - * number, or boolean) accessible via getValue(). - */ -class LeafNode { - /** - * @param value_ - The value to store in this leaf node. The object type is - * possible in the event of a deferred value - * @param priorityNode_ - The priority of this node. - */ - constructor(value_, priorityNode_ = LeafNode.__childrenNodeConstructor.EMPTY_NODE) { - this.value_ = value_; - this.priorityNode_ = priorityNode_; - this.lazyHash_ = null; - assert(this.value_ !== undefined && this.value_ !== null, "LeafNode shouldn't be created with null/undefined value."); - validatePriorityNode(this.priorityNode_); - } - static set __childrenNodeConstructor(val) { - __childrenNodeConstructor = val; - } - static get __childrenNodeConstructor() { - return __childrenNodeConstructor; - } - /** @inheritDoc */ - isLeafNode() { - return true; - } - /** @inheritDoc */ - getPriority() { - return this.priorityNode_; - } - /** @inheritDoc */ - updatePriority(newPriorityNode) { - return new LeafNode(this.value_, newPriorityNode); - } - /** @inheritDoc */ - getImmediateChild(childName) { - // Hack to treat priority as a regular child - if (childName === '.priority') { - return this.priorityNode_; - } - else { - return LeafNode.__childrenNodeConstructor.EMPTY_NODE; - } - } - /** @inheritDoc */ - getChild(path) { - if (pathIsEmpty(path)) { - return this; - } - else if (pathGetFront(path) === '.priority') { - return this.priorityNode_; - } - else { - return LeafNode.__childrenNodeConstructor.EMPTY_NODE; - } - } - hasChild() { - return false; - } - /** @inheritDoc */ - getPredecessorChildName(childName, childNode) { - return null; - } - /** @inheritDoc */ - updateImmediateChild(childName, newChildNode) { - if (childName === '.priority') { - return this.updatePriority(newChildNode); - } - else if (newChildNode.isEmpty() && childName !== '.priority') { - return this; - } - else { - return LeafNode.__childrenNodeConstructor.EMPTY_NODE.updateImmediateChild(childName, newChildNode).updatePriority(this.priorityNode_); - } - } - /** @inheritDoc */ - updateChild(path, newChildNode) { - const front = pathGetFront(path); - if (front === null) { - return newChildNode; - } - else if (newChildNode.isEmpty() && front !== '.priority') { - return this; - } - else { - assert(front !== '.priority' || pathGetLength(path) === 1, '.priority must be the last token in a path'); - return this.updateImmediateChild(front, LeafNode.__childrenNodeConstructor.EMPTY_NODE.updateChild(pathPopFront(path), newChildNode)); - } - } - /** @inheritDoc */ - isEmpty() { - return false; - } - /** @inheritDoc */ - numChildren() { - return 0; - } - /** @inheritDoc */ - forEachChild(index, action) { - return false; - } - val(exportFormat) { - if (exportFormat && !this.getPriority().isEmpty()) { - return { - '.value': this.getValue(), - '.priority': this.getPriority().val() - }; - } - else { - return this.getValue(); - } - } - /** @inheritDoc */ - hash() { - if (this.lazyHash_ === null) { - let toHash = ''; - if (!this.priorityNode_.isEmpty()) { - toHash += - 'priority:' + - priorityHashText(this.priorityNode_.val()) + - ':'; - } - const type = typeof this.value_; - toHash += type + ':'; - if (type === 'number') { - toHash += doubleToIEEE754String(this.value_); - } - else { - toHash += this.value_; - } - this.lazyHash_ = sha1(toHash); - } - return this.lazyHash_; - } - /** - * Returns the value of the leaf node. - * @returns The value of the node. - */ - getValue() { - return this.value_; - } - compareTo(other) { - if (other === LeafNode.__childrenNodeConstructor.EMPTY_NODE) { - return 1; - } - else if (other instanceof LeafNode.__childrenNodeConstructor) { - return -1; - } - else { - assert(other.isLeafNode(), 'Unknown node type'); - return this.compareToLeafNode_(other); - } - } - /** - * Comparison specifically for two leaf nodes - */ - compareToLeafNode_(otherLeaf) { - const otherLeafType = typeof otherLeaf.value_; - const thisLeafType = typeof this.value_; - const otherIndex = LeafNode.VALUE_TYPE_ORDER.indexOf(otherLeafType); - const thisIndex = LeafNode.VALUE_TYPE_ORDER.indexOf(thisLeafType); - assert(otherIndex >= 0, 'Unknown leaf type: ' + otherLeafType); - assert(thisIndex >= 0, 'Unknown leaf type: ' + thisLeafType); - if (otherIndex === thisIndex) { - // Same type, compare values - if (thisLeafType === 'object') { - // Deferred value nodes are all equal, but we should also never get to this point... - return 0; - } - else { - // Note that this works because true > false, all others are number or string comparisons - if (this.value_ < otherLeaf.value_) { - return -1; - } - else if (this.value_ === otherLeaf.value_) { - return 0; - } - else { - return 1; - } - } - } - else { - return thisIndex - otherIndex; - } - } - withIndex() { - return this; - } - isIndexed() { - return true; - } - equals(other) { - if (other === this) { - return true; - } - else if (other.isLeafNode()) { - const otherLeaf = other; - return (this.value_ === otherLeaf.value_ && - this.priorityNode_.equals(otherLeaf.priorityNode_)); - } - else { - return false; - } - } -} -/** - * The sort order for comparing leaf nodes of different types. If two leaf nodes have - * the same type, the comparison falls back to their value - */ -LeafNode.VALUE_TYPE_ORDER = ['object', 'boolean', 'number', 'string']; - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -let nodeFromJSON$1; -let MAX_NODE$1; -function setNodeFromJSON(val) { - nodeFromJSON$1 = val; -} -function setMaxNode(val) { - MAX_NODE$1 = val; -} -class PriorityIndex extends Index { - compare(a, b) { - const aPriority = a.node.getPriority(); - const bPriority = b.node.getPriority(); - const indexCmp = aPriority.compareTo(bPriority); - if (indexCmp === 0) { - return nameCompare(a.name, b.name); - } - else { - return indexCmp; - } - } - isDefinedOn(node) { - return !node.getPriority().isEmpty(); - } - indexedValueChanged(oldNode, newNode) { - return !oldNode.getPriority().equals(newNode.getPriority()); - } - minPost() { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - return NamedNode.MIN; - } - maxPost() { - return new NamedNode(MAX_NAME, new LeafNode('[PRIORITY-POST]', MAX_NODE$1)); - } - makePost(indexValue, name) { - const priorityNode = nodeFromJSON$1(indexValue); - return new NamedNode(name, new LeafNode('[PRIORITY-POST]', priorityNode)); - } - /** - * @returns String representation for inclusion in a query spec - */ - toString() { - return '.priority'; - } -} -const PRIORITY_INDEX = new PriorityIndex(); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -const LOG_2 = Math.log(2); -class Base12Num { - constructor(length) { - const logBase2 = (num) => - // eslint-disable-next-line @typescript-eslint/no-explicit-any - parseInt((Math.log(num) / LOG_2), 10); - const bitMask = (bits) => parseInt(Array(bits + 1).join('1'), 2); - this.count = logBase2(length + 1); - this.current_ = this.count - 1; - const mask = bitMask(this.count); - this.bits_ = (length + 1) & mask; - } - nextBitIsOne() { - //noinspection JSBitwiseOperatorUsage - const result = !(this.bits_ & (0x1 << this.current_)); - this.current_--; - return result; - } -} -/** - * Takes a list of child nodes and constructs a SortedSet using the given comparison - * function - * - * Uses the algorithm described in the paper linked here: - * http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.46.1458 - * - * @param childList - Unsorted list of children - * @param cmp - The comparison method to be used - * @param keyFn - An optional function to extract K from a node wrapper, if K's - * type is not NamedNode - * @param mapSortFn - An optional override for comparator used by the generated sorted map - */ -const buildChildSet = function (childList, cmp, keyFn, mapSortFn) { - childList.sort(cmp); - const buildBalancedTree = function (low, high) { - const length = high - low; - let namedNode; - let key; - if (length === 0) { - return null; - } - else if (length === 1) { - namedNode = childList[low]; - key = keyFn ? keyFn(namedNode) : namedNode; - return new LLRBNode(key, namedNode.node, LLRBNode.BLACK, null, null); - } - else { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - const middle = parseInt((length / 2), 10) + low; - const left = buildBalancedTree(low, middle); - const right = buildBalancedTree(middle + 1, high); - namedNode = childList[middle]; - key = keyFn ? keyFn(namedNode) : namedNode; - return new LLRBNode(key, namedNode.node, LLRBNode.BLACK, left, right); - } - }; - const buildFrom12Array = function (base12) { - let node = null; - let root = null; - let index = childList.length; - const buildPennant = function (chunkSize, color) { - const low = index - chunkSize; - const high = index; - index -= chunkSize; - const childTree = buildBalancedTree(low + 1, high); - const namedNode = childList[low]; - const key = keyFn ? keyFn(namedNode) : namedNode; - attachPennant(new LLRBNode(key, namedNode.node, color, null, childTree)); - }; - const attachPennant = function (pennant) { - if (node) { - node.left = pennant; - node = pennant; - } - else { - root = pennant; - node = pennant; - } - }; - for (let i = 0; i < base12.count; ++i) { - const isOne = base12.nextBitIsOne(); - // The number of nodes taken in each slice is 2^(arr.length - (i + 1)) - const chunkSize = Math.pow(2, base12.count - (i + 1)); - if (isOne) { - buildPennant(chunkSize, LLRBNode.BLACK); - } - else { - // current == 2 - buildPennant(chunkSize, LLRBNode.BLACK); - buildPennant(chunkSize, LLRBNode.RED); - } - } - return root; - }; - const base12 = new Base12Num(childList.length); - const root = buildFrom12Array(base12); - // eslint-disable-next-line @typescript-eslint/no-explicit-any - return new SortedMap(mapSortFn || cmp, root); -}; - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -let _defaultIndexMap; -const fallbackObject = {}; -class IndexMap { - constructor(indexes_, indexSet_) { - this.indexes_ = indexes_; - this.indexSet_ = indexSet_; - } - /** - * The default IndexMap for nodes without a priority - */ - static get Default() { - assert(fallbackObject && PRIORITY_INDEX, 'ChildrenNode.ts has not been loaded'); - _defaultIndexMap = - _defaultIndexMap || - new IndexMap({ '.priority': fallbackObject }, { '.priority': PRIORITY_INDEX }); - return _defaultIndexMap; - } - get(indexKey) { - const sortedMap = safeGet(this.indexes_, indexKey); - if (!sortedMap) { - throw new Error('No index defined for ' + indexKey); - } - if (sortedMap instanceof SortedMap) { - return sortedMap; - } - else { - // The index exists, but it falls back to just name comparison. Return null so that the calling code uses the - // regular child map - return null; - } - } - hasIndex(indexDefinition) { - return contains(this.indexSet_, indexDefinition.toString()); - } - addIndex(indexDefinition, existingChildren) { - assert(indexDefinition !== KEY_INDEX, "KeyIndex always exists and isn't meant to be added to the IndexMap."); - const childList = []; - let sawIndexedValue = false; - const iter = existingChildren.getIterator(NamedNode.Wrap); - let next = iter.getNext(); - while (next) { - sawIndexedValue = - sawIndexedValue || indexDefinition.isDefinedOn(next.node); - childList.push(next); - next = iter.getNext(); - } - let newIndex; - if (sawIndexedValue) { - newIndex = buildChildSet(childList, indexDefinition.getCompare()); - } - else { - newIndex = fallbackObject; - } - const indexName = indexDefinition.toString(); - const newIndexSet = Object.assign({}, this.indexSet_); - newIndexSet[indexName] = indexDefinition; - const newIndexes = Object.assign({}, this.indexes_); - newIndexes[indexName] = newIndex; - return new IndexMap(newIndexes, newIndexSet); - } - /** - * Ensure that this node is properly tracked in any indexes that we're maintaining - */ - addToIndexes(namedNode, existingChildren) { - const newIndexes = map(this.indexes_, (indexedChildren, indexName) => { - const index = safeGet(this.indexSet_, indexName); - assert(index, 'Missing index implementation for ' + indexName); - if (indexedChildren === fallbackObject) { - // Check to see if we need to index everything - if (index.isDefinedOn(namedNode.node)) { - // We need to build this index - const childList = []; - const iter = existingChildren.getIterator(NamedNode.Wrap); - let next = iter.getNext(); - while (next) { - if (next.name !== namedNode.name) { - childList.push(next); - } - next = iter.getNext(); - } - childList.push(namedNode); - return buildChildSet(childList, index.getCompare()); - } - else { - // No change, this remains a fallback - return fallbackObject; - } - } - else { - const existingSnap = existingChildren.get(namedNode.name); - let newChildren = indexedChildren; - if (existingSnap) { - newChildren = newChildren.remove(new NamedNode(namedNode.name, existingSnap)); - } - return newChildren.insert(namedNode, namedNode.node); - } - }); - return new IndexMap(newIndexes, this.indexSet_); - } - /** - * Create a new IndexMap instance with the given value removed - */ - removeFromIndexes(namedNode, existingChildren) { - const newIndexes = map(this.indexes_, (indexedChildren) => { - if (indexedChildren === fallbackObject) { - // This is the fallback. Just return it, nothing to do in this case - return indexedChildren; - } - else { - const existingSnap = existingChildren.get(namedNode.name); - if (existingSnap) { - return indexedChildren.remove(new NamedNode(namedNode.name, existingSnap)); - } - else { - // No record of this child - return indexedChildren; - } - } - }); - return new IndexMap(newIndexes, this.indexSet_); - } -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// TODO: For memory savings, don't store priorityNode_ if it's empty. -let EMPTY_NODE; -/** - * ChildrenNode is a class for storing internal nodes in a DataSnapshot - * (i.e. nodes with children). It implements Node and stores the - * list of children in the children property, sorted by child name. - */ -class ChildrenNode { - /** - * @param children_ - List of children of this node.. - * @param priorityNode_ - The priority of this node (as a snapshot node). - */ - constructor(children_, priorityNode_, indexMap_) { - this.children_ = children_; - this.priorityNode_ = priorityNode_; - this.indexMap_ = indexMap_; - this.lazyHash_ = null; - /** - * Note: The only reason we allow null priority is for EMPTY_NODE, since we can't use - * EMPTY_NODE as the priority of EMPTY_NODE. We might want to consider making EMPTY_NODE its own - * class instead of an empty ChildrenNode. - */ - if (this.priorityNode_) { - validatePriorityNode(this.priorityNode_); - } - if (this.children_.isEmpty()) { - assert(!this.priorityNode_ || this.priorityNode_.isEmpty(), 'An empty node cannot have a priority'); - } - } - static get EMPTY_NODE() { - return (EMPTY_NODE || - (EMPTY_NODE = new ChildrenNode(new SortedMap(NAME_COMPARATOR), null, IndexMap.Default))); - } - /** @inheritDoc */ - isLeafNode() { - return false; - } - /** @inheritDoc */ - getPriority() { - return this.priorityNode_ || EMPTY_NODE; - } - /** @inheritDoc */ - updatePriority(newPriorityNode) { - if (this.children_.isEmpty()) { - // Don't allow priorities on empty nodes - return this; - } - else { - return new ChildrenNode(this.children_, newPriorityNode, this.indexMap_); - } - } - /** @inheritDoc */ - getImmediateChild(childName) { - // Hack to treat priority as a regular child - if (childName === '.priority') { - return this.getPriority(); - } - else { - const child = this.children_.get(childName); - return child === null ? EMPTY_NODE : child; - } - } - /** @inheritDoc */ - getChild(path) { - const front = pathGetFront(path); - if (front === null) { - return this; - } - return this.getImmediateChild(front).getChild(pathPopFront(path)); - } - /** @inheritDoc */ - hasChild(childName) { - return this.children_.get(childName) !== null; - } - /** @inheritDoc */ - updateImmediateChild(childName, newChildNode) { - assert(newChildNode, 'We should always be passing snapshot nodes'); - if (childName === '.priority') { - return this.updatePriority(newChildNode); - } - else { - const namedNode = new NamedNode(childName, newChildNode); - let newChildren, newIndexMap; - if (newChildNode.isEmpty()) { - newChildren = this.children_.remove(childName); - newIndexMap = this.indexMap_.removeFromIndexes(namedNode, this.children_); - } - else { - newChildren = this.children_.insert(childName, newChildNode); - newIndexMap = this.indexMap_.addToIndexes(namedNode, this.children_); - } - const newPriority = newChildren.isEmpty() - ? EMPTY_NODE - : this.priorityNode_; - return new ChildrenNode(newChildren, newPriority, newIndexMap); - } - } - /** @inheritDoc */ - updateChild(path, newChildNode) { - const front = pathGetFront(path); - if (front === null) { - return newChildNode; - } - else { - assert(pathGetFront(path) !== '.priority' || pathGetLength(path) === 1, '.priority must be the last token in a path'); - const newImmediateChild = this.getImmediateChild(front).updateChild(pathPopFront(path), newChildNode); - return this.updateImmediateChild(front, newImmediateChild); - } - } - /** @inheritDoc */ - isEmpty() { - return this.children_.isEmpty(); - } - /** @inheritDoc */ - numChildren() { - return this.children_.count(); - } - /** @inheritDoc */ - val(exportFormat) { - if (this.isEmpty()) { - return null; - } - const obj = {}; - let numKeys = 0, maxKey = 0, allIntegerKeys = true; - this.forEachChild(PRIORITY_INDEX, (key, childNode) => { - obj[key] = childNode.val(exportFormat); - numKeys++; - if (allIntegerKeys && ChildrenNode.INTEGER_REGEXP_.test(key)) { - maxKey = Math.max(maxKey, Number(key)); - } - else { - allIntegerKeys = false; - } - }); - if (!exportFormat && allIntegerKeys && maxKey < 2 * numKeys) { - // convert to array. - const array = []; - // eslint-disable-next-line guard-for-in - for (const key in obj) { - array[key] = obj[key]; - } - return array; - } - else { - if (exportFormat && !this.getPriority().isEmpty()) { - obj['.priority'] = this.getPriority().val(); - } - return obj; - } - } - /** @inheritDoc */ - hash() { - if (this.lazyHash_ === null) { - let toHash = ''; - if (!this.getPriority().isEmpty()) { - toHash += - 'priority:' + - priorityHashText(this.getPriority().val()) + - ':'; - } - this.forEachChild(PRIORITY_INDEX, (key, childNode) => { - const childHash = childNode.hash(); - if (childHash !== '') { - toHash += ':' + key + ':' + childHash; - } - }); - this.lazyHash_ = toHash === '' ? '' : sha1(toHash); - } - return this.lazyHash_; - } - /** @inheritDoc */ - getPredecessorChildName(childName, childNode, index) { - const idx = this.resolveIndex_(index); - if (idx) { - const predecessor = idx.getPredecessorKey(new NamedNode(childName, childNode)); - return predecessor ? predecessor.name : null; - } - else { - return this.children_.getPredecessorKey(childName); - } - } - getFirstChildName(indexDefinition) { - const idx = this.resolveIndex_(indexDefinition); - if (idx) { - const minKey = idx.minKey(); - return minKey && minKey.name; - } - else { - return this.children_.minKey(); - } - } - getFirstChild(indexDefinition) { - const minKey = this.getFirstChildName(indexDefinition); - if (minKey) { - return new NamedNode(minKey, this.children_.get(minKey)); - } - else { - return null; - } - } - /** - * Given an index, return the key name of the largest value we have, according to that index - */ - getLastChildName(indexDefinition) { - const idx = this.resolveIndex_(indexDefinition); - if (idx) { - const maxKey = idx.maxKey(); - return maxKey && maxKey.name; - } - else { - return this.children_.maxKey(); - } - } - getLastChild(indexDefinition) { - const maxKey = this.getLastChildName(indexDefinition); - if (maxKey) { - return new NamedNode(maxKey, this.children_.get(maxKey)); - } - else { - return null; - } - } - forEachChild(index, action) { - const idx = this.resolveIndex_(index); - if (idx) { - return idx.inorderTraversal(wrappedNode => { - return action(wrappedNode.name, wrappedNode.node); - }); - } - else { - return this.children_.inorderTraversal(action); - } - } - getIterator(indexDefinition) { - return this.getIteratorFrom(indexDefinition.minPost(), indexDefinition); - } - getIteratorFrom(startPost, indexDefinition) { - const idx = this.resolveIndex_(indexDefinition); - if (idx) { - return idx.getIteratorFrom(startPost, key => key); - } - else { - const iterator = this.children_.getIteratorFrom(startPost.name, NamedNode.Wrap); - let next = iterator.peek(); - while (next != null && indexDefinition.compare(next, startPost) < 0) { - iterator.getNext(); - next = iterator.peek(); - } - return iterator; - } - } - getReverseIterator(indexDefinition) { - return this.getReverseIteratorFrom(indexDefinition.maxPost(), indexDefinition); - } - getReverseIteratorFrom(endPost, indexDefinition) { - const idx = this.resolveIndex_(indexDefinition); - if (idx) { - return idx.getReverseIteratorFrom(endPost, key => { - return key; - }); - } - else { - const iterator = this.children_.getReverseIteratorFrom(endPost.name, NamedNode.Wrap); - let next = iterator.peek(); - while (next != null && indexDefinition.compare(next, endPost) > 0) { - iterator.getNext(); - next = iterator.peek(); - } - return iterator; - } - } - compareTo(other) { - if (this.isEmpty()) { - if (other.isEmpty()) { - return 0; - } - else { - return -1; - } - } - else if (other.isLeafNode() || other.isEmpty()) { - return 1; - } - else if (other === MAX_NODE) { - return -1; - } - else { - // Must be another node with children. - return 0; - } - } - withIndex(indexDefinition) { - if (indexDefinition === KEY_INDEX || - this.indexMap_.hasIndex(indexDefinition)) { - return this; - } - else { - const newIndexMap = this.indexMap_.addIndex(indexDefinition, this.children_); - return new ChildrenNode(this.children_, this.priorityNode_, newIndexMap); - } - } - isIndexed(index) { - return index === KEY_INDEX || this.indexMap_.hasIndex(index); - } - equals(other) { - if (other === this) { - return true; - } - else if (other.isLeafNode()) { - return false; - } - else { - const otherChildrenNode = other; - if (!this.getPriority().equals(otherChildrenNode.getPriority())) { - return false; - } - else if (this.children_.count() === otherChildrenNode.children_.count()) { - const thisIter = this.getIterator(PRIORITY_INDEX); - const otherIter = otherChildrenNode.getIterator(PRIORITY_INDEX); - let thisCurrent = thisIter.getNext(); - let otherCurrent = otherIter.getNext(); - while (thisCurrent && otherCurrent) { - if (thisCurrent.name !== otherCurrent.name || - !thisCurrent.node.equals(otherCurrent.node)) { - return false; - } - thisCurrent = thisIter.getNext(); - otherCurrent = otherIter.getNext(); - } - return thisCurrent === null && otherCurrent === null; - } - else { - return false; - } - } - } - /** - * Returns a SortedMap ordered by index, or null if the default (by-key) ordering can be used - * instead. - * - */ - resolveIndex_(indexDefinition) { - if (indexDefinition === KEY_INDEX) { - return null; - } - else { - return this.indexMap_.get(indexDefinition.toString()); - } - } -} -ChildrenNode.INTEGER_REGEXP_ = /^(0|[1-9]\d*)$/; -class MaxNode extends ChildrenNode { - constructor() { - super(new SortedMap(NAME_COMPARATOR), ChildrenNode.EMPTY_NODE, IndexMap.Default); - } - compareTo(other) { - if (other === this) { - return 0; - } - else { - return 1; - } - } - equals(other) { - // Not that we every compare it, but MAX_NODE is only ever equal to itself - return other === this; - } - getPriority() { - return this; - } - getImmediateChild(childName) { - return ChildrenNode.EMPTY_NODE; - } - isEmpty() { - return false; - } -} -/** - * Marker that will sort higher than any other snapshot. - */ -const MAX_NODE = new MaxNode(); -Object.defineProperties(NamedNode, { - MIN: { - value: new NamedNode(MIN_NAME, ChildrenNode.EMPTY_NODE) - }, - MAX: { - value: new NamedNode(MAX_NAME, MAX_NODE) - } -}); -/** - * Reference Extensions - */ -KeyIndex.__EMPTY_NODE = ChildrenNode.EMPTY_NODE; -LeafNode.__childrenNodeConstructor = ChildrenNode; -setMaxNode$1(MAX_NODE); -setMaxNode(MAX_NODE); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -const USE_HINZE = true; -/** - * Constructs a snapshot node representing the passed JSON and returns it. - * @param json - JSON to create a node for. - * @param priority - Optional priority to use. This will be ignored if the - * passed JSON contains a .priority property. - */ -function nodeFromJSON(json, priority = null) { - if (json === null) { - return ChildrenNode.EMPTY_NODE; - } - if (typeof json === 'object' && '.priority' in json) { - priority = json['.priority']; - } - assert(priority === null || - typeof priority === 'string' || - typeof priority === 'number' || - (typeof priority === 'object' && '.sv' in priority), 'Invalid priority type found: ' + typeof priority); - if (typeof json === 'object' && '.value' in json && json['.value'] !== null) { - json = json['.value']; - } - // Valid leaf nodes include non-objects or server-value wrapper objects - if (typeof json !== 'object' || '.sv' in json) { - const jsonLeaf = json; - return new LeafNode(jsonLeaf, nodeFromJSON(priority)); - } - if (!(json instanceof Array) && USE_HINZE) { - const children = []; - let childrenHavePriority = false; - const hinzeJsonObj = json; - each(hinzeJsonObj, (key, child) => { - if (key.substring(0, 1) !== '.') { - // Ignore metadata nodes - const childNode = nodeFromJSON(child); - if (!childNode.isEmpty()) { - childrenHavePriority = - childrenHavePriority || !childNode.getPriority().isEmpty(); - children.push(new NamedNode(key, childNode)); - } - } - }); - if (children.length === 0) { - return ChildrenNode.EMPTY_NODE; - } - const childSet = buildChildSet(children, NAME_ONLY_COMPARATOR, namedNode => namedNode.name, NAME_COMPARATOR); - if (childrenHavePriority) { - const sortedChildSet = buildChildSet(children, PRIORITY_INDEX.getCompare()); - return new ChildrenNode(childSet, nodeFromJSON(priority), new IndexMap({ '.priority': sortedChildSet }, { '.priority': PRIORITY_INDEX })); - } - else { - return new ChildrenNode(childSet, nodeFromJSON(priority), IndexMap.Default); - } - } - else { - let node = ChildrenNode.EMPTY_NODE; - each(json, (key, childData) => { - if (contains(json, key)) { - if (key.substring(0, 1) !== '.') { - // ignore metadata nodes. - const childNode = nodeFromJSON(childData); - if (childNode.isLeafNode() || !childNode.isEmpty()) { - node = node.updateImmediateChild(key, childNode); - } - } - } - }); - return node.updatePriority(nodeFromJSON(priority)); - } -} -setNodeFromJSON(nodeFromJSON); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -class PathIndex extends Index { - constructor(indexPath_) { - super(); - this.indexPath_ = indexPath_; - assert(!pathIsEmpty(indexPath_) && pathGetFront(indexPath_) !== '.priority', "Can't create PathIndex with empty path or .priority key"); - } - extractChild(snap) { - return snap.getChild(this.indexPath_); - } - isDefinedOn(node) { - return !node.getChild(this.indexPath_).isEmpty(); - } - compare(a, b) { - const aChild = this.extractChild(a.node); - const bChild = this.extractChild(b.node); - const indexCmp = aChild.compareTo(bChild); - if (indexCmp === 0) { - return nameCompare(a.name, b.name); - } - else { - return indexCmp; - } - } - makePost(indexValue, name) { - const valueNode = nodeFromJSON(indexValue); - const node = ChildrenNode.EMPTY_NODE.updateChild(this.indexPath_, valueNode); - return new NamedNode(name, node); - } - maxPost() { - const node = ChildrenNode.EMPTY_NODE.updateChild(this.indexPath_, MAX_NODE); - return new NamedNode(MAX_NAME, node); - } - toString() { - return pathSlice(this.indexPath_, 0).join('/'); - } -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -class ValueIndex extends Index { - compare(a, b) { - const indexCmp = a.node.compareTo(b.node); - if (indexCmp === 0) { - return nameCompare(a.name, b.name); - } - else { - return indexCmp; - } - } - isDefinedOn(node) { - return true; - } - indexedValueChanged(oldNode, newNode) { - return !oldNode.equals(newNode); - } - minPost() { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - return NamedNode.MIN; - } - maxPost() { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - return NamedNode.MAX; - } - makePost(indexValue, name) { - const valueNode = nodeFromJSON(indexValue); - return new NamedNode(name, valueNode); - } - /** - * @returns String representation for inclusion in a query spec - */ - toString() { - return '.value'; - } -} -const VALUE_INDEX = new ValueIndex(); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Modeled after base64 web-safe chars, but ordered by ASCII. -const PUSH_CHARS = '-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz'; -const MIN_PUSH_CHAR = '-'; -const MAX_PUSH_CHAR = 'z'; -const MAX_KEY_LEN = 786; -/** - * Fancy ID generator that creates 20-character string identifiers with the - * following properties: - * - * 1. They're based on timestamp so that they sort *after* any existing ids. - * 2. They contain 72-bits of random data after the timestamp so that IDs won't - * collide with other clients' IDs. - * 3. They sort *lexicographically* (so the timestamp is converted to characters - * that will sort properly). - * 4. They're monotonically increasing. Even if you generate more than one in - * the same timestamp, the latter ones will sort after the former ones. We do - * this by using the previous random bits but "incrementing" them by 1 (only - * in the case of a timestamp collision). - */ -const nextPushId = (function () { - // Timestamp of last push, used to prevent local collisions if you push twice - // in one ms. - let lastPushTime = 0; - // We generate 72-bits of randomness which get turned into 12 characters and - // appended to the timestamp to prevent collisions with other clients. We - // store the last characters we generated because in the event of a collision, - // we'll use those same characters except "incremented" by one. - const lastRandChars = []; - return function (now) { - const duplicateTime = now === lastPushTime; - lastPushTime = now; - let i; - const timeStampChars = new Array(8); - for (i = 7; i >= 0; i--) { - timeStampChars[i] = PUSH_CHARS.charAt(now % 64); - // NOTE: Can't use << here because javascript will convert to int and lose - // the upper bits. - now = Math.floor(now / 64); - } - assert(now === 0, 'Cannot push at time == 0'); - let id = timeStampChars.join(''); - if (!duplicateTime) { - for (i = 0; i < 12; i++) { - lastRandChars[i] = Math.floor(Math.random() * 64); - } - } - else { - // If the timestamp hasn't changed since last push, use the same random - // number, except incremented by 1. - for (i = 11; i >= 0 && lastRandChars[i] === 63; i--) { - lastRandChars[i] = 0; - } - lastRandChars[i]++; - } - for (i = 0; i < 12; i++) { - id += PUSH_CHARS.charAt(lastRandChars[i]); - } - assert(id.length === 20, 'nextPushId: Length should be 20.'); - return id; - }; -})(); -const successor = function (key) { - if (key === '' + INTEGER_32_MAX) { - // See https://firebase.google.com/docs/database/web/lists-of-data#data-order - return MIN_PUSH_CHAR; - } - const keyAsInt = tryParseInt(key); - if (keyAsInt != null) { - return '' + (keyAsInt + 1); - } - const next = new Array(key.length); - for (let i = 0; i < next.length; i++) { - next[i] = key.charAt(i); - } - if (next.length < MAX_KEY_LEN) { - next.push(MIN_PUSH_CHAR); - return next.join(''); - } - let i = next.length - 1; - while (i >= 0 && next[i] === MAX_PUSH_CHAR) { - i--; - } - // `successor` was called on the largest possible key, so return the - // MAX_NAME, which sorts larger than all keys. - if (i === -1) { - return MAX_NAME; - } - const source = next[i]; - const sourcePlusOne = PUSH_CHARS.charAt(PUSH_CHARS.indexOf(source) + 1); - next[i] = sourcePlusOne; - return next.slice(0, i + 1).join(''); -}; -// `key` is assumed to be non-empty. -const predecessor = function (key) { - if (key === '' + INTEGER_32_MIN) { - return MIN_NAME; - } - const keyAsInt = tryParseInt(key); - if (keyAsInt != null) { - return '' + (keyAsInt - 1); - } - const next = new Array(key.length); - for (let i = 0; i < next.length; i++) { - next[i] = key.charAt(i); - } - // If `key` ends in `MIN_PUSH_CHAR`, the largest key lexicographically - // smaller than `key`, is `key[0:key.length - 1]`. The next key smaller - // than that, `predecessor(predecessor(key))`, is - // - // `key[0:key.length - 2] + (key[key.length - 1] - 1) + \ - // { MAX_PUSH_CHAR repeated MAX_KEY_LEN - (key.length - 1) times } - // - // analogous to increment/decrement for base-10 integers. - // - // This works because lexigographic comparison works character-by-character, - // using length as a tie-breaker if one key is a prefix of the other. - if (next[next.length - 1] === MIN_PUSH_CHAR) { - if (next.length === 1) { - // See https://firebase.google.com/docs/database/web/lists-of-data#orderbykey - return '' + INTEGER_32_MAX; - } - delete next[next.length - 1]; - return next.join(''); - } - // Replace the last character with it's immediate predecessor, and - // fill the suffix of the key with MAX_PUSH_CHAR. This is the - // lexicographically largest possible key smaller than `key`. - next[next.length - 1] = PUSH_CHARS.charAt(PUSH_CHARS.indexOf(next[next.length - 1]) - 1); - return next.join('') + MAX_PUSH_CHAR.repeat(MAX_KEY_LEN - next.length); -}; - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -function changeValue(snapshotNode) { - return { type: "value" /* VALUE */, snapshotNode }; -} -function changeChildAdded(childName, snapshotNode) { - return { type: "child_added" /* CHILD_ADDED */, snapshotNode, childName }; -} -function changeChildRemoved(childName, snapshotNode) { - return { type: "child_removed" /* CHILD_REMOVED */, snapshotNode, childName }; -} -function changeChildChanged(childName, snapshotNode, oldSnap) { - return { - type: "child_changed" /* CHILD_CHANGED */, - snapshotNode, - childName, - oldSnap - }; -} -function changeChildMoved(childName, snapshotNode) { - return { type: "child_moved" /* CHILD_MOVED */, snapshotNode, childName }; -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Doesn't really filter nodes but applies an index to the node and keeps track of any changes - */ -class IndexedFilter { - constructor(index_) { - this.index_ = index_; - } - updateChild(snap, key, newChild, affectedPath, source, optChangeAccumulator) { - assert(snap.isIndexed(this.index_), 'A node must be indexed if only a child is updated'); - const oldChild = snap.getImmediateChild(key); - // Check if anything actually changed. - if (oldChild.getChild(affectedPath).equals(newChild.getChild(affectedPath))) { - // There's an edge case where a child can enter or leave the view because affectedPath was set to null. - // In this case, affectedPath will appear null in both the old and new snapshots. So we need - // to avoid treating these cases as "nothing changed." - if (oldChild.isEmpty() === newChild.isEmpty()) { - // Nothing changed. - // This assert should be valid, but it's expensive (can dominate perf testing) so don't actually do it. - //assert(oldChild.equals(newChild), 'Old and new snapshots should be equal.'); - return snap; - } - } - if (optChangeAccumulator != null) { - if (newChild.isEmpty()) { - if (snap.hasChild(key)) { - optChangeAccumulator.trackChildChange(changeChildRemoved(key, oldChild)); - } - else { - assert(snap.isLeafNode(), 'A child remove without an old child only makes sense on a leaf node'); - } - } - else if (oldChild.isEmpty()) { - optChangeAccumulator.trackChildChange(changeChildAdded(key, newChild)); - } - else { - optChangeAccumulator.trackChildChange(changeChildChanged(key, newChild, oldChild)); - } - } - if (snap.isLeafNode() && newChild.isEmpty()) { - return snap; - } - else { - // Make sure the node is indexed - return snap.updateImmediateChild(key, newChild).withIndex(this.index_); - } - } - updateFullNode(oldSnap, newSnap, optChangeAccumulator) { - if (optChangeAccumulator != null) { - if (!oldSnap.isLeafNode()) { - oldSnap.forEachChild(PRIORITY_INDEX, (key, childNode) => { - if (!newSnap.hasChild(key)) { - optChangeAccumulator.trackChildChange(changeChildRemoved(key, childNode)); - } - }); - } - if (!newSnap.isLeafNode()) { - newSnap.forEachChild(PRIORITY_INDEX, (key, childNode) => { - if (oldSnap.hasChild(key)) { - const oldChild = oldSnap.getImmediateChild(key); - if (!oldChild.equals(childNode)) { - optChangeAccumulator.trackChildChange(changeChildChanged(key, childNode, oldChild)); - } - } - else { - optChangeAccumulator.trackChildChange(changeChildAdded(key, childNode)); - } - }); - } - } - return newSnap.withIndex(this.index_); - } - updatePriority(oldSnap, newPriority) { - if (oldSnap.isEmpty()) { - return ChildrenNode.EMPTY_NODE; - } - else { - return oldSnap.updatePriority(newPriority); - } - } - filtersNodes() { - return false; - } - getIndexedFilter() { - return this; - } - getIndex() { - return this.index_; - } -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Filters nodes by range and uses an IndexFilter to track any changes after filtering the node - */ -class RangedFilter { - constructor(params) { - this.indexedFilter_ = new IndexedFilter(params.getIndex()); - this.index_ = params.getIndex(); - this.startPost_ = RangedFilter.getStartPost_(params); - this.endPost_ = RangedFilter.getEndPost_(params); - } - getStartPost() { - return this.startPost_; - } - getEndPost() { - return this.endPost_; - } - matches(node) { - return (this.index_.compare(this.getStartPost(), node) <= 0 && - this.index_.compare(node, this.getEndPost()) <= 0); - } - updateChild(snap, key, newChild, affectedPath, source, optChangeAccumulator) { - if (!this.matches(new NamedNode(key, newChild))) { - newChild = ChildrenNode.EMPTY_NODE; - } - return this.indexedFilter_.updateChild(snap, key, newChild, affectedPath, source, optChangeAccumulator); - } - updateFullNode(oldSnap, newSnap, optChangeAccumulator) { - if (newSnap.isLeafNode()) { - // Make sure we have a children node with the correct index, not a leaf node; - newSnap = ChildrenNode.EMPTY_NODE; - } - let filtered = newSnap.withIndex(this.index_); - // Don't support priorities on queries - filtered = filtered.updatePriority(ChildrenNode.EMPTY_NODE); - const self = this; - newSnap.forEachChild(PRIORITY_INDEX, (key, childNode) => { - if (!self.matches(new NamedNode(key, childNode))) { - filtered = filtered.updateImmediateChild(key, ChildrenNode.EMPTY_NODE); - } - }); - return this.indexedFilter_.updateFullNode(oldSnap, filtered, optChangeAccumulator); - } - updatePriority(oldSnap, newPriority) { - // Don't support priorities on queries - return oldSnap; - } - filtersNodes() { - return true; - } - getIndexedFilter() { - return this.indexedFilter_; - } - getIndex() { - return this.index_; - } - static getStartPost_(params) { - if (params.hasStart()) { - const startName = params.getIndexStartName(); - return params.getIndex().makePost(params.getIndexStartValue(), startName); - } - else { - return params.getIndex().minPost(); - } - } - static getEndPost_(params) { - if (params.hasEnd()) { - const endName = params.getIndexEndName(); - return params.getIndex().makePost(params.getIndexEndValue(), endName); - } - else { - return params.getIndex().maxPost(); - } - } -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Applies a limit and a range to a node and uses RangedFilter to do the heavy lifting where possible - */ -class LimitedFilter { - constructor(params) { - this.rangedFilter_ = new RangedFilter(params); - this.index_ = params.getIndex(); - this.limit_ = params.getLimit(); - this.reverse_ = !params.isViewFromLeft(); - } - updateChild(snap, key, newChild, affectedPath, source, optChangeAccumulator) { - if (!this.rangedFilter_.matches(new NamedNode(key, newChild))) { - newChild = ChildrenNode.EMPTY_NODE; - } - if (snap.getImmediateChild(key).equals(newChild)) { - // No change - return snap; - } - else if (snap.numChildren() < this.limit_) { - return this.rangedFilter_ - .getIndexedFilter() - .updateChild(snap, key, newChild, affectedPath, source, optChangeAccumulator); - } - else { - return this.fullLimitUpdateChild_(snap, key, newChild, source, optChangeAccumulator); - } - } - updateFullNode(oldSnap, newSnap, optChangeAccumulator) { - let filtered; - if (newSnap.isLeafNode() || newSnap.isEmpty()) { - // Make sure we have a children node with the correct index, not a leaf node; - filtered = ChildrenNode.EMPTY_NODE.withIndex(this.index_); - } - else { - if (this.limit_ * 2 < newSnap.numChildren() && - newSnap.isIndexed(this.index_)) { - // Easier to build up a snapshot, since what we're given has more than twice the elements we want - filtered = ChildrenNode.EMPTY_NODE.withIndex(this.index_); - // anchor to the startPost, endPost, or last element as appropriate - let iterator; - if (this.reverse_) { - iterator = newSnap.getReverseIteratorFrom(this.rangedFilter_.getEndPost(), this.index_); - } - else { - iterator = newSnap.getIteratorFrom(this.rangedFilter_.getStartPost(), this.index_); - } - let count = 0; - while (iterator.hasNext() && count < this.limit_) { - const next = iterator.getNext(); - let inRange; - if (this.reverse_) { - inRange = - this.index_.compare(this.rangedFilter_.getStartPost(), next) <= 0; - } - else { - inRange = - this.index_.compare(next, this.rangedFilter_.getEndPost()) <= 0; - } - if (inRange) { - filtered = filtered.updateImmediateChild(next.name, next.node); - count++; - } - else { - // if we have reached the end post, we cannot keep adding elemments - break; - } - } - } - else { - // The snap contains less than twice the limit. Faster to delete from the snap than build up a new one - filtered = newSnap.withIndex(this.index_); - // Don't support priorities on queries - filtered = filtered.updatePriority(ChildrenNode.EMPTY_NODE); - let startPost; - let endPost; - let cmp; - let iterator; - if (this.reverse_) { - iterator = filtered.getReverseIterator(this.index_); - startPost = this.rangedFilter_.getEndPost(); - endPost = this.rangedFilter_.getStartPost(); - const indexCompare = this.index_.getCompare(); - cmp = (a, b) => indexCompare(b, a); - } - else { - iterator = filtered.getIterator(this.index_); - startPost = this.rangedFilter_.getStartPost(); - endPost = this.rangedFilter_.getEndPost(); - cmp = this.index_.getCompare(); - } - let count = 0; - let foundStartPost = false; - while (iterator.hasNext()) { - const next = iterator.getNext(); - if (!foundStartPost && cmp(startPost, next) <= 0) { - // start adding - foundStartPost = true; - } - const inRange = foundStartPost && count < this.limit_ && cmp(next, endPost) <= 0; - if (inRange) { - count++; - } - else { - filtered = filtered.updateImmediateChild(next.name, ChildrenNode.EMPTY_NODE); - } - } - } - } - return this.rangedFilter_ - .getIndexedFilter() - .updateFullNode(oldSnap, filtered, optChangeAccumulator); - } - updatePriority(oldSnap, newPriority) { - // Don't support priorities on queries - return oldSnap; - } - filtersNodes() { - return true; - } - getIndexedFilter() { - return this.rangedFilter_.getIndexedFilter(); - } - getIndex() { - return this.index_; - } - fullLimitUpdateChild_(snap, childKey, childSnap, source, changeAccumulator) { - // TODO: rename all cache stuff etc to general snap terminology - let cmp; - if (this.reverse_) { - const indexCmp = this.index_.getCompare(); - cmp = (a, b) => indexCmp(b, a); - } - else { - cmp = this.index_.getCompare(); - } - const oldEventCache = snap; - assert(oldEventCache.numChildren() === this.limit_, ''); - const newChildNamedNode = new NamedNode(childKey, childSnap); - const windowBoundary = this.reverse_ - ? oldEventCache.getFirstChild(this.index_) - : oldEventCache.getLastChild(this.index_); - const inRange = this.rangedFilter_.matches(newChildNamedNode); - if (oldEventCache.hasChild(childKey)) { - const oldChildSnap = oldEventCache.getImmediateChild(childKey); - let nextChild = source.getChildAfterChild(this.index_, windowBoundary, this.reverse_); - while (nextChild != null && - (nextChild.name === childKey || oldEventCache.hasChild(nextChild.name))) { - // There is a weird edge case where a node is updated as part of a merge in the write tree, but hasn't - // been applied to the limited filter yet. Ignore this next child which will be updated later in - // the limited filter... - nextChild = source.getChildAfterChild(this.index_, nextChild, this.reverse_); - } - const compareNext = nextChild == null ? 1 : cmp(nextChild, newChildNamedNode); - const remainsInWindow = inRange && !childSnap.isEmpty() && compareNext >= 0; - if (remainsInWindow) { - if (changeAccumulator != null) { - changeAccumulator.trackChildChange(changeChildChanged(childKey, childSnap, oldChildSnap)); - } - return oldEventCache.updateImmediateChild(childKey, childSnap); - } - else { - if (changeAccumulator != null) { - changeAccumulator.trackChildChange(changeChildRemoved(childKey, oldChildSnap)); - } - const newEventCache = oldEventCache.updateImmediateChild(childKey, ChildrenNode.EMPTY_NODE); - const nextChildInRange = nextChild != null && this.rangedFilter_.matches(nextChild); - if (nextChildInRange) { - if (changeAccumulator != null) { - changeAccumulator.trackChildChange(changeChildAdded(nextChild.name, nextChild.node)); - } - return newEventCache.updateImmediateChild(nextChild.name, nextChild.node); - } - else { - return newEventCache; - } - } - } - else if (childSnap.isEmpty()) { - // we're deleting a node, but it was not in the window, so ignore it - return snap; - } - else if (inRange) { - if (cmp(windowBoundary, newChildNamedNode) >= 0) { - if (changeAccumulator != null) { - changeAccumulator.trackChildChange(changeChildRemoved(windowBoundary.name, windowBoundary.node)); - changeAccumulator.trackChildChange(changeChildAdded(childKey, childSnap)); - } - return oldEventCache - .updateImmediateChild(childKey, childSnap) - .updateImmediateChild(windowBoundary.name, ChildrenNode.EMPTY_NODE); - } - else { - return snap; - } - } - else { - return snap; - } - } -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * This class is an immutable-from-the-public-api struct containing a set of query parameters defining a - * range to be returned for a particular location. It is assumed that validation of parameters is done at the - * user-facing API level, so it is not done here. - * - * @internal - */ -class QueryParams { - constructor() { - this.limitSet_ = false; - this.startSet_ = false; - this.startNameSet_ = false; - this.startAfterSet_ = false; - this.endSet_ = false; - this.endNameSet_ = false; - this.endBeforeSet_ = false; - this.limit_ = 0; - this.viewFrom_ = ''; - this.indexStartValue_ = null; - this.indexStartName_ = ''; - this.indexEndValue_ = null; - this.indexEndName_ = ''; - this.index_ = PRIORITY_INDEX; - } - hasStart() { - return this.startSet_; - } - hasStartAfter() { - return this.startAfterSet_; - } - hasEndBefore() { - return this.endBeforeSet_; - } - /** - * @returns True if it would return from left. - */ - isViewFromLeft() { - if (this.viewFrom_ === '') { - // limit(), rather than limitToFirst or limitToLast was called. - // This means that only one of startSet_ and endSet_ is true. Use them - // to calculate which side of the view to anchor to. If neither is set, - // anchor to the end. - return this.startSet_; - } - else { - return this.viewFrom_ === "l" /* VIEW_FROM_LEFT */; - } - } - /** - * Only valid to call if hasStart() returns true - */ - getIndexStartValue() { - assert(this.startSet_, 'Only valid if start has been set'); - return this.indexStartValue_; - } - /** - * Only valid to call if hasStart() returns true. - * Returns the starting key name for the range defined by these query parameters - */ - getIndexStartName() { - assert(this.startSet_, 'Only valid if start has been set'); - if (this.startNameSet_) { - return this.indexStartName_; - } - else { - return MIN_NAME; - } - } - hasEnd() { - return this.endSet_; - } - /** - * Only valid to call if hasEnd() returns true. - */ - getIndexEndValue() { - assert(this.endSet_, 'Only valid if end has been set'); - return this.indexEndValue_; - } - /** - * Only valid to call if hasEnd() returns true. - * Returns the end key name for the range defined by these query parameters - */ - getIndexEndName() { - assert(this.endSet_, 'Only valid if end has been set'); - if (this.endNameSet_) { - return this.indexEndName_; - } - else { - return MAX_NAME; - } - } - hasLimit() { - return this.limitSet_; - } - /** - * @returns True if a limit has been set and it has been explicitly anchored - */ - hasAnchoredLimit() { - return this.limitSet_ && this.viewFrom_ !== ''; - } - /** - * Only valid to call if hasLimit() returns true - */ - getLimit() { - assert(this.limitSet_, 'Only valid if limit has been set'); - return this.limit_; - } - getIndex() { - return this.index_; - } - loadsAllData() { - return !(this.startSet_ || this.endSet_ || this.limitSet_); - } - isDefault() { - return this.loadsAllData() && this.index_ === PRIORITY_INDEX; - } - copy() { - const copy = new QueryParams(); - copy.limitSet_ = this.limitSet_; - copy.limit_ = this.limit_; - copy.startSet_ = this.startSet_; - copy.indexStartValue_ = this.indexStartValue_; - copy.startNameSet_ = this.startNameSet_; - copy.indexStartName_ = this.indexStartName_; - copy.endSet_ = this.endSet_; - copy.indexEndValue_ = this.indexEndValue_; - copy.endNameSet_ = this.endNameSet_; - copy.indexEndName_ = this.indexEndName_; - copy.index_ = this.index_; - copy.viewFrom_ = this.viewFrom_; - return copy; - } -} -function queryParamsGetNodeFilter(queryParams) { - if (queryParams.loadsAllData()) { - return new IndexedFilter(queryParams.getIndex()); - } - else if (queryParams.hasLimit()) { - return new LimitedFilter(queryParams); - } - else { - return new RangedFilter(queryParams); - } -} -function queryParamsLimitToFirst(queryParams, newLimit) { - const newParams = queryParams.copy(); - newParams.limitSet_ = true; - newParams.limit_ = newLimit; - newParams.viewFrom_ = "l" /* VIEW_FROM_LEFT */; - return newParams; -} -function queryParamsLimitToLast(queryParams, newLimit) { - const newParams = queryParams.copy(); - newParams.limitSet_ = true; - newParams.limit_ = newLimit; - newParams.viewFrom_ = "r" /* VIEW_FROM_RIGHT */; - return newParams; -} -function queryParamsStartAt(queryParams, indexValue, key) { - const newParams = queryParams.copy(); - newParams.startSet_ = true; - if (indexValue === undefined) { - indexValue = null; - } - newParams.indexStartValue_ = indexValue; - if (key != null) { - newParams.startNameSet_ = true; - newParams.indexStartName_ = key; - } - else { - newParams.startNameSet_ = false; - newParams.indexStartName_ = ''; - } - return newParams; -} -function queryParamsStartAfter(queryParams, indexValue, key) { - let params; - if (queryParams.index_ === KEY_INDEX) { - if (typeof indexValue === 'string') { - indexValue = successor(indexValue); - } - params = queryParamsStartAt(queryParams, indexValue, key); - } - else { - let childKey; - if (key == null) { - childKey = MAX_NAME; - } - else { - childKey = successor(key); - } - params = queryParamsStartAt(queryParams, indexValue, childKey); - } - params.startAfterSet_ = true; - return params; -} -function queryParamsEndAt(queryParams, indexValue, key) { - const newParams = queryParams.copy(); - newParams.endSet_ = true; - if (indexValue === undefined) { - indexValue = null; - } - newParams.indexEndValue_ = indexValue; - if (key !== undefined) { - newParams.endNameSet_ = true; - newParams.indexEndName_ = key; - } - else { - newParams.endNameSet_ = false; - newParams.indexEndName_ = ''; - } - return newParams; -} -function queryParamsEndBefore(queryParams, indexValue, key) { - let childKey; - let params; - if (queryParams.index_ === KEY_INDEX) { - if (typeof indexValue === 'string') { - indexValue = predecessor(indexValue); - } - params = queryParamsEndAt(queryParams, indexValue, key); - } - else { - if (key == null) { - childKey = MIN_NAME; - } - else { - childKey = predecessor(key); - } - params = queryParamsEndAt(queryParams, indexValue, childKey); - } - params.endBeforeSet_ = true; - return params; -} -function queryParamsOrderBy(queryParams, index) { - const newParams = queryParams.copy(); - newParams.index_ = index; - return newParams; -} -/** - * Returns a set of REST query string parameters representing this query. - * - * @returns query string parameters - */ -function queryParamsToRestQueryStringParameters(queryParams) { - const qs = {}; - if (queryParams.isDefault()) { - return qs; - } - let orderBy; - if (queryParams.index_ === PRIORITY_INDEX) { - orderBy = "$priority" /* PRIORITY_INDEX */; - } - else if (queryParams.index_ === VALUE_INDEX) { - orderBy = "$value" /* VALUE_INDEX */; - } - else if (queryParams.index_ === KEY_INDEX) { - orderBy = "$key" /* KEY_INDEX */; - } - else { - assert(queryParams.index_ instanceof PathIndex, 'Unrecognized index type!'); - orderBy = queryParams.index_.toString(); - } - qs["orderBy" /* ORDER_BY */] = stringify(orderBy); - if (queryParams.startSet_) { - qs["startAt" /* START_AT */] = stringify(queryParams.indexStartValue_); - if (queryParams.startNameSet_) { - qs["startAt" /* START_AT */] += - ',' + stringify(queryParams.indexStartName_); - } - } - if (queryParams.endSet_) { - qs["endAt" /* END_AT */] = stringify(queryParams.indexEndValue_); - if (queryParams.endNameSet_) { - qs["endAt" /* END_AT */] += - ',' + stringify(queryParams.indexEndName_); - } - } - if (queryParams.limitSet_) { - if (queryParams.isViewFromLeft()) { - qs["limitToFirst" /* LIMIT_TO_FIRST */] = queryParams.limit_; - } - else { - qs["limitToLast" /* LIMIT_TO_LAST */] = queryParams.limit_; - } - } - return qs; -} -function queryParamsGetQueryObject(queryParams) { - const obj = {}; - if (queryParams.startSet_) { - obj["sp" /* INDEX_START_VALUE */] = - queryParams.indexStartValue_; - if (queryParams.startNameSet_) { - obj["sn" /* INDEX_START_NAME */] = - queryParams.indexStartName_; - } - } - if (queryParams.endSet_) { - obj["ep" /* INDEX_END_VALUE */] = queryParams.indexEndValue_; - if (queryParams.endNameSet_) { - obj["en" /* INDEX_END_NAME */] = queryParams.indexEndName_; - } - } - if (queryParams.limitSet_) { - obj["l" /* LIMIT */] = queryParams.limit_; - let viewFrom = queryParams.viewFrom_; - if (viewFrom === '') { - if (queryParams.isViewFromLeft()) { - viewFrom = "l" /* VIEW_FROM_LEFT */; - } - else { - viewFrom = "r" /* VIEW_FROM_RIGHT */; - } - } - obj["vf" /* VIEW_FROM */] = viewFrom; - } - // For now, priority index is the default, so we only specify if it's some other index - if (queryParams.index_ !== PRIORITY_INDEX) { - obj["i" /* INDEX */] = queryParams.index_.toString(); - } - return obj; -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * An implementation of ServerActions that communicates with the server via REST requests. - * This is mostly useful for compatibility with crawlers, where we don't want to spin up a full - * persistent connection (using WebSockets or long-polling) - */ -class ReadonlyRestClient extends ServerActions { - /** - * @param repoInfo_ - Data about the namespace we are connecting to - * @param onDataUpdate_ - A callback for new data from the server - */ - constructor(repoInfo_, onDataUpdate_, authTokenProvider_, appCheckTokenProvider_) { - super(); - this.repoInfo_ = repoInfo_; - this.onDataUpdate_ = onDataUpdate_; - this.authTokenProvider_ = authTokenProvider_; - this.appCheckTokenProvider_ = appCheckTokenProvider_; - /** @private {function(...[*])} */ - this.log_ = logWrapper('p:rest:'); - /** - * We don't actually need to track listens, except to prevent us calling an onComplete for a listen - * that's been removed. :-/ - */ - this.listens_ = {}; - } - reportStats(stats) { - throw new Error('Method not implemented.'); - } - static getListenId_(query, tag) { - if (tag !== undefined) { - return 'tag$' + tag; - } - else { - assert(query._queryParams.isDefault(), "should have a tag if it's not a default query."); - return query._path.toString(); - } - } - /** @inheritDoc */ - listen(query, currentHashFn, tag, onComplete) { - const pathString = query._path.toString(); - this.log_('Listen called for ' + pathString + ' ' + query._queryIdentifier); - // Mark this listener so we can tell if it's removed. - const listenId = ReadonlyRestClient.getListenId_(query, tag); - const thisListen = {}; - this.listens_[listenId] = thisListen; - const queryStringParameters = queryParamsToRestQueryStringParameters(query._queryParams); - this.restRequest_(pathString + '.json', queryStringParameters, (error, result) => { - let data = result; - if (error === 404) { - data = null; - error = null; - } - if (error === null) { - this.onDataUpdate_(pathString, data, /*isMerge=*/ false, tag); - } - if (safeGet(this.listens_, listenId) === thisListen) { - let status; - if (!error) { - status = 'ok'; - } - else if (error === 401) { - status = 'permission_denied'; - } - else { - status = 'rest_error:' + error; - } - onComplete(status, null); - } - }); - } - /** @inheritDoc */ - unlisten(query, tag) { - const listenId = ReadonlyRestClient.getListenId_(query, tag); - delete this.listens_[listenId]; - } - get(query) { - const queryStringParameters = queryParamsToRestQueryStringParameters(query._queryParams); - const pathString = query._path.toString(); - const deferred = new Deferred(); - this.restRequest_(pathString + '.json', queryStringParameters, (error, result) => { - let data = result; - if (error === 404) { - data = null; - error = null; - } - if (error === null) { - this.onDataUpdate_(pathString, data, - /*isMerge=*/ false, - /*tag=*/ null); - deferred.resolve(data); - } - else { - deferred.reject(new Error(data)); - } - }); - return deferred.promise; - } - /** @inheritDoc */ - refreshAuthToken(token) { - // no-op since we just always call getToken. - } - /** - * Performs a REST request to the given path, with the provided query string parameters, - * and any auth credentials we have. - */ - restRequest_(pathString, queryStringParameters = {}, callback) { - queryStringParameters['format'] = 'export'; - return Promise.all([ - this.authTokenProvider_.getToken(/*forceRefresh=*/ false), - this.appCheckTokenProvider_.getToken(/*forceRefresh=*/ false) - ]).then(([authToken, appCheckToken]) => { - if (authToken && authToken.accessToken) { - queryStringParameters['auth'] = authToken.accessToken; - } - if (appCheckToken && appCheckToken.token) { - queryStringParameters['ac'] = appCheckToken.token; - } - const url = (this.repoInfo_.secure ? 'https://' : 'http://') + - this.repoInfo_.host + - pathString + - '?' + - 'ns=' + - this.repoInfo_.namespace + - querystring(queryStringParameters); - this.log_('Sending REST request for ' + url); - const xhr = new XMLHttpRequest(); - xhr.onreadystatechange = () => { - if (callback && xhr.readyState === 4) { - this.log_('REST Response for ' + url + ' received. status:', xhr.status, 'response:', xhr.responseText); - let res = null; - if (xhr.status >= 200 && xhr.status < 300) { - try { - res = jsonEval(xhr.responseText); - } - catch (e) { - warn('Failed to parse JSON response for ' + - url + - ': ' + - xhr.responseText); - } - callback(null, res); - } - else { - // 401 and 404 are expected. - if (xhr.status !== 401 && xhr.status !== 404) { - warn('Got unsuccessful REST response for ' + - url + - ' Status: ' + - xhr.status); - } - callback(xhr.status); - } - callback = null; - } - }; - xhr.open('GET', url, /*asynchronous=*/ true); - xhr.send(); - }); - } -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Mutable object which basically just stores a reference to the "latest" immutable snapshot. - */ -class SnapshotHolder { - constructor() { - this.rootNode_ = ChildrenNode.EMPTY_NODE; - } - getNode(path) { - return this.rootNode_.getChild(path); - } - updateSnapshot(path, newSnapshotNode) { - this.rootNode_ = this.rootNode_.updateChild(path, newSnapshotNode); - } -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -function newSparseSnapshotTree() { - return { - value: null, - children: new Map() - }; -} -/** - * Stores the given node at the specified path. If there is already a node - * at a shallower path, it merges the new data into that snapshot node. - * - * @param path - Path to look up snapshot for. - * @param data - The new data, or null. - */ -function sparseSnapshotTreeRemember(sparseSnapshotTree, path, data) { - if (pathIsEmpty(path)) { - sparseSnapshotTree.value = data; - sparseSnapshotTree.children.clear(); - } - else if (sparseSnapshotTree.value !== null) { - sparseSnapshotTree.value = sparseSnapshotTree.value.updateChild(path, data); - } - else { - const childKey = pathGetFront(path); - if (!sparseSnapshotTree.children.has(childKey)) { - sparseSnapshotTree.children.set(childKey, newSparseSnapshotTree()); - } - const child = sparseSnapshotTree.children.get(childKey); - path = pathPopFront(path); - sparseSnapshotTreeRemember(child, path, data); - } -} -/** - * Purge the data at path from the cache. - * - * @param path - Path to look up snapshot for. - * @returns True if this node should now be removed. - */ -function sparseSnapshotTreeForget(sparseSnapshotTree, path) { - if (pathIsEmpty(path)) { - sparseSnapshotTree.value = null; - sparseSnapshotTree.children.clear(); - return true; - } - else { - if (sparseSnapshotTree.value !== null) { - if (sparseSnapshotTree.value.isLeafNode()) { - // We're trying to forget a node that doesn't exist - return false; - } - else { - const value = sparseSnapshotTree.value; - sparseSnapshotTree.value = null; - value.forEachChild(PRIORITY_INDEX, (key, tree) => { - sparseSnapshotTreeRemember(sparseSnapshotTree, new Path(key), tree); - }); - return sparseSnapshotTreeForget(sparseSnapshotTree, path); - } - } - else if (sparseSnapshotTree.children.size > 0) { - const childKey = pathGetFront(path); - path = pathPopFront(path); - if (sparseSnapshotTree.children.has(childKey)) { - const safeToRemove = sparseSnapshotTreeForget(sparseSnapshotTree.children.get(childKey), path); - if (safeToRemove) { - sparseSnapshotTree.children.delete(childKey); - } - } - return sparseSnapshotTree.children.size === 0; - } - else { - return true; - } - } -} -/** - * Recursively iterates through all of the stored tree and calls the - * callback on each one. - * - * @param prefixPath - Path to look up node for. - * @param func - The function to invoke for each tree. - */ -function sparseSnapshotTreeForEachTree(sparseSnapshotTree, prefixPath, func) { - if (sparseSnapshotTree.value !== null) { - func(prefixPath, sparseSnapshotTree.value); - } - else { - sparseSnapshotTreeForEachChild(sparseSnapshotTree, (key, tree) => { - const path = new Path(prefixPath.toString() + '/' + key); - sparseSnapshotTreeForEachTree(tree, path, func); - }); - } -} -/** - * Iterates through each immediate child and triggers the callback. - * Only seems to be used in tests. - * - * @param func - The function to invoke for each child. - */ -function sparseSnapshotTreeForEachChild(sparseSnapshotTree, func) { - sparseSnapshotTree.children.forEach((tree, key) => { - func(key, tree); - }); -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Returns the delta from the previous call to get stats. - * - * @param collection_ - The collection to "listen" to. - */ -class StatsListener { - constructor(collection_) { - this.collection_ = collection_; - this.last_ = null; - } - get() { - const newStats = this.collection_.get(); - const delta = Object.assign({}, newStats); - if (this.last_) { - each(this.last_, (stat, value) => { - delta[stat] = delta[stat] - value; - }); - } - this.last_ = newStats; - return delta; - } -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Assuming some apps may have a short amount of time on page, and a bulk of firebase operations probably -// happen on page load, we try to report our first set of stats pretty quickly, but we wait at least 10 -// seconds to try to ensure the Firebase connection is established / settled. -const FIRST_STATS_MIN_TIME = 10 * 1000; -const FIRST_STATS_MAX_TIME = 30 * 1000; -// We'll continue to report stats on average every 5 minutes. -const REPORT_STATS_INTERVAL = 5 * 60 * 1000; -class StatsReporter { - constructor(collection, server_) { - this.server_ = server_; - this.statsToReport_ = {}; - this.statsListener_ = new StatsListener(collection); - const timeout = FIRST_STATS_MIN_TIME + - (FIRST_STATS_MAX_TIME - FIRST_STATS_MIN_TIME) * Math.random(); - setTimeoutNonBlocking(this.reportStats_.bind(this), Math.floor(timeout)); - } - reportStats_() { - const stats = this.statsListener_.get(); - const reportedStats = {}; - let haveStatsToReport = false; - each(stats, (stat, value) => { - if (value > 0 && contains(this.statsToReport_, stat)) { - reportedStats[stat] = value; - haveStatsToReport = true; - } - }); - if (haveStatsToReport) { - this.server_.reportStats(reportedStats); - } - // queue our next run. - setTimeoutNonBlocking(this.reportStats_.bind(this), Math.floor(Math.random() * 2 * REPORT_STATS_INTERVAL)); - } -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * - * @enum - */ -var OperationType; -(function (OperationType) { - OperationType[OperationType["OVERWRITE"] = 0] = "OVERWRITE"; - OperationType[OperationType["MERGE"] = 1] = "MERGE"; - OperationType[OperationType["ACK_USER_WRITE"] = 2] = "ACK_USER_WRITE"; - OperationType[OperationType["LISTEN_COMPLETE"] = 3] = "LISTEN_COMPLETE"; -})(OperationType || (OperationType = {})); -function newOperationSourceUser() { - return { - fromUser: true, - fromServer: false, - queryId: null, - tagged: false - }; -} -function newOperationSourceServer() { - return { - fromUser: false, - fromServer: true, - queryId: null, - tagged: false - }; -} -function newOperationSourceServerTaggedQuery(queryId) { - return { - fromUser: false, - fromServer: true, - queryId, - tagged: true - }; -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -class AckUserWrite { - /** - * @param affectedTree - A tree containing true for each affected path. Affected paths can't overlap. - */ - constructor( - /** @inheritDoc */ path, - /** @inheritDoc */ affectedTree, - /** @inheritDoc */ revert) { - this.path = path; - this.affectedTree = affectedTree; - this.revert = revert; - /** @inheritDoc */ - this.type = OperationType.ACK_USER_WRITE; - /** @inheritDoc */ - this.source = newOperationSourceUser(); - } - operationForChild(childName) { - if (!pathIsEmpty(this.path)) { - assert(pathGetFront(this.path) === childName, 'operationForChild called for unrelated child.'); - return new AckUserWrite(pathPopFront(this.path), this.affectedTree, this.revert); - } - else if (this.affectedTree.value != null) { - assert(this.affectedTree.children.isEmpty(), 'affectedTree should not have overlapping affected paths.'); - // All child locations are affected as well; just return same operation. - return this; - } - else { - const childTree = this.affectedTree.subtree(new Path(childName)); - return new AckUserWrite(newEmptyPath(), childTree, this.revert); - } - } -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -class ListenComplete { - constructor(source, path) { - this.source = source; - this.path = path; - /** @inheritDoc */ - this.type = OperationType.LISTEN_COMPLETE; - } - operationForChild(childName) { - if (pathIsEmpty(this.path)) { - return new ListenComplete(this.source, newEmptyPath()); - } - else { - return new ListenComplete(this.source, pathPopFront(this.path)); - } - } -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -class Overwrite { - constructor(source, path, snap) { - this.source = source; - this.path = path; - this.snap = snap; - /** @inheritDoc */ - this.type = OperationType.OVERWRITE; - } - operationForChild(childName) { - if (pathIsEmpty(this.path)) { - return new Overwrite(this.source, newEmptyPath(), this.snap.getImmediateChild(childName)); - } - else { - return new Overwrite(this.source, pathPopFront(this.path), this.snap); - } - } -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -class Merge { - constructor( - /** @inheritDoc */ source, - /** @inheritDoc */ path, - /** @inheritDoc */ children) { - this.source = source; - this.path = path; - this.children = children; - /** @inheritDoc */ - this.type = OperationType.MERGE; - } - operationForChild(childName) { - if (pathIsEmpty(this.path)) { - const childTree = this.children.subtree(new Path(childName)); - if (childTree.isEmpty()) { - // This child is unaffected - return null; - } - else if (childTree.value) { - // We have a snapshot for the child in question. This becomes an overwrite of the child. - return new Overwrite(this.source, newEmptyPath(), childTree.value); - } - else { - // This is a merge at a deeper level - return new Merge(this.source, newEmptyPath(), childTree); - } - } - else { - assert(pathGetFront(this.path) === childName, "Can't get a merge for a child not on the path of the operation"); - return new Merge(this.source, pathPopFront(this.path), this.children); - } - } - toString() { - return ('Operation(' + - this.path + - ': ' + - this.source.toString() + - ' merge: ' + - this.children.toString() + - ')'); - } -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * A cache node only stores complete children. Additionally it holds a flag whether the node can be considered fully - * initialized in the sense that we know at one point in time this represented a valid state of the world, e.g. - * initialized with data from the server, or a complete overwrite by the client. The filtered flag also tracks - * whether a node potentially had children removed due to a filter. - */ -class CacheNode { - constructor(node_, fullyInitialized_, filtered_) { - this.node_ = node_; - this.fullyInitialized_ = fullyInitialized_; - this.filtered_ = filtered_; - } - /** - * Returns whether this node was fully initialized with either server data or a complete overwrite by the client - */ - isFullyInitialized() { - return this.fullyInitialized_; - } - /** - * Returns whether this node is potentially missing children due to a filter applied to the node - */ - isFiltered() { - return this.filtered_; - } - isCompleteForPath(path) { - if (pathIsEmpty(path)) { - return this.isFullyInitialized() && !this.filtered_; - } - const childKey = pathGetFront(path); - return this.isCompleteForChild(childKey); - } - isCompleteForChild(key) { - return ((this.isFullyInitialized() && !this.filtered_) || this.node_.hasChild(key)); - } - getNode() { - return this.node_; - } -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * An EventGenerator is used to convert "raw" changes (Change) as computed by the - * CacheDiffer into actual events (Event) that can be raised. See generateEventsForChanges() - * for details. - * - */ -class EventGenerator { - constructor(query_) { - this.query_ = query_; - this.index_ = this.query_._queryParams.getIndex(); - } -} -/** - * Given a set of raw changes (no moved events and prevName not specified yet), and a set of - * EventRegistrations that should be notified of these changes, generate the actual events to be raised. - * - * Notes: - * - child_moved events will be synthesized at this time for any child_changed events that affect - * our index. - * - prevName will be calculated based on the index ordering. - */ -function eventGeneratorGenerateEventsForChanges(eventGenerator, changes, eventCache, eventRegistrations) { - const events = []; - const moves = []; - changes.forEach(change => { - if (change.type === "child_changed" /* CHILD_CHANGED */ && - eventGenerator.index_.indexedValueChanged(change.oldSnap, change.snapshotNode)) { - moves.push(changeChildMoved(change.childName, change.snapshotNode)); - } - }); - eventGeneratorGenerateEventsForType(eventGenerator, events, "child_removed" /* CHILD_REMOVED */, changes, eventRegistrations, eventCache); - eventGeneratorGenerateEventsForType(eventGenerator, events, "child_added" /* CHILD_ADDED */, changes, eventRegistrations, eventCache); - eventGeneratorGenerateEventsForType(eventGenerator, events, "child_moved" /* CHILD_MOVED */, moves, eventRegistrations, eventCache); - eventGeneratorGenerateEventsForType(eventGenerator, events, "child_changed" /* CHILD_CHANGED */, changes, eventRegistrations, eventCache); - eventGeneratorGenerateEventsForType(eventGenerator, events, "value" /* VALUE */, changes, eventRegistrations, eventCache); - return events; -} -/** - * Given changes of a single change type, generate the corresponding events. - */ -function eventGeneratorGenerateEventsForType(eventGenerator, events, eventType, changes, registrations, eventCache) { - const filteredChanges = changes.filter(change => change.type === eventType); - filteredChanges.sort((a, b) => eventGeneratorCompareChanges(eventGenerator, a, b)); - filteredChanges.forEach(change => { - const materializedChange = eventGeneratorMaterializeSingleChange(eventGenerator, change, eventCache); - registrations.forEach(registration => { - if (registration.respondsTo(change.type)) { - events.push(registration.createEvent(materializedChange, eventGenerator.query_)); - } - }); - }); -} -function eventGeneratorMaterializeSingleChange(eventGenerator, change, eventCache) { - if (change.type === 'value' || change.type === 'child_removed') { - return change; - } - else { - change.prevName = eventCache.getPredecessorChildName(change.childName, change.snapshotNode, eventGenerator.index_); - return change; - } -} -function eventGeneratorCompareChanges(eventGenerator, a, b) { - if (a.childName == null || b.childName == null) { - throw assertionError('Should only compare child_ events.'); - } - const aWrapped = new NamedNode(a.childName, a.snapshotNode); - const bWrapped = new NamedNode(b.childName, b.snapshotNode); - return eventGenerator.index_.compare(aWrapped, bWrapped); -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -function newViewCache(eventCache, serverCache) { - return { eventCache, serverCache }; -} -function viewCacheUpdateEventSnap(viewCache, eventSnap, complete, filtered) { - return newViewCache(new CacheNode(eventSnap, complete, filtered), viewCache.serverCache); -} -function viewCacheUpdateServerSnap(viewCache, serverSnap, complete, filtered) { - return newViewCache(viewCache.eventCache, new CacheNode(serverSnap, complete, filtered)); -} -function viewCacheGetCompleteEventSnap(viewCache) { - return viewCache.eventCache.isFullyInitialized() - ? viewCache.eventCache.getNode() - : null; -} -function viewCacheGetCompleteServerSnap(viewCache) { - return viewCache.serverCache.isFullyInitialized() - ? viewCache.serverCache.getNode() - : null; -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -let emptyChildrenSingleton; -/** - * Singleton empty children collection. - * - */ -const EmptyChildren = () => { - if (!emptyChildrenSingleton) { - emptyChildrenSingleton = new SortedMap(stringCompare); - } - return emptyChildrenSingleton; -}; -/** - * A tree with immutable elements. - */ -class ImmutableTree { - constructor(value, children = EmptyChildren()) { - this.value = value; - this.children = children; - } - static fromObject(obj) { - let tree = new ImmutableTree(null); - each(obj, (childPath, childSnap) => { - tree = tree.set(new Path(childPath), childSnap); - }); - return tree; - } - /** - * True if the value is empty and there are no children - */ - isEmpty() { - return this.value === null && this.children.isEmpty(); - } - /** - * Given a path and predicate, return the first node and the path to that node - * where the predicate returns true. - * - * TODO Do a perf test -- If we're creating a bunch of `{path: value:}` - * objects on the way back out, it may be better to pass down a pathSoFar obj. - * - * @param relativePath - The remainder of the path - * @param predicate - The predicate to satisfy to return a node - */ - findRootMostMatchingPathAndValue(relativePath, predicate) { - if (this.value != null && predicate(this.value)) { - return { path: newEmptyPath(), value: this.value }; - } - else { - if (pathIsEmpty(relativePath)) { - return null; - } - else { - const front = pathGetFront(relativePath); - const child = this.children.get(front); - if (child !== null) { - const childExistingPathAndValue = child.findRootMostMatchingPathAndValue(pathPopFront(relativePath), predicate); - if (childExistingPathAndValue != null) { - const fullPath = pathChild(new Path(front), childExistingPathAndValue.path); - return { path: fullPath, value: childExistingPathAndValue.value }; - } - else { - return null; - } - } - else { - return null; - } - } - } - } - /** - * Find, if it exists, the shortest subpath of the given path that points a defined - * value in the tree - */ - findRootMostValueAndPath(relativePath) { - return this.findRootMostMatchingPathAndValue(relativePath, () => true); - } - /** - * @returns The subtree at the given path - */ - subtree(relativePath) { - if (pathIsEmpty(relativePath)) { - return this; - } - else { - const front = pathGetFront(relativePath); - const childTree = this.children.get(front); - if (childTree !== null) { - return childTree.subtree(pathPopFront(relativePath)); - } - else { - return new ImmutableTree(null); - } - } - } - /** - * Sets a value at the specified path. - * - * @param relativePath - Path to set value at. - * @param toSet - Value to set. - * @returns Resulting tree. - */ - set(relativePath, toSet) { - if (pathIsEmpty(relativePath)) { - return new ImmutableTree(toSet, this.children); - } - else { - const front = pathGetFront(relativePath); - const child = this.children.get(front) || new ImmutableTree(null); - const newChild = child.set(pathPopFront(relativePath), toSet); - const newChildren = this.children.insert(front, newChild); - return new ImmutableTree(this.value, newChildren); - } - } - /** - * Removes the value at the specified path. - * - * @param relativePath - Path to value to remove. - * @returns Resulting tree. - */ - remove(relativePath) { - if (pathIsEmpty(relativePath)) { - if (this.children.isEmpty()) { - return new ImmutableTree(null); - } - else { - return new ImmutableTree(null, this.children); - } - } - else { - const front = pathGetFront(relativePath); - const child = this.children.get(front); - if (child) { - const newChild = child.remove(pathPopFront(relativePath)); - let newChildren; - if (newChild.isEmpty()) { - newChildren = this.children.remove(front); - } - else { - newChildren = this.children.insert(front, newChild); - } - if (this.value === null && newChildren.isEmpty()) { - return new ImmutableTree(null); - } - else { - return new ImmutableTree(this.value, newChildren); - } - } - else { - return this; - } - } - } - /** - * Gets a value from the tree. - * - * @param relativePath - Path to get value for. - * @returns Value at path, or null. - */ - get(relativePath) { - if (pathIsEmpty(relativePath)) { - return this.value; - } - else { - const front = pathGetFront(relativePath); - const child = this.children.get(front); - if (child) { - return child.get(pathPopFront(relativePath)); - } - else { - return null; - } - } - } - /** - * Replace the subtree at the specified path with the given new tree. - * - * @param relativePath - Path to replace subtree for. - * @param newTree - New tree. - * @returns Resulting tree. - */ - setTree(relativePath, newTree) { - if (pathIsEmpty(relativePath)) { - return newTree; - } - else { - const front = pathGetFront(relativePath); - const child = this.children.get(front) || new ImmutableTree(null); - const newChild = child.setTree(pathPopFront(relativePath), newTree); - let newChildren; - if (newChild.isEmpty()) { - newChildren = this.children.remove(front); - } - else { - newChildren = this.children.insert(front, newChild); - } - return new ImmutableTree(this.value, newChildren); - } - } - /** - * Performs a depth first fold on this tree. Transforms a tree into a single - * value, given a function that operates on the path to a node, an optional - * current value, and a map of child names to folded subtrees - */ - fold(fn) { - return this.fold_(newEmptyPath(), fn); - } - /** - * Recursive helper for public-facing fold() method - */ - fold_(pathSoFar, fn) { - const accum = {}; - this.children.inorderTraversal((childKey, childTree) => { - accum[childKey] = childTree.fold_(pathChild(pathSoFar, childKey), fn); - }); - return fn(pathSoFar, this.value, accum); - } - /** - * Find the first matching value on the given path. Return the result of applying f to it. - */ - findOnPath(path, f) { - return this.findOnPath_(path, newEmptyPath(), f); - } - findOnPath_(pathToFollow, pathSoFar, f) { - const result = this.value ? f(pathSoFar, this.value) : false; - if (result) { - return result; - } - else { - if (pathIsEmpty(pathToFollow)) { - return null; - } - else { - const front = pathGetFront(pathToFollow); - const nextChild = this.children.get(front); - if (nextChild) { - return nextChild.findOnPath_(pathPopFront(pathToFollow), pathChild(pathSoFar, front), f); - } - else { - return null; - } - } - } - } - foreachOnPath(path, f) { - return this.foreachOnPath_(path, newEmptyPath(), f); - } - foreachOnPath_(pathToFollow, currentRelativePath, f) { - if (pathIsEmpty(pathToFollow)) { - return this; - } - else { - if (this.value) { - f(currentRelativePath, this.value); - } - const front = pathGetFront(pathToFollow); - const nextChild = this.children.get(front); - if (nextChild) { - return nextChild.foreachOnPath_(pathPopFront(pathToFollow), pathChild(currentRelativePath, front), f); - } - else { - return new ImmutableTree(null); - } - } - } - /** - * Calls the given function for each node in the tree that has a value. - * - * @param f - A function to be called with the path from the root of the tree to - * a node, and the value at that node. Called in depth-first order. - */ - foreach(f) { - this.foreach_(newEmptyPath(), f); - } - foreach_(currentRelativePath, f) { - this.children.inorderTraversal((childName, childTree) => { - childTree.foreach_(pathChild(currentRelativePath, childName), f); - }); - if (this.value) { - f(currentRelativePath, this.value); - } - } - foreachChild(f) { - this.children.inorderTraversal((childName, childTree) => { - if (childTree.value) { - f(childName, childTree.value); - } - }); - } -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * This class holds a collection of writes that can be applied to nodes in unison. It abstracts away the logic with - * dealing with priority writes and multiple nested writes. At any given path there is only allowed to be one write - * modifying that path. Any write to an existing path or shadowing an existing path will modify that existing write - * to reflect the write added. - */ -class CompoundWrite { - constructor(writeTree_) { - this.writeTree_ = writeTree_; - } - static empty() { - return new CompoundWrite(new ImmutableTree(null)); - } -} -function compoundWriteAddWrite(compoundWrite, path, node) { - if (pathIsEmpty(path)) { - return new CompoundWrite(new ImmutableTree(node)); - } - else { - const rootmost = compoundWrite.writeTree_.findRootMostValueAndPath(path); - if (rootmost != null) { - const rootMostPath = rootmost.path; - let value = rootmost.value; - const relativePath = newRelativePath(rootMostPath, path); - value = value.updateChild(relativePath, node); - return new CompoundWrite(compoundWrite.writeTree_.set(rootMostPath, value)); - } - else { - const subtree = new ImmutableTree(node); - const newWriteTree = compoundWrite.writeTree_.setTree(path, subtree); - return new CompoundWrite(newWriteTree); - } - } -} -function compoundWriteAddWrites(compoundWrite, path, updates) { - let newWrite = compoundWrite; - each(updates, (childKey, node) => { - newWrite = compoundWriteAddWrite(newWrite, pathChild(path, childKey), node); - }); - return newWrite; -} -/** - * Will remove a write at the given path and deeper paths. This will not modify a write at a higher - * location, which must be removed by calling this method with that path. - * - * @param compoundWrite - The CompoundWrite to remove. - * @param path - The path at which a write and all deeper writes should be removed - * @returns The new CompoundWrite with the removed path - */ -function compoundWriteRemoveWrite(compoundWrite, path) { - if (pathIsEmpty(path)) { - return CompoundWrite.empty(); - } - else { - const newWriteTree = compoundWrite.writeTree_.setTree(path, new ImmutableTree(null)); - return new CompoundWrite(newWriteTree); - } -} -/** - * Returns whether this CompoundWrite will fully overwrite a node at a given location and can therefore be - * considered "complete". - * - * @param compoundWrite - The CompoundWrite to check. - * @param path - The path to check for - * @returns Whether there is a complete write at that path - */ -function compoundWriteHasCompleteWrite(compoundWrite, path) { - return compoundWriteGetCompleteNode(compoundWrite, path) != null; -} -/** - * Returns a node for a path if and only if the node is a "complete" overwrite at that path. This will not aggregate - * writes from deeper paths, but will return child nodes from a more shallow path. - * - * @param compoundWrite - The CompoundWrite to get the node from. - * @param path - The path to get a complete write - * @returns The node if complete at that path, or null otherwise. - */ -function compoundWriteGetCompleteNode(compoundWrite, path) { - const rootmost = compoundWrite.writeTree_.findRootMostValueAndPath(path); - if (rootmost != null) { - return compoundWrite.writeTree_ - .get(rootmost.path) - .getChild(newRelativePath(rootmost.path, path)); - } - else { - return null; - } -} -/** - * Returns all children that are guaranteed to be a complete overwrite. - * - * @param compoundWrite - The CompoundWrite to get children from. - * @returns A list of all complete children. - */ -function compoundWriteGetCompleteChildren(compoundWrite) { - const children = []; - const node = compoundWrite.writeTree_.value; - if (node != null) { - // If it's a leaf node, it has no children; so nothing to do. - if (!node.isLeafNode()) { - node.forEachChild(PRIORITY_INDEX, (childName, childNode) => { - children.push(new NamedNode(childName, childNode)); - }); - } - } - else { - compoundWrite.writeTree_.children.inorderTraversal((childName, childTree) => { - if (childTree.value != null) { - children.push(new NamedNode(childName, childTree.value)); - } - }); - } - return children; -} -function compoundWriteChildCompoundWrite(compoundWrite, path) { - if (pathIsEmpty(path)) { - return compoundWrite; - } - else { - const shadowingNode = compoundWriteGetCompleteNode(compoundWrite, path); - if (shadowingNode != null) { - return new CompoundWrite(new ImmutableTree(shadowingNode)); - } - else { - return new CompoundWrite(compoundWrite.writeTree_.subtree(path)); - } - } -} -/** - * Returns true if this CompoundWrite is empty and therefore does not modify any nodes. - * @returns Whether this CompoundWrite is empty - */ -function compoundWriteIsEmpty(compoundWrite) { - return compoundWrite.writeTree_.isEmpty(); -} -/** - * Applies this CompoundWrite to a node. The node is returned with all writes from this CompoundWrite applied to the - * node - * @param node - The node to apply this CompoundWrite to - * @returns The node with all writes applied - */ -function compoundWriteApply(compoundWrite, node) { - return applySubtreeWrite(newEmptyPath(), compoundWrite.writeTree_, node); -} -function applySubtreeWrite(relativePath, writeTree, node) { - if (writeTree.value != null) { - // Since there a write is always a leaf, we're done here - return node.updateChild(relativePath, writeTree.value); - } - else { - let priorityWrite = null; - writeTree.children.inorderTraversal((childKey, childTree) => { - if (childKey === '.priority') { - // Apply priorities at the end so we don't update priorities for either empty nodes or forget - // to apply priorities to empty nodes that are later filled - assert(childTree.value !== null, 'Priority writes must always be leaf nodes'); - priorityWrite = childTree.value; - } - else { - node = applySubtreeWrite(pathChild(relativePath, childKey), childTree, node); - } - }); - // If there was a priority write, we only apply it if the node is not empty - if (!node.getChild(relativePath).isEmpty() && priorityWrite !== null) { - node = node.updateChild(pathChild(relativePath, '.priority'), priorityWrite); - } - return node; - } -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Create a new WriteTreeRef for the given path. For use with a new sync point at the given path. - * - */ -function writeTreeChildWrites(writeTree, path) { - return newWriteTreeRef(path, writeTree); -} -/** - * Record a new overwrite from user code. - * - * @param visible - This is set to false by some transactions. It should be excluded from event caches - */ -function writeTreeAddOverwrite(writeTree, path, snap, writeId, visible) { - assert(writeId > writeTree.lastWriteId, 'Stacking an older write on top of newer ones'); - if (visible === undefined) { - visible = true; - } - writeTree.allWrites.push({ - path, - snap, - writeId, - visible - }); - if (visible) { - writeTree.visibleWrites = compoundWriteAddWrite(writeTree.visibleWrites, path, snap); - } - writeTree.lastWriteId = writeId; -} -/** - * Record a new merge from user code. - */ -function writeTreeAddMerge(writeTree, path, changedChildren, writeId) { - assert(writeId > writeTree.lastWriteId, 'Stacking an older merge on top of newer ones'); - writeTree.allWrites.push({ - path, - children: changedChildren, - writeId, - visible: true - }); - writeTree.visibleWrites = compoundWriteAddWrites(writeTree.visibleWrites, path, changedChildren); - writeTree.lastWriteId = writeId; -} -function writeTreeGetWrite(writeTree, writeId) { - for (let i = 0; i < writeTree.allWrites.length; i++) { - const record = writeTree.allWrites[i]; - if (record.writeId === writeId) { - return record; - } - } - return null; -} -/** - * Remove a write (either an overwrite or merge) that has been successfully acknowledge by the server. Recalculates - * the tree if necessary. We return true if it may have been visible, meaning views need to reevaluate. - * - * @returns true if the write may have been visible (meaning we'll need to reevaluate / raise - * events as a result). - */ -function writeTreeRemoveWrite(writeTree, writeId) { - // Note: disabling this check. It could be a transaction that preempted another transaction, and thus was applied - // out of order. - //const validClear = revert || this.allWrites_.length === 0 || writeId <= this.allWrites_[0].writeId; - //assert(validClear, "Either we don't have this write, or it's the first one in the queue"); - const idx = writeTree.allWrites.findIndex(s => { - return s.writeId === writeId; - }); - assert(idx >= 0, 'removeWrite called with nonexistent writeId.'); - const writeToRemove = writeTree.allWrites[idx]; - writeTree.allWrites.splice(idx, 1); - let removedWriteWasVisible = writeToRemove.visible; - let removedWriteOverlapsWithOtherWrites = false; - let i = writeTree.allWrites.length - 1; - while (removedWriteWasVisible && i >= 0) { - const currentWrite = writeTree.allWrites[i]; - if (currentWrite.visible) { - if (i >= idx && - writeTreeRecordContainsPath_(currentWrite, writeToRemove.path)) { - // The removed write was completely shadowed by a subsequent write. - removedWriteWasVisible = false; - } - else if (pathContains(writeToRemove.path, currentWrite.path)) { - // Either we're covering some writes or they're covering part of us (depending on which came first). - removedWriteOverlapsWithOtherWrites = true; - } - } - i--; - } - if (!removedWriteWasVisible) { - return false; - } - else if (removedWriteOverlapsWithOtherWrites) { - // There's some shadowing going on. Just rebuild the visible writes from scratch. - writeTreeResetTree_(writeTree); - return true; - } - else { - // There's no shadowing. We can safely just remove the write(s) from visibleWrites. - if (writeToRemove.snap) { - writeTree.visibleWrites = compoundWriteRemoveWrite(writeTree.visibleWrites, writeToRemove.path); - } - else { - const children = writeToRemove.children; - each(children, (childName) => { - writeTree.visibleWrites = compoundWriteRemoveWrite(writeTree.visibleWrites, pathChild(writeToRemove.path, childName)); - }); - } - return true; - } -} -function writeTreeRecordContainsPath_(writeRecord, path) { - if (writeRecord.snap) { - return pathContains(writeRecord.path, path); - } - else { - for (const childName in writeRecord.children) { - if (writeRecord.children.hasOwnProperty(childName) && - pathContains(pathChild(writeRecord.path, childName), path)) { - return true; - } - } - return false; - } -} -/** - * Re-layer the writes and merges into a tree so we can efficiently calculate event snapshots - */ -function writeTreeResetTree_(writeTree) { - writeTree.visibleWrites = writeTreeLayerTree_(writeTree.allWrites, writeTreeDefaultFilter_, newEmptyPath()); - if (writeTree.allWrites.length > 0) { - writeTree.lastWriteId = - writeTree.allWrites[writeTree.allWrites.length - 1].writeId; - } - else { - writeTree.lastWriteId = -1; - } -} -/** - * The default filter used when constructing the tree. Keep everything that's visible. - */ -function writeTreeDefaultFilter_(write) { - return write.visible; -} -/** - * Static method. Given an array of WriteRecords, a filter for which ones to include, and a path, construct the tree of - * event data at that path. - */ -function writeTreeLayerTree_(writes, filter, treeRoot) { - let compoundWrite = CompoundWrite.empty(); - for (let i = 0; i < writes.length; ++i) { - const write = writes[i]; - // Theory, a later set will either: - // a) abort a relevant transaction, so no need to worry about excluding it from calculating that transaction - // b) not be relevant to a transaction (separate branch), so again will not affect the data for that transaction - if (filter(write)) { - const writePath = write.path; - let relativePath; - if (write.snap) { - if (pathContains(treeRoot, writePath)) { - relativePath = newRelativePath(treeRoot, writePath); - compoundWrite = compoundWriteAddWrite(compoundWrite, relativePath, write.snap); - } - else if (pathContains(writePath, treeRoot)) { - relativePath = newRelativePath(writePath, treeRoot); - compoundWrite = compoundWriteAddWrite(compoundWrite, newEmptyPath(), write.snap.getChild(relativePath)); - } - else ; - } - else if (write.children) { - if (pathContains(treeRoot, writePath)) { - relativePath = newRelativePath(treeRoot, writePath); - compoundWrite = compoundWriteAddWrites(compoundWrite, relativePath, write.children); - } - else if (pathContains(writePath, treeRoot)) { - relativePath = newRelativePath(writePath, treeRoot); - if (pathIsEmpty(relativePath)) { - compoundWrite = compoundWriteAddWrites(compoundWrite, newEmptyPath(), write.children); - } - else { - const child = safeGet(write.children, pathGetFront(relativePath)); - if (child) { - // There exists a child in this node that matches the root path - const deepNode = child.getChild(pathPopFront(relativePath)); - compoundWrite = compoundWriteAddWrite(compoundWrite, newEmptyPath(), deepNode); - } - } - } - else ; - } - else { - throw assertionError('WriteRecord should have .snap or .children'); - } - } - } - return compoundWrite; -} -/** - * Given optional, underlying server data, and an optional set of constraints (exclude some sets, include hidden - * writes), attempt to calculate a complete snapshot for the given path - * - * @param writeIdsToExclude - An optional set to be excluded - * @param includeHiddenWrites - Defaults to false, whether or not to layer on writes with visible set to false - */ -function writeTreeCalcCompleteEventCache(writeTree, treePath, completeServerCache, writeIdsToExclude, includeHiddenWrites) { - if (!writeIdsToExclude && !includeHiddenWrites) { - const shadowingNode = compoundWriteGetCompleteNode(writeTree.visibleWrites, treePath); - if (shadowingNode != null) { - return shadowingNode; - } - else { - const subMerge = compoundWriteChildCompoundWrite(writeTree.visibleWrites, treePath); - if (compoundWriteIsEmpty(subMerge)) { - return completeServerCache; - } - else if (completeServerCache == null && - !compoundWriteHasCompleteWrite(subMerge, newEmptyPath())) { - // We wouldn't have a complete snapshot, since there's no underlying data and no complete shadow - return null; - } - else { - const layeredCache = completeServerCache || ChildrenNode.EMPTY_NODE; - return compoundWriteApply(subMerge, layeredCache); - } - } - } - else { - const merge = compoundWriteChildCompoundWrite(writeTree.visibleWrites, treePath); - if (!includeHiddenWrites && compoundWriteIsEmpty(merge)) { - return completeServerCache; - } - else { - // If the server cache is null, and we don't have a complete cache, we need to return null - if (!includeHiddenWrites && - completeServerCache == null && - !compoundWriteHasCompleteWrite(merge, newEmptyPath())) { - return null; - } - else { - const filter = function (write) { - return ((write.visible || includeHiddenWrites) && - (!writeIdsToExclude || - !~writeIdsToExclude.indexOf(write.writeId)) && - (pathContains(write.path, treePath) || - pathContains(treePath, write.path))); - }; - const mergeAtPath = writeTreeLayerTree_(writeTree.allWrites, filter, treePath); - const layeredCache = completeServerCache || ChildrenNode.EMPTY_NODE; - return compoundWriteApply(mergeAtPath, layeredCache); - } - } - } -} -/** - * With optional, underlying server data, attempt to return a children node of children that we have complete data for. - * Used when creating new views, to pre-fill their complete event children snapshot. - */ -function writeTreeCalcCompleteEventChildren(writeTree, treePath, completeServerChildren) { - let completeChildren = ChildrenNode.EMPTY_NODE; - const topLevelSet = compoundWriteGetCompleteNode(writeTree.visibleWrites, treePath); - if (topLevelSet) { - if (!topLevelSet.isLeafNode()) { - // we're shadowing everything. Return the children. - topLevelSet.forEachChild(PRIORITY_INDEX, (childName, childSnap) => { - completeChildren = completeChildren.updateImmediateChild(childName, childSnap); - }); - } - return completeChildren; - } - else if (completeServerChildren) { - // Layer any children we have on top of this - // We know we don't have a top-level set, so just enumerate existing children - const merge = compoundWriteChildCompoundWrite(writeTree.visibleWrites, treePath); - completeServerChildren.forEachChild(PRIORITY_INDEX, (childName, childNode) => { - const node = compoundWriteApply(compoundWriteChildCompoundWrite(merge, new Path(childName)), childNode); - completeChildren = completeChildren.updateImmediateChild(childName, node); - }); - // Add any complete children we have from the set - compoundWriteGetCompleteChildren(merge).forEach(namedNode => { - completeChildren = completeChildren.updateImmediateChild(namedNode.name, namedNode.node); - }); - return completeChildren; - } - else { - // We don't have anything to layer on top of. Layer on any children we have - // Note that we can return an empty snap if we have a defined delete - const merge = compoundWriteChildCompoundWrite(writeTree.visibleWrites, treePath); - compoundWriteGetCompleteChildren(merge).forEach(namedNode => { - completeChildren = completeChildren.updateImmediateChild(namedNode.name, namedNode.node); - }); - return completeChildren; - } -} -/** - * Given that the underlying server data has updated, determine what, if anything, needs to be - * applied to the event cache. - * - * Possibilities: - * - * 1. No writes are shadowing. Events should be raised, the snap to be applied comes from the server data - * - * 2. Some write is completely shadowing. No events to be raised - * - * 3. Is partially shadowed. Events - * - * Either existingEventSnap or existingServerSnap must exist - */ -function writeTreeCalcEventCacheAfterServerOverwrite(writeTree, treePath, childPath, existingEventSnap, existingServerSnap) { - assert(existingEventSnap || existingServerSnap, 'Either existingEventSnap or existingServerSnap must exist'); - const path = pathChild(treePath, childPath); - if (compoundWriteHasCompleteWrite(writeTree.visibleWrites, path)) { - // At this point we can probably guarantee that we're in case 2, meaning no events - // May need to check visibility while doing the findRootMostValueAndPath call - return null; - } - else { - // No complete shadowing. We're either partially shadowing or not shadowing at all. - const childMerge = compoundWriteChildCompoundWrite(writeTree.visibleWrites, path); - if (compoundWriteIsEmpty(childMerge)) { - // We're not shadowing at all. Case 1 - return existingServerSnap.getChild(childPath); - } - else { - // This could be more efficient if the serverNode + updates doesn't change the eventSnap - // However this is tricky to find out, since user updates don't necessary change the server - // snap, e.g. priority updates on empty nodes, or deep deletes. Another special case is if the server - // adds nodes, but doesn't change any existing writes. It is therefore not enough to - // only check if the updates change the serverNode. - // Maybe check if the merge tree contains these special cases and only do a full overwrite in that case? - return compoundWriteApply(childMerge, existingServerSnap.getChild(childPath)); - } - } -} -/** - * Returns a complete child for a given server snap after applying all user writes or null if there is no - * complete child for this ChildKey. - */ -function writeTreeCalcCompleteChild(writeTree, treePath, childKey, existingServerSnap) { - const path = pathChild(treePath, childKey); - const shadowingNode = compoundWriteGetCompleteNode(writeTree.visibleWrites, path); - if (shadowingNode != null) { - return shadowingNode; - } - else { - if (existingServerSnap.isCompleteForChild(childKey)) { - const childMerge = compoundWriteChildCompoundWrite(writeTree.visibleWrites, path); - return compoundWriteApply(childMerge, existingServerSnap.getNode().getImmediateChild(childKey)); - } - else { - return null; - } - } -} -/** - * Returns a node if there is a complete overwrite for this path. More specifically, if there is a write at - * a higher path, this will return the child of that write relative to the write and this path. - * Returns null if there is no write at this path. - */ -function writeTreeShadowingWrite(writeTree, path) { - return compoundWriteGetCompleteNode(writeTree.visibleWrites, path); -} -/** - * This method is used when processing child remove events on a query. If we can, we pull in children that were outside - * the window, but may now be in the window. - */ -function writeTreeCalcIndexedSlice(writeTree, treePath, completeServerData, startPost, count, reverse, index) { - let toIterate; - const merge = compoundWriteChildCompoundWrite(writeTree.visibleWrites, treePath); - const shadowingNode = compoundWriteGetCompleteNode(merge, newEmptyPath()); - if (shadowingNode != null) { - toIterate = shadowingNode; - } - else if (completeServerData != null) { - toIterate = compoundWriteApply(merge, completeServerData); - } - else { - // no children to iterate on - return []; - } - toIterate = toIterate.withIndex(index); - if (!toIterate.isEmpty() && !toIterate.isLeafNode()) { - const nodes = []; - const cmp = index.getCompare(); - const iter = reverse - ? toIterate.getReverseIteratorFrom(startPost, index) - : toIterate.getIteratorFrom(startPost, index); - let next = iter.getNext(); - while (next && nodes.length < count) { - if (cmp(next, startPost) !== 0) { - nodes.push(next); - } - next = iter.getNext(); - } - return nodes; - } - else { - return []; - } -} -function newWriteTree() { - return { - visibleWrites: CompoundWrite.empty(), - allWrites: [], - lastWriteId: -1 - }; -} -/** - * If possible, returns a complete event cache, using the underlying server data if possible. In addition, can be used - * to get a cache that includes hidden writes, and excludes arbitrary writes. Note that customizing the returned node - * can lead to a more expensive calculation. - * - * @param writeIdsToExclude - Optional writes to exclude. - * @param includeHiddenWrites - Defaults to false, whether or not to layer on writes with visible set to false - */ -function writeTreeRefCalcCompleteEventCache(writeTreeRef, completeServerCache, writeIdsToExclude, includeHiddenWrites) { - return writeTreeCalcCompleteEventCache(writeTreeRef.writeTree, writeTreeRef.treePath, completeServerCache, writeIdsToExclude, includeHiddenWrites); -} -/** - * If possible, returns a children node containing all of the complete children we have data for. The returned data is a - * mix of the given server data and write data. - * - */ -function writeTreeRefCalcCompleteEventChildren(writeTreeRef, completeServerChildren) { - return writeTreeCalcCompleteEventChildren(writeTreeRef.writeTree, writeTreeRef.treePath, completeServerChildren); -} -/** - * Given that either the underlying server data has updated or the outstanding writes have updated, determine what, - * if anything, needs to be applied to the event cache. - * - * Possibilities: - * - * 1. No writes are shadowing. Events should be raised, the snap to be applied comes from the server data - * - * 2. Some write is completely shadowing. No events to be raised - * - * 3. Is partially shadowed. Events should be raised - * - * Either existingEventSnap or existingServerSnap must exist, this is validated via an assert - * - * - */ -function writeTreeRefCalcEventCacheAfterServerOverwrite(writeTreeRef, path, existingEventSnap, existingServerSnap) { - return writeTreeCalcEventCacheAfterServerOverwrite(writeTreeRef.writeTree, writeTreeRef.treePath, path, existingEventSnap, existingServerSnap); -} -/** - * Returns a node if there is a complete overwrite for this path. More specifically, if there is a write at - * a higher path, this will return the child of that write relative to the write and this path. - * Returns null if there is no write at this path. - * - */ -function writeTreeRefShadowingWrite(writeTreeRef, path) { - return writeTreeShadowingWrite(writeTreeRef.writeTree, pathChild(writeTreeRef.treePath, path)); -} -/** - * This method is used when processing child remove events on a query. If we can, we pull in children that were outside - * the window, but may now be in the window - */ -function writeTreeRefCalcIndexedSlice(writeTreeRef, completeServerData, startPost, count, reverse, index) { - return writeTreeCalcIndexedSlice(writeTreeRef.writeTree, writeTreeRef.treePath, completeServerData, startPost, count, reverse, index); -} -/** - * Returns a complete child for a given server snap after applying all user writes or null if there is no - * complete child for this ChildKey. - */ -function writeTreeRefCalcCompleteChild(writeTreeRef, childKey, existingServerCache) { - return writeTreeCalcCompleteChild(writeTreeRef.writeTree, writeTreeRef.treePath, childKey, existingServerCache); -} -/** - * Return a WriteTreeRef for a child. - */ -function writeTreeRefChild(writeTreeRef, childName) { - return newWriteTreeRef(pathChild(writeTreeRef.treePath, childName), writeTreeRef.writeTree); -} -function newWriteTreeRef(path, writeTree) { - return { - treePath: path, - writeTree - }; -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -class ChildChangeAccumulator { - constructor() { - this.changeMap = new Map(); - } - trackChildChange(change) { - const type = change.type; - const childKey = change.childName; - assert(type === "child_added" /* CHILD_ADDED */ || - type === "child_changed" /* CHILD_CHANGED */ || - type === "child_removed" /* CHILD_REMOVED */, 'Only child changes supported for tracking'); - assert(childKey !== '.priority', 'Only non-priority child changes can be tracked.'); - const oldChange = this.changeMap.get(childKey); - if (oldChange) { - const oldType = oldChange.type; - if (type === "child_added" /* CHILD_ADDED */ && - oldType === "child_removed" /* CHILD_REMOVED */) { - this.changeMap.set(childKey, changeChildChanged(childKey, change.snapshotNode, oldChange.snapshotNode)); - } - else if (type === "child_removed" /* CHILD_REMOVED */ && - oldType === "child_added" /* CHILD_ADDED */) { - this.changeMap.delete(childKey); - } - else if (type === "child_removed" /* CHILD_REMOVED */ && - oldType === "child_changed" /* CHILD_CHANGED */) { - this.changeMap.set(childKey, changeChildRemoved(childKey, oldChange.oldSnap)); - } - else if (type === "child_changed" /* CHILD_CHANGED */ && - oldType === "child_added" /* CHILD_ADDED */) { - this.changeMap.set(childKey, changeChildAdded(childKey, change.snapshotNode)); - } - else if (type === "child_changed" /* CHILD_CHANGED */ && - oldType === "child_changed" /* CHILD_CHANGED */) { - this.changeMap.set(childKey, changeChildChanged(childKey, change.snapshotNode, oldChange.oldSnap)); - } - else { - throw assertionError('Illegal combination of changes: ' + - change + - ' occurred after ' + - oldChange); - } - } - else { - this.changeMap.set(childKey, change); - } - } - getChanges() { - return Array.from(this.changeMap.values()); - } -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * An implementation of CompleteChildSource that never returns any additional children - */ -// eslint-disable-next-line @typescript-eslint/naming-convention -class NoCompleteChildSource_ { - getCompleteChild(childKey) { - return null; - } - getChildAfterChild(index, child, reverse) { - return null; - } -} -/** - * Singleton instance. - */ -const NO_COMPLETE_CHILD_SOURCE = new NoCompleteChildSource_(); -/** - * An implementation of CompleteChildSource that uses a WriteTree in addition to any other server data or - * old event caches available to calculate complete children. - */ -class WriteTreeCompleteChildSource { - constructor(writes_, viewCache_, optCompleteServerCache_ = null) { - this.writes_ = writes_; - this.viewCache_ = viewCache_; - this.optCompleteServerCache_ = optCompleteServerCache_; - } - getCompleteChild(childKey) { - const node = this.viewCache_.eventCache; - if (node.isCompleteForChild(childKey)) { - return node.getNode().getImmediateChild(childKey); - } - else { - const serverNode = this.optCompleteServerCache_ != null - ? new CacheNode(this.optCompleteServerCache_, true, false) - : this.viewCache_.serverCache; - return writeTreeRefCalcCompleteChild(this.writes_, childKey, serverNode); - } - } - getChildAfterChild(index, child, reverse) { - const completeServerData = this.optCompleteServerCache_ != null - ? this.optCompleteServerCache_ - : viewCacheGetCompleteServerSnap(this.viewCache_); - const nodes = writeTreeRefCalcIndexedSlice(this.writes_, completeServerData, child, 1, reverse, index); - if (nodes.length === 0) { - return null; - } - else { - return nodes[0]; - } - } -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -function newViewProcessor(filter) { - return { filter }; -} -function viewProcessorAssertIndexed(viewProcessor, viewCache) { - assert(viewCache.eventCache.getNode().isIndexed(viewProcessor.filter.getIndex()), 'Event snap not indexed'); - assert(viewCache.serverCache.getNode().isIndexed(viewProcessor.filter.getIndex()), 'Server snap not indexed'); -} -function viewProcessorApplyOperation(viewProcessor, oldViewCache, operation, writesCache, completeCache) { - const accumulator = new ChildChangeAccumulator(); - let newViewCache, filterServerNode; - if (operation.type === OperationType.OVERWRITE) { - const overwrite = operation; - if (overwrite.source.fromUser) { - newViewCache = viewProcessorApplyUserOverwrite(viewProcessor, oldViewCache, overwrite.path, overwrite.snap, writesCache, completeCache, accumulator); - } - else { - assert(overwrite.source.fromServer, 'Unknown source.'); - // We filter the node if it's a tagged update or the node has been previously filtered and the - // update is not at the root in which case it is ok (and necessary) to mark the node unfiltered - // again - filterServerNode = - overwrite.source.tagged || - (oldViewCache.serverCache.isFiltered() && !pathIsEmpty(overwrite.path)); - newViewCache = viewProcessorApplyServerOverwrite(viewProcessor, oldViewCache, overwrite.path, overwrite.snap, writesCache, completeCache, filterServerNode, accumulator); - } - } - else if (operation.type === OperationType.MERGE) { - const merge = operation; - if (merge.source.fromUser) { - newViewCache = viewProcessorApplyUserMerge(viewProcessor, oldViewCache, merge.path, merge.children, writesCache, completeCache, accumulator); - } - else { - assert(merge.source.fromServer, 'Unknown source.'); - // We filter the node if it's a tagged update or the node has been previously filtered - filterServerNode = - merge.source.tagged || oldViewCache.serverCache.isFiltered(); - newViewCache = viewProcessorApplyServerMerge(viewProcessor, oldViewCache, merge.path, merge.children, writesCache, completeCache, filterServerNode, accumulator); - } - } - else if (operation.type === OperationType.ACK_USER_WRITE) { - const ackUserWrite = operation; - if (!ackUserWrite.revert) { - newViewCache = viewProcessorAckUserWrite(viewProcessor, oldViewCache, ackUserWrite.path, ackUserWrite.affectedTree, writesCache, completeCache, accumulator); - } - else { - newViewCache = viewProcessorRevertUserWrite(viewProcessor, oldViewCache, ackUserWrite.path, writesCache, completeCache, accumulator); - } - } - else if (operation.type === OperationType.LISTEN_COMPLETE) { - newViewCache = viewProcessorListenComplete(viewProcessor, oldViewCache, operation.path, writesCache, accumulator); - } - else { - throw assertionError('Unknown operation type: ' + operation.type); - } - const changes = accumulator.getChanges(); - viewProcessorMaybeAddValueEvent(oldViewCache, newViewCache, changes); - return { viewCache: newViewCache, changes }; -} -function viewProcessorMaybeAddValueEvent(oldViewCache, newViewCache, accumulator) { - const eventSnap = newViewCache.eventCache; - if (eventSnap.isFullyInitialized()) { - const isLeafOrEmpty = eventSnap.getNode().isLeafNode() || eventSnap.getNode().isEmpty(); - const oldCompleteSnap = viewCacheGetCompleteEventSnap(oldViewCache); - if (accumulator.length > 0 || - !oldViewCache.eventCache.isFullyInitialized() || - (isLeafOrEmpty && !eventSnap.getNode().equals(oldCompleteSnap)) || - !eventSnap.getNode().getPriority().equals(oldCompleteSnap.getPriority())) { - accumulator.push(changeValue(viewCacheGetCompleteEventSnap(newViewCache))); - } - } -} -function viewProcessorGenerateEventCacheAfterServerEvent(viewProcessor, viewCache, changePath, writesCache, source, accumulator) { - const oldEventSnap = viewCache.eventCache; - if (writeTreeRefShadowingWrite(writesCache, changePath) != null) { - // we have a shadowing write, ignore changes - return viewCache; - } - else { - let newEventCache, serverNode; - if (pathIsEmpty(changePath)) { - // TODO: figure out how this plays with "sliding ack windows" - assert(viewCache.serverCache.isFullyInitialized(), 'If change path is empty, we must have complete server data'); - if (viewCache.serverCache.isFiltered()) { - // We need to special case this, because we need to only apply writes to complete children, or - // we might end up raising events for incomplete children. If the server data is filtered deep - // writes cannot be guaranteed to be complete - const serverCache = viewCacheGetCompleteServerSnap(viewCache); - const completeChildren = serverCache instanceof ChildrenNode - ? serverCache - : ChildrenNode.EMPTY_NODE; - const completeEventChildren = writeTreeRefCalcCompleteEventChildren(writesCache, completeChildren); - newEventCache = viewProcessor.filter.updateFullNode(viewCache.eventCache.getNode(), completeEventChildren, accumulator); - } - else { - const completeNode = writeTreeRefCalcCompleteEventCache(writesCache, viewCacheGetCompleteServerSnap(viewCache)); - newEventCache = viewProcessor.filter.updateFullNode(viewCache.eventCache.getNode(), completeNode, accumulator); - } - } - else { - const childKey = pathGetFront(changePath); - if (childKey === '.priority') { - assert(pathGetLength(changePath) === 1, "Can't have a priority with additional path components"); - const oldEventNode = oldEventSnap.getNode(); - serverNode = viewCache.serverCache.getNode(); - // we might have overwrites for this priority - const updatedPriority = writeTreeRefCalcEventCacheAfterServerOverwrite(writesCache, changePath, oldEventNode, serverNode); - if (updatedPriority != null) { - newEventCache = viewProcessor.filter.updatePriority(oldEventNode, updatedPriority); - } - else { - // priority didn't change, keep old node - newEventCache = oldEventSnap.getNode(); - } - } - else { - const childChangePath = pathPopFront(changePath); - // update child - let newEventChild; - if (oldEventSnap.isCompleteForChild(childKey)) { - serverNode = viewCache.serverCache.getNode(); - const eventChildUpdate = writeTreeRefCalcEventCacheAfterServerOverwrite(writesCache, changePath, oldEventSnap.getNode(), serverNode); - if (eventChildUpdate != null) { - newEventChild = oldEventSnap - .getNode() - .getImmediateChild(childKey) - .updateChild(childChangePath, eventChildUpdate); - } - else { - // Nothing changed, just keep the old child - newEventChild = oldEventSnap.getNode().getImmediateChild(childKey); - } - } - else { - newEventChild = writeTreeRefCalcCompleteChild(writesCache, childKey, viewCache.serverCache); - } - if (newEventChild != null) { - newEventCache = viewProcessor.filter.updateChild(oldEventSnap.getNode(), childKey, newEventChild, childChangePath, source, accumulator); - } - else { - // no complete child available or no change - newEventCache = oldEventSnap.getNode(); - } - } - } - return viewCacheUpdateEventSnap(viewCache, newEventCache, oldEventSnap.isFullyInitialized() || pathIsEmpty(changePath), viewProcessor.filter.filtersNodes()); - } -} -function viewProcessorApplyServerOverwrite(viewProcessor, oldViewCache, changePath, changedSnap, writesCache, completeCache, filterServerNode, accumulator) { - const oldServerSnap = oldViewCache.serverCache; - let newServerCache; - const serverFilter = filterServerNode - ? viewProcessor.filter - : viewProcessor.filter.getIndexedFilter(); - if (pathIsEmpty(changePath)) { - newServerCache = serverFilter.updateFullNode(oldServerSnap.getNode(), changedSnap, null); - } - else if (serverFilter.filtersNodes() && !oldServerSnap.isFiltered()) { - // we want to filter the server node, but we didn't filter the server node yet, so simulate a full update - const newServerNode = oldServerSnap - .getNode() - .updateChild(changePath, changedSnap); - newServerCache = serverFilter.updateFullNode(oldServerSnap.getNode(), newServerNode, null); - } - else { - const childKey = pathGetFront(changePath); - if (!oldServerSnap.isCompleteForPath(changePath) && - pathGetLength(changePath) > 1) { - // We don't update incomplete nodes with updates intended for other listeners - return oldViewCache; - } - const childChangePath = pathPopFront(changePath); - const childNode = oldServerSnap.getNode().getImmediateChild(childKey); - const newChildNode = childNode.updateChild(childChangePath, changedSnap); - if (childKey === '.priority') { - newServerCache = serverFilter.updatePriority(oldServerSnap.getNode(), newChildNode); - } - else { - newServerCache = serverFilter.updateChild(oldServerSnap.getNode(), childKey, newChildNode, childChangePath, NO_COMPLETE_CHILD_SOURCE, null); - } - } - const newViewCache = viewCacheUpdateServerSnap(oldViewCache, newServerCache, oldServerSnap.isFullyInitialized() || pathIsEmpty(changePath), serverFilter.filtersNodes()); - const source = new WriteTreeCompleteChildSource(writesCache, newViewCache, completeCache); - return viewProcessorGenerateEventCacheAfterServerEvent(viewProcessor, newViewCache, changePath, writesCache, source, accumulator); -} -function viewProcessorApplyUserOverwrite(viewProcessor, oldViewCache, changePath, changedSnap, writesCache, completeCache, accumulator) { - const oldEventSnap = oldViewCache.eventCache; - let newViewCache, newEventCache; - const source = new WriteTreeCompleteChildSource(writesCache, oldViewCache, completeCache); - if (pathIsEmpty(changePath)) { - newEventCache = viewProcessor.filter.updateFullNode(oldViewCache.eventCache.getNode(), changedSnap, accumulator); - newViewCache = viewCacheUpdateEventSnap(oldViewCache, newEventCache, true, viewProcessor.filter.filtersNodes()); - } - else { - const childKey = pathGetFront(changePath); - if (childKey === '.priority') { - newEventCache = viewProcessor.filter.updatePriority(oldViewCache.eventCache.getNode(), changedSnap); - newViewCache = viewCacheUpdateEventSnap(oldViewCache, newEventCache, oldEventSnap.isFullyInitialized(), oldEventSnap.isFiltered()); - } - else { - const childChangePath = pathPopFront(changePath); - const oldChild = oldEventSnap.getNode().getImmediateChild(childKey); - let newChild; - if (pathIsEmpty(childChangePath)) { - // Child overwrite, we can replace the child - newChild = changedSnap; - } - else { - const childNode = source.getCompleteChild(childKey); - if (childNode != null) { - if (pathGetBack(childChangePath) === '.priority' && - childNode.getChild(pathParent(childChangePath)).isEmpty()) { - // This is a priority update on an empty node. If this node exists on the server, the - // server will send down the priority in the update, so ignore for now - newChild = childNode; - } - else { - newChild = childNode.updateChild(childChangePath, changedSnap); - } - } - else { - // There is no complete child node available - newChild = ChildrenNode.EMPTY_NODE; - } - } - if (!oldChild.equals(newChild)) { - const newEventSnap = viewProcessor.filter.updateChild(oldEventSnap.getNode(), childKey, newChild, childChangePath, source, accumulator); - newViewCache = viewCacheUpdateEventSnap(oldViewCache, newEventSnap, oldEventSnap.isFullyInitialized(), viewProcessor.filter.filtersNodes()); - } - else { - newViewCache = oldViewCache; - } - } - } - return newViewCache; -} -function viewProcessorCacheHasChild(viewCache, childKey) { - return viewCache.eventCache.isCompleteForChild(childKey); -} -function viewProcessorApplyUserMerge(viewProcessor, viewCache, path, changedChildren, writesCache, serverCache, accumulator) { - // HACK: In the case of a limit query, there may be some changes that bump things out of the - // window leaving room for new items. It's important we process these changes first, so we - // iterate the changes twice, first processing any that affect items currently in view. - // TODO: I consider an item "in view" if cacheHasChild is true, which checks both the server - // and event snap. I'm not sure if this will result in edge cases when a child is in one but - // not the other. - let curViewCache = viewCache; - changedChildren.foreach((relativePath, childNode) => { - const writePath = pathChild(path, relativePath); - if (viewProcessorCacheHasChild(viewCache, pathGetFront(writePath))) { - curViewCache = viewProcessorApplyUserOverwrite(viewProcessor, curViewCache, writePath, childNode, writesCache, serverCache, accumulator); - } - }); - changedChildren.foreach((relativePath, childNode) => { - const writePath = pathChild(path, relativePath); - if (!viewProcessorCacheHasChild(viewCache, pathGetFront(writePath))) { - curViewCache = viewProcessorApplyUserOverwrite(viewProcessor, curViewCache, writePath, childNode, writesCache, serverCache, accumulator); - } - }); - return curViewCache; -} -function viewProcessorApplyMerge(viewProcessor, node, merge) { - merge.foreach((relativePath, childNode) => { - node = node.updateChild(relativePath, childNode); - }); - return node; -} -function viewProcessorApplyServerMerge(viewProcessor, viewCache, path, changedChildren, writesCache, serverCache, filterServerNode, accumulator) { - // If we don't have a cache yet, this merge was intended for a previously listen in the same location. Ignore it and - // wait for the complete data update coming soon. - if (viewCache.serverCache.getNode().isEmpty() && - !viewCache.serverCache.isFullyInitialized()) { - return viewCache; - } - // HACK: In the case of a limit query, there may be some changes that bump things out of the - // window leaving room for new items. It's important we process these changes first, so we - // iterate the changes twice, first processing any that affect items currently in view. - // TODO: I consider an item "in view" if cacheHasChild is true, which checks both the server - // and event snap. I'm not sure if this will result in edge cases when a child is in one but - // not the other. - let curViewCache = viewCache; - let viewMergeTree; - if (pathIsEmpty(path)) { - viewMergeTree = changedChildren; - } - else { - viewMergeTree = new ImmutableTree(null).setTree(path, changedChildren); - } - const serverNode = viewCache.serverCache.getNode(); - viewMergeTree.children.inorderTraversal((childKey, childTree) => { - if (serverNode.hasChild(childKey)) { - const serverChild = viewCache.serverCache - .getNode() - .getImmediateChild(childKey); - const newChild = viewProcessorApplyMerge(viewProcessor, serverChild, childTree); - curViewCache = viewProcessorApplyServerOverwrite(viewProcessor, curViewCache, new Path(childKey), newChild, writesCache, serverCache, filterServerNode, accumulator); - } - }); - viewMergeTree.children.inorderTraversal((childKey, childMergeTree) => { - const isUnknownDeepMerge = !viewCache.serverCache.isCompleteForChild(childKey) && - childMergeTree.value === null; - if (!serverNode.hasChild(childKey) && !isUnknownDeepMerge) { - const serverChild = viewCache.serverCache - .getNode() - .getImmediateChild(childKey); - const newChild = viewProcessorApplyMerge(viewProcessor, serverChild, childMergeTree); - curViewCache = viewProcessorApplyServerOverwrite(viewProcessor, curViewCache, new Path(childKey), newChild, writesCache, serverCache, filterServerNode, accumulator); - } - }); - return curViewCache; -} -function viewProcessorAckUserWrite(viewProcessor, viewCache, ackPath, affectedTree, writesCache, completeCache, accumulator) { - if (writeTreeRefShadowingWrite(writesCache, ackPath) != null) { - return viewCache; - } - // Only filter server node if it is currently filtered - const filterServerNode = viewCache.serverCache.isFiltered(); - // Essentially we'll just get our existing server cache for the affected paths and re-apply it as a server update - // now that it won't be shadowed. - const serverCache = viewCache.serverCache; - if (affectedTree.value != null) { - // This is an overwrite. - if ((pathIsEmpty(ackPath) && serverCache.isFullyInitialized()) || - serverCache.isCompleteForPath(ackPath)) { - return viewProcessorApplyServerOverwrite(viewProcessor, viewCache, ackPath, serverCache.getNode().getChild(ackPath), writesCache, completeCache, filterServerNode, accumulator); - } - else if (pathIsEmpty(ackPath)) { - // This is a goofy edge case where we are acking data at this location but don't have full data. We - // should just re-apply whatever we have in our cache as a merge. - let changedChildren = new ImmutableTree(null); - serverCache.getNode().forEachChild(KEY_INDEX, (name, node) => { - changedChildren = changedChildren.set(new Path(name), node); - }); - return viewProcessorApplyServerMerge(viewProcessor, viewCache, ackPath, changedChildren, writesCache, completeCache, filterServerNode, accumulator); - } - else { - return viewCache; - } - } - else { - // This is a merge. - let changedChildren = new ImmutableTree(null); - affectedTree.foreach((mergePath, value) => { - const serverCachePath = pathChild(ackPath, mergePath); - if (serverCache.isCompleteForPath(serverCachePath)) { - changedChildren = changedChildren.set(mergePath, serverCache.getNode().getChild(serverCachePath)); - } - }); - return viewProcessorApplyServerMerge(viewProcessor, viewCache, ackPath, changedChildren, writesCache, completeCache, filterServerNode, accumulator); - } -} -function viewProcessorListenComplete(viewProcessor, viewCache, path, writesCache, accumulator) { - const oldServerNode = viewCache.serverCache; - const newViewCache = viewCacheUpdateServerSnap(viewCache, oldServerNode.getNode(), oldServerNode.isFullyInitialized() || pathIsEmpty(path), oldServerNode.isFiltered()); - return viewProcessorGenerateEventCacheAfterServerEvent(viewProcessor, newViewCache, path, writesCache, NO_COMPLETE_CHILD_SOURCE, accumulator); -} -function viewProcessorRevertUserWrite(viewProcessor, viewCache, path, writesCache, completeServerCache, accumulator) { - let complete; - if (writeTreeRefShadowingWrite(writesCache, path) != null) { - return viewCache; - } - else { - const source = new WriteTreeCompleteChildSource(writesCache, viewCache, completeServerCache); - const oldEventCache = viewCache.eventCache.getNode(); - let newEventCache; - if (pathIsEmpty(path) || pathGetFront(path) === '.priority') { - let newNode; - if (viewCache.serverCache.isFullyInitialized()) { - newNode = writeTreeRefCalcCompleteEventCache(writesCache, viewCacheGetCompleteServerSnap(viewCache)); - } - else { - const serverChildren = viewCache.serverCache.getNode(); - assert(serverChildren instanceof ChildrenNode, 'serverChildren would be complete if leaf node'); - newNode = writeTreeRefCalcCompleteEventChildren(writesCache, serverChildren); - } - newNode = newNode; - newEventCache = viewProcessor.filter.updateFullNode(oldEventCache, newNode, accumulator); - } - else { - const childKey = pathGetFront(path); - let newChild = writeTreeRefCalcCompleteChild(writesCache, childKey, viewCache.serverCache); - if (newChild == null && - viewCache.serverCache.isCompleteForChild(childKey)) { - newChild = oldEventCache.getImmediateChild(childKey); - } - if (newChild != null) { - newEventCache = viewProcessor.filter.updateChild(oldEventCache, childKey, newChild, pathPopFront(path), source, accumulator); - } - else if (viewCache.eventCache.getNode().hasChild(childKey)) { - // No complete child available, delete the existing one, if any - newEventCache = viewProcessor.filter.updateChild(oldEventCache, childKey, ChildrenNode.EMPTY_NODE, pathPopFront(path), source, accumulator); - } - else { - newEventCache = oldEventCache; - } - if (newEventCache.isEmpty() && - viewCache.serverCache.isFullyInitialized()) { - // We might have reverted all child writes. Maybe the old event was a leaf node - complete = writeTreeRefCalcCompleteEventCache(writesCache, viewCacheGetCompleteServerSnap(viewCache)); - if (complete.isLeafNode()) { - newEventCache = viewProcessor.filter.updateFullNode(newEventCache, complete, accumulator); - } - } - } - complete = - viewCache.serverCache.isFullyInitialized() || - writeTreeRefShadowingWrite(writesCache, newEmptyPath()) != null; - return viewCacheUpdateEventSnap(viewCache, newEventCache, complete, viewProcessor.filter.filtersNodes()); - } -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * A view represents a specific location and query that has 1 or more event registrations. - * - * It does several things: - * - Maintains the list of event registrations for this location/query. - * - Maintains a cache of the data visible for this location/query. - * - Applies new operations (via applyOperation), updates the cache, and based on the event - * registrations returns the set of events to be raised. - */ -class View { - constructor(query_, initialViewCache) { - this.query_ = query_; - this.eventRegistrations_ = []; - const params = this.query_._queryParams; - const indexFilter = new IndexedFilter(params.getIndex()); - const filter = queryParamsGetNodeFilter(params); - this.processor_ = newViewProcessor(filter); - const initialServerCache = initialViewCache.serverCache; - const initialEventCache = initialViewCache.eventCache; - // Don't filter server node with other filter than index, wait for tagged listen - const serverSnap = indexFilter.updateFullNode(ChildrenNode.EMPTY_NODE, initialServerCache.getNode(), null); - const eventSnap = filter.updateFullNode(ChildrenNode.EMPTY_NODE, initialEventCache.getNode(), null); - const newServerCache = new CacheNode(serverSnap, initialServerCache.isFullyInitialized(), indexFilter.filtersNodes()); - const newEventCache = new CacheNode(eventSnap, initialEventCache.isFullyInitialized(), filter.filtersNodes()); - this.viewCache_ = newViewCache(newEventCache, newServerCache); - this.eventGenerator_ = new EventGenerator(this.query_); - } - get query() { - return this.query_; - } -} -function viewGetServerCache(view) { - return view.viewCache_.serverCache.getNode(); -} -function viewGetCompleteNode(view) { - return viewCacheGetCompleteEventSnap(view.viewCache_); -} -function viewGetCompleteServerCache(view, path) { - const cache = viewCacheGetCompleteServerSnap(view.viewCache_); - if (cache) { - // If this isn't a "loadsAllData" view, then cache isn't actually a complete cache and - // we need to see if it contains the child we're interested in. - if (view.query._queryParams.loadsAllData() || - (!pathIsEmpty(path) && - !cache.getImmediateChild(pathGetFront(path)).isEmpty())) { - return cache.getChild(path); - } - } - return null; -} -function viewIsEmpty(view) { - return view.eventRegistrations_.length === 0; -} -function viewAddEventRegistration(view, eventRegistration) { - view.eventRegistrations_.push(eventRegistration); -} -/** - * @param eventRegistration - If null, remove all callbacks. - * @param cancelError - If a cancelError is provided, appropriate cancel events will be returned. - * @returns Cancel events, if cancelError was provided. - */ -function viewRemoveEventRegistration(view, eventRegistration, cancelError) { - const cancelEvents = []; - if (cancelError) { - assert(eventRegistration == null, 'A cancel should cancel all event registrations.'); - const path = view.query._path; - view.eventRegistrations_.forEach(registration => { - const maybeEvent = registration.createCancelEvent(cancelError, path); - if (maybeEvent) { - cancelEvents.push(maybeEvent); - } - }); - } - if (eventRegistration) { - let remaining = []; - for (let i = 0; i < view.eventRegistrations_.length; ++i) { - const existing = view.eventRegistrations_[i]; - if (!existing.matches(eventRegistration)) { - remaining.push(existing); - } - else if (eventRegistration.hasAnyCallback()) { - // We're removing just this one - remaining = remaining.concat(view.eventRegistrations_.slice(i + 1)); - break; - } - } - view.eventRegistrations_ = remaining; - } - else { - view.eventRegistrations_ = []; - } - return cancelEvents; -} -/** - * Applies the given Operation, updates our cache, and returns the appropriate events. - */ -function viewApplyOperation(view, operation, writesCache, completeServerCache) { - if (operation.type === OperationType.MERGE && - operation.source.queryId !== null) { - assert(viewCacheGetCompleteServerSnap(view.viewCache_), 'We should always have a full cache before handling merges'); - assert(viewCacheGetCompleteEventSnap(view.viewCache_), 'Missing event cache, even though we have a server cache'); - } - const oldViewCache = view.viewCache_; - const result = viewProcessorApplyOperation(view.processor_, oldViewCache, operation, writesCache, completeServerCache); - viewProcessorAssertIndexed(view.processor_, result.viewCache); - assert(result.viewCache.serverCache.isFullyInitialized() || - !oldViewCache.serverCache.isFullyInitialized(), 'Once a server snap is complete, it should never go back'); - view.viewCache_ = result.viewCache; - return viewGenerateEventsForChanges_(view, result.changes, result.viewCache.eventCache.getNode(), null); -} -function viewGetInitialEvents(view, registration) { - const eventSnap = view.viewCache_.eventCache; - const initialChanges = []; - if (!eventSnap.getNode().isLeafNode()) { - const eventNode = eventSnap.getNode(); - eventNode.forEachChild(PRIORITY_INDEX, (key, childNode) => { - initialChanges.push(changeChildAdded(key, childNode)); - }); - } - if (eventSnap.isFullyInitialized()) { - initialChanges.push(changeValue(eventSnap.getNode())); - } - return viewGenerateEventsForChanges_(view, initialChanges, eventSnap.getNode(), registration); -} -function viewGenerateEventsForChanges_(view, changes, eventCache, eventRegistration) { - const registrations = eventRegistration - ? [eventRegistration] - : view.eventRegistrations_; - return eventGeneratorGenerateEventsForChanges(view.eventGenerator_, changes, eventCache, registrations); -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -let referenceConstructor$1; -/** - * SyncPoint represents a single location in a SyncTree with 1 or more event registrations, meaning we need to - * maintain 1 or more Views at this location to cache server data and raise appropriate events for server changes - * and user writes (set, transaction, update). - * - * It's responsible for: - * - Maintaining the set of 1 or more views necessary at this location (a SyncPoint with 0 views should be removed). - * - Proxying user / server operations to the views as appropriate (i.e. applyServerOverwrite, - * applyUserOverwrite, etc.) - */ -class SyncPoint { - constructor() { - /** - * The Views being tracked at this location in the tree, stored as a map where the key is a - * queryId and the value is the View for that query. - * - * NOTE: This list will be quite small (usually 1, but perhaps 2 or 3; any more is an odd use case). - */ - this.views = new Map(); - } -} -function syncPointSetReferenceConstructor(val) { - assert(!referenceConstructor$1, '__referenceConstructor has already been defined'); - referenceConstructor$1 = val; -} -function syncPointGetReferenceConstructor() { - assert(referenceConstructor$1, 'Reference.ts has not been loaded'); - return referenceConstructor$1; -} -function syncPointIsEmpty(syncPoint) { - return syncPoint.views.size === 0; -} -function syncPointApplyOperation(syncPoint, operation, writesCache, optCompleteServerCache) { - const queryId = operation.source.queryId; - if (queryId !== null) { - const view = syncPoint.views.get(queryId); - assert(view != null, 'SyncTree gave us an op for an invalid query.'); - return viewApplyOperation(view, operation, writesCache, optCompleteServerCache); - } - else { - let events = []; - for (const view of syncPoint.views.values()) { - events = events.concat(viewApplyOperation(view, operation, writesCache, optCompleteServerCache)); - } - return events; - } -} -/** - * Get a view for the specified query. - * - * @param query - The query to return a view for - * @param writesCache - * @param serverCache - * @param serverCacheComplete - * @returns Events to raise. - */ -function syncPointGetView(syncPoint, query, writesCache, serverCache, serverCacheComplete) { - const queryId = query._queryIdentifier; - const view = syncPoint.views.get(queryId); - if (!view) { - // TODO: make writesCache take flag for complete server node - let eventCache = writeTreeRefCalcCompleteEventCache(writesCache, serverCacheComplete ? serverCache : null); - let eventCacheComplete = false; - if (eventCache) { - eventCacheComplete = true; - } - else if (serverCache instanceof ChildrenNode) { - eventCache = writeTreeRefCalcCompleteEventChildren(writesCache, serverCache); - eventCacheComplete = false; - } - else { - eventCache = ChildrenNode.EMPTY_NODE; - eventCacheComplete = false; - } - const viewCache = newViewCache(new CacheNode(eventCache, eventCacheComplete, false), new CacheNode(serverCache, serverCacheComplete, false)); - return new View(query, viewCache); - } - return view; -} -/** - * Add an event callback for the specified query. - * - * @param query - * @param eventRegistration - * @param writesCache - * @param serverCache - Complete server cache, if we have it. - * @param serverCacheComplete - * @returns Events to raise. - */ -function syncPointAddEventRegistration(syncPoint, query, eventRegistration, writesCache, serverCache, serverCacheComplete) { - const view = syncPointGetView(syncPoint, query, writesCache, serverCache, serverCacheComplete); - if (!syncPoint.views.has(query._queryIdentifier)) { - syncPoint.views.set(query._queryIdentifier, view); - } - // This is guaranteed to exist now, we just created anything that was missing - viewAddEventRegistration(view, eventRegistration); - return viewGetInitialEvents(view, eventRegistration); -} -/** - * Remove event callback(s). Return cancelEvents if a cancelError is specified. - * - * If query is the default query, we'll check all views for the specified eventRegistration. - * If eventRegistration is null, we'll remove all callbacks for the specified view(s). - * - * @param eventRegistration - If null, remove all callbacks. - * @param cancelError - If a cancelError is provided, appropriate cancel events will be returned. - * @returns removed queries and any cancel events - */ -function syncPointRemoveEventRegistration(syncPoint, query, eventRegistration, cancelError) { - const queryId = query._queryIdentifier; - const removed = []; - let cancelEvents = []; - const hadCompleteView = syncPointHasCompleteView(syncPoint); - if (queryId === 'default') { - // When you do ref.off(...), we search all views for the registration to remove. - for (const [viewQueryId, view] of syncPoint.views.entries()) { - cancelEvents = cancelEvents.concat(viewRemoveEventRegistration(view, eventRegistration, cancelError)); - if (viewIsEmpty(view)) { - syncPoint.views.delete(viewQueryId); - // We'll deal with complete views later. - if (!view.query._queryParams.loadsAllData()) { - removed.push(view.query); - } - } - } - } - else { - // remove the callback from the specific view. - const view = syncPoint.views.get(queryId); - if (view) { - cancelEvents = cancelEvents.concat(viewRemoveEventRegistration(view, eventRegistration, cancelError)); - if (viewIsEmpty(view)) { - syncPoint.views.delete(queryId); - // We'll deal with complete views later. - if (!view.query._queryParams.loadsAllData()) { - removed.push(view.query); - } - } - } - } - if (hadCompleteView && !syncPointHasCompleteView(syncPoint)) { - // We removed our last complete view. - removed.push(new (syncPointGetReferenceConstructor())(query._repo, query._path)); - } - return { removed, events: cancelEvents }; -} -function syncPointGetQueryViews(syncPoint) { - const result = []; - for (const view of syncPoint.views.values()) { - if (!view.query._queryParams.loadsAllData()) { - result.push(view); - } - } - return result; -} -/** - * @param path - The path to the desired complete snapshot - * @returns A complete cache, if it exists - */ -function syncPointGetCompleteServerCache(syncPoint, path) { - let serverCache = null; - for (const view of syncPoint.views.values()) { - serverCache = serverCache || viewGetCompleteServerCache(view, path); - } - return serverCache; -} -function syncPointViewForQuery(syncPoint, query) { - const params = query._queryParams; - if (params.loadsAllData()) { - return syncPointGetCompleteView(syncPoint); - } - else { - const queryId = query._queryIdentifier; - return syncPoint.views.get(queryId); - } -} -function syncPointViewExistsForQuery(syncPoint, query) { - return syncPointViewForQuery(syncPoint, query) != null; -} -function syncPointHasCompleteView(syncPoint) { - return syncPointGetCompleteView(syncPoint) != null; -} -function syncPointGetCompleteView(syncPoint) { - for (const view of syncPoint.views.values()) { - if (view.query._queryParams.loadsAllData()) { - return view; - } - } - return null; -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -let referenceConstructor; -function syncTreeSetReferenceConstructor(val) { - assert(!referenceConstructor, '__referenceConstructor has already been defined'); - referenceConstructor = val; -} -function syncTreeGetReferenceConstructor() { - assert(referenceConstructor, 'Reference.ts has not been loaded'); - return referenceConstructor; -} -/** - * Static tracker for next query tag. - */ -let syncTreeNextQueryTag_ = 1; -/** - * SyncTree is the central class for managing event callback registration, data caching, views - * (query processing), and event generation. There are typically two SyncTree instances for - * each Repo, one for the normal Firebase data, and one for the .info data. - * - * It has a number of responsibilities, including: - * - Tracking all user event callbacks (registered via addEventRegistration() and removeEventRegistration()). - * - Applying and caching data changes for user set(), transaction(), and update() calls - * (applyUserOverwrite(), applyUserMerge()). - * - Applying and caching data changes for server data changes (applyServerOverwrite(), - * applyServerMerge()). - * - Generating user-facing events for server and user changes (all of the apply* methods - * return the set of events that need to be raised as a result). - * - Maintaining the appropriate set of server listens to ensure we are always subscribed - * to the correct set of paths and queries to satisfy the current set of user event - * callbacks (listens are started/stopped using the provided listenProvider). - * - * NOTE: Although SyncTree tracks event callbacks and calculates events to raise, the actual - * events are returned to the caller rather than raised synchronously. - * - */ -class SyncTree { - /** - * @param listenProvider_ - Used by SyncTree to start / stop listening - * to server data. - */ - constructor(listenProvider_) { - this.listenProvider_ = listenProvider_; - /** - * Tree of SyncPoints. There's a SyncPoint at any location that has 1 or more views. - */ - this.syncPointTree_ = new ImmutableTree(null); - /** - * A tree of all pending user writes (user-initiated set()'s, transaction()'s, update()'s, etc.). - */ - this.pendingWriteTree_ = newWriteTree(); - this.tagToQueryMap = new Map(); - this.queryToTagMap = new Map(); - } -} -/** - * Apply the data changes for a user-generated set() or transaction() call. - * - * @returns Events to raise. - */ -function syncTreeApplyUserOverwrite(syncTree, path, newData, writeId, visible) { - // Record pending write. - writeTreeAddOverwrite(syncTree.pendingWriteTree_, path, newData, writeId, visible); - if (!visible) { - return []; - } - else { - return syncTreeApplyOperationToSyncPoints_(syncTree, new Overwrite(newOperationSourceUser(), path, newData)); - } -} -/** - * Apply the data from a user-generated update() call - * - * @returns Events to raise. - */ -function syncTreeApplyUserMerge(syncTree, path, changedChildren, writeId) { - // Record pending merge. - writeTreeAddMerge(syncTree.pendingWriteTree_, path, changedChildren, writeId); - const changeTree = ImmutableTree.fromObject(changedChildren); - return syncTreeApplyOperationToSyncPoints_(syncTree, new Merge(newOperationSourceUser(), path, changeTree)); -} -/** - * Acknowledge a pending user write that was previously registered with applyUserOverwrite() or applyUserMerge(). - * - * @param revert - True if the given write failed and needs to be reverted - * @returns Events to raise. - */ -function syncTreeAckUserWrite(syncTree, writeId, revert = false) { - const write = writeTreeGetWrite(syncTree.pendingWriteTree_, writeId); - const needToReevaluate = writeTreeRemoveWrite(syncTree.pendingWriteTree_, writeId); - if (!needToReevaluate) { - return []; - } - else { - let affectedTree = new ImmutableTree(null); - if (write.snap != null) { - // overwrite - affectedTree = affectedTree.set(newEmptyPath(), true); - } - else { - each(write.children, (pathString) => { - affectedTree = affectedTree.set(new Path(pathString), true); - }); - } - return syncTreeApplyOperationToSyncPoints_(syncTree, new AckUserWrite(write.path, affectedTree, revert)); - } -} -/** - * Apply new server data for the specified path.. - * - * @returns Events to raise. - */ -function syncTreeApplyServerOverwrite(syncTree, path, newData) { - return syncTreeApplyOperationToSyncPoints_(syncTree, new Overwrite(newOperationSourceServer(), path, newData)); -} -/** - * Apply new server data to be merged in at the specified path. - * - * @returns Events to raise. - */ -function syncTreeApplyServerMerge(syncTree, path, changedChildren) { - const changeTree = ImmutableTree.fromObject(changedChildren); - return syncTreeApplyOperationToSyncPoints_(syncTree, new Merge(newOperationSourceServer(), path, changeTree)); -} -/** - * Apply a listen complete for a query - * - * @returns Events to raise. - */ -function syncTreeApplyListenComplete(syncTree, path) { - return syncTreeApplyOperationToSyncPoints_(syncTree, new ListenComplete(newOperationSourceServer(), path)); -} -/** - * Apply a listen complete for a tagged query - * - * @returns Events to raise. - */ -function syncTreeApplyTaggedListenComplete(syncTree, path, tag) { - const queryKey = syncTreeQueryKeyForTag_(syncTree, tag); - if (queryKey) { - const r = syncTreeParseQueryKey_(queryKey); - const queryPath = r.path, queryId = r.queryId; - const relativePath = newRelativePath(queryPath, path); - const op = new ListenComplete(newOperationSourceServerTaggedQuery(queryId), relativePath); - return syncTreeApplyTaggedOperation_(syncTree, queryPath, op); - } - else { - // We've already removed the query. No big deal, ignore the update - return []; - } -} -/** - * Remove event callback(s). - * - * If query is the default query, we'll check all queries for the specified eventRegistration. - * If eventRegistration is null, we'll remove all callbacks for the specified query/queries. - * - * @param eventRegistration - If null, all callbacks are removed. - * @param cancelError - If a cancelError is provided, appropriate cancel events will be returned. - * @param skipListenerDedup - When performing a `get()`, we don't add any new listeners, so no - * deduping needs to take place. This flag allows toggling of that behavior - * @returns Cancel events, if cancelError was provided. - */ -function syncTreeRemoveEventRegistration(syncTree, query, eventRegistration, cancelError, skipListenerDedup = false) { - // Find the syncPoint first. Then deal with whether or not it has matching listeners - const path = query._path; - const maybeSyncPoint = syncTree.syncPointTree_.get(path); - let cancelEvents = []; - // A removal on a default query affects all queries at that location. A removal on an indexed query, even one without - // other query constraints, does *not* affect all queries at that location. So this check must be for 'default', and - // not loadsAllData(). - if (maybeSyncPoint && - (query._queryIdentifier === 'default' || - syncPointViewExistsForQuery(maybeSyncPoint, query))) { - const removedAndEvents = syncPointRemoveEventRegistration(maybeSyncPoint, query, eventRegistration, cancelError); - if (syncPointIsEmpty(maybeSyncPoint)) { - syncTree.syncPointTree_ = syncTree.syncPointTree_.remove(path); - } - const removed = removedAndEvents.removed; - cancelEvents = removedAndEvents.events; - if (!skipListenerDedup) { - /** - * We may have just removed one of many listeners and can short-circuit this whole process - * We may also not have removed a default listener, in which case all of the descendant listeners should already be - * properly set up. - */ - // Since indexed queries can shadow if they don't have other query constraints, check for loadsAllData(), instead of - // queryId === 'default' - const removingDefault = -1 !== - removed.findIndex(query => { - return query._queryParams.loadsAllData(); - }); - const covered = syncTree.syncPointTree_.findOnPath(path, (relativePath, parentSyncPoint) => syncPointHasCompleteView(parentSyncPoint)); - if (removingDefault && !covered) { - const subtree = syncTree.syncPointTree_.subtree(path); - // There are potentially child listeners. Determine what if any listens we need to send before executing the - // removal - if (!subtree.isEmpty()) { - // We need to fold over our subtree and collect the listeners to send - const newViews = syncTreeCollectDistinctViewsForSubTree_(subtree); - // Ok, we've collected all the listens we need. Set them up. - for (let i = 0; i < newViews.length; ++i) { - const view = newViews[i], newQuery = view.query; - const listener = syncTreeCreateListenerForView_(syncTree, view); - syncTree.listenProvider_.startListening(syncTreeQueryForListening_(newQuery), syncTreeTagForQuery(syncTree, newQuery), listener.hashFn, listener.onComplete); - } - } - // Otherwise there's nothing below us, so nothing we need to start listening on - } - // If we removed anything and we're not covered by a higher up listen, we need to stop listening on this query - // The above block has us covered in terms of making sure we're set up on listens lower in the tree. - // Also, note that if we have a cancelError, it's already been removed at the provider level. - if (!covered && removed.length > 0 && !cancelError) { - // If we removed a default, then we weren't listening on any of the other queries here. Just cancel the one - // default. Otherwise, we need to iterate through and cancel each individual query - if (removingDefault) { - // We don't tag default listeners - const defaultTag = null; - syncTree.listenProvider_.stopListening(syncTreeQueryForListening_(query), defaultTag); - } - else { - removed.forEach((queryToRemove) => { - const tagToRemove = syncTree.queryToTagMap.get(syncTreeMakeQueryKey_(queryToRemove)); - syncTree.listenProvider_.stopListening(syncTreeQueryForListening_(queryToRemove), tagToRemove); - }); - } - } - } - // Now, clear all of the tags we're tracking for the removed listens - syncTreeRemoveTags_(syncTree, removed); - } - return cancelEvents; -} -/** - * Apply new server data for the specified tagged query. - * - * @returns Events to raise. - */ -function syncTreeApplyTaggedQueryOverwrite(syncTree, path, snap, tag) { - const queryKey = syncTreeQueryKeyForTag_(syncTree, tag); - if (queryKey != null) { - const r = syncTreeParseQueryKey_(queryKey); - const queryPath = r.path, queryId = r.queryId; - const relativePath = newRelativePath(queryPath, path); - const op = new Overwrite(newOperationSourceServerTaggedQuery(queryId), relativePath, snap); - return syncTreeApplyTaggedOperation_(syncTree, queryPath, op); - } - else { - // Query must have been removed already - return []; - } -} -/** - * Apply server data to be merged in for the specified tagged query. - * - * @returns Events to raise. - */ -function syncTreeApplyTaggedQueryMerge(syncTree, path, changedChildren, tag) { - const queryKey = syncTreeQueryKeyForTag_(syncTree, tag); - if (queryKey) { - const r = syncTreeParseQueryKey_(queryKey); - const queryPath = r.path, queryId = r.queryId; - const relativePath = newRelativePath(queryPath, path); - const changeTree = ImmutableTree.fromObject(changedChildren); - const op = new Merge(newOperationSourceServerTaggedQuery(queryId), relativePath, changeTree); - return syncTreeApplyTaggedOperation_(syncTree, queryPath, op); - } - else { - // We've already removed the query. No big deal, ignore the update - return []; - } -} -/** - * Add an event callback for the specified query. - * - * @returns Events to raise. - */ -function syncTreeAddEventRegistration(syncTree, query, eventRegistration, skipSetupListener = false) { - const path = query._path; - let serverCache = null; - let foundAncestorDefaultView = false; - // Any covering writes will necessarily be at the root, so really all we need to find is the server cache. - // Consider optimizing this once there's a better understanding of what actual behavior will be. - syncTree.syncPointTree_.foreachOnPath(path, (pathToSyncPoint, sp) => { - const relativePath = newRelativePath(pathToSyncPoint, path); - serverCache = - serverCache || syncPointGetCompleteServerCache(sp, relativePath); - foundAncestorDefaultView = - foundAncestorDefaultView || syncPointHasCompleteView(sp); - }); - let syncPoint = syncTree.syncPointTree_.get(path); - if (!syncPoint) { - syncPoint = new SyncPoint(); - syncTree.syncPointTree_ = syncTree.syncPointTree_.set(path, syncPoint); - } - else { - foundAncestorDefaultView = - foundAncestorDefaultView || syncPointHasCompleteView(syncPoint); - serverCache = - serverCache || syncPointGetCompleteServerCache(syncPoint, newEmptyPath()); - } - let serverCacheComplete; - if (serverCache != null) { - serverCacheComplete = true; - } - else { - serverCacheComplete = false; - serverCache = ChildrenNode.EMPTY_NODE; - const subtree = syncTree.syncPointTree_.subtree(path); - subtree.foreachChild((childName, childSyncPoint) => { - const completeCache = syncPointGetCompleteServerCache(childSyncPoint, newEmptyPath()); - if (completeCache) { - serverCache = serverCache.updateImmediateChild(childName, completeCache); - } - }); - } - const viewAlreadyExists = syncPointViewExistsForQuery(syncPoint, query); - if (!viewAlreadyExists && !query._queryParams.loadsAllData()) { - // We need to track a tag for this query - const queryKey = syncTreeMakeQueryKey_(query); - assert(!syncTree.queryToTagMap.has(queryKey), 'View does not exist, but we have a tag'); - const tag = syncTreeGetNextQueryTag_(); - syncTree.queryToTagMap.set(queryKey, tag); - syncTree.tagToQueryMap.set(tag, queryKey); - } - const writesCache = writeTreeChildWrites(syncTree.pendingWriteTree_, path); - let events = syncPointAddEventRegistration(syncPoint, query, eventRegistration, writesCache, serverCache, serverCacheComplete); - if (!viewAlreadyExists && !foundAncestorDefaultView && !skipSetupListener) { - const view = syncPointViewForQuery(syncPoint, query); - events = events.concat(syncTreeSetupListener_(syncTree, query, view)); - } - return events; -} -/** - * Returns a complete cache, if we have one, of the data at a particular path. If the location does not have a - * listener above it, we will get a false "null". This shouldn't be a problem because transactions will always - * have a listener above, and atomic operations would correctly show a jitter of -> - * as the write is applied locally and then acknowledged at the server. - * - * Note: this method will *include* hidden writes from transaction with applyLocally set to false. - * - * @param path - The path to the data we want - * @param writeIdsToExclude - A specific set to be excluded - */ -function syncTreeCalcCompleteEventCache(syncTree, path, writeIdsToExclude) { - const includeHiddenSets = true; - const writeTree = syncTree.pendingWriteTree_; - const serverCache = syncTree.syncPointTree_.findOnPath(path, (pathSoFar, syncPoint) => { - const relativePath = newRelativePath(pathSoFar, path); - const serverCache = syncPointGetCompleteServerCache(syncPoint, relativePath); - if (serverCache) { - return serverCache; - } - }); - return writeTreeCalcCompleteEventCache(writeTree, path, serverCache, writeIdsToExclude, includeHiddenSets); -} -function syncTreeGetServerValue(syncTree, query) { - const path = query._path; - let serverCache = null; - // Any covering writes will necessarily be at the root, so really all we need to find is the server cache. - // Consider optimizing this once there's a better understanding of what actual behavior will be. - syncTree.syncPointTree_.foreachOnPath(path, (pathToSyncPoint, sp) => { - const relativePath = newRelativePath(pathToSyncPoint, path); - serverCache = - serverCache || syncPointGetCompleteServerCache(sp, relativePath); - }); - let syncPoint = syncTree.syncPointTree_.get(path); - if (!syncPoint) { - syncPoint = new SyncPoint(); - syncTree.syncPointTree_ = syncTree.syncPointTree_.set(path, syncPoint); - } - else { - serverCache = - serverCache || syncPointGetCompleteServerCache(syncPoint, newEmptyPath()); - } - const serverCacheComplete = serverCache != null; - const serverCacheNode = serverCacheComplete - ? new CacheNode(serverCache, true, false) - : null; - const writesCache = writeTreeChildWrites(syncTree.pendingWriteTree_, query._path); - const view = syncPointGetView(syncPoint, query, writesCache, serverCacheComplete ? serverCacheNode.getNode() : ChildrenNode.EMPTY_NODE, serverCacheComplete); - return viewGetCompleteNode(view); -} -/** - * A helper method that visits all descendant and ancestor SyncPoints, applying the operation. - * - * NOTES: - * - Descendant SyncPoints will be visited first (since we raise events depth-first). - * - * - We call applyOperation() on each SyncPoint passing three things: - * 1. A version of the Operation that has been made relative to the SyncPoint location. - * 2. A WriteTreeRef of any writes we have cached at the SyncPoint location. - * 3. A snapshot Node with cached server data, if we have it. - * - * - We concatenate all of the events returned by each SyncPoint and return the result. - */ -function syncTreeApplyOperationToSyncPoints_(syncTree, operation) { - return syncTreeApplyOperationHelper_(operation, syncTree.syncPointTree_, - /*serverCache=*/ null, writeTreeChildWrites(syncTree.pendingWriteTree_, newEmptyPath())); -} -/** - * Recursive helper for applyOperationToSyncPoints_ - */ -function syncTreeApplyOperationHelper_(operation, syncPointTree, serverCache, writesCache) { - if (pathIsEmpty(operation.path)) { - return syncTreeApplyOperationDescendantsHelper_(operation, syncPointTree, serverCache, writesCache); - } - else { - const syncPoint = syncPointTree.get(newEmptyPath()); - // If we don't have cached server data, see if we can get it from this SyncPoint. - if (serverCache == null && syncPoint != null) { - serverCache = syncPointGetCompleteServerCache(syncPoint, newEmptyPath()); - } - let events = []; - const childName = pathGetFront(operation.path); - const childOperation = operation.operationForChild(childName); - const childTree = syncPointTree.children.get(childName); - if (childTree && childOperation) { - const childServerCache = serverCache - ? serverCache.getImmediateChild(childName) - : null; - const childWritesCache = writeTreeRefChild(writesCache, childName); - events = events.concat(syncTreeApplyOperationHelper_(childOperation, childTree, childServerCache, childWritesCache)); - } - if (syncPoint) { - events = events.concat(syncPointApplyOperation(syncPoint, operation, writesCache, serverCache)); - } - return events; - } -} -/** - * Recursive helper for applyOperationToSyncPoints_ - */ -function syncTreeApplyOperationDescendantsHelper_(operation, syncPointTree, serverCache, writesCache) { - const syncPoint = syncPointTree.get(newEmptyPath()); - // If we don't have cached server data, see if we can get it from this SyncPoint. - if (serverCache == null && syncPoint != null) { - serverCache = syncPointGetCompleteServerCache(syncPoint, newEmptyPath()); - } - let events = []; - syncPointTree.children.inorderTraversal((childName, childTree) => { - const childServerCache = serverCache - ? serverCache.getImmediateChild(childName) - : null; - const childWritesCache = writeTreeRefChild(writesCache, childName); - const childOperation = operation.operationForChild(childName); - if (childOperation) { - events = events.concat(syncTreeApplyOperationDescendantsHelper_(childOperation, childTree, childServerCache, childWritesCache)); - } - }); - if (syncPoint) { - events = events.concat(syncPointApplyOperation(syncPoint, operation, writesCache, serverCache)); - } - return events; -} -function syncTreeCreateListenerForView_(syncTree, view) { - const query = view.query; - const tag = syncTreeTagForQuery(syncTree, query); - return { - hashFn: () => { - const cache = viewGetServerCache(view) || ChildrenNode.EMPTY_NODE; - return cache.hash(); - }, - onComplete: (status) => { - if (status === 'ok') { - if (tag) { - return syncTreeApplyTaggedListenComplete(syncTree, query._path, tag); - } - else { - return syncTreeApplyListenComplete(syncTree, query._path); - } - } - else { - // If a listen failed, kill all of the listeners here, not just the one that triggered the error. - // Note that this may need to be scoped to just this listener if we change permissions on filtered children - const error = errorForServerCode(status, query); - return syncTreeRemoveEventRegistration(syncTree, query, - /*eventRegistration*/ null, error); - } - } - }; -} -/** - * Return the tag associated with the given query. - */ -function syncTreeTagForQuery(syncTree, query) { - const queryKey = syncTreeMakeQueryKey_(query); - return syncTree.queryToTagMap.get(queryKey); -} -/** - * Given a query, computes a "queryKey" suitable for use in our queryToTagMap_. - */ -function syncTreeMakeQueryKey_(query) { - return query._path.toString() + '$' + query._queryIdentifier; -} -/** - * Return the query associated with the given tag, if we have one - */ -function syncTreeQueryKeyForTag_(syncTree, tag) { - return syncTree.tagToQueryMap.get(tag); -} -/** - * Given a queryKey (created by makeQueryKey), parse it back into a path and queryId. - */ -function syncTreeParseQueryKey_(queryKey) { - const splitIndex = queryKey.indexOf('$'); - assert(splitIndex !== -1 && splitIndex < queryKey.length - 1, 'Bad queryKey.'); - return { - queryId: queryKey.substr(splitIndex + 1), - path: new Path(queryKey.substr(0, splitIndex)) - }; -} -/** - * A helper method to apply tagged operations - */ -function syncTreeApplyTaggedOperation_(syncTree, queryPath, operation) { - const syncPoint = syncTree.syncPointTree_.get(queryPath); - assert(syncPoint, "Missing sync point for query tag that we're tracking"); - const writesCache = writeTreeChildWrites(syncTree.pendingWriteTree_, queryPath); - return syncPointApplyOperation(syncPoint, operation, writesCache, null); -} -/** - * This collapses multiple unfiltered views into a single view, since we only need a single - * listener for them. - */ -function syncTreeCollectDistinctViewsForSubTree_(subtree) { - return subtree.fold((relativePath, maybeChildSyncPoint, childMap) => { - if (maybeChildSyncPoint && syncPointHasCompleteView(maybeChildSyncPoint)) { - const completeView = syncPointGetCompleteView(maybeChildSyncPoint); - return [completeView]; - } - else { - // No complete view here, flatten any deeper listens into an array - let views = []; - if (maybeChildSyncPoint) { - views = syncPointGetQueryViews(maybeChildSyncPoint); - } - each(childMap, (_key, childViews) => { - views = views.concat(childViews); - }); - return views; - } - }); -} -/** - * Normalizes a query to a query we send the server for listening - * - * @returns The normalized query - */ -function syncTreeQueryForListening_(query) { - if (query._queryParams.loadsAllData() && !query._queryParams.isDefault()) { - // We treat queries that load all data as default queries - // Cast is necessary because ref() technically returns Firebase which is actually fb.api.Firebase which inherits - // from Query - return new (syncTreeGetReferenceConstructor())(query._repo, query._path); - } - else { - return query; - } -} -function syncTreeRemoveTags_(syncTree, queries) { - for (let j = 0; j < queries.length; ++j) { - const removedQuery = queries[j]; - if (!removedQuery._queryParams.loadsAllData()) { - // We should have a tag for this - const removedQueryKey = syncTreeMakeQueryKey_(removedQuery); - const removedQueryTag = syncTree.queryToTagMap.get(removedQueryKey); - syncTree.queryToTagMap.delete(removedQueryKey); - syncTree.tagToQueryMap.delete(removedQueryTag); - } - } -} -/** - * Static accessor for query tags. - */ -function syncTreeGetNextQueryTag_() { - return syncTreeNextQueryTag_++; -} -/** - * For a given new listen, manage the de-duplication of outstanding subscriptions. - * - * @returns This method can return events to support synchronous data sources - */ -function syncTreeSetupListener_(syncTree, query, view) { - const path = query._path; - const tag = syncTreeTagForQuery(syncTree, query); - const listener = syncTreeCreateListenerForView_(syncTree, view); - const events = syncTree.listenProvider_.startListening(syncTreeQueryForListening_(query), tag, listener.hashFn, listener.onComplete); - const subtree = syncTree.syncPointTree_.subtree(path); - // The root of this subtree has our query. We're here because we definitely need to send a listen for that, but we - // may need to shadow other listens as well. - if (tag) { - assert(!syncPointHasCompleteView(subtree.value), "If we're adding a query, it shouldn't be shadowed"); - } - else { - // Shadow everything at or below this location, this is a default listener. - const queriesToStop = subtree.fold((relativePath, maybeChildSyncPoint, childMap) => { - if (!pathIsEmpty(relativePath) && - maybeChildSyncPoint && - syncPointHasCompleteView(maybeChildSyncPoint)) { - return [syncPointGetCompleteView(maybeChildSyncPoint).query]; - } - else { - // No default listener here, flatten any deeper queries into an array - let queries = []; - if (maybeChildSyncPoint) { - queries = queries.concat(syncPointGetQueryViews(maybeChildSyncPoint).map(view => view.query)); - } - each(childMap, (_key, childQueries) => { - queries = queries.concat(childQueries); - }); - return queries; - } - }); - for (let i = 0; i < queriesToStop.length; ++i) { - const queryToStop = queriesToStop[i]; - syncTree.listenProvider_.stopListening(syncTreeQueryForListening_(queryToStop), syncTreeTagForQuery(syncTree, queryToStop)); - } - } - return events; -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -class ExistingValueProvider { - constructor(node_) { - this.node_ = node_; - } - getImmediateChild(childName) { - const child = this.node_.getImmediateChild(childName); - return new ExistingValueProvider(child); - } - node() { - return this.node_; - } -} -class DeferredValueProvider { - constructor(syncTree, path) { - this.syncTree_ = syncTree; - this.path_ = path; - } - getImmediateChild(childName) { - const childPath = pathChild(this.path_, childName); - return new DeferredValueProvider(this.syncTree_, childPath); - } - node() { - return syncTreeCalcCompleteEventCache(this.syncTree_, this.path_); - } -} -/** - * Generate placeholders for deferred values. - */ -const generateWithValues = function (values) { - values = values || {}; - values['timestamp'] = values['timestamp'] || new Date().getTime(); - return values; -}; -/** - * Value to use when firing local events. When writing server values, fire - * local events with an approximate value, otherwise return value as-is. - */ -const resolveDeferredLeafValue = function (value, existingVal, serverValues) { - if (!value || typeof value !== 'object') { - return value; - } - assert('.sv' in value, 'Unexpected leaf node or priority contents'); - if (typeof value['.sv'] === 'string') { - return resolveScalarDeferredValue(value['.sv'], existingVal, serverValues); - } - else if (typeof value['.sv'] === 'object') { - return resolveComplexDeferredValue(value['.sv'], existingVal); - } - else { - assert(false, 'Unexpected server value: ' + JSON.stringify(value, null, 2)); - } -}; -const resolveScalarDeferredValue = function (op, existing, serverValues) { - switch (op) { - case 'timestamp': - return serverValues['timestamp']; - default: - assert(false, 'Unexpected server value: ' + op); - } -}; -const resolveComplexDeferredValue = function (op, existing, unused) { - if (!op.hasOwnProperty('increment')) { - assert(false, 'Unexpected server value: ' + JSON.stringify(op, null, 2)); - } - const delta = op['increment']; - if (typeof delta !== 'number') { - assert(false, 'Unexpected increment value: ' + delta); - } - const existingNode = existing.node(); - assert(existingNode !== null && typeof existingNode !== 'undefined', 'Expected ChildrenNode.EMPTY_NODE for nulls'); - // Incrementing a non-number sets the value to the incremented amount - if (!existingNode.isLeafNode()) { - return delta; - } - const leaf = existingNode; - const existingVal = leaf.getValue(); - if (typeof existingVal !== 'number') { - return delta; - } - // No need to do over/underflow arithmetic here because JS only handles floats under the covers - return existingVal + delta; -}; -/** - * Recursively replace all deferred values and priorities in the tree with the - * specified generated replacement values. - * @param path - path to which write is relative - * @param node - new data written at path - * @param syncTree - current data - */ -const resolveDeferredValueTree = function (path, node, syncTree, serverValues) { - return resolveDeferredValue(node, new DeferredValueProvider(syncTree, path), serverValues); -}; -/** - * Recursively replace all deferred values and priorities in the node with the - * specified generated replacement values. If there are no server values in the node, - * it'll be returned as-is. - */ -const resolveDeferredValueSnapshot = function (node, existing, serverValues) { - return resolveDeferredValue(node, new ExistingValueProvider(existing), serverValues); -}; -function resolveDeferredValue(node, existingVal, serverValues) { - const rawPri = node.getPriority().val(); - const priority = resolveDeferredLeafValue(rawPri, existingVal.getImmediateChild('.priority'), serverValues); - let newNode; - if (node.isLeafNode()) { - const leafNode = node; - const value = resolveDeferredLeafValue(leafNode.getValue(), existingVal, serverValues); - if (value !== leafNode.getValue() || - priority !== leafNode.getPriority().val()) { - return new LeafNode(value, nodeFromJSON(priority)); - } - else { - return node; - } - } - else { - const childrenNode = node; - newNode = childrenNode; - if (priority !== childrenNode.getPriority().val()) { - newNode = newNode.updatePriority(new LeafNode(priority)); - } - childrenNode.forEachChild(PRIORITY_INDEX, (childName, childNode) => { - const newChildNode = resolveDeferredValue(childNode, existingVal.getImmediateChild(childName), serverValues); - if (newChildNode !== childNode) { - newNode = newNode.updateImmediateChild(childName, newChildNode); - } - }); - return newNode; - } -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * A light-weight tree, traversable by path. Nodes can have both values and children. - * Nodes are not enumerated (by forEachChild) unless they have a value or non-empty - * children. - */ -class Tree { - /** - * @param name - Optional name of the node. - * @param parent - Optional parent node. - * @param node - Optional node to wrap. - */ - constructor(name = '', parent = null, node = { children: {}, childCount: 0 }) { - this.name = name; - this.parent = parent; - this.node = node; - } -} -/** - * Returns a sub-Tree for the given path. - * - * @param pathObj - Path to look up. - * @returns Tree for path. - */ -function treeSubTree(tree, pathObj) { - // TODO: Require pathObj to be Path? - let path = pathObj instanceof Path ? pathObj : new Path(pathObj); - let child = tree, next = pathGetFront(path); - while (next !== null) { - const childNode = safeGet(child.node.children, next) || { - children: {}, - childCount: 0 - }; - child = new Tree(next, child, childNode); - path = pathPopFront(path); - next = pathGetFront(path); - } - return child; -} -/** - * Returns the data associated with this tree node. - * - * @returns The data or null if no data exists. - */ -function treeGetValue(tree) { - return tree.node.value; -} -/** - * Sets data to this tree node. - * - * @param value - Value to set. - */ -function treeSetValue(tree, value) { - tree.node.value = value; - treeUpdateParents(tree); -} -/** - * @returns Whether the tree has any children. - */ -function treeHasChildren(tree) { - return tree.node.childCount > 0; -} -/** - * @returns Whethe rthe tree is empty (no value or children). - */ -function treeIsEmpty(tree) { - return treeGetValue(tree) === undefined && !treeHasChildren(tree); -} -/** - * Calls action for each child of this tree node. - * - * @param action - Action to be called for each child. - */ -function treeForEachChild(tree, action) { - each(tree.node.children, (child, childTree) => { - action(new Tree(child, tree, childTree)); - }); -} -/** - * Does a depth-first traversal of this node's descendants, calling action for each one. - * - * @param action - Action to be called for each child. - * @param includeSelf - Whether to call action on this node as well. Defaults to - * false. - * @param childrenFirst - Whether to call action on children before calling it on - * parent. - */ -function treeForEachDescendant(tree, action, includeSelf, childrenFirst) { - if (includeSelf && !childrenFirst) { - action(tree); - } - treeForEachChild(tree, child => { - treeForEachDescendant(child, action, true, childrenFirst); - }); - if (includeSelf && childrenFirst) { - action(tree); - } -} -/** - * Calls action on each ancestor node. - * - * @param action - Action to be called on each parent; return - * true to abort. - * @param includeSelf - Whether to call action on this node as well. - * @returns true if the action callback returned true. - */ -function treeForEachAncestor(tree, action, includeSelf) { - let node = includeSelf ? tree : tree.parent; - while (node !== null) { - if (action(node)) { - return true; - } - node = node.parent; - } - return false; -} -/** - * @returns The path of this tree node, as a Path. - */ -function treeGetPath(tree) { - return new Path(tree.parent === null - ? tree.name - : treeGetPath(tree.parent) + '/' + tree.name); -} -/** - * Adds or removes this child from its parent based on whether it's empty or not. - */ -function treeUpdateParents(tree) { - if (tree.parent !== null) { - treeUpdateChild(tree.parent, tree.name, tree); - } -} -/** - * Adds or removes the passed child to this tree node, depending on whether it's empty. - * - * @param childName - The name of the child to update. - * @param child - The child to update. - */ -function treeUpdateChild(tree, childName, child) { - const childEmpty = treeIsEmpty(child); - const childExists = contains(tree.node.children, childName); - if (childEmpty && childExists) { - delete tree.node.children[childName]; - tree.node.childCount--; - treeUpdateParents(tree); - } - else if (!childEmpty && !childExists) { - tree.node.children[childName] = child.node; - tree.node.childCount++; - treeUpdateParents(tree); - } -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * True for invalid Firebase keys - */ -const INVALID_KEY_REGEX_ = /[\[\].#$\/\u0000-\u001F\u007F]/; -/** - * True for invalid Firebase paths. - * Allows '/' in paths. - */ -const INVALID_PATH_REGEX_ = /[\[\].#$\u0000-\u001F\u007F]/; -/** - * Maximum number of characters to allow in leaf value - */ -const MAX_LEAF_SIZE_ = 10 * 1024 * 1024; -const isValidKey = function (key) { - return (typeof key === 'string' && key.length !== 0 && !INVALID_KEY_REGEX_.test(key)); -}; -const isValidPathString = function (pathString) { - return (typeof pathString === 'string' && - pathString.length !== 0 && - !INVALID_PATH_REGEX_.test(pathString)); -}; -const isValidRootPathString = function (pathString) { - if (pathString) { - // Allow '/.info/' at the beginning. - pathString = pathString.replace(/^\/*\.info(\/|$)/, '/'); - } - return isValidPathString(pathString); -}; -const isValidPriority = function (priority) { - return (priority === null || - typeof priority === 'string' || - (typeof priority === 'number' && !isInvalidJSONNumber(priority)) || - (priority && - typeof priority === 'object' && - // eslint-disable-next-line @typescript-eslint/no-explicit-any - contains(priority, '.sv'))); -}; -/** - * Pre-validate a datum passed as an argument to Firebase function. - */ -const validateFirebaseDataArg = function (fnName, value, path, optional) { - if (optional && value === undefined) { - return; - } - validateFirebaseData(errorPrefix(fnName, 'value'), value, path); -}; -/** - * Validate a data object client-side before sending to server. - */ -const validateFirebaseData = function (errorPrefix, data, path_) { - const path = path_ instanceof Path ? new ValidationPath(path_, errorPrefix) : path_; - if (data === undefined) { - throw new Error(errorPrefix + 'contains undefined ' + validationPathToErrorString(path)); - } - if (typeof data === 'function') { - throw new Error(errorPrefix + - 'contains a function ' + - validationPathToErrorString(path) + - ' with contents = ' + - data.toString()); - } - if (isInvalidJSONNumber(data)) { - throw new Error(errorPrefix + - 'contains ' + - data.toString() + - ' ' + - validationPathToErrorString(path)); - } - // Check max leaf size, but try to avoid the utf8 conversion if we can. - if (typeof data === 'string' && - data.length > MAX_LEAF_SIZE_ / 3 && - stringLength(data) > MAX_LEAF_SIZE_) { - throw new Error(errorPrefix + - 'contains a string greater than ' + - MAX_LEAF_SIZE_ + - ' utf8 bytes ' + - validationPathToErrorString(path) + - " ('" + - data.substring(0, 50) + - "...')"); - } - // TODO = Perf = Consider combining the recursive validation of keys into NodeFromJSON - // to save extra walking of large objects. - if (data && typeof data === 'object') { - let hasDotValue = false; - let hasActualChild = false; - each(data, (key, value) => { - if (key === '.value') { - hasDotValue = true; - } - else if (key !== '.priority' && key !== '.sv') { - hasActualChild = true; - if (!isValidKey(key)) { - throw new Error(errorPrefix + - ' contains an invalid key (' + - key + - ') ' + - validationPathToErrorString(path) + - '. Keys must be non-empty strings ' + - 'and can\'t contain ".", "#", "$", "/", "[", or "]"'); - } - } - validationPathPush(path, key); - validateFirebaseData(errorPrefix, value, path); - validationPathPop(path); - }); - if (hasDotValue && hasActualChild) { - throw new Error(errorPrefix + - ' contains ".value" child ' + - validationPathToErrorString(path) + - ' in addition to actual children.'); - } - } -}; -/** - * Pre-validate paths passed in the firebase function. - */ -const validateFirebaseMergePaths = function (errorPrefix, mergePaths) { - let i, curPath; - for (i = 0; i < mergePaths.length; i++) { - curPath = mergePaths[i]; - const keys = pathSlice(curPath); - for (let j = 0; j < keys.length; j++) { - if (keys[j] === '.priority' && j === keys.length - 1) ; - else if (!isValidKey(keys[j])) { - throw new Error(errorPrefix + - 'contains an invalid key (' + - keys[j] + - ') in path ' + - curPath.toString() + - '. Keys must be non-empty strings ' + - 'and can\'t contain ".", "#", "$", "/", "[", or "]"'); - } - } - } - // Check that update keys are not descendants of each other. - // We rely on the property that sorting guarantees that ancestors come - // right before descendants. - mergePaths.sort(pathCompare); - let prevPath = null; - for (i = 0; i < mergePaths.length; i++) { - curPath = mergePaths[i]; - if (prevPath !== null && pathContains(prevPath, curPath)) { - throw new Error(errorPrefix + - 'contains a path ' + - prevPath.toString() + - ' that is ancestor of another path ' + - curPath.toString()); - } - prevPath = curPath; - } -}; -/** - * pre-validate an object passed as an argument to firebase function ( - * must be an object - e.g. for firebase.update()). - */ -const validateFirebaseMergeDataArg = function (fnName, data, path, optional) { - if (optional && data === undefined) { - return; - } - const errorPrefix$1 = errorPrefix(fnName, 'values'); - if (!(data && typeof data === 'object') || Array.isArray(data)) { - throw new Error(errorPrefix$1 + ' must be an object containing the children to replace.'); - } - const mergePaths = []; - each(data, (key, value) => { - const curPath = new Path(key); - validateFirebaseData(errorPrefix$1, value, pathChild(path, curPath)); - if (pathGetBack(curPath) === '.priority') { - if (!isValidPriority(value)) { - throw new Error(errorPrefix$1 + - "contains an invalid value for '" + - curPath.toString() + - "', which must be a valid " + - 'Firebase priority (a string, finite number, server value, or null).'); - } - } - mergePaths.push(curPath); - }); - validateFirebaseMergePaths(errorPrefix$1, mergePaths); -}; -const validatePriority = function (fnName, priority, optional) { - if (optional && priority === undefined) { - return; - } - if (isInvalidJSONNumber(priority)) { - throw new Error(errorPrefix(fnName, 'priority') + - 'is ' + - priority.toString() + - ', but must be a valid Firebase priority (a string, finite number, ' + - 'server value, or null).'); - } - // Special case to allow importing data with a .sv. - if (!isValidPriority(priority)) { - throw new Error(errorPrefix(fnName, 'priority') + - 'must be a valid Firebase priority ' + - '(a string, finite number, server value, or null).'); - } -}; -const validateKey = function (fnName, argumentName, key, optional) { - if (optional && key === undefined) { - return; - } - if (!isValidKey(key)) { - throw new Error(errorPrefix(fnName, argumentName) + - 'was an invalid key = "' + - key + - '". Firebase keys must be non-empty strings and ' + - 'can\'t contain ".", "#", "$", "/", "[", or "]").'); - } -}; -/** - * @internal - */ -const validatePathString = function (fnName, argumentName, pathString, optional) { - if (optional && pathString === undefined) { - return; - } - if (!isValidPathString(pathString)) { - throw new Error(errorPrefix(fnName, argumentName) + - 'was an invalid path = "' + - pathString + - '". Paths must be non-empty strings and ' + - 'can\'t contain ".", "#", "$", "[", or "]"'); - } -}; -const validateRootPathString = function (fnName, argumentName, pathString, optional) { - if (pathString) { - // Allow '/.info/' at the beginning. - pathString = pathString.replace(/^\/*\.info(\/|$)/, '/'); - } - validatePathString(fnName, argumentName, pathString, optional); -}; -/** - * @internal - */ -const validateWritablePath = function (fnName, path) { - if (pathGetFront(path) === '.info') { - throw new Error(fnName + " failed = Can't modify data under /.info/"); - } -}; -const validateUrl = function (fnName, parsedUrl) { - // TODO = Validate server better. - const pathString = parsedUrl.path.toString(); - if (!(typeof parsedUrl.repoInfo.host === 'string') || - parsedUrl.repoInfo.host.length === 0 || - (!isValidKey(parsedUrl.repoInfo.namespace) && - parsedUrl.repoInfo.host.split(':')[0] !== 'localhost') || - (pathString.length !== 0 && !isValidRootPathString(pathString))) { - throw new Error(errorPrefix(fnName, 'url') + - 'must be a valid firebase URL and ' + - 'the path can\'t contain ".", "#", "$", "[", or "]".'); - } -}; - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * The event queue serves a few purposes: - * 1. It ensures we maintain event order in the face of event callbacks doing operations that result in more - * events being queued. - * 2. raiseQueuedEvents() handles being called reentrantly nicely. That is, if in the course of raising events, - * raiseQueuedEvents() is called again, the "inner" call will pick up raising events where the "outer" call - * left off, ensuring that the events are still raised synchronously and in order. - * 3. You can use raiseEventsAtPath and raiseEventsForChangedPath to ensure only relevant previously-queued - * events are raised synchronously. - * - * NOTE: This can all go away if/when we move to async events. - * - */ -class EventQueue { - constructor() { - this.eventLists_ = []; - /** - * Tracks recursion depth of raiseQueuedEvents_, for debugging purposes. - */ - this.recursionDepth_ = 0; - } -} -/** - * @param eventDataList - The new events to queue. - */ -function eventQueueQueueEvents(eventQueue, eventDataList) { - // We group events by path, storing them in a single EventList, to make it easier to skip over them quickly. - let currList = null; - for (let i = 0; i < eventDataList.length; i++) { - const data = eventDataList[i]; - const path = data.getPath(); - if (currList !== null && !pathEquals(path, currList.path)) { - eventQueue.eventLists_.push(currList); - currList = null; - } - if (currList === null) { - currList = { events: [], path }; - } - currList.events.push(data); - } - if (currList) { - eventQueue.eventLists_.push(currList); - } -} -/** - * Queues the specified events and synchronously raises all events (including previously queued ones) - * for the specified path. - * - * It is assumed that the new events are all for the specified path. - * - * @param path - The path to raise events for. - * @param eventDataList - The new events to raise. - */ -function eventQueueRaiseEventsAtPath(eventQueue, path, eventDataList) { - eventQueueQueueEvents(eventQueue, eventDataList); - eventQueueRaiseQueuedEventsMatchingPredicate(eventQueue, eventPath => pathEquals(eventPath, path)); -} -/** - * Queues the specified events and synchronously raises all events (including previously queued ones) for - * locations related to the specified change path (i.e. all ancestors and descendants). - * - * It is assumed that the new events are all related (ancestor or descendant) to the specified path. - * - * @param changedPath - The path to raise events for. - * @param eventDataList - The events to raise - */ -function eventQueueRaiseEventsForChangedPath(eventQueue, changedPath, eventDataList) { - eventQueueQueueEvents(eventQueue, eventDataList); - eventQueueRaiseQueuedEventsMatchingPredicate(eventQueue, eventPath => pathContains(eventPath, changedPath) || - pathContains(changedPath, eventPath)); -} -function eventQueueRaiseQueuedEventsMatchingPredicate(eventQueue, predicate) { - eventQueue.recursionDepth_++; - let sentAll = true; - for (let i = 0; i < eventQueue.eventLists_.length; i++) { - const eventList = eventQueue.eventLists_[i]; - if (eventList) { - const eventPath = eventList.path; - if (predicate(eventPath)) { - eventListRaise(eventQueue.eventLists_[i]); - eventQueue.eventLists_[i] = null; - } - else { - sentAll = false; - } - } - } - if (sentAll) { - eventQueue.eventLists_ = []; - } - eventQueue.recursionDepth_--; -} -/** - * Iterates through the list and raises each event - */ -function eventListRaise(eventList) { - for (let i = 0; i < eventList.events.length; i++) { - const eventData = eventList.events[i]; - if (eventData !== null) { - eventList.events[i] = null; - const eventFn = eventData.getEventRunner(); - if (logger) { - log('event: ' + eventData.toString()); - } - exceptionGuard(eventFn); - } - } -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -const INTERRUPT_REASON = 'repo_interrupt'; -/** - * If a transaction does not succeed after 25 retries, we abort it. Among other - * things this ensure that if there's ever a bug causing a mismatch between - * client / server hashes for some data, we won't retry indefinitely. - */ -const MAX_TRANSACTION_RETRIES = 25; -/** - * A connection to a single data repository. - */ -class Repo { - constructor(repoInfo_, forceRestClient_, authTokenProvider_, appCheckProvider_) { - this.repoInfo_ = repoInfo_; - this.forceRestClient_ = forceRestClient_; - this.authTokenProvider_ = authTokenProvider_; - this.appCheckProvider_ = appCheckProvider_; - this.dataUpdateCount = 0; - this.statsListener_ = null; - this.eventQueue_ = new EventQueue(); - this.nextWriteId_ = 1; - this.interceptServerDataCallback_ = null; - /** A list of data pieces and paths to be set when this client disconnects. */ - this.onDisconnect_ = newSparseSnapshotTree(); - /** Stores queues of outstanding transactions for Firebase locations. */ - this.transactionQueueTree_ = new Tree(); - // TODO: This should be @private but it's used by test_access.js and internal.js - this.persistentConnection_ = null; - // This key is intentionally not updated if RepoInfo is later changed or replaced - this.key = this.repoInfo_.toURLString(); - } - /** - * @returns The URL corresponding to the root of this Firebase. - */ - toString() { - return ((this.repoInfo_.secure ? 'https://' : 'http://') + this.repoInfo_.host); - } -} -function repoStart(repo, appId, authOverride) { - repo.stats_ = statsManagerGetCollection(repo.repoInfo_); - if (repo.forceRestClient_ || beingCrawled()) { - repo.server_ = new ReadonlyRestClient(repo.repoInfo_, (pathString, data, isMerge, tag) => { - repoOnDataUpdate(repo, pathString, data, isMerge, tag); - }, repo.authTokenProvider_, repo.appCheckProvider_); - // Minor hack: Fire onConnect immediately, since there's no actual connection. - setTimeout(() => repoOnConnectStatus(repo, /* connectStatus= */ true), 0); - } - else { - // Validate authOverride - if (typeof authOverride !== 'undefined' && authOverride !== null) { - if (typeof authOverride !== 'object') { - throw new Error('Only objects are supported for option databaseAuthVariableOverride'); - } - try { - stringify(authOverride); - } - catch (e) { - throw new Error('Invalid authOverride provided: ' + e); - } - } - repo.persistentConnection_ = new PersistentConnection(repo.repoInfo_, appId, (pathString, data, isMerge, tag) => { - repoOnDataUpdate(repo, pathString, data, isMerge, tag); - }, (connectStatus) => { - repoOnConnectStatus(repo, connectStatus); - }, (updates) => { - repoOnServerInfoUpdate(repo, updates); - }, repo.authTokenProvider_, repo.appCheckProvider_, authOverride); - repo.server_ = repo.persistentConnection_; - } - repo.authTokenProvider_.addTokenChangeListener(token => { - repo.server_.refreshAuthToken(token); - }); - repo.appCheckProvider_.addTokenChangeListener(result => { - repo.server_.refreshAppCheckToken(result.token); - }); - // In the case of multiple Repos for the same repoInfo (i.e. there are multiple Firebase.Contexts being used), - // we only want to create one StatsReporter. As such, we'll report stats over the first Repo created. - repo.statsReporter_ = statsManagerGetOrCreateReporter(repo.repoInfo_, () => new StatsReporter(repo.stats_, repo.server_)); - // Used for .info. - repo.infoData_ = new SnapshotHolder(); - repo.infoSyncTree_ = new SyncTree({ - startListening: (query, tag, currentHashFn, onComplete) => { - let infoEvents = []; - const node = repo.infoData_.getNode(query._path); - // This is possibly a hack, but we have different semantics for .info endpoints. We don't raise null events - // on initial data... - if (!node.isEmpty()) { - infoEvents = syncTreeApplyServerOverwrite(repo.infoSyncTree_, query._path, node); - setTimeout(() => { - onComplete('ok'); - }, 0); - } - return infoEvents; - }, - stopListening: () => { } - }); - repoUpdateInfo(repo, 'connected', false); - repo.serverSyncTree_ = new SyncTree({ - startListening: (query, tag, currentHashFn, onComplete) => { - repo.server_.listen(query, currentHashFn, tag, (status, data) => { - const events = onComplete(status, data); - eventQueueRaiseEventsForChangedPath(repo.eventQueue_, query._path, events); - }); - // No synchronous events for network-backed sync trees - return []; - }, - stopListening: (query, tag) => { - repo.server_.unlisten(query, tag); - } - }); -} -/** - * @returns The time in milliseconds, taking the server offset into account if we have one. - */ -function repoServerTime(repo) { - const offsetNode = repo.infoData_.getNode(new Path('.info/serverTimeOffset')); - const offset = offsetNode.val() || 0; - return new Date().getTime() + offset; -} -/** - * Generate ServerValues using some variables from the repo object. - */ -function repoGenerateServerValues(repo) { - return generateWithValues({ - timestamp: repoServerTime(repo) - }); -} -/** - * Called by realtime when we get new messages from the server. - */ -function repoOnDataUpdate(repo, pathString, data, isMerge, tag) { - // For testing. - repo.dataUpdateCount++; - const path = new Path(pathString); - data = repo.interceptServerDataCallback_ - ? repo.interceptServerDataCallback_(pathString, data) - : data; - let events = []; - if (tag) { - if (isMerge) { - const taggedChildren = map(data, (raw) => nodeFromJSON(raw)); - events = syncTreeApplyTaggedQueryMerge(repo.serverSyncTree_, path, taggedChildren, tag); - } - else { - const taggedSnap = nodeFromJSON(data); - events = syncTreeApplyTaggedQueryOverwrite(repo.serverSyncTree_, path, taggedSnap, tag); - } - } - else if (isMerge) { - const changedChildren = map(data, (raw) => nodeFromJSON(raw)); - events = syncTreeApplyServerMerge(repo.serverSyncTree_, path, changedChildren); - } - else { - const snap = nodeFromJSON(data); - events = syncTreeApplyServerOverwrite(repo.serverSyncTree_, path, snap); - } - let affectedPath = path; - if (events.length > 0) { - // Since we have a listener outstanding for each transaction, receiving any events - // is a proxy for some change having occurred. - affectedPath = repoRerunTransactions(repo, path); - } - eventQueueRaiseEventsForChangedPath(repo.eventQueue_, affectedPath, events); -} -function repoOnConnectStatus(repo, connectStatus) { - repoUpdateInfo(repo, 'connected', connectStatus); - if (connectStatus === false) { - repoRunOnDisconnectEvents(repo); - } -} -function repoOnServerInfoUpdate(repo, updates) { - each(updates, (key, value) => { - repoUpdateInfo(repo, key, value); - }); -} -function repoUpdateInfo(repo, pathString, value) { - const path = new Path('/.info/' + pathString); - const newNode = nodeFromJSON(value); - repo.infoData_.updateSnapshot(path, newNode); - const events = syncTreeApplyServerOverwrite(repo.infoSyncTree_, path, newNode); - eventQueueRaiseEventsForChangedPath(repo.eventQueue_, path, events); -} -function repoGetNextWriteId(repo) { - return repo.nextWriteId_++; -} -/** - * The purpose of `getValue` is to return the latest known value - * satisfying `query`. - * - * This method will first check for in-memory cached values - * belonging to active listeners. If they are found, such values - * are considered to be the most up-to-date. - * - * If the client is not connected, this method will wait until the - * repo has established a connection and then request the value for `query`. - * If the client is not able to retrieve the query result for another reason, - * it reports an error. - * - * @param query - The query to surface a value for. - */ -function repoGetValue(repo, query, eventRegistration) { - // Only active queries are cached. There is no persisted cache. - const cached = syncTreeGetServerValue(repo.serverSyncTree_, query); - if (cached != null) { - return Promise.resolve(cached); - } - return repo.server_.get(query).then(payload => { - const node = nodeFromJSON(payload).withIndex(query._queryParams.getIndex()); - /** - * Below we simulate the actions of an `onlyOnce` `onValue()` event where: - * Add an event registration, - * Update data at the path, - * Raise any events, - * Cleanup the SyncTree - */ - syncTreeAddEventRegistration(repo.serverSyncTree_, query, eventRegistration, true); - let events; - if (query._queryParams.loadsAllData()) { - events = syncTreeApplyServerOverwrite(repo.serverSyncTree_, query._path, node); - } - else { - const tag = syncTreeTagForQuery(repo.serverSyncTree_, query); - events = syncTreeApplyTaggedQueryOverwrite(repo.serverSyncTree_, query._path, node, tag); - } - /* - * We need to raise events in the scenario where `get()` is called at a parent path, and - * while the `get()` is pending, `onValue` is called at a child location. While get() is waiting - * for the data, `onValue` will register a new event. Then, get() will come back, and update the syncTree - * and its corresponding serverCache, including the child location where `onValue` is called. Then, - * `onValue` will receive the event from the server, but look at the syncTree and see that the data received - * from the server is already at the SyncPoint, and so the `onValue` callback will never get fired. - * Calling `eventQueueRaiseEventsForChangedPath()` is the correct way to propagate the events and - * ensure the corresponding child events will get fired. - */ - eventQueueRaiseEventsForChangedPath(repo.eventQueue_, query._path, events); - syncTreeRemoveEventRegistration(repo.serverSyncTree_, query, eventRegistration, null, true); - return node; - }, err => { - repoLog(repo, 'get for query ' + stringify(query) + ' failed: ' + err); - return Promise.reject(new Error(err)); - }); -} -function repoSetWithPriority(repo, path, newVal, newPriority, onComplete) { - repoLog(repo, 'set', { - path: path.toString(), - value: newVal, - priority: newPriority - }); - // TODO: Optimize this behavior to either (a) store flag to skip resolving where possible and / or - // (b) store unresolved paths on JSON parse - const serverValues = repoGenerateServerValues(repo); - const newNodeUnresolved = nodeFromJSON(newVal, newPriority); - const existing = syncTreeCalcCompleteEventCache(repo.serverSyncTree_, path); - const newNode = resolveDeferredValueSnapshot(newNodeUnresolved, existing, serverValues); - const writeId = repoGetNextWriteId(repo); - const events = syncTreeApplyUserOverwrite(repo.serverSyncTree_, path, newNode, writeId, true); - eventQueueQueueEvents(repo.eventQueue_, events); - repo.server_.put(path.toString(), newNodeUnresolved.val(/*export=*/ true), (status, errorReason) => { - const success = status === 'ok'; - if (!success) { - warn('set at ' + path + ' failed: ' + status); - } - const clearEvents = syncTreeAckUserWrite(repo.serverSyncTree_, writeId, !success); - eventQueueRaiseEventsForChangedPath(repo.eventQueue_, path, clearEvents); - repoCallOnCompleteCallback(repo, onComplete, status, errorReason); - }); - const affectedPath = repoAbortTransactions(repo, path); - repoRerunTransactions(repo, affectedPath); - // We queued the events above, so just flush the queue here - eventQueueRaiseEventsForChangedPath(repo.eventQueue_, affectedPath, []); -} -function repoUpdate(repo, path, childrenToMerge, onComplete) { - repoLog(repo, 'update', { path: path.toString(), value: childrenToMerge }); - // Start with our existing data and merge each child into it. - let empty = true; - const serverValues = repoGenerateServerValues(repo); - const changedChildren = {}; - each(childrenToMerge, (changedKey, changedValue) => { - empty = false; - changedChildren[changedKey] = resolveDeferredValueTree(pathChild(path, changedKey), nodeFromJSON(changedValue), repo.serverSyncTree_, serverValues); - }); - if (!empty) { - const writeId = repoGetNextWriteId(repo); - const events = syncTreeApplyUserMerge(repo.serverSyncTree_, path, changedChildren, writeId); - eventQueueQueueEvents(repo.eventQueue_, events); - repo.server_.merge(path.toString(), childrenToMerge, (status, errorReason) => { - const success = status === 'ok'; - if (!success) { - warn('update at ' + path + ' failed: ' + status); - } - const clearEvents = syncTreeAckUserWrite(repo.serverSyncTree_, writeId, !success); - const affectedPath = clearEvents.length > 0 ? repoRerunTransactions(repo, path) : path; - eventQueueRaiseEventsForChangedPath(repo.eventQueue_, affectedPath, clearEvents); - repoCallOnCompleteCallback(repo, onComplete, status, errorReason); - }); - each(childrenToMerge, (changedPath) => { - const affectedPath = repoAbortTransactions(repo, pathChild(path, changedPath)); - repoRerunTransactions(repo, affectedPath); - }); - // We queued the events above, so just flush the queue here - eventQueueRaiseEventsForChangedPath(repo.eventQueue_, path, []); - } - else { - log("update() called with empty data. Don't do anything."); - repoCallOnCompleteCallback(repo, onComplete, 'ok', undefined); - } -} -/** - * Applies all of the changes stored up in the onDisconnect_ tree. - */ -function repoRunOnDisconnectEvents(repo) { - repoLog(repo, 'onDisconnectEvents'); - const serverValues = repoGenerateServerValues(repo); - const resolvedOnDisconnectTree = newSparseSnapshotTree(); - sparseSnapshotTreeForEachTree(repo.onDisconnect_, newEmptyPath(), (path, node) => { - const resolved = resolveDeferredValueTree(path, node, repo.serverSyncTree_, serverValues); - sparseSnapshotTreeRemember(resolvedOnDisconnectTree, path, resolved); - }); - let events = []; - sparseSnapshotTreeForEachTree(resolvedOnDisconnectTree, newEmptyPath(), (path, snap) => { - events = events.concat(syncTreeApplyServerOverwrite(repo.serverSyncTree_, path, snap)); - const affectedPath = repoAbortTransactions(repo, path); - repoRerunTransactions(repo, affectedPath); - }); - repo.onDisconnect_ = newSparseSnapshotTree(); - eventQueueRaiseEventsForChangedPath(repo.eventQueue_, newEmptyPath(), events); -} -function repoOnDisconnectCancel(repo, path, onComplete) { - repo.server_.onDisconnectCancel(path.toString(), (status, errorReason) => { - if (status === 'ok') { - sparseSnapshotTreeForget(repo.onDisconnect_, path); - } - repoCallOnCompleteCallback(repo, onComplete, status, errorReason); - }); -} -function repoOnDisconnectSet(repo, path, value, onComplete) { - const newNode = nodeFromJSON(value); - repo.server_.onDisconnectPut(path.toString(), newNode.val(/*export=*/ true), (status, errorReason) => { - if (status === 'ok') { - sparseSnapshotTreeRemember(repo.onDisconnect_, path, newNode); - } - repoCallOnCompleteCallback(repo, onComplete, status, errorReason); - }); -} -function repoOnDisconnectSetWithPriority(repo, path, value, priority, onComplete) { - const newNode = nodeFromJSON(value, priority); - repo.server_.onDisconnectPut(path.toString(), newNode.val(/*export=*/ true), (status, errorReason) => { - if (status === 'ok') { - sparseSnapshotTreeRemember(repo.onDisconnect_, path, newNode); - } - repoCallOnCompleteCallback(repo, onComplete, status, errorReason); - }); -} -function repoOnDisconnectUpdate(repo, path, childrenToMerge, onComplete) { - if (isEmpty(childrenToMerge)) { - log("onDisconnect().update() called with empty data. Don't do anything."); - repoCallOnCompleteCallback(repo, onComplete, 'ok', undefined); - return; - } - repo.server_.onDisconnectMerge(path.toString(), childrenToMerge, (status, errorReason) => { - if (status === 'ok') { - each(childrenToMerge, (childName, childNode) => { - const newChildNode = nodeFromJSON(childNode); - sparseSnapshotTreeRemember(repo.onDisconnect_, pathChild(path, childName), newChildNode); - }); - } - repoCallOnCompleteCallback(repo, onComplete, status, errorReason); - }); -} -function repoAddEventCallbackForQuery(repo, query, eventRegistration) { - let events; - if (pathGetFront(query._path) === '.info') { - events = syncTreeAddEventRegistration(repo.infoSyncTree_, query, eventRegistration); - } - else { - events = syncTreeAddEventRegistration(repo.serverSyncTree_, query, eventRegistration); - } - eventQueueRaiseEventsAtPath(repo.eventQueue_, query._path, events); -} -function repoRemoveEventCallbackForQuery(repo, query, eventRegistration) { - // These are guaranteed not to raise events, since we're not passing in a cancelError. However, we can future-proof - // a little bit by handling the return values anyways. - let events; - if (pathGetFront(query._path) === '.info') { - events = syncTreeRemoveEventRegistration(repo.infoSyncTree_, query, eventRegistration); - } - else { - events = syncTreeRemoveEventRegistration(repo.serverSyncTree_, query, eventRegistration); - } - eventQueueRaiseEventsAtPath(repo.eventQueue_, query._path, events); -} -function repoInterrupt(repo) { - if (repo.persistentConnection_) { - repo.persistentConnection_.interrupt(INTERRUPT_REASON); - } -} -function repoResume(repo) { - if (repo.persistentConnection_) { - repo.persistentConnection_.resume(INTERRUPT_REASON); - } -} -function repoLog(repo, ...varArgs) { - let prefix = ''; - if (repo.persistentConnection_) { - prefix = repo.persistentConnection_.id + ':'; - } - log(prefix, ...varArgs); -} -function repoCallOnCompleteCallback(repo, callback, status, errorReason) { - if (callback) { - exceptionGuard(() => { - if (status === 'ok') { - callback(null); - } - else { - const code = (status || 'error').toUpperCase(); - let message = code; - if (errorReason) { - message += ': ' + errorReason; - } - const error = new Error(message); - // eslint-disable-next-line @typescript-eslint/no-explicit-any - error.code = code; - callback(error); - } - }); - } -} -/** - * Creates a new transaction, adds it to the transactions we're tracking, and - * sends it to the server if possible. - * - * @param path - Path at which to do transaction. - * @param transactionUpdate - Update callback. - * @param onComplete - Completion callback. - * @param unwatcher - Function that will be called when the transaction no longer - * need data updates for `path`. - * @param applyLocally - Whether or not to make intermediate results visible - */ -function repoStartTransaction(repo, path, transactionUpdate, onComplete, unwatcher, applyLocally) { - repoLog(repo, 'transaction on ' + path); - // Initialize transaction. - const transaction = { - path, - update: transactionUpdate, - onComplete, - // One of TransactionStatus enums. - status: null, - // Used when combining transactions at different locations to figure out - // which one goes first. - order: LUIDGenerator(), - // Whether to raise local events for this transaction. - applyLocally, - // Count of how many times we've retried the transaction. - retryCount: 0, - // Function to call to clean up our .on() listener. - unwatcher, - // Stores why a transaction was aborted. - abortReason: null, - currentWriteId: null, - currentInputSnapshot: null, - currentOutputSnapshotRaw: null, - currentOutputSnapshotResolved: null - }; - // Run transaction initially. - const currentState = repoGetLatestState(repo, path, undefined); - transaction.currentInputSnapshot = currentState; - const newVal = transaction.update(currentState.val()); - if (newVal === undefined) { - // Abort transaction. - transaction.unwatcher(); - transaction.currentOutputSnapshotRaw = null; - transaction.currentOutputSnapshotResolved = null; - if (transaction.onComplete) { - transaction.onComplete(null, false, transaction.currentInputSnapshot); - } - } - else { - validateFirebaseData('transaction failed: Data returned ', newVal, transaction.path); - // Mark as run and add to our queue. - transaction.status = 0 /* RUN */; - const queueNode = treeSubTree(repo.transactionQueueTree_, path); - const nodeQueue = treeGetValue(queueNode) || []; - nodeQueue.push(transaction); - treeSetValue(queueNode, nodeQueue); - // Update visibleData and raise events - // Note: We intentionally raise events after updating all of our - // transaction state, since the user could start new transactions from the - // event callbacks. - let priorityForNode; - if (typeof newVal === 'object' && - newVal !== null && - contains(newVal, '.priority')) { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - priorityForNode = safeGet(newVal, '.priority'); - assert(isValidPriority(priorityForNode), 'Invalid priority returned by transaction. ' + - 'Priority must be a valid string, finite number, server value, or null.'); - } - else { - const currentNode = syncTreeCalcCompleteEventCache(repo.serverSyncTree_, path) || - ChildrenNode.EMPTY_NODE; - priorityForNode = currentNode.getPriority().val(); - } - const serverValues = repoGenerateServerValues(repo); - const newNodeUnresolved = nodeFromJSON(newVal, priorityForNode); - const newNode = resolveDeferredValueSnapshot(newNodeUnresolved, currentState, serverValues); - transaction.currentOutputSnapshotRaw = newNodeUnresolved; - transaction.currentOutputSnapshotResolved = newNode; - transaction.currentWriteId = repoGetNextWriteId(repo); - const events = syncTreeApplyUserOverwrite(repo.serverSyncTree_, path, newNode, transaction.currentWriteId, transaction.applyLocally); - eventQueueRaiseEventsForChangedPath(repo.eventQueue_, path, events); - repoSendReadyTransactions(repo, repo.transactionQueueTree_); - } -} -/** - * @param excludeSets - A specific set to exclude - */ -function repoGetLatestState(repo, path, excludeSets) { - return (syncTreeCalcCompleteEventCache(repo.serverSyncTree_, path, excludeSets) || - ChildrenNode.EMPTY_NODE); -} -/** - * Sends any already-run transactions that aren't waiting for outstanding - * transactions to complete. - * - * Externally it's called with no arguments, but it calls itself recursively - * with a particular transactionQueueTree node to recurse through the tree. - * - * @param node - transactionQueueTree node to start at. - */ -function repoSendReadyTransactions(repo, node = repo.transactionQueueTree_) { - // Before recursing, make sure any completed transactions are removed. - if (!node) { - repoPruneCompletedTransactionsBelowNode(repo, node); - } - if (treeGetValue(node)) { - const queue = repoBuildTransactionQueue(repo, node); - assert(queue.length > 0, 'Sending zero length transaction queue'); - const allRun = queue.every((transaction) => transaction.status === 0 /* RUN */); - // If they're all run (and not sent), we can send them. Else, we must wait. - if (allRun) { - repoSendTransactionQueue(repo, treeGetPath(node), queue); - } - } - else if (treeHasChildren(node)) { - treeForEachChild(node, childNode => { - repoSendReadyTransactions(repo, childNode); - }); - } -} -/** - * Given a list of run transactions, send them to the server and then handle - * the result (success or failure). - * - * @param path - The location of the queue. - * @param queue - Queue of transactions under the specified location. - */ -function repoSendTransactionQueue(repo, path, queue) { - // Mark transactions as sent and increment retry count! - const setsToIgnore = queue.map(txn => { - return txn.currentWriteId; - }); - const latestState = repoGetLatestState(repo, path, setsToIgnore); - let snapToSend = latestState; - const latestHash = latestState.hash(); - for (let i = 0; i < queue.length; i++) { - const txn = queue[i]; - assert(txn.status === 0 /* RUN */, 'tryToSendTransactionQueue_: items in queue should all be run.'); - txn.status = 1 /* SENT */; - txn.retryCount++; - const relativePath = newRelativePath(path, txn.path); - // If we've gotten to this point, the output snapshot must be defined. - snapToSend = snapToSend.updateChild(relativePath /** @type {!Node} */, txn.currentOutputSnapshotRaw); - } - const dataToSend = snapToSend.val(true); - const pathToSend = path; - // Send the put. - repo.server_.put(pathToSend.toString(), dataToSend, (status) => { - repoLog(repo, 'transaction put response', { - path: pathToSend.toString(), - status - }); - let events = []; - if (status === 'ok') { - // Queue up the callbacks and fire them after cleaning up all of our - // transaction state, since the callback could trigger more - // transactions or sets. - const callbacks = []; - for (let i = 0; i < queue.length; i++) { - queue[i].status = 2 /* COMPLETED */; - events = events.concat(syncTreeAckUserWrite(repo.serverSyncTree_, queue[i].currentWriteId)); - if (queue[i].onComplete) { - // We never unset the output snapshot, and given that this - // transaction is complete, it should be set - callbacks.push(() => queue[i].onComplete(null, true, queue[i].currentOutputSnapshotResolved)); - } - queue[i].unwatcher(); - } - // Now remove the completed transactions. - repoPruneCompletedTransactionsBelowNode(repo, treeSubTree(repo.transactionQueueTree_, path)); - // There may be pending transactions that we can now send. - repoSendReadyTransactions(repo, repo.transactionQueueTree_); - eventQueueRaiseEventsForChangedPath(repo.eventQueue_, path, events); - // Finally, trigger onComplete callbacks. - for (let i = 0; i < callbacks.length; i++) { - exceptionGuard(callbacks[i]); - } - } - else { - // transactions are no longer sent. Update their status appropriately. - if (status === 'datastale') { - for (let i = 0; i < queue.length; i++) { - if (queue[i].status === 3 /* SENT_NEEDS_ABORT */) { - queue[i].status = 4 /* NEEDS_ABORT */; - } - else { - queue[i].status = 0 /* RUN */; - } - } - } - else { - warn('transaction at ' + pathToSend.toString() + ' failed: ' + status); - for (let i = 0; i < queue.length; i++) { - queue[i].status = 4 /* NEEDS_ABORT */; - queue[i].abortReason = status; - } - } - repoRerunTransactions(repo, path); - } - }, latestHash); -} -/** - * Finds all transactions dependent on the data at changedPath and reruns them. - * - * Should be called any time cached data changes. - * - * Return the highest path that was affected by rerunning transactions. This - * is the path at which events need to be raised for. - * - * @param changedPath - The path in mergedData that changed. - * @returns The rootmost path that was affected by rerunning transactions. - */ -function repoRerunTransactions(repo, changedPath) { - const rootMostTransactionNode = repoGetAncestorTransactionNode(repo, changedPath); - const path = treeGetPath(rootMostTransactionNode); - const queue = repoBuildTransactionQueue(repo, rootMostTransactionNode); - repoRerunTransactionQueue(repo, queue, path); - return path; -} -/** - * Does all the work of rerunning transactions (as well as cleans up aborted - * transactions and whatnot). - * - * @param queue - The queue of transactions to run. - * @param path - The path the queue is for. - */ -function repoRerunTransactionQueue(repo, queue, path) { - if (queue.length === 0) { - return; // Nothing to do! - } - // Queue up the callbacks and fire them after cleaning up all of our - // transaction state, since the callback could trigger more transactions or - // sets. - const callbacks = []; - let events = []; - // Ignore all of the sets we're going to re-run. - const txnsToRerun = queue.filter(q => { - return q.status === 0 /* RUN */; - }); - const setsToIgnore = txnsToRerun.map(q => { - return q.currentWriteId; - }); - for (let i = 0; i < queue.length; i++) { - const transaction = queue[i]; - const relativePath = newRelativePath(path, transaction.path); - let abortTransaction = false, abortReason; - assert(relativePath !== null, 'rerunTransactionsUnderNode_: relativePath should not be null.'); - if (transaction.status === 4 /* NEEDS_ABORT */) { - abortTransaction = true; - abortReason = transaction.abortReason; - events = events.concat(syncTreeAckUserWrite(repo.serverSyncTree_, transaction.currentWriteId, true)); - } - else if (transaction.status === 0 /* RUN */) { - if (transaction.retryCount >= MAX_TRANSACTION_RETRIES) { - abortTransaction = true; - abortReason = 'maxretry'; - events = events.concat(syncTreeAckUserWrite(repo.serverSyncTree_, transaction.currentWriteId, true)); - } - else { - // This code reruns a transaction - const currentNode = repoGetLatestState(repo, transaction.path, setsToIgnore); - transaction.currentInputSnapshot = currentNode; - const newData = queue[i].update(currentNode.val()); - if (newData !== undefined) { - validateFirebaseData('transaction failed: Data returned ', newData, transaction.path); - let newDataNode = nodeFromJSON(newData); - const hasExplicitPriority = typeof newData === 'object' && - newData != null && - contains(newData, '.priority'); - if (!hasExplicitPriority) { - // Keep the old priority if there wasn't a priority explicitly specified. - newDataNode = newDataNode.updatePriority(currentNode.getPriority()); - } - const oldWriteId = transaction.currentWriteId; - const serverValues = repoGenerateServerValues(repo); - const newNodeResolved = resolveDeferredValueSnapshot(newDataNode, currentNode, serverValues); - transaction.currentOutputSnapshotRaw = newDataNode; - transaction.currentOutputSnapshotResolved = newNodeResolved; - transaction.currentWriteId = repoGetNextWriteId(repo); - // Mutates setsToIgnore in place - setsToIgnore.splice(setsToIgnore.indexOf(oldWriteId), 1); - events = events.concat(syncTreeApplyUserOverwrite(repo.serverSyncTree_, transaction.path, newNodeResolved, transaction.currentWriteId, transaction.applyLocally)); - events = events.concat(syncTreeAckUserWrite(repo.serverSyncTree_, oldWriteId, true)); - } - else { - abortTransaction = true; - abortReason = 'nodata'; - events = events.concat(syncTreeAckUserWrite(repo.serverSyncTree_, transaction.currentWriteId, true)); - } - } - } - eventQueueRaiseEventsForChangedPath(repo.eventQueue_, path, events); - events = []; - if (abortTransaction) { - // Abort. - queue[i].status = 2 /* COMPLETED */; - // Removing a listener can trigger pruning which can muck with - // mergedData/visibleData (as it prunes data). So defer the unwatcher - // until we're done. - (function (unwatcher) { - setTimeout(unwatcher, Math.floor(0)); - })(queue[i].unwatcher); - if (queue[i].onComplete) { - if (abortReason === 'nodata') { - callbacks.push(() => queue[i].onComplete(null, false, queue[i].currentInputSnapshot)); - } - else { - callbacks.push(() => queue[i].onComplete(new Error(abortReason), false, null)); - } - } - } - } - // Clean up completed transactions. - repoPruneCompletedTransactionsBelowNode(repo, repo.transactionQueueTree_); - // Now fire callbacks, now that we're in a good, known state. - for (let i = 0; i < callbacks.length; i++) { - exceptionGuard(callbacks[i]); - } - // Try to send the transaction result to the server. - repoSendReadyTransactions(repo, repo.transactionQueueTree_); -} -/** - * Returns the rootmost ancestor node of the specified path that has a pending - * transaction on it, or just returns the node for the given path if there are - * no pending transactions on any ancestor. - * - * @param path - The location to start at. - * @returns The rootmost node with a transaction. - */ -function repoGetAncestorTransactionNode(repo, path) { - let front; - // Start at the root and walk deeper into the tree towards path until we - // find a node with pending transactions. - let transactionNode = repo.transactionQueueTree_; - front = pathGetFront(path); - while (front !== null && treeGetValue(transactionNode) === undefined) { - transactionNode = treeSubTree(transactionNode, front); - path = pathPopFront(path); - front = pathGetFront(path); - } - return transactionNode; -} -/** - * Builds the queue of all transactions at or below the specified - * transactionNode. - * - * @param transactionNode - * @returns The generated queue. - */ -function repoBuildTransactionQueue(repo, transactionNode) { - // Walk any child transaction queues and aggregate them into a single queue. - const transactionQueue = []; - repoAggregateTransactionQueuesForNode(repo, transactionNode, transactionQueue); - // Sort them by the order the transactions were created. - transactionQueue.sort((a, b) => a.order - b.order); - return transactionQueue; -} -function repoAggregateTransactionQueuesForNode(repo, node, queue) { - const nodeQueue = treeGetValue(node); - if (nodeQueue) { - for (let i = 0; i < nodeQueue.length; i++) { - queue.push(nodeQueue[i]); - } - } - treeForEachChild(node, child => { - repoAggregateTransactionQueuesForNode(repo, child, queue); - }); -} -/** - * Remove COMPLETED transactions at or below this node in the transactionQueueTree_. - */ -function repoPruneCompletedTransactionsBelowNode(repo, node) { - const queue = treeGetValue(node); - if (queue) { - let to = 0; - for (let from = 0; from < queue.length; from++) { - if (queue[from].status !== 2 /* COMPLETED */) { - queue[to] = queue[from]; - to++; - } - } - queue.length = to; - treeSetValue(node, queue.length > 0 ? queue : undefined); - } - treeForEachChild(node, childNode => { - repoPruneCompletedTransactionsBelowNode(repo, childNode); - }); -} -/** - * Aborts all transactions on ancestors or descendants of the specified path. - * Called when doing a set() or update() since we consider them incompatible - * with transactions. - * - * @param path - Path for which we want to abort related transactions. - */ -function repoAbortTransactions(repo, path) { - const affectedPath = treeGetPath(repoGetAncestorTransactionNode(repo, path)); - const transactionNode = treeSubTree(repo.transactionQueueTree_, path); - treeForEachAncestor(transactionNode, (node) => { - repoAbortTransactionsOnNode(repo, node); - }); - repoAbortTransactionsOnNode(repo, transactionNode); - treeForEachDescendant(transactionNode, (node) => { - repoAbortTransactionsOnNode(repo, node); - }); - return affectedPath; -} -/** - * Abort transactions stored in this transaction queue node. - * - * @param node - Node to abort transactions for. - */ -function repoAbortTransactionsOnNode(repo, node) { - const queue = treeGetValue(node); - if (queue) { - // Queue up the callbacks and fire them after cleaning up all of our - // transaction state, since the callback could trigger more transactions - // or sets. - const callbacks = []; - // Go through queue. Any already-sent transactions must be marked for - // abort, while the unsent ones can be immediately aborted and removed. - let events = []; - let lastSent = -1; - for (let i = 0; i < queue.length; i++) { - if (queue[i].status === 3 /* SENT_NEEDS_ABORT */) ; - else if (queue[i].status === 1 /* SENT */) { - assert(lastSent === i - 1, 'All SENT items should be at beginning of queue.'); - lastSent = i; - // Mark transaction for abort when it comes back. - queue[i].status = 3 /* SENT_NEEDS_ABORT */; - queue[i].abortReason = 'set'; - } - else { - assert(queue[i].status === 0 /* RUN */, 'Unexpected transaction status in abort'); - // We can abort it immediately. - queue[i].unwatcher(); - events = events.concat(syncTreeAckUserWrite(repo.serverSyncTree_, queue[i].currentWriteId, true)); - if (queue[i].onComplete) { - callbacks.push(queue[i].onComplete.bind(null, new Error('set'), false, null)); - } - } - } - if (lastSent === -1) { - // We're not waiting for any sent transactions. We can clear the queue. - treeSetValue(node, undefined); - } - else { - // Remove the transactions we aborted. - queue.length = lastSent + 1; - } - // Now fire the callbacks. - eventQueueRaiseEventsForChangedPath(repo.eventQueue_, treeGetPath(node), events); - for (let i = 0; i < callbacks.length; i++) { - exceptionGuard(callbacks[i]); - } - } -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -function decodePath(pathString) { - let pathStringDecoded = ''; - const pieces = pathString.split('/'); - for (let i = 0; i < pieces.length; i++) { - if (pieces[i].length > 0) { - let piece = pieces[i]; - try { - piece = decodeURIComponent(piece.replace(/\+/g, ' ')); - } - catch (e) { } - pathStringDecoded += '/' + piece; - } - } - return pathStringDecoded; -} -/** - * @returns key value hash - */ -function decodeQuery(queryString) { - const results = {}; - if (queryString.charAt(0) === '?') { - queryString = queryString.substring(1); - } - for (const segment of queryString.split('&')) { - if (segment.length === 0) { - continue; - } - const kv = segment.split('='); - if (kv.length === 2) { - results[decodeURIComponent(kv[0])] = decodeURIComponent(kv[1]); - } - else { - warn(`Invalid query segment '${segment}' in query '${queryString}'`); - } - } - return results; -} -const parseRepoInfo = function (dataURL, nodeAdmin) { - const parsedUrl = parseDatabaseURL(dataURL), namespace = parsedUrl.namespace; - if (parsedUrl.domain === 'firebase.com') { - fatal(parsedUrl.host + - ' is no longer supported. ' + - 'Please use .firebaseio.com instead'); - } - // Catch common error of uninitialized namespace value. - if ((!namespace || namespace === 'undefined') && - parsedUrl.domain !== 'localhost') { - fatal('Cannot parse Firebase url. Please use https://.firebaseio.com'); - } - if (!parsedUrl.secure) { - warnIfPageIsSecure(); - } - const webSocketOnly = parsedUrl.scheme === 'ws' || parsedUrl.scheme === 'wss'; - return { - repoInfo: new RepoInfo(parsedUrl.host, parsedUrl.secure, namespace, webSocketOnly, nodeAdmin, - /*persistenceKey=*/ '', - /*includeNamespaceInQueryParams=*/ namespace !== parsedUrl.subdomain), - path: new Path(parsedUrl.pathString) - }; -}; -const parseDatabaseURL = function (dataURL) { - // Default to empty strings in the event of a malformed string. - let host = '', domain = '', subdomain = '', pathString = '', namespace = ''; - // Always default to SSL, unless otherwise specified. - let secure = true, scheme = 'https', port = 443; - // Don't do any validation here. The caller is responsible for validating the result of parsing. - if (typeof dataURL === 'string') { - // Parse scheme. - let colonInd = dataURL.indexOf('//'); - if (colonInd >= 0) { - scheme = dataURL.substring(0, colonInd - 1); - dataURL = dataURL.substring(colonInd + 2); - } - // Parse host, path, and query string. - let slashInd = dataURL.indexOf('/'); - if (slashInd === -1) { - slashInd = dataURL.length; - } - let questionMarkInd = dataURL.indexOf('?'); - if (questionMarkInd === -1) { - questionMarkInd = dataURL.length; - } - host = dataURL.substring(0, Math.min(slashInd, questionMarkInd)); - if (slashInd < questionMarkInd) { - // For pathString, questionMarkInd will always come after slashInd - pathString = decodePath(dataURL.substring(slashInd, questionMarkInd)); - } - const queryParams = decodeQuery(dataURL.substring(Math.min(dataURL.length, questionMarkInd))); - // If we have a port, use scheme for determining if it's secure. - colonInd = host.indexOf(':'); - if (colonInd >= 0) { - secure = scheme === 'https' || scheme === 'wss'; - port = parseInt(host.substring(colonInd + 1), 10); - } - else { - colonInd = host.length; - } - const hostWithoutPort = host.slice(0, colonInd); - if (hostWithoutPort.toLowerCase() === 'localhost') { - domain = 'localhost'; - } - else if (hostWithoutPort.split('.').length <= 2) { - domain = hostWithoutPort; - } - else { - // Interpret the subdomain of a 3 or more component URL as the namespace name. - const dotInd = host.indexOf('.'); - subdomain = host.substring(0, dotInd).toLowerCase(); - domain = host.substring(dotInd + 1); - // Normalize namespaces to lowercase to share storage / connection. - namespace = subdomain; - } - // Always treat the value of the `ns` as the namespace name if it is present. - if ('ns' in queryParams) { - namespace = queryParams['ns']; - } - } - return { - host, - port, - domain, - subdomain, - secure, - scheme, - pathString, - namespace - }; -}; - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Encapsulates the data needed to raise an event - */ -class DataEvent { - /** - * @param eventType - One of: value, child_added, child_changed, child_moved, child_removed - * @param eventRegistration - The function to call to with the event data. User provided - * @param snapshot - The data backing the event - * @param prevName - Optional, the name of the previous child for child_* events. - */ - constructor(eventType, eventRegistration, snapshot, prevName) { - this.eventType = eventType; - this.eventRegistration = eventRegistration; - this.snapshot = snapshot; - this.prevName = prevName; - } - getPath() { - const ref = this.snapshot.ref; - if (this.eventType === 'value') { - return ref._path; - } - else { - return ref.parent._path; - } - } - getEventType() { - return this.eventType; - } - getEventRunner() { - return this.eventRegistration.getEventRunner(this); - } - toString() { - return (this.getPath().toString() + - ':' + - this.eventType + - ':' + - stringify(this.snapshot.exportVal())); - } -} -class CancelEvent { - constructor(eventRegistration, error, path) { - this.eventRegistration = eventRegistration; - this.error = error; - this.path = path; - } - getPath() { - return this.path; - } - getEventType() { - return 'cancel'; - } - getEventRunner() { - return this.eventRegistration.getEventRunner(this); - } - toString() { - return this.path.toString() + ':cancel'; - } -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * A wrapper class that converts events from the database@exp SDK to the legacy - * Database SDK. Events are not converted directly as event registration relies - * on reference comparison of the original user callback (see `matches()`) and - * relies on equality of the legacy SDK's `context` object. - */ -class CallbackContext { - constructor(snapshotCallback, cancelCallback) { - this.snapshotCallback = snapshotCallback; - this.cancelCallback = cancelCallback; - } - onValue(expDataSnapshot, previousChildName) { - this.snapshotCallback.call(null, expDataSnapshot, previousChildName); - } - onCancel(error) { - assert(this.hasCancelCallback, 'Raising a cancel event on a listener with no cancel callback'); - return this.cancelCallback.call(null, error); - } - get hasCancelCallback() { - return !!this.cancelCallback; - } - matches(other) { - return (this.snapshotCallback === other.snapshotCallback || - (this.snapshotCallback.userCallback !== undefined && - this.snapshotCallback.userCallback === - other.snapshotCallback.userCallback && - this.snapshotCallback.context === other.snapshotCallback.context)); - } -} - -/** - * @license - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * The `onDisconnect` class allows you to write or clear data when your client - * disconnects from the Database server. These updates occur whether your - * client disconnects cleanly or not, so you can rely on them to clean up data - * even if a connection is dropped or a client crashes. - * - * The `onDisconnect` class is most commonly used to manage presence in - * applications where it is useful to detect how many clients are connected and - * when other clients disconnect. See - * {@link https://firebase.google.com/docs/database/web/offline-capabilities | Enabling Offline Capabilities in JavaScript} - * for more information. - * - * To avoid problems when a connection is dropped before the requests can be - * transferred to the Database server, these functions should be called before - * writing any data. - * - * Note that `onDisconnect` operations are only triggered once. If you want an - * operation to occur each time a disconnect occurs, you'll need to re-establish - * the `onDisconnect` operations each time you reconnect. - */ -class OnDisconnect { - /** @hideconstructor */ - constructor(_repo, _path) { - this._repo = _repo; - this._path = _path; - } - /** - * Cancels all previously queued `onDisconnect()` set or update events for this - * location and all children. - * - * If a write has been queued for this location via a `set()` or `update()` at a - * parent location, the write at this location will be canceled, though writes - * to sibling locations will still occur. - * - * @returns Resolves when synchronization to the server is complete. - */ - cancel() { - const deferred = new Deferred(); - repoOnDisconnectCancel(this._repo, this._path, deferred.wrapCallback(() => { })); - return deferred.promise; - } - /** - * Ensures the data at this location is deleted when the client is disconnected - * (due to closing the browser, navigating to a new page, or network issues). - * - * @returns Resolves when synchronization to the server is complete. - */ - remove() { - validateWritablePath('OnDisconnect.remove', this._path); - const deferred = new Deferred(); - repoOnDisconnectSet(this._repo, this._path, null, deferred.wrapCallback(() => { })); - return deferred.promise; - } - /** - * Ensures the data at this location is set to the specified value when the - * client is disconnected (due to closing the browser, navigating to a new page, - * or network issues). - * - * `set()` is especially useful for implementing "presence" systems, where a - * value should be changed or cleared when a user disconnects so that they - * appear "offline" to other users. See - * {@link https://firebase.google.com/docs/database/web/offline-capabilities | Enabling Offline Capabilities in JavaScript} - * for more information. - * - * Note that `onDisconnect` operations are only triggered once. If you want an - * operation to occur each time a disconnect occurs, you'll need to re-establish - * the `onDisconnect` operations each time. - * - * @param value - The value to be written to this location on disconnect (can - * be an object, array, string, number, boolean, or null). - * @returns Resolves when synchronization to the Database is complete. - */ - set(value) { - validateWritablePath('OnDisconnect.set', this._path); - validateFirebaseDataArg('OnDisconnect.set', value, this._path, false); - const deferred = new Deferred(); - repoOnDisconnectSet(this._repo, this._path, value, deferred.wrapCallback(() => { })); - return deferred.promise; - } - /** - * Ensures the data at this location is set to the specified value and priority - * when the client is disconnected (due to closing the browser, navigating to a - * new page, or network issues). - * - * @param value - The value to be written to this location on disconnect (can - * be an object, array, string, number, boolean, or null). - * @param priority - The priority to be written (string, number, or null). - * @returns Resolves when synchronization to the Database is complete. - */ - setWithPriority(value, priority) { - validateWritablePath('OnDisconnect.setWithPriority', this._path); - validateFirebaseDataArg('OnDisconnect.setWithPriority', value, this._path, false); - validatePriority('OnDisconnect.setWithPriority', priority, false); - const deferred = new Deferred(); - repoOnDisconnectSetWithPriority(this._repo, this._path, value, priority, deferred.wrapCallback(() => { })); - return deferred.promise; - } - /** - * Writes multiple values at this location when the client is disconnected (due - * to closing the browser, navigating to a new page, or network issues). - * - * The `values` argument contains multiple property-value pairs that will be - * written to the Database together. Each child property can either be a simple - * property (for example, "name") or a relative path (for example, "name/first") - * from the current location to the data to update. - * - * As opposed to the `set()` method, `update()` can be use to selectively update - * only the referenced properties at the current location (instead of replacing - * all the child properties at the current location). - * - * @param values - Object containing multiple values. - * @returns Resolves when synchronization to the Database is complete. - */ - update(values) { - validateWritablePath('OnDisconnect.update', this._path); - validateFirebaseMergeDataArg('OnDisconnect.update', values, this._path, false); - const deferred = new Deferred(); - repoOnDisconnectUpdate(this._repo, this._path, values, deferred.wrapCallback(() => { })); - return deferred.promise; - } -} - -/** - * @license - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * @internal - */ -class QueryImpl { - /** - * @hideconstructor - */ - constructor(_repo, _path, _queryParams, _orderByCalled) { - this._repo = _repo; - this._path = _path; - this._queryParams = _queryParams; - this._orderByCalled = _orderByCalled; - } - get key() { - if (pathIsEmpty(this._path)) { - return null; - } - else { - return pathGetBack(this._path); - } - } - get ref() { - return new ReferenceImpl(this._repo, this._path); - } - get _queryIdentifier() { - const obj = queryParamsGetQueryObject(this._queryParams); - const id = ObjectToUniqueKey(obj); - return id === '{}' ? 'default' : id; - } - /** - * An object representation of the query parameters used by this Query. - */ - get _queryObject() { - return queryParamsGetQueryObject(this._queryParams); - } - isEqual(other) { - other = getModularInstance(other); - if (!(other instanceof QueryImpl)) { - return false; - } - const sameRepo = this._repo === other._repo; - const samePath = pathEquals(this._path, other._path); - const sameQueryIdentifier = this._queryIdentifier === other._queryIdentifier; - return sameRepo && samePath && sameQueryIdentifier; - } - toJSON() { - return this.toString(); - } - toString() { - return this._repo.toString() + pathToUrlEncodedString(this._path); - } -} -/** - * Validates that no other order by call has been made - */ -function validateNoPreviousOrderByCall(query, fnName) { - if (query._orderByCalled === true) { - throw new Error(fnName + ": You can't combine multiple orderBy calls."); - } -} -/** - * Validates start/end values for queries. - */ -function validateQueryEndpoints(params) { - let startNode = null; - let endNode = null; - if (params.hasStart()) { - startNode = params.getIndexStartValue(); - } - if (params.hasEnd()) { - endNode = params.getIndexEndValue(); - } - if (params.getIndex() === KEY_INDEX) { - const tooManyArgsError = 'Query: When ordering by key, you may only pass one argument to ' + - 'startAt(), endAt(), or equalTo().'; - const wrongArgTypeError = 'Query: When ordering by key, the argument passed to startAt(), startAfter(), ' + - 'endAt(), endBefore(), or equalTo() must be a string.'; - if (params.hasStart()) { - const startName = params.getIndexStartName(); - if (startName !== MIN_NAME) { - throw new Error(tooManyArgsError); - } - else if (typeof startNode !== 'string') { - throw new Error(wrongArgTypeError); - } - } - if (params.hasEnd()) { - const endName = params.getIndexEndName(); - if (endName !== MAX_NAME) { - throw new Error(tooManyArgsError); - } - else if (typeof endNode !== 'string') { - throw new Error(wrongArgTypeError); - } - } - } - else if (params.getIndex() === PRIORITY_INDEX) { - if ((startNode != null && !isValidPriority(startNode)) || - (endNode != null && !isValidPriority(endNode))) { - throw new Error('Query: When ordering by priority, the first argument passed to startAt(), ' + - 'startAfter() endAt(), endBefore(), or equalTo() must be a valid priority value ' + - '(null, a number, or a string).'); - } - } - else { - assert(params.getIndex() instanceof PathIndex || - params.getIndex() === VALUE_INDEX, 'unknown index type.'); - if ((startNode != null && typeof startNode === 'object') || - (endNode != null && typeof endNode === 'object')) { - throw new Error('Query: First argument passed to startAt(), startAfter(), endAt(), endBefore(), or ' + - 'equalTo() cannot be an object.'); - } - } -} -/** - * Validates that limit* has been called with the correct combination of parameters - */ -function validateLimit(params) { - if (params.hasStart() && - params.hasEnd() && - params.hasLimit() && - !params.hasAnchoredLimit()) { - throw new Error("Query: Can't combine startAt(), startAfter(), endAt(), endBefore(), and limit(). Use " + - 'limitToFirst() or limitToLast() instead.'); - } -} -/** - * @internal - */ -class ReferenceImpl extends QueryImpl { - /** @hideconstructor */ - constructor(repo, path) { - super(repo, path, new QueryParams(), false); - } - get parent() { - const parentPath = pathParent(this._path); - return parentPath === null - ? null - : new ReferenceImpl(this._repo, parentPath); - } - get root() { - let ref = this; - while (ref.parent !== null) { - ref = ref.parent; - } - return ref; - } -} -/** - * A `DataSnapshot` contains data from a Database location. - * - * Any time you read data from the Database, you receive the data as a - * `DataSnapshot`. A `DataSnapshot` is passed to the event callbacks you attach - * with `on()` or `once()`. You can extract the contents of the snapshot as a - * JavaScript object by calling the `val()` method. Alternatively, you can - * traverse into the snapshot by calling `child()` to return child snapshots - * (which you could then call `val()` on). - * - * A `DataSnapshot` is an efficiently generated, immutable copy of the data at - * a Database location. It cannot be modified and will never change (to modify - * data, you always call the `set()` method on a `Reference` directly). - */ -class DataSnapshot { - /** - * @param _node - A SnapshotNode to wrap. - * @param ref - The location this snapshot came from. - * @param _index - The iteration order for this snapshot - * @hideconstructor - */ - constructor(_node, - /** - * The location of this DataSnapshot. - */ - ref, _index) { - this._node = _node; - this.ref = ref; - this._index = _index; - } - /** - * Gets the priority value of the data in this `DataSnapshot`. - * - * Applications need not use priority but can order collections by - * ordinary properties (see - * {@link https://firebase.google.com/docs/database/web/lists-of-data#sorting_and_filtering_data |Sorting and filtering data} - * ). - */ - get priority() { - // typecast here because we never return deferred values or internal priorities (MAX_PRIORITY) - return this._node.getPriority().val(); - } - /** - * The key (last part of the path) of the location of this `DataSnapshot`. - * - * The last token in a Database location is considered its key. For example, - * "ada" is the key for the /users/ada/ node. Accessing the key on any - * `DataSnapshot` will return the key for the location that generated it. - * However, accessing the key on the root URL of a Database will return - * `null`. - */ - get key() { - return this.ref.key; - } - /** Returns the number of child properties of this `DataSnapshot`. */ - get size() { - return this._node.numChildren(); - } - /** - * Gets another `DataSnapshot` for the location at the specified relative path. - * - * Passing a relative path to the `child()` method of a DataSnapshot returns - * another `DataSnapshot` for the location at the specified relative path. The - * relative path can either be a simple child name (for example, "ada") or a - * deeper, slash-separated path (for example, "ada/name/first"). If the child - * location has no data, an empty `DataSnapshot` (that is, a `DataSnapshot` - * whose value is `null`) is returned. - * - * @param path - A relative path to the location of child data. - */ - child(path) { - const childPath = new Path(path); - const childRef = child(this.ref, path); - return new DataSnapshot(this._node.getChild(childPath), childRef, PRIORITY_INDEX); - } - /** - * Returns true if this `DataSnapshot` contains any data. It is slightly more - * efficient than using `snapshot.val() !== null`. - */ - exists() { - return !this._node.isEmpty(); - } - /** - * Exports the entire contents of the DataSnapshot as a JavaScript object. - * - * The `exportVal()` method is similar to `val()`, except priority information - * is included (if available), making it suitable for backing up your data. - * - * @returns The DataSnapshot's contents as a JavaScript value (Object, - * Array, string, number, boolean, or `null`). - */ - // eslint-disable-next-line @typescript-eslint/no-explicit-any - exportVal() { - return this._node.val(true); - } - /** - * Enumerates the top-level children in the `DataSnapshot`. - * - * Because of the way JavaScript objects work, the ordering of data in the - * JavaScript object returned by `val()` is not guaranteed to match the - * ordering on the server nor the ordering of `onChildAdded()` events. That is - * where `forEach()` comes in handy. It guarantees the children of a - * `DataSnapshot` will be iterated in their query order. - * - * If no explicit `orderBy*()` method is used, results are returned - * ordered by key (unless priorities are used, in which case, results are - * returned by priority). - * - * @param action - A function that will be called for each child DataSnapshot. - * The callback can return true to cancel further enumeration. - * @returns true if enumeration was canceled due to your callback returning - * true. - */ - forEach(action) { - if (this._node.isLeafNode()) { - return false; - } - const childrenNode = this._node; - // Sanitize the return value to a boolean. ChildrenNode.forEachChild has a weird return type... - return !!childrenNode.forEachChild(this._index, (key, node) => { - return action(new DataSnapshot(node, child(this.ref, key), PRIORITY_INDEX)); - }); - } - /** - * Returns true if the specified child path has (non-null) data. - * - * @param path - A relative path to the location of a potential child. - * @returns `true` if data exists at the specified child path; else - * `false`. - */ - hasChild(path) { - const childPath = new Path(path); - return !this._node.getChild(childPath).isEmpty(); - } - /** - * Returns whether or not the `DataSnapshot` has any non-`null` child - * properties. - * - * You can use `hasChildren()` to determine if a `DataSnapshot` has any - * children. If it does, you can enumerate them using `forEach()`. If it - * doesn't, then either this snapshot contains a primitive value (which can be - * retrieved with `val()`) or it is empty (in which case, `val()` will return - * `null`). - * - * @returns true if this snapshot has any children; else false. - */ - hasChildren() { - if (this._node.isLeafNode()) { - return false; - } - else { - return !this._node.isEmpty(); - } - } - /** - * Returns a JSON-serializable representation of this object. - */ - toJSON() { - return this.exportVal(); - } - /** - * Extracts a JavaScript value from a `DataSnapshot`. - * - * Depending on the data in a `DataSnapshot`, the `val()` method may return a - * scalar type (string, number, or boolean), an array, or an object. It may - * also return null, indicating that the `DataSnapshot` is empty (contains no - * data). - * - * @returns The DataSnapshot's contents as a JavaScript value (Object, - * Array, string, number, boolean, or `null`). - */ - // eslint-disable-next-line @typescript-eslint/no-explicit-any - val() { - return this._node.val(); - } -} -/** - * - * Returns a `Reference` representing the location in the Database - * corresponding to the provided path. If no path is provided, the `Reference` - * will point to the root of the Database. - * - * @param db - The database instance to obtain a reference for. - * @param path - Optional path representing the location the returned - * `Reference` will point. If not provided, the returned `Reference` will - * point to the root of the Database. - * @returns If a path is provided, a `Reference` - * pointing to the provided path. Otherwise, a `Reference` pointing to the - * root of the Database. - */ -function ref(db, path) { - db = getModularInstance(db); - db._checkNotDeleted('ref'); - return path !== undefined ? child(db._root, path) : db._root; -} -/** - * Returns a `Reference` representing the location in the Database - * corresponding to the provided Firebase URL. - * - * An exception is thrown if the URL is not a valid Firebase Database URL or it - * has a different domain than the current `Database` instance. - * - * Note that all query parameters (`orderBy`, `limitToLast`, etc.) are ignored - * and are not applied to the returned `Reference`. - * - * @param db - The database instance to obtain a reference for. - * @param url - The Firebase URL at which the returned `Reference` will - * point. - * @returns A `Reference` pointing to the provided - * Firebase URL. - */ -function refFromURL(db, url) { - db = getModularInstance(db); - db._checkNotDeleted('refFromURL'); - const parsedURL = parseRepoInfo(url, db._repo.repoInfo_.nodeAdmin); - validateUrl('refFromURL', parsedURL); - const repoInfo = parsedURL.repoInfo; - if (!db._repo.repoInfo_.isCustomHost() && - repoInfo.host !== db._repo.repoInfo_.host) { - fatal('refFromURL' + - ': Host name does not match the current database: ' + - '(found ' + - repoInfo.host + - ' but expected ' + - db._repo.repoInfo_.host + - ')'); - } - return ref(db, parsedURL.path.toString()); -} -/** - * Gets a `Reference` for the location at the specified relative path. - * - * The relative path can either be a simple child name (for example, "ada") or - * a deeper slash-separated path (for example, "ada/name/first"). - * - * @param parent - The parent location. - * @param path - A relative path from this location to the desired child - * location. - * @returns The specified child location. - */ -function child(parent, path) { - parent = getModularInstance(parent); - if (pathGetFront(parent._path) === null) { - validateRootPathString('child', 'path', path, false); - } - else { - validatePathString('child', 'path', path, false); - } - return new ReferenceImpl(parent._repo, pathChild(parent._path, path)); -} -/** - * Returns an `OnDisconnect` object - see - * {@link https://firebase.google.com/docs/database/web/offline-capabilities | Enabling Offline Capabilities in JavaScript} - * for more information on how to use it. - * - * @param ref - The reference to add OnDisconnect triggers for. - */ -function onDisconnect(ref) { - ref = getModularInstance(ref); - return new OnDisconnect(ref._repo, ref._path); -} -/** - * Generates a new child location using a unique key and returns its - * `Reference`. - * - * This is the most common pattern for adding data to a collection of items. - * - * If you provide a value to `push()`, the value is written to the - * generated location. If you don't pass a value, nothing is written to the - * database and the child remains empty (but you can use the `Reference` - * elsewhere). - * - * The unique keys generated by `push()` are ordered by the current time, so the - * resulting list of items is chronologically sorted. The keys are also - * designed to be unguessable (they contain 72 random bits of entropy). - * - * See {@link https://firebase.google.com/docs/database/web/lists-of-data#append_to_a_list_of_data | Append to a list of data}. - * See {@link https://firebase.googleblog.com/2015/02/the-2120-ways-to-ensure-unique_68.html | The 2^120 Ways to Ensure Unique Identifiers}. - * - * @param parent - The parent location. - * @param value - Optional value to be written at the generated location. - * @returns Combined `Promise` and `Reference`; resolves when write is complete, - * but can be used immediately as the `Reference` to the child location. - */ -function push(parent, value) { - parent = getModularInstance(parent); - validateWritablePath('push', parent._path); - validateFirebaseDataArg('push', value, parent._path, true); - const now = repoServerTime(parent._repo); - const name = nextPushId(now); - // push() returns a ThennableReference whose promise is fulfilled with a - // regular Reference. We use child() to create handles to two different - // references. The first is turned into a ThennableReference below by adding - // then() and catch() methods and is used as the return value of push(). The - // second remains a regular Reference and is used as the fulfilled value of - // the first ThennableReference. - const thennablePushRef = child(parent, name); - const pushRef = child(parent, name); - let promise; - if (value != null) { - promise = set(pushRef, value).then(() => pushRef); - } - else { - promise = Promise.resolve(pushRef); - } - thennablePushRef.then = promise.then.bind(promise); - thennablePushRef.catch = promise.then.bind(promise, undefined); - return thennablePushRef; -} -/** - * Removes the data at this Database location. - * - * Any data at child locations will also be deleted. - * - * The effect of the remove will be visible immediately and the corresponding - * event 'value' will be triggered. Synchronization of the remove to the - * Firebase servers will also be started, and the returned Promise will resolve - * when complete. If provided, the onComplete callback will be called - * asynchronously after synchronization has finished. - * - * @param ref - The location to remove. - * @returns Resolves when remove on server is complete. - */ -function remove(ref) { - validateWritablePath('remove', ref._path); - return set(ref, null); -} -/** - * Writes data to this Database location. - * - * This will overwrite any data at this location and all child locations. - * - * The effect of the write will be visible immediately, and the corresponding - * events ("value", "child_added", etc.) will be triggered. Synchronization of - * the data to the Firebase servers will also be started, and the returned - * Promise will resolve when complete. If provided, the `onComplete` callback - * will be called asynchronously after synchronization has finished. - * - * Passing `null` for the new value is equivalent to calling `remove()`; namely, - * all data at this location and all child locations will be deleted. - * - * `set()` will remove any priority stored at this location, so if priority is - * meant to be preserved, you need to use `setWithPriority()` instead. - * - * Note that modifying data with `set()` will cancel any pending transactions - * at that location, so extreme care should be taken if mixing `set()` and - * `transaction()` to modify the same data. - * - * A single `set()` will generate a single "value" event at the location where - * the `set()` was performed. - * - * @param ref - The location to write to. - * @param value - The value to be written (string, number, boolean, object, - * array, or null). - * @returns Resolves when write to server is complete. - */ -function set(ref, value) { - ref = getModularInstance(ref); - validateWritablePath('set', ref._path); - validateFirebaseDataArg('set', value, ref._path, false); - const deferred = new Deferred(); - repoSetWithPriority(ref._repo, ref._path, value, - /*priority=*/ null, deferred.wrapCallback(() => { })); - return deferred.promise; -} -/** - * Sets a priority for the data at this Database location. - * - * Applications need not use priority but can order collections by - * ordinary properties (see - * {@link https://firebase.google.com/docs/database/web/lists-of-data#sorting_and_filtering_data | Sorting and filtering data} - * ). - * - * @param ref - The location to write to. - * @param priority - The priority to be written (string, number, or null). - * @returns Resolves when write to server is complete. - */ -function setPriority(ref, priority) { - ref = getModularInstance(ref); - validateWritablePath('setPriority', ref._path); - validatePriority('setPriority', priority, false); - const deferred = new Deferred(); - repoSetWithPriority(ref._repo, pathChild(ref._path, '.priority'), priority, null, deferred.wrapCallback(() => { })); - return deferred.promise; -} -/** - * Writes data the Database location. Like `set()` but also specifies the - * priority for that data. - * - * Applications need not use priority but can order collections by - * ordinary properties (see - * {@link https://firebase.google.com/docs/database/web/lists-of-data#sorting_and_filtering_data | Sorting and filtering data} - * ). - * - * @param ref - The location to write to. - * @param value - The value to be written (string, number, boolean, object, - * array, or null). - * @param priority - The priority to be written (string, number, or null). - * @returns Resolves when write to server is complete. - */ -function setWithPriority(ref, value, priority) { - validateWritablePath('setWithPriority', ref._path); - validateFirebaseDataArg('setWithPriority', value, ref._path, false); - validatePriority('setWithPriority', priority, false); - if (ref.key === '.length' || ref.key === '.keys') { - throw 'setWithPriority failed: ' + ref.key + ' is a read-only object.'; - } - const deferred = new Deferred(); - repoSetWithPriority(ref._repo, ref._path, value, priority, deferred.wrapCallback(() => { })); - return deferred.promise; -} -/** - * Writes multiple values to the Database at once. - * - * The `values` argument contains multiple property-value pairs that will be - * written to the Database together. Each child property can either be a simple - * property (for example, "name") or a relative path (for example, - * "name/first") from the current location to the data to update. - * - * As opposed to the `set()` method, `update()` can be use to selectively update - * only the referenced properties at the current location (instead of replacing - * all the child properties at the current location). - * - * The effect of the write will be visible immediately, and the corresponding - * events ('value', 'child_added', etc.) will be triggered. Synchronization of - * the data to the Firebase servers will also be started, and the returned - * Promise will resolve when complete. If provided, the `onComplete` callback - * will be called asynchronously after synchronization has finished. - * - * A single `update()` will generate a single "value" event at the location - * where the `update()` was performed, regardless of how many children were - * modified. - * - * Note that modifying data with `update()` will cancel any pending - * transactions at that location, so extreme care should be taken if mixing - * `update()` and `transaction()` to modify the same data. - * - * Passing `null` to `update()` will remove the data at this location. - * - * See - * {@link https://firebase.googleblog.com/2015/09/introducing-multi-location-updates-and_86.html | Introducing multi-location updates and more}. - * - * @param ref - The location to write to. - * @param values - Object containing multiple values. - * @returns Resolves when update on server is complete. - */ -function update(ref, values) { - validateFirebaseMergeDataArg('update', values, ref._path, false); - const deferred = new Deferred(); - repoUpdate(ref._repo, ref._path, values, deferred.wrapCallback(() => { })); - return deferred.promise; -} -/** - * Gets the most up-to-date result for this query. - * - * @param query - The query to run. - * @returns A `Promise` which resolves to the resulting DataSnapshot if a value is - * available, or rejects if the client is unable to return a value (e.g., if the - * server is unreachable and there is nothing cached). - */ -function get(query) { - query = getModularInstance(query); - const callbackContext = new CallbackContext(() => { }); - const container = new ValueEventRegistration(callbackContext); - return repoGetValue(query._repo, query, container).then(node => { - return new DataSnapshot(node, new ReferenceImpl(query._repo, query._path), query._queryParams.getIndex()); - }); -} -/** - * Represents registration for 'value' events. - */ -class ValueEventRegistration { - constructor(callbackContext) { - this.callbackContext = callbackContext; - } - respondsTo(eventType) { - return eventType === 'value'; - } - createEvent(change, query) { - const index = query._queryParams.getIndex(); - return new DataEvent('value', this, new DataSnapshot(change.snapshotNode, new ReferenceImpl(query._repo, query._path), index)); - } - getEventRunner(eventData) { - if (eventData.getEventType() === 'cancel') { - return () => this.callbackContext.onCancel(eventData.error); - } - else { - return () => this.callbackContext.onValue(eventData.snapshot, null); - } - } - createCancelEvent(error, path) { - if (this.callbackContext.hasCancelCallback) { - return new CancelEvent(this, error, path); - } - else { - return null; - } - } - matches(other) { - if (!(other instanceof ValueEventRegistration)) { - return false; - } - else if (!other.callbackContext || !this.callbackContext) { - // If no callback specified, we consider it to match any callback. - return true; - } - else { - return other.callbackContext.matches(this.callbackContext); - } - } - hasAnyCallback() { - return this.callbackContext !== null; - } -} -/** - * Represents the registration of a child_x event. - */ -class ChildEventRegistration { - constructor(eventType, callbackContext) { - this.eventType = eventType; - this.callbackContext = callbackContext; - } - respondsTo(eventType) { - let eventToCheck = eventType === 'children_added' ? 'child_added' : eventType; - eventToCheck = - eventToCheck === 'children_removed' ? 'child_removed' : eventToCheck; - return this.eventType === eventToCheck; - } - createCancelEvent(error, path) { - if (this.callbackContext.hasCancelCallback) { - return new CancelEvent(this, error, path); - } - else { - return null; - } - } - createEvent(change, query) { - assert(change.childName != null, 'Child events should have a childName.'); - const childRef = child(new ReferenceImpl(query._repo, query._path), change.childName); - const index = query._queryParams.getIndex(); - return new DataEvent(change.type, this, new DataSnapshot(change.snapshotNode, childRef, index), change.prevName); - } - getEventRunner(eventData) { - if (eventData.getEventType() === 'cancel') { - return () => this.callbackContext.onCancel(eventData.error); - } - else { - return () => this.callbackContext.onValue(eventData.snapshot, eventData.prevName); - } - } - matches(other) { - if (other instanceof ChildEventRegistration) { - return (this.eventType === other.eventType && - (!this.callbackContext || - !other.callbackContext || - this.callbackContext.matches(other.callbackContext))); - } - return false; - } - hasAnyCallback() { - return !!this.callbackContext; - } -} -function addEventListener(query, eventType, callback, cancelCallbackOrListenOptions, options) { - let cancelCallback; - if (typeof cancelCallbackOrListenOptions === 'object') { - cancelCallback = undefined; - options = cancelCallbackOrListenOptions; - } - if (typeof cancelCallbackOrListenOptions === 'function') { - cancelCallback = cancelCallbackOrListenOptions; - } - if (options && options.onlyOnce) { - const userCallback = callback; - const onceCallback = (dataSnapshot, previousChildName) => { - repoRemoveEventCallbackForQuery(query._repo, query, container); - userCallback(dataSnapshot, previousChildName); - }; - onceCallback.userCallback = callback.userCallback; - onceCallback.context = callback.context; - callback = onceCallback; - } - const callbackContext = new CallbackContext(callback, cancelCallback || undefined); - const container = eventType === 'value' - ? new ValueEventRegistration(callbackContext) - : new ChildEventRegistration(eventType, callbackContext); - repoAddEventCallbackForQuery(query._repo, query, container); - return () => repoRemoveEventCallbackForQuery(query._repo, query, container); -} -function onValue(query, callback, cancelCallbackOrListenOptions, options) { - return addEventListener(query, 'value', callback, cancelCallbackOrListenOptions, options); -} -function onChildAdded(query, callback, cancelCallbackOrListenOptions, options) { - return addEventListener(query, 'child_added', callback, cancelCallbackOrListenOptions, options); -} -function onChildChanged(query, callback, cancelCallbackOrListenOptions, options) { - return addEventListener(query, 'child_changed', callback, cancelCallbackOrListenOptions, options); -} -function onChildMoved(query, callback, cancelCallbackOrListenOptions, options) { - return addEventListener(query, 'child_moved', callback, cancelCallbackOrListenOptions, options); -} -function onChildRemoved(query, callback, cancelCallbackOrListenOptions, options) { - return addEventListener(query, 'child_removed', callback, cancelCallbackOrListenOptions, options); -} -/** - * Detaches a callback previously attached with the corresponding `on*()` (`onValue`, `onChildAdded`) listener. - * Note: This is not the recommended way to remove a listener. Instead, please use the returned callback function from - * the respective `on*` callbacks. - * - * Detach a callback previously attached with `on*()`. Calling `off()` on a parent listener - * will not automatically remove listeners registered on child nodes, `off()` - * must also be called on any child listeners to remove the callback. - * - * If a callback is not specified, all callbacks for the specified eventType - * will be removed. Similarly, if no eventType is specified, all callbacks - * for the `Reference` will be removed. - * - * Individual listeners can also be removed by invoking their unsubscribe - * callbacks. - * - * @param query - The query that the listener was registered with. - * @param eventType - One of the following strings: "value", "child_added", - * "child_changed", "child_removed", or "child_moved." If omitted, all callbacks - * for the `Reference` will be removed. - * @param callback - The callback function that was passed to `on()` or - * `undefined` to remove all callbacks. - */ -function off(query, eventType, callback) { - let container = null; - const expCallback = callback ? new CallbackContext(callback) : null; - if (eventType === 'value') { - container = new ValueEventRegistration(expCallback); - } - else if (eventType) { - container = new ChildEventRegistration(eventType, expCallback); - } - repoRemoveEventCallbackForQuery(query._repo, query, container); -} -/** - * A `QueryConstraint` is used to narrow the set of documents returned by a - * Database query. `QueryConstraint`s are created by invoking {@link endAt}, - * {@link endBefore}, {@link startAt}, {@link startAfter}, {@link - * limitToFirst}, {@link limitToLast}, {@link orderByChild}, - * {@link orderByChild}, {@link orderByKey} , {@link orderByPriority} , - * {@link orderByValue} or {@link equalTo} and - * can then be passed to {@link query} to create a new query instance that - * also contains this `QueryConstraint`. - */ -class QueryConstraint { -} -class QueryEndAtConstraint extends QueryConstraint { - constructor(_value, _key) { - super(); - this._value = _value; - this._key = _key; - } - _apply(query) { - validateFirebaseDataArg('endAt', this._value, query._path, true); - const newParams = queryParamsEndAt(query._queryParams, this._value, this._key); - validateLimit(newParams); - validateQueryEndpoints(newParams); - if (query._queryParams.hasEnd()) { - throw new Error('endAt: Starting point was already set (by another call to endAt, ' + - 'endBefore or equalTo).'); - } - return new QueryImpl(query._repo, query._path, newParams, query._orderByCalled); - } -} -/** - * Creates a `QueryConstraint` with the specified ending point. - * - * Using `startAt()`, `startAfter()`, `endBefore()`, `endAt()` and `equalTo()` - * allows you to choose arbitrary starting and ending points for your queries. - * - * The ending point is inclusive, so children with exactly the specified value - * will be included in the query. The optional key argument can be used to - * further limit the range of the query. If it is specified, then children that - * have exactly the specified value must also have a key name less than or equal - * to the specified key. - * - * You can read more about `endAt()` in - * {@link https://firebase.google.com/docs/database/web/lists-of-data#filtering_data | Filtering data}. - * - * @param value - The value to end at. The argument type depends on which - * `orderBy*()` function was used in this query. Specify a value that matches - * the `orderBy*()` type. When used in combination with `orderByKey()`, the - * value must be a string. - * @param key - The child key to end at, among the children with the previously - * specified priority. This argument is only allowed if ordering by child, - * value, or priority. - */ -function endAt(value, key) { - validateKey('endAt', 'key', key, true); - return new QueryEndAtConstraint(value, key); -} -class QueryEndBeforeConstraint extends QueryConstraint { - constructor(_value, _key) { - super(); - this._value = _value; - this._key = _key; - } - _apply(query) { - validateFirebaseDataArg('endBefore', this._value, query._path, false); - const newParams = queryParamsEndBefore(query._queryParams, this._value, this._key); - validateLimit(newParams); - validateQueryEndpoints(newParams); - if (query._queryParams.hasEnd()) { - throw new Error('endBefore: Starting point was already set (by another call to endAt, ' + - 'endBefore or equalTo).'); - } - return new QueryImpl(query._repo, query._path, newParams, query._orderByCalled); - } -} -/** - * Creates a `QueryConstraint` with the specified ending point (exclusive). - * - * Using `startAt()`, `startAfter()`, `endBefore()`, `endAt()` and `equalTo()` - * allows you to choose arbitrary starting and ending points for your queries. - * - * The ending point is exclusive. If only a value is provided, children - * with a value less than the specified value will be included in the query. - * If a key is specified, then children must have a value less than or equal - * to the specified value and a key name less than the specified key. - * - * @param value - The value to end before. The argument type depends on which - * `orderBy*()` function was used in this query. Specify a value that matches - * the `orderBy*()` type. When used in combination with `orderByKey()`, the - * value must be a string. - * @param key - The child key to end before, among the children with the - * previously specified priority. This argument is only allowed if ordering by - * child, value, or priority. - */ -function endBefore(value, key) { - validateKey('endBefore', 'key', key, true); - return new QueryEndBeforeConstraint(value, key); -} -class QueryStartAtConstraint extends QueryConstraint { - constructor(_value, _key) { - super(); - this._value = _value; - this._key = _key; - } - _apply(query) { - validateFirebaseDataArg('startAt', this._value, query._path, true); - const newParams = queryParamsStartAt(query._queryParams, this._value, this._key); - validateLimit(newParams); - validateQueryEndpoints(newParams); - if (query._queryParams.hasStart()) { - throw new Error('startAt: Starting point was already set (by another call to startAt, ' + - 'startBefore or equalTo).'); - } - return new QueryImpl(query._repo, query._path, newParams, query._orderByCalled); - } -} -/** - * Creates a `QueryConstraint` with the specified starting point. - * - * Using `startAt()`, `startAfter()`, `endBefore()`, `endAt()` and `equalTo()` - * allows you to choose arbitrary starting and ending points for your queries. - * - * The starting point is inclusive, so children with exactly the specified value - * will be included in the query. The optional key argument can be used to - * further limit the range of the query. If it is specified, then children that - * have exactly the specified value must also have a key name greater than or - * equal to the specified key. - * - * You can read more about `startAt()` in - * {@link https://firebase.google.com/docs/database/web/lists-of-data#filtering_data | Filtering data}. - * - * @param value - The value to start at. The argument type depends on which - * `orderBy*()` function was used in this query. Specify a value that matches - * the `orderBy*()` type. When used in combination with `orderByKey()`, the - * value must be a string. - * @param key - The child key to start at. This argument is only allowed if - * ordering by child, value, or priority. - */ -function startAt(value = null, key) { - validateKey('startAt', 'key', key, true); - return new QueryStartAtConstraint(value, key); -} -class QueryStartAfterConstraint extends QueryConstraint { - constructor(_value, _key) { - super(); - this._value = _value; - this._key = _key; - } - _apply(query) { - validateFirebaseDataArg('startAfter', this._value, query._path, false); - const newParams = queryParamsStartAfter(query._queryParams, this._value, this._key); - validateLimit(newParams); - validateQueryEndpoints(newParams); - if (query._queryParams.hasStart()) { - throw new Error('startAfter: Starting point was already set (by another call to startAt, ' + - 'startAfter, or equalTo).'); - } - return new QueryImpl(query._repo, query._path, newParams, query._orderByCalled); - } -} -/** - * Creates a `QueryConstraint` with the specified starting point (exclusive). - * - * Using `startAt()`, `startAfter()`, `endBefore()`, `endAt()` and `equalTo()` - * allows you to choose arbitrary starting and ending points for your queries. - * - * The starting point is exclusive. If only a value is provided, children - * with a value greater than the specified value will be included in the query. - * If a key is specified, then children must have a value greater than or equal - * to the specified value and a a key name greater than the specified key. - * - * @param value - The value to start after. The argument type depends on which - * `orderBy*()` function was used in this query. Specify a value that matches - * the `orderBy*()` type. When used in combination with `orderByKey()`, the - * value must be a string. - * @param key - The child key to start after. This argument is only allowed if - * ordering by child, value, or priority. - */ -function startAfter(value, key) { - validateKey('startAfter', 'key', key, true); - return new QueryStartAfterConstraint(value, key); -} -class QueryLimitToFirstConstraint extends QueryConstraint { - constructor(_limit) { - super(); - this._limit = _limit; - } - _apply(query) { - if (query._queryParams.hasLimit()) { - throw new Error('limitToFirst: Limit was already set (by another call to limitToFirst ' + - 'or limitToLast).'); - } - return new QueryImpl(query._repo, query._path, queryParamsLimitToFirst(query._queryParams, this._limit), query._orderByCalled); - } -} -/** - * Creates a new `QueryConstraint` that if limited to the first specific number - * of children. - * - * The `limitToFirst()` method is used to set a maximum number of children to be - * synced for a given callback. If we set a limit of 100, we will initially only - * receive up to 100 `child_added` events. If we have fewer than 100 messages - * stored in our Database, a `child_added` event will fire for each message. - * However, if we have over 100 messages, we will only receive a `child_added` - * event for the first 100 ordered messages. As items change, we will receive - * `child_removed` events for each item that drops out of the active list so - * that the total number stays at 100. - * - * You can read more about `limitToFirst()` in - * {@link https://firebase.google.com/docs/database/web/lists-of-data#filtering_data | Filtering data}. - * - * @param limit - The maximum number of nodes to include in this query. - */ -function limitToFirst(limit) { - if (typeof limit !== 'number' || Math.floor(limit) !== limit || limit <= 0) { - throw new Error('limitToFirst: First argument must be a positive integer.'); - } - return new QueryLimitToFirstConstraint(limit); -} -class QueryLimitToLastConstraint extends QueryConstraint { - constructor(_limit) { - super(); - this._limit = _limit; - } - _apply(query) { - if (query._queryParams.hasLimit()) { - throw new Error('limitToLast: Limit was already set (by another call to limitToFirst ' + - 'or limitToLast).'); - } - return new QueryImpl(query._repo, query._path, queryParamsLimitToLast(query._queryParams, this._limit), query._orderByCalled); - } -} -/** - * Creates a new `QueryConstraint` that is limited to return only the last - * specified number of children. - * - * The `limitToLast()` method is used to set a maximum number of children to be - * synced for a given callback. If we set a limit of 100, we will initially only - * receive up to 100 `child_added` events. If we have fewer than 100 messages - * stored in our Database, a `child_added` event will fire for each message. - * However, if we have over 100 messages, we will only receive a `child_added` - * event for the last 100 ordered messages. As items change, we will receive - * `child_removed` events for each item that drops out of the active list so - * that the total number stays at 100. - * - * You can read more about `limitToLast()` in - * {@link https://firebase.google.com/docs/database/web/lists-of-data#filtering_data | Filtering data}. - * - * @param limit - The maximum number of nodes to include in this query. - */ -function limitToLast(limit) { - if (typeof limit !== 'number' || Math.floor(limit) !== limit || limit <= 0) { - throw new Error('limitToLast: First argument must be a positive integer.'); - } - return new QueryLimitToLastConstraint(limit); -} -class QueryOrderByChildConstraint extends QueryConstraint { - constructor(_path) { - super(); - this._path = _path; - } - _apply(query) { - validateNoPreviousOrderByCall(query, 'orderByChild'); - const parsedPath = new Path(this._path); - if (pathIsEmpty(parsedPath)) { - throw new Error('orderByChild: cannot pass in empty path. Use orderByValue() instead.'); - } - const index = new PathIndex(parsedPath); - const newParams = queryParamsOrderBy(query._queryParams, index); - validateQueryEndpoints(newParams); - return new QueryImpl(query._repo, query._path, newParams, - /*orderByCalled=*/ true); - } -} -/** - * Creates a new `QueryConstraint` that orders by the specified child key. - * - * Queries can only order by one key at a time. Calling `orderByChild()` - * multiple times on the same query is an error. - * - * Firebase queries allow you to order your data by any child key on the fly. - * However, if you know in advance what your indexes will be, you can define - * them via the .indexOn rule in your Security Rules for better performance. See - * the{@link https://firebase.google.com/docs/database/security/indexing-data} - * rule for more information. - * - * You can read more about `orderByChild()` in - * {@link https://firebase.google.com/docs/database/web/lists-of-data#sort_data | Sort data}. - * - * @param path - The path to order by. - */ -function orderByChild(path) { - if (path === '$key') { - throw new Error('orderByChild: "$key" is invalid. Use orderByKey() instead.'); - } - else if (path === '$priority') { - throw new Error('orderByChild: "$priority" is invalid. Use orderByPriority() instead.'); - } - else if (path === '$value') { - throw new Error('orderByChild: "$value" is invalid. Use orderByValue() instead.'); - } - validatePathString('orderByChild', 'path', path, false); - return new QueryOrderByChildConstraint(path); -} -class QueryOrderByKeyConstraint extends QueryConstraint { - _apply(query) { - validateNoPreviousOrderByCall(query, 'orderByKey'); - const newParams = queryParamsOrderBy(query._queryParams, KEY_INDEX); - validateQueryEndpoints(newParams); - return new QueryImpl(query._repo, query._path, newParams, - /*orderByCalled=*/ true); - } -} -/** - * Creates a new `QueryConstraint` that orders by the key. - * - * Sorts the results of a query by their (ascending) key values. - * - * You can read more about `orderByKey()` in - * {@link https://firebase.google.com/docs/database/web/lists-of-data#sort_data | Sort data}. - */ -function orderByKey() { - return new QueryOrderByKeyConstraint(); -} -class QueryOrderByPriorityConstraint extends QueryConstraint { - _apply(query) { - validateNoPreviousOrderByCall(query, 'orderByPriority'); - const newParams = queryParamsOrderBy(query._queryParams, PRIORITY_INDEX); - validateQueryEndpoints(newParams); - return new QueryImpl(query._repo, query._path, newParams, - /*orderByCalled=*/ true); - } -} -/** - * Creates a new `QueryConstraint` that orders by priority. - * - * Applications need not use priority but can order collections by - * ordinary properties (see - * {@link https://firebase.google.com/docs/database/web/lists-of-data#sort_data | Sort data} - * for alternatives to priority. - */ -function orderByPriority() { - return new QueryOrderByPriorityConstraint(); -} -class QueryOrderByValueConstraint extends QueryConstraint { - _apply(query) { - validateNoPreviousOrderByCall(query, 'orderByValue'); - const newParams = queryParamsOrderBy(query._queryParams, VALUE_INDEX); - validateQueryEndpoints(newParams); - return new QueryImpl(query._repo, query._path, newParams, - /*orderByCalled=*/ true); - } -} -/** - * Creates a new `QueryConstraint` that orders by value. - * - * If the children of a query are all scalar values (string, number, or - * boolean), you can order the results by their (ascending) values. - * - * You can read more about `orderByValue()` in - * {@link https://firebase.google.com/docs/database/web/lists-of-data#sort_data | Sort data}. - */ -function orderByValue() { - return new QueryOrderByValueConstraint(); -} -class QueryEqualToValueConstraint extends QueryConstraint { - constructor(_value, _key) { - super(); - this._value = _value; - this._key = _key; - } - _apply(query) { - validateFirebaseDataArg('equalTo', this._value, query._path, false); - if (query._queryParams.hasStart()) { - throw new Error('equalTo: Starting point was already set (by another call to startAt/startAfter or ' + - 'equalTo).'); - } - if (query._queryParams.hasEnd()) { - throw new Error('equalTo: Ending point was already set (by another call to endAt/endBefore or ' + - 'equalTo).'); - } - return new QueryEndAtConstraint(this._value, this._key)._apply(new QueryStartAtConstraint(this._value, this._key)._apply(query)); - } -} -/** - * Creates a `QueryConstraint` that includes children that match the specified - * value. - * - * Using `startAt()`, `startAfter()`, `endBefore()`, `endAt()` and `equalTo()` - * allows you to choose arbitrary starting and ending points for your queries. - * - * The optional key argument can be used to further limit the range of the - * query. If it is specified, then children that have exactly the specified - * value must also have exactly the specified key as their key name. This can be - * used to filter result sets with many matches for the same value. - * - * You can read more about `equalTo()` in - * {@link https://firebase.google.com/docs/database/web/lists-of-data#filtering_data | Filtering data}. - * - * @param value - The value to match for. The argument type depends on which - * `orderBy*()` function was used in this query. Specify a value that matches - * the `orderBy*()` type. When used in combination with `orderByKey()`, the - * value must be a string. - * @param key - The child key to start at, among the children with the - * previously specified priority. This argument is only allowed if ordering by - * child, value, or priority. - */ -function equalTo(value, key) { - validateKey('equalTo', 'key', key, true); - return new QueryEqualToValueConstraint(value, key); -} -/** - * Creates a new immutable instance of `Query` that is extended to also include - * additional query constraints. - * - * @param query - The Query instance to use as a base for the new constraints. - * @param queryConstraints - The list of `QueryConstraint`s to apply. - * @throws if any of the provided query constraints cannot be combined with the - * existing or new constraints. - */ -function query(query, ...queryConstraints) { - let queryImpl = getModularInstance(query); - for (const constraint of queryConstraints) { - queryImpl = constraint._apply(queryImpl); - } - return queryImpl; -} -/** - * Define reference constructor in various modules - * - * We are doing this here to avoid several circular - * dependency issues - */ -syncPointSetReferenceConstructor(ReferenceImpl); -syncTreeSetReferenceConstructor(ReferenceImpl); - -/** - * @license - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * This variable is also defined in the firebase Node.js Admin SDK. Before - * modifying this definition, consult the definition in: - * - * https://github.com/firebase/firebase-admin-node - * - * and make sure the two are consistent. - */ -const FIREBASE_DATABASE_EMULATOR_HOST_VAR = 'FIREBASE_DATABASE_EMULATOR_HOST'; -/** - * Creates and caches `Repo` instances. - */ -const repos = {}; -/** - * If true, any new `Repo` will be created to use `ReadonlyRestClient` (for testing purposes). - */ -let useRestClient = false; -/** - * Update an existing `Repo` in place to point to a new host/port. - */ -function repoManagerApplyEmulatorSettings(repo, host, port, tokenProvider) { - repo.repoInfo_ = new RepoInfo(`${host}:${port}`, - /* secure= */ false, repo.repoInfo_.namespace, repo.repoInfo_.webSocketOnly, repo.repoInfo_.nodeAdmin, repo.repoInfo_.persistenceKey, repo.repoInfo_.includeNamespaceInQueryParams); - if (tokenProvider) { - repo.authTokenProvider_ = tokenProvider; - } -} -/** - * This function should only ever be called to CREATE a new database instance. - * @internal - */ -function repoManagerDatabaseFromApp(app, authProvider, appCheckProvider, url, nodeAdmin) { - let dbUrl = url || app.options.databaseURL; - if (dbUrl === undefined) { - if (!app.options.projectId) { - fatal("Can't determine Firebase Database URL. Be sure to include " + - ' a Project ID when calling firebase.initializeApp().'); - } - log('Using default host for project ', app.options.projectId); - dbUrl = `${app.options.projectId}-default-rtdb.firebaseio.com`; - } - let parsedUrl = parseRepoInfo(dbUrl, nodeAdmin); - let repoInfo = parsedUrl.repoInfo; - let isEmulator; - let dbEmulatorHost = undefined; - if (typeof process !== 'undefined' && process.env) { - dbEmulatorHost = process.env[FIREBASE_DATABASE_EMULATOR_HOST_VAR]; - } - if (dbEmulatorHost) { - isEmulator = true; - dbUrl = `http://${dbEmulatorHost}?ns=${repoInfo.namespace}`; - parsedUrl = parseRepoInfo(dbUrl, nodeAdmin); - repoInfo = parsedUrl.repoInfo; - } - else { - isEmulator = !parsedUrl.repoInfo.secure; - } - const authTokenProvider = nodeAdmin && isEmulator - ? new EmulatorTokenProvider(EmulatorTokenProvider.OWNER) - : new FirebaseAuthTokenProvider(app.name, app.options, authProvider); - validateUrl('Invalid Firebase Database URL', parsedUrl); - if (!pathIsEmpty(parsedUrl.path)) { - fatal('Database URL must point to the root of a Firebase Database ' + - '(not including a child path).'); - } - const repo = repoManagerCreateRepo(repoInfo, app, authTokenProvider, new AppCheckTokenProvider(app.name, appCheckProvider)); - return new Database(repo, app); -} -/** - * Remove the repo and make sure it is disconnected. - * - */ -function repoManagerDeleteRepo(repo, appName) { - const appRepos = repos[appName]; - // This should never happen... - if (!appRepos || appRepos[repo.key] !== repo) { - fatal(`Database ${appName}(${repo.repoInfo_}) has already been deleted.`); - } - repoInterrupt(repo); - delete appRepos[repo.key]; -} -/** - * Ensures a repo doesn't already exist and then creates one using the - * provided app. - * - * @param repoInfo - The metadata about the Repo - * @returns The Repo object for the specified server / repoName. - */ -function repoManagerCreateRepo(repoInfo, app, authTokenProvider, appCheckProvider) { - let appRepos = repos[app.name]; - if (!appRepos) { - appRepos = {}; - repos[app.name] = appRepos; - } - let repo = appRepos[repoInfo.toURLString()]; - if (repo) { - fatal('Database initialized multiple times. Please make sure the format of the database URL matches with each database() call.'); - } - repo = new Repo(repoInfo, useRestClient, authTokenProvider, appCheckProvider); - appRepos[repoInfo.toURLString()] = repo; - return repo; -} -/** - * Forces us to use ReadonlyRestClient instead of PersistentConnection for new Repos. - */ -function repoManagerForceRestClient(forceRestClient) { - useRestClient = forceRestClient; -} -/** - * Class representing a Firebase Realtime Database. - */ -class Database { - /** @hideconstructor */ - constructor(_repoInternal, - /** The {@link @firebase/app#FirebaseApp} associated with this Realtime Database instance. */ - app) { - this._repoInternal = _repoInternal; - this.app = app; - /** Represents a `Database` instance. */ - this['type'] = 'database'; - /** Track if the instance has been used (root or repo accessed) */ - this._instanceStarted = false; - } - get _repo() { - if (!this._instanceStarted) { - repoStart(this._repoInternal, this.app.options.appId, this.app.options['databaseAuthVariableOverride']); - this._instanceStarted = true; - } - return this._repoInternal; - } - get _root() { - if (!this._rootInternal) { - this._rootInternal = new ReferenceImpl(this._repo, newEmptyPath()); - } - return this._rootInternal; - } - _delete() { - if (this._rootInternal !== null) { - repoManagerDeleteRepo(this._repo, this.app.name); - this._repoInternal = null; - this._rootInternal = null; - } - return Promise.resolve(); - } - _checkNotDeleted(apiName) { - if (this._rootInternal === null) { - fatal('Cannot call ' + apiName + ' on a deleted database.'); - } - } -} -function checkTransportInit() { - if (TransportManager.IS_TRANSPORT_INITIALIZED) { - warn('Transport has already been initialized. Please call this function before calling ref or setting up a listener'); - } -} -/** - * Force the use of websockets instead of longPolling. - */ -function forceWebSockets() { - checkTransportInit(); - BrowserPollConnection.forceDisallow(); -} -/** - * Force the use of longPolling instead of websockets. This will be ignored if websocket protocol is used in databaseURL. - */ -function forceLongPolling() { - checkTransportInit(); - WebSocketConnection.forceDisallow(); - BrowserPollConnection.forceAllow(); -} -/** - * Returns the instance of the Realtime Database SDK that is associated - * with the provided {@link @firebase/app#FirebaseApp}. Initializes a new instance with - * with default settings if no instance exists or if the existing instance uses - * a custom database URL. - * - * @param app - The {@link @firebase/app#FirebaseApp} instance that the returned Realtime - * Database instance is associated with. - * @param url - The URL of the Realtime Database instance to connect to. If not - * provided, the SDK connects to the default instance of the Firebase App. - * @returns The `Database` instance of the provided app. - */ -function getDatabase(app = getApp(), url) { - const db = _getProvider(app, 'database').getImmediate({ - identifier: url - }); - const emulator = getDefaultEmulatorHostnameAndPort('database'); - if (emulator) { - connectDatabaseEmulator(db, ...emulator); - } - return db; -} -/** - * Modify the provided instance to communicate with the Realtime Database - * emulator. - * - *

Note: This method must be called before performing any other operation. - * - * @param db - The instance to modify. - * @param host - The emulator host (ex: localhost) - * @param port - The emulator port (ex: 8080) - * @param options.mockUserToken - the mock auth token to use for unit testing Security Rules - */ -function connectDatabaseEmulator(db, host, port, options = {}) { - db = getModularInstance(db); - db._checkNotDeleted('useEmulator'); - if (db._instanceStarted) { - fatal('Cannot call useEmulator() after instance has already been initialized.'); - } - const repo = db._repoInternal; - let tokenProvider = undefined; - if (repo.repoInfo_.nodeAdmin) { - if (options.mockUserToken) { - fatal('mockUserToken is not supported by the Admin SDK. For client access with mock users, please use the "firebase" package instead of "firebase-admin".'); - } - tokenProvider = new EmulatorTokenProvider(EmulatorTokenProvider.OWNER); - } - else if (options.mockUserToken) { - const token = typeof options.mockUserToken === 'string' - ? options.mockUserToken - : createMockUserToken(options.mockUserToken, db.app.options.projectId); - tokenProvider = new EmulatorTokenProvider(token); - } - // Modify the repo to apply emulator settings - repoManagerApplyEmulatorSettings(repo, host, port, tokenProvider); -} -/** - * Disconnects from the server (all Database operations will be completed - * offline). - * - * The client automatically maintains a persistent connection to the Database - * server, which will remain active indefinitely and reconnect when - * disconnected. However, the `goOffline()` and `goOnline()` methods may be used - * to control the client connection in cases where a persistent connection is - * undesirable. - * - * While offline, the client will no longer receive data updates from the - * Database. However, all Database operations performed locally will continue to - * immediately fire events, allowing your application to continue behaving - * normally. Additionally, each operation performed locally will automatically - * be queued and retried upon reconnection to the Database server. - * - * To reconnect to the Database and begin receiving remote events, see - * `goOnline()`. - * - * @param db - The instance to disconnect. - */ -function goOffline(db) { - db = getModularInstance(db); - db._checkNotDeleted('goOffline'); - repoInterrupt(db._repo); -} -/** - * Reconnects to the server and synchronizes the offline Database state - * with the server state. - * - * This method should be used after disabling the active connection with - * `goOffline()`. Once reconnected, the client will transmit the proper data - * and fire the appropriate events so that your client "catches up" - * automatically. - * - * @param db - The instance to reconnect. - */ -function goOnline(db) { - db = getModularInstance(db); - db._checkNotDeleted('goOnline'); - repoResume(db._repo); -} -function enableLogging(logger, persistent) { - enableLogging$1(logger, persistent); -} - -/** - * @license - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -function registerDatabase(variant) { - setSDKVersion(SDK_VERSION$1); - _registerComponent(new Component('database', (container, { instanceIdentifier: url }) => { - const app = container.getProvider('app').getImmediate(); - const authProvider = container.getProvider('auth-internal'); - const appCheckProvider = container.getProvider('app-check-internal'); - return repoManagerDatabaseFromApp(app, authProvider, appCheckProvider, url); - }, "PUBLIC" /* PUBLIC */).setMultipleInstances(true)); - registerVersion(name, version, variant); - // BUILD_TARGET will be replaced by values like esm5, esm2017, cjs5, etc during the compilation - registerVersion(name, version, 'esm2017'); -} - -/** - * @license - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -const SERVER_TIMESTAMP = { - '.sv': 'timestamp' -}; -/** - * Returns a placeholder value for auto-populating the current timestamp (time - * since the Unix epoch, in milliseconds) as determined by the Firebase - * servers. - */ -function serverTimestamp() { - return SERVER_TIMESTAMP; -} -/** - * Returns a placeholder value that can be used to atomically increment the - * current database value by the provided delta. - * - * @param delta - the amount to modify the current value atomically. - * @returns A placeholder value for modifying data atomically server-side. - */ -function increment(delta) { - return { - '.sv': { - 'increment': delta - } - }; -} - -/** - * @license - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * A type for the resolve value of {@link runTransaction}. - */ -class TransactionResult { - /** @hideconstructor */ - constructor( - /** Whether the transaction was successfully committed. */ - committed, - /** The resulting data snapshot. */ - snapshot) { - this.committed = committed; - this.snapshot = snapshot; - } - /** Returns a JSON-serializable representation of this object. */ - toJSON() { - return { committed: this.committed, snapshot: this.snapshot.toJSON() }; - } -} -/** - * Atomically modifies the data at this location. - * - * Atomically modify the data at this location. Unlike a normal `set()`, which - * just overwrites the data regardless of its previous value, `runTransaction()` is - * used to modify the existing value to a new value, ensuring there are no - * conflicts with other clients writing to the same location at the same time. - * - * To accomplish this, you pass `runTransaction()` an update function which is - * used to transform the current value into a new value. If another client - * writes to the location before your new value is successfully written, your - * update function will be called again with the new current value, and the - * write will be retried. This will happen repeatedly until your write succeeds - * without conflict or you abort the transaction by not returning a value from - * your update function. - * - * Note: Modifying data with `set()` will cancel any pending transactions at - * that location, so extreme care should be taken if mixing `set()` and - * `runTransaction()` to update the same data. - * - * Note: When using transactions with Security and Firebase Rules in place, be - * aware that a client needs `.read` access in addition to `.write` access in - * order to perform a transaction. This is because the client-side nature of - * transactions requires the client to read the data in order to transactionally - * update it. - * - * @param ref - The location to atomically modify. - * @param transactionUpdate - A developer-supplied function which will be passed - * the current data stored at this location (as a JavaScript object). The - * function should return the new value it would like written (as a JavaScript - * object). If `undefined` is returned (i.e. you return with no arguments) the - * transaction will be aborted and the data at this location will not be - * modified. - * @param options - An options object to configure transactions. - * @returns A `Promise` that can optionally be used instead of the `onComplete` - * callback to handle success and failure. - */ -function runTransaction(ref, -// eslint-disable-next-line @typescript-eslint/no-explicit-any -transactionUpdate, options) { - var _a; - ref = getModularInstance(ref); - validateWritablePath('Reference.transaction', ref._path); - if (ref.key === '.length' || ref.key === '.keys') { - throw ('Reference.transaction failed: ' + ref.key + ' is a read-only object.'); - } - const applyLocally = (_a = options === null || options === void 0 ? void 0 : options.applyLocally) !== null && _a !== void 0 ? _a : true; - const deferred = new Deferred(); - const promiseComplete = (error, committed, node) => { - let dataSnapshot = null; - if (error) { - deferred.reject(error); - } - else { - dataSnapshot = new DataSnapshot(node, new ReferenceImpl(ref._repo, ref._path), PRIORITY_INDEX); - deferred.resolve(new TransactionResult(committed, dataSnapshot)); - } - }; - // Add a watch to make sure we get server updates. - const unwatcher = onValue(ref, () => { }); - repoStartTransaction(ref._repo, ref._path, transactionUpdate, promiseComplete, unwatcher, applyLocally); - return deferred.promise; -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -PersistentConnection; -// eslint-disable-next-line @typescript-eslint/no-explicit-any -PersistentConnection.prototype.simpleListen = function (pathString, onComplete) { - this.sendRequest('q', { p: pathString }, onComplete); -}; -// eslint-disable-next-line @typescript-eslint/no-explicit-any -PersistentConnection.prototype.echo = function (data, onEcho) { - this.sendRequest('echo', { d: data }, onEcho); -}; -// RealTimeConnection properties that we use in tests. -Connection; -/** - * @internal - */ -const hijackHash = function (newHash) { - const oldPut = PersistentConnection.prototype.put; - PersistentConnection.prototype.put = function (pathString, data, onComplete, hash) { - if (hash !== undefined) { - hash = newHash(); - } - oldPut.call(this, pathString, data, onComplete, hash); - }; - return function () { - PersistentConnection.prototype.put = oldPut; - }; -}; -RepoInfo; -/** - * Forces the RepoManager to create Repos that use ReadonlyRestClient instead of PersistentConnection. - * @internal - */ -const forceRestClient = function (forceRestClient) { - repoManagerForceRestClient(forceRestClient); -}; - -/** - * @license - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -setWebSocketImpl(Websocket.Client); -registerDatabase('node'); - -export { DataSnapshot, Database, OnDisconnect, QueryConstraint, TransactionResult, QueryImpl as _QueryImpl, QueryParams as _QueryParams, ReferenceImpl as _ReferenceImpl, forceRestClient as _TEST_ACCESS_forceRestClient, hijackHash as _TEST_ACCESS_hijackHash, repoManagerDatabaseFromApp as _repoManagerDatabaseFromApp, setSDKVersion as _setSDKVersion, validatePathString as _validatePathString, validateWritablePath as _validateWritablePath, child, connectDatabaseEmulator, enableLogging, endAt, endBefore, equalTo, forceLongPolling, forceWebSockets, get, getDatabase, goOffline, goOnline, increment, limitToFirst, limitToLast, off, onChildAdded, onChildChanged, onChildMoved, onChildRemoved, onDisconnect, onValue, orderByChild, orderByKey, orderByPriority, orderByValue, push, query, ref, refFromURL, remove, runTransaction, serverTimestamp, set, setPriority, setWithPriority, startAfter, startAt, update }; -//# sourceMappingURL=index.node.esm.js.map diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/package.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/package.json deleted file mode 100644 index 7c34deb5..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/package.json +++ /dev/null @@ -1 +0,0 @@ -{"type":"module"} \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/api.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/api.d.ts deleted file mode 100644 index 2f034539..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/api.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -/** - * @license - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export * from './api.standalone'; -export { getDatabase } from './api/Database'; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/api.standalone.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/api.standalone.d.ts deleted file mode 100644 index c3bc772e..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/api.standalone.d.ts +++ /dev/null @@ -1,29 +0,0 @@ -/** - * @license - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export { Database, EmulatorMockTokenOptions, enableLogging, goOffline, goOnline, forceWebSockets, forceLongPolling, connectDatabaseEmulator } from './api/Database'; -export { Query, DatabaseReference, ListenOptions, Unsubscribe, ThenableReference } from './api/Reference'; -export { OnDisconnect } from './api/OnDisconnect'; -export { DataSnapshot, EventType, QueryConstraint, QueryConstraintType, endAt, endBefore, equalTo, get, limitToFirst, limitToLast, off, onChildAdded, onChildChanged, onChildMoved, onChildRemoved, onDisconnect, onValue, orderByChild, orderByKey, orderByPriority, orderByValue, push, query, ref, refFromURL, remove, set, setPriority, setWithPriority, startAfter, startAt, update, child } from './api/Reference_impl'; -export { increment, serverTimestamp } from './api/ServerValue'; -export { runTransaction, TransactionOptions, TransactionResult } from './api/Transaction'; -export { setSDKVersion as _setSDKVersion } from './core/version'; -export { ReferenceImpl as _ReferenceImpl, QueryImpl as _QueryImpl } from './api/Reference_impl'; -export { repoManagerDatabaseFromApp as _repoManagerDatabaseFromApp } from './api/Database'; -export { validatePathString as _validatePathString, validateWritablePath as _validateWritablePath } from './core/util/validation'; -export { UserCallback as _UserCallback } from './core/view/EventRegistration'; -export { QueryParams as _QueryParams } from './core/view/QueryParams'; -export { hijackHash as _TEST_ACCESS_hijackHash, forceRestClient as _TEST_ACCESS_forceRestClient } from './api/test_access'; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/api/Database.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/api/Database.d.ts deleted file mode 100644 index 7cfbbc61..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/api/Database.d.ts +++ /dev/null @@ -1,138 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { _FirebaseService, FirebaseApp } from '@firebase/app'; -import { AppCheckInternalComponentName } from '@firebase/app-check-interop-types'; -import { FirebaseAuthInternalName } from '@firebase/auth-interop-types'; -import { Provider } from '@firebase/component'; -import { EmulatorMockTokenOptions } from '@firebase/util'; -import { Repo } from '../core/Repo'; -import { ReferenceImpl } from './Reference_impl'; -export { EmulatorMockTokenOptions } from '@firebase/util'; -/** - * This function should only ever be called to CREATE a new database instance. - * @internal - */ -export declare function repoManagerDatabaseFromApp(app: FirebaseApp, authProvider: Provider, appCheckProvider?: Provider, url?: string, nodeAdmin?: boolean): Database; -/** - * Forces us to use ReadonlyRestClient instead of PersistentConnection for new Repos. - */ -export declare function repoManagerForceRestClient(forceRestClient: boolean): void; -/** - * Class representing a Firebase Realtime Database. - */ -export declare class Database implements _FirebaseService { - _repoInternal: Repo; - /** The {@link @firebase/app#FirebaseApp} associated with this Realtime Database instance. */ - readonly app: FirebaseApp; - /** Represents a `Database` instance. */ - readonly 'type' = "database"; - /** Track if the instance has been used (root or repo accessed) */ - _instanceStarted: boolean; - /** Backing state for root_ */ - private _rootInternal?; - /** @hideconstructor */ - constructor(_repoInternal: Repo, - /** The {@link @firebase/app#FirebaseApp} associated with this Realtime Database instance. */ - app: FirebaseApp); - get _repo(): Repo; - get _root(): ReferenceImpl; - _delete(): Promise; - _checkNotDeleted(apiName: string): void; -} -/** - * Force the use of websockets instead of longPolling. - */ -export declare function forceWebSockets(): void; -/** - * Force the use of longPolling instead of websockets. This will be ignored if websocket protocol is used in databaseURL. - */ -export declare function forceLongPolling(): void; -/** - * Returns the instance of the Realtime Database SDK that is associated - * with the provided {@link @firebase/app#FirebaseApp}. Initializes a new instance with - * with default settings if no instance exists or if the existing instance uses - * a custom database URL. - * - * @param app - The {@link @firebase/app#FirebaseApp} instance that the returned Realtime - * Database instance is associated with. - * @param url - The URL of the Realtime Database instance to connect to. If not - * provided, the SDK connects to the default instance of the Firebase App. - * @returns The `Database` instance of the provided app. - */ -export declare function getDatabase(app?: FirebaseApp, url?: string): Database; -/** - * Modify the provided instance to communicate with the Realtime Database - * emulator. - * - *

Note: This method must be called before performing any other operation. - * - * @param db - The instance to modify. - * @param host - The emulator host (ex: localhost) - * @param port - The emulator port (ex: 8080) - * @param options.mockUserToken - the mock auth token to use for unit testing Security Rules - */ -export declare function connectDatabaseEmulator(db: Database, host: string, port: number, options?: { - mockUserToken?: EmulatorMockTokenOptions | string; -}): void; -/** - * Disconnects from the server (all Database operations will be completed - * offline). - * - * The client automatically maintains a persistent connection to the Database - * server, which will remain active indefinitely and reconnect when - * disconnected. However, the `goOffline()` and `goOnline()` methods may be used - * to control the client connection in cases where a persistent connection is - * undesirable. - * - * While offline, the client will no longer receive data updates from the - * Database. However, all Database operations performed locally will continue to - * immediately fire events, allowing your application to continue behaving - * normally. Additionally, each operation performed locally will automatically - * be queued and retried upon reconnection to the Database server. - * - * To reconnect to the Database and begin receiving remote events, see - * `goOnline()`. - * - * @param db - The instance to disconnect. - */ -export declare function goOffline(db: Database): void; -/** - * Reconnects to the server and synchronizes the offline Database state - * with the server state. - * - * This method should be used after disabling the active connection with - * `goOffline()`. Once reconnected, the client will transmit the proper data - * and fire the appropriate events so that your client "catches up" - * automatically. - * - * @param db - The instance to reconnect. - */ -export declare function goOnline(db: Database): void; -/** - * Logs debugging information to the console. - * - * @param enabled - Enables logging if `true`, disables logging if `false`. - * @param persistent - Remembers the logging state between page refreshes if - * `true`. - */ -export declare function enableLogging(enabled: boolean, persistent?: boolean): any; -/** - * Logs debugging information to the console. - * - * @param logger - A custom logger function to control how things get logged. - */ -export declare function enableLogging(logger: (message: string) => unknown): any; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/api/OnDisconnect.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/api/OnDisconnect.d.ts deleted file mode 100644 index d5de6440..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/api/OnDisconnect.d.ts +++ /dev/null @@ -1,110 +0,0 @@ -/** - * @license - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { Repo } from '../core/Repo'; -import { Path } from '../core/util/Path'; -/** - * The `onDisconnect` class allows you to write or clear data when your client - * disconnects from the Database server. These updates occur whether your - * client disconnects cleanly or not, so you can rely on them to clean up data - * even if a connection is dropped or a client crashes. - * - * The `onDisconnect` class is most commonly used to manage presence in - * applications where it is useful to detect how many clients are connected and - * when other clients disconnect. See - * {@link https://firebase.google.com/docs/database/web/offline-capabilities | Enabling Offline Capabilities in JavaScript} - * for more information. - * - * To avoid problems when a connection is dropped before the requests can be - * transferred to the Database server, these functions should be called before - * writing any data. - * - * Note that `onDisconnect` operations are only triggered once. If you want an - * operation to occur each time a disconnect occurs, you'll need to re-establish - * the `onDisconnect` operations each time you reconnect. - */ -export declare class OnDisconnect { - private _repo; - private _path; - /** @hideconstructor */ - constructor(_repo: Repo, _path: Path); - /** - * Cancels all previously queued `onDisconnect()` set or update events for this - * location and all children. - * - * If a write has been queued for this location via a `set()` or `update()` at a - * parent location, the write at this location will be canceled, though writes - * to sibling locations will still occur. - * - * @returns Resolves when synchronization to the server is complete. - */ - cancel(): Promise; - /** - * Ensures the data at this location is deleted when the client is disconnected - * (due to closing the browser, navigating to a new page, or network issues). - * - * @returns Resolves when synchronization to the server is complete. - */ - remove(): Promise; - /** - * Ensures the data at this location is set to the specified value when the - * client is disconnected (due to closing the browser, navigating to a new page, - * or network issues). - * - * `set()` is especially useful for implementing "presence" systems, where a - * value should be changed or cleared when a user disconnects so that they - * appear "offline" to other users. See - * {@link https://firebase.google.com/docs/database/web/offline-capabilities | Enabling Offline Capabilities in JavaScript} - * for more information. - * - * Note that `onDisconnect` operations are only triggered once. If you want an - * operation to occur each time a disconnect occurs, you'll need to re-establish - * the `onDisconnect` operations each time. - * - * @param value - The value to be written to this location on disconnect (can - * be an object, array, string, number, boolean, or null). - * @returns Resolves when synchronization to the Database is complete. - */ - set(value: unknown): Promise; - /** - * Ensures the data at this location is set to the specified value and priority - * when the client is disconnected (due to closing the browser, navigating to a - * new page, or network issues). - * - * @param value - The value to be written to this location on disconnect (can - * be an object, array, string, number, boolean, or null). - * @param priority - The priority to be written (string, number, or null). - * @returns Resolves when synchronization to the Database is complete. - */ - setWithPriority(value: unknown, priority: number | string | null): Promise; - /** - * Writes multiple values at this location when the client is disconnected (due - * to closing the browser, navigating to a new page, or network issues). - * - * The `values` argument contains multiple property-value pairs that will be - * written to the Database together. Each child property can either be a simple - * property (for example, "name") or a relative path (for example, "name/first") - * from the current location to the data to update. - * - * As opposed to the `set()` method, `update()` can be use to selectively update - * only the referenced properties at the current location (instead of replacing - * all the child properties at the current location). - * - * @param values - Object containing multiple values. - * @returns Resolves when synchronization to the Database is complete. - */ - update(values: object): Promise; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/api/Reference.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/api/Reference.d.ts deleted file mode 100644 index 887c196e..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/api/Reference.d.ts +++ /dev/null @@ -1,122 +0,0 @@ -import { Repo } from '../core/Repo'; -import { Path } from '../core/util/Path'; -import { QueryContext } from '../core/view/EventRegistration'; -/** - * @license - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * A `Query` sorts and filters the data at a Database location so only a subset - * of the child data is included. This can be used to order a collection of - * data by some attribute (for example, height of dinosaurs) as well as to - * restrict a large list of items (for example, chat messages) down to a number - * suitable for synchronizing to the client. Queries are created by chaining - * together one or more of the filter methods defined here. - * - * Just as with a `DatabaseReference`, you can receive data from a `Query` by using the - * `on*()` methods. You will only receive events and `DataSnapshot`s for the - * subset of the data that matches your query. - * - * See {@link https://firebase.google.com/docs/database/web/lists-of-data#sorting_and_filtering_data} - * for more information. - */ -export interface Query extends QueryContext { - /** The `DatabaseReference` for the `Query`'s location. */ - readonly ref: DatabaseReference; - /** - * Returns whether or not the current and provided queries represent the same - * location, have the same query parameters, and are from the same instance of - * `FirebaseApp`. - * - * Two `DatabaseReference` objects are equivalent if they represent the same location - * and are from the same instance of `FirebaseApp`. - * - * Two `Query` objects are equivalent if they represent the same location, - * have the same query parameters, and are from the same instance of - * `FirebaseApp`. Equivalent queries share the same sort order, limits, and - * starting and ending points. - * - * @param other - The query to compare against. - * @returns Whether or not the current and provided queries are equivalent. - */ - isEqual(other: Query | null): boolean; - /** - * Returns a JSON-serializable representation of this object. - * - * @returns A JSON-serializable representation of this object. - */ - toJSON(): string; - /** - * Gets the absolute URL for this location. - * - * The `toString()` method returns a URL that is ready to be put into a - * browser, curl command, or a `refFromURL()` call. Since all of those expect - * the URL to be url-encoded, `toString()` returns an encoded URL. - * - * Append '.json' to the returned URL when typed into a browser to download - * JSON-formatted data. If the location is secured (that is, not publicly - * readable), you will get a permission-denied error. - * - * @returns The absolute URL for this location. - */ - toString(): string; -} -/** - * A `DatabaseReference` represents a specific location in your Database and can be used - * for reading or writing data to that Database location. - * - * You can reference the root or child location in your Database by calling - * `ref()` or `ref("child/path")`. - * - * Writing is done with the `set()` method and reading can be done with the - * `on*()` method. See {@link - * https://firebase.google.com/docs/database/web/read-and-write} - */ -export interface DatabaseReference extends Query { - /** - * The last part of the `DatabaseReference`'s path. - * - * For example, `"ada"` is the key for - * `https://.firebaseio.com/users/ada`. - * - * The key of a root `DatabaseReference` is `null`. - */ - readonly key: string | null; - /** - * The parent location of a `DatabaseReference`. - * - * The parent of a root `DatabaseReference` is `null`. - */ - readonly parent: DatabaseReference | null; - /** The root `DatabaseReference` of the Database. */ - readonly root: DatabaseReference; -} -/** - * A `Promise` that can also act as a `DatabaseReference` when returned by - * {@link push}. The reference is available immediately and the `Promise` resolves - * as the write to the backend completes. - */ -export interface ThenableReference extends DatabaseReference, Pick, 'then' | 'catch'> { -} -/** A callback that can invoked to remove a listener. */ -export declare type Unsubscribe = () => void; -/** An options objects that can be used to customize a listener. */ -export interface ListenOptions { - /** Whether to remove the listener after its first invocation. */ - readonly onlyOnce?: boolean; -} -export interface ReferenceConstructor { - new (repo: Repo, path: Path): DatabaseReference; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/api/Reference_impl.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/api/Reference_impl.d.ts deleted file mode 100644 index c3025883..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/api/Reference_impl.d.ts +++ /dev/null @@ -1,1092 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { Repo } from '../core/Repo'; -import { Index } from '../core/snap/indexes/Index'; -import { Node } from '../core/snap/Node'; -import { Path } from '../core/util/Path'; -import { Change } from '../core/view/Change'; -import { CancelEvent, DataEvent, EventType } from '../core/view/Event'; -import { CallbackContext, EventRegistration, QueryContext } from '../core/view/EventRegistration'; -import { QueryParams } from '../core/view/QueryParams'; -import { Database } from './Database'; -import { OnDisconnect } from './OnDisconnect'; -import { ListenOptions, Query as Query, DatabaseReference, Unsubscribe, ThenableReference } from './Reference'; -/** - * @internal - */ -export declare class QueryImpl implements Query, QueryContext { - readonly _repo: Repo; - readonly _path: Path; - readonly _queryParams: QueryParams; - readonly _orderByCalled: boolean; - /** - * @hideconstructor - */ - constructor(_repo: Repo, _path: Path, _queryParams: QueryParams, _orderByCalled: boolean); - get key(): string | null; - get ref(): DatabaseReference; - get _queryIdentifier(): string; - /** - * An object representation of the query parameters used by this Query. - */ - get _queryObject(): object; - isEqual(other: QueryImpl | null): boolean; - toJSON(): string; - toString(): string; -} -/** - * @internal - */ -export declare class ReferenceImpl extends QueryImpl implements DatabaseReference { - /** @hideconstructor */ - constructor(repo: Repo, path: Path); - get parent(): ReferenceImpl | null; - get root(): ReferenceImpl; -} -/** - * A `DataSnapshot` contains data from a Database location. - * - * Any time you read data from the Database, you receive the data as a - * `DataSnapshot`. A `DataSnapshot` is passed to the event callbacks you attach - * with `on()` or `once()`. You can extract the contents of the snapshot as a - * JavaScript object by calling the `val()` method. Alternatively, you can - * traverse into the snapshot by calling `child()` to return child snapshots - * (which you could then call `val()` on). - * - * A `DataSnapshot` is an efficiently generated, immutable copy of the data at - * a Database location. It cannot be modified and will never change (to modify - * data, you always call the `set()` method on a `Reference` directly). - */ -export declare class DataSnapshot { - readonly _node: Node; - /** - * The location of this DataSnapshot. - */ - readonly ref: DatabaseReference; - readonly _index: Index; - /** - * @param _node - A SnapshotNode to wrap. - * @param ref - The location this snapshot came from. - * @param _index - The iteration order for this snapshot - * @hideconstructor - */ - constructor(_node: Node, - /** - * The location of this DataSnapshot. - */ - ref: DatabaseReference, _index: Index); - /** - * Gets the priority value of the data in this `DataSnapshot`. - * - * Applications need not use priority but can order collections by - * ordinary properties (see - * {@link https://firebase.google.com/docs/database/web/lists-of-data#sorting_and_filtering_data |Sorting and filtering data} - * ). - */ - get priority(): string | number | null; - /** - * The key (last part of the path) of the location of this `DataSnapshot`. - * - * The last token in a Database location is considered its key. For example, - * "ada" is the key for the /users/ada/ node. Accessing the key on any - * `DataSnapshot` will return the key for the location that generated it. - * However, accessing the key on the root URL of a Database will return - * `null`. - */ - get key(): string | null; - /** Returns the number of child properties of this `DataSnapshot`. */ - get size(): number; - /** - * Gets another `DataSnapshot` for the location at the specified relative path. - * - * Passing a relative path to the `child()` method of a DataSnapshot returns - * another `DataSnapshot` for the location at the specified relative path. The - * relative path can either be a simple child name (for example, "ada") or a - * deeper, slash-separated path (for example, "ada/name/first"). If the child - * location has no data, an empty `DataSnapshot` (that is, a `DataSnapshot` - * whose value is `null`) is returned. - * - * @param path - A relative path to the location of child data. - */ - child(path: string): DataSnapshot; - /** - * Returns true if this `DataSnapshot` contains any data. It is slightly more - * efficient than using `snapshot.val() !== null`. - */ - exists(): boolean; - /** - * Exports the entire contents of the DataSnapshot as a JavaScript object. - * - * The `exportVal()` method is similar to `val()`, except priority information - * is included (if available), making it suitable for backing up your data. - * - * @returns The DataSnapshot's contents as a JavaScript value (Object, - * Array, string, number, boolean, or `null`). - */ - exportVal(): any; - /** - * Enumerates the top-level children in the `DataSnapshot`. - * - * Because of the way JavaScript objects work, the ordering of data in the - * JavaScript object returned by `val()` is not guaranteed to match the - * ordering on the server nor the ordering of `onChildAdded()` events. That is - * where `forEach()` comes in handy. It guarantees the children of a - * `DataSnapshot` will be iterated in their query order. - * - * If no explicit `orderBy*()` method is used, results are returned - * ordered by key (unless priorities are used, in which case, results are - * returned by priority). - * - * @param action - A function that will be called for each child DataSnapshot. - * The callback can return true to cancel further enumeration. - * @returns true if enumeration was canceled due to your callback returning - * true. - */ - forEach(action: (child: DataSnapshot) => boolean | void): boolean; - /** - * Returns true if the specified child path has (non-null) data. - * - * @param path - A relative path to the location of a potential child. - * @returns `true` if data exists at the specified child path; else - * `false`. - */ - hasChild(path: string): boolean; - /** - * Returns whether or not the `DataSnapshot` has any non-`null` child - * properties. - * - * You can use `hasChildren()` to determine if a `DataSnapshot` has any - * children. If it does, you can enumerate them using `forEach()`. If it - * doesn't, then either this snapshot contains a primitive value (which can be - * retrieved with `val()`) or it is empty (in which case, `val()` will return - * `null`). - * - * @returns true if this snapshot has any children; else false. - */ - hasChildren(): boolean; - /** - * Returns a JSON-serializable representation of this object. - */ - toJSON(): object | null; - /** - * Extracts a JavaScript value from a `DataSnapshot`. - * - * Depending on the data in a `DataSnapshot`, the `val()` method may return a - * scalar type (string, number, or boolean), an array, or an object. It may - * also return null, indicating that the `DataSnapshot` is empty (contains no - * data). - * - * @returns The DataSnapshot's contents as a JavaScript value (Object, - * Array, string, number, boolean, or `null`). - */ - val(): any; -} -/** - * - * Returns a `Reference` representing the location in the Database - * corresponding to the provided path. If no path is provided, the `Reference` - * will point to the root of the Database. - * - * @param db - The database instance to obtain a reference for. - * @param path - Optional path representing the location the returned - * `Reference` will point. If not provided, the returned `Reference` will - * point to the root of the Database. - * @returns If a path is provided, a `Reference` - * pointing to the provided path. Otherwise, a `Reference` pointing to the - * root of the Database. - */ -export declare function ref(db: Database, path?: string): DatabaseReference; -/** - * Returns a `Reference` representing the location in the Database - * corresponding to the provided Firebase URL. - * - * An exception is thrown if the URL is not a valid Firebase Database URL or it - * has a different domain than the current `Database` instance. - * - * Note that all query parameters (`orderBy`, `limitToLast`, etc.) are ignored - * and are not applied to the returned `Reference`. - * - * @param db - The database instance to obtain a reference for. - * @param url - The Firebase URL at which the returned `Reference` will - * point. - * @returns A `Reference` pointing to the provided - * Firebase URL. - */ -export declare function refFromURL(db: Database, url: string): DatabaseReference; -/** - * Gets a `Reference` for the location at the specified relative path. - * - * The relative path can either be a simple child name (for example, "ada") or - * a deeper slash-separated path (for example, "ada/name/first"). - * - * @param parent - The parent location. - * @param path - A relative path from this location to the desired child - * location. - * @returns The specified child location. - */ -export declare function child(parent: DatabaseReference, path: string): DatabaseReference; -/** - * Returns an `OnDisconnect` object - see - * {@link https://firebase.google.com/docs/database/web/offline-capabilities | Enabling Offline Capabilities in JavaScript} - * for more information on how to use it. - * - * @param ref - The reference to add OnDisconnect triggers for. - */ -export declare function onDisconnect(ref: DatabaseReference): OnDisconnect; -export interface ThenableReferenceImpl extends ReferenceImpl, Pick, 'then' | 'catch'> { -} -/** - * Generates a new child location using a unique key and returns its - * `Reference`. - * - * This is the most common pattern for adding data to a collection of items. - * - * If you provide a value to `push()`, the value is written to the - * generated location. If you don't pass a value, nothing is written to the - * database and the child remains empty (but you can use the `Reference` - * elsewhere). - * - * The unique keys generated by `push()` are ordered by the current time, so the - * resulting list of items is chronologically sorted. The keys are also - * designed to be unguessable (they contain 72 random bits of entropy). - * - * See {@link https://firebase.google.com/docs/database/web/lists-of-data#append_to_a_list_of_data | Append to a list of data}. - * See {@link https://firebase.googleblog.com/2015/02/the-2120-ways-to-ensure-unique_68.html | The 2^120 Ways to Ensure Unique Identifiers}. - * - * @param parent - The parent location. - * @param value - Optional value to be written at the generated location. - * @returns Combined `Promise` and `Reference`; resolves when write is complete, - * but can be used immediately as the `Reference` to the child location. - */ -export declare function push(parent: DatabaseReference, value?: unknown): ThenableReference; -/** - * Removes the data at this Database location. - * - * Any data at child locations will also be deleted. - * - * The effect of the remove will be visible immediately and the corresponding - * event 'value' will be triggered. Synchronization of the remove to the - * Firebase servers will also be started, and the returned Promise will resolve - * when complete. If provided, the onComplete callback will be called - * asynchronously after synchronization has finished. - * - * @param ref - The location to remove. - * @returns Resolves when remove on server is complete. - */ -export declare function remove(ref: DatabaseReference): Promise; -/** - * Writes data to this Database location. - * - * This will overwrite any data at this location and all child locations. - * - * The effect of the write will be visible immediately, and the corresponding - * events ("value", "child_added", etc.) will be triggered. Synchronization of - * the data to the Firebase servers will also be started, and the returned - * Promise will resolve when complete. If provided, the `onComplete` callback - * will be called asynchronously after synchronization has finished. - * - * Passing `null` for the new value is equivalent to calling `remove()`; namely, - * all data at this location and all child locations will be deleted. - * - * `set()` will remove any priority stored at this location, so if priority is - * meant to be preserved, you need to use `setWithPriority()` instead. - * - * Note that modifying data with `set()` will cancel any pending transactions - * at that location, so extreme care should be taken if mixing `set()` and - * `transaction()` to modify the same data. - * - * A single `set()` will generate a single "value" event at the location where - * the `set()` was performed. - * - * @param ref - The location to write to. - * @param value - The value to be written (string, number, boolean, object, - * array, or null). - * @returns Resolves when write to server is complete. - */ -export declare function set(ref: DatabaseReference, value: unknown): Promise; -/** - * Sets a priority for the data at this Database location. - * - * Applications need not use priority but can order collections by - * ordinary properties (see - * {@link https://firebase.google.com/docs/database/web/lists-of-data#sorting_and_filtering_data | Sorting and filtering data} - * ). - * - * @param ref - The location to write to. - * @param priority - The priority to be written (string, number, or null). - * @returns Resolves when write to server is complete. - */ -export declare function setPriority(ref: DatabaseReference, priority: string | number | null): Promise; -/** - * Writes data the Database location. Like `set()` but also specifies the - * priority for that data. - * - * Applications need not use priority but can order collections by - * ordinary properties (see - * {@link https://firebase.google.com/docs/database/web/lists-of-data#sorting_and_filtering_data | Sorting and filtering data} - * ). - * - * @param ref - The location to write to. - * @param value - The value to be written (string, number, boolean, object, - * array, or null). - * @param priority - The priority to be written (string, number, or null). - * @returns Resolves when write to server is complete. - */ -export declare function setWithPriority(ref: DatabaseReference, value: unknown, priority: string | number | null): Promise; -/** - * Writes multiple values to the Database at once. - * - * The `values` argument contains multiple property-value pairs that will be - * written to the Database together. Each child property can either be a simple - * property (for example, "name") or a relative path (for example, - * "name/first") from the current location to the data to update. - * - * As opposed to the `set()` method, `update()` can be use to selectively update - * only the referenced properties at the current location (instead of replacing - * all the child properties at the current location). - * - * The effect of the write will be visible immediately, and the corresponding - * events ('value', 'child_added', etc.) will be triggered. Synchronization of - * the data to the Firebase servers will also be started, and the returned - * Promise will resolve when complete. If provided, the `onComplete` callback - * will be called asynchronously after synchronization has finished. - * - * A single `update()` will generate a single "value" event at the location - * where the `update()` was performed, regardless of how many children were - * modified. - * - * Note that modifying data with `update()` will cancel any pending - * transactions at that location, so extreme care should be taken if mixing - * `update()` and `transaction()` to modify the same data. - * - * Passing `null` to `update()` will remove the data at this location. - * - * See - * {@link https://firebase.googleblog.com/2015/09/introducing-multi-location-updates-and_86.html | Introducing multi-location updates and more}. - * - * @param ref - The location to write to. - * @param values - Object containing multiple values. - * @returns Resolves when update on server is complete. - */ -export declare function update(ref: DatabaseReference, values: object): Promise; -/** - * Gets the most up-to-date result for this query. - * - * @param query - The query to run. - * @returns A `Promise` which resolves to the resulting DataSnapshot if a value is - * available, or rejects if the client is unable to return a value (e.g., if the - * server is unreachable and there is nothing cached). - */ -export declare function get(query: Query): Promise; -/** - * Represents registration for 'value' events. - */ -export declare class ValueEventRegistration implements EventRegistration { - private callbackContext; - constructor(callbackContext: CallbackContext); - respondsTo(eventType: string): boolean; - createEvent(change: Change, query: QueryContext): DataEvent; - getEventRunner(eventData: CancelEvent | DataEvent): () => void; - createCancelEvent(error: Error, path: Path): CancelEvent | null; - matches(other: EventRegistration): boolean; - hasAnyCallback(): boolean; -} -/** - * Represents the registration of a child_x event. - */ -export declare class ChildEventRegistration implements EventRegistration { - private eventType; - private callbackContext; - constructor(eventType: string, callbackContext: CallbackContext | null); - respondsTo(eventType: string): boolean; - createCancelEvent(error: Error, path: Path): CancelEvent | null; - createEvent(change: Change, query: QueryContext): DataEvent; - getEventRunner(eventData: CancelEvent | DataEvent): () => void; - matches(other: EventRegistration): boolean; - hasAnyCallback(): boolean; -} -/** - * Listens for data changes at a particular location. - * - * This is the primary way to read data from a Database. Your callback - * will be triggered for the initial data and again whenever the data changes. - * Invoke the returned unsubscribe callback to stop receiving updates. See - * {@link https://firebase.google.com/docs/database/web/retrieve-data | Retrieve Data on the Web} - * for more details. - * - * An `onValue` event will trigger once with the initial data stored at this - * location, and then trigger again each time the data changes. The - * `DataSnapshot` passed to the callback will be for the location at which - * `on()` was called. It won't trigger until the entire contents has been - * synchronized. If the location has no data, it will be triggered with an empty - * `DataSnapshot` (`val()` will return `null`). - * - * @param query - The query to run. - * @param callback - A callback that fires when the specified event occurs. The - * callback will be passed a DataSnapshot. - * @param cancelCallback - An optional callback that will be notified if your - * event subscription is ever canceled because your client does not have - * permission to read this data (or it had permission but has now lost it). - * This callback will be passed an `Error` object indicating why the failure - * occurred. - * @returns A function that can be invoked to remove the listener. - */ -export declare function onValue(query: Query, callback: (snapshot: DataSnapshot) => unknown, cancelCallback?: (error: Error) => unknown): Unsubscribe; -/** - * Listens for data changes at a particular location. - * - * This is the primary way to read data from a Database. Your callback - * will be triggered for the initial data and again whenever the data changes. - * Invoke the returned unsubscribe callback to stop receiving updates. See - * {@link https://firebase.google.com/docs/database/web/retrieve-data | Retrieve Data on the Web} - * for more details. - * - * An `onValue` event will trigger once with the initial data stored at this - * location, and then trigger again each time the data changes. The - * `DataSnapshot` passed to the callback will be for the location at which - * `on()` was called. It won't trigger until the entire contents has been - * synchronized. If the location has no data, it will be triggered with an empty - * `DataSnapshot` (`val()` will return `null`). - * - * @param query - The query to run. - * @param callback - A callback that fires when the specified event occurs. The - * callback will be passed a DataSnapshot. - * @param options - An object that can be used to configure `onlyOnce`, which - * then removes the listener after its first invocation. - * @returns A function that can be invoked to remove the listener. - */ -export declare function onValue(query: Query, callback: (snapshot: DataSnapshot) => unknown, options: ListenOptions): Unsubscribe; -/** - * Listens for data changes at a particular location. - * - * This is the primary way to read data from a Database. Your callback - * will be triggered for the initial data and again whenever the data changes. - * Invoke the returned unsubscribe callback to stop receiving updates. See - * {@link https://firebase.google.com/docs/database/web/retrieve-data | Retrieve Data on the Web} - * for more details. - * - * An `onValue` event will trigger once with the initial data stored at this - * location, and then trigger again each time the data changes. The - * `DataSnapshot` passed to the callback will be for the location at which - * `on()` was called. It won't trigger until the entire contents has been - * synchronized. If the location has no data, it will be triggered with an empty - * `DataSnapshot` (`val()` will return `null`). - * - * @param query - The query to run. - * @param callback - A callback that fires when the specified event occurs. The - * callback will be passed a DataSnapshot. - * @param cancelCallback - An optional callback that will be notified if your - * event subscription is ever canceled because your client does not have - * permission to read this data (or it had permission but has now lost it). - * This callback will be passed an `Error` object indicating why the failure - * occurred. - * @param options - An object that can be used to configure `onlyOnce`, which - * then removes the listener after its first invocation. - * @returns A function that can be invoked to remove the listener. - */ -export declare function onValue(query: Query, callback: (snapshot: DataSnapshot) => unknown, cancelCallback: (error: Error) => unknown, options: ListenOptions): Unsubscribe; -/** - * Listens for data changes at a particular location. - * - * This is the primary way to read data from a Database. Your callback - * will be triggered for the initial data and again whenever the data changes. - * Invoke the returned unsubscribe callback to stop receiving updates. See - * {@link https://firebase.google.com/docs/database/web/retrieve-data | Retrieve Data on the Web} - * for more details. - * - * An `onChildAdded` event will be triggered once for each initial child at this - * location, and it will be triggered again every time a new child is added. The - * `DataSnapshot` passed into the callback will reflect the data for the - * relevant child. For ordering purposes, it is passed a second argument which - * is a string containing the key of the previous sibling child by sort order, - * or `null` if it is the first child. - * - * @param query - The query to run. - * @param callback - A callback that fires when the specified event occurs. - * The callback will be passed a DataSnapshot and a string containing the key of - * the previous child, by sort order, or `null` if it is the first child. - * @param cancelCallback - An optional callback that will be notified if your - * event subscription is ever canceled because your client does not have - * permission to read this data (or it had permission but has now lost it). - * This callback will be passed an `Error` object indicating why the failure - * occurred. - * @returns A function that can be invoked to remove the listener. - */ -export declare function onChildAdded(query: Query, callback: (snapshot: DataSnapshot, previousChildName?: string | null) => unknown, cancelCallback?: (error: Error) => unknown): Unsubscribe; -/** - * Listens for data changes at a particular location. - * - * This is the primary way to read data from a Database. Your callback - * will be triggered for the initial data and again whenever the data changes. - * Invoke the returned unsubscribe callback to stop receiving updates. See - * {@link https://firebase.google.com/docs/database/web/retrieve-data | Retrieve Data on the Web} - * for more details. - * - * An `onChildAdded` event will be triggered once for each initial child at this - * location, and it will be triggered again every time a new child is added. The - * `DataSnapshot` passed into the callback will reflect the data for the - * relevant child. For ordering purposes, it is passed a second argument which - * is a string containing the key of the previous sibling child by sort order, - * or `null` if it is the first child. - * - * @param query - The query to run. - * @param callback - A callback that fires when the specified event occurs. - * The callback will be passed a DataSnapshot and a string containing the key of - * the previous child, by sort order, or `null` if it is the first child. - * @param options - An object that can be used to configure `onlyOnce`, which - * then removes the listener after its first invocation. - * @returns A function that can be invoked to remove the listener. - */ -export declare function onChildAdded(query: Query, callback: (snapshot: DataSnapshot, previousChildName: string | null) => unknown, options: ListenOptions): Unsubscribe; -/** - * Listens for data changes at a particular location. - * - * This is the primary way to read data from a Database. Your callback - * will be triggered for the initial data and again whenever the data changes. - * Invoke the returned unsubscribe callback to stop receiving updates. See - * {@link https://firebase.google.com/docs/database/web/retrieve-data | Retrieve Data on the Web} - * for more details. - * - * An `onChildAdded` event will be triggered once for each initial child at this - * location, and it will be triggered again every time a new child is added. The - * `DataSnapshot` passed into the callback will reflect the data for the - * relevant child. For ordering purposes, it is passed a second argument which - * is a string containing the key of the previous sibling child by sort order, - * or `null` if it is the first child. - * - * @param query - The query to run. - * @param callback - A callback that fires when the specified event occurs. - * The callback will be passed a DataSnapshot and a string containing the key of - * the previous child, by sort order, or `null` if it is the first child. - * @param cancelCallback - An optional callback that will be notified if your - * event subscription is ever canceled because your client does not have - * permission to read this data (or it had permission but has now lost it). - * This callback will be passed an `Error` object indicating why the failure - * occurred. - * @param options - An object that can be used to configure `onlyOnce`, which - * then removes the listener after its first invocation. - * @returns A function that can be invoked to remove the listener. - */ -export declare function onChildAdded(query: Query, callback: (snapshot: DataSnapshot, previousChildName: string | null) => unknown, cancelCallback: (error: Error) => unknown, options: ListenOptions): Unsubscribe; -/** - * Listens for data changes at a particular location. - * - * This is the primary way to read data from a Database. Your callback - * will be triggered for the initial data and again whenever the data changes. - * Invoke the returned unsubscribe callback to stop receiving updates. See - * {@link https://firebase.google.com/docs/database/web/retrieve-data | Retrieve Data on the Web} - * for more details. - * - * An `onChildChanged` event will be triggered when the data stored in a child - * (or any of its descendants) changes. Note that a single `child_changed` event - * may represent multiple changes to the child. The `DataSnapshot` passed to the - * callback will contain the new child contents. For ordering purposes, the - * callback is also passed a second argument which is a string containing the - * key of the previous sibling child by sort order, or `null` if it is the first - * child. - * - * @param query - The query to run. - * @param callback - A callback that fires when the specified event occurs. - * The callback will be passed a DataSnapshot and a string containing the key of - * the previous child, by sort order, or `null` if it is the first child. - * @param cancelCallback - An optional callback that will be notified if your - * event subscription is ever canceled because your client does not have - * permission to read this data (or it had permission but has now lost it). - * This callback will be passed an `Error` object indicating why the failure - * occurred. - * @returns A function that can be invoked to remove the listener. - */ -export declare function onChildChanged(query: Query, callback: (snapshot: DataSnapshot, previousChildName: string | null) => unknown, cancelCallback?: (error: Error) => unknown): Unsubscribe; -/** - * Listens for data changes at a particular location. - * - * This is the primary way to read data from a Database. Your callback - * will be triggered for the initial data and again whenever the data changes. - * Invoke the returned unsubscribe callback to stop receiving updates. See - * {@link https://firebase.google.com/docs/database/web/retrieve-data | Retrieve Data on the Web} - * for more details. - * - * An `onChildChanged` event will be triggered when the data stored in a child - * (or any of its descendants) changes. Note that a single `child_changed` event - * may represent multiple changes to the child. The `DataSnapshot` passed to the - * callback will contain the new child contents. For ordering purposes, the - * callback is also passed a second argument which is a string containing the - * key of the previous sibling child by sort order, or `null` if it is the first - * child. - * - * @param query - The query to run. - * @param callback - A callback that fires when the specified event occurs. - * The callback will be passed a DataSnapshot and a string containing the key of - * the previous child, by sort order, or `null` if it is the first child. - * @param options - An object that can be used to configure `onlyOnce`, which - * then removes the listener after its first invocation. - * @returns A function that can be invoked to remove the listener. - */ -export declare function onChildChanged(query: Query, callback: (snapshot: DataSnapshot, previousChildName: string | null) => unknown, options: ListenOptions): Unsubscribe; -/** - * Listens for data changes at a particular location. - * - * This is the primary way to read data from a Database. Your callback - * will be triggered for the initial data and again whenever the data changes. - * Invoke the returned unsubscribe callback to stop receiving updates. See - * {@link https://firebase.google.com/docs/database/web/retrieve-data | Retrieve Data on the Web} - * for more details. - * - * An `onChildChanged` event will be triggered when the data stored in a child - * (or any of its descendants) changes. Note that a single `child_changed` event - * may represent multiple changes to the child. The `DataSnapshot` passed to the - * callback will contain the new child contents. For ordering purposes, the - * callback is also passed a second argument which is a string containing the - * key of the previous sibling child by sort order, or `null` if it is the first - * child. - * - * @param query - The query to run. - * @param callback - A callback that fires when the specified event occurs. - * The callback will be passed a DataSnapshot and a string containing the key of - * the previous child, by sort order, or `null` if it is the first child. - * @param cancelCallback - An optional callback that will be notified if your - * event subscription is ever canceled because your client does not have - * permission to read this data (or it had permission but has now lost it). - * This callback will be passed an `Error` object indicating why the failure - * occurred. - * @param options - An object that can be used to configure `onlyOnce`, which - * then removes the listener after its first invocation. - * @returns A function that can be invoked to remove the listener. - */ -export declare function onChildChanged(query: Query, callback: (snapshot: DataSnapshot, previousChildName: string | null) => unknown, cancelCallback: (error: Error) => unknown, options: ListenOptions): Unsubscribe; -/** - * Listens for data changes at a particular location. - * - * This is the primary way to read data from a Database. Your callback - * will be triggered for the initial data and again whenever the data changes. - * Invoke the returned unsubscribe callback to stop receiving updates. See - * {@link https://firebase.google.com/docs/database/web/retrieve-data | Retrieve Data on the Web} - * for more details. - * - * An `onChildMoved` event will be triggered when a child's sort order changes - * such that its position relative to its siblings changes. The `DataSnapshot` - * passed to the callback will be for the data of the child that has moved. It - * is also passed a second argument which is a string containing the key of the - * previous sibling child by sort order, or `null` if it is the first child. - * - * @param query - The query to run. - * @param callback - A callback that fires when the specified event occurs. - * The callback will be passed a DataSnapshot and a string containing the key of - * the previous child, by sort order, or `null` if it is the first child. - * @param cancelCallback - An optional callback that will be notified if your - * event subscription is ever canceled because your client does not have - * permission to read this data (or it had permission but has now lost it). - * This callback will be passed an `Error` object indicating why the failure - * occurred. - * @returns A function that can be invoked to remove the listener. - */ -export declare function onChildMoved(query: Query, callback: (snapshot: DataSnapshot, previousChildName: string | null) => unknown, cancelCallback?: (error: Error) => unknown): Unsubscribe; -/** - * Listens for data changes at a particular location. - * - * This is the primary way to read data from a Database. Your callback - * will be triggered for the initial data and again whenever the data changes. - * Invoke the returned unsubscribe callback to stop receiving updates. See - * {@link https://firebase.google.com/docs/database/web/retrieve-data | Retrieve Data on the Web} - * for more details. - * - * An `onChildMoved` event will be triggered when a child's sort order changes - * such that its position relative to its siblings changes. The `DataSnapshot` - * passed to the callback will be for the data of the child that has moved. It - * is also passed a second argument which is a string containing the key of the - * previous sibling child by sort order, or `null` if it is the first child. - * - * @param query - The query to run. - * @param callback - A callback that fires when the specified event occurs. - * The callback will be passed a DataSnapshot and a string containing the key of - * the previous child, by sort order, or `null` if it is the first child. - * @param options - An object that can be used to configure `onlyOnce`, which - * then removes the listener after its first invocation. - * @returns A function that can be invoked to remove the listener. - */ -export declare function onChildMoved(query: Query, callback: (snapshot: DataSnapshot, previousChildName: string | null) => unknown, options: ListenOptions): Unsubscribe; -/** - * Listens for data changes at a particular location. - * - * This is the primary way to read data from a Database. Your callback - * will be triggered for the initial data and again whenever the data changes. - * Invoke the returned unsubscribe callback to stop receiving updates. See - * {@link https://firebase.google.com/docs/database/web/retrieve-data | Retrieve Data on the Web} - * for more details. - * - * An `onChildMoved` event will be triggered when a child's sort order changes - * such that its position relative to its siblings changes. The `DataSnapshot` - * passed to the callback will be for the data of the child that has moved. It - * is also passed a second argument which is a string containing the key of the - * previous sibling child by sort order, or `null` if it is the first child. - * - * @param query - The query to run. - * @param callback - A callback that fires when the specified event occurs. - * The callback will be passed a DataSnapshot and a string containing the key of - * the previous child, by sort order, or `null` if it is the first child. - * @param cancelCallback - An optional callback that will be notified if your - * event subscription is ever canceled because your client does not have - * permission to read this data (or it had permission but has now lost it). - * This callback will be passed an `Error` object indicating why the failure - * occurred. - * @param options - An object that can be used to configure `onlyOnce`, which - * then removes the listener after its first invocation. - * @returns A function that can be invoked to remove the listener. - */ -export declare function onChildMoved(query: Query, callback: (snapshot: DataSnapshot, previousChildName: string | null) => unknown, cancelCallback: (error: Error) => unknown, options: ListenOptions): Unsubscribe; -/** - * Listens for data changes at a particular location. - * - * This is the primary way to read data from a Database. Your callback - * will be triggered for the initial data and again whenever the data changes. - * Invoke the returned unsubscribe callback to stop receiving updates. See - * {@link https://firebase.google.com/docs/database/web/retrieve-data | Retrieve Data on the Web} - * for more details. - * - * An `onChildRemoved` event will be triggered once every time a child is - * removed. The `DataSnapshot` passed into the callback will be the old data for - * the child that was removed. A child will get removed when either: - * - * - a client explicitly calls `remove()` on that child or one of its ancestors - * - a client calls `set(null)` on that child or one of its ancestors - * - that child has all of its children removed - * - there is a query in effect which now filters out the child (because it's - * sort order changed or the max limit was hit) - * - * @param query - The query to run. - * @param callback - A callback that fires when the specified event occurs. - * The callback will be passed a DataSnapshot and a string containing the key of - * the previous child, by sort order, or `null` if it is the first child. - * @param cancelCallback - An optional callback that will be notified if your - * event subscription is ever canceled because your client does not have - * permission to read this data (or it had permission but has now lost it). - * This callback will be passed an `Error` object indicating why the failure - * occurred. - * @returns A function that can be invoked to remove the listener. - */ -export declare function onChildRemoved(query: Query, callback: (snapshot: DataSnapshot) => unknown, cancelCallback?: (error: Error) => unknown): Unsubscribe; -/** - * Listens for data changes at a particular location. - * - * This is the primary way to read data from a Database. Your callback - * will be triggered for the initial data and again whenever the data changes. - * Invoke the returned unsubscribe callback to stop receiving updates. See - * {@link https://firebase.google.com/docs/database/web/retrieve-data | Retrieve Data on the Web} - * for more details. - * - * An `onChildRemoved` event will be triggered once every time a child is - * removed. The `DataSnapshot` passed into the callback will be the old data for - * the child that was removed. A child will get removed when either: - * - * - a client explicitly calls `remove()` on that child or one of its ancestors - * - a client calls `set(null)` on that child or one of its ancestors - * - that child has all of its children removed - * - there is a query in effect which now filters out the child (because it's - * sort order changed or the max limit was hit) - * - * @param query - The query to run. - * @param callback - A callback that fires when the specified event occurs. - * The callback will be passed a DataSnapshot and a string containing the key of - * the previous child, by sort order, or `null` if it is the first child. - * @param options - An object that can be used to configure `onlyOnce`, which - * then removes the listener after its first invocation. - * @returns A function that can be invoked to remove the listener. - */ -export declare function onChildRemoved(query: Query, callback: (snapshot: DataSnapshot) => unknown, options: ListenOptions): Unsubscribe; -/** - * Listens for data changes at a particular location. - * - * This is the primary way to read data from a Database. Your callback - * will be triggered for the initial data and again whenever the data changes. - * Invoke the returned unsubscribe callback to stop receiving updates. See - * {@link https://firebase.google.com/docs/database/web/retrieve-data | Retrieve Data on the Web} - * for more details. - * - * An `onChildRemoved` event will be triggered once every time a child is - * removed. The `DataSnapshot` passed into the callback will be the old data for - * the child that was removed. A child will get removed when either: - * - * - a client explicitly calls `remove()` on that child or one of its ancestors - * - a client calls `set(null)` on that child or one of its ancestors - * - that child has all of its children removed - * - there is a query in effect which now filters out the child (because it's - * sort order changed or the max limit was hit) - * - * @param query - The query to run. - * @param callback - A callback that fires when the specified event occurs. - * The callback will be passed a DataSnapshot and a string containing the key of - * the previous child, by sort order, or `null` if it is the first child. - * @param cancelCallback - An optional callback that will be notified if your - * event subscription is ever canceled because your client does not have - * permission to read this data (or it had permission but has now lost it). - * This callback will be passed an `Error` object indicating why the failure - * occurred. - * @param options - An object that can be used to configure `onlyOnce`, which - * then removes the listener after its first invocation. - * @returns A function that can be invoked to remove the listener. - */ -export declare function onChildRemoved(query: Query, callback: (snapshot: DataSnapshot) => unknown, cancelCallback: (error: Error) => unknown, options: ListenOptions): Unsubscribe; -export { EventType }; -/** - * Detaches a callback previously attached with the corresponding `on*()` (`onValue`, `onChildAdded`) listener. - * Note: This is not the recommended way to remove a listener. Instead, please use the returned callback function from - * the respective `on*` callbacks. - * - * Detach a callback previously attached with `on*()`. Calling `off()` on a parent listener - * will not automatically remove listeners registered on child nodes, `off()` - * must also be called on any child listeners to remove the callback. - * - * If a callback is not specified, all callbacks for the specified eventType - * will be removed. Similarly, if no eventType is specified, all callbacks - * for the `Reference` will be removed. - * - * Individual listeners can also be removed by invoking their unsubscribe - * callbacks. - * - * @param query - The query that the listener was registered with. - * @param eventType - One of the following strings: "value", "child_added", - * "child_changed", "child_removed", or "child_moved." If omitted, all callbacks - * for the `Reference` will be removed. - * @param callback - The callback function that was passed to `on()` or - * `undefined` to remove all callbacks. - */ -export declare function off(query: Query, eventType?: EventType, callback?: (snapshot: DataSnapshot, previousChildName?: string | null) => unknown): void; -/** Describes the different query constraints available in this SDK. */ -export declare type QueryConstraintType = 'endAt' | 'endBefore' | 'startAt' | 'startAfter' | 'limitToFirst' | 'limitToLast' | 'orderByChild' | 'orderByKey' | 'orderByPriority' | 'orderByValue' | 'equalTo'; -/** - * A `QueryConstraint` is used to narrow the set of documents returned by a - * Database query. `QueryConstraint`s are created by invoking {@link endAt}, - * {@link endBefore}, {@link startAt}, {@link startAfter}, {@link - * limitToFirst}, {@link limitToLast}, {@link orderByChild}, - * {@link orderByChild}, {@link orderByKey} , {@link orderByPriority} , - * {@link orderByValue} or {@link equalTo} and - * can then be passed to {@link query} to create a new query instance that - * also contains this `QueryConstraint`. - */ -export declare abstract class QueryConstraint { - /** The type of this query constraints */ - abstract readonly type: QueryConstraintType; - /** - * Takes the provided `Query` and returns a copy of the `Query` with this - * `QueryConstraint` applied. - */ - abstract _apply(query: QueryImpl): QueryImpl; -} -/** - * Creates a `QueryConstraint` with the specified ending point. - * - * Using `startAt()`, `startAfter()`, `endBefore()`, `endAt()` and `equalTo()` - * allows you to choose arbitrary starting and ending points for your queries. - * - * The ending point is inclusive, so children with exactly the specified value - * will be included in the query. The optional key argument can be used to - * further limit the range of the query. If it is specified, then children that - * have exactly the specified value must also have a key name less than or equal - * to the specified key. - * - * You can read more about `endAt()` in - * {@link https://firebase.google.com/docs/database/web/lists-of-data#filtering_data | Filtering data}. - * - * @param value - The value to end at. The argument type depends on which - * `orderBy*()` function was used in this query. Specify a value that matches - * the `orderBy*()` type. When used in combination with `orderByKey()`, the - * value must be a string. - * @param key - The child key to end at, among the children with the previously - * specified priority. This argument is only allowed if ordering by child, - * value, or priority. - */ -export declare function endAt(value: number | string | boolean | null, key?: string): QueryConstraint; -/** - * Creates a `QueryConstraint` with the specified ending point (exclusive). - * - * Using `startAt()`, `startAfter()`, `endBefore()`, `endAt()` and `equalTo()` - * allows you to choose arbitrary starting and ending points for your queries. - * - * The ending point is exclusive. If only a value is provided, children - * with a value less than the specified value will be included in the query. - * If a key is specified, then children must have a value less than or equal - * to the specified value and a key name less than the specified key. - * - * @param value - The value to end before. The argument type depends on which - * `orderBy*()` function was used in this query. Specify a value that matches - * the `orderBy*()` type. When used in combination with `orderByKey()`, the - * value must be a string. - * @param key - The child key to end before, among the children with the - * previously specified priority. This argument is only allowed if ordering by - * child, value, or priority. - */ -export declare function endBefore(value: number | string | boolean | null, key?: string): QueryConstraint; -/** - * Creates a `QueryConstraint` with the specified starting point. - * - * Using `startAt()`, `startAfter()`, `endBefore()`, `endAt()` and `equalTo()` - * allows you to choose arbitrary starting and ending points for your queries. - * - * The starting point is inclusive, so children with exactly the specified value - * will be included in the query. The optional key argument can be used to - * further limit the range of the query. If it is specified, then children that - * have exactly the specified value must also have a key name greater than or - * equal to the specified key. - * - * You can read more about `startAt()` in - * {@link https://firebase.google.com/docs/database/web/lists-of-data#filtering_data | Filtering data}. - * - * @param value - The value to start at. The argument type depends on which - * `orderBy*()` function was used in this query. Specify a value that matches - * the `orderBy*()` type. When used in combination with `orderByKey()`, the - * value must be a string. - * @param key - The child key to start at. This argument is only allowed if - * ordering by child, value, or priority. - */ -export declare function startAt(value?: number | string | boolean | null, key?: string): QueryConstraint; -/** - * Creates a `QueryConstraint` with the specified starting point (exclusive). - * - * Using `startAt()`, `startAfter()`, `endBefore()`, `endAt()` and `equalTo()` - * allows you to choose arbitrary starting and ending points for your queries. - * - * The starting point is exclusive. If only a value is provided, children - * with a value greater than the specified value will be included in the query. - * If a key is specified, then children must have a value greater than or equal - * to the specified value and a a key name greater than the specified key. - * - * @param value - The value to start after. The argument type depends on which - * `orderBy*()` function was used in this query. Specify a value that matches - * the `orderBy*()` type. When used in combination with `orderByKey()`, the - * value must be a string. - * @param key - The child key to start after. This argument is only allowed if - * ordering by child, value, or priority. - */ -export declare function startAfter(value: number | string | boolean | null, key?: string): QueryConstraint; -/** - * Creates a new `QueryConstraint` that if limited to the first specific number - * of children. - * - * The `limitToFirst()` method is used to set a maximum number of children to be - * synced for a given callback. If we set a limit of 100, we will initially only - * receive up to 100 `child_added` events. If we have fewer than 100 messages - * stored in our Database, a `child_added` event will fire for each message. - * However, if we have over 100 messages, we will only receive a `child_added` - * event for the first 100 ordered messages. As items change, we will receive - * `child_removed` events for each item that drops out of the active list so - * that the total number stays at 100. - * - * You can read more about `limitToFirst()` in - * {@link https://firebase.google.com/docs/database/web/lists-of-data#filtering_data | Filtering data}. - * - * @param limit - The maximum number of nodes to include in this query. - */ -export declare function limitToFirst(limit: number): QueryConstraint; -/** - * Creates a new `QueryConstraint` that is limited to return only the last - * specified number of children. - * - * The `limitToLast()` method is used to set a maximum number of children to be - * synced for a given callback. If we set a limit of 100, we will initially only - * receive up to 100 `child_added` events. If we have fewer than 100 messages - * stored in our Database, a `child_added` event will fire for each message. - * However, if we have over 100 messages, we will only receive a `child_added` - * event for the last 100 ordered messages. As items change, we will receive - * `child_removed` events for each item that drops out of the active list so - * that the total number stays at 100. - * - * You can read more about `limitToLast()` in - * {@link https://firebase.google.com/docs/database/web/lists-of-data#filtering_data | Filtering data}. - * - * @param limit - The maximum number of nodes to include in this query. - */ -export declare function limitToLast(limit: number): QueryConstraint; -/** - * Creates a new `QueryConstraint` that orders by the specified child key. - * - * Queries can only order by one key at a time. Calling `orderByChild()` - * multiple times on the same query is an error. - * - * Firebase queries allow you to order your data by any child key on the fly. - * However, if you know in advance what your indexes will be, you can define - * them via the .indexOn rule in your Security Rules for better performance. See - * the{@link https://firebase.google.com/docs/database/security/indexing-data} - * rule for more information. - * - * You can read more about `orderByChild()` in - * {@link https://firebase.google.com/docs/database/web/lists-of-data#sort_data | Sort data}. - * - * @param path - The path to order by. - */ -export declare function orderByChild(path: string): QueryConstraint; -/** - * Creates a new `QueryConstraint` that orders by the key. - * - * Sorts the results of a query by their (ascending) key values. - * - * You can read more about `orderByKey()` in - * {@link https://firebase.google.com/docs/database/web/lists-of-data#sort_data | Sort data}. - */ -export declare function orderByKey(): QueryConstraint; -/** - * Creates a new `QueryConstraint` that orders by priority. - * - * Applications need not use priority but can order collections by - * ordinary properties (see - * {@link https://firebase.google.com/docs/database/web/lists-of-data#sort_data | Sort data} - * for alternatives to priority. - */ -export declare function orderByPriority(): QueryConstraint; -/** - * Creates a new `QueryConstraint` that orders by value. - * - * If the children of a query are all scalar values (string, number, or - * boolean), you can order the results by their (ascending) values. - * - * You can read more about `orderByValue()` in - * {@link https://firebase.google.com/docs/database/web/lists-of-data#sort_data | Sort data}. - */ -export declare function orderByValue(): QueryConstraint; -/** - * Creates a `QueryConstraint` that includes children that match the specified - * value. - * - * Using `startAt()`, `startAfter()`, `endBefore()`, `endAt()` and `equalTo()` - * allows you to choose arbitrary starting and ending points for your queries. - * - * The optional key argument can be used to further limit the range of the - * query. If it is specified, then children that have exactly the specified - * value must also have exactly the specified key as their key name. This can be - * used to filter result sets with many matches for the same value. - * - * You can read more about `equalTo()` in - * {@link https://firebase.google.com/docs/database/web/lists-of-data#filtering_data | Filtering data}. - * - * @param value - The value to match for. The argument type depends on which - * `orderBy*()` function was used in this query. Specify a value that matches - * the `orderBy*()` type. When used in combination with `orderByKey()`, the - * value must be a string. - * @param key - The child key to start at, among the children with the - * previously specified priority. This argument is only allowed if ordering by - * child, value, or priority. - */ -export declare function equalTo(value: number | string | boolean | null, key?: string): QueryConstraint; -/** - * Creates a new immutable instance of `Query` that is extended to also include - * additional query constraints. - * - * @param query - The Query instance to use as a base for the new constraints. - * @param queryConstraints - The list of `QueryConstraint`s to apply. - * @throws if any of the provided query constraints cannot be combined with the - * existing or new constraints. - */ -export declare function query(query: Query, ...queryConstraints: QueryConstraint[]): Query; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/api/ServerValue.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/api/ServerValue.d.ts deleted file mode 100644 index b222e7e0..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/api/ServerValue.d.ts +++ /dev/null @@ -1,30 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Returns a placeholder value for auto-populating the current timestamp (time - * since the Unix epoch, in milliseconds) as determined by the Firebase - * servers. - */ -export declare function serverTimestamp(): object; -/** - * Returns a placeholder value that can be used to atomically increment the - * current database value by the provided delta. - * - * @param delta - the amount to modify the current value atomically. - * @returns A placeholder value for modifying data atomically server-side. - */ -export declare function increment(delta: number): object; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/api/Transaction.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/api/Transaction.d.ts deleted file mode 100644 index 95ae9797..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/api/Transaction.d.ts +++ /dev/null @@ -1,83 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { DatabaseReference } from './Reference'; -import { DataSnapshot } from './Reference_impl'; -/** An options object to configure transactions. */ -export interface TransactionOptions { - /** - * By default, events are raised each time the transaction update function - * runs. So if it is run multiple times, you may see intermediate states. You - * can set this to false to suppress these intermediate states and instead - * wait until the transaction has completed before events are raised. - */ - readonly applyLocally?: boolean; -} -/** - * A type for the resolve value of {@link runTransaction}. - */ -export declare class TransactionResult { - /** Whether the transaction was successfully committed. */ - readonly committed: boolean; - /** The resulting data snapshot. */ - readonly snapshot: DataSnapshot; - /** @hideconstructor */ - constructor( - /** Whether the transaction was successfully committed. */ - committed: boolean, - /** The resulting data snapshot. */ - snapshot: DataSnapshot); - /** Returns a JSON-serializable representation of this object. */ - toJSON(): object; -} -/** - * Atomically modifies the data at this location. - * - * Atomically modify the data at this location. Unlike a normal `set()`, which - * just overwrites the data regardless of its previous value, `runTransaction()` is - * used to modify the existing value to a new value, ensuring there are no - * conflicts with other clients writing to the same location at the same time. - * - * To accomplish this, you pass `runTransaction()` an update function which is - * used to transform the current value into a new value. If another client - * writes to the location before your new value is successfully written, your - * update function will be called again with the new current value, and the - * write will be retried. This will happen repeatedly until your write succeeds - * without conflict or you abort the transaction by not returning a value from - * your update function. - * - * Note: Modifying data with `set()` will cancel any pending transactions at - * that location, so extreme care should be taken if mixing `set()` and - * `runTransaction()` to update the same data. - * - * Note: When using transactions with Security and Firebase Rules in place, be - * aware that a client needs `.read` access in addition to `.write` access in - * order to perform a transaction. This is because the client-side nature of - * transactions requires the client to read the data in order to transactionally - * update it. - * - * @param ref - The location to atomically modify. - * @param transactionUpdate - A developer-supplied function which will be passed - * the current data stored at this location (as a JavaScript object). The - * function should return the new value it would like written (as a JavaScript - * object). If `undefined` is returned (i.e. you return with no arguments) the - * transaction will be aborted and the data at this location will not be - * modified. - * @param options - An options object to configure transactions. - * @returns A `Promise` that can optionally be used instead of the `onComplete` - * callback to handle success and failure. - */ -export declare function runTransaction(ref: DatabaseReference, transactionUpdate: (currentData: any) => unknown, options?: TransactionOptions): Promise; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/api/test_access.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/api/test_access.d.ts deleted file mode 100644 index 60cecac0..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/api/test_access.d.ts +++ /dev/null @@ -1,31 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { PersistentConnection } from '../core/PersistentConnection'; -import { RepoInfo } from '../core/RepoInfo'; -import { Connection } from '../realtime/Connection'; -export declare const DataConnection: typeof PersistentConnection; -export declare const RealTimeConnection: typeof Connection; -/** - * @internal - */ -export declare const hijackHash: (newHash: () => string) => () => void; -export declare const ConnectionTarget: typeof RepoInfo; -/** - * Forces the RepoManager to create Repos that use ReadonlyRestClient instead of PersistentConnection. - * @internal - */ -export declare const forceRestClient: (forceRestClient: boolean) => void; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/AppCheckTokenProvider.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/AppCheckTokenProvider.d.ts deleted file mode 100644 index 6496ca98..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/AppCheckTokenProvider.d.ts +++ /dev/null @@ -1,30 +0,0 @@ -/** - * @license - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { AppCheckInternalComponentName, AppCheckTokenListener, AppCheckTokenResult } from '@firebase/app-check-interop-types'; -import { Provider } from '@firebase/component'; -/** - * Abstraction around AppCheck's token fetching capabilities. - */ -export declare class AppCheckTokenProvider { - private appName_; - private appCheckProvider?; - private appCheck?; - constructor(appName_: string, appCheckProvider?: Provider); - getToken(forceRefresh?: boolean): Promise; - addTokenChangeListener(listener: AppCheckTokenListener): void; - notifyForInvalidToken(): void; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/AuthTokenProvider.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/AuthTokenProvider.d.ts deleted file mode 100644 index 1c797d91..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/AuthTokenProvider.d.ts +++ /dev/null @@ -1,49 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { FirebaseAuthTokenData } from '@firebase/app-types/private'; -import { FirebaseAuthInternalName } from '@firebase/auth-interop-types'; -import { Provider } from '@firebase/component'; -export interface AuthTokenProvider { - getToken(forceRefresh: boolean): Promise; - addTokenChangeListener(listener: (token: string | null) => void): void; - removeTokenChangeListener(listener: (token: string | null) => void): void; - notifyForInvalidToken(): void; -} -/** - * Abstraction around FirebaseApp's token fetching capabilities. - */ -export declare class FirebaseAuthTokenProvider implements AuthTokenProvider { - private appName_; - private firebaseOptions_; - private authProvider_; - private auth_; - constructor(appName_: string, firebaseOptions_: object, authProvider_: Provider); - getToken(forceRefresh: boolean): Promise; - addTokenChangeListener(listener: (token: string | null) => void): void; - removeTokenChangeListener(listener: (token: string | null) => void): void; - notifyForInvalidToken(): void; -} -export declare class EmulatorTokenProvider implements AuthTokenProvider { - private accessToken; - /** A string that is treated as an admin access token by the RTDB emulator. Used by Admin SDK. */ - static OWNER: string; - constructor(accessToken: string); - getToken(forceRefresh: boolean): Promise; - addTokenChangeListener(listener: (token: string | null) => void): void; - removeTokenChangeListener(listener: (token: string | null) => void): void; - notifyForInvalidToken(): void; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/CompoundWrite.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/CompoundWrite.d.ts deleted file mode 100644 index 40c4926a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/CompoundWrite.d.ts +++ /dev/null @@ -1,81 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { NamedNode, Node } from './snap/Node'; -import { ImmutableTree } from './util/ImmutableTree'; -import { Path } from './util/Path'; -/** - * This class holds a collection of writes that can be applied to nodes in unison. It abstracts away the logic with - * dealing with priority writes and multiple nested writes. At any given path there is only allowed to be one write - * modifying that path. Any write to an existing path or shadowing an existing path will modify that existing write - * to reflect the write added. - */ -export declare class CompoundWrite { - writeTree_: ImmutableTree; - constructor(writeTree_: ImmutableTree); - static empty(): CompoundWrite; -} -export declare function compoundWriteAddWrite(compoundWrite: CompoundWrite, path: Path, node: Node): CompoundWrite; -export declare function compoundWriteAddWrites(compoundWrite: CompoundWrite, path: Path, updates: { - [name: string]: Node; -}): CompoundWrite; -/** - * Will remove a write at the given path and deeper paths. This will not modify a write at a higher - * location, which must be removed by calling this method with that path. - * - * @param compoundWrite - The CompoundWrite to remove. - * @param path - The path at which a write and all deeper writes should be removed - * @returns The new CompoundWrite with the removed path - */ -export declare function compoundWriteRemoveWrite(compoundWrite: CompoundWrite, path: Path): CompoundWrite; -/** - * Returns whether this CompoundWrite will fully overwrite a node at a given location and can therefore be - * considered "complete". - * - * @param compoundWrite - The CompoundWrite to check. - * @param path - The path to check for - * @returns Whether there is a complete write at that path - */ -export declare function compoundWriteHasCompleteWrite(compoundWrite: CompoundWrite, path: Path): boolean; -/** - * Returns a node for a path if and only if the node is a "complete" overwrite at that path. This will not aggregate - * writes from deeper paths, but will return child nodes from a more shallow path. - * - * @param compoundWrite - The CompoundWrite to get the node from. - * @param path - The path to get a complete write - * @returns The node if complete at that path, or null otherwise. - */ -export declare function compoundWriteGetCompleteNode(compoundWrite: CompoundWrite, path: Path): Node | null; -/** - * Returns all children that are guaranteed to be a complete overwrite. - * - * @param compoundWrite - The CompoundWrite to get children from. - * @returns A list of all complete children. - */ -export declare function compoundWriteGetCompleteChildren(compoundWrite: CompoundWrite): NamedNode[]; -export declare function compoundWriteChildCompoundWrite(compoundWrite: CompoundWrite, path: Path): CompoundWrite; -/** - * Returns true if this CompoundWrite is empty and therefore does not modify any nodes. - * @returns Whether this CompoundWrite is empty - */ -export declare function compoundWriteIsEmpty(compoundWrite: CompoundWrite): boolean; -/** - * Applies this CompoundWrite to a node. The node is returned with all writes from this CompoundWrite applied to the - * node - * @param node - The node to apply this CompoundWrite to - * @returns The node with all writes applied - */ -export declare function compoundWriteApply(compoundWrite: CompoundWrite, node: Node): Node; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/PersistentConnection.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/PersistentConnection.d.ts deleted file mode 100644 index afff5985..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/PersistentConnection.d.ts +++ /dev/null @@ -1,135 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { AppCheckTokenProvider } from './AppCheckTokenProvider'; -import { AuthTokenProvider } from './AuthTokenProvider'; -import { RepoInfo } from './RepoInfo'; -import { ServerActions } from './ServerActions'; -import { QueryContext } from './view/EventRegistration'; -/** - * Firebase connection. Abstracts wire protocol and handles reconnecting. - * - * NOTE: All JSON objects sent to the realtime connection must have property names enclosed - * in quotes to make sure the closure compiler does not minify them. - */ -export declare class PersistentConnection extends ServerActions { - private repoInfo_; - private applicationId_; - private onDataUpdate_; - private onConnectStatus_; - private onServerInfoUpdate_; - private authTokenProvider_; - private appCheckTokenProvider_; - private authOverride_?; - id: number; - private log_; - private interruptReasons_; - private readonly listens; - private outstandingPuts_; - private outstandingGets_; - private outstandingPutCount_; - private outstandingGetCount_; - private onDisconnectRequestQueue_; - private connected_; - private reconnectDelay_; - private maxReconnectDelay_; - private securityDebugCallback_; - lastSessionId: string | null; - private establishConnectionTimer_; - private visible_; - private requestCBHash_; - private requestNumber_; - private realtime_; - private authToken_; - private appCheckToken_; - private forceTokenRefresh_; - private invalidAuthTokenCount_; - private invalidAppCheckTokenCount_; - private firstConnection_; - private lastConnectionAttemptTime_; - private lastConnectionEstablishedTime_; - private static nextPersistentConnectionId_; - /** - * Counter for number of connections created. Mainly used for tagging in the logs - */ - private static nextConnectionId_; - /** - * @param repoInfo_ - Data about the namespace we are connecting to - * @param applicationId_ - The Firebase App ID for this project - * @param onDataUpdate_ - A callback for new data from the server - */ - constructor(repoInfo_: RepoInfo, applicationId_: string, onDataUpdate_: (a: string, b: unknown, c: boolean, d: number | null) => void, onConnectStatus_: (a: boolean) => void, onServerInfoUpdate_: (a: unknown) => void, authTokenProvider_: AuthTokenProvider, appCheckTokenProvider_: AppCheckTokenProvider, authOverride_?: object | null); - protected sendRequest(action: string, body: unknown, onResponse?: (a: unknown) => void): void; - get(query: QueryContext): Promise; - listen(query: QueryContext, currentHashFn: () => string, tag: number | null, onComplete: (a: string, b: unknown) => void): void; - private sendGet_; - private sendListen_; - private static warnOnListenWarnings_; - refreshAuthToken(token: string): void; - private reduceReconnectDelayIfAdminCredential_; - refreshAppCheckToken(token: string | null): void; - /** - * Attempts to authenticate with the given credentials. If the authentication attempt fails, it's triggered like - * a auth revoked (the connection is closed). - */ - tryAuth(): void; - /** - * Attempts to authenticate with the given token. If the authentication - * attempt fails, it's triggered like the token was revoked (the connection is - * closed). - */ - tryAppCheck(): void; - /** - * @inheritDoc - */ - unlisten(query: QueryContext, tag: number | null): void; - private sendUnlisten_; - onDisconnectPut(pathString: string, data: unknown, onComplete?: (a: string, b: string) => void): void; - onDisconnectMerge(pathString: string, data: unknown, onComplete?: (a: string, b: string) => void): void; - onDisconnectCancel(pathString: string, onComplete?: (a: string, b: string) => void): void; - private sendOnDisconnect_; - put(pathString: string, data: unknown, onComplete?: (a: string, b: string) => void, hash?: string): void; - merge(pathString: string, data: unknown, onComplete: (a: string, b: string | null) => void, hash?: string): void; - putInternal(action: string, pathString: string, data: unknown, onComplete: (a: string, b: string | null) => void, hash?: string): void; - private sendPut_; - reportStats(stats: { - [k: string]: unknown; - }): void; - private onDataMessage_; - private onDataPush_; - private onReady_; - private scheduleConnect_; - private initConnection_; - private onVisible_; - private onOnline_; - private onRealtimeDisconnect_; - private establishConnection_; - interrupt(reason: string): void; - resume(reason: string): void; - private handleTimestamp_; - private cancelSentTransactions_; - private onListenRevoked_; - private removeListen_; - private onAuthRevoked_; - private onAppCheckRevoked_; - private onSecurityDebugPacket_; - private restoreState_; - /** - * Sends client stats for first connection - */ - private sendConnectStats_; - private shouldReconnect_; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/ReadonlyRestClient.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/ReadonlyRestClient.d.ts deleted file mode 100644 index 87bfe414..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/ReadonlyRestClient.d.ts +++ /dev/null @@ -1,60 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { AppCheckTokenProvider } from './AppCheckTokenProvider'; -import { AuthTokenProvider } from './AuthTokenProvider'; -import { RepoInfo } from './RepoInfo'; -import { ServerActions } from './ServerActions'; -import { QueryContext } from './view/EventRegistration'; -/** - * An implementation of ServerActions that communicates with the server via REST requests. - * This is mostly useful for compatibility with crawlers, where we don't want to spin up a full - * persistent connection (using WebSockets or long-polling) - */ -export declare class ReadonlyRestClient extends ServerActions { - private repoInfo_; - private onDataUpdate_; - private authTokenProvider_; - private appCheckTokenProvider_; - reportStats(stats: { - [k: string]: unknown; - }): void; - /** @private {function(...[*])} */ - private log_; - /** - * We don't actually need to track listens, except to prevent us calling an onComplete for a listen - * that's been removed. :-/ - */ - private listens_; - static getListenId_(query: QueryContext, tag?: number | null): string; - /** - * @param repoInfo_ - Data about the namespace we are connecting to - * @param onDataUpdate_ - A callback for new data from the server - */ - constructor(repoInfo_: RepoInfo, onDataUpdate_: (a: string, b: unknown, c: boolean, d: number | null) => void, authTokenProvider_: AuthTokenProvider, appCheckTokenProvider_: AppCheckTokenProvider); - /** @inheritDoc */ - listen(query: QueryContext, currentHashFn: () => string, tag: number | null, onComplete: (a: string, b: unknown) => void): void; - /** @inheritDoc */ - unlisten(query: QueryContext, tag: number | null): void; - get(query: QueryContext): Promise; - /** @inheritDoc */ - refreshAuthToken(token: string): void; - /** - * Performs a REST request to the given path, with the provided query string parameters, - * and any auth credentials we have. - */ - private restRequest_; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/Repo.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/Repo.d.ts deleted file mode 100644 index deded000..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/Repo.d.ts +++ /dev/null @@ -1,144 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { ValueEventRegistration } from '../api/Reference_impl'; -import { AppCheckTokenProvider } from './AppCheckTokenProvider'; -import { AuthTokenProvider } from './AuthTokenProvider'; -import { PersistentConnection } from './PersistentConnection'; -import { RepoInfo } from './RepoInfo'; -import { ServerActions } from './ServerActions'; -import { Node } from './snap/Node'; -import { SnapshotHolder } from './SnapshotHolder'; -import { SparseSnapshotTree } from './SparseSnapshotTree'; -import { StatsCollection } from './stats/StatsCollection'; -import { StatsListener } from './stats/StatsListener'; -import { StatsReporter } from './stats/StatsReporter'; -import { SyncTree } from './SyncTree'; -import { Indexable } from './util/misc'; -import { Path } from './util/Path'; -import { Tree } from './util/Tree'; -import { EventQueue } from './view/EventQueue'; -import { EventRegistration, QueryContext } from './view/EventRegistration'; -declare const enum TransactionStatus { - RUN = 0, - SENT = 1, - COMPLETED = 2, - SENT_NEEDS_ABORT = 3, - NEEDS_ABORT = 4 -} -interface Transaction { - path: Path; - update: (a: unknown) => unknown; - onComplete: (error: Error | null, committed: boolean, node: Node | null) => void; - status: TransactionStatus; - order: number; - applyLocally: boolean; - retryCount: number; - unwatcher: () => void; - abortReason: string | null; - currentWriteId: number; - currentInputSnapshot: Node | null; - currentOutputSnapshotRaw: Node | null; - currentOutputSnapshotResolved: Node | null; -} -/** - * A connection to a single data repository. - */ -export declare class Repo { - repoInfo_: RepoInfo; - forceRestClient_: boolean; - authTokenProvider_: AuthTokenProvider; - appCheckProvider_: AppCheckTokenProvider; - /** Key for uniquely identifying this repo, used in RepoManager */ - readonly key: string; - dataUpdateCount: number; - infoSyncTree_: SyncTree; - serverSyncTree_: SyncTree; - stats_: StatsCollection; - statsListener_: StatsListener | null; - eventQueue_: EventQueue; - nextWriteId_: number; - server_: ServerActions; - statsReporter_: StatsReporter; - infoData_: SnapshotHolder; - interceptServerDataCallback_: ((a: string, b: unknown) => void) | null; - /** A list of data pieces and paths to be set when this client disconnects. */ - onDisconnect_: SparseSnapshotTree; - /** Stores queues of outstanding transactions for Firebase locations. */ - transactionQueueTree_: Tree; - persistentConnection_: PersistentConnection | null; - constructor(repoInfo_: RepoInfo, forceRestClient_: boolean, authTokenProvider_: AuthTokenProvider, appCheckProvider_: AppCheckTokenProvider); - /** - * @returns The URL corresponding to the root of this Firebase. - */ - toString(): string; -} -export declare function repoStart(repo: Repo, appId: string, authOverride?: object): void; -/** - * @returns The time in milliseconds, taking the server offset into account if we have one. - */ -export declare function repoServerTime(repo: Repo): number; -/** - * Generate ServerValues using some variables from the repo object. - */ -export declare function repoGenerateServerValues(repo: Repo): Indexable; -export declare function repoInterceptServerData(repo: Repo, callback: ((a: string, b: unknown) => unknown) | null): void; -/** - * The purpose of `getValue` is to return the latest known value - * satisfying `query`. - * - * This method will first check for in-memory cached values - * belonging to active listeners. If they are found, such values - * are considered to be the most up-to-date. - * - * If the client is not connected, this method will wait until the - * repo has established a connection and then request the value for `query`. - * If the client is not able to retrieve the query result for another reason, - * it reports an error. - * - * @param query - The query to surface a value for. - */ -export declare function repoGetValue(repo: Repo, query: QueryContext, eventRegistration: ValueEventRegistration): Promise; -export declare function repoSetWithPriority(repo: Repo, path: Path, newVal: unknown, newPriority: number | string | null, onComplete: ((status: Error | null, errorReason?: string) => void) | null): void; -export declare function repoUpdate(repo: Repo, path: Path, childrenToMerge: { - [k: string]: unknown; -}, onComplete: ((status: Error | null, errorReason?: string) => void) | null): void; -export declare function repoOnDisconnectCancel(repo: Repo, path: Path, onComplete: ((status: Error | null, errorReason?: string) => void) | null): void; -export declare function repoOnDisconnectSet(repo: Repo, path: Path, value: unknown, onComplete: ((status: Error | null, errorReason?: string) => void) | null): void; -export declare function repoOnDisconnectSetWithPriority(repo: Repo, path: Path, value: unknown, priority: unknown, onComplete: ((status: Error | null, errorReason?: string) => void) | null): void; -export declare function repoOnDisconnectUpdate(repo: Repo, path: Path, childrenToMerge: { - [k: string]: unknown; -}, onComplete: ((status: Error | null, errorReason?: string) => void) | null): void; -export declare function repoAddEventCallbackForQuery(repo: Repo, query: QueryContext, eventRegistration: EventRegistration): void; -export declare function repoRemoveEventCallbackForQuery(repo: Repo, query: QueryContext, eventRegistration: EventRegistration): void; -export declare function repoInterrupt(repo: Repo): void; -export declare function repoResume(repo: Repo): void; -export declare function repoStats(repo: Repo, showDelta?: boolean): void; -export declare function repoStatsIncrementCounter(repo: Repo, metric: string): void; -export declare function repoCallOnCompleteCallback(repo: Repo, callback: ((status: Error | null, errorReason?: string) => void) | null, status: string, errorReason?: string | null): void; -/** - * Creates a new transaction, adds it to the transactions we're tracking, and - * sends it to the server if possible. - * - * @param path - Path at which to do transaction. - * @param transactionUpdate - Update callback. - * @param onComplete - Completion callback. - * @param unwatcher - Function that will be called when the transaction no longer - * need data updates for `path`. - * @param applyLocally - Whether or not to make intermediate results visible - */ -export declare function repoStartTransaction(repo: Repo, path: Path, transactionUpdate: (a: unknown) => unknown, onComplete: ((error: Error, committed: boolean, node: Node) => void) | null, unwatcher: () => void, applyLocally: boolean): void; -export {}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/RepoInfo.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/RepoInfo.d.ts deleted file mode 100644 index d24201bb..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/RepoInfo.d.ts +++ /dev/null @@ -1,55 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * A class that holds metadata about a Repo object - */ -export declare class RepoInfo { - readonly secure: boolean; - readonly namespace: string; - readonly webSocketOnly: boolean; - readonly nodeAdmin: boolean; - readonly persistenceKey: string; - readonly includeNamespaceInQueryParams: boolean; - private _host; - private _domain; - internalHost: string; - /** - * @param host - Hostname portion of the url for the repo - * @param secure - Whether or not this repo is accessed over ssl - * @param namespace - The namespace represented by the repo - * @param webSocketOnly - Whether to prefer websockets over all other transports (used by Nest). - * @param nodeAdmin - Whether this instance uses Admin SDK credentials - * @param persistenceKey - Override the default session persistence storage key - */ - constructor(host: string, secure: boolean, namespace: string, webSocketOnly: boolean, nodeAdmin?: boolean, persistenceKey?: string, includeNamespaceInQueryParams?: boolean); - isCacheableHost(): boolean; - isCustomHost(): boolean; - get host(): string; - set host(newHost: string); - toString(): string; - toURLString(): string; -} -/** - * Returns the websocket URL for this repo - * @param repoInfo - RepoInfo object - * @param type - of connection - * @param params - list - * @returns The URL for this repo - */ -export declare function repoInfoConnectionURL(repoInfo: RepoInfo, type: string, params: { - [k: string]: string; -}): string; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/ServerActions.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/ServerActions.d.ts deleted file mode 100644 index a1cca073..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/ServerActions.d.ts +++ /dev/null @@ -1,52 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { QueryContext } from './view/EventRegistration'; -/** - * Interface defining the set of actions that can be performed against the Firebase server - * (basically corresponds to our wire protocol). - * - * @interface - */ -export declare abstract class ServerActions { - abstract listen(query: QueryContext, currentHashFn: () => string, tag: number | null, onComplete: (a: string, b: unknown) => void): void; - /** - * Remove a listen. - */ - abstract unlisten(query: QueryContext, tag: number | null): void; - /** - * Get the server value satisfying this query. - */ - abstract get(query: QueryContext): Promise; - put(pathString: string, data: unknown, onComplete?: (a: string, b: string) => void, hash?: string): void; - merge(pathString: string, data: unknown, onComplete: (a: string, b: string | null) => void, hash?: string): void; - /** - * Refreshes the auth token for the current connection. - * @param token - The authentication token - */ - refreshAuthToken(token: string): void; - /** - * Refreshes the app check token for the current connection. - * @param token The app check token - */ - refreshAppCheckToken(token: string): void; - onDisconnectPut(pathString: string, data: unknown, onComplete?: (a: string, b: string) => void): void; - onDisconnectMerge(pathString: string, data: unknown, onComplete?: (a: string, b: string) => void): void; - onDisconnectCancel(pathString: string, onComplete?: (a: string, b: string) => void): void; - reportStats(stats: { - [k: string]: unknown; - }): void; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/SnapshotHolder.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/SnapshotHolder.d.ts deleted file mode 100644 index ec799e2e..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/SnapshotHolder.d.ts +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { Node } from './snap/Node'; -import { Path } from './util/Path'; -/** - * Mutable object which basically just stores a reference to the "latest" immutable snapshot. - */ -export declare class SnapshotHolder { - private rootNode_; - getNode(path: Path): Node; - updateSnapshot(path: Path, newSnapshotNode: Node): void; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/SparseSnapshotTree.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/SparseSnapshotTree.d.ts deleted file mode 100644 index a2a28736..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/SparseSnapshotTree.d.ts +++ /dev/null @@ -1,64 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { Node } from './snap/Node'; -import { Path } from './util/Path'; -/** - * Helper class to store a sparse set of snapshots. - */ -export interface SparseSnapshotTree { - value: Node | null; - readonly children: Map; -} -export declare function newSparseSnapshotTree(): SparseSnapshotTree; -/** - * Gets the node stored at the given path if one exists. - * Only seems to be used in tests. - * - * @param path - Path to look up snapshot for. - * @returns The retrieved node, or null. - */ -export declare function sparseSnapshotTreeFind(sparseSnapshotTree: SparseSnapshotTree, path: Path): Node | null; -/** - * Stores the given node at the specified path. If there is already a node - * at a shallower path, it merges the new data into that snapshot node. - * - * @param path - Path to look up snapshot for. - * @param data - The new data, or null. - */ -export declare function sparseSnapshotTreeRemember(sparseSnapshotTree: SparseSnapshotTree, path: Path, data: Node): void; -/** - * Purge the data at path from the cache. - * - * @param path - Path to look up snapshot for. - * @returns True if this node should now be removed. - */ -export declare function sparseSnapshotTreeForget(sparseSnapshotTree: SparseSnapshotTree, path: Path): boolean; -/** - * Recursively iterates through all of the stored tree and calls the - * callback on each one. - * - * @param prefixPath - Path to look up node for. - * @param func - The function to invoke for each tree. - */ -export declare function sparseSnapshotTreeForEachTree(sparseSnapshotTree: SparseSnapshotTree, prefixPath: Path, func: (a: Path, b: Node) => unknown): void; -/** - * Iterates through each immediate child and triggers the callback. - * Only seems to be used in tests. - * - * @param func - The function to invoke for each child. - */ -export declare function sparseSnapshotTreeForEachChild(sparseSnapshotTree: SparseSnapshotTree, func: (a: string, b: SparseSnapshotTree) => void): void; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/SyncPoint.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/SyncPoint.d.ts deleted file mode 100644 index dc84eabd..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/SyncPoint.d.ts +++ /dev/null @@ -1,91 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { ReferenceConstructor } from '../api/Reference'; -import { Operation } from './operation/Operation'; -import { Node } from './snap/Node'; -import { Path } from './util/Path'; -import { Event } from './view/Event'; -import { EventRegistration, QueryContext } from './view/EventRegistration'; -import { View } from './view/View'; -import { WriteTreeRef } from './WriteTree'; -/** - * SyncPoint represents a single location in a SyncTree with 1 or more event registrations, meaning we need to - * maintain 1 or more Views at this location to cache server data and raise appropriate events for server changes - * and user writes (set, transaction, update). - * - * It's responsible for: - * - Maintaining the set of 1 or more views necessary at this location (a SyncPoint with 0 views should be removed). - * - Proxying user / server operations to the views as appropriate (i.e. applyServerOverwrite, - * applyUserOverwrite, etc.) - */ -export declare class SyncPoint { - /** - * The Views being tracked at this location in the tree, stored as a map where the key is a - * queryId and the value is the View for that query. - * - * NOTE: This list will be quite small (usually 1, but perhaps 2 or 3; any more is an odd use case). - */ - readonly views: Map; -} -export declare function syncPointSetReferenceConstructor(val: ReferenceConstructor): void; -export declare function syncPointIsEmpty(syncPoint: SyncPoint): boolean; -export declare function syncPointApplyOperation(syncPoint: SyncPoint, operation: Operation, writesCache: WriteTreeRef, optCompleteServerCache: Node | null): Event[]; -/** - * Get a view for the specified query. - * - * @param query - The query to return a view for - * @param writesCache - * @param serverCache - * @param serverCacheComplete - * @returns Events to raise. - */ -export declare function syncPointGetView(syncPoint: SyncPoint, query: QueryContext, writesCache: WriteTreeRef, serverCache: Node | null, serverCacheComplete: boolean): View; -/** - * Add an event callback for the specified query. - * - * @param query - * @param eventRegistration - * @param writesCache - * @param serverCache - Complete server cache, if we have it. - * @param serverCacheComplete - * @returns Events to raise. - */ -export declare function syncPointAddEventRegistration(syncPoint: SyncPoint, query: QueryContext, eventRegistration: EventRegistration, writesCache: WriteTreeRef, serverCache: Node | null, serverCacheComplete: boolean): Event[]; -/** - * Remove event callback(s). Return cancelEvents if a cancelError is specified. - * - * If query is the default query, we'll check all views for the specified eventRegistration. - * If eventRegistration is null, we'll remove all callbacks for the specified view(s). - * - * @param eventRegistration - If null, remove all callbacks. - * @param cancelError - If a cancelError is provided, appropriate cancel events will be returned. - * @returns removed queries and any cancel events - */ -export declare function syncPointRemoveEventRegistration(syncPoint: SyncPoint, query: QueryContext, eventRegistration: EventRegistration | null, cancelError?: Error): { - removed: QueryContext[]; - events: Event[]; -}; -export declare function syncPointGetQueryViews(syncPoint: SyncPoint): View[]; -/** - * @param path - The path to the desired complete snapshot - * @returns A complete cache, if it exists - */ -export declare function syncPointGetCompleteServerCache(syncPoint: SyncPoint, path: Path): Node | null; -export declare function syncPointViewForQuery(syncPoint: SyncPoint, query: QueryContext): View | null; -export declare function syncPointViewExistsForQuery(syncPoint: SyncPoint, query: QueryContext): boolean; -export declare function syncPointHasCompleteView(syncPoint: SyncPoint): boolean; -export declare function syncPointGetCompleteView(syncPoint: SyncPoint): View | null; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/SyncTree.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/SyncTree.d.ts deleted file mode 100644 index 301c1ae7..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/SyncTree.d.ts +++ /dev/null @@ -1,166 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { ReferenceConstructor } from '../api/Reference'; -import { Node } from './snap/Node'; -import { SyncPoint } from './SyncPoint'; -import { ImmutableTree } from './util/ImmutableTree'; -import { Path } from './util/Path'; -import { Event } from './view/Event'; -import { EventRegistration, QueryContext } from './view/EventRegistration'; -import { WriteTree } from './WriteTree'; -export declare function syncTreeSetReferenceConstructor(val: ReferenceConstructor): void; -export interface ListenProvider { - startListening(query: QueryContext, tag: number | null, hashFn: () => string, onComplete: (a: string, b?: unknown) => Event[]): Event[]; - stopListening(a: QueryContext, b: number | null): void; -} -export declare function resetSyncTreeTag(): void; -/** - * SyncTree is the central class for managing event callback registration, data caching, views - * (query processing), and event generation. There are typically two SyncTree instances for - * each Repo, one for the normal Firebase data, and one for the .info data. - * - * It has a number of responsibilities, including: - * - Tracking all user event callbacks (registered via addEventRegistration() and removeEventRegistration()). - * - Applying and caching data changes for user set(), transaction(), and update() calls - * (applyUserOverwrite(), applyUserMerge()). - * - Applying and caching data changes for server data changes (applyServerOverwrite(), - * applyServerMerge()). - * - Generating user-facing events for server and user changes (all of the apply* methods - * return the set of events that need to be raised as a result). - * - Maintaining the appropriate set of server listens to ensure we are always subscribed - * to the correct set of paths and queries to satisfy the current set of user event - * callbacks (listens are started/stopped using the provided listenProvider). - * - * NOTE: Although SyncTree tracks event callbacks and calculates events to raise, the actual - * events are returned to the caller rather than raised synchronously. - * - */ -export declare class SyncTree { - listenProvider_: ListenProvider; - /** - * Tree of SyncPoints. There's a SyncPoint at any location that has 1 or more views. - */ - syncPointTree_: ImmutableTree; - /** - * A tree of all pending user writes (user-initiated set()'s, transaction()'s, update()'s, etc.). - */ - pendingWriteTree_: WriteTree; - readonly tagToQueryMap: Map; - readonly queryToTagMap: Map; - /** - * @param listenProvider_ - Used by SyncTree to start / stop listening - * to server data. - */ - constructor(listenProvider_: ListenProvider); -} -/** - * Apply the data changes for a user-generated set() or transaction() call. - * - * @returns Events to raise. - */ -export declare function syncTreeApplyUserOverwrite(syncTree: SyncTree, path: Path, newData: Node, writeId: number, visible?: boolean): Event[]; -/** - * Apply the data from a user-generated update() call - * - * @returns Events to raise. - */ -export declare function syncTreeApplyUserMerge(syncTree: SyncTree, path: Path, changedChildren: { - [k: string]: Node; -}, writeId: number): Event[]; -/** - * Acknowledge a pending user write that was previously registered with applyUserOverwrite() or applyUserMerge(). - * - * @param revert - True if the given write failed and needs to be reverted - * @returns Events to raise. - */ -export declare function syncTreeAckUserWrite(syncTree: SyncTree, writeId: number, revert?: boolean): Event[]; -/** - * Apply new server data for the specified path.. - * - * @returns Events to raise. - */ -export declare function syncTreeApplyServerOverwrite(syncTree: SyncTree, path: Path, newData: Node): Event[]; -/** - * Apply new server data to be merged in at the specified path. - * - * @returns Events to raise. - */ -export declare function syncTreeApplyServerMerge(syncTree: SyncTree, path: Path, changedChildren: { - [k: string]: Node; -}): Event[]; -/** - * Apply a listen complete for a query - * - * @returns Events to raise. - */ -export declare function syncTreeApplyListenComplete(syncTree: SyncTree, path: Path): Event[]; -/** - * Apply a listen complete for a tagged query - * - * @returns Events to raise. - */ -export declare function syncTreeApplyTaggedListenComplete(syncTree: SyncTree, path: Path, tag: number): Event[]; -/** - * Remove event callback(s). - * - * If query is the default query, we'll check all queries for the specified eventRegistration. - * If eventRegistration is null, we'll remove all callbacks for the specified query/queries. - * - * @param eventRegistration - If null, all callbacks are removed. - * @param cancelError - If a cancelError is provided, appropriate cancel events will be returned. - * @param skipListenerDedup - When performing a `get()`, we don't add any new listeners, so no - * deduping needs to take place. This flag allows toggling of that behavior - * @returns Cancel events, if cancelError was provided. - */ -export declare function syncTreeRemoveEventRegistration(syncTree: SyncTree, query: QueryContext, eventRegistration: EventRegistration | null, cancelError?: Error, skipListenerDedup?: boolean): Event[]; -/** - * Apply new server data for the specified tagged query. - * - * @returns Events to raise. - */ -export declare function syncTreeApplyTaggedQueryOverwrite(syncTree: SyncTree, path: Path, snap: Node, tag: number): Event[]; -/** - * Apply server data to be merged in for the specified tagged query. - * - * @returns Events to raise. - */ -export declare function syncTreeApplyTaggedQueryMerge(syncTree: SyncTree, path: Path, changedChildren: { - [k: string]: Node; -}, tag: number): Event[]; -/** - * Add an event callback for the specified query. - * - * @returns Events to raise. - */ -export declare function syncTreeAddEventRegistration(syncTree: SyncTree, query: QueryContext, eventRegistration: EventRegistration, skipSetupListener?: boolean): Event[]; -/** - * Returns a complete cache, if we have one, of the data at a particular path. If the location does not have a - * listener above it, we will get a false "null". This shouldn't be a problem because transactions will always - * have a listener above, and atomic operations would correctly show a jitter of -> - * as the write is applied locally and then acknowledged at the server. - * - * Note: this method will *include* hidden writes from transaction with applyLocally set to false. - * - * @param path - The path to the data we want - * @param writeIdsToExclude - A specific set to be excluded - */ -export declare function syncTreeCalcCompleteEventCache(syncTree: SyncTree, path: Path, writeIdsToExclude?: number[]): Node; -export declare function syncTreeGetServerValue(syncTree: SyncTree, query: QueryContext): Node | null; -/** - * Return the tag associated with the given query. - */ -export declare function syncTreeTagForQuery(syncTree: SyncTree, query: QueryContext): number | null; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/WriteTree.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/WriteTree.d.ts deleted file mode 100644 index ef9059e2..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/WriteTree.d.ts +++ /dev/null @@ -1,205 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { CompoundWrite } from './CompoundWrite'; -import { ChildrenNode } from './snap/ChildrenNode'; -import { Index } from './snap/indexes/Index'; -import { NamedNode, Node } from './snap/Node'; -import { Path } from './util/Path'; -import { CacheNode } from './view/CacheNode'; -/** - * Defines a single user-initiated write operation. May be the result of a set(), transaction(), or update() call. In - * the case of a set() or transaction, snap wil be non-null. In the case of an update(), children will be non-null. - */ -export interface WriteRecord { - writeId: number; - path: Path; - snap?: Node | null; - children?: { - [k: string]: Node; - } | null; - visible: boolean; -} -/** - * Create a new WriteTreeRef for the given path. For use with a new sync point at the given path. - * - */ -export declare function writeTreeChildWrites(writeTree: WriteTree, path: Path): WriteTreeRef; -/** - * Record a new overwrite from user code. - * - * @param visible - This is set to false by some transactions. It should be excluded from event caches - */ -export declare function writeTreeAddOverwrite(writeTree: WriteTree, path: Path, snap: Node, writeId: number, visible?: boolean): void; -/** - * Record a new merge from user code. - */ -export declare function writeTreeAddMerge(writeTree: WriteTree, path: Path, changedChildren: { - [k: string]: Node; -}, writeId: number): void; -export declare function writeTreeGetWrite(writeTree: WriteTree, writeId: number): WriteRecord | null; -/** - * Remove a write (either an overwrite or merge) that has been successfully acknowledge by the server. Recalculates - * the tree if necessary. We return true if it may have been visible, meaning views need to reevaluate. - * - * @returns true if the write may have been visible (meaning we'll need to reevaluate / raise - * events as a result). - */ -export declare function writeTreeRemoveWrite(writeTree: WriteTree, writeId: number): boolean; -/** - * Return a complete snapshot for the given path if there's visible write data at that path, else null. - * No server data is considered. - * - */ -export declare function writeTreeGetCompleteWriteData(writeTree: WriteTree, path: Path): Node | null; -/** - * Given optional, underlying server data, and an optional set of constraints (exclude some sets, include hidden - * writes), attempt to calculate a complete snapshot for the given path - * - * @param writeIdsToExclude - An optional set to be excluded - * @param includeHiddenWrites - Defaults to false, whether or not to layer on writes with visible set to false - */ -export declare function writeTreeCalcCompleteEventCache(writeTree: WriteTree, treePath: Path, completeServerCache: Node | null, writeIdsToExclude?: number[], includeHiddenWrites?: boolean): Node | null; -/** - * With optional, underlying server data, attempt to return a children node of children that we have complete data for. - * Used when creating new views, to pre-fill their complete event children snapshot. - */ -export declare function writeTreeCalcCompleteEventChildren(writeTree: WriteTree, treePath: Path, completeServerChildren: ChildrenNode | null): Node; -/** - * Given that the underlying server data has updated, determine what, if anything, needs to be - * applied to the event cache. - * - * Possibilities: - * - * 1. No writes are shadowing. Events should be raised, the snap to be applied comes from the server data - * - * 2. Some write is completely shadowing. No events to be raised - * - * 3. Is partially shadowed. Events - * - * Either existingEventSnap or existingServerSnap must exist - */ -export declare function writeTreeCalcEventCacheAfterServerOverwrite(writeTree: WriteTree, treePath: Path, childPath: Path, existingEventSnap: Node | null, existingServerSnap: Node | null): Node | null; -/** - * Returns a complete child for a given server snap after applying all user writes or null if there is no - * complete child for this ChildKey. - */ -export declare function writeTreeCalcCompleteChild(writeTree: WriteTree, treePath: Path, childKey: string, existingServerSnap: CacheNode): Node | null; -/** - * Returns a node if there is a complete overwrite for this path. More specifically, if there is a write at - * a higher path, this will return the child of that write relative to the write and this path. - * Returns null if there is no write at this path. - */ -export declare function writeTreeShadowingWrite(writeTree: WriteTree, path: Path): Node | null; -/** - * This method is used when processing child remove events on a query. If we can, we pull in children that were outside - * the window, but may now be in the window. - */ -export declare function writeTreeCalcIndexedSlice(writeTree: WriteTree, treePath: Path, completeServerData: Node | null, startPost: NamedNode, count: number, reverse: boolean, index: Index): NamedNode[]; -export declare function newWriteTree(): WriteTree; -/** - * WriteTree tracks all pending user-initiated writes and has methods to calculate the result of merging them - * with underlying server data (to create "event cache" data). Pending writes are added with addOverwrite() - * and addMerge(), and removed with removeWrite(). - */ -export interface WriteTree { - /** - * A tree tracking the result of applying all visible writes. This does not include transactions with - * applyLocally=false or writes that are completely shadowed by other writes. - */ - visibleWrites: CompoundWrite; - /** - * A list of all pending writes, regardless of visibility and shadowed-ness. Used to calculate arbitrary - * sets of the changed data, such as hidden writes (from transactions) or changes with certain writes excluded (also - * used by transactions). - */ - allWrites: WriteRecord[]; - lastWriteId: number; -} -/** - * If possible, returns a complete event cache, using the underlying server data if possible. In addition, can be used - * to get a cache that includes hidden writes, and excludes arbitrary writes. Note that customizing the returned node - * can lead to a more expensive calculation. - * - * @param writeIdsToExclude - Optional writes to exclude. - * @param includeHiddenWrites - Defaults to false, whether or not to layer on writes with visible set to false - */ -export declare function writeTreeRefCalcCompleteEventCache(writeTreeRef: WriteTreeRef, completeServerCache: Node | null, writeIdsToExclude?: number[], includeHiddenWrites?: boolean): Node | null; -/** - * If possible, returns a children node containing all of the complete children we have data for. The returned data is a - * mix of the given server data and write data. - * - */ -export declare function writeTreeRefCalcCompleteEventChildren(writeTreeRef: WriteTreeRef, completeServerChildren: ChildrenNode | null): ChildrenNode; -/** - * Given that either the underlying server data has updated or the outstanding writes have updated, determine what, - * if anything, needs to be applied to the event cache. - * - * Possibilities: - * - * 1. No writes are shadowing. Events should be raised, the snap to be applied comes from the server data - * - * 2. Some write is completely shadowing. No events to be raised - * - * 3. Is partially shadowed. Events should be raised - * - * Either existingEventSnap or existingServerSnap must exist, this is validated via an assert - * - * - */ -export declare function writeTreeRefCalcEventCacheAfterServerOverwrite(writeTreeRef: WriteTreeRef, path: Path, existingEventSnap: Node | null, existingServerSnap: Node | null): Node | null; -/** - * Returns a node if there is a complete overwrite for this path. More specifically, if there is a write at - * a higher path, this will return the child of that write relative to the write and this path. - * Returns null if there is no write at this path. - * - */ -export declare function writeTreeRefShadowingWrite(writeTreeRef: WriteTreeRef, path: Path): Node | null; -/** - * This method is used when processing child remove events on a query. If we can, we pull in children that were outside - * the window, but may now be in the window - */ -export declare function writeTreeRefCalcIndexedSlice(writeTreeRef: WriteTreeRef, completeServerData: Node | null, startPost: NamedNode, count: number, reverse: boolean, index: Index): NamedNode[]; -/** - * Returns a complete child for a given server snap after applying all user writes or null if there is no - * complete child for this ChildKey. - */ -export declare function writeTreeRefCalcCompleteChild(writeTreeRef: WriteTreeRef, childKey: string, existingServerCache: CacheNode): Node | null; -/** - * Return a WriteTreeRef for a child. - */ -export declare function writeTreeRefChild(writeTreeRef: WriteTreeRef, childName: string): WriteTreeRef; -export declare function newWriteTreeRef(path: Path, writeTree: WriteTree): WriteTreeRef; -/** - * A WriteTreeRef wraps a WriteTree and a path, for convenient access to a particular subtree. All of the methods - * just proxy to the underlying WriteTree. - * - */ -export interface WriteTreeRef { - /** - * The path to this particular write tree ref. Used for calling methods on writeTree_ while exposing a simpler - * interface to callers. - */ - readonly treePath: Path; - /** - * * A reference to the actual tree of write data. All methods are pass-through to the tree, but with the appropriate - * path prefixed. - * - * This lets us make cheap references to points in the tree for sync points without having to copy and maintain all of - * the data. - */ - readonly writeTree: WriteTree; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/operation/AckUserWrite.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/operation/AckUserWrite.d.ts deleted file mode 100644 index 66337cf9..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/operation/AckUserWrite.d.ts +++ /dev/null @@ -1,36 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { ImmutableTree } from '../util/ImmutableTree'; -import { Path } from '../util/Path'; -import { Operation, OperationType } from './Operation'; -export declare class AckUserWrite implements Operation { - /** @inheritDoc */ path: Path; - /** @inheritDoc */ affectedTree: ImmutableTree; - /** @inheritDoc */ revert: boolean; - /** @inheritDoc */ - type: OperationType; - /** @inheritDoc */ - source: import("./Operation").OperationSource; - /** - * @param affectedTree - A tree containing true for each affected path. Affected paths can't overlap. - */ - constructor( - /** @inheritDoc */ path: Path, - /** @inheritDoc */ affectedTree: ImmutableTree, - /** @inheritDoc */ revert: boolean); - operationForChild(childName: string): AckUserWrite; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/operation/ListenComplete.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/operation/ListenComplete.d.ts deleted file mode 100644 index 77e42506..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/operation/ListenComplete.d.ts +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { Path } from '../util/Path'; -import { Operation, OperationSource, OperationType } from './Operation'; -export declare class ListenComplete implements Operation { - source: OperationSource; - path: Path; - /** @inheritDoc */ - type: OperationType; - constructor(source: OperationSource, path: Path); - operationForChild(childName: string): ListenComplete; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/operation/Merge.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/operation/Merge.d.ts deleted file mode 100644 index 440a9111..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/operation/Merge.d.ts +++ /dev/null @@ -1,33 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { Node } from '../snap/Node'; -import { ImmutableTree } from '../util/ImmutableTree'; -import { Path } from '../util/Path'; -import { Operation, OperationSource, OperationType } from './Operation'; -export declare class Merge implements Operation { - /** @inheritDoc */ source: OperationSource; - /** @inheritDoc */ path: Path; - /** @inheritDoc */ children: ImmutableTree; - /** @inheritDoc */ - type: OperationType; - constructor( - /** @inheritDoc */ source: OperationSource, - /** @inheritDoc */ path: Path, - /** @inheritDoc */ children: ImmutableTree); - operationForChild(childName: string): Operation; - toString(): string; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/operation/Operation.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/operation/Operation.d.ts deleted file mode 100644 index fa624bcb..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/operation/Operation.d.ts +++ /dev/null @@ -1,45 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { Path } from '../util/Path'; -/** - * - * @enum - */ -export declare enum OperationType { - OVERWRITE = 0, - MERGE = 1, - ACK_USER_WRITE = 2, - LISTEN_COMPLETE = 3 -} -/** - * @interface - */ -export interface Operation { - source: OperationSource; - type: OperationType; - path: Path; - operationForChild(childName: string): Operation | null; -} -export interface OperationSource { - fromUser: boolean; - fromServer: boolean; - queryId: string | null; - tagged: boolean; -} -export declare function newOperationSourceUser(): OperationSource; -export declare function newOperationSourceServer(): OperationSource; -export declare function newOperationSourceServerTaggedQuery(queryId: string): OperationSource; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/operation/Overwrite.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/operation/Overwrite.d.ts deleted file mode 100644 index c5a15ebe..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/operation/Overwrite.d.ts +++ /dev/null @@ -1,28 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { Node } from '../snap/Node'; -import { Path } from '../util/Path'; -import { Operation, OperationSource, OperationType } from './Operation'; -export declare class Overwrite implements Operation { - source: OperationSource; - path: Path; - snap: Node; - /** @inheritDoc */ - type: OperationType; - constructor(source: OperationSource, path: Path, snap: Node); - operationForChild(childName: string): Overwrite; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/snap/ChildrenNode.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/snap/ChildrenNode.d.ts deleted file mode 100644 index b0ac8e05..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/snap/ChildrenNode.d.ts +++ /dev/null @@ -1,112 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { Path } from '../util/Path'; -import { SortedMap, SortedMapIterator } from '../util/SortedMap'; -import { Index } from './indexes/Index'; -import { IndexMap } from './IndexMap'; -import { NamedNode, Node } from './Node'; -export interface ChildrenNodeConstructor { - new (children_: SortedMap, priorityNode_: Node | null, indexMap_: IndexMap): ChildrenNode; - EMPTY_NODE: ChildrenNode; -} -/** - * ChildrenNode is a class for storing internal nodes in a DataSnapshot - * (i.e. nodes with children). It implements Node and stores the - * list of children in the children property, sorted by child name. - */ -export declare class ChildrenNode implements Node { - private readonly children_; - private readonly priorityNode_; - private indexMap_; - private lazyHash_; - static get EMPTY_NODE(): ChildrenNode; - /** - * @param children_ - List of children of this node.. - * @param priorityNode_ - The priority of this node (as a snapshot node). - */ - constructor(children_: SortedMap, priorityNode_: Node | null, indexMap_: IndexMap); - /** @inheritDoc */ - isLeafNode(): boolean; - /** @inheritDoc */ - getPriority(): Node; - /** @inheritDoc */ - updatePriority(newPriorityNode: Node): Node; - /** @inheritDoc */ - getImmediateChild(childName: string): Node; - /** @inheritDoc */ - getChild(path: Path): Node; - /** @inheritDoc */ - hasChild(childName: string): boolean; - /** @inheritDoc */ - updateImmediateChild(childName: string, newChildNode: Node): Node; - /** @inheritDoc */ - updateChild(path: Path, newChildNode: Node): Node; - /** @inheritDoc */ - isEmpty(): boolean; - /** @inheritDoc */ - numChildren(): number; - private static INTEGER_REGEXP_; - /** @inheritDoc */ - val(exportFormat?: boolean): object; - /** @inheritDoc */ - hash(): string; - /** @inheritDoc */ - getPredecessorChildName(childName: string, childNode: Node, index: Index): string; - getFirstChildName(indexDefinition: Index): string | null; - getFirstChild(indexDefinition: Index): NamedNode | null; - /** - * Given an index, return the key name of the largest value we have, according to that index - */ - getLastChildName(indexDefinition: Index): string | null; - getLastChild(indexDefinition: Index): NamedNode | null; - forEachChild(index: Index, action: (key: string, node: Node) => boolean | void): boolean; - getIterator(indexDefinition: Index): SortedMapIterator; - getIteratorFrom(startPost: NamedNode, indexDefinition: Index): SortedMapIterator; - getReverseIterator(indexDefinition: Index): SortedMapIterator; - getReverseIteratorFrom(endPost: NamedNode, indexDefinition: Index): SortedMapIterator; - compareTo(other: ChildrenNode): number; - withIndex(indexDefinition: Index): Node; - isIndexed(index: Index): boolean; - equals(other: Node): boolean; - /** - * Returns a SortedMap ordered by index, or null if the default (by-key) ordering can be used - * instead. - * - */ - private resolveIndex_; -} -export declare class MaxNode extends ChildrenNode { - constructor(); - compareTo(other: Node): number; - equals(other: Node): boolean; - getPriority(): MaxNode; - getImmediateChild(childName: string): ChildrenNode; - isEmpty(): boolean; -} -/** - * Marker that will sort higher than any other snapshot. - */ -export declare const MAX_NODE: MaxNode; -/** - * Document NamedNode extensions - */ -declare module './Node' { - interface NamedNode { - MIN: NamedNode; - MAX: NamedNode; - } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/snap/IndexMap.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/snap/IndexMap.d.ts deleted file mode 100644 index 3ac5f0e9..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/snap/IndexMap.d.ts +++ /dev/null @@ -1,43 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { SortedMap } from '../util/SortedMap'; -import { Index } from './indexes/Index'; -import { NamedNode, Node } from './Node'; -export declare class IndexMap { - private indexes_; - private indexSet_; - /** - * The default IndexMap for nodes without a priority - */ - static get Default(): IndexMap; - constructor(indexes_: { - [k: string]: SortedMap | /*FallbackType*/ object; - }, indexSet_: { - [k: string]: Index; - }); - get(indexKey: string): SortedMap | null; - hasIndex(indexDefinition: Index): boolean; - addIndex(indexDefinition: Index, existingChildren: SortedMap): IndexMap; - /** - * Ensure that this node is properly tracked in any indexes that we're maintaining - */ - addToIndexes(namedNode: NamedNode, existingChildren: SortedMap): IndexMap; - /** - * Create a new IndexMap instance with the given value removed - */ - removeFromIndexes(namedNode: NamedNode, existingChildren: SortedMap): IndexMap; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/snap/LeafNode.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/snap/LeafNode.d.ts deleted file mode 100644 index c48cda6e..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/snap/LeafNode.d.ts +++ /dev/null @@ -1,83 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { Indexable } from '../util/misc'; -import { Path } from '../util/Path'; -import { ChildrenNodeConstructor } from './ChildrenNode'; -import { Index } from './indexes/Index'; -import { Node } from './Node'; -/** - * LeafNode is a class for storing leaf nodes in a DataSnapshot. It - * implements Node and stores the value of the node (a string, - * number, or boolean) accessible via getValue(). - */ -export declare class LeafNode implements Node { - private readonly value_; - private priorityNode_; - static set __childrenNodeConstructor(val: ChildrenNodeConstructor); - static get __childrenNodeConstructor(): ChildrenNodeConstructor; - /** - * The sort order for comparing leaf nodes of different types. If two leaf nodes have - * the same type, the comparison falls back to their value - */ - static VALUE_TYPE_ORDER: string[]; - private lazyHash_; - /** - * @param value_ - The value to store in this leaf node. The object type is - * possible in the event of a deferred value - * @param priorityNode_ - The priority of this node. - */ - constructor(value_: string | number | boolean | Indexable, priorityNode_?: Node); - /** @inheritDoc */ - isLeafNode(): boolean; - /** @inheritDoc */ - getPriority(): Node; - /** @inheritDoc */ - updatePriority(newPriorityNode: Node): Node; - /** @inheritDoc */ - getImmediateChild(childName: string): Node; - /** @inheritDoc */ - getChild(path: Path): Node; - hasChild(): boolean; - /** @inheritDoc */ - getPredecessorChildName(childName: string, childNode: Node): null; - /** @inheritDoc */ - updateImmediateChild(childName: string, newChildNode: Node): Node; - /** @inheritDoc */ - updateChild(path: Path, newChildNode: Node): Node; - /** @inheritDoc */ - isEmpty(): boolean; - /** @inheritDoc */ - numChildren(): number; - /** @inheritDoc */ - forEachChild(index: Index, action: (s: string, n: Node) => void): boolean; - val(exportFormat?: boolean): {}; - /** @inheritDoc */ - hash(): string; - /** - * Returns the value of the leaf node. - * @returns The value of the node. - */ - getValue(): Indexable | string | number | boolean; - compareTo(other: Node): number; - /** - * Comparison specifically for two leaf nodes - */ - private compareToLeafNode_; - withIndex(): Node; - isIndexed(): boolean; - equals(other: Node): boolean; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/snap/Node.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/snap/Node.d.ts deleted file mode 100644 index 8249916b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/snap/Node.d.ts +++ /dev/null @@ -1,126 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { Path } from '../util/Path'; -import { Index } from './indexes/Index'; -/** - * Node is an interface defining the common functionality for nodes in - * a DataSnapshot. - * - * @interface - */ -export interface Node { - /** - * Whether this node is a leaf node. - * @returns Whether this is a leaf node. - */ - isLeafNode(): boolean; - /** - * Gets the priority of the node. - * @returns The priority of the node. - */ - getPriority(): Node; - /** - * Returns a duplicate node with the new priority. - * @param newPriorityNode - New priority to set for the node. - * @returns Node with new priority. - */ - updatePriority(newPriorityNode: Node): Node; - /** - * Returns the specified immediate child, or null if it doesn't exist. - * @param childName - The name of the child to retrieve. - * @returns The retrieved child, or an empty node. - */ - getImmediateChild(childName: string): Node; - /** - * Returns a child by path, or null if it doesn't exist. - * @param path - The path of the child to retrieve. - * @returns The retrieved child or an empty node. - */ - getChild(path: Path): Node; - /** - * Returns the name of the child immediately prior to the specified childNode, or null. - * @param childName - The name of the child to find the predecessor of. - * @param childNode - The node to find the predecessor of. - * @param index - The index to use to determine the predecessor - * @returns The name of the predecessor child, or null if childNode is the first child. - */ - getPredecessorChildName(childName: string, childNode: Node, index: Index): string | null; - /** - * Returns a duplicate node, with the specified immediate child updated. - * Any value in the node will be removed. - * @param childName - The name of the child to update. - * @param newChildNode - The new child node - * @returns The updated node. - */ - updateImmediateChild(childName: string, newChildNode: Node): Node; - /** - * Returns a duplicate node, with the specified child updated. Any value will - * be removed. - * @param path - The path of the child to update. - * @param newChildNode - The new child node, which may be an empty node - * @returns The updated node. - */ - updateChild(path: Path, newChildNode: Node): Node; - /** - * True if the immediate child specified exists - */ - hasChild(childName: string): boolean; - /** - * @returns True if this node has no value or children. - */ - isEmpty(): boolean; - /** - * @returns The number of children of this node. - */ - numChildren(): number; - /** - * Calls action for each child. - * @param action - Action to be called for - * each child. It's passed the child name and the child node. - * @returns The first truthy value return by action, or the last falsey one - */ - forEachChild(index: Index, action: (a: string, b: Node) => void): unknown; - /** - * @param exportFormat - True for export format (also wire protocol format). - * @returns Value of this node as JSON. - */ - val(exportFormat?: boolean): unknown; - /** - * @returns hash representing the node contents. - */ - hash(): string; - /** - * @param other - Another node - * @returns -1 for less than, 0 for equal, 1 for greater than other - */ - compareTo(other: Node): number; - /** - * @returns Whether or not this snapshot equals other - */ - equals(other: Node): boolean; - /** - * @returns This node, with the specified index now available - */ - withIndex(indexDefinition: Index): Node; - isIndexed(indexDefinition: Index): boolean; -} -export declare class NamedNode { - name: string; - node: Node; - constructor(name: string, node: Node); - static Wrap(name: string, node: Node): NamedNode; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/snap/childSet.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/snap/childSet.d.ts deleted file mode 100644 index 5f964f5f..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/snap/childSet.d.ts +++ /dev/null @@ -1,32 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { SortedMap } from '../util/SortedMap'; -import { NamedNode } from './Node'; -/** - * Takes a list of child nodes and constructs a SortedSet using the given comparison - * function - * - * Uses the algorithm described in the paper linked here: - * http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.46.1458 - * - * @param childList - Unsorted list of children - * @param cmp - The comparison method to be used - * @param keyFn - An optional function to extract K from a node wrapper, if K's - * type is not NamedNode - * @param mapSortFn - An optional override for comparator used by the generated sorted map - */ -export declare const buildChildSet: (childList: NamedNode[], cmp: (a: NamedNode, b: NamedNode) => number, keyFn?: (a: NamedNode) => K, mapSortFn?: (a: K, b: K) => number) => SortedMap; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/snap/comparators.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/snap/comparators.d.ts deleted file mode 100644 index 15d32616..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/snap/comparators.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { NamedNode } from './Node'; -export declare function NAME_ONLY_COMPARATOR(left: NamedNode, right: NamedNode): number; -export declare function NAME_COMPARATOR(left: string, right: string): number; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/snap/indexes/Index.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/snap/indexes/Index.d.ts deleted file mode 100644 index dde70489..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/snap/indexes/Index.d.ts +++ /dev/null @@ -1,50 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { Comparator } from '../../util/SortedMap'; -import { Node, NamedNode } from '../Node'; -export declare abstract class Index { - abstract compare(a: NamedNode, b: NamedNode): number; - abstract isDefinedOn(node: Node): boolean; - /** - * @returns A standalone comparison function for - * this index - */ - getCompare(): Comparator; - /** - * Given a before and after value for a node, determine if the indexed value has changed. Even if they are different, - * it's possible that the changes are isolated to parts of the snapshot that are not indexed. - * - * - * @returns True if the portion of the snapshot being indexed changed between oldNode and newNode - */ - indexedValueChanged(oldNode: Node, newNode: Node): boolean; - /** - * @returns a node wrapper that will sort equal to or less than - * any other node wrapper, using this index - */ - minPost(): NamedNode; - /** - * @returns a node wrapper that will sort greater than or equal to - * any other node wrapper, using this index - */ - abstract maxPost(): NamedNode; - abstract makePost(indexValue: unknown, name: string): NamedNode; - /** - * @returns String representation for inclusion in a query spec - */ - abstract toString(): string; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/snap/indexes/KeyIndex.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/snap/indexes/KeyIndex.d.ts deleted file mode 100644 index 3bed7150..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/snap/indexes/KeyIndex.d.ts +++ /dev/null @@ -1,34 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { ChildrenNode } from '../ChildrenNode'; -import { Node, NamedNode } from '../Node'; -import { Index } from './Index'; -export declare class KeyIndex extends Index { - static get __EMPTY_NODE(): ChildrenNode; - static set __EMPTY_NODE(val: ChildrenNode); - compare(a: NamedNode, b: NamedNode): number; - isDefinedOn(node: Node): boolean; - indexedValueChanged(oldNode: Node, newNode: Node): boolean; - minPost(): any; - maxPost(): NamedNode; - makePost(indexValue: string, name: string): NamedNode; - /** - * @returns String representation for inclusion in a query spec - */ - toString(): string; -} -export declare const KEY_INDEX: KeyIndex; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/snap/indexes/PathIndex.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/snap/indexes/PathIndex.d.ts deleted file mode 100644 index f96ab691..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/snap/indexes/PathIndex.d.ts +++ /dev/null @@ -1,29 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { Path } from '../../util/Path'; -import { NamedNode, Node } from '../Node'; -import { Index } from './Index'; -export declare class PathIndex extends Index { - private indexPath_; - constructor(indexPath_: Path); - protected extractChild(snap: Node): Node; - isDefinedOn(node: Node): boolean; - compare(a: NamedNode, b: NamedNode): number; - makePost(indexValue: object, name: string): NamedNode; - maxPost(): NamedNode; - toString(): string; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/snap/indexes/PriorityIndex.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/snap/indexes/PriorityIndex.d.ts deleted file mode 100644 index ce368d4e..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/snap/indexes/PriorityIndex.d.ts +++ /dev/null @@ -1,33 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { NamedNode, Node } from '../Node'; -import { Index } from './Index'; -export declare function setNodeFromJSON(val: (a: unknown) => Node): void; -export declare function setMaxNode(val: Node): void; -export declare class PriorityIndex extends Index { - compare(a: NamedNode, b: NamedNode): number; - isDefinedOn(node: Node): boolean; - indexedValueChanged(oldNode: Node, newNode: Node): boolean; - minPost(): NamedNode; - maxPost(): NamedNode; - makePost(indexValue: unknown, name: string): NamedNode; - /** - * @returns String representation for inclusion in a query spec - */ - toString(): string; -} -export declare const PRIORITY_INDEX: PriorityIndex; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/snap/indexes/ValueIndex.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/snap/indexes/ValueIndex.d.ts deleted file mode 100644 index c1a5396a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/snap/indexes/ValueIndex.d.ts +++ /dev/null @@ -1,31 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { NamedNode, Node } from '../Node'; -import { Index } from './Index'; -export declare class ValueIndex extends Index { - compare(a: NamedNode, b: NamedNode): number; - isDefinedOn(node: Node): boolean; - indexedValueChanged(oldNode: Node, newNode: Node): boolean; - minPost(): NamedNode; - maxPost(): NamedNode; - makePost(indexValue: object, name: string): NamedNode; - /** - * @returns String representation for inclusion in a query spec - */ - toString(): string; -} -export declare const VALUE_INDEX: ValueIndex; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/snap/nodeFromJSON.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/snap/nodeFromJSON.d.ts deleted file mode 100644 index bc6900cf..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/snap/nodeFromJSON.d.ts +++ /dev/null @@ -1,24 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { Node } from './Node'; -/** - * Constructs a snapshot node representing the passed JSON and returns it. - * @param json - JSON to create a node for. - * @param priority - Optional priority to use. This will be ignored if the - * passed JSON contains a .priority property. - */ -export declare function nodeFromJSON(json: unknown | null, priority?: unknown): Node; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/snap/snap.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/snap/snap.d.ts deleted file mode 100644 index b70d5e00..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/snap/snap.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { Node } from './Node'; -export declare function setMaxNode(val: Node): void; -export declare const priorityHashText: (priority: string | number) => string; -/** - * Validates that a priority snapshot Node is valid. - */ -export declare const validatePriorityNode: (priorityNode: Node) => void; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/stats/StatsCollection.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/stats/StatsCollection.d.ts deleted file mode 100644 index 4b11a2d8..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/stats/StatsCollection.d.ts +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Tracks a collection of stats. - */ -export declare class StatsCollection { - private counters_; - incrementCounter(name: string, amount?: number): void; - get(): { - [k: string]: number; - }; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/stats/StatsListener.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/stats/StatsListener.d.ts deleted file mode 100644 index a7dc485b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/stats/StatsListener.d.ts +++ /dev/null @@ -1,30 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { StatsCollection } from './StatsCollection'; -/** - * Returns the delta from the previous call to get stats. - * - * @param collection_ - The collection to "listen" to. - */ -export declare class StatsListener { - private collection_; - private last_; - constructor(collection_: StatsCollection); - get(): { - [k: string]: number; - }; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/stats/StatsManager.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/stats/StatsManager.d.ts deleted file mode 100644 index 1d6ea229..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/stats/StatsManager.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { RepoInfo } from '../RepoInfo'; -import { StatsCollection } from './StatsCollection'; -export declare function statsManagerGetCollection(repoInfo: RepoInfo): StatsCollection; -export declare function statsManagerGetOrCreateReporter(repoInfo: RepoInfo, creatorFunction: () => T): T; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/stats/StatsReporter.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/stats/StatsReporter.d.ts deleted file mode 100644 index 9b9c6c9c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/stats/StatsReporter.d.ts +++ /dev/null @@ -1,28 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { ServerActions } from '../ServerActions'; -import { StatsCollection } from './StatsCollection'; -export declare class StatsReporter { - private server_; - private statsListener_; - statsToReport_: { - [k: string]: boolean; - }; - constructor(collection: StatsCollection, server_: ServerActions); - private reportStats_; -} -export declare function statsReporterIncludeStat(reporter: StatsReporter, stat: string): void; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/storage/DOMStorageWrapper.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/storage/DOMStorageWrapper.d.ts deleted file mode 100644 index dbffa106..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/storage/DOMStorageWrapper.d.ts +++ /dev/null @@ -1,46 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Wraps a DOM Storage object and: - * - automatically encode objects as JSON strings before storing them to allow us to store arbitrary types. - * - prefixes names with "firebase:" to avoid collisions with app data. - * - * We automatically (see storage.js) create two such wrappers, one for sessionStorage, - * and one for localStorage. - * - */ -export declare class DOMStorageWrapper { - private domStorage_; - private prefix_; - /** - * @param domStorage_ - The underlying storage object (e.g. localStorage or sessionStorage) - */ - constructor(domStorage_: Storage); - /** - * @param key - The key to save the value under - * @param value - The value being stored, or null to remove the key. - */ - set(key: string, value: unknown | null): void; - /** - * @returns The value that was stored under this key, or null - */ - get(key: string): unknown; - remove(key: string): void; - isInMemoryStorage: boolean; - prefixedName_(name: string): string; - toString(): string; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/storage/MemoryStorage.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/storage/MemoryStorage.d.ts deleted file mode 100644 index df11ca68..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/storage/MemoryStorage.d.ts +++ /dev/null @@ -1,27 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * An in-memory storage implementation that matches the API of DOMStorageWrapper - * (TODO: create interface for both to implement). - */ -export declare class MemoryStorage { - private cache_; - set(key: string, value: unknown | null): void; - get(key: string): unknown; - remove(key: string): void; - isInMemoryStorage: boolean; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/storage/storage.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/storage/storage.d.ts deleted file mode 100644 index f78e4d2a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/storage/storage.d.ts +++ /dev/null @@ -1,22 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { DOMStorageWrapper } from './DOMStorageWrapper'; -import { MemoryStorage } from './MemoryStorage'; -/** A storage object that lasts across sessions */ -export declare const PersistentStorage: DOMStorageWrapper | MemoryStorage; -/** A storage object that only lasts one session */ -export declare const SessionStorage: DOMStorageWrapper | MemoryStorage; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/util/EventEmitter.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/util/EventEmitter.d.ts deleted file mode 100644 index cb37e911..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/util/EventEmitter.d.ts +++ /dev/null @@ -1,39 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Base class to be used if you want to emit events. Call the constructor with - * the set of allowed event names. - */ -export declare abstract class EventEmitter { - private allowedEvents_; - private listeners_; - constructor(allowedEvents_: string[]); - /** - * To be overridden by derived classes in order to fire an initial event when - * somebody subscribes for data. - * - * @returns {Array.<*>} Array of parameters to trigger initial event with. - */ - abstract getInitialEvent(eventType: string): unknown[]; - /** - * To be called by derived classes to trigger events. - */ - protected trigger(eventType: string, ...varArgs: unknown[]): void; - on(eventType: string, callback: (a: unknown) => void, context: unknown): void; - off(eventType: string, callback: (a: unknown) => void, context: unknown): void; - private validateEventType_; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/util/ImmutableTree.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/util/ImmutableTree.d.ts deleted file mode 100644 index 964dcb7d..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/util/ImmutableTree.d.ts +++ /dev/null @@ -1,117 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { Path } from './Path'; -import { SortedMap } from './SortedMap'; -/** - * A tree with immutable elements. - */ -export declare class ImmutableTree { - readonly value: T | null; - readonly children: SortedMap>; - static fromObject(obj: { - [k: string]: T; - }): ImmutableTree; - constructor(value: T | null, children?: SortedMap>); - /** - * True if the value is empty and there are no children - */ - isEmpty(): boolean; - /** - * Given a path and predicate, return the first node and the path to that node - * where the predicate returns true. - * - * TODO Do a perf test -- If we're creating a bunch of `{path: value:}` - * objects on the way back out, it may be better to pass down a pathSoFar obj. - * - * @param relativePath - The remainder of the path - * @param predicate - The predicate to satisfy to return a node - */ - findRootMostMatchingPathAndValue(relativePath: Path, predicate: (a: T) => boolean): { - path: Path; - value: T; - } | null; - /** - * Find, if it exists, the shortest subpath of the given path that points a defined - * value in the tree - */ - findRootMostValueAndPath(relativePath: Path): { - path: Path; - value: T; - } | null; - /** - * @returns The subtree at the given path - */ - subtree(relativePath: Path): ImmutableTree; - /** - * Sets a value at the specified path. - * - * @param relativePath - Path to set value at. - * @param toSet - Value to set. - * @returns Resulting tree. - */ - set(relativePath: Path, toSet: T | null): ImmutableTree; - /** - * Removes the value at the specified path. - * - * @param relativePath - Path to value to remove. - * @returns Resulting tree. - */ - remove(relativePath: Path): ImmutableTree; - /** - * Gets a value from the tree. - * - * @param relativePath - Path to get value for. - * @returns Value at path, or null. - */ - get(relativePath: Path): T | null; - /** - * Replace the subtree at the specified path with the given new tree. - * - * @param relativePath - Path to replace subtree for. - * @param newTree - New tree. - * @returns Resulting tree. - */ - setTree(relativePath: Path, newTree: ImmutableTree): ImmutableTree; - /** - * Performs a depth first fold on this tree. Transforms a tree into a single - * value, given a function that operates on the path to a node, an optional - * current value, and a map of child names to folded subtrees - */ - fold(fn: (path: Path, value: T, children: { - [k: string]: V; - }) => V): V; - /** - * Recursive helper for public-facing fold() method - */ - private fold_; - /** - * Find the first matching value on the given path. Return the result of applying f to it. - */ - findOnPath(path: Path, f: (path: Path, value: T) => V | null): V | null; - private findOnPath_; - foreachOnPath(path: Path, f: (path: Path, value: T) => void): ImmutableTree; - private foreachOnPath_; - /** - * Calls the given function for each node in the tree that has a value. - * - * @param f - A function to be called with the path from the root of the tree to - * a node, and the value at that node. Called in depth-first order. - */ - foreach(f: (path: Path, value: T) => void): void; - private foreach_; - foreachChild(f: (name: string, value: T) => void): void; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/util/NextPushId.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/util/NextPushId.d.ts deleted file mode 100644 index 33a438e1..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/util/NextPushId.d.ts +++ /dev/null @@ -1,33 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Fancy ID generator that creates 20-character string identifiers with the - * following properties: - * - * 1. They're based on timestamp so that they sort *after* any existing ids. - * 2. They contain 72-bits of random data after the timestamp so that IDs won't - * collide with other clients' IDs. - * 3. They sort *lexicographically* (so the timestamp is converted to characters - * that will sort properly). - * 4. They're monotonically increasing. Even if you generate more than one in - * the same timestamp, the latter ones will sort after the former ones. We do - * this by using the previous random bits but "incrementing" them by 1 (only - * in the case of a timestamp collision). - */ -export declare const nextPushId: (now: number) => string; -export declare const successor: (key: string) => string; -export declare const predecessor: (key: string) => string; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/util/OnlineMonitor.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/util/OnlineMonitor.d.ts deleted file mode 100644 index 168c515c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/util/OnlineMonitor.d.ts +++ /dev/null @@ -1,31 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { EventEmitter } from './EventEmitter'; -/** - * Monitors online state (as reported by window.online/offline events). - * - * The expectation is that this could have many false positives (thinks we are online - * when we're not), but no false negatives. So we can safely use it to determine when - * we definitely cannot reach the internet. - */ -export declare class OnlineMonitor extends EventEmitter { - private online_; - static getInstance(): OnlineMonitor; - constructor(); - getInitialEvent(eventType: string): boolean[]; - currentlyOnline(): boolean; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/util/Path.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/util/Path.d.ts deleted file mode 100644 index e42a96e8..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/util/Path.d.ts +++ /dev/null @@ -1,94 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * An immutable object representing a parsed path. It's immutable so that you - * can pass them around to other functions without worrying about them changing - * it. - */ -export declare class Path { - pieces_: string[]; - pieceNum_: number; - /** - * @param pathOrString - Path string to parse, or another path, or the raw - * tokens array - */ - constructor(pathOrString: string | string[], pieceNum?: number); - toString(): string; -} -export declare function newEmptyPath(): Path; -export declare function pathGetFront(path: Path): string | null; -/** - * @returns The number of segments in this path - */ -export declare function pathGetLength(path: Path): number; -export declare function pathPopFront(path: Path): Path; -export declare function pathGetBack(path: Path): string | null; -export declare function pathToUrlEncodedString(path: Path): string; -/** - * Shallow copy of the parts of the path. - * - */ -export declare function pathSlice(path: Path, begin?: number): string[]; -export declare function pathParent(path: Path): Path | null; -export declare function pathChild(path: Path, childPathObj: string | Path): Path; -/** - * @returns True if there are no segments in this path - */ -export declare function pathIsEmpty(path: Path): boolean; -/** - * @returns The path from outerPath to innerPath - */ -export declare function newRelativePath(outerPath: Path, innerPath: Path): Path; -/** - * @returns -1, 0, 1 if left is less, equal, or greater than the right. - */ -export declare function pathCompare(left: Path, right: Path): number; -/** - * @returns true if paths are the same. - */ -export declare function pathEquals(path: Path, other: Path): boolean; -/** - * @returns True if this path is a parent of (or the same as) other - */ -export declare function pathContains(path: Path, other: Path): boolean; -/** - * Dynamic (mutable) path used to count path lengths. - * - * This class is used to efficiently check paths for valid - * length (in UTF8 bytes) and depth (used in path validation). - * - * Throws Error exception if path is ever invalid. - * - * The definition of a path always begins with '/'. - */ -export declare class ValidationPath { - errorPrefix_: string; - parts_: string[]; - /** Initialize to number of '/' chars needed in path. */ - byteLength_: number; - /** - * @param path - Initial Path. - * @param errorPrefix_ - Prefix for any error messages. - */ - constructor(path: Path, errorPrefix_: string); -} -export declare function validationPathPush(validationPath: ValidationPath, child: string): void; -export declare function validationPathPop(validationPath: ValidationPath): void; -/** - * String for use in error messages - uses '.' notation for path. - */ -export declare function validationPathToErrorString(validationPath: ValidationPath): string; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/util/ServerValues.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/util/ServerValues.d.ts deleted file mode 100644 index 5dabefd9..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/util/ServerValues.d.ts +++ /dev/null @@ -1,56 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { Node } from '../snap/Node'; -import { SyncTree } from '../SyncTree'; -import { Indexable } from './misc'; -import { Path } from './Path'; -interface ValueProvider { - getImmediateChild(childName: string): ValueProvider; - node(): Node; -} -/** - * Generate placeholders for deferred values. - */ -export declare const generateWithValues: (values: { - [k: string]: unknown; -}) => { - [k: string]: unknown; -}; -/** - * Value to use when firing local events. When writing server values, fire - * local events with an approximate value, otherwise return value as-is. - */ -export declare const resolveDeferredLeafValue: (value: string | number | boolean | { - [k: string]: unknown; -}, existingVal: ValueProvider, serverValues: { - [k: string]: unknown; -}) => string | number | boolean; -/** - * Recursively replace all deferred values and priorities in the tree with the - * specified generated replacement values. - * @param path - path to which write is relative - * @param node - new data written at path - * @param syncTree - current data - */ -export declare const resolveDeferredValueTree: (path: Path, node: Node, syncTree: SyncTree, serverValues: Indexable) => Node; -/** - * Recursively replace all deferred values and priorities in the node with the - * specified generated replacement values. If there are no server values in the node, - * it'll be returned as-is. - */ -export declare const resolveDeferredValueSnapshot: (node: Node, existing: Node, serverValues: Indexable) => Node; -export {}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/util/SortedMap.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/util/SortedMap.d.ts deleted file mode 100644 index 13d00d81..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/util/SortedMap.d.ts +++ /dev/null @@ -1,324 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * @fileoverview Implementation of an immutable SortedMap using a Left-leaning - * Red-Black Tree, adapted from the implementation in Mugs - * (http://mads379.github.com/mugs/) by Mads Hartmann Jensen - * (mads379\@gmail.com). - * - * Original paper on Left-leaning Red-Black Trees: - * http://www.cs.princeton.edu/~rs/talks/LLRB/LLRB.pdf - * - * Invariant 1: No red node has a red child - * Invariant 2: Every leaf path has the same number of black nodes - * Invariant 3: Only the left child can be red (left leaning) - */ -export declare type Comparator = (key1: K, key2: K) => number; -/** - * An iterator over an LLRBNode. - */ -export declare class SortedMapIterator { - private isReverse_; - private resultGenerator_; - private nodeStack_; - /** - * @param node - Node to iterate. - * @param isReverse_ - Whether or not to iterate in reverse - */ - constructor(node: LLRBNode | LLRBEmptyNode, startKey: K | null, comparator: Comparator, isReverse_: boolean, resultGenerator_?: ((k: K, v: V) => T) | null); - getNext(): T; - hasNext(): boolean; - peek(): T; -} -/** - * Represents a node in a Left-leaning Red-Black tree. - */ -export declare class LLRBNode { - key: K; - value: V; - color: boolean; - left: LLRBNode | LLRBEmptyNode; - right: LLRBNode | LLRBEmptyNode; - /** - * @param key - Key associated with this node. - * @param value - Value associated with this node. - * @param color - Whether this node is red. - * @param left - Left child. - * @param right - Right child. - */ - constructor(key: K, value: V, color: boolean | null, left?: LLRBNode | LLRBEmptyNode | null, right?: LLRBNode | LLRBEmptyNode | null); - static RED: boolean; - static BLACK: boolean; - /** - * Returns a copy of the current node, optionally replacing pieces of it. - * - * @param key - New key for the node, or null. - * @param value - New value for the node, or null. - * @param color - New color for the node, or null. - * @param left - New left child for the node, or null. - * @param right - New right child for the node, or null. - * @returns The node copy. - */ - copy(key: K | null, value: V | null, color: boolean | null, left: LLRBNode | LLRBEmptyNode | null, right: LLRBNode | LLRBEmptyNode | null): LLRBNode; - /** - * @returns The total number of nodes in the tree. - */ - count(): number; - /** - * @returns True if the tree is empty. - */ - isEmpty(): boolean; - /** - * Traverses the tree in key order and calls the specified action function - * for each node. - * - * @param action - Callback function to be called for each - * node. If it returns true, traversal is aborted. - * @returns The first truthy value returned by action, or the last falsey - * value returned by action - */ - inorderTraversal(action: (k: K, v: V) => unknown): boolean; - /** - * Traverses the tree in reverse key order and calls the specified action function - * for each node. - * - * @param action - Callback function to be called for each - * node. If it returns true, traversal is aborted. - * @returns True if traversal was aborted. - */ - reverseTraversal(action: (k: K, v: V) => void): boolean; - /** - * @returns The minimum node in the tree. - */ - private min_; - /** - * @returns The maximum key in the tree. - */ - minKey(): K; - /** - * @returns The maximum key in the tree. - */ - maxKey(): K; - /** - * @param key - Key to insert. - * @param value - Value to insert. - * @param comparator - Comparator. - * @returns New tree, with the key/value added. - */ - insert(key: K, value: V, comparator: Comparator): LLRBNode; - /** - * @returns New tree, with the minimum key removed. - */ - private removeMin_; - /** - * @param key - The key of the item to remove. - * @param comparator - Comparator. - * @returns New tree, with the specified item removed. - */ - remove(key: K, comparator: Comparator): LLRBNode | LLRBEmptyNode; - /** - * @returns Whether this is a RED node. - */ - isRed_(): boolean; - /** - * @returns New tree after performing any needed rotations. - */ - private fixUp_; - /** - * @returns New tree, after moveRedLeft. - */ - private moveRedLeft_; - /** - * @returns New tree, after moveRedRight. - */ - private moveRedRight_; - /** - * @returns New tree, after rotateLeft. - */ - private rotateLeft_; - /** - * @returns New tree, after rotateRight. - */ - private rotateRight_; - /** - * @returns Newt ree, after colorFlip. - */ - private colorFlip_; - /** - * For testing. - * - * @returns True if all is well. - */ - private checkMaxDepth_; - check_(): number; -} -/** - * Represents an empty node (a leaf node in the Red-Black Tree). - */ -export declare class LLRBEmptyNode { - key: K; - value: V; - left: LLRBNode | LLRBEmptyNode; - right: LLRBNode | LLRBEmptyNode; - color: boolean; - /** - * Returns a copy of the current node. - * - * @returns The node copy. - */ - copy(key: K | null, value: V | null, color: boolean | null, left: LLRBNode | LLRBEmptyNode | null, right: LLRBNode | LLRBEmptyNode | null): LLRBEmptyNode; - /** - * Returns a copy of the tree, with the specified key/value added. - * - * @param key - Key to be added. - * @param value - Value to be added. - * @param comparator - Comparator. - * @returns New tree, with item added. - */ - insert(key: K, value: V, comparator: Comparator): LLRBNode; - /** - * Returns a copy of the tree, with the specified key removed. - * - * @param key - The key to remove. - * @param comparator - Comparator. - * @returns New tree, with item removed. - */ - remove(key: K, comparator: Comparator): LLRBEmptyNode; - /** - * @returns The total number of nodes in the tree. - */ - count(): number; - /** - * @returns True if the tree is empty. - */ - isEmpty(): boolean; - /** - * Traverses the tree in key order and calls the specified action function - * for each node. - * - * @param action - Callback function to be called for each - * node. If it returns true, traversal is aborted. - * @returns True if traversal was aborted. - */ - inorderTraversal(action: (k: K, v: V) => unknown): boolean; - /** - * Traverses the tree in reverse key order and calls the specified action function - * for each node. - * - * @param action - Callback function to be called for each - * node. If it returns true, traversal is aborted. - * @returns True if traversal was aborted. - */ - reverseTraversal(action: (k: K, v: V) => void): boolean; - minKey(): null; - maxKey(): null; - check_(): number; - /** - * @returns Whether this node is red. - */ - isRed_(): boolean; -} -/** - * An immutable sorted map implementation, based on a Left-leaning Red-Black - * tree. - */ -export declare class SortedMap { - private comparator_; - private root_; - /** - * Always use the same empty node, to reduce memory. - */ - static EMPTY_NODE: LLRBEmptyNode; - /** - * @param comparator_ - Key comparator. - * @param root_ - Optional root node for the map. - */ - constructor(comparator_: Comparator, root_?: LLRBNode | LLRBEmptyNode); - /** - * Returns a copy of the map, with the specified key/value added or replaced. - * (TODO: We should perhaps rename this method to 'put') - * - * @param key - Key to be added. - * @param value - Value to be added. - * @returns New map, with item added. - */ - insert(key: K, value: V): SortedMap; - /** - * Returns a copy of the map, with the specified key removed. - * - * @param key - The key to remove. - * @returns New map, with item removed. - */ - remove(key: K): SortedMap; - /** - * Returns the value of the node with the given key, or null. - * - * @param key - The key to look up. - * @returns The value of the node with the given key, or null if the - * key doesn't exist. - */ - get(key: K): V | null; - /** - * Returns the key of the item *before* the specified key, or null if key is the first item. - * @param key - The key to find the predecessor of - * @returns The predecessor key. - */ - getPredecessorKey(key: K): K | null; - /** - * @returns True if the map is empty. - */ - isEmpty(): boolean; - /** - * @returns The total number of nodes in the map. - */ - count(): number; - /** - * @returns The minimum key in the map. - */ - minKey(): K | null; - /** - * @returns The maximum key in the map. - */ - maxKey(): K | null; - /** - * Traverses the map in key order and calls the specified action function - * for each key/value pair. - * - * @param action - Callback function to be called - * for each key/value pair. If action returns true, traversal is aborted. - * @returns The first truthy value returned by action, or the last falsey - * value returned by action - */ - inorderTraversal(action: (k: K, v: V) => unknown): boolean; - /** - * Traverses the map in reverse key order and calls the specified action function - * for each key/value pair. - * - * @param action - Callback function to be called - * for each key/value pair. If action returns true, traversal is aborted. - * @returns True if the traversal was aborted. - */ - reverseTraversal(action: (k: K, v: V) => void): boolean; - /** - * Returns an iterator over the SortedMap. - * @returns The iterator. - */ - getIterator(resultGenerator?: (k: K, v: V) => T): SortedMapIterator; - getIteratorFrom(key: K, resultGenerator?: (k: K, v: V) => T): SortedMapIterator; - getReverseIteratorFrom(key: K, resultGenerator?: (k: K, v: V) => T): SortedMapIterator; - getReverseIterator(resultGenerator?: (k: K, v: V) => T): SortedMapIterator; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/util/Tree.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/util/Tree.d.ts deleted file mode 100644 index 2b95690e..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/util/Tree.d.ts +++ /dev/null @@ -1,105 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { Path } from './Path'; -/** - * Node in a Tree. - */ -export interface TreeNode { - children: Record>; - childCount: number; - value?: T; -} -/** - * A light-weight tree, traversable by path. Nodes can have both values and children. - * Nodes are not enumerated (by forEachChild) unless they have a value or non-empty - * children. - */ -export declare class Tree { - readonly name: string; - readonly parent: Tree | null; - node: TreeNode; - /** - * @param name - Optional name of the node. - * @param parent - Optional parent node. - * @param node - Optional node to wrap. - */ - constructor(name?: string, parent?: Tree | null, node?: TreeNode); -} -/** - * Returns a sub-Tree for the given path. - * - * @param pathObj - Path to look up. - * @returns Tree for path. - */ -export declare function treeSubTree(tree: Tree, pathObj: string | Path): Tree; -/** - * Returns the data associated with this tree node. - * - * @returns The data or null if no data exists. - */ -export declare function treeGetValue(tree: Tree): T | undefined; -/** - * Sets data to this tree node. - * - * @param value - Value to set. - */ -export declare function treeSetValue(tree: Tree, value: T | undefined): void; -/** - * @returns Whether the tree has any children. - */ -export declare function treeHasChildren(tree: Tree): boolean; -/** - * @returns Whethe rthe tree is empty (no value or children). - */ -export declare function treeIsEmpty(tree: Tree): boolean; -/** - * Calls action for each child of this tree node. - * - * @param action - Action to be called for each child. - */ -export declare function treeForEachChild(tree: Tree, action: (tree: Tree) => void): void; -/** - * Does a depth-first traversal of this node's descendants, calling action for each one. - * - * @param action - Action to be called for each child. - * @param includeSelf - Whether to call action on this node as well. Defaults to - * false. - * @param childrenFirst - Whether to call action on children before calling it on - * parent. - */ -export declare function treeForEachDescendant(tree: Tree, action: (tree: Tree) => void, includeSelf?: boolean, childrenFirst?: boolean): void; -/** - * Calls action on each ancestor node. - * - * @param action - Action to be called on each parent; return - * true to abort. - * @param includeSelf - Whether to call action on this node as well. - * @returns true if the action callback returned true. - */ -export declare function treeForEachAncestor(tree: Tree, action: (tree: Tree) => unknown, includeSelf?: boolean): boolean; -/** - * Does a depth-first traversal of this node's descendants. When a descendant with a value - * is found, action is called on it and traversal does not continue inside the node. - * Action is *not* called on this node. - * - * @param action - Action to be called for each child. - */ -export declare function treeForEachImmediateDescendantWithValue(tree: Tree, action: (tree: Tree) => void): void; -/** - * @returns The path of this tree node, as a Path. - */ -export declare function treeGetPath(tree: Tree): any; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/util/VisibilityMonitor.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/util/VisibilityMonitor.d.ts deleted file mode 100644 index 0bbb8931..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/util/VisibilityMonitor.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { EventEmitter } from './EventEmitter'; -export declare class VisibilityMonitor extends EventEmitter { - private visible_; - static getInstance(): VisibilityMonitor; - constructor(); - getInitialEvent(eventType: string): boolean[]; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/util/libs/parser.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/util/libs/parser.d.ts deleted file mode 100644 index bd9fd85f..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/util/libs/parser.d.ts +++ /dev/null @@ -1,32 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { RepoInfo } from '../../RepoInfo'; -import { Path } from '../Path'; -export declare const parseRepoInfo: (dataURL: string, nodeAdmin: boolean) => { - repoInfo: RepoInfo; - path: Path; -}; -export declare const parseDatabaseURL: (dataURL: string) => { - host: string; - port: number; - domain: string; - subdomain: string; - secure: boolean; - scheme: string; - pathString: string; - namespace: string; -}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/util/misc.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/util/misc.d.ts deleted file mode 100644 index fa35b985..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/util/misc.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -/** - * @license - * Copyright 2019 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export interface Indexable { - [key: string]: unknown; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/util/util.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/util/util.d.ts deleted file mode 100644 index 37b5e7b3..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/util/util.d.ts +++ /dev/null @@ -1,176 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { QueryContext } from '../view/EventRegistration'; -/** - * Returns a locally-unique ID (generated by just incrementing up from 0 each time its called). - */ -export declare const LUIDGenerator: () => number; -/** - * Sha1 hash of the input string - * @param str - The string to hash - * @returns {!string} The resulting hash - */ -export declare const sha1: (str: string) => string; -/** - * Use this for all debug messages in Firebase. - */ -export declare let logger: ((a: string) => void) | null; -/** - * The implementation of Firebase.enableLogging (defined here to break dependencies) - * @param logger_ - A flag to turn on logging, or a custom logger - * @param persistent - Whether or not to persist logging settings across refreshes - */ -export declare const enableLogging: (logger_?: boolean | ((a: string) => void), persistent?: boolean) => void; -export declare const log: (...varArgs: unknown[]) => void; -export declare const logWrapper: (prefix: string) => (...varArgs: unknown[]) => void; -export declare const error: (...varArgs: string[]) => void; -export declare const fatal: (...varArgs: string[]) => never; -export declare const warn: (...varArgs: unknown[]) => void; -/** - * Logs a warning if the containing page uses https. Called when a call to new Firebase - * does not use https. - */ -export declare const warnIfPageIsSecure: () => void; -export declare const warnAboutUnsupportedMethod: (methodName: string) => void; -/** - * Returns true if data is NaN, or +/- Infinity. - */ -export declare const isInvalidJSONNumber: (data: unknown) => boolean; -export declare const executeWhenDOMReady: (fn: () => void) => void; -/** - * Minimum key name. Invalid for actual data, used as a marker to sort before any valid names - */ -export declare const MIN_NAME = "[MIN_NAME]"; -/** - * Maximum key name. Invalid for actual data, used as a marker to sort above any valid names - */ -export declare const MAX_NAME = "[MAX_NAME]"; -/** - * Compares valid Firebase key names, plus min and max name - */ -export declare const nameCompare: (a: string, b: string) => number; -/** - * @returns {!number} comparison result. - */ -export declare const stringCompare: (a: string, b: string) => number; -export declare const requireKey: (key: string, obj: { - [k: string]: unknown; -}) => unknown; -export declare const ObjectToUniqueKey: (obj: unknown) => string; -/** - * Splits a string into a number of smaller segments of maximum size - * @param str - The string - * @param segsize - The maximum number of chars in the string. - * @returns The string, split into appropriately-sized chunks - */ -export declare const splitStringBySize: (str: string, segsize: number) => string[]; -/** - * Apply a function to each (key, value) pair in an object or - * apply a function to each (index, value) pair in an array - * @param obj - The object or array to iterate over - * @param fn - The function to apply - */ -export declare function each(obj: object, fn: (k: string, v: unknown) => void): void; -/** - * Like goog.bind, but doesn't bother to create a closure if opt_context is null/undefined. - * @param callback - Callback function. - * @param context - Optional context to bind to. - * - */ -export declare const bindCallback: (callback: (a: unknown) => void, context?: object | null) => (a: unknown) => void; -/** - * Borrowed from http://hg.secondlife.com/llsd/src/tip/js/typedarray.js (MIT License) - * I made one modification at the end and removed the NaN / Infinity - * handling (since it seemed broken [caused an overflow] and we don't need it). See MJL comments. - * @param v - A double - * - */ -export declare const doubleToIEEE754String: (v: number) => string; -/** - * Used to detect if we're in a Chrome content script (which executes in an - * isolated environment where long-polling doesn't work). - */ -export declare const isChromeExtensionContentScript: () => boolean; -/** - * Used to detect if we're in a Windows 8 Store app. - */ -export declare const isWindowsStoreApp: () => boolean; -/** - * Converts a server error code to a Javascript Error - */ -export declare function errorForServerCode(code: string, query: QueryContext): Error; -/** - * Used to test for integer-looking strings - */ -export declare const INTEGER_REGEXP_: RegExp; -/** - * For use in keys, the minimum possible 32-bit integer. - */ -export declare const INTEGER_32_MIN = -2147483648; -/** - * For use in kyes, the maximum possible 32-bit integer. - */ -export declare const INTEGER_32_MAX = 2147483647; -/** - * If the string contains a 32-bit integer, return it. Else return null. - */ -export declare const tryParseInt: (str: string) => number | null; -/** - * Helper to run some code but catch any exceptions and re-throw them later. - * Useful for preventing user callbacks from breaking internal code. - * - * Re-throwing the exception from a setTimeout is a little evil, but it's very - * convenient (we don't have to try to figure out when is a safe point to - * re-throw it), and the behavior seems reasonable: - * - * * If you aren't pausing on exceptions, you get an error in the console with - * the correct stack trace. - * * If you're pausing on all exceptions, the debugger will pause on your - * exception and then again when we rethrow it. - * * If you're only pausing on uncaught exceptions, the debugger will only pause - * on us re-throwing it. - * - * @param fn - The code to guard. - */ -export declare const exceptionGuard: (fn: () => void) => void; -/** - * Helper function to safely call opt_callback with the specified arguments. It: - * 1. Turns into a no-op if opt_callback is null or undefined. - * 2. Wraps the call inside exceptionGuard to prevent exceptions from breaking our state. - * - * @param callback - Optional onComplete callback. - * @param varArgs - Arbitrary args to be passed to opt_onComplete - */ -export declare const callUserCallback: (callback?: Function | null, ...varArgs: unknown[]) => void; -/** - * @returns {boolean} true if we think we're currently being crawled. - */ -export declare const beingCrawled: () => boolean; -/** - * Export a property of an object using a getter function. - */ -export declare const exportPropGetter: (object: object, name: string, fnGet: () => unknown) => void; -/** - * Same as setTimeout() except on Node.JS it will /not/ prevent the process from exiting. - * - * It is removed with clearTimeout() as normal. - * - * @param fn - Function to run. - * @param time - Milliseconds to wait before running. - * @returns The setTimeout() return value. - */ -export declare const setTimeoutNonBlocking: (fn: () => void, time: number) => number | object; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/util/validation.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/util/validation.d.ts deleted file mode 100644 index 05fd0874..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/util/validation.d.ts +++ /dev/null @@ -1,70 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { RepoInfo } from '../RepoInfo'; -import { Path, ValidationPath } from './Path'; -/** - * True for invalid Firebase keys - */ -export declare const INVALID_KEY_REGEX_: RegExp; -/** - * True for invalid Firebase paths. - * Allows '/' in paths. - */ -export declare const INVALID_PATH_REGEX_: RegExp; -/** - * Maximum number of characters to allow in leaf value - */ -export declare const MAX_LEAF_SIZE_: number; -export declare const isValidKey: (key: unknown) => boolean; -export declare const isValidPathString: (pathString: string) => boolean; -export declare const isValidRootPathString: (pathString: string) => boolean; -export declare const isValidPriority: (priority: unknown) => boolean; -/** - * Pre-validate a datum passed as an argument to Firebase function. - */ -export declare const validateFirebaseDataArg: (fnName: string, value: unknown, path: Path, optional: boolean) => void; -/** - * Validate a data object client-side before sending to server. - */ -export declare const validateFirebaseData: (errorPrefix: string, data: unknown, path_: Path | ValidationPath) => void; -/** - * Pre-validate paths passed in the firebase function. - */ -export declare const validateFirebaseMergePaths: (errorPrefix: string, mergePaths: Path[]) => void; -/** - * pre-validate an object passed as an argument to firebase function ( - * must be an object - e.g. for firebase.update()). - */ -export declare const validateFirebaseMergeDataArg: (fnName: string, data: unknown, path: Path, optional: boolean) => void; -export declare const validatePriority: (fnName: string, priority: unknown, optional: boolean) => void; -export declare const validateKey: (fnName: string, argumentName: string, key: string, optional: boolean) => void; -/** - * @internal - */ -export declare const validatePathString: (fnName: string, argumentName: string, pathString: string, optional: boolean) => void; -export declare const validateRootPathString: (fnName: string, argumentName: string, pathString: string, optional: boolean) => void; -/** - * @internal - */ -export declare const validateWritablePath: (fnName: string, path: Path) => void; -export declare const validateUrl: (fnName: string, parsedUrl: { - repoInfo: RepoInfo; - path: Path; -}) => void; -export declare const validateString: (fnName: string, argumentName: string, string: unknown, optional: boolean) => void; -export declare const validateObject: (fnName: string, argumentName: string, obj: unknown, optional: boolean) => void; -export declare const validateObjectContainsKey: (fnName: string, argumentName: string, obj: unknown, key: string, optional: boolean, optType?: string) => void; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/version.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/version.d.ts deleted file mode 100644 index 1c7743fa..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/version.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -/** - * @license - * Copyright 2019 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** The semver (www.semver.org) version of the SDK. */ -export declare let SDK_VERSION: string; -/** - * SDK_VERSION should be set before any database instance is created - * @internal - */ -export declare function setSDKVersion(version: string): void; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/view/CacheNode.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/view/CacheNode.d.ts deleted file mode 100644 index 5ba8cfd7..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/view/CacheNode.d.ts +++ /dev/null @@ -1,41 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { Node } from '../snap/Node'; -import { Path } from '../util/Path'; -/** - * A cache node only stores complete children. Additionally it holds a flag whether the node can be considered fully - * initialized in the sense that we know at one point in time this represented a valid state of the world, e.g. - * initialized with data from the server, or a complete overwrite by the client. The filtered flag also tracks - * whether a node potentially had children removed due to a filter. - */ -export declare class CacheNode { - private node_; - private fullyInitialized_; - private filtered_; - constructor(node_: Node, fullyInitialized_: boolean, filtered_: boolean); - /** - * Returns whether this node was fully initialized with either server data or a complete overwrite by the client - */ - isFullyInitialized(): boolean; - /** - * Returns whether this node is potentially missing children due to a filter applied to the node - */ - isFiltered(): boolean; - isCompleteForPath(path: Path): boolean; - isCompleteForChild(key: string): boolean; - getNode(): Node; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/view/Change.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/view/Change.d.ts deleted file mode 100644 index a53ca680..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/view/Change.d.ts +++ /dev/null @@ -1,46 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { Node } from '../snap/Node'; -export declare const enum ChangeType { - /** Event type for a child added */ - CHILD_ADDED = "child_added", - /** Event type for a child removed */ - CHILD_REMOVED = "child_removed", - /** Event type for a child changed */ - CHILD_CHANGED = "child_changed", - /** Event type for a child moved */ - CHILD_MOVED = "child_moved", - /** Event type for a value change */ - VALUE = "value" -} -export interface Change { - /** @param type - The event type */ - type: ChangeType; - /** @param snapshotNode - The data */ - snapshotNode: Node; - /** @param childName - The name for this child, if it's a child even */ - childName?: string; - /** @param oldSnap - Used for intermediate processing of child changed events */ - oldSnap?: Node; - /** * @param prevName - The name for the previous child, if applicable */ - prevName?: string | null; -} -export declare function changeValue(snapshotNode: Node): Change; -export declare function changeChildAdded(childName: string, snapshotNode: Node): Change; -export declare function changeChildRemoved(childName: string, snapshotNode: Node): Change; -export declare function changeChildChanged(childName: string, snapshotNode: Node, oldSnap: Node): Change; -export declare function changeChildMoved(childName: string, snapshotNode: Node): Change; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/view/ChildChangeAccumulator.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/view/ChildChangeAccumulator.d.ts deleted file mode 100644 index ef031e2a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/view/ChildChangeAccumulator.d.ts +++ /dev/null @@ -1,22 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { Change } from './Change'; -export declare class ChildChangeAccumulator { - private readonly changeMap; - trackChildChange(change: Change): void; - getChanges(): Change[]; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/view/CompleteChildSource.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/view/CompleteChildSource.d.ts deleted file mode 100644 index fd6a3010..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/view/CompleteChildSource.d.ts +++ /dev/null @@ -1,55 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { Index } from '../snap/indexes/Index'; -import { NamedNode, Node } from '../snap/Node'; -import { WriteTreeRef } from '../WriteTree'; -import { ViewCache } from './ViewCache'; -/** - * Since updates to filtered nodes might require nodes to be pulled in from "outside" the node, this interface - * can help to get complete children that can be pulled in. - * A class implementing this interface takes potentially multiple sources (e.g. user writes, server data from - * other views etc.) to try it's best to get a complete child that might be useful in pulling into the view. - * - * @interface - */ -export interface CompleteChildSource { - getCompleteChild(childKey: string): Node | null; - getChildAfterChild(index: Index, child: NamedNode, reverse: boolean): NamedNode | null; -} -/** - * An implementation of CompleteChildSource that never returns any additional children - */ -export declare class NoCompleteChildSource_ implements CompleteChildSource { - getCompleteChild(childKey?: string): Node | null; - getChildAfterChild(index?: Index, child?: NamedNode, reverse?: boolean): NamedNode | null; -} -/** - * Singleton instance. - */ -export declare const NO_COMPLETE_CHILD_SOURCE: NoCompleteChildSource_; -/** - * An implementation of CompleteChildSource that uses a WriteTree in addition to any other server data or - * old event caches available to calculate complete children. - */ -export declare class WriteTreeCompleteChildSource implements CompleteChildSource { - private writes_; - private viewCache_; - private optCompleteServerCache_; - constructor(writes_: WriteTreeRef, viewCache_: ViewCache, optCompleteServerCache_?: Node | null); - getCompleteChild(childKey: string): Node | null; - getChildAfterChild(index: Index, child: NamedNode, reverse: boolean): NamedNode | null; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/view/Event.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/view/Event.d.ts deleted file mode 100644 index 03a8912c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/view/Event.d.ts +++ /dev/null @@ -1,64 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { DataSnapshot as ExpDataSnapshot } from '../../api/Reference_impl'; -import { Path } from '../util/Path'; -import { EventRegistration } from './EventRegistration'; -/** - * Encapsulates the data needed to raise an event - * @interface - */ -export interface Event { - getPath(): Path; - getEventType(): string; - getEventRunner(): () => void; - toString(): string; -} -/** - * One of the following strings: "value", "child_added", "child_changed", - * "child_removed", or "child_moved." - */ -export declare type EventType = 'value' | 'child_added' | 'child_changed' | 'child_moved' | 'child_removed'; -/** - * Encapsulates the data needed to raise an event - */ -export declare class DataEvent implements Event { - eventType: EventType; - eventRegistration: EventRegistration; - snapshot: ExpDataSnapshot; - prevName?: string | null; - /** - * @param eventType - One of: value, child_added, child_changed, child_moved, child_removed - * @param eventRegistration - The function to call to with the event data. User provided - * @param snapshot - The data backing the event - * @param prevName - Optional, the name of the previous child for child_* events. - */ - constructor(eventType: EventType, eventRegistration: EventRegistration, snapshot: ExpDataSnapshot, prevName?: string | null); - getPath(): Path; - getEventType(): string; - getEventRunner(): () => void; - toString(): string; -} -export declare class CancelEvent implements Event { - eventRegistration: EventRegistration; - error: Error; - path: Path; - constructor(eventRegistration: EventRegistration, error: Error, path: Path); - getPath(): Path; - getEventType(): string; - getEventRunner(): () => void; - toString(): string; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/view/EventGenerator.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/view/EventGenerator.d.ts deleted file mode 100644 index fb665e41..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/view/EventGenerator.d.ts +++ /dev/null @@ -1,42 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { Index } from '../snap/indexes/Index'; -import { Node } from '../snap/Node'; -import { Change } from './Change'; -import { Event } from './Event'; -import { EventRegistration, QueryContext } from './EventRegistration'; -/** - * An EventGenerator is used to convert "raw" changes (Change) as computed by the - * CacheDiffer into actual events (Event) that can be raised. See generateEventsForChanges() - * for details. - * - */ -export declare class EventGenerator { - query_: QueryContext; - index_: Index; - constructor(query_: QueryContext); -} -/** - * Given a set of raw changes (no moved events and prevName not specified yet), and a set of - * EventRegistrations that should be notified of these changes, generate the actual events to be raised. - * - * Notes: - * - child_moved events will be synthesized at this time for any child_changed events that affect - * our index. - * - prevName will be calculated based on the index ordering. - */ -export declare function eventGeneratorGenerateEventsForChanges(eventGenerator: EventGenerator, changes: Change[], eventCache: Node, eventRegistrations: EventRegistration[]): Event[]; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/view/EventQueue.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/view/EventQueue.d.ts deleted file mode 100644 index 2403ca0c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/view/EventQueue.d.ts +++ /dev/null @@ -1,67 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { Path } from '../util/Path'; -import { Event } from './Event'; -/** - * The event queue serves a few purposes: - * 1. It ensures we maintain event order in the face of event callbacks doing operations that result in more - * events being queued. - * 2. raiseQueuedEvents() handles being called reentrantly nicely. That is, if in the course of raising events, - * raiseQueuedEvents() is called again, the "inner" call will pick up raising events where the "outer" call - * left off, ensuring that the events are still raised synchronously and in order. - * 3. You can use raiseEventsAtPath and raiseEventsForChangedPath to ensure only relevant previously-queued - * events are raised synchronously. - * - * NOTE: This can all go away if/when we move to async events. - * - */ -export declare class EventQueue { - eventLists_: EventList[]; - /** - * Tracks recursion depth of raiseQueuedEvents_, for debugging purposes. - */ - recursionDepth_: number; -} -/** - * @param eventDataList - The new events to queue. - */ -export declare function eventQueueQueueEvents(eventQueue: EventQueue, eventDataList: Event[]): void; -/** - * Queues the specified events and synchronously raises all events (including previously queued ones) - * for the specified path. - * - * It is assumed that the new events are all for the specified path. - * - * @param path - The path to raise events for. - * @param eventDataList - The new events to raise. - */ -export declare function eventQueueRaiseEventsAtPath(eventQueue: EventQueue, path: Path, eventDataList: Event[]): void; -/** - * Queues the specified events and synchronously raises all events (including previously queued ones) for - * locations related to the specified change path (i.e. all ancestors and descendants). - * - * It is assumed that the new events are all related (ancestor or descendant) to the specified path. - * - * @param changedPath - The path to raise events for. - * @param eventDataList - The events to raise - */ -export declare function eventQueueRaiseEventsForChangedPath(eventQueue: EventQueue, changedPath: Path, eventDataList: Event[]): void; -interface EventList { - events: Event[]; - path: Path; -} -export {}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/view/EventRegistration.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/view/EventRegistration.d.ts deleted file mode 100644 index 771d8efe..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/view/EventRegistration.d.ts +++ /dev/null @@ -1,87 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { DataSnapshot } from '../../api/Reference_impl'; -import { Repo } from '../Repo'; -import { Path } from '../util/Path'; -import { Change } from './Change'; -import { CancelEvent, Event } from './Event'; -import { QueryParams } from './QueryParams'; -/** - * A user callback. Callbacks issues from the Legacy SDK maintain references - * to the original user-issued callbacks, which allows equality - * comparison by reference even though this callbacks are wrapped before - * they can be passed to the firebase@exp SDK. - * - * @internal - */ -export interface UserCallback { - (dataSnapshot: DataSnapshot, previousChildName?: string | null): unknown; - userCallback?: unknown; - context?: object | null; -} -/** - * A wrapper class that converts events from the database@exp SDK to the legacy - * Database SDK. Events are not converted directly as event registration relies - * on reference comparison of the original user callback (see `matches()`) and - * relies on equality of the legacy SDK's `context` object. - */ -export declare class CallbackContext { - private readonly snapshotCallback; - private readonly cancelCallback?; - constructor(snapshotCallback: UserCallback, cancelCallback?: (error: Error) => unknown); - onValue(expDataSnapshot: DataSnapshot, previousChildName?: string | null): void; - onCancel(error: Error): void; - get hasCancelCallback(): boolean; - matches(other: CallbackContext): boolean; -} -export interface QueryContext { - readonly _queryIdentifier: string; - readonly _queryObject: object; - readonly _repo: Repo; - readonly _path: Path; - readonly _queryParams: QueryParams; -} -/** - * An EventRegistration is basically an event type ('value', 'child_added', etc.) and a callback - * to be notified of that type of event. - * - * That said, it can also contain a cancel callback to be notified if the event is canceled. And - * currently, this code is organized around the idea that you would register multiple child_ callbacks - * together, as a single EventRegistration. Though currently we don't do that. - */ -export interface EventRegistration { - /** - * True if this container has a callback to trigger for this event type - */ - respondsTo(eventType: string): boolean; - createEvent(change: Change, query: QueryContext): Event; - /** - * Given event data, return a function to trigger the user's callback - */ - getEventRunner(eventData: Event): () => void; - createCancelEvent(error: Error, path: Path): CancelEvent | null; - matches(other: EventRegistration): boolean; - /** - * False basically means this is a "dummy" callback container being used as a sentinel - * to remove all callback containers of a particular type. (e.g. if the user does - * ref.off('value') without specifying a specific callback). - * - * (TODO: Rework this, since it's hacky) - * - */ - hasAnyCallback(): boolean; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/view/QueryParams.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/view/QueryParams.d.ts deleted file mode 100644 index 36e06874..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/view/QueryParams.d.ts +++ /dev/null @@ -1,97 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { Index } from '../snap/indexes/Index'; -import { PriorityIndex } from '../snap/indexes/PriorityIndex'; -import { NodeFilter } from './filter/NodeFilter'; -/** - * This class is an immutable-from-the-public-api struct containing a set of query parameters defining a - * range to be returned for a particular location. It is assumed that validation of parameters is done at the - * user-facing API level, so it is not done here. - * - * @internal - */ -export declare class QueryParams { - limitSet_: boolean; - startSet_: boolean; - startNameSet_: boolean; - startAfterSet_: boolean; - endSet_: boolean; - endNameSet_: boolean; - endBeforeSet_: boolean; - limit_: number; - viewFrom_: string; - indexStartValue_: unknown | null; - indexStartName_: string; - indexEndValue_: unknown | null; - indexEndName_: string; - index_: PriorityIndex; - hasStart(): boolean; - hasStartAfter(): boolean; - hasEndBefore(): boolean; - /** - * @returns True if it would return from left. - */ - isViewFromLeft(): boolean; - /** - * Only valid to call if hasStart() returns true - */ - getIndexStartValue(): unknown; - /** - * Only valid to call if hasStart() returns true. - * Returns the starting key name for the range defined by these query parameters - */ - getIndexStartName(): string; - hasEnd(): boolean; - /** - * Only valid to call if hasEnd() returns true. - */ - getIndexEndValue(): unknown; - /** - * Only valid to call if hasEnd() returns true. - * Returns the end key name for the range defined by these query parameters - */ - getIndexEndName(): string; - hasLimit(): boolean; - /** - * @returns True if a limit has been set and it has been explicitly anchored - */ - hasAnchoredLimit(): boolean; - /** - * Only valid to call if hasLimit() returns true - */ - getLimit(): number; - getIndex(): Index; - loadsAllData(): boolean; - isDefault(): boolean; - copy(): QueryParams; -} -export declare function queryParamsGetNodeFilter(queryParams: QueryParams): NodeFilter; -export declare function queryParamsLimit(queryParams: QueryParams, newLimit: number): QueryParams; -export declare function queryParamsLimitToFirst(queryParams: QueryParams, newLimit: number): QueryParams; -export declare function queryParamsLimitToLast(queryParams: QueryParams, newLimit: number): QueryParams; -export declare function queryParamsStartAt(queryParams: QueryParams, indexValue: unknown, key?: string | null): QueryParams; -export declare function queryParamsStartAfter(queryParams: QueryParams, indexValue: unknown, key?: string | null): QueryParams; -export declare function queryParamsEndAt(queryParams: QueryParams, indexValue: unknown, key?: string | null): QueryParams; -export declare function queryParamsEndBefore(queryParams: QueryParams, indexValue: unknown, key?: string | null): QueryParams; -export declare function queryParamsOrderBy(queryParams: QueryParams, index: Index): QueryParams; -/** - * Returns a set of REST query string parameters representing this query. - * - * @returns query string parameters - */ -export declare function queryParamsToRestQueryStringParameters(queryParams: QueryParams): Record; -export declare function queryParamsGetQueryObject(queryParams: QueryParams): Record; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/view/View.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/view/View.d.ts deleted file mode 100644 index 18168be6..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/view/View.d.ts +++ /dev/null @@ -1,59 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { Operation } from '../operation/Operation'; -import { Node } from '../snap/Node'; -import { Path } from '../util/Path'; -import { WriteTreeRef } from '../WriteTree'; -import { Event } from './Event'; -import { EventGenerator } from './EventGenerator'; -import { EventRegistration, QueryContext } from './EventRegistration'; -import { ViewCache } from './ViewCache'; -import { ViewProcessor } from './ViewProcessor'; -/** - * A view represents a specific location and query that has 1 or more event registrations. - * - * It does several things: - * - Maintains the list of event registrations for this location/query. - * - Maintains a cache of the data visible for this location/query. - * - Applies new operations (via applyOperation), updates the cache, and based on the event - * registrations returns the set of events to be raised. - */ -export declare class View { - private query_; - processor_: ViewProcessor; - viewCache_: ViewCache; - eventRegistrations_: EventRegistration[]; - eventGenerator_: EventGenerator; - constructor(query_: QueryContext, initialViewCache: ViewCache); - get query(): QueryContext; -} -export declare function viewGetServerCache(view: View): Node | null; -export declare function viewGetCompleteNode(view: View): Node | null; -export declare function viewGetCompleteServerCache(view: View, path: Path): Node | null; -export declare function viewIsEmpty(view: View): boolean; -export declare function viewAddEventRegistration(view: View, eventRegistration: EventRegistration): void; -/** - * @param eventRegistration - If null, remove all callbacks. - * @param cancelError - If a cancelError is provided, appropriate cancel events will be returned. - * @returns Cancel events, if cancelError was provided. - */ -export declare function viewRemoveEventRegistration(view: View, eventRegistration: EventRegistration | null, cancelError?: Error): Event[]; -/** - * Applies the given Operation, updates our cache, and returns the appropriate events. - */ -export declare function viewApplyOperation(view: View, operation: Operation, writesCache: WriteTreeRef, completeServerCache: Node | null): Event[]; -export declare function viewGetInitialEvents(view: View, registration: EventRegistration): Event[]; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/view/ViewCache.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/view/ViewCache.d.ts deleted file mode 100644 index 99ab270a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/view/ViewCache.d.ts +++ /dev/null @@ -1,32 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { Node } from '../snap/Node'; -import { CacheNode } from './CacheNode'; -/** - * Stores the data we have cached for a view. - * - * serverSnap is the cached server data, eventSnap is the cached event data (server data plus any local writes). - */ -export interface ViewCache { - readonly eventCache: CacheNode; - readonly serverCache: CacheNode; -} -export declare function newViewCache(eventCache: CacheNode, serverCache: CacheNode): ViewCache; -export declare function viewCacheUpdateEventSnap(viewCache: ViewCache, eventSnap: Node, complete: boolean, filtered: boolean): ViewCache; -export declare function viewCacheUpdateServerSnap(viewCache: ViewCache, serverSnap: Node, complete: boolean, filtered: boolean): ViewCache; -export declare function viewCacheGetCompleteEventSnap(viewCache: ViewCache): Node | null; -export declare function viewCacheGetCompleteServerSnap(viewCache: ViewCache): Node | null; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/view/ViewProcessor.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/view/ViewProcessor.d.ts deleted file mode 100644 index 5387b4f2..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/view/ViewProcessor.d.ts +++ /dev/null @@ -1,32 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { Operation } from '../operation/Operation'; -import { Node } from '../snap/Node'; -import { WriteTreeRef } from '../WriteTree'; -import { Change } from './Change'; -import { NodeFilter } from './filter/NodeFilter'; -import { ViewCache } from './ViewCache'; -export interface ProcessorResult { - readonly viewCache: ViewCache; - readonly changes: Change[]; -} -export interface ViewProcessor { - readonly filter: NodeFilter; -} -export declare function newViewProcessor(filter: NodeFilter): ViewProcessor; -export declare function viewProcessorAssertIndexed(viewProcessor: ViewProcessor, viewCache: ViewCache): void; -export declare function viewProcessorApplyOperation(viewProcessor: ViewProcessor, oldViewCache: ViewCache, operation: Operation, writesCache: WriteTreeRef, completeCache: Node | null): ProcessorResult; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/view/filter/IndexedFilter.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/view/filter/IndexedFilter.d.ts deleted file mode 100644 index 6c1b498b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/view/filter/IndexedFilter.d.ts +++ /dev/null @@ -1,35 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { Index } from '../../snap/indexes/Index'; -import { Node } from '../../snap/Node'; -import { Path } from '../../util/Path'; -import { ChildChangeAccumulator } from '../ChildChangeAccumulator'; -import { CompleteChildSource } from '../CompleteChildSource'; -import { NodeFilter } from './NodeFilter'; -/** - * Doesn't really filter nodes but applies an index to the node and keeps track of any changes - */ -export declare class IndexedFilter implements NodeFilter { - private readonly index_; - constructor(index_: Index); - updateChild(snap: Node, key: string, newChild: Node, affectedPath: Path, source: CompleteChildSource, optChangeAccumulator: ChildChangeAccumulator | null): Node; - updateFullNode(oldSnap: Node, newSnap: Node, optChangeAccumulator: ChildChangeAccumulator | null): Node; - updatePriority(oldSnap: Node, newPriority: Node): Node; - filtersNodes(): boolean; - getIndexedFilter(): IndexedFilter; - getIndex(): Index; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/view/filter/LimitedFilter.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/view/filter/LimitedFilter.d.ts deleted file mode 100644 index 8074c2b8..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/view/filter/LimitedFilter.d.ts +++ /dev/null @@ -1,41 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { Index } from '../../snap/indexes/Index'; -import { Node } from '../../snap/Node'; -import { Path } from '../../util/Path'; -import { ChildChangeAccumulator } from '../ChildChangeAccumulator'; -import { CompleteChildSource } from '../CompleteChildSource'; -import { QueryParams } from '../QueryParams'; -import { IndexedFilter } from './IndexedFilter'; -import { NodeFilter } from './NodeFilter'; -/** - * Applies a limit and a range to a node and uses RangedFilter to do the heavy lifting where possible - */ -export declare class LimitedFilter implements NodeFilter { - private readonly rangedFilter_; - private readonly index_; - private readonly limit_; - private readonly reverse_; - constructor(params: QueryParams); - updateChild(snap: Node, key: string, newChild: Node, affectedPath: Path, source: CompleteChildSource, optChangeAccumulator: ChildChangeAccumulator | null): Node; - updateFullNode(oldSnap: Node, newSnap: Node, optChangeAccumulator: ChildChangeAccumulator | null): Node; - updatePriority(oldSnap: Node, newPriority: Node): Node; - filtersNodes(): boolean; - getIndexedFilter(): IndexedFilter; - getIndex(): Index; - private fullLimitUpdateChild_; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/view/filter/NodeFilter.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/view/filter/NodeFilter.d.ts deleted file mode 100644 index c9206bd1..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/view/filter/NodeFilter.d.ts +++ /dev/null @@ -1,54 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { Index } from '../../snap/indexes/Index'; -import { Node } from '../../snap/Node'; -import { Path } from '../../util/Path'; -import { ChildChangeAccumulator } from '../ChildChangeAccumulator'; -import { CompleteChildSource } from '../CompleteChildSource'; -/** - * NodeFilter is used to update nodes and complete children of nodes while applying queries on the fly and keeping - * track of any child changes. This class does not track value changes as value changes depend on more - * than just the node itself. Different kind of queries require different kind of implementations of this interface. - * @interface - */ -export interface NodeFilter { - /** - * Update a single complete child in the snap. If the child equals the old child in the snap, this is a no-op. - * The method expects an indexed snap. - */ - updateChild(snap: Node, key: string, newChild: Node, affectedPath: Path, source: CompleteChildSource, optChangeAccumulator: ChildChangeAccumulator | null): Node; - /** - * Update a node in full and output any resulting change from this complete update. - */ - updateFullNode(oldSnap: Node, newSnap: Node, optChangeAccumulator: ChildChangeAccumulator | null): Node; - /** - * Update the priority of the root node - */ - updatePriority(oldSnap: Node, newPriority: Node): Node; - /** - * Returns true if children might be filtered due to query criteria - */ - filtersNodes(): boolean; - /** - * Returns the index filter that this filter uses to get a NodeFilter that doesn't filter any children. - */ - getIndexedFilter(): NodeFilter; - /** - * Returns the index that this filter uses - */ - getIndex(): Index; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/view/filter/RangedFilter.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/view/filter/RangedFilter.d.ts deleted file mode 100644 index 871383f8..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/core/view/filter/RangedFilter.d.ts +++ /dev/null @@ -1,45 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { NamedNode, Node } from '../../../core/snap/Node'; -import { Index } from '../../snap/indexes/Index'; -import { Path } from '../../util/Path'; -import { ChildChangeAccumulator } from '../ChildChangeAccumulator'; -import { CompleteChildSource } from '../CompleteChildSource'; -import { QueryParams } from '../QueryParams'; -import { IndexedFilter } from './IndexedFilter'; -import { NodeFilter } from './NodeFilter'; -/** - * Filters nodes by range and uses an IndexFilter to track any changes after filtering the node - */ -export declare class RangedFilter implements NodeFilter { - private indexedFilter_; - private index_; - private startPost_; - private endPost_; - constructor(params: QueryParams); - getStartPost(): NamedNode; - getEndPost(): NamedNode; - matches(node: NamedNode): boolean; - updateChild(snap: Node, key: string, newChild: Node, affectedPath: Path, source: CompleteChildSource, optChangeAccumulator: ChildChangeAccumulator | null): Node; - updateFullNode(oldSnap: Node, newSnap: Node, optChangeAccumulator: ChildChangeAccumulator | null): Node; - updatePriority(oldSnap: Node, newPriority: Node): Node; - filtersNodes(): boolean; - getIndexedFilter(): IndexedFilter; - getIndex(): Index; - private static getStartPost_; - private static getEndPost_; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/index.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/index.d.ts deleted file mode 100644 index 45017d76..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/index.d.ts +++ /dev/null @@ -1,28 +0,0 @@ -/** - * Firebase Realtime Database - * - * @packageDocumentation - */ -/** - * @license - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { Database } from './api/Database'; -export * from './api'; -declare module '@firebase/component' { - interface NameServiceMapping { - 'database': Database; - } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/index.node.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/index.node.d.ts deleted file mode 100644 index 13debbdc..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/index.node.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * @license - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export * from './api'; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/index.standalone.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/index.standalone.d.ts deleted file mode 100644 index b272041c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/index.standalone.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * @license - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export * from './api.standalone'; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/realtime/BrowserPollConnection.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/realtime/BrowserPollConnection.d.ts deleted file mode 100644 index 85fe5c4b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/realtime/BrowserPollConnection.d.ts +++ /dev/null @@ -1,198 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { RepoInfo } from '../core/RepoInfo'; -import { PacketReceiver } from './polling/PacketReceiver'; -import { Transport } from './Transport'; -export declare const FIREBASE_LONGPOLL_START_PARAM = "start"; -export declare const FIREBASE_LONGPOLL_CLOSE_COMMAND = "close"; -export declare const FIREBASE_LONGPOLL_COMMAND_CB_NAME = "pLPCommand"; -export declare const FIREBASE_LONGPOLL_DATA_CB_NAME = "pRTLPCB"; -export declare const FIREBASE_LONGPOLL_ID_PARAM = "id"; -export declare const FIREBASE_LONGPOLL_PW_PARAM = "pw"; -export declare const FIREBASE_LONGPOLL_SERIAL_PARAM = "ser"; -export declare const FIREBASE_LONGPOLL_CALLBACK_ID_PARAM = "cb"; -export declare const FIREBASE_LONGPOLL_SEGMENT_NUM_PARAM = "seg"; -export declare const FIREBASE_LONGPOLL_SEGMENTS_IN_PACKET = "ts"; -export declare const FIREBASE_LONGPOLL_DATA_PARAM = "d"; -export declare const FIREBASE_LONGPOLL_DISCONN_FRAME_PARAM = "disconn"; -export declare const FIREBASE_LONGPOLL_DISCONN_FRAME_REQUEST_PARAM = "dframe"; -/** - * This class manages a single long-polling connection. - */ -export declare class BrowserPollConnection implements Transport { - connId: string; - repoInfo: RepoInfo; - private applicationId?; - private appCheckToken?; - private authToken?; - transportSessionId?: string; - lastSessionId?: string; - bytesSent: number; - bytesReceived: number; - urlFn: (params: object) => string; - scriptTagHolder: FirebaseIFrameScriptHolder; - myDisconnFrame: HTMLIFrameElement; - curSegmentNum: number; - myPacketOrderer: PacketReceiver; - id: string; - password: string; - private log_; - private stats_; - private everConnected_; - private isClosed_; - private connectTimeoutTimer_; - private onDisconnect_; - /** - * @param connId An identifier for this connection, used for logging - * @param repoInfo The info for the endpoint to send data to. - * @param applicationId The Firebase App ID for this project. - * @param appCheckToken The AppCheck token for this client. - * @param authToken The AuthToken to use for this connection. - * @param transportSessionId Optional transportSessionid if we are - * reconnecting for an existing transport session - * @param lastSessionId Optional lastSessionId if the PersistentConnection has - * already created a connection previously - */ - constructor(connId: string, repoInfo: RepoInfo, applicationId?: string, appCheckToken?: string, authToken?: string, transportSessionId?: string, lastSessionId?: string); - /** - * @param onMessage - Callback when messages arrive - * @param onDisconnect - Callback with connection lost. - */ - open(onMessage: (msg: {}) => void, onDisconnect: (a?: boolean) => void): void; - /** - * Call this when a handshake has completed successfully and we want to consider the connection established - */ - start(): void; - static forceAllow_: boolean; - /** - * Forces long polling to be considered as a potential transport - */ - static forceAllow(): void; - static forceDisallow_: boolean; - /** - * Forces longpolling to not be considered as a potential transport - */ - static forceDisallow(): void; - static isAvailable(): boolean; - /** - * No-op for polling - */ - markConnectionHealthy(): void; - /** - * Stops polling and cleans up the iframe - */ - private shutdown_; - /** - * Triggered when this transport is closed - */ - private onClosed_; - /** - * External-facing close handler. RealTime has requested we shut down. Kill our connection and tell the server - * that we've left. - */ - close(): void; - /** - * Send the JSON object down to the server. It will need to be stringified, base64 encoded, and then - * broken into chunks (since URLs have a small maximum length). - * @param data - The JSON data to transmit. - */ - send(data: {}): void; - /** - * This is how we notify the server that we're leaving. - * We aren't able to send requests with DHTML on a window close event, but we can - * trigger XHR requests in some browsers (everything but Opera basically). - */ - addDisconnectPingFrame(id: string, pw: string): void; - /** - * Used to track the bytes received by this client - */ - private incrementIncomingBytes_; -} -export interface IFrameElement extends HTMLIFrameElement { - doc: Document; -} -/********************************************************************************************* - * A wrapper around an iframe that is used as a long-polling script holder. - *********************************************************************************************/ -export declare class FirebaseIFrameScriptHolder { - onDisconnect: () => void; - urlFn: (a: object) => string; - outstandingRequests: Set; - pendingSegs: Array<{ - seg: number; - ts: number; - d: unknown; - }>; - currentSerial: number; - sendNewPolls: boolean; - uniqueCallbackIdentifier: number; - myIFrame: IFrameElement; - alive: boolean; - myID: string; - myPW: string; - commandCB: (command: string, ...args: unknown[]) => void; - onMessageCB: (...args: unknown[]) => void; - /** - * @param commandCB - The callback to be called when control commands are recevied from the server. - * @param onMessageCB - The callback to be triggered when responses arrive from the server. - * @param onDisconnect - The callback to be triggered when this tag holder is closed - * @param urlFn - A function that provides the URL of the endpoint to send data to. - */ - constructor(commandCB: (command: string, ...args: unknown[]) => void, onMessageCB: (...args: unknown[]) => void, onDisconnect: () => void, urlFn: (a: object) => string); - /** - * Each browser has its own funny way to handle iframes. Here we mush them all together into one object that I can - * actually use. - */ - private static createIFrame_; - /** - * Cancel all outstanding queries and remove the frame. - */ - close(): void; - /** - * Actually start the long-polling session by adding the first script tag(s) to the iframe. - * @param id - The ID of this connection - * @param pw - The password for this connection - */ - startLongPoll(id: string, pw: string): void; - /** - * This is called any time someone might want a script tag to be added. It adds a script tag when there aren't - * too many outstanding requests and we are still alive. - * - * If there are outstanding packet segments to send, it sends one. If there aren't, it sends a long-poll anyways if - * needed. - */ - private newRequest_; - /** - * Queue a packet for transmission to the server. - * @param segnum - A sequential id for this packet segment used for reassembly - * @param totalsegs - The total number of segments in this packet - * @param data - The data for this segment. - */ - enqueueSegment(segnum: number, totalsegs: number, data: unknown): void; - /** - * Add a script tag for a regular long-poll request. - * @param url - The URL of the script tag. - * @param serial - The serial number of the request. - */ - private addLongPollTag_; - /** - * Add an arbitrary script tag to the iframe. - * @param url - The URL for the script tag source. - * @param loadCB - A callback to be triggered once the script has loaded. - */ - addTag(url: string, loadCB: () => void): void; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/realtime/Connection.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/realtime/Connection.d.ts deleted file mode 100644 index 43493688..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/realtime/Connection.d.ts +++ /dev/null @@ -1,102 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { RepoInfo } from '../core/RepoInfo'; -/** - * Creates a new real-time connection to the server using whichever method works - * best in the current browser. - */ -export declare class Connection { - id: string; - private repoInfo_; - private applicationId_; - private appCheckToken_; - private authToken_; - private onMessage_; - private onReady_; - private onDisconnect_; - private onKill_; - lastSessionId?: string; - connectionCount: number; - pendingDataMessages: unknown[]; - sessionId: string; - private conn_; - private healthyTimeout_; - private isHealthy_; - private log_; - private primaryResponsesRequired_; - private rx_; - private secondaryConn_; - private secondaryResponsesRequired_; - private state_; - private transportManager_; - private tx_; - /** - * @param id - an id for this connection - * @param repoInfo_ - the info for the endpoint to connect to - * @param applicationId_ - the Firebase App ID for this project - * @param appCheckToken_ - The App Check Token for this device. - * @param authToken_ - The auth token for this session. - * @param onMessage_ - the callback to be triggered when a server-push message arrives - * @param onReady_ - the callback to be triggered when this connection is ready to send messages. - * @param onDisconnect_ - the callback to be triggered when a connection was lost - * @param onKill_ - the callback to be triggered when this connection has permanently shut down. - * @param lastSessionId - last session id in persistent connection. is used to clean up old session in real-time server - */ - constructor(id: string, repoInfo_: RepoInfo, applicationId_: string | undefined, appCheckToken_: string | undefined, authToken_: string | undefined, onMessage_: (a: {}) => void, onReady_: (a: number, b: string) => void, onDisconnect_: () => void, onKill_: (a: string) => void, lastSessionId?: string); - /** - * Starts a connection attempt - */ - private start_; - private nextTransportId_; - private disconnReceiver_; - private connReceiver_; - /** - * @param dataMsg - An arbitrary data message to be sent to the server - */ - sendRequest(dataMsg: object): void; - tryCleanupConnection(): void; - private onSecondaryControl_; - private onSecondaryMessageReceived_; - private upgradeIfSecondaryHealthy_; - private proceedWithUpgrade_; - private onPrimaryMessageReceived_; - private onDataMessage_; - private onPrimaryResponse_; - private onControl_; - /** - * @param handshake - The handshake data returned from the server - */ - private onHandshake_; - private tryStartUpgrade_; - private startUpgrade_; - private onReset_; - private onConnectionEstablished_; - private sendPingOnPrimaryIfNecessary_; - private onSecondaryConnectionLost_; - /** - * @param everConnected - Whether or not the connection ever reached a server. Used to determine if - * we should flush the host cache - */ - private onConnectionLost_; - private onConnectionShutdown_; - private sendData_; - /** - * Cleans up this connection, calling the appropriate callbacks - */ - close(): void; - private closeConnections_; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/realtime/Constants.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/realtime/Constants.d.ts deleted file mode 100644 index 7d1785e2..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/realtime/Constants.d.ts +++ /dev/null @@ -1,27 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export declare const PROTOCOL_VERSION = "5"; -export declare const VERSION_PARAM = "v"; -export declare const TRANSPORT_SESSION_PARAM = "s"; -export declare const REFERER_PARAM = "r"; -export declare const FORGE_REF = "f"; -export declare const FORGE_DOMAIN_RE: RegExp; -export declare const LAST_SESSION_PARAM = "ls"; -export declare const APPLICATION_ID_PARAM = "p"; -export declare const APP_CHECK_TOKEN_PARAM = "ac"; -export declare const WEBSOCKET = "websocket"; -export declare const LONG_POLLING = "long_polling"; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/realtime/Transport.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/realtime/Transport.d.ts deleted file mode 100644 index eb0055fc..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/realtime/Transport.d.ts +++ /dev/null @@ -1,58 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { RepoInfo } from '../core/RepoInfo'; -export interface TransportConstructor { - new (connId: string, repoInfo: RepoInfo, applicationId?: string, appCheckToken?: string, authToken?: string, transportSessionId?: string, lastSessionId?: string): Transport; - isAvailable: () => boolean; - responsesRequiredToBeHealthy?: number; - healthyTimeout?: number; -} -export declare abstract class Transport { - /** - * Bytes received since connection started. - */ - abstract bytesReceived: number; - /** - * Bytes sent since connection started. - */ - abstract bytesSent: number; - /** - * An identifier for this connection, used for logging - */ - abstract connId: string; - /** - * @param connId - An identifier for this connection, used for logging - * @param repoInfo - The info for the endpoint to send data to. - * @param transportSessionId - Optional transportSessionId if this is connecting to an existing transport session - * @param lastSessionId - Optional lastSessionId if there was a previous connection - * @interface - */ - constructor(connId: string, repoInfo: RepoInfo, transportSessionId?: string, lastSessionId?: string); - /** - * @param onMessage - Callback when messages arrive - * @param onDisconnect - Callback with connection lost. - */ - abstract open(onMessage: (a: {}) => void, onDisconnect: (a?: boolean) => void): void; - abstract start(): void; - abstract close(): void; - /** - * @param data - The JSON data to transmit - */ - abstract send(data: {}): void; - abstract markConnectionHealthy(): void; - abstract markConnectionHealthy(): void; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/realtime/TransportManager.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/realtime/TransportManager.d.ts deleted file mode 100644 index 39d637bd..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/realtime/TransportManager.d.ts +++ /dev/null @@ -1,50 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { RepoInfo } from '../core/RepoInfo'; -import { BrowserPollConnection } from './BrowserPollConnection'; -import { TransportConstructor } from './Transport'; -import { WebSocketConnection } from './WebSocketConnection'; -/** - * Currently simplistic, this class manages what transport a Connection should use at various stages of its - * lifecycle. - * - * It starts with longpolling in a browser, and httppolling on node. It then upgrades to websockets if - * they are available. - */ -export declare class TransportManager { - private transports_; - static globalTransportInitialized_: boolean; - static get ALL_TRANSPORTS(): (typeof BrowserPollConnection | typeof WebSocketConnection)[]; - /** - * Returns whether transport has been selected to ensure WebSocketConnection or BrowserPollConnection are not called after - * TransportManager has already set up transports_ - */ - static get IS_TRANSPORT_INITIALIZED(): boolean; - /** - * @param repoInfo - Metadata around the namespace we're connecting to - */ - constructor(repoInfo: RepoInfo); - private initTransports_; - /** - * @returns The constructor for the initial transport to use - */ - initialTransport(): TransportConstructor; - /** - * @returns The constructor for the next transport, or null - */ - upgradeTransport(): TransportConstructor | null; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/realtime/WebSocketConnection.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/realtime/WebSocketConnection.d.ts deleted file mode 100644 index 1f280b96..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/realtime/WebSocketConnection.d.ts +++ /dev/null @@ -1,127 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { RepoInfo } from '../core/RepoInfo'; -import { Transport } from './Transport'; -export declare function setWebSocketImpl(impl: any): void; -/** - * Create a new websocket connection with the given callbacks. - */ -export declare class WebSocketConnection implements Transport { - connId: string; - private applicationId?; - private appCheckToken?; - private authToken?; - keepaliveTimer: number | null; - frames: string[] | null; - totalFrames: number; - bytesSent: number; - bytesReceived: number; - connURL: string; - onDisconnect: (a?: boolean) => void; - onMessage: (msg: {}) => void; - mySock: WebSocket | null; - private log_; - private stats_; - private everConnected_; - private isClosed_; - private nodeAdmin; - /** - * @param connId identifier for this transport - * @param repoInfo The info for the websocket endpoint. - * @param applicationId The Firebase App ID for this project. - * @param appCheckToken The App Check Token for this client. - * @param authToken The Auth Token for this client. - * @param transportSessionId Optional transportSessionId if this is connecting - * to an existing transport session - * @param lastSessionId Optional lastSessionId if there was a previous - * connection - */ - constructor(connId: string, repoInfo: RepoInfo, applicationId?: string, appCheckToken?: string, authToken?: string, transportSessionId?: string, lastSessionId?: string); - /** - * @param repoInfo - The info for the websocket endpoint. - * @param transportSessionId - Optional transportSessionId if this is connecting to an existing transport - * session - * @param lastSessionId - Optional lastSessionId if there was a previous connection - * @returns connection url - */ - private static connectionURL_; - /** - * @param onMessage - Callback when messages arrive - * @param onDisconnect - Callback with connection lost. - */ - open(onMessage: (msg: {}) => void, onDisconnect: (a?: boolean) => void): void; - /** - * No-op for websockets, we don't need to do anything once the connection is confirmed as open - */ - start(): void; - static forceDisallow_: boolean; - static forceDisallow(): void; - static isAvailable(): boolean; - /** - * Number of response before we consider the connection "healthy." - */ - static responsesRequiredToBeHealthy: number; - /** - * Time to wait for the connection te become healthy before giving up. - */ - static healthyTimeout: number; - /** - * Returns true if we previously failed to connect with this transport. - */ - static previouslyFailed(): boolean; - markConnectionHealthy(): void; - private appendFrame_; - /** - * @param frameCount - The number of frames we are expecting from the server - */ - private handleNewFrameCount_; - /** - * Attempts to parse a frame count out of some text. If it can't, assumes a value of 1 - * @returns Any remaining data to be process, or null if there is none - */ - private extractFrameCount_; - /** - * Process a websocket frame that has arrived from the server. - * @param mess - The frame data - */ - handleIncomingFrame(mess: { - [k: string]: unknown; - }): void; - /** - * Send a message to the server - * @param data - The JSON object to transmit - */ - send(data: {}): void; - private shutdown_; - private onClosed_; - /** - * External-facing close handler. - * Close the websocket and kill the connection. - */ - close(): void; - /** - * Kill the current keepalive timer and start a new one, to ensure that it always fires N seconds after - * the last activity. - */ - resetKeepAlive(): void; - /** - * Send a string over the websocket. - * - * @param str - String to send. - */ - private sendString_; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/realtime/polling/PacketReceiver.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/realtime/polling/PacketReceiver.d.ts deleted file mode 100644 index f756f7fc..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/realtime/polling/PacketReceiver.d.ts +++ /dev/null @@ -1,38 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * This class ensures the packets from the server arrive in order - * This class takes data from the server and ensures it gets passed into the callbacks in order. - */ -export declare class PacketReceiver { - private onMessage_; - pendingResponses: unknown[]; - currentResponseNum: number; - closeAfterResponse: number; - onClose: (() => void) | null; - /** - * @param onMessage_ - */ - constructor(onMessage_: (a: {}) => void); - closeAfter(responseNum: number, callback: () => void): void; - /** - * Each message from the server comes with a response number, and an array of data. The responseNumber - * allows us to ensure that we process them in the right order, since we can't be guaranteed that all - * browsers will respond in the same order as the requests we sent - */ - handleResponse(requestNum: number, data: unknown[]): void; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/register.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/register.d.ts deleted file mode 100644 index d7e0e6ab..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/src/register.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare function registerDatabase(variant?: string): void; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/test/compound_write.test.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/test/compound_write.test.d.ts deleted file mode 100644 index cd6aeb9b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/test/compound_write.test.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export {}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/test/connection.test.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/test/connection.test.d.ts deleted file mode 100644 index cd6aeb9b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/test/connection.test.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export {}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/test/deno.test.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/test/deno.test.d.ts deleted file mode 100644 index b39bcc63..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/test/deno.test.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * @license - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export {}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/test/exp/integration.test.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/test/exp/integration.test.d.ts deleted file mode 100644 index 0365dec9..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/test/exp/integration.test.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export declare function createTestApp(): import("@firebase/app").FirebaseApp; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/test/helpers/EventAccumulator.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/test/helpers/EventAccumulator.d.ts deleted file mode 100644 index cf2fe26d..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/test/helpers/EventAccumulator.d.ts +++ /dev/null @@ -1,35 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export declare const EventAccumulatorFactory: { - waitsForCount: (maxCount: any) => EventAccumulator; - waitsForExactCount: (maxCount: any) => EventAccumulator; -}; -export declare class EventAccumulator { - condition: Function; - eventData: any[]; - promise: any; - resolve: any; - reject: any; - private onResetFxn; - private onEventFxn; - constructor(condition: Function); - addEvent(eventData?: any): void; - reset(condition?: Function): void; - onEvent(cb: Function): void; - onReset(cb: Function): void; - _testCondition(): any; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/test/helpers/syncpoint-util.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/test/helpers/syncpoint-util.d.ts deleted file mode 100644 index 17c9e364..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/test/helpers/syncpoint-util.d.ts +++ /dev/null @@ -1,29 +0,0 @@ -/** - * @license - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { FirebaseApp } from '@firebase/app'; -import { ListenProvider } from '../../src/core/SyncTree'; -import { Path } from '../../src/core/util/Path'; -export declare class SyncPointTestParser { - app: FirebaseApp; - listens_: any; - listenProvider_: ListenProvider; - private syncTree_; - constructor(); - getTestPath(optBasePath: string | string[], path?: string): Path; - private testRunner; - defineTest(spec: any): void; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/test/helpers/util.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/test/helpers/util.d.ts deleted file mode 100644 index 28bfbd2b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/test/helpers/util.d.ts +++ /dev/null @@ -1,34 +0,0 @@ -/** - * @license - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { Database, DatabaseReference } from '../../src'; -import { Path } from '../../src/core/util/Path'; -import { EventAccumulator } from './EventAccumulator'; -export declare const TEST_PROJECT: any; -export declare function getFreshRepo(path: Path): DatabaseReference; -export declare const DATABASE_ADDRESS: any; -export declare const DATABASE_URL: any; -export declare function testRepoInfo(url: any): import("../../src/core/RepoInfo").RepoInfo; -export declare function repoInfoForConnectionTest(): import("../../src/core/RepoInfo").RepoInfo; -export declare function shuffle(arr: any, randFn?: () => number): void; -export declare function waitFor(waitTimeInMS: number): Promise; -export declare function getUniqueRef(db: Database): DatabaseReference; -export declare function getRWRefs(db: Database): { - readerRef: DatabaseReference; - writerRef: DatabaseReference; -}; -export declare function writeAndValidate(writerRef: DatabaseReference, readerRef: DatabaseReference, toWrite: unknown, ec: EventAccumulator): Promise; -export declare function waitUntil(cb: () => boolean, maxRetries?: number): Promise; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/test/node.test.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/test/node.test.d.ts deleted file mode 100644 index cd6aeb9b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/test/node.test.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export {}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/test/parser.test.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/test/parser.test.d.ts deleted file mode 100644 index b39bcc63..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/test/parser.test.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * @license - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export {}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/test/path.test.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/test/path.test.d.ts deleted file mode 100644 index cd6aeb9b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/test/path.test.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export {}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/test/pushid.test.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/test/pushid.test.d.ts deleted file mode 100644 index d92ca4eb..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/test/pushid.test.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * @license - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export {}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/test/repoinfo.test.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/test/repoinfo.test.d.ts deleted file mode 100644 index cd6aeb9b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/test/repoinfo.test.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export {}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/test/sortedmap.test.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/test/sortedmap.test.d.ts deleted file mode 100644 index cd6aeb9b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/test/sortedmap.test.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export {}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/test/sparsesnapshottree.test.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/test/sparsesnapshottree.test.d.ts deleted file mode 100644 index cd6aeb9b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/test/sparsesnapshottree.test.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export {}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/test/syncpoint.test.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/test/syncpoint.test.d.ts deleted file mode 100644 index b39bcc63..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/test/syncpoint.test.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * @license - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export {}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/test/transport.test.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/test/transport.test.d.ts deleted file mode 100644 index b39bcc63..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/test/transport.test.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * @license - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export {}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/test/websocketconnection.test.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/test/websocketconnection.test.d.ts deleted file mode 100644 index b39bcc63..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/node-esm/test/websocketconnection.test.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * @license - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export {}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/private.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/private.d.ts deleted file mode 100644 index 945586d0..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/private.d.ts +++ /dev/null @@ -1,2849 +0,0 @@ -/** - * Firebase Realtime Database - * - * @packageDocumentation - */ - -import { AppCheckInternalComponentName } from '@firebase/app-check-interop-types'; -import { AppCheckTokenListener } from '@firebase/app-check-interop-types'; -import { AppCheckTokenResult } from '@firebase/app-check-interop-types'; -import { EmulatorMockTokenOptions } from '@firebase/util'; -import { FirebaseApp } from '@firebase/app'; -import { FirebaseAuthInternalName } from '@firebase/auth-interop-types'; -import { FirebaseAuthTokenData } from '@firebase/app-types/private'; -import { Provider } from '@firebase/component'; - -/** - * Abstraction around AppCheck's token fetching capabilities. - */ -declare class AppCheckTokenProvider { - private appName_; - private appCheckProvider?; - private appCheck?; - constructor(appName_: string, appCheckProvider?: Provider); - getToken(forceRefresh?: boolean): Promise; - addTokenChangeListener(listener: AppCheckTokenListener): void; - notifyForInvalidToken(): void; -} - -declare interface AuthTokenProvider { - getToken(forceRefresh: boolean): Promise; - addTokenChangeListener(listener: (token: string | null) => void): void; - removeTokenChangeListener(listener: (token: string | null) => void): void; - notifyForInvalidToken(): void; -} - -/** - * A cache node only stores complete children. Additionally it holds a flag whether the node can be considered fully - * initialized in the sense that we know at one point in time this represented a valid state of the world, e.g. - * initialized with data from the server, or a complete overwrite by the client. The filtered flag also tracks - * whether a node potentially had children removed due to a filter. - */ -declare class CacheNode { - private node_; - private fullyInitialized_; - private filtered_; - constructor(node_: Node_2, fullyInitialized_: boolean, filtered_: boolean); - /** - * Returns whether this node was fully initialized with either server data or a complete overwrite by the client - */ - isFullyInitialized(): boolean; - /** - * Returns whether this node is potentially missing children due to a filter applied to the node - */ - isFiltered(): boolean; - isCompleteForPath(path: Path): boolean; - isCompleteForChild(key: string): boolean; - getNode(): Node_2; -} - -declare class CancelEvent implements Event_2 { - eventRegistration: EventRegistration; - error: Error; - path: Path; - constructor(eventRegistration: EventRegistration, error: Error, path: Path); - getPath(): Path; - getEventType(): string; - getEventRunner(): () => void; - toString(): string; -} - -declare interface Change { - /** @param type - The event type */ - type: ChangeType; - /** @param snapshotNode - The data */ - snapshotNode: Node_2; - /** @param childName - The name for this child, if it's a child even */ - childName?: string; - /** @param oldSnap - Used for intermediate processing of child changed events */ - oldSnap?: Node_2; - /** * @param prevName - The name for the previous child, if applicable */ - prevName?: string | null; -} - -declare const enum ChangeType { - /** Event type for a child added */ - CHILD_ADDED = "child_added", - /** Event type for a child removed */ - CHILD_REMOVED = "child_removed", - /** Event type for a child changed */ - CHILD_CHANGED = "child_changed", - /** Event type for a child moved */ - CHILD_MOVED = "child_moved", - /** Event type for a value change */ - VALUE = "value" -} - -/** - * Gets a `Reference` for the location at the specified relative path. - * - * The relative path can either be a simple child name (for example, "ada") or - * a deeper slash-separated path (for example, "ada/name/first"). - * - * @param parent - The parent location. - * @param path - A relative path from this location to the desired child - * location. - * @returns The specified child location. - */ -export declare function child(parent: DatabaseReference, path: string): DatabaseReference; - -declare class ChildChangeAccumulator { - private readonly changeMap; - trackChildChange(change: Change): void; - getChanges(): Change[]; -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * @fileoverview Implementation of an immutable SortedMap using a Left-leaning - * Red-Black Tree, adapted from the implementation in Mugs - * (http://mads379.github.com/mugs/) by Mads Hartmann Jensen - * (mads379\@gmail.com). - * - * Original paper on Left-leaning Red-Black Trees: - * http://www.cs.princeton.edu/~rs/talks/LLRB/LLRB.pdf - * - * Invariant 1: No red node has a red child - * Invariant 2: Every leaf path has the same number of black nodes - * Invariant 3: Only the left child can be red (left leaning) - */ -declare type Comparator = (key1: K, key2: K) => number; - -/** - * Since updates to filtered nodes might require nodes to be pulled in from "outside" the node, this interface - * can help to get complete children that can be pulled in. - * A class implementing this interface takes potentially multiple sources (e.g. user writes, server data from - * other views etc.) to try it's best to get a complete child that might be useful in pulling into the view. - * - * @interface - */ -declare interface CompleteChildSource { - getCompleteChild(childKey: string): Node_2 | null; - getChildAfterChild(index: Index, child: NamedNode, reverse: boolean): NamedNode | null; -} - -/** - * This class holds a collection of writes that can be applied to nodes in unison. It abstracts away the logic with - * dealing with priority writes and multiple nested writes. At any given path there is only allowed to be one write - * modifying that path. Any write to an existing path or shadowing an existing path will modify that existing write - * to reflect the write added. - */ -declare class CompoundWrite { - writeTree_: ImmutableTree; - constructor(writeTree_: ImmutableTree); - static empty(): CompoundWrite; -} - -/** - * Modify the provided instance to communicate with the Realtime Database - * emulator. - * - *

Note: This method must be called before performing any other operation. - * - * @param db - The instance to modify. - * @param host - The emulator host (ex: localhost) - * @param port - The emulator port (ex: 8080) - * @param options.mockUserToken - the mock auth token to use for unit testing Security Rules - */ -export declare function connectDatabaseEmulator(db: Database, host: string, port: number, options?: { - mockUserToken?: EmulatorMockTokenOptions | string; -}): void; - -/** - * Class representing a Firebase Realtime Database. - */ -export declare class Database implements _FirebaseService { - _repoInternal: Repo; - /** The {@link @firebase/app#FirebaseApp} associated with this Realtime Database instance. */ - readonly app: FirebaseApp; - /** Represents a `Database` instance. */ - readonly 'type' = "database"; - /** Track if the instance has been used (root or repo accessed) */ - _instanceStarted: boolean; - /** Backing state for root_ */ - private _rootInternal?; - /** @hideconstructor */ - constructor(_repoInternal: Repo, - /** The {@link @firebase/app#FirebaseApp} associated with this Realtime Database instance. */ - app: FirebaseApp); - get _repo(): Repo; - get _root(): _ReferenceImpl; - _delete(): Promise; - _checkNotDeleted(apiName: string): void; -} - -/** - * A `DatabaseReference` represents a specific location in your Database and can be used - * for reading or writing data to that Database location. - * - * You can reference the root or child location in your Database by calling - * `ref()` or `ref("child/path")`. - * - * Writing is done with the `set()` method and reading can be done with the - * `on*()` method. See {@link - * https://firebase.google.com/docs/database/web/read-and-write} - */ -export declare interface DatabaseReference extends Query { - /** - * The last part of the `DatabaseReference`'s path. - * - * For example, `"ada"` is the key for - * `https://.firebaseio.com/users/ada`. - * - * The key of a root `DatabaseReference` is `null`. - */ - readonly key: string | null; - /** - * The parent location of a `DatabaseReference`. - * - * The parent of a root `DatabaseReference` is `null`. - */ - readonly parent: DatabaseReference | null; - /** The root `DatabaseReference` of the Database. */ - readonly root: DatabaseReference; -} - -/** - * A `DataSnapshot` contains data from a Database location. - * - * Any time you read data from the Database, you receive the data as a - * `DataSnapshot`. A `DataSnapshot` is passed to the event callbacks you attach - * with `on()` or `once()`. You can extract the contents of the snapshot as a - * JavaScript object by calling the `val()` method. Alternatively, you can - * traverse into the snapshot by calling `child()` to return child snapshots - * (which you could then call `val()` on). - * - * A `DataSnapshot` is an efficiently generated, immutable copy of the data at - * a Database location. It cannot be modified and will never change (to modify - * data, you always call the `set()` method on a `Reference` directly). - */ -export declare class DataSnapshot { - readonly _node: Node_2; - /** - * The location of this DataSnapshot. - */ - readonly ref: DatabaseReference; - readonly _index: Index; - /** - * @param _node - A SnapshotNode to wrap. - * @param ref - The location this snapshot came from. - * @param _index - The iteration order for this snapshot - * @hideconstructor - */ - constructor(_node: Node_2, - /** - * The location of this DataSnapshot. - */ - ref: DatabaseReference, _index: Index); - /** - * Gets the priority value of the data in this `DataSnapshot`. - * - * Applications need not use priority but can order collections by - * ordinary properties (see - * {@link https://firebase.google.com/docs/database/web/lists-of-data#sorting_and_filtering_data |Sorting and filtering data} - * ). - */ - get priority(): string | number | null; - /** - * The key (last part of the path) of the location of this `DataSnapshot`. - * - * The last token in a Database location is considered its key. For example, - * "ada" is the key for the /users/ada/ node. Accessing the key on any - * `DataSnapshot` will return the key for the location that generated it. - * However, accessing the key on the root URL of a Database will return - * `null`. - */ - get key(): string | null; - /** Returns the number of child properties of this `DataSnapshot`. */ - get size(): number; - /** - * Gets another `DataSnapshot` for the location at the specified relative path. - * - * Passing a relative path to the `child()` method of a DataSnapshot returns - * another `DataSnapshot` for the location at the specified relative path. The - * relative path can either be a simple child name (for example, "ada") or a - * deeper, slash-separated path (for example, "ada/name/first"). If the child - * location has no data, an empty `DataSnapshot` (that is, a `DataSnapshot` - * whose value is `null`) is returned. - * - * @param path - A relative path to the location of child data. - */ - child(path: string): DataSnapshot; - /** - * Returns true if this `DataSnapshot` contains any data. It is slightly more - * efficient than using `snapshot.val() !== null`. - */ - exists(): boolean; - /** - * Exports the entire contents of the DataSnapshot as a JavaScript object. - * - * The `exportVal()` method is similar to `val()`, except priority information - * is included (if available), making it suitable for backing up your data. - * - * @returns The DataSnapshot's contents as a JavaScript value (Object, - * Array, string, number, boolean, or `null`). - */ - exportVal(): any; - /** - * Enumerates the top-level children in the `DataSnapshot`. - * - * Because of the way JavaScript objects work, the ordering of data in the - * JavaScript object returned by `val()` is not guaranteed to match the - * ordering on the server nor the ordering of `onChildAdded()` events. That is - * where `forEach()` comes in handy. It guarantees the children of a - * `DataSnapshot` will be iterated in their query order. - * - * If no explicit `orderBy*()` method is used, results are returned - * ordered by key (unless priorities are used, in which case, results are - * returned by priority). - * - * @param action - A function that will be called for each child DataSnapshot. - * The callback can return true to cancel further enumeration. - * @returns true if enumeration was canceled due to your callback returning - * true. - */ - forEach(action: (child: DataSnapshot) => boolean | void): boolean; - /** - * Returns true if the specified child path has (non-null) data. - * - * @param path - A relative path to the location of a potential child. - * @returns `true` if data exists at the specified child path; else - * `false`. - */ - hasChild(path: string): boolean; - /** - * Returns whether or not the `DataSnapshot` has any non-`null` child - * properties. - * - * You can use `hasChildren()` to determine if a `DataSnapshot` has any - * children. If it does, you can enumerate them using `forEach()`. If it - * doesn't, then either this snapshot contains a primitive value (which can be - * retrieved with `val()`) or it is empty (in which case, `val()` will return - * `null`). - * - * @returns true if this snapshot has any children; else false. - */ - hasChildren(): boolean; - /** - * Returns a JSON-serializable representation of this object. - */ - toJSON(): object | null; - /** - * Extracts a JavaScript value from a `DataSnapshot`. - * - * Depending on the data in a `DataSnapshot`, the `val()` method may return a - * scalar type (string, number, or boolean), an array, or an object. It may - * also return null, indicating that the `DataSnapshot` is empty (contains no - * data). - * - * @returns The DataSnapshot's contents as a JavaScript value (Object, - * Array, string, number, boolean, or `null`). - */ - val(): any; -} -export { EmulatorMockTokenOptions } - -/** - * Logs debugging information to the console. - * - * @param enabled - Enables logging if `true`, disables logging if `false`. - * @param persistent - Remembers the logging state between page refreshes if - * `true`. - */ -export declare function enableLogging(enabled: boolean, persistent?: boolean): any; - -/** - * Logs debugging information to the console. - * - * @param logger - A custom logger function to control how things get logged. - */ -export declare function enableLogging(logger: (message: string) => unknown): any; - -/** - * Creates a `QueryConstraint` with the specified ending point. - * - * Using `startAt()`, `startAfter()`, `endBefore()`, `endAt()` and `equalTo()` - * allows you to choose arbitrary starting and ending points for your queries. - * - * The ending point is inclusive, so children with exactly the specified value - * will be included in the query. The optional key argument can be used to - * further limit the range of the query. If it is specified, then children that - * have exactly the specified value must also have a key name less than or equal - * to the specified key. - * - * You can read more about `endAt()` in - * {@link https://firebase.google.com/docs/database/web/lists-of-data#filtering_data | Filtering data}. - * - * @param value - The value to end at. The argument type depends on which - * `orderBy*()` function was used in this query. Specify a value that matches - * the `orderBy*()` type. When used in combination with `orderByKey()`, the - * value must be a string. - * @param key - The child key to end at, among the children with the previously - * specified priority. This argument is only allowed if ordering by child, - * value, or priority. - */ -export declare function endAt(value: number | string | boolean | null, key?: string): QueryConstraint; - -/** - * Creates a `QueryConstraint` with the specified ending point (exclusive). - * - * Using `startAt()`, `startAfter()`, `endBefore()`, `endAt()` and `equalTo()` - * allows you to choose arbitrary starting and ending points for your queries. - * - * The ending point is exclusive. If only a value is provided, children - * with a value less than the specified value will be included in the query. - * If a key is specified, then children must have a value less than or equal - * to the specified value and a key name less than the specified key. - * - * @param value - The value to end before. The argument type depends on which - * `orderBy*()` function was used in this query. Specify a value that matches - * the `orderBy*()` type. When used in combination with `orderByKey()`, the - * value must be a string. - * @param key - The child key to end before, among the children with the - * previously specified priority. This argument is only allowed if ordering by - * child, value, or priority. - */ -export declare function endBefore(value: number | string | boolean | null, key?: string): QueryConstraint; - -/** - * Creates a `QueryConstraint` that includes children that match the specified - * value. - * - * Using `startAt()`, `startAfter()`, `endBefore()`, `endAt()` and `equalTo()` - * allows you to choose arbitrary starting and ending points for your queries. - * - * The optional key argument can be used to further limit the range of the - * query. If it is specified, then children that have exactly the specified - * value must also have exactly the specified key as their key name. This can be - * used to filter result sets with many matches for the same value. - * - * You can read more about `equalTo()` in - * {@link https://firebase.google.com/docs/database/web/lists-of-data#filtering_data | Filtering data}. - * - * @param value - The value to match for. The argument type depends on which - * `orderBy*()` function was used in this query. Specify a value that matches - * the `orderBy*()` type. When used in combination with `orderByKey()`, the - * value must be a string. - * @param key - The child key to start at, among the children with the - * previously specified priority. This argument is only allowed if ordering by - * child, value, or priority. - */ -export declare function equalTo(value: number | string | boolean | null, key?: string): QueryConstraint; - -/** - * Encapsulates the data needed to raise an event - * @interface - */ -declare interface Event_2 { - getPath(): Path; - getEventType(): string; - getEventRunner(): () => void; - toString(): string; -} - -/** - * An EventGenerator is used to convert "raw" changes (Change) as computed by the - * CacheDiffer into actual events (Event) that can be raised. See generateEventsForChanges() - * for details. - * - */ -declare class EventGenerator { - query_: QueryContext; - index_: Index; - constructor(query_: QueryContext); -} - -declare interface EventList { - events: Event_2[]; - path: Path; -} - -/** - * The event queue serves a few purposes: - * 1. It ensures we maintain event order in the face of event callbacks doing operations that result in more - * events being queued. - * 2. raiseQueuedEvents() handles being called reentrantly nicely. That is, if in the course of raising events, - * raiseQueuedEvents() is called again, the "inner" call will pick up raising events where the "outer" call - * left off, ensuring that the events are still raised synchronously and in order. - * 3. You can use raiseEventsAtPath and raiseEventsForChangedPath to ensure only relevant previously-queued - * events are raised synchronously. - * - * NOTE: This can all go away if/when we move to async events. - * - */ -declare class EventQueue { - eventLists_: EventList[]; - /** - * Tracks recursion depth of raiseQueuedEvents_, for debugging purposes. - */ - recursionDepth_: number; -} - -/** - * An EventRegistration is basically an event type ('value', 'child_added', etc.) and a callback - * to be notified of that type of event. - * - * That said, it can also contain a cancel callback to be notified if the event is canceled. And - * currently, this code is organized around the idea that you would register multiple child_ callbacks - * together, as a single EventRegistration. Though currently we don't do that. - */ -declare interface EventRegistration { - /** - * True if this container has a callback to trigger for this event type - */ - respondsTo(eventType: string): boolean; - createEvent(change: Change, query: QueryContext): Event_2; - /** - * Given event data, return a function to trigger the user's callback - */ - getEventRunner(eventData: Event_2): () => void; - createCancelEvent(error: Error, path: Path): CancelEvent | null; - matches(other: EventRegistration): boolean; - /** - * False basically means this is a "dummy" callback container being used as a sentinel - * to remove all callback containers of a particular type. (e.g. if the user does - * ref.off('value') without specifying a specific callback). - * - * (TODO: Rework this, since it's hacky) - * - */ - hasAnyCallback(): boolean; -} - -/** - * One of the following strings: "value", "child_added", "child_changed", - * "child_removed", or "child_moved." - */ -export declare type EventType = 'value' | 'child_added' | 'child_changed' | 'child_moved' | 'child_removed'; - -/* Excluded from this release type: _FirebaseService */ - -/** - * Force the use of longPolling instead of websockets. This will be ignored if websocket protocol is used in databaseURL. - */ -export declare function forceLongPolling(): void; - -/** - * Force the use of websockets instead of longPolling. - */ -export declare function forceWebSockets(): void; - -/** - * Gets the most up-to-date result for this query. - * - * @param query - The query to run. - * @returns A `Promise` which resolves to the resulting DataSnapshot if a value is - * available, or rejects if the client is unable to return a value (e.g., if the - * server is unreachable and there is nothing cached). - */ -export declare function get(query: Query): Promise; - -/** - * Returns the instance of the Realtime Database SDK that is associated - * with the provided {@link @firebase/app#FirebaseApp}. Initializes a new instance with - * with default settings if no instance exists or if the existing instance uses - * a custom database URL. - * - * @param app - The {@link @firebase/app#FirebaseApp} instance that the returned Realtime - * Database instance is associated with. - * @param url - The URL of the Realtime Database instance to connect to. If not - * provided, the SDK connects to the default instance of the Firebase App. - * @returns The `Database` instance of the provided app. - */ -export declare function getDatabase(app?: FirebaseApp, url?: string): Database; - -/** - * Disconnects from the server (all Database operations will be completed - * offline). - * - * The client automatically maintains a persistent connection to the Database - * server, which will remain active indefinitely and reconnect when - * disconnected. However, the `goOffline()` and `goOnline()` methods may be used - * to control the client connection in cases where a persistent connection is - * undesirable. - * - * While offline, the client will no longer receive data updates from the - * Database. However, all Database operations performed locally will continue to - * immediately fire events, allowing your application to continue behaving - * normally. Additionally, each operation performed locally will automatically - * be queued and retried upon reconnection to the Database server. - * - * To reconnect to the Database and begin receiving remote events, see - * `goOnline()`. - * - * @param db - The instance to disconnect. - */ -export declare function goOffline(db: Database): void; - -/** - * Reconnects to the server and synchronizes the offline Database state - * with the server state. - * - * This method should be used after disabling the active connection with - * `goOffline()`. Once reconnected, the client will transmit the proper data - * and fire the appropriate events so that your client "catches up" - * automatically. - * - * @param db - The instance to reconnect. - */ -export declare function goOnline(db: Database): void; - -/** - * A tree with immutable elements. - */ -declare class ImmutableTree { - readonly value: T | null; - readonly children: SortedMap>; - static fromObject(obj: { - [k: string]: T; - }): ImmutableTree; - constructor(value: T | null, children?: SortedMap>); - /** - * True if the value is empty and there are no children - */ - isEmpty(): boolean; - /** - * Given a path and predicate, return the first node and the path to that node - * where the predicate returns true. - * - * TODO Do a perf test -- If we're creating a bunch of `{path: value:}` - * objects on the way back out, it may be better to pass down a pathSoFar obj. - * - * @param relativePath - The remainder of the path - * @param predicate - The predicate to satisfy to return a node - */ - findRootMostMatchingPathAndValue(relativePath: Path, predicate: (a: T) => boolean): { - path: Path; - value: T; - } | null; - /** - * Find, if it exists, the shortest subpath of the given path that points a defined - * value in the tree - */ - findRootMostValueAndPath(relativePath: Path): { - path: Path; - value: T; - } | null; - /** - * @returns The subtree at the given path - */ - subtree(relativePath: Path): ImmutableTree; - /** - * Sets a value at the specified path. - * - * @param relativePath - Path to set value at. - * @param toSet - Value to set. - * @returns Resulting tree. - */ - set(relativePath: Path, toSet: T | null): ImmutableTree; - /** - * Removes the value at the specified path. - * - * @param relativePath - Path to value to remove. - * @returns Resulting tree. - */ - remove(relativePath: Path): ImmutableTree; - /** - * Gets a value from the tree. - * - * @param relativePath - Path to get value for. - * @returns Value at path, or null. - */ - get(relativePath: Path): T | null; - /** - * Replace the subtree at the specified path with the given new tree. - * - * @param relativePath - Path to replace subtree for. - * @param newTree - New tree. - * @returns Resulting tree. - */ - setTree(relativePath: Path, newTree: ImmutableTree): ImmutableTree; - /** - * Performs a depth first fold on this tree. Transforms a tree into a single - * value, given a function that operates on the path to a node, an optional - * current value, and a map of child names to folded subtrees - */ - fold(fn: (path: Path, value: T, children: { - [k: string]: V; - }) => V): V; - /** - * Recursive helper for public-facing fold() method - */ - private fold_; - /** - * Find the first matching value on the given path. Return the result of applying f to it. - */ - findOnPath(path: Path, f: (path: Path, value: T) => V | null): V | null; - private findOnPath_; - foreachOnPath(path: Path, f: (path: Path, value: T) => void): ImmutableTree; - private foreachOnPath_; - /** - * Calls the given function for each node in the tree that has a value. - * - * @param f - A function to be called with the path from the root of the tree to - * a node, and the value at that node. Called in depth-first order. - */ - foreach(f: (path: Path, value: T) => void): void; - private foreach_; - foreachChild(f: (name: string, value: T) => void): void; -} - -/** - * Returns a placeholder value that can be used to atomically increment the - * current database value by the provided delta. - * - * @param delta - the amount to modify the current value atomically. - * @returns A placeholder value for modifying data atomically server-side. - */ -export declare function increment(delta: number): object; - -declare abstract class Index { - abstract compare(a: NamedNode, b: NamedNode): number; - abstract isDefinedOn(node: Node_2): boolean; - /** - * @returns A standalone comparison function for - * this index - */ - getCompare(): Comparator; - /** - * Given a before and after value for a node, determine if the indexed value has changed. Even if they are different, - * it's possible that the changes are isolated to parts of the snapshot that are not indexed. - * - * - * @returns True if the portion of the snapshot being indexed changed between oldNode and newNode - */ - indexedValueChanged(oldNode: Node_2, newNode: Node_2): boolean; - /** - * @returns a node wrapper that will sort equal to or less than - * any other node wrapper, using this index - */ - minPost(): NamedNode; - /** - * @returns a node wrapper that will sort greater than or equal to - * any other node wrapper, using this index - */ - abstract maxPost(): NamedNode; - abstract makePost(indexValue: unknown, name: string): NamedNode; - /** - * @returns String representation for inclusion in a query spec - */ - abstract toString(): string; -} - -/** - * Creates a new `QueryConstraint` that if limited to the first specific number - * of children. - * - * The `limitToFirst()` method is used to set a maximum number of children to be - * synced for a given callback. If we set a limit of 100, we will initially only - * receive up to 100 `child_added` events. If we have fewer than 100 messages - * stored in our Database, a `child_added` event will fire for each message. - * However, if we have over 100 messages, we will only receive a `child_added` - * event for the first 100 ordered messages. As items change, we will receive - * `child_removed` events for each item that drops out of the active list so - * that the total number stays at 100. - * - * You can read more about `limitToFirst()` in - * {@link https://firebase.google.com/docs/database/web/lists-of-data#filtering_data | Filtering data}. - * - * @param limit - The maximum number of nodes to include in this query. - */ -export declare function limitToFirst(limit: number): QueryConstraint; - -/** - * Creates a new `QueryConstraint` that is limited to return only the last - * specified number of children. - * - * The `limitToLast()` method is used to set a maximum number of children to be - * synced for a given callback. If we set a limit of 100, we will initially only - * receive up to 100 `child_added` events. If we have fewer than 100 messages - * stored in our Database, a `child_added` event will fire for each message. - * However, if we have over 100 messages, we will only receive a `child_added` - * event for the last 100 ordered messages. As items change, we will receive - * `child_removed` events for each item that drops out of the active list so - * that the total number stays at 100. - * - * You can read more about `limitToLast()` in - * {@link https://firebase.google.com/docs/database/web/lists-of-data#filtering_data | Filtering data}. - * - * @param limit - The maximum number of nodes to include in this query. - */ -export declare function limitToLast(limit: number): QueryConstraint; - -/** An options objects that can be used to customize a listener. */ -export declare interface ListenOptions { - /** Whether to remove the listener after its first invocation. */ - readonly onlyOnce?: boolean; -} - -declare interface ListenProvider { - startListening(query: QueryContext, tag: number | null, hashFn: () => string, onComplete: (a: string, b?: unknown) => Event_2[]): Event_2[]; - stopListening(a: QueryContext, b: number | null): void; -} - -/** - * Represents an empty node (a leaf node in the Red-Black Tree). - */ -declare class LLRBEmptyNode { - key: K; - value: V; - left: LLRBNode | LLRBEmptyNode; - right: LLRBNode | LLRBEmptyNode; - color: boolean; - /** - * Returns a copy of the current node. - * - * @returns The node copy. - */ - copy(key: K | null, value: V | null, color: boolean | null, left: LLRBNode | LLRBEmptyNode | null, right: LLRBNode | LLRBEmptyNode | null): LLRBEmptyNode; - /** - * Returns a copy of the tree, with the specified key/value added. - * - * @param key - Key to be added. - * @param value - Value to be added. - * @param comparator - Comparator. - * @returns New tree, with item added. - */ - insert(key: K, value: V, comparator: Comparator): LLRBNode; - /** - * Returns a copy of the tree, with the specified key removed. - * - * @param key - The key to remove. - * @param comparator - Comparator. - * @returns New tree, with item removed. - */ - remove(key: K, comparator: Comparator): LLRBEmptyNode; - /** - * @returns The total number of nodes in the tree. - */ - count(): number; - /** - * @returns True if the tree is empty. - */ - isEmpty(): boolean; - /** - * Traverses the tree in key order and calls the specified action function - * for each node. - * - * @param action - Callback function to be called for each - * node. If it returns true, traversal is aborted. - * @returns True if traversal was aborted. - */ - inorderTraversal(action: (k: K, v: V) => unknown): boolean; - /** - * Traverses the tree in reverse key order and calls the specified action function - * for each node. - * - * @param action - Callback function to be called for each - * node. If it returns true, traversal is aborted. - * @returns True if traversal was aborted. - */ - reverseTraversal(action: (k: K, v: V) => void): boolean; - minKey(): null; - maxKey(): null; - check_(): number; - /** - * @returns Whether this node is red. - */ - isRed_(): boolean; -} - -/** - * Represents a node in a Left-leaning Red-Black tree. - */ -declare class LLRBNode { - key: K; - value: V; - color: boolean; - left: LLRBNode | LLRBEmptyNode; - right: LLRBNode | LLRBEmptyNode; - /** - * @param key - Key associated with this node. - * @param value - Value associated with this node. - * @param color - Whether this node is red. - * @param left - Left child. - * @param right - Right child. - */ - constructor(key: K, value: V, color: boolean | null, left?: LLRBNode | LLRBEmptyNode | null, right?: LLRBNode | LLRBEmptyNode | null); - static RED: boolean; - static BLACK: boolean; - /** - * Returns a copy of the current node, optionally replacing pieces of it. - * - * @param key - New key for the node, or null. - * @param value - New value for the node, or null. - * @param color - New color for the node, or null. - * @param left - New left child for the node, or null. - * @param right - New right child for the node, or null. - * @returns The node copy. - */ - copy(key: K | null, value: V | null, color: boolean | null, left: LLRBNode | LLRBEmptyNode | null, right: LLRBNode | LLRBEmptyNode | null): LLRBNode; - /** - * @returns The total number of nodes in the tree. - */ - count(): number; - /** - * @returns True if the tree is empty. - */ - isEmpty(): boolean; - /** - * Traverses the tree in key order and calls the specified action function - * for each node. - * - * @param action - Callback function to be called for each - * node. If it returns true, traversal is aborted. - * @returns The first truthy value returned by action, or the last falsey - * value returned by action - */ - inorderTraversal(action: (k: K, v: V) => unknown): boolean; - /** - * Traverses the tree in reverse key order and calls the specified action function - * for each node. - * - * @param action - Callback function to be called for each - * node. If it returns true, traversal is aborted. - * @returns True if traversal was aborted. - */ - reverseTraversal(action: (k: K, v: V) => void): boolean; - /** - * @returns The minimum node in the tree. - */ - private min_; - /** - * @returns The maximum key in the tree. - */ - minKey(): K; - /** - * @returns The maximum key in the tree. - */ - maxKey(): K; - /** - * @param key - Key to insert. - * @param value - Value to insert. - * @param comparator - Comparator. - * @returns New tree, with the key/value added. - */ - insert(key: K, value: V, comparator: Comparator): LLRBNode; - /** - * @returns New tree, with the minimum key removed. - */ - private removeMin_; - /** - * @param key - The key of the item to remove. - * @param comparator - Comparator. - * @returns New tree, with the specified item removed. - */ - remove(key: K, comparator: Comparator): LLRBNode | LLRBEmptyNode; - /** - * @returns Whether this is a RED node. - */ - isRed_(): boolean; - /** - * @returns New tree after performing any needed rotations. - */ - private fixUp_; - /** - * @returns New tree, after moveRedLeft. - */ - private moveRedLeft_; - /** - * @returns New tree, after moveRedRight. - */ - private moveRedRight_; - /** - * @returns New tree, after rotateLeft. - */ - private rotateLeft_; - /** - * @returns New tree, after rotateRight. - */ - private rotateRight_; - /** - * @returns Newt ree, after colorFlip. - */ - private colorFlip_; - /** - * For testing. - * - * @returns True if all is well. - */ - private checkMaxDepth_; - check_(): number; -} - -declare class NamedNode { - name: string; - node: Node_2; - constructor(name: string, node: Node_2); - static Wrap(name: string, node: Node_2): NamedNode; -} - -/** - * Node is an interface defining the common functionality for nodes in - * a DataSnapshot. - * - * @interface - */ -declare interface Node_2 { - /** - * Whether this node is a leaf node. - * @returns Whether this is a leaf node. - */ - isLeafNode(): boolean; - /** - * Gets the priority of the node. - * @returns The priority of the node. - */ - getPriority(): Node_2; - /** - * Returns a duplicate node with the new priority. - * @param newPriorityNode - New priority to set for the node. - * @returns Node with new priority. - */ - updatePriority(newPriorityNode: Node_2): Node_2; - /** - * Returns the specified immediate child, or null if it doesn't exist. - * @param childName - The name of the child to retrieve. - * @returns The retrieved child, or an empty node. - */ - getImmediateChild(childName: string): Node_2; - /** - * Returns a child by path, or null if it doesn't exist. - * @param path - The path of the child to retrieve. - * @returns The retrieved child or an empty node. - */ - getChild(path: Path): Node_2; - /** - * Returns the name of the child immediately prior to the specified childNode, or null. - * @param childName - The name of the child to find the predecessor of. - * @param childNode - The node to find the predecessor of. - * @param index - The index to use to determine the predecessor - * @returns The name of the predecessor child, or null if childNode is the first child. - */ - getPredecessorChildName(childName: string, childNode: Node_2, index: Index): string | null; - /** - * Returns a duplicate node, with the specified immediate child updated. - * Any value in the node will be removed. - * @param childName - The name of the child to update. - * @param newChildNode - The new child node - * @returns The updated node. - */ - updateImmediateChild(childName: string, newChildNode: Node_2): Node_2; - /** - * Returns a duplicate node, with the specified child updated. Any value will - * be removed. - * @param path - The path of the child to update. - * @param newChildNode - The new child node, which may be an empty node - * @returns The updated node. - */ - updateChild(path: Path, newChildNode: Node_2): Node_2; - /** - * True if the immediate child specified exists - */ - hasChild(childName: string): boolean; - /** - * @returns True if this node has no value or children. - */ - isEmpty(): boolean; - /** - * @returns The number of children of this node. - */ - numChildren(): number; - /** - * Calls action for each child. - * @param action - Action to be called for - * each child. It's passed the child name and the child node. - * @returns The first truthy value return by action, or the last falsey one - */ - forEachChild(index: Index, action: (a: string, b: Node_2) => void): unknown; - /** - * @param exportFormat - True for export format (also wire protocol format). - * @returns Value of this node as JSON. - */ - val(exportFormat?: boolean): unknown; - /** - * @returns hash representing the node contents. - */ - hash(): string; - /** - * @param other - Another node - * @returns -1 for less than, 0 for equal, 1 for greater than other - */ - compareTo(other: Node_2): number; - /** - * @returns Whether or not this snapshot equals other - */ - equals(other: Node_2): boolean; - /** - * @returns This node, with the specified index now available - */ - withIndex(indexDefinition: Index): Node_2; - isIndexed(indexDefinition: Index): boolean; -} - -/** - * NodeFilter is used to update nodes and complete children of nodes while applying queries on the fly and keeping - * track of any child changes. This class does not track value changes as value changes depend on more - * than just the node itself. Different kind of queries require different kind of implementations of this interface. - * @interface - */ -declare interface NodeFilter_2 { - /** - * Update a single complete child in the snap. If the child equals the old child in the snap, this is a no-op. - * The method expects an indexed snap. - */ - updateChild(snap: Node_2, key: string, newChild: Node_2, affectedPath: Path, source: CompleteChildSource, optChangeAccumulator: ChildChangeAccumulator | null): Node_2; - /** - * Update a node in full and output any resulting change from this complete update. - */ - updateFullNode(oldSnap: Node_2, newSnap: Node_2, optChangeAccumulator: ChildChangeAccumulator | null): Node_2; - /** - * Update the priority of the root node - */ - updatePriority(oldSnap: Node_2, newPriority: Node_2): Node_2; - /** - * Returns true if children might be filtered due to query criteria - */ - filtersNodes(): boolean; - /** - * Returns the index filter that this filter uses to get a NodeFilter that doesn't filter any children. - */ - getIndexedFilter(): NodeFilter_2; - /** - * Returns the index that this filter uses - */ - getIndex(): Index; -} - -/** - * Detaches a callback previously attached with the corresponding `on*()` (`onValue`, `onChildAdded`) listener. - * Note: This is not the recommended way to remove a listener. Instead, please use the returned callback function from - * the respective `on*` callbacks. - * - * Detach a callback previously attached with `on*()`. Calling `off()` on a parent listener - * will not automatically remove listeners registered on child nodes, `off()` - * must also be called on any child listeners to remove the callback. - * - * If a callback is not specified, all callbacks for the specified eventType - * will be removed. Similarly, if no eventType is specified, all callbacks - * for the `Reference` will be removed. - * - * Individual listeners can also be removed by invoking their unsubscribe - * callbacks. - * - * @param query - The query that the listener was registered with. - * @param eventType - One of the following strings: "value", "child_added", - * "child_changed", "child_removed", or "child_moved." If omitted, all callbacks - * for the `Reference` will be removed. - * @param callback - The callback function that was passed to `on()` or - * `undefined` to remove all callbacks. - */ -export declare function off(query: Query, eventType?: EventType, callback?: (snapshot: DataSnapshot, previousChildName?: string | null) => unknown): void; - -/** - * Listens for data changes at a particular location. - * - * This is the primary way to read data from a Database. Your callback - * will be triggered for the initial data and again whenever the data changes. - * Invoke the returned unsubscribe callback to stop receiving updates. See - * {@link https://firebase.google.com/docs/database/web/retrieve-data | Retrieve Data on the Web} - * for more details. - * - * An `onChildAdded` event will be triggered once for each initial child at this - * location, and it will be triggered again every time a new child is added. The - * `DataSnapshot` passed into the callback will reflect the data for the - * relevant child. For ordering purposes, it is passed a second argument which - * is a string containing the key of the previous sibling child by sort order, - * or `null` if it is the first child. - * - * @param query - The query to run. - * @param callback - A callback that fires when the specified event occurs. - * The callback will be passed a DataSnapshot and a string containing the key of - * the previous child, by sort order, or `null` if it is the first child. - * @param cancelCallback - An optional callback that will be notified if your - * event subscription is ever canceled because your client does not have - * permission to read this data (or it had permission but has now lost it). - * This callback will be passed an `Error` object indicating why the failure - * occurred. - * @returns A function that can be invoked to remove the listener. - */ -export declare function onChildAdded(query: Query, callback: (snapshot: DataSnapshot, previousChildName?: string | null) => unknown, cancelCallback?: (error: Error) => unknown): Unsubscribe; - -/** - * Listens for data changes at a particular location. - * - * This is the primary way to read data from a Database. Your callback - * will be triggered for the initial data and again whenever the data changes. - * Invoke the returned unsubscribe callback to stop receiving updates. See - * {@link https://firebase.google.com/docs/database/web/retrieve-data | Retrieve Data on the Web} - * for more details. - * - * An `onChildAdded` event will be triggered once for each initial child at this - * location, and it will be triggered again every time a new child is added. The - * `DataSnapshot` passed into the callback will reflect the data for the - * relevant child. For ordering purposes, it is passed a second argument which - * is a string containing the key of the previous sibling child by sort order, - * or `null` if it is the first child. - * - * @param query - The query to run. - * @param callback - A callback that fires when the specified event occurs. - * The callback will be passed a DataSnapshot and a string containing the key of - * the previous child, by sort order, or `null` if it is the first child. - * @param options - An object that can be used to configure `onlyOnce`, which - * then removes the listener after its first invocation. - * @returns A function that can be invoked to remove the listener. - */ -export declare function onChildAdded(query: Query, callback: (snapshot: DataSnapshot, previousChildName: string | null) => unknown, options: ListenOptions): Unsubscribe; - -/** - * Listens for data changes at a particular location. - * - * This is the primary way to read data from a Database. Your callback - * will be triggered for the initial data and again whenever the data changes. - * Invoke the returned unsubscribe callback to stop receiving updates. See - * {@link https://firebase.google.com/docs/database/web/retrieve-data | Retrieve Data on the Web} - * for more details. - * - * An `onChildAdded` event will be triggered once for each initial child at this - * location, and it will be triggered again every time a new child is added. The - * `DataSnapshot` passed into the callback will reflect the data for the - * relevant child. For ordering purposes, it is passed a second argument which - * is a string containing the key of the previous sibling child by sort order, - * or `null` if it is the first child. - * - * @param query - The query to run. - * @param callback - A callback that fires when the specified event occurs. - * The callback will be passed a DataSnapshot and a string containing the key of - * the previous child, by sort order, or `null` if it is the first child. - * @param cancelCallback - An optional callback that will be notified if your - * event subscription is ever canceled because your client does not have - * permission to read this data (or it had permission but has now lost it). - * This callback will be passed an `Error` object indicating why the failure - * occurred. - * @param options - An object that can be used to configure `onlyOnce`, which - * then removes the listener after its first invocation. - * @returns A function that can be invoked to remove the listener. - */ -export declare function onChildAdded(query: Query, callback: (snapshot: DataSnapshot, previousChildName: string | null) => unknown, cancelCallback: (error: Error) => unknown, options: ListenOptions): Unsubscribe; - -/** - * Listens for data changes at a particular location. - * - * This is the primary way to read data from a Database. Your callback - * will be triggered for the initial data and again whenever the data changes. - * Invoke the returned unsubscribe callback to stop receiving updates. See - * {@link https://firebase.google.com/docs/database/web/retrieve-data | Retrieve Data on the Web} - * for more details. - * - * An `onChildChanged` event will be triggered when the data stored in a child - * (or any of its descendants) changes. Note that a single `child_changed` event - * may represent multiple changes to the child. The `DataSnapshot` passed to the - * callback will contain the new child contents. For ordering purposes, the - * callback is also passed a second argument which is a string containing the - * key of the previous sibling child by sort order, or `null` if it is the first - * child. - * - * @param query - The query to run. - * @param callback - A callback that fires when the specified event occurs. - * The callback will be passed a DataSnapshot and a string containing the key of - * the previous child, by sort order, or `null` if it is the first child. - * @param cancelCallback - An optional callback that will be notified if your - * event subscription is ever canceled because your client does not have - * permission to read this data (or it had permission but has now lost it). - * This callback will be passed an `Error` object indicating why the failure - * occurred. - * @returns A function that can be invoked to remove the listener. - */ -export declare function onChildChanged(query: Query, callback: (snapshot: DataSnapshot, previousChildName: string | null) => unknown, cancelCallback?: (error: Error) => unknown): Unsubscribe; - -/** - * Listens for data changes at a particular location. - * - * This is the primary way to read data from a Database. Your callback - * will be triggered for the initial data and again whenever the data changes. - * Invoke the returned unsubscribe callback to stop receiving updates. See - * {@link https://firebase.google.com/docs/database/web/retrieve-data | Retrieve Data on the Web} - * for more details. - * - * An `onChildChanged` event will be triggered when the data stored in a child - * (or any of its descendants) changes. Note that a single `child_changed` event - * may represent multiple changes to the child. The `DataSnapshot` passed to the - * callback will contain the new child contents. For ordering purposes, the - * callback is also passed a second argument which is a string containing the - * key of the previous sibling child by sort order, or `null` if it is the first - * child. - * - * @param query - The query to run. - * @param callback - A callback that fires when the specified event occurs. - * The callback will be passed a DataSnapshot and a string containing the key of - * the previous child, by sort order, or `null` if it is the first child. - * @param options - An object that can be used to configure `onlyOnce`, which - * then removes the listener after its first invocation. - * @returns A function that can be invoked to remove the listener. - */ -export declare function onChildChanged(query: Query, callback: (snapshot: DataSnapshot, previousChildName: string | null) => unknown, options: ListenOptions): Unsubscribe; - -/** - * Listens for data changes at a particular location. - * - * This is the primary way to read data from a Database. Your callback - * will be triggered for the initial data and again whenever the data changes. - * Invoke the returned unsubscribe callback to stop receiving updates. See - * {@link https://firebase.google.com/docs/database/web/retrieve-data | Retrieve Data on the Web} - * for more details. - * - * An `onChildChanged` event will be triggered when the data stored in a child - * (or any of its descendants) changes. Note that a single `child_changed` event - * may represent multiple changes to the child. The `DataSnapshot` passed to the - * callback will contain the new child contents. For ordering purposes, the - * callback is also passed a second argument which is a string containing the - * key of the previous sibling child by sort order, or `null` if it is the first - * child. - * - * @param query - The query to run. - * @param callback - A callback that fires when the specified event occurs. - * The callback will be passed a DataSnapshot and a string containing the key of - * the previous child, by sort order, or `null` if it is the first child. - * @param cancelCallback - An optional callback that will be notified if your - * event subscription is ever canceled because your client does not have - * permission to read this data (or it had permission but has now lost it). - * This callback will be passed an `Error` object indicating why the failure - * occurred. - * @param options - An object that can be used to configure `onlyOnce`, which - * then removes the listener after its first invocation. - * @returns A function that can be invoked to remove the listener. - */ -export declare function onChildChanged(query: Query, callback: (snapshot: DataSnapshot, previousChildName: string | null) => unknown, cancelCallback: (error: Error) => unknown, options: ListenOptions): Unsubscribe; - -/** - * Listens for data changes at a particular location. - * - * This is the primary way to read data from a Database. Your callback - * will be triggered for the initial data and again whenever the data changes. - * Invoke the returned unsubscribe callback to stop receiving updates. See - * {@link https://firebase.google.com/docs/database/web/retrieve-data | Retrieve Data on the Web} - * for more details. - * - * An `onChildMoved` event will be triggered when a child's sort order changes - * such that its position relative to its siblings changes. The `DataSnapshot` - * passed to the callback will be for the data of the child that has moved. It - * is also passed a second argument which is a string containing the key of the - * previous sibling child by sort order, or `null` if it is the first child. - * - * @param query - The query to run. - * @param callback - A callback that fires when the specified event occurs. - * The callback will be passed a DataSnapshot and a string containing the key of - * the previous child, by sort order, or `null` if it is the first child. - * @param cancelCallback - An optional callback that will be notified if your - * event subscription is ever canceled because your client does not have - * permission to read this data (or it had permission but has now lost it). - * This callback will be passed an `Error` object indicating why the failure - * occurred. - * @returns A function that can be invoked to remove the listener. - */ -export declare function onChildMoved(query: Query, callback: (snapshot: DataSnapshot, previousChildName: string | null) => unknown, cancelCallback?: (error: Error) => unknown): Unsubscribe; - -/** - * Listens for data changes at a particular location. - * - * This is the primary way to read data from a Database. Your callback - * will be triggered for the initial data and again whenever the data changes. - * Invoke the returned unsubscribe callback to stop receiving updates. See - * {@link https://firebase.google.com/docs/database/web/retrieve-data | Retrieve Data on the Web} - * for more details. - * - * An `onChildMoved` event will be triggered when a child's sort order changes - * such that its position relative to its siblings changes. The `DataSnapshot` - * passed to the callback will be for the data of the child that has moved. It - * is also passed a second argument which is a string containing the key of the - * previous sibling child by sort order, or `null` if it is the first child. - * - * @param query - The query to run. - * @param callback - A callback that fires when the specified event occurs. - * The callback will be passed a DataSnapshot and a string containing the key of - * the previous child, by sort order, or `null` if it is the first child. - * @param options - An object that can be used to configure `onlyOnce`, which - * then removes the listener after its first invocation. - * @returns A function that can be invoked to remove the listener. - */ -export declare function onChildMoved(query: Query, callback: (snapshot: DataSnapshot, previousChildName: string | null) => unknown, options: ListenOptions): Unsubscribe; - -/** - * Listens for data changes at a particular location. - * - * This is the primary way to read data from a Database. Your callback - * will be triggered for the initial data and again whenever the data changes. - * Invoke the returned unsubscribe callback to stop receiving updates. See - * {@link https://firebase.google.com/docs/database/web/retrieve-data | Retrieve Data on the Web} - * for more details. - * - * An `onChildMoved` event will be triggered when a child's sort order changes - * such that its position relative to its siblings changes. The `DataSnapshot` - * passed to the callback will be for the data of the child that has moved. It - * is also passed a second argument which is a string containing the key of the - * previous sibling child by sort order, or `null` if it is the first child. - * - * @param query - The query to run. - * @param callback - A callback that fires when the specified event occurs. - * The callback will be passed a DataSnapshot and a string containing the key of - * the previous child, by sort order, or `null` if it is the first child. - * @param cancelCallback - An optional callback that will be notified if your - * event subscription is ever canceled because your client does not have - * permission to read this data (or it had permission but has now lost it). - * This callback will be passed an `Error` object indicating why the failure - * occurred. - * @param options - An object that can be used to configure `onlyOnce`, which - * then removes the listener after its first invocation. - * @returns A function that can be invoked to remove the listener. - */ -export declare function onChildMoved(query: Query, callback: (snapshot: DataSnapshot, previousChildName: string | null) => unknown, cancelCallback: (error: Error) => unknown, options: ListenOptions): Unsubscribe; - -/** - * Listens for data changes at a particular location. - * - * This is the primary way to read data from a Database. Your callback - * will be triggered for the initial data and again whenever the data changes. - * Invoke the returned unsubscribe callback to stop receiving updates. See - * {@link https://firebase.google.com/docs/database/web/retrieve-data | Retrieve Data on the Web} - * for more details. - * - * An `onChildRemoved` event will be triggered once every time a child is - * removed. The `DataSnapshot` passed into the callback will be the old data for - * the child that was removed. A child will get removed when either: - * - * - a client explicitly calls `remove()` on that child or one of its ancestors - * - a client calls `set(null)` on that child or one of its ancestors - * - that child has all of its children removed - * - there is a query in effect which now filters out the child (because it's - * sort order changed or the max limit was hit) - * - * @param query - The query to run. - * @param callback - A callback that fires when the specified event occurs. - * The callback will be passed a DataSnapshot and a string containing the key of - * the previous child, by sort order, or `null` if it is the first child. - * @param cancelCallback - An optional callback that will be notified if your - * event subscription is ever canceled because your client does not have - * permission to read this data (or it had permission but has now lost it). - * This callback will be passed an `Error` object indicating why the failure - * occurred. - * @returns A function that can be invoked to remove the listener. - */ -export declare function onChildRemoved(query: Query, callback: (snapshot: DataSnapshot) => unknown, cancelCallback?: (error: Error) => unknown): Unsubscribe; - -/** - * Listens for data changes at a particular location. - * - * This is the primary way to read data from a Database. Your callback - * will be triggered for the initial data and again whenever the data changes. - * Invoke the returned unsubscribe callback to stop receiving updates. See - * {@link https://firebase.google.com/docs/database/web/retrieve-data | Retrieve Data on the Web} - * for more details. - * - * An `onChildRemoved` event will be triggered once every time a child is - * removed. The `DataSnapshot` passed into the callback will be the old data for - * the child that was removed. A child will get removed when either: - * - * - a client explicitly calls `remove()` on that child or one of its ancestors - * - a client calls `set(null)` on that child or one of its ancestors - * - that child has all of its children removed - * - there is a query in effect which now filters out the child (because it's - * sort order changed or the max limit was hit) - * - * @param query - The query to run. - * @param callback - A callback that fires when the specified event occurs. - * The callback will be passed a DataSnapshot and a string containing the key of - * the previous child, by sort order, or `null` if it is the first child. - * @param options - An object that can be used to configure `onlyOnce`, which - * then removes the listener after its first invocation. - * @returns A function that can be invoked to remove the listener. - */ -export declare function onChildRemoved(query: Query, callback: (snapshot: DataSnapshot) => unknown, options: ListenOptions): Unsubscribe; - -/** - * Listens for data changes at a particular location. - * - * This is the primary way to read data from a Database. Your callback - * will be triggered for the initial data and again whenever the data changes. - * Invoke the returned unsubscribe callback to stop receiving updates. See - * {@link https://firebase.google.com/docs/database/web/retrieve-data | Retrieve Data on the Web} - * for more details. - * - * An `onChildRemoved` event will be triggered once every time a child is - * removed. The `DataSnapshot` passed into the callback will be the old data for - * the child that was removed. A child will get removed when either: - * - * - a client explicitly calls `remove()` on that child or one of its ancestors - * - a client calls `set(null)` on that child or one of its ancestors - * - that child has all of its children removed - * - there is a query in effect which now filters out the child (because it's - * sort order changed or the max limit was hit) - * - * @param query - The query to run. - * @param callback - A callback that fires when the specified event occurs. - * The callback will be passed a DataSnapshot and a string containing the key of - * the previous child, by sort order, or `null` if it is the first child. - * @param cancelCallback - An optional callback that will be notified if your - * event subscription is ever canceled because your client does not have - * permission to read this data (or it had permission but has now lost it). - * This callback will be passed an `Error` object indicating why the failure - * occurred. - * @param options - An object that can be used to configure `onlyOnce`, which - * then removes the listener after its first invocation. - * @returns A function that can be invoked to remove the listener. - */ -export declare function onChildRemoved(query: Query, callback: (snapshot: DataSnapshot) => unknown, cancelCallback: (error: Error) => unknown, options: ListenOptions): Unsubscribe; - -/** - * The `onDisconnect` class allows you to write or clear data when your client - * disconnects from the Database server. These updates occur whether your - * client disconnects cleanly or not, so you can rely on them to clean up data - * even if a connection is dropped or a client crashes. - * - * The `onDisconnect` class is most commonly used to manage presence in - * applications where it is useful to detect how many clients are connected and - * when other clients disconnect. See - * {@link https://firebase.google.com/docs/database/web/offline-capabilities | Enabling Offline Capabilities in JavaScript} - * for more information. - * - * To avoid problems when a connection is dropped before the requests can be - * transferred to the Database server, these functions should be called before - * writing any data. - * - * Note that `onDisconnect` operations are only triggered once. If you want an - * operation to occur each time a disconnect occurs, you'll need to re-establish - * the `onDisconnect` operations each time you reconnect. - */ -export declare class OnDisconnect { - private _repo; - private _path; - /** @hideconstructor */ - constructor(_repo: Repo, _path: Path); - /** - * Cancels all previously queued `onDisconnect()` set or update events for this - * location and all children. - * - * If a write has been queued for this location via a `set()` or `update()` at a - * parent location, the write at this location will be canceled, though writes - * to sibling locations will still occur. - * - * @returns Resolves when synchronization to the server is complete. - */ - cancel(): Promise; - /** - * Ensures the data at this location is deleted when the client is disconnected - * (due to closing the browser, navigating to a new page, or network issues). - * - * @returns Resolves when synchronization to the server is complete. - */ - remove(): Promise; - /** - * Ensures the data at this location is set to the specified value when the - * client is disconnected (due to closing the browser, navigating to a new page, - * or network issues). - * - * `set()` is especially useful for implementing "presence" systems, where a - * value should be changed or cleared when a user disconnects so that they - * appear "offline" to other users. See - * {@link https://firebase.google.com/docs/database/web/offline-capabilities | Enabling Offline Capabilities in JavaScript} - * for more information. - * - * Note that `onDisconnect` operations are only triggered once. If you want an - * operation to occur each time a disconnect occurs, you'll need to re-establish - * the `onDisconnect` operations each time. - * - * @param value - The value to be written to this location on disconnect (can - * be an object, array, string, number, boolean, or null). - * @returns Resolves when synchronization to the Database is complete. - */ - set(value: unknown): Promise; - /** - * Ensures the data at this location is set to the specified value and priority - * when the client is disconnected (due to closing the browser, navigating to a - * new page, or network issues). - * - * @param value - The value to be written to this location on disconnect (can - * be an object, array, string, number, boolean, or null). - * @param priority - The priority to be written (string, number, or null). - * @returns Resolves when synchronization to the Database is complete. - */ - setWithPriority(value: unknown, priority: number | string | null): Promise; - /** - * Writes multiple values at this location when the client is disconnected (due - * to closing the browser, navigating to a new page, or network issues). - * - * The `values` argument contains multiple property-value pairs that will be - * written to the Database together. Each child property can either be a simple - * property (for example, "name") or a relative path (for example, "name/first") - * from the current location to the data to update. - * - * As opposed to the `set()` method, `update()` can be use to selectively update - * only the referenced properties at the current location (instead of replacing - * all the child properties at the current location). - * - * @param values - Object containing multiple values. - * @returns Resolves when synchronization to the Database is complete. - */ - update(values: object): Promise; -} - -/** - * Returns an `OnDisconnect` object - see - * {@link https://firebase.google.com/docs/database/web/offline-capabilities | Enabling Offline Capabilities in JavaScript} - * for more information on how to use it. - * - * @param ref - The reference to add OnDisconnect triggers for. - */ -export declare function onDisconnect(ref: DatabaseReference): OnDisconnect; - -/** - * Listens for data changes at a particular location. - * - * This is the primary way to read data from a Database. Your callback - * will be triggered for the initial data and again whenever the data changes. - * Invoke the returned unsubscribe callback to stop receiving updates. See - * {@link https://firebase.google.com/docs/database/web/retrieve-data | Retrieve Data on the Web} - * for more details. - * - * An `onValue` event will trigger once with the initial data stored at this - * location, and then trigger again each time the data changes. The - * `DataSnapshot` passed to the callback will be for the location at which - * `on()` was called. It won't trigger until the entire contents has been - * synchronized. If the location has no data, it will be triggered with an empty - * `DataSnapshot` (`val()` will return `null`). - * - * @param query - The query to run. - * @param callback - A callback that fires when the specified event occurs. The - * callback will be passed a DataSnapshot. - * @param cancelCallback - An optional callback that will be notified if your - * event subscription is ever canceled because your client does not have - * permission to read this data (or it had permission but has now lost it). - * This callback will be passed an `Error` object indicating why the failure - * occurred. - * @returns A function that can be invoked to remove the listener. - */ -export declare function onValue(query: Query, callback: (snapshot: DataSnapshot) => unknown, cancelCallback?: (error: Error) => unknown): Unsubscribe; - -/** - * Listens for data changes at a particular location. - * - * This is the primary way to read data from a Database. Your callback - * will be triggered for the initial data and again whenever the data changes. - * Invoke the returned unsubscribe callback to stop receiving updates. See - * {@link https://firebase.google.com/docs/database/web/retrieve-data | Retrieve Data on the Web} - * for more details. - * - * An `onValue` event will trigger once with the initial data stored at this - * location, and then trigger again each time the data changes. The - * `DataSnapshot` passed to the callback will be for the location at which - * `on()` was called. It won't trigger until the entire contents has been - * synchronized. If the location has no data, it will be triggered with an empty - * `DataSnapshot` (`val()` will return `null`). - * - * @param query - The query to run. - * @param callback - A callback that fires when the specified event occurs. The - * callback will be passed a DataSnapshot. - * @param options - An object that can be used to configure `onlyOnce`, which - * then removes the listener after its first invocation. - * @returns A function that can be invoked to remove the listener. - */ -export declare function onValue(query: Query, callback: (snapshot: DataSnapshot) => unknown, options: ListenOptions): Unsubscribe; - -/** - * Listens for data changes at a particular location. - * - * This is the primary way to read data from a Database. Your callback - * will be triggered for the initial data and again whenever the data changes. - * Invoke the returned unsubscribe callback to stop receiving updates. See - * {@link https://firebase.google.com/docs/database/web/retrieve-data | Retrieve Data on the Web} - * for more details. - * - * An `onValue` event will trigger once with the initial data stored at this - * location, and then trigger again each time the data changes. The - * `DataSnapshot` passed to the callback will be for the location at which - * `on()` was called. It won't trigger until the entire contents has been - * synchronized. If the location has no data, it will be triggered with an empty - * `DataSnapshot` (`val()` will return `null`). - * - * @param query - The query to run. - * @param callback - A callback that fires when the specified event occurs. The - * callback will be passed a DataSnapshot. - * @param cancelCallback - An optional callback that will be notified if your - * event subscription is ever canceled because your client does not have - * permission to read this data (or it had permission but has now lost it). - * This callback will be passed an `Error` object indicating why the failure - * occurred. - * @param options - An object that can be used to configure `onlyOnce`, which - * then removes the listener after its first invocation. - * @returns A function that can be invoked to remove the listener. - */ -export declare function onValue(query: Query, callback: (snapshot: DataSnapshot) => unknown, cancelCallback: (error: Error) => unknown, options: ListenOptions): Unsubscribe; - -/** - * Creates a new `QueryConstraint` that orders by the specified child key. - * - * Queries can only order by one key at a time. Calling `orderByChild()` - * multiple times on the same query is an error. - * - * Firebase queries allow you to order your data by any child key on the fly. - * However, if you know in advance what your indexes will be, you can define - * them via the .indexOn rule in your Security Rules for better performance. See - * the{@link https://firebase.google.com/docs/database/security/indexing-data} - * rule for more information. - * - * You can read more about `orderByChild()` in - * {@link https://firebase.google.com/docs/database/web/lists-of-data#sort_data | Sort data}. - * - * @param path - The path to order by. - */ -export declare function orderByChild(path: string): QueryConstraint; - -/** - * Creates a new `QueryConstraint` that orders by the key. - * - * Sorts the results of a query by their (ascending) key values. - * - * You can read more about `orderByKey()` in - * {@link https://firebase.google.com/docs/database/web/lists-of-data#sort_data | Sort data}. - */ -export declare function orderByKey(): QueryConstraint; - -/** - * Creates a new `QueryConstraint` that orders by priority. - * - * Applications need not use priority but can order collections by - * ordinary properties (see - * {@link https://firebase.google.com/docs/database/web/lists-of-data#sort_data | Sort data} - * for alternatives to priority. - */ -export declare function orderByPriority(): QueryConstraint; - -/** - * Creates a new `QueryConstraint` that orders by value. - * - * If the children of a query are all scalar values (string, number, or - * boolean), you can order the results by their (ascending) values. - * - * You can read more about `orderByValue()` in - * {@link https://firebase.google.com/docs/database/web/lists-of-data#sort_data | Sort data}. - */ -export declare function orderByValue(): QueryConstraint; - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * An immutable object representing a parsed path. It's immutable so that you - * can pass them around to other functions without worrying about them changing - * it. - */ -declare class Path { - pieces_: string[]; - pieceNum_: number; - /** - * @param pathOrString - Path string to parse, or another path, or the raw - * tokens array - */ - constructor(pathOrString: string | string[], pieceNum?: number); - toString(): string; -} - -/** - * Firebase connection. Abstracts wire protocol and handles reconnecting. - * - * NOTE: All JSON objects sent to the realtime connection must have property names enclosed - * in quotes to make sure the closure compiler does not minify them. - */ -declare class PersistentConnection extends ServerActions { - private repoInfo_; - private applicationId_; - private onDataUpdate_; - private onConnectStatus_; - private onServerInfoUpdate_; - private authTokenProvider_; - private appCheckTokenProvider_; - private authOverride_?; - id: number; - private log_; - private interruptReasons_; - private readonly listens; - private outstandingPuts_; - private outstandingGets_; - private outstandingPutCount_; - private outstandingGetCount_; - private onDisconnectRequestQueue_; - private connected_; - private reconnectDelay_; - private maxReconnectDelay_; - private securityDebugCallback_; - lastSessionId: string | null; - private establishConnectionTimer_; - private visible_; - private requestCBHash_; - private requestNumber_; - private realtime_; - private authToken_; - private appCheckToken_; - private forceTokenRefresh_; - private invalidAuthTokenCount_; - private invalidAppCheckTokenCount_; - private firstConnection_; - private lastConnectionAttemptTime_; - private lastConnectionEstablishedTime_; - private static nextPersistentConnectionId_; - /** - * Counter for number of connections created. Mainly used for tagging in the logs - */ - private static nextConnectionId_; - /** - * @param repoInfo_ - Data about the namespace we are connecting to - * @param applicationId_ - The Firebase App ID for this project - * @param onDataUpdate_ - A callback for new data from the server - */ - constructor(repoInfo_: RepoInfo, applicationId_: string, onDataUpdate_: (a: string, b: unknown, c: boolean, d: number | null) => void, onConnectStatus_: (a: boolean) => void, onServerInfoUpdate_: (a: unknown) => void, authTokenProvider_: AuthTokenProvider, appCheckTokenProvider_: AppCheckTokenProvider, authOverride_?: object | null); - protected sendRequest(action: string, body: unknown, onResponse?: (a: unknown) => void): void; - get(query: QueryContext): Promise; - listen(query: QueryContext, currentHashFn: () => string, tag: number | null, onComplete: (a: string, b: unknown) => void): void; - private sendGet_; - private sendListen_; - private static warnOnListenWarnings_; - refreshAuthToken(token: string): void; - private reduceReconnectDelayIfAdminCredential_; - refreshAppCheckToken(token: string | null): void; - /** - * Attempts to authenticate with the given credentials. If the authentication attempt fails, it's triggered like - * a auth revoked (the connection is closed). - */ - tryAuth(): void; - /** - * Attempts to authenticate with the given token. If the authentication - * attempt fails, it's triggered like the token was revoked (the connection is - * closed). - */ - tryAppCheck(): void; - /** - * @inheritDoc - */ - unlisten(query: QueryContext, tag: number | null): void; - private sendUnlisten_; - onDisconnectPut(pathString: string, data: unknown, onComplete?: (a: string, b: string) => void): void; - onDisconnectMerge(pathString: string, data: unknown, onComplete?: (a: string, b: string) => void): void; - onDisconnectCancel(pathString: string, onComplete?: (a: string, b: string) => void): void; - private sendOnDisconnect_; - put(pathString: string, data: unknown, onComplete?: (a: string, b: string) => void, hash?: string): void; - merge(pathString: string, data: unknown, onComplete: (a: string, b: string | null) => void, hash?: string): void; - putInternal(action: string, pathString: string, data: unknown, onComplete: (a: string, b: string | null) => void, hash?: string): void; - private sendPut_; - reportStats(stats: { - [k: string]: unknown; - }): void; - private onDataMessage_; - private onDataPush_; - private onReady_; - private scheduleConnect_; - private initConnection_; - private onVisible_; - private onOnline_; - private onRealtimeDisconnect_; - private establishConnection_; - interrupt(reason: string): void; - resume(reason: string): void; - private handleTimestamp_; - private cancelSentTransactions_; - private onListenRevoked_; - private removeListen_; - private onAuthRevoked_; - private onAppCheckRevoked_; - private onSecurityDebugPacket_; - private restoreState_; - /** - * Sends client stats for first connection - */ - private sendConnectStats_; - private shouldReconnect_; -} - -declare class PriorityIndex extends Index { - compare(a: NamedNode, b: NamedNode): number; - isDefinedOn(node: Node_2): boolean; - indexedValueChanged(oldNode: Node_2, newNode: Node_2): boolean; - minPost(): NamedNode; - maxPost(): NamedNode; - makePost(indexValue: unknown, name: string): NamedNode; - /** - * @returns String representation for inclusion in a query spec - */ - toString(): string; -} - -/** - * Generates a new child location using a unique key and returns its - * `Reference`. - * - * This is the most common pattern for adding data to a collection of items. - * - * If you provide a value to `push()`, the value is written to the - * generated location. If you don't pass a value, nothing is written to the - * database and the child remains empty (but you can use the `Reference` - * elsewhere). - * - * The unique keys generated by `push()` are ordered by the current time, so the - * resulting list of items is chronologically sorted. The keys are also - * designed to be unguessable (they contain 72 random bits of entropy). - * - * See {@link https://firebase.google.com/docs/database/web/lists-of-data#append_to_a_list_of_data | Append to a list of data}. - * See {@link https://firebase.googleblog.com/2015/02/the-2120-ways-to-ensure-unique_68.html | The 2^120 Ways to Ensure Unique Identifiers}. - * - * @param parent - The parent location. - * @param value - Optional value to be written at the generated location. - * @returns Combined `Promise` and `Reference`; resolves when write is complete, - * but can be used immediately as the `Reference` to the child location. - */ -export declare function push(parent: DatabaseReference, value?: unknown): ThenableReference; - -/** - * @license - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * A `Query` sorts and filters the data at a Database location so only a subset - * of the child data is included. This can be used to order a collection of - * data by some attribute (for example, height of dinosaurs) as well as to - * restrict a large list of items (for example, chat messages) down to a number - * suitable for synchronizing to the client. Queries are created by chaining - * together one or more of the filter methods defined here. - * - * Just as with a `DatabaseReference`, you can receive data from a `Query` by using the - * `on*()` methods. You will only receive events and `DataSnapshot`s for the - * subset of the data that matches your query. - * - * See {@link https://firebase.google.com/docs/database/web/lists-of-data#sorting_and_filtering_data} - * for more information. - */ -export declare interface Query extends QueryContext { - /** The `DatabaseReference` for the `Query`'s location. */ - readonly ref: DatabaseReference; - /** - * Returns whether or not the current and provided queries represent the same - * location, have the same query parameters, and are from the same instance of - * `FirebaseApp`. - * - * Two `DatabaseReference` objects are equivalent if they represent the same location - * and are from the same instance of `FirebaseApp`. - * - * Two `Query` objects are equivalent if they represent the same location, - * have the same query parameters, and are from the same instance of - * `FirebaseApp`. Equivalent queries share the same sort order, limits, and - * starting and ending points. - * - * @param other - The query to compare against. - * @returns Whether or not the current and provided queries are equivalent. - */ - isEqual(other: Query | null): boolean; - /** - * Returns a JSON-serializable representation of this object. - * - * @returns A JSON-serializable representation of this object. - */ - toJSON(): string; - /** - * Gets the absolute URL for this location. - * - * The `toString()` method returns a URL that is ready to be put into a - * browser, curl command, or a `refFromURL()` call. Since all of those expect - * the URL to be url-encoded, `toString()` returns an encoded URL. - * - * Append '.json' to the returned URL when typed into a browser to download - * JSON-formatted data. If the location is secured (that is, not publicly - * readable), you will get a permission-denied error. - * - * @returns The absolute URL for this location. - */ - toString(): string; -} - -/** - * Creates a new immutable instance of `Query` that is extended to also include - * additional query constraints. - * - * @param query - The Query instance to use as a base for the new constraints. - * @param queryConstraints - The list of `QueryConstraint`s to apply. - * @throws if any of the provided query constraints cannot be combined with the - * existing or new constraints. - */ -export declare function query(query: Query, ...queryConstraints: QueryConstraint[]): Query; - -/** - * A `QueryConstraint` is used to narrow the set of documents returned by a - * Database query. `QueryConstraint`s are created by invoking {@link endAt}, - * {@link endBefore}, {@link startAt}, {@link startAfter}, {@link - * limitToFirst}, {@link limitToLast}, {@link orderByChild}, - * {@link orderByChild}, {@link orderByKey} , {@link orderByPriority} , - * {@link orderByValue} or {@link equalTo} and - * can then be passed to {@link query} to create a new query instance that - * also contains this `QueryConstraint`. - */ -export declare abstract class QueryConstraint { - /** The type of this query constraints */ - abstract readonly type: QueryConstraintType; - /** - * Takes the provided `Query` and returns a copy of the `Query` with this - * `QueryConstraint` applied. - */ - abstract _apply(query: _QueryImpl): _QueryImpl; -} - -/** Describes the different query constraints available in this SDK. */ -export declare type QueryConstraintType = 'endAt' | 'endBefore' | 'startAt' | 'startAfter' | 'limitToFirst' | 'limitToLast' | 'orderByChild' | 'orderByKey' | 'orderByPriority' | 'orderByValue' | 'equalTo'; - -declare interface QueryContext { - readonly _queryIdentifier: string; - readonly _queryObject: object; - readonly _repo: Repo; - readonly _path: Path; - readonly _queryParams: _QueryParams; -} - -/* Excluded from this release type: _QueryImpl */ - -/* Excluded from this release type: _QueryParams */ - -/** - * - * Returns a `Reference` representing the location in the Database - * corresponding to the provided path. If no path is provided, the `Reference` - * will point to the root of the Database. - * - * @param db - The database instance to obtain a reference for. - * @param path - Optional path representing the location the returned - * `Reference` will point. If not provided, the returned `Reference` will - * point to the root of the Database. - * @returns If a path is provided, a `Reference` - * pointing to the provided path. Otherwise, a `Reference` pointing to the - * root of the Database. - */ -export declare function ref(db: Database, path?: string): DatabaseReference; - -/* Excluded from this release type: _ReferenceImpl */ - -/** - * Returns a `Reference` representing the location in the Database - * corresponding to the provided Firebase URL. - * - * An exception is thrown if the URL is not a valid Firebase Database URL or it - * has a different domain than the current `Database` instance. - * - * Note that all query parameters (`orderBy`, `limitToLast`, etc.) are ignored - * and are not applied to the returned `Reference`. - * - * @param db - The database instance to obtain a reference for. - * @param url - The Firebase URL at which the returned `Reference` will - * point. - * @returns A `Reference` pointing to the provided - * Firebase URL. - */ -export declare function refFromURL(db: Database, url: string): DatabaseReference; - -/** - * Removes the data at this Database location. - * - * Any data at child locations will also be deleted. - * - * The effect of the remove will be visible immediately and the corresponding - * event 'value' will be triggered. Synchronization of the remove to the - * Firebase servers will also be started, and the returned Promise will resolve - * when complete. If provided, the onComplete callback will be called - * asynchronously after synchronization has finished. - * - * @param ref - The location to remove. - * @returns Resolves when remove on server is complete. - */ -export declare function remove(ref: DatabaseReference): Promise; - -/** - * A connection to a single data repository. - */ -declare class Repo { - repoInfo_: RepoInfo; - forceRestClient_: boolean; - authTokenProvider_: AuthTokenProvider; - appCheckProvider_: AppCheckTokenProvider; - /** Key for uniquely identifying this repo, used in RepoManager */ - readonly key: string; - dataUpdateCount: number; - infoSyncTree_: SyncTree; - serverSyncTree_: SyncTree; - stats_: StatsCollection; - statsListener_: StatsListener | null; - eventQueue_: EventQueue; - nextWriteId_: number; - server_: ServerActions; - statsReporter_: StatsReporter; - infoData_: SnapshotHolder; - interceptServerDataCallback_: ((a: string, b: unknown) => void) | null; - /** A list of data pieces and paths to be set when this client disconnects. */ - onDisconnect_: SparseSnapshotTree; - /** Stores queues of outstanding transactions for Firebase locations. */ - transactionQueueTree_: Tree; - persistentConnection_: PersistentConnection | null; - constructor(repoInfo_: RepoInfo, forceRestClient_: boolean, authTokenProvider_: AuthTokenProvider, appCheckProvider_: AppCheckTokenProvider); - /** - * @returns The URL corresponding to the root of this Firebase. - */ - toString(): string; -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * A class that holds metadata about a Repo object - */ -declare class RepoInfo { - readonly secure: boolean; - readonly namespace: string; - readonly webSocketOnly: boolean; - readonly nodeAdmin: boolean; - readonly persistenceKey: string; - readonly includeNamespaceInQueryParams: boolean; - private _host; - private _domain; - internalHost: string; - /** - * @param host - Hostname portion of the url for the repo - * @param secure - Whether or not this repo is accessed over ssl - * @param namespace - The namespace represented by the repo - * @param webSocketOnly - Whether to prefer websockets over all other transports (used by Nest). - * @param nodeAdmin - Whether this instance uses Admin SDK credentials - * @param persistenceKey - Override the default session persistence storage key - */ - constructor(host: string, secure: boolean, namespace: string, webSocketOnly: boolean, nodeAdmin?: boolean, persistenceKey?: string, includeNamespaceInQueryParams?: boolean); - isCacheableHost(): boolean; - isCustomHost(): boolean; - get host(): string; - set host(newHost: string); - toString(): string; - toURLString(): string; -} - -/* Excluded from this release type: _repoManagerDatabaseFromApp */ - -/** - * Atomically modifies the data at this location. - * - * Atomically modify the data at this location. Unlike a normal `set()`, which - * just overwrites the data regardless of its previous value, `runTransaction()` is - * used to modify the existing value to a new value, ensuring there are no - * conflicts with other clients writing to the same location at the same time. - * - * To accomplish this, you pass `runTransaction()` an update function which is - * used to transform the current value into a new value. If another client - * writes to the location before your new value is successfully written, your - * update function will be called again with the new current value, and the - * write will be retried. This will happen repeatedly until your write succeeds - * without conflict or you abort the transaction by not returning a value from - * your update function. - * - * Note: Modifying data with `set()` will cancel any pending transactions at - * that location, so extreme care should be taken if mixing `set()` and - * `runTransaction()` to update the same data. - * - * Note: When using transactions with Security and Firebase Rules in place, be - * aware that a client needs `.read` access in addition to `.write` access in - * order to perform a transaction. This is because the client-side nature of - * transactions requires the client to read the data in order to transactionally - * update it. - * - * @param ref - The location to atomically modify. - * @param transactionUpdate - A developer-supplied function which will be passed - * the current data stored at this location (as a JavaScript object). The - * function should return the new value it would like written (as a JavaScript - * object). If `undefined` is returned (i.e. you return with no arguments) the - * transaction will be aborted and the data at this location will not be - * modified. - * @param options - An options object to configure transactions. - * @returns A `Promise` that can optionally be used instead of the `onComplete` - * callback to handle success and failure. - */ -export declare function runTransaction(ref: DatabaseReference, transactionUpdate: (currentData: any) => unknown, options?: TransactionOptions): Promise; - -/** - * Interface defining the set of actions that can be performed against the Firebase server - * (basically corresponds to our wire protocol). - * - * @interface - */ -declare abstract class ServerActions { - abstract listen(query: QueryContext, currentHashFn: () => string, tag: number | null, onComplete: (a: string, b: unknown) => void): void; - /** - * Remove a listen. - */ - abstract unlisten(query: QueryContext, tag: number | null): void; - /** - * Get the server value satisfying this query. - */ - abstract get(query: QueryContext): Promise; - put(pathString: string, data: unknown, onComplete?: (a: string, b: string) => void, hash?: string): void; - merge(pathString: string, data: unknown, onComplete: (a: string, b: string | null) => void, hash?: string): void; - /** - * Refreshes the auth token for the current connection. - * @param token - The authentication token - */ - refreshAuthToken(token: string): void; - /** - * Refreshes the app check token for the current connection. - * @param token The app check token - */ - refreshAppCheckToken(token: string): void; - onDisconnectPut(pathString: string, data: unknown, onComplete?: (a: string, b: string) => void): void; - onDisconnectMerge(pathString: string, data: unknown, onComplete?: (a: string, b: string) => void): void; - onDisconnectCancel(pathString: string, onComplete?: (a: string, b: string) => void): void; - reportStats(stats: { - [k: string]: unknown; - }): void; -} - -/** - * @license - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Returns a placeholder value for auto-populating the current timestamp (time - * since the Unix epoch, in milliseconds) as determined by the Firebase - * servers. - */ -export declare function serverTimestamp(): object; - -/** - * Writes data to this Database location. - * - * This will overwrite any data at this location and all child locations. - * - * The effect of the write will be visible immediately, and the corresponding - * events ("value", "child_added", etc.) will be triggered. Synchronization of - * the data to the Firebase servers will also be started, and the returned - * Promise will resolve when complete. If provided, the `onComplete` callback - * will be called asynchronously after synchronization has finished. - * - * Passing `null` for the new value is equivalent to calling `remove()`; namely, - * all data at this location and all child locations will be deleted. - * - * `set()` will remove any priority stored at this location, so if priority is - * meant to be preserved, you need to use `setWithPriority()` instead. - * - * Note that modifying data with `set()` will cancel any pending transactions - * at that location, so extreme care should be taken if mixing `set()` and - * `transaction()` to modify the same data. - * - * A single `set()` will generate a single "value" event at the location where - * the `set()` was performed. - * - * @param ref - The location to write to. - * @param value - The value to be written (string, number, boolean, object, - * array, or null). - * @returns Resolves when write to server is complete. - */ -export declare function set(ref: DatabaseReference, value: unknown): Promise; - -/** - * Sets a priority for the data at this Database location. - * - * Applications need not use priority but can order collections by - * ordinary properties (see - * {@link https://firebase.google.com/docs/database/web/lists-of-data#sorting_and_filtering_data | Sorting and filtering data} - * ). - * - * @param ref - The location to write to. - * @param priority - The priority to be written (string, number, or null). - * @returns Resolves when write to server is complete. - */ -export declare function setPriority(ref: DatabaseReference, priority: string | number | null): Promise; - -/* Excluded from this release type: _setSDKVersion */ - -/** - * Writes data the Database location. Like `set()` but also specifies the - * priority for that data. - * - * Applications need not use priority but can order collections by - * ordinary properties (see - * {@link https://firebase.google.com/docs/database/web/lists-of-data#sorting_and_filtering_data | Sorting and filtering data} - * ). - * - * @param ref - The location to write to. - * @param value - The value to be written (string, number, boolean, object, - * array, or null). - * @param priority - The priority to be written (string, number, or null). - * @returns Resolves when write to server is complete. - */ -export declare function setWithPriority(ref: DatabaseReference, value: unknown, priority: string | number | null): Promise; - -/** - * Mutable object which basically just stores a reference to the "latest" immutable snapshot. - */ -declare class SnapshotHolder { - private rootNode_; - getNode(path: Path): Node_2; - updateSnapshot(path: Path, newSnapshotNode: Node_2): void; -} - -/** - * An immutable sorted map implementation, based on a Left-leaning Red-Black - * tree. - */ -declare class SortedMap { - private comparator_; - private root_; - /** - * Always use the same empty node, to reduce memory. - */ - static EMPTY_NODE: LLRBEmptyNode; - /** - * @param comparator_ - Key comparator. - * @param root_ - Optional root node for the map. - */ - constructor(comparator_: Comparator, root_?: LLRBNode | LLRBEmptyNode); - /** - * Returns a copy of the map, with the specified key/value added or replaced. - * (TODO: We should perhaps rename this method to 'put') - * - * @param key - Key to be added. - * @param value - Value to be added. - * @returns New map, with item added. - */ - insert(key: K, value: V): SortedMap; - /** - * Returns a copy of the map, with the specified key removed. - * - * @param key - The key to remove. - * @returns New map, with item removed. - */ - remove(key: K): SortedMap; - /** - * Returns the value of the node with the given key, or null. - * - * @param key - The key to look up. - * @returns The value of the node with the given key, or null if the - * key doesn't exist. - */ - get(key: K): V | null; - /** - * Returns the key of the item *before* the specified key, or null if key is the first item. - * @param key - The key to find the predecessor of - * @returns The predecessor key. - */ - getPredecessorKey(key: K): K | null; - /** - * @returns True if the map is empty. - */ - isEmpty(): boolean; - /** - * @returns The total number of nodes in the map. - */ - count(): number; - /** - * @returns The minimum key in the map. - */ - minKey(): K | null; - /** - * @returns The maximum key in the map. - */ - maxKey(): K | null; - /** - * Traverses the map in key order and calls the specified action function - * for each key/value pair. - * - * @param action - Callback function to be called - * for each key/value pair. If action returns true, traversal is aborted. - * @returns The first truthy value returned by action, or the last falsey - * value returned by action - */ - inorderTraversal(action: (k: K, v: V) => unknown): boolean; - /** - * Traverses the map in reverse key order and calls the specified action function - * for each key/value pair. - * - * @param action - Callback function to be called - * for each key/value pair. If action returns true, traversal is aborted. - * @returns True if the traversal was aborted. - */ - reverseTraversal(action: (k: K, v: V) => void): boolean; - /** - * Returns an iterator over the SortedMap. - * @returns The iterator. - */ - getIterator(resultGenerator?: (k: K, v: V) => T): SortedMapIterator; - getIteratorFrom(key: K, resultGenerator?: (k: K, v: V) => T): SortedMapIterator; - getReverseIteratorFrom(key: K, resultGenerator?: (k: K, v: V) => T): SortedMapIterator; - getReverseIterator(resultGenerator?: (k: K, v: V) => T): SortedMapIterator; -} - -/** - * An iterator over an LLRBNode. - */ -declare class SortedMapIterator { - private isReverse_; - private resultGenerator_; - private nodeStack_; - /** - * @param node - Node to iterate. - * @param isReverse_ - Whether or not to iterate in reverse - */ - constructor(node: LLRBNode | LLRBEmptyNode, startKey: K | null, comparator: Comparator, isReverse_: boolean, resultGenerator_?: ((k: K, v: V) => T) | null); - getNext(): T; - hasNext(): boolean; - peek(): T; -} - -/** - * Helper class to store a sparse set of snapshots. - */ -declare interface SparseSnapshotTree { - value: Node_2 | null; - readonly children: Map; -} - -/** - * Creates a `QueryConstraint` with the specified starting point (exclusive). - * - * Using `startAt()`, `startAfter()`, `endBefore()`, `endAt()` and `equalTo()` - * allows you to choose arbitrary starting and ending points for your queries. - * - * The starting point is exclusive. If only a value is provided, children - * with a value greater than the specified value will be included in the query. - * If a key is specified, then children must have a value greater than or equal - * to the specified value and a a key name greater than the specified key. - * - * @param value - The value to start after. The argument type depends on which - * `orderBy*()` function was used in this query. Specify a value that matches - * the `orderBy*()` type. When used in combination with `orderByKey()`, the - * value must be a string. - * @param key - The child key to start after. This argument is only allowed if - * ordering by child, value, or priority. - */ -export declare function startAfter(value: number | string | boolean | null, key?: string): QueryConstraint; - -/** - * Creates a `QueryConstraint` with the specified starting point. - * - * Using `startAt()`, `startAfter()`, `endBefore()`, `endAt()` and `equalTo()` - * allows you to choose arbitrary starting and ending points for your queries. - * - * The starting point is inclusive, so children with exactly the specified value - * will be included in the query. The optional key argument can be used to - * further limit the range of the query. If it is specified, then children that - * have exactly the specified value must also have a key name greater than or - * equal to the specified key. - * - * You can read more about `startAt()` in - * {@link https://firebase.google.com/docs/database/web/lists-of-data#filtering_data | Filtering data}. - * - * @param value - The value to start at. The argument type depends on which - * `orderBy*()` function was used in this query. Specify a value that matches - * the `orderBy*()` type. When used in combination with `orderByKey()`, the - * value must be a string. - * @param key - The child key to start at. This argument is only allowed if - * ordering by child, value, or priority. - */ -export declare function startAt(value?: number | string | boolean | null, key?: string): QueryConstraint; - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Tracks a collection of stats. - */ -declare class StatsCollection { - private counters_; - incrementCounter(name: string, amount?: number): void; - get(): { - [k: string]: number; - }; -} - -/** - * Returns the delta from the previous call to get stats. - * - * @param collection_ - The collection to "listen" to. - */ -declare class StatsListener { - private collection_; - private last_; - constructor(collection_: StatsCollection); - get(): { - [k: string]: number; - }; -} - -declare class StatsReporter { - private server_; - private statsListener_; - statsToReport_: { - [k: string]: boolean; - }; - constructor(collection: StatsCollection, server_: ServerActions); - private reportStats_; -} - -/** - * SyncPoint represents a single location in a SyncTree with 1 or more event registrations, meaning we need to - * maintain 1 or more Views at this location to cache server data and raise appropriate events for server changes - * and user writes (set, transaction, update). - * - * It's responsible for: - * - Maintaining the set of 1 or more views necessary at this location (a SyncPoint with 0 views should be removed). - * - Proxying user / server operations to the views as appropriate (i.e. applyServerOverwrite, - * applyUserOverwrite, etc.) - */ -declare class SyncPoint { - /** - * The Views being tracked at this location in the tree, stored as a map where the key is a - * queryId and the value is the View for that query. - * - * NOTE: This list will be quite small (usually 1, but perhaps 2 or 3; any more is an odd use case). - */ - readonly views: Map; -} - -/** - * SyncTree is the central class for managing event callback registration, data caching, views - * (query processing), and event generation. There are typically two SyncTree instances for - * each Repo, one for the normal Firebase data, and one for the .info data. - * - * It has a number of responsibilities, including: - * - Tracking all user event callbacks (registered via addEventRegistration() and removeEventRegistration()). - * - Applying and caching data changes for user set(), transaction(), and update() calls - * (applyUserOverwrite(), applyUserMerge()). - * - Applying and caching data changes for server data changes (applyServerOverwrite(), - * applyServerMerge()). - * - Generating user-facing events for server and user changes (all of the apply* methods - * return the set of events that need to be raised as a result). - * - Maintaining the appropriate set of server listens to ensure we are always subscribed - * to the correct set of paths and queries to satisfy the current set of user event - * callbacks (listens are started/stopped using the provided listenProvider). - * - * NOTE: Although SyncTree tracks event callbacks and calculates events to raise, the actual - * events are returned to the caller rather than raised synchronously. - * - */ -declare class SyncTree { - listenProvider_: ListenProvider; - /** - * Tree of SyncPoints. There's a SyncPoint at any location that has 1 or more views. - */ - syncPointTree_: ImmutableTree; - /** - * A tree of all pending user writes (user-initiated set()'s, transaction()'s, update()'s, etc.). - */ - pendingWriteTree_: WriteTree; - readonly tagToQueryMap: Map; - readonly queryToTagMap: Map; - /** - * @param listenProvider_ - Used by SyncTree to start / stop listening - * to server data. - */ - constructor(listenProvider_: ListenProvider); -} - -/* Excluded from this release type: _TEST_ACCESS_forceRestClient */ - -/* Excluded from this release type: _TEST_ACCESS_hijackHash */ - -/** - * A `Promise` that can also act as a `DatabaseReference` when returned by - * {@link push}. The reference is available immediately and the `Promise` resolves - * as the write to the backend completes. - */ -export declare interface ThenableReference extends DatabaseReference, Pick, 'then' | 'catch'> { -} - -declare interface Transaction { - path: Path; - update: (a: unknown) => unknown; - onComplete: (error: Error | null, committed: boolean, node: Node_2 | null) => void; - status: TransactionStatus; - order: number; - applyLocally: boolean; - retryCount: number; - unwatcher: () => void; - abortReason: string | null; - currentWriteId: number; - currentInputSnapshot: Node_2 | null; - currentOutputSnapshotRaw: Node_2 | null; - currentOutputSnapshotResolved: Node_2 | null; -} - -/** An options object to configure transactions. */ -export declare interface TransactionOptions { - /** - * By default, events are raised each time the transaction update function - * runs. So if it is run multiple times, you may see intermediate states. You - * can set this to false to suppress these intermediate states and instead - * wait until the transaction has completed before events are raised. - */ - readonly applyLocally?: boolean; -} - -/** - * A type for the resolve value of {@link runTransaction}. - */ -export declare class TransactionResult { - /** Whether the transaction was successfully committed. */ - readonly committed: boolean; - /** The resulting data snapshot. */ - readonly snapshot: DataSnapshot; - /** @hideconstructor */ - constructor( - /** Whether the transaction was successfully committed. */ - committed: boolean, - /** The resulting data snapshot. */ - snapshot: DataSnapshot); - /** Returns a JSON-serializable representation of this object. */ - toJSON(): object; -} - -declare const enum TransactionStatus { - RUN = 0, - SENT = 1, - COMPLETED = 2, - SENT_NEEDS_ABORT = 3, - NEEDS_ABORT = 4 -} - -/** - * A light-weight tree, traversable by path. Nodes can have both values and children. - * Nodes are not enumerated (by forEachChild) unless they have a value or non-empty - * children. - */ -declare class Tree { - readonly name: string; - readonly parent: Tree | null; - node: TreeNode; - /** - * @param name - Optional name of the node. - * @param parent - Optional parent node. - * @param node - Optional node to wrap. - */ - constructor(name?: string, parent?: Tree | null, node?: TreeNode); -} - -/** - * Node in a Tree. - */ -declare interface TreeNode { - children: Record>; - childCount: number; - value?: T; -} - -/** A callback that can invoked to remove a listener. */ -export declare type Unsubscribe = () => void; - -/** - * Writes multiple values to the Database at once. - * - * The `values` argument contains multiple property-value pairs that will be - * written to the Database together. Each child property can either be a simple - * property (for example, "name") or a relative path (for example, - * "name/first") from the current location to the data to update. - * - * As opposed to the `set()` method, `update()` can be use to selectively update - * only the referenced properties at the current location (instead of replacing - * all the child properties at the current location). - * - * The effect of the write will be visible immediately, and the corresponding - * events ('value', 'child_added', etc.) will be triggered. Synchronization of - * the data to the Firebase servers will also be started, and the returned - * Promise will resolve when complete. If provided, the `onComplete` callback - * will be called asynchronously after synchronization has finished. - * - * A single `update()` will generate a single "value" event at the location - * where the `update()` was performed, regardless of how many children were - * modified. - * - * Note that modifying data with `update()` will cancel any pending - * transactions at that location, so extreme care should be taken if mixing - * `update()` and `transaction()` to modify the same data. - * - * Passing `null` to `update()` will remove the data at this location. - * - * See - * {@link https://firebase.googleblog.com/2015/09/introducing-multi-location-updates-and_86.html | Introducing multi-location updates and more}. - * - * @param ref - The location to write to. - * @param values - Object containing multiple values. - * @returns Resolves when update on server is complete. - */ -export declare function update(ref: DatabaseReference, values: object): Promise; - -/* Excluded from this release type: _UserCallback */ - -/* Excluded from this release type: _validatePathString */ - -/* Excluded from this release type: _validateWritablePath */ - -/** - * A view represents a specific location and query that has 1 or more event registrations. - * - * It does several things: - * - Maintains the list of event registrations for this location/query. - * - Maintains a cache of the data visible for this location/query. - * - Applies new operations (via applyOperation), updates the cache, and based on the event - * registrations returns the set of events to be raised. - */ -declare class View { - private query_; - processor_: ViewProcessor; - viewCache_: ViewCache; - eventRegistrations_: EventRegistration[]; - eventGenerator_: EventGenerator; - constructor(query_: QueryContext, initialViewCache: ViewCache); - get query(): QueryContext; -} - -/** - * Stores the data we have cached for a view. - * - * serverSnap is the cached server data, eventSnap is the cached event data (server data plus any local writes). - */ -declare interface ViewCache { - readonly eventCache: CacheNode; - readonly serverCache: CacheNode; -} - -declare interface ViewProcessor { - readonly filter: NodeFilter_2; -} - -/** - * Defines a single user-initiated write operation. May be the result of a set(), transaction(), or update() call. In - * the case of a set() or transaction, snap wil be non-null. In the case of an update(), children will be non-null. - */ -declare interface WriteRecord { - writeId: number; - path: Path; - snap?: Node_2 | null; - children?: { - [k: string]: Node_2; - } | null; - visible: boolean; -} - -/** - * WriteTree tracks all pending user-initiated writes and has methods to calculate the result of merging them - * with underlying server data (to create "event cache" data). Pending writes are added with addOverwrite() - * and addMerge(), and removed with removeWrite(). - */ -declare interface WriteTree { - /** - * A tree tracking the result of applying all visible writes. This does not include transactions with - * applyLocally=false or writes that are completely shadowed by other writes. - */ - visibleWrites: CompoundWrite; - /** - * A list of all pending writes, regardless of visibility and shadowed-ness. Used to calculate arbitrary - * sets of the changed data, such as hidden writes (from transactions) or changes with certain writes excluded (also - * used by transactions). - */ - allWrites: WriteRecord[]; - lastWriteId: number; -} - -export { } diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/public.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/public.d.ts deleted file mode 100644 index dad4ce1f..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/public.d.ts +++ /dev/null @@ -1,1397 +0,0 @@ -/** - * Firebase Realtime Database - * - * @packageDocumentation - */ -import { FirebaseApp } from '@firebase/app'; -import { EmulatorMockTokenOptions } from '@firebase/util'; - -/** - * Gets a `Reference` for the location at the specified relative path. - * - * The relative path can either be a simple child name (for example, "ada") or - * a deeper slash-separated path (for example, "ada/name/first"). - * - * @param parent - The parent location. - * @param path - A relative path from this location to the desired child - * location. - * @returns The specified child location. - */ -export declare function child(parent: DatabaseReference, path: string): DatabaseReference; -/** - * Modify the provided instance to communicate with the Realtime Database - * emulator. - * - *

Note: This method must be called before performing any other operation. - * - * @param db - The instance to modify. - * @param host - The emulator host (ex: localhost) - * @param port - The emulator port (ex: 8080) - * @param options.mockUserToken - the mock auth token to use for unit testing Security Rules - */ -export declare function connectDatabaseEmulator(db: Database, host: string, port: number, options?: { - mockUserToken?: EmulatorMockTokenOptions | string; -}): void; -/** - * Class representing a Firebase Realtime Database. - */ -export declare class Database { - /** The {@link @firebase/app#FirebaseApp} associated with this Realtime Database instance. */ - readonly app: FirebaseApp; - /** Represents a `Database` instance. */ - readonly 'type' = "database"; - private constructor(); -} -/** - * A `DatabaseReference` represents a specific location in your Database and can be used - * for reading or writing data to that Database location. - * - * You can reference the root or child location in your Database by calling - * `ref()` or `ref("child/path")`. - * - * Writing is done with the `set()` method and reading can be done with the - * `on*()` method. See {@link - * https://firebase.google.com/docs/database/web/read-and-write} - */ -export declare interface DatabaseReference extends Query { - /** - * The last part of the `DatabaseReference`'s path. - * - * For example, `"ada"` is the key for - * `https://.firebaseio.com/users/ada`. - * - * The key of a root `DatabaseReference` is `null`. - */ - readonly key: string | null; - /** - * The parent location of a `DatabaseReference`. - * - * The parent of a root `DatabaseReference` is `null`. - */ - readonly parent: DatabaseReference | null; - /** The root `DatabaseReference` of the Database. */ - readonly root: DatabaseReference; -} -/** - * A `DataSnapshot` contains data from a Database location. - * - * Any time you read data from the Database, you receive the data as a - * `DataSnapshot`. A `DataSnapshot` is passed to the event callbacks you attach - * with `on()` or `once()`. You can extract the contents of the snapshot as a - * JavaScript object by calling the `val()` method. Alternatively, you can - * traverse into the snapshot by calling `child()` to return child snapshots - * (which you could then call `val()` on). - * - * A `DataSnapshot` is an efficiently generated, immutable copy of the data at - * a Database location. It cannot be modified and will never change (to modify - * data, you always call the `set()` method on a `Reference` directly). - */ -export declare class DataSnapshot { - /** - * The location of this DataSnapshot. - */ - readonly ref: DatabaseReference; - private constructor(); - /** - * Gets the priority value of the data in this `DataSnapshot`. - * - * Applications need not use priority but can order collections by - * ordinary properties (see - * {@link https://firebase.google.com/docs/database/web/lists-of-data#sorting_and_filtering_data |Sorting and filtering data} - * ). - */ - get priority(): string | number | null; - /** - * The key (last part of the path) of the location of this `DataSnapshot`. - * - * The last token in a Database location is considered its key. For example, - * "ada" is the key for the /users/ada/ node. Accessing the key on any - * `DataSnapshot` will return the key for the location that generated it. - * However, accessing the key on the root URL of a Database will return - * `null`. - */ - get key(): string | null; - /** Returns the number of child properties of this `DataSnapshot`. */ - get size(): number; - /** - * Gets another `DataSnapshot` for the location at the specified relative path. - * - * Passing a relative path to the `child()` method of a DataSnapshot returns - * another `DataSnapshot` for the location at the specified relative path. The - * relative path can either be a simple child name (for example, "ada") or a - * deeper, slash-separated path (for example, "ada/name/first"). If the child - * location has no data, an empty `DataSnapshot` (that is, a `DataSnapshot` - * whose value is `null`) is returned. - * - * @param path - A relative path to the location of child data. - */ - child(path: string): DataSnapshot; - /** - * Returns true if this `DataSnapshot` contains any data. It is slightly more - * efficient than using `snapshot.val() !== null`. - */ - exists(): boolean; - /** - * Exports the entire contents of the DataSnapshot as a JavaScript object. - * - * The `exportVal()` method is similar to `val()`, except priority information - * is included (if available), making it suitable for backing up your data. - * - * @returns The DataSnapshot's contents as a JavaScript value (Object, - * Array, string, number, boolean, or `null`). - */ - exportVal(): any; - /** - * Enumerates the top-level children in the `DataSnapshot`. - * - * Because of the way JavaScript objects work, the ordering of data in the - * JavaScript object returned by `val()` is not guaranteed to match the - * ordering on the server nor the ordering of `onChildAdded()` events. That is - * where `forEach()` comes in handy. It guarantees the children of a - * `DataSnapshot` will be iterated in their query order. - * - * If no explicit `orderBy*()` method is used, results are returned - * ordered by key (unless priorities are used, in which case, results are - * returned by priority). - * - * @param action - A function that will be called for each child DataSnapshot. - * The callback can return true to cancel further enumeration. - * @returns true if enumeration was canceled due to your callback returning - * true. - */ - forEach(action: (child: DataSnapshot) => boolean | void): boolean; - /** - * Returns true if the specified child path has (non-null) data. - * - * @param path - A relative path to the location of a potential child. - * @returns `true` if data exists at the specified child path; else - * `false`. - */ - hasChild(path: string): boolean; - /** - * Returns whether or not the `DataSnapshot` has any non-`null` child - * properties. - * - * You can use `hasChildren()` to determine if a `DataSnapshot` has any - * children. If it does, you can enumerate them using `forEach()`. If it - * doesn't, then either this snapshot contains a primitive value (which can be - * retrieved with `val()`) or it is empty (in which case, `val()` will return - * `null`). - * - * @returns true if this snapshot has any children; else false. - */ - hasChildren(): boolean; - /** - * Returns a JSON-serializable representation of this object. - */ - toJSON(): object | null; - /** - * Extracts a JavaScript value from a `DataSnapshot`. - * - * Depending on the data in a `DataSnapshot`, the `val()` method may return a - * scalar type (string, number, or boolean), an array, or an object. It may - * also return null, indicating that the `DataSnapshot` is empty (contains no - * data). - * - * @returns The DataSnapshot's contents as a JavaScript value (Object, - * Array, string, number, boolean, or `null`). - */ - val(): any; -} -export { EmulatorMockTokenOptions }; -/** - * Logs debugging information to the console. - * - * @param enabled - Enables logging if `true`, disables logging if `false`. - * @param persistent - Remembers the logging state between page refreshes if - * `true`. - */ -export declare function enableLogging(enabled: boolean, persistent?: boolean): any; -/** - * Logs debugging information to the console. - * - * @param logger - A custom logger function to control how things get logged. - */ -export declare function enableLogging(logger: (message: string) => unknown): any; -/** - * Creates a `QueryConstraint` with the specified ending point. - * - * Using `startAt()`, `startAfter()`, `endBefore()`, `endAt()` and `equalTo()` - * allows you to choose arbitrary starting and ending points for your queries. - * - * The ending point is inclusive, so children with exactly the specified value - * will be included in the query. The optional key argument can be used to - * further limit the range of the query. If it is specified, then children that - * have exactly the specified value must also have a key name less than or equal - * to the specified key. - * - * You can read more about `endAt()` in - * {@link https://firebase.google.com/docs/database/web/lists-of-data#filtering_data | Filtering data}. - * - * @param value - The value to end at. The argument type depends on which - * `orderBy*()` function was used in this query. Specify a value that matches - * the `orderBy*()` type. When used in combination with `orderByKey()`, the - * value must be a string. - * @param key - The child key to end at, among the children with the previously - * specified priority. This argument is only allowed if ordering by child, - * value, or priority. - */ -export declare function endAt(value: number | string | boolean | null, key?: string): QueryConstraint; -/** - * Creates a `QueryConstraint` with the specified ending point (exclusive). - * - * Using `startAt()`, `startAfter()`, `endBefore()`, `endAt()` and `equalTo()` - * allows you to choose arbitrary starting and ending points for your queries. - * - * The ending point is exclusive. If only a value is provided, children - * with a value less than the specified value will be included in the query. - * If a key is specified, then children must have a value less than or equal - * to the specified value and a key name less than the specified key. - * - * @param value - The value to end before. The argument type depends on which - * `orderBy*()` function was used in this query. Specify a value that matches - * the `orderBy*()` type. When used in combination with `orderByKey()`, the - * value must be a string. - * @param key - The child key to end before, among the children with the - * previously specified priority. This argument is only allowed if ordering by - * child, value, or priority. - */ -export declare function endBefore(value: number | string | boolean | null, key?: string): QueryConstraint; -/** - * Creates a `QueryConstraint` that includes children that match the specified - * value. - * - * Using `startAt()`, `startAfter()`, `endBefore()`, `endAt()` and `equalTo()` - * allows you to choose arbitrary starting and ending points for your queries. - * - * The optional key argument can be used to further limit the range of the - * query. If it is specified, then children that have exactly the specified - * value must also have exactly the specified key as their key name. This can be - * used to filter result sets with many matches for the same value. - * - * You can read more about `equalTo()` in - * {@link https://firebase.google.com/docs/database/web/lists-of-data#filtering_data | Filtering data}. - * - * @param value - The value to match for. The argument type depends on which - * `orderBy*()` function was used in this query. Specify a value that matches - * the `orderBy*()` type. When used in combination with `orderByKey()`, the - * value must be a string. - * @param key - The child key to start at, among the children with the - * previously specified priority. This argument is only allowed if ordering by - * child, value, or priority. - */ -export declare function equalTo(value: number | string | boolean | null, key?: string): QueryConstraint; -/** - * One of the following strings: "value", "child_added", "child_changed", - * "child_removed", or "child_moved." - */ -export declare type EventType = 'value' | 'child_added' | 'child_changed' | 'child_moved' | 'child_removed'; -/* Excluded from this release type: _FirebaseService */ -/** - * Force the use of longPolling instead of websockets. This will be ignored if websocket protocol is used in databaseURL. - */ -export declare function forceLongPolling(): void; -/** - * Force the use of websockets instead of longPolling. - */ -export declare function forceWebSockets(): void; -/** - * Gets the most up-to-date result for this query. - * - * @param query - The query to run. - * @returns A `Promise` which resolves to the resulting DataSnapshot if a value is - * available, or rejects if the client is unable to return a value (e.g., if the - * server is unreachable and there is nothing cached). - */ -export declare function get(query: Query): Promise; -/** - * Returns the instance of the Realtime Database SDK that is associated - * with the provided {@link @firebase/app#FirebaseApp}. Initializes a new instance with - * with default settings if no instance exists or if the existing instance uses - * a custom database URL. - * - * @param app - The {@link @firebase/app#FirebaseApp} instance that the returned Realtime - * Database instance is associated with. - * @param url - The URL of the Realtime Database instance to connect to. If not - * provided, the SDK connects to the default instance of the Firebase App. - * @returns The `Database` instance of the provided app. - */ -export declare function getDatabase(app?: FirebaseApp, url?: string): Database; -/** - * Disconnects from the server (all Database operations will be completed - * offline). - * - * The client automatically maintains a persistent connection to the Database - * server, which will remain active indefinitely and reconnect when - * disconnected. However, the `goOffline()` and `goOnline()` methods may be used - * to control the client connection in cases where a persistent connection is - * undesirable. - * - * While offline, the client will no longer receive data updates from the - * Database. However, all Database operations performed locally will continue to - * immediately fire events, allowing your application to continue behaving - * normally. Additionally, each operation performed locally will automatically - * be queued and retried upon reconnection to the Database server. - * - * To reconnect to the Database and begin receiving remote events, see - * `goOnline()`. - * - * @param db - The instance to disconnect. - */ -export declare function goOffline(db: Database): void; -/** - * Reconnects to the server and synchronizes the offline Database state - * with the server state. - * - * This method should be used after disabling the active connection with - * `goOffline()`. Once reconnected, the client will transmit the proper data - * and fire the appropriate events so that your client "catches up" - * automatically. - * - * @param db - The instance to reconnect. - */ -export declare function goOnline(db: Database): void; -/** - * Returns a placeholder value that can be used to atomically increment the - * current database value by the provided delta. - * - * @param delta - the amount to modify the current value atomically. - * @returns A placeholder value for modifying data atomically server-side. - */ -export declare function increment(delta: number): object; -/** - * Creates a new `QueryConstraint` that if limited to the first specific number - * of children. - * - * The `limitToFirst()` method is used to set a maximum number of children to be - * synced for a given callback. If we set a limit of 100, we will initially only - * receive up to 100 `child_added` events. If we have fewer than 100 messages - * stored in our Database, a `child_added` event will fire for each message. - * However, if we have over 100 messages, we will only receive a `child_added` - * event for the first 100 ordered messages. As items change, we will receive - * `child_removed` events for each item that drops out of the active list so - * that the total number stays at 100. - * - * You can read more about `limitToFirst()` in - * {@link https://firebase.google.com/docs/database/web/lists-of-data#filtering_data | Filtering data}. - * - * @param limit - The maximum number of nodes to include in this query. - */ -export declare function limitToFirst(limit: number): QueryConstraint; -/** - * Creates a new `QueryConstraint` that is limited to return only the last - * specified number of children. - * - * The `limitToLast()` method is used to set a maximum number of children to be - * synced for a given callback. If we set a limit of 100, we will initially only - * receive up to 100 `child_added` events. If we have fewer than 100 messages - * stored in our Database, a `child_added` event will fire for each message. - * However, if we have over 100 messages, we will only receive a `child_added` - * event for the last 100 ordered messages. As items change, we will receive - * `child_removed` events for each item that drops out of the active list so - * that the total number stays at 100. - * - * You can read more about `limitToLast()` in - * {@link https://firebase.google.com/docs/database/web/lists-of-data#filtering_data | Filtering data}. - * - * @param limit - The maximum number of nodes to include in this query. - */ -export declare function limitToLast(limit: number): QueryConstraint; -/** An options objects that can be used to customize a listener. */ -export declare interface ListenOptions { - /** Whether to remove the listener after its first invocation. */ - readonly onlyOnce?: boolean; -} -/** - * Detaches a callback previously attached with the corresponding `on*()` (`onValue`, `onChildAdded`) listener. - * Note: This is not the recommended way to remove a listener. Instead, please use the returned callback function from - * the respective `on*` callbacks. - * - * Detach a callback previously attached with `on*()`. Calling `off()` on a parent listener - * will not automatically remove listeners registered on child nodes, `off()` - * must also be called on any child listeners to remove the callback. - * - * If a callback is not specified, all callbacks for the specified eventType - * will be removed. Similarly, if no eventType is specified, all callbacks - * for the `Reference` will be removed. - * - * Individual listeners can also be removed by invoking their unsubscribe - * callbacks. - * - * @param query - The query that the listener was registered with. - * @param eventType - One of the following strings: "value", "child_added", - * "child_changed", "child_removed", or "child_moved." If omitted, all callbacks - * for the `Reference` will be removed. - * @param callback - The callback function that was passed to `on()` or - * `undefined` to remove all callbacks. - */ -export declare function off(query: Query, eventType?: EventType, callback?: (snapshot: DataSnapshot, previousChildName?: string | null) => unknown): void; -/** - * Listens for data changes at a particular location. - * - * This is the primary way to read data from a Database. Your callback - * will be triggered for the initial data and again whenever the data changes. - * Invoke the returned unsubscribe callback to stop receiving updates. See - * {@link https://firebase.google.com/docs/database/web/retrieve-data | Retrieve Data on the Web} - * for more details. - * - * An `onChildAdded` event will be triggered once for each initial child at this - * location, and it will be triggered again every time a new child is added. The - * `DataSnapshot` passed into the callback will reflect the data for the - * relevant child. For ordering purposes, it is passed a second argument which - * is a string containing the key of the previous sibling child by sort order, - * or `null` if it is the first child. - * - * @param query - The query to run. - * @param callback - A callback that fires when the specified event occurs. - * The callback will be passed a DataSnapshot and a string containing the key of - * the previous child, by sort order, or `null` if it is the first child. - * @param cancelCallback - An optional callback that will be notified if your - * event subscription is ever canceled because your client does not have - * permission to read this data (or it had permission but has now lost it). - * This callback will be passed an `Error` object indicating why the failure - * occurred. - * @returns A function that can be invoked to remove the listener. - */ -export declare function onChildAdded(query: Query, callback: (snapshot: DataSnapshot, previousChildName?: string | null) => unknown, cancelCallback?: (error: Error) => unknown): Unsubscribe; -/** - * Listens for data changes at a particular location. - * - * This is the primary way to read data from a Database. Your callback - * will be triggered for the initial data and again whenever the data changes. - * Invoke the returned unsubscribe callback to stop receiving updates. See - * {@link https://firebase.google.com/docs/database/web/retrieve-data | Retrieve Data on the Web} - * for more details. - * - * An `onChildAdded` event will be triggered once for each initial child at this - * location, and it will be triggered again every time a new child is added. The - * `DataSnapshot` passed into the callback will reflect the data for the - * relevant child. For ordering purposes, it is passed a second argument which - * is a string containing the key of the previous sibling child by sort order, - * or `null` if it is the first child. - * - * @param query - The query to run. - * @param callback - A callback that fires when the specified event occurs. - * The callback will be passed a DataSnapshot and a string containing the key of - * the previous child, by sort order, or `null` if it is the first child. - * @param options - An object that can be used to configure `onlyOnce`, which - * then removes the listener after its first invocation. - * @returns A function that can be invoked to remove the listener. - */ -export declare function onChildAdded(query: Query, callback: (snapshot: DataSnapshot, previousChildName: string | null) => unknown, options: ListenOptions): Unsubscribe; -/** - * Listens for data changes at a particular location. - * - * This is the primary way to read data from a Database. Your callback - * will be triggered for the initial data and again whenever the data changes. - * Invoke the returned unsubscribe callback to stop receiving updates. See - * {@link https://firebase.google.com/docs/database/web/retrieve-data | Retrieve Data on the Web} - * for more details. - * - * An `onChildAdded` event will be triggered once for each initial child at this - * location, and it will be triggered again every time a new child is added. The - * `DataSnapshot` passed into the callback will reflect the data for the - * relevant child. For ordering purposes, it is passed a second argument which - * is a string containing the key of the previous sibling child by sort order, - * or `null` if it is the first child. - * - * @param query - The query to run. - * @param callback - A callback that fires when the specified event occurs. - * The callback will be passed a DataSnapshot and a string containing the key of - * the previous child, by sort order, or `null` if it is the first child. - * @param cancelCallback - An optional callback that will be notified if your - * event subscription is ever canceled because your client does not have - * permission to read this data (or it had permission but has now lost it). - * This callback will be passed an `Error` object indicating why the failure - * occurred. - * @param options - An object that can be used to configure `onlyOnce`, which - * then removes the listener after its first invocation. - * @returns A function that can be invoked to remove the listener. - */ -export declare function onChildAdded(query: Query, callback: (snapshot: DataSnapshot, previousChildName: string | null) => unknown, cancelCallback: (error: Error) => unknown, options: ListenOptions): Unsubscribe; -/** - * Listens for data changes at a particular location. - * - * This is the primary way to read data from a Database. Your callback - * will be triggered for the initial data and again whenever the data changes. - * Invoke the returned unsubscribe callback to stop receiving updates. See - * {@link https://firebase.google.com/docs/database/web/retrieve-data | Retrieve Data on the Web} - * for more details. - * - * An `onChildChanged` event will be triggered when the data stored in a child - * (or any of its descendants) changes. Note that a single `child_changed` event - * may represent multiple changes to the child. The `DataSnapshot` passed to the - * callback will contain the new child contents. For ordering purposes, the - * callback is also passed a second argument which is a string containing the - * key of the previous sibling child by sort order, or `null` if it is the first - * child. - * - * @param query - The query to run. - * @param callback - A callback that fires when the specified event occurs. - * The callback will be passed a DataSnapshot and a string containing the key of - * the previous child, by sort order, or `null` if it is the first child. - * @param cancelCallback - An optional callback that will be notified if your - * event subscription is ever canceled because your client does not have - * permission to read this data (or it had permission but has now lost it). - * This callback will be passed an `Error` object indicating why the failure - * occurred. - * @returns A function that can be invoked to remove the listener. - */ -export declare function onChildChanged(query: Query, callback: (snapshot: DataSnapshot, previousChildName: string | null) => unknown, cancelCallback?: (error: Error) => unknown): Unsubscribe; -/** - * Listens for data changes at a particular location. - * - * This is the primary way to read data from a Database. Your callback - * will be triggered for the initial data and again whenever the data changes. - * Invoke the returned unsubscribe callback to stop receiving updates. See - * {@link https://firebase.google.com/docs/database/web/retrieve-data | Retrieve Data on the Web} - * for more details. - * - * An `onChildChanged` event will be triggered when the data stored in a child - * (or any of its descendants) changes. Note that a single `child_changed` event - * may represent multiple changes to the child. The `DataSnapshot` passed to the - * callback will contain the new child contents. For ordering purposes, the - * callback is also passed a second argument which is a string containing the - * key of the previous sibling child by sort order, or `null` if it is the first - * child. - * - * @param query - The query to run. - * @param callback - A callback that fires when the specified event occurs. - * The callback will be passed a DataSnapshot and a string containing the key of - * the previous child, by sort order, or `null` if it is the first child. - * @param options - An object that can be used to configure `onlyOnce`, which - * then removes the listener after its first invocation. - * @returns A function that can be invoked to remove the listener. - */ -export declare function onChildChanged(query: Query, callback: (snapshot: DataSnapshot, previousChildName: string | null) => unknown, options: ListenOptions): Unsubscribe; -/** - * Listens for data changes at a particular location. - * - * This is the primary way to read data from a Database. Your callback - * will be triggered for the initial data and again whenever the data changes. - * Invoke the returned unsubscribe callback to stop receiving updates. See - * {@link https://firebase.google.com/docs/database/web/retrieve-data | Retrieve Data on the Web} - * for more details. - * - * An `onChildChanged` event will be triggered when the data stored in a child - * (or any of its descendants) changes. Note that a single `child_changed` event - * may represent multiple changes to the child. The `DataSnapshot` passed to the - * callback will contain the new child contents. For ordering purposes, the - * callback is also passed a second argument which is a string containing the - * key of the previous sibling child by sort order, or `null` if it is the first - * child. - * - * @param query - The query to run. - * @param callback - A callback that fires when the specified event occurs. - * The callback will be passed a DataSnapshot and a string containing the key of - * the previous child, by sort order, or `null` if it is the first child. - * @param cancelCallback - An optional callback that will be notified if your - * event subscription is ever canceled because your client does not have - * permission to read this data (or it had permission but has now lost it). - * This callback will be passed an `Error` object indicating why the failure - * occurred. - * @param options - An object that can be used to configure `onlyOnce`, which - * then removes the listener after its first invocation. - * @returns A function that can be invoked to remove the listener. - */ -export declare function onChildChanged(query: Query, callback: (snapshot: DataSnapshot, previousChildName: string | null) => unknown, cancelCallback: (error: Error) => unknown, options: ListenOptions): Unsubscribe; -/** - * Listens for data changes at a particular location. - * - * This is the primary way to read data from a Database. Your callback - * will be triggered for the initial data and again whenever the data changes. - * Invoke the returned unsubscribe callback to stop receiving updates. See - * {@link https://firebase.google.com/docs/database/web/retrieve-data | Retrieve Data on the Web} - * for more details. - * - * An `onChildMoved` event will be triggered when a child's sort order changes - * such that its position relative to its siblings changes. The `DataSnapshot` - * passed to the callback will be for the data of the child that has moved. It - * is also passed a second argument which is a string containing the key of the - * previous sibling child by sort order, or `null` if it is the first child. - * - * @param query - The query to run. - * @param callback - A callback that fires when the specified event occurs. - * The callback will be passed a DataSnapshot and a string containing the key of - * the previous child, by sort order, or `null` if it is the first child. - * @param cancelCallback - An optional callback that will be notified if your - * event subscription is ever canceled because your client does not have - * permission to read this data (or it had permission but has now lost it). - * This callback will be passed an `Error` object indicating why the failure - * occurred. - * @returns A function that can be invoked to remove the listener. - */ -export declare function onChildMoved(query: Query, callback: (snapshot: DataSnapshot, previousChildName: string | null) => unknown, cancelCallback?: (error: Error) => unknown): Unsubscribe; -/** - * Listens for data changes at a particular location. - * - * This is the primary way to read data from a Database. Your callback - * will be triggered for the initial data and again whenever the data changes. - * Invoke the returned unsubscribe callback to stop receiving updates. See - * {@link https://firebase.google.com/docs/database/web/retrieve-data | Retrieve Data on the Web} - * for more details. - * - * An `onChildMoved` event will be triggered when a child's sort order changes - * such that its position relative to its siblings changes. The `DataSnapshot` - * passed to the callback will be for the data of the child that has moved. It - * is also passed a second argument which is a string containing the key of the - * previous sibling child by sort order, or `null` if it is the first child. - * - * @param query - The query to run. - * @param callback - A callback that fires when the specified event occurs. - * The callback will be passed a DataSnapshot and a string containing the key of - * the previous child, by sort order, or `null` if it is the first child. - * @param options - An object that can be used to configure `onlyOnce`, which - * then removes the listener after its first invocation. - * @returns A function that can be invoked to remove the listener. - */ -export declare function onChildMoved(query: Query, callback: (snapshot: DataSnapshot, previousChildName: string | null) => unknown, options: ListenOptions): Unsubscribe; -/** - * Listens for data changes at a particular location. - * - * This is the primary way to read data from a Database. Your callback - * will be triggered for the initial data and again whenever the data changes. - * Invoke the returned unsubscribe callback to stop receiving updates. See - * {@link https://firebase.google.com/docs/database/web/retrieve-data | Retrieve Data on the Web} - * for more details. - * - * An `onChildMoved` event will be triggered when a child's sort order changes - * such that its position relative to its siblings changes. The `DataSnapshot` - * passed to the callback will be for the data of the child that has moved. It - * is also passed a second argument which is a string containing the key of the - * previous sibling child by sort order, or `null` if it is the first child. - * - * @param query - The query to run. - * @param callback - A callback that fires when the specified event occurs. - * The callback will be passed a DataSnapshot and a string containing the key of - * the previous child, by sort order, or `null` if it is the first child. - * @param cancelCallback - An optional callback that will be notified if your - * event subscription is ever canceled because your client does not have - * permission to read this data (or it had permission but has now lost it). - * This callback will be passed an `Error` object indicating why the failure - * occurred. - * @param options - An object that can be used to configure `onlyOnce`, which - * then removes the listener after its first invocation. - * @returns A function that can be invoked to remove the listener. - */ -export declare function onChildMoved(query: Query, callback: (snapshot: DataSnapshot, previousChildName: string | null) => unknown, cancelCallback: (error: Error) => unknown, options: ListenOptions): Unsubscribe; -/** - * Listens for data changes at a particular location. - * - * This is the primary way to read data from a Database. Your callback - * will be triggered for the initial data and again whenever the data changes. - * Invoke the returned unsubscribe callback to stop receiving updates. See - * {@link https://firebase.google.com/docs/database/web/retrieve-data | Retrieve Data on the Web} - * for more details. - * - * An `onChildRemoved` event will be triggered once every time a child is - * removed. The `DataSnapshot` passed into the callback will be the old data for - * the child that was removed. A child will get removed when either: - * - * - a client explicitly calls `remove()` on that child or one of its ancestors - * - a client calls `set(null)` on that child or one of its ancestors - * - that child has all of its children removed - * - there is a query in effect which now filters out the child (because it's - * sort order changed or the max limit was hit) - * - * @param query - The query to run. - * @param callback - A callback that fires when the specified event occurs. - * The callback will be passed a DataSnapshot and a string containing the key of - * the previous child, by sort order, or `null` if it is the first child. - * @param cancelCallback - An optional callback that will be notified if your - * event subscription is ever canceled because your client does not have - * permission to read this data (or it had permission but has now lost it). - * This callback will be passed an `Error` object indicating why the failure - * occurred. - * @returns A function that can be invoked to remove the listener. - */ -export declare function onChildRemoved(query: Query, callback: (snapshot: DataSnapshot) => unknown, cancelCallback?: (error: Error) => unknown): Unsubscribe; -/** - * Listens for data changes at a particular location. - * - * This is the primary way to read data from a Database. Your callback - * will be triggered for the initial data and again whenever the data changes. - * Invoke the returned unsubscribe callback to stop receiving updates. See - * {@link https://firebase.google.com/docs/database/web/retrieve-data | Retrieve Data on the Web} - * for more details. - * - * An `onChildRemoved` event will be triggered once every time a child is - * removed. The `DataSnapshot` passed into the callback will be the old data for - * the child that was removed. A child will get removed when either: - * - * - a client explicitly calls `remove()` on that child or one of its ancestors - * - a client calls `set(null)` on that child or one of its ancestors - * - that child has all of its children removed - * - there is a query in effect which now filters out the child (because it's - * sort order changed or the max limit was hit) - * - * @param query - The query to run. - * @param callback - A callback that fires when the specified event occurs. - * The callback will be passed a DataSnapshot and a string containing the key of - * the previous child, by sort order, or `null` if it is the first child. - * @param options - An object that can be used to configure `onlyOnce`, which - * then removes the listener after its first invocation. - * @returns A function that can be invoked to remove the listener. - */ -export declare function onChildRemoved(query: Query, callback: (snapshot: DataSnapshot) => unknown, options: ListenOptions): Unsubscribe; -/** - * Listens for data changes at a particular location. - * - * This is the primary way to read data from a Database. Your callback - * will be triggered for the initial data and again whenever the data changes. - * Invoke the returned unsubscribe callback to stop receiving updates. See - * {@link https://firebase.google.com/docs/database/web/retrieve-data | Retrieve Data on the Web} - * for more details. - * - * An `onChildRemoved` event will be triggered once every time a child is - * removed. The `DataSnapshot` passed into the callback will be the old data for - * the child that was removed. A child will get removed when either: - * - * - a client explicitly calls `remove()` on that child or one of its ancestors - * - a client calls `set(null)` on that child or one of its ancestors - * - that child has all of its children removed - * - there is a query in effect which now filters out the child (because it's - * sort order changed or the max limit was hit) - * - * @param query - The query to run. - * @param callback - A callback that fires when the specified event occurs. - * The callback will be passed a DataSnapshot and a string containing the key of - * the previous child, by sort order, or `null` if it is the first child. - * @param cancelCallback - An optional callback that will be notified if your - * event subscription is ever canceled because your client does not have - * permission to read this data (or it had permission but has now lost it). - * This callback will be passed an `Error` object indicating why the failure - * occurred. - * @param options - An object that can be used to configure `onlyOnce`, which - * then removes the listener after its first invocation. - * @returns A function that can be invoked to remove the listener. - */ -export declare function onChildRemoved(query: Query, callback: (snapshot: DataSnapshot) => unknown, cancelCallback: (error: Error) => unknown, options: ListenOptions): Unsubscribe; -/** - * The `onDisconnect` class allows you to write or clear data when your client - * disconnects from the Database server. These updates occur whether your - * client disconnects cleanly or not, so you can rely on them to clean up data - * even if a connection is dropped or a client crashes. - * - * The `onDisconnect` class is most commonly used to manage presence in - * applications where it is useful to detect how many clients are connected and - * when other clients disconnect. See - * {@link https://firebase.google.com/docs/database/web/offline-capabilities | Enabling Offline Capabilities in JavaScript} - * for more information. - * - * To avoid problems when a connection is dropped before the requests can be - * transferred to the Database server, these functions should be called before - * writing any data. - * - * Note that `onDisconnect` operations are only triggered once. If you want an - * operation to occur each time a disconnect occurs, you'll need to re-establish - * the `onDisconnect` operations each time you reconnect. - */ -export declare class OnDisconnect { - private constructor(); - /** - * Cancels all previously queued `onDisconnect()` set or update events for this - * location and all children. - * - * If a write has been queued for this location via a `set()` or `update()` at a - * parent location, the write at this location will be canceled, though writes - * to sibling locations will still occur. - * - * @returns Resolves when synchronization to the server is complete. - */ - cancel(): Promise; - /** - * Ensures the data at this location is deleted when the client is disconnected - * (due to closing the browser, navigating to a new page, or network issues). - * - * @returns Resolves when synchronization to the server is complete. - */ - remove(): Promise; - /** - * Ensures the data at this location is set to the specified value when the - * client is disconnected (due to closing the browser, navigating to a new page, - * or network issues). - * - * `set()` is especially useful for implementing "presence" systems, where a - * value should be changed or cleared when a user disconnects so that they - * appear "offline" to other users. See - * {@link https://firebase.google.com/docs/database/web/offline-capabilities | Enabling Offline Capabilities in JavaScript} - * for more information. - * - * Note that `onDisconnect` operations are only triggered once. If you want an - * operation to occur each time a disconnect occurs, you'll need to re-establish - * the `onDisconnect` operations each time. - * - * @param value - The value to be written to this location on disconnect (can - * be an object, array, string, number, boolean, or null). - * @returns Resolves when synchronization to the Database is complete. - */ - set(value: unknown): Promise; - /** - * Ensures the data at this location is set to the specified value and priority - * when the client is disconnected (due to closing the browser, navigating to a - * new page, or network issues). - * - * @param value - The value to be written to this location on disconnect (can - * be an object, array, string, number, boolean, or null). - * @param priority - The priority to be written (string, number, or null). - * @returns Resolves when synchronization to the Database is complete. - */ - setWithPriority(value: unknown, priority: number | string | null): Promise; - /** - * Writes multiple values at this location when the client is disconnected (due - * to closing the browser, navigating to a new page, or network issues). - * - * The `values` argument contains multiple property-value pairs that will be - * written to the Database together. Each child property can either be a simple - * property (for example, "name") or a relative path (for example, "name/first") - * from the current location to the data to update. - * - * As opposed to the `set()` method, `update()` can be use to selectively update - * only the referenced properties at the current location (instead of replacing - * all the child properties at the current location). - * - * @param values - Object containing multiple values. - * @returns Resolves when synchronization to the Database is complete. - */ - update(values: object): Promise; -} -/** - * Returns an `OnDisconnect` object - see - * {@link https://firebase.google.com/docs/database/web/offline-capabilities | Enabling Offline Capabilities in JavaScript} - * for more information on how to use it. - * - * @param ref - The reference to add OnDisconnect triggers for. - */ -export declare function onDisconnect(ref: DatabaseReference): OnDisconnect; -/** - * Listens for data changes at a particular location. - * - * This is the primary way to read data from a Database. Your callback - * will be triggered for the initial data and again whenever the data changes. - * Invoke the returned unsubscribe callback to stop receiving updates. See - * {@link https://firebase.google.com/docs/database/web/retrieve-data | Retrieve Data on the Web} - * for more details. - * - * An `onValue` event will trigger once with the initial data stored at this - * location, and then trigger again each time the data changes. The - * `DataSnapshot` passed to the callback will be for the location at which - * `on()` was called. It won't trigger until the entire contents has been - * synchronized. If the location has no data, it will be triggered with an empty - * `DataSnapshot` (`val()` will return `null`). - * - * @param query - The query to run. - * @param callback - A callback that fires when the specified event occurs. The - * callback will be passed a DataSnapshot. - * @param cancelCallback - An optional callback that will be notified if your - * event subscription is ever canceled because your client does not have - * permission to read this data (or it had permission but has now lost it). - * This callback will be passed an `Error` object indicating why the failure - * occurred. - * @returns A function that can be invoked to remove the listener. - */ -export declare function onValue(query: Query, callback: (snapshot: DataSnapshot) => unknown, cancelCallback?: (error: Error) => unknown): Unsubscribe; -/** - * Listens for data changes at a particular location. - * - * This is the primary way to read data from a Database. Your callback - * will be triggered for the initial data and again whenever the data changes. - * Invoke the returned unsubscribe callback to stop receiving updates. See - * {@link https://firebase.google.com/docs/database/web/retrieve-data | Retrieve Data on the Web} - * for more details. - * - * An `onValue` event will trigger once with the initial data stored at this - * location, and then trigger again each time the data changes. The - * `DataSnapshot` passed to the callback will be for the location at which - * `on()` was called. It won't trigger until the entire contents has been - * synchronized. If the location has no data, it will be triggered with an empty - * `DataSnapshot` (`val()` will return `null`). - * - * @param query - The query to run. - * @param callback - A callback that fires when the specified event occurs. The - * callback will be passed a DataSnapshot. - * @param options - An object that can be used to configure `onlyOnce`, which - * then removes the listener after its first invocation. - * @returns A function that can be invoked to remove the listener. - */ -export declare function onValue(query: Query, callback: (snapshot: DataSnapshot) => unknown, options: ListenOptions): Unsubscribe; -/** - * Listens for data changes at a particular location. - * - * This is the primary way to read data from a Database. Your callback - * will be triggered for the initial data and again whenever the data changes. - * Invoke the returned unsubscribe callback to stop receiving updates. See - * {@link https://firebase.google.com/docs/database/web/retrieve-data | Retrieve Data on the Web} - * for more details. - * - * An `onValue` event will trigger once with the initial data stored at this - * location, and then trigger again each time the data changes. The - * `DataSnapshot` passed to the callback will be for the location at which - * `on()` was called. It won't trigger until the entire contents has been - * synchronized. If the location has no data, it will be triggered with an empty - * `DataSnapshot` (`val()` will return `null`). - * - * @param query - The query to run. - * @param callback - A callback that fires when the specified event occurs. The - * callback will be passed a DataSnapshot. - * @param cancelCallback - An optional callback that will be notified if your - * event subscription is ever canceled because your client does not have - * permission to read this data (or it had permission but has now lost it). - * This callback will be passed an `Error` object indicating why the failure - * occurred. - * @param options - An object that can be used to configure `onlyOnce`, which - * then removes the listener after its first invocation. - * @returns A function that can be invoked to remove the listener. - */ -export declare function onValue(query: Query, callback: (snapshot: DataSnapshot) => unknown, cancelCallback: (error: Error) => unknown, options: ListenOptions): Unsubscribe; -/** - * Creates a new `QueryConstraint` that orders by the specified child key. - * - * Queries can only order by one key at a time. Calling `orderByChild()` - * multiple times on the same query is an error. - * - * Firebase queries allow you to order your data by any child key on the fly. - * However, if you know in advance what your indexes will be, you can define - * them via the .indexOn rule in your Security Rules for better performance. See - * the{@link https://firebase.google.com/docs/database/security/indexing-data} - * rule for more information. - * - * You can read more about `orderByChild()` in - * {@link https://firebase.google.com/docs/database/web/lists-of-data#sort_data | Sort data}. - * - * @param path - The path to order by. - */ -export declare function orderByChild(path: string): QueryConstraint; -/** - * Creates a new `QueryConstraint` that orders by the key. - * - * Sorts the results of a query by their (ascending) key values. - * - * You can read more about `orderByKey()` in - * {@link https://firebase.google.com/docs/database/web/lists-of-data#sort_data | Sort data}. - */ -export declare function orderByKey(): QueryConstraint; -/** - * Creates a new `QueryConstraint` that orders by priority. - * - * Applications need not use priority but can order collections by - * ordinary properties (see - * {@link https://firebase.google.com/docs/database/web/lists-of-data#sort_data | Sort data} - * for alternatives to priority. - */ -export declare function orderByPriority(): QueryConstraint; -/** - * Creates a new `QueryConstraint` that orders by value. - * - * If the children of a query are all scalar values (string, number, or - * boolean), you can order the results by their (ascending) values. - * - * You can read more about `orderByValue()` in - * {@link https://firebase.google.com/docs/database/web/lists-of-data#sort_data | Sort data}. - */ -export declare function orderByValue(): QueryConstraint; -/** - * Generates a new child location using a unique key and returns its - * `Reference`. - * - * This is the most common pattern for adding data to a collection of items. - * - * If you provide a value to `push()`, the value is written to the - * generated location. If you don't pass a value, nothing is written to the - * database and the child remains empty (but you can use the `Reference` - * elsewhere). - * - * The unique keys generated by `push()` are ordered by the current time, so the - * resulting list of items is chronologically sorted. The keys are also - * designed to be unguessable (they contain 72 random bits of entropy). - * - * See {@link https://firebase.google.com/docs/database/web/lists-of-data#append_to_a_list_of_data | Append to a list of data}. - * See {@link https://firebase.googleblog.com/2015/02/the-2120-ways-to-ensure-unique_68.html | The 2^120 Ways to Ensure Unique Identifiers}. - * - * @param parent - The parent location. - * @param value - Optional value to be written at the generated location. - * @returns Combined `Promise` and `Reference`; resolves when write is complete, - * but can be used immediately as the `Reference` to the child location. - */ -export declare function push(parent: DatabaseReference, value?: unknown): ThenableReference; -/** - * @license - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * A `Query` sorts and filters the data at a Database location so only a subset - * of the child data is included. This can be used to order a collection of - * data by some attribute (for example, height of dinosaurs) as well as to - * restrict a large list of items (for example, chat messages) down to a number - * suitable for synchronizing to the client. Queries are created by chaining - * together one or more of the filter methods defined here. - * - * Just as with a `DatabaseReference`, you can receive data from a `Query` by using the - * `on*()` methods. You will only receive events and `DataSnapshot`s for the - * subset of the data that matches your query. - * - * See {@link https://firebase.google.com/docs/database/web/lists-of-data#sorting_and_filtering_data} - * for more information. - */ -export declare interface Query { - /** The `DatabaseReference` for the `Query`'s location. */ - readonly ref: DatabaseReference; - /** - * Returns whether or not the current and provided queries represent the same - * location, have the same query parameters, and are from the same instance of - * `FirebaseApp`. - * - * Two `DatabaseReference` objects are equivalent if they represent the same location - * and are from the same instance of `FirebaseApp`. - * - * Two `Query` objects are equivalent if they represent the same location, - * have the same query parameters, and are from the same instance of - * `FirebaseApp`. Equivalent queries share the same sort order, limits, and - * starting and ending points. - * - * @param other - The query to compare against. - * @returns Whether or not the current and provided queries are equivalent. - */ - isEqual(other: Query | null): boolean; - /** - * Returns a JSON-serializable representation of this object. - * - * @returns A JSON-serializable representation of this object. - */ - toJSON(): string; - /** - * Gets the absolute URL for this location. - * - * The `toString()` method returns a URL that is ready to be put into a - * browser, curl command, or a `refFromURL()` call. Since all of those expect - * the URL to be url-encoded, `toString()` returns an encoded URL. - * - * Append '.json' to the returned URL when typed into a browser to download - * JSON-formatted data. If the location is secured (that is, not publicly - * readable), you will get a permission-denied error. - * - * @returns The absolute URL for this location. - */ - toString(): string; -} -/** - * Creates a new immutable instance of `Query` that is extended to also include - * additional query constraints. - * - * @param query - The Query instance to use as a base for the new constraints. - * @param queryConstraints - The list of `QueryConstraint`s to apply. - * @throws if any of the provided query constraints cannot be combined with the - * existing or new constraints. - */ -export declare function query(query: Query, ...queryConstraints: QueryConstraint[]): Query; -/** - * A `QueryConstraint` is used to narrow the set of documents returned by a - * Database query. `QueryConstraint`s are created by invoking {@link endAt}, - * {@link endBefore}, {@link startAt}, {@link startAfter}, {@link - * limitToFirst}, {@link limitToLast}, {@link orderByChild}, - * {@link orderByChild}, {@link orderByKey} , {@link orderByPriority} , - * {@link orderByValue} or {@link equalTo} and - * can then be passed to {@link query} to create a new query instance that - * also contains this `QueryConstraint`. - */ -export declare abstract class QueryConstraint { - /** The type of this query constraints */ - abstract readonly type: QueryConstraintType; -} -/** Describes the different query constraints available in this SDK. */ -export declare type QueryConstraintType = 'endAt' | 'endBefore' | 'startAt' | 'startAfter' | 'limitToFirst' | 'limitToLast' | 'orderByChild' | 'orderByKey' | 'orderByPriority' | 'orderByValue' | 'equalTo'; -/* Excluded from this release type: _QueryImpl */ -/* Excluded from this release type: _QueryParams */ -/** - * - * Returns a `Reference` representing the location in the Database - * corresponding to the provided path. If no path is provided, the `Reference` - * will point to the root of the Database. - * - * @param db - The database instance to obtain a reference for. - * @param path - Optional path representing the location the returned - * `Reference` will point. If not provided, the returned `Reference` will - * point to the root of the Database. - * @returns If a path is provided, a `Reference` - * pointing to the provided path. Otherwise, a `Reference` pointing to the - * root of the Database. - */ -export declare function ref(db: Database, path?: string): DatabaseReference; -/* Excluded from this release type: _ReferenceImpl */ -/** - * Returns a `Reference` representing the location in the Database - * corresponding to the provided Firebase URL. - * - * An exception is thrown if the URL is not a valid Firebase Database URL or it - * has a different domain than the current `Database` instance. - * - * Note that all query parameters (`orderBy`, `limitToLast`, etc.) are ignored - * and are not applied to the returned `Reference`. - * - * @param db - The database instance to obtain a reference for. - * @param url - The Firebase URL at which the returned `Reference` will - * point. - * @returns A `Reference` pointing to the provided - * Firebase URL. - */ -export declare function refFromURL(db: Database, url: string): DatabaseReference; -/** - * Removes the data at this Database location. - * - * Any data at child locations will also be deleted. - * - * The effect of the remove will be visible immediately and the corresponding - * event 'value' will be triggered. Synchronization of the remove to the - * Firebase servers will also be started, and the returned Promise will resolve - * when complete. If provided, the onComplete callback will be called - * asynchronously after synchronization has finished. - * - * @param ref - The location to remove. - * @returns Resolves when remove on server is complete. - */ -export declare function remove(ref: DatabaseReference): Promise; -/* Excluded from this release type: _repoManagerDatabaseFromApp */ -/** - * Atomically modifies the data at this location. - * - * Atomically modify the data at this location. Unlike a normal `set()`, which - * just overwrites the data regardless of its previous value, `runTransaction()` is - * used to modify the existing value to a new value, ensuring there are no - * conflicts with other clients writing to the same location at the same time. - * - * To accomplish this, you pass `runTransaction()` an update function which is - * used to transform the current value into a new value. If another client - * writes to the location before your new value is successfully written, your - * update function will be called again with the new current value, and the - * write will be retried. This will happen repeatedly until your write succeeds - * without conflict or you abort the transaction by not returning a value from - * your update function. - * - * Note: Modifying data with `set()` will cancel any pending transactions at - * that location, so extreme care should be taken if mixing `set()` and - * `runTransaction()` to update the same data. - * - * Note: When using transactions with Security and Firebase Rules in place, be - * aware that a client needs `.read` access in addition to `.write` access in - * order to perform a transaction. This is because the client-side nature of - * transactions requires the client to read the data in order to transactionally - * update it. - * - * @param ref - The location to atomically modify. - * @param transactionUpdate - A developer-supplied function which will be passed - * the current data stored at this location (as a JavaScript object). The - * function should return the new value it would like written (as a JavaScript - * object). If `undefined` is returned (i.e. you return with no arguments) the - * transaction will be aborted and the data at this location will not be - * modified. - * @param options - An options object to configure transactions. - * @returns A `Promise` that can optionally be used instead of the `onComplete` - * callback to handle success and failure. - */ -export declare function runTransaction(ref: DatabaseReference, transactionUpdate: (currentData: any) => unknown, options?: TransactionOptions): Promise; -/** - * @license - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Returns a placeholder value for auto-populating the current timestamp (time - * since the Unix epoch, in milliseconds) as determined by the Firebase - * servers. - */ -export declare function serverTimestamp(): object; -/** - * Writes data to this Database location. - * - * This will overwrite any data at this location and all child locations. - * - * The effect of the write will be visible immediately, and the corresponding - * events ("value", "child_added", etc.) will be triggered. Synchronization of - * the data to the Firebase servers will also be started, and the returned - * Promise will resolve when complete. If provided, the `onComplete` callback - * will be called asynchronously after synchronization has finished. - * - * Passing `null` for the new value is equivalent to calling `remove()`; namely, - * all data at this location and all child locations will be deleted. - * - * `set()` will remove any priority stored at this location, so if priority is - * meant to be preserved, you need to use `setWithPriority()` instead. - * - * Note that modifying data with `set()` will cancel any pending transactions - * at that location, so extreme care should be taken if mixing `set()` and - * `transaction()` to modify the same data. - * - * A single `set()` will generate a single "value" event at the location where - * the `set()` was performed. - * - * @param ref - The location to write to. - * @param value - The value to be written (string, number, boolean, object, - * array, or null). - * @returns Resolves when write to server is complete. - */ -export declare function set(ref: DatabaseReference, value: unknown): Promise; -/** - * Sets a priority for the data at this Database location. - * - * Applications need not use priority but can order collections by - * ordinary properties (see - * {@link https://firebase.google.com/docs/database/web/lists-of-data#sorting_and_filtering_data | Sorting and filtering data} - * ). - * - * @param ref - The location to write to. - * @param priority - The priority to be written (string, number, or null). - * @returns Resolves when write to server is complete. - */ -export declare function setPriority(ref: DatabaseReference, priority: string | number | null): Promise; -/* Excluded from this release type: _setSDKVersion */ -/** - * Writes data the Database location. Like `set()` but also specifies the - * priority for that data. - * - * Applications need not use priority but can order collections by - * ordinary properties (see - * {@link https://firebase.google.com/docs/database/web/lists-of-data#sorting_and_filtering_data | Sorting and filtering data} - * ). - * - * @param ref - The location to write to. - * @param value - The value to be written (string, number, boolean, object, - * array, or null). - * @param priority - The priority to be written (string, number, or null). - * @returns Resolves when write to server is complete. - */ -export declare function setWithPriority(ref: DatabaseReference, value: unknown, priority: string | number | null): Promise; -/** - * Creates a `QueryConstraint` with the specified starting point (exclusive). - * - * Using `startAt()`, `startAfter()`, `endBefore()`, `endAt()` and `equalTo()` - * allows you to choose arbitrary starting and ending points for your queries. - * - * The starting point is exclusive. If only a value is provided, children - * with a value greater than the specified value will be included in the query. - * If a key is specified, then children must have a value greater than or equal - * to the specified value and a a key name greater than the specified key. - * - * @param value - The value to start after. The argument type depends on which - * `orderBy*()` function was used in this query. Specify a value that matches - * the `orderBy*()` type. When used in combination with `orderByKey()`, the - * value must be a string. - * @param key - The child key to start after. This argument is only allowed if - * ordering by child, value, or priority. - */ -export declare function startAfter(value: number | string | boolean | null, key?: string): QueryConstraint; -/** - * Creates a `QueryConstraint` with the specified starting point. - * - * Using `startAt()`, `startAfter()`, `endBefore()`, `endAt()` and `equalTo()` - * allows you to choose arbitrary starting and ending points for your queries. - * - * The starting point is inclusive, so children with exactly the specified value - * will be included in the query. The optional key argument can be used to - * further limit the range of the query. If it is specified, then children that - * have exactly the specified value must also have a key name greater than or - * equal to the specified key. - * - * You can read more about `startAt()` in - * {@link https://firebase.google.com/docs/database/web/lists-of-data#filtering_data | Filtering data}. - * - * @param value - The value to start at. The argument type depends on which - * `orderBy*()` function was used in this query. Specify a value that matches - * the `orderBy*()` type. When used in combination with `orderByKey()`, the - * value must be a string. - * @param key - The child key to start at. This argument is only allowed if - * ordering by child, value, or priority. - */ -export declare function startAt(value?: number | string | boolean | null, key?: string): QueryConstraint; -/* Excluded from this release type: _TEST_ACCESS_forceRestClient */ -/* Excluded from this release type: _TEST_ACCESS_hijackHash */ -/** - * A `Promise` that can also act as a `DatabaseReference` when returned by - * {@link push}. The reference is available immediately and the `Promise` resolves - * as the write to the backend completes. - */ -export declare interface ThenableReference extends DatabaseReference, Pick, 'then' | 'catch'> { -} -/** An options object to configure transactions. */ -export declare interface TransactionOptions { - /** - * By default, events are raised each time the transaction update function - * runs. So if it is run multiple times, you may see intermediate states. You - * can set this to false to suppress these intermediate states and instead - * wait until the transaction has completed before events are raised. - */ - readonly applyLocally?: boolean; -} -/** - * A type for the resolve value of {@link runTransaction}. - */ -export declare class TransactionResult { - /** Whether the transaction was successfully committed. */ - readonly committed: boolean; - /** The resulting data snapshot. */ - readonly snapshot: DataSnapshot; - private constructor(); - /** Returns a JSON-serializable representation of this object. */ - toJSON(): object; -} -/** A callback that can invoked to remove a listener. */ -export declare type Unsubscribe = () => void; -/** - * Writes multiple values to the Database at once. - * - * The `values` argument contains multiple property-value pairs that will be - * written to the Database together. Each child property can either be a simple - * property (for example, "name") or a relative path (for example, - * "name/first") from the current location to the data to update. - * - * As opposed to the `set()` method, `update()` can be use to selectively update - * only the referenced properties at the current location (instead of replacing - * all the child properties at the current location). - * - * The effect of the write will be visible immediately, and the corresponding - * events ('value', 'child_added', etc.) will be triggered. Synchronization of - * the data to the Firebase servers will also be started, and the returned - * Promise will resolve when complete. If provided, the `onComplete` callback - * will be called asynchronously after synchronization has finished. - * - * A single `update()` will generate a single "value" event at the location - * where the `update()` was performed, regardless of how many children were - * modified. - * - * Note that modifying data with `update()` will cancel any pending - * transactions at that location, so extreme care should be taken if mixing - * `update()` and `transaction()` to modify the same data. - * - * Passing `null` to `update()` will remove the data at this location. - * - * See - * {@link https://firebase.googleblog.com/2015/09/introducing-multi-location-updates-and_86.html | Introducing multi-location updates and more}. - * - * @param ref - The location to write to. - * @param values - Object containing multiple values. - * @returns Resolves when update on server is complete. - */ -export declare function update(ref: DatabaseReference, values: object): Promise; -export {}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/api.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/api.d.ts deleted file mode 100644 index 2f034539..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/api.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -/** - * @license - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export * from './api.standalone'; -export { getDatabase } from './api/Database'; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/api.standalone.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/api.standalone.d.ts deleted file mode 100644 index c3bc772e..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/api.standalone.d.ts +++ /dev/null @@ -1,29 +0,0 @@ -/** - * @license - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export { Database, EmulatorMockTokenOptions, enableLogging, goOffline, goOnline, forceWebSockets, forceLongPolling, connectDatabaseEmulator } from './api/Database'; -export { Query, DatabaseReference, ListenOptions, Unsubscribe, ThenableReference } from './api/Reference'; -export { OnDisconnect } from './api/OnDisconnect'; -export { DataSnapshot, EventType, QueryConstraint, QueryConstraintType, endAt, endBefore, equalTo, get, limitToFirst, limitToLast, off, onChildAdded, onChildChanged, onChildMoved, onChildRemoved, onDisconnect, onValue, orderByChild, orderByKey, orderByPriority, orderByValue, push, query, ref, refFromURL, remove, set, setPriority, setWithPriority, startAfter, startAt, update, child } from './api/Reference_impl'; -export { increment, serverTimestamp } from './api/ServerValue'; -export { runTransaction, TransactionOptions, TransactionResult } from './api/Transaction'; -export { setSDKVersion as _setSDKVersion } from './core/version'; -export { ReferenceImpl as _ReferenceImpl, QueryImpl as _QueryImpl } from './api/Reference_impl'; -export { repoManagerDatabaseFromApp as _repoManagerDatabaseFromApp } from './api/Database'; -export { validatePathString as _validatePathString, validateWritablePath as _validateWritablePath } from './core/util/validation'; -export { UserCallback as _UserCallback } from './core/view/EventRegistration'; -export { QueryParams as _QueryParams } from './core/view/QueryParams'; -export { hijackHash as _TEST_ACCESS_hijackHash, forceRestClient as _TEST_ACCESS_forceRestClient } from './api/test_access'; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/api/Database.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/api/Database.d.ts deleted file mode 100644 index 7cfbbc61..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/api/Database.d.ts +++ /dev/null @@ -1,138 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { _FirebaseService, FirebaseApp } from '@firebase/app'; -import { AppCheckInternalComponentName } from '@firebase/app-check-interop-types'; -import { FirebaseAuthInternalName } from '@firebase/auth-interop-types'; -import { Provider } from '@firebase/component'; -import { EmulatorMockTokenOptions } from '@firebase/util'; -import { Repo } from '../core/Repo'; -import { ReferenceImpl } from './Reference_impl'; -export { EmulatorMockTokenOptions } from '@firebase/util'; -/** - * This function should only ever be called to CREATE a new database instance. - * @internal - */ -export declare function repoManagerDatabaseFromApp(app: FirebaseApp, authProvider: Provider, appCheckProvider?: Provider, url?: string, nodeAdmin?: boolean): Database; -/** - * Forces us to use ReadonlyRestClient instead of PersistentConnection for new Repos. - */ -export declare function repoManagerForceRestClient(forceRestClient: boolean): void; -/** - * Class representing a Firebase Realtime Database. - */ -export declare class Database implements _FirebaseService { - _repoInternal: Repo; - /** The {@link @firebase/app#FirebaseApp} associated with this Realtime Database instance. */ - readonly app: FirebaseApp; - /** Represents a `Database` instance. */ - readonly 'type' = "database"; - /** Track if the instance has been used (root or repo accessed) */ - _instanceStarted: boolean; - /** Backing state for root_ */ - private _rootInternal?; - /** @hideconstructor */ - constructor(_repoInternal: Repo, - /** The {@link @firebase/app#FirebaseApp} associated with this Realtime Database instance. */ - app: FirebaseApp); - get _repo(): Repo; - get _root(): ReferenceImpl; - _delete(): Promise; - _checkNotDeleted(apiName: string): void; -} -/** - * Force the use of websockets instead of longPolling. - */ -export declare function forceWebSockets(): void; -/** - * Force the use of longPolling instead of websockets. This will be ignored if websocket protocol is used in databaseURL. - */ -export declare function forceLongPolling(): void; -/** - * Returns the instance of the Realtime Database SDK that is associated - * with the provided {@link @firebase/app#FirebaseApp}. Initializes a new instance with - * with default settings if no instance exists or if the existing instance uses - * a custom database URL. - * - * @param app - The {@link @firebase/app#FirebaseApp} instance that the returned Realtime - * Database instance is associated with. - * @param url - The URL of the Realtime Database instance to connect to. If not - * provided, the SDK connects to the default instance of the Firebase App. - * @returns The `Database` instance of the provided app. - */ -export declare function getDatabase(app?: FirebaseApp, url?: string): Database; -/** - * Modify the provided instance to communicate with the Realtime Database - * emulator. - * - *

Note: This method must be called before performing any other operation. - * - * @param db - The instance to modify. - * @param host - The emulator host (ex: localhost) - * @param port - The emulator port (ex: 8080) - * @param options.mockUserToken - the mock auth token to use for unit testing Security Rules - */ -export declare function connectDatabaseEmulator(db: Database, host: string, port: number, options?: { - mockUserToken?: EmulatorMockTokenOptions | string; -}): void; -/** - * Disconnects from the server (all Database operations will be completed - * offline). - * - * The client automatically maintains a persistent connection to the Database - * server, which will remain active indefinitely and reconnect when - * disconnected. However, the `goOffline()` and `goOnline()` methods may be used - * to control the client connection in cases where a persistent connection is - * undesirable. - * - * While offline, the client will no longer receive data updates from the - * Database. However, all Database operations performed locally will continue to - * immediately fire events, allowing your application to continue behaving - * normally. Additionally, each operation performed locally will automatically - * be queued and retried upon reconnection to the Database server. - * - * To reconnect to the Database and begin receiving remote events, see - * `goOnline()`. - * - * @param db - The instance to disconnect. - */ -export declare function goOffline(db: Database): void; -/** - * Reconnects to the server and synchronizes the offline Database state - * with the server state. - * - * This method should be used after disabling the active connection with - * `goOffline()`. Once reconnected, the client will transmit the proper data - * and fire the appropriate events so that your client "catches up" - * automatically. - * - * @param db - The instance to reconnect. - */ -export declare function goOnline(db: Database): void; -/** - * Logs debugging information to the console. - * - * @param enabled - Enables logging if `true`, disables logging if `false`. - * @param persistent - Remembers the logging state between page refreshes if - * `true`. - */ -export declare function enableLogging(enabled: boolean, persistent?: boolean): any; -/** - * Logs debugging information to the console. - * - * @param logger - A custom logger function to control how things get logged. - */ -export declare function enableLogging(logger: (message: string) => unknown): any; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/api/OnDisconnect.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/api/OnDisconnect.d.ts deleted file mode 100644 index d5de6440..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/api/OnDisconnect.d.ts +++ /dev/null @@ -1,110 +0,0 @@ -/** - * @license - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { Repo } from '../core/Repo'; -import { Path } from '../core/util/Path'; -/** - * The `onDisconnect` class allows you to write or clear data when your client - * disconnects from the Database server. These updates occur whether your - * client disconnects cleanly or not, so you can rely on them to clean up data - * even if a connection is dropped or a client crashes. - * - * The `onDisconnect` class is most commonly used to manage presence in - * applications where it is useful to detect how many clients are connected and - * when other clients disconnect. See - * {@link https://firebase.google.com/docs/database/web/offline-capabilities | Enabling Offline Capabilities in JavaScript} - * for more information. - * - * To avoid problems when a connection is dropped before the requests can be - * transferred to the Database server, these functions should be called before - * writing any data. - * - * Note that `onDisconnect` operations are only triggered once. If you want an - * operation to occur each time a disconnect occurs, you'll need to re-establish - * the `onDisconnect` operations each time you reconnect. - */ -export declare class OnDisconnect { - private _repo; - private _path; - /** @hideconstructor */ - constructor(_repo: Repo, _path: Path); - /** - * Cancels all previously queued `onDisconnect()` set or update events for this - * location and all children. - * - * If a write has been queued for this location via a `set()` or `update()` at a - * parent location, the write at this location will be canceled, though writes - * to sibling locations will still occur. - * - * @returns Resolves when synchronization to the server is complete. - */ - cancel(): Promise; - /** - * Ensures the data at this location is deleted when the client is disconnected - * (due to closing the browser, navigating to a new page, or network issues). - * - * @returns Resolves when synchronization to the server is complete. - */ - remove(): Promise; - /** - * Ensures the data at this location is set to the specified value when the - * client is disconnected (due to closing the browser, navigating to a new page, - * or network issues). - * - * `set()` is especially useful for implementing "presence" systems, where a - * value should be changed or cleared when a user disconnects so that they - * appear "offline" to other users. See - * {@link https://firebase.google.com/docs/database/web/offline-capabilities | Enabling Offline Capabilities in JavaScript} - * for more information. - * - * Note that `onDisconnect` operations are only triggered once. If you want an - * operation to occur each time a disconnect occurs, you'll need to re-establish - * the `onDisconnect` operations each time. - * - * @param value - The value to be written to this location on disconnect (can - * be an object, array, string, number, boolean, or null). - * @returns Resolves when synchronization to the Database is complete. - */ - set(value: unknown): Promise; - /** - * Ensures the data at this location is set to the specified value and priority - * when the client is disconnected (due to closing the browser, navigating to a - * new page, or network issues). - * - * @param value - The value to be written to this location on disconnect (can - * be an object, array, string, number, boolean, or null). - * @param priority - The priority to be written (string, number, or null). - * @returns Resolves when synchronization to the Database is complete. - */ - setWithPriority(value: unknown, priority: number | string | null): Promise; - /** - * Writes multiple values at this location when the client is disconnected (due - * to closing the browser, navigating to a new page, or network issues). - * - * The `values` argument contains multiple property-value pairs that will be - * written to the Database together. Each child property can either be a simple - * property (for example, "name") or a relative path (for example, "name/first") - * from the current location to the data to update. - * - * As opposed to the `set()` method, `update()` can be use to selectively update - * only the referenced properties at the current location (instead of replacing - * all the child properties at the current location). - * - * @param values - Object containing multiple values. - * @returns Resolves when synchronization to the Database is complete. - */ - update(values: object): Promise; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/api/Reference.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/api/Reference.d.ts deleted file mode 100644 index 887c196e..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/api/Reference.d.ts +++ /dev/null @@ -1,122 +0,0 @@ -import { Repo } from '../core/Repo'; -import { Path } from '../core/util/Path'; -import { QueryContext } from '../core/view/EventRegistration'; -/** - * @license - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * A `Query` sorts and filters the data at a Database location so only a subset - * of the child data is included. This can be used to order a collection of - * data by some attribute (for example, height of dinosaurs) as well as to - * restrict a large list of items (for example, chat messages) down to a number - * suitable for synchronizing to the client. Queries are created by chaining - * together one or more of the filter methods defined here. - * - * Just as with a `DatabaseReference`, you can receive data from a `Query` by using the - * `on*()` methods. You will only receive events and `DataSnapshot`s for the - * subset of the data that matches your query. - * - * See {@link https://firebase.google.com/docs/database/web/lists-of-data#sorting_and_filtering_data} - * for more information. - */ -export interface Query extends QueryContext { - /** The `DatabaseReference` for the `Query`'s location. */ - readonly ref: DatabaseReference; - /** - * Returns whether or not the current and provided queries represent the same - * location, have the same query parameters, and are from the same instance of - * `FirebaseApp`. - * - * Two `DatabaseReference` objects are equivalent if they represent the same location - * and are from the same instance of `FirebaseApp`. - * - * Two `Query` objects are equivalent if they represent the same location, - * have the same query parameters, and are from the same instance of - * `FirebaseApp`. Equivalent queries share the same sort order, limits, and - * starting and ending points. - * - * @param other - The query to compare against. - * @returns Whether or not the current and provided queries are equivalent. - */ - isEqual(other: Query | null): boolean; - /** - * Returns a JSON-serializable representation of this object. - * - * @returns A JSON-serializable representation of this object. - */ - toJSON(): string; - /** - * Gets the absolute URL for this location. - * - * The `toString()` method returns a URL that is ready to be put into a - * browser, curl command, or a `refFromURL()` call. Since all of those expect - * the URL to be url-encoded, `toString()` returns an encoded URL. - * - * Append '.json' to the returned URL when typed into a browser to download - * JSON-formatted data. If the location is secured (that is, not publicly - * readable), you will get a permission-denied error. - * - * @returns The absolute URL for this location. - */ - toString(): string; -} -/** - * A `DatabaseReference` represents a specific location in your Database and can be used - * for reading or writing data to that Database location. - * - * You can reference the root or child location in your Database by calling - * `ref()` or `ref("child/path")`. - * - * Writing is done with the `set()` method and reading can be done with the - * `on*()` method. See {@link - * https://firebase.google.com/docs/database/web/read-and-write} - */ -export interface DatabaseReference extends Query { - /** - * The last part of the `DatabaseReference`'s path. - * - * For example, `"ada"` is the key for - * `https://.firebaseio.com/users/ada`. - * - * The key of a root `DatabaseReference` is `null`. - */ - readonly key: string | null; - /** - * The parent location of a `DatabaseReference`. - * - * The parent of a root `DatabaseReference` is `null`. - */ - readonly parent: DatabaseReference | null; - /** The root `DatabaseReference` of the Database. */ - readonly root: DatabaseReference; -} -/** - * A `Promise` that can also act as a `DatabaseReference` when returned by - * {@link push}. The reference is available immediately and the `Promise` resolves - * as the write to the backend completes. - */ -export interface ThenableReference extends DatabaseReference, Pick, 'then' | 'catch'> { -} -/** A callback that can invoked to remove a listener. */ -export declare type Unsubscribe = () => void; -/** An options objects that can be used to customize a listener. */ -export interface ListenOptions { - /** Whether to remove the listener after its first invocation. */ - readonly onlyOnce?: boolean; -} -export interface ReferenceConstructor { - new (repo: Repo, path: Path): DatabaseReference; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/api/Reference_impl.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/api/Reference_impl.d.ts deleted file mode 100644 index c3025883..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/api/Reference_impl.d.ts +++ /dev/null @@ -1,1092 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { Repo } from '../core/Repo'; -import { Index } from '../core/snap/indexes/Index'; -import { Node } from '../core/snap/Node'; -import { Path } from '../core/util/Path'; -import { Change } from '../core/view/Change'; -import { CancelEvent, DataEvent, EventType } from '../core/view/Event'; -import { CallbackContext, EventRegistration, QueryContext } from '../core/view/EventRegistration'; -import { QueryParams } from '../core/view/QueryParams'; -import { Database } from './Database'; -import { OnDisconnect } from './OnDisconnect'; -import { ListenOptions, Query as Query, DatabaseReference, Unsubscribe, ThenableReference } from './Reference'; -/** - * @internal - */ -export declare class QueryImpl implements Query, QueryContext { - readonly _repo: Repo; - readonly _path: Path; - readonly _queryParams: QueryParams; - readonly _orderByCalled: boolean; - /** - * @hideconstructor - */ - constructor(_repo: Repo, _path: Path, _queryParams: QueryParams, _orderByCalled: boolean); - get key(): string | null; - get ref(): DatabaseReference; - get _queryIdentifier(): string; - /** - * An object representation of the query parameters used by this Query. - */ - get _queryObject(): object; - isEqual(other: QueryImpl | null): boolean; - toJSON(): string; - toString(): string; -} -/** - * @internal - */ -export declare class ReferenceImpl extends QueryImpl implements DatabaseReference { - /** @hideconstructor */ - constructor(repo: Repo, path: Path); - get parent(): ReferenceImpl | null; - get root(): ReferenceImpl; -} -/** - * A `DataSnapshot` contains data from a Database location. - * - * Any time you read data from the Database, you receive the data as a - * `DataSnapshot`. A `DataSnapshot` is passed to the event callbacks you attach - * with `on()` or `once()`. You can extract the contents of the snapshot as a - * JavaScript object by calling the `val()` method. Alternatively, you can - * traverse into the snapshot by calling `child()` to return child snapshots - * (which you could then call `val()` on). - * - * A `DataSnapshot` is an efficiently generated, immutable copy of the data at - * a Database location. It cannot be modified and will never change (to modify - * data, you always call the `set()` method on a `Reference` directly). - */ -export declare class DataSnapshot { - readonly _node: Node; - /** - * The location of this DataSnapshot. - */ - readonly ref: DatabaseReference; - readonly _index: Index; - /** - * @param _node - A SnapshotNode to wrap. - * @param ref - The location this snapshot came from. - * @param _index - The iteration order for this snapshot - * @hideconstructor - */ - constructor(_node: Node, - /** - * The location of this DataSnapshot. - */ - ref: DatabaseReference, _index: Index); - /** - * Gets the priority value of the data in this `DataSnapshot`. - * - * Applications need not use priority but can order collections by - * ordinary properties (see - * {@link https://firebase.google.com/docs/database/web/lists-of-data#sorting_and_filtering_data |Sorting and filtering data} - * ). - */ - get priority(): string | number | null; - /** - * The key (last part of the path) of the location of this `DataSnapshot`. - * - * The last token in a Database location is considered its key. For example, - * "ada" is the key for the /users/ada/ node. Accessing the key on any - * `DataSnapshot` will return the key for the location that generated it. - * However, accessing the key on the root URL of a Database will return - * `null`. - */ - get key(): string | null; - /** Returns the number of child properties of this `DataSnapshot`. */ - get size(): number; - /** - * Gets another `DataSnapshot` for the location at the specified relative path. - * - * Passing a relative path to the `child()` method of a DataSnapshot returns - * another `DataSnapshot` for the location at the specified relative path. The - * relative path can either be a simple child name (for example, "ada") or a - * deeper, slash-separated path (for example, "ada/name/first"). If the child - * location has no data, an empty `DataSnapshot` (that is, a `DataSnapshot` - * whose value is `null`) is returned. - * - * @param path - A relative path to the location of child data. - */ - child(path: string): DataSnapshot; - /** - * Returns true if this `DataSnapshot` contains any data. It is slightly more - * efficient than using `snapshot.val() !== null`. - */ - exists(): boolean; - /** - * Exports the entire contents of the DataSnapshot as a JavaScript object. - * - * The `exportVal()` method is similar to `val()`, except priority information - * is included (if available), making it suitable for backing up your data. - * - * @returns The DataSnapshot's contents as a JavaScript value (Object, - * Array, string, number, boolean, or `null`). - */ - exportVal(): any; - /** - * Enumerates the top-level children in the `DataSnapshot`. - * - * Because of the way JavaScript objects work, the ordering of data in the - * JavaScript object returned by `val()` is not guaranteed to match the - * ordering on the server nor the ordering of `onChildAdded()` events. That is - * where `forEach()` comes in handy. It guarantees the children of a - * `DataSnapshot` will be iterated in their query order. - * - * If no explicit `orderBy*()` method is used, results are returned - * ordered by key (unless priorities are used, in which case, results are - * returned by priority). - * - * @param action - A function that will be called for each child DataSnapshot. - * The callback can return true to cancel further enumeration. - * @returns true if enumeration was canceled due to your callback returning - * true. - */ - forEach(action: (child: DataSnapshot) => boolean | void): boolean; - /** - * Returns true if the specified child path has (non-null) data. - * - * @param path - A relative path to the location of a potential child. - * @returns `true` if data exists at the specified child path; else - * `false`. - */ - hasChild(path: string): boolean; - /** - * Returns whether or not the `DataSnapshot` has any non-`null` child - * properties. - * - * You can use `hasChildren()` to determine if a `DataSnapshot` has any - * children. If it does, you can enumerate them using `forEach()`. If it - * doesn't, then either this snapshot contains a primitive value (which can be - * retrieved with `val()`) or it is empty (in which case, `val()` will return - * `null`). - * - * @returns true if this snapshot has any children; else false. - */ - hasChildren(): boolean; - /** - * Returns a JSON-serializable representation of this object. - */ - toJSON(): object | null; - /** - * Extracts a JavaScript value from a `DataSnapshot`. - * - * Depending on the data in a `DataSnapshot`, the `val()` method may return a - * scalar type (string, number, or boolean), an array, or an object. It may - * also return null, indicating that the `DataSnapshot` is empty (contains no - * data). - * - * @returns The DataSnapshot's contents as a JavaScript value (Object, - * Array, string, number, boolean, or `null`). - */ - val(): any; -} -/** - * - * Returns a `Reference` representing the location in the Database - * corresponding to the provided path. If no path is provided, the `Reference` - * will point to the root of the Database. - * - * @param db - The database instance to obtain a reference for. - * @param path - Optional path representing the location the returned - * `Reference` will point. If not provided, the returned `Reference` will - * point to the root of the Database. - * @returns If a path is provided, a `Reference` - * pointing to the provided path. Otherwise, a `Reference` pointing to the - * root of the Database. - */ -export declare function ref(db: Database, path?: string): DatabaseReference; -/** - * Returns a `Reference` representing the location in the Database - * corresponding to the provided Firebase URL. - * - * An exception is thrown if the URL is not a valid Firebase Database URL or it - * has a different domain than the current `Database` instance. - * - * Note that all query parameters (`orderBy`, `limitToLast`, etc.) are ignored - * and are not applied to the returned `Reference`. - * - * @param db - The database instance to obtain a reference for. - * @param url - The Firebase URL at which the returned `Reference` will - * point. - * @returns A `Reference` pointing to the provided - * Firebase URL. - */ -export declare function refFromURL(db: Database, url: string): DatabaseReference; -/** - * Gets a `Reference` for the location at the specified relative path. - * - * The relative path can either be a simple child name (for example, "ada") or - * a deeper slash-separated path (for example, "ada/name/first"). - * - * @param parent - The parent location. - * @param path - A relative path from this location to the desired child - * location. - * @returns The specified child location. - */ -export declare function child(parent: DatabaseReference, path: string): DatabaseReference; -/** - * Returns an `OnDisconnect` object - see - * {@link https://firebase.google.com/docs/database/web/offline-capabilities | Enabling Offline Capabilities in JavaScript} - * for more information on how to use it. - * - * @param ref - The reference to add OnDisconnect triggers for. - */ -export declare function onDisconnect(ref: DatabaseReference): OnDisconnect; -export interface ThenableReferenceImpl extends ReferenceImpl, Pick, 'then' | 'catch'> { -} -/** - * Generates a new child location using a unique key and returns its - * `Reference`. - * - * This is the most common pattern for adding data to a collection of items. - * - * If you provide a value to `push()`, the value is written to the - * generated location. If you don't pass a value, nothing is written to the - * database and the child remains empty (but you can use the `Reference` - * elsewhere). - * - * The unique keys generated by `push()` are ordered by the current time, so the - * resulting list of items is chronologically sorted. The keys are also - * designed to be unguessable (they contain 72 random bits of entropy). - * - * See {@link https://firebase.google.com/docs/database/web/lists-of-data#append_to_a_list_of_data | Append to a list of data}. - * See {@link https://firebase.googleblog.com/2015/02/the-2120-ways-to-ensure-unique_68.html | The 2^120 Ways to Ensure Unique Identifiers}. - * - * @param parent - The parent location. - * @param value - Optional value to be written at the generated location. - * @returns Combined `Promise` and `Reference`; resolves when write is complete, - * but can be used immediately as the `Reference` to the child location. - */ -export declare function push(parent: DatabaseReference, value?: unknown): ThenableReference; -/** - * Removes the data at this Database location. - * - * Any data at child locations will also be deleted. - * - * The effect of the remove will be visible immediately and the corresponding - * event 'value' will be triggered. Synchronization of the remove to the - * Firebase servers will also be started, and the returned Promise will resolve - * when complete. If provided, the onComplete callback will be called - * asynchronously after synchronization has finished. - * - * @param ref - The location to remove. - * @returns Resolves when remove on server is complete. - */ -export declare function remove(ref: DatabaseReference): Promise; -/** - * Writes data to this Database location. - * - * This will overwrite any data at this location and all child locations. - * - * The effect of the write will be visible immediately, and the corresponding - * events ("value", "child_added", etc.) will be triggered. Synchronization of - * the data to the Firebase servers will also be started, and the returned - * Promise will resolve when complete. If provided, the `onComplete` callback - * will be called asynchronously after synchronization has finished. - * - * Passing `null` for the new value is equivalent to calling `remove()`; namely, - * all data at this location and all child locations will be deleted. - * - * `set()` will remove any priority stored at this location, so if priority is - * meant to be preserved, you need to use `setWithPriority()` instead. - * - * Note that modifying data with `set()` will cancel any pending transactions - * at that location, so extreme care should be taken if mixing `set()` and - * `transaction()` to modify the same data. - * - * A single `set()` will generate a single "value" event at the location where - * the `set()` was performed. - * - * @param ref - The location to write to. - * @param value - The value to be written (string, number, boolean, object, - * array, or null). - * @returns Resolves when write to server is complete. - */ -export declare function set(ref: DatabaseReference, value: unknown): Promise; -/** - * Sets a priority for the data at this Database location. - * - * Applications need not use priority but can order collections by - * ordinary properties (see - * {@link https://firebase.google.com/docs/database/web/lists-of-data#sorting_and_filtering_data | Sorting and filtering data} - * ). - * - * @param ref - The location to write to. - * @param priority - The priority to be written (string, number, or null). - * @returns Resolves when write to server is complete. - */ -export declare function setPriority(ref: DatabaseReference, priority: string | number | null): Promise; -/** - * Writes data the Database location. Like `set()` but also specifies the - * priority for that data. - * - * Applications need not use priority but can order collections by - * ordinary properties (see - * {@link https://firebase.google.com/docs/database/web/lists-of-data#sorting_and_filtering_data | Sorting and filtering data} - * ). - * - * @param ref - The location to write to. - * @param value - The value to be written (string, number, boolean, object, - * array, or null). - * @param priority - The priority to be written (string, number, or null). - * @returns Resolves when write to server is complete. - */ -export declare function setWithPriority(ref: DatabaseReference, value: unknown, priority: string | number | null): Promise; -/** - * Writes multiple values to the Database at once. - * - * The `values` argument contains multiple property-value pairs that will be - * written to the Database together. Each child property can either be a simple - * property (for example, "name") or a relative path (for example, - * "name/first") from the current location to the data to update. - * - * As opposed to the `set()` method, `update()` can be use to selectively update - * only the referenced properties at the current location (instead of replacing - * all the child properties at the current location). - * - * The effect of the write will be visible immediately, and the corresponding - * events ('value', 'child_added', etc.) will be triggered. Synchronization of - * the data to the Firebase servers will also be started, and the returned - * Promise will resolve when complete. If provided, the `onComplete` callback - * will be called asynchronously after synchronization has finished. - * - * A single `update()` will generate a single "value" event at the location - * where the `update()` was performed, regardless of how many children were - * modified. - * - * Note that modifying data with `update()` will cancel any pending - * transactions at that location, so extreme care should be taken if mixing - * `update()` and `transaction()` to modify the same data. - * - * Passing `null` to `update()` will remove the data at this location. - * - * See - * {@link https://firebase.googleblog.com/2015/09/introducing-multi-location-updates-and_86.html | Introducing multi-location updates and more}. - * - * @param ref - The location to write to. - * @param values - Object containing multiple values. - * @returns Resolves when update on server is complete. - */ -export declare function update(ref: DatabaseReference, values: object): Promise; -/** - * Gets the most up-to-date result for this query. - * - * @param query - The query to run. - * @returns A `Promise` which resolves to the resulting DataSnapshot if a value is - * available, or rejects if the client is unable to return a value (e.g., if the - * server is unreachable and there is nothing cached). - */ -export declare function get(query: Query): Promise; -/** - * Represents registration for 'value' events. - */ -export declare class ValueEventRegistration implements EventRegistration { - private callbackContext; - constructor(callbackContext: CallbackContext); - respondsTo(eventType: string): boolean; - createEvent(change: Change, query: QueryContext): DataEvent; - getEventRunner(eventData: CancelEvent | DataEvent): () => void; - createCancelEvent(error: Error, path: Path): CancelEvent | null; - matches(other: EventRegistration): boolean; - hasAnyCallback(): boolean; -} -/** - * Represents the registration of a child_x event. - */ -export declare class ChildEventRegistration implements EventRegistration { - private eventType; - private callbackContext; - constructor(eventType: string, callbackContext: CallbackContext | null); - respondsTo(eventType: string): boolean; - createCancelEvent(error: Error, path: Path): CancelEvent | null; - createEvent(change: Change, query: QueryContext): DataEvent; - getEventRunner(eventData: CancelEvent | DataEvent): () => void; - matches(other: EventRegistration): boolean; - hasAnyCallback(): boolean; -} -/** - * Listens for data changes at a particular location. - * - * This is the primary way to read data from a Database. Your callback - * will be triggered for the initial data and again whenever the data changes. - * Invoke the returned unsubscribe callback to stop receiving updates. See - * {@link https://firebase.google.com/docs/database/web/retrieve-data | Retrieve Data on the Web} - * for more details. - * - * An `onValue` event will trigger once with the initial data stored at this - * location, and then trigger again each time the data changes. The - * `DataSnapshot` passed to the callback will be for the location at which - * `on()` was called. It won't trigger until the entire contents has been - * synchronized. If the location has no data, it will be triggered with an empty - * `DataSnapshot` (`val()` will return `null`). - * - * @param query - The query to run. - * @param callback - A callback that fires when the specified event occurs. The - * callback will be passed a DataSnapshot. - * @param cancelCallback - An optional callback that will be notified if your - * event subscription is ever canceled because your client does not have - * permission to read this data (or it had permission but has now lost it). - * This callback will be passed an `Error` object indicating why the failure - * occurred. - * @returns A function that can be invoked to remove the listener. - */ -export declare function onValue(query: Query, callback: (snapshot: DataSnapshot) => unknown, cancelCallback?: (error: Error) => unknown): Unsubscribe; -/** - * Listens for data changes at a particular location. - * - * This is the primary way to read data from a Database. Your callback - * will be triggered for the initial data and again whenever the data changes. - * Invoke the returned unsubscribe callback to stop receiving updates. See - * {@link https://firebase.google.com/docs/database/web/retrieve-data | Retrieve Data on the Web} - * for more details. - * - * An `onValue` event will trigger once with the initial data stored at this - * location, and then trigger again each time the data changes. The - * `DataSnapshot` passed to the callback will be for the location at which - * `on()` was called. It won't trigger until the entire contents has been - * synchronized. If the location has no data, it will be triggered with an empty - * `DataSnapshot` (`val()` will return `null`). - * - * @param query - The query to run. - * @param callback - A callback that fires when the specified event occurs. The - * callback will be passed a DataSnapshot. - * @param options - An object that can be used to configure `onlyOnce`, which - * then removes the listener after its first invocation. - * @returns A function that can be invoked to remove the listener. - */ -export declare function onValue(query: Query, callback: (snapshot: DataSnapshot) => unknown, options: ListenOptions): Unsubscribe; -/** - * Listens for data changes at a particular location. - * - * This is the primary way to read data from a Database. Your callback - * will be triggered for the initial data and again whenever the data changes. - * Invoke the returned unsubscribe callback to stop receiving updates. See - * {@link https://firebase.google.com/docs/database/web/retrieve-data | Retrieve Data on the Web} - * for more details. - * - * An `onValue` event will trigger once with the initial data stored at this - * location, and then trigger again each time the data changes. The - * `DataSnapshot` passed to the callback will be for the location at which - * `on()` was called. It won't trigger until the entire contents has been - * synchronized. If the location has no data, it will be triggered with an empty - * `DataSnapshot` (`val()` will return `null`). - * - * @param query - The query to run. - * @param callback - A callback that fires when the specified event occurs. The - * callback will be passed a DataSnapshot. - * @param cancelCallback - An optional callback that will be notified if your - * event subscription is ever canceled because your client does not have - * permission to read this data (or it had permission but has now lost it). - * This callback will be passed an `Error` object indicating why the failure - * occurred. - * @param options - An object that can be used to configure `onlyOnce`, which - * then removes the listener after its first invocation. - * @returns A function that can be invoked to remove the listener. - */ -export declare function onValue(query: Query, callback: (snapshot: DataSnapshot) => unknown, cancelCallback: (error: Error) => unknown, options: ListenOptions): Unsubscribe; -/** - * Listens for data changes at a particular location. - * - * This is the primary way to read data from a Database. Your callback - * will be triggered for the initial data and again whenever the data changes. - * Invoke the returned unsubscribe callback to stop receiving updates. See - * {@link https://firebase.google.com/docs/database/web/retrieve-data | Retrieve Data on the Web} - * for more details. - * - * An `onChildAdded` event will be triggered once for each initial child at this - * location, and it will be triggered again every time a new child is added. The - * `DataSnapshot` passed into the callback will reflect the data for the - * relevant child. For ordering purposes, it is passed a second argument which - * is a string containing the key of the previous sibling child by sort order, - * or `null` if it is the first child. - * - * @param query - The query to run. - * @param callback - A callback that fires when the specified event occurs. - * The callback will be passed a DataSnapshot and a string containing the key of - * the previous child, by sort order, or `null` if it is the first child. - * @param cancelCallback - An optional callback that will be notified if your - * event subscription is ever canceled because your client does not have - * permission to read this data (or it had permission but has now lost it). - * This callback will be passed an `Error` object indicating why the failure - * occurred. - * @returns A function that can be invoked to remove the listener. - */ -export declare function onChildAdded(query: Query, callback: (snapshot: DataSnapshot, previousChildName?: string | null) => unknown, cancelCallback?: (error: Error) => unknown): Unsubscribe; -/** - * Listens for data changes at a particular location. - * - * This is the primary way to read data from a Database. Your callback - * will be triggered for the initial data and again whenever the data changes. - * Invoke the returned unsubscribe callback to stop receiving updates. See - * {@link https://firebase.google.com/docs/database/web/retrieve-data | Retrieve Data on the Web} - * for more details. - * - * An `onChildAdded` event will be triggered once for each initial child at this - * location, and it will be triggered again every time a new child is added. The - * `DataSnapshot` passed into the callback will reflect the data for the - * relevant child. For ordering purposes, it is passed a second argument which - * is a string containing the key of the previous sibling child by sort order, - * or `null` if it is the first child. - * - * @param query - The query to run. - * @param callback - A callback that fires when the specified event occurs. - * The callback will be passed a DataSnapshot and a string containing the key of - * the previous child, by sort order, or `null` if it is the first child. - * @param options - An object that can be used to configure `onlyOnce`, which - * then removes the listener after its first invocation. - * @returns A function that can be invoked to remove the listener. - */ -export declare function onChildAdded(query: Query, callback: (snapshot: DataSnapshot, previousChildName: string | null) => unknown, options: ListenOptions): Unsubscribe; -/** - * Listens for data changes at a particular location. - * - * This is the primary way to read data from a Database. Your callback - * will be triggered for the initial data and again whenever the data changes. - * Invoke the returned unsubscribe callback to stop receiving updates. See - * {@link https://firebase.google.com/docs/database/web/retrieve-data | Retrieve Data on the Web} - * for more details. - * - * An `onChildAdded` event will be triggered once for each initial child at this - * location, and it will be triggered again every time a new child is added. The - * `DataSnapshot` passed into the callback will reflect the data for the - * relevant child. For ordering purposes, it is passed a second argument which - * is a string containing the key of the previous sibling child by sort order, - * or `null` if it is the first child. - * - * @param query - The query to run. - * @param callback - A callback that fires when the specified event occurs. - * The callback will be passed a DataSnapshot and a string containing the key of - * the previous child, by sort order, or `null` if it is the first child. - * @param cancelCallback - An optional callback that will be notified if your - * event subscription is ever canceled because your client does not have - * permission to read this data (or it had permission but has now lost it). - * This callback will be passed an `Error` object indicating why the failure - * occurred. - * @param options - An object that can be used to configure `onlyOnce`, which - * then removes the listener after its first invocation. - * @returns A function that can be invoked to remove the listener. - */ -export declare function onChildAdded(query: Query, callback: (snapshot: DataSnapshot, previousChildName: string | null) => unknown, cancelCallback: (error: Error) => unknown, options: ListenOptions): Unsubscribe; -/** - * Listens for data changes at a particular location. - * - * This is the primary way to read data from a Database. Your callback - * will be triggered for the initial data and again whenever the data changes. - * Invoke the returned unsubscribe callback to stop receiving updates. See - * {@link https://firebase.google.com/docs/database/web/retrieve-data | Retrieve Data on the Web} - * for more details. - * - * An `onChildChanged` event will be triggered when the data stored in a child - * (or any of its descendants) changes. Note that a single `child_changed` event - * may represent multiple changes to the child. The `DataSnapshot` passed to the - * callback will contain the new child contents. For ordering purposes, the - * callback is also passed a second argument which is a string containing the - * key of the previous sibling child by sort order, or `null` if it is the first - * child. - * - * @param query - The query to run. - * @param callback - A callback that fires when the specified event occurs. - * The callback will be passed a DataSnapshot and a string containing the key of - * the previous child, by sort order, or `null` if it is the first child. - * @param cancelCallback - An optional callback that will be notified if your - * event subscription is ever canceled because your client does not have - * permission to read this data (or it had permission but has now lost it). - * This callback will be passed an `Error` object indicating why the failure - * occurred. - * @returns A function that can be invoked to remove the listener. - */ -export declare function onChildChanged(query: Query, callback: (snapshot: DataSnapshot, previousChildName: string | null) => unknown, cancelCallback?: (error: Error) => unknown): Unsubscribe; -/** - * Listens for data changes at a particular location. - * - * This is the primary way to read data from a Database. Your callback - * will be triggered for the initial data and again whenever the data changes. - * Invoke the returned unsubscribe callback to stop receiving updates. See - * {@link https://firebase.google.com/docs/database/web/retrieve-data | Retrieve Data on the Web} - * for more details. - * - * An `onChildChanged` event will be triggered when the data stored in a child - * (or any of its descendants) changes. Note that a single `child_changed` event - * may represent multiple changes to the child. The `DataSnapshot` passed to the - * callback will contain the new child contents. For ordering purposes, the - * callback is also passed a second argument which is a string containing the - * key of the previous sibling child by sort order, or `null` if it is the first - * child. - * - * @param query - The query to run. - * @param callback - A callback that fires when the specified event occurs. - * The callback will be passed a DataSnapshot and a string containing the key of - * the previous child, by sort order, or `null` if it is the first child. - * @param options - An object that can be used to configure `onlyOnce`, which - * then removes the listener after its first invocation. - * @returns A function that can be invoked to remove the listener. - */ -export declare function onChildChanged(query: Query, callback: (snapshot: DataSnapshot, previousChildName: string | null) => unknown, options: ListenOptions): Unsubscribe; -/** - * Listens for data changes at a particular location. - * - * This is the primary way to read data from a Database. Your callback - * will be triggered for the initial data and again whenever the data changes. - * Invoke the returned unsubscribe callback to stop receiving updates. See - * {@link https://firebase.google.com/docs/database/web/retrieve-data | Retrieve Data on the Web} - * for more details. - * - * An `onChildChanged` event will be triggered when the data stored in a child - * (or any of its descendants) changes. Note that a single `child_changed` event - * may represent multiple changes to the child. The `DataSnapshot` passed to the - * callback will contain the new child contents. For ordering purposes, the - * callback is also passed a second argument which is a string containing the - * key of the previous sibling child by sort order, or `null` if it is the first - * child. - * - * @param query - The query to run. - * @param callback - A callback that fires when the specified event occurs. - * The callback will be passed a DataSnapshot and a string containing the key of - * the previous child, by sort order, or `null` if it is the first child. - * @param cancelCallback - An optional callback that will be notified if your - * event subscription is ever canceled because your client does not have - * permission to read this data (or it had permission but has now lost it). - * This callback will be passed an `Error` object indicating why the failure - * occurred. - * @param options - An object that can be used to configure `onlyOnce`, which - * then removes the listener after its first invocation. - * @returns A function that can be invoked to remove the listener. - */ -export declare function onChildChanged(query: Query, callback: (snapshot: DataSnapshot, previousChildName: string | null) => unknown, cancelCallback: (error: Error) => unknown, options: ListenOptions): Unsubscribe; -/** - * Listens for data changes at a particular location. - * - * This is the primary way to read data from a Database. Your callback - * will be triggered for the initial data and again whenever the data changes. - * Invoke the returned unsubscribe callback to stop receiving updates. See - * {@link https://firebase.google.com/docs/database/web/retrieve-data | Retrieve Data on the Web} - * for more details. - * - * An `onChildMoved` event will be triggered when a child's sort order changes - * such that its position relative to its siblings changes. The `DataSnapshot` - * passed to the callback will be for the data of the child that has moved. It - * is also passed a second argument which is a string containing the key of the - * previous sibling child by sort order, or `null` if it is the first child. - * - * @param query - The query to run. - * @param callback - A callback that fires when the specified event occurs. - * The callback will be passed a DataSnapshot and a string containing the key of - * the previous child, by sort order, or `null` if it is the first child. - * @param cancelCallback - An optional callback that will be notified if your - * event subscription is ever canceled because your client does not have - * permission to read this data (or it had permission but has now lost it). - * This callback will be passed an `Error` object indicating why the failure - * occurred. - * @returns A function that can be invoked to remove the listener. - */ -export declare function onChildMoved(query: Query, callback: (snapshot: DataSnapshot, previousChildName: string | null) => unknown, cancelCallback?: (error: Error) => unknown): Unsubscribe; -/** - * Listens for data changes at a particular location. - * - * This is the primary way to read data from a Database. Your callback - * will be triggered for the initial data and again whenever the data changes. - * Invoke the returned unsubscribe callback to stop receiving updates. See - * {@link https://firebase.google.com/docs/database/web/retrieve-data | Retrieve Data on the Web} - * for more details. - * - * An `onChildMoved` event will be triggered when a child's sort order changes - * such that its position relative to its siblings changes. The `DataSnapshot` - * passed to the callback will be for the data of the child that has moved. It - * is also passed a second argument which is a string containing the key of the - * previous sibling child by sort order, or `null` if it is the first child. - * - * @param query - The query to run. - * @param callback - A callback that fires when the specified event occurs. - * The callback will be passed a DataSnapshot and a string containing the key of - * the previous child, by sort order, or `null` if it is the first child. - * @param options - An object that can be used to configure `onlyOnce`, which - * then removes the listener after its first invocation. - * @returns A function that can be invoked to remove the listener. - */ -export declare function onChildMoved(query: Query, callback: (snapshot: DataSnapshot, previousChildName: string | null) => unknown, options: ListenOptions): Unsubscribe; -/** - * Listens for data changes at a particular location. - * - * This is the primary way to read data from a Database. Your callback - * will be triggered for the initial data and again whenever the data changes. - * Invoke the returned unsubscribe callback to stop receiving updates. See - * {@link https://firebase.google.com/docs/database/web/retrieve-data | Retrieve Data on the Web} - * for more details. - * - * An `onChildMoved` event will be triggered when a child's sort order changes - * such that its position relative to its siblings changes. The `DataSnapshot` - * passed to the callback will be for the data of the child that has moved. It - * is also passed a second argument which is a string containing the key of the - * previous sibling child by sort order, or `null` if it is the first child. - * - * @param query - The query to run. - * @param callback - A callback that fires when the specified event occurs. - * The callback will be passed a DataSnapshot and a string containing the key of - * the previous child, by sort order, or `null` if it is the first child. - * @param cancelCallback - An optional callback that will be notified if your - * event subscription is ever canceled because your client does not have - * permission to read this data (or it had permission but has now lost it). - * This callback will be passed an `Error` object indicating why the failure - * occurred. - * @param options - An object that can be used to configure `onlyOnce`, which - * then removes the listener after its first invocation. - * @returns A function that can be invoked to remove the listener. - */ -export declare function onChildMoved(query: Query, callback: (snapshot: DataSnapshot, previousChildName: string | null) => unknown, cancelCallback: (error: Error) => unknown, options: ListenOptions): Unsubscribe; -/** - * Listens for data changes at a particular location. - * - * This is the primary way to read data from a Database. Your callback - * will be triggered for the initial data and again whenever the data changes. - * Invoke the returned unsubscribe callback to stop receiving updates. See - * {@link https://firebase.google.com/docs/database/web/retrieve-data | Retrieve Data on the Web} - * for more details. - * - * An `onChildRemoved` event will be triggered once every time a child is - * removed. The `DataSnapshot` passed into the callback will be the old data for - * the child that was removed. A child will get removed when either: - * - * - a client explicitly calls `remove()` on that child or one of its ancestors - * - a client calls `set(null)` on that child or one of its ancestors - * - that child has all of its children removed - * - there is a query in effect which now filters out the child (because it's - * sort order changed or the max limit was hit) - * - * @param query - The query to run. - * @param callback - A callback that fires when the specified event occurs. - * The callback will be passed a DataSnapshot and a string containing the key of - * the previous child, by sort order, or `null` if it is the first child. - * @param cancelCallback - An optional callback that will be notified if your - * event subscription is ever canceled because your client does not have - * permission to read this data (or it had permission but has now lost it). - * This callback will be passed an `Error` object indicating why the failure - * occurred. - * @returns A function that can be invoked to remove the listener. - */ -export declare function onChildRemoved(query: Query, callback: (snapshot: DataSnapshot) => unknown, cancelCallback?: (error: Error) => unknown): Unsubscribe; -/** - * Listens for data changes at a particular location. - * - * This is the primary way to read data from a Database. Your callback - * will be triggered for the initial data and again whenever the data changes. - * Invoke the returned unsubscribe callback to stop receiving updates. See - * {@link https://firebase.google.com/docs/database/web/retrieve-data | Retrieve Data on the Web} - * for more details. - * - * An `onChildRemoved` event will be triggered once every time a child is - * removed. The `DataSnapshot` passed into the callback will be the old data for - * the child that was removed. A child will get removed when either: - * - * - a client explicitly calls `remove()` on that child or one of its ancestors - * - a client calls `set(null)` on that child or one of its ancestors - * - that child has all of its children removed - * - there is a query in effect which now filters out the child (because it's - * sort order changed or the max limit was hit) - * - * @param query - The query to run. - * @param callback - A callback that fires when the specified event occurs. - * The callback will be passed a DataSnapshot and a string containing the key of - * the previous child, by sort order, or `null` if it is the first child. - * @param options - An object that can be used to configure `onlyOnce`, which - * then removes the listener after its first invocation. - * @returns A function that can be invoked to remove the listener. - */ -export declare function onChildRemoved(query: Query, callback: (snapshot: DataSnapshot) => unknown, options: ListenOptions): Unsubscribe; -/** - * Listens for data changes at a particular location. - * - * This is the primary way to read data from a Database. Your callback - * will be triggered for the initial data and again whenever the data changes. - * Invoke the returned unsubscribe callback to stop receiving updates. See - * {@link https://firebase.google.com/docs/database/web/retrieve-data | Retrieve Data on the Web} - * for more details. - * - * An `onChildRemoved` event will be triggered once every time a child is - * removed. The `DataSnapshot` passed into the callback will be the old data for - * the child that was removed. A child will get removed when either: - * - * - a client explicitly calls `remove()` on that child or one of its ancestors - * - a client calls `set(null)` on that child or one of its ancestors - * - that child has all of its children removed - * - there is a query in effect which now filters out the child (because it's - * sort order changed or the max limit was hit) - * - * @param query - The query to run. - * @param callback - A callback that fires when the specified event occurs. - * The callback will be passed a DataSnapshot and a string containing the key of - * the previous child, by sort order, or `null` if it is the first child. - * @param cancelCallback - An optional callback that will be notified if your - * event subscription is ever canceled because your client does not have - * permission to read this data (or it had permission but has now lost it). - * This callback will be passed an `Error` object indicating why the failure - * occurred. - * @param options - An object that can be used to configure `onlyOnce`, which - * then removes the listener after its first invocation. - * @returns A function that can be invoked to remove the listener. - */ -export declare function onChildRemoved(query: Query, callback: (snapshot: DataSnapshot) => unknown, cancelCallback: (error: Error) => unknown, options: ListenOptions): Unsubscribe; -export { EventType }; -/** - * Detaches a callback previously attached with the corresponding `on*()` (`onValue`, `onChildAdded`) listener. - * Note: This is not the recommended way to remove a listener. Instead, please use the returned callback function from - * the respective `on*` callbacks. - * - * Detach a callback previously attached with `on*()`. Calling `off()` on a parent listener - * will not automatically remove listeners registered on child nodes, `off()` - * must also be called on any child listeners to remove the callback. - * - * If a callback is not specified, all callbacks for the specified eventType - * will be removed. Similarly, if no eventType is specified, all callbacks - * for the `Reference` will be removed. - * - * Individual listeners can also be removed by invoking their unsubscribe - * callbacks. - * - * @param query - The query that the listener was registered with. - * @param eventType - One of the following strings: "value", "child_added", - * "child_changed", "child_removed", or "child_moved." If omitted, all callbacks - * for the `Reference` will be removed. - * @param callback - The callback function that was passed to `on()` or - * `undefined` to remove all callbacks. - */ -export declare function off(query: Query, eventType?: EventType, callback?: (snapshot: DataSnapshot, previousChildName?: string | null) => unknown): void; -/** Describes the different query constraints available in this SDK. */ -export declare type QueryConstraintType = 'endAt' | 'endBefore' | 'startAt' | 'startAfter' | 'limitToFirst' | 'limitToLast' | 'orderByChild' | 'orderByKey' | 'orderByPriority' | 'orderByValue' | 'equalTo'; -/** - * A `QueryConstraint` is used to narrow the set of documents returned by a - * Database query. `QueryConstraint`s are created by invoking {@link endAt}, - * {@link endBefore}, {@link startAt}, {@link startAfter}, {@link - * limitToFirst}, {@link limitToLast}, {@link orderByChild}, - * {@link orderByChild}, {@link orderByKey} , {@link orderByPriority} , - * {@link orderByValue} or {@link equalTo} and - * can then be passed to {@link query} to create a new query instance that - * also contains this `QueryConstraint`. - */ -export declare abstract class QueryConstraint { - /** The type of this query constraints */ - abstract readonly type: QueryConstraintType; - /** - * Takes the provided `Query` and returns a copy of the `Query` with this - * `QueryConstraint` applied. - */ - abstract _apply(query: QueryImpl): QueryImpl; -} -/** - * Creates a `QueryConstraint` with the specified ending point. - * - * Using `startAt()`, `startAfter()`, `endBefore()`, `endAt()` and `equalTo()` - * allows you to choose arbitrary starting and ending points for your queries. - * - * The ending point is inclusive, so children with exactly the specified value - * will be included in the query. The optional key argument can be used to - * further limit the range of the query. If it is specified, then children that - * have exactly the specified value must also have a key name less than or equal - * to the specified key. - * - * You can read more about `endAt()` in - * {@link https://firebase.google.com/docs/database/web/lists-of-data#filtering_data | Filtering data}. - * - * @param value - The value to end at. The argument type depends on which - * `orderBy*()` function was used in this query. Specify a value that matches - * the `orderBy*()` type. When used in combination with `orderByKey()`, the - * value must be a string. - * @param key - The child key to end at, among the children with the previously - * specified priority. This argument is only allowed if ordering by child, - * value, or priority. - */ -export declare function endAt(value: number | string | boolean | null, key?: string): QueryConstraint; -/** - * Creates a `QueryConstraint` with the specified ending point (exclusive). - * - * Using `startAt()`, `startAfter()`, `endBefore()`, `endAt()` and `equalTo()` - * allows you to choose arbitrary starting and ending points for your queries. - * - * The ending point is exclusive. If only a value is provided, children - * with a value less than the specified value will be included in the query. - * If a key is specified, then children must have a value less than or equal - * to the specified value and a key name less than the specified key. - * - * @param value - The value to end before. The argument type depends on which - * `orderBy*()` function was used in this query. Specify a value that matches - * the `orderBy*()` type. When used in combination with `orderByKey()`, the - * value must be a string. - * @param key - The child key to end before, among the children with the - * previously specified priority. This argument is only allowed if ordering by - * child, value, or priority. - */ -export declare function endBefore(value: number | string | boolean | null, key?: string): QueryConstraint; -/** - * Creates a `QueryConstraint` with the specified starting point. - * - * Using `startAt()`, `startAfter()`, `endBefore()`, `endAt()` and `equalTo()` - * allows you to choose arbitrary starting and ending points for your queries. - * - * The starting point is inclusive, so children with exactly the specified value - * will be included in the query. The optional key argument can be used to - * further limit the range of the query. If it is specified, then children that - * have exactly the specified value must also have a key name greater than or - * equal to the specified key. - * - * You can read more about `startAt()` in - * {@link https://firebase.google.com/docs/database/web/lists-of-data#filtering_data | Filtering data}. - * - * @param value - The value to start at. The argument type depends on which - * `orderBy*()` function was used in this query. Specify a value that matches - * the `orderBy*()` type. When used in combination with `orderByKey()`, the - * value must be a string. - * @param key - The child key to start at. This argument is only allowed if - * ordering by child, value, or priority. - */ -export declare function startAt(value?: number | string | boolean | null, key?: string): QueryConstraint; -/** - * Creates a `QueryConstraint` with the specified starting point (exclusive). - * - * Using `startAt()`, `startAfter()`, `endBefore()`, `endAt()` and `equalTo()` - * allows you to choose arbitrary starting and ending points for your queries. - * - * The starting point is exclusive. If only a value is provided, children - * with a value greater than the specified value will be included in the query. - * If a key is specified, then children must have a value greater than or equal - * to the specified value and a a key name greater than the specified key. - * - * @param value - The value to start after. The argument type depends on which - * `orderBy*()` function was used in this query. Specify a value that matches - * the `orderBy*()` type. When used in combination with `orderByKey()`, the - * value must be a string. - * @param key - The child key to start after. This argument is only allowed if - * ordering by child, value, or priority. - */ -export declare function startAfter(value: number | string | boolean | null, key?: string): QueryConstraint; -/** - * Creates a new `QueryConstraint` that if limited to the first specific number - * of children. - * - * The `limitToFirst()` method is used to set a maximum number of children to be - * synced for a given callback. If we set a limit of 100, we will initially only - * receive up to 100 `child_added` events. If we have fewer than 100 messages - * stored in our Database, a `child_added` event will fire for each message. - * However, if we have over 100 messages, we will only receive a `child_added` - * event for the first 100 ordered messages. As items change, we will receive - * `child_removed` events for each item that drops out of the active list so - * that the total number stays at 100. - * - * You can read more about `limitToFirst()` in - * {@link https://firebase.google.com/docs/database/web/lists-of-data#filtering_data | Filtering data}. - * - * @param limit - The maximum number of nodes to include in this query. - */ -export declare function limitToFirst(limit: number): QueryConstraint; -/** - * Creates a new `QueryConstraint` that is limited to return only the last - * specified number of children. - * - * The `limitToLast()` method is used to set a maximum number of children to be - * synced for a given callback. If we set a limit of 100, we will initially only - * receive up to 100 `child_added` events. If we have fewer than 100 messages - * stored in our Database, a `child_added` event will fire for each message. - * However, if we have over 100 messages, we will only receive a `child_added` - * event for the last 100 ordered messages. As items change, we will receive - * `child_removed` events for each item that drops out of the active list so - * that the total number stays at 100. - * - * You can read more about `limitToLast()` in - * {@link https://firebase.google.com/docs/database/web/lists-of-data#filtering_data | Filtering data}. - * - * @param limit - The maximum number of nodes to include in this query. - */ -export declare function limitToLast(limit: number): QueryConstraint; -/** - * Creates a new `QueryConstraint` that orders by the specified child key. - * - * Queries can only order by one key at a time. Calling `orderByChild()` - * multiple times on the same query is an error. - * - * Firebase queries allow you to order your data by any child key on the fly. - * However, if you know in advance what your indexes will be, you can define - * them via the .indexOn rule in your Security Rules for better performance. See - * the{@link https://firebase.google.com/docs/database/security/indexing-data} - * rule for more information. - * - * You can read more about `orderByChild()` in - * {@link https://firebase.google.com/docs/database/web/lists-of-data#sort_data | Sort data}. - * - * @param path - The path to order by. - */ -export declare function orderByChild(path: string): QueryConstraint; -/** - * Creates a new `QueryConstraint` that orders by the key. - * - * Sorts the results of a query by their (ascending) key values. - * - * You can read more about `orderByKey()` in - * {@link https://firebase.google.com/docs/database/web/lists-of-data#sort_data | Sort data}. - */ -export declare function orderByKey(): QueryConstraint; -/** - * Creates a new `QueryConstraint` that orders by priority. - * - * Applications need not use priority but can order collections by - * ordinary properties (see - * {@link https://firebase.google.com/docs/database/web/lists-of-data#sort_data | Sort data} - * for alternatives to priority. - */ -export declare function orderByPriority(): QueryConstraint; -/** - * Creates a new `QueryConstraint` that orders by value. - * - * If the children of a query are all scalar values (string, number, or - * boolean), you can order the results by their (ascending) values. - * - * You can read more about `orderByValue()` in - * {@link https://firebase.google.com/docs/database/web/lists-of-data#sort_data | Sort data}. - */ -export declare function orderByValue(): QueryConstraint; -/** - * Creates a `QueryConstraint` that includes children that match the specified - * value. - * - * Using `startAt()`, `startAfter()`, `endBefore()`, `endAt()` and `equalTo()` - * allows you to choose arbitrary starting and ending points for your queries. - * - * The optional key argument can be used to further limit the range of the - * query. If it is specified, then children that have exactly the specified - * value must also have exactly the specified key as their key name. This can be - * used to filter result sets with many matches for the same value. - * - * You can read more about `equalTo()` in - * {@link https://firebase.google.com/docs/database/web/lists-of-data#filtering_data | Filtering data}. - * - * @param value - The value to match for. The argument type depends on which - * `orderBy*()` function was used in this query. Specify a value that matches - * the `orderBy*()` type. When used in combination with `orderByKey()`, the - * value must be a string. - * @param key - The child key to start at, among the children with the - * previously specified priority. This argument is only allowed if ordering by - * child, value, or priority. - */ -export declare function equalTo(value: number | string | boolean | null, key?: string): QueryConstraint; -/** - * Creates a new immutable instance of `Query` that is extended to also include - * additional query constraints. - * - * @param query - The Query instance to use as a base for the new constraints. - * @param queryConstraints - The list of `QueryConstraint`s to apply. - * @throws if any of the provided query constraints cannot be combined with the - * existing or new constraints. - */ -export declare function query(query: Query, ...queryConstraints: QueryConstraint[]): Query; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/api/ServerValue.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/api/ServerValue.d.ts deleted file mode 100644 index b222e7e0..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/api/ServerValue.d.ts +++ /dev/null @@ -1,30 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Returns a placeholder value for auto-populating the current timestamp (time - * since the Unix epoch, in milliseconds) as determined by the Firebase - * servers. - */ -export declare function serverTimestamp(): object; -/** - * Returns a placeholder value that can be used to atomically increment the - * current database value by the provided delta. - * - * @param delta - the amount to modify the current value atomically. - * @returns A placeholder value for modifying data atomically server-side. - */ -export declare function increment(delta: number): object; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/api/Transaction.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/api/Transaction.d.ts deleted file mode 100644 index 95ae9797..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/api/Transaction.d.ts +++ /dev/null @@ -1,83 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { DatabaseReference } from './Reference'; -import { DataSnapshot } from './Reference_impl'; -/** An options object to configure transactions. */ -export interface TransactionOptions { - /** - * By default, events are raised each time the transaction update function - * runs. So if it is run multiple times, you may see intermediate states. You - * can set this to false to suppress these intermediate states and instead - * wait until the transaction has completed before events are raised. - */ - readonly applyLocally?: boolean; -} -/** - * A type for the resolve value of {@link runTransaction}. - */ -export declare class TransactionResult { - /** Whether the transaction was successfully committed. */ - readonly committed: boolean; - /** The resulting data snapshot. */ - readonly snapshot: DataSnapshot; - /** @hideconstructor */ - constructor( - /** Whether the transaction was successfully committed. */ - committed: boolean, - /** The resulting data snapshot. */ - snapshot: DataSnapshot); - /** Returns a JSON-serializable representation of this object. */ - toJSON(): object; -} -/** - * Atomically modifies the data at this location. - * - * Atomically modify the data at this location. Unlike a normal `set()`, which - * just overwrites the data regardless of its previous value, `runTransaction()` is - * used to modify the existing value to a new value, ensuring there are no - * conflicts with other clients writing to the same location at the same time. - * - * To accomplish this, you pass `runTransaction()` an update function which is - * used to transform the current value into a new value. If another client - * writes to the location before your new value is successfully written, your - * update function will be called again with the new current value, and the - * write will be retried. This will happen repeatedly until your write succeeds - * without conflict or you abort the transaction by not returning a value from - * your update function. - * - * Note: Modifying data with `set()` will cancel any pending transactions at - * that location, so extreme care should be taken if mixing `set()` and - * `runTransaction()` to update the same data. - * - * Note: When using transactions with Security and Firebase Rules in place, be - * aware that a client needs `.read` access in addition to `.write` access in - * order to perform a transaction. This is because the client-side nature of - * transactions requires the client to read the data in order to transactionally - * update it. - * - * @param ref - The location to atomically modify. - * @param transactionUpdate - A developer-supplied function which will be passed - * the current data stored at this location (as a JavaScript object). The - * function should return the new value it would like written (as a JavaScript - * object). If `undefined` is returned (i.e. you return with no arguments) the - * transaction will be aborted and the data at this location will not be - * modified. - * @param options - An options object to configure transactions. - * @returns A `Promise` that can optionally be used instead of the `onComplete` - * callback to handle success and failure. - */ -export declare function runTransaction(ref: DatabaseReference, transactionUpdate: (currentData: any) => unknown, options?: TransactionOptions): Promise; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/api/test_access.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/api/test_access.d.ts deleted file mode 100644 index 60cecac0..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/api/test_access.d.ts +++ /dev/null @@ -1,31 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { PersistentConnection } from '../core/PersistentConnection'; -import { RepoInfo } from '../core/RepoInfo'; -import { Connection } from '../realtime/Connection'; -export declare const DataConnection: typeof PersistentConnection; -export declare const RealTimeConnection: typeof Connection; -/** - * @internal - */ -export declare const hijackHash: (newHash: () => string) => () => void; -export declare const ConnectionTarget: typeof RepoInfo; -/** - * Forces the RepoManager to create Repos that use ReadonlyRestClient instead of PersistentConnection. - * @internal - */ -export declare const forceRestClient: (forceRestClient: boolean) => void; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/AppCheckTokenProvider.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/AppCheckTokenProvider.d.ts deleted file mode 100644 index 6496ca98..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/AppCheckTokenProvider.d.ts +++ /dev/null @@ -1,30 +0,0 @@ -/** - * @license - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { AppCheckInternalComponentName, AppCheckTokenListener, AppCheckTokenResult } from '@firebase/app-check-interop-types'; -import { Provider } from '@firebase/component'; -/** - * Abstraction around AppCheck's token fetching capabilities. - */ -export declare class AppCheckTokenProvider { - private appName_; - private appCheckProvider?; - private appCheck?; - constructor(appName_: string, appCheckProvider?: Provider); - getToken(forceRefresh?: boolean): Promise; - addTokenChangeListener(listener: AppCheckTokenListener): void; - notifyForInvalidToken(): void; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/AuthTokenProvider.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/AuthTokenProvider.d.ts deleted file mode 100644 index 1c797d91..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/AuthTokenProvider.d.ts +++ /dev/null @@ -1,49 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { FirebaseAuthTokenData } from '@firebase/app-types/private'; -import { FirebaseAuthInternalName } from '@firebase/auth-interop-types'; -import { Provider } from '@firebase/component'; -export interface AuthTokenProvider { - getToken(forceRefresh: boolean): Promise; - addTokenChangeListener(listener: (token: string | null) => void): void; - removeTokenChangeListener(listener: (token: string | null) => void): void; - notifyForInvalidToken(): void; -} -/** - * Abstraction around FirebaseApp's token fetching capabilities. - */ -export declare class FirebaseAuthTokenProvider implements AuthTokenProvider { - private appName_; - private firebaseOptions_; - private authProvider_; - private auth_; - constructor(appName_: string, firebaseOptions_: object, authProvider_: Provider); - getToken(forceRefresh: boolean): Promise; - addTokenChangeListener(listener: (token: string | null) => void): void; - removeTokenChangeListener(listener: (token: string | null) => void): void; - notifyForInvalidToken(): void; -} -export declare class EmulatorTokenProvider implements AuthTokenProvider { - private accessToken; - /** A string that is treated as an admin access token by the RTDB emulator. Used by Admin SDK. */ - static OWNER: string; - constructor(accessToken: string); - getToken(forceRefresh: boolean): Promise; - addTokenChangeListener(listener: (token: string | null) => void): void; - removeTokenChangeListener(listener: (token: string | null) => void): void; - notifyForInvalidToken(): void; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/CompoundWrite.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/CompoundWrite.d.ts deleted file mode 100644 index 40c4926a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/CompoundWrite.d.ts +++ /dev/null @@ -1,81 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { NamedNode, Node } from './snap/Node'; -import { ImmutableTree } from './util/ImmutableTree'; -import { Path } from './util/Path'; -/** - * This class holds a collection of writes that can be applied to nodes in unison. It abstracts away the logic with - * dealing with priority writes and multiple nested writes. At any given path there is only allowed to be one write - * modifying that path. Any write to an existing path or shadowing an existing path will modify that existing write - * to reflect the write added. - */ -export declare class CompoundWrite { - writeTree_: ImmutableTree; - constructor(writeTree_: ImmutableTree); - static empty(): CompoundWrite; -} -export declare function compoundWriteAddWrite(compoundWrite: CompoundWrite, path: Path, node: Node): CompoundWrite; -export declare function compoundWriteAddWrites(compoundWrite: CompoundWrite, path: Path, updates: { - [name: string]: Node; -}): CompoundWrite; -/** - * Will remove a write at the given path and deeper paths. This will not modify a write at a higher - * location, which must be removed by calling this method with that path. - * - * @param compoundWrite - The CompoundWrite to remove. - * @param path - The path at which a write and all deeper writes should be removed - * @returns The new CompoundWrite with the removed path - */ -export declare function compoundWriteRemoveWrite(compoundWrite: CompoundWrite, path: Path): CompoundWrite; -/** - * Returns whether this CompoundWrite will fully overwrite a node at a given location and can therefore be - * considered "complete". - * - * @param compoundWrite - The CompoundWrite to check. - * @param path - The path to check for - * @returns Whether there is a complete write at that path - */ -export declare function compoundWriteHasCompleteWrite(compoundWrite: CompoundWrite, path: Path): boolean; -/** - * Returns a node for a path if and only if the node is a "complete" overwrite at that path. This will not aggregate - * writes from deeper paths, but will return child nodes from a more shallow path. - * - * @param compoundWrite - The CompoundWrite to get the node from. - * @param path - The path to get a complete write - * @returns The node if complete at that path, or null otherwise. - */ -export declare function compoundWriteGetCompleteNode(compoundWrite: CompoundWrite, path: Path): Node | null; -/** - * Returns all children that are guaranteed to be a complete overwrite. - * - * @param compoundWrite - The CompoundWrite to get children from. - * @returns A list of all complete children. - */ -export declare function compoundWriteGetCompleteChildren(compoundWrite: CompoundWrite): NamedNode[]; -export declare function compoundWriteChildCompoundWrite(compoundWrite: CompoundWrite, path: Path): CompoundWrite; -/** - * Returns true if this CompoundWrite is empty and therefore does not modify any nodes. - * @returns Whether this CompoundWrite is empty - */ -export declare function compoundWriteIsEmpty(compoundWrite: CompoundWrite): boolean; -/** - * Applies this CompoundWrite to a node. The node is returned with all writes from this CompoundWrite applied to the - * node - * @param node - The node to apply this CompoundWrite to - * @returns The node with all writes applied - */ -export declare function compoundWriteApply(compoundWrite: CompoundWrite, node: Node): Node; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/PersistentConnection.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/PersistentConnection.d.ts deleted file mode 100644 index afff5985..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/PersistentConnection.d.ts +++ /dev/null @@ -1,135 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { AppCheckTokenProvider } from './AppCheckTokenProvider'; -import { AuthTokenProvider } from './AuthTokenProvider'; -import { RepoInfo } from './RepoInfo'; -import { ServerActions } from './ServerActions'; -import { QueryContext } from './view/EventRegistration'; -/** - * Firebase connection. Abstracts wire protocol and handles reconnecting. - * - * NOTE: All JSON objects sent to the realtime connection must have property names enclosed - * in quotes to make sure the closure compiler does not minify them. - */ -export declare class PersistentConnection extends ServerActions { - private repoInfo_; - private applicationId_; - private onDataUpdate_; - private onConnectStatus_; - private onServerInfoUpdate_; - private authTokenProvider_; - private appCheckTokenProvider_; - private authOverride_?; - id: number; - private log_; - private interruptReasons_; - private readonly listens; - private outstandingPuts_; - private outstandingGets_; - private outstandingPutCount_; - private outstandingGetCount_; - private onDisconnectRequestQueue_; - private connected_; - private reconnectDelay_; - private maxReconnectDelay_; - private securityDebugCallback_; - lastSessionId: string | null; - private establishConnectionTimer_; - private visible_; - private requestCBHash_; - private requestNumber_; - private realtime_; - private authToken_; - private appCheckToken_; - private forceTokenRefresh_; - private invalidAuthTokenCount_; - private invalidAppCheckTokenCount_; - private firstConnection_; - private lastConnectionAttemptTime_; - private lastConnectionEstablishedTime_; - private static nextPersistentConnectionId_; - /** - * Counter for number of connections created. Mainly used for tagging in the logs - */ - private static nextConnectionId_; - /** - * @param repoInfo_ - Data about the namespace we are connecting to - * @param applicationId_ - The Firebase App ID for this project - * @param onDataUpdate_ - A callback for new data from the server - */ - constructor(repoInfo_: RepoInfo, applicationId_: string, onDataUpdate_: (a: string, b: unknown, c: boolean, d: number | null) => void, onConnectStatus_: (a: boolean) => void, onServerInfoUpdate_: (a: unknown) => void, authTokenProvider_: AuthTokenProvider, appCheckTokenProvider_: AppCheckTokenProvider, authOverride_?: object | null); - protected sendRequest(action: string, body: unknown, onResponse?: (a: unknown) => void): void; - get(query: QueryContext): Promise; - listen(query: QueryContext, currentHashFn: () => string, tag: number | null, onComplete: (a: string, b: unknown) => void): void; - private sendGet_; - private sendListen_; - private static warnOnListenWarnings_; - refreshAuthToken(token: string): void; - private reduceReconnectDelayIfAdminCredential_; - refreshAppCheckToken(token: string | null): void; - /** - * Attempts to authenticate with the given credentials. If the authentication attempt fails, it's triggered like - * a auth revoked (the connection is closed). - */ - tryAuth(): void; - /** - * Attempts to authenticate with the given token. If the authentication - * attempt fails, it's triggered like the token was revoked (the connection is - * closed). - */ - tryAppCheck(): void; - /** - * @inheritDoc - */ - unlisten(query: QueryContext, tag: number | null): void; - private sendUnlisten_; - onDisconnectPut(pathString: string, data: unknown, onComplete?: (a: string, b: string) => void): void; - onDisconnectMerge(pathString: string, data: unknown, onComplete?: (a: string, b: string) => void): void; - onDisconnectCancel(pathString: string, onComplete?: (a: string, b: string) => void): void; - private sendOnDisconnect_; - put(pathString: string, data: unknown, onComplete?: (a: string, b: string) => void, hash?: string): void; - merge(pathString: string, data: unknown, onComplete: (a: string, b: string | null) => void, hash?: string): void; - putInternal(action: string, pathString: string, data: unknown, onComplete: (a: string, b: string | null) => void, hash?: string): void; - private sendPut_; - reportStats(stats: { - [k: string]: unknown; - }): void; - private onDataMessage_; - private onDataPush_; - private onReady_; - private scheduleConnect_; - private initConnection_; - private onVisible_; - private onOnline_; - private onRealtimeDisconnect_; - private establishConnection_; - interrupt(reason: string): void; - resume(reason: string): void; - private handleTimestamp_; - private cancelSentTransactions_; - private onListenRevoked_; - private removeListen_; - private onAuthRevoked_; - private onAppCheckRevoked_; - private onSecurityDebugPacket_; - private restoreState_; - /** - * Sends client stats for first connection - */ - private sendConnectStats_; - private shouldReconnect_; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/ReadonlyRestClient.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/ReadonlyRestClient.d.ts deleted file mode 100644 index 87bfe414..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/ReadonlyRestClient.d.ts +++ /dev/null @@ -1,60 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { AppCheckTokenProvider } from './AppCheckTokenProvider'; -import { AuthTokenProvider } from './AuthTokenProvider'; -import { RepoInfo } from './RepoInfo'; -import { ServerActions } from './ServerActions'; -import { QueryContext } from './view/EventRegistration'; -/** - * An implementation of ServerActions that communicates with the server via REST requests. - * This is mostly useful for compatibility with crawlers, where we don't want to spin up a full - * persistent connection (using WebSockets or long-polling) - */ -export declare class ReadonlyRestClient extends ServerActions { - private repoInfo_; - private onDataUpdate_; - private authTokenProvider_; - private appCheckTokenProvider_; - reportStats(stats: { - [k: string]: unknown; - }): void; - /** @private {function(...[*])} */ - private log_; - /** - * We don't actually need to track listens, except to prevent us calling an onComplete for a listen - * that's been removed. :-/ - */ - private listens_; - static getListenId_(query: QueryContext, tag?: number | null): string; - /** - * @param repoInfo_ - Data about the namespace we are connecting to - * @param onDataUpdate_ - A callback for new data from the server - */ - constructor(repoInfo_: RepoInfo, onDataUpdate_: (a: string, b: unknown, c: boolean, d: number | null) => void, authTokenProvider_: AuthTokenProvider, appCheckTokenProvider_: AppCheckTokenProvider); - /** @inheritDoc */ - listen(query: QueryContext, currentHashFn: () => string, tag: number | null, onComplete: (a: string, b: unknown) => void): void; - /** @inheritDoc */ - unlisten(query: QueryContext, tag: number | null): void; - get(query: QueryContext): Promise; - /** @inheritDoc */ - refreshAuthToken(token: string): void; - /** - * Performs a REST request to the given path, with the provided query string parameters, - * and any auth credentials we have. - */ - private restRequest_; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/Repo.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/Repo.d.ts deleted file mode 100644 index deded000..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/Repo.d.ts +++ /dev/null @@ -1,144 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { ValueEventRegistration } from '../api/Reference_impl'; -import { AppCheckTokenProvider } from './AppCheckTokenProvider'; -import { AuthTokenProvider } from './AuthTokenProvider'; -import { PersistentConnection } from './PersistentConnection'; -import { RepoInfo } from './RepoInfo'; -import { ServerActions } from './ServerActions'; -import { Node } from './snap/Node'; -import { SnapshotHolder } from './SnapshotHolder'; -import { SparseSnapshotTree } from './SparseSnapshotTree'; -import { StatsCollection } from './stats/StatsCollection'; -import { StatsListener } from './stats/StatsListener'; -import { StatsReporter } from './stats/StatsReporter'; -import { SyncTree } from './SyncTree'; -import { Indexable } from './util/misc'; -import { Path } from './util/Path'; -import { Tree } from './util/Tree'; -import { EventQueue } from './view/EventQueue'; -import { EventRegistration, QueryContext } from './view/EventRegistration'; -declare const enum TransactionStatus { - RUN = 0, - SENT = 1, - COMPLETED = 2, - SENT_NEEDS_ABORT = 3, - NEEDS_ABORT = 4 -} -interface Transaction { - path: Path; - update: (a: unknown) => unknown; - onComplete: (error: Error | null, committed: boolean, node: Node | null) => void; - status: TransactionStatus; - order: number; - applyLocally: boolean; - retryCount: number; - unwatcher: () => void; - abortReason: string | null; - currentWriteId: number; - currentInputSnapshot: Node | null; - currentOutputSnapshotRaw: Node | null; - currentOutputSnapshotResolved: Node | null; -} -/** - * A connection to a single data repository. - */ -export declare class Repo { - repoInfo_: RepoInfo; - forceRestClient_: boolean; - authTokenProvider_: AuthTokenProvider; - appCheckProvider_: AppCheckTokenProvider; - /** Key for uniquely identifying this repo, used in RepoManager */ - readonly key: string; - dataUpdateCount: number; - infoSyncTree_: SyncTree; - serverSyncTree_: SyncTree; - stats_: StatsCollection; - statsListener_: StatsListener | null; - eventQueue_: EventQueue; - nextWriteId_: number; - server_: ServerActions; - statsReporter_: StatsReporter; - infoData_: SnapshotHolder; - interceptServerDataCallback_: ((a: string, b: unknown) => void) | null; - /** A list of data pieces and paths to be set when this client disconnects. */ - onDisconnect_: SparseSnapshotTree; - /** Stores queues of outstanding transactions for Firebase locations. */ - transactionQueueTree_: Tree; - persistentConnection_: PersistentConnection | null; - constructor(repoInfo_: RepoInfo, forceRestClient_: boolean, authTokenProvider_: AuthTokenProvider, appCheckProvider_: AppCheckTokenProvider); - /** - * @returns The URL corresponding to the root of this Firebase. - */ - toString(): string; -} -export declare function repoStart(repo: Repo, appId: string, authOverride?: object): void; -/** - * @returns The time in milliseconds, taking the server offset into account if we have one. - */ -export declare function repoServerTime(repo: Repo): number; -/** - * Generate ServerValues using some variables from the repo object. - */ -export declare function repoGenerateServerValues(repo: Repo): Indexable; -export declare function repoInterceptServerData(repo: Repo, callback: ((a: string, b: unknown) => unknown) | null): void; -/** - * The purpose of `getValue` is to return the latest known value - * satisfying `query`. - * - * This method will first check for in-memory cached values - * belonging to active listeners. If they are found, such values - * are considered to be the most up-to-date. - * - * If the client is not connected, this method will wait until the - * repo has established a connection and then request the value for `query`. - * If the client is not able to retrieve the query result for another reason, - * it reports an error. - * - * @param query - The query to surface a value for. - */ -export declare function repoGetValue(repo: Repo, query: QueryContext, eventRegistration: ValueEventRegistration): Promise; -export declare function repoSetWithPriority(repo: Repo, path: Path, newVal: unknown, newPriority: number | string | null, onComplete: ((status: Error | null, errorReason?: string) => void) | null): void; -export declare function repoUpdate(repo: Repo, path: Path, childrenToMerge: { - [k: string]: unknown; -}, onComplete: ((status: Error | null, errorReason?: string) => void) | null): void; -export declare function repoOnDisconnectCancel(repo: Repo, path: Path, onComplete: ((status: Error | null, errorReason?: string) => void) | null): void; -export declare function repoOnDisconnectSet(repo: Repo, path: Path, value: unknown, onComplete: ((status: Error | null, errorReason?: string) => void) | null): void; -export declare function repoOnDisconnectSetWithPriority(repo: Repo, path: Path, value: unknown, priority: unknown, onComplete: ((status: Error | null, errorReason?: string) => void) | null): void; -export declare function repoOnDisconnectUpdate(repo: Repo, path: Path, childrenToMerge: { - [k: string]: unknown; -}, onComplete: ((status: Error | null, errorReason?: string) => void) | null): void; -export declare function repoAddEventCallbackForQuery(repo: Repo, query: QueryContext, eventRegistration: EventRegistration): void; -export declare function repoRemoveEventCallbackForQuery(repo: Repo, query: QueryContext, eventRegistration: EventRegistration): void; -export declare function repoInterrupt(repo: Repo): void; -export declare function repoResume(repo: Repo): void; -export declare function repoStats(repo: Repo, showDelta?: boolean): void; -export declare function repoStatsIncrementCounter(repo: Repo, metric: string): void; -export declare function repoCallOnCompleteCallback(repo: Repo, callback: ((status: Error | null, errorReason?: string) => void) | null, status: string, errorReason?: string | null): void; -/** - * Creates a new transaction, adds it to the transactions we're tracking, and - * sends it to the server if possible. - * - * @param path - Path at which to do transaction. - * @param transactionUpdate - Update callback. - * @param onComplete - Completion callback. - * @param unwatcher - Function that will be called when the transaction no longer - * need data updates for `path`. - * @param applyLocally - Whether or not to make intermediate results visible - */ -export declare function repoStartTransaction(repo: Repo, path: Path, transactionUpdate: (a: unknown) => unknown, onComplete: ((error: Error, committed: boolean, node: Node) => void) | null, unwatcher: () => void, applyLocally: boolean): void; -export {}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/RepoInfo.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/RepoInfo.d.ts deleted file mode 100644 index d24201bb..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/RepoInfo.d.ts +++ /dev/null @@ -1,55 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * A class that holds metadata about a Repo object - */ -export declare class RepoInfo { - readonly secure: boolean; - readonly namespace: string; - readonly webSocketOnly: boolean; - readonly nodeAdmin: boolean; - readonly persistenceKey: string; - readonly includeNamespaceInQueryParams: boolean; - private _host; - private _domain; - internalHost: string; - /** - * @param host - Hostname portion of the url for the repo - * @param secure - Whether or not this repo is accessed over ssl - * @param namespace - The namespace represented by the repo - * @param webSocketOnly - Whether to prefer websockets over all other transports (used by Nest). - * @param nodeAdmin - Whether this instance uses Admin SDK credentials - * @param persistenceKey - Override the default session persistence storage key - */ - constructor(host: string, secure: boolean, namespace: string, webSocketOnly: boolean, nodeAdmin?: boolean, persistenceKey?: string, includeNamespaceInQueryParams?: boolean); - isCacheableHost(): boolean; - isCustomHost(): boolean; - get host(): string; - set host(newHost: string); - toString(): string; - toURLString(): string; -} -/** - * Returns the websocket URL for this repo - * @param repoInfo - RepoInfo object - * @param type - of connection - * @param params - list - * @returns The URL for this repo - */ -export declare function repoInfoConnectionURL(repoInfo: RepoInfo, type: string, params: { - [k: string]: string; -}): string; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/ServerActions.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/ServerActions.d.ts deleted file mode 100644 index a1cca073..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/ServerActions.d.ts +++ /dev/null @@ -1,52 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { QueryContext } from './view/EventRegistration'; -/** - * Interface defining the set of actions that can be performed against the Firebase server - * (basically corresponds to our wire protocol). - * - * @interface - */ -export declare abstract class ServerActions { - abstract listen(query: QueryContext, currentHashFn: () => string, tag: number | null, onComplete: (a: string, b: unknown) => void): void; - /** - * Remove a listen. - */ - abstract unlisten(query: QueryContext, tag: number | null): void; - /** - * Get the server value satisfying this query. - */ - abstract get(query: QueryContext): Promise; - put(pathString: string, data: unknown, onComplete?: (a: string, b: string) => void, hash?: string): void; - merge(pathString: string, data: unknown, onComplete: (a: string, b: string | null) => void, hash?: string): void; - /** - * Refreshes the auth token for the current connection. - * @param token - The authentication token - */ - refreshAuthToken(token: string): void; - /** - * Refreshes the app check token for the current connection. - * @param token The app check token - */ - refreshAppCheckToken(token: string): void; - onDisconnectPut(pathString: string, data: unknown, onComplete?: (a: string, b: string) => void): void; - onDisconnectMerge(pathString: string, data: unknown, onComplete?: (a: string, b: string) => void): void; - onDisconnectCancel(pathString: string, onComplete?: (a: string, b: string) => void): void; - reportStats(stats: { - [k: string]: unknown; - }): void; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/SnapshotHolder.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/SnapshotHolder.d.ts deleted file mode 100644 index ec799e2e..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/SnapshotHolder.d.ts +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { Node } from './snap/Node'; -import { Path } from './util/Path'; -/** - * Mutable object which basically just stores a reference to the "latest" immutable snapshot. - */ -export declare class SnapshotHolder { - private rootNode_; - getNode(path: Path): Node; - updateSnapshot(path: Path, newSnapshotNode: Node): void; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/SparseSnapshotTree.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/SparseSnapshotTree.d.ts deleted file mode 100644 index a2a28736..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/SparseSnapshotTree.d.ts +++ /dev/null @@ -1,64 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { Node } from './snap/Node'; -import { Path } from './util/Path'; -/** - * Helper class to store a sparse set of snapshots. - */ -export interface SparseSnapshotTree { - value: Node | null; - readonly children: Map; -} -export declare function newSparseSnapshotTree(): SparseSnapshotTree; -/** - * Gets the node stored at the given path if one exists. - * Only seems to be used in tests. - * - * @param path - Path to look up snapshot for. - * @returns The retrieved node, or null. - */ -export declare function sparseSnapshotTreeFind(sparseSnapshotTree: SparseSnapshotTree, path: Path): Node | null; -/** - * Stores the given node at the specified path. If there is already a node - * at a shallower path, it merges the new data into that snapshot node. - * - * @param path - Path to look up snapshot for. - * @param data - The new data, or null. - */ -export declare function sparseSnapshotTreeRemember(sparseSnapshotTree: SparseSnapshotTree, path: Path, data: Node): void; -/** - * Purge the data at path from the cache. - * - * @param path - Path to look up snapshot for. - * @returns True if this node should now be removed. - */ -export declare function sparseSnapshotTreeForget(sparseSnapshotTree: SparseSnapshotTree, path: Path): boolean; -/** - * Recursively iterates through all of the stored tree and calls the - * callback on each one. - * - * @param prefixPath - Path to look up node for. - * @param func - The function to invoke for each tree. - */ -export declare function sparseSnapshotTreeForEachTree(sparseSnapshotTree: SparseSnapshotTree, prefixPath: Path, func: (a: Path, b: Node) => unknown): void; -/** - * Iterates through each immediate child and triggers the callback. - * Only seems to be used in tests. - * - * @param func - The function to invoke for each child. - */ -export declare function sparseSnapshotTreeForEachChild(sparseSnapshotTree: SparseSnapshotTree, func: (a: string, b: SparseSnapshotTree) => void): void; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/SyncPoint.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/SyncPoint.d.ts deleted file mode 100644 index dc84eabd..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/SyncPoint.d.ts +++ /dev/null @@ -1,91 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { ReferenceConstructor } from '../api/Reference'; -import { Operation } from './operation/Operation'; -import { Node } from './snap/Node'; -import { Path } from './util/Path'; -import { Event } from './view/Event'; -import { EventRegistration, QueryContext } from './view/EventRegistration'; -import { View } from './view/View'; -import { WriteTreeRef } from './WriteTree'; -/** - * SyncPoint represents a single location in a SyncTree with 1 or more event registrations, meaning we need to - * maintain 1 or more Views at this location to cache server data and raise appropriate events for server changes - * and user writes (set, transaction, update). - * - * It's responsible for: - * - Maintaining the set of 1 or more views necessary at this location (a SyncPoint with 0 views should be removed). - * - Proxying user / server operations to the views as appropriate (i.e. applyServerOverwrite, - * applyUserOverwrite, etc.) - */ -export declare class SyncPoint { - /** - * The Views being tracked at this location in the tree, stored as a map where the key is a - * queryId and the value is the View for that query. - * - * NOTE: This list will be quite small (usually 1, but perhaps 2 or 3; any more is an odd use case). - */ - readonly views: Map; -} -export declare function syncPointSetReferenceConstructor(val: ReferenceConstructor): void; -export declare function syncPointIsEmpty(syncPoint: SyncPoint): boolean; -export declare function syncPointApplyOperation(syncPoint: SyncPoint, operation: Operation, writesCache: WriteTreeRef, optCompleteServerCache: Node | null): Event[]; -/** - * Get a view for the specified query. - * - * @param query - The query to return a view for - * @param writesCache - * @param serverCache - * @param serverCacheComplete - * @returns Events to raise. - */ -export declare function syncPointGetView(syncPoint: SyncPoint, query: QueryContext, writesCache: WriteTreeRef, serverCache: Node | null, serverCacheComplete: boolean): View; -/** - * Add an event callback for the specified query. - * - * @param query - * @param eventRegistration - * @param writesCache - * @param serverCache - Complete server cache, if we have it. - * @param serverCacheComplete - * @returns Events to raise. - */ -export declare function syncPointAddEventRegistration(syncPoint: SyncPoint, query: QueryContext, eventRegistration: EventRegistration, writesCache: WriteTreeRef, serverCache: Node | null, serverCacheComplete: boolean): Event[]; -/** - * Remove event callback(s). Return cancelEvents if a cancelError is specified. - * - * If query is the default query, we'll check all views for the specified eventRegistration. - * If eventRegistration is null, we'll remove all callbacks for the specified view(s). - * - * @param eventRegistration - If null, remove all callbacks. - * @param cancelError - If a cancelError is provided, appropriate cancel events will be returned. - * @returns removed queries and any cancel events - */ -export declare function syncPointRemoveEventRegistration(syncPoint: SyncPoint, query: QueryContext, eventRegistration: EventRegistration | null, cancelError?: Error): { - removed: QueryContext[]; - events: Event[]; -}; -export declare function syncPointGetQueryViews(syncPoint: SyncPoint): View[]; -/** - * @param path - The path to the desired complete snapshot - * @returns A complete cache, if it exists - */ -export declare function syncPointGetCompleteServerCache(syncPoint: SyncPoint, path: Path): Node | null; -export declare function syncPointViewForQuery(syncPoint: SyncPoint, query: QueryContext): View | null; -export declare function syncPointViewExistsForQuery(syncPoint: SyncPoint, query: QueryContext): boolean; -export declare function syncPointHasCompleteView(syncPoint: SyncPoint): boolean; -export declare function syncPointGetCompleteView(syncPoint: SyncPoint): View | null; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/SyncTree.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/SyncTree.d.ts deleted file mode 100644 index 301c1ae7..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/SyncTree.d.ts +++ /dev/null @@ -1,166 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { ReferenceConstructor } from '../api/Reference'; -import { Node } from './snap/Node'; -import { SyncPoint } from './SyncPoint'; -import { ImmutableTree } from './util/ImmutableTree'; -import { Path } from './util/Path'; -import { Event } from './view/Event'; -import { EventRegistration, QueryContext } from './view/EventRegistration'; -import { WriteTree } from './WriteTree'; -export declare function syncTreeSetReferenceConstructor(val: ReferenceConstructor): void; -export interface ListenProvider { - startListening(query: QueryContext, tag: number | null, hashFn: () => string, onComplete: (a: string, b?: unknown) => Event[]): Event[]; - stopListening(a: QueryContext, b: number | null): void; -} -export declare function resetSyncTreeTag(): void; -/** - * SyncTree is the central class for managing event callback registration, data caching, views - * (query processing), and event generation. There are typically two SyncTree instances for - * each Repo, one for the normal Firebase data, and one for the .info data. - * - * It has a number of responsibilities, including: - * - Tracking all user event callbacks (registered via addEventRegistration() and removeEventRegistration()). - * - Applying and caching data changes for user set(), transaction(), and update() calls - * (applyUserOverwrite(), applyUserMerge()). - * - Applying and caching data changes for server data changes (applyServerOverwrite(), - * applyServerMerge()). - * - Generating user-facing events for server and user changes (all of the apply* methods - * return the set of events that need to be raised as a result). - * - Maintaining the appropriate set of server listens to ensure we are always subscribed - * to the correct set of paths and queries to satisfy the current set of user event - * callbacks (listens are started/stopped using the provided listenProvider). - * - * NOTE: Although SyncTree tracks event callbacks and calculates events to raise, the actual - * events are returned to the caller rather than raised synchronously. - * - */ -export declare class SyncTree { - listenProvider_: ListenProvider; - /** - * Tree of SyncPoints. There's a SyncPoint at any location that has 1 or more views. - */ - syncPointTree_: ImmutableTree; - /** - * A tree of all pending user writes (user-initiated set()'s, transaction()'s, update()'s, etc.). - */ - pendingWriteTree_: WriteTree; - readonly tagToQueryMap: Map; - readonly queryToTagMap: Map; - /** - * @param listenProvider_ - Used by SyncTree to start / stop listening - * to server data. - */ - constructor(listenProvider_: ListenProvider); -} -/** - * Apply the data changes for a user-generated set() or transaction() call. - * - * @returns Events to raise. - */ -export declare function syncTreeApplyUserOverwrite(syncTree: SyncTree, path: Path, newData: Node, writeId: number, visible?: boolean): Event[]; -/** - * Apply the data from a user-generated update() call - * - * @returns Events to raise. - */ -export declare function syncTreeApplyUserMerge(syncTree: SyncTree, path: Path, changedChildren: { - [k: string]: Node; -}, writeId: number): Event[]; -/** - * Acknowledge a pending user write that was previously registered with applyUserOverwrite() or applyUserMerge(). - * - * @param revert - True if the given write failed and needs to be reverted - * @returns Events to raise. - */ -export declare function syncTreeAckUserWrite(syncTree: SyncTree, writeId: number, revert?: boolean): Event[]; -/** - * Apply new server data for the specified path.. - * - * @returns Events to raise. - */ -export declare function syncTreeApplyServerOverwrite(syncTree: SyncTree, path: Path, newData: Node): Event[]; -/** - * Apply new server data to be merged in at the specified path. - * - * @returns Events to raise. - */ -export declare function syncTreeApplyServerMerge(syncTree: SyncTree, path: Path, changedChildren: { - [k: string]: Node; -}): Event[]; -/** - * Apply a listen complete for a query - * - * @returns Events to raise. - */ -export declare function syncTreeApplyListenComplete(syncTree: SyncTree, path: Path): Event[]; -/** - * Apply a listen complete for a tagged query - * - * @returns Events to raise. - */ -export declare function syncTreeApplyTaggedListenComplete(syncTree: SyncTree, path: Path, tag: number): Event[]; -/** - * Remove event callback(s). - * - * If query is the default query, we'll check all queries for the specified eventRegistration. - * If eventRegistration is null, we'll remove all callbacks for the specified query/queries. - * - * @param eventRegistration - If null, all callbacks are removed. - * @param cancelError - If a cancelError is provided, appropriate cancel events will be returned. - * @param skipListenerDedup - When performing a `get()`, we don't add any new listeners, so no - * deduping needs to take place. This flag allows toggling of that behavior - * @returns Cancel events, if cancelError was provided. - */ -export declare function syncTreeRemoveEventRegistration(syncTree: SyncTree, query: QueryContext, eventRegistration: EventRegistration | null, cancelError?: Error, skipListenerDedup?: boolean): Event[]; -/** - * Apply new server data for the specified tagged query. - * - * @returns Events to raise. - */ -export declare function syncTreeApplyTaggedQueryOverwrite(syncTree: SyncTree, path: Path, snap: Node, tag: number): Event[]; -/** - * Apply server data to be merged in for the specified tagged query. - * - * @returns Events to raise. - */ -export declare function syncTreeApplyTaggedQueryMerge(syncTree: SyncTree, path: Path, changedChildren: { - [k: string]: Node; -}, tag: number): Event[]; -/** - * Add an event callback for the specified query. - * - * @returns Events to raise. - */ -export declare function syncTreeAddEventRegistration(syncTree: SyncTree, query: QueryContext, eventRegistration: EventRegistration, skipSetupListener?: boolean): Event[]; -/** - * Returns a complete cache, if we have one, of the data at a particular path. If the location does not have a - * listener above it, we will get a false "null". This shouldn't be a problem because transactions will always - * have a listener above, and atomic operations would correctly show a jitter of -> - * as the write is applied locally and then acknowledged at the server. - * - * Note: this method will *include* hidden writes from transaction with applyLocally set to false. - * - * @param path - The path to the data we want - * @param writeIdsToExclude - A specific set to be excluded - */ -export declare function syncTreeCalcCompleteEventCache(syncTree: SyncTree, path: Path, writeIdsToExclude?: number[]): Node; -export declare function syncTreeGetServerValue(syncTree: SyncTree, query: QueryContext): Node | null; -/** - * Return the tag associated with the given query. - */ -export declare function syncTreeTagForQuery(syncTree: SyncTree, query: QueryContext): number | null; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/WriteTree.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/WriteTree.d.ts deleted file mode 100644 index ef9059e2..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/WriteTree.d.ts +++ /dev/null @@ -1,205 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { CompoundWrite } from './CompoundWrite'; -import { ChildrenNode } from './snap/ChildrenNode'; -import { Index } from './snap/indexes/Index'; -import { NamedNode, Node } from './snap/Node'; -import { Path } from './util/Path'; -import { CacheNode } from './view/CacheNode'; -/** - * Defines a single user-initiated write operation. May be the result of a set(), transaction(), or update() call. In - * the case of a set() or transaction, snap wil be non-null. In the case of an update(), children will be non-null. - */ -export interface WriteRecord { - writeId: number; - path: Path; - snap?: Node | null; - children?: { - [k: string]: Node; - } | null; - visible: boolean; -} -/** - * Create a new WriteTreeRef for the given path. For use with a new sync point at the given path. - * - */ -export declare function writeTreeChildWrites(writeTree: WriteTree, path: Path): WriteTreeRef; -/** - * Record a new overwrite from user code. - * - * @param visible - This is set to false by some transactions. It should be excluded from event caches - */ -export declare function writeTreeAddOverwrite(writeTree: WriteTree, path: Path, snap: Node, writeId: number, visible?: boolean): void; -/** - * Record a new merge from user code. - */ -export declare function writeTreeAddMerge(writeTree: WriteTree, path: Path, changedChildren: { - [k: string]: Node; -}, writeId: number): void; -export declare function writeTreeGetWrite(writeTree: WriteTree, writeId: number): WriteRecord | null; -/** - * Remove a write (either an overwrite or merge) that has been successfully acknowledge by the server. Recalculates - * the tree if necessary. We return true if it may have been visible, meaning views need to reevaluate. - * - * @returns true if the write may have been visible (meaning we'll need to reevaluate / raise - * events as a result). - */ -export declare function writeTreeRemoveWrite(writeTree: WriteTree, writeId: number): boolean; -/** - * Return a complete snapshot for the given path if there's visible write data at that path, else null. - * No server data is considered. - * - */ -export declare function writeTreeGetCompleteWriteData(writeTree: WriteTree, path: Path): Node | null; -/** - * Given optional, underlying server data, and an optional set of constraints (exclude some sets, include hidden - * writes), attempt to calculate a complete snapshot for the given path - * - * @param writeIdsToExclude - An optional set to be excluded - * @param includeHiddenWrites - Defaults to false, whether or not to layer on writes with visible set to false - */ -export declare function writeTreeCalcCompleteEventCache(writeTree: WriteTree, treePath: Path, completeServerCache: Node | null, writeIdsToExclude?: number[], includeHiddenWrites?: boolean): Node | null; -/** - * With optional, underlying server data, attempt to return a children node of children that we have complete data for. - * Used when creating new views, to pre-fill their complete event children snapshot. - */ -export declare function writeTreeCalcCompleteEventChildren(writeTree: WriteTree, treePath: Path, completeServerChildren: ChildrenNode | null): Node; -/** - * Given that the underlying server data has updated, determine what, if anything, needs to be - * applied to the event cache. - * - * Possibilities: - * - * 1. No writes are shadowing. Events should be raised, the snap to be applied comes from the server data - * - * 2. Some write is completely shadowing. No events to be raised - * - * 3. Is partially shadowed. Events - * - * Either existingEventSnap or existingServerSnap must exist - */ -export declare function writeTreeCalcEventCacheAfterServerOverwrite(writeTree: WriteTree, treePath: Path, childPath: Path, existingEventSnap: Node | null, existingServerSnap: Node | null): Node | null; -/** - * Returns a complete child for a given server snap after applying all user writes or null if there is no - * complete child for this ChildKey. - */ -export declare function writeTreeCalcCompleteChild(writeTree: WriteTree, treePath: Path, childKey: string, existingServerSnap: CacheNode): Node | null; -/** - * Returns a node if there is a complete overwrite for this path. More specifically, if there is a write at - * a higher path, this will return the child of that write relative to the write and this path. - * Returns null if there is no write at this path. - */ -export declare function writeTreeShadowingWrite(writeTree: WriteTree, path: Path): Node | null; -/** - * This method is used when processing child remove events on a query. If we can, we pull in children that were outside - * the window, but may now be in the window. - */ -export declare function writeTreeCalcIndexedSlice(writeTree: WriteTree, treePath: Path, completeServerData: Node | null, startPost: NamedNode, count: number, reverse: boolean, index: Index): NamedNode[]; -export declare function newWriteTree(): WriteTree; -/** - * WriteTree tracks all pending user-initiated writes and has methods to calculate the result of merging them - * with underlying server data (to create "event cache" data). Pending writes are added with addOverwrite() - * and addMerge(), and removed with removeWrite(). - */ -export interface WriteTree { - /** - * A tree tracking the result of applying all visible writes. This does not include transactions with - * applyLocally=false or writes that are completely shadowed by other writes. - */ - visibleWrites: CompoundWrite; - /** - * A list of all pending writes, regardless of visibility and shadowed-ness. Used to calculate arbitrary - * sets of the changed data, such as hidden writes (from transactions) or changes with certain writes excluded (also - * used by transactions). - */ - allWrites: WriteRecord[]; - lastWriteId: number; -} -/** - * If possible, returns a complete event cache, using the underlying server data if possible. In addition, can be used - * to get a cache that includes hidden writes, and excludes arbitrary writes. Note that customizing the returned node - * can lead to a more expensive calculation. - * - * @param writeIdsToExclude - Optional writes to exclude. - * @param includeHiddenWrites - Defaults to false, whether or not to layer on writes with visible set to false - */ -export declare function writeTreeRefCalcCompleteEventCache(writeTreeRef: WriteTreeRef, completeServerCache: Node | null, writeIdsToExclude?: number[], includeHiddenWrites?: boolean): Node | null; -/** - * If possible, returns a children node containing all of the complete children we have data for. The returned data is a - * mix of the given server data and write data. - * - */ -export declare function writeTreeRefCalcCompleteEventChildren(writeTreeRef: WriteTreeRef, completeServerChildren: ChildrenNode | null): ChildrenNode; -/** - * Given that either the underlying server data has updated or the outstanding writes have updated, determine what, - * if anything, needs to be applied to the event cache. - * - * Possibilities: - * - * 1. No writes are shadowing. Events should be raised, the snap to be applied comes from the server data - * - * 2. Some write is completely shadowing. No events to be raised - * - * 3. Is partially shadowed. Events should be raised - * - * Either existingEventSnap or existingServerSnap must exist, this is validated via an assert - * - * - */ -export declare function writeTreeRefCalcEventCacheAfterServerOverwrite(writeTreeRef: WriteTreeRef, path: Path, existingEventSnap: Node | null, existingServerSnap: Node | null): Node | null; -/** - * Returns a node if there is a complete overwrite for this path. More specifically, if there is a write at - * a higher path, this will return the child of that write relative to the write and this path. - * Returns null if there is no write at this path. - * - */ -export declare function writeTreeRefShadowingWrite(writeTreeRef: WriteTreeRef, path: Path): Node | null; -/** - * This method is used when processing child remove events on a query. If we can, we pull in children that were outside - * the window, but may now be in the window - */ -export declare function writeTreeRefCalcIndexedSlice(writeTreeRef: WriteTreeRef, completeServerData: Node | null, startPost: NamedNode, count: number, reverse: boolean, index: Index): NamedNode[]; -/** - * Returns a complete child for a given server snap after applying all user writes or null if there is no - * complete child for this ChildKey. - */ -export declare function writeTreeRefCalcCompleteChild(writeTreeRef: WriteTreeRef, childKey: string, existingServerCache: CacheNode): Node | null; -/** - * Return a WriteTreeRef for a child. - */ -export declare function writeTreeRefChild(writeTreeRef: WriteTreeRef, childName: string): WriteTreeRef; -export declare function newWriteTreeRef(path: Path, writeTree: WriteTree): WriteTreeRef; -/** - * A WriteTreeRef wraps a WriteTree and a path, for convenient access to a particular subtree. All of the methods - * just proxy to the underlying WriteTree. - * - */ -export interface WriteTreeRef { - /** - * The path to this particular write tree ref. Used for calling methods on writeTree_ while exposing a simpler - * interface to callers. - */ - readonly treePath: Path; - /** - * * A reference to the actual tree of write data. All methods are pass-through to the tree, but with the appropriate - * path prefixed. - * - * This lets us make cheap references to points in the tree for sync points without having to copy and maintain all of - * the data. - */ - readonly writeTree: WriteTree; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/operation/AckUserWrite.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/operation/AckUserWrite.d.ts deleted file mode 100644 index 66337cf9..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/operation/AckUserWrite.d.ts +++ /dev/null @@ -1,36 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { ImmutableTree } from '../util/ImmutableTree'; -import { Path } from '../util/Path'; -import { Operation, OperationType } from './Operation'; -export declare class AckUserWrite implements Operation { - /** @inheritDoc */ path: Path; - /** @inheritDoc */ affectedTree: ImmutableTree; - /** @inheritDoc */ revert: boolean; - /** @inheritDoc */ - type: OperationType; - /** @inheritDoc */ - source: import("./Operation").OperationSource; - /** - * @param affectedTree - A tree containing true for each affected path. Affected paths can't overlap. - */ - constructor( - /** @inheritDoc */ path: Path, - /** @inheritDoc */ affectedTree: ImmutableTree, - /** @inheritDoc */ revert: boolean); - operationForChild(childName: string): AckUserWrite; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/operation/ListenComplete.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/operation/ListenComplete.d.ts deleted file mode 100644 index 77e42506..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/operation/ListenComplete.d.ts +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { Path } from '../util/Path'; -import { Operation, OperationSource, OperationType } from './Operation'; -export declare class ListenComplete implements Operation { - source: OperationSource; - path: Path; - /** @inheritDoc */ - type: OperationType; - constructor(source: OperationSource, path: Path); - operationForChild(childName: string): ListenComplete; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/operation/Merge.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/operation/Merge.d.ts deleted file mode 100644 index 440a9111..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/operation/Merge.d.ts +++ /dev/null @@ -1,33 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { Node } from '../snap/Node'; -import { ImmutableTree } from '../util/ImmutableTree'; -import { Path } from '../util/Path'; -import { Operation, OperationSource, OperationType } from './Operation'; -export declare class Merge implements Operation { - /** @inheritDoc */ source: OperationSource; - /** @inheritDoc */ path: Path; - /** @inheritDoc */ children: ImmutableTree; - /** @inheritDoc */ - type: OperationType; - constructor( - /** @inheritDoc */ source: OperationSource, - /** @inheritDoc */ path: Path, - /** @inheritDoc */ children: ImmutableTree); - operationForChild(childName: string): Operation; - toString(): string; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/operation/Operation.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/operation/Operation.d.ts deleted file mode 100644 index fa624bcb..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/operation/Operation.d.ts +++ /dev/null @@ -1,45 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { Path } from '../util/Path'; -/** - * - * @enum - */ -export declare enum OperationType { - OVERWRITE = 0, - MERGE = 1, - ACK_USER_WRITE = 2, - LISTEN_COMPLETE = 3 -} -/** - * @interface - */ -export interface Operation { - source: OperationSource; - type: OperationType; - path: Path; - operationForChild(childName: string): Operation | null; -} -export interface OperationSource { - fromUser: boolean; - fromServer: boolean; - queryId: string | null; - tagged: boolean; -} -export declare function newOperationSourceUser(): OperationSource; -export declare function newOperationSourceServer(): OperationSource; -export declare function newOperationSourceServerTaggedQuery(queryId: string): OperationSource; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/operation/Overwrite.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/operation/Overwrite.d.ts deleted file mode 100644 index c5a15ebe..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/operation/Overwrite.d.ts +++ /dev/null @@ -1,28 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { Node } from '../snap/Node'; -import { Path } from '../util/Path'; -import { Operation, OperationSource, OperationType } from './Operation'; -export declare class Overwrite implements Operation { - source: OperationSource; - path: Path; - snap: Node; - /** @inheritDoc */ - type: OperationType; - constructor(source: OperationSource, path: Path, snap: Node); - operationForChild(childName: string): Overwrite; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/snap/ChildrenNode.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/snap/ChildrenNode.d.ts deleted file mode 100644 index b0ac8e05..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/snap/ChildrenNode.d.ts +++ /dev/null @@ -1,112 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { Path } from '../util/Path'; -import { SortedMap, SortedMapIterator } from '../util/SortedMap'; -import { Index } from './indexes/Index'; -import { IndexMap } from './IndexMap'; -import { NamedNode, Node } from './Node'; -export interface ChildrenNodeConstructor { - new (children_: SortedMap, priorityNode_: Node | null, indexMap_: IndexMap): ChildrenNode; - EMPTY_NODE: ChildrenNode; -} -/** - * ChildrenNode is a class for storing internal nodes in a DataSnapshot - * (i.e. nodes with children). It implements Node and stores the - * list of children in the children property, sorted by child name. - */ -export declare class ChildrenNode implements Node { - private readonly children_; - private readonly priorityNode_; - private indexMap_; - private lazyHash_; - static get EMPTY_NODE(): ChildrenNode; - /** - * @param children_ - List of children of this node.. - * @param priorityNode_ - The priority of this node (as a snapshot node). - */ - constructor(children_: SortedMap, priorityNode_: Node | null, indexMap_: IndexMap); - /** @inheritDoc */ - isLeafNode(): boolean; - /** @inheritDoc */ - getPriority(): Node; - /** @inheritDoc */ - updatePriority(newPriorityNode: Node): Node; - /** @inheritDoc */ - getImmediateChild(childName: string): Node; - /** @inheritDoc */ - getChild(path: Path): Node; - /** @inheritDoc */ - hasChild(childName: string): boolean; - /** @inheritDoc */ - updateImmediateChild(childName: string, newChildNode: Node): Node; - /** @inheritDoc */ - updateChild(path: Path, newChildNode: Node): Node; - /** @inheritDoc */ - isEmpty(): boolean; - /** @inheritDoc */ - numChildren(): number; - private static INTEGER_REGEXP_; - /** @inheritDoc */ - val(exportFormat?: boolean): object; - /** @inheritDoc */ - hash(): string; - /** @inheritDoc */ - getPredecessorChildName(childName: string, childNode: Node, index: Index): string; - getFirstChildName(indexDefinition: Index): string | null; - getFirstChild(indexDefinition: Index): NamedNode | null; - /** - * Given an index, return the key name of the largest value we have, according to that index - */ - getLastChildName(indexDefinition: Index): string | null; - getLastChild(indexDefinition: Index): NamedNode | null; - forEachChild(index: Index, action: (key: string, node: Node) => boolean | void): boolean; - getIterator(indexDefinition: Index): SortedMapIterator; - getIteratorFrom(startPost: NamedNode, indexDefinition: Index): SortedMapIterator; - getReverseIterator(indexDefinition: Index): SortedMapIterator; - getReverseIteratorFrom(endPost: NamedNode, indexDefinition: Index): SortedMapIterator; - compareTo(other: ChildrenNode): number; - withIndex(indexDefinition: Index): Node; - isIndexed(index: Index): boolean; - equals(other: Node): boolean; - /** - * Returns a SortedMap ordered by index, or null if the default (by-key) ordering can be used - * instead. - * - */ - private resolveIndex_; -} -export declare class MaxNode extends ChildrenNode { - constructor(); - compareTo(other: Node): number; - equals(other: Node): boolean; - getPriority(): MaxNode; - getImmediateChild(childName: string): ChildrenNode; - isEmpty(): boolean; -} -/** - * Marker that will sort higher than any other snapshot. - */ -export declare const MAX_NODE: MaxNode; -/** - * Document NamedNode extensions - */ -declare module './Node' { - interface NamedNode { - MIN: NamedNode; - MAX: NamedNode; - } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/snap/IndexMap.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/snap/IndexMap.d.ts deleted file mode 100644 index 3ac5f0e9..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/snap/IndexMap.d.ts +++ /dev/null @@ -1,43 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { SortedMap } from '../util/SortedMap'; -import { Index } from './indexes/Index'; -import { NamedNode, Node } from './Node'; -export declare class IndexMap { - private indexes_; - private indexSet_; - /** - * The default IndexMap for nodes without a priority - */ - static get Default(): IndexMap; - constructor(indexes_: { - [k: string]: SortedMap | /*FallbackType*/ object; - }, indexSet_: { - [k: string]: Index; - }); - get(indexKey: string): SortedMap | null; - hasIndex(indexDefinition: Index): boolean; - addIndex(indexDefinition: Index, existingChildren: SortedMap): IndexMap; - /** - * Ensure that this node is properly tracked in any indexes that we're maintaining - */ - addToIndexes(namedNode: NamedNode, existingChildren: SortedMap): IndexMap; - /** - * Create a new IndexMap instance with the given value removed - */ - removeFromIndexes(namedNode: NamedNode, existingChildren: SortedMap): IndexMap; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/snap/LeafNode.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/snap/LeafNode.d.ts deleted file mode 100644 index c48cda6e..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/snap/LeafNode.d.ts +++ /dev/null @@ -1,83 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { Indexable } from '../util/misc'; -import { Path } from '../util/Path'; -import { ChildrenNodeConstructor } from './ChildrenNode'; -import { Index } from './indexes/Index'; -import { Node } from './Node'; -/** - * LeafNode is a class for storing leaf nodes in a DataSnapshot. It - * implements Node and stores the value of the node (a string, - * number, or boolean) accessible via getValue(). - */ -export declare class LeafNode implements Node { - private readonly value_; - private priorityNode_; - static set __childrenNodeConstructor(val: ChildrenNodeConstructor); - static get __childrenNodeConstructor(): ChildrenNodeConstructor; - /** - * The sort order for comparing leaf nodes of different types. If two leaf nodes have - * the same type, the comparison falls back to their value - */ - static VALUE_TYPE_ORDER: string[]; - private lazyHash_; - /** - * @param value_ - The value to store in this leaf node. The object type is - * possible in the event of a deferred value - * @param priorityNode_ - The priority of this node. - */ - constructor(value_: string | number | boolean | Indexable, priorityNode_?: Node); - /** @inheritDoc */ - isLeafNode(): boolean; - /** @inheritDoc */ - getPriority(): Node; - /** @inheritDoc */ - updatePriority(newPriorityNode: Node): Node; - /** @inheritDoc */ - getImmediateChild(childName: string): Node; - /** @inheritDoc */ - getChild(path: Path): Node; - hasChild(): boolean; - /** @inheritDoc */ - getPredecessorChildName(childName: string, childNode: Node): null; - /** @inheritDoc */ - updateImmediateChild(childName: string, newChildNode: Node): Node; - /** @inheritDoc */ - updateChild(path: Path, newChildNode: Node): Node; - /** @inheritDoc */ - isEmpty(): boolean; - /** @inheritDoc */ - numChildren(): number; - /** @inheritDoc */ - forEachChild(index: Index, action: (s: string, n: Node) => void): boolean; - val(exportFormat?: boolean): {}; - /** @inheritDoc */ - hash(): string; - /** - * Returns the value of the leaf node. - * @returns The value of the node. - */ - getValue(): Indexable | string | number | boolean; - compareTo(other: Node): number; - /** - * Comparison specifically for two leaf nodes - */ - private compareToLeafNode_; - withIndex(): Node; - isIndexed(): boolean; - equals(other: Node): boolean; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/snap/Node.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/snap/Node.d.ts deleted file mode 100644 index 8249916b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/snap/Node.d.ts +++ /dev/null @@ -1,126 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { Path } from '../util/Path'; -import { Index } from './indexes/Index'; -/** - * Node is an interface defining the common functionality for nodes in - * a DataSnapshot. - * - * @interface - */ -export interface Node { - /** - * Whether this node is a leaf node. - * @returns Whether this is a leaf node. - */ - isLeafNode(): boolean; - /** - * Gets the priority of the node. - * @returns The priority of the node. - */ - getPriority(): Node; - /** - * Returns a duplicate node with the new priority. - * @param newPriorityNode - New priority to set for the node. - * @returns Node with new priority. - */ - updatePriority(newPriorityNode: Node): Node; - /** - * Returns the specified immediate child, or null if it doesn't exist. - * @param childName - The name of the child to retrieve. - * @returns The retrieved child, or an empty node. - */ - getImmediateChild(childName: string): Node; - /** - * Returns a child by path, or null if it doesn't exist. - * @param path - The path of the child to retrieve. - * @returns The retrieved child or an empty node. - */ - getChild(path: Path): Node; - /** - * Returns the name of the child immediately prior to the specified childNode, or null. - * @param childName - The name of the child to find the predecessor of. - * @param childNode - The node to find the predecessor of. - * @param index - The index to use to determine the predecessor - * @returns The name of the predecessor child, or null if childNode is the first child. - */ - getPredecessorChildName(childName: string, childNode: Node, index: Index): string | null; - /** - * Returns a duplicate node, with the specified immediate child updated. - * Any value in the node will be removed. - * @param childName - The name of the child to update. - * @param newChildNode - The new child node - * @returns The updated node. - */ - updateImmediateChild(childName: string, newChildNode: Node): Node; - /** - * Returns a duplicate node, with the specified child updated. Any value will - * be removed. - * @param path - The path of the child to update. - * @param newChildNode - The new child node, which may be an empty node - * @returns The updated node. - */ - updateChild(path: Path, newChildNode: Node): Node; - /** - * True if the immediate child specified exists - */ - hasChild(childName: string): boolean; - /** - * @returns True if this node has no value or children. - */ - isEmpty(): boolean; - /** - * @returns The number of children of this node. - */ - numChildren(): number; - /** - * Calls action for each child. - * @param action - Action to be called for - * each child. It's passed the child name and the child node. - * @returns The first truthy value return by action, or the last falsey one - */ - forEachChild(index: Index, action: (a: string, b: Node) => void): unknown; - /** - * @param exportFormat - True for export format (also wire protocol format). - * @returns Value of this node as JSON. - */ - val(exportFormat?: boolean): unknown; - /** - * @returns hash representing the node contents. - */ - hash(): string; - /** - * @param other - Another node - * @returns -1 for less than, 0 for equal, 1 for greater than other - */ - compareTo(other: Node): number; - /** - * @returns Whether or not this snapshot equals other - */ - equals(other: Node): boolean; - /** - * @returns This node, with the specified index now available - */ - withIndex(indexDefinition: Index): Node; - isIndexed(indexDefinition: Index): boolean; -} -export declare class NamedNode { - name: string; - node: Node; - constructor(name: string, node: Node); - static Wrap(name: string, node: Node): NamedNode; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/snap/childSet.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/snap/childSet.d.ts deleted file mode 100644 index 5f964f5f..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/snap/childSet.d.ts +++ /dev/null @@ -1,32 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { SortedMap } from '../util/SortedMap'; -import { NamedNode } from './Node'; -/** - * Takes a list of child nodes and constructs a SortedSet using the given comparison - * function - * - * Uses the algorithm described in the paper linked here: - * http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.46.1458 - * - * @param childList - Unsorted list of children - * @param cmp - The comparison method to be used - * @param keyFn - An optional function to extract K from a node wrapper, if K's - * type is not NamedNode - * @param mapSortFn - An optional override for comparator used by the generated sorted map - */ -export declare const buildChildSet: (childList: NamedNode[], cmp: (a: NamedNode, b: NamedNode) => number, keyFn?: (a: NamedNode) => K, mapSortFn?: (a: K, b: K) => number) => SortedMap; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/snap/comparators.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/snap/comparators.d.ts deleted file mode 100644 index 15d32616..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/snap/comparators.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { NamedNode } from './Node'; -export declare function NAME_ONLY_COMPARATOR(left: NamedNode, right: NamedNode): number; -export declare function NAME_COMPARATOR(left: string, right: string): number; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/snap/indexes/Index.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/snap/indexes/Index.d.ts deleted file mode 100644 index dde70489..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/snap/indexes/Index.d.ts +++ /dev/null @@ -1,50 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { Comparator } from '../../util/SortedMap'; -import { Node, NamedNode } from '../Node'; -export declare abstract class Index { - abstract compare(a: NamedNode, b: NamedNode): number; - abstract isDefinedOn(node: Node): boolean; - /** - * @returns A standalone comparison function for - * this index - */ - getCompare(): Comparator; - /** - * Given a before and after value for a node, determine if the indexed value has changed. Even if they are different, - * it's possible that the changes are isolated to parts of the snapshot that are not indexed. - * - * - * @returns True if the portion of the snapshot being indexed changed between oldNode and newNode - */ - indexedValueChanged(oldNode: Node, newNode: Node): boolean; - /** - * @returns a node wrapper that will sort equal to or less than - * any other node wrapper, using this index - */ - minPost(): NamedNode; - /** - * @returns a node wrapper that will sort greater than or equal to - * any other node wrapper, using this index - */ - abstract maxPost(): NamedNode; - abstract makePost(indexValue: unknown, name: string): NamedNode; - /** - * @returns String representation for inclusion in a query spec - */ - abstract toString(): string; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/snap/indexes/KeyIndex.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/snap/indexes/KeyIndex.d.ts deleted file mode 100644 index 3bed7150..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/snap/indexes/KeyIndex.d.ts +++ /dev/null @@ -1,34 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { ChildrenNode } from '../ChildrenNode'; -import { Node, NamedNode } from '../Node'; -import { Index } from './Index'; -export declare class KeyIndex extends Index { - static get __EMPTY_NODE(): ChildrenNode; - static set __EMPTY_NODE(val: ChildrenNode); - compare(a: NamedNode, b: NamedNode): number; - isDefinedOn(node: Node): boolean; - indexedValueChanged(oldNode: Node, newNode: Node): boolean; - minPost(): any; - maxPost(): NamedNode; - makePost(indexValue: string, name: string): NamedNode; - /** - * @returns String representation for inclusion in a query spec - */ - toString(): string; -} -export declare const KEY_INDEX: KeyIndex; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/snap/indexes/PathIndex.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/snap/indexes/PathIndex.d.ts deleted file mode 100644 index f96ab691..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/snap/indexes/PathIndex.d.ts +++ /dev/null @@ -1,29 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { Path } from '../../util/Path'; -import { NamedNode, Node } from '../Node'; -import { Index } from './Index'; -export declare class PathIndex extends Index { - private indexPath_; - constructor(indexPath_: Path); - protected extractChild(snap: Node): Node; - isDefinedOn(node: Node): boolean; - compare(a: NamedNode, b: NamedNode): number; - makePost(indexValue: object, name: string): NamedNode; - maxPost(): NamedNode; - toString(): string; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/snap/indexes/PriorityIndex.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/snap/indexes/PriorityIndex.d.ts deleted file mode 100644 index ce368d4e..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/snap/indexes/PriorityIndex.d.ts +++ /dev/null @@ -1,33 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { NamedNode, Node } from '../Node'; -import { Index } from './Index'; -export declare function setNodeFromJSON(val: (a: unknown) => Node): void; -export declare function setMaxNode(val: Node): void; -export declare class PriorityIndex extends Index { - compare(a: NamedNode, b: NamedNode): number; - isDefinedOn(node: Node): boolean; - indexedValueChanged(oldNode: Node, newNode: Node): boolean; - minPost(): NamedNode; - maxPost(): NamedNode; - makePost(indexValue: unknown, name: string): NamedNode; - /** - * @returns String representation for inclusion in a query spec - */ - toString(): string; -} -export declare const PRIORITY_INDEX: PriorityIndex; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/snap/indexes/ValueIndex.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/snap/indexes/ValueIndex.d.ts deleted file mode 100644 index c1a5396a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/snap/indexes/ValueIndex.d.ts +++ /dev/null @@ -1,31 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { NamedNode, Node } from '../Node'; -import { Index } from './Index'; -export declare class ValueIndex extends Index { - compare(a: NamedNode, b: NamedNode): number; - isDefinedOn(node: Node): boolean; - indexedValueChanged(oldNode: Node, newNode: Node): boolean; - minPost(): NamedNode; - maxPost(): NamedNode; - makePost(indexValue: object, name: string): NamedNode; - /** - * @returns String representation for inclusion in a query spec - */ - toString(): string; -} -export declare const VALUE_INDEX: ValueIndex; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/snap/nodeFromJSON.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/snap/nodeFromJSON.d.ts deleted file mode 100644 index bc6900cf..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/snap/nodeFromJSON.d.ts +++ /dev/null @@ -1,24 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { Node } from './Node'; -/** - * Constructs a snapshot node representing the passed JSON and returns it. - * @param json - JSON to create a node for. - * @param priority - Optional priority to use. This will be ignored if the - * passed JSON contains a .priority property. - */ -export declare function nodeFromJSON(json: unknown | null, priority?: unknown): Node; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/snap/snap.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/snap/snap.d.ts deleted file mode 100644 index b70d5e00..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/snap/snap.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { Node } from './Node'; -export declare function setMaxNode(val: Node): void; -export declare const priorityHashText: (priority: string | number) => string; -/** - * Validates that a priority snapshot Node is valid. - */ -export declare const validatePriorityNode: (priorityNode: Node) => void; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/stats/StatsCollection.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/stats/StatsCollection.d.ts deleted file mode 100644 index 4b11a2d8..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/stats/StatsCollection.d.ts +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Tracks a collection of stats. - */ -export declare class StatsCollection { - private counters_; - incrementCounter(name: string, amount?: number): void; - get(): { - [k: string]: number; - }; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/stats/StatsListener.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/stats/StatsListener.d.ts deleted file mode 100644 index a7dc485b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/stats/StatsListener.d.ts +++ /dev/null @@ -1,30 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { StatsCollection } from './StatsCollection'; -/** - * Returns the delta from the previous call to get stats. - * - * @param collection_ - The collection to "listen" to. - */ -export declare class StatsListener { - private collection_; - private last_; - constructor(collection_: StatsCollection); - get(): { - [k: string]: number; - }; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/stats/StatsManager.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/stats/StatsManager.d.ts deleted file mode 100644 index 1d6ea229..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/stats/StatsManager.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { RepoInfo } from '../RepoInfo'; -import { StatsCollection } from './StatsCollection'; -export declare function statsManagerGetCollection(repoInfo: RepoInfo): StatsCollection; -export declare function statsManagerGetOrCreateReporter(repoInfo: RepoInfo, creatorFunction: () => T): T; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/stats/StatsReporter.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/stats/StatsReporter.d.ts deleted file mode 100644 index 9b9c6c9c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/stats/StatsReporter.d.ts +++ /dev/null @@ -1,28 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { ServerActions } from '../ServerActions'; -import { StatsCollection } from './StatsCollection'; -export declare class StatsReporter { - private server_; - private statsListener_; - statsToReport_: { - [k: string]: boolean; - }; - constructor(collection: StatsCollection, server_: ServerActions); - private reportStats_; -} -export declare function statsReporterIncludeStat(reporter: StatsReporter, stat: string): void; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/storage/DOMStorageWrapper.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/storage/DOMStorageWrapper.d.ts deleted file mode 100644 index dbffa106..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/storage/DOMStorageWrapper.d.ts +++ /dev/null @@ -1,46 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Wraps a DOM Storage object and: - * - automatically encode objects as JSON strings before storing them to allow us to store arbitrary types. - * - prefixes names with "firebase:" to avoid collisions with app data. - * - * We automatically (see storage.js) create two such wrappers, one for sessionStorage, - * and one for localStorage. - * - */ -export declare class DOMStorageWrapper { - private domStorage_; - private prefix_; - /** - * @param domStorage_ - The underlying storage object (e.g. localStorage or sessionStorage) - */ - constructor(domStorage_: Storage); - /** - * @param key - The key to save the value under - * @param value - The value being stored, or null to remove the key. - */ - set(key: string, value: unknown | null): void; - /** - * @returns The value that was stored under this key, or null - */ - get(key: string): unknown; - remove(key: string): void; - isInMemoryStorage: boolean; - prefixedName_(name: string): string; - toString(): string; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/storage/MemoryStorage.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/storage/MemoryStorage.d.ts deleted file mode 100644 index df11ca68..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/storage/MemoryStorage.d.ts +++ /dev/null @@ -1,27 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * An in-memory storage implementation that matches the API of DOMStorageWrapper - * (TODO: create interface for both to implement). - */ -export declare class MemoryStorage { - private cache_; - set(key: string, value: unknown | null): void; - get(key: string): unknown; - remove(key: string): void; - isInMemoryStorage: boolean; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/storage/storage.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/storage/storage.d.ts deleted file mode 100644 index f78e4d2a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/storage/storage.d.ts +++ /dev/null @@ -1,22 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { DOMStorageWrapper } from './DOMStorageWrapper'; -import { MemoryStorage } from './MemoryStorage'; -/** A storage object that lasts across sessions */ -export declare const PersistentStorage: DOMStorageWrapper | MemoryStorage; -/** A storage object that only lasts one session */ -export declare const SessionStorage: DOMStorageWrapper | MemoryStorage; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/util/EventEmitter.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/util/EventEmitter.d.ts deleted file mode 100644 index cb37e911..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/util/EventEmitter.d.ts +++ /dev/null @@ -1,39 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Base class to be used if you want to emit events. Call the constructor with - * the set of allowed event names. - */ -export declare abstract class EventEmitter { - private allowedEvents_; - private listeners_; - constructor(allowedEvents_: string[]); - /** - * To be overridden by derived classes in order to fire an initial event when - * somebody subscribes for data. - * - * @returns {Array.<*>} Array of parameters to trigger initial event with. - */ - abstract getInitialEvent(eventType: string): unknown[]; - /** - * To be called by derived classes to trigger events. - */ - protected trigger(eventType: string, ...varArgs: unknown[]): void; - on(eventType: string, callback: (a: unknown) => void, context: unknown): void; - off(eventType: string, callback: (a: unknown) => void, context: unknown): void; - private validateEventType_; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/util/ImmutableTree.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/util/ImmutableTree.d.ts deleted file mode 100644 index 964dcb7d..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/util/ImmutableTree.d.ts +++ /dev/null @@ -1,117 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { Path } from './Path'; -import { SortedMap } from './SortedMap'; -/** - * A tree with immutable elements. - */ -export declare class ImmutableTree { - readonly value: T | null; - readonly children: SortedMap>; - static fromObject(obj: { - [k: string]: T; - }): ImmutableTree; - constructor(value: T | null, children?: SortedMap>); - /** - * True if the value is empty and there are no children - */ - isEmpty(): boolean; - /** - * Given a path and predicate, return the first node and the path to that node - * where the predicate returns true. - * - * TODO Do a perf test -- If we're creating a bunch of `{path: value:}` - * objects on the way back out, it may be better to pass down a pathSoFar obj. - * - * @param relativePath - The remainder of the path - * @param predicate - The predicate to satisfy to return a node - */ - findRootMostMatchingPathAndValue(relativePath: Path, predicate: (a: T) => boolean): { - path: Path; - value: T; - } | null; - /** - * Find, if it exists, the shortest subpath of the given path that points a defined - * value in the tree - */ - findRootMostValueAndPath(relativePath: Path): { - path: Path; - value: T; - } | null; - /** - * @returns The subtree at the given path - */ - subtree(relativePath: Path): ImmutableTree; - /** - * Sets a value at the specified path. - * - * @param relativePath - Path to set value at. - * @param toSet - Value to set. - * @returns Resulting tree. - */ - set(relativePath: Path, toSet: T | null): ImmutableTree; - /** - * Removes the value at the specified path. - * - * @param relativePath - Path to value to remove. - * @returns Resulting tree. - */ - remove(relativePath: Path): ImmutableTree; - /** - * Gets a value from the tree. - * - * @param relativePath - Path to get value for. - * @returns Value at path, or null. - */ - get(relativePath: Path): T | null; - /** - * Replace the subtree at the specified path with the given new tree. - * - * @param relativePath - Path to replace subtree for. - * @param newTree - New tree. - * @returns Resulting tree. - */ - setTree(relativePath: Path, newTree: ImmutableTree): ImmutableTree; - /** - * Performs a depth first fold on this tree. Transforms a tree into a single - * value, given a function that operates on the path to a node, an optional - * current value, and a map of child names to folded subtrees - */ - fold(fn: (path: Path, value: T, children: { - [k: string]: V; - }) => V): V; - /** - * Recursive helper for public-facing fold() method - */ - private fold_; - /** - * Find the first matching value on the given path. Return the result of applying f to it. - */ - findOnPath(path: Path, f: (path: Path, value: T) => V | null): V | null; - private findOnPath_; - foreachOnPath(path: Path, f: (path: Path, value: T) => void): ImmutableTree; - private foreachOnPath_; - /** - * Calls the given function for each node in the tree that has a value. - * - * @param f - A function to be called with the path from the root of the tree to - * a node, and the value at that node. Called in depth-first order. - */ - foreach(f: (path: Path, value: T) => void): void; - private foreach_; - foreachChild(f: (name: string, value: T) => void): void; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/util/NextPushId.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/util/NextPushId.d.ts deleted file mode 100644 index 33a438e1..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/util/NextPushId.d.ts +++ /dev/null @@ -1,33 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Fancy ID generator that creates 20-character string identifiers with the - * following properties: - * - * 1. They're based on timestamp so that they sort *after* any existing ids. - * 2. They contain 72-bits of random data after the timestamp so that IDs won't - * collide with other clients' IDs. - * 3. They sort *lexicographically* (so the timestamp is converted to characters - * that will sort properly). - * 4. They're monotonically increasing. Even if you generate more than one in - * the same timestamp, the latter ones will sort after the former ones. We do - * this by using the previous random bits but "incrementing" them by 1 (only - * in the case of a timestamp collision). - */ -export declare const nextPushId: (now: number) => string; -export declare const successor: (key: string) => string; -export declare const predecessor: (key: string) => string; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/util/OnlineMonitor.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/util/OnlineMonitor.d.ts deleted file mode 100644 index 168c515c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/util/OnlineMonitor.d.ts +++ /dev/null @@ -1,31 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { EventEmitter } from './EventEmitter'; -/** - * Monitors online state (as reported by window.online/offline events). - * - * The expectation is that this could have many false positives (thinks we are online - * when we're not), but no false negatives. So we can safely use it to determine when - * we definitely cannot reach the internet. - */ -export declare class OnlineMonitor extends EventEmitter { - private online_; - static getInstance(): OnlineMonitor; - constructor(); - getInitialEvent(eventType: string): boolean[]; - currentlyOnline(): boolean; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/util/Path.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/util/Path.d.ts deleted file mode 100644 index e42a96e8..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/util/Path.d.ts +++ /dev/null @@ -1,94 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * An immutable object representing a parsed path. It's immutable so that you - * can pass them around to other functions without worrying about them changing - * it. - */ -export declare class Path { - pieces_: string[]; - pieceNum_: number; - /** - * @param pathOrString - Path string to parse, or another path, or the raw - * tokens array - */ - constructor(pathOrString: string | string[], pieceNum?: number); - toString(): string; -} -export declare function newEmptyPath(): Path; -export declare function pathGetFront(path: Path): string | null; -/** - * @returns The number of segments in this path - */ -export declare function pathGetLength(path: Path): number; -export declare function pathPopFront(path: Path): Path; -export declare function pathGetBack(path: Path): string | null; -export declare function pathToUrlEncodedString(path: Path): string; -/** - * Shallow copy of the parts of the path. - * - */ -export declare function pathSlice(path: Path, begin?: number): string[]; -export declare function pathParent(path: Path): Path | null; -export declare function pathChild(path: Path, childPathObj: string | Path): Path; -/** - * @returns True if there are no segments in this path - */ -export declare function pathIsEmpty(path: Path): boolean; -/** - * @returns The path from outerPath to innerPath - */ -export declare function newRelativePath(outerPath: Path, innerPath: Path): Path; -/** - * @returns -1, 0, 1 if left is less, equal, or greater than the right. - */ -export declare function pathCompare(left: Path, right: Path): number; -/** - * @returns true if paths are the same. - */ -export declare function pathEquals(path: Path, other: Path): boolean; -/** - * @returns True if this path is a parent of (or the same as) other - */ -export declare function pathContains(path: Path, other: Path): boolean; -/** - * Dynamic (mutable) path used to count path lengths. - * - * This class is used to efficiently check paths for valid - * length (in UTF8 bytes) and depth (used in path validation). - * - * Throws Error exception if path is ever invalid. - * - * The definition of a path always begins with '/'. - */ -export declare class ValidationPath { - errorPrefix_: string; - parts_: string[]; - /** Initialize to number of '/' chars needed in path. */ - byteLength_: number; - /** - * @param path - Initial Path. - * @param errorPrefix_ - Prefix for any error messages. - */ - constructor(path: Path, errorPrefix_: string); -} -export declare function validationPathPush(validationPath: ValidationPath, child: string): void; -export declare function validationPathPop(validationPath: ValidationPath): void; -/** - * String for use in error messages - uses '.' notation for path. - */ -export declare function validationPathToErrorString(validationPath: ValidationPath): string; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/util/ServerValues.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/util/ServerValues.d.ts deleted file mode 100644 index 5dabefd9..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/util/ServerValues.d.ts +++ /dev/null @@ -1,56 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { Node } from '../snap/Node'; -import { SyncTree } from '../SyncTree'; -import { Indexable } from './misc'; -import { Path } from './Path'; -interface ValueProvider { - getImmediateChild(childName: string): ValueProvider; - node(): Node; -} -/** - * Generate placeholders for deferred values. - */ -export declare const generateWithValues: (values: { - [k: string]: unknown; -}) => { - [k: string]: unknown; -}; -/** - * Value to use when firing local events. When writing server values, fire - * local events with an approximate value, otherwise return value as-is. - */ -export declare const resolveDeferredLeafValue: (value: string | number | boolean | { - [k: string]: unknown; -}, existingVal: ValueProvider, serverValues: { - [k: string]: unknown; -}) => string | number | boolean; -/** - * Recursively replace all deferred values and priorities in the tree with the - * specified generated replacement values. - * @param path - path to which write is relative - * @param node - new data written at path - * @param syncTree - current data - */ -export declare const resolveDeferredValueTree: (path: Path, node: Node, syncTree: SyncTree, serverValues: Indexable) => Node; -/** - * Recursively replace all deferred values and priorities in the node with the - * specified generated replacement values. If there are no server values in the node, - * it'll be returned as-is. - */ -export declare const resolveDeferredValueSnapshot: (node: Node, existing: Node, serverValues: Indexable) => Node; -export {}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/util/SortedMap.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/util/SortedMap.d.ts deleted file mode 100644 index 13d00d81..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/util/SortedMap.d.ts +++ /dev/null @@ -1,324 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * @fileoverview Implementation of an immutable SortedMap using a Left-leaning - * Red-Black Tree, adapted from the implementation in Mugs - * (http://mads379.github.com/mugs/) by Mads Hartmann Jensen - * (mads379\@gmail.com). - * - * Original paper on Left-leaning Red-Black Trees: - * http://www.cs.princeton.edu/~rs/talks/LLRB/LLRB.pdf - * - * Invariant 1: No red node has a red child - * Invariant 2: Every leaf path has the same number of black nodes - * Invariant 3: Only the left child can be red (left leaning) - */ -export declare type Comparator = (key1: K, key2: K) => number; -/** - * An iterator over an LLRBNode. - */ -export declare class SortedMapIterator { - private isReverse_; - private resultGenerator_; - private nodeStack_; - /** - * @param node - Node to iterate. - * @param isReverse_ - Whether or not to iterate in reverse - */ - constructor(node: LLRBNode | LLRBEmptyNode, startKey: K | null, comparator: Comparator, isReverse_: boolean, resultGenerator_?: ((k: K, v: V) => T) | null); - getNext(): T; - hasNext(): boolean; - peek(): T; -} -/** - * Represents a node in a Left-leaning Red-Black tree. - */ -export declare class LLRBNode { - key: K; - value: V; - color: boolean; - left: LLRBNode | LLRBEmptyNode; - right: LLRBNode | LLRBEmptyNode; - /** - * @param key - Key associated with this node. - * @param value - Value associated with this node. - * @param color - Whether this node is red. - * @param left - Left child. - * @param right - Right child. - */ - constructor(key: K, value: V, color: boolean | null, left?: LLRBNode | LLRBEmptyNode | null, right?: LLRBNode | LLRBEmptyNode | null); - static RED: boolean; - static BLACK: boolean; - /** - * Returns a copy of the current node, optionally replacing pieces of it. - * - * @param key - New key for the node, or null. - * @param value - New value for the node, or null. - * @param color - New color for the node, or null. - * @param left - New left child for the node, or null. - * @param right - New right child for the node, or null. - * @returns The node copy. - */ - copy(key: K | null, value: V | null, color: boolean | null, left: LLRBNode | LLRBEmptyNode | null, right: LLRBNode | LLRBEmptyNode | null): LLRBNode; - /** - * @returns The total number of nodes in the tree. - */ - count(): number; - /** - * @returns True if the tree is empty. - */ - isEmpty(): boolean; - /** - * Traverses the tree in key order and calls the specified action function - * for each node. - * - * @param action - Callback function to be called for each - * node. If it returns true, traversal is aborted. - * @returns The first truthy value returned by action, or the last falsey - * value returned by action - */ - inorderTraversal(action: (k: K, v: V) => unknown): boolean; - /** - * Traverses the tree in reverse key order and calls the specified action function - * for each node. - * - * @param action - Callback function to be called for each - * node. If it returns true, traversal is aborted. - * @returns True if traversal was aborted. - */ - reverseTraversal(action: (k: K, v: V) => void): boolean; - /** - * @returns The minimum node in the tree. - */ - private min_; - /** - * @returns The maximum key in the tree. - */ - minKey(): K; - /** - * @returns The maximum key in the tree. - */ - maxKey(): K; - /** - * @param key - Key to insert. - * @param value - Value to insert. - * @param comparator - Comparator. - * @returns New tree, with the key/value added. - */ - insert(key: K, value: V, comparator: Comparator): LLRBNode; - /** - * @returns New tree, with the minimum key removed. - */ - private removeMin_; - /** - * @param key - The key of the item to remove. - * @param comparator - Comparator. - * @returns New tree, with the specified item removed. - */ - remove(key: K, comparator: Comparator): LLRBNode | LLRBEmptyNode; - /** - * @returns Whether this is a RED node. - */ - isRed_(): boolean; - /** - * @returns New tree after performing any needed rotations. - */ - private fixUp_; - /** - * @returns New tree, after moveRedLeft. - */ - private moveRedLeft_; - /** - * @returns New tree, after moveRedRight. - */ - private moveRedRight_; - /** - * @returns New tree, after rotateLeft. - */ - private rotateLeft_; - /** - * @returns New tree, after rotateRight. - */ - private rotateRight_; - /** - * @returns Newt ree, after colorFlip. - */ - private colorFlip_; - /** - * For testing. - * - * @returns True if all is well. - */ - private checkMaxDepth_; - check_(): number; -} -/** - * Represents an empty node (a leaf node in the Red-Black Tree). - */ -export declare class LLRBEmptyNode { - key: K; - value: V; - left: LLRBNode | LLRBEmptyNode; - right: LLRBNode | LLRBEmptyNode; - color: boolean; - /** - * Returns a copy of the current node. - * - * @returns The node copy. - */ - copy(key: K | null, value: V | null, color: boolean | null, left: LLRBNode | LLRBEmptyNode | null, right: LLRBNode | LLRBEmptyNode | null): LLRBEmptyNode; - /** - * Returns a copy of the tree, with the specified key/value added. - * - * @param key - Key to be added. - * @param value - Value to be added. - * @param comparator - Comparator. - * @returns New tree, with item added. - */ - insert(key: K, value: V, comparator: Comparator): LLRBNode; - /** - * Returns a copy of the tree, with the specified key removed. - * - * @param key - The key to remove. - * @param comparator - Comparator. - * @returns New tree, with item removed. - */ - remove(key: K, comparator: Comparator): LLRBEmptyNode; - /** - * @returns The total number of nodes in the tree. - */ - count(): number; - /** - * @returns True if the tree is empty. - */ - isEmpty(): boolean; - /** - * Traverses the tree in key order and calls the specified action function - * for each node. - * - * @param action - Callback function to be called for each - * node. If it returns true, traversal is aborted. - * @returns True if traversal was aborted. - */ - inorderTraversal(action: (k: K, v: V) => unknown): boolean; - /** - * Traverses the tree in reverse key order and calls the specified action function - * for each node. - * - * @param action - Callback function to be called for each - * node. If it returns true, traversal is aborted. - * @returns True if traversal was aborted. - */ - reverseTraversal(action: (k: K, v: V) => void): boolean; - minKey(): null; - maxKey(): null; - check_(): number; - /** - * @returns Whether this node is red. - */ - isRed_(): boolean; -} -/** - * An immutable sorted map implementation, based on a Left-leaning Red-Black - * tree. - */ -export declare class SortedMap { - private comparator_; - private root_; - /** - * Always use the same empty node, to reduce memory. - */ - static EMPTY_NODE: LLRBEmptyNode; - /** - * @param comparator_ - Key comparator. - * @param root_ - Optional root node for the map. - */ - constructor(comparator_: Comparator, root_?: LLRBNode | LLRBEmptyNode); - /** - * Returns a copy of the map, with the specified key/value added or replaced. - * (TODO: We should perhaps rename this method to 'put') - * - * @param key - Key to be added. - * @param value - Value to be added. - * @returns New map, with item added. - */ - insert(key: K, value: V): SortedMap; - /** - * Returns a copy of the map, with the specified key removed. - * - * @param key - The key to remove. - * @returns New map, with item removed. - */ - remove(key: K): SortedMap; - /** - * Returns the value of the node with the given key, or null. - * - * @param key - The key to look up. - * @returns The value of the node with the given key, or null if the - * key doesn't exist. - */ - get(key: K): V | null; - /** - * Returns the key of the item *before* the specified key, or null if key is the first item. - * @param key - The key to find the predecessor of - * @returns The predecessor key. - */ - getPredecessorKey(key: K): K | null; - /** - * @returns True if the map is empty. - */ - isEmpty(): boolean; - /** - * @returns The total number of nodes in the map. - */ - count(): number; - /** - * @returns The minimum key in the map. - */ - minKey(): K | null; - /** - * @returns The maximum key in the map. - */ - maxKey(): K | null; - /** - * Traverses the map in key order and calls the specified action function - * for each key/value pair. - * - * @param action - Callback function to be called - * for each key/value pair. If action returns true, traversal is aborted. - * @returns The first truthy value returned by action, or the last falsey - * value returned by action - */ - inorderTraversal(action: (k: K, v: V) => unknown): boolean; - /** - * Traverses the map in reverse key order and calls the specified action function - * for each key/value pair. - * - * @param action - Callback function to be called - * for each key/value pair. If action returns true, traversal is aborted. - * @returns True if the traversal was aborted. - */ - reverseTraversal(action: (k: K, v: V) => void): boolean; - /** - * Returns an iterator over the SortedMap. - * @returns The iterator. - */ - getIterator(resultGenerator?: (k: K, v: V) => T): SortedMapIterator; - getIteratorFrom(key: K, resultGenerator?: (k: K, v: V) => T): SortedMapIterator; - getReverseIteratorFrom(key: K, resultGenerator?: (k: K, v: V) => T): SortedMapIterator; - getReverseIterator(resultGenerator?: (k: K, v: V) => T): SortedMapIterator; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/util/Tree.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/util/Tree.d.ts deleted file mode 100644 index 2b95690e..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/util/Tree.d.ts +++ /dev/null @@ -1,105 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { Path } from './Path'; -/** - * Node in a Tree. - */ -export interface TreeNode { - children: Record>; - childCount: number; - value?: T; -} -/** - * A light-weight tree, traversable by path. Nodes can have both values and children. - * Nodes are not enumerated (by forEachChild) unless they have a value or non-empty - * children. - */ -export declare class Tree { - readonly name: string; - readonly parent: Tree | null; - node: TreeNode; - /** - * @param name - Optional name of the node. - * @param parent - Optional parent node. - * @param node - Optional node to wrap. - */ - constructor(name?: string, parent?: Tree | null, node?: TreeNode); -} -/** - * Returns a sub-Tree for the given path. - * - * @param pathObj - Path to look up. - * @returns Tree for path. - */ -export declare function treeSubTree(tree: Tree, pathObj: string | Path): Tree; -/** - * Returns the data associated with this tree node. - * - * @returns The data or null if no data exists. - */ -export declare function treeGetValue(tree: Tree): T | undefined; -/** - * Sets data to this tree node. - * - * @param value - Value to set. - */ -export declare function treeSetValue(tree: Tree, value: T | undefined): void; -/** - * @returns Whether the tree has any children. - */ -export declare function treeHasChildren(tree: Tree): boolean; -/** - * @returns Whethe rthe tree is empty (no value or children). - */ -export declare function treeIsEmpty(tree: Tree): boolean; -/** - * Calls action for each child of this tree node. - * - * @param action - Action to be called for each child. - */ -export declare function treeForEachChild(tree: Tree, action: (tree: Tree) => void): void; -/** - * Does a depth-first traversal of this node's descendants, calling action for each one. - * - * @param action - Action to be called for each child. - * @param includeSelf - Whether to call action on this node as well. Defaults to - * false. - * @param childrenFirst - Whether to call action on children before calling it on - * parent. - */ -export declare function treeForEachDescendant(tree: Tree, action: (tree: Tree) => void, includeSelf?: boolean, childrenFirst?: boolean): void; -/** - * Calls action on each ancestor node. - * - * @param action - Action to be called on each parent; return - * true to abort. - * @param includeSelf - Whether to call action on this node as well. - * @returns true if the action callback returned true. - */ -export declare function treeForEachAncestor(tree: Tree, action: (tree: Tree) => unknown, includeSelf?: boolean): boolean; -/** - * Does a depth-first traversal of this node's descendants. When a descendant with a value - * is found, action is called on it and traversal does not continue inside the node. - * Action is *not* called on this node. - * - * @param action - Action to be called for each child. - */ -export declare function treeForEachImmediateDescendantWithValue(tree: Tree, action: (tree: Tree) => void): void; -/** - * @returns The path of this tree node, as a Path. - */ -export declare function treeGetPath(tree: Tree): any; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/util/VisibilityMonitor.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/util/VisibilityMonitor.d.ts deleted file mode 100644 index 0bbb8931..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/util/VisibilityMonitor.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { EventEmitter } from './EventEmitter'; -export declare class VisibilityMonitor extends EventEmitter { - private visible_; - static getInstance(): VisibilityMonitor; - constructor(); - getInitialEvent(eventType: string): boolean[]; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/util/libs/parser.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/util/libs/parser.d.ts deleted file mode 100644 index bd9fd85f..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/util/libs/parser.d.ts +++ /dev/null @@ -1,32 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { RepoInfo } from '../../RepoInfo'; -import { Path } from '../Path'; -export declare const parseRepoInfo: (dataURL: string, nodeAdmin: boolean) => { - repoInfo: RepoInfo; - path: Path; -}; -export declare const parseDatabaseURL: (dataURL: string) => { - host: string; - port: number; - domain: string; - subdomain: string; - secure: boolean; - scheme: string; - pathString: string; - namespace: string; -}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/util/misc.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/util/misc.d.ts deleted file mode 100644 index fa35b985..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/util/misc.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -/** - * @license - * Copyright 2019 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export interface Indexable { - [key: string]: unknown; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/util/util.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/util/util.d.ts deleted file mode 100644 index 37b5e7b3..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/util/util.d.ts +++ /dev/null @@ -1,176 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { QueryContext } from '../view/EventRegistration'; -/** - * Returns a locally-unique ID (generated by just incrementing up from 0 each time its called). - */ -export declare const LUIDGenerator: () => number; -/** - * Sha1 hash of the input string - * @param str - The string to hash - * @returns {!string} The resulting hash - */ -export declare const sha1: (str: string) => string; -/** - * Use this for all debug messages in Firebase. - */ -export declare let logger: ((a: string) => void) | null; -/** - * The implementation of Firebase.enableLogging (defined here to break dependencies) - * @param logger_ - A flag to turn on logging, or a custom logger - * @param persistent - Whether or not to persist logging settings across refreshes - */ -export declare const enableLogging: (logger_?: boolean | ((a: string) => void), persistent?: boolean) => void; -export declare const log: (...varArgs: unknown[]) => void; -export declare const logWrapper: (prefix: string) => (...varArgs: unknown[]) => void; -export declare const error: (...varArgs: string[]) => void; -export declare const fatal: (...varArgs: string[]) => never; -export declare const warn: (...varArgs: unknown[]) => void; -/** - * Logs a warning if the containing page uses https. Called when a call to new Firebase - * does not use https. - */ -export declare const warnIfPageIsSecure: () => void; -export declare const warnAboutUnsupportedMethod: (methodName: string) => void; -/** - * Returns true if data is NaN, or +/- Infinity. - */ -export declare const isInvalidJSONNumber: (data: unknown) => boolean; -export declare const executeWhenDOMReady: (fn: () => void) => void; -/** - * Minimum key name. Invalid for actual data, used as a marker to sort before any valid names - */ -export declare const MIN_NAME = "[MIN_NAME]"; -/** - * Maximum key name. Invalid for actual data, used as a marker to sort above any valid names - */ -export declare const MAX_NAME = "[MAX_NAME]"; -/** - * Compares valid Firebase key names, plus min and max name - */ -export declare const nameCompare: (a: string, b: string) => number; -/** - * @returns {!number} comparison result. - */ -export declare const stringCompare: (a: string, b: string) => number; -export declare const requireKey: (key: string, obj: { - [k: string]: unknown; -}) => unknown; -export declare const ObjectToUniqueKey: (obj: unknown) => string; -/** - * Splits a string into a number of smaller segments of maximum size - * @param str - The string - * @param segsize - The maximum number of chars in the string. - * @returns The string, split into appropriately-sized chunks - */ -export declare const splitStringBySize: (str: string, segsize: number) => string[]; -/** - * Apply a function to each (key, value) pair in an object or - * apply a function to each (index, value) pair in an array - * @param obj - The object or array to iterate over - * @param fn - The function to apply - */ -export declare function each(obj: object, fn: (k: string, v: unknown) => void): void; -/** - * Like goog.bind, but doesn't bother to create a closure if opt_context is null/undefined. - * @param callback - Callback function. - * @param context - Optional context to bind to. - * - */ -export declare const bindCallback: (callback: (a: unknown) => void, context?: object | null) => (a: unknown) => void; -/** - * Borrowed from http://hg.secondlife.com/llsd/src/tip/js/typedarray.js (MIT License) - * I made one modification at the end and removed the NaN / Infinity - * handling (since it seemed broken [caused an overflow] and we don't need it). See MJL comments. - * @param v - A double - * - */ -export declare const doubleToIEEE754String: (v: number) => string; -/** - * Used to detect if we're in a Chrome content script (which executes in an - * isolated environment where long-polling doesn't work). - */ -export declare const isChromeExtensionContentScript: () => boolean; -/** - * Used to detect if we're in a Windows 8 Store app. - */ -export declare const isWindowsStoreApp: () => boolean; -/** - * Converts a server error code to a Javascript Error - */ -export declare function errorForServerCode(code: string, query: QueryContext): Error; -/** - * Used to test for integer-looking strings - */ -export declare const INTEGER_REGEXP_: RegExp; -/** - * For use in keys, the minimum possible 32-bit integer. - */ -export declare const INTEGER_32_MIN = -2147483648; -/** - * For use in kyes, the maximum possible 32-bit integer. - */ -export declare const INTEGER_32_MAX = 2147483647; -/** - * If the string contains a 32-bit integer, return it. Else return null. - */ -export declare const tryParseInt: (str: string) => number | null; -/** - * Helper to run some code but catch any exceptions and re-throw them later. - * Useful for preventing user callbacks from breaking internal code. - * - * Re-throwing the exception from a setTimeout is a little evil, but it's very - * convenient (we don't have to try to figure out when is a safe point to - * re-throw it), and the behavior seems reasonable: - * - * * If you aren't pausing on exceptions, you get an error in the console with - * the correct stack trace. - * * If you're pausing on all exceptions, the debugger will pause on your - * exception and then again when we rethrow it. - * * If you're only pausing on uncaught exceptions, the debugger will only pause - * on us re-throwing it. - * - * @param fn - The code to guard. - */ -export declare const exceptionGuard: (fn: () => void) => void; -/** - * Helper function to safely call opt_callback with the specified arguments. It: - * 1. Turns into a no-op if opt_callback is null or undefined. - * 2. Wraps the call inside exceptionGuard to prevent exceptions from breaking our state. - * - * @param callback - Optional onComplete callback. - * @param varArgs - Arbitrary args to be passed to opt_onComplete - */ -export declare const callUserCallback: (callback?: Function | null, ...varArgs: unknown[]) => void; -/** - * @returns {boolean} true if we think we're currently being crawled. - */ -export declare const beingCrawled: () => boolean; -/** - * Export a property of an object using a getter function. - */ -export declare const exportPropGetter: (object: object, name: string, fnGet: () => unknown) => void; -/** - * Same as setTimeout() except on Node.JS it will /not/ prevent the process from exiting. - * - * It is removed with clearTimeout() as normal. - * - * @param fn - Function to run. - * @param time - Milliseconds to wait before running. - * @returns The setTimeout() return value. - */ -export declare const setTimeoutNonBlocking: (fn: () => void, time: number) => number | object; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/util/validation.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/util/validation.d.ts deleted file mode 100644 index 05fd0874..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/util/validation.d.ts +++ /dev/null @@ -1,70 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { RepoInfo } from '../RepoInfo'; -import { Path, ValidationPath } from './Path'; -/** - * True for invalid Firebase keys - */ -export declare const INVALID_KEY_REGEX_: RegExp; -/** - * True for invalid Firebase paths. - * Allows '/' in paths. - */ -export declare const INVALID_PATH_REGEX_: RegExp; -/** - * Maximum number of characters to allow in leaf value - */ -export declare const MAX_LEAF_SIZE_: number; -export declare const isValidKey: (key: unknown) => boolean; -export declare const isValidPathString: (pathString: string) => boolean; -export declare const isValidRootPathString: (pathString: string) => boolean; -export declare const isValidPriority: (priority: unknown) => boolean; -/** - * Pre-validate a datum passed as an argument to Firebase function. - */ -export declare const validateFirebaseDataArg: (fnName: string, value: unknown, path: Path, optional: boolean) => void; -/** - * Validate a data object client-side before sending to server. - */ -export declare const validateFirebaseData: (errorPrefix: string, data: unknown, path_: Path | ValidationPath) => void; -/** - * Pre-validate paths passed in the firebase function. - */ -export declare const validateFirebaseMergePaths: (errorPrefix: string, mergePaths: Path[]) => void; -/** - * pre-validate an object passed as an argument to firebase function ( - * must be an object - e.g. for firebase.update()). - */ -export declare const validateFirebaseMergeDataArg: (fnName: string, data: unknown, path: Path, optional: boolean) => void; -export declare const validatePriority: (fnName: string, priority: unknown, optional: boolean) => void; -export declare const validateKey: (fnName: string, argumentName: string, key: string, optional: boolean) => void; -/** - * @internal - */ -export declare const validatePathString: (fnName: string, argumentName: string, pathString: string, optional: boolean) => void; -export declare const validateRootPathString: (fnName: string, argumentName: string, pathString: string, optional: boolean) => void; -/** - * @internal - */ -export declare const validateWritablePath: (fnName: string, path: Path) => void; -export declare const validateUrl: (fnName: string, parsedUrl: { - repoInfo: RepoInfo; - path: Path; -}) => void; -export declare const validateString: (fnName: string, argumentName: string, string: unknown, optional: boolean) => void; -export declare const validateObject: (fnName: string, argumentName: string, obj: unknown, optional: boolean) => void; -export declare const validateObjectContainsKey: (fnName: string, argumentName: string, obj: unknown, key: string, optional: boolean, optType?: string) => void; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/version.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/version.d.ts deleted file mode 100644 index 1c7743fa..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/version.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -/** - * @license - * Copyright 2019 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** The semver (www.semver.org) version of the SDK. */ -export declare let SDK_VERSION: string; -/** - * SDK_VERSION should be set before any database instance is created - * @internal - */ -export declare function setSDKVersion(version: string): void; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/view/CacheNode.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/view/CacheNode.d.ts deleted file mode 100644 index 5ba8cfd7..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/view/CacheNode.d.ts +++ /dev/null @@ -1,41 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { Node } from '../snap/Node'; -import { Path } from '../util/Path'; -/** - * A cache node only stores complete children. Additionally it holds a flag whether the node can be considered fully - * initialized in the sense that we know at one point in time this represented a valid state of the world, e.g. - * initialized with data from the server, or a complete overwrite by the client. The filtered flag also tracks - * whether a node potentially had children removed due to a filter. - */ -export declare class CacheNode { - private node_; - private fullyInitialized_; - private filtered_; - constructor(node_: Node, fullyInitialized_: boolean, filtered_: boolean); - /** - * Returns whether this node was fully initialized with either server data or a complete overwrite by the client - */ - isFullyInitialized(): boolean; - /** - * Returns whether this node is potentially missing children due to a filter applied to the node - */ - isFiltered(): boolean; - isCompleteForPath(path: Path): boolean; - isCompleteForChild(key: string): boolean; - getNode(): Node; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/view/Change.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/view/Change.d.ts deleted file mode 100644 index a53ca680..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/view/Change.d.ts +++ /dev/null @@ -1,46 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { Node } from '../snap/Node'; -export declare const enum ChangeType { - /** Event type for a child added */ - CHILD_ADDED = "child_added", - /** Event type for a child removed */ - CHILD_REMOVED = "child_removed", - /** Event type for a child changed */ - CHILD_CHANGED = "child_changed", - /** Event type for a child moved */ - CHILD_MOVED = "child_moved", - /** Event type for a value change */ - VALUE = "value" -} -export interface Change { - /** @param type - The event type */ - type: ChangeType; - /** @param snapshotNode - The data */ - snapshotNode: Node; - /** @param childName - The name for this child, if it's a child even */ - childName?: string; - /** @param oldSnap - Used for intermediate processing of child changed events */ - oldSnap?: Node; - /** * @param prevName - The name for the previous child, if applicable */ - prevName?: string | null; -} -export declare function changeValue(snapshotNode: Node): Change; -export declare function changeChildAdded(childName: string, snapshotNode: Node): Change; -export declare function changeChildRemoved(childName: string, snapshotNode: Node): Change; -export declare function changeChildChanged(childName: string, snapshotNode: Node, oldSnap: Node): Change; -export declare function changeChildMoved(childName: string, snapshotNode: Node): Change; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/view/ChildChangeAccumulator.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/view/ChildChangeAccumulator.d.ts deleted file mode 100644 index ef031e2a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/view/ChildChangeAccumulator.d.ts +++ /dev/null @@ -1,22 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { Change } from './Change'; -export declare class ChildChangeAccumulator { - private readonly changeMap; - trackChildChange(change: Change): void; - getChanges(): Change[]; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/view/CompleteChildSource.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/view/CompleteChildSource.d.ts deleted file mode 100644 index fd6a3010..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/view/CompleteChildSource.d.ts +++ /dev/null @@ -1,55 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { Index } from '../snap/indexes/Index'; -import { NamedNode, Node } from '../snap/Node'; -import { WriteTreeRef } from '../WriteTree'; -import { ViewCache } from './ViewCache'; -/** - * Since updates to filtered nodes might require nodes to be pulled in from "outside" the node, this interface - * can help to get complete children that can be pulled in. - * A class implementing this interface takes potentially multiple sources (e.g. user writes, server data from - * other views etc.) to try it's best to get a complete child that might be useful in pulling into the view. - * - * @interface - */ -export interface CompleteChildSource { - getCompleteChild(childKey: string): Node | null; - getChildAfterChild(index: Index, child: NamedNode, reverse: boolean): NamedNode | null; -} -/** - * An implementation of CompleteChildSource that never returns any additional children - */ -export declare class NoCompleteChildSource_ implements CompleteChildSource { - getCompleteChild(childKey?: string): Node | null; - getChildAfterChild(index?: Index, child?: NamedNode, reverse?: boolean): NamedNode | null; -} -/** - * Singleton instance. - */ -export declare const NO_COMPLETE_CHILD_SOURCE: NoCompleteChildSource_; -/** - * An implementation of CompleteChildSource that uses a WriteTree in addition to any other server data or - * old event caches available to calculate complete children. - */ -export declare class WriteTreeCompleteChildSource implements CompleteChildSource { - private writes_; - private viewCache_; - private optCompleteServerCache_; - constructor(writes_: WriteTreeRef, viewCache_: ViewCache, optCompleteServerCache_?: Node | null); - getCompleteChild(childKey: string): Node | null; - getChildAfterChild(index: Index, child: NamedNode, reverse: boolean): NamedNode | null; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/view/Event.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/view/Event.d.ts deleted file mode 100644 index 03a8912c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/view/Event.d.ts +++ /dev/null @@ -1,64 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { DataSnapshot as ExpDataSnapshot } from '../../api/Reference_impl'; -import { Path } from '../util/Path'; -import { EventRegistration } from './EventRegistration'; -/** - * Encapsulates the data needed to raise an event - * @interface - */ -export interface Event { - getPath(): Path; - getEventType(): string; - getEventRunner(): () => void; - toString(): string; -} -/** - * One of the following strings: "value", "child_added", "child_changed", - * "child_removed", or "child_moved." - */ -export declare type EventType = 'value' | 'child_added' | 'child_changed' | 'child_moved' | 'child_removed'; -/** - * Encapsulates the data needed to raise an event - */ -export declare class DataEvent implements Event { - eventType: EventType; - eventRegistration: EventRegistration; - snapshot: ExpDataSnapshot; - prevName?: string | null; - /** - * @param eventType - One of: value, child_added, child_changed, child_moved, child_removed - * @param eventRegistration - The function to call to with the event data. User provided - * @param snapshot - The data backing the event - * @param prevName - Optional, the name of the previous child for child_* events. - */ - constructor(eventType: EventType, eventRegistration: EventRegistration, snapshot: ExpDataSnapshot, prevName?: string | null); - getPath(): Path; - getEventType(): string; - getEventRunner(): () => void; - toString(): string; -} -export declare class CancelEvent implements Event { - eventRegistration: EventRegistration; - error: Error; - path: Path; - constructor(eventRegistration: EventRegistration, error: Error, path: Path); - getPath(): Path; - getEventType(): string; - getEventRunner(): () => void; - toString(): string; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/view/EventGenerator.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/view/EventGenerator.d.ts deleted file mode 100644 index fb665e41..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/view/EventGenerator.d.ts +++ /dev/null @@ -1,42 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { Index } from '../snap/indexes/Index'; -import { Node } from '../snap/Node'; -import { Change } from './Change'; -import { Event } from './Event'; -import { EventRegistration, QueryContext } from './EventRegistration'; -/** - * An EventGenerator is used to convert "raw" changes (Change) as computed by the - * CacheDiffer into actual events (Event) that can be raised. See generateEventsForChanges() - * for details. - * - */ -export declare class EventGenerator { - query_: QueryContext; - index_: Index; - constructor(query_: QueryContext); -} -/** - * Given a set of raw changes (no moved events and prevName not specified yet), and a set of - * EventRegistrations that should be notified of these changes, generate the actual events to be raised. - * - * Notes: - * - child_moved events will be synthesized at this time for any child_changed events that affect - * our index. - * - prevName will be calculated based on the index ordering. - */ -export declare function eventGeneratorGenerateEventsForChanges(eventGenerator: EventGenerator, changes: Change[], eventCache: Node, eventRegistrations: EventRegistration[]): Event[]; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/view/EventQueue.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/view/EventQueue.d.ts deleted file mode 100644 index 2403ca0c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/view/EventQueue.d.ts +++ /dev/null @@ -1,67 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { Path } from '../util/Path'; -import { Event } from './Event'; -/** - * The event queue serves a few purposes: - * 1. It ensures we maintain event order in the face of event callbacks doing operations that result in more - * events being queued. - * 2. raiseQueuedEvents() handles being called reentrantly nicely. That is, if in the course of raising events, - * raiseQueuedEvents() is called again, the "inner" call will pick up raising events where the "outer" call - * left off, ensuring that the events are still raised synchronously and in order. - * 3. You can use raiseEventsAtPath and raiseEventsForChangedPath to ensure only relevant previously-queued - * events are raised synchronously. - * - * NOTE: This can all go away if/when we move to async events. - * - */ -export declare class EventQueue { - eventLists_: EventList[]; - /** - * Tracks recursion depth of raiseQueuedEvents_, for debugging purposes. - */ - recursionDepth_: number; -} -/** - * @param eventDataList - The new events to queue. - */ -export declare function eventQueueQueueEvents(eventQueue: EventQueue, eventDataList: Event[]): void; -/** - * Queues the specified events and synchronously raises all events (including previously queued ones) - * for the specified path. - * - * It is assumed that the new events are all for the specified path. - * - * @param path - The path to raise events for. - * @param eventDataList - The new events to raise. - */ -export declare function eventQueueRaiseEventsAtPath(eventQueue: EventQueue, path: Path, eventDataList: Event[]): void; -/** - * Queues the specified events and synchronously raises all events (including previously queued ones) for - * locations related to the specified change path (i.e. all ancestors and descendants). - * - * It is assumed that the new events are all related (ancestor or descendant) to the specified path. - * - * @param changedPath - The path to raise events for. - * @param eventDataList - The events to raise - */ -export declare function eventQueueRaiseEventsForChangedPath(eventQueue: EventQueue, changedPath: Path, eventDataList: Event[]): void; -interface EventList { - events: Event[]; - path: Path; -} -export {}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/view/EventRegistration.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/view/EventRegistration.d.ts deleted file mode 100644 index 771d8efe..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/view/EventRegistration.d.ts +++ /dev/null @@ -1,87 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { DataSnapshot } from '../../api/Reference_impl'; -import { Repo } from '../Repo'; -import { Path } from '../util/Path'; -import { Change } from './Change'; -import { CancelEvent, Event } from './Event'; -import { QueryParams } from './QueryParams'; -/** - * A user callback. Callbacks issues from the Legacy SDK maintain references - * to the original user-issued callbacks, which allows equality - * comparison by reference even though this callbacks are wrapped before - * they can be passed to the firebase@exp SDK. - * - * @internal - */ -export interface UserCallback { - (dataSnapshot: DataSnapshot, previousChildName?: string | null): unknown; - userCallback?: unknown; - context?: object | null; -} -/** - * A wrapper class that converts events from the database@exp SDK to the legacy - * Database SDK. Events are not converted directly as event registration relies - * on reference comparison of the original user callback (see `matches()`) and - * relies on equality of the legacy SDK's `context` object. - */ -export declare class CallbackContext { - private readonly snapshotCallback; - private readonly cancelCallback?; - constructor(snapshotCallback: UserCallback, cancelCallback?: (error: Error) => unknown); - onValue(expDataSnapshot: DataSnapshot, previousChildName?: string | null): void; - onCancel(error: Error): void; - get hasCancelCallback(): boolean; - matches(other: CallbackContext): boolean; -} -export interface QueryContext { - readonly _queryIdentifier: string; - readonly _queryObject: object; - readonly _repo: Repo; - readonly _path: Path; - readonly _queryParams: QueryParams; -} -/** - * An EventRegistration is basically an event type ('value', 'child_added', etc.) and a callback - * to be notified of that type of event. - * - * That said, it can also contain a cancel callback to be notified if the event is canceled. And - * currently, this code is organized around the idea that you would register multiple child_ callbacks - * together, as a single EventRegistration. Though currently we don't do that. - */ -export interface EventRegistration { - /** - * True if this container has a callback to trigger for this event type - */ - respondsTo(eventType: string): boolean; - createEvent(change: Change, query: QueryContext): Event; - /** - * Given event data, return a function to trigger the user's callback - */ - getEventRunner(eventData: Event): () => void; - createCancelEvent(error: Error, path: Path): CancelEvent | null; - matches(other: EventRegistration): boolean; - /** - * False basically means this is a "dummy" callback container being used as a sentinel - * to remove all callback containers of a particular type. (e.g. if the user does - * ref.off('value') without specifying a specific callback). - * - * (TODO: Rework this, since it's hacky) - * - */ - hasAnyCallback(): boolean; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/view/QueryParams.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/view/QueryParams.d.ts deleted file mode 100644 index 36e06874..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/view/QueryParams.d.ts +++ /dev/null @@ -1,97 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { Index } from '../snap/indexes/Index'; -import { PriorityIndex } from '../snap/indexes/PriorityIndex'; -import { NodeFilter } from './filter/NodeFilter'; -/** - * This class is an immutable-from-the-public-api struct containing a set of query parameters defining a - * range to be returned for a particular location. It is assumed that validation of parameters is done at the - * user-facing API level, so it is not done here. - * - * @internal - */ -export declare class QueryParams { - limitSet_: boolean; - startSet_: boolean; - startNameSet_: boolean; - startAfterSet_: boolean; - endSet_: boolean; - endNameSet_: boolean; - endBeforeSet_: boolean; - limit_: number; - viewFrom_: string; - indexStartValue_: unknown | null; - indexStartName_: string; - indexEndValue_: unknown | null; - indexEndName_: string; - index_: PriorityIndex; - hasStart(): boolean; - hasStartAfter(): boolean; - hasEndBefore(): boolean; - /** - * @returns True if it would return from left. - */ - isViewFromLeft(): boolean; - /** - * Only valid to call if hasStart() returns true - */ - getIndexStartValue(): unknown; - /** - * Only valid to call if hasStart() returns true. - * Returns the starting key name for the range defined by these query parameters - */ - getIndexStartName(): string; - hasEnd(): boolean; - /** - * Only valid to call if hasEnd() returns true. - */ - getIndexEndValue(): unknown; - /** - * Only valid to call if hasEnd() returns true. - * Returns the end key name for the range defined by these query parameters - */ - getIndexEndName(): string; - hasLimit(): boolean; - /** - * @returns True if a limit has been set and it has been explicitly anchored - */ - hasAnchoredLimit(): boolean; - /** - * Only valid to call if hasLimit() returns true - */ - getLimit(): number; - getIndex(): Index; - loadsAllData(): boolean; - isDefault(): boolean; - copy(): QueryParams; -} -export declare function queryParamsGetNodeFilter(queryParams: QueryParams): NodeFilter; -export declare function queryParamsLimit(queryParams: QueryParams, newLimit: number): QueryParams; -export declare function queryParamsLimitToFirst(queryParams: QueryParams, newLimit: number): QueryParams; -export declare function queryParamsLimitToLast(queryParams: QueryParams, newLimit: number): QueryParams; -export declare function queryParamsStartAt(queryParams: QueryParams, indexValue: unknown, key?: string | null): QueryParams; -export declare function queryParamsStartAfter(queryParams: QueryParams, indexValue: unknown, key?: string | null): QueryParams; -export declare function queryParamsEndAt(queryParams: QueryParams, indexValue: unknown, key?: string | null): QueryParams; -export declare function queryParamsEndBefore(queryParams: QueryParams, indexValue: unknown, key?: string | null): QueryParams; -export declare function queryParamsOrderBy(queryParams: QueryParams, index: Index): QueryParams; -/** - * Returns a set of REST query string parameters representing this query. - * - * @returns query string parameters - */ -export declare function queryParamsToRestQueryStringParameters(queryParams: QueryParams): Record; -export declare function queryParamsGetQueryObject(queryParams: QueryParams): Record; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/view/View.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/view/View.d.ts deleted file mode 100644 index 18168be6..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/view/View.d.ts +++ /dev/null @@ -1,59 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { Operation } from '../operation/Operation'; -import { Node } from '../snap/Node'; -import { Path } from '../util/Path'; -import { WriteTreeRef } from '../WriteTree'; -import { Event } from './Event'; -import { EventGenerator } from './EventGenerator'; -import { EventRegistration, QueryContext } from './EventRegistration'; -import { ViewCache } from './ViewCache'; -import { ViewProcessor } from './ViewProcessor'; -/** - * A view represents a specific location and query that has 1 or more event registrations. - * - * It does several things: - * - Maintains the list of event registrations for this location/query. - * - Maintains a cache of the data visible for this location/query. - * - Applies new operations (via applyOperation), updates the cache, and based on the event - * registrations returns the set of events to be raised. - */ -export declare class View { - private query_; - processor_: ViewProcessor; - viewCache_: ViewCache; - eventRegistrations_: EventRegistration[]; - eventGenerator_: EventGenerator; - constructor(query_: QueryContext, initialViewCache: ViewCache); - get query(): QueryContext; -} -export declare function viewGetServerCache(view: View): Node | null; -export declare function viewGetCompleteNode(view: View): Node | null; -export declare function viewGetCompleteServerCache(view: View, path: Path): Node | null; -export declare function viewIsEmpty(view: View): boolean; -export declare function viewAddEventRegistration(view: View, eventRegistration: EventRegistration): void; -/** - * @param eventRegistration - If null, remove all callbacks. - * @param cancelError - If a cancelError is provided, appropriate cancel events will be returned. - * @returns Cancel events, if cancelError was provided. - */ -export declare function viewRemoveEventRegistration(view: View, eventRegistration: EventRegistration | null, cancelError?: Error): Event[]; -/** - * Applies the given Operation, updates our cache, and returns the appropriate events. - */ -export declare function viewApplyOperation(view: View, operation: Operation, writesCache: WriteTreeRef, completeServerCache: Node | null): Event[]; -export declare function viewGetInitialEvents(view: View, registration: EventRegistration): Event[]; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/view/ViewCache.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/view/ViewCache.d.ts deleted file mode 100644 index 99ab270a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/view/ViewCache.d.ts +++ /dev/null @@ -1,32 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { Node } from '../snap/Node'; -import { CacheNode } from './CacheNode'; -/** - * Stores the data we have cached for a view. - * - * serverSnap is the cached server data, eventSnap is the cached event data (server data plus any local writes). - */ -export interface ViewCache { - readonly eventCache: CacheNode; - readonly serverCache: CacheNode; -} -export declare function newViewCache(eventCache: CacheNode, serverCache: CacheNode): ViewCache; -export declare function viewCacheUpdateEventSnap(viewCache: ViewCache, eventSnap: Node, complete: boolean, filtered: boolean): ViewCache; -export declare function viewCacheUpdateServerSnap(viewCache: ViewCache, serverSnap: Node, complete: boolean, filtered: boolean): ViewCache; -export declare function viewCacheGetCompleteEventSnap(viewCache: ViewCache): Node | null; -export declare function viewCacheGetCompleteServerSnap(viewCache: ViewCache): Node | null; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/view/ViewProcessor.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/view/ViewProcessor.d.ts deleted file mode 100644 index 5387b4f2..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/view/ViewProcessor.d.ts +++ /dev/null @@ -1,32 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { Operation } from '../operation/Operation'; -import { Node } from '../snap/Node'; -import { WriteTreeRef } from '../WriteTree'; -import { Change } from './Change'; -import { NodeFilter } from './filter/NodeFilter'; -import { ViewCache } from './ViewCache'; -export interface ProcessorResult { - readonly viewCache: ViewCache; - readonly changes: Change[]; -} -export interface ViewProcessor { - readonly filter: NodeFilter; -} -export declare function newViewProcessor(filter: NodeFilter): ViewProcessor; -export declare function viewProcessorAssertIndexed(viewProcessor: ViewProcessor, viewCache: ViewCache): void; -export declare function viewProcessorApplyOperation(viewProcessor: ViewProcessor, oldViewCache: ViewCache, operation: Operation, writesCache: WriteTreeRef, completeCache: Node | null): ProcessorResult; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/view/filter/IndexedFilter.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/view/filter/IndexedFilter.d.ts deleted file mode 100644 index 6c1b498b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/view/filter/IndexedFilter.d.ts +++ /dev/null @@ -1,35 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { Index } from '../../snap/indexes/Index'; -import { Node } from '../../snap/Node'; -import { Path } from '../../util/Path'; -import { ChildChangeAccumulator } from '../ChildChangeAccumulator'; -import { CompleteChildSource } from '../CompleteChildSource'; -import { NodeFilter } from './NodeFilter'; -/** - * Doesn't really filter nodes but applies an index to the node and keeps track of any changes - */ -export declare class IndexedFilter implements NodeFilter { - private readonly index_; - constructor(index_: Index); - updateChild(snap: Node, key: string, newChild: Node, affectedPath: Path, source: CompleteChildSource, optChangeAccumulator: ChildChangeAccumulator | null): Node; - updateFullNode(oldSnap: Node, newSnap: Node, optChangeAccumulator: ChildChangeAccumulator | null): Node; - updatePriority(oldSnap: Node, newPriority: Node): Node; - filtersNodes(): boolean; - getIndexedFilter(): IndexedFilter; - getIndex(): Index; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/view/filter/LimitedFilter.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/view/filter/LimitedFilter.d.ts deleted file mode 100644 index 8074c2b8..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/view/filter/LimitedFilter.d.ts +++ /dev/null @@ -1,41 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { Index } from '../../snap/indexes/Index'; -import { Node } from '../../snap/Node'; -import { Path } from '../../util/Path'; -import { ChildChangeAccumulator } from '../ChildChangeAccumulator'; -import { CompleteChildSource } from '../CompleteChildSource'; -import { QueryParams } from '../QueryParams'; -import { IndexedFilter } from './IndexedFilter'; -import { NodeFilter } from './NodeFilter'; -/** - * Applies a limit and a range to a node and uses RangedFilter to do the heavy lifting where possible - */ -export declare class LimitedFilter implements NodeFilter { - private readonly rangedFilter_; - private readonly index_; - private readonly limit_; - private readonly reverse_; - constructor(params: QueryParams); - updateChild(snap: Node, key: string, newChild: Node, affectedPath: Path, source: CompleteChildSource, optChangeAccumulator: ChildChangeAccumulator | null): Node; - updateFullNode(oldSnap: Node, newSnap: Node, optChangeAccumulator: ChildChangeAccumulator | null): Node; - updatePriority(oldSnap: Node, newPriority: Node): Node; - filtersNodes(): boolean; - getIndexedFilter(): IndexedFilter; - getIndex(): Index; - private fullLimitUpdateChild_; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/view/filter/NodeFilter.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/view/filter/NodeFilter.d.ts deleted file mode 100644 index c9206bd1..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/view/filter/NodeFilter.d.ts +++ /dev/null @@ -1,54 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { Index } from '../../snap/indexes/Index'; -import { Node } from '../../snap/Node'; -import { Path } from '../../util/Path'; -import { ChildChangeAccumulator } from '../ChildChangeAccumulator'; -import { CompleteChildSource } from '../CompleteChildSource'; -/** - * NodeFilter is used to update nodes and complete children of nodes while applying queries on the fly and keeping - * track of any child changes. This class does not track value changes as value changes depend on more - * than just the node itself. Different kind of queries require different kind of implementations of this interface. - * @interface - */ -export interface NodeFilter { - /** - * Update a single complete child in the snap. If the child equals the old child in the snap, this is a no-op. - * The method expects an indexed snap. - */ - updateChild(snap: Node, key: string, newChild: Node, affectedPath: Path, source: CompleteChildSource, optChangeAccumulator: ChildChangeAccumulator | null): Node; - /** - * Update a node in full and output any resulting change from this complete update. - */ - updateFullNode(oldSnap: Node, newSnap: Node, optChangeAccumulator: ChildChangeAccumulator | null): Node; - /** - * Update the priority of the root node - */ - updatePriority(oldSnap: Node, newPriority: Node): Node; - /** - * Returns true if children might be filtered due to query criteria - */ - filtersNodes(): boolean; - /** - * Returns the index filter that this filter uses to get a NodeFilter that doesn't filter any children. - */ - getIndexedFilter(): NodeFilter; - /** - * Returns the index that this filter uses - */ - getIndex(): Index; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/view/filter/RangedFilter.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/view/filter/RangedFilter.d.ts deleted file mode 100644 index 871383f8..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/core/view/filter/RangedFilter.d.ts +++ /dev/null @@ -1,45 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { NamedNode, Node } from '../../../core/snap/Node'; -import { Index } from '../../snap/indexes/Index'; -import { Path } from '../../util/Path'; -import { ChildChangeAccumulator } from '../ChildChangeAccumulator'; -import { CompleteChildSource } from '../CompleteChildSource'; -import { QueryParams } from '../QueryParams'; -import { IndexedFilter } from './IndexedFilter'; -import { NodeFilter } from './NodeFilter'; -/** - * Filters nodes by range and uses an IndexFilter to track any changes after filtering the node - */ -export declare class RangedFilter implements NodeFilter { - private indexedFilter_; - private index_; - private startPost_; - private endPost_; - constructor(params: QueryParams); - getStartPost(): NamedNode; - getEndPost(): NamedNode; - matches(node: NamedNode): boolean; - updateChild(snap: Node, key: string, newChild: Node, affectedPath: Path, source: CompleteChildSource, optChangeAccumulator: ChildChangeAccumulator | null): Node; - updateFullNode(oldSnap: Node, newSnap: Node, optChangeAccumulator: ChildChangeAccumulator | null): Node; - updatePriority(oldSnap: Node, newPriority: Node): Node; - filtersNodes(): boolean; - getIndexedFilter(): IndexedFilter; - getIndex(): Index; - private static getStartPost_; - private static getEndPost_; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/index.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/index.d.ts deleted file mode 100644 index 45017d76..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/index.d.ts +++ /dev/null @@ -1,28 +0,0 @@ -/** - * Firebase Realtime Database - * - * @packageDocumentation - */ -/** - * @license - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { Database } from './api/Database'; -export * from './api'; -declare module '@firebase/component' { - interface NameServiceMapping { - 'database': Database; - } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/index.node.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/index.node.d.ts deleted file mode 100644 index 13debbdc..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/index.node.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * @license - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export * from './api'; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/index.standalone.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/index.standalone.d.ts deleted file mode 100644 index b272041c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/index.standalone.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * @license - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export * from './api.standalone'; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/realtime/BrowserPollConnection.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/realtime/BrowserPollConnection.d.ts deleted file mode 100644 index 85fe5c4b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/realtime/BrowserPollConnection.d.ts +++ /dev/null @@ -1,198 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { RepoInfo } from '../core/RepoInfo'; -import { PacketReceiver } from './polling/PacketReceiver'; -import { Transport } from './Transport'; -export declare const FIREBASE_LONGPOLL_START_PARAM = "start"; -export declare const FIREBASE_LONGPOLL_CLOSE_COMMAND = "close"; -export declare const FIREBASE_LONGPOLL_COMMAND_CB_NAME = "pLPCommand"; -export declare const FIREBASE_LONGPOLL_DATA_CB_NAME = "pRTLPCB"; -export declare const FIREBASE_LONGPOLL_ID_PARAM = "id"; -export declare const FIREBASE_LONGPOLL_PW_PARAM = "pw"; -export declare const FIREBASE_LONGPOLL_SERIAL_PARAM = "ser"; -export declare const FIREBASE_LONGPOLL_CALLBACK_ID_PARAM = "cb"; -export declare const FIREBASE_LONGPOLL_SEGMENT_NUM_PARAM = "seg"; -export declare const FIREBASE_LONGPOLL_SEGMENTS_IN_PACKET = "ts"; -export declare const FIREBASE_LONGPOLL_DATA_PARAM = "d"; -export declare const FIREBASE_LONGPOLL_DISCONN_FRAME_PARAM = "disconn"; -export declare const FIREBASE_LONGPOLL_DISCONN_FRAME_REQUEST_PARAM = "dframe"; -/** - * This class manages a single long-polling connection. - */ -export declare class BrowserPollConnection implements Transport { - connId: string; - repoInfo: RepoInfo; - private applicationId?; - private appCheckToken?; - private authToken?; - transportSessionId?: string; - lastSessionId?: string; - bytesSent: number; - bytesReceived: number; - urlFn: (params: object) => string; - scriptTagHolder: FirebaseIFrameScriptHolder; - myDisconnFrame: HTMLIFrameElement; - curSegmentNum: number; - myPacketOrderer: PacketReceiver; - id: string; - password: string; - private log_; - private stats_; - private everConnected_; - private isClosed_; - private connectTimeoutTimer_; - private onDisconnect_; - /** - * @param connId An identifier for this connection, used for logging - * @param repoInfo The info for the endpoint to send data to. - * @param applicationId The Firebase App ID for this project. - * @param appCheckToken The AppCheck token for this client. - * @param authToken The AuthToken to use for this connection. - * @param transportSessionId Optional transportSessionid if we are - * reconnecting for an existing transport session - * @param lastSessionId Optional lastSessionId if the PersistentConnection has - * already created a connection previously - */ - constructor(connId: string, repoInfo: RepoInfo, applicationId?: string, appCheckToken?: string, authToken?: string, transportSessionId?: string, lastSessionId?: string); - /** - * @param onMessage - Callback when messages arrive - * @param onDisconnect - Callback with connection lost. - */ - open(onMessage: (msg: {}) => void, onDisconnect: (a?: boolean) => void): void; - /** - * Call this when a handshake has completed successfully and we want to consider the connection established - */ - start(): void; - static forceAllow_: boolean; - /** - * Forces long polling to be considered as a potential transport - */ - static forceAllow(): void; - static forceDisallow_: boolean; - /** - * Forces longpolling to not be considered as a potential transport - */ - static forceDisallow(): void; - static isAvailable(): boolean; - /** - * No-op for polling - */ - markConnectionHealthy(): void; - /** - * Stops polling and cleans up the iframe - */ - private shutdown_; - /** - * Triggered when this transport is closed - */ - private onClosed_; - /** - * External-facing close handler. RealTime has requested we shut down. Kill our connection and tell the server - * that we've left. - */ - close(): void; - /** - * Send the JSON object down to the server. It will need to be stringified, base64 encoded, and then - * broken into chunks (since URLs have a small maximum length). - * @param data - The JSON data to transmit. - */ - send(data: {}): void; - /** - * This is how we notify the server that we're leaving. - * We aren't able to send requests with DHTML on a window close event, but we can - * trigger XHR requests in some browsers (everything but Opera basically). - */ - addDisconnectPingFrame(id: string, pw: string): void; - /** - * Used to track the bytes received by this client - */ - private incrementIncomingBytes_; -} -export interface IFrameElement extends HTMLIFrameElement { - doc: Document; -} -/********************************************************************************************* - * A wrapper around an iframe that is used as a long-polling script holder. - *********************************************************************************************/ -export declare class FirebaseIFrameScriptHolder { - onDisconnect: () => void; - urlFn: (a: object) => string; - outstandingRequests: Set; - pendingSegs: Array<{ - seg: number; - ts: number; - d: unknown; - }>; - currentSerial: number; - sendNewPolls: boolean; - uniqueCallbackIdentifier: number; - myIFrame: IFrameElement; - alive: boolean; - myID: string; - myPW: string; - commandCB: (command: string, ...args: unknown[]) => void; - onMessageCB: (...args: unknown[]) => void; - /** - * @param commandCB - The callback to be called when control commands are recevied from the server. - * @param onMessageCB - The callback to be triggered when responses arrive from the server. - * @param onDisconnect - The callback to be triggered when this tag holder is closed - * @param urlFn - A function that provides the URL of the endpoint to send data to. - */ - constructor(commandCB: (command: string, ...args: unknown[]) => void, onMessageCB: (...args: unknown[]) => void, onDisconnect: () => void, urlFn: (a: object) => string); - /** - * Each browser has its own funny way to handle iframes. Here we mush them all together into one object that I can - * actually use. - */ - private static createIFrame_; - /** - * Cancel all outstanding queries and remove the frame. - */ - close(): void; - /** - * Actually start the long-polling session by adding the first script tag(s) to the iframe. - * @param id - The ID of this connection - * @param pw - The password for this connection - */ - startLongPoll(id: string, pw: string): void; - /** - * This is called any time someone might want a script tag to be added. It adds a script tag when there aren't - * too many outstanding requests and we are still alive. - * - * If there are outstanding packet segments to send, it sends one. If there aren't, it sends a long-poll anyways if - * needed. - */ - private newRequest_; - /** - * Queue a packet for transmission to the server. - * @param segnum - A sequential id for this packet segment used for reassembly - * @param totalsegs - The total number of segments in this packet - * @param data - The data for this segment. - */ - enqueueSegment(segnum: number, totalsegs: number, data: unknown): void; - /** - * Add a script tag for a regular long-poll request. - * @param url - The URL of the script tag. - * @param serial - The serial number of the request. - */ - private addLongPollTag_; - /** - * Add an arbitrary script tag to the iframe. - * @param url - The URL for the script tag source. - * @param loadCB - A callback to be triggered once the script has loaded. - */ - addTag(url: string, loadCB: () => void): void; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/realtime/Connection.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/realtime/Connection.d.ts deleted file mode 100644 index 43493688..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/realtime/Connection.d.ts +++ /dev/null @@ -1,102 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { RepoInfo } from '../core/RepoInfo'; -/** - * Creates a new real-time connection to the server using whichever method works - * best in the current browser. - */ -export declare class Connection { - id: string; - private repoInfo_; - private applicationId_; - private appCheckToken_; - private authToken_; - private onMessage_; - private onReady_; - private onDisconnect_; - private onKill_; - lastSessionId?: string; - connectionCount: number; - pendingDataMessages: unknown[]; - sessionId: string; - private conn_; - private healthyTimeout_; - private isHealthy_; - private log_; - private primaryResponsesRequired_; - private rx_; - private secondaryConn_; - private secondaryResponsesRequired_; - private state_; - private transportManager_; - private tx_; - /** - * @param id - an id for this connection - * @param repoInfo_ - the info for the endpoint to connect to - * @param applicationId_ - the Firebase App ID for this project - * @param appCheckToken_ - The App Check Token for this device. - * @param authToken_ - The auth token for this session. - * @param onMessage_ - the callback to be triggered when a server-push message arrives - * @param onReady_ - the callback to be triggered when this connection is ready to send messages. - * @param onDisconnect_ - the callback to be triggered when a connection was lost - * @param onKill_ - the callback to be triggered when this connection has permanently shut down. - * @param lastSessionId - last session id in persistent connection. is used to clean up old session in real-time server - */ - constructor(id: string, repoInfo_: RepoInfo, applicationId_: string | undefined, appCheckToken_: string | undefined, authToken_: string | undefined, onMessage_: (a: {}) => void, onReady_: (a: number, b: string) => void, onDisconnect_: () => void, onKill_: (a: string) => void, lastSessionId?: string); - /** - * Starts a connection attempt - */ - private start_; - private nextTransportId_; - private disconnReceiver_; - private connReceiver_; - /** - * @param dataMsg - An arbitrary data message to be sent to the server - */ - sendRequest(dataMsg: object): void; - tryCleanupConnection(): void; - private onSecondaryControl_; - private onSecondaryMessageReceived_; - private upgradeIfSecondaryHealthy_; - private proceedWithUpgrade_; - private onPrimaryMessageReceived_; - private onDataMessage_; - private onPrimaryResponse_; - private onControl_; - /** - * @param handshake - The handshake data returned from the server - */ - private onHandshake_; - private tryStartUpgrade_; - private startUpgrade_; - private onReset_; - private onConnectionEstablished_; - private sendPingOnPrimaryIfNecessary_; - private onSecondaryConnectionLost_; - /** - * @param everConnected - Whether or not the connection ever reached a server. Used to determine if - * we should flush the host cache - */ - private onConnectionLost_; - private onConnectionShutdown_; - private sendData_; - /** - * Cleans up this connection, calling the appropriate callbacks - */ - close(): void; - private closeConnections_; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/realtime/Constants.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/realtime/Constants.d.ts deleted file mode 100644 index 7d1785e2..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/realtime/Constants.d.ts +++ /dev/null @@ -1,27 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export declare const PROTOCOL_VERSION = "5"; -export declare const VERSION_PARAM = "v"; -export declare const TRANSPORT_SESSION_PARAM = "s"; -export declare const REFERER_PARAM = "r"; -export declare const FORGE_REF = "f"; -export declare const FORGE_DOMAIN_RE: RegExp; -export declare const LAST_SESSION_PARAM = "ls"; -export declare const APPLICATION_ID_PARAM = "p"; -export declare const APP_CHECK_TOKEN_PARAM = "ac"; -export declare const WEBSOCKET = "websocket"; -export declare const LONG_POLLING = "long_polling"; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/realtime/Transport.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/realtime/Transport.d.ts deleted file mode 100644 index eb0055fc..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/realtime/Transport.d.ts +++ /dev/null @@ -1,58 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { RepoInfo } from '../core/RepoInfo'; -export interface TransportConstructor { - new (connId: string, repoInfo: RepoInfo, applicationId?: string, appCheckToken?: string, authToken?: string, transportSessionId?: string, lastSessionId?: string): Transport; - isAvailable: () => boolean; - responsesRequiredToBeHealthy?: number; - healthyTimeout?: number; -} -export declare abstract class Transport { - /** - * Bytes received since connection started. - */ - abstract bytesReceived: number; - /** - * Bytes sent since connection started. - */ - abstract bytesSent: number; - /** - * An identifier for this connection, used for logging - */ - abstract connId: string; - /** - * @param connId - An identifier for this connection, used for logging - * @param repoInfo - The info for the endpoint to send data to. - * @param transportSessionId - Optional transportSessionId if this is connecting to an existing transport session - * @param lastSessionId - Optional lastSessionId if there was a previous connection - * @interface - */ - constructor(connId: string, repoInfo: RepoInfo, transportSessionId?: string, lastSessionId?: string); - /** - * @param onMessage - Callback when messages arrive - * @param onDisconnect - Callback with connection lost. - */ - abstract open(onMessage: (a: {}) => void, onDisconnect: (a?: boolean) => void): void; - abstract start(): void; - abstract close(): void; - /** - * @param data - The JSON data to transmit - */ - abstract send(data: {}): void; - abstract markConnectionHealthy(): void; - abstract markConnectionHealthy(): void; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/realtime/TransportManager.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/realtime/TransportManager.d.ts deleted file mode 100644 index 39d637bd..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/realtime/TransportManager.d.ts +++ /dev/null @@ -1,50 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { RepoInfo } from '../core/RepoInfo'; -import { BrowserPollConnection } from './BrowserPollConnection'; -import { TransportConstructor } from './Transport'; -import { WebSocketConnection } from './WebSocketConnection'; -/** - * Currently simplistic, this class manages what transport a Connection should use at various stages of its - * lifecycle. - * - * It starts with longpolling in a browser, and httppolling on node. It then upgrades to websockets if - * they are available. - */ -export declare class TransportManager { - private transports_; - static globalTransportInitialized_: boolean; - static get ALL_TRANSPORTS(): (typeof BrowserPollConnection | typeof WebSocketConnection)[]; - /** - * Returns whether transport has been selected to ensure WebSocketConnection or BrowserPollConnection are not called after - * TransportManager has already set up transports_ - */ - static get IS_TRANSPORT_INITIALIZED(): boolean; - /** - * @param repoInfo - Metadata around the namespace we're connecting to - */ - constructor(repoInfo: RepoInfo); - private initTransports_; - /** - * @returns The constructor for the initial transport to use - */ - initialTransport(): TransportConstructor; - /** - * @returns The constructor for the next transport, or null - */ - upgradeTransport(): TransportConstructor | null; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/realtime/WebSocketConnection.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/realtime/WebSocketConnection.d.ts deleted file mode 100644 index 1f280b96..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/realtime/WebSocketConnection.d.ts +++ /dev/null @@ -1,127 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { RepoInfo } from '../core/RepoInfo'; -import { Transport } from './Transport'; -export declare function setWebSocketImpl(impl: any): void; -/** - * Create a new websocket connection with the given callbacks. - */ -export declare class WebSocketConnection implements Transport { - connId: string; - private applicationId?; - private appCheckToken?; - private authToken?; - keepaliveTimer: number | null; - frames: string[] | null; - totalFrames: number; - bytesSent: number; - bytesReceived: number; - connURL: string; - onDisconnect: (a?: boolean) => void; - onMessage: (msg: {}) => void; - mySock: WebSocket | null; - private log_; - private stats_; - private everConnected_; - private isClosed_; - private nodeAdmin; - /** - * @param connId identifier for this transport - * @param repoInfo The info for the websocket endpoint. - * @param applicationId The Firebase App ID for this project. - * @param appCheckToken The App Check Token for this client. - * @param authToken The Auth Token for this client. - * @param transportSessionId Optional transportSessionId if this is connecting - * to an existing transport session - * @param lastSessionId Optional lastSessionId if there was a previous - * connection - */ - constructor(connId: string, repoInfo: RepoInfo, applicationId?: string, appCheckToken?: string, authToken?: string, transportSessionId?: string, lastSessionId?: string); - /** - * @param repoInfo - The info for the websocket endpoint. - * @param transportSessionId - Optional transportSessionId if this is connecting to an existing transport - * session - * @param lastSessionId - Optional lastSessionId if there was a previous connection - * @returns connection url - */ - private static connectionURL_; - /** - * @param onMessage - Callback when messages arrive - * @param onDisconnect - Callback with connection lost. - */ - open(onMessage: (msg: {}) => void, onDisconnect: (a?: boolean) => void): void; - /** - * No-op for websockets, we don't need to do anything once the connection is confirmed as open - */ - start(): void; - static forceDisallow_: boolean; - static forceDisallow(): void; - static isAvailable(): boolean; - /** - * Number of response before we consider the connection "healthy." - */ - static responsesRequiredToBeHealthy: number; - /** - * Time to wait for the connection te become healthy before giving up. - */ - static healthyTimeout: number; - /** - * Returns true if we previously failed to connect with this transport. - */ - static previouslyFailed(): boolean; - markConnectionHealthy(): void; - private appendFrame_; - /** - * @param frameCount - The number of frames we are expecting from the server - */ - private handleNewFrameCount_; - /** - * Attempts to parse a frame count out of some text. If it can't, assumes a value of 1 - * @returns Any remaining data to be process, or null if there is none - */ - private extractFrameCount_; - /** - * Process a websocket frame that has arrived from the server. - * @param mess - The frame data - */ - handleIncomingFrame(mess: { - [k: string]: unknown; - }): void; - /** - * Send a message to the server - * @param data - The JSON object to transmit - */ - send(data: {}): void; - private shutdown_; - private onClosed_; - /** - * External-facing close handler. - * Close the websocket and kill the connection. - */ - close(): void; - /** - * Kill the current keepalive timer and start a new one, to ensure that it always fires N seconds after - * the last activity. - */ - resetKeepAlive(): void; - /** - * Send a string over the websocket. - * - * @param str - String to send. - */ - private sendString_; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/realtime/polling/PacketReceiver.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/realtime/polling/PacketReceiver.d.ts deleted file mode 100644 index f756f7fc..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/realtime/polling/PacketReceiver.d.ts +++ /dev/null @@ -1,38 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * This class ensures the packets from the server arrive in order - * This class takes data from the server and ensures it gets passed into the callbacks in order. - */ -export declare class PacketReceiver { - private onMessage_; - pendingResponses: unknown[]; - currentResponseNum: number; - closeAfterResponse: number; - onClose: (() => void) | null; - /** - * @param onMessage_ - */ - constructor(onMessage_: (a: {}) => void); - closeAfter(responseNum: number, callback: () => void): void; - /** - * Each message from the server comes with a response number, and an array of data. The responseNumber - * allows us to ensure that we process them in the right order, since we can't be guaranteed that all - * browsers will respond in the same order as the requests we sent - */ - handleResponse(requestNum: number, data: unknown[]): void; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/register.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/register.d.ts deleted file mode 100644 index d7e0e6ab..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/register.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare function registerDatabase(variant?: string): void; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/tsdoc-metadata.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/tsdoc-metadata.json deleted file mode 100644 index 6af1f6a1..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/src/tsdoc-metadata.json +++ /dev/null @@ -1,11 +0,0 @@ -// This file is read by tools that parse documentation comments conforming to the TSDoc standard. -// It should be published with your NPM package. It should not be tracked by Git. -{ - "tsdocVersion": "0.12", - "toolPackages": [ - { - "packageName": "@microsoft/api-extractor", - "packageVersion": "0.1.2" - } - ] -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/test/compound_write.test.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/test/compound_write.test.d.ts deleted file mode 100644 index cd6aeb9b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/test/compound_write.test.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export {}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/test/connection.test.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/test/connection.test.d.ts deleted file mode 100644 index cd6aeb9b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/test/connection.test.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export {}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/test/deno.test.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/test/deno.test.d.ts deleted file mode 100644 index b39bcc63..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/test/deno.test.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * @license - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export {}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/test/exp/integration.test.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/test/exp/integration.test.d.ts deleted file mode 100644 index 0365dec9..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/test/exp/integration.test.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export declare function createTestApp(): import("@firebase/app").FirebaseApp; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/test/helpers/EventAccumulator.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/test/helpers/EventAccumulator.d.ts deleted file mode 100644 index cf2fe26d..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/test/helpers/EventAccumulator.d.ts +++ /dev/null @@ -1,35 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export declare const EventAccumulatorFactory: { - waitsForCount: (maxCount: any) => EventAccumulator; - waitsForExactCount: (maxCount: any) => EventAccumulator; -}; -export declare class EventAccumulator { - condition: Function; - eventData: any[]; - promise: any; - resolve: any; - reject: any; - private onResetFxn; - private onEventFxn; - constructor(condition: Function); - addEvent(eventData?: any): void; - reset(condition?: Function): void; - onEvent(cb: Function): void; - onReset(cb: Function): void; - _testCondition(): any; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/test/helpers/syncpoint-util.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/test/helpers/syncpoint-util.d.ts deleted file mode 100644 index 17c9e364..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/test/helpers/syncpoint-util.d.ts +++ /dev/null @@ -1,29 +0,0 @@ -/** - * @license - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { FirebaseApp } from '@firebase/app'; -import { ListenProvider } from '../../src/core/SyncTree'; -import { Path } from '../../src/core/util/Path'; -export declare class SyncPointTestParser { - app: FirebaseApp; - listens_: any; - listenProvider_: ListenProvider; - private syncTree_; - constructor(); - getTestPath(optBasePath: string | string[], path?: string): Path; - private testRunner; - defineTest(spec: any): void; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/test/helpers/util.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/test/helpers/util.d.ts deleted file mode 100644 index 28bfbd2b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/test/helpers/util.d.ts +++ /dev/null @@ -1,34 +0,0 @@ -/** - * @license - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { Database, DatabaseReference } from '../../src'; -import { Path } from '../../src/core/util/Path'; -import { EventAccumulator } from './EventAccumulator'; -export declare const TEST_PROJECT: any; -export declare function getFreshRepo(path: Path): DatabaseReference; -export declare const DATABASE_ADDRESS: any; -export declare const DATABASE_URL: any; -export declare function testRepoInfo(url: any): import("../../src/core/RepoInfo").RepoInfo; -export declare function repoInfoForConnectionTest(): import("../../src/core/RepoInfo").RepoInfo; -export declare function shuffle(arr: any, randFn?: () => number): void; -export declare function waitFor(waitTimeInMS: number): Promise; -export declare function getUniqueRef(db: Database): DatabaseReference; -export declare function getRWRefs(db: Database): { - readerRef: DatabaseReference; - writerRef: DatabaseReference; -}; -export declare function writeAndValidate(writerRef: DatabaseReference, readerRef: DatabaseReference, toWrite: unknown, ec: EventAccumulator): Promise; -export declare function waitUntil(cb: () => boolean, maxRetries?: number): Promise; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/test/node.test.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/test/node.test.d.ts deleted file mode 100644 index cd6aeb9b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/test/node.test.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export {}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/test/parser.test.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/test/parser.test.d.ts deleted file mode 100644 index b39bcc63..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/test/parser.test.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * @license - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export {}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/test/path.test.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/test/path.test.d.ts deleted file mode 100644 index cd6aeb9b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/test/path.test.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export {}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/test/pushid.test.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/test/pushid.test.d.ts deleted file mode 100644 index d92ca4eb..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/test/pushid.test.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * @license - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export {}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/test/repoinfo.test.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/test/repoinfo.test.d.ts deleted file mode 100644 index cd6aeb9b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/test/repoinfo.test.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export {}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/test/sortedmap.test.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/test/sortedmap.test.d.ts deleted file mode 100644 index cd6aeb9b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/test/sortedmap.test.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export {}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/test/sparsesnapshottree.test.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/test/sparsesnapshottree.test.d.ts deleted file mode 100644 index cd6aeb9b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/test/sparsesnapshottree.test.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export {}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/test/syncpoint.test.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/test/syncpoint.test.d.ts deleted file mode 100644 index b39bcc63..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/test/syncpoint.test.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * @license - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export {}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/test/transport.test.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/test/transport.test.d.ts deleted file mode 100644 index b39bcc63..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/test/transport.test.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * @license - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export {}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/test/websocketconnection.test.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/test/websocketconnection.test.d.ts deleted file mode 100644 index b39bcc63..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/dist/test/websocketconnection.test.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * @license - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export {}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/package.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/package.json deleted file mode 100644 index 37dfecba..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/database/package.json +++ /dev/null @@ -1,76 +0,0 @@ -{ - "name": "@firebase/database", - "version": "0.13.10", - "description": "", - "author": "Firebase (https://firebase.google.com/)", - "main": "dist/index.node.cjs.js", - "browser": "dist/index.esm2017.js", - "module": "dist/index.esm2017.js", - "esm5": "dist/index.esm5.js", - "standalone": "dist/index.standalone.js", - "exports": { - ".": { - "types": "./dist/public.d.ts", - "node": { - "import": "./dist/node-esm/index.node.esm.js", - "require": "./dist/index.node.cjs.js" - }, - "esm5": "./dist/index.esm5.js", - "standalone": "./dist/index.standalone.js", - "default": "./dist/index.esm2017.js" - }, - "./package.json": "./package.json" - }, - "files": [ - "dist" - ], - "scripts": { - "lint": "eslint -c .eslintrc.js '**/*.ts' --ignore-path '../../.gitignore'", - "lint:fix": "eslint --fix -c .eslintrc.js '**/*.ts' --ignore-path '../../.gitignore'", - "prettier": "prettier --write '*.js' '*.ts' '@(src|test)/**/*.ts'", - "build": "rollup -c rollup.config.js && yarn api-report", - "build:deps": "lerna run --scope @firebase/'{app,database}' --include-dependencies build", - "dev": "rollup -c -w", - "test": "run-p lint test:emulator", - "test:ci": "node ../../scripts/run_tests_in_ci.js -s test:emulator", - "test:all": "run-p lint test:browser test:node", - "test:browser": "karma start --single-run", - "test:node": "TS_NODE_FILES=true TS_NODE_CACHE=NO TS_NODE_COMPILER_OPTIONS='{\"module\":\"commonjs\"}' nyc --reporter lcovonly -- mocha 'test/{,!(browser)/**/}*.test.ts' --file src/index.node.ts --config ../../config/mocharc.node.js", - "test:emulator": "ts-node --compiler-options='{\"module\":\"commonjs\"}' ../../scripts/emulator-testing/database-test-runner.ts", - "api-report": "TS_NODE_COMPILER_OPTIONS='{\"module\":\"commonjs\"}' ts-node ../../repo-scripts/prune-dts/extract-public-api.ts --package database --packageRoot . --typescriptDts ./dist/src/index.d.ts --rollupDts ./dist/private.d.ts --untrimmedRollupDts ./dist/internal.d.ts --publicDts ./dist/public.d.ts && yarn api-report:api-json", - "api-report:api-json": "rm -rf temp && api-extractor run --local --verbose", - "doc": "api-documenter markdown --input temp --output docs", - "typings:public": "node ../../scripts/build/use_typings.js ./dist/public.d.ts" - }, - "license": "Apache-2.0", - "peerDependencies": {}, - "dependencies": { - "@firebase/logger": "0.3.4", - "@firebase/util": "1.7.3", - "@firebase/component": "0.5.21", - "@firebase/auth-interop-types": "0.1.7", - "faye-websocket": "0.11.4", - "tslib": "^2.1.0" - }, - "devDependencies": { - "@firebase/app": "0.8.3", - "rollup": "2.79.1", - "rollup-plugin-typescript2": "0.31.2", - "typescript": "4.2.2" - }, - "repository": { - "directory": "packages/database", - "type": "git", - "url": "https://github.com/firebase/firebase-js-sdk.git" - }, - "bugs": { - "url": "https://github.com/firebase/firebase-js-sdk/issues" - }, - "typings": "./dist/public.d.ts", - "nyc": { - "extension": [ - ".ts" - ], - "reportDir": "./coverage/node" - } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/logger/CHANGELOG.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/logger/CHANGELOG.md deleted file mode 100644 index 21774102..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/logger/CHANGELOG.md +++ /dev/null @@ -1,37 +0,0 @@ -# @firebase/logger - -## 0.3.4 - -### Patch Changes - -- [`4af28c1a4`](https://github.com/firebase/firebase-js-sdk/commit/4af28c1a42bd25ce2353f694ca1724c6101cbce5) [#6682](https://github.com/firebase/firebase-js-sdk/pull/6682) - Upgrade TypeScript to 4.7.4. - -## 0.3.3 - -### Patch Changes - -- [`2cd1cc76f`](https://github.com/firebase/firebase-js-sdk/commit/2cd1cc76f2a308135cd60f424fe09084a34b5cb5) [#6307](https://github.com/firebase/firebase-js-sdk/pull/6307) (fixes [#6300](https://github.com/firebase/firebase-js-sdk/issues/6300)) - fix: add type declarations to exports field - -## 0.3.2 - -### Patch Changes - -- [`3281315fa`](https://github.com/firebase/firebase-js-sdk/commit/3281315fae9c6f535f9d5052ee17d60861ea569a) [#5708](https://github.com/firebase/firebase-js-sdk/pull/5708) (fixes [#1487](https://github.com/firebase/firebase-js-sdk/issues/1487)) - Update build scripts to work with the exports field - -## 0.3.1 - -### Patch Changes - -- [`2322b6023`](https://github.com/firebase/firebase-js-sdk/commit/2322b6023c628cd9f4f4172767c17d215dd91684) [#5693](https://github.com/firebase/firebase-js-sdk/pull/5693) - Add exports field to all packages - -## 0.3.0 - -### Minor Changes - -- [`a99943fe3`](https://github.com/firebase/firebase-js-sdk/commit/a99943fe3bd5279761aa29d138ec91272b06df39) [#5539](https://github.com/firebase/firebase-js-sdk/pull/5539) - Use esm2017 builds by default - -## 0.2.6 - -### Patch Changes - -- [`a754645e`](https://github.com/firebase/firebase-js-sdk/commit/a754645ec2be1b8c205f25f510196eee298b0d6e) [#3297](https://github.com/firebase/firebase-js-sdk/pull/3297) Thanks [@renovate](https://github.com/apps/renovate)! - Update dependency typescript to v3.9.5 diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/logger/README.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/logger/README.md deleted file mode 100644 index 69c1642e..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/logger/README.md +++ /dev/null @@ -1,40 +0,0 @@ -# @firebase/logger - -This package serves as the base of all logging in the JS SDK. Any logging that -is intended to be visible to Firebase end developers should go through this -module. - -## Basic Usage - -Firebase components should import the `Logger` class and instantiate a new -instance by passing a component name (e.g. `@firebase/`) to the -constructor. - -_e.g._ - -```typescript -import { Logger } from '@firebase/logger'; - -const logClient = new Logger(`@firebase/`); -``` - -Each `Logger` instance supports 5 log functions each to be used in a specific -instance: - -- `debug`: Internal logs; use this to allow developers to send us their debug - logs for us to be able to diagnose an issue. -- `log`: Use to inform your user about things they may need to know. -- `info`: Use if you have to inform the user about something that they need to - take a concrete action on. Once they take that action, the log should go away. -- `warn`: Use when a product feature may stop functioning correctly; unexpected - scenario. -- `error`: Only use when user App would stop functioning correctly - super rare! - -## Log Format - -Each log will be formatted in the following manner: - -```typescript -`[${new Date()}] ${COMPONENT_NAME}: ${...args}` -``` - diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/logger/dist/esm/index.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/logger/dist/esm/index.d.ts deleted file mode 100644 index 38a7e36d..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/logger/dist/esm/index.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export { setLogLevel, Logger, LogLevel, LogHandler, setUserLogHandler, LogCallback, LogLevelString, LogOptions } from './src/logger'; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/logger/dist/esm/index.esm2017.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/logger/dist/esm/index.esm2017.js deleted file mode 100644 index 9cbe7c8b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/logger/dist/esm/index.esm2017.js +++ /dev/null @@ -1,219 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * A container for all of the Logger instances - */ -const instances = []; -/** - * The JS SDK supports 5 log levels and also allows a user the ability to - * silence the logs altogether. - * - * The order is a follows: - * DEBUG < VERBOSE < INFO < WARN < ERROR - * - * All of the log types above the current log level will be captured (i.e. if - * you set the log level to `INFO`, errors will still be logged, but `DEBUG` and - * `VERBOSE` logs will not) - */ -var LogLevel; -(function (LogLevel) { - LogLevel[LogLevel["DEBUG"] = 0] = "DEBUG"; - LogLevel[LogLevel["VERBOSE"] = 1] = "VERBOSE"; - LogLevel[LogLevel["INFO"] = 2] = "INFO"; - LogLevel[LogLevel["WARN"] = 3] = "WARN"; - LogLevel[LogLevel["ERROR"] = 4] = "ERROR"; - LogLevel[LogLevel["SILENT"] = 5] = "SILENT"; -})(LogLevel || (LogLevel = {})); -const levelStringToEnum = { - 'debug': LogLevel.DEBUG, - 'verbose': LogLevel.VERBOSE, - 'info': LogLevel.INFO, - 'warn': LogLevel.WARN, - 'error': LogLevel.ERROR, - 'silent': LogLevel.SILENT -}; -/** - * The default log level - */ -const defaultLogLevel = LogLevel.INFO; -/** - * By default, `console.debug` is not displayed in the developer console (in - * chrome). To avoid forcing users to have to opt-in to these logs twice - * (i.e. once for firebase, and once in the console), we are sending `DEBUG` - * logs to the `console.log` function. - */ -const ConsoleMethod = { - [LogLevel.DEBUG]: 'log', - [LogLevel.VERBOSE]: 'log', - [LogLevel.INFO]: 'info', - [LogLevel.WARN]: 'warn', - [LogLevel.ERROR]: 'error' -}; -/** - * The default log handler will forward DEBUG, VERBOSE, INFO, WARN, and ERROR - * messages on to their corresponding console counterparts (if the log method - * is supported by the current log level) - */ -const defaultLogHandler = (instance, logType, ...args) => { - if (logType < instance.logLevel) { - return; - } - const now = new Date().toISOString(); - const method = ConsoleMethod[logType]; - if (method) { - console[method](`[${now}] ${instance.name}:`, ...args); - } - else { - throw new Error(`Attempted to log a message with an invalid logType (value: ${logType})`); - } -}; -class Logger { - /** - * Gives you an instance of a Logger to capture messages according to - * Firebase's logging scheme. - * - * @param name The name that the logs will be associated with - */ - constructor(name) { - this.name = name; - /** - * The log level of the given Logger instance. - */ - this._logLevel = defaultLogLevel; - /** - * The main (internal) log handler for the Logger instance. - * Can be set to a new function in internal package code but not by user. - */ - this._logHandler = defaultLogHandler; - /** - * The optional, additional, user-defined log handler for the Logger instance. - */ - this._userLogHandler = null; - /** - * Capture the current instance for later use - */ - instances.push(this); - } - get logLevel() { - return this._logLevel; - } - set logLevel(val) { - if (!(val in LogLevel)) { - throw new TypeError(`Invalid value "${val}" assigned to \`logLevel\``); - } - this._logLevel = val; - } - // Workaround for setter/getter having to be the same type. - setLogLevel(val) { - this._logLevel = typeof val === 'string' ? levelStringToEnum[val] : val; - } - get logHandler() { - return this._logHandler; - } - set logHandler(val) { - if (typeof val !== 'function') { - throw new TypeError('Value assigned to `logHandler` must be a function'); - } - this._logHandler = val; - } - get userLogHandler() { - return this._userLogHandler; - } - set userLogHandler(val) { - this._userLogHandler = val; - } - /** - * The functions below are all based on the `console` interface - */ - debug(...args) { - this._userLogHandler && this._userLogHandler(this, LogLevel.DEBUG, ...args); - this._logHandler(this, LogLevel.DEBUG, ...args); - } - log(...args) { - this._userLogHandler && - this._userLogHandler(this, LogLevel.VERBOSE, ...args); - this._logHandler(this, LogLevel.VERBOSE, ...args); - } - info(...args) { - this._userLogHandler && this._userLogHandler(this, LogLevel.INFO, ...args); - this._logHandler(this, LogLevel.INFO, ...args); - } - warn(...args) { - this._userLogHandler && this._userLogHandler(this, LogLevel.WARN, ...args); - this._logHandler(this, LogLevel.WARN, ...args); - } - error(...args) { - this._userLogHandler && this._userLogHandler(this, LogLevel.ERROR, ...args); - this._logHandler(this, LogLevel.ERROR, ...args); - } -} -function setLogLevel(level) { - instances.forEach(inst => { - inst.setLogLevel(level); - }); -} -function setUserLogHandler(logCallback, options) { - for (const instance of instances) { - let customLogLevel = null; - if (options && options.level) { - customLogLevel = levelStringToEnum[options.level]; - } - if (logCallback === null) { - instance.userLogHandler = null; - } - else { - instance.userLogHandler = (instance, level, ...args) => { - const message = args - .map(arg => { - if (arg == null) { - return null; - } - else if (typeof arg === 'string') { - return arg; - } - else if (typeof arg === 'number' || typeof arg === 'boolean') { - return arg.toString(); - } - else if (arg instanceof Error) { - return arg.message; - } - else { - try { - return JSON.stringify(arg); - } - catch (ignored) { - return null; - } - } - }) - .filter(arg => arg) - .join(' '); - if (level >= (customLogLevel !== null && customLogLevel !== void 0 ? customLogLevel : instance.logLevel)) { - logCallback({ - level: LogLevel[level].toLowerCase(), - message, - args, - type: instance.name - }); - } - }; - } - } -} - -export { LogLevel, Logger, setLogLevel, setUserLogHandler }; -//# sourceMappingURL=index.esm2017.js.map diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/logger/dist/esm/index.esm5.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/logger/dist/esm/index.esm5.js deleted file mode 100644 index 0648bec6..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/logger/dist/esm/index.esm5.js +++ /dev/null @@ -1,266 +0,0 @@ -import { __spreadArray } from 'tslib'; - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var _a; -/** - * A container for all of the Logger instances - */ -var instances = []; -/** - * The JS SDK supports 5 log levels and also allows a user the ability to - * silence the logs altogether. - * - * The order is a follows: - * DEBUG < VERBOSE < INFO < WARN < ERROR - * - * All of the log types above the current log level will be captured (i.e. if - * you set the log level to `INFO`, errors will still be logged, but `DEBUG` and - * `VERBOSE` logs will not) - */ -var LogLevel; -(function (LogLevel) { - LogLevel[LogLevel["DEBUG"] = 0] = "DEBUG"; - LogLevel[LogLevel["VERBOSE"] = 1] = "VERBOSE"; - LogLevel[LogLevel["INFO"] = 2] = "INFO"; - LogLevel[LogLevel["WARN"] = 3] = "WARN"; - LogLevel[LogLevel["ERROR"] = 4] = "ERROR"; - LogLevel[LogLevel["SILENT"] = 5] = "SILENT"; -})(LogLevel || (LogLevel = {})); -var levelStringToEnum = { - 'debug': LogLevel.DEBUG, - 'verbose': LogLevel.VERBOSE, - 'info': LogLevel.INFO, - 'warn': LogLevel.WARN, - 'error': LogLevel.ERROR, - 'silent': LogLevel.SILENT -}; -/** - * The default log level - */ -var defaultLogLevel = LogLevel.INFO; -/** - * By default, `console.debug` is not displayed in the developer console (in - * chrome). To avoid forcing users to have to opt-in to these logs twice - * (i.e. once for firebase, and once in the console), we are sending `DEBUG` - * logs to the `console.log` function. - */ -var ConsoleMethod = (_a = {}, - _a[LogLevel.DEBUG] = 'log', - _a[LogLevel.VERBOSE] = 'log', - _a[LogLevel.INFO] = 'info', - _a[LogLevel.WARN] = 'warn', - _a[LogLevel.ERROR] = 'error', - _a); -/** - * The default log handler will forward DEBUG, VERBOSE, INFO, WARN, and ERROR - * messages on to their corresponding console counterparts (if the log method - * is supported by the current log level) - */ -var defaultLogHandler = function (instance, logType) { - var args = []; - for (var _i = 2; _i < arguments.length; _i++) { - args[_i - 2] = arguments[_i]; - } - if (logType < instance.logLevel) { - return; - } - var now = new Date().toISOString(); - var method = ConsoleMethod[logType]; - if (method) { - console[method].apply(console, __spreadArray(["[" + now + "] " + instance.name + ":"], args)); - } - else { - throw new Error("Attempted to log a message with an invalid logType (value: " + logType + ")"); - } -}; -var Logger = /** @class */ (function () { - /** - * Gives you an instance of a Logger to capture messages according to - * Firebase's logging scheme. - * - * @param name The name that the logs will be associated with - */ - function Logger(name) { - this.name = name; - /** - * The log level of the given Logger instance. - */ - this._logLevel = defaultLogLevel; - /** - * The main (internal) log handler for the Logger instance. - * Can be set to a new function in internal package code but not by user. - */ - this._logHandler = defaultLogHandler; - /** - * The optional, additional, user-defined log handler for the Logger instance. - */ - this._userLogHandler = null; - /** - * Capture the current instance for later use - */ - instances.push(this); - } - Object.defineProperty(Logger.prototype, "logLevel", { - get: function () { - return this._logLevel; - }, - set: function (val) { - if (!(val in LogLevel)) { - throw new TypeError("Invalid value \"" + val + "\" assigned to `logLevel`"); - } - this._logLevel = val; - }, - enumerable: false, - configurable: true - }); - // Workaround for setter/getter having to be the same type. - Logger.prototype.setLogLevel = function (val) { - this._logLevel = typeof val === 'string' ? levelStringToEnum[val] : val; - }; - Object.defineProperty(Logger.prototype, "logHandler", { - get: function () { - return this._logHandler; - }, - set: function (val) { - if (typeof val !== 'function') { - throw new TypeError('Value assigned to `logHandler` must be a function'); - } - this._logHandler = val; - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(Logger.prototype, "userLogHandler", { - get: function () { - return this._userLogHandler; - }, - set: function (val) { - this._userLogHandler = val; - }, - enumerable: false, - configurable: true - }); - /** - * The functions below are all based on the `console` interface - */ - Logger.prototype.debug = function () { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - this._userLogHandler && this._userLogHandler.apply(this, __spreadArray([this, LogLevel.DEBUG], args)); - this._logHandler.apply(this, __spreadArray([this, LogLevel.DEBUG], args)); - }; - Logger.prototype.log = function () { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - this._userLogHandler && this._userLogHandler.apply(this, __spreadArray([this, LogLevel.VERBOSE], args)); - this._logHandler.apply(this, __spreadArray([this, LogLevel.VERBOSE], args)); - }; - Logger.prototype.info = function () { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - this._userLogHandler && this._userLogHandler.apply(this, __spreadArray([this, LogLevel.INFO], args)); - this._logHandler.apply(this, __spreadArray([this, LogLevel.INFO], args)); - }; - Logger.prototype.warn = function () { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - this._userLogHandler && this._userLogHandler.apply(this, __spreadArray([this, LogLevel.WARN], args)); - this._logHandler.apply(this, __spreadArray([this, LogLevel.WARN], args)); - }; - Logger.prototype.error = function () { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - this._userLogHandler && this._userLogHandler.apply(this, __spreadArray([this, LogLevel.ERROR], args)); - this._logHandler.apply(this, __spreadArray([this, LogLevel.ERROR], args)); - }; - return Logger; -}()); -function setLogLevel(level) { - instances.forEach(function (inst) { - inst.setLogLevel(level); - }); -} -function setUserLogHandler(logCallback, options) { - var _loop_1 = function (instance) { - var customLogLevel = null; - if (options && options.level) { - customLogLevel = levelStringToEnum[options.level]; - } - if (logCallback === null) { - instance.userLogHandler = null; - } - else { - instance.userLogHandler = function (instance, level) { - var args = []; - for (var _i = 2; _i < arguments.length; _i++) { - args[_i - 2] = arguments[_i]; - } - var message = args - .map(function (arg) { - if (arg == null) { - return null; - } - else if (typeof arg === 'string') { - return arg; - } - else if (typeof arg === 'number' || typeof arg === 'boolean') { - return arg.toString(); - } - else if (arg instanceof Error) { - return arg.message; - } - else { - try { - return JSON.stringify(arg); - } - catch (ignored) { - return null; - } - } - }) - .filter(function (arg) { return arg; }) - .join(' '); - if (level >= (customLogLevel !== null && customLogLevel !== void 0 ? customLogLevel : instance.logLevel)) { - logCallback({ - level: LogLevel[level].toLowerCase(), - message: message, - args: args, - type: instance.name - }); - } - }; - } - }; - for (var _i = 0, instances_1 = instances; _i < instances_1.length; _i++) { - var instance = instances_1[_i]; - _loop_1(instance); - } -} - -export { LogLevel, Logger, setLogLevel, setUserLogHandler }; -//# sourceMappingURL=index.esm5.js.map diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/logger/dist/esm/package.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/logger/dist/esm/package.json deleted file mode 100644 index 7c34deb5..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/logger/dist/esm/package.json +++ /dev/null @@ -1 +0,0 @@ -{"type":"module"} \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/logger/dist/esm/src/logger.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/logger/dist/esm/src/logger.d.ts deleted file mode 100644 index fdbe5e6c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/logger/dist/esm/src/logger.d.ts +++ /dev/null @@ -1,96 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export declare type LogLevelString = 'debug' | 'verbose' | 'info' | 'warn' | 'error' | 'silent'; -export interface LogOptions { - level: LogLevelString; -} -export declare type LogCallback = (callbackParams: LogCallbackParams) => void; -export interface LogCallbackParams { - level: LogLevelString; - message: string; - args: unknown[]; - type: string; -} -/** - * A container for all of the Logger instances - */ -export declare const instances: Logger[]; -/** - * The JS SDK supports 5 log levels and also allows a user the ability to - * silence the logs altogether. - * - * The order is a follows: - * DEBUG < VERBOSE < INFO < WARN < ERROR - * - * All of the log types above the current log level will be captured (i.e. if - * you set the log level to `INFO`, errors will still be logged, but `DEBUG` and - * `VERBOSE` logs will not) - */ -export declare enum LogLevel { - DEBUG = 0, - VERBOSE = 1, - INFO = 2, - WARN = 3, - ERROR = 4, - SILENT = 5 -} -/** - * We allow users the ability to pass their own log handler. We will pass the - * type of log, the current log level, and any other arguments passed (i.e. the - * messages that the user wants to log) to this function. - */ -export declare type LogHandler = (loggerInstance: Logger, logType: LogLevel, ...args: unknown[]) => void; -export declare class Logger { - name: string; - /** - * Gives you an instance of a Logger to capture messages according to - * Firebase's logging scheme. - * - * @param name The name that the logs will be associated with - */ - constructor(name: string); - /** - * The log level of the given Logger instance. - */ - private _logLevel; - get logLevel(): LogLevel; - set logLevel(val: LogLevel); - setLogLevel(val: LogLevel | LogLevelString): void; - /** - * The main (internal) log handler for the Logger instance. - * Can be set to a new function in internal package code but not by user. - */ - private _logHandler; - get logHandler(): LogHandler; - set logHandler(val: LogHandler); - /** - * The optional, additional, user-defined log handler for the Logger instance. - */ - private _userLogHandler; - get userLogHandler(): LogHandler | null; - set userLogHandler(val: LogHandler | null); - /** - * The functions below are all based on the `console` interface - */ - debug(...args: unknown[]): void; - log(...args: unknown[]): void; - info(...args: unknown[]): void; - warn(...args: unknown[]): void; - error(...args: unknown[]): void; -} -export declare function setLogLevel(level: LogLevelString | LogLevel): void; -export declare function setUserLogHandler(logCallback: LogCallback | null, options?: LogOptions): void; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/logger/dist/esm/test/custom-logger.test.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/logger/dist/esm/test/custom-logger.test.d.ts deleted file mode 100644 index 99491857..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/logger/dist/esm/test/custom-logger.test.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export {}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/logger/dist/esm/test/logger.test.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/logger/dist/esm/test/logger.test.d.ts deleted file mode 100644 index 99491857..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/logger/dist/esm/test/logger.test.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export {}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/logger/dist/index.cjs.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/logger/dist/index.cjs.js deleted file mode 100644 index 6ef2449e..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/logger/dist/index.cjs.js +++ /dev/null @@ -1,272 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, '__esModule', { value: true }); - -var tslib = require('tslib'); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var _a; -/** - * A container for all of the Logger instances - */ -var instances = []; -/** - * The JS SDK supports 5 log levels and also allows a user the ability to - * silence the logs altogether. - * - * The order is a follows: - * DEBUG < VERBOSE < INFO < WARN < ERROR - * - * All of the log types above the current log level will be captured (i.e. if - * you set the log level to `INFO`, errors will still be logged, but `DEBUG` and - * `VERBOSE` logs will not) - */ -exports.LogLevel = void 0; -(function (LogLevel) { - LogLevel[LogLevel["DEBUG"] = 0] = "DEBUG"; - LogLevel[LogLevel["VERBOSE"] = 1] = "VERBOSE"; - LogLevel[LogLevel["INFO"] = 2] = "INFO"; - LogLevel[LogLevel["WARN"] = 3] = "WARN"; - LogLevel[LogLevel["ERROR"] = 4] = "ERROR"; - LogLevel[LogLevel["SILENT"] = 5] = "SILENT"; -})(exports.LogLevel || (exports.LogLevel = {})); -var levelStringToEnum = { - 'debug': exports.LogLevel.DEBUG, - 'verbose': exports.LogLevel.VERBOSE, - 'info': exports.LogLevel.INFO, - 'warn': exports.LogLevel.WARN, - 'error': exports.LogLevel.ERROR, - 'silent': exports.LogLevel.SILENT -}; -/** - * The default log level - */ -var defaultLogLevel = exports.LogLevel.INFO; -/** - * By default, `console.debug` is not displayed in the developer console (in - * chrome). To avoid forcing users to have to opt-in to these logs twice - * (i.e. once for firebase, and once in the console), we are sending `DEBUG` - * logs to the `console.log` function. - */ -var ConsoleMethod = (_a = {}, - _a[exports.LogLevel.DEBUG] = 'log', - _a[exports.LogLevel.VERBOSE] = 'log', - _a[exports.LogLevel.INFO] = 'info', - _a[exports.LogLevel.WARN] = 'warn', - _a[exports.LogLevel.ERROR] = 'error', - _a); -/** - * The default log handler will forward DEBUG, VERBOSE, INFO, WARN, and ERROR - * messages on to their corresponding console counterparts (if the log method - * is supported by the current log level) - */ -var defaultLogHandler = function (instance, logType) { - var args = []; - for (var _i = 2; _i < arguments.length; _i++) { - args[_i - 2] = arguments[_i]; - } - if (logType < instance.logLevel) { - return; - } - var now = new Date().toISOString(); - var method = ConsoleMethod[logType]; - if (method) { - console[method].apply(console, tslib.__spreadArray(["[" + now + "] " + instance.name + ":"], args)); - } - else { - throw new Error("Attempted to log a message with an invalid logType (value: " + logType + ")"); - } -}; -var Logger = /** @class */ (function () { - /** - * Gives you an instance of a Logger to capture messages according to - * Firebase's logging scheme. - * - * @param name The name that the logs will be associated with - */ - function Logger(name) { - this.name = name; - /** - * The log level of the given Logger instance. - */ - this._logLevel = defaultLogLevel; - /** - * The main (internal) log handler for the Logger instance. - * Can be set to a new function in internal package code but not by user. - */ - this._logHandler = defaultLogHandler; - /** - * The optional, additional, user-defined log handler for the Logger instance. - */ - this._userLogHandler = null; - /** - * Capture the current instance for later use - */ - instances.push(this); - } - Object.defineProperty(Logger.prototype, "logLevel", { - get: function () { - return this._logLevel; - }, - set: function (val) { - if (!(val in exports.LogLevel)) { - throw new TypeError("Invalid value \"" + val + "\" assigned to `logLevel`"); - } - this._logLevel = val; - }, - enumerable: false, - configurable: true - }); - // Workaround for setter/getter having to be the same type. - Logger.prototype.setLogLevel = function (val) { - this._logLevel = typeof val === 'string' ? levelStringToEnum[val] : val; - }; - Object.defineProperty(Logger.prototype, "logHandler", { - get: function () { - return this._logHandler; - }, - set: function (val) { - if (typeof val !== 'function') { - throw new TypeError('Value assigned to `logHandler` must be a function'); - } - this._logHandler = val; - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(Logger.prototype, "userLogHandler", { - get: function () { - return this._userLogHandler; - }, - set: function (val) { - this._userLogHandler = val; - }, - enumerable: false, - configurable: true - }); - /** - * The functions below are all based on the `console` interface - */ - Logger.prototype.debug = function () { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - this._userLogHandler && this._userLogHandler.apply(this, tslib.__spreadArray([this, exports.LogLevel.DEBUG], args)); - this._logHandler.apply(this, tslib.__spreadArray([this, exports.LogLevel.DEBUG], args)); - }; - Logger.prototype.log = function () { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - this._userLogHandler && this._userLogHandler.apply(this, tslib.__spreadArray([this, exports.LogLevel.VERBOSE], args)); - this._logHandler.apply(this, tslib.__spreadArray([this, exports.LogLevel.VERBOSE], args)); - }; - Logger.prototype.info = function () { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - this._userLogHandler && this._userLogHandler.apply(this, tslib.__spreadArray([this, exports.LogLevel.INFO], args)); - this._logHandler.apply(this, tslib.__spreadArray([this, exports.LogLevel.INFO], args)); - }; - Logger.prototype.warn = function () { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - this._userLogHandler && this._userLogHandler.apply(this, tslib.__spreadArray([this, exports.LogLevel.WARN], args)); - this._logHandler.apply(this, tslib.__spreadArray([this, exports.LogLevel.WARN], args)); - }; - Logger.prototype.error = function () { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - this._userLogHandler && this._userLogHandler.apply(this, tslib.__spreadArray([this, exports.LogLevel.ERROR], args)); - this._logHandler.apply(this, tslib.__spreadArray([this, exports.LogLevel.ERROR], args)); - }; - return Logger; -}()); -function setLogLevel(level) { - instances.forEach(function (inst) { - inst.setLogLevel(level); - }); -} -function setUserLogHandler(logCallback, options) { - var _loop_1 = function (instance) { - var customLogLevel = null; - if (options && options.level) { - customLogLevel = levelStringToEnum[options.level]; - } - if (logCallback === null) { - instance.userLogHandler = null; - } - else { - instance.userLogHandler = function (instance, level) { - var args = []; - for (var _i = 2; _i < arguments.length; _i++) { - args[_i - 2] = arguments[_i]; - } - var message = args - .map(function (arg) { - if (arg == null) { - return null; - } - else if (typeof arg === 'string') { - return arg; - } - else if (typeof arg === 'number' || typeof arg === 'boolean') { - return arg.toString(); - } - else if (arg instanceof Error) { - return arg.message; - } - else { - try { - return JSON.stringify(arg); - } - catch (ignored) { - return null; - } - } - }) - .filter(function (arg) { return arg; }) - .join(' '); - if (level >= (customLogLevel !== null && customLogLevel !== void 0 ? customLogLevel : instance.logLevel)) { - logCallback({ - level: exports.LogLevel[level].toLowerCase(), - message: message, - args: args, - type: instance.name - }); - } - }; - } - }; - for (var _i = 0, instances_1 = instances; _i < instances_1.length; _i++) { - var instance = instances_1[_i]; - _loop_1(instance); - } -} - -exports.Logger = Logger; -exports.setLogLevel = setLogLevel; -exports.setUserLogHandler = setUserLogHandler; -//# sourceMappingURL=index.cjs.js.map diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/logger/dist/index.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/logger/dist/index.d.ts deleted file mode 100644 index 38a7e36d..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/logger/dist/index.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export { setLogLevel, Logger, LogLevel, LogHandler, setUserLogHandler, LogCallback, LogLevelString, LogOptions } from './src/logger'; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/logger/dist/src/logger.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/logger/dist/src/logger.d.ts deleted file mode 100644 index fdbe5e6c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/logger/dist/src/logger.d.ts +++ /dev/null @@ -1,96 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export declare type LogLevelString = 'debug' | 'verbose' | 'info' | 'warn' | 'error' | 'silent'; -export interface LogOptions { - level: LogLevelString; -} -export declare type LogCallback = (callbackParams: LogCallbackParams) => void; -export interface LogCallbackParams { - level: LogLevelString; - message: string; - args: unknown[]; - type: string; -} -/** - * A container for all of the Logger instances - */ -export declare const instances: Logger[]; -/** - * The JS SDK supports 5 log levels and also allows a user the ability to - * silence the logs altogether. - * - * The order is a follows: - * DEBUG < VERBOSE < INFO < WARN < ERROR - * - * All of the log types above the current log level will be captured (i.e. if - * you set the log level to `INFO`, errors will still be logged, but `DEBUG` and - * `VERBOSE` logs will not) - */ -export declare enum LogLevel { - DEBUG = 0, - VERBOSE = 1, - INFO = 2, - WARN = 3, - ERROR = 4, - SILENT = 5 -} -/** - * We allow users the ability to pass their own log handler. We will pass the - * type of log, the current log level, and any other arguments passed (i.e. the - * messages that the user wants to log) to this function. - */ -export declare type LogHandler = (loggerInstance: Logger, logType: LogLevel, ...args: unknown[]) => void; -export declare class Logger { - name: string; - /** - * Gives you an instance of a Logger to capture messages according to - * Firebase's logging scheme. - * - * @param name The name that the logs will be associated with - */ - constructor(name: string); - /** - * The log level of the given Logger instance. - */ - private _logLevel; - get logLevel(): LogLevel; - set logLevel(val: LogLevel); - setLogLevel(val: LogLevel | LogLevelString): void; - /** - * The main (internal) log handler for the Logger instance. - * Can be set to a new function in internal package code but not by user. - */ - private _logHandler; - get logHandler(): LogHandler; - set logHandler(val: LogHandler); - /** - * The optional, additional, user-defined log handler for the Logger instance. - */ - private _userLogHandler; - get userLogHandler(): LogHandler | null; - set userLogHandler(val: LogHandler | null); - /** - * The functions below are all based on the `console` interface - */ - debug(...args: unknown[]): void; - log(...args: unknown[]): void; - info(...args: unknown[]): void; - warn(...args: unknown[]): void; - error(...args: unknown[]): void; -} -export declare function setLogLevel(level: LogLevelString | LogLevel): void; -export declare function setUserLogHandler(logCallback: LogCallback | null, options?: LogOptions): void; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/logger/dist/test/custom-logger.test.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/logger/dist/test/custom-logger.test.d.ts deleted file mode 100644 index 99491857..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/logger/dist/test/custom-logger.test.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export {}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/logger/dist/test/logger.test.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/logger/dist/test/logger.test.d.ts deleted file mode 100644 index 99491857..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/logger/dist/test/logger.test.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export {}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/logger/package.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/logger/package.json deleted file mode 100644 index 587b2144..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/logger/package.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "name": "@firebase/logger", - "version": "0.3.4", - "description": "A logger package for use in the Firebase JS SDK", - "author": "Firebase (https://firebase.google.com/)", - "main": "dist/index.cjs.js", - "module": "dist/esm/index.esm2017.js", - "esm5": "dist/esm/index.esm5.js", - "exports": { - ".": { - "types": "./dist/index.d.ts", - "require": "./dist/index.cjs.js", - "esm5": "./dist/esm/index.esm5.js", - "default": "./dist/esm/index.esm2017.js" - }, - "./package.json": "./package.json" - }, - "files": [ - "dist" - ], - "scripts": { - "lint": "eslint -c .eslintrc.js '**/*.ts' --ignore-path '../../.gitignore'", - "lint:fix": "eslint --fix -c .eslintrc.js '**/*.ts' --ignore-path '../../.gitignore'", - "build": "rollup -c", - "build:deps": "lerna run --scope @firebase/logger --include-dependencies build", - "dev": "rollup -c -w", - "test": "run-p lint test:all", - "test:ci": "node ../../scripts/run_tests_in_ci.js -s test:all", - "test:all": "run-p test:browser test:node", - "test:browser": "karma start --single-run", - "test:browser:debug": "karma start --browsers Chrome --auto-watch", - "test:node": "TS_NODE_COMPILER_OPTIONS='{\"module\":\"commonjs\"}' nyc --reporter lcovonly -- mocha test/**/*.test.* --config ../../config/mocharc.node.js" - }, - "license": "Apache-2.0", - "dependencies": { - "tslib": "^2.1.0" - }, - "devDependencies": { - "rollup": "2.79.1", - "rollup-plugin-typescript2": "0.31.2", - "typescript": "4.2.2" - }, - "repository": { - "directory": "packages/logger", - "type": "git", - "url": "https://github.com/firebase/firebase-js-sdk.git" - }, - "bugs": { - "url": "https://github.com/firebase/firebase-js-sdk/issues" - }, - "typings": "dist/index.d.ts", - "nyc": { - "extension": [ - ".ts" - ], - "reportDir": "./coverage/node" - } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/CHANGELOG.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/CHANGELOG.md deleted file mode 100644 index 7f58b74b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/CHANGELOG.md +++ /dev/null @@ -1,182 +0,0 @@ -# @firebase/util - -## 1.7.3 - -### Patch Changes - -- [`4af28c1a4`](https://github.com/firebase/firebase-js-sdk/commit/4af28c1a42bd25ce2353f694ca1724c6101cbce5) [#6682](https://github.com/firebase/firebase-js-sdk/pull/6682) - Upgrade TypeScript to 4.7.4. - -## 1.7.2 - -### Patch Changes - -- [`807f06aa2`](https://github.com/firebase/firebase-js-sdk/commit/807f06aa26438a91aaea08fd38efb6c706bb8a5d) [#6686](https://github.com/firebase/firebase-js-sdk/pull/6686) (fixes [#6677](https://github.com/firebase/firebase-js-sdk/issues/6677)) - Catch errors when the SDK checks for `__FIREBASE_DEFAULTS__` and do not block other app functionality. - -## 1.7.1 - -### Patch Changes - -- [`171b78b76`](https://github.com/firebase/firebase-js-sdk/commit/171b78b762826a640d267dd4dd172ad9459c4561) [#6673](https://github.com/firebase/firebase-js-sdk/pull/6673) - Handle IPv6 addresses in emulator autoinit. - -* [`29d034072`](https://github.com/firebase/firebase-js-sdk/commit/29d034072c20af394ce384e42aa10a37d5dfcb18) [#6665](https://github.com/firebase/firebase-js-sdk/pull/6665) (fixes [#6660](https://github.com/firebase/firebase-js-sdk/issues/6660)) - Remove `__FIREBASE_DEFAULTS_PATH__` option for now, as the current implementation causes Webpack warnings. Also fix `process.env` check to work in environments where `process` exists but `process.env` does not. - -## 1.7.0 - -### Minor Changes - -- [`fdd4ab464`](https://github.com/firebase/firebase-js-sdk/commit/fdd4ab464b59a107bdcc195df3f01e32efd89ed4) [#6526](https://github.com/firebase/firebase-js-sdk/pull/6526) - Add functionality to auto-initialize project config and emulator settings from global defaults provided by framework tooling. - -## 1.6.3 - -### Patch Changes - -- [`b12af44a5`](https://github.com/firebase/firebase-js-sdk/commit/b12af44a5c7500e1192d6cc1a4afc4d77efadbaf) [#6340](https://github.com/firebase/firebase-js-sdk/pull/6340) (fixes [#6036](https://github.com/firebase/firebase-js-sdk/issues/6036)) - Forced `get()` to wait until db is online to resolve. - -## 1.6.2 - -### Patch Changes - -- [`efe2000fc`](https://github.com/firebase/firebase-js-sdk/commit/efe2000fc499e2c85c4e5e0fef6741ff3bad2eb0) [#6363](https://github.com/firebase/firebase-js-sdk/pull/6363) - Extract uuid function into @firebase/util - -## 1.6.1 - -### Patch Changes - -- [`2cd1cc76f`](https://github.com/firebase/firebase-js-sdk/commit/2cd1cc76f2a308135cd60f424fe09084a34b5cb5) [#6307](https://github.com/firebase/firebase-js-sdk/pull/6307) (fixes [#6300](https://github.com/firebase/firebase-js-sdk/issues/6300)) - fix: add type declarations to exports field - -## 1.6.0 - -### Minor Changes - -- [`9c5c9c36d`](https://github.com/firebase/firebase-js-sdk/commit/9c5c9c36da80b98b73cfd60ef2e2965087e9f801) [#6154](https://github.com/firebase/firebase-js-sdk/pull/6154) - Replace stopgap firebase/util IndexedDB methods with `idb` library. - -## 1.5.2 - -### Patch Changes - -- [`e9e5f6b3c`](https://github.com/firebase/firebase-js-sdk/commit/e9e5f6b3ca9d61323b22f87986d9959f5297ec59) [#6122](https://github.com/firebase/firebase-js-sdk/pull/6122) (fixes [#6121](https://github.com/firebase/firebase-js-sdk/issues/6121)) - Default indexeddb transaction mode to readonly for IE11 compatibility - -## 1.5.1 - -### Patch Changes - -- [`3198d58dc`](https://github.com/firebase/firebase-js-sdk/commit/3198d58dcedbf7583914dbcc76984f6f7df8d2ef) [#6088](https://github.com/firebase/firebase-js-sdk/pull/6088) - Remove unneeded types from public typings file. - -## 1.5.0 - -### Minor Changes - -- [`2d672cead`](https://github.com/firebase/firebase-js-sdk/commit/2d672cead167187cb714cd89b638c0884ba58f03) [#6061](https://github.com/firebase/firebase-js-sdk/pull/6061) - Remove idb dependency and replace with our own code. - -## 1.4.3 - -### Patch Changes - -- [`3b481f572`](https://github.com/firebase/firebase-js-sdk/commit/3b481f572456e1eab3435bfc25717770d95a8c49) [#5831](https://github.com/firebase/firebase-js-sdk/pull/5831) (fixes [#5754](https://github.com/firebase/firebase-js-sdk/issues/5754)) - FirestoreError and StorageError now extend FirebaseError - -## 1.4.2 - -### Patch Changes - -- [`3281315fa`](https://github.com/firebase/firebase-js-sdk/commit/3281315fae9c6f535f9d5052ee17d60861ea569a) [#5708](https://github.com/firebase/firebase-js-sdk/pull/5708) (fixes [#1487](https://github.com/firebase/firebase-js-sdk/issues/1487)) - Update build scripts to work with the exports field - -## 1.4.1 - -### Patch Changes - -- [`2322b6023`](https://github.com/firebase/firebase-js-sdk/commit/2322b6023c628cd9f4f4172767c17d215dd91684) [#5693](https://github.com/firebase/firebase-js-sdk/pull/5693) - Add exports field to all packages - -## 1.4.0 - -### Minor Changes - -- [`a99943fe3`](https://github.com/firebase/firebase-js-sdk/commit/a99943fe3bd5279761aa29d138ec91272b06df39) [#5539](https://github.com/firebase/firebase-js-sdk/pull/5539) - Use esm2017 builds by default - -### Patch Changes - -- [`b835b4cba`](https://github.com/firebase/firebase-js-sdk/commit/b835b4cbabc4b7b180ae38b908c49205ce31a422) [#5506](https://github.com/firebase/firebase-js-sdk/pull/5506) - areCookiesEnabled could encounter runtime errors in certain enviornments - -## 1.3.0 - -### Minor Changes - -- [`3c6a11c8d`](https://github.com/firebase/firebase-js-sdk/commit/3c6a11c8d0b35afddb50e9c3e0c4d2e30f642131) [#5282](https://github.com/firebase/firebase-js-sdk/pull/5282) - Implement mockUserToken for Storage and fix JWT format bugs. - -## 1.2.0 - -### Minor Changes - -- [`a3cbe719b`](https://github.com/firebase/firebase-js-sdk/commit/a3cbe719b1bd733a5c4c15ee0d0e6388d512054c) [#5207](https://github.com/firebase/firebase-js-sdk/pull/5207) - Added deepEqual for comparing objects - -## 1.1.0 - -### Minor Changes - -- [`ac4ad08a2`](https://github.com/firebase/firebase-js-sdk/commit/ac4ad08a284397ec966e991dd388bb1fba857467) [#4792](https://github.com/firebase/firebase-js-sdk/pull/4792) - Add mockUserToken support for database emulator. - -## 1.0.0 - -### Major Changes - -- [`7354a0ed4`](https://github.com/firebase/firebase-js-sdk/commit/7354a0ed438f4e3df6577e4927e8c8f8f1fbbfda) [#4720](https://github.com/firebase/firebase-js-sdk/pull/4720) - Internal changes to Database and Validation APIs. - -## 0.4.1 - -### Patch Changes - -- [`de5f90501`](https://github.com/firebase/firebase-js-sdk/commit/de5f9050137acc9ed1490082e5aa429b5de3cb2a) [#4673](https://github.com/firebase/firebase-js-sdk/pull/4673) - Added a utility function and type for compat interop API - -## 0.4.0 - -### Minor Changes - -- [`ec95df3d0`](https://github.com/firebase/firebase-js-sdk/commit/ec95df3d07e5f091f2a7f7327e46417f64d04b4e) [#4610](https://github.com/firebase/firebase-js-sdk/pull/4610) - Add extractQuerystring() function which extracts the query string part of a URL, including the leading question mark (if present). - -## 0.3.4 - -### Patch Changes - -- [`9cf727fcc`](https://github.com/firebase/firebase-js-sdk/commit/9cf727fcc3d049551b16ae0698ac33dc2fe45ada) [#4001](https://github.com/firebase/firebase-js-sdk/pull/4001) - Do not merge `__proto__` in `deepExtend` to prevent `__proto__` pollution. - -## 0.3.3 - -### Patch Changes - -- [`a5768b0aa`](https://github.com/firebase/firebase-js-sdk/commit/a5768b0aa7d7ce732279931aa436e988c9f36487) [#3932](https://github.com/firebase/firebase-js-sdk/pull/3932) - Point browser field to esm build. Now you need to use default import instead of namespace import to import firebase. - - Before this change - - ``` - import * as firebase from 'firebase/app'; - ``` - - After this change - - ``` - import firebase from 'firebase/app'; - ``` - -* [`7d916d905`](https://github.com/firebase/firebase-js-sdk/commit/7d916d905ba16816ac8ac7c8748c83831ff614ce) [#3946](https://github.com/firebase/firebase-js-sdk/pull/3946) - Write template data to a new `customData` field in`FirebaseError` instead of writing to the error object itself to avoid overwriting existing fields. - -## 0.3.2 - -### Patch Changes - -- [`fb3b095e4`](https://github.com/firebase/firebase-js-sdk/commit/fb3b095e4b7c8f57fdb3172bc039c84576abf290) [#2800](https://github.com/firebase/firebase-js-sdk/pull/2800) - Moved `calculateBackoffMillis()` exponential backoff function from remote-config to util, - where it can be shared between packages. - -## 0.3.1 - -### Patch Changes - -- [`d4ca3da0`](https://github.com/firebase/firebase-js-sdk/commit/d4ca3da0a59fcea1261ba69d7eb663bba38d3089) [#3585](https://github.com/firebase/firebase-js-sdk/pull/3585) - Extended Usage of `isIndexedDBAvailable` to Service Worker - -## 0.3.0 - -### Minor Changes - -- [`a87676b8`](https://github.com/firebase/firebase-js-sdk/commit/a87676b84b78ccc2f057a22eb947a5d13402949c) [#3472](https://github.com/firebase/firebase-js-sdk/pull/3472) - - Fix an error where an analytics PR included a change to `@firebase/util`, but - the util package was not properly included in the changeset for a patch bump. - - - `@firebase/util` adds environment check methods `isIndexedDBAvailable` - `validateIndexedDBOpenable`, and `areCookiesEnabled`. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/README.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/README.md deleted file mode 100644 index b79aeb60..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/README.md +++ /dev/null @@ -1,25 +0,0 @@ -# @firebase/util - -_NOTE: This is specifically tailored for Firebase JS SDK usage, if you are not a -member of the Firebase team, please avoid using this package_ - -This is a wrapper of some Webchannel Features for the Firebase JS SDK. - -## Usage - -**ES Modules** - -```javascript -import { Deferred } from '@firebase/util'; - -// Do stuff with Deferred or any of the other Utils you import -``` - -**CommonJS Modules** - -```javascript -const utils = require('@firebase/util'); - -// Do stuff with any of the re-exported `utils` -``` - diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/index.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/index.d.ts deleted file mode 100644 index 6f847984..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/index.d.ts +++ /dev/null @@ -1,38 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export * from './src/assert'; -export * from './src/crypt'; -export * from './src/constants'; -export * from './src/deepCopy'; -export * from './src/defaults'; -export * from './src/deferred'; -export * from './src/emulator'; -export * from './src/environment'; -export * from './src/errors'; -export * from './src/json'; -export * from './src/jwt'; -export * from './src/obj'; -export * from './src/promise'; -export * from './src/query'; -export * from './src/sha1'; -export * from './src/subscribe'; -export * from './src/validation'; -export * from './src/utf8'; -export * from './src/uuid'; -export * from './src/exponential_backoff'; -export * from './src/formatters'; -export * from './src/compat'; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/index.esm2017.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/index.esm2017.js deleted file mode 100644 index 5ca23b2f..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/index.esm2017.js +++ /dev/null @@ -1,2068 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * @fileoverview Firebase constants. Some of these (@defines) can be overridden at compile-time. - */ -const CONSTANTS = { - /** - * @define {boolean} Whether this is the client Node.js SDK. - */ - NODE_CLIENT: false, - /** - * @define {boolean} Whether this is the Admin Node.js SDK. - */ - NODE_ADMIN: false, - /** - * Firebase SDK Version - */ - SDK_VERSION: '${JSCORE_VERSION}' -}; - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Throws an error if the provided assertion is falsy - */ -const assert = function (assertion, message) { - if (!assertion) { - throw assertionError(message); - } -}; -/** - * Returns an Error object suitable for throwing. - */ -const assertionError = function (message) { - return new Error('Firebase Database (' + - CONSTANTS.SDK_VERSION + - ') INTERNAL ASSERT FAILED: ' + - message); -}; - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -const stringToByteArray$1 = function (str) { - // TODO(user): Use native implementations if/when available - const out = []; - let p = 0; - for (let i = 0; i < str.length; i++) { - let c = str.charCodeAt(i); - if (c < 128) { - out[p++] = c; - } - else if (c < 2048) { - out[p++] = (c >> 6) | 192; - out[p++] = (c & 63) | 128; - } - else if ((c & 0xfc00) === 0xd800 && - i + 1 < str.length && - (str.charCodeAt(i + 1) & 0xfc00) === 0xdc00) { - // Surrogate Pair - c = 0x10000 + ((c & 0x03ff) << 10) + (str.charCodeAt(++i) & 0x03ff); - out[p++] = (c >> 18) | 240; - out[p++] = ((c >> 12) & 63) | 128; - out[p++] = ((c >> 6) & 63) | 128; - out[p++] = (c & 63) | 128; - } - else { - out[p++] = (c >> 12) | 224; - out[p++] = ((c >> 6) & 63) | 128; - out[p++] = (c & 63) | 128; - } - } - return out; -}; -/** - * Turns an array of numbers into the string given by the concatenation of the - * characters to which the numbers correspond. - * @param bytes Array of numbers representing characters. - * @return Stringification of the array. - */ -const byteArrayToString = function (bytes) { - // TODO(user): Use native implementations if/when available - const out = []; - let pos = 0, c = 0; - while (pos < bytes.length) { - const c1 = bytes[pos++]; - if (c1 < 128) { - out[c++] = String.fromCharCode(c1); - } - else if (c1 > 191 && c1 < 224) { - const c2 = bytes[pos++]; - out[c++] = String.fromCharCode(((c1 & 31) << 6) | (c2 & 63)); - } - else if (c1 > 239 && c1 < 365) { - // Surrogate Pair - const c2 = bytes[pos++]; - const c3 = bytes[pos++]; - const c4 = bytes[pos++]; - const u = (((c1 & 7) << 18) | ((c2 & 63) << 12) | ((c3 & 63) << 6) | (c4 & 63)) - - 0x10000; - out[c++] = String.fromCharCode(0xd800 + (u >> 10)); - out[c++] = String.fromCharCode(0xdc00 + (u & 1023)); - } - else { - const c2 = bytes[pos++]; - const c3 = bytes[pos++]; - out[c++] = String.fromCharCode(((c1 & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63)); - } - } - return out.join(''); -}; -// We define it as an object literal instead of a class because a class compiled down to es5 can't -// be treeshaked. https://github.com/rollup/rollup/issues/1691 -// Static lookup maps, lazily populated by init_() -const base64 = { - /** - * Maps bytes to characters. - */ - byteToCharMap_: null, - /** - * Maps characters to bytes. - */ - charToByteMap_: null, - /** - * Maps bytes to websafe characters. - * @private - */ - byteToCharMapWebSafe_: null, - /** - * Maps websafe characters to bytes. - * @private - */ - charToByteMapWebSafe_: null, - /** - * Our default alphabet, shared between - * ENCODED_VALS and ENCODED_VALS_WEBSAFE - */ - ENCODED_VALS_BASE: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' + 'abcdefghijklmnopqrstuvwxyz' + '0123456789', - /** - * Our default alphabet. Value 64 (=) is special; it means "nothing." - */ - get ENCODED_VALS() { - return this.ENCODED_VALS_BASE + '+/='; - }, - /** - * Our websafe alphabet. - */ - get ENCODED_VALS_WEBSAFE() { - return this.ENCODED_VALS_BASE + '-_.'; - }, - /** - * Whether this browser supports the atob and btoa functions. This extension - * started at Mozilla but is now implemented by many browsers. We use the - * ASSUME_* variables to avoid pulling in the full useragent detection library - * but still allowing the standard per-browser compilations. - * - */ - HAS_NATIVE_SUPPORT: typeof atob === 'function', - /** - * Base64-encode an array of bytes. - * - * @param input An array of bytes (numbers with - * value in [0, 255]) to encode. - * @param webSafe Boolean indicating we should use the - * alternative alphabet. - * @return The base64 encoded string. - */ - encodeByteArray(input, webSafe) { - if (!Array.isArray(input)) { - throw Error('encodeByteArray takes an array as a parameter'); - } - this.init_(); - const byteToCharMap = webSafe - ? this.byteToCharMapWebSafe_ - : this.byteToCharMap_; - const output = []; - for (let i = 0; i < input.length; i += 3) { - const byte1 = input[i]; - const haveByte2 = i + 1 < input.length; - const byte2 = haveByte2 ? input[i + 1] : 0; - const haveByte3 = i + 2 < input.length; - const byte3 = haveByte3 ? input[i + 2] : 0; - const outByte1 = byte1 >> 2; - const outByte2 = ((byte1 & 0x03) << 4) | (byte2 >> 4); - let outByte3 = ((byte2 & 0x0f) << 2) | (byte3 >> 6); - let outByte4 = byte3 & 0x3f; - if (!haveByte3) { - outByte4 = 64; - if (!haveByte2) { - outByte3 = 64; - } - } - output.push(byteToCharMap[outByte1], byteToCharMap[outByte2], byteToCharMap[outByte3], byteToCharMap[outByte4]); - } - return output.join(''); - }, - /** - * Base64-encode a string. - * - * @param input A string to encode. - * @param webSafe If true, we should use the - * alternative alphabet. - * @return The base64 encoded string. - */ - encodeString(input, webSafe) { - // Shortcut for Mozilla browsers that implement - // a native base64 encoder in the form of "btoa/atob" - if (this.HAS_NATIVE_SUPPORT && !webSafe) { - return btoa(input); - } - return this.encodeByteArray(stringToByteArray$1(input), webSafe); - }, - /** - * Base64-decode a string. - * - * @param input to decode. - * @param webSafe True if we should use the - * alternative alphabet. - * @return string representing the decoded value. - */ - decodeString(input, webSafe) { - // Shortcut for Mozilla browsers that implement - // a native base64 encoder in the form of "btoa/atob" - if (this.HAS_NATIVE_SUPPORT && !webSafe) { - return atob(input); - } - return byteArrayToString(this.decodeStringToByteArray(input, webSafe)); - }, - /** - * Base64-decode a string. - * - * In base-64 decoding, groups of four characters are converted into three - * bytes. If the encoder did not apply padding, the input length may not - * be a multiple of 4. - * - * In this case, the last group will have fewer than 4 characters, and - * padding will be inferred. If the group has one or two characters, it decodes - * to one byte. If the group has three characters, it decodes to two bytes. - * - * @param input Input to decode. - * @param webSafe True if we should use the web-safe alphabet. - * @return bytes representing the decoded value. - */ - decodeStringToByteArray(input, webSafe) { - this.init_(); - const charToByteMap = webSafe - ? this.charToByteMapWebSafe_ - : this.charToByteMap_; - const output = []; - for (let i = 0; i < input.length;) { - const byte1 = charToByteMap[input.charAt(i++)]; - const haveByte2 = i < input.length; - const byte2 = haveByte2 ? charToByteMap[input.charAt(i)] : 0; - ++i; - const haveByte3 = i < input.length; - const byte3 = haveByte3 ? charToByteMap[input.charAt(i)] : 64; - ++i; - const haveByte4 = i < input.length; - const byte4 = haveByte4 ? charToByteMap[input.charAt(i)] : 64; - ++i; - if (byte1 == null || byte2 == null || byte3 == null || byte4 == null) { - throw Error(); - } - const outByte1 = (byte1 << 2) | (byte2 >> 4); - output.push(outByte1); - if (byte3 !== 64) { - const outByte2 = ((byte2 << 4) & 0xf0) | (byte3 >> 2); - output.push(outByte2); - if (byte4 !== 64) { - const outByte3 = ((byte3 << 6) & 0xc0) | byte4; - output.push(outByte3); - } - } - } - return output; - }, - /** - * Lazy static initialization function. Called before - * accessing any of the static map variables. - * @private - */ - init_() { - if (!this.byteToCharMap_) { - this.byteToCharMap_ = {}; - this.charToByteMap_ = {}; - this.byteToCharMapWebSafe_ = {}; - this.charToByteMapWebSafe_ = {}; - // We want quick mappings back and forth, so we precompute two maps. - for (let i = 0; i < this.ENCODED_VALS.length; i++) { - this.byteToCharMap_[i] = this.ENCODED_VALS.charAt(i); - this.charToByteMap_[this.byteToCharMap_[i]] = i; - this.byteToCharMapWebSafe_[i] = this.ENCODED_VALS_WEBSAFE.charAt(i); - this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[i]] = i; - // Be forgiving when decoding and correctly decode both encodings. - if (i >= this.ENCODED_VALS_BASE.length) { - this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(i)] = i; - this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(i)] = i; - } - } - } - } -}; -/** - * URL-safe base64 encoding - */ -const base64Encode = function (str) { - const utf8Bytes = stringToByteArray$1(str); - return base64.encodeByteArray(utf8Bytes, true); -}; -/** - * URL-safe base64 encoding (without "." padding in the end). - * e.g. Used in JSON Web Token (JWT) parts. - */ -const base64urlEncodeWithoutPadding = function (str) { - // Use base64url encoding and remove padding in the end (dot characters). - return base64Encode(str).replace(/\./g, ''); -}; -/** - * URL-safe base64 decoding - * - * NOTE: DO NOT use the global atob() function - it does NOT support the - * base64Url variant encoding. - * - * @param str To be decoded - * @return Decoded result, if possible - */ -const base64Decode = function (str) { - try { - return base64.decodeString(str, true); - } - catch (e) { - console.error('base64Decode failed: ', e); - } - return null; -}; - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Do a deep-copy of basic JavaScript Objects or Arrays. - */ -function deepCopy(value) { - return deepExtend(undefined, value); -} -/** - * Copy properties from source to target (recursively allows extension - * of Objects and Arrays). Scalar values in the target are over-written. - * If target is undefined, an object of the appropriate type will be created - * (and returned). - * - * We recursively copy all child properties of plain Objects in the source- so - * that namespace- like dictionaries are merged. - * - * Note that the target can be a function, in which case the properties in - * the source Object are copied onto it as static properties of the Function. - * - * Note: we don't merge __proto__ to prevent prototype pollution - */ -function deepExtend(target, source) { - if (!(source instanceof Object)) { - return source; - } - switch (source.constructor) { - case Date: - // Treat Dates like scalars; if the target date object had any child - // properties - they will be lost! - const dateValue = source; - return new Date(dateValue.getTime()); - case Object: - if (target === undefined) { - target = {}; - } - break; - case Array: - // Always copy the array source and overwrite the target. - target = []; - break; - default: - // Not a plain Object - treat it as a scalar. - return source; - } - for (const prop in source) { - // use isValidKey to guard against prototype pollution. See https://snyk.io/vuln/SNYK-JS-LODASH-450202 - if (!source.hasOwnProperty(prop) || !isValidKey(prop)) { - continue; - } - target[prop] = deepExtend(target[prop], source[prop]); - } - return target; -} -function isValidKey(key) { - return key !== '__proto__'; -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Returns navigator.userAgent string or '' if it's not defined. - * @return user agent string - */ -function getUA() { - if (typeof navigator !== 'undefined' && - typeof navigator['userAgent'] === 'string') { - return navigator['userAgent']; - } - else { - return ''; - } -} -/** - * Detect Cordova / PhoneGap / Ionic frameworks on a mobile device. - * - * Deliberately does not rely on checking `file://` URLs (as this fails PhoneGap - * in the Ripple emulator) nor Cordova `onDeviceReady`, which would normally - * wait for a callback. - */ -function isMobileCordova() { - return (typeof window !== 'undefined' && - // @ts-ignore Setting up an broadly applicable index signature for Window - // just to deal with this case would probably be a bad idea. - !!(window['cordova'] || window['phonegap'] || window['PhoneGap']) && - /ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(getUA())); -} -/** - * Detect Node.js. - * - * @return true if Node.js environment is detected. - */ -// Node detection logic from: https://github.com/iliakan/detect-node/ -function isNode() { - try { - return (Object.prototype.toString.call(global.process) === '[object process]'); - } - catch (e) { - return false; - } -} -/** - * Detect Browser Environment - */ -function isBrowser() { - return typeof self === 'object' && self.self === self; -} -function isBrowserExtension() { - const runtime = typeof chrome === 'object' - ? chrome.runtime - : typeof browser === 'object' - ? browser.runtime - : undefined; - return typeof runtime === 'object' && runtime.id !== undefined; -} -/** - * Detect React Native. - * - * @return true if ReactNative environment is detected. - */ -function isReactNative() { - return (typeof navigator === 'object' && navigator['product'] === 'ReactNative'); -} -/** Detects Electron apps. */ -function isElectron() { - return getUA().indexOf('Electron/') >= 0; -} -/** Detects Internet Explorer. */ -function isIE() { - const ua = getUA(); - return ua.indexOf('MSIE ') >= 0 || ua.indexOf('Trident/') >= 0; -} -/** Detects Universal Windows Platform apps. */ -function isUWP() { - return getUA().indexOf('MSAppHost/') >= 0; -} -/** - * Detect whether the current SDK build is the Node version. - * - * @return true if it's the Node SDK build. - */ -function isNodeSdk() { - return CONSTANTS.NODE_CLIENT === true || CONSTANTS.NODE_ADMIN === true; -} -/** Returns true if we are running in Safari. */ -function isSafari() { - return (!isNode() && - navigator.userAgent.includes('Safari') && - !navigator.userAgent.includes('Chrome')); -} -/** - * This method checks if indexedDB is supported by current browser/service worker context - * @return true if indexedDB is supported by current browser/service worker context - */ -function isIndexedDBAvailable() { - return typeof indexedDB === 'object'; -} -/** - * This method validates browser/sw context for indexedDB by opening a dummy indexedDB database and reject - * if errors occur during the database open operation. - * - * @throws exception if current browser/sw context can't run idb.open (ex: Safari iframe, Firefox - * private browsing) - */ -function validateIndexedDBOpenable() { - return new Promise((resolve, reject) => { - try { - let preExist = true; - const DB_CHECK_NAME = 'validate-browser-context-for-indexeddb-analytics-module'; - const request = self.indexedDB.open(DB_CHECK_NAME); - request.onsuccess = () => { - request.result.close(); - // delete database only when it doesn't pre-exist - if (!preExist) { - self.indexedDB.deleteDatabase(DB_CHECK_NAME); - } - resolve(true); - }; - request.onupgradeneeded = () => { - preExist = false; - }; - request.onerror = () => { - var _a; - reject(((_a = request.error) === null || _a === void 0 ? void 0 : _a.message) || ''); - }; - } - catch (error) { - reject(error); - } - }); -} -/** - * - * This method checks whether cookie is enabled within current browser - * @return true if cookie is enabled within current browser - */ -function areCookiesEnabled() { - if (typeof navigator === 'undefined' || !navigator.cookieEnabled) { - return false; - } - return true; -} -/** - * Polyfill for `globalThis` object. - * @returns the `globalThis` object for the given environment. - */ -function getGlobal() { - if (typeof self !== 'undefined') { - return self; - } - if (typeof window !== 'undefined') { - return window; - } - if (typeof global !== 'undefined') { - return global; - } - throw new Error('Unable to locate global object.'); -} - -/** - * @license - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -const getDefaultsFromGlobal = () => getGlobal().__FIREBASE_DEFAULTS__; -/** - * Attempt to read defaults from a JSON string provided to - * process.env.__FIREBASE_DEFAULTS__ or a JSON file whose path is in - * process.env.__FIREBASE_DEFAULTS_PATH__ - */ -const getDefaultsFromEnvVariable = () => { - if (typeof process === 'undefined' || typeof process.env === 'undefined') { - return; - } - const defaultsJsonString = process.env.__FIREBASE_DEFAULTS__; - if (defaultsJsonString) { - return JSON.parse(defaultsJsonString); - } -}; -const getDefaultsFromCookie = () => { - if (typeof document === 'undefined') { - return; - } - let match; - try { - match = document.cookie.match(/__FIREBASE_DEFAULTS__=([^;]+)/); - } - catch (e) { - // Some environments such as Angular Universal SSR have a - // `document` object but error on accessing `document.cookie`. - return; - } - const decoded = match && base64Decode(match[1]); - return decoded && JSON.parse(decoded); -}; -/** - * Get the __FIREBASE_DEFAULTS__ object. It checks in order: - * (1) if such an object exists as a property of `globalThis` - * (2) if such an object was provided on a shell environment variable - * (3) if such an object exists in a cookie - */ -const getDefaults = () => { - try { - return (getDefaultsFromGlobal() || - getDefaultsFromEnvVariable() || - getDefaultsFromCookie()); - } - catch (e) { - /** - * Catch-all for being unable to get __FIREBASE_DEFAULTS__ due - * to any environment case we have not accounted for. Log to - * info instead of swallowing so we can find these unknown cases - * and add paths for them if needed. - */ - console.info(`Unable to get __FIREBASE_DEFAULTS__ due to: ${e}`); - return; - } -}; -/** - * Returns emulator host stored in the __FIREBASE_DEFAULTS__ object - * for the given product. - * @returns a URL host formatted like `127.0.0.1:9999` or `[::1]:4000` if available - * @public - */ -const getDefaultEmulatorHost = (productName) => { var _a, _b; return (_b = (_a = getDefaults()) === null || _a === void 0 ? void 0 : _a.emulatorHosts) === null || _b === void 0 ? void 0 : _b[productName]; }; -/** - * Returns emulator hostname and port stored in the __FIREBASE_DEFAULTS__ object - * for the given product. - * @returns a pair of hostname and port like `["::1", 4000]` if available - * @public - */ -const getDefaultEmulatorHostnameAndPort = (productName) => { - const host = getDefaultEmulatorHost(productName); - if (!host) { - return undefined; - } - const separatorIndex = host.lastIndexOf(':'); // Finding the last since IPv6 addr also has colons. - if (separatorIndex <= 0 || separatorIndex + 1 === host.length) { - throw new Error(`Invalid host ${host} with no separate hostname and port!`); - } - // eslint-disable-next-line no-restricted-globals - const port = parseInt(host.substring(separatorIndex + 1), 10); - if (host[0] === '[') { - // Bracket-quoted `[ipv6addr]:port` => return "ipv6addr" (without brackets). - return [host.substring(1, separatorIndex - 1), port]; - } - else { - return [host.substring(0, separatorIndex), port]; - } -}; -/** - * Returns Firebase app config stored in the __FIREBASE_DEFAULTS__ object. - * @public - */ -const getDefaultAppConfig = () => { var _a; return (_a = getDefaults()) === null || _a === void 0 ? void 0 : _a.config; }; -/** - * Returns an experimental setting on the __FIREBASE_DEFAULTS__ object (properties - * prefixed by "_") - * @public - */ -const getExperimentalSetting = (name) => { var _a; return (_a = getDefaults()) === null || _a === void 0 ? void 0 : _a[`_${name}`]; }; - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -class Deferred { - constructor() { - this.reject = () => { }; - this.resolve = () => { }; - this.promise = new Promise((resolve, reject) => { - this.resolve = resolve; - this.reject = reject; - }); - } - /** - * Our API internals are not promiseified and cannot because our callback APIs have subtle expectations around - * invoking promises inline, which Promises are forbidden to do. This method accepts an optional node-style callback - * and returns a node-style callback which will resolve or reject the Deferred's promise. - */ - wrapCallback(callback) { - return (error, value) => { - if (error) { - this.reject(error); - } - else { - this.resolve(value); - } - if (typeof callback === 'function') { - // Attaching noop handler just in case developer wasn't expecting - // promises - this.promise.catch(() => { }); - // Some of our callbacks don't expect a value and our own tests - // assert that the parameter length is 1 - if (callback.length === 1) { - callback(error); - } - else { - callback(error, value); - } - } - }; - } -} - -/** - * @license - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -function createMockUserToken(token, projectId) { - if (token.uid) { - throw new Error('The "uid" field is no longer supported by mockUserToken. Please use "sub" instead for Firebase Auth User ID.'); - } - // Unsecured JWTs use "none" as the algorithm. - const header = { - alg: 'none', - type: 'JWT' - }; - const project = projectId || 'demo-project'; - const iat = token.iat || 0; - const sub = token.sub || token.user_id; - if (!sub) { - throw new Error("mockUserToken must contain 'sub' or 'user_id' field!"); - } - const payload = Object.assign({ - // Set all required fields to decent defaults - iss: `https://securetoken.google.com/${project}`, aud: project, iat, exp: iat + 3600, auth_time: iat, sub, user_id: sub, firebase: { - sign_in_provider: 'custom', - identities: {} - } }, token); - // Unsecured JWTs use the empty string as a signature. - const signature = ''; - return [ - base64urlEncodeWithoutPadding(JSON.stringify(header)), - base64urlEncodeWithoutPadding(JSON.stringify(payload)), - signature - ].join('.'); -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * @fileoverview Standardized Firebase Error. - * - * Usage: - * - * // Typescript string literals for type-safe codes - * type Err = - * 'unknown' | - * 'object-not-found' - * ; - * - * // Closure enum for type-safe error codes - * // at-enum {string} - * var Err = { - * UNKNOWN: 'unknown', - * OBJECT_NOT_FOUND: 'object-not-found', - * } - * - * let errors: Map = { - * 'generic-error': "Unknown error", - * 'file-not-found': "Could not find file: {$file}", - * }; - * - * // Type-safe function - must pass a valid error code as param. - * let error = new ErrorFactory('service', 'Service', errors); - * - * ... - * throw error.create(Err.GENERIC); - * ... - * throw error.create(Err.FILE_NOT_FOUND, {'file': fileName}); - * ... - * // Service: Could not file file: foo.txt (service/file-not-found). - * - * catch (e) { - * assert(e.message === "Could not find file: foo.txt."); - * if ((e as FirebaseError)?.code === 'service/file-not-found') { - * console.log("Could not read file: " + e['file']); - * } - * } - */ -const ERROR_NAME = 'FirebaseError'; -// Based on code from: -// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error#Custom_Error_Types -class FirebaseError extends Error { - constructor( - /** The error code for this error. */ - code, message, - /** Custom data for this error. */ - customData) { - super(message); - this.code = code; - this.customData = customData; - /** The custom name for all FirebaseErrors. */ - this.name = ERROR_NAME; - // Fix For ES5 - // https://github.com/Microsoft/TypeScript-wiki/blob/master/Breaking-Changes.md#extending-built-ins-like-error-array-and-map-may-no-longer-work - Object.setPrototypeOf(this, FirebaseError.prototype); - // Maintains proper stack trace for where our error was thrown. - // Only available on V8. - if (Error.captureStackTrace) { - Error.captureStackTrace(this, ErrorFactory.prototype.create); - } - } -} -class ErrorFactory { - constructor(service, serviceName, errors) { - this.service = service; - this.serviceName = serviceName; - this.errors = errors; - } - create(code, ...data) { - const customData = data[0] || {}; - const fullCode = `${this.service}/${code}`; - const template = this.errors[code]; - const message = template ? replaceTemplate(template, customData) : 'Error'; - // Service Name: Error message (service/code). - const fullMessage = `${this.serviceName}: ${message} (${fullCode}).`; - const error = new FirebaseError(fullCode, fullMessage, customData); - return error; - } -} -function replaceTemplate(template, data) { - return template.replace(PATTERN, (_, key) => { - const value = data[key]; - return value != null ? String(value) : `<${key}?>`; - }); -} -const PATTERN = /\{\$([^}]+)}/g; - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Evaluates a JSON string into a javascript object. - * - * @param {string} str A string containing JSON. - * @return {*} The javascript object representing the specified JSON. - */ -function jsonEval(str) { - return JSON.parse(str); -} -/** - * Returns JSON representing a javascript object. - * @param {*} data Javascript object to be stringified. - * @return {string} The JSON contents of the object. - */ -function stringify(data) { - return JSON.stringify(data); -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Decodes a Firebase auth. token into constituent parts. - * - * Notes: - * - May return with invalid / incomplete claims if there's no native base64 decoding support. - * - Doesn't check if the token is actually valid. - */ -const decode = function (token) { - let header = {}, claims = {}, data = {}, signature = ''; - try { - const parts = token.split('.'); - header = jsonEval(base64Decode(parts[0]) || ''); - claims = jsonEval(base64Decode(parts[1]) || ''); - signature = parts[2]; - data = claims['d'] || {}; - delete claims['d']; - } - catch (e) { } - return { - header, - claims, - data, - signature - }; -}; -/** - * Decodes a Firebase auth. token and checks the validity of its time-based claims. Will return true if the - * token is within the time window authorized by the 'nbf' (not-before) and 'iat' (issued-at) claims. - * - * Notes: - * - May return a false negative if there's no native base64 decoding support. - * - Doesn't check if the token is actually valid. - */ -const isValidTimestamp = function (token) { - const claims = decode(token).claims; - const now = Math.floor(new Date().getTime() / 1000); - let validSince = 0, validUntil = 0; - if (typeof claims === 'object') { - if (claims.hasOwnProperty('nbf')) { - validSince = claims['nbf']; - } - else if (claims.hasOwnProperty('iat')) { - validSince = claims['iat']; - } - if (claims.hasOwnProperty('exp')) { - validUntil = claims['exp']; - } - else { - // token will expire after 24h by default - validUntil = validSince + 86400; - } - } - return (!!now && - !!validSince && - !!validUntil && - now >= validSince && - now <= validUntil); -}; -/** - * Decodes a Firebase auth. token and returns its issued at time if valid, null otherwise. - * - * Notes: - * - May return null if there's no native base64 decoding support. - * - Doesn't check if the token is actually valid. - */ -const issuedAtTime = function (token) { - const claims = decode(token).claims; - if (typeof claims === 'object' && claims.hasOwnProperty('iat')) { - return claims['iat']; - } - return null; -}; -/** - * Decodes a Firebase auth. token and checks the validity of its format. Expects a valid issued-at time. - * - * Notes: - * - May return a false negative if there's no native base64 decoding support. - * - Doesn't check if the token is actually valid. - */ -const isValidFormat = function (token) { - const decoded = decode(token), claims = decoded.claims; - return !!claims && typeof claims === 'object' && claims.hasOwnProperty('iat'); -}; -/** - * Attempts to peer into an auth token and determine if it's an admin auth token by looking at the claims portion. - * - * Notes: - * - May return a false negative if there's no native base64 decoding support. - * - Doesn't check if the token is actually valid. - */ -const isAdmin = function (token) { - const claims = decode(token).claims; - return typeof claims === 'object' && claims['admin'] === true; -}; - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -function contains(obj, key) { - return Object.prototype.hasOwnProperty.call(obj, key); -} -function safeGet(obj, key) { - if (Object.prototype.hasOwnProperty.call(obj, key)) { - return obj[key]; - } - else { - return undefined; - } -} -function isEmpty(obj) { - for (const key in obj) { - if (Object.prototype.hasOwnProperty.call(obj, key)) { - return false; - } - } - return true; -} -function map(obj, fn, contextObj) { - const res = {}; - for (const key in obj) { - if (Object.prototype.hasOwnProperty.call(obj, key)) { - res[key] = fn.call(contextObj, obj[key], key, obj); - } - } - return res; -} -/** - * Deep equal two objects. Support Arrays and Objects. - */ -function deepEqual(a, b) { - if (a === b) { - return true; - } - const aKeys = Object.keys(a); - const bKeys = Object.keys(b); - for (const k of aKeys) { - if (!bKeys.includes(k)) { - return false; - } - const aProp = a[k]; - const bProp = b[k]; - if (isObject(aProp) && isObject(bProp)) { - if (!deepEqual(aProp, bProp)) { - return false; - } - } - else if (aProp !== bProp) { - return false; - } - } - for (const k of bKeys) { - if (!aKeys.includes(k)) { - return false; - } - } - return true; -} -function isObject(thing) { - return thing !== null && typeof thing === 'object'; -} - -/** - * @license - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Rejects if the given promise doesn't resolve in timeInMS milliseconds. - * @internal - */ -function promiseWithTimeout(promise, timeInMS = 2000) { - const deferredPromise = new Deferred(); - setTimeout(() => deferredPromise.reject('timeout!'), timeInMS); - promise.then(deferredPromise.resolve, deferredPromise.reject); - return deferredPromise.promise; -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Returns a querystring-formatted string (e.g. &arg=val&arg2=val2) from a - * params object (e.g. {arg: 'val', arg2: 'val2'}) - * Note: You must prepend it with ? when adding it to a URL. - */ -function querystring(querystringParams) { - const params = []; - for (const [key, value] of Object.entries(querystringParams)) { - if (Array.isArray(value)) { - value.forEach(arrayVal => { - params.push(encodeURIComponent(key) + '=' + encodeURIComponent(arrayVal)); - }); - } - else { - params.push(encodeURIComponent(key) + '=' + encodeURIComponent(value)); - } - } - return params.length ? '&' + params.join('&') : ''; -} -/** - * Decodes a querystring (e.g. ?arg=val&arg2=val2) into a params object - * (e.g. {arg: 'val', arg2: 'val2'}) - */ -function querystringDecode(querystring) { - const obj = {}; - const tokens = querystring.replace(/^\?/, '').split('&'); - tokens.forEach(token => { - if (token) { - const [key, value] = token.split('='); - obj[decodeURIComponent(key)] = decodeURIComponent(value); - } - }); - return obj; -} -/** - * Extract the query string part of a URL, including the leading question mark (if present). - */ -function extractQuerystring(url) { - const queryStart = url.indexOf('?'); - if (!queryStart) { - return ''; - } - const fragmentStart = url.indexOf('#', queryStart); - return url.substring(queryStart, fragmentStart > 0 ? fragmentStart : undefined); -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * @fileoverview SHA-1 cryptographic hash. - * Variable names follow the notation in FIPS PUB 180-3: - * http://csrc.nist.gov/publications/fips/fips180-3/fips180-3_final.pdf. - * - * Usage: - * var sha1 = new sha1(); - * sha1.update(bytes); - * var hash = sha1.digest(); - * - * Performance: - * Chrome 23: ~400 Mbit/s - * Firefox 16: ~250 Mbit/s - * - */ -/** - * SHA-1 cryptographic hash constructor. - * - * The properties declared here are discussed in the above algorithm document. - * @constructor - * @final - * @struct - */ -class Sha1 { - constructor() { - /** - * Holds the previous values of accumulated variables a-e in the compress_ - * function. - * @private - */ - this.chain_ = []; - /** - * A buffer holding the partially computed hash result. - * @private - */ - this.buf_ = []; - /** - * An array of 80 bytes, each a part of the message to be hashed. Referred to - * as the message schedule in the docs. - * @private - */ - this.W_ = []; - /** - * Contains data needed to pad messages less than 64 bytes. - * @private - */ - this.pad_ = []; - /** - * @private {number} - */ - this.inbuf_ = 0; - /** - * @private {number} - */ - this.total_ = 0; - this.blockSize = 512 / 8; - this.pad_[0] = 128; - for (let i = 1; i < this.blockSize; ++i) { - this.pad_[i] = 0; - } - this.reset(); - } - reset() { - this.chain_[0] = 0x67452301; - this.chain_[1] = 0xefcdab89; - this.chain_[2] = 0x98badcfe; - this.chain_[3] = 0x10325476; - this.chain_[4] = 0xc3d2e1f0; - this.inbuf_ = 0; - this.total_ = 0; - } - /** - * Internal compress helper function. - * @param buf Block to compress. - * @param offset Offset of the block in the buffer. - * @private - */ - compress_(buf, offset) { - if (!offset) { - offset = 0; - } - const W = this.W_; - // get 16 big endian words - if (typeof buf === 'string') { - for (let i = 0; i < 16; i++) { - // TODO(user): [bug 8140122] Recent versions of Safari for Mac OS and iOS - // have a bug that turns the post-increment ++ operator into pre-increment - // during JIT compilation. We have code that depends heavily on SHA-1 for - // correctness and which is affected by this bug, so I've removed all uses - // of post-increment ++ in which the result value is used. We can revert - // this change once the Safari bug - // (https://bugs.webkit.org/show_bug.cgi?id=109036) has been fixed and - // most clients have been updated. - W[i] = - (buf.charCodeAt(offset) << 24) | - (buf.charCodeAt(offset + 1) << 16) | - (buf.charCodeAt(offset + 2) << 8) | - buf.charCodeAt(offset + 3); - offset += 4; - } - } - else { - for (let i = 0; i < 16; i++) { - W[i] = - (buf[offset] << 24) | - (buf[offset + 1] << 16) | - (buf[offset + 2] << 8) | - buf[offset + 3]; - offset += 4; - } - } - // expand to 80 words - for (let i = 16; i < 80; i++) { - const t = W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16]; - W[i] = ((t << 1) | (t >>> 31)) & 0xffffffff; - } - let a = this.chain_[0]; - let b = this.chain_[1]; - let c = this.chain_[2]; - let d = this.chain_[3]; - let e = this.chain_[4]; - let f, k; - // TODO(user): Try to unroll this loop to speed up the computation. - for (let i = 0; i < 80; i++) { - if (i < 40) { - if (i < 20) { - f = d ^ (b & (c ^ d)); - k = 0x5a827999; - } - else { - f = b ^ c ^ d; - k = 0x6ed9eba1; - } - } - else { - if (i < 60) { - f = (b & c) | (d & (b | c)); - k = 0x8f1bbcdc; - } - else { - f = b ^ c ^ d; - k = 0xca62c1d6; - } - } - const t = (((a << 5) | (a >>> 27)) + f + e + k + W[i]) & 0xffffffff; - e = d; - d = c; - c = ((b << 30) | (b >>> 2)) & 0xffffffff; - b = a; - a = t; - } - this.chain_[0] = (this.chain_[0] + a) & 0xffffffff; - this.chain_[1] = (this.chain_[1] + b) & 0xffffffff; - this.chain_[2] = (this.chain_[2] + c) & 0xffffffff; - this.chain_[3] = (this.chain_[3] + d) & 0xffffffff; - this.chain_[4] = (this.chain_[4] + e) & 0xffffffff; - } - update(bytes, length) { - // TODO(johnlenz): tighten the function signature and remove this check - if (bytes == null) { - return; - } - if (length === undefined) { - length = bytes.length; - } - const lengthMinusBlock = length - this.blockSize; - let n = 0; - // Using local instead of member variables gives ~5% speedup on Firefox 16. - const buf = this.buf_; - let inbuf = this.inbuf_; - // The outer while loop should execute at most twice. - while (n < length) { - // When we have no data in the block to top up, we can directly process the - // input buffer (assuming it contains sufficient data). This gives ~25% - // speedup on Chrome 23 and ~15% speedup on Firefox 16, but requires that - // the data is provided in large chunks (or in multiples of 64 bytes). - if (inbuf === 0) { - while (n <= lengthMinusBlock) { - this.compress_(bytes, n); - n += this.blockSize; - } - } - if (typeof bytes === 'string') { - while (n < length) { - buf[inbuf] = bytes.charCodeAt(n); - ++inbuf; - ++n; - if (inbuf === this.blockSize) { - this.compress_(buf); - inbuf = 0; - // Jump to the outer loop so we use the full-block optimization. - break; - } - } - } - else { - while (n < length) { - buf[inbuf] = bytes[n]; - ++inbuf; - ++n; - if (inbuf === this.blockSize) { - this.compress_(buf); - inbuf = 0; - // Jump to the outer loop so we use the full-block optimization. - break; - } - } - } - } - this.inbuf_ = inbuf; - this.total_ += length; - } - /** @override */ - digest() { - const digest = []; - let totalBits = this.total_ * 8; - // Add pad 0x80 0x00*. - if (this.inbuf_ < 56) { - this.update(this.pad_, 56 - this.inbuf_); - } - else { - this.update(this.pad_, this.blockSize - (this.inbuf_ - 56)); - } - // Add # bits. - for (let i = this.blockSize - 1; i >= 56; i--) { - this.buf_[i] = totalBits & 255; - totalBits /= 256; // Don't use bit-shifting here! - } - this.compress_(this.buf_); - let n = 0; - for (let i = 0; i < 5; i++) { - for (let j = 24; j >= 0; j -= 8) { - digest[n] = (this.chain_[i] >> j) & 255; - ++n; - } - } - return digest; - } -} - -/** - * Helper to make a Subscribe function (just like Promise helps make a - * Thenable). - * - * @param executor Function which can make calls to a single Observer - * as a proxy. - * @param onNoObservers Callback when count of Observers goes to zero. - */ -function createSubscribe(executor, onNoObservers) { - const proxy = new ObserverProxy(executor, onNoObservers); - return proxy.subscribe.bind(proxy); -} -/** - * Implement fan-out for any number of Observers attached via a subscribe - * function. - */ -class ObserverProxy { - /** - * @param executor Function which can make calls to a single Observer - * as a proxy. - * @param onNoObservers Callback when count of Observers goes to zero. - */ - constructor(executor, onNoObservers) { - this.observers = []; - this.unsubscribes = []; - this.observerCount = 0; - // Micro-task scheduling by calling task.then(). - this.task = Promise.resolve(); - this.finalized = false; - this.onNoObservers = onNoObservers; - // Call the executor asynchronously so subscribers that are called - // synchronously after the creation of the subscribe function - // can still receive the very first value generated in the executor. - this.task - .then(() => { - executor(this); - }) - .catch(e => { - this.error(e); - }); - } - next(value) { - this.forEachObserver((observer) => { - observer.next(value); - }); - } - error(error) { - this.forEachObserver((observer) => { - observer.error(error); - }); - this.close(error); - } - complete() { - this.forEachObserver((observer) => { - observer.complete(); - }); - this.close(); - } - /** - * Subscribe function that can be used to add an Observer to the fan-out list. - * - * - We require that no event is sent to a subscriber sychronously to their - * call to subscribe(). - */ - subscribe(nextOrObserver, error, complete) { - let observer; - if (nextOrObserver === undefined && - error === undefined && - complete === undefined) { - throw new Error('Missing Observer.'); - } - // Assemble an Observer object when passed as callback functions. - if (implementsAnyMethods(nextOrObserver, [ - 'next', - 'error', - 'complete' - ])) { - observer = nextOrObserver; - } - else { - observer = { - next: nextOrObserver, - error, - complete - }; - } - if (observer.next === undefined) { - observer.next = noop; - } - if (observer.error === undefined) { - observer.error = noop; - } - if (observer.complete === undefined) { - observer.complete = noop; - } - const unsub = this.unsubscribeOne.bind(this, this.observers.length); - // Attempt to subscribe to a terminated Observable - we - // just respond to the Observer with the final error or complete - // event. - if (this.finalized) { - // eslint-disable-next-line @typescript-eslint/no-floating-promises - this.task.then(() => { - try { - if (this.finalError) { - observer.error(this.finalError); - } - else { - observer.complete(); - } - } - catch (e) { - // nothing - } - return; - }); - } - this.observers.push(observer); - return unsub; - } - // Unsubscribe is synchronous - we guarantee that no events are sent to - // any unsubscribed Observer. - unsubscribeOne(i) { - if (this.observers === undefined || this.observers[i] === undefined) { - return; - } - delete this.observers[i]; - this.observerCount -= 1; - if (this.observerCount === 0 && this.onNoObservers !== undefined) { - this.onNoObservers(this); - } - } - forEachObserver(fn) { - if (this.finalized) { - // Already closed by previous event....just eat the additional values. - return; - } - // Since sendOne calls asynchronously - there is no chance that - // this.observers will become undefined. - for (let i = 0; i < this.observers.length; i++) { - this.sendOne(i, fn); - } - } - // Call the Observer via one of it's callback function. We are careful to - // confirm that the observe has not been unsubscribed since this asynchronous - // function had been queued. - sendOne(i, fn) { - // Execute the callback asynchronously - // eslint-disable-next-line @typescript-eslint/no-floating-promises - this.task.then(() => { - if (this.observers !== undefined && this.observers[i] !== undefined) { - try { - fn(this.observers[i]); - } - catch (e) { - // Ignore exceptions raised in Observers or missing methods of an - // Observer. - // Log error to console. b/31404806 - if (typeof console !== 'undefined' && console.error) { - console.error(e); - } - } - } - }); - } - close(err) { - if (this.finalized) { - return; - } - this.finalized = true; - if (err !== undefined) { - this.finalError = err; - } - // Proxy is no longer needed - garbage collect references - // eslint-disable-next-line @typescript-eslint/no-floating-promises - this.task.then(() => { - this.observers = undefined; - this.onNoObservers = undefined; - }); - } -} -/** Turn synchronous function into one called asynchronously. */ -// eslint-disable-next-line @typescript-eslint/ban-types -function async(fn, onError) { - return (...args) => { - Promise.resolve(true) - .then(() => { - fn(...args); - }) - .catch((error) => { - if (onError) { - onError(error); - } - }); - }; -} -/** - * Return true if the object passed in implements any of the named methods. - */ -function implementsAnyMethods(obj, methods) { - if (typeof obj !== 'object' || obj === null) { - return false; - } - for (const method of methods) { - if (method in obj && typeof obj[method] === 'function') { - return true; - } - } - return false; -} -function noop() { - // do nothing -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Check to make sure the appropriate number of arguments are provided for a public function. - * Throws an error if it fails. - * - * @param fnName The function name - * @param minCount The minimum number of arguments to allow for the function call - * @param maxCount The maximum number of argument to allow for the function call - * @param argCount The actual number of arguments provided. - */ -const validateArgCount = function (fnName, minCount, maxCount, argCount) { - let argError; - if (argCount < minCount) { - argError = 'at least ' + minCount; - } - else if (argCount > maxCount) { - argError = maxCount === 0 ? 'none' : 'no more than ' + maxCount; - } - if (argError) { - const error = fnName + - ' failed: Was called with ' + - argCount + - (argCount === 1 ? ' argument.' : ' arguments.') + - ' Expects ' + - argError + - '.'; - throw new Error(error); - } -}; -/** - * Generates a string to prefix an error message about failed argument validation - * - * @param fnName The function name - * @param argName The name of the argument - * @return The prefix to add to the error thrown for validation. - */ -function errorPrefix(fnName, argName) { - return `${fnName} failed: ${argName} argument `; -} -/** - * @param fnName - * @param argumentNumber - * @param namespace - * @param optional - */ -function validateNamespace(fnName, namespace, optional) { - if (optional && !namespace) { - return; - } - if (typeof namespace !== 'string') { - //TODO: I should do more validation here. We only allow certain chars in namespaces. - throw new Error(errorPrefix(fnName, 'namespace') + 'must be a valid firebase namespace.'); - } -} -function validateCallback(fnName, argumentName, -// eslint-disable-next-line @typescript-eslint/ban-types -callback, optional) { - if (optional && !callback) { - return; - } - if (typeof callback !== 'function') { - throw new Error(errorPrefix(fnName, argumentName) + 'must be a valid function.'); - } -} -function validateContextObject(fnName, argumentName, context, optional) { - if (optional && !context) { - return; - } - if (typeof context !== 'object' || context === null) { - throw new Error(errorPrefix(fnName, argumentName) + 'must be a valid context object.'); - } -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Code originally came from goog.crypt.stringToUtf8ByteArray, but for some reason they -// automatically replaced '\r\n' with '\n', and they didn't handle surrogate pairs, -// so it's been modified. -// Note that not all Unicode characters appear as single characters in JavaScript strings. -// fromCharCode returns the UTF-16 encoding of a character - so some Unicode characters -// use 2 characters in Javascript. All 4-byte UTF-8 characters begin with a first -// character in the range 0xD800 - 0xDBFF (the first character of a so-called surrogate -// pair). -// See http://www.ecma-international.org/ecma-262/5.1/#sec-15.1.3 -/** - * @param {string} str - * @return {Array} - */ -const stringToByteArray = function (str) { - const out = []; - let p = 0; - for (let i = 0; i < str.length; i++) { - let c = str.charCodeAt(i); - // Is this the lead surrogate in a surrogate pair? - if (c >= 0xd800 && c <= 0xdbff) { - const high = c - 0xd800; // the high 10 bits. - i++; - assert(i < str.length, 'Surrogate pair missing trail surrogate.'); - const low = str.charCodeAt(i) - 0xdc00; // the low 10 bits. - c = 0x10000 + (high << 10) + low; - } - if (c < 128) { - out[p++] = c; - } - else if (c < 2048) { - out[p++] = (c >> 6) | 192; - out[p++] = (c & 63) | 128; - } - else if (c < 65536) { - out[p++] = (c >> 12) | 224; - out[p++] = ((c >> 6) & 63) | 128; - out[p++] = (c & 63) | 128; - } - else { - out[p++] = (c >> 18) | 240; - out[p++] = ((c >> 12) & 63) | 128; - out[p++] = ((c >> 6) & 63) | 128; - out[p++] = (c & 63) | 128; - } - } - return out; -}; -/** - * Calculate length without actually converting; useful for doing cheaper validation. - * @param {string} str - * @return {number} - */ -const stringLength = function (str) { - let p = 0; - for (let i = 0; i < str.length; i++) { - const c = str.charCodeAt(i); - if (c < 128) { - p++; - } - else if (c < 2048) { - p += 2; - } - else if (c >= 0xd800 && c <= 0xdbff) { - // Lead surrogate of a surrogate pair. The pair together will take 4 bytes to represent. - p += 4; - i++; // skip trail surrogate. - } - else { - p += 3; - } - } - return p; -}; - -/** - * @license - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Copied from https://stackoverflow.com/a/2117523 - * Generates a new uuid. - * @public - */ -const uuidv4 = function () { - return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, c => { - const r = (Math.random() * 16) | 0, v = c === 'x' ? r : (r & 0x3) | 0x8; - return v.toString(16); - }); -}; - -/** - * @license - * Copyright 2019 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * The amount of milliseconds to exponentially increase. - */ -const DEFAULT_INTERVAL_MILLIS = 1000; -/** - * The factor to backoff by. - * Should be a number greater than 1. - */ -const DEFAULT_BACKOFF_FACTOR = 2; -/** - * The maximum milliseconds to increase to. - * - *

Visible for testing - */ -const MAX_VALUE_MILLIS = 4 * 60 * 60 * 1000; // Four hours, like iOS and Android. -/** - * The percentage of backoff time to randomize by. - * See - * http://go/safe-client-behavior#step-1-determine-the-appropriate-retry-interval-to-handle-spike-traffic - * for context. - * - *

Visible for testing - */ -const RANDOM_FACTOR = 0.5; -/** - * Based on the backoff method from - * https://github.com/google/closure-library/blob/master/closure/goog/math/exponentialbackoff.js. - * Extracted here so we don't need to pass metadata and a stateful ExponentialBackoff object around. - */ -function calculateBackoffMillis(backoffCount, intervalMillis = DEFAULT_INTERVAL_MILLIS, backoffFactor = DEFAULT_BACKOFF_FACTOR) { - // Calculates an exponentially increasing value. - // Deviation: calculates value from count and a constant interval, so we only need to save value - // and count to restore state. - const currBaseValue = intervalMillis * Math.pow(backoffFactor, backoffCount); - // A random "fuzz" to avoid waves of retries. - // Deviation: randomFactor is required. - const randomWait = Math.round( - // A fraction of the backoff value to add/subtract. - // Deviation: changes multiplication order to improve readability. - RANDOM_FACTOR * - currBaseValue * - // A random float (rounded to int by Math.round above) in the range [-1, 1]. Determines - // if we add or subtract. - (Math.random() - 0.5) * - 2); - // Limits backoff to max to avoid effectively permanent backoff. - return Math.min(MAX_VALUE_MILLIS, currBaseValue + randomWait); -} - -/** - * @license - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Provide English ordinal letters after a number - */ -function ordinal(i) { - if (!Number.isFinite(i)) { - return `${i}`; - } - return i + indicator(i); -} -function indicator(i) { - i = Math.abs(i); - const cent = i % 100; - if (cent >= 10 && cent <= 20) { - return 'th'; - } - const dec = i % 10; - if (dec === 1) { - return 'st'; - } - if (dec === 2) { - return 'nd'; - } - if (dec === 3) { - return 'rd'; - } - return 'th'; -} - -/** - * @license - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -function getModularInstance(service) { - if (service && service._delegate) { - return service._delegate; - } - else { - return service; - } -} - -export { CONSTANTS, Deferred, ErrorFactory, FirebaseError, MAX_VALUE_MILLIS, RANDOM_FACTOR, Sha1, areCookiesEnabled, assert, assertionError, async, base64, base64Decode, base64Encode, base64urlEncodeWithoutPadding, calculateBackoffMillis, contains, createMockUserToken, createSubscribe, decode, deepCopy, deepEqual, deepExtend, errorPrefix, extractQuerystring, getDefaultAppConfig, getDefaultEmulatorHost, getDefaultEmulatorHostnameAndPort, getExperimentalSetting, getGlobal, getModularInstance, getUA, isAdmin, isBrowser, isBrowserExtension, isElectron, isEmpty, isIE, isIndexedDBAvailable, isMobileCordova, isNode, isNodeSdk, isReactNative, isSafari, isUWP, isValidFormat, isValidTimestamp, issuedAtTime, jsonEval, map, ordinal, promiseWithTimeout, querystring, querystringDecode, safeGet, stringLength, stringToByteArray, stringify, uuidv4, validateArgCount, validateCallback, validateContextObject, validateIndexedDBOpenable, validateNamespace }; -//# sourceMappingURL=index.esm2017.js.map diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/index.esm5.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/index.esm5.js deleted file mode 100644 index f049e4aa..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/index.esm5.js +++ /dev/null @@ -1,2063 +0,0 @@ -import { __assign, __extends } from 'tslib'; - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * @fileoverview Firebase constants. Some of these (@defines) can be overridden at compile-time. - */ -var CONSTANTS = { - /** - * @define {boolean} Whether this is the client Node.js SDK. - */ - NODE_CLIENT: false, - /** - * @define {boolean} Whether this is the Admin Node.js SDK. - */ - NODE_ADMIN: false, - /** - * Firebase SDK Version - */ - SDK_VERSION: '${JSCORE_VERSION}' -}; - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Throws an error if the provided assertion is falsy - */ -var assert = function (assertion, message) { - if (!assertion) { - throw assertionError(message); - } -}; -/** - * Returns an Error object suitable for throwing. - */ -var assertionError = function (message) { - return new Error('Firebase Database (' + - CONSTANTS.SDK_VERSION + - ') INTERNAL ASSERT FAILED: ' + - message); -}; - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var stringToByteArray$1 = function (str) { - // TODO(user): Use native implementations if/when available - var out = []; - var p = 0; - for (var i = 0; i < str.length; i++) { - var c = str.charCodeAt(i); - if (c < 128) { - out[p++] = c; - } - else if (c < 2048) { - out[p++] = (c >> 6) | 192; - out[p++] = (c & 63) | 128; - } - else if ((c & 0xfc00) === 0xd800 && - i + 1 < str.length && - (str.charCodeAt(i + 1) & 0xfc00) === 0xdc00) { - // Surrogate Pair - c = 0x10000 + ((c & 0x03ff) << 10) + (str.charCodeAt(++i) & 0x03ff); - out[p++] = (c >> 18) | 240; - out[p++] = ((c >> 12) & 63) | 128; - out[p++] = ((c >> 6) & 63) | 128; - out[p++] = (c & 63) | 128; - } - else { - out[p++] = (c >> 12) | 224; - out[p++] = ((c >> 6) & 63) | 128; - out[p++] = (c & 63) | 128; - } - } - return out; -}; -/** - * Turns an array of numbers into the string given by the concatenation of the - * characters to which the numbers correspond. - * @param bytes Array of numbers representing characters. - * @return Stringification of the array. - */ -var byteArrayToString = function (bytes) { - // TODO(user): Use native implementations if/when available - var out = []; - var pos = 0, c = 0; - while (pos < bytes.length) { - var c1 = bytes[pos++]; - if (c1 < 128) { - out[c++] = String.fromCharCode(c1); - } - else if (c1 > 191 && c1 < 224) { - var c2 = bytes[pos++]; - out[c++] = String.fromCharCode(((c1 & 31) << 6) | (c2 & 63)); - } - else if (c1 > 239 && c1 < 365) { - // Surrogate Pair - var c2 = bytes[pos++]; - var c3 = bytes[pos++]; - var c4 = bytes[pos++]; - var u = (((c1 & 7) << 18) | ((c2 & 63) << 12) | ((c3 & 63) << 6) | (c4 & 63)) - - 0x10000; - out[c++] = String.fromCharCode(0xd800 + (u >> 10)); - out[c++] = String.fromCharCode(0xdc00 + (u & 1023)); - } - else { - var c2 = bytes[pos++]; - var c3 = bytes[pos++]; - out[c++] = String.fromCharCode(((c1 & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63)); - } - } - return out.join(''); -}; -// We define it as an object literal instead of a class because a class compiled down to es5 can't -// be treeshaked. https://github.com/rollup/rollup/issues/1691 -// Static lookup maps, lazily populated by init_() -var base64 = { - /** - * Maps bytes to characters. - */ - byteToCharMap_: null, - /** - * Maps characters to bytes. - */ - charToByteMap_: null, - /** - * Maps bytes to websafe characters. - * @private - */ - byteToCharMapWebSafe_: null, - /** - * Maps websafe characters to bytes. - * @private - */ - charToByteMapWebSafe_: null, - /** - * Our default alphabet, shared between - * ENCODED_VALS and ENCODED_VALS_WEBSAFE - */ - ENCODED_VALS_BASE: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' + 'abcdefghijklmnopqrstuvwxyz' + '0123456789', - /** - * Our default alphabet. Value 64 (=) is special; it means "nothing." - */ - get ENCODED_VALS() { - return this.ENCODED_VALS_BASE + '+/='; - }, - /** - * Our websafe alphabet. - */ - get ENCODED_VALS_WEBSAFE() { - return this.ENCODED_VALS_BASE + '-_.'; - }, - /** - * Whether this browser supports the atob and btoa functions. This extension - * started at Mozilla but is now implemented by many browsers. We use the - * ASSUME_* variables to avoid pulling in the full useragent detection library - * but still allowing the standard per-browser compilations. - * - */ - HAS_NATIVE_SUPPORT: typeof atob === 'function', - /** - * Base64-encode an array of bytes. - * - * @param input An array of bytes (numbers with - * value in [0, 255]) to encode. - * @param webSafe Boolean indicating we should use the - * alternative alphabet. - * @return The base64 encoded string. - */ - encodeByteArray: function (input, webSafe) { - if (!Array.isArray(input)) { - throw Error('encodeByteArray takes an array as a parameter'); - } - this.init_(); - var byteToCharMap = webSafe - ? this.byteToCharMapWebSafe_ - : this.byteToCharMap_; - var output = []; - for (var i = 0; i < input.length; i += 3) { - var byte1 = input[i]; - var haveByte2 = i + 1 < input.length; - var byte2 = haveByte2 ? input[i + 1] : 0; - var haveByte3 = i + 2 < input.length; - var byte3 = haveByte3 ? input[i + 2] : 0; - var outByte1 = byte1 >> 2; - var outByte2 = ((byte1 & 0x03) << 4) | (byte2 >> 4); - var outByte3 = ((byte2 & 0x0f) << 2) | (byte3 >> 6); - var outByte4 = byte3 & 0x3f; - if (!haveByte3) { - outByte4 = 64; - if (!haveByte2) { - outByte3 = 64; - } - } - output.push(byteToCharMap[outByte1], byteToCharMap[outByte2], byteToCharMap[outByte3], byteToCharMap[outByte4]); - } - return output.join(''); - }, - /** - * Base64-encode a string. - * - * @param input A string to encode. - * @param webSafe If true, we should use the - * alternative alphabet. - * @return The base64 encoded string. - */ - encodeString: function (input, webSafe) { - // Shortcut for Mozilla browsers that implement - // a native base64 encoder in the form of "btoa/atob" - if (this.HAS_NATIVE_SUPPORT && !webSafe) { - return btoa(input); - } - return this.encodeByteArray(stringToByteArray$1(input), webSafe); - }, - /** - * Base64-decode a string. - * - * @param input to decode. - * @param webSafe True if we should use the - * alternative alphabet. - * @return string representing the decoded value. - */ - decodeString: function (input, webSafe) { - // Shortcut for Mozilla browsers that implement - // a native base64 encoder in the form of "btoa/atob" - if (this.HAS_NATIVE_SUPPORT && !webSafe) { - return atob(input); - } - return byteArrayToString(this.decodeStringToByteArray(input, webSafe)); - }, - /** - * Base64-decode a string. - * - * In base-64 decoding, groups of four characters are converted into three - * bytes. If the encoder did not apply padding, the input length may not - * be a multiple of 4. - * - * In this case, the last group will have fewer than 4 characters, and - * padding will be inferred. If the group has one or two characters, it decodes - * to one byte. If the group has three characters, it decodes to two bytes. - * - * @param input Input to decode. - * @param webSafe True if we should use the web-safe alphabet. - * @return bytes representing the decoded value. - */ - decodeStringToByteArray: function (input, webSafe) { - this.init_(); - var charToByteMap = webSafe - ? this.charToByteMapWebSafe_ - : this.charToByteMap_; - var output = []; - for (var i = 0; i < input.length;) { - var byte1 = charToByteMap[input.charAt(i++)]; - var haveByte2 = i < input.length; - var byte2 = haveByte2 ? charToByteMap[input.charAt(i)] : 0; - ++i; - var haveByte3 = i < input.length; - var byte3 = haveByte3 ? charToByteMap[input.charAt(i)] : 64; - ++i; - var haveByte4 = i < input.length; - var byte4 = haveByte4 ? charToByteMap[input.charAt(i)] : 64; - ++i; - if (byte1 == null || byte2 == null || byte3 == null || byte4 == null) { - throw Error(); - } - var outByte1 = (byte1 << 2) | (byte2 >> 4); - output.push(outByte1); - if (byte3 !== 64) { - var outByte2 = ((byte2 << 4) & 0xf0) | (byte3 >> 2); - output.push(outByte2); - if (byte4 !== 64) { - var outByte3 = ((byte3 << 6) & 0xc0) | byte4; - output.push(outByte3); - } - } - } - return output; - }, - /** - * Lazy static initialization function. Called before - * accessing any of the static map variables. - * @private - */ - init_: function () { - if (!this.byteToCharMap_) { - this.byteToCharMap_ = {}; - this.charToByteMap_ = {}; - this.byteToCharMapWebSafe_ = {}; - this.charToByteMapWebSafe_ = {}; - // We want quick mappings back and forth, so we precompute two maps. - for (var i = 0; i < this.ENCODED_VALS.length; i++) { - this.byteToCharMap_[i] = this.ENCODED_VALS.charAt(i); - this.charToByteMap_[this.byteToCharMap_[i]] = i; - this.byteToCharMapWebSafe_[i] = this.ENCODED_VALS_WEBSAFE.charAt(i); - this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[i]] = i; - // Be forgiving when decoding and correctly decode both encodings. - if (i >= this.ENCODED_VALS_BASE.length) { - this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(i)] = i; - this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(i)] = i; - } - } - } - } -}; -/** - * URL-safe base64 encoding - */ -var base64Encode = function (str) { - var utf8Bytes = stringToByteArray$1(str); - return base64.encodeByteArray(utf8Bytes, true); -}; -/** - * URL-safe base64 encoding (without "." padding in the end). - * e.g. Used in JSON Web Token (JWT) parts. - */ -var base64urlEncodeWithoutPadding = function (str) { - // Use base64url encoding and remove padding in the end (dot characters). - return base64Encode(str).replace(/\./g, ''); -}; -/** - * URL-safe base64 decoding - * - * NOTE: DO NOT use the global atob() function - it does NOT support the - * base64Url variant encoding. - * - * @param str To be decoded - * @return Decoded result, if possible - */ -var base64Decode = function (str) { - try { - return base64.decodeString(str, true); - } - catch (e) { - console.error('base64Decode failed: ', e); - } - return null; -}; - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Do a deep-copy of basic JavaScript Objects or Arrays. - */ -function deepCopy(value) { - return deepExtend(undefined, value); -} -/** - * Copy properties from source to target (recursively allows extension - * of Objects and Arrays). Scalar values in the target are over-written. - * If target is undefined, an object of the appropriate type will be created - * (and returned). - * - * We recursively copy all child properties of plain Objects in the source- so - * that namespace- like dictionaries are merged. - * - * Note that the target can be a function, in which case the properties in - * the source Object are copied onto it as static properties of the Function. - * - * Note: we don't merge __proto__ to prevent prototype pollution - */ -function deepExtend(target, source) { - if (!(source instanceof Object)) { - return source; - } - switch (source.constructor) { - case Date: - // Treat Dates like scalars; if the target date object had any child - // properties - they will be lost! - var dateValue = source; - return new Date(dateValue.getTime()); - case Object: - if (target === undefined) { - target = {}; - } - break; - case Array: - // Always copy the array source and overwrite the target. - target = []; - break; - default: - // Not a plain Object - treat it as a scalar. - return source; - } - for (var prop in source) { - // use isValidKey to guard against prototype pollution. See https://snyk.io/vuln/SNYK-JS-LODASH-450202 - if (!source.hasOwnProperty(prop) || !isValidKey(prop)) { - continue; - } - target[prop] = deepExtend(target[prop], source[prop]); - } - return target; -} -function isValidKey(key) { - return key !== '__proto__'; -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Returns navigator.userAgent string or '' if it's not defined. - * @return user agent string - */ -function getUA() { - if (typeof navigator !== 'undefined' && - typeof navigator['userAgent'] === 'string') { - return navigator['userAgent']; - } - else { - return ''; - } -} -/** - * Detect Cordova / PhoneGap / Ionic frameworks on a mobile device. - * - * Deliberately does not rely on checking `file://` URLs (as this fails PhoneGap - * in the Ripple emulator) nor Cordova `onDeviceReady`, which would normally - * wait for a callback. - */ -function isMobileCordova() { - return (typeof window !== 'undefined' && - // @ts-ignore Setting up an broadly applicable index signature for Window - // just to deal with this case would probably be a bad idea. - !!(window['cordova'] || window['phonegap'] || window['PhoneGap']) && - /ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(getUA())); -} -/** - * Detect Node.js. - * - * @return true if Node.js environment is detected. - */ -// Node detection logic from: https://github.com/iliakan/detect-node/ -function isNode() { - try { - return (Object.prototype.toString.call(global.process) === '[object process]'); - } - catch (e) { - return false; - } -} -/** - * Detect Browser Environment - */ -function isBrowser() { - return typeof self === 'object' && self.self === self; -} -function isBrowserExtension() { - var runtime = typeof chrome === 'object' - ? chrome.runtime - : typeof browser === 'object' - ? browser.runtime - : undefined; - return typeof runtime === 'object' && runtime.id !== undefined; -} -/** - * Detect React Native. - * - * @return true if ReactNative environment is detected. - */ -function isReactNative() { - return (typeof navigator === 'object' && navigator['product'] === 'ReactNative'); -} -/** Detects Electron apps. */ -function isElectron() { - return getUA().indexOf('Electron/') >= 0; -} -/** Detects Internet Explorer. */ -function isIE() { - var ua = getUA(); - return ua.indexOf('MSIE ') >= 0 || ua.indexOf('Trident/') >= 0; -} -/** Detects Universal Windows Platform apps. */ -function isUWP() { - return getUA().indexOf('MSAppHost/') >= 0; -} -/** - * Detect whether the current SDK build is the Node version. - * - * @return true if it's the Node SDK build. - */ -function isNodeSdk() { - return CONSTANTS.NODE_CLIENT === true || CONSTANTS.NODE_ADMIN === true; -} -/** Returns true if we are running in Safari. */ -function isSafari() { - return (!isNode() && - navigator.userAgent.includes('Safari') && - !navigator.userAgent.includes('Chrome')); -} -/** - * This method checks if indexedDB is supported by current browser/service worker context - * @return true if indexedDB is supported by current browser/service worker context - */ -function isIndexedDBAvailable() { - return typeof indexedDB === 'object'; -} -/** - * This method validates browser/sw context for indexedDB by opening a dummy indexedDB database and reject - * if errors occur during the database open operation. - * - * @throws exception if current browser/sw context can't run idb.open (ex: Safari iframe, Firefox - * private browsing) - */ -function validateIndexedDBOpenable() { - return new Promise(function (resolve, reject) { - try { - var preExist_1 = true; - var DB_CHECK_NAME_1 = 'validate-browser-context-for-indexeddb-analytics-module'; - var request_1 = self.indexedDB.open(DB_CHECK_NAME_1); - request_1.onsuccess = function () { - request_1.result.close(); - // delete database only when it doesn't pre-exist - if (!preExist_1) { - self.indexedDB.deleteDatabase(DB_CHECK_NAME_1); - } - resolve(true); - }; - request_1.onupgradeneeded = function () { - preExist_1 = false; - }; - request_1.onerror = function () { - var _a; - reject(((_a = request_1.error) === null || _a === void 0 ? void 0 : _a.message) || ''); - }; - } - catch (error) { - reject(error); - } - }); -} -/** - * - * This method checks whether cookie is enabled within current browser - * @return true if cookie is enabled within current browser - */ -function areCookiesEnabled() { - if (typeof navigator === 'undefined' || !navigator.cookieEnabled) { - return false; - } - return true; -} -/** - * Polyfill for `globalThis` object. - * @returns the `globalThis` object for the given environment. - */ -function getGlobal() { - if (typeof self !== 'undefined') { - return self; - } - if (typeof window !== 'undefined') { - return window; - } - if (typeof global !== 'undefined') { - return global; - } - throw new Error('Unable to locate global object.'); -} - -/** - * @license - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var getDefaultsFromGlobal = function () { - return getGlobal().__FIREBASE_DEFAULTS__; -}; -/** - * Attempt to read defaults from a JSON string provided to - * process.env.__FIREBASE_DEFAULTS__ or a JSON file whose path is in - * process.env.__FIREBASE_DEFAULTS_PATH__ - */ -var getDefaultsFromEnvVariable = function () { - if (typeof process === 'undefined' || typeof process.env === 'undefined') { - return; - } - var defaultsJsonString = process.env.__FIREBASE_DEFAULTS__; - if (defaultsJsonString) { - return JSON.parse(defaultsJsonString); - } -}; -var getDefaultsFromCookie = function () { - if (typeof document === 'undefined') { - return; - } - var match; - try { - match = document.cookie.match(/__FIREBASE_DEFAULTS__=([^;]+)/); - } - catch (e) { - // Some environments such as Angular Universal SSR have a - // `document` object but error on accessing `document.cookie`. - return; - } - var decoded = match && base64Decode(match[1]); - return decoded && JSON.parse(decoded); -}; -/** - * Get the __FIREBASE_DEFAULTS__ object. It checks in order: - * (1) if such an object exists as a property of `globalThis` - * (2) if such an object was provided on a shell environment variable - * (3) if such an object exists in a cookie - */ -var getDefaults = function () { - try { - return (getDefaultsFromGlobal() || - getDefaultsFromEnvVariable() || - getDefaultsFromCookie()); - } - catch (e) { - /** - * Catch-all for being unable to get __FIREBASE_DEFAULTS__ due - * to any environment case we have not accounted for. Log to - * info instead of swallowing so we can find these unknown cases - * and add paths for them if needed. - */ - console.info("Unable to get __FIREBASE_DEFAULTS__ due to: " + e); - return; - } -}; -/** - * Returns emulator host stored in the __FIREBASE_DEFAULTS__ object - * for the given product. - * @returns a URL host formatted like `127.0.0.1:9999` or `[::1]:4000` if available - * @public - */ -var getDefaultEmulatorHost = function (productName) { var _a, _b; return (_b = (_a = getDefaults()) === null || _a === void 0 ? void 0 : _a.emulatorHosts) === null || _b === void 0 ? void 0 : _b[productName]; }; -/** - * Returns emulator hostname and port stored in the __FIREBASE_DEFAULTS__ object - * for the given product. - * @returns a pair of hostname and port like `["::1", 4000]` if available - * @public - */ -var getDefaultEmulatorHostnameAndPort = function (productName) { - var host = getDefaultEmulatorHost(productName); - if (!host) { - return undefined; - } - var separatorIndex = host.lastIndexOf(':'); // Finding the last since IPv6 addr also has colons. - if (separatorIndex <= 0 || separatorIndex + 1 === host.length) { - throw new Error("Invalid host " + host + " with no separate hostname and port!"); - } - // eslint-disable-next-line no-restricted-globals - var port = parseInt(host.substring(separatorIndex + 1), 10); - if (host[0] === '[') { - // Bracket-quoted `[ipv6addr]:port` => return "ipv6addr" (without brackets). - return [host.substring(1, separatorIndex - 1), port]; - } - else { - return [host.substring(0, separatorIndex), port]; - } -}; -/** - * Returns Firebase app config stored in the __FIREBASE_DEFAULTS__ object. - * @public - */ -var getDefaultAppConfig = function () { var _a; return (_a = getDefaults()) === null || _a === void 0 ? void 0 : _a.config; }; -/** - * Returns an experimental setting on the __FIREBASE_DEFAULTS__ object (properties - * prefixed by "_") - * @public - */ -var getExperimentalSetting = function (name) { var _a; return (_a = getDefaults()) === null || _a === void 0 ? void 0 : _a["_" + name]; }; - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var Deferred = /** @class */ (function () { - function Deferred() { - var _this = this; - this.reject = function () { }; - this.resolve = function () { }; - this.promise = new Promise(function (resolve, reject) { - _this.resolve = resolve; - _this.reject = reject; - }); - } - /** - * Our API internals are not promiseified and cannot because our callback APIs have subtle expectations around - * invoking promises inline, which Promises are forbidden to do. This method accepts an optional node-style callback - * and returns a node-style callback which will resolve or reject the Deferred's promise. - */ - Deferred.prototype.wrapCallback = function (callback) { - var _this = this; - return function (error, value) { - if (error) { - _this.reject(error); - } - else { - _this.resolve(value); - } - if (typeof callback === 'function') { - // Attaching noop handler just in case developer wasn't expecting - // promises - _this.promise.catch(function () { }); - // Some of our callbacks don't expect a value and our own tests - // assert that the parameter length is 1 - if (callback.length === 1) { - callback(error); - } - else { - callback(error, value); - } - } - }; - }; - return Deferred; -}()); - -/** - * @license - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -function createMockUserToken(token, projectId) { - if (token.uid) { - throw new Error('The "uid" field is no longer supported by mockUserToken. Please use "sub" instead for Firebase Auth User ID.'); - } - // Unsecured JWTs use "none" as the algorithm. - var header = { - alg: 'none', - type: 'JWT' - }; - var project = projectId || 'demo-project'; - var iat = token.iat || 0; - var sub = token.sub || token.user_id; - if (!sub) { - throw new Error("mockUserToken must contain 'sub' or 'user_id' field!"); - } - var payload = __assign({ - // Set all required fields to decent defaults - iss: "https://securetoken.google.com/" + project, aud: project, iat: iat, exp: iat + 3600, auth_time: iat, sub: sub, user_id: sub, firebase: { - sign_in_provider: 'custom', - identities: {} - } }, token); - // Unsecured JWTs use the empty string as a signature. - var signature = ''; - return [ - base64urlEncodeWithoutPadding(JSON.stringify(header)), - base64urlEncodeWithoutPadding(JSON.stringify(payload)), - signature - ].join('.'); -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var ERROR_NAME = 'FirebaseError'; -// Based on code from: -// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error#Custom_Error_Types -var FirebaseError = /** @class */ (function (_super) { - __extends(FirebaseError, _super); - function FirebaseError( - /** The error code for this error. */ - code, message, - /** Custom data for this error. */ - customData) { - var _this = _super.call(this, message) || this; - _this.code = code; - _this.customData = customData; - /** The custom name for all FirebaseErrors. */ - _this.name = ERROR_NAME; - // Fix For ES5 - // https://github.com/Microsoft/TypeScript-wiki/blob/master/Breaking-Changes.md#extending-built-ins-like-error-array-and-map-may-no-longer-work - Object.setPrototypeOf(_this, FirebaseError.prototype); - // Maintains proper stack trace for where our error was thrown. - // Only available on V8. - if (Error.captureStackTrace) { - Error.captureStackTrace(_this, ErrorFactory.prototype.create); - } - return _this; - } - return FirebaseError; -}(Error)); -var ErrorFactory = /** @class */ (function () { - function ErrorFactory(service, serviceName, errors) { - this.service = service; - this.serviceName = serviceName; - this.errors = errors; - } - ErrorFactory.prototype.create = function (code) { - var data = []; - for (var _i = 1; _i < arguments.length; _i++) { - data[_i - 1] = arguments[_i]; - } - var customData = data[0] || {}; - var fullCode = this.service + "/" + code; - var template = this.errors[code]; - var message = template ? replaceTemplate(template, customData) : 'Error'; - // Service Name: Error message (service/code). - var fullMessage = this.serviceName + ": " + message + " (" + fullCode + ")."; - var error = new FirebaseError(fullCode, fullMessage, customData); - return error; - }; - return ErrorFactory; -}()); -function replaceTemplate(template, data) { - return template.replace(PATTERN, function (_, key) { - var value = data[key]; - return value != null ? String(value) : "<" + key + "?>"; - }); -} -var PATTERN = /\{\$([^}]+)}/g; - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Evaluates a JSON string into a javascript object. - * - * @param {string} str A string containing JSON. - * @return {*} The javascript object representing the specified JSON. - */ -function jsonEval(str) { - return JSON.parse(str); -} -/** - * Returns JSON representing a javascript object. - * @param {*} data Javascript object to be stringified. - * @return {string} The JSON contents of the object. - */ -function stringify(data) { - return JSON.stringify(data); -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Decodes a Firebase auth. token into constituent parts. - * - * Notes: - * - May return with invalid / incomplete claims if there's no native base64 decoding support. - * - Doesn't check if the token is actually valid. - */ -var decode = function (token) { - var header = {}, claims = {}, data = {}, signature = ''; - try { - var parts = token.split('.'); - header = jsonEval(base64Decode(parts[0]) || ''); - claims = jsonEval(base64Decode(parts[1]) || ''); - signature = parts[2]; - data = claims['d'] || {}; - delete claims['d']; - } - catch (e) { } - return { - header: header, - claims: claims, - data: data, - signature: signature - }; -}; -/** - * Decodes a Firebase auth. token and checks the validity of its time-based claims. Will return true if the - * token is within the time window authorized by the 'nbf' (not-before) and 'iat' (issued-at) claims. - * - * Notes: - * - May return a false negative if there's no native base64 decoding support. - * - Doesn't check if the token is actually valid. - */ -var isValidTimestamp = function (token) { - var claims = decode(token).claims; - var now = Math.floor(new Date().getTime() / 1000); - var validSince = 0, validUntil = 0; - if (typeof claims === 'object') { - if (claims.hasOwnProperty('nbf')) { - validSince = claims['nbf']; - } - else if (claims.hasOwnProperty('iat')) { - validSince = claims['iat']; - } - if (claims.hasOwnProperty('exp')) { - validUntil = claims['exp']; - } - else { - // token will expire after 24h by default - validUntil = validSince + 86400; - } - } - return (!!now && - !!validSince && - !!validUntil && - now >= validSince && - now <= validUntil); -}; -/** - * Decodes a Firebase auth. token and returns its issued at time if valid, null otherwise. - * - * Notes: - * - May return null if there's no native base64 decoding support. - * - Doesn't check if the token is actually valid. - */ -var issuedAtTime = function (token) { - var claims = decode(token).claims; - if (typeof claims === 'object' && claims.hasOwnProperty('iat')) { - return claims['iat']; - } - return null; -}; -/** - * Decodes a Firebase auth. token and checks the validity of its format. Expects a valid issued-at time. - * - * Notes: - * - May return a false negative if there's no native base64 decoding support. - * - Doesn't check if the token is actually valid. - */ -var isValidFormat = function (token) { - var decoded = decode(token), claims = decoded.claims; - return !!claims && typeof claims === 'object' && claims.hasOwnProperty('iat'); -}; -/** - * Attempts to peer into an auth token and determine if it's an admin auth token by looking at the claims portion. - * - * Notes: - * - May return a false negative if there's no native base64 decoding support. - * - Doesn't check if the token is actually valid. - */ -var isAdmin = function (token) { - var claims = decode(token).claims; - return typeof claims === 'object' && claims['admin'] === true; -}; - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -function contains(obj, key) { - return Object.prototype.hasOwnProperty.call(obj, key); -} -function safeGet(obj, key) { - if (Object.prototype.hasOwnProperty.call(obj, key)) { - return obj[key]; - } - else { - return undefined; - } -} -function isEmpty(obj) { - for (var key in obj) { - if (Object.prototype.hasOwnProperty.call(obj, key)) { - return false; - } - } - return true; -} -function map(obj, fn, contextObj) { - var res = {}; - for (var key in obj) { - if (Object.prototype.hasOwnProperty.call(obj, key)) { - res[key] = fn.call(contextObj, obj[key], key, obj); - } - } - return res; -} -/** - * Deep equal two objects. Support Arrays and Objects. - */ -function deepEqual(a, b) { - if (a === b) { - return true; - } - var aKeys = Object.keys(a); - var bKeys = Object.keys(b); - for (var _i = 0, aKeys_1 = aKeys; _i < aKeys_1.length; _i++) { - var k = aKeys_1[_i]; - if (!bKeys.includes(k)) { - return false; - } - var aProp = a[k]; - var bProp = b[k]; - if (isObject(aProp) && isObject(bProp)) { - if (!deepEqual(aProp, bProp)) { - return false; - } - } - else if (aProp !== bProp) { - return false; - } - } - for (var _a = 0, bKeys_1 = bKeys; _a < bKeys_1.length; _a++) { - var k = bKeys_1[_a]; - if (!aKeys.includes(k)) { - return false; - } - } - return true; -} -function isObject(thing) { - return thing !== null && typeof thing === 'object'; -} - -/** - * @license - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Rejects if the given promise doesn't resolve in timeInMS milliseconds. - * @internal - */ -function promiseWithTimeout(promise, timeInMS) { - if (timeInMS === void 0) { timeInMS = 2000; } - var deferredPromise = new Deferred(); - setTimeout(function () { return deferredPromise.reject('timeout!'); }, timeInMS); - promise.then(deferredPromise.resolve, deferredPromise.reject); - return deferredPromise.promise; -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Returns a querystring-formatted string (e.g. &arg=val&arg2=val2) from a - * params object (e.g. {arg: 'val', arg2: 'val2'}) - * Note: You must prepend it with ? when adding it to a URL. - */ -function querystring(querystringParams) { - var params = []; - var _loop_1 = function (key, value) { - if (Array.isArray(value)) { - value.forEach(function (arrayVal) { - params.push(encodeURIComponent(key) + '=' + encodeURIComponent(arrayVal)); - }); - } - else { - params.push(encodeURIComponent(key) + '=' + encodeURIComponent(value)); - } - }; - for (var _i = 0, _a = Object.entries(querystringParams); _i < _a.length; _i++) { - var _b = _a[_i], key = _b[0], value = _b[1]; - _loop_1(key, value); - } - return params.length ? '&' + params.join('&') : ''; -} -/** - * Decodes a querystring (e.g. ?arg=val&arg2=val2) into a params object - * (e.g. {arg: 'val', arg2: 'val2'}) - */ -function querystringDecode(querystring) { - var obj = {}; - var tokens = querystring.replace(/^\?/, '').split('&'); - tokens.forEach(function (token) { - if (token) { - var _a = token.split('='), key = _a[0], value = _a[1]; - obj[decodeURIComponent(key)] = decodeURIComponent(value); - } - }); - return obj; -} -/** - * Extract the query string part of a URL, including the leading question mark (if present). - */ -function extractQuerystring(url) { - var queryStart = url.indexOf('?'); - if (!queryStart) { - return ''; - } - var fragmentStart = url.indexOf('#', queryStart); - return url.substring(queryStart, fragmentStart > 0 ? fragmentStart : undefined); -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * @fileoverview SHA-1 cryptographic hash. - * Variable names follow the notation in FIPS PUB 180-3: - * http://csrc.nist.gov/publications/fips/fips180-3/fips180-3_final.pdf. - * - * Usage: - * var sha1 = new sha1(); - * sha1.update(bytes); - * var hash = sha1.digest(); - * - * Performance: - * Chrome 23: ~400 Mbit/s - * Firefox 16: ~250 Mbit/s - * - */ -/** - * SHA-1 cryptographic hash constructor. - * - * The properties declared here are discussed in the above algorithm document. - * @constructor - * @final - * @struct - */ -var Sha1 = /** @class */ (function () { - function Sha1() { - /** - * Holds the previous values of accumulated variables a-e in the compress_ - * function. - * @private - */ - this.chain_ = []; - /** - * A buffer holding the partially computed hash result. - * @private - */ - this.buf_ = []; - /** - * An array of 80 bytes, each a part of the message to be hashed. Referred to - * as the message schedule in the docs. - * @private - */ - this.W_ = []; - /** - * Contains data needed to pad messages less than 64 bytes. - * @private - */ - this.pad_ = []; - /** - * @private {number} - */ - this.inbuf_ = 0; - /** - * @private {number} - */ - this.total_ = 0; - this.blockSize = 512 / 8; - this.pad_[0] = 128; - for (var i = 1; i < this.blockSize; ++i) { - this.pad_[i] = 0; - } - this.reset(); - } - Sha1.prototype.reset = function () { - this.chain_[0] = 0x67452301; - this.chain_[1] = 0xefcdab89; - this.chain_[2] = 0x98badcfe; - this.chain_[3] = 0x10325476; - this.chain_[4] = 0xc3d2e1f0; - this.inbuf_ = 0; - this.total_ = 0; - }; - /** - * Internal compress helper function. - * @param buf Block to compress. - * @param offset Offset of the block in the buffer. - * @private - */ - Sha1.prototype.compress_ = function (buf, offset) { - if (!offset) { - offset = 0; - } - var W = this.W_; - // get 16 big endian words - if (typeof buf === 'string') { - for (var i = 0; i < 16; i++) { - // TODO(user): [bug 8140122] Recent versions of Safari for Mac OS and iOS - // have a bug that turns the post-increment ++ operator into pre-increment - // during JIT compilation. We have code that depends heavily on SHA-1 for - // correctness and which is affected by this bug, so I've removed all uses - // of post-increment ++ in which the result value is used. We can revert - // this change once the Safari bug - // (https://bugs.webkit.org/show_bug.cgi?id=109036) has been fixed and - // most clients have been updated. - W[i] = - (buf.charCodeAt(offset) << 24) | - (buf.charCodeAt(offset + 1) << 16) | - (buf.charCodeAt(offset + 2) << 8) | - buf.charCodeAt(offset + 3); - offset += 4; - } - } - else { - for (var i = 0; i < 16; i++) { - W[i] = - (buf[offset] << 24) | - (buf[offset + 1] << 16) | - (buf[offset + 2] << 8) | - buf[offset + 3]; - offset += 4; - } - } - // expand to 80 words - for (var i = 16; i < 80; i++) { - var t = W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16]; - W[i] = ((t << 1) | (t >>> 31)) & 0xffffffff; - } - var a = this.chain_[0]; - var b = this.chain_[1]; - var c = this.chain_[2]; - var d = this.chain_[3]; - var e = this.chain_[4]; - var f, k; - // TODO(user): Try to unroll this loop to speed up the computation. - for (var i = 0; i < 80; i++) { - if (i < 40) { - if (i < 20) { - f = d ^ (b & (c ^ d)); - k = 0x5a827999; - } - else { - f = b ^ c ^ d; - k = 0x6ed9eba1; - } - } - else { - if (i < 60) { - f = (b & c) | (d & (b | c)); - k = 0x8f1bbcdc; - } - else { - f = b ^ c ^ d; - k = 0xca62c1d6; - } - } - var t = (((a << 5) | (a >>> 27)) + f + e + k + W[i]) & 0xffffffff; - e = d; - d = c; - c = ((b << 30) | (b >>> 2)) & 0xffffffff; - b = a; - a = t; - } - this.chain_[0] = (this.chain_[0] + a) & 0xffffffff; - this.chain_[1] = (this.chain_[1] + b) & 0xffffffff; - this.chain_[2] = (this.chain_[2] + c) & 0xffffffff; - this.chain_[3] = (this.chain_[3] + d) & 0xffffffff; - this.chain_[4] = (this.chain_[4] + e) & 0xffffffff; - }; - Sha1.prototype.update = function (bytes, length) { - // TODO(johnlenz): tighten the function signature and remove this check - if (bytes == null) { - return; - } - if (length === undefined) { - length = bytes.length; - } - var lengthMinusBlock = length - this.blockSize; - var n = 0; - // Using local instead of member variables gives ~5% speedup on Firefox 16. - var buf = this.buf_; - var inbuf = this.inbuf_; - // The outer while loop should execute at most twice. - while (n < length) { - // When we have no data in the block to top up, we can directly process the - // input buffer (assuming it contains sufficient data). This gives ~25% - // speedup on Chrome 23 and ~15% speedup on Firefox 16, but requires that - // the data is provided in large chunks (or in multiples of 64 bytes). - if (inbuf === 0) { - while (n <= lengthMinusBlock) { - this.compress_(bytes, n); - n += this.blockSize; - } - } - if (typeof bytes === 'string') { - while (n < length) { - buf[inbuf] = bytes.charCodeAt(n); - ++inbuf; - ++n; - if (inbuf === this.blockSize) { - this.compress_(buf); - inbuf = 0; - // Jump to the outer loop so we use the full-block optimization. - break; - } - } - } - else { - while (n < length) { - buf[inbuf] = bytes[n]; - ++inbuf; - ++n; - if (inbuf === this.blockSize) { - this.compress_(buf); - inbuf = 0; - // Jump to the outer loop so we use the full-block optimization. - break; - } - } - } - } - this.inbuf_ = inbuf; - this.total_ += length; - }; - /** @override */ - Sha1.prototype.digest = function () { - var digest = []; - var totalBits = this.total_ * 8; - // Add pad 0x80 0x00*. - if (this.inbuf_ < 56) { - this.update(this.pad_, 56 - this.inbuf_); - } - else { - this.update(this.pad_, this.blockSize - (this.inbuf_ - 56)); - } - // Add # bits. - for (var i = this.blockSize - 1; i >= 56; i--) { - this.buf_[i] = totalBits & 255; - totalBits /= 256; // Don't use bit-shifting here! - } - this.compress_(this.buf_); - var n = 0; - for (var i = 0; i < 5; i++) { - for (var j = 24; j >= 0; j -= 8) { - digest[n] = (this.chain_[i] >> j) & 255; - ++n; - } - } - return digest; - }; - return Sha1; -}()); - -/** - * Helper to make a Subscribe function (just like Promise helps make a - * Thenable). - * - * @param executor Function which can make calls to a single Observer - * as a proxy. - * @param onNoObservers Callback when count of Observers goes to zero. - */ -function createSubscribe(executor, onNoObservers) { - var proxy = new ObserverProxy(executor, onNoObservers); - return proxy.subscribe.bind(proxy); -} -/** - * Implement fan-out for any number of Observers attached via a subscribe - * function. - */ -var ObserverProxy = /** @class */ (function () { - /** - * @param executor Function which can make calls to a single Observer - * as a proxy. - * @param onNoObservers Callback when count of Observers goes to zero. - */ - function ObserverProxy(executor, onNoObservers) { - var _this = this; - this.observers = []; - this.unsubscribes = []; - this.observerCount = 0; - // Micro-task scheduling by calling task.then(). - this.task = Promise.resolve(); - this.finalized = false; - this.onNoObservers = onNoObservers; - // Call the executor asynchronously so subscribers that are called - // synchronously after the creation of the subscribe function - // can still receive the very first value generated in the executor. - this.task - .then(function () { - executor(_this); - }) - .catch(function (e) { - _this.error(e); - }); - } - ObserverProxy.prototype.next = function (value) { - this.forEachObserver(function (observer) { - observer.next(value); - }); - }; - ObserverProxy.prototype.error = function (error) { - this.forEachObserver(function (observer) { - observer.error(error); - }); - this.close(error); - }; - ObserverProxy.prototype.complete = function () { - this.forEachObserver(function (observer) { - observer.complete(); - }); - this.close(); - }; - /** - * Subscribe function that can be used to add an Observer to the fan-out list. - * - * - We require that no event is sent to a subscriber sychronously to their - * call to subscribe(). - */ - ObserverProxy.prototype.subscribe = function (nextOrObserver, error, complete) { - var _this = this; - var observer; - if (nextOrObserver === undefined && - error === undefined && - complete === undefined) { - throw new Error('Missing Observer.'); - } - // Assemble an Observer object when passed as callback functions. - if (implementsAnyMethods(nextOrObserver, [ - 'next', - 'error', - 'complete' - ])) { - observer = nextOrObserver; - } - else { - observer = { - next: nextOrObserver, - error: error, - complete: complete - }; - } - if (observer.next === undefined) { - observer.next = noop; - } - if (observer.error === undefined) { - observer.error = noop; - } - if (observer.complete === undefined) { - observer.complete = noop; - } - var unsub = this.unsubscribeOne.bind(this, this.observers.length); - // Attempt to subscribe to a terminated Observable - we - // just respond to the Observer with the final error or complete - // event. - if (this.finalized) { - // eslint-disable-next-line @typescript-eslint/no-floating-promises - this.task.then(function () { - try { - if (_this.finalError) { - observer.error(_this.finalError); - } - else { - observer.complete(); - } - } - catch (e) { - // nothing - } - return; - }); - } - this.observers.push(observer); - return unsub; - }; - // Unsubscribe is synchronous - we guarantee that no events are sent to - // any unsubscribed Observer. - ObserverProxy.prototype.unsubscribeOne = function (i) { - if (this.observers === undefined || this.observers[i] === undefined) { - return; - } - delete this.observers[i]; - this.observerCount -= 1; - if (this.observerCount === 0 && this.onNoObservers !== undefined) { - this.onNoObservers(this); - } - }; - ObserverProxy.prototype.forEachObserver = function (fn) { - if (this.finalized) { - // Already closed by previous event....just eat the additional values. - return; - } - // Since sendOne calls asynchronously - there is no chance that - // this.observers will become undefined. - for (var i = 0; i < this.observers.length; i++) { - this.sendOne(i, fn); - } - }; - // Call the Observer via one of it's callback function. We are careful to - // confirm that the observe has not been unsubscribed since this asynchronous - // function had been queued. - ObserverProxy.prototype.sendOne = function (i, fn) { - var _this = this; - // Execute the callback asynchronously - // eslint-disable-next-line @typescript-eslint/no-floating-promises - this.task.then(function () { - if (_this.observers !== undefined && _this.observers[i] !== undefined) { - try { - fn(_this.observers[i]); - } - catch (e) { - // Ignore exceptions raised in Observers or missing methods of an - // Observer. - // Log error to console. b/31404806 - if (typeof console !== 'undefined' && console.error) { - console.error(e); - } - } - } - }); - }; - ObserverProxy.prototype.close = function (err) { - var _this = this; - if (this.finalized) { - return; - } - this.finalized = true; - if (err !== undefined) { - this.finalError = err; - } - // Proxy is no longer needed - garbage collect references - // eslint-disable-next-line @typescript-eslint/no-floating-promises - this.task.then(function () { - _this.observers = undefined; - _this.onNoObservers = undefined; - }); - }; - return ObserverProxy; -}()); -/** Turn synchronous function into one called asynchronously. */ -// eslint-disable-next-line @typescript-eslint/ban-types -function async(fn, onError) { - return function () { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - Promise.resolve(true) - .then(function () { - fn.apply(void 0, args); - }) - .catch(function (error) { - if (onError) { - onError(error); - } - }); - }; -} -/** - * Return true if the object passed in implements any of the named methods. - */ -function implementsAnyMethods(obj, methods) { - if (typeof obj !== 'object' || obj === null) { - return false; - } - for (var _i = 0, methods_1 = methods; _i < methods_1.length; _i++) { - var method = methods_1[_i]; - if (method in obj && typeof obj[method] === 'function') { - return true; - } - } - return false; -} -function noop() { - // do nothing -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Check to make sure the appropriate number of arguments are provided for a public function. - * Throws an error if it fails. - * - * @param fnName The function name - * @param minCount The minimum number of arguments to allow for the function call - * @param maxCount The maximum number of argument to allow for the function call - * @param argCount The actual number of arguments provided. - */ -var validateArgCount = function (fnName, minCount, maxCount, argCount) { - var argError; - if (argCount < minCount) { - argError = 'at least ' + minCount; - } - else if (argCount > maxCount) { - argError = maxCount === 0 ? 'none' : 'no more than ' + maxCount; - } - if (argError) { - var error = fnName + - ' failed: Was called with ' + - argCount + - (argCount === 1 ? ' argument.' : ' arguments.') + - ' Expects ' + - argError + - '.'; - throw new Error(error); - } -}; -/** - * Generates a string to prefix an error message about failed argument validation - * - * @param fnName The function name - * @param argName The name of the argument - * @return The prefix to add to the error thrown for validation. - */ -function errorPrefix(fnName, argName) { - return fnName + " failed: " + argName + " argument "; -} -/** - * @param fnName - * @param argumentNumber - * @param namespace - * @param optional - */ -function validateNamespace(fnName, namespace, optional) { - if (optional && !namespace) { - return; - } - if (typeof namespace !== 'string') { - //TODO: I should do more validation here. We only allow certain chars in namespaces. - throw new Error(errorPrefix(fnName, 'namespace') + 'must be a valid firebase namespace.'); - } -} -function validateCallback(fnName, argumentName, -// eslint-disable-next-line @typescript-eslint/ban-types -callback, optional) { - if (optional && !callback) { - return; - } - if (typeof callback !== 'function') { - throw new Error(errorPrefix(fnName, argumentName) + 'must be a valid function.'); - } -} -function validateContextObject(fnName, argumentName, context, optional) { - if (optional && !context) { - return; - } - if (typeof context !== 'object' || context === null) { - throw new Error(errorPrefix(fnName, argumentName) + 'must be a valid context object.'); - } -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Code originally came from goog.crypt.stringToUtf8ByteArray, but for some reason they -// automatically replaced '\r\n' with '\n', and they didn't handle surrogate pairs, -// so it's been modified. -// Note that not all Unicode characters appear as single characters in JavaScript strings. -// fromCharCode returns the UTF-16 encoding of a character - so some Unicode characters -// use 2 characters in Javascript. All 4-byte UTF-8 characters begin with a first -// character in the range 0xD800 - 0xDBFF (the first character of a so-called surrogate -// pair). -// See http://www.ecma-international.org/ecma-262/5.1/#sec-15.1.3 -/** - * @param {string} str - * @return {Array} - */ -var stringToByteArray = function (str) { - var out = []; - var p = 0; - for (var i = 0; i < str.length; i++) { - var c = str.charCodeAt(i); - // Is this the lead surrogate in a surrogate pair? - if (c >= 0xd800 && c <= 0xdbff) { - var high = c - 0xd800; // the high 10 bits. - i++; - assert(i < str.length, 'Surrogate pair missing trail surrogate.'); - var low = str.charCodeAt(i) - 0xdc00; // the low 10 bits. - c = 0x10000 + (high << 10) + low; - } - if (c < 128) { - out[p++] = c; - } - else if (c < 2048) { - out[p++] = (c >> 6) | 192; - out[p++] = (c & 63) | 128; - } - else if (c < 65536) { - out[p++] = (c >> 12) | 224; - out[p++] = ((c >> 6) & 63) | 128; - out[p++] = (c & 63) | 128; - } - else { - out[p++] = (c >> 18) | 240; - out[p++] = ((c >> 12) & 63) | 128; - out[p++] = ((c >> 6) & 63) | 128; - out[p++] = (c & 63) | 128; - } - } - return out; -}; -/** - * Calculate length without actually converting; useful for doing cheaper validation. - * @param {string} str - * @return {number} - */ -var stringLength = function (str) { - var p = 0; - for (var i = 0; i < str.length; i++) { - var c = str.charCodeAt(i); - if (c < 128) { - p++; - } - else if (c < 2048) { - p += 2; - } - else if (c >= 0xd800 && c <= 0xdbff) { - // Lead surrogate of a surrogate pair. The pair together will take 4 bytes to represent. - p += 4; - i++; // skip trail surrogate. - } - else { - p += 3; - } - } - return p; -}; - -/** - * @license - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Copied from https://stackoverflow.com/a/2117523 - * Generates a new uuid. - * @public - */ -var uuidv4 = function () { - return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) { - var r = (Math.random() * 16) | 0, v = c === 'x' ? r : (r & 0x3) | 0x8; - return v.toString(16); - }); -}; - -/** - * @license - * Copyright 2019 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * The amount of milliseconds to exponentially increase. - */ -var DEFAULT_INTERVAL_MILLIS = 1000; -/** - * The factor to backoff by. - * Should be a number greater than 1. - */ -var DEFAULT_BACKOFF_FACTOR = 2; -/** - * The maximum milliseconds to increase to. - * - *

Visible for testing - */ -var MAX_VALUE_MILLIS = 4 * 60 * 60 * 1000; // Four hours, like iOS and Android. -/** - * The percentage of backoff time to randomize by. - * See - * http://go/safe-client-behavior#step-1-determine-the-appropriate-retry-interval-to-handle-spike-traffic - * for context. - * - *

Visible for testing - */ -var RANDOM_FACTOR = 0.5; -/** - * Based on the backoff method from - * https://github.com/google/closure-library/blob/master/closure/goog/math/exponentialbackoff.js. - * Extracted here so we don't need to pass metadata and a stateful ExponentialBackoff object around. - */ -function calculateBackoffMillis(backoffCount, intervalMillis, backoffFactor) { - if (intervalMillis === void 0) { intervalMillis = DEFAULT_INTERVAL_MILLIS; } - if (backoffFactor === void 0) { backoffFactor = DEFAULT_BACKOFF_FACTOR; } - // Calculates an exponentially increasing value. - // Deviation: calculates value from count and a constant interval, so we only need to save value - // and count to restore state. - var currBaseValue = intervalMillis * Math.pow(backoffFactor, backoffCount); - // A random "fuzz" to avoid waves of retries. - // Deviation: randomFactor is required. - var randomWait = Math.round( - // A fraction of the backoff value to add/subtract. - // Deviation: changes multiplication order to improve readability. - RANDOM_FACTOR * - currBaseValue * - // A random float (rounded to int by Math.round above) in the range [-1, 1]. Determines - // if we add or subtract. - (Math.random() - 0.5) * - 2); - // Limits backoff to max to avoid effectively permanent backoff. - return Math.min(MAX_VALUE_MILLIS, currBaseValue + randomWait); -} - -/** - * @license - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Provide English ordinal letters after a number - */ -function ordinal(i) { - if (!Number.isFinite(i)) { - return "" + i; - } - return i + indicator(i); -} -function indicator(i) { - i = Math.abs(i); - var cent = i % 100; - if (cent >= 10 && cent <= 20) { - return 'th'; - } - var dec = i % 10; - if (dec === 1) { - return 'st'; - } - if (dec === 2) { - return 'nd'; - } - if (dec === 3) { - return 'rd'; - } - return 'th'; -} - -/** - * @license - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -function getModularInstance(service) { - if (service && service._delegate) { - return service._delegate; - } - else { - return service; - } -} - -export { CONSTANTS, Deferred, ErrorFactory, FirebaseError, MAX_VALUE_MILLIS, RANDOM_FACTOR, Sha1, areCookiesEnabled, assert, assertionError, async, base64, base64Decode, base64Encode, base64urlEncodeWithoutPadding, calculateBackoffMillis, contains, createMockUserToken, createSubscribe, decode, deepCopy, deepEqual, deepExtend, errorPrefix, extractQuerystring, getDefaultAppConfig, getDefaultEmulatorHost, getDefaultEmulatorHostnameAndPort, getExperimentalSetting, getGlobal, getModularInstance, getUA, isAdmin, isBrowser, isBrowserExtension, isElectron, isEmpty, isIE, isIndexedDBAvailable, isMobileCordova, isNode, isNodeSdk, isReactNative, isSafari, isUWP, isValidFormat, isValidTimestamp, issuedAtTime, jsonEval, map, ordinal, promiseWithTimeout, querystring, querystringDecode, safeGet, stringLength, stringToByteArray, stringify, uuidv4, validateArgCount, validateCallback, validateContextObject, validateIndexedDBOpenable, validateNamespace }; -//# sourceMappingURL=index.esm5.js.map diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/index.node.cjs.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/index.node.cjs.js deleted file mode 100644 index b0e3efe6..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/index.node.cjs.js +++ /dev/null @@ -1,2149 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, '__esModule', { value: true }); - -var tslib = require('tslib'); - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * @fileoverview Firebase constants. Some of these (@defines) can be overridden at compile-time. - */ -var CONSTANTS = { - /** - * @define {boolean} Whether this is the client Node.js SDK. - */ - NODE_CLIENT: false, - /** - * @define {boolean} Whether this is the Admin Node.js SDK. - */ - NODE_ADMIN: false, - /** - * Firebase SDK Version - */ - SDK_VERSION: '${JSCORE_VERSION}' -}; - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Throws an error if the provided assertion is falsy - */ -var assert = function (assertion, message) { - if (!assertion) { - throw assertionError(message); - } -}; -/** - * Returns an Error object suitable for throwing. - */ -var assertionError = function (message) { - return new Error('Firebase Database (' + - CONSTANTS.SDK_VERSION + - ') INTERNAL ASSERT FAILED: ' + - message); -}; - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var stringToByteArray$1 = function (str) { - // TODO(user): Use native implementations if/when available - var out = []; - var p = 0; - for (var i = 0; i < str.length; i++) { - var c = str.charCodeAt(i); - if (c < 128) { - out[p++] = c; - } - else if (c < 2048) { - out[p++] = (c >> 6) | 192; - out[p++] = (c & 63) | 128; - } - else if ((c & 0xfc00) === 0xd800 && - i + 1 < str.length && - (str.charCodeAt(i + 1) & 0xfc00) === 0xdc00) { - // Surrogate Pair - c = 0x10000 + ((c & 0x03ff) << 10) + (str.charCodeAt(++i) & 0x03ff); - out[p++] = (c >> 18) | 240; - out[p++] = ((c >> 12) & 63) | 128; - out[p++] = ((c >> 6) & 63) | 128; - out[p++] = (c & 63) | 128; - } - else { - out[p++] = (c >> 12) | 224; - out[p++] = ((c >> 6) & 63) | 128; - out[p++] = (c & 63) | 128; - } - } - return out; -}; -/** - * Turns an array of numbers into the string given by the concatenation of the - * characters to which the numbers correspond. - * @param bytes Array of numbers representing characters. - * @return Stringification of the array. - */ -var byteArrayToString = function (bytes) { - // TODO(user): Use native implementations if/when available - var out = []; - var pos = 0, c = 0; - while (pos < bytes.length) { - var c1 = bytes[pos++]; - if (c1 < 128) { - out[c++] = String.fromCharCode(c1); - } - else if (c1 > 191 && c1 < 224) { - var c2 = bytes[pos++]; - out[c++] = String.fromCharCode(((c1 & 31) << 6) | (c2 & 63)); - } - else if (c1 > 239 && c1 < 365) { - // Surrogate Pair - var c2 = bytes[pos++]; - var c3 = bytes[pos++]; - var c4 = bytes[pos++]; - var u = (((c1 & 7) << 18) | ((c2 & 63) << 12) | ((c3 & 63) << 6) | (c4 & 63)) - - 0x10000; - out[c++] = String.fromCharCode(0xd800 + (u >> 10)); - out[c++] = String.fromCharCode(0xdc00 + (u & 1023)); - } - else { - var c2 = bytes[pos++]; - var c3 = bytes[pos++]; - out[c++] = String.fromCharCode(((c1 & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63)); - } - } - return out.join(''); -}; -// We define it as an object literal instead of a class because a class compiled down to es5 can't -// be treeshaked. https://github.com/rollup/rollup/issues/1691 -// Static lookup maps, lazily populated by init_() -var base64 = { - /** - * Maps bytes to characters. - */ - byteToCharMap_: null, - /** - * Maps characters to bytes. - */ - charToByteMap_: null, - /** - * Maps bytes to websafe characters. - * @private - */ - byteToCharMapWebSafe_: null, - /** - * Maps websafe characters to bytes. - * @private - */ - charToByteMapWebSafe_: null, - /** - * Our default alphabet, shared between - * ENCODED_VALS and ENCODED_VALS_WEBSAFE - */ - ENCODED_VALS_BASE: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' + 'abcdefghijklmnopqrstuvwxyz' + '0123456789', - /** - * Our default alphabet. Value 64 (=) is special; it means "nothing." - */ - get ENCODED_VALS() { - return this.ENCODED_VALS_BASE + '+/='; - }, - /** - * Our websafe alphabet. - */ - get ENCODED_VALS_WEBSAFE() { - return this.ENCODED_VALS_BASE + '-_.'; - }, - /** - * Whether this browser supports the atob and btoa functions. This extension - * started at Mozilla but is now implemented by many browsers. We use the - * ASSUME_* variables to avoid pulling in the full useragent detection library - * but still allowing the standard per-browser compilations. - * - */ - HAS_NATIVE_SUPPORT: typeof atob === 'function', - /** - * Base64-encode an array of bytes. - * - * @param input An array of bytes (numbers with - * value in [0, 255]) to encode. - * @param webSafe Boolean indicating we should use the - * alternative alphabet. - * @return The base64 encoded string. - */ - encodeByteArray: function (input, webSafe) { - if (!Array.isArray(input)) { - throw Error('encodeByteArray takes an array as a parameter'); - } - this.init_(); - var byteToCharMap = webSafe - ? this.byteToCharMapWebSafe_ - : this.byteToCharMap_; - var output = []; - for (var i = 0; i < input.length; i += 3) { - var byte1 = input[i]; - var haveByte2 = i + 1 < input.length; - var byte2 = haveByte2 ? input[i + 1] : 0; - var haveByte3 = i + 2 < input.length; - var byte3 = haveByte3 ? input[i + 2] : 0; - var outByte1 = byte1 >> 2; - var outByte2 = ((byte1 & 0x03) << 4) | (byte2 >> 4); - var outByte3 = ((byte2 & 0x0f) << 2) | (byte3 >> 6); - var outByte4 = byte3 & 0x3f; - if (!haveByte3) { - outByte4 = 64; - if (!haveByte2) { - outByte3 = 64; - } - } - output.push(byteToCharMap[outByte1], byteToCharMap[outByte2], byteToCharMap[outByte3], byteToCharMap[outByte4]); - } - return output.join(''); - }, - /** - * Base64-encode a string. - * - * @param input A string to encode. - * @param webSafe If true, we should use the - * alternative alphabet. - * @return The base64 encoded string. - */ - encodeString: function (input, webSafe) { - // Shortcut for Mozilla browsers that implement - // a native base64 encoder in the form of "btoa/atob" - if (this.HAS_NATIVE_SUPPORT && !webSafe) { - return btoa(input); - } - return this.encodeByteArray(stringToByteArray$1(input), webSafe); - }, - /** - * Base64-decode a string. - * - * @param input to decode. - * @param webSafe True if we should use the - * alternative alphabet. - * @return string representing the decoded value. - */ - decodeString: function (input, webSafe) { - // Shortcut for Mozilla browsers that implement - // a native base64 encoder in the form of "btoa/atob" - if (this.HAS_NATIVE_SUPPORT && !webSafe) { - return atob(input); - } - return byteArrayToString(this.decodeStringToByteArray(input, webSafe)); - }, - /** - * Base64-decode a string. - * - * In base-64 decoding, groups of four characters are converted into three - * bytes. If the encoder did not apply padding, the input length may not - * be a multiple of 4. - * - * In this case, the last group will have fewer than 4 characters, and - * padding will be inferred. If the group has one or two characters, it decodes - * to one byte. If the group has three characters, it decodes to two bytes. - * - * @param input Input to decode. - * @param webSafe True if we should use the web-safe alphabet. - * @return bytes representing the decoded value. - */ - decodeStringToByteArray: function (input, webSafe) { - this.init_(); - var charToByteMap = webSafe - ? this.charToByteMapWebSafe_ - : this.charToByteMap_; - var output = []; - for (var i = 0; i < input.length;) { - var byte1 = charToByteMap[input.charAt(i++)]; - var haveByte2 = i < input.length; - var byte2 = haveByte2 ? charToByteMap[input.charAt(i)] : 0; - ++i; - var haveByte3 = i < input.length; - var byte3 = haveByte3 ? charToByteMap[input.charAt(i)] : 64; - ++i; - var haveByte4 = i < input.length; - var byte4 = haveByte4 ? charToByteMap[input.charAt(i)] : 64; - ++i; - if (byte1 == null || byte2 == null || byte3 == null || byte4 == null) { - throw Error(); - } - var outByte1 = (byte1 << 2) | (byte2 >> 4); - output.push(outByte1); - if (byte3 !== 64) { - var outByte2 = ((byte2 << 4) & 0xf0) | (byte3 >> 2); - output.push(outByte2); - if (byte4 !== 64) { - var outByte3 = ((byte3 << 6) & 0xc0) | byte4; - output.push(outByte3); - } - } - } - return output; - }, - /** - * Lazy static initialization function. Called before - * accessing any of the static map variables. - * @private - */ - init_: function () { - if (!this.byteToCharMap_) { - this.byteToCharMap_ = {}; - this.charToByteMap_ = {}; - this.byteToCharMapWebSafe_ = {}; - this.charToByteMapWebSafe_ = {}; - // We want quick mappings back and forth, so we precompute two maps. - for (var i = 0; i < this.ENCODED_VALS.length; i++) { - this.byteToCharMap_[i] = this.ENCODED_VALS.charAt(i); - this.charToByteMap_[this.byteToCharMap_[i]] = i; - this.byteToCharMapWebSafe_[i] = this.ENCODED_VALS_WEBSAFE.charAt(i); - this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[i]] = i; - // Be forgiving when decoding and correctly decode both encodings. - if (i >= this.ENCODED_VALS_BASE.length) { - this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(i)] = i; - this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(i)] = i; - } - } - } - } -}; -/** - * URL-safe base64 encoding - */ -var base64Encode = function (str) { - var utf8Bytes = stringToByteArray$1(str); - return base64.encodeByteArray(utf8Bytes, true); -}; -/** - * URL-safe base64 encoding (without "." padding in the end). - * e.g. Used in JSON Web Token (JWT) parts. - */ -var base64urlEncodeWithoutPadding = function (str) { - // Use base64url encoding and remove padding in the end (dot characters). - return base64Encode(str).replace(/\./g, ''); -}; -/** - * URL-safe base64 decoding - * - * NOTE: DO NOT use the global atob() function - it does NOT support the - * base64Url variant encoding. - * - * @param str To be decoded - * @return Decoded result, if possible - */ -var base64Decode = function (str) { - try { - return base64.decodeString(str, true); - } - catch (e) { - console.error('base64Decode failed: ', e); - } - return null; -}; - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Do a deep-copy of basic JavaScript Objects or Arrays. - */ -function deepCopy(value) { - return deepExtend(undefined, value); -} -/** - * Copy properties from source to target (recursively allows extension - * of Objects and Arrays). Scalar values in the target are over-written. - * If target is undefined, an object of the appropriate type will be created - * (and returned). - * - * We recursively copy all child properties of plain Objects in the source- so - * that namespace- like dictionaries are merged. - * - * Note that the target can be a function, in which case the properties in - * the source Object are copied onto it as static properties of the Function. - * - * Note: we don't merge __proto__ to prevent prototype pollution - */ -function deepExtend(target, source) { - if (!(source instanceof Object)) { - return source; - } - switch (source.constructor) { - case Date: - // Treat Dates like scalars; if the target date object had any child - // properties - they will be lost! - var dateValue = source; - return new Date(dateValue.getTime()); - case Object: - if (target === undefined) { - target = {}; - } - break; - case Array: - // Always copy the array source and overwrite the target. - target = []; - break; - default: - // Not a plain Object - treat it as a scalar. - return source; - } - for (var prop in source) { - // use isValidKey to guard against prototype pollution. See https://snyk.io/vuln/SNYK-JS-LODASH-450202 - if (!source.hasOwnProperty(prop) || !isValidKey(prop)) { - continue; - } - target[prop] = deepExtend(target[prop], source[prop]); - } - return target; -} -function isValidKey(key) { - return key !== '__proto__'; -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Returns navigator.userAgent string or '' if it's not defined. - * @return user agent string - */ -function getUA() { - if (typeof navigator !== 'undefined' && - typeof navigator['userAgent'] === 'string') { - return navigator['userAgent']; - } - else { - return ''; - } -} -/** - * Detect Cordova / PhoneGap / Ionic frameworks on a mobile device. - * - * Deliberately does not rely on checking `file://` URLs (as this fails PhoneGap - * in the Ripple emulator) nor Cordova `onDeviceReady`, which would normally - * wait for a callback. - */ -function isMobileCordova() { - return (typeof window !== 'undefined' && - // @ts-ignore Setting up an broadly applicable index signature for Window - // just to deal with this case would probably be a bad idea. - !!(window['cordova'] || window['phonegap'] || window['PhoneGap']) && - /ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(getUA())); -} -/** - * Detect Node.js. - * - * @return true if Node.js environment is detected. - */ -// Node detection logic from: https://github.com/iliakan/detect-node/ -function isNode() { - try { - return (Object.prototype.toString.call(global.process) === '[object process]'); - } - catch (e) { - return false; - } -} -/** - * Detect Browser Environment - */ -function isBrowser() { - return typeof self === 'object' && self.self === self; -} -function isBrowserExtension() { - var runtime = typeof chrome === 'object' - ? chrome.runtime - : typeof browser === 'object' - ? browser.runtime - : undefined; - return typeof runtime === 'object' && runtime.id !== undefined; -} -/** - * Detect React Native. - * - * @return true if ReactNative environment is detected. - */ -function isReactNative() { - return (typeof navigator === 'object' && navigator['product'] === 'ReactNative'); -} -/** Detects Electron apps. */ -function isElectron() { - return getUA().indexOf('Electron/') >= 0; -} -/** Detects Internet Explorer. */ -function isIE() { - var ua = getUA(); - return ua.indexOf('MSIE ') >= 0 || ua.indexOf('Trident/') >= 0; -} -/** Detects Universal Windows Platform apps. */ -function isUWP() { - return getUA().indexOf('MSAppHost/') >= 0; -} -/** - * Detect whether the current SDK build is the Node version. - * - * @return true if it's the Node SDK build. - */ -function isNodeSdk() { - return CONSTANTS.NODE_CLIENT === true || CONSTANTS.NODE_ADMIN === true; -} -/** Returns true if we are running in Safari. */ -function isSafari() { - return (!isNode() && - navigator.userAgent.includes('Safari') && - !navigator.userAgent.includes('Chrome')); -} -/** - * This method checks if indexedDB is supported by current browser/service worker context - * @return true if indexedDB is supported by current browser/service worker context - */ -function isIndexedDBAvailable() { - return typeof indexedDB === 'object'; -} -/** - * This method validates browser/sw context for indexedDB by opening a dummy indexedDB database and reject - * if errors occur during the database open operation. - * - * @throws exception if current browser/sw context can't run idb.open (ex: Safari iframe, Firefox - * private browsing) - */ -function validateIndexedDBOpenable() { - return new Promise(function (resolve, reject) { - try { - var preExist_1 = true; - var DB_CHECK_NAME_1 = 'validate-browser-context-for-indexeddb-analytics-module'; - var request_1 = self.indexedDB.open(DB_CHECK_NAME_1); - request_1.onsuccess = function () { - request_1.result.close(); - // delete database only when it doesn't pre-exist - if (!preExist_1) { - self.indexedDB.deleteDatabase(DB_CHECK_NAME_1); - } - resolve(true); - }; - request_1.onupgradeneeded = function () { - preExist_1 = false; - }; - request_1.onerror = function () { - var _a; - reject(((_a = request_1.error) === null || _a === void 0 ? void 0 : _a.message) || ''); - }; - } - catch (error) { - reject(error); - } - }); -} -/** - * - * This method checks whether cookie is enabled within current browser - * @return true if cookie is enabled within current browser - */ -function areCookiesEnabled() { - if (typeof navigator === 'undefined' || !navigator.cookieEnabled) { - return false; - } - return true; -} -/** - * Polyfill for `globalThis` object. - * @returns the `globalThis` object for the given environment. - */ -function getGlobal() { - if (typeof self !== 'undefined') { - return self; - } - if (typeof window !== 'undefined') { - return window; - } - if (typeof global !== 'undefined') { - return global; - } - throw new Error('Unable to locate global object.'); -} - -/** - * @license - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var getDefaultsFromGlobal = function () { - return getGlobal().__FIREBASE_DEFAULTS__; -}; -/** - * Attempt to read defaults from a JSON string provided to - * process.env.__FIREBASE_DEFAULTS__ or a JSON file whose path is in - * process.env.__FIREBASE_DEFAULTS_PATH__ - */ -var getDefaultsFromEnvVariable = function () { - if (typeof process === 'undefined' || typeof process.env === 'undefined') { - return; - } - var defaultsJsonString = process.env.__FIREBASE_DEFAULTS__; - if (defaultsJsonString) { - return JSON.parse(defaultsJsonString); - } -}; -var getDefaultsFromCookie = function () { - if (typeof document === 'undefined') { - return; - } - var match; - try { - match = document.cookie.match(/__FIREBASE_DEFAULTS__=([^;]+)/); - } - catch (e) { - // Some environments such as Angular Universal SSR have a - // `document` object but error on accessing `document.cookie`. - return; - } - var decoded = match && base64Decode(match[1]); - return decoded && JSON.parse(decoded); -}; -/** - * Get the __FIREBASE_DEFAULTS__ object. It checks in order: - * (1) if such an object exists as a property of `globalThis` - * (2) if such an object was provided on a shell environment variable - * (3) if such an object exists in a cookie - */ -var getDefaults = function () { - try { - return (getDefaultsFromGlobal() || - getDefaultsFromEnvVariable() || - getDefaultsFromCookie()); - } - catch (e) { - /** - * Catch-all for being unable to get __FIREBASE_DEFAULTS__ due - * to any environment case we have not accounted for. Log to - * info instead of swallowing so we can find these unknown cases - * and add paths for them if needed. - */ - console.info("Unable to get __FIREBASE_DEFAULTS__ due to: " + e); - return; - } -}; -/** - * Returns emulator host stored in the __FIREBASE_DEFAULTS__ object - * for the given product. - * @returns a URL host formatted like `127.0.0.1:9999` or `[::1]:4000` if available - * @public - */ -var getDefaultEmulatorHost = function (productName) { var _a, _b; return (_b = (_a = getDefaults()) === null || _a === void 0 ? void 0 : _a.emulatorHosts) === null || _b === void 0 ? void 0 : _b[productName]; }; -/** - * Returns emulator hostname and port stored in the __FIREBASE_DEFAULTS__ object - * for the given product. - * @returns a pair of hostname and port like `["::1", 4000]` if available - * @public - */ -var getDefaultEmulatorHostnameAndPort = function (productName) { - var host = getDefaultEmulatorHost(productName); - if (!host) { - return undefined; - } - var separatorIndex = host.lastIndexOf(':'); // Finding the last since IPv6 addr also has colons. - if (separatorIndex <= 0 || separatorIndex + 1 === host.length) { - throw new Error("Invalid host " + host + " with no separate hostname and port!"); - } - // eslint-disable-next-line no-restricted-globals - var port = parseInt(host.substring(separatorIndex + 1), 10); - if (host[0] === '[') { - // Bracket-quoted `[ipv6addr]:port` => return "ipv6addr" (without brackets). - return [host.substring(1, separatorIndex - 1), port]; - } - else { - return [host.substring(0, separatorIndex), port]; - } -}; -/** - * Returns Firebase app config stored in the __FIREBASE_DEFAULTS__ object. - * @public - */ -var getDefaultAppConfig = function () { var _a; return (_a = getDefaults()) === null || _a === void 0 ? void 0 : _a.config; }; -/** - * Returns an experimental setting on the __FIREBASE_DEFAULTS__ object (properties - * prefixed by "_") - * @public - */ -var getExperimentalSetting = function (name) { var _a; return (_a = getDefaults()) === null || _a === void 0 ? void 0 : _a["_" + name]; }; - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var Deferred = /** @class */ (function () { - function Deferred() { - var _this = this; - this.reject = function () { }; - this.resolve = function () { }; - this.promise = new Promise(function (resolve, reject) { - _this.resolve = resolve; - _this.reject = reject; - }); - } - /** - * Our API internals are not promiseified and cannot because our callback APIs have subtle expectations around - * invoking promises inline, which Promises are forbidden to do. This method accepts an optional node-style callback - * and returns a node-style callback which will resolve or reject the Deferred's promise. - */ - Deferred.prototype.wrapCallback = function (callback) { - var _this = this; - return function (error, value) { - if (error) { - _this.reject(error); - } - else { - _this.resolve(value); - } - if (typeof callback === 'function') { - // Attaching noop handler just in case developer wasn't expecting - // promises - _this.promise.catch(function () { }); - // Some of our callbacks don't expect a value and our own tests - // assert that the parameter length is 1 - if (callback.length === 1) { - callback(error); - } - else { - callback(error, value); - } - } - }; - }; - return Deferred; -}()); - -/** - * @license - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -function createMockUserToken(token, projectId) { - if (token.uid) { - throw new Error('The "uid" field is no longer supported by mockUserToken. Please use "sub" instead for Firebase Auth User ID.'); - } - // Unsecured JWTs use "none" as the algorithm. - var header = { - alg: 'none', - type: 'JWT' - }; - var project = projectId || 'demo-project'; - var iat = token.iat || 0; - var sub = token.sub || token.user_id; - if (!sub) { - throw new Error("mockUserToken must contain 'sub' or 'user_id' field!"); - } - var payload = tslib.__assign({ - // Set all required fields to decent defaults - iss: "https://securetoken.google.com/" + project, aud: project, iat: iat, exp: iat + 3600, auth_time: iat, sub: sub, user_id: sub, firebase: { - sign_in_provider: 'custom', - identities: {} - } }, token); - // Unsecured JWTs use the empty string as a signature. - var signature = ''; - return [ - base64urlEncodeWithoutPadding(JSON.stringify(header)), - base64urlEncodeWithoutPadding(JSON.stringify(payload)), - signature - ].join('.'); -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var ERROR_NAME = 'FirebaseError'; -// Based on code from: -// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error#Custom_Error_Types -var FirebaseError = /** @class */ (function (_super) { - tslib.__extends(FirebaseError, _super); - function FirebaseError( - /** The error code for this error. */ - code, message, - /** Custom data for this error. */ - customData) { - var _this = _super.call(this, message) || this; - _this.code = code; - _this.customData = customData; - /** The custom name for all FirebaseErrors. */ - _this.name = ERROR_NAME; - // Fix For ES5 - // https://github.com/Microsoft/TypeScript-wiki/blob/master/Breaking-Changes.md#extending-built-ins-like-error-array-and-map-may-no-longer-work - Object.setPrototypeOf(_this, FirebaseError.prototype); - // Maintains proper stack trace for where our error was thrown. - // Only available on V8. - if (Error.captureStackTrace) { - Error.captureStackTrace(_this, ErrorFactory.prototype.create); - } - return _this; - } - return FirebaseError; -}(Error)); -var ErrorFactory = /** @class */ (function () { - function ErrorFactory(service, serviceName, errors) { - this.service = service; - this.serviceName = serviceName; - this.errors = errors; - } - ErrorFactory.prototype.create = function (code) { - var data = []; - for (var _i = 1; _i < arguments.length; _i++) { - data[_i - 1] = arguments[_i]; - } - var customData = data[0] || {}; - var fullCode = this.service + "/" + code; - var template = this.errors[code]; - var message = template ? replaceTemplate(template, customData) : 'Error'; - // Service Name: Error message (service/code). - var fullMessage = this.serviceName + ": " + message + " (" + fullCode + ")."; - var error = new FirebaseError(fullCode, fullMessage, customData); - return error; - }; - return ErrorFactory; -}()); -function replaceTemplate(template, data) { - return template.replace(PATTERN, function (_, key) { - var value = data[key]; - return value != null ? String(value) : "<" + key + "?>"; - }); -} -var PATTERN = /\{\$([^}]+)}/g; - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Evaluates a JSON string into a javascript object. - * - * @param {string} str A string containing JSON. - * @return {*} The javascript object representing the specified JSON. - */ -function jsonEval(str) { - return JSON.parse(str); -} -/** - * Returns JSON representing a javascript object. - * @param {*} data Javascript object to be stringified. - * @return {string} The JSON contents of the object. - */ -function stringify(data) { - return JSON.stringify(data); -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Decodes a Firebase auth. token into constituent parts. - * - * Notes: - * - May return with invalid / incomplete claims if there's no native base64 decoding support. - * - Doesn't check if the token is actually valid. - */ -var decode = function (token) { - var header = {}, claims = {}, data = {}, signature = ''; - try { - var parts = token.split('.'); - header = jsonEval(base64Decode(parts[0]) || ''); - claims = jsonEval(base64Decode(parts[1]) || ''); - signature = parts[2]; - data = claims['d'] || {}; - delete claims['d']; - } - catch (e) { } - return { - header: header, - claims: claims, - data: data, - signature: signature - }; -}; -/** - * Decodes a Firebase auth. token and checks the validity of its time-based claims. Will return true if the - * token is within the time window authorized by the 'nbf' (not-before) and 'iat' (issued-at) claims. - * - * Notes: - * - May return a false negative if there's no native base64 decoding support. - * - Doesn't check if the token is actually valid. - */ -var isValidTimestamp = function (token) { - var claims = decode(token).claims; - var now = Math.floor(new Date().getTime() / 1000); - var validSince = 0, validUntil = 0; - if (typeof claims === 'object') { - if (claims.hasOwnProperty('nbf')) { - validSince = claims['nbf']; - } - else if (claims.hasOwnProperty('iat')) { - validSince = claims['iat']; - } - if (claims.hasOwnProperty('exp')) { - validUntil = claims['exp']; - } - else { - // token will expire after 24h by default - validUntil = validSince + 86400; - } - } - return (!!now && - !!validSince && - !!validUntil && - now >= validSince && - now <= validUntil); -}; -/** - * Decodes a Firebase auth. token and returns its issued at time if valid, null otherwise. - * - * Notes: - * - May return null if there's no native base64 decoding support. - * - Doesn't check if the token is actually valid. - */ -var issuedAtTime = function (token) { - var claims = decode(token).claims; - if (typeof claims === 'object' && claims.hasOwnProperty('iat')) { - return claims['iat']; - } - return null; -}; -/** - * Decodes a Firebase auth. token and checks the validity of its format. Expects a valid issued-at time. - * - * Notes: - * - May return a false negative if there's no native base64 decoding support. - * - Doesn't check if the token is actually valid. - */ -var isValidFormat = function (token) { - var decoded = decode(token), claims = decoded.claims; - return !!claims && typeof claims === 'object' && claims.hasOwnProperty('iat'); -}; -/** - * Attempts to peer into an auth token and determine if it's an admin auth token by looking at the claims portion. - * - * Notes: - * - May return a false negative if there's no native base64 decoding support. - * - Doesn't check if the token is actually valid. - */ -var isAdmin = function (token) { - var claims = decode(token).claims; - return typeof claims === 'object' && claims['admin'] === true; -}; - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -function contains(obj, key) { - return Object.prototype.hasOwnProperty.call(obj, key); -} -function safeGet(obj, key) { - if (Object.prototype.hasOwnProperty.call(obj, key)) { - return obj[key]; - } - else { - return undefined; - } -} -function isEmpty(obj) { - for (var key in obj) { - if (Object.prototype.hasOwnProperty.call(obj, key)) { - return false; - } - } - return true; -} -function map(obj, fn, contextObj) { - var res = {}; - for (var key in obj) { - if (Object.prototype.hasOwnProperty.call(obj, key)) { - res[key] = fn.call(contextObj, obj[key], key, obj); - } - } - return res; -} -/** - * Deep equal two objects. Support Arrays and Objects. - */ -function deepEqual(a, b) { - if (a === b) { - return true; - } - var aKeys = Object.keys(a); - var bKeys = Object.keys(b); - for (var _i = 0, aKeys_1 = aKeys; _i < aKeys_1.length; _i++) { - var k = aKeys_1[_i]; - if (!bKeys.includes(k)) { - return false; - } - var aProp = a[k]; - var bProp = b[k]; - if (isObject(aProp) && isObject(bProp)) { - if (!deepEqual(aProp, bProp)) { - return false; - } - } - else if (aProp !== bProp) { - return false; - } - } - for (var _a = 0, bKeys_1 = bKeys; _a < bKeys_1.length; _a++) { - var k = bKeys_1[_a]; - if (!aKeys.includes(k)) { - return false; - } - } - return true; -} -function isObject(thing) { - return thing !== null && typeof thing === 'object'; -} - -/** - * @license - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Rejects if the given promise doesn't resolve in timeInMS milliseconds. - * @internal - */ -function promiseWithTimeout(promise, timeInMS) { - if (timeInMS === void 0) { timeInMS = 2000; } - var deferredPromise = new Deferred(); - setTimeout(function () { return deferredPromise.reject('timeout!'); }, timeInMS); - promise.then(deferredPromise.resolve, deferredPromise.reject); - return deferredPromise.promise; -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Returns a querystring-formatted string (e.g. &arg=val&arg2=val2) from a - * params object (e.g. {arg: 'val', arg2: 'val2'}) - * Note: You must prepend it with ? when adding it to a URL. - */ -function querystring(querystringParams) { - var params = []; - var _loop_1 = function (key, value) { - if (Array.isArray(value)) { - value.forEach(function (arrayVal) { - params.push(encodeURIComponent(key) + '=' + encodeURIComponent(arrayVal)); - }); - } - else { - params.push(encodeURIComponent(key) + '=' + encodeURIComponent(value)); - } - }; - for (var _i = 0, _a = Object.entries(querystringParams); _i < _a.length; _i++) { - var _b = _a[_i], key = _b[0], value = _b[1]; - _loop_1(key, value); - } - return params.length ? '&' + params.join('&') : ''; -} -/** - * Decodes a querystring (e.g. ?arg=val&arg2=val2) into a params object - * (e.g. {arg: 'val', arg2: 'val2'}) - */ -function querystringDecode(querystring) { - var obj = {}; - var tokens = querystring.replace(/^\?/, '').split('&'); - tokens.forEach(function (token) { - if (token) { - var _a = token.split('='), key = _a[0], value = _a[1]; - obj[decodeURIComponent(key)] = decodeURIComponent(value); - } - }); - return obj; -} -/** - * Extract the query string part of a URL, including the leading question mark (if present). - */ -function extractQuerystring(url) { - var queryStart = url.indexOf('?'); - if (!queryStart) { - return ''; - } - var fragmentStart = url.indexOf('#', queryStart); - return url.substring(queryStart, fragmentStart > 0 ? fragmentStart : undefined); -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * @fileoverview SHA-1 cryptographic hash. - * Variable names follow the notation in FIPS PUB 180-3: - * http://csrc.nist.gov/publications/fips/fips180-3/fips180-3_final.pdf. - * - * Usage: - * var sha1 = new sha1(); - * sha1.update(bytes); - * var hash = sha1.digest(); - * - * Performance: - * Chrome 23: ~400 Mbit/s - * Firefox 16: ~250 Mbit/s - * - */ -/** - * SHA-1 cryptographic hash constructor. - * - * The properties declared here are discussed in the above algorithm document. - * @constructor - * @final - * @struct - */ -var Sha1 = /** @class */ (function () { - function Sha1() { - /** - * Holds the previous values of accumulated variables a-e in the compress_ - * function. - * @private - */ - this.chain_ = []; - /** - * A buffer holding the partially computed hash result. - * @private - */ - this.buf_ = []; - /** - * An array of 80 bytes, each a part of the message to be hashed. Referred to - * as the message schedule in the docs. - * @private - */ - this.W_ = []; - /** - * Contains data needed to pad messages less than 64 bytes. - * @private - */ - this.pad_ = []; - /** - * @private {number} - */ - this.inbuf_ = 0; - /** - * @private {number} - */ - this.total_ = 0; - this.blockSize = 512 / 8; - this.pad_[0] = 128; - for (var i = 1; i < this.blockSize; ++i) { - this.pad_[i] = 0; - } - this.reset(); - } - Sha1.prototype.reset = function () { - this.chain_[0] = 0x67452301; - this.chain_[1] = 0xefcdab89; - this.chain_[2] = 0x98badcfe; - this.chain_[3] = 0x10325476; - this.chain_[4] = 0xc3d2e1f0; - this.inbuf_ = 0; - this.total_ = 0; - }; - /** - * Internal compress helper function. - * @param buf Block to compress. - * @param offset Offset of the block in the buffer. - * @private - */ - Sha1.prototype.compress_ = function (buf, offset) { - if (!offset) { - offset = 0; - } - var W = this.W_; - // get 16 big endian words - if (typeof buf === 'string') { - for (var i = 0; i < 16; i++) { - // TODO(user): [bug 8140122] Recent versions of Safari for Mac OS and iOS - // have a bug that turns the post-increment ++ operator into pre-increment - // during JIT compilation. We have code that depends heavily on SHA-1 for - // correctness and which is affected by this bug, so I've removed all uses - // of post-increment ++ in which the result value is used. We can revert - // this change once the Safari bug - // (https://bugs.webkit.org/show_bug.cgi?id=109036) has been fixed and - // most clients have been updated. - W[i] = - (buf.charCodeAt(offset) << 24) | - (buf.charCodeAt(offset + 1) << 16) | - (buf.charCodeAt(offset + 2) << 8) | - buf.charCodeAt(offset + 3); - offset += 4; - } - } - else { - for (var i = 0; i < 16; i++) { - W[i] = - (buf[offset] << 24) | - (buf[offset + 1] << 16) | - (buf[offset + 2] << 8) | - buf[offset + 3]; - offset += 4; - } - } - // expand to 80 words - for (var i = 16; i < 80; i++) { - var t = W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16]; - W[i] = ((t << 1) | (t >>> 31)) & 0xffffffff; - } - var a = this.chain_[0]; - var b = this.chain_[1]; - var c = this.chain_[2]; - var d = this.chain_[3]; - var e = this.chain_[4]; - var f, k; - // TODO(user): Try to unroll this loop to speed up the computation. - for (var i = 0; i < 80; i++) { - if (i < 40) { - if (i < 20) { - f = d ^ (b & (c ^ d)); - k = 0x5a827999; - } - else { - f = b ^ c ^ d; - k = 0x6ed9eba1; - } - } - else { - if (i < 60) { - f = (b & c) | (d & (b | c)); - k = 0x8f1bbcdc; - } - else { - f = b ^ c ^ d; - k = 0xca62c1d6; - } - } - var t = (((a << 5) | (a >>> 27)) + f + e + k + W[i]) & 0xffffffff; - e = d; - d = c; - c = ((b << 30) | (b >>> 2)) & 0xffffffff; - b = a; - a = t; - } - this.chain_[0] = (this.chain_[0] + a) & 0xffffffff; - this.chain_[1] = (this.chain_[1] + b) & 0xffffffff; - this.chain_[2] = (this.chain_[2] + c) & 0xffffffff; - this.chain_[3] = (this.chain_[3] + d) & 0xffffffff; - this.chain_[4] = (this.chain_[4] + e) & 0xffffffff; - }; - Sha1.prototype.update = function (bytes, length) { - // TODO(johnlenz): tighten the function signature and remove this check - if (bytes == null) { - return; - } - if (length === undefined) { - length = bytes.length; - } - var lengthMinusBlock = length - this.blockSize; - var n = 0; - // Using local instead of member variables gives ~5% speedup on Firefox 16. - var buf = this.buf_; - var inbuf = this.inbuf_; - // The outer while loop should execute at most twice. - while (n < length) { - // When we have no data in the block to top up, we can directly process the - // input buffer (assuming it contains sufficient data). This gives ~25% - // speedup on Chrome 23 and ~15% speedup on Firefox 16, but requires that - // the data is provided in large chunks (or in multiples of 64 bytes). - if (inbuf === 0) { - while (n <= lengthMinusBlock) { - this.compress_(bytes, n); - n += this.blockSize; - } - } - if (typeof bytes === 'string') { - while (n < length) { - buf[inbuf] = bytes.charCodeAt(n); - ++inbuf; - ++n; - if (inbuf === this.blockSize) { - this.compress_(buf); - inbuf = 0; - // Jump to the outer loop so we use the full-block optimization. - break; - } - } - } - else { - while (n < length) { - buf[inbuf] = bytes[n]; - ++inbuf; - ++n; - if (inbuf === this.blockSize) { - this.compress_(buf); - inbuf = 0; - // Jump to the outer loop so we use the full-block optimization. - break; - } - } - } - } - this.inbuf_ = inbuf; - this.total_ += length; - }; - /** @override */ - Sha1.prototype.digest = function () { - var digest = []; - var totalBits = this.total_ * 8; - // Add pad 0x80 0x00*. - if (this.inbuf_ < 56) { - this.update(this.pad_, 56 - this.inbuf_); - } - else { - this.update(this.pad_, this.blockSize - (this.inbuf_ - 56)); - } - // Add # bits. - for (var i = this.blockSize - 1; i >= 56; i--) { - this.buf_[i] = totalBits & 255; - totalBits /= 256; // Don't use bit-shifting here! - } - this.compress_(this.buf_); - var n = 0; - for (var i = 0; i < 5; i++) { - for (var j = 24; j >= 0; j -= 8) { - digest[n] = (this.chain_[i] >> j) & 255; - ++n; - } - } - return digest; - }; - return Sha1; -}()); - -/** - * Helper to make a Subscribe function (just like Promise helps make a - * Thenable). - * - * @param executor Function which can make calls to a single Observer - * as a proxy. - * @param onNoObservers Callback when count of Observers goes to zero. - */ -function createSubscribe(executor, onNoObservers) { - var proxy = new ObserverProxy(executor, onNoObservers); - return proxy.subscribe.bind(proxy); -} -/** - * Implement fan-out for any number of Observers attached via a subscribe - * function. - */ -var ObserverProxy = /** @class */ (function () { - /** - * @param executor Function which can make calls to a single Observer - * as a proxy. - * @param onNoObservers Callback when count of Observers goes to zero. - */ - function ObserverProxy(executor, onNoObservers) { - var _this = this; - this.observers = []; - this.unsubscribes = []; - this.observerCount = 0; - // Micro-task scheduling by calling task.then(). - this.task = Promise.resolve(); - this.finalized = false; - this.onNoObservers = onNoObservers; - // Call the executor asynchronously so subscribers that are called - // synchronously after the creation of the subscribe function - // can still receive the very first value generated in the executor. - this.task - .then(function () { - executor(_this); - }) - .catch(function (e) { - _this.error(e); - }); - } - ObserverProxy.prototype.next = function (value) { - this.forEachObserver(function (observer) { - observer.next(value); - }); - }; - ObserverProxy.prototype.error = function (error) { - this.forEachObserver(function (observer) { - observer.error(error); - }); - this.close(error); - }; - ObserverProxy.prototype.complete = function () { - this.forEachObserver(function (observer) { - observer.complete(); - }); - this.close(); - }; - /** - * Subscribe function that can be used to add an Observer to the fan-out list. - * - * - We require that no event is sent to a subscriber sychronously to their - * call to subscribe(). - */ - ObserverProxy.prototype.subscribe = function (nextOrObserver, error, complete) { - var _this = this; - var observer; - if (nextOrObserver === undefined && - error === undefined && - complete === undefined) { - throw new Error('Missing Observer.'); - } - // Assemble an Observer object when passed as callback functions. - if (implementsAnyMethods(nextOrObserver, [ - 'next', - 'error', - 'complete' - ])) { - observer = nextOrObserver; - } - else { - observer = { - next: nextOrObserver, - error: error, - complete: complete - }; - } - if (observer.next === undefined) { - observer.next = noop; - } - if (observer.error === undefined) { - observer.error = noop; - } - if (observer.complete === undefined) { - observer.complete = noop; - } - var unsub = this.unsubscribeOne.bind(this, this.observers.length); - // Attempt to subscribe to a terminated Observable - we - // just respond to the Observer with the final error or complete - // event. - if (this.finalized) { - // eslint-disable-next-line @typescript-eslint/no-floating-promises - this.task.then(function () { - try { - if (_this.finalError) { - observer.error(_this.finalError); - } - else { - observer.complete(); - } - } - catch (e) { - // nothing - } - return; - }); - } - this.observers.push(observer); - return unsub; - }; - // Unsubscribe is synchronous - we guarantee that no events are sent to - // any unsubscribed Observer. - ObserverProxy.prototype.unsubscribeOne = function (i) { - if (this.observers === undefined || this.observers[i] === undefined) { - return; - } - delete this.observers[i]; - this.observerCount -= 1; - if (this.observerCount === 0 && this.onNoObservers !== undefined) { - this.onNoObservers(this); - } - }; - ObserverProxy.prototype.forEachObserver = function (fn) { - if (this.finalized) { - // Already closed by previous event....just eat the additional values. - return; - } - // Since sendOne calls asynchronously - there is no chance that - // this.observers will become undefined. - for (var i = 0; i < this.observers.length; i++) { - this.sendOne(i, fn); - } - }; - // Call the Observer via one of it's callback function. We are careful to - // confirm that the observe has not been unsubscribed since this asynchronous - // function had been queued. - ObserverProxy.prototype.sendOne = function (i, fn) { - var _this = this; - // Execute the callback asynchronously - // eslint-disable-next-line @typescript-eslint/no-floating-promises - this.task.then(function () { - if (_this.observers !== undefined && _this.observers[i] !== undefined) { - try { - fn(_this.observers[i]); - } - catch (e) { - // Ignore exceptions raised in Observers or missing methods of an - // Observer. - // Log error to console. b/31404806 - if (typeof console !== 'undefined' && console.error) { - console.error(e); - } - } - } - }); - }; - ObserverProxy.prototype.close = function (err) { - var _this = this; - if (this.finalized) { - return; - } - this.finalized = true; - if (err !== undefined) { - this.finalError = err; - } - // Proxy is no longer needed - garbage collect references - // eslint-disable-next-line @typescript-eslint/no-floating-promises - this.task.then(function () { - _this.observers = undefined; - _this.onNoObservers = undefined; - }); - }; - return ObserverProxy; -}()); -/** Turn synchronous function into one called asynchronously. */ -// eslint-disable-next-line @typescript-eslint/ban-types -function async(fn, onError) { - return function () { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - Promise.resolve(true) - .then(function () { - fn.apply(void 0, args); - }) - .catch(function (error) { - if (onError) { - onError(error); - } - }); - }; -} -/** - * Return true if the object passed in implements any of the named methods. - */ -function implementsAnyMethods(obj, methods) { - if (typeof obj !== 'object' || obj === null) { - return false; - } - for (var _i = 0, methods_1 = methods; _i < methods_1.length; _i++) { - var method = methods_1[_i]; - if (method in obj && typeof obj[method] === 'function') { - return true; - } - } - return false; -} -function noop() { - // do nothing -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Check to make sure the appropriate number of arguments are provided for a public function. - * Throws an error if it fails. - * - * @param fnName The function name - * @param minCount The minimum number of arguments to allow for the function call - * @param maxCount The maximum number of argument to allow for the function call - * @param argCount The actual number of arguments provided. - */ -var validateArgCount = function (fnName, minCount, maxCount, argCount) { - var argError; - if (argCount < minCount) { - argError = 'at least ' + minCount; - } - else if (argCount > maxCount) { - argError = maxCount === 0 ? 'none' : 'no more than ' + maxCount; - } - if (argError) { - var error = fnName + - ' failed: Was called with ' + - argCount + - (argCount === 1 ? ' argument.' : ' arguments.') + - ' Expects ' + - argError + - '.'; - throw new Error(error); - } -}; -/** - * Generates a string to prefix an error message about failed argument validation - * - * @param fnName The function name - * @param argName The name of the argument - * @return The prefix to add to the error thrown for validation. - */ -function errorPrefix(fnName, argName) { - return fnName + " failed: " + argName + " argument "; -} -/** - * @param fnName - * @param argumentNumber - * @param namespace - * @param optional - */ -function validateNamespace(fnName, namespace, optional) { - if (optional && !namespace) { - return; - } - if (typeof namespace !== 'string') { - //TODO: I should do more validation here. We only allow certain chars in namespaces. - throw new Error(errorPrefix(fnName, 'namespace') + 'must be a valid firebase namespace.'); - } -} -function validateCallback(fnName, argumentName, -// eslint-disable-next-line @typescript-eslint/ban-types -callback, optional) { - if (optional && !callback) { - return; - } - if (typeof callback !== 'function') { - throw new Error(errorPrefix(fnName, argumentName) + 'must be a valid function.'); - } -} -function validateContextObject(fnName, argumentName, context, optional) { - if (optional && !context) { - return; - } - if (typeof context !== 'object' || context === null) { - throw new Error(errorPrefix(fnName, argumentName) + 'must be a valid context object.'); - } -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Code originally came from goog.crypt.stringToUtf8ByteArray, but for some reason they -// automatically replaced '\r\n' with '\n', and they didn't handle surrogate pairs, -// so it's been modified. -// Note that not all Unicode characters appear as single characters in JavaScript strings. -// fromCharCode returns the UTF-16 encoding of a character - so some Unicode characters -// use 2 characters in Javascript. All 4-byte UTF-8 characters begin with a first -// character in the range 0xD800 - 0xDBFF (the first character of a so-called surrogate -// pair). -// See http://www.ecma-international.org/ecma-262/5.1/#sec-15.1.3 -/** - * @param {string} str - * @return {Array} - */ -var stringToByteArray = function (str) { - var out = []; - var p = 0; - for (var i = 0; i < str.length; i++) { - var c = str.charCodeAt(i); - // Is this the lead surrogate in a surrogate pair? - if (c >= 0xd800 && c <= 0xdbff) { - var high = c - 0xd800; // the high 10 bits. - i++; - assert(i < str.length, 'Surrogate pair missing trail surrogate.'); - var low = str.charCodeAt(i) - 0xdc00; // the low 10 bits. - c = 0x10000 + (high << 10) + low; - } - if (c < 128) { - out[p++] = c; - } - else if (c < 2048) { - out[p++] = (c >> 6) | 192; - out[p++] = (c & 63) | 128; - } - else if (c < 65536) { - out[p++] = (c >> 12) | 224; - out[p++] = ((c >> 6) & 63) | 128; - out[p++] = (c & 63) | 128; - } - else { - out[p++] = (c >> 18) | 240; - out[p++] = ((c >> 12) & 63) | 128; - out[p++] = ((c >> 6) & 63) | 128; - out[p++] = (c & 63) | 128; - } - } - return out; -}; -/** - * Calculate length without actually converting; useful for doing cheaper validation. - * @param {string} str - * @return {number} - */ -var stringLength = function (str) { - var p = 0; - for (var i = 0; i < str.length; i++) { - var c = str.charCodeAt(i); - if (c < 128) { - p++; - } - else if (c < 2048) { - p += 2; - } - else if (c >= 0xd800 && c <= 0xdbff) { - // Lead surrogate of a surrogate pair. The pair together will take 4 bytes to represent. - p += 4; - i++; // skip trail surrogate. - } - else { - p += 3; - } - } - return p; -}; - -/** - * @license - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Copied from https://stackoverflow.com/a/2117523 - * Generates a new uuid. - * @public - */ -var uuidv4 = function () { - return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) { - var r = (Math.random() * 16) | 0, v = c === 'x' ? r : (r & 0x3) | 0x8; - return v.toString(16); - }); -}; - -/** - * @license - * Copyright 2019 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * The amount of milliseconds to exponentially increase. - */ -var DEFAULT_INTERVAL_MILLIS = 1000; -/** - * The factor to backoff by. - * Should be a number greater than 1. - */ -var DEFAULT_BACKOFF_FACTOR = 2; -/** - * The maximum milliseconds to increase to. - * - *

Visible for testing - */ -var MAX_VALUE_MILLIS = 4 * 60 * 60 * 1000; // Four hours, like iOS and Android. -/** - * The percentage of backoff time to randomize by. - * See - * http://go/safe-client-behavior#step-1-determine-the-appropriate-retry-interval-to-handle-spike-traffic - * for context. - * - *

Visible for testing - */ -var RANDOM_FACTOR = 0.5; -/** - * Based on the backoff method from - * https://github.com/google/closure-library/blob/master/closure/goog/math/exponentialbackoff.js. - * Extracted here so we don't need to pass metadata and a stateful ExponentialBackoff object around. - */ -function calculateBackoffMillis(backoffCount, intervalMillis, backoffFactor) { - if (intervalMillis === void 0) { intervalMillis = DEFAULT_INTERVAL_MILLIS; } - if (backoffFactor === void 0) { backoffFactor = DEFAULT_BACKOFF_FACTOR; } - // Calculates an exponentially increasing value. - // Deviation: calculates value from count and a constant interval, so we only need to save value - // and count to restore state. - var currBaseValue = intervalMillis * Math.pow(backoffFactor, backoffCount); - // A random "fuzz" to avoid waves of retries. - // Deviation: randomFactor is required. - var randomWait = Math.round( - // A fraction of the backoff value to add/subtract. - // Deviation: changes multiplication order to improve readability. - RANDOM_FACTOR * - currBaseValue * - // A random float (rounded to int by Math.round above) in the range [-1, 1]. Determines - // if we add or subtract. - (Math.random() - 0.5) * - 2); - // Limits backoff to max to avoid effectively permanent backoff. - return Math.min(MAX_VALUE_MILLIS, currBaseValue + randomWait); -} - -/** - * @license - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Provide English ordinal letters after a number - */ -function ordinal(i) { - if (!Number.isFinite(i)) { - return "" + i; - } - return i + indicator(i); -} -function indicator(i) { - i = Math.abs(i); - var cent = i % 100; - if (cent >= 10 && cent <= 20) { - return 'th'; - } - var dec = i % 10; - if (dec === 1) { - return 'st'; - } - if (dec === 2) { - return 'nd'; - } - if (dec === 3) { - return 'rd'; - } - return 'th'; -} - -/** - * @license - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -function getModularInstance(service) { - if (service && service._delegate) { - return service._delegate; - } - else { - return service; - } -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Overriding the constant (we should be the only ones doing this) -CONSTANTS.NODE_CLIENT = true; - -exports.CONSTANTS = CONSTANTS; -exports.Deferred = Deferred; -exports.ErrorFactory = ErrorFactory; -exports.FirebaseError = FirebaseError; -exports.MAX_VALUE_MILLIS = MAX_VALUE_MILLIS; -exports.RANDOM_FACTOR = RANDOM_FACTOR; -exports.Sha1 = Sha1; -exports.areCookiesEnabled = areCookiesEnabled; -exports.assert = assert; -exports.assertionError = assertionError; -exports.async = async; -exports.base64 = base64; -exports.base64Decode = base64Decode; -exports.base64Encode = base64Encode; -exports.base64urlEncodeWithoutPadding = base64urlEncodeWithoutPadding; -exports.calculateBackoffMillis = calculateBackoffMillis; -exports.contains = contains; -exports.createMockUserToken = createMockUserToken; -exports.createSubscribe = createSubscribe; -exports.decode = decode; -exports.deepCopy = deepCopy; -exports.deepEqual = deepEqual; -exports.deepExtend = deepExtend; -exports.errorPrefix = errorPrefix; -exports.extractQuerystring = extractQuerystring; -exports.getDefaultAppConfig = getDefaultAppConfig; -exports.getDefaultEmulatorHost = getDefaultEmulatorHost; -exports.getDefaultEmulatorHostnameAndPort = getDefaultEmulatorHostnameAndPort; -exports.getExperimentalSetting = getExperimentalSetting; -exports.getGlobal = getGlobal; -exports.getModularInstance = getModularInstance; -exports.getUA = getUA; -exports.isAdmin = isAdmin; -exports.isBrowser = isBrowser; -exports.isBrowserExtension = isBrowserExtension; -exports.isElectron = isElectron; -exports.isEmpty = isEmpty; -exports.isIE = isIE; -exports.isIndexedDBAvailable = isIndexedDBAvailable; -exports.isMobileCordova = isMobileCordova; -exports.isNode = isNode; -exports.isNodeSdk = isNodeSdk; -exports.isReactNative = isReactNative; -exports.isSafari = isSafari; -exports.isUWP = isUWP; -exports.isValidFormat = isValidFormat; -exports.isValidTimestamp = isValidTimestamp; -exports.issuedAtTime = issuedAtTime; -exports.jsonEval = jsonEval; -exports.map = map; -exports.ordinal = ordinal; -exports.promiseWithTimeout = promiseWithTimeout; -exports.querystring = querystring; -exports.querystringDecode = querystringDecode; -exports.safeGet = safeGet; -exports.stringLength = stringLength; -exports.stringToByteArray = stringToByteArray; -exports.stringify = stringify; -exports.uuidv4 = uuidv4; -exports.validateArgCount = validateArgCount; -exports.validateCallback = validateCallback; -exports.validateContextObject = validateContextObject; -exports.validateIndexedDBOpenable = validateIndexedDBOpenable; -exports.validateNamespace = validateNamespace; -//# sourceMappingURL=index.node.cjs.js.map diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/index.node.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/index.node.d.ts deleted file mode 100644 index 6f847984..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/index.node.d.ts +++ /dev/null @@ -1,38 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export * from './src/assert'; -export * from './src/crypt'; -export * from './src/constants'; -export * from './src/deepCopy'; -export * from './src/defaults'; -export * from './src/deferred'; -export * from './src/emulator'; -export * from './src/environment'; -export * from './src/errors'; -export * from './src/json'; -export * from './src/jwt'; -export * from './src/obj'; -export * from './src/promise'; -export * from './src/query'; -export * from './src/sha1'; -export * from './src/subscribe'; -export * from './src/validation'; -export * from './src/utf8'; -export * from './src/uuid'; -export * from './src/exponential_backoff'; -export * from './src/formatters'; -export * from './src/compat'; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/node-esm/index.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/node-esm/index.d.ts deleted file mode 100644 index 6f847984..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/node-esm/index.d.ts +++ /dev/null @@ -1,38 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export * from './src/assert'; -export * from './src/crypt'; -export * from './src/constants'; -export * from './src/deepCopy'; -export * from './src/defaults'; -export * from './src/deferred'; -export * from './src/emulator'; -export * from './src/environment'; -export * from './src/errors'; -export * from './src/json'; -export * from './src/jwt'; -export * from './src/obj'; -export * from './src/promise'; -export * from './src/query'; -export * from './src/sha1'; -export * from './src/subscribe'; -export * from './src/validation'; -export * from './src/utf8'; -export * from './src/uuid'; -export * from './src/exponential_backoff'; -export * from './src/formatters'; -export * from './src/compat'; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/node-esm/index.node.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/node-esm/index.node.d.ts deleted file mode 100644 index 6f847984..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/node-esm/index.node.d.ts +++ /dev/null @@ -1,38 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export * from './src/assert'; -export * from './src/crypt'; -export * from './src/constants'; -export * from './src/deepCopy'; -export * from './src/defaults'; -export * from './src/deferred'; -export * from './src/emulator'; -export * from './src/environment'; -export * from './src/errors'; -export * from './src/json'; -export * from './src/jwt'; -export * from './src/obj'; -export * from './src/promise'; -export * from './src/query'; -export * from './src/sha1'; -export * from './src/subscribe'; -export * from './src/validation'; -export * from './src/utf8'; -export * from './src/uuid'; -export * from './src/exponential_backoff'; -export * from './src/formatters'; -export * from './src/compat'; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/node-esm/index.node.esm.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/node-esm/index.node.esm.js deleted file mode 100644 index a1a864b1..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/node-esm/index.node.esm.js +++ /dev/null @@ -1,2087 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * @fileoverview Firebase constants. Some of these (@defines) can be overridden at compile-time. - */ -const CONSTANTS = { - /** - * @define {boolean} Whether this is the client Node.js SDK. - */ - NODE_CLIENT: false, - /** - * @define {boolean} Whether this is the Admin Node.js SDK. - */ - NODE_ADMIN: false, - /** - * Firebase SDK Version - */ - SDK_VERSION: '${JSCORE_VERSION}' -}; - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Throws an error if the provided assertion is falsy - */ -const assert = function (assertion, message) { - if (!assertion) { - throw assertionError(message); - } -}; -/** - * Returns an Error object suitable for throwing. - */ -const assertionError = function (message) { - return new Error('Firebase Database (' + - CONSTANTS.SDK_VERSION + - ') INTERNAL ASSERT FAILED: ' + - message); -}; - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -const stringToByteArray$1 = function (str) { - // TODO(user): Use native implementations if/when available - const out = []; - let p = 0; - for (let i = 0; i < str.length; i++) { - let c = str.charCodeAt(i); - if (c < 128) { - out[p++] = c; - } - else if (c < 2048) { - out[p++] = (c >> 6) | 192; - out[p++] = (c & 63) | 128; - } - else if ((c & 0xfc00) === 0xd800 && - i + 1 < str.length && - (str.charCodeAt(i + 1) & 0xfc00) === 0xdc00) { - // Surrogate Pair - c = 0x10000 + ((c & 0x03ff) << 10) + (str.charCodeAt(++i) & 0x03ff); - out[p++] = (c >> 18) | 240; - out[p++] = ((c >> 12) & 63) | 128; - out[p++] = ((c >> 6) & 63) | 128; - out[p++] = (c & 63) | 128; - } - else { - out[p++] = (c >> 12) | 224; - out[p++] = ((c >> 6) & 63) | 128; - out[p++] = (c & 63) | 128; - } - } - return out; -}; -/** - * Turns an array of numbers into the string given by the concatenation of the - * characters to which the numbers correspond. - * @param bytes Array of numbers representing characters. - * @return Stringification of the array. - */ -const byteArrayToString = function (bytes) { - // TODO(user): Use native implementations if/when available - const out = []; - let pos = 0, c = 0; - while (pos < bytes.length) { - const c1 = bytes[pos++]; - if (c1 < 128) { - out[c++] = String.fromCharCode(c1); - } - else if (c1 > 191 && c1 < 224) { - const c2 = bytes[pos++]; - out[c++] = String.fromCharCode(((c1 & 31) << 6) | (c2 & 63)); - } - else if (c1 > 239 && c1 < 365) { - // Surrogate Pair - const c2 = bytes[pos++]; - const c3 = bytes[pos++]; - const c4 = bytes[pos++]; - const u = (((c1 & 7) << 18) | ((c2 & 63) << 12) | ((c3 & 63) << 6) | (c4 & 63)) - - 0x10000; - out[c++] = String.fromCharCode(0xd800 + (u >> 10)); - out[c++] = String.fromCharCode(0xdc00 + (u & 1023)); - } - else { - const c2 = bytes[pos++]; - const c3 = bytes[pos++]; - out[c++] = String.fromCharCode(((c1 & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63)); - } - } - return out.join(''); -}; -// We define it as an object literal instead of a class because a class compiled down to es5 can't -// be treeshaked. https://github.com/rollup/rollup/issues/1691 -// Static lookup maps, lazily populated by init_() -const base64 = { - /** - * Maps bytes to characters. - */ - byteToCharMap_: null, - /** - * Maps characters to bytes. - */ - charToByteMap_: null, - /** - * Maps bytes to websafe characters. - * @private - */ - byteToCharMapWebSafe_: null, - /** - * Maps websafe characters to bytes. - * @private - */ - charToByteMapWebSafe_: null, - /** - * Our default alphabet, shared between - * ENCODED_VALS and ENCODED_VALS_WEBSAFE - */ - ENCODED_VALS_BASE: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' + 'abcdefghijklmnopqrstuvwxyz' + '0123456789', - /** - * Our default alphabet. Value 64 (=) is special; it means "nothing." - */ - get ENCODED_VALS() { - return this.ENCODED_VALS_BASE + '+/='; - }, - /** - * Our websafe alphabet. - */ - get ENCODED_VALS_WEBSAFE() { - return this.ENCODED_VALS_BASE + '-_.'; - }, - /** - * Whether this browser supports the atob and btoa functions. This extension - * started at Mozilla but is now implemented by many browsers. We use the - * ASSUME_* variables to avoid pulling in the full useragent detection library - * but still allowing the standard per-browser compilations. - * - */ - HAS_NATIVE_SUPPORT: typeof atob === 'function', - /** - * Base64-encode an array of bytes. - * - * @param input An array of bytes (numbers with - * value in [0, 255]) to encode. - * @param webSafe Boolean indicating we should use the - * alternative alphabet. - * @return The base64 encoded string. - */ - encodeByteArray(input, webSafe) { - if (!Array.isArray(input)) { - throw Error('encodeByteArray takes an array as a parameter'); - } - this.init_(); - const byteToCharMap = webSafe - ? this.byteToCharMapWebSafe_ - : this.byteToCharMap_; - const output = []; - for (let i = 0; i < input.length; i += 3) { - const byte1 = input[i]; - const haveByte2 = i + 1 < input.length; - const byte2 = haveByte2 ? input[i + 1] : 0; - const haveByte3 = i + 2 < input.length; - const byte3 = haveByte3 ? input[i + 2] : 0; - const outByte1 = byte1 >> 2; - const outByte2 = ((byte1 & 0x03) << 4) | (byte2 >> 4); - let outByte3 = ((byte2 & 0x0f) << 2) | (byte3 >> 6); - let outByte4 = byte3 & 0x3f; - if (!haveByte3) { - outByte4 = 64; - if (!haveByte2) { - outByte3 = 64; - } - } - output.push(byteToCharMap[outByte1], byteToCharMap[outByte2], byteToCharMap[outByte3], byteToCharMap[outByte4]); - } - return output.join(''); - }, - /** - * Base64-encode a string. - * - * @param input A string to encode. - * @param webSafe If true, we should use the - * alternative alphabet. - * @return The base64 encoded string. - */ - encodeString(input, webSafe) { - // Shortcut for Mozilla browsers that implement - // a native base64 encoder in the form of "btoa/atob" - if (this.HAS_NATIVE_SUPPORT && !webSafe) { - return btoa(input); - } - return this.encodeByteArray(stringToByteArray$1(input), webSafe); - }, - /** - * Base64-decode a string. - * - * @param input to decode. - * @param webSafe True if we should use the - * alternative alphabet. - * @return string representing the decoded value. - */ - decodeString(input, webSafe) { - // Shortcut for Mozilla browsers that implement - // a native base64 encoder in the form of "btoa/atob" - if (this.HAS_NATIVE_SUPPORT && !webSafe) { - return atob(input); - } - return byteArrayToString(this.decodeStringToByteArray(input, webSafe)); - }, - /** - * Base64-decode a string. - * - * In base-64 decoding, groups of four characters are converted into three - * bytes. If the encoder did not apply padding, the input length may not - * be a multiple of 4. - * - * In this case, the last group will have fewer than 4 characters, and - * padding will be inferred. If the group has one or two characters, it decodes - * to one byte. If the group has three characters, it decodes to two bytes. - * - * @param input Input to decode. - * @param webSafe True if we should use the web-safe alphabet. - * @return bytes representing the decoded value. - */ - decodeStringToByteArray(input, webSafe) { - this.init_(); - const charToByteMap = webSafe - ? this.charToByteMapWebSafe_ - : this.charToByteMap_; - const output = []; - for (let i = 0; i < input.length;) { - const byte1 = charToByteMap[input.charAt(i++)]; - const haveByte2 = i < input.length; - const byte2 = haveByte2 ? charToByteMap[input.charAt(i)] : 0; - ++i; - const haveByte3 = i < input.length; - const byte3 = haveByte3 ? charToByteMap[input.charAt(i)] : 64; - ++i; - const haveByte4 = i < input.length; - const byte4 = haveByte4 ? charToByteMap[input.charAt(i)] : 64; - ++i; - if (byte1 == null || byte2 == null || byte3 == null || byte4 == null) { - throw Error(); - } - const outByte1 = (byte1 << 2) | (byte2 >> 4); - output.push(outByte1); - if (byte3 !== 64) { - const outByte2 = ((byte2 << 4) & 0xf0) | (byte3 >> 2); - output.push(outByte2); - if (byte4 !== 64) { - const outByte3 = ((byte3 << 6) & 0xc0) | byte4; - output.push(outByte3); - } - } - } - return output; - }, - /** - * Lazy static initialization function. Called before - * accessing any of the static map variables. - * @private - */ - init_() { - if (!this.byteToCharMap_) { - this.byteToCharMap_ = {}; - this.charToByteMap_ = {}; - this.byteToCharMapWebSafe_ = {}; - this.charToByteMapWebSafe_ = {}; - // We want quick mappings back and forth, so we precompute two maps. - for (let i = 0; i < this.ENCODED_VALS.length; i++) { - this.byteToCharMap_[i] = this.ENCODED_VALS.charAt(i); - this.charToByteMap_[this.byteToCharMap_[i]] = i; - this.byteToCharMapWebSafe_[i] = this.ENCODED_VALS_WEBSAFE.charAt(i); - this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[i]] = i; - // Be forgiving when decoding and correctly decode both encodings. - if (i >= this.ENCODED_VALS_BASE.length) { - this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(i)] = i; - this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(i)] = i; - } - } - } - } -}; -/** - * URL-safe base64 encoding - */ -const base64Encode = function (str) { - const utf8Bytes = stringToByteArray$1(str); - return base64.encodeByteArray(utf8Bytes, true); -}; -/** - * URL-safe base64 encoding (without "." padding in the end). - * e.g. Used in JSON Web Token (JWT) parts. - */ -const base64urlEncodeWithoutPadding = function (str) { - // Use base64url encoding and remove padding in the end (dot characters). - return base64Encode(str).replace(/\./g, ''); -}; -/** - * URL-safe base64 decoding - * - * NOTE: DO NOT use the global atob() function - it does NOT support the - * base64Url variant encoding. - * - * @param str To be decoded - * @return Decoded result, if possible - */ -const base64Decode = function (str) { - try { - return base64.decodeString(str, true); - } - catch (e) { - console.error('base64Decode failed: ', e); - } - return null; -}; - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Do a deep-copy of basic JavaScript Objects or Arrays. - */ -function deepCopy(value) { - return deepExtend(undefined, value); -} -/** - * Copy properties from source to target (recursively allows extension - * of Objects and Arrays). Scalar values in the target are over-written. - * If target is undefined, an object of the appropriate type will be created - * (and returned). - * - * We recursively copy all child properties of plain Objects in the source- so - * that namespace- like dictionaries are merged. - * - * Note that the target can be a function, in which case the properties in - * the source Object are copied onto it as static properties of the Function. - * - * Note: we don't merge __proto__ to prevent prototype pollution - */ -function deepExtend(target, source) { - if (!(source instanceof Object)) { - return source; - } - switch (source.constructor) { - case Date: - // Treat Dates like scalars; if the target date object had any child - // properties - they will be lost! - const dateValue = source; - return new Date(dateValue.getTime()); - case Object: - if (target === undefined) { - target = {}; - } - break; - case Array: - // Always copy the array source and overwrite the target. - target = []; - break; - default: - // Not a plain Object - treat it as a scalar. - return source; - } - for (const prop in source) { - // use isValidKey to guard against prototype pollution. See https://snyk.io/vuln/SNYK-JS-LODASH-450202 - if (!source.hasOwnProperty(prop) || !isValidKey(prop)) { - continue; - } - target[prop] = deepExtend(target[prop], source[prop]); - } - return target; -} -function isValidKey(key) { - return key !== '__proto__'; -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Returns navigator.userAgent string or '' if it's not defined. - * @return user agent string - */ -function getUA() { - if (typeof navigator !== 'undefined' && - typeof navigator['userAgent'] === 'string') { - return navigator['userAgent']; - } - else { - return ''; - } -} -/** - * Detect Cordova / PhoneGap / Ionic frameworks on a mobile device. - * - * Deliberately does not rely on checking `file://` URLs (as this fails PhoneGap - * in the Ripple emulator) nor Cordova `onDeviceReady`, which would normally - * wait for a callback. - */ -function isMobileCordova() { - return (typeof window !== 'undefined' && - // @ts-ignore Setting up an broadly applicable index signature for Window - // just to deal with this case would probably be a bad idea. - !!(window['cordova'] || window['phonegap'] || window['PhoneGap']) && - /ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(getUA())); -} -/** - * Detect Node.js. - * - * @return true if Node.js environment is detected. - */ -// Node detection logic from: https://github.com/iliakan/detect-node/ -function isNode() { - try { - return (Object.prototype.toString.call(global.process) === '[object process]'); - } - catch (e) { - return false; - } -} -/** - * Detect Browser Environment - */ -function isBrowser() { - return typeof self === 'object' && self.self === self; -} -function isBrowserExtension() { - const runtime = typeof chrome === 'object' - ? chrome.runtime - : typeof browser === 'object' - ? browser.runtime - : undefined; - return typeof runtime === 'object' && runtime.id !== undefined; -} -/** - * Detect React Native. - * - * @return true if ReactNative environment is detected. - */ -function isReactNative() { - return (typeof navigator === 'object' && navigator['product'] === 'ReactNative'); -} -/** Detects Electron apps. */ -function isElectron() { - return getUA().indexOf('Electron/') >= 0; -} -/** Detects Internet Explorer. */ -function isIE() { - const ua = getUA(); - return ua.indexOf('MSIE ') >= 0 || ua.indexOf('Trident/') >= 0; -} -/** Detects Universal Windows Platform apps. */ -function isUWP() { - return getUA().indexOf('MSAppHost/') >= 0; -} -/** - * Detect whether the current SDK build is the Node version. - * - * @return true if it's the Node SDK build. - */ -function isNodeSdk() { - return CONSTANTS.NODE_CLIENT === true || CONSTANTS.NODE_ADMIN === true; -} -/** Returns true if we are running in Safari. */ -function isSafari() { - return (!isNode() && - navigator.userAgent.includes('Safari') && - !navigator.userAgent.includes('Chrome')); -} -/** - * This method checks if indexedDB is supported by current browser/service worker context - * @return true if indexedDB is supported by current browser/service worker context - */ -function isIndexedDBAvailable() { - return typeof indexedDB === 'object'; -} -/** - * This method validates browser/sw context for indexedDB by opening a dummy indexedDB database and reject - * if errors occur during the database open operation. - * - * @throws exception if current browser/sw context can't run idb.open (ex: Safari iframe, Firefox - * private browsing) - */ -function validateIndexedDBOpenable() { - return new Promise((resolve, reject) => { - try { - let preExist = true; - const DB_CHECK_NAME = 'validate-browser-context-for-indexeddb-analytics-module'; - const request = self.indexedDB.open(DB_CHECK_NAME); - request.onsuccess = () => { - request.result.close(); - // delete database only when it doesn't pre-exist - if (!preExist) { - self.indexedDB.deleteDatabase(DB_CHECK_NAME); - } - resolve(true); - }; - request.onupgradeneeded = () => { - preExist = false; - }; - request.onerror = () => { - var _a; - reject(((_a = request.error) === null || _a === void 0 ? void 0 : _a.message) || ''); - }; - } - catch (error) { - reject(error); - } - }); -} -/** - * - * This method checks whether cookie is enabled within current browser - * @return true if cookie is enabled within current browser - */ -function areCookiesEnabled() { - if (typeof navigator === 'undefined' || !navigator.cookieEnabled) { - return false; - } - return true; -} -/** - * Polyfill for `globalThis` object. - * @returns the `globalThis` object for the given environment. - */ -function getGlobal() { - if (typeof self !== 'undefined') { - return self; - } - if (typeof window !== 'undefined') { - return window; - } - if (typeof global !== 'undefined') { - return global; - } - throw new Error('Unable to locate global object.'); -} - -/** - * @license - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -const getDefaultsFromGlobal = () => getGlobal().__FIREBASE_DEFAULTS__; -/** - * Attempt to read defaults from a JSON string provided to - * process.env.__FIREBASE_DEFAULTS__ or a JSON file whose path is in - * process.env.__FIREBASE_DEFAULTS_PATH__ - */ -const getDefaultsFromEnvVariable = () => { - if (typeof process === 'undefined' || typeof process.env === 'undefined') { - return; - } - const defaultsJsonString = process.env.__FIREBASE_DEFAULTS__; - if (defaultsJsonString) { - return JSON.parse(defaultsJsonString); - } -}; -const getDefaultsFromCookie = () => { - if (typeof document === 'undefined') { - return; - } - let match; - try { - match = document.cookie.match(/__FIREBASE_DEFAULTS__=([^;]+)/); - } - catch (e) { - // Some environments such as Angular Universal SSR have a - // `document` object but error on accessing `document.cookie`. - return; - } - const decoded = match && base64Decode(match[1]); - return decoded && JSON.parse(decoded); -}; -/** - * Get the __FIREBASE_DEFAULTS__ object. It checks in order: - * (1) if such an object exists as a property of `globalThis` - * (2) if such an object was provided on a shell environment variable - * (3) if such an object exists in a cookie - */ -const getDefaults = () => { - try { - return (getDefaultsFromGlobal() || - getDefaultsFromEnvVariable() || - getDefaultsFromCookie()); - } - catch (e) { - /** - * Catch-all for being unable to get __FIREBASE_DEFAULTS__ due - * to any environment case we have not accounted for. Log to - * info instead of swallowing so we can find these unknown cases - * and add paths for them if needed. - */ - console.info(`Unable to get __FIREBASE_DEFAULTS__ due to: ${e}`); - return; - } -}; -/** - * Returns emulator host stored in the __FIREBASE_DEFAULTS__ object - * for the given product. - * @returns a URL host formatted like `127.0.0.1:9999` or `[::1]:4000` if available - * @public - */ -const getDefaultEmulatorHost = (productName) => { var _a, _b; return (_b = (_a = getDefaults()) === null || _a === void 0 ? void 0 : _a.emulatorHosts) === null || _b === void 0 ? void 0 : _b[productName]; }; -/** - * Returns emulator hostname and port stored in the __FIREBASE_DEFAULTS__ object - * for the given product. - * @returns a pair of hostname and port like `["::1", 4000]` if available - * @public - */ -const getDefaultEmulatorHostnameAndPort = (productName) => { - const host = getDefaultEmulatorHost(productName); - if (!host) { - return undefined; - } - const separatorIndex = host.lastIndexOf(':'); // Finding the last since IPv6 addr also has colons. - if (separatorIndex <= 0 || separatorIndex + 1 === host.length) { - throw new Error(`Invalid host ${host} with no separate hostname and port!`); - } - // eslint-disable-next-line no-restricted-globals - const port = parseInt(host.substring(separatorIndex + 1), 10); - if (host[0] === '[') { - // Bracket-quoted `[ipv6addr]:port` => return "ipv6addr" (without brackets). - return [host.substring(1, separatorIndex - 1), port]; - } - else { - return [host.substring(0, separatorIndex), port]; - } -}; -/** - * Returns Firebase app config stored in the __FIREBASE_DEFAULTS__ object. - * @public - */ -const getDefaultAppConfig = () => { var _a; return (_a = getDefaults()) === null || _a === void 0 ? void 0 : _a.config; }; -/** - * Returns an experimental setting on the __FIREBASE_DEFAULTS__ object (properties - * prefixed by "_") - * @public - */ -const getExperimentalSetting = (name) => { var _a; return (_a = getDefaults()) === null || _a === void 0 ? void 0 : _a[`_${name}`]; }; - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -class Deferred { - constructor() { - this.reject = () => { }; - this.resolve = () => { }; - this.promise = new Promise((resolve, reject) => { - this.resolve = resolve; - this.reject = reject; - }); - } - /** - * Our API internals are not promiseified and cannot because our callback APIs have subtle expectations around - * invoking promises inline, which Promises are forbidden to do. This method accepts an optional node-style callback - * and returns a node-style callback which will resolve or reject the Deferred's promise. - */ - wrapCallback(callback) { - return (error, value) => { - if (error) { - this.reject(error); - } - else { - this.resolve(value); - } - if (typeof callback === 'function') { - // Attaching noop handler just in case developer wasn't expecting - // promises - this.promise.catch(() => { }); - // Some of our callbacks don't expect a value and our own tests - // assert that the parameter length is 1 - if (callback.length === 1) { - callback(error); - } - else { - callback(error, value); - } - } - }; - } -} - -/** - * @license - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -function createMockUserToken(token, projectId) { - if (token.uid) { - throw new Error('The "uid" field is no longer supported by mockUserToken. Please use "sub" instead for Firebase Auth User ID.'); - } - // Unsecured JWTs use "none" as the algorithm. - const header = { - alg: 'none', - type: 'JWT' - }; - const project = projectId || 'demo-project'; - const iat = token.iat || 0; - const sub = token.sub || token.user_id; - if (!sub) { - throw new Error("mockUserToken must contain 'sub' or 'user_id' field!"); - } - const payload = Object.assign({ - // Set all required fields to decent defaults - iss: `https://securetoken.google.com/${project}`, aud: project, iat, exp: iat + 3600, auth_time: iat, sub, user_id: sub, firebase: { - sign_in_provider: 'custom', - identities: {} - } }, token); - // Unsecured JWTs use the empty string as a signature. - const signature = ''; - return [ - base64urlEncodeWithoutPadding(JSON.stringify(header)), - base64urlEncodeWithoutPadding(JSON.stringify(payload)), - signature - ].join('.'); -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * @fileoverview Standardized Firebase Error. - * - * Usage: - * - * // Typescript string literals for type-safe codes - * type Err = - * 'unknown' | - * 'object-not-found' - * ; - * - * // Closure enum for type-safe error codes - * // at-enum {string} - * var Err = { - * UNKNOWN: 'unknown', - * OBJECT_NOT_FOUND: 'object-not-found', - * } - * - * let errors: Map = { - * 'generic-error': "Unknown error", - * 'file-not-found': "Could not find file: {$file}", - * }; - * - * // Type-safe function - must pass a valid error code as param. - * let error = new ErrorFactory('service', 'Service', errors); - * - * ... - * throw error.create(Err.GENERIC); - * ... - * throw error.create(Err.FILE_NOT_FOUND, {'file': fileName}); - * ... - * // Service: Could not file file: foo.txt (service/file-not-found). - * - * catch (e) { - * assert(e.message === "Could not find file: foo.txt."); - * if ((e as FirebaseError)?.code === 'service/file-not-found') { - * console.log("Could not read file: " + e['file']); - * } - * } - */ -const ERROR_NAME = 'FirebaseError'; -// Based on code from: -// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error#Custom_Error_Types -class FirebaseError extends Error { - constructor( - /** The error code for this error. */ - code, message, - /** Custom data for this error. */ - customData) { - super(message); - this.code = code; - this.customData = customData; - /** The custom name for all FirebaseErrors. */ - this.name = ERROR_NAME; - // Fix For ES5 - // https://github.com/Microsoft/TypeScript-wiki/blob/master/Breaking-Changes.md#extending-built-ins-like-error-array-and-map-may-no-longer-work - Object.setPrototypeOf(this, FirebaseError.prototype); - // Maintains proper stack trace for where our error was thrown. - // Only available on V8. - if (Error.captureStackTrace) { - Error.captureStackTrace(this, ErrorFactory.prototype.create); - } - } -} -class ErrorFactory { - constructor(service, serviceName, errors) { - this.service = service; - this.serviceName = serviceName; - this.errors = errors; - } - create(code, ...data) { - const customData = data[0] || {}; - const fullCode = `${this.service}/${code}`; - const template = this.errors[code]; - const message = template ? replaceTemplate(template, customData) : 'Error'; - // Service Name: Error message (service/code). - const fullMessage = `${this.serviceName}: ${message} (${fullCode}).`; - const error = new FirebaseError(fullCode, fullMessage, customData); - return error; - } -} -function replaceTemplate(template, data) { - return template.replace(PATTERN, (_, key) => { - const value = data[key]; - return value != null ? String(value) : `<${key}?>`; - }); -} -const PATTERN = /\{\$([^}]+)}/g; - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Evaluates a JSON string into a javascript object. - * - * @param {string} str A string containing JSON. - * @return {*} The javascript object representing the specified JSON. - */ -function jsonEval(str) { - return JSON.parse(str); -} -/** - * Returns JSON representing a javascript object. - * @param {*} data Javascript object to be stringified. - * @return {string} The JSON contents of the object. - */ -function stringify(data) { - return JSON.stringify(data); -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Decodes a Firebase auth. token into constituent parts. - * - * Notes: - * - May return with invalid / incomplete claims if there's no native base64 decoding support. - * - Doesn't check if the token is actually valid. - */ -const decode = function (token) { - let header = {}, claims = {}, data = {}, signature = ''; - try { - const parts = token.split('.'); - header = jsonEval(base64Decode(parts[0]) || ''); - claims = jsonEval(base64Decode(parts[1]) || ''); - signature = parts[2]; - data = claims['d'] || {}; - delete claims['d']; - } - catch (e) { } - return { - header, - claims, - data, - signature - }; -}; -/** - * Decodes a Firebase auth. token and checks the validity of its time-based claims. Will return true if the - * token is within the time window authorized by the 'nbf' (not-before) and 'iat' (issued-at) claims. - * - * Notes: - * - May return a false negative if there's no native base64 decoding support. - * - Doesn't check if the token is actually valid. - */ -const isValidTimestamp = function (token) { - const claims = decode(token).claims; - const now = Math.floor(new Date().getTime() / 1000); - let validSince = 0, validUntil = 0; - if (typeof claims === 'object') { - if (claims.hasOwnProperty('nbf')) { - validSince = claims['nbf']; - } - else if (claims.hasOwnProperty('iat')) { - validSince = claims['iat']; - } - if (claims.hasOwnProperty('exp')) { - validUntil = claims['exp']; - } - else { - // token will expire after 24h by default - validUntil = validSince + 86400; - } - } - return (!!now && - !!validSince && - !!validUntil && - now >= validSince && - now <= validUntil); -}; -/** - * Decodes a Firebase auth. token and returns its issued at time if valid, null otherwise. - * - * Notes: - * - May return null if there's no native base64 decoding support. - * - Doesn't check if the token is actually valid. - */ -const issuedAtTime = function (token) { - const claims = decode(token).claims; - if (typeof claims === 'object' && claims.hasOwnProperty('iat')) { - return claims['iat']; - } - return null; -}; -/** - * Decodes a Firebase auth. token and checks the validity of its format. Expects a valid issued-at time. - * - * Notes: - * - May return a false negative if there's no native base64 decoding support. - * - Doesn't check if the token is actually valid. - */ -const isValidFormat = function (token) { - const decoded = decode(token), claims = decoded.claims; - return !!claims && typeof claims === 'object' && claims.hasOwnProperty('iat'); -}; -/** - * Attempts to peer into an auth token and determine if it's an admin auth token by looking at the claims portion. - * - * Notes: - * - May return a false negative if there's no native base64 decoding support. - * - Doesn't check if the token is actually valid. - */ -const isAdmin = function (token) { - const claims = decode(token).claims; - return typeof claims === 'object' && claims['admin'] === true; -}; - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -function contains(obj, key) { - return Object.prototype.hasOwnProperty.call(obj, key); -} -function safeGet(obj, key) { - if (Object.prototype.hasOwnProperty.call(obj, key)) { - return obj[key]; - } - else { - return undefined; - } -} -function isEmpty(obj) { - for (const key in obj) { - if (Object.prototype.hasOwnProperty.call(obj, key)) { - return false; - } - } - return true; -} -function map(obj, fn, contextObj) { - const res = {}; - for (const key in obj) { - if (Object.prototype.hasOwnProperty.call(obj, key)) { - res[key] = fn.call(contextObj, obj[key], key, obj); - } - } - return res; -} -/** - * Deep equal two objects. Support Arrays and Objects. - */ -function deepEqual(a, b) { - if (a === b) { - return true; - } - const aKeys = Object.keys(a); - const bKeys = Object.keys(b); - for (const k of aKeys) { - if (!bKeys.includes(k)) { - return false; - } - const aProp = a[k]; - const bProp = b[k]; - if (isObject(aProp) && isObject(bProp)) { - if (!deepEqual(aProp, bProp)) { - return false; - } - } - else if (aProp !== bProp) { - return false; - } - } - for (const k of bKeys) { - if (!aKeys.includes(k)) { - return false; - } - } - return true; -} -function isObject(thing) { - return thing !== null && typeof thing === 'object'; -} - -/** - * @license - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Rejects if the given promise doesn't resolve in timeInMS milliseconds. - * @internal - */ -function promiseWithTimeout(promise, timeInMS = 2000) { - const deferredPromise = new Deferred(); - setTimeout(() => deferredPromise.reject('timeout!'), timeInMS); - promise.then(deferredPromise.resolve, deferredPromise.reject); - return deferredPromise.promise; -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Returns a querystring-formatted string (e.g. &arg=val&arg2=val2) from a - * params object (e.g. {arg: 'val', arg2: 'val2'}) - * Note: You must prepend it with ? when adding it to a URL. - */ -function querystring(querystringParams) { - const params = []; - for (const [key, value] of Object.entries(querystringParams)) { - if (Array.isArray(value)) { - value.forEach(arrayVal => { - params.push(encodeURIComponent(key) + '=' + encodeURIComponent(arrayVal)); - }); - } - else { - params.push(encodeURIComponent(key) + '=' + encodeURIComponent(value)); - } - } - return params.length ? '&' + params.join('&') : ''; -} -/** - * Decodes a querystring (e.g. ?arg=val&arg2=val2) into a params object - * (e.g. {arg: 'val', arg2: 'val2'}) - */ -function querystringDecode(querystring) { - const obj = {}; - const tokens = querystring.replace(/^\?/, '').split('&'); - tokens.forEach(token => { - if (token) { - const [key, value] = token.split('='); - obj[decodeURIComponent(key)] = decodeURIComponent(value); - } - }); - return obj; -} -/** - * Extract the query string part of a URL, including the leading question mark (if present). - */ -function extractQuerystring(url) { - const queryStart = url.indexOf('?'); - if (!queryStart) { - return ''; - } - const fragmentStart = url.indexOf('#', queryStart); - return url.substring(queryStart, fragmentStart > 0 ? fragmentStart : undefined); -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * @fileoverview SHA-1 cryptographic hash. - * Variable names follow the notation in FIPS PUB 180-3: - * http://csrc.nist.gov/publications/fips/fips180-3/fips180-3_final.pdf. - * - * Usage: - * var sha1 = new sha1(); - * sha1.update(bytes); - * var hash = sha1.digest(); - * - * Performance: - * Chrome 23: ~400 Mbit/s - * Firefox 16: ~250 Mbit/s - * - */ -/** - * SHA-1 cryptographic hash constructor. - * - * The properties declared here are discussed in the above algorithm document. - * @constructor - * @final - * @struct - */ -class Sha1 { - constructor() { - /** - * Holds the previous values of accumulated variables a-e in the compress_ - * function. - * @private - */ - this.chain_ = []; - /** - * A buffer holding the partially computed hash result. - * @private - */ - this.buf_ = []; - /** - * An array of 80 bytes, each a part of the message to be hashed. Referred to - * as the message schedule in the docs. - * @private - */ - this.W_ = []; - /** - * Contains data needed to pad messages less than 64 bytes. - * @private - */ - this.pad_ = []; - /** - * @private {number} - */ - this.inbuf_ = 0; - /** - * @private {number} - */ - this.total_ = 0; - this.blockSize = 512 / 8; - this.pad_[0] = 128; - for (let i = 1; i < this.blockSize; ++i) { - this.pad_[i] = 0; - } - this.reset(); - } - reset() { - this.chain_[0] = 0x67452301; - this.chain_[1] = 0xefcdab89; - this.chain_[2] = 0x98badcfe; - this.chain_[3] = 0x10325476; - this.chain_[4] = 0xc3d2e1f0; - this.inbuf_ = 0; - this.total_ = 0; - } - /** - * Internal compress helper function. - * @param buf Block to compress. - * @param offset Offset of the block in the buffer. - * @private - */ - compress_(buf, offset) { - if (!offset) { - offset = 0; - } - const W = this.W_; - // get 16 big endian words - if (typeof buf === 'string') { - for (let i = 0; i < 16; i++) { - // TODO(user): [bug 8140122] Recent versions of Safari for Mac OS and iOS - // have a bug that turns the post-increment ++ operator into pre-increment - // during JIT compilation. We have code that depends heavily on SHA-1 for - // correctness and which is affected by this bug, so I've removed all uses - // of post-increment ++ in which the result value is used. We can revert - // this change once the Safari bug - // (https://bugs.webkit.org/show_bug.cgi?id=109036) has been fixed and - // most clients have been updated. - W[i] = - (buf.charCodeAt(offset) << 24) | - (buf.charCodeAt(offset + 1) << 16) | - (buf.charCodeAt(offset + 2) << 8) | - buf.charCodeAt(offset + 3); - offset += 4; - } - } - else { - for (let i = 0; i < 16; i++) { - W[i] = - (buf[offset] << 24) | - (buf[offset + 1] << 16) | - (buf[offset + 2] << 8) | - buf[offset + 3]; - offset += 4; - } - } - // expand to 80 words - for (let i = 16; i < 80; i++) { - const t = W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16]; - W[i] = ((t << 1) | (t >>> 31)) & 0xffffffff; - } - let a = this.chain_[0]; - let b = this.chain_[1]; - let c = this.chain_[2]; - let d = this.chain_[3]; - let e = this.chain_[4]; - let f, k; - // TODO(user): Try to unroll this loop to speed up the computation. - for (let i = 0; i < 80; i++) { - if (i < 40) { - if (i < 20) { - f = d ^ (b & (c ^ d)); - k = 0x5a827999; - } - else { - f = b ^ c ^ d; - k = 0x6ed9eba1; - } - } - else { - if (i < 60) { - f = (b & c) | (d & (b | c)); - k = 0x8f1bbcdc; - } - else { - f = b ^ c ^ d; - k = 0xca62c1d6; - } - } - const t = (((a << 5) | (a >>> 27)) + f + e + k + W[i]) & 0xffffffff; - e = d; - d = c; - c = ((b << 30) | (b >>> 2)) & 0xffffffff; - b = a; - a = t; - } - this.chain_[0] = (this.chain_[0] + a) & 0xffffffff; - this.chain_[1] = (this.chain_[1] + b) & 0xffffffff; - this.chain_[2] = (this.chain_[2] + c) & 0xffffffff; - this.chain_[3] = (this.chain_[3] + d) & 0xffffffff; - this.chain_[4] = (this.chain_[4] + e) & 0xffffffff; - } - update(bytes, length) { - // TODO(johnlenz): tighten the function signature and remove this check - if (bytes == null) { - return; - } - if (length === undefined) { - length = bytes.length; - } - const lengthMinusBlock = length - this.blockSize; - let n = 0; - // Using local instead of member variables gives ~5% speedup on Firefox 16. - const buf = this.buf_; - let inbuf = this.inbuf_; - // The outer while loop should execute at most twice. - while (n < length) { - // When we have no data in the block to top up, we can directly process the - // input buffer (assuming it contains sufficient data). This gives ~25% - // speedup on Chrome 23 and ~15% speedup on Firefox 16, but requires that - // the data is provided in large chunks (or in multiples of 64 bytes). - if (inbuf === 0) { - while (n <= lengthMinusBlock) { - this.compress_(bytes, n); - n += this.blockSize; - } - } - if (typeof bytes === 'string') { - while (n < length) { - buf[inbuf] = bytes.charCodeAt(n); - ++inbuf; - ++n; - if (inbuf === this.blockSize) { - this.compress_(buf); - inbuf = 0; - // Jump to the outer loop so we use the full-block optimization. - break; - } - } - } - else { - while (n < length) { - buf[inbuf] = bytes[n]; - ++inbuf; - ++n; - if (inbuf === this.blockSize) { - this.compress_(buf); - inbuf = 0; - // Jump to the outer loop so we use the full-block optimization. - break; - } - } - } - } - this.inbuf_ = inbuf; - this.total_ += length; - } - /** @override */ - digest() { - const digest = []; - let totalBits = this.total_ * 8; - // Add pad 0x80 0x00*. - if (this.inbuf_ < 56) { - this.update(this.pad_, 56 - this.inbuf_); - } - else { - this.update(this.pad_, this.blockSize - (this.inbuf_ - 56)); - } - // Add # bits. - for (let i = this.blockSize - 1; i >= 56; i--) { - this.buf_[i] = totalBits & 255; - totalBits /= 256; // Don't use bit-shifting here! - } - this.compress_(this.buf_); - let n = 0; - for (let i = 0; i < 5; i++) { - for (let j = 24; j >= 0; j -= 8) { - digest[n] = (this.chain_[i] >> j) & 255; - ++n; - } - } - return digest; - } -} - -/** - * Helper to make a Subscribe function (just like Promise helps make a - * Thenable). - * - * @param executor Function which can make calls to a single Observer - * as a proxy. - * @param onNoObservers Callback when count of Observers goes to zero. - */ -function createSubscribe(executor, onNoObservers) { - const proxy = new ObserverProxy(executor, onNoObservers); - return proxy.subscribe.bind(proxy); -} -/** - * Implement fan-out for any number of Observers attached via a subscribe - * function. - */ -class ObserverProxy { - /** - * @param executor Function which can make calls to a single Observer - * as a proxy. - * @param onNoObservers Callback when count of Observers goes to zero. - */ - constructor(executor, onNoObservers) { - this.observers = []; - this.unsubscribes = []; - this.observerCount = 0; - // Micro-task scheduling by calling task.then(). - this.task = Promise.resolve(); - this.finalized = false; - this.onNoObservers = onNoObservers; - // Call the executor asynchronously so subscribers that are called - // synchronously after the creation of the subscribe function - // can still receive the very first value generated in the executor. - this.task - .then(() => { - executor(this); - }) - .catch(e => { - this.error(e); - }); - } - next(value) { - this.forEachObserver((observer) => { - observer.next(value); - }); - } - error(error) { - this.forEachObserver((observer) => { - observer.error(error); - }); - this.close(error); - } - complete() { - this.forEachObserver((observer) => { - observer.complete(); - }); - this.close(); - } - /** - * Subscribe function that can be used to add an Observer to the fan-out list. - * - * - We require that no event is sent to a subscriber sychronously to their - * call to subscribe(). - */ - subscribe(nextOrObserver, error, complete) { - let observer; - if (nextOrObserver === undefined && - error === undefined && - complete === undefined) { - throw new Error('Missing Observer.'); - } - // Assemble an Observer object when passed as callback functions. - if (implementsAnyMethods(nextOrObserver, [ - 'next', - 'error', - 'complete' - ])) { - observer = nextOrObserver; - } - else { - observer = { - next: nextOrObserver, - error, - complete - }; - } - if (observer.next === undefined) { - observer.next = noop; - } - if (observer.error === undefined) { - observer.error = noop; - } - if (observer.complete === undefined) { - observer.complete = noop; - } - const unsub = this.unsubscribeOne.bind(this, this.observers.length); - // Attempt to subscribe to a terminated Observable - we - // just respond to the Observer with the final error or complete - // event. - if (this.finalized) { - // eslint-disable-next-line @typescript-eslint/no-floating-promises - this.task.then(() => { - try { - if (this.finalError) { - observer.error(this.finalError); - } - else { - observer.complete(); - } - } - catch (e) { - // nothing - } - return; - }); - } - this.observers.push(observer); - return unsub; - } - // Unsubscribe is synchronous - we guarantee that no events are sent to - // any unsubscribed Observer. - unsubscribeOne(i) { - if (this.observers === undefined || this.observers[i] === undefined) { - return; - } - delete this.observers[i]; - this.observerCount -= 1; - if (this.observerCount === 0 && this.onNoObservers !== undefined) { - this.onNoObservers(this); - } - } - forEachObserver(fn) { - if (this.finalized) { - // Already closed by previous event....just eat the additional values. - return; - } - // Since sendOne calls asynchronously - there is no chance that - // this.observers will become undefined. - for (let i = 0; i < this.observers.length; i++) { - this.sendOne(i, fn); - } - } - // Call the Observer via one of it's callback function. We are careful to - // confirm that the observe has not been unsubscribed since this asynchronous - // function had been queued. - sendOne(i, fn) { - // Execute the callback asynchronously - // eslint-disable-next-line @typescript-eslint/no-floating-promises - this.task.then(() => { - if (this.observers !== undefined && this.observers[i] !== undefined) { - try { - fn(this.observers[i]); - } - catch (e) { - // Ignore exceptions raised in Observers or missing methods of an - // Observer. - // Log error to console. b/31404806 - if (typeof console !== 'undefined' && console.error) { - console.error(e); - } - } - } - }); - } - close(err) { - if (this.finalized) { - return; - } - this.finalized = true; - if (err !== undefined) { - this.finalError = err; - } - // Proxy is no longer needed - garbage collect references - // eslint-disable-next-line @typescript-eslint/no-floating-promises - this.task.then(() => { - this.observers = undefined; - this.onNoObservers = undefined; - }); - } -} -/** Turn synchronous function into one called asynchronously. */ -// eslint-disable-next-line @typescript-eslint/ban-types -function async(fn, onError) { - return (...args) => { - Promise.resolve(true) - .then(() => { - fn(...args); - }) - .catch((error) => { - if (onError) { - onError(error); - } - }); - }; -} -/** - * Return true if the object passed in implements any of the named methods. - */ -function implementsAnyMethods(obj, methods) { - if (typeof obj !== 'object' || obj === null) { - return false; - } - for (const method of methods) { - if (method in obj && typeof obj[method] === 'function') { - return true; - } - } - return false; -} -function noop() { - // do nothing -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Check to make sure the appropriate number of arguments are provided for a public function. - * Throws an error if it fails. - * - * @param fnName The function name - * @param minCount The minimum number of arguments to allow for the function call - * @param maxCount The maximum number of argument to allow for the function call - * @param argCount The actual number of arguments provided. - */ -const validateArgCount = function (fnName, minCount, maxCount, argCount) { - let argError; - if (argCount < minCount) { - argError = 'at least ' + minCount; - } - else if (argCount > maxCount) { - argError = maxCount === 0 ? 'none' : 'no more than ' + maxCount; - } - if (argError) { - const error = fnName + - ' failed: Was called with ' + - argCount + - (argCount === 1 ? ' argument.' : ' arguments.') + - ' Expects ' + - argError + - '.'; - throw new Error(error); - } -}; -/** - * Generates a string to prefix an error message about failed argument validation - * - * @param fnName The function name - * @param argName The name of the argument - * @return The prefix to add to the error thrown for validation. - */ -function errorPrefix(fnName, argName) { - return `${fnName} failed: ${argName} argument `; -} -/** - * @param fnName - * @param argumentNumber - * @param namespace - * @param optional - */ -function validateNamespace(fnName, namespace, optional) { - if (optional && !namespace) { - return; - } - if (typeof namespace !== 'string') { - //TODO: I should do more validation here. We only allow certain chars in namespaces. - throw new Error(errorPrefix(fnName, 'namespace') + 'must be a valid firebase namespace.'); - } -} -function validateCallback(fnName, argumentName, -// eslint-disable-next-line @typescript-eslint/ban-types -callback, optional) { - if (optional && !callback) { - return; - } - if (typeof callback !== 'function') { - throw new Error(errorPrefix(fnName, argumentName) + 'must be a valid function.'); - } -} -function validateContextObject(fnName, argumentName, context, optional) { - if (optional && !context) { - return; - } - if (typeof context !== 'object' || context === null) { - throw new Error(errorPrefix(fnName, argumentName) + 'must be a valid context object.'); - } -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Code originally came from goog.crypt.stringToUtf8ByteArray, but for some reason they -// automatically replaced '\r\n' with '\n', and they didn't handle surrogate pairs, -// so it's been modified. -// Note that not all Unicode characters appear as single characters in JavaScript strings. -// fromCharCode returns the UTF-16 encoding of a character - so some Unicode characters -// use 2 characters in Javascript. All 4-byte UTF-8 characters begin with a first -// character in the range 0xD800 - 0xDBFF (the first character of a so-called surrogate -// pair). -// See http://www.ecma-international.org/ecma-262/5.1/#sec-15.1.3 -/** - * @param {string} str - * @return {Array} - */ -const stringToByteArray = function (str) { - const out = []; - let p = 0; - for (let i = 0; i < str.length; i++) { - let c = str.charCodeAt(i); - // Is this the lead surrogate in a surrogate pair? - if (c >= 0xd800 && c <= 0xdbff) { - const high = c - 0xd800; // the high 10 bits. - i++; - assert(i < str.length, 'Surrogate pair missing trail surrogate.'); - const low = str.charCodeAt(i) - 0xdc00; // the low 10 bits. - c = 0x10000 + (high << 10) + low; - } - if (c < 128) { - out[p++] = c; - } - else if (c < 2048) { - out[p++] = (c >> 6) | 192; - out[p++] = (c & 63) | 128; - } - else if (c < 65536) { - out[p++] = (c >> 12) | 224; - out[p++] = ((c >> 6) & 63) | 128; - out[p++] = (c & 63) | 128; - } - else { - out[p++] = (c >> 18) | 240; - out[p++] = ((c >> 12) & 63) | 128; - out[p++] = ((c >> 6) & 63) | 128; - out[p++] = (c & 63) | 128; - } - } - return out; -}; -/** - * Calculate length without actually converting; useful for doing cheaper validation. - * @param {string} str - * @return {number} - */ -const stringLength = function (str) { - let p = 0; - for (let i = 0; i < str.length; i++) { - const c = str.charCodeAt(i); - if (c < 128) { - p++; - } - else if (c < 2048) { - p += 2; - } - else if (c >= 0xd800 && c <= 0xdbff) { - // Lead surrogate of a surrogate pair. The pair together will take 4 bytes to represent. - p += 4; - i++; // skip trail surrogate. - } - else { - p += 3; - } - } - return p; -}; - -/** - * @license - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Copied from https://stackoverflow.com/a/2117523 - * Generates a new uuid. - * @public - */ -const uuidv4 = function () { - return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, c => { - const r = (Math.random() * 16) | 0, v = c === 'x' ? r : (r & 0x3) | 0x8; - return v.toString(16); - }); -}; - -/** - * @license - * Copyright 2019 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * The amount of milliseconds to exponentially increase. - */ -const DEFAULT_INTERVAL_MILLIS = 1000; -/** - * The factor to backoff by. - * Should be a number greater than 1. - */ -const DEFAULT_BACKOFF_FACTOR = 2; -/** - * The maximum milliseconds to increase to. - * - *

Visible for testing - */ -const MAX_VALUE_MILLIS = 4 * 60 * 60 * 1000; // Four hours, like iOS and Android. -/** - * The percentage of backoff time to randomize by. - * See - * http://go/safe-client-behavior#step-1-determine-the-appropriate-retry-interval-to-handle-spike-traffic - * for context. - * - *

Visible for testing - */ -const RANDOM_FACTOR = 0.5; -/** - * Based on the backoff method from - * https://github.com/google/closure-library/blob/master/closure/goog/math/exponentialbackoff.js. - * Extracted here so we don't need to pass metadata and a stateful ExponentialBackoff object around. - */ -function calculateBackoffMillis(backoffCount, intervalMillis = DEFAULT_INTERVAL_MILLIS, backoffFactor = DEFAULT_BACKOFF_FACTOR) { - // Calculates an exponentially increasing value. - // Deviation: calculates value from count and a constant interval, so we only need to save value - // and count to restore state. - const currBaseValue = intervalMillis * Math.pow(backoffFactor, backoffCount); - // A random "fuzz" to avoid waves of retries. - // Deviation: randomFactor is required. - const randomWait = Math.round( - // A fraction of the backoff value to add/subtract. - // Deviation: changes multiplication order to improve readability. - RANDOM_FACTOR * - currBaseValue * - // A random float (rounded to int by Math.round above) in the range [-1, 1]. Determines - // if we add or subtract. - (Math.random() - 0.5) * - 2); - // Limits backoff to max to avoid effectively permanent backoff. - return Math.min(MAX_VALUE_MILLIS, currBaseValue + randomWait); -} - -/** - * @license - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Provide English ordinal letters after a number - */ -function ordinal(i) { - if (!Number.isFinite(i)) { - return `${i}`; - } - return i + indicator(i); -} -function indicator(i) { - i = Math.abs(i); - const cent = i % 100; - if (cent >= 10 && cent <= 20) { - return 'th'; - } - const dec = i % 10; - if (dec === 1) { - return 'st'; - } - if (dec === 2) { - return 'nd'; - } - if (dec === 3) { - return 'rd'; - } - return 'th'; -} - -/** - * @license - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -function getModularInstance(service) { - if (service && service._delegate) { - return service._delegate; - } - else { - return service; - } -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Overriding the constant (we should be the only ones doing this) -CONSTANTS.NODE_CLIENT = true; - -export { CONSTANTS, Deferred, ErrorFactory, FirebaseError, MAX_VALUE_MILLIS, RANDOM_FACTOR, Sha1, areCookiesEnabled, assert, assertionError, async, base64, base64Decode, base64Encode, base64urlEncodeWithoutPadding, calculateBackoffMillis, contains, createMockUserToken, createSubscribe, decode, deepCopy, deepEqual, deepExtend, errorPrefix, extractQuerystring, getDefaultAppConfig, getDefaultEmulatorHost, getDefaultEmulatorHostnameAndPort, getExperimentalSetting, getGlobal, getModularInstance, getUA, isAdmin, isBrowser, isBrowserExtension, isElectron, isEmpty, isIE, isIndexedDBAvailable, isMobileCordova, isNode, isNodeSdk, isReactNative, isSafari, isUWP, isValidFormat, isValidTimestamp, issuedAtTime, jsonEval, map, ordinal, promiseWithTimeout, querystring, querystringDecode, safeGet, stringLength, stringToByteArray, stringify, uuidv4, validateArgCount, validateCallback, validateContextObject, validateIndexedDBOpenable, validateNamespace }; -//# sourceMappingURL=index.node.esm.js.map diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/node-esm/package.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/node-esm/package.json deleted file mode 100644 index 7c34deb5..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/node-esm/package.json +++ /dev/null @@ -1 +0,0 @@ -{"type":"module"} \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/node-esm/src/assert.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/node-esm/src/assert.d.ts deleted file mode 100644 index f16966b5..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/node-esm/src/assert.d.ts +++ /dev/null @@ -1,24 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Throws an error if the provided assertion is falsy - */ -export declare const assert: (assertion: unknown, message: string) => void; -/** - * Returns an Error object suitable for throwing. - */ -export declare const assertionError: (message: string) => Error; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/node-esm/src/compat.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/node-esm/src/compat.d.ts deleted file mode 100644 index 1d0c7d98..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/node-esm/src/compat.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -/** - * @license - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export interface Compat { - _delegate: T; -} -export declare function getModularInstance(service: Compat | ExpService): ExpService; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/node-esm/src/constants.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/node-esm/src/constants.d.ts deleted file mode 100644 index 3f908c9e..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/node-esm/src/constants.d.ts +++ /dev/null @@ -1,33 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * @fileoverview Firebase constants. Some of these (@defines) can be overridden at compile-time. - */ -export declare const CONSTANTS: { - /** - * @define {boolean} Whether this is the client Node.js SDK. - */ - NODE_CLIENT: boolean; - /** - * @define {boolean} Whether this is the Admin Node.js SDK. - */ - NODE_ADMIN: boolean; - /** - * Firebase SDK Version - */ - SDK_VERSION: string; -}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/node-esm/src/crypt.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/node-esm/src/crypt.d.ts deleted file mode 100644 index f8e93ab9..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/node-esm/src/crypt.d.ts +++ /dev/null @@ -1,60 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -interface Base64 { - byteToCharMap_: { - [key: number]: string; - } | null; - charToByteMap_: { - [key: string]: number; - } | null; - byteToCharMapWebSafe_: { - [key: number]: string; - } | null; - charToByteMapWebSafe_: { - [key: string]: number; - } | null; - ENCODED_VALS_BASE: string; - readonly ENCODED_VALS: string; - readonly ENCODED_VALS_WEBSAFE: string; - HAS_NATIVE_SUPPORT: boolean; - encodeByteArray(input: number[] | Uint8Array, webSafe?: boolean): string; - encodeString(input: string, webSafe?: boolean): string; - decodeString(input: string, webSafe: boolean): string; - decodeStringToByteArray(input: string, webSafe: boolean): number[]; - init_(): void; -} -export declare const base64: Base64; -/** - * URL-safe base64 encoding - */ -export declare const base64Encode: (str: string) => string; -/** - * URL-safe base64 encoding (without "." padding in the end). - * e.g. Used in JSON Web Token (JWT) parts. - */ -export declare const base64urlEncodeWithoutPadding: (str: string) => string; -/** - * URL-safe base64 decoding - * - * NOTE: DO NOT use the global atob() function - it does NOT support the - * base64Url variant encoding. - * - * @param str To be decoded - * @return Decoded result, if possible - */ -export declare const base64Decode: (str: string) => string | null; -export {}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/node-esm/src/deepCopy.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/node-esm/src/deepCopy.d.ts deleted file mode 100644 index bea1dba9..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/node-esm/src/deepCopy.d.ts +++ /dev/null @@ -1,35 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Do a deep-copy of basic JavaScript Objects or Arrays. - */ -export declare function deepCopy(value: T): T; -/** - * Copy properties from source to target (recursively allows extension - * of Objects and Arrays). Scalar values in the target are over-written. - * If target is undefined, an object of the appropriate type will be created - * (and returned). - * - * We recursively copy all child properties of plain Objects in the source- so - * that namespace- like dictionaries are merged. - * - * Note that the target can be a function, in which case the properties in - * the source Object are copied onto it as static properties of the Function. - * - * Note: we don't merge __proto__ to prevent prototype pollution - */ -export declare function deepExtend(target: unknown, source: unknown): unknown; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/node-esm/src/defaults.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/node-esm/src/defaults.d.ts deleted file mode 100644 index 8032101b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/node-esm/src/defaults.d.ts +++ /dev/null @@ -1,66 +0,0 @@ -/** - * @license - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Keys for experimental properties on the `FirebaseDefaults` object. - * @public - */ -export declare type ExperimentalKey = 'authTokenSyncURL' | 'authIdTokenMaxAge'; -/** - * An object that can be injected into the environment as __FIREBASE_DEFAULTS__, - * either as a property of globalThis, a shell environment variable, or a - * cookie. - * - * This object can be used to automatically configure and initialize - * a Firebase app as well as any emulators. - * - * @public - */ -export interface FirebaseDefaults { - config?: Record; - emulatorHosts?: Record; - _authTokenSyncURL?: string; - _authIdTokenMaxAge?: number; - [key: string]: unknown; -} -declare global { - var __FIREBASE_DEFAULTS__: FirebaseDefaults | undefined; -} -/** - * Returns emulator host stored in the __FIREBASE_DEFAULTS__ object - * for the given product. - * @returns a URL host formatted like `127.0.0.1:9999` or `[::1]:4000` if available - * @public - */ -export declare const getDefaultEmulatorHost: (productName: string) => string | undefined; -/** - * Returns emulator hostname and port stored in the __FIREBASE_DEFAULTS__ object - * for the given product. - * @returns a pair of hostname and port like `["::1", 4000]` if available - * @public - */ -export declare const getDefaultEmulatorHostnameAndPort: (productName: string) => [hostname: string, port: number] | undefined; -/** - * Returns Firebase app config stored in the __FIREBASE_DEFAULTS__ object. - * @public - */ -export declare const getDefaultAppConfig: () => Record | undefined; -/** - * Returns an experimental setting on the __FIREBASE_DEFAULTS__ object (properties - * prefixed by "_") - * @public - */ -export declare const getExperimentalSetting: (name: T) => FirebaseDefaults[`_${T}`]; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/node-esm/src/deferred.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/node-esm/src/deferred.d.ts deleted file mode 100644 index 376a5331..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/node-esm/src/deferred.d.ts +++ /dev/null @@ -1,28 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export declare class Deferred { - promise: Promise; - reject: (value?: unknown) => void; - resolve: (value?: unknown) => void; - constructor(); - /** - * Our API internals are not promiseified and cannot because our callback APIs have subtle expectations around - * invoking promises inline, which Promises are forbidden to do. This method accepts an optional node-style callback - * and returns a node-style callback which will resolve or reject the Deferred's promise. - */ - wrapCallback(callback?: (error?: unknown, value?: unknown) => void): (error: unknown, value?: unknown) => void; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/node-esm/src/emulator.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/node-esm/src/emulator.d.ts deleted file mode 100644 index 79244b52..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/node-esm/src/emulator.d.ts +++ /dev/null @@ -1,47 +0,0 @@ -/** - * @license - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export declare type FirebaseSignInProvider = 'custom' | 'email' | 'password' | 'phone' | 'anonymous' | 'google.com' | 'facebook.com' | 'github.com' | 'twitter.com' | 'microsoft.com' | 'apple.com'; -interface FirebaseIdToken { - iss: string; - aud: string; - sub: string; - iat: number; - exp: number; - user_id: string; - auth_time: number; - provider_id?: 'anonymous'; - email?: string; - email_verified?: boolean; - phone_number?: string; - name?: string; - picture?: string; - firebase: { - sign_in_provider: FirebaseSignInProvider; - identities?: { - [provider in FirebaseSignInProvider]?: string[]; - }; - }; - [claim: string]: unknown; - uid?: never; -} -export declare type EmulatorMockTokenOptions = ({ - user_id: string; -} | { - sub: string; -}) & Partial; -export declare function createMockUserToken(token: EmulatorMockTokenOptions, projectId?: string): string; -export {}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/node-esm/src/environment.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/node-esm/src/environment.d.ts deleted file mode 100644 index b31be6e9..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/node-esm/src/environment.d.ts +++ /dev/null @@ -1,84 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Returns navigator.userAgent string or '' if it's not defined. - * @return user agent string - */ -export declare function getUA(): string; -/** - * Detect Cordova / PhoneGap / Ionic frameworks on a mobile device. - * - * Deliberately does not rely on checking `file://` URLs (as this fails PhoneGap - * in the Ripple emulator) nor Cordova `onDeviceReady`, which would normally - * wait for a callback. - */ -export declare function isMobileCordova(): boolean; -/** - * Detect Node.js. - * - * @return true if Node.js environment is detected. - */ -export declare function isNode(): boolean; -/** - * Detect Browser Environment - */ -export declare function isBrowser(): boolean; -export declare function isBrowserExtension(): boolean; -/** - * Detect React Native. - * - * @return true if ReactNative environment is detected. - */ -export declare function isReactNative(): boolean; -/** Detects Electron apps. */ -export declare function isElectron(): boolean; -/** Detects Internet Explorer. */ -export declare function isIE(): boolean; -/** Detects Universal Windows Platform apps. */ -export declare function isUWP(): boolean; -/** - * Detect whether the current SDK build is the Node version. - * - * @return true if it's the Node SDK build. - */ -export declare function isNodeSdk(): boolean; -/** Returns true if we are running in Safari. */ -export declare function isSafari(): boolean; -/** - * This method checks if indexedDB is supported by current browser/service worker context - * @return true if indexedDB is supported by current browser/service worker context - */ -export declare function isIndexedDBAvailable(): boolean; -/** - * This method validates browser/sw context for indexedDB by opening a dummy indexedDB database and reject - * if errors occur during the database open operation. - * - * @throws exception if current browser/sw context can't run idb.open (ex: Safari iframe, Firefox - * private browsing) - */ -export declare function validateIndexedDBOpenable(): Promise; -/** - * - * This method checks whether cookie is enabled within current browser - * @return true if cookie is enabled within current browser - */ -export declare function areCookiesEnabled(): boolean; -/** - * Polyfill for `globalThis` object. - * @returns the `globalThis` object for the given environment. - */ -export declare function getGlobal(): typeof globalThis; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/node-esm/src/errors.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/node-esm/src/errors.d.ts deleted file mode 100644 index 526a1938..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/node-esm/src/errors.d.ts +++ /dev/null @@ -1,87 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * @fileoverview Standardized Firebase Error. - * - * Usage: - * - * // Typescript string literals for type-safe codes - * type Err = - * 'unknown' | - * 'object-not-found' - * ; - * - * // Closure enum for type-safe error codes - * // at-enum {string} - * var Err = { - * UNKNOWN: 'unknown', - * OBJECT_NOT_FOUND: 'object-not-found', - * } - * - * let errors: Map = { - * 'generic-error': "Unknown error", - * 'file-not-found': "Could not find file: {$file}", - * }; - * - * // Type-safe function - must pass a valid error code as param. - * let error = new ErrorFactory('service', 'Service', errors); - * - * ... - * throw error.create(Err.GENERIC); - * ... - * throw error.create(Err.FILE_NOT_FOUND, {'file': fileName}); - * ... - * // Service: Could not file file: foo.txt (service/file-not-found). - * - * catch (e) { - * assert(e.message === "Could not find file: foo.txt."); - * if ((e as FirebaseError)?.code === 'service/file-not-found') { - * console.log("Could not read file: " + e['file']); - * } - * } - */ -export declare type ErrorMap = { - readonly [K in ErrorCode]: string; -}; -export interface StringLike { - toString(): string; -} -export interface ErrorData { - [key: string]: unknown; -} -export declare class FirebaseError extends Error { - /** The error code for this error. */ - readonly code: string; - /** Custom data for this error. */ - customData?: Record | undefined; - /** The custom name for all FirebaseErrors. */ - readonly name: string; - constructor( - /** The error code for this error. */ - code: string, message: string, - /** Custom data for this error. */ - customData?: Record | undefined); -} -export declare class ErrorFactory { - private readonly service; - private readonly serviceName; - private readonly errors; - constructor(service: string, serviceName: string, errors: ErrorMap); - create(code: K, ...data: K extends keyof ErrorParams ? [ErrorParams[K]] : []): FirebaseError; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/node-esm/src/exponential_backoff.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/node-esm/src/exponential_backoff.d.ts deleted file mode 100644 index 3e57c34f..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/node-esm/src/exponential_backoff.d.ts +++ /dev/null @@ -1,37 +0,0 @@ -/** - * @license - * Copyright 2019 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * The maximum milliseconds to increase to. - * - *

Visible for testing - */ -export declare const MAX_VALUE_MILLIS: number; -/** - * The percentage of backoff time to randomize by. - * See - * http://go/safe-client-behavior#step-1-determine-the-appropriate-retry-interval-to-handle-spike-traffic - * for context. - * - *

Visible for testing - */ -export declare const RANDOM_FACTOR = 0.5; -/** - * Based on the backoff method from - * https://github.com/google/closure-library/blob/master/closure/goog/math/exponentialbackoff.js. - * Extracted here so we don't need to pass metadata and a stateful ExponentialBackoff object around. - */ -export declare function calculateBackoffMillis(backoffCount: number, intervalMillis?: number, backoffFactor?: number): number; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/node-esm/src/formatters.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/node-esm/src/formatters.d.ts deleted file mode 100644 index 85483d80..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/node-esm/src/formatters.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Provide English ordinal letters after a number - */ -export declare function ordinal(i: number): string; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/node-esm/src/json.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/node-esm/src/json.d.ts deleted file mode 100644 index 33f2c6a5..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/node-esm/src/json.d.ts +++ /dev/null @@ -1,29 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Evaluates a JSON string into a javascript object. - * - * @param {string} str A string containing JSON. - * @return {*} The javascript object representing the specified JSON. - */ -export declare function jsonEval(str: string): unknown; -/** - * Returns JSON representing a javascript object. - * @param {*} data Javascript object to be stringified. - * @return {string} The JSON contents of the object. - */ -export declare function stringify(data: unknown): string; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/node-esm/src/jwt.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/node-esm/src/jwt.d.ts deleted file mode 100644 index 19a0b168..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/node-esm/src/jwt.d.ts +++ /dev/null @@ -1,73 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -interface Claims { - [key: string]: {}; -} -interface DecodedToken { - header: object; - claims: Claims; - data: object; - signature: string; -} -/** - * Decodes a Firebase auth. token into constituent parts. - * - * Notes: - * - May return with invalid / incomplete claims if there's no native base64 decoding support. - * - Doesn't check if the token is actually valid. - */ -export declare const decode: (token: string) => DecodedToken; -interface DecodedToken { - header: object; - claims: Claims; - data: object; - signature: string; -} -/** - * Decodes a Firebase auth. token and checks the validity of its time-based claims. Will return true if the - * token is within the time window authorized by the 'nbf' (not-before) and 'iat' (issued-at) claims. - * - * Notes: - * - May return a false negative if there's no native base64 decoding support. - * - Doesn't check if the token is actually valid. - */ -export declare const isValidTimestamp: (token: string) => boolean; -/** - * Decodes a Firebase auth. token and returns its issued at time if valid, null otherwise. - * - * Notes: - * - May return null if there's no native base64 decoding support. - * - Doesn't check if the token is actually valid. - */ -export declare const issuedAtTime: (token: string) => number | null; -/** - * Decodes a Firebase auth. token and checks the validity of its format. Expects a valid issued-at time. - * - * Notes: - * - May return a false negative if there's no native base64 decoding support. - * - Doesn't check if the token is actually valid. - */ -export declare const isValidFormat: (token: string) => boolean; -/** - * Attempts to peer into an auth token and determine if it's an admin auth token by looking at the claims portion. - * - * Notes: - * - May return a false negative if there's no native base64 decoding support. - * - Doesn't check if the token is actually valid. - */ -export declare const isAdmin: (token: string) => boolean; -export {}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/node-esm/src/obj.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/node-esm/src/obj.d.ts deleted file mode 100644 index 024cc000..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/node-esm/src/obj.d.ts +++ /dev/null @@ -1,30 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export declare function contains(obj: T, key: string): boolean; -export declare function safeGet(obj: T, key: K): T[K] | undefined; -export declare function isEmpty(obj: object): obj is {}; -export declare function map(obj: { - [key in K]: V; -}, fn: (value: V, key: K, obj: { - [key in K]: V; -}) => U, contextObj?: unknown): { - [key in K]: U; -}; -/** - * Deep equal two objects. Support Arrays and Objects. - */ -export declare function deepEqual(a: object, b: object): boolean; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/node-esm/src/promise.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/node-esm/src/promise.d.ts deleted file mode 100644 index 4b89ae27..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/node-esm/src/promise.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -/** - * @license - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Rejects if the given promise doesn't resolve in timeInMS milliseconds. - * @internal - */ -export declare function promiseWithTimeout(promise: Promise, timeInMS?: number): Promise; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/node-esm/src/query.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/node-esm/src/query.d.ts deleted file mode 100644 index 99b15a52..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/node-esm/src/query.d.ts +++ /dev/null @@ -1,33 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Returns a querystring-formatted string (e.g. &arg=val&arg2=val2) from a - * params object (e.g. {arg: 'val', arg2: 'val2'}) - * Note: You must prepend it with ? when adding it to a URL. - */ -export declare function querystring(querystringParams: { - [key: string]: string | number; -}): string; -/** - * Decodes a querystring (e.g. ?arg=val&arg2=val2) into a params object - * (e.g. {arg: 'val', arg2: 'val2'}) - */ -export declare function querystringDecode(querystring: string): Record; -/** - * Extract the query string part of a URL, including the leading question mark (if present). - */ -export declare function extractQuerystring(url: string): string; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/node-esm/src/sha1.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/node-esm/src/sha1.d.ts deleted file mode 100644 index e839144c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/node-esm/src/sha1.d.ts +++ /dev/null @@ -1,84 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * @fileoverview SHA-1 cryptographic hash. - * Variable names follow the notation in FIPS PUB 180-3: - * http://csrc.nist.gov/publications/fips/fips180-3/fips180-3_final.pdf. - * - * Usage: - * var sha1 = new sha1(); - * sha1.update(bytes); - * var hash = sha1.digest(); - * - * Performance: - * Chrome 23: ~400 Mbit/s - * Firefox 16: ~250 Mbit/s - * - */ -/** - * SHA-1 cryptographic hash constructor. - * - * The properties declared here are discussed in the above algorithm document. - * @constructor - * @final - * @struct - */ -export declare class Sha1 { - /** - * Holds the previous values of accumulated variables a-e in the compress_ - * function. - * @private - */ - private chain_; - /** - * A buffer holding the partially computed hash result. - * @private - */ - private buf_; - /** - * An array of 80 bytes, each a part of the message to be hashed. Referred to - * as the message schedule in the docs. - * @private - */ - private W_; - /** - * Contains data needed to pad messages less than 64 bytes. - * @private - */ - private pad_; - /** - * @private {number} - */ - private inbuf_; - /** - * @private {number} - */ - private total_; - blockSize: number; - constructor(); - reset(): void; - /** - * Internal compress helper function. - * @param buf Block to compress. - * @param offset Offset of the block in the buffer. - * @private - */ - compress_(buf: number[] | Uint8Array | string, offset?: number): void; - update(bytes?: number[] | Uint8Array | string, length?: number): void; - /** @override */ - digest(): number[]; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/node-esm/src/subscribe.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/node-esm/src/subscribe.d.ts deleted file mode 100644 index 327faab6..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/node-esm/src/subscribe.d.ts +++ /dev/null @@ -1,49 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export declare type NextFn = (value: T) => void; -export declare type ErrorFn = (error: Error) => void; -export declare type CompleteFn = () => void; -export interface Observer { - next: NextFn; - error: ErrorFn; - complete: CompleteFn; -} -export declare type PartialObserver = Partial>; -export declare type Unsubscribe = () => void; -/** - * The Subscribe interface has two forms - passing the inline function - * callbacks, or a object interface with callback properties. - */ -export interface Subscribe { - (next?: NextFn, error?: ErrorFn, complete?: CompleteFn): Unsubscribe; - (observer: PartialObserver): Unsubscribe; -} -export interface Observable { - subscribe: Subscribe; -} -export declare type Executor = (observer: Observer) => void; -/** - * Helper to make a Subscribe function (just like Promise helps make a - * Thenable). - * - * @param executor Function which can make calls to a single Observer - * as a proxy. - * @param onNoObservers Callback when count of Observers goes to zero. - */ -export declare function createSubscribe(executor: Executor, onNoObservers?: Executor): Subscribe; -/** Turn synchronous function into one called asynchronously. */ -export declare function async(fn: Function, onError?: ErrorFn): Function; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/node-esm/src/utf8.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/node-esm/src/utf8.d.ts deleted file mode 100644 index 4db9431f..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/node-esm/src/utf8.d.ts +++ /dev/null @@ -1,27 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * @param {string} str - * @return {Array} - */ -export declare const stringToByteArray: (str: string) => number[]; -/** - * Calculate length without actually converting; useful for doing cheaper validation. - * @param {string} str - * @return {number} - */ -export declare const stringLength: (str: string) => number; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/node-esm/src/uuid.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/node-esm/src/uuid.d.ts deleted file mode 100644 index be85202a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/node-esm/src/uuid.d.ts +++ /dev/null @@ -1,22 +0,0 @@ -/** - * @license - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Copied from https://stackoverflow.com/a/2117523 - * Generates a new uuid. - * @public - */ -export declare const uuidv4: () => string; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/node-esm/src/validation.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/node-esm/src/validation.d.ts deleted file mode 100644 index d452ce6b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/node-esm/src/validation.d.ts +++ /dev/null @@ -1,43 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Check to make sure the appropriate number of arguments are provided for a public function. - * Throws an error if it fails. - * - * @param fnName The function name - * @param minCount The minimum number of arguments to allow for the function call - * @param maxCount The maximum number of argument to allow for the function call - * @param argCount The actual number of arguments provided. - */ -export declare const validateArgCount: (fnName: string, minCount: number, maxCount: number, argCount: number) => void; -/** - * Generates a string to prefix an error message about failed argument validation - * - * @param fnName The function name - * @param argName The name of the argument - * @return The prefix to add to the error thrown for validation. - */ -export declare function errorPrefix(fnName: string, argName: string): string; -/** - * @param fnName - * @param argumentNumber - * @param namespace - * @param optional - */ -export declare function validateNamespace(fnName: string, namespace: string, optional: boolean): void; -export declare function validateCallback(fnName: string, argumentName: string, callback: Function, optional: boolean): void; -export declare function validateContextObject(fnName: string, argumentName: string, context: unknown, optional: boolean): void; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/node-esm/test/base64.test.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/node-esm/test/base64.test.d.ts deleted file mode 100644 index 509db186..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/node-esm/test/base64.test.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/node-esm/test/compat.test.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/node-esm/test/compat.test.d.ts deleted file mode 100644 index d92ca4eb..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/node-esm/test/compat.test.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * @license - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export {}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/node-esm/test/deepCopy.test.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/node-esm/test/deepCopy.test.d.ts deleted file mode 100644 index 509db186..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/node-esm/test/deepCopy.test.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/node-esm/test/defaults.test.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/node-esm/test/defaults.test.d.ts deleted file mode 100644 index 509db186..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/node-esm/test/defaults.test.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/node-esm/test/emulator.test.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/node-esm/test/emulator.test.d.ts deleted file mode 100644 index 509db186..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/node-esm/test/emulator.test.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/node-esm/test/errors.test.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/node-esm/test/errors.test.d.ts deleted file mode 100644 index 509db186..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/node-esm/test/errors.test.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/node-esm/test/exponential_backoff.test.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/node-esm/test/exponential_backoff.test.d.ts deleted file mode 100644 index 05e43f18..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/node-esm/test/exponential_backoff.test.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * @license - * Copyright 2019 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export {}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/node-esm/test/object.test.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/node-esm/test/object.test.d.ts deleted file mode 100644 index d92ca4eb..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/node-esm/test/object.test.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * @license - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export {}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/node-esm/test/subscribe.test.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/node-esm/test/subscribe.test.d.ts deleted file mode 100644 index cd6aeb9b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/node-esm/test/subscribe.test.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export {}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/src/assert.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/src/assert.d.ts deleted file mode 100644 index f16966b5..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/src/assert.d.ts +++ /dev/null @@ -1,24 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Throws an error if the provided assertion is falsy - */ -export declare const assert: (assertion: unknown, message: string) => void; -/** - * Returns an Error object suitable for throwing. - */ -export declare const assertionError: (message: string) => Error; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/src/compat.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/src/compat.d.ts deleted file mode 100644 index 1d0c7d98..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/src/compat.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -/** - * @license - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export interface Compat { - _delegate: T; -} -export declare function getModularInstance(service: Compat | ExpService): ExpService; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/src/constants.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/src/constants.d.ts deleted file mode 100644 index 3f908c9e..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/src/constants.d.ts +++ /dev/null @@ -1,33 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * @fileoverview Firebase constants. Some of these (@defines) can be overridden at compile-time. - */ -export declare const CONSTANTS: { - /** - * @define {boolean} Whether this is the client Node.js SDK. - */ - NODE_CLIENT: boolean; - /** - * @define {boolean} Whether this is the Admin Node.js SDK. - */ - NODE_ADMIN: boolean; - /** - * Firebase SDK Version - */ - SDK_VERSION: string; -}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/src/crypt.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/src/crypt.d.ts deleted file mode 100644 index f8e93ab9..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/src/crypt.d.ts +++ /dev/null @@ -1,60 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -interface Base64 { - byteToCharMap_: { - [key: number]: string; - } | null; - charToByteMap_: { - [key: string]: number; - } | null; - byteToCharMapWebSafe_: { - [key: number]: string; - } | null; - charToByteMapWebSafe_: { - [key: string]: number; - } | null; - ENCODED_VALS_BASE: string; - readonly ENCODED_VALS: string; - readonly ENCODED_VALS_WEBSAFE: string; - HAS_NATIVE_SUPPORT: boolean; - encodeByteArray(input: number[] | Uint8Array, webSafe?: boolean): string; - encodeString(input: string, webSafe?: boolean): string; - decodeString(input: string, webSafe: boolean): string; - decodeStringToByteArray(input: string, webSafe: boolean): number[]; - init_(): void; -} -export declare const base64: Base64; -/** - * URL-safe base64 encoding - */ -export declare const base64Encode: (str: string) => string; -/** - * URL-safe base64 encoding (without "." padding in the end). - * e.g. Used in JSON Web Token (JWT) parts. - */ -export declare const base64urlEncodeWithoutPadding: (str: string) => string; -/** - * URL-safe base64 decoding - * - * NOTE: DO NOT use the global atob() function - it does NOT support the - * base64Url variant encoding. - * - * @param str To be decoded - * @return Decoded result, if possible - */ -export declare const base64Decode: (str: string) => string | null; -export {}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/src/deepCopy.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/src/deepCopy.d.ts deleted file mode 100644 index bea1dba9..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/src/deepCopy.d.ts +++ /dev/null @@ -1,35 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Do a deep-copy of basic JavaScript Objects or Arrays. - */ -export declare function deepCopy(value: T): T; -/** - * Copy properties from source to target (recursively allows extension - * of Objects and Arrays). Scalar values in the target are over-written. - * If target is undefined, an object of the appropriate type will be created - * (and returned). - * - * We recursively copy all child properties of plain Objects in the source- so - * that namespace- like dictionaries are merged. - * - * Note that the target can be a function, in which case the properties in - * the source Object are copied onto it as static properties of the Function. - * - * Note: we don't merge __proto__ to prevent prototype pollution - */ -export declare function deepExtend(target: unknown, source: unknown): unknown; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/src/defaults.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/src/defaults.d.ts deleted file mode 100644 index 8032101b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/src/defaults.d.ts +++ /dev/null @@ -1,66 +0,0 @@ -/** - * @license - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Keys for experimental properties on the `FirebaseDefaults` object. - * @public - */ -export declare type ExperimentalKey = 'authTokenSyncURL' | 'authIdTokenMaxAge'; -/** - * An object that can be injected into the environment as __FIREBASE_DEFAULTS__, - * either as a property of globalThis, a shell environment variable, or a - * cookie. - * - * This object can be used to automatically configure and initialize - * a Firebase app as well as any emulators. - * - * @public - */ -export interface FirebaseDefaults { - config?: Record; - emulatorHosts?: Record; - _authTokenSyncURL?: string; - _authIdTokenMaxAge?: number; - [key: string]: unknown; -} -declare global { - var __FIREBASE_DEFAULTS__: FirebaseDefaults | undefined; -} -/** - * Returns emulator host stored in the __FIREBASE_DEFAULTS__ object - * for the given product. - * @returns a URL host formatted like `127.0.0.1:9999` or `[::1]:4000` if available - * @public - */ -export declare const getDefaultEmulatorHost: (productName: string) => string | undefined; -/** - * Returns emulator hostname and port stored in the __FIREBASE_DEFAULTS__ object - * for the given product. - * @returns a pair of hostname and port like `["::1", 4000]` if available - * @public - */ -export declare const getDefaultEmulatorHostnameAndPort: (productName: string) => [hostname: string, port: number] | undefined; -/** - * Returns Firebase app config stored in the __FIREBASE_DEFAULTS__ object. - * @public - */ -export declare const getDefaultAppConfig: () => Record | undefined; -/** - * Returns an experimental setting on the __FIREBASE_DEFAULTS__ object (properties - * prefixed by "_") - * @public - */ -export declare const getExperimentalSetting: (name: T) => FirebaseDefaults[`_${T}`]; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/src/deferred.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/src/deferred.d.ts deleted file mode 100644 index 376a5331..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/src/deferred.d.ts +++ /dev/null @@ -1,28 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export declare class Deferred { - promise: Promise; - reject: (value?: unknown) => void; - resolve: (value?: unknown) => void; - constructor(); - /** - * Our API internals are not promiseified and cannot because our callback APIs have subtle expectations around - * invoking promises inline, which Promises are forbidden to do. This method accepts an optional node-style callback - * and returns a node-style callback which will resolve or reject the Deferred's promise. - */ - wrapCallback(callback?: (error?: unknown, value?: unknown) => void): (error: unknown, value?: unknown) => void; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/src/emulator.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/src/emulator.d.ts deleted file mode 100644 index 79244b52..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/src/emulator.d.ts +++ /dev/null @@ -1,47 +0,0 @@ -/** - * @license - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export declare type FirebaseSignInProvider = 'custom' | 'email' | 'password' | 'phone' | 'anonymous' | 'google.com' | 'facebook.com' | 'github.com' | 'twitter.com' | 'microsoft.com' | 'apple.com'; -interface FirebaseIdToken { - iss: string; - aud: string; - sub: string; - iat: number; - exp: number; - user_id: string; - auth_time: number; - provider_id?: 'anonymous'; - email?: string; - email_verified?: boolean; - phone_number?: string; - name?: string; - picture?: string; - firebase: { - sign_in_provider: FirebaseSignInProvider; - identities?: { - [provider in FirebaseSignInProvider]?: string[]; - }; - }; - [claim: string]: unknown; - uid?: never; -} -export declare type EmulatorMockTokenOptions = ({ - user_id: string; -} | { - sub: string; -}) & Partial; -export declare function createMockUserToken(token: EmulatorMockTokenOptions, projectId?: string): string; -export {}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/src/environment.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/src/environment.d.ts deleted file mode 100644 index b31be6e9..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/src/environment.d.ts +++ /dev/null @@ -1,84 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Returns navigator.userAgent string or '' if it's not defined. - * @return user agent string - */ -export declare function getUA(): string; -/** - * Detect Cordova / PhoneGap / Ionic frameworks on a mobile device. - * - * Deliberately does not rely on checking `file://` URLs (as this fails PhoneGap - * in the Ripple emulator) nor Cordova `onDeviceReady`, which would normally - * wait for a callback. - */ -export declare function isMobileCordova(): boolean; -/** - * Detect Node.js. - * - * @return true if Node.js environment is detected. - */ -export declare function isNode(): boolean; -/** - * Detect Browser Environment - */ -export declare function isBrowser(): boolean; -export declare function isBrowserExtension(): boolean; -/** - * Detect React Native. - * - * @return true if ReactNative environment is detected. - */ -export declare function isReactNative(): boolean; -/** Detects Electron apps. */ -export declare function isElectron(): boolean; -/** Detects Internet Explorer. */ -export declare function isIE(): boolean; -/** Detects Universal Windows Platform apps. */ -export declare function isUWP(): boolean; -/** - * Detect whether the current SDK build is the Node version. - * - * @return true if it's the Node SDK build. - */ -export declare function isNodeSdk(): boolean; -/** Returns true if we are running in Safari. */ -export declare function isSafari(): boolean; -/** - * This method checks if indexedDB is supported by current browser/service worker context - * @return true if indexedDB is supported by current browser/service worker context - */ -export declare function isIndexedDBAvailable(): boolean; -/** - * This method validates browser/sw context for indexedDB by opening a dummy indexedDB database and reject - * if errors occur during the database open operation. - * - * @throws exception if current browser/sw context can't run idb.open (ex: Safari iframe, Firefox - * private browsing) - */ -export declare function validateIndexedDBOpenable(): Promise; -/** - * - * This method checks whether cookie is enabled within current browser - * @return true if cookie is enabled within current browser - */ -export declare function areCookiesEnabled(): boolean; -/** - * Polyfill for `globalThis` object. - * @returns the `globalThis` object for the given environment. - */ -export declare function getGlobal(): typeof globalThis; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/src/errors.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/src/errors.d.ts deleted file mode 100644 index 526a1938..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/src/errors.d.ts +++ /dev/null @@ -1,87 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * @fileoverview Standardized Firebase Error. - * - * Usage: - * - * // Typescript string literals for type-safe codes - * type Err = - * 'unknown' | - * 'object-not-found' - * ; - * - * // Closure enum for type-safe error codes - * // at-enum {string} - * var Err = { - * UNKNOWN: 'unknown', - * OBJECT_NOT_FOUND: 'object-not-found', - * } - * - * let errors: Map = { - * 'generic-error': "Unknown error", - * 'file-not-found': "Could not find file: {$file}", - * }; - * - * // Type-safe function - must pass a valid error code as param. - * let error = new ErrorFactory('service', 'Service', errors); - * - * ... - * throw error.create(Err.GENERIC); - * ... - * throw error.create(Err.FILE_NOT_FOUND, {'file': fileName}); - * ... - * // Service: Could not file file: foo.txt (service/file-not-found). - * - * catch (e) { - * assert(e.message === "Could not find file: foo.txt."); - * if ((e as FirebaseError)?.code === 'service/file-not-found') { - * console.log("Could not read file: " + e['file']); - * } - * } - */ -export declare type ErrorMap = { - readonly [K in ErrorCode]: string; -}; -export interface StringLike { - toString(): string; -} -export interface ErrorData { - [key: string]: unknown; -} -export declare class FirebaseError extends Error { - /** The error code for this error. */ - readonly code: string; - /** Custom data for this error. */ - customData?: Record | undefined; - /** The custom name for all FirebaseErrors. */ - readonly name: string; - constructor( - /** The error code for this error. */ - code: string, message: string, - /** Custom data for this error. */ - customData?: Record | undefined); -} -export declare class ErrorFactory { - private readonly service; - private readonly serviceName; - private readonly errors; - constructor(service: string, serviceName: string, errors: ErrorMap); - create(code: K, ...data: K extends keyof ErrorParams ? [ErrorParams[K]] : []): FirebaseError; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/src/exponential_backoff.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/src/exponential_backoff.d.ts deleted file mode 100644 index 3e57c34f..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/src/exponential_backoff.d.ts +++ /dev/null @@ -1,37 +0,0 @@ -/** - * @license - * Copyright 2019 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * The maximum milliseconds to increase to. - * - *

Visible for testing - */ -export declare const MAX_VALUE_MILLIS: number; -/** - * The percentage of backoff time to randomize by. - * See - * http://go/safe-client-behavior#step-1-determine-the-appropriate-retry-interval-to-handle-spike-traffic - * for context. - * - *

Visible for testing - */ -export declare const RANDOM_FACTOR = 0.5; -/** - * Based on the backoff method from - * https://github.com/google/closure-library/blob/master/closure/goog/math/exponentialbackoff.js. - * Extracted here so we don't need to pass metadata and a stateful ExponentialBackoff object around. - */ -export declare function calculateBackoffMillis(backoffCount: number, intervalMillis?: number, backoffFactor?: number): number; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/src/formatters.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/src/formatters.d.ts deleted file mode 100644 index 85483d80..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/src/formatters.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Provide English ordinal letters after a number - */ -export declare function ordinal(i: number): string; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/src/json.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/src/json.d.ts deleted file mode 100644 index 33f2c6a5..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/src/json.d.ts +++ /dev/null @@ -1,29 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Evaluates a JSON string into a javascript object. - * - * @param {string} str A string containing JSON. - * @return {*} The javascript object representing the specified JSON. - */ -export declare function jsonEval(str: string): unknown; -/** - * Returns JSON representing a javascript object. - * @param {*} data Javascript object to be stringified. - * @return {string} The JSON contents of the object. - */ -export declare function stringify(data: unknown): string; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/src/jwt.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/src/jwt.d.ts deleted file mode 100644 index 19a0b168..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/src/jwt.d.ts +++ /dev/null @@ -1,73 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -interface Claims { - [key: string]: {}; -} -interface DecodedToken { - header: object; - claims: Claims; - data: object; - signature: string; -} -/** - * Decodes a Firebase auth. token into constituent parts. - * - * Notes: - * - May return with invalid / incomplete claims if there's no native base64 decoding support. - * - Doesn't check if the token is actually valid. - */ -export declare const decode: (token: string) => DecodedToken; -interface DecodedToken { - header: object; - claims: Claims; - data: object; - signature: string; -} -/** - * Decodes a Firebase auth. token and checks the validity of its time-based claims. Will return true if the - * token is within the time window authorized by the 'nbf' (not-before) and 'iat' (issued-at) claims. - * - * Notes: - * - May return a false negative if there's no native base64 decoding support. - * - Doesn't check if the token is actually valid. - */ -export declare const isValidTimestamp: (token: string) => boolean; -/** - * Decodes a Firebase auth. token and returns its issued at time if valid, null otherwise. - * - * Notes: - * - May return null if there's no native base64 decoding support. - * - Doesn't check if the token is actually valid. - */ -export declare const issuedAtTime: (token: string) => number | null; -/** - * Decodes a Firebase auth. token and checks the validity of its format. Expects a valid issued-at time. - * - * Notes: - * - May return a false negative if there's no native base64 decoding support. - * - Doesn't check if the token is actually valid. - */ -export declare const isValidFormat: (token: string) => boolean; -/** - * Attempts to peer into an auth token and determine if it's an admin auth token by looking at the claims portion. - * - * Notes: - * - May return a false negative if there's no native base64 decoding support. - * - Doesn't check if the token is actually valid. - */ -export declare const isAdmin: (token: string) => boolean; -export {}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/src/obj.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/src/obj.d.ts deleted file mode 100644 index 024cc000..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/src/obj.d.ts +++ /dev/null @@ -1,30 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export declare function contains(obj: T, key: string): boolean; -export declare function safeGet(obj: T, key: K): T[K] | undefined; -export declare function isEmpty(obj: object): obj is {}; -export declare function map(obj: { - [key in K]: V; -}, fn: (value: V, key: K, obj: { - [key in K]: V; -}) => U, contextObj?: unknown): { - [key in K]: U; -}; -/** - * Deep equal two objects. Support Arrays and Objects. - */ -export declare function deepEqual(a: object, b: object): boolean; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/src/promise.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/src/promise.d.ts deleted file mode 100644 index 4b89ae27..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/src/promise.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -/** - * @license - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Rejects if the given promise doesn't resolve in timeInMS milliseconds. - * @internal - */ -export declare function promiseWithTimeout(promise: Promise, timeInMS?: number): Promise; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/src/query.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/src/query.d.ts deleted file mode 100644 index 99b15a52..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/src/query.d.ts +++ /dev/null @@ -1,33 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Returns a querystring-formatted string (e.g. &arg=val&arg2=val2) from a - * params object (e.g. {arg: 'val', arg2: 'val2'}) - * Note: You must prepend it with ? when adding it to a URL. - */ -export declare function querystring(querystringParams: { - [key: string]: string | number; -}): string; -/** - * Decodes a querystring (e.g. ?arg=val&arg2=val2) into a params object - * (e.g. {arg: 'val', arg2: 'val2'}) - */ -export declare function querystringDecode(querystring: string): Record; -/** - * Extract the query string part of a URL, including the leading question mark (if present). - */ -export declare function extractQuerystring(url: string): string; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/src/sha1.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/src/sha1.d.ts deleted file mode 100644 index e839144c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/src/sha1.d.ts +++ /dev/null @@ -1,84 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * @fileoverview SHA-1 cryptographic hash. - * Variable names follow the notation in FIPS PUB 180-3: - * http://csrc.nist.gov/publications/fips/fips180-3/fips180-3_final.pdf. - * - * Usage: - * var sha1 = new sha1(); - * sha1.update(bytes); - * var hash = sha1.digest(); - * - * Performance: - * Chrome 23: ~400 Mbit/s - * Firefox 16: ~250 Mbit/s - * - */ -/** - * SHA-1 cryptographic hash constructor. - * - * The properties declared here are discussed in the above algorithm document. - * @constructor - * @final - * @struct - */ -export declare class Sha1 { - /** - * Holds the previous values of accumulated variables a-e in the compress_ - * function. - * @private - */ - private chain_; - /** - * A buffer holding the partially computed hash result. - * @private - */ - private buf_; - /** - * An array of 80 bytes, each a part of the message to be hashed. Referred to - * as the message schedule in the docs. - * @private - */ - private W_; - /** - * Contains data needed to pad messages less than 64 bytes. - * @private - */ - private pad_; - /** - * @private {number} - */ - private inbuf_; - /** - * @private {number} - */ - private total_; - blockSize: number; - constructor(); - reset(): void; - /** - * Internal compress helper function. - * @param buf Block to compress. - * @param offset Offset of the block in the buffer. - * @private - */ - compress_(buf: number[] | Uint8Array | string, offset?: number): void; - update(bytes?: number[] | Uint8Array | string, length?: number): void; - /** @override */ - digest(): number[]; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/src/subscribe.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/src/subscribe.d.ts deleted file mode 100644 index 327faab6..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/src/subscribe.d.ts +++ /dev/null @@ -1,49 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export declare type NextFn = (value: T) => void; -export declare type ErrorFn = (error: Error) => void; -export declare type CompleteFn = () => void; -export interface Observer { - next: NextFn; - error: ErrorFn; - complete: CompleteFn; -} -export declare type PartialObserver = Partial>; -export declare type Unsubscribe = () => void; -/** - * The Subscribe interface has two forms - passing the inline function - * callbacks, or a object interface with callback properties. - */ -export interface Subscribe { - (next?: NextFn, error?: ErrorFn, complete?: CompleteFn): Unsubscribe; - (observer: PartialObserver): Unsubscribe; -} -export interface Observable { - subscribe: Subscribe; -} -export declare type Executor = (observer: Observer) => void; -/** - * Helper to make a Subscribe function (just like Promise helps make a - * Thenable). - * - * @param executor Function which can make calls to a single Observer - * as a proxy. - * @param onNoObservers Callback when count of Observers goes to zero. - */ -export declare function createSubscribe(executor: Executor, onNoObservers?: Executor): Subscribe; -/** Turn synchronous function into one called asynchronously. */ -export declare function async(fn: Function, onError?: ErrorFn): Function; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/src/utf8.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/src/utf8.d.ts deleted file mode 100644 index 4db9431f..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/src/utf8.d.ts +++ /dev/null @@ -1,27 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * @param {string} str - * @return {Array} - */ -export declare const stringToByteArray: (str: string) => number[]; -/** - * Calculate length without actually converting; useful for doing cheaper validation. - * @param {string} str - * @return {number} - */ -export declare const stringLength: (str: string) => number; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/src/uuid.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/src/uuid.d.ts deleted file mode 100644 index be85202a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/src/uuid.d.ts +++ /dev/null @@ -1,22 +0,0 @@ -/** - * @license - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Copied from https://stackoverflow.com/a/2117523 - * Generates a new uuid. - * @public - */ -export declare const uuidv4: () => string; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/src/validation.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/src/validation.d.ts deleted file mode 100644 index d452ce6b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/src/validation.d.ts +++ /dev/null @@ -1,43 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Check to make sure the appropriate number of arguments are provided for a public function. - * Throws an error if it fails. - * - * @param fnName The function name - * @param minCount The minimum number of arguments to allow for the function call - * @param maxCount The maximum number of argument to allow for the function call - * @param argCount The actual number of arguments provided. - */ -export declare const validateArgCount: (fnName: string, minCount: number, maxCount: number, argCount: number) => void; -/** - * Generates a string to prefix an error message about failed argument validation - * - * @param fnName The function name - * @param argName The name of the argument - * @return The prefix to add to the error thrown for validation. - */ -export declare function errorPrefix(fnName: string, argName: string): string; -/** - * @param fnName - * @param argumentNumber - * @param namespace - * @param optional - */ -export declare function validateNamespace(fnName: string, namespace: string, optional: boolean): void; -export declare function validateCallback(fnName: string, argumentName: string, callback: Function, optional: boolean): void; -export declare function validateContextObject(fnName: string, argumentName: string, context: unknown, optional: boolean): void; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/test/base64.test.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/test/base64.test.d.ts deleted file mode 100644 index 509db186..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/test/base64.test.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/test/compat.test.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/test/compat.test.d.ts deleted file mode 100644 index d92ca4eb..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/test/compat.test.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * @license - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export {}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/test/deepCopy.test.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/test/deepCopy.test.d.ts deleted file mode 100644 index 509db186..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/test/deepCopy.test.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/test/defaults.test.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/test/defaults.test.d.ts deleted file mode 100644 index 509db186..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/test/defaults.test.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/test/emulator.test.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/test/emulator.test.d.ts deleted file mode 100644 index 509db186..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/test/emulator.test.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/test/errors.test.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/test/errors.test.d.ts deleted file mode 100644 index 509db186..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/test/errors.test.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/test/exponential_backoff.test.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/test/exponential_backoff.test.d.ts deleted file mode 100644 index 05e43f18..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/test/exponential_backoff.test.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * @license - * Copyright 2019 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export {}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/test/object.test.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/test/object.test.d.ts deleted file mode 100644 index d92ca4eb..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/test/object.test.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * @license - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export {}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/test/subscribe.test.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/test/subscribe.test.d.ts deleted file mode 100644 index cd6aeb9b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/test/subscribe.test.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export {}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/tsdoc-metadata.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/tsdoc-metadata.json deleted file mode 100644 index 6af1f6a1..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/tsdoc-metadata.json +++ /dev/null @@ -1,11 +0,0 @@ -// This file is read by tools that parse documentation comments conforming to the TSDoc standard. -// It should be published with your NPM package. It should not be tracked by Git. -{ - "tsdocVersion": "0.12", - "toolPackages": [ - { - "packageName": "@microsoft/api-extractor", - "packageVersion": "0.1.2" - } - ] -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/util-public.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/util-public.d.ts deleted file mode 100644 index 099f078f..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/util-public.d.ts +++ /dev/null @@ -1,918 +0,0 @@ - -/** - * - * This method checks whether cookie is enabled within current browser - * @return true if cookie is enabled within current browser - */ -export declare function areCookiesEnabled(): boolean; - -/** - * Throws an error if the provided assertion is falsy - */ -export declare const assert: (assertion: unknown, message: string) => void; - -/** - * Returns an Error object suitable for throwing. - */ -export declare const assertionError: (message: string) => Error; - -/** Turn synchronous function into one called asynchronously. */ -export declare function async(fn: Function, onError?: ErrorFn): Function; - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -declare interface Base64 { - byteToCharMap_: { - [key: number]: string; - } | null; - charToByteMap_: { - [key: string]: number; - } | null; - byteToCharMapWebSafe_: { - [key: number]: string; - } | null; - charToByteMapWebSafe_: { - [key: string]: number; - } | null; - ENCODED_VALS_BASE: string; - readonly ENCODED_VALS: string; - readonly ENCODED_VALS_WEBSAFE: string; - HAS_NATIVE_SUPPORT: boolean; - encodeByteArray(input: number[] | Uint8Array, webSafe?: boolean): string; - encodeString(input: string, webSafe?: boolean): string; - decodeString(input: string, webSafe: boolean): string; - decodeStringToByteArray(input: string, webSafe: boolean): number[]; - init_(): void; -} - -export declare const base64: Base64; - -/** - * URL-safe base64 decoding - * - * NOTE: DO NOT use the global atob() function - it does NOT support the - * base64Url variant encoding. - * - * @param str To be decoded - * @return Decoded result, if possible - */ -export declare const base64Decode: (str: string) => string | null; - -/** - * URL-safe base64 encoding - */ -export declare const base64Encode: (str: string) => string; - -/** - * URL-safe base64 encoding (without "." padding in the end). - * e.g. Used in JSON Web Token (JWT) parts. - */ -export declare const base64urlEncodeWithoutPadding: (str: string) => string; - -/** - * Based on the backoff method from - * https://github.com/google/closure-library/blob/master/closure/goog/math/exponentialbackoff.js. - * Extracted here so we don't need to pass metadata and a stateful ExponentialBackoff object around. - */ -export declare function calculateBackoffMillis(backoffCount: number, intervalMillis?: number, backoffFactor?: number): number; - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -declare interface Claims { - [key: string]: {}; -} - -/** - * @license - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export declare interface Compat { - _delegate: T; -} - -export declare type CompleteFn = () => void; - -/** - * @fileoverview Firebase constants. Some of these (@defines) can be overridden at compile-time. - */ -export declare const CONSTANTS: { - /** - * @define {boolean} Whether this is the client Node.js SDK. - */ - NODE_CLIENT: boolean; - /** - * @define {boolean} Whether this is the Admin Node.js SDK. - */ - NODE_ADMIN: boolean; - /** - * Firebase SDK Version - */ - SDK_VERSION: string; -}; - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export declare function contains(obj: T, key: string): boolean; - -export declare function createMockUserToken(token: EmulatorMockTokenOptions, projectId?: string): string; - -/** - * Helper to make a Subscribe function (just like Promise helps make a - * Thenable). - * - * @param executor Function which can make calls to a single Observer - * as a proxy. - * @param onNoObservers Callback when count of Observers goes to zero. - */ -export declare function createSubscribe(executor: Executor, onNoObservers?: Executor): Subscribe; - -/** - * Decodes a Firebase auth. token into constituent parts. - * - * Notes: - * - May return with invalid / incomplete claims if there's no native base64 decoding support. - * - Doesn't check if the token is actually valid. - */ -export declare const decode: (token: string) => DecodedToken; - -declare interface DecodedToken { - header: object; - claims: Claims; - data: object; - signature: string; -} - -declare interface DecodedToken { - header: object; - claims: Claims; - data: object; - signature: string; -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Do a deep-copy of basic JavaScript Objects or Arrays. - */ -export declare function deepCopy(value: T): T; - -/** - * Deep equal two objects. Support Arrays and Objects. - */ -export declare function deepEqual(a: object, b: object): boolean; - -/** - * Copy properties from source to target (recursively allows extension - * of Objects and Arrays). Scalar values in the target are over-written. - * If target is undefined, an object of the appropriate type will be created - * (and returned). - * - * We recursively copy all child properties of plain Objects in the source- so - * that namespace- like dictionaries are merged. - * - * Note that the target can be a function, in which case the properties in - * the source Object are copied onto it as static properties of the Function. - * - * Note: we don't merge __proto__ to prevent prototype pollution - */ -export declare function deepExtend(target: unknown, source: unknown): unknown; - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export declare class Deferred { - promise: Promise; - reject: (value?: unknown) => void; - resolve: (value?: unknown) => void; - constructor(); - /** - * Our API internals are not promiseified and cannot because our callback APIs have subtle expectations around - * invoking promises inline, which Promises are forbidden to do. This method accepts an optional node-style callback - * and returns a node-style callback which will resolve or reject the Deferred's promise. - */ - wrapCallback(callback?: (error?: unknown, value?: unknown) => void): (error: unknown, value?: unknown) => void; -} - -export declare type EmulatorMockTokenOptions = ({ - user_id: string; -} | { - sub: string; -}) & Partial; - -export declare interface ErrorData { - [key: string]: unknown; -} - -export declare class ErrorFactory { - private readonly service; - private readonly serviceName; - private readonly errors; - constructor(service: string, serviceName: string, errors: ErrorMap); - create(code: K, ...data: K extends keyof ErrorParams ? [ErrorParams[K]] : []): FirebaseError; -} - -export declare type ErrorFn = (error: Error) => void; - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * @fileoverview Standardized Firebase Error. - * - * Usage: - * - * // Typescript string literals for type-safe codes - * type Err = - * 'unknown' | - * 'object-not-found' - * ; - * - * // Closure enum for type-safe error codes - * // at-enum {string} - * var Err = { - * UNKNOWN: 'unknown', - * OBJECT_NOT_FOUND: 'object-not-found', - * } - * - * let errors: Map = { - * 'generic-error': "Unknown error", - * 'file-not-found': "Could not find file: {$file}", - * }; - * - * // Type-safe function - must pass a valid error code as param. - * let error = new ErrorFactory('service', 'Service', errors); - * - * ... - * throw error.create(Err.GENERIC); - * ... - * throw error.create(Err.FILE_NOT_FOUND, {'file': fileName}); - * ... - * // Service: Could not file file: foo.txt (service/file-not-found). - * - * catch (e) { - * assert(e.message === "Could not find file: foo.txt."); - * if ((e as FirebaseError)?.code === 'service/file-not-found') { - * console.log("Could not read file: " + e['file']); - * } - * } - */ -export declare type ErrorMap = { - readonly [K in ErrorCode]: string; -}; - -/** - * Generates a string to prefix an error message about failed argument validation - * - * @param fnName The function name - * @param argName The name of the argument - * @return The prefix to add to the error thrown for validation. - */ -export declare function errorPrefix(fnName: string, argName: string): string; - -export declare type Executor = (observer: Observer) => void; - -/** - * @license - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Keys for experimental properties on the `FirebaseDefaults` object. - * @public - */ -export declare type ExperimentalKey = 'authTokenSyncURL' | 'authIdTokenMaxAge'; - -/** - * Extract the query string part of a URL, including the leading question mark (if present). - */ -export declare function extractQuerystring(url: string): string; - -/** - * An object that can be injected into the environment as __FIREBASE_DEFAULTS__, - * either as a property of globalThis, a shell environment variable, or a - * cookie. - * - * This object can be used to automatically configure and initialize - * a Firebase app as well as any emulators. - * - * @public - */ -export declare interface FirebaseDefaults { - config?: Record; - emulatorHosts?: Record; - _authTokenSyncURL?: string; - _authIdTokenMaxAge?: number; - [key: string]: unknown; -} - -export declare class FirebaseError extends Error { - /** The error code for this error. */ - readonly code: string; - /** Custom data for this error. */ - customData?: Record | undefined; - /** The custom name for all FirebaseErrors. */ - readonly name: string; - constructor( - /** The error code for this error. */ - code: string, message: string, - /** Custom data for this error. */ - customData?: Record | undefined); -} - -declare interface FirebaseIdToken { - iss: string; - aud: string; - sub: string; - iat: number; - exp: number; - user_id: string; - auth_time: number; - provider_id?: 'anonymous'; - email?: string; - email_verified?: boolean; - phone_number?: string; - name?: string; - picture?: string; - firebase: { - sign_in_provider: FirebaseSignInProvider; - identities?: { - [provider in FirebaseSignInProvider]?: string[]; - }; - }; - [claim: string]: unknown; - uid?: never; -} - -/** - * @license - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export declare type FirebaseSignInProvider = 'custom' | 'email' | 'password' | 'phone' | 'anonymous' | 'google.com' | 'facebook.com' | 'github.com' | 'twitter.com' | 'microsoft.com' | 'apple.com'; - -/** - * Returns Firebase app config stored in the __FIREBASE_DEFAULTS__ object. - * @public - */ -export declare const getDefaultAppConfig: () => Record | undefined; - -/** - * Returns emulator host stored in the __FIREBASE_DEFAULTS__ object - * for the given product. - * @returns a URL host formatted like `127.0.0.1:9999` or `[::1]:4000` if available - * @public - */ -export declare const getDefaultEmulatorHost: (productName: string) => string | undefined; - -/** - * Returns emulator hostname and port stored in the __FIREBASE_DEFAULTS__ object - * for the given product. - * @returns a pair of hostname and port like `["::1", 4000]` if available - * @public - */ -export declare const getDefaultEmulatorHostnameAndPort: (productName: string) => [hostname: string, port: number] | undefined; - -/** - * Returns an experimental setting on the __FIREBASE_DEFAULTS__ object (properties - * prefixed by "_") - * @public - */ -export declare const getExperimentalSetting: (name: T) => FirebaseDefaults[`_${T}`]; - -/** - * Polyfill for `globalThis` object. - * @returns the `globalThis` object for the given environment. - */ -export declare function getGlobal(): typeof globalThis; - -export declare function getModularInstance(service: Compat | ExpService): ExpService; - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Returns navigator.userAgent string or '' if it's not defined. - * @return user agent string - */ -export declare function getUA(): string; - -/** - * Attempts to peer into an auth token and determine if it's an admin auth token by looking at the claims portion. - * - * Notes: - * - May return a false negative if there's no native base64 decoding support. - * - Doesn't check if the token is actually valid. - */ -export declare const isAdmin: (token: string) => boolean; - -/** - * Detect Browser Environment - */ -export declare function isBrowser(): boolean; - -export declare function isBrowserExtension(): boolean; - -/** Detects Electron apps. */ -export declare function isElectron(): boolean; - -export declare function isEmpty(obj: object): obj is {}; - -/** Detects Internet Explorer. */ -export declare function isIE(): boolean; - -/** - * This method checks if indexedDB is supported by current browser/service worker context - * @return true if indexedDB is supported by current browser/service worker context - */ -export declare function isIndexedDBAvailable(): boolean; - -/** - * Detect Cordova / PhoneGap / Ionic frameworks on a mobile device. - * - * Deliberately does not rely on checking `file://` URLs (as this fails PhoneGap - * in the Ripple emulator) nor Cordova `onDeviceReady`, which would normally - * wait for a callback. - */ -export declare function isMobileCordova(): boolean; - -/** - * Detect Node.js. - * - * @return true if Node.js environment is detected. - */ -export declare function isNode(): boolean; - -/** - * Detect whether the current SDK build is the Node version. - * - * @return true if it's the Node SDK build. - */ -export declare function isNodeSdk(): boolean; - -/** - * Detect React Native. - * - * @return true if ReactNative environment is detected. - */ -export declare function isReactNative(): boolean; - -/** Returns true if we are running in Safari. */ -export declare function isSafari(): boolean; - -/** - * Decodes a Firebase auth. token and returns its issued at time if valid, null otherwise. - * - * Notes: - * - May return null if there's no native base64 decoding support. - * - Doesn't check if the token is actually valid. - */ -export declare const issuedAtTime: (token: string) => number | null; - -/** Detects Universal Windows Platform apps. */ -export declare function isUWP(): boolean; - -/** - * Decodes a Firebase auth. token and checks the validity of its format. Expects a valid issued-at time. - * - * Notes: - * - May return a false negative if there's no native base64 decoding support. - * - Doesn't check if the token is actually valid. - */ -export declare const isValidFormat: (token: string) => boolean; - -/** - * Decodes a Firebase auth. token and checks the validity of its time-based claims. Will return true if the - * token is within the time window authorized by the 'nbf' (not-before) and 'iat' (issued-at) claims. - * - * Notes: - * - May return a false negative if there's no native base64 decoding support. - * - Doesn't check if the token is actually valid. - */ -export declare const isValidTimestamp: (token: string) => boolean; - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Evaluates a JSON string into a javascript object. - * - * @param {string} str A string containing JSON. - * @return {*} The javascript object representing the specified JSON. - */ -export declare function jsonEval(str: string): unknown; - -export declare function map(obj: { - [key in K]: V; -}, fn: (value: V, key: K, obj: { - [key in K]: V; -}) => U, contextObj?: unknown): { - [key in K]: U; -}; - -/** - * The maximum milliseconds to increase to. - * - *

Visible for testing - */ -export declare const MAX_VALUE_MILLIS: number; - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export declare type NextFn = (value: T) => void; - -export declare interface Observable { - subscribe: Subscribe; -} - -export declare interface Observer { - next: NextFn; - error: ErrorFn; - complete: CompleteFn; -} - -/** - * @license - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Provide English ordinal letters after a number - */ -export declare function ordinal(i: number): string; - -export declare type PartialObserver = Partial>; - -/* Excluded from this release type: promiseWithTimeout */ - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Returns a querystring-formatted string (e.g. &arg=val&arg2=val2) from a - * params object (e.g. {arg: 'val', arg2: 'val2'}) - * Note: You must prepend it with ? when adding it to a URL. - */ -export declare function querystring(querystringParams: { - [key: string]: string | number; -}): string; - -/** - * Decodes a querystring (e.g. ?arg=val&arg2=val2) into a params object - * (e.g. {arg: 'val', arg2: 'val2'}) - */ -export declare function querystringDecode(querystring: string): Record; - -/** - * The percentage of backoff time to randomize by. - * See - * http://go/safe-client-behavior#step-1-determine-the-appropriate-retry-interval-to-handle-spike-traffic - * for context. - * - *

Visible for testing - */ -export declare const RANDOM_FACTOR = 0.5; - -export declare function safeGet(obj: T, key: K): T[K] | undefined; - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * @fileoverview SHA-1 cryptographic hash. - * Variable names follow the notation in FIPS PUB 180-3: - * http://csrc.nist.gov/publications/fips/fips180-3/fips180-3_final.pdf. - * - * Usage: - * var sha1 = new sha1(); - * sha1.update(bytes); - * var hash = sha1.digest(); - * - * Performance: - * Chrome 23: ~400 Mbit/s - * Firefox 16: ~250 Mbit/s - * - */ -/** - * SHA-1 cryptographic hash constructor. - * - * The properties declared here are discussed in the above algorithm document. - * @constructor - * @final - * @struct - */ -export declare class Sha1 { - /** - * Holds the previous values of accumulated variables a-e in the compress_ - * function. - * @private - */ - private chain_; - /** - * A buffer holding the partially computed hash result. - * @private - */ - private buf_; - /** - * An array of 80 bytes, each a part of the message to be hashed. Referred to - * as the message schedule in the docs. - * @private - */ - private W_; - /** - * Contains data needed to pad messages less than 64 bytes. - * @private - */ - private pad_; - /** - * @private {number} - */ - private inbuf_; - /** - * @private {number} - */ - private total_; - blockSize: number; - constructor(); - reset(): void; - /** - * Internal compress helper function. - * @param buf Block to compress. - * @param offset Offset of the block in the buffer. - * @private - */ - compress_(buf: number[] | Uint8Array | string, offset?: number): void; - update(bytes?: number[] | Uint8Array | string, length?: number): void; - /** @override */ - digest(): number[]; -} - -/** - * Returns JSON representing a javascript object. - * @param {*} data Javascript object to be stringified. - * @return {string} The JSON contents of the object. - */ -export declare function stringify(data: unknown): string; - -/** - * Calculate length without actually converting; useful for doing cheaper validation. - * @param {string} str - * @return {number} - */ -export declare const stringLength: (str: string) => number; - -export declare interface StringLike { - toString(): string; -} - -/** - * @param {string} str - * @return {Array} - */ -export declare const stringToByteArray: (str: string) => number[]; - -/** - * The Subscribe interface has two forms - passing the inline function - * callbacks, or a object interface with callback properties. - */ -export declare interface Subscribe { - (next?: NextFn, error?: ErrorFn, complete?: CompleteFn): Unsubscribe; - (observer: PartialObserver): Unsubscribe; -} - -export declare type Unsubscribe = () => void; - -/** - * Copied from https://stackoverflow.com/a/2117523 - * Generates a new uuid. - * @public - */ -export declare const uuidv4: () => string; - -/** - * Check to make sure the appropriate number of arguments are provided for a public function. - * Throws an error if it fails. - * - * @param fnName The function name - * @param minCount The minimum number of arguments to allow for the function call - * @param maxCount The maximum number of argument to allow for the function call - * @param argCount The actual number of arguments provided. - */ -export declare const validateArgCount: (fnName: string, minCount: number, maxCount: number, argCount: number) => void; - -export declare function validateCallback(fnName: string, argumentName: string, callback: Function, optional: boolean): void; - -export declare function validateContextObject(fnName: string, argumentName: string, context: unknown, optional: boolean): void; - -/** - * This method validates browser/sw context for indexedDB by opening a dummy indexedDB database and reject - * if errors occur during the database open operation. - * - * @throws exception if current browser/sw context can't run idb.open (ex: Safari iframe, Firefox - * private browsing) - */ -export declare function validateIndexedDBOpenable(): Promise; - -/** - * @param fnName - * @param argumentNumber - * @param namespace - * @param optional - */ -export declare function validateNamespace(fnName: string, namespace: string, optional: boolean): void; - -export { } diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/util.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/util.d.ts deleted file mode 100644 index cb4a7ba8..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/dist/util.d.ts +++ /dev/null @@ -1,938 +0,0 @@ - -/** - * - * This method checks whether cookie is enabled within current browser - * @return true if cookie is enabled within current browser - */ -export declare function areCookiesEnabled(): boolean; - -/** - * Throws an error if the provided assertion is falsy - */ -export declare const assert: (assertion: unknown, message: string) => void; - -/** - * Returns an Error object suitable for throwing. - */ -export declare const assertionError: (message: string) => Error; - -/** Turn synchronous function into one called asynchronously. */ -export declare function async(fn: Function, onError?: ErrorFn): Function; - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -declare interface Base64 { - byteToCharMap_: { - [key: number]: string; - } | null; - charToByteMap_: { - [key: string]: number; - } | null; - byteToCharMapWebSafe_: { - [key: number]: string; - } | null; - charToByteMapWebSafe_: { - [key: string]: number; - } | null; - ENCODED_VALS_BASE: string; - readonly ENCODED_VALS: string; - readonly ENCODED_VALS_WEBSAFE: string; - HAS_NATIVE_SUPPORT: boolean; - encodeByteArray(input: number[] | Uint8Array, webSafe?: boolean): string; - encodeString(input: string, webSafe?: boolean): string; - decodeString(input: string, webSafe: boolean): string; - decodeStringToByteArray(input: string, webSafe: boolean): number[]; - init_(): void; -} - -export declare const base64: Base64; - -/** - * URL-safe base64 decoding - * - * NOTE: DO NOT use the global atob() function - it does NOT support the - * base64Url variant encoding. - * - * @param str To be decoded - * @return Decoded result, if possible - */ -export declare const base64Decode: (str: string) => string | null; - -/** - * URL-safe base64 encoding - */ -export declare const base64Encode: (str: string) => string; - -/** - * URL-safe base64 encoding (without "." padding in the end). - * e.g. Used in JSON Web Token (JWT) parts. - */ -export declare const base64urlEncodeWithoutPadding: (str: string) => string; - -/** - * Based on the backoff method from - * https://github.com/google/closure-library/blob/master/closure/goog/math/exponentialbackoff.js. - * Extracted here so we don't need to pass metadata and a stateful ExponentialBackoff object around. - */ -export declare function calculateBackoffMillis(backoffCount: number, intervalMillis?: number, backoffFactor?: number): number; - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -declare interface Claims { - [key: string]: {}; -} - -/** - * @license - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export declare interface Compat { - _delegate: T; -} - -export declare type CompleteFn = () => void; - -/** - * @fileoverview Firebase constants. Some of these (@defines) can be overridden at compile-time. - */ -export declare const CONSTANTS: { - /** - * @define {boolean} Whether this is the client Node.js SDK. - */ - NODE_CLIENT: boolean; - /** - * @define {boolean} Whether this is the Admin Node.js SDK. - */ - NODE_ADMIN: boolean; - /** - * Firebase SDK Version - */ - SDK_VERSION: string; -}; - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export declare function contains(obj: T, key: string): boolean; - -export declare function createMockUserToken(token: EmulatorMockTokenOptions, projectId?: string): string; - -/** - * Helper to make a Subscribe function (just like Promise helps make a - * Thenable). - * - * @param executor Function which can make calls to a single Observer - * as a proxy. - * @param onNoObservers Callback when count of Observers goes to zero. - */ -export declare function createSubscribe(executor: Executor, onNoObservers?: Executor): Subscribe; - -/** - * Decodes a Firebase auth. token into constituent parts. - * - * Notes: - * - May return with invalid / incomplete claims if there's no native base64 decoding support. - * - Doesn't check if the token is actually valid. - */ -export declare const decode: (token: string) => DecodedToken; - -declare interface DecodedToken { - header: object; - claims: Claims; - data: object; - signature: string; -} - -declare interface DecodedToken { - header: object; - claims: Claims; - data: object; - signature: string; -} - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Do a deep-copy of basic JavaScript Objects or Arrays. - */ -export declare function deepCopy(value: T): T; - -/** - * Deep equal two objects. Support Arrays and Objects. - */ -export declare function deepEqual(a: object, b: object): boolean; - -/** - * Copy properties from source to target (recursively allows extension - * of Objects and Arrays). Scalar values in the target are over-written. - * If target is undefined, an object of the appropriate type will be created - * (and returned). - * - * We recursively copy all child properties of plain Objects in the source- so - * that namespace- like dictionaries are merged. - * - * Note that the target can be a function, in which case the properties in - * the source Object are copied onto it as static properties of the Function. - * - * Note: we don't merge __proto__ to prevent prototype pollution - */ -export declare function deepExtend(target: unknown, source: unknown): unknown; - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export declare class Deferred { - promise: Promise; - reject: (value?: unknown) => void; - resolve: (value?: unknown) => void; - constructor(); - /** - * Our API internals are not promiseified and cannot because our callback APIs have subtle expectations around - * invoking promises inline, which Promises are forbidden to do. This method accepts an optional node-style callback - * and returns a node-style callback which will resolve or reject the Deferred's promise. - */ - wrapCallback(callback?: (error?: unknown, value?: unknown) => void): (error: unknown, value?: unknown) => void; -} - -export declare type EmulatorMockTokenOptions = ({ - user_id: string; -} | { - sub: string; -}) & Partial; - -export declare interface ErrorData { - [key: string]: unknown; -} - -export declare class ErrorFactory { - private readonly service; - private readonly serviceName; - private readonly errors; - constructor(service: string, serviceName: string, errors: ErrorMap); - create(code: K, ...data: K extends keyof ErrorParams ? [ErrorParams[K]] : []): FirebaseError; -} - -export declare type ErrorFn = (error: Error) => void; - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * @fileoverview Standardized Firebase Error. - * - * Usage: - * - * // Typescript string literals for type-safe codes - * type Err = - * 'unknown' | - * 'object-not-found' - * ; - * - * // Closure enum for type-safe error codes - * // at-enum {string} - * var Err = { - * UNKNOWN: 'unknown', - * OBJECT_NOT_FOUND: 'object-not-found', - * } - * - * let errors: Map = { - * 'generic-error': "Unknown error", - * 'file-not-found': "Could not find file: {$file}", - * }; - * - * // Type-safe function - must pass a valid error code as param. - * let error = new ErrorFactory('service', 'Service', errors); - * - * ... - * throw error.create(Err.GENERIC); - * ... - * throw error.create(Err.FILE_NOT_FOUND, {'file': fileName}); - * ... - * // Service: Could not file file: foo.txt (service/file-not-found). - * - * catch (e) { - * assert(e.message === "Could not find file: foo.txt."); - * if ((e as FirebaseError)?.code === 'service/file-not-found') { - * console.log("Could not read file: " + e['file']); - * } - * } - */ -export declare type ErrorMap = { - readonly [K in ErrorCode]: string; -}; - -/** - * Generates a string to prefix an error message about failed argument validation - * - * @param fnName The function name - * @param argName The name of the argument - * @return The prefix to add to the error thrown for validation. - */ -export declare function errorPrefix(fnName: string, argName: string): string; - -export declare type Executor = (observer: Observer) => void; - -/** - * @license - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Keys for experimental properties on the `FirebaseDefaults` object. - * @public - */ -export declare type ExperimentalKey = 'authTokenSyncURL' | 'authIdTokenMaxAge'; - -/** - * Extract the query string part of a URL, including the leading question mark (if present). - */ -export declare function extractQuerystring(url: string): string; - -/** - * An object that can be injected into the environment as __FIREBASE_DEFAULTS__, - * either as a property of globalThis, a shell environment variable, or a - * cookie. - * - * This object can be used to automatically configure and initialize - * a Firebase app as well as any emulators. - * - * @public - */ -export declare interface FirebaseDefaults { - config?: Record; - emulatorHosts?: Record; - _authTokenSyncURL?: string; - _authIdTokenMaxAge?: number; - [key: string]: unknown; -} - -export declare class FirebaseError extends Error { - /** The error code for this error. */ - readonly code: string; - /** Custom data for this error. */ - customData?: Record | undefined; - /** The custom name for all FirebaseErrors. */ - readonly name: string; - constructor( - /** The error code for this error. */ - code: string, message: string, - /** Custom data for this error. */ - customData?: Record | undefined); -} - -declare interface FirebaseIdToken { - iss: string; - aud: string; - sub: string; - iat: number; - exp: number; - user_id: string; - auth_time: number; - provider_id?: 'anonymous'; - email?: string; - email_verified?: boolean; - phone_number?: string; - name?: string; - picture?: string; - firebase: { - sign_in_provider: FirebaseSignInProvider; - identities?: { - [provider in FirebaseSignInProvider]?: string[]; - }; - }; - [claim: string]: unknown; - uid?: never; -} - -/** - * @license - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export declare type FirebaseSignInProvider = 'custom' | 'email' | 'password' | 'phone' | 'anonymous' | 'google.com' | 'facebook.com' | 'github.com' | 'twitter.com' | 'microsoft.com' | 'apple.com'; - -/** - * Returns Firebase app config stored in the __FIREBASE_DEFAULTS__ object. - * @public - */ -export declare const getDefaultAppConfig: () => Record | undefined; - -/** - * Returns emulator host stored in the __FIREBASE_DEFAULTS__ object - * for the given product. - * @returns a URL host formatted like `127.0.0.1:9999` or `[::1]:4000` if available - * @public - */ -export declare const getDefaultEmulatorHost: (productName: string) => string | undefined; - -/** - * Returns emulator hostname and port stored in the __FIREBASE_DEFAULTS__ object - * for the given product. - * @returns a pair of hostname and port like `["::1", 4000]` if available - * @public - */ -export declare const getDefaultEmulatorHostnameAndPort: (productName: string) => [hostname: string, port: number] | undefined; - -/** - * Returns an experimental setting on the __FIREBASE_DEFAULTS__ object (properties - * prefixed by "_") - * @public - */ -export declare const getExperimentalSetting: (name: T) => FirebaseDefaults[`_${T}`]; - -/** - * Polyfill for `globalThis` object. - * @returns the `globalThis` object for the given environment. - */ -export declare function getGlobal(): typeof globalThis; - -export declare function getModularInstance(service: Compat | ExpService): ExpService; - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Returns navigator.userAgent string or '' if it's not defined. - * @return user agent string - */ -export declare function getUA(): string; - -/** - * Attempts to peer into an auth token and determine if it's an admin auth token by looking at the claims portion. - * - * Notes: - * - May return a false negative if there's no native base64 decoding support. - * - Doesn't check if the token is actually valid. - */ -export declare const isAdmin: (token: string) => boolean; - -/** - * Detect Browser Environment - */ -export declare function isBrowser(): boolean; - -export declare function isBrowserExtension(): boolean; - -/** Detects Electron apps. */ -export declare function isElectron(): boolean; - -export declare function isEmpty(obj: object): obj is {}; - -/** Detects Internet Explorer. */ -export declare function isIE(): boolean; - -/** - * This method checks if indexedDB is supported by current browser/service worker context - * @return true if indexedDB is supported by current browser/service worker context - */ -export declare function isIndexedDBAvailable(): boolean; - -/** - * Detect Cordova / PhoneGap / Ionic frameworks on a mobile device. - * - * Deliberately does not rely on checking `file://` URLs (as this fails PhoneGap - * in the Ripple emulator) nor Cordova `onDeviceReady`, which would normally - * wait for a callback. - */ -export declare function isMobileCordova(): boolean; - -/** - * Detect Node.js. - * - * @return true if Node.js environment is detected. - */ -export declare function isNode(): boolean; - -/** - * Detect whether the current SDK build is the Node version. - * - * @return true if it's the Node SDK build. - */ -export declare function isNodeSdk(): boolean; - -/** - * Detect React Native. - * - * @return true if ReactNative environment is detected. - */ -export declare function isReactNative(): boolean; - -/** Returns true if we are running in Safari. */ -export declare function isSafari(): boolean; - -/** - * Decodes a Firebase auth. token and returns its issued at time if valid, null otherwise. - * - * Notes: - * - May return null if there's no native base64 decoding support. - * - Doesn't check if the token is actually valid. - */ -export declare const issuedAtTime: (token: string) => number | null; - -/** Detects Universal Windows Platform apps. */ -export declare function isUWP(): boolean; - -/** - * Decodes a Firebase auth. token and checks the validity of its format. Expects a valid issued-at time. - * - * Notes: - * - May return a false negative if there's no native base64 decoding support. - * - Doesn't check if the token is actually valid. - */ -export declare const isValidFormat: (token: string) => boolean; - -/** - * Decodes a Firebase auth. token and checks the validity of its time-based claims. Will return true if the - * token is within the time window authorized by the 'nbf' (not-before) and 'iat' (issued-at) claims. - * - * Notes: - * - May return a false negative if there's no native base64 decoding support. - * - Doesn't check if the token is actually valid. - */ -export declare const isValidTimestamp: (token: string) => boolean; - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Evaluates a JSON string into a javascript object. - * - * @param {string} str A string containing JSON. - * @return {*} The javascript object representing the specified JSON. - */ -export declare function jsonEval(str: string): unknown; - -export declare function map(obj: { - [key in K]: V; -}, fn: (value: V, key: K, obj: { - [key in K]: V; -}) => U, contextObj?: unknown): { - [key in K]: U; -}; - -/** - * The maximum milliseconds to increase to. - * - *

Visible for testing - */ -export declare const MAX_VALUE_MILLIS: number; - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export declare type NextFn = (value: T) => void; - -export declare interface Observable { - subscribe: Subscribe; -} - -export declare interface Observer { - next: NextFn; - error: ErrorFn; - complete: CompleteFn; -} - -/** - * @license - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Provide English ordinal letters after a number - */ -export declare function ordinal(i: number): string; - -export declare type PartialObserver = Partial>; - -/** - * @license - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Rejects if the given promise doesn't resolve in timeInMS milliseconds. - * @internal - */ -export declare function promiseWithTimeout(promise: Promise, timeInMS?: number): Promise; - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Returns a querystring-formatted string (e.g. &arg=val&arg2=val2) from a - * params object (e.g. {arg: 'val', arg2: 'val2'}) - * Note: You must prepend it with ? when adding it to a URL. - */ -export declare function querystring(querystringParams: { - [key: string]: string | number; -}): string; - -/** - * Decodes a querystring (e.g. ?arg=val&arg2=val2) into a params object - * (e.g. {arg: 'val', arg2: 'val2'}) - */ -export declare function querystringDecode(querystring: string): Record; - -/** - * The percentage of backoff time to randomize by. - * See - * http://go/safe-client-behavior#step-1-determine-the-appropriate-retry-interval-to-handle-spike-traffic - * for context. - * - *

Visible for testing - */ -export declare const RANDOM_FACTOR = 0.5; - -export declare function safeGet(obj: T, key: K): T[K] | undefined; - -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * @fileoverview SHA-1 cryptographic hash. - * Variable names follow the notation in FIPS PUB 180-3: - * http://csrc.nist.gov/publications/fips/fips180-3/fips180-3_final.pdf. - * - * Usage: - * var sha1 = new sha1(); - * sha1.update(bytes); - * var hash = sha1.digest(); - * - * Performance: - * Chrome 23: ~400 Mbit/s - * Firefox 16: ~250 Mbit/s - * - */ -/** - * SHA-1 cryptographic hash constructor. - * - * The properties declared here are discussed in the above algorithm document. - * @constructor - * @final - * @struct - */ -export declare class Sha1 { - /** - * Holds the previous values of accumulated variables a-e in the compress_ - * function. - * @private - */ - private chain_; - /** - * A buffer holding the partially computed hash result. - * @private - */ - private buf_; - /** - * An array of 80 bytes, each a part of the message to be hashed. Referred to - * as the message schedule in the docs. - * @private - */ - private W_; - /** - * Contains data needed to pad messages less than 64 bytes. - * @private - */ - private pad_; - /** - * @private {number} - */ - private inbuf_; - /** - * @private {number} - */ - private total_; - blockSize: number; - constructor(); - reset(): void; - /** - * Internal compress helper function. - * @param buf Block to compress. - * @param offset Offset of the block in the buffer. - * @private - */ - compress_(buf: number[] | Uint8Array | string, offset?: number): void; - update(bytes?: number[] | Uint8Array | string, length?: number): void; - /** @override */ - digest(): number[]; -} - -/** - * Returns JSON representing a javascript object. - * @param {*} data Javascript object to be stringified. - * @return {string} The JSON contents of the object. - */ -export declare function stringify(data: unknown): string; - -/** - * Calculate length without actually converting; useful for doing cheaper validation. - * @param {string} str - * @return {number} - */ -export declare const stringLength: (str: string) => number; - -export declare interface StringLike { - toString(): string; -} - -/** - * @param {string} str - * @return {Array} - */ -export declare const stringToByteArray: (str: string) => number[]; - -/** - * The Subscribe interface has two forms - passing the inline function - * callbacks, or a object interface with callback properties. - */ -export declare interface Subscribe { - (next?: NextFn, error?: ErrorFn, complete?: CompleteFn): Unsubscribe; - (observer: PartialObserver): Unsubscribe; -} - -export declare type Unsubscribe = () => void; - -/** - * Copied from https://stackoverflow.com/a/2117523 - * Generates a new uuid. - * @public - */ -export declare const uuidv4: () => string; - -/** - * Check to make sure the appropriate number of arguments are provided for a public function. - * Throws an error if it fails. - * - * @param fnName The function name - * @param minCount The minimum number of arguments to allow for the function call - * @param maxCount The maximum number of argument to allow for the function call - * @param argCount The actual number of arguments provided. - */ -export declare const validateArgCount: (fnName: string, minCount: number, maxCount: number, argCount: number) => void; - -export declare function validateCallback(fnName: string, argumentName: string, callback: Function, optional: boolean): void; - -export declare function validateContextObject(fnName: string, argumentName: string, context: unknown, optional: boolean): void; - -/** - * This method validates browser/sw context for indexedDB by opening a dummy indexedDB database and reject - * if errors occur during the database open operation. - * - * @throws exception if current browser/sw context can't run idb.open (ex: Safari iframe, Firefox - * private browsing) - */ -export declare function validateIndexedDBOpenable(): Promise; - -/** - * @param fnName - * @param argumentNumber - * @param namespace - * @param optional - */ -export declare function validateNamespace(fnName: string, namespace: string, optional: boolean): void; - -export { } diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/package.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/package.json deleted file mode 100644 index 58b79ee2..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@firebase/util/package.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "name": "@firebase/util", - "version": "1.7.3", - "description": "", - "author": "Firebase (https://firebase.google.com/)", - "main": "dist/index.node.cjs.js", - "browser": "dist/index.esm2017.js", - "module": "dist/index.esm2017.js", - "esm5": "dist/index.esm5.js", - "exports": { - ".": { - "types": "./dist/util-public.d.ts", - "node": { - "import": "./dist/node-esm/index.node.esm.js", - "require": "./dist/index.node.cjs.js" - }, - "esm5": "./dist/index.esm5.js", - "default": "./dist/index.esm2017.js" - }, - "./package.json": "./package.json" - }, - "files": [ - "dist" - ], - "scripts": { - "lint": "eslint -c .eslintrc.js '**/*.ts' --ignore-path '../../.gitignore'", - "lint:fix": "eslint --fix -c .eslintrc.js '**/*.ts' --ignore-path '../../.gitignore'", - "build": "rollup -c && yarn api-report", - "build:deps": "lerna run --scope @firebase/util --include-dependencies build", - "dev": "rollup -c -w", - "prettier": "prettier --write 'src/**/*.ts' 'test/**/*.ts'", - "test": "run-p lint test:all", - "test:ci": "node ../../scripts/run_tests_in_ci.js -s test:all", - "test:all": "run-p test:browser test:node", - "test:browser": "karma start --single-run", - "test:node": "TS_NODE_CACHE=NO TS_NODE_COMPILER_OPTIONS='{\"module\":\"commonjs\"}' nyc --reporter lcovonly -- mocha test/**/*.test.* --config ../../config/mocharc.node.js", - "api-report": "api-extractor run --local --verbose", - "typings:public": "node ../../scripts/build/use_typings.js ./dist/util-public.d.ts" - }, - "license": "Apache-2.0", - "dependencies": { - "tslib": "^2.1.0" - }, - "devDependencies": { - "rollup": "2.79.1", - "rollup-plugin-typescript2": "0.31.2", - "typescript": "4.2.2" - }, - "repository": { - "directory": "packages/util", - "type": "git", - "url": "https://github.com/firebase/firebase-js-sdk.git" - }, - "bugs": { - "url": "https://github.com/firebase/firebase-js-sdk/issues" - }, - "typings": "./dist/util-public.d.ts", - "nyc": { - "extension": [ - ".ts" - ], - "reportDir": "./coverage/node" - } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/firestore/CHANGELOG.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/firestore/CHANGELOG.md deleted file mode 100644 index 6c028c7f..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/firestore/CHANGELOG.md +++ /dev/null @@ -1,1102 +0,0 @@ -# Changelog - -[npm history][1] - -[1]: https://www.npmjs.com/package/@google-cloud/firestore?activeTab=versions - -## [6.4.1](https://github.com/googleapis/nodejs-firestore/compare/v6.4.0...v6.4.1) (2022-10-17) - - -### Bug Fixes - -* Force use of http by the GAX module when using the GAX fallback and connecting to the emulator ([#1788](https://github.com/googleapis/nodejs-firestore/issues/1788)) ([50747ad](https://github.com/googleapis/nodejs-firestore/commit/50747ad52b19da9ed87282af98eadff660dffb75)) - -## [6.4.0](https://github.com/googleapis/nodejs-firestore/compare/v6.3.0...v6.4.0) (2022-10-07) - - -### Features - -* Add internal multi-db support ([#1761](https://github.com/googleapis/nodejs-firestore/issues/1761)) ([5ba8df0](https://github.com/googleapis/nodejs-firestore/commit/5ba8df011264b435b53499642e68afd73859f332)) -* COUNT Queries ([#1774](https://github.com/googleapis/nodejs-firestore/issues/1774)) ([bcaecb4](https://github.com/googleapis/nodejs-firestore/commit/bcaecb45b7911073bb968542df0267ba81d4462d)) - - -### Bug Fixes - -* Remove [@internal](https://github.com/internal) annotation from snapshot_ ([#1728](https://github.com/googleapis/nodejs-firestore/issues/1728)) ([983ab89](https://github.com/googleapis/nodejs-firestore/commit/983ab89387d8c5314680d1520c3bece011ee6a64)) - -## [6.3.0](https://github.com/googleapis/nodejs-firestore/compare/v6.2.0...v6.3.0) (2022-09-22) - - -### Features - -* Add aggregation query APIs ([#1765](https://github.com/googleapis/nodejs-firestore/issues/1765)) ([18be4d0](https://github.com/googleapis/nodejs-firestore/commit/18be4d0ca3a8e927a883ba6e41a43d19fb2af665)) - - -### Bug Fixes - -* Tests will now verify asynchronous termination of underlying steam, and fix related bug. ([#1772](https://github.com/googleapis/nodejs-firestore/issues/1772)) ([a1717ff](https://github.com/googleapis/nodejs-firestore/commit/a1717ff279f1ea9647e28b8e93539bcad9739af0)) - -## [6.2.0](https://github.com/googleapis/nodejs-firestore/compare/v6.1.0...v6.2.0) (2022-09-13) - - -### Features - -* Use REST ([#1698](https://github.com/googleapis/nodejs-firestore/issues/1698)) ([d85b0e9](https://github.com/googleapis/nodejs-firestore/commit/d85b0e93bcb4a5806490ee66a4443afd4a0a519a)) - - -### Bug Fixes - -* Minify proto JSON files ([#1771](https://github.com/googleapis/nodejs-firestore/issues/1771)) ([6393fe7](https://github.com/googleapis/nodejs-firestore/commit/6393fe704097a1214961fa30f01832a64dced775)) -* Remove hack in update.sh, and replace with existing pattern for protobuf dependencies. ([#1769](https://github.com/googleapis/nodejs-firestore/issues/1769)) ([6ba6751](https://github.com/googleapis/nodejs-firestore/commit/6ba67517123578a93bb3e0eeb771b610ac3ee397)) - -## [6.1.0](https://github.com/googleapis/nodejs-firestore/compare/v6.0.0...v6.1.0) (2022-09-07) - - -### Features - -* Accept google-gax instance as a parameter ([#1757](https://github.com/googleapis/nodejs-firestore/issues/1757)) ([ef59a22](https://github.com/googleapis/nodejs-firestore/commit/ef59a22a8abd894d4d3e8b05f075f510de26019f)) - - -### Bug Fixes - -* Better support for fallback mode ([#1756](https://github.com/googleapis/nodejs-firestore/issues/1756)) ([a029a6e](https://github.com/googleapis/nodejs-firestore/commit/a029a6e602ef5ed6553ecc7022623fcd81763c7e)) -* Don't allow serialization of firestore settings ([#1742](https://github.com/googleapis/nodejs-firestore/issues/1742)) ([fa0ad66](https://github.com/googleapis/nodejs-firestore/commit/fa0ad66bc7e4a0c46f1ae5ca10b2a6f3a528ab6f)) -* Pin Typescript to prevent new type checking. ([#1764](https://github.com/googleapis/nodejs-firestore/issues/1764)) ([dd01b27](https://github.com/googleapis/nodejs-firestore/commit/dd01b27022e35ddf6793d71451d0b86f549288fe)) -* Update GAX ([#1758](https://github.com/googleapis/nodejs-firestore/issues/1758)) ([1931415](https://github.com/googleapis/nodejs-firestore/commit/19314159a9907dfea8301b41d8050b0d2e783dd8)) -* Version 7 of protobufjs broke the update.sh script. Added path to built in protobuf. ([#1766](https://github.com/googleapis/nodejs-firestore/issues/1766)) ([40f1db3](https://github.com/googleapis/nodejs-firestore/commit/40f1db379ba01174471bbb91cdddc88f929c9b46)) - -## [6.0.0](https://github.com/googleapis/nodejs-firestore/compare/v5.0.2...v6.0.0) (2022-07-22) - - -### ⚠ BREAKING CHANGES - -* update library to use Node 12 (#1725) - -### Features - -* Enable RunQueryResponse.done ([#1712](https://github.com/googleapis/nodejs-firestore/issues/1712)) ([0cc549c](https://github.com/googleapis/nodejs-firestore/commit/0cc549c69ccc59e25f8347d6b236f8b9b04dc105)) -* Support Logical Termination on RunQueryResponse ([#1741](https://github.com/googleapis/nodejs-firestore/issues/1741)) ([07de28a](https://github.com/googleapis/nodejs-firestore/commit/07de28a04cdea27c5f859091aaf30d16bd8a8c3c)) -* support regapic LRO ([#1729](https://github.com/googleapis/nodejs-firestore/issues/1729)) ([b9d8fef](https://github.com/googleapis/nodejs-firestore/commit/b9d8fefc5f927d1f064a79ec0990d256803360cd)) -* update client libraries to support Database operations ([#1676](https://github.com/googleapis/nodejs-firestore/issues/1676)) ([533aade](https://github.com/googleapis/nodejs-firestore/commit/533aade3272f07b39bbad2c32a5d9669fde6de53)) - - -### Bug Fixes - -* change REST binding for ListDocuments to support root collection ([#1695](https://github.com/googleapis/nodejs-firestore/issues/1695)) ([6185f13](https://github.com/googleapis/nodejs-firestore/commit/6185f13070ff9dda91d7128e3b8a1db7f09914a8)) -* **deps:** update dependency protobufjs to v7 ([#1747](https://github.com/googleapis/nodejs-firestore/issues/1747)) ([4e8d33c](https://github.com/googleapis/nodejs-firestore/commit/4e8d33cce418dfb004725ce2271121fd1fdbd9b2)) -* split v1 and v1beta1 protos to improve startup time ([#1664](https://github.com/googleapis/nodejs-firestore/issues/1664)) ([f3729cf](https://github.com/googleapis/nodejs-firestore/commit/f3729cf49818b9b929a556e7a8e8a5588b5f2726)) - - -### Build System - -* update library to use Node 12 ([#1725](https://github.com/googleapis/nodejs-firestore/issues/1725)) ([0abbd21](https://github.com/googleapis/nodejs-firestore/commit/0abbd215d4574f238b40630361d0836432ead3af)) - -### [5.0.2](https://www.github.com/googleapis/nodejs-firestore/compare/v5.0.1...v5.0.2) (2022-01-07) - - -### Bug Fixes - -* remove serializer check from Query.isEqual() ([#1654](https://www.github.com/googleapis/nodejs-firestore/issues/1654)) ([f13da18](https://www.github.com/googleapis/nodejs-firestore/commit/f13da184bd2b4f9abfe920f6d9f7af8f2f6f37cb)) - -### [5.0.1](https://www.github.com/googleapis/nodejs-firestore/compare/v5.0.0...v5.0.1) (2021-12-02) - - -### Bug Fixes - -* save negative zero as doubleValue ([#1639](https://www.github.com/googleapis/nodejs-firestore/issues/1639)) ([a6ba5cc](https://www.github.com/googleapis/nodejs-firestore/commit/a6ba5ccf8b21dbe117e5d8ad5fc1e26d16ed0d1d)) - -## [5.0.0](https://www.github.com/googleapis/nodejs-firestore/compare/v4.15.1...v5.0.0) (2021-11-23) - - -### ⚠ BREAKING CHANGES - -* upgrade Typescript to v4.1.5 and add converter and typing upgrades (#1632) - -### Features - -* upgrade Typescript to v4.1.5 and add converter and typing upgrades ([#1632](https://www.github.com/googleapis/nodejs-firestore/issues/1632)) ([c293955](https://www.github.com/googleapis/nodejs-firestore/commit/c293955fecd19d12abcb9c441c39ef2664cb011b)) - -### [4.15.1](https://www.github.com/googleapis/nodejs-firestore/compare/v4.15.0...v4.15.1) (2021-09-03) - - -### Bug Fixes - -* **build:** migrate to main branch ([#1601](https://www.github.com/googleapis/nodejs-firestore/issues/1601)) ([6f16b9a](https://www.github.com/googleapis/nodejs-firestore/commit/6f16b9ab9e1365b99498e9df4d56a88db313f9a6)) - -## [4.15.0](https://www.github.com/googleapis/nodejs-firestore/compare/v4.14.2...v4.15.0) (2021-08-26) - - -### Features - -* turns on self-signed JWT feature flag ([#1593](https://www.github.com/googleapis/nodejs-firestore/issues/1593)) ([feee8cc](https://www.github.com/googleapis/nodejs-firestore/commit/feee8cc1b32ab04613f654806ca31477328059ff)) - - -### Bug Fixes - -* Handles identical document ids from different collections. ([#1599](https://www.github.com/googleapis/nodejs-firestore/issues/1599)) ([745b608](https://www.github.com/googleapis/nodejs-firestore/commit/745b608a7883a27ccb1c4d1f7800fdcc9a7917b1)) - -### [4.14.2](https://www.github.com/googleapis/nodejs-firestore/compare/v4.14.1...v4.14.2) (2021-08-17) - - -### Bug Fixes - -* **deps:** google-gax v2.24.1 ([#1588](https://www.github.com/googleapis/nodejs-firestore/issues/1588)) ([56150b6](https://www.github.com/googleapis/nodejs-firestore/commit/56150b62f55d765c0c221aed70b999477f867ace)) - -### [4.14.1](https://www.github.com/googleapis/nodejs-firestore/compare/v4.14.0...v4.14.1) (2021-08-02) - - -### Bug Fixes - -* avoid destructuring undefined timestamps ([#1575](https://www.github.com/googleapis/nodejs-firestore/issues/1575)) ([a61a24a](https://www.github.com/googleapis/nodejs-firestore/commit/a61a24a44e70a9693f552a3a39f4579d861fd77f)) - -## [4.14.0](https://www.github.com/googleapis/nodejs-firestore/compare/v4.13.2...v4.14.0) (2021-07-30) - - -### Features - -* add "NON_EMPTY_DEFAULT" FieldBehavior ([#1554](https://www.github.com/googleapis/nodejs-firestore/issues/1554)) ([8d9c503](https://www.github.com/googleapis/nodejs-firestore/commit/8d9c50381eedf6ee8043eed681d03b44262b9820)) -* allow UnhandledPromiseRejection errors in BulkWriter if no error handler is specified ([#1572](https://www.github.com/googleapis/nodejs-firestore/issues/1572)) ([e862ac8](https://www.github.com/googleapis/nodejs-firestore/commit/e862ac81cbb99287a226989b184fc2e683defa16)) - -### [4.13.2](https://www.github.com/googleapis/nodejs-firestore/compare/v4.13.1...v4.13.2) (2021-07-14) - - -### Bug Fixes - -* **deps:** google-gax v2.17.1 ([#1557](https://www.github.com/googleapis/nodejs-firestore/issues/1557)) ([866bd25](https://www.github.com/googleapis/nodejs-firestore/commit/866bd255d930850956609a0941d4010847c0d196)) -* lower batch size on BulkWriter retry to stay under throughput limits ([#1556](https://www.github.com/googleapis/nodejs-firestore/issues/1556)) ([f17a36e](https://www.github.com/googleapis/nodejs-firestore/commit/f17a36e3fa1ce532c1c68ed63ea1845408368469)) - -### [4.13.1](https://www.github.com/googleapis/nodejs-firestore/compare/v4.13.0...v4.13.1) (2021-07-01) - - -### Bug Fixes - -* lower batch size on BulkWriter retry ([#1549](https://www.github.com/googleapis/nodejs-firestore/issues/1549)) ([26d480b](https://www.github.com/googleapis/nodejs-firestore/commit/26d480b4a7fbeb26e99bb23d7aa1fbd4802b738a)) - -## [4.13.0](https://www.github.com/googleapis/nodejs-firestore/compare/v4.12.3...v4.13.0) (2021-06-29) - - -### Features - -* add read-only transactions ([#1541](https://www.github.com/googleapis/nodejs-firestore/issues/1541)) ([ca4241e](https://www.github.com/googleapis/nodejs-firestore/commit/ca4241eb3ee4abb8453b6da0911397187dc18dde)) -* retry BatchGetDocuments RPCs that fail with errors ([#1544](https://www.github.com/googleapis/nodejs-firestore/issues/1544)) ([b39dd3c](https://www.github.com/googleapis/nodejs-firestore/commit/b39dd3c65549fb1a651c1722d8ea2c038e152417)) - - -### Bug Fixes - -* **deps:** google-gax v2.17.0 with mTLS ([#1546](https://www.github.com/googleapis/nodejs-firestore/issues/1546)) ([a322345](https://www.github.com/googleapis/nodejs-firestore/commit/a32234510d487982b950c88575b9425c531c2d94)) -* make request optional in all cases ([#1536](https://www.github.com/googleapis/nodejs-firestore/issues/1536)) ([f6edfc1](https://www.github.com/googleapis/nodejs-firestore/commit/f6edfc181ca39cd307eab6d141db08f377d5cfdf)) - -### [4.12.3](https://www.github.com/googleapis/nodejs-firestore/compare/v4.12.2...v4.12.3) (2021-06-16) - - -### Bug Fixes - -* bulkWriter: ensure buffered batches are sent after flush ([#1535](https://www.github.com/googleapis/nodejs-firestore/issues/1535)) ([115a134](https://www.github.com/googleapis/nodejs-firestore/commit/115a13407b907887a930b4299ebed042532c3ec2)) -* GoogleAdsError missing using generator version after 1.3.0 ([#1526](https://www.github.com/googleapis/nodejs-firestore/issues/1526)) ([adfe68e](https://www.github.com/googleapis/nodejs-firestore/commit/adfe68e194d518369d5b4f89e9be89f948efbdbb)) - -### [4.12.2](https://www.github.com/googleapis/nodejs-firestore/compare/v4.12.1...v4.12.2) (2021-05-27) - - -### Bug Fixes - -* do not leak credentials in Firestore.toJSON() ([#1522](https://www.github.com/googleapis/nodejs-firestore/issues/1522)) ([791310f](https://www.github.com/googleapis/nodejs-firestore/commit/791310ff4b0a828ca6d1f5c0fa03a110972afb1f)) - -### [4.12.1](https://www.github.com/googleapis/nodejs-firestore/compare/v4.12.0...v4.12.1) (2021-05-27) - - -### Bug Fixes - -* do not load google-gax at client startup ([#1517](https://www.github.com/googleapis/nodejs-firestore/issues/1517)) ([2141b08](https://www.github.com/googleapis/nodejs-firestore/commit/2141b0879cbccb1354f9821edcc917b6aa4ff0ab)) -* recursive delete: backporting changes from Java ([#1514](https://www.github.com/googleapis/nodejs-firestore/issues/1514)) ([92ea651](https://www.github.com/googleapis/nodejs-firestore/commit/92ea651adc84ba854ae7cd203af231573f885307)) -* return results from getPartitions() in order ([#1521](https://www.github.com/googleapis/nodejs-firestore/issues/1521)) ([c8168a8](https://www.github.com/googleapis/nodejs-firestore/commit/c8168a83a864dd77f88b1743adcd3568671702fe)) - -## [4.12.0](https://www.github.com/googleapis/nodejs-firestore/compare/v4.11.1...v4.12.0) (2021-05-19) - - -### Features - -* add `gcf-owl-bot[bot]` to `ignoreAuthors` ([#1506](https://www.github.com/googleapis/nodejs-firestore/issues/1506)) ([6fa1d4d](https://www.github.com/googleapis/nodejs-firestore/commit/6fa1d4da627f17d76cf2d6109765862fd5083e03)) -* add Precondition.exists to delete() ([#1505](https://www.github.com/googleapis/nodejs-firestore/issues/1505)) ([28d645b](https://www.github.com/googleapis/nodejs-firestore/commit/28d645bd3e368abde592bfa2611de3378ca175a6)) - -### [4.11.1](https://www.github.com/googleapis/nodejs-firestore/compare/v4.11.0...v4.11.1) (2021-05-13) - - -### Bug Fixes - -* **deps:** require google-gax v2.12.0 ([#1497](https://www.github.com/googleapis/nodejs-firestore/issues/1497)) ([a8d5f0b](https://www.github.com/googleapis/nodejs-firestore/commit/a8d5f0b1e4503ef9f0d289dbf8ed67a30eb9ed4b)) - -## [4.11.0](https://www.github.com/googleapis/nodejs-firestore/compare/v4.10.1...v4.11.0) (2021-05-05) - - -### Features - -* add recursive delete to Firestore class ([#1494](https://www.github.com/googleapis/nodejs-firestore/issues/1494)) ([6f1e304](https://www.github.com/googleapis/nodejs-firestore/commit/6f1e3040800d0dcc5ed3f9f7cef16fe41804266a)) - -### [4.10.1](https://www.github.com/googleapis/nodejs-firestore/compare/v4.10.0...v4.10.1) (2021-04-28) - - -### Bug Fixes - -* type of QuerySnapshot.docChanges() should be generic ([#1484](https://www.github.com/googleapis/nodejs-firestore/issues/1484)) ([3ed1929](https://www.github.com/googleapis/nodejs-firestore/commit/3ed1929a06b4c019bbb0b1db3e1abcd62ee668d2)) - -## [4.10.0](https://www.github.com/googleapis/nodejs-firestore/compare/v4.9.9...v4.10.0) (2021-04-15) - - -### Features - -* add buffering layer to BulkWriter ([#1470](https://www.github.com/googleapis/nodejs-firestore/issues/1470)) ([9cc9548](https://www.github.com/googleapis/nodejs-firestore/commit/9cc954849c74199f01e52b24fc7ba045d5b56be4)) - - -### Bug Fixes - -* use BigInt when calculating nanos in Timestamp.fromMillis() ([#1468](https://www.github.com/googleapis/nodejs-firestore/issues/1468)) ([cf1949f](https://www.github.com/googleapis/nodejs-firestore/commit/cf1949f99f840d1e34edfa31a223418abdf48372)) - -### [4.9.9](https://www.github.com/googleapis/nodejs-firestore/compare/v4.9.8...v4.9.9) (2021-04-07) - - -### Bug Fixes - -* BulkWriter: apply rate limiter before sending batch ([#1451](https://www.github.com/googleapis/nodejs-firestore/issues/1451)) ([3a50f8b](https://www.github.com/googleapis/nodejs-firestore/commit/3a50f8b524a73d60c6034d4828682b9dc1b49d6e)) -* remove floating point rounding error in Timestamp.fromMillis() ([#1464](https://www.github.com/googleapis/nodejs-firestore/issues/1464)) ([97e7281](https://www.github.com/googleapis/nodejs-firestore/commit/97e728188a097760bd52099ec852a716a25b4745)) - -### [4.9.8](https://www.github.com/googleapis/nodejs-firestore/compare/v4.9.7...v4.9.8) (2021-03-15) - - -### Bug Fixes - -* BulkWriter: add backoff on retries ([#1447](https://www.github.com/googleapis/nodejs-firestore/issues/1447)) ([f483083](https://www.github.com/googleapis/nodejs-firestore/commit/f48308344a90d2da48af99a878f0384b7b93f704)) - -### [4.9.7](https://www.github.com/googleapis/nodejs-firestore/compare/v4.9.6...v4.9.7) (2021-03-09) - - -### Bug Fixes - -* export v1 and v1beta1 client class types correctly ([#1445](https://www.github.com/googleapis/nodejs-firestore/issues/1445)) ([6c9319e](https://www.github.com/googleapis/nodejs-firestore/commit/6c9319ed6e2ac0dfe0fcf45853f0b38dc0784686)) -* retry BulkWriter deletes that fail with RST_STREAM error ([#1442](https://www.github.com/googleapis/nodejs-firestore/issues/1442)) ([cccf48d](https://www.github.com/googleapis/nodejs-firestore/commit/cccf48de4963403a2e77ba241641a2b77fb993da)) - -### [4.9.6](https://www.github.com/googleapis/nodejs-firestore/compare/v4.9.5...v4.9.6) (2021-03-03) - - -### Bug Fixes - -* set default max ratelimiter throughput to 10k for BulkWriter ([#1439](https://www.github.com/googleapis/nodejs-firestore/issues/1439)) ([c06fb3c](https://www.github.com/googleapis/nodejs-firestore/commit/c06fb3cc32f94c9058ad8e484333e688967d5a8f)) - -### [4.9.5](https://www.github.com/googleapis/nodejs-firestore/compare/v4.9.4...v4.9.5) (2021-03-02) - - -### Bug Fixes - -* add typings to v1 and v1beta in firestore.d.ts ([#1433](https://www.github.com/googleapis/nodejs-firestore/issues/1433)) ([47238a9](https://www.github.com/googleapis/nodejs-firestore/commit/47238a926471dee8bdeaa38bcb5f772c7f20349f)) - -### [4.9.4](https://www.github.com/googleapis/nodejs-firestore/compare/v4.9.3...v4.9.4) (2021-02-15) - - -### Bug Fixes - -* update "protobufjs" to be a dependency ([#1425](https://www.github.com/googleapis/nodejs-firestore/issues/1425)) ([d960fbb](https://www.github.com/googleapis/nodejs-firestore/commit/d960fbb5ca20a7eb9594e8c0b2dfabdb0cb473e3)) - -### [4.9.3](https://www.github.com/googleapis/nodejs-firestore/compare/v4.9.2...v4.9.3) (2021-02-09) - - -### Bug Fixes - -* use `Array.isArray` instead of an `instanceof` check ([#1417](https://www.github.com/googleapis/nodejs-firestore/issues/1417)) ([4a8c3cf](https://www.github.com/googleapis/nodejs-firestore/commit/4a8c3cfcaf57ed600da094ab0275a5f32fb1ea30)) - -### [4.9.2](https://www.github.com/googleapis/nodejs-firestore/compare/v4.9.1...v4.9.2) (2021-02-05) - - -### Bug Fixes - -* support byte values in Bundles ([#1395](https://www.github.com/googleapis/nodejs-firestore/issues/1395)) ([8cf53a9](https://www.github.com/googleapis/nodejs-firestore/commit/8cf53a92dc13324562ca1a1e841312e43f5c383e)) - -### [4.9.1](https://www.github.com/googleapis/nodejs-firestore/compare/v4.9.0...v4.9.1) (2021-01-26) - - -### Bug Fixes - -* handle ignoreUndefinedProperties in set(merge: true) ([#1396](https://www.github.com/googleapis/nodejs-firestore/issues/1396)) ([d870c9d](https://www.github.com/googleapis/nodejs-firestore/commit/d870c9de75a2c67ffc48d1205a5929df4c57f3cb)) - -## [4.9.0](https://www.github.com/googleapis/nodejs-firestore/compare/v4.8.1...v4.9.0) (2021-01-25) - - -### Features - -* add support for applying default converter in withConverter() ([#1394](https://www.github.com/googleapis/nodejs-firestore/issues/1394)) ([ab057f7](https://www.github.com/googleapis/nodejs-firestore/commit/ab057f7b362a2929ebffa19e570d3e9cd23bc964)) -* adds UNORDERED_LIST type ([#1382](https://www.github.com/googleapis/nodejs-firestore/issues/1382)) ([5b43e7b](https://www.github.com/googleapis/nodejs-firestore/commit/5b43e7bcb2ea9c014587c84164f9ba8a0ed05397)) -* introduces style enumeration ([#1388](https://www.github.com/googleapis/nodejs-firestore/issues/1388)) ([eb1b4dc](https://www.github.com/googleapis/nodejs-firestore/commit/eb1b4dccf52b09ce395ba2ceabe02e84ee8e4dfd)) - -### [4.8.1](https://www.github.com/googleapis/nodejs-firestore/compare/v4.8.0...v4.8.1) (2020-12-16) - - -### Bug Fixes - -* release clients that received a RST_STREAM error ([#1380](https://www.github.com/googleapis/nodejs-firestore/issues/1380)) ([0296dd6](https://www.github.com/googleapis/nodejs-firestore/commit/0296dd65d135f5b809547c69dec03dcc8f4bd071)) - -## [4.8.0](https://www.github.com/googleapis/nodejs-firestore/compare/v4.7.2...v4.8.0) (2020-12-03) - - -### Features - -* Add support to build Firestore bundles ([#1365](https://www.github.com/googleapis/nodejs-firestore/issues/1365)) ([bae82dd](https://www.github.com/googleapis/nodejs-firestore/commit/bae82dd4438ac03107c221c62dbce8cf6d20a4b1)) - - -### Bug Fixes - -* stop using GRPC channels after RST_STREAM ([#1373](https://www.github.com/googleapis/nodejs-firestore/issues/1373)) ([504bb5f](https://www.github.com/googleapis/nodejs-firestore/commit/504bb5f34159238cd9bed3645591e6c6c810452b)) - -### [4.7.2](https://www.github.com/googleapis/nodejs-firestore/compare/v4.7.1...v4.7.2) (2020-11-25) - - -### Bug Fixes - -* **browser:** check for fetch on window ([#1368](https://www.github.com/googleapis/nodejs-firestore/issues/1368)) ([3cd29d2](https://www.github.com/googleapis/nodejs-firestore/commit/3cd29d22073cff8d0ca072057c63dfe0a2144841)) - -### [4.7.1](https://www.github.com/googleapis/nodejs-firestore/compare/v4.7.0...v4.7.1) (2020-11-10) - - -### Bug Fixes - -* do not modify options object, use defaultScopes ([#1360](https://www.github.com/googleapis/nodejs-firestore/issues/1360)) ([bd40d3a](https://www.github.com/googleapis/nodejs-firestore/commit/bd40d3ae73cfd0a8e2503fca8d0aa28cb3bbcb86)) -* ignore 'undefined' in update() with UpdateMap ([#1363](https://www.github.com/googleapis/nodejs-firestore/issues/1363)) ([9bad804](https://www.github.com/googleapis/nodejs-firestore/commit/9bad804205ab886c1a80351a8e7a7726e3d242ec)) -* remove unneeded async signature from BulkWriter.sendBatch() ([#1361](https://www.github.com/googleapis/nodejs-firestore/issues/1361)) ([b5cf449](https://www.github.com/googleapis/nodejs-firestore/commit/b5cf4499724ff41e626a69f2db66be22167a7223)) - -## [4.7.0](https://www.github.com/googleapis/nodejs-firestore/compare/v4.6.1...v4.7.0) (2020-11-05) - - -### Features - -* add ability to specify custom headers for individual RPC types ([#1355](https://www.github.com/googleapis/nodejs-firestore/issues/1355)) ([0900379](https://www.github.com/googleapis/nodejs-firestore/commit/0900379e9853a8c2c7c36418dce8beb7ce966889)) - -### [4.6.1](https://www.github.com/googleapis/nodejs-firestore/compare/v4.6.0...v4.6.1) (2020-11-03) - - -### Bug Fixes - -* create new batch for writes to the same doc ([#1352](https://www.github.com/googleapis/nodejs-firestore/issues/1352)) ([bd5adc3](https://www.github.com/googleapis/nodejs-firestore/commit/bd5adc35ea1f662ee762ac8b9048556e78a54f35)) - -## [4.6.0](https://www.github.com/googleapis/nodejs-firestore/compare/v4.5.0...v4.6.0) (2020-11-03) - - -### Features - -* add onWriteError() and onWriteResult() handlers to BulkWriter ([#1315](https://www.github.com/googleapis/nodejs-firestore/issues/1315)) ([a173f4d](https://www.github.com/googleapis/nodejs-firestore/commit/a173f4defab7a6e750907fcb86431c56fcb3d4cf)) - - -### Bug Fixes - -* retry transactions that fail with expired transaction IDs ([#1347](https://www.github.com/googleapis/nodejs-firestore/issues/1347)) ([a18ab50](https://www.github.com/googleapis/nodejs-firestore/commit/a18ab50f3304f1154caaaab9768b736bdb3d8442)) - -## [4.5.0](https://www.github.com/googleapis/nodejs-firestore/compare/v4.4.0...v4.5.0) (2020-10-26) - - -### Features - -* add implicit ordering for startAt(DocumentReference) calls ([#1328](https://www.github.com/googleapis/nodejs-firestore/issues/1328)) ([e9afa38](https://www.github.com/googleapis/nodejs-firestore/commit/e9afa38592b3cc324a8d4685244ee4b249eeedfc)) -* add support for Partition API ([#1320](https://www.github.com/googleapis/nodejs-firestore/issues/1320)) ([51961c3](https://www.github.com/googleapis/nodejs-firestore/commit/51961c3b39ff9c532214eb783458f83da98eb485)) - - -### Bug Fixes - -* retry PartitionQuery for INTERNAL and DEADLINE_EXCEEDED ([#1336](https://www.github.com/googleapis/nodejs-firestore/issues/1336)) ([fdf5462](https://www.github.com/googleapis/nodejs-firestore/commit/fdf5462917e322cc04bf47ebc337d5a76a4a8b18)) -* simplify BulkWriter logic ([#1321](https://www.github.com/googleapis/nodejs-firestore/issues/1321)) ([b493baf](https://www.github.com/googleapis/nodejs-firestore/commit/b493baf44e729fa584b29881ef83f7821967a97b)) -* speed up listDocuments pagination ([#1344](https://www.github.com/googleapis/nodejs-firestore/issues/1344)) ([498301d](https://www.github.com/googleapis/nodejs-firestore/commit/498301dc06bdd5a1eccaadd7ffb1b470749488f7)) -* Update getAll example in documentation ([#1326](https://www.github.com/googleapis/nodejs-firestore/issues/1326)) ([721fce0](https://www.github.com/googleapis/nodejs-firestore/commit/721fce02440fde39e8a5c2d379b2254079e15201)) -* update required field to implement NodeJS.Timeout ([#1338](https://www.github.com/googleapis/nodejs-firestore/issues/1338)) ([6b7371b](https://www.github.com/googleapis/nodejs-firestore/commit/6b7371b4511a7cf039f85519a9d4b8be1bff8930)) -* **firestore/v1:** give PartitionQuery retry/timeout config ([#1334](https://www.github.com/googleapis/nodejs-firestore/issues/1334)) ([39a30c2](https://www.github.com/googleapis/nodejs-firestore/commit/39a30c24a54078e53ad9c746ee8ae5a4a9471349)) - -## [4.4.0](https://www.github.com/googleapis/nodejs-firestore/compare/v4.3.0...v4.4.0) (2020-09-29) - - -### Features - -* add starting/max rates to BulkWriterOptions ([#1305](https://www.github.com/googleapis/nodejs-firestore/issues/1305)) ([57dcf1c](https://www.github.com/googleapis/nodejs-firestore/commit/57dcf1c42b406a15ecb960059d67d99a97d42547)) - - -## [4.3.0](https://www.github.com/googleapis/nodejs-firestore/compare/v4.2.0...v4.3.0) (2020-09-22) - - -### Features - -* add support for != and not-in queries ([#1292](https://www.github.com/googleapis/nodejs-firestore/issues/1292)) ([786e52f](https://www.github.com/googleapis/nodejs-firestore/commit/786e52f8c8b7b9c6b84ffc988190470a063d5855)) - - -### Bug Fixes - -* add capacity logging to RateLimiter ([#1287](https://www.github.com/googleapis/nodejs-firestore/issues/1287)) ([befe625](https://www.github.com/googleapis/nodejs-firestore/commit/befe625f35b7c96e9a90399a1ca71a8a049224ad)) -* allow `setLogFunction(null)` ([#1304](https://www.github.com/googleapis/nodejs-firestore/issues/1304)) ([20b1226](https://www.github.com/googleapis/nodejs-firestore/commit/20b122695843bffc106f73c92e112144f0b96070)) -* bulkWriter: writing to the same document does not create a new batch ([#1298](https://www.github.com/googleapis/nodejs-firestore/issues/1298)) ([6243d62](https://www.github.com/googleapis/nodejs-firestore/commit/6243d625481e8f9a852b4a3bf8d77ca9cbca4dd3)) -* change typings for select() to return `Query` ([#1303](https://www.github.com/googleapis/nodejs-firestore/issues/1303)) ([b678857](https://www.github.com/googleapis/nodejs-firestore/commit/b678857afcdf14be5d645d7552e5f4aa4183b037)) -* correct BulkWriter types in firestore.d.ts ([#1284](https://www.github.com/googleapis/nodejs-firestore/issues/1284)) ([382128b](https://www.github.com/googleapis/nodejs-firestore/commit/382128b83de01cc0f88110393a1271b8d768509e)) - -## [4.2.0](https://www.github.com/googleapis/nodejs-firestore/compare/v4.1.2...v4.2.0) (2020-07-31) - - -### Features - -* allow `Settings.host` to be used when `Settings.servicePath` is set ([#1275](https://www.github.com/googleapis/nodejs-firestore/issues/1275)) ([34d6728](https://www.github.com/googleapis/nodejs-firestore/commit/34d672870f9a4673e990176e4453c4202a1386f9)) - -### [4.1.2](https://www.github.com/googleapis/nodejs-firestore/compare/v4.1.1...v4.1.2) (2020-07-24) - - -### Bug Fixes - -* add Firestore.bulkWriter to firestore.d.ts ([#1272](https://www.github.com/googleapis/nodejs-firestore/issues/1272)) ([5e7e627](https://www.github.com/googleapis/nodejs-firestore/commit/5e7e62712ab049ce1adcb26213dd13964939bf65)) - -### [4.1.1](https://www.github.com/googleapis/nodejs-firestore/compare/v4.1.0...v4.1.1) (2020-07-09) - - -### Bug Fixes - -* typeo in nodejs .gitattribute ([#1257](https://www.github.com/googleapis/nodejs-firestore/issues/1257)) ([2664878](https://www.github.com/googleapis/nodejs-firestore/commit/2664878c0f71d83b0d9e5475d31a9daec1a34eaa)) - -## [4.1.0](https://www.github.com/googleapis/nodejs-firestore/compare/v4.0.0...v4.1.0) (2020-07-08) - - -### Features - -* Added `Firestore.bulkWriter()`, which performs large scale writes in parallel. By default, BulkWriter throttles writes according to the "500/50/5" rule and retries writes that fail due to contention. ([#1252](https://www.github.com/googleapis/nodejs-firestore/issues/1252)) ([d0c6c4b](https://www.github.com/googleapis/nodejs-firestore/commit/d0c6c4b116e096a1bb59c89de26cedb8cf5f1224)) - -## [4.0.0](https://www.github.com/googleapis/nodejs-firestore/compare/v3.8.6...v4.0.0) (2020-06-24) - - -### ⚠ BREAKING CHANGES - -* drop Node 8 support (#1006) -* `FirestoreDataConverter.fromFirestore()` is now called with a `QueryDocumentSnapshot` instead of `DocumentData` (#965) - -### Features - -* add support for serialization to BigInt `(via settings({useBigInt: true})` (#1016) -* add support for set() with SetOptions when using `FirestoreDataConverter` (#1087) -* retry CommitRequests that fail with UNAVAILABLE (#1235) - -### Bug Fix -- remove fallback code that periodically invoked CommitRequests inside Transactions on GCF (#1112) -- fixes an error that prevented Firestore from connecting to the Emulator if multiple versions of `@grpc/grpc-js` are installed (#1233) - - -### [3.8.6](https://www.github.com/googleapis/nodejs-firestore/compare/v3.8.5...v3.8.6) (2020-06-19) - - -### Bug Fixes - -* reject all promises with errors ([#1224](https://www.github.com/googleapis/nodejs-firestore/issues/1224)) ([9118521](https://www.github.com/googleapis/nodejs-firestore/commit/9118521a0382fd2d484803a89e590c1bf6d2a3c6)) -* restart onSnapshot() listeners that stop receiving updates ([#1220](https://www.github.com/googleapis/nodejs-firestore/issues/1220)) ([49ca641](https://www.github.com/googleapis/nodejs-firestore/commit/49ca641ca5d813923b3d4efd113bfc5aecd32437)) - -### [3.8.5](https://www.github.com/googleapis/nodejs-firestore/compare/v3.8.4...v3.8.5) (2020-06-10) - - -### Bug Fixes - -* fix flaky BulkWriter test ([#1115](https://www.github.com/googleapis/nodejs-firestore/issues/1115)) ([9a24cc0](https://www.github.com/googleapis/nodejs-firestore/commit/9a24cc0c6ee68c1dee7ec64d89dfa7c88375f88d)) -* retry ABORTED for non-transactional commits ([#1111](https://www.github.com/googleapis/nodejs-firestore/issues/1111)) ([f175236](https://www.github.com/googleapis/nodejs-firestore/commit/f175236bde2f64365f140b14641f848bd4eb34d9)) -* retry Query streams ([#1116](https://www.github.com/googleapis/nodejs-firestore/issues/1116)) ([d7574ea](https://www.github.com/googleapis/nodejs-firestore/commit/d7574ea4ecd807d501243f8435903cfa385bb630)) - -### [3.8.4](https://www.github.com/googleapis/nodejs-firestore/compare/v3.8.3...v3.8.4) (2020-06-01) - - -### Bug Fixes - -* send Authentication header with every emulator request ([#1105](https://www.github.com/googleapis/nodejs-firestore/issues/1105)) ([83f617c](https://www.github.com/googleapis/nodejs-firestore/commit/83f617c753dbcad58eb91be585fd9fcb10480099)) - -### [3.8.3](https://www.github.com/googleapis/nodejs-firestore/compare/v3.8.2...v3.8.3) (2020-05-31) - - -### Bug Fixes - -* return null for 'parent' call on root collection ([#1099](https://www.github.com/googleapis/nodejs-firestore/issues/1099)) ([c5c0b15](https://www.github.com/googleapis/nodejs-firestore/commit/c5c0b157bf32466875ace690216a99371d31b461)) - -### [3.8.2](https://www.github.com/googleapis/nodejs-firestore/compare/v3.8.1...v3.8.2) (2020-05-30) - - -### Bug Fixes - -* authenticate as admin user when ssl:false is set ([#1095](https://www.github.com/googleapis/nodejs-firestore/issues/1095)) ([a178556](https://www.github.com/googleapis/nodejs-firestore/commit/a17855634542bce798f1ffe50d72775647990616)), closes [/github.com/firebase/firebase-js-sdk/issues/3105#issuecomment-635541894](https://www.github.com/googleapis//github.com/firebase/firebase-js-sdk/issues/3105/issues/issuecomment-635541894) - -### [3.8.1](https://www.github.com/googleapis/nodejs-firestore/compare/v3.8.0...v3.8.1) (2020-05-27) - - -### Bug Fixes - -* Add tests to check fields used in whereIn should be equality filters ([#1081](https://www.github.com/googleapis/nodejs-firestore/issues/1081)) ([3153dd2](https://www.github.com/googleapis/nodejs-firestore/commit/3153dd296891a983b3a0e78354df3fe106ad44a2)) -* capture error stacks across async calls ([#1088](https://www.github.com/googleapis/nodejs-firestore/issues/1088)) ([7acdd7e](https://www.github.com/googleapis/nodejs-firestore/commit/7acdd7e9e0877fd6dbb50539a0a3c1537d30904a)) - -## [3.8.0](https://www.github.com/googleapis/nodejs-firestore/compare/v3.7.5...v3.8.0) (2020-05-13) - - -### Features - -* add ignoreUndefinedProperties option ([#1062](https://www.github.com/googleapis/nodejs-firestore/issues/1062)) ([de733c8](https://www.github.com/googleapis/nodejs-firestore/commit/de733c821152a32893e7fccf30cdf96a2f8050eb)) - - -### Bug Fixes - -* prepare sources for BulkWriter ([#1051](https://www.github.com/googleapis/nodejs-firestore/issues/1051)) ([8c52d47](https://www.github.com/googleapis/nodejs-firestore/commit/8c52d475ae486e2998220947a0b0441d4a95ab49)) -* allow running source with ts-node ([#1074](https://www.github.com/googleapis/nodejs-firestore/issues/1074)) ([f66a089](https://www.github.com/googleapis/nodejs-firestore/commit/f66a08978f11915d8662f964867a966ff75f6e96)) -* remove type dependency on Moment ([#1063](https://www.github.com/googleapis/nodejs-firestore/issues/1063)) ([30008b0](https://www.github.com/googleapis/nodejs-firestore/commit/30008b093a9872e34a83209e94de3dca09e89fe7)) - -### [3.7.5](https://www.github.com/googleapis/nodejs-firestore/compare/v3.7.4...v3.7.5) (2020-04-25) - - -### Bug Fixes - -* return errors from Query.stream() ([#1046](https://www.github.com/googleapis/nodejs-firestore/issues/1046)) ([4b65fca](https://www.github.com/googleapis/nodejs-firestore/commit/4b65fca3d7aa9618ff944c02f059d08f39b4cac3)) - -### [3.7.4](https://www.github.com/googleapis/nodejs-firestore/compare/v3.7.3...v3.7.4) (2020-04-09) - - -### Bug Fixes - -* validate nested arrays in FieldValue ([#1003](https://www.github.com/googleapis/nodejs-firestore/issues/1003)) ([3497691](https://www.github.com/googleapis/nodejs-firestore/commit/3497691754d8b3b0b17385c34362f74ab8a84feb)) - -### [3.7.3](https://www.github.com/googleapis/nodejs-firestore/compare/v3.7.2...v3.7.3) (2020-03-31) - - -### Bug Fixes - -* support array of references for IN queries ([#993](https://www.github.com/googleapis/nodejs-firestore/issues/993)) ([a6d8fe0](https://www.github.com/googleapis/nodejs-firestore/commit/a6d8fe061fcfe0fde7a4fa023b2ec454e2adb432)) - -### [3.7.2](https://www.github.com/googleapis/nodejs-firestore/compare/v3.7.1...v3.7.2) (2020-03-25) - - -### Bug Fixes - -* fix flaky contention test ([#979](https://www.github.com/googleapis/nodejs-firestore/issues/979)) ([f294998](https://www.github.com/googleapis/nodejs-firestore/commit/f294998daab77a0a51c81265945e28eec34db186)) -* fix: use Random Number from `crypto` to generate AutoId ([05b3363](https://www.github.com/googleapis/nodejs-firestore/commit/ce6ea390f2fffcbe796ba1c5b040ee02452e287a)) - -### [3.7.1](https://www.github.com/googleapis/nodejs-firestore/compare/v3.7.0...v3.7.1) (2020-03-16) - - -### Bug Fixes - -* support Query.stream() as first client operation ([#971](https://www.github.com/googleapis/nodejs-firestore/issues/971)) ([a48017c](https://www.github.com/googleapis/nodejs-firestore/commit/a48017c16dbf7819ea45ea2577365b52721c2475)) - -## [3.7.0](https://www.github.com/googleapis/nodejs-firestore/compare/v3.6.0...v3.7.0) (2020-03-11) - - -### Features - -* **deps:** update to TypeScript 3.8 ([#962](https://www.github.com/googleapis/nodejs-firestore/issues/962)) ([12982cd](https://www.github.com/googleapis/nodejs-firestore/commit/12982cd9ef6b418b6bc9fa303bb804255b9c906a)) -* add support for Query.limitToLast() ([#954](https://www.github.com/googleapis/nodejs-firestore/issues/954)) ([c89546f](https://www.github.com/googleapis/nodejs-firestore/commit/c89546f5ae83da3845076aeeffcda75f9b208f5c)) - -## [3.6.0](https://www.github.com/googleapis/nodejs-firestore/compare/v3.5.1...v3.6.0) (2020-03-09) - - -### Features - -* base transaction retries on error codes ([#953](https://www.github.com/googleapis/nodejs-firestore/issues/953)) ([4a30820](https://www.github.com/googleapis/nodejs-firestore/commit/4a30820876db2ec925efd0ac04482fe9c6882813)) -* deferred client initialization ([#956](https://www.github.com/googleapis/nodejs-firestore/issues/956)) ([301a7e2](https://www.github.com/googleapis/nodejs-firestore/commit/301a7e2870529fc8b14c91ac08c942dececcc3d6)) -* implement Timestamp.valueOf() ([#947](https://www.github.com/googleapis/nodejs-firestore/issues/947)) ([24a96c6](https://www.github.com/googleapis/nodejs-firestore/commit/24a96c65ecbc4df0fc69b9a7f64e9e508fea89b9)), closes [#944](https://www.github.com/googleapis/nodejs-firestore/issues/944) - -### [3.5.1](https://www.github.com/googleapis/nodejs-firestore/compare/v3.5.0...v3.5.1) (2020-02-19) - - -### Bug Fixes - -* collectionReference.add() validation ([#925](https://www.github.com/googleapis/nodejs-firestore/issues/925)) ([19c2c75](https://www.github.com/googleapis/nodejs-firestore/commit/19c2c75d86c3aab967d21da16598016185ae360b)) -* pass x-goog-request-params header for streaming calls ([#920](https://www.github.com/googleapis/nodejs-firestore/issues/920)) ([cfbe19e](https://www.github.com/googleapis/nodejs-firestore/commit/cfbe19ed4c3cc6bb9ffc7b352de901150b8b9dea)) -* propagate converter in QueryOptions.with() ([#931](https://www.github.com/googleapis/nodejs-firestore/issues/931)) ([e35a098](https://www.github.com/googleapis/nodejs-firestore/commit/e35a098621b872b85a3ab70c6592eba75a929de8)) -* wait for operations to complete before deleting clients ([#915](https://www.github.com/googleapis/nodejs-firestore/issues/915)) ([1e5d63f](https://www.github.com/googleapis/nodejs-firestore/commit/1e5d63fbc39d9c3e6883e79a55e8a26634cd30c5)) - -## [3.5.0](https://www.github.com/googleapis/nodejs-firestore/compare/v3.4.1...v3.5.0) (2020-02-07) - - -### Features - -* add google-gax status to exports ([#912](https://www.github.com/googleapis/nodejs-firestore/issues/912)) ([7d97384](https://www.github.com/googleapis/nodejs-firestore/commit/7d9738456525b99507b8819d86a8634b0a1d04c3)) - - -### Bug Fixes - -* add missing generics on query ([#917](https://www.github.com/googleapis/nodejs-firestore/issues/917)) ([c5b9442](https://www.github.com/googleapis/nodejs-firestore/commit/c5b9442e6620e59e5563ffaf210ad493ec5ed9b2)) -* better parameter naming in path template helpers ([aac02f4](https://www.github.com/googleapis/nodejs-firestore/commit/aac02f463ba13c385a6dc5a4d96e281e0801cc93)) -* retry streaming methods if initial write errored ([#897](https://www.github.com/googleapis/nodejs-firestore/issues/897)) ([2ec0489](https://www.github.com/googleapis/nodejs-firestore/commit/2ec0489127faea88dca95e6dc169efe6e55d330d)) - -### [3.4.1](https://www.github.com/googleapis/nodejs-firestore/compare/v3.4.0...v3.4.1) (2020-01-22) - - -### Bug Fixes - -* do not assume all custom objects have constructors ([#893](https://www.github.com/googleapis/nodejs-firestore/issues/893)) ([f668e8e](https://www.github.com/googleapis/nodejs-firestore/commit/f668e8e4880256223c41c2c3183434e81c7f7945)) - -## [3.4.0](https://www.github.com/googleapis/nodejs-firestore/compare/v3.3.4...v3.4.0) (2020-01-15) - - -### Features - -* support serialization of custom objects ([#828](https://www.github.com/googleapis/nodejs-firestore/issues/828)) ([94ddc89](https://www.github.com/googleapis/nodejs-firestore/commit/94ddc897400cafe5a1ee16f3ad0d285411bdd0b2)) -* support serialization of Moment.js types ([#879](https://www.github.com/googleapis/nodejs-firestore/issues/879)) ([9169fae](https://www.github.com/googleapis/nodejs-firestore/commit/9169fae692d219b5fb42004a4eb82e5a5919f087)) -* allow logging to be disabled ([#880](https://www.github.com/googleapis/nodejs-firestore/issues/880)) ([36d75f6](https://www.github.com/googleapis/nodejs-firestore/commit/36d75f6b75d7ede4656636f1d8bf770eb1cb3a80)) - - -### Bug Fixes - -* don't format log message if logging is disabled ([#874](https://www.github.com/googleapis/nodejs-firestore/issues/874)) ([b7b5fc9](https://www.github.com/googleapis/nodejs-firestore/commit/b7b5fc993d4cece92833c95487efe63320537058)) -* disable non-transactional retries for Code ABORTED ([#881](https://www.github.com/googleapis/nodejs-firestore/issues/881)) ([82273ec](https://www.github.com/googleapis/nodejs-firestore/commit/82273ec0035b2ddae94d8f12791f8a5c55b6560d)) -* manually retry ABORTED reads in transactions ([#883](https://www.github.com/googleapis/nodejs-firestore/issues/883)) ([7562033](https://www.github.com/googleapis/nodejs-firestore/commit/7562033876dc006e77d00b576b2541a7dfd30c66)) -* remove ticks from code comments ([#885](https://www.github.com/googleapis/nodejs-firestore/issues/885)) ([b2740ed](https://www.github.com/googleapis/nodejs-firestore/commit/b2740ed4fb0e7c34fd407e3de4f47f03067171cb)) - -### [3.3.4](https://www.github.com/googleapis/nodejs-firestore/compare/v3.3.3...v3.3.4) (2020-01-12) - - -### Bug Fixes - -* do not release client before retry ([#870](https://www.github.com/googleapis/nodejs-firestore/issues/870)) ([47f7ab5](https://www.github.com/googleapis/nodejs-firestore/commit/47f7ab52f9133064785754ee924d9f8736853eba)) -* proper routing headers ([43472f6](https://www.github.com/googleapis/nodejs-firestore/commit/43472f6bd51a22a5ee27d7fc0f88a9dd97c22336)) -* remove redundant log line ([#868](https://www.github.com/googleapis/nodejs-firestore/issues/868)) ([af3196f](https://www.github.com/googleapis/nodejs-firestore/commit/af3196fe8da2018e0a9842f4f62588ce2c740597)) - -### [3.3.3](https://www.github.com/googleapis/nodejs-firestore/compare/v3.3.2...v3.3.3) (2020-01-08) - - -### Bug Fixes - -* support Objects created with Object.create({}) ([#842](https://www.github.com/googleapis/nodejs-firestore/issues/842)) ([a85f0c3](https://www.github.com/googleapis/nodejs-firestore/commit/a85f0c32eca5d8cf677d621a8ff326623ad5266e)) -* use rejected Promise for terminate() ([#845](https://www.github.com/googleapis/nodejs-firestore/issues/845)) ([f2c4d91](https://www.github.com/googleapis/nodejs-firestore/commit/f2c4d911077c8e5b7713263fc8b2c21bbd50ca11)) - -### [3.3.2](https://www.github.com/googleapis/nodejs-firestore/compare/v3.3.1...v3.3.2) (2020-01-06) - - -### Bug Fixes - -* add quotes to field name to avoid ambiguity ([#860](https://www.github.com/googleapis/nodejs-firestore/issues/860)) ([8caee71](https://www.github.com/googleapis/nodejs-firestore/commit/8caee71f6105e82faf3f6334e69ed5890f977a3a)) - -### [3.3.1](https://www.github.com/googleapis/nodejs-firestore/compare/v3.3.0...v3.3.1) (2020-01-06) - - -### Bug Fixes - -* don't recreate instances when client is idle ([0aa2a8b](https://www.github.com/googleapis/nodejs-firestore/commit/0aa2a8b8d0c76e0cfc6d29c37d143cc9c0b45fec)) - -## [3.3.0](https://www.github.com/googleapis/nodejs-firestore/compare/v3.2.0...v3.3.0) (2020-01-03) - - -### Features - -* add Symbol.asyncInterator to Query.stream() ([#843](https://www.github.com/googleapis/nodejs-firestore/issues/843)) ([68795c4](https://www.github.com/googleapis/nodejs-firestore/commit/68795c43ae9ef6b286650228746c7c16f59347f7)) -* use GAX retry config for streams ([#847](https://www.github.com/googleapis/nodejs-firestore/issues/847)) ([218a4c6](https://www.github.com/googleapis/nodejs-firestore/commit/218a4c65afcc55158aac45b98a4ccb28b88c00a1)) - - -### Bug Fixes - -* increase test timeout ([#846](https://www.github.com/googleapis/nodejs-firestore/issues/846)) ([b94c367](https://www.github.com/googleapis/nodejs-firestore/commit/b94c367e9655f8a6a3553610ebc655877be502ec)) -* retry writes that fail with status code ABORTED ([#854](https://www.github.com/googleapis/nodejs-firestore/issues/854)) ([96f085f](https://www.github.com/googleapis/nodejs-firestore/commit/96f085f3df7c8e6e20dbffb14ebf6ebb533fc036)) - -## [3.2.0](https://www.github.com/googleapis/nodejs-firestore/compare/v3.1.0...v3.2.0) (2019-12-30) - - -### Features - -* allow specifying how many idle GRPC channels to keep ([#837](https://www.github.com/googleapis/nodejs-firestore/issues/837)) ([37e93da](https://www.github.com/googleapis/nodejs-firestore/commit/37e93da689f985b6b0f30645435b12179513eb64)) - - -### Bug Fixes - -* reduce overhead for listDocuments()/listCollections() ([#838](https://www.github.com/googleapis/nodejs-firestore/issues/838)) ([5c870e6](https://www.github.com/googleapis/nodejs-firestore/commit/5c870e615e4774d3d50fc33c17b5da45dcacea4f)) - -## [3.1.0](https://www.github.com/googleapis/nodejs-firestore/compare/v3.0.0...v3.1.0) (2019-12-19) - - -### Features - -* add ability to close channels ([#824](https://www.github.com/googleapis/nodejs-firestore/issues/824)) ([9ef582a](https://www.github.com/googleapis/nodejs-firestore/commit/9ef582aa0508a3d02fb036f741c8c51e5ff4307c)) - - -### Bug Fixes - -* **deps:** update dependency deep-equal to v2 ([#821](https://www.github.com/googleapis/nodejs-firestore/issues/821)) ([25472e1](https://www.github.com/googleapis/nodejs-firestore/commit/25472e11a0e1a4a5e1931b1652d125f9c8cabf11)) - -## [3.0.0](https://www.github.com/googleapis/nodejs-firestore/compare/v2.6.1...v3.0.0) (2019-12-15) - - -### ⚠ BREAKING CHANGES - -* convert Gapic client to TypeScript (#805) -* remove deprecated timestampInSnapshots setting (#808) - -### Features - -* convert Gapic client to TypeScript ([#805](https://www.github.com/googleapis/nodejs-firestore/issues/805)) ([5000b2d](https://www.github.com/googleapis/nodejs-firestore/commit/5000b2d4b5c528b66c5a71db343c0e4163d5d8f7)) -* remove deprecated timestampInSnapshots setting ([#808](https://www.github.com/googleapis/nodejs-firestore/issues/808)) ([f37fffc](https://www.github.com/googleapis/nodejs-firestore/commit/f37fffc44fb1ddc8177bd24dfb44d830221e2479)) - - -### Bug Fixes - -* close GRPC channel when we dispose of clients ([#779](https://www.github.com/googleapis/nodejs-firestore/issues/779)) ([22ef0d0](https://www.github.com/googleapis/nodejs-firestore/commit/22ef0d0229569f0d97ff908b5866264a8de2ca78)) - -### [2.6.1](https://www.github.com/googleapis/nodejs-firestore/compare/v2.6.0...v2.6.1) (2019-12-05) - - -### Bug Fixes - -* **deps:** pin TypeScript below 3.7.0 ([0d4e558](https://www.github.com/googleapis/nodejs-firestore/commit/0d4e558be4111b3524aa3b855b14e63cb486d2c8)) -* **docs:** snippets are now replaced in jsdoc comments ([#795](https://www.github.com/googleapis/nodejs-firestore/issues/795)) ([396bebb](https://www.github.com/googleapis/nodejs-firestore/commit/396bebbe21b4df16b3017d144fd9e505eb99feda)) - -## [2.6.0](https://www.github.com/googleapis/nodejs-firestore/compare/v2.5.0...v2.6.0) (2019-11-01) - - -### Features - -* add IN queries support ([#715](https://www.github.com/googleapis/nodejs-firestore/issues/715)) ([00bdf8f](https://www.github.com/googleapis/nodejs-firestore/commit/00bdf8ff81f658c4534adea8d2010a1f68195f45)) - -## [2.5.0](https://www.github.com/googleapis/nodejs-firestore/compare/v2.4.0...v2.5.0) (2019-10-22) - - -### Features - -* introduces ARRAY_CONTAINS_ANY and IN to operator enum ([2c8869d](https://www.github.com/googleapis/nodejs-firestore/commit/2c8869d23ad1aef024273b640579624cde97849f)) - - -### Bug Fixes - -* **deps:** bump google-gax to 1.7.5 ([#786](https://www.github.com/googleapis/nodejs-firestore/issues/786)) ([e5763ba](https://www.github.com/googleapis/nodejs-firestore/commit/e5763baadf7cc424620913a09ca0ed6af4a0971a)) - -## [2.4.0](https://www.github.com/googleapis/nodejs-firestore/compare/v2.3.0...v2.4.0) (2019-10-03) - - -### Bug Fixes - -* provide custom error for FieldValue subclasses ([#771](https://www.github.com/googleapis/nodejs-firestore/issues/771)) ([29c3e9b](https://www.github.com/googleapis/nodejs-firestore/commit/29c3e9b)) -* use compatible version of google-gax ([b0c89c5](https://www.github.com/googleapis/nodejs-firestore/commit/b0c89c5)) - - -### Features - -* ability to specify the Collection Group query scope in the V1 Admin API ([#762](https://www.github.com/googleapis/nodejs-firestore/issues/762)) ([b16cd40](https://www.github.com/googleapis/nodejs-firestore/commit/b16cd40)) - -## [2.3.0](https://www.github.com/googleapis/nodejs-firestore/compare/v2.2.9...v2.3.0) (2019-09-09) - - -### Features - -* load protos from JSON, grpc-fallback support ([#749](https://www.github.com/googleapis/nodejs-firestore/issues/749)) ([6cb9d68](https://www.github.com/googleapis/nodejs-firestore/commit/6cb9d68)) - -### [2.2.9](https://www.github.com/googleapis/nodejs-firestore/compare/v2.2.8...v2.2.9) (2019-08-30) - - -### Bug Fixes - -* retrying 13 INTERNAL RPC errors ([#742](https://www.github.com/googleapis/nodejs-firestore/issues/742)) ([431edcb](https://www.github.com/googleapis/nodejs-firestore/commit/431edcb)) - -### [2.2.8](https://www.github.com/googleapis/nodejs-firestore/compare/v2.2.7...v2.2.8) (2019-08-22) - - -### Bug Fixes - -* serialization does not work with null objects ([#736](https://www.github.com/googleapis/nodejs-firestore/issues/736)) ([870d6a7](https://www.github.com/googleapis/nodejs-firestore/commit/870d6a7)) - -### [2.2.7](https://www.github.com/googleapis/nodejs-firestore/compare/v2.2.6...v2.2.7) (2019-08-16) - - -### Bug Fixes - -* **deps:** use the latest extend ([#728](https://www.github.com/googleapis/nodejs-firestore/issues/728)) ([425bf3d](https://www.github.com/googleapis/nodejs-firestore/commit/425bf3d)) -* add logging to client pool ([#733](https://www.github.com/googleapis/nodejs-firestore/issues/733)) ([a4efa09](https://www.github.com/googleapis/nodejs-firestore/commit/a4efa09)) - -### [2.2.6](https://www.github.com/googleapis/nodejs-firestore/compare/v2.2.5...v2.2.6) (2019-08-02) - - -### Bug Fixes - -* allow calls with no request, add JSON proto ([#725](https://www.github.com/googleapis/nodejs-firestore/issues/725)) ([8b0624b](https://www.github.com/googleapis/nodejs-firestore/commit/8b0624b)) - -### [2.2.5](https://www.github.com/googleapis/nodejs-firestore/compare/v2.2.4...v2.2.5) (2019-08-02) - - -### Bug Fixes - -* Better error for Collection Group Queries with documentId() cursors ([#720](https://www.github.com/googleapis/nodejs-firestore/issues/720)) ([169286d](https://www.github.com/googleapis/nodejs-firestore/commit/169286d)) - -### [2.2.4](https://www.github.com/googleapis/nodejs-firestore/compare/v2.2.3...v2.2.4) (2019-07-08) - - -### Bug Fixes - -* Don't re-open streams on 'error' and 'end' ([#713](https://www.github.com/googleapis/nodejs-firestore/issues/713)) ([104a965](https://www.github.com/googleapis/nodejs-firestore/commit/104a965)) - -### [2.2.3](https://www.github.com/googleapis/nodejs-firestore/compare/v2.2.2...v2.2.3) (2019-06-26) - - -### Bug Fixes - -* **docs:** link to reference docs section on googleapis.dev ([#701](https://www.github.com/googleapis/nodejs-firestore/issues/701)) ([d7c89a8](https://www.github.com/googleapis/nodejs-firestore/commit/d7c89a8)) -* Relax validation of FIRESTORE_EMULATOR_HOST in settings() ([#703](https://www.github.com/googleapis/nodejs-firestore/issues/703)) ([daff9de](https://www.github.com/googleapis/nodejs-firestore/commit/daff9de)) - -### [2.2.2](https://www.github.com/googleapis/nodejs-firestore/compare/v2.2.1...v2.2.2) (2019-06-25) - - -### Bug Fixes - -* Support non-ISO-8859-1 Collection Names in Queries ([fc6f839](https://www.github.com/googleapis/nodejs-firestore/commit/fc6f839)) -* Unset servicePath when FIRESTORE_EMULATOR_HOST is set ([#696](https://www.github.com/googleapis/nodejs-firestore/issues/696)) ([5a19931](https://www.github.com/googleapis/nodejs-firestore/commit/5a19931)) -* Use new stream rather than pipe ([#700](https://www.github.com/googleapis/nodejs-firestore/issues/700)) ([0370e03](https://www.github.com/googleapis/nodejs-firestore/commit/0370e03)) - -### [2.2.1](https://www.github.com/googleapis/nodejs-firestore/compare/v2.2.0...v2.2.1) (2019-06-14) - - -### Bug Fixes - -* **docs:** move to new client docs URL ([#689](https://www.github.com/googleapis/nodejs-firestore/issues/689)) ([58acc46](https://www.github.com/googleapis/nodejs-firestore/commit/58acc46)) - -## [2.2.0](https://www.github.com/googleapis/nodejs-firestore/compare/v2.1.1...v2.2.0) (2019-06-06) - - -### Bug Fixes - -* Split settings.host into servicePath and port ([#684](https://www.github.com/googleapis/nodejs-firestore/issues/684)) ([b2cbca5](https://www.github.com/googleapis/nodejs-firestore/commit/b2cbca5)) -* Store large numbers as doubles ([#683](https://www.github.com/googleapis/nodejs-firestore/issues/683)) ([607b3c0](https://www.github.com/googleapis/nodejs-firestore/commit/607b3c0)) - - -### Features - -* support apiEndpoint override in client constructor ([368bc5c](https://www.github.com/googleapis/nodejs-firestore/commit/368bc5c)) -* Support host, ssl and FIRESTORE_EMULATOR_HOST for endpoint configuration ([#680](https://www.github.com/googleapis/nodejs-firestore/issues/680)) ([d15f29d](https://www.github.com/googleapis/nodejs-firestore/commit/d15f29d)) - -## [2.1.1](https://www.github.com/googleapis/nodejs-firestore/compare/v2.1.0...v2.1.1) (2019-05-30) - - -### Dependencies -- deps: Pin @gprc/grpc-js to 0.4.0 ([#668](https://github.com/googleapis/nodejs-firestore/pull/668)) - - - ### Internal / Testing Changes -- build: remove verbose logging from test scripts ([#665](https://github.com/googleapis/nodejs-firestore/pull/665)) -- build: ignore proto files in test coverage ([#664](https://github.com/googleapis/nodejs-firestore/pull/664)) - -## [2.1.0](https://www.github.com/googleapis/nodejs-firestore/compare/v2.0.0...v2.1.0) (2019-05-28) - - -### Bug Fixes - -* Add overloads for doc() and doc(id:string) ([#662](https://www.github.com/googleapis/nodejs-firestore/issues/662)) ([cb189e9](https://www.github.com/googleapis/nodejs-firestore/commit/cb189e9)) -* retry on abort and limit retry count to 10 ([#655](https://www.github.com/googleapis/nodejs-firestore/issues/655)) ([9e97656](https://www.github.com/googleapis/nodejs-firestore/commit/9e97656)) - - -### Features - -* Support listDocuments()/listCollections() via the Firestore Emulator ([#654](https://www.github.com/googleapis/nodejs-firestore/issues/654)) ([eaf5a4e](https://www.github.com/googleapis/nodejs-firestore/commit/eaf5a4e)) - -## [2.0.0](https://www.github.com/googleapis/nodejs-firestore/compare/v1.3.0...v2.0.0) (2019-05-20) - - -### ⚠ BREAKING CHANGES - -* library now requires Node >= 8.13.0 -* **deprecation:** remove legacy support for array arguments (#625) -* **deprecation:** remove deprecated getCollections() (#624) -* upgrade engines field to >=8.10.0 (#608) - -### Bug Fixes - -* **deps:** update dependency google-gax to ^0.26.0 ([#606](https://www.github.com/googleapis/nodejs-firestore/issues/606)) ([a637a68](https://www.github.com/googleapis/nodejs-firestore/commit/a637a68)) -* Fix client pooling for long-lived listens ([#614](https://www.github.com/googleapis/nodejs-firestore/issues/614)) ([479bc9c](https://www.github.com/googleapis/nodejs-firestore/commit/479bc9c)), closes [firebase/firebase-admin-node#499](https://www.github.com/googleapis/nodejs-firestore/issues/499) [#256](https://www.github.com/googleapis/nodejs-firestore/issues/256) -* **deps:** update dependency google-gax to v1 ([#615](https://www.github.com/googleapis/nodejs-firestore/issues/615)) ([687a353](https://www.github.com/googleapis/nodejs-firestore/commit/687a353)) -* run the generator ([#616](https://www.github.com/googleapis/nodejs-firestore/issues/616)) ([92b0add](https://www.github.com/googleapis/nodejs-firestore/commit/92b0add)) -* **docs:** revert jsdoc and pin to 3.5.5 ([#627](https://www.github.com/googleapis/nodejs-firestore/issues/627)) ([e22f9c6](https://www.github.com/googleapis/nodejs-firestore/commit/e22f9c6)) -* Support more than 100 long-lived streams ([#623](https://www.github.com/googleapis/nodejs-firestore/issues/623)) ([9474e3f](https://www.github.com/googleapis/nodejs-firestore/commit/9474e3f)) - - -### Build System - -* upgrade engines field to >=8.10.0 ([#608](https://www.github.com/googleapis/nodejs-firestore/issues/608)) ([32485f4](https://www.github.com/googleapis/nodejs-firestore/commit/32485f4)) -* upgrade engines field to >=8.13.0 ([#636](https://www.github.com/googleapis/nodejs-firestore/issues/636)) ([a5db7d8](https://www.github.com/googleapis/nodejs-firestore/commit/a5db7d8)) - - -### Code Refactoring - -* **deprecation:** remove deprecated getCollections() ([#624](https://www.github.com/googleapis/nodejs-firestore/issues/624)) ([43ac9c6](https://www.github.com/googleapis/nodejs-firestore/commit/43ac9c6)) -* **deprecation:** remove legacy support for array arguments ([#625](https://www.github.com/googleapis/nodejs-firestore/issues/625)) ([54dd405](https://www.github.com/googleapis/nodejs-firestore/commit/54dd405)) - -## v1.3.0 - -04-26-2019 16:54 PDT - -### New Features -- feature: Adding CollectionGroup queries ([#578](https://github.com/googleapis/nodejs-firestore/pull/578))([#595](https://github.com/googleapis/nodejs-firestore/pull/595)) - -### Dependencies -- chore(deps): update dependency nyc to v14 ([#600](https://github.com/googleapis/nodejs-firestore/pull/600)) -- chore(deps): update dependency typescript to ~3.4.0 -- docs: add .readme-metadata.json and generate new README.md - -### Documentation -- docs: Add example for Precondition ([#601](https://github.com/googleapis/nodejs-firestore/pull/601)) - -## v1.2.0 - -03-21-2019 14:17 PDT - -### New Features -- feature: Release the V1 Admin API ([#590](https://github.com/googleapis/nodejs-firestore/pull/590)) - The Firestore Node SDK now exposes the Firestore Admin API (via `v1.FirebaseAdminClient()`). - -### Implementation Changes -- deps/refactor: Removing @google-cloud/projectify ([#564](https://github.com/googleapis/nodejs-firestore/pull/564)) - -### Dependencies -- chore(deps): update dependency hard-rejection to v2 - -### Documentation -- fix(docs): add namespaces so docs are generated ([#591](https://github.com/googleapis/nodejs-firestore/pull/591)) -- docs: fix typo in doc strings ([#585](https://github.com/googleapis/nodejs-firestore/pull/585)) - -### Internal / Testing Changes -- chore: publish to npm using wombat ([#586](https://github.com/googleapis/nodejs-firestore/pull/586)) -- build: use per-repo publish token ([#582](https://github.com/googleapis/nodejs-firestore/pull/582)) -- refactor: update json import paths ([#580](https://github.com/googleapis/nodejs-firestore/pull/580)) - -## v1.1.0 - -03-10-2019 20:09 PDT - -### New Features -- feature: Added `FieldValue.increment()`, which can be used in `create()`, `update()` and `set(..., {merge:true})` to - increment or decrement numeric field values safely without transactions ([#444](https://github.com/googleapis/nodejs-firestore/pull/444)) - -### Implementation Changes -- fix: Allow async functions ([#576](https://github.com/googleapis/nodejs-firestore/pull/576)) -- fix: Don't call stream.end() on Watch ended by server ([#565](https://github.com/googleapis/nodejs-firestore/pull/565)) - -### Internal / Testing Changes -- refactor: async/await to test/order.ts ([#566](https://github.com/googleapis/nodejs-firestore/pull/566)) -- build: Add docuploader credentials to node publish jobs ([#572](https://github.com/googleapis/nodejs-firestore/pull/572)) -- build: update release config ([#570](https://github.com/googleapis/nodejs-firestore/pull/570)) -- build: use node10 to run samples-test, system-test etc ([#571](https://github.com/googleapis/nodejs-firestore/pull/571)) - -## v1.0.2 - -03-04-2019 13:32 PST - -### Implementation Changes - -- fix: throw on invalid credentials ([#548](https://github.com/googleapis/nodejs-firestore/pull/548)) - -### Dependencies - -- fix(deps): update dependency google-gax to ^0.25.0 ([#535](https://github.com/googleapis/nodejs-firestore/pull/535)) -- chore(deps): update dependency mocha to v6 -- chore(deps): update dependency duplexify to v4 ([#539](https://github.com/googleapis/nodejs-firestore/pull/539)) - -### Documentation - -- docs: update comments on protos ([#559](https://github.com/googleapis/nodejs-firestore/pull/559)) -- docs: update API doc comments ([#557](https://github.com/googleapis/nodejs-firestore/pull/557)) -- docs: update links in contrib guide ([#550](https://github.com/googleapis/nodejs-firestore/pull/550)) -- docs: add lint/fix example to contributing guide ([#541](https://github.com/googleapis/nodejs-firestore/pull/541)) -- docs: fix example comments ([#540](https://github.com/googleapis/nodejs-firestore/pull/540)) -- doc: show GA message in README.md ([#536](https://github.com/googleapis/nodejs-firestore/pull/536)) -- Add note about Datastore mode ([#552](https://github.com/googleapis/nodejs-firestore/pull/552)) -- chore: move CONTRIBUTING.md to root ([#543](https://github.com/googleapis/nodejs-firestore/pull/543)) -- docs: update contributing path in README ([#544](https://github.com/googleapis/nodejs-firestore/pull/544)) - -### Internal / Testing Changes - -- refactor(typescript): enable noImplicitAny ([#553](https://github.com/googleapis/nodejs-firestore/pull/553)) -- chore: update array types ([#555](https://github.com/googleapis/nodejs-firestore/pull/555)) -- Finish TypeScript Migration ([#512](https://github.com/googleapis/nodejs-firestore/pull/512)) -- refactor: improve generated code style. ([#538](https://github.com/googleapis/nodejs-firestore/pull/538)) -- Remove unhandled Promise rejection warning ([#556](https://github.com/googleapis/nodejs-firestore/pull/556)) -- build: use linkinator for docs test ([#549](https://github.com/googleapis/nodejs-firestore/pull/549)) -- build: create docs test npm scripts ([#547](https://github.com/googleapis/nodejs-firestore/pull/547)) -- build: test using @grpc/grpc-js in CI ([#546](https://github.com/googleapis/nodejs-firestore/pull/546)) - -## v1.0.1 - -01-29-2019 14:02 PST - -# Documentation - -- doc: update README.md to show this library as GA ([#532](https://github.com/googleapis/nodejs-firestore/pull/532)) -- fix(samples): constructor doesn't need project or cred options ([#533](https://github.com/googleapis/nodejs-firestore/pull/533)) - -## v1.0.0 - -01-29-2019 12:12 PST - -This is the Firestore Node.js Client Library GA release. - -## v0.21.0 - -01-25-2019 12:21 PST - -This release brings in google-gax update to 0.24.0 which had its dependency google-auth-library updated to 3.0.0^ that swaps out axios in favour of gaxios and addresses an issue using the library behind a proxy (https://github.com/googleapis/nodejs-firestore/issues/493). - -### Dependencies -- chore(deps): update dependency ts-node to v8 ([#526](https://github.com/googleapis/nodejs-firestore/pull/526)) -- fix(deps): update dependency google-gax to ^0.24.0 ([#529](https://github.com/googleapis/nodejs-firestore/pull/529)) - -### Documentation -- build: ignore googleapis.com in doc link check ([#527](https://github.com/googleapis/nodejs-firestore/pull/527)) -- docs: fix import links in the jsdocs ([#524](https://github.com/googleapis/nodejs-firestore/pull/524)) - -### Internal / Testing Changes -- chore: update year in the license headers. ([#523](https://github.com/googleapis/nodejs-firestore/pull/523)) - -## v0.20.0 - -01-16-2019 13:14 PST - -#### BREAKING: The `timestampsInSnapshots` default has changed to true. -The `timestampsInSnapshots` setting is now enabled by default so timestamp -fields read from a `DocumentSnapshot` will be returned as `Timestamp` objects -instead of `Date`. Any code expecting to receive a `Date` object must be -updated. - -#### DEPRECATED: `Firestore.v1beta1` replaced by `Firestore.v1` -If you are currently using `Firestore.v1beta1.FirestoreClient`, you must switch -to `Firestore.v1.FirestoreClient`. No other changes should be required as the -API is 100% identical. - -### Bug Fixes -- fix: getAll function signature to allow array destructuring ([#515](https://github.com/googleapis/nodejs-firestore/pull/515)) -- fix: update grpc retry config ([#464](https://github.com/googleapis/nodejs-firestore/pull/464)) - -### New Features -- feat: update to v1 protos ([#516](https://github.com/googleapis/nodejs-firestore/pull/516)) -- feat: add additional field transform types ([#521](https://github.com/googleapis/nodejs-firestore/pull/521)) - -### Dependencies -- fix(deps): update dependency google-gax to ^0.23.0 ([#518](https://github.com/googleapis/nodejs-firestore/pull/518)) - -### Documentation -- fix(docs): remove unused long running operations types -- docs: elaborate on QuerySnapshot.forEach ([#480](https://github.com/googleapis/nodejs-firestore/pull/480)) -- docs: update doc writetime ([#475](https://github.com/googleapis/nodejs-firestore/pull/475)) -- docs: Fix example for writeTime ([#474](https://github.com/googleapis/nodejs-firestore/pull/474)) -- chore: update license file ([#473](https://github.com/googleapis/nodejs-firestore/pull/473)) -- docs: update readme badges ([#470](https://github.com/googleapis/nodejs-firestore/pull/470)) - -### Internal / Testing Changes -- build: check broken links in generated docs ([#511](https://github.com/googleapis/nodejs-firestore/pull/511)) -- chore(build): inject yoshi automation key ([#492](https://github.com/googleapis/nodejs-firestore/pull/492)) -- chore: update nyc and eslint configs ([#491](https://github.com/googleapis/nodejs-firestore/pull/491)) -- chore: fix publish.sh permission +x ([#489](https://github.com/googleapis/nodejs-firestore/pull/489)) -- fix(build): fix Kokoro release script ([#488](https://github.com/googleapis/nodejs-firestore/pull/488)) -- build: add Kokoro configs for autorelease ([#487](https://github.com/googleapis/nodejs-firestore/pull/487)) -- chore: add synth.metadata ([#485](https://github.com/googleapis/nodejs-firestore/pull/485)) -- chore: always nyc report before calling codecov ([#482](https://github.com/googleapis/nodejs-firestore/pull/482)) -- chore: nyc ignore build/test by default ([#479](https://github.com/googleapis/nodejs-firestore/pull/479)) -- chore(build): update the prettier config ([#476](https://github.com/googleapis/nodejs-firestore/pull/476)) -- chore(deps): update dependency typescript to ~3.2.0 ([#467](https://github.com/googleapis/nodejs-firestore/pull/467)) -- fix(build): fix system key decryption ([#468](https://github.com/googleapis/nodejs-firestore/pull/468)) -- Adding array-contains to error message ([#465](https://github.com/googleapis/nodejs-firestore/pull/465)) - -## v0.17.0 - -### Implementation Changes -- Regenerate library with synth.py customizations ([#345](https://github.com/googleapis/nodejs-firestore/pull/345)) - - contains some documentation and internal timeout changes -- Converting backoff.js to TypeScript ([#328](https://github.com/googleapis/nodejs-firestore/pull/328)) -- Making .dotChanges a method ([#324](https://github.com/googleapis/nodejs-firestore/pull/324)) - -### Dependencies -- chore(deps): update dependency nyc to v13 ([#329](https://github.com/googleapis/nodejs-firestore/pull/329)) -- fix(deps): update dependency google-gax to ^0.19.0 ([#325](https://github.com/googleapis/nodejs-firestore/pull/325)) - -### Documentation -- Fix DocumentReference.get() docs ([#332](https://github.com/googleapis/nodejs-firestore/pull/332)) - -### Internal / Testing Changes -- Retry npm install in CI ([#341](https://github.com/googleapis/nodejs-firestore/pull/341)) -- make synth.py generate library to ./dev ([#337](https://github.com/googleapis/nodejs-firestore/pull/337)) -- Revert "Re-generate library using /synth.py ([#331](https://github.com/googleapis/nodejs-firestore/pull/331))" ([#334](https://github.com/googleapis/nodejs-firestore/pull/334)) -- Re-generate library using /synth.py ([#331](https://github.com/googleapis/nodejs-firestore/pull/331)) diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/firestore/LICENSE b/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/firestore/LICENSE deleted file mode 100644 index d6456956..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/firestore/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/firestore/README.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/firestore/README.md deleted file mode 100644 index e426c888..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/firestore/README.md +++ /dev/null @@ -1,181 +0,0 @@ -[//]: # "This README.md file is auto-generated, all changes to this file will be lost." -[//]: # "To regenerate it, use `python -m synthtool`." -Google Cloud Platform logo - -# [Cloud Firestore: Node.js Client](https://github.com/googleapis/nodejs-firestore) - -[![release level](https://img.shields.io/badge/release%20level-stable-brightgreen.svg?style=flat)](https://cloud.google.com/terms/launch-stages) -[![npm version](https://img.shields.io/npm/v/@google-cloud/firestore.svg)](https://www.npmjs.org/package/@google-cloud/firestore) - - - - -This is the Node.js Server SDK for [Google Cloud Firestore](https://firebase.google.com/docs/firestore/). Google Cloud Firestore is a NoSQL document database built for automatic scaling, high performance, and ease of application development. - -This Cloud Firestore Server SDK uses Google’s Cloud Identity and Access Management for authentication and should only be used in trusted environments. Your Cloud Identity credentials allow you bypass all access restrictions and provide read and write access to all data in your Cloud Firestore project. - -The Cloud Firestore Server SDKs are designed to manage the full set of data in your Cloud Firestore project and work best with reliable network connectivity. Data operations performed via these SDKs directly access the Cloud Firestore backend and all document reads and writes are optimized for high throughput. - -Applications that use Google's Server SDKs should not be used in end-user environments, such as on phones or on publicly hosted websites. If you are developing a Web or Node.js application that accesses Cloud Firestore on behalf of end users, use the firebase Client SDK. - -**Note:** This Cloud Firestore Server SDK does not support Firestore databases created in [Datastore mode](https://cloud.google.com/datastore/docs/firestore-or-datastore#in_datastore_mode). To access these databases, use the [Datastore SDK](https://www.npmjs.com/package/@google-cloud/datastore). - - -A comprehensive list of changes in each version may be found in -[the CHANGELOG](https://github.com/googleapis/nodejs-firestore/blob/main/CHANGELOG.md). - -* [Cloud Firestore Node.js Client API Reference][client-docs] -* [Cloud Firestore Documentation][product-docs] -* [github.com/googleapis/nodejs-firestore](https://github.com/googleapis/nodejs-firestore) - -Read more about the client libraries for Cloud APIs, including the older -Google APIs Client Libraries, in [Client Libraries Explained][explained]. - -[explained]: https://cloud.google.com/apis/docs/client-libraries-explained - -**Table of contents:** - - -* [Quickstart](#quickstart) - * [Before you begin](#before-you-begin) - * [Installing the client library](#installing-the-client-library) - * [Using the client library](#using-the-client-library) -* [Samples](#samples) -* [Versioning](#versioning) -* [Contributing](#contributing) -* [License](#license) - -## Quickstart - -### Before you begin - -1. [Select or create a Cloud Platform project][projects]. -1. [Enable the Cloud Firestore API][enable_api]. -1. [Set up authentication with a service account][auth] so you can access the - API from your local workstation. - -### Installing the client library - -```bash -npm install @google-cloud/firestore -``` - - -### Using the client library - -```javascript -const {Firestore} = require('@google-cloud/firestore'); - -// Create a new client -const firestore = new Firestore(); - -async function quickstart() { - // Obtain a document reference. - const document = firestore.doc('posts/intro-to-firestore'); - - // Enter new data into the document. - await document.set({ - title: 'Welcome to Firestore', - body: 'Hello World', - }); - console.log('Entered new data into the document'); - - // Update an existing document. - await document.update({ - body: 'My first Firestore app', - }); - console.log('Updated an existing document'); - - // Read the document. - const doc = await document.get(); - console.log('Read the document'); - - // Delete the document. - await document.delete(); - console.log('Deleted the document'); -} -quickstart(); - -``` - - - -## Samples - -Samples are in the [`samples/`](https://github.com/googleapis/nodejs-firestore/tree/main/samples) directory. Each sample's `README.md` has instructions for running its sample. - -| Sample | Source Code | Try it | -| --------------------------- | --------------------------------- | ------ | -| Limit-to-last-query | [source code](https://github.com/googleapis/nodejs-firestore/blob/main/samples/limit-to-last-query.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-firestore&page=editor&open_in_editor=samples/limit-to-last-query.js,samples/README.md) | -| Quickstart | [source code](https://github.com/googleapis/nodejs-firestore/blob/main/samples/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-firestore&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) | -| Solution-counters | [source code](https://github.com/googleapis/nodejs-firestore/blob/main/samples/solution-counters.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-firestore&page=editor&open_in_editor=samples/solution-counters.js,samples/README.md) | - - - -The [Cloud Firestore Node.js Client API Reference][client-docs] documentation -also contains samples. - -## Supported Node.js Versions - -Our client libraries follow the [Node.js release schedule](https://nodejs.org/en/about/releases/). -Libraries are compatible with all current _active_ and _maintenance_ versions of -Node.js. -If you are using an end-of-life version of Node.js, we recommend that you update -as soon as possible to an actively supported LTS version. - -Google's client libraries support legacy versions of Node.js runtimes on a -best-efforts basis with the following warnings: - -* Legacy versions are not tested in continuous integration. -* Some security patches and features cannot be backported. -* Dependencies cannot be kept up-to-date. - -Client libraries targeting some end-of-life versions of Node.js are available, and -can be installed through npm [dist-tags](https://docs.npmjs.com/cli/dist-tag). -The dist-tags follow the naming convention `legacy-(version)`. -For example, `npm install @google-cloud/firestore@legacy-8` installs client libraries -for versions compatible with Node.js 8. - -## Versioning - -This library follows [Semantic Versioning](http://semver.org/). - - - -This library is considered to be **stable**. The code surface will not change in backwards-incompatible ways -unless absolutely necessary (e.g. because of critical security issues) or with -an extensive deprecation period. Issues and requests against **stable** libraries -are addressed with the highest priority. - - - - - - -More Information: [Google Cloud Platform Launch Stages][launch_stages] - -[launch_stages]: https://cloud.google.com/terms/launch-stages - -## Contributing - -Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/nodejs-firestore/blob/main/CONTRIBUTING.md). - -Please note that this `README.md`, the `samples/README.md`, -and a variety of configuration files in this repository (including `.nycrc` and `tsconfig.json`) -are generated from a central template. To edit one of these files, make an edit -to its templates in -[directory](https://github.com/googleapis/synthtool). - -## License - -Apache Version 2.0 - -See [LICENSE](https://github.com/googleapis/nodejs-firestore/blob/main/LICENSE) - -[client-docs]: https://cloud.google.com/nodejs/docs/reference/firestore/latest -[product-docs]: https://cloud.google.com/firestore -[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png -[projects]: https://console.cloud.google.com/project -[billing]: https://support.google.com/cloud/answer/6293499#enable-billing -[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=firestore.googleapis.com -[auth]: https://cloud.google.com/docs/authentication/getting-started diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/firestore/package.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/firestore/package.json deleted file mode 100644 index d7fbff7b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/firestore/package.json +++ /dev/null @@ -1,90 +0,0 @@ -{ - "name": "@google-cloud/firestore", - "description": "Firestore Client Library for Node.js", - "version": "6.4.1", - "license": "Apache-2.0", - "author": "Google Inc.", - "engines": { - "node": ">=12.0.0" - }, - "repository": "googleapis/nodejs-firestore", - "main": "./build/src/index.js", - "types": "./types/firestore.d.ts", - "files": [ - "build/protos", - "build/src", - "!build/src/**/*.map", - "types" - ], - "keywords": [ - "google apis client", - "google api client", - "google apis", - "google api", - "google", - "google cloud platform", - "google cloud", - "cloud", - "firestore" - ], - "scripts": { - "predocs": "npm run compile", - "docs": "jsdoc -c .jsdoc.js", - "system-test:rest": "USE_REST_FALLBACK=YES mocha build/system-test --timeout 600000", - "system-test:grpc": "mocha build/system-test --timeout 600000", - "system-test": "npm run system-test:grpc && npm run system-test:rest", - "presystem-test": "npm run compile", - "samples-test": "npm link && cd samples/ && npm link ../ && npm test && cd ../", - "conformance": "mocha build/conformance", - "preconformance": "npm run compile", - "test-only": "c8 mocha build/test", - "pretest-only": "npm run compile", - "test": "npm run test-only && npm run conformance", - "lint": "gts check", - "clean": "gts clean", - "compile": "tsc -p .", - "postcompile": "node scripts/init-directories.js && cp -r dev/protos build && cp dev/src/v1beta1/*.json build/src/v1beta1/ && cp dev/src/v1/*.json build/src/v1/ && cp dev/conformance/test-definition.proto build/conformance && cp dev/conformance/conformance-tests/*.json build/conformance/conformance-tests && minifyProtoJson", - "fix": "gts fix", - "prepare": "npm run compile", - "docs-test": "linkinator docs", - "predocs-test": "npm run docs", - "prelint": "cd samples; npm link ../; npm install", - "precompile": "gts clean" - }, - "dependencies": { - "fast-deep-equal": "^3.1.1", - "functional-red-black-tree": "^1.0.1", - "google-gax": "^3.5.1", - "protobufjs": "^7.0.0" - }, - "devDependencies": { - "@types/assert": "^1.4.0", - "@types/chai": "^4.2.7", - "@types/chai-as-promised": "^7.1.2", - "@types/duplexify": "^3.5.0", - "@types/extend": "^3.0.0", - "@types/mocha": "^9.0.0", - "@types/node": "^16.0.0", - "@types/sinon": "^10.0.0", - "@types/through2": "^2.0.34", - "c8": "^7.0.0", - "chai": "^4.1.2", - "chai-as-promised": "^7.1.1", - "codecov": "^3.6.1", - "duplexify": "^4.0.0", - "extend": "^3.0.2", - "gts": "^3.1.0", - "jsdoc": "^3.6.2", - "jsdoc-fresh": "^2.0.0", - "jsdoc-region-tag": "^2.0.0", - "length-prefixed-json-stream": "^1.0.1", - "linkinator": "^4.0.0", - "mocha": "^9.2.2", - "protobufjs-cli": "^1.0.0", - "proxyquire": "^2.1.3", - "sinon": "^13.0.0", - "through2": "^4.0.0", - "ts-node": "^10.0.0", - "typescript": "~4.7.4" - } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/firestore/types/firestore.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/firestore/types/firestore.d.ts deleted file mode 100644 index 1e33ce92..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/firestore/types/firestore.d.ts +++ /dev/null @@ -1,2431 +0,0 @@ -/*! - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// We deliberately use `any` in the external API to not impose type-checking -// on end users. -/* eslint-disable @typescript-eslint/no-explicit-any */ - -// Declare a global (ambient) namespace -// (used when not using import statement, but just script include). -declare namespace FirebaseFirestore { - /** Alias for `any` but used where a Firestore field value would be provided. */ - export type DocumentFieldValue = any; - - /** - * Document data (for use with `DocumentReference.set()`) consists of fields - * mapped to values. - */ - export type DocumentData = {[field: string]: DocumentFieldValue}; - - /** - * Similar to Typescript's `Partial`, but allows nested fields to be - * omitted and FieldValues to be passed in as property values. - */ - export type PartialWithFieldValue = - | Partial - | (T extends Primitive - ? T - : T extends {} - ? {[K in keyof T]?: PartialWithFieldValue | FieldValue} - : never); - - /** - * Allows FieldValues to be passed in as a property value while maintaining - * type safety. - */ - export type WithFieldValue = - | T - | (T extends Primitive - ? T - : T extends {} - ? {[K in keyof T]: WithFieldValue | FieldValue} - : never); - - /** - * Update data (for use with [update]{@link DocumentReference#update}) - * that contains paths mapped to values. Fields that contain dots reference - * nested fields within the document. FieldValues can be passed in - * as property values. - * - * You can update a top-level field in your document by using the field name - * as a key (e.g. `foo`). The provided value completely replaces the contents - * for this field. - * - * You can also update a nested field directly by using its field path as a - * key (e.g. `foo.bar`). This nested field update replaces the contents at - * `bar` but does not modify other data under `foo`. - */ - export type UpdateData = T extends Primitive - ? T - : T extends {} - ? {[K in keyof T]?: UpdateData | FieldValue} & NestedUpdateFields - : Partial; - - /** Primitive types. */ - export type Primitive = string | number | boolean | undefined | null; - - /** - * For each field (e.g. 'bar'), find all nested keys (e.g. {'bar.baz': T1, - * 'bar.qux': T2}). Intersect them together to make a single map containing - * all possible keys that are all marked as optional - */ - export type NestedUpdateFields> = - UnionToIntersection< - { - [K in keyof T & string]: ChildUpdateFields; - }[keyof T & string] // Also include the generated prefix-string keys. - >; - - /** - * Helper for calculating the nested fields for a given type T1. This is needed - * to distribute union types such as `undefined | {...}` (happens for optional - * props) or `{a: A} | {b: B}`. - * - * In this use case, `V` is used to distribute the union types of `T[K]` on - * `Record`, since `T[K]` is evaluated as an expression and not distributed. - * - * See https://www.typescriptlang.org/docs/handbook/advanced-types.html#distributive-conditional-types - */ - export type ChildUpdateFields = - // Only allow nesting for map values - V extends Record - ? // Recurse into the map and add the prefix in front of each key - // (e.g. Prefix 'bar.' to create: 'bar.baz' and 'bar.qux'. - AddPrefixToKeys> - : // UpdateData is always a map of values. - never; - - /** - * Returns a new map where every key is prefixed with the outer key appended - * to a dot. - */ - export type AddPrefixToKeys< - Prefix extends string, - T extends Record - > = - // Remap K => Prefix.K. See https://www.typescriptlang.org/docs/handbook/2/mapped-types.html#key-remapping-via-as - {[K in keyof T & string as `${Prefix}.${K}`]+?: T[K]}; - - /** - * Given a union type `U = T1 | T2 | ...`, returns an intersected type - * `(T1 & T2 & ...)`. - * - * Uses distributive conditional types and inference from conditional types. - * This works because multiple candidates for the same type variable in - * contra-variant positions causes an intersection type to be inferred. - * https://www.typescriptlang.org/docs/handbook/advanced-types.html#type-inference-in-conditional-types - * https://stackoverflow.com/questions/50374908/transform-union-type-to-intersection-type - */ - export type UnionToIntersection = ( - U extends unknown ? (k: U) => void : never - ) extends (k: infer I) => void - ? I - : never; - - /** - * Sets or disables the log function for all active Firestore instances. - * - * @param logger A log function that takes a message (such as `console.log`) or - * `null` to turn off logging. - */ - function setLogFunction(logger: ((msg: string) => void) | null): void; - - /** - * Converter used by `withConverter()` to transform user objects of type T - * into Firestore data. - * - * Using the converter allows you to specify generic type arguments when - * storing and retrieving objects from Firestore. - * - * @example - * class Post { - * constructor(readonly title: string, readonly author: string) {} - * - * toString(): string { - * return this.title + ', by ' + this.author; - * } - * } - * - * const postConverter = { - * toFirestore(post: Post): FirebaseFirestore.DocumentData { - * return {title: post.title, author: post.author}; - * }, - * fromFirestore( - * snapshot: FirebaseFirestore.QueryDocumentSnapshot - * ): Post { - * const data = snapshot.data(); - * return new Post(data.title, data.author); - * } - * }; - * - * const postSnap = await Firestore() - * .collection('posts') - * .withConverter(postConverter) - * .doc().get(); - * const post = postSnap.data(); - * if (post !== undefined) { - * post.title; // string - * post.toString(); // Should be defined - * post.someNonExistentProperty; // TS error - * } - */ - export interface FirestoreDataConverter { - /** - * Called by the Firestore SDK to convert a custom model object of type T - * into a plain Javascript object (suitable for writing directly to the - * Firestore database). To use set() with `merge` and `mergeFields`, - * toFirestore() must be defined with `Partial`. - * - * The `WithFieldValue` type extends `T` to also allow FieldValues such - * as `FieldValue.delete()` to be used as property values. - */ - toFirestore(modelObject: WithFieldValue): DocumentData; - - /** - * Called by the Firestore SDK to convert a custom model object of type T - * into a plain Javascript object (suitable for writing directly to the - * Firestore database). To use set() with `merge` and `mergeFields`, - * toFirestore() must be defined with `Partial`. - * - * The `PartialWithFieldValue` type extends `Partial` to allow - * FieldValues such as `FieldValue.delete()` to be used as property values. - * It also supports nested `Partial` by allowing nested fields to be - * omitted. - */ - toFirestore( - modelObject: PartialWithFieldValue, - options: SetOptions - ): DocumentData; - - /** - * Called by the Firestore SDK to convert Firestore data into an object of - * type T. - */ - fromFirestore(snapshot: QueryDocumentSnapshot): T; - } - - /** - * Settings used to directly configure a `Firestore` instance. - */ - export interface Settings { - /** - * The project ID from the Google Developer's Console, e.g. - * 'grape-spaceship-123'. We will also check the environment variable - * GCLOUD_PROJECT for your project ID. Can be omitted in environments that - * support {@link https://cloud.google.com/docs/authentication Application - * Default Credentials} - */ - projectId?: string; - - /** - * The database name. If omitted, the default database will be used. - * - * @internal - */ - databaseId?: string; - - /** The hostname to connect to. */ - host?: string; - - /** The port to connect to. */ - port?: number; - - /** - * Local file containing the Service Account credentials as downloaded from - * the Google Developers Console. Can be omitted in environments that - * support {@link https://cloud.google.com/docs/authentication Application - * Default Credentials}. To configure Firestore with custom credentials, use - * the `credentials` property to provide the `client_email` and - * `private_key` of your service account. - */ - keyFilename?: string; - - /** - * The 'client_email' and 'private_key' properties of the service account - * to use with your Firestore project. Can be omitted in environments that - * support {@link https://cloud.google.com/docs/authentication Application - * Default Credentials}. If your credentials are stored in a JSON file, you - * can specify a `keyFilename` instead. - */ - credentials?: {client_email?: string; private_key?: string}; - - /** Whether to use SSL when connecting. */ - ssl?: boolean; - - /** - * The maximum number of idle GRPC channels to keep. A smaller number of idle - * channels reduces memory usage but increases request latency for clients - * with fluctuating request rates. If set to 0, shuts down all GRPC channels - * when the client becomes idle. Defaults to 1. - */ - maxIdleChannels?: number; - - /** - * Whether to use `BigInt` for integer types when deserializing Firestore - * Documents. Regardless of magnitude, all integer values are returned as - * `BigInt` to match the precision of the Firestore backend. Floating point - * numbers continue to use JavaScript's `number` type. - */ - useBigInt?: boolean; - - /** - * Whether to skip nested properties that are set to `undefined` during - * object serialization. If set to `true`, these properties are skipped - * and not written to Firestore. If set `false` or omitted, the SDK throws - * an exception when it encounters properties of type `undefined`. - */ - ignoreUndefinedProperties?: boolean; - - /** - * Use HTTP for requests that can be served over HTTP and JSON. This reduces - * the amount of networking code that is loaded to serve requests within - * Firestore. - * - * This setting does not apply to `onSnapshot` APIs as they cannot be served - * over native HTTP. - */ - preferRest?: boolean; - - [key: string]: any; // Accept other properties, such as GRPC settings. - } - - /** Options to configure a read-only transaction. */ - export interface ReadOnlyTransactionOptions { - /** Set to true to indicate a read-only transaction. */ - readOnly: true; - /** - * If specified, documents are read at the given time. This may not be more - * than 60 seconds in the past from when the request is processed by the - * server. - */ - readTime?: Timestamp; - } - - /** Options to configure a read-write transaction. */ - export interface ReadWriteTransactionOptions { - /** Set to false or omit to indicate a read-write transaction. */ - readOnly?: false; - /** - * The maximum number of attempts for this transaction. Defaults to 5. - */ - maxAttempts?: number; - } - - /** - * `Firestore` represents a Firestore Database and is the entry point for all - * Firestore operations. - */ - export class Firestore { - /** - * @param settings Configuration object. See [Firestore Documentation] - * {@link https://firebase.google.com/docs/firestore/} - */ - public constructor(settings?: Settings); - - /** - * Specifies custom settings to be used to configure the `Firestore` - * instance. Can only be invoked once and before any other Firestore - * method. - * - * If settings are provided via both `settings()` and the `Firestore` - * constructor, both settings objects are merged and any settings provided - * via `settings()` take precedence. - * - * @param {object} settings The settings to use for all Firestore - * operations. - */ - settings(settings: Settings): void; - - /** - * Gets a `CollectionReference` instance that refers to the collection at - * the specified path. - * - * @param collectionPath A slash-separated path to a collection. - * @return The `CollectionReference` instance. - */ - collection(collectionPath: string): CollectionReference; - - /** - * Gets a `DocumentReference` instance that refers to the document at the - * specified path. - * - * @param documentPath A slash-separated path to a document. - * @return The `DocumentReference` instance. - */ - doc(documentPath: string): DocumentReference; - - /** - * Creates and returns a new Query that includes all documents in the - * database that are contained in a collection or subcollection with the - * given collectionId. - * - * @param collectionId Identifies the collections to query over. Every - * collection or subcollection with this ID as the last segment of its path - * will be included. Cannot contain a slash. - * @return The created `CollectionGroup`. - */ - collectionGroup(collectionId: string): CollectionGroup; - - /** - * Retrieves multiple documents from Firestore. - * - * The first argument is required and must be of type `DocumentReference` - * followed by any additional `DocumentReference` documents. If used, the - * optional `ReadOptions` must be the last argument. - * - * @param {Array.} documentRefsOrReadOptions - * The `DocumentReferences` to receive, followed by an optional field - * mask. - * @return A Promise that resolves with an array of resulting document - * snapshots. - */ - getAll( - ...documentRefsOrReadOptions: Array< - DocumentReference | ReadOptions - > - ): Promise>>; - - /** - * Recursively deletes all documents and subcollections at and under the - * specified level. - * - * If any delete fails, the promise is rejected with an error message - * containing the number of failed deletes and the stack trace of the last - * failed delete. The provided reference is deleted regardless of whether - * all deletes succeeded. - * - * `recursiveDelete()` uses a BulkWriter instance with default settings to - * perform the deletes. To customize throttling rates or add success/error - * callbacks, pass in a custom BulkWriter instance. - * - * @param ref The reference of a document or collection to delete. - * @param bulkWriter A custom BulkWriter instance used to perform the - * deletes. - * @return A promise that resolves when all deletes have been performed. - * The promise is rejected if any of the deletes fail. - * - * @example - * // Recursively delete a reference and log the references of failures. - * const bulkWriter = firestore.bulkWriter(); - * bulkWriter - * .onWriteError((error) => { - * if ( - * error.failedAttempts < MAX_RETRY_ATTEMPTS - * ) { - * return true; - * } else { - * console.log('Failed write at document: ', error.documentRef.path); - * return false; - * } - * }); - * await firestore.recursiveDelete(docRef, bulkWriter); - */ - recursiveDelete( - ref: CollectionReference | DocumentReference, - bulkWriter?: BulkWriter - ): Promise; - - /** - * Terminates the Firestore client and closes all open streams. - * - * @return A Promise that resolves when the client is terminated. - */ - terminate(): Promise; - - /** - * Fetches the root collections that are associated with this Firestore - * database. - * - * @returns A Promise that resolves with an array of CollectionReferences. - */ - listCollections(): Promise>>; - - /** - * Executes the given updateFunction and commits the changes applied within - * the transaction. - * - * You can use the transaction object passed to 'updateFunction' to read and - * modify Firestore documents under lock. You have to perform all reads - * before you perform any write. - * - * Transactions can be performed as read-only or read-write transactions. By - * default, transactions are executed in read-write mode. - * - * A read-write transaction obtains a pessimistic lock on all documents that - * are read during the transaction. These locks block other transactions, - * batched writes, and other non-transactional writes from changing that - * document. Any writes in a read-write transactions are committed once - * 'updateFunction' resolves, which also releases all locks. - * - * If a read-write transaction fails with contention, the transaction is - * retried up to five times. The `updateFunction` is invoked once for each - * attempt. - * - * Read-only transactions do not lock documents. They can be used to read - * documents at a consistent snapshot in time, which may be up to 60 seconds - * in the past. Read-only transactions are not retried. - * - * Transactions time out after 60 seconds if no documents are read. - * Transactions that are not committed within than 270 seconds are also - * aborted. Any remaining locks are released when a transaction times out. - * - * @param updateFunction The function to execute within the transaction - * context. - * @param transactionOptions Transaction options. - * @return If the transaction completed successfully or was explicitly - * aborted (by the updateFunction returning a failed Promise), the Promise - * returned by the updateFunction will be returned here. Else if the - * transaction failed, a rejected Promise with the corresponding failure - * error will be returned. - */ - runTransaction( - updateFunction: (transaction: Transaction) => Promise, - transactionOptions?: - | ReadWriteTransactionOptions - | ReadOnlyTransactionOptions - ): Promise; - - /** - * Creates a write batch, used for performing multiple writes as a single - * atomic operation. - */ - batch(): WriteBatch; - - /** - * Creates a [BulkWriter]{@link BulkWriter}, used for performing - * multiple writes in parallel. Gradually ramps up writes as specified - * by the 500/50/5 rule. - * - * @see https://firebase.google.com/docs/firestore/best-practices#ramping_up_traffic - * - * @param options An options object used to configure the throttling - * behavior for the underlying BulkWriter. - */ - bulkWriter(options?: BulkWriterOptions): BulkWriter; - - /** - * Creates a new `BundleBuilder` instance to package selected Firestore data into - * a bundle. - * - * @param bundleId The ID of the bundle. When loaded on clients, client SDKs use this ID - * and the timestamp associated with the bundle to tell if it has been loaded already. - * If not specified, a random identifier will be used. - * - * - * @example - * const bundle = firestore.bundle('data-bundle'); - * const docSnapshot = await firestore.doc('abc/123').get(); - * const querySnapshot = await firestore.collection('coll').get(); - * - * const bundleBuffer = bundle.add(docSnapshot); // Add a document - * .add('coll-query', querySnapshot) // Add a named query. - * .build() - * // Save `bundleBuffer` to CDN or stream it to clients. - */ - bundle(bundleId?: string): BundleBuilder; - } - - /** - * An immutable object representing a geo point in Firestore. The geo point - * is represented as latitude/longitude pair. - * - * Latitude values are in the range of [-90, 90]. - * Longitude values are in the range of [-180, 180]. - */ - export class GeoPoint { - /** - * Creates a new immutable GeoPoint object with the provided latitude and - * longitude values. - * @param latitude The latitude as number between -90 and 90. - * @param longitude The longitude as number between -180 and 180. - */ - constructor(latitude: number, longitude: number); - - readonly latitude: number; - readonly longitude: number; - - /** - * Returns true if this `GeoPoint` is equal to the provided one. - * - * @param other The `GeoPoint` to compare against. - * @return true if this `GeoPoint` is equal to the provided one. - */ - isEqual(other: GeoPoint): boolean; - } - - /** - * A reference to a transaction. - * The `Transaction` object passed to a transaction's updateFunction provides - * the methods to read and write data within the transaction context. See - * `Firestore.runTransaction()`. - */ - export class Transaction { - private constructor(); - - /** - * Retrieves a query result. Holds a pessimistic lock on all returned - * documents. - * - * @param query A query to execute. - * @return A QuerySnapshot for the retrieved data. - */ - get(query: Query): Promise>; - - /** - * Reads the document referenced by the provided `DocumentReference.` - * Holds a pessimistic lock on the returned document. - * - * @param documentRef A reference to the document to be read. - * @return A DocumentSnapshot for the read data. - */ - get(documentRef: DocumentReference): Promise>; - - /** - * Retrieves an aggregate query result. Holds a pessimistic lock on all - * documents that were matched by the underlying query. - * - * @param aggregateQuery An aggregate query to execute. - * @return An AggregateQuerySnapshot for the retrieved data. - */ - get( - aggregateQuery: AggregateQuery - ): Promise>; - - /** - * Retrieves multiple documents from Firestore. Holds a pessimistic lock on - * all returned documents. - * - * The first argument is required and must be of type `DocumentReference` - * followed by any additional `DocumentReference` documents. If used, the - * optional `ReadOptions` must be the last argument. - * - * @param {Array.} documentRefsOrReadOptions - * The `DocumentReferences` to receive, followed by an optional field - * mask. - * @return A Promise that resolves with an array of resulting document - * snapshots. - */ - getAll( - ...documentRefsOrReadOptions: Array | ReadOptions> - ): Promise>>; - - /** - * Create the document referred to by the provided `DocumentReference`. - * The operation will fail the transaction if a document exists at the - * specified location. - * - * @param documentRef A reference to the document to be create. - * @param data The object data to serialize as the document. - * @throws Error If the provided input is not a valid Firestore document. - * @return This `Transaction` instance. Used for chaining method calls. - */ - create( - documentRef: DocumentReference, - data: WithFieldValue - ): Transaction; - - /** - * Writes to the document referred to by the provided `DocumentReference`. - * If the document does not exist yet, it will be created. If you pass - * `SetOptions`, the provided data can be merged into the existing document. - * - * @param documentRef A reference to the document to be set. - * @param data An object of the fields and values for the document. - * @param options An object to configure the set behavior. - * @param options.merge - If true, set() merges the values specified in its - * data argument. Fields omitted from this set() call remain untouched. If - * your input sets any field to an empty map, all nested fields are - * overwritten. - * @param options.mergeFields - If provided, set() only replaces the - * specified field paths. Any field path that is not specified is ignored - * and remains untouched. If your input sets any field to an empty map, all - * nested fields are overwritten. - * @throws Error If the provided input is not a valid Firestore document. - * @return This `Transaction` instance. Used for chaining method calls. - */ - set( - documentRef: DocumentReference, - data: PartialWithFieldValue, - options: SetOptions - ): Transaction; - set( - documentRef: DocumentReference, - data: WithFieldValue - ): Transaction; - - /** - * Updates fields in the document referred to by the provided - * `DocumentReference`. The update will fail if applied to a document that - * does not exist. - * - * Nested fields can be updated by providing dot-separated field path - * strings. - * - * @param documentRef A reference to the document to be updated. - * @param data An object containing the fields and values with which to - * update the document. - * @param precondition A Precondition to enforce on this update. - * @throws Error If the provided input is not valid Firestore data. - * @return This `Transaction` instance. Used for chaining method calls. - */ - update( - documentRef: DocumentReference, - data: UpdateData, - precondition?: Precondition - ): Transaction; - - /** - * Updates fields in the document referred to by the provided - * `DocumentReference`. The update will fail if applied to a document that - * does not exist. - * - * Nested fields can be updated by providing dot-separated field path - * strings or by providing FieldPath objects. - * - * A `Precondition` restricting this update can be specified as the last - * argument. - * - * @param documentRef A reference to the document to be updated. - * @param field The first field to update. - * @param value The first value - * @param fieldsOrPrecondition An alternating list of field paths and values - * to update, optionally followed by a `Precondition` to enforce on this - * update. - * @throws Error If the provided input is not valid Firestore data. - * @return This `Transaction` instance. Used for chaining method calls. - */ - update( - documentRef: DocumentReference, - field: string | FieldPath, - value: any, - ...fieldsOrPrecondition: any[] - ): Transaction; - - /** - * Deletes the document referred to by the provided `DocumentReference`. - * - * @param documentRef A reference to the document to be deleted. - * @param precondition A Precondition to enforce for this delete. - * @return This `Transaction` instance. Used for chaining method calls. - */ - delete( - documentRef: DocumentReference, - precondition?: Precondition - ): Transaction; - } - - /** - * A Firestore BulkWriter than can be used to perform a large number of writes - * in parallel. Writes to the same document will be executed sequentially. - * - * @class - */ - export class BulkWriter { - private constructor(); - - /** - * Create a document with the provided data. This single operation will fail - * if a document exists at its location. - * - * @param documentRef A reference to the document to be - * created. - * @param data The object to serialize as the document. - * @throws Error If the provided input is not a valid Firestore document. - * @returns A promise that resolves with the result of the write. If the - * write fails, the promise is rejected with a - * [BulkWriterError]{@link BulkWriterError}. - */ - create( - documentRef: DocumentReference, - data: WithFieldValue - ): Promise; - - /** - * Delete a document from the database. - * - * @param documentRef A reference to the document to be - * deleted. - * @param precondition A precondition to enforce for this - * delete. - * @param precondition.lastUpdateTime If set, enforces that the - * document was last updated at lastUpdateTime. Fails the batch if the - * document doesn't exist or was last updated at a different time. - * @param precondition.exists If set, enforces that the target document - * must or must not exist. - * @returns A promise that resolves with the result of the delete. If the - * delete fails, the promise is rejected with a - * [BulkWriterError]{@link BulkWriterError}. - */ - delete( - documentRef: DocumentReference, - precondition?: Precondition - ): Promise; - - /** - * Write to the document referred to by the provided - * [DocumentReference]{@link DocumentReference}. If the document does not - * exist yet, it will be created. If you pass - * [SetOptions]{@link SetOptions}., the provided data can be merged into the - * existing document. - * - * @param documentRef A reference to the document to be - * set. - * @param data The object to serialize as the document. - * @param options An object to configure the set behavior. - * @param options.merge - If true, set() merges the values specified in its - * data argument. Fields omitted from this set() call remain untouched. If - * your input sets any field to an empty map, all nested fields are - * overwritten. - * @param options.mergeFields - If provided, set() only replaces the - * specified field paths. Any field path that is not specified is ignored - * and remains untouched. If your input sets any field to an empty map, all - * nested fields are overwritten. - * @throws Error If the provided input is not a valid Firestore document. - * @returns A promise that resolves with the result of the write. If the - * write fails, the promise is rejected with a - * [BulkWriterError]{@link BulkWriterError}. - */ - set( - documentRef: DocumentReference, - data: PartialWithFieldValue, - options: SetOptions - ): Promise; - set( - documentRef: DocumentReference, - data: WithFieldValue - ): Promise; - - /** - * Update fields of the document referred to by the provided - * [DocumentReference]{@link DocumentReference}. If the document doesn't yet - * exist, the update fails and the entire batch will be rejected. - * - * The update() method accepts either an object with field paths encoded as - * keys and field values encoded as values, or a variable number of - * arguments that alternate between field paths and field values. Nested - * fields can be updated by providing dot-separated field path strings or by - * providing FieldPath objects. - * - * - * A Precondition restricting this update can be specified as the last - * argument. - * - * @param documentRef A reference to the document to be updated. - * @param data An object containing the fields and values with which to - * update the document. - * @param precondition A Precondition to enforce on this update. - * @throws Error If the provided input is not valid Firestore data. - * @returns A promise that resolves with the result of the write. If the - * write fails, the promise is rejected with a - * [BulkWriterError]{@link BulkWriterError}. - */ - update( - documentRef: DocumentReference, - data: UpdateData, - precondition?: Precondition - ): Promise; - - /** - * Update fields of the document referred to by the provided - * [DocumentReference]{@link DocumentReference}. If the document doesn't yet - * exist, the update fails and the entire batch will be rejected. - * - * The update() method accepts either an object with field paths encoded as - * keys and field values encoded as values, or a variable number of - * arguments that alternate between field paths and field values. Nested - * fields can be updated by providing dot-separated field path strings or by - * providing FieldPath objects. - * - * - * A Precondition restricting this update can be specified as the last - * argument. - * - * @param documentRef A reference to the document to be updated. - * @param field The first field to update. - * @param value The first value - * @param fieldsOrPrecondition An alternating list of field paths and values - * to update, optionally followed a `Precondition` to enforce on this - * update. - * @throws Error If the provided input is not valid Firestore data; - * @returns A promise that resolves with the result of the write. If the - * write fails, the promise is rejected with a - * [BulkWriterError]{@link BulkWriterError}. - */ - update( - documentRef: DocumentReference, - field: string | FieldPath, - value: any, - ...fieldsOrPrecondition: any[] - ): Promise; - - /** - * Attaches a listener that is run every time a BulkWriter operation - * successfully completes. - * - * @param callback A callback to be called every time a BulkWriter operation - * successfully completes. - */ - onWriteResult( - callback: ( - documentRef: DocumentReference, - result: WriteResult - ) => void - ): void; - - /** - * Attaches an error handler listener that is run every time a BulkWriter - * operation fails. - * - * BulkWriter has a default error handler that retries UNAVAILABLE and - * ABORTED errors up to a maximum of 10 failed attempts. When an error - * handler is specified, the default error handler will be overwritten. - * - * @param shouldRetryCallback A callback to be called every time a BulkWriter - * operation fails. Returning `true` will retry the operation. Returning - * `false` will stop the retry loop. - */ - onWriteError( - shouldRetryCallback: (error: BulkWriterError) => boolean - ): void; - - /** - * Commits all writes that have been enqueued up to this point in parallel. - * - * Returns a Promise that resolves when all currently queued operations have - * been committed. The Promise will never be rejected since the results for - * each individual operation are conveyed via their individual Promises. - * - * The Promise resolves immediately if there are no pending writes. - * Otherwise, the Promise waits for all previously issued writes, but it - * does not wait for writes that were added after the method is called. If - * you want to wait for additional writes, call `flush()` again. - * - * @return A promise that resolves when all enqueued writes - * up to this point have been committed. - */ - flush(): Promise; - - /** - * Commits all enqueued writes and marks the BulkWriter instance as closed. - * - * After calling `close()`, calling any method will throw an error. Any - * retries scheduled as part of an `onWriteError()` handler will be run - * before the `close()` promise resolves. - * - * Returns a Promise that resolves when all writes have been committed. The - * Promise will never be rejected. Calling this method will send all - * requests. The promise resolves immediately if there are no pending - * writes. - * - * @return A promise that resolves when all enqueued writes - * up to this point have been committed. - */ - close(): Promise; - } - - /** - * An options object to configure throttling on BulkWriter. - */ - export interface BulkWriterOptions { - /** - * Whether to disable or configure throttling. By default, throttling is - * enabled. This field can be set to either a boolean or a config - * object. Setting it to `true` will use default values. You can override - * the defaults by setting it to `false` to disable throttling, or by - * setting the config values to enable throttling with the provided values. - * - * @see https://firebase.google.com/docs/firestore/best-practices#ramping_up_traffic - * - * @param initialOpsPerSecond The initial maximum number of operations per - * second allowed by the throttler. If this field is not set, the default - * is 500 operations per second. - * @param maxOpsPerSecond The maximum number of operations per second - * allowed by the throttler. If this field is set, the throttler's allowed - * operations per second does not ramp up past the specified operations per - * second. - */ - readonly throttling?: - | boolean - | {initialOpsPerSecond?: number; maxOpsPerSecond?: number}; - } - - /** - * The error thrown when a BulkWriter operation fails. - */ - export class BulkWriterError extends Error { - /** The status code of the error. */ - readonly code: GrpcStatus; - - /** The error message of the error. */ - readonly message: string; - - /** The document reference the operation was performed on. */ - readonly documentRef: DocumentReference; - - /** The type of operation performed. */ - readonly operationType: 'create' | 'set' | 'update' | 'delete'; - - /** How many times this operation has been attempted unsuccessfully. */ - readonly failedAttempts: number; - } - - /** - * A write batch, used to perform multiple writes as a single atomic unit. - * - * A `WriteBatch` object can be acquired by calling `Firestore.batch()`. It - * provides methods for adding writes to the write batch. None of the - * writes will be committed (or visible locally) until `WriteBatch.commit()` - * is called. - * - * Unlike transactions, write batches are persisted offline and therefore are - * preferable when you don't need to condition your writes on read data. - */ - export class WriteBatch { - private constructor(); - - /** - * Create the document referred to by the provided `DocumentReference`. The - * operation will fail the batch if a document exists at the specified - * location. - * - * @param documentRef A reference to the document to be created. - * @param data The object data to serialize as the document. - * @throws Error If the provided input is not a valid Firestore document. - * @return This `WriteBatch` instance. Used for chaining method calls. - */ - create( - documentRef: DocumentReference, - data: WithFieldValue - ): WriteBatch; - - /** - * Write to the document referred to by the provided `DocumentReference`. - * If the document does not exist yet, it will be created. If you pass - * `SetOptions`, the provided data can be merged into the existing document. - * - * @param documentRef A reference to the document to be set. - * @param data An object of the fields and values for the document. - * @param options An object to configure the set behavior. - * @param options.merge - If true, set() merges the values specified in its - * data argument. Fields omitted from this set() call remain untouched. If - * your input sets any field to an empty map, all nested fields are - * overwritten. - * @param options.mergeFields - If provided, set() only replaces the - * specified field paths. Any field path that is not specified is ignored - * and remains untouched. If your input sets any field to an empty map, all - * nested fields are overwritten. - * @throws Error If the provided input is not a valid Firestore document. - * @return This `WriteBatch` instance. Used for chaining method calls. - */ - set( - documentRef: DocumentReference, - data: PartialWithFieldValue, - options: SetOptions - ): WriteBatch; - set( - documentRef: DocumentReference, - data: WithFieldValue - ): WriteBatch; - - /** - * Update fields of the document referred to by the provided - * `DocumentReference`. If the document doesn't yet exist, the update fails - * and the entire batch will be rejected. - * - * Nested fields can be updated by providing dot-separated field path - * strings. - * - * @param documentRef A reference to the document to be updated. - * @param data An object containing the fields and values with which to - * update the document. - * @param precondition A Precondition to enforce on this update. - * @throws Error If the provided input is not valid Firestore data. - * @return This `WriteBatch` instance. Used for chaining method calls. - */ - update( - documentRef: DocumentReference, - data: UpdateData, - precondition?: Precondition - ): WriteBatch; - - /** - * Updates fields in the document referred to by the provided - * `DocumentReference`. The update will fail if applied to a document that - * does not exist. - * - * Nested fields can be updated by providing dot-separated field path - * strings or by providing FieldPath objects. - * - * A `Precondition` restricting this update can be specified as the last - * argument. - * - * @param documentRef A reference to the document to be updated. - * @param field The first field to update. - * @param value The first value - * @param fieldsOrPrecondition An alternating list of field paths and values - * to update, optionally followed a `Precondition` to enforce on this - * update. - * @throws Error If the provided input is not valid Firestore data. - * @return This `WriteBatch` instance. Used for chaining method calls. - */ - update( - documentRef: DocumentReference, - field: string | FieldPath, - value: any, - ...fieldsOrPrecondition: any[] - ): WriteBatch; - - /** - * Deletes the document referred to by the provided `DocumentReference`. - * - * @param documentRef A reference to the document to be deleted. - * @param precondition A Precondition to enforce for this delete. - * @return This `WriteBatch` instance. Used for chaining method calls. - */ - delete( - documentRef: DocumentReference, - precondition?: Precondition - ): WriteBatch; - - /** - * Commits all of the writes in this write batch as a single atomic unit. - * - * @return A Promise resolved once all of the writes in the batch have been - * successfully written to the backend as an atomic unit. - */ - commit(): Promise; - } - - /** - * An options object that configures conditional behavior of `update()` and - * `delete()` calls in `DocumentReference`, `WriteBatch`, and `Transaction`. - * Using Preconditions, these calls can be restricted to only apply to - * documents that match the specified restrictions. - */ - export interface Precondition { - /** - * If set, the last update time to enforce. - */ - readonly lastUpdateTime?: Timestamp; - - /** - * If set, enforces that the target document must or must not exist. - */ - readonly exists?: boolean; - } - - /** - * An options object that configures the behavior of `set()` calls in - * `DocumentReference`, `WriteBatch` and `Transaction`. These calls can be - * configured to perform granular merges instead of overwriting the target - * documents in their entirety. - * - * @param merge Changes the behavior of a set() call to only replace the - * values specified in its data argument. Fields omitted from the set() call - * remain untouched. If your input sets any field to an empty map, all nested - * fields are overwritten. - * - * @param mergeFields Changes the behavior of set() calls to only replace - * the specified field paths. Any field path that is not specified is ignored - * and remains untouched. If your input sets any field to an empty map, all - * nested fields are overwritten. - */ - export type SetOptions = - | { - readonly merge?: boolean; - } - | { - readonly mergeFields?: Array; - }; - - /** - * An options object that can be used to configure the behavior of `getAll()` - * calls. By providing a `fieldMask`, these calls can be configured to only - * return a subset of fields. - */ - export interface ReadOptions { - /** - * Specifies the set of fields to return and reduces the amount of data - * transmitted by the backend. - * - * Adding a field mask does not filter results. Documents do not need to - * contain values for all the fields in the mask to be part of the result - * set. - */ - readonly fieldMask?: (string | FieldPath)[]; - } - - /** - * A WriteResult wraps the write time set by the Firestore servers on `sets()`, - * `updates()`, and `creates()`. - */ - export class WriteResult { - private constructor(); - - /** - * The write time as set by the Firestore servers. - */ - readonly writeTime: Timestamp; - - /** - * Returns true if this `WriteResult` is equal to the provided one. - * - * @param other The `WriteResult` to compare against. - * @return true if this `WriteResult` is equal to the provided one. - */ - isEqual(other: WriteResult): boolean; - } - - /** - * A `DocumentReference` refers to a document location in a Firestore database - * and can be used to write, read, or listen to the location. The document at - * the referenced location may or may not exist. A `DocumentReference` can - * also be used to create a `CollectionReference` to a subcollection. - */ - export class DocumentReference { - private constructor(); - - /** The identifier of the document within its collection. */ - readonly id: string; - - /** - * The `Firestore` for the Firestore database (useful for performing - * transactions, etc.). - */ - readonly firestore: Firestore; - - /** - * A reference to the Collection to which this DocumentReference belongs. - */ - readonly parent: CollectionReference; - - /** - * A string representing the path of the referenced document (relative - * to the root of the database). - */ - readonly path: string; - - /** - * Gets a `CollectionReference` instance that refers to the collection at - * the specified path. - * - * @param collectionPath A slash-separated path to a collection. - * @return The `CollectionReference` instance. - */ - collection(collectionPath: string): CollectionReference; - - /** - * Fetches the subcollections that are direct children of this document. - * - * @returns A Promise that resolves with an array of CollectionReferences. - */ - listCollections(): Promise>>; - - /** - * Creates a document referred to by this `DocumentReference` with the - * provided object values. The write fails if the document already exists - * - * @param data The object data to serialize as the document. - * @throws Error If the provided input is not a valid Firestore document. - * @return A Promise resolved with the write time of this create. - */ - create(data: WithFieldValue): Promise; - - /** - * Writes to the document referred to by this `DocumentReference`. If the - * document does not yet exist, it will be created. If you pass - * `SetOptions`, the provided data can be merged into an existing document. - * - * @param data A map of the fields and values for the document. - * @param options An object to configure the set behavior. - * @param options.merge - If true, set() merges the values specified in its - * data argument. Fields omitted from this set() call remain untouched. If - * your input sets any field to an empty map, all nested fields are - * overwritten. - * @param options.mergeFields - If provided, set() only replaces the - * specified field paths. Any field path that is not specified is ignored - * and remains untouched. If your input sets any field to an empty map, all - * nested fields are overwritten. - * @throws Error If the provided input is not a valid Firestore document. - * @return A Promise resolved with the write time of this set. - */ - set( - data: PartialWithFieldValue, - options: SetOptions - ): Promise; - set(data: WithFieldValue): Promise; - - /** - * Updates fields in the document referred to by this `DocumentReference`. - * The update will fail if applied to a document that does not exist. - * - * Nested fields can be updated by providing dot-separated field path - * strings. - * - * @param data An object containing the fields and values with which to - * update the document. - * @param precondition A Precondition to enforce on this update. - * @throws Error If the provided input is not valid Firestore data. - * @return A Promise resolved with the write time of this update. - */ - update( - data: UpdateData, - precondition?: Precondition - ): Promise; - - /** - * Updates fields in the document referred to by this `DocumentReference`. - * The update will fail if applied to a document that does not exist. - * - * Nested fields can be updated by providing dot-separated field path - * strings or by providing FieldPath objects. - * - * A `Precondition` restricting this update can be specified as the last - * argument. - * - * @param field The first field to update. - * @param value The first value. - * @param moreFieldsOrPrecondition An alternating list of field paths and - * values to update, optionally followed by a `Precondition` to enforce on - * this update. - * @throws Error If the provided input is not valid Firestore data. - * @return A Promise resolved with the write time of this update. - */ - update( - field: string | FieldPath, - value: any, - ...moreFieldsOrPrecondition: any[] - ): Promise; - - /** - * Deletes the document referred to by this `DocumentReference`. - * - * @param precondition A Precondition to enforce for this delete. - * @return A Promise resolved with the write time of this delete. - */ - delete(precondition?: Precondition): Promise; - - /** - * Reads the document referred to by this `DocumentReference`. - * - * @return A Promise resolved with a DocumentSnapshot containing the - * current document contents. - */ - get(): Promise>; - - /** - * Attaches a listener for DocumentSnapshot events. - * - * @param onNext A callback to be called every time a new `DocumentSnapshot` - * is available. - * @param onError A callback to be called if the listen fails or is - * cancelled. No further callbacks will occur. - * @return An unsubscribe function that can be called to cancel - * the snapshot listener. - */ - onSnapshot( - onNext: (snapshot: DocumentSnapshot) => void, - onError?: (error: Error) => void - ): () => void; - - /** - * Returns true if this `DocumentReference` is equal to the provided one. - * - * @param other The `DocumentReference` to compare against. - * @return true if this `DocumentReference` is equal to the provided one. - */ - isEqual(other: DocumentReference): boolean; - - /** - * Applies a custom data converter to this DocumentReference, allowing you - * to use your own custom model objects with Firestore. When you call - * set(), get(), etc. on the returned DocumentReference instance, the - * provided converter will convert between Firestore data and your custom - * type U. - * - * @param converter Converts objects to and from Firestore. Passing in - * `null` removes the current converter. - * @return A DocumentReference that uses the provided converter. - */ - withConverter( - converter: FirestoreDataConverter - ): DocumentReference; - withConverter(converter: null): DocumentReference; - } - - /** - * A `DocumentSnapshot` contains data read from a document in your Firestore - * database. The data can be extracted with `.data()` or `.get()` to - * get a specific field. - * - * For a `DocumentSnapshot` that points to a non-existing document, any data - * access will return 'undefined'. You can use the `exists` property to - * explicitly verify a document's existence. - */ - export class DocumentSnapshot { - protected constructor(); - - /** True if the document exists. */ - readonly exists: boolean; - - /** A `DocumentReference` to the document location. */ - readonly ref: DocumentReference; - - /** - * The ID of the document for which this `DocumentSnapshot` contains data. - */ - readonly id: string; - - /** - * The time the document was created. Not set for documents that don't - * exist. - */ - readonly createTime?: Timestamp; - - /** - * The time the document was last updated (at the time the snapshot was - * generated). Not set for documents that don't exist. - */ - readonly updateTime?: Timestamp; - - /** - * The time this snapshot was read. - */ - readonly readTime: Timestamp; - - /** - * Retrieves all fields in the document as an Object. Returns 'undefined' if - * the document doesn't exist. - * - * @return An Object containing all fields in the document. - */ - data(): T | undefined; - - /** - * Retrieves the field specified by `fieldPath`. - * - * @param fieldPath The path (e.g. 'foo' or 'foo.bar') to a specific field. - * @return The data at the specified field location or undefined if no such - * field exists in the document. - */ - get(fieldPath: string | FieldPath): any; - - /** - * Returns true if the document's data and path in this `DocumentSnapshot` - * is equal to the provided one. - * - * @param other The `DocumentSnapshot` to compare against. - * @return true if this `DocumentSnapshot` is equal to the provided one. - */ - isEqual(other: DocumentSnapshot): boolean; - } - - /** - * A `QueryDocumentSnapshot` contains data read from a document in your - * Firestore database as part of a query. The document is guaranteed to exist - * and its data can be extracted with `.data()` or `.get()` to get a - * specific field. - * - * A `QueryDocumentSnapshot` offers the same API surface as a - * `DocumentSnapshot`. Since query results contain only existing documents, the - * `exists` property will always be true and `data()` will never return - * 'undefined'. - */ - export class QueryDocumentSnapshot< - T = DocumentData - > extends DocumentSnapshot { - private constructor(); - - /** - * The time the document was created. - */ - readonly createTime: Timestamp; - - /** - * The time the document was last updated (at the time the snapshot was - * generated). - */ - readonly updateTime: Timestamp; - - /** - * Retrieves all fields in the document as an Object. - * - * @override - * @return An Object containing all fields in the document. - */ - data(): T; - } - - /** - * The direction of a `Query.orderBy()` clause is specified as 'desc' or 'asc' - * (descending or ascending). - */ - export type OrderByDirection = 'desc' | 'asc'; - - /** - * Filter conditions in a `Query.where()` clause are specified using the - * strings '<', '<=', '==', '!=', '>=', '>', 'array-contains', 'in', 'not-in', - * and 'array-contains-any'. - */ - export type WhereFilterOp = - | '<' - | '<=' - | '==' - | '!=' - | '>=' - | '>' - | 'array-contains' - | 'in' - | 'not-in' - | 'array-contains-any'; - - /** - * A `Query` refers to a Query which you can read or listen to. You can also - * construct refined `Query` objects by adding filters and ordering. - */ - export class Query { - protected constructor(); - - /** - * The `Firestore` for the Firestore database (useful for performing - * transactions, etc.). - */ - readonly firestore: Firestore; - - /** - * Creates and returns a new Query with the additional filter that documents - * must contain the specified field and that its value should satisfy the - * relation constraint provided. - * - * This function returns a new (immutable) instance of the Query (rather - * than modify the existing instance) to impose the filter. - * - * @param fieldPath The path to compare - * @param opStr The operation string (e.g "<", "<=", "==", ">", ">="). - * @param value The value for comparison - * @return The created Query. - */ - where( - fieldPath: string | FieldPath, - opStr: WhereFilterOp, - value: any - ): Query; - - /** - * Creates and returns a new Query that's additionally sorted by the - * specified field, optionally in descending order instead of ascending. - * - * This function returns a new (immutable) instance of the Query (rather - * than modify the existing instance) to impose the order. - * - * @param fieldPath The field to sort by. - * @param directionStr Optional direction to sort by ('asc' or 'desc'). If - * not specified, order will be ascending. - * @return The created Query. - */ - orderBy( - fieldPath: string | FieldPath, - directionStr?: OrderByDirection - ): Query; - - /** - * Creates and returns a new Query that only returns the first matching - * documents. - * - * This function returns a new (immutable) instance of the Query (rather - * than modify the existing instance) to impose the limit. - * - * @param limit The maximum number of items to return. - * @return The created Query. - */ - limit(limit: number): Query; - - /** - * Creates and returns a new Query that only returns the last matching - * documents. - * - * You must specify at least one orderBy clause for limitToLast queries, - * otherwise an exception will be thrown during execution. - * - * Results for limitToLast queries cannot be streamed via the `stream()` - * API. - * - * @param limit The maximum number of items to return. - * @return The created Query. - */ - limitToLast(limit: number): Query; - - /** - * Specifies the offset of the returned results. - * - * This function returns a new (immutable) instance of the Query (rather - * than modify the existing instance) to impose the offset. - * - * @param offset The offset to apply to the Query results. - * @return The created Query. - */ - offset(offset: number): Query; - - /** - * Creates and returns a new Query instance that applies a field mask to - * the result and returns only the specified subset of fields. You can - * specify a list of field paths to return, or use an empty list to only - * return the references of matching documents. - * - * Queries that contain field masks cannot be listened to via `onSnapshot()` - * listeners. - * - * This function returns a new (immutable) instance of the Query (rather - * than modify the existing instance) to impose the field mask. - * - * @param field The field paths to return. - * @return The created Query. - */ - select(...field: (string | FieldPath)[]): Query; - - /** - * Creates and returns a new Query that starts at the provided document - * (inclusive). The starting position is relative to the order of the query. - * The document must contain all of the fields provided in the orderBy of - * this query. - * - * @param snapshot The snapshot of the document to start after. - * @return The created Query. - */ - startAt(snapshot: DocumentSnapshot): Query; - - /** - * Creates and returns a new Query that starts at the provided fields - * relative to the order of the query. The order of the field values - * must match the order of the order by clauses of the query. - * - * @param fieldValues The field values to start this query at, in order - * of the query's order by. - * @return The created Query. - */ - startAt(...fieldValues: any[]): Query; - - /** - * Creates and returns a new Query that starts after the provided document - * (exclusive). The starting position is relative to the order of the query. - * The document must contain all of the fields provided in the orderBy of - * this query. - * - * @param snapshot The snapshot of the document to start after. - * @return The created Query. - */ - startAfter(snapshot: DocumentSnapshot): Query; - - /** - * Creates and returns a new Query that starts after the provided fields - * relative to the order of the query. The order of the field values - * must match the order of the order by clauses of the query. - * - * @param fieldValues The field values to start this query after, in order - * of the query's order by. - * @return The created Query. - */ - startAfter(...fieldValues: any[]): Query; - - /** - * Creates and returns a new Query that ends before the provided document - * (exclusive). The end position is relative to the order of the query. The - * document must contain all of the fields provided in the orderBy of this - * query. - * - * @param snapshot The snapshot of the document to end before. - * @return The created Query. - */ - endBefore(snapshot: DocumentSnapshot): Query; - - /** - * Creates and returns a new Query that ends before the provided fields - * relative to the order of the query. The order of the field values - * must match the order of the order by clauses of the query. - * - * @param fieldValues The field values to end this query before, in order - * of the query's order by. - * @return The created Query. - */ - endBefore(...fieldValues: any[]): Query; - - /** - * Creates and returns a new Query that ends at the provided document - * (inclusive). The end position is relative to the order of the query. The - * document must contain all of the fields provided in the orderBy of this - * query. - * - * @param snapshot The snapshot of the document to end at. - * @return The created Query. - */ - endAt(snapshot: DocumentSnapshot): Query; - - /** - * Creates and returns a new Query that ends at the provided fields - * relative to the order of the query. The order of the field values - * must match the order of the order by clauses of the query. - * - * @param fieldValues The field values to end this query at, in order - * of the query's order by. - * @return The created Query. - */ - endAt(...fieldValues: any[]): Query; - - /** - * Executes the query and returns the results as a `QuerySnapshot`. - * - * @return A Promise that will be resolved with the results of the Query. - */ - get(): Promise>; - - /* - * Executes the query and returns the results as Node Stream. - * - * @return A stream of QueryDocumentSnapshot. - */ - stream(): NodeJS.ReadableStream; - - /** - * Attaches a listener for `QuerySnapshot `events. - * - * @param onNext A callback to be called every time a new `QuerySnapshot` - * is available. - * @param onError A callback to be called if the listen fails or is - * cancelled. No further callbacks will occur. - * @return An unsubscribe function that can be called to cancel - * the snapshot listener. - */ - onSnapshot( - onNext: (snapshot: QuerySnapshot) => void, - onError?: (error: Error) => void - ): () => void; - - /** - * Returns a query that counts the documents in the result set of this - * query. - * - * The returned query, when executed, counts the documents in the result set - * of this query without actually downloading the documents. - * - * Using the returned query to count the documents is efficient because only - * the final count, not the documents' data, is downloaded. The returned - * query can even count the documents if the result set would be - * prohibitively large to download entirely (e.g. thousands of documents). - * - * @return a query that counts the documents in the result set of this - * query. The count can be retrieved from `snapshot.data().count`, where - * `snapshot` is the `AggregateQuerySnapshot` resulting from running the - * returned query. - */ - count(): AggregateQuery<{count: AggregateField}>; - - /** - * Returns true if this `Query` is equal to the provided one. - * - * @param other The `Query` to compare against. - * @return true if this `Query` is equal to the provided one. - */ - isEqual(other: Query): boolean; - - /** - * Applies a custom data converter to this Query, allowing you to use your - * own custom model objects with Firestore. When you call get() on the - * returned Query, the provided converter will convert between Firestore - * data and your custom type U. - * - * @param converter Converts objects to and from Firestore. Passing in - * `null` removes the current converter. - * @return A Query that uses the provided converter. - */ - withConverter(converter: FirestoreDataConverter): Query; - withConverter(converter: null): Query; - } - - /** - * A `QuerySnapshot` contains zero or more `QueryDocumentSnapshot` objects - * representing the results of a query. The documents can be accessed as an - * array via the `docs` property or enumerated using the `forEach` method. The - * number of documents can be determined via the `empty` and `size` - * properties. - */ - export class QuerySnapshot { - private constructor(); - - /** - * The query on which you called `get` or `onSnapshot` in order to get this - * `QuerySnapshot`. - */ - readonly query: Query; - - /** An array of all the documents in the QuerySnapshot. */ - readonly docs: Array>; - - /** The number of documents in the QuerySnapshot. */ - readonly size: number; - - /** True if there are no documents in the QuerySnapshot. */ - readonly empty: boolean; - - /** The time this query snapshot was obtained. */ - readonly readTime: Timestamp; - - /** - * Returns an array of the documents changes since the last snapshot. If - * this is the first snapshot, all documents will be in the list as added - * changes. - */ - docChanges(): DocumentChange[]; - - /** - * Enumerates all of the documents in the QuerySnapshot. - * - * @param callback A callback to be called with a `DocumentSnapshot` for - * each document in the snapshot. - * @param thisArg The `this` binding for the callback. - */ - forEach( - callback: (result: QueryDocumentSnapshot) => void, - thisArg?: any - ): void; - - /** - * Returns true if the document data in this `QuerySnapshot` is equal to the - * provided one. - * - * @param other The `QuerySnapshot` to compare against. - * @return true if this `QuerySnapshot` is equal to the provided one. - */ - isEqual(other: QuerySnapshot): boolean; - } - - /** - * The type of of a `DocumentChange` may be 'added', 'removed', or 'modified'. - */ - export type DocumentChangeType = 'added' | 'removed' | 'modified'; - - /** - * A `DocumentChange` represents a change to the documents matching a query. - * It contains the document affected and the type of change that occurred. - */ - export interface DocumentChange { - /** The type of change ('added', 'modified', or 'removed'). */ - readonly type: DocumentChangeType; - - /** The document affected by this change. */ - readonly doc: QueryDocumentSnapshot; - - /** - * The index of the changed document in the result set immediately prior to - * this DocumentChange (i.e. supposing that all prior DocumentChange objects - * have been applied). Is -1 for 'added' events. - */ - readonly oldIndex: number; - - /** - * The index of the changed document in the result set immediately after - * this DocumentChange (i.e. supposing that all prior DocumentChange - * objects and the current DocumentChange object have been applied). - * Is -1 for 'removed' events. - */ - readonly newIndex: number; - - /** - * Returns true if the data in this `DocumentChange` is equal to the - * provided one. - * - * @param other The `DocumentChange` to compare against. - * @return true if this `DocumentChange` is equal to the provided one. - */ - isEqual(other: DocumentChange): boolean; - } - - /** - * A `CollectionReference` object can be used for adding documents, getting - * document references, and querying for documents (using the methods - * inherited from `Query`). - */ - export class CollectionReference extends Query { - private constructor(); - - /** The identifier of the collection. */ - readonly id: string; - - /** - * A reference to the containing Document if this is a subcollection, else - * null. - */ - readonly parent: DocumentReference | null; - - /** - * A string representing the path of the referenced collection (relative - * to the root of the database). - */ - readonly path: string; - - /** - * Retrieves the list of documents in this collection. - * - * The document references returned may include references to "missing - * documents", i.e. document locations that have no document present but - * which contain subcollections with documents. Attempting to read such a - * document reference (e.g. via `.get()` or `.onSnapshot()`) will return a - * `DocumentSnapshot` whose `.exists` property is false. - * - * @return {Promise} The list of documents in this - * collection. - */ - listDocuments(): Promise>>; - - /** - * Get a `DocumentReference` for a randomly-named document within this - * collection. An automatically-generated unique ID will be used as the - * document ID. - * - * @return The `DocumentReference` instance. - */ - doc(): DocumentReference; - - /** - * Get a `DocumentReference` for the document within the collection at the - * specified path. - * - * @param documentPath A slash-separated path to a document. - * @return The `DocumentReference` instance. - */ - doc(documentPath: string): DocumentReference; - - /** - * Add a new document to this collection with the specified data, assigning - * it a document ID automatically. - * - * @param data An Object containing the data for the new document. - * @throws Error If the provided input is not a valid Firestore document. - * @return A Promise resolved with a `DocumentReference` pointing to the - * newly created document after it has been written to the backend. - */ - add(data: WithFieldValue): Promise>; - - /** - * Returns true if this `CollectionReference` is equal to the provided one. - * - * @param other The `CollectionReference` to compare against. - * @return true if this `CollectionReference` is equal to the provided one. - */ - isEqual(other: CollectionReference): boolean; - - /** - * Applies a custom data converter to this CollectionReference, allowing you - * to use your own custom model objects with Firestore. When you call add() - * on the returned CollectionReference instance, the provided converter will - * convert between Firestore data and your custom type U. - * - * @param converter Converts objects to and from Firestore. Passing in - * `null` removes the current converter. - * @return A CollectionReference that uses the provided converter. - */ - withConverter( - converter: FirestoreDataConverter - ): CollectionReference; - withConverter(converter: null): CollectionReference; - } - - /** - * A `CollectionGroup` refers to all documents that are contained in a - * collection or subcollection with a specific collection ID. - */ - export class CollectionGroup extends Query { - private constructor(); - - /** - * Partitions a query by returning partition cursors that can be used to run - * the query in parallel. The returned cursors are split points that can be - * used as starting and end points for individual query invocations. - * - * @param desiredPartitionCount The desired maximum number of partition - * points. The number must be strictly positive. The actual number of - * partitions returned may be fewer. - * @return An AsyncIterable of `QueryPartition`s. - */ - getPartitions( - desiredPartitionCount: number - ): AsyncIterable>; - - /** - * Applies a custom data converter to this `CollectionGroup`, allowing you - * to use your own custom model objects with Firestore. When you call get() - * on the returned `CollectionGroup`, the provided converter will convert - * between Firestore data and your custom type U. - * - * Using the converter allows you to specify generic type arguments when - * storing and retrieving objects from Firestore. - * - * @example - * class Post { - * constructor(readonly title: string, readonly author: string) {} - * - * toString(): string { - * return this.title + ', by ' + this.author; - * } - * } - * - * const postConverter = { - * toFirestore(post: Post): FirebaseFirestore.DocumentData { - * return {title: post.title, author: post.author}; - * }, - * fromFirestore( - * snapshot: FirebaseFirestore.QueryDocumentSnapshot - * ): Post { - * const data = snapshot.data(); - * return new Post(data.title, data.author); - * } - * }; - * - * const querySnapshot = await Firestore() - * .collectionGroup('posts') - * .withConverter(postConverter) - * .get(); - * for (const doc of querySnapshot.docs) { - * const post = doc.data(); - * post.title; // string - * post.toString(); // Should be defined - * post.someNonExistentProperty; // TS error - * } - * - * @param converter Converts objects to and from Firestore. Passing in - * `null` removes the current converter. - * @return A `CollectionGroup` that uses the provided converter. - */ - withConverter(converter: FirestoreDataConverter): CollectionGroup; - withConverter(converter: null): CollectionGroup; - } - - /** - * A split point that can be used in a query as a starting and/or end point for - * the query results. The cursors returned by {@link #startAt} and {@link - * #endBefore} can only be used in a query that matches the constraint of query - * that produced this partition. - */ - export class QueryPartition { - private constructor(); - - /** - * The cursor that defines the first result for this partition or - * `undefined` if this is the first partition. The cursor value must be - * destructured when passed to `startAt()` (for example with - * `query.startAt(...queryPartition.startAt)`). - * - * @return Cursor values that can be used with {@link Query#startAt} or - * `undefined` if this is the first partition. - */ - get startAt(): unknown[] | undefined; - - /** - * The cursor that defines the first result after this partition or - * `undefined` if this is the last partition. The cursor value must be - * destructured when passed to `endBefore()` (for example with - * `query.endBefore(...queryPartition.endBefore)`). - * - * @return Cursor values that can be used with {@link Query#endBefore} or - * `undefined` if this is the last partition. - */ - get endBefore(): unknown[] | undefined; - - /** - * Returns a query that only returns the documents for this partition. - * - * @return A query partitioned by a {@link Query#startAt} and {@link - * Query#endBefore} cursor. - */ - toQuery(): Query; - } - - /** - * Represents an aggregation that can be performed by Firestore. - */ - // eslint-disable-next-line @typescript-eslint/no-unused-vars - export class AggregateField { - private constructor(); - } - - /** - * The union of all `AggregateField` types that are supported by Firestore. - */ - export type AggregateFieldType = AggregateField; - - /** - * A type whose property values are all `AggregateField` objects. - */ - export interface AggregateSpec { - [field: string]: AggregateFieldType; - } - - /** - * A type whose keys are taken from an `AggregateSpec`, and whose values are - * the result of the aggregation performed by the corresponding - * `AggregateField` from the input `AggregateSpec`. - */ - export type AggregateSpecData = { - [P in keyof T]: T[P] extends AggregateField ? U : never; - }; - - /** - * A query that calculates aggregations over an underlying query. - */ - export class AggregateQuery { - private constructor(); - - /** The query whose aggregations will be calculated by this object. */ - readonly query: Query; - - /** - * Executes this query. - * - * @return A promise that will be resolved with the results of the query. - */ - get(): Promise>; - - /** - * Compares this object with the given object for equality. - * - * This object is considered "equal" to the other object if and only if - * `other` performs the same aggregations as this `AggregateQuery` and - * the underlying Query of `other` compares equal to that of this object - * using `Query.isEqual()`. - * - * @param other The object to compare to this object for equality. - * @return `true` if this object is "equal" to the given object, as - * defined above, or `false` otherwise. - */ - isEqual(other: AggregateQuery): boolean; - } - - /** - * The results of executing an aggregation query. - */ - export class AggregateQuerySnapshot { - private constructor(); - - /** The query that was executed to produce this result. */ - readonly query: AggregateQuery; - - /** The time this snapshot was read. */ - readonly readTime: Timestamp; - - /** - * Returns the results of the aggregations performed over the underlying - * query. - * - * The keys of the returned object will be the same as those of the - * `AggregateSpec` object specified to the aggregation method, and the - * values will be the corresponding aggregation result. - * - * @returns The results of the aggregations performed over the underlying - * query. - */ - data(): AggregateSpecData; - - /** - * Compares this object with the given object for equality. - * - * Two `AggregateQuerySnapshot` instances are considered "equal" if they - * have the same data and their underlying queries compare "equal" using - * `AggregateQuery.isEqual()`. - * - * @param other The object to compare to this object for equality. - * @return `true` if this object is "equal" to the given object, as - * defined above, or `false` otherwise. - */ - isEqual(other: AggregateQuerySnapshot): boolean; - } - - /** - * Sentinel values that can be used when writing document fields with set(), - * create() or update(). - */ - export class FieldValue { - private constructor(); - - /** - * Returns a sentinel used with set(), create() or update() to include a - * server-generated timestamp in the written data. - * - * @return The FieldValue sentinel for use in a call to set(), create() or - * update(). - */ - static serverTimestamp(): FieldValue; - - /** - * Returns a sentinel for use with update() or set() with {merge:true} to - * mark a field for deletion. - * - * @return The FieldValue sentinel for use in a call to set() or update(). - */ - static delete(): FieldValue; - - /** - * Returns a special value that can be used with set(), create() or update() - * that tells the server to increment the field's current value by the given - * value. - * - * If either current field value or the operand uses floating point - * precision, both values will be interpreted as floating point numbers and - * all arithmetic will follow IEEE 754 semantics. Otherwise, integer - * precision is kept and the result is capped between -2^63 and 2^63-1. - * - * If the current field value is not of type 'number', or if the field does - * not yet exist, the transformation will set the field to the given value. - * - * @param n The value to increment by. - * @return The FieldValue sentinel for use in a call to set(), create() or - * update(). - */ - static increment(n: number): FieldValue; - - /** - * Returns a special value that can be used with set(), create() or update() - * that tells the server to union the given elements with any array value - * that already exists on the server. Each specified element that doesn't - * already exist in the array will be added to the end. If the field being - * modified is not already an array it will be overwritten with an array - * containing exactly the specified elements. - * - * @param elements The elements to union into the array. - * @return The FieldValue sentinel for use in a call to set(), create() or - * update(). - */ - static arrayUnion(...elements: any[]): FieldValue; - - /** - * Returns a special value that can be used with set(), create() or update() - * that tells the server to remove the given elements from any array value - * that already exists on the server. All instances of each element - * specified will be removed from the array. If the field being modified is - * not already an array it will be overwritten with an empty array. - * - * @param elements The elements to remove from the array. - * @return The FieldValue sentinel for use in a call to set(), create() or - * update(). - */ - static arrayRemove(...elements: any[]): FieldValue; - - /** - * Returns true if this `FieldValue` is equal to the provided one. - * - * @param other The `FieldValue` to compare against. - * @return true if this `FieldValue` is equal to the provided one. - */ - isEqual(other: FieldValue): boolean; - } - - /** - * A FieldPath refers to a field in a document. The path may consist of a - * single field name (referring to a top-level field in the document), or a - * list of field names (referring to a nested field in the document). - */ - export class FieldPath { - /** - * Creates a FieldPath from the provided field names. If more than one field - * name is provided, the path will point to a nested field in a document. - * - * @param fieldNames A list of field names. - */ - constructor(...fieldNames: string[]); - - /** - * Returns a special sentinel FieldPath to refer to the ID of a document. - * It can be used in queries to sort or filter by the document ID. - */ - static documentId(): FieldPath; - - /** - * Returns true if this `FieldPath` is equal to the provided one. - * - * @param other The `FieldPath` to compare against. - * @return true if this `FieldPath` is equal to the provided one. - */ - isEqual(other: FieldPath): boolean; - } - - /** - * A Timestamp represents a point in time independent of any time zone or - * calendar, represented as seconds and fractions of seconds at nanosecond - * resolution in UTC Epoch time. It is encoded using the Proleptic Gregorian - * Calendar which extends the Gregorian calendar backwards to year one. It is - * encoded assuming all minutes are 60 seconds long, i.e. leap seconds are - * "smeared" so that no leap second table is needed for interpretation. Range - * is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. - * - * @see https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto - */ - export class Timestamp { - /** - * Creates a new timestamp with the current date, with millisecond precision. - * - * @return A new `Timestamp` representing the current date. - */ - static now(): Timestamp; - - /** - * Creates a new timestamp from the given date. - * - * @param date The date to initialize the `Timestamp` from. - * @return A new `Timestamp` representing the same point in time as the - * given date. - */ - static fromDate(date: Date): Timestamp; - - /** - * Creates a new timestamp from the given number of milliseconds. - * - * @param milliseconds Number of milliseconds since Unix epoch - * 1970-01-01T00:00:00Z. - * @return A new `Timestamp` representing the same point in time as the - * given number of milliseconds. - */ - static fromMillis(milliseconds: number): Timestamp; - - /** - * Creates a new timestamp. - * - * @param seconds The number of seconds of UTC time since Unix epoch - * 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to - * 9999-12-31T23:59:59Z inclusive. - * @param nanoseconds The non-negative fractions of a second at nanosecond - * resolution. Negative second values with fractions must still have - * non-negative nanoseconds values that count forward in time. Must be from - * 0 to 999,999,999 inclusive. - */ - constructor(seconds: number, nanoseconds: number); - - /** - * The number of seconds of UTC time since Unix epoch 1970-01-01T00:00:00Z. - */ - readonly seconds: number; - - /** The non-negative fractions of a second at nanosecond resolution. */ - readonly nanoseconds: number; - - /** - * Returns a new `Date` corresponding to this timestamp. This may lose - * precision. - * - * @return JavaScript `Date` object representing the same point in time as - * this `Timestamp`, with millisecond precision. - */ - toDate(): Date; - - /** - * Returns the number of milliseconds since Unix epoch 1970-01-01T00:00:00Z. - * - * @return The point in time corresponding to this timestamp, represented as - * the number of milliseconds since Unix epoch 1970-01-01T00:00:00Z. - */ - toMillis(): number; - - /** - * Returns true if this `Timestamp` is equal to the provided one. - * - * @param other The `Timestamp` to compare against. - * @return 'true' if this `Timestamp` is equal to the provided one. - */ - isEqual(other: Timestamp): boolean; - - /** - * Converts this object to a primitive `string`, which allows `Timestamp` objects to be compared - * using the `>`, `<=`, `>=` and `>` operators. - * - * @return a string encoding of this object. - */ - valueOf(): string; - } - - /** - * Builds a Firestore data bundle with results from the given document and query snapshots. - */ - export class BundleBuilder { - /** The ID of this bundle. */ - readonly bundleId: string; - - /** - * Adds a Firestore `DocumentSnapshot` to the bundle. Both the documents data and the document - * read time will be included in the bundle. - * - * @param documentSnapshot A `DocumentSnapshot` to add. - * @returns This instance. - */ - add(documentSnapshot: DocumentSnapshot): BundleBuilder; - - /** - * Adds a Firestore `QuerySnapshot` to the bundle. Both the documents in the query results and - * the query read time will be included in the bundle. - * - * @param queryName The name of the query to add. - * @param querySnapshot A `QuerySnapshot` to add to the bundle. - * @returns This instance. - */ - add(queryName: string, querySnapshot: QuerySnapshot): BundleBuilder; - - /** - * Builds the bundle and returns the result as a `Buffer` instance. - */ - build(): Buffer; - } - - /** - * The v1beta1 Veneer client. This client provides access to to the underlying - * Firestore v1beta1 RPCs. - * @deprecated Use v1 instead. - */ - export const v1beta1: { - FirestoreClient: typeof import('./v1beta1/firestore_client').FirestoreClient; - }; - - /** - * The v1 Veneer clients. These clients provide access to the Firestore Admin - * API and the underlying Firestore v1 RPCs. - */ - export const v1: { - FirestoreClient: typeof import('./v1/firestore_client').FirestoreClient; - FirestoreAdminClient: typeof import('./v1/firestore_admin_client').FirestoreAdminClient; - }; - - /** - * Status codes returned by Firestore's gRPC calls. - */ - export enum GrpcStatus { - OK = 0, - CANCELLED = 1, - UNKNOWN = 2, - INVALID_ARGUMENT = 3, - DEADLINE_EXCEEDED = 4, - NOT_FOUND = 5, - ALREADY_EXISTS = 6, - PERMISSION_DENIED = 7, - RESOURCE_EXHAUSTED = 8, - FAILED_PRECONDITION = 9, - ABORTED = 10, - OUT_OF_RANGE = 11, - UNIMPLEMENTED = 12, - INTERNAL = 13, - UNAVAILABLE = 14, - DATA_LOSS = 15, - UNAUTHENTICATED = 16, - } -} - -declare module '@google-cloud/firestore' { - export = FirebaseFirestore; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/firestore/types/protos/firestore_admin_v1_proto_api.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/firestore/types/protos/firestore_admin_v1_proto_api.d.ts deleted file mode 100644 index 216fa60d..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/firestore/types/protos/firestore_admin_v1_proto_api.d.ts +++ /dev/null @@ -1,5152 +0,0 @@ -/*! - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import * as $protobuf from "protobufjs"; -/** Namespace google. */ -export namespace google { - - /** Namespace firestore. */ - namespace firestore { - - /** Namespace admin. */ - namespace admin { - - /** Namespace v1. */ - namespace v1 { - - /** Properties of a Database. */ - interface IDatabase { - - /** Database name */ - name?: (string|null); - - /** Database locationId */ - locationId?: (string|null); - - /** Database type */ - type?: (google.firestore.admin.v1.Database.DatabaseType|null); - - /** Database concurrencyMode */ - concurrencyMode?: (google.firestore.admin.v1.Database.ConcurrencyMode|null); - - /** Database etag */ - etag?: (string|null); - } - - /** Represents a Database. */ - class Database implements IDatabase { - - /** - * Constructs a new Database. - * @param [properties] Properties to set - */ - constructor(properties?: google.firestore.admin.v1.IDatabase); - - /** Database name. */ - public name: string; - - /** Database locationId. */ - public locationId: string; - - /** Database type. */ - public type: google.firestore.admin.v1.Database.DatabaseType; - - /** Database concurrencyMode. */ - public concurrencyMode: google.firestore.admin.v1.Database.ConcurrencyMode; - - /** Database etag. */ - public etag: string; - - /** - * Creates a Database message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Database - */ - public static fromObject(object: { [k: string]: any }): google.firestore.admin.v1.Database; - - /** - * Creates a plain object from a Database message. Also converts values to other types if specified. - * @param message Database - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.admin.v1.Database, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Database to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - namespace Database { - - /** DatabaseType enum. */ - type DatabaseType = - "DATABASE_TYPE_UNSPECIFIED"| "FIRESTORE_NATIVE"| "DATASTORE_MODE"; - - /** ConcurrencyMode enum. */ - type ConcurrencyMode = - "CONCURRENCY_MODE_UNSPECIFIED"| "OPTIMISTIC"| "PESSIMISTIC"| "OPTIMISTIC_WITH_ENTITY_GROUPS"; - } - - /** Properties of a Field. */ - interface IField { - - /** Field name */ - name?: (string|null); - - /** Field indexConfig */ - indexConfig?: (google.firestore.admin.v1.Field.IIndexConfig|null); - } - - /** Represents a Field. */ - class Field implements IField { - - /** - * Constructs a new Field. - * @param [properties] Properties to set - */ - constructor(properties?: google.firestore.admin.v1.IField); - - /** Field name. */ - public name: string; - - /** Field indexConfig. */ - public indexConfig?: (google.firestore.admin.v1.Field.IIndexConfig|null); - - /** - * Creates a Field message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Field - */ - public static fromObject(object: { [k: string]: any }): google.firestore.admin.v1.Field; - - /** - * Creates a plain object from a Field message. Also converts values to other types if specified. - * @param message Field - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.admin.v1.Field, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Field to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - namespace Field { - - /** Properties of an IndexConfig. */ - interface IIndexConfig { - - /** IndexConfig indexes */ - indexes?: (google.firestore.admin.v1.IIndex[]|null); - - /** IndexConfig usesAncestorConfig */ - usesAncestorConfig?: (boolean|null); - - /** IndexConfig ancestorField */ - ancestorField?: (string|null); - - /** IndexConfig reverting */ - reverting?: (boolean|null); - } - - /** Represents an IndexConfig. */ - class IndexConfig implements IIndexConfig { - - /** - * Constructs a new IndexConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.firestore.admin.v1.Field.IIndexConfig); - - /** IndexConfig indexes. */ - public indexes: google.firestore.admin.v1.IIndex[]; - - /** IndexConfig usesAncestorConfig. */ - public usesAncestorConfig: boolean; - - /** IndexConfig ancestorField. */ - public ancestorField: string; - - /** IndexConfig reverting. */ - public reverting: boolean; - - /** - * Creates an IndexConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns IndexConfig - */ - public static fromObject(object: { [k: string]: any }): google.firestore.admin.v1.Field.IndexConfig; - - /** - * Creates a plain object from an IndexConfig message. Also converts values to other types if specified. - * @param message IndexConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.admin.v1.Field.IndexConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this IndexConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } - - /** Represents a FirestoreAdmin */ - class FirestoreAdmin extends $protobuf.rpc.Service { - - /** - * Constructs a new FirestoreAdmin service. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - */ - constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); - - /** - * Calls CreateIndex. - * @param request CreateIndexRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public createIndex(request: google.firestore.admin.v1.ICreateIndexRequest, callback: google.firestore.admin.v1.FirestoreAdmin.CreateIndexCallback): void; - - /** - * Calls CreateIndex. - * @param request CreateIndexRequest message or plain object - * @returns Promise - */ - public createIndex(request: google.firestore.admin.v1.ICreateIndexRequest): Promise; - - /** - * Calls ListIndexes. - * @param request ListIndexesRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListIndexesResponse - */ - public listIndexes(request: google.firestore.admin.v1.IListIndexesRequest, callback: google.firestore.admin.v1.FirestoreAdmin.ListIndexesCallback): void; - - /** - * Calls ListIndexes. - * @param request ListIndexesRequest message or plain object - * @returns Promise - */ - public listIndexes(request: google.firestore.admin.v1.IListIndexesRequest): Promise; - - /** - * Calls GetIndex. - * @param request GetIndexRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Index - */ - public getIndex(request: google.firestore.admin.v1.IGetIndexRequest, callback: google.firestore.admin.v1.FirestoreAdmin.GetIndexCallback): void; - - /** - * Calls GetIndex. - * @param request GetIndexRequest message or plain object - * @returns Promise - */ - public getIndex(request: google.firestore.admin.v1.IGetIndexRequest): Promise; - - /** - * Calls DeleteIndex. - * @param request DeleteIndexRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty - */ - public deleteIndex(request: google.firestore.admin.v1.IDeleteIndexRequest, callback: google.firestore.admin.v1.FirestoreAdmin.DeleteIndexCallback): void; - - /** - * Calls DeleteIndex. - * @param request DeleteIndexRequest message or plain object - * @returns Promise - */ - public deleteIndex(request: google.firestore.admin.v1.IDeleteIndexRequest): Promise; - - /** - * Calls GetField. - * @param request GetFieldRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Field - */ - public getField(request: google.firestore.admin.v1.IGetFieldRequest, callback: google.firestore.admin.v1.FirestoreAdmin.GetFieldCallback): void; - - /** - * Calls GetField. - * @param request GetFieldRequest message or plain object - * @returns Promise - */ - public getField(request: google.firestore.admin.v1.IGetFieldRequest): Promise; - - /** - * Calls UpdateField. - * @param request UpdateFieldRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public updateField(request: google.firestore.admin.v1.IUpdateFieldRequest, callback: google.firestore.admin.v1.FirestoreAdmin.UpdateFieldCallback): void; - - /** - * Calls UpdateField. - * @param request UpdateFieldRequest message or plain object - * @returns Promise - */ - public updateField(request: google.firestore.admin.v1.IUpdateFieldRequest): Promise; - - /** - * Calls ListFields. - * @param request ListFieldsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListFieldsResponse - */ - public listFields(request: google.firestore.admin.v1.IListFieldsRequest, callback: google.firestore.admin.v1.FirestoreAdmin.ListFieldsCallback): void; - - /** - * Calls ListFields. - * @param request ListFieldsRequest message or plain object - * @returns Promise - */ - public listFields(request: google.firestore.admin.v1.IListFieldsRequest): Promise; - - /** - * Calls ExportDocuments. - * @param request ExportDocumentsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public exportDocuments(request: google.firestore.admin.v1.IExportDocumentsRequest, callback: google.firestore.admin.v1.FirestoreAdmin.ExportDocumentsCallback): void; - - /** - * Calls ExportDocuments. - * @param request ExportDocumentsRequest message or plain object - * @returns Promise - */ - public exportDocuments(request: google.firestore.admin.v1.IExportDocumentsRequest): Promise; - - /** - * Calls ImportDocuments. - * @param request ImportDocumentsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public importDocuments(request: google.firestore.admin.v1.IImportDocumentsRequest, callback: google.firestore.admin.v1.FirestoreAdmin.ImportDocumentsCallback): void; - - /** - * Calls ImportDocuments. - * @param request ImportDocumentsRequest message or plain object - * @returns Promise - */ - public importDocuments(request: google.firestore.admin.v1.IImportDocumentsRequest): Promise; - - /** - * Calls GetDatabase. - * @param request GetDatabaseRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Database - */ - public getDatabase(request: google.firestore.admin.v1.IGetDatabaseRequest, callback: google.firestore.admin.v1.FirestoreAdmin.GetDatabaseCallback): void; - - /** - * Calls GetDatabase. - * @param request GetDatabaseRequest message or plain object - * @returns Promise - */ - public getDatabase(request: google.firestore.admin.v1.IGetDatabaseRequest): Promise; - - /** - * Calls ListDatabases. - * @param request ListDatabasesRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListDatabasesResponse - */ - public listDatabases(request: google.firestore.admin.v1.IListDatabasesRequest, callback: google.firestore.admin.v1.FirestoreAdmin.ListDatabasesCallback): void; - - /** - * Calls ListDatabases. - * @param request ListDatabasesRequest message or plain object - * @returns Promise - */ - public listDatabases(request: google.firestore.admin.v1.IListDatabasesRequest): Promise; - - /** - * Calls UpdateDatabase. - * @param request UpdateDatabaseRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public updateDatabase(request: google.firestore.admin.v1.IUpdateDatabaseRequest, callback: google.firestore.admin.v1.FirestoreAdmin.UpdateDatabaseCallback): void; - - /** - * Calls UpdateDatabase. - * @param request UpdateDatabaseRequest message or plain object - * @returns Promise - */ - public updateDatabase(request: google.firestore.admin.v1.IUpdateDatabaseRequest): Promise; - } - - namespace FirestoreAdmin { - - /** - * Callback as used by {@link google.firestore.admin.v1.FirestoreAdmin#createIndex}. - * @param error Error, if any - * @param [response] Operation - */ - type CreateIndexCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.firestore.admin.v1.FirestoreAdmin#listIndexes}. - * @param error Error, if any - * @param [response] ListIndexesResponse - */ - type ListIndexesCallback = (error: (Error|null), response?: google.firestore.admin.v1.ListIndexesResponse) => void; - - /** - * Callback as used by {@link google.firestore.admin.v1.FirestoreAdmin#getIndex}. - * @param error Error, if any - * @param [response] Index - */ - type GetIndexCallback = (error: (Error|null), response?: google.firestore.admin.v1.Index) => void; - - /** - * Callback as used by {@link google.firestore.admin.v1.FirestoreAdmin#deleteIndex}. - * @param error Error, if any - * @param [response] Empty - */ - type DeleteIndexCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - - /** - * Callback as used by {@link google.firestore.admin.v1.FirestoreAdmin#getField}. - * @param error Error, if any - * @param [response] Field - */ - type GetFieldCallback = (error: (Error|null), response?: google.firestore.admin.v1.Field) => void; - - /** - * Callback as used by {@link google.firestore.admin.v1.FirestoreAdmin#updateField}. - * @param error Error, if any - * @param [response] Operation - */ - type UpdateFieldCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.firestore.admin.v1.FirestoreAdmin#listFields}. - * @param error Error, if any - * @param [response] ListFieldsResponse - */ - type ListFieldsCallback = (error: (Error|null), response?: google.firestore.admin.v1.ListFieldsResponse) => void; - - /** - * Callback as used by {@link google.firestore.admin.v1.FirestoreAdmin#exportDocuments}. - * @param error Error, if any - * @param [response] Operation - */ - type ExportDocumentsCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.firestore.admin.v1.FirestoreAdmin#importDocuments}. - * @param error Error, if any - * @param [response] Operation - */ - type ImportDocumentsCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.firestore.admin.v1.FirestoreAdmin#getDatabase}. - * @param error Error, if any - * @param [response] Database - */ - type GetDatabaseCallback = (error: (Error|null), response?: google.firestore.admin.v1.Database) => void; - - /** - * Callback as used by {@link google.firestore.admin.v1.FirestoreAdmin#listDatabases}. - * @param error Error, if any - * @param [response] ListDatabasesResponse - */ - type ListDatabasesCallback = (error: (Error|null), response?: google.firestore.admin.v1.ListDatabasesResponse) => void; - - /** - * Callback as used by {@link google.firestore.admin.v1.FirestoreAdmin#updateDatabase}. - * @param error Error, if any - * @param [response] Operation - */ - type UpdateDatabaseCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - } - - /** Properties of a ListDatabasesRequest. */ - interface IListDatabasesRequest { - - /** ListDatabasesRequest parent */ - parent?: (string|null); - } - - /** Represents a ListDatabasesRequest. */ - class ListDatabasesRequest implements IListDatabasesRequest { - - /** - * Constructs a new ListDatabasesRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.firestore.admin.v1.IListDatabasesRequest); - - /** ListDatabasesRequest parent. */ - public parent: string; - - /** - * Creates a ListDatabasesRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListDatabasesRequest - */ - public static fromObject(object: { [k: string]: any }): google.firestore.admin.v1.ListDatabasesRequest; - - /** - * Creates a plain object from a ListDatabasesRequest message. Also converts values to other types if specified. - * @param message ListDatabasesRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.admin.v1.ListDatabasesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListDatabasesRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a ListDatabasesResponse. */ - interface IListDatabasesResponse { - - /** ListDatabasesResponse databases */ - databases?: (google.firestore.admin.v1.IDatabase[]|null); - } - - /** Represents a ListDatabasesResponse. */ - class ListDatabasesResponse implements IListDatabasesResponse { - - /** - * Constructs a new ListDatabasesResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.firestore.admin.v1.IListDatabasesResponse); - - /** ListDatabasesResponse databases. */ - public databases: google.firestore.admin.v1.IDatabase[]; - - /** - * Creates a ListDatabasesResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListDatabasesResponse - */ - public static fromObject(object: { [k: string]: any }): google.firestore.admin.v1.ListDatabasesResponse; - - /** - * Creates a plain object from a ListDatabasesResponse message. Also converts values to other types if specified. - * @param message ListDatabasesResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.admin.v1.ListDatabasesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListDatabasesResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a GetDatabaseRequest. */ - interface IGetDatabaseRequest { - - /** GetDatabaseRequest name */ - name?: (string|null); - } - - /** Represents a GetDatabaseRequest. */ - class GetDatabaseRequest implements IGetDatabaseRequest { - - /** - * Constructs a new GetDatabaseRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.firestore.admin.v1.IGetDatabaseRequest); - - /** GetDatabaseRequest name. */ - public name: string; - - /** - * Creates a GetDatabaseRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetDatabaseRequest - */ - public static fromObject(object: { [k: string]: any }): google.firestore.admin.v1.GetDatabaseRequest; - - /** - * Creates a plain object from a GetDatabaseRequest message. Also converts values to other types if specified. - * @param message GetDatabaseRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.admin.v1.GetDatabaseRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetDatabaseRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of an UpdateDatabaseRequest. */ - interface IUpdateDatabaseRequest { - - /** UpdateDatabaseRequest database */ - database?: (google.firestore.admin.v1.IDatabase|null); - - /** UpdateDatabaseRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); - } - - /** Represents an UpdateDatabaseRequest. */ - class UpdateDatabaseRequest implements IUpdateDatabaseRequest { - - /** - * Constructs a new UpdateDatabaseRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.firestore.admin.v1.IUpdateDatabaseRequest); - - /** UpdateDatabaseRequest database. */ - public database?: (google.firestore.admin.v1.IDatabase|null); - - /** UpdateDatabaseRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); - - /** - * Creates an UpdateDatabaseRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateDatabaseRequest - */ - public static fromObject(object: { [k: string]: any }): google.firestore.admin.v1.UpdateDatabaseRequest; - - /** - * Creates a plain object from an UpdateDatabaseRequest message. Also converts values to other types if specified. - * @param message UpdateDatabaseRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.admin.v1.UpdateDatabaseRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateDatabaseRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of an UpdateDatabaseMetadata. */ - interface IUpdateDatabaseMetadata { - } - - /** Represents an UpdateDatabaseMetadata. */ - class UpdateDatabaseMetadata implements IUpdateDatabaseMetadata { - - /** - * Constructs a new UpdateDatabaseMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.firestore.admin.v1.IUpdateDatabaseMetadata); - - /** - * Creates an UpdateDatabaseMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateDatabaseMetadata - */ - public static fromObject(object: { [k: string]: any }): google.firestore.admin.v1.UpdateDatabaseMetadata; - - /** - * Creates a plain object from an UpdateDatabaseMetadata message. Also converts values to other types if specified. - * @param message UpdateDatabaseMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.admin.v1.UpdateDatabaseMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateDatabaseMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a CreateIndexRequest. */ - interface ICreateIndexRequest { - - /** CreateIndexRequest parent */ - parent?: (string|null); - - /** CreateIndexRequest index */ - index?: (google.firestore.admin.v1.IIndex|null); - } - - /** Represents a CreateIndexRequest. */ - class CreateIndexRequest implements ICreateIndexRequest { - - /** - * Constructs a new CreateIndexRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.firestore.admin.v1.ICreateIndexRequest); - - /** CreateIndexRequest parent. */ - public parent: string; - - /** CreateIndexRequest index. */ - public index?: (google.firestore.admin.v1.IIndex|null); - - /** - * Creates a CreateIndexRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateIndexRequest - */ - public static fromObject(object: { [k: string]: any }): google.firestore.admin.v1.CreateIndexRequest; - - /** - * Creates a plain object from a CreateIndexRequest message. Also converts values to other types if specified. - * @param message CreateIndexRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.admin.v1.CreateIndexRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateIndexRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a ListIndexesRequest. */ - interface IListIndexesRequest { - - /** ListIndexesRequest parent */ - parent?: (string|null); - - /** ListIndexesRequest filter */ - filter?: (string|null); - - /** ListIndexesRequest pageSize */ - pageSize?: (number|null); - - /** ListIndexesRequest pageToken */ - pageToken?: (string|null); - } - - /** Represents a ListIndexesRequest. */ - class ListIndexesRequest implements IListIndexesRequest { - - /** - * Constructs a new ListIndexesRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.firestore.admin.v1.IListIndexesRequest); - - /** ListIndexesRequest parent. */ - public parent: string; - - /** ListIndexesRequest filter. */ - public filter: string; - - /** ListIndexesRequest pageSize. */ - public pageSize: number; - - /** ListIndexesRequest pageToken. */ - public pageToken: string; - - /** - * Creates a ListIndexesRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListIndexesRequest - */ - public static fromObject(object: { [k: string]: any }): google.firestore.admin.v1.ListIndexesRequest; - - /** - * Creates a plain object from a ListIndexesRequest message. Also converts values to other types if specified. - * @param message ListIndexesRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.admin.v1.ListIndexesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListIndexesRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a ListIndexesResponse. */ - interface IListIndexesResponse { - - /** ListIndexesResponse indexes */ - indexes?: (google.firestore.admin.v1.IIndex[]|null); - - /** ListIndexesResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListIndexesResponse. */ - class ListIndexesResponse implements IListIndexesResponse { - - /** - * Constructs a new ListIndexesResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.firestore.admin.v1.IListIndexesResponse); - - /** ListIndexesResponse indexes. */ - public indexes: google.firestore.admin.v1.IIndex[]; - - /** ListIndexesResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a ListIndexesResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListIndexesResponse - */ - public static fromObject(object: { [k: string]: any }): google.firestore.admin.v1.ListIndexesResponse; - - /** - * Creates a plain object from a ListIndexesResponse message. Also converts values to other types if specified. - * @param message ListIndexesResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.admin.v1.ListIndexesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListIndexesResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a GetIndexRequest. */ - interface IGetIndexRequest { - - /** GetIndexRequest name */ - name?: (string|null); - } - - /** Represents a GetIndexRequest. */ - class GetIndexRequest implements IGetIndexRequest { - - /** - * Constructs a new GetIndexRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.firestore.admin.v1.IGetIndexRequest); - - /** GetIndexRequest name. */ - public name: string; - - /** - * Creates a GetIndexRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetIndexRequest - */ - public static fromObject(object: { [k: string]: any }): google.firestore.admin.v1.GetIndexRequest; - - /** - * Creates a plain object from a GetIndexRequest message. Also converts values to other types if specified. - * @param message GetIndexRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.admin.v1.GetIndexRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetIndexRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a DeleteIndexRequest. */ - interface IDeleteIndexRequest { - - /** DeleteIndexRequest name */ - name?: (string|null); - } - - /** Represents a DeleteIndexRequest. */ - class DeleteIndexRequest implements IDeleteIndexRequest { - - /** - * Constructs a new DeleteIndexRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.firestore.admin.v1.IDeleteIndexRequest); - - /** DeleteIndexRequest name. */ - public name: string; - - /** - * Creates a DeleteIndexRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteIndexRequest - */ - public static fromObject(object: { [k: string]: any }): google.firestore.admin.v1.DeleteIndexRequest; - - /** - * Creates a plain object from a DeleteIndexRequest message. Also converts values to other types if specified. - * @param message DeleteIndexRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.admin.v1.DeleteIndexRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteIndexRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of an UpdateFieldRequest. */ - interface IUpdateFieldRequest { - - /** UpdateFieldRequest field */ - field?: (google.firestore.admin.v1.IField|null); - - /** UpdateFieldRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); - } - - /** Represents an UpdateFieldRequest. */ - class UpdateFieldRequest implements IUpdateFieldRequest { - - /** - * Constructs a new UpdateFieldRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.firestore.admin.v1.IUpdateFieldRequest); - - /** UpdateFieldRequest field. */ - public field?: (google.firestore.admin.v1.IField|null); - - /** UpdateFieldRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); - - /** - * Creates an UpdateFieldRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateFieldRequest - */ - public static fromObject(object: { [k: string]: any }): google.firestore.admin.v1.UpdateFieldRequest; - - /** - * Creates a plain object from an UpdateFieldRequest message. Also converts values to other types if specified. - * @param message UpdateFieldRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.admin.v1.UpdateFieldRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateFieldRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a GetFieldRequest. */ - interface IGetFieldRequest { - - /** GetFieldRequest name */ - name?: (string|null); - } - - /** Represents a GetFieldRequest. */ - class GetFieldRequest implements IGetFieldRequest { - - /** - * Constructs a new GetFieldRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.firestore.admin.v1.IGetFieldRequest); - - /** GetFieldRequest name. */ - public name: string; - - /** - * Creates a GetFieldRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetFieldRequest - */ - public static fromObject(object: { [k: string]: any }): google.firestore.admin.v1.GetFieldRequest; - - /** - * Creates a plain object from a GetFieldRequest message. Also converts values to other types if specified. - * @param message GetFieldRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.admin.v1.GetFieldRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetFieldRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a ListFieldsRequest. */ - interface IListFieldsRequest { - - /** ListFieldsRequest parent */ - parent?: (string|null); - - /** ListFieldsRequest filter */ - filter?: (string|null); - - /** ListFieldsRequest pageSize */ - pageSize?: (number|null); - - /** ListFieldsRequest pageToken */ - pageToken?: (string|null); - } - - /** Represents a ListFieldsRequest. */ - class ListFieldsRequest implements IListFieldsRequest { - - /** - * Constructs a new ListFieldsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.firestore.admin.v1.IListFieldsRequest); - - /** ListFieldsRequest parent. */ - public parent: string; - - /** ListFieldsRequest filter. */ - public filter: string; - - /** ListFieldsRequest pageSize. */ - public pageSize: number; - - /** ListFieldsRequest pageToken. */ - public pageToken: string; - - /** - * Creates a ListFieldsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListFieldsRequest - */ - public static fromObject(object: { [k: string]: any }): google.firestore.admin.v1.ListFieldsRequest; - - /** - * Creates a plain object from a ListFieldsRequest message. Also converts values to other types if specified. - * @param message ListFieldsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.admin.v1.ListFieldsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListFieldsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a ListFieldsResponse. */ - interface IListFieldsResponse { - - /** ListFieldsResponse fields */ - fields?: (google.firestore.admin.v1.IField[]|null); - - /** ListFieldsResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListFieldsResponse. */ - class ListFieldsResponse implements IListFieldsResponse { - - /** - * Constructs a new ListFieldsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.firestore.admin.v1.IListFieldsResponse); - - /** ListFieldsResponse fields. */ - public fields: google.firestore.admin.v1.IField[]; - - /** ListFieldsResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a ListFieldsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListFieldsResponse - */ - public static fromObject(object: { [k: string]: any }): google.firestore.admin.v1.ListFieldsResponse; - - /** - * Creates a plain object from a ListFieldsResponse message. Also converts values to other types if specified. - * @param message ListFieldsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.admin.v1.ListFieldsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListFieldsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of an ExportDocumentsRequest. */ - interface IExportDocumentsRequest { - - /** ExportDocumentsRequest name */ - name?: (string|null); - - /** ExportDocumentsRequest collectionIds */ - collectionIds?: (string[]|null); - - /** ExportDocumentsRequest outputUriPrefix */ - outputUriPrefix?: (string|null); - } - - /** Represents an ExportDocumentsRequest. */ - class ExportDocumentsRequest implements IExportDocumentsRequest { - - /** - * Constructs a new ExportDocumentsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.firestore.admin.v1.IExportDocumentsRequest); - - /** ExportDocumentsRequest name. */ - public name: string; - - /** ExportDocumentsRequest collectionIds. */ - public collectionIds: string[]; - - /** ExportDocumentsRequest outputUriPrefix. */ - public outputUriPrefix: string; - - /** - * Creates an ExportDocumentsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ExportDocumentsRequest - */ - public static fromObject(object: { [k: string]: any }): google.firestore.admin.v1.ExportDocumentsRequest; - - /** - * Creates a plain object from an ExportDocumentsRequest message. Also converts values to other types if specified. - * @param message ExportDocumentsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.admin.v1.ExportDocumentsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ExportDocumentsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of an ImportDocumentsRequest. */ - interface IImportDocumentsRequest { - - /** ImportDocumentsRequest name */ - name?: (string|null); - - /** ImportDocumentsRequest collectionIds */ - collectionIds?: (string[]|null); - - /** ImportDocumentsRequest inputUriPrefix */ - inputUriPrefix?: (string|null); - } - - /** Represents an ImportDocumentsRequest. */ - class ImportDocumentsRequest implements IImportDocumentsRequest { - - /** - * Constructs a new ImportDocumentsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.firestore.admin.v1.IImportDocumentsRequest); - - /** ImportDocumentsRequest name. */ - public name: string; - - /** ImportDocumentsRequest collectionIds. */ - public collectionIds: string[]; - - /** ImportDocumentsRequest inputUriPrefix. */ - public inputUriPrefix: string; - - /** - * Creates an ImportDocumentsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ImportDocumentsRequest - */ - public static fromObject(object: { [k: string]: any }): google.firestore.admin.v1.ImportDocumentsRequest; - - /** - * Creates a plain object from an ImportDocumentsRequest message. Also converts values to other types if specified. - * @param message ImportDocumentsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.admin.v1.ImportDocumentsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ImportDocumentsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of an Index. */ - interface IIndex { - - /** Index name */ - name?: (string|null); - - /** Index queryScope */ - queryScope?: (google.firestore.admin.v1.Index.QueryScope|null); - - /** Index fields */ - fields?: (google.firestore.admin.v1.Index.IIndexField[]|null); - - /** Index state */ - state?: (google.firestore.admin.v1.Index.State|null); - } - - /** Represents an Index. */ - class Index implements IIndex { - - /** - * Constructs a new Index. - * @param [properties] Properties to set - */ - constructor(properties?: google.firestore.admin.v1.IIndex); - - /** Index name. */ - public name: string; - - /** Index queryScope. */ - public queryScope: google.firestore.admin.v1.Index.QueryScope; - - /** Index fields. */ - public fields: google.firestore.admin.v1.Index.IIndexField[]; - - /** Index state. */ - public state: google.firestore.admin.v1.Index.State; - - /** - * Creates an Index message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Index - */ - public static fromObject(object: { [k: string]: any }): google.firestore.admin.v1.Index; - - /** - * Creates a plain object from an Index message. Also converts values to other types if specified. - * @param message Index - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.admin.v1.Index, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Index to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - namespace Index { - - /** Properties of an IndexField. */ - interface IIndexField { - - /** IndexField fieldPath */ - fieldPath?: (string|null); - - /** IndexField order */ - order?: (google.firestore.admin.v1.Index.IndexField.Order|null); - - /** IndexField arrayConfig */ - arrayConfig?: (google.firestore.admin.v1.Index.IndexField.ArrayConfig|null); - } - - /** Represents an IndexField. */ - class IndexField implements IIndexField { - - /** - * Constructs a new IndexField. - * @param [properties] Properties to set - */ - constructor(properties?: google.firestore.admin.v1.Index.IIndexField); - - /** IndexField fieldPath. */ - public fieldPath: string; - - /** IndexField order. */ - public order?: (google.firestore.admin.v1.Index.IndexField.Order|null); - - /** IndexField arrayConfig. */ - public arrayConfig?: (google.firestore.admin.v1.Index.IndexField.ArrayConfig|null); - - /** IndexField valueMode. */ - public valueMode?: ("order"|"arrayConfig"); - - /** - * Creates an IndexField message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns IndexField - */ - public static fromObject(object: { [k: string]: any }): google.firestore.admin.v1.Index.IndexField; - - /** - * Creates a plain object from an IndexField message. Also converts values to other types if specified. - * @param message IndexField - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.admin.v1.Index.IndexField, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this IndexField to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - namespace IndexField { - - /** Order enum. */ - type Order = - "ORDER_UNSPECIFIED"| "ASCENDING"| "DESCENDING"; - - /** ArrayConfig enum. */ - type ArrayConfig = - "ARRAY_CONFIG_UNSPECIFIED"| "CONTAINS"; - } - - /** QueryScope enum. */ - type QueryScope = - "QUERY_SCOPE_UNSPECIFIED"| "COLLECTION"| "COLLECTION_GROUP"; - - /** State enum. */ - type State = - "STATE_UNSPECIFIED"| "CREATING"| "READY"| "NEEDS_REPAIR"; - } - - /** Properties of a LocationMetadata. */ - interface ILocationMetadata { - } - - /** Represents a LocationMetadata. */ - class LocationMetadata implements ILocationMetadata { - - /** - * Constructs a new LocationMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.firestore.admin.v1.ILocationMetadata); - - /** - * Creates a LocationMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns LocationMetadata - */ - public static fromObject(object: { [k: string]: any }): google.firestore.admin.v1.LocationMetadata; - - /** - * Creates a plain object from a LocationMetadata message. Also converts values to other types if specified. - * @param message LocationMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.admin.v1.LocationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this LocationMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of an IndexOperationMetadata. */ - interface IIndexOperationMetadata { - - /** IndexOperationMetadata startTime */ - startTime?: (google.protobuf.ITimestamp|null); - - /** IndexOperationMetadata endTime */ - endTime?: (google.protobuf.ITimestamp|null); - - /** IndexOperationMetadata index */ - index?: (string|null); - - /** IndexOperationMetadata state */ - state?: (google.firestore.admin.v1.OperationState|null); - - /** IndexOperationMetadata progressDocuments */ - progressDocuments?: (google.firestore.admin.v1.IProgress|null); - - /** IndexOperationMetadata progressBytes */ - progressBytes?: (google.firestore.admin.v1.IProgress|null); - } - - /** Represents an IndexOperationMetadata. */ - class IndexOperationMetadata implements IIndexOperationMetadata { - - /** - * Constructs a new IndexOperationMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.firestore.admin.v1.IIndexOperationMetadata); - - /** IndexOperationMetadata startTime. */ - public startTime?: (google.protobuf.ITimestamp|null); - - /** IndexOperationMetadata endTime. */ - public endTime?: (google.protobuf.ITimestamp|null); - - /** IndexOperationMetadata index. */ - public index: string; - - /** IndexOperationMetadata state. */ - public state: google.firestore.admin.v1.OperationState; - - /** IndexOperationMetadata progressDocuments. */ - public progressDocuments?: (google.firestore.admin.v1.IProgress|null); - - /** IndexOperationMetadata progressBytes. */ - public progressBytes?: (google.firestore.admin.v1.IProgress|null); - - /** - * Creates an IndexOperationMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns IndexOperationMetadata - */ - public static fromObject(object: { [k: string]: any }): google.firestore.admin.v1.IndexOperationMetadata; - - /** - * Creates a plain object from an IndexOperationMetadata message. Also converts values to other types if specified. - * @param message IndexOperationMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.admin.v1.IndexOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this IndexOperationMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a FieldOperationMetadata. */ - interface IFieldOperationMetadata { - - /** FieldOperationMetadata startTime */ - startTime?: (google.protobuf.ITimestamp|null); - - /** FieldOperationMetadata endTime */ - endTime?: (google.protobuf.ITimestamp|null); - - /** FieldOperationMetadata field */ - field?: (string|null); - - /** FieldOperationMetadata indexConfigDeltas */ - indexConfigDeltas?: (google.firestore.admin.v1.FieldOperationMetadata.IIndexConfigDelta[]|null); - - /** FieldOperationMetadata state */ - state?: (google.firestore.admin.v1.OperationState|null); - - /** FieldOperationMetadata progressDocuments */ - progressDocuments?: (google.firestore.admin.v1.IProgress|null); - - /** FieldOperationMetadata progressBytes */ - progressBytes?: (google.firestore.admin.v1.IProgress|null); - } - - /** Represents a FieldOperationMetadata. */ - class FieldOperationMetadata implements IFieldOperationMetadata { - - /** - * Constructs a new FieldOperationMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.firestore.admin.v1.IFieldOperationMetadata); - - /** FieldOperationMetadata startTime. */ - public startTime?: (google.protobuf.ITimestamp|null); - - /** FieldOperationMetadata endTime. */ - public endTime?: (google.protobuf.ITimestamp|null); - - /** FieldOperationMetadata field. */ - public field: string; - - /** FieldOperationMetadata indexConfigDeltas. */ - public indexConfigDeltas: google.firestore.admin.v1.FieldOperationMetadata.IIndexConfigDelta[]; - - /** FieldOperationMetadata state. */ - public state: google.firestore.admin.v1.OperationState; - - /** FieldOperationMetadata progressDocuments. */ - public progressDocuments?: (google.firestore.admin.v1.IProgress|null); - - /** FieldOperationMetadata progressBytes. */ - public progressBytes?: (google.firestore.admin.v1.IProgress|null); - - /** - * Creates a FieldOperationMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FieldOperationMetadata - */ - public static fromObject(object: { [k: string]: any }): google.firestore.admin.v1.FieldOperationMetadata; - - /** - * Creates a plain object from a FieldOperationMetadata message. Also converts values to other types if specified. - * @param message FieldOperationMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.admin.v1.FieldOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FieldOperationMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - namespace FieldOperationMetadata { - - /** Properties of an IndexConfigDelta. */ - interface IIndexConfigDelta { - - /** IndexConfigDelta changeType */ - changeType?: (google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta.ChangeType|null); - - /** IndexConfigDelta index */ - index?: (google.firestore.admin.v1.IIndex|null); - } - - /** Represents an IndexConfigDelta. */ - class IndexConfigDelta implements IIndexConfigDelta { - - /** - * Constructs a new IndexConfigDelta. - * @param [properties] Properties to set - */ - constructor(properties?: google.firestore.admin.v1.FieldOperationMetadata.IIndexConfigDelta); - - /** IndexConfigDelta changeType. */ - public changeType: google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta.ChangeType; - - /** IndexConfigDelta index. */ - public index?: (google.firestore.admin.v1.IIndex|null); - - /** - * Creates an IndexConfigDelta message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns IndexConfigDelta - */ - public static fromObject(object: { [k: string]: any }): google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta; - - /** - * Creates a plain object from an IndexConfigDelta message. Also converts values to other types if specified. - * @param message IndexConfigDelta - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this IndexConfigDelta to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - namespace IndexConfigDelta { - - /** ChangeType enum. */ - type ChangeType = - "CHANGE_TYPE_UNSPECIFIED"| "ADD"| "REMOVE"; - } - } - - /** Properties of an ExportDocumentsMetadata. */ - interface IExportDocumentsMetadata { - - /** ExportDocumentsMetadata startTime */ - startTime?: (google.protobuf.ITimestamp|null); - - /** ExportDocumentsMetadata endTime */ - endTime?: (google.protobuf.ITimestamp|null); - - /** ExportDocumentsMetadata operationState */ - operationState?: (google.firestore.admin.v1.OperationState|null); - - /** ExportDocumentsMetadata progressDocuments */ - progressDocuments?: (google.firestore.admin.v1.IProgress|null); - - /** ExportDocumentsMetadata progressBytes */ - progressBytes?: (google.firestore.admin.v1.IProgress|null); - - /** ExportDocumentsMetadata collectionIds */ - collectionIds?: (string[]|null); - - /** ExportDocumentsMetadata outputUriPrefix */ - outputUriPrefix?: (string|null); - } - - /** Represents an ExportDocumentsMetadata. */ - class ExportDocumentsMetadata implements IExportDocumentsMetadata { - - /** - * Constructs a new ExportDocumentsMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.firestore.admin.v1.IExportDocumentsMetadata); - - /** ExportDocumentsMetadata startTime. */ - public startTime?: (google.protobuf.ITimestamp|null); - - /** ExportDocumentsMetadata endTime. */ - public endTime?: (google.protobuf.ITimestamp|null); - - /** ExportDocumentsMetadata operationState. */ - public operationState: google.firestore.admin.v1.OperationState; - - /** ExportDocumentsMetadata progressDocuments. */ - public progressDocuments?: (google.firestore.admin.v1.IProgress|null); - - /** ExportDocumentsMetadata progressBytes. */ - public progressBytes?: (google.firestore.admin.v1.IProgress|null); - - /** ExportDocumentsMetadata collectionIds. */ - public collectionIds: string[]; - - /** ExportDocumentsMetadata outputUriPrefix. */ - public outputUriPrefix: string; - - /** - * Creates an ExportDocumentsMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ExportDocumentsMetadata - */ - public static fromObject(object: { [k: string]: any }): google.firestore.admin.v1.ExportDocumentsMetadata; - - /** - * Creates a plain object from an ExportDocumentsMetadata message. Also converts values to other types if specified. - * @param message ExportDocumentsMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.admin.v1.ExportDocumentsMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ExportDocumentsMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of an ImportDocumentsMetadata. */ - interface IImportDocumentsMetadata { - - /** ImportDocumentsMetadata startTime */ - startTime?: (google.protobuf.ITimestamp|null); - - /** ImportDocumentsMetadata endTime */ - endTime?: (google.protobuf.ITimestamp|null); - - /** ImportDocumentsMetadata operationState */ - operationState?: (google.firestore.admin.v1.OperationState|null); - - /** ImportDocumentsMetadata progressDocuments */ - progressDocuments?: (google.firestore.admin.v1.IProgress|null); - - /** ImportDocumentsMetadata progressBytes */ - progressBytes?: (google.firestore.admin.v1.IProgress|null); - - /** ImportDocumentsMetadata collectionIds */ - collectionIds?: (string[]|null); - - /** ImportDocumentsMetadata inputUriPrefix */ - inputUriPrefix?: (string|null); - } - - /** Represents an ImportDocumentsMetadata. */ - class ImportDocumentsMetadata implements IImportDocumentsMetadata { - - /** - * Constructs a new ImportDocumentsMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.firestore.admin.v1.IImportDocumentsMetadata); - - /** ImportDocumentsMetadata startTime. */ - public startTime?: (google.protobuf.ITimestamp|null); - - /** ImportDocumentsMetadata endTime. */ - public endTime?: (google.protobuf.ITimestamp|null); - - /** ImportDocumentsMetadata operationState. */ - public operationState: google.firestore.admin.v1.OperationState; - - /** ImportDocumentsMetadata progressDocuments. */ - public progressDocuments?: (google.firestore.admin.v1.IProgress|null); - - /** ImportDocumentsMetadata progressBytes. */ - public progressBytes?: (google.firestore.admin.v1.IProgress|null); - - /** ImportDocumentsMetadata collectionIds. */ - public collectionIds: string[]; - - /** ImportDocumentsMetadata inputUriPrefix. */ - public inputUriPrefix: string; - - /** - * Creates an ImportDocumentsMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ImportDocumentsMetadata - */ - public static fromObject(object: { [k: string]: any }): google.firestore.admin.v1.ImportDocumentsMetadata; - - /** - * Creates a plain object from an ImportDocumentsMetadata message. Also converts values to other types if specified. - * @param message ImportDocumentsMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.admin.v1.ImportDocumentsMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ImportDocumentsMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of an ExportDocumentsResponse. */ - interface IExportDocumentsResponse { - - /** ExportDocumentsResponse outputUriPrefix */ - outputUriPrefix?: (string|null); - } - - /** Represents an ExportDocumentsResponse. */ - class ExportDocumentsResponse implements IExportDocumentsResponse { - - /** - * Constructs a new ExportDocumentsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.firestore.admin.v1.IExportDocumentsResponse); - - /** ExportDocumentsResponse outputUriPrefix. */ - public outputUriPrefix: string; - - /** - * Creates an ExportDocumentsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ExportDocumentsResponse - */ - public static fromObject(object: { [k: string]: any }): google.firestore.admin.v1.ExportDocumentsResponse; - - /** - * Creates a plain object from an ExportDocumentsResponse message. Also converts values to other types if specified. - * @param message ExportDocumentsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.admin.v1.ExportDocumentsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ExportDocumentsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** OperationState enum. */ - type OperationState = - "OPERATION_STATE_UNSPECIFIED"| "INITIALIZING"| "PROCESSING"| "CANCELLING"| "FINALIZING"| "SUCCESSFUL"| "FAILED"| "CANCELLED"; - - /** Properties of a Progress. */ - interface IProgress { - - /** Progress estimatedWork */ - estimatedWork?: (number|string|null); - - /** Progress completedWork */ - completedWork?: (number|string|null); - } - - /** Represents a Progress. */ - class Progress implements IProgress { - - /** - * Constructs a new Progress. - * @param [properties] Properties to set - */ - constructor(properties?: google.firestore.admin.v1.IProgress); - - /** Progress estimatedWork. */ - public estimatedWork: (number|string); - - /** Progress completedWork. */ - public completedWork: (number|string); - - /** - * Creates a Progress message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Progress - */ - public static fromObject(object: { [k: string]: any }): google.firestore.admin.v1.Progress; - - /** - * Creates a plain object from a Progress message. Also converts values to other types if specified. - * @param message Progress - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.admin.v1.Progress, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Progress to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } - } - } - - /** Namespace api. */ - namespace api { - - /** Properties of a Http. */ - interface IHttp { - - /** Http rules */ - rules?: (google.api.IHttpRule[]|null); - } - - /** Represents a Http. */ - class Http implements IHttp { - - /** - * Constructs a new Http. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IHttp); - - /** Http rules. */ - public rules: google.api.IHttpRule[]; - - /** - * Creates a Http message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Http - */ - public static fromObject(object: { [k: string]: any }): google.api.Http; - - /** - * Creates a plain object from a Http message. Also converts values to other types if specified. - * @param message Http - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.Http, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Http to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a HttpRule. */ - interface IHttpRule { - - /** HttpRule get */ - get?: (string|null); - - /** HttpRule put */ - put?: (string|null); - - /** HttpRule post */ - post?: (string|null); - - /** HttpRule delete */ - "delete"?: (string|null); - - /** HttpRule patch */ - patch?: (string|null); - - /** HttpRule custom */ - custom?: (google.api.ICustomHttpPattern|null); - - /** HttpRule selector */ - selector?: (string|null); - - /** HttpRule body */ - body?: (string|null); - - /** HttpRule additionalBindings */ - additionalBindings?: (google.api.IHttpRule[]|null); - } - - /** Represents a HttpRule. */ - class HttpRule implements IHttpRule { - - /** - * Constructs a new HttpRule. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IHttpRule); - - /** HttpRule get. */ - public get?: (string|null); - - /** HttpRule put. */ - public put?: (string|null); - - /** HttpRule post. */ - public post?: (string|null); - - /** HttpRule delete. */ - public delete?: (string|null); - - /** HttpRule patch. */ - public patch?: (string|null); - - /** HttpRule custom. */ - public custom?: (google.api.ICustomHttpPattern|null); - - /** HttpRule selector. */ - public selector: string; - - /** HttpRule body. */ - public body: string; - - /** HttpRule additionalBindings. */ - public additionalBindings: google.api.IHttpRule[]; - - /** HttpRule pattern. */ - public pattern?: ("get"|"put"|"post"|"delete"|"patch"|"custom"); - - /** - * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns HttpRule - */ - public static fromObject(object: { [k: string]: any }): google.api.HttpRule; - - /** - * Creates a plain object from a HttpRule message. Also converts values to other types if specified. - * @param message HttpRule - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.HttpRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this HttpRule to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a CustomHttpPattern. */ - interface ICustomHttpPattern { - - /** CustomHttpPattern kind */ - kind?: (string|null); - - /** CustomHttpPattern path */ - path?: (string|null); - } - - /** Represents a CustomHttpPattern. */ - class CustomHttpPattern implements ICustomHttpPattern { - - /** - * Constructs a new CustomHttpPattern. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.ICustomHttpPattern); - - /** CustomHttpPattern kind. */ - public kind: string; - - /** CustomHttpPattern path. */ - public path: string; - - /** - * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CustomHttpPattern - */ - public static fromObject(object: { [k: string]: any }): google.api.CustomHttpPattern; - - /** - * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. - * @param message CustomHttpPattern - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.CustomHttpPattern, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CustomHttpPattern to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** FieldBehavior enum. */ - type FieldBehavior = - "FIELD_BEHAVIOR_UNSPECIFIED"| "OPTIONAL"| "REQUIRED"| "OUTPUT_ONLY"| "INPUT_ONLY"| "IMMUTABLE"| "UNORDERED_LIST"| "NON_EMPTY_DEFAULT"; - - /** Properties of a ResourceDescriptor. */ - interface IResourceDescriptor { - - /** ResourceDescriptor type */ - type?: (string|null); - - /** ResourceDescriptor pattern */ - pattern?: (string[]|null); - - /** ResourceDescriptor nameField */ - nameField?: (string|null); - - /** ResourceDescriptor history */ - history?: (google.api.ResourceDescriptor.History|null); - - /** ResourceDescriptor plural */ - plural?: (string|null); - - /** ResourceDescriptor singular */ - singular?: (string|null); - - /** ResourceDescriptor style */ - style?: (google.api.ResourceDescriptor.Style[]|null); - } - - /** Represents a ResourceDescriptor. */ - class ResourceDescriptor implements IResourceDescriptor { - - /** - * Constructs a new ResourceDescriptor. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IResourceDescriptor); - - /** ResourceDescriptor type. */ - public type: string; - - /** ResourceDescriptor pattern. */ - public pattern: string[]; - - /** ResourceDescriptor nameField. */ - public nameField: string; - - /** ResourceDescriptor history. */ - public history: google.api.ResourceDescriptor.History; - - /** ResourceDescriptor plural. */ - public plural: string; - - /** ResourceDescriptor singular. */ - public singular: string; - - /** ResourceDescriptor style. */ - public style: google.api.ResourceDescriptor.Style[]; - - /** - * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ResourceDescriptor - */ - public static fromObject(object: { [k: string]: any }): google.api.ResourceDescriptor; - - /** - * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. - * @param message ResourceDescriptor - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.ResourceDescriptor, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ResourceDescriptor to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - namespace ResourceDescriptor { - - /** History enum. */ - type History = - "HISTORY_UNSPECIFIED"| "ORIGINALLY_SINGLE_PATTERN"| "FUTURE_MULTI_PATTERN"; - - /** Style enum. */ - type Style = - "STYLE_UNSPECIFIED"| "DECLARATIVE_FRIENDLY"; - } - - /** Properties of a ResourceReference. */ - interface IResourceReference { - - /** ResourceReference type */ - type?: (string|null); - - /** ResourceReference childType */ - childType?: (string|null); - } - - /** Represents a ResourceReference. */ - class ResourceReference implements IResourceReference { - - /** - * Constructs a new ResourceReference. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IResourceReference); - - /** ResourceReference type. */ - public type: string; - - /** ResourceReference childType. */ - public childType: string; - - /** - * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ResourceReference - */ - public static fromObject(object: { [k: string]: any }): google.api.ResourceReference; - - /** - * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. - * @param message ResourceReference - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.ResourceReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ResourceReference to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } - - /** Namespace protobuf. */ - namespace protobuf { - - /** Properties of a FileDescriptorSet. */ - interface IFileDescriptorSet { - - /** FileDescriptorSet file */ - file?: (google.protobuf.IFileDescriptorProto[]|null); - } - - /** Represents a FileDescriptorSet. */ - class FileDescriptorSet implements IFileDescriptorSet { - - /** - * Constructs a new FileDescriptorSet. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFileDescriptorSet); - - /** FileDescriptorSet file. */ - public file: google.protobuf.IFileDescriptorProto[]; - - /** - * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FileDescriptorSet - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorSet; - - /** - * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. - * @param message FileDescriptorSet - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FileDescriptorSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FileDescriptorSet to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a FileDescriptorProto. */ - interface IFileDescriptorProto { - - /** FileDescriptorProto name */ - name?: (string|null); - - /** FileDescriptorProto package */ - "package"?: (string|null); - - /** FileDescriptorProto dependency */ - dependency?: (string[]|null); - - /** FileDescriptorProto publicDependency */ - publicDependency?: (number[]|null); - - /** FileDescriptorProto weakDependency */ - weakDependency?: (number[]|null); - - /** FileDescriptorProto messageType */ - messageType?: (google.protobuf.IDescriptorProto[]|null); - - /** FileDescriptorProto enumType */ - enumType?: (google.protobuf.IEnumDescriptorProto[]|null); - - /** FileDescriptorProto service */ - service?: (google.protobuf.IServiceDescriptorProto[]|null); - - /** FileDescriptorProto extension */ - extension?: (google.protobuf.IFieldDescriptorProto[]|null); - - /** FileDescriptorProto options */ - options?: (google.protobuf.IFileOptions|null); - - /** FileDescriptorProto sourceCodeInfo */ - sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); - - /** FileDescriptorProto syntax */ - syntax?: (string|null); - } - - /** Represents a FileDescriptorProto. */ - class FileDescriptorProto implements IFileDescriptorProto { - - /** - * Constructs a new FileDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFileDescriptorProto); - - /** FileDescriptorProto name. */ - public name: string; - - /** FileDescriptorProto package. */ - public package: string; - - /** FileDescriptorProto dependency. */ - public dependency: string[]; - - /** FileDescriptorProto publicDependency. */ - public publicDependency: number[]; - - /** FileDescriptorProto weakDependency. */ - public weakDependency: number[]; - - /** FileDescriptorProto messageType. */ - public messageType: google.protobuf.IDescriptorProto[]; - - /** FileDescriptorProto enumType. */ - public enumType: google.protobuf.IEnumDescriptorProto[]; - - /** FileDescriptorProto service. */ - public service: google.protobuf.IServiceDescriptorProto[]; - - /** FileDescriptorProto extension. */ - public extension: google.protobuf.IFieldDescriptorProto[]; - - /** FileDescriptorProto options. */ - public options?: (google.protobuf.IFileOptions|null); - - /** FileDescriptorProto sourceCodeInfo. */ - public sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); - - /** FileDescriptorProto syntax. */ - public syntax: string; - - /** - * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FileDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorProto; - - /** - * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. - * @param message FileDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FileDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FileDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a DescriptorProto. */ - interface IDescriptorProto { - - /** DescriptorProto name */ - name?: (string|null); - - /** DescriptorProto field */ - field?: (google.protobuf.IFieldDescriptorProto[]|null); - - /** DescriptorProto extension */ - extension?: (google.protobuf.IFieldDescriptorProto[]|null); - - /** DescriptorProto nestedType */ - nestedType?: (google.protobuf.IDescriptorProto[]|null); - - /** DescriptorProto enumType */ - enumType?: (google.protobuf.IEnumDescriptorProto[]|null); - - /** DescriptorProto extensionRange */ - extensionRange?: (google.protobuf.DescriptorProto.IExtensionRange[]|null); - - /** DescriptorProto oneofDecl */ - oneofDecl?: (google.protobuf.IOneofDescriptorProto[]|null); - - /** DescriptorProto options */ - options?: (google.protobuf.IMessageOptions|null); - - /** DescriptorProto reservedRange */ - reservedRange?: (google.protobuf.DescriptorProto.IReservedRange[]|null); - - /** DescriptorProto reservedName */ - reservedName?: (string[]|null); - } - - /** Represents a DescriptorProto. */ - class DescriptorProto implements IDescriptorProto { - - /** - * Constructs a new DescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IDescriptorProto); - - /** DescriptorProto name. */ - public name: string; - - /** DescriptorProto field. */ - public field: google.protobuf.IFieldDescriptorProto[]; - - /** DescriptorProto extension. */ - public extension: google.protobuf.IFieldDescriptorProto[]; - - /** DescriptorProto nestedType. */ - public nestedType: google.protobuf.IDescriptorProto[]; - - /** DescriptorProto enumType. */ - public enumType: google.protobuf.IEnumDescriptorProto[]; - - /** DescriptorProto extensionRange. */ - public extensionRange: google.protobuf.DescriptorProto.IExtensionRange[]; - - /** DescriptorProto oneofDecl. */ - public oneofDecl: google.protobuf.IOneofDescriptorProto[]; - - /** DescriptorProto options. */ - public options?: (google.protobuf.IMessageOptions|null); - - /** DescriptorProto reservedRange. */ - public reservedRange: google.protobuf.DescriptorProto.IReservedRange[]; - - /** DescriptorProto reservedName. */ - public reservedName: string[]; - - /** - * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto; - - /** - * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. - * @param message DescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.DescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - namespace DescriptorProto { - - /** Properties of an ExtensionRange. */ - interface IExtensionRange { - - /** ExtensionRange start */ - start?: (number|null); - - /** ExtensionRange end */ - end?: (number|null); - } - - /** Represents an ExtensionRange. */ - class ExtensionRange implements IExtensionRange { - - /** - * Constructs a new ExtensionRange. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.DescriptorProto.IExtensionRange); - - /** ExtensionRange start. */ - public start: number; - - /** ExtensionRange end. */ - public end: number; - - /** - * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ExtensionRange - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ExtensionRange; - - /** - * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. - * @param message ExtensionRange - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.DescriptorProto.ExtensionRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ExtensionRange to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a ReservedRange. */ - interface IReservedRange { - - /** ReservedRange start */ - start?: (number|null); - - /** ReservedRange end */ - end?: (number|null); - } - - /** Represents a ReservedRange. */ - class ReservedRange implements IReservedRange { - - /** - * Constructs a new ReservedRange. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.DescriptorProto.IReservedRange); - - /** ReservedRange start. */ - public start: number; - - /** ReservedRange end. */ - public end: number; - - /** - * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ReservedRange - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ReservedRange; - - /** - * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. - * @param message ReservedRange - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.DescriptorProto.ReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ReservedRange to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } - - /** Properties of a FieldDescriptorProto. */ - interface IFieldDescriptorProto { - - /** FieldDescriptorProto name */ - name?: (string|null); - - /** FieldDescriptorProto number */ - number?: (number|null); - - /** FieldDescriptorProto label */ - label?: (google.protobuf.FieldDescriptorProto.Label|null); - - /** FieldDescriptorProto type */ - type?: (google.protobuf.FieldDescriptorProto.Type|null); - - /** FieldDescriptorProto typeName */ - typeName?: (string|null); - - /** FieldDescriptorProto extendee */ - extendee?: (string|null); - - /** FieldDescriptorProto defaultValue */ - defaultValue?: (string|null); - - /** FieldDescriptorProto oneofIndex */ - oneofIndex?: (number|null); - - /** FieldDescriptorProto jsonName */ - jsonName?: (string|null); - - /** FieldDescriptorProto options */ - options?: (google.protobuf.IFieldOptions|null); - } - - /** Represents a FieldDescriptorProto. */ - class FieldDescriptorProto implements IFieldDescriptorProto { - - /** - * Constructs a new FieldDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFieldDescriptorProto); - - /** FieldDescriptorProto name. */ - public name: string; - - /** FieldDescriptorProto number. */ - public number: number; - - /** FieldDescriptorProto label. */ - public label: google.protobuf.FieldDescriptorProto.Label; - - /** FieldDescriptorProto type. */ - public type: google.protobuf.FieldDescriptorProto.Type; - - /** FieldDescriptorProto typeName. */ - public typeName: string; - - /** FieldDescriptorProto extendee. */ - public extendee: string; - - /** FieldDescriptorProto defaultValue. */ - public defaultValue: string; - - /** FieldDescriptorProto oneofIndex. */ - public oneofIndex: number; - - /** FieldDescriptorProto jsonName. */ - public jsonName: string; - - /** FieldDescriptorProto options. */ - public options?: (google.protobuf.IFieldOptions|null); - - /** - * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FieldDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FieldDescriptorProto; - - /** - * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. - * @param message FieldDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FieldDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FieldDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - namespace FieldDescriptorProto { - - /** Type enum. */ - type Type = - "TYPE_DOUBLE"| "TYPE_FLOAT"| "TYPE_INT64"| "TYPE_UINT64"| "TYPE_INT32"| "TYPE_FIXED64"| "TYPE_FIXED32"| "TYPE_BOOL"| "TYPE_STRING"| "TYPE_GROUP"| "TYPE_MESSAGE"| "TYPE_BYTES"| "TYPE_UINT32"| "TYPE_ENUM"| "TYPE_SFIXED32"| "TYPE_SFIXED64"| "TYPE_SINT32"| "TYPE_SINT64"; - - /** Label enum. */ - type Label = - "LABEL_OPTIONAL"| "LABEL_REQUIRED"| "LABEL_REPEATED"; - } - - /** Properties of an OneofDescriptorProto. */ - interface IOneofDescriptorProto { - - /** OneofDescriptorProto name */ - name?: (string|null); - - /** OneofDescriptorProto options */ - options?: (google.protobuf.IOneofOptions|null); - } - - /** Represents an OneofDescriptorProto. */ - class OneofDescriptorProto implements IOneofDescriptorProto { - - /** - * Constructs a new OneofDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IOneofDescriptorProto); - - /** OneofDescriptorProto name. */ - public name: string; - - /** OneofDescriptorProto options. */ - public options?: (google.protobuf.IOneofOptions|null); - - /** - * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns OneofDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.OneofDescriptorProto; - - /** - * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. - * @param message OneofDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.OneofDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this OneofDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of an EnumDescriptorProto. */ - interface IEnumDescriptorProto { - - /** EnumDescriptorProto name */ - name?: (string|null); - - /** EnumDescriptorProto value */ - value?: (google.protobuf.IEnumValueDescriptorProto[]|null); - - /** EnumDescriptorProto options */ - options?: (google.protobuf.IEnumOptions|null); - } - - /** Represents an EnumDescriptorProto. */ - class EnumDescriptorProto implements IEnumDescriptorProto { - - /** - * Constructs a new EnumDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IEnumDescriptorProto); - - /** EnumDescriptorProto name. */ - public name: string; - - /** EnumDescriptorProto value. */ - public value: google.protobuf.IEnumValueDescriptorProto[]; - - /** EnumDescriptorProto options. */ - public options?: (google.protobuf.IEnumOptions|null); - - /** - * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EnumDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto; - - /** - * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. - * @param message EnumDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.EnumDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EnumDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of an EnumValueDescriptorProto. */ - interface IEnumValueDescriptorProto { - - /** EnumValueDescriptorProto name */ - name?: (string|null); - - /** EnumValueDescriptorProto number */ - number?: (number|null); - - /** EnumValueDescriptorProto options */ - options?: (google.protobuf.IEnumValueOptions|null); - } - - /** Represents an EnumValueDescriptorProto. */ - class EnumValueDescriptorProto implements IEnumValueDescriptorProto { - - /** - * Constructs a new EnumValueDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IEnumValueDescriptorProto); - - /** EnumValueDescriptorProto name. */ - public name: string; - - /** EnumValueDescriptorProto number. */ - public number: number; - - /** EnumValueDescriptorProto options. */ - public options?: (google.protobuf.IEnumValueOptions|null); - - /** - * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EnumValueDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueDescriptorProto; - - /** - * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. - * @param message EnumValueDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.EnumValueDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EnumValueDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a ServiceDescriptorProto. */ - interface IServiceDescriptorProto { - - /** ServiceDescriptorProto name */ - name?: (string|null); - - /** ServiceDescriptorProto method */ - method?: (google.protobuf.IMethodDescriptorProto[]|null); - - /** ServiceDescriptorProto options */ - options?: (google.protobuf.IServiceOptions|null); - } - - /** Represents a ServiceDescriptorProto. */ - class ServiceDescriptorProto implements IServiceDescriptorProto { - - /** - * Constructs a new ServiceDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IServiceDescriptorProto); - - /** ServiceDescriptorProto name. */ - public name: string; - - /** ServiceDescriptorProto method. */ - public method: google.protobuf.IMethodDescriptorProto[]; - - /** ServiceDescriptorProto options. */ - public options?: (google.protobuf.IServiceOptions|null); - - /** - * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ServiceDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceDescriptorProto; - - /** - * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. - * @param message ServiceDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.ServiceDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ServiceDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a MethodDescriptorProto. */ - interface IMethodDescriptorProto { - - /** MethodDescriptorProto name */ - name?: (string|null); - - /** MethodDescriptorProto inputType */ - inputType?: (string|null); - - /** MethodDescriptorProto outputType */ - outputType?: (string|null); - - /** MethodDescriptorProto options */ - options?: (google.protobuf.IMethodOptions|null); - - /** MethodDescriptorProto clientStreaming */ - clientStreaming?: (boolean|null); - - /** MethodDescriptorProto serverStreaming */ - serverStreaming?: (boolean|null); - } - - /** Represents a MethodDescriptorProto. */ - class MethodDescriptorProto implements IMethodDescriptorProto { - - /** - * Constructs a new MethodDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IMethodDescriptorProto); - - /** MethodDescriptorProto name. */ - public name: string; - - /** MethodDescriptorProto inputType. */ - public inputType: string; - - /** MethodDescriptorProto outputType. */ - public outputType: string; - - /** MethodDescriptorProto options. */ - public options?: (google.protobuf.IMethodOptions|null); - - /** MethodDescriptorProto clientStreaming. */ - public clientStreaming: boolean; - - /** MethodDescriptorProto serverStreaming. */ - public serverStreaming: boolean; - - /** - * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MethodDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.MethodDescriptorProto; - - /** - * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. - * @param message MethodDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.MethodDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MethodDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a FileOptions. */ - interface IFileOptions { - - /** FileOptions javaPackage */ - javaPackage?: (string|null); - - /** FileOptions javaOuterClassname */ - javaOuterClassname?: (string|null); - - /** FileOptions javaMultipleFiles */ - javaMultipleFiles?: (boolean|null); - - /** FileOptions javaGenerateEqualsAndHash */ - javaGenerateEqualsAndHash?: (boolean|null); - - /** FileOptions javaStringCheckUtf8 */ - javaStringCheckUtf8?: (boolean|null); - - /** FileOptions optimizeFor */ - optimizeFor?: (google.protobuf.FileOptions.OptimizeMode|null); - - /** FileOptions goPackage */ - goPackage?: (string|null); - - /** FileOptions ccGenericServices */ - ccGenericServices?: (boolean|null); - - /** FileOptions javaGenericServices */ - javaGenericServices?: (boolean|null); - - /** FileOptions pyGenericServices */ - pyGenericServices?: (boolean|null); - - /** FileOptions deprecated */ - deprecated?: (boolean|null); - - /** FileOptions ccEnableArenas */ - ccEnableArenas?: (boolean|null); - - /** FileOptions objcClassPrefix */ - objcClassPrefix?: (string|null); - - /** FileOptions csharpNamespace */ - csharpNamespace?: (string|null); - - /** FileOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - - /** FileOptions .google.api.resourceDefinition */ - ".google.api.resourceDefinition"?: (google.api.IResourceDescriptor[]|null); - } - - /** Represents a FileOptions. */ - class FileOptions implements IFileOptions { - - /** - * Constructs a new FileOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFileOptions); - - /** FileOptions javaPackage. */ - public javaPackage: string; - - /** FileOptions javaOuterClassname. */ - public javaOuterClassname: string; - - /** FileOptions javaMultipleFiles. */ - public javaMultipleFiles: boolean; - - /** FileOptions javaGenerateEqualsAndHash. */ - public javaGenerateEqualsAndHash: boolean; - - /** FileOptions javaStringCheckUtf8. */ - public javaStringCheckUtf8: boolean; - - /** FileOptions optimizeFor. */ - public optimizeFor: google.protobuf.FileOptions.OptimizeMode; - - /** FileOptions goPackage. */ - public goPackage: string; - - /** FileOptions ccGenericServices. */ - public ccGenericServices: boolean; - - /** FileOptions javaGenericServices. */ - public javaGenericServices: boolean; - - /** FileOptions pyGenericServices. */ - public pyGenericServices: boolean; - - /** FileOptions deprecated. */ - public deprecated: boolean; - - /** FileOptions ccEnableArenas. */ - public ccEnableArenas: boolean; - - /** FileOptions objcClassPrefix. */ - public objcClassPrefix: string; - - /** FileOptions csharpNamespace. */ - public csharpNamespace: string; - - /** FileOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FileOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FileOptions; - - /** - * Creates a plain object from a FileOptions message. Also converts values to other types if specified. - * @param message FileOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FileOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FileOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - namespace FileOptions { - - /** OptimizeMode enum. */ - type OptimizeMode = - "SPEED"| "CODE_SIZE"| "LITE_RUNTIME"; - } - - /** Properties of a MessageOptions. */ - interface IMessageOptions { - - /** MessageOptions messageSetWireFormat */ - messageSetWireFormat?: (boolean|null); - - /** MessageOptions noStandardDescriptorAccessor */ - noStandardDescriptorAccessor?: (boolean|null); - - /** MessageOptions deprecated */ - deprecated?: (boolean|null); - - /** MessageOptions mapEntry */ - mapEntry?: (boolean|null); - - /** MessageOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - - /** MessageOptions .google.api.resource */ - ".google.api.resource"?: (google.api.IResourceDescriptor|null); - } - - /** Represents a MessageOptions. */ - class MessageOptions implements IMessageOptions { - - /** - * Constructs a new MessageOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IMessageOptions); - - /** MessageOptions messageSetWireFormat. */ - public messageSetWireFormat: boolean; - - /** MessageOptions noStandardDescriptorAccessor. */ - public noStandardDescriptorAccessor: boolean; - - /** MessageOptions deprecated. */ - public deprecated: boolean; - - /** MessageOptions mapEntry. */ - public mapEntry: boolean; - - /** MessageOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MessageOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.MessageOptions; - - /** - * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. - * @param message MessageOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.MessageOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MessageOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a FieldOptions. */ - interface IFieldOptions { - - /** FieldOptions ctype */ - ctype?: (google.protobuf.FieldOptions.CType|null); - - /** FieldOptions packed */ - packed?: (boolean|null); - - /** FieldOptions jstype */ - jstype?: (google.protobuf.FieldOptions.JSType|null); - - /** FieldOptions lazy */ - lazy?: (boolean|null); - - /** FieldOptions deprecated */ - deprecated?: (boolean|null); - - /** FieldOptions weak */ - weak?: (boolean|null); - - /** FieldOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - - /** FieldOptions .google.api.fieldBehavior */ - ".google.api.fieldBehavior"?: (google.api.FieldBehavior[]|null); - - /** FieldOptions .google.api.resourceReference */ - ".google.api.resourceReference"?: (google.api.IResourceReference|null); - } - - /** Represents a FieldOptions. */ - class FieldOptions implements IFieldOptions { - - /** - * Constructs a new FieldOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFieldOptions); - - /** FieldOptions ctype. */ - public ctype: google.protobuf.FieldOptions.CType; - - /** FieldOptions packed. */ - public packed: boolean; - - /** FieldOptions jstype. */ - public jstype: google.protobuf.FieldOptions.JSType; - - /** FieldOptions lazy. */ - public lazy: boolean; - - /** FieldOptions deprecated. */ - public deprecated: boolean; - - /** FieldOptions weak. */ - public weak: boolean; - - /** FieldOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FieldOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions; - - /** - * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. - * @param message FieldOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FieldOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FieldOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - namespace FieldOptions { - - /** CType enum. */ - type CType = - "STRING"| "CORD"| "STRING_PIECE"; - - /** JSType enum. */ - type JSType = - "JS_NORMAL"| "JS_STRING"| "JS_NUMBER"; - } - - /** Properties of an OneofOptions. */ - interface IOneofOptions { - - /** OneofOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - } - - /** Represents an OneofOptions. */ - class OneofOptions implements IOneofOptions { - - /** - * Constructs a new OneofOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IOneofOptions); - - /** OneofOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns OneofOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.OneofOptions; - - /** - * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. - * @param message OneofOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.OneofOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this OneofOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of an EnumOptions. */ - interface IEnumOptions { - - /** EnumOptions allowAlias */ - allowAlias?: (boolean|null); - - /** EnumOptions deprecated */ - deprecated?: (boolean|null); - - /** EnumOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - } - - /** Represents an EnumOptions. */ - class EnumOptions implements IEnumOptions { - - /** - * Constructs a new EnumOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IEnumOptions); - - /** EnumOptions allowAlias. */ - public allowAlias: boolean; - - /** EnumOptions deprecated. */ - public deprecated: boolean; - - /** EnumOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EnumOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.EnumOptions; - - /** - * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. - * @param message EnumOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.EnumOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EnumOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of an EnumValueOptions. */ - interface IEnumValueOptions { - - /** EnumValueOptions deprecated */ - deprecated?: (boolean|null); - - /** EnumValueOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - } - - /** Represents an EnumValueOptions. */ - class EnumValueOptions implements IEnumValueOptions { - - /** - * Constructs a new EnumValueOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IEnumValueOptions); - - /** EnumValueOptions deprecated. */ - public deprecated: boolean; - - /** EnumValueOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EnumValueOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueOptions; - - /** - * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. - * @param message EnumValueOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.EnumValueOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EnumValueOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a ServiceOptions. */ - interface IServiceOptions { - - /** ServiceOptions deprecated */ - deprecated?: (boolean|null); - - /** ServiceOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - - /** ServiceOptions .google.api.defaultHost */ - ".google.api.defaultHost"?: (string|null); - - /** ServiceOptions .google.api.oauthScopes */ - ".google.api.oauthScopes"?: (string|null); - } - - /** Represents a ServiceOptions. */ - class ServiceOptions implements IServiceOptions { - - /** - * Constructs a new ServiceOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IServiceOptions); - - /** ServiceOptions deprecated. */ - public deprecated: boolean; - - /** ServiceOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ServiceOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceOptions; - - /** - * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. - * @param message ServiceOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.ServiceOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ServiceOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a MethodOptions. */ - interface IMethodOptions { - - /** MethodOptions deprecated */ - deprecated?: (boolean|null); - - /** MethodOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - - /** MethodOptions .google.api.http */ - ".google.api.http"?: (google.api.IHttpRule|null); - - /** MethodOptions .google.api.methodSignature */ - ".google.api.methodSignature"?: (string[]|null); - - /** MethodOptions .google.longrunning.operationInfo */ - ".google.longrunning.operationInfo"?: (google.longrunning.IOperationInfo|null); - } - - /** Represents a MethodOptions. */ - class MethodOptions implements IMethodOptions { - - /** - * Constructs a new MethodOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IMethodOptions); - - /** MethodOptions deprecated. */ - public deprecated: boolean; - - /** MethodOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MethodOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.MethodOptions; - - /** - * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. - * @param message MethodOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.MethodOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MethodOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of an UninterpretedOption. */ - interface IUninterpretedOption { - - /** UninterpretedOption name */ - name?: (google.protobuf.UninterpretedOption.INamePart[]|null); - - /** UninterpretedOption identifierValue */ - identifierValue?: (string|null); - - /** UninterpretedOption positiveIntValue */ - positiveIntValue?: (number|string|null); - - /** UninterpretedOption negativeIntValue */ - negativeIntValue?: (number|string|null); - - /** UninterpretedOption doubleValue */ - doubleValue?: (number|null); - - /** UninterpretedOption stringValue */ - stringValue?: (Uint8Array|null); - - /** UninterpretedOption aggregateValue */ - aggregateValue?: (string|null); - } - - /** Represents an UninterpretedOption. */ - class UninterpretedOption implements IUninterpretedOption { - - /** - * Constructs a new UninterpretedOption. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IUninterpretedOption); - - /** UninterpretedOption name. */ - public name: google.protobuf.UninterpretedOption.INamePart[]; - - /** UninterpretedOption identifierValue. */ - public identifierValue: string; - - /** UninterpretedOption positiveIntValue. */ - public positiveIntValue: (number|string); - - /** UninterpretedOption negativeIntValue. */ - public negativeIntValue: (number|string); - - /** UninterpretedOption doubleValue. */ - public doubleValue: number; - - /** UninterpretedOption stringValue. */ - public stringValue: Uint8Array; - - /** UninterpretedOption aggregateValue. */ - public aggregateValue: string; - - /** - * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UninterpretedOption - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption; - - /** - * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. - * @param message UninterpretedOption - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.UninterpretedOption, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UninterpretedOption to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - namespace UninterpretedOption { - - /** Properties of a NamePart. */ - interface INamePart { - - /** NamePart namePart */ - namePart: string; - - /** NamePart isExtension */ - isExtension: boolean; - } - - /** Represents a NamePart. */ - class NamePart implements INamePart { - - /** - * Constructs a new NamePart. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.UninterpretedOption.INamePart); - - /** NamePart namePart. */ - public namePart: string; - - /** NamePart isExtension. */ - public isExtension: boolean; - - /** - * Creates a NamePart message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns NamePart - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption.NamePart; - - /** - * Creates a plain object from a NamePart message. Also converts values to other types if specified. - * @param message NamePart - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.UninterpretedOption.NamePart, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this NamePart to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } - - /** Properties of a SourceCodeInfo. */ - interface ISourceCodeInfo { - - /** SourceCodeInfo location */ - location?: (google.protobuf.SourceCodeInfo.ILocation[]|null); - } - - /** Represents a SourceCodeInfo. */ - class SourceCodeInfo implements ISourceCodeInfo { - - /** - * Constructs a new SourceCodeInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.ISourceCodeInfo); - - /** SourceCodeInfo location. */ - public location: google.protobuf.SourceCodeInfo.ILocation[]; - - /** - * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SourceCodeInfo - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo; - - /** - * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. - * @param message SourceCodeInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.SourceCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SourceCodeInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - namespace SourceCodeInfo { - - /** Properties of a Location. */ - interface ILocation { - - /** Location path */ - path?: (number[]|null); - - /** Location span */ - span?: (number[]|null); - - /** Location leadingComments */ - leadingComments?: (string|null); - - /** Location trailingComments */ - trailingComments?: (string|null); - - /** Location leadingDetachedComments */ - leadingDetachedComments?: (string[]|null); - } - - /** Represents a Location. */ - class Location implements ILocation { - - /** - * Constructs a new Location. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.SourceCodeInfo.ILocation); - - /** Location path. */ - public path: number[]; - - /** Location span. */ - public span: number[]; - - /** Location leadingComments. */ - public leadingComments: string; - - /** Location trailingComments. */ - public trailingComments: string; - - /** Location leadingDetachedComments. */ - public leadingDetachedComments: string[]; - - /** - * Creates a Location message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Location - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo.Location; - - /** - * Creates a plain object from a Location message. Also converts values to other types if specified. - * @param message Location - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.SourceCodeInfo.Location, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Location to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } - - /** Properties of a GeneratedCodeInfo. */ - interface IGeneratedCodeInfo { - - /** GeneratedCodeInfo annotation */ - annotation?: (google.protobuf.GeneratedCodeInfo.IAnnotation[]|null); - } - - /** Represents a GeneratedCodeInfo. */ - class GeneratedCodeInfo implements IGeneratedCodeInfo { - - /** - * Constructs a new GeneratedCodeInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IGeneratedCodeInfo); - - /** GeneratedCodeInfo annotation. */ - public annotation: google.protobuf.GeneratedCodeInfo.IAnnotation[]; - - /** - * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GeneratedCodeInfo - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo; - - /** - * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. - * @param message GeneratedCodeInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.GeneratedCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GeneratedCodeInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - namespace GeneratedCodeInfo { - - /** Properties of an Annotation. */ - interface IAnnotation { - - /** Annotation path */ - path?: (number[]|null); - - /** Annotation sourceFile */ - sourceFile?: (string|null); - - /** Annotation begin */ - begin?: (number|null); - - /** Annotation end */ - end?: (number|null); - } - - /** Represents an Annotation. */ - class Annotation implements IAnnotation { - - /** - * Constructs a new Annotation. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation); - - /** Annotation path. */ - public path: number[]; - - /** Annotation sourceFile. */ - public sourceFile: string; - - /** Annotation begin. */ - public begin: number; - - /** Annotation end. */ - public end: number; - - /** - * Creates an Annotation message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Annotation - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo.Annotation; - - /** - * Creates a plain object from an Annotation message. Also converts values to other types if specified. - * @param message Annotation - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.GeneratedCodeInfo.Annotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Annotation to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } - - /** Properties of an Empty. */ - interface IEmpty { - } - - /** Represents an Empty. */ - class Empty implements IEmpty { - - /** - * Constructs a new Empty. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IEmpty); - - /** - * Creates an Empty message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Empty - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Empty; - - /** - * Creates a plain object from an Empty message. Also converts values to other types if specified. - * @param message Empty - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.Empty, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Empty to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a FieldMask. */ - interface IFieldMask { - - /** FieldMask paths */ - paths?: (string[]|null); - } - - /** Represents a FieldMask. */ - class FieldMask implements IFieldMask { - - /** - * Constructs a new FieldMask. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFieldMask); - - /** FieldMask paths. */ - public paths: string[]; - - /** - * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FieldMask - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FieldMask; - - /** - * Creates a plain object from a FieldMask message. Also converts values to other types if specified. - * @param message FieldMask - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FieldMask, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FieldMask to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a Timestamp. */ - interface ITimestamp { - - /** Timestamp seconds */ - seconds?: (number|string|null); - - /** Timestamp nanos */ - nanos?: (number|null); - } - - /** Represents a Timestamp. */ - class Timestamp implements ITimestamp { - - /** - * Constructs a new Timestamp. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.ITimestamp); - - /** Timestamp seconds. */ - public seconds: (number|string); - - /** Timestamp nanos. */ - public nanos: number; - - /** - * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Timestamp - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Timestamp; - - /** - * Creates a plain object from a Timestamp message. Also converts values to other types if specified. - * @param message Timestamp - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.Timestamp, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Timestamp to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of an Any. */ - interface IAny { - - /** Any type_url */ - type_url?: (string|null); - - /** Any value */ - value?: (Uint8Array|null); - } - - /** Represents an Any. */ - class Any implements IAny { - - /** - * Constructs a new Any. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IAny); - - /** Any type_url. */ - public type_url: string; - - /** Any value. */ - public value: Uint8Array; - - /** - * Creates an Any message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Any - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Any; - - /** - * Creates a plain object from an Any message. Also converts values to other types if specified. - * @param message Any - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.Any, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Any to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a Struct. */ - interface IStruct { - - /** Struct fields */ - fields?: ({ [k: string]: google.protobuf.IValue }|null); - } - - /** Represents a Struct. */ - class Struct implements IStruct { - - /** - * Constructs a new Struct. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IStruct); - - /** Struct fields. */ - public fields: { [k: string]: google.protobuf.IValue }; - - /** - * Creates a Struct message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Struct - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Struct; - - /** - * Creates a plain object from a Struct message. Also converts values to other types if specified. - * @param message Struct - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.Struct, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Struct to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a Value. */ - interface IValue { - - /** Value nullValue */ - nullValue?: (google.protobuf.NullValue|null); - - /** Value numberValue */ - numberValue?: (number|null); - - /** Value stringValue */ - stringValue?: (string|null); - - /** Value boolValue */ - boolValue?: (boolean|null); - - /** Value structValue */ - structValue?: (google.protobuf.IStruct|null); - - /** Value listValue */ - listValue?: (google.protobuf.IListValue|null); - } - - /** Represents a Value. */ - class Value implements IValue { - - /** - * Constructs a new Value. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IValue); - - /** Value nullValue. */ - public nullValue?: (google.protobuf.NullValue|null); - - /** Value numberValue. */ - public numberValue?: (number|null); - - /** Value stringValue. */ - public stringValue?: (string|null); - - /** Value boolValue. */ - public boolValue?: (boolean|null); - - /** Value structValue. */ - public structValue?: (google.protobuf.IStruct|null); - - /** Value listValue. */ - public listValue?: (google.protobuf.IListValue|null); - - /** Value kind. */ - public kind?: ("nullValue"|"numberValue"|"stringValue"|"boolValue"|"structValue"|"listValue"); - - /** - * Creates a Value message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Value - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Value; - - /** - * Creates a plain object from a Value message. Also converts values to other types if specified. - * @param message Value - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Value to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** NullValue enum. */ - type NullValue = - "NULL_VALUE"; - - /** Properties of a ListValue. */ - interface IListValue { - - /** ListValue values */ - values?: (google.protobuf.IValue[]|null); - } - - /** Represents a ListValue. */ - class ListValue implements IListValue { - - /** - * Constructs a new ListValue. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IListValue); - - /** ListValue values. */ - public values: google.protobuf.IValue[]; - - /** - * Creates a ListValue message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListValue - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.ListValue; - - /** - * Creates a plain object from a ListValue message. Also converts values to other types if specified. - * @param message ListValue - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.ListValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListValue to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a DoubleValue. */ - interface IDoubleValue { - - /** DoubleValue value */ - value?: (number|null); - } - - /** Represents a DoubleValue. */ - class DoubleValue implements IDoubleValue { - - /** - * Constructs a new DoubleValue. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IDoubleValue); - - /** DoubleValue value. */ - public value: number; - - /** - * Creates a DoubleValue message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DoubleValue - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.DoubleValue; - - /** - * Creates a plain object from a DoubleValue message. Also converts values to other types if specified. - * @param message DoubleValue - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.DoubleValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DoubleValue to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a FloatValue. */ - interface IFloatValue { - - /** FloatValue value */ - value?: (number|null); - } - - /** Represents a FloatValue. */ - class FloatValue implements IFloatValue { - - /** - * Constructs a new FloatValue. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFloatValue); - - /** FloatValue value. */ - public value: number; - - /** - * Creates a FloatValue message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FloatValue - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FloatValue; - - /** - * Creates a plain object from a FloatValue message. Also converts values to other types if specified. - * @param message FloatValue - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FloatValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FloatValue to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of an Int64Value. */ - interface IInt64Value { - - /** Int64Value value */ - value?: (number|string|null); - } - - /** Represents an Int64Value. */ - class Int64Value implements IInt64Value { - - /** - * Constructs a new Int64Value. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IInt64Value); - - /** Int64Value value. */ - public value: (number|string); - - /** - * Creates an Int64Value message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Int64Value - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Int64Value; - - /** - * Creates a plain object from an Int64Value message. Also converts values to other types if specified. - * @param message Int64Value - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.Int64Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Int64Value to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a UInt64Value. */ - interface IUInt64Value { - - /** UInt64Value value */ - value?: (number|string|null); - } - - /** Represents a UInt64Value. */ - class UInt64Value implements IUInt64Value { - - /** - * Constructs a new UInt64Value. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IUInt64Value); - - /** UInt64Value value. */ - public value: (number|string); - - /** - * Creates a UInt64Value message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UInt64Value - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.UInt64Value; - - /** - * Creates a plain object from a UInt64Value message. Also converts values to other types if specified. - * @param message UInt64Value - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.UInt64Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UInt64Value to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of an Int32Value. */ - interface IInt32Value { - - /** Int32Value value */ - value?: (number|null); - } - - /** Represents an Int32Value. */ - class Int32Value implements IInt32Value { - - /** - * Constructs a new Int32Value. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IInt32Value); - - /** Int32Value value. */ - public value: number; - - /** - * Creates an Int32Value message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Int32Value - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Int32Value; - - /** - * Creates a plain object from an Int32Value message. Also converts values to other types if specified. - * @param message Int32Value - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.Int32Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Int32Value to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a UInt32Value. */ - interface IUInt32Value { - - /** UInt32Value value */ - value?: (number|null); - } - - /** Represents a UInt32Value. */ - class UInt32Value implements IUInt32Value { - - /** - * Constructs a new UInt32Value. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IUInt32Value); - - /** UInt32Value value. */ - public value: number; - - /** - * Creates a UInt32Value message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UInt32Value - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.UInt32Value; - - /** - * Creates a plain object from a UInt32Value message. Also converts values to other types if specified. - * @param message UInt32Value - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.UInt32Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UInt32Value to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a BoolValue. */ - interface IBoolValue { - - /** BoolValue value */ - value?: (boolean|null); - } - - /** Represents a BoolValue. */ - class BoolValue implements IBoolValue { - - /** - * Constructs a new BoolValue. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IBoolValue); - - /** BoolValue value. */ - public value: boolean; - - /** - * Creates a BoolValue message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BoolValue - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.BoolValue; - - /** - * Creates a plain object from a BoolValue message. Also converts values to other types if specified. - * @param message BoolValue - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.BoolValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BoolValue to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a StringValue. */ - interface IStringValue { - - /** StringValue value */ - value?: (string|null); - } - - /** Represents a StringValue. */ - class StringValue implements IStringValue { - - /** - * Constructs a new StringValue. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IStringValue); - - /** StringValue value. */ - public value: string; - - /** - * Creates a StringValue message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns StringValue - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.StringValue; - - /** - * Creates a plain object from a StringValue message. Also converts values to other types if specified. - * @param message StringValue - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.StringValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this StringValue to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a BytesValue. */ - interface IBytesValue { - - /** BytesValue value */ - value?: (Uint8Array|null); - } - - /** Represents a BytesValue. */ - class BytesValue implements IBytesValue { - - /** - * Constructs a new BytesValue. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IBytesValue); - - /** BytesValue value. */ - public value: Uint8Array; - - /** - * Creates a BytesValue message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BytesValue - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.BytesValue; - - /** - * Creates a plain object from a BytesValue message. Also converts values to other types if specified. - * @param message BytesValue - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.BytesValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BytesValue to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a Duration. */ - interface IDuration { - - /** Duration seconds */ - seconds?: (number|string|null); - - /** Duration nanos */ - nanos?: (number|null); - } - - /** Represents a Duration. */ - class Duration implements IDuration { - - /** - * Constructs a new Duration. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IDuration); - - /** Duration seconds. */ - public seconds: (number|string); - - /** Duration nanos. */ - public nanos: number; - - /** - * Creates a Duration message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Duration - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Duration; - - /** - * Creates a plain object from a Duration message. Also converts values to other types if specified. - * @param message Duration - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.Duration, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Duration to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } - - /** Namespace type. */ - namespace type { - - /** Properties of a LatLng. */ - interface ILatLng { - - /** LatLng latitude */ - latitude?: (number|null); - - /** LatLng longitude */ - longitude?: (number|null); - } - - /** Represents a LatLng. */ - class LatLng implements ILatLng { - - /** - * Constructs a new LatLng. - * @param [properties] Properties to set - */ - constructor(properties?: google.type.ILatLng); - - /** LatLng latitude. */ - public latitude: number; - - /** LatLng longitude. */ - public longitude: number; - - /** - * Creates a LatLng message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns LatLng - */ - public static fromObject(object: { [k: string]: any }): google.type.LatLng; - - /** - * Creates a plain object from a LatLng message. Also converts values to other types if specified. - * @param message LatLng - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.type.LatLng, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this LatLng to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } - - /** Namespace rpc. */ - namespace rpc { - - /** Properties of a Status. */ - interface IStatus { - - /** Status code */ - code?: (number|null); - - /** Status message */ - message?: (string|null); - - /** Status details */ - details?: (google.protobuf.IAny[]|null); - } - - /** Represents a Status. */ - class Status implements IStatus { - - /** - * Constructs a new Status. - * @param [properties] Properties to set - */ - constructor(properties?: google.rpc.IStatus); - - /** Status code. */ - public code: number; - - /** Status message. */ - public message: string; - - /** Status details. */ - public details: google.protobuf.IAny[]; - - /** - * Creates a Status message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Status - */ - public static fromObject(object: { [k: string]: any }): google.rpc.Status; - - /** - * Creates a plain object from a Status message. Also converts values to other types if specified. - * @param message Status - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.rpc.Status, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Status to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } - - /** Namespace longrunning. */ - namespace longrunning { - - /** Represents an Operations */ - class Operations extends $protobuf.rpc.Service { - - /** - * Constructs a new Operations service. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - */ - constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); - - /** - * Calls ListOperations. - * @param request ListOperationsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListOperationsResponse - */ - public listOperations(request: google.longrunning.IListOperationsRequest, callback: google.longrunning.Operations.ListOperationsCallback): void; - - /** - * Calls ListOperations. - * @param request ListOperationsRequest message or plain object - * @returns Promise - */ - public listOperations(request: google.longrunning.IListOperationsRequest): Promise; - - /** - * Calls GetOperation. - * @param request GetOperationRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public getOperation(request: google.longrunning.IGetOperationRequest, callback: google.longrunning.Operations.GetOperationCallback): void; - - /** - * Calls GetOperation. - * @param request GetOperationRequest message or plain object - * @returns Promise - */ - public getOperation(request: google.longrunning.IGetOperationRequest): Promise; - - /** - * Calls DeleteOperation. - * @param request DeleteOperationRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty - */ - public deleteOperation(request: google.longrunning.IDeleteOperationRequest, callback: google.longrunning.Operations.DeleteOperationCallback): void; - - /** - * Calls DeleteOperation. - * @param request DeleteOperationRequest message or plain object - * @returns Promise - */ - public deleteOperation(request: google.longrunning.IDeleteOperationRequest): Promise; - - /** - * Calls CancelOperation. - * @param request CancelOperationRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty - */ - public cancelOperation(request: google.longrunning.ICancelOperationRequest, callback: google.longrunning.Operations.CancelOperationCallback): void; - - /** - * Calls CancelOperation. - * @param request CancelOperationRequest message or plain object - * @returns Promise - */ - public cancelOperation(request: google.longrunning.ICancelOperationRequest): Promise; - - /** - * Calls WaitOperation. - * @param request WaitOperationRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public waitOperation(request: google.longrunning.IWaitOperationRequest, callback: google.longrunning.Operations.WaitOperationCallback): void; - - /** - * Calls WaitOperation. - * @param request WaitOperationRequest message or plain object - * @returns Promise - */ - public waitOperation(request: google.longrunning.IWaitOperationRequest): Promise; - } - - namespace Operations { - - /** - * Callback as used by {@link google.longrunning.Operations#listOperations}. - * @param error Error, if any - * @param [response] ListOperationsResponse - */ - type ListOperationsCallback = (error: (Error|null), response?: google.longrunning.ListOperationsResponse) => void; - - /** - * Callback as used by {@link google.longrunning.Operations#getOperation}. - * @param error Error, if any - * @param [response] Operation - */ - type GetOperationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.longrunning.Operations#deleteOperation}. - * @param error Error, if any - * @param [response] Empty - */ - type DeleteOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - - /** - * Callback as used by {@link google.longrunning.Operations#cancelOperation}. - * @param error Error, if any - * @param [response] Empty - */ - type CancelOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - - /** - * Callback as used by {@link google.longrunning.Operations#waitOperation}. - * @param error Error, if any - * @param [response] Operation - */ - type WaitOperationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - } - - /** Properties of an Operation. */ - interface IOperation { - - /** Operation name */ - name?: (string|null); - - /** Operation metadata */ - metadata?: (google.protobuf.IAny|null); - - /** Operation done */ - done?: (boolean|null); - - /** Operation error */ - error?: (google.rpc.IStatus|null); - - /** Operation response */ - response?: (google.protobuf.IAny|null); - } - - /** Represents an Operation. */ - class Operation implements IOperation { - - /** - * Constructs a new Operation. - * @param [properties] Properties to set - */ - constructor(properties?: google.longrunning.IOperation); - - /** Operation name. */ - public name: string; - - /** Operation metadata. */ - public metadata?: (google.protobuf.IAny|null); - - /** Operation done. */ - public done: boolean; - - /** Operation error. */ - public error?: (google.rpc.IStatus|null); - - /** Operation response. */ - public response?: (google.protobuf.IAny|null); - - /** Operation result. */ - public result?: ("error"|"response"); - - /** - * Creates an Operation message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Operation - */ - public static fromObject(object: { [k: string]: any }): google.longrunning.Operation; - - /** - * Creates a plain object from an Operation message. Also converts values to other types if specified. - * @param message Operation - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.longrunning.Operation, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Operation to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a GetOperationRequest. */ - interface IGetOperationRequest { - - /** GetOperationRequest name */ - name?: (string|null); - } - - /** Represents a GetOperationRequest. */ - class GetOperationRequest implements IGetOperationRequest { - - /** - * Constructs a new GetOperationRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.longrunning.IGetOperationRequest); - - /** GetOperationRequest name. */ - public name: string; - - /** - * Creates a GetOperationRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetOperationRequest - */ - public static fromObject(object: { [k: string]: any }): google.longrunning.GetOperationRequest; - - /** - * Creates a plain object from a GetOperationRequest message. Also converts values to other types if specified. - * @param message GetOperationRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.longrunning.GetOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetOperationRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a ListOperationsRequest. */ - interface IListOperationsRequest { - - /** ListOperationsRequest name */ - name?: (string|null); - - /** ListOperationsRequest filter */ - filter?: (string|null); - - /** ListOperationsRequest pageSize */ - pageSize?: (number|null); - - /** ListOperationsRequest pageToken */ - pageToken?: (string|null); - } - - /** Represents a ListOperationsRequest. */ - class ListOperationsRequest implements IListOperationsRequest { - - /** - * Constructs a new ListOperationsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.longrunning.IListOperationsRequest); - - /** ListOperationsRequest name. */ - public name: string; - - /** ListOperationsRequest filter. */ - public filter: string; - - /** ListOperationsRequest pageSize. */ - public pageSize: number; - - /** ListOperationsRequest pageToken. */ - public pageToken: string; - - /** - * Creates a ListOperationsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListOperationsRequest - */ - public static fromObject(object: { [k: string]: any }): google.longrunning.ListOperationsRequest; - - /** - * Creates a plain object from a ListOperationsRequest message. Also converts values to other types if specified. - * @param message ListOperationsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.longrunning.ListOperationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListOperationsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a ListOperationsResponse. */ - interface IListOperationsResponse { - - /** ListOperationsResponse operations */ - operations?: (google.longrunning.IOperation[]|null); - - /** ListOperationsResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListOperationsResponse. */ - class ListOperationsResponse implements IListOperationsResponse { - - /** - * Constructs a new ListOperationsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.longrunning.IListOperationsResponse); - - /** ListOperationsResponse operations. */ - public operations: google.longrunning.IOperation[]; - - /** ListOperationsResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a ListOperationsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListOperationsResponse - */ - public static fromObject(object: { [k: string]: any }): google.longrunning.ListOperationsResponse; - - /** - * Creates a plain object from a ListOperationsResponse message. Also converts values to other types if specified. - * @param message ListOperationsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.longrunning.ListOperationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListOperationsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a CancelOperationRequest. */ - interface ICancelOperationRequest { - - /** CancelOperationRequest name */ - name?: (string|null); - } - - /** Represents a CancelOperationRequest. */ - class CancelOperationRequest implements ICancelOperationRequest { - - /** - * Constructs a new CancelOperationRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.longrunning.ICancelOperationRequest); - - /** CancelOperationRequest name. */ - public name: string; - - /** - * Creates a CancelOperationRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CancelOperationRequest - */ - public static fromObject(object: { [k: string]: any }): google.longrunning.CancelOperationRequest; - - /** - * Creates a plain object from a CancelOperationRequest message. Also converts values to other types if specified. - * @param message CancelOperationRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.longrunning.CancelOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CancelOperationRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a DeleteOperationRequest. */ - interface IDeleteOperationRequest { - - /** DeleteOperationRequest name */ - name?: (string|null); - } - - /** Represents a DeleteOperationRequest. */ - class DeleteOperationRequest implements IDeleteOperationRequest { - - /** - * Constructs a new DeleteOperationRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.longrunning.IDeleteOperationRequest); - - /** DeleteOperationRequest name. */ - public name: string; - - /** - * Creates a DeleteOperationRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteOperationRequest - */ - public static fromObject(object: { [k: string]: any }): google.longrunning.DeleteOperationRequest; - - /** - * Creates a plain object from a DeleteOperationRequest message. Also converts values to other types if specified. - * @param message DeleteOperationRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.longrunning.DeleteOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteOperationRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a WaitOperationRequest. */ - interface IWaitOperationRequest { - - /** WaitOperationRequest name */ - name?: (string|null); - - /** WaitOperationRequest timeout */ - timeout?: (google.protobuf.IDuration|null); - } - - /** Represents a WaitOperationRequest. */ - class WaitOperationRequest implements IWaitOperationRequest { - - /** - * Constructs a new WaitOperationRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.longrunning.IWaitOperationRequest); - - /** WaitOperationRequest name. */ - public name: string; - - /** WaitOperationRequest timeout. */ - public timeout?: (google.protobuf.IDuration|null); - - /** - * Creates a WaitOperationRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns WaitOperationRequest - */ - public static fromObject(object: { [k: string]: any }): google.longrunning.WaitOperationRequest; - - /** - * Creates a plain object from a WaitOperationRequest message. Also converts values to other types if specified. - * @param message WaitOperationRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.longrunning.WaitOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this WaitOperationRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of an OperationInfo. */ - interface IOperationInfo { - - /** OperationInfo responseType */ - responseType?: (string|null); - - /** OperationInfo metadataType */ - metadataType?: (string|null); - } - - /** Represents an OperationInfo. */ - class OperationInfo implements IOperationInfo { - - /** - * Constructs a new OperationInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.longrunning.IOperationInfo); - - /** OperationInfo responseType. */ - public responseType: string; - - /** OperationInfo metadataType. */ - public metadataType: string; - - /** - * Creates an OperationInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns OperationInfo - */ - public static fromObject(object: { [k: string]: any }): google.longrunning.OperationInfo; - - /** - * Creates a plain object from an OperationInfo message. Also converts values to other types if specified. - * @param message OperationInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.longrunning.OperationInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this OperationInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/firestore/types/protos/firestore_v1_proto_api.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/firestore/types/protos/firestore_v1_proto_api.d.ts deleted file mode 100644 index 763e6668..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/firestore/types/protos/firestore_v1_proto_api.d.ts +++ /dev/null @@ -1,7132 +0,0 @@ -/*! - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import * as $protobuf from "protobufjs"; -/** Namespace firestore. */ -export namespace firestore { - - /** Properties of a BundledQuery. */ - interface IBundledQuery { - - /** BundledQuery parent */ - parent?: (string|null); - - /** BundledQuery structuredQuery */ - structuredQuery?: (google.firestore.v1.IStructuredQuery|null); - - /** BundledQuery limitType */ - limitType?: (firestore.BundledQuery.LimitType|null); - } - - /** Represents a BundledQuery. */ - class BundledQuery implements IBundledQuery { - - /** - * Constructs a new BundledQuery. - * @param [properties] Properties to set - */ - constructor(properties?: firestore.IBundledQuery); - - /** BundledQuery parent. */ - public parent: string; - - /** BundledQuery structuredQuery. */ - public structuredQuery?: (google.firestore.v1.IStructuredQuery|null); - - /** BundledQuery limitType. */ - public limitType: firestore.BundledQuery.LimitType; - - /** BundledQuery queryType. */ - public queryType?: "structuredQuery"; - - /** - * Creates a BundledQuery message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BundledQuery - */ - public static fromObject(object: { [k: string]: any }): firestore.BundledQuery; - - /** - * Creates a plain object from a BundledQuery message. Also converts values to other types if specified. - * @param message BundledQuery - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: firestore.BundledQuery, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BundledQuery to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - namespace BundledQuery { - - /** LimitType enum. */ - type LimitType = - "FIRST"| "LAST"; - } - - /** Properties of a NamedQuery. */ - interface INamedQuery { - - /** NamedQuery name */ - name?: (string|null); - - /** NamedQuery bundledQuery */ - bundledQuery?: (firestore.IBundledQuery|null); - - /** NamedQuery readTime */ - readTime?: (google.protobuf.ITimestamp|null); - } - - /** Represents a NamedQuery. */ - class NamedQuery implements INamedQuery { - - /** - * Constructs a new NamedQuery. - * @param [properties] Properties to set - */ - constructor(properties?: firestore.INamedQuery); - - /** NamedQuery name. */ - public name: string; - - /** NamedQuery bundledQuery. */ - public bundledQuery?: (firestore.IBundledQuery|null); - - /** NamedQuery readTime. */ - public readTime?: (google.protobuf.ITimestamp|null); - - /** - * Creates a NamedQuery message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns NamedQuery - */ - public static fromObject(object: { [k: string]: any }): firestore.NamedQuery; - - /** - * Creates a plain object from a NamedQuery message. Also converts values to other types if specified. - * @param message NamedQuery - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: firestore.NamedQuery, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this NamedQuery to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a BundledDocumentMetadata. */ - interface IBundledDocumentMetadata { - - /** BundledDocumentMetadata name */ - name?: (string|null); - - /** BundledDocumentMetadata readTime */ - readTime?: (google.protobuf.ITimestamp|null); - - /** BundledDocumentMetadata exists */ - exists?: (boolean|null); - - /** BundledDocumentMetadata queries */ - queries?: (string[]|null); - } - - /** Represents a BundledDocumentMetadata. */ - class BundledDocumentMetadata implements IBundledDocumentMetadata { - - /** - * Constructs a new BundledDocumentMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: firestore.IBundledDocumentMetadata); - - /** BundledDocumentMetadata name. */ - public name: string; - - /** BundledDocumentMetadata readTime. */ - public readTime?: (google.protobuf.ITimestamp|null); - - /** BundledDocumentMetadata exists. */ - public exists: boolean; - - /** BundledDocumentMetadata queries. */ - public queries: string[]; - - /** - * Creates a BundledDocumentMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BundledDocumentMetadata - */ - public static fromObject(object: { [k: string]: any }): firestore.BundledDocumentMetadata; - - /** - * Creates a plain object from a BundledDocumentMetadata message. Also converts values to other types if specified. - * @param message BundledDocumentMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: firestore.BundledDocumentMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BundledDocumentMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a BundleMetadata. */ - interface IBundleMetadata { - - /** BundleMetadata id */ - id?: (string|null); - - /** BundleMetadata createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** BundleMetadata version */ - version?: (number|null); - - /** BundleMetadata totalDocuments */ - totalDocuments?: (number|null); - - /** BundleMetadata totalBytes */ - totalBytes?: (number|string|null); - } - - /** Represents a BundleMetadata. */ - class BundleMetadata implements IBundleMetadata { - - /** - * Constructs a new BundleMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: firestore.IBundleMetadata); - - /** BundleMetadata id. */ - public id: string; - - /** BundleMetadata createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** BundleMetadata version. */ - public version: number; - - /** BundleMetadata totalDocuments. */ - public totalDocuments: number; - - /** BundleMetadata totalBytes. */ - public totalBytes: (number|string); - - /** - * Creates a BundleMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BundleMetadata - */ - public static fromObject(object: { [k: string]: any }): firestore.BundleMetadata; - - /** - * Creates a plain object from a BundleMetadata message. Also converts values to other types if specified. - * @param message BundleMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: firestore.BundleMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BundleMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a BundleElement. */ - interface IBundleElement { - - /** BundleElement metadata */ - metadata?: (firestore.IBundleMetadata|null); - - /** BundleElement namedQuery */ - namedQuery?: (firestore.INamedQuery|null); - - /** BundleElement documentMetadata */ - documentMetadata?: (firestore.IBundledDocumentMetadata|null); - - /** BundleElement document */ - document?: (google.firestore.v1.IDocument|null); - } - - /** Represents a BundleElement. */ - class BundleElement implements IBundleElement { - - /** - * Constructs a new BundleElement. - * @param [properties] Properties to set - */ - constructor(properties?: firestore.IBundleElement); - - /** BundleElement metadata. */ - public metadata?: (firestore.IBundleMetadata|null); - - /** BundleElement namedQuery. */ - public namedQuery?: (firestore.INamedQuery|null); - - /** BundleElement documentMetadata. */ - public documentMetadata?: (firestore.IBundledDocumentMetadata|null); - - /** BundleElement document. */ - public document?: (google.firestore.v1.IDocument|null); - - /** BundleElement elementType. */ - public elementType?: ("metadata"|"namedQuery"|"documentMetadata"|"document"); - - /** - * Creates a BundleElement message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BundleElement - */ - public static fromObject(object: { [k: string]: any }): firestore.BundleElement; - - /** - * Creates a plain object from a BundleElement message. Also converts values to other types if specified. - * @param message BundleElement - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: firestore.BundleElement, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BundleElement to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } -} - -/** Namespace google. */ -export namespace google { - - /** Namespace protobuf. */ - namespace protobuf { - - /** Properties of a Timestamp. */ - interface ITimestamp { - - /** Timestamp seconds */ - seconds?: (number|string|null); - - /** Timestamp nanos */ - nanos?: (number|null); - } - - /** Represents a Timestamp. */ - class Timestamp implements ITimestamp { - - /** - * Constructs a new Timestamp. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.ITimestamp); - - /** Timestamp seconds. */ - public seconds: (number|string); - - /** Timestamp nanos. */ - public nanos: number; - - /** - * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Timestamp - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Timestamp; - - /** - * Creates a plain object from a Timestamp message. Also converts values to other types if specified. - * @param message Timestamp - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.Timestamp, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Timestamp to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a FileDescriptorSet. */ - interface IFileDescriptorSet { - - /** FileDescriptorSet file */ - file?: (google.protobuf.IFileDescriptorProto[]|null); - } - - /** Represents a FileDescriptorSet. */ - class FileDescriptorSet implements IFileDescriptorSet { - - /** - * Constructs a new FileDescriptorSet. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFileDescriptorSet); - - /** FileDescriptorSet file. */ - public file: google.protobuf.IFileDescriptorProto[]; - - /** - * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FileDescriptorSet - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorSet; - - /** - * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. - * @param message FileDescriptorSet - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FileDescriptorSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FileDescriptorSet to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a FileDescriptorProto. */ - interface IFileDescriptorProto { - - /** FileDescriptorProto name */ - name?: (string|null); - - /** FileDescriptorProto package */ - "package"?: (string|null); - - /** FileDescriptorProto dependency */ - dependency?: (string[]|null); - - /** FileDescriptorProto publicDependency */ - publicDependency?: (number[]|null); - - /** FileDescriptorProto weakDependency */ - weakDependency?: (number[]|null); - - /** FileDescriptorProto messageType */ - messageType?: (google.protobuf.IDescriptorProto[]|null); - - /** FileDescriptorProto enumType */ - enumType?: (google.protobuf.IEnumDescriptorProto[]|null); - - /** FileDescriptorProto service */ - service?: (google.protobuf.IServiceDescriptorProto[]|null); - - /** FileDescriptorProto extension */ - extension?: (google.protobuf.IFieldDescriptorProto[]|null); - - /** FileDescriptorProto options */ - options?: (google.protobuf.IFileOptions|null); - - /** FileDescriptorProto sourceCodeInfo */ - sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); - - /** FileDescriptorProto syntax */ - syntax?: (string|null); - } - - /** Represents a FileDescriptorProto. */ - class FileDescriptorProto implements IFileDescriptorProto { - - /** - * Constructs a new FileDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFileDescriptorProto); - - /** FileDescriptorProto name. */ - public name: string; - - /** FileDescriptorProto package. */ - public package: string; - - /** FileDescriptorProto dependency. */ - public dependency: string[]; - - /** FileDescriptorProto publicDependency. */ - public publicDependency: number[]; - - /** FileDescriptorProto weakDependency. */ - public weakDependency: number[]; - - /** FileDescriptorProto messageType. */ - public messageType: google.protobuf.IDescriptorProto[]; - - /** FileDescriptorProto enumType. */ - public enumType: google.protobuf.IEnumDescriptorProto[]; - - /** FileDescriptorProto service. */ - public service: google.protobuf.IServiceDescriptorProto[]; - - /** FileDescriptorProto extension. */ - public extension: google.protobuf.IFieldDescriptorProto[]; - - /** FileDescriptorProto options. */ - public options?: (google.protobuf.IFileOptions|null); - - /** FileDescriptorProto sourceCodeInfo. */ - public sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); - - /** FileDescriptorProto syntax. */ - public syntax: string; - - /** - * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FileDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorProto; - - /** - * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. - * @param message FileDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FileDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FileDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a DescriptorProto. */ - interface IDescriptorProto { - - /** DescriptorProto name */ - name?: (string|null); - - /** DescriptorProto field */ - field?: (google.protobuf.IFieldDescriptorProto[]|null); - - /** DescriptorProto extension */ - extension?: (google.protobuf.IFieldDescriptorProto[]|null); - - /** DescriptorProto nestedType */ - nestedType?: (google.protobuf.IDescriptorProto[]|null); - - /** DescriptorProto enumType */ - enumType?: (google.protobuf.IEnumDescriptorProto[]|null); - - /** DescriptorProto extensionRange */ - extensionRange?: (google.protobuf.DescriptorProto.IExtensionRange[]|null); - - /** DescriptorProto oneofDecl */ - oneofDecl?: (google.protobuf.IOneofDescriptorProto[]|null); - - /** DescriptorProto options */ - options?: (google.protobuf.IMessageOptions|null); - - /** DescriptorProto reservedRange */ - reservedRange?: (google.protobuf.DescriptorProto.IReservedRange[]|null); - - /** DescriptorProto reservedName */ - reservedName?: (string[]|null); - } - - /** Represents a DescriptorProto. */ - class DescriptorProto implements IDescriptorProto { - - /** - * Constructs a new DescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IDescriptorProto); - - /** DescriptorProto name. */ - public name: string; - - /** DescriptorProto field. */ - public field: google.protobuf.IFieldDescriptorProto[]; - - /** DescriptorProto extension. */ - public extension: google.protobuf.IFieldDescriptorProto[]; - - /** DescriptorProto nestedType. */ - public nestedType: google.protobuf.IDescriptorProto[]; - - /** DescriptorProto enumType. */ - public enumType: google.protobuf.IEnumDescriptorProto[]; - - /** DescriptorProto extensionRange. */ - public extensionRange: google.protobuf.DescriptorProto.IExtensionRange[]; - - /** DescriptorProto oneofDecl. */ - public oneofDecl: google.protobuf.IOneofDescriptorProto[]; - - /** DescriptorProto options. */ - public options?: (google.protobuf.IMessageOptions|null); - - /** DescriptorProto reservedRange. */ - public reservedRange: google.protobuf.DescriptorProto.IReservedRange[]; - - /** DescriptorProto reservedName. */ - public reservedName: string[]; - - /** - * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto; - - /** - * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. - * @param message DescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.DescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - namespace DescriptorProto { - - /** Properties of an ExtensionRange. */ - interface IExtensionRange { - - /** ExtensionRange start */ - start?: (number|null); - - /** ExtensionRange end */ - end?: (number|null); - } - - /** Represents an ExtensionRange. */ - class ExtensionRange implements IExtensionRange { - - /** - * Constructs a new ExtensionRange. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.DescriptorProto.IExtensionRange); - - /** ExtensionRange start. */ - public start: number; - - /** ExtensionRange end. */ - public end: number; - - /** - * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ExtensionRange - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ExtensionRange; - - /** - * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. - * @param message ExtensionRange - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.DescriptorProto.ExtensionRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ExtensionRange to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a ReservedRange. */ - interface IReservedRange { - - /** ReservedRange start */ - start?: (number|null); - - /** ReservedRange end */ - end?: (number|null); - } - - /** Represents a ReservedRange. */ - class ReservedRange implements IReservedRange { - - /** - * Constructs a new ReservedRange. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.DescriptorProto.IReservedRange); - - /** ReservedRange start. */ - public start: number; - - /** ReservedRange end. */ - public end: number; - - /** - * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ReservedRange - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ReservedRange; - - /** - * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. - * @param message ReservedRange - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.DescriptorProto.ReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ReservedRange to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } - - /** Properties of a FieldDescriptorProto. */ - interface IFieldDescriptorProto { - - /** FieldDescriptorProto name */ - name?: (string|null); - - /** FieldDescriptorProto number */ - number?: (number|null); - - /** FieldDescriptorProto label */ - label?: (google.protobuf.FieldDescriptorProto.Label|null); - - /** FieldDescriptorProto type */ - type?: (google.protobuf.FieldDescriptorProto.Type|null); - - /** FieldDescriptorProto typeName */ - typeName?: (string|null); - - /** FieldDescriptorProto extendee */ - extendee?: (string|null); - - /** FieldDescriptorProto defaultValue */ - defaultValue?: (string|null); - - /** FieldDescriptorProto oneofIndex */ - oneofIndex?: (number|null); - - /** FieldDescriptorProto jsonName */ - jsonName?: (string|null); - - /** FieldDescriptorProto options */ - options?: (google.protobuf.IFieldOptions|null); - } - - /** Represents a FieldDescriptorProto. */ - class FieldDescriptorProto implements IFieldDescriptorProto { - - /** - * Constructs a new FieldDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFieldDescriptorProto); - - /** FieldDescriptorProto name. */ - public name: string; - - /** FieldDescriptorProto number. */ - public number: number; - - /** FieldDescriptorProto label. */ - public label: google.protobuf.FieldDescriptorProto.Label; - - /** FieldDescriptorProto type. */ - public type: google.protobuf.FieldDescriptorProto.Type; - - /** FieldDescriptorProto typeName. */ - public typeName: string; - - /** FieldDescriptorProto extendee. */ - public extendee: string; - - /** FieldDescriptorProto defaultValue. */ - public defaultValue: string; - - /** FieldDescriptorProto oneofIndex. */ - public oneofIndex: number; - - /** FieldDescriptorProto jsonName. */ - public jsonName: string; - - /** FieldDescriptorProto options. */ - public options?: (google.protobuf.IFieldOptions|null); - - /** - * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FieldDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FieldDescriptorProto; - - /** - * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. - * @param message FieldDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FieldDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FieldDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - namespace FieldDescriptorProto { - - /** Type enum. */ - type Type = - "TYPE_DOUBLE"| "TYPE_FLOAT"| "TYPE_INT64"| "TYPE_UINT64"| "TYPE_INT32"| "TYPE_FIXED64"| "TYPE_FIXED32"| "TYPE_BOOL"| "TYPE_STRING"| "TYPE_GROUP"| "TYPE_MESSAGE"| "TYPE_BYTES"| "TYPE_UINT32"| "TYPE_ENUM"| "TYPE_SFIXED32"| "TYPE_SFIXED64"| "TYPE_SINT32"| "TYPE_SINT64"; - - /** Label enum. */ - type Label = - "LABEL_OPTIONAL"| "LABEL_REQUIRED"| "LABEL_REPEATED"; - } - - /** Properties of an OneofDescriptorProto. */ - interface IOneofDescriptorProto { - - /** OneofDescriptorProto name */ - name?: (string|null); - - /** OneofDescriptorProto options */ - options?: (google.protobuf.IOneofOptions|null); - } - - /** Represents an OneofDescriptorProto. */ - class OneofDescriptorProto implements IOneofDescriptorProto { - - /** - * Constructs a new OneofDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IOneofDescriptorProto); - - /** OneofDescriptorProto name. */ - public name: string; - - /** OneofDescriptorProto options. */ - public options?: (google.protobuf.IOneofOptions|null); - - /** - * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns OneofDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.OneofDescriptorProto; - - /** - * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. - * @param message OneofDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.OneofDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this OneofDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of an EnumDescriptorProto. */ - interface IEnumDescriptorProto { - - /** EnumDescriptorProto name */ - name?: (string|null); - - /** EnumDescriptorProto value */ - value?: (google.protobuf.IEnumValueDescriptorProto[]|null); - - /** EnumDescriptorProto options */ - options?: (google.protobuf.IEnumOptions|null); - } - - /** Represents an EnumDescriptorProto. */ - class EnumDescriptorProto implements IEnumDescriptorProto { - - /** - * Constructs a new EnumDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IEnumDescriptorProto); - - /** EnumDescriptorProto name. */ - public name: string; - - /** EnumDescriptorProto value. */ - public value: google.protobuf.IEnumValueDescriptorProto[]; - - /** EnumDescriptorProto options. */ - public options?: (google.protobuf.IEnumOptions|null); - - /** - * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EnumDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto; - - /** - * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. - * @param message EnumDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.EnumDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EnumDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of an EnumValueDescriptorProto. */ - interface IEnumValueDescriptorProto { - - /** EnumValueDescriptorProto name */ - name?: (string|null); - - /** EnumValueDescriptorProto number */ - number?: (number|null); - - /** EnumValueDescriptorProto options */ - options?: (google.protobuf.IEnumValueOptions|null); - } - - /** Represents an EnumValueDescriptorProto. */ - class EnumValueDescriptorProto implements IEnumValueDescriptorProto { - - /** - * Constructs a new EnumValueDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IEnumValueDescriptorProto); - - /** EnumValueDescriptorProto name. */ - public name: string; - - /** EnumValueDescriptorProto number. */ - public number: number; - - /** EnumValueDescriptorProto options. */ - public options?: (google.protobuf.IEnumValueOptions|null); - - /** - * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EnumValueDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueDescriptorProto; - - /** - * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. - * @param message EnumValueDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.EnumValueDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EnumValueDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a ServiceDescriptorProto. */ - interface IServiceDescriptorProto { - - /** ServiceDescriptorProto name */ - name?: (string|null); - - /** ServiceDescriptorProto method */ - method?: (google.protobuf.IMethodDescriptorProto[]|null); - - /** ServiceDescriptorProto options */ - options?: (google.protobuf.IServiceOptions|null); - } - - /** Represents a ServiceDescriptorProto. */ - class ServiceDescriptorProto implements IServiceDescriptorProto { - - /** - * Constructs a new ServiceDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IServiceDescriptorProto); - - /** ServiceDescriptorProto name. */ - public name: string; - - /** ServiceDescriptorProto method. */ - public method: google.protobuf.IMethodDescriptorProto[]; - - /** ServiceDescriptorProto options. */ - public options?: (google.protobuf.IServiceOptions|null); - - /** - * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ServiceDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceDescriptorProto; - - /** - * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. - * @param message ServiceDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.ServiceDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ServiceDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a MethodDescriptorProto. */ - interface IMethodDescriptorProto { - - /** MethodDescriptorProto name */ - name?: (string|null); - - /** MethodDescriptorProto inputType */ - inputType?: (string|null); - - /** MethodDescriptorProto outputType */ - outputType?: (string|null); - - /** MethodDescriptorProto options */ - options?: (google.protobuf.IMethodOptions|null); - - /** MethodDescriptorProto clientStreaming */ - clientStreaming?: (boolean|null); - - /** MethodDescriptorProto serverStreaming */ - serverStreaming?: (boolean|null); - } - - /** Represents a MethodDescriptorProto. */ - class MethodDescriptorProto implements IMethodDescriptorProto { - - /** - * Constructs a new MethodDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IMethodDescriptorProto); - - /** MethodDescriptorProto name. */ - public name: string; - - /** MethodDescriptorProto inputType. */ - public inputType: string; - - /** MethodDescriptorProto outputType. */ - public outputType: string; - - /** MethodDescriptorProto options. */ - public options?: (google.protobuf.IMethodOptions|null); - - /** MethodDescriptorProto clientStreaming. */ - public clientStreaming: boolean; - - /** MethodDescriptorProto serverStreaming. */ - public serverStreaming: boolean; - - /** - * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MethodDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.MethodDescriptorProto; - - /** - * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. - * @param message MethodDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.MethodDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MethodDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a FileOptions. */ - interface IFileOptions { - - /** FileOptions javaPackage */ - javaPackage?: (string|null); - - /** FileOptions javaOuterClassname */ - javaOuterClassname?: (string|null); - - /** FileOptions javaMultipleFiles */ - javaMultipleFiles?: (boolean|null); - - /** FileOptions javaGenerateEqualsAndHash */ - javaGenerateEqualsAndHash?: (boolean|null); - - /** FileOptions javaStringCheckUtf8 */ - javaStringCheckUtf8?: (boolean|null); - - /** FileOptions optimizeFor */ - optimizeFor?: (google.protobuf.FileOptions.OptimizeMode|null); - - /** FileOptions goPackage */ - goPackage?: (string|null); - - /** FileOptions ccGenericServices */ - ccGenericServices?: (boolean|null); - - /** FileOptions javaGenericServices */ - javaGenericServices?: (boolean|null); - - /** FileOptions pyGenericServices */ - pyGenericServices?: (boolean|null); - - /** FileOptions deprecated */ - deprecated?: (boolean|null); - - /** FileOptions ccEnableArenas */ - ccEnableArenas?: (boolean|null); - - /** FileOptions objcClassPrefix */ - objcClassPrefix?: (string|null); - - /** FileOptions csharpNamespace */ - csharpNamespace?: (string|null); - - /** FileOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - - /** FileOptions .google.api.resourceDefinition */ - ".google.api.resourceDefinition"?: (google.api.IResourceDescriptor[]|null); - } - - /** Represents a FileOptions. */ - class FileOptions implements IFileOptions { - - /** - * Constructs a new FileOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFileOptions); - - /** FileOptions javaPackage. */ - public javaPackage: string; - - /** FileOptions javaOuterClassname. */ - public javaOuterClassname: string; - - /** FileOptions javaMultipleFiles. */ - public javaMultipleFiles: boolean; - - /** FileOptions javaGenerateEqualsAndHash. */ - public javaGenerateEqualsAndHash: boolean; - - /** FileOptions javaStringCheckUtf8. */ - public javaStringCheckUtf8: boolean; - - /** FileOptions optimizeFor. */ - public optimizeFor: google.protobuf.FileOptions.OptimizeMode; - - /** FileOptions goPackage. */ - public goPackage: string; - - /** FileOptions ccGenericServices. */ - public ccGenericServices: boolean; - - /** FileOptions javaGenericServices. */ - public javaGenericServices: boolean; - - /** FileOptions pyGenericServices. */ - public pyGenericServices: boolean; - - /** FileOptions deprecated. */ - public deprecated: boolean; - - /** FileOptions ccEnableArenas. */ - public ccEnableArenas: boolean; - - /** FileOptions objcClassPrefix. */ - public objcClassPrefix: string; - - /** FileOptions csharpNamespace. */ - public csharpNamespace: string; - - /** FileOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FileOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FileOptions; - - /** - * Creates a plain object from a FileOptions message. Also converts values to other types if specified. - * @param message FileOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FileOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FileOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - namespace FileOptions { - - /** OptimizeMode enum. */ - type OptimizeMode = - "SPEED"| "CODE_SIZE"| "LITE_RUNTIME"; - } - - /** Properties of a MessageOptions. */ - interface IMessageOptions { - - /** MessageOptions messageSetWireFormat */ - messageSetWireFormat?: (boolean|null); - - /** MessageOptions noStandardDescriptorAccessor */ - noStandardDescriptorAccessor?: (boolean|null); - - /** MessageOptions deprecated */ - deprecated?: (boolean|null); - - /** MessageOptions mapEntry */ - mapEntry?: (boolean|null); - - /** MessageOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - - /** MessageOptions .google.api.resource */ - ".google.api.resource"?: (google.api.IResourceDescriptor|null); - } - - /** Represents a MessageOptions. */ - class MessageOptions implements IMessageOptions { - - /** - * Constructs a new MessageOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IMessageOptions); - - /** MessageOptions messageSetWireFormat. */ - public messageSetWireFormat: boolean; - - /** MessageOptions noStandardDescriptorAccessor. */ - public noStandardDescriptorAccessor: boolean; - - /** MessageOptions deprecated. */ - public deprecated: boolean; - - /** MessageOptions mapEntry. */ - public mapEntry: boolean; - - /** MessageOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MessageOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.MessageOptions; - - /** - * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. - * @param message MessageOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.MessageOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MessageOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a FieldOptions. */ - interface IFieldOptions { - - /** FieldOptions ctype */ - ctype?: (google.protobuf.FieldOptions.CType|null); - - /** FieldOptions packed */ - packed?: (boolean|null); - - /** FieldOptions jstype */ - jstype?: (google.protobuf.FieldOptions.JSType|null); - - /** FieldOptions lazy */ - lazy?: (boolean|null); - - /** FieldOptions deprecated */ - deprecated?: (boolean|null); - - /** FieldOptions weak */ - weak?: (boolean|null); - - /** FieldOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - - /** FieldOptions .google.api.fieldBehavior */ - ".google.api.fieldBehavior"?: (google.api.FieldBehavior[]|null); - - /** FieldOptions .google.api.resourceReference */ - ".google.api.resourceReference"?: (google.api.IResourceReference|null); - } - - /** Represents a FieldOptions. */ - class FieldOptions implements IFieldOptions { - - /** - * Constructs a new FieldOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFieldOptions); - - /** FieldOptions ctype. */ - public ctype: google.protobuf.FieldOptions.CType; - - /** FieldOptions packed. */ - public packed: boolean; - - /** FieldOptions jstype. */ - public jstype: google.protobuf.FieldOptions.JSType; - - /** FieldOptions lazy. */ - public lazy: boolean; - - /** FieldOptions deprecated. */ - public deprecated: boolean; - - /** FieldOptions weak. */ - public weak: boolean; - - /** FieldOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FieldOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions; - - /** - * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. - * @param message FieldOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FieldOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FieldOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - namespace FieldOptions { - - /** CType enum. */ - type CType = - "STRING"| "CORD"| "STRING_PIECE"; - - /** JSType enum. */ - type JSType = - "JS_NORMAL"| "JS_STRING"| "JS_NUMBER"; - } - - /** Properties of an OneofOptions. */ - interface IOneofOptions { - - /** OneofOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - } - - /** Represents an OneofOptions. */ - class OneofOptions implements IOneofOptions { - - /** - * Constructs a new OneofOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IOneofOptions); - - /** OneofOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns OneofOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.OneofOptions; - - /** - * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. - * @param message OneofOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.OneofOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this OneofOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of an EnumOptions. */ - interface IEnumOptions { - - /** EnumOptions allowAlias */ - allowAlias?: (boolean|null); - - /** EnumOptions deprecated */ - deprecated?: (boolean|null); - - /** EnumOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - } - - /** Represents an EnumOptions. */ - class EnumOptions implements IEnumOptions { - - /** - * Constructs a new EnumOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IEnumOptions); - - /** EnumOptions allowAlias. */ - public allowAlias: boolean; - - /** EnumOptions deprecated. */ - public deprecated: boolean; - - /** EnumOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EnumOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.EnumOptions; - - /** - * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. - * @param message EnumOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.EnumOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EnumOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of an EnumValueOptions. */ - interface IEnumValueOptions { - - /** EnumValueOptions deprecated */ - deprecated?: (boolean|null); - - /** EnumValueOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - } - - /** Represents an EnumValueOptions. */ - class EnumValueOptions implements IEnumValueOptions { - - /** - * Constructs a new EnumValueOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IEnumValueOptions); - - /** EnumValueOptions deprecated. */ - public deprecated: boolean; - - /** EnumValueOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EnumValueOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueOptions; - - /** - * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. - * @param message EnumValueOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.EnumValueOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EnumValueOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a ServiceOptions. */ - interface IServiceOptions { - - /** ServiceOptions deprecated */ - deprecated?: (boolean|null); - - /** ServiceOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - - /** ServiceOptions .google.api.defaultHost */ - ".google.api.defaultHost"?: (string|null); - - /** ServiceOptions .google.api.oauthScopes */ - ".google.api.oauthScopes"?: (string|null); - } - - /** Represents a ServiceOptions. */ - class ServiceOptions implements IServiceOptions { - - /** - * Constructs a new ServiceOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IServiceOptions); - - /** ServiceOptions deprecated. */ - public deprecated: boolean; - - /** ServiceOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ServiceOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceOptions; - - /** - * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. - * @param message ServiceOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.ServiceOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ServiceOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a MethodOptions. */ - interface IMethodOptions { - - /** MethodOptions deprecated */ - deprecated?: (boolean|null); - - /** MethodOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - - /** MethodOptions .google.api.http */ - ".google.api.http"?: (google.api.IHttpRule|null); - - /** MethodOptions .google.api.methodSignature */ - ".google.api.methodSignature"?: (string[]|null); - - /** MethodOptions .google.longrunning.operationInfo */ - ".google.longrunning.operationInfo"?: (google.longrunning.IOperationInfo|null); - } - - /** Represents a MethodOptions. */ - class MethodOptions implements IMethodOptions { - - /** - * Constructs a new MethodOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IMethodOptions); - - /** MethodOptions deprecated. */ - public deprecated: boolean; - - /** MethodOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MethodOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.MethodOptions; - - /** - * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. - * @param message MethodOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.MethodOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MethodOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of an UninterpretedOption. */ - interface IUninterpretedOption { - - /** UninterpretedOption name */ - name?: (google.protobuf.UninterpretedOption.INamePart[]|null); - - /** UninterpretedOption identifierValue */ - identifierValue?: (string|null); - - /** UninterpretedOption positiveIntValue */ - positiveIntValue?: (number|string|null); - - /** UninterpretedOption negativeIntValue */ - negativeIntValue?: (number|string|null); - - /** UninterpretedOption doubleValue */ - doubleValue?: (number|null); - - /** UninterpretedOption stringValue */ - stringValue?: (Uint8Array|null); - - /** UninterpretedOption aggregateValue */ - aggregateValue?: (string|null); - } - - /** Represents an UninterpretedOption. */ - class UninterpretedOption implements IUninterpretedOption { - - /** - * Constructs a new UninterpretedOption. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IUninterpretedOption); - - /** UninterpretedOption name. */ - public name: google.protobuf.UninterpretedOption.INamePart[]; - - /** UninterpretedOption identifierValue. */ - public identifierValue: string; - - /** UninterpretedOption positiveIntValue. */ - public positiveIntValue: (number|string); - - /** UninterpretedOption negativeIntValue. */ - public negativeIntValue: (number|string); - - /** UninterpretedOption doubleValue. */ - public doubleValue: number; - - /** UninterpretedOption stringValue. */ - public stringValue: Uint8Array; - - /** UninterpretedOption aggregateValue. */ - public aggregateValue: string; - - /** - * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UninterpretedOption - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption; - - /** - * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. - * @param message UninterpretedOption - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.UninterpretedOption, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UninterpretedOption to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - namespace UninterpretedOption { - - /** Properties of a NamePart. */ - interface INamePart { - - /** NamePart namePart */ - namePart: string; - - /** NamePart isExtension */ - isExtension: boolean; - } - - /** Represents a NamePart. */ - class NamePart implements INamePart { - - /** - * Constructs a new NamePart. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.UninterpretedOption.INamePart); - - /** NamePart namePart. */ - public namePart: string; - - /** NamePart isExtension. */ - public isExtension: boolean; - - /** - * Creates a NamePart message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns NamePart - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption.NamePart; - - /** - * Creates a plain object from a NamePart message. Also converts values to other types if specified. - * @param message NamePart - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.UninterpretedOption.NamePart, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this NamePart to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } - - /** Properties of a SourceCodeInfo. */ - interface ISourceCodeInfo { - - /** SourceCodeInfo location */ - location?: (google.protobuf.SourceCodeInfo.ILocation[]|null); - } - - /** Represents a SourceCodeInfo. */ - class SourceCodeInfo implements ISourceCodeInfo { - - /** - * Constructs a new SourceCodeInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.ISourceCodeInfo); - - /** SourceCodeInfo location. */ - public location: google.protobuf.SourceCodeInfo.ILocation[]; - - /** - * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SourceCodeInfo - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo; - - /** - * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. - * @param message SourceCodeInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.SourceCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SourceCodeInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - namespace SourceCodeInfo { - - /** Properties of a Location. */ - interface ILocation { - - /** Location path */ - path?: (number[]|null); - - /** Location span */ - span?: (number[]|null); - - /** Location leadingComments */ - leadingComments?: (string|null); - - /** Location trailingComments */ - trailingComments?: (string|null); - - /** Location leadingDetachedComments */ - leadingDetachedComments?: (string[]|null); - } - - /** Represents a Location. */ - class Location implements ILocation { - - /** - * Constructs a new Location. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.SourceCodeInfo.ILocation); - - /** Location path. */ - public path: number[]; - - /** Location span. */ - public span: number[]; - - /** Location leadingComments. */ - public leadingComments: string; - - /** Location trailingComments. */ - public trailingComments: string; - - /** Location leadingDetachedComments. */ - public leadingDetachedComments: string[]; - - /** - * Creates a Location message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Location - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo.Location; - - /** - * Creates a plain object from a Location message. Also converts values to other types if specified. - * @param message Location - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.SourceCodeInfo.Location, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Location to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } - - /** Properties of a GeneratedCodeInfo. */ - interface IGeneratedCodeInfo { - - /** GeneratedCodeInfo annotation */ - annotation?: (google.protobuf.GeneratedCodeInfo.IAnnotation[]|null); - } - - /** Represents a GeneratedCodeInfo. */ - class GeneratedCodeInfo implements IGeneratedCodeInfo { - - /** - * Constructs a new GeneratedCodeInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IGeneratedCodeInfo); - - /** GeneratedCodeInfo annotation. */ - public annotation: google.protobuf.GeneratedCodeInfo.IAnnotation[]; - - /** - * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GeneratedCodeInfo - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo; - - /** - * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. - * @param message GeneratedCodeInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.GeneratedCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GeneratedCodeInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - namespace GeneratedCodeInfo { - - /** Properties of an Annotation. */ - interface IAnnotation { - - /** Annotation path */ - path?: (number[]|null); - - /** Annotation sourceFile */ - sourceFile?: (string|null); - - /** Annotation begin */ - begin?: (number|null); - - /** Annotation end */ - end?: (number|null); - } - - /** Represents an Annotation. */ - class Annotation implements IAnnotation { - - /** - * Constructs a new Annotation. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation); - - /** Annotation path. */ - public path: number[]; - - /** Annotation sourceFile. */ - public sourceFile: string; - - /** Annotation begin. */ - public begin: number; - - /** Annotation end. */ - public end: number; - - /** - * Creates an Annotation message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Annotation - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo.Annotation; - - /** - * Creates a plain object from an Annotation message. Also converts values to other types if specified. - * @param message Annotation - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.GeneratedCodeInfo.Annotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Annotation to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } - - /** Properties of a Struct. */ - interface IStruct { - - /** Struct fields */ - fields?: ({ [k: string]: google.protobuf.IValue }|null); - } - - /** Represents a Struct. */ - class Struct implements IStruct { - - /** - * Constructs a new Struct. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IStruct); - - /** Struct fields. */ - public fields: { [k: string]: google.protobuf.IValue }; - - /** - * Creates a Struct message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Struct - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Struct; - - /** - * Creates a plain object from a Struct message. Also converts values to other types if specified. - * @param message Struct - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.Struct, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Struct to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a Value. */ - interface IValue { - - /** Value nullValue */ - nullValue?: (google.protobuf.NullValue|null); - - /** Value numberValue */ - numberValue?: (number|null); - - /** Value stringValue */ - stringValue?: (string|null); - - /** Value boolValue */ - boolValue?: (boolean|null); - - /** Value structValue */ - structValue?: (google.protobuf.IStruct|null); - - /** Value listValue */ - listValue?: (google.protobuf.IListValue|null); - } - - /** Represents a Value. */ - class Value implements IValue { - - /** - * Constructs a new Value. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IValue); - - /** Value nullValue. */ - public nullValue?: (google.protobuf.NullValue|null); - - /** Value numberValue. */ - public numberValue?: (number|null); - - /** Value stringValue. */ - public stringValue?: (string|null); - - /** Value boolValue. */ - public boolValue?: (boolean|null); - - /** Value structValue. */ - public structValue?: (google.protobuf.IStruct|null); - - /** Value listValue. */ - public listValue?: (google.protobuf.IListValue|null); - - /** Value kind. */ - public kind?: ("nullValue"|"numberValue"|"stringValue"|"boolValue"|"structValue"|"listValue"); - - /** - * Creates a Value message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Value - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Value; - - /** - * Creates a plain object from a Value message. Also converts values to other types if specified. - * @param message Value - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Value to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** NullValue enum. */ - type NullValue = - "NULL_VALUE"; - - /** Properties of a ListValue. */ - interface IListValue { - - /** ListValue values */ - values?: (google.protobuf.IValue[]|null); - } - - /** Represents a ListValue. */ - class ListValue implements IListValue { - - /** - * Constructs a new ListValue. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IListValue); - - /** ListValue values. */ - public values: google.protobuf.IValue[]; - - /** - * Creates a ListValue message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListValue - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.ListValue; - - /** - * Creates a plain object from a ListValue message. Also converts values to other types if specified. - * @param message ListValue - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.ListValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListValue to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of an Empty. */ - interface IEmpty { - } - - /** Represents an Empty. */ - class Empty implements IEmpty { - - /** - * Constructs a new Empty. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IEmpty); - - /** - * Creates an Empty message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Empty - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Empty; - - /** - * Creates a plain object from an Empty message. Also converts values to other types if specified. - * @param message Empty - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.Empty, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Empty to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a DoubleValue. */ - interface IDoubleValue { - - /** DoubleValue value */ - value?: (number|null); - } - - /** Represents a DoubleValue. */ - class DoubleValue implements IDoubleValue { - - /** - * Constructs a new DoubleValue. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IDoubleValue); - - /** DoubleValue value. */ - public value: number; - - /** - * Creates a DoubleValue message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DoubleValue - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.DoubleValue; - - /** - * Creates a plain object from a DoubleValue message. Also converts values to other types if specified. - * @param message DoubleValue - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.DoubleValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DoubleValue to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a FloatValue. */ - interface IFloatValue { - - /** FloatValue value */ - value?: (number|null); - } - - /** Represents a FloatValue. */ - class FloatValue implements IFloatValue { - - /** - * Constructs a new FloatValue. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFloatValue); - - /** FloatValue value. */ - public value: number; - - /** - * Creates a FloatValue message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FloatValue - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FloatValue; - - /** - * Creates a plain object from a FloatValue message. Also converts values to other types if specified. - * @param message FloatValue - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FloatValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FloatValue to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of an Int64Value. */ - interface IInt64Value { - - /** Int64Value value */ - value?: (number|string|null); - } - - /** Represents an Int64Value. */ - class Int64Value implements IInt64Value { - - /** - * Constructs a new Int64Value. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IInt64Value); - - /** Int64Value value. */ - public value: (number|string); - - /** - * Creates an Int64Value message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Int64Value - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Int64Value; - - /** - * Creates a plain object from an Int64Value message. Also converts values to other types if specified. - * @param message Int64Value - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.Int64Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Int64Value to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a UInt64Value. */ - interface IUInt64Value { - - /** UInt64Value value */ - value?: (number|string|null); - } - - /** Represents a UInt64Value. */ - class UInt64Value implements IUInt64Value { - - /** - * Constructs a new UInt64Value. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IUInt64Value); - - /** UInt64Value value. */ - public value: (number|string); - - /** - * Creates a UInt64Value message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UInt64Value - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.UInt64Value; - - /** - * Creates a plain object from a UInt64Value message. Also converts values to other types if specified. - * @param message UInt64Value - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.UInt64Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UInt64Value to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of an Int32Value. */ - interface IInt32Value { - - /** Int32Value value */ - value?: (number|null); - } - - /** Represents an Int32Value. */ - class Int32Value implements IInt32Value { - - /** - * Constructs a new Int32Value. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IInt32Value); - - /** Int32Value value. */ - public value: number; - - /** - * Creates an Int32Value message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Int32Value - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Int32Value; - - /** - * Creates a plain object from an Int32Value message. Also converts values to other types if specified. - * @param message Int32Value - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.Int32Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Int32Value to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a UInt32Value. */ - interface IUInt32Value { - - /** UInt32Value value */ - value?: (number|null); - } - - /** Represents a UInt32Value. */ - class UInt32Value implements IUInt32Value { - - /** - * Constructs a new UInt32Value. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IUInt32Value); - - /** UInt32Value value. */ - public value: number; - - /** - * Creates a UInt32Value message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UInt32Value - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.UInt32Value; - - /** - * Creates a plain object from a UInt32Value message. Also converts values to other types if specified. - * @param message UInt32Value - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.UInt32Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UInt32Value to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a BoolValue. */ - interface IBoolValue { - - /** BoolValue value */ - value?: (boolean|null); - } - - /** Represents a BoolValue. */ - class BoolValue implements IBoolValue { - - /** - * Constructs a new BoolValue. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IBoolValue); - - /** BoolValue value. */ - public value: boolean; - - /** - * Creates a BoolValue message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BoolValue - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.BoolValue; - - /** - * Creates a plain object from a BoolValue message. Also converts values to other types if specified. - * @param message BoolValue - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.BoolValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BoolValue to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a StringValue. */ - interface IStringValue { - - /** StringValue value */ - value?: (string|null); - } - - /** Represents a StringValue. */ - class StringValue implements IStringValue { - - /** - * Constructs a new StringValue. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IStringValue); - - /** StringValue value. */ - public value: string; - - /** - * Creates a StringValue message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns StringValue - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.StringValue; - - /** - * Creates a plain object from a StringValue message. Also converts values to other types if specified. - * @param message StringValue - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.StringValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this StringValue to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a BytesValue. */ - interface IBytesValue { - - /** BytesValue value */ - value?: (Uint8Array|null); - } - - /** Represents a BytesValue. */ - class BytesValue implements IBytesValue { - - /** - * Constructs a new BytesValue. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IBytesValue); - - /** BytesValue value. */ - public value: Uint8Array; - - /** - * Creates a BytesValue message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BytesValue - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.BytesValue; - - /** - * Creates a plain object from a BytesValue message. Also converts values to other types if specified. - * @param message BytesValue - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.BytesValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BytesValue to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of an Any. */ - interface IAny { - - /** Any type_url */ - type_url?: (string|null); - - /** Any value */ - value?: (Uint8Array|null); - } - - /** Represents an Any. */ - class Any implements IAny { - - /** - * Constructs a new Any. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IAny); - - /** Any type_url. */ - public type_url: string; - - /** Any value. */ - public value: Uint8Array; - - /** - * Creates an Any message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Any - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Any; - - /** - * Creates a plain object from an Any message. Also converts values to other types if specified. - * @param message Any - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.Any, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Any to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a FieldMask. */ - interface IFieldMask { - - /** FieldMask paths */ - paths?: (string[]|null); - } - - /** Represents a FieldMask. */ - class FieldMask implements IFieldMask { - - /** - * Constructs a new FieldMask. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFieldMask); - - /** FieldMask paths. */ - public paths: string[]; - - /** - * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FieldMask - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FieldMask; - - /** - * Creates a plain object from a FieldMask message. Also converts values to other types if specified. - * @param message FieldMask - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FieldMask, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FieldMask to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a Duration. */ - interface IDuration { - - /** Duration seconds */ - seconds?: (number|string|null); - - /** Duration nanos */ - nanos?: (number|null); - } - - /** Represents a Duration. */ - class Duration implements IDuration { - - /** - * Constructs a new Duration. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IDuration); - - /** Duration seconds. */ - public seconds: (number|string); - - /** Duration nanos. */ - public nanos: number; - - /** - * Creates a Duration message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Duration - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Duration; - - /** - * Creates a plain object from a Duration message. Also converts values to other types if specified. - * @param message Duration - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.Duration, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Duration to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } - - /** Namespace firestore. */ - namespace firestore { - - /** Namespace v1. */ - namespace v1 { - - /** Properties of a DocumentMask. */ - interface IDocumentMask { - - /** DocumentMask fieldPaths */ - fieldPaths?: (string[]|null); - } - - /** Represents a DocumentMask. */ - class DocumentMask implements IDocumentMask { - - /** - * Constructs a new DocumentMask. - * @param [properties] Properties to set - */ - constructor(properties?: google.firestore.v1.IDocumentMask); - - /** DocumentMask fieldPaths. */ - public fieldPaths: string[]; - - /** - * Creates a DocumentMask message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DocumentMask - */ - public static fromObject(object: { [k: string]: any }): google.firestore.v1.DocumentMask; - - /** - * Creates a plain object from a DocumentMask message. Also converts values to other types if specified. - * @param message DocumentMask - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.v1.DocumentMask, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DocumentMask to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a Precondition. */ - interface IPrecondition { - - /** Precondition exists */ - exists?: (boolean|null); - - /** Precondition updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); - } - - /** Represents a Precondition. */ - class Precondition implements IPrecondition { - - /** - * Constructs a new Precondition. - * @param [properties] Properties to set - */ - constructor(properties?: google.firestore.v1.IPrecondition); - - /** Precondition exists. */ - public exists?: (boolean|null); - - /** Precondition updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); - - /** Precondition conditionType. */ - public conditionType?: ("exists"|"updateTime"); - - /** - * Creates a Precondition message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Precondition - */ - public static fromObject(object: { [k: string]: any }): google.firestore.v1.Precondition; - - /** - * Creates a plain object from a Precondition message. Also converts values to other types if specified. - * @param message Precondition - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.v1.Precondition, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Precondition to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a TransactionOptions. */ - interface ITransactionOptions { - - /** TransactionOptions readOnly */ - readOnly?: (google.firestore.v1.TransactionOptions.IReadOnly|null); - - /** TransactionOptions readWrite */ - readWrite?: (google.firestore.v1.TransactionOptions.IReadWrite|null); - } - - /** Represents a TransactionOptions. */ - class TransactionOptions implements ITransactionOptions { - - /** - * Constructs a new TransactionOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.firestore.v1.ITransactionOptions); - - /** TransactionOptions readOnly. */ - public readOnly?: (google.firestore.v1.TransactionOptions.IReadOnly|null); - - /** TransactionOptions readWrite. */ - public readWrite?: (google.firestore.v1.TransactionOptions.IReadWrite|null); - - /** TransactionOptions mode. */ - public mode?: ("readOnly"|"readWrite"); - - /** - * Creates a TransactionOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TransactionOptions - */ - public static fromObject(object: { [k: string]: any }): google.firestore.v1.TransactionOptions; - - /** - * Creates a plain object from a TransactionOptions message. Also converts values to other types if specified. - * @param message TransactionOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.v1.TransactionOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TransactionOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - namespace TransactionOptions { - - /** Properties of a ReadWrite. */ - interface IReadWrite { - - /** ReadWrite retryTransaction */ - retryTransaction?: (Uint8Array|null); - } - - /** Represents a ReadWrite. */ - class ReadWrite implements IReadWrite { - - /** - * Constructs a new ReadWrite. - * @param [properties] Properties to set - */ - constructor(properties?: google.firestore.v1.TransactionOptions.IReadWrite); - - /** ReadWrite retryTransaction. */ - public retryTransaction: Uint8Array; - - /** - * Creates a ReadWrite message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ReadWrite - */ - public static fromObject(object: { [k: string]: any }): google.firestore.v1.TransactionOptions.ReadWrite; - - /** - * Creates a plain object from a ReadWrite message. Also converts values to other types if specified. - * @param message ReadWrite - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.v1.TransactionOptions.ReadWrite, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ReadWrite to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a ReadOnly. */ - interface IReadOnly { - - /** ReadOnly readTime */ - readTime?: (google.protobuf.ITimestamp|null); - } - - /** Represents a ReadOnly. */ - class ReadOnly implements IReadOnly { - - /** - * Constructs a new ReadOnly. - * @param [properties] Properties to set - */ - constructor(properties?: google.firestore.v1.TransactionOptions.IReadOnly); - - /** ReadOnly readTime. */ - public readTime?: (google.protobuf.ITimestamp|null); - - /** ReadOnly consistencySelector. */ - public consistencySelector?: "readTime"; - - /** - * Creates a ReadOnly message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ReadOnly - */ - public static fromObject(object: { [k: string]: any }): google.firestore.v1.TransactionOptions.ReadOnly; - - /** - * Creates a plain object from a ReadOnly message. Also converts values to other types if specified. - * @param message ReadOnly - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.v1.TransactionOptions.ReadOnly, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ReadOnly to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } - - /** Properties of a Document. */ - interface IDocument { - - /** Document name */ - name?: (string|null); - - /** Document fields */ - fields?: ({ [k: string]: google.firestore.v1.IValue }|null); - - /** Document createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** Document updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); - } - - /** Represents a Document. */ - class Document implements IDocument { - - /** - * Constructs a new Document. - * @param [properties] Properties to set - */ - constructor(properties?: google.firestore.v1.IDocument); - - /** Document name. */ - public name: string; - - /** Document fields. */ - public fields: { [k: string]: google.firestore.v1.IValue }; - - /** Document createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** Document updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); - - /** - * Creates a Document message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Document - */ - public static fromObject(object: { [k: string]: any }): google.firestore.v1.Document; - - /** - * Creates a plain object from a Document message. Also converts values to other types if specified. - * @param message Document - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.v1.Document, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Document to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a Value. */ - interface IValue { - - /** Value nullValue */ - nullValue?: (google.protobuf.NullValue|null); - - /** Value booleanValue */ - booleanValue?: (boolean|null); - - /** Value integerValue */ - integerValue?: (number|string|null); - - /** Value doubleValue */ - doubleValue?: (number|null); - - /** Value timestampValue */ - timestampValue?: (google.protobuf.ITimestamp|null); - - /** Value stringValue */ - stringValue?: (string|null); - - /** Value bytesValue */ - bytesValue?: (Uint8Array|null); - - /** Value referenceValue */ - referenceValue?: (string|null); - - /** Value geoPointValue */ - geoPointValue?: (google.type.ILatLng|null); - - /** Value arrayValue */ - arrayValue?: (google.firestore.v1.IArrayValue|null); - - /** Value mapValue */ - mapValue?: (google.firestore.v1.IMapValue|null); - } - - /** Represents a Value. */ - class Value implements IValue { - - /** - * Constructs a new Value. - * @param [properties] Properties to set - */ - constructor(properties?: google.firestore.v1.IValue); - - /** Value nullValue. */ - public nullValue?: (google.protobuf.NullValue|null); - - /** Value booleanValue. */ - public booleanValue?: (boolean|null); - - /** Value integerValue. */ - public integerValue?: (number|string|null); - - /** Value doubleValue. */ - public doubleValue?: (number|null); - - /** Value timestampValue. */ - public timestampValue?: (google.protobuf.ITimestamp|null); - - /** Value stringValue. */ - public stringValue?: (string|null); - - /** Value bytesValue. */ - public bytesValue?: (Uint8Array|null); - - /** Value referenceValue. */ - public referenceValue?: (string|null); - - /** Value geoPointValue. */ - public geoPointValue?: (google.type.ILatLng|null); - - /** Value arrayValue. */ - public arrayValue?: (google.firestore.v1.IArrayValue|null); - - /** Value mapValue. */ - public mapValue?: (google.firestore.v1.IMapValue|null); - - /** Value valueType. */ - public valueType?: ("nullValue"|"booleanValue"|"integerValue"|"doubleValue"|"timestampValue"|"stringValue"|"bytesValue"|"referenceValue"|"geoPointValue"|"arrayValue"|"mapValue"); - - /** - * Creates a Value message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Value - */ - public static fromObject(object: { [k: string]: any }): google.firestore.v1.Value; - - /** - * Creates a plain object from a Value message. Also converts values to other types if specified. - * @param message Value - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.v1.Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Value to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of an ArrayValue. */ - interface IArrayValue { - - /** ArrayValue values */ - values?: (google.firestore.v1.IValue[]|null); - } - - /** Represents an ArrayValue. */ - class ArrayValue implements IArrayValue { - - /** - * Constructs a new ArrayValue. - * @param [properties] Properties to set - */ - constructor(properties?: google.firestore.v1.IArrayValue); - - /** ArrayValue values. */ - public values: google.firestore.v1.IValue[]; - - /** - * Creates an ArrayValue message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ArrayValue - */ - public static fromObject(object: { [k: string]: any }): google.firestore.v1.ArrayValue; - - /** - * Creates a plain object from an ArrayValue message. Also converts values to other types if specified. - * @param message ArrayValue - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.v1.ArrayValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ArrayValue to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a MapValue. */ - interface IMapValue { - - /** MapValue fields */ - fields?: ({ [k: string]: google.firestore.v1.IValue }|null); - } - - /** Represents a MapValue. */ - class MapValue implements IMapValue { - - /** - * Constructs a new MapValue. - * @param [properties] Properties to set - */ - constructor(properties?: google.firestore.v1.IMapValue); - - /** MapValue fields. */ - public fields: { [k: string]: google.firestore.v1.IValue }; - - /** - * Creates a MapValue message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MapValue - */ - public static fromObject(object: { [k: string]: any }): google.firestore.v1.MapValue; - - /** - * Creates a plain object from a MapValue message. Also converts values to other types if specified. - * @param message MapValue - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.v1.MapValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MapValue to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Represents a Firestore */ - class Firestore extends $protobuf.rpc.Service { - - /** - * Constructs a new Firestore service. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - */ - constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); - - /** - * Calls GetDocument. - * @param request GetDocumentRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Document - */ - public getDocument(request: google.firestore.v1.IGetDocumentRequest, callback: google.firestore.v1.Firestore.GetDocumentCallback): void; - - /** - * Calls GetDocument. - * @param request GetDocumentRequest message or plain object - * @returns Promise - */ - public getDocument(request: google.firestore.v1.IGetDocumentRequest): Promise; - - /** - * Calls ListDocuments. - * @param request ListDocumentsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListDocumentsResponse - */ - public listDocuments(request: google.firestore.v1.IListDocumentsRequest, callback: google.firestore.v1.Firestore.ListDocumentsCallback): void; - - /** - * Calls ListDocuments. - * @param request ListDocumentsRequest message or plain object - * @returns Promise - */ - public listDocuments(request: google.firestore.v1.IListDocumentsRequest): Promise; - - /** - * Calls UpdateDocument. - * @param request UpdateDocumentRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Document - */ - public updateDocument(request: google.firestore.v1.IUpdateDocumentRequest, callback: google.firestore.v1.Firestore.UpdateDocumentCallback): void; - - /** - * Calls UpdateDocument. - * @param request UpdateDocumentRequest message or plain object - * @returns Promise - */ - public updateDocument(request: google.firestore.v1.IUpdateDocumentRequest): Promise; - - /** - * Calls DeleteDocument. - * @param request DeleteDocumentRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty - */ - public deleteDocument(request: google.firestore.v1.IDeleteDocumentRequest, callback: google.firestore.v1.Firestore.DeleteDocumentCallback): void; - - /** - * Calls DeleteDocument. - * @param request DeleteDocumentRequest message or plain object - * @returns Promise - */ - public deleteDocument(request: google.firestore.v1.IDeleteDocumentRequest): Promise; - - /** - * Calls BatchGetDocuments. - * @param request BatchGetDocumentsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and BatchGetDocumentsResponse - */ - public batchGetDocuments(request: google.firestore.v1.IBatchGetDocumentsRequest, callback: google.firestore.v1.Firestore.BatchGetDocumentsCallback): void; - - /** - * Calls BatchGetDocuments. - * @param request BatchGetDocumentsRequest message or plain object - * @returns Promise - */ - public batchGetDocuments(request: google.firestore.v1.IBatchGetDocumentsRequest): Promise; - - /** - * Calls BeginTransaction. - * @param request BeginTransactionRequest message or plain object - * @param callback Node-style callback called with the error, if any, and BeginTransactionResponse - */ - public beginTransaction(request: google.firestore.v1.IBeginTransactionRequest, callback: google.firestore.v1.Firestore.BeginTransactionCallback): void; - - /** - * Calls BeginTransaction. - * @param request BeginTransactionRequest message or plain object - * @returns Promise - */ - public beginTransaction(request: google.firestore.v1.IBeginTransactionRequest): Promise; - - /** - * Calls Commit. - * @param request CommitRequest message or plain object - * @param callback Node-style callback called with the error, if any, and CommitResponse - */ - public commit(request: google.firestore.v1.ICommitRequest, callback: google.firestore.v1.Firestore.CommitCallback): void; - - /** - * Calls Commit. - * @param request CommitRequest message or plain object - * @returns Promise - */ - public commit(request: google.firestore.v1.ICommitRequest): Promise; - - /** - * Calls Rollback. - * @param request RollbackRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty - */ - public rollback(request: google.firestore.v1.IRollbackRequest, callback: google.firestore.v1.Firestore.RollbackCallback): void; - - /** - * Calls Rollback. - * @param request RollbackRequest message or plain object - * @returns Promise - */ - public rollback(request: google.firestore.v1.IRollbackRequest): Promise; - - /** - * Calls RunQuery. - * @param request RunQueryRequest message or plain object - * @param callback Node-style callback called with the error, if any, and RunQueryResponse - */ - public runQuery(request: google.firestore.v1.IRunQueryRequest, callback: google.firestore.v1.Firestore.RunQueryCallback): void; - - /** - * Calls RunQuery. - * @param request RunQueryRequest message or plain object - * @returns Promise - */ - public runQuery(request: google.firestore.v1.IRunQueryRequest): Promise; - - /** - * Calls PartitionQuery. - * @param request PartitionQueryRequest message or plain object - * @param callback Node-style callback called with the error, if any, and PartitionQueryResponse - */ - public partitionQuery(request: google.firestore.v1.IPartitionQueryRequest, callback: google.firestore.v1.Firestore.PartitionQueryCallback): void; - - /** - * Calls PartitionQuery. - * @param request PartitionQueryRequest message or plain object - * @returns Promise - */ - public partitionQuery(request: google.firestore.v1.IPartitionQueryRequest): Promise; - - /** - * Calls Write. - * @param request WriteRequest message or plain object - * @param callback Node-style callback called with the error, if any, and WriteResponse - */ - public write(request: google.firestore.v1.IWriteRequest, callback: google.firestore.v1.Firestore.WriteCallback): void; - - /** - * Calls Write. - * @param request WriteRequest message or plain object - * @returns Promise - */ - public write(request: google.firestore.v1.IWriteRequest): Promise; - - /** - * Calls Listen. - * @param request ListenRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListenResponse - */ - public listen(request: google.firestore.v1.IListenRequest, callback: google.firestore.v1.Firestore.ListenCallback): void; - - /** - * Calls Listen. - * @param request ListenRequest message or plain object - * @returns Promise - */ - public listen(request: google.firestore.v1.IListenRequest): Promise; - - /** - * Calls ListCollectionIds. - * @param request ListCollectionIdsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListCollectionIdsResponse - */ - public listCollectionIds(request: google.firestore.v1.IListCollectionIdsRequest, callback: google.firestore.v1.Firestore.ListCollectionIdsCallback): void; - - /** - * Calls ListCollectionIds. - * @param request ListCollectionIdsRequest message or plain object - * @returns Promise - */ - public listCollectionIds(request: google.firestore.v1.IListCollectionIdsRequest): Promise; - - /** - * Calls BatchWrite. - * @param request BatchWriteRequest message or plain object - * @param callback Node-style callback called with the error, if any, and BatchWriteResponse - */ - public batchWrite(request: google.firestore.v1.IBatchWriteRequest, callback: google.firestore.v1.Firestore.BatchWriteCallback): void; - - /** - * Calls BatchWrite. - * @param request BatchWriteRequest message or plain object - * @returns Promise - */ - public batchWrite(request: google.firestore.v1.IBatchWriteRequest): Promise; - - /** - * Calls CreateDocument. - * @param request CreateDocumentRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Document - */ - public createDocument(request: google.firestore.v1.ICreateDocumentRequest, callback: google.firestore.v1.Firestore.CreateDocumentCallback): void; - - /** - * Calls CreateDocument. - * @param request CreateDocumentRequest message or plain object - * @returns Promise - */ - public createDocument(request: google.firestore.v1.ICreateDocumentRequest): Promise; - } - - namespace Firestore { - - /** - * Callback as used by {@link google.firestore.v1.Firestore#getDocument}. - * @param error Error, if any - * @param [response] Document - */ - type GetDocumentCallback = (error: (Error|null), response?: google.firestore.v1.Document) => void; - - /** - * Callback as used by {@link google.firestore.v1.Firestore#listDocuments}. - * @param error Error, if any - * @param [response] ListDocumentsResponse - */ - type ListDocumentsCallback = (error: (Error|null), response?: google.firestore.v1.ListDocumentsResponse) => void; - - /** - * Callback as used by {@link google.firestore.v1.Firestore#updateDocument}. - * @param error Error, if any - * @param [response] Document - */ - type UpdateDocumentCallback = (error: (Error|null), response?: google.firestore.v1.Document) => void; - - /** - * Callback as used by {@link google.firestore.v1.Firestore#deleteDocument}. - * @param error Error, if any - * @param [response] Empty - */ - type DeleteDocumentCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - - /** - * Callback as used by {@link google.firestore.v1.Firestore#batchGetDocuments}. - * @param error Error, if any - * @param [response] BatchGetDocumentsResponse - */ - type BatchGetDocumentsCallback = (error: (Error|null), response?: google.firestore.v1.BatchGetDocumentsResponse) => void; - - /** - * Callback as used by {@link google.firestore.v1.Firestore#beginTransaction}. - * @param error Error, if any - * @param [response] BeginTransactionResponse - */ - type BeginTransactionCallback = (error: (Error|null), response?: google.firestore.v1.BeginTransactionResponse) => void; - - /** - * Callback as used by {@link google.firestore.v1.Firestore#commit}. - * @param error Error, if any - * @param [response] CommitResponse - */ - type CommitCallback = (error: (Error|null), response?: google.firestore.v1.CommitResponse) => void; - - /** - * Callback as used by {@link google.firestore.v1.Firestore#rollback}. - * @param error Error, if any - * @param [response] Empty - */ - type RollbackCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - - /** - * Callback as used by {@link google.firestore.v1.Firestore#runQuery}. - * @param error Error, if any - * @param [response] RunQueryResponse - */ - type RunQueryCallback = (error: (Error|null), response?: google.firestore.v1.RunQueryResponse) => void; - - /** - * Callback as used by {@link google.firestore.v1.Firestore#partitionQuery}. - * @param error Error, if any - * @param [response] PartitionQueryResponse - */ - type PartitionQueryCallback = (error: (Error|null), response?: google.firestore.v1.PartitionQueryResponse) => void; - - /** - * Callback as used by {@link google.firestore.v1.Firestore#write}. - * @param error Error, if any - * @param [response] WriteResponse - */ - type WriteCallback = (error: (Error|null), response?: google.firestore.v1.WriteResponse) => void; - - /** - * Callback as used by {@link google.firestore.v1.Firestore#listen}. - * @param error Error, if any - * @param [response] ListenResponse - */ - type ListenCallback = (error: (Error|null), response?: google.firestore.v1.ListenResponse) => void; - - /** - * Callback as used by {@link google.firestore.v1.Firestore#listCollectionIds}. - * @param error Error, if any - * @param [response] ListCollectionIdsResponse - */ - type ListCollectionIdsCallback = (error: (Error|null), response?: google.firestore.v1.ListCollectionIdsResponse) => void; - - /** - * Callback as used by {@link google.firestore.v1.Firestore#batchWrite}. - * @param error Error, if any - * @param [response] BatchWriteResponse - */ - type BatchWriteCallback = (error: (Error|null), response?: google.firestore.v1.BatchWriteResponse) => void; - - /** - * Callback as used by {@link google.firestore.v1.Firestore#createDocument}. - * @param error Error, if any - * @param [response] Document - */ - type CreateDocumentCallback = (error: (Error|null), response?: google.firestore.v1.Document) => void; - } - - /** Properties of a GetDocumentRequest. */ - interface IGetDocumentRequest { - - /** GetDocumentRequest name */ - name?: (string|null); - - /** GetDocumentRequest mask */ - mask?: (google.firestore.v1.IDocumentMask|null); - - /** GetDocumentRequest transaction */ - transaction?: (Uint8Array|null); - - /** GetDocumentRequest readTime */ - readTime?: (google.protobuf.ITimestamp|null); - } - - /** Represents a GetDocumentRequest. */ - class GetDocumentRequest implements IGetDocumentRequest { - - /** - * Constructs a new GetDocumentRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.firestore.v1.IGetDocumentRequest); - - /** GetDocumentRequest name. */ - public name: string; - - /** GetDocumentRequest mask. */ - public mask?: (google.firestore.v1.IDocumentMask|null); - - /** GetDocumentRequest transaction. */ - public transaction?: (Uint8Array|null); - - /** GetDocumentRequest readTime. */ - public readTime?: (google.protobuf.ITimestamp|null); - - /** GetDocumentRequest consistencySelector. */ - public consistencySelector?: ("transaction"|"readTime"); - - /** - * Creates a GetDocumentRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetDocumentRequest - */ - public static fromObject(object: { [k: string]: any }): google.firestore.v1.GetDocumentRequest; - - /** - * Creates a plain object from a GetDocumentRequest message. Also converts values to other types if specified. - * @param message GetDocumentRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.v1.GetDocumentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetDocumentRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a ListDocumentsRequest. */ - interface IListDocumentsRequest { - - /** ListDocumentsRequest parent */ - parent?: (string|null); - - /** ListDocumentsRequest collectionId */ - collectionId?: (string|null); - - /** ListDocumentsRequest pageSize */ - pageSize?: (number|null); - - /** ListDocumentsRequest pageToken */ - pageToken?: (string|null); - - /** ListDocumentsRequest orderBy */ - orderBy?: (string|null); - - /** ListDocumentsRequest mask */ - mask?: (google.firestore.v1.IDocumentMask|null); - - /** ListDocumentsRequest transaction */ - transaction?: (Uint8Array|null); - - /** ListDocumentsRequest readTime */ - readTime?: (google.protobuf.ITimestamp|null); - - /** ListDocumentsRequest showMissing */ - showMissing?: (boolean|null); - } - - /** Represents a ListDocumentsRequest. */ - class ListDocumentsRequest implements IListDocumentsRequest { - - /** - * Constructs a new ListDocumentsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.firestore.v1.IListDocumentsRequest); - - /** ListDocumentsRequest parent. */ - public parent: string; - - /** ListDocumentsRequest collectionId. */ - public collectionId: string; - - /** ListDocumentsRequest pageSize. */ - public pageSize: number; - - /** ListDocumentsRequest pageToken. */ - public pageToken: string; - - /** ListDocumentsRequest orderBy. */ - public orderBy: string; - - /** ListDocumentsRequest mask. */ - public mask?: (google.firestore.v1.IDocumentMask|null); - - /** ListDocumentsRequest transaction. */ - public transaction?: (Uint8Array|null); - - /** ListDocumentsRequest readTime. */ - public readTime?: (google.protobuf.ITimestamp|null); - - /** ListDocumentsRequest showMissing. */ - public showMissing: boolean; - - /** ListDocumentsRequest consistencySelector. */ - public consistencySelector?: ("transaction"|"readTime"); - - /** - * Creates a ListDocumentsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListDocumentsRequest - */ - public static fromObject(object: { [k: string]: any }): google.firestore.v1.ListDocumentsRequest; - - /** - * Creates a plain object from a ListDocumentsRequest message. Also converts values to other types if specified. - * @param message ListDocumentsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.v1.ListDocumentsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListDocumentsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a ListDocumentsResponse. */ - interface IListDocumentsResponse { - - /** ListDocumentsResponse documents */ - documents?: (google.firestore.v1.IDocument[]|null); - - /** ListDocumentsResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListDocumentsResponse. */ - class ListDocumentsResponse implements IListDocumentsResponse { - - /** - * Constructs a new ListDocumentsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.firestore.v1.IListDocumentsResponse); - - /** ListDocumentsResponse documents. */ - public documents: google.firestore.v1.IDocument[]; - - /** ListDocumentsResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a ListDocumentsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListDocumentsResponse - */ - public static fromObject(object: { [k: string]: any }): google.firestore.v1.ListDocumentsResponse; - - /** - * Creates a plain object from a ListDocumentsResponse message. Also converts values to other types if specified. - * @param message ListDocumentsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.v1.ListDocumentsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListDocumentsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a CreateDocumentRequest. */ - interface ICreateDocumentRequest { - - /** CreateDocumentRequest parent */ - parent?: (string|null); - - /** CreateDocumentRequest collectionId */ - collectionId?: (string|null); - - /** CreateDocumentRequest documentId */ - documentId?: (string|null); - - /** CreateDocumentRequest document */ - document?: (google.firestore.v1.IDocument|null); - - /** CreateDocumentRequest mask */ - mask?: (google.firestore.v1.IDocumentMask|null); - } - - /** Represents a CreateDocumentRequest. */ - class CreateDocumentRequest implements ICreateDocumentRequest { - - /** - * Constructs a new CreateDocumentRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.firestore.v1.ICreateDocumentRequest); - - /** CreateDocumentRequest parent. */ - public parent: string; - - /** CreateDocumentRequest collectionId. */ - public collectionId: string; - - /** CreateDocumentRequest documentId. */ - public documentId: string; - - /** CreateDocumentRequest document. */ - public document?: (google.firestore.v1.IDocument|null); - - /** CreateDocumentRequest mask. */ - public mask?: (google.firestore.v1.IDocumentMask|null); - - /** - * Creates a CreateDocumentRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateDocumentRequest - */ - public static fromObject(object: { [k: string]: any }): google.firestore.v1.CreateDocumentRequest; - - /** - * Creates a plain object from a CreateDocumentRequest message. Also converts values to other types if specified. - * @param message CreateDocumentRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.v1.CreateDocumentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateDocumentRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of an UpdateDocumentRequest. */ - interface IUpdateDocumentRequest { - - /** UpdateDocumentRequest document */ - document?: (google.firestore.v1.IDocument|null); - - /** UpdateDocumentRequest updateMask */ - updateMask?: (google.firestore.v1.IDocumentMask|null); - - /** UpdateDocumentRequest mask */ - mask?: (google.firestore.v1.IDocumentMask|null); - - /** UpdateDocumentRequest currentDocument */ - currentDocument?: (google.firestore.v1.IPrecondition|null); - } - - /** Represents an UpdateDocumentRequest. */ - class UpdateDocumentRequest implements IUpdateDocumentRequest { - - /** - * Constructs a new UpdateDocumentRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.firestore.v1.IUpdateDocumentRequest); - - /** UpdateDocumentRequest document. */ - public document?: (google.firestore.v1.IDocument|null); - - /** UpdateDocumentRequest updateMask. */ - public updateMask?: (google.firestore.v1.IDocumentMask|null); - - /** UpdateDocumentRequest mask. */ - public mask?: (google.firestore.v1.IDocumentMask|null); - - /** UpdateDocumentRequest currentDocument. */ - public currentDocument?: (google.firestore.v1.IPrecondition|null); - - /** - * Creates an UpdateDocumentRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateDocumentRequest - */ - public static fromObject(object: { [k: string]: any }): google.firestore.v1.UpdateDocumentRequest; - - /** - * Creates a plain object from an UpdateDocumentRequest message. Also converts values to other types if specified. - * @param message UpdateDocumentRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.v1.UpdateDocumentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateDocumentRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a DeleteDocumentRequest. */ - interface IDeleteDocumentRequest { - - /** DeleteDocumentRequest name */ - name?: (string|null); - - /** DeleteDocumentRequest currentDocument */ - currentDocument?: (google.firestore.v1.IPrecondition|null); - } - - /** Represents a DeleteDocumentRequest. */ - class DeleteDocumentRequest implements IDeleteDocumentRequest { - - /** - * Constructs a new DeleteDocumentRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.firestore.v1.IDeleteDocumentRequest); - - /** DeleteDocumentRequest name. */ - public name: string; - - /** DeleteDocumentRequest currentDocument. */ - public currentDocument?: (google.firestore.v1.IPrecondition|null); - - /** - * Creates a DeleteDocumentRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteDocumentRequest - */ - public static fromObject(object: { [k: string]: any }): google.firestore.v1.DeleteDocumentRequest; - - /** - * Creates a plain object from a DeleteDocumentRequest message. Also converts values to other types if specified. - * @param message DeleteDocumentRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.v1.DeleteDocumentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteDocumentRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a BatchGetDocumentsRequest. */ - interface IBatchGetDocumentsRequest { - - /** BatchGetDocumentsRequest database */ - database?: (string|null); - - /** BatchGetDocumentsRequest documents */ - documents?: (string[]|null); - - /** BatchGetDocumentsRequest mask */ - mask?: (google.firestore.v1.IDocumentMask|null); - - /** BatchGetDocumentsRequest transaction */ - transaction?: (Uint8Array|null); - - /** BatchGetDocumentsRequest newTransaction */ - newTransaction?: (google.firestore.v1.ITransactionOptions|null); - - /** BatchGetDocumentsRequest readTime */ - readTime?: (google.protobuf.ITimestamp|null); - } - - /** Represents a BatchGetDocumentsRequest. */ - class BatchGetDocumentsRequest implements IBatchGetDocumentsRequest { - - /** - * Constructs a new BatchGetDocumentsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.firestore.v1.IBatchGetDocumentsRequest); - - /** BatchGetDocumentsRequest database. */ - public database: string; - - /** BatchGetDocumentsRequest documents. */ - public documents: string[]; - - /** BatchGetDocumentsRequest mask. */ - public mask?: (google.firestore.v1.IDocumentMask|null); - - /** BatchGetDocumentsRequest transaction. */ - public transaction?: (Uint8Array|null); - - /** BatchGetDocumentsRequest newTransaction. */ - public newTransaction?: (google.firestore.v1.ITransactionOptions|null); - - /** BatchGetDocumentsRequest readTime. */ - public readTime?: (google.protobuf.ITimestamp|null); - - /** BatchGetDocumentsRequest consistencySelector. */ - public consistencySelector?: ("transaction"|"newTransaction"|"readTime"); - - /** - * Creates a BatchGetDocumentsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BatchGetDocumentsRequest - */ - public static fromObject(object: { [k: string]: any }): google.firestore.v1.BatchGetDocumentsRequest; - - /** - * Creates a plain object from a BatchGetDocumentsRequest message. Also converts values to other types if specified. - * @param message BatchGetDocumentsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.v1.BatchGetDocumentsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BatchGetDocumentsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a BatchGetDocumentsResponse. */ - interface IBatchGetDocumentsResponse { - - /** BatchGetDocumentsResponse found */ - found?: (google.firestore.v1.IDocument|null); - - /** BatchGetDocumentsResponse missing */ - missing?: (string|null); - - /** BatchGetDocumentsResponse transaction */ - transaction?: (Uint8Array|null); - - /** BatchGetDocumentsResponse readTime */ - readTime?: (google.protobuf.ITimestamp|null); - } - - /** Represents a BatchGetDocumentsResponse. */ - class BatchGetDocumentsResponse implements IBatchGetDocumentsResponse { - - /** - * Constructs a new BatchGetDocumentsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.firestore.v1.IBatchGetDocumentsResponse); - - /** BatchGetDocumentsResponse found. */ - public found?: (google.firestore.v1.IDocument|null); - - /** BatchGetDocumentsResponse missing. */ - public missing?: (string|null); - - /** BatchGetDocumentsResponse transaction. */ - public transaction: Uint8Array; - - /** BatchGetDocumentsResponse readTime. */ - public readTime?: (google.protobuf.ITimestamp|null); - - /** BatchGetDocumentsResponse result. */ - public result?: ("found"|"missing"); - - /** - * Creates a BatchGetDocumentsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BatchGetDocumentsResponse - */ - public static fromObject(object: { [k: string]: any }): google.firestore.v1.BatchGetDocumentsResponse; - - /** - * Creates a plain object from a BatchGetDocumentsResponse message. Also converts values to other types if specified. - * @param message BatchGetDocumentsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.v1.BatchGetDocumentsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BatchGetDocumentsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a BeginTransactionRequest. */ - interface IBeginTransactionRequest { - - /** BeginTransactionRequest database */ - database?: (string|null); - - /** BeginTransactionRequest options */ - options?: (google.firestore.v1.ITransactionOptions|null); - } - - /** Represents a BeginTransactionRequest. */ - class BeginTransactionRequest implements IBeginTransactionRequest { - - /** - * Constructs a new BeginTransactionRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.firestore.v1.IBeginTransactionRequest); - - /** BeginTransactionRequest database. */ - public database: string; - - /** BeginTransactionRequest options. */ - public options?: (google.firestore.v1.ITransactionOptions|null); - - /** - * Creates a BeginTransactionRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BeginTransactionRequest - */ - public static fromObject(object: { [k: string]: any }): google.firestore.v1.BeginTransactionRequest; - - /** - * Creates a plain object from a BeginTransactionRequest message. Also converts values to other types if specified. - * @param message BeginTransactionRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.v1.BeginTransactionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BeginTransactionRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a BeginTransactionResponse. */ - interface IBeginTransactionResponse { - - /** BeginTransactionResponse transaction */ - transaction?: (Uint8Array|null); - } - - /** Represents a BeginTransactionResponse. */ - class BeginTransactionResponse implements IBeginTransactionResponse { - - /** - * Constructs a new BeginTransactionResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.firestore.v1.IBeginTransactionResponse); - - /** BeginTransactionResponse transaction. */ - public transaction: Uint8Array; - - /** - * Creates a BeginTransactionResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BeginTransactionResponse - */ - public static fromObject(object: { [k: string]: any }): google.firestore.v1.BeginTransactionResponse; - - /** - * Creates a plain object from a BeginTransactionResponse message. Also converts values to other types if specified. - * @param message BeginTransactionResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.v1.BeginTransactionResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BeginTransactionResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a CommitRequest. */ - interface ICommitRequest { - - /** CommitRequest database */ - database?: (string|null); - - /** CommitRequest writes */ - writes?: (google.firestore.v1.IWrite[]|null); - - /** CommitRequest transaction */ - transaction?: (Uint8Array|null); - } - - /** Represents a CommitRequest. */ - class CommitRequest implements ICommitRequest { - - /** - * Constructs a new CommitRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.firestore.v1.ICommitRequest); - - /** CommitRequest database. */ - public database: string; - - /** CommitRequest writes. */ - public writes: google.firestore.v1.IWrite[]; - - /** CommitRequest transaction. */ - public transaction: Uint8Array; - - /** - * Creates a CommitRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CommitRequest - */ - public static fromObject(object: { [k: string]: any }): google.firestore.v1.CommitRequest; - - /** - * Creates a plain object from a CommitRequest message. Also converts values to other types if specified. - * @param message CommitRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.v1.CommitRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CommitRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a CommitResponse. */ - interface ICommitResponse { - - /** CommitResponse writeResults */ - writeResults?: (google.firestore.v1.IWriteResult[]|null); - - /** CommitResponse commitTime */ - commitTime?: (google.protobuf.ITimestamp|null); - } - - /** Represents a CommitResponse. */ - class CommitResponse implements ICommitResponse { - - /** - * Constructs a new CommitResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.firestore.v1.ICommitResponse); - - /** CommitResponse writeResults. */ - public writeResults: google.firestore.v1.IWriteResult[]; - - /** CommitResponse commitTime. */ - public commitTime?: (google.protobuf.ITimestamp|null); - - /** - * Creates a CommitResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CommitResponse - */ - public static fromObject(object: { [k: string]: any }): google.firestore.v1.CommitResponse; - - /** - * Creates a plain object from a CommitResponse message. Also converts values to other types if specified. - * @param message CommitResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.v1.CommitResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CommitResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a RollbackRequest. */ - interface IRollbackRequest { - - /** RollbackRequest database */ - database?: (string|null); - - /** RollbackRequest transaction */ - transaction?: (Uint8Array|null); - } - - /** Represents a RollbackRequest. */ - class RollbackRequest implements IRollbackRequest { - - /** - * Constructs a new RollbackRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.firestore.v1.IRollbackRequest); - - /** RollbackRequest database. */ - public database: string; - - /** RollbackRequest transaction. */ - public transaction: Uint8Array; - - /** - * Creates a RollbackRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RollbackRequest - */ - public static fromObject(object: { [k: string]: any }): google.firestore.v1.RollbackRequest; - - /** - * Creates a plain object from a RollbackRequest message. Also converts values to other types if specified. - * @param message RollbackRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.v1.RollbackRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RollbackRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a RunQueryRequest. */ - interface IRunQueryRequest { - - /** RunQueryRequest parent */ - parent?: (string|null); - - /** RunQueryRequest structuredQuery */ - structuredQuery?: (google.firestore.v1.IStructuredQuery|null); - - /** RunQueryRequest transaction */ - transaction?: (Uint8Array|null); - - /** RunQueryRequest newTransaction */ - newTransaction?: (google.firestore.v1.ITransactionOptions|null); - - /** RunQueryRequest readTime */ - readTime?: (google.protobuf.ITimestamp|null); - } - - /** Represents a RunQueryRequest. */ - class RunQueryRequest implements IRunQueryRequest { - - /** - * Constructs a new RunQueryRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.firestore.v1.IRunQueryRequest); - - /** RunQueryRequest parent. */ - public parent: string; - - /** RunQueryRequest structuredQuery. */ - public structuredQuery?: (google.firestore.v1.IStructuredQuery|null); - - /** RunQueryRequest transaction. */ - public transaction?: (Uint8Array|null); - - /** RunQueryRequest newTransaction. */ - public newTransaction?: (google.firestore.v1.ITransactionOptions|null); - - /** RunQueryRequest readTime. */ - public readTime?: (google.protobuf.ITimestamp|null); - - /** RunQueryRequest queryType. */ - public queryType?: "structuredQuery"; - - /** RunQueryRequest consistencySelector. */ - public consistencySelector?: ("transaction"|"newTransaction"|"readTime"); - - /** - * Creates a RunQueryRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RunQueryRequest - */ - public static fromObject(object: { [k: string]: any }): google.firestore.v1.RunQueryRequest; - - /** - * Creates a plain object from a RunQueryRequest message. Also converts values to other types if specified. - * @param message RunQueryRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.v1.RunQueryRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RunQueryRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a RunQueryResponse. */ - interface IRunQueryResponse { - - /** RunQueryResponse transaction */ - transaction?: (Uint8Array|null); - - /** RunQueryResponse document */ - document?: (google.firestore.v1.IDocument|null); - - /** RunQueryResponse readTime */ - readTime?: (google.protobuf.ITimestamp|null); - - /** RunQueryResponse skippedResults */ - skippedResults?: (number|null); - } - - /** Represents a RunQueryResponse. */ - class RunQueryResponse implements IRunQueryResponse { - - /** - * Constructs a new RunQueryResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.firestore.v1.IRunQueryResponse); - - /** RunQueryResponse transaction. */ - public transaction: Uint8Array; - - /** RunQueryResponse document. */ - public document?: (google.firestore.v1.IDocument|null); - - /** RunQueryResponse readTime. */ - public readTime?: (google.protobuf.ITimestamp|null); - - /** RunQueryResponse skippedResults. */ - public skippedResults: number; - - /** - * Creates a RunQueryResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RunQueryResponse - */ - public static fromObject(object: { [k: string]: any }): google.firestore.v1.RunQueryResponse; - - /** - * Creates a plain object from a RunQueryResponse message. Also converts values to other types if specified. - * @param message RunQueryResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.v1.RunQueryResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RunQueryResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a PartitionQueryRequest. */ - interface IPartitionQueryRequest { - - /** PartitionQueryRequest parent */ - parent?: (string|null); - - /** PartitionQueryRequest structuredQuery */ - structuredQuery?: (google.firestore.v1.IStructuredQuery|null); - - /** PartitionQueryRequest partitionCount */ - partitionCount?: (number|string|null); - - /** PartitionQueryRequest pageToken */ - pageToken?: (string|null); - - /** PartitionQueryRequest pageSize */ - pageSize?: (number|null); - } - - /** Represents a PartitionQueryRequest. */ - class PartitionQueryRequest implements IPartitionQueryRequest { - - /** - * Constructs a new PartitionQueryRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.firestore.v1.IPartitionQueryRequest); - - /** PartitionQueryRequest parent. */ - public parent: string; - - /** PartitionQueryRequest structuredQuery. */ - public structuredQuery?: (google.firestore.v1.IStructuredQuery|null); - - /** PartitionQueryRequest partitionCount. */ - public partitionCount: (number|string); - - /** PartitionQueryRequest pageToken. */ - public pageToken: string; - - /** PartitionQueryRequest pageSize. */ - public pageSize: number; - - /** PartitionQueryRequest queryType. */ - public queryType?: "structuredQuery"; - - /** - * Creates a PartitionQueryRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PartitionQueryRequest - */ - public static fromObject(object: { [k: string]: any }): google.firestore.v1.PartitionQueryRequest; - - /** - * Creates a plain object from a PartitionQueryRequest message. Also converts values to other types if specified. - * @param message PartitionQueryRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.v1.PartitionQueryRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PartitionQueryRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a PartitionQueryResponse. */ - interface IPartitionQueryResponse { - - /** PartitionQueryResponse partitions */ - partitions?: (google.firestore.v1.ICursor[]|null); - - /** PartitionQueryResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a PartitionQueryResponse. */ - class PartitionQueryResponse implements IPartitionQueryResponse { - - /** - * Constructs a new PartitionQueryResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.firestore.v1.IPartitionQueryResponse); - - /** PartitionQueryResponse partitions. */ - public partitions: google.firestore.v1.ICursor[]; - - /** PartitionQueryResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a PartitionQueryResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PartitionQueryResponse - */ - public static fromObject(object: { [k: string]: any }): google.firestore.v1.PartitionQueryResponse; - - /** - * Creates a plain object from a PartitionQueryResponse message. Also converts values to other types if specified. - * @param message PartitionQueryResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.v1.PartitionQueryResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PartitionQueryResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a WriteRequest. */ - interface IWriteRequest { - - /** WriteRequest database */ - database?: (string|null); - - /** WriteRequest streamId */ - streamId?: (string|null); - - /** WriteRequest writes */ - writes?: (google.firestore.v1.IWrite[]|null); - - /** WriteRequest streamToken */ - streamToken?: (Uint8Array|null); - - /** WriteRequest labels */ - labels?: ({ [k: string]: string }|null); - } - - /** Represents a WriteRequest. */ - class WriteRequest implements IWriteRequest { - - /** - * Constructs a new WriteRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.firestore.v1.IWriteRequest); - - /** WriteRequest database. */ - public database: string; - - /** WriteRequest streamId. */ - public streamId: string; - - /** WriteRequest writes. */ - public writes: google.firestore.v1.IWrite[]; - - /** WriteRequest streamToken. */ - public streamToken: Uint8Array; - - /** WriteRequest labels. */ - public labels: { [k: string]: string }; - - /** - * Creates a WriteRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns WriteRequest - */ - public static fromObject(object: { [k: string]: any }): google.firestore.v1.WriteRequest; - - /** - * Creates a plain object from a WriteRequest message. Also converts values to other types if specified. - * @param message WriteRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.v1.WriteRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this WriteRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a WriteResponse. */ - interface IWriteResponse { - - /** WriteResponse streamId */ - streamId?: (string|null); - - /** WriteResponse streamToken */ - streamToken?: (Uint8Array|null); - - /** WriteResponse writeResults */ - writeResults?: (google.firestore.v1.IWriteResult[]|null); - - /** WriteResponse commitTime */ - commitTime?: (google.protobuf.ITimestamp|null); - } - - /** Represents a WriteResponse. */ - class WriteResponse implements IWriteResponse { - - /** - * Constructs a new WriteResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.firestore.v1.IWriteResponse); - - /** WriteResponse streamId. */ - public streamId: string; - - /** WriteResponse streamToken. */ - public streamToken: Uint8Array; - - /** WriteResponse writeResults. */ - public writeResults: google.firestore.v1.IWriteResult[]; - - /** WriteResponse commitTime. */ - public commitTime?: (google.protobuf.ITimestamp|null); - - /** - * Creates a WriteResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns WriteResponse - */ - public static fromObject(object: { [k: string]: any }): google.firestore.v1.WriteResponse; - - /** - * Creates a plain object from a WriteResponse message. Also converts values to other types if specified. - * @param message WriteResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.v1.WriteResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this WriteResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a ListenRequest. */ - interface IListenRequest { - - /** ListenRequest database */ - database?: (string|null); - - /** ListenRequest addTarget */ - addTarget?: (google.firestore.v1.ITarget|null); - - /** ListenRequest removeTarget */ - removeTarget?: (number|null); - - /** ListenRequest labels */ - labels?: ({ [k: string]: string }|null); - } - - /** Represents a ListenRequest. */ - class ListenRequest implements IListenRequest { - - /** - * Constructs a new ListenRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.firestore.v1.IListenRequest); - - /** ListenRequest database. */ - public database: string; - - /** ListenRequest addTarget. */ - public addTarget?: (google.firestore.v1.ITarget|null); - - /** ListenRequest removeTarget. */ - public removeTarget?: (number|null); - - /** ListenRequest labels. */ - public labels: { [k: string]: string }; - - /** ListenRequest targetChange. */ - public targetChange?: ("addTarget"|"removeTarget"); - - /** - * Creates a ListenRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListenRequest - */ - public static fromObject(object: { [k: string]: any }): google.firestore.v1.ListenRequest; - - /** - * Creates a plain object from a ListenRequest message. Also converts values to other types if specified. - * @param message ListenRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.v1.ListenRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListenRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a ListenResponse. */ - interface IListenResponse { - - /** ListenResponse targetChange */ - targetChange?: (google.firestore.v1.ITargetChange|null); - - /** ListenResponse documentChange */ - documentChange?: (google.firestore.v1.IDocumentChange|null); - - /** ListenResponse documentDelete */ - documentDelete?: (google.firestore.v1.IDocumentDelete|null); - - /** ListenResponse documentRemove */ - documentRemove?: (google.firestore.v1.IDocumentRemove|null); - - /** ListenResponse filter */ - filter?: (google.firestore.v1.IExistenceFilter|null); - } - - /** Represents a ListenResponse. */ - class ListenResponse implements IListenResponse { - - /** - * Constructs a new ListenResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.firestore.v1.IListenResponse); - - /** ListenResponse targetChange. */ - public targetChange?: (google.firestore.v1.ITargetChange|null); - - /** ListenResponse documentChange. */ - public documentChange?: (google.firestore.v1.IDocumentChange|null); - - /** ListenResponse documentDelete. */ - public documentDelete?: (google.firestore.v1.IDocumentDelete|null); - - /** ListenResponse documentRemove. */ - public documentRemove?: (google.firestore.v1.IDocumentRemove|null); - - /** ListenResponse filter. */ - public filter?: (google.firestore.v1.IExistenceFilter|null); - - /** ListenResponse responseType. */ - public responseType?: ("targetChange"|"documentChange"|"documentDelete"|"documentRemove"|"filter"); - - /** - * Creates a ListenResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListenResponse - */ - public static fromObject(object: { [k: string]: any }): google.firestore.v1.ListenResponse; - - /** - * Creates a plain object from a ListenResponse message. Also converts values to other types if specified. - * @param message ListenResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.v1.ListenResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListenResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a Target. */ - interface ITarget { - - /** Target query */ - query?: (google.firestore.v1.Target.IQueryTarget|null); - - /** Target documents */ - documents?: (google.firestore.v1.Target.IDocumentsTarget|null); - - /** Target resumeToken */ - resumeToken?: (Uint8Array|null); - - /** Target readTime */ - readTime?: (google.protobuf.ITimestamp|null); - - /** Target targetId */ - targetId?: (number|null); - - /** Target once */ - once?: (boolean|null); - } - - /** Represents a Target. */ - class Target implements ITarget { - - /** - * Constructs a new Target. - * @param [properties] Properties to set - */ - constructor(properties?: google.firestore.v1.ITarget); - - /** Target query. */ - public query?: (google.firestore.v1.Target.IQueryTarget|null); - - /** Target documents. */ - public documents?: (google.firestore.v1.Target.IDocumentsTarget|null); - - /** Target resumeToken. */ - public resumeToken?: (Uint8Array|null); - - /** Target readTime. */ - public readTime?: (google.protobuf.ITimestamp|null); - - /** Target targetId. */ - public targetId: number; - - /** Target once. */ - public once: boolean; - - /** Target targetType. */ - public targetType?: ("query"|"documents"); - - /** Target resumeType. */ - public resumeType?: ("resumeToken"|"readTime"); - - /** - * Creates a Target message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Target - */ - public static fromObject(object: { [k: string]: any }): google.firestore.v1.Target; - - /** - * Creates a plain object from a Target message. Also converts values to other types if specified. - * @param message Target - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.v1.Target, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Target to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - namespace Target { - - /** Properties of a DocumentsTarget. */ - interface IDocumentsTarget { - - /** DocumentsTarget documents */ - documents?: (string[]|null); - } - - /** Represents a DocumentsTarget. */ - class DocumentsTarget implements IDocumentsTarget { - - /** - * Constructs a new DocumentsTarget. - * @param [properties] Properties to set - */ - constructor(properties?: google.firestore.v1.Target.IDocumentsTarget); - - /** DocumentsTarget documents. */ - public documents: string[]; - - /** - * Creates a DocumentsTarget message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DocumentsTarget - */ - public static fromObject(object: { [k: string]: any }): google.firestore.v1.Target.DocumentsTarget; - - /** - * Creates a plain object from a DocumentsTarget message. Also converts values to other types if specified. - * @param message DocumentsTarget - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.v1.Target.DocumentsTarget, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DocumentsTarget to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a QueryTarget. */ - interface IQueryTarget { - - /** QueryTarget parent */ - parent?: (string|null); - - /** QueryTarget structuredQuery */ - structuredQuery?: (google.firestore.v1.IStructuredQuery|null); - } - - /** Represents a QueryTarget. */ - class QueryTarget implements IQueryTarget { - - /** - * Constructs a new QueryTarget. - * @param [properties] Properties to set - */ - constructor(properties?: google.firestore.v1.Target.IQueryTarget); - - /** QueryTarget parent. */ - public parent: string; - - /** QueryTarget structuredQuery. */ - public structuredQuery?: (google.firestore.v1.IStructuredQuery|null); - - /** QueryTarget queryType. */ - public queryType?: "structuredQuery"; - - /** - * Creates a QueryTarget message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryTarget - */ - public static fromObject(object: { [k: string]: any }): google.firestore.v1.Target.QueryTarget; - - /** - * Creates a plain object from a QueryTarget message. Also converts values to other types if specified. - * @param message QueryTarget - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.v1.Target.QueryTarget, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryTarget to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } - - /** Properties of a TargetChange. */ - interface ITargetChange { - - /** TargetChange targetChangeType */ - targetChangeType?: (google.firestore.v1.TargetChange.TargetChangeType|null); - - /** TargetChange targetIds */ - targetIds?: (number[]|null); - - /** TargetChange cause */ - cause?: (google.rpc.IStatus|null); - - /** TargetChange resumeToken */ - resumeToken?: (Uint8Array|null); - - /** TargetChange readTime */ - readTime?: (google.protobuf.ITimestamp|null); - } - - /** Represents a TargetChange. */ - class TargetChange implements ITargetChange { - - /** - * Constructs a new TargetChange. - * @param [properties] Properties to set - */ - constructor(properties?: google.firestore.v1.ITargetChange); - - /** TargetChange targetChangeType. */ - public targetChangeType: google.firestore.v1.TargetChange.TargetChangeType; - - /** TargetChange targetIds. */ - public targetIds: number[]; - - /** TargetChange cause. */ - public cause?: (google.rpc.IStatus|null); - - /** TargetChange resumeToken. */ - public resumeToken: Uint8Array; - - /** TargetChange readTime. */ - public readTime?: (google.protobuf.ITimestamp|null); - - /** - * Creates a TargetChange message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TargetChange - */ - public static fromObject(object: { [k: string]: any }): google.firestore.v1.TargetChange; - - /** - * Creates a plain object from a TargetChange message. Also converts values to other types if specified. - * @param message TargetChange - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.v1.TargetChange, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TargetChange to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - namespace TargetChange { - - /** TargetChangeType enum. */ - type TargetChangeType = - "NO_CHANGE"| "ADD"| "REMOVE"| "CURRENT"| "RESET"; - } - - /** Properties of a ListCollectionIdsRequest. */ - interface IListCollectionIdsRequest { - - /** ListCollectionIdsRequest parent */ - parent?: (string|null); - - /** ListCollectionIdsRequest pageSize */ - pageSize?: (number|null); - - /** ListCollectionIdsRequest pageToken */ - pageToken?: (string|null); - } - - /** Represents a ListCollectionIdsRequest. */ - class ListCollectionIdsRequest implements IListCollectionIdsRequest { - - /** - * Constructs a new ListCollectionIdsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.firestore.v1.IListCollectionIdsRequest); - - /** ListCollectionIdsRequest parent. */ - public parent: string; - - /** ListCollectionIdsRequest pageSize. */ - public pageSize: number; - - /** ListCollectionIdsRequest pageToken. */ - public pageToken: string; - - /** - * Creates a ListCollectionIdsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListCollectionIdsRequest - */ - public static fromObject(object: { [k: string]: any }): google.firestore.v1.ListCollectionIdsRequest; - - /** - * Creates a plain object from a ListCollectionIdsRequest message. Also converts values to other types if specified. - * @param message ListCollectionIdsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.v1.ListCollectionIdsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListCollectionIdsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a ListCollectionIdsResponse. */ - interface IListCollectionIdsResponse { - - /** ListCollectionIdsResponse collectionIds */ - collectionIds?: (string[]|null); - - /** ListCollectionIdsResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListCollectionIdsResponse. */ - class ListCollectionIdsResponse implements IListCollectionIdsResponse { - - /** - * Constructs a new ListCollectionIdsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.firestore.v1.IListCollectionIdsResponse); - - /** ListCollectionIdsResponse collectionIds. */ - public collectionIds: string[]; - - /** ListCollectionIdsResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a ListCollectionIdsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListCollectionIdsResponse - */ - public static fromObject(object: { [k: string]: any }): google.firestore.v1.ListCollectionIdsResponse; - - /** - * Creates a plain object from a ListCollectionIdsResponse message. Also converts values to other types if specified. - * @param message ListCollectionIdsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.v1.ListCollectionIdsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListCollectionIdsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a BatchWriteRequest. */ - interface IBatchWriteRequest { - - /** BatchWriteRequest database */ - database?: (string|null); - - /** BatchWriteRequest writes */ - writes?: (google.firestore.v1.IWrite[]|null); - - /** BatchWriteRequest labels */ - labels?: ({ [k: string]: string }|null); - } - - /** Represents a BatchWriteRequest. */ - class BatchWriteRequest implements IBatchWriteRequest { - - /** - * Constructs a new BatchWriteRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.firestore.v1.IBatchWriteRequest); - - /** BatchWriteRequest database. */ - public database: string; - - /** BatchWriteRequest writes. */ - public writes: google.firestore.v1.IWrite[]; - - /** BatchWriteRequest labels. */ - public labels: { [k: string]: string }; - - /** - * Creates a BatchWriteRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BatchWriteRequest - */ - public static fromObject(object: { [k: string]: any }): google.firestore.v1.BatchWriteRequest; - - /** - * Creates a plain object from a BatchWriteRequest message. Also converts values to other types if specified. - * @param message BatchWriteRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.v1.BatchWriteRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BatchWriteRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a BatchWriteResponse. */ - interface IBatchWriteResponse { - - /** BatchWriteResponse writeResults */ - writeResults?: (google.firestore.v1.IWriteResult[]|null); - - /** BatchWriteResponse status */ - status?: (google.rpc.IStatus[]|null); - } - - /** Represents a BatchWriteResponse. */ - class BatchWriteResponse implements IBatchWriteResponse { - - /** - * Constructs a new BatchWriteResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.firestore.v1.IBatchWriteResponse); - - /** BatchWriteResponse writeResults. */ - public writeResults: google.firestore.v1.IWriteResult[]; - - /** BatchWriteResponse status. */ - public status: google.rpc.IStatus[]; - - /** - * Creates a BatchWriteResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BatchWriteResponse - */ - public static fromObject(object: { [k: string]: any }): google.firestore.v1.BatchWriteResponse; - - /** - * Creates a plain object from a BatchWriteResponse message. Also converts values to other types if specified. - * @param message BatchWriteResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.v1.BatchWriteResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BatchWriteResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a StructuredQuery. */ - interface IStructuredQuery { - - /** StructuredQuery select */ - select?: (google.firestore.v1.StructuredQuery.IProjection|null); - - /** StructuredQuery from */ - from?: (google.firestore.v1.StructuredQuery.ICollectionSelector[]|null); - - /** StructuredQuery where */ - where?: (google.firestore.v1.StructuredQuery.IFilter|null); - - /** StructuredQuery orderBy */ - orderBy?: (google.firestore.v1.StructuredQuery.IOrder[]|null); - - /** StructuredQuery startAt */ - startAt?: (google.firestore.v1.ICursor|null); - - /** StructuredQuery endAt */ - endAt?: (google.firestore.v1.ICursor|null); - - /** StructuredQuery offset */ - offset?: (number|null); - - /** StructuredQuery limit */ - limit?: (google.protobuf.IInt32Value|null); - } - - /** Represents a StructuredQuery. */ - class StructuredQuery implements IStructuredQuery { - - /** - * Constructs a new StructuredQuery. - * @param [properties] Properties to set - */ - constructor(properties?: google.firestore.v1.IStructuredQuery); - - /** StructuredQuery select. */ - public select?: (google.firestore.v1.StructuredQuery.IProjection|null); - - /** StructuredQuery from. */ - public from: google.firestore.v1.StructuredQuery.ICollectionSelector[]; - - /** StructuredQuery where. */ - public where?: (google.firestore.v1.StructuredQuery.IFilter|null); - - /** StructuredQuery orderBy. */ - public orderBy: google.firestore.v1.StructuredQuery.IOrder[]; - - /** StructuredQuery startAt. */ - public startAt?: (google.firestore.v1.ICursor|null); - - /** StructuredQuery endAt. */ - public endAt?: (google.firestore.v1.ICursor|null); - - /** StructuredQuery offset. */ - public offset: number; - - /** StructuredQuery limit. */ - public limit?: (google.protobuf.IInt32Value|null); - - /** - * Creates a StructuredQuery message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns StructuredQuery - */ - public static fromObject(object: { [k: string]: any }): google.firestore.v1.StructuredQuery; - - /** - * Creates a plain object from a StructuredQuery message. Also converts values to other types if specified. - * @param message StructuredQuery - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.v1.StructuredQuery, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this StructuredQuery to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - namespace StructuredQuery { - - /** Properties of a CollectionSelector. */ - interface ICollectionSelector { - - /** CollectionSelector collectionId */ - collectionId?: (string|null); - - /** CollectionSelector allDescendants */ - allDescendants?: (boolean|null); - } - - /** Represents a CollectionSelector. */ - class CollectionSelector implements ICollectionSelector { - - /** - * Constructs a new CollectionSelector. - * @param [properties] Properties to set - */ - constructor(properties?: google.firestore.v1.StructuredQuery.ICollectionSelector); - - /** CollectionSelector collectionId. */ - public collectionId: string; - - /** CollectionSelector allDescendants. */ - public allDescendants: boolean; - - /** - * Creates a CollectionSelector message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CollectionSelector - */ - public static fromObject(object: { [k: string]: any }): google.firestore.v1.StructuredQuery.CollectionSelector; - - /** - * Creates a plain object from a CollectionSelector message. Also converts values to other types if specified. - * @param message CollectionSelector - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.v1.StructuredQuery.CollectionSelector, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CollectionSelector to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a Filter. */ - interface IFilter { - - /** Filter compositeFilter */ - compositeFilter?: (google.firestore.v1.StructuredQuery.ICompositeFilter|null); - - /** Filter fieldFilter */ - fieldFilter?: (google.firestore.v1.StructuredQuery.IFieldFilter|null); - - /** Filter unaryFilter */ - unaryFilter?: (google.firestore.v1.StructuredQuery.IUnaryFilter|null); - } - - /** Represents a Filter. */ - class Filter implements IFilter { - - /** - * Constructs a new Filter. - * @param [properties] Properties to set - */ - constructor(properties?: google.firestore.v1.StructuredQuery.IFilter); - - /** Filter compositeFilter. */ - public compositeFilter?: (google.firestore.v1.StructuredQuery.ICompositeFilter|null); - - /** Filter fieldFilter. */ - public fieldFilter?: (google.firestore.v1.StructuredQuery.IFieldFilter|null); - - /** Filter unaryFilter. */ - public unaryFilter?: (google.firestore.v1.StructuredQuery.IUnaryFilter|null); - - /** Filter filterType. */ - public filterType?: ("compositeFilter"|"fieldFilter"|"unaryFilter"); - - /** - * Creates a Filter message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Filter - */ - public static fromObject(object: { [k: string]: any }): google.firestore.v1.StructuredQuery.Filter; - - /** - * Creates a plain object from a Filter message. Also converts values to other types if specified. - * @param message Filter - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.v1.StructuredQuery.Filter, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Filter to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a CompositeFilter. */ - interface ICompositeFilter { - - /** CompositeFilter op */ - op?: (google.firestore.v1.StructuredQuery.CompositeFilter.Operator|null); - - /** CompositeFilter filters */ - filters?: (google.firestore.v1.StructuredQuery.IFilter[]|null); - } - - /** Represents a CompositeFilter. */ - class CompositeFilter implements ICompositeFilter { - - /** - * Constructs a new CompositeFilter. - * @param [properties] Properties to set - */ - constructor(properties?: google.firestore.v1.StructuredQuery.ICompositeFilter); - - /** CompositeFilter op. */ - public op: google.firestore.v1.StructuredQuery.CompositeFilter.Operator; - - /** CompositeFilter filters. */ - public filters: google.firestore.v1.StructuredQuery.IFilter[]; - - /** - * Creates a CompositeFilter message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CompositeFilter - */ - public static fromObject(object: { [k: string]: any }): google.firestore.v1.StructuredQuery.CompositeFilter; - - /** - * Creates a plain object from a CompositeFilter message. Also converts values to other types if specified. - * @param message CompositeFilter - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.v1.StructuredQuery.CompositeFilter, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CompositeFilter to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - namespace CompositeFilter { - - /** Operator enum. */ - type Operator = - "OPERATOR_UNSPECIFIED"| "AND"; - } - - /** Properties of a FieldFilter. */ - interface IFieldFilter { - - /** FieldFilter field */ - field?: (google.firestore.v1.StructuredQuery.IFieldReference|null); - - /** FieldFilter op */ - op?: (google.firestore.v1.StructuredQuery.FieldFilter.Operator|null); - - /** FieldFilter value */ - value?: (google.firestore.v1.IValue|null); - } - - /** Represents a FieldFilter. */ - class FieldFilter implements IFieldFilter { - - /** - * Constructs a new FieldFilter. - * @param [properties] Properties to set - */ - constructor(properties?: google.firestore.v1.StructuredQuery.IFieldFilter); - - /** FieldFilter field. */ - public field?: (google.firestore.v1.StructuredQuery.IFieldReference|null); - - /** FieldFilter op. */ - public op: google.firestore.v1.StructuredQuery.FieldFilter.Operator; - - /** FieldFilter value. */ - public value?: (google.firestore.v1.IValue|null); - - /** - * Creates a FieldFilter message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FieldFilter - */ - public static fromObject(object: { [k: string]: any }): google.firestore.v1.StructuredQuery.FieldFilter; - - /** - * Creates a plain object from a FieldFilter message. Also converts values to other types if specified. - * @param message FieldFilter - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.v1.StructuredQuery.FieldFilter, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FieldFilter to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - namespace FieldFilter { - - /** Operator enum. */ - type Operator = - "OPERATOR_UNSPECIFIED"| "LESS_THAN"| "LESS_THAN_OR_EQUAL"| "GREATER_THAN"| "GREATER_THAN_OR_EQUAL"| "EQUAL"| "NOT_EQUAL"| "ARRAY_CONTAINS"| "IN"| "ARRAY_CONTAINS_ANY"| "NOT_IN"; - } - - /** Properties of an UnaryFilter. */ - interface IUnaryFilter { - - /** UnaryFilter op */ - op?: (google.firestore.v1.StructuredQuery.UnaryFilter.Operator|null); - - /** UnaryFilter field */ - field?: (google.firestore.v1.StructuredQuery.IFieldReference|null); - } - - /** Represents an UnaryFilter. */ - class UnaryFilter implements IUnaryFilter { - - /** - * Constructs a new UnaryFilter. - * @param [properties] Properties to set - */ - constructor(properties?: google.firestore.v1.StructuredQuery.IUnaryFilter); - - /** UnaryFilter op. */ - public op: google.firestore.v1.StructuredQuery.UnaryFilter.Operator; - - /** UnaryFilter field. */ - public field?: (google.firestore.v1.StructuredQuery.IFieldReference|null); - - /** UnaryFilter operandType. */ - public operandType?: "field"; - - /** - * Creates an UnaryFilter message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UnaryFilter - */ - public static fromObject(object: { [k: string]: any }): google.firestore.v1.StructuredQuery.UnaryFilter; - - /** - * Creates a plain object from an UnaryFilter message. Also converts values to other types if specified. - * @param message UnaryFilter - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.v1.StructuredQuery.UnaryFilter, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UnaryFilter to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - namespace UnaryFilter { - - /** Operator enum. */ - type Operator = - "OPERATOR_UNSPECIFIED"| "IS_NAN"| "IS_NULL"| "IS_NOT_NAN"| "IS_NOT_NULL"; - } - - /** Properties of an Order. */ - interface IOrder { - - /** Order field */ - field?: (google.firestore.v1.StructuredQuery.IFieldReference|null); - - /** Order direction */ - direction?: (google.firestore.v1.StructuredQuery.Direction|null); - } - - /** Represents an Order. */ - class Order implements IOrder { - - /** - * Constructs a new Order. - * @param [properties] Properties to set - */ - constructor(properties?: google.firestore.v1.StructuredQuery.IOrder); - - /** Order field. */ - public field?: (google.firestore.v1.StructuredQuery.IFieldReference|null); - - /** Order direction. */ - public direction: google.firestore.v1.StructuredQuery.Direction; - - /** - * Creates an Order message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Order - */ - public static fromObject(object: { [k: string]: any }): google.firestore.v1.StructuredQuery.Order; - - /** - * Creates a plain object from an Order message. Also converts values to other types if specified. - * @param message Order - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.v1.StructuredQuery.Order, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Order to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a FieldReference. */ - interface IFieldReference { - - /** FieldReference fieldPath */ - fieldPath?: (string|null); - } - - /** Represents a FieldReference. */ - class FieldReference implements IFieldReference { - - /** - * Constructs a new FieldReference. - * @param [properties] Properties to set - */ - constructor(properties?: google.firestore.v1.StructuredQuery.IFieldReference); - - /** FieldReference fieldPath. */ - public fieldPath: string; - - /** - * Creates a FieldReference message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FieldReference - */ - public static fromObject(object: { [k: string]: any }): google.firestore.v1.StructuredQuery.FieldReference; - - /** - * Creates a plain object from a FieldReference message. Also converts values to other types if specified. - * @param message FieldReference - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.v1.StructuredQuery.FieldReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FieldReference to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a Projection. */ - interface IProjection { - - /** Projection fields */ - fields?: (google.firestore.v1.StructuredQuery.IFieldReference[]|null); - } - - /** Represents a Projection. */ - class Projection implements IProjection { - - /** - * Constructs a new Projection. - * @param [properties] Properties to set - */ - constructor(properties?: google.firestore.v1.StructuredQuery.IProjection); - - /** Projection fields. */ - public fields: google.firestore.v1.StructuredQuery.IFieldReference[]; - - /** - * Creates a Projection message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Projection - */ - public static fromObject(object: { [k: string]: any }): google.firestore.v1.StructuredQuery.Projection; - - /** - * Creates a plain object from a Projection message. Also converts values to other types if specified. - * @param message Projection - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.v1.StructuredQuery.Projection, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Projection to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Direction enum. */ - type Direction = - "DIRECTION_UNSPECIFIED"| "ASCENDING"| "DESCENDING"; - } - - /** Properties of a Cursor. */ - interface ICursor { - - /** Cursor values */ - values?: (google.firestore.v1.IValue[]|null); - - /** Cursor before */ - before?: (boolean|null); - } - - /** Represents a Cursor. */ - class Cursor implements ICursor { - - /** - * Constructs a new Cursor. - * @param [properties] Properties to set - */ - constructor(properties?: google.firestore.v1.ICursor); - - /** Cursor values. */ - public values: google.firestore.v1.IValue[]; - - /** Cursor before. */ - public before: boolean; - - /** - * Creates a Cursor message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Cursor - */ - public static fromObject(object: { [k: string]: any }): google.firestore.v1.Cursor; - - /** - * Creates a plain object from a Cursor message. Also converts values to other types if specified. - * @param message Cursor - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.v1.Cursor, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Cursor to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a Write. */ - interface IWrite { - - /** Write update */ - update?: (google.firestore.v1.IDocument|null); - - /** Write delete */ - "delete"?: (string|null); - - /** Write transform */ - transform?: (google.firestore.v1.IDocumentTransform|null); - - /** Write updateMask */ - updateMask?: (google.firestore.v1.IDocumentMask|null); - - /** Write updateTransforms */ - updateTransforms?: (google.firestore.v1.DocumentTransform.IFieldTransform[]|null); - - /** Write currentDocument */ - currentDocument?: (google.firestore.v1.IPrecondition|null); - } - - /** Represents a Write. */ - class Write implements IWrite { - - /** - * Constructs a new Write. - * @param [properties] Properties to set - */ - constructor(properties?: google.firestore.v1.IWrite); - - /** Write update. */ - public update?: (google.firestore.v1.IDocument|null); - - /** Write delete. */ - public delete?: (string|null); - - /** Write transform. */ - public transform?: (google.firestore.v1.IDocumentTransform|null); - - /** Write updateMask. */ - public updateMask?: (google.firestore.v1.IDocumentMask|null); - - /** Write updateTransforms. */ - public updateTransforms: google.firestore.v1.DocumentTransform.IFieldTransform[]; - - /** Write currentDocument. */ - public currentDocument?: (google.firestore.v1.IPrecondition|null); - - /** Write operation. */ - public operation?: ("update"|"delete"|"transform"); - - /** - * Creates a Write message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Write - */ - public static fromObject(object: { [k: string]: any }): google.firestore.v1.Write; - - /** - * Creates a plain object from a Write message. Also converts values to other types if specified. - * @param message Write - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.v1.Write, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Write to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a DocumentTransform. */ - interface IDocumentTransform { - - /** DocumentTransform document */ - document?: (string|null); - - /** DocumentTransform fieldTransforms */ - fieldTransforms?: (google.firestore.v1.DocumentTransform.IFieldTransform[]|null); - } - - /** Represents a DocumentTransform. */ - class DocumentTransform implements IDocumentTransform { - - /** - * Constructs a new DocumentTransform. - * @param [properties] Properties to set - */ - constructor(properties?: google.firestore.v1.IDocumentTransform); - - /** DocumentTransform document. */ - public document: string; - - /** DocumentTransform fieldTransforms. */ - public fieldTransforms: google.firestore.v1.DocumentTransform.IFieldTransform[]; - - /** - * Creates a DocumentTransform message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DocumentTransform - */ - public static fromObject(object: { [k: string]: any }): google.firestore.v1.DocumentTransform; - - /** - * Creates a plain object from a DocumentTransform message. Also converts values to other types if specified. - * @param message DocumentTransform - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.v1.DocumentTransform, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DocumentTransform to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - namespace DocumentTransform { - - /** Properties of a FieldTransform. */ - interface IFieldTransform { - - /** FieldTransform fieldPath */ - fieldPath?: (string|null); - - /** FieldTransform setToServerValue */ - setToServerValue?: (google.firestore.v1.DocumentTransform.FieldTransform.ServerValue|null); - - /** FieldTransform increment */ - increment?: (google.firestore.v1.IValue|null); - - /** FieldTransform maximum */ - maximum?: (google.firestore.v1.IValue|null); - - /** FieldTransform minimum */ - minimum?: (google.firestore.v1.IValue|null); - - /** FieldTransform appendMissingElements */ - appendMissingElements?: (google.firestore.v1.IArrayValue|null); - - /** FieldTransform removeAllFromArray */ - removeAllFromArray?: (google.firestore.v1.IArrayValue|null); - } - - /** Represents a FieldTransform. */ - class FieldTransform implements IFieldTransform { - - /** - * Constructs a new FieldTransform. - * @param [properties] Properties to set - */ - constructor(properties?: google.firestore.v1.DocumentTransform.IFieldTransform); - - /** FieldTransform fieldPath. */ - public fieldPath: string; - - /** FieldTransform setToServerValue. */ - public setToServerValue?: (google.firestore.v1.DocumentTransform.FieldTransform.ServerValue|null); - - /** FieldTransform increment. */ - public increment?: (google.firestore.v1.IValue|null); - - /** FieldTransform maximum. */ - public maximum?: (google.firestore.v1.IValue|null); - - /** FieldTransform minimum. */ - public minimum?: (google.firestore.v1.IValue|null); - - /** FieldTransform appendMissingElements. */ - public appendMissingElements?: (google.firestore.v1.IArrayValue|null); - - /** FieldTransform removeAllFromArray. */ - public removeAllFromArray?: (google.firestore.v1.IArrayValue|null); - - /** FieldTransform transformType. */ - public transformType?: ("setToServerValue"|"increment"|"maximum"|"minimum"|"appendMissingElements"|"removeAllFromArray"); - - /** - * Creates a FieldTransform message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FieldTransform - */ - public static fromObject(object: { [k: string]: any }): google.firestore.v1.DocumentTransform.FieldTransform; - - /** - * Creates a plain object from a FieldTransform message. Also converts values to other types if specified. - * @param message FieldTransform - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.v1.DocumentTransform.FieldTransform, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FieldTransform to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - namespace FieldTransform { - - /** ServerValue enum. */ - type ServerValue = - "SERVER_VALUE_UNSPECIFIED"| "REQUEST_TIME"; - } - } - - /** Properties of a WriteResult. */ - interface IWriteResult { - - /** WriteResult updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); - - /** WriteResult transformResults */ - transformResults?: (google.firestore.v1.IValue[]|null); - } - - /** Represents a WriteResult. */ - class WriteResult implements IWriteResult { - - /** - * Constructs a new WriteResult. - * @param [properties] Properties to set - */ - constructor(properties?: google.firestore.v1.IWriteResult); - - /** WriteResult updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); - - /** WriteResult transformResults. */ - public transformResults: google.firestore.v1.IValue[]; - - /** - * Creates a WriteResult message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns WriteResult - */ - public static fromObject(object: { [k: string]: any }): google.firestore.v1.WriteResult; - - /** - * Creates a plain object from a WriteResult message. Also converts values to other types if specified. - * @param message WriteResult - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.v1.WriteResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this WriteResult to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a DocumentChange. */ - interface IDocumentChange { - - /** DocumentChange document */ - document?: (google.firestore.v1.IDocument|null); - - /** DocumentChange targetIds */ - targetIds?: (number[]|null); - - /** DocumentChange removedTargetIds */ - removedTargetIds?: (number[]|null); - } - - /** Represents a DocumentChange. */ - class DocumentChange implements IDocumentChange { - - /** - * Constructs a new DocumentChange. - * @param [properties] Properties to set - */ - constructor(properties?: google.firestore.v1.IDocumentChange); - - /** DocumentChange document. */ - public document?: (google.firestore.v1.IDocument|null); - - /** DocumentChange targetIds. */ - public targetIds: number[]; - - /** DocumentChange removedTargetIds. */ - public removedTargetIds: number[]; - - /** - * Creates a DocumentChange message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DocumentChange - */ - public static fromObject(object: { [k: string]: any }): google.firestore.v1.DocumentChange; - - /** - * Creates a plain object from a DocumentChange message. Also converts values to other types if specified. - * @param message DocumentChange - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.v1.DocumentChange, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DocumentChange to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a DocumentDelete. */ - interface IDocumentDelete { - - /** DocumentDelete document */ - document?: (string|null); - - /** DocumentDelete removedTargetIds */ - removedTargetIds?: (number[]|null); - - /** DocumentDelete readTime */ - readTime?: (google.protobuf.ITimestamp|null); - } - - /** Represents a DocumentDelete. */ - class DocumentDelete implements IDocumentDelete { - - /** - * Constructs a new DocumentDelete. - * @param [properties] Properties to set - */ - constructor(properties?: google.firestore.v1.IDocumentDelete); - - /** DocumentDelete document. */ - public document: string; - - /** DocumentDelete removedTargetIds. */ - public removedTargetIds: number[]; - - /** DocumentDelete readTime. */ - public readTime?: (google.protobuf.ITimestamp|null); - - /** - * Creates a DocumentDelete message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DocumentDelete - */ - public static fromObject(object: { [k: string]: any }): google.firestore.v1.DocumentDelete; - - /** - * Creates a plain object from a DocumentDelete message. Also converts values to other types if specified. - * @param message DocumentDelete - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.v1.DocumentDelete, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DocumentDelete to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a DocumentRemove. */ - interface IDocumentRemove { - - /** DocumentRemove document */ - document?: (string|null); - - /** DocumentRemove removedTargetIds */ - removedTargetIds?: (number[]|null); - - /** DocumentRemove readTime */ - readTime?: (google.protobuf.ITimestamp|null); - } - - /** Represents a DocumentRemove. */ - class DocumentRemove implements IDocumentRemove { - - /** - * Constructs a new DocumentRemove. - * @param [properties] Properties to set - */ - constructor(properties?: google.firestore.v1.IDocumentRemove); - - /** DocumentRemove document. */ - public document: string; - - /** DocumentRemove removedTargetIds. */ - public removedTargetIds: number[]; - - /** DocumentRemove readTime. */ - public readTime?: (google.protobuf.ITimestamp|null); - - /** - * Creates a DocumentRemove message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DocumentRemove - */ - public static fromObject(object: { [k: string]: any }): google.firestore.v1.DocumentRemove; - - /** - * Creates a plain object from a DocumentRemove message. Also converts values to other types if specified. - * @param message DocumentRemove - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.v1.DocumentRemove, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DocumentRemove to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of an ExistenceFilter. */ - interface IExistenceFilter { - - /** ExistenceFilter targetId */ - targetId?: (number|null); - - /** ExistenceFilter count */ - count?: (number|null); - } - - /** Represents an ExistenceFilter. */ - class ExistenceFilter implements IExistenceFilter { - - /** - * Constructs a new ExistenceFilter. - * @param [properties] Properties to set - */ - constructor(properties?: google.firestore.v1.IExistenceFilter); - - /** ExistenceFilter targetId. */ - public targetId: number; - - /** ExistenceFilter count. */ - public count: number; - - /** - * Creates an ExistenceFilter message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ExistenceFilter - */ - public static fromObject(object: { [k: string]: any }): google.firestore.v1.ExistenceFilter; - - /** - * Creates a plain object from an ExistenceFilter message. Also converts values to other types if specified. - * @param message ExistenceFilter - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.v1.ExistenceFilter, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ExistenceFilter to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } - } - - /** Namespace api. */ - namespace api { - - /** Properties of a Http. */ - interface IHttp { - - /** Http rules */ - rules?: (google.api.IHttpRule[]|null); - } - - /** Represents a Http. */ - class Http implements IHttp { - - /** - * Constructs a new Http. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IHttp); - - /** Http rules. */ - public rules: google.api.IHttpRule[]; - - /** - * Creates a Http message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Http - */ - public static fromObject(object: { [k: string]: any }): google.api.Http; - - /** - * Creates a plain object from a Http message. Also converts values to other types if specified. - * @param message Http - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.Http, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Http to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a HttpRule. */ - interface IHttpRule { - - /** HttpRule get */ - get?: (string|null); - - /** HttpRule put */ - put?: (string|null); - - /** HttpRule post */ - post?: (string|null); - - /** HttpRule delete */ - "delete"?: (string|null); - - /** HttpRule patch */ - patch?: (string|null); - - /** HttpRule custom */ - custom?: (google.api.ICustomHttpPattern|null); - - /** HttpRule selector */ - selector?: (string|null); - - /** HttpRule body */ - body?: (string|null); - - /** HttpRule additionalBindings */ - additionalBindings?: (google.api.IHttpRule[]|null); - } - - /** Represents a HttpRule. */ - class HttpRule implements IHttpRule { - - /** - * Constructs a new HttpRule. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IHttpRule); - - /** HttpRule get. */ - public get?: (string|null); - - /** HttpRule put. */ - public put?: (string|null); - - /** HttpRule post. */ - public post?: (string|null); - - /** HttpRule delete. */ - public delete?: (string|null); - - /** HttpRule patch. */ - public patch?: (string|null); - - /** HttpRule custom. */ - public custom?: (google.api.ICustomHttpPattern|null); - - /** HttpRule selector. */ - public selector: string; - - /** HttpRule body. */ - public body: string; - - /** HttpRule additionalBindings. */ - public additionalBindings: google.api.IHttpRule[]; - - /** HttpRule pattern. */ - public pattern?: ("get"|"put"|"post"|"delete"|"patch"|"custom"); - - /** - * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns HttpRule - */ - public static fromObject(object: { [k: string]: any }): google.api.HttpRule; - - /** - * Creates a plain object from a HttpRule message. Also converts values to other types if specified. - * @param message HttpRule - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.HttpRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this HttpRule to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a CustomHttpPattern. */ - interface ICustomHttpPattern { - - /** CustomHttpPattern kind */ - kind?: (string|null); - - /** CustomHttpPattern path */ - path?: (string|null); - } - - /** Represents a CustomHttpPattern. */ - class CustomHttpPattern implements ICustomHttpPattern { - - /** - * Constructs a new CustomHttpPattern. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.ICustomHttpPattern); - - /** CustomHttpPattern kind. */ - public kind: string; - - /** CustomHttpPattern path. */ - public path: string; - - /** - * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CustomHttpPattern - */ - public static fromObject(object: { [k: string]: any }): google.api.CustomHttpPattern; - - /** - * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. - * @param message CustomHttpPattern - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.CustomHttpPattern, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CustomHttpPattern to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** FieldBehavior enum. */ - type FieldBehavior = - "FIELD_BEHAVIOR_UNSPECIFIED"| "OPTIONAL"| "REQUIRED"| "OUTPUT_ONLY"| "INPUT_ONLY"| "IMMUTABLE"| "UNORDERED_LIST"| "NON_EMPTY_DEFAULT"; - - /** Properties of a ResourceDescriptor. */ - interface IResourceDescriptor { - - /** ResourceDescriptor type */ - type?: (string|null); - - /** ResourceDescriptor pattern */ - pattern?: (string[]|null); - - /** ResourceDescriptor nameField */ - nameField?: (string|null); - - /** ResourceDescriptor history */ - history?: (google.api.ResourceDescriptor.History|null); - - /** ResourceDescriptor plural */ - plural?: (string|null); - - /** ResourceDescriptor singular */ - singular?: (string|null); - - /** ResourceDescriptor style */ - style?: (google.api.ResourceDescriptor.Style[]|null); - } - - /** Represents a ResourceDescriptor. */ - class ResourceDescriptor implements IResourceDescriptor { - - /** - * Constructs a new ResourceDescriptor. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IResourceDescriptor); - - /** ResourceDescriptor type. */ - public type: string; - - /** ResourceDescriptor pattern. */ - public pattern: string[]; - - /** ResourceDescriptor nameField. */ - public nameField: string; - - /** ResourceDescriptor history. */ - public history: google.api.ResourceDescriptor.History; - - /** ResourceDescriptor plural. */ - public plural: string; - - /** ResourceDescriptor singular. */ - public singular: string; - - /** ResourceDescriptor style. */ - public style: google.api.ResourceDescriptor.Style[]; - - /** - * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ResourceDescriptor - */ - public static fromObject(object: { [k: string]: any }): google.api.ResourceDescriptor; - - /** - * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. - * @param message ResourceDescriptor - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.ResourceDescriptor, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ResourceDescriptor to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - namespace ResourceDescriptor { - - /** History enum. */ - type History = - "HISTORY_UNSPECIFIED"| "ORIGINALLY_SINGLE_PATTERN"| "FUTURE_MULTI_PATTERN"; - - /** Style enum. */ - type Style = - "STYLE_UNSPECIFIED"| "DECLARATIVE_FRIENDLY"; - } - - /** Properties of a ResourceReference. */ - interface IResourceReference { - - /** ResourceReference type */ - type?: (string|null); - - /** ResourceReference childType */ - childType?: (string|null); - } - - /** Represents a ResourceReference. */ - class ResourceReference implements IResourceReference { - - /** - * Constructs a new ResourceReference. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IResourceReference); - - /** ResourceReference type. */ - public type: string; - - /** ResourceReference childType. */ - public childType: string; - - /** - * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ResourceReference - */ - public static fromObject(object: { [k: string]: any }): google.api.ResourceReference; - - /** - * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. - * @param message ResourceReference - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.ResourceReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ResourceReference to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } - - /** Namespace type. */ - namespace type { - - /** Properties of a LatLng. */ - interface ILatLng { - - /** LatLng latitude */ - latitude?: (number|null); - - /** LatLng longitude */ - longitude?: (number|null); - } - - /** Represents a LatLng. */ - class LatLng implements ILatLng { - - /** - * Constructs a new LatLng. - * @param [properties] Properties to set - */ - constructor(properties?: google.type.ILatLng); - - /** LatLng latitude. */ - public latitude: number; - - /** LatLng longitude. */ - public longitude: number; - - /** - * Creates a LatLng message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns LatLng - */ - public static fromObject(object: { [k: string]: any }): google.type.LatLng; - - /** - * Creates a plain object from a LatLng message. Also converts values to other types if specified. - * @param message LatLng - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.type.LatLng, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this LatLng to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } - - /** Namespace rpc. */ - namespace rpc { - - /** Properties of a Status. */ - interface IStatus { - - /** Status code */ - code?: (number|null); - - /** Status message */ - message?: (string|null); - - /** Status details */ - details?: (google.protobuf.IAny[]|null); - } - - /** Represents a Status. */ - class Status implements IStatus { - - /** - * Constructs a new Status. - * @param [properties] Properties to set - */ - constructor(properties?: google.rpc.IStatus); - - /** Status code. */ - public code: number; - - /** Status message. */ - public message: string; - - /** Status details. */ - public details: google.protobuf.IAny[]; - - /** - * Creates a Status message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Status - */ - public static fromObject(object: { [k: string]: any }): google.rpc.Status; - - /** - * Creates a plain object from a Status message. Also converts values to other types if specified. - * @param message Status - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.rpc.Status, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Status to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } - - /** Namespace longrunning. */ - namespace longrunning { - - /** Represents an Operations */ - class Operations extends $protobuf.rpc.Service { - - /** - * Constructs a new Operations service. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - */ - constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); - - /** - * Calls ListOperations. - * @param request ListOperationsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListOperationsResponse - */ - public listOperations(request: google.longrunning.IListOperationsRequest, callback: google.longrunning.Operations.ListOperationsCallback): void; - - /** - * Calls ListOperations. - * @param request ListOperationsRequest message or plain object - * @returns Promise - */ - public listOperations(request: google.longrunning.IListOperationsRequest): Promise; - - /** - * Calls GetOperation. - * @param request GetOperationRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public getOperation(request: google.longrunning.IGetOperationRequest, callback: google.longrunning.Operations.GetOperationCallback): void; - - /** - * Calls GetOperation. - * @param request GetOperationRequest message or plain object - * @returns Promise - */ - public getOperation(request: google.longrunning.IGetOperationRequest): Promise; - - /** - * Calls DeleteOperation. - * @param request DeleteOperationRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty - */ - public deleteOperation(request: google.longrunning.IDeleteOperationRequest, callback: google.longrunning.Operations.DeleteOperationCallback): void; - - /** - * Calls DeleteOperation. - * @param request DeleteOperationRequest message or plain object - * @returns Promise - */ - public deleteOperation(request: google.longrunning.IDeleteOperationRequest): Promise; - - /** - * Calls CancelOperation. - * @param request CancelOperationRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty - */ - public cancelOperation(request: google.longrunning.ICancelOperationRequest, callback: google.longrunning.Operations.CancelOperationCallback): void; - - /** - * Calls CancelOperation. - * @param request CancelOperationRequest message or plain object - * @returns Promise - */ - public cancelOperation(request: google.longrunning.ICancelOperationRequest): Promise; - - /** - * Calls WaitOperation. - * @param request WaitOperationRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public waitOperation(request: google.longrunning.IWaitOperationRequest, callback: google.longrunning.Operations.WaitOperationCallback): void; - - /** - * Calls WaitOperation. - * @param request WaitOperationRequest message or plain object - * @returns Promise - */ - public waitOperation(request: google.longrunning.IWaitOperationRequest): Promise; - } - - namespace Operations { - - /** - * Callback as used by {@link google.longrunning.Operations#listOperations}. - * @param error Error, if any - * @param [response] ListOperationsResponse - */ - type ListOperationsCallback = (error: (Error|null), response?: google.longrunning.ListOperationsResponse) => void; - - /** - * Callback as used by {@link google.longrunning.Operations#getOperation}. - * @param error Error, if any - * @param [response] Operation - */ - type GetOperationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.longrunning.Operations#deleteOperation}. - * @param error Error, if any - * @param [response] Empty - */ - type DeleteOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - - /** - * Callback as used by {@link google.longrunning.Operations#cancelOperation}. - * @param error Error, if any - * @param [response] Empty - */ - type CancelOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - - /** - * Callback as used by {@link google.longrunning.Operations#waitOperation}. - * @param error Error, if any - * @param [response] Operation - */ - type WaitOperationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - } - - /** Properties of an Operation. */ - interface IOperation { - - /** Operation name */ - name?: (string|null); - - /** Operation metadata */ - metadata?: (google.protobuf.IAny|null); - - /** Operation done */ - done?: (boolean|null); - - /** Operation error */ - error?: (google.rpc.IStatus|null); - - /** Operation response */ - response?: (google.protobuf.IAny|null); - } - - /** Represents an Operation. */ - class Operation implements IOperation { - - /** - * Constructs a new Operation. - * @param [properties] Properties to set - */ - constructor(properties?: google.longrunning.IOperation); - - /** Operation name. */ - public name: string; - - /** Operation metadata. */ - public metadata?: (google.protobuf.IAny|null); - - /** Operation done. */ - public done: boolean; - - /** Operation error. */ - public error?: (google.rpc.IStatus|null); - - /** Operation response. */ - public response?: (google.protobuf.IAny|null); - - /** Operation result. */ - public result?: ("error"|"response"); - - /** - * Creates an Operation message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Operation - */ - public static fromObject(object: { [k: string]: any }): google.longrunning.Operation; - - /** - * Creates a plain object from an Operation message. Also converts values to other types if specified. - * @param message Operation - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.longrunning.Operation, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Operation to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a GetOperationRequest. */ - interface IGetOperationRequest { - - /** GetOperationRequest name */ - name?: (string|null); - } - - /** Represents a GetOperationRequest. */ - class GetOperationRequest implements IGetOperationRequest { - - /** - * Constructs a new GetOperationRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.longrunning.IGetOperationRequest); - - /** GetOperationRequest name. */ - public name: string; - - /** - * Creates a GetOperationRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetOperationRequest - */ - public static fromObject(object: { [k: string]: any }): google.longrunning.GetOperationRequest; - - /** - * Creates a plain object from a GetOperationRequest message. Also converts values to other types if specified. - * @param message GetOperationRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.longrunning.GetOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetOperationRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a ListOperationsRequest. */ - interface IListOperationsRequest { - - /** ListOperationsRequest name */ - name?: (string|null); - - /** ListOperationsRequest filter */ - filter?: (string|null); - - /** ListOperationsRequest pageSize */ - pageSize?: (number|null); - - /** ListOperationsRequest pageToken */ - pageToken?: (string|null); - } - - /** Represents a ListOperationsRequest. */ - class ListOperationsRequest implements IListOperationsRequest { - - /** - * Constructs a new ListOperationsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.longrunning.IListOperationsRequest); - - /** ListOperationsRequest name. */ - public name: string; - - /** ListOperationsRequest filter. */ - public filter: string; - - /** ListOperationsRequest pageSize. */ - public pageSize: number; - - /** ListOperationsRequest pageToken. */ - public pageToken: string; - - /** - * Creates a ListOperationsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListOperationsRequest - */ - public static fromObject(object: { [k: string]: any }): google.longrunning.ListOperationsRequest; - - /** - * Creates a plain object from a ListOperationsRequest message. Also converts values to other types if specified. - * @param message ListOperationsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.longrunning.ListOperationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListOperationsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a ListOperationsResponse. */ - interface IListOperationsResponse { - - /** ListOperationsResponse operations */ - operations?: (google.longrunning.IOperation[]|null); - - /** ListOperationsResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListOperationsResponse. */ - class ListOperationsResponse implements IListOperationsResponse { - - /** - * Constructs a new ListOperationsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.longrunning.IListOperationsResponse); - - /** ListOperationsResponse operations. */ - public operations: google.longrunning.IOperation[]; - - /** ListOperationsResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a ListOperationsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListOperationsResponse - */ - public static fromObject(object: { [k: string]: any }): google.longrunning.ListOperationsResponse; - - /** - * Creates a plain object from a ListOperationsResponse message. Also converts values to other types if specified. - * @param message ListOperationsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.longrunning.ListOperationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListOperationsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a CancelOperationRequest. */ - interface ICancelOperationRequest { - - /** CancelOperationRequest name */ - name?: (string|null); - } - - /** Represents a CancelOperationRequest. */ - class CancelOperationRequest implements ICancelOperationRequest { - - /** - * Constructs a new CancelOperationRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.longrunning.ICancelOperationRequest); - - /** CancelOperationRequest name. */ - public name: string; - - /** - * Creates a CancelOperationRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CancelOperationRequest - */ - public static fromObject(object: { [k: string]: any }): google.longrunning.CancelOperationRequest; - - /** - * Creates a plain object from a CancelOperationRequest message. Also converts values to other types if specified. - * @param message CancelOperationRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.longrunning.CancelOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CancelOperationRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a DeleteOperationRequest. */ - interface IDeleteOperationRequest { - - /** DeleteOperationRequest name */ - name?: (string|null); - } - - /** Represents a DeleteOperationRequest. */ - class DeleteOperationRequest implements IDeleteOperationRequest { - - /** - * Constructs a new DeleteOperationRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.longrunning.IDeleteOperationRequest); - - /** DeleteOperationRequest name. */ - public name: string; - - /** - * Creates a DeleteOperationRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteOperationRequest - */ - public static fromObject(object: { [k: string]: any }): google.longrunning.DeleteOperationRequest; - - /** - * Creates a plain object from a DeleteOperationRequest message. Also converts values to other types if specified. - * @param message DeleteOperationRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.longrunning.DeleteOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteOperationRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a WaitOperationRequest. */ - interface IWaitOperationRequest { - - /** WaitOperationRequest name */ - name?: (string|null); - - /** WaitOperationRequest timeout */ - timeout?: (google.protobuf.IDuration|null); - } - - /** Represents a WaitOperationRequest. */ - class WaitOperationRequest implements IWaitOperationRequest { - - /** - * Constructs a new WaitOperationRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.longrunning.IWaitOperationRequest); - - /** WaitOperationRequest name. */ - public name: string; - - /** WaitOperationRequest timeout. */ - public timeout?: (google.protobuf.IDuration|null); - - /** - * Creates a WaitOperationRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns WaitOperationRequest - */ - public static fromObject(object: { [k: string]: any }): google.longrunning.WaitOperationRequest; - - /** - * Creates a plain object from a WaitOperationRequest message. Also converts values to other types if specified. - * @param message WaitOperationRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.longrunning.WaitOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this WaitOperationRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of an OperationInfo. */ - interface IOperationInfo { - - /** OperationInfo responseType */ - responseType?: (string|null); - - /** OperationInfo metadataType */ - metadataType?: (string|null); - } - - /** Represents an OperationInfo. */ - class OperationInfo implements IOperationInfo { - - /** - * Constructs a new OperationInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.longrunning.IOperationInfo); - - /** OperationInfo responseType. */ - public responseType: string; - - /** OperationInfo metadataType. */ - public metadataType: string; - - /** - * Creates an OperationInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns OperationInfo - */ - public static fromObject(object: { [k: string]: any }): google.longrunning.OperationInfo; - - /** - * Creates a plain object from an OperationInfo message. Also converts values to other types if specified. - * @param message OperationInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.longrunning.OperationInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this OperationInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/firestore/types/protos/firestore_v1beta1_proto_api.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/firestore/types/protos/firestore_v1beta1_proto_api.d.ts deleted file mode 100644 index ce9fcaee..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/firestore/types/protos/firestore_v1beta1_proto_api.d.ts +++ /dev/null @@ -1,6826 +0,0 @@ -/*! - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import * as $protobuf from "protobufjs"; -/** Namespace google. */ -export namespace google { - - /** Namespace protobuf. */ - namespace protobuf { - - /** Properties of a Timestamp. */ - interface ITimestamp { - - /** Timestamp seconds */ - seconds?: (number|string|null); - - /** Timestamp nanos */ - nanos?: (number|null); - } - - /** Represents a Timestamp. */ - class Timestamp implements ITimestamp { - - /** - * Constructs a new Timestamp. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.ITimestamp); - - /** Timestamp seconds. */ - public seconds: (number|string); - - /** Timestamp nanos. */ - public nanos: number; - - /** - * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Timestamp - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Timestamp; - - /** - * Creates a plain object from a Timestamp message. Also converts values to other types if specified. - * @param message Timestamp - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.Timestamp, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Timestamp to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a FileDescriptorSet. */ - interface IFileDescriptorSet { - - /** FileDescriptorSet file */ - file?: (google.protobuf.IFileDescriptorProto[]|null); - } - - /** Represents a FileDescriptorSet. */ - class FileDescriptorSet implements IFileDescriptorSet { - - /** - * Constructs a new FileDescriptorSet. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFileDescriptorSet); - - /** FileDescriptorSet file. */ - public file: google.protobuf.IFileDescriptorProto[]; - - /** - * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FileDescriptorSet - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorSet; - - /** - * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. - * @param message FileDescriptorSet - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FileDescriptorSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FileDescriptorSet to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a FileDescriptorProto. */ - interface IFileDescriptorProto { - - /** FileDescriptorProto name */ - name?: (string|null); - - /** FileDescriptorProto package */ - "package"?: (string|null); - - /** FileDescriptorProto dependency */ - dependency?: (string[]|null); - - /** FileDescriptorProto publicDependency */ - publicDependency?: (number[]|null); - - /** FileDescriptorProto weakDependency */ - weakDependency?: (number[]|null); - - /** FileDescriptorProto messageType */ - messageType?: (google.protobuf.IDescriptorProto[]|null); - - /** FileDescriptorProto enumType */ - enumType?: (google.protobuf.IEnumDescriptorProto[]|null); - - /** FileDescriptorProto service */ - service?: (google.protobuf.IServiceDescriptorProto[]|null); - - /** FileDescriptorProto extension */ - extension?: (google.protobuf.IFieldDescriptorProto[]|null); - - /** FileDescriptorProto options */ - options?: (google.protobuf.IFileOptions|null); - - /** FileDescriptorProto sourceCodeInfo */ - sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); - - /** FileDescriptorProto syntax */ - syntax?: (string|null); - } - - /** Represents a FileDescriptorProto. */ - class FileDescriptorProto implements IFileDescriptorProto { - - /** - * Constructs a new FileDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFileDescriptorProto); - - /** FileDescriptorProto name. */ - public name: string; - - /** FileDescriptorProto package. */ - public package: string; - - /** FileDescriptorProto dependency. */ - public dependency: string[]; - - /** FileDescriptorProto publicDependency. */ - public publicDependency: number[]; - - /** FileDescriptorProto weakDependency. */ - public weakDependency: number[]; - - /** FileDescriptorProto messageType. */ - public messageType: google.protobuf.IDescriptorProto[]; - - /** FileDescriptorProto enumType. */ - public enumType: google.protobuf.IEnumDescriptorProto[]; - - /** FileDescriptorProto service. */ - public service: google.protobuf.IServiceDescriptorProto[]; - - /** FileDescriptorProto extension. */ - public extension: google.protobuf.IFieldDescriptorProto[]; - - /** FileDescriptorProto options. */ - public options?: (google.protobuf.IFileOptions|null); - - /** FileDescriptorProto sourceCodeInfo. */ - public sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); - - /** FileDescriptorProto syntax. */ - public syntax: string; - - /** - * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FileDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorProto; - - /** - * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. - * @param message FileDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FileDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FileDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a DescriptorProto. */ - interface IDescriptorProto { - - /** DescriptorProto name */ - name?: (string|null); - - /** DescriptorProto field */ - field?: (google.protobuf.IFieldDescriptorProto[]|null); - - /** DescriptorProto extension */ - extension?: (google.protobuf.IFieldDescriptorProto[]|null); - - /** DescriptorProto nestedType */ - nestedType?: (google.protobuf.IDescriptorProto[]|null); - - /** DescriptorProto enumType */ - enumType?: (google.protobuf.IEnumDescriptorProto[]|null); - - /** DescriptorProto extensionRange */ - extensionRange?: (google.protobuf.DescriptorProto.IExtensionRange[]|null); - - /** DescriptorProto oneofDecl */ - oneofDecl?: (google.protobuf.IOneofDescriptorProto[]|null); - - /** DescriptorProto options */ - options?: (google.protobuf.IMessageOptions|null); - - /** DescriptorProto reservedRange */ - reservedRange?: (google.protobuf.DescriptorProto.IReservedRange[]|null); - - /** DescriptorProto reservedName */ - reservedName?: (string[]|null); - } - - /** Represents a DescriptorProto. */ - class DescriptorProto implements IDescriptorProto { - - /** - * Constructs a new DescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IDescriptorProto); - - /** DescriptorProto name. */ - public name: string; - - /** DescriptorProto field. */ - public field: google.protobuf.IFieldDescriptorProto[]; - - /** DescriptorProto extension. */ - public extension: google.protobuf.IFieldDescriptorProto[]; - - /** DescriptorProto nestedType. */ - public nestedType: google.protobuf.IDescriptorProto[]; - - /** DescriptorProto enumType. */ - public enumType: google.protobuf.IEnumDescriptorProto[]; - - /** DescriptorProto extensionRange. */ - public extensionRange: google.protobuf.DescriptorProto.IExtensionRange[]; - - /** DescriptorProto oneofDecl. */ - public oneofDecl: google.protobuf.IOneofDescriptorProto[]; - - /** DescriptorProto options. */ - public options?: (google.protobuf.IMessageOptions|null); - - /** DescriptorProto reservedRange. */ - public reservedRange: google.protobuf.DescriptorProto.IReservedRange[]; - - /** DescriptorProto reservedName. */ - public reservedName: string[]; - - /** - * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto; - - /** - * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. - * @param message DescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.DescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - namespace DescriptorProto { - - /** Properties of an ExtensionRange. */ - interface IExtensionRange { - - /** ExtensionRange start */ - start?: (number|null); - - /** ExtensionRange end */ - end?: (number|null); - } - - /** Represents an ExtensionRange. */ - class ExtensionRange implements IExtensionRange { - - /** - * Constructs a new ExtensionRange. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.DescriptorProto.IExtensionRange); - - /** ExtensionRange start. */ - public start: number; - - /** ExtensionRange end. */ - public end: number; - - /** - * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ExtensionRange - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ExtensionRange; - - /** - * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. - * @param message ExtensionRange - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.DescriptorProto.ExtensionRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ExtensionRange to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a ReservedRange. */ - interface IReservedRange { - - /** ReservedRange start */ - start?: (number|null); - - /** ReservedRange end */ - end?: (number|null); - } - - /** Represents a ReservedRange. */ - class ReservedRange implements IReservedRange { - - /** - * Constructs a new ReservedRange. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.DescriptorProto.IReservedRange); - - /** ReservedRange start. */ - public start: number; - - /** ReservedRange end. */ - public end: number; - - /** - * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ReservedRange - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ReservedRange; - - /** - * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. - * @param message ReservedRange - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.DescriptorProto.ReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ReservedRange to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } - - /** Properties of a FieldDescriptorProto. */ - interface IFieldDescriptorProto { - - /** FieldDescriptorProto name */ - name?: (string|null); - - /** FieldDescriptorProto number */ - number?: (number|null); - - /** FieldDescriptorProto label */ - label?: (google.protobuf.FieldDescriptorProto.Label|null); - - /** FieldDescriptorProto type */ - type?: (google.protobuf.FieldDescriptorProto.Type|null); - - /** FieldDescriptorProto typeName */ - typeName?: (string|null); - - /** FieldDescriptorProto extendee */ - extendee?: (string|null); - - /** FieldDescriptorProto defaultValue */ - defaultValue?: (string|null); - - /** FieldDescriptorProto oneofIndex */ - oneofIndex?: (number|null); - - /** FieldDescriptorProto jsonName */ - jsonName?: (string|null); - - /** FieldDescriptorProto options */ - options?: (google.protobuf.IFieldOptions|null); - } - - /** Represents a FieldDescriptorProto. */ - class FieldDescriptorProto implements IFieldDescriptorProto { - - /** - * Constructs a new FieldDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFieldDescriptorProto); - - /** FieldDescriptorProto name. */ - public name: string; - - /** FieldDescriptorProto number. */ - public number: number; - - /** FieldDescriptorProto label. */ - public label: google.protobuf.FieldDescriptorProto.Label; - - /** FieldDescriptorProto type. */ - public type: google.protobuf.FieldDescriptorProto.Type; - - /** FieldDescriptorProto typeName. */ - public typeName: string; - - /** FieldDescriptorProto extendee. */ - public extendee: string; - - /** FieldDescriptorProto defaultValue. */ - public defaultValue: string; - - /** FieldDescriptorProto oneofIndex. */ - public oneofIndex: number; - - /** FieldDescriptorProto jsonName. */ - public jsonName: string; - - /** FieldDescriptorProto options. */ - public options?: (google.protobuf.IFieldOptions|null); - - /** - * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FieldDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FieldDescriptorProto; - - /** - * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. - * @param message FieldDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FieldDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FieldDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - namespace FieldDescriptorProto { - - /** Type enum. */ - type Type = - "TYPE_DOUBLE"| "TYPE_FLOAT"| "TYPE_INT64"| "TYPE_UINT64"| "TYPE_INT32"| "TYPE_FIXED64"| "TYPE_FIXED32"| "TYPE_BOOL"| "TYPE_STRING"| "TYPE_GROUP"| "TYPE_MESSAGE"| "TYPE_BYTES"| "TYPE_UINT32"| "TYPE_ENUM"| "TYPE_SFIXED32"| "TYPE_SFIXED64"| "TYPE_SINT32"| "TYPE_SINT64"; - - /** Label enum. */ - type Label = - "LABEL_OPTIONAL"| "LABEL_REQUIRED"| "LABEL_REPEATED"; - } - - /** Properties of an OneofDescriptorProto. */ - interface IOneofDescriptorProto { - - /** OneofDescriptorProto name */ - name?: (string|null); - - /** OneofDescriptorProto options */ - options?: (google.protobuf.IOneofOptions|null); - } - - /** Represents an OneofDescriptorProto. */ - class OneofDescriptorProto implements IOneofDescriptorProto { - - /** - * Constructs a new OneofDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IOneofDescriptorProto); - - /** OneofDescriptorProto name. */ - public name: string; - - /** OneofDescriptorProto options. */ - public options?: (google.protobuf.IOneofOptions|null); - - /** - * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns OneofDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.OneofDescriptorProto; - - /** - * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. - * @param message OneofDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.OneofDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this OneofDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of an EnumDescriptorProto. */ - interface IEnumDescriptorProto { - - /** EnumDescriptorProto name */ - name?: (string|null); - - /** EnumDescriptorProto value */ - value?: (google.protobuf.IEnumValueDescriptorProto[]|null); - - /** EnumDescriptorProto options */ - options?: (google.protobuf.IEnumOptions|null); - } - - /** Represents an EnumDescriptorProto. */ - class EnumDescriptorProto implements IEnumDescriptorProto { - - /** - * Constructs a new EnumDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IEnumDescriptorProto); - - /** EnumDescriptorProto name. */ - public name: string; - - /** EnumDescriptorProto value. */ - public value: google.protobuf.IEnumValueDescriptorProto[]; - - /** EnumDescriptorProto options. */ - public options?: (google.protobuf.IEnumOptions|null); - - /** - * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EnumDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto; - - /** - * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. - * @param message EnumDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.EnumDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EnumDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of an EnumValueDescriptorProto. */ - interface IEnumValueDescriptorProto { - - /** EnumValueDescriptorProto name */ - name?: (string|null); - - /** EnumValueDescriptorProto number */ - number?: (number|null); - - /** EnumValueDescriptorProto options */ - options?: (google.protobuf.IEnumValueOptions|null); - } - - /** Represents an EnumValueDescriptorProto. */ - class EnumValueDescriptorProto implements IEnumValueDescriptorProto { - - /** - * Constructs a new EnumValueDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IEnumValueDescriptorProto); - - /** EnumValueDescriptorProto name. */ - public name: string; - - /** EnumValueDescriptorProto number. */ - public number: number; - - /** EnumValueDescriptorProto options. */ - public options?: (google.protobuf.IEnumValueOptions|null); - - /** - * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EnumValueDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueDescriptorProto; - - /** - * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. - * @param message EnumValueDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.EnumValueDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EnumValueDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a ServiceDescriptorProto. */ - interface IServiceDescriptorProto { - - /** ServiceDescriptorProto name */ - name?: (string|null); - - /** ServiceDescriptorProto method */ - method?: (google.protobuf.IMethodDescriptorProto[]|null); - - /** ServiceDescriptorProto options */ - options?: (google.protobuf.IServiceOptions|null); - } - - /** Represents a ServiceDescriptorProto. */ - class ServiceDescriptorProto implements IServiceDescriptorProto { - - /** - * Constructs a new ServiceDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IServiceDescriptorProto); - - /** ServiceDescriptorProto name. */ - public name: string; - - /** ServiceDescriptorProto method. */ - public method: google.protobuf.IMethodDescriptorProto[]; - - /** ServiceDescriptorProto options. */ - public options?: (google.protobuf.IServiceOptions|null); - - /** - * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ServiceDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceDescriptorProto; - - /** - * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. - * @param message ServiceDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.ServiceDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ServiceDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a MethodDescriptorProto. */ - interface IMethodDescriptorProto { - - /** MethodDescriptorProto name */ - name?: (string|null); - - /** MethodDescriptorProto inputType */ - inputType?: (string|null); - - /** MethodDescriptorProto outputType */ - outputType?: (string|null); - - /** MethodDescriptorProto options */ - options?: (google.protobuf.IMethodOptions|null); - - /** MethodDescriptorProto clientStreaming */ - clientStreaming?: (boolean|null); - - /** MethodDescriptorProto serverStreaming */ - serverStreaming?: (boolean|null); - } - - /** Represents a MethodDescriptorProto. */ - class MethodDescriptorProto implements IMethodDescriptorProto { - - /** - * Constructs a new MethodDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IMethodDescriptorProto); - - /** MethodDescriptorProto name. */ - public name: string; - - /** MethodDescriptorProto inputType. */ - public inputType: string; - - /** MethodDescriptorProto outputType. */ - public outputType: string; - - /** MethodDescriptorProto options. */ - public options?: (google.protobuf.IMethodOptions|null); - - /** MethodDescriptorProto clientStreaming. */ - public clientStreaming: boolean; - - /** MethodDescriptorProto serverStreaming. */ - public serverStreaming: boolean; - - /** - * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MethodDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.MethodDescriptorProto; - - /** - * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. - * @param message MethodDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.MethodDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MethodDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a FileOptions. */ - interface IFileOptions { - - /** FileOptions javaPackage */ - javaPackage?: (string|null); - - /** FileOptions javaOuterClassname */ - javaOuterClassname?: (string|null); - - /** FileOptions javaMultipleFiles */ - javaMultipleFiles?: (boolean|null); - - /** FileOptions javaGenerateEqualsAndHash */ - javaGenerateEqualsAndHash?: (boolean|null); - - /** FileOptions javaStringCheckUtf8 */ - javaStringCheckUtf8?: (boolean|null); - - /** FileOptions optimizeFor */ - optimizeFor?: (google.protobuf.FileOptions.OptimizeMode|null); - - /** FileOptions goPackage */ - goPackage?: (string|null); - - /** FileOptions ccGenericServices */ - ccGenericServices?: (boolean|null); - - /** FileOptions javaGenericServices */ - javaGenericServices?: (boolean|null); - - /** FileOptions pyGenericServices */ - pyGenericServices?: (boolean|null); - - /** FileOptions deprecated */ - deprecated?: (boolean|null); - - /** FileOptions ccEnableArenas */ - ccEnableArenas?: (boolean|null); - - /** FileOptions objcClassPrefix */ - objcClassPrefix?: (string|null); - - /** FileOptions csharpNamespace */ - csharpNamespace?: (string|null); - - /** FileOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - - /** FileOptions .google.api.resourceDefinition */ - ".google.api.resourceDefinition"?: (google.api.IResourceDescriptor[]|null); - } - - /** Represents a FileOptions. */ - class FileOptions implements IFileOptions { - - /** - * Constructs a new FileOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFileOptions); - - /** FileOptions javaPackage. */ - public javaPackage: string; - - /** FileOptions javaOuterClassname. */ - public javaOuterClassname: string; - - /** FileOptions javaMultipleFiles. */ - public javaMultipleFiles: boolean; - - /** FileOptions javaGenerateEqualsAndHash. */ - public javaGenerateEqualsAndHash: boolean; - - /** FileOptions javaStringCheckUtf8. */ - public javaStringCheckUtf8: boolean; - - /** FileOptions optimizeFor. */ - public optimizeFor: google.protobuf.FileOptions.OptimizeMode; - - /** FileOptions goPackage. */ - public goPackage: string; - - /** FileOptions ccGenericServices. */ - public ccGenericServices: boolean; - - /** FileOptions javaGenericServices. */ - public javaGenericServices: boolean; - - /** FileOptions pyGenericServices. */ - public pyGenericServices: boolean; - - /** FileOptions deprecated. */ - public deprecated: boolean; - - /** FileOptions ccEnableArenas. */ - public ccEnableArenas: boolean; - - /** FileOptions objcClassPrefix. */ - public objcClassPrefix: string; - - /** FileOptions csharpNamespace. */ - public csharpNamespace: string; - - /** FileOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FileOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FileOptions; - - /** - * Creates a plain object from a FileOptions message. Also converts values to other types if specified. - * @param message FileOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FileOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FileOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - namespace FileOptions { - - /** OptimizeMode enum. */ - type OptimizeMode = - "SPEED"| "CODE_SIZE"| "LITE_RUNTIME"; - } - - /** Properties of a MessageOptions. */ - interface IMessageOptions { - - /** MessageOptions messageSetWireFormat */ - messageSetWireFormat?: (boolean|null); - - /** MessageOptions noStandardDescriptorAccessor */ - noStandardDescriptorAccessor?: (boolean|null); - - /** MessageOptions deprecated */ - deprecated?: (boolean|null); - - /** MessageOptions mapEntry */ - mapEntry?: (boolean|null); - - /** MessageOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - - /** MessageOptions .google.api.resource */ - ".google.api.resource"?: (google.api.IResourceDescriptor|null); - } - - /** Represents a MessageOptions. */ - class MessageOptions implements IMessageOptions { - - /** - * Constructs a new MessageOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IMessageOptions); - - /** MessageOptions messageSetWireFormat. */ - public messageSetWireFormat: boolean; - - /** MessageOptions noStandardDescriptorAccessor. */ - public noStandardDescriptorAccessor: boolean; - - /** MessageOptions deprecated. */ - public deprecated: boolean; - - /** MessageOptions mapEntry. */ - public mapEntry: boolean; - - /** MessageOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MessageOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.MessageOptions; - - /** - * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. - * @param message MessageOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.MessageOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MessageOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a FieldOptions. */ - interface IFieldOptions { - - /** FieldOptions ctype */ - ctype?: (google.protobuf.FieldOptions.CType|null); - - /** FieldOptions packed */ - packed?: (boolean|null); - - /** FieldOptions jstype */ - jstype?: (google.protobuf.FieldOptions.JSType|null); - - /** FieldOptions lazy */ - lazy?: (boolean|null); - - /** FieldOptions deprecated */ - deprecated?: (boolean|null); - - /** FieldOptions weak */ - weak?: (boolean|null); - - /** FieldOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - - /** FieldOptions .google.api.fieldBehavior */ - ".google.api.fieldBehavior"?: (google.api.FieldBehavior[]|null); - - /** FieldOptions .google.api.resourceReference */ - ".google.api.resourceReference"?: (google.api.IResourceReference|null); - } - - /** Represents a FieldOptions. */ - class FieldOptions implements IFieldOptions { - - /** - * Constructs a new FieldOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFieldOptions); - - /** FieldOptions ctype. */ - public ctype: google.protobuf.FieldOptions.CType; - - /** FieldOptions packed. */ - public packed: boolean; - - /** FieldOptions jstype. */ - public jstype: google.protobuf.FieldOptions.JSType; - - /** FieldOptions lazy. */ - public lazy: boolean; - - /** FieldOptions deprecated. */ - public deprecated: boolean; - - /** FieldOptions weak. */ - public weak: boolean; - - /** FieldOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FieldOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions; - - /** - * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. - * @param message FieldOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FieldOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FieldOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - namespace FieldOptions { - - /** CType enum. */ - type CType = - "STRING"| "CORD"| "STRING_PIECE"; - - /** JSType enum. */ - type JSType = - "JS_NORMAL"| "JS_STRING"| "JS_NUMBER"; - } - - /** Properties of an OneofOptions. */ - interface IOneofOptions { - - /** OneofOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - } - - /** Represents an OneofOptions. */ - class OneofOptions implements IOneofOptions { - - /** - * Constructs a new OneofOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IOneofOptions); - - /** OneofOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns OneofOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.OneofOptions; - - /** - * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. - * @param message OneofOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.OneofOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this OneofOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of an EnumOptions. */ - interface IEnumOptions { - - /** EnumOptions allowAlias */ - allowAlias?: (boolean|null); - - /** EnumOptions deprecated */ - deprecated?: (boolean|null); - - /** EnumOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - } - - /** Represents an EnumOptions. */ - class EnumOptions implements IEnumOptions { - - /** - * Constructs a new EnumOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IEnumOptions); - - /** EnumOptions allowAlias. */ - public allowAlias: boolean; - - /** EnumOptions deprecated. */ - public deprecated: boolean; - - /** EnumOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EnumOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.EnumOptions; - - /** - * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. - * @param message EnumOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.EnumOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EnumOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of an EnumValueOptions. */ - interface IEnumValueOptions { - - /** EnumValueOptions deprecated */ - deprecated?: (boolean|null); - - /** EnumValueOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - } - - /** Represents an EnumValueOptions. */ - class EnumValueOptions implements IEnumValueOptions { - - /** - * Constructs a new EnumValueOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IEnumValueOptions); - - /** EnumValueOptions deprecated. */ - public deprecated: boolean; - - /** EnumValueOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EnumValueOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueOptions; - - /** - * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. - * @param message EnumValueOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.EnumValueOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EnumValueOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a ServiceOptions. */ - interface IServiceOptions { - - /** ServiceOptions deprecated */ - deprecated?: (boolean|null); - - /** ServiceOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - - /** ServiceOptions .google.api.defaultHost */ - ".google.api.defaultHost"?: (string|null); - - /** ServiceOptions .google.api.oauthScopes */ - ".google.api.oauthScopes"?: (string|null); - } - - /** Represents a ServiceOptions. */ - class ServiceOptions implements IServiceOptions { - - /** - * Constructs a new ServiceOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IServiceOptions); - - /** ServiceOptions deprecated. */ - public deprecated: boolean; - - /** ServiceOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ServiceOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceOptions; - - /** - * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. - * @param message ServiceOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.ServiceOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ServiceOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a MethodOptions. */ - interface IMethodOptions { - - /** MethodOptions deprecated */ - deprecated?: (boolean|null); - - /** MethodOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - - /** MethodOptions .google.api.http */ - ".google.api.http"?: (google.api.IHttpRule|null); - - /** MethodOptions .google.api.methodSignature */ - ".google.api.methodSignature"?: (string[]|null); - - /** MethodOptions .google.longrunning.operationInfo */ - ".google.longrunning.operationInfo"?: (google.longrunning.IOperationInfo|null); - } - - /** Represents a MethodOptions. */ - class MethodOptions implements IMethodOptions { - - /** - * Constructs a new MethodOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IMethodOptions); - - /** MethodOptions deprecated. */ - public deprecated: boolean; - - /** MethodOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MethodOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.MethodOptions; - - /** - * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. - * @param message MethodOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.MethodOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MethodOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of an UninterpretedOption. */ - interface IUninterpretedOption { - - /** UninterpretedOption name */ - name?: (google.protobuf.UninterpretedOption.INamePart[]|null); - - /** UninterpretedOption identifierValue */ - identifierValue?: (string|null); - - /** UninterpretedOption positiveIntValue */ - positiveIntValue?: (number|string|null); - - /** UninterpretedOption negativeIntValue */ - negativeIntValue?: (number|string|null); - - /** UninterpretedOption doubleValue */ - doubleValue?: (number|null); - - /** UninterpretedOption stringValue */ - stringValue?: (Uint8Array|null); - - /** UninterpretedOption aggregateValue */ - aggregateValue?: (string|null); - } - - /** Represents an UninterpretedOption. */ - class UninterpretedOption implements IUninterpretedOption { - - /** - * Constructs a new UninterpretedOption. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IUninterpretedOption); - - /** UninterpretedOption name. */ - public name: google.protobuf.UninterpretedOption.INamePart[]; - - /** UninterpretedOption identifierValue. */ - public identifierValue: string; - - /** UninterpretedOption positiveIntValue. */ - public positiveIntValue: (number|string); - - /** UninterpretedOption negativeIntValue. */ - public negativeIntValue: (number|string); - - /** UninterpretedOption doubleValue. */ - public doubleValue: number; - - /** UninterpretedOption stringValue. */ - public stringValue: Uint8Array; - - /** UninterpretedOption aggregateValue. */ - public aggregateValue: string; - - /** - * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UninterpretedOption - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption; - - /** - * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. - * @param message UninterpretedOption - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.UninterpretedOption, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UninterpretedOption to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - namespace UninterpretedOption { - - /** Properties of a NamePart. */ - interface INamePart { - - /** NamePart namePart */ - namePart: string; - - /** NamePart isExtension */ - isExtension: boolean; - } - - /** Represents a NamePart. */ - class NamePart implements INamePart { - - /** - * Constructs a new NamePart. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.UninterpretedOption.INamePart); - - /** NamePart namePart. */ - public namePart: string; - - /** NamePart isExtension. */ - public isExtension: boolean; - - /** - * Creates a NamePart message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns NamePart - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption.NamePart; - - /** - * Creates a plain object from a NamePart message. Also converts values to other types if specified. - * @param message NamePart - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.UninterpretedOption.NamePart, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this NamePart to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } - - /** Properties of a SourceCodeInfo. */ - interface ISourceCodeInfo { - - /** SourceCodeInfo location */ - location?: (google.protobuf.SourceCodeInfo.ILocation[]|null); - } - - /** Represents a SourceCodeInfo. */ - class SourceCodeInfo implements ISourceCodeInfo { - - /** - * Constructs a new SourceCodeInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.ISourceCodeInfo); - - /** SourceCodeInfo location. */ - public location: google.protobuf.SourceCodeInfo.ILocation[]; - - /** - * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SourceCodeInfo - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo; - - /** - * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. - * @param message SourceCodeInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.SourceCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SourceCodeInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - namespace SourceCodeInfo { - - /** Properties of a Location. */ - interface ILocation { - - /** Location path */ - path?: (number[]|null); - - /** Location span */ - span?: (number[]|null); - - /** Location leadingComments */ - leadingComments?: (string|null); - - /** Location trailingComments */ - trailingComments?: (string|null); - - /** Location leadingDetachedComments */ - leadingDetachedComments?: (string[]|null); - } - - /** Represents a Location. */ - class Location implements ILocation { - - /** - * Constructs a new Location. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.SourceCodeInfo.ILocation); - - /** Location path. */ - public path: number[]; - - /** Location span. */ - public span: number[]; - - /** Location leadingComments. */ - public leadingComments: string; - - /** Location trailingComments. */ - public trailingComments: string; - - /** Location leadingDetachedComments. */ - public leadingDetachedComments: string[]; - - /** - * Creates a Location message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Location - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo.Location; - - /** - * Creates a plain object from a Location message. Also converts values to other types if specified. - * @param message Location - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.SourceCodeInfo.Location, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Location to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } - - /** Properties of a GeneratedCodeInfo. */ - interface IGeneratedCodeInfo { - - /** GeneratedCodeInfo annotation */ - annotation?: (google.protobuf.GeneratedCodeInfo.IAnnotation[]|null); - } - - /** Represents a GeneratedCodeInfo. */ - class GeneratedCodeInfo implements IGeneratedCodeInfo { - - /** - * Constructs a new GeneratedCodeInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IGeneratedCodeInfo); - - /** GeneratedCodeInfo annotation. */ - public annotation: google.protobuf.GeneratedCodeInfo.IAnnotation[]; - - /** - * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GeneratedCodeInfo - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo; - - /** - * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. - * @param message GeneratedCodeInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.GeneratedCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GeneratedCodeInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - namespace GeneratedCodeInfo { - - /** Properties of an Annotation. */ - interface IAnnotation { - - /** Annotation path */ - path?: (number[]|null); - - /** Annotation sourceFile */ - sourceFile?: (string|null); - - /** Annotation begin */ - begin?: (number|null); - - /** Annotation end */ - end?: (number|null); - } - - /** Represents an Annotation. */ - class Annotation implements IAnnotation { - - /** - * Constructs a new Annotation. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation); - - /** Annotation path. */ - public path: number[]; - - /** Annotation sourceFile. */ - public sourceFile: string; - - /** Annotation begin. */ - public begin: number; - - /** Annotation end. */ - public end: number; - - /** - * Creates an Annotation message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Annotation - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo.Annotation; - - /** - * Creates a plain object from an Annotation message. Also converts values to other types if specified. - * @param message Annotation - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.GeneratedCodeInfo.Annotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Annotation to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } - - /** Properties of a Struct. */ - interface IStruct { - - /** Struct fields */ - fields?: ({ [k: string]: google.protobuf.IValue }|null); - } - - /** Represents a Struct. */ - class Struct implements IStruct { - - /** - * Constructs a new Struct. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IStruct); - - /** Struct fields. */ - public fields: { [k: string]: google.protobuf.IValue }; - - /** - * Creates a Struct message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Struct - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Struct; - - /** - * Creates a plain object from a Struct message. Also converts values to other types if specified. - * @param message Struct - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.Struct, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Struct to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a Value. */ - interface IValue { - - /** Value nullValue */ - nullValue?: (google.protobuf.NullValue|null); - - /** Value numberValue */ - numberValue?: (number|null); - - /** Value stringValue */ - stringValue?: (string|null); - - /** Value boolValue */ - boolValue?: (boolean|null); - - /** Value structValue */ - structValue?: (google.protobuf.IStruct|null); - - /** Value listValue */ - listValue?: (google.protobuf.IListValue|null); - } - - /** Represents a Value. */ - class Value implements IValue { - - /** - * Constructs a new Value. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IValue); - - /** Value nullValue. */ - public nullValue?: (google.protobuf.NullValue|null); - - /** Value numberValue. */ - public numberValue?: (number|null); - - /** Value stringValue. */ - public stringValue?: (string|null); - - /** Value boolValue. */ - public boolValue?: (boolean|null); - - /** Value structValue. */ - public structValue?: (google.protobuf.IStruct|null); - - /** Value listValue. */ - public listValue?: (google.protobuf.IListValue|null); - - /** Value kind. */ - public kind?: ("nullValue"|"numberValue"|"stringValue"|"boolValue"|"structValue"|"listValue"); - - /** - * Creates a Value message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Value - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Value; - - /** - * Creates a plain object from a Value message. Also converts values to other types if specified. - * @param message Value - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Value to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** NullValue enum. */ - type NullValue = - "NULL_VALUE"; - - /** Properties of a ListValue. */ - interface IListValue { - - /** ListValue values */ - values?: (google.protobuf.IValue[]|null); - } - - /** Represents a ListValue. */ - class ListValue implements IListValue { - - /** - * Constructs a new ListValue. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IListValue); - - /** ListValue values. */ - public values: google.protobuf.IValue[]; - - /** - * Creates a ListValue message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListValue - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.ListValue; - - /** - * Creates a plain object from a ListValue message. Also converts values to other types if specified. - * @param message ListValue - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.ListValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListValue to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of an Empty. */ - interface IEmpty { - } - - /** Represents an Empty. */ - class Empty implements IEmpty { - - /** - * Constructs a new Empty. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IEmpty); - - /** - * Creates an Empty message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Empty - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Empty; - - /** - * Creates a plain object from an Empty message. Also converts values to other types if specified. - * @param message Empty - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.Empty, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Empty to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a DoubleValue. */ - interface IDoubleValue { - - /** DoubleValue value */ - value?: (number|null); - } - - /** Represents a DoubleValue. */ - class DoubleValue implements IDoubleValue { - - /** - * Constructs a new DoubleValue. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IDoubleValue); - - /** DoubleValue value. */ - public value: number; - - /** - * Creates a DoubleValue message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DoubleValue - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.DoubleValue; - - /** - * Creates a plain object from a DoubleValue message. Also converts values to other types if specified. - * @param message DoubleValue - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.DoubleValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DoubleValue to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a FloatValue. */ - interface IFloatValue { - - /** FloatValue value */ - value?: (number|null); - } - - /** Represents a FloatValue. */ - class FloatValue implements IFloatValue { - - /** - * Constructs a new FloatValue. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFloatValue); - - /** FloatValue value. */ - public value: number; - - /** - * Creates a FloatValue message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FloatValue - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FloatValue; - - /** - * Creates a plain object from a FloatValue message. Also converts values to other types if specified. - * @param message FloatValue - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FloatValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FloatValue to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of an Int64Value. */ - interface IInt64Value { - - /** Int64Value value */ - value?: (number|string|null); - } - - /** Represents an Int64Value. */ - class Int64Value implements IInt64Value { - - /** - * Constructs a new Int64Value. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IInt64Value); - - /** Int64Value value. */ - public value: (number|string); - - /** - * Creates an Int64Value message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Int64Value - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Int64Value; - - /** - * Creates a plain object from an Int64Value message. Also converts values to other types if specified. - * @param message Int64Value - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.Int64Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Int64Value to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a UInt64Value. */ - interface IUInt64Value { - - /** UInt64Value value */ - value?: (number|string|null); - } - - /** Represents a UInt64Value. */ - class UInt64Value implements IUInt64Value { - - /** - * Constructs a new UInt64Value. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IUInt64Value); - - /** UInt64Value value. */ - public value: (number|string); - - /** - * Creates a UInt64Value message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UInt64Value - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.UInt64Value; - - /** - * Creates a plain object from a UInt64Value message. Also converts values to other types if specified. - * @param message UInt64Value - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.UInt64Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UInt64Value to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of an Int32Value. */ - interface IInt32Value { - - /** Int32Value value */ - value?: (number|null); - } - - /** Represents an Int32Value. */ - class Int32Value implements IInt32Value { - - /** - * Constructs a new Int32Value. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IInt32Value); - - /** Int32Value value. */ - public value: number; - - /** - * Creates an Int32Value message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Int32Value - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Int32Value; - - /** - * Creates a plain object from an Int32Value message. Also converts values to other types if specified. - * @param message Int32Value - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.Int32Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Int32Value to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a UInt32Value. */ - interface IUInt32Value { - - /** UInt32Value value */ - value?: (number|null); - } - - /** Represents a UInt32Value. */ - class UInt32Value implements IUInt32Value { - - /** - * Constructs a new UInt32Value. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IUInt32Value); - - /** UInt32Value value. */ - public value: number; - - /** - * Creates a UInt32Value message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UInt32Value - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.UInt32Value; - - /** - * Creates a plain object from a UInt32Value message. Also converts values to other types if specified. - * @param message UInt32Value - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.UInt32Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UInt32Value to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a BoolValue. */ - interface IBoolValue { - - /** BoolValue value */ - value?: (boolean|null); - } - - /** Represents a BoolValue. */ - class BoolValue implements IBoolValue { - - /** - * Constructs a new BoolValue. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IBoolValue); - - /** BoolValue value. */ - public value: boolean; - - /** - * Creates a BoolValue message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BoolValue - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.BoolValue; - - /** - * Creates a plain object from a BoolValue message. Also converts values to other types if specified. - * @param message BoolValue - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.BoolValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BoolValue to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a StringValue. */ - interface IStringValue { - - /** StringValue value */ - value?: (string|null); - } - - /** Represents a StringValue. */ - class StringValue implements IStringValue { - - /** - * Constructs a new StringValue. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IStringValue); - - /** StringValue value. */ - public value: string; - - /** - * Creates a StringValue message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns StringValue - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.StringValue; - - /** - * Creates a plain object from a StringValue message. Also converts values to other types if specified. - * @param message StringValue - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.StringValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this StringValue to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a BytesValue. */ - interface IBytesValue { - - /** BytesValue value */ - value?: (Uint8Array|null); - } - - /** Represents a BytesValue. */ - class BytesValue implements IBytesValue { - - /** - * Constructs a new BytesValue. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IBytesValue); - - /** BytesValue value. */ - public value: Uint8Array; - - /** - * Creates a BytesValue message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BytesValue - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.BytesValue; - - /** - * Creates a plain object from a BytesValue message. Also converts values to other types if specified. - * @param message BytesValue - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.BytesValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BytesValue to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of an Any. */ - interface IAny { - - /** Any type_url */ - type_url?: (string|null); - - /** Any value */ - value?: (Uint8Array|null); - } - - /** Represents an Any. */ - class Any implements IAny { - - /** - * Constructs a new Any. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IAny); - - /** Any type_url. */ - public type_url: string; - - /** Any value. */ - public value: Uint8Array; - - /** - * Creates an Any message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Any - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Any; - - /** - * Creates a plain object from an Any message. Also converts values to other types if specified. - * @param message Any - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.Any, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Any to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a FieldMask. */ - interface IFieldMask { - - /** FieldMask paths */ - paths?: (string[]|null); - } - - /** Represents a FieldMask. */ - class FieldMask implements IFieldMask { - - /** - * Constructs a new FieldMask. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFieldMask); - - /** FieldMask paths. */ - public paths: string[]; - - /** - * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FieldMask - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FieldMask; - - /** - * Creates a plain object from a FieldMask message. Also converts values to other types if specified. - * @param message FieldMask - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FieldMask, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FieldMask to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a Duration. */ - interface IDuration { - - /** Duration seconds */ - seconds?: (number|string|null); - - /** Duration nanos */ - nanos?: (number|null); - } - - /** Represents a Duration. */ - class Duration implements IDuration { - - /** - * Constructs a new Duration. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IDuration); - - /** Duration seconds. */ - public seconds: (number|string); - - /** Duration nanos. */ - public nanos: number; - - /** - * Creates a Duration message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Duration - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Duration; - - /** - * Creates a plain object from a Duration message. Also converts values to other types if specified. - * @param message Duration - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.Duration, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Duration to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } - - /** Namespace firestore. */ - namespace firestore { - - /** Namespace v1beta1. */ - namespace v1beta1 { - - /** Properties of a DocumentMask. */ - interface IDocumentMask { - - /** DocumentMask fieldPaths */ - fieldPaths?: (string[]|null); - } - - /** Represents a DocumentMask. */ - class DocumentMask implements IDocumentMask { - - /** - * Constructs a new DocumentMask. - * @param [properties] Properties to set - */ - constructor(properties?: google.firestore.v1beta1.IDocumentMask); - - /** DocumentMask fieldPaths. */ - public fieldPaths: string[]; - - /** - * Creates a DocumentMask message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DocumentMask - */ - public static fromObject(object: { [k: string]: any }): google.firestore.v1beta1.DocumentMask; - - /** - * Creates a plain object from a DocumentMask message. Also converts values to other types if specified. - * @param message DocumentMask - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.v1beta1.DocumentMask, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DocumentMask to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a Precondition. */ - interface IPrecondition { - - /** Precondition exists */ - exists?: (boolean|null); - - /** Precondition updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); - } - - /** Represents a Precondition. */ - class Precondition implements IPrecondition { - - /** - * Constructs a new Precondition. - * @param [properties] Properties to set - */ - constructor(properties?: google.firestore.v1beta1.IPrecondition); - - /** Precondition exists. */ - public exists?: (boolean|null); - - /** Precondition updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); - - /** Precondition conditionType. */ - public conditionType?: ("exists"|"updateTime"); - - /** - * Creates a Precondition message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Precondition - */ - public static fromObject(object: { [k: string]: any }): google.firestore.v1beta1.Precondition; - - /** - * Creates a plain object from a Precondition message. Also converts values to other types if specified. - * @param message Precondition - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.v1beta1.Precondition, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Precondition to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a TransactionOptions. */ - interface ITransactionOptions { - - /** TransactionOptions readOnly */ - readOnly?: (google.firestore.v1beta1.TransactionOptions.IReadOnly|null); - - /** TransactionOptions readWrite */ - readWrite?: (google.firestore.v1beta1.TransactionOptions.IReadWrite|null); - } - - /** Represents a TransactionOptions. */ - class TransactionOptions implements ITransactionOptions { - - /** - * Constructs a new TransactionOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.firestore.v1beta1.ITransactionOptions); - - /** TransactionOptions readOnly. */ - public readOnly?: (google.firestore.v1beta1.TransactionOptions.IReadOnly|null); - - /** TransactionOptions readWrite. */ - public readWrite?: (google.firestore.v1beta1.TransactionOptions.IReadWrite|null); - - /** TransactionOptions mode. */ - public mode?: ("readOnly"|"readWrite"); - - /** - * Creates a TransactionOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TransactionOptions - */ - public static fromObject(object: { [k: string]: any }): google.firestore.v1beta1.TransactionOptions; - - /** - * Creates a plain object from a TransactionOptions message. Also converts values to other types if specified. - * @param message TransactionOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.v1beta1.TransactionOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TransactionOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - namespace TransactionOptions { - - /** Properties of a ReadWrite. */ - interface IReadWrite { - - /** ReadWrite retryTransaction */ - retryTransaction?: (Uint8Array|null); - } - - /** Represents a ReadWrite. */ - class ReadWrite implements IReadWrite { - - /** - * Constructs a new ReadWrite. - * @param [properties] Properties to set - */ - constructor(properties?: google.firestore.v1beta1.TransactionOptions.IReadWrite); - - /** ReadWrite retryTransaction. */ - public retryTransaction: Uint8Array; - - /** - * Creates a ReadWrite message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ReadWrite - */ - public static fromObject(object: { [k: string]: any }): google.firestore.v1beta1.TransactionOptions.ReadWrite; - - /** - * Creates a plain object from a ReadWrite message. Also converts values to other types if specified. - * @param message ReadWrite - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.v1beta1.TransactionOptions.ReadWrite, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ReadWrite to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a ReadOnly. */ - interface IReadOnly { - - /** ReadOnly readTime */ - readTime?: (google.protobuf.ITimestamp|null); - } - - /** Represents a ReadOnly. */ - class ReadOnly implements IReadOnly { - - /** - * Constructs a new ReadOnly. - * @param [properties] Properties to set - */ - constructor(properties?: google.firestore.v1beta1.TransactionOptions.IReadOnly); - - /** ReadOnly readTime. */ - public readTime?: (google.protobuf.ITimestamp|null); - - /** ReadOnly consistencySelector. */ - public consistencySelector?: "readTime"; - - /** - * Creates a ReadOnly message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ReadOnly - */ - public static fromObject(object: { [k: string]: any }): google.firestore.v1beta1.TransactionOptions.ReadOnly; - - /** - * Creates a plain object from a ReadOnly message. Also converts values to other types if specified. - * @param message ReadOnly - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.v1beta1.TransactionOptions.ReadOnly, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ReadOnly to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } - - /** Properties of a Document. */ - interface IDocument { - - /** Document name */ - name?: (string|null); - - /** Document fields */ - fields?: ({ [k: string]: google.firestore.v1beta1.IValue }|null); - - /** Document createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** Document updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); - } - - /** Represents a Document. */ - class Document implements IDocument { - - /** - * Constructs a new Document. - * @param [properties] Properties to set - */ - constructor(properties?: google.firestore.v1beta1.IDocument); - - /** Document name. */ - public name: string; - - /** Document fields. */ - public fields: { [k: string]: google.firestore.v1beta1.IValue }; - - /** Document createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** Document updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); - - /** - * Creates a Document message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Document - */ - public static fromObject(object: { [k: string]: any }): google.firestore.v1beta1.Document; - - /** - * Creates a plain object from a Document message. Also converts values to other types if specified. - * @param message Document - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.v1beta1.Document, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Document to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a Value. */ - interface IValue { - - /** Value nullValue */ - nullValue?: (google.protobuf.NullValue|null); - - /** Value booleanValue */ - booleanValue?: (boolean|null); - - /** Value integerValue */ - integerValue?: (number|string|null); - - /** Value doubleValue */ - doubleValue?: (number|null); - - /** Value timestampValue */ - timestampValue?: (google.protobuf.ITimestamp|null); - - /** Value stringValue */ - stringValue?: (string|null); - - /** Value bytesValue */ - bytesValue?: (Uint8Array|null); - - /** Value referenceValue */ - referenceValue?: (string|null); - - /** Value geoPointValue */ - geoPointValue?: (google.type.ILatLng|null); - - /** Value arrayValue */ - arrayValue?: (google.firestore.v1beta1.IArrayValue|null); - - /** Value mapValue */ - mapValue?: (google.firestore.v1beta1.IMapValue|null); - } - - /** Represents a Value. */ - class Value implements IValue { - - /** - * Constructs a new Value. - * @param [properties] Properties to set - */ - constructor(properties?: google.firestore.v1beta1.IValue); - - /** Value nullValue. */ - public nullValue?: (google.protobuf.NullValue|null); - - /** Value booleanValue. */ - public booleanValue?: (boolean|null); - - /** Value integerValue. */ - public integerValue?: (number|string|null); - - /** Value doubleValue. */ - public doubleValue?: (number|null); - - /** Value timestampValue. */ - public timestampValue?: (google.protobuf.ITimestamp|null); - - /** Value stringValue. */ - public stringValue?: (string|null); - - /** Value bytesValue. */ - public bytesValue?: (Uint8Array|null); - - /** Value referenceValue. */ - public referenceValue?: (string|null); - - /** Value geoPointValue. */ - public geoPointValue?: (google.type.ILatLng|null); - - /** Value arrayValue. */ - public arrayValue?: (google.firestore.v1beta1.IArrayValue|null); - - /** Value mapValue. */ - public mapValue?: (google.firestore.v1beta1.IMapValue|null); - - /** Value valueType. */ - public valueType?: ("nullValue"|"booleanValue"|"integerValue"|"doubleValue"|"timestampValue"|"stringValue"|"bytesValue"|"referenceValue"|"geoPointValue"|"arrayValue"|"mapValue"); - - /** - * Creates a Value message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Value - */ - public static fromObject(object: { [k: string]: any }): google.firestore.v1beta1.Value; - - /** - * Creates a plain object from a Value message. Also converts values to other types if specified. - * @param message Value - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.v1beta1.Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Value to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of an ArrayValue. */ - interface IArrayValue { - - /** ArrayValue values */ - values?: (google.firestore.v1beta1.IValue[]|null); - } - - /** Represents an ArrayValue. */ - class ArrayValue implements IArrayValue { - - /** - * Constructs a new ArrayValue. - * @param [properties] Properties to set - */ - constructor(properties?: google.firestore.v1beta1.IArrayValue); - - /** ArrayValue values. */ - public values: google.firestore.v1beta1.IValue[]; - - /** - * Creates an ArrayValue message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ArrayValue - */ - public static fromObject(object: { [k: string]: any }): google.firestore.v1beta1.ArrayValue; - - /** - * Creates a plain object from an ArrayValue message. Also converts values to other types if specified. - * @param message ArrayValue - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.v1beta1.ArrayValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ArrayValue to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a MapValue. */ - interface IMapValue { - - /** MapValue fields */ - fields?: ({ [k: string]: google.firestore.v1beta1.IValue }|null); - } - - /** Represents a MapValue. */ - class MapValue implements IMapValue { - - /** - * Constructs a new MapValue. - * @param [properties] Properties to set - */ - constructor(properties?: google.firestore.v1beta1.IMapValue); - - /** MapValue fields. */ - public fields: { [k: string]: google.firestore.v1beta1.IValue }; - - /** - * Creates a MapValue message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MapValue - */ - public static fromObject(object: { [k: string]: any }): google.firestore.v1beta1.MapValue; - - /** - * Creates a plain object from a MapValue message. Also converts values to other types if specified. - * @param message MapValue - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.v1beta1.MapValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MapValue to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Represents a Firestore */ - class Firestore extends $protobuf.rpc.Service { - - /** - * Constructs a new Firestore service. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - */ - constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); - - /** - * Calls GetDocument. - * @param request GetDocumentRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Document - */ - public getDocument(request: google.firestore.v1beta1.IGetDocumentRequest, callback: google.firestore.v1beta1.Firestore.GetDocumentCallback): void; - - /** - * Calls GetDocument. - * @param request GetDocumentRequest message or plain object - * @returns Promise - */ - public getDocument(request: google.firestore.v1beta1.IGetDocumentRequest): Promise; - - /** - * Calls ListDocuments. - * @param request ListDocumentsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListDocumentsResponse - */ - public listDocuments(request: google.firestore.v1beta1.IListDocumentsRequest, callback: google.firestore.v1beta1.Firestore.ListDocumentsCallback): void; - - /** - * Calls ListDocuments. - * @param request ListDocumentsRequest message or plain object - * @returns Promise - */ - public listDocuments(request: google.firestore.v1beta1.IListDocumentsRequest): Promise; - - /** - * Calls UpdateDocument. - * @param request UpdateDocumentRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Document - */ - public updateDocument(request: google.firestore.v1beta1.IUpdateDocumentRequest, callback: google.firestore.v1beta1.Firestore.UpdateDocumentCallback): void; - - /** - * Calls UpdateDocument. - * @param request UpdateDocumentRequest message or plain object - * @returns Promise - */ - public updateDocument(request: google.firestore.v1beta1.IUpdateDocumentRequest): Promise; - - /** - * Calls DeleteDocument. - * @param request DeleteDocumentRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty - */ - public deleteDocument(request: google.firestore.v1beta1.IDeleteDocumentRequest, callback: google.firestore.v1beta1.Firestore.DeleteDocumentCallback): void; - - /** - * Calls DeleteDocument. - * @param request DeleteDocumentRequest message or plain object - * @returns Promise - */ - public deleteDocument(request: google.firestore.v1beta1.IDeleteDocumentRequest): Promise; - - /** - * Calls BatchGetDocuments. - * @param request BatchGetDocumentsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and BatchGetDocumentsResponse - */ - public batchGetDocuments(request: google.firestore.v1beta1.IBatchGetDocumentsRequest, callback: google.firestore.v1beta1.Firestore.BatchGetDocumentsCallback): void; - - /** - * Calls BatchGetDocuments. - * @param request BatchGetDocumentsRequest message or plain object - * @returns Promise - */ - public batchGetDocuments(request: google.firestore.v1beta1.IBatchGetDocumentsRequest): Promise; - - /** - * Calls BeginTransaction. - * @param request BeginTransactionRequest message or plain object - * @param callback Node-style callback called with the error, if any, and BeginTransactionResponse - */ - public beginTransaction(request: google.firestore.v1beta1.IBeginTransactionRequest, callback: google.firestore.v1beta1.Firestore.BeginTransactionCallback): void; - - /** - * Calls BeginTransaction. - * @param request BeginTransactionRequest message or plain object - * @returns Promise - */ - public beginTransaction(request: google.firestore.v1beta1.IBeginTransactionRequest): Promise; - - /** - * Calls Commit. - * @param request CommitRequest message or plain object - * @param callback Node-style callback called with the error, if any, and CommitResponse - */ - public commit(request: google.firestore.v1beta1.ICommitRequest, callback: google.firestore.v1beta1.Firestore.CommitCallback): void; - - /** - * Calls Commit. - * @param request CommitRequest message or plain object - * @returns Promise - */ - public commit(request: google.firestore.v1beta1.ICommitRequest): Promise; - - /** - * Calls Rollback. - * @param request RollbackRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty - */ - public rollback(request: google.firestore.v1beta1.IRollbackRequest, callback: google.firestore.v1beta1.Firestore.RollbackCallback): void; - - /** - * Calls Rollback. - * @param request RollbackRequest message or plain object - * @returns Promise - */ - public rollback(request: google.firestore.v1beta1.IRollbackRequest): Promise; - - /** - * Calls RunQuery. - * @param request RunQueryRequest message or plain object - * @param callback Node-style callback called with the error, if any, and RunQueryResponse - */ - public runQuery(request: google.firestore.v1beta1.IRunQueryRequest, callback: google.firestore.v1beta1.Firestore.RunQueryCallback): void; - - /** - * Calls RunQuery. - * @param request RunQueryRequest message or plain object - * @returns Promise - */ - public runQuery(request: google.firestore.v1beta1.IRunQueryRequest): Promise; - - /** - * Calls PartitionQuery. - * @param request PartitionQueryRequest message or plain object - * @param callback Node-style callback called with the error, if any, and PartitionQueryResponse - */ - public partitionQuery(request: google.firestore.v1beta1.IPartitionQueryRequest, callback: google.firestore.v1beta1.Firestore.PartitionQueryCallback): void; - - /** - * Calls PartitionQuery. - * @param request PartitionQueryRequest message or plain object - * @returns Promise - */ - public partitionQuery(request: google.firestore.v1beta1.IPartitionQueryRequest): Promise; - - /** - * Calls Write. - * @param request WriteRequest message or plain object - * @param callback Node-style callback called with the error, if any, and WriteResponse - */ - public write(request: google.firestore.v1beta1.IWriteRequest, callback: google.firestore.v1beta1.Firestore.WriteCallback): void; - - /** - * Calls Write. - * @param request WriteRequest message or plain object - * @returns Promise - */ - public write(request: google.firestore.v1beta1.IWriteRequest): Promise; - - /** - * Calls Listen. - * @param request ListenRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListenResponse - */ - public listen(request: google.firestore.v1beta1.IListenRequest, callback: google.firestore.v1beta1.Firestore.ListenCallback): void; - - /** - * Calls Listen. - * @param request ListenRequest message or plain object - * @returns Promise - */ - public listen(request: google.firestore.v1beta1.IListenRequest): Promise; - - /** - * Calls ListCollectionIds. - * @param request ListCollectionIdsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListCollectionIdsResponse - */ - public listCollectionIds(request: google.firestore.v1beta1.IListCollectionIdsRequest, callback: google.firestore.v1beta1.Firestore.ListCollectionIdsCallback): void; - - /** - * Calls ListCollectionIds. - * @param request ListCollectionIdsRequest message or plain object - * @returns Promise - */ - public listCollectionIds(request: google.firestore.v1beta1.IListCollectionIdsRequest): Promise; - - /** - * Calls BatchWrite. - * @param request BatchWriteRequest message or plain object - * @param callback Node-style callback called with the error, if any, and BatchWriteResponse - */ - public batchWrite(request: google.firestore.v1beta1.IBatchWriteRequest, callback: google.firestore.v1beta1.Firestore.BatchWriteCallback): void; - - /** - * Calls BatchWrite. - * @param request BatchWriteRequest message or plain object - * @returns Promise - */ - public batchWrite(request: google.firestore.v1beta1.IBatchWriteRequest): Promise; - - /** - * Calls CreateDocument. - * @param request CreateDocumentRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Document - */ - public createDocument(request: google.firestore.v1beta1.ICreateDocumentRequest, callback: google.firestore.v1beta1.Firestore.CreateDocumentCallback): void; - - /** - * Calls CreateDocument. - * @param request CreateDocumentRequest message or plain object - * @returns Promise - */ - public createDocument(request: google.firestore.v1beta1.ICreateDocumentRequest): Promise; - } - - namespace Firestore { - - /** - * Callback as used by {@link google.firestore.v1beta1.Firestore#getDocument}. - * @param error Error, if any - * @param [response] Document - */ - type GetDocumentCallback = (error: (Error|null), response?: google.firestore.v1beta1.Document) => void; - - /** - * Callback as used by {@link google.firestore.v1beta1.Firestore#listDocuments}. - * @param error Error, if any - * @param [response] ListDocumentsResponse - */ - type ListDocumentsCallback = (error: (Error|null), response?: google.firestore.v1beta1.ListDocumentsResponse) => void; - - /** - * Callback as used by {@link google.firestore.v1beta1.Firestore#updateDocument}. - * @param error Error, if any - * @param [response] Document - */ - type UpdateDocumentCallback = (error: (Error|null), response?: google.firestore.v1beta1.Document) => void; - - /** - * Callback as used by {@link google.firestore.v1beta1.Firestore#deleteDocument}. - * @param error Error, if any - * @param [response] Empty - */ - type DeleteDocumentCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - - /** - * Callback as used by {@link google.firestore.v1beta1.Firestore#batchGetDocuments}. - * @param error Error, if any - * @param [response] BatchGetDocumentsResponse - */ - type BatchGetDocumentsCallback = (error: (Error|null), response?: google.firestore.v1beta1.BatchGetDocumentsResponse) => void; - - /** - * Callback as used by {@link google.firestore.v1beta1.Firestore#beginTransaction}. - * @param error Error, if any - * @param [response] BeginTransactionResponse - */ - type BeginTransactionCallback = (error: (Error|null), response?: google.firestore.v1beta1.BeginTransactionResponse) => void; - - /** - * Callback as used by {@link google.firestore.v1beta1.Firestore#commit}. - * @param error Error, if any - * @param [response] CommitResponse - */ - type CommitCallback = (error: (Error|null), response?: google.firestore.v1beta1.CommitResponse) => void; - - /** - * Callback as used by {@link google.firestore.v1beta1.Firestore#rollback}. - * @param error Error, if any - * @param [response] Empty - */ - type RollbackCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - - /** - * Callback as used by {@link google.firestore.v1beta1.Firestore#runQuery}. - * @param error Error, if any - * @param [response] RunQueryResponse - */ - type RunQueryCallback = (error: (Error|null), response?: google.firestore.v1beta1.RunQueryResponse) => void; - - /** - * Callback as used by {@link google.firestore.v1beta1.Firestore#partitionQuery}. - * @param error Error, if any - * @param [response] PartitionQueryResponse - */ - type PartitionQueryCallback = (error: (Error|null), response?: google.firestore.v1beta1.PartitionQueryResponse) => void; - - /** - * Callback as used by {@link google.firestore.v1beta1.Firestore#write}. - * @param error Error, if any - * @param [response] WriteResponse - */ - type WriteCallback = (error: (Error|null), response?: google.firestore.v1beta1.WriteResponse) => void; - - /** - * Callback as used by {@link google.firestore.v1beta1.Firestore#listen}. - * @param error Error, if any - * @param [response] ListenResponse - */ - type ListenCallback = (error: (Error|null), response?: google.firestore.v1beta1.ListenResponse) => void; - - /** - * Callback as used by {@link google.firestore.v1beta1.Firestore#listCollectionIds}. - * @param error Error, if any - * @param [response] ListCollectionIdsResponse - */ - type ListCollectionIdsCallback = (error: (Error|null), response?: google.firestore.v1beta1.ListCollectionIdsResponse) => void; - - /** - * Callback as used by {@link google.firestore.v1beta1.Firestore#batchWrite}. - * @param error Error, if any - * @param [response] BatchWriteResponse - */ - type BatchWriteCallback = (error: (Error|null), response?: google.firestore.v1beta1.BatchWriteResponse) => void; - - /** - * Callback as used by {@link google.firestore.v1beta1.Firestore#createDocument}. - * @param error Error, if any - * @param [response] Document - */ - type CreateDocumentCallback = (error: (Error|null), response?: google.firestore.v1beta1.Document) => void; - } - - /** Properties of a GetDocumentRequest. */ - interface IGetDocumentRequest { - - /** GetDocumentRequest name */ - name?: (string|null); - - /** GetDocumentRequest mask */ - mask?: (google.firestore.v1beta1.IDocumentMask|null); - - /** GetDocumentRequest transaction */ - transaction?: (Uint8Array|null); - - /** GetDocumentRequest readTime */ - readTime?: (google.protobuf.ITimestamp|null); - } - - /** Represents a GetDocumentRequest. */ - class GetDocumentRequest implements IGetDocumentRequest { - - /** - * Constructs a new GetDocumentRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.firestore.v1beta1.IGetDocumentRequest); - - /** GetDocumentRequest name. */ - public name: string; - - /** GetDocumentRequest mask. */ - public mask?: (google.firestore.v1beta1.IDocumentMask|null); - - /** GetDocumentRequest transaction. */ - public transaction?: (Uint8Array|null); - - /** GetDocumentRequest readTime. */ - public readTime?: (google.protobuf.ITimestamp|null); - - /** GetDocumentRequest consistencySelector. */ - public consistencySelector?: ("transaction"|"readTime"); - - /** - * Creates a GetDocumentRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetDocumentRequest - */ - public static fromObject(object: { [k: string]: any }): google.firestore.v1beta1.GetDocumentRequest; - - /** - * Creates a plain object from a GetDocumentRequest message. Also converts values to other types if specified. - * @param message GetDocumentRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.v1beta1.GetDocumentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetDocumentRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a ListDocumentsRequest. */ - interface IListDocumentsRequest { - - /** ListDocumentsRequest parent */ - parent?: (string|null); - - /** ListDocumentsRequest collectionId */ - collectionId?: (string|null); - - /** ListDocumentsRequest pageSize */ - pageSize?: (number|null); - - /** ListDocumentsRequest pageToken */ - pageToken?: (string|null); - - /** ListDocumentsRequest orderBy */ - orderBy?: (string|null); - - /** ListDocumentsRequest mask */ - mask?: (google.firestore.v1beta1.IDocumentMask|null); - - /** ListDocumentsRequest transaction */ - transaction?: (Uint8Array|null); - - /** ListDocumentsRequest readTime */ - readTime?: (google.protobuf.ITimestamp|null); - - /** ListDocumentsRequest showMissing */ - showMissing?: (boolean|null); - } - - /** Represents a ListDocumentsRequest. */ - class ListDocumentsRequest implements IListDocumentsRequest { - - /** - * Constructs a new ListDocumentsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.firestore.v1beta1.IListDocumentsRequest); - - /** ListDocumentsRequest parent. */ - public parent: string; - - /** ListDocumentsRequest collectionId. */ - public collectionId: string; - - /** ListDocumentsRequest pageSize. */ - public pageSize: number; - - /** ListDocumentsRequest pageToken. */ - public pageToken: string; - - /** ListDocumentsRequest orderBy. */ - public orderBy: string; - - /** ListDocumentsRequest mask. */ - public mask?: (google.firestore.v1beta1.IDocumentMask|null); - - /** ListDocumentsRequest transaction. */ - public transaction?: (Uint8Array|null); - - /** ListDocumentsRequest readTime. */ - public readTime?: (google.protobuf.ITimestamp|null); - - /** ListDocumentsRequest showMissing. */ - public showMissing: boolean; - - /** ListDocumentsRequest consistencySelector. */ - public consistencySelector?: ("transaction"|"readTime"); - - /** - * Creates a ListDocumentsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListDocumentsRequest - */ - public static fromObject(object: { [k: string]: any }): google.firestore.v1beta1.ListDocumentsRequest; - - /** - * Creates a plain object from a ListDocumentsRequest message. Also converts values to other types if specified. - * @param message ListDocumentsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.v1beta1.ListDocumentsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListDocumentsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a ListDocumentsResponse. */ - interface IListDocumentsResponse { - - /** ListDocumentsResponse documents */ - documents?: (google.firestore.v1beta1.IDocument[]|null); - - /** ListDocumentsResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListDocumentsResponse. */ - class ListDocumentsResponse implements IListDocumentsResponse { - - /** - * Constructs a new ListDocumentsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.firestore.v1beta1.IListDocumentsResponse); - - /** ListDocumentsResponse documents. */ - public documents: google.firestore.v1beta1.IDocument[]; - - /** ListDocumentsResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a ListDocumentsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListDocumentsResponse - */ - public static fromObject(object: { [k: string]: any }): google.firestore.v1beta1.ListDocumentsResponse; - - /** - * Creates a plain object from a ListDocumentsResponse message. Also converts values to other types if specified. - * @param message ListDocumentsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.v1beta1.ListDocumentsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListDocumentsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a CreateDocumentRequest. */ - interface ICreateDocumentRequest { - - /** CreateDocumentRequest parent */ - parent?: (string|null); - - /** CreateDocumentRequest collectionId */ - collectionId?: (string|null); - - /** CreateDocumentRequest documentId */ - documentId?: (string|null); - - /** CreateDocumentRequest document */ - document?: (google.firestore.v1beta1.IDocument|null); - - /** CreateDocumentRequest mask */ - mask?: (google.firestore.v1beta1.IDocumentMask|null); - } - - /** Represents a CreateDocumentRequest. */ - class CreateDocumentRequest implements ICreateDocumentRequest { - - /** - * Constructs a new CreateDocumentRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.firestore.v1beta1.ICreateDocumentRequest); - - /** CreateDocumentRequest parent. */ - public parent: string; - - /** CreateDocumentRequest collectionId. */ - public collectionId: string; - - /** CreateDocumentRequest documentId. */ - public documentId: string; - - /** CreateDocumentRequest document. */ - public document?: (google.firestore.v1beta1.IDocument|null); - - /** CreateDocumentRequest mask. */ - public mask?: (google.firestore.v1beta1.IDocumentMask|null); - - /** - * Creates a CreateDocumentRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateDocumentRequest - */ - public static fromObject(object: { [k: string]: any }): google.firestore.v1beta1.CreateDocumentRequest; - - /** - * Creates a plain object from a CreateDocumentRequest message. Also converts values to other types if specified. - * @param message CreateDocumentRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.v1beta1.CreateDocumentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateDocumentRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of an UpdateDocumentRequest. */ - interface IUpdateDocumentRequest { - - /** UpdateDocumentRequest document */ - document?: (google.firestore.v1beta1.IDocument|null); - - /** UpdateDocumentRequest updateMask */ - updateMask?: (google.firestore.v1beta1.IDocumentMask|null); - - /** UpdateDocumentRequest mask */ - mask?: (google.firestore.v1beta1.IDocumentMask|null); - - /** UpdateDocumentRequest currentDocument */ - currentDocument?: (google.firestore.v1beta1.IPrecondition|null); - } - - /** Represents an UpdateDocumentRequest. */ - class UpdateDocumentRequest implements IUpdateDocumentRequest { - - /** - * Constructs a new UpdateDocumentRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.firestore.v1beta1.IUpdateDocumentRequest); - - /** UpdateDocumentRequest document. */ - public document?: (google.firestore.v1beta1.IDocument|null); - - /** UpdateDocumentRequest updateMask. */ - public updateMask?: (google.firestore.v1beta1.IDocumentMask|null); - - /** UpdateDocumentRequest mask. */ - public mask?: (google.firestore.v1beta1.IDocumentMask|null); - - /** UpdateDocumentRequest currentDocument. */ - public currentDocument?: (google.firestore.v1beta1.IPrecondition|null); - - /** - * Creates an UpdateDocumentRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateDocumentRequest - */ - public static fromObject(object: { [k: string]: any }): google.firestore.v1beta1.UpdateDocumentRequest; - - /** - * Creates a plain object from an UpdateDocumentRequest message. Also converts values to other types if specified. - * @param message UpdateDocumentRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.v1beta1.UpdateDocumentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateDocumentRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a DeleteDocumentRequest. */ - interface IDeleteDocumentRequest { - - /** DeleteDocumentRequest name */ - name?: (string|null); - - /** DeleteDocumentRequest currentDocument */ - currentDocument?: (google.firestore.v1beta1.IPrecondition|null); - } - - /** Represents a DeleteDocumentRequest. */ - class DeleteDocumentRequest implements IDeleteDocumentRequest { - - /** - * Constructs a new DeleteDocumentRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.firestore.v1beta1.IDeleteDocumentRequest); - - /** DeleteDocumentRequest name. */ - public name: string; - - /** DeleteDocumentRequest currentDocument. */ - public currentDocument?: (google.firestore.v1beta1.IPrecondition|null); - - /** - * Creates a DeleteDocumentRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteDocumentRequest - */ - public static fromObject(object: { [k: string]: any }): google.firestore.v1beta1.DeleteDocumentRequest; - - /** - * Creates a plain object from a DeleteDocumentRequest message. Also converts values to other types if specified. - * @param message DeleteDocumentRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.v1beta1.DeleteDocumentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteDocumentRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a BatchGetDocumentsRequest. */ - interface IBatchGetDocumentsRequest { - - /** BatchGetDocumentsRequest database */ - database?: (string|null); - - /** BatchGetDocumentsRequest documents */ - documents?: (string[]|null); - - /** BatchGetDocumentsRequest mask */ - mask?: (google.firestore.v1beta1.IDocumentMask|null); - - /** BatchGetDocumentsRequest transaction */ - transaction?: (Uint8Array|null); - - /** BatchGetDocumentsRequest newTransaction */ - newTransaction?: (google.firestore.v1beta1.ITransactionOptions|null); - - /** BatchGetDocumentsRequest readTime */ - readTime?: (google.protobuf.ITimestamp|null); - } - - /** Represents a BatchGetDocumentsRequest. */ - class BatchGetDocumentsRequest implements IBatchGetDocumentsRequest { - - /** - * Constructs a new BatchGetDocumentsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.firestore.v1beta1.IBatchGetDocumentsRequest); - - /** BatchGetDocumentsRequest database. */ - public database: string; - - /** BatchGetDocumentsRequest documents. */ - public documents: string[]; - - /** BatchGetDocumentsRequest mask. */ - public mask?: (google.firestore.v1beta1.IDocumentMask|null); - - /** BatchGetDocumentsRequest transaction. */ - public transaction?: (Uint8Array|null); - - /** BatchGetDocumentsRequest newTransaction. */ - public newTransaction?: (google.firestore.v1beta1.ITransactionOptions|null); - - /** BatchGetDocumentsRequest readTime. */ - public readTime?: (google.protobuf.ITimestamp|null); - - /** BatchGetDocumentsRequest consistencySelector. */ - public consistencySelector?: ("transaction"|"newTransaction"|"readTime"); - - /** - * Creates a BatchGetDocumentsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BatchGetDocumentsRequest - */ - public static fromObject(object: { [k: string]: any }): google.firestore.v1beta1.BatchGetDocumentsRequest; - - /** - * Creates a plain object from a BatchGetDocumentsRequest message. Also converts values to other types if specified. - * @param message BatchGetDocumentsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.v1beta1.BatchGetDocumentsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BatchGetDocumentsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a BatchGetDocumentsResponse. */ - interface IBatchGetDocumentsResponse { - - /** BatchGetDocumentsResponse found */ - found?: (google.firestore.v1beta1.IDocument|null); - - /** BatchGetDocumentsResponse missing */ - missing?: (string|null); - - /** BatchGetDocumentsResponse transaction */ - transaction?: (Uint8Array|null); - - /** BatchGetDocumentsResponse readTime */ - readTime?: (google.protobuf.ITimestamp|null); - } - - /** Represents a BatchGetDocumentsResponse. */ - class BatchGetDocumentsResponse implements IBatchGetDocumentsResponse { - - /** - * Constructs a new BatchGetDocumentsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.firestore.v1beta1.IBatchGetDocumentsResponse); - - /** BatchGetDocumentsResponse found. */ - public found?: (google.firestore.v1beta1.IDocument|null); - - /** BatchGetDocumentsResponse missing. */ - public missing?: (string|null); - - /** BatchGetDocumentsResponse transaction. */ - public transaction: Uint8Array; - - /** BatchGetDocumentsResponse readTime. */ - public readTime?: (google.protobuf.ITimestamp|null); - - /** BatchGetDocumentsResponse result. */ - public result?: ("found"|"missing"); - - /** - * Creates a BatchGetDocumentsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BatchGetDocumentsResponse - */ - public static fromObject(object: { [k: string]: any }): google.firestore.v1beta1.BatchGetDocumentsResponse; - - /** - * Creates a plain object from a BatchGetDocumentsResponse message. Also converts values to other types if specified. - * @param message BatchGetDocumentsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.v1beta1.BatchGetDocumentsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BatchGetDocumentsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a BeginTransactionRequest. */ - interface IBeginTransactionRequest { - - /** BeginTransactionRequest database */ - database?: (string|null); - - /** BeginTransactionRequest options */ - options?: (google.firestore.v1beta1.ITransactionOptions|null); - } - - /** Represents a BeginTransactionRequest. */ - class BeginTransactionRequest implements IBeginTransactionRequest { - - /** - * Constructs a new BeginTransactionRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.firestore.v1beta1.IBeginTransactionRequest); - - /** BeginTransactionRequest database. */ - public database: string; - - /** BeginTransactionRequest options. */ - public options?: (google.firestore.v1beta1.ITransactionOptions|null); - - /** - * Creates a BeginTransactionRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BeginTransactionRequest - */ - public static fromObject(object: { [k: string]: any }): google.firestore.v1beta1.BeginTransactionRequest; - - /** - * Creates a plain object from a BeginTransactionRequest message. Also converts values to other types if specified. - * @param message BeginTransactionRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.v1beta1.BeginTransactionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BeginTransactionRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a BeginTransactionResponse. */ - interface IBeginTransactionResponse { - - /** BeginTransactionResponse transaction */ - transaction?: (Uint8Array|null); - } - - /** Represents a BeginTransactionResponse. */ - class BeginTransactionResponse implements IBeginTransactionResponse { - - /** - * Constructs a new BeginTransactionResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.firestore.v1beta1.IBeginTransactionResponse); - - /** BeginTransactionResponse transaction. */ - public transaction: Uint8Array; - - /** - * Creates a BeginTransactionResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BeginTransactionResponse - */ - public static fromObject(object: { [k: string]: any }): google.firestore.v1beta1.BeginTransactionResponse; - - /** - * Creates a plain object from a BeginTransactionResponse message. Also converts values to other types if specified. - * @param message BeginTransactionResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.v1beta1.BeginTransactionResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BeginTransactionResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a CommitRequest. */ - interface ICommitRequest { - - /** CommitRequest database */ - database?: (string|null); - - /** CommitRequest writes */ - writes?: (google.firestore.v1beta1.IWrite[]|null); - - /** CommitRequest transaction */ - transaction?: (Uint8Array|null); - } - - /** Represents a CommitRequest. */ - class CommitRequest implements ICommitRequest { - - /** - * Constructs a new CommitRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.firestore.v1beta1.ICommitRequest); - - /** CommitRequest database. */ - public database: string; - - /** CommitRequest writes. */ - public writes: google.firestore.v1beta1.IWrite[]; - - /** CommitRequest transaction. */ - public transaction: Uint8Array; - - /** - * Creates a CommitRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CommitRequest - */ - public static fromObject(object: { [k: string]: any }): google.firestore.v1beta1.CommitRequest; - - /** - * Creates a plain object from a CommitRequest message. Also converts values to other types if specified. - * @param message CommitRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.v1beta1.CommitRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CommitRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a CommitResponse. */ - interface ICommitResponse { - - /** CommitResponse writeResults */ - writeResults?: (google.firestore.v1beta1.IWriteResult[]|null); - - /** CommitResponse commitTime */ - commitTime?: (google.protobuf.ITimestamp|null); - } - - /** Represents a CommitResponse. */ - class CommitResponse implements ICommitResponse { - - /** - * Constructs a new CommitResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.firestore.v1beta1.ICommitResponse); - - /** CommitResponse writeResults. */ - public writeResults: google.firestore.v1beta1.IWriteResult[]; - - /** CommitResponse commitTime. */ - public commitTime?: (google.protobuf.ITimestamp|null); - - /** - * Creates a CommitResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CommitResponse - */ - public static fromObject(object: { [k: string]: any }): google.firestore.v1beta1.CommitResponse; - - /** - * Creates a plain object from a CommitResponse message. Also converts values to other types if specified. - * @param message CommitResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.v1beta1.CommitResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CommitResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a RollbackRequest. */ - interface IRollbackRequest { - - /** RollbackRequest database */ - database?: (string|null); - - /** RollbackRequest transaction */ - transaction?: (Uint8Array|null); - } - - /** Represents a RollbackRequest. */ - class RollbackRequest implements IRollbackRequest { - - /** - * Constructs a new RollbackRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.firestore.v1beta1.IRollbackRequest); - - /** RollbackRequest database. */ - public database: string; - - /** RollbackRequest transaction. */ - public transaction: Uint8Array; - - /** - * Creates a RollbackRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RollbackRequest - */ - public static fromObject(object: { [k: string]: any }): google.firestore.v1beta1.RollbackRequest; - - /** - * Creates a plain object from a RollbackRequest message. Also converts values to other types if specified. - * @param message RollbackRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.v1beta1.RollbackRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RollbackRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a RunQueryRequest. */ - interface IRunQueryRequest { - - /** RunQueryRequest parent */ - parent?: (string|null); - - /** RunQueryRequest structuredQuery */ - structuredQuery?: (google.firestore.v1beta1.IStructuredQuery|null); - - /** RunQueryRequest transaction */ - transaction?: (Uint8Array|null); - - /** RunQueryRequest newTransaction */ - newTransaction?: (google.firestore.v1beta1.ITransactionOptions|null); - - /** RunQueryRequest readTime */ - readTime?: (google.protobuf.ITimestamp|null); - } - - /** Represents a RunQueryRequest. */ - class RunQueryRequest implements IRunQueryRequest { - - /** - * Constructs a new RunQueryRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.firestore.v1beta1.IRunQueryRequest); - - /** RunQueryRequest parent. */ - public parent: string; - - /** RunQueryRequest structuredQuery. */ - public structuredQuery?: (google.firestore.v1beta1.IStructuredQuery|null); - - /** RunQueryRequest transaction. */ - public transaction?: (Uint8Array|null); - - /** RunQueryRequest newTransaction. */ - public newTransaction?: (google.firestore.v1beta1.ITransactionOptions|null); - - /** RunQueryRequest readTime. */ - public readTime?: (google.protobuf.ITimestamp|null); - - /** RunQueryRequest queryType. */ - public queryType?: "structuredQuery"; - - /** RunQueryRequest consistencySelector. */ - public consistencySelector?: ("transaction"|"newTransaction"|"readTime"); - - /** - * Creates a RunQueryRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RunQueryRequest - */ - public static fromObject(object: { [k: string]: any }): google.firestore.v1beta1.RunQueryRequest; - - /** - * Creates a plain object from a RunQueryRequest message. Also converts values to other types if specified. - * @param message RunQueryRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.v1beta1.RunQueryRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RunQueryRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a RunQueryResponse. */ - interface IRunQueryResponse { - - /** RunQueryResponse transaction */ - transaction?: (Uint8Array|null); - - /** RunQueryResponse document */ - document?: (google.firestore.v1beta1.IDocument|null); - - /** RunQueryResponse readTime */ - readTime?: (google.protobuf.ITimestamp|null); - - /** RunQueryResponse skippedResults */ - skippedResults?: (number|null); - } - - /** Represents a RunQueryResponse. */ - class RunQueryResponse implements IRunQueryResponse { - - /** - * Constructs a new RunQueryResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.firestore.v1beta1.IRunQueryResponse); - - /** RunQueryResponse transaction. */ - public transaction: Uint8Array; - - /** RunQueryResponse document. */ - public document?: (google.firestore.v1beta1.IDocument|null); - - /** RunQueryResponse readTime. */ - public readTime?: (google.protobuf.ITimestamp|null); - - /** RunQueryResponse skippedResults. */ - public skippedResults: number; - - /** - * Creates a RunQueryResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RunQueryResponse - */ - public static fromObject(object: { [k: string]: any }): google.firestore.v1beta1.RunQueryResponse; - - /** - * Creates a plain object from a RunQueryResponse message. Also converts values to other types if specified. - * @param message RunQueryResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.v1beta1.RunQueryResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RunQueryResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a PartitionQueryRequest. */ - interface IPartitionQueryRequest { - - /** PartitionQueryRequest parent */ - parent?: (string|null); - - /** PartitionQueryRequest structuredQuery */ - structuredQuery?: (google.firestore.v1beta1.IStructuredQuery|null); - - /** PartitionQueryRequest partitionCount */ - partitionCount?: (number|string|null); - - /** PartitionQueryRequest pageToken */ - pageToken?: (string|null); - - /** PartitionQueryRequest pageSize */ - pageSize?: (number|null); - } - - /** Represents a PartitionQueryRequest. */ - class PartitionQueryRequest implements IPartitionQueryRequest { - - /** - * Constructs a new PartitionQueryRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.firestore.v1beta1.IPartitionQueryRequest); - - /** PartitionQueryRequest parent. */ - public parent: string; - - /** PartitionQueryRequest structuredQuery. */ - public structuredQuery?: (google.firestore.v1beta1.IStructuredQuery|null); - - /** PartitionQueryRequest partitionCount. */ - public partitionCount: (number|string); - - /** PartitionQueryRequest pageToken. */ - public pageToken: string; - - /** PartitionQueryRequest pageSize. */ - public pageSize: number; - - /** PartitionQueryRequest queryType. */ - public queryType?: "structuredQuery"; - - /** - * Creates a PartitionQueryRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PartitionQueryRequest - */ - public static fromObject(object: { [k: string]: any }): google.firestore.v1beta1.PartitionQueryRequest; - - /** - * Creates a plain object from a PartitionQueryRequest message. Also converts values to other types if specified. - * @param message PartitionQueryRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.v1beta1.PartitionQueryRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PartitionQueryRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a PartitionQueryResponse. */ - interface IPartitionQueryResponse { - - /** PartitionQueryResponse partitions */ - partitions?: (google.firestore.v1beta1.ICursor[]|null); - - /** PartitionQueryResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a PartitionQueryResponse. */ - class PartitionQueryResponse implements IPartitionQueryResponse { - - /** - * Constructs a new PartitionQueryResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.firestore.v1beta1.IPartitionQueryResponse); - - /** PartitionQueryResponse partitions. */ - public partitions: google.firestore.v1beta1.ICursor[]; - - /** PartitionQueryResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a PartitionQueryResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PartitionQueryResponse - */ - public static fromObject(object: { [k: string]: any }): google.firestore.v1beta1.PartitionQueryResponse; - - /** - * Creates a plain object from a PartitionQueryResponse message. Also converts values to other types if specified. - * @param message PartitionQueryResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.v1beta1.PartitionQueryResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PartitionQueryResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a WriteRequest. */ - interface IWriteRequest { - - /** WriteRequest database */ - database?: (string|null); - - /** WriteRequest streamId */ - streamId?: (string|null); - - /** WriteRequest writes */ - writes?: (google.firestore.v1beta1.IWrite[]|null); - - /** WriteRequest streamToken */ - streamToken?: (Uint8Array|null); - - /** WriteRequest labels */ - labels?: ({ [k: string]: string }|null); - } - - /** Represents a WriteRequest. */ - class WriteRequest implements IWriteRequest { - - /** - * Constructs a new WriteRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.firestore.v1beta1.IWriteRequest); - - /** WriteRequest database. */ - public database: string; - - /** WriteRequest streamId. */ - public streamId: string; - - /** WriteRequest writes. */ - public writes: google.firestore.v1beta1.IWrite[]; - - /** WriteRequest streamToken. */ - public streamToken: Uint8Array; - - /** WriteRequest labels. */ - public labels: { [k: string]: string }; - - /** - * Creates a WriteRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns WriteRequest - */ - public static fromObject(object: { [k: string]: any }): google.firestore.v1beta1.WriteRequest; - - /** - * Creates a plain object from a WriteRequest message. Also converts values to other types if specified. - * @param message WriteRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.v1beta1.WriteRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this WriteRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a WriteResponse. */ - interface IWriteResponse { - - /** WriteResponse streamId */ - streamId?: (string|null); - - /** WriteResponse streamToken */ - streamToken?: (Uint8Array|null); - - /** WriteResponse writeResults */ - writeResults?: (google.firestore.v1beta1.IWriteResult[]|null); - - /** WriteResponse commitTime */ - commitTime?: (google.protobuf.ITimestamp|null); - } - - /** Represents a WriteResponse. */ - class WriteResponse implements IWriteResponse { - - /** - * Constructs a new WriteResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.firestore.v1beta1.IWriteResponse); - - /** WriteResponse streamId. */ - public streamId: string; - - /** WriteResponse streamToken. */ - public streamToken: Uint8Array; - - /** WriteResponse writeResults. */ - public writeResults: google.firestore.v1beta1.IWriteResult[]; - - /** WriteResponse commitTime. */ - public commitTime?: (google.protobuf.ITimestamp|null); - - /** - * Creates a WriteResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns WriteResponse - */ - public static fromObject(object: { [k: string]: any }): google.firestore.v1beta1.WriteResponse; - - /** - * Creates a plain object from a WriteResponse message. Also converts values to other types if specified. - * @param message WriteResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.v1beta1.WriteResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this WriteResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a ListenRequest. */ - interface IListenRequest { - - /** ListenRequest database */ - database?: (string|null); - - /** ListenRequest addTarget */ - addTarget?: (google.firestore.v1beta1.ITarget|null); - - /** ListenRequest removeTarget */ - removeTarget?: (number|null); - - /** ListenRequest labels */ - labels?: ({ [k: string]: string }|null); - } - - /** Represents a ListenRequest. */ - class ListenRequest implements IListenRequest { - - /** - * Constructs a new ListenRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.firestore.v1beta1.IListenRequest); - - /** ListenRequest database. */ - public database: string; - - /** ListenRequest addTarget. */ - public addTarget?: (google.firestore.v1beta1.ITarget|null); - - /** ListenRequest removeTarget. */ - public removeTarget?: (number|null); - - /** ListenRequest labels. */ - public labels: { [k: string]: string }; - - /** ListenRequest targetChange. */ - public targetChange?: ("addTarget"|"removeTarget"); - - /** - * Creates a ListenRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListenRequest - */ - public static fromObject(object: { [k: string]: any }): google.firestore.v1beta1.ListenRequest; - - /** - * Creates a plain object from a ListenRequest message. Also converts values to other types if specified. - * @param message ListenRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.v1beta1.ListenRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListenRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a ListenResponse. */ - interface IListenResponse { - - /** ListenResponse targetChange */ - targetChange?: (google.firestore.v1beta1.ITargetChange|null); - - /** ListenResponse documentChange */ - documentChange?: (google.firestore.v1beta1.IDocumentChange|null); - - /** ListenResponse documentDelete */ - documentDelete?: (google.firestore.v1beta1.IDocumentDelete|null); - - /** ListenResponse documentRemove */ - documentRemove?: (google.firestore.v1beta1.IDocumentRemove|null); - - /** ListenResponse filter */ - filter?: (google.firestore.v1beta1.IExistenceFilter|null); - } - - /** Represents a ListenResponse. */ - class ListenResponse implements IListenResponse { - - /** - * Constructs a new ListenResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.firestore.v1beta1.IListenResponse); - - /** ListenResponse targetChange. */ - public targetChange?: (google.firestore.v1beta1.ITargetChange|null); - - /** ListenResponse documentChange. */ - public documentChange?: (google.firestore.v1beta1.IDocumentChange|null); - - /** ListenResponse documentDelete. */ - public documentDelete?: (google.firestore.v1beta1.IDocumentDelete|null); - - /** ListenResponse documentRemove. */ - public documentRemove?: (google.firestore.v1beta1.IDocumentRemove|null); - - /** ListenResponse filter. */ - public filter?: (google.firestore.v1beta1.IExistenceFilter|null); - - /** ListenResponse responseType. */ - public responseType?: ("targetChange"|"documentChange"|"documentDelete"|"documentRemove"|"filter"); - - /** - * Creates a ListenResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListenResponse - */ - public static fromObject(object: { [k: string]: any }): google.firestore.v1beta1.ListenResponse; - - /** - * Creates a plain object from a ListenResponse message. Also converts values to other types if specified. - * @param message ListenResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.v1beta1.ListenResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListenResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a Target. */ - interface ITarget { - - /** Target query */ - query?: (google.firestore.v1beta1.Target.IQueryTarget|null); - - /** Target documents */ - documents?: (google.firestore.v1beta1.Target.IDocumentsTarget|null); - - /** Target resumeToken */ - resumeToken?: (Uint8Array|null); - - /** Target readTime */ - readTime?: (google.protobuf.ITimestamp|null); - - /** Target targetId */ - targetId?: (number|null); - - /** Target once */ - once?: (boolean|null); - } - - /** Represents a Target. */ - class Target implements ITarget { - - /** - * Constructs a new Target. - * @param [properties] Properties to set - */ - constructor(properties?: google.firestore.v1beta1.ITarget); - - /** Target query. */ - public query?: (google.firestore.v1beta1.Target.IQueryTarget|null); - - /** Target documents. */ - public documents?: (google.firestore.v1beta1.Target.IDocumentsTarget|null); - - /** Target resumeToken. */ - public resumeToken?: (Uint8Array|null); - - /** Target readTime. */ - public readTime?: (google.protobuf.ITimestamp|null); - - /** Target targetId. */ - public targetId: number; - - /** Target once. */ - public once: boolean; - - /** Target targetType. */ - public targetType?: ("query"|"documents"); - - /** Target resumeType. */ - public resumeType?: ("resumeToken"|"readTime"); - - /** - * Creates a Target message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Target - */ - public static fromObject(object: { [k: string]: any }): google.firestore.v1beta1.Target; - - /** - * Creates a plain object from a Target message. Also converts values to other types if specified. - * @param message Target - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.v1beta1.Target, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Target to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - namespace Target { - - /** Properties of a DocumentsTarget. */ - interface IDocumentsTarget { - - /** DocumentsTarget documents */ - documents?: (string[]|null); - } - - /** Represents a DocumentsTarget. */ - class DocumentsTarget implements IDocumentsTarget { - - /** - * Constructs a new DocumentsTarget. - * @param [properties] Properties to set - */ - constructor(properties?: google.firestore.v1beta1.Target.IDocumentsTarget); - - /** DocumentsTarget documents. */ - public documents: string[]; - - /** - * Creates a DocumentsTarget message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DocumentsTarget - */ - public static fromObject(object: { [k: string]: any }): google.firestore.v1beta1.Target.DocumentsTarget; - - /** - * Creates a plain object from a DocumentsTarget message. Also converts values to other types if specified. - * @param message DocumentsTarget - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.v1beta1.Target.DocumentsTarget, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DocumentsTarget to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a QueryTarget. */ - interface IQueryTarget { - - /** QueryTarget parent */ - parent?: (string|null); - - /** QueryTarget structuredQuery */ - structuredQuery?: (google.firestore.v1beta1.IStructuredQuery|null); - } - - /** Represents a QueryTarget. */ - class QueryTarget implements IQueryTarget { - - /** - * Constructs a new QueryTarget. - * @param [properties] Properties to set - */ - constructor(properties?: google.firestore.v1beta1.Target.IQueryTarget); - - /** QueryTarget parent. */ - public parent: string; - - /** QueryTarget structuredQuery. */ - public structuredQuery?: (google.firestore.v1beta1.IStructuredQuery|null); - - /** QueryTarget queryType. */ - public queryType?: "structuredQuery"; - - /** - * Creates a QueryTarget message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryTarget - */ - public static fromObject(object: { [k: string]: any }): google.firestore.v1beta1.Target.QueryTarget; - - /** - * Creates a plain object from a QueryTarget message. Also converts values to other types if specified. - * @param message QueryTarget - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.v1beta1.Target.QueryTarget, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryTarget to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } - - /** Properties of a TargetChange. */ - interface ITargetChange { - - /** TargetChange targetChangeType */ - targetChangeType?: (google.firestore.v1beta1.TargetChange.TargetChangeType|null); - - /** TargetChange targetIds */ - targetIds?: (number[]|null); - - /** TargetChange cause */ - cause?: (google.rpc.IStatus|null); - - /** TargetChange resumeToken */ - resumeToken?: (Uint8Array|null); - - /** TargetChange readTime */ - readTime?: (google.protobuf.ITimestamp|null); - } - - /** Represents a TargetChange. */ - class TargetChange implements ITargetChange { - - /** - * Constructs a new TargetChange. - * @param [properties] Properties to set - */ - constructor(properties?: google.firestore.v1beta1.ITargetChange); - - /** TargetChange targetChangeType. */ - public targetChangeType: google.firestore.v1beta1.TargetChange.TargetChangeType; - - /** TargetChange targetIds. */ - public targetIds: number[]; - - /** TargetChange cause. */ - public cause?: (google.rpc.IStatus|null); - - /** TargetChange resumeToken. */ - public resumeToken: Uint8Array; - - /** TargetChange readTime. */ - public readTime?: (google.protobuf.ITimestamp|null); - - /** - * Creates a TargetChange message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TargetChange - */ - public static fromObject(object: { [k: string]: any }): google.firestore.v1beta1.TargetChange; - - /** - * Creates a plain object from a TargetChange message. Also converts values to other types if specified. - * @param message TargetChange - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.v1beta1.TargetChange, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TargetChange to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - namespace TargetChange { - - /** TargetChangeType enum. */ - type TargetChangeType = - "NO_CHANGE"| "ADD"| "REMOVE"| "CURRENT"| "RESET"; - } - - /** Properties of a ListCollectionIdsRequest. */ - interface IListCollectionIdsRequest { - - /** ListCollectionIdsRequest parent */ - parent?: (string|null); - - /** ListCollectionIdsRequest pageSize */ - pageSize?: (number|null); - - /** ListCollectionIdsRequest pageToken */ - pageToken?: (string|null); - } - - /** Represents a ListCollectionIdsRequest. */ - class ListCollectionIdsRequest implements IListCollectionIdsRequest { - - /** - * Constructs a new ListCollectionIdsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.firestore.v1beta1.IListCollectionIdsRequest); - - /** ListCollectionIdsRequest parent. */ - public parent: string; - - /** ListCollectionIdsRequest pageSize. */ - public pageSize: number; - - /** ListCollectionIdsRequest pageToken. */ - public pageToken: string; - - /** - * Creates a ListCollectionIdsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListCollectionIdsRequest - */ - public static fromObject(object: { [k: string]: any }): google.firestore.v1beta1.ListCollectionIdsRequest; - - /** - * Creates a plain object from a ListCollectionIdsRequest message. Also converts values to other types if specified. - * @param message ListCollectionIdsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.v1beta1.ListCollectionIdsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListCollectionIdsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a ListCollectionIdsResponse. */ - interface IListCollectionIdsResponse { - - /** ListCollectionIdsResponse collectionIds */ - collectionIds?: (string[]|null); - - /** ListCollectionIdsResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListCollectionIdsResponse. */ - class ListCollectionIdsResponse implements IListCollectionIdsResponse { - - /** - * Constructs a new ListCollectionIdsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.firestore.v1beta1.IListCollectionIdsResponse); - - /** ListCollectionIdsResponse collectionIds. */ - public collectionIds: string[]; - - /** ListCollectionIdsResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a ListCollectionIdsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListCollectionIdsResponse - */ - public static fromObject(object: { [k: string]: any }): google.firestore.v1beta1.ListCollectionIdsResponse; - - /** - * Creates a plain object from a ListCollectionIdsResponse message. Also converts values to other types if specified. - * @param message ListCollectionIdsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.v1beta1.ListCollectionIdsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListCollectionIdsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a BatchWriteRequest. */ - interface IBatchWriteRequest { - - /** BatchWriteRequest database */ - database?: (string|null); - - /** BatchWriteRequest writes */ - writes?: (google.firestore.v1beta1.IWrite[]|null); - - /** BatchWriteRequest labels */ - labels?: ({ [k: string]: string }|null); - } - - /** Represents a BatchWriteRequest. */ - class BatchWriteRequest implements IBatchWriteRequest { - - /** - * Constructs a new BatchWriteRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.firestore.v1beta1.IBatchWriteRequest); - - /** BatchWriteRequest database. */ - public database: string; - - /** BatchWriteRequest writes. */ - public writes: google.firestore.v1beta1.IWrite[]; - - /** BatchWriteRequest labels. */ - public labels: { [k: string]: string }; - - /** - * Creates a BatchWriteRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BatchWriteRequest - */ - public static fromObject(object: { [k: string]: any }): google.firestore.v1beta1.BatchWriteRequest; - - /** - * Creates a plain object from a BatchWriteRequest message. Also converts values to other types if specified. - * @param message BatchWriteRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.v1beta1.BatchWriteRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BatchWriteRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a BatchWriteResponse. */ - interface IBatchWriteResponse { - - /** BatchWriteResponse writeResults */ - writeResults?: (google.firestore.v1beta1.IWriteResult[]|null); - - /** BatchWriteResponse status */ - status?: (google.rpc.IStatus[]|null); - } - - /** Represents a BatchWriteResponse. */ - class BatchWriteResponse implements IBatchWriteResponse { - - /** - * Constructs a new BatchWriteResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.firestore.v1beta1.IBatchWriteResponse); - - /** BatchWriteResponse writeResults. */ - public writeResults: google.firestore.v1beta1.IWriteResult[]; - - /** BatchWriteResponse status. */ - public status: google.rpc.IStatus[]; - - /** - * Creates a BatchWriteResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BatchWriteResponse - */ - public static fromObject(object: { [k: string]: any }): google.firestore.v1beta1.BatchWriteResponse; - - /** - * Creates a plain object from a BatchWriteResponse message. Also converts values to other types if specified. - * @param message BatchWriteResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.v1beta1.BatchWriteResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BatchWriteResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a StructuredQuery. */ - interface IStructuredQuery { - - /** StructuredQuery select */ - select?: (google.firestore.v1beta1.StructuredQuery.IProjection|null); - - /** StructuredQuery from */ - from?: (google.firestore.v1beta1.StructuredQuery.ICollectionSelector[]|null); - - /** StructuredQuery where */ - where?: (google.firestore.v1beta1.StructuredQuery.IFilter|null); - - /** StructuredQuery orderBy */ - orderBy?: (google.firestore.v1beta1.StructuredQuery.IOrder[]|null); - - /** StructuredQuery startAt */ - startAt?: (google.firestore.v1beta1.ICursor|null); - - /** StructuredQuery endAt */ - endAt?: (google.firestore.v1beta1.ICursor|null); - - /** StructuredQuery offset */ - offset?: (number|null); - - /** StructuredQuery limit */ - limit?: (google.protobuf.IInt32Value|null); - } - - /** Represents a StructuredQuery. */ - class StructuredQuery implements IStructuredQuery { - - /** - * Constructs a new StructuredQuery. - * @param [properties] Properties to set - */ - constructor(properties?: google.firestore.v1beta1.IStructuredQuery); - - /** StructuredQuery select. */ - public select?: (google.firestore.v1beta1.StructuredQuery.IProjection|null); - - /** StructuredQuery from. */ - public from: google.firestore.v1beta1.StructuredQuery.ICollectionSelector[]; - - /** StructuredQuery where. */ - public where?: (google.firestore.v1beta1.StructuredQuery.IFilter|null); - - /** StructuredQuery orderBy. */ - public orderBy: google.firestore.v1beta1.StructuredQuery.IOrder[]; - - /** StructuredQuery startAt. */ - public startAt?: (google.firestore.v1beta1.ICursor|null); - - /** StructuredQuery endAt. */ - public endAt?: (google.firestore.v1beta1.ICursor|null); - - /** StructuredQuery offset. */ - public offset: number; - - /** StructuredQuery limit. */ - public limit?: (google.protobuf.IInt32Value|null); - - /** - * Creates a StructuredQuery message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns StructuredQuery - */ - public static fromObject(object: { [k: string]: any }): google.firestore.v1beta1.StructuredQuery; - - /** - * Creates a plain object from a StructuredQuery message. Also converts values to other types if specified. - * @param message StructuredQuery - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.v1beta1.StructuredQuery, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this StructuredQuery to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - namespace StructuredQuery { - - /** Properties of a CollectionSelector. */ - interface ICollectionSelector { - - /** CollectionSelector collectionId */ - collectionId?: (string|null); - - /** CollectionSelector allDescendants */ - allDescendants?: (boolean|null); - } - - /** Represents a CollectionSelector. */ - class CollectionSelector implements ICollectionSelector { - - /** - * Constructs a new CollectionSelector. - * @param [properties] Properties to set - */ - constructor(properties?: google.firestore.v1beta1.StructuredQuery.ICollectionSelector); - - /** CollectionSelector collectionId. */ - public collectionId: string; - - /** CollectionSelector allDescendants. */ - public allDescendants: boolean; - - /** - * Creates a CollectionSelector message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CollectionSelector - */ - public static fromObject(object: { [k: string]: any }): google.firestore.v1beta1.StructuredQuery.CollectionSelector; - - /** - * Creates a plain object from a CollectionSelector message. Also converts values to other types if specified. - * @param message CollectionSelector - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.v1beta1.StructuredQuery.CollectionSelector, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CollectionSelector to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a Filter. */ - interface IFilter { - - /** Filter compositeFilter */ - compositeFilter?: (google.firestore.v1beta1.StructuredQuery.ICompositeFilter|null); - - /** Filter fieldFilter */ - fieldFilter?: (google.firestore.v1beta1.StructuredQuery.IFieldFilter|null); - - /** Filter unaryFilter */ - unaryFilter?: (google.firestore.v1beta1.StructuredQuery.IUnaryFilter|null); - } - - /** Represents a Filter. */ - class Filter implements IFilter { - - /** - * Constructs a new Filter. - * @param [properties] Properties to set - */ - constructor(properties?: google.firestore.v1beta1.StructuredQuery.IFilter); - - /** Filter compositeFilter. */ - public compositeFilter?: (google.firestore.v1beta1.StructuredQuery.ICompositeFilter|null); - - /** Filter fieldFilter. */ - public fieldFilter?: (google.firestore.v1beta1.StructuredQuery.IFieldFilter|null); - - /** Filter unaryFilter. */ - public unaryFilter?: (google.firestore.v1beta1.StructuredQuery.IUnaryFilter|null); - - /** Filter filterType. */ - public filterType?: ("compositeFilter"|"fieldFilter"|"unaryFilter"); - - /** - * Creates a Filter message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Filter - */ - public static fromObject(object: { [k: string]: any }): google.firestore.v1beta1.StructuredQuery.Filter; - - /** - * Creates a plain object from a Filter message. Also converts values to other types if specified. - * @param message Filter - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.v1beta1.StructuredQuery.Filter, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Filter to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a CompositeFilter. */ - interface ICompositeFilter { - - /** CompositeFilter op */ - op?: (google.firestore.v1beta1.StructuredQuery.CompositeFilter.Operator|null); - - /** CompositeFilter filters */ - filters?: (google.firestore.v1beta1.StructuredQuery.IFilter[]|null); - } - - /** Represents a CompositeFilter. */ - class CompositeFilter implements ICompositeFilter { - - /** - * Constructs a new CompositeFilter. - * @param [properties] Properties to set - */ - constructor(properties?: google.firestore.v1beta1.StructuredQuery.ICompositeFilter); - - /** CompositeFilter op. */ - public op: google.firestore.v1beta1.StructuredQuery.CompositeFilter.Operator; - - /** CompositeFilter filters. */ - public filters: google.firestore.v1beta1.StructuredQuery.IFilter[]; - - /** - * Creates a CompositeFilter message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CompositeFilter - */ - public static fromObject(object: { [k: string]: any }): google.firestore.v1beta1.StructuredQuery.CompositeFilter; - - /** - * Creates a plain object from a CompositeFilter message. Also converts values to other types if specified. - * @param message CompositeFilter - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.v1beta1.StructuredQuery.CompositeFilter, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CompositeFilter to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - namespace CompositeFilter { - - /** Operator enum. */ - type Operator = - "OPERATOR_UNSPECIFIED"| "AND"; - } - - /** Properties of a FieldFilter. */ - interface IFieldFilter { - - /** FieldFilter field */ - field?: (google.firestore.v1beta1.StructuredQuery.IFieldReference|null); - - /** FieldFilter op */ - op?: (google.firestore.v1beta1.StructuredQuery.FieldFilter.Operator|null); - - /** FieldFilter value */ - value?: (google.firestore.v1beta1.IValue|null); - } - - /** Represents a FieldFilter. */ - class FieldFilter implements IFieldFilter { - - /** - * Constructs a new FieldFilter. - * @param [properties] Properties to set - */ - constructor(properties?: google.firestore.v1beta1.StructuredQuery.IFieldFilter); - - /** FieldFilter field. */ - public field?: (google.firestore.v1beta1.StructuredQuery.IFieldReference|null); - - /** FieldFilter op. */ - public op: google.firestore.v1beta1.StructuredQuery.FieldFilter.Operator; - - /** FieldFilter value. */ - public value?: (google.firestore.v1beta1.IValue|null); - - /** - * Creates a FieldFilter message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FieldFilter - */ - public static fromObject(object: { [k: string]: any }): google.firestore.v1beta1.StructuredQuery.FieldFilter; - - /** - * Creates a plain object from a FieldFilter message. Also converts values to other types if specified. - * @param message FieldFilter - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.v1beta1.StructuredQuery.FieldFilter, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FieldFilter to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - namespace FieldFilter { - - /** Operator enum. */ - type Operator = - "OPERATOR_UNSPECIFIED"| "LESS_THAN"| "LESS_THAN_OR_EQUAL"| "GREATER_THAN"| "GREATER_THAN_OR_EQUAL"| "EQUAL"| "NOT_EQUAL"| "ARRAY_CONTAINS"| "IN"| "ARRAY_CONTAINS_ANY"| "NOT_IN"; - } - - /** Properties of an UnaryFilter. */ - interface IUnaryFilter { - - /** UnaryFilter op */ - op?: (google.firestore.v1beta1.StructuredQuery.UnaryFilter.Operator|null); - - /** UnaryFilter field */ - field?: (google.firestore.v1beta1.StructuredQuery.IFieldReference|null); - } - - /** Represents an UnaryFilter. */ - class UnaryFilter implements IUnaryFilter { - - /** - * Constructs a new UnaryFilter. - * @param [properties] Properties to set - */ - constructor(properties?: google.firestore.v1beta1.StructuredQuery.IUnaryFilter); - - /** UnaryFilter op. */ - public op: google.firestore.v1beta1.StructuredQuery.UnaryFilter.Operator; - - /** UnaryFilter field. */ - public field?: (google.firestore.v1beta1.StructuredQuery.IFieldReference|null); - - /** UnaryFilter operandType. */ - public operandType?: "field"; - - /** - * Creates an UnaryFilter message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UnaryFilter - */ - public static fromObject(object: { [k: string]: any }): google.firestore.v1beta1.StructuredQuery.UnaryFilter; - - /** - * Creates a plain object from an UnaryFilter message. Also converts values to other types if specified. - * @param message UnaryFilter - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.v1beta1.StructuredQuery.UnaryFilter, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UnaryFilter to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - namespace UnaryFilter { - - /** Operator enum. */ - type Operator = - "OPERATOR_UNSPECIFIED"| "IS_NAN"| "IS_NULL"| "IS_NOT_NAN"| "IS_NOT_NULL"; - } - - /** Properties of a FieldReference. */ - interface IFieldReference { - - /** FieldReference fieldPath */ - fieldPath?: (string|null); - } - - /** Represents a FieldReference. */ - class FieldReference implements IFieldReference { - - /** - * Constructs a new FieldReference. - * @param [properties] Properties to set - */ - constructor(properties?: google.firestore.v1beta1.StructuredQuery.IFieldReference); - - /** FieldReference fieldPath. */ - public fieldPath: string; - - /** - * Creates a FieldReference message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FieldReference - */ - public static fromObject(object: { [k: string]: any }): google.firestore.v1beta1.StructuredQuery.FieldReference; - - /** - * Creates a plain object from a FieldReference message. Also converts values to other types if specified. - * @param message FieldReference - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.v1beta1.StructuredQuery.FieldReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FieldReference to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of an Order. */ - interface IOrder { - - /** Order field */ - field?: (google.firestore.v1beta1.StructuredQuery.IFieldReference|null); - - /** Order direction */ - direction?: (google.firestore.v1beta1.StructuredQuery.Direction|null); - } - - /** Represents an Order. */ - class Order implements IOrder { - - /** - * Constructs a new Order. - * @param [properties] Properties to set - */ - constructor(properties?: google.firestore.v1beta1.StructuredQuery.IOrder); - - /** Order field. */ - public field?: (google.firestore.v1beta1.StructuredQuery.IFieldReference|null); - - /** Order direction. */ - public direction: google.firestore.v1beta1.StructuredQuery.Direction; - - /** - * Creates an Order message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Order - */ - public static fromObject(object: { [k: string]: any }): google.firestore.v1beta1.StructuredQuery.Order; - - /** - * Creates a plain object from an Order message. Also converts values to other types if specified. - * @param message Order - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.v1beta1.StructuredQuery.Order, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Order to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a Projection. */ - interface IProjection { - - /** Projection fields */ - fields?: (google.firestore.v1beta1.StructuredQuery.IFieldReference[]|null); - } - - /** Represents a Projection. */ - class Projection implements IProjection { - - /** - * Constructs a new Projection. - * @param [properties] Properties to set - */ - constructor(properties?: google.firestore.v1beta1.StructuredQuery.IProjection); - - /** Projection fields. */ - public fields: google.firestore.v1beta1.StructuredQuery.IFieldReference[]; - - /** - * Creates a Projection message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Projection - */ - public static fromObject(object: { [k: string]: any }): google.firestore.v1beta1.StructuredQuery.Projection; - - /** - * Creates a plain object from a Projection message. Also converts values to other types if specified. - * @param message Projection - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.v1beta1.StructuredQuery.Projection, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Projection to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Direction enum. */ - type Direction = - "DIRECTION_UNSPECIFIED"| "ASCENDING"| "DESCENDING"; - } - - /** Properties of a Cursor. */ - interface ICursor { - - /** Cursor values */ - values?: (google.firestore.v1beta1.IValue[]|null); - - /** Cursor before */ - before?: (boolean|null); - } - - /** Represents a Cursor. */ - class Cursor implements ICursor { - - /** - * Constructs a new Cursor. - * @param [properties] Properties to set - */ - constructor(properties?: google.firestore.v1beta1.ICursor); - - /** Cursor values. */ - public values: google.firestore.v1beta1.IValue[]; - - /** Cursor before. */ - public before: boolean; - - /** - * Creates a Cursor message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Cursor - */ - public static fromObject(object: { [k: string]: any }): google.firestore.v1beta1.Cursor; - - /** - * Creates a plain object from a Cursor message. Also converts values to other types if specified. - * @param message Cursor - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.v1beta1.Cursor, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Cursor to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a Write. */ - interface IWrite { - - /** Write update */ - update?: (google.firestore.v1beta1.IDocument|null); - - /** Write delete */ - "delete"?: (string|null); - - /** Write transform */ - transform?: (google.firestore.v1beta1.IDocumentTransform|null); - - /** Write updateMask */ - updateMask?: (google.firestore.v1beta1.IDocumentMask|null); - - /** Write updateTransforms */ - updateTransforms?: (google.firestore.v1beta1.DocumentTransform.IFieldTransform[]|null); - - /** Write currentDocument */ - currentDocument?: (google.firestore.v1beta1.IPrecondition|null); - } - - /** Represents a Write. */ - class Write implements IWrite { - - /** - * Constructs a new Write. - * @param [properties] Properties to set - */ - constructor(properties?: google.firestore.v1beta1.IWrite); - - /** Write update. */ - public update?: (google.firestore.v1beta1.IDocument|null); - - /** Write delete. */ - public delete?: (string|null); - - /** Write transform. */ - public transform?: (google.firestore.v1beta1.IDocumentTransform|null); - - /** Write updateMask. */ - public updateMask?: (google.firestore.v1beta1.IDocumentMask|null); - - /** Write updateTransforms. */ - public updateTransforms: google.firestore.v1beta1.DocumentTransform.IFieldTransform[]; - - /** Write currentDocument. */ - public currentDocument?: (google.firestore.v1beta1.IPrecondition|null); - - /** Write operation. */ - public operation?: ("update"|"delete"|"transform"); - - /** - * Creates a Write message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Write - */ - public static fromObject(object: { [k: string]: any }): google.firestore.v1beta1.Write; - - /** - * Creates a plain object from a Write message. Also converts values to other types if specified. - * @param message Write - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.v1beta1.Write, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Write to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a DocumentTransform. */ - interface IDocumentTransform { - - /** DocumentTransform document */ - document?: (string|null); - - /** DocumentTransform fieldTransforms */ - fieldTransforms?: (google.firestore.v1beta1.DocumentTransform.IFieldTransform[]|null); - } - - /** Represents a DocumentTransform. */ - class DocumentTransform implements IDocumentTransform { - - /** - * Constructs a new DocumentTransform. - * @param [properties] Properties to set - */ - constructor(properties?: google.firestore.v1beta1.IDocumentTransform); - - /** DocumentTransform document. */ - public document: string; - - /** DocumentTransform fieldTransforms. */ - public fieldTransforms: google.firestore.v1beta1.DocumentTransform.IFieldTransform[]; - - /** - * Creates a DocumentTransform message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DocumentTransform - */ - public static fromObject(object: { [k: string]: any }): google.firestore.v1beta1.DocumentTransform; - - /** - * Creates a plain object from a DocumentTransform message. Also converts values to other types if specified. - * @param message DocumentTransform - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.v1beta1.DocumentTransform, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DocumentTransform to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - namespace DocumentTransform { - - /** Properties of a FieldTransform. */ - interface IFieldTransform { - - /** FieldTransform fieldPath */ - fieldPath?: (string|null); - - /** FieldTransform setToServerValue */ - setToServerValue?: (google.firestore.v1beta1.DocumentTransform.FieldTransform.ServerValue|null); - - /** FieldTransform increment */ - increment?: (google.firestore.v1beta1.IValue|null); - - /** FieldTransform maximum */ - maximum?: (google.firestore.v1beta1.IValue|null); - - /** FieldTransform minimum */ - minimum?: (google.firestore.v1beta1.IValue|null); - - /** FieldTransform appendMissingElements */ - appendMissingElements?: (google.firestore.v1beta1.IArrayValue|null); - - /** FieldTransform removeAllFromArray */ - removeAllFromArray?: (google.firestore.v1beta1.IArrayValue|null); - } - - /** Represents a FieldTransform. */ - class FieldTransform implements IFieldTransform { - - /** - * Constructs a new FieldTransform. - * @param [properties] Properties to set - */ - constructor(properties?: google.firestore.v1beta1.DocumentTransform.IFieldTransform); - - /** FieldTransform fieldPath. */ - public fieldPath: string; - - /** FieldTransform setToServerValue. */ - public setToServerValue?: (google.firestore.v1beta1.DocumentTransform.FieldTransform.ServerValue|null); - - /** FieldTransform increment. */ - public increment?: (google.firestore.v1beta1.IValue|null); - - /** FieldTransform maximum. */ - public maximum?: (google.firestore.v1beta1.IValue|null); - - /** FieldTransform minimum. */ - public minimum?: (google.firestore.v1beta1.IValue|null); - - /** FieldTransform appendMissingElements. */ - public appendMissingElements?: (google.firestore.v1beta1.IArrayValue|null); - - /** FieldTransform removeAllFromArray. */ - public removeAllFromArray?: (google.firestore.v1beta1.IArrayValue|null); - - /** FieldTransform transformType. */ - public transformType?: ("setToServerValue"|"increment"|"maximum"|"minimum"|"appendMissingElements"|"removeAllFromArray"); - - /** - * Creates a FieldTransform message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FieldTransform - */ - public static fromObject(object: { [k: string]: any }): google.firestore.v1beta1.DocumentTransform.FieldTransform; - - /** - * Creates a plain object from a FieldTransform message. Also converts values to other types if specified. - * @param message FieldTransform - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.v1beta1.DocumentTransform.FieldTransform, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FieldTransform to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - namespace FieldTransform { - - /** ServerValue enum. */ - type ServerValue = - "SERVER_VALUE_UNSPECIFIED"| "REQUEST_TIME"; - } - } - - /** Properties of a WriteResult. */ - interface IWriteResult { - - /** WriteResult updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); - - /** WriteResult transformResults */ - transformResults?: (google.firestore.v1beta1.IValue[]|null); - } - - /** Represents a WriteResult. */ - class WriteResult implements IWriteResult { - - /** - * Constructs a new WriteResult. - * @param [properties] Properties to set - */ - constructor(properties?: google.firestore.v1beta1.IWriteResult); - - /** WriteResult updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); - - /** WriteResult transformResults. */ - public transformResults: google.firestore.v1beta1.IValue[]; - - /** - * Creates a WriteResult message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns WriteResult - */ - public static fromObject(object: { [k: string]: any }): google.firestore.v1beta1.WriteResult; - - /** - * Creates a plain object from a WriteResult message. Also converts values to other types if specified. - * @param message WriteResult - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.v1beta1.WriteResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this WriteResult to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a DocumentChange. */ - interface IDocumentChange { - - /** DocumentChange document */ - document?: (google.firestore.v1beta1.IDocument|null); - - /** DocumentChange targetIds */ - targetIds?: (number[]|null); - - /** DocumentChange removedTargetIds */ - removedTargetIds?: (number[]|null); - } - - /** Represents a DocumentChange. */ - class DocumentChange implements IDocumentChange { - - /** - * Constructs a new DocumentChange. - * @param [properties] Properties to set - */ - constructor(properties?: google.firestore.v1beta1.IDocumentChange); - - /** DocumentChange document. */ - public document?: (google.firestore.v1beta1.IDocument|null); - - /** DocumentChange targetIds. */ - public targetIds: number[]; - - /** DocumentChange removedTargetIds. */ - public removedTargetIds: number[]; - - /** - * Creates a DocumentChange message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DocumentChange - */ - public static fromObject(object: { [k: string]: any }): google.firestore.v1beta1.DocumentChange; - - /** - * Creates a plain object from a DocumentChange message. Also converts values to other types if specified. - * @param message DocumentChange - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.v1beta1.DocumentChange, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DocumentChange to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a DocumentDelete. */ - interface IDocumentDelete { - - /** DocumentDelete document */ - document?: (string|null); - - /** DocumentDelete removedTargetIds */ - removedTargetIds?: (number[]|null); - - /** DocumentDelete readTime */ - readTime?: (google.protobuf.ITimestamp|null); - } - - /** Represents a DocumentDelete. */ - class DocumentDelete implements IDocumentDelete { - - /** - * Constructs a new DocumentDelete. - * @param [properties] Properties to set - */ - constructor(properties?: google.firestore.v1beta1.IDocumentDelete); - - /** DocumentDelete document. */ - public document: string; - - /** DocumentDelete removedTargetIds. */ - public removedTargetIds: number[]; - - /** DocumentDelete readTime. */ - public readTime?: (google.protobuf.ITimestamp|null); - - /** - * Creates a DocumentDelete message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DocumentDelete - */ - public static fromObject(object: { [k: string]: any }): google.firestore.v1beta1.DocumentDelete; - - /** - * Creates a plain object from a DocumentDelete message. Also converts values to other types if specified. - * @param message DocumentDelete - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.v1beta1.DocumentDelete, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DocumentDelete to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a DocumentRemove. */ - interface IDocumentRemove { - - /** DocumentRemove document */ - document?: (string|null); - - /** DocumentRemove removedTargetIds */ - removedTargetIds?: (number[]|null); - - /** DocumentRemove readTime */ - readTime?: (google.protobuf.ITimestamp|null); - } - - /** Represents a DocumentRemove. */ - class DocumentRemove implements IDocumentRemove { - - /** - * Constructs a new DocumentRemove. - * @param [properties] Properties to set - */ - constructor(properties?: google.firestore.v1beta1.IDocumentRemove); - - /** DocumentRemove document. */ - public document: string; - - /** DocumentRemove removedTargetIds. */ - public removedTargetIds: number[]; - - /** DocumentRemove readTime. */ - public readTime?: (google.protobuf.ITimestamp|null); - - /** - * Creates a DocumentRemove message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DocumentRemove - */ - public static fromObject(object: { [k: string]: any }): google.firestore.v1beta1.DocumentRemove; - - /** - * Creates a plain object from a DocumentRemove message. Also converts values to other types if specified. - * @param message DocumentRemove - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.v1beta1.DocumentRemove, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DocumentRemove to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of an ExistenceFilter. */ - interface IExistenceFilter { - - /** ExistenceFilter targetId */ - targetId?: (number|null); - - /** ExistenceFilter count */ - count?: (number|null); - } - - /** Represents an ExistenceFilter. */ - class ExistenceFilter implements IExistenceFilter { - - /** - * Constructs a new ExistenceFilter. - * @param [properties] Properties to set - */ - constructor(properties?: google.firestore.v1beta1.IExistenceFilter); - - /** ExistenceFilter targetId. */ - public targetId: number; - - /** ExistenceFilter count. */ - public count: number; - - /** - * Creates an ExistenceFilter message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ExistenceFilter - */ - public static fromObject(object: { [k: string]: any }): google.firestore.v1beta1.ExistenceFilter; - - /** - * Creates a plain object from an ExistenceFilter message. Also converts values to other types if specified. - * @param message ExistenceFilter - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.v1beta1.ExistenceFilter, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ExistenceFilter to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } - } - - /** Namespace api. */ - namespace api { - - /** Properties of a Http. */ - interface IHttp { - - /** Http rules */ - rules?: (google.api.IHttpRule[]|null); - } - - /** Represents a Http. */ - class Http implements IHttp { - - /** - * Constructs a new Http. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IHttp); - - /** Http rules. */ - public rules: google.api.IHttpRule[]; - - /** - * Creates a Http message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Http - */ - public static fromObject(object: { [k: string]: any }): google.api.Http; - - /** - * Creates a plain object from a Http message. Also converts values to other types if specified. - * @param message Http - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.Http, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Http to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a HttpRule. */ - interface IHttpRule { - - /** HttpRule get */ - get?: (string|null); - - /** HttpRule put */ - put?: (string|null); - - /** HttpRule post */ - post?: (string|null); - - /** HttpRule delete */ - "delete"?: (string|null); - - /** HttpRule patch */ - patch?: (string|null); - - /** HttpRule custom */ - custom?: (google.api.ICustomHttpPattern|null); - - /** HttpRule selector */ - selector?: (string|null); - - /** HttpRule body */ - body?: (string|null); - - /** HttpRule additionalBindings */ - additionalBindings?: (google.api.IHttpRule[]|null); - } - - /** Represents a HttpRule. */ - class HttpRule implements IHttpRule { - - /** - * Constructs a new HttpRule. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IHttpRule); - - /** HttpRule get. */ - public get?: (string|null); - - /** HttpRule put. */ - public put?: (string|null); - - /** HttpRule post. */ - public post?: (string|null); - - /** HttpRule delete. */ - public delete?: (string|null); - - /** HttpRule patch. */ - public patch?: (string|null); - - /** HttpRule custom. */ - public custom?: (google.api.ICustomHttpPattern|null); - - /** HttpRule selector. */ - public selector: string; - - /** HttpRule body. */ - public body: string; - - /** HttpRule additionalBindings. */ - public additionalBindings: google.api.IHttpRule[]; - - /** HttpRule pattern. */ - public pattern?: ("get"|"put"|"post"|"delete"|"patch"|"custom"); - - /** - * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns HttpRule - */ - public static fromObject(object: { [k: string]: any }): google.api.HttpRule; - - /** - * Creates a plain object from a HttpRule message. Also converts values to other types if specified. - * @param message HttpRule - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.HttpRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this HttpRule to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a CustomHttpPattern. */ - interface ICustomHttpPattern { - - /** CustomHttpPattern kind */ - kind?: (string|null); - - /** CustomHttpPattern path */ - path?: (string|null); - } - - /** Represents a CustomHttpPattern. */ - class CustomHttpPattern implements ICustomHttpPattern { - - /** - * Constructs a new CustomHttpPattern. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.ICustomHttpPattern); - - /** CustomHttpPattern kind. */ - public kind: string; - - /** CustomHttpPattern path. */ - public path: string; - - /** - * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CustomHttpPattern - */ - public static fromObject(object: { [k: string]: any }): google.api.CustomHttpPattern; - - /** - * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. - * @param message CustomHttpPattern - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.CustomHttpPattern, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CustomHttpPattern to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** FieldBehavior enum. */ - type FieldBehavior = - "FIELD_BEHAVIOR_UNSPECIFIED"| "OPTIONAL"| "REQUIRED"| "OUTPUT_ONLY"| "INPUT_ONLY"| "IMMUTABLE"| "UNORDERED_LIST"| "NON_EMPTY_DEFAULT"; - - /** Properties of a ResourceDescriptor. */ - interface IResourceDescriptor { - - /** ResourceDescriptor type */ - type?: (string|null); - - /** ResourceDescriptor pattern */ - pattern?: (string[]|null); - - /** ResourceDescriptor nameField */ - nameField?: (string|null); - - /** ResourceDescriptor history */ - history?: (google.api.ResourceDescriptor.History|null); - - /** ResourceDescriptor plural */ - plural?: (string|null); - - /** ResourceDescriptor singular */ - singular?: (string|null); - - /** ResourceDescriptor style */ - style?: (google.api.ResourceDescriptor.Style[]|null); - } - - /** Represents a ResourceDescriptor. */ - class ResourceDescriptor implements IResourceDescriptor { - - /** - * Constructs a new ResourceDescriptor. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IResourceDescriptor); - - /** ResourceDescriptor type. */ - public type: string; - - /** ResourceDescriptor pattern. */ - public pattern: string[]; - - /** ResourceDescriptor nameField. */ - public nameField: string; - - /** ResourceDescriptor history. */ - public history: google.api.ResourceDescriptor.History; - - /** ResourceDescriptor plural. */ - public plural: string; - - /** ResourceDescriptor singular. */ - public singular: string; - - /** ResourceDescriptor style. */ - public style: google.api.ResourceDescriptor.Style[]; - - /** - * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ResourceDescriptor - */ - public static fromObject(object: { [k: string]: any }): google.api.ResourceDescriptor; - - /** - * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. - * @param message ResourceDescriptor - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.ResourceDescriptor, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ResourceDescriptor to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - namespace ResourceDescriptor { - - /** History enum. */ - type History = - "HISTORY_UNSPECIFIED"| "ORIGINALLY_SINGLE_PATTERN"| "FUTURE_MULTI_PATTERN"; - - /** Style enum. */ - type Style = - "STYLE_UNSPECIFIED"| "DECLARATIVE_FRIENDLY"; - } - - /** Properties of a ResourceReference. */ - interface IResourceReference { - - /** ResourceReference type */ - type?: (string|null); - - /** ResourceReference childType */ - childType?: (string|null); - } - - /** Represents a ResourceReference. */ - class ResourceReference implements IResourceReference { - - /** - * Constructs a new ResourceReference. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IResourceReference); - - /** ResourceReference type. */ - public type: string; - - /** ResourceReference childType. */ - public childType: string; - - /** - * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ResourceReference - */ - public static fromObject(object: { [k: string]: any }): google.api.ResourceReference; - - /** - * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. - * @param message ResourceReference - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.ResourceReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ResourceReference to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } - - /** Namespace type. */ - namespace type { - - /** Properties of a LatLng. */ - interface ILatLng { - - /** LatLng latitude */ - latitude?: (number|null); - - /** LatLng longitude */ - longitude?: (number|null); - } - - /** Represents a LatLng. */ - class LatLng implements ILatLng { - - /** - * Constructs a new LatLng. - * @param [properties] Properties to set - */ - constructor(properties?: google.type.ILatLng); - - /** LatLng latitude. */ - public latitude: number; - - /** LatLng longitude. */ - public longitude: number; - - /** - * Creates a LatLng message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns LatLng - */ - public static fromObject(object: { [k: string]: any }): google.type.LatLng; - - /** - * Creates a plain object from a LatLng message. Also converts values to other types if specified. - * @param message LatLng - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.type.LatLng, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this LatLng to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } - - /** Namespace rpc. */ - namespace rpc { - - /** Properties of a Status. */ - interface IStatus { - - /** Status code */ - code?: (number|null); - - /** Status message */ - message?: (string|null); - - /** Status details */ - details?: (google.protobuf.IAny[]|null); - } - - /** Represents a Status. */ - class Status implements IStatus { - - /** - * Constructs a new Status. - * @param [properties] Properties to set - */ - constructor(properties?: google.rpc.IStatus); - - /** Status code. */ - public code: number; - - /** Status message. */ - public message: string; - - /** Status details. */ - public details: google.protobuf.IAny[]; - - /** - * Creates a Status message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Status - */ - public static fromObject(object: { [k: string]: any }): google.rpc.Status; - - /** - * Creates a plain object from a Status message. Also converts values to other types if specified. - * @param message Status - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.rpc.Status, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Status to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } - - /** Namespace longrunning. */ - namespace longrunning { - - /** Represents an Operations */ - class Operations extends $protobuf.rpc.Service { - - /** - * Constructs a new Operations service. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - */ - constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); - - /** - * Calls ListOperations. - * @param request ListOperationsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListOperationsResponse - */ - public listOperations(request: google.longrunning.IListOperationsRequest, callback: google.longrunning.Operations.ListOperationsCallback): void; - - /** - * Calls ListOperations. - * @param request ListOperationsRequest message or plain object - * @returns Promise - */ - public listOperations(request: google.longrunning.IListOperationsRequest): Promise; - - /** - * Calls GetOperation. - * @param request GetOperationRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public getOperation(request: google.longrunning.IGetOperationRequest, callback: google.longrunning.Operations.GetOperationCallback): void; - - /** - * Calls GetOperation. - * @param request GetOperationRequest message or plain object - * @returns Promise - */ - public getOperation(request: google.longrunning.IGetOperationRequest): Promise; - - /** - * Calls DeleteOperation. - * @param request DeleteOperationRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty - */ - public deleteOperation(request: google.longrunning.IDeleteOperationRequest, callback: google.longrunning.Operations.DeleteOperationCallback): void; - - /** - * Calls DeleteOperation. - * @param request DeleteOperationRequest message or plain object - * @returns Promise - */ - public deleteOperation(request: google.longrunning.IDeleteOperationRequest): Promise; - - /** - * Calls CancelOperation. - * @param request CancelOperationRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty - */ - public cancelOperation(request: google.longrunning.ICancelOperationRequest, callback: google.longrunning.Operations.CancelOperationCallback): void; - - /** - * Calls CancelOperation. - * @param request CancelOperationRequest message or plain object - * @returns Promise - */ - public cancelOperation(request: google.longrunning.ICancelOperationRequest): Promise; - - /** - * Calls WaitOperation. - * @param request WaitOperationRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public waitOperation(request: google.longrunning.IWaitOperationRequest, callback: google.longrunning.Operations.WaitOperationCallback): void; - - /** - * Calls WaitOperation. - * @param request WaitOperationRequest message or plain object - * @returns Promise - */ - public waitOperation(request: google.longrunning.IWaitOperationRequest): Promise; - } - - namespace Operations { - - /** - * Callback as used by {@link google.longrunning.Operations#listOperations}. - * @param error Error, if any - * @param [response] ListOperationsResponse - */ - type ListOperationsCallback = (error: (Error|null), response?: google.longrunning.ListOperationsResponse) => void; - - /** - * Callback as used by {@link google.longrunning.Operations#getOperation}. - * @param error Error, if any - * @param [response] Operation - */ - type GetOperationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.longrunning.Operations#deleteOperation}. - * @param error Error, if any - * @param [response] Empty - */ - type DeleteOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - - /** - * Callback as used by {@link google.longrunning.Operations#cancelOperation}. - * @param error Error, if any - * @param [response] Empty - */ - type CancelOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - - /** - * Callback as used by {@link google.longrunning.Operations#waitOperation}. - * @param error Error, if any - * @param [response] Operation - */ - type WaitOperationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - } - - /** Properties of an Operation. */ - interface IOperation { - - /** Operation name */ - name?: (string|null); - - /** Operation metadata */ - metadata?: (google.protobuf.IAny|null); - - /** Operation done */ - done?: (boolean|null); - - /** Operation error */ - error?: (google.rpc.IStatus|null); - - /** Operation response */ - response?: (google.protobuf.IAny|null); - } - - /** Represents an Operation. */ - class Operation implements IOperation { - - /** - * Constructs a new Operation. - * @param [properties] Properties to set - */ - constructor(properties?: google.longrunning.IOperation); - - /** Operation name. */ - public name: string; - - /** Operation metadata. */ - public metadata?: (google.protobuf.IAny|null); - - /** Operation done. */ - public done: boolean; - - /** Operation error. */ - public error?: (google.rpc.IStatus|null); - - /** Operation response. */ - public response?: (google.protobuf.IAny|null); - - /** Operation result. */ - public result?: ("error"|"response"); - - /** - * Creates an Operation message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Operation - */ - public static fromObject(object: { [k: string]: any }): google.longrunning.Operation; - - /** - * Creates a plain object from an Operation message. Also converts values to other types if specified. - * @param message Operation - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.longrunning.Operation, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Operation to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a GetOperationRequest. */ - interface IGetOperationRequest { - - /** GetOperationRequest name */ - name?: (string|null); - } - - /** Represents a GetOperationRequest. */ - class GetOperationRequest implements IGetOperationRequest { - - /** - * Constructs a new GetOperationRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.longrunning.IGetOperationRequest); - - /** GetOperationRequest name. */ - public name: string; - - /** - * Creates a GetOperationRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetOperationRequest - */ - public static fromObject(object: { [k: string]: any }): google.longrunning.GetOperationRequest; - - /** - * Creates a plain object from a GetOperationRequest message. Also converts values to other types if specified. - * @param message GetOperationRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.longrunning.GetOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetOperationRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a ListOperationsRequest. */ - interface IListOperationsRequest { - - /** ListOperationsRequest name */ - name?: (string|null); - - /** ListOperationsRequest filter */ - filter?: (string|null); - - /** ListOperationsRequest pageSize */ - pageSize?: (number|null); - - /** ListOperationsRequest pageToken */ - pageToken?: (string|null); - } - - /** Represents a ListOperationsRequest. */ - class ListOperationsRequest implements IListOperationsRequest { - - /** - * Constructs a new ListOperationsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.longrunning.IListOperationsRequest); - - /** ListOperationsRequest name. */ - public name: string; - - /** ListOperationsRequest filter. */ - public filter: string; - - /** ListOperationsRequest pageSize. */ - public pageSize: number; - - /** ListOperationsRequest pageToken. */ - public pageToken: string; - - /** - * Creates a ListOperationsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListOperationsRequest - */ - public static fromObject(object: { [k: string]: any }): google.longrunning.ListOperationsRequest; - - /** - * Creates a plain object from a ListOperationsRequest message. Also converts values to other types if specified. - * @param message ListOperationsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.longrunning.ListOperationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListOperationsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a ListOperationsResponse. */ - interface IListOperationsResponse { - - /** ListOperationsResponse operations */ - operations?: (google.longrunning.IOperation[]|null); - - /** ListOperationsResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListOperationsResponse. */ - class ListOperationsResponse implements IListOperationsResponse { - - /** - * Constructs a new ListOperationsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.longrunning.IListOperationsResponse); - - /** ListOperationsResponse operations. */ - public operations: google.longrunning.IOperation[]; - - /** ListOperationsResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a ListOperationsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListOperationsResponse - */ - public static fromObject(object: { [k: string]: any }): google.longrunning.ListOperationsResponse; - - /** - * Creates a plain object from a ListOperationsResponse message. Also converts values to other types if specified. - * @param message ListOperationsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.longrunning.ListOperationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListOperationsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a CancelOperationRequest. */ - interface ICancelOperationRequest { - - /** CancelOperationRequest name */ - name?: (string|null); - } - - /** Represents a CancelOperationRequest. */ - class CancelOperationRequest implements ICancelOperationRequest { - - /** - * Constructs a new CancelOperationRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.longrunning.ICancelOperationRequest); - - /** CancelOperationRequest name. */ - public name: string; - - /** - * Creates a CancelOperationRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CancelOperationRequest - */ - public static fromObject(object: { [k: string]: any }): google.longrunning.CancelOperationRequest; - - /** - * Creates a plain object from a CancelOperationRequest message. Also converts values to other types if specified. - * @param message CancelOperationRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.longrunning.CancelOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CancelOperationRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a DeleteOperationRequest. */ - interface IDeleteOperationRequest { - - /** DeleteOperationRequest name */ - name?: (string|null); - } - - /** Represents a DeleteOperationRequest. */ - class DeleteOperationRequest implements IDeleteOperationRequest { - - /** - * Constructs a new DeleteOperationRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.longrunning.IDeleteOperationRequest); - - /** DeleteOperationRequest name. */ - public name: string; - - /** - * Creates a DeleteOperationRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteOperationRequest - */ - public static fromObject(object: { [k: string]: any }): google.longrunning.DeleteOperationRequest; - - /** - * Creates a plain object from a DeleteOperationRequest message. Also converts values to other types if specified. - * @param message DeleteOperationRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.longrunning.DeleteOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteOperationRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a WaitOperationRequest. */ - interface IWaitOperationRequest { - - /** WaitOperationRequest name */ - name?: (string|null); - - /** WaitOperationRequest timeout */ - timeout?: (google.protobuf.IDuration|null); - } - - /** Represents a WaitOperationRequest. */ - class WaitOperationRequest implements IWaitOperationRequest { - - /** - * Constructs a new WaitOperationRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.longrunning.IWaitOperationRequest); - - /** WaitOperationRequest name. */ - public name: string; - - /** WaitOperationRequest timeout. */ - public timeout?: (google.protobuf.IDuration|null); - - /** - * Creates a WaitOperationRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns WaitOperationRequest - */ - public static fromObject(object: { [k: string]: any }): google.longrunning.WaitOperationRequest; - - /** - * Creates a plain object from a WaitOperationRequest message. Also converts values to other types if specified. - * @param message WaitOperationRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.longrunning.WaitOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this WaitOperationRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of an OperationInfo. */ - interface IOperationInfo { - - /** OperationInfo responseType */ - responseType?: (string|null); - - /** OperationInfo metadataType */ - metadataType?: (string|null); - } - - /** Represents an OperationInfo. */ - class OperationInfo implements IOperationInfo { - - /** - * Constructs a new OperationInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.longrunning.IOperationInfo); - - /** OperationInfo responseType. */ - public responseType: string; - - /** OperationInfo metadataType. */ - public metadataType: string; - - /** - * Creates an OperationInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns OperationInfo - */ - public static fromObject(object: { [k: string]: any }): google.longrunning.OperationInfo; - - /** - * Creates a plain object from an OperationInfo message. Also converts values to other types if specified. - * @param message OperationInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.longrunning.OperationInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this OperationInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/firestore/types/v1/firestore_admin_client.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/firestore/types/v1/firestore_admin_client.d.ts deleted file mode 100644 index 5adbd788..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/firestore/types/v1/firestore_admin_client.d.ts +++ /dev/null @@ -1,1255 +0,0 @@ -/*! - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/// -import * as gax from 'google-gax'; -import { - Callback, - CallOptions, - Descriptors, - ClientOptions, - LROperation, - PaginationCallback, -} from 'google-gax'; -import {Transform} from 'stream'; -import * as protos from '../protos/firestore_admin_v1_proto_api'; -/** - * The Cloud Firestore Admin API. - * - * This API provides several administrative services for Cloud Firestore. - * - * Project, Database, Namespace, Collection, Collection Group, and Document are - * used as defined in the Google Cloud Firestore API. - * - * Operation: An Operation represents work being performed in the background. - * - * The index service manages Cloud Firestore indexes. - * - * Index creation is performed asynchronously. - * An Operation resource is created for each such asynchronous operation. - * The state of the operation (including any errors encountered) - * may be queried via the Operation resource. - * - * The Operations collection provides a record of actions performed for the - * specified Project (including any Operations in progress). Operations are not - * created directly but through calls on other collections or resources. - * - * An Operation that is done may be deleted so that it is no longer listed as - * part of the Operation collection. Operations are garbage collected after - * 30 days. By default, ListOperations will only return in progress and failed - * operations. To list completed operation, issue a ListOperations request with - * the filter `done: true`. - * - * Operations are created by service `FirestoreAdmin`, but are accessed via - * service `google.longrunning.Operations`. - * @class - * @memberof v1 - */ -export declare class FirestoreAdminClient { - private _terminated; - private _opts; - private _providedCustomServicePath; - private _gaxModule; - private _gaxGrpc; - private _protos; - private _defaults; - auth: gax.GoogleAuth; - descriptors: Descriptors; - warn: (code: string, message: string, warnType?: string) => void; - innerApiCalls: { - [name: string]: Function; - }; - pathTemplates: { - [name: string]: gax.PathTemplate; - }; - operationsClient: gax.OperationsClient; - firestoreAdminStub?: Promise<{ - [name: string]: Function; - }>; - /** - * Construct an instance of FirestoreAdminClient. - * - * @param {object} [options] - The configuration object. - * The options accepted by the constructor are described in detail - * in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance). - * The common options are: - * @param {object} [options.credentials] - Credentials object. - * @param {string} [options.credentials.client_email] - * @param {string} [options.credentials.private_key] - * @param {string} [options.email] - Account email address. Required when - * using a .pem or .p12 keyFilename. - * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or - * .p12 key downloaded from the Google Developers Console. If you provide - * a path to a JSON file, the projectId option below is not necessary. - * NOTE: .pem and .p12 require you to specify options.email as well. - * @param {number} [options.port] - The port on which to connect to - * the remote host. - * @param {string} [options.projectId] - The project ID from the Google - * Developer's Console, e.g. 'grape-spaceship-123'. We will also check - * the environment variable GCLOUD_PROJECT for your project ID. If your - * app is running in an environment which supports - * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, - * your project ID will be detected automatically. - * @param {string} [options.apiEndpoint] - The domain name of the - * API remote host. - * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. - * Follows the structure of {@link gapicConfig}. - * @param {boolean} [options.fallback] - Use HTTP fallback mode. - * In fallback mode, a special browser-compatible transport implementation is used - * instead of gRPC transport. In browser context (if the `window` object is defined) - * the fallback mode is enabled automatically; set `options.fallback` to `false` - * if you need to override this behavior. - */ - constructor(opts?: ClientOptions); - /** - * Initialize the client. - * Performs asynchronous operations (such as authentication) and prepares the client. - * This function will be called automatically when any class method is called for the - * first time, but if you need to initialize it before calling an actual method, - * feel free to call initialize() directly. - * - * You can await on this method if you want to make sure the client is initialized. - * - * @returns {Promise} A promise that resolves to an authenticated service stub. - */ - initialize(): Promise<{ - [name: string]: Function; - }>; - /** - * The DNS address for this API service. - * @returns {string} The DNS address for this service. - */ - static get servicePath(): string; - /** - * The DNS address for this API service - same as servicePath(), - * exists for compatibility reasons. - * @returns {string} The DNS address for this service. - */ - static get apiEndpoint(): string; - /** - * The port for this API service. - * @returns {number} The default port for this service. - */ - static get port(): number; - /** - * The scopes needed to make gRPC calls for every method defined - * in this service. - * @returns {string[]} List of default scopes. - */ - static get scopes(): string[]; - getProjectId(): Promise; - getProjectId(callback: Callback): void; - /** - * Gets a composite index. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. A name of the form - * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{index_id}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Index]{@link google.firestore.admin.v1.Index}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1/firestore_admin.get_index.js - * region_tag:firestore_v1_generated_FirestoreAdmin_GetIndex_async - */ - getIndex( - request?: protos.google.firestore.admin.v1.IGetIndexRequest, - options?: CallOptions - ): Promise< - [ - protos.google.firestore.admin.v1.IIndex, - protos.google.firestore.admin.v1.IGetIndexRequest | undefined, - {} | undefined - ] - >; - getIndex( - request: protos.google.firestore.admin.v1.IGetIndexRequest, - options: CallOptions, - callback: Callback< - protos.google.firestore.admin.v1.IIndex, - protos.google.firestore.admin.v1.IGetIndexRequest | null | undefined, - {} | null | undefined - > - ): void; - getIndex( - request: protos.google.firestore.admin.v1.IGetIndexRequest, - callback: Callback< - protos.google.firestore.admin.v1.IIndex, - protos.google.firestore.admin.v1.IGetIndexRequest | null | undefined, - {} | null | undefined - > - ): void; - /** - * Deletes a composite index. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. A name of the form - * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{index_id}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1/firestore_admin.delete_index.js - * region_tag:firestore_v1_generated_FirestoreAdmin_DeleteIndex_async - */ - deleteIndex( - request?: protos.google.firestore.admin.v1.IDeleteIndexRequest, - options?: CallOptions - ): Promise< - [ - protos.google.protobuf.IEmpty, - protos.google.firestore.admin.v1.IDeleteIndexRequest | undefined, - {} | undefined - ] - >; - deleteIndex( - request: protos.google.firestore.admin.v1.IDeleteIndexRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.firestore.admin.v1.IDeleteIndexRequest | null | undefined, - {} | null | undefined - > - ): void; - deleteIndex( - request: protos.google.firestore.admin.v1.IDeleteIndexRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.firestore.admin.v1.IDeleteIndexRequest | null | undefined, - {} | null | undefined - > - ): void; - /** - * Gets the metadata and configuration for a Field. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. A name of the form - * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/fields/{field_id}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Field]{@link google.firestore.admin.v1.Field}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1/firestore_admin.get_field.js - * region_tag:firestore_v1_generated_FirestoreAdmin_GetField_async - */ - getField( - request?: protos.google.firestore.admin.v1.IGetFieldRequest, - options?: CallOptions - ): Promise< - [ - protos.google.firestore.admin.v1.IField, - protos.google.firestore.admin.v1.IGetFieldRequest | undefined, - {} | undefined - ] - >; - getField( - request: protos.google.firestore.admin.v1.IGetFieldRequest, - options: CallOptions, - callback: Callback< - protos.google.firestore.admin.v1.IField, - protos.google.firestore.admin.v1.IGetFieldRequest | null | undefined, - {} | null | undefined - > - ): void; - getField( - request: protos.google.firestore.admin.v1.IGetFieldRequest, - callback: Callback< - protos.google.firestore.admin.v1.IField, - protos.google.firestore.admin.v1.IGetFieldRequest | null | undefined, - {} | null | undefined - > - ): void; - /** - * Gets information about a database. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. A name of the form - * `projects/{project_id}/databases/{database_id}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Database]{@link google.firestore.admin.v1.Database}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1/firestore_admin.get_database.js - * region_tag:firestore_v1_generated_FirestoreAdmin_GetDatabase_async - */ - getDatabase( - request?: protos.google.firestore.admin.v1.IGetDatabaseRequest, - options?: CallOptions - ): Promise< - [ - protos.google.firestore.admin.v1.IDatabase, - protos.google.firestore.admin.v1.IGetDatabaseRequest | undefined, - {} | undefined - ] - >; - getDatabase( - request: protos.google.firestore.admin.v1.IGetDatabaseRequest, - options: CallOptions, - callback: Callback< - protos.google.firestore.admin.v1.IDatabase, - protos.google.firestore.admin.v1.IGetDatabaseRequest | null | undefined, - {} | null | undefined - > - ): void; - getDatabase( - request: protos.google.firestore.admin.v1.IGetDatabaseRequest, - callback: Callback< - protos.google.firestore.admin.v1.IDatabase, - protos.google.firestore.admin.v1.IGetDatabaseRequest | null | undefined, - {} | null | undefined - > - ): void; - /** - * List all the databases in the project. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. A parent name of the form - * `projects/{project_id}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [ListDatabasesResponse]{@link google.firestore.admin.v1.ListDatabasesResponse}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1/firestore_admin.list_databases.js - * region_tag:firestore_v1_generated_FirestoreAdmin_ListDatabases_async - */ - listDatabases( - request?: protos.google.firestore.admin.v1.IListDatabasesRequest, - options?: CallOptions - ): Promise< - [ - protos.google.firestore.admin.v1.IListDatabasesResponse, - protos.google.firestore.admin.v1.IListDatabasesRequest | undefined, - {} | undefined - ] - >; - listDatabases( - request: protos.google.firestore.admin.v1.IListDatabasesRequest, - options: CallOptions, - callback: Callback< - protos.google.firestore.admin.v1.IListDatabasesResponse, - protos.google.firestore.admin.v1.IListDatabasesRequest | null | undefined, - {} | null | undefined - > - ): void; - listDatabases( - request: protos.google.firestore.admin.v1.IListDatabasesRequest, - callback: Callback< - protos.google.firestore.admin.v1.IListDatabasesResponse, - protos.google.firestore.admin.v1.IListDatabasesRequest | null | undefined, - {} | null | undefined - > - ): void; - /** - * Creates a composite index. This returns a {@link google.longrunning.Operation|google.longrunning.Operation} - * which may be used to track the status of the creation. The metadata for - * the operation will be the type {@link google.firestore.admin.v1.IndexOperationMetadata|IndexOperationMetadata}. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. A parent name of the form - * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}` - * @param {google.firestore.admin.v1.Index} request.index - * Required. The composite index to create. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example include:samples/generated/v1/firestore_admin.create_index.js - * region_tag:firestore_v1_generated_FirestoreAdmin_CreateIndex_async - */ - createIndex( - request?: protos.google.firestore.admin.v1.ICreateIndexRequest, - options?: CallOptions - ): Promise< - [ - LROperation< - protos.google.firestore.admin.v1.IIndex, - protos.google.firestore.admin.v1.IIndexOperationMetadata - >, - protos.google.longrunning.IOperation | undefined, - {} | undefined - ] - >; - createIndex( - request: protos.google.firestore.admin.v1.ICreateIndexRequest, - options: CallOptions, - callback: Callback< - LROperation< - protos.google.firestore.admin.v1.IIndex, - protos.google.firestore.admin.v1.IIndexOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - > - ): void; - createIndex( - request: protos.google.firestore.admin.v1.ICreateIndexRequest, - callback: Callback< - LROperation< - protos.google.firestore.admin.v1.IIndex, - protos.google.firestore.admin.v1.IIndexOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - > - ): void; - /** - * Check the status of the long running operation returned by `createIndex()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example include:samples/generated/v1/firestore_admin.create_index.js - * region_tag:firestore_v1_generated_FirestoreAdmin_CreateIndex_async - */ - checkCreateIndexProgress( - name: string - ): Promise< - LROperation< - protos.google.firestore.admin.v1.Index, - protos.google.firestore.admin.v1.IndexOperationMetadata - > - >; - /** - * Updates a field configuration. Currently, field updates apply only to - * single field index configuration. However, calls to - * {@link google.firestore.admin.v1.FirestoreAdmin.UpdateField|FirestoreAdmin.UpdateField} should provide a field mask to avoid - * changing any configuration that the caller isn't aware of. The field mask - * should be specified as: `{ paths: "index_config" }`. - * - * This call returns a {@link google.longrunning.Operation|google.longrunning.Operation} which may be used to - * track the status of the field update. The metadata for - * the operation will be the type {@link google.firestore.admin.v1.FieldOperationMetadata|FieldOperationMetadata}. - * - * To configure the default field settings for the database, use - * the special `Field` with resource name: - * `projects/{project_id}/databases/{database_id}/collectionGroups/__default__/fields/*`. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.firestore.admin.v1.Field} request.field - * Required. The field to be updated. - * @param {google.protobuf.FieldMask} request.updateMask - * A mask, relative to the field. If specified, only configuration specified - * by this field_mask will be updated in the field. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example include:samples/generated/v1/firestore_admin.update_field.js - * region_tag:firestore_v1_generated_FirestoreAdmin_UpdateField_async - */ - updateField( - request?: protos.google.firestore.admin.v1.IUpdateFieldRequest, - options?: CallOptions - ): Promise< - [ - LROperation< - protos.google.firestore.admin.v1.IField, - protos.google.firestore.admin.v1.IFieldOperationMetadata - >, - protos.google.longrunning.IOperation | undefined, - {} | undefined - ] - >; - updateField( - request: protos.google.firestore.admin.v1.IUpdateFieldRequest, - options: CallOptions, - callback: Callback< - LROperation< - protos.google.firestore.admin.v1.IField, - protos.google.firestore.admin.v1.IFieldOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - > - ): void; - updateField( - request: protos.google.firestore.admin.v1.IUpdateFieldRequest, - callback: Callback< - LROperation< - protos.google.firestore.admin.v1.IField, - protos.google.firestore.admin.v1.IFieldOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - > - ): void; - /** - * Check the status of the long running operation returned by `updateField()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example include:samples/generated/v1/firestore_admin.update_field.js - * region_tag:firestore_v1_generated_FirestoreAdmin_UpdateField_async - */ - checkUpdateFieldProgress( - name: string - ): Promise< - LROperation< - protos.google.firestore.admin.v1.Field, - protos.google.firestore.admin.v1.FieldOperationMetadata - > - >; - /** - * Exports a copy of all or a subset of documents from Google Cloud Firestore - * to another storage system, such as Google Cloud Storage. Recent updates to - * documents may not be reflected in the export. The export occurs in the - * background and its progress can be monitored and managed via the - * Operation resource that is created. The output of an export may only be - * used once the associated operation is done. If an export operation is - * cancelled before completion it may leave partial data behind in Google - * Cloud Storage. - * - * For more details on export behavior and output format, refer to: - * https://cloud.google.com/firestore/docs/manage-data/export-import - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. Database to export. Should be of the form: - * `projects/{project_id}/databases/{database_id}`. - * @param {string[]} request.collectionIds - * Which collection ids to export. Unspecified means all collections. - * @param {string} request.outputUriPrefix - * The output URI. Currently only supports Google Cloud Storage URIs of the - * form: `gs://BUCKET_NAME[/NAMESPACE_PATH]`, where `BUCKET_NAME` is the name - * of the Google Cloud Storage bucket and `NAMESPACE_PATH` is an optional - * Google Cloud Storage namespace path. When - * choosing a name, be sure to consider Google Cloud Storage naming - * guidelines: https://cloud.google.com/storage/docs/naming. - * If the URI is a bucket (without a namespace path), a prefix will be - * generated based on the start time. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example include:samples/generated/v1/firestore_admin.export_documents.js - * region_tag:firestore_v1_generated_FirestoreAdmin_ExportDocuments_async - */ - exportDocuments( - request?: protos.google.firestore.admin.v1.IExportDocumentsRequest, - options?: CallOptions - ): Promise< - [ - LROperation< - protos.google.firestore.admin.v1.IExportDocumentsResponse, - protos.google.firestore.admin.v1.IExportDocumentsMetadata - >, - protos.google.longrunning.IOperation | undefined, - {} | undefined - ] - >; - exportDocuments( - request: protos.google.firestore.admin.v1.IExportDocumentsRequest, - options: CallOptions, - callback: Callback< - LROperation< - protos.google.firestore.admin.v1.IExportDocumentsResponse, - protos.google.firestore.admin.v1.IExportDocumentsMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - > - ): void; - exportDocuments( - request: protos.google.firestore.admin.v1.IExportDocumentsRequest, - callback: Callback< - LROperation< - protos.google.firestore.admin.v1.IExportDocumentsResponse, - protos.google.firestore.admin.v1.IExportDocumentsMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - > - ): void; - /** - * Check the status of the long running operation returned by `exportDocuments()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example include:samples/generated/v1/firestore_admin.export_documents.js - * region_tag:firestore_v1_generated_FirestoreAdmin_ExportDocuments_async - */ - checkExportDocumentsProgress( - name: string - ): Promise< - LROperation< - protos.google.firestore.admin.v1.ExportDocumentsResponse, - protos.google.firestore.admin.v1.ExportDocumentsMetadata - > - >; - /** - * Imports documents into Google Cloud Firestore. Existing documents with the - * same name are overwritten. The import occurs in the background and its - * progress can be monitored and managed via the Operation resource that is - * created. If an ImportDocuments operation is cancelled, it is possible - * that a subset of the data has already been imported to Cloud Firestore. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. Database to import into. Should be of the form: - * `projects/{project_id}/databases/{database_id}`. - * @param {string[]} request.collectionIds - * Which collection ids to import. Unspecified means all collections included - * in the import. - * @param {string} request.inputUriPrefix - * Location of the exported files. - * This must match the output_uri_prefix of an ExportDocumentsResponse from - * an export that has completed successfully. - * See: - * {@link google.firestore.admin.v1.ExportDocumentsResponse.output_uri_prefix|google.firestore.admin.v1.ExportDocumentsResponse.output_uri_prefix}. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example include:samples/generated/v1/firestore_admin.import_documents.js - * region_tag:firestore_v1_generated_FirestoreAdmin_ImportDocuments_async - */ - importDocuments( - request?: protos.google.firestore.admin.v1.IImportDocumentsRequest, - options?: CallOptions - ): Promise< - [ - LROperation< - protos.google.protobuf.IEmpty, - protos.google.firestore.admin.v1.IImportDocumentsMetadata - >, - protos.google.longrunning.IOperation | undefined, - {} | undefined - ] - >; - importDocuments( - request: protos.google.firestore.admin.v1.IImportDocumentsRequest, - options: CallOptions, - callback: Callback< - LROperation< - protos.google.protobuf.IEmpty, - protos.google.firestore.admin.v1.IImportDocumentsMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - > - ): void; - importDocuments( - request: protos.google.firestore.admin.v1.IImportDocumentsRequest, - callback: Callback< - LROperation< - protos.google.protobuf.IEmpty, - protos.google.firestore.admin.v1.IImportDocumentsMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - > - ): void; - /** - * Check the status of the long running operation returned by `importDocuments()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example include:samples/generated/v1/firestore_admin.import_documents.js - * region_tag:firestore_v1_generated_FirestoreAdmin_ImportDocuments_async - */ - checkImportDocumentsProgress( - name: string - ): Promise< - LROperation< - protos.google.protobuf.Empty, - protos.google.firestore.admin.v1.ImportDocumentsMetadata - > - >; - /** - * Updates a database. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.firestore.admin.v1.Database} request.database - * Required. The database to update. - * @param {google.protobuf.FieldMask} request.updateMask - * The list of fields to be updated. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example include:samples/generated/v1/firestore_admin.update_database.js - * region_tag:firestore_v1_generated_FirestoreAdmin_UpdateDatabase_async - */ - updateDatabase( - request?: protos.google.firestore.admin.v1.IUpdateDatabaseRequest, - options?: CallOptions - ): Promise< - [ - LROperation< - protos.google.firestore.admin.v1.IDatabase, - protos.google.firestore.admin.v1.IUpdateDatabaseMetadata - >, - protos.google.longrunning.IOperation | undefined, - {} | undefined - ] - >; - updateDatabase( - request: protos.google.firestore.admin.v1.IUpdateDatabaseRequest, - options: CallOptions, - callback: Callback< - LROperation< - protos.google.firestore.admin.v1.IDatabase, - protos.google.firestore.admin.v1.IUpdateDatabaseMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - > - ): void; - updateDatabase( - request: protos.google.firestore.admin.v1.IUpdateDatabaseRequest, - callback: Callback< - LROperation< - protos.google.firestore.admin.v1.IDatabase, - protos.google.firestore.admin.v1.IUpdateDatabaseMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - > - ): void; - /** - * Check the status of the long running operation returned by `updateDatabase()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example include:samples/generated/v1/firestore_admin.update_database.js - * region_tag:firestore_v1_generated_FirestoreAdmin_UpdateDatabase_async - */ - checkUpdateDatabaseProgress( - name: string - ): Promise< - LROperation< - protos.google.firestore.admin.v1.Database, - protos.google.firestore.admin.v1.UpdateDatabaseMetadata - > - >; - /** - * Lists composite indexes. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. A parent name of the form - * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}` - * @param {string} request.filter - * The filter to apply to list results. - * @param {number} request.pageSize - * The number of results to return. - * @param {string} request.pageToken - * A page token, returned from a previous call to - * {@link google.firestore.admin.v1.FirestoreAdmin.ListIndexes|FirestoreAdmin.ListIndexes}, that may be used to get the next - * page of results. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [Index]{@link google.firestore.admin.v1.Index}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listIndexesAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listIndexes( - request?: protos.google.firestore.admin.v1.IListIndexesRequest, - options?: CallOptions - ): Promise< - [ - protos.google.firestore.admin.v1.IIndex[], - protos.google.firestore.admin.v1.IListIndexesRequest | null, - protos.google.firestore.admin.v1.IListIndexesResponse - ] - >; - listIndexes( - request: protos.google.firestore.admin.v1.IListIndexesRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.firestore.admin.v1.IListIndexesRequest, - protos.google.firestore.admin.v1.IListIndexesResponse | null | undefined, - protos.google.firestore.admin.v1.IIndex - > - ): void; - listIndexes( - request: protos.google.firestore.admin.v1.IListIndexesRequest, - callback: PaginationCallback< - protos.google.firestore.admin.v1.IListIndexesRequest, - protos.google.firestore.admin.v1.IListIndexesResponse | null | undefined, - protos.google.firestore.admin.v1.IIndex - > - ): void; - /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. A parent name of the form - * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}` - * @param {string} request.filter - * The filter to apply to list results. - * @param {number} request.pageSize - * The number of results to return. - * @param {string} request.pageToken - * A page token, returned from a previous call to - * {@link google.firestore.admin.v1.FirestoreAdmin.ListIndexes|FirestoreAdmin.ListIndexes}, that may be used to get the next - * page of results. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing [Index]{@link google.firestore.admin.v1.Index} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listIndexesAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listIndexesStream( - request?: protos.google.firestore.admin.v1.IListIndexesRequest, - options?: CallOptions - ): Transform; - /** - * Equivalent to `listIndexes`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. A parent name of the form - * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}` - * @param {string} request.filter - * The filter to apply to list results. - * @param {number} request.pageSize - * The number of results to return. - * @param {string} request.pageToken - * A page token, returned from a previous call to - * {@link google.firestore.admin.v1.FirestoreAdmin.ListIndexes|FirestoreAdmin.ListIndexes}, that may be used to get the next - * page of results. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). - * When you iterate the returned iterable, each element will be an object representing - * [Index]{@link google.firestore.admin.v1.Index}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - * @example include:samples/generated/v1/firestore_admin.list_indexes.js - * region_tag:firestore_v1_generated_FirestoreAdmin_ListIndexes_async - */ - listIndexesAsync( - request?: protos.google.firestore.admin.v1.IListIndexesRequest, - options?: CallOptions - ): AsyncIterable; - /** - * Lists the field configuration and metadata for this database. - * - * Currently, {@link google.firestore.admin.v1.FirestoreAdmin.ListFields|FirestoreAdmin.ListFields} only supports listing fields - * that have been explicitly overridden. To issue this query, call - * {@link google.firestore.admin.v1.FirestoreAdmin.ListFields|FirestoreAdmin.ListFields} with the filter set to - * `indexConfig.usesAncestorConfig:false` . - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. A parent name of the form - * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}` - * @param {string} request.filter - * The filter to apply to list results. Currently, - * {@link google.firestore.admin.v1.FirestoreAdmin.ListFields|FirestoreAdmin.ListFields} only supports listing fields - * that have been explicitly overridden. To issue this query, call - * {@link google.firestore.admin.v1.FirestoreAdmin.ListFields|FirestoreAdmin.ListFields} with a filter that includes - * `indexConfig.usesAncestorConfig:false` . - * @param {number} request.pageSize - * The number of results to return. - * @param {string} request.pageToken - * A page token, returned from a previous call to - * {@link google.firestore.admin.v1.FirestoreAdmin.ListFields|FirestoreAdmin.ListFields}, that may be used to get the next - * page of results. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [Field]{@link google.firestore.admin.v1.Field}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listFieldsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listFields( - request?: protos.google.firestore.admin.v1.IListFieldsRequest, - options?: CallOptions - ): Promise< - [ - protos.google.firestore.admin.v1.IField[], - protos.google.firestore.admin.v1.IListFieldsRequest | null, - protos.google.firestore.admin.v1.IListFieldsResponse - ] - >; - listFields( - request: protos.google.firestore.admin.v1.IListFieldsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.firestore.admin.v1.IListFieldsRequest, - protos.google.firestore.admin.v1.IListFieldsResponse | null | undefined, - protos.google.firestore.admin.v1.IField - > - ): void; - listFields( - request: protos.google.firestore.admin.v1.IListFieldsRequest, - callback: PaginationCallback< - protos.google.firestore.admin.v1.IListFieldsRequest, - protos.google.firestore.admin.v1.IListFieldsResponse | null | undefined, - protos.google.firestore.admin.v1.IField - > - ): void; - /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. A parent name of the form - * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}` - * @param {string} request.filter - * The filter to apply to list results. Currently, - * {@link google.firestore.admin.v1.FirestoreAdmin.ListFields|FirestoreAdmin.ListFields} only supports listing fields - * that have been explicitly overridden. To issue this query, call - * {@link google.firestore.admin.v1.FirestoreAdmin.ListFields|FirestoreAdmin.ListFields} with a filter that includes - * `indexConfig.usesAncestorConfig:false` . - * @param {number} request.pageSize - * The number of results to return. - * @param {string} request.pageToken - * A page token, returned from a previous call to - * {@link google.firestore.admin.v1.FirestoreAdmin.ListFields|FirestoreAdmin.ListFields}, that may be used to get the next - * page of results. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing [Field]{@link google.firestore.admin.v1.Field} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listFieldsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listFieldsStream( - request?: protos.google.firestore.admin.v1.IListFieldsRequest, - options?: CallOptions - ): Transform; - /** - * Equivalent to `listFields`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. A parent name of the form - * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}` - * @param {string} request.filter - * The filter to apply to list results. Currently, - * {@link google.firestore.admin.v1.FirestoreAdmin.ListFields|FirestoreAdmin.ListFields} only supports listing fields - * that have been explicitly overridden. To issue this query, call - * {@link google.firestore.admin.v1.FirestoreAdmin.ListFields|FirestoreAdmin.ListFields} with a filter that includes - * `indexConfig.usesAncestorConfig:false` . - * @param {number} request.pageSize - * The number of results to return. - * @param {string} request.pageToken - * A page token, returned from a previous call to - * {@link google.firestore.admin.v1.FirestoreAdmin.ListFields|FirestoreAdmin.ListFields}, that may be used to get the next - * page of results. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). - * When you iterate the returned iterable, each element will be an object representing - * [Field]{@link google.firestore.admin.v1.Field}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - * @example include:samples/generated/v1/firestore_admin.list_fields.js - * region_tag:firestore_v1_generated_FirestoreAdmin_ListFields_async - */ - listFieldsAsync( - request?: protos.google.firestore.admin.v1.IListFieldsRequest, - options?: CallOptions - ): AsyncIterable; - /** - * Return a fully-qualified collectionGroup resource name string. - * - * @param {string} project - * @param {string} database - * @param {string} collection - * @returns {string} Resource name string. - */ - collectionGroupPath( - project: string, - database: string, - collection: string - ): string; - /** - * Parse the project from CollectionGroup resource. - * - * @param {string} collectionGroupName - * A fully-qualified path representing CollectionGroup resource. - * @returns {string} A string representing the project. - */ - matchProjectFromCollectionGroupName( - collectionGroupName: string - ): string | number; - /** - * Parse the database from CollectionGroup resource. - * - * @param {string} collectionGroupName - * A fully-qualified path representing CollectionGroup resource. - * @returns {string} A string representing the database. - */ - matchDatabaseFromCollectionGroupName( - collectionGroupName: string - ): string | number; - /** - * Parse the collection from CollectionGroup resource. - * - * @param {string} collectionGroupName - * A fully-qualified path representing CollectionGroup resource. - * @returns {string} A string representing the collection. - */ - matchCollectionFromCollectionGroupName( - collectionGroupName: string - ): string | number; - /** - * Return a fully-qualified database resource name string. - * - * @param {string} project - * @param {string} database - * @returns {string} Resource name string. - */ - databasePath(project: string, database: string): string; - /** - * Parse the project from Database resource. - * - * @param {string} databaseName - * A fully-qualified path representing Database resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDatabaseName(databaseName: string): string | number; - /** - * Parse the database from Database resource. - * - * @param {string} databaseName - * A fully-qualified path representing Database resource. - * @returns {string} A string representing the database. - */ - matchDatabaseFromDatabaseName(databaseName: string): string | number; - /** - * Return a fully-qualified field resource name string. - * - * @param {string} project - * @param {string} database - * @param {string} collection - * @param {string} field - * @returns {string} Resource name string. - */ - fieldPath( - project: string, - database: string, - collection: string, - field: string - ): string; - /** - * Parse the project from Field resource. - * - * @param {string} fieldName - * A fully-qualified path representing Field resource. - * @returns {string} A string representing the project. - */ - matchProjectFromFieldName(fieldName: string): string | number; - /** - * Parse the database from Field resource. - * - * @param {string} fieldName - * A fully-qualified path representing Field resource. - * @returns {string} A string representing the database. - */ - matchDatabaseFromFieldName(fieldName: string): string | number; - /** - * Parse the collection from Field resource. - * - * @param {string} fieldName - * A fully-qualified path representing Field resource. - * @returns {string} A string representing the collection. - */ - matchCollectionFromFieldName(fieldName: string): string | number; - /** - * Parse the field from Field resource. - * - * @param {string} fieldName - * A fully-qualified path representing Field resource. - * @returns {string} A string representing the field. - */ - matchFieldFromFieldName(fieldName: string): string | number; - /** - * Return a fully-qualified index resource name string. - * - * @param {string} project - * @param {string} database - * @param {string} collection - * @param {string} index - * @returns {string} Resource name string. - */ - indexPath( - project: string, - database: string, - collection: string, - index: string - ): string; - /** - * Parse the project from Index resource. - * - * @param {string} indexName - * A fully-qualified path representing Index resource. - * @returns {string} A string representing the project. - */ - matchProjectFromIndexName(indexName: string): string | number; - /** - * Parse the database from Index resource. - * - * @param {string} indexName - * A fully-qualified path representing Index resource. - * @returns {string} A string representing the database. - */ - matchDatabaseFromIndexName(indexName: string): string | number; - /** - * Parse the collection from Index resource. - * - * @param {string} indexName - * A fully-qualified path representing Index resource. - * @returns {string} A string representing the collection. - */ - matchCollectionFromIndexName(indexName: string): string | number; - /** - * Parse the index from Index resource. - * - * @param {string} indexName - * A fully-qualified path representing Index resource. - * @returns {string} A string representing the index. - */ - matchIndexFromIndexName(indexName: string): string | number; - /** - * Return a fully-qualified project resource name string. - * - * @param {string} project - * @returns {string} Resource name string. - */ - projectPath(project: string): string; - /** - * Parse the project from Project resource. - * - * @param {string} projectName - * A fully-qualified path representing Project resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectName(projectName: string): string | number; - /** - * Terminate the gRPC channel and close the client. - * - * The client will no longer be usable and all future behavior is undefined. - * @returns {Promise} A promise that resolves when the client is closed. - */ - close(): Promise; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/firestore/types/v1/firestore_client.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/firestore/types/v1/firestore_client.d.ts deleted file mode 100644 index 4d57c387..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/firestore/types/v1/firestore_client.d.ts +++ /dev/null @@ -1,1203 +0,0 @@ -/*! - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/// -import * as gax from 'google-gax'; -import { - Callback, - CallOptions, - Descriptors, - ClientOptions, - PaginationCallback, -} from 'google-gax'; -import {Transform} from 'stream'; -import * as protos from '../protos/firestore_v1_proto_api'; -/** - * The Cloud Firestore service. - * - * Cloud Firestore is a fast, fully managed, serverless, cloud-native NoSQL - * document database that simplifies storing, syncing, and querying data for - * your mobile, web, and IoT apps at global scale. Its client libraries provide - * live synchronization and offline support, while its security features and - * integrations with Firebase and Google Cloud Platform (GCP) accelerate - * building truly serverless apps. - * @class - * @memberof v1 - */ -export declare class FirestoreClient { - private _terminated; - private _opts; - private _providedCustomServicePath; - private _gaxModule; - private _gaxGrpc; - private _protos; - private _defaults; - auth: gax.GoogleAuth; - descriptors: Descriptors; - warn: (code: string, message: string, warnType?: string) => void; - innerApiCalls: { - [name: string]: Function; - }; - firestoreStub?: Promise<{ - [name: string]: Function; - }>; - /** - * Construct an instance of FirestoreClient. - * - * @param {object} [options] - The configuration object. - * The options accepted by the constructor are described in detail - * in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance). - * The common options are: - * @param {object} [options.credentials] - Credentials object. - * @param {string} [options.credentials.client_email] - * @param {string} [options.credentials.private_key] - * @param {string} [options.email] - Account email address. Required when - * using a .pem or .p12 keyFilename. - * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or - * .p12 key downloaded from the Google Developers Console. If you provide - * a path to a JSON file, the projectId option below is not necessary. - * NOTE: .pem and .p12 require you to specify options.email as well. - * @param {number} [options.port] - The port on which to connect to - * the remote host. - * @param {string} [options.projectId] - The project ID from the Google - * Developer's Console, e.g. 'grape-spaceship-123'. We will also check - * the environment variable GCLOUD_PROJECT for your project ID. If your - * app is running in an environment which supports - * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, - * your project ID will be detected automatically. - * @param {string} [options.apiEndpoint] - The domain name of the - * API remote host. - * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. - * Follows the structure of {@link gapicConfig}. - * @param {boolean} [options.fallback] - Use HTTP fallback mode. - * In fallback mode, a special browser-compatible transport implementation is used - * instead of gRPC transport. In browser context (if the `window` object is defined) - * the fallback mode is enabled automatically; set `options.fallback` to `false` - * if you need to override this behavior. - */ - constructor(opts?: ClientOptions); - /** - * Initialize the client. - * Performs asynchronous operations (such as authentication) and prepares the client. - * This function will be called automatically when any class method is called for the - * first time, but if you need to initialize it before calling an actual method, - * feel free to call initialize() directly. - * - * You can await on this method if you want to make sure the client is initialized. - * - * @returns {Promise} A promise that resolves to an authenticated service stub. - */ - initialize(): Promise<{ - [name: string]: Function; - }>; - /** - * The DNS address for this API service. - * @returns {string} The DNS address for this service. - */ - static get servicePath(): string; - /** - * The DNS address for this API service - same as servicePath(), - * exists for compatibility reasons. - * @returns {string} The DNS address for this service. - */ - static get apiEndpoint(): string; - /** - * The port for this API service. - * @returns {number} The default port for this service. - */ - static get port(): number; - /** - * The scopes needed to make gRPC calls for every method defined - * in this service. - * @returns {string[]} List of default scopes. - */ - static get scopes(): string[]; - getProjectId(): Promise; - getProjectId(callback: Callback): void; - /** - * Gets a single document. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name of the Document to get. In the format: - * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - * @param {google.firestore.v1.DocumentMask} request.mask - * The fields to return. If not set, returns all fields. - * - * If the document has a field that is not present in this mask, that field - * will not be returned in the response. - * @param {Buffer} request.transaction - * Reads the document in a transaction. - * @param {google.protobuf.Timestamp} request.readTime - * Reads the version of the document at the given time. - * This may not be older than 270 seconds. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Document]{@link google.firestore.v1.Document}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1/firestore.get_document.js - * region_tag:firestore_v1_generated_Firestore_GetDocument_async - */ - getDocument( - request?: protos.google.firestore.v1.IGetDocumentRequest, - options?: CallOptions - ): Promise< - [ - protos.google.firestore.v1.IDocument, - protos.google.firestore.v1.IGetDocumentRequest | undefined, - {} | undefined - ] - >; - getDocument( - request: protos.google.firestore.v1.IGetDocumentRequest, - options: CallOptions, - callback: Callback< - protos.google.firestore.v1.IDocument, - protos.google.firestore.v1.IGetDocumentRequest | null | undefined, - {} | null | undefined - > - ): void; - getDocument( - request: protos.google.firestore.v1.IGetDocumentRequest, - callback: Callback< - protos.google.firestore.v1.IDocument, - protos.google.firestore.v1.IGetDocumentRequest | null | undefined, - {} | null | undefined - > - ): void; - /** - * Updates or inserts a document. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.firestore.v1.Document} request.document - * Required. The updated document. - * Creates the document if it does not already exist. - * @param {google.firestore.v1.DocumentMask} request.updateMask - * The fields to update. - * None of the field paths in the mask may contain a reserved name. - * - * If the document exists on the server and has fields not referenced in the - * mask, they are left unchanged. - * Fields referenced in the mask, but not present in the input document, are - * deleted from the document on the server. - * @param {google.firestore.v1.DocumentMask} request.mask - * The fields to return. If not set, returns all fields. - * - * If the document has a field that is not present in this mask, that field - * will not be returned in the response. - * @param {google.firestore.v1.Precondition} request.currentDocument - * An optional precondition on the document. - * The request will fail if this is set and not met by the target document. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Document]{@link google.firestore.v1.Document}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1/firestore.update_document.js - * region_tag:firestore_v1_generated_Firestore_UpdateDocument_async - */ - updateDocument( - request?: protos.google.firestore.v1.IUpdateDocumentRequest, - options?: CallOptions - ): Promise< - [ - protos.google.firestore.v1.IDocument, - protos.google.firestore.v1.IUpdateDocumentRequest | undefined, - {} | undefined - ] - >; - updateDocument( - request: protos.google.firestore.v1.IUpdateDocumentRequest, - options: CallOptions, - callback: Callback< - protos.google.firestore.v1.IDocument, - protos.google.firestore.v1.IUpdateDocumentRequest | null | undefined, - {} | null | undefined - > - ): void; - updateDocument( - request: protos.google.firestore.v1.IUpdateDocumentRequest, - callback: Callback< - protos.google.firestore.v1.IDocument, - protos.google.firestore.v1.IUpdateDocumentRequest | null | undefined, - {} | null | undefined - > - ): void; - /** - * Deletes a document. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name of the Document to delete. In the format: - * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - * @param {google.firestore.v1.Precondition} request.currentDocument - * An optional precondition on the document. - * The request will fail if this is set and not met by the target document. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1/firestore.delete_document.js - * region_tag:firestore_v1_generated_Firestore_DeleteDocument_async - */ - deleteDocument( - request?: protos.google.firestore.v1.IDeleteDocumentRequest, - options?: CallOptions - ): Promise< - [ - protos.google.protobuf.IEmpty, - protos.google.firestore.v1.IDeleteDocumentRequest | undefined, - {} | undefined - ] - >; - deleteDocument( - request: protos.google.firestore.v1.IDeleteDocumentRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.firestore.v1.IDeleteDocumentRequest | null | undefined, - {} | null | undefined - > - ): void; - deleteDocument( - request: protos.google.firestore.v1.IDeleteDocumentRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.firestore.v1.IDeleteDocumentRequest | null | undefined, - {} | null | undefined - > - ): void; - /** - * Starts a new transaction. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.database - * Required. The database name. In the format: - * `projects/{project_id}/databases/{database_id}`. - * @param {google.firestore.v1.TransactionOptions} request.options - * The options for the transaction. - * Defaults to a read-write transaction. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [BeginTransactionResponse]{@link google.firestore.v1.BeginTransactionResponse}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1/firestore.begin_transaction.js - * region_tag:firestore_v1_generated_Firestore_BeginTransaction_async - */ - beginTransaction( - request?: protos.google.firestore.v1.IBeginTransactionRequest, - options?: CallOptions - ): Promise< - [ - protos.google.firestore.v1.IBeginTransactionResponse, - protos.google.firestore.v1.IBeginTransactionRequest | undefined, - {} | undefined - ] - >; - beginTransaction( - request: protos.google.firestore.v1.IBeginTransactionRequest, - options: CallOptions, - callback: Callback< - protos.google.firestore.v1.IBeginTransactionResponse, - protos.google.firestore.v1.IBeginTransactionRequest | null | undefined, - {} | null | undefined - > - ): void; - beginTransaction( - request: protos.google.firestore.v1.IBeginTransactionRequest, - callback: Callback< - protos.google.firestore.v1.IBeginTransactionResponse, - protos.google.firestore.v1.IBeginTransactionRequest | null | undefined, - {} | null | undefined - > - ): void; - /** - * Commits a transaction, while optionally updating documents. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.database - * Required. The database name. In the format: - * `projects/{project_id}/databases/{database_id}`. - * @param {number[]} request.writes - * The writes to apply. - * - * Always executed atomically and in order. - * @param {Buffer} request.transaction - * If set, applies all writes in this transaction, and commits it. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [CommitResponse]{@link google.firestore.v1.CommitResponse}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1/firestore.commit.js - * region_tag:firestore_v1_generated_Firestore_Commit_async - */ - commit( - request?: protos.google.firestore.v1.ICommitRequest, - options?: CallOptions - ): Promise< - [ - protos.google.firestore.v1.ICommitResponse, - protos.google.firestore.v1.ICommitRequest | undefined, - {} | undefined - ] - >; - commit( - request: protos.google.firestore.v1.ICommitRequest, - options: CallOptions, - callback: Callback< - protos.google.firestore.v1.ICommitResponse, - protos.google.firestore.v1.ICommitRequest | null | undefined, - {} | null | undefined - > - ): void; - commit( - request: protos.google.firestore.v1.ICommitRequest, - callback: Callback< - protos.google.firestore.v1.ICommitResponse, - protos.google.firestore.v1.ICommitRequest | null | undefined, - {} | null | undefined - > - ): void; - /** - * Rolls back a transaction. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.database - * Required. The database name. In the format: - * `projects/{project_id}/databases/{database_id}`. - * @param {Buffer} request.transaction - * Required. The transaction to roll back. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1/firestore.rollback.js - * region_tag:firestore_v1_generated_Firestore_Rollback_async - */ - rollback( - request?: protos.google.firestore.v1.IRollbackRequest, - options?: CallOptions - ): Promise< - [ - protos.google.protobuf.IEmpty, - protos.google.firestore.v1.IRollbackRequest | undefined, - {} | undefined - ] - >; - rollback( - request: protos.google.firestore.v1.IRollbackRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.firestore.v1.IRollbackRequest | null | undefined, - {} | null | undefined - > - ): void; - rollback( - request: protos.google.firestore.v1.IRollbackRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.firestore.v1.IRollbackRequest | null | undefined, - {} | null | undefined - > - ): void; - /** - * Applies a batch of write operations. - * - * The BatchWrite method does not apply the write operations atomically - * and can apply them out of order. Method does not allow more than one write - * per document. Each write succeeds or fails independently. See the - * {@link google.firestore.v1.BatchWriteResponse|BatchWriteResponse} for the success status of each write. - * - * If you require an atomically applied set of writes, use - * {@link google.firestore.v1.Firestore.Commit|Commit} instead. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.database - * Required. The database name. In the format: - * `projects/{project_id}/databases/{database_id}`. - * @param {number[]} request.writes - * The writes to apply. - * - * Method does not apply writes atomically and does not guarantee ordering. - * Each write succeeds or fails independently. You cannot write to the same - * document more than once per request. - * @param {number[]} request.labels - * Labels associated with this batch write. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [BatchWriteResponse]{@link google.firestore.v1.BatchWriteResponse}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1/firestore.batch_write.js - * region_tag:firestore_v1_generated_Firestore_BatchWrite_async - */ - batchWrite( - request?: protos.google.firestore.v1.IBatchWriteRequest, - options?: CallOptions - ): Promise< - [ - protos.google.firestore.v1.IBatchWriteResponse, - protos.google.firestore.v1.IBatchWriteRequest | undefined, - {} | undefined - ] - >; - batchWrite( - request: protos.google.firestore.v1.IBatchWriteRequest, - options: CallOptions, - callback: Callback< - protos.google.firestore.v1.IBatchWriteResponse, - protos.google.firestore.v1.IBatchWriteRequest | null | undefined, - {} | null | undefined - > - ): void; - batchWrite( - request: protos.google.firestore.v1.IBatchWriteRequest, - callback: Callback< - protos.google.firestore.v1.IBatchWriteResponse, - protos.google.firestore.v1.IBatchWriteRequest | null | undefined, - {} | null | undefined - > - ): void; - /** - * Creates a new document. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent resource. For example: - * `projects/{project_id}/databases/{database_id}/documents` or - * `projects/{project_id}/databases/{database_id}/documents/chatrooms/{chatroom_id}` - * @param {string} request.collectionId - * Required. The collection ID, relative to `parent`, to list. For example: `chatrooms`. - * @param {string} request.documentId - * The client-assigned document ID to use for this document. - * - * Optional. If not specified, an ID will be assigned by the service. - * @param {google.firestore.v1.Document} request.document - * Required. The document to create. `name` must not be set. - * @param {google.firestore.v1.DocumentMask} request.mask - * The fields to return. If not set, returns all fields. - * - * If the document has a field that is not present in this mask, that field - * will not be returned in the response. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Document]{@link google.firestore.v1.Document}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1/firestore.create_document.js - * region_tag:firestore_v1_generated_Firestore_CreateDocument_async - */ - createDocument( - request?: protos.google.firestore.v1.ICreateDocumentRequest, - options?: CallOptions - ): Promise< - [ - protos.google.firestore.v1.IDocument, - protos.google.firestore.v1.ICreateDocumentRequest | undefined, - {} | undefined - ] - >; - createDocument( - request: protos.google.firestore.v1.ICreateDocumentRequest, - options: CallOptions, - callback: Callback< - protos.google.firestore.v1.IDocument, - protos.google.firestore.v1.ICreateDocumentRequest | null | undefined, - {} | null | undefined - > - ): void; - createDocument( - request: protos.google.firestore.v1.ICreateDocumentRequest, - callback: Callback< - protos.google.firestore.v1.IDocument, - protos.google.firestore.v1.ICreateDocumentRequest | null | undefined, - {} | null | undefined - > - ): void; - /** - * Gets multiple documents. - * - * Documents returned by this method are not guaranteed to be returned in the - * same order that they were requested. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.database - * Required. The database name. In the format: - * `projects/{project_id}/databases/{database_id}`. - * @param {string[]} request.documents - * The names of the documents to retrieve. In the format: - * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - * The request will fail if any of the document is not a child resource of the - * given `database`. Duplicate names will be elided. - * @param {google.firestore.v1.DocumentMask} request.mask - * The fields to return. If not set, returns all fields. - * - * If a document has a field that is not present in this mask, that field will - * not be returned in the response. - * @param {Buffer} request.transaction - * Reads documents in a transaction. - * @param {google.firestore.v1.TransactionOptions} request.newTransaction - * Starts a new transaction and reads the documents. - * Defaults to a read-only transaction. - * The new transaction ID will be returned as the first response in the - * stream. - * @param {google.protobuf.Timestamp} request.readTime - * Reads documents as they were at the given time. - * This may not be older than 270 seconds. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits [BatchGetDocumentsResponse]{@link google.firestore.v1.BatchGetDocumentsResponse} on 'data' event. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#server-streaming) - * for more details and examples. - * @example include:samples/generated/v1/firestore.batch_get_documents.js - * region_tag:firestore_v1_generated_Firestore_BatchGetDocuments_async - */ - batchGetDocuments( - request?: protos.google.firestore.v1.IBatchGetDocumentsRequest, - options?: CallOptions - ): gax.CancellableStream; - /** - * Runs a query. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent resource name. In the format: - * `projects/{project_id}/databases/{database_id}/documents` or - * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - * For example: - * `projects/my-project/databases/my-database/documents` or - * `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` - * @param {google.firestore.v1.StructuredQuery} request.structuredQuery - * A structured query. - * @param {Buffer} request.transaction - * Reads documents in a transaction. - * @param {google.firestore.v1.TransactionOptions} request.newTransaction - * Starts a new transaction and reads the documents. - * Defaults to a read-only transaction. - * The new transaction ID will be returned as the first response in the - * stream. - * @param {google.protobuf.Timestamp} request.readTime - * Reads documents as they were at the given time. - * This may not be older than 270 seconds. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits [RunQueryResponse]{@link google.firestore.v1.RunQueryResponse} on 'data' event. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#server-streaming) - * for more details and examples. - * @example include:samples/generated/v1/firestore.run_query.js - * region_tag:firestore_v1_generated_Firestore_RunQuery_async - */ - runQuery( - request?: protos.google.firestore.v1.IRunQueryRequest, - options?: CallOptions - ): gax.CancellableStream; - /** - * Streams batches of document updates and deletes, in order. - * - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which is both readable and writable. It accepts objects - * representing [WriteRequest]{@link google.firestore.v1.WriteRequest} for write() method, and - * will emit objects representing [WriteResponse]{@link google.firestore.v1.WriteResponse} on 'data' event asynchronously. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#bi-directional-streaming) - * for more details and examples. - * @example include:samples/generated/v1/firestore.write.js - * region_tag:firestore_v1_generated_Firestore_Write_async - */ - write(options?: CallOptions): gax.CancellableStream; - /** - * Listens to changes. - * - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which is both readable and writable. It accepts objects - * representing [ListenRequest]{@link google.firestore.v1.ListenRequest} for write() method, and - * will emit objects representing [ListenResponse]{@link google.firestore.v1.ListenResponse} on 'data' event asynchronously. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#bi-directional-streaming) - * for more details and examples. - * @example include:samples/generated/v1/firestore.listen.js - * region_tag:firestore_v1_generated_Firestore_Listen_async - */ - listen(options?: CallOptions): gax.CancellableStream; - /** - * Lists documents. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent resource name. In the format: - * `projects/{project_id}/databases/{database_id}/documents` or - * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - * For example: - * `projects/my-project/databases/my-database/documents` or - * `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` - * @param {string} request.collectionId - * Required. The collection ID, relative to `parent`, to list. For example: `chatrooms` - * or `messages`. - * @param {number} request.pageSize - * The maximum number of documents to return. - * @param {string} request.pageToken - * The `next_page_token` value returned from a previous List request, if any. - * @param {string} request.orderBy - * The order to sort results by. For example: `priority desc, name`. - * @param {google.firestore.v1.DocumentMask} request.mask - * The fields to return. If not set, returns all fields. - * - * If a document has a field that is not present in this mask, that field - * will not be returned in the response. - * @param {Buffer} request.transaction - * Reads documents in a transaction. - * @param {google.protobuf.Timestamp} request.readTime - * Reads documents as they were at the given time. - * This may not be older than 270 seconds. - * @param {boolean} request.showMissing - * If the list should show missing documents. A missing document is a - * document that does not exist but has sub-documents. These documents will - * be returned with a key but will not have fields, {@link google.firestore.v1.Document.create_time|Document.create_time}, - * or {@link google.firestore.v1.Document.update_time|Document.update_time} set. - * - * Requests with `show_missing` may not specify `where` or - * `order_by`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [Document]{@link google.firestore.v1.Document}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listDocumentsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listDocuments( - request?: protos.google.firestore.v1.IListDocumentsRequest, - options?: CallOptions - ): Promise< - [ - protos.google.firestore.v1.IDocument[], - protos.google.firestore.v1.IListDocumentsRequest | null, - protos.google.firestore.v1.IListDocumentsResponse - ] - >; - listDocuments( - request: protos.google.firestore.v1.IListDocumentsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.firestore.v1.IListDocumentsRequest, - protos.google.firestore.v1.IListDocumentsResponse | null | undefined, - protos.google.firestore.v1.IDocument - > - ): void; - listDocuments( - request: protos.google.firestore.v1.IListDocumentsRequest, - callback: PaginationCallback< - protos.google.firestore.v1.IListDocumentsRequest, - protos.google.firestore.v1.IListDocumentsResponse | null | undefined, - protos.google.firestore.v1.IDocument - > - ): void; - /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent resource name. In the format: - * `projects/{project_id}/databases/{database_id}/documents` or - * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - * For example: - * `projects/my-project/databases/my-database/documents` or - * `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` - * @param {string} request.collectionId - * Required. The collection ID, relative to `parent`, to list. For example: `chatrooms` - * or `messages`. - * @param {number} request.pageSize - * The maximum number of documents to return. - * @param {string} request.pageToken - * The `next_page_token` value returned from a previous List request, if any. - * @param {string} request.orderBy - * The order to sort results by. For example: `priority desc, name`. - * @param {google.firestore.v1.DocumentMask} request.mask - * The fields to return. If not set, returns all fields. - * - * If a document has a field that is not present in this mask, that field - * will not be returned in the response. - * @param {Buffer} request.transaction - * Reads documents in a transaction. - * @param {google.protobuf.Timestamp} request.readTime - * Reads documents as they were at the given time. - * This may not be older than 270 seconds. - * @param {boolean} request.showMissing - * If the list should show missing documents. A missing document is a - * document that does not exist but has sub-documents. These documents will - * be returned with a key but will not have fields, {@link google.firestore.v1.Document.create_time|Document.create_time}, - * or {@link google.firestore.v1.Document.update_time|Document.update_time} set. - * - * Requests with `show_missing` may not specify `where` or - * `order_by`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing [Document]{@link google.firestore.v1.Document} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listDocumentsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listDocumentsStream( - request?: protos.google.firestore.v1.IListDocumentsRequest, - options?: CallOptions - ): Transform; - /** - * Equivalent to `listDocuments`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent resource name. In the format: - * `projects/{project_id}/databases/{database_id}/documents` or - * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - * For example: - * `projects/my-project/databases/my-database/documents` or - * `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` - * @param {string} request.collectionId - * Required. The collection ID, relative to `parent`, to list. For example: `chatrooms` - * or `messages`. - * @param {number} request.pageSize - * The maximum number of documents to return. - * @param {string} request.pageToken - * The `next_page_token` value returned from a previous List request, if any. - * @param {string} request.orderBy - * The order to sort results by. For example: `priority desc, name`. - * @param {google.firestore.v1.DocumentMask} request.mask - * The fields to return. If not set, returns all fields. - * - * If a document has a field that is not present in this mask, that field - * will not be returned in the response. - * @param {Buffer} request.transaction - * Reads documents in a transaction. - * @param {google.protobuf.Timestamp} request.readTime - * Reads documents as they were at the given time. - * This may not be older than 270 seconds. - * @param {boolean} request.showMissing - * If the list should show missing documents. A missing document is a - * document that does not exist but has sub-documents. These documents will - * be returned with a key but will not have fields, {@link google.firestore.v1.Document.create_time|Document.create_time}, - * or {@link google.firestore.v1.Document.update_time|Document.update_time} set. - * - * Requests with `show_missing` may not specify `where` or - * `order_by`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). - * When you iterate the returned iterable, each element will be an object representing - * [Document]{@link google.firestore.v1.Document}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - * @example include:samples/generated/v1/firestore.list_documents.js - * region_tag:firestore_v1_generated_Firestore_ListDocuments_async - */ - listDocumentsAsync( - request?: protos.google.firestore.v1.IListDocumentsRequest, - options?: CallOptions - ): AsyncIterable; - /** - * Partitions a query by returning partition cursors that can be used to run - * the query in parallel. The returned partition cursors are split points that - * can be used by RunQuery as starting/end points for the query results. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent resource name. In the format: - * `projects/{project_id}/databases/{database_id}/documents`. - * Document resource names are not supported; only database resource names - * can be specified. - * @param {google.firestore.v1.StructuredQuery} request.structuredQuery - * A structured query. - * Query must specify collection with all descendants and be ordered by name - * ascending. Other filters, order bys, limits, offsets, and start/end - * cursors are not supported. - * @param {number} request.partitionCount - * The desired maximum number of partition points. - * The partitions may be returned across multiple pages of results. - * The number must be positive. The actual number of partitions - * returned may be fewer. - * - * For example, this may be set to one fewer than the number of parallel - * queries to be run, or in running a data pipeline job, one fewer than the - * number of workers or compute instances available. - * @param {string} request.pageToken - * The `next_page_token` value returned from a previous call to - * PartitionQuery that may be used to get an additional set of results. - * There are no ordering guarantees between sets of results. Thus, using - * multiple sets of results will require merging the different result sets. - * - * For example, two subsequent calls using a page_token may return: - * - * * cursor B, cursor M, cursor Q - * * cursor A, cursor U, cursor W - * - * To obtain a complete result set ordered with respect to the results of the - * query supplied to PartitionQuery, the results sets should be merged: - * cursor A, cursor B, cursor M, cursor Q, cursor U, cursor W - * @param {number} request.pageSize - * The maximum number of partitions to return in this call, subject to - * `partition_count`. - * - * For example, if `partition_count` = 10 and `page_size` = 8, the first call - * to PartitionQuery will return up to 8 partitions and a `next_page_token` - * if more results exist. A second call to PartitionQuery will return up to - * 2 partitions, to complete the total of 10 specified in `partition_count`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [Cursor]{@link google.firestore.v1.Cursor}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `partitionQueryAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - partitionQuery( - request?: protos.google.firestore.v1.IPartitionQueryRequest, - options?: CallOptions - ): Promise< - [ - protos.google.firestore.v1.ICursor[], - protos.google.firestore.v1.IPartitionQueryRequest | null, - protos.google.firestore.v1.IPartitionQueryResponse - ] - >; - partitionQuery( - request: protos.google.firestore.v1.IPartitionQueryRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.firestore.v1.IPartitionQueryRequest, - protos.google.firestore.v1.IPartitionQueryResponse | null | undefined, - protos.google.firestore.v1.ICursor - > - ): void; - partitionQuery( - request: protos.google.firestore.v1.IPartitionQueryRequest, - callback: PaginationCallback< - protos.google.firestore.v1.IPartitionQueryRequest, - protos.google.firestore.v1.IPartitionQueryResponse | null | undefined, - protos.google.firestore.v1.ICursor - > - ): void; - /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent resource name. In the format: - * `projects/{project_id}/databases/{database_id}/documents`. - * Document resource names are not supported; only database resource names - * can be specified. - * @param {google.firestore.v1.StructuredQuery} request.structuredQuery - * A structured query. - * Query must specify collection with all descendants and be ordered by name - * ascending. Other filters, order bys, limits, offsets, and start/end - * cursors are not supported. - * @param {number} request.partitionCount - * The desired maximum number of partition points. - * The partitions may be returned across multiple pages of results. - * The number must be positive. The actual number of partitions - * returned may be fewer. - * - * For example, this may be set to one fewer than the number of parallel - * queries to be run, or in running a data pipeline job, one fewer than the - * number of workers or compute instances available. - * @param {string} request.pageToken - * The `next_page_token` value returned from a previous call to - * PartitionQuery that may be used to get an additional set of results. - * There are no ordering guarantees between sets of results. Thus, using - * multiple sets of results will require merging the different result sets. - * - * For example, two subsequent calls using a page_token may return: - * - * * cursor B, cursor M, cursor Q - * * cursor A, cursor U, cursor W - * - * To obtain a complete result set ordered with respect to the results of the - * query supplied to PartitionQuery, the results sets should be merged: - * cursor A, cursor B, cursor M, cursor Q, cursor U, cursor W - * @param {number} request.pageSize - * The maximum number of partitions to return in this call, subject to - * `partition_count`. - * - * For example, if `partition_count` = 10 and `page_size` = 8, the first call - * to PartitionQuery will return up to 8 partitions and a `next_page_token` - * if more results exist. A second call to PartitionQuery will return up to - * 2 partitions, to complete the total of 10 specified in `partition_count`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing [Cursor]{@link google.firestore.v1.Cursor} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `partitionQueryAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - partitionQueryStream( - request?: protos.google.firestore.v1.IPartitionQueryRequest, - options?: CallOptions - ): Transform; - /** - * Equivalent to `partitionQuery`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent resource name. In the format: - * `projects/{project_id}/databases/{database_id}/documents`. - * Document resource names are not supported; only database resource names - * can be specified. - * @param {google.firestore.v1.StructuredQuery} request.structuredQuery - * A structured query. - * Query must specify collection with all descendants and be ordered by name - * ascending. Other filters, order bys, limits, offsets, and start/end - * cursors are not supported. - * @param {number} request.partitionCount - * The desired maximum number of partition points. - * The partitions may be returned across multiple pages of results. - * The number must be positive. The actual number of partitions - * returned may be fewer. - * - * For example, this may be set to one fewer than the number of parallel - * queries to be run, or in running a data pipeline job, one fewer than the - * number of workers or compute instances available. - * @param {string} request.pageToken - * The `next_page_token` value returned from a previous call to - * PartitionQuery that may be used to get an additional set of results. - * There are no ordering guarantees between sets of results. Thus, using - * multiple sets of results will require merging the different result sets. - * - * For example, two subsequent calls using a page_token may return: - * - * * cursor B, cursor M, cursor Q - * * cursor A, cursor U, cursor W - * - * To obtain a complete result set ordered with respect to the results of the - * query supplied to PartitionQuery, the results sets should be merged: - * cursor A, cursor B, cursor M, cursor Q, cursor U, cursor W - * @param {number} request.pageSize - * The maximum number of partitions to return in this call, subject to - * `partition_count`. - * - * For example, if `partition_count` = 10 and `page_size` = 8, the first call - * to PartitionQuery will return up to 8 partitions and a `next_page_token` - * if more results exist. A second call to PartitionQuery will return up to - * 2 partitions, to complete the total of 10 specified in `partition_count`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). - * When you iterate the returned iterable, each element will be an object representing - * [Cursor]{@link google.firestore.v1.Cursor}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - * @example include:samples/generated/v1/firestore.partition_query.js - * region_tag:firestore_v1_generated_Firestore_PartitionQuery_async - */ - partitionQueryAsync( - request?: protos.google.firestore.v1.IPartitionQueryRequest, - options?: CallOptions - ): AsyncIterable; - /** - * Lists all the collection IDs underneath a document. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent document. In the format: - * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - * For example: - * `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` - * @param {number} request.pageSize - * The maximum number of results to return. - * @param {string} request.pageToken - * A page token. Must be a value from - * {@link google.firestore.v1.ListCollectionIdsResponse|ListCollectionIdsResponse}. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of string. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listCollectionIdsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listCollectionIds( - request?: protos.google.firestore.v1.IListCollectionIdsRequest, - options?: CallOptions - ): Promise< - [ - string[], - protos.google.firestore.v1.IListCollectionIdsRequest | null, - protos.google.firestore.v1.IListCollectionIdsResponse - ] - >; - listCollectionIds( - request: protos.google.firestore.v1.IListCollectionIdsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.firestore.v1.IListCollectionIdsRequest, - protos.google.firestore.v1.IListCollectionIdsResponse | null | undefined, - string - > - ): void; - listCollectionIds( - request: protos.google.firestore.v1.IListCollectionIdsRequest, - callback: PaginationCallback< - protos.google.firestore.v1.IListCollectionIdsRequest, - protos.google.firestore.v1.IListCollectionIdsResponse | null | undefined, - string - > - ): void; - /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent document. In the format: - * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - * For example: - * `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` - * @param {number} request.pageSize - * The maximum number of results to return. - * @param {string} request.pageToken - * A page token. Must be a value from - * {@link google.firestore.v1.ListCollectionIdsResponse|ListCollectionIdsResponse}. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing string on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listCollectionIdsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listCollectionIdsStream( - request?: protos.google.firestore.v1.IListCollectionIdsRequest, - options?: CallOptions - ): Transform; - /** - * Equivalent to `listCollectionIds`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent document. In the format: - * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - * For example: - * `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` - * @param {number} request.pageSize - * The maximum number of results to return. - * @param {string} request.pageToken - * A page token. Must be a value from - * {@link google.firestore.v1.ListCollectionIdsResponse|ListCollectionIdsResponse}. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). - * When you iterate the returned iterable, each element will be an object representing - * string. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - * @example include:samples/generated/v1/firestore.list_collection_ids.js - * region_tag:firestore_v1_generated_Firestore_ListCollectionIds_async - */ - listCollectionIdsAsync( - request?: protos.google.firestore.v1.IListCollectionIdsRequest, - options?: CallOptions - ): AsyncIterable; - /** - * Terminate the gRPC channel and close the client. - * - * The client will no longer be usable and all future behavior is undefined. - * @returns {Promise} A promise that resolves when the client is closed. - */ - close(): Promise; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/firestore/types/v1beta1/firestore_client.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/firestore/types/v1beta1/firestore_client.d.ts deleted file mode 100644 index b925aff6..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/firestore/types/v1beta1/firestore_client.d.ts +++ /dev/null @@ -1,1216 +0,0 @@ -/*! - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/// -import * as gax from 'google-gax'; -import { - Callback, - CallOptions, - Descriptors, - ClientOptions, - PaginationCallback, -} from 'google-gax'; -import {Transform} from 'stream'; -import * as protos from '../protos/firestore_v1beta1_proto_api'; -/** - * The Cloud Firestore service. - * - * Cloud Firestore is a fast, fully managed, serverless, cloud-native NoSQL - * document database that simplifies storing, syncing, and querying data for - * your mobile, web, and IoT apps at global scale. Its client libraries provide - * live synchronization and offline support, while its security features and - * integrations with Firebase and Google Cloud Platform (GCP) accelerate - * building truly serverless apps. - * @class - * @deprecated Use v1/firestore_client instead. - * @memberof v1beta1 - */ -export declare class FirestoreClient { - private _terminated; - private _opts; - private _providedCustomServicePath; - private _gaxModule; - private _gaxGrpc; - private _protos; - private _defaults; - auth: gax.GoogleAuth; - descriptors: Descriptors; - warn: (code: string, message: string, warnType?: string) => void; - innerApiCalls: { - [name: string]: Function; - }; - firestoreStub?: Promise<{ - [name: string]: Function; - }>; - /** - * Construct an instance of FirestoreClient. - * - * @param {object} [options] - The configuration object. - * The options accepted by the constructor are described in detail - * in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance). - * The common options are: - * @param {object} [options.credentials] - Credentials object. - * @param {string} [options.credentials.client_email] - * @param {string} [options.credentials.private_key] - * @param {string} [options.email] - Account email address. Required when - * using a .pem or .p12 keyFilename. - * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or - * .p12 key downloaded from the Google Developers Console. If you provide - * a path to a JSON file, the projectId option below is not necessary. - * NOTE: .pem and .p12 require you to specify options.email as well. - * @param {number} [options.port] - The port on which to connect to - * the remote host. - * @param {string} [options.projectId] - The project ID from the Google - * Developer's Console, e.g. 'grape-spaceship-123'. We will also check - * the environment variable GCLOUD_PROJECT for your project ID. If your - * app is running in an environment which supports - * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, - * your project ID will be detected automatically. - * @param {string} [options.apiEndpoint] - The domain name of the - * API remote host. - * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. - * Follows the structure of {@link gapicConfig}. - * @param {boolean} [options.fallback] - Use HTTP fallback mode. - * In fallback mode, a special browser-compatible transport implementation is used - * instead of gRPC transport. In browser context (if the `window` object is defined) - * the fallback mode is enabled automatically; set `options.fallback` to `false` - * if you need to override this behavior. - */ - constructor(opts?: ClientOptions); - /** - * Initialize the client. - * Performs asynchronous operations (such as authentication) and prepares the client. - * This function will be called automatically when any class method is called for the - * first time, but if you need to initialize it before calling an actual method, - * feel free to call initialize() directly. - * - * You can await on this method if you want to make sure the client is initialized. - * - * @returns {Promise} A promise that resolves to an authenticated service stub. - */ - initialize(): Promise<{ - [name: string]: Function; - }>; - /** - * The DNS address for this API service. - * @returns {string} The DNS address for this service. - */ - static get servicePath(): string; - /** - * The DNS address for this API service - same as servicePath(), - * exists for compatibility reasons. - * @returns {string} The DNS address for this service. - */ - static get apiEndpoint(): string; - /** - * The port for this API service. - * @returns {number} The default port for this service. - */ - static get port(): number; - /** - * The scopes needed to make gRPC calls for every method defined - * in this service. - * @returns {string[]} List of default scopes. - */ - static get scopes(): string[]; - getProjectId(): Promise; - getProjectId(callback: Callback): void; - /** - * Gets a single document. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name of the Document to get. In the format: - * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - * @param {google.firestore.v1beta1.DocumentMask} request.mask - * The fields to return. If not set, returns all fields. - * - * If the document has a field that is not present in this mask, that field - * will not be returned in the response. - * @param {Buffer} request.transaction - * Reads the document in a transaction. - * @param {google.protobuf.Timestamp} request.readTime - * Reads the version of the document at the given time. - * This may not be older than 270 seconds. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Document]{@link google.firestore.v1beta1.Document}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1beta1/firestore.get_document.js - * region_tag:firestore_v1beta1_generated_Firestore_GetDocument_async - */ - getDocument( - request?: protos.google.firestore.v1beta1.IGetDocumentRequest, - options?: CallOptions - ): Promise< - [ - protos.google.firestore.v1beta1.IDocument, - protos.google.firestore.v1beta1.IGetDocumentRequest | undefined, - {} | undefined - ] - >; - getDocument( - request: protos.google.firestore.v1beta1.IGetDocumentRequest, - options: CallOptions, - callback: Callback< - protos.google.firestore.v1beta1.IDocument, - protos.google.firestore.v1beta1.IGetDocumentRequest | null | undefined, - {} | null | undefined - > - ): void; - getDocument( - request: protos.google.firestore.v1beta1.IGetDocumentRequest, - callback: Callback< - protos.google.firestore.v1beta1.IDocument, - protos.google.firestore.v1beta1.IGetDocumentRequest | null | undefined, - {} | null | undefined - > - ): void; - /** - * Updates or inserts a document. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.firestore.v1beta1.Document} request.document - * Required. The updated document. - * Creates the document if it does not already exist. - * @param {google.firestore.v1beta1.DocumentMask} request.updateMask - * The fields to update. - * None of the field paths in the mask may contain a reserved name. - * - * If the document exists on the server and has fields not referenced in the - * mask, they are left unchanged. - * Fields referenced in the mask, but not present in the input document, are - * deleted from the document on the server. - * @param {google.firestore.v1beta1.DocumentMask} request.mask - * The fields to return. If not set, returns all fields. - * - * If the document has a field that is not present in this mask, that field - * will not be returned in the response. - * @param {google.firestore.v1beta1.Precondition} request.currentDocument - * An optional precondition on the document. - * The request will fail if this is set and not met by the target document. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Document]{@link google.firestore.v1beta1.Document}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1beta1/firestore.update_document.js - * region_tag:firestore_v1beta1_generated_Firestore_UpdateDocument_async - */ - updateDocument( - request?: protos.google.firestore.v1beta1.IUpdateDocumentRequest, - options?: CallOptions - ): Promise< - [ - protos.google.firestore.v1beta1.IDocument, - protos.google.firestore.v1beta1.IUpdateDocumentRequest | undefined, - {} | undefined - ] - >; - updateDocument( - request: protos.google.firestore.v1beta1.IUpdateDocumentRequest, - options: CallOptions, - callback: Callback< - protos.google.firestore.v1beta1.IDocument, - protos.google.firestore.v1beta1.IUpdateDocumentRequest | null | undefined, - {} | null | undefined - > - ): void; - updateDocument( - request: protos.google.firestore.v1beta1.IUpdateDocumentRequest, - callback: Callback< - protos.google.firestore.v1beta1.IDocument, - protos.google.firestore.v1beta1.IUpdateDocumentRequest | null | undefined, - {} | null | undefined - > - ): void; - /** - * Deletes a document. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name of the Document to delete. In the format: - * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - * @param {google.firestore.v1beta1.Precondition} request.currentDocument - * An optional precondition on the document. - * The request will fail if this is set and not met by the target document. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1beta1/firestore.delete_document.js - * region_tag:firestore_v1beta1_generated_Firestore_DeleteDocument_async - */ - deleteDocument( - request?: protos.google.firestore.v1beta1.IDeleteDocumentRequest, - options?: CallOptions - ): Promise< - [ - protos.google.protobuf.IEmpty, - protos.google.firestore.v1beta1.IDeleteDocumentRequest | undefined, - {} | undefined - ] - >; - deleteDocument( - request: protos.google.firestore.v1beta1.IDeleteDocumentRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.firestore.v1beta1.IDeleteDocumentRequest | null | undefined, - {} | null | undefined - > - ): void; - deleteDocument( - request: protos.google.firestore.v1beta1.IDeleteDocumentRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.firestore.v1beta1.IDeleteDocumentRequest | null | undefined, - {} | null | undefined - > - ): void; - /** - * Starts a new transaction. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.database - * Required. The database name. In the format: - * `projects/{project_id}/databases/{database_id}`. - * @param {google.firestore.v1beta1.TransactionOptions} request.options - * The options for the transaction. - * Defaults to a read-write transaction. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [BeginTransactionResponse]{@link google.firestore.v1beta1.BeginTransactionResponse}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1beta1/firestore.begin_transaction.js - * region_tag:firestore_v1beta1_generated_Firestore_BeginTransaction_async - */ - beginTransaction( - request?: protos.google.firestore.v1beta1.IBeginTransactionRequest, - options?: CallOptions - ): Promise< - [ - protos.google.firestore.v1beta1.IBeginTransactionResponse, - protos.google.firestore.v1beta1.IBeginTransactionRequest | undefined, - {} | undefined - ] - >; - beginTransaction( - request: protos.google.firestore.v1beta1.IBeginTransactionRequest, - options: CallOptions, - callback: Callback< - protos.google.firestore.v1beta1.IBeginTransactionResponse, - | protos.google.firestore.v1beta1.IBeginTransactionRequest - | null - | undefined, - {} | null | undefined - > - ): void; - beginTransaction( - request: protos.google.firestore.v1beta1.IBeginTransactionRequest, - callback: Callback< - protos.google.firestore.v1beta1.IBeginTransactionResponse, - | protos.google.firestore.v1beta1.IBeginTransactionRequest - | null - | undefined, - {} | null | undefined - > - ): void; - /** - * Commits a transaction, while optionally updating documents. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.database - * Required. The database name. In the format: - * `projects/{project_id}/databases/{database_id}`. - * @param {number[]} request.writes - * The writes to apply. - * - * Always executed atomically and in order. - * @param {Buffer} request.transaction - * If set, applies all writes in this transaction, and commits it. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [CommitResponse]{@link google.firestore.v1beta1.CommitResponse}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1beta1/firestore.commit.js - * region_tag:firestore_v1beta1_generated_Firestore_Commit_async - */ - commit( - request?: protos.google.firestore.v1beta1.ICommitRequest, - options?: CallOptions - ): Promise< - [ - protos.google.firestore.v1beta1.ICommitResponse, - protos.google.firestore.v1beta1.ICommitRequest | undefined, - {} | undefined - ] - >; - commit( - request: protos.google.firestore.v1beta1.ICommitRequest, - options: CallOptions, - callback: Callback< - protos.google.firestore.v1beta1.ICommitResponse, - protos.google.firestore.v1beta1.ICommitRequest | null | undefined, - {} | null | undefined - > - ): void; - commit( - request: protos.google.firestore.v1beta1.ICommitRequest, - callback: Callback< - protos.google.firestore.v1beta1.ICommitResponse, - protos.google.firestore.v1beta1.ICommitRequest | null | undefined, - {} | null | undefined - > - ): void; - /** - * Rolls back a transaction. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.database - * Required. The database name. In the format: - * `projects/{project_id}/databases/{database_id}`. - * @param {Buffer} request.transaction - * Required. The transaction to roll back. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1beta1/firestore.rollback.js - * region_tag:firestore_v1beta1_generated_Firestore_Rollback_async - */ - rollback( - request?: protos.google.firestore.v1beta1.IRollbackRequest, - options?: CallOptions - ): Promise< - [ - protos.google.protobuf.IEmpty, - protos.google.firestore.v1beta1.IRollbackRequest | undefined, - {} | undefined - ] - >; - rollback( - request: protos.google.firestore.v1beta1.IRollbackRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.firestore.v1beta1.IRollbackRequest | null | undefined, - {} | null | undefined - > - ): void; - rollback( - request: protos.google.firestore.v1beta1.IRollbackRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.firestore.v1beta1.IRollbackRequest | null | undefined, - {} | null | undefined - > - ): void; - /** - * Applies a batch of write operations. - * - * The BatchWrite method does not apply the write operations atomically - * and can apply them out of order. Method does not allow more than one write - * per document. Each write succeeds or fails independently. See the - * {@link google.firestore.v1beta1.BatchWriteResponse|BatchWriteResponse} for the success status of each write. - * - * If you require an atomically applied set of writes, use - * {@link google.firestore.v1beta1.Firestore.Commit|Commit} instead. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.database - * Required. The database name. In the format: - * `projects/{project_id}/databases/{database_id}`. - * @param {number[]} request.writes - * The writes to apply. - * - * Method does not apply writes atomically and does not guarantee ordering. - * Each write succeeds or fails independently. You cannot write to the same - * document more than once per request. - * @param {number[]} request.labels - * Labels associated with this batch write. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [BatchWriteResponse]{@link google.firestore.v1beta1.BatchWriteResponse}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1beta1/firestore.batch_write.js - * region_tag:firestore_v1beta1_generated_Firestore_BatchWrite_async - */ - batchWrite( - request?: protos.google.firestore.v1beta1.IBatchWriteRequest, - options?: CallOptions - ): Promise< - [ - protos.google.firestore.v1beta1.IBatchWriteResponse, - protos.google.firestore.v1beta1.IBatchWriteRequest | undefined, - {} | undefined - ] - >; - batchWrite( - request: protos.google.firestore.v1beta1.IBatchWriteRequest, - options: CallOptions, - callback: Callback< - protos.google.firestore.v1beta1.IBatchWriteResponse, - protos.google.firestore.v1beta1.IBatchWriteRequest | null | undefined, - {} | null | undefined - > - ): void; - batchWrite( - request: protos.google.firestore.v1beta1.IBatchWriteRequest, - callback: Callback< - protos.google.firestore.v1beta1.IBatchWriteResponse, - protos.google.firestore.v1beta1.IBatchWriteRequest | null | undefined, - {} | null | undefined - > - ): void; - /** - * Creates a new document. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent resource. For example: - * `projects/{project_id}/databases/{database_id}/documents` or - * `projects/{project_id}/databases/{database_id}/documents/chatrooms/{chatroom_id}` - * @param {string} request.collectionId - * Required. The collection ID, relative to `parent`, to list. For example: `chatrooms`. - * @param {string} request.documentId - * The client-assigned document ID to use for this document. - * - * Optional. If not specified, an ID will be assigned by the service. - * @param {google.firestore.v1beta1.Document} request.document - * Required. The document to create. `name` must not be set. - * @param {google.firestore.v1beta1.DocumentMask} request.mask - * The fields to return. If not set, returns all fields. - * - * If the document has a field that is not present in this mask, that field - * will not be returned in the response. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Document]{@link google.firestore.v1beta1.Document}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1beta1/firestore.create_document.js - * region_tag:firestore_v1beta1_generated_Firestore_CreateDocument_async - */ - createDocument( - request?: protos.google.firestore.v1beta1.ICreateDocumentRequest, - options?: CallOptions - ): Promise< - [ - protos.google.firestore.v1beta1.IDocument, - protos.google.firestore.v1beta1.ICreateDocumentRequest | undefined, - {} | undefined - ] - >; - createDocument( - request: protos.google.firestore.v1beta1.ICreateDocumentRequest, - options: CallOptions, - callback: Callback< - protos.google.firestore.v1beta1.IDocument, - protos.google.firestore.v1beta1.ICreateDocumentRequest | null | undefined, - {} | null | undefined - > - ): void; - createDocument( - request: protos.google.firestore.v1beta1.ICreateDocumentRequest, - callback: Callback< - protos.google.firestore.v1beta1.IDocument, - protos.google.firestore.v1beta1.ICreateDocumentRequest | null | undefined, - {} | null | undefined - > - ): void; - /** - * Gets multiple documents. - * - * Documents returned by this method are not guaranteed to be returned in the - * same order that they were requested. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.database - * Required. The database name. In the format: - * `projects/{project_id}/databases/{database_id}`. - * @param {string[]} request.documents - * The names of the documents to retrieve. In the format: - * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - * The request will fail if any of the document is not a child resource of the - * given `database`. Duplicate names will be elided. - * @param {google.firestore.v1beta1.DocumentMask} request.mask - * The fields to return. If not set, returns all fields. - * - * If a document has a field that is not present in this mask, that field will - * not be returned in the response. - * @param {Buffer} request.transaction - * Reads documents in a transaction. - * @param {google.firestore.v1beta1.TransactionOptions} request.newTransaction - * Starts a new transaction and reads the documents. - * Defaults to a read-only transaction. - * The new transaction ID will be returned as the first response in the - * stream. - * @param {google.protobuf.Timestamp} request.readTime - * Reads documents as they were at the given time. - * This may not be older than 270 seconds. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits [BatchGetDocumentsResponse]{@link google.firestore.v1beta1.BatchGetDocumentsResponse} on 'data' event. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#server-streaming) - * for more details and examples. - * @example include:samples/generated/v1beta1/firestore.batch_get_documents.js - * region_tag:firestore_v1beta1_generated_Firestore_BatchGetDocuments_async - */ - batchGetDocuments( - request?: protos.google.firestore.v1beta1.IBatchGetDocumentsRequest, - options?: CallOptions - ): gax.CancellableStream; - /** - * Runs a query. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent resource name. In the format: - * `projects/{project_id}/databases/{database_id}/documents` or - * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - * For example: - * `projects/my-project/databases/my-database/documents` or - * `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` - * @param {google.firestore.v1beta1.StructuredQuery} request.structuredQuery - * A structured query. - * @param {Buffer} request.transaction - * Reads documents in a transaction. - * @param {google.firestore.v1beta1.TransactionOptions} request.newTransaction - * Starts a new transaction and reads the documents. - * Defaults to a read-only transaction. - * The new transaction ID will be returned as the first response in the - * stream. - * @param {google.protobuf.Timestamp} request.readTime - * Reads documents as they were at the given time. - * This may not be older than 270 seconds. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits [RunQueryResponse]{@link google.firestore.v1beta1.RunQueryResponse} on 'data' event. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#server-streaming) - * for more details and examples. - * @example include:samples/generated/v1beta1/firestore.run_query.js - * region_tag:firestore_v1beta1_generated_Firestore_RunQuery_async - */ - runQuery( - request?: protos.google.firestore.v1beta1.IRunQueryRequest, - options?: CallOptions - ): gax.CancellableStream; - /** - * Streams batches of document updates and deletes, in order. - * - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which is both readable and writable. It accepts objects - * representing [WriteRequest]{@link google.firestore.v1beta1.WriteRequest} for write() method, and - * will emit objects representing [WriteResponse]{@link google.firestore.v1beta1.WriteResponse} on 'data' event asynchronously. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#bi-directional-streaming) - * for more details and examples. - * @example include:samples/generated/v1beta1/firestore.write.js - * region_tag:firestore_v1beta1_generated_Firestore_Write_async - */ - write(options?: CallOptions): gax.CancellableStream; - /** - * Listens to changes. - * - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which is both readable and writable. It accepts objects - * representing [ListenRequest]{@link google.firestore.v1beta1.ListenRequest} for write() method, and - * will emit objects representing [ListenResponse]{@link google.firestore.v1beta1.ListenResponse} on 'data' event asynchronously. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#bi-directional-streaming) - * for more details and examples. - * @example include:samples/generated/v1beta1/firestore.listen.js - * region_tag:firestore_v1beta1_generated_Firestore_Listen_async - */ - listen(options?: CallOptions): gax.CancellableStream; - /** - * Lists documents. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent resource name. In the format: - * `projects/{project_id}/databases/{database_id}/documents` or - * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - * For example: - * `projects/my-project/databases/my-database/documents` or - * `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` - * @param {string} request.collectionId - * Required. The collection ID, relative to `parent`, to list. For example: `chatrooms` - * or `messages`. - * @param {number} request.pageSize - * The maximum number of documents to return. - * @param {string} request.pageToken - * The `next_page_token` value returned from a previous List request, if any. - * @param {string} request.orderBy - * The order to sort results by. For example: `priority desc, name`. - * @param {google.firestore.v1beta1.DocumentMask} request.mask - * The fields to return. If not set, returns all fields. - * - * If a document has a field that is not present in this mask, that field - * will not be returned in the response. - * @param {Buffer} request.transaction - * Reads documents in a transaction. - * @param {google.protobuf.Timestamp} request.readTime - * Reads documents as they were at the given time. - * This may not be older than 270 seconds. - * @param {boolean} request.showMissing - * If the list should show missing documents. A missing document is a - * document that does not exist but has sub-documents. These documents will - * be returned with a key but will not have fields, {@link google.firestore.v1beta1.Document.create_time|Document.create_time}, - * or {@link google.firestore.v1beta1.Document.update_time|Document.update_time} set. - * - * Requests with `show_missing` may not specify `where` or - * `order_by`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [Document]{@link google.firestore.v1beta1.Document}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listDocumentsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listDocuments( - request?: protos.google.firestore.v1beta1.IListDocumentsRequest, - options?: CallOptions - ): Promise< - [ - protos.google.firestore.v1beta1.IDocument[], - protos.google.firestore.v1beta1.IListDocumentsRequest | null, - protos.google.firestore.v1beta1.IListDocumentsResponse - ] - >; - listDocuments( - request: protos.google.firestore.v1beta1.IListDocumentsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.firestore.v1beta1.IListDocumentsRequest, - protos.google.firestore.v1beta1.IListDocumentsResponse | null | undefined, - protos.google.firestore.v1beta1.IDocument - > - ): void; - listDocuments( - request: protos.google.firestore.v1beta1.IListDocumentsRequest, - callback: PaginationCallback< - protos.google.firestore.v1beta1.IListDocumentsRequest, - protos.google.firestore.v1beta1.IListDocumentsResponse | null | undefined, - protos.google.firestore.v1beta1.IDocument - > - ): void; - /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent resource name. In the format: - * `projects/{project_id}/databases/{database_id}/documents` or - * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - * For example: - * `projects/my-project/databases/my-database/documents` or - * `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` - * @param {string} request.collectionId - * Required. The collection ID, relative to `parent`, to list. For example: `chatrooms` - * or `messages`. - * @param {number} request.pageSize - * The maximum number of documents to return. - * @param {string} request.pageToken - * The `next_page_token` value returned from a previous List request, if any. - * @param {string} request.orderBy - * The order to sort results by. For example: `priority desc, name`. - * @param {google.firestore.v1beta1.DocumentMask} request.mask - * The fields to return. If not set, returns all fields. - * - * If a document has a field that is not present in this mask, that field - * will not be returned in the response. - * @param {Buffer} request.transaction - * Reads documents in a transaction. - * @param {google.protobuf.Timestamp} request.readTime - * Reads documents as they were at the given time. - * This may not be older than 270 seconds. - * @param {boolean} request.showMissing - * If the list should show missing documents. A missing document is a - * document that does not exist but has sub-documents. These documents will - * be returned with a key but will not have fields, {@link google.firestore.v1beta1.Document.create_time|Document.create_time}, - * or {@link google.firestore.v1beta1.Document.update_time|Document.update_time} set. - * - * Requests with `show_missing` may not specify `where` or - * `order_by`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing [Document]{@link google.firestore.v1beta1.Document} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listDocumentsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listDocumentsStream( - request?: protos.google.firestore.v1beta1.IListDocumentsRequest, - options?: CallOptions - ): Transform; - /** - * Equivalent to `listDocuments`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent resource name. In the format: - * `projects/{project_id}/databases/{database_id}/documents` or - * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - * For example: - * `projects/my-project/databases/my-database/documents` or - * `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` - * @param {string} request.collectionId - * Required. The collection ID, relative to `parent`, to list. For example: `chatrooms` - * or `messages`. - * @param {number} request.pageSize - * The maximum number of documents to return. - * @param {string} request.pageToken - * The `next_page_token` value returned from a previous List request, if any. - * @param {string} request.orderBy - * The order to sort results by. For example: `priority desc, name`. - * @param {google.firestore.v1beta1.DocumentMask} request.mask - * The fields to return. If not set, returns all fields. - * - * If a document has a field that is not present in this mask, that field - * will not be returned in the response. - * @param {Buffer} request.transaction - * Reads documents in a transaction. - * @param {google.protobuf.Timestamp} request.readTime - * Reads documents as they were at the given time. - * This may not be older than 270 seconds. - * @param {boolean} request.showMissing - * If the list should show missing documents. A missing document is a - * document that does not exist but has sub-documents. These documents will - * be returned with a key but will not have fields, {@link google.firestore.v1beta1.Document.create_time|Document.create_time}, - * or {@link google.firestore.v1beta1.Document.update_time|Document.update_time} set. - * - * Requests with `show_missing` may not specify `where` or - * `order_by`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). - * When you iterate the returned iterable, each element will be an object representing - * [Document]{@link google.firestore.v1beta1.Document}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - * @example include:samples/generated/v1beta1/firestore.list_documents.js - * region_tag:firestore_v1beta1_generated_Firestore_ListDocuments_async - */ - listDocumentsAsync( - request?: protos.google.firestore.v1beta1.IListDocumentsRequest, - options?: CallOptions - ): AsyncIterable; - /** - * Partitions a query by returning partition cursors that can be used to run - * the query in parallel. The returned partition cursors are split points that - * can be used by RunQuery as starting/end points for the query results. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent resource name. In the format: - * `projects/{project_id}/databases/{database_id}/documents`. - * Document resource names are not supported; only database resource names - * can be specified. - * @param {google.firestore.v1beta1.StructuredQuery} request.structuredQuery - * A structured query. - * Query must specify collection with all descendants and be ordered by name - * ascending. Other filters, order bys, limits, offsets, and start/end - * cursors are not supported. - * @param {number} request.partitionCount - * The desired maximum number of partition points. - * The partitions may be returned across multiple pages of results. - * The number must be positive. The actual number of partitions - * returned may be fewer. - * - * For example, this may be set to one fewer than the number of parallel - * queries to be run, or in running a data pipeline job, one fewer than the - * number of workers or compute instances available. - * @param {string} request.pageToken - * The `next_page_token` value returned from a previous call to - * PartitionQuery that may be used to get an additional set of results. - * There are no ordering guarantees between sets of results. Thus, using - * multiple sets of results will require merging the different result sets. - * - * For example, two subsequent calls using a page_token may return: - * - * * cursor B, cursor M, cursor Q - * * cursor A, cursor U, cursor W - * - * To obtain a complete result set ordered with respect to the results of the - * query supplied to PartitionQuery, the results sets should be merged: - * cursor A, cursor B, cursor M, cursor Q, cursor U, cursor W - * @param {number} request.pageSize - * The maximum number of partitions to return in this call, subject to - * `partition_count`. - * - * For example, if `partition_count` = 10 and `page_size` = 8, the first call - * to PartitionQuery will return up to 8 partitions and a `next_page_token` - * if more results exist. A second call to PartitionQuery will return up to - * 2 partitions, to complete the total of 10 specified in `partition_count`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [Cursor]{@link google.firestore.v1beta1.Cursor}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `partitionQueryAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - partitionQuery( - request?: protos.google.firestore.v1beta1.IPartitionQueryRequest, - options?: CallOptions - ): Promise< - [ - protos.google.firestore.v1beta1.ICursor[], - protos.google.firestore.v1beta1.IPartitionQueryRequest | null, - protos.google.firestore.v1beta1.IPartitionQueryResponse - ] - >; - partitionQuery( - request: protos.google.firestore.v1beta1.IPartitionQueryRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.firestore.v1beta1.IPartitionQueryRequest, - | protos.google.firestore.v1beta1.IPartitionQueryResponse - | null - | undefined, - protos.google.firestore.v1beta1.ICursor - > - ): void; - partitionQuery( - request: protos.google.firestore.v1beta1.IPartitionQueryRequest, - callback: PaginationCallback< - protos.google.firestore.v1beta1.IPartitionQueryRequest, - | protos.google.firestore.v1beta1.IPartitionQueryResponse - | null - | undefined, - protos.google.firestore.v1beta1.ICursor - > - ): void; - /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent resource name. In the format: - * `projects/{project_id}/databases/{database_id}/documents`. - * Document resource names are not supported; only database resource names - * can be specified. - * @param {google.firestore.v1beta1.StructuredQuery} request.structuredQuery - * A structured query. - * Query must specify collection with all descendants and be ordered by name - * ascending. Other filters, order bys, limits, offsets, and start/end - * cursors are not supported. - * @param {number} request.partitionCount - * The desired maximum number of partition points. - * The partitions may be returned across multiple pages of results. - * The number must be positive. The actual number of partitions - * returned may be fewer. - * - * For example, this may be set to one fewer than the number of parallel - * queries to be run, or in running a data pipeline job, one fewer than the - * number of workers or compute instances available. - * @param {string} request.pageToken - * The `next_page_token` value returned from a previous call to - * PartitionQuery that may be used to get an additional set of results. - * There are no ordering guarantees between sets of results. Thus, using - * multiple sets of results will require merging the different result sets. - * - * For example, two subsequent calls using a page_token may return: - * - * * cursor B, cursor M, cursor Q - * * cursor A, cursor U, cursor W - * - * To obtain a complete result set ordered with respect to the results of the - * query supplied to PartitionQuery, the results sets should be merged: - * cursor A, cursor B, cursor M, cursor Q, cursor U, cursor W - * @param {number} request.pageSize - * The maximum number of partitions to return in this call, subject to - * `partition_count`. - * - * For example, if `partition_count` = 10 and `page_size` = 8, the first call - * to PartitionQuery will return up to 8 partitions and a `next_page_token` - * if more results exist. A second call to PartitionQuery will return up to - * 2 partitions, to complete the total of 10 specified in `partition_count`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing [Cursor]{@link google.firestore.v1beta1.Cursor} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `partitionQueryAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - partitionQueryStream( - request?: protos.google.firestore.v1beta1.IPartitionQueryRequest, - options?: CallOptions - ): Transform; - /** - * Equivalent to `partitionQuery`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent resource name. In the format: - * `projects/{project_id}/databases/{database_id}/documents`. - * Document resource names are not supported; only database resource names - * can be specified. - * @param {google.firestore.v1beta1.StructuredQuery} request.structuredQuery - * A structured query. - * Query must specify collection with all descendants and be ordered by name - * ascending. Other filters, order bys, limits, offsets, and start/end - * cursors are not supported. - * @param {number} request.partitionCount - * The desired maximum number of partition points. - * The partitions may be returned across multiple pages of results. - * The number must be positive. The actual number of partitions - * returned may be fewer. - * - * For example, this may be set to one fewer than the number of parallel - * queries to be run, or in running a data pipeline job, one fewer than the - * number of workers or compute instances available. - * @param {string} request.pageToken - * The `next_page_token` value returned from a previous call to - * PartitionQuery that may be used to get an additional set of results. - * There are no ordering guarantees between sets of results. Thus, using - * multiple sets of results will require merging the different result sets. - * - * For example, two subsequent calls using a page_token may return: - * - * * cursor B, cursor M, cursor Q - * * cursor A, cursor U, cursor W - * - * To obtain a complete result set ordered with respect to the results of the - * query supplied to PartitionQuery, the results sets should be merged: - * cursor A, cursor B, cursor M, cursor Q, cursor U, cursor W - * @param {number} request.pageSize - * The maximum number of partitions to return in this call, subject to - * `partition_count`. - * - * For example, if `partition_count` = 10 and `page_size` = 8, the first call - * to PartitionQuery will return up to 8 partitions and a `next_page_token` - * if more results exist. A second call to PartitionQuery will return up to - * 2 partitions, to complete the total of 10 specified in `partition_count`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). - * When you iterate the returned iterable, each element will be an object representing - * [Cursor]{@link google.firestore.v1beta1.Cursor}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - * @example include:samples/generated/v1beta1/firestore.partition_query.js - * region_tag:firestore_v1beta1_generated_Firestore_PartitionQuery_async - */ - partitionQueryAsync( - request?: protos.google.firestore.v1beta1.IPartitionQueryRequest, - options?: CallOptions - ): AsyncIterable; - /** - * Lists all the collection IDs underneath a document. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent document. In the format: - * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - * For example: - * `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` - * @param {number} request.pageSize - * The maximum number of results to return. - * @param {string} request.pageToken - * A page token. Must be a value from - * {@link google.firestore.v1beta1.ListCollectionIdsResponse|ListCollectionIdsResponse}. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of string. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listCollectionIdsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listCollectionIds( - request?: protos.google.firestore.v1beta1.IListCollectionIdsRequest, - options?: CallOptions - ): Promise< - [ - string[], - protos.google.firestore.v1beta1.IListCollectionIdsRequest | null, - protos.google.firestore.v1beta1.IListCollectionIdsResponse - ] - >; - listCollectionIds( - request: protos.google.firestore.v1beta1.IListCollectionIdsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.firestore.v1beta1.IListCollectionIdsRequest, - | protos.google.firestore.v1beta1.IListCollectionIdsResponse - | null - | undefined, - string - > - ): void; - listCollectionIds( - request: protos.google.firestore.v1beta1.IListCollectionIdsRequest, - callback: PaginationCallback< - protos.google.firestore.v1beta1.IListCollectionIdsRequest, - | protos.google.firestore.v1beta1.IListCollectionIdsResponse - | null - | undefined, - string - > - ): void; - /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent document. In the format: - * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - * For example: - * `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` - * @param {number} request.pageSize - * The maximum number of results to return. - * @param {string} request.pageToken - * A page token. Must be a value from - * {@link google.firestore.v1beta1.ListCollectionIdsResponse|ListCollectionIdsResponse}. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing string on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listCollectionIdsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listCollectionIdsStream( - request?: protos.google.firestore.v1beta1.IListCollectionIdsRequest, - options?: CallOptions - ): Transform; - /** - * Equivalent to `listCollectionIds`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent document. In the format: - * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - * For example: - * `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` - * @param {number} request.pageSize - * The maximum number of results to return. - * @param {string} request.pageToken - * A page token. Must be a value from - * {@link google.firestore.v1beta1.ListCollectionIdsResponse|ListCollectionIdsResponse}. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). - * When you iterate the returned iterable, each element will be an object representing - * string. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - * @example include:samples/generated/v1beta1/firestore.list_collection_ids.js - * region_tag:firestore_v1beta1_generated_Firestore_ListCollectionIds_async - */ - listCollectionIdsAsync( - request?: protos.google.firestore.v1beta1.IListCollectionIdsRequest, - options?: CallOptions - ): AsyncIterable; - /** - * Terminate the gRPC channel and close the client. - * - * The client will no longer be usable and all future behavior is undefined. - * @returns {Promise} A promise that resolves when the client is closed. - */ - close(): Promise; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/paginator/CHANGELOG.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/paginator/CHANGELOG.md deleted file mode 100644 index 350a56c5..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/paginator/CHANGELOG.md +++ /dev/null @@ -1,219 +0,0 @@ -# Changelog - -[npm history][1] - -[1]: https://www.npmjs.com/package/nodejs-paginator?activeTab=versions - -### [3.0.7](https://github.com/googleapis/nodejs-paginator/compare/v3.0.6...v3.0.7) (2022-02-14) - - -### Bug Fixes - -* update signature of end to comply with update node types definition ([#311](https://github.com/googleapis/nodejs-paginator/issues/311)) ([79e6fbd](https://github.com/googleapis/nodejs-paginator/commit/79e6fbdae5008d874613d2919a6cf723708fc919)) - -### [3.0.6](https://www.github.com/googleapis/nodejs-paginator/compare/v3.0.5...v3.0.6) (2021-09-09) - - -### Bug Fixes - -* **build:** switch primary branch to main ([#287](https://www.github.com/googleapis/nodejs-paginator/issues/287)) ([1b796f3](https://www.github.com/googleapis/nodejs-paginator/commit/1b796f3377174354a62b7475d16f52213197f650)) - -### [3.0.5](https://www.github.com/googleapis/nodejs-paginator/compare/v3.0.4...v3.0.5) (2020-09-02) - - -### Bug Fixes - -* add configs by running synthtool ([#241](https://www.github.com/googleapis/nodejs-paginator/issues/241)) ([643593a](https://www.github.com/googleapis/nodejs-paginator/commit/643593ae9ffb8febff69a7bdae19239f5bcb1266)) - -### [3.0.4](https://www.github.com/googleapis/nodejs-paginator/compare/v3.0.3...v3.0.4) (2020-08-06) - - -### Bug Fixes - -* destroy ResourceStream with pre-flight error ([#236](https://www.github.com/googleapis/nodejs-paginator/issues/236)) ([d57beb4](https://www.github.com/googleapis/nodejs-paginator/commit/d57beb424d875a7bf502d458cc208f1bbe47a42a)) - -### [3.0.3](https://www.github.com/googleapis/nodejs-paginator/compare/v3.0.2...v3.0.3) (2020-07-24) - - -### Bug Fixes - -* move gitattributes files to node templates ([#234](https://www.github.com/googleapis/nodejs-paginator/issues/234)) ([30e881c](https://www.github.com/googleapis/nodejs-paginator/commit/30e881ce7415749b93b6b7e4e71745ea3fb248b6)) - -### [3.0.2](https://www.github.com/googleapis/nodejs-paginator/compare/v3.0.1...v3.0.2) (2020-07-06) - - -### Bug Fixes - -* update node issue template ([#221](https://www.github.com/googleapis/nodejs-paginator/issues/221)) ([088153c](https://www.github.com/googleapis/nodejs-paginator/commit/088153c4fca6d53e2e5ef4bb42365ce5493b913d)) - -### [3.0.1](https://www.github.com/googleapis/nodejs-paginator/compare/v3.0.0...v3.0.1) (2020-05-20) - - -### Bug Fixes - -* apache license URL ([#468](https://www.github.com/googleapis/nodejs-paginator/issues/468)) ([#211](https://www.github.com/googleapis/nodejs-paginator/issues/211)) ([f343b7f](https://www.github.com/googleapis/nodejs-paginator/commit/f343b7f7e184fd1b453f20ac1463d17520aac7ad)) - -## [3.0.0](https://www.github.com/googleapis/nodejs-paginator/compare/v2.0.3...v3.0.0) (2020-03-25) - - -### ⚠ BREAKING CHANGES - -* **dep:** upgrade gts 2.0.0 (#194) -* **deps:** deprecated node 8 to 10; upgrade typescript - -### Miscellaneous Chores - -* **dep:** upgrade gts 2.0.0 ([#194](https://www.github.com/googleapis/nodejs-paginator/issues/194)) ([4eaf9be](https://www.github.com/googleapis/nodejs-paginator/commit/4eaf9bed1fcfd0f10e877ff15c1d0e968e3356c8)) -* **deps:** deprecated node 8 to 10; upgrade typescript ([f6434ab](https://www.github.com/googleapis/nodejs-paginator/commit/f6434ab9cacb6ab804c070f19c38b6072ca326b5)) - -### [2.0.3](https://www.github.com/googleapis/nodejs-paginator/compare/v2.0.2...v2.0.3) (2019-12-05) - - -### Bug Fixes - -* **deps:** pin TypeScript below 3.7.0 ([e06e1b0](https://www.github.com/googleapis/nodejs-paginator/commit/e06e1b0a2e2bb1cf56fc806c1703b8b5e468b954)) - -### [2.0.2](https://www.github.com/googleapis/nodejs-paginator/compare/v2.0.1...v2.0.2) (2019-11-13) - - -### Bug Fixes - -* **docs:** add jsdoc-region-tag plugin ([#155](https://www.github.com/googleapis/nodejs-paginator/issues/155)) ([b983799](https://www.github.com/googleapis/nodejs-paginator/commit/b98379905848fd179c6268aff3e1cfaf2bf76663)) - -### [2.0.1](https://www.github.com/googleapis/nodejs-paginator/compare/v2.0.0...v2.0.1) (2019-08-25) - - -### Bug Fixes - -* **deps:** use the latest extend ([#141](https://www.github.com/googleapis/nodejs-paginator/issues/141)) ([61b383e](https://www.github.com/googleapis/nodejs-paginator/commit/61b383e)) - -## [2.0.0](https://www.github.com/googleapis/nodejs-paginator/compare/v1.0.2...v2.0.0) (2019-07-12) - - -### ⚠ BREAKING CHANGES - -* rewrite streaming logic (#136) - -### Code Refactoring - -* rewrite streaming logic ([#136](https://www.github.com/googleapis/nodejs-paginator/issues/136)) ([641d82d](https://www.github.com/googleapis/nodejs-paginator/commit/641d82d)) - -### [1.0.2](https://www.github.com/googleapis/nodejs-paginator/compare/v1.0.1...v1.0.2) (2019-06-26) - - -### Bug Fixes - -* **docs:** link to reference docs section on googleapis.dev ([#132](https://www.github.com/googleapis/nodejs-paginator/issues/132)) ([be231be](https://www.github.com/googleapis/nodejs-paginator/commit/be231be)) - -### [1.0.1](https://www.github.com/googleapis/nodejs-paginator/compare/v1.0.0...v1.0.1) (2019-06-14) - - -### Bug Fixes - -* **docs:** move to new client docs URL ([#129](https://www.github.com/googleapis/nodejs-paginator/issues/129)) ([689f483](https://www.github.com/googleapis/nodejs-paginator/commit/689f483)) - -## [1.0.0](https://www.github.com/googleapis/nodejs-paginator/compare/v0.2.0...v1.0.0) (2019-05-03) - - -### Bug Fixes - -* **deps:** update dependency arrify to v2 ([#109](https://www.github.com/googleapis/nodejs-paginator/issues/109)) ([9f06c83](https://www.github.com/googleapis/nodejs-paginator/commit/9f06c83)) - - -### Build System - -* upgrade engines field to >=8.10.0 ([#115](https://www.github.com/googleapis/nodejs-paginator/issues/115)) ([0921076](https://www.github.com/googleapis/nodejs-paginator/commit/0921076)) - - -### BREAKING CHANGES - -* upgrade engines field to >=8.10.0 (#115) - -## v0.2.0 - -03-08-2019 12:15 PST - -### New Features -- feat: handle promise based functions ([#91](https://github.com/googleapis/nodejs-paginator/pull/91)) -- refactor(ts): create generic for object streams ([#101](https://github.com/googleapis/nodejs-paginator/pull/101)) - -### Dependencies -- chore(deps): update dependency through2 to v3 ([#53](https://github.com/googleapis/nodejs-paginator/pull/53)) -- chore(deps): update dependency @types/is to v0.0.21 ([#55](https://github.com/googleapis/nodejs-paginator/pull/55)) -- chore(deps): update dependency gts to ^0.9.0 ([#57](https://github.com/googleapis/nodejs-paginator/pull/57)) -- fix: Pin @types/sinon to last compatible version ([#61](https://github.com/googleapis/nodejs-paginator/pull/61)) -- refactor: trim a few dependencies ([#60](https://github.com/googleapis/nodejs-paginator/pull/60)) -- chore(deps): update dependency @types/sinon to v5.0.7 ([#62](https://github.com/googleapis/nodejs-paginator/pull/62)) -- chore(deps): update dependency @types/sinon to v7 ([#81](https://github.com/googleapis/nodejs-paginator/pull/81)) -- chore(deps): update dependency mocha to v6 - -### Documentation -- docs: add lint/fix example to contributing guide ([#85](https://github.com/googleapis/nodejs-paginator/pull/85)) -- chore: move CONTRIBUTING.md to root ([#87](https://github.com/googleapis/nodejs-paginator/pull/87)) -- docs: update links in contrib guide ([#94](https://github.com/googleapis/nodejs-paginator/pull/94)) -- docs: update contributing path in README ([#88](https://github.com/googleapis/nodejs-paginator/pull/88)) - -### Internal / Testing Changes -- chore: include build in eslintignore ([#49](https://github.com/googleapis/nodejs-paginator/pull/49)) -- chore: update CircleCI config ([#52](https://github.com/googleapis/nodejs-paginator/pull/52)) -- chore: use latest npm on Windows ([#54](https://github.com/googleapis/nodejs-paginator/pull/54)) -- chore: update eslintignore config ([#56](https://github.com/googleapis/nodejs-paginator/pull/56)) -- chore: add synth.metadata -- fix(build): fix system key decryption ([#64](https://github.com/googleapis/nodejs-paginator/pull/64)) -- chore: update license file ([#68](https://github.com/googleapis/nodejs-paginator/pull/68)) -- chore(build): update prettier config ([#69](https://github.com/googleapis/nodejs-paginator/pull/69)) -- chore: nyc ignore build/test by default ([#71](https://github.com/googleapis/nodejs-paginator/pull/71)) -- chore: always nyc report before calling codecov ([#72](https://github.com/googleapis/nodejs-paginator/pull/72)) -- build: add Kokoro configs for autorelease ([#75](https://github.com/googleapis/nodejs-paginator/pull/75)) -- fix(build): fix Kokoro release script ([#76](https://github.com/googleapis/nodejs-paginator/pull/76)) -- chore: fix publish.sh permission +x ([#77](https://github.com/googleapis/nodejs-paginator/pull/77)) -- chore: update nyc and eslint configs ([#79](https://github.com/googleapis/nodejs-paginator/pull/79)) -- chore(build): inject yoshi automation key ([#80](https://github.com/googleapis/nodejs-paginator/pull/80)) -- build: check broken links in generated docs ([#82](https://github.com/googleapis/nodejs-paginator/pull/82)) -- build: ignore googleapis.com in doc link check ([#84](https://github.com/googleapis/nodejs-paginator/pull/84)) -- build: test using @grpc/grpc-js in CI ([#89](https://github.com/googleapis/nodejs-paginator/pull/89)) -- build: create docs test npm scripts ([#90](https://github.com/googleapis/nodejs-paginator/pull/90)) -- build: use linkinator for docs test ([#93](https://github.com/googleapis/nodejs-paginator/pull/93)) -- build: update release configuration -- build: fix types for sinon ([#98](https://github.com/googleapis/nodejs-paginator/pull/98)) -- build: use node10 to run samples-test, system-test etc ([#97](https://github.com/googleapis/nodejs-paginator/pull/97)) -- build: Add docuploader credentials to node publish jobs ([#99](https://github.com/googleapis/nodejs-paginator/pull/99)) - -## v0.1.2 - -### Bug fixes -- fix: call limiter.makeRequest() instead of original method ([#43](https://github.com/googleapis/nodejs-paginator/pull/43)) - -### Internal / Testing Changes -- chore: update issue templates ([#42](https://github.com/googleapis/nodejs-paginator/pull/42)) -- chore: remove old issue template ([#40](https://github.com/googleapis/nodejs-paginator/pull/40)) -- build: run tests on node11 ([#39](https://github.com/googleapis/nodejs-paginator/pull/39)) -- chores(build): run codecov on continuous builds ([#36](https://github.com/googleapis/nodejs-paginator/pull/36)) -- chores(build): do not collect sponge.xml from windows builds ([#37](https://github.com/googleapis/nodejs-paginator/pull/37)) -- chore: update new issue template ([#35](https://github.com/googleapis/nodejs-paginator/pull/35)) -- chore(deps): update dependency sinon to v7 ([#31](https://github.com/googleapis/nodejs-paginator/pull/31)) -- build: fix codecov uploading on Kokoro ([#32](https://github.com/googleapis/nodejs-paginator/pull/32)) -- Update kokoro config ([#29](https://github.com/googleapis/nodejs-paginator/pull/29)) -- Update CI config ([#27](https://github.com/googleapis/nodejs-paginator/pull/27)) -- Don't publish sourcemaps ([#25](https://github.com/googleapis/nodejs-paginator/pull/25)) -- build: prevent system/sample-test from leaking credentials -- Update kokoro config ([#23](https://github.com/googleapis/nodejs-paginator/pull/23)) -- test: remove appveyor config ([#22](https://github.com/googleapis/nodejs-paginator/pull/22)) -- Update CI config ([#21](https://github.com/googleapis/nodejs-paginator/pull/21)) -- Enable prefer-const in the eslint config ([#20](https://github.com/googleapis/nodejs-paginator/pull/20)) -- Enable no-var in eslint ([#19](https://github.com/googleapis/nodejs-paginator/pull/19)) -- Update CI config ([#18](https://github.com/googleapis/nodejs-paginator/pull/18)) - -## v0.1.1 - -### Internal / Testing Changes -- Add synth script and update CI config (#14) -- chore(deps): update dependency nyc to v13 (#12) -- chore: ignore package-lock.json (#11) -- chore(deps): lock file maintenance (#10) -- chore: update renovate config (#9) -- remove that whitespace (#8) -- chore(deps): lock file maintenance (#7) -- chore(deps): update dependency typescript to v3 (#6) -- chore: assert.deelEqual => assert.deepStrictEqual (#5) -- chore: move mocha options to mocha.opts (#4) diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/paginator/LICENSE b/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/paginator/LICENSE deleted file mode 100644 index d6456956..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/paginator/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/paginator/README.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/paginator/README.md deleted file mode 100644 index c7c58082..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/paginator/README.md +++ /dev/null @@ -1,136 +0,0 @@ -[//]: # "This README.md file is auto-generated, all changes to this file will be lost." -[//]: # "To regenerate it, use `python -m synthtool`." -Google Cloud Platform logo - -# [Google Cloud Common Paginator: Node.js Client](https://github.com/googleapis/nodejs-paginator) - -[![release level](https://img.shields.io/badge/release%20level-stable-brightgreen.svg?style=flat)](https://cloud.google.com/terms/launch-stages) -[![npm version](https://img.shields.io/npm/v/@google-cloud/paginator.svg)](https://www.npmjs.org/package/@google-cloud/paginator) - - - - -A result paging utility used by Google node.js modules - - -A comprehensive list of changes in each version may be found in -[the CHANGELOG](https://github.com/googleapis/nodejs-paginator/blob/main/CHANGELOG.md). - -* [Google Cloud Common Paginator Node.js Client API Reference][client-docs] - -* [github.com/googleapis/nodejs-paginator](https://github.com/googleapis/nodejs-paginator) - -Read more about the client libraries for Cloud APIs, including the older -Google APIs Client Libraries, in [Client Libraries Explained][explained]. - -[explained]: https://cloud.google.com/apis/docs/client-libraries-explained - -**Table of contents:** - - -* [Quickstart](#quickstart) - - * [Installing the client library](#installing-the-client-library) - * [Using the client library](#using-the-client-library) -* [Samples](#samples) -* [Versioning](#versioning) -* [Contributing](#contributing) -* [License](#license) - -## Quickstart - -### Installing the client library - -```bash -npm install @google-cloud/paginator -``` - - -### Using the client library - -```javascript -const {paginator} = require('@google-cloud/paginator'); -console.log(paginator); - -``` - - - -## Samples - -Samples are in the [`samples/`](https://github.com/googleapis/nodejs-paginator/tree/main/samples) directory. Each sample's `README.md` has instructions for running its sample. - -| Sample | Source Code | Try it | -| --------------------------- | --------------------------------- | ------ | -| Quickstart | [source code](https://github.com/googleapis/nodejs-paginator/blob/main/samples/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-paginator&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) | -| Streamify | [source code](https://github.com/googleapis/nodejs-paginator/blob/main/samples/streamify.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-paginator&page=editor&open_in_editor=samples/streamify.js,samples/README.md) | - - - -The [Google Cloud Common Paginator Node.js Client API Reference][client-docs] documentation -also contains samples. - -## Supported Node.js Versions - -Our client libraries follow the [Node.js release schedule](https://nodejs.org/en/about/releases/). -Libraries are compatible with all current _active_ and _maintenance_ versions of -Node.js. -If you are using an end-of-life version of Node.js, we recommend that you update -as soon as possible to an actively supported LTS version. - -Google's client libraries support legacy versions of Node.js runtimes on a -best-efforts basis with the following warnings: - -* Legacy versions are not tested in continuous integration. -* Some security patches and features cannot be backported. -* Dependencies cannot be kept up-to-date. - -Client libraries targeting some end-of-life versions of Node.js are available, and -can be installed through npm [dist-tags](https://docs.npmjs.com/cli/dist-tag). -The dist-tags follow the naming convention `legacy-(version)`. -For example, `npm install @google-cloud/paginator@legacy-8` installs client libraries -for versions compatible with Node.js 8. - -## Versioning - -This library follows [Semantic Versioning](http://semver.org/). - - - -This library is considered to be **stable**. The code surface will not change in backwards-incompatible ways -unless absolutely necessary (e.g. because of critical security issues) or with -an extensive deprecation period. Issues and requests against **stable** libraries -are addressed with the highest priority. - - - - - - -More Information: [Google Cloud Platform Launch Stages][launch_stages] - -[launch_stages]: https://cloud.google.com/terms/launch-stages - -## Contributing - -Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/nodejs-paginator/blob/main/CONTRIBUTING.md). - -Please note that this `README.md`, the `samples/README.md`, -and a variety of configuration files in this repository (including `.nycrc` and `tsconfig.json`) -are generated from a central template. To edit one of these files, make an edit -to its templates in -[directory](https://github.com/googleapis/synthtool). - -## License - -Apache Version 2.0 - -See [LICENSE](https://github.com/googleapis/nodejs-paginator/blob/main/LICENSE) - -[client-docs]: https://cloud.google.com/nodejs/docs/reference/paginator/latest - -[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png -[projects]: https://console.cloud.google.com/project -[billing]: https://support.google.com/cloud/answer/6293499#enable-billing - -[auth]: https://cloud.google.com/docs/authentication/getting-started diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/paginator/package.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/paginator/package.json deleted file mode 100644 index 56571131..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/paginator/package.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "name": "@google-cloud/paginator", - "version": "3.0.7", - "description": "A result paging utility used by Google node.js modules", - "main": "build/src/index.js", - "types": "build/src/index.d.ts", - "repository": "googleapis/nodejs-paginator", - "scripts": { - "test": "c8 mocha build/test", - "compile": "tsc -p .", - "fix": "gts fix", - "prelint": "cd samples; npm link ../; npm install", - "lint": "gts check", - "prepare": "npm run compile", - "pretest": "npm run compile", - "docs": "compodoc src/", - "presystem-test": "npm run compile", - "samples-test": "cd samples/ && npm link ../ && npm test && cd ../", - "system-test": "mocha build/system-test", - "docs-test": "linkinator docs", - "predocs-test": "npm run docs", - "clean": "gts clean", - "precompile": "gts clean" - }, - "keywords": [], - "files": [ - "build/src", - "!build/src/**/*.map" - ], - "author": "Google Inc.", - "license": "Apache-2.0", - "devDependencies": { - "@compodoc/compodoc": "^1.1.7", - "@types/extend": "^3.0.0", - "@types/mocha": "^8.0.0", - "@types/node": "^16.0.0", - "@types/proxyquire": "^1.3.28", - "@types/sinon": "^10.0.0", - "@types/uuid": "^8.0.0", - "c8": "^7.0.0", - "codecov": "^3.0.4", - "gts": "^3.0.0", - "linkinator": "^2.0.0", - "mocha": "^8.0.0", - "proxyquire": "^2.0.1", - "sinon": "^13.0.0", - "typescript": "^3.8.3", - "uuid": "^8.0.0" - }, - "dependencies": { - "arrify": "^2.0.0", - "extend": "^3.0.2" - }, - "engines": { - "node": ">=10" - } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/projectify/CHANGELOG.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/projectify/CHANGELOG.md deleted file mode 100644 index 165968fa..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/projectify/CHANGELOG.md +++ /dev/null @@ -1,180 +0,0 @@ -# Changelog - -[npm history][1] - -[1]: https://www.npmjs.com/package/@google-cloud/projectify?activeTab=versions -## [3.0.0](https://github.com/googleapis/nodejs-projectify/compare/v2.1.1...v3.0.0) (2022-05-20) - - -### ⚠ BREAKING CHANGES - -* update library to use Node 12 (#299) - -### Build System - -* update library to use Node 12 ([#299](https://github.com/googleapis/nodejs-projectify/issues/299)) ([83b63ca](https://github.com/googleapis/nodejs-projectify/commit/83b63ca8cb89086a8535a9fc8abd39e95f0cecd4)) - -### [2.1.1](https://www.github.com/googleapis/nodejs-projectify/compare/v2.1.0...v2.1.1) (2021-09-09) - - -### Bug Fixes - -* **build:** switch primary branch to main ([#267](https://www.github.com/googleapis/nodejs-projectify/issues/267)) ([9e8d6e4](https://www.github.com/googleapis/nodejs-projectify/commit/9e8d6e48c080806b42164d7be0bd11197996f245)) - -## [2.1.0](https://www.github.com/googleapis/nodejs-projectify/compare/v2.0.1...v2.1.0) (2021-06-10) - - -### Features - -* add `gcf-owl-bot[bot]` to `ignoreAuthors` ([#245](https://www.github.com/googleapis/nodejs-projectify/issues/245)) ([30f0499](https://www.github.com/googleapis/nodejs-projectify/commit/30f0499ade5f140774c3aa672b44fd3538e72309)) - -### [2.0.1](https://www.github.com/googleapis/nodejs-projectify/compare/v2.0.0...v2.0.1) (2020-07-06) - - -### Bug Fixes - -* update node issue template ([#197](https://www.github.com/googleapis/nodejs-projectify/issues/197)) ([3406f2a](https://www.github.com/googleapis/nodejs-projectify/commit/3406f2aa431ed04541585b63c330c04270c602aa)) - -## [2.0.0](https://www.github.com/googleapis/nodejs-projectify/compare/v1.0.4...v2.0.0) (2020-03-24) - - -### ⚠ BREAKING CHANGES - -* typescript@3.7 introduced some breaking changes -* drop Node 8 from engines field (#172) - -### Features - -* drop Node 8 from engines field ([#172](https://www.github.com/googleapis/nodejs-projectify/issues/172)) ([3eac424](https://www.github.com/googleapis/nodejs-projectify/commit/3eac424bfb1ee47144a77888dc68db687988945e)) - - -### Build System - -* update to latest version of gts/typescript ([#171](https://www.github.com/googleapis/nodejs-projectify/issues/171)) ([30f90cc](https://www.github.com/googleapis/nodejs-projectify/commit/30f90cc172da6ed9394da91869556bf5eef42434)) - -### [1.0.4](https://www.github.com/googleapis/nodejs-projectify/compare/v1.0.3...v1.0.4) (2019-12-05) - - -### Bug Fixes - -* **publish:** publication failed to reach npm ([#141](https://www.github.com/googleapis/nodejs-projectify/issues/141)) ([5406ba5](https://www.github.com/googleapis/nodejs-projectify/commit/5406ba5e1d43a228a19072023c1baebce34190af)) - -### [1.0.3](https://www.github.com/googleapis/nodejs-projectify/compare/v1.0.2...v1.0.3) (2019-12-05) - - -### Bug Fixes - -* **deps:** pin TypeScript below 3.7.0 ([6c95307](https://www.github.com/googleapis/nodejs-projectify/commit/6c953070139a77d30c4ce5b7dee1443874046906)) - -### [1.0.2](https://www.github.com/googleapis/nodejs-projectify/compare/v1.0.1...v1.0.2) (2019-11-14) - - -### Bug Fixes - -* **docs:** add jsdoc-region-tag plugin ([#135](https://www.github.com/googleapis/nodejs-projectify/issues/135)) ([59301e7](https://www.github.com/googleapis/nodejs-projectify/commit/59301e7cfa855add4894dd9c46870e61fffa7413)) - -### [1.0.1](https://www.github.com/googleapis/nodejs-projectify/compare/v1.0.0...v1.0.1) (2019-06-26) - - -### Bug Fixes - -* **docs:** link to reference docs section on googleapis.dev ([#119](https://www.github.com/googleapis/nodejs-projectify/issues/119)) ([90a009f](https://www.github.com/googleapis/nodejs-projectify/commit/90a009f)) - -## [1.0.0](https://www.github.com/googleapis/nodejs-projectify/compare/v0.3.3...v1.0.0) (2019-05-02) - - -### Build System - -* upgrade engines field to >=8.10.0 ([#103](https://www.github.com/googleapis/nodejs-projectify/issues/103)) ([0149650](https://www.github.com/googleapis/nodejs-projectify/commit/0149650)) - - -### BREAKING CHANGES - -* upgrade engines field to >=8.10.0 (#103) - -## v0.3.3 - -03-12-2019 12:27 PDT - -This patch release contains a few updates to the docs. That's all! - -### Documentation -- docs: update links in contrib guide ([#86](https://github.com/googleapis/nodejs-projectify/pull/86)) -- docs: update contributing path in README ([#82](https://github.com/googleapis/nodejs-projectify/pull/82)) -- docs: move CONTRIBUTING.md to root ([#81](https://github.com/googleapis/nodejs-projectify/pull/81)) -- docs: add lint/fix example to contributing guide ([#79](https://github.com/googleapis/nodejs-projectify/pull/79)) - -### Internal / Testing Changes -- build: Add docuploader credentials to node publish jobs ([#90](https://github.com/googleapis/nodejs-projectify/pull/90)) -- build: use node10 to run samples-test, system-test etc ([#89](https://github.com/googleapis/nodejs-projectify/pull/89)) -- build: update release configuration -- chore(deps): update dependency mocha to v6 -- build: use linkinator for docs test ([#85](https://github.com/googleapis/nodejs-projectify/pull/85)) -- build: create docs test npm scripts ([#84](https://github.com/googleapis/nodejs-projectify/pull/84)) -- build: test using @grpc/grpc-js in CI ([#83](https://github.com/googleapis/nodejs-projectify/pull/83)) -- build: ignore googleapis.com in doc link check ([#78](https://github.com/googleapis/nodejs-projectify/pull/78)) -- build: check for 404s in the docs ([#77](https://github.com/googleapis/nodejs-projectify/pull/77)) -- chore(build): inject yoshi automation key ([#75](https://github.com/googleapis/nodejs-projectify/pull/75)) -- chore: update nyc and eslint configs ([#74](https://github.com/googleapis/nodejs-projectify/pull/74)) -- chore: fix publish.sh permission +x ([#72](https://github.com/googleapis/nodejs-projectify/pull/72)) -- fix(build): fix Kokoro release script ([#71](https://github.com/googleapis/nodejs-projectify/pull/71)) -- build: add Kokoro configs for autorelease ([#70](https://github.com/googleapis/nodejs-projectify/pull/70)) -- chore: always nyc report before calling codecov ([#67](https://github.com/googleapis/nodejs-projectify/pull/67)) -- chore: nyc ignore build/test by default ([#66](https://github.com/googleapis/nodejs-projectify/pull/66)) -- chore(build): update prettier config ([#64](https://github.com/googleapis/nodejs-projectify/pull/64)) -- chore: update license file ([#63](https://github.com/googleapis/nodejs-projectify/pull/63)) -- fix(build): fix system key decryption ([#59](https://github.com/googleapis/nodejs-projectify/pull/59)) -- chore: add synth.metadata - -## v0.3.2 - -### Bug fixes -- fix: do not replace projectId on stream objects ([#53](https://github.com/googleapis/nodejs-projectify/pull/53)) - -### Dependencies -- chore(deps): update dependency gts to ^0.9.0 ([#52](https://github.com/googleapis/nodejs-projectify/pull/52)) - -### Internal / Testing Changes -- chore: update eslintignore config ([#51](https://github.com/googleapis/nodejs-projectify/pull/51)) -- chore: use latest npm on Windows ([#50](https://github.com/googleapis/nodejs-projectify/pull/50)) -- chore: update CircleCI config ([#49](https://github.com/googleapis/nodejs-projectify/pull/49)) -- chore: include build in eslintignore ([#46](https://github.com/googleapis/nodejs-projectify/pull/46)) - -## v0.3.1 - -### Implementation Changes -- fix: replaceProjectId should not fail when passed a Buffer ([#43](https://github.com/googleapis/nodejs-projectify/pull/43)) - -### Dependencies -- chore(deps): update dependency nyc to v13 ([#13](https://github.com/googleapis/nodejs-projectify/pull/13)) -- chore(deps): lock file maintenance ([#11](https://github.com/googleapis/nodejs-projectify/pull/11)) -- chore(deps): lock file maintenance ([#8](https://github.com/googleapis/nodejs-projectify/pull/8)) -- chore(deps): update dependency typescript to v3 ([#7](https://github.com/googleapis/nodejs-projectify/pull/7)) -- chore(deps): update dependency gts to ^0.8.0 ([#2](https://github.com/googleapis/nodejs-projectify/pull/2)) -- chore(deps): lock file maintenance ([#4](https://github.com/googleapis/nodejs-projectify/pull/4)) -- chore(deps): lock file maintenance ([#3](https://github.com/googleapis/nodejs-projectify/pull/3)) - -### Internal / Testing Changes -- chore: update issue templates ([#40](https://github.com/googleapis/nodejs-projectify/pull/40)) -- chore: remove old issue template ([#38](https://github.com/googleapis/nodejs-projectify/pull/38)) -- build: run tests on node11 ([#37](https://github.com/googleapis/nodejs-projectify/pull/37)) -- chores(build): run codecov on continuous builds ([#34](https://github.com/googleapis/nodejs-projectify/pull/34)) -- chores(build): do not collect sponge.xml from windows builds ([#35](https://github.com/googleapis/nodejs-projectify/pull/35)) -- chore: update new issue template ([#33](https://github.com/googleapis/nodejs-projectify/pull/33)) -- build: fix codecov uploading on Kokoro ([#30](https://github.com/googleapis/nodejs-projectify/pull/30)) -- Update kokoro config ([#28](https://github.com/googleapis/nodejs-projectify/pull/28)) -- Update CI config ([#26](https://github.com/googleapis/nodejs-projectify/pull/26)) -- Don't publish sourcemaps ([#24](https://github.com/googleapis/nodejs-projectify/pull/24)) -- build: prevent system/sample-test from leaking credentials -- Update kokoro config ([#22](https://github.com/googleapis/nodejs-projectify/pull/22)) -- test: remove appveyor config ([#21](https://github.com/googleapis/nodejs-projectify/pull/21)) -- Update CI config ([#20](https://github.com/googleapis/nodejs-projectify/pull/20)) -- Enable prefer-const in the eslint config ([#19](https://github.com/googleapis/nodejs-projectify/pull/19)) -- Enable no-var in eslint ([#18](https://github.com/googleapis/nodejs-projectify/pull/18)) -- Update CI config ([#17](https://github.com/googleapis/nodejs-projectify/pull/17)) -- Add synth and update CI config ([#15](https://github.com/googleapis/nodejs-projectify/pull/15)) -- chore: ignore package-lock.json ([#12](https://github.com/googleapis/nodejs-projectify/pull/12)) -- chore: update renovate config ([#10](https://github.com/googleapis/nodejs-projectify/pull/10)) -- remove that whitespace ([#9](https://github.com/googleapis/nodejs-projectify/pull/9)) -- chore: assert.deelEqual => assert.deepStrictEqual ([#6](https://github.com/googleapis/nodejs-projectify/pull/6)) -- chore: move mocha options to mocha.opts ([#5](https://github.com/googleapis/nodejs-projectify/pull/5)) diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/projectify/LICENSE b/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/projectify/LICENSE deleted file mode 100644 index d6456956..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/projectify/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/projectify/README.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/projectify/README.md deleted file mode 100644 index a8d7c4fa..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/projectify/README.md +++ /dev/null @@ -1,138 +0,0 @@ -[//]: # "This README.md file is auto-generated, all changes to this file will be lost." -[//]: # "To regenerate it, use `python -m synthtool`." -Google Cloud Platform logo - -# [Google Cloud Common Projectify: Node.js Client](https://github.com/googleapis/nodejs-projectify) - -[![release level](https://img.shields.io/badge/release%20level-stable-brightgreen.svg?style=flat)](https://cloud.google.com/terms/launch-stages) -[![npm version](https://img.shields.io/npm/v/@google-cloud/projectify.svg)](https://www.npmjs.org/package/@google-cloud/projectify) - - - - -A simple utility for replacing the projectid token in objects. - - -A comprehensive list of changes in each version may be found in -[the CHANGELOG](https://github.com/googleapis/nodejs-projectify/blob/main/CHANGELOG.md). - -* [Google Cloud Common Projectify Node.js Client API Reference][client-docs] - -* [github.com/googleapis/nodejs-projectify](https://github.com/googleapis/nodejs-projectify) - -Read more about the client libraries for Cloud APIs, including the older -Google APIs Client Libraries, in [Client Libraries Explained][explained]. - -[explained]: https://cloud.google.com/apis/docs/client-libraries-explained - -**Table of contents:** - - -* [Quickstart](#quickstart) - - * [Installing the client library](#installing-the-client-library) - * [Using the client library](#using-the-client-library) -* [Samples](#samples) -* [Versioning](#versioning) -* [Contributing](#contributing) -* [License](#license) - -## Quickstart - -### Installing the client library - -```bash -npm install @google-cloud/projectify -``` - - -### Using the client library - -```javascript -const {replaceProjectIdToken} = require('@google-cloud/projectify'); -const options = { - projectId: '{{projectId}}', -}; -replaceProjectIdToken(options, 'fake-project-id'); - -``` - - - -## Samples - -Samples are in the [`samples/`](https://github.com/googleapis/nodejs-projectify/tree/main/samples) directory. Each sample's `README.md` has instructions for running its sample. - -| Sample | Source Code | Try it | -| --------------------------- | --------------------------------- | ------ | -| Quickstart | [source code](https://github.com/googleapis/nodejs-projectify/blob/main/samples/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-projectify&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) | - - - -The [Google Cloud Common Projectify Node.js Client API Reference][client-docs] documentation -also contains samples. - -## Supported Node.js Versions - -Our client libraries follow the [Node.js release schedule](https://nodejs.org/en/about/releases/). -Libraries are compatible with all current _active_ and _maintenance_ versions of -Node.js. -If you are using an end-of-life version of Node.js, we recommend that you update -as soon as possible to an actively supported LTS version. - -Google's client libraries support legacy versions of Node.js runtimes on a -best-efforts basis with the following warnings: - -* Legacy versions are not tested in continuous integration. -* Some security patches and features cannot be backported. -* Dependencies cannot be kept up-to-date. - -Client libraries targeting some end-of-life versions of Node.js are available, and -can be installed through npm [dist-tags](https://docs.npmjs.com/cli/dist-tag). -The dist-tags follow the naming convention `legacy-(version)`. -For example, `npm install @google-cloud/projectify@legacy-8` installs client libraries -for versions compatible with Node.js 8. - -## Versioning - -This library follows [Semantic Versioning](http://semver.org/). - - - -This library is considered to be **stable**. The code surface will not change in backwards-incompatible ways -unless absolutely necessary (e.g. because of critical security issues) or with -an extensive deprecation period. Issues and requests against **stable** libraries -are addressed with the highest priority. - - - - - - -More Information: [Google Cloud Platform Launch Stages][launch_stages] - -[launch_stages]: https://cloud.google.com/terms/launch-stages - -## Contributing - -Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/nodejs-projectify/blob/main/CONTRIBUTING.md). - -Please note that this `README.md`, the `samples/README.md`, -and a variety of configuration files in this repository (including `.nycrc` and `tsconfig.json`) -are generated from a central template. To edit one of these files, make an edit -to its templates in -[directory](https://github.com/googleapis/synthtool). - -## License - -Apache Version 2.0 - -See [LICENSE](https://github.com/googleapis/nodejs-projectify/blob/main/LICENSE) - -[client-docs]: https://cloud.google.com/nodejs/docs/reference/projectify/latest - -[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png -[projects]: https://console.cloud.google.com/project -[billing]: https://support.google.com/cloud/answer/6293499#enable-billing - -[auth]: https://cloud.google.com/docs/authentication/getting-started diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/projectify/package.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/projectify/package.json deleted file mode 100644 index 696247c8..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/projectify/package.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "name": "@google-cloud/projectify", - "version": "3.0.0", - "description": "A simple utility for replacing the projectid token in objects.", - "main": "build/src/index.js", - "types": "build/src/index.d.ts", - "repository": "googleapis/nodejs-projectify", - "scripts": { - "test": "c8 mocha build/test", - "lint": "gts check", - "clean": "gts clean", - "compile": "tsc -p .", - "fix": "gts fix", - "prepare": "npm run compile", - "pretest": "npm run compile", - "docs": "compodoc src/", - "presystem-test": "npm run compile", - "samples-test": "cd samples/ && npm link ../ && npm test && cd ../", - "system-test": "mocha build/system-test", - "docs-test": "linkinator docs", - "predocs-test": "npm run docs", - "prelint": "cd samples; npm link ../; npm install", - "precompile": "gts clean" - }, - "keywords": [], - "files": [ - "build/src", - "!build/src/**/*.map" - ], - "author": "Google Inc.", - "license": "Apache-2.0", - "devDependencies": { - "@compodoc/compodoc": "^1.1.11", - "@types/mocha": "^9.0.0", - "@types/node": "^16.0.0", - "c8": "^7.1.0", - "codecov": "^3.6.5", - "gts": "^3.1.0", - "linkinator": "^2.0.4", - "mocha": "^9.2.2", - "typescript": "^4.6.4" - }, - "engines": { - "node": ">=12.0.0" - } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/promisify/CHANGELOG.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/promisify/CHANGELOG.md deleted file mode 100644 index f3a56bb7..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/promisify/CHANGELOG.md +++ /dev/null @@ -1,180 +0,0 @@ -# Changelog - -[npm history][1] - -[1]: https://www.npmjs.com/package/nodejs-promisify?activeTab=versions - -## [3.0.1](https://github.com/googleapis/nodejs-promisify/compare/v3.0.0...v3.0.1) (2022-08-23) - - -### Bug Fixes - -* remove pip install statements ([#1546](https://github.com/googleapis/nodejs-promisify/issues/1546)) ([#310](https://github.com/googleapis/nodejs-promisify/issues/310)) ([c7c6883](https://github.com/googleapis/nodejs-promisify/commit/c7c688389de72ddc0181b19bceee2d95eacd3d96)) - -## [3.0.0](https://github.com/googleapis/nodejs-promisify/compare/v2.0.4...v3.0.0) (2022-05-03) - - -### ⚠ BREAKING CHANGES - -* drop node 10 from engines list, update typescript to 4.6.3 (#300) - -### Build System - -* drop node 10 from engines list, update typescript to 4.6.3 ([#300](https://github.com/googleapis/nodejs-promisify/issues/300)) ([fed2f14](https://github.com/googleapis/nodejs-promisify/commit/fed2f145a5256c939eb66b85a5c7c48332b8841d)) - -### [2.0.4](https://www.github.com/googleapis/nodejs-promisify/compare/v2.0.3...v2.0.4) (2021-09-09) - - -### Bug Fixes - -* **build:** switch primary branch to main ([#270](https://www.github.com/googleapis/nodejs-promisify/issues/270)) ([11242f7](https://www.github.com/googleapis/nodejs-promisify/commit/11242f7f76e170dae7a429f8d4064bf33be9bb3f)) - -### [2.0.3](https://www.github.com/googleapis/nodejs-promisify/compare/v2.0.2...v2.0.3) (2020-09-04) - - -### Bug Fixes - -* allow excluding accessor methods ([#228](https://www.github.com/googleapis/nodejs-promisify/issues/228)) ([114d8bc](https://www.github.com/googleapis/nodejs-promisify/commit/114d8bcef7093bdfda195a15e0c2f376195fd3fc)) - -### [2.0.2](https://www.github.com/googleapis/nodejs-promisify/compare/v2.0.1...v2.0.2) (2020-07-06) - - -### Bug Fixes - -* update node issue template ([#204](https://www.github.com/googleapis/nodejs-promisify/issues/204)) ([a2ba8d8](https://www.github.com/googleapis/nodejs-promisify/commit/a2ba8d8e45ef03d093d987292a467696745fc9fd)) - -### [2.0.1](https://www.github.com/googleapis/nodejs-promisify/compare/v2.0.0...v2.0.1) (2020-05-08) - - -### Bug Fixes - -* apache license URL ([#468](https://www.github.com/googleapis/nodejs-promisify/issues/468)) ([#191](https://www.github.com/googleapis/nodejs-promisify/issues/191)) ([0edc724](https://www.github.com/googleapis/nodejs-promisify/commit/0edc7246c53d25d9dd220b813561bcee97250783)) - -## [2.0.0](https://www.github.com/googleapis/nodejs-promisify/compare/v1.0.4...v2.0.0) (2020-03-23) - - -### ⚠ BREAKING CHANGES - -* update to latest version of gts/typescript (#183) -* drop Node 8 from engines field (#184) - -### Features - -* drop Node 8 from engines field ([#184](https://www.github.com/googleapis/nodejs-promisify/issues/184)) ([7e6d3c5](https://www.github.com/googleapis/nodejs-promisify/commit/7e6d3c54066d89530ed25c7f9722efd252f43fb8)) - - -### Build System - -* update to latest version of gts/typescript ([#183](https://www.github.com/googleapis/nodejs-promisify/issues/183)) ([9c3ed12](https://www.github.com/googleapis/nodejs-promisify/commit/9c3ed12c12f4bb1e17af7440c6371c4cefddcd59)) - -### [1.0.4](https://www.github.com/googleapis/nodejs-promisify/compare/v1.0.3...v1.0.4) (2019-12-05) - - -### Bug Fixes - -* **deps:** pin TypeScript below 3.7.0 ([e48750e](https://www.github.com/googleapis/nodejs-promisify/commit/e48750ef96aa20eb3a2b73fe2f062d04430468a7)) - -### [1.0.3](https://www.github.com/googleapis/nodejs-promisify/compare/v1.0.2...v1.0.3) (2019-11-13) - - -### Bug Fixes - -* **docs:** add jsdoc-region-tag plugin ([#146](https://www.github.com/googleapis/nodejs-promisify/issues/146)) ([ff0ee74](https://www.github.com/googleapis/nodejs-promisify/commit/ff0ee7408f50e8f7147b8ccf7e10337aa5920076)) - -### [1.0.2](https://www.github.com/googleapis/nodejs-promisify/compare/v1.0.1...v1.0.2) (2019-06-26) - - -### Bug Fixes - -* **docs:** link to reference docs section on googleapis.dev ([#128](https://www.github.com/googleapis/nodejs-promisify/issues/128)) ([5a8bd90](https://www.github.com/googleapis/nodejs-promisify/commit/5a8bd90)) - -### [1.0.1](https://www.github.com/googleapis/nodejs-promisify/compare/v1.0.0...v1.0.1) (2019-06-14) - - -### Bug Fixes - -* **docs:** move to new client docs URL ([#124](https://www.github.com/googleapis/nodejs-promisify/issues/124)) ([34d18cd](https://www.github.com/googleapis/nodejs-promisify/commit/34d18cd)) - -## [1.0.0](https://www.github.com/googleapis/nodejs-promisify/compare/v0.4.0...v1.0.0) (2019-05-02) - - -### Build System - -* upgrade engines field to >=8.10.0 ([#108](https://www.github.com/googleapis/nodejs-promisify/issues/108)) ([78ab89c](https://www.github.com/googleapis/nodejs-promisify/commit/78ab89c)) - - -### BREAKING CHANGES - -* upgrade engines field to >=8.10.0 (#108) - -## v0.4.0 - -02-12-2019 19:44 PST - -### New features -- feat: add callbackify() and callbackifyAll() methods ([#82](https://github.com/googleapis/nodejs-promisify/pull/82)) - -### Documentation -- docs: update contributing path in README ([#86](https://github.com/googleapis/nodejs-promisify/pull/86)) -- chore: move CONTRIBUTING.md to root ([#85](https://github.com/googleapis/nodejs-promisify/pull/85)) -- docs: add lint/fix example to contributing guide ([#83](https://github.com/googleapis/nodejs-promisify/pull/83)) - -### Internal / Testing Changes -- build: create docs test npm scripts ([#88](https://github.com/googleapis/nodejs-promisify/pull/88)) -- build: test using @grpc/grpc-js in CI ([#87](https://github.com/googleapis/nodejs-promisify/pull/87)) -- build: ignore googleapis.com in doc link check ([#81](https://github.com/googleapis/nodejs-promisify/pull/81)) -- build: check broken links in generated docs ([#79](https://github.com/googleapis/nodejs-promisify/pull/79)) -- chore(deps): update dependency @types/sinon to v7 ([#78](https://github.com/googleapis/nodejs-promisify/pull/78)) -- chore(build): inject yoshi automation key ([#77](https://github.com/googleapis/nodejs-promisify/pull/77)) -- chore: update nyc and eslint configs ([#76](https://github.com/googleapis/nodejs-promisify/pull/76)) -- chore: fix publish.sh permission +x ([#74](https://github.com/googleapis/nodejs-promisify/pull/74)) -- fix(build): fix Kokoro release script ([#73](https://github.com/googleapis/nodejs-promisify/pull/73)) -- build: add Kokoro configs for autorelease ([#72](https://github.com/googleapis/nodejs-promisify/pull/72)) -- chore: always nyc report before calling codecov ([#69](https://github.com/googleapis/nodejs-promisify/pull/69)) -- chore: nyc ignore build/test by default ([#68](https://github.com/googleapis/nodejs-promisify/pull/68)) -- chore(build): update prettier config ([#66](https://github.com/googleapis/nodejs-promisify/pull/66)) -- fix: get the build passing ([#65](https://github.com/googleapis/nodejs-promisify/pull/65)) -- chore: update license file ([#64](https://github.com/googleapis/nodejs-promisify/pull/64)) -- fix(build): fix system key decryption ([#60](https://github.com/googleapis/nodejs-promisify/pull/60)) -- chore(deps): update dependency @types/sinon to v5.0.7 ([#58](https://github.com/googleapis/nodejs-promisify/pull/58)) -- fix: Pin @types/sinon to last compatible version ([#57](https://github.com/googleapis/nodejs-promisify/pull/57)) -- chore: add synth.metadata -- chore(deps): update dependency gts to ^0.9.0 ([#54](https://github.com/googleapis/nodejs-promisify/pull/54)) -- chore: update eslintignore config ([#53](https://github.com/googleapis/nodejs-promisify/pull/53)) -- chore: use latest npm on Windows ([#52](https://github.com/googleapis/nodejs-promisify/pull/52)) -- chore: update CircleCI config ([#51](https://github.com/googleapis/nodejs-promisify/pull/51)) -- chore: include build in eslintignore ([#48](https://github.com/googleapis/nodejs-promisify/pull/48)) -- chore: update issue templates ([#44](https://github.com/googleapis/nodejs-promisify/pull/44)) -- chore: remove old issue template ([#42](https://github.com/googleapis/nodejs-promisify/pull/42)) -- build: run tests on node11 ([#41](https://github.com/googleapis/nodejs-promisify/pull/41)) -- chores(build): do not collect sponge.xml from windows builds ([#40](https://github.com/googleapis/nodejs-promisify/pull/40)) -- chores(build): run codecov on continuous builds ([#39](https://github.com/googleapis/nodejs-promisify/pull/39)) -- chore: update new issue template ([#38](https://github.com/googleapis/nodejs-promisify/pull/38)) -- chore(deps): update dependency sinon to v7 ([#33](https://github.com/googleapis/nodejs-promisify/pull/33)) -- build: fix codecov uploading on Kokoro ([#34](https://github.com/googleapis/nodejs-promisify/pull/34)) -- Update kokoro config ([#30](https://github.com/googleapis/nodejs-promisify/pull/30)) -- Update CI config ([#28](https://github.com/googleapis/nodejs-promisify/pull/28)) -- Don't publish sourcemaps ([#26](https://github.com/googleapis/nodejs-promisify/pull/26)) -- Update kokoro config ([#24](https://github.com/googleapis/nodejs-promisify/pull/24)) -- test: remove appveyor config ([#23](https://github.com/googleapis/nodejs-promisify/pull/23)) -- Update CI config ([#22](https://github.com/googleapis/nodejs-promisify/pull/22)) -- Enable prefer-const in the eslint config ([#21](https://github.com/googleapis/nodejs-promisify/pull/21)) -- Enable no-var in eslint ([#19](https://github.com/googleapis/nodejs-promisify/pull/19)) -- Update CI config ([#18](https://github.com/googleapis/nodejs-promisify/pull/18)) - -## v0.3.1 - -### Internal / Testing Changes -- Add synth script and update CI (#14) -- chore(deps): update dependency nyc to v13 (#12) -- chore: ignore package-lock.json (#11) -- chore(deps): lock file maintenance (#10) -- chore: update renovate config (#9) -- remove that whitespace (#8) -- chore(deps): lock file maintenance (#7) -- chore(deps): update dependency typescript to v3 (#6) -- chore: assert.deelEqual => assert.deepStrictEqual (#5) -- chore: move mocha options to mocha.opts (#4) -- chore(deps): update dependency gts to ^0.8.0 (#1) -- chore(deps): lock file maintenance (#3) -- chore(deps): lock file maintenance (#2) diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/promisify/LICENSE b/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/promisify/LICENSE deleted file mode 100644 index d6456956..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/promisify/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/promisify/README.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/promisify/README.md deleted file mode 100644 index cae6f16c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/promisify/README.md +++ /dev/null @@ -1,156 +0,0 @@ -[//]: # "This README.md file is auto-generated, all changes to this file will be lost." -[//]: # "To regenerate it, use `python -m synthtool`." -Google Cloud Platform logo - -# [Google Cloud Common Promisify: Node.js Client](https://github.com/googleapis/nodejs-promisify) - -[![release level](https://img.shields.io/badge/release%20level-stable-brightgreen.svg?style=flat)](https://cloud.google.com/terms/launch-stages) -[![npm version](https://img.shields.io/npm/v/@google-cloud/promisify.svg)](https://www.npmjs.org/package/@google-cloud/promisify) - - - - -A simple utility for promisifying functions and classes. - - -A comprehensive list of changes in each version may be found in -[the CHANGELOG](https://github.com/googleapis/nodejs-promisify/blob/main/CHANGELOG.md). - -* [Google Cloud Common Promisify Node.js Client API Reference][client-docs] - -* [github.com/googleapis/nodejs-promisify](https://github.com/googleapis/nodejs-promisify) - -Read more about the client libraries for Cloud APIs, including the older -Google APIs Client Libraries, in [Client Libraries Explained][explained]. - -[explained]: https://cloud.google.com/apis/docs/client-libraries-explained - -**Table of contents:** - - -* [Quickstart](#quickstart) - - * [Installing the client library](#installing-the-client-library) - * [Using the client library](#using-the-client-library) -* [Samples](#samples) -* [Versioning](#versioning) -* [Contributing](#contributing) -* [License](#license) - -## Quickstart - -### Installing the client library - -```bash -npm install @google-cloud/promisify -``` - - -### Using the client library - -```javascript -const {promisify} = require('@google-cloud/promisify'); - -/** - * This is a very basic example function that accepts a callback. - */ -function someCallbackFunction(name, callback) { - if (!name) { - callback(new Error('Name is required!')); - } else { - callback(null, `Well hello there, ${name}!`); - } -} - -// let's promisify it! -const somePromiseFunction = promisify(someCallbackFunction); - -async function quickstart() { - // now we can just `await` the function to use it like a promisified method - const [result] = await somePromiseFunction('nodestronaut'); - console.log(result); -} -quickstart(); - -``` -It's unlikely you will need to install this package directly, as it will be -installed as a dependency when you install other `@google-cloud` packages. - - -## Samples - -Samples are in the [`samples/`](https://github.com/googleapis/nodejs-promisify/tree/main/samples) directory. Each sample's `README.md` has instructions for running its sample. - -| Sample | Source Code | Try it | -| --------------------------- | --------------------------------- | ------ | -| Quickstart | [source code](https://github.com/googleapis/nodejs-promisify/blob/main/samples/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-promisify&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) | - - - -The [Google Cloud Common Promisify Node.js Client API Reference][client-docs] documentation -also contains samples. - -## Supported Node.js Versions - -Our client libraries follow the [Node.js release schedule](https://nodejs.org/en/about/releases/). -Libraries are compatible with all current _active_ and _maintenance_ versions of -Node.js. -If you are using an end-of-life version of Node.js, we recommend that you update -as soon as possible to an actively supported LTS version. - -Google's client libraries support legacy versions of Node.js runtimes on a -best-efforts basis with the following warnings: - -* Legacy versions are not tested in continuous integration. -* Some security patches and features cannot be backported. -* Dependencies cannot be kept up-to-date. - -Client libraries targeting some end-of-life versions of Node.js are available, and -can be installed through npm [dist-tags](https://docs.npmjs.com/cli/dist-tag). -The dist-tags follow the naming convention `legacy-(version)`. -For example, `npm install @google-cloud/promisify@legacy-8` installs client libraries -for versions compatible with Node.js 8. - -## Versioning - -This library follows [Semantic Versioning](http://semver.org/). - - - -This library is considered to be **stable**. The code surface will not change in backwards-incompatible ways -unless absolutely necessary (e.g. because of critical security issues) or with -an extensive deprecation period. Issues and requests against **stable** libraries -are addressed with the highest priority. - - - - - - -More Information: [Google Cloud Platform Launch Stages][launch_stages] - -[launch_stages]: https://cloud.google.com/terms/launch-stages - -## Contributing - -Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/nodejs-promisify/blob/main/CONTRIBUTING.md). - -Please note that this `README.md`, the `samples/README.md`, -and a variety of configuration files in this repository (including `.nycrc` and `tsconfig.json`) -are generated from a central template. To edit one of these files, make an edit -to its templates in -[directory](https://github.com/googleapis/synthtool). - -## License - -Apache Version 2.0 - -See [LICENSE](https://github.com/googleapis/nodejs-promisify/blob/main/LICENSE) - -[client-docs]: https://googleapis.dev/nodejs/promisify/latest - -[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png -[projects]: https://console.cloud.google.com/project -[billing]: https://support.google.com/cloud/answer/6293499#enable-billing - -[auth]: https://cloud.google.com/docs/authentication/getting-started diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/promisify/package.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/promisify/package.json deleted file mode 100644 index fb12764b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/promisify/package.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "name": "@google-cloud/promisify", - "version": "3.0.1", - "description": "A simple utility for promisifying functions and classes.", - "main": "build/src/index.js", - "types": "build/src/index.d.ts", - "repository": "googleapis/nodejs-promisify", - "scripts": { - "test": "c8 mocha build/test", - "lint": "gts check", - "compile": "tsc -p .", - "fix": "gts fix", - "prepare": "npm run compile", - "pretest": "npm run compile", - "docs": "compodoc src/", - "presystem-test": "npm run compile", - "samples-test": "cd samples/ && npm link ../ && npm test && cd ../", - "system-test": "mocha build/system-test", - "docs-test": "linkinator docs", - "predocs-test": "npm run docs", - "prelint": "cd samples; npm link ../; npm install", - "clean": "gts clean", - "precompile": "gts clean" - }, - "keywords": [], - "files": [ - "build/src", - "!build/src/**/*.map" - ], - "author": "Google Inc.", - "license": "Apache-2.0", - "devDependencies": { - "@compodoc/compodoc": "^1.1.9", - "@types/mocha": "^9.0.0", - "@types/node": "^17.0.25", - "@types/sinon": "^10.0.0", - "c8": "^7.0.0", - "chai": "^4.2.0", - "codecov": "^3.0.4", - "gts": "^3.1.0", - "hard-rejection": "^2.1.0", - "linkinator": "^4.0.0", - "mocha": "^8.0.0", - "sinon": "^14.0.0", - "typescript": "^4.6.3" - }, - "engines": { - "node": ">=12" - } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/CHANGELOG.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/CHANGELOG.md deleted file mode 100644 index df1271e6..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/CHANGELOG.md +++ /dev/null @@ -1,1418 +0,0 @@ -# Changelog - -[npm history][1] - -[1]: https://www.npmjs.com/package/@google-cloud/storage?activeTab=versions - -## [6.7.0](https://github.com/googleapis/nodejs-storage/compare/v6.6.0...v6.7.0) (2022-11-03) - - -### Features - -* Support autoclass ([#2078](https://github.com/googleapis/nodejs-storage/issues/2078)) ([7e83580](https://github.com/googleapis/nodejs-storage/commit/7e8358008467dd2d77702734e05f54bc06c9ca5b)) - -## [6.6.0](https://github.com/googleapis/nodejs-storage/compare/v6.5.4...v6.6.0) (2022-10-25) - - -### Features - -* **crc32c:** Convenient Method For Reading Files ([#2095](https://github.com/googleapis/nodejs-storage/issues/2095)) ([2145c81](https://github.com/googleapis/nodejs-storage/commit/2145c8177f3659fb5f193045866fbcd1220aaeaf)) - - -### Bug Fixes - -* Remove async from final function which causes double invocation … ([#2094](https://github.com/googleapis/nodejs-storage/issues/2094)) ([1a3df98](https://github.com/googleapis/nodejs-storage/commit/1a3df985e9096229bc2909921b4974680e12be2a)) - -## [6.5.4](https://github.com/googleapis/nodejs-storage/compare/v6.5.3...v6.5.4) (2022-10-20) - - -### Bug Fixes - -* Revert STORAGE_EMULATOR_HOST handling ([#2089](https://github.com/googleapis/nodejs-storage/issues/2089)) ([48dce65](https://github.com/googleapis/nodejs-storage/commit/48dce654064470f7496d160d87b696ab5cfd65d4)) - -## [6.5.3](https://github.com/googleapis/nodejs-storage/compare/v6.5.2...v6.5.3) (2022-10-18) - - -### Bug Fixes - -* Correct STORAGE_EMULATOR_HOST handling ([#2069](https://github.com/googleapis/nodejs-storage/issues/2069), [#1314](https://github.com/googleapis/nodejs-storage/issues/1314)) ([#2070](https://github.com/googleapis/nodejs-storage/issues/2070)) ([c75b8b8](https://github.com/googleapis/nodejs-storage/commit/c75b8b82262dddb794304a71f648bd6e03cafb30)) - -## [6.5.2](https://github.com/googleapis/nodejs-storage/compare/v6.5.1...v6.5.2) (2022-09-23) - - -### Bug Fixes - -* Determine `Content-Length` Before Attempting Multi-chunk Upload ([#2074](https://github.com/googleapis/nodejs-storage/issues/2074)) ([666402a](https://github.com/googleapis/nodejs-storage/commit/666402a6a65c2ee8e91bc4fe072e91c0b893864e)) - -## [6.5.1](https://github.com/googleapis/nodejs-storage/compare/v6.5.0...v6.5.1) (2022-09-20) - - -### Bug Fixes - -* Revert skip validation ([#2023](https://github.com/googleapis/nodejs-storage/issues/2023)) ([70ab224](https://github.com/googleapis/nodejs-storage/commit/70ab22459b51b9781e40b0cc86663c1658e43520)) - -## [6.5.0](https://github.com/googleapis/nodejs-storage/compare/v6.4.2...v6.5.0) (2022-09-15) - - -### Features - -* Add multiple lifecycle rules ([#2062](https://github.com/googleapis/nodejs-storage/issues/2062)) ([fbe2deb](https://github.com/googleapis/nodejs-storage/commit/fbe2deb72bd98db54a03cf228a360a871ba1915b)) - -## [6.4.2](https://github.com/googleapis/nodejs-storage/compare/v6.4.1...v6.4.2) (2022-09-01) - - -### Bug Fixes - -* remove pip install statements ([#1546](https://github.com/googleapis/nodejs-storage/issues/1546)) ([#2049](https://github.com/googleapis/nodejs-storage/issues/2049)) ([c90ba0f](https://github.com/googleapis/nodejs-storage/commit/c90ba0feecca9d39de3c52f12cc9423b7a2d4d47)) -* truncated `createReadStream` through early `end` event ([#2056](https://github.com/googleapis/nodejs-storage/issues/2056)) ([a4716a4](https://github.com/googleapis/nodejs-storage/commit/a4716a4ed1053560f2692647c8a90131763c1e72)) - -## [6.4.1](https://github.com/googleapis/nodejs-storage/compare/v6.4.0...v6.4.1) (2022-08-12) - - -### Bug Fixes - -* Remove `pumpify` ([#2029](https://github.com/googleapis/nodejs-storage/issues/2029)) ([edc1d64](https://github.com/googleapis/nodejs-storage/commit/edc1d64069a6038c301c3b775f116fbf69b10b28)) -* Retry `EPIPE` Connection Errors + Attempt Retries in Resumable Upload Connection Errors ([#2040](https://github.com/googleapis/nodejs-storage/issues/2040)) ([ba35321](https://github.com/googleapis/nodejs-storage/commit/ba35321c3fef9a1874ff8fbea43885e2e7746b4f)) - -## [6.4.0](https://github.com/googleapis/nodejs-storage/compare/v6.3.0...v6.4.0) (2022-08-10) - - -### Features - -* add functionality for passing preconditions at the function level ([#1993](https://github.com/googleapis/nodejs-storage/issues/1993)) ([21f173e](https://github.com/googleapis/nodejs-storage/commit/21f173eb17d4216e2b42ffdd1ed0104aeda7cf13)) - -## [6.3.0](https://github.com/googleapis/nodejs-storage/compare/v6.2.3...v6.3.0) (2022-08-01) - - -### Features - -* custom dual regions refactor implementation ([#2012](https://github.com/googleapis/nodejs-storage/issues/2012)) ([9a614fb](https://github.com/googleapis/nodejs-storage/commit/9a614fb2b624f8234fa9d40f352dae177b2b0374)) - -## [6.2.3](https://github.com/googleapis/nodejs-storage/compare/v6.2.2...v6.2.3) (2022-07-13) - - -### Bug Fixes - -* force setMetadata calls to use promise version, invoke callbacks manually ([#2000](https://github.com/googleapis/nodejs-storage/issues/2000)) ([f488647](https://github.com/googleapis/nodejs-storage/commit/f488647d5ac8ccfdb479d7ea24a377d10573b8c4)) - -## [6.2.2](https://github.com/googleapis/nodejs-storage/compare/v6.2.1...v6.2.2) (2022-06-29) - - -### Bug Fixes - -* correctly handle an empty file in download function ([#1995](https://github.com/googleapis/nodejs-storage/issues/1995)) ([f1a5a0b](https://github.com/googleapis/nodejs-storage/commit/f1a5a0bd121b84c3d56a9eddbd31593089634574)) - -## [6.2.1](https://github.com/googleapis/nodejs-storage/compare/v6.2.0...v6.2.1) (2022-06-27) - - -### Bug Fixes - -* explicitly import URL so that .d.ts file is correctly generated ([#1992](https://github.com/googleapis/nodejs-storage/issues/1992)) ([a968f50](https://github.com/googleapis/nodejs-storage/commit/a968f508e7c98e160b658ffc3ab568997548172f)) - -## [6.2.0](https://github.com/googleapis/nodejs-storage/compare/v6.1.0...v6.2.0) (2022-06-22) - - -### Features - -* Convenient `gs://` URI retrieval ([#1987](https://github.com/googleapis/nodejs-storage/issues/1987)) ([58fad6d](https://github.com/googleapis/nodejs-storage/commit/58fad6d9a3bd92966306e98fd7dedd3992995cb7)) - - -### Bug Fixes - -* **deps:** update dependency @google-cloud/projectify to v3 ([#1986](https://github.com/googleapis/nodejs-storage/issues/1986)) ([71a61ec](https://github.com/googleapis/nodejs-storage/commit/71a61ec4ef2436bc091f390af14a02b6920b2b87)) -* **deps:** update dependency @google-cloud/pubsub to v3 ([#1972](https://github.com/googleapis/nodejs-storage/issues/1972)) ([004b97e](https://github.com/googleapis/nodejs-storage/commit/004b97ec0ae866997c84ee2327db87e59f510f00)) -* Requests Respect `config.projectIdRequired` === `false` ([#1988](https://github.com/googleapis/nodejs-storage/issues/1988)) ([8813369](https://github.com/googleapis/nodejs-storage/commit/881336944be37e15c45b12973064245adc519860)) - -## [6.1.0](https://github.com/googleapis/nodejs-storage/compare/v6.0.1...v6.1.0) (2022-06-08) - - -### Features - -* support OLM Prefix/Suffix ([#1847](https://github.com/googleapis/nodejs-storage/issues/1847)) ([c22984c](https://github.com/googleapis/nodejs-storage/commit/c22984caa8e8ae09a61d308876b2b3d97503777b)) - -### [6.0.1](https://github.com/googleapis/nodejs-storage/compare/v6.0.0...v6.0.1) (2022-05-25) - - -### Bug Fixes - -* capture and throw on non-existent files ([#1969](https://github.com/googleapis/nodejs-storage/issues/1969)) ([52d81c0](https://github.com/googleapis/nodejs-storage/commit/52d81c026f30aef0902ea7173dfa6da2e7f97d50)) - -## [6.0.0](https://github.com/googleapis/nodejs-storage/compare/v5.20.5...v6.0.0) (2022-05-24) - - -### ⚠ BREAKING CHANGES - -* update TypeScript -* remove deprecated fields -* remove configstore -* align resumable upload behavior -* utilize internalized CRC32C utilities -* drop node 10 support - -### Build System - -* drop node 10 support ([77fa8d9](https://github.com/googleapis/nodejs-storage/commit/77fa8d9f95afbc830b57188ce0d2dfac46476d0b)) - - -### Code Refactoring - -* align resumable upload behavior ([77fa8d9](https://github.com/googleapis/nodejs-storage/commit/77fa8d9f95afbc830b57188ce0d2dfac46476d0b)) -* remove configstore ([77fa8d9](https://github.com/googleapis/nodejs-storage/commit/77fa8d9f95afbc830b57188ce0d2dfac46476d0b)) -* remove deprecated fields ([77fa8d9](https://github.com/googleapis/nodejs-storage/commit/77fa8d9f95afbc830b57188ce0d2dfac46476d0b)) -* utilize internalized CRC32C utilities ([77fa8d9](https://github.com/googleapis/nodejs-storage/commit/77fa8d9f95afbc830b57188ce0d2dfac46476d0b)) - - -### deps - -* update TypeScript ([77fa8d9](https://github.com/googleapis/nodejs-storage/commit/77fa8d9f95afbc830b57188ce0d2dfac46476d0b)) - -### [5.20.5](https://github.com/googleapis/nodejs-storage/compare/v5.20.4...v5.20.5) (2022-05-19) - - -### Bug Fixes - -* **chore:** move uuid package to dependencies ([#1952](https://github.com/googleapis/nodejs-storage/issues/1952)) ([0ff5aa3](https://github.com/googleapis/nodejs-storage/commit/0ff5aa3e9ff8b4dcc536b9494e44b9a2fb217727)) - -### [5.20.4](https://github.com/googleapis/nodejs-storage/compare/v5.20.3...v5.20.4) (2022-05-18) - - -### Bug Fixes - -* revert native typescript mocha tests ([#1947](https://github.com/googleapis/nodejs-storage/issues/1947)) ([1d0ea7d](https://github.com/googleapis/nodejs-storage/commit/1d0ea7d2281a049bc99c6bd810dd24ffc83c6a09)) -* support empty object uploads for resumable upload ([#1949](https://github.com/googleapis/nodejs-storage/issues/1949)) ([da6016e](https://github.com/googleapis/nodejs-storage/commit/da6016e20b681d6a75ed1a5459cfd333b58c70a9)) - -### [5.20.3](https://github.com/googleapis/nodejs-storage/compare/v5.20.2...v5.20.3) (2022-05-17) - - -### Bug Fixes - -* move retrieval of package.json to utility function ([#1941](https://github.com/googleapis/nodejs-storage/issues/1941)) ([ac5cbdf](https://github.com/googleapis/nodejs-storage/commit/ac5cbdf0d3c363e7dab43e9002b01a0dae877642)) - -### [5.20.2](https://github.com/googleapis/nodejs-storage/compare/v5.20.1...v5.20.2) (2022-05-17) - - -### Bug Fixes - -* use path.join and __dirname for require package.json ([#1936](https://github.com/googleapis/nodejs-storage/issues/1936)) ([b868762](https://github.com/googleapis/nodejs-storage/commit/b86876201ec7d4ce58ae5c1d9635dad82a1fdc4b)) - -### [5.20.1](https://github.com/googleapis/nodejs-storage/compare/v5.20.0...v5.20.1) (2022-05-16) - - -### Bug Fixes - -* do not use import on package.json ([#1932](https://github.com/googleapis/nodejs-storage/issues/1932)) ([d0f0494](https://github.com/googleapis/nodejs-storage/commit/d0f04941f1cabf7c153f7e5abb91c358f12ef83e)) - -## [5.20.0](https://github.com/googleapis/nodejs-storage/compare/v5.19.4...v5.20.0) (2022-05-16) - - -### Features - -* add x-goog-api-client headers for retry metrics ([#1920](https://github.com/googleapis/nodejs-storage/issues/1920)) ([0c7e4f6](https://github.com/googleapis/nodejs-storage/commit/0c7e4f6ade4cee1715e14b3cd9abf2aa2a56c0b9)) - -### [5.19.4](https://github.com/googleapis/nodejs-storage/compare/v5.19.3...v5.19.4) (2022-04-28) - - -### Bug Fixes - -* don't modify passed in options ([#1895](https://github.com/googleapis/nodejs-storage/issues/1895)) ([cd80ca3](https://github.com/googleapis/nodejs-storage/commit/cd80ca318a2b10379b8b166a59f3943b97576475)) - -### [5.19.3](https://github.com/googleapis/nodejs-storage/compare/v5.19.2...v5.19.3) (2022-04-20) - - -### Bug Fixes - -* export idempotencystrategy and preconditionoptions from index ([#1880](https://github.com/googleapis/nodejs-storage/issues/1880)) ([8aafe04](https://github.com/googleapis/nodejs-storage/commit/8aafe0453a8e2dc41f848dd5165d3e86d6a160ed)) - -### [5.19.2](https://github.com/googleapis/nodejs-storage/compare/v5.19.1...v5.19.2) (2022-04-14) - - -### Bug Fixes - -* deleting, getting, and getting metadata for notifications ([#1872](https://github.com/googleapis/nodejs-storage/issues/1872)) ([451570e](https://github.com/googleapis/nodejs-storage/commit/451570e6038a1b91b5723db9b941cd916fd76348)) - -### [5.19.1](https://github.com/googleapis/nodejs-storage/compare/v5.19.0...v5.19.1) (2022-04-08) - - -### Bug Fixes - -* prevent retrying 200 response ([#1857](https://github.com/googleapis/nodejs-storage/issues/1857)) ([638a47b](https://github.com/googleapis/nodejs-storage/commit/638a47b4e7ecc6e94b3b11d1ccc7c52afdeaafe1)) - -## [5.19.0](https://github.com/googleapis/nodejs-storage/compare/v5.18.3...v5.19.0) (2022-04-06) - - -### Features - -* Dual Region Support ([#1814](https://github.com/googleapis/nodejs-storage/issues/1814)) ([caf7ee5](https://github.com/googleapis/nodejs-storage/commit/caf7ee561fd640b0daea92c7837c47e66070c30c)) - -### [5.18.3](https://github.com/googleapis/nodejs-storage/compare/v5.18.2...v5.18.3) (2022-03-28) - - -### Bug Fixes - -* encode name portion when calling publicUrl function ([#1828](https://github.com/googleapis/nodejs-storage/issues/1828)) ([5522b35](https://github.com/googleapis/nodejs-storage/commit/5522b35e83857421a00e71c4e93ba6ae0ffccb90)) -* fixed typo ([#1803](https://github.com/googleapis/nodejs-storage/issues/1803)) ([be70dae](https://github.com/googleapis/nodejs-storage/commit/be70dae33751ddc3e0ae5a55b5cdbf2002a42932)) - -### [5.18.2](https://github.com/googleapis/nodejs-storage/compare/v5.18.1...v5.18.2) (2022-02-16) - - -### Bug Fixes - -* resumable uploads should respect autoRetry & multipart uploads should correctly use preconditions ([#1779](https://github.com/googleapis/nodejs-storage/issues/1779)) ([1e72586](https://github.com/googleapis/nodejs-storage/commit/1e725867dce8f78070435b96b65f97f2253c0e80)) - -### [5.18.1](https://github.com/googleapis/nodejs-storage/compare/v5.18.0...v5.18.1) (2022-01-26) - - -### Bug Fixes - -* **gcs-resumable-upload:** Stop Duplicate Response Handlers on Retries ([#1764](https://github.com/googleapis/nodejs-storage/issues/1764)) ([fe44871](https://github.com/googleapis/nodejs-storage/commit/fe4487187aa405e7d7f8e0bec485bbddb76ea050)) - -## [5.18.0](https://github.com/googleapis/nodejs-storage/compare/v5.17.0...v5.18.0) (2022-01-18) - - -### Features - -* Expose `chunkSize` param for `CreateResumableUploadOptions` ([#1754](https://github.com/googleapis/nodejs-storage/issues/1754)) ([3acfd5b](https://github.com/googleapis/nodejs-storage/commit/3acfd5b2412d046c471d8d707023e034dc1a167a)) - -## [5.17.0](https://www.github.com/googleapis/nodejs-storage/compare/v5.16.1...v5.17.0) (2022-01-10) - - -### Features - -* add support for rpo (turbo replication) metadata field when cre… ([#1648](https://www.github.com/googleapis/nodejs-storage/issues/1648)) ([291e6ef](https://www.github.com/googleapis/nodejs-storage/commit/291e6ef48efcfca55b4a7dca8868a57c0eeec89b)) - - -### Bug Fixes - -* remove compodoc dev dependency ([#1745](https://www.github.com/googleapis/nodejs-storage/issues/1745)) ([809bf11](https://www.github.com/googleapis/nodejs-storage/commit/809bf11b8a2a2203db82aec38b6a6023a805bd62)) - -### [5.16.1](https://www.github.com/googleapis/nodejs-storage/compare/v5.16.0...v5.16.1) (2021-11-29) - - -### Bug Fixes - -* change properties with function value to methods ([#1715](https://www.github.com/googleapis/nodejs-storage/issues/1715)) ([c365254](https://www.github.com/googleapis/nodejs-storage/commit/c36525402da8e748971473b1cdd2423e8fd953e1)) -* revert skip validation ([#1718](https://www.github.com/googleapis/nodejs-storage/issues/1718)) ([0c75e33](https://www.github.com/googleapis/nodejs-storage/commit/0c75e33eb0291aa7dfc704c86733f4c0dc78d322)) -* stop File.download from truncating output file on failure ([#1720](https://www.github.com/googleapis/nodejs-storage/issues/1720)) ([d77979b](https://www.github.com/googleapis/nodejs-storage/commit/d77979b1003dbb89cd9d4725330de50b1f8d9262)) - -## [5.16.0](https://www.github.com/googleapis/nodejs-storage/compare/v5.15.5...v5.16.0) (2021-11-09) - - -### Features - -* improved error messages for resumable uploads ([#1708](https://www.github.com/googleapis/nodejs-storage/issues/1708)) ([50cdbb6](https://www.github.com/googleapis/nodejs-storage/commit/50cdbb6f730ee7f96cb598c4cda412fc4bcc8807)) - - -### Bug Fixes - -* add scenario 3 conformance tests ([#1702](https://www.github.com/googleapis/nodejs-storage/issues/1702)) ([e16a3a5](https://www.github.com/googleapis/nodejs-storage/commit/e16a3a5eb09a388743259d54c31e62d7fc220bf0)) -* retry uri creation dep update & conformance tests ([#1700](https://www.github.com/googleapis/nodejs-storage/issues/1700)) ([d265f8c](https://www.github.com/googleapis/nodejs-storage/commit/d265f8c5e4e6a8c8239e959dfb4d0acbf4cdfe0a)) - -### [5.15.6](https://www.github.com/googleapis/nodejs-storage/compare/v5.15.5...v5.15.6) (2021-11-05) - - -### Bug Fixes - -* add scenario 3 conformance tests ([#1702](https://www.github.com/googleapis/nodejs-storage/issues/1702)) ([e16a3a5](https://www.github.com/googleapis/nodejs-storage/commit/e16a3a5eb09a388743259d54c31e62d7fc220bf0)) -* retry uri creation dep update & conformance tests ([#1700](https://www.github.com/googleapis/nodejs-storage/issues/1700)) ([d265f8c](https://www.github.com/googleapis/nodejs-storage/commit/d265f8c5e4e6a8c8239e959dfb4d0acbf4cdfe0a)) - -### [5.15.5](https://www.github.com/googleapis/nodejs-storage/compare/v5.15.4...v5.15.5) (2021-11-03) - - -### Bug Fixes - -* **deps:** update dependency mime to v3 ([#1696](https://www.github.com/googleapis/nodejs-storage/issues/1696)) ([f337208](https://www.github.com/googleapis/nodejs-storage/commit/f33720883bb6d797d2fb89d5e6ff9584d216be74)) -* explicitly define function type of getFilesStream ([#1697](https://www.github.com/googleapis/nodejs-storage/issues/1697)) ([c950c23](https://www.github.com/googleapis/nodejs-storage/commit/c950c23742bb9291a3e15b95ae0ee4a13466c361)) - -### [5.15.4](https://www.github.com/googleapis/nodejs-storage/compare/v5.15.3...v5.15.4) (2021-11-01) - - -### Bug Fixes - -* check e is not null ([#1692](https://www.github.com/googleapis/nodejs-storage/issues/1692)) ([56ff485](https://www.github.com/googleapis/nodejs-storage/commit/56ff485cbe28ba048c9a689711b034c416853b1f)) - -### [5.15.3](https://www.github.com/googleapis/nodejs-storage/compare/v5.15.2...v5.15.3) (2021-10-14) - - -### Bug Fixes - -* do not use src precondition options in copy. ([#1666](https://www.github.com/googleapis/nodejs-storage/issues/1666)) ([678ae77](https://www.github.com/googleapis/nodejs-storage/commit/678ae77dfb2c1eb2272734f34315b4d0ec726076)) - -### [5.15.2](https://www.github.com/googleapis/nodejs-storage/compare/v5.15.1...v5.15.2) (2021-10-13) - - -### Bug Fixes - -* remove bucket preconditions from deleteFiles, it is a file operation not bucket ([#1661](https://www.github.com/googleapis/nodejs-storage/issues/1661)) ([6b7a06d](https://www.github.com/googleapis/nodejs-storage/commit/6b7a06defe1a3cadc6fad9258ff3fb01a2ecce0a)) - -### [5.15.1](https://www.github.com/googleapis/nodejs-storage/compare/v5.15.0...v5.15.1) (2021-10-12) - - -### Bug Fixes - -* check generation on source files not metageneration on bucket ([#1654](https://www.github.com/googleapis/nodejs-storage/issues/1654)) ([760231c](https://www.github.com/googleapis/nodejs-storage/commit/760231ca520f4eedf878c245489cb07f95e153af)) - -## [5.15.0](https://www.github.com/googleapis/nodejs-storage/compare/v5.14.7...v5.15.0) (2021-10-07) - - -### Features - -* add support for useAuthWithCustomEndpoint option ([#1645](https://www.github.com/googleapis/nodejs-storage/issues/1645)) ([d11d6b4](https://www.github.com/googleapis/nodejs-storage/commit/d11d6b4b2678cb240928e2dfe20f983d2ae896f6)) - - -### Bug Fixes - -* update common dep ([#1644](https://www.github.com/googleapis/nodejs-storage/issues/1644)) ([793467f](https://www.github.com/googleapis/nodejs-storage/commit/793467f25abf46eb7ba5e6cd1b80f735faa035dc)) - -### [5.14.8](https://www.github.com/googleapis/nodejs-storage/compare/v5.14.7...v5.14.8) (2021-10-06) - - -### Bug Fixes - -* update common dep ([#1644](https://www.github.com/googleapis/nodejs-storage/issues/1644)) ([793467f](https://www.github.com/googleapis/nodejs-storage/commit/793467f25abf46eb7ba5e6cd1b80f735faa035dc)) - -### [5.14.7](https://www.github.com/googleapis/nodejs-storage/compare/v5.14.6...v5.14.7) (2021-10-06) - - -### Bug Fixes - -* file preconditions should respect ifGenerationMatch not ifMetagenerationMatch ([#1642](https://www.github.com/googleapis/nodejs-storage/issues/1642)) ([eb6f31f](https://www.github.com/googleapis/nodejs-storage/commit/eb6f31f3f6c439e21bbc0cd46f32a7327e15f65e)) - -### [5.14.6](https://www.github.com/googleapis/nodejs-storage/compare/v5.14.5...v5.14.6) (2021-10-06) - - -### Bug Fixes - -* pass precondition opts to new file ([#1638](https://www.github.com/googleapis/nodejs-storage/issues/1638)) ([1523ca9](https://www.github.com/googleapis/nodejs-storage/commit/1523ca962fda070cf60e5b81d062e3a291461c83)) - -### [5.14.5](https://www.github.com/googleapis/nodejs-storage/compare/v5.14.4...v5.14.5) (2021-10-01) - - -### Bug Fixes - -* fix logic for buckets that do not have a generation ([#1634](https://www.github.com/googleapis/nodejs-storage/issues/1634)) ([9069bdc](https://www.github.com/googleapis/nodejs-storage/commit/9069bdc9a0ab495ab62033f432ea0e180e3b182e)) -* updated connection reset string ([#1632](https://www.github.com/googleapis/nodejs-storage/issues/1632)) ([b841d5b](https://www.github.com/googleapis/nodejs-storage/commit/b841d5b98c3d98b5f1dc7776a887159294eb0b36)) - -### [5.14.4](https://www.github.com/googleapis/nodejs-storage/compare/v5.14.3...v5.14.4) (2021-09-27) - - -### Bug Fixes - -* respect precondition settings from constructors ([#1617](https://www.github.com/googleapis/nodejs-storage/issues/1617)) ([6a48942](https://www.github.com/googleapis/nodejs-storage/commit/6a48942e540e3d96e2a5b396b8e74cbe732178be)) - -### [5.14.3](https://www.github.com/googleapis/nodejs-storage/compare/v5.14.2...v5.14.3) (2021-09-22) - - -### Bug Fixes - -* set autoretry back to instance value at end of file functions ([#1604](https://www.github.com/googleapis/nodejs-storage/issues/1604)) ([db3b59d](https://www.github.com/googleapis/nodejs-storage/commit/db3b59d731c9760d55bf112c211bdd644da911c4)) - -### [5.14.2](https://www.github.com/googleapis/nodejs-storage/compare/v5.14.1...v5.14.2) (2021-09-13) - - -### Bug Fixes - -* **build:** set default branch to main ([#1587](https://www.github.com/googleapis/nodejs-storage/issues/1587)) ([b39ce95](https://www.github.com/googleapis/nodejs-storage/commit/b39ce95a2ec9d8dd2114863898181ea10670d962)) - -### [5.14.1](https://www.github.com/googleapis/nodejs-storage/compare/v5.14.0...v5.14.1) (2021-09-08) - - -### Bug Fixes - -* **types:** remove duplicated definition of BucketOptions and make sure proper version is exported ([#1583](https://www.github.com/googleapis/nodejs-storage/issues/1583)) ([d8f4bc5](https://www.github.com/googleapis/nodejs-storage/commit/d8f4bc59bd3e2cebfe6494842414cd9f7e32018f)) - -## [5.14.0](https://www.github.com/googleapis/nodejs-storage/compare/v5.13.2...v5.14.0) (2021-08-26) - - -### Features - -* retries for conditionally idempotent operations ([#1561](https://www.github.com/googleapis/nodejs-storage/issues/1561)) ([653f4b4](https://www.github.com/googleapis/nodejs-storage/commit/653f4b488e8603e4008e51b45920fb7de7138eab)) - - -### Bug Fixes - -* allow retries of metadatata operations in system tests ([#1568](https://www.github.com/googleapis/nodejs-storage/issues/1568)) ([9398566](https://www.github.com/googleapis/nodejs-storage/commit/939856680d279dcd9587328d0cc58f789b022f5a)) - -### [5.13.2](https://www.github.com/googleapis/nodejs-storage/compare/v5.13.1...v5.13.2) (2021-08-26) - - -### Bug Fixes - -* update getLabels definition to actually allow no arguments when used in typescript ([#1559](https://www.github.com/googleapis/nodejs-storage/issues/1559)) ([176dbb5](https://www.github.com/googleapis/nodejs-storage/commit/176dbb5223f4442d10fd098ffa2cda5cf12144f2)) - -### [5.13.1](https://www.github.com/googleapis/nodejs-storage/compare/v5.13.0...v5.13.1) (2021-08-18) - - -### Bug Fixes - -* **deps:** update dependency date-and-time to v2 ([#1537](https://www.github.com/googleapis/nodejs-storage/issues/1537)) ([9d0d69e](https://www.github.com/googleapis/nodejs-storage/commit/9d0d69eaf908817dec274abe915bd96bb22c663a)) - -## [5.13.0](https://www.github.com/googleapis/nodejs-storage/compare/v5.12.0...v5.13.0) (2021-08-09) - - -### Features - -* Precondition checks ([#1523](https://www.github.com/googleapis/nodejs-storage/issues/1523)) ([7c24417](https://www.github.com/googleapis/nodejs-storage/commit/7c244178649f120cfefe58994b515da7ca6b7ffb)) - -## [5.12.0](https://www.github.com/googleapis/nodejs-storage/compare/v5.11.1...v5.12.0) (2021-08-03) - - -### Features - -* pass precondition parameters to gcs-resumable-upload ([#1516](https://www.github.com/googleapis/nodejs-storage/issues/1516)) ([65211dd](https://www.github.com/googleapis/nodejs-storage/commit/65211ddb8ae19229154b4aca3d5ff97f2aaa9f56)) - -### [5.11.1](https://www.github.com/googleapis/nodejs-storage/compare/v5.11.0...v5.11.1) (2021-08-02) - - -### Bug Fixes - -* don't retry non-idempotent functions ([#1517](https://www.github.com/googleapis/nodejs-storage/issues/1517)) ([c938795](https://www.github.com/googleapis/nodejs-storage/commit/c938795e8a5f14ba7724f2d0e334310dd8e8f207)) - -## [5.11.0](https://www.github.com/googleapis/nodejs-storage/compare/v5.10.0...v5.11.0) (2021-07-23) - - -### Features - -* retries for resumable bucket.upload and file.save ([#1511](https://www.github.com/googleapis/nodejs-storage/issues/1511)) ([9bf163c](https://www.github.com/googleapis/nodejs-storage/commit/9bf163c3e3569bad1440940ff1a6bfd42404bb32)) - -## [5.10.0](https://www.github.com/googleapis/nodejs-storage/compare/v5.9.0...v5.10.0) (2021-07-22) - - -### Features - -* retry multipart Bucket.upload ([#1509](https://www.github.com/googleapis/nodejs-storage/issues/1509)) ([730d0a0](https://www.github.com/googleapis/nodejs-storage/commit/730d0a0d4a6aa5192d998c54292d3423d3ddeaaa)) - -## [5.9.0](https://www.github.com/googleapis/nodejs-storage/compare/v5.8.5...v5.9.0) (2021-07-21) - - -### Features - -* customize retry behavior implementation ([#1474](https://www.github.com/googleapis/nodejs-storage/issues/1474)) ([#1493](https://www.github.com/googleapis/nodejs-storage/issues/1493)) ([49008e3](https://www.github.com/googleapis/nodejs-storage/commit/49008e313b89ce6035543bf2cf1e60e253404520)) - -### [5.8.5](https://www.github.com/googleapis/nodejs-storage/compare/v5.8.4...v5.8.5) (2021-05-04) - - -### Bug Fixes - -* **deps:** updated gcs-resumable-upload dependency ([#1459](https://www.github.com/googleapis/nodejs-storage/issues/1459)) ([afaccc7](https://www.github.com/googleapis/nodejs-storage/commit/afaccc70375a2c778e4306a59bf8a86736c17f6c)) - -### [5.8.4](https://www.github.com/googleapis/nodejs-storage/compare/v5.8.3...v5.8.4) (2021-04-19) - - -### Bug Fixes - -* **deps:** update dependency date-and-time to v1 ([#1434](https://www.github.com/googleapis/nodejs-storage/issues/1434)) ([91ee6ca](https://www.github.com/googleapis/nodejs-storage/commit/91ee6cab38769d36b00d702e17b222518ad4e752)) -* don't fail if ~/.config doesn't exist ([#1428](https://www.github.com/googleapis/nodejs-storage/issues/1428)) ([3cfaba1](https://www.github.com/googleapis/nodejs-storage/commit/3cfaba19d4223c68f4382c06674f135838d32eb8)) - -### [5.8.3](https://www.github.com/googleapis/nodejs-storage/compare/v5.8.2...v5.8.3) (2021-03-29) - - -### Bug Fixes - -* update CopyOptions type to include cacheControl, contentType and contentEncoding ([#1426](https://www.github.com/googleapis/nodejs-storage/issues/1426)) ([efa5bb8](https://www.github.com/googleapis/nodejs-storage/commit/efa5bb8a22ab68c0c3e8549850e5db4d57ff29bb)) - -### [5.8.2](https://www.github.com/googleapis/nodejs-storage/compare/v5.8.1...v5.8.2) (2021-03-23) - - -### Bug Fixes - -* **perf:** pull hashes without refreshing metadata ([#1419](https://www.github.com/googleapis/nodejs-storage/issues/1419)) ([f3ec627](https://www.github.com/googleapis/nodejs-storage/commit/f3ec6278df3c3df4d4cddf5293be4dda95f0cbf7)) - -### [5.8.1](https://www.github.com/googleapis/nodejs-storage/compare/v5.8.0...v5.8.1) (2021-03-02) - - -### Bug Fixes - -* deprecate `options.promise` and sync options with Service ([#1391](https://www.github.com/googleapis/nodejs-storage/issues/1391)) ([59cfe27](https://www.github.com/googleapis/nodejs-storage/commit/59cfe272de16c41e9c768953a25677294f520cc7)) -* **types:** support metadata override in file.copy() ([#1406](https://www.github.com/googleapis/nodejs-storage/issues/1406)) ([dda6d30](https://www.github.com/googleapis/nodejs-storage/commit/dda6d305638a07cbca188e459544393d8624f4f0)) - -## [5.8.0](https://www.github.com/googleapis/nodejs-storage/compare/v5.7.4...v5.8.0) (2021-02-18) - - -### Features - -* adds support workload identity federation ([#1404](https://www.github.com/googleapis/nodejs-storage/issues/1404)) ([7d3a3f1](https://www.github.com/googleapis/nodejs-storage/commit/7d3a3f148361e56cbcd4dc4c8fb178b75f9208bf)) - -### [5.7.4](https://www.github.com/googleapis/nodejs-storage/compare/v5.7.3...v5.7.4) (2021-02-01) - - -### Bug Fixes - -* specified acceptable types for File.save data parameter ([#1388](https://www.github.com/googleapis/nodejs-storage/issues/1388)) ([607f6c1](https://www.github.com/googleapis/nodejs-storage/commit/607f6c1c8b9ae5414513957f54a5de2490c454b1)) - -### [5.7.3](https://www.github.com/googleapis/nodejs-storage/compare/v5.7.2...v5.7.3) (2021-01-22) - - -### Bug Fixes - -* retry multipart uploads on File.save() ([#1385](https://www.github.com/googleapis/nodejs-storage/issues/1385)) ([4dec8c1](https://www.github.com/googleapis/nodejs-storage/commit/4dec8c1a362e3f80cbbf49f8bf7e7eaa2e2ce3bc)) - -### [5.7.2](https://www.github.com/googleapis/nodejs-storage/compare/v5.7.1...v5.7.2) (2021-01-11) - - -### Bug Fixes - -* deprecated directory. prefix should be used instead ([#1370](https://www.github.com/googleapis/nodejs-storage/issues/1370)) ([fae4c06](https://www.github.com/googleapis/nodejs-storage/commit/fae4c0635909a831d65bd3111b27250795d4735b)) - -### [5.7.1](https://www.github.com/googleapis/nodejs-storage/compare/v5.7.0...v5.7.1) (2021-01-07) - - -### Bug Fixes - -* bump dependencies See [#1372](https://www.github.com/googleapis/nodejs-storage/issues/1372) for details ([#1375](https://www.github.com/googleapis/nodejs-storage/issues/1375)) ([7cf0264](https://www.github.com/googleapis/nodejs-storage/commit/7cf0264c0cea2e0d668818924aaa737381c07bfa)) - -## [5.7.0](https://www.github.com/googleapis/nodejs-storage/compare/v5.6.0...v5.7.0) (2020-12-10) - - -### Features - -* support metadata updates from makePrivate() methods ([#1355](https://www.github.com/googleapis/nodejs-storage/issues/1355)) ([3db1e83](https://www.github.com/googleapis/nodejs-storage/commit/3db1e832af1cd3a394305b0a1120953d85f86249)) - - -### Bug Fixes - -* capitalize action in Bucket#addLifecycleRule ([#1358](https://www.github.com/googleapis/nodejs-storage/issues/1358)) ([205f39f](https://www.github.com/googleapis/nodejs-storage/commit/205f39f970639c06258fb1e0cd18a4d963729262)) -* jsdoc for bucket ([#1359](https://www.github.com/googleapis/nodejs-storage/issues/1359)) ([5fa530a](https://www.github.com/googleapis/nodejs-storage/commit/5fa530ab909e837558deecd7e1aa50a7cc4f5830)) - -## [5.6.0](https://www.github.com/googleapis/nodejs-storage/compare/v5.5.1...v5.6.0) (2020-12-02) - - -### Features - -* allow ignoring 404 errors during delete() operations ([#1347](https://www.github.com/googleapis/nodejs-storage/issues/1347)) ([dab0e7d](https://www.github.com/googleapis/nodejs-storage/commit/dab0e7d9345499411cec57186ef7404026f041eb)) - -### [5.5.1](https://www.github.com/googleapis/nodejs-storage/compare/v5.5.0...v5.5.1) (2020-12-01) - - -### Bug Fixes - -* add publicUrl to exclude promisifyAll ([#1339](https://www.github.com/googleapis/nodejs-storage/issues/1339)) ([ea2c2c9](https://www.github.com/googleapis/nodejs-storage/commit/ea2c2c9d670b8a8eefffa3e67dd2599135c0d933)) -* error if both `storageClass` and specific storage class name are provided ([#1323](https://www.github.com/googleapis/nodejs-storage/issues/1323)) ([91a65f8](https://www.github.com/googleapis/nodejs-storage/commit/91a65f86fe5f9608437b91d6e67192c78b0e8d7b)) -* only throw if `storageClass` and specific storage class name provide different values ([#1346](https://www.github.com/googleapis/nodejs-storage/issues/1346)) ([1765608](https://www.github.com/googleapis/nodejs-storage/commit/1765608430d98c555e4a7431c28cd5878e65c7df)) -* **docs:** explain manual pagination and add usage sample ([#1317](https://www.github.com/googleapis/nodejs-storage/issues/1317)) ([16b779d](https://www.github.com/googleapis/nodejs-storage/commit/16b779de912f6ac082ec5ee3d904b125a5526485)) - -## [5.5.0](https://www.github.com/googleapis/nodejs-storage/compare/v5.4.0...v5.5.0) (2020-11-03) - - -### Features - -* accessibleAt v4 signed urls ([#1328](https://www.github.com/googleapis/nodejs-storage/issues/1328)) ([1e0295e](https://www.github.com/googleapis/nodejs-storage/commit/1e0295eebd1120ce6cbcabee4cf1aaa825455d4b)) - -## [5.4.0](https://www.github.com/googleapis/nodejs-storage/compare/v5.3.0...v5.4.0) (2020-10-29) - - -### Features - -* **userAgent:** allow for optional user agent to be provided ([#1313](https://www.github.com/googleapis/nodejs-storage/issues/1313)) ([13a064f](https://www.github.com/googleapis/nodejs-storage/commit/13a064f3e7342640c5c6e64e060e8558062a31c7)) -* add custom time field in metadata sample ([#1285](https://www.github.com/googleapis/nodejs-storage/issues/1285)) ([9e3474f](https://www.github.com/googleapis/nodejs-storage/commit/9e3474f87dabd300d914c0f44f49a13dae34227d)) -* add File#rename ([#1311](https://www.github.com/googleapis/nodejs-storage/issues/1311)) ([c77eaa3](https://www.github.com/googleapis/nodejs-storage/commit/c77eaa363be18b6b9ddd1f7b505e23be8cd5bf98)) -* public url of a file ([#1324](https://www.github.com/googleapis/nodejs-storage/issues/1324)) ([5ec256e](https://www.github.com/googleapis/nodejs-storage/commit/5ec256e58d04dbcb8dee8cde7460b306da5ff880)) - - -### Bug Fixes - -* set customEndpoint for custom environments ([#1316](https://www.github.com/googleapis/nodejs-storage/issues/1316)) ([60910e1](https://www.github.com/googleapis/nodejs-storage/commit/60910e1903f95a0abca6b9855d11833b32666e2c)) -* **deps:** update dependency gaxios to v4 ([#1322](https://www.github.com/googleapis/nodejs-storage/issues/1322)) ([f9b16d8](https://www.github.com/googleapis/nodejs-storage/commit/f9b16d82e5c6a26d76f721a277cf07b518b63a42)) -* moved publicUrl comment ([#1327](https://www.github.com/googleapis/nodejs-storage/issues/1327)) ([249ed2c](https://www.github.com/googleapis/nodejs-storage/commit/249ed2c4e5fe9cfb029ca8e60c1bafab5c370a48)) -* self-upload files for Unicode system tests ([#1318](https://www.github.com/googleapis/nodejs-storage/issues/1318)) ([e826a52](https://www.github.com/googleapis/nodejs-storage/commit/e826a526c3a5a8515cc7a07c15f86fcfb0fb2f93)) -* **deps:** update dependency duplexify to v4 ([#1302](https://www.github.com/googleapis/nodejs-storage/issues/1302)) ([1ce3d89](https://www.github.com/googleapis/nodejs-storage/commit/1ce3d895b3f5d12776f0634b41b1baef7aa4491c)) -* **deps:** update dependency yargs to v16 ([#1289](https://www.github.com/googleapis/nodejs-storage/issues/1289)) ([12f2133](https://www.github.com/googleapis/nodejs-storage/commit/12f2133b7e3ec9612b3694d93b9ff756cb1bbd66)) -* **types:** add `CreateBucketRequest.storageClass` ([#1299](https://www.github.com/googleapis/nodejs-storage/issues/1299)) ([d854c26](https://www.github.com/googleapis/nodejs-storage/commit/d854c2609eb87886a010e726daa5f1339ee9ea38)), closes [#1248](https://www.github.com/googleapis/nodejs-storage/issues/1248) - -## [5.3.0](https://www.github.com/googleapis/nodejs-storage/compare/v5.2.0...v5.3.0) (2020-08-24) - - -### Features - -* support noncurrent time object lifecycle condition ([#1216](https://www.github.com/googleapis/nodejs-storage/issues/1216)) ([d198aff](https://www.github.com/googleapis/nodejs-storage/commit/d198affa98b0dd027d6628eaff9fcd2dca5c7b47)) - -## [5.2.0](https://www.github.com/googleapis/nodejs-storage/compare/v5.1.2...v5.2.0) (2020-08-10) - - -### Features - -* remove through2 dependency ([#1240](https://www.github.com/googleapis/nodejs-storage/issues/1240)) ([97c73dd](https://www.github.com/googleapis/nodejs-storage/commit/97c73ddec4dbb7cbf7a1486c16ed24dbe9be6d83)) - - -### Bug Fixes - -* support request interceptors for file uploads ([#1225](https://www.github.com/googleapis/nodejs-storage/issues/1225)) ([aa4e4ec](https://www.github.com/googleapis/nodejs-storage/commit/aa4e4ecf49c2e67fdeb90d54e06335fe8671c185)) -* **deps:** update dependency date-and-time to ^0.14.0 ([#1263](https://www.github.com/googleapis/nodejs-storage/issues/1263)) ([408aff9](https://www.github.com/googleapis/nodejs-storage/commit/408aff9234b30f4d68bc9027fbc3088ab059578a)) - -### [5.1.2](https://www.github.com/googleapis/nodejs-storage/compare/v5.1.1...v5.1.2) (2020-07-06) - - -### Bug Fixes - -* **deps:** update dependency through2 to v4 ([#1226](https://www.github.com/googleapis/nodejs-storage/issues/1226)) ([2be25e8](https://www.github.com/googleapis/nodejs-storage/commit/2be25e8fbd4bc60f8e702c2120cf99510508cd15)) - -### [5.1.1](https://www.github.com/googleapis/nodejs-storage/compare/v5.1.0...v5.1.1) (2020-06-19) - - -### Bug Fixes - -* **deps:** update dependency p-limit to v3 ([#1210](https://www.github.com/googleapis/nodejs-storage/issues/1210)) ([7da0379](https://www.github.com/googleapis/nodejs-storage/commit/7da03797791ed20ffbbc6456c7cfad1653c59e76)) -* update node issue template ([#1220](https://www.github.com/googleapis/nodejs-storage/issues/1220)) ([eaac92b](https://www.github.com/googleapis/nodejs-storage/commit/eaac92bb789aea32718280fb67c6496022fa56d3)) - -## [5.1.0](https://www.github.com/googleapis/nodejs-storage/compare/v5.0.1...v5.1.0) (2020-06-11) - - -### Features - -* **secrets:** begin migration to secret manager from keystore ([#1211](https://www.github.com/googleapis/nodejs-storage/issues/1211)) ([11b16ae](https://www.github.com/googleapis/nodejs-storage/commit/11b16ae1b06273ab169d7b1f65a54196956ef4ea)) -* allow setting timeouts on uploads ([#1208](https://www.github.com/googleapis/nodejs-storage/issues/1208)) ([01b3691](https://www.github.com/googleapis/nodejs-storage/commit/01b3691bbfc4a93e2229ea07184637479c515183)) - - -### Bug Fixes - -* **deps:** update dependency @google-cloud/pubsub to v2 ([#1201](https://www.github.com/googleapis/nodejs-storage/issues/1201)) ([c684b2a](https://www.github.com/googleapis/nodejs-storage/commit/c684b2abe99169a8801d76fda38a4cbfba91f417)) - -### [5.0.1](https://www.github.com/googleapis/nodejs-storage/compare/v5.0.0...v5.0.1) (2020-05-20) - - -### Bug Fixes - -* StorageOptions.apiEndpoint overrides simple and resumable uploads ([#1161](https://www.github.com/googleapis/nodejs-storage/issues/1161)) ([cf8ea5c](https://www.github.com/googleapis/nodejs-storage/commit/cf8ea5cbbecea50233b1681c7f8aba121ec37a1a)) -* **types:** assert in typescript 3.7 ([#1198](https://www.github.com/googleapis/nodejs-storage/issues/1198)) ([d5aa8b7](https://www.github.com/googleapis/nodejs-storage/commit/d5aa8b7892366c9fbbdc33dd001f644da61bb22e)) - -## [5.0.0](https://www.github.com/googleapis/nodejs-storage/compare/v4.7.0...v5.0.0) (2020-05-13) - - -### ⚠ BREAKING CHANGES - -* automatically detect contentType if not provided (#1190) -* drop keepAcl parameter in file copy (#1166) -* drop support for node.js 8.x - -### Features - -* automatically detect contentType if not provided ([#1190](https://www.github.com/googleapis/nodejs-storage/issues/1190)) ([b31ba4a](https://www.github.com/googleapis/nodejs-storage/commit/b31ba4a11399b57538ddf0d6ca2e10b2aa3fbc3a)) -* enable bytes read tracking ([#1074](https://www.github.com/googleapis/nodejs-storage/issues/1074)) ([0776a04](https://www.github.com/googleapis/nodejs-storage/commit/0776a044f3b2149b485e114369e952688df75645)) - - -### Bug Fixes - -* **bucket:** Only disable resumable uploads for bucket.upload (fixes [#1133](https://www.github.com/googleapis/nodejs-storage/issues/1133)) ([#1135](https://www.github.com/googleapis/nodejs-storage/issues/1135)) ([2c20148](https://www.github.com/googleapis/nodejs-storage/commit/2c201486b7b2d3146846ac96c877a904c4a674b0)), closes [/github.com/googleapis/nodejs-storage/pull/1135#issuecomment-620070038](https://www.github.com/googleapis//github.com/googleapis/nodejs-storage/pull/1135/issues/issuecomment-620070038) -* add whitespace to generateV4SignedPolicy ([#1136](https://www.github.com/googleapis/nodejs-storage/issues/1136)) ([dcee78b](https://www.github.com/googleapis/nodejs-storage/commit/dcee78b98da23b02fe7d2f13a9270546bc07bba8)) -* apache license URL ([#468](https://www.github.com/googleapis/nodejs-storage/issues/468)) ([#1151](https://www.github.com/googleapis/nodejs-storage/issues/1151)) ([e8116d3](https://www.github.com/googleapis/nodejs-storage/commit/e8116d3c6fa7412858692e67745b514eef78850e)) -* Point to team in correct org ([#1185](https://www.github.com/googleapis/nodejs-storage/issues/1185)) ([0bb1909](https://www.github.com/googleapis/nodejs-storage/commit/0bb19098013acf71cc3842f78ff333a8e356331a)) -* **deps:** update dependency @google-cloud/common to v3 ([#1134](https://www.github.com/googleapis/nodejs-storage/issues/1134)) ([774ac5c](https://www.github.com/googleapis/nodejs-storage/commit/774ac5c75f02238418cc8ed7242297ea573ca9cb)) -* **deps:** update dependency @google-cloud/paginator to v3 ([#1131](https://www.github.com/googleapis/nodejs-storage/issues/1131)) ([c1614d9](https://www.github.com/googleapis/nodejs-storage/commit/c1614d98e3047db379e09299b1014e80d73ed52f)) -* **deps:** update dependency @google-cloud/promisify to v2 ([#1127](https://www.github.com/googleapis/nodejs-storage/issues/1127)) ([06624a5](https://www.github.com/googleapis/nodejs-storage/commit/06624a534cd1fdbc38455eee8d89f9f60ba75758)) -* **deps:** update dependency uuid to v8 ([#1170](https://www.github.com/googleapis/nodejs-storage/issues/1170)) ([6a98d64](https://www.github.com/googleapis/nodejs-storage/commit/6a98d64831baf1ca1ec2f03ecc4914745cba1c86)) -* **deps:** update gcs-resumable-upload, remove gitnpm usage ([#1186](https://www.github.com/googleapis/nodejs-storage/issues/1186)) ([c78c9cd](https://www.github.com/googleapis/nodejs-storage/commit/c78c9cde49dccb2fcd4ce10e4e9f8299d65f6838)) -* **v4-policy:** encode special characters ([#1169](https://www.github.com/googleapis/nodejs-storage/issues/1169)) ([6e48539](https://www.github.com/googleapis/nodejs-storage/commit/6e48539d76ca27e6f4c6cf2ac0872970f7391fed)) -* sync to googleapis/conformance-tests@fa559a1 ([#1167](https://www.github.com/googleapis/nodejs-storage/issues/1167)) ([5500446](https://www.github.com/googleapis/nodejs-storage/commit/550044619d2f17a1977c83bce5df915c6dc9578c)), closes [#1168](https://www.github.com/googleapis/nodejs-storage/issues/1168) - - -### Miscellaneous Chores - -* drop keepAcl parameter in file copy ([#1166](https://www.github.com/googleapis/nodejs-storage/issues/1166)) ([5a4044a](https://www.github.com/googleapis/nodejs-storage/commit/5a4044a8ba13f248fc4f791248f797eb0f1f3c16)) - - -### Build System - -* drop support for node.js 8.x ([b80c025](https://www.github.com/googleapis/nodejs-storage/commit/b80c025f106052fd25554c64314b3b3520e829b5)) - -## [4.7.0](https://www.github.com/googleapis/nodejs-storage/compare/v4.6.0...v4.7.0) (2020-03-26) - - -### Features - -* add remove conditional binding ([#1107](https://www.github.com/googleapis/nodejs-storage/issues/1107)) ([2143705](https://www.github.com/googleapis/nodejs-storage/commit/21437053e9497aa95ef37a865ffbdbaf4134138f)) -* v4 POST with signed policy ([#1102](https://www.github.com/googleapis/nodejs-storage/issues/1102)) ([a3d5b88](https://www.github.com/googleapis/nodejs-storage/commit/a3d5b88b8d3d25b6e16808eb5c1425aa0a8c5ecc)), closes [#1125](https://www.github.com/googleapis/nodejs-storage/issues/1125) - - -### Bug Fixes - -* **deps:** update dependency date-and-time to ^0.13.0 ([#1106](https://www.github.com/googleapis/nodejs-storage/issues/1106)) ([b759605](https://www.github.com/googleapis/nodejs-storage/commit/b7596058e130ee2d82dc2221f24220b83c04fdae)) -* **deps:** update dependency gaxios to v3 ([#1129](https://www.github.com/googleapis/nodejs-storage/issues/1129)) ([5561452](https://www.github.com/googleapis/nodejs-storage/commit/5561452cb0b6e5a1dcabea6973db57799422abb7)) -* **types:** wrap GetSignedUrlResponse ([#1119](https://www.github.com/googleapis/nodejs-storage/issues/1119)) ([0c7ac16](https://www.github.com/googleapis/nodejs-storage/commit/0c7ac161f808201562f60710b9ec7bce4fbf819f)) - -## [4.6.0](https://www.github.com/googleapis/nodejs-storage/compare/v4.5.0...v4.6.0) (2020-03-13) - - -### Features - -* **storage:** Add versioning as optional metadata param of createBucket ([#1090](https://www.github.com/googleapis/nodejs-storage/issues/1090)) ([39869e3](https://www.github.com/googleapis/nodejs-storage/commit/39869e3c6c62eabe1840f0fd884b361265e2cb76)) - -## [4.5.0](https://www.github.com/googleapis/nodejs-storage/compare/v4.4.0...v4.5.0) (2020-03-06) - - -### Features - -* **v4:** support v4 signed URL for GA ([#1072](https://www.github.com/googleapis/nodejs-storage/issues/1072)) ([79d7b8f](https://www.github.com/googleapis/nodejs-storage/commit/79d7b8f5a187f23e58bf84db3f4b8c4b1a921978)), closes [#1051](https://www.github.com/googleapis/nodejs-storage/issues/1051) [#1056](https://www.github.com/googleapis/nodejs-storage/issues/1056) [#1066](https://www.github.com/googleapis/nodejs-storage/issues/1066) [#1068](https://www.github.com/googleapis/nodejs-storage/issues/1068) [#1069](https://www.github.com/googleapis/nodejs-storage/issues/1069) [#1067](https://www.github.com/googleapis/nodejs-storage/issues/1067) [#1070](https://www.github.com/googleapis/nodejs-storage/issues/1070) - -## [4.4.0](https://www.github.com/googleapis/nodejs-storage/compare/v4.3.2...v4.4.0) (2020-03-03) - - -### Features - -* **bucket:** support single source in combine ([#1076](https://www.github.com/googleapis/nodejs-storage/issues/1076)) ([#1085](https://www.github.com/googleapis/nodejs-storage/issues/1085)) ([251a617](https://www.github.com/googleapis/nodejs-storage/commit/251a617791ca4b0e148b741d1931013150becc02)) - -### [4.3.2](https://www.github.com/googleapis/nodejs-storage/compare/v4.3.1...v4.3.2) (2020-03-02) - - -### Bug Fixes - -* **deps:** update dependency uuid to v7 ([#1081](https://www.github.com/googleapis/nodejs-storage/issues/1081)) ([c72d57f](https://www.github.com/googleapis/nodejs-storage/commit/c72d57f6f2982dad512d425ee3f041b43a87c278)) -* **tests:** flaky getSignedPolicy tests ([#1093](https://www.github.com/googleapis/nodejs-storage/issues/1093)) ([531050a](https://www.github.com/googleapis/nodejs-storage/commit/531050a05e5b1eeedb25647417a8ae9df8d76f29)) - -### [4.3.1](https://www.github.com/googleapis/nodejs-storage/compare/v4.3.0...v4.3.1) (2020-02-06) - - -### Bug Fixes - -* **samples:** fix overwritten IAM conditions sample ([#1042](https://www.github.com/googleapis/nodejs-storage/issues/1042)) ([25d839c](https://www.github.com/googleapis/nodejs-storage/commit/25d839ccf421276d8a4c18b2be95004ca832d84d)) -* skip validation for server decompressed objects ([#1063](https://www.github.com/googleapis/nodejs-storage/issues/1063)) ([d6e3738](https://www.github.com/googleapis/nodejs-storage/commit/d6e37382da1ed3b72771770cb9447c62c91f26a5)) -* unhandled promise rejection warning in samples ([#1056](https://www.github.com/googleapis/nodejs-storage/issues/1056)) ([e95ec19](https://www.github.com/googleapis/nodejs-storage/commit/e95ec19756388e6fc4fc8e0d49a40c613ed006c6)) - -## [4.3.0](https://www.github.com/googleapis/nodejs-storage/compare/v4.2.0...v4.3.0) (2020-01-21) - - -### Features - -* add support for CORS as a first class citizen ([#1020](https://www.github.com/googleapis/nodejs-storage/issues/1020)) ([9fee6d9](https://www.github.com/googleapis/nodejs-storage/commit/9fee6d969a1311a3db18bf523d3614adef0526ce)) - - -### Bug Fixes - -* **deps:** update dependency date-and-time to ^0.12.0 ([#1032](https://www.github.com/googleapis/nodejs-storage/issues/1032)) ([a324564](https://www.github.com/googleapis/nodejs-storage/commit/a324564e8f29345412047b7f6296098211e0e831)) -* a couple of typos from the refactorNodeSampleStorage branch ([#1038](https://www.github.com/googleapis/nodejs-storage/issues/1038)) ([8faa6c6](https://www.github.com/googleapis/nodejs-storage/commit/8faa6c6698b3b7ef4857d978482209bc5077e08e)) -* do not modify constructor options ([#974](https://www.github.com/googleapis/nodejs-storage/issues/974)) ([4969148](https://www.github.com/googleapis/nodejs-storage/commit/4969148f5e114d86aa4928109f099ec15d56fda5)) -* refactor getMetadata sample into its own file ([#1008](https://www.github.com/googleapis/nodejs-storage/issues/1008)) ([6ed1af8](https://www.github.com/googleapis/nodejs-storage/commit/6ed1af8aadd6f72cf0957d02e403f7c551166a5c)) -* refactor getRetentionPolicy sample into its own file ([#993](https://www.github.com/googleapis/nodejs-storage/issues/993)) ([47e4ad8](https://www.github.com/googleapis/nodejs-storage/commit/47e4ad8c8a4fd16f4f1d9d6d9bfdc9e30b1ab999)) -* refactor getUniformBucketLevelAccess into its own file ([#981](https://www.github.com/googleapis/nodejs-storage/issues/981)) ([0ba69f1](https://www.github.com/googleapis/nodejs-storage/commit/0ba69f1b3d6093701dac927fa4543d2d911ce8b0)) -* refactor rotateEncryptionKey sample into its own file ([#1030](https://www.github.com/googleapis/nodejs-storage/issues/1030)) ([afdf0fe](https://www.github.com/googleapis/nodejs-storage/commit/afdf0febe8760c0819736961065d134e231a0afa)) -* refactor uploadEncryptedFile sample into its own file ([#1028](https://www.github.com/googleapis/nodejs-storage/issues/1028)) ([ba4520b](https://www.github.com/googleapis/nodejs-storage/commit/ba4520b5f925968717222ffe5d2b1dbcfbea4334)) -* refactoring disableUniformBucketLevelAccess into its own file ([#980](https://www.github.com/googleapis/nodejs-storage/issues/980)) ([1481e20](https://www.github.com/googleapis/nodejs-storage/commit/1481e20d8332ee2806116166fb16028506487d2d)) - -## [4.2.0](https://www.github.com/googleapis/nodejs-storage/compare/v4.1.3...v4.2.0) (2020-01-02) - - -### Features - -* **iam:** getIamPolicy to support requestedPolicyVersion ([#960](https://www.github.com/googleapis/nodejs-storage/issues/960)) ([0f38f75](https://www.github.com/googleapis/nodejs-storage/commit/0f38f7597f5e671b4c08830f8d457f9ca2c03cd1)) -* add support for Archive storage class ([#908](https://www.github.com/googleapis/nodejs-storage/issues/908)) ([63f63f4](https://www.github.com/googleapis/nodejs-storage/commit/63f63f448d2d220b1e77a7dcd379f7ac7fc22af3)) - - -### Bug Fixes - -* **deps:** pin TypeScript below 3.7.0 ([#952](https://www.github.com/googleapis/nodejs-storage/issues/952)) ([1fea60c](https://www.github.com/googleapis/nodejs-storage/commit/1fea60c04fd9762c5506c22df0992cdb8fce4ea0)) -* add createBucket file and updated relevant test ([#940](https://www.github.com/googleapis/nodejs-storage/issues/940)) ([913b43e](https://www.github.com/googleapis/nodejs-storage/commit/913b43e66bb10bd5dbf6b0bca9e65edd48b54234)) -* update PolicyDocument types ([#944](https://www.github.com/googleapis/nodejs-storage/issues/944)) ([b1c05b2](https://www.github.com/googleapis/nodejs-storage/commit/b1c05b27029215c8bc313a8f4f16ff13d5af2391)) - -### [4.1.3](https://www.github.com/googleapis/nodejs-storage/compare/v4.1.2...v4.1.3) (2019-11-18) - - -### Bug Fixes - -* **deps:** update dependency date-and-time to ^0.11.0 ([#934](https://www.github.com/googleapis/nodejs-storage/issues/934)) ([c4bf1c6](https://www.github.com/googleapis/nodejs-storage/commit/c4bf1c616d0a9402237708bddac1341c620f0542)) -* **deps:** update dependency yargs to v15 ([#933](https://www.github.com/googleapis/nodejs-storage/issues/933)) ([f40fe0c](https://www.github.com/googleapis/nodejs-storage/commit/f40fe0c5bd4e9b89ebe007e59986580fae4d7e09)) - -### [4.1.2](https://www.github.com/googleapis/nodejs-storage/compare/v4.1.1...v4.1.2) (2019-11-12) - - -### Bug Fixes - -* do not check access of configPath ([#915](https://www.github.com/googleapis/nodejs-storage/issues/915)) ([a21a644](https://www.github.com/googleapis/nodejs-storage/commit/a21a6443346f91f275233a9a07fb79550035e157)) -* missing snippets with jsdoc-region-tag ([#924](https://www.github.com/googleapis/nodejs-storage/issues/924)) ([310ba90](https://www.github.com/googleapis/nodejs-storage/commit/310ba90a48c6f02a31c1254037dfcdb4da4b7150)) -* **docs:** add jsdoc-region-tag plugin ([#929](https://www.github.com/googleapis/nodejs-storage/issues/929)) ([74526e7](https://www.github.com/googleapis/nodejs-storage/commit/74526e7f42cfa92c18ff332d0b9e10ea3b1324cf)) - -### [4.1.1](https://www.github.com/googleapis/nodejs-storage/compare/v4.1.0...v4.1.1) (2019-11-07) - - -### Bug Fixes - -* update format for upload sample ([#918](https://www.github.com/googleapis/nodejs-storage/issues/918)) ([d77208b](https://www.github.com/googleapis/nodejs-storage/commit/d77208bee82dc2d76c72fbe8d5db1bfeb8e392ff)) - -## [4.1.0](https://www.github.com/googleapis/nodejs-storage/compare/v4.0.1...v4.1.0) (2019-10-31) - - -### Features - -* [Storage] Support UniformBucketLevelAccess ([#903](https://www.github.com/googleapis/nodejs-storage/issues/903)) ([35b1bd9](https://www.github.com/googleapis/nodejs-storage/commit/35b1bd9f6db351ad1e51b135a3f25cc5e1566600)) - -### [4.0.1](https://www.github.com/googleapis/nodejs-storage/compare/v4.0.0...v4.0.1) (2019-10-31) - - -### Bug Fixes - -* **docs:** missing quote in signed url jsdoc ([#896](https://www.github.com/googleapis/nodejs-storage/issues/896)) ([f2d567f](https://www.github.com/googleapis/nodejs-storage/commit/f2d567f279fee0f48c2d6a607f4066c9da372549)) -* use storage.googleapis.com for api endpoint ([862fb16](https://www.github.com/googleapis/nodejs-storage/commit/862fb16db2990c958c0097252a44c775431a7b3f)) -* **signed-url:** replace encodeURIComponent with custom encoding function ([#905](https://www.github.com/googleapis/nodejs-storage/issues/905)) ([ba41517](https://www.github.com/googleapis/nodejs-storage/commit/ba415179f1d5951742c1b239e0500bbd2a815ddd)) - -## [4.0.0](https://www.github.com/googleapis/nodejs-storage/compare/v3.5.0...v4.0.0) (2019-10-17) - - -### ⚠ BREAKING CHANGES - -* allow leading slashes in file name (#820) - -### Bug Fixes - -* **deps:** update hash-stream-validation ([#884](https://www.github.com/googleapis/nodejs-storage/issues/884)) ([96a7fc2](https://www.github.com/googleapis/nodejs-storage/commit/96a7fc297a563819b09727990eb9ee15a421310b)) -* allow leading slashes in file name ([#820](https://www.github.com/googleapis/nodejs-storage/issues/820)) ([92e115d](https://www.github.com/googleapis/nodejs-storage/commit/92e115dca81604909fc34e983abcf47409d3f417)) - -## [3.5.0](https://www.github.com/googleapis/nodejs-storage/compare/v3.4.0...v3.5.0) (2019-10-14) - - -### Features - -* **bucket:** add enableLogging method ([#876](https://www.github.com/googleapis/nodejs-storage/issues/876)) ([b09ecac](https://www.github.com/googleapis/nodejs-storage/commit/b09ecac79b70bf99e19f0f23ffcecd17e34516bb)) - -## [3.4.0](https://www.github.com/googleapis/nodejs-storage/compare/v3.3.1...v3.4.0) (2019-10-10) - - -### Bug Fixes - -* file#move do not delete origin file if same as destination ([#874](https://www.github.com/googleapis/nodejs-storage/issues/874)) ([dcaba8a](https://www.github.com/googleapis/nodejs-storage/commit/dcaba8a)) -* pass predefined acl as destinationPredefinedAcl to qs ([#872](https://www.github.com/googleapis/nodejs-storage/issues/872)) ([09b8fa4](https://www.github.com/googleapis/nodejs-storage/commit/09b8fa4)) - - -### Features - -* add flag to allow disabling auto decompression by client ([#850](https://www.github.com/googleapis/nodejs-storage/issues/850)) ([9ebface](https://www.github.com/googleapis/nodejs-storage/commit/9ebface)) -* allow setting standard Bucket storage class ([#873](https://www.github.com/googleapis/nodejs-storage/issues/873)) ([12a99e9](https://www.github.com/googleapis/nodejs-storage/commit/12a99e9)) - -### [3.3.1](https://www.github.com/googleapis/nodejs-storage/compare/v3.3.0...v3.3.1) (2019-09-30) - - -### Bug Fixes - -* create correct v4 signed url with cname ([#868](https://www.github.com/googleapis/nodejs-storage/issues/868)) ([ace3b5e](https://www.github.com/googleapis/nodejs-storage/commit/ace3b5e)) - -## [3.3.0](https://www.github.com/googleapis/nodejs-storage/compare/v3.2.1...v3.3.0) (2019-09-19) - - -### Bug Fixes - -* **deps:** update dependency @google-cloud/pubsub to ^0.32.0 ([#849](https://www.github.com/googleapis/nodejs-storage/issues/849)) ([fdf70bb](https://www.github.com/googleapis/nodejs-storage/commit/fdf70bb)) -* add warning for unsupported keepAcl param in file#copy ([#841](https://www.github.com/googleapis/nodejs-storage/issues/841)) ([473bda0](https://www.github.com/googleapis/nodejs-storage/commit/473bda0)) -* remove unsupported keepAcl param ([#837](https://www.github.com/googleapis/nodejs-storage/issues/837)) ([5f69a3d](https://www.github.com/googleapis/nodejs-storage/commit/5f69a3d)) -* use storage.googleapis.com for api endpoint ([#854](https://www.github.com/googleapis/nodejs-storage/issues/854)) ([27fa02f](https://www.github.com/googleapis/nodejs-storage/commit/27fa02f)) -* **deps:** update dependency @google-cloud/pubsub to v1 ([#858](https://www.github.com/googleapis/nodejs-storage/issues/858)) ([31466f4](https://www.github.com/googleapis/nodejs-storage/commit/31466f4)) -* **deps:** update dependency date-and-time to ^0.10.0 ([#857](https://www.github.com/googleapis/nodejs-storage/issues/857)) ([e9ec9cf](https://www.github.com/googleapis/nodejs-storage/commit/e9ec9cf)) - - -### Features - -* adds support for asyncIterators (via readable-stream@3 dependency) ([dd5ae7f](https://www.github.com/googleapis/nodejs-storage/commit/dd5ae7f)) -* allow removal of resumable upload cache ([#773](https://www.github.com/googleapis/nodejs-storage/issues/773)) ([da943db](https://www.github.com/googleapis/nodejs-storage/commit/da943db)), closes [#217](https://www.github.com/googleapis/nodejs-storage/issues/217) - -### [3.2.1](https://www.github.com/googleapis/nodejs-storage/compare/v3.2.0...v3.2.1) (2019-08-28) - - -### Bug Fixes - -* **docs:** stop redirecting reference docs to anchor, add new sample to README ([bbb5537](https://www.github.com/googleapis/nodejs-storage/commit/bbb5537)) -* **samples:** fix failing sample view IAM member-role groups ([1c4f21f](https://www.github.com/googleapis/nodejs-storage/commit/1c4f21f)) - -## [3.2.0](https://www.github.com/googleapis/nodejs-storage/compare/v3.1.0...v3.2.0) (2019-08-22) - - -### Bug Fixes - -* **deps:** update @google-cloud/common with fixes for http ([#809](https://www.github.com/googleapis/nodejs-storage/issues/809)) ([8598631](https://www.github.com/googleapis/nodejs-storage/commit/8598631)) -* **deps:** update dependency @google-cloud/pubsub to ^0.31.0 ([#814](https://www.github.com/googleapis/nodejs-storage/issues/814)) ([604e564](https://www.github.com/googleapis/nodejs-storage/commit/604e564)) -* **deps:** update dependency date-and-time to ^0.9.0 ([#805](https://www.github.com/googleapis/nodejs-storage/issues/805)) ([8739a7d](https://www.github.com/googleapis/nodejs-storage/commit/8739a7d)) -* **ts:** fix nock @~11.0.0 ([#819](https://www.github.com/googleapis/nodejs-storage/issues/819)) ([48f9b44](https://www.github.com/googleapis/nodejs-storage/commit/48f9b44)) - - -### Features - -* hmac service account ([#751](https://www.github.com/googleapis/nodejs-storage/issues/751)) ([ed1ec7b](https://www.github.com/googleapis/nodejs-storage/commit/ed1ec7b)) - -## [3.1.0](https://www.github.com/googleapis/nodejs-storage/compare/v3.0.4...v3.1.0) (2019-08-09) - - -### Bug Fixes - -* **deps:** update dependency @google-cloud/paginator to v2 ([#781](https://www.github.com/googleapis/nodejs-storage/issues/781)) ([23244e9](https://www.github.com/googleapis/nodejs-storage/commit/23244e9)) -* **deps:** update dependency @google-cloud/pubsub to ^0.30.0 ([#778](https://www.github.com/googleapis/nodejs-storage/issues/778)) ([7256650](https://www.github.com/googleapis/nodejs-storage/commit/7256650)) -* allow calls with no request, add JSON proto ([30fff15](https://www.github.com/googleapis/nodejs-storage/commit/30fff15)) -* **deps:** update dependency date-and-time to ^0.8.0 ([#779](https://www.github.com/googleapis/nodejs-storage/issues/779)) ([ab2734d](https://www.github.com/googleapis/nodejs-storage/commit/ab2734d)) -* **deps:** upgrade @google-cloud/common version to show original… ([#795](https://www.github.com/googleapis/nodejs-storage/issues/795)) ([ea63cbe](https://www.github.com/googleapis/nodejs-storage/commit/ea63cbe)) -* **deps:** use the latest extend ([#800](https://www.github.com/googleapis/nodejs-storage/issues/800)) ([a7f0172](https://www.github.com/googleapis/nodejs-storage/commit/a7f0172)) - - -### Features - -* **file:** allow setting configPath of resumable upload ([#642](https://www.github.com/googleapis/nodejs-storage/issues/642)) ([a8ceb78](https://www.github.com/googleapis/nodejs-storage/commit/a8ceb78)) - -### [3.0.4](https://www.github.com/googleapis/nodejs-storage/compare/v3.0.3...v3.0.4) (2019-07-25) - - -### Bug Fixes - -* **deps:** update dependency pumpify to v2 ([#740](https://www.github.com/googleapis/nodejs-storage/issues/740)) ([71a4f59](https://www.github.com/googleapis/nodejs-storage/commit/71a4f59)) - -### [3.0.3](https://www.github.com/googleapis/nodejs-storage/compare/v3.0.2...v3.0.3) (2019-07-16) - - -### Bug Fixes - -* **typescript:** make SetLabelOptions optional ([#766](https://www.github.com/googleapis/nodejs-storage/issues/766)) ([4336882](https://www.github.com/googleapis/nodejs-storage/commit/4336882)) - -### [3.0.2](https://www.github.com/googleapis/nodejs-storage/compare/v3.0.1...v3.0.2) (2019-07-01) - - -### Bug Fixes - -* **docs:** fix sample code in docs ([#759](https://www.github.com/googleapis/nodejs-storage/issues/759)) ([f9e5fd8](https://www.github.com/googleapis/nodejs-storage/commit/f9e5fd8)) -* **docs:** link to reference docs section on googleapis.dev ([#753](https://www.github.com/googleapis/nodejs-storage/issues/753)) ([5e3a96b](https://www.github.com/googleapis/nodejs-storage/commit/5e3a96b)) - -### [3.0.1](https://www.github.com/googleapis/nodejs-storage/compare/v3.0.0...v3.0.1) (2019-06-14) - - -### Bug Fixes - -* async should be dependency ([#743](https://www.github.com/googleapis/nodejs-storage/issues/743)) ([e542b8b](https://www.github.com/googleapis/nodejs-storage/commit/e542b8b)) - -## [3.0.0](https://www.github.com/googleapis/nodejs-storage/compare/v2.5.0...v3.0.0) (2019-06-14) - - -### ⚠ BREAKING CHANGES - -* upgrade engines field to >=8.10.0 (#688) - -### Bug Fixes - -* **deps:** update dependency @google-cloud/common to v1 ([#705](https://www.github.com/googleapis/nodejs-storage/issues/705)) ([72a9f51](https://www.github.com/googleapis/nodejs-storage/commit/72a9f51)) -* **deps:** update dependency @google-cloud/paginator to v1 ([#695](https://www.github.com/googleapis/nodejs-storage/issues/695)) ([ada995e](https://www.github.com/googleapis/nodejs-storage/commit/ada995e)) -* **deps:** update dependency @google-cloud/promisify to v1 ([#693](https://www.github.com/googleapis/nodejs-storage/issues/693)) ([5df2f83](https://www.github.com/googleapis/nodejs-storage/commit/5df2f83)) -* **deps:** update dependency @google-cloud/pubsub to ^0.29.0 ([#714](https://www.github.com/googleapis/nodejs-storage/issues/714)) ([3ee1a2c](https://www.github.com/googleapis/nodejs-storage/commit/3ee1a2c)) -* **deps:** update dependency arrify to v2 ([#667](https://www.github.com/googleapis/nodejs-storage/issues/667)) ([ce02c27](https://www.github.com/googleapis/nodejs-storage/commit/ce02c27)) -* validate action of getSignedUrl() function ([#684](https://www.github.com/googleapis/nodejs-storage/issues/684)) ([1b09d24](https://www.github.com/googleapis/nodejs-storage/commit/1b09d24)) -* **deps:** update dependency date-and-time to ^0.7.0 ([#736](https://www.github.com/googleapis/nodejs-storage/issues/736)) ([7071f26](https://www.github.com/googleapis/nodejs-storage/commit/7071f26)) -* **deps:** update dependency xdg-basedir to v4 ([#681](https://www.github.com/googleapis/nodejs-storage/issues/681)) ([8b40e6a](https://www.github.com/googleapis/nodejs-storage/commit/8b40e6a)) -* **docs:** move to new client docs URL ([#738](https://www.github.com/googleapis/nodejs-storage/issues/738)) ([a637f99](https://www.github.com/googleapis/nodejs-storage/commit/a637f99)) -* **ts:** improve return types for response metadata ([#666](https://www.github.com/googleapis/nodejs-storage/issues/666)) ([da42bed](https://www.github.com/googleapis/nodejs-storage/commit/da42bed)) -* **types:** fix signatures of listing methods ([#703](https://www.github.com/googleapis/nodejs-storage/issues/703)) ([42937a8](https://www.github.com/googleapis/nodejs-storage/commit/42937a8)) - - -### Build System - -* upgrade engines field to >=8.10.0 ([#688](https://www.github.com/googleapis/nodejs-storage/issues/688)) ([6a1fa0f](https://www.github.com/googleapis/nodejs-storage/commit/6a1fa0f)) - - -### Features - -* add file.isPublic() function ([#708](https://www.github.com/googleapis/nodejs-storage/issues/708)) ([f86cadb](https://www.github.com/googleapis/nodejs-storage/commit/f86cadb)) -* support apiEndpoint override ([#728](https://www.github.com/googleapis/nodejs-storage/issues/728)) ([61eeb64](https://www.github.com/googleapis/nodejs-storage/commit/61eeb64)) - -## v2.5.0 - -04-04-2019 12:27 PDT - -This release brings an option to file#getSignedURL to create a version 4 Signed URL. - -```javascript -file.getSignedUrl({ - version: 'v4', // optional, defaults to v2 (existing version) - action: 'read', - expires: FUTURE_DATE, -}) -``` - -### New Features -- feat: introduce v4 signed url ([#637](https://github.com/googleapis/nodejs-storage/pull/637)) - -### Dependencies -- chore(deps): update dependency @types/node to v11.13.0 ([#662](https://github.com/googleapis/nodejs-storage/pull/662)) -- chore(deps): update dependency @types/tmp to v0.1.0 -- chore(deps): upgrade to newest version of @google-cloud/common ([#657](https://github.com/googleapis/nodejs-storage/pull/657)) -- chore(deps): update dependency typescript to ~3.4.0 -- chore(deps): update dependency tmp to ^0.1.0 ([#641](https://github.com/googleapis/nodejs-storage/pull/641)) - -### Documentation -- docs: regenerate the samples/README.md ([#649](https://github.com/googleapis/nodejs-storage/pull/649)) -- docs: slight difference in how nightly synthtool run generated README ([#650](https://github.com/googleapis/nodejs-storage/pull/650)) -- docs: new synthtool generated README ([#645](https://github.com/googleapis/nodejs-storage/pull/645)) -- docs(samples): refactor the quickstart to match the new rubric ([#647](https://github.com/googleapis/nodejs-storage/pull/647)) -- docs: update README format -- docs: add requires_billing, retire .cloud-repo-tools.json ([#644](https://github.com/googleapis/nodejs-storage/pull/644)) -- docs: add additional api_id field ([#640](https://github.com/googleapis/nodejs-storage/pull/640)) -- docs: document destination option ([#633](https://github.com/googleapis/nodejs-storage/pull/633)) -- docs: clarify in docs, the meaning of ASIA and coldline ([#632](https://github.com/googleapis/nodejs-storage/pull/632)) -- docs: add a .repo-metadata.json ([#639](https://github.com/googleapis/nodejs-storage/pull/639)) - -### Internal / Testing Changes -- test(v2-sign): add multi-valued headers system-test ([#646](https://github.com/googleapis/nodejs-storage/pull/646)) -- refactor: replace once with onetime ([#660](https://github.com/googleapis/nodejs-storage/pull/660)) -- fix: do not download cached files ([#643](https://github.com/googleapis/nodejs-storage/pull/643)) -- chore: publish to npm using wombat ([#634](https://github.com/googleapis/nodejs-storage/pull/634)) -- build: use per-repo npm publish token ([#630](https://github.com/googleapis/nodejs-storage/pull/630)) - -## v2.4.3 - -03-13-2019 17:10 PDT - -### Bug Fixes / Implementation Changes -- fix: getSigned(Policy|Url) throws if expiration is invalid Date ([#614](https://github.com/googleapis/nodejs-storage/pull/614)) -- fix: handle errors from file#createReadStream ([#615](https://github.com/googleapis/nodejs-storage/pull/615)) - -### Dependencies -- fix(deps): update dependency @google-cloud/paginator to ^0.2.0 -- fix(deps): update dependency gcs-resumable-upload to v1 ([#619](https://github.com/googleapis/nodejs-storage/pull/619)) -- fix(deps): update dependency @google-cloud/pubsub to ^0.27.0 ([#620](https://github.com/googleapis/nodejs-storage/pull/620)) -- fix(deps): update dependency @google-cloud/pubsub to ^0.26.0 ([#618](https://github.com/googleapis/nodejs-storage/pull/618)) -- fix(deps): update dependency @google-cloud/pubsub to ^0.25.0 ([#616](https://github.com/googleapis/nodejs-storage/pull/616)) -- chore(deps): update dependency mocha to v6 ([#611](https://github.com/googleapis/nodejs-storage/pull/611)) -- fix(deps): update dependency @google-cloud/promisify to ^0.4.0 ([#609](https://github.com/googleapis/nodejs-storage/pull/609)) -- chore(deps): update dependency @types/tmp to v0.0.34 ([#608](https://github.com/googleapis/nodejs-storage/pull/608)) -- fix(deps): update dependency yargs to v13 ([#606](https://github.com/googleapis/nodejs-storage/pull/606)) - -### Documentation -- docs: update links in contrib guide ([#610](https://github.com/googleapis/nodejs-storage/pull/610)) -- docs: update contributing path in README ([#603](https://github.com/googleapis/nodejs-storage/pull/603)) -- chore: move CONTRIBUTING.md to root ([#601](https://github.com/googleapis/nodejs-storage/pull/601)) - -### Internal / Testing Changes -- build: Add docuploader credentials to node publish jobs ([#624](https://github.com/googleapis/nodejs-storage/pull/624)) -- build: use node10 to run samples-test, system-test etc ([#623](https://github.com/googleapis/nodejs-storage/pull/623)) -- build: update release configuration -- build: use linkinator for docs test ([#607](https://github.com/googleapis/nodejs-storage/pull/607)) -- build: create docs test npm scripts ([#605](https://github.com/googleapis/nodejs-storage/pull/605)) -- build: test using @grpc/grpc-js in CI ([#604](https://github.com/googleapis/nodejs-storage/pull/604)) -- chore: remove console.log in system test ([#599](https://github.com/googleapis/nodejs-storage/pull/599)) - -## v2.4.2 - -02-05-2019 16:55 PST - -### Dependencies - -- deps: update @google-cloud/common ([#596](https://github.com/googleapis/nodejs-storage/pull/596)) -- chore(deps): update dependency typescript to ~3.3.0 ([#591](https://github.com/googleapis/nodejs-storage/pull/591)) - -### Documentation - -- docs: add lint/fix example to contributing guide ([#594](https://github.com/googleapis/nodejs-storage/pull/594)) - -### Internal / Testing Changes - -- test: skip public bucket system tests running under VPCSC ([#595](https://github.com/googleapis/nodejs-storage/pull/595)) - -## v2.4.1 - -01-29-2019 13:05 PST - -### Implementation Changes -- fix(ts): fix Storage.createBucket overloaded signature ([#589](https://github.com/googleapis/nodejs-storage/pull/589)) - -### Dependencies -- fix(deps): update dependency @google-cloud/pubsub to ^0.24.0 ([#588](https://github.com/googleapis/nodejs-storage/pull/588)) - -## v2.4.0 - -01-28-2019 12:13 PST - -### New Features -- fix: `expires` can be a Date, string, or number ([#548](https://github.com/googleapis/nodejs-storage/pull/548)) - -### Dependencies -- deps: upgrade nodejs-common ([#582](https://github.com/googleapis/nodejs-storage/pull/582)) -- chore(deps): update dependency eslint-config-prettier to v4 ([#586](https://github.com/googleapis/nodejs-storage/pull/586)) -- fix(deps): update dependency @google-cloud/pubsub to ^0.23.0 ([#583](https://github.com/googleapis/nodejs-storage/pull/583)) -- fix(deps): update dependency concat-stream to v2 ([#563](https://github.com/googleapis/nodejs-storage/pull/563)) - -### Documentation -- docs(samples): Bucket Policy Only Samples ([#557](https://github.com/googleapis/nodejs-storage/pull/557)) -- fix(docs): move jsdoc away from interface ([#565](https://github.com/googleapis/nodejs-storage/pull/565)) - -### Internal / Testing Changes -- test: Bucket Policy Only related system test ([#579](https://github.com/googleapis/nodejs-storage/pull/579)) -- build: check broken links in generated docs ([#567](https://github.com/googleapis/nodejs-storage/pull/567)) -- build: include only build/src in compiled source ([#572](https://github.com/googleapis/nodejs-storage/pull/572)) - -## v2.3.4 - -12-19-2018 14:21 PST - -### Implementation Changes -- fix(types): file.getMetadata should resolves to Metadata, not File ([#560](https://github.com/googleapis/nodejs-storage/pull/560)) - -### Internal / Testing Changes -- refactor: modernize the sample tests ([#558](https://github.com/googleapis/nodejs-storage/pull/558)) -- chore(build): inject yoshi automation key ([#555](https://github.com/googleapis/nodejs-storage/pull/555)) -- chore: update nyc and eslint configs ([#554](https://github.com/googleapis/nodejs-storage/pull/554)) -- chore: fix publish.sh permission +x ([#552](https://github.com/googleapis/nodejs-storage/pull/552)) -- fix(build): fix Kokoro release script ([#551](https://github.com/googleapis/nodejs-storage/pull/551)) -- build: add Kokoro configs for autorelease ([#550](https://github.com/googleapis/nodejs-storage/pull/550)) - -## v2.3.3 - -12-06-2018 17:09 PST - -### Dependencies -- chore(deps): update dependency @types/configstore to v4 ([#537](https://github.com/googleapis/nodejs-storage/pull/537)) -- chore(deps): update dependency @google-cloud/pubsub to ^0.22.0 ([#535](https://github.com/googleapis/nodejs-storage/pull/535)) - -### Documentation -- fix(docs): place doc comment above the last overload ([#544](https://github.com/googleapis/nodejs-storage/pull/544)) -- docs: update readme badges ([#536](https://github.com/googleapis/nodejs-storage/pull/536)) - -### Internal / Testing Changes -- chore: always nyc report before calling codecov ([#543](https://github.com/googleapis/nodejs-storage/pull/543)) -- chore: nyc ignore build/test by default ([#542](https://github.com/googleapis/nodejs-storage/pull/542)) -- chore: update license file ([#539](https://github.com/googleapis/nodejs-storage/pull/539)) - -## v2.3.2 - -This patch release fixed an issue affecting reading from a file on GCS ([#528](https://github.com/googleapis/nodejs-storage/issues/528)). - -### Dependencies -- fix(dep): upgrade teeny-request to v3.11.3 ([#529](https://github.com/googleapis/nodejs-storage/pull/529)) -- fix(deps): update dependency @google-cloud/common to ^0.27.0 ([#525](https://github.com/googleapis/nodejs-storage/pull/525)) - -### Internal / Testing Changes -- refactor: convert sample tests from ava to mocha ([#523](https://github.com/googleapis/nodejs-storage/pull/523)) -- docs(samples): updated samples code to use async await ([#521](https://github.com/googleapis/nodejs-storage/pull/521)) -- chore: add synth.metadata -- fix(ts): Update bucket options types ([#518](https://github.com/googleapis/nodejs-storage/pull/518)) - -## v2.3.1 - -11-14-2018 22:15 PST - -### Bug fixes -- fix: fix TypeScript and system tests ([#515](https://github.com/googleapis/nodejs-storage/pull/515)) -- fix(deps): update dependency through2 to v3 ([#507](https://github.com/googleapis/nodejs-storage/pull/507)) -- docs: File#setMetadata in parallel results in unpredictable state ([#504](https://github.com/googleapis/nodejs-storage/pull/504)) - -### Internal / Testing Changes -- chore(deps): update dependency gts to ^0.9.0 ([#514](https://github.com/googleapis/nodejs-storage/pull/514)) -- chore: update eslintignore config ([#513](https://github.com/googleapis/nodejs-storage/pull/513)) -- chore(deps): update dependency @google-cloud/nodejs-repo-tools to v3 ([#512](https://github.com/googleapis/nodejs-storage/pull/512)) -- refactor: use object.assign where possible ([#510](https://github.com/googleapis/nodejs-storage/pull/510)) -- chore: drop contributors from multiple places ([#511](https://github.com/googleapis/nodejs-storage/pull/511)) -- chore: use latest npm on Windows ([#509](https://github.com/googleapis/nodejs-storage/pull/509)) - -## v2.3.0 - -### Implementation Changes -- fix(types): Fixes getSignedUrl Return Type ([#496](https://github.com/googleapis/nodejs-storage/pull/496)) -- -### New Features -- Introduce Object Lifecycle Management ([#471](https://github.com/googleapis/nodejs-storage/pull/471)) - -### Dependencies -- chore(deps): update dependency eslint-plugin-node to v8 ([#490](https://github.com/googleapis/nodejs-storage/pull/490)) - -### Internal / Testing Changes -- chore: update issue templates ([#488](https://github.com/googleapis/nodejs-storage/pull/488)) - -## v2.2.0 - -### Bug Fixes -- fix: re-enable typescript types ([#484](https://github.com/googleapis/nodejs-storage/pull/484)) - -### Dependencies -- fix(deps): update dependency @google-cloud/common to ^0.26.0 (edited) ([#480](https://github.com/googleapis/nodejs-storage/pull/480)) -- chore: Remove 'is' dependency ([#462](https://github.com/googleapis/nodejs-storage/pull/462)) -- chore: upgrade teeny-request to 3.11.0 with type definitions ([#457](https://github.com/googleapis/nodejs-storage/pull/457)) -- feat: use small HTTP dependency ([#416](https://github.com/googleapis/nodejs-storage/pull/416)) - -### Documentation -- docs: Minor docs correction ([#465](https://github.com/googleapis/nodejs-storage/pull/465)) - -### Internal / Testing Changes -- chore: remove old issue template ([#485](https://github.com/googleapis/nodejs-storage/pull/485)) -- chore(typescript): enable noImplicitAny ([#483](https://github.com/googleapis/nodejs-storage/pull/483)) -- chore(typescript): improve typescript types and update tests ([#482](https://github.com/googleapis/nodejs-storage/pull/482)) -- build: run tests on node11 ([#481](https://github.com/googleapis/nodejs-storage/pull/481)) -- chores(build): do not collect sponge.xml from windows builds ([#478](https://github.com/googleapis/nodejs-storage/pull/478)) -- chores(build): run codecov on continuous builds ([#476](https://github.com/googleapis/nodejs-storage/pull/476)) -- chore: update new issue template ([#475](https://github.com/googleapis/nodejs-storage/pull/475)) -- fix: enable noImplicitAny for src/bucket.ts ([#472](https://github.com/googleapis/nodejs-storage/pull/472)) -- fix(tests): use unique prefix for system tests to avoid collision with another run ([#468](https://github.com/googleapis/nodejs-storage/pull/468)) -- fix: improve the types ([#467](https://github.com/googleapis/nodejs-storage/pull/467)) -- chore: move class Storage to storage.ts, create index.ts that contains all exports ([#464](https://github.com/googleapis/nodejs-storage/pull/464)) -- chore: add types to many unit tests ([#463](https://github.com/googleapis/nodejs-storage/pull/463)) -- fix: Annotate Iam types ([#461](https://github.com/googleapis/nodejs-storage/pull/461)) -- fix: complete bucket.ts noImplicitAny ([#460](https://github.com/googleapis/nodejs-storage/pull/460)) -- fix: improve the types on acl.ts ([#459](https://github.com/googleapis/nodejs-storage/pull/459)) -- fix: improve types (7) ([#458](https://github.com/googleapis/nodejs-storage/pull/458)) -- fix: improve the types ([#453](https://github.com/googleapis/nodejs-storage/pull/453)) -- chore: update build config ([#455](https://github.com/googleapis/nodejs-storage/pull/455)) -- fix: improve typescript types in src/file.ts ([#450](https://github.com/googleapis/nodejs-storage/pull/450)) -- build: fix codecov uploading on Kokoro ([#451](https://github.com/googleapis/nodejs-storage/pull/451)) -- test: Attempt to re-enable iam#testPermissions ([#429](https://github.com/googleapis/nodejs-storage/pull/429)) -- chore(deps): update dependency sinon to v7 ([#449](https://github.com/googleapis/nodejs-storage/pull/449)) -- Re-generate library using /synth.py ([#448](https://github.com/googleapis/nodejs-storage/pull/448)) -- Correct parameter name. ([#446](https://github.com/googleapis/nodejs-storage/pull/446)) - -## v2.1.0 - -This release brings support for Bucket/Object lock operations, as well as disable TypeScript as we continue to annotate the project with types. - -### New Features -- feat: Support Bucket/Object lock operations ([#374](https://github.com/googleapis/nodejs-storage/pull/374)) - -### Implementation Changes -- disable types for now ([#392](https://github.com/googleapis/nodejs-storage/pull/392)) -- Don't publish sourcemaps ([#412](https://github.com/googleapis/nodejs-storage/pull/412)) -#### TypeScript support (in progress) -- fix: add better types for file.ts ([#436](https://github.com/googleapis/nodejs-storage/pull/436)) -- fix: use ~ for typescript (and fix compile errors) ([#426](https://github.com/googleapis/nodejs-storage/pull/426)) -- fix: Add typing for File#download() ([#409](https://github.com/googleapis/nodejs-storage/pull/409)) -- chore: convert system tests to typescript ([#424](https://github.com/googleapis/nodejs-storage/pull/424)) -- Improve TypeScript types (part 4) ([#402](https://github.com/googleapis/nodejs-storage/pull/402)) -- ts: convert jsdoc types to typescript interfaces (1) ([#383](https://github.com/googleapis/nodejs-storage/pull/383)) -- fix: TS definition ([#387](https://github.com/googleapis/nodejs-storage/pull/387)) -- Annotate types [#3](https://github.com/googleapis/nodejs-storage/pull/3) ([#391](https://github.com/googleapis/nodejs-storage/pull/391)) -- Annotate types (2) ([#388](https://github.com/googleapis/nodejs-storage/pull/388)) - -### Dependencies -- chore(deps): update dependency eslint-plugin-prettier to v3 ([#419](https://github.com/googleapis/nodejs-storage/pull/419)) - -### Documentation -- docs: Modify source location for templates ([#410](https://github.com/googleapis/nodejs-storage/pull/410)) -- docs: Explain `Bucket#upload()` still exists ([#421](https://github.com/googleapis/nodejs-storage/pull/421)) - -### Internal / Testing Changes -- fix(tests): fix system tests on CircleCI ([#431](https://github.com/googleapis/nodejs-storage/pull/431)) -- fix(tests): system-test compiles to ./build, fix relative path ([#428](https://github.com/googleapis/nodejs-storage/pull/428)) -- Update kokoro config ([#425](https://github.com/googleapis/nodejs-storage/pull/425)) -- chore(samples): convert samples to async/await ([#422](https://github.com/googleapis/nodejs-storage/pull/422)) -- build: samples test by adding approprate test variables ([#423](https://github.com/googleapis/nodejs-storage/pull/423)) -- build: bring in latest kokoro cfgs to run System tests on PRs ([#413](https://github.com/googleapis/nodejs-storage/pull/413)) -- test: remove appveyor config ([#411](https://github.com/googleapis/nodejs-storage/pull/411)) -- Enable prefer-const in the eslint config ([#404](https://github.com/googleapis/nodejs-storage/pull/404)) -- fix(test): instantiate PubSub using new ([#403](https://github.com/googleapis/nodejs-storage/pull/403)) -- fix: optionsOrCallback could be undefined if not given, check before assign ([#401](https://github.com/googleapis/nodejs-storage/pull/401)) -- Fix the requesterPays methods ([#400](https://github.com/googleapis/nodejs-storage/pull/400)) -- Enable no-var in eslint ([#398](https://github.com/googleapis/nodejs-storage/pull/398)) -- samples: don't use USA formatted dates for expiry ([#396](https://github.com/googleapis/nodejs-storage/pull/396)) -- fix: copy(): Use correct destination file name in URI ([#389](https://github.com/googleapis/nodejs-storage/pull/389)) - -## v2.0.3 - -### Implementation Changes -- Improve TypeScript types ([#381](https://github.com/googleapis/nodejs-storage/pull/381)) -- Make some parameters optional ([#380](https://github.com/googleapis/nodejs-storage/pull/380)) - -## v2.0.2 - -### Implementation Changes -- Improve the types (#377) - -## v2.0.1 - -**This fixes types declaration issues with projects using TypeScript.** - -### Implementation Changes -- Enable noImplicitThis in the tsconfig ([#370](https://github.com/googleapis/nodejs-storage/pull/370)) -- Fix the path to the d.ts ([#364](https://github.com/googleapis/nodejs-storage/pull/364)) -- fix: make dependency on request explicit ([#361](https://github.com/googleapis/nodejs-storage/pull/361)) -- fix: remove trailing slashes from bucket name. ([#266](https://github.com/googleapis/nodejs-storage/pull/266)) - -### Dependencies -- fix(deps): update dependency @google-cloud/common to ^0.24.0 ([#367](https://github.com/googleapis/nodejs-storage/pull/367)) -- fix(deps): update dependency gcs-resumable-upload to ^0.13.0 ([#368](https://github.com/googleapis/nodejs-storage/pull/368)) -- Remove unused dependencies ([#363](https://github.com/googleapis/nodejs-storage/pull/363)) -- Remove safe-buffer ([#359](https://github.com/googleapis/nodejs-storage/pull/359)) -- samples: update dependency @google-cloud/storage to v2 ([#350](https://github.com/googleapis/nodejs-storage/pull/350)) - -### Internal / Testing Changes -- Update CI config ([#371](https://github.com/googleapis/nodejs-storage/pull/371)) -- build(kokoro): run docker as user node ([#358](https://github.com/googleapis/nodejs-storage/pull/358)) -- build: fix multiline in circle.yml ([#357](https://github.com/googleapis/nodejs-storage/pull/357)) -- fix executable modes on .sh's; add pre-system-test.sh hook ([#356](https://github.com/googleapis/nodejs-storage/pull/356)) -- decrypt both service account keys ([#353](https://github.com/googleapis/nodejs-storage/pull/353)) -- Retry npm install in CI ([#352](https://github.com/googleapis/nodejs-storage/pull/352)) -- Add synth script and run it ([#351](https://github.com/googleapis/nodejs-storage/pull/351)) - -## v2.0.0 - -**This release has breaking changes**. This release has a few notable breaking changes. Please take care when upgrading! - -### require syntax changes -The import style of this library has been changed to support [es module](https://nodejs.org/api/esm.html) syntax. This provides both forward compatibility with es modules, and better supports the TypeScript and Babel ecosystems. As a result, the import syntax has changed: - -#### Old Code -```js -const storage = require('@google-cloud/storage')(); -// or... -const Storage = require('@google-cloud/storage'); -const storage = new Storage({ - // config... -}); -``` - -#### New Code -```js -const {Storage} = require('@google-cloud/storage'); -const storage = new Storage({ - // config... -}); -``` - -### `bucket.upload` no longer accepts URLs -To better support a variety of HTTP clients, the remote fetching functionality of `bucket.upload` has been removed. It can be replaced with your favorite HTTP client. - -#### Old Code -```js -bucket.upload('https://example.com/images/image.png', function(err, file, res) { - // handle upload... -}); -``` - -#### New Code - -```js -const request = require('request'); -const file = bucket.file(name); -const writeStream = file.createWriteStream(); -request(url).pipe(writeStream); -``` - -### Breaking changes -- semver: do not support upload() from url (#337) -- fix: drop support for node.js 4.x and 9.x (#282) - -### Features -- refactor(ts): merge initial TypeScript conversion (#334) -- feat: Add Storage#getServiceAccount(). (#331) -- Kms sample (#209) - -### Bug fixes -- fix: gzip and Cache-Control headers in upload sample (#225) -- fix: move this.[ROLE]s initialization from Acl to AclAccessorRoleMethods (#252) -- fix: signedURL cname (#210) (#234) - -### Internal / Testing Changes -- chore(deps): update dependency nyc to v13 (#341) -- fix(deps): update dependency @google-cloud/common to ^0.23.0 (#340) -- test: throw on deprecation (#319) -- chore(deps): update dependency eslint-config-prettier to v3 (#336) -- fix(deps): update dependency gcs-resumable-upload to ^0.12.0 (#317) -- Fix system tests for string comparisons (#328) -- chore: ignore package-lock.json (#326) -- chore: update renovate config (#322) -- chore: regen lock files (#318) -- chore(deps): lock file maintenance (#313) -- chore: move mocha options to mocha.opts (#311) -- chore(deps): lock file maintenance (#309) -- test: use strictEqual in tests (#306) -- chore(deps): update dependency eslint-plugin-node to v7 (#305) -- chore(deps): lock file maintenance (#303) -- chore(deps): lock file maintenance (#285) -- fix: test meant to assert err msg exists (#280) -- fix(deps): update dependency yargs to v12 (#270) -- fix(deps): update dependency uuid to v3.3.2 (#269) -- chore: update gcs-resumable-upload to 0.11.1 (#265) -- fix(deps): update dependency uuid to v3.3.0 (#262) -- chore(deps): update dependency sinon to v6 (#263) -- Configure Renovate (#250) -- refactor: drop repo-tool as an exec wrapper (#258) -- chore: update sample lockfiles (#256) -- fix: update linking for samples (#254) -- chore(package): update eslint to version 5.0.0 (#253) -- refactor(es6): Refactor constructor pattern as ES6 class (#246) -- Update @google-cloud/common to the latest version 🚀 (#226) -- system-tests: fix channel test. (#243) -- refactor: Update to the latest version of nodejs-common and gcs-resumable-upload (#202) -- Fix permission of bash script for Kokoro (#223) -- chore(package): update nyc to version 12.0.2 (#216) -- chore: fix prettier incompatibility (#211) diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/LICENSE b/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/LICENSE deleted file mode 100644 index d6456956..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/README.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/README.md deleted file mode 100644 index f906c9f2..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/README.md +++ /dev/null @@ -1,282 +0,0 @@ -[//]: # "This README.md file is auto-generated, all changes to this file will be lost." -[//]: # "To regenerate it, use `python -m synthtool`." -Google Cloud Platform logo - -# [Google Cloud Storage: Node.js Client](https://github.com/googleapis/nodejs-storage) - -[![release level](https://img.shields.io/badge/release%20level-stable-brightgreen.svg?style=flat)](https://cloud.google.com/terms/launch-stages) -[![npm version](https://img.shields.io/npm/v/@google-cloud/storage.svg)](https://www.npmjs.org/package/@google-cloud/storage) - - - - -> Node.js idiomatic client for [Cloud Storage][product-docs]. - -[Cloud Storage](https://cloud.google.com/storage/docs) allows world-wide -storage and retrieval of any amount of data at any time. You can use Google -Cloud Storage for a range of scenarios including serving website content, -storing data for archival and disaster recovery, or distributing large data -objects to users via direct download. - - -A comprehensive list of changes in each version may be found in -[the CHANGELOG](https://github.com/googleapis/nodejs-storage/blob/main/CHANGELOG.md). - -* [Google Cloud Storage Node.js Client API Reference][client-docs] -* [Google Cloud Storage Documentation][product-docs] -* [github.com/googleapis/nodejs-storage](https://github.com/googleapis/nodejs-storage) - -Read more about the client libraries for Cloud APIs, including the older -Google APIs Client Libraries, in [Client Libraries Explained][explained]. - -[explained]: https://cloud.google.com/apis/docs/client-libraries-explained - -**Table of contents:** - - -* [Quickstart](#quickstart) - * [Before you begin](#before-you-begin) - * [Installing the client library](#installing-the-client-library) - * [Using the client library](#using-the-client-library) -* [Samples](#samples) -* [Versioning](#versioning) -* [Contributing](#contributing) -* [License](#license) - -## Quickstart - -### Before you begin - -1. [Select or create a Cloud Platform project][projects]. -1. [Enable billing for your project][billing]. -1. [Enable the Google Cloud Storage API][enable_api]. -1. [Set up authentication with a service account][auth] so you can access the - API from your local workstation. - -### Installing the client library - -```bash -npm install @google-cloud/storage -``` - - -### Using the client library - -```javascript -// Imports the Google Cloud client library -const {Storage} = require('@google-cloud/storage'); - -// For more information on ways to initialize Storage, please see -// https://googleapis.dev/nodejs/storage/latest/Storage.html - -// Creates a client using Application Default Credentials -const storage = new Storage(); - -// Creates a client from a Google service account key -// const storage = new Storage({keyFilename: 'key.json'}); - -/** - * TODO(developer): Uncomment these variables before running the sample. - */ -// The ID of your GCS bucket -// const bucketName = 'your-unique-bucket-name'; - -async function createBucket() { - // Creates the new bucket - await storage.createBucket(bucketName); - console.log(`Bucket ${bucketName} created.`); -} - -createBucket().catch(console.error); - -``` - - - -## Samples - -Samples are in the [`samples/`](https://github.com/googleapis/nodejs-storage/tree/main/samples) directory. Each sample's `README.md` has instructions for running its sample. - -| Sample | Source Code | Try it | -| --------------------------- | --------------------------------- | ------ | -| Add Bucket Conditional Binding | [source code](https://github.com/googleapis/nodejs-storage/blob/main/samples/addBucketConditionalBinding.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/addBucketConditionalBinding.js,samples/README.md) | -| Add Bucket Default Owner Acl | [source code](https://github.com/googleapis/nodejs-storage/blob/main/samples/addBucketDefaultOwnerAcl.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/addBucketDefaultOwnerAcl.js,samples/README.md) | -| Add Bucket Iam Member | [source code](https://github.com/googleapis/nodejs-storage/blob/main/samples/addBucketIamMember.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/addBucketIamMember.js,samples/README.md) | -| Storage Add Bucket Label. | [source code](https://github.com/googleapis/nodejs-storage/blob/main/samples/addBucketLabel.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/addBucketLabel.js,samples/README.md) | -| Add Bucket Owner Acl | [source code](https://github.com/googleapis/nodejs-storage/blob/main/samples/addBucketOwnerAcl.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/addBucketOwnerAcl.js,samples/README.md) | -| Bucket Website Configuration. | [source code](https://github.com/googleapis/nodejs-storage/blob/main/samples/addBucketWebsiteConfiguration.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/addBucketWebsiteConfiguration.js,samples/README.md) | -| Add File Owner Acl | [source code](https://github.com/googleapis/nodejs-storage/blob/main/samples/addFileOwnerAcl.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/addFileOwnerAcl.js,samples/README.md) | -| Storage Get Bucket Metadata. | [source code](https://github.com/googleapis/nodejs-storage/blob/main/samples/bucketMetadata.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/bucketMetadata.js,samples/README.md) | -| Change Bucket's Default Storage Class. | [source code](https://github.com/googleapis/nodejs-storage/blob/main/samples/changeDefaultStorageClass.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/changeDefaultStorageClass.js,samples/README.md) | -| Storage File Convert CSEK to CMEK. | [source code](https://github.com/googleapis/nodejs-storage/blob/main/samples/changeFileCSEKToCMEK.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/changeFileCSEKToCMEK.js,samples/README.md) | -| Storage Combine files. | [source code](https://github.com/googleapis/nodejs-storage/blob/main/samples/composeFile.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/composeFile.js,samples/README.md) | -| Storage Configure Bucket Cors. | [source code](https://github.com/googleapis/nodejs-storage/blob/main/samples/configureBucketCors.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/configureBucketCors.js,samples/README.md) | -| Configure Retries | [source code](https://github.com/googleapis/nodejs-storage/blob/main/samples/configureRetries.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/configureRetries.js,samples/README.md) | -| Copy File | [source code](https://github.com/googleapis/nodejs-storage/blob/main/samples/copyFile.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/copyFile.js,samples/README.md) | -| Copy Old Version Of File. | [source code](https://github.com/googleapis/nodejs-storage/blob/main/samples/copyOldVersionOfFile.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/copyOldVersionOfFile.js,samples/README.md) | -| Create a Dual-Region Bucket | [source code](https://github.com/googleapis/nodejs-storage/blob/main/samples/createBucketWithDualRegion.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/createBucketWithDualRegion.js,samples/README.md) | -| Create Bucket With Storage Class and Location. | [source code](https://github.com/googleapis/nodejs-storage/blob/main/samples/createBucketWithStorageClassAndLocation.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/createBucketWithStorageClassAndLocation.js,samples/README.md) | -| Create Bucket With Turbo Replication | [source code](https://github.com/googleapis/nodejs-storage/blob/main/samples/createBucketWithTurboReplication.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/createBucketWithTurboReplication.js,samples/README.md) | -| Create New Bucket | [source code](https://github.com/googleapis/nodejs-storage/blob/main/samples/createNewBucket.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/createNewBucket.js,samples/README.md) | -| Create Notification | [source code](https://github.com/googleapis/nodejs-storage/blob/main/samples/createNotification.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/createNotification.js,samples/README.md) | -| Delete Bucket | [source code](https://github.com/googleapis/nodejs-storage/blob/main/samples/deleteBucket.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/deleteBucket.js,samples/README.md) | -| Delete File | [source code](https://github.com/googleapis/nodejs-storage/blob/main/samples/deleteFile.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/deleteFile.js,samples/README.md) | -| Delete Notification | [source code](https://github.com/googleapis/nodejs-storage/blob/main/samples/deleteNotification.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/deleteNotification.js,samples/README.md) | -| Delete Old Version Of File. | [source code](https://github.com/googleapis/nodejs-storage/blob/main/samples/deleteOldVersionOfFile.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/deleteOldVersionOfFile.js,samples/README.md) | -| Disable Bucket Lifecycle Management | [source code](https://github.com/googleapis/nodejs-storage/blob/main/samples/disableBucketLifecycleManagement.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/disableBucketLifecycleManagement.js,samples/README.md) | -| Storage Disable Bucket Versioning. | [source code](https://github.com/googleapis/nodejs-storage/blob/main/samples/disableBucketVersioning.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/disableBucketVersioning.js,samples/README.md) | -| Disable Default Event Based Hold | [source code](https://github.com/googleapis/nodejs-storage/blob/main/samples/disableDefaultEventBasedHold.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/disableDefaultEventBasedHold.js,samples/README.md) | -| Disable Requester Pays | [source code](https://github.com/googleapis/nodejs-storage/blob/main/samples/disableRequesterPays.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/disableRequesterPays.js,samples/README.md) | -| Disable Uniform Bucket Level Access | [source code](https://github.com/googleapis/nodejs-storage/blob/main/samples/disableUniformBucketLevelAccess.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/disableUniformBucketLevelAccess.js,samples/README.md) | -| Download Byte Range | [source code](https://github.com/googleapis/nodejs-storage/blob/main/samples/downloadByteRange.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/downloadByteRange.js,samples/README.md) | -| Download Encrypted File | [source code](https://github.com/googleapis/nodejs-storage/blob/main/samples/downloadEncryptedFile.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/downloadEncryptedFile.js,samples/README.md) | -| Download File | [source code](https://github.com/googleapis/nodejs-storage/blob/main/samples/downloadFile.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/downloadFile.js,samples/README.md) | -| Download File Using Requester Pays | [source code](https://github.com/googleapis/nodejs-storage/blob/main/samples/downloadFileUsingRequesterPays.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/downloadFileUsingRequesterPays.js,samples/README.md) | -| Download Into Memory | [source code](https://github.com/googleapis/nodejs-storage/blob/main/samples/downloadIntoMemory.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/downloadIntoMemory.js,samples/README.md) | -| Storage Download Public File. | [source code](https://github.com/googleapis/nodejs-storage/blob/main/samples/downloadPublicFile.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/downloadPublicFile.js,samples/README.md) | -| Enable Bucket Lifecycle Management | [source code](https://github.com/googleapis/nodejs-storage/blob/main/samples/enableBucketLifecycleManagement.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/enableBucketLifecycleManagement.js,samples/README.md) | -| Storage Enable Bucket Versioning. | [source code](https://github.com/googleapis/nodejs-storage/blob/main/samples/enableBucketVersioning.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/enableBucketVersioning.js,samples/README.md) | -| Enable Default Event Based Hold | [source code](https://github.com/googleapis/nodejs-storage/blob/main/samples/enableDefaultEventBasedHold.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/enableDefaultEventBasedHold.js,samples/README.md) | -| Enable Default KMS Key | [source code](https://github.com/googleapis/nodejs-storage/blob/main/samples/enableDefaultKMSKey.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/enableDefaultKMSKey.js,samples/README.md) | -| Enable Requester Pays | [source code](https://github.com/googleapis/nodejs-storage/blob/main/samples/enableRequesterPays.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/enableRequesterPays.js,samples/README.md) | -| Enable Uniform Bucket Level Access | [source code](https://github.com/googleapis/nodejs-storage/blob/main/samples/enableUniformBucketLevelAccess.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/enableUniformBucketLevelAccess.js,samples/README.md) | -| Change File's Storage Class. | [source code](https://github.com/googleapis/nodejs-storage/blob/main/samples/fileChangeStorageClass.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/fileChangeStorageClass.js,samples/README.md) | -| Storage Set File Metadata. | [source code](https://github.com/googleapis/nodejs-storage/blob/main/samples/fileSetMetadata.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/fileSetMetadata.js,samples/README.md) | -| Generate Encryption Key | [source code](https://github.com/googleapis/nodejs-storage/blob/main/samples/generateEncryptionKey.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/generateEncryptionKey.js,samples/README.md) | -| Generate Signed Url | [source code](https://github.com/googleapis/nodejs-storage/blob/main/samples/generateSignedUrl.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/generateSignedUrl.js,samples/README.md) | -| Generate V4 Read Signed Url | [source code](https://github.com/googleapis/nodejs-storage/blob/main/samples/generateV4ReadSignedUrl.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/generateV4ReadSignedUrl.js,samples/README.md) | -| Generate V4 Signed Policy | [source code](https://github.com/googleapis/nodejs-storage/blob/main/samples/generateV4SignedPolicy.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/generateV4SignedPolicy.js,samples/README.md) | -| Generate V4 Upload Signed Url | [source code](https://github.com/googleapis/nodejs-storage/blob/main/samples/generateV4UploadSignedUrl.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/generateV4UploadSignedUrl.js,samples/README.md) | -| Get Autoclass | [source code](https://github.com/googleapis/nodejs-storage/blob/main/samples/getAutoclass.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/getAutoclass.js,samples/README.md) | -| Get Default Event Based Hold | [source code](https://github.com/googleapis/nodejs-storage/blob/main/samples/getDefaultEventBasedHold.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/getDefaultEventBasedHold.js,samples/README.md) | -| Get Metadata | [source code](https://github.com/googleapis/nodejs-storage/blob/main/samples/getMetadata.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/getMetadata.js,samples/README.md) | -| Get Metadata Notifications | [source code](https://github.com/googleapis/nodejs-storage/blob/main/samples/getMetadataNotifications.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/getMetadataNotifications.js,samples/README.md) | -| Get Public Access Prevention | [source code](https://github.com/googleapis/nodejs-storage/blob/main/samples/getPublicAccessPrevention.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/getPublicAccessPrevention.js,samples/README.md) | -| Get RPO | [source code](https://github.com/googleapis/nodejs-storage/blob/main/samples/getRPO.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/getRPO.js,samples/README.md) | -| Get Requester Pays Status | [source code](https://github.com/googleapis/nodejs-storage/blob/main/samples/getRequesterPaysStatus.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/getRequesterPaysStatus.js,samples/README.md) | -| Get Retention Policy | [source code](https://github.com/googleapis/nodejs-storage/blob/main/samples/getRetentionPolicy.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/getRetentionPolicy.js,samples/README.md) | -| Storage Get Service Account. | [source code](https://github.com/googleapis/nodejs-storage/blob/main/samples/getServiceAccount.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/getServiceAccount.js,samples/README.md) | -| Get Uniform Bucket Level Access | [source code](https://github.com/googleapis/nodejs-storage/blob/main/samples/getUniformBucketLevelAccess.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/getUniformBucketLevelAccess.js,samples/README.md) | -| Activate HMAC SA Key. | [source code](https://github.com/googleapis/nodejs-storage/blob/main/samples/hmacKeyActivate.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/hmacKeyActivate.js,samples/README.md) | -| Create HMAC SA Key. | [source code](https://github.com/googleapis/nodejs-storage/blob/main/samples/hmacKeyCreate.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/hmacKeyCreate.js,samples/README.md) | -| Deactivate HMAC SA Key. | [source code](https://github.com/googleapis/nodejs-storage/blob/main/samples/hmacKeyDeactivate.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/hmacKeyDeactivate.js,samples/README.md) | -| Delete HMAC SA Key. | [source code](https://github.com/googleapis/nodejs-storage/blob/main/samples/hmacKeyDelete.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/hmacKeyDelete.js,samples/README.md) | -| Get HMAC SA Key Metadata. | [source code](https://github.com/googleapis/nodejs-storage/blob/main/samples/hmacKeyGet.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/hmacKeyGet.js,samples/README.md) | -| List HMAC SA Keys Metadata. | [source code](https://github.com/googleapis/nodejs-storage/blob/main/samples/hmacKeysList.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/hmacKeysList.js,samples/README.md) | -| List Buckets | [source code](https://github.com/googleapis/nodejs-storage/blob/main/samples/listBuckets.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/listBuckets.js,samples/README.md) | -| List Files | [source code](https://github.com/googleapis/nodejs-storage/blob/main/samples/listFiles.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/listFiles.js,samples/README.md) | -| List Files By Prefix | [source code](https://github.com/googleapis/nodejs-storage/blob/main/samples/listFilesByPrefix.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/listFilesByPrefix.js,samples/README.md) | -| List Files Paginate | [source code](https://github.com/googleapis/nodejs-storage/blob/main/samples/listFilesPaginate.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/listFilesPaginate.js,samples/README.md) | -| List Files with Old Versions. | [source code](https://github.com/googleapis/nodejs-storage/blob/main/samples/listFilesWithOldVersions.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/listFilesWithOldVersions.js,samples/README.md) | -| List Notifications | [source code](https://github.com/googleapis/nodejs-storage/blob/main/samples/listNotifications.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/listNotifications.js,samples/README.md) | -| Lock Retention Policy | [source code](https://github.com/googleapis/nodejs-storage/blob/main/samples/lockRetentionPolicy.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/lockRetentionPolicy.js,samples/README.md) | -| Storage Make Bucket Public. | [source code](https://github.com/googleapis/nodejs-storage/blob/main/samples/makeBucketPublic.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/makeBucketPublic.js,samples/README.md) | -| Make Public | [source code](https://github.com/googleapis/nodejs-storage/blob/main/samples/makePublic.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/makePublic.js,samples/README.md) | -| Move File | [source code](https://github.com/googleapis/nodejs-storage/blob/main/samples/moveFile.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/moveFile.js,samples/README.md) | -| Print Bucket Acl | [source code](https://github.com/googleapis/nodejs-storage/blob/main/samples/printBucketAcl.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/printBucketAcl.js,samples/README.md) | -| Print Bucket Acl For User | [source code](https://github.com/googleapis/nodejs-storage/blob/main/samples/printBucketAclForUser.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/printBucketAclForUser.js,samples/README.md) | -| Print File Acl | [source code](https://github.com/googleapis/nodejs-storage/blob/main/samples/printFileAcl.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/printFileAcl.js,samples/README.md) | -| Print File Acl For User | [source code](https://github.com/googleapis/nodejs-storage/blob/main/samples/printFileAclForUser.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/printFileAclForUser.js,samples/README.md) | -| Quickstart | [source code](https://github.com/googleapis/nodejs-storage/blob/main/samples/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) | -| Release Event Based Hold | [source code](https://github.com/googleapis/nodejs-storage/blob/main/samples/releaseEventBasedHold.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/releaseEventBasedHold.js,samples/README.md) | -| Release Temporary Hold | [source code](https://github.com/googleapis/nodejs-storage/blob/main/samples/releaseTemporaryHold.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/releaseTemporaryHold.js,samples/README.md) | -| Remove Bucket Conditional Binding | [source code](https://github.com/googleapis/nodejs-storage/blob/main/samples/removeBucketConditionalBinding.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/removeBucketConditionalBinding.js,samples/README.md) | -| Storage Remove Bucket Cors Configuration. | [source code](https://github.com/googleapis/nodejs-storage/blob/main/samples/removeBucketCors.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/removeBucketCors.js,samples/README.md) | -| Remove Bucket Default Owner | [source code](https://github.com/googleapis/nodejs-storage/blob/main/samples/removeBucketDefaultOwner.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/removeBucketDefaultOwner.js,samples/README.md) | -| Remove Bucket Iam Member | [source code](https://github.com/googleapis/nodejs-storage/blob/main/samples/removeBucketIamMember.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/removeBucketIamMember.js,samples/README.md) | -| Storage Remove Bucket Label. | [source code](https://github.com/googleapis/nodejs-storage/blob/main/samples/removeBucketLabel.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/removeBucketLabel.js,samples/README.md) | -| Remove Bucket Owner Acl | [source code](https://github.com/googleapis/nodejs-storage/blob/main/samples/removeBucketOwnerAcl.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/removeBucketOwnerAcl.js,samples/README.md) | -| Remove Default KMS Key. | [source code](https://github.com/googleapis/nodejs-storage/blob/main/samples/removeDefaultKMSKey.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/removeDefaultKMSKey.js,samples/README.md) | -| Remove File Owner Acl | [source code](https://github.com/googleapis/nodejs-storage/blob/main/samples/removeFileOwnerAcl.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/removeFileOwnerAcl.js,samples/README.md) | -| Remove Retention Policy | [source code](https://github.com/googleapis/nodejs-storage/blob/main/samples/removeRetentionPolicy.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/removeRetentionPolicy.js,samples/README.md) | -| Rename File | [source code](https://github.com/googleapis/nodejs-storage/blob/main/samples/renameFile.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/renameFile.js,samples/README.md) | -| Rotate Encryption Key | [source code](https://github.com/googleapis/nodejs-storage/blob/main/samples/rotateEncryptionKey.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/rotateEncryptionKey.js,samples/README.md) | -| Set Autoclass | [source code](https://github.com/googleapis/nodejs-storage/blob/main/samples/setAutoclass.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/setAutoclass.js,samples/README.md) | -| Set Client Endpoint | [source code](https://github.com/googleapis/nodejs-storage/blob/main/samples/setClientEndpoint.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/setClientEndpoint.js,samples/README.md) | -| Set Event Based Hold | [source code](https://github.com/googleapis/nodejs-storage/blob/main/samples/setEventBasedHold.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/setEventBasedHold.js,samples/README.md) | -| Set Public Access Prevention Enforced | [source code](https://github.com/googleapis/nodejs-storage/blob/main/samples/setPublicAccessPreventionEnforced.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/setPublicAccessPreventionEnforced.js,samples/README.md) | -| Set Public Access Prevention Inherited | [source code](https://github.com/googleapis/nodejs-storage/blob/main/samples/setPublicAccessPreventionInherited.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/setPublicAccessPreventionInherited.js,samples/README.md) | -| Set RPO Async Turbo | [source code](https://github.com/googleapis/nodejs-storage/blob/main/samples/setRPOAsyncTurbo.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/setRPOAsyncTurbo.js,samples/README.md) | -| Set RPO Default | [source code](https://github.com/googleapis/nodejs-storage/blob/main/samples/setRPODefault.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/setRPODefault.js,samples/README.md) | -| Set Retention Policy | [source code](https://github.com/googleapis/nodejs-storage/blob/main/samples/setRetentionPolicy.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/setRetentionPolicy.js,samples/README.md) | -| Set Temporary Hold | [source code](https://github.com/googleapis/nodejs-storage/blob/main/samples/setTemporaryHold.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/setTemporaryHold.js,samples/README.md) | -| Stream File Download | [source code](https://github.com/googleapis/nodejs-storage/blob/main/samples/streamFileDownload.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/streamFileDownload.js,samples/README.md) | -| Stream File Upload | [source code](https://github.com/googleapis/nodejs-storage/blob/main/samples/streamFileUpload.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/streamFileUpload.js,samples/README.md) | -| Upload a directory to a bucket. | [source code](https://github.com/googleapis/nodejs-storage/blob/main/samples/uploadDirectory.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/uploadDirectory.js,samples/README.md) | -| Upload Encrypted File | [source code](https://github.com/googleapis/nodejs-storage/blob/main/samples/uploadEncryptedFile.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/uploadEncryptedFile.js,samples/README.md) | -| Upload File | [source code](https://github.com/googleapis/nodejs-storage/blob/main/samples/uploadFile.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/uploadFile.js,samples/README.md) | -| Upload File With Kms Key | [source code](https://github.com/googleapis/nodejs-storage/blob/main/samples/uploadFileWithKmsKey.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/uploadFileWithKmsKey.js,samples/README.md) | -| Upload From Memory | [source code](https://github.com/googleapis/nodejs-storage/blob/main/samples/uploadFromMemory.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/uploadFromMemory.js,samples/README.md) | -| Upload Without Authentication | [source code](https://github.com/googleapis/nodejs-storage/blob/main/samples/uploadWithoutAuthentication.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/uploadWithoutAuthentication.js,samples/README.md) | -| Upload Without Authentication Signed Url | [source code](https://github.com/googleapis/nodejs-storage/blob/main/samples/uploadWithoutAuthenticationSignedUrl.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/uploadWithoutAuthenticationSignedUrl.js,samples/README.md) | -| View Bucket Iam Members | [source code](https://github.com/googleapis/nodejs-storage/blob/main/samples/viewBucketIamMembers.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/viewBucketIamMembers.js,samples/README.md) | - - - -The [Google Cloud Storage Node.js Client API Reference][client-docs] documentation -also contains samples. - -## Supported Node.js Versions - -Our client libraries follow the [Node.js release schedule](https://nodejs.org/en/about/releases/). -Libraries are compatible with all current _active_ and _maintenance_ versions of -Node.js. -If you are using an end-of-life version of Node.js, we recommend that you update -as soon as possible to an actively supported LTS version. - -Google's client libraries support legacy versions of Node.js runtimes on a -best-efforts basis with the following warnings: - -* Legacy versions are not tested in continuous integration. -* Some security patches and features cannot be backported. -* Dependencies cannot be kept up-to-date. - -Client libraries targeting some end-of-life versions of Node.js are available, and -can be installed through npm [dist-tags](https://docs.npmjs.com/cli/dist-tag). -The dist-tags follow the naming convention `legacy-(version)`. -For example, `npm install @google-cloud/storage@legacy-8` installs client libraries -for versions compatible with Node.js 8. - -## Versioning - -This library follows [Semantic Versioning](http://semver.org/). - - - -This library is considered to be **stable**. The code surface will not change in backwards-incompatible ways -unless absolutely necessary (e.g. because of critical security issues) or with -an extensive deprecation period. Issues and requests against **stable** libraries -are addressed with the highest priority. - - - - - - -More Information: [Google Cloud Platform Launch Stages][launch_stages] - -[launch_stages]: https://cloud.google.com/terms/launch-stages - -## Contributing - -Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/nodejs-storage/blob/main/CONTRIBUTING.md). - -Please note that this `README.md`, the `samples/README.md`, -and a variety of configuration files in this repository (including `.nycrc` and `tsconfig.json`) -are generated from a central template. To edit one of these files, make an edit -to its templates in -[directory](https://github.com/googleapis/synthtool). - -## License - -Apache Version 2.0 - -See [LICENSE](https://github.com/googleapis/nodejs-storage/blob/main/LICENSE) - -[client-docs]: https://googleapis.dev/nodejs/storage/latest -[product-docs]: https://cloud.google.com/storage -[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png -[projects]: https://console.cloud.google.com/project -[billing]: https://support.google.com/cloud/answer/6293499#enable-billing -[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=storage-api.googleapis.com -[auth]: https://cloud.google.com/docs/authentication/getting-started diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/.bin/uuid b/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/.bin/uuid deleted file mode 120000 index 588f70ec..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/.bin/uuid +++ /dev/null @@ -1 +0,0 @@ -../uuid/dist/bin/uuid \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/CHANGELOG.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/CHANGELOG.md deleted file mode 100644 index 7519d19d..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/CHANGELOG.md +++ /dev/null @@ -1,229 +0,0 @@ -# Changelog - -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. - -### [8.3.2](https://github.com/uuidjs/uuid/compare/v8.3.1...v8.3.2) (2020-12-08) - -### Bug Fixes - -- lazy load getRandomValues ([#537](https://github.com/uuidjs/uuid/issues/537)) ([16c8f6d](https://github.com/uuidjs/uuid/commit/16c8f6df2f6b09b4d6235602d6a591188320a82e)), closes [#536](https://github.com/uuidjs/uuid/issues/536) - -### [8.3.1](https://github.com/uuidjs/uuid/compare/v8.3.0...v8.3.1) (2020-10-04) - -### Bug Fixes - -- support expo>=39.0.0 ([#515](https://github.com/uuidjs/uuid/issues/515)) ([c65a0f3](https://github.com/uuidjs/uuid/commit/c65a0f3fa73b901959d638d1e3591dfacdbed867)), closes [#375](https://github.com/uuidjs/uuid/issues/375) - -## [8.3.0](https://github.com/uuidjs/uuid/compare/v8.2.0...v8.3.0) (2020-07-27) - -### Features - -- add parse/stringify/validate/version/NIL APIs ([#479](https://github.com/uuidjs/uuid/issues/479)) ([0e6c10b](https://github.com/uuidjs/uuid/commit/0e6c10ba1bf9517796ff23c052fc0468eedfd5f4)), closes [#475](https://github.com/uuidjs/uuid/issues/475) [#478](https://github.com/uuidjs/uuid/issues/478) [#480](https://github.com/uuidjs/uuid/issues/480) [#481](https://github.com/uuidjs/uuid/issues/481) [#180](https://github.com/uuidjs/uuid/issues/180) - -## [8.2.0](https://github.com/uuidjs/uuid/compare/v8.1.0...v8.2.0) (2020-06-23) - -### Features - -- improve performance of v1 string representation ([#453](https://github.com/uuidjs/uuid/issues/453)) ([0ee0b67](https://github.com/uuidjs/uuid/commit/0ee0b67c37846529c66089880414d29f3ae132d5)) -- remove deprecated v4 string parameter ([#454](https://github.com/uuidjs/uuid/issues/454)) ([88ce3ca](https://github.com/uuidjs/uuid/commit/88ce3ca0ba046f60856de62c7ce03f7ba98ba46c)), closes [#437](https://github.com/uuidjs/uuid/issues/437) -- support jspm ([#473](https://github.com/uuidjs/uuid/issues/473)) ([e9f2587](https://github.com/uuidjs/uuid/commit/e9f2587a92575cac31bc1d4ae944e17c09756659)) - -### Bug Fixes - -- prepare package exports for webpack 5 ([#468](https://github.com/uuidjs/uuid/issues/468)) ([8d6e6a5](https://github.com/uuidjs/uuid/commit/8d6e6a5f8965ca9575eb4d92e99a43435f4a58a8)) - -## [8.1.0](https://github.com/uuidjs/uuid/compare/v8.0.0...v8.1.0) (2020-05-20) - -### Features - -- improve v4 performance by reusing random number array ([#435](https://github.com/uuidjs/uuid/issues/435)) ([bf4af0d](https://github.com/uuidjs/uuid/commit/bf4af0d711b4d2ed03d1f74fd12ad0baa87dc79d)) -- optimize V8 performance of bytesToUuid ([#434](https://github.com/uuidjs/uuid/issues/434)) ([e156415](https://github.com/uuidjs/uuid/commit/e156415448ec1af2351fa0b6660cfb22581971f2)) - -### Bug Fixes - -- export package.json required by react-native and bundlers ([#449](https://github.com/uuidjs/uuid/issues/449)) ([be1c8fe](https://github.com/uuidjs/uuid/commit/be1c8fe9a3206c358e0059b52fafd7213aa48a52)), closes [ai/nanoevents#44](https://github.com/ai/nanoevents/issues/44#issuecomment-602010343) [#444](https://github.com/uuidjs/uuid/issues/444) - -## [8.0.0](https://github.com/uuidjs/uuid/compare/v7.0.3...v8.0.0) (2020-04-29) - -### ⚠ BREAKING CHANGES - -- For native ECMAScript Module (ESM) usage in Node.js only named exports are exposed, there is no more default export. - - ```diff - -import uuid from 'uuid'; - -console.log(uuid.v4()); // -> 'cd6c3b08-0adc-4f4b-a6ef-36087a1c9869' - +import { v4 as uuidv4 } from 'uuid'; - +uuidv4(); // ⇨ '9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d' - ``` - -- Deep requiring specific algorithms of this library like `require('uuid/v4')`, which has been deprecated in `uuid@7`, is no longer supported. - - Instead use the named exports that this module exports. - - For ECMAScript Modules (ESM): - - ```diff - -import uuidv4 from 'uuid/v4'; - +import { v4 as uuidv4 } from 'uuid'; - uuidv4(); - ``` - - For CommonJS: - - ```diff - -const uuidv4 = require('uuid/v4'); - +const { v4: uuidv4 } = require('uuid'); - uuidv4(); - ``` - -### Features - -- native Node.js ES Modules (wrapper approach) ([#423](https://github.com/uuidjs/uuid/issues/423)) ([2d9f590](https://github.com/uuidjs/uuid/commit/2d9f590ad9701d692625c07ed62f0a0f91227991)), closes [#245](https://github.com/uuidjs/uuid/issues/245) [#419](https://github.com/uuidjs/uuid/issues/419) [#342](https://github.com/uuidjs/uuid/issues/342) -- remove deep requires ([#426](https://github.com/uuidjs/uuid/issues/426)) ([daf72b8](https://github.com/uuidjs/uuid/commit/daf72b84ceb20272a81bb5fbddb05dd95922cbba)) - -### Bug Fixes - -- add CommonJS syntax example to README quickstart section ([#417](https://github.com/uuidjs/uuid/issues/417)) ([e0ec840](https://github.com/uuidjs/uuid/commit/e0ec8402c7ad44b7ef0453036c612f5db513fda0)) - -### [7.0.3](https://github.com/uuidjs/uuid/compare/v7.0.2...v7.0.3) (2020-03-31) - -### Bug Fixes - -- make deep require deprecation warning work in browsers ([#409](https://github.com/uuidjs/uuid/issues/409)) ([4b71107](https://github.com/uuidjs/uuid/commit/4b71107d8c0d2ef56861ede6403fc9dc35a1e6bf)), closes [#408](https://github.com/uuidjs/uuid/issues/408) - -### [7.0.2](https://github.com/uuidjs/uuid/compare/v7.0.1...v7.0.2) (2020-03-04) - -### Bug Fixes - -- make access to msCrypto consistent ([#393](https://github.com/uuidjs/uuid/issues/393)) ([8bf2a20](https://github.com/uuidjs/uuid/commit/8bf2a20f3565df743da7215eebdbada9d2df118c)) -- simplify link in deprecation warning ([#391](https://github.com/uuidjs/uuid/issues/391)) ([bb2c8e4](https://github.com/uuidjs/uuid/commit/bb2c8e4e9f4c5f9c1eaaf3ea59710c633cd90cb7)) -- update links to match content in readme ([#386](https://github.com/uuidjs/uuid/issues/386)) ([44f2f86](https://github.com/uuidjs/uuid/commit/44f2f86e9d2bbf14ee5f0f00f72a3db1292666d4)) - -### [7.0.1](https://github.com/uuidjs/uuid/compare/v7.0.0...v7.0.1) (2020-02-25) - -### Bug Fixes - -- clean up esm builds for node and browser ([#383](https://github.com/uuidjs/uuid/issues/383)) ([59e6a49](https://github.com/uuidjs/uuid/commit/59e6a49e7ce7b3e8fb0f3ee52b9daae72af467dc)) -- provide browser versions independent from module system ([#380](https://github.com/uuidjs/uuid/issues/380)) ([4344a22](https://github.com/uuidjs/uuid/commit/4344a22e7aed33be8627eeaaf05360f256a21753)), closes [#378](https://github.com/uuidjs/uuid/issues/378) - -## [7.0.0](https://github.com/uuidjs/uuid/compare/v3.4.0...v7.0.0) (2020-02-24) - -### ⚠ BREAKING CHANGES - -- The default export, which used to be the v4() method but which was already discouraged in v3.x of this library, has been removed. -- Explicitly note that deep imports of the different uuid version functions are deprecated and no longer encouraged and that ECMAScript module named imports should be used instead. Emit a deprecation warning for people who deep-require the different algorithm variants. -- Remove builtin support for insecure random number generators in the browser. Users who want that will have to supply their own random number generator function. -- Remove support for generating v3 and v5 UUIDs in Node.js<4.x -- Convert code base to ECMAScript Modules (ESM) and release CommonJS build for node and ESM build for browser bundlers. - -### Features - -- add UMD build to npm package ([#357](https://github.com/uuidjs/uuid/issues/357)) ([4e75adf](https://github.com/uuidjs/uuid/commit/4e75adf435196f28e3fbbe0185d654b5ded7ca2c)), closes [#345](https://github.com/uuidjs/uuid/issues/345) -- add various es module and CommonJS examples ([b238510](https://github.com/uuidjs/uuid/commit/b238510bf352463521f74bab175a3af9b7a42555)) -- ensure that docs are up-to-date in CI ([ee5e77d](https://github.com/uuidjs/uuid/commit/ee5e77db547474f5a8f23d6c857a6d399209986b)) -- hybrid CommonJS & ECMAScript modules build ([a3f078f](https://github.com/uuidjs/uuid/commit/a3f078faa0baff69ab41aed08e041f8f9c8993d0)) -- remove insecure fallback random number generator ([3a5842b](https://github.com/uuidjs/uuid/commit/3a5842b141a6e5de0ae338f391661e6b84b167c9)), closes [#173](https://github.com/uuidjs/uuid/issues/173) -- remove support for pre Node.js v4 Buffer API ([#356](https://github.com/uuidjs/uuid/issues/356)) ([b59b5c5](https://github.com/uuidjs/uuid/commit/b59b5c5ecad271c5453f1a156f011671f6d35627)) -- rename repository to github:uuidjs/uuid ([#351](https://github.com/uuidjs/uuid/issues/351)) ([c37a518](https://github.com/uuidjs/uuid/commit/c37a518e367ac4b6d0aa62dba1bc6ce9e85020f7)), closes [#338](https://github.com/uuidjs/uuid/issues/338) - -### Bug Fixes - -- add deep-require proxies for local testing and adjust tests ([#365](https://github.com/uuidjs/uuid/issues/365)) ([7fedc79](https://github.com/uuidjs/uuid/commit/7fedc79ac8fda4bfd1c566c7f05ef4ac13b2db48)) -- add note about removal of default export ([#372](https://github.com/uuidjs/uuid/issues/372)) ([12749b7](https://github.com/uuidjs/uuid/commit/12749b700eb49db8a9759fd306d8be05dbfbd58c)), closes [#370](https://github.com/uuidjs/uuid/issues/370) -- deprecated deep requiring of the different algorithm versions ([#361](https://github.com/uuidjs/uuid/issues/361)) ([c0bdf15](https://github.com/uuidjs/uuid/commit/c0bdf15e417639b1aeb0b247b2fb11f7a0a26b23)) - -## [3.4.0](https://github.com/uuidjs/uuid/compare/v3.3.3...v3.4.0) (2020-01-16) - -### Features - -- rename repository to github:uuidjs/uuid ([#351](https://github.com/uuidjs/uuid/issues/351)) ([e2d7314](https://github.com/uuidjs/uuid/commit/e2d7314)), closes [#338](https://github.com/uuidjs/uuid/issues/338) - -## [3.3.3](https://github.com/uuidjs/uuid/compare/v3.3.2...v3.3.3) (2019-08-19) - -### Bug Fixes - -- no longer run ci tests on node v4 -- upgrade dependencies - -## [3.3.2](https://github.com/uuidjs/uuid/compare/v3.3.1...v3.3.2) (2018-06-28) - -### Bug Fixes - -- typo ([305d877](https://github.com/uuidjs/uuid/commit/305d877)) - -## [3.3.1](https://github.com/uuidjs/uuid/compare/v3.3.0...v3.3.1) (2018-06-28) - -### Bug Fixes - -- fix [#284](https://github.com/uuidjs/uuid/issues/284) by setting function name in try-catch ([f2a60f2](https://github.com/uuidjs/uuid/commit/f2a60f2)) - -# [3.3.0](https://github.com/uuidjs/uuid/compare/v3.2.1...v3.3.0) (2018-06-22) - -### Bug Fixes - -- assignment to readonly property to allow running in strict mode ([#270](https://github.com/uuidjs/uuid/issues/270)) ([d062fdc](https://github.com/uuidjs/uuid/commit/d062fdc)) -- fix [#229](https://github.com/uuidjs/uuid/issues/229) ([c9684d4](https://github.com/uuidjs/uuid/commit/c9684d4)) -- Get correct version of IE11 crypto ([#274](https://github.com/uuidjs/uuid/issues/274)) ([153d331](https://github.com/uuidjs/uuid/commit/153d331)) -- mem issue when generating uuid ([#267](https://github.com/uuidjs/uuid/issues/267)) ([c47702c](https://github.com/uuidjs/uuid/commit/c47702c)) - -### Features - -- enforce Conventional Commit style commit messages ([#282](https://github.com/uuidjs/uuid/issues/282)) ([cc9a182](https://github.com/uuidjs/uuid/commit/cc9a182)) - -## [3.2.1](https://github.com/uuidjs/uuid/compare/v3.2.0...v3.2.1) (2018-01-16) - -### Bug Fixes - -- use msCrypto if available. Fixes [#241](https://github.com/uuidjs/uuid/issues/241) ([#247](https://github.com/uuidjs/uuid/issues/247)) ([1fef18b](https://github.com/uuidjs/uuid/commit/1fef18b)) - -# [3.2.0](https://github.com/uuidjs/uuid/compare/v3.1.0...v3.2.0) (2018-01-16) - -### Bug Fixes - -- remove mistakenly added typescript dependency, rollback version (standard-version will auto-increment) ([09fa824](https://github.com/uuidjs/uuid/commit/09fa824)) -- use msCrypto if available. Fixes [#241](https://github.com/uuidjs/uuid/issues/241) ([#247](https://github.com/uuidjs/uuid/issues/247)) ([1fef18b](https://github.com/uuidjs/uuid/commit/1fef18b)) - -### Features - -- Add v3 Support ([#217](https://github.com/uuidjs/uuid/issues/217)) ([d94f726](https://github.com/uuidjs/uuid/commit/d94f726)) - -# [3.1.0](https://github.com/uuidjs/uuid/compare/v3.1.0...v3.0.1) (2017-06-17) - -### Bug Fixes - -- (fix) Add .npmignore file to exclude test/ and other non-essential files from packing. (#183) -- Fix typo (#178) -- Simple typo fix (#165) - -### Features - -- v5 support in CLI (#197) -- V5 support (#188) - -# 3.0.1 (2016-11-28) - -- split uuid versions into separate files - -# 3.0.0 (2016-11-17) - -- remove .parse and .unparse - -# 2.0.0 - -- Removed uuid.BufferClass - -# 1.4.0 - -- Improved module context detection -- Removed public RNG functions - -# 1.3.2 - -- Improve tests and handling of v1() options (Issue #24) -- Expose RNG option to allow for perf testing with different generators - -# 1.3.0 - -- Support for version 1 ids, thanks to [@ctavan](https://github.com/ctavan)! -- Support for node.js crypto API -- De-emphasizing performance in favor of a) cryptographic quality PRNGs where available and b) more manageable code diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/CONTRIBUTING.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/CONTRIBUTING.md deleted file mode 100644 index 4a4503d0..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/CONTRIBUTING.md +++ /dev/null @@ -1,18 +0,0 @@ -# Contributing - -Please feel free to file GitHub Issues or propose Pull Requests. We're always happy to discuss improvements to this library! - -## Testing - -```shell -npm test -``` - -## Releasing - -Releases are supposed to be done from master, version bumping is automated through [`standard-version`](https://github.com/conventional-changelog/standard-version): - -```shell -npm run release -- --dry-run # verify output manually -npm run release # follow the instructions from the output of this command -``` diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/LICENSE.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/LICENSE.md deleted file mode 100644 index 39341683..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/LICENSE.md +++ /dev/null @@ -1,9 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2010-2020 Robert Kieffer and other contributors - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/README.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/README.md deleted file mode 100644 index ed27e576..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/README.md +++ /dev/null @@ -1,505 +0,0 @@ - - -# uuid [![CI](https://github.com/uuidjs/uuid/workflows/CI/badge.svg)](https://github.com/uuidjs/uuid/actions?query=workflow%3ACI) [![Browser](https://github.com/uuidjs/uuid/workflows/Browser/badge.svg)](https://github.com/uuidjs/uuid/actions?query=workflow%3ABrowser) - -For the creation of [RFC4122](http://www.ietf.org/rfc/rfc4122.txt) UUIDs - -- **Complete** - Support for RFC4122 version 1, 3, 4, and 5 UUIDs -- **Cross-platform** - Support for ... - - CommonJS, [ECMAScript Modules](#ecmascript-modules) and [CDN builds](#cdn-builds) - - Node 8, 10, 12, 14 - - Chrome, Safari, Firefox, Edge, IE 11 browsers - - Webpack and rollup.js module bundlers - - [React Native / Expo](#react-native--expo) -- **Secure** - Cryptographically-strong random values -- **Small** - Zero-dependency, small footprint, plays nice with "tree shaking" packagers -- **CLI** - Includes the [`uuid` command line](#command-line) utility - -**Upgrading from `uuid@3.x`?** Your code is probably okay, but check out [Upgrading From `uuid@3.x`](#upgrading-from-uuid3x) for details. - -## Quickstart - -To create a random UUID... - -**1. Install** - -```shell -npm install uuid -``` - -**2. Create a UUID** (ES6 module syntax) - -```javascript -import { v4 as uuidv4 } from 'uuid'; -uuidv4(); // ⇨ '9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d' -``` - -... or using CommonJS syntax: - -```javascript -const { v4: uuidv4 } = require('uuid'); -uuidv4(); // ⇨ '1b9d6bcd-bbfd-4b2d-9b5d-ab8dfbbd4bed' -``` - -For timestamp UUIDs, namespace UUIDs, and other options read on ... - -## API Summary - -| | | | -| --- | --- | --- | -| [`uuid.NIL`](#uuidnil) | The nil UUID string (all zeros) | New in `uuid@8.3` | -| [`uuid.parse()`](#uuidparsestr) | Convert UUID string to array of bytes | New in `uuid@8.3` | -| [`uuid.stringify()`](#uuidstringifyarr-offset) | Convert array of bytes to UUID string | New in `uuid@8.3` | -| [`uuid.v1()`](#uuidv1options-buffer-offset) | Create a version 1 (timestamp) UUID | | -| [`uuid.v3()`](#uuidv3name-namespace-buffer-offset) | Create a version 3 (namespace w/ MD5) UUID | | -| [`uuid.v4()`](#uuidv4options-buffer-offset) | Create a version 4 (random) UUID | | -| [`uuid.v5()`](#uuidv5name-namespace-buffer-offset) | Create a version 5 (namespace w/ SHA-1) UUID | | -| [`uuid.validate()`](#uuidvalidatestr) | Test a string to see if it is a valid UUID | New in `uuid@8.3` | -| [`uuid.version()`](#uuidversionstr) | Detect RFC version of a UUID | New in `uuid@8.3` | - -## API - -### uuid.NIL - -The nil UUID string (all zeros). - -Example: - -```javascript -import { NIL as NIL_UUID } from 'uuid'; - -NIL_UUID; // ⇨ '00000000-0000-0000-0000-000000000000' -``` - -### uuid.parse(str) - -Convert UUID string to array of bytes - -| | | -| --------- | ---------------------------------------- | -| `str` | A valid UUID `String` | -| _returns_ | `Uint8Array[16]` | -| _throws_ | `TypeError` if `str` is not a valid UUID | - -Note: Ordering of values in the byte arrays used by `parse()` and `stringify()` follows the left ↠ right order of hex-pairs in UUID strings. As shown in the example below. - -Example: - -```javascript -import { parse as uuidParse } from 'uuid'; - -// Parse a UUID -const bytes = uuidParse('6ec0bd7f-11c0-43da-975e-2a8ad9ebae0b'); - -// Convert to hex strings to show byte order (for documentation purposes) -[...bytes].map((v) => v.toString(16).padStart(2, '0')); // ⇨ - // [ - // '6e', 'c0', 'bd', '7f', - // '11', 'c0', '43', 'da', - // '97', '5e', '2a', '8a', - // 'd9', 'eb', 'ae', '0b' - // ] -``` - -### uuid.stringify(arr[, offset]) - -Convert array of bytes to UUID string - -| | | -| -------------- | ---------------------------------------------------------------------------- | -| `arr` | `Array`-like collection of 16 values (starting from `offset`) between 0-255. | -| [`offset` = 0] | `Number` Starting index in the Array | -| _returns_ | `String` | -| _throws_ | `TypeError` if a valid UUID string cannot be generated | - -Note: Ordering of values in the byte arrays used by `parse()` and `stringify()` follows the left ↠ right order of hex-pairs in UUID strings. As shown in the example below. - -Example: - -```javascript -import { stringify as uuidStringify } from 'uuid'; - -const uuidBytes = [ - 0x6e, - 0xc0, - 0xbd, - 0x7f, - 0x11, - 0xc0, - 0x43, - 0xda, - 0x97, - 0x5e, - 0x2a, - 0x8a, - 0xd9, - 0xeb, - 0xae, - 0x0b, -]; - -uuidStringify(uuidBytes); // ⇨ '6ec0bd7f-11c0-43da-975e-2a8ad9ebae0b' -``` - -### uuid.v1([options[, buffer[, offset]]]) - -Create an RFC version 1 (timestamp) UUID - -| | | -| --- | --- | -| [`options`] | `Object` with one or more of the following properties: | -| [`options.node` ] | RFC "node" field as an `Array[6]` of byte values (per 4.1.6) | -| [`options.clockseq`] | RFC "clock sequence" as a `Number` between 0 - 0x3fff | -| [`options.msecs`] | RFC "timestamp" field (`Number` of milliseconds, unix epoch) | -| [`options.nsecs`] | RFC "timestamp" field (`Number` of nanseconds to add to `msecs`, should be 0-10,000) | -| [`options.random`] | `Array` of 16 random bytes (0-255) | -| [`options.rng`] | Alternative to `options.random`, a `Function` that returns an `Array` of 16 random bytes (0-255) | -| [`buffer`] | `Array \| Buffer` If specified, uuid will be written here in byte-form, starting at `offset` | -| [`offset` = 0] | `Number` Index to start writing UUID bytes in `buffer` | -| _returns_ | UUID `String` if no `buffer` is specified, otherwise returns `buffer` | -| _throws_ | `Error` if more than 10M UUIDs/sec are requested | - -Note: The default [node id](https://tools.ietf.org/html/rfc4122#section-4.1.6) (the last 12 digits in the UUID) is generated once, randomly, on process startup, and then remains unchanged for the duration of the process. - -Note: `options.random` and `options.rng` are only meaningful on the very first call to `v1()`, where they may be passed to initialize the internal `node` and `clockseq` fields. - -Example: - -```javascript -import { v1 as uuidv1 } from 'uuid'; - -uuidv1(); // ⇨ '2c5ea4c0-4067-11e9-8bad-9b1deb4d3b7d' -``` - -Example using `options`: - -```javascript -import { v1 as uuidv1 } from 'uuid'; - -const v1options = { - node: [0x01, 0x23, 0x45, 0x67, 0x89, 0xab], - clockseq: 0x1234, - msecs: new Date('2011-11-01').getTime(), - nsecs: 5678, -}; -uuidv1(v1options); // ⇨ '710b962e-041c-11e1-9234-0123456789ab' -``` - -### uuid.v3(name, namespace[, buffer[, offset]]) - -Create an RFC version 3 (namespace w/ MD5) UUID - -API is identical to `v5()`, but uses "v3" instead. - -⚠️ Note: Per the RFC, "_If backward compatibility is not an issue, SHA-1 [Version 5] is preferred_." - -### uuid.v4([options[, buffer[, offset]]]) - -Create an RFC version 4 (random) UUID - -| | | -| --- | --- | -| [`options`] | `Object` with one or more of the following properties: | -| [`options.random`] | `Array` of 16 random bytes (0-255) | -| [`options.rng`] | Alternative to `options.random`, a `Function` that returns an `Array` of 16 random bytes (0-255) | -| [`buffer`] | `Array \| Buffer` If specified, uuid will be written here in byte-form, starting at `offset` | -| [`offset` = 0] | `Number` Index to start writing UUID bytes in `buffer` | -| _returns_ | UUID `String` if no `buffer` is specified, otherwise returns `buffer` | - -Example: - -```javascript -import { v4 as uuidv4 } from 'uuid'; - -uuidv4(); // ⇨ '1b9d6bcd-bbfd-4b2d-9b5d-ab8dfbbd4bed' -``` - -Example using predefined `random` values: - -```javascript -import { v4 as uuidv4 } from 'uuid'; - -const v4options = { - random: [ - 0x10, - 0x91, - 0x56, - 0xbe, - 0xc4, - 0xfb, - 0xc1, - 0xea, - 0x71, - 0xb4, - 0xef, - 0xe1, - 0x67, - 0x1c, - 0x58, - 0x36, - ], -}; -uuidv4(v4options); // ⇨ '109156be-c4fb-41ea-b1b4-efe1671c5836' -``` - -### uuid.v5(name, namespace[, buffer[, offset]]) - -Create an RFC version 5 (namespace w/ SHA-1) UUID - -| | | -| --- | --- | -| `name` | `String \| Array` | -| `namespace` | `String \| Array[16]` Namespace UUID | -| [`buffer`] | `Array \| Buffer` If specified, uuid will be written here in byte-form, starting at `offset` | -| [`offset` = 0] | `Number` Index to start writing UUID bytes in `buffer` | -| _returns_ | UUID `String` if no `buffer` is specified, otherwise returns `buffer` | - -Note: The RFC `DNS` and `URL` namespaces are available as `v5.DNS` and `v5.URL`. - -Example with custom namespace: - -```javascript -import { v5 as uuidv5 } from 'uuid'; - -// Define a custom namespace. Readers, create your own using something like -// https://www.uuidgenerator.net/ -const MY_NAMESPACE = '1b671a64-40d5-491e-99b0-da01ff1f3341'; - -uuidv5('Hello, World!', MY_NAMESPACE); // ⇨ '630eb68f-e0fa-5ecc-887a-7c7a62614681' -``` - -Example with RFC `URL` namespace: - -```javascript -import { v5 as uuidv5 } from 'uuid'; - -uuidv5('https://www.w3.org/', uuidv5.URL); // ⇨ 'c106a26a-21bb-5538-8bf2-57095d1976c1' -``` - -### uuid.validate(str) - -Test a string to see if it is a valid UUID - -| | | -| --------- | --------------------------------------------------- | -| `str` | `String` to validate | -| _returns_ | `true` if string is a valid UUID, `false` otherwise | - -Example: - -```javascript -import { validate as uuidValidate } from 'uuid'; - -uuidValidate('not a UUID'); // ⇨ false -uuidValidate('6ec0bd7f-11c0-43da-975e-2a8ad9ebae0b'); // ⇨ true -``` - -Using `validate` and `version` together it is possible to do per-version validation, e.g. validate for only v4 UUIds. - -```javascript -import { version as uuidVersion } from 'uuid'; -import { validate as uuidValidate } from 'uuid'; - -function uuidValidateV4(uuid) { - return uuidValidate(uuid) && uuidVersion(uuid) === 4; -} - -const v1Uuid = 'd9428888-122b-11e1-b85c-61cd3cbb3210'; -const v4Uuid = '109156be-c4fb-41ea-b1b4-efe1671c5836'; - -uuidValidateV4(v4Uuid); // ⇨ true -uuidValidateV4(v1Uuid); // ⇨ false -``` - -### uuid.version(str) - -Detect RFC version of a UUID - -| | | -| --------- | ---------------------------------------- | -| `str` | A valid UUID `String` | -| _returns_ | `Number` The RFC version of the UUID | -| _throws_ | `TypeError` if `str` is not a valid UUID | - -Example: - -```javascript -import { version as uuidVersion } from 'uuid'; - -uuidVersion('45637ec4-c85f-11ea-87d0-0242ac130003'); // ⇨ 1 -uuidVersion('6ec0bd7f-11c0-43da-975e-2a8ad9ebae0b'); // ⇨ 4 -``` - -## Command Line - -UUIDs can be generated from the command line using `uuid`. - -```shell -$ uuid -ddeb27fb-d9a0-4624-be4d-4615062daed4 -``` - -The default is to generate version 4 UUIDS, however the other versions are supported. Type `uuid --help` for details: - -```shell -$ uuid --help - -Usage: - uuid - uuid v1 - uuid v3 - uuid v4 - uuid v5 - uuid --help - -Note: may be "URL" or "DNS" to use the corresponding UUIDs -defined by RFC4122 -``` - -## ECMAScript Modules - -This library comes with [ECMAScript Modules](https://www.ecma-international.org/ecma-262/6.0/#sec-modules) (ESM) support for Node.js versions that support it ([example](./examples/node-esmodules/)) as well as bundlers like [rollup.js](https://rollupjs.org/guide/en/#tree-shaking) ([example](./examples/browser-rollup/)) and [webpack](https://webpack.js.org/guides/tree-shaking/) ([example](./examples/browser-webpack/)) (targeting both, Node.js and browser environments). - -```javascript -import { v4 as uuidv4 } from 'uuid'; -uuidv4(); // ⇨ '1b9d6bcd-bbfd-4b2d-9b5d-ab8dfbbd4bed' -``` - -To run the examples you must first create a dist build of this library in the module root: - -```shell -npm run build -``` - -## CDN Builds - -### ECMAScript Modules - -To load this module directly into modern browsers that [support loading ECMAScript Modules](https://caniuse.com/#feat=es6-module) you can make use of [jspm](https://jspm.org/): - -```html - -``` - -### UMD - -To load this module directly into older browsers you can use the [UMD (Universal Module Definition)](https://github.com/umdjs/umd) builds from any of the following CDNs: - -**Using [UNPKG](https://unpkg.com/uuid@latest/dist/umd/)**: - -```html - -``` - -**Using [jsDelivr](https://cdn.jsdelivr.net/npm/uuid@latest/dist/umd/)**: - -```html - -``` - -**Using [cdnjs](https://cdnjs.com/libraries/uuid)**: - -```html - -``` - -These CDNs all provide the same [`uuidv4()`](#uuidv4options-buffer-offset) method: - -```html - -``` - -Methods for the other algorithms ([`uuidv1()`](#uuidv1options-buffer-offset), [`uuidv3()`](#uuidv3name-namespace-buffer-offset) and [`uuidv5()`](#uuidv5name-namespace-buffer-offset)) are available from the files `uuidv1.min.js`, `uuidv3.min.js` and `uuidv5.min.js` respectively. - -## "getRandomValues() not supported" - -This error occurs in environments where the standard [`crypto.getRandomValues()`](https://developer.mozilla.org/en-US/docs/Web/API/Crypto/getRandomValues) API is not supported. This issue can be resolved by adding an appropriate polyfill: - -### React Native / Expo - -1. Install [`react-native-get-random-values`](https://github.com/LinusU/react-native-get-random-values#readme) -1. Import it _before_ `uuid`. Since `uuid` might also appear as a transitive dependency of some other imports it's safest to just import `react-native-get-random-values` as the very first thing in your entry point: - -```javascript -import 'react-native-get-random-values'; -import { v4 as uuidv4 } from 'uuid'; -``` - -Note: If you are using Expo, you must be using at least `react-native-get-random-values@1.5.0` and `expo@39.0.0`. - -### Web Workers / Service Workers (Edge <= 18) - -[In Edge <= 18, Web Crypto is not supported in Web Workers or Service Workers](https://caniuse.com/#feat=cryptography) and we are not aware of a polyfill (let us know if you find one, please). - -## Upgrading From `uuid@7.x` - -### Only Named Exports Supported When Using with Node.js ESM - -`uuid@7.x` did not come with native ECMAScript Module (ESM) support for Node.js. Importing it in Node.js ESM consequently imported the CommonJS source with a default export. This library now comes with true Node.js ESM support and only provides named exports. - -Instead of doing: - -```javascript -import uuid from 'uuid'; -uuid.v4(); -``` - -you will now have to use the named exports: - -```javascript -import { v4 as uuidv4 } from 'uuid'; -uuidv4(); -``` - -### Deep Requires No Longer Supported - -Deep requires like `require('uuid/v4')` [which have been deprecated in `uuid@7.x`](#deep-requires-now-deprecated) are no longer supported. - -## Upgrading From `uuid@3.x` - -"_Wait... what happened to `uuid@4.x` - `uuid@6.x`?!?_" - -In order to avoid confusion with RFC [version 4](#uuidv4options-buffer-offset) and [version 5](#uuidv5name-namespace-buffer-offset) UUIDs, and a possible [version 6](http://gh.peabody.io/uuidv6/), releases 4 thru 6 of this module have been skipped. - -### Deep Requires Now Deprecated - -`uuid@3.x` encouraged the use of deep requires to minimize the bundle size of browser builds: - -```javascript -const uuidv4 = require('uuid/v4'); // <== NOW DEPRECATED! -uuidv4(); -``` - -As of `uuid@7.x` this library now provides ECMAScript modules builds, which allow packagers like Webpack and Rollup to do "tree-shaking" to remove dead code. Instead, use the `import` syntax: - -```javascript -import { v4 as uuidv4 } from 'uuid'; -uuidv4(); -``` - -... or for CommonJS: - -```javascript -const { v4: uuidv4 } = require('uuid'); -uuidv4(); -``` - -### Default Export Removed - -`uuid@3.x` was exporting the Version 4 UUID method as a default export: - -```javascript -const uuid = require('uuid'); // <== REMOVED! -``` - -This usage pattern was already discouraged in `uuid@3.x` and has been removed in `uuid@7.x`. - ----- -Markdown generated from [README_js.md](README_js.md) by [![RunMD Logo](http://i.imgur.com/h0FVyzU.png)](https://github.com/broofa/runmd) \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/bin/uuid b/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/bin/uuid deleted file mode 100755 index f38d2ee1..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/bin/uuid +++ /dev/null @@ -1,2 +0,0 @@ -#!/usr/bin/env node -require('../uuid-bin'); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/esm-browser/index.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/esm-browser/index.js deleted file mode 100644 index 1db6f6d2..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/esm-browser/index.js +++ /dev/null @@ -1,9 +0,0 @@ -export { default as v1 } from './v1.js'; -export { default as v3 } from './v3.js'; -export { default as v4 } from './v4.js'; -export { default as v5 } from './v5.js'; -export { default as NIL } from './nil.js'; -export { default as version } from './version.js'; -export { default as validate } from './validate.js'; -export { default as stringify } from './stringify.js'; -export { default as parse } from './parse.js'; \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/esm-browser/md5.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/esm-browser/md5.js deleted file mode 100644 index 8b5d46a7..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/esm-browser/md5.js +++ /dev/null @@ -1,215 +0,0 @@ -/* - * Browser-compatible JavaScript MD5 - * - * Modification of JavaScript MD5 - * https://github.com/blueimp/JavaScript-MD5 - * - * Copyright 2011, Sebastian Tschan - * https://blueimp.net - * - * Licensed under the MIT license: - * https://opensource.org/licenses/MIT - * - * Based on - * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message - * Digest Algorithm, as defined in RFC 1321. - * Version 2.2 Copyright (C) Paul Johnston 1999 - 2009 - * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet - * Distributed under the BSD License - * See http://pajhome.org.uk/crypt/md5 for more info. - */ -function md5(bytes) { - if (typeof bytes === 'string') { - var msg = unescape(encodeURIComponent(bytes)); // UTF8 escape - - bytes = new Uint8Array(msg.length); - - for (var i = 0; i < msg.length; ++i) { - bytes[i] = msg.charCodeAt(i); - } - } - - return md5ToHexEncodedArray(wordsToMd5(bytesToWords(bytes), bytes.length * 8)); -} -/* - * Convert an array of little-endian words to an array of bytes - */ - - -function md5ToHexEncodedArray(input) { - var output = []; - var length32 = input.length * 32; - var hexTab = '0123456789abcdef'; - - for (var i = 0; i < length32; i += 8) { - var x = input[i >> 5] >>> i % 32 & 0xff; - var hex = parseInt(hexTab.charAt(x >>> 4 & 0x0f) + hexTab.charAt(x & 0x0f), 16); - output.push(hex); - } - - return output; -} -/** - * Calculate output length with padding and bit length - */ - - -function getOutputLength(inputLength8) { - return (inputLength8 + 64 >>> 9 << 4) + 14 + 1; -} -/* - * Calculate the MD5 of an array of little-endian words, and a bit length. - */ - - -function wordsToMd5(x, len) { - /* append padding */ - x[len >> 5] |= 0x80 << len % 32; - x[getOutputLength(len) - 1] = len; - var a = 1732584193; - var b = -271733879; - var c = -1732584194; - var d = 271733878; - - for (var i = 0; i < x.length; i += 16) { - var olda = a; - var oldb = b; - var oldc = c; - var oldd = d; - a = md5ff(a, b, c, d, x[i], 7, -680876936); - d = md5ff(d, a, b, c, x[i + 1], 12, -389564586); - c = md5ff(c, d, a, b, x[i + 2], 17, 606105819); - b = md5ff(b, c, d, a, x[i + 3], 22, -1044525330); - a = md5ff(a, b, c, d, x[i + 4], 7, -176418897); - d = md5ff(d, a, b, c, x[i + 5], 12, 1200080426); - c = md5ff(c, d, a, b, x[i + 6], 17, -1473231341); - b = md5ff(b, c, d, a, x[i + 7], 22, -45705983); - a = md5ff(a, b, c, d, x[i + 8], 7, 1770035416); - d = md5ff(d, a, b, c, x[i + 9], 12, -1958414417); - c = md5ff(c, d, a, b, x[i + 10], 17, -42063); - b = md5ff(b, c, d, a, x[i + 11], 22, -1990404162); - a = md5ff(a, b, c, d, x[i + 12], 7, 1804603682); - d = md5ff(d, a, b, c, x[i + 13], 12, -40341101); - c = md5ff(c, d, a, b, x[i + 14], 17, -1502002290); - b = md5ff(b, c, d, a, x[i + 15], 22, 1236535329); - a = md5gg(a, b, c, d, x[i + 1], 5, -165796510); - d = md5gg(d, a, b, c, x[i + 6], 9, -1069501632); - c = md5gg(c, d, a, b, x[i + 11], 14, 643717713); - b = md5gg(b, c, d, a, x[i], 20, -373897302); - a = md5gg(a, b, c, d, x[i + 5], 5, -701558691); - d = md5gg(d, a, b, c, x[i + 10], 9, 38016083); - c = md5gg(c, d, a, b, x[i + 15], 14, -660478335); - b = md5gg(b, c, d, a, x[i + 4], 20, -405537848); - a = md5gg(a, b, c, d, x[i + 9], 5, 568446438); - d = md5gg(d, a, b, c, x[i + 14], 9, -1019803690); - c = md5gg(c, d, a, b, x[i + 3], 14, -187363961); - b = md5gg(b, c, d, a, x[i + 8], 20, 1163531501); - a = md5gg(a, b, c, d, x[i + 13], 5, -1444681467); - d = md5gg(d, a, b, c, x[i + 2], 9, -51403784); - c = md5gg(c, d, a, b, x[i + 7], 14, 1735328473); - b = md5gg(b, c, d, a, x[i + 12], 20, -1926607734); - a = md5hh(a, b, c, d, x[i + 5], 4, -378558); - d = md5hh(d, a, b, c, x[i + 8], 11, -2022574463); - c = md5hh(c, d, a, b, x[i + 11], 16, 1839030562); - b = md5hh(b, c, d, a, x[i + 14], 23, -35309556); - a = md5hh(a, b, c, d, x[i + 1], 4, -1530992060); - d = md5hh(d, a, b, c, x[i + 4], 11, 1272893353); - c = md5hh(c, d, a, b, x[i + 7], 16, -155497632); - b = md5hh(b, c, d, a, x[i + 10], 23, -1094730640); - a = md5hh(a, b, c, d, x[i + 13], 4, 681279174); - d = md5hh(d, a, b, c, x[i], 11, -358537222); - c = md5hh(c, d, a, b, x[i + 3], 16, -722521979); - b = md5hh(b, c, d, a, x[i + 6], 23, 76029189); - a = md5hh(a, b, c, d, x[i + 9], 4, -640364487); - d = md5hh(d, a, b, c, x[i + 12], 11, -421815835); - c = md5hh(c, d, a, b, x[i + 15], 16, 530742520); - b = md5hh(b, c, d, a, x[i + 2], 23, -995338651); - a = md5ii(a, b, c, d, x[i], 6, -198630844); - d = md5ii(d, a, b, c, x[i + 7], 10, 1126891415); - c = md5ii(c, d, a, b, x[i + 14], 15, -1416354905); - b = md5ii(b, c, d, a, x[i + 5], 21, -57434055); - a = md5ii(a, b, c, d, x[i + 12], 6, 1700485571); - d = md5ii(d, a, b, c, x[i + 3], 10, -1894986606); - c = md5ii(c, d, a, b, x[i + 10], 15, -1051523); - b = md5ii(b, c, d, a, x[i + 1], 21, -2054922799); - a = md5ii(a, b, c, d, x[i + 8], 6, 1873313359); - d = md5ii(d, a, b, c, x[i + 15], 10, -30611744); - c = md5ii(c, d, a, b, x[i + 6], 15, -1560198380); - b = md5ii(b, c, d, a, x[i + 13], 21, 1309151649); - a = md5ii(a, b, c, d, x[i + 4], 6, -145523070); - d = md5ii(d, a, b, c, x[i + 11], 10, -1120210379); - c = md5ii(c, d, a, b, x[i + 2], 15, 718787259); - b = md5ii(b, c, d, a, x[i + 9], 21, -343485551); - a = safeAdd(a, olda); - b = safeAdd(b, oldb); - c = safeAdd(c, oldc); - d = safeAdd(d, oldd); - } - - return [a, b, c, d]; -} -/* - * Convert an array bytes to an array of little-endian words - * Characters >255 have their high-byte silently ignored. - */ - - -function bytesToWords(input) { - if (input.length === 0) { - return []; - } - - var length8 = input.length * 8; - var output = new Uint32Array(getOutputLength(length8)); - - for (var i = 0; i < length8; i += 8) { - output[i >> 5] |= (input[i / 8] & 0xff) << i % 32; - } - - return output; -} -/* - * Add integers, wrapping at 2^32. This uses 16-bit operations internally - * to work around bugs in some JS interpreters. - */ - - -function safeAdd(x, y) { - var lsw = (x & 0xffff) + (y & 0xffff); - var msw = (x >> 16) + (y >> 16) + (lsw >> 16); - return msw << 16 | lsw & 0xffff; -} -/* - * Bitwise rotate a 32-bit number to the left. - */ - - -function bitRotateLeft(num, cnt) { - return num << cnt | num >>> 32 - cnt; -} -/* - * These functions implement the four basic operations the algorithm uses. - */ - - -function md5cmn(q, a, b, x, s, t) { - return safeAdd(bitRotateLeft(safeAdd(safeAdd(a, q), safeAdd(x, t)), s), b); -} - -function md5ff(a, b, c, d, x, s, t) { - return md5cmn(b & c | ~b & d, a, b, x, s, t); -} - -function md5gg(a, b, c, d, x, s, t) { - return md5cmn(b & d | c & ~d, a, b, x, s, t); -} - -function md5hh(a, b, c, d, x, s, t) { - return md5cmn(b ^ c ^ d, a, b, x, s, t); -} - -function md5ii(a, b, c, d, x, s, t) { - return md5cmn(c ^ (b | ~d), a, b, x, s, t); -} - -export default md5; \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/esm-browser/nil.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/esm-browser/nil.js deleted file mode 100644 index b36324c2..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/esm-browser/nil.js +++ /dev/null @@ -1 +0,0 @@ -export default '00000000-0000-0000-0000-000000000000'; \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/esm-browser/parse.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/esm-browser/parse.js deleted file mode 100644 index 7c5b1d5a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/esm-browser/parse.js +++ /dev/null @@ -1,35 +0,0 @@ -import validate from './validate.js'; - -function parse(uuid) { - if (!validate(uuid)) { - throw TypeError('Invalid UUID'); - } - - var v; - var arr = new Uint8Array(16); // Parse ########-....-....-....-............ - - arr[0] = (v = parseInt(uuid.slice(0, 8), 16)) >>> 24; - arr[1] = v >>> 16 & 0xff; - arr[2] = v >>> 8 & 0xff; - arr[3] = v & 0xff; // Parse ........-####-....-....-............ - - arr[4] = (v = parseInt(uuid.slice(9, 13), 16)) >>> 8; - arr[5] = v & 0xff; // Parse ........-....-####-....-............ - - arr[6] = (v = parseInt(uuid.slice(14, 18), 16)) >>> 8; - arr[7] = v & 0xff; // Parse ........-....-....-####-............ - - arr[8] = (v = parseInt(uuid.slice(19, 23), 16)) >>> 8; - arr[9] = v & 0xff; // Parse ........-....-....-....-############ - // (Use "/" to avoid 32-bit truncation when bit-shifting high-order bytes) - - arr[10] = (v = parseInt(uuid.slice(24, 36), 16)) / 0x10000000000 & 0xff; - arr[11] = v / 0x100000000 & 0xff; - arr[12] = v >>> 24 & 0xff; - arr[13] = v >>> 16 & 0xff; - arr[14] = v >>> 8 & 0xff; - arr[15] = v & 0xff; - return arr; -} - -export default parse; \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/esm-browser/regex.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/esm-browser/regex.js deleted file mode 100644 index 3da8673a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/esm-browser/regex.js +++ /dev/null @@ -1 +0,0 @@ -export 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; \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/esm-browser/rng.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/esm-browser/rng.js deleted file mode 100644 index 8abbf2ea..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/esm-browser/rng.js +++ /dev/null @@ -1,19 +0,0 @@ -// Unique ID creation requires a high quality random # generator. In the browser we therefore -// require the crypto API and do not support built-in fallback to lower quality random number -// generators (like Math.random()). -var getRandomValues; -var rnds8 = new Uint8Array(16); -export default function rng() { - // lazy load so that environments that need to polyfill have a chance to do so - if (!getRandomValues) { - // getRandomValues needs to be invoked in a context where "this" is a Crypto implementation. Also, - // find the complete implementation of crypto (msCrypto) on IE11. - getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto) || typeof msCrypto !== 'undefined' && typeof msCrypto.getRandomValues === 'function' && msCrypto.getRandomValues.bind(msCrypto); - - if (!getRandomValues) { - throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported'); - } - } - - return getRandomValues(rnds8); -} \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/esm-browser/sha1.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/esm-browser/sha1.js deleted file mode 100644 index 940548ba..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/esm-browser/sha1.js +++ /dev/null @@ -1,96 +0,0 @@ -// Adapted from Chris Veness' SHA1 code at -// http://www.movable-type.co.uk/scripts/sha1.html -function f(s, x, y, z) { - switch (s) { - case 0: - return x & y ^ ~x & z; - - case 1: - return x ^ y ^ z; - - case 2: - return x & y ^ x & z ^ y & z; - - case 3: - return x ^ y ^ z; - } -} - -function ROTL(x, n) { - return x << n | x >>> 32 - n; -} - -function sha1(bytes) { - var K = [0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xca62c1d6]; - var H = [0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0]; - - if (typeof bytes === 'string') { - var msg = unescape(encodeURIComponent(bytes)); // UTF8 escape - - bytes = []; - - for (var i = 0; i < msg.length; ++i) { - bytes.push(msg.charCodeAt(i)); - } - } else if (!Array.isArray(bytes)) { - // Convert Array-like to Array - bytes = Array.prototype.slice.call(bytes); - } - - bytes.push(0x80); - var l = bytes.length / 4 + 2; - var N = Math.ceil(l / 16); - var M = new Array(N); - - for (var _i = 0; _i < N; ++_i) { - var arr = new Uint32Array(16); - - for (var j = 0; j < 16; ++j) { - arr[j] = bytes[_i * 64 + j * 4] << 24 | bytes[_i * 64 + j * 4 + 1] << 16 | bytes[_i * 64 + j * 4 + 2] << 8 | bytes[_i * 64 + j * 4 + 3]; - } - - M[_i] = arr; - } - - M[N - 1][14] = (bytes.length - 1) * 8 / Math.pow(2, 32); - M[N - 1][14] = Math.floor(M[N - 1][14]); - M[N - 1][15] = (bytes.length - 1) * 8 & 0xffffffff; - - for (var _i2 = 0; _i2 < N; ++_i2) { - var W = new Uint32Array(80); - - for (var t = 0; t < 16; ++t) { - W[t] = M[_i2][t]; - } - - for (var _t = 16; _t < 80; ++_t) { - W[_t] = ROTL(W[_t - 3] ^ W[_t - 8] ^ W[_t - 14] ^ W[_t - 16], 1); - } - - var a = H[0]; - var b = H[1]; - var c = H[2]; - var d = H[3]; - var e = H[4]; - - for (var _t2 = 0; _t2 < 80; ++_t2) { - var s = Math.floor(_t2 / 20); - var T = ROTL(a, 5) + f(s, b, c, d) + e + K[s] + W[_t2] >>> 0; - e = d; - d = c; - c = ROTL(b, 30) >>> 0; - b = a; - a = T; - } - - H[0] = H[0] + a >>> 0; - H[1] = H[1] + b >>> 0; - H[2] = H[2] + c >>> 0; - H[3] = H[3] + d >>> 0; - H[4] = H[4] + e >>> 0; - } - - return [H[0] >> 24 & 0xff, H[0] >> 16 & 0xff, H[0] >> 8 & 0xff, H[0] & 0xff, H[1] >> 24 & 0xff, H[1] >> 16 & 0xff, H[1] >> 8 & 0xff, H[1] & 0xff, H[2] >> 24 & 0xff, H[2] >> 16 & 0xff, H[2] >> 8 & 0xff, H[2] & 0xff, H[3] >> 24 & 0xff, H[3] >> 16 & 0xff, H[3] >> 8 & 0xff, H[3] & 0xff, H[4] >> 24 & 0xff, H[4] >> 16 & 0xff, H[4] >> 8 & 0xff, H[4] & 0xff]; -} - -export default sha1; \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/esm-browser/stringify.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/esm-browser/stringify.js deleted file mode 100644 index 31021115..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/esm-browser/stringify.js +++ /dev/null @@ -1,30 +0,0 @@ -import validate from './validate.js'; -/** - * Convert array of 16 byte values to UUID string format of the form: - * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX - */ - -var byteToHex = []; - -for (var i = 0; i < 256; ++i) { - byteToHex.push((i + 0x100).toString(16).substr(1)); -} - -function stringify(arr) { - var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; - // Note: Be careful editing this code! It's been tuned for performance - // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434 - var uuid = (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase(); // Consistency check for valid UUID. If this throws, it's likely due to one - // of the following: - // - One or more input array values don't map to a hex octet (leading to - // "undefined" in the uuid) - // - Invalid input values for the RFC `version` or `variant` fields - - if (!validate(uuid)) { - throw TypeError('Stringified UUID is invalid'); - } - - return uuid; -} - -export default stringify; \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/esm-browser/v1.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/esm-browser/v1.js deleted file mode 100644 index 1a22591e..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/esm-browser/v1.js +++ /dev/null @@ -1,95 +0,0 @@ -import rng from './rng.js'; -import stringify from './stringify.js'; // **`v1()` - Generate time-based UUID** -// -// Inspired by https://github.com/LiosK/UUID.js -// and http://docs.python.org/library/uuid.html - -var _nodeId; - -var _clockseq; // Previous uuid creation time - - -var _lastMSecs = 0; -var _lastNSecs = 0; // See https://github.com/uuidjs/uuid for API details - -function v1(options, buf, offset) { - var i = buf && offset || 0; - var b = buf || new Array(16); - options = options || {}; - var node = options.node || _nodeId; - var clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq; // node and clockseq need to be initialized to random values if they're not - // specified. We do this lazily to minimize issues related to insufficient - // system entropy. See #189 - - if (node == null || clockseq == null) { - var seedBytes = options.random || (options.rng || rng)(); - - if (node == null) { - // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1) - node = _nodeId = [seedBytes[0] | 0x01, seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]]; - } - - if (clockseq == null) { - // Per 4.2.2, randomize (14 bit) clockseq - clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff; - } - } // UUID timestamps are 100 nano-second units since the Gregorian epoch, - // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so - // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs' - // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00. - - - var msecs = options.msecs !== undefined ? options.msecs : Date.now(); // Per 4.2.1.2, use count of uuid's generated during the current clock - // cycle to simulate higher resolution clock - - var nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1; // Time since last uuid creation (in msecs) - - var dt = msecs - _lastMSecs + (nsecs - _lastNSecs) / 10000; // Per 4.2.1.2, Bump clockseq on clock regression - - if (dt < 0 && options.clockseq === undefined) { - clockseq = clockseq + 1 & 0x3fff; - } // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new - // time interval - - - if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) { - nsecs = 0; - } // Per 4.2.1.2 Throw error if too many uuids are requested - - - if (nsecs >= 10000) { - throw new Error("uuid.v1(): Can't create more than 10M uuids/sec"); - } - - _lastMSecs = msecs; - _lastNSecs = nsecs; - _clockseq = clockseq; // Per 4.1.4 - Convert from unix epoch to Gregorian epoch - - msecs += 12219292800000; // `time_low` - - var tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000; - b[i++] = tl >>> 24 & 0xff; - b[i++] = tl >>> 16 & 0xff; - b[i++] = tl >>> 8 & 0xff; - b[i++] = tl & 0xff; // `time_mid` - - var tmh = msecs / 0x100000000 * 10000 & 0xfffffff; - b[i++] = tmh >>> 8 & 0xff; - b[i++] = tmh & 0xff; // `time_high_and_version` - - b[i++] = tmh >>> 24 & 0xf | 0x10; // include version - - b[i++] = tmh >>> 16 & 0xff; // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant) - - b[i++] = clockseq >>> 8 | 0x80; // `clock_seq_low` - - b[i++] = clockseq & 0xff; // `node` - - for (var n = 0; n < 6; ++n) { - b[i + n] = node[n]; - } - - return buf || stringify(b); -} - -export default v1; \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/esm-browser/v3.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/esm-browser/v3.js deleted file mode 100644 index c9ab9a4c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/esm-browser/v3.js +++ /dev/null @@ -1,4 +0,0 @@ -import v35 from './v35.js'; -import md5 from './md5.js'; -var v3 = v35('v3', 0x30, md5); -export default v3; \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/esm-browser/v35.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/esm-browser/v35.js deleted file mode 100644 index 31dd8a1c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/esm-browser/v35.js +++ /dev/null @@ -1,64 +0,0 @@ -import stringify from './stringify.js'; -import parse from './parse.js'; - -function stringToBytes(str) { - str = unescape(encodeURIComponent(str)); // UTF8 escape - - var bytes = []; - - for (var i = 0; i < str.length; ++i) { - bytes.push(str.charCodeAt(i)); - } - - return bytes; -} - -export var DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8'; -export var URL = '6ba7b811-9dad-11d1-80b4-00c04fd430c8'; -export default function (name, version, hashfunc) { - function generateUUID(value, namespace, buf, offset) { - if (typeof value === 'string') { - value = stringToBytes(value); - } - - if (typeof namespace === 'string') { - namespace = parse(namespace); - } - - if (namespace.length !== 16) { - throw TypeError('Namespace must be array-like (16 iterable integer values, 0-255)'); - } // Compute hash of namespace and value, Per 4.3 - // Future: Use spread syntax when supported on all platforms, e.g. `bytes = - // hashfunc([...namespace, ... value])` - - - var bytes = new Uint8Array(16 + value.length); - bytes.set(namespace); - bytes.set(value, namespace.length); - bytes = hashfunc(bytes); - bytes[6] = bytes[6] & 0x0f | version; - bytes[8] = bytes[8] & 0x3f | 0x80; - - if (buf) { - offset = offset || 0; - - for (var i = 0; i < 16; ++i) { - buf[offset + i] = bytes[i]; - } - - return buf; - } - - return stringify(bytes); - } // Function#name is not settable on some platforms (#270) - - - try { - generateUUID.name = name; // eslint-disable-next-line no-empty - } catch (err) {} // For CommonJS default export support - - - generateUUID.DNS = DNS; - generateUUID.URL = URL; - return generateUUID; -} \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/esm-browser/v4.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/esm-browser/v4.js deleted file mode 100644 index 404810a4..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/esm-browser/v4.js +++ /dev/null @@ -1,24 +0,0 @@ -import rng from './rng.js'; -import stringify from './stringify.js'; - -function v4(options, buf, offset) { - options = options || {}; - var rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved` - - rnds[6] = rnds[6] & 0x0f | 0x40; - rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided - - if (buf) { - offset = offset || 0; - - for (var i = 0; i < 16; ++i) { - buf[offset + i] = rnds[i]; - } - - return buf; - } - - return stringify(rnds); -} - -export default v4; \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/esm-browser/v5.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/esm-browser/v5.js deleted file mode 100644 index c08d96ba..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/esm-browser/v5.js +++ /dev/null @@ -1,4 +0,0 @@ -import v35 from './v35.js'; -import sha1 from './sha1.js'; -var v5 = v35('v5', 0x50, sha1); -export default v5; \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/esm-browser/validate.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/esm-browser/validate.js deleted file mode 100644 index f1cdc7af..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/esm-browser/validate.js +++ /dev/null @@ -1,7 +0,0 @@ -import REGEX from './regex.js'; - -function validate(uuid) { - return typeof uuid === 'string' && REGEX.test(uuid); -} - -export default validate; \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/esm-browser/version.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/esm-browser/version.js deleted file mode 100644 index 77530e9c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/esm-browser/version.js +++ /dev/null @@ -1,11 +0,0 @@ -import validate from './validate.js'; - -function version(uuid) { - if (!validate(uuid)) { - throw TypeError('Invalid UUID'); - } - - return parseInt(uuid.substr(14, 1), 16); -} - -export default version; \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/esm-node/index.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/esm-node/index.js deleted file mode 100644 index 1db6f6d2..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/esm-node/index.js +++ /dev/null @@ -1,9 +0,0 @@ -export { default as v1 } from './v1.js'; -export { default as v3 } from './v3.js'; -export { default as v4 } from './v4.js'; -export { default as v5 } from './v5.js'; -export { default as NIL } from './nil.js'; -export { default as version } from './version.js'; -export { default as validate } from './validate.js'; -export { default as stringify } from './stringify.js'; -export { default as parse } from './parse.js'; \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/esm-node/md5.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/esm-node/md5.js deleted file mode 100644 index 4d68b040..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/esm-node/md5.js +++ /dev/null @@ -1,13 +0,0 @@ -import crypto from 'crypto'; - -function md5(bytes) { - if (Array.isArray(bytes)) { - bytes = Buffer.from(bytes); - } else if (typeof bytes === 'string') { - bytes = Buffer.from(bytes, 'utf8'); - } - - return crypto.createHash('md5').update(bytes).digest(); -} - -export default md5; \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/esm-node/nil.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/esm-node/nil.js deleted file mode 100644 index b36324c2..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/esm-node/nil.js +++ /dev/null @@ -1 +0,0 @@ -export default '00000000-0000-0000-0000-000000000000'; \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/esm-node/parse.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/esm-node/parse.js deleted file mode 100644 index 6421c5d5..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/esm-node/parse.js +++ /dev/null @@ -1,35 +0,0 @@ -import validate from './validate.js'; - -function parse(uuid) { - if (!validate(uuid)) { - throw TypeError('Invalid UUID'); - } - - let v; - const arr = new Uint8Array(16); // Parse ########-....-....-....-............ - - arr[0] = (v = parseInt(uuid.slice(0, 8), 16)) >>> 24; - arr[1] = v >>> 16 & 0xff; - arr[2] = v >>> 8 & 0xff; - arr[3] = v & 0xff; // Parse ........-####-....-....-............ - - arr[4] = (v = parseInt(uuid.slice(9, 13), 16)) >>> 8; - arr[5] = v & 0xff; // Parse ........-....-####-....-............ - - arr[6] = (v = parseInt(uuid.slice(14, 18), 16)) >>> 8; - arr[7] = v & 0xff; // Parse ........-....-....-####-............ - - arr[8] = (v = parseInt(uuid.slice(19, 23), 16)) >>> 8; - arr[9] = v & 0xff; // Parse ........-....-....-....-############ - // (Use "/" to avoid 32-bit truncation when bit-shifting high-order bytes) - - arr[10] = (v = parseInt(uuid.slice(24, 36), 16)) / 0x10000000000 & 0xff; - arr[11] = v / 0x100000000 & 0xff; - arr[12] = v >>> 24 & 0xff; - arr[13] = v >>> 16 & 0xff; - arr[14] = v >>> 8 & 0xff; - arr[15] = v & 0xff; - return arr; -} - -export default parse; \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/esm-node/regex.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/esm-node/regex.js deleted file mode 100644 index 3da8673a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/esm-node/regex.js +++ /dev/null @@ -1 +0,0 @@ -export 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; \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/esm-node/rng.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/esm-node/rng.js deleted file mode 100644 index 80062449..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/esm-node/rng.js +++ /dev/null @@ -1,12 +0,0 @@ -import crypto from 'crypto'; -const rnds8Pool = new Uint8Array(256); // # of random values to pre-allocate - -let poolPtr = rnds8Pool.length; -export default function rng() { - if (poolPtr > rnds8Pool.length - 16) { - crypto.randomFillSync(rnds8Pool); - poolPtr = 0; - } - - return rnds8Pool.slice(poolPtr, poolPtr += 16); -} \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/esm-node/sha1.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/esm-node/sha1.js deleted file mode 100644 index e23850b4..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/esm-node/sha1.js +++ /dev/null @@ -1,13 +0,0 @@ -import crypto from 'crypto'; - -function sha1(bytes) { - if (Array.isArray(bytes)) { - bytes = Buffer.from(bytes); - } else if (typeof bytes === 'string') { - bytes = Buffer.from(bytes, 'utf8'); - } - - return crypto.createHash('sha1').update(bytes).digest(); -} - -export default sha1; \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/esm-node/stringify.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/esm-node/stringify.js deleted file mode 100644 index f9bca120..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/esm-node/stringify.js +++ /dev/null @@ -1,29 +0,0 @@ -import validate from './validate.js'; -/** - * Convert array of 16 byte values to UUID string format of the form: - * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX - */ - -const byteToHex = []; - -for (let i = 0; i < 256; ++i) { - byteToHex.push((i + 0x100).toString(16).substr(1)); -} - -function stringify(arr, offset = 0) { - // Note: Be careful editing this code! It's been tuned for performance - // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434 - const uuid = (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase(); // Consistency check for valid UUID. If this throws, it's likely due to one - // of the following: - // - One or more input array values don't map to a hex octet (leading to - // "undefined" in the uuid) - // - Invalid input values for the RFC `version` or `variant` fields - - if (!validate(uuid)) { - throw TypeError('Stringified UUID is invalid'); - } - - return uuid; -} - -export default stringify; \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/esm-node/v1.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/esm-node/v1.js deleted file mode 100644 index ebf81acb..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/esm-node/v1.js +++ /dev/null @@ -1,95 +0,0 @@ -import rng from './rng.js'; -import stringify from './stringify.js'; // **`v1()` - Generate time-based UUID** -// -// Inspired by https://github.com/LiosK/UUID.js -// and http://docs.python.org/library/uuid.html - -let _nodeId; - -let _clockseq; // Previous uuid creation time - - -let _lastMSecs = 0; -let _lastNSecs = 0; // See https://github.com/uuidjs/uuid for API details - -function v1(options, buf, offset) { - let i = buf && offset || 0; - const b = buf || new Array(16); - options = options || {}; - let node = options.node || _nodeId; - let clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq; // node and clockseq need to be initialized to random values if they're not - // specified. We do this lazily to minimize issues related to insufficient - // system entropy. See #189 - - if (node == null || clockseq == null) { - const seedBytes = options.random || (options.rng || rng)(); - - if (node == null) { - // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1) - node = _nodeId = [seedBytes[0] | 0x01, seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]]; - } - - if (clockseq == null) { - // Per 4.2.2, randomize (14 bit) clockseq - clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff; - } - } // UUID timestamps are 100 nano-second units since the Gregorian epoch, - // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so - // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs' - // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00. - - - let msecs = options.msecs !== undefined ? options.msecs : Date.now(); // Per 4.2.1.2, use count of uuid's generated during the current clock - // cycle to simulate higher resolution clock - - let nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1; // Time since last uuid creation (in msecs) - - const dt = msecs - _lastMSecs + (nsecs - _lastNSecs) / 10000; // Per 4.2.1.2, Bump clockseq on clock regression - - if (dt < 0 && options.clockseq === undefined) { - clockseq = clockseq + 1 & 0x3fff; - } // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new - // time interval - - - if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) { - nsecs = 0; - } // Per 4.2.1.2 Throw error if too many uuids are requested - - - if (nsecs >= 10000) { - throw new Error("uuid.v1(): Can't create more than 10M uuids/sec"); - } - - _lastMSecs = msecs; - _lastNSecs = nsecs; - _clockseq = clockseq; // Per 4.1.4 - Convert from unix epoch to Gregorian epoch - - msecs += 12219292800000; // `time_low` - - const tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000; - b[i++] = tl >>> 24 & 0xff; - b[i++] = tl >>> 16 & 0xff; - b[i++] = tl >>> 8 & 0xff; - b[i++] = tl & 0xff; // `time_mid` - - const tmh = msecs / 0x100000000 * 10000 & 0xfffffff; - b[i++] = tmh >>> 8 & 0xff; - b[i++] = tmh & 0xff; // `time_high_and_version` - - b[i++] = tmh >>> 24 & 0xf | 0x10; // include version - - b[i++] = tmh >>> 16 & 0xff; // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant) - - b[i++] = clockseq >>> 8 | 0x80; // `clock_seq_low` - - b[i++] = clockseq & 0xff; // `node` - - for (let n = 0; n < 6; ++n) { - b[i + n] = node[n]; - } - - return buf || stringify(b); -} - -export default v1; \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/esm-node/v3.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/esm-node/v3.js deleted file mode 100644 index 09063b86..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/esm-node/v3.js +++ /dev/null @@ -1,4 +0,0 @@ -import v35 from './v35.js'; -import md5 from './md5.js'; -const v3 = v35('v3', 0x30, md5); -export default v3; \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/esm-node/v35.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/esm-node/v35.js deleted file mode 100644 index 22f6a196..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/esm-node/v35.js +++ /dev/null @@ -1,64 +0,0 @@ -import stringify from './stringify.js'; -import parse from './parse.js'; - -function stringToBytes(str) { - str = unescape(encodeURIComponent(str)); // UTF8 escape - - const bytes = []; - - for (let i = 0; i < str.length; ++i) { - bytes.push(str.charCodeAt(i)); - } - - return bytes; -} - -export const DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8'; -export const URL = '6ba7b811-9dad-11d1-80b4-00c04fd430c8'; -export default function (name, version, hashfunc) { - function generateUUID(value, namespace, buf, offset) { - if (typeof value === 'string') { - value = stringToBytes(value); - } - - if (typeof namespace === 'string') { - namespace = parse(namespace); - } - - if (namespace.length !== 16) { - throw TypeError('Namespace must be array-like (16 iterable integer values, 0-255)'); - } // Compute hash of namespace and value, Per 4.3 - // Future: Use spread syntax when supported on all platforms, e.g. `bytes = - // hashfunc([...namespace, ... value])` - - - let bytes = new Uint8Array(16 + value.length); - bytes.set(namespace); - bytes.set(value, namespace.length); - bytes = hashfunc(bytes); - bytes[6] = bytes[6] & 0x0f | version; - bytes[8] = bytes[8] & 0x3f | 0x80; - - if (buf) { - offset = offset || 0; - - for (let i = 0; i < 16; ++i) { - buf[offset + i] = bytes[i]; - } - - return buf; - } - - return stringify(bytes); - } // Function#name is not settable on some platforms (#270) - - - try { - generateUUID.name = name; // eslint-disable-next-line no-empty - } catch (err) {} // For CommonJS default export support - - - generateUUID.DNS = DNS; - generateUUID.URL = URL; - return generateUUID; -} \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/esm-node/v4.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/esm-node/v4.js deleted file mode 100644 index efad926f..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/esm-node/v4.js +++ /dev/null @@ -1,24 +0,0 @@ -import rng from './rng.js'; -import stringify from './stringify.js'; - -function v4(options, buf, offset) { - options = options || {}; - const rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved` - - rnds[6] = rnds[6] & 0x0f | 0x40; - rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided - - if (buf) { - offset = offset || 0; - - for (let i = 0; i < 16; ++i) { - buf[offset + i] = rnds[i]; - } - - return buf; - } - - return stringify(rnds); -} - -export default v4; \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/esm-node/v5.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/esm-node/v5.js deleted file mode 100644 index e87fe317..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/esm-node/v5.js +++ /dev/null @@ -1,4 +0,0 @@ -import v35 from './v35.js'; -import sha1 from './sha1.js'; -const v5 = v35('v5', 0x50, sha1); -export default v5; \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/esm-node/validate.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/esm-node/validate.js deleted file mode 100644 index f1cdc7af..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/esm-node/validate.js +++ /dev/null @@ -1,7 +0,0 @@ -import REGEX from './regex.js'; - -function validate(uuid) { - return typeof uuid === 'string' && REGEX.test(uuid); -} - -export default validate; \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/esm-node/version.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/esm-node/version.js deleted file mode 100644 index 77530e9c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/esm-node/version.js +++ /dev/null @@ -1,11 +0,0 @@ -import validate from './validate.js'; - -function version(uuid) { - if (!validate(uuid)) { - throw TypeError('Invalid UUID'); - } - - return parseInt(uuid.substr(14, 1), 16); -} - -export default version; \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/index.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/index.js deleted file mode 100644 index bf13b103..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/index.js +++ /dev/null @@ -1,79 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -Object.defineProperty(exports, "v1", { - enumerable: true, - get: function () { - return _v.default; - } -}); -Object.defineProperty(exports, "v3", { - enumerable: true, - get: function () { - return _v2.default; - } -}); -Object.defineProperty(exports, "v4", { - enumerable: true, - get: function () { - return _v3.default; - } -}); -Object.defineProperty(exports, "v5", { - enumerable: true, - get: function () { - return _v4.default; - } -}); -Object.defineProperty(exports, "NIL", { - enumerable: true, - get: function () { - return _nil.default; - } -}); -Object.defineProperty(exports, "version", { - enumerable: true, - get: function () { - return _version.default; - } -}); -Object.defineProperty(exports, "validate", { - enumerable: true, - get: function () { - return _validate.default; - } -}); -Object.defineProperty(exports, "stringify", { - enumerable: true, - get: function () { - return _stringify.default; - } -}); -Object.defineProperty(exports, "parse", { - enumerable: true, - get: function () { - return _parse.default; - } -}); - -var _v = _interopRequireDefault(require("./v1.js")); - -var _v2 = _interopRequireDefault(require("./v3.js")); - -var _v3 = _interopRequireDefault(require("./v4.js")); - -var _v4 = _interopRequireDefault(require("./v5.js")); - -var _nil = _interopRequireDefault(require("./nil.js")); - -var _version = _interopRequireDefault(require("./version.js")); - -var _validate = _interopRequireDefault(require("./validate.js")); - -var _stringify = _interopRequireDefault(require("./stringify.js")); - -var _parse = _interopRequireDefault(require("./parse.js")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/md5-browser.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/md5-browser.js deleted file mode 100644 index 7a4582ac..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/md5-browser.js +++ /dev/null @@ -1,223 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; - -/* - * Browser-compatible JavaScript MD5 - * - * Modification of JavaScript MD5 - * https://github.com/blueimp/JavaScript-MD5 - * - * Copyright 2011, Sebastian Tschan - * https://blueimp.net - * - * Licensed under the MIT license: - * https://opensource.org/licenses/MIT - * - * Based on - * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message - * Digest Algorithm, as defined in RFC 1321. - * Version 2.2 Copyright (C) Paul Johnston 1999 - 2009 - * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet - * Distributed under the BSD License - * See http://pajhome.org.uk/crypt/md5 for more info. - */ -function md5(bytes) { - if (typeof bytes === 'string') { - const msg = unescape(encodeURIComponent(bytes)); // UTF8 escape - - bytes = new Uint8Array(msg.length); - - for (let i = 0; i < msg.length; ++i) { - bytes[i] = msg.charCodeAt(i); - } - } - - return md5ToHexEncodedArray(wordsToMd5(bytesToWords(bytes), bytes.length * 8)); -} -/* - * Convert an array of little-endian words to an array of bytes - */ - - -function md5ToHexEncodedArray(input) { - const output = []; - const length32 = input.length * 32; - const hexTab = '0123456789abcdef'; - - for (let i = 0; i < length32; i += 8) { - const x = input[i >> 5] >>> i % 32 & 0xff; - const hex = parseInt(hexTab.charAt(x >>> 4 & 0x0f) + hexTab.charAt(x & 0x0f), 16); - output.push(hex); - } - - return output; -} -/** - * Calculate output length with padding and bit length - */ - - -function getOutputLength(inputLength8) { - return (inputLength8 + 64 >>> 9 << 4) + 14 + 1; -} -/* - * Calculate the MD5 of an array of little-endian words, and a bit length. - */ - - -function wordsToMd5(x, len) { - /* append padding */ - x[len >> 5] |= 0x80 << len % 32; - x[getOutputLength(len) - 1] = len; - let a = 1732584193; - let b = -271733879; - let c = -1732584194; - let d = 271733878; - - for (let i = 0; i < x.length; i += 16) { - const olda = a; - const oldb = b; - const oldc = c; - const oldd = d; - a = md5ff(a, b, c, d, x[i], 7, -680876936); - d = md5ff(d, a, b, c, x[i + 1], 12, -389564586); - c = md5ff(c, d, a, b, x[i + 2], 17, 606105819); - b = md5ff(b, c, d, a, x[i + 3], 22, -1044525330); - a = md5ff(a, b, c, d, x[i + 4], 7, -176418897); - d = md5ff(d, a, b, c, x[i + 5], 12, 1200080426); - c = md5ff(c, d, a, b, x[i + 6], 17, -1473231341); - b = md5ff(b, c, d, a, x[i + 7], 22, -45705983); - a = md5ff(a, b, c, d, x[i + 8], 7, 1770035416); - d = md5ff(d, a, b, c, x[i + 9], 12, -1958414417); - c = md5ff(c, d, a, b, x[i + 10], 17, -42063); - b = md5ff(b, c, d, a, x[i + 11], 22, -1990404162); - a = md5ff(a, b, c, d, x[i + 12], 7, 1804603682); - d = md5ff(d, a, b, c, x[i + 13], 12, -40341101); - c = md5ff(c, d, a, b, x[i + 14], 17, -1502002290); - b = md5ff(b, c, d, a, x[i + 15], 22, 1236535329); - a = md5gg(a, b, c, d, x[i + 1], 5, -165796510); - d = md5gg(d, a, b, c, x[i + 6], 9, -1069501632); - c = md5gg(c, d, a, b, x[i + 11], 14, 643717713); - b = md5gg(b, c, d, a, x[i], 20, -373897302); - a = md5gg(a, b, c, d, x[i + 5], 5, -701558691); - d = md5gg(d, a, b, c, x[i + 10], 9, 38016083); - c = md5gg(c, d, a, b, x[i + 15], 14, -660478335); - b = md5gg(b, c, d, a, x[i + 4], 20, -405537848); - a = md5gg(a, b, c, d, x[i + 9], 5, 568446438); - d = md5gg(d, a, b, c, x[i + 14], 9, -1019803690); - c = md5gg(c, d, a, b, x[i + 3], 14, -187363961); - b = md5gg(b, c, d, a, x[i + 8], 20, 1163531501); - a = md5gg(a, b, c, d, x[i + 13], 5, -1444681467); - d = md5gg(d, a, b, c, x[i + 2], 9, -51403784); - c = md5gg(c, d, a, b, x[i + 7], 14, 1735328473); - b = md5gg(b, c, d, a, x[i + 12], 20, -1926607734); - a = md5hh(a, b, c, d, x[i + 5], 4, -378558); - d = md5hh(d, a, b, c, x[i + 8], 11, -2022574463); - c = md5hh(c, d, a, b, x[i + 11], 16, 1839030562); - b = md5hh(b, c, d, a, x[i + 14], 23, -35309556); - a = md5hh(a, b, c, d, x[i + 1], 4, -1530992060); - d = md5hh(d, a, b, c, x[i + 4], 11, 1272893353); - c = md5hh(c, d, a, b, x[i + 7], 16, -155497632); - b = md5hh(b, c, d, a, x[i + 10], 23, -1094730640); - a = md5hh(a, b, c, d, x[i + 13], 4, 681279174); - d = md5hh(d, a, b, c, x[i], 11, -358537222); - c = md5hh(c, d, a, b, x[i + 3], 16, -722521979); - b = md5hh(b, c, d, a, x[i + 6], 23, 76029189); - a = md5hh(a, b, c, d, x[i + 9], 4, -640364487); - d = md5hh(d, a, b, c, x[i + 12], 11, -421815835); - c = md5hh(c, d, a, b, x[i + 15], 16, 530742520); - b = md5hh(b, c, d, a, x[i + 2], 23, -995338651); - a = md5ii(a, b, c, d, x[i], 6, -198630844); - d = md5ii(d, a, b, c, x[i + 7], 10, 1126891415); - c = md5ii(c, d, a, b, x[i + 14], 15, -1416354905); - b = md5ii(b, c, d, a, x[i + 5], 21, -57434055); - a = md5ii(a, b, c, d, x[i + 12], 6, 1700485571); - d = md5ii(d, a, b, c, x[i + 3], 10, -1894986606); - c = md5ii(c, d, a, b, x[i + 10], 15, -1051523); - b = md5ii(b, c, d, a, x[i + 1], 21, -2054922799); - a = md5ii(a, b, c, d, x[i + 8], 6, 1873313359); - d = md5ii(d, a, b, c, x[i + 15], 10, -30611744); - c = md5ii(c, d, a, b, x[i + 6], 15, -1560198380); - b = md5ii(b, c, d, a, x[i + 13], 21, 1309151649); - a = md5ii(a, b, c, d, x[i + 4], 6, -145523070); - d = md5ii(d, a, b, c, x[i + 11], 10, -1120210379); - c = md5ii(c, d, a, b, x[i + 2], 15, 718787259); - b = md5ii(b, c, d, a, x[i + 9], 21, -343485551); - a = safeAdd(a, olda); - b = safeAdd(b, oldb); - c = safeAdd(c, oldc); - d = safeAdd(d, oldd); - } - - return [a, b, c, d]; -} -/* - * Convert an array bytes to an array of little-endian words - * Characters >255 have their high-byte silently ignored. - */ - - -function bytesToWords(input) { - if (input.length === 0) { - return []; - } - - const length8 = input.length * 8; - const output = new Uint32Array(getOutputLength(length8)); - - for (let i = 0; i < length8; i += 8) { - output[i >> 5] |= (input[i / 8] & 0xff) << i % 32; - } - - return output; -} -/* - * Add integers, wrapping at 2^32. This uses 16-bit operations internally - * to work around bugs in some JS interpreters. - */ - - -function safeAdd(x, y) { - const lsw = (x & 0xffff) + (y & 0xffff); - const msw = (x >> 16) + (y >> 16) + (lsw >> 16); - return msw << 16 | lsw & 0xffff; -} -/* - * Bitwise rotate a 32-bit number to the left. - */ - - -function bitRotateLeft(num, cnt) { - return num << cnt | num >>> 32 - cnt; -} -/* - * These functions implement the four basic operations the algorithm uses. - */ - - -function md5cmn(q, a, b, x, s, t) { - return safeAdd(bitRotateLeft(safeAdd(safeAdd(a, q), safeAdd(x, t)), s), b); -} - -function md5ff(a, b, c, d, x, s, t) { - return md5cmn(b & c | ~b & d, a, b, x, s, t); -} - -function md5gg(a, b, c, d, x, s, t) { - return md5cmn(b & d | c & ~d, a, b, x, s, t); -} - -function md5hh(a, b, c, d, x, s, t) { - return md5cmn(b ^ c ^ d, a, b, x, s, t); -} - -function md5ii(a, b, c, d, x, s, t) { - return md5cmn(c ^ (b | ~d), a, b, x, s, t); -} - -var _default = md5; -exports.default = _default; \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/md5.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/md5.js deleted file mode 100644 index 824d4816..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/md5.js +++ /dev/null @@ -1,23 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; - -var _crypto = _interopRequireDefault(require("crypto")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function md5(bytes) { - if (Array.isArray(bytes)) { - bytes = Buffer.from(bytes); - } else if (typeof bytes === 'string') { - bytes = Buffer.from(bytes, 'utf8'); - } - - return _crypto.default.createHash('md5').update(bytes).digest(); -} - -var _default = md5; -exports.default = _default; \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/nil.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/nil.js deleted file mode 100644 index 7ade577b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/nil.js +++ /dev/null @@ -1,8 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; -var _default = '00000000-0000-0000-0000-000000000000'; -exports.default = _default; \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/parse.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/parse.js deleted file mode 100644 index 4c69fc39..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/parse.js +++ /dev/null @@ -1,45 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; - -var _validate = _interopRequireDefault(require("./validate.js")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function parse(uuid) { - if (!(0, _validate.default)(uuid)) { - throw TypeError('Invalid UUID'); - } - - let v; - const arr = new Uint8Array(16); // Parse ########-....-....-....-............ - - arr[0] = (v = parseInt(uuid.slice(0, 8), 16)) >>> 24; - arr[1] = v >>> 16 & 0xff; - arr[2] = v >>> 8 & 0xff; - arr[3] = v & 0xff; // Parse ........-####-....-....-............ - - arr[4] = (v = parseInt(uuid.slice(9, 13), 16)) >>> 8; - arr[5] = v & 0xff; // Parse ........-....-####-....-............ - - arr[6] = (v = parseInt(uuid.slice(14, 18), 16)) >>> 8; - arr[7] = v & 0xff; // Parse ........-....-....-####-............ - - arr[8] = (v = parseInt(uuid.slice(19, 23), 16)) >>> 8; - arr[9] = v & 0xff; // Parse ........-....-....-....-############ - // (Use "/" to avoid 32-bit truncation when bit-shifting high-order bytes) - - arr[10] = (v = parseInt(uuid.slice(24, 36), 16)) / 0x10000000000 & 0xff; - arr[11] = v / 0x100000000 & 0xff; - arr[12] = v >>> 24 & 0xff; - arr[13] = v >>> 16 & 0xff; - arr[14] = v >>> 8 & 0xff; - arr[15] = v & 0xff; - return arr; -} - -var _default = parse; -exports.default = _default; \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/regex.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/regex.js deleted file mode 100644 index 1ef91d64..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/regex.js +++ /dev/null @@ -1,8 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; -var _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; -exports.default = _default; \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/rng-browser.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/rng-browser.js deleted file mode 100644 index 91faeae6..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/rng-browser.js +++ /dev/null @@ -1,26 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = rng; -// Unique ID creation requires a high quality random # generator. In the browser we therefore -// require the crypto API and do not support built-in fallback to lower quality random number -// generators (like Math.random()). -let getRandomValues; -const rnds8 = new Uint8Array(16); - -function rng() { - // lazy load so that environments that need to polyfill have a chance to do so - if (!getRandomValues) { - // getRandomValues needs to be invoked in a context where "this" is a Crypto implementation. Also, - // find the complete implementation of crypto (msCrypto) on IE11. - getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto) || typeof msCrypto !== 'undefined' && typeof msCrypto.getRandomValues === 'function' && msCrypto.getRandomValues.bind(msCrypto); - - if (!getRandomValues) { - throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported'); - } - } - - return getRandomValues(rnds8); -} \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/rng.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/rng.js deleted file mode 100644 index 3507f937..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/rng.js +++ /dev/null @@ -1,24 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = rng; - -var _crypto = _interopRequireDefault(require("crypto")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -const rnds8Pool = new Uint8Array(256); // # of random values to pre-allocate - -let poolPtr = rnds8Pool.length; - -function rng() { - if (poolPtr > rnds8Pool.length - 16) { - _crypto.default.randomFillSync(rnds8Pool); - - poolPtr = 0; - } - - return rnds8Pool.slice(poolPtr, poolPtr += 16); -} \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/sha1-browser.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/sha1-browser.js deleted file mode 100644 index 24cbcedc..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/sha1-browser.js +++ /dev/null @@ -1,104 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; - -// Adapted from Chris Veness' SHA1 code at -// http://www.movable-type.co.uk/scripts/sha1.html -function f(s, x, y, z) { - switch (s) { - case 0: - return x & y ^ ~x & z; - - case 1: - return x ^ y ^ z; - - case 2: - return x & y ^ x & z ^ y & z; - - case 3: - return x ^ y ^ z; - } -} - -function ROTL(x, n) { - return x << n | x >>> 32 - n; -} - -function sha1(bytes) { - const K = [0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xca62c1d6]; - const H = [0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0]; - - if (typeof bytes === 'string') { - const msg = unescape(encodeURIComponent(bytes)); // UTF8 escape - - bytes = []; - - for (let i = 0; i < msg.length; ++i) { - bytes.push(msg.charCodeAt(i)); - } - } else if (!Array.isArray(bytes)) { - // Convert Array-like to Array - bytes = Array.prototype.slice.call(bytes); - } - - bytes.push(0x80); - const l = bytes.length / 4 + 2; - const N = Math.ceil(l / 16); - const M = new Array(N); - - for (let i = 0; i < N; ++i) { - const arr = new Uint32Array(16); - - for (let j = 0; j < 16; ++j) { - arr[j] = bytes[i * 64 + j * 4] << 24 | bytes[i * 64 + j * 4 + 1] << 16 | bytes[i * 64 + j * 4 + 2] << 8 | bytes[i * 64 + j * 4 + 3]; - } - - M[i] = arr; - } - - M[N - 1][14] = (bytes.length - 1) * 8 / Math.pow(2, 32); - M[N - 1][14] = Math.floor(M[N - 1][14]); - M[N - 1][15] = (bytes.length - 1) * 8 & 0xffffffff; - - for (let i = 0; i < N; ++i) { - const W = new Uint32Array(80); - - for (let t = 0; t < 16; ++t) { - W[t] = M[i][t]; - } - - for (let t = 16; t < 80; ++t) { - W[t] = ROTL(W[t - 3] ^ W[t - 8] ^ W[t - 14] ^ W[t - 16], 1); - } - - let a = H[0]; - let b = H[1]; - let c = H[2]; - let d = H[3]; - let e = H[4]; - - for (let t = 0; t < 80; ++t) { - const s = Math.floor(t / 20); - const T = ROTL(a, 5) + f(s, b, c, d) + e + K[s] + W[t] >>> 0; - e = d; - d = c; - c = ROTL(b, 30) >>> 0; - b = a; - a = T; - } - - H[0] = H[0] + a >>> 0; - H[1] = H[1] + b >>> 0; - H[2] = H[2] + c >>> 0; - H[3] = H[3] + d >>> 0; - H[4] = H[4] + e >>> 0; - } - - return [H[0] >> 24 & 0xff, H[0] >> 16 & 0xff, H[0] >> 8 & 0xff, H[0] & 0xff, H[1] >> 24 & 0xff, H[1] >> 16 & 0xff, H[1] >> 8 & 0xff, H[1] & 0xff, H[2] >> 24 & 0xff, H[2] >> 16 & 0xff, H[2] >> 8 & 0xff, H[2] & 0xff, H[3] >> 24 & 0xff, H[3] >> 16 & 0xff, H[3] >> 8 & 0xff, H[3] & 0xff, H[4] >> 24 & 0xff, H[4] >> 16 & 0xff, H[4] >> 8 & 0xff, H[4] & 0xff]; -} - -var _default = sha1; -exports.default = _default; \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/sha1.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/sha1.js deleted file mode 100644 index 03bdd63c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/sha1.js +++ /dev/null @@ -1,23 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; - -var _crypto = _interopRequireDefault(require("crypto")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function sha1(bytes) { - if (Array.isArray(bytes)) { - bytes = Buffer.from(bytes); - } else if (typeof bytes === 'string') { - bytes = Buffer.from(bytes, 'utf8'); - } - - return _crypto.default.createHash('sha1').update(bytes).digest(); -} - -var _default = sha1; -exports.default = _default; \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/stringify.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/stringify.js deleted file mode 100644 index b8e75194..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/stringify.js +++ /dev/null @@ -1,39 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; - -var _validate = _interopRequireDefault(require("./validate.js")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * Convert array of 16 byte values to UUID string format of the form: - * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX - */ -const byteToHex = []; - -for (let i = 0; i < 256; ++i) { - byteToHex.push((i + 0x100).toString(16).substr(1)); -} - -function stringify(arr, offset = 0) { - // Note: Be careful editing this code! It's been tuned for performance - // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434 - const uuid = (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase(); // Consistency check for valid UUID. If this throws, it's likely due to one - // of the following: - // - One or more input array values don't map to a hex octet (leading to - // "undefined" in the uuid) - // - Invalid input values for the RFC `version` or `variant` fields - - if (!(0, _validate.default)(uuid)) { - throw TypeError('Stringified UUID is invalid'); - } - - return uuid; -} - -var _default = stringify; -exports.default = _default; \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/umd/uuid.min.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/umd/uuid.min.js deleted file mode 100644 index 639ca2f2..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/umd/uuid.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(r,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((r="undefined"!=typeof globalThis?globalThis:r||self).uuid={})}(this,(function(r){"use strict";var e,n=new Uint8Array(16);function t(){if(!e&&!(e="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return e(n)}var o=/^(?:[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;function a(r){return"string"==typeof r&&o.test(r)}for(var i,u,f=[],s=0;s<256;++s)f.push((s+256).toString(16).substr(1));function c(r){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=(f[r[e+0]]+f[r[e+1]]+f[r[e+2]]+f[r[e+3]]+"-"+f[r[e+4]]+f[r[e+5]]+"-"+f[r[e+6]]+f[r[e+7]]+"-"+f[r[e+8]]+f[r[e+9]]+"-"+f[r[e+10]]+f[r[e+11]]+f[r[e+12]]+f[r[e+13]]+f[r[e+14]]+f[r[e+15]]).toLowerCase();if(!a(n))throw TypeError("Stringified UUID is invalid");return n}var l=0,d=0;function v(r){if(!a(r))throw TypeError("Invalid UUID");var e,n=new Uint8Array(16);return n[0]=(e=parseInt(r.slice(0,8),16))>>>24,n[1]=e>>>16&255,n[2]=e>>>8&255,n[3]=255&e,n[4]=(e=parseInt(r.slice(9,13),16))>>>8,n[5]=255&e,n[6]=(e=parseInt(r.slice(14,18),16))>>>8,n[7]=255&e,n[8]=(e=parseInt(r.slice(19,23),16))>>>8,n[9]=255&e,n[10]=(e=parseInt(r.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}function p(r,e,n){function t(r,t,o,a){if("string"==typeof r&&(r=function(r){r=unescape(encodeURIComponent(r));for(var e=[],n=0;n>>9<<4)+1}function y(r,e){var n=(65535&r)+(65535&e);return(r>>16)+(e>>16)+(n>>16)<<16|65535&n}function g(r,e,n,t,o,a){return y((i=y(y(e,r),y(t,a)))<<(u=o)|i>>>32-u,n);var i,u}function m(r,e,n,t,o,a,i){return g(e&n|~e&t,r,e,o,a,i)}function w(r,e,n,t,o,a,i){return g(e&t|n&~t,r,e,o,a,i)}function b(r,e,n,t,o,a,i){return g(e^n^t,r,e,o,a,i)}function A(r,e,n,t,o,a,i){return g(n^(e|~t),r,e,o,a,i)}var U=p("v3",48,(function(r){if("string"==typeof r){var e=unescape(encodeURIComponent(r));r=new Uint8Array(e.length);for(var n=0;n>5]>>>o%32&255,i=parseInt(t.charAt(a>>>4&15)+t.charAt(15&a),16);e.push(i)}return e}(function(r,e){r[e>>5]|=128<>5]|=(255&r[t/8])<>>32-e}var R=p("v5",80,(function(r){var e=[1518500249,1859775393,2400959708,3395469782],n=[1732584193,4023233417,2562383102,271733878,3285377520];if("string"==typeof r){var t=unescape(encodeURIComponent(r));r=[];for(var o=0;o>>0;w=m,m=g,g=C(y,30)>>>0,y=h,h=U}n[0]=n[0]+h>>>0,n[1]=n[1]+y>>>0,n[2]=n[2]+g>>>0,n[3]=n[3]+m>>>0,n[4]=n[4]+w>>>0}return[n[0]>>24&255,n[0]>>16&255,n[0]>>8&255,255&n[0],n[1]>>24&255,n[1]>>16&255,n[1]>>8&255,255&n[1],n[2]>>24&255,n[2]>>16&255,n[2]>>8&255,255&n[2],n[3]>>24&255,n[3]>>16&255,n[3]>>8&255,255&n[3],n[4]>>24&255,n[4]>>16&255,n[4]>>8&255,255&n[4]]}));r.NIL="00000000-0000-0000-0000-000000000000",r.parse=v,r.stringify=c,r.v1=function(r,e,n){var o=e&&n||0,a=e||new Array(16),f=(r=r||{}).node||i,s=void 0!==r.clockseq?r.clockseq:u;if(null==f||null==s){var v=r.random||(r.rng||t)();null==f&&(f=i=[1|v[0],v[1],v[2],v[3],v[4],v[5]]),null==s&&(s=u=16383&(v[6]<<8|v[7]))}var p=void 0!==r.msecs?r.msecs:Date.now(),h=void 0!==r.nsecs?r.nsecs:d+1,y=p-l+(h-d)/1e4;if(y<0&&void 0===r.clockseq&&(s=s+1&16383),(y<0||p>l)&&void 0===r.nsecs&&(h=0),h>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");l=p,d=h,u=s;var g=(1e4*(268435455&(p+=122192928e5))+h)%4294967296;a[o++]=g>>>24&255,a[o++]=g>>>16&255,a[o++]=g>>>8&255,a[o++]=255&g;var m=p/4294967296*1e4&268435455;a[o++]=m>>>8&255,a[o++]=255&m,a[o++]=m>>>24&15|16,a[o++]=m>>>16&255,a[o++]=s>>>8|128,a[o++]=255&s;for(var w=0;w<6;++w)a[o+w]=f[w];return e||c(a)},r.v3=U,r.v4=function(r,e,n){var o=(r=r||{}).random||(r.rng||t)();if(o[6]=15&o[6]|64,o[8]=63&o[8]|128,e){n=n||0;for(var a=0;a<16;++a)e[n+a]=o[a];return e}return c(o)},r.v5=R,r.validate=a,r.version=function(r){if(!a(r))throw TypeError("Invalid UUID");return parseInt(r.substr(14,1),16)},Object.defineProperty(r,"__esModule",{value:!0})})); \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/umd/uuidNIL.min.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/umd/uuidNIL.min.js deleted file mode 100644 index 30b28a7e..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/umd/uuidNIL.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):(e="undefined"!=typeof globalThis?globalThis:e||self).uuidNIL=n()}(this,(function(){"use strict";return"00000000-0000-0000-0000-000000000000"})); \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/umd/uuidParse.min.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/umd/uuidParse.min.js deleted file mode 100644 index d48ea6af..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/umd/uuidParse.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):(e="undefined"!=typeof globalThis?globalThis:e||self).uuidParse=n()}(this,(function(){"use strict";var e=/^(?:[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;return function(n){if(!function(n){return"string"==typeof n&&e.test(n)}(n))throw TypeError("Invalid UUID");var t,i=new Uint8Array(16);return i[0]=(t=parseInt(n.slice(0,8),16))>>>24,i[1]=t>>>16&255,i[2]=t>>>8&255,i[3]=255&t,i[4]=(t=parseInt(n.slice(9,13),16))>>>8,i[5]=255&t,i[6]=(t=parseInt(n.slice(14,18),16))>>>8,i[7]=255&t,i[8]=(t=parseInt(n.slice(19,23),16))>>>8,i[9]=255&t,i[10]=(t=parseInt(n.slice(24,36),16))/1099511627776&255,i[11]=t/4294967296&255,i[12]=t>>>24&255,i[13]=t>>>16&255,i[14]=t>>>8&255,i[15]=255&t,i}})); \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/umd/uuidStringify.min.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/umd/uuidStringify.min.js deleted file mode 100644 index fd39adc3..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/umd/uuidStringify.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).uuidStringify=t()}(this,(function(){"use strict";var e=/^(?:[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;function t(t){return"string"==typeof t&&e.test(t)}for(var i=[],n=0;n<256;++n)i.push((n+256).toString(16).substr(1));return function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,f=(i[e[n+0]]+i[e[n+1]]+i[e[n+2]]+i[e[n+3]]+"-"+i[e[n+4]]+i[e[n+5]]+"-"+i[e[n+6]]+i[e[n+7]]+"-"+i[e[n+8]]+i[e[n+9]]+"-"+i[e[n+10]]+i[e[n+11]]+i[e[n+12]]+i[e[n+13]]+i[e[n+14]]+i[e[n+15]]).toLowerCase();if(!t(f))throw TypeError("Stringified UUID is invalid");return f}})); \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/umd/uuidValidate.min.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/umd/uuidValidate.min.js deleted file mode 100644 index 378e5b90..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/umd/uuidValidate.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).uuidValidate=t()}(this,(function(){"use strict";var e=/^(?:[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;return function(t){return"string"==typeof t&&e.test(t)}})); \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/umd/uuidVersion.min.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/umd/uuidVersion.min.js deleted file mode 100644 index 274bb090..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/umd/uuidVersion.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).uuidVersion=t()}(this,(function(){"use strict";var e=/^(?:[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;return function(t){if(!function(t){return"string"==typeof t&&e.test(t)}(t))throw TypeError("Invalid UUID");return parseInt(t.substr(14,1),16)}})); \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/umd/uuidv1.min.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/umd/uuidv1.min.js deleted file mode 100644 index 2622889a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/umd/uuidv1.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(e,o){"object"==typeof exports&&"undefined"!=typeof module?module.exports=o():"function"==typeof define&&define.amd?define(o):(e="undefined"!=typeof globalThis?globalThis:e||self).uuidv1=o()}(this,(function(){"use strict";var e,o=new Uint8Array(16);function t(){if(!e&&!(e="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return e(o)}var n=/^(?:[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;function r(e){return"string"==typeof e&&n.test(e)}for(var i,u,s=[],a=0;a<256;++a)s.push((a+256).toString(16).substr(1));var d=0,f=0;return function(e,o,n){var a=o&&n||0,c=o||new Array(16),l=(e=e||{}).node||i,p=void 0!==e.clockseq?e.clockseq:u;if(null==l||null==p){var v=e.random||(e.rng||t)();null==l&&(l=i=[1|v[0],v[1],v[2],v[3],v[4],v[5]]),null==p&&(p=u=16383&(v[6]<<8|v[7]))}var y=void 0!==e.msecs?e.msecs:Date.now(),m=void 0!==e.nsecs?e.nsecs:f+1,g=y-d+(m-f)/1e4;if(g<0&&void 0===e.clockseq&&(p=p+1&16383),(g<0||y>d)&&void 0===e.nsecs&&(m=0),m>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");d=y,f=m,u=p;var h=(1e4*(268435455&(y+=122192928e5))+m)%4294967296;c[a++]=h>>>24&255,c[a++]=h>>>16&255,c[a++]=h>>>8&255,c[a++]=255&h;var w=y/4294967296*1e4&268435455;c[a++]=w>>>8&255,c[a++]=255&w,c[a++]=w>>>24&15|16,c[a++]=w>>>16&255,c[a++]=p>>>8|128,c[a++]=255&p;for(var b=0;b<6;++b)c[a+b]=l[b];return o||function(e){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,t=(s[e[o+0]]+s[e[o+1]]+s[e[o+2]]+s[e[o+3]]+"-"+s[e[o+4]]+s[e[o+5]]+"-"+s[e[o+6]]+s[e[o+7]]+"-"+s[e[o+8]]+s[e[o+9]]+"-"+s[e[o+10]]+s[e[o+11]]+s[e[o+12]]+s[e[o+13]]+s[e[o+14]]+s[e[o+15]]).toLowerCase();if(!r(t))throw TypeError("Stringified UUID is invalid");return t}(c)}})); \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/umd/uuidv3.min.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/umd/uuidv3.min.js deleted file mode 100644 index 8d37b62d..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/umd/uuidv3.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(n,r){"object"==typeof exports&&"undefined"!=typeof module?module.exports=r():"function"==typeof define&&define.amd?define(r):(n="undefined"!=typeof globalThis?globalThis:n||self).uuidv3=r()}(this,(function(){"use strict";var n=/^(?:[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;function r(r){return"string"==typeof r&&n.test(r)}for(var e=[],t=0;t<256;++t)e.push((t+256).toString(16).substr(1));function i(n){return 14+(n+64>>>9<<4)+1}function o(n,r){var e=(65535&n)+(65535&r);return(n>>16)+(r>>16)+(e>>16)<<16|65535&e}function a(n,r,e,t,i,a){return o((f=o(o(r,n),o(t,a)))<<(u=i)|f>>>32-u,e);var f,u}function f(n,r,e,t,i,o,f){return a(r&e|~r&t,n,r,i,o,f)}function u(n,r,e,t,i,o,f){return a(r&t|e&~t,n,r,i,o,f)}function c(n,r,e,t,i,o,f){return a(r^e^t,n,r,i,o,f)}function s(n,r,e,t,i,o,f){return a(e^(r|~t),n,r,i,o,f)}return function(n,t,i){function o(n,o,a,f){if("string"==typeof n&&(n=function(n){n=unescape(encodeURIComponent(n));for(var r=[],e=0;e>>24,t[1]=e>>>16&255,t[2]=e>>>8&255,t[3]=255&e,t[4]=(e=parseInt(n.slice(9,13),16))>>>8,t[5]=255&e,t[6]=(e=parseInt(n.slice(14,18),16))>>>8,t[7]=255&e,t[8]=(e=parseInt(n.slice(19,23),16))>>>8,t[9]=255&e,t[10]=(e=parseInt(n.slice(24,36),16))/1099511627776&255,t[11]=e/4294967296&255,t[12]=e>>>24&255,t[13]=e>>>16&255,t[14]=e>>>8&255,t[15]=255&e,t}(o)),16!==o.length)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");var u=new Uint8Array(16+n.length);if(u.set(o),u.set(n,o.length),(u=i(u))[6]=15&u[6]|t,u[8]=63&u[8]|128,a){f=f||0;for(var c=0;c<16;++c)a[f+c]=u[c];return a}return function(n){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=(e[n[t+0]]+e[n[t+1]]+e[n[t+2]]+e[n[t+3]]+"-"+e[n[t+4]]+e[n[t+5]]+"-"+e[n[t+6]]+e[n[t+7]]+"-"+e[n[t+8]]+e[n[t+9]]+"-"+e[n[t+10]]+e[n[t+11]]+e[n[t+12]]+e[n[t+13]]+e[n[t+14]]+e[n[t+15]]).toLowerCase();if(!r(i))throw TypeError("Stringified UUID is invalid");return i}(u)}try{o.name=n}catch(n){}return o.DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8",o.URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8",o}("v3",48,(function(n){if("string"==typeof n){var r=unescape(encodeURIComponent(n));n=new Uint8Array(r.length);for(var e=0;e>5]>>>i%32&255,a=parseInt(t.charAt(o>>>4&15)+t.charAt(15&o),16);r.push(a)}return r}(function(n,r){n[r>>5]|=128<>5]|=(255&n[t/8])<1&&void 0!==arguments[1]?arguments[1]:0,o=(i[t[e+0]]+i[t[e+1]]+i[t[e+2]]+i[t[e+3]]+"-"+i[t[e+4]]+i[t[e+5]]+"-"+i[t[e+6]]+i[t[e+7]]+"-"+i[t[e+8]]+i[t[e+9]]+"-"+i[t[e+10]]+i[t[e+11]]+i[t[e+12]]+i[t[e+13]]+i[t[e+14]]+i[t[e+15]]).toLowerCase();if(!r(o))throw TypeError("Stringified UUID is invalid");return o}(u)}})); \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/umd/uuidv5.min.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/umd/uuidv5.min.js deleted file mode 100644 index ba6fc63d..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/umd/uuidv5.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(r,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(r="undefined"!=typeof globalThis?globalThis:r||self).uuidv5=e()}(this,(function(){"use strict";var r=/^(?:[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;function e(e){return"string"==typeof e&&r.test(e)}for(var t=[],n=0;n<256;++n)t.push((n+256).toString(16).substr(1));function a(r,e,t,n){switch(r){case 0:return e&t^~e&n;case 1:return e^t^n;case 2:return e&t^e&n^t&n;case 3:return e^t^n}}function o(r,e){return r<>>32-e}return function(r,n,a){function o(r,o,i,f){if("string"==typeof r&&(r=function(r){r=unescape(encodeURIComponent(r));for(var e=[],t=0;t>>24,n[1]=t>>>16&255,n[2]=t>>>8&255,n[3]=255&t,n[4]=(t=parseInt(r.slice(9,13),16))>>>8,n[5]=255&t,n[6]=(t=parseInt(r.slice(14,18),16))>>>8,n[7]=255&t,n[8]=(t=parseInt(r.slice(19,23),16))>>>8,n[9]=255&t,n[10]=(t=parseInt(r.slice(24,36),16))/1099511627776&255,n[11]=t/4294967296&255,n[12]=t>>>24&255,n[13]=t>>>16&255,n[14]=t>>>8&255,n[15]=255&t,n}(o)),16!==o.length)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");var s=new Uint8Array(16+r.length);if(s.set(o),s.set(r,o.length),(s=a(s))[6]=15&s[6]|n,s[8]=63&s[8]|128,i){f=f||0;for(var u=0;u<16;++u)i[f+u]=s[u];return i}return function(r){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,a=(t[r[n+0]]+t[r[n+1]]+t[r[n+2]]+t[r[n+3]]+"-"+t[r[n+4]]+t[r[n+5]]+"-"+t[r[n+6]]+t[r[n+7]]+"-"+t[r[n+8]]+t[r[n+9]]+"-"+t[r[n+10]]+t[r[n+11]]+t[r[n+12]]+t[r[n+13]]+t[r[n+14]]+t[r[n+15]]).toLowerCase();if(!e(a))throw TypeError("Stringified UUID is invalid");return a}(s)}try{o.name=r}catch(r){}return o.DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8",o.URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8",o}("v5",80,(function(r){var e=[1518500249,1859775393,2400959708,3395469782],t=[1732584193,4023233417,2562383102,271733878,3285377520];if("string"==typeof r){var n=unescape(encodeURIComponent(r));r=[];for(var i=0;i>>0;A=U,U=w,w=o(b,30)>>>0,b=g,g=C}t[0]=t[0]+g>>>0,t[1]=t[1]+b>>>0,t[2]=t[2]+w>>>0,t[3]=t[3]+U>>>0,t[4]=t[4]+A>>>0}return[t[0]>>24&255,t[0]>>16&255,t[0]>>8&255,255&t[0],t[1]>>24&255,t[1]>>16&255,t[1]>>8&255,255&t[1],t[2]>>24&255,t[2]>>16&255,t[2]>>8&255,255&t[2],t[3]>>24&255,t[3]>>16&255,t[3]>>8&255,255&t[3],t[4]>>24&255,t[4]>>16&255,t[4]>>8&255,255&t[4]]}))})); \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/uuid-bin.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/uuid-bin.js deleted file mode 100644 index 50a7a9f1..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/uuid-bin.js +++ /dev/null @@ -1,85 +0,0 @@ -"use strict"; - -var _assert = _interopRequireDefault(require("assert")); - -var _v = _interopRequireDefault(require("./v1.js")); - -var _v2 = _interopRequireDefault(require("./v3.js")); - -var _v3 = _interopRequireDefault(require("./v4.js")); - -var _v4 = _interopRequireDefault(require("./v5.js")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function usage() { - console.log('Usage:'); - console.log(' uuid'); - console.log(' uuid v1'); - console.log(' uuid v3 '); - console.log(' uuid v4'); - console.log(' uuid v5 '); - console.log(' uuid --help'); - console.log('\nNote: may be "URL" or "DNS" to use the corresponding UUIDs defined by RFC4122'); -} - -const args = process.argv.slice(2); - -if (args.indexOf('--help') >= 0) { - usage(); - process.exit(0); -} - -const version = args.shift() || 'v4'; - -switch (version) { - case 'v1': - console.log((0, _v.default)()); - break; - - case 'v3': - { - const name = args.shift(); - let namespace = args.shift(); - (0, _assert.default)(name != null, 'v3 name not specified'); - (0, _assert.default)(namespace != null, 'v3 namespace not specified'); - - if (namespace === 'URL') { - namespace = _v2.default.URL; - } - - if (namespace === 'DNS') { - namespace = _v2.default.DNS; - } - - console.log((0, _v2.default)(name, namespace)); - break; - } - - case 'v4': - console.log((0, _v3.default)()); - break; - - case 'v5': - { - const name = args.shift(); - let namespace = args.shift(); - (0, _assert.default)(name != null, 'v5 name not specified'); - (0, _assert.default)(namespace != null, 'v5 namespace not specified'); - - if (namespace === 'URL') { - namespace = _v4.default.URL; - } - - if (namespace === 'DNS') { - namespace = _v4.default.DNS; - } - - console.log((0, _v4.default)(name, namespace)); - break; - } - - default: - usage(); - process.exit(1); -} \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/v1.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/v1.js deleted file mode 100644 index abb9b3d1..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/v1.js +++ /dev/null @@ -1,107 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; - -var _rng = _interopRequireDefault(require("./rng.js")); - -var _stringify = _interopRequireDefault(require("./stringify.js")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -// **`v1()` - Generate time-based UUID** -// -// Inspired by https://github.com/LiosK/UUID.js -// and http://docs.python.org/library/uuid.html -let _nodeId; - -let _clockseq; // Previous uuid creation time - - -let _lastMSecs = 0; -let _lastNSecs = 0; // See https://github.com/uuidjs/uuid for API details - -function v1(options, buf, offset) { - let i = buf && offset || 0; - const b = buf || new Array(16); - options = options || {}; - let node = options.node || _nodeId; - let clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq; // node and clockseq need to be initialized to random values if they're not - // specified. We do this lazily to minimize issues related to insufficient - // system entropy. See #189 - - if (node == null || clockseq == null) { - const seedBytes = options.random || (options.rng || _rng.default)(); - - if (node == null) { - // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1) - node = _nodeId = [seedBytes[0] | 0x01, seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]]; - } - - if (clockseq == null) { - // Per 4.2.2, randomize (14 bit) clockseq - clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff; - } - } // UUID timestamps are 100 nano-second units since the Gregorian epoch, - // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so - // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs' - // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00. - - - let msecs = options.msecs !== undefined ? options.msecs : Date.now(); // Per 4.2.1.2, use count of uuid's generated during the current clock - // cycle to simulate higher resolution clock - - let nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1; // Time since last uuid creation (in msecs) - - const dt = msecs - _lastMSecs + (nsecs - _lastNSecs) / 10000; // Per 4.2.1.2, Bump clockseq on clock regression - - if (dt < 0 && options.clockseq === undefined) { - clockseq = clockseq + 1 & 0x3fff; - } // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new - // time interval - - - if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) { - nsecs = 0; - } // Per 4.2.1.2 Throw error if too many uuids are requested - - - if (nsecs >= 10000) { - throw new Error("uuid.v1(): Can't create more than 10M uuids/sec"); - } - - _lastMSecs = msecs; - _lastNSecs = nsecs; - _clockseq = clockseq; // Per 4.1.4 - Convert from unix epoch to Gregorian epoch - - msecs += 12219292800000; // `time_low` - - const tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000; - b[i++] = tl >>> 24 & 0xff; - b[i++] = tl >>> 16 & 0xff; - b[i++] = tl >>> 8 & 0xff; - b[i++] = tl & 0xff; // `time_mid` - - const tmh = msecs / 0x100000000 * 10000 & 0xfffffff; - b[i++] = tmh >>> 8 & 0xff; - b[i++] = tmh & 0xff; // `time_high_and_version` - - b[i++] = tmh >>> 24 & 0xf | 0x10; // include version - - b[i++] = tmh >>> 16 & 0xff; // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant) - - b[i++] = clockseq >>> 8 | 0x80; // `clock_seq_low` - - b[i++] = clockseq & 0xff; // `node` - - for (let n = 0; n < 6; ++n) { - b[i + n] = node[n]; - } - - return buf || (0, _stringify.default)(b); -} - -var _default = v1; -exports.default = _default; \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/v3.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/v3.js deleted file mode 100644 index 6b47ff51..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/v3.js +++ /dev/null @@ -1,16 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; - -var _v = _interopRequireDefault(require("./v35.js")); - -var _md = _interopRequireDefault(require("./md5.js")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -const v3 = (0, _v.default)('v3', 0x30, _md.default); -var _default = v3; -exports.default = _default; \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/v35.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/v35.js deleted file mode 100644 index f784c633..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/v35.js +++ /dev/null @@ -1,78 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = _default; -exports.URL = exports.DNS = void 0; - -var _stringify = _interopRequireDefault(require("./stringify.js")); - -var _parse = _interopRequireDefault(require("./parse.js")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function stringToBytes(str) { - str = unescape(encodeURIComponent(str)); // UTF8 escape - - const bytes = []; - - for (let i = 0; i < str.length; ++i) { - bytes.push(str.charCodeAt(i)); - } - - return bytes; -} - -const DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8'; -exports.DNS = DNS; -const URL = '6ba7b811-9dad-11d1-80b4-00c04fd430c8'; -exports.URL = URL; - -function _default(name, version, hashfunc) { - function generateUUID(value, namespace, buf, offset) { - if (typeof value === 'string') { - value = stringToBytes(value); - } - - if (typeof namespace === 'string') { - namespace = (0, _parse.default)(namespace); - } - - if (namespace.length !== 16) { - throw TypeError('Namespace must be array-like (16 iterable integer values, 0-255)'); - } // Compute hash of namespace and value, Per 4.3 - // Future: Use spread syntax when supported on all platforms, e.g. `bytes = - // hashfunc([...namespace, ... value])` - - - let bytes = new Uint8Array(16 + value.length); - bytes.set(namespace); - bytes.set(value, namespace.length); - bytes = hashfunc(bytes); - bytes[6] = bytes[6] & 0x0f | version; - bytes[8] = bytes[8] & 0x3f | 0x80; - - if (buf) { - offset = offset || 0; - - for (let i = 0; i < 16; ++i) { - buf[offset + i] = bytes[i]; - } - - return buf; - } - - return (0, _stringify.default)(bytes); - } // Function#name is not settable on some platforms (#270) - - - try { - generateUUID.name = name; // eslint-disable-next-line no-empty - } catch (err) {} // For CommonJS default export support - - - generateUUID.DNS = DNS; - generateUUID.URL = URL; - return generateUUID; -} \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/v4.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/v4.js deleted file mode 100644 index 838ce0b2..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/v4.js +++ /dev/null @@ -1,37 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; - -var _rng = _interopRequireDefault(require("./rng.js")); - -var _stringify = _interopRequireDefault(require("./stringify.js")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function v4(options, buf, offset) { - options = options || {}; - - const rnds = options.random || (options.rng || _rng.default)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved` - - - rnds[6] = rnds[6] & 0x0f | 0x40; - rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided - - if (buf) { - offset = offset || 0; - - for (let i = 0; i < 16; ++i) { - buf[offset + i] = rnds[i]; - } - - return buf; - } - - return (0, _stringify.default)(rnds); -} - -var _default = v4; -exports.default = _default; \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/v5.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/v5.js deleted file mode 100644 index 99d615e0..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/v5.js +++ /dev/null @@ -1,16 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; - -var _v = _interopRequireDefault(require("./v35.js")); - -var _sha = _interopRequireDefault(require("./sha1.js")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -const v5 = (0, _v.default)('v5', 0x50, _sha.default); -var _default = v5; -exports.default = _default; \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/validate.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/validate.js deleted file mode 100644 index fd052157..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/validate.js +++ /dev/null @@ -1,17 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; - -var _regex = _interopRequireDefault(require("./regex.js")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function validate(uuid) { - return typeof uuid === 'string' && _regex.default.test(uuid); -} - -var _default = validate; -exports.default = _default; \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/version.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/version.js deleted file mode 100644 index b72949cd..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/dist/version.js +++ /dev/null @@ -1,21 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; - -var _validate = _interopRequireDefault(require("./validate.js")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function version(uuid) { - if (!(0, _validate.default)(uuid)) { - throw TypeError('Invalid UUID'); - } - - return parseInt(uuid.substr(14, 1), 16); -} - -var _default = version; -exports.default = _default; \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/package.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/package.json deleted file mode 100644 index f0ab3711..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/package.json +++ /dev/null @@ -1,135 +0,0 @@ -{ - "name": "uuid", - "version": "8.3.2", - "description": "RFC4122 (v1, v4, and v5) UUIDs", - "commitlint": { - "extends": [ - "@commitlint/config-conventional" - ] - }, - "keywords": [ - "uuid", - "guid", - "rfc4122" - ], - "license": "MIT", - "bin": { - "uuid": "./dist/bin/uuid" - }, - "sideEffects": false, - "main": "./dist/index.js", - "exports": { - ".": { - "node": { - "module": "./dist/esm-node/index.js", - "require": "./dist/index.js", - "import": "./wrapper.mjs" - }, - "default": "./dist/esm-browser/index.js" - }, - "./package.json": "./package.json" - }, - "module": "./dist/esm-node/index.js", - "browser": { - "./dist/md5.js": "./dist/md5-browser.js", - "./dist/rng.js": "./dist/rng-browser.js", - "./dist/sha1.js": "./dist/sha1-browser.js", - "./dist/esm-node/index.js": "./dist/esm-browser/index.js" - }, - "files": [ - "CHANGELOG.md", - "CONTRIBUTING.md", - "LICENSE.md", - "README.md", - "dist", - "wrapper.mjs" - ], - "devDependencies": { - "@babel/cli": "7.11.6", - "@babel/core": "7.11.6", - "@babel/preset-env": "7.11.5", - "@commitlint/cli": "11.0.0", - "@commitlint/config-conventional": "11.0.0", - "@rollup/plugin-node-resolve": "9.0.0", - "babel-eslint": "10.1.0", - "bundlewatch": "0.3.1", - "eslint": "7.10.0", - "eslint-config-prettier": "6.12.0", - "eslint-config-standard": "14.1.1", - "eslint-plugin-import": "2.22.1", - "eslint-plugin-node": "11.1.0", - "eslint-plugin-prettier": "3.1.4", - "eslint-plugin-promise": "4.2.1", - "eslint-plugin-standard": "4.0.1", - "husky": "4.3.0", - "jest": "25.5.4", - "lint-staged": "10.4.0", - "npm-run-all": "4.1.5", - "optional-dev-dependency": "2.0.1", - "prettier": "2.1.2", - "random-seed": "0.3.0", - "rollup": "2.28.2", - "rollup-plugin-terser": "7.0.2", - "runmd": "1.3.2", - "standard-version": "9.0.0" - }, - "optionalDevDependencies": { - "@wdio/browserstack-service": "6.4.0", - "@wdio/cli": "6.4.0", - "@wdio/jasmine-framework": "6.4.0", - "@wdio/local-runner": "6.4.0", - "@wdio/spec-reporter": "6.4.0", - "@wdio/static-server-service": "6.4.0", - "@wdio/sync": "6.4.0" - }, - "scripts": { - "examples:browser:webpack:build": "cd examples/browser-webpack && npm install && npm run build", - "examples:browser:rollup:build": "cd examples/browser-rollup && npm install && npm run build", - "examples:node:commonjs:test": "cd examples/node-commonjs && npm install && npm test", - "examples:node:esmodules:test": "cd examples/node-esmodules && npm install && npm test", - "lint": "npm run eslint:check && npm run prettier:check", - "eslint:check": "eslint src/ test/ examples/ *.js", - "eslint:fix": "eslint --fix src/ test/ examples/ *.js", - "pretest": "[ -n $CI ] || npm run build", - "test": "BABEL_ENV=commonjs node --throw-deprecation node_modules/.bin/jest test/unit/", - "pretest:browser": "optional-dev-dependency && npm run build && npm-run-all --parallel examples:browser:**", - "test:browser": "wdio run ./wdio.conf.js", - "pretest:node": "npm run build", - "test:node": "npm-run-all --parallel examples:node:**", - "test:pack": "./scripts/testpack.sh", - "pretest:benchmark": "npm run build", - "test:benchmark": "cd examples/benchmark && npm install && npm test", - "prettier:check": "prettier --ignore-path .prettierignore --check '**/*.{js,jsx,json,md}'", - "prettier:fix": "prettier --ignore-path .prettierignore --write '**/*.{js,jsx,json,md}'", - "bundlewatch": "npm run pretest:browser && bundlewatch --config bundlewatch.config.json", - "md": "runmd --watch --output=README.md README_js.md", - "docs": "( node --version | grep -q 'v12' ) && ( npm run build && runmd --output=README.md README_js.md )", - "docs:diff": "npm run docs && git diff --quiet README.md", - "build": "./scripts/build.sh", - "prepack": "npm run build", - "release": "standard-version --no-verify" - }, - "repository": { - "type": "git", - "url": "https://github.com/uuidjs/uuid.git" - }, - "husky": { - "hooks": { - "commit-msg": "commitlint -E HUSKY_GIT_PARAMS", - "pre-commit": "lint-staged" - } - }, - "lint-staged": { - "*.{js,jsx,json,md}": [ - "prettier --write" - ], - "*.{js,jsx}": [ - "eslint --fix" - ] - }, - "standard-version": { - "scripts": { - "postchangelog": "prettier --write CHANGELOG.md" - } - } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/wrapper.mjs b/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/wrapper.mjs deleted file mode 100644 index c31e9cef..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/node_modules/uuid/wrapper.mjs +++ /dev/null @@ -1,10 +0,0 @@ -import uuid from './dist/index.js'; -export const v1 = uuid.v1; -export const v3 = uuid.v3; -export const v4 = uuid.v4; -export const v5 = uuid.v5; -export const NIL = uuid.NIL; -export const version = uuid.version; -export const validate = uuid.validate; -export const stringify = uuid.stringify; -export const parse = uuid.parse; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/package.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/package.json deleted file mode 100644 index 3c902faa..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@google-cloud/storage/package.json +++ /dev/null @@ -1,108 +0,0 @@ -{ - "name": "@google-cloud/storage", - "description": "Cloud Storage Client Library for Node.js", - "version": "6.7.0", - "license": "Apache-2.0", - "author": "Google Inc.", - "engines": { - "node": ">=12" - }, - "repository": "googleapis/nodejs-storage", - "main": "./build/src/index.js", - "types": "./build/src/index.d.ts", - "files": [ - "build/src", - "!build/src/**/*.map" - ], - "keywords": [ - "google apis client", - "google api client", - "google apis", - "google api", - "google", - "google cloud platform", - "google cloud", - "cloud", - "google storage", - "storage" - ], - "scripts": { - "predocs": "npm run compile", - "docs": "jsdoc -c .jsdoc.js", - "system-test": "mocha build/system-test --timeout 600000 --exit", - "conformance-test": "mocha --parallel build/conformance-test/ --require build/conformance-test/globalHooks.js", - "preconformance-test": "npm run compile", - "presystem-test": "npm run compile", - "test": "c8 mocha build/test", - "pretest": "npm run compile", - "lint": "gts check", - "samples-test": "npm link && cd samples/ && npm link ../ && npm test && cd ../", - "all-test": "npm test && npm run system-test && npm run samples-test", - "check": "gts check", - "clean": "gts clean", - "compile": "tsc -p .", - "fix": "gts fix", - "prepare": "npm run compile", - "docs-test": "linkinator docs", - "predocs-test": "npm run docs", - "benchwrapper": "node bin/benchwrapper.js", - "prelint": "cd samples; npm link ../; npm install", - "precompile": "gts clean" - }, - "dependencies": { - "@google-cloud/paginator": "^3.0.7", - "@google-cloud/projectify": "^3.0.0", - "@google-cloud/promisify": "^3.0.0", - "abort-controller": "^3.0.0", - "async-retry": "^1.3.3", - "compressible": "^2.0.12", - "duplexify": "^4.0.0", - "ent": "^2.2.0", - "extend": "^3.0.2", - "gaxios": "^5.0.0", - "google-auth-library": "^8.0.1", - "mime": "^3.0.0", - "mime-types": "^2.0.8", - "p-limit": "^3.0.1", - "retry-request": "^5.0.0", - "teeny-request": "^8.0.0", - "uuid": "^8.0.0" - }, - "devDependencies": { - "@google-cloud/pubsub": "^3.0.0", - "@grpc/grpc-js": "^1.0.3", - "@grpc/proto-loader": "^0.7.0", - "@types/async-retry": "^1.4.3", - "@types/compressible": "^2.0.0", - "@types/ent": "^2.2.1", - "@types/extend": "^3.0.0", - "@types/mime": "^3.0.0", - "@types/mime-types": "^2.1.0", - "@types/mocha": "^9.1.1", - "@types/mockery": "^1.4.29", - "@types/node": "^18.0.0", - "@types/node-fetch": "^2.1.3", - "@types/proxyquire": "^1.3.28", - "@types/request": "^2.48.4", - "@types/sinon": "^10.0.0", - "@types/tmp": "0.2.3", - "@types/uuid": "^8.0.0", - "@types/yargs": "^17.0.10", - "c8": "^7.0.0", - "form-data": "^4.0.0", - "gts": "^3.1.0", - "jsdoc": "^3.6.2", - "jsdoc-fresh": "^2.0.0", - "jsdoc-region-tag": "^2.0.0", - "linkinator": "^4.0.0", - "mocha": "^9.2.2", - "mockery": "^2.1.0", - "nock": "~13.2.0", - "node-fetch": "^2.6.7", - "proxyquire": "^2.1.3", - "sinon": "^14.0.0", - "tmp": "^0.2.0", - "typescript": "^4.6.4", - "yargs": "^17.3.1" - } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/LICENSE b/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/LICENSE deleted file mode 100644 index 8dada3ed..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "{}" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright {yyyy} {name of copyright owner} - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/README.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/README.md deleted file mode 100644 index 11a8ca9a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/README.md +++ /dev/null @@ -1,73 +0,0 @@ -# Pure JavaScript gRPC Client - -## Installation - -Node 12 is recommended. The exact set of compatible Node versions can be found in the `engines` field of the `package.json` file. - -```sh -npm install @grpc/grpc-js -``` - -## Documentation - -Documentation specifically for the `@grpc/grpc-js` package is currently not available. However, [documentation is available for the `grpc` package](https://grpc.github.io/grpc/node/grpc.html), and the two packages contain mostly the same interface. There are a few notable differences, however, and these differences are noted in the "Migrating from grpc" section below. - -## Features - -- Clients -- Automatic reconnection -- Servers -- Streaming -- Metadata -- Partial compression support: clients can decompress response messages -- Pick first and round robin load balancing policies -- Client Interceptors -- Connection Keepalives -- HTTP Connect support (proxies) - -If you need a feature from the `grpc` package that is not provided by the `@grpc/grpc-js`, please file a feature request with that information. - -This library does not directly handle `.proto` files. To use `.proto` files with this library we recommend using the `@grpc/proto-loader` package. - -## Migrating from [`grpc`](https://www.npmjs.com/package/grpc) - -`@grpc/grpc-js` is almost a drop-in replacement for `grpc`, but you may need to make a few code changes to use it: - -- If you are currently loading `.proto` files using `grpc.load`, that function is not available in this library. You should instead load your `.proto` files using `@grpc/proto-loader` and load the resulting package definition objects into `@grpc/grpc-js` using `grpc.loadPackageDefinition`. -- If you are currently loading packages generated by `grpc-tools`, you should instead generate your files using the `generate_package_definition` option in `grpc-tools`, then load the object exported by the generated file into `@grpc/grpc-js` using `grpc.loadPackageDefinition`. -- If you have a server and you are using `Server#bind` to bind ports, you will need to use `Server#bindAsync` instead. -- If you are using any channel options supported in `grpc` but not supported in `@grpc/grpc-js`, you may need to adjust your code to handle the different behavior. Refer to [the list of supported options](#supported-channel-options) below. -- Refer to the [detailed package comparison](https://github.com/grpc/grpc-node/blob/master/PACKAGE-COMPARISON.md) for more details on the differences between `grpc` and `@grpc/grpc-js`. - -## Supported Channel Options -Many channel arguments supported in `grpc` are not supported in `@grpc/grpc-js`. The channel arguments supported by `@grpc/grpc-js` are: - - `grpc.ssl_target_name_override` - - `grpc.primary_user_agent` - - `grpc.secondary_user_agent` - - `grpc.default_authority` - - `grpc.keepalive_time_ms` - - `grpc.keepalive_timeout_ms` - - `grpc.keepalive_permit_without_calls` - - `grpc.service_config` - - `grpc.max_concurrent_streams` - - `grpc.initial_reconnect_backoff_ms` - - `grpc.max_reconnect_backoff_ms` - - `grpc.use_local_subchannel_pool` - - `grpc.max_send_message_length` - - `grpc.max_receive_message_length` - - `grpc.enable_http_proxy` - - `grpc.default_compression_algorithm` - - `grpc.enable_channelz` - - `grpc.dns_min_time_between_resolutions_ms` - - `grpc-node.max_session_memory` - - `channelOverride` - - `channelFactoryOverride` - -## Some Notes on API Guarantees - -The public API of this library follows semantic versioning, with some caveats: - -- Some methods are prefixed with an underscore. These methods are internal and should not be considered part of the public API. -- The class `Call` is only exposed due to limitations of TypeScript. It should not be considered part of the public API. -- In general, any API that is exposed by this library but is not exposed by the `grpc` library is likely an error and should not be considered part of the public API. -- The `grpc.experimental` namespace contains APIs that have not stabilized. Any API in that namespace may break in any minor version update. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/package.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/package.json deleted file mode 100644 index 55ddb10a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/package.json +++ /dev/null @@ -1,78 +0,0 @@ -{ - "name": "@grpc/grpc-js", - "version": "1.7.3", - "description": "gRPC Library for Node - pure JS implementation", - "homepage": "https://grpc.io/", - "repository": "https://github.com/grpc/grpc-node/tree/master/packages/grpc-js", - "main": "build/src/index.js", - "engines": { - "node": "^8.13.0 || >=10.10.0" - }, - "keywords": [], - "author": { - "name": "Google Inc." - }, - "types": "build/src/index.d.ts", - "license": "Apache-2.0", - "devDependencies": { - "@types/gulp": "^4.0.6", - "@types/gulp-mocha": "0.0.32", - "@types/lodash": "^4.14.108", - "@types/mocha": "^5.2.6", - "@types/ncp": "^2.0.1", - "@types/pify": "^3.0.2", - "@types/semver": "^7.3.9", - "clang-format": "^1.0.55", - "execa": "^2.0.3", - "gts": "^2.0.0", - "gulp": "^4.0.2", - "gulp-mocha": "^6.0.0", - "lodash": "^4.17.4", - "madge": "^5.0.1", - "mocha-jenkins-reporter": "^0.4.1", - "ncp": "^2.0.0", - "pify": "^4.0.1", - "rimraf": "^3.0.2", - "semver": "^7.3.5", - "ts-node": "^8.3.0", - "typescript": "^3.7.2" - }, - "contributors": [ - { - "name": "Google Inc." - } - ], - "scripts": { - "build": "npm run compile", - "clean": "rimraf ./build", - "compile": "tsc -p .", - "format": "clang-format -i -style=\"{Language: JavaScript, BasedOnStyle: Google, ColumnLimit: 80}\" src/*.ts test/*.ts", - "lint": "npm run check", - "prepare": "npm run generate-types && npm run compile", - "test": "gulp test", - "check": "gts check src/**/*.ts", - "fix": "gts fix src/*.ts", - "pretest": "npm run generate-types && npm run generate-test-types && npm run compile", - "posttest": "npm run check && madge -c ./build/src", - "generate-types": "proto-loader-gen-types --keepCase --longs String --enums String --defaults --oneofs --includeComments --includeDirs proto/ --include-dirs test/fixtures/ -O src/generated/ --grpcLib ../index channelz.proto", - "generate-test-types": "proto-loader-gen-types --keepCase --longs String --enums String --defaults --oneofs --includeComments --include-dirs test/fixtures/ -O test/generated/ --grpcLib ../../src/index test_service.proto" - }, - "dependencies": { - "@grpc/proto-loader": "^0.7.0", - "@types/node": ">=12.12.47" - }, - "files": [ - "src/**/*.ts", - "build/src/**/*.{js,d.ts,js.map}", - "proto/*.proto", - "LICENSE", - "deps/envoy-api/envoy/api/v2/**/*.proto", - "deps/envoy-api/envoy/config/**/*.proto", - "deps/envoy-api/envoy/service/**/*.proto", - "deps/envoy-api/envoy/type/**/*.proto", - "deps/udpa/udpa/**/*.proto", - "deps/googleapis/google/api/*.proto", - "deps/googleapis/google/rpc/*.proto", - "deps/protoc-gen-validate/validate/**/*.proto" - ] -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/proto/channelz.proto b/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/proto/channelz.proto deleted file mode 100644 index 446e9794..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/proto/channelz.proto +++ /dev/null @@ -1,564 +0,0 @@ -// Copyright 2018 The gRPC Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// This file defines an interface for exporting monitoring information -// out of gRPC servers. See the full design at -// https://github.com/grpc/proposal/blob/master/A14-channelz.md -// -// The canonical version of this proto can be found at -// https://github.com/grpc/grpc-proto/blob/master/grpc/channelz/v1/channelz.proto - -syntax = "proto3"; - -package grpc.channelz.v1; - -import "google/protobuf/any.proto"; -import "google/protobuf/duration.proto"; -import "google/protobuf/timestamp.proto"; -import "google/protobuf/wrappers.proto"; - -option go_package = "google.golang.org/grpc/channelz/grpc_channelz_v1"; -option java_multiple_files = true; -option java_package = "io.grpc.channelz.v1"; -option java_outer_classname = "ChannelzProto"; - -// Channel is a logical grouping of channels, subchannels, and sockets. -message Channel { - // The identifier for this channel. This should bet set. - ChannelRef ref = 1; - // Data specific to this channel. - ChannelData data = 2; - // At most one of 'channel_ref+subchannel_ref' and 'socket' is set. - - // There are no ordering guarantees on the order of channel refs. - // There may not be cycles in the ref graph. - // A channel ref may be present in more than one channel or subchannel. - repeated ChannelRef channel_ref = 3; - - // At most one of 'channel_ref+subchannel_ref' and 'socket' is set. - // There are no ordering guarantees on the order of subchannel refs. - // There may not be cycles in the ref graph. - // A sub channel ref may be present in more than one channel or subchannel. - repeated SubchannelRef subchannel_ref = 4; - - // There are no ordering guarantees on the order of sockets. - repeated SocketRef socket_ref = 5; -} - -// Subchannel is a logical grouping of channels, subchannels, and sockets. -// A subchannel is load balanced over by it's ancestor -message Subchannel { - // The identifier for this channel. - SubchannelRef ref = 1; - // Data specific to this channel. - ChannelData data = 2; - // At most one of 'channel_ref+subchannel_ref' and 'socket' is set. - - // There are no ordering guarantees on the order of channel refs. - // There may not be cycles in the ref graph. - // A channel ref may be present in more than one channel or subchannel. - repeated ChannelRef channel_ref = 3; - - // At most one of 'channel_ref+subchannel_ref' and 'socket' is set. - // There are no ordering guarantees on the order of subchannel refs. - // There may not be cycles in the ref graph. - // A sub channel ref may be present in more than one channel or subchannel. - repeated SubchannelRef subchannel_ref = 4; - - // There are no ordering guarantees on the order of sockets. - repeated SocketRef socket_ref = 5; -} - -// These come from the specified states in this document: -// https://github.com/grpc/grpc/blob/master/doc/connectivity-semantics-and-api.md -message ChannelConnectivityState { - enum State { - UNKNOWN = 0; - IDLE = 1; - CONNECTING = 2; - READY = 3; - TRANSIENT_FAILURE = 4; - SHUTDOWN = 5; - } - State state = 1; -} - -// Channel data is data related to a specific Channel or Subchannel. -message ChannelData { - // The connectivity state of the channel or subchannel. Implementations - // should always set this. - ChannelConnectivityState state = 1; - - // The target this channel originally tried to connect to. May be absent - string target = 2; - - // A trace of recent events on the channel. May be absent. - ChannelTrace trace = 3; - - // The number of calls started on the channel - int64 calls_started = 4; - // The number of calls that have completed with an OK status - int64 calls_succeeded = 5; - // The number of calls that have completed with a non-OK status - int64 calls_failed = 6; - - // The last time a call was started on the channel. - google.protobuf.Timestamp last_call_started_timestamp = 7; -} - -// A trace event is an interesting thing that happened to a channel or -// subchannel, such as creation, address resolution, subchannel creation, etc. -message ChannelTraceEvent { - // High level description of the event. - string description = 1; - // The supported severity levels of trace events. - enum Severity { - CT_UNKNOWN = 0; - CT_INFO = 1; - CT_WARNING = 2; - CT_ERROR = 3; - } - // the severity of the trace event - Severity severity = 2; - // When this event occurred. - google.protobuf.Timestamp timestamp = 3; - // ref of referenced channel or subchannel. - // Optional, only present if this event refers to a child object. For example, - // this field would be filled if this trace event was for a subchannel being - // created. - oneof child_ref { - ChannelRef channel_ref = 4; - SubchannelRef subchannel_ref = 5; - } -} - -// ChannelTrace represents the recent events that have occurred on the channel. -message ChannelTrace { - // Number of events ever logged in this tracing object. This can differ from - // events.size() because events can be overwritten or garbage collected by - // implementations. - int64 num_events_logged = 1; - // Time that this channel was created. - google.protobuf.Timestamp creation_timestamp = 2; - // List of events that have occurred on this channel. - repeated ChannelTraceEvent events = 3; -} - -// ChannelRef is a reference to a Channel. -message ChannelRef { - // The globally unique id for this channel. Must be a positive number. - int64 channel_id = 1; - // An optional name associated with the channel. - string name = 2; - // Intentionally don't use field numbers from other refs. - reserved 3, 4, 5, 6, 7, 8; -} - -// SubchannelRef is a reference to a Subchannel. -message SubchannelRef { - // The globally unique id for this subchannel. Must be a positive number. - int64 subchannel_id = 7; - // An optional name associated with the subchannel. - string name = 8; - // Intentionally don't use field numbers from other refs. - reserved 1, 2, 3, 4, 5, 6; -} - -// SocketRef is a reference to a Socket. -message SocketRef { - // The globally unique id for this socket. Must be a positive number. - int64 socket_id = 3; - // An optional name associated with the socket. - string name = 4; - // Intentionally don't use field numbers from other refs. - reserved 1, 2, 5, 6, 7, 8; -} - -// ServerRef is a reference to a Server. -message ServerRef { - // A globally unique identifier for this server. Must be a positive number. - int64 server_id = 5; - // An optional name associated with the server. - string name = 6; - // Intentionally don't use field numbers from other refs. - reserved 1, 2, 3, 4, 7, 8; -} - -// Server represents a single server. There may be multiple servers in a single -// program. -message Server { - // The identifier for a Server. This should be set. - ServerRef ref = 1; - // The associated data of the Server. - ServerData data = 2; - - // The sockets that the server is listening on. There are no ordering - // guarantees. This may be absent. - repeated SocketRef listen_socket = 3; -} - -// ServerData is data for a specific Server. -message ServerData { - // A trace of recent events on the server. May be absent. - ChannelTrace trace = 1; - - // The number of incoming calls started on the server - int64 calls_started = 2; - // The number of incoming calls that have completed with an OK status - int64 calls_succeeded = 3; - // The number of incoming calls that have a completed with a non-OK status - int64 calls_failed = 4; - - // The last time a call was started on the server. - google.protobuf.Timestamp last_call_started_timestamp = 5; -} - -// Information about an actual connection. Pronounced "sock-ay". -message Socket { - // The identifier for the Socket. - SocketRef ref = 1; - - // Data specific to this Socket. - SocketData data = 2; - // The locally bound address. - Address local = 3; - // The remote bound address. May be absent. - Address remote = 4; - // Security details for this socket. May be absent if not available, or - // there is no security on the socket. - Security security = 5; - - // Optional, represents the name of the remote endpoint, if different than - // the original target name. - string remote_name = 6; -} - -// SocketData is data associated for a specific Socket. The fields present -// are specific to the implementation, so there may be minor differences in -// the semantics. (e.g. flow control windows) -message SocketData { - // The number of streams that have been started. - int64 streams_started = 1; - // The number of streams that have ended successfully: - // On client side, received frame with eos bit set; - // On server side, sent frame with eos bit set. - int64 streams_succeeded = 2; - // The number of streams that have ended unsuccessfully: - // On client side, ended without receiving frame with eos bit set; - // On server side, ended without sending frame with eos bit set. - int64 streams_failed = 3; - // The number of grpc messages successfully sent on this socket. - int64 messages_sent = 4; - // The number of grpc messages received on this socket. - int64 messages_received = 5; - - // The number of keep alives sent. This is typically implemented with HTTP/2 - // ping messages. - int64 keep_alives_sent = 6; - - // The last time a stream was created by this endpoint. Usually unset for - // servers. - google.protobuf.Timestamp last_local_stream_created_timestamp = 7; - // The last time a stream was created by the remote endpoint. Usually unset - // for clients. - google.protobuf.Timestamp last_remote_stream_created_timestamp = 8; - - // The last time a message was sent by this endpoint. - google.protobuf.Timestamp last_message_sent_timestamp = 9; - // The last time a message was received by this endpoint. - google.protobuf.Timestamp last_message_received_timestamp = 10; - - // The amount of window, granted to the local endpoint by the remote endpoint. - // This may be slightly out of date due to network latency. This does NOT - // include stream level or TCP level flow control info. - google.protobuf.Int64Value local_flow_control_window = 11; - - // The amount of window, granted to the remote endpoint by the local endpoint. - // This may be slightly out of date due to network latency. This does NOT - // include stream level or TCP level flow control info. - google.protobuf.Int64Value remote_flow_control_window = 12; - - // Socket options set on this socket. May be absent if 'summary' is set - // on GetSocketRequest. - repeated SocketOption option = 13; -} - -// Address represents the address used to create the socket. -message Address { - message TcpIpAddress { - // Either the IPv4 or IPv6 address in bytes. Will be either 4 bytes or 16 - // bytes in length. - bytes ip_address = 1; - // 0-64k, or -1 if not appropriate. - int32 port = 2; - } - // A Unix Domain Socket address. - message UdsAddress { - string filename = 1; - } - // An address type not included above. - message OtherAddress { - // The human readable version of the value. This value should be set. - string name = 1; - // The actual address message. - google.protobuf.Any value = 2; - } - - oneof address { - TcpIpAddress tcpip_address = 1; - UdsAddress uds_address = 2; - OtherAddress other_address = 3; - } -} - -// Security represents details about how secure the socket is. -message Security { - message Tls { - oneof cipher_suite { - // The cipher suite name in the RFC 4346 format: - // https://tools.ietf.org/html/rfc4346#appendix-C - string standard_name = 1; - // Some other way to describe the cipher suite if - // the RFC 4346 name is not available. - string other_name = 2; - } - // the certificate used by this endpoint. - bytes local_certificate = 3; - // the certificate used by the remote endpoint. - bytes remote_certificate = 4; - } - message OtherSecurity { - // The human readable version of the value. - string name = 1; - // The actual security details message. - google.protobuf.Any value = 2; - } - oneof model { - Tls tls = 1; - OtherSecurity other = 2; - } -} - -// SocketOption represents socket options for a socket. Specifically, these -// are the options returned by getsockopt(). -message SocketOption { - // The full name of the socket option. Typically this will be the upper case - // name, such as "SO_REUSEPORT". - string name = 1; - // The human readable value of this socket option. At least one of value or - // additional will be set. - string value = 2; - // Additional data associated with the socket option. At least one of value - // or additional will be set. - google.protobuf.Any additional = 3; -} - -// For use with SocketOption's additional field. This is primarily used for -// SO_RCVTIMEO and SO_SNDTIMEO -message SocketOptionTimeout { - google.protobuf.Duration duration = 1; -} - -// For use with SocketOption's additional field. This is primarily used for -// SO_LINGER. -message SocketOptionLinger { - // active maps to `struct linger.l_onoff` - bool active = 1; - // duration maps to `struct linger.l_linger` - google.protobuf.Duration duration = 2; -} - -// For use with SocketOption's additional field. Tcp info for -// SOL_TCP and TCP_INFO. -message SocketOptionTcpInfo { - uint32 tcpi_state = 1; - - uint32 tcpi_ca_state = 2; - uint32 tcpi_retransmits = 3; - uint32 tcpi_probes = 4; - uint32 tcpi_backoff = 5; - uint32 tcpi_options = 6; - uint32 tcpi_snd_wscale = 7; - uint32 tcpi_rcv_wscale = 8; - - uint32 tcpi_rto = 9; - uint32 tcpi_ato = 10; - uint32 tcpi_snd_mss = 11; - uint32 tcpi_rcv_mss = 12; - - uint32 tcpi_unacked = 13; - uint32 tcpi_sacked = 14; - uint32 tcpi_lost = 15; - uint32 tcpi_retrans = 16; - uint32 tcpi_fackets = 17; - - uint32 tcpi_last_data_sent = 18; - uint32 tcpi_last_ack_sent = 19; - uint32 tcpi_last_data_recv = 20; - uint32 tcpi_last_ack_recv = 21; - - uint32 tcpi_pmtu = 22; - uint32 tcpi_rcv_ssthresh = 23; - uint32 tcpi_rtt = 24; - uint32 tcpi_rttvar = 25; - uint32 tcpi_snd_ssthresh = 26; - uint32 tcpi_snd_cwnd = 27; - uint32 tcpi_advmss = 28; - uint32 tcpi_reordering = 29; -} - -// Channelz is a service exposed by gRPC servers that provides detailed debug -// information. -service Channelz { - // Gets all root channels (i.e. channels the application has directly - // created). This does not include subchannels nor non-top level channels. - rpc GetTopChannels(GetTopChannelsRequest) returns (GetTopChannelsResponse); - // Gets all servers that exist in the process. - rpc GetServers(GetServersRequest) returns (GetServersResponse); - // Returns a single Server, or else a NOT_FOUND code. - rpc GetServer(GetServerRequest) returns (GetServerResponse); - // Gets all server sockets that exist in the process. - rpc GetServerSockets(GetServerSocketsRequest) returns (GetServerSocketsResponse); - // Returns a single Channel, or else a NOT_FOUND code. - rpc GetChannel(GetChannelRequest) returns (GetChannelResponse); - // Returns a single Subchannel, or else a NOT_FOUND code. - rpc GetSubchannel(GetSubchannelRequest) returns (GetSubchannelResponse); - // Returns a single Socket or else a NOT_FOUND code. - rpc GetSocket(GetSocketRequest) returns (GetSocketResponse); -} - -message GetTopChannelsRequest { - // start_channel_id indicates that only channels at or above this id should be - // included in the results. - // To request the first page, this should be set to 0. To request - // subsequent pages, the client generates this value by adding 1 to - // the highest seen result ID. - int64 start_channel_id = 1; - - // If non-zero, the server will return a page of results containing - // at most this many items. If zero, the server will choose a - // reasonable page size. Must never be negative. - int64 max_results = 2; -} - -message GetTopChannelsResponse { - // list of channels that the connection detail service knows about. Sorted in - // ascending channel_id order. - // Must contain at least 1 result, otherwise 'end' must be true. - repeated Channel channel = 1; - // If set, indicates that the list of channels is the final list. Requesting - // more channels can only return more if they are created after this RPC - // completes. - bool end = 2; -} - -message GetServersRequest { - // start_server_id indicates that only servers at or above this id should be - // included in the results. - // To request the first page, this must be set to 0. To request - // subsequent pages, the client generates this value by adding 1 to - // the highest seen result ID. - int64 start_server_id = 1; - - // If non-zero, the server will return a page of results containing - // at most this many items. If zero, the server will choose a - // reasonable page size. Must never be negative. - int64 max_results = 2; -} - -message GetServersResponse { - // list of servers that the connection detail service knows about. Sorted in - // ascending server_id order. - // Must contain at least 1 result, otherwise 'end' must be true. - repeated Server server = 1; - // If set, indicates that the list of servers is the final list. Requesting - // more servers will only return more if they are created after this RPC - // completes. - bool end = 2; -} - -message GetServerRequest { - // server_id is the identifier of the specific server to get. - int64 server_id = 1; -} - -message GetServerResponse { - // The Server that corresponds to the requested server_id. This field - // should be set. - Server server = 1; -} - -message GetServerSocketsRequest { - int64 server_id = 1; - // start_socket_id indicates that only sockets at or above this id should be - // included in the results. - // To request the first page, this must be set to 0. To request - // subsequent pages, the client generates this value by adding 1 to - // the highest seen result ID. - int64 start_socket_id = 2; - - // If non-zero, the server will return a page of results containing - // at most this many items. If zero, the server will choose a - // reasonable page size. Must never be negative. - int64 max_results = 3; -} - -message GetServerSocketsResponse { - // list of socket refs that the connection detail service knows about. Sorted in - // ascending socket_id order. - // Must contain at least 1 result, otherwise 'end' must be true. - repeated SocketRef socket_ref = 1; - // If set, indicates that the list of sockets is the final list. Requesting - // more sockets will only return more if they are created after this RPC - // completes. - bool end = 2; -} - -message GetChannelRequest { - // channel_id is the identifier of the specific channel to get. - int64 channel_id = 1; -} - -message GetChannelResponse { - // The Channel that corresponds to the requested channel_id. This field - // should be set. - Channel channel = 1; -} - -message GetSubchannelRequest { - // subchannel_id is the identifier of the specific subchannel to get. - int64 subchannel_id = 1; -} - -message GetSubchannelResponse { - // The Subchannel that corresponds to the requested subchannel_id. This - // field should be set. - Subchannel subchannel = 1; -} - -message GetSocketRequest { - // socket_id is the identifier of the specific socket to get. - int64 socket_id = 1; - - // If true, the response will contain only high level information - // that is inexpensive to obtain. Fields thay may be omitted are - // documented. - bool summary = 2; -} - -message GetSocketResponse { - // The Socket that corresponds to the requested socket_id. This field - // should be set. - Socket socket = 1; -} \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/admin.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/admin.ts deleted file mode 100644 index 7745d07d..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/admin.ts +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright 2021 gRPC authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -import { ServiceDefinition } from "./make-client"; -import { Server, UntypedServiceImplementation } from "./server"; - -interface GetServiceDefinition { - (): ServiceDefinition; -} - -interface GetHandlers { - (): UntypedServiceImplementation; -} - -const registeredAdminServices: {getServiceDefinition: GetServiceDefinition, getHandlers: GetHandlers}[] = []; - -export function registerAdminService(getServiceDefinition: GetServiceDefinition, getHandlers: GetHandlers) { - registeredAdminServices.push({getServiceDefinition, getHandlers}); -} - -export function addAdminServicesToServer(server: Server): void { - for (const {getServiceDefinition, getHandlers} of registeredAdminServices) { - server.addService(getServiceDefinition(), getHandlers()); - } -} \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/backoff-timeout.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/backoff-timeout.ts deleted file mode 100644 index f523e259..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/backoff-timeout.ts +++ /dev/null @@ -1,181 +0,0 @@ -/* - * Copyright 2019 gRPC authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -const INITIAL_BACKOFF_MS = 1000; -const BACKOFF_MULTIPLIER = 1.6; -const MAX_BACKOFF_MS = 120000; -const BACKOFF_JITTER = 0.2; - -/** - * Get a number uniformly at random in the range [min, max) - * @param min - * @param max - */ -function uniformRandom(min: number, max: number) { - return Math.random() * (max - min) + min; -} - -export interface BackoffOptions { - initialDelay?: number; - multiplier?: number; - jitter?: number; - maxDelay?: number; -} - -export class BackoffTimeout { - /** - * The delay time at the start, and after each reset. - */ - private readonly initialDelay: number = INITIAL_BACKOFF_MS; - /** - * The exponential backoff multiplier. - */ - private readonly multiplier: number = BACKOFF_MULTIPLIER; - /** - * The maximum delay time - */ - private readonly maxDelay: number = MAX_BACKOFF_MS; - /** - * The maximum fraction by which the delay time can randomly vary after - * applying the multiplier. - */ - private readonly jitter: number = BACKOFF_JITTER; - /** - * The delay time for the next time the timer runs. - */ - private nextDelay: number; - /** - * The handle of the underlying timer. If running is false, this value refers - * to an object representing a timer that has ended, but it can still be - * interacted with without error. - */ - private timerId: NodeJS.Timer; - /** - * Indicates whether the timer is currently running. - */ - private running = false; - /** - * Indicates whether the timer should keep the Node process running if no - * other async operation is doing so. - */ - private hasRef = true; - /** - * The time that the currently running timer was started. Only valid if - * running is true. - */ - private startTime: Date = new Date(); - - constructor(private callback: () => void, options?: BackoffOptions) { - if (options) { - if (options.initialDelay) { - this.initialDelay = options.initialDelay; - } - if (options.multiplier) { - this.multiplier = options.multiplier; - } - if (options.jitter) { - this.jitter = options.jitter; - } - if (options.maxDelay) { - this.maxDelay = options.maxDelay; - } - } - this.nextDelay = this.initialDelay; - this.timerId = setTimeout(() => {}, 0); - clearTimeout(this.timerId); - } - - private runTimer(delay: number) { - clearTimeout(this.timerId); - this.timerId = setTimeout(() => { - this.callback(); - this.running = false; - }, delay); - if (!this.hasRef) { - this.timerId.unref?.(); - } - } - - /** - * Call the callback after the current amount of delay time - */ - runOnce() { - this.running = true; - this.startTime = new Date(); - this.runTimer(this.nextDelay); - const nextBackoff = Math.min( - this.nextDelay * this.multiplier, - this.maxDelay - ); - const jitterMagnitude = nextBackoff * this.jitter; - this.nextDelay = - nextBackoff + uniformRandom(-jitterMagnitude, jitterMagnitude); - } - - /** - * Stop the timer. The callback will not be called until `runOnce` is called - * again. - */ - stop() { - clearTimeout(this.timerId); - this.running = false; - } - - /** - * Reset the delay time to its initial value. If the timer is still running, - * retroactively apply that reset to the current timer. - */ - reset() { - this.nextDelay = this.initialDelay; - if (this.running) { - const now = new Date(); - const newEndTime = this.startTime; - newEndTime.setMilliseconds(newEndTime.getMilliseconds() + this.nextDelay); - clearTimeout(this.timerId); - if (now < newEndTime) { - this.runTimer(newEndTime.getTime() - now.getTime()); - } else { - this.running = false; - } - } - } - - /** - * Check whether the timer is currently running. - */ - isRunning() { - return this.running; - } - - /** - * Set that while the timer is running, it should keep the Node process - * running. - */ - ref() { - this.hasRef = true; - this.timerId.ref?.(); - } - - /** - * Set that while the timer is running, it should not keep the Node process - * running. - */ - unref() { - this.hasRef = false; - this.timerId.unref?.(); - } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/call-credentials-filter.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/call-credentials-filter.ts deleted file mode 100644 index 5c746297..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/call-credentials-filter.ts +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright 2019 gRPC authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -import { Call } from './call-stream'; -import { Channel } from './channel'; -import { BaseFilter, Filter, FilterFactory } from './filter'; -import { Metadata } from './metadata'; -import { Status } from './constants'; -import { splitHostPort } from './uri-parser'; -import { ServiceError } from './call'; - -export class CallCredentialsFilter extends BaseFilter implements Filter { - private serviceUrl: string; - constructor( - private readonly channel: Channel, - private readonly stream: Call - ) { - super(); - this.channel = channel; - this.stream = stream; - const splitPath: string[] = stream.getMethod().split('/'); - let serviceName = ''; - /* The standard path format is "/{serviceName}/{methodName}", so if we split - * by '/', the first item should be empty and the second should be the - * service name */ - if (splitPath.length >= 2) { - serviceName = splitPath[1]; - } - const hostname = splitHostPort(stream.getHost())?.host ?? 'localhost'; - /* Currently, call credentials are only allowed on HTTPS connections, so we - * can assume that the scheme is "https" */ - this.serviceUrl = `https://${hostname}/${serviceName}`; - } - - async sendMetadata(metadata: Promise): Promise { - const credentials = this.stream.getCredentials(); - const credsMetadata = credentials.generateMetadata({ - service_url: this.serviceUrl, - }); - const resultMetadata = await metadata; - try { - resultMetadata.merge(await credsMetadata); - } catch (error) { - this.stream.cancelWithStatus( - Status.UNAUTHENTICATED, - `Failed to retrieve auth metadata with error: ${error.message}` - ); - return Promise.reject('Failed to retrieve auth metadata'); - } - if (resultMetadata.get('authorization').length > 1) { - this.stream.cancelWithStatus( - Status.INTERNAL, - '"authorization" metadata cannot have multiple values' - ); - return Promise.reject( - '"authorization" metadata cannot have multiple values' - ); - } - return resultMetadata; - } -} - -export class CallCredentialsFilterFactory - implements FilterFactory { - constructor(private readonly channel: Channel) { - this.channel = channel; - } - - createFilter(callStream: Call): CallCredentialsFilter { - return new CallCredentialsFilter(this.channel, callStream); - } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/call-credentials.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/call-credentials.ts deleted file mode 100644 index bbc88a89..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/call-credentials.ts +++ /dev/null @@ -1,222 +0,0 @@ -/* - * Copyright 2019 gRPC authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -import { Metadata } from './metadata'; - -export interface CallMetadataOptions { - service_url: string; -} - -export type CallMetadataGenerator = ( - options: CallMetadataOptions, - cb: (err: Error | null, metadata?: Metadata) => void -) => void; - -// google-auth-library pre-v2.0.0 does not have getRequestHeaders -// but has getRequestMetadata, which is deprecated in v2.0.0 -export interface OldOAuth2Client { - getRequestMetadata: ( - url: string, - callback: ( - err: Error | null, - headers?: { - [index: string]: string; - } - ) => void - ) => void; -} - -export interface CurrentOAuth2Client { - getRequestHeaders: (url?: string) => Promise<{ [index: string]: string }>; -} - -export type OAuth2Client = OldOAuth2Client | CurrentOAuth2Client; - -function isCurrentOauth2Client( - client: OAuth2Client -): client is CurrentOAuth2Client { - return ( - 'getRequestHeaders' in client && - typeof client.getRequestHeaders === 'function' - ); -} - -/** - * A class that represents a generic method of adding authentication-related - * metadata on a per-request basis. - */ -export abstract class CallCredentials { - /** - * Asynchronously generates a new Metadata object. - * @param options Options used in generating the Metadata object. - */ - abstract generateMetadata(options: CallMetadataOptions): Promise; - /** - * Creates a new CallCredentials object from properties of both this and - * another CallCredentials object. This object's metadata generator will be - * called first. - * @param callCredentials The other CallCredentials object. - */ - abstract compose(callCredentials: CallCredentials): CallCredentials; - - /** - * Check whether two call credentials objects are equal. Separate - * SingleCallCredentials with identical metadata generator functions are - * equal. - * @param other The other CallCredentials object to compare with. - */ - abstract _equals(other: CallCredentials): boolean; - - /** - * Creates a new CallCredentials object from a given function that generates - * Metadata objects. - * @param metadataGenerator A function that accepts a set of options, and - * generates a Metadata object based on these options, which is passed back - * to the caller via a supplied (err, metadata) callback. - */ - static createFromMetadataGenerator( - metadataGenerator: CallMetadataGenerator - ): CallCredentials { - return new SingleCallCredentials(metadataGenerator); - } - - /** - * Create a gRPC credential from a Google credential object. - * @param googleCredentials The authentication client to use. - * @return The resulting CallCredentials object. - */ - static createFromGoogleCredential( - googleCredentials: OAuth2Client - ): CallCredentials { - return CallCredentials.createFromMetadataGenerator((options, callback) => { - let getHeaders: Promise<{ [index: string]: string }>; - if (isCurrentOauth2Client(googleCredentials)) { - getHeaders = googleCredentials.getRequestHeaders(options.service_url); - } else { - getHeaders = new Promise((resolve, reject) => { - googleCredentials.getRequestMetadata( - options.service_url, - (err, headers) => { - if (err) { - reject(err); - return; - } - resolve(headers); - } - ); - }); - } - getHeaders.then( - (headers) => { - const metadata = new Metadata(); - for (const key of Object.keys(headers)) { - metadata.add(key, headers[key]); - } - callback(null, metadata); - }, - (err) => { - callback(err); - } - ); - }); - } - - static createEmpty(): CallCredentials { - return new EmptyCallCredentials(); - } -} - -class ComposedCallCredentials extends CallCredentials { - constructor(private creds: CallCredentials[]) { - super(); - } - - async generateMetadata(options: CallMetadataOptions): Promise { - const base: Metadata = new Metadata(); - const generated: Metadata[] = await Promise.all( - this.creds.map((cred) => cred.generateMetadata(options)) - ); - for (const gen of generated) { - base.merge(gen); - } - return base; - } - - compose(other: CallCredentials): CallCredentials { - return new ComposedCallCredentials(this.creds.concat([other])); - } - - _equals(other: CallCredentials): boolean { - if (this === other) { - return true; - } - if (other instanceof ComposedCallCredentials) { - return this.creds.every((value, index) => - value._equals(other.creds[index]) - ); - } else { - return false; - } - } -} - -class SingleCallCredentials extends CallCredentials { - constructor(private metadataGenerator: CallMetadataGenerator) { - super(); - } - - generateMetadata(options: CallMetadataOptions): Promise { - return new Promise((resolve, reject) => { - this.metadataGenerator(options, (err, metadata) => { - if (metadata !== undefined) { - resolve(metadata); - } else { - reject(err); - } - }); - }); - } - - compose(other: CallCredentials): CallCredentials { - return new ComposedCallCredentials([this, other]); - } - - _equals(other: CallCredentials): boolean { - if (this === other) { - return true; - } - if (other instanceof SingleCallCredentials) { - return this.metadataGenerator === other.metadataGenerator; - } else { - return false; - } - } -} - -class EmptyCallCredentials extends CallCredentials { - generateMetadata(options: CallMetadataOptions): Promise { - return Promise.resolve(new Metadata()); - } - - compose(other: CallCredentials): CallCredentials { - return other; - } - - _equals(other: CallCredentials): boolean { - return other instanceof EmptyCallCredentials; - } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/call-stream.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/call-stream.ts deleted file mode 100644 index 488e35fc..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/call-stream.ts +++ /dev/null @@ -1,899 +0,0 @@ -/* - * Copyright 2019 gRPC authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -import * as http2 from 'http2'; -import * as os from 'os'; - -import { CallCredentials } from './call-credentials'; -import { Propagate, Status } from './constants'; -import { Filter, FilterFactory } from './filter'; -import { FilterStackFactory, FilterStack } from './filter-stack'; -import { Metadata } from './metadata'; -import { StreamDecoder } from './stream-decoder'; -import { ChannelImplementation } from './channel'; -import { SubchannelCallStatsTracker, Subchannel } from './subchannel'; -import * as logging from './logging'; -import { LogVerbosity } from './constants'; -import { ServerSurfaceCall } from './server-call'; - -const TRACER_NAME = 'call_stream'; - -const { - HTTP2_HEADER_STATUS, - HTTP2_HEADER_CONTENT_TYPE, - NGHTTP2_CANCEL, -} = http2.constants; - -/** - * https://nodejs.org/api/errors.html#errors_class_systemerror - */ -interface SystemError extends Error { - address?: string; - code: string; - dest?: string; - errno: number; - info?: object; - message: string; - path?: string; - port?: number; - syscall: string; -} - -/** - * Should do approximately the same thing as util.getSystemErrorName but the - * TypeScript types don't have that function for some reason so I just made my - * own. - * @param errno - */ -function getSystemErrorName(errno: number): string { - for (const [name, num] of Object.entries(os.constants.errno)) { - if (num === errno) { - return name; - } - } - return 'Unknown system error ' + errno; -} - -export type Deadline = Date | number; - -function getMinDeadline(deadlineList: Deadline[]): Deadline { - let minValue = Infinity; - for (const deadline of deadlineList) { - const deadlineMsecs = - deadline instanceof Date ? deadline.getTime() : deadline; - if (deadlineMsecs < minValue) { - minValue = deadlineMsecs; - } - } - return minValue; -} - -export interface CallStreamOptions { - deadline: Deadline; - flags: number; - host: string; - parentCall: ServerSurfaceCall | null; -} - -export type PartialCallStreamOptions = Partial; - -export interface StatusObject { - code: Status; - details: string; - metadata: Metadata; -} - -export type PartialStatusObject = Pick & { - metadata: Metadata | null; -} - -export const enum WriteFlags { - BufferHint = 1, - NoCompress = 2, - WriteThrough = 4, -} - -export interface WriteObject { - message: Buffer; - flags?: number; -} - -export interface MetadataListener { - (metadata: Metadata, next: (metadata: Metadata) => void): void; -} - -export interface MessageListener { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (message: any, next: (message: any) => void): void; -} - -export interface StatusListener { - (status: StatusObject, next: (status: StatusObject) => void): void; -} - -export interface FullListener { - onReceiveMetadata: MetadataListener; - onReceiveMessage: MessageListener; - onReceiveStatus: StatusListener; -} - -export type Listener = Partial; - -/** - * An object with methods for handling the responses to a call. - */ -export interface InterceptingListener { - onReceiveMetadata(metadata: Metadata): void; - // eslint-disable-next-line @typescript-eslint/no-explicit-any - onReceiveMessage(message: any): void; - onReceiveStatus(status: StatusObject): void; -} - -export function isInterceptingListener( - listener: Listener | InterceptingListener -): listener is InterceptingListener { - return ( - listener.onReceiveMetadata !== undefined && - listener.onReceiveMetadata.length === 1 - ); -} - -export class InterceptingListenerImpl implements InterceptingListener { - private processingMetadata = false; - private hasPendingMessage = false; - private pendingMessage: any; - private processingMessage = false; - private pendingStatus: StatusObject | null = null; - constructor( - private listener: FullListener, - private nextListener: InterceptingListener - ) {} - - private processPendingMessage() { - if (this.hasPendingMessage) { - this.nextListener.onReceiveMessage(this.pendingMessage); - this.pendingMessage = null; - this.hasPendingMessage = false; - } - } - - private processPendingStatus() { - if (this.pendingStatus) { - this.nextListener.onReceiveStatus(this.pendingStatus); - } - } - - onReceiveMetadata(metadata: Metadata): void { - this.processingMetadata = true; - this.listener.onReceiveMetadata(metadata, (metadata) => { - this.processingMetadata = false; - this.nextListener.onReceiveMetadata(metadata); - this.processPendingMessage(); - this.processPendingStatus(); - }); - } - // eslint-disable-next-line @typescript-eslint/no-explicit-any - onReceiveMessage(message: any): void { - /* If this listener processes messages asynchronously, the last message may - * be reordered with respect to the status */ - this.processingMessage = true; - this.listener.onReceiveMessage(message, (msg) => { - this.processingMessage = false; - if (this.processingMetadata) { - this.pendingMessage = msg; - this.hasPendingMessage = true; - } else { - this.nextListener.onReceiveMessage(msg); - this.processPendingStatus(); - } - }); - } - onReceiveStatus(status: StatusObject): void { - this.listener.onReceiveStatus(status, (processedStatus) => { - if (this.processingMetadata || this.processingMessage) { - this.pendingStatus = processedStatus; - } else { - this.nextListener.onReceiveStatus(processedStatus); - } - }); - } -} - -export interface WriteCallback { - (error?: Error | null): void; -} - -export interface MessageContext { - callback?: WriteCallback; - flags?: number; -} - -export interface Call { - cancelWithStatus(status: Status, details: string): void; - getPeer(): string; - start(metadata: Metadata, listener: InterceptingListener): void; - sendMessageWithContext(context: MessageContext, message: Buffer): void; - startRead(): void; - halfClose(): void; - - getDeadline(): Deadline; - getCredentials(): CallCredentials; - setCredentials(credentials: CallCredentials): void; - getMethod(): string; - getHost(): string; -} - -export class Http2CallStream implements Call { - credentials: CallCredentials; - filterStack: FilterStack; - private http2Stream: http2.ClientHttp2Stream | null = null; - private pendingRead = false; - private isWriteFilterPending = false; - private pendingWrite: Buffer | null = null; - private pendingWriteCallback: WriteCallback | null = null; - private writesClosed = false; - - private decoder = new StreamDecoder(); - - private isReadFilterPending = false; - private canPush = false; - /** - * Indicates that an 'end' event has come from the http2 stream, so there - * will be no more data events. - */ - private readsClosed = false; - - private statusOutput = false; - - private unpushedReadMessages: Buffer[] = []; - private unfilteredReadMessages: Buffer[] = []; - - // Status code mapped from :status. To be used if grpc-status is not received - private mappedStatusCode: Status = Status.UNKNOWN; - - // This is populated (non-null) if and only if the call has ended - private finalStatus: StatusObject | null = null; - - private subchannel: Subchannel | null = null; - private disconnectListener: () => void; - - private listener: InterceptingListener | null = null; - - private internalError: SystemError | null = null; - - private configDeadline: Deadline = Infinity; - - private statusWatchers: ((status: StatusObject) => void)[] = []; - private streamEndWatchers: ((success: boolean) => void)[] = []; - - private callStatsTracker: SubchannelCallStatsTracker | null = null; - - constructor( - private readonly methodName: string, - private readonly channel: ChannelImplementation, - private readonly options: CallStreamOptions, - filterStackFactory: FilterStackFactory, - private readonly channelCallCredentials: CallCredentials, - private readonly callNumber: number - ) { - this.filterStack = filterStackFactory.createFilter(this); - this.credentials = channelCallCredentials; - this.disconnectListener = () => { - this.endCall({ - code: Status.UNAVAILABLE, - details: 'Connection dropped', - metadata: new Metadata(), - }); - }; - if ( - this.options.parentCall && - this.options.flags & Propagate.CANCELLATION - ) { - this.options.parentCall.on('cancelled', () => { - this.cancelWithStatus(Status.CANCELLED, 'Cancelled by parent call'); - }); - } - } - - private outputStatus() { - /* Precondition: this.finalStatus !== null */ - if (this.listener && !this.statusOutput) { - this.statusOutput = true; - const filteredStatus = this.filterStack.receiveTrailers( - this.finalStatus! - ); - this.trace( - 'ended with status: code=' + - filteredStatus.code + - ' details="' + - filteredStatus.details + - '"' - ); - this.statusWatchers.forEach(watcher => watcher(filteredStatus)); - /* We delay the actual action of bubbling up the status to insulate the - * cleanup code in this class from any errors that may be thrown in the - * upper layers as a result of bubbling up the status. In particular, - * if the status is not OK, the "error" event may be emitted - * synchronously at the top level, which will result in a thrown error if - * the user does not handle that event. */ - process.nextTick(() => { - this.listener?.onReceiveStatus(filteredStatus); - }); - /* Leave the http2 stream in flowing state to drain incoming messages, to - * ensure that the stream closure completes. The call stream already does - * not push more messages after the status is output, so the messages go - * nowhere either way. */ - this.http2Stream?.resume(); - if (this.subchannel) { - this.subchannel.callUnref(); - this.subchannel.removeDisconnectListener(this.disconnectListener); - } - } - } - - private trace(text: string): void { - logging.trace( - LogVerbosity.DEBUG, - TRACER_NAME, - '[' + this.callNumber + '] ' + text - ); - } - - /** - * On first call, emits a 'status' event with the given StatusObject. - * Subsequent calls are no-ops. - * @param status The status of the call. - */ - private endCall(status: StatusObject): void { - /* If the status is OK and a new status comes in (e.g. from a - * deserialization failure), that new status takes priority */ - if (this.finalStatus === null || this.finalStatus.code === Status.OK) { - this.finalStatus = status; - this.maybeOutputStatus(); - } - this.destroyHttp2Stream(); - } - - private maybeOutputStatus() { - if (this.finalStatus !== null) { - /* The combination check of readsClosed and that the two message buffer - * arrays are empty checks that there all incoming data has been fully - * processed */ - if ( - this.finalStatus.code !== Status.OK || - (this.readsClosed && - this.unpushedReadMessages.length === 0 && - this.unfilteredReadMessages.length === 0 && - !this.isReadFilterPending) - ) { - this.outputStatus(); - } - } - } - - private push(message: Buffer): void { - this.trace( - 'pushing to reader message of length ' + - (message instanceof Buffer ? message.length : null) - ); - this.canPush = false; - process.nextTick(() => { - /* If we have already output the status any later messages should be - * ignored, and can cause out-of-order operation errors higher up in the - * stack. Checking as late as possible here to avoid any race conditions. - */ - if (this.statusOutput) { - return; - } - this.listener?.onReceiveMessage(message); - this.maybeOutputStatus(); - }); - } - - private handleFilterError(error: Error) { - this.cancelWithStatus(Status.INTERNAL, error.message); - } - - private handleFilteredRead(message: Buffer) { - /* If we the call has already ended with an error, we don't want to do - * anything with this message. Dropping it on the floor is correct - * behavior */ - if (this.finalStatus !== null && this.finalStatus.code !== Status.OK) { - this.maybeOutputStatus(); - return; - } - this.isReadFilterPending = false; - if (this.canPush) { - this.http2Stream!.pause(); - this.push(message); - } else { - this.trace( - 'unpushedReadMessages.push message of length ' + message.length - ); - this.unpushedReadMessages.push(message); - } - if (this.unfilteredReadMessages.length > 0) { - /* nextMessage is guaranteed not to be undefined because - unfilteredReadMessages is non-empty */ - const nextMessage = this.unfilteredReadMessages.shift()!; - this.filterReceivedMessage(nextMessage); - } - } - - private filterReceivedMessage(framedMessage: Buffer) { - /* If we the call has already ended with an error, we don't want to do - * anything with this message. Dropping it on the floor is correct - * behavior */ - if (this.finalStatus !== null && this.finalStatus.code !== Status.OK) { - this.maybeOutputStatus(); - return; - } - this.trace('filterReceivedMessage of length ' + framedMessage.length); - this.isReadFilterPending = true; - this.filterStack - .receiveMessage(Promise.resolve(framedMessage)) - .then( - this.handleFilteredRead.bind(this), - this.handleFilterError.bind(this) - ); - } - - private tryPush(messageBytes: Buffer): void { - if (this.isReadFilterPending) { - this.trace( - 'unfilteredReadMessages.push message of length ' + - (messageBytes && messageBytes.length) - ); - this.unfilteredReadMessages.push(messageBytes); - } else { - this.filterReceivedMessage(messageBytes); - } - } - - private handleTrailers(headers: http2.IncomingHttpHeaders) { - this.streamEndWatchers.forEach(watcher => watcher(true)); - let headersString = ''; - for (const header of Object.keys(headers)) { - headersString += '\t\t' + header + ': ' + headers[header] + '\n'; - } - this.trace('Received server trailers:\n' + headersString); - let metadata: Metadata; - try { - metadata = Metadata.fromHttp2Headers(headers); - } catch (e) { - metadata = new Metadata(); - } - const metadataMap = metadata.getMap(); - let code: Status = this.mappedStatusCode; - if ( - code === Status.UNKNOWN && - typeof metadataMap['grpc-status'] === 'string' - ) { - const receivedStatus = Number(metadataMap['grpc-status']); - if (receivedStatus in Status) { - code = receivedStatus; - this.trace('received status code ' + receivedStatus + ' from server'); - } - metadata.remove('grpc-status'); - } - let details = ''; - if (typeof metadataMap['grpc-message'] === 'string') { - try { - details = decodeURI(metadataMap['grpc-message']); - } catch (e) { - details = metadataMap['grpc-message']; - } - metadata.remove('grpc-message'); - this.trace( - 'received status details string "' + details + '" from server' - ); - } - const status: StatusObject = { code, details, metadata }; - // This is a no-op if the call was already ended when handling headers. - this.endCall(status); - } - - private writeMessageToStream(message: Buffer, callback: WriteCallback) { - this.callStatsTracker?.addMessageSent(); - this.http2Stream!.write(message, callback); - } - - attachHttp2Stream( - stream: http2.ClientHttp2Stream, - subchannel: Subchannel, - extraFilters: Filter[], - callStatsTracker: SubchannelCallStatsTracker - ): void { - this.filterStack.push(extraFilters); - if (this.finalStatus !== null) { - stream.close(NGHTTP2_CANCEL); - } else { - this.trace( - 'attachHttp2Stream from subchannel ' + subchannel.getAddress() - ); - this.http2Stream = stream; - this.subchannel = subchannel; - this.callStatsTracker = callStatsTracker; - subchannel.addDisconnectListener(this.disconnectListener); - subchannel.callRef(); - stream.on('response', (headers, flags) => { - let headersString = ''; - for (const header of Object.keys(headers)) { - headersString += '\t\t' + header + ': ' + headers[header] + '\n'; - } - this.trace('Received server headers:\n' + headersString); - switch (headers[':status']) { - // TODO(murgatroid99): handle 100 and 101 - case 400: - this.mappedStatusCode = Status.INTERNAL; - break; - case 401: - this.mappedStatusCode = Status.UNAUTHENTICATED; - break; - case 403: - this.mappedStatusCode = Status.PERMISSION_DENIED; - break; - case 404: - this.mappedStatusCode = Status.UNIMPLEMENTED; - break; - case 429: - case 502: - case 503: - case 504: - this.mappedStatusCode = Status.UNAVAILABLE; - break; - default: - this.mappedStatusCode = Status.UNKNOWN; - } - - if (flags & http2.constants.NGHTTP2_FLAG_END_STREAM) { - this.handleTrailers(headers); - } else { - let metadata: Metadata; - try { - metadata = Metadata.fromHttp2Headers(headers); - } catch (error) { - this.endCall({ - code: Status.UNKNOWN, - details: error.message, - metadata: new Metadata(), - }); - return; - } - try { - const finalMetadata = this.filterStack.receiveMetadata(metadata); - this.listener?.onReceiveMetadata(finalMetadata); - } catch (error) { - this.endCall({ - code: Status.UNKNOWN, - details: error.message, - metadata: new Metadata(), - }); - } - } - }); - stream.on('trailers', (headers: http2.IncomingHttpHeaders) => { - this.handleTrailers(headers); - }); - stream.on('data', (data: Buffer) => { - /* If the status has already been output, allow the http2 stream to - * drain without processing the data. */ - if (this.statusOutput) { - return; - } - this.trace('receive HTTP/2 data frame of length ' + data.length); - const messages = this.decoder.write(data); - - for (const message of messages) { - this.trace('parsed message of length ' + message.length); - this.callStatsTracker!.addMessageReceived(); - this.tryPush(message); - } - }); - stream.on('end', () => { - this.readsClosed = true; - this.maybeOutputStatus(); - }); - stream.on('close', () => { - /* Use process.next tick to ensure that this code happens after any - * "error" event that may be emitted at about the same time, so that - * we can bubble up the error message from that event. */ - process.nextTick(() => { - this.trace('HTTP/2 stream closed with code ' + stream.rstCode); - /* If we have a final status with an OK status code, that means that - * we have received all of the messages and we have processed the - * trailers and the call completed successfully, so it doesn't matter - * how the stream ends after that */ - if (this.finalStatus?.code === Status.OK) { - return; - } - let code: Status; - let details = ''; - switch (stream.rstCode) { - case http2.constants.NGHTTP2_NO_ERROR: - /* If we get a NO_ERROR code and we already have a status, the - * stream completed properly and we just haven't fully processed - * it yet */ - if (this.finalStatus !== null) { - return; - } - code = Status.INTERNAL; - details = `Received RST_STREAM with code ${stream.rstCode}`; - break; - case http2.constants.NGHTTP2_REFUSED_STREAM: - code = Status.UNAVAILABLE; - details = 'Stream refused by server'; - break; - case http2.constants.NGHTTP2_CANCEL: - code = Status.CANCELLED; - details = 'Call cancelled'; - break; - case http2.constants.NGHTTP2_ENHANCE_YOUR_CALM: - code = Status.RESOURCE_EXHAUSTED; - details = 'Bandwidth exhausted or memory limit exceeded'; - break; - case http2.constants.NGHTTP2_INADEQUATE_SECURITY: - code = Status.PERMISSION_DENIED; - details = 'Protocol not secure enough'; - break; - case http2.constants.NGHTTP2_INTERNAL_ERROR: - code = Status.INTERNAL; - if (this.internalError === null) { - /* This error code was previously handled in the default case, and - * there are several instances of it online, so I wanted to - * preserve the original error message so that people find existing - * information in searches, but also include the more recognizable - * "Internal server error" message. */ - details = `Received RST_STREAM with code ${stream.rstCode} (Internal server error)`; - } else { - if (this.internalError.code === 'ECONNRESET' || this.internalError.code === 'ETIMEDOUT') { - code = Status.UNAVAILABLE; - details = this.internalError.message; - } else { - /* The "Received RST_STREAM with code ..." error is preserved - * here for continuity with errors reported online, but the - * error message at the end will probably be more relevant in - * most cases. */ - details = `Received RST_STREAM with code ${stream.rstCode} triggered by internal client error: ${this.internalError.message}`; - } - } - break; - default: - code = Status.INTERNAL; - details = `Received RST_STREAM with code ${stream.rstCode}`; - } - // This is a no-op if trailers were received at all. - // This is OK, because status codes emitted here correspond to more - // catastrophic issues that prevent us from receiving trailers in the - // first place. - this.endCall({ code, details, metadata: new Metadata() }); - }); - }); - stream.on('error', (err: SystemError) => { - /* We need an error handler here to stop "Uncaught Error" exceptions - * from bubbling up. However, errors here should all correspond to - * "close" events, where we will handle the error more granularly */ - /* Specifically looking for stream errors that were *not* constructed - * from a RST_STREAM response here: - * https://github.com/nodejs/node/blob/8b8620d580314050175983402dfddf2674e8e22a/lib/internal/http2/core.js#L2267 - */ - if (err.code !== 'ERR_HTTP2_STREAM_ERROR') { - this.trace( - 'Node error event: message=' + - err.message + - ' code=' + - err.code + - ' errno=' + - getSystemErrorName(err.errno) + - ' syscall=' + - err.syscall - ); - this.internalError = err; - } - this.streamEndWatchers.forEach(watcher => watcher(false)); - }); - if (this.pendingWrite) { - if (!this.pendingWriteCallback) { - throw new Error('Invalid state in write handling code'); - } - this.trace( - 'sending data chunk of length ' + - this.pendingWrite.length + - ' (deferred)' - ); - try { - this.writeMessageToStream(this.pendingWrite, this.pendingWriteCallback); - } catch (error) { - this.endCall({ - code: Status.UNAVAILABLE, - details: `Write failed with error ${error.message}`, - metadata: new Metadata() - }); - } - } - this.maybeCloseWrites(); - } - } - - start(metadata: Metadata, listener: InterceptingListener) { - this.trace('Sending metadata'); - this.listener = listener; - this.channel._startCallStream(this, metadata); - this.maybeOutputStatus(); - } - - private destroyHttp2Stream() { - // The http2 stream could already have been destroyed if cancelWithStatus - // is called in response to an internal http2 error. - if (this.http2Stream !== null && !this.http2Stream.destroyed) { - /* If the call has ended with an OK status, communicate that when closing - * the stream, partly to avoid a situation in which we detect an error - * RST_STREAM as a result after we have the status */ - let code: number; - if (this.finalStatus?.code === Status.OK) { - code = http2.constants.NGHTTP2_NO_ERROR; - } else { - code = http2.constants.NGHTTP2_CANCEL; - } - this.trace('close http2 stream with code ' + code); - this.http2Stream.close(code); - } - } - - cancelWithStatus(status: Status, details: string): void { - this.trace( - 'cancelWithStatus code: ' + status + ' details: "' + details + '"' - ); - this.endCall({ code: status, details, metadata: new Metadata() }); - } - - getDeadline(): Deadline { - const deadlineList = [this.options.deadline]; - if (this.options.parentCall && this.options.flags & Propagate.DEADLINE) { - deadlineList.push(this.options.parentCall.getDeadline()); - } - if (this.configDeadline) { - deadlineList.push(this.configDeadline); - } - return getMinDeadline(deadlineList); - } - - getCredentials(): CallCredentials { - return this.credentials; - } - - setCredentials(credentials: CallCredentials): void { - this.credentials = this.channelCallCredentials.compose(credentials); - } - - getStatus(): StatusObject | null { - return this.finalStatus; - } - - getPeer(): string { - return this.subchannel?.getAddress() ?? this.channel.getTarget(); - } - - getMethod(): string { - return this.methodName; - } - - getHost(): string { - return this.options.host; - } - - setConfigDeadline(configDeadline: Deadline) { - this.configDeadline = configDeadline; - } - - addStatusWatcher(watcher: (status: StatusObject) => void) { - this.statusWatchers.push(watcher); - } - - addStreamEndWatcher(watcher: (success: boolean) => void) { - this.streamEndWatchers.push(watcher); - } - - addFilters(extraFilters: Filter[]) { - this.filterStack.push(extraFilters); - } - - getCallNumber() { - return this.callNumber; - } - - startRead() { - /* If the stream has ended with an error, we should not emit any more - * messages and we should communicate that the stream has ended */ - if (this.finalStatus !== null && this.finalStatus.code !== Status.OK) { - this.readsClosed = true; - this.maybeOutputStatus(); - return; - } - this.canPush = true; - if (this.http2Stream === null) { - this.pendingRead = true; - } else { - if (this.unpushedReadMessages.length > 0) { - const nextMessage: Buffer = this.unpushedReadMessages.shift()!; - this.push(nextMessage); - return; - } - /* Only resume reading from the http2Stream if we don't have any pending - * messages to emit */ - this.http2Stream.resume(); - } - } - - private maybeCloseWrites() { - if ( - this.writesClosed && - !this.isWriteFilterPending && - this.http2Stream !== null - ) { - this.trace('calling end() on HTTP/2 stream'); - this.http2Stream.end(); - } - } - - sendMessageWithContext(context: MessageContext, message: Buffer) { - this.trace('write() called with message of length ' + message.length); - const writeObj: WriteObject = { - message, - flags: context.flags, - }; - const cb: WriteCallback = (error?: Error | null) => { - let code: Status = Status.UNAVAILABLE; - if ((error as NodeJS.ErrnoException)?.code === 'ERR_STREAM_WRITE_AFTER_END') { - code = Status.INTERNAL; - } - if (error) { - this.cancelWithStatus(code, `Write error: ${error.message}`); - } - context.callback?.(); - }; - this.isWriteFilterPending = true; - this.filterStack.sendMessage(Promise.resolve(writeObj)).then((message) => { - this.isWriteFilterPending = false; - if (this.http2Stream === null) { - this.trace( - 'deferring writing data chunk of length ' + message.message.length - ); - this.pendingWrite = message.message; - this.pendingWriteCallback = cb; - } else { - this.trace('sending data chunk of length ' + message.message.length); - try { - this.writeMessageToStream(message.message, cb); - } catch (error) { - this.endCall({ - code: Status.UNAVAILABLE, - details: `Write failed with error ${error.message}`, - metadata: new Metadata() - }); - } - this.maybeCloseWrites(); - } - }, this.handleFilterError.bind(this)); - } - - halfClose() { - this.trace('end() called'); - this.writesClosed = true; - this.maybeCloseWrites(); - } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/call.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/call.ts deleted file mode 100644 index 10b606a4..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/call.ts +++ /dev/null @@ -1,195 +0,0 @@ -/* - * Copyright 2019 gRPC authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -import { EventEmitter } from 'events'; -import { Duplex, Readable, Writable } from 'stream'; - -import { StatusObject, MessageContext } from './call-stream'; -import { Status } from './constants'; -import { EmitterAugmentation1 } from './events'; -import { Metadata } from './metadata'; -import { ObjectReadable, ObjectWritable, WriteCallback } from './object-stream'; -import { InterceptingCallInterface } from './client-interceptors'; - -/** - * A type extending the built-in Error object with additional fields. - */ -export type ServiceError = StatusObject & Error; - -/** - * A base type for all user-facing values returned by client-side method calls. - */ -export type SurfaceCall = { - call?: InterceptingCallInterface; - cancel(): void; - getPeer(): string; -} & EmitterAugmentation1<'metadata', Metadata> & - EmitterAugmentation1<'status', StatusObject> & - EventEmitter; - -/** - * A type representing the return value of a unary method call. - */ -export type ClientUnaryCall = SurfaceCall; - -/** - * A type representing the return value of a server stream method call. - */ -export type ClientReadableStream = { - deserialize: (chunk: Buffer) => ResponseType; -} & SurfaceCall & - ObjectReadable; - -/** - * A type representing the return value of a client stream method call. - */ -export type ClientWritableStream = { - serialize: (value: RequestType) => Buffer; -} & SurfaceCall & - ObjectWritable; - -/** - * A type representing the return value of a bidirectional stream method call. - */ -export type ClientDuplexStream< - RequestType, - ResponseType -> = ClientWritableStream & ClientReadableStream; - -/** - * Construct a ServiceError from a StatusObject. This function exists primarily - * as an attempt to make the error stack trace clearly communicate that the - * error is not necessarily a problem in gRPC itself. - * @param status - */ -export function callErrorFromStatus(status: StatusObject, callerStack: string): ServiceError { - const message = `${status.code} ${Status[status.code]}: ${status.details}`; - const error = new Error(message); - const stack = `${error.stack}\nfor call at\n${callerStack}`; - return Object.assign(new Error(message), status, {stack}); -} - -export class ClientUnaryCallImpl - extends EventEmitter - implements ClientUnaryCall { - public call?: InterceptingCallInterface; - constructor() { - super(); - } - - cancel(): void { - this.call?.cancelWithStatus(Status.CANCELLED, 'Cancelled on client'); - } - - getPeer(): string { - return this.call?.getPeer() ?? 'unknown'; - } -} - -export class ClientReadableStreamImpl - extends Readable - implements ClientReadableStream { - public call?: InterceptingCallInterface; - constructor(readonly deserialize: (chunk: Buffer) => ResponseType) { - super({ objectMode: true }); - } - - cancel(): void { - this.call?.cancelWithStatus(Status.CANCELLED, 'Cancelled on client'); - } - - getPeer(): string { - return this.call?.getPeer() ?? 'unknown'; - } - - _read(_size: number): void { - this.call?.startRead(); - } -} - -export class ClientWritableStreamImpl - extends Writable - implements ClientWritableStream { - public call?: InterceptingCallInterface; - constructor(readonly serialize: (value: RequestType) => Buffer) { - super({ objectMode: true }); - } - - cancel(): void { - this.call?.cancelWithStatus(Status.CANCELLED, 'Cancelled on client'); - } - - getPeer(): string { - return this.call?.getPeer() ?? 'unknown'; - } - - _write(chunk: RequestType, encoding: string, cb: WriteCallback) { - const context: MessageContext = { - callback: cb, - }; - const flags = Number(encoding); - if (!Number.isNaN(flags)) { - context.flags = flags; - } - this.call?.sendMessageWithContext(context, chunk); - } - - _final(cb: Function) { - this.call?.halfClose(); - cb(); - } -} - -export class ClientDuplexStreamImpl - extends Duplex - implements ClientDuplexStream { - public call?: InterceptingCallInterface; - constructor( - readonly serialize: (value: RequestType) => Buffer, - readonly deserialize: (chunk: Buffer) => ResponseType - ) { - super({ objectMode: true }); - } - - cancel(): void { - this.call?.cancelWithStatus(Status.CANCELLED, 'Cancelled on client'); - } - - getPeer(): string { - return this.call?.getPeer() ?? 'unknown'; - } - - _read(_size: number): void { - this.call?.startRead(); - } - - _write(chunk: RequestType, encoding: string, cb: WriteCallback) { - const context: MessageContext = { - callback: cb, - }; - const flags = Number(encoding); - if (!Number.isNaN(flags)) { - context.flags = flags; - } - this.call?.sendMessageWithContext(context, chunk); - } - - _final(cb: Function) { - this.call?.halfClose(); - cb(); - } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/channel-credentials.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/channel-credentials.ts deleted file mode 100644 index fd9d7b57..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/channel-credentials.ts +++ /dev/null @@ -1,273 +0,0 @@ -/* - * Copyright 2019 gRPC authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -import { ConnectionOptions, createSecureContext, PeerCertificate, SecureContext } from 'tls'; - -import { CallCredentials } from './call-credentials'; -import { CIPHER_SUITES, getDefaultRootsData } from './tls-helpers'; - -// eslint-disable-next-line @typescript-eslint/no-explicit-any -function verifyIsBufferOrNull(obj: any, friendlyName: string): void { - if (obj && !(obj instanceof Buffer)) { - throw new TypeError(`${friendlyName}, if provided, must be a Buffer.`); - } -} - -/** - * A callback that will receive the expected hostname and presented peer - * certificate as parameters. The callback should return an error to - * indicate that the presented certificate is considered invalid and - * otherwise returned undefined. - */ -export type CheckServerIdentityCallback = ( - hostname: string, - cert: PeerCertificate -) => Error | undefined; - -function bufferOrNullEqual(buf1: Buffer | null, buf2: Buffer | null) { - if (buf1 === null && buf2 === null) { - return true; - } else { - return buf1 !== null && buf2 !== null && buf1.equals(buf2); - } -} - -/** - * Additional peer verification options that can be set when creating - * SSL credentials. - */ -export interface VerifyOptions { - /** - * If set, this callback will be invoked after the usual hostname verification - * has been performed on the peer certificate. - */ - checkServerIdentity?: CheckServerIdentityCallback; -} - -/** - * A class that contains credentials for communicating over a channel, as well - * as a set of per-call credentials, which are applied to every method call made - * over a channel initialized with an instance of this class. - */ -export abstract class ChannelCredentials { - protected callCredentials: CallCredentials; - - protected constructor(callCredentials?: CallCredentials) { - this.callCredentials = callCredentials || CallCredentials.createEmpty(); - } - /** - * Returns a copy of this object with the included set of per-call credentials - * expanded to include callCredentials. - * @param callCredentials A CallCredentials object to associate with this - * instance. - */ - abstract compose(callCredentials: CallCredentials): ChannelCredentials; - - /** - * Gets the set of per-call credentials associated with this instance. - */ - _getCallCredentials(): CallCredentials { - return this.callCredentials; - } - - /** - * Gets a SecureContext object generated from input parameters if this - * instance was created with createSsl, or null if this instance was created - * with createInsecure. - */ - abstract _getConnectionOptions(): ConnectionOptions | null; - - /** - * Indicates whether this credentials object creates a secure channel. - */ - abstract _isSecure(): boolean; - - /** - * Check whether two channel credentials objects are equal. Two secure - * credentials are equal if they were constructed with the same parameters. - * @param other The other ChannelCredentials Object - */ - abstract _equals(other: ChannelCredentials): boolean; - - /** - * Return a new ChannelCredentials instance with a given set of credentials. - * The resulting instance can be used to construct a Channel that communicates - * over TLS. - * @param rootCerts The root certificate data. - * @param privateKey The client certificate private key, if available. - * @param certChain The client certificate key chain, if available. - * @param verifyOptions Additional options to modify certificate verification - */ - static createSsl( - rootCerts?: Buffer | null, - privateKey?: Buffer | null, - certChain?: Buffer | null, - verifyOptions?: VerifyOptions - ): ChannelCredentials { - verifyIsBufferOrNull(rootCerts, 'Root certificate'); - verifyIsBufferOrNull(privateKey, 'Private key'); - verifyIsBufferOrNull(certChain, 'Certificate chain'); - if (privateKey && !certChain) { - throw new Error( - 'Private key must be given with accompanying certificate chain' - ); - } - if (!privateKey && certChain) { - throw new Error( - 'Certificate chain must be given with accompanying private key' - ); - } - const secureContext = createSecureContext({ - ca: rootCerts ?? getDefaultRootsData() ?? undefined, - key: privateKey ?? undefined, - cert: certChain ?? undefined, - ciphers: CIPHER_SUITES, - }); - return new SecureChannelCredentialsImpl( - secureContext, - verifyOptions ?? {} - ); - } - - /** - * Return a new ChannelCredentials instance with credentials created using - * the provided secureContext. The resulting instances can be used to - * construct a Channel that communicates over TLS. gRPC will not override - * anything in the provided secureContext, so the environment variables - * GRPC_SSL_CIPHER_SUITES and GRPC_DEFAULT_SSL_ROOTS_FILE_PATH will - * not be applied. - * @param secureContext The return value of tls.createSecureContext() - * @param verifyOptions Additional options to modify certificate verification - */ - static createFromSecureContext(secureContext: SecureContext, verifyOptions?: VerifyOptions): ChannelCredentials { - return new SecureChannelCredentialsImpl( - secureContext, - verifyOptions ?? {} - ) - } - - /** - * Return a new ChannelCredentials instance with no credentials. - */ - static createInsecure(): ChannelCredentials { - return new InsecureChannelCredentialsImpl(); - } -} - -class InsecureChannelCredentialsImpl extends ChannelCredentials { - constructor(callCredentials?: CallCredentials) { - super(callCredentials); - } - - compose(callCredentials: CallCredentials): never { - throw new Error('Cannot compose insecure credentials'); - } - - _getConnectionOptions(): ConnectionOptions | null { - return null; - } - _isSecure(): boolean { - return false; - } - _equals(other: ChannelCredentials): boolean { - return other instanceof InsecureChannelCredentialsImpl; - } -} - -class SecureChannelCredentialsImpl extends ChannelCredentials { - connectionOptions: ConnectionOptions; - - constructor( - private secureContext: SecureContext, - private verifyOptions: VerifyOptions - ) { - super(); - this.connectionOptions = { - secureContext - }; - // Node asserts that this option is a function, so we cannot pass undefined - if (verifyOptions?.checkServerIdentity) { - this.connectionOptions.checkServerIdentity = verifyOptions.checkServerIdentity; - } - } - - compose(callCredentials: CallCredentials): ChannelCredentials { - const combinedCallCredentials = this.callCredentials.compose( - callCredentials - ); - return new ComposedChannelCredentialsImpl(this, combinedCallCredentials); - } - - _getConnectionOptions(): ConnectionOptions | null { - // Copy to prevent callers from mutating this.connectionOptions - return { ...this.connectionOptions }; - } - _isSecure(): boolean { - return true; - } - _equals(other: ChannelCredentials): boolean { - if (this === other) { - return true; - } - if (other instanceof SecureChannelCredentialsImpl) { - return ( - this.secureContext === other.secureContext && - this.verifyOptions.checkServerIdentity === other.verifyOptions.checkServerIdentity - ); - } else { - return false; - } - } -} - -class ComposedChannelCredentialsImpl extends ChannelCredentials { - constructor( - private channelCredentials: SecureChannelCredentialsImpl, - callCreds: CallCredentials - ) { - super(callCreds); - } - compose(callCredentials: CallCredentials) { - const combinedCallCredentials = this.callCredentials.compose( - callCredentials - ); - return new ComposedChannelCredentialsImpl( - this.channelCredentials, - combinedCallCredentials - ); - } - - _getConnectionOptions(): ConnectionOptions | null { - return this.channelCredentials._getConnectionOptions(); - } - _isSecure(): boolean { - return true; - } - _equals(other: ChannelCredentials): boolean { - if (this === other) { - return true; - } - if (other instanceof ComposedChannelCredentialsImpl) { - return ( - this.channelCredentials._equals(other.channelCredentials) && - this.callCredentials._equals(other.callCredentials) - ); - } else { - return false; - } - } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/channel-options.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/channel-options.ts deleted file mode 100644 index b7fc92fa..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/channel-options.ts +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Copyright 2019 gRPC authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -import { CompressionAlgorithms } from './compression-algorithms'; - -/** - * An interface that contains options used when initializing a Channel instance. - */ -export interface ChannelOptions { - 'grpc.ssl_target_name_override'?: string; - 'grpc.primary_user_agent'?: string; - 'grpc.secondary_user_agent'?: string; - 'grpc.default_authority'?: string; - 'grpc.keepalive_time_ms'?: number; - 'grpc.keepalive_timeout_ms'?: number; - 'grpc.keepalive_permit_without_calls'?: number; - 'grpc.service_config'?: string; - 'grpc.max_concurrent_streams'?: number; - 'grpc.initial_reconnect_backoff_ms'?: number; - 'grpc.max_reconnect_backoff_ms'?: number; - 'grpc.use_local_subchannel_pool'?: number; - 'grpc.max_send_message_length'?: number; - 'grpc.max_receive_message_length'?: number; - 'grpc.enable_http_proxy'?: number; - /* http_connect_target and http_connect_creds are used for passing data - * around internally, and should not be documented as public-facing options - */ - 'grpc.http_connect_target'?: string; - 'grpc.http_connect_creds'?: string; - 'grpc.default_compression_algorithm'?: CompressionAlgorithms; - 'grpc.enable_channelz'?: number; - 'grpc.dns_min_time_between_resolutions_ms'?: number; - 'grpc-node.max_session_memory'?: number; - // eslint-disable-next-line @typescript-eslint/no-explicit-any - [key: string]: any; -} - -/** - * This is for checking provided options at runtime. This is an object for - * easier membership checking. - */ -export const recognizedOptions = { - 'grpc.ssl_target_name_override': true, - 'grpc.primary_user_agent': true, - 'grpc.secondary_user_agent': true, - 'grpc.default_authority': true, - 'grpc.keepalive_time_ms': true, - 'grpc.keepalive_timeout_ms': true, - 'grpc.keepalive_permit_without_calls': true, - 'grpc.service_config': true, - 'grpc.max_concurrent_streams': true, - 'grpc.initial_reconnect_backoff_ms': true, - 'grpc.max_reconnect_backoff_ms': true, - 'grpc.use_local_subchannel_pool': true, - 'grpc.max_send_message_length': true, - 'grpc.max_receive_message_length': true, - 'grpc.enable_http_proxy': true, - 'grpc.enable_channelz': true, - 'grpc.dns_min_time_between_resolutions_ms': true, - 'grpc-node.max_session_memory': true, -}; - -export function channelOptionsEqual( - options1: ChannelOptions, - options2: ChannelOptions -) { - const keys1 = Object.keys(options1).sort(); - const keys2 = Object.keys(options2).sort(); - if (keys1.length !== keys2.length) { - return false; - } - for (let i = 0; i < keys1.length; i += 1) { - if (keys1[i] !== keys2[i]) { - return false; - } - if (options1[keys1[i]] !== options2[keys2[i]]) { - return false; - } - } - return true; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/channel.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/channel.ts deleted file mode 100644 index 93b2204c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/channel.ts +++ /dev/null @@ -1,820 +0,0 @@ -/* - * Copyright 2019 gRPC authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -import { - Deadline, - Call, - Http2CallStream, - CallStreamOptions, - StatusObject, -} from './call-stream'; -import { ChannelCredentials } from './channel-credentials'; -import { ChannelOptions } from './channel-options'; -import { ResolvingLoadBalancer } from './resolving-load-balancer'; -import { SubchannelPool, getSubchannelPool } from './subchannel-pool'; -import { ChannelControlHelper } from './load-balancer'; -import { UnavailablePicker, Picker, PickResultType } from './picker'; -import { Metadata } from './metadata'; -import { Status, LogVerbosity, Propagate } from './constants'; -import { FilterStackFactory } from './filter-stack'; -import { CallCredentialsFilterFactory } from './call-credentials-filter'; -import { DeadlineFilterFactory } from './deadline-filter'; -import { CompressionFilterFactory } from './compression-filter'; -import { - CallConfig, - ConfigSelector, - getDefaultAuthority, - mapUriDefaultScheme, -} from './resolver'; -import { trace, log } from './logging'; -import { SubchannelAddress } from './subchannel-address'; -import { MaxMessageSizeFilterFactory } from './max-message-size-filter'; -import { mapProxyName } from './http_proxy'; -import { GrpcUri, parseUri, uriToString } from './uri-parser'; -import { ServerSurfaceCall } from './server-call'; -import { Filter } from './filter'; - -import { ConnectivityState } from './connectivity-state'; -import { ChannelInfo, ChannelRef, ChannelzCallTracker, ChannelzChildrenTracker, ChannelzTrace, registerChannelzChannel, SubchannelRef, unregisterChannelzRef } from './channelz'; -import { Subchannel } from './subchannel'; - -/** - * See https://nodejs.org/api/timers.html#timers_setinterval_callback_delay_args - */ -const MAX_TIMEOUT_TIME = 2147483647; - -let nextCallNumber = 0; - -function getNewCallNumber(): number { - const callNumber = nextCallNumber; - nextCallNumber += 1; - if (nextCallNumber >= Number.MAX_SAFE_INTEGER) { - nextCallNumber = 0; - } - return callNumber; -} - -const INAPPROPRIATE_CONTROL_PLANE_CODES: Status[] = [ - Status.OK, - Status.INVALID_ARGUMENT, - Status.NOT_FOUND, - Status.ALREADY_EXISTS, - Status.FAILED_PRECONDITION, - Status.ABORTED, - Status.OUT_OF_RANGE, - Status.DATA_LOSS -] - -function restrictControlPlaneStatusCode(code: Status, details: string): {code: Status, details: string} { - if (INAPPROPRIATE_CONTROL_PLANE_CODES.includes(code)) { - return { - code: Status.INTERNAL, - details: `Invalid status from control plane: ${code} ${Status[code]} ${details}` - } - } else { - return {code, details}; - } -} - -/** - * An interface that represents a communication channel to a server specified - * by a given address. - */ -export interface Channel { - /** - * Close the channel. This has the same functionality as the existing - * grpc.Client.prototype.close - */ - close(): void; - /** - * Return the target that this channel connects to - */ - getTarget(): string; - /** - * Get the channel's current connectivity state. This method is here mainly - * because it is in the existing internal Channel class, and there isn't - * another good place to put it. - * @param tryToConnect If true, the channel will start connecting if it is - * idle. Otherwise, idle channels will only start connecting when a - * call starts. - */ - getConnectivityState(tryToConnect: boolean): ConnectivityState; - /** - * Watch for connectivity state changes. This is also here mainly because - * it is in the existing external Channel class. - * @param currentState The state to watch for transitions from. This should - * always be populated by calling getConnectivityState immediately - * before. - * @param deadline A deadline for waiting for a state change - * @param callback Called with no error when a state change, or with an - * error if the deadline passes without a state change. - */ - watchConnectivityState( - currentState: ConnectivityState, - deadline: Date | number, - callback: (error?: Error) => void - ): void; - /** - * Get the channelz reference object for this channel. A request to the - * channelz service for the id in this object will provide information - * about this channel. - */ - getChannelzRef(): ChannelRef; - /** - * Create a call object. Call is an opaque type that is used by the Client - * class. This function is called by the gRPC library when starting a - * request. Implementers should return an instance of Call that is returned - * from calling createCall on an instance of the provided Channel class. - * @param method The full method string to request. - * @param deadline The call deadline - * @param host A host string override for making the request - * @param parentCall A server call to propagate some information from - * @param propagateFlags A bitwise combination of elements of grpc.propagate - * that indicates what information to propagate from parentCall. - */ - createCall( - method: string, - deadline: Deadline, - host: string | null | undefined, - parentCall: ServerSurfaceCall | null, - propagateFlags: number | null | undefined - ): Call; -} - -interface ConnectivityStateWatcher { - currentState: ConnectivityState; - timer: NodeJS.Timeout | null; - callback: (error?: Error) => void; -} - -export class ChannelImplementation implements Channel { - private resolvingLoadBalancer: ResolvingLoadBalancer; - private subchannelPool: SubchannelPool; - private connectivityState: ConnectivityState = ConnectivityState.IDLE; - private currentPicker: Picker = new UnavailablePicker(); - /** - * Calls queued up to get a call config. Should only be populated before the - * first time the resolver returns a result, which includes the ConfigSelector. - */ - private configSelectionQueue: Array<{ - callStream: Http2CallStream; - callMetadata: Metadata; - }> = []; - private pickQueue: Array<{ - callStream: Http2CallStream; - callMetadata: Metadata; - callConfig: CallConfig; - dynamicFilters: Filter[]; - }> = []; - private connectivityStateWatchers: ConnectivityStateWatcher[] = []; - private defaultAuthority: string; - private filterStackFactory: FilterStackFactory; - private target: GrpcUri; - /** - * This timer does not do anything on its own. Its purpose is to hold the - * event loop open while there are any pending calls for the channel that - * have not yet been assigned to specific subchannels. In other words, - * the invariant is that callRefTimer is reffed if and only if pickQueue - * is non-empty. - */ - private callRefTimer: NodeJS.Timer; - private configSelector: ConfigSelector | null = null; - /** - * This is the error from the name resolver if it failed most recently. It - * is only used to end calls that start while there is no config selector - * and the name resolver is in backoff, so it should be nulled if - * configSelector becomes set or the channel state becomes anything other - * than TRANSIENT_FAILURE. - */ - private currentResolutionError: StatusObject | null = null; - - // Channelz info - private readonly channelzEnabled: boolean = true; - private originalTarget: string; - private channelzRef: ChannelRef; - private channelzTrace: ChannelzTrace; - private callTracker = new ChannelzCallTracker(); - private childrenTracker = new ChannelzChildrenTracker(); - - constructor( - target: string, - private readonly credentials: ChannelCredentials, - private readonly options: ChannelOptions - ) { - if (typeof target !== 'string') { - throw new TypeError('Channel target must be a string'); - } - if (!(credentials instanceof ChannelCredentials)) { - throw new TypeError( - 'Channel credentials must be a ChannelCredentials object' - ); - } - if (options) { - if (typeof options !== 'object') { - throw new TypeError('Channel options must be an object'); - } - } - this.originalTarget = target; - const originalTargetUri = parseUri(target); - if (originalTargetUri === null) { - throw new Error(`Could not parse target name "${target}"`); - } - /* This ensures that the target has a scheme that is registered with the - * resolver */ - const defaultSchemeMapResult = mapUriDefaultScheme(originalTargetUri); - if (defaultSchemeMapResult === null) { - throw new Error( - `Could not find a default scheme for target name "${target}"` - ); - } - - this.callRefTimer = setInterval(() => {}, MAX_TIMEOUT_TIME); - this.callRefTimer.unref?.(); - - if (this.options['grpc.enable_channelz'] === 0) { - this.channelzEnabled = false; - } - - this.channelzTrace = new ChannelzTrace(); - this.channelzRef = registerChannelzChannel(target, () => this.getChannelzInfo(), this.channelzEnabled); - if (this.channelzEnabled) { - this.channelzTrace.addTrace('CT_INFO', 'Channel created'); - } - - if (this.options['grpc.default_authority']) { - this.defaultAuthority = this.options['grpc.default_authority'] as string; - } else { - this.defaultAuthority = getDefaultAuthority(defaultSchemeMapResult); - } - const proxyMapResult = mapProxyName(defaultSchemeMapResult, options); - this.target = proxyMapResult.target; - this.options = Object.assign({}, this.options, proxyMapResult.extraOptions); - - /* The global boolean parameter to getSubchannelPool has the inverse meaning to what - * the grpc.use_local_subchannel_pool channel option means. */ - this.subchannelPool = getSubchannelPool( - (options['grpc.use_local_subchannel_pool'] ?? 0) === 0 - ); - const channelControlHelper: ChannelControlHelper = { - createSubchannel: ( - subchannelAddress: SubchannelAddress, - subchannelArgs: ChannelOptions - ) => { - const subchannel = this.subchannelPool.getOrCreateSubchannel( - this.target, - subchannelAddress, - Object.assign({}, this.options, subchannelArgs), - this.credentials - ); - if (this.channelzEnabled) { - this.channelzTrace.addTrace('CT_INFO', 'Created subchannel or used existing subchannel', subchannel.getChannelzRef()); - } - return subchannel; - }, - updateState: (connectivityState: ConnectivityState, picker: Picker) => { - this.currentPicker = picker; - const queueCopy = this.pickQueue.slice(); - this.pickQueue = []; - this.callRefTimerUnref(); - for (const { callStream, callMetadata, callConfig, dynamicFilters } of queueCopy) { - this.tryPick(callStream, callMetadata, callConfig, dynamicFilters); - } - this.updateState(connectivityState); - }, - requestReresolution: () => { - // This should never be called. - throw new Error( - 'Resolving load balancer should never call requestReresolution' - ); - }, - addChannelzChild: (child: ChannelRef | SubchannelRef) => { - if (this.channelzEnabled) { - this.childrenTracker.refChild(child); - } - }, - removeChannelzChild: (child: ChannelRef | SubchannelRef) => { - if (this.channelzEnabled) { - this.childrenTracker.unrefChild(child); - } - } - }; - this.resolvingLoadBalancer = new ResolvingLoadBalancer( - this.target, - channelControlHelper, - options, - (configSelector) => { - if (this.channelzEnabled) { - this.channelzTrace.addTrace('CT_INFO', 'Address resolution succeeded'); - } - this.configSelector = configSelector; - this.currentResolutionError = null; - /* We process the queue asynchronously to ensure that the corresponding - * load balancer update has completed. */ - process.nextTick(() => { - const localQueue = this.configSelectionQueue; - this.configSelectionQueue = []; - this.callRefTimerUnref(); - for (const { callStream, callMetadata } of localQueue) { - this.tryGetConfig(callStream, callMetadata); - } - this.configSelectionQueue = []; - }); - }, - (status) => { - if (this.channelzEnabled) { - this.channelzTrace.addTrace('CT_WARNING', 'Address resolution failed with code ' + status.code + ' and details "' + status.details + '"'); - } - if (this.configSelectionQueue.length > 0) { - this.trace('Name resolution failed with calls queued for config selection'); - } - if (this.configSelector === null) { - this.currentResolutionError = {...restrictControlPlaneStatusCode(status.code, status.details), metadata: status.metadata}; - } - const localQueue = this.configSelectionQueue; - this.configSelectionQueue = []; - this.callRefTimerUnref(); - for (const { callStream, callMetadata } of localQueue) { - if (callMetadata.getOptions().waitForReady) { - this.callRefTimerRef(); - this.configSelectionQueue.push({ callStream, callMetadata }); - } else { - callStream.cancelWithStatus(status.code, status.details); - } - } - } - ); - this.filterStackFactory = new FilterStackFactory([ - new CallCredentialsFilterFactory(this), - new DeadlineFilterFactory(this), - new MaxMessageSizeFilterFactory(this.options), - new CompressionFilterFactory(this, this.options), - ]); - this.trace('Channel constructed with options ' + JSON.stringify(options, undefined, 2)); - const error = new Error(); - trace(LogVerbosity.DEBUG, 'channel_stacktrace', '(' + this.channelzRef.id + ') ' + 'Channel constructed \n' + error.stack?.substring(error.stack.indexOf('\n')+1)); - } - - private getChannelzInfo(): ChannelInfo { - return { - target: this.originalTarget, - state: this.connectivityState, - trace: this.channelzTrace, - callTracker: this.callTracker, - children: this.childrenTracker.getChildLists() - }; - } - - private trace(text: string, verbosityOverride?: LogVerbosity) { - trace(verbosityOverride ?? LogVerbosity.DEBUG, 'channel', '(' + this.channelzRef.id + ') ' + uriToString(this.target) + ' ' + text); - } - - private callRefTimerRef() { - // If the hasRef function does not exist, always run the code - if (!this.callRefTimer.hasRef?.()) { - this.trace( - 'callRefTimer.ref | configSelectionQueue.length=' + - this.configSelectionQueue.length + - ' pickQueue.length=' + - this.pickQueue.length - ); - this.callRefTimer.ref?.(); - } - } - - private callRefTimerUnref() { - // If the hasRef function does not exist, always run the code - if (!this.callRefTimer.hasRef || this.callRefTimer.hasRef()) { - this.trace( - 'callRefTimer.unref | configSelectionQueue.length=' + - this.configSelectionQueue.length + - ' pickQueue.length=' + - this.pickQueue.length - ); - this.callRefTimer.unref?.(); - } - } - - private pushPick( - callStream: Http2CallStream, - callMetadata: Metadata, - callConfig: CallConfig, - dynamicFilters: Filter[] - ) { - this.pickQueue.push({ callStream, callMetadata, callConfig, dynamicFilters }); - this.callRefTimerRef(); - } - - /** - * Check the picker output for the given call and corresponding metadata, - * and take any relevant actions. Should not be called while iterating - * over pickQueue. - * @param callStream - * @param callMetadata - */ - private tryPick( - callStream: Http2CallStream, - callMetadata: Metadata, - callConfig: CallConfig, - dynamicFilters: Filter[] - ) { - const pickResult = this.currentPicker.pick({ - metadata: callMetadata, - extraPickInfo: callConfig.pickInformation, - }); - const subchannelString = pickResult.subchannel ? - '(' + pickResult.subchannel.getChannelzRef().id + ') ' + pickResult.subchannel.getAddress() : - '' + pickResult.subchannel; - this.trace( - 'Pick result for call [' + - callStream.getCallNumber() + - ']: ' + - PickResultType[pickResult.pickResultType] + - ' subchannel: ' + - subchannelString + - ' status: ' + - pickResult.status?.code + - ' ' + - pickResult.status?.details - ); - switch (pickResult.pickResultType) { - case PickResultType.COMPLETE: - if (pickResult.subchannel === null) { - callStream.cancelWithStatus( - Status.UNAVAILABLE, - 'Request dropped by load balancing policy' - ); - // End the call with an error - } else { - /* If the subchannel is not in the READY state, that indicates a bug - * somewhere in the load balancer or picker. So, we log an error and - * queue the pick to be tried again later. */ - if ( - pickResult.subchannel!.getConnectivityState() !== - ConnectivityState.READY - ) { - log( - LogVerbosity.ERROR, - 'Error: COMPLETE pick result subchannel ' + - subchannelString + - ' has state ' + - ConnectivityState[pickResult.subchannel!.getConnectivityState()] - ); - this.pushPick(callStream, callMetadata, callConfig, dynamicFilters); - break; - } - /* We need to clone the callMetadata here because the transparent - * retry code in the promise resolution handler use the same - * callMetadata object, so it needs to stay unmodified */ - callStream.filterStack - .sendMetadata(Promise.resolve(callMetadata.clone())) - .then( - (finalMetadata) => { - const subchannelState: ConnectivityState = pickResult.subchannel!.getConnectivityState(); - if (subchannelState === ConnectivityState.READY) { - try { - const pickExtraFilters = pickResult.extraFilterFactories.map(factory => factory.createFilter(callStream)); - pickResult.subchannel?.getRealSubchannel().startCallStream( - finalMetadata, - callStream, - [...dynamicFilters, ...pickExtraFilters] - ); - /* If we reach this point, the call stream has started - * successfully */ - callConfig.onCommitted?.(); - pickResult.onCallStarted?.(); - } catch (error) { - const errorCode = (error as NodeJS.ErrnoException).code; - if (errorCode === 'ERR_HTTP2_GOAWAY_SESSION' || - errorCode === 'ERR_HTTP2_INVALID_SESSION' - ) { - /* An error here indicates that something went wrong with - * the picked subchannel's http2 stream right before we - * tried to start the stream. We are handling a promise - * result here, so this is asynchronous with respect to the - * original tryPick call, so calling it again is not - * recursive. We call tryPick immediately instead of - * queueing this pick again because handling the queue is - * triggered by state changes, and we want to immediately - * check if the state has already changed since the - * previous tryPick call. We do this instead of cancelling - * the stream because the correct behavior may be - * re-queueing instead, based on the logic in the rest of - * tryPick */ - this.trace( - 'Failed to start call on picked subchannel ' + - subchannelString + - ' with error ' + - (error as Error).message + - '. Retrying pick', - LogVerbosity.INFO - ); - this.tryPick(callStream, callMetadata, callConfig, dynamicFilters); - } else { - this.trace( - 'Failed to start call on picked subchanel ' + - subchannelString + - ' with error ' + - (error as Error).message + - '. Ending call', - LogVerbosity.INFO - ); - callStream.cancelWithStatus( - Status.INTERNAL, - `Failed to start HTTP/2 stream with error: ${ - (error as Error).message - }` - ); - } - } - } else { - /* The logic for doing this here is the same as in the catch - * block above */ - this.trace( - 'Picked subchannel ' + - subchannelString + - ' has state ' + - ConnectivityState[subchannelState] + - ' after metadata filters. Retrying pick', - LogVerbosity.INFO - ); - this.tryPick(callStream, callMetadata, callConfig, dynamicFilters); - } - }, - (error: Error & { code: number }) => { - // We assume the error code isn't 0 (Status.OK) - const {code, details} = restrictControlPlaneStatusCode( - typeof error.code === 'number' ? error.code : Status.UNKNOWN, - `Getting metadata from plugin failed with error: ${error.message}` - ) - callStream.cancelWithStatus(code, details); - } - ); - } - break; - case PickResultType.QUEUE: - this.pushPick(callStream, callMetadata, callConfig, dynamicFilters); - break; - case PickResultType.TRANSIENT_FAILURE: - if (callMetadata.getOptions().waitForReady) { - this.pushPick(callStream, callMetadata, callConfig, dynamicFilters); - } else { - const {code, details} = restrictControlPlaneStatusCode(pickResult.status!.code, pickResult.status!.details); - callStream.cancelWithStatus(code, details); - } - break; - case PickResultType.DROP: - const {code, details} = restrictControlPlaneStatusCode(pickResult.status!.code, pickResult.status!.details); - callStream.cancelWithStatus(code, details); - break; - default: - throw new Error( - `Invalid state: unknown pickResultType ${pickResult.pickResultType}` - ); - } - } - - private removeConnectivityStateWatcher( - watcherObject: ConnectivityStateWatcher - ) { - const watcherIndex = this.connectivityStateWatchers.findIndex( - (value) => value === watcherObject - ); - if (watcherIndex >= 0) { - this.connectivityStateWatchers.splice(watcherIndex, 1); - } - } - - private updateState(newState: ConnectivityState): void { - trace( - LogVerbosity.DEBUG, - 'connectivity_state', - '(' + this.channelzRef.id + ') ' + - uriToString(this.target) + - ' ' + - ConnectivityState[this.connectivityState] + - ' -> ' + - ConnectivityState[newState] - ); - if (this.channelzEnabled) { - this.channelzTrace.addTrace('CT_INFO', ConnectivityState[this.connectivityState] + ' -> ' + ConnectivityState[newState]); - } - this.connectivityState = newState; - const watchersCopy = this.connectivityStateWatchers.slice(); - for (const watcherObject of watchersCopy) { - if (newState !== watcherObject.currentState) { - if (watcherObject.timer) { - clearTimeout(watcherObject.timer); - } - this.removeConnectivityStateWatcher(watcherObject); - watcherObject.callback(); - } - } - if (newState !== ConnectivityState.TRANSIENT_FAILURE) { - this.currentResolutionError = null; - } - } - - private tryGetConfig(stream: Http2CallStream, metadata: Metadata) { - if (stream.getStatus() !== null) { - /* If the stream has a status, it has already finished and we don't need - * to take any more actions on it. */ - return; - } - if (this.configSelector === null) { - /* This branch will only be taken at the beginning of the channel's life, - * before the resolver ever returns a result. So, the - * ResolvingLoadBalancer may be idle and if so it needs to be kicked - * because it now has a pending request. */ - this.resolvingLoadBalancer.exitIdle(); - if (this.currentResolutionError && !metadata.getOptions().waitForReady) { - stream.cancelWithStatus(this.currentResolutionError.code, this.currentResolutionError.details); - } else { - this.configSelectionQueue.push({ - callStream: stream, - callMetadata: metadata, - }); - this.callRefTimerRef(); - } - } else { - const callConfig = this.configSelector(stream.getMethod(), metadata); - if (callConfig.status === Status.OK) { - if (callConfig.methodConfig.timeout) { - const deadline = new Date(); - deadline.setSeconds( - deadline.getSeconds() + callConfig.methodConfig.timeout.seconds - ); - deadline.setMilliseconds( - deadline.getMilliseconds() + - callConfig.methodConfig.timeout.nanos / 1_000_000 - ); - stream.setConfigDeadline(deadline); - // Refreshing the filters makes the deadline filter pick up the new deadline - stream.filterStack.refresh(); - } - if (callConfig.dynamicFilterFactories.length > 0) { - /* These dynamicFilters are the mechanism for implementing gRFC A39: - * https://github.com/grpc/proposal/blob/master/A39-xds-http-filters.md - * We run them here instead of with the rest of the filters because - * that spec says "the xDS HTTP filters will run in between name - * resolution and load balancing". - * - * We use the filter stack here to simplify the multi-filter async - * waterfall logic, but we pass along the underlying list of filters - * to avoid having nested filter stacks when combining it with the - * original filter stack. We do not pass along the original filter - * factory list because these filters may need to persist data - * between sending headers and other operations. */ - const dynamicFilterStackFactory = new FilterStackFactory(callConfig.dynamicFilterFactories); - const dynamicFilterStack = dynamicFilterStackFactory.createFilter(stream); - dynamicFilterStack.sendMetadata(Promise.resolve(metadata)).then(filteredMetadata => { - this.tryPick(stream, filteredMetadata, callConfig, dynamicFilterStack.getFilters()); - }); - } else { - this.tryPick(stream, metadata, callConfig, []); - } - } else { - const {code, details} = restrictControlPlaneStatusCode(callConfig.status, 'Failed to route call to method ' + stream.getMethod()); - stream.cancelWithStatus(code, details); - } - } - } - - _startCallStream(stream: Http2CallStream, metadata: Metadata) { - this.tryGetConfig(stream, metadata.clone()); - } - - close() { - this.resolvingLoadBalancer.destroy(); - this.updateState(ConnectivityState.SHUTDOWN); - clearInterval(this.callRefTimer); - if (this.channelzEnabled) { - unregisterChannelzRef(this.channelzRef); - } - - this.subchannelPool.unrefUnusedSubchannels(); - } - - getTarget() { - return uriToString(this.target); - } - - getConnectivityState(tryToConnect: boolean) { - const connectivityState = this.connectivityState; - if (tryToConnect) { - this.resolvingLoadBalancer.exitIdle(); - } - return connectivityState; - } - - watchConnectivityState( - currentState: ConnectivityState, - deadline: Date | number, - callback: (error?: Error) => void - ): void { - if (this.connectivityState === ConnectivityState.SHUTDOWN) { - throw new Error('Channel has been shut down'); - } - let timer = null; - if (deadline !== Infinity) { - const deadlineDate: Date = - deadline instanceof Date ? deadline : new Date(deadline); - const now = new Date(); - if (deadline === -Infinity || deadlineDate <= now) { - process.nextTick( - callback, - new Error('Deadline passed without connectivity state change') - ); - return; - } - timer = setTimeout(() => { - this.removeConnectivityStateWatcher(watcherObject); - callback( - new Error('Deadline passed without connectivity state change') - ); - }, deadlineDate.getTime() - now.getTime()); - } - const watcherObject = { - currentState, - callback, - timer, - }; - this.connectivityStateWatchers.push(watcherObject); - } - - /** - * Get the channelz reference object for this channel. The returned value is - * garbage if channelz is disabled for this channel. - * @returns - */ - getChannelzRef() { - return this.channelzRef; - } - - createCall( - method: string, - deadline: Deadline, - host: string | null | undefined, - parentCall: ServerSurfaceCall | null, - propagateFlags: number | null | undefined - ): Call { - if (typeof method !== 'string') { - throw new TypeError('Channel#createCall: method must be a string'); - } - if (!(typeof deadline === 'number' || deadline instanceof Date)) { - throw new TypeError( - 'Channel#createCall: deadline must be a number or Date' - ); - } - if (this.connectivityState === ConnectivityState.SHUTDOWN) { - throw new Error('Channel has been shut down'); - } - const callNumber = getNewCallNumber(); - this.trace( - 'createCall [' + - callNumber + - '] method="' + - method + - '", deadline=' + - deadline - ); - const finalOptions: CallStreamOptions = { - deadline: deadline, - flags: propagateFlags ?? Propagate.DEFAULTS, - host: host ?? this.defaultAuthority, - parentCall: parentCall, - }; - const stream: Http2CallStream = new Http2CallStream( - method, - this, - finalOptions, - this.filterStackFactory, - this.credentials._getCallCredentials(), - callNumber - ); - if (this.channelzEnabled) { - this.callTracker.addCallStarted(); - stream.addStatusWatcher(status => { - if (status.code === Status.OK) { - this.callTracker.addCallSucceeded(); - } else { - this.callTracker.addCallFailed(); - } - }); - } - return stream; - } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/channelz.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/channelz.ts deleted file mode 100644 index 5a7a5476..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/channelz.ts +++ /dev/null @@ -1,758 +0,0 @@ -/* - * Copyright 2021 gRPC authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -import { isIPv4, isIPv6 } from "net"; -import { ConnectivityState } from "./connectivity-state"; -import { Status } from "./constants"; -import { Timestamp } from "./generated/google/protobuf/Timestamp"; -import { Channel as ChannelMessage } from "./generated/grpc/channelz/v1/Channel"; -import { ChannelConnectivityState__Output } from "./generated/grpc/channelz/v1/ChannelConnectivityState"; -import { ChannelRef as ChannelRefMessage } from "./generated/grpc/channelz/v1/ChannelRef"; -import { ChannelTrace } from "./generated/grpc/channelz/v1/ChannelTrace"; -import { GetChannelRequest__Output } from "./generated/grpc/channelz/v1/GetChannelRequest"; -import { GetChannelResponse } from "./generated/grpc/channelz/v1/GetChannelResponse"; -import { sendUnaryData, ServerUnaryCall } from "./server-call"; -import { ServerRef as ServerRefMessage } from "./generated/grpc/channelz/v1/ServerRef"; -import { SocketRef as SocketRefMessage } from "./generated/grpc/channelz/v1/SocketRef"; -import { isTcpSubchannelAddress, SubchannelAddress } from "./subchannel-address"; -import { SubchannelRef as SubchannelRefMessage } from "./generated/grpc/channelz/v1/SubchannelRef"; -import { GetServerRequest__Output } from "./generated/grpc/channelz/v1/GetServerRequest"; -import { GetServerResponse } from "./generated/grpc/channelz/v1/GetServerResponse"; -import { Server as ServerMessage } from "./generated/grpc/channelz/v1/Server"; -import { GetServersRequest__Output } from "./generated/grpc/channelz/v1/GetServersRequest"; -import { GetServersResponse } from "./generated/grpc/channelz/v1/GetServersResponse"; -import { GetTopChannelsRequest__Output } from "./generated/grpc/channelz/v1/GetTopChannelsRequest"; -import { GetTopChannelsResponse } from "./generated/grpc/channelz/v1/GetTopChannelsResponse"; -import { GetSubchannelRequest__Output } from "./generated/grpc/channelz/v1/GetSubchannelRequest"; -import { GetSubchannelResponse } from "./generated/grpc/channelz/v1/GetSubchannelResponse"; -import { Subchannel as SubchannelMessage } from "./generated/grpc/channelz/v1/Subchannel"; -import { GetSocketRequest__Output } from "./generated/grpc/channelz/v1/GetSocketRequest"; -import { GetSocketResponse } from "./generated/grpc/channelz/v1/GetSocketResponse"; -import { Socket as SocketMessage } from "./generated/grpc/channelz/v1/Socket"; -import { Address } from "./generated/grpc/channelz/v1/Address"; -import { Security } from "./generated/grpc/channelz/v1/Security"; -import { GetServerSocketsRequest__Output } from "./generated/grpc/channelz/v1/GetServerSocketsRequest"; -import { GetServerSocketsResponse } from "./generated/grpc/channelz/v1/GetServerSocketsResponse"; -import { ChannelzDefinition, ChannelzHandlers } from "./generated/grpc/channelz/v1/Channelz"; -import { ProtoGrpcType as ChannelzProtoGrpcType } from "./generated/channelz"; -import type { loadSync } from '@grpc/proto-loader'; -import { registerAdminService } from "./admin"; -import { loadPackageDefinition } from "./make-client"; - -export type TraceSeverity = 'CT_UNKNOWN' | 'CT_INFO' | 'CT_WARNING' | 'CT_ERROR'; - -export interface ChannelRef { - kind: 'channel'; - id: number; - name: string; -} - -export interface SubchannelRef { - kind: 'subchannel'; - id: number; - name: string; -} - -export interface ServerRef { - kind: 'server'; - id: number; -} - -export interface SocketRef { - kind: 'socket'; - id: number; - name: string; -} - -function channelRefToMessage(ref: ChannelRef): ChannelRefMessage { - return { - channel_id: ref.id, - name: ref.name - }; -} - -function subchannelRefToMessage(ref: SubchannelRef): SubchannelRefMessage { - return { - subchannel_id: ref.id, - name: ref.name - } -} - -function serverRefToMessage(ref: ServerRef): ServerRefMessage { - return { - server_id: ref.id - } -} - -function socketRefToMessage(ref: SocketRef): SocketRefMessage { - return { - socket_id: ref.id, - name: ref.name - } -} - -interface TraceEvent { - description: string; - severity: TraceSeverity; - timestamp: Date; - childChannel?: ChannelRef; - childSubchannel?: SubchannelRef; -} - -/** - * The loose upper bound on the number of events that should be retained in a - * trace. This may be exceeded by up to a factor of 2. Arbitrarily chosen as a - * number that should be large enough to contain the recent relevant - * information, but small enough to not use excessive memory. - */ -const TARGET_RETAINED_TRACES = 32; - -export class ChannelzTrace { - events: TraceEvent[] = []; - creationTimestamp: Date; - eventsLogged: number = 0; - - constructor() { - this.creationTimestamp = new Date(); - } - - addTrace(severity: TraceSeverity, description: string, child?: ChannelRef | SubchannelRef) { - const timestamp = new Date(); - this.events.push({ - description: description, - severity: severity, - timestamp: timestamp, - childChannel: child?.kind === 'channel' ? child : undefined, - childSubchannel: child?.kind === 'subchannel' ? child : undefined - }); - // Whenever the trace array gets too large, discard the first half - if (this.events.length >= TARGET_RETAINED_TRACES * 2) { - this.events = this.events.slice(TARGET_RETAINED_TRACES); - } - this.eventsLogged += 1; - } - - getTraceMessage(): ChannelTrace { - return { - creation_timestamp: dateToProtoTimestamp(this.creationTimestamp), - num_events_logged: this.eventsLogged, - events: this.events.map(event => { - return { - description: event.description, - severity: event.severity, - timestamp: dateToProtoTimestamp(event.timestamp), - channel_ref: event.childChannel ? channelRefToMessage(event.childChannel) : null, - subchannel_ref: event.childSubchannel ? subchannelRefToMessage(event.childSubchannel) : null - } - }) - }; - } -} - -export class ChannelzChildrenTracker { - private channelChildren: Map = new Map(); - private subchannelChildren: Map = new Map(); - private socketChildren: Map = new Map(); - - refChild(child: ChannelRef | SubchannelRef | SocketRef) { - switch (child.kind) { - case 'channel': { - let trackedChild = this.channelChildren.get(child.id) ?? {ref: child, count: 0}; - trackedChild.count += 1; - this.channelChildren.set(child.id, trackedChild); - break; - } - case 'subchannel':{ - let trackedChild = this.subchannelChildren.get(child.id) ?? {ref: child, count: 0}; - trackedChild.count += 1; - this.subchannelChildren.set(child.id, trackedChild); - break; - } - case 'socket':{ - let trackedChild = this.socketChildren.get(child.id) ?? {ref: child, count: 0}; - trackedChild.count += 1; - this.socketChildren.set(child.id, trackedChild); - break; - } - } - } - - unrefChild(child: ChannelRef | SubchannelRef | SocketRef) { - switch (child.kind) { - case 'channel': { - let trackedChild = this.channelChildren.get(child.id); - if (trackedChild !== undefined) { - trackedChild.count -= 1; - if (trackedChild.count === 0) { - this.channelChildren.delete(child.id); - } else { - this.channelChildren.set(child.id, trackedChild); - } - } - break; - } - case 'subchannel': { - let trackedChild = this.subchannelChildren.get(child.id); - if (trackedChild !== undefined) { - trackedChild.count -= 1; - if (trackedChild.count === 0) { - this.subchannelChildren.delete(child.id); - } else { - this.subchannelChildren.set(child.id, trackedChild); - } - } - break; - } - case 'socket': { - let trackedChild = this.socketChildren.get(child.id); - if (trackedChild !== undefined) { - trackedChild.count -= 1; - if (trackedChild.count === 0) { - this.socketChildren.delete(child.id); - } else { - this.socketChildren.set(child.id, trackedChild); - } - } - break; - } - } - } - - getChildLists(): ChannelzChildren { - const channels: ChannelRef[] = []; - for (const {ref} of this.channelChildren.values()) { - channels.push(ref); - } - const subchannels: SubchannelRef[] = []; - for (const {ref} of this.subchannelChildren.values()) { - subchannels.push(ref); - } - const sockets: SocketRef[] = []; - for (const {ref} of this.socketChildren.values()) { - sockets.push(ref); - } - return {channels, subchannels, sockets}; - } -} - -export class ChannelzCallTracker { - callsStarted: number = 0; - callsSucceeded: number = 0; - callsFailed: number = 0; - lastCallStartedTimestamp: Date | null = null; - - addCallStarted() { - this.callsStarted += 1; - this.lastCallStartedTimestamp = new Date(); - } - addCallSucceeded() { - this.callsSucceeded += 1; - } - addCallFailed() { - this.callsFailed += 1; - } -} - -export interface ChannelzChildren { - channels: ChannelRef[]; - subchannels: SubchannelRef[]; - sockets: SocketRef[]; -} - -export interface ChannelInfo { - target: string; - state: ConnectivityState; - trace: ChannelzTrace; - callTracker: ChannelzCallTracker; - children: ChannelzChildren; -} - -export interface SubchannelInfo extends ChannelInfo {} - -export interface ServerInfo { - trace: ChannelzTrace; - callTracker: ChannelzCallTracker; - listenerChildren: ChannelzChildren; - sessionChildren: ChannelzChildren; -} - -export interface TlsInfo { - cipherSuiteStandardName: string | null; - cipherSuiteOtherName: string | null; - localCertificate: Buffer | null; - remoteCertificate: Buffer | null; -} - -export interface SocketInfo { - localAddress: SubchannelAddress | null; - remoteAddress: SubchannelAddress | null; - security: TlsInfo | null; - remoteName: string | null; - streamsStarted: number; - streamsSucceeded: number; - streamsFailed: number; - messagesSent: number; - messagesReceived: number; - keepAlivesSent: number; - lastLocalStreamCreatedTimestamp: Date | null; - lastRemoteStreamCreatedTimestamp: Date | null; - lastMessageSentTimestamp: Date | null; - lastMessageReceivedTimestamp: Date | null; - localFlowControlWindow: number | null; - remoteFlowControlWindow: number | null; -} - -interface ChannelEntry { - ref: ChannelRef; - getInfo(): ChannelInfo; -} - -interface SubchannelEntry { - ref: SubchannelRef; - getInfo(): SubchannelInfo; -} - -interface ServerEntry { - ref: ServerRef; - getInfo(): ServerInfo; -} - -interface SocketEntry { - ref: SocketRef; - getInfo(): SocketInfo; -} - -let nextId = 1; - -function getNextId(): number { - return nextId++; -} - -const channels: (ChannelEntry | undefined)[] = []; -const subchannels: (SubchannelEntry | undefined)[] = []; -const servers: (ServerEntry | undefined)[] = []; -const sockets: (SocketEntry | undefined)[] = []; - -export function registerChannelzChannel(name: string, getInfo: () => ChannelInfo, channelzEnabled: boolean): ChannelRef { - const id = getNextId(); - const ref: ChannelRef = {id, name, kind: 'channel'}; - if (channelzEnabled) { - channels[id] = { ref, getInfo }; - } - return ref; -} - -export function registerChannelzSubchannel(name: string, getInfo:() => SubchannelInfo, channelzEnabled: boolean): SubchannelRef { - const id = getNextId(); - const ref: SubchannelRef = {id, name, kind: 'subchannel'}; - if (channelzEnabled) { - subchannels[id] = { ref, getInfo }; - } - return ref; -} - -export function registerChannelzServer(getInfo: () => ServerInfo, channelzEnabled: boolean): ServerRef { - const id = getNextId(); - const ref: ServerRef = {id, kind: 'server'}; - if (channelzEnabled) { - servers[id] = { ref, getInfo }; - } - return ref; -} - -export function registerChannelzSocket(name: string, getInfo: () => SocketInfo, channelzEnabled: boolean): SocketRef { - const id = getNextId(); - const ref: SocketRef = {id, name, kind: 'socket'}; - if (channelzEnabled) { - sockets[id] = { ref, getInfo}; - } - return ref; -} - -export function unregisterChannelzRef(ref: ChannelRef | SubchannelRef | ServerRef | SocketRef) { - switch (ref.kind) { - case 'channel': - delete channels[ref.id]; - return; - case 'subchannel': - delete subchannels[ref.id]; - return; - case 'server': - delete servers[ref.id]; - return; - case 'socket': - delete sockets[ref.id]; - return; - } -} - -/** - * Parse a single section of an IPv6 address as two bytes - * @param addressSection A hexadecimal string of length up to 4 - * @returns The pair of bytes representing this address section - */ -function parseIPv6Section(addressSection: string): [number, number] { - const numberValue = Number.parseInt(addressSection, 16); - return [numberValue / 256 | 0, numberValue % 256]; -} - -/** - * Parse a chunk of an IPv6 address string to some number of bytes - * @param addressChunk Some number of segments of up to 4 hexadecimal - * characters each, joined by colons. - * @returns The list of bytes representing this address chunk - */ -function parseIPv6Chunk(addressChunk: string): number[] { - if (addressChunk === '') { - return []; - } - const bytePairs = addressChunk.split(':').map(section => parseIPv6Section(section)); - const result: number[] = []; - return result.concat(...bytePairs); -} - -/** - * Converts an IPv4 or IPv6 address from string representation to binary - * representation - * @param ipAddress an IP address in standard IPv4 or IPv6 text format - * @returns - */ -function ipAddressStringToBuffer(ipAddress: string): Buffer | null { - if (isIPv4(ipAddress)) { - return Buffer.from(Uint8Array.from(ipAddress.split('.').map(segment => Number.parseInt(segment)))); - } else if (isIPv6(ipAddress)) { - let leftSection: string; - let rightSection: string; - const doubleColonIndex = ipAddress.indexOf('::'); - if (doubleColonIndex === -1) { - leftSection = ipAddress; - rightSection = ''; - } else { - leftSection = ipAddress.substring(0, doubleColonIndex); - rightSection = ipAddress.substring(doubleColonIndex + 2); - } - const leftBuffer = Buffer.from(parseIPv6Chunk(leftSection)); - const rightBuffer = Buffer.from(parseIPv6Chunk(rightSection)); - const middleBuffer = Buffer.alloc(16 - leftBuffer.length - rightBuffer.length, 0); - return Buffer.concat([leftBuffer, middleBuffer, rightBuffer]); - } else { - return null; - } -} - -function connectivityStateToMessage(state: ConnectivityState): ChannelConnectivityState__Output { - switch (state) { - case ConnectivityState.CONNECTING: - return { - state: 'CONNECTING' - }; - case ConnectivityState.IDLE: - return { - state: 'IDLE' - }; - case ConnectivityState.READY: - return { - state: 'READY' - }; - case ConnectivityState.SHUTDOWN: - return { - state: 'SHUTDOWN' - }; - case ConnectivityState.TRANSIENT_FAILURE: - return { - state: 'TRANSIENT_FAILURE' - }; - default: - return { - state: 'UNKNOWN' - }; - } -} - -function dateToProtoTimestamp(date?: Date | null): Timestamp | null { - if (!date) { - return null; - } - const millisSinceEpoch = date.getTime(); - return { - seconds: (millisSinceEpoch / 1000) | 0, - nanos: (millisSinceEpoch % 1000) * 1_000_000 - } -} - -function getChannelMessage(channelEntry: ChannelEntry): ChannelMessage { - const resolvedInfo = channelEntry.getInfo(); - return { - ref: channelRefToMessage(channelEntry.ref), - data: { - target: resolvedInfo.target, - state: connectivityStateToMessage(resolvedInfo.state), - calls_started: resolvedInfo.callTracker.callsStarted, - calls_succeeded: resolvedInfo.callTracker.callsSucceeded, - calls_failed: resolvedInfo.callTracker.callsFailed, - last_call_started_timestamp: dateToProtoTimestamp(resolvedInfo.callTracker.lastCallStartedTimestamp), - trace: resolvedInfo.trace.getTraceMessage() - }, - channel_ref: resolvedInfo.children.channels.map(ref => channelRefToMessage(ref)), - subchannel_ref: resolvedInfo.children.subchannels.map(ref => subchannelRefToMessage(ref)) - }; -} - -function GetChannel(call: ServerUnaryCall, callback: sendUnaryData): void { - const channelId = Number.parseInt(call.request.channel_id); - const channelEntry = channels[channelId]; - if (channelEntry === undefined) { - callback({ - 'code': Status.NOT_FOUND, - 'details': 'No channel data found for id ' + channelId - }); - return; - } - callback(null, {channel: getChannelMessage(channelEntry)}); -} - -function GetTopChannels(call: ServerUnaryCall, callback: sendUnaryData): void { - const maxResults = Number.parseInt(call.request.max_results); - const resultList: ChannelMessage[] = []; - let i = Number.parseInt(call.request.start_channel_id); - for (; i < channels.length; i++) { - const channelEntry = channels[i]; - if (channelEntry === undefined) { - continue; - } - resultList.push(getChannelMessage(channelEntry)); - if (resultList.length >= maxResults) { - break; - } - } - callback(null, { - channel: resultList, - end: i >= servers.length - }); -} - -function getServerMessage(serverEntry: ServerEntry): ServerMessage { - const resolvedInfo = serverEntry.getInfo(); - return { - ref: serverRefToMessage(serverEntry.ref), - data: { - calls_started: resolvedInfo.callTracker.callsStarted, - calls_succeeded: resolvedInfo.callTracker.callsSucceeded, - calls_failed: resolvedInfo.callTracker.callsFailed, - last_call_started_timestamp: dateToProtoTimestamp(resolvedInfo.callTracker.lastCallStartedTimestamp), - trace: resolvedInfo.trace.getTraceMessage() - }, - listen_socket: resolvedInfo.listenerChildren.sockets.map(ref => socketRefToMessage(ref)) - }; -} - -function GetServer(call: ServerUnaryCall, callback: sendUnaryData): void { - const serverId = Number.parseInt(call.request.server_id); - const serverEntry = servers[serverId]; - if (serverEntry === undefined) { - callback({ - 'code': Status.NOT_FOUND, - 'details': 'No server data found for id ' + serverId - }); - return; - } - callback(null, {server: getServerMessage(serverEntry)}); -} - -function GetServers(call: ServerUnaryCall, callback: sendUnaryData): void { - const maxResults = Number.parseInt(call.request.max_results); - const resultList: ServerMessage[] = []; - let i = Number.parseInt(call.request.start_server_id); - for (; i < servers.length; i++) { - const serverEntry = servers[i]; - if (serverEntry === undefined) { - continue; - } - resultList.push(getServerMessage(serverEntry)); - if (resultList.length >= maxResults) { - break; - } - } - callback(null, { - server: resultList, - end: i >= servers.length - }); -} - -function GetSubchannel(call: ServerUnaryCall, callback: sendUnaryData): void { - const subchannelId = Number.parseInt(call.request.subchannel_id); - const subchannelEntry = subchannels[subchannelId]; - if (subchannelEntry === undefined) { - callback({ - 'code': Status.NOT_FOUND, - 'details': 'No subchannel data found for id ' + subchannelId - }); - return; - } - const resolvedInfo = subchannelEntry.getInfo(); - const subchannelMessage: SubchannelMessage = { - ref: subchannelRefToMessage(subchannelEntry.ref), - data: { - target: resolvedInfo.target, - state: connectivityStateToMessage(resolvedInfo.state), - calls_started: resolvedInfo.callTracker.callsStarted, - calls_succeeded: resolvedInfo.callTracker.callsSucceeded, - calls_failed: resolvedInfo.callTracker.callsFailed, - last_call_started_timestamp: dateToProtoTimestamp(resolvedInfo.callTracker.lastCallStartedTimestamp), - trace: resolvedInfo.trace.getTraceMessage() - }, - socket_ref: resolvedInfo.children.sockets.map(ref => socketRefToMessage(ref)) - }; - callback(null, {subchannel: subchannelMessage}); -} - -function subchannelAddressToAddressMessage(subchannelAddress: SubchannelAddress): Address { - if (isTcpSubchannelAddress(subchannelAddress)) { - return { - address: 'tcpip_address', - tcpip_address: { - ip_address: ipAddressStringToBuffer(subchannelAddress.host) ?? undefined, - port: subchannelAddress.port - } - }; - } else { - return { - address: 'uds_address', - uds_address: { - filename: subchannelAddress.path - } - }; - } -} - -function GetSocket(call: ServerUnaryCall, callback: sendUnaryData): void { - const socketId = Number.parseInt(call.request.socket_id); - const socketEntry = sockets[socketId]; - if (socketEntry === undefined) { - callback({ - 'code': Status.NOT_FOUND, - 'details': 'No socket data found for id ' + socketId - }); - return; - } - const resolvedInfo = socketEntry.getInfo(); - const securityMessage: Security | null = resolvedInfo.security ? { - model: 'tls', - tls: { - cipher_suite: resolvedInfo.security.cipherSuiteStandardName ? 'standard_name' : 'other_name', - standard_name: resolvedInfo.security.cipherSuiteStandardName ?? undefined, - other_name: resolvedInfo.security.cipherSuiteOtherName ?? undefined, - local_certificate: resolvedInfo.security.localCertificate ?? undefined, - remote_certificate: resolvedInfo.security.remoteCertificate ?? undefined - } - } : null; - const socketMessage: SocketMessage = { - ref: socketRefToMessage(socketEntry.ref), - local: resolvedInfo.localAddress ? subchannelAddressToAddressMessage(resolvedInfo.localAddress) : null, - remote: resolvedInfo.remoteAddress ? subchannelAddressToAddressMessage(resolvedInfo.remoteAddress) : null, - remote_name: resolvedInfo.remoteName ?? undefined, - security: securityMessage, - data: { - keep_alives_sent: resolvedInfo.keepAlivesSent, - streams_started: resolvedInfo.streamsStarted, - streams_succeeded: resolvedInfo.streamsSucceeded, - streams_failed: resolvedInfo.streamsFailed, - last_local_stream_created_timestamp: dateToProtoTimestamp(resolvedInfo.lastLocalStreamCreatedTimestamp), - last_remote_stream_created_timestamp: dateToProtoTimestamp(resolvedInfo.lastRemoteStreamCreatedTimestamp), - messages_received: resolvedInfo.messagesReceived, - messages_sent: resolvedInfo.messagesSent, - last_message_received_timestamp: dateToProtoTimestamp(resolvedInfo.lastMessageReceivedTimestamp), - last_message_sent_timestamp: dateToProtoTimestamp(resolvedInfo.lastMessageSentTimestamp), - local_flow_control_window: resolvedInfo.localFlowControlWindow ? { value: resolvedInfo.localFlowControlWindow } : null, - remote_flow_control_window: resolvedInfo.remoteFlowControlWindow ? { value: resolvedInfo.remoteFlowControlWindow } : null, - } - }; - callback(null, {socket: socketMessage}); -} - -function GetServerSockets(call: ServerUnaryCall, callback: sendUnaryData): void { - const serverId = Number.parseInt(call.request.server_id); - const serverEntry = servers[serverId]; - if (serverEntry === undefined) { - callback({ - 'code': Status.NOT_FOUND, - 'details': 'No server data found for id ' + serverId - }); - return; - } - const startId = Number.parseInt(call.request.start_socket_id); - const maxResults = Number.parseInt(call.request.max_results); - const resolvedInfo = serverEntry.getInfo(); - // If we wanted to include listener sockets in the result, this line would - // instead say - // const allSockets = resolvedInfo.listenerChildren.sockets.concat(resolvedInfo.sessionChildren.sockets).sort((ref1, ref2) => ref1.id - ref2.id); - const allSockets = resolvedInfo.sessionChildren.sockets.sort((ref1, ref2) => ref1.id - ref2.id); - const resultList: SocketRefMessage[] = []; - let i = 0; - for (; i < allSockets.length; i++) { - if (allSockets[i].id >= startId) { - resultList.push(socketRefToMessage(allSockets[i])); - if (resultList.length >= maxResults) { - break; - } - } - } - callback(null, { - socket_ref: resultList, - end: i >= allSockets.length - }); -} - -export function getChannelzHandlers(): ChannelzHandlers { - return { - GetChannel, - GetTopChannels, - GetServer, - GetServers, - GetSubchannel, - GetSocket, - GetServerSockets - }; -} - -let loadedChannelzDefinition: ChannelzDefinition | null = null; - -export function getChannelzServiceDefinition(): ChannelzDefinition { - if (loadedChannelzDefinition) { - return loadedChannelzDefinition; - } - /* The purpose of this complexity is to avoid loading @grpc/proto-loader at - * runtime for users who will not use/enable channelz. */ - const loaderLoadSync = require('@grpc/proto-loader').loadSync as typeof loadSync; - const loadedProto = loaderLoadSync('channelz.proto', { - keepCase: true, - longs: String, - enums: String, - defaults: true, - oneofs: true, - includeDirs: [ - `${__dirname}/../../proto` - ] - }); - const channelzGrpcObject = loadPackageDefinition(loadedProto) as unknown as ChannelzProtoGrpcType; - loadedChannelzDefinition = channelzGrpcObject.grpc.channelz.v1.Channelz.service; - return loadedChannelzDefinition; -} - -export function setup() { - registerAdminService(getChannelzServiceDefinition, getChannelzHandlers); -} \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/client-interceptors.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/client-interceptors.ts deleted file mode 100644 index ddb296ff..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/client-interceptors.ts +++ /dev/null @@ -1,581 +0,0 @@ -/* - * Copyright 2019 gRPC authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -import { Metadata } from './metadata'; -import { - StatusObject, - Listener, - MetadataListener, - MessageListener, - StatusListener, - FullListener, - InterceptingListener, - InterceptingListenerImpl, - isInterceptingListener, - MessageContext, - Call, -} from './call-stream'; -import { Status } from './constants'; -import { Channel } from './channel'; -import { CallOptions } from './client'; -import { CallCredentials } from './call-credentials'; -import { ClientMethodDefinition } from './make-client'; - -/** - * Error class associated with passing both interceptors and interceptor - * providers to a client constructor or as call options. - */ -export class InterceptorConfigurationError extends Error { - constructor(message: string) { - super(message); - this.name = 'InterceptorConfigurationError'; - Error.captureStackTrace(this, InterceptorConfigurationError); - } -} - -export interface MetadataRequester { - ( - metadata: Metadata, - listener: InterceptingListener, - next: ( - metadata: Metadata, - listener: InterceptingListener | Listener - ) => void - ): void; -} - -export interface MessageRequester { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (message: any, next: (message: any) => void): void; -} - -export interface CloseRequester { - (next: () => void): void; -} - -export interface CancelRequester { - (next: () => void): void; -} - -/** - * An object with methods for intercepting and modifying outgoing call operations. - */ -export interface FullRequester { - start: MetadataRequester; - sendMessage: MessageRequester; - halfClose: CloseRequester; - cancel: CancelRequester; -} - -export type Requester = Partial; - -export class ListenerBuilder { - private metadata: MetadataListener | undefined = undefined; - private message: MessageListener | undefined = undefined; - private status: StatusListener | undefined = undefined; - - withOnReceiveMetadata(onReceiveMetadata: MetadataListener): this { - this.metadata = onReceiveMetadata; - return this; - } - - withOnReceiveMessage(onReceiveMessage: MessageListener): this { - this.message = onReceiveMessage; - return this; - } - - withOnReceiveStatus(onReceiveStatus: StatusListener): this { - this.status = onReceiveStatus; - return this; - } - - build(): Listener { - return { - onReceiveMetadata: this.metadata, - onReceiveMessage: this.message, - onReceiveStatus: this.status, - }; - } -} - -export class RequesterBuilder { - private start: MetadataRequester | undefined = undefined; - private message: MessageRequester | undefined = undefined; - private halfClose: CloseRequester | undefined = undefined; - private cancel: CancelRequester | undefined = undefined; - - withStart(start: MetadataRequester): this { - this.start = start; - return this; - } - - withSendMessage(sendMessage: MessageRequester): this { - this.message = sendMessage; - return this; - } - - withHalfClose(halfClose: CloseRequester): this { - this.halfClose = halfClose; - return this; - } - - withCancel(cancel: CancelRequester): this { - this.cancel = cancel; - return this; - } - - build(): Requester { - return { - start: this.start, - sendMessage: this.message, - halfClose: this.halfClose, - cancel: this.cancel, - }; - } -} - -/** - * A Listener with a default pass-through implementation of each method. Used - * for filling out Listeners with some methods omitted. - */ -const defaultListener: FullListener = { - onReceiveMetadata: (metadata, next) => { - next(metadata); - }, - onReceiveMessage: (message, next) => { - next(message); - }, - onReceiveStatus: (status, next) => { - next(status); - }, -}; - -/** - * A Requester with a default pass-through implementation of each method. Used - * for filling out Requesters with some methods omitted. - */ -const defaultRequester: FullRequester = { - start: (metadata, listener, next) => { - next(metadata, listener); - }, - sendMessage: (message, next) => { - next(message); - }, - halfClose: (next) => { - next(); - }, - cancel: (next) => { - next(); - }, -}; - -export interface InterceptorOptions extends CallOptions { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - method_definition: ClientMethodDefinition; -} - -export interface InterceptingCallInterface { - cancelWithStatus(status: Status, details: string): void; - getPeer(): string; - start(metadata: Metadata, listener?: Partial): void; - // eslint-disable-next-line @typescript-eslint/no-explicit-any - sendMessageWithContext(context: MessageContext, message: any): void; - // eslint-disable-next-line @typescript-eslint/no-explicit-any - sendMessage(message: any): void; - startRead(): void; - halfClose(): void; - - setCredentials(credentials: CallCredentials): void; -} - -export class InterceptingCall implements InterceptingCallInterface { - /** - * The requester that this InterceptingCall uses to modify outgoing operations - */ - private requester: FullRequester; - /** - * Indicates that metadata has been passed to the requester's start - * method but it has not been passed to the corresponding next callback - */ - private processingMetadata = false; - /** - * Message context for a pending message that is waiting for - */ - private pendingMessageContext: MessageContext | null = null; - private pendingMessage: any; - /** - * Indicates that a message has been passed to the requester's sendMessage - * method but it has not been passed to the corresponding next callback - */ - private processingMessage = false; - /** - * Indicates that a status was received but could not be propagated because - * a message was still being processed. - */ - private pendingHalfClose = false; - constructor( - private nextCall: InterceptingCallInterface, - requester?: Requester - ) { - if (requester) { - this.requester = { - start: requester.start ?? defaultRequester.start, - sendMessage: requester.sendMessage ?? defaultRequester.sendMessage, - halfClose: requester.halfClose ?? defaultRequester.halfClose, - cancel: requester.cancel ?? defaultRequester.cancel, - }; - } else { - this.requester = defaultRequester; - } - } - - cancelWithStatus(status: Status, details: string) { - this.requester.cancel(() => { - this.nextCall.cancelWithStatus(status, details); - }); - } - - getPeer() { - return this.nextCall.getPeer(); - } - - private processPendingMessage() { - if (this.pendingMessageContext) { - this.nextCall.sendMessageWithContext(this.pendingMessageContext, this.pendingMessage); - this.pendingMessageContext = null; - this.pendingMessage = null; - } - } - - private processPendingHalfClose() { - if (this.pendingHalfClose) { - this.nextCall.halfClose(); - } - } - - start( - metadata: Metadata, - interceptingListener?: Partial - ): void { - const fullInterceptingListener: InterceptingListener = { - onReceiveMetadata: - interceptingListener?.onReceiveMetadata?.bind(interceptingListener) ?? - ((metadata) => {}), - onReceiveMessage: - interceptingListener?.onReceiveMessage?.bind(interceptingListener) ?? - ((message) => {}), - onReceiveStatus: - interceptingListener?.onReceiveStatus?.bind(interceptingListener) ?? - ((status) => {}), - }; - this.processingMetadata = true; - this.requester.start(metadata, fullInterceptingListener, (md, listener) => { - this.processingMetadata = false; - let finalInterceptingListener: InterceptingListener; - if (isInterceptingListener(listener)) { - finalInterceptingListener = listener; - } else { - const fullListener: FullListener = { - onReceiveMetadata: - listener.onReceiveMetadata ?? defaultListener.onReceiveMetadata, - onReceiveMessage: - listener.onReceiveMessage ?? defaultListener.onReceiveMessage, - onReceiveStatus: - listener.onReceiveStatus ?? defaultListener.onReceiveStatus, - }; - finalInterceptingListener = new InterceptingListenerImpl( - fullListener, - fullInterceptingListener - ); - } - this.nextCall.start(md, finalInterceptingListener); - this.processPendingMessage(); - this.processPendingHalfClose(); - }); - } - // eslint-disable-next-line @typescript-eslint/no-explicit-any - sendMessageWithContext(context: MessageContext, message: any): void { - this.processingMessage = true; - this.requester.sendMessage(message, (finalMessage) => { - this.processingMessage = false; - if (this.processingMetadata) { - this.pendingMessageContext = context; - this.pendingMessage = message; - } else { - this.nextCall.sendMessageWithContext(context, finalMessage); - this.processPendingHalfClose(); - } - }); - } - // eslint-disable-next-line @typescript-eslint/no-explicit-any - sendMessage(message: any): void { - this.sendMessageWithContext({}, message); - } - startRead(): void { - this.nextCall.startRead(); - } - halfClose(): void { - this.requester.halfClose(() => { - if (this.processingMetadata || this.processingMessage) { - this.pendingHalfClose = true; - } else { - this.nextCall.halfClose(); - } - }); - } - setCredentials(credentials: CallCredentials): void { - this.nextCall.setCredentials(credentials); - } -} - -function getCall(channel: Channel, path: string, options: CallOptions): Call { - const deadline = options.deadline ?? Infinity; - const host = options.host; - const parent = options.parent ?? null; - const propagateFlags = options.propagate_flags; - const credentials = options.credentials; - const call = channel.createCall(path, deadline, host, parent, propagateFlags); - if (credentials) { - call.setCredentials(credentials); - } - return call; -} - -/** - * InterceptingCall implementation that directly owns the underlying Call - * object and handles serialization and deseraizliation. - */ -class BaseInterceptingCall implements InterceptingCallInterface { - constructor( - protected call: Call, - // eslint-disable-next-line @typescript-eslint/no-explicit-any - protected methodDefinition: ClientMethodDefinition - ) {} - cancelWithStatus(status: Status, details: string): void { - this.call.cancelWithStatus(status, details); - } - getPeer(): string { - return this.call.getPeer(); - } - setCredentials(credentials: CallCredentials): void { - this.call.setCredentials(credentials); - } - // eslint-disable-next-line @typescript-eslint/no-explicit-any - sendMessageWithContext(context: MessageContext, message: any): void { - let serialized: Buffer; - try { - serialized = this.methodDefinition.requestSerialize(message); - } catch (e) { - this.call.cancelWithStatus( - Status.INTERNAL, - `Request message serialization failure: ${e.message}` - ); - return; - } - this.call.sendMessageWithContext(context, serialized); - } - // eslint-disable-next-line @typescript-eslint/no-explicit-any - sendMessage(message: any) { - this.sendMessageWithContext({}, message); - } - start( - metadata: Metadata, - interceptingListener?: Partial - ): void { - let readError: StatusObject | null = null; - this.call.start(metadata, { - onReceiveMetadata: (metadata) => { - interceptingListener?.onReceiveMetadata?.(metadata); - }, - onReceiveMessage: (message) => { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - let deserialized: any; - try { - deserialized = this.methodDefinition.responseDeserialize(message); - } catch (e) { - readError = { - code: Status.INTERNAL, - details: `Response message parsing error: ${e.message}`, - metadata: new Metadata(), - }; - this.call.cancelWithStatus(readError.code, readError.details); - return; - } - interceptingListener?.onReceiveMessage?.(deserialized); - }, - onReceiveStatus: (status) => { - if (readError) { - interceptingListener?.onReceiveStatus?.(readError); - } else { - interceptingListener?.onReceiveStatus?.(status); - } - }, - }); - } - startRead() { - this.call.startRead(); - } - halfClose(): void { - this.call.halfClose(); - } -} - -/** - * BaseInterceptingCall with special-cased behavior for methods with unary - * responses. - */ -class BaseUnaryInterceptingCall - extends BaseInterceptingCall - implements InterceptingCallInterface { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - constructor(call: Call, methodDefinition: ClientMethodDefinition) { - super(call, methodDefinition); - } - start(metadata: Metadata, listener?: Partial): void { - let receivedMessage = false; - const wrapperListener: InterceptingListener = { - onReceiveMetadata: - listener?.onReceiveMetadata?.bind(listener) ?? ((metadata) => {}), - // eslint-disable-next-line @typescript-eslint/no-explicit-any - onReceiveMessage: (message: any) => { - receivedMessage = true; - listener?.onReceiveMessage?.(message); - }, - onReceiveStatus: (status: StatusObject) => { - if (!receivedMessage) { - listener?.onReceiveMessage?.(null); - } - listener?.onReceiveStatus?.(status); - }, - }; - super.start(metadata, wrapperListener); - this.call.startRead(); - } -} - -/** - * BaseInterceptingCall with special-cased behavior for methods with streaming - * responses. - */ -class BaseStreamingInterceptingCall - extends BaseInterceptingCall - implements InterceptingCallInterface {} - -function getBottomInterceptingCall( - channel: Channel, - options: InterceptorOptions, - // eslint-disable-next-line @typescript-eslint/no-explicit-any - methodDefinition: ClientMethodDefinition -) { - const call = getCall(channel, methodDefinition.path, options); - if (methodDefinition.responseStream) { - return new BaseStreamingInterceptingCall(call, methodDefinition); - } else { - return new BaseUnaryInterceptingCall(call, methodDefinition); - } -} - -export interface NextCall { - (options: InterceptorOptions): InterceptingCallInterface; -} - -export interface Interceptor { - (options: InterceptorOptions, nextCall: NextCall): InterceptingCall; -} - -export interface InterceptorProvider { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (methodDefinition: ClientMethodDefinition): Interceptor; -} - -export interface InterceptorArguments { - clientInterceptors: Interceptor[]; - clientInterceptorProviders: InterceptorProvider[]; - callInterceptors: Interceptor[]; - callInterceptorProviders: InterceptorProvider[]; -} - -export function getInterceptingCall( - interceptorArgs: InterceptorArguments, - // eslint-disable-next-line @typescript-eslint/no-explicit-any - methodDefinition: ClientMethodDefinition, - options: CallOptions, - channel: Channel -): InterceptingCallInterface { - if ( - interceptorArgs.clientInterceptors.length > 0 && - interceptorArgs.clientInterceptorProviders.length > 0 - ) { - throw new InterceptorConfigurationError( - 'Both interceptors and interceptor_providers were passed as options ' + - 'to the client constructor. Only one of these is allowed.' - ); - } - if ( - interceptorArgs.callInterceptors.length > 0 && - interceptorArgs.callInterceptorProviders.length > 0 - ) { - throw new InterceptorConfigurationError( - 'Both interceptors and interceptor_providers were passed as call ' + - 'options. Only one of these is allowed.' - ); - } - let interceptors: Interceptor[] = []; - // Interceptors passed to the call override interceptors passed to the client constructor - if ( - interceptorArgs.callInterceptors.length > 0 || - interceptorArgs.callInterceptorProviders.length > 0 - ) { - interceptors = ([] as Interceptor[]) - .concat( - interceptorArgs.callInterceptors, - interceptorArgs.callInterceptorProviders.map((provider) => - provider(methodDefinition) - ) - ) - .filter((interceptor) => interceptor); - // Filter out falsy values when providers return nothing - } else { - interceptors = ([] as Interceptor[]) - .concat( - interceptorArgs.clientInterceptors, - interceptorArgs.clientInterceptorProviders.map((provider) => - provider(methodDefinition) - ) - ) - .filter((interceptor) => interceptor); - // Filter out falsy values when providers return nothing - } - const interceptorOptions = Object.assign({}, options, { - method_definition: methodDefinition, - }); - /* For each interceptor in the list, the nextCall function passed to it is - * based on the next interceptor in the list, using a nextCall function - * constructed with the following interceptor in the list, and so on. The - * initialValue, which is effectively at the end of the list, is a nextCall - * function that invokes getBottomInterceptingCall, the result of which - * handles (de)serialization and also gets the underlying call from the - * channel. */ - const getCall: NextCall = interceptors.reduceRight( - (nextCall: NextCall, nextInterceptor: Interceptor) => { - return (currentOptions) => nextInterceptor(currentOptions, nextCall); - }, - (finalOptions: InterceptorOptions) => - getBottomInterceptingCall(channel, finalOptions, methodDefinition) - ); - return getCall(interceptorOptions); -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/client.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/client.ts deleted file mode 100644 index 1198dc46..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/client.ts +++ /dev/null @@ -1,710 +0,0 @@ -/* - * Copyright 2019 gRPC authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -import { - ClientDuplexStream, - ClientDuplexStreamImpl, - ClientReadableStream, - ClientReadableStreamImpl, - ClientUnaryCall, - ClientUnaryCallImpl, - ClientWritableStream, - ClientWritableStreamImpl, - ServiceError, - callErrorFromStatus, - SurfaceCall, -} from './call'; -import { CallCredentials } from './call-credentials'; -import { Deadline, StatusObject } from './call-stream'; -import { Channel, ChannelImplementation } from './channel'; -import { ConnectivityState } from './connectivity-state'; -import { ChannelCredentials } from './channel-credentials'; -import { ChannelOptions } from './channel-options'; -import { Status } from './constants'; -import { Metadata } from './metadata'; -import { ClientMethodDefinition } from './make-client'; -import { - getInterceptingCall, - Interceptor, - InterceptorProvider, - InterceptorArguments, - InterceptingCallInterface, -} from './client-interceptors'; -import { - ServerUnaryCall, - ServerReadableStream, - ServerWritableStream, - ServerDuplexStream, -} from './server-call'; - -const CHANNEL_SYMBOL = Symbol(); -const INTERCEPTOR_SYMBOL = Symbol(); -const INTERCEPTOR_PROVIDER_SYMBOL = Symbol(); -const CALL_INVOCATION_TRANSFORMER_SYMBOL = Symbol(); - -function isFunction( - arg: Metadata | CallOptions | UnaryCallback | undefined -): arg is UnaryCallback { - return typeof arg === 'function'; -} - -export interface UnaryCallback { - (err: ServiceError | null, value?: ResponseType): void; -} - -/* eslint-disable @typescript-eslint/no-explicit-any */ -export interface CallOptions { - deadline?: Deadline; - host?: string; - parent?: - | ServerUnaryCall - | ServerReadableStream - | ServerWritableStream - | ServerDuplexStream; - propagate_flags?: number; - credentials?: CallCredentials; - interceptors?: Interceptor[]; - interceptor_providers?: InterceptorProvider[]; -} -/* eslint-enable @typescript-eslint/no-explicit-any */ - -export interface CallProperties { - argument?: RequestType; - metadata: Metadata; - call: SurfaceCall; - channel: Channel; - methodDefinition: ClientMethodDefinition; - callOptions: CallOptions; - callback?: UnaryCallback; -} - -export interface CallInvocationTransformer { - (callProperties: CallProperties): CallProperties; // eslint-disable-line @typescript-eslint/no-explicit-any -} - -export type ClientOptions = Partial & { - channelOverride?: Channel; - channelFactoryOverride?: ( - address: string, - credentials: ChannelCredentials, - options: ClientOptions - ) => Channel; - interceptors?: Interceptor[]; - interceptor_providers?: InterceptorProvider[]; - callInvocationTransformer?: CallInvocationTransformer; -}; - -function getErrorStackString(error: Error): string { - return error.stack!.split('\n').slice(1).join('\n'); -} - -/** - * A generic gRPC client. Primarily useful as a base class for all generated - * clients. - */ -export class Client { - private readonly [CHANNEL_SYMBOL]: Channel; - private readonly [INTERCEPTOR_SYMBOL]: Interceptor[]; - private readonly [INTERCEPTOR_PROVIDER_SYMBOL]: InterceptorProvider[]; - private readonly [CALL_INVOCATION_TRANSFORMER_SYMBOL]?: CallInvocationTransformer; - constructor( - address: string, - credentials: ChannelCredentials, - options: ClientOptions = {} - ) { - options = Object.assign({}, options); - this[INTERCEPTOR_SYMBOL] = options.interceptors ?? []; - delete options.interceptors; - this[INTERCEPTOR_PROVIDER_SYMBOL] = options.interceptor_providers ?? []; - delete options.interceptor_providers; - if ( - this[INTERCEPTOR_SYMBOL].length > 0 && - this[INTERCEPTOR_PROVIDER_SYMBOL].length > 0 - ) { - throw new Error( - 'Both interceptors and interceptor_providers were passed as options ' + - 'to the client constructor. Only one of these is allowed.' - ); - } - this[CALL_INVOCATION_TRANSFORMER_SYMBOL] = - options.callInvocationTransformer; - delete options.callInvocationTransformer; - if (options.channelOverride) { - this[CHANNEL_SYMBOL] = options.channelOverride; - } else if (options.channelFactoryOverride) { - const channelFactoryOverride = options.channelFactoryOverride; - delete options.channelFactoryOverride; - this[CHANNEL_SYMBOL] = channelFactoryOverride( - address, - credentials, - options - ); - } else { - this[CHANNEL_SYMBOL] = new ChannelImplementation( - address, - credentials, - options - ); - } - } - - close(): void { - this[CHANNEL_SYMBOL].close(); - } - - getChannel(): Channel { - return this[CHANNEL_SYMBOL]; - } - - waitForReady(deadline: Deadline, callback: (error?: Error) => void): void { - const checkState = (err?: Error) => { - if (err) { - callback(new Error('Failed to connect before the deadline')); - return; - } - let newState; - try { - newState = this[CHANNEL_SYMBOL].getConnectivityState(true); - } catch (e) { - callback(new Error('The channel has been closed')); - return; - } - if (newState === ConnectivityState.READY) { - callback(); - } else { - try { - this[CHANNEL_SYMBOL].watchConnectivityState( - newState, - deadline, - checkState - ); - } catch (e) { - callback(new Error('The channel has been closed')); - } - } - }; - setImmediate(checkState); - } - - private checkOptionalUnaryResponseArguments( - arg1: Metadata | CallOptions | UnaryCallback, - arg2?: CallOptions | UnaryCallback, - arg3?: UnaryCallback - ): { - metadata: Metadata; - options: CallOptions; - callback: UnaryCallback; - } { - if (isFunction(arg1)) { - return { metadata: new Metadata(), options: {}, callback: arg1 }; - } else if (isFunction(arg2)) { - if (arg1 instanceof Metadata) { - return { metadata: arg1, options: {}, callback: arg2 }; - } else { - return { metadata: new Metadata(), options: arg1, callback: arg2 }; - } - } else { - if ( - !( - arg1 instanceof Metadata && - arg2 instanceof Object && - isFunction(arg3) - ) - ) { - throw new Error('Incorrect arguments passed'); - } - return { metadata: arg1, options: arg2, callback: arg3 }; - } - } - - makeUnaryRequest( - method: string, - serialize: (value: RequestType) => Buffer, - deserialize: (value: Buffer) => ResponseType, - argument: RequestType, - metadata: Metadata, - options: CallOptions, - callback: UnaryCallback - ): ClientUnaryCall; - makeUnaryRequest( - method: string, - serialize: (value: RequestType) => Buffer, - deserialize: (value: Buffer) => ResponseType, - argument: RequestType, - metadata: Metadata, - callback: UnaryCallback - ): ClientUnaryCall; - makeUnaryRequest( - method: string, - serialize: (value: RequestType) => Buffer, - deserialize: (value: Buffer) => ResponseType, - argument: RequestType, - options: CallOptions, - callback: UnaryCallback - ): ClientUnaryCall; - makeUnaryRequest( - method: string, - serialize: (value: RequestType) => Buffer, - deserialize: (value: Buffer) => ResponseType, - argument: RequestType, - callback: UnaryCallback - ): ClientUnaryCall; - makeUnaryRequest( - method: string, - serialize: (value: RequestType) => Buffer, - deserialize: (value: Buffer) => ResponseType, - argument: RequestType, - metadata: Metadata | CallOptions | UnaryCallback, - options?: CallOptions | UnaryCallback, - callback?: UnaryCallback - ): ClientUnaryCall { - const checkedArguments = this.checkOptionalUnaryResponseArguments( - metadata, - options, - callback - ); - const methodDefinition: ClientMethodDefinition< - RequestType, - ResponseType - > = { - path: method, - requestStream: false, - responseStream: false, - requestSerialize: serialize, - responseDeserialize: deserialize, - }; - let callProperties: CallProperties = { - argument: argument, - metadata: checkedArguments.metadata, - call: new ClientUnaryCallImpl(), - channel: this[CHANNEL_SYMBOL], - methodDefinition: methodDefinition, - callOptions: checkedArguments.options, - callback: checkedArguments.callback, - }; - if (this[CALL_INVOCATION_TRANSFORMER_SYMBOL]) { - callProperties = this[CALL_INVOCATION_TRANSFORMER_SYMBOL]!( - callProperties - ) as CallProperties; - } - const emitter: ClientUnaryCall = callProperties.call; - const interceptorArgs: InterceptorArguments = { - clientInterceptors: this[INTERCEPTOR_SYMBOL], - clientInterceptorProviders: this[INTERCEPTOR_PROVIDER_SYMBOL], - callInterceptors: callProperties.callOptions.interceptors ?? [], - callInterceptorProviders: - callProperties.callOptions.interceptor_providers ?? [], - }; - const call: InterceptingCallInterface = getInterceptingCall( - interceptorArgs, - callProperties.methodDefinition, - callProperties.callOptions, - callProperties.channel - ); - /* This needs to happen before the emitter is used. Unfortunately we can't - * enforce this with the type system. We need to construct this emitter - * before calling the CallInvocationTransformer, and we need to create the - * call after that. */ - emitter.call = call; - if (callProperties.callOptions.credentials) { - call.setCredentials(callProperties.callOptions.credentials); - } - let responseMessage: ResponseType | null = null; - let receivedStatus = false; - const callerStackError = new Error(); - call.start(callProperties.metadata, { - onReceiveMetadata: (metadata) => { - emitter.emit('metadata', metadata); - }, - // eslint-disable-next-line @typescript-eslint/no-explicit-any - onReceiveMessage(message: any) { - if (responseMessage !== null) { - call.cancelWithStatus(Status.INTERNAL, 'Too many responses received'); - } - responseMessage = message; - }, - onReceiveStatus(status: StatusObject) { - if (receivedStatus) { - return; - } - receivedStatus = true; - if (status.code === Status.OK) { - if (responseMessage === null) { - const callerStack = getErrorStackString(callerStackError); - callProperties.callback!(callErrorFromStatus({ - code: Status.INTERNAL, - details: 'No message received', - metadata: status.metadata - }, callerStack)); - } else { - callProperties.callback!(null, responseMessage); - } - } else { - const callerStack = getErrorStackString(callerStackError); - callProperties.callback!(callErrorFromStatus(status, callerStack)); - } - emitter.emit('status', status); - }, - }); - call.sendMessage(argument); - call.halfClose(); - return emitter; - } - - makeClientStreamRequest( - method: string, - serialize: (value: RequestType) => Buffer, - deserialize: (value: Buffer) => ResponseType, - metadata: Metadata, - options: CallOptions, - callback: UnaryCallback - ): ClientWritableStream; - makeClientStreamRequest( - method: string, - serialize: (value: RequestType) => Buffer, - deserialize: (value: Buffer) => ResponseType, - metadata: Metadata, - callback: UnaryCallback - ): ClientWritableStream; - makeClientStreamRequest( - method: string, - serialize: (value: RequestType) => Buffer, - deserialize: (value: Buffer) => ResponseType, - options: CallOptions, - callback: UnaryCallback - ): ClientWritableStream; - makeClientStreamRequest( - method: string, - serialize: (value: RequestType) => Buffer, - deserialize: (value: Buffer) => ResponseType, - callback: UnaryCallback - ): ClientWritableStream; - makeClientStreamRequest( - method: string, - serialize: (value: RequestType) => Buffer, - deserialize: (value: Buffer) => ResponseType, - metadata: Metadata | CallOptions | UnaryCallback, - options?: CallOptions | UnaryCallback, - callback?: UnaryCallback - ): ClientWritableStream { - const checkedArguments = this.checkOptionalUnaryResponseArguments( - metadata, - options, - callback - ); - const methodDefinition: ClientMethodDefinition< - RequestType, - ResponseType - > = { - path: method, - requestStream: true, - responseStream: false, - requestSerialize: serialize, - responseDeserialize: deserialize, - }; - let callProperties: CallProperties = { - metadata: checkedArguments.metadata, - call: new ClientWritableStreamImpl(serialize), - channel: this[CHANNEL_SYMBOL], - methodDefinition: methodDefinition, - callOptions: checkedArguments.options, - callback: checkedArguments.callback, - }; - if (this[CALL_INVOCATION_TRANSFORMER_SYMBOL]) { - callProperties = this[CALL_INVOCATION_TRANSFORMER_SYMBOL]!( - callProperties - ) as CallProperties; - } - const emitter: ClientWritableStream = callProperties.call as ClientWritableStream; - const interceptorArgs: InterceptorArguments = { - clientInterceptors: this[INTERCEPTOR_SYMBOL], - clientInterceptorProviders: this[INTERCEPTOR_PROVIDER_SYMBOL], - callInterceptors: callProperties.callOptions.interceptors ?? [], - callInterceptorProviders: - callProperties.callOptions.interceptor_providers ?? [], - }; - const call: InterceptingCallInterface = getInterceptingCall( - interceptorArgs, - callProperties.methodDefinition, - callProperties.callOptions, - callProperties.channel - ); - /* This needs to happen before the emitter is used. Unfortunately we can't - * enforce this with the type system. We need to construct this emitter - * before calling the CallInvocationTransformer, and we need to create the - * call after that. */ - emitter.call = call; - if (callProperties.callOptions.credentials) { - call.setCredentials(callProperties.callOptions.credentials); - } - let responseMessage: ResponseType | null = null; - let receivedStatus = false; - const callerStackError = new Error(); - call.start(callProperties.metadata, { - onReceiveMetadata: (metadata) => { - emitter.emit('metadata', metadata); - }, - // eslint-disable-next-line @typescript-eslint/no-explicit-any - onReceiveMessage(message: any) { - if (responseMessage !== null) { - call.cancelWithStatus(Status.INTERNAL, 'Too many responses received'); - } - responseMessage = message; - }, - onReceiveStatus(status: StatusObject) { - if (receivedStatus) { - return; - } - receivedStatus = true; - if (status.code === Status.OK) { - if (responseMessage === null) { - const callerStack = getErrorStackString(callerStackError); - callProperties.callback!(callErrorFromStatus({ - code: Status.INTERNAL, - details: 'No message received', - metadata: status.metadata - }, callerStack)); - } else { - callProperties.callback!(null, responseMessage); - } - } else { - const callerStack = getErrorStackString(callerStackError); - callProperties.callback!(callErrorFromStatus(status, callerStack)); - } - emitter.emit('status', status); - }, - }); - return emitter; - } - - private checkMetadataAndOptions( - arg1?: Metadata | CallOptions, - arg2?: CallOptions - ): { metadata: Metadata; options: CallOptions } { - let metadata: Metadata; - let options: CallOptions; - if (arg1 instanceof Metadata) { - metadata = arg1; - if (arg2) { - options = arg2; - } else { - options = {}; - } - } else { - if (arg1) { - options = arg1; - } else { - options = {}; - } - metadata = new Metadata(); - } - return { metadata, options }; - } - - makeServerStreamRequest( - method: string, - serialize: (value: RequestType) => Buffer, - deserialize: (value: Buffer) => ResponseType, - argument: RequestType, - metadata: Metadata, - options?: CallOptions - ): ClientReadableStream; - makeServerStreamRequest( - method: string, - serialize: (value: RequestType) => Buffer, - deserialize: (value: Buffer) => ResponseType, - argument: RequestType, - options?: CallOptions - ): ClientReadableStream; - makeServerStreamRequest( - method: string, - serialize: (value: RequestType) => Buffer, - deserialize: (value: Buffer) => ResponseType, - argument: RequestType, - metadata?: Metadata | CallOptions, - options?: CallOptions - ): ClientReadableStream { - const checkedArguments = this.checkMetadataAndOptions(metadata, options); - const methodDefinition: ClientMethodDefinition< - RequestType, - ResponseType - > = { - path: method, - requestStream: false, - responseStream: true, - requestSerialize: serialize, - responseDeserialize: deserialize, - }; - let callProperties: CallProperties = { - argument: argument, - metadata: checkedArguments.metadata, - call: new ClientReadableStreamImpl(deserialize), - channel: this[CHANNEL_SYMBOL], - methodDefinition: methodDefinition, - callOptions: checkedArguments.options, - }; - if (this[CALL_INVOCATION_TRANSFORMER_SYMBOL]) { - callProperties = this[CALL_INVOCATION_TRANSFORMER_SYMBOL]!( - callProperties - ) as CallProperties; - } - const stream: ClientReadableStream = callProperties.call as ClientReadableStream; - const interceptorArgs: InterceptorArguments = { - clientInterceptors: this[INTERCEPTOR_SYMBOL], - clientInterceptorProviders: this[INTERCEPTOR_PROVIDER_SYMBOL], - callInterceptors: callProperties.callOptions.interceptors ?? [], - callInterceptorProviders: - callProperties.callOptions.interceptor_providers ?? [], - }; - const call: InterceptingCallInterface = getInterceptingCall( - interceptorArgs, - callProperties.methodDefinition, - callProperties.callOptions, - callProperties.channel - ); - /* This needs to happen before the emitter is used. Unfortunately we can't - * enforce this with the type system. We need to construct this emitter - * before calling the CallInvocationTransformer, and we need to create the - * call after that. */ - stream.call = call; - if (callProperties.callOptions.credentials) { - call.setCredentials(callProperties.callOptions.credentials); - } - let receivedStatus = false; - const callerStackError = new Error(); - call.start(callProperties.metadata, { - onReceiveMetadata(metadata: Metadata) { - stream.emit('metadata', metadata); - }, - // eslint-disable-next-line @typescript-eslint/no-explicit-any - onReceiveMessage(message: any) { - stream.push(message); - }, - onReceiveStatus(status: StatusObject) { - if (receivedStatus) { - return; - } - receivedStatus = true; - stream.push(null); - if (status.code !== Status.OK) { - const callerStack = getErrorStackString(callerStackError); - stream.emit('error', callErrorFromStatus(status, callerStack)); - } - stream.emit('status', status); - }, - }); - call.sendMessage(argument); - call.halfClose(); - return stream; - } - - makeBidiStreamRequest( - method: string, - serialize: (value: RequestType) => Buffer, - deserialize: (value: Buffer) => ResponseType, - metadata: Metadata, - options?: CallOptions - ): ClientDuplexStream; - makeBidiStreamRequest( - method: string, - serialize: (value: RequestType) => Buffer, - deserialize: (value: Buffer) => ResponseType, - options?: CallOptions - ): ClientDuplexStream; - makeBidiStreamRequest( - method: string, - serialize: (value: RequestType) => Buffer, - deserialize: (value: Buffer) => ResponseType, - metadata?: Metadata | CallOptions, - options?: CallOptions - ): ClientDuplexStream { - const checkedArguments = this.checkMetadataAndOptions(metadata, options); - const methodDefinition: ClientMethodDefinition< - RequestType, - ResponseType - > = { - path: method, - requestStream: true, - responseStream: true, - requestSerialize: serialize, - responseDeserialize: deserialize, - }; - let callProperties: CallProperties = { - metadata: checkedArguments.metadata, - call: new ClientDuplexStreamImpl( - serialize, - deserialize - ), - channel: this[CHANNEL_SYMBOL], - methodDefinition: methodDefinition, - callOptions: checkedArguments.options, - }; - if (this[CALL_INVOCATION_TRANSFORMER_SYMBOL]) { - callProperties = this[CALL_INVOCATION_TRANSFORMER_SYMBOL]!( - callProperties - ) as CallProperties; - } - const stream: ClientDuplexStream< - RequestType, - ResponseType - > = callProperties.call as ClientDuplexStream; - const interceptorArgs: InterceptorArguments = { - clientInterceptors: this[INTERCEPTOR_SYMBOL], - clientInterceptorProviders: this[INTERCEPTOR_PROVIDER_SYMBOL], - callInterceptors: callProperties.callOptions.interceptors ?? [], - callInterceptorProviders: - callProperties.callOptions.interceptor_providers ?? [], - }; - const call: InterceptingCallInterface = getInterceptingCall( - interceptorArgs, - callProperties.methodDefinition, - callProperties.callOptions, - callProperties.channel - ); - /* This needs to happen before the emitter is used. Unfortunately we can't - * enforce this with the type system. We need to construct this emitter - * before calling the CallInvocationTransformer, and we need to create the - * call after that. */ - stream.call = call; - if (callProperties.callOptions.credentials) { - call.setCredentials(callProperties.callOptions.credentials); - } - let receivedStatus = false; - const callerStackError = new Error(); - call.start(callProperties.metadata, { - onReceiveMetadata(metadata: Metadata) { - stream.emit('metadata', metadata); - }, - onReceiveMessage(message: Buffer) { - stream.push(message); - }, - onReceiveStatus(status: StatusObject) { - if (receivedStatus) { - return; - } - receivedStatus = true; - stream.push(null); - if (status.code !== Status.OK) { - const callerStack = getErrorStackString(callerStackError); - stream.emit('error', callErrorFromStatus(status, callerStack)); - } - stream.emit('status', status); - }, - }); - return stream; - } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/compression-algorithms.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/compression-algorithms.ts deleted file mode 100644 index ca2c7a62..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/compression-algorithms.ts +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright 2021 gRPC authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -export enum CompressionAlgorithms { - identity = 0, - deflate = 1, - gzip = 2 -}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/compression-filter.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/compression-filter.ts deleted file mode 100644 index 40825467..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/compression-filter.ts +++ /dev/null @@ -1,289 +0,0 @@ -/* - * Copyright 2019 gRPC authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -import * as zlib from 'zlib'; - -import { Call, WriteObject, WriteFlags } from './call-stream'; -import { Channel } from './channel'; -import { ChannelOptions } from './channel-options'; -import { CompressionAlgorithms } from './compression-algorithms'; -import { LogVerbosity } from './constants'; -import { BaseFilter, Filter, FilterFactory } from './filter'; -import * as logging from './logging'; -import { Metadata, MetadataValue } from './metadata'; - -const isCompressionAlgorithmKey = (key: number): key is CompressionAlgorithms => { - return typeof key === 'number' && typeof CompressionAlgorithms[key] === 'string'; -} - -type CompressionAlgorithm = keyof typeof CompressionAlgorithms; - -type SharedCompressionFilterConfig = { - serverSupportedEncodingHeader?: string; -}; - -abstract class CompressionHandler { - protected abstract compressMessage(message: Buffer): Promise; - protected abstract decompressMessage(data: Buffer): Promise; - /** - * @param message Raw uncompressed message bytes - * @param compress Indicates whether the message should be compressed - * @return Framed message, compressed if applicable - */ - async writeMessage(message: Buffer, compress: boolean): Promise { - let messageBuffer = message; - if (compress) { - messageBuffer = await this.compressMessage(messageBuffer); - } - const output = Buffer.allocUnsafe(messageBuffer.length + 5); - output.writeUInt8(compress ? 1 : 0, 0); - output.writeUInt32BE(messageBuffer.length, 1); - messageBuffer.copy(output, 5); - return output; - } - /** - * @param data Framed message, possibly compressed - * @return Uncompressed message - */ - async readMessage(data: Buffer): Promise { - const compressed = data.readUInt8(0) === 1; - let messageBuffer = data.slice(5); - if (compressed) { - messageBuffer = await this.decompressMessage(messageBuffer); - } - return messageBuffer; - } -} - -class IdentityHandler extends CompressionHandler { - async compressMessage(message: Buffer) { - return message; - } - - async writeMessage(message: Buffer, compress: boolean): Promise { - const output = Buffer.allocUnsafe(message.length + 5); - /* With "identity" compression, messages should always be marked as - * uncompressed */ - output.writeUInt8(0, 0); - output.writeUInt32BE(message.length, 1); - message.copy(output, 5); - return output; - } - - decompressMessage(message: Buffer): Promise { - return Promise.reject( - new Error( - 'Received compressed message but "grpc-encoding" header was identity' - ) - ); - } -} - -class DeflateHandler extends CompressionHandler { - compressMessage(message: Buffer) { - return new Promise((resolve, reject) => { - zlib.deflate(message, (err, output) => { - if (err) { - reject(err); - } else { - resolve(output); - } - }); - }); - } - - decompressMessage(message: Buffer) { - return new Promise((resolve, reject) => { - zlib.inflate(message, (err, output) => { - if (err) { - reject(err); - } else { - resolve(output); - } - }); - }); - } -} - -class GzipHandler extends CompressionHandler { - compressMessage(message: Buffer) { - return new Promise((resolve, reject) => { - zlib.gzip(message, (err, output) => { - if (err) { - reject(err); - } else { - resolve(output); - } - }); - }); - } - - decompressMessage(message: Buffer) { - return new Promise((resolve, reject) => { - zlib.unzip(message, (err, output) => { - if (err) { - reject(err); - } else { - resolve(output); - } - }); - }); - } -} - -class UnknownHandler extends CompressionHandler { - constructor(private readonly compressionName: string) { - super(); - } - compressMessage(message: Buffer): Promise { - return Promise.reject( - new Error( - `Received message compressed with unsupported compression method ${this.compressionName}` - ) - ); - } - - decompressMessage(message: Buffer): Promise { - // This should be unreachable - return Promise.reject( - new Error(`Compression method not supported: ${this.compressionName}`) - ); - } -} - -function getCompressionHandler(compressionName: string): CompressionHandler { - switch (compressionName) { - case 'identity': - return new IdentityHandler(); - case 'deflate': - return new DeflateHandler(); - case 'gzip': - return new GzipHandler(); - default: - return new UnknownHandler(compressionName); - } -} - -export class CompressionFilter extends BaseFilter implements Filter { - private sendCompression: CompressionHandler = new IdentityHandler(); - private receiveCompression: CompressionHandler = new IdentityHandler(); - private currentCompressionAlgorithm: CompressionAlgorithm = 'identity'; - - constructor(channelOptions: ChannelOptions, private sharedFilterConfig: SharedCompressionFilterConfig) { - super(); - - const compressionAlgorithmKey = channelOptions['grpc.default_compression_algorithm']; - if (compressionAlgorithmKey !== undefined) { - if (isCompressionAlgorithmKey(compressionAlgorithmKey)) { - const clientSelectedEncoding = CompressionAlgorithms[compressionAlgorithmKey] as CompressionAlgorithm; - const serverSupportedEncodings = sharedFilterConfig.serverSupportedEncodingHeader?.split(','); - /** - * There are two possible situations here: - * 1) We don't have any info yet from the server about what compression it supports - * In that case we should just use what the client tells us to use - * 2) We've previously received a response from the server including a grpc-accept-encoding header - * In that case we only want to use the encoding chosen by the client if the server supports it - */ - if (!serverSupportedEncodings || serverSupportedEncodings.includes(clientSelectedEncoding)) { - this.currentCompressionAlgorithm = clientSelectedEncoding; - this.sendCompression = getCompressionHandler(this.currentCompressionAlgorithm); - } - } else { - logging.log(LogVerbosity.ERROR, `Invalid value provided for grpc.default_compression_algorithm option: ${compressionAlgorithmKey}`); - } - } - } - - async sendMetadata(metadata: Promise): Promise { - const headers: Metadata = await metadata; - headers.set('grpc-accept-encoding', 'identity,deflate,gzip'); - headers.set('accept-encoding', 'identity'); - - // No need to send the header if it's "identity" - behavior is identical; save the bandwidth - if (this.currentCompressionAlgorithm === 'identity') { - headers.remove('grpc-encoding'); - } else { - headers.set('grpc-encoding', this.currentCompressionAlgorithm); - } - - return headers; - } - - receiveMetadata(metadata: Metadata): Metadata { - const receiveEncoding: MetadataValue[] = metadata.get('grpc-encoding'); - if (receiveEncoding.length > 0) { - const encoding: MetadataValue = receiveEncoding[0]; - if (typeof encoding === 'string') { - this.receiveCompression = getCompressionHandler(encoding); - } - } - metadata.remove('grpc-encoding'); - - /* Check to see if the compression we're using to send messages is supported by the server - * If not, reset the sendCompression filter and have it use the default IdentityHandler */ - const serverSupportedEncodingsHeader = metadata.get('grpc-accept-encoding')[0] as string | undefined; - if (serverSupportedEncodingsHeader) { - this.sharedFilterConfig.serverSupportedEncodingHeader = serverSupportedEncodingsHeader; - const serverSupportedEncodings = serverSupportedEncodingsHeader.split(','); - - if (!serverSupportedEncodings.includes(this.currentCompressionAlgorithm)) { - this.sendCompression = new IdentityHandler(); - this.currentCompressionAlgorithm = 'identity'; - } - } - metadata.remove('grpc-accept-encoding'); - return metadata; - } - - async sendMessage(message: Promise): Promise { - /* This filter is special. The input message is the bare message bytes, - * and the output is a framed and possibly compressed message. For this - * reason, this filter should be at the bottom of the filter stack */ - const resolvedMessage: WriteObject = await message; - let compress: boolean; - if (this.sendCompression instanceof IdentityHandler) { - compress = false; - } else { - compress = ((resolvedMessage.flags ?? 0) & WriteFlags.NoCompress) === 0; - } - - return { - message: await this.sendCompression.writeMessage( - resolvedMessage.message, - compress - ), - flags: resolvedMessage.flags, - }; - } - - async receiveMessage(message: Promise) { - /* This filter is also special. The input message is framed and possibly - * compressed, and the output message is deframed and uncompressed. So - * this is another reason that this filter should be at the bottom of the - * filter stack. */ - return this.receiveCompression.readMessage(await message); - } -} - -export class CompressionFilterFactory - implements FilterFactory { - private sharedFilterConfig: SharedCompressionFilterConfig = {}; - constructor(private readonly channel: Channel, private readonly options: ChannelOptions) {} - createFilter(callStream: Call): CompressionFilter { - return new CompressionFilter(this.options, this.sharedFilterConfig); - } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/connectivity-state.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/connectivity-state.ts deleted file mode 100644 index 560ab9c3..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/connectivity-state.ts +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright 2021 gRPC authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -export enum ConnectivityState { - IDLE, - CONNECTING, - READY, - TRANSIENT_FAILURE, - SHUTDOWN, -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/constants.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/constants.ts deleted file mode 100644 index 865b24c9..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/constants.ts +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright 2019 gRPC authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -export enum Status { - OK = 0, - CANCELLED, - UNKNOWN, - INVALID_ARGUMENT, - DEADLINE_EXCEEDED, - NOT_FOUND, - ALREADY_EXISTS, - PERMISSION_DENIED, - RESOURCE_EXHAUSTED, - FAILED_PRECONDITION, - ABORTED, - OUT_OF_RANGE, - UNIMPLEMENTED, - INTERNAL, - UNAVAILABLE, - DATA_LOSS, - UNAUTHENTICATED, -} - -export enum LogVerbosity { - DEBUG = 0, - INFO, - ERROR, - NONE, -} - -/** - * NOTE: This enum is not currently used in any implemented API in this - * library. It is included only for type parity with the other implementation. - */ -export enum Propagate { - DEADLINE = 1, - CENSUS_STATS_CONTEXT = 2, - CENSUS_TRACING_CONTEXT = 4, - CANCELLATION = 8, - // https://github.com/grpc/grpc/blob/master/include/grpc/impl/codegen/propagation_bits.h#L43 - DEFAULTS = 0xffff | - Propagate.DEADLINE | - Propagate.CENSUS_STATS_CONTEXT | - Propagate.CENSUS_TRACING_CONTEXT | - Propagate.CANCELLATION, -} - -// -1 means unlimited -export const DEFAULT_MAX_SEND_MESSAGE_LENGTH = -1; - -// 4 MB default -export const DEFAULT_MAX_RECEIVE_MESSAGE_LENGTH = 4 * 1024 * 1024; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/deadline-filter.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/deadline-filter.ts deleted file mode 100644 index 7bdd764f..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/deadline-filter.ts +++ /dev/null @@ -1,120 +0,0 @@ -/* - * Copyright 2019 gRPC authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -import { Call, StatusObject } from './call-stream'; -import { Channel } from './channel'; -import { Status } from './constants'; -import { BaseFilter, Filter, FilterFactory } from './filter'; -import { Metadata } from './metadata'; - -const units: Array<[string, number]> = [ - ['m', 1], - ['S', 1000], - ['M', 60 * 1000], - ['H', 60 * 60 * 1000], -]; - -function getDeadline(deadline: number) { - const now = new Date().getTime(); - const timeoutMs = Math.max(deadline - now, 0); - for (const [unit, factor] of units) { - const amount = timeoutMs / factor; - if (amount < 1e8) { - return String(Math.ceil(amount)) + unit; - } - } - throw new Error('Deadline is too far in the future'); -} - -export class DeadlineFilter extends BaseFilter implements Filter { - private timer: NodeJS.Timer | null = null; - private deadline = Infinity; - constructor( - private readonly channel: Channel, - private readonly callStream: Call - ) { - super(); - this.retreiveDeadline(); - this.runTimer(); - } - - private retreiveDeadline() { - const callDeadline = this.callStream.getDeadline(); - if (callDeadline instanceof Date) { - this.deadline = callDeadline.getTime(); - } else { - this.deadline = callDeadline; - } - } - - private runTimer() { - if (this.timer) { - clearTimeout(this.timer); - } - const now: number = new Date().getTime(); - const timeout = this.deadline - now; - if (timeout <= 0) { - process.nextTick(() => { - this.callStream.cancelWithStatus( - Status.DEADLINE_EXCEEDED, - 'Deadline exceeded' - ); - }); - } else if (this.deadline !== Infinity) { - this.timer = setTimeout(() => { - this.callStream.cancelWithStatus( - Status.DEADLINE_EXCEEDED, - 'Deadline exceeded' - ); - }, timeout); - this.timer.unref?.(); - } - } - - refresh() { - this.retreiveDeadline(); - this.runTimer(); - } - - async sendMetadata(metadata: Promise) { - if (this.deadline === Infinity) { - return metadata; - } - /* The input metadata promise depends on the original channel.connect() - * promise, so when it is complete that implies that the channel is - * connected */ - const finalMetadata = await metadata; - const timeoutString = getDeadline(this.deadline); - finalMetadata.set('grpc-timeout', timeoutString); - return finalMetadata; - } - - receiveTrailers(status: StatusObject) { - if (this.timer) { - clearTimeout(this.timer); - } - return status; - } -} - -export class DeadlineFilterFactory implements FilterFactory { - constructor(private readonly channel: Channel) {} - - createFilter(callStream: Call): DeadlineFilter { - return new DeadlineFilter(this.channel, callStream); - } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/duration.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/duration.ts deleted file mode 100644 index 278c9ae5..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/duration.ts +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2022 gRPC authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -export interface Duration { - seconds: number; - nanos: number; -} - -export function msToDuration(millis: number): Duration { - return { - seconds: (millis / 1000) | 0, - nanos: (millis % 1000) * 1_000_000 | 0 - }; -} - -export function durationToMs(duration: Duration): number { - return (duration.seconds * 1000 + duration.nanos / 1_000_000) | 0; -} - -export function isDuration(value: any): value is Duration { - return (typeof value.seconds === 'number') && (typeof value.nanos === 'number'); -} \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/events.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/events.ts deleted file mode 100644 index 7718746d..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/events.ts +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright 2019 gRPC authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -export interface EmitterAugmentation1 { - addListener(event: Name, listener: (arg1: Arg) => void): this; - emit(event: Name, arg1: Arg): boolean; - on(event: Name, listener: (arg1: Arg) => void): this; - once(event: Name, listener: (arg1: Arg) => void): this; - prependListener(event: Name, listener: (arg1: Arg) => void): this; - prependOnceListener(event: Name, listener: (arg1: Arg) => void): this; - removeListener(event: Name, listener: (arg1: Arg) => void): this; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/experimental.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/experimental.ts deleted file mode 100644 index d58495f4..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/experimental.ts +++ /dev/null @@ -1,39 +0,0 @@ -export { trace, log } from './logging'; -export { - Resolver, - ResolverListener, - registerResolver, - ConfigSelector, -} from './resolver'; -export { GrpcUri, uriToString } from './uri-parser'; -export { Duration, durationToMs } from './duration'; -export { ServiceConfig } from './service-config'; -export { BackoffTimeout } from './backoff-timeout'; -export { - LoadBalancer, - LoadBalancingConfig, - ChannelControlHelper, - createChildChannelControlHelper, - registerLoadBalancerType, - getFirstUsableConfig, - validateLoadBalancingConfig, -} from './load-balancer'; -export { - SubchannelAddress, - subchannelAddressToString, -} from './subchannel-address'; -export { ChildLoadBalancerHandler } from './load-balancer-child-handler'; -export { - Picker, - UnavailablePicker, - QueuePicker, - PickResult, - PickArgs, - PickResultType, -} from './picker'; -export { Call as CallStream } from './call-stream'; -export { Filter, BaseFilter, FilterFactory } from './filter'; -export { FilterStackFactory } from './filter-stack'; -export { registerAdminService } from './admin'; -export { SubchannelInterface, BaseSubchannelWrapper, ConnectivityStateListener } from './subchannel-interface'; -export { OutlierDetectionLoadBalancingConfig, SuccessRateEjectionConfig, FailurePercentageEjectionConfig } from './load-balancer-outlier-detection'; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/filter-stack.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/filter-stack.ts deleted file mode 100644 index a9e75442..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/filter-stack.ts +++ /dev/null @@ -1,102 +0,0 @@ -/* - * Copyright 2019 gRPC authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -import { Call, StatusObject, WriteObject } from './call-stream'; -import { Filter, FilterFactory } from './filter'; -import { Metadata } from './metadata'; - -export class FilterStack implements Filter { - constructor(private readonly filters: Filter[]) {} - - sendMetadata(metadata: Promise) { - let result: Promise = metadata; - - for (let i = 0; i < this.filters.length; i++) { - result = this.filters[i].sendMetadata(result); - } - - return result; - } - - receiveMetadata(metadata: Metadata) { - let result: Metadata = metadata; - - for (let i = this.filters.length - 1; i >= 0; i--) { - result = this.filters[i].receiveMetadata(result); - } - - return result; - } - - sendMessage(message: Promise): Promise { - let result: Promise = message; - - for (let i = 0; i < this.filters.length; i++) { - result = this.filters[i].sendMessage(result); - } - - return result; - } - - receiveMessage(message: Promise): Promise { - let result: Promise = message; - - for (let i = this.filters.length - 1; i >= 0; i--) { - result = this.filters[i].receiveMessage(result); - } - - return result; - } - - receiveTrailers(status: StatusObject): StatusObject { - let result: StatusObject = status; - - for (let i = this.filters.length - 1; i >= 0; i--) { - result = this.filters[i].receiveTrailers(result); - } - - return result; - } - - refresh(): void { - for (const filter of this.filters) { - filter.refresh(); - } - } - - push(filters: Filter[]) { - this.filters.unshift(...filters); - } - - getFilters(): Filter[] { - return this.filters; - } -} - -export class FilterStackFactory implements FilterFactory { - constructor(private readonly factories: Array>) {} - - push(filterFactories: FilterFactory[]) { - this.factories.unshift(...filterFactories); - } - - createFilter(callStream: Call): FilterStack { - return new FilterStack( - this.factories.map((factory) => factory.createFilter(callStream)) - ); - } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/filter.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/filter.ts deleted file mode 100644 index 8475a0a5..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/filter.ts +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright 2019 gRPC authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -import { Call, StatusObject, WriteObject } from './call-stream'; -import { Metadata } from './metadata'; - -/** - * Filter classes represent related per-call logic and state that is primarily - * used to modify incoming and outgoing data - */ -export interface Filter { - sendMetadata(metadata: Promise): Promise; - - receiveMetadata(metadata: Metadata): Metadata; - - sendMessage(message: Promise): Promise; - - receiveMessage(message: Promise): Promise; - - receiveTrailers(status: StatusObject): StatusObject; - - refresh(): void; -} - -export abstract class BaseFilter implements Filter { - async sendMetadata(metadata: Promise): Promise { - return metadata; - } - - receiveMetadata(metadata: Metadata): Metadata { - return metadata; - } - - async sendMessage(message: Promise): Promise { - return message; - } - - async receiveMessage(message: Promise): Promise { - return message; - } - - receiveTrailers(status: StatusObject): StatusObject { - return status; - } - - refresh(): void {} -} - -export interface FilterFactory { - createFilter(callStream: Call): T; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/channelz.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/channelz.ts deleted file mode 100644 index 367cf27f..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/channelz.ts +++ /dev/null @@ -1,73 +0,0 @@ -import type * as grpc from '../index'; -import type { MessageTypeDefinition } from '@grpc/proto-loader'; - -import type { ChannelzClient as _grpc_channelz_v1_ChannelzClient, ChannelzDefinition as _grpc_channelz_v1_ChannelzDefinition } from './grpc/channelz/v1/Channelz'; - -type SubtypeConstructor any, Subtype> = { - new(...args: ConstructorParameters): Subtype; -}; - -export interface ProtoGrpcType { - google: { - protobuf: { - Any: MessageTypeDefinition - BoolValue: MessageTypeDefinition - BytesValue: MessageTypeDefinition - DoubleValue: MessageTypeDefinition - Duration: MessageTypeDefinition - FloatValue: MessageTypeDefinition - Int32Value: MessageTypeDefinition - Int64Value: MessageTypeDefinition - StringValue: MessageTypeDefinition - Timestamp: MessageTypeDefinition - UInt32Value: MessageTypeDefinition - UInt64Value: MessageTypeDefinition - } - } - grpc: { - channelz: { - v1: { - Address: MessageTypeDefinition - Channel: MessageTypeDefinition - ChannelConnectivityState: MessageTypeDefinition - ChannelData: MessageTypeDefinition - ChannelRef: MessageTypeDefinition - ChannelTrace: MessageTypeDefinition - ChannelTraceEvent: MessageTypeDefinition - /** - * Channelz is a service exposed by gRPC servers that provides detailed debug - * information. - */ - Channelz: SubtypeConstructor & { service: _grpc_channelz_v1_ChannelzDefinition } - GetChannelRequest: MessageTypeDefinition - GetChannelResponse: MessageTypeDefinition - GetServerRequest: MessageTypeDefinition - GetServerResponse: MessageTypeDefinition - GetServerSocketsRequest: MessageTypeDefinition - GetServerSocketsResponse: MessageTypeDefinition - GetServersRequest: MessageTypeDefinition - GetServersResponse: MessageTypeDefinition - GetSocketRequest: MessageTypeDefinition - GetSocketResponse: MessageTypeDefinition - GetSubchannelRequest: MessageTypeDefinition - GetSubchannelResponse: MessageTypeDefinition - GetTopChannelsRequest: MessageTypeDefinition - GetTopChannelsResponse: MessageTypeDefinition - Security: MessageTypeDefinition - Server: MessageTypeDefinition - ServerData: MessageTypeDefinition - ServerRef: MessageTypeDefinition - Socket: MessageTypeDefinition - SocketData: MessageTypeDefinition - SocketOption: MessageTypeDefinition - SocketOptionLinger: MessageTypeDefinition - SocketOptionTcpInfo: MessageTypeDefinition - SocketOptionTimeout: MessageTypeDefinition - SocketRef: MessageTypeDefinition - Subchannel: MessageTypeDefinition - SubchannelRef: MessageTypeDefinition - } - } - } -} - diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/google/protobuf/Any.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/google/protobuf/Any.ts deleted file mode 100644 index fcaa6724..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/google/protobuf/Any.ts +++ /dev/null @@ -1,13 +0,0 @@ -// Original file: null - -import type { AnyExtension } from '@grpc/proto-loader'; - -export type Any = AnyExtension | { - type_url: string; - value: Buffer | Uint8Array | string; -} - -export interface Any__Output { - 'type_url': (string); - 'value': (Buffer); -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/google/protobuf/BoolValue.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/google/protobuf/BoolValue.ts deleted file mode 100644 index 86507eaf..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/google/protobuf/BoolValue.ts +++ /dev/null @@ -1,10 +0,0 @@ -// Original file: null - - -export interface BoolValue { - 'value'?: (boolean); -} - -export interface BoolValue__Output { - 'value': (boolean); -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/google/protobuf/BytesValue.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/google/protobuf/BytesValue.ts deleted file mode 100644 index 9cec76f7..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/google/protobuf/BytesValue.ts +++ /dev/null @@ -1,10 +0,0 @@ -// Original file: null - - -export interface BytesValue { - 'value'?: (Buffer | Uint8Array | string); -} - -export interface BytesValue__Output { - 'value': (Buffer); -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/google/protobuf/DoubleValue.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/google/protobuf/DoubleValue.ts deleted file mode 100644 index d70b303c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/google/protobuf/DoubleValue.ts +++ /dev/null @@ -1,10 +0,0 @@ -// Original file: null - - -export interface DoubleValue { - 'value'?: (number | string); -} - -export interface DoubleValue__Output { - 'value': (number); -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/google/protobuf/Duration.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/google/protobuf/Duration.ts deleted file mode 100644 index 8595377a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/google/protobuf/Duration.ts +++ /dev/null @@ -1,13 +0,0 @@ -// Original file: null - -import type { Long } from '@grpc/proto-loader'; - -export interface Duration { - 'seconds'?: (number | string | Long); - 'nanos'?: (number); -} - -export interface Duration__Output { - 'seconds': (string); - 'nanos': (number); -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/google/protobuf/FloatValue.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/google/protobuf/FloatValue.ts deleted file mode 100644 index 54a655fb..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/google/protobuf/FloatValue.ts +++ /dev/null @@ -1,10 +0,0 @@ -// Original file: null - - -export interface FloatValue { - 'value'?: (number | string); -} - -export interface FloatValue__Output { - 'value': (number); -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/google/protobuf/Int32Value.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/google/protobuf/Int32Value.ts deleted file mode 100644 index ec4eeb7e..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/google/protobuf/Int32Value.ts +++ /dev/null @@ -1,10 +0,0 @@ -// Original file: null - - -export interface Int32Value { - 'value'?: (number); -} - -export interface Int32Value__Output { - 'value': (number); -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/google/protobuf/Int64Value.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/google/protobuf/Int64Value.ts deleted file mode 100644 index f7375196..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/google/protobuf/Int64Value.ts +++ /dev/null @@ -1,11 +0,0 @@ -// Original file: null - -import type { Long } from '@grpc/proto-loader'; - -export interface Int64Value { - 'value'?: (number | string | Long); -} - -export interface Int64Value__Output { - 'value': (string); -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/google/protobuf/StringValue.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/google/protobuf/StringValue.ts deleted file mode 100644 index 673090e3..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/google/protobuf/StringValue.ts +++ /dev/null @@ -1,10 +0,0 @@ -// Original file: null - - -export interface StringValue { - 'value'?: (string); -} - -export interface StringValue__Output { - 'value': (string); -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/google/protobuf/Timestamp.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/google/protobuf/Timestamp.ts deleted file mode 100644 index ceaa32b5..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/google/protobuf/Timestamp.ts +++ /dev/null @@ -1,13 +0,0 @@ -// Original file: null - -import type { Long } from '@grpc/proto-loader'; - -export interface Timestamp { - 'seconds'?: (number | string | Long); - 'nanos'?: (number); -} - -export interface Timestamp__Output { - 'seconds': (string); - 'nanos': (number); -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/google/protobuf/UInt32Value.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/google/protobuf/UInt32Value.ts deleted file mode 100644 index 973ab34a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/google/protobuf/UInt32Value.ts +++ /dev/null @@ -1,10 +0,0 @@ -// Original file: null - - -export interface UInt32Value { - 'value'?: (number); -} - -export interface UInt32Value__Output { - 'value': (number); -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/google/protobuf/UInt64Value.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/google/protobuf/UInt64Value.ts deleted file mode 100644 index 7a85c39c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/google/protobuf/UInt64Value.ts +++ /dev/null @@ -1,11 +0,0 @@ -// Original file: null - -import type { Long } from '@grpc/proto-loader'; - -export interface UInt64Value { - 'value'?: (number | string | Long); -} - -export interface UInt64Value__Output { - 'value': (string); -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/grpc/channelz/v1/Address.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/grpc/channelz/v1/Address.ts deleted file mode 100644 index 259cfeab..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/grpc/channelz/v1/Address.ts +++ /dev/null @@ -1,89 +0,0 @@ -// Original file: proto/channelz.proto - -import type { Any as _google_protobuf_Any, Any__Output as _google_protobuf_Any__Output } from '../../../google/protobuf/Any'; - -/** - * An address type not included above. - */ -export interface _grpc_channelz_v1_Address_OtherAddress { - /** - * The human readable version of the value. This value should be set. - */ - 'name'?: (string); - /** - * The actual address message. - */ - 'value'?: (_google_protobuf_Any | null); -} - -/** - * An address type not included above. - */ -export interface _grpc_channelz_v1_Address_OtherAddress__Output { - /** - * The human readable version of the value. This value should be set. - */ - 'name': (string); - /** - * The actual address message. - */ - 'value': (_google_protobuf_Any__Output | null); -} - -export interface _grpc_channelz_v1_Address_TcpIpAddress { - /** - * Either the IPv4 or IPv6 address in bytes. Will be either 4 bytes or 16 - * bytes in length. - */ - 'ip_address'?: (Buffer | Uint8Array | string); - /** - * 0-64k, or -1 if not appropriate. - */ - 'port'?: (number); -} - -export interface _grpc_channelz_v1_Address_TcpIpAddress__Output { - /** - * Either the IPv4 or IPv6 address in bytes. Will be either 4 bytes or 16 - * bytes in length. - */ - 'ip_address': (Buffer); - /** - * 0-64k, or -1 if not appropriate. - */ - 'port': (number); -} - -/** - * A Unix Domain Socket address. - */ -export interface _grpc_channelz_v1_Address_UdsAddress { - 'filename'?: (string); -} - -/** - * A Unix Domain Socket address. - */ -export interface _grpc_channelz_v1_Address_UdsAddress__Output { - 'filename': (string); -} - -/** - * Address represents the address used to create the socket. - */ -export interface Address { - 'tcpip_address'?: (_grpc_channelz_v1_Address_TcpIpAddress | null); - 'uds_address'?: (_grpc_channelz_v1_Address_UdsAddress | null); - 'other_address'?: (_grpc_channelz_v1_Address_OtherAddress | null); - 'address'?: "tcpip_address"|"uds_address"|"other_address"; -} - -/** - * Address represents the address used to create the socket. - */ -export interface Address__Output { - 'tcpip_address'?: (_grpc_channelz_v1_Address_TcpIpAddress__Output | null); - 'uds_address'?: (_grpc_channelz_v1_Address_UdsAddress__Output | null); - 'other_address'?: (_grpc_channelz_v1_Address_OtherAddress__Output | null); - 'address': "tcpip_address"|"uds_address"|"other_address"; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/grpc/channelz/v1/Channel.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/grpc/channelz/v1/Channel.ts deleted file mode 100644 index 93b4a261..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/grpc/channelz/v1/Channel.ts +++ /dev/null @@ -1,68 +0,0 @@ -// Original file: proto/channelz.proto - -import type { ChannelRef as _grpc_channelz_v1_ChannelRef, ChannelRef__Output as _grpc_channelz_v1_ChannelRef__Output } from '../../../grpc/channelz/v1/ChannelRef'; -import type { ChannelData as _grpc_channelz_v1_ChannelData, ChannelData__Output as _grpc_channelz_v1_ChannelData__Output } from '../../../grpc/channelz/v1/ChannelData'; -import type { SubchannelRef as _grpc_channelz_v1_SubchannelRef, SubchannelRef__Output as _grpc_channelz_v1_SubchannelRef__Output } from '../../../grpc/channelz/v1/SubchannelRef'; -import type { SocketRef as _grpc_channelz_v1_SocketRef, SocketRef__Output as _grpc_channelz_v1_SocketRef__Output } from '../../../grpc/channelz/v1/SocketRef'; - -/** - * Channel is a logical grouping of channels, subchannels, and sockets. - */ -export interface Channel { - /** - * The identifier for this channel. This should bet set. - */ - 'ref'?: (_grpc_channelz_v1_ChannelRef | null); - /** - * Data specific to this channel. - */ - 'data'?: (_grpc_channelz_v1_ChannelData | null); - /** - * There are no ordering guarantees on the order of channel refs. - * There may not be cycles in the ref graph. - * A channel ref may be present in more than one channel or subchannel. - */ - 'channel_ref'?: (_grpc_channelz_v1_ChannelRef)[]; - /** - * At most one of 'channel_ref+subchannel_ref' and 'socket' is set. - * There are no ordering guarantees on the order of subchannel refs. - * There may not be cycles in the ref graph. - * A sub channel ref may be present in more than one channel or subchannel. - */ - 'subchannel_ref'?: (_grpc_channelz_v1_SubchannelRef)[]; - /** - * There are no ordering guarantees on the order of sockets. - */ - 'socket_ref'?: (_grpc_channelz_v1_SocketRef)[]; -} - -/** - * Channel is a logical grouping of channels, subchannels, and sockets. - */ -export interface Channel__Output { - /** - * The identifier for this channel. This should bet set. - */ - 'ref': (_grpc_channelz_v1_ChannelRef__Output | null); - /** - * Data specific to this channel. - */ - 'data': (_grpc_channelz_v1_ChannelData__Output | null); - /** - * There are no ordering guarantees on the order of channel refs. - * There may not be cycles in the ref graph. - * A channel ref may be present in more than one channel or subchannel. - */ - 'channel_ref': (_grpc_channelz_v1_ChannelRef__Output)[]; - /** - * At most one of 'channel_ref+subchannel_ref' and 'socket' is set. - * There are no ordering guarantees on the order of subchannel refs. - * There may not be cycles in the ref graph. - * A sub channel ref may be present in more than one channel or subchannel. - */ - 'subchannel_ref': (_grpc_channelz_v1_SubchannelRef__Output)[]; - /** - * There are no ordering guarantees on the order of sockets. - */ - 'socket_ref': (_grpc_channelz_v1_SocketRef__Output)[]; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/grpc/channelz/v1/ChannelConnectivityState.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/grpc/channelz/v1/ChannelConnectivityState.ts deleted file mode 100644 index be34ab98..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/grpc/channelz/v1/ChannelConnectivityState.ts +++ /dev/null @@ -1,29 +0,0 @@ -// Original file: proto/channelz.proto - - -// Original file: proto/channelz.proto - -export enum _grpc_channelz_v1_ChannelConnectivityState_State { - UNKNOWN = 0, - IDLE = 1, - CONNECTING = 2, - READY = 3, - TRANSIENT_FAILURE = 4, - SHUTDOWN = 5, -} - -/** - * These come from the specified states in this document: - * https://github.com/grpc/grpc/blob/master/doc/connectivity-semantics-and-api.md - */ -export interface ChannelConnectivityState { - 'state'?: (_grpc_channelz_v1_ChannelConnectivityState_State | keyof typeof _grpc_channelz_v1_ChannelConnectivityState_State); -} - -/** - * These come from the specified states in this document: - * https://github.com/grpc/grpc/blob/master/doc/connectivity-semantics-and-api.md - */ -export interface ChannelConnectivityState__Output { - 'state': (keyof typeof _grpc_channelz_v1_ChannelConnectivityState_State); -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/grpc/channelz/v1/ChannelData.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/grpc/channelz/v1/ChannelData.ts deleted file mode 100644 index 6d6824af..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/grpc/channelz/v1/ChannelData.ts +++ /dev/null @@ -1,76 +0,0 @@ -// Original file: proto/channelz.proto - -import type { ChannelConnectivityState as _grpc_channelz_v1_ChannelConnectivityState, ChannelConnectivityState__Output as _grpc_channelz_v1_ChannelConnectivityState__Output } from '../../../grpc/channelz/v1/ChannelConnectivityState'; -import type { ChannelTrace as _grpc_channelz_v1_ChannelTrace, ChannelTrace__Output as _grpc_channelz_v1_ChannelTrace__Output } from '../../../grpc/channelz/v1/ChannelTrace'; -import type { Timestamp as _google_protobuf_Timestamp, Timestamp__Output as _google_protobuf_Timestamp__Output } from '../../../google/protobuf/Timestamp'; -import type { Long } from '@grpc/proto-loader'; - -/** - * Channel data is data related to a specific Channel or Subchannel. - */ -export interface ChannelData { - /** - * The connectivity state of the channel or subchannel. Implementations - * should always set this. - */ - 'state'?: (_grpc_channelz_v1_ChannelConnectivityState | null); - /** - * The target this channel originally tried to connect to. May be absent - */ - 'target'?: (string); - /** - * A trace of recent events on the channel. May be absent. - */ - 'trace'?: (_grpc_channelz_v1_ChannelTrace | null); - /** - * The number of calls started on the channel - */ - 'calls_started'?: (number | string | Long); - /** - * The number of calls that have completed with an OK status - */ - 'calls_succeeded'?: (number | string | Long); - /** - * The number of calls that have completed with a non-OK status - */ - 'calls_failed'?: (number | string | Long); - /** - * The last time a call was started on the channel. - */ - 'last_call_started_timestamp'?: (_google_protobuf_Timestamp | null); -} - -/** - * Channel data is data related to a specific Channel or Subchannel. - */ -export interface ChannelData__Output { - /** - * The connectivity state of the channel or subchannel. Implementations - * should always set this. - */ - 'state': (_grpc_channelz_v1_ChannelConnectivityState__Output | null); - /** - * The target this channel originally tried to connect to. May be absent - */ - 'target': (string); - /** - * A trace of recent events on the channel. May be absent. - */ - 'trace': (_grpc_channelz_v1_ChannelTrace__Output | null); - /** - * The number of calls started on the channel - */ - 'calls_started': (string); - /** - * The number of calls that have completed with an OK status - */ - 'calls_succeeded': (string); - /** - * The number of calls that have completed with a non-OK status - */ - 'calls_failed': (string); - /** - * The last time a call was started on the channel. - */ - 'last_call_started_timestamp': (_google_protobuf_Timestamp__Output | null); -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/grpc/channelz/v1/ChannelRef.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/grpc/channelz/v1/ChannelRef.ts deleted file mode 100644 index 231d0087..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/grpc/channelz/v1/ChannelRef.ts +++ /dev/null @@ -1,31 +0,0 @@ -// Original file: proto/channelz.proto - -import type { Long } from '@grpc/proto-loader'; - -/** - * ChannelRef is a reference to a Channel. - */ -export interface ChannelRef { - /** - * The globally unique id for this channel. Must be a positive number. - */ - 'channel_id'?: (number | string | Long); - /** - * An optional name associated with the channel. - */ - 'name'?: (string); -} - -/** - * ChannelRef is a reference to a Channel. - */ -export interface ChannelRef__Output { - /** - * The globally unique id for this channel. Must be a positive number. - */ - 'channel_id': (string); - /** - * An optional name associated with the channel. - */ - 'name': (string); -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/grpc/channelz/v1/ChannelTrace.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/grpc/channelz/v1/ChannelTrace.ts deleted file mode 100644 index 7dbc8d92..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/grpc/channelz/v1/ChannelTrace.ts +++ /dev/null @@ -1,45 +0,0 @@ -// Original file: proto/channelz.proto - -import type { Timestamp as _google_protobuf_Timestamp, Timestamp__Output as _google_protobuf_Timestamp__Output } from '../../../google/protobuf/Timestamp'; -import type { ChannelTraceEvent as _grpc_channelz_v1_ChannelTraceEvent, ChannelTraceEvent__Output as _grpc_channelz_v1_ChannelTraceEvent__Output } from '../../../grpc/channelz/v1/ChannelTraceEvent'; -import type { Long } from '@grpc/proto-loader'; - -/** - * ChannelTrace represents the recent events that have occurred on the channel. - */ -export interface ChannelTrace { - /** - * Number of events ever logged in this tracing object. This can differ from - * events.size() because events can be overwritten or garbage collected by - * implementations. - */ - 'num_events_logged'?: (number | string | Long); - /** - * Time that this channel was created. - */ - 'creation_timestamp'?: (_google_protobuf_Timestamp | null); - /** - * List of events that have occurred on this channel. - */ - 'events'?: (_grpc_channelz_v1_ChannelTraceEvent)[]; -} - -/** - * ChannelTrace represents the recent events that have occurred on the channel. - */ -export interface ChannelTrace__Output { - /** - * Number of events ever logged in this tracing object. This can differ from - * events.size() because events can be overwritten or garbage collected by - * implementations. - */ - 'num_events_logged': (string); - /** - * Time that this channel was created. - */ - 'creation_timestamp': (_google_protobuf_Timestamp__Output | null); - /** - * List of events that have occurred on this channel. - */ - 'events': (_grpc_channelz_v1_ChannelTraceEvent__Output)[]; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/grpc/channelz/v1/ChannelTraceEvent.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/grpc/channelz/v1/ChannelTraceEvent.ts deleted file mode 100644 index 24b97fbc..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/grpc/channelz/v1/ChannelTraceEvent.ts +++ /dev/null @@ -1,73 +0,0 @@ -// Original file: proto/channelz.proto - -import type { Timestamp as _google_protobuf_Timestamp, Timestamp__Output as _google_protobuf_Timestamp__Output } from '../../../google/protobuf/Timestamp'; -import type { ChannelRef as _grpc_channelz_v1_ChannelRef, ChannelRef__Output as _grpc_channelz_v1_ChannelRef__Output } from '../../../grpc/channelz/v1/ChannelRef'; -import type { SubchannelRef as _grpc_channelz_v1_SubchannelRef, SubchannelRef__Output as _grpc_channelz_v1_SubchannelRef__Output } from '../../../grpc/channelz/v1/SubchannelRef'; - -// Original file: proto/channelz.proto - -/** - * The supported severity levels of trace events. - */ -export enum _grpc_channelz_v1_ChannelTraceEvent_Severity { - CT_UNKNOWN = 0, - CT_INFO = 1, - CT_WARNING = 2, - CT_ERROR = 3, -} - -/** - * A trace event is an interesting thing that happened to a channel or - * subchannel, such as creation, address resolution, subchannel creation, etc. - */ -export interface ChannelTraceEvent { - /** - * High level description of the event. - */ - 'description'?: (string); - /** - * the severity of the trace event - */ - 'severity'?: (_grpc_channelz_v1_ChannelTraceEvent_Severity | keyof typeof _grpc_channelz_v1_ChannelTraceEvent_Severity); - /** - * When this event occurred. - */ - 'timestamp'?: (_google_protobuf_Timestamp | null); - 'channel_ref'?: (_grpc_channelz_v1_ChannelRef | null); - 'subchannel_ref'?: (_grpc_channelz_v1_SubchannelRef | null); - /** - * ref of referenced channel or subchannel. - * Optional, only present if this event refers to a child object. For example, - * this field would be filled if this trace event was for a subchannel being - * created. - */ - 'child_ref'?: "channel_ref"|"subchannel_ref"; -} - -/** - * A trace event is an interesting thing that happened to a channel or - * subchannel, such as creation, address resolution, subchannel creation, etc. - */ -export interface ChannelTraceEvent__Output { - /** - * High level description of the event. - */ - 'description': (string); - /** - * the severity of the trace event - */ - 'severity': (keyof typeof _grpc_channelz_v1_ChannelTraceEvent_Severity); - /** - * When this event occurred. - */ - 'timestamp': (_google_protobuf_Timestamp__Output | null); - 'channel_ref'?: (_grpc_channelz_v1_ChannelRef__Output | null); - 'subchannel_ref'?: (_grpc_channelz_v1_SubchannelRef__Output | null); - /** - * ref of referenced channel or subchannel. - * Optional, only present if this event refers to a child object. For example, - * this field would be filled if this trace event was for a subchannel being - * created. - */ - 'child_ref': "channel_ref"|"subchannel_ref"; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/grpc/channelz/v1/Channelz.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/grpc/channelz/v1/Channelz.ts deleted file mode 100644 index 4c8c18aa..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/grpc/channelz/v1/Channelz.ts +++ /dev/null @@ -1,178 +0,0 @@ -// Original file: proto/channelz.proto - -import type * as grpc from '../../../../index' -import type { MethodDefinition } from '@grpc/proto-loader' -import type { GetChannelRequest as _grpc_channelz_v1_GetChannelRequest, GetChannelRequest__Output as _grpc_channelz_v1_GetChannelRequest__Output } from '../../../grpc/channelz/v1/GetChannelRequest'; -import type { GetChannelResponse as _grpc_channelz_v1_GetChannelResponse, GetChannelResponse__Output as _grpc_channelz_v1_GetChannelResponse__Output } from '../../../grpc/channelz/v1/GetChannelResponse'; -import type { GetServerRequest as _grpc_channelz_v1_GetServerRequest, GetServerRequest__Output as _grpc_channelz_v1_GetServerRequest__Output } from '../../../grpc/channelz/v1/GetServerRequest'; -import type { GetServerResponse as _grpc_channelz_v1_GetServerResponse, GetServerResponse__Output as _grpc_channelz_v1_GetServerResponse__Output } from '../../../grpc/channelz/v1/GetServerResponse'; -import type { GetServerSocketsRequest as _grpc_channelz_v1_GetServerSocketsRequest, GetServerSocketsRequest__Output as _grpc_channelz_v1_GetServerSocketsRequest__Output } from '../../../grpc/channelz/v1/GetServerSocketsRequest'; -import type { GetServerSocketsResponse as _grpc_channelz_v1_GetServerSocketsResponse, GetServerSocketsResponse__Output as _grpc_channelz_v1_GetServerSocketsResponse__Output } from '../../../grpc/channelz/v1/GetServerSocketsResponse'; -import type { GetServersRequest as _grpc_channelz_v1_GetServersRequest, GetServersRequest__Output as _grpc_channelz_v1_GetServersRequest__Output } from '../../../grpc/channelz/v1/GetServersRequest'; -import type { GetServersResponse as _grpc_channelz_v1_GetServersResponse, GetServersResponse__Output as _grpc_channelz_v1_GetServersResponse__Output } from '../../../grpc/channelz/v1/GetServersResponse'; -import type { GetSocketRequest as _grpc_channelz_v1_GetSocketRequest, GetSocketRequest__Output as _grpc_channelz_v1_GetSocketRequest__Output } from '../../../grpc/channelz/v1/GetSocketRequest'; -import type { GetSocketResponse as _grpc_channelz_v1_GetSocketResponse, GetSocketResponse__Output as _grpc_channelz_v1_GetSocketResponse__Output } from '../../../grpc/channelz/v1/GetSocketResponse'; -import type { GetSubchannelRequest as _grpc_channelz_v1_GetSubchannelRequest, GetSubchannelRequest__Output as _grpc_channelz_v1_GetSubchannelRequest__Output } from '../../../grpc/channelz/v1/GetSubchannelRequest'; -import type { GetSubchannelResponse as _grpc_channelz_v1_GetSubchannelResponse, GetSubchannelResponse__Output as _grpc_channelz_v1_GetSubchannelResponse__Output } from '../../../grpc/channelz/v1/GetSubchannelResponse'; -import type { GetTopChannelsRequest as _grpc_channelz_v1_GetTopChannelsRequest, GetTopChannelsRequest__Output as _grpc_channelz_v1_GetTopChannelsRequest__Output } from '../../../grpc/channelz/v1/GetTopChannelsRequest'; -import type { GetTopChannelsResponse as _grpc_channelz_v1_GetTopChannelsResponse, GetTopChannelsResponse__Output as _grpc_channelz_v1_GetTopChannelsResponse__Output } from '../../../grpc/channelz/v1/GetTopChannelsResponse'; - -/** - * Channelz is a service exposed by gRPC servers that provides detailed debug - * information. - */ -export interface ChannelzClient extends grpc.Client { - /** - * Returns a single Channel, or else a NOT_FOUND code. - */ - GetChannel(argument: _grpc_channelz_v1_GetChannelRequest, metadata: grpc.Metadata, options: grpc.CallOptions, callback: grpc.requestCallback<_grpc_channelz_v1_GetChannelResponse__Output>): grpc.ClientUnaryCall; - GetChannel(argument: _grpc_channelz_v1_GetChannelRequest, metadata: grpc.Metadata, callback: grpc.requestCallback<_grpc_channelz_v1_GetChannelResponse__Output>): grpc.ClientUnaryCall; - GetChannel(argument: _grpc_channelz_v1_GetChannelRequest, options: grpc.CallOptions, callback: grpc.requestCallback<_grpc_channelz_v1_GetChannelResponse__Output>): grpc.ClientUnaryCall; - GetChannel(argument: _grpc_channelz_v1_GetChannelRequest, callback: grpc.requestCallback<_grpc_channelz_v1_GetChannelResponse__Output>): grpc.ClientUnaryCall; - - /** - * Returns a single Server, or else a NOT_FOUND code. - */ - GetServer(argument: _grpc_channelz_v1_GetServerRequest, metadata: grpc.Metadata, options: grpc.CallOptions, callback: grpc.requestCallback<_grpc_channelz_v1_GetServerResponse__Output>): grpc.ClientUnaryCall; - GetServer(argument: _grpc_channelz_v1_GetServerRequest, metadata: grpc.Metadata, callback: grpc.requestCallback<_grpc_channelz_v1_GetServerResponse__Output>): grpc.ClientUnaryCall; - GetServer(argument: _grpc_channelz_v1_GetServerRequest, options: grpc.CallOptions, callback: grpc.requestCallback<_grpc_channelz_v1_GetServerResponse__Output>): grpc.ClientUnaryCall; - GetServer(argument: _grpc_channelz_v1_GetServerRequest, callback: grpc.requestCallback<_grpc_channelz_v1_GetServerResponse__Output>): grpc.ClientUnaryCall; - /** - * Returns a single Server, or else a NOT_FOUND code. - */ - getServer(argument: _grpc_channelz_v1_GetServerRequest, metadata: grpc.Metadata, options: grpc.CallOptions, callback: grpc.requestCallback<_grpc_channelz_v1_GetServerResponse__Output>): grpc.ClientUnaryCall; - getServer(argument: _grpc_channelz_v1_GetServerRequest, metadata: grpc.Metadata, callback: grpc.requestCallback<_grpc_channelz_v1_GetServerResponse__Output>): grpc.ClientUnaryCall; - getServer(argument: _grpc_channelz_v1_GetServerRequest, options: grpc.CallOptions, callback: grpc.requestCallback<_grpc_channelz_v1_GetServerResponse__Output>): grpc.ClientUnaryCall; - getServer(argument: _grpc_channelz_v1_GetServerRequest, callback: grpc.requestCallback<_grpc_channelz_v1_GetServerResponse__Output>): grpc.ClientUnaryCall; - - /** - * Gets all server sockets that exist in the process. - */ - GetServerSockets(argument: _grpc_channelz_v1_GetServerSocketsRequest, metadata: grpc.Metadata, options: grpc.CallOptions, callback: grpc.requestCallback<_grpc_channelz_v1_GetServerSocketsResponse__Output>): grpc.ClientUnaryCall; - GetServerSockets(argument: _grpc_channelz_v1_GetServerSocketsRequest, metadata: grpc.Metadata, callback: grpc.requestCallback<_grpc_channelz_v1_GetServerSocketsResponse__Output>): grpc.ClientUnaryCall; - GetServerSockets(argument: _grpc_channelz_v1_GetServerSocketsRequest, options: grpc.CallOptions, callback: grpc.requestCallback<_grpc_channelz_v1_GetServerSocketsResponse__Output>): grpc.ClientUnaryCall; - GetServerSockets(argument: _grpc_channelz_v1_GetServerSocketsRequest, callback: grpc.requestCallback<_grpc_channelz_v1_GetServerSocketsResponse__Output>): grpc.ClientUnaryCall; - /** - * Gets all server sockets that exist in the process. - */ - getServerSockets(argument: _grpc_channelz_v1_GetServerSocketsRequest, metadata: grpc.Metadata, options: grpc.CallOptions, callback: grpc.requestCallback<_grpc_channelz_v1_GetServerSocketsResponse__Output>): grpc.ClientUnaryCall; - getServerSockets(argument: _grpc_channelz_v1_GetServerSocketsRequest, metadata: grpc.Metadata, callback: grpc.requestCallback<_grpc_channelz_v1_GetServerSocketsResponse__Output>): grpc.ClientUnaryCall; - getServerSockets(argument: _grpc_channelz_v1_GetServerSocketsRequest, options: grpc.CallOptions, callback: grpc.requestCallback<_grpc_channelz_v1_GetServerSocketsResponse__Output>): grpc.ClientUnaryCall; - getServerSockets(argument: _grpc_channelz_v1_GetServerSocketsRequest, callback: grpc.requestCallback<_grpc_channelz_v1_GetServerSocketsResponse__Output>): grpc.ClientUnaryCall; - - /** - * Gets all servers that exist in the process. - */ - GetServers(argument: _grpc_channelz_v1_GetServersRequest, metadata: grpc.Metadata, options: grpc.CallOptions, callback: grpc.requestCallback<_grpc_channelz_v1_GetServersResponse__Output>): grpc.ClientUnaryCall; - GetServers(argument: _grpc_channelz_v1_GetServersRequest, metadata: grpc.Metadata, callback: grpc.requestCallback<_grpc_channelz_v1_GetServersResponse__Output>): grpc.ClientUnaryCall; - GetServers(argument: _grpc_channelz_v1_GetServersRequest, options: grpc.CallOptions, callback: grpc.requestCallback<_grpc_channelz_v1_GetServersResponse__Output>): grpc.ClientUnaryCall; - GetServers(argument: _grpc_channelz_v1_GetServersRequest, callback: grpc.requestCallback<_grpc_channelz_v1_GetServersResponse__Output>): grpc.ClientUnaryCall; - /** - * Gets all servers that exist in the process. - */ - getServers(argument: _grpc_channelz_v1_GetServersRequest, metadata: grpc.Metadata, options: grpc.CallOptions, callback: grpc.requestCallback<_grpc_channelz_v1_GetServersResponse__Output>): grpc.ClientUnaryCall; - getServers(argument: _grpc_channelz_v1_GetServersRequest, metadata: grpc.Metadata, callback: grpc.requestCallback<_grpc_channelz_v1_GetServersResponse__Output>): grpc.ClientUnaryCall; - getServers(argument: _grpc_channelz_v1_GetServersRequest, options: grpc.CallOptions, callback: grpc.requestCallback<_grpc_channelz_v1_GetServersResponse__Output>): grpc.ClientUnaryCall; - getServers(argument: _grpc_channelz_v1_GetServersRequest, callback: grpc.requestCallback<_grpc_channelz_v1_GetServersResponse__Output>): grpc.ClientUnaryCall; - - /** - * Returns a single Socket or else a NOT_FOUND code. - */ - GetSocket(argument: _grpc_channelz_v1_GetSocketRequest, metadata: grpc.Metadata, options: grpc.CallOptions, callback: grpc.requestCallback<_grpc_channelz_v1_GetSocketResponse__Output>): grpc.ClientUnaryCall; - GetSocket(argument: _grpc_channelz_v1_GetSocketRequest, metadata: grpc.Metadata, callback: grpc.requestCallback<_grpc_channelz_v1_GetSocketResponse__Output>): grpc.ClientUnaryCall; - GetSocket(argument: _grpc_channelz_v1_GetSocketRequest, options: grpc.CallOptions, callback: grpc.requestCallback<_grpc_channelz_v1_GetSocketResponse__Output>): grpc.ClientUnaryCall; - GetSocket(argument: _grpc_channelz_v1_GetSocketRequest, callback: grpc.requestCallback<_grpc_channelz_v1_GetSocketResponse__Output>): grpc.ClientUnaryCall; - /** - * Returns a single Socket or else a NOT_FOUND code. - */ - getSocket(argument: _grpc_channelz_v1_GetSocketRequest, metadata: grpc.Metadata, options: grpc.CallOptions, callback: grpc.requestCallback<_grpc_channelz_v1_GetSocketResponse__Output>): grpc.ClientUnaryCall; - getSocket(argument: _grpc_channelz_v1_GetSocketRequest, metadata: grpc.Metadata, callback: grpc.requestCallback<_grpc_channelz_v1_GetSocketResponse__Output>): grpc.ClientUnaryCall; - getSocket(argument: _grpc_channelz_v1_GetSocketRequest, options: grpc.CallOptions, callback: grpc.requestCallback<_grpc_channelz_v1_GetSocketResponse__Output>): grpc.ClientUnaryCall; - getSocket(argument: _grpc_channelz_v1_GetSocketRequest, callback: grpc.requestCallback<_grpc_channelz_v1_GetSocketResponse__Output>): grpc.ClientUnaryCall; - - /** - * Returns a single Subchannel, or else a NOT_FOUND code. - */ - GetSubchannel(argument: _grpc_channelz_v1_GetSubchannelRequest, metadata: grpc.Metadata, options: grpc.CallOptions, callback: grpc.requestCallback<_grpc_channelz_v1_GetSubchannelResponse__Output>): grpc.ClientUnaryCall; - GetSubchannel(argument: _grpc_channelz_v1_GetSubchannelRequest, metadata: grpc.Metadata, callback: grpc.requestCallback<_grpc_channelz_v1_GetSubchannelResponse__Output>): grpc.ClientUnaryCall; - GetSubchannel(argument: _grpc_channelz_v1_GetSubchannelRequest, options: grpc.CallOptions, callback: grpc.requestCallback<_grpc_channelz_v1_GetSubchannelResponse__Output>): grpc.ClientUnaryCall; - GetSubchannel(argument: _grpc_channelz_v1_GetSubchannelRequest, callback: grpc.requestCallback<_grpc_channelz_v1_GetSubchannelResponse__Output>): grpc.ClientUnaryCall; - /** - * Returns a single Subchannel, or else a NOT_FOUND code. - */ - getSubchannel(argument: _grpc_channelz_v1_GetSubchannelRequest, metadata: grpc.Metadata, options: grpc.CallOptions, callback: grpc.requestCallback<_grpc_channelz_v1_GetSubchannelResponse__Output>): grpc.ClientUnaryCall; - getSubchannel(argument: _grpc_channelz_v1_GetSubchannelRequest, metadata: grpc.Metadata, callback: grpc.requestCallback<_grpc_channelz_v1_GetSubchannelResponse__Output>): grpc.ClientUnaryCall; - getSubchannel(argument: _grpc_channelz_v1_GetSubchannelRequest, options: grpc.CallOptions, callback: grpc.requestCallback<_grpc_channelz_v1_GetSubchannelResponse__Output>): grpc.ClientUnaryCall; - getSubchannel(argument: _grpc_channelz_v1_GetSubchannelRequest, callback: grpc.requestCallback<_grpc_channelz_v1_GetSubchannelResponse__Output>): grpc.ClientUnaryCall; - - /** - * Gets all root channels (i.e. channels the application has directly - * created). This does not include subchannels nor non-top level channels. - */ - GetTopChannels(argument: _grpc_channelz_v1_GetTopChannelsRequest, metadata: grpc.Metadata, options: grpc.CallOptions, callback: grpc.requestCallback<_grpc_channelz_v1_GetTopChannelsResponse__Output>): grpc.ClientUnaryCall; - GetTopChannels(argument: _grpc_channelz_v1_GetTopChannelsRequest, metadata: grpc.Metadata, callback: grpc.requestCallback<_grpc_channelz_v1_GetTopChannelsResponse__Output>): grpc.ClientUnaryCall; - GetTopChannels(argument: _grpc_channelz_v1_GetTopChannelsRequest, options: grpc.CallOptions, callback: grpc.requestCallback<_grpc_channelz_v1_GetTopChannelsResponse__Output>): grpc.ClientUnaryCall; - GetTopChannels(argument: _grpc_channelz_v1_GetTopChannelsRequest, callback: grpc.requestCallback<_grpc_channelz_v1_GetTopChannelsResponse__Output>): grpc.ClientUnaryCall; - /** - * Gets all root channels (i.e. channels the application has directly - * created). This does not include subchannels nor non-top level channels. - */ - getTopChannels(argument: _grpc_channelz_v1_GetTopChannelsRequest, metadata: grpc.Metadata, options: grpc.CallOptions, callback: grpc.requestCallback<_grpc_channelz_v1_GetTopChannelsResponse__Output>): grpc.ClientUnaryCall; - getTopChannels(argument: _grpc_channelz_v1_GetTopChannelsRequest, metadata: grpc.Metadata, callback: grpc.requestCallback<_grpc_channelz_v1_GetTopChannelsResponse__Output>): grpc.ClientUnaryCall; - getTopChannels(argument: _grpc_channelz_v1_GetTopChannelsRequest, options: grpc.CallOptions, callback: grpc.requestCallback<_grpc_channelz_v1_GetTopChannelsResponse__Output>): grpc.ClientUnaryCall; - getTopChannels(argument: _grpc_channelz_v1_GetTopChannelsRequest, callback: grpc.requestCallback<_grpc_channelz_v1_GetTopChannelsResponse__Output>): grpc.ClientUnaryCall; - -} - -/** - * Channelz is a service exposed by gRPC servers that provides detailed debug - * information. - */ -export interface ChannelzHandlers extends grpc.UntypedServiceImplementation { - /** - * Returns a single Channel, or else a NOT_FOUND code. - */ - GetChannel: grpc.handleUnaryCall<_grpc_channelz_v1_GetChannelRequest__Output, _grpc_channelz_v1_GetChannelResponse>; - - /** - * Returns a single Server, or else a NOT_FOUND code. - */ - GetServer: grpc.handleUnaryCall<_grpc_channelz_v1_GetServerRequest__Output, _grpc_channelz_v1_GetServerResponse>; - - /** - * Gets all server sockets that exist in the process. - */ - GetServerSockets: grpc.handleUnaryCall<_grpc_channelz_v1_GetServerSocketsRequest__Output, _grpc_channelz_v1_GetServerSocketsResponse>; - - /** - * Gets all servers that exist in the process. - */ - GetServers: grpc.handleUnaryCall<_grpc_channelz_v1_GetServersRequest__Output, _grpc_channelz_v1_GetServersResponse>; - - /** - * Returns a single Socket or else a NOT_FOUND code. - */ - GetSocket: grpc.handleUnaryCall<_grpc_channelz_v1_GetSocketRequest__Output, _grpc_channelz_v1_GetSocketResponse>; - - /** - * Returns a single Subchannel, or else a NOT_FOUND code. - */ - GetSubchannel: grpc.handleUnaryCall<_grpc_channelz_v1_GetSubchannelRequest__Output, _grpc_channelz_v1_GetSubchannelResponse>; - - /** - * Gets all root channels (i.e. channels the application has directly - * created). This does not include subchannels nor non-top level channels. - */ - GetTopChannels: grpc.handleUnaryCall<_grpc_channelz_v1_GetTopChannelsRequest__Output, _grpc_channelz_v1_GetTopChannelsResponse>; - -} - -export interface ChannelzDefinition extends grpc.ServiceDefinition { - GetChannel: MethodDefinition<_grpc_channelz_v1_GetChannelRequest, _grpc_channelz_v1_GetChannelResponse, _grpc_channelz_v1_GetChannelRequest__Output, _grpc_channelz_v1_GetChannelResponse__Output> - GetServer: MethodDefinition<_grpc_channelz_v1_GetServerRequest, _grpc_channelz_v1_GetServerResponse, _grpc_channelz_v1_GetServerRequest__Output, _grpc_channelz_v1_GetServerResponse__Output> - GetServerSockets: MethodDefinition<_grpc_channelz_v1_GetServerSocketsRequest, _grpc_channelz_v1_GetServerSocketsResponse, _grpc_channelz_v1_GetServerSocketsRequest__Output, _grpc_channelz_v1_GetServerSocketsResponse__Output> - GetServers: MethodDefinition<_grpc_channelz_v1_GetServersRequest, _grpc_channelz_v1_GetServersResponse, _grpc_channelz_v1_GetServersRequest__Output, _grpc_channelz_v1_GetServersResponse__Output> - GetSocket: MethodDefinition<_grpc_channelz_v1_GetSocketRequest, _grpc_channelz_v1_GetSocketResponse, _grpc_channelz_v1_GetSocketRequest__Output, _grpc_channelz_v1_GetSocketResponse__Output> - GetSubchannel: MethodDefinition<_grpc_channelz_v1_GetSubchannelRequest, _grpc_channelz_v1_GetSubchannelResponse, _grpc_channelz_v1_GetSubchannelRequest__Output, _grpc_channelz_v1_GetSubchannelResponse__Output> - GetTopChannels: MethodDefinition<_grpc_channelz_v1_GetTopChannelsRequest, _grpc_channelz_v1_GetTopChannelsResponse, _grpc_channelz_v1_GetTopChannelsRequest__Output, _grpc_channelz_v1_GetTopChannelsResponse__Output> -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/grpc/channelz/v1/GetChannelRequest.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/grpc/channelz/v1/GetChannelRequest.ts deleted file mode 100644 index 437e2d60..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/grpc/channelz/v1/GetChannelRequest.ts +++ /dev/null @@ -1,17 +0,0 @@ -// Original file: proto/channelz.proto - -import type { Long } from '@grpc/proto-loader'; - -export interface GetChannelRequest { - /** - * channel_id is the identifier of the specific channel to get. - */ - 'channel_id'?: (number | string | Long); -} - -export interface GetChannelRequest__Output { - /** - * channel_id is the identifier of the specific channel to get. - */ - 'channel_id': (string); -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/grpc/channelz/v1/GetChannelResponse.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/grpc/channelz/v1/GetChannelResponse.ts deleted file mode 100644 index 2e967a45..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/grpc/channelz/v1/GetChannelResponse.ts +++ /dev/null @@ -1,19 +0,0 @@ -// Original file: proto/channelz.proto - -import type { Channel as _grpc_channelz_v1_Channel, Channel__Output as _grpc_channelz_v1_Channel__Output } from '../../../grpc/channelz/v1/Channel'; - -export interface GetChannelResponse { - /** - * The Channel that corresponds to the requested channel_id. This field - * should be set. - */ - 'channel'?: (_grpc_channelz_v1_Channel | null); -} - -export interface GetChannelResponse__Output { - /** - * The Channel that corresponds to the requested channel_id. This field - * should be set. - */ - 'channel': (_grpc_channelz_v1_Channel__Output | null); -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/grpc/channelz/v1/GetServerRequest.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/grpc/channelz/v1/GetServerRequest.ts deleted file mode 100644 index f5d4a298..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/grpc/channelz/v1/GetServerRequest.ts +++ /dev/null @@ -1,17 +0,0 @@ -// Original file: proto/channelz.proto - -import type { Long } from '@grpc/proto-loader'; - -export interface GetServerRequest { - /** - * server_id is the identifier of the specific server to get. - */ - 'server_id'?: (number | string | Long); -} - -export interface GetServerRequest__Output { - /** - * server_id is the identifier of the specific server to get. - */ - 'server_id': (string); -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/grpc/channelz/v1/GetServerResponse.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/grpc/channelz/v1/GetServerResponse.ts deleted file mode 100644 index fe007820..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/grpc/channelz/v1/GetServerResponse.ts +++ /dev/null @@ -1,19 +0,0 @@ -// Original file: proto/channelz.proto - -import type { Server as _grpc_channelz_v1_Server, Server__Output as _grpc_channelz_v1_Server__Output } from '../../../grpc/channelz/v1/Server'; - -export interface GetServerResponse { - /** - * The Server that corresponds to the requested server_id. This field - * should be set. - */ - 'server'?: (_grpc_channelz_v1_Server | null); -} - -export interface GetServerResponse__Output { - /** - * The Server that corresponds to the requested server_id. This field - * should be set. - */ - 'server': (_grpc_channelz_v1_Server__Output | null); -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/grpc/channelz/v1/GetServerSocketsRequest.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/grpc/channelz/v1/GetServerSocketsRequest.ts deleted file mode 100644 index c33056ed..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/grpc/channelz/v1/GetServerSocketsRequest.ts +++ /dev/null @@ -1,39 +0,0 @@ -// Original file: proto/channelz.proto - -import type { Long } from '@grpc/proto-loader'; - -export interface GetServerSocketsRequest { - 'server_id'?: (number | string | Long); - /** - * start_socket_id indicates that only sockets at or above this id should be - * included in the results. - * To request the first page, this must be set to 0. To request - * subsequent pages, the client generates this value by adding 1 to - * the highest seen result ID. - */ - 'start_socket_id'?: (number | string | Long); - /** - * If non-zero, the server will return a page of results containing - * at most this many items. If zero, the server will choose a - * reasonable page size. Must never be negative. - */ - 'max_results'?: (number | string | Long); -} - -export interface GetServerSocketsRequest__Output { - 'server_id': (string); - /** - * start_socket_id indicates that only sockets at or above this id should be - * included in the results. - * To request the first page, this must be set to 0. To request - * subsequent pages, the client generates this value by adding 1 to - * the highest seen result ID. - */ - 'start_socket_id': (string); - /** - * If non-zero, the server will return a page of results containing - * at most this many items. If zero, the server will choose a - * reasonable page size. Must never be negative. - */ - 'max_results': (string); -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/grpc/channelz/v1/GetServerSocketsResponse.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/grpc/channelz/v1/GetServerSocketsResponse.ts deleted file mode 100644 index 112f277e..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/grpc/channelz/v1/GetServerSocketsResponse.ts +++ /dev/null @@ -1,33 +0,0 @@ -// Original file: proto/channelz.proto - -import type { SocketRef as _grpc_channelz_v1_SocketRef, SocketRef__Output as _grpc_channelz_v1_SocketRef__Output } from '../../../grpc/channelz/v1/SocketRef'; - -export interface GetServerSocketsResponse { - /** - * list of socket refs that the connection detail service knows about. Sorted in - * ascending socket_id order. - * Must contain at least 1 result, otherwise 'end' must be true. - */ - 'socket_ref'?: (_grpc_channelz_v1_SocketRef)[]; - /** - * If set, indicates that the list of sockets is the final list. Requesting - * more sockets will only return more if they are created after this RPC - * completes. - */ - 'end'?: (boolean); -} - -export interface GetServerSocketsResponse__Output { - /** - * list of socket refs that the connection detail service knows about. Sorted in - * ascending socket_id order. - * Must contain at least 1 result, otherwise 'end' must be true. - */ - 'socket_ref': (_grpc_channelz_v1_SocketRef__Output)[]; - /** - * If set, indicates that the list of sockets is the final list. Requesting - * more sockets will only return more if they are created after this RPC - * completes. - */ - 'end': (boolean); -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/grpc/channelz/v1/GetServersRequest.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/grpc/channelz/v1/GetServersRequest.ts deleted file mode 100644 index 2defea62..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/grpc/channelz/v1/GetServersRequest.ts +++ /dev/null @@ -1,37 +0,0 @@ -// Original file: proto/channelz.proto - -import type { Long } from '@grpc/proto-loader'; - -export interface GetServersRequest { - /** - * start_server_id indicates that only servers at or above this id should be - * included in the results. - * To request the first page, this must be set to 0. To request - * subsequent pages, the client generates this value by adding 1 to - * the highest seen result ID. - */ - 'start_server_id'?: (number | string | Long); - /** - * If non-zero, the server will return a page of results containing - * at most this many items. If zero, the server will choose a - * reasonable page size. Must never be negative. - */ - 'max_results'?: (number | string | Long); -} - -export interface GetServersRequest__Output { - /** - * start_server_id indicates that only servers at or above this id should be - * included in the results. - * To request the first page, this must be set to 0. To request - * subsequent pages, the client generates this value by adding 1 to - * the highest seen result ID. - */ - 'start_server_id': (string); - /** - * If non-zero, the server will return a page of results containing - * at most this many items. If zero, the server will choose a - * reasonable page size. Must never be negative. - */ - 'max_results': (string); -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/grpc/channelz/v1/GetServersResponse.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/grpc/channelz/v1/GetServersResponse.ts deleted file mode 100644 index b07893b8..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/grpc/channelz/v1/GetServersResponse.ts +++ /dev/null @@ -1,33 +0,0 @@ -// Original file: proto/channelz.proto - -import type { Server as _grpc_channelz_v1_Server, Server__Output as _grpc_channelz_v1_Server__Output } from '../../../grpc/channelz/v1/Server'; - -export interface GetServersResponse { - /** - * list of servers that the connection detail service knows about. Sorted in - * ascending server_id order. - * Must contain at least 1 result, otherwise 'end' must be true. - */ - 'server'?: (_grpc_channelz_v1_Server)[]; - /** - * If set, indicates that the list of servers is the final list. Requesting - * more servers will only return more if they are created after this RPC - * completes. - */ - 'end'?: (boolean); -} - -export interface GetServersResponse__Output { - /** - * list of servers that the connection detail service knows about. Sorted in - * ascending server_id order. - * Must contain at least 1 result, otherwise 'end' must be true. - */ - 'server': (_grpc_channelz_v1_Server__Output)[]; - /** - * If set, indicates that the list of servers is the final list. Requesting - * more servers will only return more if they are created after this RPC - * completes. - */ - 'end': (boolean); -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/grpc/channelz/v1/GetSocketRequest.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/grpc/channelz/v1/GetSocketRequest.ts deleted file mode 100644 index b3dc1608..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/grpc/channelz/v1/GetSocketRequest.ts +++ /dev/null @@ -1,29 +0,0 @@ -// Original file: proto/channelz.proto - -import type { Long } from '@grpc/proto-loader'; - -export interface GetSocketRequest { - /** - * socket_id is the identifier of the specific socket to get. - */ - 'socket_id'?: (number | string | Long); - /** - * If true, the response will contain only high level information - * that is inexpensive to obtain. Fields thay may be omitted are - * documented. - */ - 'summary'?: (boolean); -} - -export interface GetSocketRequest__Output { - /** - * socket_id is the identifier of the specific socket to get. - */ - 'socket_id': (string); - /** - * If true, the response will contain only high level information - * that is inexpensive to obtain. Fields thay may be omitted are - * documented. - */ - 'summary': (boolean); -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/grpc/channelz/v1/GetSocketResponse.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/grpc/channelz/v1/GetSocketResponse.ts deleted file mode 100644 index b6304b7f..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/grpc/channelz/v1/GetSocketResponse.ts +++ /dev/null @@ -1,19 +0,0 @@ -// Original file: proto/channelz.proto - -import type { Socket as _grpc_channelz_v1_Socket, Socket__Output as _grpc_channelz_v1_Socket__Output } from '../../../grpc/channelz/v1/Socket'; - -export interface GetSocketResponse { - /** - * The Socket that corresponds to the requested socket_id. This field - * should be set. - */ - 'socket'?: (_grpc_channelz_v1_Socket | null); -} - -export interface GetSocketResponse__Output { - /** - * The Socket that corresponds to the requested socket_id. This field - * should be set. - */ - 'socket': (_grpc_channelz_v1_Socket__Output | null); -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/grpc/channelz/v1/GetSubchannelRequest.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/grpc/channelz/v1/GetSubchannelRequest.ts deleted file mode 100644 index f481a81d..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/grpc/channelz/v1/GetSubchannelRequest.ts +++ /dev/null @@ -1,17 +0,0 @@ -// Original file: proto/channelz.proto - -import type { Long } from '@grpc/proto-loader'; - -export interface GetSubchannelRequest { - /** - * subchannel_id is the identifier of the specific subchannel to get. - */ - 'subchannel_id'?: (number | string | Long); -} - -export interface GetSubchannelRequest__Output { - /** - * subchannel_id is the identifier of the specific subchannel to get. - */ - 'subchannel_id': (string); -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/grpc/channelz/v1/GetSubchannelResponse.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/grpc/channelz/v1/GetSubchannelResponse.ts deleted file mode 100644 index 57d2bf2d..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/grpc/channelz/v1/GetSubchannelResponse.ts +++ /dev/null @@ -1,19 +0,0 @@ -// Original file: proto/channelz.proto - -import type { Subchannel as _grpc_channelz_v1_Subchannel, Subchannel__Output as _grpc_channelz_v1_Subchannel__Output } from '../../../grpc/channelz/v1/Subchannel'; - -export interface GetSubchannelResponse { - /** - * The Subchannel that corresponds to the requested subchannel_id. This - * field should be set. - */ - 'subchannel'?: (_grpc_channelz_v1_Subchannel | null); -} - -export interface GetSubchannelResponse__Output { - /** - * The Subchannel that corresponds to the requested subchannel_id. This - * field should be set. - */ - 'subchannel': (_grpc_channelz_v1_Subchannel__Output | null); -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/grpc/channelz/v1/GetTopChannelsRequest.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/grpc/channelz/v1/GetTopChannelsRequest.ts deleted file mode 100644 index a122d7a8..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/grpc/channelz/v1/GetTopChannelsRequest.ts +++ /dev/null @@ -1,37 +0,0 @@ -// Original file: proto/channelz.proto - -import type { Long } from '@grpc/proto-loader'; - -export interface GetTopChannelsRequest { - /** - * start_channel_id indicates that only channels at or above this id should be - * included in the results. - * To request the first page, this should be set to 0. To request - * subsequent pages, the client generates this value by adding 1 to - * the highest seen result ID. - */ - 'start_channel_id'?: (number | string | Long); - /** - * If non-zero, the server will return a page of results containing - * at most this many items. If zero, the server will choose a - * reasonable page size. Must never be negative. - */ - 'max_results'?: (number | string | Long); -} - -export interface GetTopChannelsRequest__Output { - /** - * start_channel_id indicates that only channels at or above this id should be - * included in the results. - * To request the first page, this should be set to 0. To request - * subsequent pages, the client generates this value by adding 1 to - * the highest seen result ID. - */ - 'start_channel_id': (string); - /** - * If non-zero, the server will return a page of results containing - * at most this many items. If zero, the server will choose a - * reasonable page size. Must never be negative. - */ - 'max_results': (string); -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/grpc/channelz/v1/GetTopChannelsResponse.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/grpc/channelz/v1/GetTopChannelsResponse.ts deleted file mode 100644 index d96e6367..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/grpc/channelz/v1/GetTopChannelsResponse.ts +++ /dev/null @@ -1,33 +0,0 @@ -// Original file: proto/channelz.proto - -import type { Channel as _grpc_channelz_v1_Channel, Channel__Output as _grpc_channelz_v1_Channel__Output } from '../../../grpc/channelz/v1/Channel'; - -export interface GetTopChannelsResponse { - /** - * list of channels that the connection detail service knows about. Sorted in - * ascending channel_id order. - * Must contain at least 1 result, otherwise 'end' must be true. - */ - 'channel'?: (_grpc_channelz_v1_Channel)[]; - /** - * If set, indicates that the list of channels is the final list. Requesting - * more channels can only return more if they are created after this RPC - * completes. - */ - 'end'?: (boolean); -} - -export interface GetTopChannelsResponse__Output { - /** - * list of channels that the connection detail service knows about. Sorted in - * ascending channel_id order. - * Must contain at least 1 result, otherwise 'end' must be true. - */ - 'channel': (_grpc_channelz_v1_Channel__Output)[]; - /** - * If set, indicates that the list of channels is the final list. Requesting - * more channels can only return more if they are created after this RPC - * completes. - */ - 'end': (boolean); -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/grpc/channelz/v1/Security.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/grpc/channelz/v1/Security.ts deleted file mode 100644 index e555d698..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/grpc/channelz/v1/Security.ts +++ /dev/null @@ -1,87 +0,0 @@ -// Original file: proto/channelz.proto - -import type { Any as _google_protobuf_Any, Any__Output as _google_protobuf_Any__Output } from '../../../google/protobuf/Any'; - -export interface _grpc_channelz_v1_Security_OtherSecurity { - /** - * The human readable version of the value. - */ - 'name'?: (string); - /** - * The actual security details message. - */ - 'value'?: (_google_protobuf_Any | null); -} - -export interface _grpc_channelz_v1_Security_OtherSecurity__Output { - /** - * The human readable version of the value. - */ - 'name': (string); - /** - * The actual security details message. - */ - 'value': (_google_protobuf_Any__Output | null); -} - -export interface _grpc_channelz_v1_Security_Tls { - /** - * The cipher suite name in the RFC 4346 format: - * https://tools.ietf.org/html/rfc4346#appendix-C - */ - 'standard_name'?: (string); - /** - * Some other way to describe the cipher suite if - * the RFC 4346 name is not available. - */ - 'other_name'?: (string); - /** - * the certificate used by this endpoint. - */ - 'local_certificate'?: (Buffer | Uint8Array | string); - /** - * the certificate used by the remote endpoint. - */ - 'remote_certificate'?: (Buffer | Uint8Array | string); - 'cipher_suite'?: "standard_name"|"other_name"; -} - -export interface _grpc_channelz_v1_Security_Tls__Output { - /** - * The cipher suite name in the RFC 4346 format: - * https://tools.ietf.org/html/rfc4346#appendix-C - */ - 'standard_name'?: (string); - /** - * Some other way to describe the cipher suite if - * the RFC 4346 name is not available. - */ - 'other_name'?: (string); - /** - * the certificate used by this endpoint. - */ - 'local_certificate': (Buffer); - /** - * the certificate used by the remote endpoint. - */ - 'remote_certificate': (Buffer); - 'cipher_suite': "standard_name"|"other_name"; -} - -/** - * Security represents details about how secure the socket is. - */ -export interface Security { - 'tls'?: (_grpc_channelz_v1_Security_Tls | null); - 'other'?: (_grpc_channelz_v1_Security_OtherSecurity | null); - 'model'?: "tls"|"other"; -} - -/** - * Security represents details about how secure the socket is. - */ -export interface Security__Output { - 'tls'?: (_grpc_channelz_v1_Security_Tls__Output | null); - 'other'?: (_grpc_channelz_v1_Security_OtherSecurity__Output | null); - 'model': "tls"|"other"; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/grpc/channelz/v1/Server.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/grpc/channelz/v1/Server.ts deleted file mode 100644 index 95834335..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/grpc/channelz/v1/Server.ts +++ /dev/null @@ -1,45 +0,0 @@ -// Original file: proto/channelz.proto - -import type { ServerRef as _grpc_channelz_v1_ServerRef, ServerRef__Output as _grpc_channelz_v1_ServerRef__Output } from '../../../grpc/channelz/v1/ServerRef'; -import type { ServerData as _grpc_channelz_v1_ServerData, ServerData__Output as _grpc_channelz_v1_ServerData__Output } from '../../../grpc/channelz/v1/ServerData'; -import type { SocketRef as _grpc_channelz_v1_SocketRef, SocketRef__Output as _grpc_channelz_v1_SocketRef__Output } from '../../../grpc/channelz/v1/SocketRef'; - -/** - * Server represents a single server. There may be multiple servers in a single - * program. - */ -export interface Server { - /** - * The identifier for a Server. This should be set. - */ - 'ref'?: (_grpc_channelz_v1_ServerRef | null); - /** - * The associated data of the Server. - */ - 'data'?: (_grpc_channelz_v1_ServerData | null); - /** - * The sockets that the server is listening on. There are no ordering - * guarantees. This may be absent. - */ - 'listen_socket'?: (_grpc_channelz_v1_SocketRef)[]; -} - -/** - * Server represents a single server. There may be multiple servers in a single - * program. - */ -export interface Server__Output { - /** - * The identifier for a Server. This should be set. - */ - 'ref': (_grpc_channelz_v1_ServerRef__Output | null); - /** - * The associated data of the Server. - */ - 'data': (_grpc_channelz_v1_ServerData__Output | null); - /** - * The sockets that the server is listening on. There are no ordering - * guarantees. This may be absent. - */ - 'listen_socket': (_grpc_channelz_v1_SocketRef__Output)[]; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/grpc/channelz/v1/ServerData.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/grpc/channelz/v1/ServerData.ts deleted file mode 100644 index ce48e36f..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/grpc/channelz/v1/ServerData.ts +++ /dev/null @@ -1,57 +0,0 @@ -// Original file: proto/channelz.proto - -import type { ChannelTrace as _grpc_channelz_v1_ChannelTrace, ChannelTrace__Output as _grpc_channelz_v1_ChannelTrace__Output } from '../../../grpc/channelz/v1/ChannelTrace'; -import type { Timestamp as _google_protobuf_Timestamp, Timestamp__Output as _google_protobuf_Timestamp__Output } from '../../../google/protobuf/Timestamp'; -import type { Long } from '@grpc/proto-loader'; - -/** - * ServerData is data for a specific Server. - */ -export interface ServerData { - /** - * A trace of recent events on the server. May be absent. - */ - 'trace'?: (_grpc_channelz_v1_ChannelTrace | null); - /** - * The number of incoming calls started on the server - */ - 'calls_started'?: (number | string | Long); - /** - * The number of incoming calls that have completed with an OK status - */ - 'calls_succeeded'?: (number | string | Long); - /** - * The number of incoming calls that have a completed with a non-OK status - */ - 'calls_failed'?: (number | string | Long); - /** - * The last time a call was started on the server. - */ - 'last_call_started_timestamp'?: (_google_protobuf_Timestamp | null); -} - -/** - * ServerData is data for a specific Server. - */ -export interface ServerData__Output { - /** - * A trace of recent events on the server. May be absent. - */ - 'trace': (_grpc_channelz_v1_ChannelTrace__Output | null); - /** - * The number of incoming calls started on the server - */ - 'calls_started': (string); - /** - * The number of incoming calls that have completed with an OK status - */ - 'calls_succeeded': (string); - /** - * The number of incoming calls that have a completed with a non-OK status - */ - 'calls_failed': (string); - /** - * The last time a call was started on the server. - */ - 'last_call_started_timestamp': (_google_protobuf_Timestamp__Output | null); -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/grpc/channelz/v1/ServerRef.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/grpc/channelz/v1/ServerRef.ts deleted file mode 100644 index 389183bd..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/grpc/channelz/v1/ServerRef.ts +++ /dev/null @@ -1,31 +0,0 @@ -// Original file: proto/channelz.proto - -import type { Long } from '@grpc/proto-loader'; - -/** - * ServerRef is a reference to a Server. - */ -export interface ServerRef { - /** - * A globally unique identifier for this server. Must be a positive number. - */ - 'server_id'?: (number | string | Long); - /** - * An optional name associated with the server. - */ - 'name'?: (string); -} - -/** - * ServerRef is a reference to a Server. - */ -export interface ServerRef__Output { - /** - * A globally unique identifier for this server. Must be a positive number. - */ - 'server_id': (string); - /** - * An optional name associated with the server. - */ - 'name': (string); -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/grpc/channelz/v1/Socket.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/grpc/channelz/v1/Socket.ts deleted file mode 100644 index 5829afe9..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/grpc/channelz/v1/Socket.ts +++ /dev/null @@ -1,70 +0,0 @@ -// Original file: proto/channelz.proto - -import type { SocketRef as _grpc_channelz_v1_SocketRef, SocketRef__Output as _grpc_channelz_v1_SocketRef__Output } from '../../../grpc/channelz/v1/SocketRef'; -import type { SocketData as _grpc_channelz_v1_SocketData, SocketData__Output as _grpc_channelz_v1_SocketData__Output } from '../../../grpc/channelz/v1/SocketData'; -import type { Address as _grpc_channelz_v1_Address, Address__Output as _grpc_channelz_v1_Address__Output } from '../../../grpc/channelz/v1/Address'; -import type { Security as _grpc_channelz_v1_Security, Security__Output as _grpc_channelz_v1_Security__Output } from '../../../grpc/channelz/v1/Security'; - -/** - * Information about an actual connection. Pronounced "sock-ay". - */ -export interface Socket { - /** - * The identifier for the Socket. - */ - 'ref'?: (_grpc_channelz_v1_SocketRef | null); - /** - * Data specific to this Socket. - */ - 'data'?: (_grpc_channelz_v1_SocketData | null); - /** - * The locally bound address. - */ - 'local'?: (_grpc_channelz_v1_Address | null); - /** - * The remote bound address. May be absent. - */ - 'remote'?: (_grpc_channelz_v1_Address | null); - /** - * Security details for this socket. May be absent if not available, or - * there is no security on the socket. - */ - 'security'?: (_grpc_channelz_v1_Security | null); - /** - * Optional, represents the name of the remote endpoint, if different than - * the original target name. - */ - 'remote_name'?: (string); -} - -/** - * Information about an actual connection. Pronounced "sock-ay". - */ -export interface Socket__Output { - /** - * The identifier for the Socket. - */ - 'ref': (_grpc_channelz_v1_SocketRef__Output | null); - /** - * Data specific to this Socket. - */ - 'data': (_grpc_channelz_v1_SocketData__Output | null); - /** - * The locally bound address. - */ - 'local': (_grpc_channelz_v1_Address__Output | null); - /** - * The remote bound address. May be absent. - */ - 'remote': (_grpc_channelz_v1_Address__Output | null); - /** - * Security details for this socket. May be absent if not available, or - * there is no security on the socket. - */ - 'security': (_grpc_channelz_v1_Security__Output | null); - /** - * Optional, represents the name of the remote endpoint, if different than - * the original target name. - */ - 'remote_name': (string); -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/grpc/channelz/v1/SocketData.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/grpc/channelz/v1/SocketData.ts deleted file mode 100644 index c62d4d10..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/grpc/channelz/v1/SocketData.ts +++ /dev/null @@ -1,150 +0,0 @@ -// Original file: proto/channelz.proto - -import type { Timestamp as _google_protobuf_Timestamp, Timestamp__Output as _google_protobuf_Timestamp__Output } from '../../../google/protobuf/Timestamp'; -import type { Int64Value as _google_protobuf_Int64Value, Int64Value__Output as _google_protobuf_Int64Value__Output } from '../../../google/protobuf/Int64Value'; -import type { SocketOption as _grpc_channelz_v1_SocketOption, SocketOption__Output as _grpc_channelz_v1_SocketOption__Output } from '../../../grpc/channelz/v1/SocketOption'; -import type { Long } from '@grpc/proto-loader'; - -/** - * SocketData is data associated for a specific Socket. The fields present - * are specific to the implementation, so there may be minor differences in - * the semantics. (e.g. flow control windows) - */ -export interface SocketData { - /** - * The number of streams that have been started. - */ - 'streams_started'?: (number | string | Long); - /** - * The number of streams that have ended successfully: - * On client side, received frame with eos bit set; - * On server side, sent frame with eos bit set. - */ - 'streams_succeeded'?: (number | string | Long); - /** - * The number of streams that have ended unsuccessfully: - * On client side, ended without receiving frame with eos bit set; - * On server side, ended without sending frame with eos bit set. - */ - 'streams_failed'?: (number | string | Long); - /** - * The number of grpc messages successfully sent on this socket. - */ - 'messages_sent'?: (number | string | Long); - /** - * The number of grpc messages received on this socket. - */ - 'messages_received'?: (number | string | Long); - /** - * The number of keep alives sent. This is typically implemented with HTTP/2 - * ping messages. - */ - 'keep_alives_sent'?: (number | string | Long); - /** - * The last time a stream was created by this endpoint. Usually unset for - * servers. - */ - 'last_local_stream_created_timestamp'?: (_google_protobuf_Timestamp | null); - /** - * The last time a stream was created by the remote endpoint. Usually unset - * for clients. - */ - 'last_remote_stream_created_timestamp'?: (_google_protobuf_Timestamp | null); - /** - * The last time a message was sent by this endpoint. - */ - 'last_message_sent_timestamp'?: (_google_protobuf_Timestamp | null); - /** - * The last time a message was received by this endpoint. - */ - 'last_message_received_timestamp'?: (_google_protobuf_Timestamp | null); - /** - * The amount of window, granted to the local endpoint by the remote endpoint. - * This may be slightly out of date due to network latency. This does NOT - * include stream level or TCP level flow control info. - */ - 'local_flow_control_window'?: (_google_protobuf_Int64Value | null); - /** - * The amount of window, granted to the remote endpoint by the local endpoint. - * This may be slightly out of date due to network latency. This does NOT - * include stream level or TCP level flow control info. - */ - 'remote_flow_control_window'?: (_google_protobuf_Int64Value | null); - /** - * Socket options set on this socket. May be absent if 'summary' is set - * on GetSocketRequest. - */ - 'option'?: (_grpc_channelz_v1_SocketOption)[]; -} - -/** - * SocketData is data associated for a specific Socket. The fields present - * are specific to the implementation, so there may be minor differences in - * the semantics. (e.g. flow control windows) - */ -export interface SocketData__Output { - /** - * The number of streams that have been started. - */ - 'streams_started': (string); - /** - * The number of streams that have ended successfully: - * On client side, received frame with eos bit set; - * On server side, sent frame with eos bit set. - */ - 'streams_succeeded': (string); - /** - * The number of streams that have ended unsuccessfully: - * On client side, ended without receiving frame with eos bit set; - * On server side, ended without sending frame with eos bit set. - */ - 'streams_failed': (string); - /** - * The number of grpc messages successfully sent on this socket. - */ - 'messages_sent': (string); - /** - * The number of grpc messages received on this socket. - */ - 'messages_received': (string); - /** - * The number of keep alives sent. This is typically implemented with HTTP/2 - * ping messages. - */ - 'keep_alives_sent': (string); - /** - * The last time a stream was created by this endpoint. Usually unset for - * servers. - */ - 'last_local_stream_created_timestamp': (_google_protobuf_Timestamp__Output | null); - /** - * The last time a stream was created by the remote endpoint. Usually unset - * for clients. - */ - 'last_remote_stream_created_timestamp': (_google_protobuf_Timestamp__Output | null); - /** - * The last time a message was sent by this endpoint. - */ - 'last_message_sent_timestamp': (_google_protobuf_Timestamp__Output | null); - /** - * The last time a message was received by this endpoint. - */ - 'last_message_received_timestamp': (_google_protobuf_Timestamp__Output | null); - /** - * The amount of window, granted to the local endpoint by the remote endpoint. - * This may be slightly out of date due to network latency. This does NOT - * include stream level or TCP level flow control info. - */ - 'local_flow_control_window': (_google_protobuf_Int64Value__Output | null); - /** - * The amount of window, granted to the remote endpoint by the local endpoint. - * This may be slightly out of date due to network latency. This does NOT - * include stream level or TCP level flow control info. - */ - 'remote_flow_control_window': (_google_protobuf_Int64Value__Output | null); - /** - * Socket options set on this socket. May be absent if 'summary' is set - * on GetSocketRequest. - */ - 'option': (_grpc_channelz_v1_SocketOption__Output)[]; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/grpc/channelz/v1/SocketOption.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/grpc/channelz/v1/SocketOption.ts deleted file mode 100644 index 115b36aa..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/grpc/channelz/v1/SocketOption.ts +++ /dev/null @@ -1,47 +0,0 @@ -// Original file: proto/channelz.proto - -import type { Any as _google_protobuf_Any, Any__Output as _google_protobuf_Any__Output } from '../../../google/protobuf/Any'; - -/** - * SocketOption represents socket options for a socket. Specifically, these - * are the options returned by getsockopt(). - */ -export interface SocketOption { - /** - * The full name of the socket option. Typically this will be the upper case - * name, such as "SO_REUSEPORT". - */ - 'name'?: (string); - /** - * The human readable value of this socket option. At least one of value or - * additional will be set. - */ - 'value'?: (string); - /** - * Additional data associated with the socket option. At least one of value - * or additional will be set. - */ - 'additional'?: (_google_protobuf_Any | null); -} - -/** - * SocketOption represents socket options for a socket. Specifically, these - * are the options returned by getsockopt(). - */ -export interface SocketOption__Output { - /** - * The full name of the socket option. Typically this will be the upper case - * name, such as "SO_REUSEPORT". - */ - 'name': (string); - /** - * The human readable value of this socket option. At least one of value or - * additional will be set. - */ - 'value': (string); - /** - * Additional data associated with the socket option. At least one of value - * or additional will be set. - */ - 'additional': (_google_protobuf_Any__Output | null); -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/grpc/channelz/v1/SocketOptionLinger.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/grpc/channelz/v1/SocketOptionLinger.ts deleted file mode 100644 index d83fa323..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/grpc/channelz/v1/SocketOptionLinger.ts +++ /dev/null @@ -1,33 +0,0 @@ -// Original file: proto/channelz.proto - -import type { Duration as _google_protobuf_Duration, Duration__Output as _google_protobuf_Duration__Output } from '../../../google/protobuf/Duration'; - -/** - * For use with SocketOption's additional field. This is primarily used for - * SO_LINGER. - */ -export interface SocketOptionLinger { - /** - * active maps to `struct linger.l_onoff` - */ - 'active'?: (boolean); - /** - * duration maps to `struct linger.l_linger` - */ - 'duration'?: (_google_protobuf_Duration | null); -} - -/** - * For use with SocketOption's additional field. This is primarily used for - * SO_LINGER. - */ -export interface SocketOptionLinger__Output { - /** - * active maps to `struct linger.l_onoff` - */ - 'active': (boolean); - /** - * duration maps to `struct linger.l_linger` - */ - 'duration': (_google_protobuf_Duration__Output | null); -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/grpc/channelz/v1/SocketOptionTcpInfo.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/grpc/channelz/v1/SocketOptionTcpInfo.ts deleted file mode 100644 index 2f8affe8..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/grpc/channelz/v1/SocketOptionTcpInfo.ts +++ /dev/null @@ -1,74 +0,0 @@ -// Original file: proto/channelz.proto - - -/** - * For use with SocketOption's additional field. Tcp info for - * SOL_TCP and TCP_INFO. - */ -export interface SocketOptionTcpInfo { - 'tcpi_state'?: (number); - 'tcpi_ca_state'?: (number); - 'tcpi_retransmits'?: (number); - 'tcpi_probes'?: (number); - 'tcpi_backoff'?: (number); - 'tcpi_options'?: (number); - 'tcpi_snd_wscale'?: (number); - 'tcpi_rcv_wscale'?: (number); - 'tcpi_rto'?: (number); - 'tcpi_ato'?: (number); - 'tcpi_snd_mss'?: (number); - 'tcpi_rcv_mss'?: (number); - 'tcpi_unacked'?: (number); - 'tcpi_sacked'?: (number); - 'tcpi_lost'?: (number); - 'tcpi_retrans'?: (number); - 'tcpi_fackets'?: (number); - 'tcpi_last_data_sent'?: (number); - 'tcpi_last_ack_sent'?: (number); - 'tcpi_last_data_recv'?: (number); - 'tcpi_last_ack_recv'?: (number); - 'tcpi_pmtu'?: (number); - 'tcpi_rcv_ssthresh'?: (number); - 'tcpi_rtt'?: (number); - 'tcpi_rttvar'?: (number); - 'tcpi_snd_ssthresh'?: (number); - 'tcpi_snd_cwnd'?: (number); - 'tcpi_advmss'?: (number); - 'tcpi_reordering'?: (number); -} - -/** - * For use with SocketOption's additional field. Tcp info for - * SOL_TCP and TCP_INFO. - */ -export interface SocketOptionTcpInfo__Output { - 'tcpi_state': (number); - 'tcpi_ca_state': (number); - 'tcpi_retransmits': (number); - 'tcpi_probes': (number); - 'tcpi_backoff': (number); - 'tcpi_options': (number); - 'tcpi_snd_wscale': (number); - 'tcpi_rcv_wscale': (number); - 'tcpi_rto': (number); - 'tcpi_ato': (number); - 'tcpi_snd_mss': (number); - 'tcpi_rcv_mss': (number); - 'tcpi_unacked': (number); - 'tcpi_sacked': (number); - 'tcpi_lost': (number); - 'tcpi_retrans': (number); - 'tcpi_fackets': (number); - 'tcpi_last_data_sent': (number); - 'tcpi_last_ack_sent': (number); - 'tcpi_last_data_recv': (number); - 'tcpi_last_ack_recv': (number); - 'tcpi_pmtu': (number); - 'tcpi_rcv_ssthresh': (number); - 'tcpi_rtt': (number); - 'tcpi_rttvar': (number); - 'tcpi_snd_ssthresh': (number); - 'tcpi_snd_cwnd': (number); - 'tcpi_advmss': (number); - 'tcpi_reordering': (number); -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/grpc/channelz/v1/SocketOptionTimeout.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/grpc/channelz/v1/SocketOptionTimeout.ts deleted file mode 100644 index 185839b2..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/grpc/channelz/v1/SocketOptionTimeout.ts +++ /dev/null @@ -1,19 +0,0 @@ -// Original file: proto/channelz.proto - -import type { Duration as _google_protobuf_Duration, Duration__Output as _google_protobuf_Duration__Output } from '../../../google/protobuf/Duration'; - -/** - * For use with SocketOption's additional field. This is primarily used for - * SO_RCVTIMEO and SO_SNDTIMEO - */ -export interface SocketOptionTimeout { - 'duration'?: (_google_protobuf_Duration | null); -} - -/** - * For use with SocketOption's additional field. This is primarily used for - * SO_RCVTIMEO and SO_SNDTIMEO - */ -export interface SocketOptionTimeout__Output { - 'duration': (_google_protobuf_Duration__Output | null); -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/grpc/channelz/v1/SocketRef.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/grpc/channelz/v1/SocketRef.ts deleted file mode 100644 index 52fdb2bd..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/grpc/channelz/v1/SocketRef.ts +++ /dev/null @@ -1,31 +0,0 @@ -// Original file: proto/channelz.proto - -import type { Long } from '@grpc/proto-loader'; - -/** - * SocketRef is a reference to a Socket. - */ -export interface SocketRef { - /** - * The globally unique id for this socket. Must be a positive number. - */ - 'socket_id'?: (number | string | Long); - /** - * An optional name associated with the socket. - */ - 'name'?: (string); -} - -/** - * SocketRef is a reference to a Socket. - */ -export interface SocketRef__Output { - /** - * The globally unique id for this socket. Must be a positive number. - */ - 'socket_id': (string); - /** - * An optional name associated with the socket. - */ - 'name': (string); -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/grpc/channelz/v1/Subchannel.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/grpc/channelz/v1/Subchannel.ts deleted file mode 100644 index 7122fac8..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/grpc/channelz/v1/Subchannel.ts +++ /dev/null @@ -1,70 +0,0 @@ -// Original file: proto/channelz.proto - -import type { SubchannelRef as _grpc_channelz_v1_SubchannelRef, SubchannelRef__Output as _grpc_channelz_v1_SubchannelRef__Output } from '../../../grpc/channelz/v1/SubchannelRef'; -import type { ChannelData as _grpc_channelz_v1_ChannelData, ChannelData__Output as _grpc_channelz_v1_ChannelData__Output } from '../../../grpc/channelz/v1/ChannelData'; -import type { ChannelRef as _grpc_channelz_v1_ChannelRef, ChannelRef__Output as _grpc_channelz_v1_ChannelRef__Output } from '../../../grpc/channelz/v1/ChannelRef'; -import type { SocketRef as _grpc_channelz_v1_SocketRef, SocketRef__Output as _grpc_channelz_v1_SocketRef__Output } from '../../../grpc/channelz/v1/SocketRef'; - -/** - * Subchannel is a logical grouping of channels, subchannels, and sockets. - * A subchannel is load balanced over by it's ancestor - */ -export interface Subchannel { - /** - * The identifier for this channel. - */ - 'ref'?: (_grpc_channelz_v1_SubchannelRef | null); - /** - * Data specific to this channel. - */ - 'data'?: (_grpc_channelz_v1_ChannelData | null); - /** - * There are no ordering guarantees on the order of channel refs. - * There may not be cycles in the ref graph. - * A channel ref may be present in more than one channel or subchannel. - */ - 'channel_ref'?: (_grpc_channelz_v1_ChannelRef)[]; - /** - * At most one of 'channel_ref+subchannel_ref' and 'socket' is set. - * There are no ordering guarantees on the order of subchannel refs. - * There may not be cycles in the ref graph. - * A sub channel ref may be present in more than one channel or subchannel. - */ - 'subchannel_ref'?: (_grpc_channelz_v1_SubchannelRef)[]; - /** - * There are no ordering guarantees on the order of sockets. - */ - 'socket_ref'?: (_grpc_channelz_v1_SocketRef)[]; -} - -/** - * Subchannel is a logical grouping of channels, subchannels, and sockets. - * A subchannel is load balanced over by it's ancestor - */ -export interface Subchannel__Output { - /** - * The identifier for this channel. - */ - 'ref': (_grpc_channelz_v1_SubchannelRef__Output | null); - /** - * Data specific to this channel. - */ - 'data': (_grpc_channelz_v1_ChannelData__Output | null); - /** - * There are no ordering guarantees on the order of channel refs. - * There may not be cycles in the ref graph. - * A channel ref may be present in more than one channel or subchannel. - */ - 'channel_ref': (_grpc_channelz_v1_ChannelRef__Output)[]; - /** - * At most one of 'channel_ref+subchannel_ref' and 'socket' is set. - * There are no ordering guarantees on the order of subchannel refs. - * There may not be cycles in the ref graph. - * A sub channel ref may be present in more than one channel or subchannel. - */ - 'subchannel_ref': (_grpc_channelz_v1_SubchannelRef__Output)[]; - /** - * There are no ordering guarantees on the order of sockets. - */ - 'socket_ref': (_grpc_channelz_v1_SocketRef__Output)[]; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/grpc/channelz/v1/SubchannelRef.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/grpc/channelz/v1/SubchannelRef.ts deleted file mode 100644 index b6911c77..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/generated/grpc/channelz/v1/SubchannelRef.ts +++ /dev/null @@ -1,31 +0,0 @@ -// Original file: proto/channelz.proto - -import type { Long } from '@grpc/proto-loader'; - -/** - * SubchannelRef is a reference to a Subchannel. - */ -export interface SubchannelRef { - /** - * The globally unique id for this subchannel. Must be a positive number. - */ - 'subchannel_id'?: (number | string | Long); - /** - * An optional name associated with the subchannel. - */ - 'name'?: (string); -} - -/** - * SubchannelRef is a reference to a Subchannel. - */ -export interface SubchannelRef__Output { - /** - * The globally unique id for this subchannel. Must be a positive number. - */ - 'subchannel_id': (string); - /** - * An optional name associated with the subchannel. - */ - 'name': (string); -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/http_proxy.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/http_proxy.ts deleted file mode 100644 index 6faa1976..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/http_proxy.ts +++ /dev/null @@ -1,301 +0,0 @@ -/* - * Copyright 2019 gRPC authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -import { log } from './logging'; -import { LogVerbosity } from './constants'; -import { getDefaultAuthority } from './resolver'; -import { Socket } from 'net'; -import * as http from 'http'; -import * as tls from 'tls'; -import * as logging from './logging'; -import { - SubchannelAddress, - isTcpSubchannelAddress, - subchannelAddressToString, -} from './subchannel-address'; -import { ChannelOptions } from './channel-options'; -import { GrpcUri, parseUri, splitHostPort, uriToString } from './uri-parser'; -import { URL } from 'url'; - -const TRACER_NAME = 'proxy'; - -function trace(text: string): void { - logging.trace(LogVerbosity.DEBUG, TRACER_NAME, text); -} - -interface ProxyInfo { - address?: string; - creds?: string; -} - -function getProxyInfo(): ProxyInfo { - let proxyEnv = ''; - let envVar = ''; - /* Prefer using 'grpc_proxy'. Fallback on 'http_proxy' if it is not set. - * Also prefer using 'https_proxy' with fallback on 'http_proxy'. The - * fallback behavior can be removed if there's a demand for it. - */ - if (process.env.grpc_proxy) { - envVar = 'grpc_proxy'; - proxyEnv = process.env.grpc_proxy; - } else if (process.env.https_proxy) { - envVar = 'https_proxy'; - proxyEnv = process.env.https_proxy; - } else if (process.env.http_proxy) { - envVar = 'http_proxy'; - proxyEnv = process.env.http_proxy; - } else { - return {}; - } - let proxyUrl: URL; - try { - proxyUrl = new URL(proxyEnv); - } catch (e) { - log(LogVerbosity.ERROR, `cannot parse value of "${envVar}" env var`); - return {}; - } - if (proxyUrl.protocol !== 'http:') { - log( - LogVerbosity.ERROR, - `"${proxyUrl.protocol}" scheme not supported in proxy URI` - ); - return {}; - } - let userCred: string | null = null; - if (proxyUrl.username) { - if (proxyUrl.password) { - log(LogVerbosity.INFO, 'userinfo found in proxy URI'); - userCred = `${proxyUrl.username}:${proxyUrl.password}`; - } else { - userCred = proxyUrl.username; - } - } - const hostname = proxyUrl.hostname; - let port = proxyUrl.port; - /* The proxy URL uses the scheme "http:", which has a default port number of - * 80. We need to set that explicitly here if it is omitted because otherwise - * it will use gRPC's default port 443. */ - if (port === '') { - port = '80'; - } - const result: ProxyInfo = { - address: `${hostname}:${port}`, - }; - if (userCred) { - result.creds = userCred; - } - trace( - 'Proxy server ' + result.address + ' set by environment variable ' + envVar - ); - return result; -} - -function getNoProxyHostList(): string[] { - /* Prefer using 'no_grpc_proxy'. Fallback on 'no_proxy' if it is not set. */ - let noProxyStr: string | undefined = process.env.no_grpc_proxy; - let envVar = 'no_grpc_proxy'; - if (!noProxyStr) { - noProxyStr = process.env.no_proxy; - envVar = 'no_proxy'; - } - if (noProxyStr) { - trace('No proxy server list set by environment variable ' + envVar); - return noProxyStr.split(','); - } else { - return []; - } -} - -export interface ProxyMapResult { - target: GrpcUri; - extraOptions: ChannelOptions; -} - -export function mapProxyName( - target: GrpcUri, - options: ChannelOptions -): ProxyMapResult { - const noProxyResult: ProxyMapResult = { - target: target, - extraOptions: {}, - }; - if ((options['grpc.enable_http_proxy'] ?? 1) === 0) { - return noProxyResult; - } - if (target.scheme === 'unix') { - return noProxyResult; - } - const proxyInfo = getProxyInfo(); - if (!proxyInfo.address) { - return noProxyResult; - } - const hostPort = splitHostPort(target.path); - if (!hostPort) { - return noProxyResult; - } - const serverHost = hostPort.host; - for (const host of getNoProxyHostList()) { - if (host === serverHost) { - trace( - 'Not using proxy for target in no_proxy list: ' + uriToString(target) - ); - return noProxyResult; - } - } - const extraOptions: ChannelOptions = { - 'grpc.http_connect_target': uriToString(target), - }; - if (proxyInfo.creds) { - extraOptions['grpc.http_connect_creds'] = proxyInfo.creds; - } - return { - target: { - scheme: 'dns', - path: proxyInfo.address, - }, - extraOptions: extraOptions, - }; -} - -export interface ProxyConnectionResult { - socket?: Socket; - realTarget?: GrpcUri; -} - -export function getProxiedConnection( - address: SubchannelAddress, - channelOptions: ChannelOptions, - connectionOptions: tls.ConnectionOptions -): Promise { - if (!('grpc.http_connect_target' in channelOptions)) { - return Promise.resolve({}); - } - const realTarget = channelOptions['grpc.http_connect_target'] as string; - const parsedTarget = parseUri(realTarget); - if (parsedTarget === null) { - return Promise.resolve({}); - } - const options: http.RequestOptions = { - method: 'CONNECT', - path: parsedTarget.path, - }; - const headers: http.OutgoingHttpHeaders = { - Host: parsedTarget.path, - }; - // Connect to the subchannel address as a proxy - if (isTcpSubchannelAddress(address)) { - options.host = address.host; - options.port = address.port; - } else { - options.socketPath = address.path; - } - if ('grpc.http_connect_creds' in channelOptions) { - headers['Proxy-Authorization'] = - 'Basic ' + - Buffer.from( - channelOptions['grpc.http_connect_creds'] as string - ).toString('base64'); - } - options.headers = headers - const proxyAddressString = subchannelAddressToString(address); - trace('Using proxy ' + proxyAddressString + ' to connect to ' + options.path); - return new Promise((resolve, reject) => { - const request = http.request(options); - request.once('connect', (res, socket, head) => { - request.removeAllListeners(); - socket.removeAllListeners(); - if (res.statusCode === 200) { - trace( - 'Successfully connected to ' + - options.path + - ' through proxy ' + - proxyAddressString - ); - if ('secureContext' in connectionOptions) { - /* The proxy is connecting to a TLS server, so upgrade this socket - * connection to a TLS connection. - * This is a workaround for https://github.com/nodejs/node/issues/32922 - * See https://github.com/grpc/grpc-node/pull/1369 for more info. */ - const targetPath = getDefaultAuthority(parsedTarget); - const hostPort = splitHostPort(targetPath); - const remoteHost = hostPort?.host ?? targetPath; - - const cts = tls.connect( - { - host: remoteHost, - servername: remoteHost, - socket: socket, - ...connectionOptions, - }, - () => { - trace( - 'Successfully established a TLS connection to ' + - options.path + - ' through proxy ' + - proxyAddressString - ); - resolve({ socket: cts, realTarget: parsedTarget }); - } - ); - cts.on('error', (error: Error) => { - trace('Failed to establish a TLS connection to ' + - options.path + - ' through proxy ' + - proxyAddressString + - ' with error ' + - error.message); - reject(); - }); - } else { - trace( - 'Successfully established a plaintext connection to ' + - options.path + - ' through proxy ' + - proxyAddressString - ); - resolve({ - socket, - realTarget: parsedTarget, - }); - } - } else { - log( - LogVerbosity.ERROR, - 'Failed to connect to ' + - options.path + - ' through proxy ' + - proxyAddressString + - ' with status ' + - res.statusCode - ); - reject(); - } - }); - request.once('error', (err) => { - request.removeAllListeners(); - log( - LogVerbosity.ERROR, - 'Failed to connect to proxy ' + - proxyAddressString + - ' with error ' + - err.message - ); - reject(); - }); - request.end(); - }); -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/index.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/index.ts deleted file mode 100644 index b4855fb5..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/index.ts +++ /dev/null @@ -1,290 +0,0 @@ -/* - * Copyright 2019 gRPC authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -import { - ClientDuplexStream, - ClientReadableStream, - ClientUnaryCall, - ClientWritableStream, - ServiceError, -} from './call'; -import { CallCredentials, OAuth2Client } from './call-credentials'; -import { Deadline, StatusObject } from './call-stream'; -import { Channel, ChannelImplementation } from './channel'; -import { CompressionAlgorithms } from './compression-algorithms'; -import { ConnectivityState } from './connectivity-state'; -import { ChannelCredentials } from './channel-credentials'; -import { - CallOptions, - Client, - ClientOptions, - CallInvocationTransformer, - CallProperties, - UnaryCallback, -} from './client'; -import { LogVerbosity, Status, Propagate } from './constants'; -import * as logging from './logging'; -import { - Deserialize, - loadPackageDefinition, - makeClientConstructor, - MethodDefinition, - ProtobufTypeDefinition, - Serialize, - ServiceClientConstructor, - ServiceDefinition, -} from './make-client'; -import { Metadata, MetadataOptions, MetadataValue } from './metadata'; -import { - Server, - UntypedHandleCall, - UntypedServiceImplementation, -} from './server'; -import { KeyCertPair, ServerCredentials } from './server-credentials'; -import { StatusBuilder } from './status-builder'; -import { - handleBidiStreamingCall, - handleServerStreamingCall, - handleClientStreamingCall, - handleUnaryCall, - sendUnaryData, - ServerUnaryCall, - ServerReadableStream, - ServerWritableStream, - ServerDuplexStream, - ServerErrorResponse, -} from './server-call'; - -export { OAuth2Client }; - -/**** Client Credentials ****/ - -// Using assign only copies enumerable properties, which is what we want -export const credentials = { - /** - * Combine a ChannelCredentials with any number of CallCredentials into a - * single ChannelCredentials object. - * @param channelCredentials The ChannelCredentials object. - * @param callCredentials Any number of CallCredentials objects. - * @return The resulting ChannelCredentials object. - */ - combineChannelCredentials: ( - channelCredentials: ChannelCredentials, - ...callCredentials: CallCredentials[] - ): ChannelCredentials => { - return callCredentials.reduce( - (acc, other) => acc.compose(other), - channelCredentials - ); - }, - - /** - * Combine any number of CallCredentials into a single CallCredentials - * object. - * @param first The first CallCredentials object. - * @param additional Any number of additional CallCredentials objects. - * @return The resulting CallCredentials object. - */ - combineCallCredentials: ( - first: CallCredentials, - ...additional: CallCredentials[] - ): CallCredentials => { - return additional.reduce((acc, other) => acc.compose(other), first); - }, - - // from channel-credentials.ts - createInsecure: ChannelCredentials.createInsecure, - createSsl: ChannelCredentials.createSsl, - createFromSecureContext: ChannelCredentials.createFromSecureContext, - - // from call-credentials.ts - createFromMetadataGenerator: CallCredentials.createFromMetadataGenerator, - createFromGoogleCredential: CallCredentials.createFromGoogleCredential, - createEmpty: CallCredentials.createEmpty, -}; - -/**** Metadata ****/ - -export { Metadata, MetadataOptions, MetadataValue }; - -/**** Constants ****/ - -export { - LogVerbosity as logVerbosity, - Status as status, - ConnectivityState as connectivityState, - Propagate as propagate, - CompressionAlgorithms as compressionAlgorithms - // TODO: Other constants as well -}; - -/**** Client ****/ - -export { - Client, - ClientOptions, - loadPackageDefinition, - makeClientConstructor, - makeClientConstructor as makeGenericClientConstructor, - CallProperties, - CallInvocationTransformer, - ChannelImplementation as Channel, - Channel as ChannelInterface, - UnaryCallback as requestCallback, -}; - -/** - * Close a Client object. - * @param client The client to close. - */ -export const closeClient = (client: Client) => client.close(); - -export const waitForClientReady = ( - client: Client, - deadline: Date | number, - callback: (error?: Error) => void -) => client.waitForReady(deadline, callback); - -/* Interfaces */ - -export { - sendUnaryData, - ChannelCredentials, - CallCredentials, - Deadline, - Serialize as serialize, - Deserialize as deserialize, - ClientUnaryCall, - ClientReadableStream, - ClientWritableStream, - ClientDuplexStream, - CallOptions, - MethodDefinition, - StatusObject, - ServiceError, - ServerUnaryCall, - ServerReadableStream, - ServerWritableStream, - ServerDuplexStream, - ServerErrorResponse, - ServiceDefinition, - UntypedHandleCall, - UntypedServiceImplementation, -}; - -/**** Server ****/ - -export { - handleBidiStreamingCall, - handleServerStreamingCall, - handleUnaryCall, - handleClientStreamingCall, -}; - -/* eslint-disable @typescript-eslint/no-explicit-any */ -export type Call = - | ClientUnaryCall - | ClientReadableStream - | ClientWritableStream - | ClientDuplexStream; -/* eslint-enable @typescript-eslint/no-explicit-any */ - -/**** Unimplemented function stubs ****/ - -/* eslint-disable @typescript-eslint/no-explicit-any */ - -export const loadObject = (value: any, options: any): never => { - throw new Error( - 'Not available in this library. Use @grpc/proto-loader and loadPackageDefinition instead' - ); -}; - -export const load = (filename: any, format: any, options: any): never => { - throw new Error( - 'Not available in this library. Use @grpc/proto-loader and loadPackageDefinition instead' - ); -}; - -export const setLogger = (logger: Partial): void => { - logging.setLogger(logger); -}; - -export const setLogVerbosity = (verbosity: LogVerbosity): void => { - logging.setLoggerVerbosity(verbosity); -}; - -export { Server }; -export { ServerCredentials }; -export { KeyCertPair }; - -export const getClientChannel = (client: Client) => { - return Client.prototype.getChannel.call(client); -}; - -export { StatusBuilder }; - -export { Listener } from './call-stream'; - -export { - Requester, - ListenerBuilder, - RequesterBuilder, - Interceptor, - InterceptorOptions, - InterceptorProvider, - InterceptingCall, - InterceptorConfigurationError, -} from './client-interceptors'; - -export { - GrpcObject, - ServiceClientConstructor, - ProtobufTypeDefinition -} from './make-client'; - -export { ChannelOptions } from './channel-options'; - -export { - getChannelzServiceDefinition, - getChannelzHandlers -} from './channelz'; - -export { addAdminServicesToServer } from './admin'; - -import * as experimental from './experimental'; -export { experimental }; - -import * as resolver_dns from './resolver-dns'; -import * as resolver_uds from './resolver-uds'; -import * as resolver_ip from './resolver-ip'; -import * as load_balancer_pick_first from './load-balancer-pick-first'; -import * as load_balancer_round_robin from './load-balancer-round-robin'; -import * as load_balancer_outlier_detection from './load-balancer-outlier-detection'; -import * as channelz from './channelz'; - -const clientVersion = require('../../package.json').version; - -(() => { - logging.trace(LogVerbosity.DEBUG, 'index', 'Loading @grpc/grpc-js version ' + clientVersion); - resolver_dns.setup(); - resolver_uds.setup(); - resolver_ip.setup(); - load_balancer_pick_first.setup(); - load_balancer_round_robin.setup(); - load_balancer_outlier_detection.setup(); - channelz.setup(); -})(); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/load-balancer-child-handler.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/load-balancer-child-handler.ts deleted file mode 100644 index 64b34181..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/load-balancer-child-handler.ts +++ /dev/null @@ -1,155 +0,0 @@ -/* - * Copyright 2020 gRPC authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -import { - LoadBalancer, - ChannelControlHelper, - LoadBalancingConfig, - createLoadBalancer, -} from './load-balancer'; -import { SubchannelAddress } from './subchannel-address'; -import { ChannelOptions } from './channel-options'; -import { ConnectivityState } from './connectivity-state'; -import { Picker } from './picker'; -import { ChannelRef, SubchannelRef } from './channelz'; -import { SubchannelInterface } from './subchannel-interface'; - -const TYPE_NAME = 'child_load_balancer_helper'; - -export class ChildLoadBalancerHandler implements LoadBalancer { - private currentChild: LoadBalancer | null = null; - private pendingChild: LoadBalancer | null = null; - - private ChildPolicyHelper = class { - private child: LoadBalancer | null = null; - constructor(private parent: ChildLoadBalancerHandler) {} - createSubchannel( - subchannelAddress: SubchannelAddress, - subchannelArgs: ChannelOptions - ): SubchannelInterface { - return this.parent.channelControlHelper.createSubchannel( - subchannelAddress, - subchannelArgs - ); - } - updateState(connectivityState: ConnectivityState, picker: Picker): void { - if (this.calledByPendingChild()) { - if (connectivityState === ConnectivityState.CONNECTING) { - return; - } - this.parent.currentChild?.destroy(); - this.parent.currentChild = this.parent.pendingChild; - this.parent.pendingChild = null; - } else if (!this.calledByCurrentChild()) { - return; - } - this.parent.channelControlHelper.updateState(connectivityState, picker); - } - requestReresolution(): void { - const latestChild = this.parent.pendingChild ?? this.parent.currentChild; - if (this.child === latestChild) { - this.parent.channelControlHelper.requestReresolution(); - } - } - setChild(newChild: LoadBalancer) { - this.child = newChild; - } - addChannelzChild(child: ChannelRef | SubchannelRef) { - this.parent.channelControlHelper.addChannelzChild(child); - } - removeChannelzChild(child: ChannelRef | SubchannelRef) { - this.parent.channelControlHelper.removeChannelzChild(child); - } - - private calledByPendingChild(): boolean { - return this.child === this.parent.pendingChild; - } - private calledByCurrentChild(): boolean { - return this.child === this.parent.currentChild; - } - }; - - constructor(private readonly channelControlHelper: ChannelControlHelper) {} - - /** - * Prerequisites: lbConfig !== null and lbConfig.name is registered - * @param addressList - * @param lbConfig - * @param attributes - */ - updateAddressList( - addressList: SubchannelAddress[], - lbConfig: LoadBalancingConfig, - attributes: { [key: string]: unknown } - ): void { - let childToUpdate: LoadBalancer; - if ( - this.currentChild === null || - this.currentChild.getTypeName() !== lbConfig.getLoadBalancerName() - ) { - const newHelper = new this.ChildPolicyHelper(this); - const newChild = createLoadBalancer(lbConfig, newHelper)!; - newHelper.setChild(newChild); - if (this.currentChild === null) { - this.currentChild = newChild; - childToUpdate = this.currentChild; - } else { - if (this.pendingChild) { - this.pendingChild.destroy(); - } - this.pendingChild = newChild; - childToUpdate = this.pendingChild; - } - } else { - if (this.pendingChild === null) { - childToUpdate = this.currentChild; - } else { - childToUpdate = this.pendingChild; - } - } - childToUpdate.updateAddressList(addressList, lbConfig, attributes); - } - exitIdle(): void { - if (this.currentChild) { - this.currentChild.exitIdle(); - if (this.pendingChild) { - this.pendingChild.exitIdle(); - } - } - } - resetBackoff(): void { - if (this.currentChild) { - this.currentChild.resetBackoff(); - if (this.pendingChild) { - this.pendingChild.resetBackoff(); - } - } - } - destroy(): void { - if (this.currentChild) { - this.currentChild.destroy(); - this.currentChild = null; - } - if (this.pendingChild) { - this.pendingChild.destroy(); - this.pendingChild = null; - } - } - getTypeName(): string { - return TYPE_NAME; - } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/load-balancer-outlier-detection.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/load-balancer-outlier-detection.ts deleted file mode 100644 index 52a9bfc9..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/load-balancer-outlier-detection.ts +++ /dev/null @@ -1,673 +0,0 @@ -/* - * Copyright 2022 gRPC authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -import { ChannelOptions, connectivityState, StatusObject } from "."; -import { Call } from "./call-stream"; -import { ConnectivityState } from "./connectivity-state"; -import { LogVerbosity, Status } from "./constants"; -import { durationToMs, isDuration, msToDuration } from "./duration"; -import { ChannelControlHelper, createChildChannelControlHelper, registerLoadBalancerType } from "./experimental"; -import { BaseFilter, Filter, FilterFactory } from "./filter"; -import { getFirstUsableConfig, LoadBalancer, LoadBalancingConfig, validateLoadBalancingConfig } from "./load-balancer"; -import { ChildLoadBalancerHandler } from "./load-balancer-child-handler"; -import { PickArgs, Picker, PickResult, PickResultType, QueuePicker, UnavailablePicker } from "./picker"; -import { Subchannel } from "./subchannel"; -import { SubchannelAddress, subchannelAddressToString } from "./subchannel-address"; -import { BaseSubchannelWrapper, ConnectivityStateListener, SubchannelInterface } from "./subchannel-interface"; -import * as logging from './logging'; - -const TRACER_NAME = 'outlier_detection'; - -function trace(text: string): void { - logging.trace(LogVerbosity.DEBUG, TRACER_NAME, text); -} - -const TYPE_NAME = 'outlier_detection'; - -const OUTLIER_DETECTION_ENABLED = (process.env.GRPC_EXPERIMENTAL_ENABLE_OUTLIER_DETECTION ?? 'true') === 'true'; - -export interface SuccessRateEjectionConfig { - readonly stdev_factor: number; - readonly enforcement_percentage: number; - readonly minimum_hosts: number; - readonly request_volume: number; -} - -export interface FailurePercentageEjectionConfig { - readonly threshold: number; - readonly enforcement_percentage: number; - readonly minimum_hosts: number; - readonly request_volume: number; -} - -const defaultSuccessRateEjectionConfig: SuccessRateEjectionConfig = { - stdev_factor: 1900, - enforcement_percentage: 100, - minimum_hosts: 5, - request_volume: 100 -}; - -const defaultFailurePercentageEjectionConfig: FailurePercentageEjectionConfig = { - threshold: 85, - enforcement_percentage: 100, - minimum_hosts: 5, - request_volume: 50 -} - -type TypeofValues = 'object' | 'boolean' | 'function' | 'number' | 'string' | 'undefined'; - -function validateFieldType(obj: any, fieldName: string, expectedType: TypeofValues, objectName?: string) { - if (fieldName in obj && typeof obj[fieldName] !== expectedType) { - const fullFieldName = objectName ? `${objectName}.${fieldName}` : fieldName; - throw new Error(`outlier detection config ${fullFieldName} parse error: expected ${expectedType}, got ${typeof obj[fieldName]}`); - } -} - -function validatePositiveDuration(obj: any, fieldName: string, objectName?: string) { - const fullFieldName = objectName ? `${objectName}.${fieldName}` : fieldName; - if (fieldName in obj) { - if (!isDuration(obj[fieldName])) { - throw new Error(`outlier detection config ${fullFieldName} parse error: expected Duration, got ${typeof obj[fieldName]}`); - } - if (!(obj[fieldName].seconds >= 0 && obj[fieldName].seconds <= 315_576_000_000 && obj[fieldName].nanos >= 0 && obj[fieldName].nanos <= 999_999_999)) { - throw new Error(`outlier detection config ${fullFieldName} parse error: values out of range for non-negative Duaration`); - } - } -} - -function validatePercentage(obj: any, fieldName: string, objectName?: string) { - const fullFieldName = objectName ? `${objectName}.${fieldName}` : fieldName; - validateFieldType(obj, fieldName, 'number', objectName); - if (fieldName in obj && !(obj[fieldName] >= 0 && obj[fieldName] <= 100)) { - throw new Error(`outlier detection config ${fullFieldName} parse error: value out of range for percentage (0-100)`); - } -} - -export class OutlierDetectionLoadBalancingConfig implements LoadBalancingConfig { - private readonly intervalMs: number; - private readonly baseEjectionTimeMs: number; - private readonly maxEjectionTimeMs: number; - private readonly maxEjectionPercent: number; - private readonly successRateEjection: SuccessRateEjectionConfig | null; - private readonly failurePercentageEjection: FailurePercentageEjectionConfig | null; - - constructor( - intervalMs: number | null, - baseEjectionTimeMs: number | null, - maxEjectionTimeMs: number | null, - maxEjectionPercent: number | null, - successRateEjection: Partial | null, - failurePercentageEjection: Partial | null, - private readonly childPolicy: LoadBalancingConfig[] - ) { - this.intervalMs = intervalMs ?? 10_000; - this.baseEjectionTimeMs = baseEjectionTimeMs ?? 30_000; - this.maxEjectionTimeMs = maxEjectionTimeMs ?? 300_000; - this.maxEjectionPercent = maxEjectionPercent ?? 10; - this.successRateEjection = successRateEjection ? {...defaultSuccessRateEjectionConfig, ...successRateEjection} : null; - this.failurePercentageEjection = failurePercentageEjection ? {...defaultFailurePercentageEjectionConfig, ...failurePercentageEjection}: null; - } - getLoadBalancerName(): string { - return TYPE_NAME; - } - toJsonObject(): object { - return { - interval: msToDuration(this.intervalMs), - base_ejection_time: msToDuration(this.baseEjectionTimeMs), - max_ejection_time: msToDuration(this.maxEjectionTimeMs), - max_ejection_percent: this.maxEjectionPercent, - success_rate_ejection: this.successRateEjection, - failure_percentage_ejection: this.failurePercentageEjection, - child_policy: this.childPolicy.map(policy => policy.toJsonObject()) - }; - } - - getIntervalMs(): number { - return this.intervalMs; - } - getBaseEjectionTimeMs(): number { - return this.baseEjectionTimeMs; - } - getMaxEjectionTimeMs(): number { - return this.maxEjectionTimeMs; - } - getMaxEjectionPercent(): number { - return this.maxEjectionPercent; - } - getSuccessRateEjectionConfig(): SuccessRateEjectionConfig | null { - return this.successRateEjection; - } - getFailurePercentageEjectionConfig(): FailurePercentageEjectionConfig | null { - return this.failurePercentageEjection; - } - getChildPolicy(): LoadBalancingConfig[] { - return this.childPolicy; - } - - copyWithChildPolicy(childPolicy: LoadBalancingConfig[]): OutlierDetectionLoadBalancingConfig { - return new OutlierDetectionLoadBalancingConfig(this.intervalMs, this.baseEjectionTimeMs, this.maxEjectionTimeMs, this.maxEjectionPercent, this.successRateEjection, this.failurePercentageEjection, childPolicy); - } - - static createFromJson(obj: any): OutlierDetectionLoadBalancingConfig { - validatePositiveDuration(obj, 'interval'); - validatePositiveDuration(obj, 'base_ejection_time'); - validatePositiveDuration(obj, 'max_ejection_time'); - validatePercentage(obj, 'max_ejection_percent'); - if ('success_rate_ejection' in obj) { - if (typeof obj.success_rate_ejection !== 'object') { - throw new Error('outlier detection config success_rate_ejection must be an object'); - } - validateFieldType(obj.success_rate_ejection, 'stdev_factor', 'number', 'success_rate_ejection'); - validatePercentage(obj.success_rate_ejection, 'enforcement_percentage', 'success_rate_ejection'); - validateFieldType(obj.success_rate_ejection, 'minimum_hosts', 'number', 'success_rate_ejection'); - validateFieldType(obj.success_rate_ejection, 'request_volume', 'number', 'success_rate_ejection'); - } - if ('failure_percentage_ejection' in obj) { - if (typeof obj.failure_percentage_ejection !== 'object') { - throw new Error('outlier detection config failure_percentage_ejection must be an object'); - } - validatePercentage(obj.failure_percentage_ejection, 'threshold', 'failure_percentage_ejection'); - validatePercentage(obj.failure_percentage_ejection, 'enforcement_percentage', 'failure_percentage_ejection'); - validateFieldType(obj.failure_percentage_ejection, 'minimum_hosts', 'number', 'failure_percentage_ejection'); - validateFieldType(obj.failure_percentage_ejection, 'request_volume', 'number', 'failure_percentage_ejection'); - } - - return new OutlierDetectionLoadBalancingConfig( - obj.interval ? durationToMs(obj.interval) : null, - obj.base_ejection_time ? durationToMs(obj.base_ejection_time) : null, - obj.max_ejection_time ? durationToMs(obj.max_ejection_time) : null, - obj.max_ejection_percent ?? null, - obj.success_rate_ejection, - obj.failure_percentage_ejection, - obj.child_policy.map(validateLoadBalancingConfig) - ); - } -} - -class OutlierDetectionSubchannelWrapper extends BaseSubchannelWrapper implements SubchannelInterface { - private childSubchannelState: ConnectivityState; - private stateListeners: ConnectivityStateListener[] = []; - private ejected: boolean = false; - private refCount: number = 0; - constructor(childSubchannel: SubchannelInterface, private mapEntry?: MapEntry) { - super(childSubchannel); - this.childSubchannelState = childSubchannel.getConnectivityState(); - childSubchannel.addConnectivityStateListener((subchannel, previousState, newState) => { - this.childSubchannelState = newState; - if (!this.ejected) { - for (const listener of this.stateListeners) { - listener(this, previousState, newState); - } - } - }); - } - - getConnectivityState(): connectivityState { - if (this.ejected) { - return ConnectivityState.TRANSIENT_FAILURE; - } else { - return this.childSubchannelState; - } - } - - /** - * Add a listener function to be called whenever the wrapper's - * connectivity state changes. - * @param listener - */ - addConnectivityStateListener(listener: ConnectivityStateListener) { - this.stateListeners.push(listener); - } - - /** - * Remove a listener previously added with `addConnectivityStateListener` - * @param listener A reference to a function previously passed to - * `addConnectivityStateListener` - */ - removeConnectivityStateListener(listener: ConnectivityStateListener) { - const listenerIndex = this.stateListeners.indexOf(listener); - if (listenerIndex > -1) { - this.stateListeners.splice(listenerIndex, 1); - } - } - - ref() { - this.child.ref(); - this.refCount += 1; - } - - unref() { - this.child.unref(); - this.refCount -= 1; - if (this.refCount <= 0) { - if (this.mapEntry) { - const index = this.mapEntry.subchannelWrappers.indexOf(this); - if (index >= 0) { - this.mapEntry.subchannelWrappers.splice(index, 1); - } - } - } - } - - eject() { - this.ejected = true; - for (const listener of this.stateListeners) { - listener(this, this.childSubchannelState, ConnectivityState.TRANSIENT_FAILURE); - } - } - - uneject() { - this.ejected = false; - for (const listener of this.stateListeners) { - listener(this, ConnectivityState.TRANSIENT_FAILURE, this.childSubchannelState); - } - } - - getMapEntry(): MapEntry | undefined { - return this.mapEntry; - } - - getWrappedSubchannel(): SubchannelInterface { - return this.child; - } -} - -interface CallCountBucket { - success: number; - failure: number; -} - -function createEmptyBucket(): CallCountBucket { - return { - success: 0, - failure: 0 - } -} - -class CallCounter { - private activeBucket: CallCountBucket = createEmptyBucket(); - private inactiveBucket: CallCountBucket = createEmptyBucket(); - addSuccess() { - this.activeBucket.success += 1; - } - addFailure() { - this.activeBucket.failure += 1; - } - switchBuckets() { - this.inactiveBucket = this.activeBucket; - this.activeBucket = createEmptyBucket(); - } - getLastSuccesses() { - return this.inactiveBucket.success; - } - getLastFailures() { - return this.inactiveBucket.failure; - } -} - -interface MapEntry { - counter: CallCounter; - currentEjectionTimestamp: Date | null; - ejectionTimeMultiplier: number; - subchannelWrappers: OutlierDetectionSubchannelWrapper[]; -} - -class OutlierDetectionCounterFilter extends BaseFilter implements Filter { - constructor(private callCounter: CallCounter) { - super(); - } - receiveTrailers(status: StatusObject): StatusObject { - if (status.code === Status.OK) { - this.callCounter.addSuccess(); - } else { - this.callCounter.addFailure(); - } - return status; - } -} - -class OutlierDetectionCounterFilterFactory implements FilterFactory { - constructor(private callCounter: CallCounter) {} - createFilter(callStream: Call): OutlierDetectionCounterFilter { - return new OutlierDetectionCounterFilter(this.callCounter); - } - -} - -class OutlierDetectionPicker implements Picker { - constructor(private wrappedPicker: Picker, private countCalls: boolean) {} - pick(pickArgs: PickArgs): PickResult { - const wrappedPick = this.wrappedPicker.pick(pickArgs); - if (wrappedPick.pickResultType === PickResultType.COMPLETE) { - const subchannelWrapper = wrappedPick.subchannel as OutlierDetectionSubchannelWrapper; - const mapEntry = subchannelWrapper.getMapEntry(); - if (mapEntry) { - const extraFilterFactories = [...wrappedPick.extraFilterFactories]; - if (this.countCalls) { - extraFilterFactories.push(new OutlierDetectionCounterFilterFactory(mapEntry.counter)); - } - return { - ...wrappedPick, - subchannel: subchannelWrapper.getWrappedSubchannel(), - extraFilterFactories: extraFilterFactories - }; - } else { - return { - ...wrappedPick, - subchannel: subchannelWrapper.getWrappedSubchannel() - } - } - } else { - return wrappedPick; - } - } - -} - -export class OutlierDetectionLoadBalancer implements LoadBalancer { - private childBalancer: ChildLoadBalancerHandler; - private addressMap: Map = new Map(); - private latestConfig: OutlierDetectionLoadBalancingConfig | null = null; - private ejectionTimer: NodeJS.Timer; - private timerStartTime: Date | null = null; - - constructor(channelControlHelper: ChannelControlHelper) { - this.childBalancer = new ChildLoadBalancerHandler(createChildChannelControlHelper(channelControlHelper, { - createSubchannel: (subchannelAddress: SubchannelAddress, subchannelArgs: ChannelOptions) => { - const originalSubchannel = channelControlHelper.createSubchannel(subchannelAddress, subchannelArgs); - const mapEntry = this.addressMap.get(subchannelAddressToString(subchannelAddress)); - const subchannelWrapper = new OutlierDetectionSubchannelWrapper(originalSubchannel, mapEntry); - if (mapEntry?.currentEjectionTimestamp !== null) { - // If the address is ejected, propagate that to the new subchannel wrapper - subchannelWrapper.eject(); - } - mapEntry?.subchannelWrappers.push(subchannelWrapper); - return subchannelWrapper; - }, - updateState: (connectivityState: ConnectivityState, picker: Picker) => { - if (connectivityState === ConnectivityState.READY) { - channelControlHelper.updateState(connectivityState, new OutlierDetectionPicker(picker, this.isCountingEnabled())); - } else { - channelControlHelper.updateState(connectivityState, picker); - } - } - })); - this.ejectionTimer = setInterval(() => {}, 0); - clearInterval(this.ejectionTimer); - } - - private isCountingEnabled(): boolean { - return this.latestConfig !== null && - (this.latestConfig.getSuccessRateEjectionConfig() !== null || - this.latestConfig.getFailurePercentageEjectionConfig() !== null); - } - - private getCurrentEjectionPercent() { - let ejectionCount = 0; - for (const mapEntry of this.addressMap.values()) { - if (mapEntry.currentEjectionTimestamp !== null) { - ejectionCount += 1; - } - } - return (ejectionCount * 100) / this.addressMap.size; - } - - private runSuccessRateCheck(ejectionTimestamp: Date) { - if (!this.latestConfig) { - return; - } - const successRateConfig = this.latestConfig.getSuccessRateEjectionConfig(); - if (!successRateConfig) { - return; - } - trace('Running success rate check'); - // Step 1 - const targetRequestVolume = successRateConfig.request_volume; - let addresesWithTargetVolume = 0; - const successRates: number[] = [] - for (const mapEntry of this.addressMap.values()) { - const successes = mapEntry.counter.getLastSuccesses(); - const failures = mapEntry.counter.getLastFailures(); - if (successes + failures >= targetRequestVolume) { - addresesWithTargetVolume += 1; - successRates.push(successes/(successes + failures)); - } - } - trace('Found ' + addresesWithTargetVolume + ' success rate candidates; currentEjectionPercent=' + this.getCurrentEjectionPercent() + ' successRates=[' + successRates + ']'); - if (addresesWithTargetVolume < successRateConfig.minimum_hosts) { - return; - } - - // Step 2 - const successRateMean = successRates.reduce((a, b) => a + b) / successRates.length; - let successRateDeviationSum = 0; - for (const rate of successRates) { - const deviation = rate - successRateMean; - successRateDeviationSum += deviation * deviation; - } - const successRateVariance = successRateDeviationSum / successRates.length; - const successRateStdev = Math.sqrt(successRateVariance); - const ejectionThreshold = successRateMean - successRateStdev * (successRateConfig.stdev_factor / 1000); - trace('stdev=' + successRateStdev + ' ejectionThreshold=' + ejectionThreshold); - - // Step 3 - for (const [address, mapEntry] of this.addressMap.entries()) { - // Step 3.i - if (this.getCurrentEjectionPercent() >= this.latestConfig.getMaxEjectionPercent()) { - break; - } - // Step 3.ii - const successes = mapEntry.counter.getLastSuccesses(); - const failures = mapEntry.counter.getLastFailures(); - if (successes + failures < targetRequestVolume) { - continue; - } - // Step 3.iii - const successRate = successes / (successes + failures); - trace('Checking candidate ' + address + ' successRate=' + successRate); - if (successRate < ejectionThreshold) { - const randomNumber = Math.random() * 100; - trace('Candidate ' + address + ' randomNumber=' + randomNumber + ' enforcement_percentage=' + successRateConfig.enforcement_percentage); - if (randomNumber < successRateConfig.enforcement_percentage) { - trace('Ejecting candidate ' + address); - this.eject(mapEntry, ejectionTimestamp); - } - } - } - } - - private runFailurePercentageCheck(ejectionTimestamp: Date) { - if (!this.latestConfig) { - return; - } - const failurePercentageConfig = this.latestConfig.getFailurePercentageEjectionConfig() - if (!failurePercentageConfig) { - return; - } - trace('Running failure percentage check. threshold=' + failurePercentageConfig.threshold + ' request volume threshold=' + failurePercentageConfig.request_volume); - // Step 1 - let addressesWithTargetVolume = 0; - for (const mapEntry of this.addressMap.values()) { - const successes = mapEntry.counter.getLastSuccesses(); - const failures = mapEntry.counter.getLastFailures(); - if (successes + failures >= failurePercentageConfig.request_volume) { - addressesWithTargetVolume += 1; - } - } - if (addressesWithTargetVolume < failurePercentageConfig.minimum_hosts) { - return; - } - - // Step 2 - for (const [address, mapEntry] of this.addressMap.entries()) { - // Step 2.i - if (this.getCurrentEjectionPercent() >= this.latestConfig.getMaxEjectionPercent()) { - break; - } - // Step 2.ii - const successes = mapEntry.counter.getLastSuccesses(); - const failures = mapEntry.counter.getLastFailures(); - trace('Candidate successes=' + successes + ' failures=' + failures); - if (successes + failures < failurePercentageConfig.request_volume) { - continue; - } - // Step 2.iii - const failurePercentage = (failures * 100) / (failures + successes); - if (failurePercentage > failurePercentageConfig.threshold) { - const randomNumber = Math.random() * 100; - trace('Candidate ' + address + ' randomNumber=' + randomNumber + ' enforcement_percentage=' + failurePercentageConfig.enforcement_percentage); - if (randomNumber < failurePercentageConfig.enforcement_percentage) { - trace('Ejecting candidate ' + address); - this.eject(mapEntry, ejectionTimestamp); - } - } - } - } - - private eject(mapEntry: MapEntry, ejectionTimestamp: Date) { - mapEntry.currentEjectionTimestamp = new Date(); - mapEntry.ejectionTimeMultiplier += 1; - for (const subchannelWrapper of mapEntry.subchannelWrappers) { - subchannelWrapper.eject(); - } - } - - private uneject(mapEntry: MapEntry) { - mapEntry.currentEjectionTimestamp = null; - for (const subchannelWrapper of mapEntry.subchannelWrappers) { - subchannelWrapper.uneject(); - } - } - - private switchAllBuckets() { - for (const mapEntry of this.addressMap.values()) { - mapEntry.counter.switchBuckets(); - } - } - - private startTimer(delayMs: number) { - this.ejectionTimer = setTimeout(() => this.runChecks(), delayMs); - } - - private runChecks() { - const ejectionTimestamp = new Date(); - trace('Ejection timer running'); - - this.switchAllBuckets(); - - if (!this.latestConfig) { - return; - } - this.timerStartTime = ejectionTimestamp; - this.startTimer(this.latestConfig.getIntervalMs()); - - this.runSuccessRateCheck(ejectionTimestamp); - this.runFailurePercentageCheck(ejectionTimestamp); - - for (const [address, mapEntry] of this.addressMap.entries()) { - if (mapEntry.currentEjectionTimestamp === null) { - if (mapEntry.ejectionTimeMultiplier > 0) { - mapEntry.ejectionTimeMultiplier -= 1; - } - } else { - const baseEjectionTimeMs = this.latestConfig.getBaseEjectionTimeMs(); - const maxEjectionTimeMs = this.latestConfig.getMaxEjectionTimeMs(); - const returnTime = new Date(mapEntry.currentEjectionTimestamp.getTime()); - returnTime.setMilliseconds(returnTime.getMilliseconds() + Math.min(baseEjectionTimeMs * mapEntry.ejectionTimeMultiplier, Math.max(baseEjectionTimeMs, maxEjectionTimeMs))); - if (returnTime < new Date()) { - trace('Unejecting ' + address); - this.uneject(mapEntry); - } - } - } - } - - updateAddressList(addressList: SubchannelAddress[], lbConfig: LoadBalancingConfig, attributes: { [key: string]: unknown; }): void { - if (!(lbConfig instanceof OutlierDetectionLoadBalancingConfig)) { - return; - } - const subchannelAddresses = new Set(); - for (const address of addressList) { - subchannelAddresses.add(subchannelAddressToString(address)); - } - for (const address of subchannelAddresses) { - if (!this.addressMap.has(address)) { - trace('Adding map entry for ' + address); - this.addressMap.set(address, { - counter: new CallCounter(), - currentEjectionTimestamp: null, - ejectionTimeMultiplier: 0, - subchannelWrappers: [] - }); - } - } - for (const key of this.addressMap.keys()) { - if (!subchannelAddresses.has(key)) { - trace('Removing map entry for ' + key); - this.addressMap.delete(key); - } - } - const childPolicy: LoadBalancingConfig = getFirstUsableConfig( - lbConfig.getChildPolicy(), - true - ); - this.childBalancer.updateAddressList(addressList, childPolicy, attributes); - - if (lbConfig.getSuccessRateEjectionConfig() || lbConfig.getFailurePercentageEjectionConfig()) { - if (this.timerStartTime) { - trace('Previous timer existed. Replacing timer'); - clearTimeout(this.ejectionTimer); - const remainingDelay = lbConfig.getIntervalMs() - ((new Date()).getTime() - this.timerStartTime.getTime()); - this.startTimer(remainingDelay); - } else { - trace('Starting new timer'); - this.timerStartTime = new Date(); - this.startTimer(lbConfig.getIntervalMs()); - this.switchAllBuckets(); - } - } else { - trace('Counting disabled. Cancelling timer.'); - this.timerStartTime = null; - clearTimeout(this.ejectionTimer); - for (const mapEntry of this.addressMap.values()) { - this.uneject(mapEntry); - mapEntry.ejectionTimeMultiplier = 0; - } - } - - this.latestConfig = lbConfig; - } - exitIdle(): void { - this.childBalancer.exitIdle(); - } - resetBackoff(): void { - this.childBalancer.resetBackoff(); - } - destroy(): void { - clearTimeout(this.ejectionTimer); - this.childBalancer.destroy(); - } - getTypeName(): string { - return TYPE_NAME; - } -} - -export function setup() { - if (OUTLIER_DETECTION_ENABLED) { - registerLoadBalancerType(TYPE_NAME, OutlierDetectionLoadBalancer, OutlierDetectionLoadBalancingConfig); - } -} \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/load-balancer-pick-first.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/load-balancer-pick-first.ts deleted file mode 100644 index 240f0e9f..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/load-balancer-pick-first.ts +++ /dev/null @@ -1,480 +0,0 @@ -/* - * Copyright 2019 gRPC authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -import { - LoadBalancer, - ChannelControlHelper, - LoadBalancingConfig, - registerDefaultLoadBalancerType, - registerLoadBalancerType, -} from './load-balancer'; -import { ConnectivityState } from './connectivity-state'; -import { - QueuePicker, - Picker, - PickArgs, - CompletePickResult, - PickResultType, - UnavailablePicker, -} from './picker'; -import { - SubchannelAddress, - subchannelAddressToString, -} from './subchannel-address'; -import * as logging from './logging'; -import { LogVerbosity } from './constants'; -import { SubchannelInterface, ConnectivityStateListener } from './subchannel-interface'; - -const TRACER_NAME = 'pick_first'; - -function trace(text: string): void { - logging.trace(LogVerbosity.DEBUG, TRACER_NAME, text); -} - -const TYPE_NAME = 'pick_first'; - -/** - * Delay after starting a connection on a subchannel before starting a - * connection on the next subchannel in the list, for Happy Eyeballs algorithm. - */ -const CONNECTION_DELAY_INTERVAL_MS = 250; - -export class PickFirstLoadBalancingConfig implements LoadBalancingConfig { - getLoadBalancerName(): string { - return TYPE_NAME; - } - - constructor() {} - - toJsonObject(): object { - return { - [TYPE_NAME]: {}, - }; - } - - // eslint-disable-next-line @typescript-eslint/no-explicit-any - static createFromJson(obj: any) { - return new PickFirstLoadBalancingConfig(); - } -} - -/** - * Picker for a `PickFirstLoadBalancer` in the READY state. Always returns the - * picked subchannel. - */ -class PickFirstPicker implements Picker { - constructor(private subchannel: SubchannelInterface) {} - - pick(pickArgs: PickArgs): CompletePickResult { - return { - pickResultType: PickResultType.COMPLETE, - subchannel: this.subchannel, - status: null, - extraFilterFactories: [], - onCallStarted: null, - }; - } -} - -interface ConnectivityStateCounts { - [ConnectivityState.CONNECTING]: number; - [ConnectivityState.IDLE]: number; - [ConnectivityState.READY]: number; - [ConnectivityState.SHUTDOWN]: number; - [ConnectivityState.TRANSIENT_FAILURE]: number; -} - -export class PickFirstLoadBalancer implements LoadBalancer { - /** - * The list of backend addresses most recently passed to `updateAddressList`. - */ - private latestAddressList: SubchannelAddress[] = []; - /** - * The list of subchannels this load balancer is currently attempting to - * connect to. - */ - private subchannels: SubchannelInterface[] = []; - /** - * The current connectivity state of the load balancer. - */ - private currentState: ConnectivityState = ConnectivityState.IDLE; - /** - * The index within the `subchannels` array of the subchannel with the most - * recently started connection attempt. - */ - private currentSubchannelIndex = 0; - - private subchannelStateCounts: ConnectivityStateCounts; - /** - * The currently picked subchannel used for making calls. Populated if - * and only if the load balancer's current state is READY. In that case, - * the subchannel's current state is also READY. - */ - private currentPick: SubchannelInterface | null = null; - /** - * Listener callback attached to each subchannel in the `subchannels` list - * while establishing a connection. - */ - private subchannelStateListener: ConnectivityStateListener; - /** - * Listener callback attached to the current picked subchannel. - */ - private pickedSubchannelStateListener: ConnectivityStateListener; - /** - * Timer reference for the timer tracking when to start - */ - private connectionDelayTimeout: NodeJS.Timeout; - - private triedAllSubchannels = false; - - /** - * Load balancer that attempts to connect to each backend in the address list - * in order, and picks the first one that connects, using it for every - * request. - * @param channelControlHelper `ChannelControlHelper` instance provided by - * this load balancer's owner. - */ - constructor(private readonly channelControlHelper: ChannelControlHelper) { - this.subchannelStateCounts = { - [ConnectivityState.CONNECTING]: 0, - [ConnectivityState.IDLE]: 0, - [ConnectivityState.READY]: 0, - [ConnectivityState.SHUTDOWN]: 0, - [ConnectivityState.TRANSIENT_FAILURE]: 0, - }; - this.subchannelStateListener = ( - subchannel: SubchannelInterface, - previousState: ConnectivityState, - newState: ConnectivityState - ) => { - this.subchannelStateCounts[previousState] -= 1; - this.subchannelStateCounts[newState] += 1; - /* If the subchannel we most recently attempted to start connecting - * to goes into TRANSIENT_FAILURE, immediately try to start - * connecting to the next one instead of waiting for the connection - * delay timer. */ - if ( - subchannel === this.subchannels[this.currentSubchannelIndex] && - newState === ConnectivityState.TRANSIENT_FAILURE - ) { - this.startNextSubchannelConnecting(); - } - if (newState === ConnectivityState.READY) { - this.pickSubchannel(subchannel); - return; - } else { - if ( - this.triedAllSubchannels && - this.subchannelStateCounts[ConnectivityState.IDLE] === - this.subchannels.length - ) { - /* If all of the subchannels are IDLE we should go back to a - * basic IDLE state where there is no subchannel list to avoid - * holding unused resources. We do not reset triedAllSubchannels - * because that is a reminder to request reresolution the next time - * this LB policy needs to connect. */ - this.resetSubchannelList(false); - this.updateState(ConnectivityState.IDLE, new QueuePicker(this)); - return; - } - if (this.currentPick === null) { - if (this.triedAllSubchannels) { - let newLBState: ConnectivityState; - if (this.subchannelStateCounts[ConnectivityState.CONNECTING] > 0) { - newLBState = ConnectivityState.CONNECTING; - } else if ( - this.subchannelStateCounts[ConnectivityState.TRANSIENT_FAILURE] > - 0 - ) { - newLBState = ConnectivityState.TRANSIENT_FAILURE; - } else { - newLBState = ConnectivityState.IDLE; - } - if (newLBState !== this.currentState) { - if (newLBState === ConnectivityState.TRANSIENT_FAILURE) { - this.updateState(newLBState, new UnavailablePicker()); - } else { - this.updateState(newLBState, new QueuePicker(this)); - } - } - } else { - this.updateState( - ConnectivityState.CONNECTING, - new QueuePicker(this) - ); - } - } - } - }; - this.pickedSubchannelStateListener = ( - subchannel: SubchannelInterface, - previousState: ConnectivityState, - newState: ConnectivityState - ) => { - if (newState !== ConnectivityState.READY) { - this.currentPick = null; - subchannel.unref(); - subchannel.removeConnectivityStateListener( - this.pickedSubchannelStateListener - ); - this.channelControlHelper.removeChannelzChild(subchannel.getChannelzRef()); - if (this.subchannels.length > 0) { - if (this.triedAllSubchannels) { - let newLBState: ConnectivityState; - if (this.subchannelStateCounts[ConnectivityState.CONNECTING] > 0) { - newLBState = ConnectivityState.CONNECTING; - } else if ( - this.subchannelStateCounts[ConnectivityState.TRANSIENT_FAILURE] > - 0 - ) { - newLBState = ConnectivityState.TRANSIENT_FAILURE; - } else { - newLBState = ConnectivityState.IDLE; - } - if (newLBState === ConnectivityState.TRANSIENT_FAILURE) { - this.updateState(newLBState, new UnavailablePicker()); - } else { - this.updateState(newLBState, new QueuePicker(this)); - } - } else { - this.updateState( - ConnectivityState.CONNECTING, - new QueuePicker(this) - ); - } - } else { - /* We don't need to backoff here because this only happens if a - * subchannel successfully connects then disconnects, so it will not - * create a loop of attempting to connect to an unreachable backend - */ - this.updateState(ConnectivityState.IDLE, new QueuePicker(this)); - } - } - }; - this.connectionDelayTimeout = setTimeout(() => {}, 0); - clearTimeout(this.connectionDelayTimeout); - } - - private startNextSubchannelConnecting() { - if (this.triedAllSubchannels) { - return; - } - for (const [index, subchannel] of this.subchannels.entries()) { - if (index > this.currentSubchannelIndex) { - const subchannelState = subchannel.getConnectivityState(); - if ( - subchannelState === ConnectivityState.IDLE || - subchannelState === ConnectivityState.CONNECTING - ) { - this.startConnecting(index); - return; - } - } - } - this.triedAllSubchannels = true; - } - - /** - * Have a single subchannel in the `subchannels` list start connecting. - * @param subchannelIndex The index into the `subchannels` list. - */ - private startConnecting(subchannelIndex: number) { - clearTimeout(this.connectionDelayTimeout); - this.currentSubchannelIndex = subchannelIndex; - if ( - this.subchannels[subchannelIndex].getConnectivityState() === - ConnectivityState.IDLE - ) { - trace( - 'Start connecting to subchannel with address ' + - this.subchannels[subchannelIndex].getAddress() - ); - process.nextTick(() => { - this.subchannels[subchannelIndex].startConnecting(); - }); - } - this.connectionDelayTimeout = setTimeout(() => { - this.startNextSubchannelConnecting(); - }, CONNECTION_DELAY_INTERVAL_MS); - } - - private pickSubchannel(subchannel: SubchannelInterface) { - trace('Pick subchannel with address ' + subchannel.getAddress()); - if (this.currentPick !== null) { - this.currentPick.unref(); - this.currentPick.removeConnectivityStateListener( - this.pickedSubchannelStateListener - ); - } - this.currentPick = subchannel; - this.updateState(ConnectivityState.READY, new PickFirstPicker(subchannel)); - subchannel.addConnectivityStateListener(this.pickedSubchannelStateListener); - subchannel.ref(); - this.channelControlHelper.addChannelzChild(subchannel.getChannelzRef()); - this.resetSubchannelList(); - clearTimeout(this.connectionDelayTimeout); - } - - private updateState(newState: ConnectivityState, picker: Picker) { - trace( - ConnectivityState[this.currentState] + - ' -> ' + - ConnectivityState[newState] - ); - this.currentState = newState; - this.channelControlHelper.updateState(newState, picker); - } - - private resetSubchannelList(resetTriedAllSubchannels = true) { - for (const subchannel of this.subchannels) { - subchannel.removeConnectivityStateListener(this.subchannelStateListener); - subchannel.unref(); - this.channelControlHelper.removeChannelzChild(subchannel.getChannelzRef()); - } - this.currentSubchannelIndex = 0; - this.subchannelStateCounts = { - [ConnectivityState.CONNECTING]: 0, - [ConnectivityState.IDLE]: 0, - [ConnectivityState.READY]: 0, - [ConnectivityState.SHUTDOWN]: 0, - [ConnectivityState.TRANSIENT_FAILURE]: 0, - }; - this.subchannels = []; - if (resetTriedAllSubchannels) { - this.triedAllSubchannels = false; - } - } - - /** - * Start connecting to the address list most recently passed to - * `updateAddressList`. - */ - private connectToAddressList(): void { - this.resetSubchannelList(); - trace( - 'Connect to address list ' + - this.latestAddressList.map((address) => - subchannelAddressToString(address) - ) - ); - this.subchannels = this.latestAddressList.map((address) => - this.channelControlHelper.createSubchannel(address, {}) - ); - for (const subchannel of this.subchannels) { - subchannel.ref(); - this.channelControlHelper.addChannelzChild(subchannel.getChannelzRef()); - } - for (const subchannel of this.subchannels) { - subchannel.addConnectivityStateListener(this.subchannelStateListener); - this.subchannelStateCounts[subchannel.getConnectivityState()] += 1; - if (subchannel.getConnectivityState() === ConnectivityState.READY) { - this.pickSubchannel(subchannel); - this.resetSubchannelList(); - return; - } - } - for (const [index, subchannel] of this.subchannels.entries()) { - const subchannelState = subchannel.getConnectivityState(); - if ( - subchannelState === ConnectivityState.IDLE || - subchannelState === ConnectivityState.CONNECTING - ) { - this.startConnecting(index); - if (this.currentPick === null) { - this.updateState(ConnectivityState.CONNECTING, new QueuePicker(this)); - } - return; - } - } - // If the code reaches this point, every subchannel must be in TRANSIENT_FAILURE - if (this.currentPick === null) { - this.updateState( - ConnectivityState.TRANSIENT_FAILURE, - new UnavailablePicker() - ); - } - } - - updateAddressList( - addressList: SubchannelAddress[], - lbConfig: LoadBalancingConfig - ): void { - // lbConfig has no useful information for pick first load balancing - /* To avoid unnecessary churn, we only do something with this address list - * if we're not currently trying to establish a connection, or if the new - * address list is different from the existing one */ - if ( - this.subchannels.length === 0 || - !this.latestAddressList.every( - (value, index) => addressList[index] === value - ) - ) { - this.latestAddressList = addressList; - this.connectToAddressList(); - } - } - - exitIdle() { - if ( - this.currentState === ConnectivityState.IDLE || - this.triedAllSubchannels - ) { - this.channelControlHelper.requestReresolution(); - } - for (const subchannel of this.subchannels) { - subchannel.startConnecting(); - } - if (this.currentState === ConnectivityState.IDLE) { - if (this.latestAddressList.length > 0) { - this.connectToAddressList(); - } - } - } - - resetBackoff() { - /* The pick first load balancer does not have a connection backoff, so this - * does nothing */ - } - - destroy() { - this.resetSubchannelList(); - if (this.currentPick !== null) { - /* Unref can cause a state change, which can cause a change in the value - * of this.currentPick, so we hold a local reference to make sure that - * does not impact this function. */ - const currentPick = this.currentPick; - currentPick.unref(); - currentPick.removeConnectivityStateListener( - this.pickedSubchannelStateListener - ); - this.channelControlHelper.removeChannelzChild(currentPick.getChannelzRef()); - } - } - - getTypeName(): string { - return TYPE_NAME; - } -} - -export function setup(): void { - registerLoadBalancerType( - TYPE_NAME, - PickFirstLoadBalancer, - PickFirstLoadBalancingConfig - ); - registerDefaultLoadBalancerType(TYPE_NAME); -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/load-balancer-round-robin.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/load-balancer-round-robin.ts deleted file mode 100644 index 8a4094a0..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/load-balancer-round-robin.ts +++ /dev/null @@ -1,257 +0,0 @@ -/* - * Copyright 2019 gRPC authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -import { - LoadBalancer, - ChannelControlHelper, - LoadBalancingConfig, - registerLoadBalancerType, -} from './load-balancer'; -import { ConnectivityState } from './connectivity-state'; -import { - QueuePicker, - Picker, - PickArgs, - CompletePickResult, - PickResultType, - UnavailablePicker, -} from './picker'; -import { - SubchannelAddress, - subchannelAddressToString, -} from './subchannel-address'; -import * as logging from './logging'; -import { LogVerbosity } from './constants'; -import { ConnectivityStateListener, SubchannelInterface } from './subchannel-interface'; - -const TRACER_NAME = 'round_robin'; - -function trace(text: string): void { - logging.trace(LogVerbosity.DEBUG, TRACER_NAME, text); -} - -const TYPE_NAME = 'round_robin'; - -class RoundRobinLoadBalancingConfig implements LoadBalancingConfig { - getLoadBalancerName(): string { - return TYPE_NAME; - } - - constructor() {} - - toJsonObject(): object { - return { - [TYPE_NAME]: {}, - }; - } - - // eslint-disable-next-line @typescript-eslint/no-explicit-any - static createFromJson(obj: any) { - return new RoundRobinLoadBalancingConfig(); - } -} - -class RoundRobinPicker implements Picker { - constructor( - private readonly subchannelList: SubchannelInterface[], - private nextIndex = 0 - ) {} - - pick(pickArgs: PickArgs): CompletePickResult { - const pickedSubchannel = this.subchannelList[this.nextIndex]; - this.nextIndex = (this.nextIndex + 1) % this.subchannelList.length; - return { - pickResultType: PickResultType.COMPLETE, - subchannel: pickedSubchannel, - status: null, - extraFilterFactories: [], - onCallStarted: null, - }; - } - - /** - * Check what the next subchannel returned would be. Used by the load - * balancer implementation to preserve this part of the picker state if - * possible when a subchannel connects or disconnects. - */ - peekNextSubchannel(): SubchannelInterface { - return this.subchannelList[this.nextIndex]; - } -} - -interface ConnectivityStateCounts { - [ConnectivityState.CONNECTING]: number; - [ConnectivityState.IDLE]: number; - [ConnectivityState.READY]: number; - [ConnectivityState.SHUTDOWN]: number; - [ConnectivityState.TRANSIENT_FAILURE]: number; -} - -export class RoundRobinLoadBalancer implements LoadBalancer { - private subchannels: SubchannelInterface[] = []; - - private currentState: ConnectivityState = ConnectivityState.IDLE; - - private subchannelStateListener: ConnectivityStateListener; - - private subchannelStateCounts: ConnectivityStateCounts; - - private currentReadyPicker: RoundRobinPicker | null = null; - - constructor(private readonly channelControlHelper: ChannelControlHelper) { - this.subchannelStateCounts = { - [ConnectivityState.CONNECTING]: 0, - [ConnectivityState.IDLE]: 0, - [ConnectivityState.READY]: 0, - [ConnectivityState.SHUTDOWN]: 0, - [ConnectivityState.TRANSIENT_FAILURE]: 0, - }; - this.subchannelStateListener = ( - subchannel: SubchannelInterface, - previousState: ConnectivityState, - newState: ConnectivityState - ) => { - this.subchannelStateCounts[previousState] -= 1; - this.subchannelStateCounts[newState] += 1; - this.calculateAndUpdateState(); - - if ( - newState === ConnectivityState.TRANSIENT_FAILURE || - newState === ConnectivityState.IDLE - ) { - this.channelControlHelper.requestReresolution(); - subchannel.startConnecting(); - } - }; - } - - private calculateAndUpdateState() { - if (this.subchannelStateCounts[ConnectivityState.READY] > 0) { - const readySubchannels = this.subchannels.filter( - (subchannel) => - subchannel.getConnectivityState() === ConnectivityState.READY - ); - let index = 0; - if (this.currentReadyPicker !== null) { - index = readySubchannels.indexOf( - this.currentReadyPicker.peekNextSubchannel() - ); - if (index < 0) { - index = 0; - } - } - this.updateState( - ConnectivityState.READY, - new RoundRobinPicker(readySubchannels, index) - ); - } else if (this.subchannelStateCounts[ConnectivityState.CONNECTING] > 0) { - this.updateState(ConnectivityState.CONNECTING, new QueuePicker(this)); - } else if ( - this.subchannelStateCounts[ConnectivityState.TRANSIENT_FAILURE] > 0 - ) { - this.updateState( - ConnectivityState.TRANSIENT_FAILURE, - new UnavailablePicker() - ); - } else { - this.updateState(ConnectivityState.IDLE, new QueuePicker(this)); - } - } - - private updateState(newState: ConnectivityState, picker: Picker) { - trace( - ConnectivityState[this.currentState] + - ' -> ' + - ConnectivityState[newState] - ); - if (newState === ConnectivityState.READY) { - this.currentReadyPicker = picker as RoundRobinPicker; - } else { - this.currentReadyPicker = null; - } - this.currentState = newState; - this.channelControlHelper.updateState(newState, picker); - } - - private resetSubchannelList() { - for (const subchannel of this.subchannels) { - subchannel.removeConnectivityStateListener(this.subchannelStateListener); - subchannel.unref(); - this.channelControlHelper.removeChannelzChild(subchannel.getChannelzRef()); - } - this.subchannelStateCounts = { - [ConnectivityState.CONNECTING]: 0, - [ConnectivityState.IDLE]: 0, - [ConnectivityState.READY]: 0, - [ConnectivityState.SHUTDOWN]: 0, - [ConnectivityState.TRANSIENT_FAILURE]: 0, - }; - this.subchannels = []; - } - - updateAddressList( - addressList: SubchannelAddress[], - lbConfig: LoadBalancingConfig - ): void { - this.resetSubchannelList(); - trace( - 'Connect to address list ' + - addressList.map((address) => subchannelAddressToString(address)) - ); - this.subchannels = addressList.map((address) => - this.channelControlHelper.createSubchannel(address, {}) - ); - for (const subchannel of this.subchannels) { - subchannel.ref(); - subchannel.addConnectivityStateListener(this.subchannelStateListener); - this.channelControlHelper.addChannelzChild(subchannel.getChannelzRef()); - const subchannelState = subchannel.getConnectivityState(); - this.subchannelStateCounts[subchannelState] += 1; - if ( - subchannelState === ConnectivityState.IDLE || - subchannelState === ConnectivityState.TRANSIENT_FAILURE - ) { - subchannel.startConnecting(); - } - } - this.calculateAndUpdateState(); - } - - exitIdle(): void { - for (const subchannel of this.subchannels) { - subchannel.startConnecting(); - } - } - resetBackoff(): void { - /* The pick first load balancer does not have a connection backoff, so this - * does nothing */ - } - destroy(): void { - this.resetSubchannelList(); - } - getTypeName(): string { - return TYPE_NAME; - } -} - -export function setup() { - registerLoadBalancerType( - TYPE_NAME, - RoundRobinLoadBalancer, - RoundRobinLoadBalancingConfig - ); -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/load-balancer.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/load-balancer.ts deleted file mode 100644 index 48930c7d..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/load-balancer.ts +++ /dev/null @@ -1,219 +0,0 @@ -/* - * Copyright 2019 gRPC authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -import { ChannelOptions } from './channel-options'; -import { Subchannel } from './subchannel'; -import { SubchannelAddress } from './subchannel-address'; -import { ConnectivityState } from './connectivity-state'; -import { Picker } from './picker'; -import { ChannelRef, SubchannelRef } from './channelz'; -import { SubchannelInterface } from './subchannel-interface'; - -/** - * A collection of functions associated with a channel that a load balancer - * can call as necessary. - */ -export interface ChannelControlHelper { - /** - * Returns a subchannel connected to the specified address. - * @param subchannelAddress The address to connect to - * @param subchannelArgs Extra channel arguments specified by the load balancer - */ - createSubchannel( - subchannelAddress: SubchannelAddress, - subchannelArgs: ChannelOptions - ): SubchannelInterface; - /** - * Passes a new subchannel picker up to the channel. This is called if either - * the connectivity state changes or if a different picker is needed for any - * other reason. - * @param connectivityState New connectivity state - * @param picker New picker - */ - updateState(connectivityState: ConnectivityState, picker: Picker): void; - /** - * Request new data from the resolver. - */ - requestReresolution(): void; - addChannelzChild(child: ChannelRef | SubchannelRef): void; - removeChannelzChild(child: ChannelRef | SubchannelRef): void; -} - -/** - * Create a child ChannelControlHelper that overrides some methods of the - * parent while letting others pass through to the parent unmodified. This - * allows other code to create these children without needing to know about - * all of the methods to be passed through. - * @param parent - * @param overrides - */ -export function createChildChannelControlHelper(parent: ChannelControlHelper, overrides: Partial): ChannelControlHelper { - return { - createSubchannel: overrides.createSubchannel?.bind(overrides) ?? parent.createSubchannel.bind(parent), - updateState: overrides.updateState?.bind(overrides) ?? parent.updateState.bind(parent), - requestReresolution: overrides.requestReresolution?.bind(overrides) ?? parent.requestReresolution.bind(parent), - addChannelzChild: overrides.addChannelzChild?.bind(overrides) ?? parent.addChannelzChild.bind(parent), - removeChannelzChild: overrides.removeChannelzChild?.bind(overrides) ?? parent.removeChannelzChild.bind(parent) - }; -} - -/** - * Tracks one or more connected subchannels and determines which subchannel - * each request should use. - */ -export interface LoadBalancer { - /** - * Gives the load balancer a new list of addresses to start connecting to. - * The load balancer will start establishing connections with the new list, - * but will continue using any existing connections until the new connections - * are established - * @param addressList The new list of addresses to connect to - * @param lbConfig The load balancing config object from the service config, - * if one was provided - */ - updateAddressList( - addressList: SubchannelAddress[], - lbConfig: LoadBalancingConfig, - attributes: { [key: string]: unknown } - ): void; - /** - * If the load balancer is currently in the IDLE state, start connecting. - */ - exitIdle(): void; - /** - * If the load balancer is currently in the CONNECTING or TRANSIENT_FAILURE - * state, reset the current connection backoff timeout to its base value and - * transition to CONNECTING if in TRANSIENT_FAILURE. - */ - resetBackoff(): void; - /** - * The load balancer unrefs all of its subchannels and stops calling methods - * of its channel control helper. - */ - destroy(): void; - /** - * Get the type name for this load balancer type. Must be constant across an - * entire load balancer implementation class and must match the name that the - * balancer implementation class was registered with. - */ - getTypeName(): string; -} - -export interface LoadBalancerConstructor { - new (channelControlHelper: ChannelControlHelper): LoadBalancer; -} - -export interface LoadBalancingConfig { - getLoadBalancerName(): string; - toJsonObject(): object; -} - -export interface LoadBalancingConfigConstructor { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - new (...args: any): LoadBalancingConfig; - // eslint-disable-next-line @typescript-eslint/no-explicit-any - createFromJson(obj: any): LoadBalancingConfig; -} - -const registeredLoadBalancerTypes: { - [name: string]: { - LoadBalancer: LoadBalancerConstructor; - LoadBalancingConfig: LoadBalancingConfigConstructor; - }; -} = {}; - -let defaultLoadBalancerType: string | null = null; - -export function registerLoadBalancerType( - typeName: string, - loadBalancerType: LoadBalancerConstructor, - loadBalancingConfigType: LoadBalancingConfigConstructor -) { - registeredLoadBalancerTypes[typeName] = { - LoadBalancer: loadBalancerType, - LoadBalancingConfig: loadBalancingConfigType, - }; -} - -export function registerDefaultLoadBalancerType(typeName: string) { - defaultLoadBalancerType = typeName; -} - -export function createLoadBalancer( - config: LoadBalancingConfig, - channelControlHelper: ChannelControlHelper -): LoadBalancer | null { - const typeName = config.getLoadBalancerName(); - if (typeName in registeredLoadBalancerTypes) { - return new registeredLoadBalancerTypes[typeName].LoadBalancer( - channelControlHelper - ); - } else { - return null; - } -} - -export function isLoadBalancerNameRegistered(typeName: string): boolean { - return typeName in registeredLoadBalancerTypes; -} - -export function getFirstUsableConfig( - configs: LoadBalancingConfig[], - fallbackTodefault?: true -): LoadBalancingConfig; -export function getFirstUsableConfig( - configs: LoadBalancingConfig[], - fallbackTodefault = false -): LoadBalancingConfig | null { - for (const config of configs) { - if (config.getLoadBalancerName() in registeredLoadBalancerTypes) { - return config; - } - } - if (fallbackTodefault) { - if (defaultLoadBalancerType) { - return new registeredLoadBalancerTypes[ - defaultLoadBalancerType - ]!.LoadBalancingConfig(); - } else { - return null; - } - } else { - return null; - } -} - -// eslint-disable-next-line @typescript-eslint/no-explicit-any -export function validateLoadBalancingConfig(obj: any): LoadBalancingConfig { - if (!(obj !== null && typeof obj === 'object')) { - throw new Error('Load balancing config must be an object'); - } - const keys = Object.keys(obj); - if (keys.length !== 1) { - throw new Error( - 'Provided load balancing config has multiple conflicting entries' - ); - } - const typeName = keys[0]; - if (typeName in registeredLoadBalancerTypes) { - return registeredLoadBalancerTypes[ - typeName - ].LoadBalancingConfig.createFromJson(obj[typeName]); - } else { - throw new Error(`Unrecognized load balancing config name ${typeName}`); - } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/logging.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/logging.ts deleted file mode 100644 index ec845c1a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/logging.ts +++ /dev/null @@ -1,119 +0,0 @@ -/* - * Copyright 2019 gRPC authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -import { LogVerbosity } from './constants'; - -const DEFAULT_LOGGER: Partial = { - error: (message?: any, ...optionalParams: any[]) => { - console.error('E ' + message, ...optionalParams); - }, - info: (message?: any, ...optionalParams: any[]) => { - console.error('I ' + message, ...optionalParams); - }, - debug: (message?: any, ...optionalParams: any[]) => { - console.error('D ' + message, ...optionalParams); - }, -} - -let _logger: Partial = DEFAULT_LOGGER; -let _logVerbosity: LogVerbosity = LogVerbosity.ERROR; - -const verbosityString = - process.env.GRPC_NODE_VERBOSITY ?? process.env.GRPC_VERBOSITY ?? ''; - -switch (verbosityString.toUpperCase()) { - case 'DEBUG': - _logVerbosity = LogVerbosity.DEBUG; - break; - case 'INFO': - _logVerbosity = LogVerbosity.INFO; - break; - case 'ERROR': - _logVerbosity = LogVerbosity.ERROR; - break; - case 'NONE': - _logVerbosity = LogVerbosity.NONE; - break; - default: - // Ignore any other values -} - -export const getLogger = (): Partial => { - return _logger; -}; - -export const setLogger = (logger: Partial): void => { - _logger = logger; -}; - -export const setLoggerVerbosity = (verbosity: LogVerbosity): void => { - _logVerbosity = verbosity; -}; - -// eslint-disable-next-line @typescript-eslint/no-explicit-any -export const log = (severity: LogVerbosity, ...args: any[]): void => { - let logFunction: typeof DEFAULT_LOGGER.error; - if (severity >= _logVerbosity) { - switch (severity) { - case LogVerbosity.DEBUG: - logFunction = _logger.debug; - break; - case LogVerbosity.INFO: - logFunction = _logger.info; - break; - case LogVerbosity.ERROR: - logFunction = _logger.error; - break; - } - /* Fall back to _logger.error when other methods are not available for - * compatiblity with older behavior that always logged to _logger.error */ - if (!logFunction) { - logFunction = _logger.error; - } - if (logFunction) { - logFunction.bind(_logger)(...args); - } - } -}; - -const tracersString = - process.env.GRPC_NODE_TRACE ?? process.env.GRPC_TRACE ?? ''; -const enabledTracers = new Set(); -const disabledTracers = new Set(); -for (const tracerName of tracersString.split(',')) { - if (tracerName.startsWith('-')) { - disabledTracers.add(tracerName.substring(1)); - } else { - enabledTracers.add(tracerName); - } -} -const allEnabled = enabledTracers.has('all'); - -export function trace( - severity: LogVerbosity, - tracer: string, - text: string -): void { - if (isTracerEnabled(tracer)) { - log(severity, new Date().toISOString() + ' | ' + tracer + ' | ' + text); - } -} - -export function isTracerEnabled(tracer: string): boolean { - return !disabledTracers.has(tracer) && - (allEnabled || enabledTracers.has(tracer)); -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/make-client.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/make-client.ts deleted file mode 100644 index 7d08fee2..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/make-client.ts +++ /dev/null @@ -1,238 +0,0 @@ -/* - * Copyright 2019 gRPC authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -import { ChannelCredentials } from './channel-credentials'; -import { ChannelOptions } from './channel-options'; -import { Client } from './client'; -import { UntypedServiceImplementation } from './server'; - -export interface Serialize { - (value: T): Buffer; -} - -export interface Deserialize { - (bytes: Buffer): T; -} - -export interface ClientMethodDefinition { - path: string; - requestStream: boolean; - responseStream: boolean; - requestSerialize: Serialize; - responseDeserialize: Deserialize; - originalName?: string; -} - -export interface ServerMethodDefinition { - path: string; - requestStream: boolean; - responseStream: boolean; - responseSerialize: Serialize; - requestDeserialize: Deserialize; - originalName?: string; -} - -export interface MethodDefinition - extends ClientMethodDefinition, - ServerMethodDefinition {} - -/* eslint-disable @typescript-eslint/no-explicit-any */ -export type ServiceDefinition< - ImplementationType = UntypedServiceImplementation -> = { - readonly [index in keyof ImplementationType]: MethodDefinition; -}; -/* eslint-enable @typescript-eslint/no-explicit-any */ - -export interface ProtobufTypeDefinition { - format: string; - type: object; - fileDescriptorProtos: Buffer[]; -} - -export interface PackageDefinition { - [index: string]: ServiceDefinition | ProtobufTypeDefinition; -} - -/** - * Map with short names for each of the requester maker functions. Used in - * makeClientConstructor - * @private - */ -const requesterFuncs = { - unary: Client.prototype.makeUnaryRequest, - server_stream: Client.prototype.makeServerStreamRequest, - client_stream: Client.prototype.makeClientStreamRequest, - bidi: Client.prototype.makeBidiStreamRequest, -}; - -export interface ServiceClient extends Client { - [methodName: string]: Function; -} - -export interface ServiceClientConstructor { - new ( - address: string, - credentials: ChannelCredentials, - options?: Partial - ): ServiceClient; - service: ServiceDefinition; - serviceName: string; -} - -/** - * Returns true, if given key is included in the blacklisted - * keys. - * @param key key for check, string. - */ -function isPrototypePolluted(key: string): boolean { - return ['__proto__', 'prototype', 'constructor'].includes(key); -} - -/** - * Creates a constructor for a client with the given methods, as specified in - * the methods argument. The resulting class will have an instance method for - * each method in the service, which is a partial application of one of the - * [Client]{@link grpc.Client} request methods, depending on `requestSerialize` - * and `responseSerialize`, with the `method`, `serialize`, and `deserialize` - * arguments predefined. - * @param methods An object mapping method names to - * method attributes - * @param serviceName The fully qualified name of the service - * @param classOptions An options object. - * @return New client constructor, which is a subclass of - * {@link grpc.Client}, and has the same arguments as that constructor. - */ -export function makeClientConstructor( - methods: ServiceDefinition, - serviceName: string, - classOptions?: {} -): ServiceClientConstructor { - if (!classOptions) { - classOptions = {}; - } - - class ServiceClientImpl extends Client implements ServiceClient { - static service: ServiceDefinition; - static serviceName: string; - [methodName: string]: Function; - } - - Object.keys(methods).forEach((name) => { - if (isPrototypePolluted(name)) { - return; - } - const attrs = methods[name]; - let methodType: keyof typeof requesterFuncs; - // TODO(murgatroid99): Verify that we don't need this anymore - if (typeof name === 'string' && name.charAt(0) === '$') { - throw new Error('Method names cannot start with $'); - } - if (attrs.requestStream) { - if (attrs.responseStream) { - methodType = 'bidi'; - } else { - methodType = 'client_stream'; - } - } else { - if (attrs.responseStream) { - methodType = 'server_stream'; - } else { - methodType = 'unary'; - } - } - const serialize = attrs.requestSerialize; - const deserialize = attrs.responseDeserialize; - const methodFunc = partial( - requesterFuncs[methodType], - attrs.path, - serialize, - deserialize - ); - ServiceClientImpl.prototype[name] = methodFunc; - // Associate all provided attributes with the method - Object.assign(ServiceClientImpl.prototype[name], attrs); - if (attrs.originalName && !isPrototypePolluted(attrs.originalName)) { - ServiceClientImpl.prototype[attrs.originalName] = - ServiceClientImpl.prototype[name]; - } - }); - - ServiceClientImpl.service = methods; - ServiceClientImpl.serviceName = serviceName; - - return ServiceClientImpl; -} - -function partial( - fn: Function, - path: string, - serialize: Function, - deserialize: Function -): Function { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - return function (this: any, ...args: any[]) { - return fn.call(this, path, serialize, deserialize, ...args); - }; -} - -export interface GrpcObject { - [index: string]: - | GrpcObject - | ServiceClientConstructor - | ProtobufTypeDefinition; -} - -function isProtobufTypeDefinition( - obj: ServiceDefinition | ProtobufTypeDefinition -): obj is ProtobufTypeDefinition { - return 'format' in obj; -} - -/** - * Load a gRPC package definition as a gRPC object hierarchy. - * @param packageDef The package definition object. - * @return The resulting gRPC object. - */ -export function loadPackageDefinition( - packageDef: PackageDefinition -): GrpcObject { - const result: GrpcObject = {}; - for (const serviceFqn in packageDef) { - if (Object.prototype.hasOwnProperty.call(packageDef, serviceFqn)) { - const service = packageDef[serviceFqn]; - const nameComponents = serviceFqn.split('.'); - if (nameComponents.some((comp: string) => isPrototypePolluted(comp))) { - continue; - } - const serviceName = nameComponents[nameComponents.length - 1]; - let current = result; - for (const packageName of nameComponents.slice(0, -1)) { - if (!current[packageName]) { - current[packageName] = {}; - } - current = current[packageName] as GrpcObject; - } - if (isProtobufTypeDefinition(service)) { - current[serviceName] = service; - } else { - current[serviceName] = makeClientConstructor(service, serviceName, {}); - } - } - } - return result; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/max-message-size-filter.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/max-message-size-filter.ts deleted file mode 100644 index 9a3bc9c0..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/max-message-size-filter.ts +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Copyright 2020 gRPC authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -import { BaseFilter, Filter, FilterFactory } from './filter'; -import { Call, WriteObject } from './call-stream'; -import { - Status, - DEFAULT_MAX_SEND_MESSAGE_LENGTH, - DEFAULT_MAX_RECEIVE_MESSAGE_LENGTH, -} from './constants'; -import { ChannelOptions } from './channel-options'; - -export class MaxMessageSizeFilter extends BaseFilter implements Filter { - private maxSendMessageSize: number = DEFAULT_MAX_SEND_MESSAGE_LENGTH; - private maxReceiveMessageSize: number = DEFAULT_MAX_RECEIVE_MESSAGE_LENGTH; - constructor( - private readonly options: ChannelOptions, - private readonly callStream: Call - ) { - super(); - if ('grpc.max_send_message_length' in options) { - this.maxSendMessageSize = options['grpc.max_send_message_length']!; - } - if ('grpc.max_receive_message_length' in options) { - this.maxReceiveMessageSize = options['grpc.max_receive_message_length']!; - } - } - - async sendMessage(message: Promise): Promise { - /* A configured size of -1 means that there is no limit, so skip the check - * entirely */ - if (this.maxSendMessageSize === -1) { - return message; - } else { - const concreteMessage = await message; - if (concreteMessage.message.length > this.maxSendMessageSize) { - this.callStream.cancelWithStatus( - Status.RESOURCE_EXHAUSTED, - `Sent message larger than max (${concreteMessage.message.length} vs. ${this.maxSendMessageSize})` - ); - return Promise.reject('Message too large'); - } else { - return concreteMessage; - } - } - } - - async receiveMessage(message: Promise): Promise { - /* A configured size of -1 means that there is no limit, so skip the check - * entirely */ - if (this.maxReceiveMessageSize === -1) { - return message; - } else { - const concreteMessage = await message; - if (concreteMessage.length > this.maxReceiveMessageSize) { - this.callStream.cancelWithStatus( - Status.RESOURCE_EXHAUSTED, - `Received message larger than max (${concreteMessage.length} vs. ${this.maxReceiveMessageSize})` - ); - return Promise.reject('Message too large'); - } else { - return concreteMessage; - } - } - } -} - -export class MaxMessageSizeFilterFactory - implements FilterFactory { - constructor(private readonly options: ChannelOptions) {} - - createFilter(callStream: Call): MaxMessageSizeFilter { - return new MaxMessageSizeFilter(this.options, callStream); - } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/metadata.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/metadata.ts deleted file mode 100644 index 376cb491..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/metadata.ts +++ /dev/null @@ -1,299 +0,0 @@ -/* - * Copyright 2019 gRPC authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -import * as http2 from 'http2'; -import { log } from './logging'; -import { LogVerbosity } from './constants'; -const LEGAL_KEY_REGEX = /^[0-9a-z_.-]+$/; -const LEGAL_NON_BINARY_VALUE_REGEX = /^[ -~]*$/; - -export type MetadataValue = string | Buffer; -export type MetadataObject = Map; - -function isLegalKey(key: string): boolean { - return LEGAL_KEY_REGEX.test(key); -} - -function isLegalNonBinaryValue(value: string): boolean { - return LEGAL_NON_BINARY_VALUE_REGEX.test(value); -} - -function isBinaryKey(key: string): boolean { - return key.endsWith('-bin'); -} - -function isCustomMetadata(key: string): boolean { - return !key.startsWith('grpc-'); -} - -function normalizeKey(key: string): string { - return key.toLowerCase(); -} - -function validate(key: string, value?: MetadataValue): void { - if (!isLegalKey(key)) { - throw new Error('Metadata key "' + key + '" contains illegal characters'); - } - - if (value !== null && value !== undefined) { - if (isBinaryKey(key)) { - if (!Buffer.isBuffer(value)) { - throw new Error("keys that end with '-bin' must have Buffer values"); - } - } else { - if (Buffer.isBuffer(value)) { - throw new Error( - "keys that don't end with '-bin' must have String values" - ); - } - if (!isLegalNonBinaryValue(value)) { - throw new Error( - 'Metadata string value "' + value + '" contains illegal characters' - ); - } - } - } -} - -export interface MetadataOptions { - /* Signal that the request is idempotent. Defaults to false */ - idempotentRequest?: boolean; - /* Signal that the call should not return UNAVAILABLE before it has - * started. Defaults to false. */ - waitForReady?: boolean; - /* Signal that the call is cacheable. GRPC is free to use GET verb. - * Defaults to false */ - cacheableRequest?: boolean; - /* Signal that the initial metadata should be corked. Defaults to false. */ - corked?: boolean; -} - -/** - * A class for storing metadata. Keys are normalized to lowercase ASCII. - */ -export class Metadata { - protected internalRepr: MetadataObject = new Map(); - private options: MetadataOptions; - - constructor(options: MetadataOptions = {}) { - this.options = options; - } - - /** - * Sets the given value for the given key by replacing any other values - * associated with that key. Normalizes the key. - * @param key The key to whose value should be set. - * @param value The value to set. Must be a buffer if and only - * if the normalized key ends with '-bin'. - */ - set(key: string, value: MetadataValue): void { - key = normalizeKey(key); - validate(key, value); - this.internalRepr.set(key, [value]); - } - - /** - * Adds the given value for the given key by appending to a list of previous - * values associated with that key. Normalizes the key. - * @param key The key for which a new value should be appended. - * @param value The value to add. Must be a buffer if and only - * if the normalized key ends with '-bin'. - */ - add(key: string, value: MetadataValue): void { - key = normalizeKey(key); - validate(key, value); - - const existingValue: MetadataValue[] | undefined = this.internalRepr.get(key); - - if (existingValue === undefined) { - this.internalRepr.set(key, [value]); - } else { - existingValue.push(value); - } - } - - /** - * Removes the given key and any associated values. Normalizes the key. - * @param key The key whose values should be removed. - */ - remove(key: string): void { - key = normalizeKey(key); - // validate(key); - this.internalRepr.delete(key); - } - - /** - * Gets a list of all values associated with the key. Normalizes the key. - * @param key The key whose value should be retrieved. - * @return A list of values associated with the given key. - */ - get(key: string): MetadataValue[] { - key = normalizeKey(key); - // validate(key); - return this.internalRepr.get(key) || []; - } - - /** - * Gets a plain object mapping each key to the first value associated with it. - * This reflects the most common way that people will want to see metadata. - * @return A key/value mapping of the metadata. - */ - getMap(): { [key: string]: MetadataValue } { - const result: { [key: string]: MetadataValue } = {}; - - for (const [key, values] of this.internalRepr) { - if (values.length > 0) { - const v = values[0]; - result[key] = Buffer.isBuffer(v) ? Buffer.from(v) : v; - } - } - return result; - } - - /** - * Clones the metadata object. - * @return The newly cloned object. - */ - clone(): Metadata { - const newMetadata = new Metadata(this.options); - const newInternalRepr = newMetadata.internalRepr; - - for (const [key, value] of this.internalRepr) { - const clonedValue: MetadataValue[] = value.map((v) => { - if (Buffer.isBuffer(v)) { - return Buffer.from(v); - } else { - return v; - } - }); - - newInternalRepr.set(key, clonedValue); - } - - return newMetadata; - } - - /** - * Merges all key-value pairs from a given Metadata object into this one. - * If both this object and the given object have values in the same key, - * values from the other Metadata object will be appended to this object's - * values. - * @param other A Metadata object. - */ - merge(other: Metadata): void { - for (const [key, values] of other.internalRepr) { - const mergedValue: MetadataValue[] = ( - this.internalRepr.get(key) || [] - ).concat(values); - - this.internalRepr.set(key, mergedValue); - } - } - - setOptions(options: MetadataOptions) { - this.options = options; - } - - getOptions(): MetadataOptions { - return this.options; - } - - /** - * Creates an OutgoingHttpHeaders object that can be used with the http2 API. - */ - toHttp2Headers(): http2.OutgoingHttpHeaders { - // NOTE: Node <8.9 formats http2 headers incorrectly. - const result: http2.OutgoingHttpHeaders = {}; - - for (const [key, values] of this.internalRepr) { - // We assume that the user's interaction with this object is limited to - // through its public API (i.e. keys and values are already validated). - result[key] = values.map(bufToString); - } - - return result; - } - - // For compatibility with the other Metadata implementation - private _getCoreRepresentation() { - return this.internalRepr; - } - - /** - * This modifies the behavior of JSON.stringify to show an object - * representation of the metadata map. - */ - toJSON() { - const result: { [key: string]: MetadataValue[] } = {}; - for (const [key, values] of this.internalRepr) { - result[key] = values; - } - return result; - } - - /** - * Returns a new Metadata object based fields in a given IncomingHttpHeaders - * object. - * @param headers An IncomingHttpHeaders object. - */ - static fromHttp2Headers(headers: http2.IncomingHttpHeaders): Metadata { - const result = new Metadata(); - for (const key of Object.keys(headers)) { - // Reserved headers (beginning with `:`) are not valid keys. - if (key.charAt(0) === ':') { - continue; - } - - const values = headers[key]; - - try { - if (isBinaryKey(key)) { - if (Array.isArray(values)) { - values.forEach((value) => { - result.add(key, Buffer.from(value, 'base64')); - }); - } else if (values !== undefined) { - if (isCustomMetadata(key)) { - values.split(',').forEach((v) => { - result.add(key, Buffer.from(v.trim(), 'base64')); - }); - } else { - result.add(key, Buffer.from(values, 'base64')); - } - } - } else { - if (Array.isArray(values)) { - values.forEach((value) => { - result.add(key, value); - }); - } else if (values !== undefined) { - result.add(key, values); - } - } - } catch (error) { - const message = `Failed to add metadata entry ${key}: ${values}. ${error.message}. For more information see https://github.com/grpc/grpc-node/issues/1173`; - log(LogVerbosity.ERROR, message); - } - } - - return result; - } -} - -const bufToString = (val: string | Buffer): string => { - return Buffer.isBuffer(val) ? val.toString('base64') : val -}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/object-stream.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/object-stream.ts deleted file mode 100644 index 22ab8a41..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/object-stream.ts +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright 2019 gRPC authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -import { Duplex, Readable, Writable } from 'stream'; -import { EmitterAugmentation1 } from './events'; - -/* eslint-disable @typescript-eslint/no-explicit-any */ - -export type WriteCallback = (error: Error | null | undefined) => void; - -export interface IntermediateObjectReadable extends Readable { - read(size?: number): any & T; -} - -export type ObjectReadable = { - read(size?: number): T; -} & EmitterAugmentation1<'data', T> & - IntermediateObjectReadable; - -export interface IntermediateObjectWritable extends Writable { - _write(chunk: any & T, encoding: string, callback: Function): void; - write(chunk: any & T, cb?: WriteCallback): boolean; - write(chunk: any & T, encoding?: any, cb?: WriteCallback): boolean; - setDefaultEncoding(encoding: string): this; - end(): ReturnType extends Writable ? this : void; - end(chunk: any & T, cb?: Function): ReturnType extends Writable ? this : void; - end(chunk: any & T, encoding?: any, cb?: Function): ReturnType extends Writable ? this : void; -} - -export interface ObjectWritable extends IntermediateObjectWritable { - _write(chunk: T, encoding: string, callback: Function): void; - write(chunk: T, cb?: Function): boolean; - write(chunk: T, encoding?: any, cb?: Function): boolean; - setDefaultEncoding(encoding: string): this; - end(): ReturnType extends Writable ? this : void; - end(chunk: T, cb?: Function): ReturnType extends Writable ? this : void; - end(chunk: T, encoding?: any, cb?: Function): ReturnType extends Writable ? this : void; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/picker.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/picker.ts deleted file mode 100644 index f366a691..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/picker.ts +++ /dev/null @@ -1,156 +0,0 @@ -/* - * Copyright 2019 gRPC authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -import { Subchannel } from './subchannel'; -import { StatusObject } from './call-stream'; -import { Metadata } from './metadata'; -import { Status } from './constants'; -import { LoadBalancer } from './load-balancer'; -import { FilterFactory, Filter } from './filter'; -import { SubchannelInterface } from './subchannel-interface'; - -export enum PickResultType { - COMPLETE, - QUEUE, - TRANSIENT_FAILURE, - DROP, -} - -export interface PickResult { - pickResultType: PickResultType; - /** - * The subchannel to use as the transport for the call. Only meaningful if - * `pickResultType` is COMPLETE. If null, indicates that the call should be - * dropped. - */ - subchannel: SubchannelInterface | null; - /** - * The status object to end the call with. Populated if and only if - * `pickResultType` is TRANSIENT_FAILURE. - */ - status: StatusObject | null; - /** - * Extra FilterFactory (can be multiple encapsulated in a FilterStackFactory) - * provided by the load balancer to be used with the call. For technical - * reasons filters from this factory will not see sendMetadata events. - */ - extraFilterFactories: FilterFactory[]; - onCallStarted: (() => void) | null; -} - -export interface CompletePickResult extends PickResult { - pickResultType: PickResultType.COMPLETE; - subchannel: SubchannelInterface | null; - status: null; - extraFilterFactories: FilterFactory[]; - onCallStarted: (() => void) | null; -} - -export interface QueuePickResult extends PickResult { - pickResultType: PickResultType.QUEUE; - subchannel: null; - status: null; - extraFilterFactories: []; - onCallStarted: null; -} - -export interface TransientFailurePickResult extends PickResult { - pickResultType: PickResultType.TRANSIENT_FAILURE; - subchannel: null; - status: StatusObject; - extraFilterFactories: []; - onCallStarted: null; -} - -export interface DropCallPickResult extends PickResult { - pickResultType: PickResultType.DROP; - subchannel: null; - status: StatusObject; - extraFilterFactories: []; - onCallStarted: null; -} - -export interface PickArgs { - metadata: Metadata; - extraPickInfo: { [key: string]: string }; -} - -/** - * A proxy object representing the momentary state of a load balancer. Picks - * subchannels or returns other information based on that state. Should be - * replaced every time the load balancer changes state. - */ -export interface Picker { - pick(pickArgs: PickArgs): PickResult; -} - -/** - * A standard picker representing a load balancer in the TRANSIENT_FAILURE - * state. Always responds to every pick request with an UNAVAILABLE status. - */ -export class UnavailablePicker implements Picker { - private status: StatusObject; - constructor(status?: StatusObject) { - if (status !== undefined) { - this.status = status; - } else { - this.status = { - code: Status.UNAVAILABLE, - details: 'No connection established', - metadata: new Metadata(), - }; - } - } - pick(pickArgs: PickArgs): TransientFailurePickResult { - return { - pickResultType: PickResultType.TRANSIENT_FAILURE, - subchannel: null, - status: this.status, - extraFilterFactories: [], - onCallStarted: null, - }; - } -} - -/** - * A standard picker representing a load balancer in the IDLE or CONNECTING - * state. Always responds to every pick request with a QUEUE pick result - * indicating that the pick should be tried again with the next `Picker`. Also - * reports back to the load balancer that a connection should be established - * once any pick is attempted. - */ -export class QueuePicker { - private calledExitIdle = false; - // Constructed with a load balancer. Calls exitIdle on it the first time pick is called - constructor(private loadBalancer: LoadBalancer) {} - - pick(pickArgs: PickArgs): QueuePickResult { - if (!this.calledExitIdle) { - process.nextTick(() => { - this.loadBalancer.exitIdle(); - }); - this.calledExitIdle = true; - } - return { - pickResultType: PickResultType.QUEUE, - subchannel: null, - status: null, - extraFilterFactories: [], - onCallStarted: null, - }; - } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/resolver-dns.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/resolver-dns.ts deleted file mode 100644 index 14de2656..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/resolver-dns.ts +++ /dev/null @@ -1,373 +0,0 @@ -/* - * Copyright 2019 gRPC authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { - Resolver, - ResolverListener, - registerResolver, - registerDefaultScheme, -} from './resolver'; -import * as dns from 'dns'; -import * as util from 'util'; -import { extractAndSelectServiceConfig, ServiceConfig } from './service-config'; -import { Status } from './constants'; -import { StatusObject } from './call-stream'; -import { Metadata } from './metadata'; -import * as logging from './logging'; -import { LogVerbosity } from './constants'; -import { SubchannelAddress, TcpSubchannelAddress } from './subchannel-address'; -import { GrpcUri, uriToString, splitHostPort } from './uri-parser'; -import { isIPv6, isIPv4 } from 'net'; -import { ChannelOptions } from './channel-options'; -import { BackoffOptions, BackoffTimeout } from './backoff-timeout'; - -const TRACER_NAME = 'dns_resolver'; - -function trace(text: string): void { - logging.trace(LogVerbosity.DEBUG, TRACER_NAME, text); -} - -/** - * The default TCP port to connect to if not explicitly specified in the target. - */ -const DEFAULT_PORT = 443; - -const DEFAULT_MIN_TIME_BETWEEN_RESOLUTIONS_MS = 30_000; - -const resolveTxtPromise = util.promisify(dns.resolveTxt); -const dnsLookupPromise = util.promisify(dns.lookup); - -/** - * Merge any number of arrays into a single alternating array - * @param arrays - */ -function mergeArrays(...arrays: T[][]): T[] { - const result: T[] = []; - for ( - let i = 0; - i < - Math.max.apply( - null, - arrays.map((array) => array.length) - ); - i++ - ) { - for (const array of arrays) { - if (i < array.length) { - result.push(array[i]); - } - } - } - return result; -} - -/** - * Resolver implementation that handles DNS names and IP addresses. - */ -class DnsResolver implements Resolver { - private readonly ipResult: SubchannelAddress[] | null; - private readonly dnsHostname: string | null; - private readonly port: number | null; - /** - * Minimum time between resolutions, measured as the time between starting - * successive resolution requests. Only applies to successful resolutions. - * Failures are handled by the backoff timer. - */ - private readonly minTimeBetweenResolutionsMs: number; - private pendingLookupPromise: Promise | null = null; - private pendingTxtPromise: Promise | null = null; - private latestLookupResult: TcpSubchannelAddress[] | null = null; - private latestServiceConfig: ServiceConfig | null = null; - private latestServiceConfigError: StatusObject | null = null; - private percentage: number; - private defaultResolutionError: StatusObject; - private backoff: BackoffTimeout; - private continueResolving = false; - private nextResolutionTimer: NodeJS.Timer; - private isNextResolutionTimerRunning = false; - constructor( - private target: GrpcUri, - private listener: ResolverListener, - channelOptions: ChannelOptions - ) { - trace('Resolver constructed for target ' + uriToString(target)); - const hostPort = splitHostPort(target.path); - if (hostPort === null) { - this.ipResult = null; - this.dnsHostname = null; - this.port = null; - } else { - if (isIPv4(hostPort.host) || isIPv6(hostPort.host)) { - this.ipResult = [ - { - host: hostPort.host, - port: hostPort.port ?? DEFAULT_PORT, - }, - ]; - this.dnsHostname = null; - this.port = null; - } else { - this.ipResult = null; - this.dnsHostname = hostPort.host; - this.port = hostPort.port ?? DEFAULT_PORT; - } - } - this.percentage = Math.random() * 100; - - this.defaultResolutionError = { - code: Status.UNAVAILABLE, - details: `Name resolution failed for target ${uriToString(this.target)}`, - metadata: new Metadata(), - }; - - const backoffOptions: BackoffOptions = { - initialDelay: channelOptions['grpc.initial_reconnect_backoff_ms'], - maxDelay: channelOptions['grpc.max_reconnect_backoff_ms'], - }; - - this.backoff = new BackoffTimeout(() => { - if (this.continueResolving) { - this.startResolutionWithBackoff(); - } - }, backoffOptions); - this.backoff.unref(); - - this.minTimeBetweenResolutionsMs = channelOptions['grpc.dns_min_time_between_resolutions_ms'] ?? DEFAULT_MIN_TIME_BETWEEN_RESOLUTIONS_MS; - this.nextResolutionTimer = setTimeout(() => {}, 0); - clearTimeout(this.nextResolutionTimer); - } - - /** - * If the target is an IP address, just provide that address as a result. - * Otherwise, initiate A, AAAA, and TXT lookups - */ - private startResolution() { - if (this.ipResult !== null) { - trace('Returning IP address for target ' + uriToString(this.target)); - setImmediate(() => { - this.listener.onSuccessfulResolution( - this.ipResult!, - null, - null, - null, - {} - ); - }); - this.backoff.stop(); - this.backoff.reset(); - return; - } - if (this.dnsHostname === null) { - trace('Failed to parse DNS address ' + uriToString(this.target)); - setImmediate(() => { - this.listener.onError({ - code: Status.UNAVAILABLE, - details: `Failed to parse DNS address ${uriToString(this.target)}`, - metadata: new Metadata(), - }); - }); - this.stopNextResolutionTimer(); - } else { - if (this.pendingLookupPromise !== null) { - return; - } - trace('Looking up DNS hostname ' + this.dnsHostname); - /* We clear out latestLookupResult here to ensure that it contains the - * latest result since the last time we started resolving. That way, the - * TXT resolution handler can use it, but only if it finishes second. We - * don't clear out any previous service config results because it's - * better to use a service config that's slightly out of date than to - * revert to an effectively blank one. */ - this.latestLookupResult = null; - const hostname: string = this.dnsHostname; - /* We lookup both address families here and then split them up later - * because when looking up a single family, dns.lookup outputs an error - * if the name exists but there are no records for that family, and that - * error is indistinguishable from other kinds of errors */ - this.pendingLookupPromise = dnsLookupPromise(hostname, { all: true }); - this.pendingLookupPromise.then( - (addressList) => { - this.pendingLookupPromise = null; - this.backoff.reset(); - this.backoff.stop(); - const ip4Addresses: dns.LookupAddress[] = addressList.filter( - (addr) => addr.family === 4 - ); - const ip6Addresses: dns.LookupAddress[] = addressList.filter( - (addr) => addr.family === 6 - ); - this.latestLookupResult = mergeArrays( - ip6Addresses, - ip4Addresses - ).map((addr) => ({ host: addr.address, port: +this.port! })); - const allAddressesString: string = - '[' + - this.latestLookupResult - .map((addr) => addr.host + ':' + addr.port) - .join(',') + - ']'; - trace( - 'Resolved addresses for target ' + - uriToString(this.target) + - ': ' + - allAddressesString - ); - if (this.latestLookupResult.length === 0) { - this.listener.onError(this.defaultResolutionError); - return; - } - /* If the TXT lookup has not yet finished, both of the last two - * arguments will be null, which is the equivalent of getting an - * empty TXT response. When the TXT lookup does finish, its handler - * can update the service config by using the same address list */ - this.listener.onSuccessfulResolution( - this.latestLookupResult, - this.latestServiceConfig, - this.latestServiceConfigError, - null, - {} - ); - }, - (err) => { - trace( - 'Resolution error for target ' + - uriToString(this.target) + - ': ' + - (err as Error).message - ); - this.pendingLookupPromise = null; - this.stopNextResolutionTimer(); - this.listener.onError(this.defaultResolutionError); - } - ); - /* If there already is a still-pending TXT resolution, we can just use - * that result when it comes in */ - if (this.pendingTxtPromise === null) { - /* We handle the TXT query promise differently than the others because - * the name resolution attempt as a whole is a success even if the TXT - * lookup fails */ - this.pendingTxtPromise = resolveTxtPromise(hostname); - this.pendingTxtPromise.then( - (txtRecord) => { - this.pendingTxtPromise = null; - try { - this.latestServiceConfig = extractAndSelectServiceConfig( - txtRecord, - this.percentage - ); - } catch (err) { - this.latestServiceConfigError = { - code: Status.UNAVAILABLE, - details: 'Parsing service config failed', - metadata: new Metadata(), - }; - } - if (this.latestLookupResult !== null) { - /* We rely here on the assumption that calling this function with - * identical parameters will be essentialy idempotent, and calling - * it with the same address list and a different service config - * should result in a fast and seamless switchover. */ - this.listener.onSuccessfulResolution( - this.latestLookupResult, - this.latestServiceConfig, - this.latestServiceConfigError, - null, - {} - ); - } - }, - (err) => { - /* If TXT lookup fails we should do nothing, which means that we - * continue to use the result of the most recent successful lookup, - * or the default null config object if there has never been a - * successful lookup. We do not set the latestServiceConfigError - * here because that is specifically used for response validation - * errors. We still need to handle this error so that it does not - * bubble up as an unhandled promise rejection. */ - } - ); - } - } - } - - private startNextResolutionTimer() { - clearTimeout(this.nextResolutionTimer); - this.nextResolutionTimer = setTimeout(() => { - this.stopNextResolutionTimer(); - if (this.continueResolving) { - this.startResolutionWithBackoff(); - } - }, this.minTimeBetweenResolutionsMs).unref?.(); - this.isNextResolutionTimerRunning = true; - } - - private stopNextResolutionTimer() { - clearTimeout(this.nextResolutionTimer); - this.isNextResolutionTimerRunning = false; - } - - private startResolutionWithBackoff() { - if (this.pendingLookupPromise === null) { - this.continueResolving = false; - this.startResolution(); - this.backoff.runOnce(); - this.startNextResolutionTimer(); - } - } - - updateResolution() { - /* If there is a pending lookup, just let it finish. Otherwise, if the - * nextResolutionTimer or backoff timer is running, set the - * continueResolving flag to resolve when whichever of those timers - * fires. Otherwise, start resolving immediately. */ - if (this.pendingLookupPromise === null) { - if (this.isNextResolutionTimerRunning || this.backoff.isRunning()) { - this.continueResolving = true; - } else { - this.startResolutionWithBackoff(); - } - } - } - - destroy() { - this.continueResolving = false; - this.backoff.stop(); - this.stopNextResolutionTimer(); - } - - /** - * Get the default authority for the given target. For IP targets, that is - * the IP address. For DNS targets, it is the hostname. - * @param target - */ - static getDefaultAuthority(target: GrpcUri): string { - return target.path; - } -} - -/** - * Set up the DNS resolver class by registering it as the handler for the - * "dns:" prefix and as the default resolver. - */ -export function setup(): void { - registerResolver('dns', DnsResolver); - registerDefaultScheme('dns'); -} - -export interface DnsUrl { - host: string; - port?: string; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/resolver-ip.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/resolver-ip.ts deleted file mode 100644 index 24efc3fd..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/resolver-ip.ts +++ /dev/null @@ -1,116 +0,0 @@ -/* - * Copyright 2021 gRPC authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { isIPv4, isIPv6 } from 'net'; -import { StatusObject } from './call-stream'; -import { ChannelOptions } from './channel-options'; -import { LogVerbosity, Status } from './constants'; -import { Metadata } from './metadata'; -import { registerResolver, Resolver, ResolverListener } from './resolver'; -import { SubchannelAddress } from './subchannel-address'; -import { GrpcUri, splitHostPort, uriToString } from './uri-parser'; -import * as logging from './logging'; - -const TRACER_NAME = 'ip_resolver'; - -function trace(text: string): void { - logging.trace(LogVerbosity.DEBUG, TRACER_NAME, text); -} - -const IPV4_SCHEME = 'ipv4'; -const IPV6_SCHEME = 'ipv6'; - -/** - * The default TCP port to connect to if not explicitly specified in the target. - */ -const DEFAULT_PORT = 443; - -class IpResolver implements Resolver { - private addresses: SubchannelAddress[] = []; - private error: StatusObject | null = null; - constructor( - private target: GrpcUri, - private listener: ResolverListener, - channelOptions: ChannelOptions - ) { - trace('Resolver constructed for target ' + uriToString(target)); - const addresses: SubchannelAddress[] = []; - if (!(target.scheme === IPV4_SCHEME || target.scheme === IPV6_SCHEME)) { - this.error = { - code: Status.UNAVAILABLE, - details: `Unrecognized scheme ${target.scheme} in IP resolver`, - metadata: new Metadata(), - }; - return; - } - const pathList = target.path.split(','); - for (const path of pathList) { - const hostPort = splitHostPort(path); - if (hostPort === null) { - this.error = { - code: Status.UNAVAILABLE, - details: `Failed to parse ${target.scheme} address ${path}`, - metadata: new Metadata(), - }; - return; - } - if ( - (target.scheme === IPV4_SCHEME && !isIPv4(hostPort.host)) || - (target.scheme === IPV6_SCHEME && !isIPv6(hostPort.host)) - ) { - this.error = { - code: Status.UNAVAILABLE, - details: `Failed to parse ${target.scheme} address ${path}`, - metadata: new Metadata(), - }; - return; - } - addresses.push({ - host: hostPort.host, - port: hostPort.port ?? DEFAULT_PORT, - }); - } - this.addresses = addresses; - trace('Parsed ' + target.scheme + ' address list ' + this.addresses); - } - updateResolution(): void { - process.nextTick(() => { - if (this.error) { - this.listener.onError(this.error); - } else { - this.listener.onSuccessfulResolution( - this.addresses, - null, - null, - null, - {} - ); - } - }); - } - destroy(): void { - // This resolver owns no resources, so we do nothing here. - } - - static getDefaultAuthority(target: GrpcUri): string { - return target.path.split(',')[0]; - } -} - -export function setup() { - registerResolver(IPV4_SCHEME, IpResolver); - registerResolver(IPV6_SCHEME, IpResolver); -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/resolver-uds.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/resolver-uds.ts deleted file mode 100644 index 24095ec2..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/resolver-uds.ts +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright 2019 gRPC authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { Resolver, ResolverListener, registerResolver } from './resolver'; -import { SubchannelAddress } from './subchannel-address'; -import { GrpcUri } from './uri-parser'; -import { ChannelOptions } from './channel-options'; - -class UdsResolver implements Resolver { - private addresses: SubchannelAddress[] = []; - constructor( - target: GrpcUri, - private listener: ResolverListener, - channelOptions: ChannelOptions - ) { - let path: string; - if (target.authority === '') { - path = '/' + target.path; - } else { - path = target.path; - } - this.addresses = [{ path }]; - } - updateResolution(): void { - process.nextTick( - this.listener.onSuccessfulResolution, - this.addresses, - null, - null, - null, - {} - ); - } - - destroy() { - // This resolver owns no resources, so we do nothing here. - } - - static getDefaultAuthority(target: GrpcUri): string { - return 'localhost'; - } -} - -export function setup() { - registerResolver('unix', UdsResolver); -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/resolver.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/resolver.ts deleted file mode 100644 index fcbc6894..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/resolver.ts +++ /dev/null @@ -1,177 +0,0 @@ -/* - * Copyright 2019 gRPC authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -import { MethodConfig, ServiceConfig } from './service-config'; -import { StatusObject } from './call-stream'; -import { SubchannelAddress } from './subchannel-address'; -import { GrpcUri, uriToString } from './uri-parser'; -import { ChannelOptions } from './channel-options'; -import { Metadata } from './metadata'; -import { Status } from './constants'; -import { Filter, FilterFactory } from './filter'; - -export interface CallConfig { - methodConfig: MethodConfig; - onCommitted?: () => void; - pickInformation: { [key: string]: string }; - status: Status; - dynamicFilterFactories: FilterFactory[]; -} - -/** - * Selects a configuration for a method given the name and metadata. Defined in - * https://github.com/grpc/proposal/blob/master/A31-xds-timeout-support-and-config-selector.md#new-functionality-in-grpc - */ -export interface ConfigSelector { - (methodName: string, metadata: Metadata): CallConfig; -} - -/** - * A listener object passed to the resolver's constructor that provides name - * resolution updates back to the resolver's owner. - */ -export interface ResolverListener { - /** - * Called whenever the resolver has new name resolution results to report - * @param addressList The new list of backend addresses - * @param serviceConfig The new service configuration corresponding to the - * `addressList`. Will be `null` if no service configuration was - * retrieved or if the service configuration was invalid - * @param serviceConfigError If non-`null`, indicates that the retrieved - * service configuration was invalid - */ - onSuccessfulResolution( - addressList: SubchannelAddress[], - serviceConfig: ServiceConfig | null, - serviceConfigError: StatusObject | null, - configSelector: ConfigSelector | null, - attributes: { [key: string]: unknown } - ): void; - /** - * Called whenever a name resolution attempt fails. - * @param error Describes how resolution failed - */ - onError(error: StatusObject): void; -} - -/** - * A resolver class that handles one or more of the name syntax schemes defined - * in the [gRPC Name Resolution document](https://github.com/grpc/grpc/blob/master/doc/naming.md) - */ -export interface Resolver { - /** - * Indicates that the caller wants new name resolution data. Calling this - * function may eventually result in calling one of the `ResolverListener` - * functions, but that is not guaranteed. Those functions will never be - * called synchronously with the constructor or updateResolution. - */ - updateResolution(): void; - - /** - * Destroy the resolver. Should be called when the owning channel shuts down. - */ - destroy(): void; -} - -export interface ResolverConstructor { - new ( - target: GrpcUri, - listener: ResolverListener, - channelOptions: ChannelOptions - ): Resolver; - /** - * Get the default authority for a target. This loosely corresponds to that - * target's hostname. Throws an error if this resolver class cannot parse the - * `target`. - * @param target - */ - getDefaultAuthority(target: GrpcUri): string; -} - -const registeredResolvers: { [scheme: string]: ResolverConstructor } = {}; -let defaultScheme: string | null = null; - -/** - * Register a resolver class to handle target names prefixed with the `prefix` - * string. This prefix should correspond to a URI scheme name listed in the - * [gRPC Name Resolution document](https://github.com/grpc/grpc/blob/master/doc/naming.md) - * @param prefix - * @param resolverClass - */ -export function registerResolver( - scheme: string, - resolverClass: ResolverConstructor -) { - registeredResolvers[scheme] = resolverClass; -} - -/** - * Register a default resolver to handle target names that do not start with - * any registered prefix. - * @param resolverClass - */ -export function registerDefaultScheme(scheme: string) { - defaultScheme = scheme; -} - -/** - * Create a name resolver for the specified target, if possible. Throws an - * error if no such name resolver can be created. - * @param target - * @param listener - */ -export function createResolver( - target: GrpcUri, - listener: ResolverListener, - options: ChannelOptions -): Resolver { - if (target.scheme !== undefined && target.scheme in registeredResolvers) { - return new registeredResolvers[target.scheme](target, listener, options); - } else { - throw new Error( - `No resolver could be created for target ${uriToString(target)}` - ); - } -} - -/** - * Get the default authority for the specified target, if possible. Throws an - * error if no registered name resolver can parse that target string. - * @param target - */ -export function getDefaultAuthority(target: GrpcUri): string { - if (target.scheme !== undefined && target.scheme in registeredResolvers) { - return registeredResolvers[target.scheme].getDefaultAuthority(target); - } else { - throw new Error(`Invalid target ${uriToString(target)}`); - } -} - -export function mapUriDefaultScheme(target: GrpcUri): GrpcUri | null { - if (target.scheme === undefined || !(target.scheme in registeredResolvers)) { - if (defaultScheme !== null) { - return { - scheme: defaultScheme, - authority: undefined, - path: uriToString(target), - }; - } else { - return null; - } - } - return target; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/resolving-load-balancer.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/resolving-load-balancer.ts deleted file mode 100644 index 985b6e31..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/resolving-load-balancer.ts +++ /dev/null @@ -1,332 +0,0 @@ -/* - * Copyright 2019 gRPC authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -import { - ChannelControlHelper, - LoadBalancer, - LoadBalancingConfig, - getFirstUsableConfig, -} from './load-balancer'; -import { ServiceConfig, validateServiceConfig } from './service-config'; -import { ConnectivityState } from './connectivity-state'; -import { ConfigSelector, createResolver, Resolver } from './resolver'; -import { ServiceError } from './call'; -import { Picker, UnavailablePicker, QueuePicker } from './picker'; -import { BackoffOptions, BackoffTimeout } from './backoff-timeout'; -import { Status } from './constants'; -import { StatusObject } from './call-stream'; -import { Metadata } from './metadata'; -import * as logging from './logging'; -import { LogVerbosity } from './constants'; -import { SubchannelAddress } from './subchannel-address'; -import { GrpcUri, uriToString } from './uri-parser'; -import { ChildLoadBalancerHandler } from './load-balancer-child-handler'; -import { ChannelOptions } from './channel-options'; -import { PickFirstLoadBalancingConfig } from './load-balancer-pick-first'; - -const TRACER_NAME = 'resolving_load_balancer'; - -function trace(text: string): void { - logging.trace(LogVerbosity.DEBUG, TRACER_NAME, text); -} - -const DEFAULT_LOAD_BALANCER_NAME = 'pick_first'; - -function getDefaultConfigSelector( - serviceConfig: ServiceConfig | null -): ConfigSelector { - return function defaultConfigSelector( - methodName: string, - metadata: Metadata - ) { - const splitName = methodName.split('/').filter((x) => x.length > 0); - const service = splitName[0] ?? ''; - const method = splitName[1] ?? ''; - if (serviceConfig && serviceConfig.methodConfig) { - for (const methodConfig of serviceConfig.methodConfig) { - for (const name of methodConfig.name) { - if ( - name.service === service && - (name.method === undefined || name.method === method) - ) { - return { - methodConfig: methodConfig, - pickInformation: {}, - status: Status.OK, - dynamicFilterFactories: [] - }; - } - } - } - } - return { - methodConfig: { name: [] }, - pickInformation: {}, - status: Status.OK, - dynamicFilterFactories: [] - }; - }; -} - -export interface ResolutionCallback { - (configSelector: ConfigSelector): void; -} - -export interface ResolutionFailureCallback { - (status: StatusObject): void; -} - -export class ResolvingLoadBalancer implements LoadBalancer { - /** - * The resolver class constructed for the target address. - */ - private innerResolver: Resolver; - - private childLoadBalancer: ChildLoadBalancerHandler; - private latestChildState: ConnectivityState = ConnectivityState.IDLE; - private latestChildPicker: Picker = new QueuePicker(this); - /** - * This resolving load balancer's current connectivity state. - */ - private currentState: ConnectivityState = ConnectivityState.IDLE; - private readonly defaultServiceConfig: ServiceConfig; - /** - * The service config object from the last successful resolution, if - * available. A value of null indicates that we have not yet received a valid - * service config from the resolver. - */ - private previousServiceConfig: ServiceConfig | null = null; - - /** - * The backoff timer for handling name resolution failures. - */ - private readonly backoffTimeout: BackoffTimeout; - - /** - * Indicates whether we should attempt to resolve again after the backoff - * timer runs out. - */ - private continueResolving = false; - - /** - * Wrapper class that behaves like a `LoadBalancer` and also handles name - * resolution internally. - * @param target The address of the backend to connect to. - * @param channelControlHelper `ChannelControlHelper` instance provided by - * this load balancer's owner. - * @param defaultServiceConfig The default service configuration to be used - * if none is provided by the name resolver. A `null` value indicates - * that the default behavior should be the default unconfigured behavior. - * In practice, that means using the "pick first" load balancer - * implmentation - */ - constructor( - private readonly target: GrpcUri, - private readonly channelControlHelper: ChannelControlHelper, - private readonly channelOptions: ChannelOptions, - private readonly onSuccessfulResolution: ResolutionCallback, - private readonly onFailedResolution: ResolutionFailureCallback - ) { - if (channelOptions['grpc.service_config']) { - this.defaultServiceConfig = validateServiceConfig( - JSON.parse(channelOptions['grpc.service_config']!) - ); - } else { - this.defaultServiceConfig = { - loadBalancingConfig: [], - methodConfig: [], - }; - } - this.updateState(ConnectivityState.IDLE, new QueuePicker(this)); - this.childLoadBalancer = new ChildLoadBalancerHandler({ - createSubchannel: channelControlHelper.createSubchannel.bind( - channelControlHelper - ), - requestReresolution: () => { - /* If the backoffTimeout is running, we're still backing off from - * making resolve requests, so we shouldn't make another one here. - * In that case, the backoff timer callback will call - * updateResolution */ - if (this.backoffTimeout.isRunning()) { - this.continueResolving = true; - } else { - this.updateResolution(); - } - }, - updateState: (newState: ConnectivityState, picker: Picker) => { - this.latestChildState = newState; - this.latestChildPicker = picker; - this.updateState(newState, picker); - }, - addChannelzChild: channelControlHelper.addChannelzChild.bind( - channelControlHelper - ), - removeChannelzChild: channelControlHelper.removeChannelzChild.bind( - channelControlHelper - ) - }); - this.innerResolver = createResolver( - target, - { - onSuccessfulResolution: ( - addressList: SubchannelAddress[], - serviceConfig: ServiceConfig | null, - serviceConfigError: ServiceError | null, - configSelector: ConfigSelector | null, - attributes: { [key: string]: unknown } - ) => { - let workingServiceConfig: ServiceConfig | null = null; - /* This first group of conditionals implements the algorithm described - * in https://github.com/grpc/proposal/blob/master/A21-service-config-error-handling.md - * in the section called "Behavior on receiving a new gRPC Config". - */ - if (serviceConfig === null) { - // Step 4 and 5 - if (serviceConfigError === null) { - // Step 5 - this.previousServiceConfig = null; - workingServiceConfig = this.defaultServiceConfig; - } else { - // Step 4 - if (this.previousServiceConfig === null) { - // Step 4.ii - this.handleResolutionFailure(serviceConfigError); - } else { - // Step 4.i - workingServiceConfig = this.previousServiceConfig; - } - } - } else { - // Step 3 - workingServiceConfig = serviceConfig; - this.previousServiceConfig = serviceConfig; - } - const workingConfigList = - workingServiceConfig?.loadBalancingConfig ?? []; - const loadBalancingConfig = getFirstUsableConfig( - workingConfigList, - true - ); - if (loadBalancingConfig === null) { - // There were load balancing configs but none are supported. This counts as a resolution failure - this.handleResolutionFailure({ - code: Status.UNAVAILABLE, - details: - 'All load balancer options in service config are not compatible', - metadata: new Metadata(), - }); - return; - } - this.childLoadBalancer.updateAddressList( - addressList, - loadBalancingConfig, - attributes - ); - const finalServiceConfig = - workingServiceConfig ?? this.defaultServiceConfig; - this.onSuccessfulResolution( - configSelector ?? getDefaultConfigSelector(finalServiceConfig) - ); - }, - onError: (error: StatusObject) => { - this.handleResolutionFailure(error); - }, - }, - channelOptions - ); - const backoffOptions: BackoffOptions = { - initialDelay: channelOptions['grpc.initial_reconnect_backoff_ms'], - maxDelay: channelOptions['grpc.max_reconnect_backoff_ms'], - }; - this.backoffTimeout = new BackoffTimeout(() => { - if (this.continueResolving) { - this.updateResolution(); - this.continueResolving = false; - } else { - this.updateState(this.latestChildState, this.latestChildPicker); - } - }, backoffOptions); - this.backoffTimeout.unref(); - } - - private updateResolution() { - this.innerResolver.updateResolution(); - if (this.currentState === ConnectivityState.IDLE) { - this.updateState(ConnectivityState.CONNECTING, new QueuePicker(this)); - } - this.backoffTimeout.runOnce(); - } - - private updateState(connectivityState: ConnectivityState, picker: Picker) { - trace( - uriToString(this.target) + - ' ' + - ConnectivityState[this.currentState] + - ' -> ' + - ConnectivityState[connectivityState] - ); - // Ensure that this.exitIdle() is called by the picker - if (connectivityState === ConnectivityState.IDLE) { - picker = new QueuePicker(this); - } - this.currentState = connectivityState; - this.channelControlHelper.updateState(connectivityState, picker); - } - - private handleResolutionFailure(error: StatusObject) { - if (this.latestChildState === ConnectivityState.IDLE) { - this.updateState( - ConnectivityState.TRANSIENT_FAILURE, - new UnavailablePicker(error) - ); - this.onFailedResolution(error); - } - } - - exitIdle() { - if (this.currentState === ConnectivityState.IDLE || this.currentState === ConnectivityState.TRANSIENT_FAILURE) { - if (this.backoffTimeout.isRunning()) { - this.continueResolving = true; - } else { - this.updateResolution(); - } - } - this.childLoadBalancer.exitIdle(); - } - - updateAddressList( - addressList: SubchannelAddress[], - lbConfig: LoadBalancingConfig | null - ): never { - throw new Error('updateAddressList not supported on ResolvingLoadBalancer'); - } - - resetBackoff() { - this.backoffTimeout.reset(); - this.childLoadBalancer.resetBackoff(); - } - - destroy() { - this.childLoadBalancer.destroy(); - this.innerResolver.destroy(); - this.updateState(ConnectivityState.SHUTDOWN, new UnavailablePicker()); - } - - getTypeName() { - return 'resolving_load_balancer'; - } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/server-call.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/server-call.ts deleted file mode 100644 index 6ddfe13b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/server-call.ts +++ /dev/null @@ -1,970 +0,0 @@ -/* - * Copyright 2019 gRPC authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -import { EventEmitter } from 'events'; -import * as http2 from 'http2'; -import { Duplex, Readable, Writable } from 'stream'; -import * as zlib from 'zlib'; -import { promisify } from 'util'; - -import { Deadline, StatusObject, PartialStatusObject } from './call-stream'; -import { - Status, - DEFAULT_MAX_SEND_MESSAGE_LENGTH, - DEFAULT_MAX_RECEIVE_MESSAGE_LENGTH, - LogVerbosity, -} from './constants'; -import { Deserialize, Serialize } from './make-client'; -import { Metadata } from './metadata'; -import { StreamDecoder } from './stream-decoder'; -import { ObjectReadable, ObjectWritable } from './object-stream'; -import { ChannelOptions } from './channel-options'; -import * as logging from './logging'; - -const TRACER_NAME = 'server_call'; -const unzip = promisify(zlib.unzip); -const inflate = promisify(zlib.inflate); - -function trace(text: string): void { - logging.trace(LogVerbosity.DEBUG, TRACER_NAME, text); -} - -interface DeadlineUnitIndexSignature { - [name: string]: number; -} - -const GRPC_ACCEPT_ENCODING_HEADER = 'grpc-accept-encoding'; -const GRPC_ENCODING_HEADER = 'grpc-encoding'; -const GRPC_MESSAGE_HEADER = 'grpc-message'; -const GRPC_STATUS_HEADER = 'grpc-status'; -const GRPC_TIMEOUT_HEADER = 'grpc-timeout'; -const DEADLINE_REGEX = /(\d{1,8})\s*([HMSmun])/; -const deadlineUnitsToMs: DeadlineUnitIndexSignature = { - H: 3600000, - M: 60000, - S: 1000, - m: 1, - u: 0.001, - n: 0.000001, -}; -const defaultResponseHeaders = { - // TODO(cjihrig): Remove these encoding headers from the default response - // once compression is integrated. - [GRPC_ACCEPT_ENCODING_HEADER]: 'identity,deflate,gzip', - [GRPC_ENCODING_HEADER]: 'identity', - [http2.constants.HTTP2_HEADER_STATUS]: http2.constants.HTTP_STATUS_OK, - [http2.constants.HTTP2_HEADER_CONTENT_TYPE]: 'application/grpc+proto', -}; -const defaultResponseOptions = { - waitForTrailers: true, -} as http2.ServerStreamResponseOptions; - -export type ServerStatusResponse = Partial; - -export type ServerErrorResponse = ServerStatusResponse & Error; - -export type ServerSurfaceCall = { - cancelled: boolean; - readonly metadata: Metadata; - getPeer(): string; - sendMetadata(responseMetadata: Metadata): void; - getDeadline(): Deadline; - getPath(): string; -} & EventEmitter; - -export type ServerUnaryCall = ServerSurfaceCall & { - request: RequestType; -}; -export type ServerReadableStream = - ServerSurfaceCall & ObjectReadable; -export type ServerWritableStream = - ServerSurfaceCall & - ObjectWritable & { - request: RequestType; - end: (metadata?: Metadata) => void; - }; -export type ServerDuplexStream = ServerSurfaceCall & - ObjectReadable & - ObjectWritable & { end: (metadata?: Metadata) => void }; - -export class ServerUnaryCallImpl - extends EventEmitter - implements ServerUnaryCall -{ - cancelled: boolean; - - constructor( - private call: Http2ServerCallStream, - public metadata: Metadata, - public request: RequestType - ) { - super(); - this.cancelled = false; - this.call.setupSurfaceCall(this); - } - - getPeer(): string { - return this.call.getPeer(); - } - - sendMetadata(responseMetadata: Metadata): void { - this.call.sendMetadata(responseMetadata); - } - - getDeadline(): Deadline { - return this.call.getDeadline(); - } - - getPath(): string { - return this.call.getPath(); - } -} - -export class ServerReadableStreamImpl - extends Readable - implements ServerReadableStream -{ - cancelled: boolean; - - constructor( - private call: Http2ServerCallStream, - public metadata: Metadata, - public deserialize: Deserialize, - encoding: string - ) { - super({ objectMode: true }); - this.cancelled = false; - this.call.setupSurfaceCall(this); - this.call.setupReadable(this, encoding); - } - - _read(size: number) { - if (!this.call.consumeUnpushedMessages(this)) { - return; - } - - this.call.resume(); - } - - getPeer(): string { - return this.call.getPeer(); - } - - sendMetadata(responseMetadata: Metadata): void { - this.call.sendMetadata(responseMetadata); - } - - getDeadline(): Deadline { - return this.call.getDeadline(); - } - - getPath(): string { - return this.call.getPath(); - } -} - -export class ServerWritableStreamImpl - extends Writable - implements ServerWritableStream -{ - cancelled: boolean; - private trailingMetadata: Metadata; - - constructor( - private call: Http2ServerCallStream, - public metadata: Metadata, - public serialize: Serialize, - public request: RequestType - ) { - super({ objectMode: true }); - this.cancelled = false; - this.trailingMetadata = new Metadata(); - this.call.setupSurfaceCall(this); - - this.on('error', (err) => { - this.call.sendError(err); - this.end(); - }); - } - - getPeer(): string { - return this.call.getPeer(); - } - - sendMetadata(responseMetadata: Metadata): void { - this.call.sendMetadata(responseMetadata); - } - - getDeadline(): Deadline { - return this.call.getDeadline(); - } - - getPath(): string { - return this.call.getPath(); - } - - _write( - chunk: ResponseType, - encoding: string, - // eslint-disable-next-line @typescript-eslint/no-explicit-any - callback: (...args: any[]) => void - ) { - try { - const response = this.call.serializeMessage(chunk); - - if (!this.call.write(response)) { - this.call.once('drain', callback); - return; - } - } catch (err) { - err.code = Status.INTERNAL; - this.emit('error', err); - } - - callback(); - } - - _final(callback: Function): void { - this.call.sendStatus({ - code: Status.OK, - details: 'OK', - metadata: this.trailingMetadata, - }); - callback(null); - } - - // eslint-disable-next-line @typescript-eslint/no-explicit-any - end(metadata?: any) { - if (metadata) { - this.trailingMetadata = metadata; - } - - return super.end(); - } -} - -export class ServerDuplexStreamImpl - extends Duplex - implements ServerDuplexStream -{ - cancelled: boolean; - private trailingMetadata: Metadata; - - constructor( - private call: Http2ServerCallStream, - public metadata: Metadata, - public serialize: Serialize, - public deserialize: Deserialize, - encoding: string - ) { - super({ objectMode: true }); - this.cancelled = false; - this.trailingMetadata = new Metadata(); - this.call.setupSurfaceCall(this); - this.call.setupReadable(this, encoding); - - this.on('error', (err) => { - this.call.sendError(err); - this.end(); - }); - } - - getPeer(): string { - return this.call.getPeer(); - } - - sendMetadata(responseMetadata: Metadata): void { - this.call.sendMetadata(responseMetadata); - } - - getDeadline(): Deadline { - return this.call.getDeadline(); - } - - getPath(): string { - return this.call.getPath(); - } - - // eslint-disable-next-line @typescript-eslint/no-explicit-any - end(metadata?: any) { - if (metadata) { - this.trailingMetadata = metadata; - } - - return super.end(); - } -} - -ServerDuplexStreamImpl.prototype._read = - ServerReadableStreamImpl.prototype._read; -ServerDuplexStreamImpl.prototype._write = - ServerWritableStreamImpl.prototype._write; -ServerDuplexStreamImpl.prototype._final = - ServerWritableStreamImpl.prototype._final; - -// Unary response callback signature. -export type sendUnaryData = ( - error: ServerErrorResponse | ServerStatusResponse | null, - value?: ResponseType | null, - trailer?: Metadata, - flags?: number -) => void; - -// User provided handler for unary calls. -export type handleUnaryCall = ( - call: ServerUnaryCall, - callback: sendUnaryData -) => void; - -// User provided handler for client streaming calls. -export type handleClientStreamingCall = ( - call: ServerReadableStream, - callback: sendUnaryData -) => void; - -// User provided handler for server streaming calls. -export type handleServerStreamingCall = ( - call: ServerWritableStream -) => void; - -// User provided handler for bidirectional streaming calls. -export type handleBidiStreamingCall = ( - call: ServerDuplexStream -) => void; - -export type HandleCall = - | handleUnaryCall - | handleClientStreamingCall - | handleServerStreamingCall - | handleBidiStreamingCall; - -export interface UnaryHandler { - func: handleUnaryCall; - serialize: Serialize; - deserialize: Deserialize; - type: HandlerType; - path: string; -} - -export interface ClientStreamingHandler { - func: handleClientStreamingCall; - serialize: Serialize; - deserialize: Deserialize; - type: HandlerType; - path: string; -} - -export interface ServerStreamingHandler { - func: handleServerStreamingCall; - serialize: Serialize; - deserialize: Deserialize; - type: HandlerType; - path: string; -} - -export interface BidiStreamingHandler { - func: handleBidiStreamingCall; - serialize: Serialize; - deserialize: Deserialize; - type: HandlerType; - path: string; -} - -export type Handler = - | UnaryHandler - | ClientStreamingHandler - | ServerStreamingHandler - | BidiStreamingHandler; - -export type HandlerType = 'bidi' | 'clientStream' | 'serverStream' | 'unary'; - -// Internal class that wraps the HTTP2 request. -export class Http2ServerCallStream< - RequestType, - ResponseType -> extends EventEmitter { - cancelled = false; - deadlineTimer: NodeJS.Timer | null = null; - private statusSent = false; - private deadline: Deadline = Infinity; - private wantTrailers = false; - private metadataSent = false; - private canPush = false; - private isPushPending = false; - private bufferedMessages: Array = []; - private messagesToPush: Array = []; - private maxSendMessageSize: number = DEFAULT_MAX_SEND_MESSAGE_LENGTH; - private maxReceiveMessageSize: number = DEFAULT_MAX_RECEIVE_MESSAGE_LENGTH; - - constructor( - private stream: http2.ServerHttp2Stream, - private handler: Handler, - private options: ChannelOptions - ) { - super(); - - this.stream.once('error', (err: ServerErrorResponse) => { - /* We need an error handler to avoid uncaught error event exceptions, but - * there is nothing we can reasonably do here. Any error event should - * have a corresponding close event, which handles emitting the cancelled - * event. And the stream is now in a bad state, so we can't reasonably - * expect to be able to send an error over it. */ - }); - - this.stream.once('close', () => { - trace( - 'Request to method ' + - this.handler?.path + - ' stream closed with rstCode ' + - this.stream.rstCode - ); - - if (!this.statusSent) { - this.cancelled = true; - this.emit('cancelled', 'cancelled'); - this.emit('streamEnd', false); - this.sendStatus({ - code: Status.CANCELLED, - details: 'Cancelled by client', - metadata: null, - }); - } - }); - - this.stream.on('drain', () => { - this.emit('drain'); - }); - - if ('grpc.max_send_message_length' in options) { - this.maxSendMessageSize = options['grpc.max_send_message_length']!; - } - if ('grpc.max_receive_message_length' in options) { - this.maxReceiveMessageSize = options['grpc.max_receive_message_length']!; - } - } - - private checkCancelled(): boolean { - /* In some cases the stream can become destroyed before the close event - * fires. That creates a race condition that this check works around */ - if (this.stream.destroyed || this.stream.closed) { - this.cancelled = true; - } - return this.cancelled; - } - - private getDecompressedMessage( - message: Buffer, - encoding: string - ): Buffer | Promise { - if (encoding === 'deflate') { - return inflate(message.subarray(5)); - } else if (encoding === 'gzip') { - return unzip(message.subarray(5)); - } else if (encoding === 'identity') { - return message.subarray(5); - } - - return Promise.reject({ - code: Status.UNIMPLEMENTED, - details: `Received message compressed with unsupported encoding "${encoding}"`, - }); - } - - sendMetadata(customMetadata?: Metadata) { - if (this.checkCancelled()) { - return; - } - - if (this.metadataSent) { - return; - } - - this.metadataSent = true; - const custom = customMetadata ? customMetadata.toHttp2Headers() : null; - // TODO(cjihrig): Include compression headers. - const headers = { ...defaultResponseHeaders, ...custom }; - this.stream.respond(headers, defaultResponseOptions); - } - - receiveMetadata(headers: http2.IncomingHttpHeaders) { - const metadata = Metadata.fromHttp2Headers(headers); - - if (logging.isTracerEnabled(TRACER_NAME)) { - trace( - 'Request to ' + - this.handler.path + - ' received headers ' + - JSON.stringify(metadata.toJSON()) - ); - } - - // TODO(cjihrig): Receive compression metadata. - - const timeoutHeader = metadata.get(GRPC_TIMEOUT_HEADER); - - if (timeoutHeader.length > 0) { - const match = timeoutHeader[0].toString().match(DEADLINE_REGEX); - - if (match === null) { - const err = new Error('Invalid deadline') as ServerErrorResponse; - err.code = Status.OUT_OF_RANGE; - this.sendError(err); - return metadata; - } - - const timeout = (+match[1] * deadlineUnitsToMs[match[2]]) | 0; - - const now = new Date(); - this.deadline = now.setMilliseconds(now.getMilliseconds() + timeout); - this.deadlineTimer = setTimeout(handleExpiredDeadline, timeout, this); - metadata.remove(GRPC_TIMEOUT_HEADER); - } - - // Remove several headers that should not be propagated to the application - metadata.remove(http2.constants.HTTP2_HEADER_ACCEPT_ENCODING); - metadata.remove(http2.constants.HTTP2_HEADER_TE); - metadata.remove(http2.constants.HTTP2_HEADER_CONTENT_TYPE); - metadata.remove('grpc-accept-encoding'); - - return metadata; - } - - receiveUnaryMessage( - encoding: string, - next: ( - err: Partial | null, - request?: RequestType - ) => void - ): void { - const { stream } = this; - - let receivedLength = 0; - const call = this; - const body: Buffer[] = []; - const limit = this.maxReceiveMessageSize; - - stream.on('data', onData); - stream.on('end', onEnd); - stream.on('error', onEnd); - - function onData(chunk: Buffer) { - receivedLength += chunk.byteLength; - - if (limit !== -1 && receivedLength > limit) { - stream.removeListener('data', onData); - stream.removeListener('end', onEnd); - stream.removeListener('error', onEnd); - next({ - code: Status.RESOURCE_EXHAUSTED, - details: `Received message larger than max (${receivedLength} vs. ${limit})`, - }); - return; - } - - body.push(chunk); - } - - function onEnd(err?: Error) { - stream.removeListener('data', onData); - stream.removeListener('end', onEnd); - stream.removeListener('error', onEnd); - - if (err !== undefined) { - next({ code: Status.INTERNAL, details: err.message }); - return; - } - - if (receivedLength === 0) { - next({ code: Status.INTERNAL, details: 'received empty unary message' }) - return; - } - - call.emit('receiveMessage'); - - const requestBytes = Buffer.concat(body, receivedLength); - const compressed = requestBytes.readUInt8(0) === 1; - const compressedMessageEncoding = compressed ? encoding : 'identity'; - const decompressedMessage = call.getDecompressedMessage( - requestBytes, - compressedMessageEncoding - ); - - if (Buffer.isBuffer(decompressedMessage)) { - call.safeDeserializeMessage(decompressedMessage, next); - return; - } - - decompressedMessage.then( - (decompressed) => call.safeDeserializeMessage(decompressed, next), - (err: any) => next( - err.code - ? err - : { - code: Status.INTERNAL, - details: `Received "grpc-encoding" header "${encoding}" but ${encoding} decompression failed`, - } - ) - ) - } - } - - private safeDeserializeMessage( - buffer: Buffer, - next: (err: Partial | null, request?: RequestType) => void - ) { - try { - next(null, this.deserializeMessage(buffer)); - } catch (err) { - err.code = Status.INTERNAL; - next(err); - } - } - - serializeMessage(value: ResponseType) { - const messageBuffer = this.handler.serialize(value); - - // TODO(cjihrig): Call compression aware serializeMessage(). - const byteLength = messageBuffer.byteLength; - const output = Buffer.allocUnsafe(byteLength + 5); - output.writeUInt8(0, 0); - output.writeUInt32BE(byteLength, 1); - messageBuffer.copy(output, 5); - return output; - } - - deserializeMessage(bytes: Buffer) { - return this.handler.deserialize(bytes); - } - - async sendUnaryMessage( - err: ServerErrorResponse | ServerStatusResponse | null, - value?: ResponseType | null, - metadata?: Metadata | null, - flags?: number - ) { - if (this.checkCancelled()) { - return; - } - - if (metadata === undefined) { - metadata = null; - } - - if (err) { - if (!Object.prototype.hasOwnProperty.call(err, 'metadata') && metadata) { - err.metadata = metadata; - } - this.sendError(err); - return; - } - - try { - const response = this.serializeMessage(value!); - - this.write(response); - this.sendStatus({ code: Status.OK, details: 'OK', metadata }); - } catch (err) { - err.code = Status.INTERNAL; - this.sendError(err); - } - } - - sendStatus(statusObj: PartialStatusObject) { - this.emit('callEnd', statusObj.code); - this.emit('streamEnd', statusObj.code === Status.OK); - if (this.checkCancelled()) { - return; - } - - trace( - 'Request to method ' + - this.handler?.path + - ' ended with status code: ' + - Status[statusObj.code] + - ' details: ' + - statusObj.details - ); - - if (this.deadlineTimer) clearTimeout(this.deadlineTimer); - - if (!this.wantTrailers) { - this.wantTrailers = true; - this.stream.once('wantTrailers', () => { - const trailersToSend = { - [GRPC_STATUS_HEADER]: statusObj.code, - [GRPC_MESSAGE_HEADER]: encodeURI(statusObj.details), - ...statusObj.metadata?.toHttp2Headers(), - }; - - this.stream.sendTrailers(trailersToSend); - this.statusSent = true; - }); - this.sendMetadata(); - this.stream.end(); - } - } - - sendError(error: ServerErrorResponse | ServerStatusResponse) { - const status: PartialStatusObject = { - code: Status.UNKNOWN, - details: 'message' in error ? error.message : 'Unknown Error', - metadata: - 'metadata' in error && error.metadata !== undefined - ? error.metadata - : null, - }; - - if ( - 'code' in error && - typeof error.code === 'number' && - Number.isInteger(error.code) - ) { - status.code = error.code; - - if ('details' in error && typeof error.details === 'string') { - status.details = error.details!; - } - } - - this.sendStatus(status); - } - - write(chunk: Buffer) { - if (this.checkCancelled()) { - return; - } - - if ( - this.maxSendMessageSize !== -1 && - chunk.length > this.maxSendMessageSize - ) { - this.sendError({ - code: Status.RESOURCE_EXHAUSTED, - details: `Sent message larger than max (${chunk.length} vs. ${this.maxSendMessageSize})`, - }); - return; - } - - this.sendMetadata(); - this.emit('sendMessage'); - return this.stream.write(chunk); - } - - resume() { - this.stream.resume(); - } - - setupSurfaceCall(call: ServerSurfaceCall) { - this.once('cancelled', (reason) => { - call.cancelled = true; - call.emit('cancelled', reason); - }); - - this.once('callEnd', (status) => call.emit('callEnd', status)); - } - - setupReadable( - readable: - | ServerReadableStream - | ServerDuplexStream, - encoding: string - ) { - const decoder = new StreamDecoder(); - - let readsDone = false; - - let pendingMessageProcessing = false; - - let pushedEnd = false; - - const maybePushEnd = () => { - if (!pushedEnd && readsDone && !pendingMessageProcessing) { - pushedEnd = true; - this.pushOrBufferMessage(readable, null); - } - }; - - this.stream.on('data', async (data: Buffer) => { - const messages = decoder.write(data); - - pendingMessageProcessing = true; - this.stream.pause(); - for (const message of messages) { - if ( - this.maxReceiveMessageSize !== -1 && - message.length > this.maxReceiveMessageSize - ) { - this.sendError({ - code: Status.RESOURCE_EXHAUSTED, - details: `Received message larger than max (${message.length} vs. ${this.maxReceiveMessageSize})`, - }); - return; - } - this.emit('receiveMessage'); - - const compressed = message.readUInt8(0) === 1; - const compressedMessageEncoding = compressed ? encoding : 'identity'; - const decompressedMessage = await this.getDecompressedMessage( - message, - compressedMessageEncoding - ); - - // Encountered an error with decompression; it'll already have been propogated back - // Just return early - if (!decompressedMessage) return; - - this.pushOrBufferMessage(readable, decompressedMessage); - } - pendingMessageProcessing = false; - this.stream.resume(); - maybePushEnd(); - }); - - this.stream.once('end', () => { - readsDone = true; - maybePushEnd(); - }); - } - - consumeUnpushedMessages( - readable: - | ServerReadableStream - | ServerDuplexStream - ): boolean { - this.canPush = true; - - while (this.messagesToPush.length > 0) { - const nextMessage = this.messagesToPush.shift(); - const canPush = readable.push(nextMessage); - - if (nextMessage === null || canPush === false) { - this.canPush = false; - break; - } - } - - return this.canPush; - } - - private pushOrBufferMessage( - readable: - | ServerReadableStream - | ServerDuplexStream, - messageBytes: Buffer | null - ): void { - if (this.isPushPending) { - this.bufferedMessages.push(messageBytes); - } else { - this.pushMessage(readable, messageBytes); - } - } - - private async pushMessage( - readable: - | ServerReadableStream - | ServerDuplexStream, - messageBytes: Buffer | null - ) { - if (messageBytes === null) { - trace('Received end of stream'); - if (this.canPush) { - readable.push(null); - } else { - this.messagesToPush.push(null); - } - - return; - } - - trace('Received message of length ' + messageBytes.length); - - this.isPushPending = true; - - try { - const deserialized = await this.deserializeMessage(messageBytes); - - if (this.canPush) { - if (!readable.push(deserialized)) { - this.canPush = false; - this.stream.pause(); - } - } else { - this.messagesToPush.push(deserialized); - } - } catch (error) { - // Ignore any remaining messages when errors occur. - this.bufferedMessages.length = 0; - - if ( - !( - 'code' in error && - typeof error.code === 'number' && - Number.isInteger(error.code) && - error.code >= Status.OK && - error.code <= Status.UNAUTHENTICATED - ) - ) { - // The error code is not a valid gRPC code so its being overwritten. - error.code = Status.INTERNAL; - } - - readable.emit('error', error); - } - - this.isPushPending = false; - - if (this.bufferedMessages.length > 0) { - this.pushMessage( - readable, - this.bufferedMessages.shift() as Buffer | null - ); - } - } - - getPeer(): string { - const socket = this.stream.session.socket; - if (socket.remoteAddress) { - if (socket.remotePort) { - return `${socket.remoteAddress}:${socket.remotePort}`; - } else { - return socket.remoteAddress; - } - } else { - return 'unknown'; - } - } - - getDeadline(): Deadline { - return this.deadline; - } - - getPath(): string { - return this.handler.path; - } -} - -/* eslint-disable @typescript-eslint/no-explicit-any */ -type UntypedServerCall = Http2ServerCallStream; - -function handleExpiredDeadline(call: UntypedServerCall) { - const err = new Error('Deadline exceeded') as ServerErrorResponse; - err.code = Status.DEADLINE_EXCEEDED; - - call.sendError(err); - call.cancelled = true; - call.emit('cancelled', 'deadline'); -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/server-credentials.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/server-credentials.ts deleted file mode 100644 index 17ab2980..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/server-credentials.ts +++ /dev/null @@ -1,108 +0,0 @@ -/* - * Copyright 2019 gRPC authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -import { SecureServerOptions } from 'http2'; -import { CIPHER_SUITES, getDefaultRootsData } from './tls-helpers'; - -export interface KeyCertPair { - private_key: Buffer; - cert_chain: Buffer; -} - -export abstract class ServerCredentials { - abstract _isSecure(): boolean; - abstract _getSettings(): SecureServerOptions | null; - - static createInsecure(): ServerCredentials { - return new InsecureServerCredentials(); - } - - static createSsl( - rootCerts: Buffer | null, - keyCertPairs: KeyCertPair[], - checkClientCertificate = false - ): ServerCredentials { - if (rootCerts !== null && !Buffer.isBuffer(rootCerts)) { - throw new TypeError('rootCerts must be null or a Buffer'); - } - - if (!Array.isArray(keyCertPairs)) { - throw new TypeError('keyCertPairs must be an array'); - } - - if (typeof checkClientCertificate !== 'boolean') { - throw new TypeError('checkClientCertificate must be a boolean'); - } - - const cert = []; - const key = []; - - for (let i = 0; i < keyCertPairs.length; i++) { - const pair = keyCertPairs[i]; - - if (pair === null || typeof pair !== 'object') { - throw new TypeError(`keyCertPair[${i}] must be an object`); - } - - if (!Buffer.isBuffer(pair.private_key)) { - throw new TypeError(`keyCertPair[${i}].private_key must be a Buffer`); - } - - if (!Buffer.isBuffer(pair.cert_chain)) { - throw new TypeError(`keyCertPair[${i}].cert_chain must be a Buffer`); - } - - cert.push(pair.cert_chain); - key.push(pair.private_key); - } - - return new SecureServerCredentials({ - ca: rootCerts || getDefaultRootsData() || undefined, - cert, - key, - requestCert: checkClientCertificate, - ciphers: CIPHER_SUITES, - }); - } -} - -class InsecureServerCredentials extends ServerCredentials { - _isSecure(): boolean { - return false; - } - - _getSettings(): null { - return null; - } -} - -class SecureServerCredentials extends ServerCredentials { - private options: SecureServerOptions; - - constructor(options: SecureServerOptions) { - super(); - this.options = options; - } - - _isSecure(): boolean { - return true; - } - - _getSettings(): SecureServerOptions { - return this.options; - } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/server.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/server.ts deleted file mode 100644 index 2e89f459..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/server.ts +++ /dev/null @@ -1,1091 +0,0 @@ -/* - * Copyright 2019 gRPC authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -import * as http2 from 'http2'; -import { AddressInfo } from 'net'; - -import { ServiceError } from './call'; -import { Status, LogVerbosity } from './constants'; -import { Deserialize, Serialize, ServiceDefinition } from './make-client'; -import { Metadata } from './metadata'; -import { - BidiStreamingHandler, - ClientStreamingHandler, - HandleCall, - Handler, - HandlerType, - Http2ServerCallStream, - sendUnaryData, - ServerDuplexStream, - ServerDuplexStreamImpl, - ServerReadableStream, - ServerReadableStreamImpl, - ServerStreamingHandler, - ServerUnaryCall, - ServerUnaryCallImpl, - ServerWritableStream, - ServerWritableStreamImpl, - UnaryHandler, - ServerErrorResponse, - ServerStatusResponse, -} from './server-call'; -import { ServerCredentials } from './server-credentials'; -import { ChannelOptions } from './channel-options'; -import { - createResolver, - ResolverListener, - mapUriDefaultScheme, -} from './resolver'; -import * as logging from './logging'; -import { - SubchannelAddress, - TcpSubchannelAddress, - isTcpSubchannelAddress, - subchannelAddressToString, - stringToSubchannelAddress, -} from './subchannel-address'; -import { parseUri } from './uri-parser'; -import { ChannelzCallTracker, ChannelzChildrenTracker, ChannelzTrace, registerChannelzServer, registerChannelzSocket, ServerInfo, ServerRef, SocketInfo, SocketRef, TlsInfo, unregisterChannelzRef } from './channelz'; -import { CipherNameAndProtocol, TLSSocket } from 'tls'; - -const { - HTTP2_HEADER_PATH -} = http2.constants - -const TRACER_NAME = 'server'; - -interface BindResult { - port: number; - count: number; -} - -function noop(): void {} - -function getUnimplementedStatusResponse( - methodName: string -): Partial { - return { - code: Status.UNIMPLEMENTED, - details: `The server does not implement the method ${methodName}`, - }; -} - -/* eslint-disable @typescript-eslint/no-explicit-any */ -type UntypedUnaryHandler = UnaryHandler; -type UntypedClientStreamingHandler = ClientStreamingHandler; -type UntypedServerStreamingHandler = ServerStreamingHandler; -type UntypedBidiStreamingHandler = BidiStreamingHandler; -export type UntypedHandleCall = HandleCall; -type UntypedHandler = Handler; -export interface UntypedServiceImplementation { - [name: string]: UntypedHandleCall; -} - -function getDefaultHandler(handlerType: HandlerType, methodName: string) { - const unimplementedStatusResponse = getUnimplementedStatusResponse( - methodName - ); - switch (handlerType) { - case 'unary': - return ( - call: ServerUnaryCall, - callback: sendUnaryData - ) => { - callback(unimplementedStatusResponse as ServiceError, null); - }; - case 'clientStream': - return ( - call: ServerReadableStream, - callback: sendUnaryData - ) => { - callback(unimplementedStatusResponse as ServiceError, null); - }; - case 'serverStream': - return (call: ServerWritableStream) => { - call.emit('error', unimplementedStatusResponse); - }; - case 'bidi': - return (call: ServerDuplexStream) => { - call.emit('error', unimplementedStatusResponse); - }; - default: - throw new Error(`Invalid handlerType ${handlerType}`); - } -} - -interface ChannelzSessionInfo { - ref: SocketRef; - streamTracker: ChannelzCallTracker; - messagesSent: number; - messagesReceived: number; - lastMessageSentTimestamp: Date | null; - lastMessageReceivedTimestamp: Date | null; -} - -interface ChannelzListenerInfo { - ref: SocketRef; -} - -export class Server { - private http2ServerList: { server: (http2.Http2Server | http2.Http2SecureServer), channelzRef: SocketRef }[] = []; - - private handlers: Map = new Map< - string, - UntypedHandler - >(); - private sessions = new Map(); - private started = false; - private options: ChannelOptions; - private serverAddressString: string = 'null' - - // Channelz Info - private readonly channelzEnabled: boolean = true; - private channelzRef: ServerRef; - private channelzTrace = new ChannelzTrace(); - private callTracker = new ChannelzCallTracker(); - private listenerChildrenTracker = new ChannelzChildrenTracker(); - private sessionChildrenTracker = new ChannelzChildrenTracker(); - - constructor(options?: ChannelOptions) { - this.options = options ?? {}; - if (this.options['grpc.enable_channelz'] === 0) { - this.channelzEnabled = false; - } - this.channelzRef = registerChannelzServer(() => this.getChannelzInfo(), this.channelzEnabled); - if (this.channelzEnabled) { - this.channelzTrace.addTrace('CT_INFO', 'Server created'); - } - - this.trace('Server constructed'); - } - - private getChannelzInfo(): ServerInfo { - return { - trace: this.channelzTrace, - callTracker: this.callTracker, - listenerChildren: this.listenerChildrenTracker.getChildLists(), - sessionChildren: this.sessionChildrenTracker.getChildLists() - }; - } - - private getChannelzSessionInfoGetter(session: http2.ServerHttp2Session): () => SocketInfo { - return () => { - const sessionInfo = this.sessions.get(session)!; - const sessionSocket = session.socket; - const remoteAddress = sessionSocket.remoteAddress ? stringToSubchannelAddress(sessionSocket.remoteAddress, sessionSocket.remotePort) : null; - const localAddress = sessionSocket.localAddress ? stringToSubchannelAddress(sessionSocket.localAddress!, sessionSocket.localPort) : null; - let tlsInfo: TlsInfo | null; - if (session.encrypted) { - const tlsSocket: TLSSocket = sessionSocket as TLSSocket; - const cipherInfo: CipherNameAndProtocol & {standardName?: string} = tlsSocket.getCipher(); - const certificate = tlsSocket.getCertificate(); - const peerCertificate = tlsSocket.getPeerCertificate(); - tlsInfo = { - cipherSuiteStandardName: cipherInfo.standardName ?? null, - cipherSuiteOtherName: cipherInfo.standardName ? null : cipherInfo.name, - localCertificate: (certificate && 'raw' in certificate) ? certificate.raw : null, - remoteCertificate: (peerCertificate && 'raw' in peerCertificate) ? peerCertificate.raw : null - }; - } else { - tlsInfo = null; - } - const socketInfo: SocketInfo = { - remoteAddress: remoteAddress, - localAddress: localAddress, - security: tlsInfo, - remoteName: null, - streamsStarted: sessionInfo.streamTracker.callsStarted, - streamsSucceeded: sessionInfo.streamTracker.callsSucceeded, - streamsFailed: sessionInfo.streamTracker.callsFailed, - messagesSent: sessionInfo.messagesSent, - messagesReceived: sessionInfo.messagesReceived, - keepAlivesSent: 0, - lastLocalStreamCreatedTimestamp: null, - lastRemoteStreamCreatedTimestamp: sessionInfo.streamTracker.lastCallStartedTimestamp, - lastMessageSentTimestamp: sessionInfo.lastMessageSentTimestamp, - lastMessageReceivedTimestamp: sessionInfo.lastMessageReceivedTimestamp, - localFlowControlWindow: session.state.localWindowSize ?? null, - remoteFlowControlWindow: session.state.remoteWindowSize ?? null - }; - return socketInfo; - }; - } - - private trace(text: string): void { - logging.trace(LogVerbosity.DEBUG, TRACER_NAME, '(' + this.channelzRef.id + ') ' + text); - } - - - addProtoService(): never { - throw new Error('Not implemented. Use addService() instead'); - } - - addService( - service: ServiceDefinition, - implementation: UntypedServiceImplementation - ): void { - if ( - service === null || - typeof service !== 'object' || - implementation === null || - typeof implementation !== 'object' - ) { - throw new Error('addService() requires two objects as arguments'); - } - - const serviceKeys = Object.keys(service); - - if (serviceKeys.length === 0) { - throw new Error('Cannot add an empty service to a server'); - } - - serviceKeys.forEach((name) => { - const attrs = service[name]; - let methodType: HandlerType; - - if (attrs.requestStream) { - if (attrs.responseStream) { - methodType = 'bidi'; - } else { - methodType = 'clientStream'; - } - } else { - if (attrs.responseStream) { - methodType = 'serverStream'; - } else { - methodType = 'unary'; - } - } - - let implFn = implementation[name]; - let impl; - - if (implFn === undefined && typeof attrs.originalName === 'string') { - implFn = implementation[attrs.originalName]; - } - - if (implFn !== undefined) { - impl = implFn.bind(implementation); - } else { - impl = getDefaultHandler(methodType, name); - } - - const success = this.register( - attrs.path, - impl as UntypedHandleCall, - attrs.responseSerialize, - attrs.requestDeserialize, - methodType - ); - - if (success === false) { - throw new Error(`Method handler for ${attrs.path} already provided.`); - } - }); - } - - removeService(service: ServiceDefinition): void { - if (service === null || typeof service !== 'object') { - throw new Error('removeService() requires object as argument'); - } - - const serviceKeys = Object.keys(service); - serviceKeys.forEach((name) => { - const attrs = service[name]; - this.unregister(attrs.path); - }); - } - - bind(port: string, creds: ServerCredentials): never { - throw new Error('Not implemented. Use bindAsync() instead'); - } - - bindAsync( - port: string, - creds: ServerCredentials, - callback: (error: Error | null, port: number) => void - ): void { - if (this.started === true) { - throw new Error('server is already started'); - } - - if (typeof port !== 'string') { - throw new TypeError('port must be a string'); - } - - if (creds === null || !(creds instanceof ServerCredentials)) { - throw new TypeError('creds must be a ServerCredentials object'); - } - - if (typeof callback !== 'function') { - throw new TypeError('callback must be a function'); - } - - const initialPortUri = parseUri(port); - if (initialPortUri === null) { - throw new Error(`Could not parse port "${port}"`); - } - const portUri = mapUriDefaultScheme(initialPortUri); - if (portUri === null) { - throw new Error(`Could not get a default scheme for port "${port}"`); - } - - const serverOptions: http2.ServerOptions = { - maxSendHeaderBlockLength: Number.MAX_SAFE_INTEGER, - }; - if ('grpc-node.max_session_memory' in this.options) { - serverOptions.maxSessionMemory = this.options[ - 'grpc-node.max_session_memory' - ]; - } else { - /* By default, set a very large max session memory limit, to effectively - * disable enforcement of the limit. Some testing indicates that Node's - * behavior degrades badly when this limit is reached, so we solve that - * by disabling the check entirely. */ - serverOptions.maxSessionMemory = Number.MAX_SAFE_INTEGER; - } - if ('grpc.max_concurrent_streams' in this.options) { - serverOptions.settings = { - maxConcurrentStreams: this.options['grpc.max_concurrent_streams'], - }; - } - - const deferredCallback = (error: Error | null, port: number) => { - process.nextTick(() => callback(error, port)); - } - - const setupServer = (): http2.Http2Server | http2.Http2SecureServer => { - let http2Server: http2.Http2Server | http2.Http2SecureServer; - if (creds._isSecure()) { - const secureServerOptions = Object.assign( - serverOptions, - creds._getSettings()! - ); - http2Server = http2.createSecureServer(secureServerOptions); - http2Server.on('secureConnection', (socket: TLSSocket) => { - /* These errors need to be handled by the user of Http2SecureServer, - * according to https://github.com/nodejs/node/issues/35824 */ - socket.on('error', (e: Error) => { - this.trace('An incoming TLS connection closed with error: ' + e.message); - }); - }); - } else { - http2Server = http2.createServer(serverOptions); - } - - http2Server.setTimeout(0, noop); - this._setupHandlers(http2Server); - return http2Server; - }; - - const bindSpecificPort = ( - addressList: SubchannelAddress[], - portNum: number, - previousCount: number - ): Promise => { - if (addressList.length === 0) { - return Promise.resolve({ port: portNum, count: previousCount }); - } - return Promise.all( - addressList.map((address) => { - this.trace('Attempting to bind ' + subchannelAddressToString(address)); - let addr: SubchannelAddress; - if (isTcpSubchannelAddress(address)) { - addr = { - host: (address as TcpSubchannelAddress).host, - port: portNum, - }; - } else { - addr = address; - } - - const http2Server = setupServer(); - return new Promise((resolve, reject) => { - const onError = (err: Error) => { - this.trace('Failed to bind ' + subchannelAddressToString(address) + ' with error ' + err.message); - resolve(err); - } - - http2Server.once('error', onError); - - http2Server.listen(addr, () => { - const boundAddress = http2Server.address()!; - let boundSubchannelAddress: SubchannelAddress; - if (typeof boundAddress === 'string') { - boundSubchannelAddress = { - path: boundAddress - }; - } else { - boundSubchannelAddress = { - host: boundAddress.address, - port: boundAddress.port - } - } - let channelzRef: SocketRef; - channelzRef = registerChannelzSocket(subchannelAddressToString(boundSubchannelAddress), () => { - return { - localAddress: boundSubchannelAddress, - remoteAddress: null, - security: null, - remoteName: null, - streamsStarted: 0, - streamsSucceeded: 0, - streamsFailed: 0, - messagesSent: 0, - messagesReceived: 0, - keepAlivesSent: 0, - lastLocalStreamCreatedTimestamp: null, - lastRemoteStreamCreatedTimestamp: null, - lastMessageSentTimestamp: null, - lastMessageReceivedTimestamp: null, - localFlowControlWindow: null, - remoteFlowControlWindow: null - }; - }, this.channelzEnabled); - if (this.channelzEnabled) { - this.listenerChildrenTracker.refChild(channelzRef); - } - this.http2ServerList.push({server: http2Server, channelzRef: channelzRef}); - this.trace('Successfully bound ' + subchannelAddressToString(boundSubchannelAddress)); - resolve('port' in boundSubchannelAddress ? boundSubchannelAddress.port : portNum); - http2Server.removeListener('error', onError); - }); - }); - }) - ).then((results) => { - let count = 0; - for (const result of results) { - if (typeof result === 'number') { - count += 1; - if (result !== portNum) { - throw new Error( - 'Invalid state: multiple port numbers added from single address' - ); - } - } - } - return { - port: portNum, - count: count + previousCount, - }; - }); - }; - - const bindWildcardPort = ( - addressList: SubchannelAddress[] - ): Promise => { - if (addressList.length === 0) { - return Promise.resolve({ port: 0, count: 0 }); - } - const address = addressList[0]; - const http2Server = setupServer(); - return new Promise((resolve, reject) => { - const onError = (err: Error) => { - this.trace('Failed to bind ' + subchannelAddressToString(address) + ' with error ' + err.message); - resolve(bindWildcardPort(addressList.slice(1))); - } - - http2Server.once('error', onError); - - http2Server.listen(address, () => { - const boundAddress = http2Server.address() as AddressInfo; - const boundSubchannelAddress: SubchannelAddress = { - host: boundAddress.address, - port: boundAddress.port - }; - let channelzRef: SocketRef; - channelzRef = registerChannelzSocket(subchannelAddressToString(boundSubchannelAddress), () => { - return { - localAddress: boundSubchannelAddress, - remoteAddress: null, - security: null, - remoteName: null, - streamsStarted: 0, - streamsSucceeded: 0, - streamsFailed: 0, - messagesSent: 0, - messagesReceived: 0, - keepAlivesSent: 0, - lastLocalStreamCreatedTimestamp: null, - lastRemoteStreamCreatedTimestamp: null, - lastMessageSentTimestamp: null, - lastMessageReceivedTimestamp: null, - localFlowControlWindow: null, - remoteFlowControlWindow: null - }; - }, this.channelzEnabled); - if (this.channelzEnabled) { - this.listenerChildrenTracker.refChild(channelzRef); - } - this.http2ServerList.push({server: http2Server, channelzRef: channelzRef}); - this.trace('Successfully bound ' + subchannelAddressToString(boundSubchannelAddress)); - resolve( - bindSpecificPort( - addressList.slice(1), - boundAddress.port, - 1 - ) - ); - http2Server.removeListener('error', onError); - }); - }); - }; - - const resolverListener: ResolverListener = { - onSuccessfulResolution: ( - addressList, - serviceConfig, - serviceConfigError - ) => { - // We only want one resolution result. Discard all future results - resolverListener.onSuccessfulResolution = () => {}; - if (addressList.length === 0) { - deferredCallback(new Error(`No addresses resolved for port ${port}`), 0); - return; - } - let bindResultPromise: Promise; - if (isTcpSubchannelAddress(addressList[0])) { - if (addressList[0].port === 0) { - bindResultPromise = bindWildcardPort(addressList); - } else { - bindResultPromise = bindSpecificPort( - addressList, - addressList[0].port, - 0 - ); - } - } else { - // Use an arbitrary non-zero port for non-TCP addresses - bindResultPromise = bindSpecificPort(addressList, 1, 0); - } - bindResultPromise.then( - (bindResult) => { - if (bindResult.count === 0) { - const errorString = `No address added out of total ${addressList.length} resolved`; - logging.log(LogVerbosity.ERROR, errorString); - deferredCallback(new Error(errorString), 0); - } else { - if (bindResult.count < addressList.length) { - logging.log( - LogVerbosity.INFO, - `WARNING Only ${bindResult.count} addresses added out of total ${addressList.length} resolved` - ); - } - deferredCallback(null, bindResult.port); - } - }, - (error) => { - const errorString = `No address added out of total ${addressList.length} resolved`; - logging.log(LogVerbosity.ERROR, errorString); - deferredCallback(new Error(errorString), 0); - } - ); - }, - onError: (error) => { - deferredCallback(new Error(error.details), 0); - }, - }; - - const resolver = createResolver(portUri, resolverListener, this.options); - resolver.updateResolution(); - } - - forceShutdown(): void { - // Close the server if it is still running. - - for (const {server: http2Server, channelzRef: ref} of this.http2ServerList) { - if (http2Server.listening) { - http2Server.close(() => { - if (this.channelzEnabled) { - this.listenerChildrenTracker.unrefChild(ref); - unregisterChannelzRef(ref); - } - }); - } - } - - this.started = false; - - // Always destroy any available sessions. It's possible that one or more - // tryShutdown() calls are in progress. Don't wait on them to finish. - this.sessions.forEach((channelzInfo, session) => { - // Cast NGHTTP2_CANCEL to any because TypeScript doesn't seem to - // recognize destroy(code) as a valid signature. - // eslint-disable-next-line @typescript-eslint/no-explicit-any - session.destroy(http2.constants.NGHTTP2_CANCEL as any); - }); - this.sessions.clear(); - if (this.channelzEnabled) { - unregisterChannelzRef(this.channelzRef); - } - } - - register( - name: string, - handler: HandleCall, - serialize: Serialize, - deserialize: Deserialize, - type: string - ): boolean { - if (this.handlers.has(name)) { - return false; - } - - this.handlers.set(name, { - func: handler, - serialize, - deserialize, - type, - path: name, - } as UntypedHandler); - return true; - } - - unregister(name: string): boolean { - return this.handlers.delete(name); - } - - start(): void { - if ( - this.http2ServerList.length === 0 || - this.http2ServerList.every( - ({server: http2Server}) => http2Server.listening !== true - ) - ) { - throw new Error('server must be bound in order to start'); - } - - if (this.started === true) { - throw new Error('server is already started'); - } - if (this.channelzEnabled) { - this.channelzTrace.addTrace('CT_INFO', 'Starting'); - } - this.started = true; - } - - tryShutdown(callback: (error?: Error) => void): void { - const wrappedCallback = (error?: Error) => { - if (this.channelzEnabled) { - unregisterChannelzRef(this.channelzRef); - } - callback(error); - }; - let pendingChecks = 0; - - function maybeCallback(): void { - pendingChecks--; - - if (pendingChecks === 0) { - wrappedCallback(); - } - } - - // Close the server if necessary. - this.started = false; - - for (const {server: http2Server, channelzRef: ref} of this.http2ServerList) { - if (http2Server.listening) { - pendingChecks++; - http2Server.close(() => { - if (this.channelzEnabled) { - this.listenerChildrenTracker.unrefChild(ref); - unregisterChannelzRef(ref); - } - maybeCallback(); - }); - } - } - - this.sessions.forEach((channelzInfo, session) => { - if (!session.closed) { - pendingChecks += 1; - session.close(maybeCallback); - } - }); - if (pendingChecks === 0) { - wrappedCallback(); - } - } - - addHttp2Port(): never { - throw new Error('Not yet implemented'); - } - - /** - * Get the channelz reference object for this server. The returned value is - * garbage if channelz is disabled for this server. - * @returns - */ - getChannelzRef() { - return this.channelzRef; - } - - private _verifyContentType(stream: http2.ServerHttp2Stream, headers: http2.IncomingHttpHeaders): boolean { - const contentType = headers[http2.constants.HTTP2_HEADER_CONTENT_TYPE]; - - if ( - typeof contentType !== 'string' || - !contentType.startsWith('application/grpc') - ) { - stream.respond( - { - [http2.constants.HTTP2_HEADER_STATUS]: - http2.constants.HTTP_STATUS_UNSUPPORTED_MEDIA_TYPE, - }, - { endStream: true } - ); - return false - } - - return true - } - - private _retrieveHandler(headers: http2.IncomingHttpHeaders): Handler { - const path = headers[HTTP2_HEADER_PATH] as string - - this.trace( - 'Received call to method ' + - path + - ' at address ' + - this.serverAddressString - ); - - const handler = this.handlers.get(path); - - if (handler === undefined) { - this.trace( - 'No handler registered for method ' + - path + - '. Sending UNIMPLEMENTED status.' - ); - throw getUnimplementedStatusResponse(path); - } - - return handler - } - - private _respondWithError>( - err: T, - stream: http2.ServerHttp2Stream, - channelzSessionInfo: ChannelzSessionInfo | null = null - ) { - const call = new Http2ServerCallStream(stream, null!, this.options); - - if (err.code === undefined) { - err.code = Status.INTERNAL; - } - - if (this.channelzEnabled) { - this.callTracker.addCallFailed(); - channelzSessionInfo?.streamTracker.addCallFailed() - } - - call.sendError(err); - } - - private _channelzHandler(stream: http2.ServerHttp2Stream, headers: http2.IncomingHttpHeaders) { - const channelzSessionInfo = this.sessions.get(stream.session as http2.ServerHttp2Session); - - this.callTracker.addCallStarted(); - channelzSessionInfo?.streamTracker.addCallStarted(); - - if (!this._verifyContentType(stream, headers)) { - this.callTracker.addCallFailed(); - channelzSessionInfo?.streamTracker.addCallFailed(); - return - } - - let handler: Handler - try { - handler = this._retrieveHandler(headers) - } catch (err) { - this._respondWithError(err, stream, channelzSessionInfo) - return - } - - const call = new Http2ServerCallStream(stream, handler, this.options); - - call.once('callEnd', (code: Status) => { - if (code === Status.OK) { - this.callTracker.addCallSucceeded(); - } else { - this.callTracker.addCallFailed(); - } - }); - - if (channelzSessionInfo) { - call.once('streamEnd', (success: boolean) => { - if (success) { - channelzSessionInfo.streamTracker.addCallSucceeded(); - } else { - channelzSessionInfo.streamTracker.addCallFailed(); - } - }); - call.on('sendMessage', () => { - channelzSessionInfo.messagesSent += 1; - channelzSessionInfo.lastMessageSentTimestamp = new Date(); - }); - call.on('receiveMessage', () => { - channelzSessionInfo.messagesReceived += 1; - channelzSessionInfo.lastMessageReceivedTimestamp = new Date(); - }); - } - - if (!this._runHandlerForCall(call, handler, headers)) { - this.callTracker.addCallFailed(); - channelzSessionInfo?.streamTracker.addCallFailed() - - call.sendError({ - code: Status.INTERNAL, - details: `Unknown handler type: ${handler.type}` - }); - } - } - - private _streamHandler(stream: http2.ServerHttp2Stream, headers: http2.IncomingHttpHeaders) { - if (this._verifyContentType(stream, headers) !== true) { - return - } - - let handler: Handler - try { - handler = this._retrieveHandler(headers) - } catch (err) { - this._respondWithError(err, stream, null) - return - } - - const call = new Http2ServerCallStream(stream, handler, this.options) - if (!this._runHandlerForCall(call, handler, headers)) { - call.sendError({ - code: Status.INTERNAL, - details: `Unknown handler type: ${handler.type}` - }); - } - } - - private _runHandlerForCall(call: Http2ServerCallStream, handler: Handler, headers: http2.IncomingHttpHeaders): boolean { - const metadata = call.receiveMetadata(headers); - const encoding = (metadata.get('grpc-encoding')[0] as string | undefined) ?? 'identity'; - metadata.remove('grpc-encoding'); - - const { type } = handler - if (type === 'unary') { - handleUnary(call, handler as UntypedUnaryHandler, metadata, encoding); - } else if (type === 'clientStream') { - handleClientStreaming( - call, - handler as UntypedClientStreamingHandler, - metadata, - encoding - ); - } else if (type === 'serverStream') { - handleServerStreaming( - call, - handler as UntypedServerStreamingHandler, - metadata, - encoding - ); - } else if (type === 'bidi') { - handleBidiStreaming( - call, - handler as UntypedBidiStreamingHandler, - metadata, - encoding - ); - } else { - return false - } - - return true - } - - private _setupHandlers( - http2Server: http2.Http2Server | http2.Http2SecureServer - ): void { - if (http2Server === null) { - return; - } - - const serverAddress = http2Server.address(); - let serverAddressString = 'null' - if (serverAddress) { - if (typeof serverAddress === 'string') { - serverAddressString = serverAddress - } else { - serverAddressString = - serverAddress.address + ':' + serverAddress.port - } - } - this.serverAddressString = serverAddressString - - const handler = this.channelzEnabled - ? this._channelzHandler - : this._streamHandler - - http2Server.on('stream', handler.bind(this)) - http2Server.on('session', (session) => { - if (!this.started) { - session.destroy(); - return; - } - - let channelzRef: SocketRef; - channelzRef = registerChannelzSocket(session.socket.remoteAddress ?? 'unknown', this.getChannelzSessionInfoGetter(session), this.channelzEnabled); - - const channelzSessionInfo: ChannelzSessionInfo = { - ref: channelzRef, - streamTracker: new ChannelzCallTracker(), - messagesSent: 0, - messagesReceived: 0, - lastMessageSentTimestamp: null, - lastMessageReceivedTimestamp: null - }; - - this.sessions.set(session, channelzSessionInfo); - const clientAddress = session.socket.remoteAddress; - if (this.channelzEnabled) { - this.channelzTrace.addTrace('CT_INFO', 'Connection established by client ' + clientAddress); - this.sessionChildrenTracker.refChild(channelzRef); - } - session.on('close', () => { - if (this.channelzEnabled) { - this.channelzTrace.addTrace('CT_INFO', 'Connection dropped by client ' + clientAddress); - this.sessionChildrenTracker.unrefChild(channelzRef); - unregisterChannelzRef(channelzRef); - } - this.sessions.delete(session); - }); - }); - } -} - -function handleUnary( - call: Http2ServerCallStream, - handler: UnaryHandler, - metadata: Metadata, - encoding: string -): void { - call.receiveUnaryMessage(encoding, (err, request) => { - if (err) { - call.sendError(err) - return - } - - if (request === undefined || call.cancelled) { - return; - } - - const emitter = new ServerUnaryCallImpl( - call, - metadata, - request - ); - - handler.func( - emitter, - ( - err: ServerErrorResponse | ServerStatusResponse | null, - value?: ResponseType | null, - trailer?: Metadata, - flags?: number - ) => { - call.sendUnaryMessage(err, value, trailer, flags); - } - ); - }); -} - -function handleClientStreaming( - call: Http2ServerCallStream, - handler: ClientStreamingHandler, - metadata: Metadata, - encoding: string -): void { - const stream = new ServerReadableStreamImpl( - call, - metadata, - handler.deserialize, - encoding - ); - - function respond( - err: ServerErrorResponse | ServerStatusResponse | null, - value?: ResponseType | null, - trailer?: Metadata, - flags?: number - ) { - stream.destroy(); - call.sendUnaryMessage(err, value, trailer, flags); - } - - if (call.cancelled) { - return; - } - - stream.on('error', respond); - handler.func(stream, respond); -} - -function handleServerStreaming( - call: Http2ServerCallStream, - handler: ServerStreamingHandler, - metadata: Metadata, - encoding: string -): void { - call.receiveUnaryMessage(encoding, (err, request) => { - if (err) { - call.sendError(err) - return - } - - if (request === undefined || call.cancelled) { - return; - } - - const stream = new ServerWritableStreamImpl( - call, - metadata, - handler.serialize, - request - ); - - handler.func(stream); - }); -} - -function handleBidiStreaming( - call: Http2ServerCallStream, - handler: BidiStreamingHandler, - metadata: Metadata, - encoding: string -): void { - const stream = new ServerDuplexStreamImpl( - call, - metadata, - handler.serialize, - handler.deserialize, - encoding - ); - - if (call.cancelled) { - return; - } - - handler.func(stream); -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/service-config.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/service-config.ts deleted file mode 100644 index f310597e..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/service-config.ts +++ /dev/null @@ -1,334 +0,0 @@ -/* - * Copyright 2019 gRPC authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -/* This file implements gRFC A2 and the service config spec: - * https://github.com/grpc/proposal/blob/master/A2-service-configs-in-dns.md - * https://github.com/grpc/grpc/blob/master/doc/service_config.md. Each - * function here takes an object with unknown structure and returns its - * specific object type if the input has the right structure, and throws an - * error otherwise. */ - -/* The any type is purposely used here. All functions validate their input at - * runtime */ -/* eslint-disable @typescript-eslint/no-explicit-any */ - -import * as os from 'os'; -import { Duration } from './duration'; -import { - LoadBalancingConfig, - validateLoadBalancingConfig, -} from './load-balancer'; - -export interface MethodConfigName { - service: string; - method?: string; -} - -export interface MethodConfig { - name: MethodConfigName[]; - waitForReady?: boolean; - timeout?: Duration; - maxRequestBytes?: number; - maxResponseBytes?: number; -} - -export interface ServiceConfig { - loadBalancingPolicy?: string; - loadBalancingConfig: LoadBalancingConfig[]; - methodConfig: MethodConfig[]; -} - -export interface ServiceConfigCanaryConfig { - clientLanguage?: string[]; - percentage?: number; - clientHostname?: string[]; - serviceConfig: ServiceConfig; -} - -/** - * Recognizes a number with up to 9 digits after the decimal point, followed by - * an "s", representing a number of seconds. - */ -const TIMEOUT_REGEX = /^\d+(\.\d{1,9})?s$/; - -/** - * Client language name used for determining whether this client matches a - * `ServiceConfigCanaryConfig`'s `clientLanguage` list. - */ -const CLIENT_LANGUAGE_STRING = 'node'; - -function validateName(obj: any): MethodConfigName { - if (!('service' in obj) || typeof obj.service !== 'string') { - throw new Error('Invalid method config name: invalid service'); - } - const result: MethodConfigName = { - service: obj.service, - }; - if ('method' in obj) { - if (typeof obj.method === 'string') { - result.method = obj.method; - } else { - throw new Error('Invalid method config name: invalid method'); - } - } - return result; -} - -function validateMethodConfig(obj: any): MethodConfig { - const result: MethodConfig = { - name: [], - }; - if (!('name' in obj) || !Array.isArray(obj.name)) { - throw new Error('Invalid method config: invalid name array'); - } - for (const name of obj.name) { - result.name.push(validateName(name)); - } - if ('waitForReady' in obj) { - if (typeof obj.waitForReady !== 'boolean') { - throw new Error('Invalid method config: invalid waitForReady'); - } - result.waitForReady = obj.waitForReady; - } - if ('timeout' in obj) { - if (typeof obj.timeout === 'object') { - if ( - !('seconds' in obj.timeout) || - !(typeof obj.timeout.seconds === 'number') - ) { - throw new Error('Invalid method config: invalid timeout.seconds'); - } - if ( - !('nanos' in obj.timeout) || - !(typeof obj.timeout.nanos === 'number') - ) { - throw new Error('Invalid method config: invalid timeout.nanos'); - } - result.timeout = obj.timeout; - } else if ( - typeof obj.timeout === 'string' && - TIMEOUT_REGEX.test(obj.timeout) - ) { - const timeoutParts = obj.timeout - .substring(0, obj.timeout.length - 1) - .split('.'); - result.timeout = { - seconds: timeoutParts[0] | 0, - nanos: (timeoutParts[1] ?? 0) | 0, - }; - } else { - throw new Error('Invalid method config: invalid timeout'); - } - } - if ('maxRequestBytes' in obj) { - if (typeof obj.maxRequestBytes !== 'number') { - throw new Error('Invalid method config: invalid maxRequestBytes'); - } - result.maxRequestBytes = obj.maxRequestBytes; - } - if ('maxResponseBytes' in obj) { - if (typeof obj.maxResponseBytes !== 'number') { - throw new Error('Invalid method config: invalid maxRequestBytes'); - } - result.maxResponseBytes = obj.maxResponseBytes; - } - return result; -} - -export function validateServiceConfig(obj: any): ServiceConfig { - const result: ServiceConfig = { - loadBalancingConfig: [], - methodConfig: [], - }; - if ('loadBalancingPolicy' in obj) { - if (typeof obj.loadBalancingPolicy === 'string') { - result.loadBalancingPolicy = obj.loadBalancingPolicy; - } else { - throw new Error('Invalid service config: invalid loadBalancingPolicy'); - } - } - if ('loadBalancingConfig' in obj) { - if (Array.isArray(obj.loadBalancingConfig)) { - for (const config of obj.loadBalancingConfig) { - result.loadBalancingConfig.push(validateLoadBalancingConfig(config)); - } - } else { - throw new Error('Invalid service config: invalid loadBalancingConfig'); - } - } - if ('methodConfig' in obj) { - if (Array.isArray(obj.methodConfig)) { - for (const methodConfig of obj.methodConfig) { - result.methodConfig.push(validateMethodConfig(methodConfig)); - } - } - } - // Validate method name uniqueness - const seenMethodNames: MethodConfigName[] = []; - for (const methodConfig of result.methodConfig) { - for (const name of methodConfig.name) { - for (const seenName of seenMethodNames) { - if ( - name.service === seenName.service && - name.method === seenName.method - ) { - throw new Error( - `Invalid service config: duplicate name ${name.service}/${name.method}` - ); - } - } - seenMethodNames.push(name); - } - } - return result; -} - -function validateCanaryConfig(obj: any): ServiceConfigCanaryConfig { - if (!('serviceConfig' in obj)) { - throw new Error('Invalid service config choice: missing service config'); - } - const result: ServiceConfigCanaryConfig = { - serviceConfig: validateServiceConfig(obj.serviceConfig), - }; - if ('clientLanguage' in obj) { - if (Array.isArray(obj.clientLanguage)) { - result.clientLanguage = []; - for (const lang of obj.clientLanguage) { - if (typeof lang === 'string') { - result.clientLanguage.push(lang); - } else { - throw new Error( - 'Invalid service config choice: invalid clientLanguage' - ); - } - } - } else { - throw new Error('Invalid service config choice: invalid clientLanguage'); - } - } - if ('clientHostname' in obj) { - if (Array.isArray(obj.clientHostname)) { - result.clientHostname = []; - for (const lang of obj.clientHostname) { - if (typeof lang === 'string') { - result.clientHostname.push(lang); - } else { - throw new Error( - 'Invalid service config choice: invalid clientHostname' - ); - } - } - } else { - throw new Error('Invalid service config choice: invalid clientHostname'); - } - } - if ('percentage' in obj) { - if ( - typeof obj.percentage === 'number' && - 0 <= obj.percentage && - obj.percentage <= 100 - ) { - result.percentage = obj.percentage; - } else { - throw new Error('Invalid service config choice: invalid percentage'); - } - } - // Validate that no unexpected fields are present - const allowedFields = [ - 'clientLanguage', - 'percentage', - 'clientHostname', - 'serviceConfig', - ]; - for (const field in obj) { - if (!allowedFields.includes(field)) { - throw new Error( - `Invalid service config choice: unexpected field ${field}` - ); - } - } - return result; -} - -function validateAndSelectCanaryConfig( - obj: any, - percentage: number -): ServiceConfig { - if (!Array.isArray(obj)) { - throw new Error('Invalid service config list'); - } - for (const config of obj) { - const validatedConfig = validateCanaryConfig(config); - /* For each field, we check if it is present, then only discard the - * config if the field value does not match the current client */ - if ( - typeof validatedConfig.percentage === 'number' && - percentage > validatedConfig.percentage - ) { - continue; - } - if (Array.isArray(validatedConfig.clientHostname)) { - let hostnameMatched = false; - for (const hostname of validatedConfig.clientHostname) { - if (hostname === os.hostname()) { - hostnameMatched = true; - } - } - if (!hostnameMatched) { - continue; - } - } - if (Array.isArray(validatedConfig.clientLanguage)) { - let languageMatched = false; - for (const language of validatedConfig.clientLanguage) { - if (language === CLIENT_LANGUAGE_STRING) { - languageMatched = true; - } - } - if (!languageMatched) { - continue; - } - } - return validatedConfig.serviceConfig; - } - throw new Error('No matching service config found'); -} - -/** - * Find the "grpc_config" record among the TXT records, parse its value as JSON, validate its contents, - * and select a service config with selection fields that all match this client. Most of these steps - * can fail with an error; the caller must handle any errors thrown this way. - * @param txtRecord The TXT record array that is output from a successful call to dns.resolveTxt - * @param percentage A number chosen from the range [0, 100) that is used to select which config to use - * @return The service configuration to use, given the percentage value, or null if the service config - * data has a valid format but none of the options match the current client. - */ -export function extractAndSelectServiceConfig( - txtRecord: string[][], - percentage: number -): ServiceConfig | null { - for (const record of txtRecord) { - if (record.length > 0 && record[0].startsWith('grpc_config=')) { - /* Treat the list of strings in this record as a single string and remove - * "grpc_config=" from the beginning. The rest should be a JSON string */ - const recordString = record.join('').substring('grpc_config='.length); - const recordJson: any = JSON.parse(recordString); - return validateAndSelectCanaryConfig(recordJson, percentage); - } - } - return null; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/status-builder.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/status-builder.ts deleted file mode 100644 index 1109af1a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/status-builder.ts +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright 2019 gRPC authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -import { StatusObject } from './call-stream'; -import { Status } from './constants'; -import { Metadata } from './metadata'; - -/** - * A builder for gRPC status objects. - */ -export class StatusBuilder { - private code: Status | null; - private details: string | null; - private metadata: Metadata | null; - - constructor() { - this.code = null; - this.details = null; - this.metadata = null; - } - - /** - * Adds a status code to the builder. - */ - withCode(code: Status): this { - this.code = code; - return this; - } - - /** - * Adds details to the builder. - */ - withDetails(details: string): this { - this.details = details; - return this; - } - - /** - * Adds metadata to the builder. - */ - withMetadata(metadata: Metadata): this { - this.metadata = metadata; - return this; - } - - /** - * Builds the status object. - */ - build(): Partial { - const status: Partial = {}; - - if (this.code !== null) { - status.code = this.code; - } - - if (this.details !== null) { - status.details = this.details; - } - - if (this.metadata !== null) { - status.metadata = this.metadata; - } - - return status; - } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/stream-decoder.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/stream-decoder.ts deleted file mode 100644 index 671ad41a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/stream-decoder.ts +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Copyright 2019 gRPC authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -enum ReadState { - NO_DATA, - READING_SIZE, - READING_MESSAGE, -} - -export class StreamDecoder { - private readState: ReadState = ReadState.NO_DATA; - private readCompressFlag: Buffer = Buffer.alloc(1); - private readPartialSize: Buffer = Buffer.alloc(4); - private readSizeRemaining = 4; - private readMessageSize = 0; - private readPartialMessage: Buffer[] = []; - private readMessageRemaining = 0; - - write(data: Buffer): Buffer[] { - let readHead = 0; - let toRead: number; - const result: Buffer[] = []; - - while (readHead < data.length) { - switch (this.readState) { - case ReadState.NO_DATA: - this.readCompressFlag = data.slice(readHead, readHead + 1); - readHead += 1; - this.readState = ReadState.READING_SIZE; - this.readPartialSize.fill(0); - this.readSizeRemaining = 4; - this.readMessageSize = 0; - this.readMessageRemaining = 0; - this.readPartialMessage = []; - break; - case ReadState.READING_SIZE: - toRead = Math.min(data.length - readHead, this.readSizeRemaining); - data.copy( - this.readPartialSize, - 4 - this.readSizeRemaining, - readHead, - readHead + toRead - ); - this.readSizeRemaining -= toRead; - readHead += toRead; - // readSizeRemaining >=0 here - if (this.readSizeRemaining === 0) { - this.readMessageSize = this.readPartialSize.readUInt32BE(0); - this.readMessageRemaining = this.readMessageSize; - if (this.readMessageRemaining > 0) { - this.readState = ReadState.READING_MESSAGE; - } else { - const message = Buffer.concat( - [this.readCompressFlag, this.readPartialSize], - 5 - ); - - this.readState = ReadState.NO_DATA; - result.push(message); - } - } - break; - case ReadState.READING_MESSAGE: - toRead = Math.min(data.length - readHead, this.readMessageRemaining); - this.readPartialMessage.push(data.slice(readHead, readHead + toRead)); - this.readMessageRemaining -= toRead; - readHead += toRead; - // readMessageRemaining >=0 here - if (this.readMessageRemaining === 0) { - // At this point, we have read a full message - const framedMessageBuffers = [ - this.readCompressFlag, - this.readPartialSize, - ].concat(this.readPartialMessage); - const framedMessage = Buffer.concat( - framedMessageBuffers, - this.readMessageSize + 5 - ); - - this.readState = ReadState.NO_DATA; - result.push(framedMessage); - } - break; - default: - throw new Error('Unexpected read state'); - } - } - - return result; - } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/subchannel-address.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/subchannel-address.ts deleted file mode 100644 index 29022caa..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/subchannel-address.ts +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright 2021 gRPC authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -import { isIP } from "net"; - -export interface TcpSubchannelAddress { - port: number; - host: string; -} - -export interface IpcSubchannelAddress { - path: string; -} -/** - * This represents a single backend address to connect to. This interface is a - * subset of net.SocketConnectOpts, i.e. the options described at - * https://nodejs.org/api/net.html#net_socket_connect_options_connectlistener. - * Those are in turn a subset of the options that can be passed to http2.connect. - */ - -export type SubchannelAddress = TcpSubchannelAddress | IpcSubchannelAddress; - -export function isTcpSubchannelAddress( - address: SubchannelAddress -): address is TcpSubchannelAddress { - return 'port' in address; -} - -export function subchannelAddressEqual( - address1: SubchannelAddress, - address2: SubchannelAddress -): boolean { - if (isTcpSubchannelAddress(address1)) { - return ( - isTcpSubchannelAddress(address2) && - address1.host === address2.host && - address1.port === address2.port - ); - } else { - return !isTcpSubchannelAddress(address2) && address1.path === address2.path; - } -} - -export function subchannelAddressToString(address: SubchannelAddress): string { - if (isTcpSubchannelAddress(address)) { - return address.host + ':' + address.port; - } else { - return address.path; - } -} - -const DEFAULT_PORT = 443; - -export function stringToSubchannelAddress(addressString: string, port?: number): SubchannelAddress { - if (isIP(addressString)) { - return { - host: addressString, - port: port ?? DEFAULT_PORT - }; - } else { - return { - path: addressString - }; - } -} \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/subchannel-interface.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/subchannel-interface.ts deleted file mode 100644 index 082a8b3c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/subchannel-interface.ts +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright 2022 gRPC authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -import { SubchannelRef } from "./channelz"; -import { ConnectivityState } from "./connectivity-state"; -import { Subchannel } from "./subchannel"; - -export type ConnectivityStateListener = ( - subchannel: SubchannelInterface, - previousState: ConnectivityState, - newState: ConnectivityState -) => void; - -/** - * This is an interface for load balancing policies to use to interact with - * subchannels. This allows load balancing policies to wrap and unwrap - * subchannels. - * - * Any load balancing policy that wraps subchannels must unwrap the subchannel - * in the picker, so that other load balancing policies consistently have - * access to their own wrapper objects. - */ -export interface SubchannelInterface { - getConnectivityState(): ConnectivityState; - addConnectivityStateListener(listener: ConnectivityStateListener): void; - removeConnectivityStateListener(listener: ConnectivityStateListener): void; - startConnecting(): void; - getAddress(): string; - ref(): void; - unref(): void; - getChannelzRef(): SubchannelRef; - /** - * If this is a wrapper, return the wrapped subchannel, otherwise return this - */ - getRealSubchannel(): Subchannel; -} - -export abstract class BaseSubchannelWrapper implements SubchannelInterface { - constructor(protected child: SubchannelInterface) {} - - getConnectivityState(): ConnectivityState { - return this.child.getConnectivityState(); - } - addConnectivityStateListener(listener: ConnectivityStateListener): void { - this.child.addConnectivityStateListener(listener); - } - removeConnectivityStateListener(listener: ConnectivityStateListener): void { - this.child.removeConnectivityStateListener(listener); - } - startConnecting(): void { - this.child.startConnecting(); - } - getAddress(): string { - return this.child.getAddress(); - } - ref(): void { - this.child.ref(); - } - unref(): void { - this.child.unref(); - } - getChannelzRef(): SubchannelRef { - return this.child.getChannelzRef(); - } - getRealSubchannel(): Subchannel { - return this.child.getRealSubchannel(); - } -} \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/subchannel-pool.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/subchannel-pool.ts deleted file mode 100644 index b7ef362c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/subchannel-pool.ts +++ /dev/null @@ -1,174 +0,0 @@ -/* - * Copyright 2019 gRPC authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -import { ChannelOptions, channelOptionsEqual } from './channel-options'; -import { Subchannel } from './subchannel'; -import { - SubchannelAddress, - subchannelAddressEqual, -} from './subchannel-address'; -import { ChannelCredentials } from './channel-credentials'; -import { GrpcUri, uriToString } from './uri-parser'; - -// 10 seconds in milliseconds. This value is arbitrary. -/** - * The amount of time in between checks for dropping subchannels that have no - * other references - */ -const REF_CHECK_INTERVAL = 10_000; - -export class SubchannelPool { - private pool: { - [channelTarget: string]: Array<{ - subchannelAddress: SubchannelAddress; - channelArguments: ChannelOptions; - channelCredentials: ChannelCredentials; - subchannel: Subchannel; - }>; - } = Object.create(null); - - /** - * A timer of a task performing a periodic subchannel cleanup. - */ - private cleanupTimer: NodeJS.Timer | null = null; - - /** - * A pool of subchannels use for making connections. Subchannels with the - * exact same parameters will be reused. - */ - constructor() {} - - /** - * Unrefs all unused subchannels and cancels the cleanup task if all - * subchannels have been unrefed. - */ - unrefUnusedSubchannels(): void { - let allSubchannelsUnrefed = true; - - /* These objects are created with Object.create(null), so they do not - * have a prototype, which means that for (... in ...) loops over them - * do not need to be filtered */ - // eslint-disable-disable-next-line:forin - for (const channelTarget in this.pool) { - const subchannelObjArray = this.pool[channelTarget]; - - const refedSubchannels = subchannelObjArray.filter( - (value) => !value.subchannel.unrefIfOneRef() - ); - - if (refedSubchannels.length > 0) { - allSubchannelsUnrefed = false; - } - - /* For each subchannel in the pool, try to unref it if it has - * exactly one ref (which is the ref from the pool itself). If that - * does happen, remove the subchannel from the pool */ - this.pool[channelTarget] = refedSubchannels; - } - /* Currently we do not delete keys with empty values. If that results - * in significant memory usage we should change it. */ - - // Cancel the cleanup task if all subchannels have been unrefed. - if (allSubchannelsUnrefed && this.cleanupTimer !== null) { - clearInterval(this.cleanupTimer); - this.cleanupTimer = null; - } - } - - /** - * Ensures that the cleanup task is spawned. - */ - ensureCleanupTask(): void { - if (this.cleanupTimer === null) { - this.cleanupTimer = setInterval(() => { - this.unrefUnusedSubchannels(); - }, REF_CHECK_INTERVAL); - - // Unref because this timer should not keep the event loop running. - // Call unref only if it exists to address electron/electron#21162 - this.cleanupTimer.unref?.(); - } - } - - /** - * Get a subchannel if one already exists with exactly matching parameters. - * Otherwise, create and save a subchannel with those parameters. - * @param channelTarget - * @param subchannelTarget - * @param channelArguments - * @param channelCredentials - */ - getOrCreateSubchannel( - channelTargetUri: GrpcUri, - subchannelTarget: SubchannelAddress, - channelArguments: ChannelOptions, - channelCredentials: ChannelCredentials - ): Subchannel { - this.ensureCleanupTask(); - const channelTarget = uriToString(channelTargetUri); - if (channelTarget in this.pool) { - const subchannelObjArray = this.pool[channelTarget]; - for (const subchannelObj of subchannelObjArray) { - if ( - subchannelAddressEqual( - subchannelTarget, - subchannelObj.subchannelAddress - ) && - channelOptionsEqual( - channelArguments, - subchannelObj.channelArguments - ) && - channelCredentials._equals(subchannelObj.channelCredentials) - ) { - return subchannelObj.subchannel; - } - } - } - // If we get here, no matching subchannel was found - const subchannel = new Subchannel( - channelTargetUri, - subchannelTarget, - channelArguments, - channelCredentials - ); - if (!(channelTarget in this.pool)) { - this.pool[channelTarget] = []; - } - this.pool[channelTarget].push({ - subchannelAddress: subchannelTarget, - channelArguments, - channelCredentials, - subchannel, - }); - subchannel.ref(); - return subchannel; - } -} - -const globalSubchannelPool = new SubchannelPool(); - -/** - * Get either the global subchannel pool, or a new subchannel pool. - * @param global - */ -export function getSubchannelPool(global: boolean): SubchannelPool { - if (global) { - return globalSubchannelPool; - } else { - return new SubchannelPool(); - } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/subchannel.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/subchannel.ts deleted file mode 100644 index 87c0cd2c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/subchannel.ts +++ /dev/null @@ -1,1012 +0,0 @@ -/* - * Copyright 2019 gRPC authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -import * as http2 from 'http2'; -import { ChannelCredentials } from './channel-credentials'; -import { Metadata } from './metadata'; -import { Call, Http2CallStream, WriteObject } from './call-stream'; -import { ChannelOptions } from './channel-options'; -import { PeerCertificate, checkServerIdentity, TLSSocket, CipherNameAndProtocol } from 'tls'; -import { ConnectivityState } from './connectivity-state'; -import { BackoffTimeout, BackoffOptions } from './backoff-timeout'; -import { getDefaultAuthority } from './resolver'; -import * as logging from './logging'; -import { LogVerbosity, Status } from './constants'; -import { getProxiedConnection, ProxyConnectionResult } from './http_proxy'; -import * as net from 'net'; -import { GrpcUri, parseUri, splitHostPort, uriToString } from './uri-parser'; -import { ConnectionOptions } from 'tls'; -import { FilterFactory, Filter, BaseFilter } from './filter'; -import { - stringToSubchannelAddress, - SubchannelAddress, - subchannelAddressToString, -} from './subchannel-address'; -import { SubchannelRef, ChannelzTrace, ChannelzChildrenTracker, SubchannelInfo, registerChannelzSubchannel, ChannelzCallTracker, SocketInfo, SocketRef, unregisterChannelzRef, registerChannelzSocket, TlsInfo } from './channelz'; -import { ConnectivityStateListener } from './subchannel-interface'; - -const clientVersion = require('../../package.json').version; - -const TRACER_NAME = 'subchannel'; -const FLOW_CONTROL_TRACER_NAME = 'subchannel_flowctrl'; - -const MIN_CONNECT_TIMEOUT_MS = 20000; -const INITIAL_BACKOFF_MS = 1000; -const BACKOFF_MULTIPLIER = 1.6; -const MAX_BACKOFF_MS = 120000; -const BACKOFF_JITTER = 0.2; - -/* setInterval and setTimeout only accept signed 32 bit integers. JS doesn't - * have a constant for the max signed 32 bit integer, so this is a simple way - * to calculate it */ -const KEEPALIVE_MAX_TIME_MS = ~(1 << 31); -const KEEPALIVE_TIMEOUT_MS = 20000; - -export interface SubchannelCallStatsTracker { - addMessageSent(): void; - addMessageReceived(): void; -} - -const { - HTTP2_HEADER_AUTHORITY, - HTTP2_HEADER_CONTENT_TYPE, - HTTP2_HEADER_METHOD, - HTTP2_HEADER_PATH, - HTTP2_HEADER_TE, - HTTP2_HEADER_USER_AGENT, -} = http2.constants; - -/** - * Get a number uniformly at random in the range [min, max) - * @param min - * @param max - */ -function uniformRandom(min: number, max: number) { - return Math.random() * (max - min) + min; -} - -const tooManyPingsData: Buffer = Buffer.from('too_many_pings', 'ascii'); - -export class Subchannel { - /** - * The subchannel's current connectivity state. Invariant: `session` === `null` - * if and only if `connectivityState` is IDLE or TRANSIENT_FAILURE. - */ - private connectivityState: ConnectivityState = ConnectivityState.IDLE; - /** - * The underlying http2 session used to make requests. - */ - private session: http2.ClientHttp2Session | null = null; - /** - * Indicates that the subchannel should transition from TRANSIENT_FAILURE to - * CONNECTING instead of IDLE when the backoff timeout ends. - */ - private continueConnecting = false; - /** - * A list of listener functions that will be called whenever the connectivity - * state changes. Will be modified by `addConnectivityStateListener` and - * `removeConnectivityStateListener` - */ - private stateListeners: ConnectivityStateListener[] = []; - - /** - * A list of listener functions that will be called when the underlying - * socket disconnects. Used for ending active calls with an UNAVAILABLE - * status. - */ - private disconnectListeners: Set<() => void> = new Set(); - - private backoffTimeout: BackoffTimeout; - - /** - * The complete user agent string constructed using channel args. - */ - private userAgent: string; - - /** - * The amount of time in between sending pings - */ - private keepaliveTimeMs: number = KEEPALIVE_MAX_TIME_MS; - /** - * The amount of time to wait for an acknowledgement after sending a ping - */ - private keepaliveTimeoutMs: number = KEEPALIVE_TIMEOUT_MS; - /** - * Timer reference for timeout that indicates when to send the next ping - */ - private keepaliveIntervalId: NodeJS.Timer; - /** - * Timer reference tracking when the most recent ping will be considered lost - */ - private keepaliveTimeoutId: NodeJS.Timer; - /** - * Indicates whether keepalive pings should be sent without any active calls - */ - private keepaliveWithoutCalls = false; - - /** - * Tracks calls with references to this subchannel - */ - private callRefcount = 0; - /** - * Tracks channels and subchannel pools with references to this subchannel - */ - private refcount = 0; - - /** - * A string representation of the subchannel address, for logging/tracing - */ - private subchannelAddressString: string; - - // Channelz info - private readonly channelzEnabled: boolean = true; - private channelzRef: SubchannelRef; - private channelzTrace: ChannelzTrace; - private callTracker = new ChannelzCallTracker(); - private childrenTracker = new ChannelzChildrenTracker(); - - // Channelz socket info - private channelzSocketRef: SocketRef | null = null; - /** - * Name of the remote server, if it is not the same as the subchannel - * address, i.e. if connecting through an HTTP CONNECT proxy. - */ - private remoteName: string | null = null; - private streamTracker = new ChannelzCallTracker(); - private keepalivesSent = 0; - private messagesSent = 0; - private messagesReceived = 0; - private lastMessageSentTimestamp: Date | null = null; - private lastMessageReceivedTimestamp: Date | null = null; - - /** - * A class representing a connection to a single backend. - * @param channelTarget The target string for the channel as a whole - * @param subchannelAddress The address for the backend that this subchannel - * will connect to - * @param options The channel options, plus any specific subchannel options - * for this subchannel - * @param credentials The channel credentials used to establish this - * connection - */ - constructor( - private channelTarget: GrpcUri, - private subchannelAddress: SubchannelAddress, - private options: ChannelOptions, - private credentials: ChannelCredentials - ) { - // Build user-agent string. - this.userAgent = [ - options['grpc.primary_user_agent'], - `grpc-node-js/${clientVersion}`, - options['grpc.secondary_user_agent'], - ] - .filter((e) => e) - .join(' '); // remove falsey values first - - if ('grpc.keepalive_time_ms' in options) { - this.keepaliveTimeMs = options['grpc.keepalive_time_ms']!; - } - if ('grpc.keepalive_timeout_ms' in options) { - this.keepaliveTimeoutMs = options['grpc.keepalive_timeout_ms']!; - } - if ('grpc.keepalive_permit_without_calls' in options) { - this.keepaliveWithoutCalls = - options['grpc.keepalive_permit_without_calls'] === 1; - } else { - this.keepaliveWithoutCalls = false; - } - this.keepaliveIntervalId = setTimeout(() => {}, 0); - clearTimeout(this.keepaliveIntervalId); - this.keepaliveTimeoutId = setTimeout(() => {}, 0); - clearTimeout(this.keepaliveTimeoutId); - const backoffOptions: BackoffOptions = { - initialDelay: options['grpc.initial_reconnect_backoff_ms'], - maxDelay: options['grpc.max_reconnect_backoff_ms'], - }; - this.backoffTimeout = new BackoffTimeout(() => { - this.handleBackoffTimer(); - }, backoffOptions); - this.subchannelAddressString = subchannelAddressToString(subchannelAddress); - - if (options['grpc.enable_channelz'] === 0) { - this.channelzEnabled = false; - } - this.channelzTrace = new ChannelzTrace(); - this.channelzRef = registerChannelzSubchannel(this.subchannelAddressString, () => this.getChannelzInfo(), this.channelzEnabled); - if (this.channelzEnabled) { - this.channelzTrace.addTrace('CT_INFO', 'Subchannel created'); - } - this.trace('Subchannel constructed with options ' + JSON.stringify(options, undefined, 2)); - } - - private getChannelzInfo(): SubchannelInfo { - return { - state: this.connectivityState, - trace: this.channelzTrace, - callTracker: this.callTracker, - children: this.childrenTracker.getChildLists(), - target: this.subchannelAddressString - }; - } - - private getChannelzSocketInfo(): SocketInfo | null { - if (this.session === null) { - return null; - } - const sessionSocket = this.session.socket; - const remoteAddress = sessionSocket.remoteAddress ? stringToSubchannelAddress(sessionSocket.remoteAddress, sessionSocket.remotePort) : null; - const localAddress = sessionSocket.localAddress ? stringToSubchannelAddress(sessionSocket.localAddress, sessionSocket.localPort) : null; - let tlsInfo: TlsInfo | null; - if (this.session.encrypted) { - const tlsSocket: TLSSocket = sessionSocket as TLSSocket; - const cipherInfo: CipherNameAndProtocol & {standardName?: string} = tlsSocket.getCipher(); - const certificate = tlsSocket.getCertificate(); - const peerCertificate = tlsSocket.getPeerCertificate(); - tlsInfo = { - cipherSuiteStandardName: cipherInfo.standardName ?? null, - cipherSuiteOtherName: cipherInfo.standardName ? null : cipherInfo.name, - localCertificate: (certificate && 'raw' in certificate) ? certificate.raw : null, - remoteCertificate: (peerCertificate && 'raw' in peerCertificate) ? peerCertificate.raw : null - }; - } else { - tlsInfo = null; - } - const socketInfo: SocketInfo = { - remoteAddress: remoteAddress, - localAddress: localAddress, - security: tlsInfo, - remoteName: this.remoteName, - streamsStarted: this.streamTracker.callsStarted, - streamsSucceeded: this.streamTracker.callsSucceeded, - streamsFailed: this.streamTracker.callsFailed, - messagesSent: this.messagesSent, - messagesReceived: this.messagesReceived, - keepAlivesSent: this.keepalivesSent, - lastLocalStreamCreatedTimestamp: this.streamTracker.lastCallStartedTimestamp, - lastRemoteStreamCreatedTimestamp: null, - lastMessageSentTimestamp: this.lastMessageSentTimestamp, - lastMessageReceivedTimestamp: this.lastMessageReceivedTimestamp, - localFlowControlWindow: this.session.state.localWindowSize ?? null, - remoteFlowControlWindow: this.session.state.remoteWindowSize ?? null - }; - return socketInfo; - } - - private resetChannelzSocketInfo() { - if (!this.channelzEnabled) { - return; - } - if (this.channelzSocketRef) { - unregisterChannelzRef(this.channelzSocketRef); - this.childrenTracker.unrefChild(this.channelzSocketRef); - this.channelzSocketRef = null; - } - this.remoteName = null; - this.streamTracker = new ChannelzCallTracker(); - this.keepalivesSent = 0; - this.messagesSent = 0; - this.messagesReceived = 0; - this.lastMessageSentTimestamp = null; - this.lastMessageReceivedTimestamp = null; - } - - private trace(text: string): void { - logging.trace(LogVerbosity.DEBUG, TRACER_NAME, '(' + this.channelzRef.id + ') ' + this.subchannelAddressString + ' ' + text); - } - - private refTrace(text: string): void { - logging.trace(LogVerbosity.DEBUG, 'subchannel_refcount', '(' + this.channelzRef.id + ') ' + this.subchannelAddressString + ' ' + text); - } - - private flowControlTrace(text: string): void { - logging.trace(LogVerbosity.DEBUG, FLOW_CONTROL_TRACER_NAME, '(' + this.channelzRef.id + ') ' + this.subchannelAddressString + ' ' + text); - } - - private internalsTrace(text: string): void { - logging.trace(LogVerbosity.DEBUG, 'subchannel_internals', '(' + this.channelzRef.id + ') ' + this.subchannelAddressString + ' ' + text); - } - - private keepaliveTrace(text: string): void { - logging.trace(LogVerbosity.DEBUG, 'keepalive', '(' + this.channelzRef.id + ') ' + this.subchannelAddressString + ' ' + text); - } - - private handleBackoffTimer() { - if (this.continueConnecting) { - this.transitionToState( - [ConnectivityState.TRANSIENT_FAILURE], - ConnectivityState.CONNECTING - ); - } else { - this.transitionToState( - [ConnectivityState.TRANSIENT_FAILURE], - ConnectivityState.IDLE - ); - } - } - - /** - * Start a backoff timer with the current nextBackoff timeout - */ - private startBackoff() { - this.backoffTimeout.runOnce(); - } - - private stopBackoff() { - this.backoffTimeout.stop(); - this.backoffTimeout.reset(); - } - - private sendPing() { - if (this.channelzEnabled) { - this.keepalivesSent += 1; - } - this.keepaliveTrace('Sending ping with timeout ' + this.keepaliveTimeoutMs + 'ms'); - this.keepaliveTimeoutId = setTimeout(() => { - this.keepaliveTrace('Ping timeout passed without response'); - this.handleDisconnect(); - }, this.keepaliveTimeoutMs); - this.keepaliveTimeoutId.unref?.(); - try { - this.session!.ping( - (err: Error | null, duration: number, payload: Buffer) => { - this.keepaliveTrace('Received ping response'); - clearTimeout(this.keepaliveTimeoutId); - } - ); - } catch (e) { - /* If we fail to send a ping, the connection is no longer functional, so - * we should discard it. */ - this.transitionToState( - [ConnectivityState.READY], - ConnectivityState.TRANSIENT_FAILURE - ); - } - } - - private startKeepalivePings() { - this.keepaliveIntervalId = setInterval(() => { - this.sendPing(); - }, this.keepaliveTimeMs); - this.keepaliveIntervalId.unref?.(); - /* Don't send a ping immediately because whatever caused us to start - * sending pings should also involve some network activity. */ - } - - /** - * Stop keepalive pings when terminating a connection. This discards the - * outstanding ping timeout, so it should not be called if the same - * connection will still be used. - */ - private stopKeepalivePings() { - clearInterval(this.keepaliveIntervalId); - clearTimeout(this.keepaliveTimeoutId); - } - - private createSession(proxyConnectionResult: ProxyConnectionResult) { - if (proxyConnectionResult.realTarget) { - this.remoteName = uriToString(proxyConnectionResult.realTarget); - this.trace('creating HTTP/2 session through proxy to ' + proxyConnectionResult.realTarget); - } else { - this.remoteName = null; - this.trace('creating HTTP/2 session'); - } - const targetAuthority = getDefaultAuthority( - proxyConnectionResult.realTarget ?? this.channelTarget - ); - let connectionOptions: http2.SecureClientSessionOptions = - this.credentials._getConnectionOptions() || {}; - connectionOptions.maxSendHeaderBlockLength = Number.MAX_SAFE_INTEGER; - if ('grpc-node.max_session_memory' in this.options) { - connectionOptions.maxSessionMemory = this.options[ - 'grpc-node.max_session_memory' - ]; - } else { - /* By default, set a very large max session memory limit, to effectively - * disable enforcement of the limit. Some testing indicates that Node's - * behavior degrades badly when this limit is reached, so we solve that - * by disabling the check entirely. */ - connectionOptions.maxSessionMemory = Number.MAX_SAFE_INTEGER; - } - let addressScheme = 'http://'; - if ('secureContext' in connectionOptions) { - addressScheme = 'https://'; - // If provided, the value of grpc.ssl_target_name_override should be used - // to override the target hostname when checking server identity. - // This option is used for testing only. - if (this.options['grpc.ssl_target_name_override']) { - const sslTargetNameOverride = this.options[ - 'grpc.ssl_target_name_override' - ]!; - connectionOptions.checkServerIdentity = ( - host: string, - cert: PeerCertificate - ): Error | undefined => { - return checkServerIdentity(sslTargetNameOverride, cert); - }; - connectionOptions.servername = sslTargetNameOverride; - } else { - const authorityHostname = - splitHostPort(targetAuthority)?.host ?? 'localhost'; - // We want to always set servername to support SNI - connectionOptions.servername = authorityHostname; - } - if (proxyConnectionResult.socket) { - /* This is part of the workaround for - * https://github.com/nodejs/node/issues/32922. Without that bug, - * proxyConnectionResult.socket would always be a plaintext socket and - * this would say - * connectionOptions.socket = proxyConnectionResult.socket; */ - connectionOptions.createConnection = (authority, option) => { - return proxyConnectionResult.socket!; - }; - } - } else { - /* In all but the most recent versions of Node, http2.connect does not use - * the options when establishing plaintext connections, so we need to - * establish that connection explicitly. */ - connectionOptions.createConnection = (authority, option) => { - if (proxyConnectionResult.socket) { - return proxyConnectionResult.socket; - } else { - /* net.NetConnectOpts is declared in a way that is more restrictive - * than what net.connect will actually accept, so we use the type - * assertion to work around that. */ - return net.connect(this.subchannelAddress); - } - }; - } - - connectionOptions = { - ...connectionOptions, - ...this.subchannelAddress, - }; - - /* http2.connect uses the options here: - * https://github.com/nodejs/node/blob/70c32a6d190e2b5d7b9ff9d5b6a459d14e8b7d59/lib/internal/http2/core.js#L3028-L3036 - * The spread operator overides earlier values with later ones, so any port - * or host values in the options will be used rather than any values extracted - * from the first argument. In addition, the path overrides the host and port, - * as documented for plaintext connections here: - * https://nodejs.org/api/net.html#net_socket_connect_options_connectlistener - * and for TLS connections here: - * https://nodejs.org/api/tls.html#tls_tls_connect_options_callback. In - * earlier versions of Node, http2.connect passes these options to - * tls.connect but not net.connect, so in the insecure case we still need - * to set the createConnection option above to create the connection - * explicitly. We cannot do that in the TLS case because http2.connect - * passes necessary additional options to tls.connect. - * The first argument just needs to be parseable as a URL and the scheme - * determines whether the connection will be established over TLS or not. - */ - const session = http2.connect( - addressScheme + targetAuthority, - connectionOptions - ); - this.session = session; - this.channelzSocketRef = registerChannelzSocket(this.subchannelAddressString, () => this.getChannelzSocketInfo()!, this.channelzEnabled); - if (this.channelzEnabled) { - this.childrenTracker.refChild(this.channelzSocketRef); - } - session.unref(); - /* For all of these events, check if the session at the time of the event - * is the same one currently attached to this subchannel, to ensure that - * old events from previous connection attempts cannot cause invalid state - * transitions. */ - session.once('connect', () => { - if (this.session === session) { - this.transitionToState( - [ConnectivityState.CONNECTING], - ConnectivityState.READY - ); - } - }); - session.once('close', () => { - if (this.session === session) { - this.trace('connection closed'); - this.transitionToState( - [ConnectivityState.CONNECTING], - ConnectivityState.TRANSIENT_FAILURE - ); - /* Transitioning directly to IDLE here should be OK because we are not - * doing any backoff, because a connection was established at some - * point */ - this.transitionToState( - [ConnectivityState.READY], - ConnectivityState.IDLE - ); - } - }); - session.once( - 'goaway', - (errorCode: number, lastStreamID: number, opaqueData: Buffer) => { - if (this.session === session) { - /* See the last paragraph of - * https://github.com/grpc/proposal/blob/master/A8-client-side-keepalive.md#basic-keepalive */ - if ( - errorCode === http2.constants.NGHTTP2_ENHANCE_YOUR_CALM && - opaqueData.equals(tooManyPingsData) - ) { - this.keepaliveTimeMs = Math.min( - 2 * this.keepaliveTimeMs, - KEEPALIVE_MAX_TIME_MS - ); - logging.log( - LogVerbosity.ERROR, - `Connection to ${uriToString(this.channelTarget)} at ${ - this.subchannelAddressString - } rejected by server because of excess pings. Increasing ping interval to ${ - this.keepaliveTimeMs - } ms` - ); - } - this.trace( - 'connection closed by GOAWAY with code ' + - errorCode - ); - this.transitionToState( - [ConnectivityState.CONNECTING, ConnectivityState.READY], - ConnectivityState.IDLE - ); - } - } - ); - session.once('error', (error) => { - /* Do nothing here. Any error should also trigger a close event, which is - * where we want to handle that. */ - this.trace( - 'connection closed with error ' + - (error as Error).message - ); - }); - if (logging.isTracerEnabled(TRACER_NAME)) { - session.on('remoteSettings', (settings: http2.Settings) => { - this.trace( - 'new settings received' + - (this.session !== session ? ' on the old connection' : '') + - ': ' + - JSON.stringify(settings) - ); - }); - session.on('localSettings', (settings: http2.Settings) => { - this.trace( - 'local settings acknowledged by remote' + - (this.session !== session ? ' on the old connection' : '') + - ': ' + - JSON.stringify(settings) - ); - }); - } - } - - private startConnectingInternal() { - /* Pass connection options through to the proxy so that it's able to - * upgrade it's connection to support tls if needed. - * This is a workaround for https://github.com/nodejs/node/issues/32922 - * See https://github.com/grpc/grpc-node/pull/1369 for more info. */ - const connectionOptions: ConnectionOptions = - this.credentials._getConnectionOptions() || {}; - - if ('secureContext' in connectionOptions) { - connectionOptions.ALPNProtocols = ['h2']; - // If provided, the value of grpc.ssl_target_name_override should be used - // to override the target hostname when checking server identity. - // This option is used for testing only. - if (this.options['grpc.ssl_target_name_override']) { - const sslTargetNameOverride = this.options[ - 'grpc.ssl_target_name_override' - ]!; - connectionOptions.checkServerIdentity = ( - host: string, - cert: PeerCertificate - ): Error | undefined => { - return checkServerIdentity(sslTargetNameOverride, cert); - }; - connectionOptions.servername = sslTargetNameOverride; - } else { - if ('grpc.http_connect_target' in this.options) { - /* This is more or less how servername will be set in createSession - * if a connection is successfully established through the proxy. - * If the proxy is not used, these connectionOptions are discarded - * anyway */ - const targetPath = getDefaultAuthority( - parseUri(this.options['grpc.http_connect_target'] as string) ?? { - path: 'localhost', - } - ); - const hostPort = splitHostPort(targetPath); - connectionOptions.servername = hostPort?.host ?? targetPath; - } - } - } - - getProxiedConnection( - this.subchannelAddress, - this.options, - connectionOptions - ).then( - (result) => { - this.createSession(result); - }, - (reason) => { - this.transitionToState( - [ConnectivityState.CONNECTING], - ConnectivityState.TRANSIENT_FAILURE - ); - } - ); - } - - private handleDisconnect() { - this.transitionToState( - [ConnectivityState.READY], - ConnectivityState.TRANSIENT_FAILURE); - for (const listener of this.disconnectListeners.values()) { - listener(); - } - } - - /** - * Initiate a state transition from any element of oldStates to the new - * state. If the current connectivityState is not in oldStates, do nothing. - * @param oldStates The set of states to transition from - * @param newState The state to transition to - * @returns True if the state changed, false otherwise - */ - private transitionToState( - oldStates: ConnectivityState[], - newState: ConnectivityState - ): boolean { - if (oldStates.indexOf(this.connectivityState) === -1) { - return false; - } - this.trace( - ConnectivityState[this.connectivityState] + - ' -> ' + - ConnectivityState[newState] - ); - if (this.channelzEnabled) { - this.channelzTrace.addTrace('CT_INFO', ConnectivityState[this.connectivityState] + ' -> ' + ConnectivityState[newState]); - } - const previousState = this.connectivityState; - this.connectivityState = newState; - switch (newState) { - case ConnectivityState.READY: - this.stopBackoff(); - const session = this.session!; - session.socket.once('close', () => { - if (this.session === session) { - this.handleDisconnect(); - } - }); - if (this.keepaliveWithoutCalls) { - this.startKeepalivePings(); - } - break; - case ConnectivityState.CONNECTING: - this.startBackoff(); - this.startConnectingInternal(); - this.continueConnecting = false; - break; - case ConnectivityState.TRANSIENT_FAILURE: - if (this.session) { - this.session.close(); - } - this.session = null; - this.resetChannelzSocketInfo(); - this.stopKeepalivePings(); - /* If the backoff timer has already ended by the time we get to the - * TRANSIENT_FAILURE state, we want to immediately transition out of - * TRANSIENT_FAILURE as though the backoff timer is ending right now */ - if (!this.backoffTimeout.isRunning()) { - process.nextTick(() => { - this.handleBackoffTimer(); - }); - } - break; - case ConnectivityState.IDLE: - if (this.session) { - this.session.close(); - } - this.session = null; - this.resetChannelzSocketInfo(); - this.stopKeepalivePings(); - break; - default: - throw new Error(`Invalid state: unknown ConnectivityState ${newState}`); - } - /* We use a shallow copy of the stateListeners array in case a listener - * is removed during this iteration */ - for (const listener of [...this.stateListeners]) { - listener(this, previousState, newState); - } - return true; - } - - /** - * Check if the subchannel associated with zero calls and with zero channels. - * If so, shut it down. - */ - private checkBothRefcounts() { - /* If no calls, channels, or subchannel pools have any more references to - * this subchannel, we can be sure it will never be used again. */ - if (this.callRefcount === 0 && this.refcount === 0) { - if (this.channelzEnabled) { - this.channelzTrace.addTrace('CT_INFO', 'Shutting down'); - } - this.transitionToState( - [ConnectivityState.CONNECTING, ConnectivityState.READY], - ConnectivityState.IDLE - ); - if (this.channelzEnabled) { - unregisterChannelzRef(this.channelzRef); - } - } - } - - callRef() { - this.refTrace( - 'callRefcount ' + - this.callRefcount + - ' -> ' + - (this.callRefcount + 1) - ); - if (this.callRefcount === 0) { - if (this.session) { - this.session.ref(); - } - this.backoffTimeout.ref(); - if (!this.keepaliveWithoutCalls) { - this.startKeepalivePings(); - } - } - this.callRefcount += 1; - } - - callUnref() { - this.refTrace( - 'callRefcount ' + - this.callRefcount + - ' -> ' + - (this.callRefcount - 1) - ); - this.callRefcount -= 1; - if (this.callRefcount === 0) { - if (this.session) { - this.session.unref(); - } - this.backoffTimeout.unref(); - if (!this.keepaliveWithoutCalls) { - clearInterval(this.keepaliveIntervalId); - } - this.checkBothRefcounts(); - } - } - - ref() { - this.refTrace( - 'refcount ' + - this.refcount + - ' -> ' + - (this.refcount + 1) - ); - this.refcount += 1; - } - - unref() { - this.refTrace( - 'refcount ' + - this.refcount + - ' -> ' + - (this.refcount - 1) - ); - this.refcount -= 1; - this.checkBothRefcounts(); - } - - unrefIfOneRef(): boolean { - if (this.refcount === 1) { - this.unref(); - return true; - } - return false; - } - - /** - * Start a stream on the current session with the given `metadata` as headers - * and then attach it to the `callStream`. Must only be called if the - * subchannel's current connectivity state is READY. - * @param metadata - * @param callStream - */ - startCallStream( - metadata: Metadata, - callStream: Http2CallStream, - extraFilters: Filter[] - ) { - const headers = metadata.toHttp2Headers(); - headers[HTTP2_HEADER_AUTHORITY] = callStream.getHost(); - headers[HTTP2_HEADER_USER_AGENT] = this.userAgent; - headers[HTTP2_HEADER_CONTENT_TYPE] = 'application/grpc'; - headers[HTTP2_HEADER_METHOD] = 'POST'; - headers[HTTP2_HEADER_PATH] = callStream.getMethod(); - headers[HTTP2_HEADER_TE] = 'trailers'; - let http2Stream: http2.ClientHttp2Stream; - /* In theory, if an error is thrown by session.request because session has - * become unusable (e.g. because it has received a goaway), this subchannel - * should soon see the corresponding close or goaway event anyway and leave - * READY. But we have seen reports that this does not happen - * (https://github.com/googleapis/nodejs-firestore/issues/1023#issuecomment-653204096) - * so for defense in depth, we just discard the session when we see an - * error here. - */ - try { - http2Stream = this.session!.request(headers); - } catch (e) { - this.transitionToState( - [ConnectivityState.READY], - ConnectivityState.TRANSIENT_FAILURE - ); - throw e; - } - let headersString = ''; - for (const header of Object.keys(headers)) { - headersString += '\t\t' + header + ': ' + headers[header] + '\n'; - } - logging.trace( - LogVerbosity.DEBUG, - 'call_stream', - 'Starting stream [' + callStream.getCallNumber() + '] on subchannel ' + - '(' + this.channelzRef.id + ') ' + - this.subchannelAddressString + - ' with headers\n' + - headersString - ); - this.flowControlTrace( - 'local window size: ' + - this.session!.state.localWindowSize + - ' remote window size: ' + - this.session!.state.remoteWindowSize - ); - const streamSession = this.session; - this.internalsTrace( - 'session.closed=' + - streamSession!.closed + - ' session.destroyed=' + - streamSession!.destroyed + - ' session.socket.destroyed=' + - streamSession!.socket.destroyed); - let statsTracker: SubchannelCallStatsTracker; - if (this.channelzEnabled) { - this.callTracker.addCallStarted(); - callStream.addStatusWatcher(status => { - if (status.code === Status.OK) { - this.callTracker.addCallSucceeded(); - } else { - this.callTracker.addCallFailed(); - } - }); - this.streamTracker.addCallStarted(); - callStream.addStreamEndWatcher(success => { - if (streamSession === this.session) { - if (success) { - this.streamTracker.addCallSucceeded(); - } else { - this.streamTracker.addCallFailed(); - } - } - }); - statsTracker = { - addMessageSent: () => { - this.messagesSent += 1; - this.lastMessageSentTimestamp = new Date(); - }, - addMessageReceived: () => { - this.messagesReceived += 1; - } - } - } else { - statsTracker = { - addMessageSent: () => {}, - addMessageReceived: () => {} - } - } - callStream.attachHttp2Stream(http2Stream, this, extraFilters, statsTracker); - } - - /** - * If the subchannel is currently IDLE, start connecting and switch to the - * CONNECTING state. If the subchannel is current in TRANSIENT_FAILURE, - * the next time it would transition to IDLE, start connecting again instead. - * Otherwise, do nothing. - */ - startConnecting() { - /* First, try to transition from IDLE to connecting. If that doesn't happen - * because the state is not currently IDLE, check if it is - * TRANSIENT_FAILURE, and if so indicate that it should go back to - * connecting after the backoff timer ends. Otherwise do nothing */ - if ( - !this.transitionToState( - [ConnectivityState.IDLE], - ConnectivityState.CONNECTING - ) - ) { - if (this.connectivityState === ConnectivityState.TRANSIENT_FAILURE) { - this.continueConnecting = true; - } - } - } - - /** - * Get the subchannel's current connectivity state. - */ - getConnectivityState() { - return this.connectivityState; - } - - /** - * Add a listener function to be called whenever the subchannel's - * connectivity state changes. - * @param listener - */ - addConnectivityStateListener(listener: ConnectivityStateListener) { - this.stateListeners.push(listener); - } - - /** - * Remove a listener previously added with `addConnectivityStateListener` - * @param listener A reference to a function previously passed to - * `addConnectivityStateListener` - */ - removeConnectivityStateListener(listener: ConnectivityStateListener) { - const listenerIndex = this.stateListeners.indexOf(listener); - if (listenerIndex > -1) { - this.stateListeners.splice(listenerIndex, 1); - } - } - - addDisconnectListener(listener: () => void) { - this.disconnectListeners.add(listener); - } - - removeDisconnectListener(listener: () => void) { - this.disconnectListeners.delete(listener); - } - - /** - * Reset the backoff timeout, and immediately start connecting if in backoff. - */ - resetBackoff() { - this.backoffTimeout.reset(); - this.transitionToState( - [ConnectivityState.TRANSIENT_FAILURE], - ConnectivityState.CONNECTING - ); - } - - getAddress(): string { - return this.subchannelAddressString; - } - - getChannelzRef(): SubchannelRef { - return this.channelzRef; - } - - getRealSubchannel(): this { - return this; - } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/tls-helpers.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/tls-helpers.ts deleted file mode 100644 index 3f7a62e7..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/tls-helpers.ts +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright 2019 gRPC authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -import * as fs from 'fs'; - -export const CIPHER_SUITES: string | undefined = - process.env.GRPC_SSL_CIPHER_SUITES; - -const DEFAULT_ROOTS_FILE_PATH = process.env.GRPC_DEFAULT_SSL_ROOTS_FILE_PATH; - -let defaultRootsData: Buffer | null = null; - -export function getDefaultRootsData(): Buffer | null { - if (DEFAULT_ROOTS_FILE_PATH) { - if (defaultRootsData === null) { - defaultRootsData = fs.readFileSync(DEFAULT_ROOTS_FILE_PATH); - } - return defaultRootsData; - } - return null; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/uri-parser.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/uri-parser.ts deleted file mode 100644 index 20c3d53b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/grpc-js/src/uri-parser.ts +++ /dev/null @@ -1,114 +0,0 @@ -/* - * Copyright 2020 gRPC authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -export interface GrpcUri { - scheme?: string; - authority?: string; - path: string; -} - -/* - * The groups correspond to URI parts as follows: - * 1. scheme - * 2. authority - * 3. path - */ -const URI_REGEX = /^(?:([A-Za-z0-9+.-]+):)?(?:\/\/([^/]*)\/)?(.+)$/; - -export function parseUri(uriString: string): GrpcUri | null { - const parsedUri = URI_REGEX.exec(uriString); - if (parsedUri === null) { - return null; - } - return { - scheme: parsedUri[1], - authority: parsedUri[2], - path: parsedUri[3], - }; -} - -export interface HostPort { - host: string; - port?: number; -} - -const NUMBER_REGEX = /^\d+$/; - -export function splitHostPort(path: string): HostPort | null { - if (path.startsWith('[')) { - const hostEnd = path.indexOf(']'); - if (hostEnd === -1) { - return null; - } - const host = path.substring(1, hostEnd); - /* Only an IPv6 address should be in bracketed notation, and an IPv6 - * address should have at least one colon */ - if (host.indexOf(':') === -1) { - return null; - } - if (path.length > hostEnd + 1) { - if (path[hostEnd + 1] === ':') { - const portString = path.substring(hostEnd + 2); - if (NUMBER_REGEX.test(portString)) { - return { - host: host, - port: +portString, - }; - } else { - return null; - } - } else { - return null; - } - } else { - return { - host, - }; - } - } else { - const splitPath = path.split(':'); - /* Exactly one colon means that this is host:port. Zero colons means that - * there is no port. And multiple colons means that this is a bare IPv6 - * address with no port */ - if (splitPath.length === 2) { - if (NUMBER_REGEX.test(splitPath[1])) { - return { - host: splitPath[0], - port: +splitPath[1], - }; - } else { - return null; - } - } else { - return { - host: path, - }; - } - } -} - -export function uriToString(uri: GrpcUri): string { - let result = ''; - if (uri.scheme !== undefined) { - result += uri.scheme + ':'; - } - if (uri.authority !== undefined) { - result += '//' + uri.authority + '/'; - } - result += uri.path; - return result; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/proto-loader/LICENSE b/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/proto-loader/LICENSE deleted file mode 100644 index 8dada3ed..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/proto-loader/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "{}" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright {yyyy} {name of copyright owner} - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/proto-loader/README.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/proto-loader/README.md deleted file mode 100644 index 818f0efd..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/proto-loader/README.md +++ /dev/null @@ -1,124 +0,0 @@ -# gRPC Protobuf Loader - -A utility package for loading `.proto` files for use with gRPC, using the latest Protobuf.js package. -Please refer to [protobuf.js' documentation](https://github.com/dcodeIO/protobuf.js/blob/master/README.md) -to understands its features and limitations. - -## Installation - -```sh -npm install @grpc/proto-loader -``` - -## Usage - -```js -const protoLoader = require('@grpc/proto-loader'); -const grpcLibrary = require('grpc'); -// OR -const grpcLibrary = require('@grpc/grpc-js'); - -protoLoader.load(protoFileName, options).then(packageDefinition => { - const packageObject = grpcLibrary.loadPackageDefinition(packageDefinition); -}); -// OR -const packageDefinition = protoLoader.loadSync(protoFileName, options); -const packageObject = grpcLibrary.loadPackageDefinition(packageDefinition); -``` - -The options parameter is an object that can have the following optional properties: - -| Field name | Valid values | Description -|------------|--------------|------------ -| `keepCase` | `true` or `false` | Preserve field names. The default is to change them to camel case. -| `longs` | `String` or `Number` | The type to use to represent `long` values. Defaults to a `Long` object type. -| `enums` | `String` | The type to use to represent `enum` values. Defaults to the numeric value. -| `bytes` | `Array` or `String` | The type to use to represent `bytes` values. Defaults to `Buffer`. -| `defaults` | `true` or `false` | Set default values on output objects. Defaults to `false`. -| `arrays` | `true` or `false` | Set empty arrays for missing array values even if `defaults` is `false` Defaults to `false`. -| `objects` | `true` or `false` | Set empty objects for missing object values even if `defaults` is `false` Defaults to `false`. -| `oneofs` | `true` or `false` | Set virtual oneof properties to the present field's name. Defaults to `false`. -| `json` | `true` or `false` | Represent `Infinity` and `NaN` as strings in `float` fields, and automatically decode `google.protobuf.Any` values. Defaults to `false` -| `includeDirs` | An array of strings | A list of search paths for imported `.proto` files. - -The following options object closely approximates the existing behavior of `grpc.load`: - -```js -const options = { - keepCase: true, - longs: String, - enums: String, - defaults: true, - oneofs: true -} -``` - -## Generating TypeScript types - -The `proto-loader-gen-types` script distributed with this package can be used to generate TypeScript type information for the objects loaded at runtime. More information about how to use it can be found in [the *@grpc/proto-loader TypeScript Type Generator CLI Tool* proposal document](https://github.com/grpc/proposal/blob/master/L70-node-proto-loader-type-generator.md). The arguments mostly match the `load` function's options; the full usage information is as follows: - -```console -proto-loader-gen-types.js [options] filenames... - -Options: - --help Show help [boolean] - --version Show version number [boolean] - --keepCase Preserve the case of field names - [boolean] [default: false] - --longs The type that should be used to output 64 bit integer - values. Can be String, Number[string] [default: "Long"] - --enums The type that should be used to output enum fields. Can - be String [string] [default: "number"] - --bytes The type that should be used to output bytes fields. - Can be String, Array [string] [default: "Buffer"] - --defaults Output default values for omitted fields - [boolean] [default: false] - --arrays Output default values for omitted repeated fields even - if --defaults is not set [boolean] [default: false] - --objects Output default values for omitted message fields even - if --defaults is not set [boolean] [default: false] - --oneofs Output virtual oneof fields set to the present field's - name [boolean] [default: false] - --json Represent Infinity and NaN as strings in float fields. - Also decode google.protobuf.Any automatically - [boolean] [default: false] - --includeComments Generate doc comments from comments in the original - files [boolean] [default: false] - -I, --includeDirs Directories to search for included files [array] - -O, --outDir Directory in which to output files [string] [required] - --grpcLib The gRPC implementation library that these types will - be used with [string] [required] - --inputTemplate Template for mapping input or "permissive" type names - [string] [default: "%s"] - --outputTemplate Template for mapping output or "restricted" type names - [string] [default: "%s__Output"] -``` - -### Example Usage - -Generate the types: - -```sh -$(npm bin)/proto-loader-gen-types --longs=String --enums=String --defaults --oneofs --grpcLib=@grpc/grpc-js --outDir=proto/ proto/*.proto -``` - -Consume the types: - -```ts -import * as grpc from '@grpc/grpc-js'; -import * as protoLoader from '@grpc/proto-loader'; -import { ProtoGrpcType } from './proto/example'; -import { ExampleHandlers } from './proto/example_package/Example'; - -const exampleServer: ExampleHandlers = { - // server handlers implementation... -}; - -const packageDefinition = protoLoader.loadSync('./proto/example.proto'); -const proto = (grpc.loadPackageDefinition( - packageDefinition -) as unknown) as ProtoGrpcType; - -const server = new grpc.Server(); -server.addService(proto.example_package.Example.service, exampleServer); -``` diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/proto-loader/package.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/proto-loader/package.json deleted file mode 100644 index cae7635f..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@grpc/proto-loader/package.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "name": "@grpc/proto-loader", - "version": "0.7.3", - "author": "Google Inc.", - "contributors": [ - { - "name": "Michael Lumish", - "email": "mlumish@google.com" - } - ], - "description": "gRPC utility library for loading .proto files", - "homepage": "https://grpc.io/", - "main": "build/src/index.js", - "typings": "build/src/index.d.ts", - "scripts": { - "build": "npm run compile", - "clean": "rimraf ./build", - "compile": "tsc -p .", - "format": "clang-format -i -style=\"{Language: JavaScript, BasedOnStyle: Google, ColumnLimit: 80}\" src/*.ts test/*.ts", - "lint": "tslint -c node_modules/google-ts-style/tslint.json -p . -t codeFrame --type-check", - "prepare": "npm run compile", - "test": "gulp test", - "check": "gts check", - "fix": "gts fix", - "pretest": "npm run compile", - "posttest": "npm run check", - "generate-golden": "node ./build/bin/proto-loader-gen-types.js --keepCase --longs=String --enums=String --defaults --oneofs --json --includeComments --inputTemplate=I%s --outputTemplate=O%s -I deps/gapic-showcase/schema/ deps/googleapis/ -O ./golden-generated --grpcLib @grpc/grpc-js google/showcase/v1beta1/echo.proto", - "validate-golden": "rm -rf ./golden-generated-old && mv ./golden-generated/ ./golden-generated-old && npm run generate-golden && diff -rb ./golden-generated ./golden-generated-old" - }, - "repository": { - "type": "git", - "url": "https://github.com/grpc/grpc-node.git" - }, - "license": "Apache-2.0", - "bugs": { - "url": "https://github.com/grpc/grpc-node/issues" - }, - "files": [ - "LICENSE", - "build/src/*.d.ts", - "build/src/*.{js,js.map}", - "build/bin/*.{js,js.map}" - ], - "bin": { - "proto-loader-gen-types": "./build/bin/proto-loader-gen-types.js" - }, - "dependencies": { - "@types/long": "^4.0.1", - "lodash.camelcase": "^4.3.0", - "long": "^4.0.0", - "protobufjs": "^7.0.0", - "yargs": "^16.2.0" - }, - "devDependencies": { - "@types/lodash.camelcase": "^4.3.4", - "@types/mkdirp": "^1.0.1", - "@types/mocha": "^5.2.7", - "@types/node": "^10.17.26", - "@types/yargs": "^16.0.4", - "clang-format": "^1.2.2", - "gts": "^3.1.0", - "rimraf": "^3.0.2", - "typescript": "~4.7.4" - }, - "engines": { - "node": ">=6" - } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@panva/asn1.js/CHANGELOG.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/@panva/asn1.js/CHANGELOG.md deleted file mode 100644 index 83925cf9..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@panva/asn1.js/CHANGELOG.md +++ /dev/null @@ -1,10 +0,0 @@ -# Change Log - -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. - -# 1.0.0 (2020-02-18) - - -### Features - -* fork asn1.js, remove all dependencies, use BigInt instead bn.js ([6d3c518](https://github.com/panva/asn1.js/commit/6d3c5188af42059478f8833b768912cb7b86aceb)) diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@panva/asn1.js/LICENSE b/packages/wyatt_notification_bloc/example/scripts/node_modules/@panva/asn1.js/LICENSE deleted file mode 100644 index 25d0cf1f..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@panva/asn1.js/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -The MIT License (MIT) -Copyright (c) 2020 Filip Skokan - - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE -OR OTHER DEALINGS IN THE SOFTWARE. - diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@panva/asn1.js/README.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/@panva/asn1.js/README.md deleted file mode 100644 index 11d9039f..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@panva/asn1.js/README.md +++ /dev/null @@ -1,83 +0,0 @@ -# ASN1.js - -ASN.1 DER Encoder/Decoder and DSL for Node.js with no dependencies - -## Acknowledgement - -This is a fork of [@indutny's](https://github.com/indutny) `asn.js` library with the following -changes made: - -- all `.int()` returns are native `BigInt` values -- lint using [`standard`](https://github.com/standard/standard) - -## Example - -Define model: - -```js -const asn = require('@panva/asn1.js') - -const Human = asn.define('Human', function () { - this.seq().obj( - this.key('firstName').octstr(), - this.key('lastName').octstr(), - this.key('age').int(), - this.key('gender').enum({ 0: 'male', 1: 'female' }), - this.key('bio').seqof(Bio) - ) -}) - -const Bio = asn.define('Bio', function () { - this.seq().obj( - this.key('time').gentime(), - this.key('description').octstr() - ) -}) -``` - -Encode data: - -```js -const output = Human.encode({ - firstName: 'Thomas', - lastName: 'Anderson', - age: 28, - gender: 'male', - bio: [ - { - time: new Date('31 March 1999').getTime(), - description: 'freedom of mind' - } - ] -}, 'der') -``` - -Decode data: - -```js -const human = Human.decode(output, 'der') -console.log(human) -/* -{ firstName: , - lastName: , - age: 28n, - gender: 'male', - bio: - [ { time: 922820400000, - description: } ] } -*/ -``` - -### Partial decode - -Its possible to parse data without stopping on first error. In order to do it, -you should call: - -```js -const human = Human.decode(output, 'der', { partial: true }) -console.log(human) -/* -{ result: { ... }, - errors: [ ... ] } -*/ -``` diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@panva/asn1.js/lib/asn1.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/@panva/asn1.js/lib/asn1.js deleted file mode 100644 index beff021a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@panva/asn1.js/lib/asn1.js +++ /dev/null @@ -1,13 +0,0 @@ -const { define } = require('./asn1/api') -const base = require('./asn1/base') -const constants = require('./asn1/constants') -const decoders = require('./asn1/decoders') -const encoders = require('./asn1/encoders') - -module.exports = { - base, - constants, - decoders, - define, - encoders -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@panva/asn1.js/lib/asn1/api.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/@panva/asn1.js/lib/asn1/api.js deleted file mode 100644 index 98e791a0..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@panva/asn1.js/lib/asn1/api.js +++ /dev/null @@ -1,51 +0,0 @@ -const { inherits } = require('util') -const encoders = require('./encoders') -const decoders = require('./decoders') - -module.exports.define = function define (name, body) { - return new Entity(name, body) -} - -function Entity (name, body) { - this.name = name - this.body = body - - this.decoders = {} - this.encoders = {} -} - -Entity.prototype._createNamed = function createNamed (Base) { - const name = this.name - - function Generated (entity) { - this._initNamed(entity, name) - } - inherits(Generated, Base) - Generated.prototype._initNamed = function _initNamed (entity, name) { - Base.call(this, entity, name) - } - - return new Generated(this) -} - -Entity.prototype._getDecoder = function _getDecoder (enc) { - enc = enc || 'der' - // Lazily create decoder - if (!Object.prototype.hasOwnProperty.call(this.decoders, enc)) { this.decoders[enc] = this._createNamed(decoders[enc]) } - return this.decoders[enc] -} - -Entity.prototype.decode = function decode (data, enc, options) { - return this._getDecoder(enc).decode(data, options) -} - -Entity.prototype._getEncoder = function _getEncoder (enc) { - enc = enc || 'der' - // Lazily create encoder - if (!Object.prototype.hasOwnProperty.call(this.encoders, enc)) { this.encoders[enc] = this._createNamed(encoders[enc]) } - return this.encoders[enc] -} - -Entity.prototype.encode = function encode (data, enc, /* internal */ reporter) { - return this._getEncoder(enc).encode(data, reporter) -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@panva/asn1.js/lib/asn1/base/buffer.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/@panva/asn1.js/lib/asn1/base/buffer.js deleted file mode 100644 index 89c9e1a7..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@panva/asn1.js/lib/asn1/base/buffer.js +++ /dev/null @@ -1,140 +0,0 @@ -const { inherits } = require('util') - -const { Reporter } = require('../base/reporter') - -function DecoderBuffer (base, options) { - Reporter.call(this, options) - if (!Buffer.isBuffer(base)) { - this.error('Input not Buffer') - return - } - - this.base = base - this.offset = 0 - this.length = base.length -} -inherits(DecoderBuffer, Reporter) - -DecoderBuffer.isDecoderBuffer = function isDecoderBuffer (data) { - if (data instanceof DecoderBuffer) { - return true - } - - // Or accept compatible API - const isCompatible = typeof data === 'object' && - Buffer.isBuffer(data.base) && - data.constructor.name === 'DecoderBuffer' && - typeof data.offset === 'number' && - typeof data.length === 'number' && - typeof data.save === 'function' && - typeof data.restore === 'function' && - typeof data.isEmpty === 'function' && - typeof data.readUInt8 === 'function' && - typeof data.skip === 'function' && - typeof data.raw === 'function' - - return isCompatible -} - -DecoderBuffer.prototype.save = function save () { - return { offset: this.offset, reporter: Reporter.prototype.save.call(this) } -} - -DecoderBuffer.prototype.restore = function restore (save) { - // Return skipped data - const res = new DecoderBuffer(this.base) - res.offset = save.offset - res.length = this.offset - - this.offset = save.offset - Reporter.prototype.restore.call(this, save.reporter) - - return res -} - -DecoderBuffer.prototype.isEmpty = function isEmpty () { - return this.offset === this.length -} - -DecoderBuffer.prototype.readUInt8 = function readUInt8 (fail) { - if (this.offset + 1 <= this.length) { return this.base.readUInt8(this.offset++, true) } else { return this.error(fail || 'DecoderBuffer overrun') } -} - -DecoderBuffer.prototype.skip = function skip (bytes, fail) { - if (!(this.offset + bytes <= this.length)) { return this.error(fail || 'DecoderBuffer overrun') } - - const res = new DecoderBuffer(this.base) - - // Share reporter state - res._reporterState = this._reporterState - - res.offset = this.offset - res.length = this.offset + bytes - this.offset += bytes - return res -} - -DecoderBuffer.prototype.raw = function raw (save) { - return this.base.slice(save ? save.offset : this.offset, this.length) -} - -function EncoderBuffer (value, reporter) { - if (Array.isArray(value)) { - this.length = 0 - this.value = value.map(function (item) { - if (!EncoderBuffer.isEncoderBuffer(item)) { item = new EncoderBuffer(item, reporter) } - this.length += item.length - return item - }, this) - } else if (typeof value === 'number') { - if (!(value >= 0 && value <= 0xff)) { return reporter.error('non-byte EncoderBuffer value') } - this.value = value - this.length = 1 - } else if (typeof value === 'string') { - this.value = value - this.length = Buffer.byteLength(value) - } else if (Buffer.isBuffer(value)) { - this.value = value - this.length = value.length - } else { - return reporter.error(`Unsupported type: ${typeof value}`) - } -} - -EncoderBuffer.isEncoderBuffer = function isEncoderBuffer (data) { - if (data instanceof EncoderBuffer) { - return true - } - - // Or accept compatible API - const isCompatible = typeof data === 'object' && - data.constructor.name === 'EncoderBuffer' && - typeof data.length === 'number' && - typeof data.join === 'function' - - return isCompatible -} - -EncoderBuffer.prototype.join = function join (out, offset) { - if (!out) { out = Buffer.alloc(this.length) } - if (!offset) { offset = 0 } - - if (this.length === 0) { return out } - - if (Array.isArray(this.value)) { - this.value.forEach(function (item) { - item.join(out, offset) - offset += item.length - }) - } else { - if (typeof this.value === 'number') { out[offset] = this.value } else if (typeof this.value === 'string') { out.write(this.value, offset) } else if (Buffer.isBuffer(this.value)) { this.value.copy(out, offset) } - offset += this.length - } - - return out -} - -module.exports = { - DecoderBuffer, - EncoderBuffer -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@panva/asn1.js/lib/asn1/base/index.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/@panva/asn1.js/lib/asn1/base/index.js deleted file mode 100644 index ec478bf6..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@panva/asn1.js/lib/asn1/base/index.js +++ /dev/null @@ -1,10 +0,0 @@ -const { Reporter } = require('./reporter') -const { DecoderBuffer, EncoderBuffer } = require('./buffer') -const Node = require('./node') - -module.exports = { - DecoderBuffer, - EncoderBuffer, - Node, - Reporter -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@panva/asn1.js/lib/asn1/base/node.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/@panva/asn1.js/lib/asn1/base/node.js deleted file mode 100644 index 52a25358..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@panva/asn1.js/lib/asn1/base/node.js +++ /dev/null @@ -1,555 +0,0 @@ -const { strict: assert } = require('assert') - -const { Reporter } = require('../base/reporter') -const { DecoderBuffer, EncoderBuffer } = require('../base/buffer') - -// Supported tags -const tags = [ - 'seq', 'seqof', 'set', 'setof', 'objid', 'bool', - 'gentime', 'utctime', 'null_', 'enum', 'int', 'objDesc', - 'bitstr', 'bmpstr', 'charstr', 'genstr', 'graphstr', 'ia5str', 'iso646str', - 'numstr', 'octstr', 'printstr', 't61str', 'unistr', 'utf8str', 'videostr' -] - -// Public methods list -const methods = [ - 'key', 'obj', 'use', 'optional', 'explicit', 'implicit', 'def', 'choice', - 'any', 'contains' -].concat(tags) - -// Overrided methods list -const overrided = [ - '_peekTag', '_decodeTag', '_use', - '_decodeStr', '_decodeObjid', '_decodeTime', - '_decodeNull', '_decodeInt', '_decodeBool', '_decodeList', - - '_encodeComposite', '_encodeStr', '_encodeObjid', '_encodeTime', - '_encodeNull', '_encodeInt', '_encodeBool' -] - -function Node (enc, parent, name) { - const state = {} - this._baseState = state - - state.name = name - state.enc = enc - - state.parent = parent || null - state.children = null - - // State - state.tag = null - state.args = null - state.reverseArgs = null - state.choice = null - state.optional = false - state.any = false - state.obj = false - state.use = null - state.useDecoder = null - state.key = null - state.default = null - state.explicit = null - state.implicit = null - state.contains = null - - // Should create new instance on each method - if (!state.parent) { - state.children = [] - this._wrap() - } -} - -const stateProps = [ - 'enc', 'parent', 'children', 'tag', 'args', 'reverseArgs', 'choice', - 'optional', 'any', 'obj', 'use', 'alteredUse', 'key', 'default', 'explicit', - 'implicit', 'contains' -] - -Node.prototype.clone = function clone () { - const state = this._baseState - const cstate = {} - stateProps.forEach(function (prop) { - cstate[prop] = state[prop] - }) - const res = new this.constructor(cstate.parent) - res._baseState = cstate - return res -} - -Node.prototype._wrap = function wrap () { - const state = this._baseState - methods.forEach(function (method) { - this[method] = function _wrappedMethod () { - const clone = new this.constructor(this) - state.children.push(clone) - return clone[method].apply(clone, arguments) - } - }, this) -} - -Node.prototype._init = function init (body) { - const state = this._baseState - - assert(state.parent === null) - body.call(this) - - // Filter children - state.children = state.children.filter(function (child) { - return child._baseState.parent === this - }, this) - assert.equal(state.children.length, 1, 'Root node can have only one child') -} - -Node.prototype._useArgs = function useArgs (args) { - const state = this._baseState - - // Filter children and args - const children = args.filter(function (arg) { - return arg instanceof this.constructor - }, this) - args = args.filter(function (arg) { - return !(arg instanceof this.constructor) - }, this) - - if (children.length !== 0) { - assert(state.children === null) - state.children = children - - // Replace parent to maintain backward link - children.forEach(function (child) { - child._baseState.parent = this - }, this) - } - if (args.length !== 0) { - assert(state.args === null) - state.args = args - state.reverseArgs = args.map(function (arg) { - if (typeof arg !== 'object' || arg.constructor !== Object) { return arg } - - const res = {} - Object.keys(arg).forEach(function (key) { - if (key == (key | 0)) { key |= 0 } // eslint-disable-line eqeqeq - const value = arg[key] - res[value] = key - }) - return res - }) - } -} - -// -// Overrided methods -// - -overrided.forEach(function (method) { - Node.prototype[method] = function _overrided () { - const state = this._baseState - throw new Error(`${method} not implemented for encoding: ${state.enc}`) - } -}) - -// -// Public methods -// - -tags.forEach(function (tag) { - Node.prototype[tag] = function _tagMethod () { - const state = this._baseState - const args = Array.prototype.slice.call(arguments) - - assert(state.tag === null) - state.tag = tag - - this._useArgs(args) - - return this - } -}) - -Node.prototype.use = function use (item) { - assert(item) - const state = this._baseState - - assert(state.use === null) - state.use = item - - return this -} - -Node.prototype.optional = function optional () { - const state = this._baseState - - state.optional = true - - return this -} - -Node.prototype.def = function def (val) { - const state = this._baseState - - assert(state.default === null) - state.default = val - state.optional = true - - return this -} - -Node.prototype.explicit = function explicit (num) { - const state = this._baseState - - assert(state.explicit === null && state.implicit === null) - state.explicit = num - - return this -} - -Node.prototype.implicit = function implicit (num) { - const state = this._baseState - - assert(state.explicit === null && state.implicit === null) - state.implicit = num - - return this -} - -Node.prototype.obj = function obj () { - const state = this._baseState - const args = Array.prototype.slice.call(arguments) - - state.obj = true - - if (args.length !== 0) { this._useArgs(args) } - - return this -} - -Node.prototype.key = function key (newKey) { - const state = this._baseState - - assert(state.key === null) - state.key = newKey - - return this -} - -Node.prototype.any = function any () { - const state = this._baseState - - state.any = true - - return this -} - -Node.prototype.choice = function choice (obj) { - const state = this._baseState - - assert(state.choice === null) - state.choice = obj - this._useArgs(Object.keys(obj).map(function (key) { - return obj[key] - })) - - return this -} - -Node.prototype.contains = function contains (item) { - const state = this._baseState - - assert(state.use === null) - state.contains = item - - return this -} - -// -// Decoding -// - -Node.prototype._decode = function decode (input, options) { - const state = this._baseState - - // Decode root node - if (state.parent === null) { return input.wrapResult(state.children[0]._decode(input, options)) } - - let result = state.default - let present = true - - let prevKey = null - if (state.key !== null) { prevKey = input.enterKey(state.key) } - - // Check if tag is there - if (state.optional) { - let tag = null - if (state.explicit !== null) { tag = state.explicit } else if (state.implicit !== null) { tag = state.implicit } else if (state.tag !== null) { tag = state.tag } - - if (tag === null && !state.any) { - // Trial and Error - const save = input.save() - try { - if (state.choice === null) { this._decodeGeneric(state.tag, input, options) } else { this._decodeChoice(input, options) } - present = true - } catch (e) { - present = false - } - input.restore(save) - } else { - present = this._peekTag(input, tag, state.any) - - if (input.isError(present)) { return present } - } - } - - // Push object on stack - let prevObj - if (state.obj && present) { prevObj = input.enterObject() } - - if (present) { - // Unwrap explicit values - if (state.explicit !== null) { - const explicit = this._decodeTag(input, state.explicit) - if (input.isError(explicit)) { return explicit } - input = explicit - } - - const start = input.offset - - // Unwrap implicit and normal values - if (state.use === null && state.choice === null) { - let save - if (state.any) { save = input.save() } - const body = this._decodeTag( - input, - state.implicit !== null ? state.implicit : state.tag, - state.any - ) - if (input.isError(body)) { return body } - - if (state.any) { result = input.raw(save) } else { input = body } - } - - if (options && options.track && state.tag !== null) { options.track(input.path(), start, input.length, 'tagged') } - - if (options && options.track && state.tag !== null) { options.track(input.path(), input.offset, input.length, 'content') } - - // Select proper method for tag - if (state.any) { - // no-op - } else if (state.choice === null) { - result = this._decodeGeneric(state.tag, input, options) - } else { - result = this._decodeChoice(input, options) - } - - if (input.isError(result)) { return result } - - // Decode children - if (!state.any && state.choice === null && state.children !== null) { - state.children.forEach(function decodeChildren (child) { - // NOTE: We are ignoring errors here, to let parser continue with other - // parts of encoded data - child._decode(input, options) - }) - } - - // Decode contained/encoded by schema, only in bit or octet strings - if (state.contains && (state.tag === 'octstr' || state.tag === 'bitstr')) { - const data = new DecoderBuffer(result) - result = this._getUse(state.contains, input._reporterState.obj) - ._decode(data, options) - } - } - - // Pop object - if (state.obj && present) { result = input.leaveObject(prevObj) } - - // Set key - if (state.key !== null && (result !== null || present === true)) { input.leaveKey(prevKey, state.key, result) } else if (prevKey !== null) { input.exitKey(prevKey) } - - return result -} - -Node.prototype._decodeGeneric = function decodeGeneric (tag, input, options) { - const state = this._baseState - - if (tag === 'seq' || tag === 'set') { return null } - if (tag === 'seqof' || tag === 'setof') { return this._decodeList(input, tag, state.args[0], options) } else if (/str$/.test(tag)) { return this._decodeStr(input, tag, options) } else if (tag === 'objid' && state.args) { return this._decodeObjid(input, state.args[0], state.args[1], options) } else if (tag === 'objid') { return this._decodeObjid(input, null, null, options) } else if (tag === 'gentime' || tag === 'utctime') { return this._decodeTime(input, tag, options) } else if (tag === 'null_') { return this._decodeNull(input, options) } else if (tag === 'bool') { return this._decodeBool(input, options) } else if (tag === 'objDesc') { return this._decodeStr(input, tag, options) } else if (tag === 'int' || tag === 'enum') { return this._decodeInt(input, state.args && state.args[0], options) } - - if (state.use !== null) { - return this._getUse(state.use, input._reporterState.obj) - ._decode(input, options) - } else { - return input.error(`unknown tag: ${tag}`) - } -} - -Node.prototype._getUse = function _getUse (entity, obj) { - const state = this._baseState - // Create altered use decoder if implicit is set - state.useDecoder = this._use(entity, obj) - assert(state.useDecoder._baseState.parent === null) - state.useDecoder = state.useDecoder._baseState.children[0] - if (state.implicit !== state.useDecoder._baseState.implicit) { - state.useDecoder = state.useDecoder.clone() - state.useDecoder._baseState.implicit = state.implicit - } - return state.useDecoder -} - -Node.prototype._decodeChoice = function decodeChoice (input, options) { - const state = this._baseState - let result = null - let match = false - - Object.keys(state.choice).some(function (key) { - const save = input.save() - const node = state.choice[key] - try { - const value = node._decode(input, options) - if (input.isError(value)) { return false } - - result = { type: key, value: value } - match = true - } catch (e) { - input.restore(save) - return false - } - return true - }, this) - - if (!match) { return input.error('Choice not matched') } - - return result -} - -// -// Encoding -// - -Node.prototype._createEncoderBuffer = function createEncoderBuffer (data) { - return new EncoderBuffer(data, this.reporter) -} - -Node.prototype._encode = function encode (data, reporter, parent) { - const state = this._baseState - if (state.default !== null && state.default === data) { return } - - const result = this._encodeValue(data, reporter, parent) - if (result === undefined) { return } - - if (this._skipDefault(result, reporter, parent)) { return } - - return result -} - -Node.prototype._encodeValue = function encode (data, reporter, parent) { - const state = this._baseState - - // Decode root node - if (state.parent === null) { return state.children[0]._encode(data, reporter || new Reporter()) } - - let result = null - - // Set reporter to share it with a child class - this.reporter = reporter - - // Check if data is there - if (state.optional && data === undefined) { - if (state.default !== null) { data = state.default } else { return } - } - - // Encode children first - let content = null - let primitive = false - if (state.any) { - // Anything that was given is translated to buffer - result = this._createEncoderBuffer(data) - } else if (state.choice) { - result = this._encodeChoice(data, reporter) - } else if (state.contains) { - content = this._getUse(state.contains, parent)._encode(data, reporter) - primitive = true - } else if (state.children) { - content = state.children.map(function (child) { - if (child._baseState.tag === 'null_') { return child._encode(null, reporter, data) } - - if (child._baseState.key === null) { return reporter.error('Child should have a key') } - const prevKey = reporter.enterKey(child._baseState.key) - - if (typeof data !== 'object') { return reporter.error('Child expected, but input is not object') } - - const res = child._encode(data[child._baseState.key], reporter, data) - reporter.leaveKey(prevKey) - - return res - }, this).filter(function (child) { - return child - }) - content = this._createEncoderBuffer(content) - } else { - if (state.tag === 'seqof' || state.tag === 'setof') { - if (!(state.args && state.args.length === 1)) { return reporter.error(`Too many args for: ${state.tag}`) } - - if (!Array.isArray(data)) { return reporter.error('seqof/setof, but data is not Array') } - - const child = this.clone() - child._baseState.implicit = null - content = this._createEncoderBuffer(data.map(function (item) { - const state = this._baseState - - return this._getUse(state.args[0], data)._encode(item, reporter) - }, child)) - } else if (state.use !== null) { - result = this._getUse(state.use, parent)._encode(data, reporter) - } else { - content = this._encodePrimitive(state.tag, data) - primitive = true - } - } - - // Encode data itself - if (!state.any && state.choice === null) { - const tag = state.implicit !== null ? state.implicit : state.tag - const cls = state.implicit === null ? 'universal' : 'context' - - if (tag === null) { - if (state.use === null) { reporter.error('Tag could be omitted only for .use()') } - } else { - if (state.use === null) { result = this._encodeComposite(tag, primitive, cls, content) } - } - } - - // Wrap in explicit - if (state.explicit !== null) { result = this._encodeComposite(state.explicit, false, 'context', result) } - - return result -} - -Node.prototype._encodeChoice = function encodeChoice (data, reporter) { - const state = this._baseState - - const node = state.choice[data.type] - if (!node) { - assert( - false, - `${data.type} not found in ${JSON.stringify(Object.keys(state.choice))}` - ) - } - return node._encode(data.value, reporter) -} - -Node.prototype._encodePrimitive = function encodePrimitive (tag, data) { - const state = this._baseState - - if (/str$/.test(tag)) { return this._encodeStr(data, tag) } else if (tag === 'objid' && state.args) { return this._encodeObjid(data, state.reverseArgs[0], state.args[1]) } else if (tag === 'objid') { return this._encodeObjid(data, null, null) } else if (tag === 'gentime' || tag === 'utctime') { return this._encodeTime(data, tag) } else if (tag === 'null_') { return this._encodeNull() } else if (tag === 'int' || tag === 'enum') { return this._encodeInt(data, state.args && state.reverseArgs[0]) } else if (tag === 'bool') { return this._encodeBool(data) } else if (tag === 'objDesc') { return this._encodeStr(data, tag) } else { throw new Error(`Unsupported tag: ${tag}`) } -} - -Node.prototype._isNumstr = function isNumstr (str) { - return /^[0-9 ]*$/.test(str) -} - -Node.prototype._isPrintstr = function isPrintstr (str) { - return /^[A-Za-z0-9 '()+,-./:=?]*$/.test(str) -} - -module.exports = Node diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@panva/asn1.js/lib/asn1/base/reporter.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/@panva/asn1.js/lib/asn1/base/reporter.js deleted file mode 100644 index a3185833..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@panva/asn1.js/lib/asn1/base/reporter.js +++ /dev/null @@ -1,117 +0,0 @@ -const { inherits } = require('util') - -function Reporter (options) { - this._reporterState = { - obj: null, - path: [], - options: options || {}, - errors: [] - } -} - -Reporter.prototype.isError = function isError (obj) { - return obj instanceof ReporterError -} - -Reporter.prototype.save = function save () { - const state = this._reporterState - - return { obj: state.obj, pathLen: state.path.length } -} - -Reporter.prototype.restore = function restore (data) { - const state = this._reporterState - - state.obj = data.obj - state.path = state.path.slice(0, data.pathLen) -} - -Reporter.prototype.enterKey = function enterKey (key) { - return this._reporterState.path.push(key) -} - -Reporter.prototype.exitKey = function exitKey (index) { - const state = this._reporterState - - state.path = state.path.slice(0, index - 1) -} - -Reporter.prototype.leaveKey = function leaveKey (index, key, value) { - const state = this._reporterState - - this.exitKey(index) - if (state.obj !== null) { state.obj[key] = value } -} - -Reporter.prototype.path = function path () { - return this._reporterState.path.join('/') -} - -Reporter.prototype.enterObject = function enterObject () { - const state = this._reporterState - - const prev = state.obj - state.obj = {} - return prev -} - -Reporter.prototype.leaveObject = function leaveObject (prev) { - const state = this._reporterState - - const now = state.obj - state.obj = prev - return now -} - -Reporter.prototype.error = function error (msg) { - let err - const state = this._reporterState - - const inherited = msg instanceof ReporterError - if (inherited) { - err = msg - } else { - err = new ReporterError(state.path.map(function (elem) { - return `[${JSON.stringify(elem)}]` - }).join(''), msg.message || msg, msg.stack) - } - - if (!state.options.partial) { throw err } - - if (!inherited) { state.errors.push(err) } - - return err -} - -Reporter.prototype.wrapResult = function wrapResult (result) { - const state = this._reporterState - if (!state.options.partial) { return result } - - return { - result: this.isError(result) ? null : result, - errors: state.errors - } -} - -function ReporterError (path, msg) { - this.path = path - this.rethrow(msg) -} -inherits(ReporterError, Error) - -ReporterError.prototype.rethrow = function rethrow (msg) { - this.message = `${msg} at: ${this.path || '(shallow)'}` - if (Error.captureStackTrace) { Error.captureStackTrace(this, ReporterError) } - - if (!this.stack) { - try { - // IE only adds stack when thrown - throw new Error(this.message) - } catch (e) { - this.stack = e.stack - } - } - return this -} - -exports.Reporter = Reporter diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@panva/asn1.js/lib/asn1/constants/der.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/@panva/asn1.js/lib/asn1/constants/der.js deleted file mode 100644 index d8b22e19..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@panva/asn1.js/lib/asn1/constants/der.js +++ /dev/null @@ -1,55 +0,0 @@ -// Helper -function reverse (map) { - const res = {} - - Object.keys(map).forEach(function (key) { - // Convert key to integer if it is stringified - if ((key | 0) == key) { key = key | 0 } // eslint-disable-line eqeqeq - - const value = map[key] - res[value] = key - }) - - return res -} - -exports.tagClass = { - 0: 'universal', - 1: 'application', - 2: 'context', - 3: 'private' -} -exports.tagClassByName = reverse(exports.tagClass) - -exports.tag = { - 0x00: 'end', - 0x01: 'bool', - 0x02: 'int', - 0x03: 'bitstr', - 0x04: 'octstr', - 0x05: 'null_', - 0x06: 'objid', - 0x07: 'objDesc', - 0x08: 'external', - 0x09: 'real', - 0x0a: 'enum', - 0x0b: 'embed', - 0x0c: 'utf8str', - 0x0d: 'relativeOid', - 0x10: 'seq', - 0x11: 'set', - 0x12: 'numstr', - 0x13: 'printstr', - 0x14: 't61str', - 0x15: 'videostr', - 0x16: 'ia5str', - 0x17: 'utctime', - 0x18: 'gentime', - 0x19: 'graphstr', - 0x1a: 'iso646str', - 0x1b: 'genstr', - 0x1c: 'unistr', - 0x1d: 'charstr', - 0x1e: 'bmpstr' -} -exports.tagByName = reverse(exports.tag) diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@panva/asn1.js/lib/asn1/constants/index.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/@panva/asn1.js/lib/asn1/constants/index.js deleted file mode 100644 index 8da77fef..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@panva/asn1.js/lib/asn1/constants/index.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = { - der: require('./der') -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@panva/asn1.js/lib/asn1/decoders/der.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/@panva/asn1.js/lib/asn1/decoders/der.js deleted file mode 100644 index 4da64de8..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@panva/asn1.js/lib/asn1/decoders/der.js +++ /dev/null @@ -1,296 +0,0 @@ -/* global BigInt */ -const { inherits } = require('util') - -const { DecoderBuffer } = require('../base/buffer') -const Node = require('../base/node') - -// Import DER constants -const der = require('../constants/der') - -function DERDecoder (entity) { - this.enc = 'der' - this.name = entity.name - this.entity = entity - - // Construct base tree - this.tree = new DERNode() - this.tree._init(entity.body) -} - -DERDecoder.prototype.decode = function decode (data, options) { - if (!DecoderBuffer.isDecoderBuffer(data)) { - data = new DecoderBuffer(data, options) - } - - return this.tree._decode(data, options) -} - -// Tree methods - -function DERNode (parent) { - Node.call(this, 'der', parent) -} -inherits(DERNode, Node) - -DERNode.prototype._peekTag = function peekTag (buffer, tag, any) { - if (buffer.isEmpty()) { return false } - - const state = buffer.save() - const decodedTag = derDecodeTag(buffer, `Failed to peek tag: "${tag}"`) - if (buffer.isError(decodedTag)) { return decodedTag } - - buffer.restore(state) - - return decodedTag.tag === tag || decodedTag.tagStr === tag || (decodedTag.tagStr + 'of') === tag || any -} - -DERNode.prototype._decodeTag = function decodeTag (buffer, tag, any) { - const decodedTag = derDecodeTag(buffer, - `Failed to decode tag of "${tag}"`) - if (buffer.isError(decodedTag)) { return decodedTag } - - let len = derDecodeLen(buffer, - decodedTag.primitive, - `Failed to get length of "${tag}"`) - - // Failure - if (buffer.isError(len)) { return len } - - if (!any && - decodedTag.tag !== tag && - decodedTag.tagStr !== tag && - decodedTag.tagStr + 'of' !== tag) { - return buffer.error(`Failed to match tag: "${tag}"`) - } - - if (decodedTag.primitive || len !== null) { return buffer.skip(len, `Failed to match body of: "${tag}"`) } - - // Indefinite length... find END tag - const state = buffer.save() - const res = this._skipUntilEnd( - buffer, - `Failed to skip indefinite length body: "${this.tag}"`) - if (buffer.isError(res)) { return res } - - len = buffer.offset - state.offset - buffer.restore(state) - return buffer.skip(len, `Failed to match body of: "${tag}"`) -} - -DERNode.prototype._skipUntilEnd = function skipUntilEnd (buffer, fail) { - for (;;) { - const tag = derDecodeTag(buffer, fail) - if (buffer.isError(tag)) { return tag } - const len = derDecodeLen(buffer, tag.primitive, fail) - if (buffer.isError(len)) { return len } - - let res - if (tag.primitive || len !== null) { res = buffer.skip(len) } else { res = this._skipUntilEnd(buffer, fail) } - - // Failure - if (buffer.isError(res)) { return res } - - if (tag.tagStr === 'end') { break } - } -} - -DERNode.prototype._decodeList = function decodeList (buffer, tag, decoder, - options) { - const result = [] - while (!buffer.isEmpty()) { - const possibleEnd = this._peekTag(buffer, 'end') - if (buffer.isError(possibleEnd)) { return possibleEnd } - - const res = decoder.decode(buffer, 'der', options) - if (buffer.isError(res) && possibleEnd) { break } - result.push(res) - } - return result -} - -DERNode.prototype._decodeStr = function decodeStr (buffer, tag) { - if (tag === 'bitstr') { - const unused = buffer.readUInt8() - if (buffer.isError(unused)) { return unused } - return { unused: unused, data: buffer.raw() } - } else if (tag === 'bmpstr') { - const raw = buffer.raw() - if (raw.length % 2 === 1) { return buffer.error('Decoding of string type: bmpstr length mismatch') } - - let str = '' - for (let i = 0; i < raw.length / 2; i++) { - str += String.fromCharCode(raw.readUInt16BE(i * 2)) - } - return str - } else if (tag === 'numstr') { - const numstr = buffer.raw().toString('ascii') - if (!this._isNumstr(numstr)) { - return buffer.error('Decoding of string type: numstr unsupported characters') - } - return numstr - } else if (tag === 'octstr') { - return buffer.raw() - } else if (tag === 'objDesc') { - return buffer.raw() - } else if (tag === 'printstr') { - const printstr = buffer.raw().toString('ascii') - if (!this._isPrintstr(printstr)) { - return buffer.error('Decoding of string type: printstr unsupported characters') - } - return printstr - } else if (/str$/.test(tag)) { - return buffer.raw().toString() - } else { - return buffer.error(`Decoding of string type: ${tag} unsupported`) - } -} - -DERNode.prototype._decodeObjid = function decodeObjid (buffer, values, relative) { - let result - const identifiers = [] - let ident = 0 - let subident = 0 - while (!buffer.isEmpty()) { - subident = buffer.readUInt8() - ident <<= 7 - ident |= subident & 0x7f - if ((subident & 0x80) === 0) { - identifiers.push(ident) - ident = 0 - } - } - if (subident & 0x80) { identifiers.push(ident) } - - const first = (identifiers[0] / 40) | 0 - const second = identifiers[0] % 40 - - if (relative) { result = identifiers } else { result = [first, second].concat(identifiers.slice(1)) } - - if (values) { - let tmp = values[result.join(' ')] - if (tmp === undefined) { tmp = values[result.join('.')] } - if (tmp !== undefined) { result = tmp } - } - - return result -} - -DERNode.prototype._decodeTime = function decodeTime (buffer, tag) { - const str = buffer.raw().toString() - - let year - let mon - let day - let hour - let min - let sec - if (tag === 'gentime') { - year = str.slice(0, 4) | 0 - mon = str.slice(4, 6) | 0 - day = str.slice(6, 8) | 0 - hour = str.slice(8, 10) | 0 - min = str.slice(10, 12) | 0 - sec = str.slice(12, 14) | 0 - } else if (tag === 'utctime') { - year = str.slice(0, 2) | 0 - mon = str.slice(2, 4) | 0 - day = str.slice(4, 6) | 0 - hour = str.slice(6, 8) | 0 - min = str.slice(8, 10) | 0 - sec = str.slice(10, 12) | 0 - if (year < 70) { year = 2000 + year } else { year = 1900 + year } - } else { - return buffer.error(`Decoding ${tag} time is not supported yet`) - } - - return Date.UTC(year, mon - 1, day, hour, min, sec, 0) -} - -DERNode.prototype._decodeNull = function decodeNull () { - return null -} - -DERNode.prototype._decodeBool = function decodeBool (buffer) { - const res = buffer.readUInt8() - if (buffer.isError(res)) { return res } else { return res !== 0 } -} - -DERNode.prototype._decodeInt = function decodeInt (buffer, values) { - // Bigint, return as it is (assume big endian) - const raw = buffer.raw() - let res = BigInt(`0x${raw.toString('hex')}`) - - if (values) { - res = values[res.toString(10)] || res - } - - return res -} - -DERNode.prototype._use = function use (entity, obj) { - if (typeof entity === 'function') { entity = entity(obj) } - return entity._getDecoder('der').tree -} - -// Utility methods - -function derDecodeTag (buf, fail) { - let tag = buf.readUInt8(fail) - if (buf.isError(tag)) { return tag } - - const cls = der.tagClass[tag >> 6] - const primitive = (tag & 0x20) === 0 - - // Multi-octet tag - load - if ((tag & 0x1f) === 0x1f) { - let oct = tag - tag = 0 - while ((oct & 0x80) === 0x80) { - oct = buf.readUInt8(fail) - if (buf.isError(oct)) { return oct } - - tag <<= 7 - tag |= oct & 0x7f - } - } else { - tag &= 0x1f - } - const tagStr = der.tag[tag] - - return { - cls: cls, - primitive: primitive, - tag: tag, - tagStr: tagStr - } -} - -function derDecodeLen (buf, primitive, fail) { - let len = buf.readUInt8(fail) - if (buf.isError(len)) { return len } - - // Indefinite form - if (!primitive && len === 0x80) { return null } - - // Definite form - if ((len & 0x80) === 0) { - // Short form - return len - } - - // Long form - const num = len & 0x7f - if (num > 4) { return buf.error('length octect is too long') } - - len = 0 - for (let i = 0; i < num; i++) { - len <<= 8 - const j = buf.readUInt8(fail) - if (buf.isError(j)) { return j } - len |= j - } - - return len -} - -module.exports = DERDecoder diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@panva/asn1.js/lib/asn1/decoders/index.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/@panva/asn1.js/lib/asn1/decoders/index.js deleted file mode 100644 index b6acd323..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@panva/asn1.js/lib/asn1/decoders/index.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = { - der: require('./der'), - pem: require('./pem') -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@panva/asn1.js/lib/asn1/decoders/pem.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/@panva/asn1.js/lib/asn1/decoders/pem.js deleted file mode 100644 index ba94cc32..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@panva/asn1.js/lib/asn1/decoders/pem.js +++ /dev/null @@ -1,44 +0,0 @@ -const { inherits } = require('util') - -const DERDecoder = require('./der') - -function PEMDecoder (entity) { - DERDecoder.call(this, entity) - this.enc = 'pem' -} -inherits(PEMDecoder, DERDecoder) - -PEMDecoder.prototype.decode = function decode (data, options) { - const lines = data.toString().split(/[\r\n]+/g) - - const label = options.label.toUpperCase() - - const re = /^-----(BEGIN|END) ([^-]+)-----$/ - let start = -1 - let end = -1 - for (let i = 0; i < lines.length; i++) { - const match = lines[i].match(re) - if (match === null) { continue } - - if (match[2] !== label) { continue } - - if (start === -1) { - if (match[1] !== 'BEGIN') { break } - start = i - } else { - if (match[1] !== 'END') { break } - end = i - break - } - } - if (start === -1 || end === -1) { throw new Error(`PEM section not found for: ${label}`) } - - const base64 = lines.slice(start + 1, end).join('') - // Remove excessive symbols - base64.replace(/[^a-z0-9+/=]+/gi, '') - - const input = Buffer.from(base64, 'base64') - return DERDecoder.prototype.decode.call(this, input, options) -} - -module.exports = PEMDecoder diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@panva/asn1.js/lib/asn1/encoders/der.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/@panva/asn1.js/lib/asn1/encoders/der.js deleted file mode 100644 index f4c2381e..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@panva/asn1.js/lib/asn1/encoders/der.js +++ /dev/null @@ -1,269 +0,0 @@ -/* global BigInt */ -const { inherits } = require('util') - -const Node = require('../base/node') -const der = require('../constants/der') - -function DEREncoder (entity) { - this.enc = 'der' - this.name = entity.name - this.entity = entity - - // Construct base tree - this.tree = new DERNode() - this.tree._init(entity.body) -} - -DEREncoder.prototype.encode = function encode (data, reporter) { - return this.tree._encode(data, reporter).join() -} - -// Tree methods - -function DERNode (parent) { - Node.call(this, 'der', parent) -} -inherits(DERNode, Node) - -DERNode.prototype._encodeComposite = function encodeComposite (tag, - primitive, - cls, - content) { - const encodedTag = encodeTag(tag, primitive, cls, this.reporter) - - // Short form - if (content.length < 0x80) { - const header = Buffer.alloc(2) - header[0] = encodedTag - header[1] = content.length - return this._createEncoderBuffer([header, content]) - } - - // Long form - // Count octets required to store length - let lenOctets = 1 - for (let i = content.length; i >= 0x100; i >>= 8) { lenOctets++ } - - const header = Buffer.alloc(1 + 1 + lenOctets) - header[0] = encodedTag - header[1] = 0x80 | lenOctets - - for (let i = 1 + lenOctets, j = content.length; j > 0; i--, j >>= 8) { header[i] = j & 0xff } - - return this._createEncoderBuffer([header, content]) -} - -DERNode.prototype._encodeStr = function encodeStr (str, tag) { - if (tag === 'bitstr') { - return this._createEncoderBuffer([str.unused | 0, str.data]) - } else if (tag === 'bmpstr') { - const buf = Buffer.alloc(str.length * 2) - for (let i = 0; i < str.length; i++) { - buf.writeUInt16BE(str.charCodeAt(i), i * 2) - } - return this._createEncoderBuffer(buf) - } else if (tag === 'numstr') { - if (!this._isNumstr(str)) { - return this.reporter.error('Encoding of string type: numstr supports only digits and space') - } - return this._createEncoderBuffer(str) - } else if (tag === 'printstr') { - if (!this._isPrintstr(str)) { - return this.reporter.error('Encoding of string type: printstr supports only latin upper and lower case letters, digits, space, apostrophe, left and rigth parenthesis, plus sign, comma, hyphen, dot, slash, colon, equal sign, question mark') - } - return this._createEncoderBuffer(str) - } else if (/str$/.test(tag)) { - return this._createEncoderBuffer(str) - } else if (tag === 'objDesc') { - return this._createEncoderBuffer(str) - } else { - return this.reporter.error(`Encoding of string type: ${tag} unsupported`) - } -} - -DERNode.prototype._encodeObjid = function encodeObjid (id, values, relative) { - if (typeof id === 'string') { - if (!values) { return this.reporter.error('string objid given, but no values map found') } - if (!Object.prototype.hasOwnProperty.call(values, id)) { return this.reporter.error('objid not found in values map') } - id = values[id].split(/[\s.]+/g) - for (let i = 0; i < id.length; i++) { id[i] |= 0 } - } else if (Array.isArray(id)) { - id = id.slice() - for (let i = 0; i < id.length; i++) { id[i] |= 0 } - } - - if (!Array.isArray(id)) { - return this.reporter.error(`objid() should be either array or string, got: ${JSON.stringify(id)}`) - } - - if (!relative) { - if (id[1] >= 40) { return this.reporter.error('Second objid identifier OOB') } - id.splice(0, 2, id[0] * 40 + id[1]) - } - - // Count number of octets - let size = 0 - for (let i = 0; i < id.length; i++) { - let ident = id[i] - for (size++; ident >= 0x80; ident >>= 7) { size++ } - } - - const objid = Buffer.alloc(size) - let offset = objid.length - 1 - for (let i = id.length - 1; i >= 0; i--) { - let ident = id[i] - objid[offset--] = ident & 0x7f - while ((ident >>= 7) > 0) { objid[offset--] = 0x80 | (ident & 0x7f) } - } - - return this._createEncoderBuffer(objid) -} - -function two (num) { - if (num < 10) { return `0${num}` } else { return num } -} - -DERNode.prototype._encodeTime = function encodeTime (time, tag) { - let str - const date = new Date(time) - - if (tag === 'gentime') { - str = [ - two(date.getUTCFullYear()), - two(date.getUTCMonth() + 1), - two(date.getUTCDate()), - two(date.getUTCHours()), - two(date.getUTCMinutes()), - two(date.getUTCSeconds()), - 'Z' - ].join('') - } else if (tag === 'utctime') { - str = [ - two(date.getUTCFullYear() % 100), - two(date.getUTCMonth() + 1), - two(date.getUTCDate()), - two(date.getUTCHours()), - two(date.getUTCMinutes()), - two(date.getUTCSeconds()), - 'Z' - ].join('') - } else { - this.reporter.error(`Encoding ${tag} time is not supported yet`) - } - - return this._encodeStr(str, 'octstr') -} - -DERNode.prototype._encodeNull = function encodeNull () { - return this._createEncoderBuffer('') -} - -function bnToBuf (bn) { - var hex = BigInt(bn).toString(16) - if (hex.length % 2) { hex = '0' + hex } - - var len = hex.length / 2 - var u8 = new Uint8Array(len) - - var i = 0 - var j = 0 - while (i < len) { - u8[i] = parseInt(hex.slice(j, j + 2), 16) - i += 1 - j += 2 - } - - return u8 -} - -DERNode.prototype._encodeInt = function encodeInt (num, values) { - if (typeof num === 'string') { - if (!values) { return this.reporter.error('String int or enum given, but no values map') } - if (!Object.prototype.hasOwnProperty.call(values, num)) { - return this.reporter.error(`Values map doesn't contain: ${JSON.stringify(num)}`) - } - num = values[num] - } - - if (typeof num === 'bigint') { - const numArray = [...bnToBuf(num)] - if (numArray[0] & 0x80) { - numArray.unshift(0) - } - num = Buffer.from(numArray) - } - - if (Buffer.isBuffer(num)) { - let size = num.length - if (num.length === 0) { size++ } - - const out = Buffer.alloc(size) - num.copy(out) - if (num.length === 0) { out[0] = 0 } - return this._createEncoderBuffer(out) - } - - if (num < 0x80) { return this._createEncoderBuffer(num) } - - if (num < 0x100) { return this._createEncoderBuffer([0, num]) } - - let size = 1 - for (let i = num; i >= 0x100; i >>= 8) { size++ } - - const out = new Array(size) - for (let i = out.length - 1; i >= 0; i--) { - out[i] = num & 0xff - num >>= 8 - } - if (out[0] & 0x80) { - out.unshift(0) - } - - return this._createEncoderBuffer(Buffer.from(out)) -} - -DERNode.prototype._encodeBool = function encodeBool (value) { - return this._createEncoderBuffer(value ? 0xff : 0) -} - -DERNode.prototype._use = function use (entity, obj) { - if (typeof entity === 'function') { entity = entity(obj) } - return entity._getEncoder('der').tree -} - -DERNode.prototype._skipDefault = function skipDefault (dataBuffer, reporter, parent) { - const state = this._baseState - let i - if (state.default === null) { return false } - - const data = dataBuffer.join() - if (state.defaultBuffer === undefined) { state.defaultBuffer = this._encodeValue(state.default, reporter, parent).join() } - - if (data.length !== state.defaultBuffer.length) { return false } - - for (i = 0; i < data.length; i++) { - if (data[i] !== state.defaultBuffer[i]) { return false } - } - - return true -} - -// Utility methods - -function encodeTag (tag, primitive, cls, reporter) { - let res - - if (tag === 'seqof') { tag = 'seq' } else if (tag === 'setof') { tag = 'set' } - - if (Object.prototype.hasOwnProperty.call(der.tagByName, tag)) { res = der.tagByName[tag] } else if (typeof tag === 'number' && (tag | 0) === tag) { res = tag } else { return reporter.error(`Unknown tag: ${tag}`) } - - if (res >= 0x1f) { return reporter.error('Multi-octet tag encoding unsupported') } - - if (!primitive) { res |= 0x20 } - - res |= (der.tagClassByName[cls || 'universal'] << 6) - - return res -} - -module.exports = DEREncoder diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@panva/asn1.js/lib/asn1/encoders/index.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/@panva/asn1.js/lib/asn1/encoders/index.js deleted file mode 100644 index b6acd323..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@panva/asn1.js/lib/asn1/encoders/index.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = { - der: require('./der'), - pem: require('./pem') -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@panva/asn1.js/lib/asn1/encoders/pem.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/@panva/asn1.js/lib/asn1/encoders/pem.js deleted file mode 100644 index 1fbd2b11..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@panva/asn1.js/lib/asn1/encoders/pem.js +++ /dev/null @@ -1,21 +0,0 @@ -const { inherits } = require('util') - -const DEREncoder = require('./der') - -function PEMEncoder (entity) { - DEREncoder.call(this, entity) - this.enc = 'pem' -} -inherits(PEMEncoder, DEREncoder) - -PEMEncoder.prototype.encode = function encode (data, options) { - const buf = DEREncoder.prototype.encode.call(this, data) - - const p = buf.toString('base64') - const out = [`-----BEGIN ${options.label}-----`] - for (let i = 0; i < p.length; i += 64) { out.push(p.slice(i, i + 64)) } - out.push(`-----END ${options.label}-----`) - return out.join('\n') -} - -module.exports = PEMEncoder diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@panva/asn1.js/package.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/@panva/asn1.js/package.json deleted file mode 100644 index 2e9d902f..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@panva/asn1.js/package.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "name": "@panva/asn1.js", - "version": "1.0.0", - "description": "ASN.1 encoder and decoder for Node.js with no dependencies (fork of asn1.js using native BigInt)", - "keywords": [ - "asn.1", - "bigint", - "der", - "pem" - ], - "homepage": "https://github.com/panva/asn1.js", - "repository": "panva/asn1.js", - "license": "MIT", - "author": "Fedor Indutny", - "files": [ - "lib" - ], - "main": "lib/asn1.js", - "scripts": { - "lint": "standard", - "lint-fix": "standard --fix", - "test": "mocha test/**/*-test.js" - }, - "devDependencies": { - "mocha": "^7.0.1", - "standard": "^14.3.1" - }, - "engines": { - "node": ">=10.13.0" - }, - "contributors": [ - "Filip Skokan " - ] -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/aspromise/LICENSE b/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/aspromise/LICENSE deleted file mode 100644 index 2a2d5601..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/aspromise/LICENSE +++ /dev/null @@ -1,26 +0,0 @@ -Copyright (c) 2016, Daniel Wirtz All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - -* Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -* Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -* Neither the name of its author, nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/aspromise/README.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/aspromise/README.md deleted file mode 100644 index 72270960..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/aspromise/README.md +++ /dev/null @@ -1,13 +0,0 @@ -@protobufjs/aspromise -===================== -[![npm](https://img.shields.io/npm/v/@protobufjs/aspromise.svg)](https://www.npmjs.com/package/@protobufjs/aspromise) - -Returns a promise from a node-style callback function. - -API ---- - -* **asPromise(fn: `function`, ctx: `Object`, ...params: `*`): `Promise<*>`**
- Returns a promise from a node-style callback function. - -**License:** [BSD 3-Clause License](https://opensource.org/licenses/BSD-3-Clause) diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/aspromise/index.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/aspromise/index.d.ts deleted file mode 100644 index afbd89ac..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/aspromise/index.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -export = asPromise; - -type asPromiseCallback = (error: Error | null, ...params: any[]) => {}; - -/** - * Returns a promise from a node-style callback function. - * @memberof util - * @param {asPromiseCallback} fn Function to call - * @param {*} ctx Function context - * @param {...*} params Function arguments - * @returns {Promise<*>} Promisified function - */ -declare function asPromise(fn: asPromiseCallback, ctx: any, ...params: any[]): Promise; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/aspromise/index.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/aspromise/index.js deleted file mode 100644 index b10f8267..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/aspromise/index.js +++ /dev/null @@ -1,52 +0,0 @@ -"use strict"; -module.exports = asPromise; - -/** - * Callback as used by {@link util.asPromise}. - * @typedef asPromiseCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {...*} params Additional arguments - * @returns {undefined} - */ - -/** - * Returns a promise from a node-style callback function. - * @memberof util - * @param {asPromiseCallback} fn Function to call - * @param {*} ctx Function context - * @param {...*} params Function arguments - * @returns {Promise<*>} Promisified function - */ -function asPromise(fn, ctx/*, varargs */) { - var params = new Array(arguments.length - 1), - offset = 0, - index = 2, - pending = true; - while (index < arguments.length) - params[offset++] = arguments[index++]; - return new Promise(function executor(resolve, reject) { - params[offset] = function callback(err/*, varargs */) { - if (pending) { - pending = false; - if (err) - reject(err); - else { - var params = new Array(arguments.length - 1), - offset = 0; - while (offset < params.length) - params[offset++] = arguments[offset]; - resolve.apply(null, params); - } - } - }; - try { - fn.apply(ctx || null, params); - } catch (err) { - if (pending) { - pending = false; - reject(err); - } - } - }); -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/aspromise/package.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/aspromise/package.json deleted file mode 100644 index 2d7e503f..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/aspromise/package.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "name": "@protobufjs/aspromise", - "description": "Returns a promise from a node-style callback function.", - "version": "1.1.2", - "author": "Daniel Wirtz ", - "repository": { - "type": "git", - "url": "https://github.com/dcodeIO/protobuf.js.git" - }, - "license": "BSD-3-Clause", - "main": "index.js", - "types": "index.d.ts", - "devDependencies": { - "istanbul": "^0.4.5", - "tape": "^4.6.3" - }, - "scripts": { - "test": "tape tests/*.js", - "coverage": "istanbul cover node_modules/tape/bin/tape tests/*.js" - } -} \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/aspromise/tests/index.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/aspromise/tests/index.js deleted file mode 100644 index 6d8d24c1..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/aspromise/tests/index.js +++ /dev/null @@ -1,130 +0,0 @@ -var tape = require("tape"); - -var asPromise = require(".."); - -tape.test("aspromise", function(test) { - - test.test(this.name + " - resolve", function(test) { - - function fn(arg1, arg2, callback) { - test.equal(this, ctx, "function should be called with this = ctx"); - test.equal(arg1, 1, "function should be called with arg1 = 1"); - test.equal(arg2, 2, "function should be called with arg2 = 2"); - callback(null, arg2); - } - - var ctx = {}; - - var promise = asPromise(fn, ctx, 1, 2); - promise.then(function(arg2) { - test.equal(arg2, 2, "promise should be resolved with arg2 = 2"); - test.end(); - }).catch(function(err) { - test.fail("promise should not be rejected (" + err + ")"); - }); - }); - - test.test(this.name + " - reject", function(test) { - - function fn(arg1, arg2, callback) { - test.equal(this, ctx, "function should be called with this = ctx"); - test.equal(arg1, 1, "function should be called with arg1 = 1"); - test.equal(arg2, 2, "function should be called with arg2 = 2"); - callback(arg1); - } - - var ctx = {}; - - var promise = asPromise(fn, ctx, 1, 2); - promise.then(function() { - test.fail("promise should not be resolved"); - }).catch(function(err) { - test.equal(err, 1, "promise should be rejected with err = 1"); - test.end(); - }); - }); - - test.test(this.name + " - resolve twice", function(test) { - - function fn(arg1, arg2, callback) { - test.equal(this, ctx, "function should be called with this = ctx"); - test.equal(arg1, 1, "function should be called with arg1 = 1"); - test.equal(arg2, 2, "function should be called with arg2 = 2"); - callback(null, arg2); - callback(null, arg1); - } - - var ctx = {}; - var count = 0; - - var promise = asPromise(fn, ctx, 1, 2); - promise.then(function(arg2) { - test.equal(arg2, 2, "promise should be resolved with arg2 = 2"); - if (++count > 1) - test.fail("promise should not be resolved twice"); - test.end(); - }).catch(function(err) { - test.fail("promise should not be rejected (" + err + ")"); - }); - }); - - test.test(this.name + " - reject twice", function(test) { - - function fn(arg1, arg2, callback) { - test.equal(this, ctx, "function should be called with this = ctx"); - test.equal(arg1, 1, "function should be called with arg1 = 1"); - test.equal(arg2, 2, "function should be called with arg2 = 2"); - callback(arg1); - callback(arg2); - } - - var ctx = {}; - var count = 0; - - var promise = asPromise(fn, ctx, 1, 2); - promise.then(function() { - test.fail("promise should not be resolved"); - }).catch(function(err) { - test.equal(err, 1, "promise should be rejected with err = 1"); - if (++count > 1) - test.fail("promise should not be rejected twice"); - test.end(); - }); - }); - - test.test(this.name + " - reject error", function(test) { - - function fn(callback) { - test.ok(arguments.length === 1 && typeof callback === "function", "function should be called with just a callback"); - throw 3; - } - - var promise = asPromise(fn, null); - promise.then(function() { - test.fail("promise should not be resolved"); - }).catch(function(err) { - test.equal(err, 3, "promise should be rejected with err = 3"); - test.end(); - }); - }); - - test.test(this.name + " - reject and error", function(test) { - - function fn(callback) { - callback(3); - throw 4; - } - - var count = 0; - - var promise = asPromise(fn, null); - promise.then(function() { - test.fail("promise should not be resolved"); - }).catch(function(err) { - test.equal(err, 3, "promise should be rejected with err = 3"); - if (++count > 1) - test.fail("promise should not be rejected twice"); - test.end(); - }); - }); -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/base64/LICENSE b/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/base64/LICENSE deleted file mode 100644 index 2a2d5601..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/base64/LICENSE +++ /dev/null @@ -1,26 +0,0 @@ -Copyright (c) 2016, Daniel Wirtz All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - -* Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -* Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -* Neither the name of its author, nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/base64/README.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/base64/README.md deleted file mode 100644 index 0e2eb33f..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/base64/README.md +++ /dev/null @@ -1,19 +0,0 @@ -@protobufjs/base64 -================== -[![npm](https://img.shields.io/npm/v/@protobufjs/base64.svg)](https://www.npmjs.com/package/@protobufjs/base64) - -A minimal base64 implementation for number arrays. - -API ---- - -* **base64.length(string: `string`): `number`**
- Calculates the byte length of a base64 encoded string. - -* **base64.encode(buffer: `Uint8Array`, start: `number`, end: `number`): `string`**
- Encodes a buffer to a base64 encoded string. - -* **base64.decode(string: `string`, buffer: `Uint8Array`, offset: `number`): `number`**
- Decodes a base64 encoded string to a buffer. - -**License:** [BSD 3-Clause License](https://opensource.org/licenses/BSD-3-Clause) diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/base64/index.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/base64/index.d.ts deleted file mode 100644 index 16fd7db7..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/base64/index.d.ts +++ /dev/null @@ -1,32 +0,0 @@ -/** - * Calculates the byte length of a base64 encoded string. - * @param {string} string Base64 encoded string - * @returns {number} Byte length - */ -export function length(string: string): number; - -/** - * Encodes a buffer to a base64 encoded string. - * @param {Uint8Array} buffer Source buffer - * @param {number} start Source start - * @param {number} end Source end - * @returns {string} Base64 encoded string - */ -export function encode(buffer: Uint8Array, start: number, end: number): string; - -/** - * Decodes a base64 encoded string to a buffer. - * @param {string} string Source string - * @param {Uint8Array} buffer Destination buffer - * @param {number} offset Destination offset - * @returns {number} Number of bytes written - * @throws {Error} If encoding is invalid - */ -export function decode(string: string, buffer: Uint8Array, offset: number): number; - -/** - * Tests if the specified string appears to be base64 encoded. - * @param {string} string String to test - * @returns {boolean} `true` if it appears to be base64 encoded, otherwise false - */ -export function test(string: string): boolean; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/base64/index.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/base64/index.js deleted file mode 100644 index 26d54433..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/base64/index.js +++ /dev/null @@ -1,139 +0,0 @@ -"use strict"; - -/** - * A minimal base64 implementation for number arrays. - * @memberof util - * @namespace - */ -var base64 = exports; - -/** - * Calculates the byte length of a base64 encoded string. - * @param {string} string Base64 encoded string - * @returns {number} Byte length - */ -base64.length = function length(string) { - var p = string.length; - if (!p) - return 0; - var n = 0; - while (--p % 4 > 1 && string.charAt(p) === "=") - ++n; - return Math.ceil(string.length * 3) / 4 - n; -}; - -// Base64 encoding table -var b64 = new Array(64); - -// Base64 decoding table -var s64 = new Array(123); - -// 65..90, 97..122, 48..57, 43, 47 -for (var i = 0; i < 64;) - s64[b64[i] = i < 26 ? i + 65 : i < 52 ? i + 71 : i < 62 ? i - 4 : i - 59 | 43] = i++; - -/** - * Encodes a buffer to a base64 encoded string. - * @param {Uint8Array} buffer Source buffer - * @param {number} start Source start - * @param {number} end Source end - * @returns {string} Base64 encoded string - */ -base64.encode = function encode(buffer, start, end) { - var parts = null, - chunk = []; - var i = 0, // output index - j = 0, // goto index - t; // temporary - while (start < end) { - var b = buffer[start++]; - switch (j) { - case 0: - chunk[i++] = b64[b >> 2]; - t = (b & 3) << 4; - j = 1; - break; - case 1: - chunk[i++] = b64[t | b >> 4]; - t = (b & 15) << 2; - j = 2; - break; - case 2: - chunk[i++] = b64[t | b >> 6]; - chunk[i++] = b64[b & 63]; - j = 0; - break; - } - if (i > 8191) { - (parts || (parts = [])).push(String.fromCharCode.apply(String, chunk)); - i = 0; - } - } - if (j) { - chunk[i++] = b64[t]; - chunk[i++] = 61; - if (j === 1) - chunk[i++] = 61; - } - if (parts) { - if (i) - parts.push(String.fromCharCode.apply(String, chunk.slice(0, i))); - return parts.join(""); - } - return String.fromCharCode.apply(String, chunk.slice(0, i)); -}; - -var invalidEncoding = "invalid encoding"; - -/** - * Decodes a base64 encoded string to a buffer. - * @param {string} string Source string - * @param {Uint8Array} buffer Destination buffer - * @param {number} offset Destination offset - * @returns {number} Number of bytes written - * @throws {Error} If encoding is invalid - */ -base64.decode = function decode(string, buffer, offset) { - var start = offset; - var j = 0, // goto index - t; // temporary - for (var i = 0; i < string.length;) { - var c = string.charCodeAt(i++); - if (c === 61 && j > 1) - break; - if ((c = s64[c]) === undefined) - throw Error(invalidEncoding); - switch (j) { - case 0: - t = c; - j = 1; - break; - case 1: - buffer[offset++] = t << 2 | (c & 48) >> 4; - t = c; - j = 2; - break; - case 2: - buffer[offset++] = (t & 15) << 4 | (c & 60) >> 2; - t = c; - j = 3; - break; - case 3: - buffer[offset++] = (t & 3) << 6 | c; - j = 0; - break; - } - } - if (j === 1) - throw Error(invalidEncoding); - return offset - start; -}; - -/** - * Tests if the specified string appears to be base64 encoded. - * @param {string} string String to test - * @returns {boolean} `true` if probably base64 encoded, otherwise false - */ -base64.test = function test(string) { - return /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(string); -}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/base64/package.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/base64/package.json deleted file mode 100644 index 46e71d41..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/base64/package.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "name": "@protobufjs/base64", - "description": "A minimal base64 implementation for number arrays.", - "version": "1.1.2", - "author": "Daniel Wirtz ", - "repository": { - "type": "git", - "url": "https://github.com/dcodeIO/protobuf.js.git" - }, - "license": "BSD-3-Clause", - "main": "index.js", - "types": "index.d.ts", - "devDependencies": { - "istanbul": "^0.4.5", - "tape": "^4.6.3" - }, - "scripts": { - "test": "tape tests/*.js", - "coverage": "istanbul cover node_modules/tape/bin/tape tests/*.js" - } -} \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/base64/tests/index.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/base64/tests/index.js deleted file mode 100644 index 89828f2b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/base64/tests/index.js +++ /dev/null @@ -1,46 +0,0 @@ -var tape = require("tape"); - -var base64 = require(".."); - -var strings = { - "": "", - "a": "YQ==", - "ab": "YWI=", - "abcdefg": "YWJjZGVmZw==", - "abcdefgh": "YWJjZGVmZ2g=", - "abcdefghi": "YWJjZGVmZ2hp" -}; - -tape.test("base64", function(test) { - - Object.keys(strings).forEach(function(str) { - var enc = strings[str]; - - test.equal(base64.test(enc), true, "should detect '" + enc + "' to be base64 encoded"); - - var len = base64.length(enc); - test.equal(len, str.length, "should calculate '" + enc + "' as " + str.length + " bytes"); - - var buf = new Array(len); - var len2 = base64.decode(enc, buf, 0); - test.equal(len2, len, "should decode '" + enc + "' to " + len + " bytes"); - - test.equal(String.fromCharCode.apply(String, buf), str, "should decode '" + enc + "' to '" + str + "'"); - - var enc2 = base64.encode(buf, 0, buf.length); - test.equal(enc2, enc, "should encode '" + str + "' to '" + enc + "'"); - - }); - - test.throws(function() { - var buf = new Array(10); - base64.decode("YQ!", buf, 0); - }, Error, "should throw if encoding is invalid"); - - test.throws(function() { - var buf = new Array(10); - base64.decode("Y", buf, 0); - }, Error, "should throw if string is truncated"); - - test.end(); -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/codegen/LICENSE b/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/codegen/LICENSE deleted file mode 100644 index 2a2d5601..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/codegen/LICENSE +++ /dev/null @@ -1,26 +0,0 @@ -Copyright (c) 2016, Daniel Wirtz All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - -* Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -* Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -* Neither the name of its author, nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/codegen/README.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/codegen/README.md deleted file mode 100644 index 01693386..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/codegen/README.md +++ /dev/null @@ -1,49 +0,0 @@ -@protobufjs/codegen -=================== -[![npm](https://img.shields.io/npm/v/@protobufjs/codegen.svg)](https://www.npmjs.com/package/@protobufjs/codegen) - -A minimalistic code generation utility. - -API ---- - -* **codegen([functionParams: `string[]`], [functionName: string]): `Codegen`**
- Begins generating a function. - -* **codegen.verbose = `false`**
- When set to true, codegen will log generated code to console. Useful for debugging. - -Invoking **codegen** returns an appender function that appends code to the function's body and returns itself: - -* **Codegen(formatString: `string`, [...formatParams: `any`]): Codegen**
- Appends code to the function's body. The format string can contain placeholders specifying the types of inserted format parameters: - - * `%d`: Number (integer or floating point value) - * `%f`: Floating point value - * `%i`: Integer value - * `%j`: JSON.stringify'ed value - * `%s`: String value - * `%%`: Percent sign
- -* **Codegen([scope: `Object.`]): `Function`**
- Finishes the function and returns it. - -* **Codegen.toString([functionNameOverride: `string`]): `string`**
- Returns the function as a string. - -Example -------- - -```js -var codegen = require("@protobufjs/codegen"); - -var add = codegen(["a", "b"], "add") // A function with parameters "a" and "b" named "add" - ("// awesome comment") // adds the line to the function's body - ("return a + b - c + %d", 1) // replaces %d with 1 and adds the line to the body - ({ c: 1 }); // adds "c" with a value of 1 to the function's scope - -console.log(add.toString()); // function add(a, b) { return a + b - c + 1 } -console.log(add(1, 2)); // calculates 1 + 2 - 1 + 1 = 3 -``` - -**License:** [BSD 3-Clause License](https://opensource.org/licenses/BSD-3-Clause) diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/codegen/index.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/codegen/index.d.ts deleted file mode 100644 index f7fb921d..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/codegen/index.d.ts +++ /dev/null @@ -1,31 +0,0 @@ -export = codegen; - -/** - * Appends code to the function's body. - * @param [formatStringOrScope] Format string or, to finish the function, an object of additional scope variables, if any - * @param [formatParams] Format parameters - * @returns Itself or the generated function if finished - * @throws {Error} If format parameter counts do not match - */ -type Codegen = (formatStringOrScope?: (string|{ [k: string]: any }), ...formatParams: any[]) => (Codegen|Function); - -/** - * Begins generating a function. - * @param functionParams Function parameter names - * @param [functionName] Function name if not anonymous - * @returns Appender that appends code to the function's body - */ -declare function codegen(functionParams: string[], functionName?: string): Codegen; - -/** - * Begins generating a function. - * @param [functionName] Function name if not anonymous - * @returns Appender that appends code to the function's body - */ -declare function codegen(functionName?: string): Codegen; - -declare namespace codegen { - - /** When set to `true`, codegen will log generated code to console. Useful for debugging. */ - let verbose: boolean; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/codegen/index.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/codegen/index.js deleted file mode 100644 index de73f80b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/codegen/index.js +++ /dev/null @@ -1,99 +0,0 @@ -"use strict"; -module.exports = codegen; - -/** - * Begins generating a function. - * @memberof util - * @param {string[]} functionParams Function parameter names - * @param {string} [functionName] Function name if not anonymous - * @returns {Codegen} Appender that appends code to the function's body - */ -function codegen(functionParams, functionName) { - - /* istanbul ignore if */ - if (typeof functionParams === "string") { - functionName = functionParams; - functionParams = undefined; - } - - var body = []; - - /** - * Appends code to the function's body or finishes generation. - * @typedef Codegen - * @type {function} - * @param {string|Object.} [formatStringOrScope] Format string or, to finish the function, an object of additional scope variables, if any - * @param {...*} [formatParams] Format parameters - * @returns {Codegen|Function} Itself or the generated function if finished - * @throws {Error} If format parameter counts do not match - */ - - function Codegen(formatStringOrScope) { - // note that explicit array handling below makes this ~50% faster - - // finish the function - if (typeof formatStringOrScope !== "string") { - var source = toString(); - if (codegen.verbose) - console.log("codegen: " + source); // eslint-disable-line no-console - source = "return " + source; - if (formatStringOrScope) { - var scopeKeys = Object.keys(formatStringOrScope), - scopeParams = new Array(scopeKeys.length + 1), - scopeValues = new Array(scopeKeys.length), - scopeOffset = 0; - while (scopeOffset < scopeKeys.length) { - scopeParams[scopeOffset] = scopeKeys[scopeOffset]; - scopeValues[scopeOffset] = formatStringOrScope[scopeKeys[scopeOffset++]]; - } - scopeParams[scopeOffset] = source; - return Function.apply(null, scopeParams).apply(null, scopeValues); // eslint-disable-line no-new-func - } - return Function(source)(); // eslint-disable-line no-new-func - } - - // otherwise append to body - var formatParams = new Array(arguments.length - 1), - formatOffset = 0; - while (formatOffset < formatParams.length) - formatParams[formatOffset] = arguments[++formatOffset]; - formatOffset = 0; - formatStringOrScope = formatStringOrScope.replace(/%([%dfijs])/g, function replace($0, $1) { - var value = formatParams[formatOffset++]; - switch ($1) { - case "d": case "f": return String(Number(value)); - case "i": return String(Math.floor(value)); - case "j": return JSON.stringify(value); - case "s": return String(value); - } - return "%"; - }); - if (formatOffset !== formatParams.length) - throw Error("parameter count mismatch"); - body.push(formatStringOrScope); - return Codegen; - } - - function toString(functionNameOverride) { - return "function " + (functionNameOverride || functionName || "") + "(" + (functionParams && functionParams.join(",") || "") + "){\n " + body.join("\n ") + "\n}"; - } - - Codegen.toString = toString; - return Codegen; -} - -/** - * Begins generating a function. - * @memberof util - * @function codegen - * @param {string} [functionName] Function name if not anonymous - * @returns {Codegen} Appender that appends code to the function's body - * @variation 2 - */ - -/** - * When set to `true`, codegen will log generated code to console. Useful for debugging. - * @name util.codegen.verbose - * @type {boolean} - */ -codegen.verbose = false; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/codegen/package.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/codegen/package.json deleted file mode 100644 index 92f2c4cd..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/codegen/package.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "name": "@protobufjs/codegen", - "description": "A minimalistic code generation utility.", - "version": "2.0.4", - "author": "Daniel Wirtz ", - "repository": { - "type": "git", - "url": "https://github.com/dcodeIO/protobuf.js.git" - }, - "license": "BSD-3-Clause", - "main": "index.js", - "types": "index.d.ts" -} \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/codegen/tests/index.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/codegen/tests/index.js deleted file mode 100644 index f3a3db11..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/codegen/tests/index.js +++ /dev/null @@ -1,13 +0,0 @@ -var codegen = require(".."); - -// new require("benchmark").Suite().add("add", function() { - -var add = codegen(["a", "b"], "add") - ("// awesome comment") - ("return a + b - c + %d", 1) - ({ c: 1 }); - -if (add(1, 2) !== 3) - throw Error("failed"); - -// }).on("cycle", function(event) { process.stdout.write(String(event.target) + "\n"); }).run(); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/eventemitter/LICENSE b/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/eventemitter/LICENSE deleted file mode 100644 index 2a2d5601..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/eventemitter/LICENSE +++ /dev/null @@ -1,26 +0,0 @@ -Copyright (c) 2016, Daniel Wirtz All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - -* Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -* Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -* Neither the name of its author, nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/eventemitter/README.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/eventemitter/README.md deleted file mode 100644 index 998d3151..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/eventemitter/README.md +++ /dev/null @@ -1,22 +0,0 @@ -@protobufjs/eventemitter -======================== -[![npm](https://img.shields.io/npm/v/@protobufjs/eventemitter.svg)](https://www.npmjs.com/package/@protobufjs/eventemitter) - -A minimal event emitter. - -API ---- - -* **new EventEmitter()**
- Constructs a new event emitter instance. - -* **EventEmitter#on(evt: `string`, fn: `function`, [ctx: `Object`]): `EventEmitter`**
- Registers an event listener. - -* **EventEmitter#off([evt: `string`], [fn: `function`]): `EventEmitter`**
- Removes an event listener or any matching listeners if arguments are omitted. - -* **EventEmitter#emit(evt: `string`, ...args: `*`): `EventEmitter`**
- Emits an event by calling its listeners with the specified arguments. - -**License:** [BSD 3-Clause License](https://opensource.org/licenses/BSD-3-Clause) diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/eventemitter/index.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/eventemitter/index.d.ts deleted file mode 100644 index 4615963f..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/eventemitter/index.d.ts +++ /dev/null @@ -1,43 +0,0 @@ -export = EventEmitter; - -/** - * Constructs a new event emitter instance. - * @classdesc A minimal event emitter. - * @memberof util - * @constructor - */ -declare class EventEmitter { - - /** - * Constructs a new event emitter instance. - * @classdesc A minimal event emitter. - * @memberof util - * @constructor - */ - constructor(); - - /** - * Registers an event listener. - * @param {string} evt Event name - * @param {function} fn Listener - * @param {*} [ctx] Listener context - * @returns {util.EventEmitter} `this` - */ - on(evt: string, fn: () => any, ctx?: any): EventEmitter; - - /** - * Removes an event listener or any matching listeners if arguments are omitted. - * @param {string} [evt] Event name. Removes all listeners if omitted. - * @param {function} [fn] Listener to remove. Removes all listeners of `evt` if omitted. - * @returns {util.EventEmitter} `this` - */ - off(evt?: string, fn?: () => any): EventEmitter; - - /** - * Emits an event by calling its listeners with the specified arguments. - * @param {string} evt Event name - * @param {...*} args Arguments - * @returns {util.EventEmitter} `this` - */ - emit(evt: string, ...args: any[]): EventEmitter; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/eventemitter/index.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/eventemitter/index.js deleted file mode 100644 index 76ce9385..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/eventemitter/index.js +++ /dev/null @@ -1,76 +0,0 @@ -"use strict"; -module.exports = EventEmitter; - -/** - * Constructs a new event emitter instance. - * @classdesc A minimal event emitter. - * @memberof util - * @constructor - */ -function EventEmitter() { - - /** - * Registered listeners. - * @type {Object.} - * @private - */ - this._listeners = {}; -} - -/** - * Registers an event listener. - * @param {string} evt Event name - * @param {function} fn Listener - * @param {*} [ctx] Listener context - * @returns {util.EventEmitter} `this` - */ -EventEmitter.prototype.on = function on(evt, fn, ctx) { - (this._listeners[evt] || (this._listeners[evt] = [])).push({ - fn : fn, - ctx : ctx || this - }); - return this; -}; - -/** - * Removes an event listener or any matching listeners if arguments are omitted. - * @param {string} [evt] Event name. Removes all listeners if omitted. - * @param {function} [fn] Listener to remove. Removes all listeners of `evt` if omitted. - * @returns {util.EventEmitter} `this` - */ -EventEmitter.prototype.off = function off(evt, fn) { - if (evt === undefined) - this._listeners = {}; - else { - if (fn === undefined) - this._listeners[evt] = []; - else { - var listeners = this._listeners[evt]; - for (var i = 0; i < listeners.length;) - if (listeners[i].fn === fn) - listeners.splice(i, 1); - else - ++i; - } - } - return this; -}; - -/** - * Emits an event by calling its listeners with the specified arguments. - * @param {string} evt Event name - * @param {...*} args Arguments - * @returns {util.EventEmitter} `this` - */ -EventEmitter.prototype.emit = function emit(evt) { - var listeners = this._listeners[evt]; - if (listeners) { - var args = [], - i = 1; - for (; i < arguments.length;) - args.push(arguments[i++]); - for (i = 0; i < listeners.length;) - listeners[i].fn.apply(listeners[i++].ctx, args); - } - return this; -}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/eventemitter/package.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/eventemitter/package.json deleted file mode 100644 index 1d565e62..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/eventemitter/package.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "name": "@protobufjs/eventemitter", - "description": "A minimal event emitter.", - "version": "1.1.0", - "author": "Daniel Wirtz ", - "repository": { - "type": "git", - "url": "https://github.com/dcodeIO/protobuf.js.git" - }, - "license": "BSD-3-Clause", - "main": "index.js", - "types": "index.d.ts", - "devDependencies": { - "istanbul": "^0.4.5", - "tape": "^4.6.3" - }, - "scripts": { - "test": "tape tests/*.js", - "coverage": "istanbul cover node_modules/tape/bin/tape tests/*.js" - } -} \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/eventemitter/tests/index.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/eventemitter/tests/index.js deleted file mode 100644 index aeee277c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/eventemitter/tests/index.js +++ /dev/null @@ -1,47 +0,0 @@ -var tape = require("tape"); - -var EventEmitter = require(".."); - -tape.test("eventemitter", function(test) { - - var ee = new EventEmitter(); - var fn; - var ctx = {}; - - test.doesNotThrow(function() { - ee.emit("a", 1); - ee.off(); - ee.off("a"); - ee.off("a", function() {}); - }, "should not throw if no listeners are registered"); - - test.equal(ee.on("a", function(arg1) { - test.equal(this, ctx, "should be called with this = ctx"); - test.equal(arg1, 1, "should be called with arg1 = 1"); - }, ctx), ee, "should return itself when registering events"); - ee.emit("a", 1); - - ee.off("a"); - test.same(ee._listeners, { a: [] }, "should remove all listeners of the respective event when calling off(evt)"); - - ee.off(); - test.same(ee._listeners, {}, "should remove all listeners when just calling off()"); - - ee.on("a", fn = function(arg1) { - test.equal(this, ctx, "should be called with this = ctx"); - test.equal(arg1, 1, "should be called with arg1 = 1"); - }, ctx).emit("a", 1); - - ee.off("a", fn); - test.same(ee._listeners, { a: [] }, "should remove the exact listener when calling off(evt, fn)"); - - ee.on("a", function() { - test.equal(this, ee, "should be called with this = ee"); - }).emit("a"); - - test.doesNotThrow(function() { - ee.off("a", fn); - }, "should not throw if no such listener is found"); - - test.end(); -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/fetch/LICENSE b/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/fetch/LICENSE deleted file mode 100644 index 2a2d5601..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/fetch/LICENSE +++ /dev/null @@ -1,26 +0,0 @@ -Copyright (c) 2016, Daniel Wirtz All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - -* Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -* Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -* Neither the name of its author, nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/fetch/README.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/fetch/README.md deleted file mode 100644 index 11088a0b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/fetch/README.md +++ /dev/null @@ -1,13 +0,0 @@ -@protobufjs/fetch -================= -[![npm](https://img.shields.io/npm/v/@protobufjs/fetch.svg)](https://www.npmjs.com/package/@protobufjs/fetch) - -Fetches the contents of a file accross node and browsers. - -API ---- - -* **fetch(path: `string`, [options: { binary: boolean } ], [callback: `function(error: ?Error, [contents: string])`]): `Promise|undefined`** - Fetches the contents of a file. - -**License:** [BSD 3-Clause License](https://opensource.org/licenses/BSD-3-Clause) diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/fetch/index.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/fetch/index.d.ts deleted file mode 100644 index 77cf9f35..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/fetch/index.d.ts +++ /dev/null @@ -1,56 +0,0 @@ -export = fetch; - -/** - * Node-style callback as used by {@link util.fetch}. - * @typedef FetchCallback - * @type {function} - * @param {?Error} error Error, if any, otherwise `null` - * @param {string} [contents] File contents, if there hasn't been an error - * @returns {undefined} - */ -type FetchCallback = (error: Error, contents?: string) => void; - -/** - * Options as used by {@link util.fetch}. - * @typedef FetchOptions - * @type {Object} - * @property {boolean} [binary=false] Whether expecting a binary response - * @property {boolean} [xhr=false] If `true`, forces the use of XMLHttpRequest - */ - -interface FetchOptions { - binary?: boolean; - xhr?: boolean -} - -/** - * Fetches the contents of a file. - * @memberof util - * @param {string} filename File path or url - * @param {FetchOptions} options Fetch options - * @param {FetchCallback} callback Callback function - * @returns {undefined} - */ -declare function fetch(filename: string, options: FetchOptions, callback: FetchCallback): void; - -/** - * Fetches the contents of a file. - * @name util.fetch - * @function - * @param {string} path File path or url - * @param {FetchCallback} callback Callback function - * @returns {undefined} - * @variation 2 - */ -declare function fetch(path: string, callback: FetchCallback): void; - -/** - * Fetches the contents of a file. - * @name util.fetch - * @function - * @param {string} path File path or url - * @param {FetchOptions} [options] Fetch options - * @returns {Promise} Promise - * @variation 3 - */ -declare function fetch(path: string, options?: FetchOptions): Promise<(string|Uint8Array)>; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/fetch/index.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/fetch/index.js deleted file mode 100644 index f2766f54..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/fetch/index.js +++ /dev/null @@ -1,115 +0,0 @@ -"use strict"; -module.exports = fetch; - -var asPromise = require("@protobufjs/aspromise"), - inquire = require("@protobufjs/inquire"); - -var fs = inquire("fs"); - -/** - * Node-style callback as used by {@link util.fetch}. - * @typedef FetchCallback - * @type {function} - * @param {?Error} error Error, if any, otherwise `null` - * @param {string} [contents] File contents, if there hasn't been an error - * @returns {undefined} - */ - -/** - * Options as used by {@link util.fetch}. - * @typedef FetchOptions - * @type {Object} - * @property {boolean} [binary=false] Whether expecting a binary response - * @property {boolean} [xhr=false] If `true`, forces the use of XMLHttpRequest - */ - -/** - * Fetches the contents of a file. - * @memberof util - * @param {string} filename File path or url - * @param {FetchOptions} options Fetch options - * @param {FetchCallback} callback Callback function - * @returns {undefined} - */ -function fetch(filename, options, callback) { - if (typeof options === "function") { - callback = options; - options = {}; - } else if (!options) - options = {}; - - if (!callback) - return asPromise(fetch, this, filename, options); // eslint-disable-line no-invalid-this - - // if a node-like filesystem is present, try it first but fall back to XHR if nothing is found. - if (!options.xhr && fs && fs.readFile) - return fs.readFile(filename, function fetchReadFileCallback(err, contents) { - return err && typeof XMLHttpRequest !== "undefined" - ? fetch.xhr(filename, options, callback) - : err - ? callback(err) - : callback(null, options.binary ? contents : contents.toString("utf8")); - }); - - // use the XHR version otherwise. - return fetch.xhr(filename, options, callback); -} - -/** - * Fetches the contents of a file. - * @name util.fetch - * @function - * @param {string} path File path or url - * @param {FetchCallback} callback Callback function - * @returns {undefined} - * @variation 2 - */ - -/** - * Fetches the contents of a file. - * @name util.fetch - * @function - * @param {string} path File path or url - * @param {FetchOptions} [options] Fetch options - * @returns {Promise} Promise - * @variation 3 - */ - -/**/ -fetch.xhr = function fetch_xhr(filename, options, callback) { - var xhr = new XMLHttpRequest(); - xhr.onreadystatechange /* works everywhere */ = function fetchOnReadyStateChange() { - - if (xhr.readyState !== 4) - return undefined; - - // local cors security errors return status 0 / empty string, too. afaik this cannot be - // reliably distinguished from an actually empty file for security reasons. feel free - // to send a pull request if you are aware of a solution. - if (xhr.status !== 0 && xhr.status !== 200) - return callback(Error("status " + xhr.status)); - - // if binary data is expected, make sure that some sort of array is returned, even if - // ArrayBuffers are not supported. the binary string fallback, however, is unsafe. - if (options.binary) { - var buffer = xhr.response; - if (!buffer) { - buffer = []; - for (var i = 0; i < xhr.responseText.length; ++i) - buffer.push(xhr.responseText.charCodeAt(i) & 255); - } - return callback(null, typeof Uint8Array !== "undefined" ? new Uint8Array(buffer) : buffer); - } - return callback(null, xhr.responseText); - }; - - if (options.binary) { - // ref: https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/Sending_and_Receiving_Binary_Data#Receiving_binary_data_in_older_browsers - if ("overrideMimeType" in xhr) - xhr.overrideMimeType("text/plain; charset=x-user-defined"); - xhr.responseType = "arraybuffer"; - } - - xhr.open("GET", filename); - xhr.send(); -}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/fetch/package.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/fetch/package.json deleted file mode 100644 index 10096ea1..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/fetch/package.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "name": "@protobufjs/fetch", - "description": "Fetches the contents of a file accross node and browsers.", - "version": "1.1.0", - "author": "Daniel Wirtz ", - "repository": { - "type": "git", - "url": "https://github.com/dcodeIO/protobuf.js.git" - }, - "dependencies": { - "@protobufjs/aspromise": "^1.1.1", - "@protobufjs/inquire": "^1.1.0" - }, - "license": "BSD-3-Clause", - "main": "index.js", - "types": "index.d.ts", - "devDependencies": { - "istanbul": "^0.4.5", - "tape": "^4.6.3" - }, - "scripts": { - "test": "tape tests/*.js", - "coverage": "istanbul cover node_modules/tape/bin/tape tests/*.js" - } -} \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/fetch/tests/index.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/fetch/tests/index.js deleted file mode 100644 index 3cb0daeb..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/fetch/tests/index.js +++ /dev/null @@ -1,16 +0,0 @@ -var tape = require("tape"); - -var fetch = require(".."); - -tape.test("fetch", function(test) { - - if (typeof Promise !== "undefined") { - var promise = fetch("NOTFOUND"); - promise.catch(function() {}); - test.ok(promise instanceof Promise, "should return a promise if callback has been omitted"); - } - - // TODO - some way to test this properly? - - test.end(); -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/float/LICENSE b/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/float/LICENSE deleted file mode 100644 index 2a2d5601..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/float/LICENSE +++ /dev/null @@ -1,26 +0,0 @@ -Copyright (c) 2016, Daniel Wirtz All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - -* Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -* Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -* Neither the name of its author, nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/float/README.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/float/README.md deleted file mode 100644 index 8947baea..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/float/README.md +++ /dev/null @@ -1,102 +0,0 @@ -@protobufjs/float -================= -[![npm](https://img.shields.io/npm/v/@protobufjs/float.svg)](https://www.npmjs.com/package/@protobufjs/float) - -Reads / writes floats / doubles from / to buffers in both modern and ancient browsers. Fast. - -API ---- - -* **writeFloatLE(val: `number`, buf: `Uint8Array`, pos: `number`)**
- Writes a 32 bit float to a buffer using little endian byte order. - -* **writeFloatBE(val: `number`, buf: `Uint8Array`, pos: `number`)**
- Writes a 32 bit float to a buffer using big endian byte order. - -* **readFloatLE(buf: `Uint8Array`, pos: `number`): `number`**
- Reads a 32 bit float from a buffer using little endian byte order. - -* **readFloatBE(buf: `Uint8Array`, pos: `number`): `number`**
- Reads a 32 bit float from a buffer using big endian byte order. - -* **writeDoubleLE(val: `number`, buf: `Uint8Array`, pos: `number`)**
- Writes a 64 bit double to a buffer using little endian byte order. - -* **writeDoubleBE(val: `number`, buf: `Uint8Array`, pos: `number`)**
- Writes a 64 bit double to a buffer using big endian byte order. - -* **readDoubleLE(buf: `Uint8Array`, pos: `number`): `number`**
- Reads a 64 bit double from a buffer using little endian byte order. - -* **readDoubleBE(buf: `Uint8Array`, pos: `number`): `number`**
- Reads a 64 bit double from a buffer using big endian byte order. - -Performance ------------ -There is a simple benchmark included comparing raw read/write performance of this library (float), float's fallback for old browsers, the [ieee754](https://www.npmjs.com/package/ieee754) module and node's [buffer](https://nodejs.org/api/buffer.html). On an i7-2600k running node 6.9.1 it yields: - -``` -benchmarking writeFloat performance ... - -float x 42,741,625 ops/sec ±1.75% (81 runs sampled) -float (fallback) x 11,272,532 ops/sec ±1.12% (85 runs sampled) -ieee754 x 8,653,337 ops/sec ±1.18% (84 runs sampled) -buffer x 12,412,414 ops/sec ±1.41% (83 runs sampled) -buffer (noAssert) x 13,471,149 ops/sec ±1.09% (84 runs sampled) - - float was fastest - float (fallback) was 73.5% slower - ieee754 was 79.6% slower - buffer was 70.9% slower - buffer (noAssert) was 68.3% slower - -benchmarking readFloat performance ... - -float x 44,382,729 ops/sec ±1.70% (84 runs sampled) -float (fallback) x 20,925,938 ops/sec ±0.86% (87 runs sampled) -ieee754 x 17,189,009 ops/sec ±1.01% (87 runs sampled) -buffer x 10,518,437 ops/sec ±1.04% (83 runs sampled) -buffer (noAssert) x 11,031,636 ops/sec ±1.15% (87 runs sampled) - - float was fastest - float (fallback) was 52.5% slower - ieee754 was 61.0% slower - buffer was 76.1% slower - buffer (noAssert) was 75.0% slower - -benchmarking writeDouble performance ... - -float x 38,624,906 ops/sec ±0.93% (83 runs sampled) -float (fallback) x 10,457,811 ops/sec ±1.54% (85 runs sampled) -ieee754 x 7,681,130 ops/sec ±1.11% (83 runs sampled) -buffer x 12,657,876 ops/sec ±1.03% (83 runs sampled) -buffer (noAssert) x 13,372,795 ops/sec ±0.84% (85 runs sampled) - - float was fastest - float (fallback) was 73.1% slower - ieee754 was 80.1% slower - buffer was 67.3% slower - buffer (noAssert) was 65.3% slower - -benchmarking readDouble performance ... - -float x 40,527,888 ops/sec ±1.05% (84 runs sampled) -float (fallback) x 18,696,480 ops/sec ±0.84% (86 runs sampled) -ieee754 x 14,074,028 ops/sec ±1.04% (87 runs sampled) -buffer x 10,092,367 ops/sec ±1.15% (84 runs sampled) -buffer (noAssert) x 10,623,793 ops/sec ±0.96% (84 runs sampled) - - float was fastest - float (fallback) was 53.8% slower - ieee754 was 65.3% slower - buffer was 75.1% slower - buffer (noAssert) was 73.8% slower -``` - -To run it yourself: - -``` -$> npm run bench -``` - -**License:** [BSD 3-Clause License](https://opensource.org/licenses/BSD-3-Clause) diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/float/bench/index.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/float/bench/index.js deleted file mode 100644 index 1b3c4b8a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/float/bench/index.js +++ /dev/null @@ -1,87 +0,0 @@ -"use strict"; - -var float = require(".."), - ieee754 = require("ieee754"), - newSuite = require("./suite"); - -var F32 = Float32Array; -var F64 = Float64Array; -delete global.Float32Array; -delete global.Float64Array; -var floatFallback = float({}); -global.Float32Array = F32; -global.Float64Array = F64; - -var buf = new Buffer(8); - -newSuite("writeFloat") -.add("float", function() { - float.writeFloatLE(0.1, buf, 0); -}) -.add("float (fallback)", function() { - floatFallback.writeFloatLE(0.1, buf, 0); -}) -.add("ieee754", function() { - ieee754.write(buf, 0.1, 0, true, 23, 4); -}) -.add("buffer", function() { - buf.writeFloatLE(0.1, 0); -}) -.add("buffer (noAssert)", function() { - buf.writeFloatLE(0.1, 0, true); -}) -.run(); - -newSuite("readFloat") -.add("float", function() { - float.readFloatLE(buf, 0); -}) -.add("float (fallback)", function() { - floatFallback.readFloatLE(buf, 0); -}) -.add("ieee754", function() { - ieee754.read(buf, 0, true, 23, 4); -}) -.add("buffer", function() { - buf.readFloatLE(0); -}) -.add("buffer (noAssert)", function() { - buf.readFloatLE(0, true); -}) -.run(); - -newSuite("writeDouble") -.add("float", function() { - float.writeDoubleLE(0.1, buf, 0); -}) -.add("float (fallback)", function() { - floatFallback.writeDoubleLE(0.1, buf, 0); -}) -.add("ieee754", function() { - ieee754.write(buf, 0.1, 0, true, 52, 8); -}) -.add("buffer", function() { - buf.writeDoubleLE(0.1, 0); -}) -.add("buffer (noAssert)", function() { - buf.writeDoubleLE(0.1, 0, true); -}) -.run(); - -newSuite("readDouble") -.add("float", function() { - float.readDoubleLE(buf, 0); -}) -.add("float (fallback)", function() { - floatFallback.readDoubleLE(buf, 0); -}) -.add("ieee754", function() { - ieee754.read(buf, 0, true, 52, 8); -}) -.add("buffer", function() { - buf.readDoubleLE(0); -}) -.add("buffer (noAssert)", function() { - buf.readDoubleLE(0, true); -}) -.run(); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/float/bench/suite.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/float/bench/suite.js deleted file mode 100644 index 38205795..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/float/bench/suite.js +++ /dev/null @@ -1,46 +0,0 @@ -"use strict"; -module.exports = newSuite; - -var benchmark = require("benchmark"), - chalk = require("chalk"); - -var padSize = 27; - -function newSuite(name) { - var benches = []; - return new benchmark.Suite(name) - .on("add", function(event) { - benches.push(event.target); - }) - .on("start", function() { - process.stdout.write("benchmarking " + name + " performance ...\n\n"); - }) - .on("cycle", function(event) { - process.stdout.write(String(event.target) + "\n"); - }) - .on("complete", function() { - if (benches.length > 1) { - var fastest = this.filter("fastest"), // eslint-disable-line no-invalid-this - fastestHz = getHz(fastest[0]); - process.stdout.write("\n" + chalk.white(pad(fastest[0].name, padSize)) + " was " + chalk.green("fastest") + "\n"); - benches.forEach(function(bench) { - if (fastest.indexOf(bench) === 0) - return; - var hz = hz = getHz(bench); - var percent = (1 - hz / fastestHz) * 100; - process.stdout.write(chalk.white(pad(bench.name, padSize)) + " was " + chalk.red(percent.toFixed(1) + "% slower") + "\n"); - }); - } - process.stdout.write("\n"); - }); -} - -function getHz(bench) { - return 1 / (bench.stats.mean + bench.stats.moe); -} - -function pad(str, len, l) { - while (str.length < len) - str = l ? str + " " : " " + str; - return str; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/float/index.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/float/index.d.ts deleted file mode 100644 index ab05de36..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/float/index.d.ts +++ /dev/null @@ -1,83 +0,0 @@ -/** - * Writes a 32 bit float to a buffer using little endian byte order. - * @name writeFloatLE - * @function - * @param {number} val Value to write - * @param {Uint8Array} buf Target buffer - * @param {number} pos Target buffer offset - * @returns {undefined} - */ -export function writeFloatLE(val: number, buf: Uint8Array, pos: number): void; - -/** - * Writes a 32 bit float to a buffer using big endian byte order. - * @name writeFloatBE - * @function - * @param {number} val Value to write - * @param {Uint8Array} buf Target buffer - * @param {number} pos Target buffer offset - * @returns {undefined} - */ -export function writeFloatBE(val: number, buf: Uint8Array, pos: number): void; - -/** - * Reads a 32 bit float from a buffer using little endian byte order. - * @name readFloatLE - * @function - * @param {Uint8Array} buf Source buffer - * @param {number} pos Source buffer offset - * @returns {number} Value read - */ -export function readFloatLE(buf: Uint8Array, pos: number): number; - -/** - * Reads a 32 bit float from a buffer using big endian byte order. - * @name readFloatBE - * @function - * @param {Uint8Array} buf Source buffer - * @param {number} pos Source buffer offset - * @returns {number} Value read - */ -export function readFloatBE(buf: Uint8Array, pos: number): number; - -/** - * Writes a 64 bit double to a buffer using little endian byte order. - * @name writeDoubleLE - * @function - * @param {number} val Value to write - * @param {Uint8Array} buf Target buffer - * @param {number} pos Target buffer offset - * @returns {undefined} - */ -export function writeDoubleLE(val: number, buf: Uint8Array, pos: number): void; - -/** - * Writes a 64 bit double to a buffer using big endian byte order. - * @name writeDoubleBE - * @function - * @param {number} val Value to write - * @param {Uint8Array} buf Target buffer - * @param {number} pos Target buffer offset - * @returns {undefined} - */ -export function writeDoubleBE(val: number, buf: Uint8Array, pos: number): void; - -/** - * Reads a 64 bit double from a buffer using little endian byte order. - * @name readDoubleLE - * @function - * @param {Uint8Array} buf Source buffer - * @param {number} pos Source buffer offset - * @returns {number} Value read - */ -export function readDoubleLE(buf: Uint8Array, pos: number): number; - -/** - * Reads a 64 bit double from a buffer using big endian byte order. - * @name readDoubleBE - * @function - * @param {Uint8Array} buf Source buffer - * @param {number} pos Source buffer offset - * @returns {number} Value read - */ -export function readDoubleBE(buf: Uint8Array, pos: number): number; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/float/index.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/float/index.js deleted file mode 100644 index 706d0963..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/float/index.js +++ /dev/null @@ -1,335 +0,0 @@ -"use strict"; - -module.exports = factory(factory); - -/** - * Reads / writes floats / doubles from / to buffers. - * @name util.float - * @namespace - */ - -/** - * Writes a 32 bit float to a buffer using little endian byte order. - * @name util.float.writeFloatLE - * @function - * @param {number} val Value to write - * @param {Uint8Array} buf Target buffer - * @param {number} pos Target buffer offset - * @returns {undefined} - */ - -/** - * Writes a 32 bit float to a buffer using big endian byte order. - * @name util.float.writeFloatBE - * @function - * @param {number} val Value to write - * @param {Uint8Array} buf Target buffer - * @param {number} pos Target buffer offset - * @returns {undefined} - */ - -/** - * Reads a 32 bit float from a buffer using little endian byte order. - * @name util.float.readFloatLE - * @function - * @param {Uint8Array} buf Source buffer - * @param {number} pos Source buffer offset - * @returns {number} Value read - */ - -/** - * Reads a 32 bit float from a buffer using big endian byte order. - * @name util.float.readFloatBE - * @function - * @param {Uint8Array} buf Source buffer - * @param {number} pos Source buffer offset - * @returns {number} Value read - */ - -/** - * Writes a 64 bit double to a buffer using little endian byte order. - * @name util.float.writeDoubleLE - * @function - * @param {number} val Value to write - * @param {Uint8Array} buf Target buffer - * @param {number} pos Target buffer offset - * @returns {undefined} - */ - -/** - * Writes a 64 bit double to a buffer using big endian byte order. - * @name util.float.writeDoubleBE - * @function - * @param {number} val Value to write - * @param {Uint8Array} buf Target buffer - * @param {number} pos Target buffer offset - * @returns {undefined} - */ - -/** - * Reads a 64 bit double from a buffer using little endian byte order. - * @name util.float.readDoubleLE - * @function - * @param {Uint8Array} buf Source buffer - * @param {number} pos Source buffer offset - * @returns {number} Value read - */ - -/** - * Reads a 64 bit double from a buffer using big endian byte order. - * @name util.float.readDoubleBE - * @function - * @param {Uint8Array} buf Source buffer - * @param {number} pos Source buffer offset - * @returns {number} Value read - */ - -// Factory function for the purpose of node-based testing in modified global environments -function factory(exports) { - - // float: typed array - if (typeof Float32Array !== "undefined") (function() { - - var f32 = new Float32Array([ -0 ]), - f8b = new Uint8Array(f32.buffer), - le = f8b[3] === 128; - - function writeFloat_f32_cpy(val, buf, pos) { - f32[0] = val; - buf[pos ] = f8b[0]; - buf[pos + 1] = f8b[1]; - buf[pos + 2] = f8b[2]; - buf[pos + 3] = f8b[3]; - } - - function writeFloat_f32_rev(val, buf, pos) { - f32[0] = val; - buf[pos ] = f8b[3]; - buf[pos + 1] = f8b[2]; - buf[pos + 2] = f8b[1]; - buf[pos + 3] = f8b[0]; - } - - /* istanbul ignore next */ - exports.writeFloatLE = le ? writeFloat_f32_cpy : writeFloat_f32_rev; - /* istanbul ignore next */ - exports.writeFloatBE = le ? writeFloat_f32_rev : writeFloat_f32_cpy; - - function readFloat_f32_cpy(buf, pos) { - f8b[0] = buf[pos ]; - f8b[1] = buf[pos + 1]; - f8b[2] = buf[pos + 2]; - f8b[3] = buf[pos + 3]; - return f32[0]; - } - - function readFloat_f32_rev(buf, pos) { - f8b[3] = buf[pos ]; - f8b[2] = buf[pos + 1]; - f8b[1] = buf[pos + 2]; - f8b[0] = buf[pos + 3]; - return f32[0]; - } - - /* istanbul ignore next */ - exports.readFloatLE = le ? readFloat_f32_cpy : readFloat_f32_rev; - /* istanbul ignore next */ - exports.readFloatBE = le ? readFloat_f32_rev : readFloat_f32_cpy; - - // float: ieee754 - })(); else (function() { - - function writeFloat_ieee754(writeUint, val, buf, pos) { - var sign = val < 0 ? 1 : 0; - if (sign) - val = -val; - if (val === 0) - writeUint(1 / val > 0 ? /* positive */ 0 : /* negative 0 */ 2147483648, buf, pos); - else if (isNaN(val)) - writeUint(2143289344, buf, pos); - else if (val > 3.4028234663852886e+38) // +-Infinity - writeUint((sign << 31 | 2139095040) >>> 0, buf, pos); - else if (val < 1.1754943508222875e-38) // denormal - writeUint((sign << 31 | Math.round(val / 1.401298464324817e-45)) >>> 0, buf, pos); - else { - var exponent = Math.floor(Math.log(val) / Math.LN2), - mantissa = Math.round(val * Math.pow(2, -exponent) * 8388608) & 8388607; - writeUint((sign << 31 | exponent + 127 << 23 | mantissa) >>> 0, buf, pos); - } - } - - exports.writeFloatLE = writeFloat_ieee754.bind(null, writeUintLE); - exports.writeFloatBE = writeFloat_ieee754.bind(null, writeUintBE); - - function readFloat_ieee754(readUint, buf, pos) { - var uint = readUint(buf, pos), - sign = (uint >> 31) * 2 + 1, - exponent = uint >>> 23 & 255, - mantissa = uint & 8388607; - return exponent === 255 - ? mantissa - ? NaN - : sign * Infinity - : exponent === 0 // denormal - ? sign * 1.401298464324817e-45 * mantissa - : sign * Math.pow(2, exponent - 150) * (mantissa + 8388608); - } - - exports.readFloatLE = readFloat_ieee754.bind(null, readUintLE); - exports.readFloatBE = readFloat_ieee754.bind(null, readUintBE); - - })(); - - // double: typed array - if (typeof Float64Array !== "undefined") (function() { - - var f64 = new Float64Array([-0]), - f8b = new Uint8Array(f64.buffer), - le = f8b[7] === 128; - - function writeDouble_f64_cpy(val, buf, pos) { - f64[0] = val; - buf[pos ] = f8b[0]; - buf[pos + 1] = f8b[1]; - buf[pos + 2] = f8b[2]; - buf[pos + 3] = f8b[3]; - buf[pos + 4] = f8b[4]; - buf[pos + 5] = f8b[5]; - buf[pos + 6] = f8b[6]; - buf[pos + 7] = f8b[7]; - } - - function writeDouble_f64_rev(val, buf, pos) { - f64[0] = val; - buf[pos ] = f8b[7]; - buf[pos + 1] = f8b[6]; - buf[pos + 2] = f8b[5]; - buf[pos + 3] = f8b[4]; - buf[pos + 4] = f8b[3]; - buf[pos + 5] = f8b[2]; - buf[pos + 6] = f8b[1]; - buf[pos + 7] = f8b[0]; - } - - /* istanbul ignore next */ - exports.writeDoubleLE = le ? writeDouble_f64_cpy : writeDouble_f64_rev; - /* istanbul ignore next */ - exports.writeDoubleBE = le ? writeDouble_f64_rev : writeDouble_f64_cpy; - - function readDouble_f64_cpy(buf, pos) { - f8b[0] = buf[pos ]; - f8b[1] = buf[pos + 1]; - f8b[2] = buf[pos + 2]; - f8b[3] = buf[pos + 3]; - f8b[4] = buf[pos + 4]; - f8b[5] = buf[pos + 5]; - f8b[6] = buf[pos + 6]; - f8b[7] = buf[pos + 7]; - return f64[0]; - } - - function readDouble_f64_rev(buf, pos) { - f8b[7] = buf[pos ]; - f8b[6] = buf[pos + 1]; - f8b[5] = buf[pos + 2]; - f8b[4] = buf[pos + 3]; - f8b[3] = buf[pos + 4]; - f8b[2] = buf[pos + 5]; - f8b[1] = buf[pos + 6]; - f8b[0] = buf[pos + 7]; - return f64[0]; - } - - /* istanbul ignore next */ - exports.readDoubleLE = le ? readDouble_f64_cpy : readDouble_f64_rev; - /* istanbul ignore next */ - exports.readDoubleBE = le ? readDouble_f64_rev : readDouble_f64_cpy; - - // double: ieee754 - })(); else (function() { - - function writeDouble_ieee754(writeUint, off0, off1, val, buf, pos) { - var sign = val < 0 ? 1 : 0; - if (sign) - val = -val; - if (val === 0) { - writeUint(0, buf, pos + off0); - writeUint(1 / val > 0 ? /* positive */ 0 : /* negative 0 */ 2147483648, buf, pos + off1); - } else if (isNaN(val)) { - writeUint(0, buf, pos + off0); - writeUint(2146959360, buf, pos + off1); - } else if (val > 1.7976931348623157e+308) { // +-Infinity - writeUint(0, buf, pos + off0); - writeUint((sign << 31 | 2146435072) >>> 0, buf, pos + off1); - } else { - var mantissa; - if (val < 2.2250738585072014e-308) { // denormal - mantissa = val / 5e-324; - writeUint(mantissa >>> 0, buf, pos + off0); - writeUint((sign << 31 | mantissa / 4294967296) >>> 0, buf, pos + off1); - } else { - var exponent = Math.floor(Math.log(val) / Math.LN2); - if (exponent === 1024) - exponent = 1023; - mantissa = val * Math.pow(2, -exponent); - writeUint(mantissa * 4503599627370496 >>> 0, buf, pos + off0); - writeUint((sign << 31 | exponent + 1023 << 20 | mantissa * 1048576 & 1048575) >>> 0, buf, pos + off1); - } - } - } - - exports.writeDoubleLE = writeDouble_ieee754.bind(null, writeUintLE, 0, 4); - exports.writeDoubleBE = writeDouble_ieee754.bind(null, writeUintBE, 4, 0); - - function readDouble_ieee754(readUint, off0, off1, buf, pos) { - var lo = readUint(buf, pos + off0), - hi = readUint(buf, pos + off1); - var sign = (hi >> 31) * 2 + 1, - exponent = hi >>> 20 & 2047, - mantissa = 4294967296 * (hi & 1048575) + lo; - return exponent === 2047 - ? mantissa - ? NaN - : sign * Infinity - : exponent === 0 // denormal - ? sign * 5e-324 * mantissa - : sign * Math.pow(2, exponent - 1075) * (mantissa + 4503599627370496); - } - - exports.readDoubleLE = readDouble_ieee754.bind(null, readUintLE, 0, 4); - exports.readDoubleBE = readDouble_ieee754.bind(null, readUintBE, 4, 0); - - })(); - - return exports; -} - -// uint helpers - -function writeUintLE(val, buf, pos) { - buf[pos ] = val & 255; - buf[pos + 1] = val >>> 8 & 255; - buf[pos + 2] = val >>> 16 & 255; - buf[pos + 3] = val >>> 24; -} - -function writeUintBE(val, buf, pos) { - buf[pos ] = val >>> 24; - buf[pos + 1] = val >>> 16 & 255; - buf[pos + 2] = val >>> 8 & 255; - buf[pos + 3] = val & 255; -} - -function readUintLE(buf, pos) { - return (buf[pos ] - | buf[pos + 1] << 8 - | buf[pos + 2] << 16 - | buf[pos + 3] << 24) >>> 0; -} - -function readUintBE(buf, pos) { - return (buf[pos ] << 24 - | buf[pos + 1] << 16 - | buf[pos + 2] << 8 - | buf[pos + 3]) >>> 0; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/float/package.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/float/package.json deleted file mode 100644 index b3072f19..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/float/package.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "name": "@protobufjs/float", - "description": "Reads / writes floats / doubles from / to buffers in both modern and ancient browsers.", - "version": "1.0.2", - "author": "Daniel Wirtz ", - "repository": { - "type": "git", - "url": "https://github.com/dcodeIO/protobuf.js.git" - }, - "dependencies": {}, - "license": "BSD-3-Clause", - "main": "index.js", - "types": "index.d.ts", - "devDependencies": { - "benchmark": "^2.1.4", - "chalk": "^1.1.3", - "ieee754": "^1.1.8", - "istanbul": "^0.4.5", - "tape": "^4.6.3" - }, - "scripts": { - "test": "tape tests/*.js", - "coverage": "istanbul cover node_modules/tape/bin/tape tests/*.js", - "bench": "node bench" - } -} \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/float/tests/index.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/float/tests/index.js deleted file mode 100644 index 324e85c0..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/float/tests/index.js +++ /dev/null @@ -1,100 +0,0 @@ -var tape = require("tape"); - -var float = require(".."); - -tape.test("float", function(test) { - - // default - test.test(test.name + " - typed array", function(test) { - runTest(float, test); - }); - - // ieee754 - test.test(test.name + " - fallback", function(test) { - var F32 = global.Float32Array, - F64 = global.Float64Array; - delete global.Float32Array; - delete global.Float64Array; - runTest(float({}), test); - global.Float32Array = F32; - global.Float64Array = F64; - }); -}); - -function runTest(float, test) { - - var common = [ - 0, - -0, - Infinity, - -Infinity, - 0.125, - 1024.5, - -4096.5, - NaN - ]; - - test.test(test.name + " - using 32 bits", function(test) { - common.concat([ - 3.4028234663852886e+38, - 1.1754943508222875e-38, - 1.1754946310819804e-39 - ]) - .forEach(function(value) { - var strval = value === 0 && 1 / value < 0 ? "-0" : value.toString(); - test.ok( - checkValue(value, 4, float.readFloatLE, float.writeFloatLE, Buffer.prototype.writeFloatLE), - "should write and read back " + strval + " (32 bit LE)" - ); - test.ok( - checkValue(value, 4, float.readFloatBE, float.writeFloatBE, Buffer.prototype.writeFloatBE), - "should write and read back " + strval + " (32 bit BE)" - ); - }); - test.end(); - }); - - test.test(test.name + " - using 64 bits", function(test) { - common.concat([ - 1.7976931348623157e+308, - 2.2250738585072014e-308, - 2.2250738585072014e-309 - ]) - .forEach(function(value) { - var strval = value === 0 && 1 / value < 0 ? "-0" : value.toString(); - test.ok( - checkValue(value, 8, float.readDoubleLE, float.writeDoubleLE, Buffer.prototype.writeDoubleLE), - "should write and read back " + strval + " (64 bit LE)" - ); - test.ok( - checkValue(value, 8, float.readDoubleBE, float.writeDoubleBE, Buffer.prototype.writeDoubleBE), - "should write and read back " + strval + " (64 bit BE)" - ); - }); - test.end(); - }); - - test.end(); -} - -function checkValue(value, size, read, write, write_comp) { - var buffer = new Buffer(size); - write(value, buffer, 0); - var value_comp = read(buffer, 0); - var strval = value === 0 && 1 / value < 0 ? "-0" : value.toString(); - if (value !== value) { - if (value_comp === value_comp) - return false; - } else if (value_comp !== value) - return false; - - var buffer_comp = new Buffer(size); - write_comp.call(buffer_comp, value, 0); - for (var i = 0; i < size; ++i) - if (buffer[i] !== buffer_comp[i]) { - console.error(">", buffer, buffer_comp); - return false; - } - - return true; -} \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/inquire/.npmignore b/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/inquire/.npmignore deleted file mode 100644 index ce75de45..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/inquire/.npmignore +++ /dev/null @@ -1,3 +0,0 @@ -npm-debug.* -node_modules/ -coverage/ diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/inquire/LICENSE b/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/inquire/LICENSE deleted file mode 100644 index 2a2d5601..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/inquire/LICENSE +++ /dev/null @@ -1,26 +0,0 @@ -Copyright (c) 2016, Daniel Wirtz All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - -* Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -* Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -* Neither the name of its author, nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/inquire/README.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/inquire/README.md deleted file mode 100644 index 22f99684..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/inquire/README.md +++ /dev/null @@ -1,13 +0,0 @@ -@protobufjs/inquire -=================== -[![npm](https://img.shields.io/npm/v/@protobufjs/inquire.svg)](https://www.npmjs.com/package/@protobufjs/inquire) - -Requires a module only if available and hides the require call from bundlers. - -API ---- - -* **inquire(moduleName: `string`): `?Object`**
- Requires a module only if available. - -**License:** [BSD 3-Clause License](https://opensource.org/licenses/BSD-3-Clause) diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/inquire/index.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/inquire/index.d.ts deleted file mode 100644 index 6f9825b8..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/inquire/index.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -export = inquire; - -/** - * Requires a module only if available. - * @memberof util - * @param {string} moduleName Module to require - * @returns {?Object} Required module if available and not empty, otherwise `null` - */ -declare function inquire(moduleName: string): Object; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/inquire/index.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/inquire/index.js deleted file mode 100644 index 33778b55..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/inquire/index.js +++ /dev/null @@ -1,17 +0,0 @@ -"use strict"; -module.exports = inquire; - -/** - * Requires a module only if available. - * @memberof util - * @param {string} moduleName Module to require - * @returns {?Object} Required module if available and not empty, otherwise `null` - */ -function inquire(moduleName) { - try { - var mod = eval("quire".replace(/^/,"re"))(moduleName); // eslint-disable-line no-eval - if (mod && (mod.length || Object.keys(mod).length)) - return mod; - } catch (e) {} // eslint-disable-line no-empty - return null; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/inquire/package.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/inquire/package.json deleted file mode 100644 index f4b33db4..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/inquire/package.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "name": "@protobufjs/inquire", - "description": "Requires a module only if available and hides the require call from bundlers.", - "version": "1.1.0", - "author": "Daniel Wirtz ", - "repository": { - "type": "git", - "url": "https://github.com/dcodeIO/protobuf.js.git" - }, - "license": "BSD-3-Clause", - "main": "index.js", - "types": "index.d.ts", - "devDependencies": { - "istanbul": "^0.4.5", - "tape": "^4.6.3" - }, - "scripts": { - "test": "tape tests/*.js", - "coverage": "istanbul cover node_modules/tape/bin/tape tests/*.js" - } -} \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/inquire/tests/data/array.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/inquire/tests/data/array.js deleted file mode 100644 index 96627c36..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/inquire/tests/data/array.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = [1]; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/inquire/tests/data/emptyArray.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/inquire/tests/data/emptyArray.js deleted file mode 100644 index 0630c8f5..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/inquire/tests/data/emptyArray.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = []; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/inquire/tests/data/emptyObject.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/inquire/tests/data/emptyObject.js deleted file mode 100644 index 0369aa45..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/inquire/tests/data/emptyObject.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = {}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/inquire/tests/data/object.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/inquire/tests/data/object.js deleted file mode 100644 index 3226d44e..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/inquire/tests/data/object.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = { a: 1 }; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/inquire/tests/index.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/inquire/tests/index.js deleted file mode 100644 index 7d6496f0..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/inquire/tests/index.js +++ /dev/null @@ -1,20 +0,0 @@ -var tape = require("tape"); - -var inquire = require(".."); - -tape.test("inquire", function(test) { - - test.equal(inquire("buffer").Buffer, Buffer, "should be able to require \"buffer\""); - - test.equal(inquire("%invalid"), null, "should not be able to require \"%invalid\""); - - test.equal(inquire("./tests/data/emptyObject"), null, "should return null when requiring a module exporting an empty object"); - - test.equal(inquire("./tests/data/emptyArray"), null, "should return null when requiring a module exporting an empty array"); - - test.same(inquire("./tests/data/object"), { a: 1 }, "should return the object if a non-empty object"); - - test.same(inquire("./tests/data/array"), [ 1 ], "should return the module if a non-empty array"); - - test.end(); -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/path/LICENSE b/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/path/LICENSE deleted file mode 100644 index 2a2d5601..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/path/LICENSE +++ /dev/null @@ -1,26 +0,0 @@ -Copyright (c) 2016, Daniel Wirtz All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - -* Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -* Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -* Neither the name of its author, nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/path/README.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/path/README.md deleted file mode 100644 index 0e8e6bc3..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/path/README.md +++ /dev/null @@ -1,19 +0,0 @@ -@protobufjs/path -================ -[![npm](https://img.shields.io/npm/v/@protobufjs/path.svg)](https://www.npmjs.com/package/@protobufjs/path) - -A minimal path module to resolve Unix, Windows and URL paths alike. - -API ---- - -* **path.isAbsolute(path: `string`): `boolean`**
- Tests if the specified path is absolute. - -* **path.normalize(path: `string`): `string`**
- Normalizes the specified path. - -* **path.resolve(originPath: `string`, includePath: `string`, [alreadyNormalized=false: `boolean`]): `string`**
- Resolves the specified include path against the specified origin path. - -**License:** [BSD 3-Clause License](https://opensource.org/licenses/BSD-3-Clause) diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/path/index.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/path/index.d.ts deleted file mode 100644 index 567c3dcf..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/path/index.d.ts +++ /dev/null @@ -1,22 +0,0 @@ -/** - * Tests if the specified path is absolute. - * @param {string} path Path to test - * @returns {boolean} `true` if path is absolute - */ -export function isAbsolute(path: string): boolean; - -/** - * Normalizes the specified path. - * @param {string} path Path to normalize - * @returns {string} Normalized path - */ -export function normalize(path: string): string; - -/** - * Resolves the specified include path against the specified origin path. - * @param {string} originPath Path to the origin file - * @param {string} includePath Include path relative to origin path - * @param {boolean} [alreadyNormalized=false] `true` if both paths are already known to be normalized - * @returns {string} Path to the include file - */ -export function resolve(originPath: string, includePath: string, alreadyNormalized?: boolean): string; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/path/index.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/path/index.js deleted file mode 100644 index 1ea7b174..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/path/index.js +++ /dev/null @@ -1,65 +0,0 @@ -"use strict"; - -/** - * A minimal path module to resolve Unix, Windows and URL paths alike. - * @memberof util - * @namespace - */ -var path = exports; - -var isAbsolute = -/** - * Tests if the specified path is absolute. - * @param {string} path Path to test - * @returns {boolean} `true` if path is absolute - */ -path.isAbsolute = function isAbsolute(path) { - return /^(?:\/|\w+:)/.test(path); -}; - -var normalize = -/** - * Normalizes the specified path. - * @param {string} path Path to normalize - * @returns {string} Normalized path - */ -path.normalize = function normalize(path) { - path = path.replace(/\\/g, "/") - .replace(/\/{2,}/g, "/"); - var parts = path.split("/"), - absolute = isAbsolute(path), - prefix = ""; - if (absolute) - prefix = parts.shift() + "/"; - for (var i = 0; i < parts.length;) { - if (parts[i] === "..") { - if (i > 0 && parts[i - 1] !== "..") - parts.splice(--i, 2); - else if (absolute) - parts.splice(i, 1); - else - ++i; - } else if (parts[i] === ".") - parts.splice(i, 1); - else - ++i; - } - return prefix + parts.join("/"); -}; - -/** - * Resolves the specified include path against the specified origin path. - * @param {string} originPath Path to the origin file - * @param {string} includePath Include path relative to origin path - * @param {boolean} [alreadyNormalized=false] `true` if both paths are already known to be normalized - * @returns {string} Path to the include file - */ -path.resolve = function resolve(originPath, includePath, alreadyNormalized) { - if (!alreadyNormalized) - includePath = normalize(includePath); - if (isAbsolute(includePath)) - return includePath; - if (!alreadyNormalized) - originPath = normalize(originPath); - return (originPath = originPath.replace(/(?:\/|^)[^/]+$/, "")).length ? normalize(originPath + "/" + includePath) : includePath; -}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/path/package.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/path/package.json deleted file mode 100644 index ae0808aa..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/path/package.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "name": "@protobufjs/path", - "description": "A minimal path module to resolve Unix, Windows and URL paths alike.", - "version": "1.1.2", - "author": "Daniel Wirtz ", - "repository": { - "type": "git", - "url": "https://github.com/dcodeIO/protobuf.js.git" - }, - "license": "BSD-3-Clause", - "main": "index.js", - "types": "index.d.ts", - "devDependencies": { - "istanbul": "^0.4.5", - "tape": "^4.6.3" - }, - "scripts": { - "test": "tape tests/*.js", - "coverage": "istanbul cover node_modules/tape/bin/tape tests/*.js" - } -} \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/path/tests/index.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/path/tests/index.js deleted file mode 100644 index 927736e4..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/path/tests/index.js +++ /dev/null @@ -1,60 +0,0 @@ -var tape = require("tape"); - -var path = require(".."); - -tape.test("path", function(test) { - - test.ok(path.isAbsolute("X:\\some\\path\\file.js"), "should identify absolute windows paths"); - test.ok(path.isAbsolute("/some/path/file.js"), "should identify absolute unix paths"); - - test.notOk(path.isAbsolute("some\\path\\file.js"), "should identify relative windows paths"); - test.notOk(path.isAbsolute("some/path/file.js"), "should identify relative unix paths"); - - var paths = [ - { - actual: "X:\\some\\..\\.\\path\\\\file.js", - normal: "X:/path/file.js", - resolve: { - origin: "X:/path/origin.js", - expected: "X:/path/file.js" - } - }, { - actual: "some\\..\\.\\path\\\\file.js", - normal: "path/file.js", - resolve: { - origin: "X:/path/origin.js", - expected: "X:/path/path/file.js" - } - }, { - actual: "/some/.././path//file.js", - normal: "/path/file.js", - resolve: { - origin: "/path/origin.js", - expected: "/path/file.js" - } - }, { - actual: "some/.././path//file.js", - normal: "path/file.js", - resolve: { - origin: "", - expected: "path/file.js" - } - }, { - actual: ".././path//file.js", - normal: "../path/file.js" - }, { - actual: "/.././path//file.js", - normal: "/path/file.js" - } - ]; - - paths.forEach(function(p) { - test.equal(path.normalize(p.actual), p.normal, "should normalize " + p.actual); - if (p.resolve) { - test.equal(path.resolve(p.resolve.origin, p.actual), p.resolve.expected, "should resolve " + p.actual); - test.equal(path.resolve(p.resolve.origin, p.normal, true), p.resolve.expected, "should resolve " + p.normal + " (already normalized)"); - } - }); - - test.end(); -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/pool/.npmignore b/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/pool/.npmignore deleted file mode 100644 index ce75de45..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/pool/.npmignore +++ /dev/null @@ -1,3 +0,0 @@ -npm-debug.* -node_modules/ -coverage/ diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/pool/LICENSE b/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/pool/LICENSE deleted file mode 100644 index 2a2d5601..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/pool/LICENSE +++ /dev/null @@ -1,26 +0,0 @@ -Copyright (c) 2016, Daniel Wirtz All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - -* Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -* Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -* Neither the name of its author, nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/pool/README.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/pool/README.md deleted file mode 100644 index 3955ae03..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/pool/README.md +++ /dev/null @@ -1,13 +0,0 @@ -@protobufjs/pool -================ -[![npm](https://img.shields.io/npm/v/@protobufjs/pool.svg)](https://www.npmjs.com/package/@protobufjs/pool) - -A general purpose buffer pool. - -API ---- - -* **pool(alloc: `function(size: number): Uint8Array`, slice: `function(this: Uint8Array, start: number, end: number): Uint8Array`, [size=8192: `number`]): `function(size: number): Uint8Array`**
- Creates a pooled allocator. - -**License:** [BSD 3-Clause License](https://opensource.org/licenses/BSD-3-Clause) diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/pool/index.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/pool/index.d.ts deleted file mode 100644 index 465559c7..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/pool/index.d.ts +++ /dev/null @@ -1,32 +0,0 @@ -export = pool; - -/** - * An allocator as used by {@link util.pool}. - * @typedef PoolAllocator - * @type {function} - * @param {number} size Buffer size - * @returns {Uint8Array} Buffer - */ -type PoolAllocator = (size: number) => Uint8Array; - -/** - * A slicer as used by {@link util.pool}. - * @typedef PoolSlicer - * @type {function} - * @param {number} start Start offset - * @param {number} end End offset - * @returns {Uint8Array} Buffer slice - * @this {Uint8Array} - */ -type PoolSlicer = (this: Uint8Array, start: number, end: number) => Uint8Array; - -/** - * A general purpose buffer pool. - * @memberof util - * @function - * @param {PoolAllocator} alloc Allocator - * @param {PoolSlicer} slice Slicer - * @param {number} [size=8192] Slab size - * @returns {PoolAllocator} Pooled allocator - */ -declare function pool(alloc: PoolAllocator, slice: PoolSlicer, size?: number): PoolAllocator; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/pool/index.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/pool/index.js deleted file mode 100644 index 9556f5a4..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/pool/index.js +++ /dev/null @@ -1,48 +0,0 @@ -"use strict"; -module.exports = pool; - -/** - * An allocator as used by {@link util.pool}. - * @typedef PoolAllocator - * @type {function} - * @param {number} size Buffer size - * @returns {Uint8Array} Buffer - */ - -/** - * A slicer as used by {@link util.pool}. - * @typedef PoolSlicer - * @type {function} - * @param {number} start Start offset - * @param {number} end End offset - * @returns {Uint8Array} Buffer slice - * @this {Uint8Array} - */ - -/** - * A general purpose buffer pool. - * @memberof util - * @function - * @param {PoolAllocator} alloc Allocator - * @param {PoolSlicer} slice Slicer - * @param {number} [size=8192] Slab size - * @returns {PoolAllocator} Pooled allocator - */ -function pool(alloc, slice, size) { - var SIZE = size || 8192; - var MAX = SIZE >>> 1; - var slab = null; - var offset = SIZE; - return function pool_alloc(size) { - if (size < 1 || size > MAX) - return alloc(size); - if (offset + size > SIZE) { - slab = alloc(SIZE); - offset = 0; - } - var buf = slice.call(slab, offset, offset += size); - if (offset & 7) // align to 32 bit - offset = (offset | 7) + 1; - return buf; - }; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/pool/package.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/pool/package.json deleted file mode 100644 index f025e033..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/pool/package.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "name": "@protobufjs/pool", - "description": "A general purpose buffer pool.", - "version": "1.1.0", - "author": "Daniel Wirtz ", - "repository": { - "type": "git", - "url": "https://github.com/dcodeIO/protobuf.js.git" - }, - "license": "BSD-3-Clause", - "main": "index.js", - "types": "index.d.ts", - "devDependencies": { - "istanbul": "^0.4.5", - "tape": "^4.6.3" - }, - "scripts": { - "test": "tape tests/*.js", - "coverage": "istanbul cover node_modules/tape/bin/tape tests/*.js" - } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/pool/tests/index.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/pool/tests/index.js deleted file mode 100644 index dc488b80..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/pool/tests/index.js +++ /dev/null @@ -1,33 +0,0 @@ -var tape = require("tape"); - -var pool = require(".."); - -if (typeof Uint8Array !== "undefined") -tape.test("pool", function(test) { - - var alloc = pool(function(size) { return new Uint8Array(size); }, Uint8Array.prototype.subarray); - - var buf1 = alloc(0); - test.equal(buf1.length, 0, "should allocate a buffer of size 0"); - - var buf2 = alloc(1); - test.equal(buf2.length, 1, "should allocate a buffer of size 1 (initializes slab)"); - - test.notEqual(buf2.buffer, buf1.buffer, "should not reference the same backing buffer if previous buffer had size 0"); - test.equal(buf2.byteOffset, 0, "should allocate at byteOffset 0 when using a new slab"); - - buf1 = alloc(1); - test.equal(buf1.buffer, buf2.buffer, "should reference the same backing buffer when allocating a chunk fitting into the slab"); - test.equal(buf1.byteOffset, 8, "should align slices to 32 bit and this allocate at byteOffset 8"); - - var buf3 = alloc(4097); - test.notEqual(buf3.buffer, buf2.buffer, "should not reference the same backing buffer when allocating a buffer larger than half the backing buffer's size"); - - buf2 = alloc(4096); - test.equal(buf2.buffer, buf1.buffer, "should reference the same backing buffer when allocating a buffer smaller or equal than half the backing buffer's size"); - - buf1 = alloc(4096); - test.notEqual(buf1.buffer, buf2.buffer, "should not reference the same backing buffer when the slab is exhausted (initializes new slab)"); - - test.end(); -}); \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/utf8/.npmignore b/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/utf8/.npmignore deleted file mode 100644 index ce75de45..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/utf8/.npmignore +++ /dev/null @@ -1,3 +0,0 @@ -npm-debug.* -node_modules/ -coverage/ diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/utf8/LICENSE b/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/utf8/LICENSE deleted file mode 100644 index 2a2d5601..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/utf8/LICENSE +++ /dev/null @@ -1,26 +0,0 @@ -Copyright (c) 2016, Daniel Wirtz All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - -* Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -* Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -* Neither the name of its author, nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/utf8/README.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/utf8/README.md deleted file mode 100644 index 36962893..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/utf8/README.md +++ /dev/null @@ -1,20 +0,0 @@ -@protobufjs/utf8 -================ -[![npm](https://img.shields.io/npm/v/@protobufjs/utf8.svg)](https://www.npmjs.com/package/@protobufjs/utf8) - -A minimal UTF8 implementation for number arrays. - -API ---- - -* **utf8.length(string: `string`): `number`**
- Calculates the UTF8 byte length of a string. - -* **utf8.read(buffer: `Uint8Array`, start: `number`, end: `number`): `string`**
- Reads UTF8 bytes as a string. - -* **utf8.write(string: `string`, buffer: `Uint8Array`, offset: `number`): `number`**
- Writes a string as UTF8 bytes. - - -**License:** [BSD 3-Clause License](https://opensource.org/licenses/BSD-3-Clause) diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/utf8/index.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/utf8/index.d.ts deleted file mode 100644 index 010888c3..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/utf8/index.d.ts +++ /dev/null @@ -1,24 +0,0 @@ -/** - * Calculates the UTF8 byte length of a string. - * @param {string} string String - * @returns {number} Byte length - */ -export function length(string: string): number; - -/** - * Reads UTF8 bytes as a string. - * @param {Uint8Array} buffer Source buffer - * @param {number} start Source start - * @param {number} end Source end - * @returns {string} String read - */ -export function read(buffer: Uint8Array, start: number, end: number): string; - -/** - * Writes a string as UTF8 bytes. - * @param {string} string Source string - * @param {Uint8Array} buffer Destination buffer - * @param {number} offset Destination offset - * @returns {number} Bytes written - */ -export function write(string: string, buffer: Uint8Array, offset: number): number; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/utf8/index.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/utf8/index.js deleted file mode 100644 index e4ff8df9..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/utf8/index.js +++ /dev/null @@ -1,105 +0,0 @@ -"use strict"; - -/** - * A minimal UTF8 implementation for number arrays. - * @memberof util - * @namespace - */ -var utf8 = exports; - -/** - * Calculates the UTF8 byte length of a string. - * @param {string} string String - * @returns {number} Byte length - */ -utf8.length = function utf8_length(string) { - var len = 0, - c = 0; - for (var i = 0; i < string.length; ++i) { - c = string.charCodeAt(i); - if (c < 128) - len += 1; - else if (c < 2048) - len += 2; - else if ((c & 0xFC00) === 0xD800 && (string.charCodeAt(i + 1) & 0xFC00) === 0xDC00) { - ++i; - len += 4; - } else - len += 3; - } - return len; -}; - -/** - * Reads UTF8 bytes as a string. - * @param {Uint8Array} buffer Source buffer - * @param {number} start Source start - * @param {number} end Source end - * @returns {string} String read - */ -utf8.read = function utf8_read(buffer, start, end) { - var len = end - start; - if (len < 1) - return ""; - var parts = null, - chunk = [], - i = 0, // char offset - t; // temporary - while (start < end) { - t = buffer[start++]; - if (t < 128) - chunk[i++] = t; - else if (t > 191 && t < 224) - chunk[i++] = (t & 31) << 6 | buffer[start++] & 63; - else if (t > 239 && t < 365) { - t = ((t & 7) << 18 | (buffer[start++] & 63) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63) - 0x10000; - chunk[i++] = 0xD800 + (t >> 10); - chunk[i++] = 0xDC00 + (t & 1023); - } else - chunk[i++] = (t & 15) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63; - if (i > 8191) { - (parts || (parts = [])).push(String.fromCharCode.apply(String, chunk)); - i = 0; - } - } - if (parts) { - if (i) - parts.push(String.fromCharCode.apply(String, chunk.slice(0, i))); - return parts.join(""); - } - return String.fromCharCode.apply(String, chunk.slice(0, i)); -}; - -/** - * Writes a string as UTF8 bytes. - * @param {string} string Source string - * @param {Uint8Array} buffer Destination buffer - * @param {number} offset Destination offset - * @returns {number} Bytes written - */ -utf8.write = function utf8_write(string, buffer, offset) { - var start = offset, - c1, // character 1 - c2; // character 2 - for (var i = 0; i < string.length; ++i) { - c1 = string.charCodeAt(i); - if (c1 < 128) { - buffer[offset++] = c1; - } else if (c1 < 2048) { - buffer[offset++] = c1 >> 6 | 192; - buffer[offset++] = c1 & 63 | 128; - } else if ((c1 & 0xFC00) === 0xD800 && ((c2 = string.charCodeAt(i + 1)) & 0xFC00) === 0xDC00) { - c1 = 0x10000 + ((c1 & 0x03FF) << 10) + (c2 & 0x03FF); - ++i; - buffer[offset++] = c1 >> 18 | 240; - buffer[offset++] = c1 >> 12 & 63 | 128; - buffer[offset++] = c1 >> 6 & 63 | 128; - buffer[offset++] = c1 & 63 | 128; - } else { - buffer[offset++] = c1 >> 12 | 224; - buffer[offset++] = c1 >> 6 & 63 | 128; - buffer[offset++] = c1 & 63 | 128; - } - } - return offset - start; -}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/utf8/package.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/utf8/package.json deleted file mode 100644 index 80881c51..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/utf8/package.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "name": "@protobufjs/utf8", - "description": "A minimal UTF8 implementation for number arrays.", - "version": "1.1.0", - "author": "Daniel Wirtz ", - "repository": { - "type": "git", - "url": "https://github.com/dcodeIO/protobuf.js.git" - }, - "license": "BSD-3-Clause", - "main": "index.js", - "types": "index.d.ts", - "devDependencies": { - "istanbul": "^0.4.5", - "tape": "^4.6.3" - }, - "scripts": { - "test": "tape tests/*.js", - "coverage": "istanbul cover node_modules/tape/bin/tape tests/*.js" - } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/utf8/tests/data/utf8.txt b/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/utf8/tests/data/utf8.txt deleted file mode 100644 index 580b4c4e..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/utf8/tests/data/utf8.txt +++ /dev/null @@ -1,216 +0,0 @@ -UTF-8 encoded sample plain-text file -‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ - -Markus Kuhn [ˈmaʳkʊs kuːn] — 2002-07-25 CC BY - - -The ASCII compatible UTF-8 encoding used in this plain-text file -is defined in Unicode, ISO 10646-1, and RFC 2279. - - -Using Unicode/UTF-8, you can write in emails and source code things such as - -Mathematics and sciences: - - ∮ E⋅da = Q, n → ∞, ∑ f(i) = ∏ g(i), ⎧⎡⎛┌─────┐⎞⎤⎫ - ⎪⎢⎜│a²+b³ ⎟⎥⎪ - ∀x∈ℝ: ⌈x⌉ = −⌊−x⌋, α ∧ ¬β = ¬(¬α ∨ β), ⎪⎢⎜│───── ⎟⎥⎪ - ⎪⎢⎜⎷ c₈ ⎟⎥⎪ - ℕ ⊆ ℕ₀ ⊂ ℤ ⊂ ℚ ⊂ ℝ ⊂ ℂ, ⎨⎢⎜ ⎟⎥⎬ - ⎪⎢⎜ ∞ ⎟⎥⎪ - ⊥ < a ≠ b ≡ c ≤ d ≪ ⊤ ⇒ (⟦A⟧ ⇔ ⟪B⟫), ⎪⎢⎜ ⎲ ⎟⎥⎪ - ⎪⎢⎜ ⎳aⁱ-bⁱ⎟⎥⎪ - 2H₂ + O₂ ⇌ 2H₂O, R = 4.7 kΩ, ⌀ 200 mm ⎩⎣⎝i=1 ⎠⎦⎭ - -Linguistics and dictionaries: - - ði ıntəˈnæʃənəl fəˈnɛtık əsoʊsiˈeıʃn - Y [ˈʏpsilɔn], Yen [jɛn], Yoga [ˈjoːgɑ] - -APL: - - ((V⍳V)=⍳⍴V)/V←,V ⌷←⍳→⍴∆∇⊃‾⍎⍕⌈ - -Nicer typography in plain text files: - - ╔══════════════════════════════════════════╗ - ║ ║ - ║ • ‘single’ and “double” quotes ║ - ║ ║ - ║ • Curly apostrophes: “We’ve been here” ║ - ║ ║ - ║ • Latin-1 apostrophe and accents: '´` ║ - ║ ║ - ║ • ‚deutsche‘ „Anführungszeichen“ ║ - ║ ║ - ║ • †, ‡, ‰, •, 3–4, —, −5/+5, ™, … ║ - ║ ║ - ║ • ASCII safety test: 1lI|, 0OD, 8B ║ - ║ ╭─────────╮ ║ - ║ • the euro symbol: │ 14.95 € │ ║ - ║ ╰─────────╯ ║ - ╚══════════════════════════════════════════╝ - -Combining characters: - - STARGΛ̊TE SG-1, a = v̇ = r̈, a⃑ ⊥ b⃑ - -Greek (in Polytonic): - - The Greek anthem: - - Σὲ γνωρίζω ἀπὸ τὴν κόψη - τοῦ σπαθιοῦ τὴν τρομερή, - σὲ γνωρίζω ἀπὸ τὴν ὄψη - ποὺ μὲ βία μετράει τὴ γῆ. - - ᾿Απ᾿ τὰ κόκκαλα βγαλμένη - τῶν ῾Ελλήνων τὰ ἱερά - καὶ σὰν πρῶτα ἀνδρειωμένη - χαῖρε, ὦ χαῖρε, ᾿Ελευθεριά! - - From a speech of Demosthenes in the 4th century BC: - - Οὐχὶ ταὐτὰ παρίσταταί μοι γιγνώσκειν, ὦ ἄνδρες ᾿Αθηναῖοι, - ὅταν τ᾿ εἰς τὰ πράγματα ἀποβλέψω καὶ ὅταν πρὸς τοὺς - λόγους οὓς ἀκούω· τοὺς μὲν γὰρ λόγους περὶ τοῦ - τιμωρήσασθαι Φίλιππον ὁρῶ γιγνομένους, τὰ δὲ πράγματ᾿ - εἰς τοῦτο προήκοντα, ὥσθ᾿ ὅπως μὴ πεισόμεθ᾿ αὐτοὶ - πρότερον κακῶς σκέψασθαι δέον. οὐδέν οὖν ἄλλο μοι δοκοῦσιν - οἱ τὰ τοιαῦτα λέγοντες ἢ τὴν ὑπόθεσιν, περὶ ἧς βουλεύεσθαι, - οὐχὶ τὴν οὖσαν παριστάντες ὑμῖν ἁμαρτάνειν. ἐγὼ δέ, ὅτι μέν - ποτ᾿ ἐξῆν τῇ πόλει καὶ τὰ αὑτῆς ἔχειν ἀσφαλῶς καὶ Φίλιππον - τιμωρήσασθαι, καὶ μάλ᾿ ἀκριβῶς οἶδα· ἐπ᾿ ἐμοῦ γάρ, οὐ πάλαι - γέγονεν ταῦτ᾿ ἀμφότερα· νῦν μέντοι πέπεισμαι τοῦθ᾿ ἱκανὸν - προλαβεῖν ἡμῖν εἶναι τὴν πρώτην, ὅπως τοὺς συμμάχους - σώσομεν. ἐὰν γὰρ τοῦτο βεβαίως ὑπάρξῃ, τότε καὶ περὶ τοῦ - τίνα τιμωρήσεταί τις καὶ ὃν τρόπον ἐξέσται σκοπεῖν· πρὶν δὲ - τὴν ἀρχὴν ὀρθῶς ὑποθέσθαι, μάταιον ἡγοῦμαι περὶ τῆς - τελευτῆς ὁντινοῦν ποιεῖσθαι λόγον. - - Δημοσθένους, Γ´ ᾿Ολυνθιακὸς - -Georgian: - - From a Unicode conference invitation: - - გთხოვთ ახლავე გაიაროთ რეგისტრაცია Unicode-ის მეათე საერთაშორისო - კონფერენციაზე დასასწრებად, რომელიც გაიმართება 10-12 მარტს, - ქ. მაინცში, გერმანიაში. კონფერენცია შეჰკრებს ერთად მსოფლიოს - ექსპერტებს ისეთ დარგებში როგორიცაა ინტერნეტი და Unicode-ი, - ინტერნაციონალიზაცია და ლოკალიზაცია, Unicode-ის გამოყენება - ოპერაციულ სისტემებსა, და გამოყენებით პროგრამებში, შრიფტებში, - ტექსტების დამუშავებასა და მრავალენოვან კომპიუტერულ სისტემებში. - -Russian: - - From a Unicode conference invitation: - - Зарегистрируйтесь сейчас на Десятую Международную Конференцию по - Unicode, которая состоится 10-12 марта 1997 года в Майнце в Германии. - Конференция соберет широкий круг экспертов по вопросам глобального - Интернета и Unicode, локализации и интернационализации, воплощению и - применению Unicode в различных операционных системах и программных - приложениях, шрифтах, верстке и многоязычных компьютерных системах. - -Thai (UCS Level 2): - - Excerpt from a poetry on The Romance of The Three Kingdoms (a Chinese - classic 'San Gua'): - - [----------------------------|------------------------] - ๏ แผ่นดินฮั่นเสื่อมโทรมแสนสังเวช พระปกเกศกองบู๊กู้ขึ้นใหม่ - สิบสองกษัตริย์ก่อนหน้าแลถัดไป สององค์ไซร้โง่เขลาเบาปัญญา - ทรงนับถือขันทีเป็นที่พึ่ง บ้านเมืองจึงวิปริตเป็นนักหนา - โฮจิ๋นเรียกทัพทั่วหัวเมืองมา หมายจะฆ่ามดชั่วตัวสำคัญ - เหมือนขับไสไล่เสือจากเคหา รับหมาป่าเข้ามาเลยอาสัญ - ฝ่ายอ้องอุ้นยุแยกให้แตกกัน ใช้สาวนั้นเป็นชนวนชื่นชวนใจ - พลันลิฉุยกุยกีกลับก่อเหตุ ช่างอาเพศจริงหนาฟ้าร้องไห้ - ต้องรบราฆ่าฟันจนบรรลัย ฤๅหาใครค้ำชูกู้บรรลังก์ ฯ - - (The above is a two-column text. If combining characters are handled - correctly, the lines of the second column should be aligned with the - | character above.) - -Ethiopian: - - Proverbs in the Amharic language: - - ሰማይ አይታረስ ንጉሥ አይከሰስ። - ብላ ካለኝ እንደአባቴ በቆመጠኝ። - ጌጥ ያለቤቱ ቁምጥና ነው። - ደሀ በሕልሙ ቅቤ ባይጠጣ ንጣት በገደለው። - የአፍ ወለምታ በቅቤ አይታሽም። - አይጥ በበላ ዳዋ ተመታ። - ሲተረጉሙ ይደረግሙ። - ቀስ በቀስ፥ ዕንቁላል በእግሩ ይሄዳል። - ድር ቢያብር አንበሳ ያስር። - ሰው እንደቤቱ እንጅ እንደ ጉረቤቱ አይተዳደርም። - እግዜር የከፈተውን ጉሮሮ ሳይዘጋው አይድርም። - የጎረቤት ሌባ፥ ቢያዩት ይስቅ ባያዩት ያጠልቅ። - ሥራ ከመፍታት ልጄን ላፋታት። - ዓባይ ማደሪያ የለው፥ ግንድ ይዞ ይዞራል። - የእስላም አገሩ መካ የአሞራ አገሩ ዋርካ። - ተንጋሎ ቢተፉ ተመልሶ ባፉ። - ወዳጅህ ማር ቢሆን ጨርስህ አትላሰው። - እግርህን በፍራሽህ ልክ ዘርጋ። - -Runes: - - ᚻᛖ ᚳᚹᚫᚦ ᚦᚫᛏ ᚻᛖ ᛒᚢᛞᛖ ᚩᚾ ᚦᚫᛗ ᛚᚪᚾᛞᛖ ᚾᚩᚱᚦᚹᛖᚪᚱᛞᚢᛗ ᚹᛁᚦ ᚦᚪ ᚹᛖᛥᚫ - - (Old English, which transcribed into Latin reads 'He cwaeth that he - bude thaem lande northweardum with tha Westsae.' and means 'He said - that he lived in the northern land near the Western Sea.') - -Braille: - - ⡌⠁⠧⠑ ⠼⠁⠒ ⡍⠜⠇⠑⠹⠰⠎ ⡣⠕⠌ - - ⡍⠜⠇⠑⠹ ⠺⠁⠎ ⠙⠑⠁⠙⠒ ⠞⠕ ⠃⠑⠛⠔ ⠺⠊⠹⠲ ⡹⠻⠑ ⠊⠎ ⠝⠕ ⠙⠳⠃⠞ - ⠱⠁⠞⠑⠧⠻ ⠁⠃⠳⠞ ⠹⠁⠞⠲ ⡹⠑ ⠗⠑⠛⠊⠌⠻ ⠕⠋ ⠙⠊⠎ ⠃⠥⠗⠊⠁⠇ ⠺⠁⠎ - ⠎⠊⠛⠝⠫ ⠃⠹ ⠹⠑ ⠊⠇⠻⠛⠹⠍⠁⠝⠂ ⠹⠑ ⠊⠇⠻⠅⠂ ⠹⠑ ⠥⠝⠙⠻⠞⠁⠅⠻⠂ - ⠁⠝⠙ ⠹⠑ ⠡⠊⠑⠋ ⠍⠳⠗⠝⠻⠲ ⡎⠊⠗⠕⠕⠛⠑ ⠎⠊⠛⠝⠫ ⠊⠞⠲ ⡁⠝⠙ - ⡎⠊⠗⠕⠕⠛⠑⠰⠎ ⠝⠁⠍⠑ ⠺⠁⠎ ⠛⠕⠕⠙ ⠥⠏⠕⠝ ⠰⡡⠁⠝⠛⠑⠂ ⠋⠕⠗ ⠁⠝⠹⠹⠔⠛ ⠙⠑ - ⠡⠕⠎⠑ ⠞⠕ ⠏⠥⠞ ⠙⠊⠎ ⠙⠁⠝⠙ ⠞⠕⠲ - - ⡕⠇⠙ ⡍⠜⠇⠑⠹ ⠺⠁⠎ ⠁⠎ ⠙⠑⠁⠙ ⠁⠎ ⠁ ⠙⠕⠕⠗⠤⠝⠁⠊⠇⠲ - - ⡍⠔⠙⠖ ⡊ ⠙⠕⠝⠰⠞ ⠍⠑⠁⠝ ⠞⠕ ⠎⠁⠹ ⠹⠁⠞ ⡊ ⠅⠝⠪⠂ ⠕⠋ ⠍⠹ - ⠪⠝ ⠅⠝⠪⠇⠫⠛⠑⠂ ⠱⠁⠞ ⠹⠻⠑ ⠊⠎ ⠏⠜⠞⠊⠊⠥⠇⠜⠇⠹ ⠙⠑⠁⠙ ⠁⠃⠳⠞ - ⠁ ⠙⠕⠕⠗⠤⠝⠁⠊⠇⠲ ⡊ ⠍⠊⠣⠞ ⠙⠁⠧⠑ ⠃⠑⠲ ⠔⠊⠇⠔⠫⠂ ⠍⠹⠎⠑⠇⠋⠂ ⠞⠕ - ⠗⠑⠛⠜⠙ ⠁ ⠊⠕⠋⠋⠔⠤⠝⠁⠊⠇ ⠁⠎ ⠹⠑ ⠙⠑⠁⠙⠑⠌ ⠏⠊⠑⠊⠑ ⠕⠋ ⠊⠗⠕⠝⠍⠕⠝⠛⠻⠹ - ⠔ ⠹⠑ ⠞⠗⠁⠙⠑⠲ ⡃⠥⠞ ⠹⠑ ⠺⠊⠎⠙⠕⠍ ⠕⠋ ⠳⠗ ⠁⠝⠊⠑⠌⠕⠗⠎ - ⠊⠎ ⠔ ⠹⠑ ⠎⠊⠍⠊⠇⠑⠆ ⠁⠝⠙ ⠍⠹ ⠥⠝⠙⠁⠇⠇⠪⠫ ⠙⠁⠝⠙⠎ - ⠩⠁⠇⠇ ⠝⠕⠞ ⠙⠊⠌⠥⠗⠃ ⠊⠞⠂ ⠕⠗ ⠹⠑ ⡊⠳⠝⠞⠗⠹⠰⠎ ⠙⠕⠝⠑ ⠋⠕⠗⠲ ⡹⠳ - ⠺⠊⠇⠇ ⠹⠻⠑⠋⠕⠗⠑ ⠏⠻⠍⠊⠞ ⠍⠑ ⠞⠕ ⠗⠑⠏⠑⠁⠞⠂ ⠑⠍⠏⠙⠁⠞⠊⠊⠁⠇⠇⠹⠂ ⠹⠁⠞ - ⡍⠜⠇⠑⠹ ⠺⠁⠎ ⠁⠎ ⠙⠑⠁⠙ ⠁⠎ ⠁ ⠙⠕⠕⠗⠤⠝⠁⠊⠇⠲ - - (The first couple of paragraphs of "A Christmas Carol" by Dickens) - -Compact font selection example text: - - ABCDEFGHIJKLMNOPQRSTUVWXYZ /0123456789 - abcdefghijklmnopqrstuvwxyz £©µÀÆÖÞßéöÿ - –—‘“”„†•…‰™œŠŸž€ ΑΒΓΔΩαβγδω АБВГДабвгд - ∀∂∈ℝ∧∪≡∞ ↑↗↨↻⇣ ┐┼╔╘░►☺♀ fi�⑀₂ἠḂӥẄɐː⍎אԱა - -Greetings in various languages: - - Hello world, Καλημέρα κόσμε, コンニチハ - -Box drawing alignment tests: █ - ▉ - ╔══╦══╗ ┌──┬──┐ ╭──┬──╮ ╭──┬──╮ ┏━━┳━━┓ ┎┒┏┑ ╷ ╻ ┏┯┓ ┌┰┐ ▊ ╱╲╱╲╳╳╳ - ║┌─╨─┐║ │╔═╧═╗│ │╒═╪═╕│ │╓─╁─╖│ ┃┌─╂─┐┃ ┗╃╄┙ ╶┼╴╺╋╸┠┼┨ ┝╋┥ ▋ ╲╱╲╱╳╳╳ - ║│╲ ╱│║ │║ ║│ ││ │ ││ │║ ┃ ║│ ┃│ ╿ │┃ ┍╅╆┓ ╵ ╹ ┗┷┛ └┸┘ ▌ ╱╲╱╲╳╳╳ - ╠╡ ╳ ╞╣ ├╢ ╟┤ ├┼─┼─┼┤ ├╫─╂─╫┤ ┣┿╾┼╼┿┫ ┕┛┖┚ ┌┄┄┐ ╎ ┏┅┅┓ ┋ ▍ ╲╱╲╱╳╳╳ - ║│╱ ╲│║ │║ ║│ ││ │ ││ │║ ┃ ║│ ┃│ ╽ │┃ ░░▒▒▓▓██ ┊ ┆ ╎ ╏ ┇ ┋ ▎ - ║└─╥─┘║ │╚═╤═╝│ │╘═╪═╛│ │╙─╀─╜│ ┃└─╂─┘┃ ░░▒▒▓▓██ ┊ ┆ ╎ ╏ ┇ ┋ ▏ - ╚══╩══╝ └──┴──┘ ╰──┴──╯ ╰──┴──╯ ┗━━┻━━┛ ▗▄▖▛▀▜ └╌╌┘ ╎ ┗╍╍┛ ┋ ▁▂▃▄▅▆▇█ - ▝▀▘▙▄▟ - -Surrogates: - -𠜎 𠜱 𠝹 𠱓 𠱸 𠲖 𠳏 𠳕 𠴕 𠵼 𠵿 𠸎 𠸏 𠹷 𠺝 𠺢 𠻗 𠻹 𠻺 𠼭 𠼮 𠽌 𠾴 𠾼 𠿪 𡁜 𡁯 𡁵 𡁶 𡁻 𡃁 -𡃉 𡇙 𢃇 𢞵 𢫕 𢭃 𢯊 𢱑 𢱕 𢳂 𢴈 𢵌 𢵧 𢺳 𣲷 𤓓 𤶸 𤷪 𥄫 𦉘 𦟌 𦧲 𦧺 𧨾 𨅝 𨈇 𨋢 𨳊 𨳍 𨳒 𩶘 diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/utf8/tests/index.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/utf8/tests/index.js deleted file mode 100644 index 222cd8a0..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@protobufjs/utf8/tests/index.js +++ /dev/null @@ -1,57 +0,0 @@ -var tape = require("tape"); - -var utf8 = require(".."); - -var data = require("fs").readFileSync(require.resolve("./data/utf8.txt")), - dataStr = data.toString("utf8"); - -tape.test("utf8", function(test) { - - test.test(test.name + " - length", function(test) { - test.equal(utf8.length(""), 0, "should return a byte length of zero for an empty string"); - - test.equal(utf8.length(dataStr), Buffer.byteLength(dataStr), "should return the same byte length as node buffers"); - - test.end(); - }); - - test.test(test.name + " - read", function(test) { - var comp = utf8.read([], 0, 0); - test.equal(comp, "", "should decode an empty buffer to an empty string"); - - comp = utf8.read(data, 0, data.length); - test.equal(comp, data.toString("utf8"), "should decode to the same byte data as node buffers"); - - var longData = Buffer.concat([data, data, data, data]); - comp = utf8.read(longData, 0, longData.length); - test.equal(comp, longData.toString("utf8"), "should decode to the same byte data as node buffers (long)"); - - var chunkData = new Buffer(data.toString("utf8").substring(0, 8192)); - comp = utf8.read(chunkData, 0, chunkData.length); - test.equal(comp, chunkData.toString("utf8"), "should decode to the same byte data as node buffers (chunk size)"); - - test.end(); - }); - - test.test(test.name + " - write", function(test) { - var buf = new Buffer(0); - test.equal(utf8.write("", buf, 0), 0, "should encode an empty string to an empty buffer"); - - var len = utf8.length(dataStr); - buf = new Buffer(len); - test.equal(utf8.write(dataStr, buf, 0), len, "should encode to exactly " + len + " bytes"); - - test.equal(buf.length, data.length, "should encode to a buffer length equal to that of node buffers"); - - for (var i = 0; i < buf.length; ++i) { - if (buf[i] !== data[i]) { - test.fail("should encode to the same buffer data as node buffers (offset " + i + ")"); - return; - } - } - test.pass("should encode to the same buffer data as node buffers"); - - test.end(); - }); - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@tootallnate/once/LICENSE b/packages/wyatt_notification_bloc/example/scripts/node_modules/@tootallnate/once/LICENSE deleted file mode 100644 index c4c56a2a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@tootallnate/once/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2020 Nathan Rajlich - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@tootallnate/once/README.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/@tootallnate/once/README.md deleted file mode 100644 index bc980fd4..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@tootallnate/once/README.md +++ /dev/null @@ -1,93 +0,0 @@ -# @tootallnate/once - -### Creates a Promise that waits for a single event - -## Installation - -Install with `npm`: - -```bash -$ npm install @tootallnate/once -``` - -## API - -### once(emitter: EventEmitter, name: string, opts?: OnceOptions): Promise<[...Args]> - -Creates a Promise that waits for event `name` to occur on `emitter`, and resolves -the promise with an array of the values provided to the event handler. If an -`error` event occurs before the event specified by `name`, then the Promise is -rejected with the error argument. - -```typescript -import once from '@tootallnate/once'; -import { EventEmitter } from 'events'; - -const emitter = new EventEmitter(); - -setTimeout(() => { - emitter.emit('foo', 'bar'); -}, 100); - -const [result] = await once(emitter, 'foo'); -console.log({ result }); -// { result: 'bar' } -``` - -#### Promise Strong Typing - -The main feature that this module provides over other "once" implementations is that -the Promise that is returned is _**strongly typed**_ based on the type of `emitter` -and the `name` of the event. Some examples are shown below. - -_The process "exit" event contains a single number for exit code:_ - -```typescript -const [code] = await once(process, 'exit'); -// ^ number -``` -_A child process "exit" event contains either an exit code or a signal:_ - -```typescript -const child = spawn('echo', []); -const [code, signal] = await once(child, 'exit'); -// ^ number | null -// ^ string | null -``` - -_A forked child process "message" event is type `any`, so you can cast the Promise directly:_ - -```typescript -const child = fork('file.js'); - -// With `await` -const [message, _]: [WorkerPayload, unknown] = await once(child, 'message'); - -// With Promise -const messagePromise: Promise<[WorkerPayload, unknown]> = once(child, 'message'); - -// Better yet would be to leave it as `any`, and validate the payload -// at runtime with i.e. `ajv` + `json-schema-to-typescript` -``` - -_If the TypeScript definition does not contain an overload for the specified event name, then the Promise will have type `unknown[]` and your code will need to narrow the result manually:_ - -```typescript -interface CustomEmitter extends EventEmitter { - on(name: 'foo', listener: (a: string, b: number) => void): this; -} - -const emitter: CustomEmitter = new EventEmitter(); - -// "foo" event is a defined overload, so it's properly typed -const fooPromise = once(emitter, 'foo'); -// ^ Promise<[a: string, b: number]> - -// "bar" event in not a defined overload, so it gets `unknown[]` -const barPromise = once(emitter, 'bar'); -// ^ Promise -``` - -### OnceOptions - -- `signal` - `AbortSignal` instance to unbind event handlers before the Promise has been fulfilled. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@tootallnate/once/dist/index.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@tootallnate/once/dist/index.d.ts deleted file mode 100644 index 93d02a9a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@tootallnate/once/dist/index.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -/// -import { EventEmitter } from 'events'; -import { EventNames, EventListenerParameters, AbortSignal } from './types'; -export interface OnceOptions { - signal?: AbortSignal; -} -export default function once>(emitter: Emitter, name: Event, { signal }?: OnceOptions): Promise>; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@tootallnate/once/dist/index.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/@tootallnate/once/dist/index.js deleted file mode 100644 index ca6385b1..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@tootallnate/once/dist/index.js +++ /dev/null @@ -1,24 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -function once(emitter, name, { signal } = {}) { - return new Promise((resolve, reject) => { - function cleanup() { - signal === null || signal === void 0 ? void 0 : signal.removeEventListener('abort', cleanup); - emitter.removeListener(name, onEvent); - emitter.removeListener('error', onError); - } - function onEvent(...args) { - cleanup(); - resolve(args); - } - function onError(err) { - cleanup(); - reject(err); - } - signal === null || signal === void 0 ? void 0 : signal.addEventListener('abort', cleanup); - emitter.on(name, onEvent); - emitter.on('error', onError); - }); -} -exports.default = once; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@tootallnate/once/dist/overloaded-parameters.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@tootallnate/once/dist/overloaded-parameters.d.ts deleted file mode 100644 index eb2bbc6c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@tootallnate/once/dist/overloaded-parameters.d.ts +++ /dev/null @@ -1,231 +0,0 @@ -export declare type OverloadedParameters = T extends { - (...args: infer A1): any; - (...args: infer A2): any; - (...args: infer A3): any; - (...args: infer A4): any; - (...args: infer A5): any; - (...args: infer A6): any; - (...args: infer A7): any; - (...args: infer A8): any; - (...args: infer A9): any; - (...args: infer A10): any; - (...args: infer A11): any; - (...args: infer A12): any; - (...args: infer A13): any; - (...args: infer A14): any; - (...args: infer A15): any; - (...args: infer A16): any; - (...args: infer A17): any; - (...args: infer A18): any; - (...args: infer A19): any; - (...args: infer A20): any; -} ? A1 | A2 | A3 | A4 | A5 | A6 | A7 | A8 | A9 | A10 | A11 | A12 | A13 | A14 | A15 | A16 | A17 | A18 | A19 | A20 : T extends { - (...args: infer A1): any; - (...args: infer A2): any; - (...args: infer A3): any; - (...args: infer A4): any; - (...args: infer A5): any; - (...args: infer A6): any; - (...args: infer A7): any; - (...args: infer A8): any; - (...args: infer A9): any; - (...args: infer A10): any; - (...args: infer A11): any; - (...args: infer A12): any; - (...args: infer A13): any; - (...args: infer A14): any; - (...args: infer A15): any; - (...args: infer A16): any; - (...args: infer A17): any; - (...args: infer A18): any; - (...args: infer A19): any; -} ? A1 | A2 | A3 | A4 | A5 | A6 | A7 | A8 | A9 | A10 | A11 | A12 | A13 | A14 | A15 | A16 | A17 | A18 | A19 : T extends { - (...args: infer A1): any; - (...args: infer A2): any; - (...args: infer A3): any; - (...args: infer A4): any; - (...args: infer A5): any; - (...args: infer A6): any; - (...args: infer A7): any; - (...args: infer A8): any; - (...args: infer A9): any; - (...args: infer A10): any; - (...args: infer A11): any; - (...args: infer A12): any; - (...args: infer A13): any; - (...args: infer A14): any; - (...args: infer A15): any; - (...args: infer A16): any; - (...args: infer A17): any; - (...args: infer A18): any; -} ? A1 | A2 | A3 | A4 | A5 | A6 | A7 | A8 | A9 | A10 | A11 | A12 | A13 | A14 | A15 | A16 | A17 | A18 : T extends { - (...args: infer A1): any; - (...args: infer A2): any; - (...args: infer A3): any; - (...args: infer A4): any; - (...args: infer A5): any; - (...args: infer A6): any; - (...args: infer A7): any; - (...args: infer A8): any; - (...args: infer A9): any; - (...args: infer A10): any; - (...args: infer A11): any; - (...args: infer A12): any; - (...args: infer A13): any; - (...args: infer A14): any; - (...args: infer A15): any; - (...args: infer A16): any; - (...args: infer A17): any; -} ? A1 | A2 | A3 | A4 | A5 | A6 | A7 | A8 | A9 | A10 | A11 | A12 | A13 | A14 | A15 | A16 | A17 : T extends { - (...args: infer A1): any; - (...args: infer A2): any; - (...args: infer A3): any; - (...args: infer A4): any; - (...args: infer A5): any; - (...args: infer A6): any; - (...args: infer A7): any; - (...args: infer A8): any; - (...args: infer A9): any; - (...args: infer A10): any; - (...args: infer A11): any; - (...args: infer A12): any; - (...args: infer A13): any; - (...args: infer A14): any; - (...args: infer A15): any; - (...args: infer A16): any; -} ? A1 | A2 | A3 | A4 | A5 | A6 | A7 | A8 | A9 | A10 | A11 | A12 | A13 | A14 | A15 | A16 : T extends { - (...args: infer A1): any; - (...args: infer A2): any; - (...args: infer A3): any; - (...args: infer A4): any; - (...args: infer A5): any; - (...args: infer A6): any; - (...args: infer A7): any; - (...args: infer A8): any; - (...args: infer A9): any; - (...args: infer A10): any; - (...args: infer A11): any; - (...args: infer A12): any; - (...args: infer A13): any; - (...args: infer A14): any; - (...args: infer A15): any; -} ? A1 | A2 | A3 | A4 | A5 | A6 | A7 | A8 | A9 | A10 | A11 | A12 | A13 | A14 | A15 : T extends { - (...args: infer A1): any; - (...args: infer A2): any; - (...args: infer A3): any; - (...args: infer A4): any; - (...args: infer A5): any; - (...args: infer A6): any; - (...args: infer A7): any; - (...args: infer A8): any; - (...args: infer A9): any; - (...args: infer A10): any; - (...args: infer A11): any; - (...args: infer A12): any; - (...args: infer A13): any; - (...args: infer A14): any; -} ? A1 | A2 | A3 | A4 | A5 | A6 | A7 | A8 | A9 | A10 | A11 | A12 | A13 | A14 : T extends { - (...args: infer A1): any; - (...args: infer A2): any; - (...args: infer A3): any; - (...args: infer A4): any; - (...args: infer A5): any; - (...args: infer A6): any; - (...args: infer A7): any; - (...args: infer A8): any; - (...args: infer A9): any; - (...args: infer A10): any; - (...args: infer A11): any; - (...args: infer A12): any; - (...args: infer A13): any; -} ? A1 | A2 | A3 | A4 | A5 | A6 | A7 | A8 | A9 | A10 | A11 | A12 | A13 : T extends { - (...args: infer A1): any; - (...args: infer A2): any; - (...args: infer A3): any; - (...args: infer A4): any; - (...args: infer A5): any; - (...args: infer A6): any; - (...args: infer A7): any; - (...args: infer A8): any; - (...args: infer A9): any; - (...args: infer A10): any; - (...args: infer A11): any; - (...args: infer A12): any; -} ? A1 | A2 | A3 | A4 | A5 | A6 | A7 | A8 | A9 | A10 | A11 | A12 : T extends { - (...args: infer A1): any; - (...args: infer A2): any; - (...args: infer A3): any; - (...args: infer A4): any; - (...args: infer A5): any; - (...args: infer A6): any; - (...args: infer A7): any; - (...args: infer A8): any; - (...args: infer A9): any; - (...args: infer A10): any; - (...args: infer A11): any; -} ? A1 | A2 | A3 | A4 | A5 | A6 | A7 | A8 | A9 | A10 | A11 : T extends { - (...args: infer A1): any; - (...args: infer A2): any; - (...args: infer A3): any; - (...args: infer A4): any; - (...args: infer A5): any; - (...args: infer A6): any; - (...args: infer A7): any; - (...args: infer A8): any; - (...args: infer A9): any; - (...args: infer A10): any; -} ? A1 | A2 | A3 | A4 | A5 | A6 | A7 | A8 | A9 | A10 : T extends { - (...args: infer A1): any; - (...args: infer A2): any; - (...args: infer A3): any; - (...args: infer A4): any; - (...args: infer A5): any; - (...args: infer A6): any; - (...args: infer A7): any; - (...args: infer A8): any; - (...args: infer A9): any; -} ? A1 | A2 | A3 | A4 | A5 | A6 | A7 | A8 | A9 : T extends { - (...args: infer A1): any; - (...args: infer A2): any; - (...args: infer A3): any; - (...args: infer A4): any; - (...args: infer A5): any; - (...args: infer A6): any; - (...args: infer A7): any; - (...args: infer A8): any; -} ? A1 | A2 | A3 | A4 | A5 | A6 | A7 | A8 : T extends { - (...args: infer A1): any; - (...args: infer A2): any; - (...args: infer A3): any; - (...args: infer A4): any; - (...args: infer A5): any; - (...args: infer A6): any; - (...args: infer A7): any; -} ? A1 | A2 | A3 | A4 | A5 | A6 | A7 : T extends { - (...args: infer A1): any; - (...args: infer A2): any; - (...args: infer A3): any; - (...args: infer A4): any; - (...args: infer A5): any; - (...args: infer A6): any; -} ? A1 | A2 | A3 | A4 | A5 | A6 : T extends { - (...args: infer A1): any; - (...args: infer A2): any; - (...args: infer A3): any; - (...args: infer A4): any; - (...args: infer A5): any; -} ? A1 | A2 | A3 | A4 | A5 : T extends { - (...args: infer A1): any; - (...args: infer A2): any; - (...args: infer A3): any; - (...args: infer A4): any; -} ? A1 | A2 | A3 | A4 : T extends { - (...args: infer A1): any; - (...args: infer A2): any; - (...args: infer A3): any; -} ? A1 | A2 | A3 : T extends { - (...args: infer A1): any; - (...args: infer A2): any; -} ? A1 | A2 : T extends { - (...args: infer A1): any; -} ? A1 : any; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@tootallnate/once/dist/overloaded-parameters.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/@tootallnate/once/dist/overloaded-parameters.js deleted file mode 100644 index 207186d9..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@tootallnate/once/dist/overloaded-parameters.js +++ /dev/null @@ -1,3 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -//# sourceMappingURL=overloaded-parameters.js.map \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@tootallnate/once/dist/types.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@tootallnate/once/dist/types.d.ts deleted file mode 100644 index 58be8284..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@tootallnate/once/dist/types.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -/// -import { EventEmitter } from 'events'; -import { OverloadedParameters } from './overloaded-parameters'; -export declare type FirstParameter = T extends [infer R, ...any[]] ? R : never; -export declare type EventListener = F extends [ - T, - infer R, - ...any[] -] ? R : never; -export declare type EventParameters = OverloadedParameters; -export declare type EventNames = FirstParameter>; -export declare type EventListenerParameters> = WithDefault, Event>>, unknown[]>; -export declare type WithDefault = [T] extends [never] ? D : T; -export interface AbortSignal { - addEventListener: (name: string, listener: (...args: any[]) => any) => void; - removeEventListener: (name: string, listener: (...args: any[]) => any) => void; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@tootallnate/once/dist/types.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/@tootallnate/once/dist/types.js deleted file mode 100644 index 11e638d1..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@tootallnate/once/dist/types.js +++ /dev/null @@ -1,3 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -//# sourceMappingURL=types.js.map \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@tootallnate/once/package.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/@tootallnate/once/package.json deleted file mode 100644 index 69ce947d..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@tootallnate/once/package.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "name": "@tootallnate/once", - "version": "2.0.0", - "description": "Creates a Promise that waits for a single event", - "main": "./dist/index.js", - "types": "./dist/index.d.ts", - "files": [ - "dist" - ], - "scripts": { - "prebuild": "rimraf dist", - "build": "tsc", - "test": "jest", - "prepublishOnly": "npm run build" - }, - "repository": { - "type": "git", - "url": "git://github.com/TooTallNate/once.git" - }, - "keywords": [], - "author": "Nathan Rajlich (http://n8.io/)", - "license": "MIT", - "bugs": { - "url": "https://github.com/TooTallNate/once/issues" - }, - "devDependencies": { - "@types/jest": "^27.0.2", - "@types/node": "^12.12.11", - "abort-controller": "^3.0.0", - "jest": "^27.2.1", - "rimraf": "^3.0.0", - "ts-jest": "^27.0.5", - "typescript": "^4.4.3" - }, - "engines": { - "node": ">= 10" - }, - "jest": { - "preset": "ts-jest", - "globals": { - "ts-jest": { - "diagnostics": false, - "isolatedModules": true - } - }, - "verbose": false, - "testEnvironment": "node", - "testMatch": [ - "/test/**/*.test.ts" - ] - } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/body-parser/LICENSE b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/body-parser/LICENSE deleted file mode 100755 index 9e841e7a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/body-parser/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ - MIT License - - Copyright (c) Microsoft Corporation. - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in all - copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - SOFTWARE diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/body-parser/README.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/body-parser/README.md deleted file mode 100755 index 9b54a39c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/body-parser/README.md +++ /dev/null @@ -1,16 +0,0 @@ -# Installation -> `npm install --save @types/body-parser` - -# Summary -This package contains type definitions for body-parser (https://github.com/expressjs/body-parser). - -# Details -Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/body-parser. - -### Additional Details - * Last updated: Tue, 16 Nov 2021 18:31:30 GMT - * Dependencies: [@types/connect](https://npmjs.com/package/@types/connect), [@types/node](https://npmjs.com/package/@types/node) - * Global values: none - -# Credits -These definitions were written by [Santi Albo](https://github.com/santialbo), [Vilic Vane](https://github.com/vilic), [Jonathan Häberle](https://github.com/dreampulse), [Gevik Babakhani](https://github.com/blendsdk), [Tomasz Łaziuk](https://github.com/tlaziuk), [Jason Walton](https://github.com/jwalton), and [Piotr Błażejewicz](https://github.com/peterblazejewicz). diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/body-parser/index.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/body-parser/index.d.ts deleted file mode 100755 index 4be03964..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/body-parser/index.d.ts +++ /dev/null @@ -1,107 +0,0 @@ -// Type definitions for body-parser 1.19 -// Project: https://github.com/expressjs/body-parser -// Definitions by: Santi Albo -// Vilic Vane -// Jonathan Häberle -// Gevik Babakhani -// Tomasz Łaziuk -// Jason Walton -// Piotr Błażejewicz -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/// - -import { NextHandleFunction } from 'connect'; -import * as http from 'http'; - -// for docs go to https://github.com/expressjs/body-parser/tree/1.19.0#body-parser - -declare namespace bodyParser { - interface BodyParser { - /** - * @deprecated use individual json/urlencoded middlewares - */ - (options?: OptionsJson & OptionsText & OptionsUrlencoded): NextHandleFunction; - /** - * Returns middleware that only parses json and only looks at requests - * where the Content-Type header matches the type option. - */ - json(options?: OptionsJson): NextHandleFunction; - /** - * Returns middleware that parses all bodies as a Buffer and only looks at requests - * where the Content-Type header matches the type option. - */ - raw(options?: Options): NextHandleFunction; - - /** - * Returns middleware that parses all bodies as a string and only looks at requests - * where the Content-Type header matches the type option. - */ - text(options?: OptionsText): NextHandleFunction; - /** - * Returns middleware that only parses urlencoded bodies and only looks at requests - * where the Content-Type header matches the type option - */ - urlencoded(options?: OptionsUrlencoded): NextHandleFunction; - } - - interface Options { - /** When set to true, then deflated (compressed) bodies will be inflated; when false, deflated bodies are rejected. Defaults to true. */ - inflate?: boolean | undefined; - /** - * Controls the maximum request body size. If this is a number, - * then the value specifies the number of bytes; if it is a string, - * the value is passed to the bytes library for parsing. Defaults to '100kb'. - */ - limit?: number | string | undefined; - /** - * The type option is used to determine what media type the middleware will parse - */ - type?: string | string[] | ((req: http.IncomingMessage) => any) | undefined; - /** - * The verify option, if supplied, is called as verify(req, res, buf, encoding), - * where buf is a Buffer of the raw request body and encoding is the encoding of the request. - */ - verify?(req: http.IncomingMessage, res: http.ServerResponse, buf: Buffer, encoding: string): void; - } - - interface OptionsJson extends Options { - /** - * - * The reviver option is passed directly to JSON.parse as the second argument. - */ - reviver?(key: string, value: any): any; - /** - * When set to `true`, will only accept arrays and objects; - * when `false` will accept anything JSON.parse accepts. Defaults to `true`. - */ - strict?: boolean | undefined; - } - - interface OptionsText extends Options { - /** - * Specify the default character set for the text content if the charset - * is not specified in the Content-Type header of the request. - * Defaults to `utf-8`. - */ - defaultCharset?: string | undefined; - } - - interface OptionsUrlencoded extends Options { - /** - * The extended option allows to choose between parsing the URL-encoded data - * with the querystring library (when `false`) or the qs library (when `true`). - */ - extended?: boolean | undefined; - /** - * The parameterLimit option controls the maximum number of parameters - * that are allowed in the URL-encoded data. If a request contains more parameters than this value, - * a 413 will be returned to the client. Defaults to 1000. - */ - parameterLimit?: number | undefined; - } -} - -declare const bodyParser: bodyParser.BodyParser; - -export = bodyParser; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/body-parser/package.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/body-parser/package.json deleted file mode 100755 index 8f99f52b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/body-parser/package.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "name": "@types/body-parser", - "version": "1.19.2", - "description": "TypeScript definitions for body-parser", - "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/body-parser", - "license": "MIT", - "contributors": [ - { - "name": "Santi Albo", - "url": "https://github.com/santialbo", - "githubUsername": "santialbo" - }, - { - "name": "Vilic Vane", - "url": "https://github.com/vilic", - "githubUsername": "vilic" - }, - { - "name": "Jonathan Häberle", - "url": "https://github.com/dreampulse", - "githubUsername": "dreampulse" - }, - { - "name": "Gevik Babakhani", - "url": "https://github.com/blendsdk", - "githubUsername": "blendsdk" - }, - { - "name": "Tomasz Łaziuk", - "url": "https://github.com/tlaziuk", - "githubUsername": "tlaziuk" - }, - { - "name": "Jason Walton", - "url": "https://github.com/jwalton", - "githubUsername": "jwalton" - }, - { - "name": "Piotr Błażejewicz", - "url": "https://github.com/peterblazejewicz", - "githubUsername": "peterblazejewicz" - } - ], - "main": "", - "types": "index.d.ts", - "repository": { - "type": "git", - "url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git", - "directory": "types/body-parser" - }, - "scripts": {}, - "dependencies": { - "@types/connect": "*", - "@types/node": "*" - }, - "typesPublisherContentHash": "ad069aa8b9e8a95f66df025de11975c773540e4071000abdb7db565579b013ee", - "typeScriptVersion": "3.7" -} \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/connect/LICENSE b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/connect/LICENSE deleted file mode 100755 index 9e841e7a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/connect/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ - MIT License - - Copyright (c) Microsoft Corporation. - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in all - copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - SOFTWARE diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/connect/README.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/connect/README.md deleted file mode 100755 index e9872646..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/connect/README.md +++ /dev/null @@ -1,16 +0,0 @@ -# Installation -> `npm install --save @types/connect` - -# Summary -This package contains type definitions for connect (https://github.com/senchalabs/connect). - -# Details -Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/connect. - -### Additional Details - * Last updated: Tue, 06 Jul 2021 20:32:28 GMT - * Dependencies: [@types/node](https://npmjs.com/package/@types/node) - * Global values: none - -# Credits -These definitions were written by [Maxime LUCE](https://github.com/SomaticIT), and [Evan Hahn](https://github.com/EvanHahn). diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/connect/index.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/connect/index.d.ts deleted file mode 100755 index c1d5aa86..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/connect/index.d.ts +++ /dev/null @@ -1,93 +0,0 @@ -// Type definitions for connect v3.4.0 -// Project: https://github.com/senchalabs/connect -// Definitions by: Maxime LUCE -// Evan Hahn -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/// - - -import * as http from "http"; - -/** - * Create a new connect server. - */ -declare function createServer(): createServer.Server; - -declare namespace createServer { - export type ServerHandle = HandleFunction | http.Server; - - export class IncomingMessage extends http.IncomingMessage { - originalUrl?: http.IncomingMessage["url"] | undefined; - } - - type NextFunction = (err?: any) => void; - - export type SimpleHandleFunction = (req: IncomingMessage, res: http.ServerResponse) => void; - export type NextHandleFunction = (req: IncomingMessage, res: http.ServerResponse, next: NextFunction) => void; - export type ErrorHandleFunction = (err: any, req: IncomingMessage, res: http.ServerResponse, next: NextFunction) => void; - export type HandleFunction = SimpleHandleFunction | NextHandleFunction | ErrorHandleFunction; - - export interface ServerStackItem { - route: string; - handle: ServerHandle; - } - - export interface Server extends NodeJS.EventEmitter { - (req: http.IncomingMessage, res: http.ServerResponse, next?: Function): void; - - route: string; - stack: ServerStackItem[]; - - /** - * Utilize the given middleware `handle` to the given `route`, - * defaulting to _/_. This "route" is the mount-point for the - * middleware, when given a value other than _/_ the middleware - * is only effective when that segment is present in the request's - * pathname. - * - * For example if we were to mount a function at _/admin_, it would - * be invoked on _/admin_, and _/admin/settings_, however it would - * not be invoked for _/_, or _/posts_. - */ - use(fn: NextHandleFunction): Server; - use(fn: HandleFunction): Server; - use(route: string, fn: NextHandleFunction): Server; - use(route: string, fn: HandleFunction): Server; - - /** - * Handle server requests, punting them down - * the middleware stack. - */ - handle(req: http.IncomingMessage, res: http.ServerResponse, next: Function): void; - - /** - * Listen for connections. - * - * This method takes the same arguments - * as node's `http.Server#listen()`. - * - * HTTP and HTTPS: - * - * If you run your application both as HTTP - * and HTTPS you may wrap them individually, - * since your Connect "server" is really just - * a JavaScript `Function`. - * - * var connect = require('connect') - * , http = require('http') - * , https = require('https'); - * - * var app = connect(); - * - * http.createServer(app).listen(80); - * https.createServer(options, app).listen(443); - */ - listen(port: number, hostname?: string, backlog?: number, callback?: Function): http.Server; - listen(port: number, hostname?: string, callback?: Function): http.Server; - listen(path: string, callback?: Function): http.Server; - listen(handle: any, listeningListener?: Function): http.Server; - } -} - -export = createServer; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/connect/package.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/connect/package.json deleted file mode 100755 index dff5f104..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/connect/package.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "name": "@types/connect", - "version": "3.4.35", - "description": "TypeScript definitions for connect", - "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/connect", - "license": "MIT", - "contributors": [ - { - "name": "Maxime LUCE", - "url": "https://github.com/SomaticIT", - "githubUsername": "SomaticIT" - }, - { - "name": "Evan Hahn", - "url": "https://github.com/EvanHahn", - "githubUsername": "EvanHahn" - } - ], - "main": "", - "types": "index.d.ts", - "repository": { - "type": "git", - "url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git", - "directory": "types/connect" - }, - "scripts": {}, - "dependencies": { - "@types/node": "*" - }, - "typesPublisherContentHash": "09c0dcec5f675cb2bdd7487a85447955f769ef4ab174294478c4f055b528fecc", - "typeScriptVersion": "3.6" -} \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/express-serve-static-core/LICENSE b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/express-serve-static-core/LICENSE deleted file mode 100755 index 9e841e7a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/express-serve-static-core/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ - MIT License - - Copyright (c) Microsoft Corporation. - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in all - copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - SOFTWARE diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/express-serve-static-core/README.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/express-serve-static-core/README.md deleted file mode 100755 index 01a300d5..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/express-serve-static-core/README.md +++ /dev/null @@ -1,16 +0,0 @@ -# Installation -> `npm install --save @types/express-serve-static-core` - -# Summary -This package contains type definitions for Express (http://expressjs.com). - -# Details -Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/express-serve-static-core. - -### Additional Details - * Last updated: Tue, 13 Sep 2022 18:26:26 GMT - * Dependencies: [@types/node](https://npmjs.com/package/@types/node), [@types/qs](https://npmjs.com/package/@types/qs), [@types/range-parser](https://npmjs.com/package/@types/range-parser) - * Global values: none - -# Credits -These definitions were written by [Boris Yankov](https://github.com/borisyankov), [Satana Charuwichitratana](https://github.com/micksatana), [Sami Jaber](https://github.com/samijaber), [Jose Luis Leon](https://github.com/JoseLion), [David Stephens](https://github.com/dwrss), and [Shin Ando](https://github.com/andoshin11). diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/express-serve-static-core/index.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/express-serve-static-core/index.d.ts deleted file mode 100755 index 979aea85..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/express-serve-static-core/index.d.ts +++ /dev/null @@ -1,1254 +0,0 @@ -// Type definitions for Express 4.17 -// Project: http://expressjs.com -// Definitions by: Boris Yankov -// Satana Charuwichitratana -// Sami Jaber -// Jose Luis Leon -// David Stephens -// Shin Ando -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 - -// This extracts the core definitions from express to prevent a circular dependency between express and serve-static -/// - -declare global { - namespace Express { - // These open interfaces may be extended in an application-specific manner via declaration merging. - // See for example method-override.d.ts (https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/method-override/index.d.ts) - interface Request {} - interface Response {} - interface Application {} - } -} - -import * as http from 'http'; -import { EventEmitter } from 'events'; -import { Options as RangeParserOptions, Result as RangeParserResult, Ranges as RangeParserRanges } from 'range-parser'; -import { ParsedQs } from 'qs'; - -export {}; - -export type Query = ParsedQs; - -export interface NextFunction { - (err?: any): void; - /** - * "Break-out" of a router by calling {next('router')}; - * @see {https://expressjs.com/en/guide/using-middleware.html#middleware.router} - */ - (deferToNext: 'router'): void; - /** - * "Break-out" of a route by calling {next('route')}; - * @see {https://expressjs.com/en/guide/using-middleware.html#middleware.application} - */ - (deferToNext: 'route'): void; -} - -export interface Dictionary { - [key: string]: T; -} - -export interface ParamsDictionary { - [key: string]: string; -} -export type ParamsArray = string[]; -export type Params = ParamsDictionary | ParamsArray; - -export interface RequestHandler< - P = ParamsDictionary, - ResBody = any, - ReqBody = any, - ReqQuery = ParsedQs, - Locals extends Record = Record -> { - // tslint:disable-next-line callable-types (This is extended from and can't extend from a type alias in ts<2.2) - ( - req: Request, - res: Response, - next: NextFunction, - ): void; -} - -export type ErrorRequestHandler< - P = ParamsDictionary, - ResBody = any, - ReqBody = any, - ReqQuery = ParsedQs, - Locals extends Record = Record -> = ( - err: any, - req: Request, - res: Response, - next: NextFunction, -) => void; - -export type PathParams = string | RegExp | Array; - -export type RequestHandlerParams< - P = ParamsDictionary, - ResBody = any, - ReqBody = any, - ReqQuery = ParsedQs, - Locals extends Record = Record -> = - | RequestHandler - | ErrorRequestHandler - | Array | ErrorRequestHandler

>; - -type RemoveTail = S extends `${infer P}${Tail}` ? P : S; -type GetRouteParameter = RemoveTail< - RemoveTail, `-${string}`>, - `.${string}` ->; - -// prettier-ignore -export type RouteParameters = string extends Route - ? ParamsDictionary - : Route extends `${string}(${string}` - ? ParamsDictionary //TODO: handling for regex parameters - : Route extends `${string}:${infer Rest}` - ? ( - GetRouteParameter extends never - ? ParamsDictionary - : GetRouteParameter extends `${infer ParamName}?` - ? { [P in ParamName]?: string } - : { [P in GetRouteParameter]: string } - ) & - (Rest extends `${GetRouteParameter}${infer Next}` - ? RouteParameters : unknown) - : {}; - -export interface IRouterMatcher< - T, - Method extends 'all' | 'get' | 'post' | 'put' | 'delete' | 'patch' | 'options' | 'head' = any -> { - < - Route extends string, - P = RouteParameters, - ResBody = any, - ReqBody = any, - ReqQuery = ParsedQs, - Locals extends Record = Record - >( - // tslint:disable-next-line no-unnecessary-generics (it's used as the default type parameter for P) - path: Route, - // tslint:disable-next-line no-unnecessary-generics (This generic is meant to be passed explicitly.) - ...handlers: Array> - ): T; - < - Path extends string, - P = RouteParameters, - ResBody = any, - ReqBody = any, - ReqQuery = ParsedQs, - Locals extends Record = Record - >( - // tslint:disable-next-line no-unnecessary-generics (it's used as the default type parameter for P) - path: Path, - // tslint:disable-next-line no-unnecessary-generics (This generic is meant to be passed explicitly.) - ...handlers: Array> - ): T; - < - P = ParamsDictionary, - ResBody = any, - ReqBody = any, - ReqQuery = ParsedQs, - Locals extends Record = Record - >( - path: PathParams, - // tslint:disable-next-line no-unnecessary-generics (This generic is meant to be passed explicitly.) - ...handlers: Array> - ): T; - < - P = ParamsDictionary, - ResBody = any, - ReqBody = any, - ReqQuery = ParsedQs, - Locals extends Record = Record - >( - path: PathParams, - // tslint:disable-next-line no-unnecessary-generics (This generic is meant to be passed explicitly.) - ...handlers: Array> - ): T; - (path: PathParams, subApplication: Application): T; -} - -export interface IRouterHandler { - (...handlers: Array>>): T; - (...handlers: Array>>): T; - < - P = RouteParameters, - ResBody = any, - ReqBody = any, - ReqQuery = ParsedQs, - Locals extends Record = Record - >( - // tslint:disable-next-line no-unnecessary-generics (This generic is meant to be passed explicitly.) - ...handlers: Array> - ): T; - < - P = RouteParameters, - ResBody = any, - ReqBody = any, - ReqQuery = ParsedQs, - Locals extends Record = Record - >( - // tslint:disable-next-line no-unnecessary-generics (This generic is meant to be passed explicitly.) - ...handlers: Array> - ): T; - < - P = ParamsDictionary, - ResBody = any, - ReqBody = any, - ReqQuery = ParsedQs, - Locals extends Record = Record - >( - // tslint:disable-next-line no-unnecessary-generics (This generic is meant to be passed explicitly.) - ...handlers: Array> - ): T; - < - P = ParamsDictionary, - ResBody = any, - ReqBody = any, - ReqQuery = ParsedQs, - Locals extends Record = Record - >( - // tslint:disable-next-line no-unnecessary-generics (This generic is meant to be passed explicitly.) - ...handlers: Array> - ): T; -} - -export interface IRouter extends RequestHandler { - /** - * Map the given param placeholder `name`(s) to the given callback(s). - * - * Parameter mapping is used to provide pre-conditions to routes - * which use normalized placeholders. For example a _:user_id_ parameter - * could automatically load a user's information from the database without - * any additional code, - * - * The callback uses the samesignature as middleware, the only differencing - * being that the value of the placeholder is passed, in this case the _id_ - * of the user. Once the `next()` function is invoked, just like middleware - * it will continue on to execute the route, or subsequent parameter functions. - * - * app.param('user_id', function(req, res, next, id){ - * User.find(id, function(err, user){ - * if (err) { - * next(err); - * } else if (user) { - * req.user = user; - * next(); - * } else { - * next(new Error('failed to load user')); - * } - * }); - * }); - */ - param(name: string, handler: RequestParamHandler): this; - - /** - * Alternatively, you can pass only a callback, in which case you have the opportunity to alter the app.param() - * - * @deprecated since version 4.11 - */ - param(callback: (name: string, matcher: RegExp) => RequestParamHandler): this; - - /** - * Special-cased "all" method, applying the given route `path`, - * middleware, and callback to _every_ HTTP method. - */ - all: IRouterMatcher; - get: IRouterMatcher; - post: IRouterMatcher; - put: IRouterMatcher; - delete: IRouterMatcher; - patch: IRouterMatcher; - options: IRouterMatcher; - head: IRouterMatcher; - - checkout: IRouterMatcher; - connect: IRouterMatcher; - copy: IRouterMatcher; - lock: IRouterMatcher; - merge: IRouterMatcher; - mkactivity: IRouterMatcher; - mkcol: IRouterMatcher; - move: IRouterMatcher; - 'm-search': IRouterMatcher; - notify: IRouterMatcher; - propfind: IRouterMatcher; - proppatch: IRouterMatcher; - purge: IRouterMatcher; - report: IRouterMatcher; - search: IRouterMatcher; - subscribe: IRouterMatcher; - trace: IRouterMatcher; - unlock: IRouterMatcher; - unsubscribe: IRouterMatcher; - - use: IRouterHandler & IRouterMatcher; - - route(prefix: T): IRoute; - route(prefix: PathParams): IRoute; - /** - * Stack of configured routes - */ - stack: any[]; -} - -export interface IRoute { - path: string; - stack: any; - all: IRouterHandler; - get: IRouterHandler; - post: IRouterHandler; - put: IRouterHandler; - delete: IRouterHandler; - patch: IRouterHandler; - options: IRouterHandler; - head: IRouterHandler; - - checkout: IRouterHandler; - copy: IRouterHandler; - lock: IRouterHandler; - merge: IRouterHandler; - mkactivity: IRouterHandler; - mkcol: IRouterHandler; - move: IRouterHandler; - 'm-search': IRouterHandler; - notify: IRouterHandler; - purge: IRouterHandler; - report: IRouterHandler; - search: IRouterHandler; - subscribe: IRouterHandler; - trace: IRouterHandler; - unlock: IRouterHandler; - unsubscribe: IRouterHandler; -} - -export interface Router extends IRouter {} - -export interface CookieOptions { - maxAge?: number | undefined; - signed?: boolean | undefined; - expires?: Date | undefined; - httpOnly?: boolean | undefined; - path?: string | undefined; - domain?: string | undefined; - secure?: boolean | undefined; - encode?: ((val: string) => string) | undefined; - sameSite?: boolean | 'lax' | 'strict' | 'none' | undefined; -} - -export interface ByteRange { - start: number; - end: number; -} - -export interface RequestRanges extends RangeParserRanges {} - -export type Errback = (err: Error) => void; - -/** - * @param P For most requests, this should be `ParamsDictionary`, but if you're - * using this in a route handler for a route that uses a `RegExp` or a wildcard - * `string` path (e.g. `'/user/*'`), then `req.params` will be an array, in - * which case you should use `ParamsArray` instead. - * - * @see https://expressjs.com/en/api.html#req.params - * - * @example - * app.get('/user/:id', (req, res) => res.send(req.params.id)); // implicitly `ParamsDictionary` - * app.get(/user\/(.*)/, (req, res) => res.send(req.params[0])); - * app.get('/user/*', (req, res) => res.send(req.params[0])); - */ -export interface Request< - P = ParamsDictionary, - ResBody = any, - ReqBody = any, - ReqQuery = ParsedQs, - Locals extends Record = Record -> extends http.IncomingMessage, - Express.Request { - /** - * Return request header. - * - * The `Referrer` header field is special-cased, - * both `Referrer` and `Referer` are interchangeable. - * - * Examples: - * - * req.get('Content-Type'); - * // => "text/plain" - * - * req.get('content-type'); - * // => "text/plain" - * - * req.get('Something'); - * // => undefined - * - * Aliased as `req.header()`. - */ - get(name: 'set-cookie'): string[] | undefined; - get(name: string): string | undefined; - - header(name: 'set-cookie'): string[] | undefined; - header(name: string): string | undefined; - - /** - * Check if the given `type(s)` is acceptable, returning - * the best match when true, otherwise `undefined`, in which - * case you should respond with 406 "Not Acceptable". - * - * The `type` value may be a single mime type string - * such as "application/json", the extension name - * such as "json", a comma-delimted list such as "json, html, text/plain", - * or an array `["json", "html", "text/plain"]`. When a list - * or array is given the _best_ match, if any is returned. - * - * Examples: - * - * // Accept: text/html - * req.accepts('html'); - * // => "html" - * - * // Accept: text/*, application/json - * req.accepts('html'); - * // => "html" - * req.accepts('text/html'); - * // => "text/html" - * req.accepts('json, text'); - * // => "json" - * req.accepts('application/json'); - * // => "application/json" - * - * // Accept: text/*, application/json - * req.accepts('image/png'); - * req.accepts('png'); - * // => undefined - * - * // Accept: text/*;q=.5, application/json - * req.accepts(['html', 'json']); - * req.accepts('html, json'); - * // => "json" - */ - accepts(): string[]; - accepts(type: string): string | false; - accepts(type: string[]): string | false; - accepts(...type: string[]): string | false; - - /** - * Returns the first accepted charset of the specified character sets, - * based on the request's Accept-Charset HTTP header field. - * If none of the specified charsets is accepted, returns false. - * - * For more information, or if you have issues or concerns, see accepts. - */ - acceptsCharsets(): string[]; - acceptsCharsets(charset: string): string | false; - acceptsCharsets(charset: string[]): string | false; - acceptsCharsets(...charset: string[]): string | false; - - /** - * Returns the first accepted encoding of the specified encodings, - * based on the request's Accept-Encoding HTTP header field. - * If none of the specified encodings is accepted, returns false. - * - * For more information, or if you have issues or concerns, see accepts. - */ - acceptsEncodings(): string[]; - acceptsEncodings(encoding: string): string | false; - acceptsEncodings(encoding: string[]): string | false; - acceptsEncodings(...encoding: string[]): string | false; - - /** - * Returns the first accepted language of the specified languages, - * based on the request's Accept-Language HTTP header field. - * If none of the specified languages is accepted, returns false. - * - * For more information, or if you have issues or concerns, see accepts. - */ - acceptsLanguages(): string[]; - acceptsLanguages(lang: string): string | false; - acceptsLanguages(lang: string[]): string | false; - acceptsLanguages(...lang: string[]): string | false; - - /** - * Parse Range header field, capping to the given `size`. - * - * Unspecified ranges such as "0-" require knowledge of your resource length. In - * the case of a byte range this is of course the total number of bytes. - * If the Range header field is not given `undefined` is returned. - * If the Range header field is given, return value is a result of range-parser. - * See more ./types/range-parser/index.d.ts - * - * NOTE: remember that ranges are inclusive, so for example "Range: users=0-3" - * should respond with 4 users when available, not 3. - * - */ - range(size: number, options?: RangeParserOptions): RangeParserRanges | RangeParserResult | undefined; - - /** - * Return an array of Accepted media types - * ordered from highest quality to lowest. - */ - accepted: MediaType[]; - - /** - * @deprecated since 4.11 Use either req.params, req.body or req.query, as applicable. - * - * Return the value of param `name` when present or `defaultValue`. - * - * - Checks route placeholders, ex: _/user/:id_ - * - Checks body params, ex: id=12, {"id":12} - * - Checks query string params, ex: ?id=12 - * - * To utilize request bodies, `req.body` - * should be an object. This can be done by using - * the `connect.bodyParser()` middleware. - */ - param(name: string, defaultValue?: any): string; - - /** - * Check if the incoming request contains the "Content-Type" - * header field, and it contains the give mime `type`. - * - * Examples: - * - * // With Content-Type: text/html; charset=utf-8 - * req.is('html'); - * req.is('text/html'); - * req.is('text/*'); - * // => true - * - * // When Content-Type is application/json - * req.is('json'); - * req.is('application/json'); - * req.is('application/*'); - * // => true - * - * req.is('html'); - * // => false - */ - is(type: string | string[]): string | false | null; - - /** - * Return the protocol string "http" or "https" - * when requested with TLS. When the "trust proxy" - * setting is enabled the "X-Forwarded-Proto" header - * field will be trusted. If you're running behind - * a reverse proxy that supplies https for you this - * may be enabled. - */ - protocol: string; - - /** - * Short-hand for: - * - * req.protocol == 'https' - */ - secure: boolean; - - /** - * Return the remote address, or when - * "trust proxy" is `true` return - * the upstream addr. - */ - ip: string; - - /** - * When "trust proxy" is `true`, parse - * the "X-Forwarded-For" ip address list. - * - * For example if the value were "client, proxy1, proxy2" - * you would receive the array `["client", "proxy1", "proxy2"]` - * where "proxy2" is the furthest down-stream. - */ - ips: string[]; - - /** - * Return subdomains as an array. - * - * Subdomains are the dot-separated parts of the host before the main domain of - * the app. By default, the domain of the app is assumed to be the last two - * parts of the host. This can be changed by setting "subdomain offset". - * - * For example, if the domain is "tobi.ferrets.example.com": - * If "subdomain offset" is not set, req.subdomains is `["ferrets", "tobi"]`. - * If "subdomain offset" is 3, req.subdomains is `["tobi"]`. - */ - subdomains: string[]; - - /** - * Short-hand for `url.parse(req.url).pathname`. - */ - path: string; - - /** - * Parse the "Host" header field hostname. - */ - hostname: string; - - /** - * @deprecated Use hostname instead. - */ - host: string; - - /** - * Check if the request is fresh, aka - * Last-Modified and/or the ETag - * still match. - */ - fresh: boolean; - - /** - * Check if the request is stale, aka - * "Last-Modified" and / or the "ETag" for the - * resource has changed. - */ - stale: boolean; - - /** - * Check if the request was an _XMLHttpRequest_. - */ - xhr: boolean; - - //body: { username: string; password: string; remember: boolean; title: string; }; - body: ReqBody; - - //cookies: { string; remember: boolean; }; - cookies: any; - - method: string; - - params: P; - - query: ReqQuery; - - route: any; - - signedCookies: any; - - originalUrl: string; - - url: string; - - baseUrl: string; - - app: Application; - - /** - * After middleware.init executed, Request will contain res and next properties - * See: express/lib/middleware/init.js - */ - res?: Response | undefined; - next?: NextFunction | undefined; -} - -export interface MediaType { - value: string; - quality: number; - type: string; - subtype: string; -} - -export type Send> = (body?: ResBody) => T; - -export interface Response< - ResBody = any, - Locals extends Record = Record, - StatusCode extends number = number -> extends http.ServerResponse, - Express.Response { - /** - * Set status `code`. - */ - status(code: StatusCode): this; - - /** - * Set the response HTTP status code to `statusCode` and send its string representation as the response body. - * @link http://expressjs.com/4x/api.html#res.sendStatus - * - * Examples: - * - * res.sendStatus(200); // equivalent to res.status(200).send('OK') - * res.sendStatus(403); // equivalent to res.status(403).send('Forbidden') - * res.sendStatus(404); // equivalent to res.status(404).send('Not Found') - * res.sendStatus(500); // equivalent to res.status(500).send('Internal Server Error') - */ - sendStatus(code: StatusCode): this; - - /** - * Set Link header field with the given `links`. - * - * Examples: - * - * res.links({ - * next: 'http://api.example.com/users?page=2', - * last: 'http://api.example.com/users?page=5' - * }); - */ - links(links: any): this; - - /** - * Send a response. - * - * Examples: - * - * res.send(new Buffer('wahoo')); - * res.send({ some: 'json' }); - * res.send('

some html

'); - * res.status(404).send('Sorry, cant find that'); - */ - send: Send; - - /** - * Send JSON response. - * - * Examples: - * - * res.json(null); - * res.json({ user: 'tj' }); - * res.status(500).json('oh noes!'); - * res.status(404).json('I dont have that'); - */ - json: Send; - - /** - * Send JSON response with JSONP callback support. - * - * Examples: - * - * res.jsonp(null); - * res.jsonp({ user: 'tj' }); - * res.status(500).jsonp('oh noes!'); - * res.status(404).jsonp('I dont have that'); - */ - jsonp: Send; - - /** - * Transfer the file at the given `path`. - * - * Automatically sets the _Content-Type_ response header field. - * The callback `fn(err)` is invoked when the transfer is complete - * or when an error occurs. Be sure to check `res.headersSent` - * if you wish to attempt responding, as the header and some data - * may have already been transferred. - * - * Options: - * - * - `maxAge` defaulting to 0 (can be string converted by `ms`) - * - `root` root directory for relative filenames - * - `headers` object of headers to serve with file - * - `dotfiles` serve dotfiles, defaulting to false; can be `"allow"` to send them - * - * Other options are passed along to `send`. - * - * Examples: - * - * The following example illustrates how `res.sendFile()` may - * be used as an alternative for the `static()` middleware for - * dynamic situations. The code backing `res.sendFile()` is actually - * the same code, so HTTP cache support etc is identical. - * - * app.get('/user/:uid/photos/:file', function(req, res){ - * var uid = req.params.uid - * , file = req.params.file; - * - * req.user.mayViewFilesFrom(uid, function(yes){ - * if (yes) { - * res.sendFile('/uploads/' + uid + '/' + file); - * } else { - * res.send(403, 'Sorry! you cant see that.'); - * } - * }); - * }); - * - * @api public - */ - sendFile(path: string, fn?: Errback): void; - sendFile(path: string, options: any, fn?: Errback): void; - - /** - * @deprecated Use sendFile instead. - */ - sendfile(path: string): void; - /** - * @deprecated Use sendFile instead. - */ - sendfile(path: string, options: any): void; - /** - * @deprecated Use sendFile instead. - */ - sendfile(path: string, fn: Errback): void; - /** - * @deprecated Use sendFile instead. - */ - sendfile(path: string, options: any, fn: Errback): void; - - /** - * Transfer the file at the given `path` as an attachment. - * - * Optionally providing an alternate attachment `filename`, - * and optional callback `fn(err)`. The callback is invoked - * when the data transfer is complete, or when an error has - * ocurred. Be sure to check `res.headersSent` if you plan to respond. - * - * The optional options argument passes through to the underlying - * res.sendFile() call, and takes the exact same parameters. - * - * This method uses `res.sendfile()`. - */ - download(path: string, fn?: Errback): void; - download(path: string, filename: string, fn?: Errback): void; - download(path: string, filename: string, options: any, fn?: Errback): void; - - /** - * Set _Content-Type_ response header with `type` through `mime.lookup()` - * when it does not contain "/", or set the Content-Type to `type` otherwise. - * - * Examples: - * - * res.type('.html'); - * res.type('html'); - * res.type('json'); - * res.type('application/json'); - * res.type('png'); - */ - contentType(type: string): this; - - /** - * Set _Content-Type_ response header with `type` through `mime.lookup()` - * when it does not contain "/", or set the Content-Type to `type` otherwise. - * - * Examples: - * - * res.type('.html'); - * res.type('html'); - * res.type('json'); - * res.type('application/json'); - * res.type('png'); - */ - type(type: string): this; - - /** - * Respond to the Acceptable formats using an `obj` - * of mime-type callbacks. - * - * This method uses `req.accepted`, an array of - * acceptable types ordered by their quality values. - * When "Accept" is not present the _first_ callback - * is invoked, otherwise the first match is used. When - * no match is performed the server responds with - * 406 "Not Acceptable". - * - * Content-Type is set for you, however if you choose - * you may alter this within the callback using `res.type()` - * or `res.set('Content-Type', ...)`. - * - * res.format({ - * 'text/plain': function(){ - * res.send('hey'); - * }, - * - * 'text/html': function(){ - * res.send('

hey

'); - * }, - * - * 'appliation/json': function(){ - * res.send({ message: 'hey' }); - * } - * }); - * - * In addition to canonicalized MIME types you may - * also use extnames mapped to these types: - * - * res.format({ - * text: function(){ - * res.send('hey'); - * }, - * - * html: function(){ - * res.send('

hey

'); - * }, - * - * json: function(){ - * res.send({ message: 'hey' }); - * } - * }); - * - * By default Express passes an `Error` - * with a `.status` of 406 to `next(err)` - * if a match is not made. If you provide - * a `.default` callback it will be invoked - * instead. - */ - format(obj: any): this; - - /** - * Set _Content-Disposition_ header to _attachment_ with optional `filename`. - */ - attachment(filename?: string): this; - - /** - * Set header `field` to `val`, or pass - * an object of header fields. - * - * Examples: - * - * res.set('Foo', ['bar', 'baz']); - * res.set('Accept', 'application/json'); - * res.set({ Accept: 'text/plain', 'X-API-Key': 'tobi' }); - * - * Aliased as `res.header()`. - */ - set(field: any): this; - set(field: string, value?: string | string[]): this; - - header(field: any): this; - header(field: string, value?: string | string[]): this; - - // Property indicating if HTTP headers has been sent for the response. - headersSent: boolean; - - /** Get value for header `field`. */ - get(field: string): string|undefined; - - /** Clear cookie `name`. */ - clearCookie(name: string, options?: CookieOptions): this; - - /** - * Set cookie `name` to `val`, with the given `options`. - * - * Options: - * - * - `maxAge` max-age in milliseconds, converted to `expires` - * - `signed` sign the cookie - * - `path` defaults to "/" - * - * Examples: - * - * // "Remember Me" for 15 minutes - * res.cookie('rememberme', '1', { expires: new Date(Date.now() + 900000), httpOnly: true }); - * - * // save as above - * res.cookie('rememberme', '1', { maxAge: 900000, httpOnly: true }) - */ - cookie(name: string, val: string, options: CookieOptions): this; - cookie(name: string, val: any, options: CookieOptions): this; - cookie(name: string, val: any): this; - - /** - * Set the location header to `url`. - * - * The given `url` can also be the name of a mapped url, for - * example by default express supports "back" which redirects - * to the _Referrer_ or _Referer_ headers or "/". - * - * Examples: - * - * res.location('/foo/bar').; - * res.location('http://example.com'); - * res.location('../login'); // /blog/post/1 -> /blog/login - * - * Mounting: - * - * When an application is mounted and `res.location()` - * is given a path that does _not_ lead with "/" it becomes - * relative to the mount-point. For example if the application - * is mounted at "/blog", the following would become "/blog/login". - * - * res.location('login'); - * - * While the leading slash would result in a location of "/login": - * - * res.location('/login'); - */ - location(url: string): this; - - /** - * Redirect to the given `url` with optional response `status` - * defaulting to 302. - * - * The resulting `url` is determined by `res.location()`, so - * it will play nicely with mounted apps, relative paths, - * `"back"` etc. - * - * Examples: - * - * res.redirect('back'); - * res.redirect('/foo/bar'); - * res.redirect('http://example.com'); - * res.redirect(301, 'http://example.com'); - * res.redirect('http://example.com', 301); - * res.redirect('../login'); // /blog/post/1 -> /blog/login - */ - redirect(url: string): void; - redirect(status: number, url: string): void; - /** @deprecated use res.redirect(status, url) instead */ - redirect(url: string, status: number): void; - - /** - * Render `view` with the given `options` and optional callback `fn`. - * When a callback function is given a response will _not_ be made - * automatically, otherwise a response of _200_ and _text/html_ is given. - * - * Options: - * - * - `cache` boolean hinting to the engine it should cache - * - `filename` filename of the view being rendered - */ - render(view: string, options?: object, callback?: (err: Error, html: string) => void): void; - render(view: string, callback?: (err: Error, html: string) => void): void; - - locals: Locals; - - charset: string; - - /** - * Adds the field to the Vary response header, if it is not there already. - * Examples: - * - * res.vary('User-Agent').render('docs'); - * - */ - vary(field: string): this; - - app: Application; - - /** - * Appends the specified value to the HTTP response header field. - * If the header is not already set, it creates the header with the specified value. - * The value parameter can be a string or an array. - * - * Note: calling res.set() after res.append() will reset the previously-set header value. - * - * @since 4.11.0 - */ - append(field: string, value?: string[] | string): this; - - /** - * After middleware.init executed, Response will contain req property - * See: express/lib/middleware/init.js - */ - req: Request; -} - -export interface Handler extends RequestHandler {} - -export type RequestParamHandler = (req: Request, res: Response, next: NextFunction, value: any, name: string) => any; - -export type ApplicationRequestHandler = IRouterHandler & - IRouterMatcher & - ((...handlers: RequestHandlerParams[]) => T); - -export interface Application< - Locals extends Record = Record -> extends EventEmitter, IRouter, Express.Application { - /** - * Express instance itself is a request handler, which could be invoked without - * third argument. - */ - (req: Request | http.IncomingMessage, res: Response | http.ServerResponse): any; - - /** - * Initialize the server. - * - * - setup default configuration - * - setup default middleware - * - setup route reflection methods - */ - init(): void; - - /** - * Initialize application configuration. - */ - defaultConfiguration(): void; - - /** - * Register the given template engine callback `fn` - * as `ext`. - * - * By default will `require()` the engine based on the - * file extension. For example if you try to render - * a "foo.jade" file Express will invoke the following internally: - * - * app.engine('jade', require('jade').__express); - * - * For engines that do not provide `.__express` out of the box, - * or if you wish to "map" a different extension to the template engine - * you may use this method. For example mapping the EJS template engine to - * ".html" files: - * - * app.engine('html', require('ejs').renderFile); - * - * In this case EJS provides a `.renderFile()` method with - * the same signature that Express expects: `(path, options, callback)`, - * though note that it aliases this method as `ejs.__express` internally - * so if you're using ".ejs" extensions you dont need to do anything. - * - * Some template engines do not follow this convention, the - * [Consolidate.js](https://github.com/visionmedia/consolidate.js) - * library was created to map all of node's popular template - * engines to follow this convention, thus allowing them to - * work seamlessly within Express. - */ - engine( - ext: string, - fn: (path: string, options: object, callback: (e: any, rendered?: string) => void) => void, - ): this; - - /** - * Assign `setting` to `val`, or return `setting`'s value. - * - * app.set('foo', 'bar'); - * app.get('foo'); - * // => "bar" - * app.set('foo', ['bar', 'baz']); - * app.get('foo'); - * // => ["bar", "baz"] - * - * Mounted servers inherit their parent server's settings. - */ - set(setting: string, val: any): this; - get: ((name: string) => any) & IRouterMatcher; - - param(name: string | string[], handler: RequestParamHandler): this; - - /** - * Alternatively, you can pass only a callback, in which case you have the opportunity to alter the app.param() - * - * @deprecated since version 4.11 - */ - param(callback: (name: string, matcher: RegExp) => RequestParamHandler): this; - - /** - * Return the app's absolute pathname - * based on the parent(s) that have - * mounted it. - * - * For example if the application was - * mounted as "/admin", which itself - * was mounted as "/blog" then the - * return value would be "/blog/admin". - */ - path(): string; - - /** - * Check if `setting` is enabled (truthy). - * - * app.enabled('foo') - * // => false - * - * app.enable('foo') - * app.enabled('foo') - * // => true - */ - enabled(setting: string): boolean; - - /** - * Check if `setting` is disabled. - * - * app.disabled('foo') - * // => true - * - * app.enable('foo') - * app.disabled('foo') - * // => false - */ - disabled(setting: string): boolean; - - /** Enable `setting`. */ - enable(setting: string): this; - - /** Disable `setting`. */ - disable(setting: string): this; - - /** - * Render the given view `name` name with `options` - * and a callback accepting an error and the - * rendered template string. - * - * Example: - * - * app.render('email', { name: 'Tobi' }, function(err, html){ - * // ... - * }) - */ - render(name: string, options?: object, callback?: (err: Error, html: string) => void): void; - render(name: string, callback: (err: Error, html: string) => void): void; - - /** - * Listen for connections. - * - * A node `http.Server` is returned, with this - * application (which is a `Function`) as its - * callback. If you wish to create both an HTTP - * and HTTPS server you may do so with the "http" - * and "https" modules as shown here: - * - * var http = require('http') - * , https = require('https') - * , express = require('express') - * , app = express(); - * - * http.createServer(app).listen(80); - * https.createServer({ ... }, app).listen(443); - */ - listen(port: number, hostname: string, backlog: number, callback?: () => void): http.Server; - listen(port: number, hostname: string, callback?: () => void): http.Server; - listen(port: number, callback?: () => void): http.Server; - listen(callback?: () => void): http.Server; - listen(path: string, callback?: () => void): http.Server; - listen(handle: any, listeningListener?: () => void): http.Server; - - router: string; - - settings: any; - - resource: any; - - map: any; - - locals: Locals; - - /** - * The app.routes object houses all of the routes defined mapped by the - * associated HTTP verb. This object may be used for introspection - * capabilities, for example Express uses this internally not only for - * routing but to provide default OPTIONS behaviour unless app.options() - * is used. Your application or framework may also remove routes by - * simply by removing them from this object. - */ - routes: any; - - /** - * Used to get all registered routes in Express Application - */ - _router: any; - - use: ApplicationRequestHandler; - - /** - * The mount event is fired on a sub-app, when it is mounted on a parent app. - * The parent app is passed to the callback function. - * - * NOTE: - * Sub-apps will: - * - Not inherit the value of settings that have a default value. You must set the value in the sub-app. - * - Inherit the value of settings with no default value. - */ - on: (event: string, callback: (parent: Application) => void) => this; - - /** - * The app.mountpath property contains one or more path patterns on which a sub-app was mounted. - */ - mountpath: string | string[]; -} - -export interface Express extends Application { - request: Request; - response: Response; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/express-serve-static-core/package.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/express-serve-static-core/package.json deleted file mode 100755 index 8c5f7bf4..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/express-serve-static-core/package.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "name": "@types/express-serve-static-core", - "version": "4.17.31", - "description": "TypeScript definitions for Express", - "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/express-serve-static-core", - "license": "MIT", - "contributors": [ - { - "name": "Boris Yankov", - "url": "https://github.com/borisyankov", - "githubUsername": "borisyankov" - }, - { - "name": "Satana Charuwichitratana", - "url": "https://github.com/micksatana", - "githubUsername": "micksatana" - }, - { - "name": "Sami Jaber", - "url": "https://github.com/samijaber", - "githubUsername": "samijaber" - }, - { - "name": "Jose Luis Leon", - "url": "https://github.com/JoseLion", - "githubUsername": "JoseLion" - }, - { - "name": "David Stephens", - "url": "https://github.com/dwrss", - "githubUsername": "dwrss" - }, - { - "name": "Shin Ando", - "url": "https://github.com/andoshin11", - "githubUsername": "andoshin11" - } - ], - "main": "", - "types": "index.d.ts", - "repository": { - "type": "git", - "url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git", - "directory": "types/express-serve-static-core" - }, - "scripts": {}, - "dependencies": { - "@types/node": "*", - "@types/qs": "*", - "@types/range-parser": "*" - }, - "typesPublisherContentHash": "9f714068b422a8e3ba9eac20ddf48fbcaa24a940fcd22920c164887ab8fe2b64", - "typeScriptVersion": "4.1" -} \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/express/LICENSE b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/express/LICENSE deleted file mode 100755 index 9e841e7a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/express/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ - MIT License - - Copyright (c) Microsoft Corporation. - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in all - copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - SOFTWARE diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/express/README.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/express/README.md deleted file mode 100755 index ac958787..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/express/README.md +++ /dev/null @@ -1,16 +0,0 @@ -# Installation -> `npm install --save @types/express` - -# Summary -This package contains type definitions for Express (http://expressjs.com). - -# Details -Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/express. - -### Additional Details - * Last updated: Tue, 13 Sep 2022 18:26:26 GMT - * Dependencies: [@types/body-parser](https://npmjs.com/package/@types/body-parser), [@types/express-serve-static-core](https://npmjs.com/package/@types/express-serve-static-core), [@types/qs](https://npmjs.com/package/@types/qs), [@types/serve-static](https://npmjs.com/package/@types/serve-static) - * Global values: none - -# Credits -These definitions were written by [Boris Yankov](https://github.com/borisyankov), [China Medical University Hospital](https://github.com/CMUH), [Puneet Arora](https://github.com/puneetar), and [Dylan Frankland](https://github.com/dfrankland). diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/express/index.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/express/index.d.ts deleted file mode 100755 index 8427f02a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/express/index.d.ts +++ /dev/null @@ -1,133 +0,0 @@ -// Type definitions for Express 4.17 -// Project: http://expressjs.com -// Definitions by: Boris Yankov -// China Medical University Hospital -// Puneet Arora -// Dylan Frankland -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/* =================== USAGE =================== - - import express = require("express"); - var app = express(); - - =============================================== */ - -/// -/// - -import * as bodyParser from 'body-parser'; -import * as serveStatic from 'serve-static'; -import * as core from 'express-serve-static-core'; -import * as qs from 'qs'; - -/** - * Creates an Express application. The express() function is a top-level function exported by the express module. - */ -declare function e(): core.Express; - -declare namespace e { - /** - * This is a built-in middleware function in Express. It parses incoming requests with JSON payloads and is based on body-parser. - * @since 4.16.0 - */ - var json: typeof bodyParser.json; - - /** - * This is a built-in middleware function in Express. It parses incoming requests with Buffer payloads and is based on body-parser. - * @since 4.17.0 - */ - var raw: typeof bodyParser.raw; - - /** - * This is a built-in middleware function in Express. It parses incoming requests with text payloads and is based on body-parser. - * @since 4.17.0 - */ - var text: typeof bodyParser.text; - - /** - * These are the exposed prototypes. - */ - var application: Application; - var request: Request; - var response: Response; - - /** - * This is a built-in middleware function in Express. It serves static files and is based on serve-static. - */ - var static: serveStatic.RequestHandlerConstructor; - - /** - * This is a built-in middleware function in Express. It parses incoming requests with urlencoded payloads and is based on body-parser. - * @since 4.16.0 - */ - var urlencoded: typeof bodyParser.urlencoded; - - /** - * This is a built-in middleware function in Express. It parses incoming request query parameters. - */ - export function query(options: qs.IParseOptions | typeof qs.parse): Handler; - - export function Router(options?: RouterOptions): core.Router; - - interface RouterOptions { - /** - * Enable case sensitivity. - */ - caseSensitive?: boolean | undefined; - - /** - * Preserve the req.params values from the parent router. - * If the parent and the child have conflicting param names, the child’s value take precedence. - * - * @default false - * @since 4.5.0 - */ - mergeParams?: boolean | undefined; - - /** - * Enable strict routing. - */ - strict?: boolean | undefined; - } - - interface Application extends core.Application {} - interface CookieOptions extends core.CookieOptions {} - interface Errback extends core.Errback {} - interface ErrorRequestHandler< - P = core.ParamsDictionary, - ResBody = any, - ReqBody = any, - ReqQuery = core.Query, - Locals extends Record = Record - > extends core.ErrorRequestHandler {} - interface Express extends core.Express {} - interface Handler extends core.Handler {} - interface IRoute extends core.IRoute {} - interface IRouter extends core.IRouter {} - interface IRouterHandler extends core.IRouterHandler {} - interface IRouterMatcher extends core.IRouterMatcher {} - interface MediaType extends core.MediaType {} - interface NextFunction extends core.NextFunction {} - interface Request< - P = core.ParamsDictionary, - ResBody = any, - ReqBody = any, - ReqQuery = core.Query, - Locals extends Record = Record - > extends core.Request {} - interface RequestHandler< - P = core.ParamsDictionary, - ResBody = any, - ReqBody = any, - ReqQuery = core.Query, - Locals extends Record = Record - > extends core.RequestHandler {} - interface RequestParamHandler extends core.RequestParamHandler {} - export interface Response = Record> - extends core.Response {} - interface Router extends core.Router {} - interface Send extends core.Send {} -} - -export = e; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/express/package.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/express/package.json deleted file mode 100755 index 8a6c41ff..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/express/package.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "name": "@types/express", - "version": "4.17.14", - "description": "TypeScript definitions for Express", - "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/express", - "license": "MIT", - "contributors": [ - { - "name": "Boris Yankov", - "url": "https://github.com/borisyankov", - "githubUsername": "borisyankov" - }, - { - "name": "China Medical University Hospital", - "url": "https://github.com/CMUH", - "githubUsername": "CMUH" - }, - { - "name": "Puneet Arora", - "url": "https://github.com/puneetar", - "githubUsername": "puneetar" - }, - { - "name": "Dylan Frankland", - "url": "https://github.com/dfrankland", - "githubUsername": "dfrankland" - } - ], - "main": "", - "types": "index.d.ts", - "repository": { - "type": "git", - "url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git", - "directory": "types/express" - }, - "scripts": {}, - "dependencies": { - "@types/body-parser": "*", - "@types/express-serve-static-core": "^4.17.18", - "@types/qs": "*", - "@types/serve-static": "*" - }, - "typesPublisherContentHash": "c1bc3eb1de87678353401acb958785c75095c71fec66004c015b6aba2aeee230", - "typeScriptVersion": "4.1" -} \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/jsonwebtoken/LICENSE b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/jsonwebtoken/LICENSE deleted file mode 100755 index 9e841e7a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/jsonwebtoken/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ - MIT License - - Copyright (c) Microsoft Corporation. - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in all - copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - SOFTWARE diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/jsonwebtoken/README.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/jsonwebtoken/README.md deleted file mode 100755 index 0390dac9..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/jsonwebtoken/README.md +++ /dev/null @@ -1,16 +0,0 @@ -# Installation -> `npm install --save @types/jsonwebtoken` - -# Summary -This package contains type definitions for jsonwebtoken (https://github.com/auth0/node-jsonwebtoken). - -# Details -Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/jsonwebtoken. - -### Additional Details - * Last updated: Wed, 24 Aug 2022 10:02:25 GMT - * Dependencies: [@types/node](https://npmjs.com/package/@types/node) - * Global values: none - -# Credits -These definitions were written by [Maxime LUCE](https://github.com/SomaticIT), [Daniel Heim](https://github.com/danielheim), [Brice BERNARD](https://github.com/brikou), [Veli-Pekka Kestilä](https://github.com/vpk), [Daniel Parker](https://github.com/GeneralistDev), [Kjell Dießel](https://github.com/kettil), [Robert Gajda](https://github.com/RunAge), [Nico Flaig](https://github.com/nflaig), [Linus Unnebäck](https://github.com/LinusU), [Ivan Sieder](https://github.com/ivansieder), [Piotr Błażejewicz](https://github.com/peterblazejewicz), and [Nandor Kraszlan](https://github.com/nandi95). diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/jsonwebtoken/index.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/jsonwebtoken/index.d.ts deleted file mode 100755 index 52d6365d..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/jsonwebtoken/index.d.ts +++ /dev/null @@ -1,247 +0,0 @@ -// Type definitions for jsonwebtoken 8.5 -// Project: https://github.com/auth0/node-jsonwebtoken -// Definitions by: Maxime LUCE , -// Daniel Heim , -// Brice BERNARD , -// Veli-Pekka Kestilä , -// Daniel Parker , -// Kjell Dießel , -// Robert Gajda , -// Nico Flaig , -// Linus Unnebäck -// Ivan Sieder -// Piotr Błażejewicz -// Nandor Kraszlan -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/// - -export class JsonWebTokenError extends Error { - inner: Error; - - constructor(message: string, error?: Error); -} - -export class TokenExpiredError extends JsonWebTokenError { - expiredAt: Date; - - constructor(message: string, expiredAt: Date); -} - -/** - * Thrown if current time is before the nbf claim. - */ -export class NotBeforeError extends JsonWebTokenError { - date: Date; - - constructor(message: string, date: Date); -} - -export interface SignOptions { - /** - * Signature algorithm. Could be one of these values : - * - HS256: HMAC using SHA-256 hash algorithm (default) - * - HS384: HMAC using SHA-384 hash algorithm - * - HS512: HMAC using SHA-512 hash algorithm - * - RS256: RSASSA using SHA-256 hash algorithm - * - RS384: RSASSA using SHA-384 hash algorithm - * - RS512: RSASSA using SHA-512 hash algorithm - * - ES256: ECDSA using P-256 curve and SHA-256 hash algorithm - * - ES384: ECDSA using P-384 curve and SHA-384 hash algorithm - * - ES512: ECDSA using P-521 curve and SHA-512 hash algorithm - * - none: No digital signature or MAC value included - */ - algorithm?: Algorithm | undefined; - keyid?: string | undefined; - /** expressed in seconds or a string describing a time span [zeit/ms](https://github.com/zeit/ms.js). Eg: 60, "2 days", "10h", "7d" */ - expiresIn?: string | number | undefined; - /** expressed in seconds or a string describing a time span [zeit/ms](https://github.com/zeit/ms.js). Eg: 60, "2 days", "10h", "7d" */ - notBefore?: string | number | undefined; - audience?: string | string[] | undefined; - subject?: string | undefined; - issuer?: string | undefined; - jwtid?: string | undefined; - mutatePayload?: boolean | undefined; - noTimestamp?: boolean | undefined; - header?: JwtHeader | undefined; - encoding?: string | undefined; -} - -export interface VerifyOptions { - algorithms?: Algorithm[] | undefined; - audience?: string | RegExp | Array | undefined; - clockTimestamp?: number | undefined; - clockTolerance?: number | undefined; - /** return an object with the decoded `{ payload, header, signature }` instead of only the usual content of the payload. */ - complete?: boolean | undefined; - issuer?: string | string[] | undefined; - ignoreExpiration?: boolean | undefined; - ignoreNotBefore?: boolean | undefined; - jwtid?: string | undefined; - /** - * If you want to check `nonce` claim, provide a string value here. - * It is used on Open ID for the ID Tokens. ([Open ID implementation notes](https://openid.net/specs/openid-connect-core-1_0.html#NonceNotes)) - */ - nonce?: string | undefined; - subject?: string | undefined; - maxAge?: string | number | undefined; -} - -export interface DecodeOptions { - complete?: boolean | undefined; - json?: boolean | undefined; -} -export type VerifyErrors = - | JsonWebTokenError - | NotBeforeError - | TokenExpiredError; -export type VerifyCallback = ( - error: VerifyErrors | null, - decoded: T | undefined, -) => void; - -export type SignCallback = ( - error: Error | null, - encoded: string | undefined, -) => void; - -// standard names https://www.rfc-editor.org/rfc/rfc7515.html#section-4.1 -export interface JwtHeader { - alg: string | Algorithm; - typ?: string | undefined; - cty?: string | undefined; - crit?: Array> | undefined; - kid?: string | undefined; - jku?: string | undefined; - x5u?: string | string[] | undefined; - 'x5t#S256'?: string | undefined; - x5t?: string | undefined; - x5c?: string | string[] | undefined; -} - -// standard claims https://datatracker.ietf.org/doc/html/rfc7519#section-4.1 -export interface JwtPayload { - [key: string]: any; - iss?: string | undefined; - sub?: string | undefined; - aud?: string | string[] | undefined; - exp?: number | undefined; - nbf?: number | undefined; - iat?: number | undefined; - jti?: string | undefined; -} - -export interface Jwt { - header: JwtHeader; - payload: JwtPayload | string; - signature: string; -} - -// https://github.com/auth0/node-jsonwebtoken#algorithms-supported -export type Algorithm = - "HS256" | "HS384" | "HS512" | - "RS256" | "RS384" | "RS512" | - "ES256" | "ES384" | "ES512" | - "PS256" | "PS384" | "PS512" | - "none"; - -export type SigningKeyCallback = ( - error: Error | null, - signingKey?: Secret -) => void; - -export type GetPublicKeyOrSecret = ( - header: JwtHeader, - callback: SigningKeyCallback -) => void; - -export type Secret = - | string - | Buffer - | { key: string | Buffer; passphrase: string }; - -/** - * Synchronously sign the given payload into a JSON Web Token string - * payload - Payload to sign, could be an literal, buffer or string - * secretOrPrivateKey - Either the secret for HMAC algorithms, or the PEM encoded private key for RSA and ECDSA. - * [options] - Options for the signature - * returns - The JSON Web Token string - */ -export function sign( - payload: string | Buffer | object, - secretOrPrivateKey: Secret, - options?: SignOptions, -): string; - -/** - * Sign the given payload into a JSON Web Token string - * payload - Payload to sign, could be an literal, buffer or string - * secretOrPrivateKey - Either the secret for HMAC algorithms, or the PEM encoded private key for RSA and ECDSA. - * [options] - Options for the signature - * callback - Callback to get the encoded token on - */ -export function sign( - payload: string | Buffer | object, - secretOrPrivateKey: Secret, - callback: SignCallback, -): void; -export function sign( - payload: string | Buffer | object, - secretOrPrivateKey: Secret, - options: SignOptions, - callback: SignCallback, -): void; - -/** - * Synchronously verify given token using a secret or a public key to get a decoded token - * token - JWT string to verify - * secretOrPublicKey - Either the secret for HMAC algorithms, or the PEM encoded public key for RSA and ECDSA. - * [options] - Options for the verification - * returns - The decoded token. - */ -export function verify(token: string, secretOrPublicKey: Secret, options: VerifyOptions & { complete: true }): Jwt; -export function verify(token: string, secretOrPublicKey: Secret, options?: VerifyOptions & { complete?: false }): JwtPayload | string; -export function verify(token: string, secretOrPublicKey: Secret, options?: VerifyOptions): Jwt | JwtPayload | string; - -/** - * Asynchronously verify given token using a secret or a public key to get a decoded token - * token - JWT string to verify - * secretOrPublicKey - A string or buffer containing either the secret for HMAC algorithms, - * or the PEM encoded public key for RSA and ECDSA. If jwt.verify is called asynchronous, - * secretOrPublicKey can be a function that should fetch the secret or public key - * [options] - Options for the verification - * callback - Callback to get the decoded token on - */ -export function verify( - token: string, - secretOrPublicKey: Secret | GetPublicKeyOrSecret, - callback?: VerifyCallback, -): void; -export function verify( - token: string, - secretOrPublicKey: Secret | GetPublicKeyOrSecret, - options: VerifyOptions & { complete: true }, - callback?: VerifyCallback, -): void; -export function verify( - token: string, - secretOrPublicKey: Secret | GetPublicKeyOrSecret, - options?: VerifyOptions & { complete?: false }, - callback?: VerifyCallback, -): void; -export function verify( - token: string, - secretOrPublicKey: Secret | GetPublicKeyOrSecret, - options?: VerifyOptions, - callback?: VerifyCallback, -): void; - -/** - * Returns the decoded payload without verifying if the signature is valid. - * token - JWT string to decode - * [options] - Options for decoding - * returns - The decoded Token - */ -export function decode(token: string, options: DecodeOptions & { complete: true }): null | Jwt; -export function decode(token: string, options: DecodeOptions & { json: true }): null | JwtPayload; -export function decode(token: string, options?: DecodeOptions): null | JwtPayload | string; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/jsonwebtoken/package.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/jsonwebtoken/package.json deleted file mode 100755 index 76ba7a70..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/jsonwebtoken/package.json +++ /dev/null @@ -1,82 +0,0 @@ -{ - "name": "@types/jsonwebtoken", - "version": "8.5.9", - "description": "TypeScript definitions for jsonwebtoken", - "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/jsonwebtoken", - "license": "MIT", - "contributors": [ - { - "name": "Maxime LUCE", - "url": "https://github.com/SomaticIT", - "githubUsername": "SomaticIT" - }, - { - "name": "Daniel Heim", - "url": "https://github.com/danielheim", - "githubUsername": "danielheim" - }, - { - "name": "Brice BERNARD", - "url": "https://github.com/brikou", - "githubUsername": "brikou" - }, - { - "name": "Veli-Pekka Kestilä", - "url": "https://github.com/vpk", - "githubUsername": "vpk" - }, - { - "name": "Daniel Parker", - "url": "https://github.com/GeneralistDev", - "githubUsername": "GeneralistDev" - }, - { - "name": "Kjell Dießel", - "url": "https://github.com/kettil", - "githubUsername": "kettil" - }, - { - "name": "Robert Gajda", - "url": "https://github.com/RunAge", - "githubUsername": "RunAge" - }, - { - "name": "Nico Flaig", - "url": "https://github.com/nflaig", - "githubUsername": "nflaig" - }, - { - "name": "Linus Unnebäck", - "url": "https://github.com/LinusU", - "githubUsername": "LinusU" - }, - { - "name": "Ivan Sieder", - "url": "https://github.com/ivansieder", - "githubUsername": "ivansieder" - }, - { - "name": "Piotr Błażejewicz", - "url": "https://github.com/peterblazejewicz", - "githubUsername": "peterblazejewicz" - }, - { - "name": "Nandor Kraszlan", - "url": "https://github.com/nandi95", - "githubUsername": "nandi95" - } - ], - "main": "", - "types": "index.d.ts", - "repository": { - "type": "git", - "url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git", - "directory": "types/jsonwebtoken" - }, - "scripts": {}, - "dependencies": { - "@types/node": "*" - }, - "typesPublisherContentHash": "5d1f6ea66089a8298a1a19b2f519936a3a94aea2974dab382dd4e93177bdeb3d", - "typeScriptVersion": "4.0" -} \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/linkify-it/LICENSE b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/linkify-it/LICENSE deleted file mode 100755 index 9e841e7a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/linkify-it/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ - MIT License - - Copyright (c) Microsoft Corporation. - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in all - copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - SOFTWARE diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/linkify-it/README.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/linkify-it/README.md deleted file mode 100755 index 29ef78a0..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/linkify-it/README.md +++ /dev/null @@ -1,89 +0,0 @@ -# Installation -> `npm install --save @types/linkify-it` - -# Summary -This package contains type definitions for linkify-it (https://github.com/markdown-it/linkify-it). - -# Details -Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/linkify-it. -## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/linkify-it/index.d.ts) -````ts -// Type definitions for linkify-it 3.0.2 -// Project: https://github.com/markdown-it/linkify-it -// Definitions by: Lindsey Smith -// Robert Coie -// Alex Plumb -// Rafa Gares -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.2 - -declare const LinkifyIt: { - ( - schemas?: LinkifyIt.SchemaRules | LinkifyIt.Options, - options?: LinkifyIt.Options - ): LinkifyIt.LinkifyIt; - new ( - schemas?: LinkifyIt.SchemaRules | LinkifyIt.Options, - options?: LinkifyIt.Options - ): LinkifyIt.LinkifyIt; -}; - -declare namespace LinkifyIt { - type Validate = (text: string, pos: number, self: LinkifyIt) => number | boolean; - - interface FullRule { - validate: string | RegExp | Validate; - normalize?: ((match: Match) => void) | undefined; - } - - type Rule = string | FullRule; - - interface SchemaRules { - [schema: string]: Rule; - } - - interface Options { - fuzzyLink?: boolean | undefined; - fuzzyIP?: boolean | undefined; - fuzzyEmail?: boolean | undefined; - } - - interface Match { - index: number; - lastIndex: number; - raw: string; - schema: string; - text: string; - url: string; - } - - interface LinkifyIt { - // Use overloads to provide contextual typing to `FullRule.normalize`, which is ambiguous with string.normalize - // This appears unneeded to the unified-signatures lint rule. - add(schema: string, rule: string): LinkifyIt; - // tslint:disable-next-line: unified-signatures - add(schema: string, rule: FullRule | null): LinkifyIt; - match(text: string): Match[] | null; - normalize(raw: string): string; - pretest(text: string): boolean; - set(options: Options): LinkifyIt; - test(text: string): boolean; - testSchemaAt(text: string, schemaName: string, pos: number): number; - tlds(list: string | string[], keepOld?: boolean): LinkifyIt; - re: { - [key: string]: RegExp; - }; - } -} - -export = LinkifyIt; - -```` - -### Additional Details - * Last updated: Tue, 06 Jul 2021 22:02:41 GMT - * Dependencies: none - * Global values: none - -# Credits -These definitions were written by [Lindsey Smith](https://github.com/praxxis), [Robert Coie](https://github.com/rapropos/typed-linkify-it), [Alex Plumb](https://github.com/alexplumb), and [Rafa Gares](https://github.com/ragafus). diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/linkify-it/index.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/linkify-it/index.d.ts deleted file mode 100755 index f3e25d3f..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/linkify-it/index.d.ts +++ /dev/null @@ -1,69 +0,0 @@ -// Type definitions for linkify-it 3.0.2 -// Project: https://github.com/markdown-it/linkify-it -// Definitions by: Lindsey Smith -// Robert Coie -// Alex Plumb -// Rafa Gares -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.2 - -declare const LinkifyIt: { - ( - schemas?: LinkifyIt.SchemaRules | LinkifyIt.Options, - options?: LinkifyIt.Options - ): LinkifyIt.LinkifyIt; - new ( - schemas?: LinkifyIt.SchemaRules | LinkifyIt.Options, - options?: LinkifyIt.Options - ): LinkifyIt.LinkifyIt; -}; - -declare namespace LinkifyIt { - type Validate = (text: string, pos: number, self: LinkifyIt) => number | boolean; - - interface FullRule { - validate: string | RegExp | Validate; - normalize?: ((match: Match) => void) | undefined; - } - - type Rule = string | FullRule; - - interface SchemaRules { - [schema: string]: Rule; - } - - interface Options { - fuzzyLink?: boolean | undefined; - fuzzyIP?: boolean | undefined; - fuzzyEmail?: boolean | undefined; - } - - interface Match { - index: number; - lastIndex: number; - raw: string; - schema: string; - text: string; - url: string; - } - - interface LinkifyIt { - // Use overloads to provide contextual typing to `FullRule.normalize`, which is ambiguous with string.normalize - // This appears unneeded to the unified-signatures lint rule. - add(schema: string, rule: string): LinkifyIt; - // tslint:disable-next-line: unified-signatures - add(schema: string, rule: FullRule | null): LinkifyIt; - match(text: string): Match[] | null; - normalize(raw: string): string; - pretest(text: string): boolean; - set(options: Options): LinkifyIt; - test(text: string): boolean; - testSchemaAt(text: string, schemaName: string, pos: number): number; - tlds(list: string | string[], keepOld?: boolean): LinkifyIt; - re: { - [key: string]: RegExp; - }; - } -} - -export = LinkifyIt; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/linkify-it/package.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/linkify-it/package.json deleted file mode 100755 index 4867d042..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/linkify-it/package.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "name": "@types/linkify-it", - "version": "3.0.2", - "description": "TypeScript definitions for linkify-it", - "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/linkify-it", - "license": "MIT", - "contributors": [ - { - "name": "Lindsey Smith", - "url": "https://github.com/praxxis", - "githubUsername": "praxxis" - }, - { - "name": "Robert Coie", - "url": "https://github.com/rapropos/typed-linkify-it" - }, - { - "name": "Alex Plumb", - "url": "https://github.com/alexplumb", - "githubUsername": "alexplumb" - }, - { - "name": "Rafa Gares", - "url": "https://github.com/ragafus", - "githubUsername": "ragafus" - } - ], - "main": "", - "types": "index.d.ts", - "repository": { - "type": "git", - "url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git", - "directory": "types/linkify-it" - }, - "scripts": {}, - "dependencies": {}, - "typesPublisherContentHash": "001e13e25578e89bdd72aba9710cc97e62dacb4982344e91c4d666aa7cfd642d", - "typeScriptVersion": "3.6" -} \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/long/LICENSE b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/long/LICENSE deleted file mode 100755 index 9e841e7a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/long/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ - MIT License - - Copyright (c) Microsoft Corporation. - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in all - copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - SOFTWARE diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/long/README.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/long/README.md deleted file mode 100755 index 7e8ba38b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/long/README.md +++ /dev/null @@ -1,16 +0,0 @@ -# Installation -> `npm install --save @types/long` - -# Summary -This package contains type definitions for long.js (https://github.com/dcodeIO/long.js). - -# Details -Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/long. - -### Additional Details - * Last updated: Tue, 26 Apr 2022 19:31:52 GMT - * Dependencies: none - * Global values: `Long` - -# Credits -These definitions were written by [Peter Kooijmans](https://github.com/peterkooijmans). diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/long/index.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/long/index.d.ts deleted file mode 100755 index 3a95005d..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/long/index.d.ts +++ /dev/null @@ -1,389 +0,0 @@ -// Type definitions for long.js 4.0.0 -// Project: https://github.com/dcodeIO/long.js -// Definitions by: Peter Kooijmans -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Definitions by: Denis Cappellin - -export = Long; -export as namespace Long; - -declare const Long: Long.LongConstructor; -type Long = Long.Long; -declare namespace Long { - interface LongConstructor { - /** - * Constructs a 64 bit two's-complement integer, given its low and high 32 bit values as signed integers. See the from* functions below for more convenient ways of constructing Longs. - */ - new( low: number, high?: number, unsigned?: boolean ): Long; - prototype: Long; - /** - * Maximum unsigned value. - */ - MAX_UNSIGNED_VALUE: Long; - - /** - * Maximum signed value. - */ - MAX_VALUE: Long; - - /** - * Minimum signed value. - */ - MIN_VALUE: Long; - - /** - * Signed negative one. - */ - NEG_ONE: Long; - - /** - * Signed one. - */ - ONE: Long; - - /** - * Unsigned one. - */ - UONE: Long; - - /** - * Unsigned zero. - */ - UZERO: Long; - - /** - * Signed zero - */ - ZERO: Long; - - /** - * Returns a Long representing the 64 bit integer that comes by concatenating the given low and high bits. Each is assumed to use 32 bits. - */ - fromBits( lowBits:number, highBits:number, unsigned?:boolean ): Long; - - /** - * Returns a Long representing the given 32 bit integer value. - */ - fromInt( value: number, unsigned?: boolean ): Long; - - /** - * Returns a Long representing the given value, provided that it is a finite number. Otherwise, zero is returned. - */ - fromNumber( value: number, unsigned?: boolean ): Long; - - /** - * Returns a Long representation of the given string, written using the specified radix. - */ - fromString( str: string, unsigned?: boolean | number, radix?: number ): Long; - - /** - * Creates a Long from its byte representation. - */ - fromBytes( bytes: number[], unsigned?: boolean, le?: boolean ): Long; - - /** - * Creates a Long from its little endian byte representation. - */ - fromBytesLE( bytes: number[], unsigned?: boolean ): Long; - - /** - * Creates a Long from its little endian byte representation. - */ - fromBytesBE( bytes: number[], unsigned?: boolean ): Long; - - /** - * Tests if the specified object is a Long. - */ - isLong( obj: any ): obj is Long; - - /** - * Converts the specified value to a Long. - */ - fromValue( val: Long | number | string | {low: number, high: number, unsigned: boolean}, unsigned?: boolean ): Long; - } - interface Long - { - /** - * The high 32 bits as a signed value. - */ - high: number; - - /** - * The low 32 bits as a signed value. - */ - low: number; - - /** - * Whether unsigned or not. - */ - unsigned: boolean; - - /** - * Returns the sum of this and the specified Long. - */ - add( addend: number | Long | string ): Long; - - /** - * Returns the bitwise AND of this Long and the specified. - */ - and( other: Long | number | string ): Long; - - /** - * Compares this Long's value with the specified's. - */ - compare( other: Long | number | string ): number; - - /** - * Compares this Long's value with the specified's. - */ - comp( other: Long | number | string ): number; - - /** - * Returns this Long divided by the specified. - */ - divide( divisor: Long | number | string ): Long; - - /** - * Returns this Long divided by the specified. - */ - div( divisor: Long | number | string ): Long; - - /** - * Tests if this Long's value equals the specified's. - */ - equals( other: Long | number | string ): boolean; - - /** - * Tests if this Long's value equals the specified's. - */ - eq( other: Long | number | string ): boolean; - - /** - * Gets the high 32 bits as a signed integer. - */ - getHighBits(): number; - - /** - * Gets the high 32 bits as an unsigned integer. - */ - getHighBitsUnsigned(): number; - - /** - * Gets the low 32 bits as a signed integer. - */ - getLowBits(): number; - - /** - * Gets the low 32 bits as an unsigned integer. - */ - getLowBitsUnsigned(): number; - - /** - * Gets the number of bits needed to represent the absolute value of this Long. - */ - getNumBitsAbs(): number; - - /** - * Tests if this Long's value is greater than the specified's. - */ - greaterThan( other: Long | number | string ): boolean; - - /** - * Tests if this Long's value is greater than the specified's. - */ - gt( other: Long | number | string ): boolean; - - /** - * Tests if this Long's value is greater than or equal the specified's. - */ - greaterThanOrEqual( other: Long | number | string ): boolean; - - /** - * Tests if this Long's value is greater than or equal the specified's. - */ - gte( other: Long | number | string ): boolean; - - /** - * Tests if this Long's value is even. - */ - isEven(): boolean; - - /** - * Tests if this Long's value is negative. - */ - isNegative(): boolean; - - /** - * Tests if this Long's value is odd. - */ - isOdd(): boolean; - - /** - * Tests if this Long's value is positive. - */ - isPositive(): boolean; - - /** - * Tests if this Long's value equals zero. - */ - isZero(): boolean; - - /** - * Tests if this Long's value is less than the specified's. - */ - lessThan( other: Long | number | string ): boolean; - - /** - * Tests if this Long's value is less than the specified's. - */ - lt( other: Long | number | string ): boolean; - - /** - * Tests if this Long's value is less than or equal the specified's. - */ - lessThanOrEqual( other: Long | number | string ): boolean; - - /** - * Tests if this Long's value is less than or equal the specified's. - */ - lte( other: Long | number | string ): boolean; - - /** - * Returns this Long modulo the specified. - */ - modulo( other: Long | number | string ): Long; - - /** - * Returns this Long modulo the specified. - */ - mod( other: Long | number | string ): Long; - - /** - * Returns the product of this and the specified Long. - */ - multiply( multiplier: Long | number | string ): Long; - - /** - * Returns the product of this and the specified Long. - */ - mul( multiplier: Long | number | string ): Long; - - /** - * Negates this Long's value. - */ - negate(): Long; - - /** - * Negates this Long's value. - */ - neg(): Long; - - /** - * Returns the bitwise NOT of this Long. - */ - not(): Long; - - /** - * Tests if this Long's value differs from the specified's. - */ - notEquals( other: Long | number | string ): boolean; - - /** - * Tests if this Long's value differs from the specified's. - */ - neq( other: Long | number | string ): boolean; - - /** - * Returns the bitwise OR of this Long and the specified. - */ - or( other: Long | number | string ): Long; - - /** - * Returns this Long with bits shifted to the left by the given amount. - */ - shiftLeft( numBits: number | Long ): Long; - - /** - * Returns this Long with bits shifted to the left by the given amount. - */ - shl( numBits: number | Long ): Long; - - /** - * Returns this Long with bits arithmetically shifted to the right by the given amount. - */ - shiftRight( numBits: number | Long ): Long; - - /** - * Returns this Long with bits arithmetically shifted to the right by the given amount. - */ - shr( numBits: number | Long ): Long; - - /** - * Returns this Long with bits logically shifted to the right by the given amount. - */ - shiftRightUnsigned( numBits: number | Long ): Long; - - /** - * Returns this Long with bits logically shifted to the right by the given amount. - */ - shru( numBits: number | Long ): Long; - - /** - * Returns the difference of this and the specified Long. - */ - subtract( subtrahend: number | Long | string ): Long; - - /** - * Returns the difference of this and the specified Long. - */ - sub( subtrahend: number | Long |string ): Long; - - /** - * Converts the Long to a 32 bit integer, assuming it is a 32 bit integer. - */ - toInt(): number; - - /** - * Converts the Long to a the nearest floating-point representation of this value (double, 53 bit mantissa). - */ - toNumber(): number; - - /** - * Converts this Long to its byte representation. - */ - - toBytes( le?: boolean ): number[]; - - /** - * Converts this Long to its little endian byte representation. - */ - - toBytesLE(): number[]; - - /** - * Converts this Long to its big endian byte representation. - */ - - toBytesBE(): number[]; - - /** - * Converts this Long to signed. - */ - toSigned(): Long; - - /** - * Converts the Long to a string written in the specified radix. - */ - toString( radix?: number ): string; - - /** - * Converts this Long to unsigned. - */ - toUnsigned(): Long; - - /** - * Returns the bitwise XOR of this Long and the given one. - */ - xor( other: Long | number | string ): Long; - } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/long/package.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/long/package.json deleted file mode 100755 index 35b1e759..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/long/package.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "name": "@types/long", - "version": "4.0.2", - "description": "TypeScript definitions for long.js", - "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/long", - "license": "MIT", - "contributors": [ - { - "name": "Peter Kooijmans", - "url": "https://github.com/peterkooijmans", - "githubUsername": "peterkooijmans" - } - ], - "main": "", - "types": "index.d.ts", - "repository": { - "type": "git", - "url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git", - "directory": "types/long" - }, - "scripts": {}, - "dependencies": {}, - "typesPublisherContentHash": "ce51a9fcaeb3f15cee5396e1c4f4b5ca2986a066f9bbe885a51dcdc6dbb22fd5", - "typeScriptVersion": "3.9" -} \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/markdown-it/LICENSE b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/markdown-it/LICENSE deleted file mode 100755 index 9e841e7a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/markdown-it/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ - MIT License - - Copyright (c) Microsoft Corporation. - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in all - copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - SOFTWARE diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/markdown-it/README.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/markdown-it/README.md deleted file mode 100755 index b03f4714..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/markdown-it/README.md +++ /dev/null @@ -1,16 +0,0 @@ -# Installation -> `npm install --save @types/markdown-it` - -# Summary -This package contains type definitions for markdown-it (https://github.com/markdown-it/markdown-it). - -# Details -Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/markdown-it. - -### Additional Details - * Last updated: Thu, 07 Oct 2021 19:01:21 GMT - * Dependencies: [@types/linkify-it](https://npmjs.com/package/@types/linkify-it), [@types/mdurl](https://npmjs.com/package/@types/mdurl) - * Global values: `markdownit` - -# Credits -These definitions were written by [York Yao](https://github.com/plantain-00), [Robert Coie](https://github.com/rapropos), [duduluu](https://github.com/duduluu), and [Piotr Błażejewicz](https://github.com/peterblazejewicz). diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/markdown-it/index.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/markdown-it/index.d.ts deleted file mode 100755 index 1e4c6e24..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/markdown-it/index.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -// Type definitions for markdown-it 12.2 -// Project: https://github.com/markdown-it/markdown-it -// Definitions by: York Yao -// Robert Coie -// duduluu -// Piotr Błażejewicz -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -import MarkdownIt = require('./lib'); - -export as namespace markdownit; - -export = MarkdownIt; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/markdown-it/lib/common/entities.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/markdown-it/lib/common/entities.d.ts deleted file mode 100755 index dfa7380f..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/markdown-it/lib/common/entities.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -interface MapType { - [key: string]: string; -} - -declare const entities: MapType; - -export = entities; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/markdown-it/lib/common/html_blocks.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/markdown-it/lib/common/html_blocks.d.ts deleted file mode 100755 index 08e5290c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/markdown-it/lib/common/html_blocks.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -declare const htmlBlocks: string[]; - -export = htmlBlocks; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/markdown-it/lib/common/html_re.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/markdown-it/lib/common/html_re.d.ts deleted file mode 100755 index 6ff85e6b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/markdown-it/lib/common/html_re.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -interface HtmlRE { - HTML_TAG_RE: RegExp; - HTML_OPEN_CLOSE_TAG_RE: RegExp; -} - -declare const htmlRE: HtmlRE; - -export = htmlRE; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/markdown-it/lib/common/utils.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/markdown-it/lib/common/utils.d.ts deleted file mode 100755 index 9c2ff209..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/markdown-it/lib/common/utils.d.ts +++ /dev/null @@ -1,70 +0,0 @@ -import * as mdurl from 'mdurl'; -// import ucmicro from 'uc.micro'; - -interface Utils { - lib: { - mdurl: typeof mdurl; - }; - - /** - * Merge objects - */ - assign(target: any, ...sources: any[]): any; - - /** - * Check if the type is string or not - */ - isString(obj: any): obj is string; - - /** - * has own property - */ - has(obj: any, key: keyof any): boolean; - - unescapeMd(str: string): string; - unescapeAll(str: string): string; - - isValidEntityCode(code: number): boolean; - fromCodePoint(code: number): string; - escapeHtml(str: string): string; - - /** - * Remove element from array and put another array at those position. - * Useful for some operations with tokens. - * Return a new array. - */ - arrayReplaceAt(src: T[], pos: number, newElements: T[]): T[]; - - isSpace(code: number): boolean; - - /** - * Zs (unicode class) || [\t\f\v\r\n] - */ - isWhiteSpace(code: number): boolean; - - /** - * Markdown ASCII punctuation characters. - * - * !, ", #, $, %, &, ', (, ), *, +, ,, -, ., /, :, ;, <, =, >, ?, @, [, \, ], ^, _, `, {, |, }, or ~ - * http://spec.commonmark.org/0.15/#ascii-punctuation-character - * - * Don't confuse with unicode punctuation !!! It lacks some chars in ascii range. - */ - isMdAsciiPunct(code: number): boolean; - - /** - * Currently without astral characters support. - */ - isPunctChar(ch: string): boolean; - - escapeRE(str: string): string; - - /** - * Hepler to unify [reference labels]. - */ - normalizeReference(str: string): string; -} - -declare const utils: Utils; - -export = utils; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/markdown-it/lib/helpers/index.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/markdown-it/lib/helpers/index.d.ts deleted file mode 100755 index a32643c5..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/markdown-it/lib/helpers/index.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import parseLinkLabel = require('./parse_link_label'); -import parseLinkDestination = require('./parse_link_destination'); -import parseLinkTitle = require('./parse_link_title'); - -interface Helpers { - parseLinkLabel: typeof parseLinkLabel; - parseLinkDestination: typeof parseLinkDestination; - parseLinkTitle: typeof parseLinkTitle; -} - -declare const helpers: Helpers; - -export = helpers; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/markdown-it/lib/helpers/parse_link_destination.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/markdown-it/lib/helpers/parse_link_destination.d.ts deleted file mode 100755 index b0f78aab..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/markdown-it/lib/helpers/parse_link_destination.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -declare namespace parseLinkDestination { - interface ParseResult { - ok: boolean; - pos: number; - lines: number; - str: string; - } -} - -declare function parseLinkDestination(str: string, pos: number, max: number): parseLinkDestination.ParseResult; - -export = parseLinkDestination; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/markdown-it/lib/helpers/parse_link_label.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/markdown-it/lib/helpers/parse_link_label.d.ts deleted file mode 100755 index 4fa71ff1..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/markdown-it/lib/helpers/parse_link_label.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import StateInline = require('../rules_inline/state_inline'); - -declare function parseLinkLabel(state: StateInline, start: number, disableNested?: boolean): number; - -export = parseLinkLabel; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/markdown-it/lib/helpers/parse_link_title.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/markdown-it/lib/helpers/parse_link_title.d.ts deleted file mode 100755 index f327d838..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/markdown-it/lib/helpers/parse_link_title.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import Destination = require('./parse_link_destination'); - -declare function parseLinkTitle(str: string, pos: number, max: number): Destination.ParseResult; - -export = parseLinkTitle; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/markdown-it/lib/index.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/markdown-it/lib/index.d.ts deleted file mode 100755 index edfdd97a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/markdown-it/lib/index.d.ts +++ /dev/null @@ -1,406 +0,0 @@ -import LinkifyIt = require('linkify-it'); - -import utils = require('./common/utils'); -import helpers = require('./helpers'); -import ParserBlock = require('./parser_block'); -import ParserCore = require('./parser_core'); -import ParserInline = require('./parser_inline'); -import Renderer = require('./renderer'); -import Token = require('./token'); - -declare namespace MarkdownIt { - /** - * MarkdownIt provides named presets as a convenience to quickly - * enable/disable active syntax rules and options for common use cases. - * - * - ["commonmark"](https://github.com/markdown-it/markdown-it/blob/master/lib/presets/commonmark.js) - - * configures parser to strict [CommonMark](http://commonmark.org/) mode. - * - [default](https://github.com/markdown-it/markdown-it/blob/master/lib/presets/default.js) - - * similar to GFM, used when no preset name given. Enables all available rules, - * but still without html, typographer & autolinker. - * - ["zero"](https://github.com/markdown-it/markdown-it/blob/master/lib/presets/zero.js) - - * all rules disabled. Useful to quickly setup your config via `.enable()`. - * For example, when you need only `bold` and `italic` markup and nothing else. - */ - type PresetName = 'default' | 'zero' | 'commonmark'; - - interface Options { - /** - * Set `true` to enable HTML tags in source. Be careful! - * That's not safe! You may need external sanitizer to protect output from XSS. - * It's better to extend features via plugins, instead of enabling HTML. - * @default false - */ - html?: boolean | undefined; - - /** - * Set `true` to add '/' when closing single tags - * (`
`). This is needed only for full CommonMark compatibility. In real - * world you will need HTML output. - * @default false - */ - xhtmlOut?: boolean | undefined; - - /** - * Set `true` to convert `\n` in paragraphs into `
`. - * @default false - */ - breaks?: boolean | undefined; - - /** - * CSS language class prefix for fenced blocks. - * Can be useful for external highlighters. - * @default 'language-' - */ - langPrefix?: string | undefined; - - /** - * Set `true` to autoconvert URL-like text to links. - * @default false - */ - linkify?: boolean | undefined; - - /** - * Set `true` to enable [some language-neutral replacement](https://github.com/markdown-it/markdown-it/blob/master/lib/rules_core/replacements.js) + - * quotes beautification (smartquotes). - * @default false - */ - typographer?: boolean | undefined; - - /** - * Double + single quotes replacement - * pairs, when typographer enabled and smartquotes on. For example, you can - * use `'«»„“'` for Russian, `'„“‚‘'` for German, and - * `['«\xA0', '\xA0»', '‹\xA0', '\xA0›']` for French (including nbsp). - * @default '“”‘’' - */ - quotes?: string | string[]; - - /** - * Highlighter function for fenced code blocks. - * Highlighter `function (str, lang, attrs)` should return escaped HTML. It can - * also return empty string if the source was not changed and should be escaped - * externally. If result starts with string) | null | undefined; - } - - type PluginSimple = (md: MarkdownIt) => void; - type PluginWithOptions = (md: MarkdownIt, options?: T) => void; - type PluginWithParams = (md: MarkdownIt, ...params: any[]) => void; -} - -interface MarkdownItConstructor { - new (): MarkdownIt; - new (presetName: MarkdownIt.PresetName, options?: MarkdownIt.Options): MarkdownIt; - new (options: MarkdownIt.Options): MarkdownIt; - (): MarkdownIt; - (presetName: MarkdownIt.PresetName, options?: MarkdownIt.Options): MarkdownIt; - (options: MarkdownIt.Options): MarkdownIt; -} - -interface MarkdownIt { - /** - * Instance of [[ParserInline]]. You may need it to add new rules when - * writing plugins. For simple rules control use [[MarkdownIt.disable]] and - * [[MarkdownIt.enable]]. - */ - readonly inline: ParserInline; - - /** - * Instance of [[ParserBlock]]. You may need it to add new rules when - * writing plugins. For simple rules control use [[MarkdownIt.disable]] and - * [[MarkdownIt.enable]]. - */ - readonly block: ParserBlock; - - /** - * Instance of [[Core]] chain executor. You may need it to add new rules when - * writing plugins. For simple rules control use [[MarkdownIt.disable]] and - * [[MarkdownIt.enable]]. - */ - readonly core: ParserCore; - - /** - * Instance of [[Renderer]]. Use it to modify output look. Or to add rendering - * rules for new token types, generated by plugins. - * - * ##### Example - * - * ```javascript - * var md = require('markdown-it')(); - * - * function myToken(tokens, idx, options, env, self) { - * //... - * return result; - * }; - * - * md.renderer.rules['my_token'] = myToken - * ``` - * - * See [[Renderer]] docs and [source code](https://github.com/markdown-it/markdown-it/blob/master/lib/renderer.js). - */ - readonly renderer: Renderer; - - /** - * [linkify-it](https://github.com/markdown-it/linkify-it) instance. - * Used by [linkify](https://github.com/markdown-it/markdown-it/blob/master/lib/rules_core/linkify.js) - * rule. - */ - readonly linkify: LinkifyIt.LinkifyIt; - - /** - * Link validation function. CommonMark allows too much in links. By default - * we disable `javascript:`, `vbscript:`, `file:` schemas, and almost all `data:...` schemas - * except some embedded image types. - * - * You can change this behaviour: - * - * ```javascript - * var md = require('markdown-it')(); - * // enable everything - * md.validateLink = function () { return true; } - * ``` - */ - validateLink(url: string): boolean; - - /** - * Function used to encode link url to a machine-readable format, - * which includes url-encoding, punycode, etc. - */ - normalizeLink(url: string): string; - - /** - * Function used to decode link url to a human-readable format` - */ - normalizeLinkText(url: string): string; - - readonly utils: typeof utils; - - readonly helpers: typeof helpers; - - readonly options: MarkdownIt.Options; - - /** - * *chainable* - * - * Set parser options (in the same format as in constructor). Probably, you - * will never need it, but you can change options after constructor call. - * - * ##### Example - * - * ```javascript - * var md = require('markdown-it')() - * .set({ html: true, breaks: true }) - * .set({ typographer: true }); - * ``` - * - * __Note:__ To achieve the best possible performance, don't modify a - * `markdown-it` instance options on the fly. If you need multiple configurations - * it's best to create multiple instances and initialize each with separate - * config. - */ - set(options: MarkdownIt.Options): this; - - /** - * *chainable*, *internal* - * - * Batch load of all options and compenent settings. This is internal method, - * and you probably will not need it. But if you with - see available presets - * and data structure [here](https://github.com/markdown-it/markdown-it/tree/master/lib/presets) - * - * We strongly recommend to use presets instead of direct config loads. That - * will give better compatibility with next versions. - */ - configure(presets: MarkdownIt.PresetName): this; - - /** - * *chainable* - * - * Enable list or rules. It will automatically find appropriate components, - * containing rules with given names. If rule not found, and `ignoreInvalid` - * not set - throws exception. - * - * ##### Example - * - * ```javascript - * var md = require('markdown-it')() - * .enable(['sub', 'sup']) - * .disable('smartquotes'); - * ``` - * - * @param list rule name or list of rule names to enable - * @param ignoreInvalid set `true` to ignore errors when rule not found. - */ - enable(list: string | string[], ignoreInvalid?: boolean): this; - - /** - * *chainable* - * - * The same as [[MarkdownIt.enable]], but turn specified rules off. - * - * @param list rule name or list of rule names to disable. - * @param ignoreInvalid set `true` to ignore errors when rule not found. - */ - disable(list: string | string[], ignoreInvalid?: boolean): this; - - /** - * *chainable* - * - * Load specified plugin with given params into current parser instance. - * It's just a sugar to call `plugin(md, params)` with curring. - * - * ##### Example - * - * ```javascript - * var iterator = require('markdown-it-for-inline'); - * var md = require('markdown-it')() - * .use(iterator, 'foo_replace', 'text', function (tokens, idx) { - * tokens[idx].content = tokens[idx].content.replace(/foo/g, 'bar'); - * }); - * ``` - */ - use(plugin: MarkdownIt.PluginSimple): this; - use(plugin: MarkdownIt.PluginWithOptions, options?: T): this; - use(plugin: MarkdownIt.PluginWithParams, ...params: any[]): this; - - /** - * *internal* - * - * Parse input string and returns list of block tokens (special token type - * "inline" will contain list of inline tokens). You should not call this - * method directly, until you write custom renderer (for example, to produce - * AST). - * - * `env` is used to pass data between "distributed" rules and return additional - * metadata like reference info, needed for the renderer. It also can be used to - * inject data in specific cases. Usually, you will be ok to pass `{}`, - * and then pass updated object to renderer. - * - * @param src source string - * @param env environment sandbox - */ - parse(src: string, env: any): Token[]; - - /** - * Render markdown string into html. It does all magic for you :). - * - * `env` can be used to inject additional metadata (`{}` by default). - * But you will not need it with high probability. See also comment - * in [[MarkdownIt.parse]]. - * - * @param src source string - * @param env environment sandbox - */ - render(src: string, env?: any): string; - - /** - * *internal* - * - * The same as [[MarkdownIt.parse]] but skip all block rules. It returns the - * block tokens list with the single `inline` element, containing parsed inline - * tokens in `children` property. Also updates `env` object. - * - * @param src source string - * @param env environment sandbox - */ - parseInline(src: string, env: any): Token[]; - - /** - * Similar to [[MarkdownIt.render]] but for single paragraph content. Result - * will NOT be wrapped into `

` tags. - * - * @param src source string - * @param env environment sandbox - */ - renderInline(src: string, env?: any): string; -} - -/** - * Main parser/renderer class. - * - * ##### Usage - * - * ```javascript - * // node.js, "classic" way: - * var MarkdownIt = require('markdown-it'), - * md = new MarkdownIt(); - * var result = md.render('# markdown-it rulezz!'); - * - * // node.js, the same, but with sugar: - * var md = require('markdown-it')(); - * var result = md.render('# markdown-it rulezz!'); - * - * // browser without AMD, added to "window" on script load - * // Note, there are no dash. - * var md = window.markdownit(); - * var result = md.render('# markdown-it rulezz!'); - * ``` - * - * Single line rendering, without paragraph wrap: - * - * ```javascript - * var md = require('markdown-it')(); - * var result = md.renderInline('__markdown-it__ rulezz!'); - * ``` - * - * ##### Example - * - * ```javascript - * // commonmark mode - * var md = require('markdown-it')('commonmark'); - * - * // default mode - * var md = require('markdown-it')(); - * - * // enable everything - * var md = require('markdown-it')({ - * html: true, - * linkify: true, - * typographer: true - * }); - * ``` - * - * ##### Syntax highlighting - * - * ```js - * var hljs = require('highlight.js') // https://highlightjs.org/ - * - * var md = require('markdown-it')({ - * highlight: function (str, lang) { - * if (lang && hljs.getLanguage(lang)) { - * try { - * return hljs.highlight(lang, str, true).value; - * } catch (__) {} - * } - * - * return ''; // use external default escaping - * } - * }); - * ``` - * - * Or with full wrapper override (if you need assign class to `

`):
- *
- * ```javascript
- * var hljs = require('highlight.js') // https://highlightjs.org/
- *
- * // Actual default values
- * var md = require('markdown-it')({
- *   highlight: function (str, lang) {
- *     if (lang && hljs.getLanguage(lang)) {
- *       try {
- *         return '
' +
- *                hljs.highlight(lang, str, true).value +
- *                '
'; - * } catch (__) {} - * } - * - * return '
' + md.utils.escapeHtml(str) + '
'; - * } - * }); - * ``` - */ -declare const MarkdownIt: MarkdownItConstructor; - -export = MarkdownIt; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/markdown-it/lib/parser_block.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/markdown-it/lib/parser_block.d.ts deleted file mode 100755 index ce8dbf41..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/markdown-it/lib/parser_block.d.ts +++ /dev/null @@ -1,29 +0,0 @@ -import MarkdownIt = require('.'); -import Ruler = require('./ruler'); -import StateBlock = require('./rules_block/state_block'); -import Token = require('./token'); - -declare namespace ParserBlock { - type RuleBlock = (state: StateBlock, startLine: number, endLine: number, silent: boolean) => boolean; -} - -declare class ParserBlock { - /** - * [[Ruler]] instance. Keep configuration of block rules. - */ - ruler: Ruler; - - /** - * Generate tokens for input range - */ - tokenize(state: StateBlock, startLine: number, endLine: number): void; - - /** - * Process input string and push block tokens into `outTokens` - */ - parse(str: string, md: MarkdownIt, env: any, outTokens: Token[]): void; - - State: typeof StateBlock; -} - -export = ParserBlock; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/markdown-it/lib/parser_core.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/markdown-it/lib/parser_core.d.ts deleted file mode 100755 index 08a0ddb9..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/markdown-it/lib/parser_core.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -import Ruler = require('./ruler'); -import StateCore = require('./rules_core/state_core'); - -declare namespace Core { - type RuleCore = (state: StateCore) => void; -} - -declare class Core { - ruler: Ruler; - - /** - * Executes core chain rules. - */ - process(state: StateCore): void; - - State: typeof StateCore; -} - -export = Core; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/markdown-it/lib/parser_inline.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/markdown-it/lib/parser_inline.d.ts deleted file mode 100755 index 7ccf7dc6..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/markdown-it/lib/parser_inline.d.ts +++ /dev/null @@ -1,42 +0,0 @@ -import MarkdownIt = require('.'); -import Ruler = require('./ruler'); -import Token = require('./token'); -import StateInline = require('./rules_inline/state_inline'); - -declare namespace ParserInline { - type RuleInline = (state: StateInline, silent: boolean) => boolean; - type RuleInline2 = (state: StateInline) => boolean; -} - -declare class ParserInline { - /** - * [[Ruler]] instance. Keep configuration of inline rules. - */ - ruler: Ruler; - - /** - * [[Ruler]] instance. Second ruler used for post-processing - * (e.g. in emphasis-like rules). - */ - ruler2: Ruler; - - /** - * Skip single token by running all rules in validation mode; - * returns `true` if any rule reported success - */ - skipToken(state: StateInline): void; - - /** - * Generate tokens for input range - */ - tokenize(state: StateInline): void; - - /** - * Process input string and push inline tokens into `outTokens` - */ - parse(str: string, md: MarkdownIt, env: any, outTokens: Token[]): void; - - State: typeof StateInline; -} - -export = ParserInline; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/markdown-it/lib/renderer.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/markdown-it/lib/renderer.d.ts deleted file mode 100755 index e5ca2568..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/markdown-it/lib/renderer.d.ts +++ /dev/null @@ -1,96 +0,0 @@ -import MarkdownIt = require('.'); -import Token = require('./token'); - -declare namespace Renderer { - type RenderRule = (tokens: Token[], idx: number, options: MarkdownIt.Options, env: any, self: Renderer) => string; - - interface RenderRuleRecord { - [type: string]: RenderRule | undefined; - code_inline?: RenderRule | undefined; - code_block?: RenderRule | undefined; - fence?: RenderRule | undefined; - image?: RenderRule | undefined; - hardbreak?: RenderRule | undefined; - softbreak?: RenderRule | undefined; - text?: RenderRule | undefined; - html_block?: RenderRule | undefined; - html_inline?: RenderRule | undefined; - } -} - -declare class Renderer { - /** - * Contains render rules for tokens. Can be updated and extended. - * - * ##### Example - * - * ```javascript - * var md = require('markdown-it')(); - * - * md.renderer.rules.strong_open = function () { return ''; }; - * md.renderer.rules.strong_close = function () { return ''; }; - * - * var result = md.renderInline(...); - * ``` - * - * Each rule is called as independent static function with fixed signature: - * - * ```javascript - * function my_token_render(tokens, idx, options, env, renderer) { - * // ... - * return renderedHTML; - * } - * ``` - * - * See [source code](https://github.com/markdown-it/markdown-it/blob/master/lib/renderer.js) - * for more details and examples. - */ - rules: Renderer.RenderRuleRecord; - - /** - * Render token attributes to string. - */ - renderAttrs(token: Token): string; - - /** - * Default token renderer. Can be overriden by custom function - * in [[Renderer#rules]]. - * - * @param tokens list of tokens - * @param idx token index to render - * @param options params of parser instance - */ - renderToken(tokens: Token[], idx: number, options: MarkdownIt.Options): string; - - /** - * The same as [[Renderer.render]], but for single token of `inline` type. - * - * @param tokens list on block tokens to renter - * @param options params of parser instance - * @param env additional data from parsed input (references, for example) - */ - renderInline(tokens: Token[], options: MarkdownIt.Options, env: any): string; - - /** - * Special kludge for image `alt` attributes to conform CommonMark spec. - * Don't try to use it! Spec requires to show `alt` content with stripped markup, - * instead of simple escaping. - * - * @param tokens list on block tokens to renter - * @param options params of parser instance - * @param env additional data from parsed input (references, for example) - */ - renderInlineAsText(tokens: Token[], options: MarkdownIt.Options, env: any): string; - - /** - * Takes token stream and generates HTML. Probably, you will never need to call - * this method directly. - * - * @param tokens list on block tokens to renter - * @param options params of parser instance - * @param env additional data from parsed input (references, for example) - */ - render(tokens: Token[], options: MarkdownIt.Options, env: any): string; -} - -export = Renderer; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/markdown-it/lib/ruler.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/markdown-it/lib/ruler.d.ts deleted file mode 100755 index 4d3405ad..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/markdown-it/lib/ruler.d.ts +++ /dev/null @@ -1,167 +0,0 @@ -declare namespace Ruler { - interface RuleOptions { - /** - * array with names of "alternate" chains. - */ - alt: string[]; - } -} - -/** - * class Ruler - * - * Helper class, used by [[MarkdownIt#core]], [[MarkdownIt#block]] and - * [[MarkdownIt#inline]] to manage sequences of functions (rules): - * - * - keep rules in defined order - * - assign the name to each rule - * - enable/disable rules - * - add/replace rules - * - allow assign rules to additional named chains (in the same) - * - cacheing lists of active rules - * - * You will not need use this class directly until write plugins. For simple - * rules control use [[MarkdownIt.disable]], [[MarkdownIt.enable]] and - * [[MarkdownIt.use]]. - */ -declare class Ruler { - /** - * Replace rule by name with new function & options. Throws error if name not - * found. - * - * ##### Example - * - * Replace existing typographer replacement rule with new one: - * - * ```javascript - * var md = require('markdown-it')(); - * - * md.core.ruler.at('replacements', function replace(state) { - * //... - * }); - * ``` - * - * @param name rule name to replace. - * @param fn new rule function. - * @param options new rule options (not mandatory). - */ - at(name: string, fn: T, options?: Ruler.RuleOptions): void; - - /** - * Add new rule to chain before one with given name. See also - * [[Ruler.after]], [[Ruler.push]]. - * - * ##### Example - * - * ```javascript - * var md = require('markdown-it')(); - * - * md.block.ruler.before('paragraph', 'my_rule', function replace(state) { - * //... - * }); - * ``` - * - * @param beforeName new rule will be added before this one. - * @param ruleName name of added rule. - * @param fn rule function. - * @param options rule options (not mandatory). - */ - before(beforeName: string, ruleName: string, fn: T, options?: Ruler.RuleOptions): void; - - /** - * Add new rule to chain after one with given name. See also - * [[Ruler.before]], [[Ruler.push]]. - * - * ##### Options: - * - * - __alt__ - array with names of "alternate" chains. - * - * ##### Example - * - * ```javascript - * var md = require('markdown-it')(); - * - * md.inline.ruler.after('text', 'my_rule', function replace(state) { - * //... - * }); - * ``` - * - * @param afterName new rule will be added after this one. - * @param ruleName name of added rule. - * @param fn rule function. - * @param options rule options (not mandatory). - */ - after(afterName: string, ruleName: string, fn: T, options?: Ruler.RuleOptions): void; - - /** - * Push new rule to the end of chain. See also - * [[Ruler.before]], [[Ruler.after]]. - * - * ##### Options: - * - * - __alt__ - array with names of "alternate" chains. - * - * ##### Example - * - * ```javascript - * var md = require('markdown-it')(); - * - * md.core.ruler.push('my_rule', function replace(state) { - * //... - * }); - * ``` - * - * @param ruleName name of added rule. - * @param fn rule function. - * @param options rule options (not mandatory). - */ - push(ruleName: string, fn: T, options?: Ruler.RuleOptions): void; - - /** - * Enable rules with given names. If any rule name not found - throw Error. - * Errors can be disabled by second param. - * - * Returns list of found rule names (if no exception happened). - * - * See also [[Ruler.disable]], [[Ruler.enableOnly]]. - * - * @param list list of rule names to enable. - * @param ignoreInvalid set `true` to ignore errors when rule not found. - */ - enable(list: string | string[], ignoreInvalid?: boolean): string[]; - - /** - * Enable rules with given names, and disable everything else. If any rule name - * not found - throw Error. Errors can be disabled by second param. - * - * See also [[Ruler.disable]], [[Ruler.enable]]. - * - * @param list list of rule names to enable (whitelist). - * @param ignoreInvalid set `true` to ignore errors when rule not found. - */ - enableOnly(list: string | string[], ignoreInvalid?: boolean): string[]; - - /** - * Disable rules with given names. If any rule name not found - throw Error. - * Errors can be disabled by second param. - * - * Returns list of found rule names (if no exception happened). - * - * See also [[Ruler.enable]], [[Ruler.enableOnly]]. - * - * @param list list of rule names to disable. - * @param ignoreInvalid set `true` to ignore errors when rule not found. - */ - disable(list: string | string[], ignoreInvalid?: boolean): string[]; - - /** - * Return array of active functions (rules) for given chain name. It analyzes - * rules configuration, compiles caches if not exists and returns result. - * - * Default chain name is `''` (empty string). It can't be skipped. That's - * done intentionally, to keep signature monomorphic for high speed. - */ - getRules(chainName: string): T[]; -} - -export = Ruler; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/markdown-it/lib/rules_block/state_block.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/markdown-it/lib/rules_block/state_block.d.ts deleted file mode 100755 index 907054ac..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/markdown-it/lib/rules_block/state_block.d.ts +++ /dev/null @@ -1,134 +0,0 @@ -import MarkdownIt = require('..'); -import Token = require('../token'); - -declare namespace StateBlock { - type ParentType = 'blockquote' | 'list' | 'root' | 'paragraph' | 'reference'; -} - -declare class StateBlock { - constructor(src: string, md: MarkdownIt, env: any, tokens: Token[]); - - src: string; - - /** - * link to parser instance - */ - md: MarkdownIt; - - env: any; - - // - // Internal state vartiables - // - - tokens: Token[]; - - /** - * line begin offsets for fast jumps - */ - bMarks: number[]; - /** - * line end offsets for fast jumps - */ - eMarks: number[]; - /** - * offsets of the first non-space characters (tabs not expanded) - */ - tShift: number[]; - /** - * indents for each line (tabs expanded) - */ - sCount: number[]; - - /** - * An amount of virtual spaces (tabs expanded) between beginning - * of each line (bMarks) and real beginning of that line. - * - * It exists only as a hack because blockquotes override bMarks - * losing information in the process. - * - * It's used only when expanding tabs, you can think about it as - * an initial tab length, e.g. bsCount=21 applied to string `\t123` - * means first tab should be expanded to 4-21%4 === 3 spaces. - */ - bsCount: number[]; - - // block parser variables - - /** - * required block content indent (for example, if we are - * inside a list, it would be positioned after list marker) - */ - blkIndent: number; - /** - * line index in src - */ - line: number; - /** - * lines count - */ - lineMax: number; - /** - * loose/tight mode for lists - */ - tight: boolean; - /** - * indent of the current dd block (-1 if there isn't any) - */ - ddIndent: number; - /** - * indent of the current list block (-1 if there isn't any) - */ - listIndent: number; - - /** - * can be 'blockquote', 'list', 'root', 'paragraph' or 'reference' - * used in lists to determine if they interrupt a paragraph - */ - parentType: StateBlock.ParentType; - - level: number; - - /** - * renderer - */ - result: string; - - /** - * Push new token to "stream". - */ - push(type: string, tag: string, nesting: Token.Nesting): Token; - - isEmpty(line: number): boolean; - - skipEmptyLines(from: number): number; - - /** - * Skip spaces from given position. - */ - skipSpaces(pos: number): number; - - /** - * Skip spaces from given position in reverse. - */ - skipSpacesBack(pos: number, min: number): number; - - /** - * Skip char codes from given position - */ - skipChars(pos: number, code: number): number; - - /** - * Skip char codes reverse from given position - 1 - */ - skipCharsBack(pos: number, code: number, min: number): number; - - /** - * cut lines range from source. - */ - getLines(begin: number, end: number, indent: number, keepLastLF: boolean): string; - - Token: typeof Token; -} - -export = StateBlock; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/markdown-it/lib/rules_core/state_core.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/markdown-it/lib/rules_core/state_core.d.ts deleted file mode 100755 index 3d6dcb63..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/markdown-it/lib/rules_core/state_core.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -import MarkdownIt = require('..'); -import Token = require('../token'); - -declare class StateCore { - constructor(src: string, md: MarkdownIt, env: any); - - src: string; - env: any; - tokens: Token[]; - inlineMode: boolean; - - /** - * link to parser instance - */ - md: MarkdownIt; - - Token: typeof Token; -} - -export = StateCore; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/markdown-it/lib/rules_inline/state_inline.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/markdown-it/lib/rules_inline/state_inline.d.ts deleted file mode 100755 index be5a70d8..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/markdown-it/lib/rules_inline/state_inline.d.ts +++ /dev/null @@ -1,78 +0,0 @@ -import MarkdownIt = require('..'); -import Token = require('../token'); - -declare namespace StateInline { - interface Scanned { - can_open: boolean; - can_close: boolean; - length: number; - } - - interface Delimiter { - marker: number; - length: number; - jump: number; - token: number; - end: number; - open: boolean; - close: boolean; - } - - interface TokenMata { - delimiters: Delimiter[]; - } -} - -declare class StateInline { - constructor(src: string, md: MarkdownIt, env: any, outTokens: Token[]); - - src: string; - env: any; - md: MarkdownIt; - tokens: Token[]; - tokens_meta: Array; - - pos: number; - posMax: number; - level: number; - pending: string; - pendingLevel: number; - - /** - * Stores { start: end } pairs. Useful for backtrack - * optimization of pairs parse (emphasis, strikes). - */ - cache: any; - - /** - * List of emphasis-like delimiters for current tag - */ - delimiters: StateInline.Delimiter[]; - - // Stack of delimiter lists for upper level tags - // _prev_delimiters: StateInline.Delimiter[][]; - - /** - * Flush pending text - */ - pushPending(): Token; - - /** - * Push new token to "stream". - * If pending text exists - flush it as text token - */ - push(type: string, tag: string, nesting: Token.Nesting): Token; - - /** - * Scan a sequence of emphasis-like markers, and determine whether - * it can start an emphasis sequence or end an emphasis sequence. - * - * @param start position to scan from (it should point at a valid marker); - * @param canSplitWord determine if these markers can be found inside a word - */ - scanDelims(start: number, canSplitWord: boolean): StateInline.Scanned; - - Token: typeof Token; -} - -export = StateInline; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/markdown-it/lib/token.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/markdown-it/lib/token.d.ts deleted file mode 100755 index 5f1e1627..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/markdown-it/lib/token.d.ts +++ /dev/null @@ -1,111 +0,0 @@ -declare namespace Token { - type Nesting = 1 | 0 | -1; -} - -/** - * Create new token and fill passed properties. - */ -declare class Token { - constructor(type: string, tag: string, nesting: Token.Nesting); - - /** - * Type of the token, e.g. "paragraph_open" - */ - type: string; - - /** - * HTML tag name, e.g. "p" - */ - tag: string; - - /** - * HTML attributes. Format: `[[name1, value1], [name2, value2]]` - */ - attrs: [string, string][] | null; - - /** - * Source map info. Format: `[line_begin, line_end]` - */ - map: [number, number] | null; - - /** - * Level change (number in {-1, 0, 1} set), where: - * - * - `1` means the tag is opening - * - `0` means the tag is self-closing - * - `-1` means the tag is closing - */ - nesting: 1 | 0 | -1; - - /** - * nesting level, the same as `state.level` - */ - level: number; - - /** - * An array of child nodes (inline and img tokens) - */ - children: Token[] | null; - - /** - * In a case of self-closing tag (code, html, fence, etc.), - * it has contents of this tag. - */ - content: string; - - /** - * '*' or '_' for emphasis, fence string for fence, etc. - */ - markup: string; - - /** - * Fence info string - */ - info: string; - - /** - * A place for plugins to store an arbitrary data - */ - meta: any; - - /** - * True for block-level tokens, false for inline tokens. - * Used in renderer to calculate line breaks - */ - block: boolean; - - /** - * If it's true, ignore this element when rendering. Used for tight lists - * to hide paragraphs. - */ - hidden: boolean; - - /** - * Search attribute index by name. - */ - attrIndex(name: string): number; - - /** - * Add `[name, value]` attribute to list. Init attrs if necessary - */ - attrPush(attrData: [string, string]): void; - - /** - * Set `name` attribute to `value`. Override old value if exists. - */ - attrSet(name: string, value: string): void; - - /** - * Get the value of attribute `name`, or null if it does not exist. - */ - attrGet(name: string): string | null; - - /** - * - * Join value to existing attribute via space. Or create new attribute if not - * exists. Useful to operate with token classes. - */ - attrJoin(name: string, value: string): void; -} - -export = Token; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/markdown-it/package.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/markdown-it/package.json deleted file mode 100755 index eacc1607..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/markdown-it/package.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "name": "@types/markdown-it", - "version": "12.2.3", - "description": "TypeScript definitions for markdown-it", - "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/markdown-it", - "license": "MIT", - "contributors": [ - { - "name": "York Yao", - "url": "https://github.com/plantain-00", - "githubUsername": "plantain-00" - }, - { - "name": "Robert Coie", - "url": "https://github.com/rapropos", - "githubUsername": "rapropos" - }, - { - "name": "duduluu", - "url": "https://github.com/duduluu", - "githubUsername": "duduluu" - }, - { - "name": "Piotr Błażejewicz", - "url": "https://github.com/peterblazejewicz", - "githubUsername": "peterblazejewicz" - } - ], - "main": "", - "types": "index.d.ts", - "repository": { - "type": "git", - "url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git", - "directory": "types/markdown-it" - }, - "scripts": {}, - "dependencies": { - "@types/linkify-it": "*", - "@types/mdurl": "*" - }, - "typesPublisherContentHash": "36f0d70c931d35e9b42ff42d3fcfdf021860abdb23b8a6310e8db0afd2395a15", - "typeScriptVersion": "3.7" -} \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/mdurl/LICENSE b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/mdurl/LICENSE deleted file mode 100644 index 4b1ad51b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/mdurl/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ - MIT License - - Copyright (c) Microsoft Corporation. All rights reserved. - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in all - copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - SOFTWARE diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/mdurl/README.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/mdurl/README.md deleted file mode 100644 index caf3bb82..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/mdurl/README.md +++ /dev/null @@ -1,16 +0,0 @@ -# Installation -> `npm install --save @types/mdurl` - -# Summary -This package contains type definitions for mdurl (https://github.com/markdown-it/mdurl#readme). - -# Details -Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/mdurl - -Additional Details - * Last updated: Wed, 17 Oct 2018 20:11:23 GMT - * Dependencies: none - * Global values: none - -# Credits -These definitions were written by Junyoung Choi . diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/mdurl/decode.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/mdurl/decode.d.ts deleted file mode 100644 index f45d0854..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/mdurl/decode.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -declare namespace decode { - const defaultChars: string; - const componentChars: string; -} -declare function decode(input: string, exclude?: string): string; - -export = decode; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/mdurl/encode.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/mdurl/encode.d.ts deleted file mode 100644 index 7848d3c8..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/mdurl/encode.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -declare namespace encode { - const defaultChars: string; - const componentChars: string; -} -declare function encode(str: string, exclude?: string, keepEscaped?: boolean): string; - -export = encode; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/mdurl/format.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/mdurl/format.d.ts deleted file mode 100644 index a7cc04cd..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/mdurl/format.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { Url } from './'; - -declare function format(url: Url): string; - -export = format; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/mdurl/index.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/mdurl/index.d.ts deleted file mode 100644 index 103ca229..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/mdurl/index.d.ts +++ /dev/null @@ -1,26 +0,0 @@ -// Type definitions for mdurl 1.0 -// Project: https://github.com/markdown-it/mdurl#readme -// Definitions by: Junyoung Choi -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -import encode = require('./encode'); -import decode = require('./decode'); -import parse = require('./parse'); -import format = require('./format'); - -export interface Url { - protocol: string; - slashes: string; - auth: string; - port: string; - hostname: string; - hash: string; - search: string; - pathname: string; -} - -export { - encode, - decode, - parse, - format -}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/mdurl/package.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/mdurl/package.json deleted file mode 100644 index 1335d9e7..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/mdurl/package.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "name": "@types/mdurl", - "version": "1.0.2", - "description": "TypeScript definitions for mdurl", - "license": "MIT", - "contributors": [ - { - "name": "Junyoung Choi", - "url": "https://github.com/rokt33r", - "githubUsername": "rokt33r" - } - ], - "main": "", - "types": "", - "repository": { - "type": "git", - "url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git" - }, - "scripts": {}, - "dependencies": {}, - "typesPublisherContentHash": "55901ccf45e8744ad241fd6beb7750d1c1f77d7fe727ac575e234c1431eb5bca", - "typeScriptVersion": "2.0" -} \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/mdurl/parse.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/mdurl/parse.d.ts deleted file mode 100644 index 30c377f3..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/mdurl/parse.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { Url } from './'; - -declare function parse(input: string, slashesDenoteHost?: boolean): Url; - -export = parse; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/mime/LICENSE b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/mime/LICENSE deleted file mode 100755 index 9e841e7a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/mime/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ - MIT License - - Copyright (c) Microsoft Corporation. - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in all - copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - SOFTWARE diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/mime/Mime.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/mime/Mime.d.ts deleted file mode 100755 index 2639c09d..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/mime/Mime.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import type { TypeMap } from './index'; - -declare class Mime { - constructor(typeMap: TypeMap, ...mimes: TypeMap[]); - - getType(path: string): string | null; - getExtension(mime: string): string | null; - define(typeMap: TypeMap, force?: boolean): void; -} - -export = Mime; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/mime/README.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/mime/README.md deleted file mode 100755 index f228b661..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/mime/README.md +++ /dev/null @@ -1,16 +0,0 @@ -# Installation -> `npm install --save @types/mime` - -# Summary -This package contains type definitions for mime (https://github.com/broofa/node-mime). - -# Details -Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/mime. - -### Additional Details - * Last updated: Thu, 04 Aug 2022 21:02:19 GMT - * Dependencies: none - * Global values: `mime`, `mimelite` - -# Credits -These definitions were written by [Jeff Goddard](https://github.com/jedigo), and [Daniel Hritzkiv](https://github.com/dhritzkiv). diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/mime/index.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/mime/index.d.ts deleted file mode 100755 index ce0df4a6..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/mime/index.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -// Type definitions for mime 3.0 -// Project: https://github.com/broofa/node-mime -// Definitions by: Jeff Goddard -// Daniel Hritzkiv -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -// Originally imported from: https://github.com/soywiz/typescript-node-definitions/mime.d.ts - -import Mime = require('./Mime'); - -export as namespace mime; - -declare namespace mime { - interface TypeMap { - [key: string]: string[]; - } -} - -declare const mime: Mime; - -export = mime; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/mime/lite.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/mime/lite.d.ts deleted file mode 100755 index a5684fa4..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/mime/lite.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import Mime = require('./Mime'); - -declare const mimelite: Mime; - -export as namespace mimelite; - -export = mimelite; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/mime/package.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/mime/package.json deleted file mode 100755 index 59e3306a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/mime/package.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "name": "@types/mime", - "version": "3.0.1", - "description": "TypeScript definitions for mime", - "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/mime", - "license": "MIT", - "contributors": [ - { - "name": "Jeff Goddard", - "url": "https://github.com/jedigo", - "githubUsername": "jedigo" - }, - { - "name": "Daniel Hritzkiv", - "url": "https://github.com/dhritzkiv", - "githubUsername": "dhritzkiv" - } - ], - "main": "", - "types": "index.d.ts", - "repository": { - "type": "git", - "url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git", - "directory": "types/mime" - }, - "scripts": {}, - "dependencies": {}, - "typesPublisherContentHash": "594e1e4777af908b69119d71c37be0a70e63c840095dcdb0881343b51b7286f3", - "typeScriptVersion": "4.0" -} \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/LICENSE b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/LICENSE deleted file mode 100755 index 9e841e7a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ - MIT License - - Copyright (c) Microsoft Corporation. - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in all - copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - SOFTWARE diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/README.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/README.md deleted file mode 100755 index c92bc387..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/README.md +++ /dev/null @@ -1,16 +0,0 @@ -# Installation -> `npm install --save @types/node` - -# Summary -This package contains type definitions for Node.js (https://nodejs.org/). - -# Details -Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node. - -### Additional Details - * Last updated: Tue, 01 Nov 2022 09:32:58 GMT - * Dependencies: none - * Global values: `AbortController`, `AbortSignal`, `__dirname`, `__filename`, `console`, `exports`, `gc`, `global`, `module`, `process`, `require`, `structuredClone` - -# Credits -These definitions were written by [Microsoft TypeScript](https://github.com/Microsoft), [DefinitelyTyped](https://github.com/DefinitelyTyped), [Alberto Schiabel](https://github.com/jkomyno), [Alvis HT Tang](https://github.com/alvis), [Andrew Makarov](https://github.com/r3nya), [Benjamin Toueg](https://github.com/btoueg), [Chigozirim C.](https://github.com/smac89), [David Junger](https://github.com/touffy), [Deividas Bakanas](https://github.com/DeividasBakanas), [Eugene Y. Q. Shen](https://github.com/eyqs), [Hannes Magnusson](https://github.com/Hannes-Magnusson-CK), [Huw](https://github.com/hoo29), [Kelvin Jin](https://github.com/kjin), [Klaus Meinhardt](https://github.com/ajafff), [Lishude](https://github.com/islishude), [Mariusz Wiktorczyk](https://github.com/mwiktorczyk), [Mohsen Azimi](https://github.com/mohsen1), [Nicolas Even](https://github.com/n-e), [Nikita Galkin](https://github.com/galkin), [Parambir Singh](https://github.com/parambirs), [Sebastian Silbermann](https://github.com/eps1lon), [Simon Schick](https://github.com/SimonSchick), [Thomas den Hollander](https://github.com/ThomasdenH), [Wilco Bakker](https://github.com/WilcoBakker), [wwwy3y3](https://github.com/wwwy3y3), [Samuel Ainsworth](https://github.com/samuela), [Kyle Uehlein](https://github.com/kuehlein), [Thanik Bhongbhibhat](https://github.com/bhongy), [Marcin Kopacz](https://github.com/chyzwar), [Trivikram Kamat](https://github.com/trivikr), [Junxiao Shi](https://github.com/yoursunny), [Ilia Baryshnikov](https://github.com/qwelias), [ExE Boss](https://github.com/ExE-Boss), [Piotr Błażejewicz](https://github.com/peterblazejewicz), [Anna Henningsen](https://github.com/addaleax), [Victor Perin](https://github.com/victorperin), [Yongsheng Zhang](https://github.com/ZYSzys), [NodeJS Contributors](https://github.com/NodeJS), [Linus Unnebäck](https://github.com/LinusU), [wafuwafu13](https://github.com/wafuwafu13), and [Matteo Collina](https://github.com/mcollina). diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/assert.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/assert.d.ts deleted file mode 100755 index e8595e63..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/assert.d.ts +++ /dev/null @@ -1,961 +0,0 @@ -/** - * The `assert` module provides a set of assertion functions for verifying - * invariants. - * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/assert.js) - */ -declare module 'assert' { - /** - * An alias of {@link ok}. - * @since v0.5.9 - * @param value The input that is checked for being truthy. - */ - function assert(value: unknown, message?: string | Error): asserts value; - namespace assert { - /** - * Indicates the failure of an assertion. All errors thrown by the `assert` module - * will be instances of the `AssertionError` class. - */ - class AssertionError extends Error { - actual: unknown; - expected: unknown; - operator: string; - generatedMessage: boolean; - code: 'ERR_ASSERTION'; - constructor(options?: { - /** If provided, the error message is set to this value. */ - message?: string | undefined; - /** The `actual` property on the error instance. */ - actual?: unknown | undefined; - /** The `expected` property on the error instance. */ - expected?: unknown | undefined; - /** The `operator` property on the error instance. */ - operator?: string | undefined; - /** If provided, the generated stack trace omits frames before this function. */ - // tslint:disable-next-line:ban-types - stackStartFn?: Function | undefined; - }); - } - /** - * This feature is currently experimental and behavior might still change. - * @since v14.2.0, v12.19.0 - * @experimental - */ - class CallTracker { - /** - * The wrapper function is expected to be called exactly `exact` times. If the - * function has not been called exactly `exact` times when `tracker.verify()` is called, then `tracker.verify()` will throw an - * error. - * - * ```js - * import assert from 'assert'; - * - * // Creates call tracker. - * const tracker = new assert.CallTracker(); - * - * function func() {} - * - * // Returns a function that wraps func() that must be called exact times - * // before tracker.verify(). - * const callsfunc = tracker.calls(func); - * ``` - * @since v14.2.0, v12.19.0 - * @param [fn='A no-op function'] - * @param [exact=1] - * @return that wraps `fn`. - */ - calls(exact?: number): () => void; - calls any>(fn?: Func, exact?: number): Func; - /** - * Example: - * - * ```js - * import assert from 'node:assert'; - * - * const tracker = new assert.CallTracker(); - * - * function func() {} - * const callsfunc = tracker.calls(func); - * callsfunc(1, 2, 3); - * - * assert.deepStrictEqual(tracker.getCalls(callsfunc), - * [{ thisArg: this, arguments: [1, 2, 3 ] }]); - * ``` - * - * @since v18.8.0, v16.18.0 - * @params fn - * @returns An Array with the calls to a tracked function. - */ - getCalls(fn: Function): CallTrackerCall[]; - /** - * The arrays contains information about the expected and actual number of calls of - * the functions that have not been called the expected number of times. - * - * ```js - * import assert from 'assert'; - * - * // Creates call tracker. - * const tracker = new assert.CallTracker(); - * - * function func() {} - * - * function foo() {} - * - * // Returns a function that wraps func() that must be called exact times - * // before tracker.verify(). - * const callsfunc = tracker.calls(func, 2); - * - * // Returns an array containing information on callsfunc() - * tracker.report(); - * // [ - * // { - * // message: 'Expected the func function to be executed 2 time(s) but was - * // executed 0 time(s).', - * // actual: 0, - * // expected: 2, - * // operator: 'func', - * // stack: stack trace - * // } - * // ] - * ``` - * @since v14.2.0, v12.19.0 - * @return of objects containing information about the wrapper functions returned by `calls`. - */ - report(): CallTrackerReportInformation[]; - /** - * Reset calls of the call tracker. - * If a tracked function is passed as an argument, the calls will be reset for it. - * If no arguments are passed, all tracked functions will be reset. - * - * ```js - * import assert from 'node:assert'; - * - * const tracker = new assert.CallTracker(); - * - * function func() {} - * const callsfunc = tracker.calls(func); - * - * callsfunc(); - * // Tracker was called once - * tracker.getCalls(callsfunc).length === 1; - * - * tracker.reset(callsfunc); - * tracker.getCalls(callsfunc).length === 0; - * ``` - * - * @since v18.8.0, v16.18.0 - * @param fn a tracked function to reset. - */ - reset(fn?: Function): void; - /** - * Iterates through the list of functions passed to `tracker.calls()` and will throw an error for functions that - * have not been called the expected number of times. - * - * ```js - * import assert from 'assert'; - * - * // Creates call tracker. - * const tracker = new assert.CallTracker(); - * - * function func() {} - * - * // Returns a function that wraps func() that must be called exact times - * // before tracker.verify(). - * const callsfunc = tracker.calls(func, 2); - * - * callsfunc(); - * - * // Will throw an error since callsfunc() was only called once. - * tracker.verify(); - * ``` - * @since v14.2.0, v12.19.0 - */ - verify(): void; - } - interface CallTrackerCall { - thisArg: object; - arguments: unknown[]; - } - interface CallTrackerReportInformation { - message: string; - /** The actual number of times the function was called. */ - actual: number; - /** The number of times the function was expected to be called. */ - expected: number; - /** The name of the function that is wrapped. */ - operator: string; - /** A stack trace of the function. */ - stack: object; - } - type AssertPredicate = RegExp | (new () => object) | ((thrown: unknown) => boolean) | object | Error; - /** - * Throws an `AssertionError` with the provided error message or a default - * error message. If the `message` parameter is an instance of an `Error` then - * it will be thrown instead of the `AssertionError`. - * - * ```js - * import assert from 'assert/strict'; - * - * assert.fail(); - * // AssertionError [ERR_ASSERTION]: Failed - * - * assert.fail('boom'); - * // AssertionError [ERR_ASSERTION]: boom - * - * assert.fail(new TypeError('need array')); - * // TypeError: need array - * ``` - * - * Using `assert.fail()` with more than two arguments is possible but deprecated. - * See below for further details. - * @since v0.1.21 - * @param [message='Failed'] - */ - function fail(message?: string | Error): never; - /** @deprecated since v10.0.0 - use fail([message]) or other assert functions instead. */ - function fail( - actual: unknown, - expected: unknown, - message?: string | Error, - operator?: string, - // tslint:disable-next-line:ban-types - stackStartFn?: Function - ): never; - /** - * Tests if `value` is truthy. It is equivalent to`assert.equal(!!value, true, message)`. - * - * If `value` is not truthy, an `AssertionError` is thrown with a `message`property set equal to the value of the `message` parameter. If the `message`parameter is `undefined`, a default - * error message is assigned. If the `message`parameter is an instance of an `Error` then it will be thrown instead of the`AssertionError`. - * If no arguments are passed in at all `message` will be set to the string:`` 'No value argument passed to `assert.ok()`' ``. - * - * Be aware that in the `repl` the error message will be different to the one - * thrown in a file! See below for further details. - * - * ```js - * import assert from 'assert/strict'; - * - * assert.ok(true); - * // OK - * assert.ok(1); - * // OK - * - * assert.ok(); - * // AssertionError: No value argument passed to `assert.ok()` - * - * assert.ok(false, 'it\'s false'); - * // AssertionError: it's false - * - * // In the repl: - * assert.ok(typeof 123 === 'string'); - * // AssertionError: false == true - * - * // In a file (e.g. test.js): - * assert.ok(typeof 123 === 'string'); - * // AssertionError: The expression evaluated to a falsy value: - * // - * // assert.ok(typeof 123 === 'string') - * - * assert.ok(false); - * // AssertionError: The expression evaluated to a falsy value: - * // - * // assert.ok(false) - * - * assert.ok(0); - * // AssertionError: The expression evaluated to a falsy value: - * // - * // assert.ok(0) - * ``` - * - * ```js - * import assert from 'assert/strict'; - * - * // Using `assert()` works the same: - * assert(0); - * // AssertionError: The expression evaluated to a falsy value: - * // - * // assert(0) - * ``` - * @since v0.1.21 - */ - function ok(value: unknown, message?: string | Error): asserts value; - /** - * **Strict assertion mode** - * - * An alias of {@link strictEqual}. - * - * **Legacy assertion mode** - * - * > Stability: 3 - Legacy: Use {@link strictEqual} instead. - * - * Tests shallow, coercive equality between the `actual` and `expected` parameters - * using the [`==` operator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Equality). `NaN` is specially handled - * and treated as being identical if both sides are `NaN`. - * - * ```js - * import assert from 'assert'; - * - * assert.equal(1, 1); - * // OK, 1 == 1 - * assert.equal(1, '1'); - * // OK, 1 == '1' - * assert.equal(NaN, NaN); - * // OK - * - * assert.equal(1, 2); - * // AssertionError: 1 == 2 - * assert.equal({ a: { b: 1 } }, { a: { b: 1 } }); - * // AssertionError: { a: { b: 1 } } == { a: { b: 1 } } - * ``` - * - * If the values are not equal, an `AssertionError` is thrown with a `message`property set equal to the value of the `message` parameter. If the `message`parameter is undefined, a default - * error message is assigned. If the `message`parameter is an instance of an `Error` then it will be thrown instead of the`AssertionError`. - * @since v0.1.21 - */ - function equal(actual: unknown, expected: unknown, message?: string | Error): void; - /** - * **Strict assertion mode** - * - * An alias of {@link notStrictEqual}. - * - * **Legacy assertion mode** - * - * > Stability: 3 - Legacy: Use {@link notStrictEqual} instead. - * - * Tests shallow, coercive inequality with the [`!=` operator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Inequality). `NaN` is - * specially handled and treated as being identical if both sides are `NaN`. - * - * ```js - * import assert from 'assert'; - * - * assert.notEqual(1, 2); - * // OK - * - * assert.notEqual(1, 1); - * // AssertionError: 1 != 1 - * - * assert.notEqual(1, '1'); - * // AssertionError: 1 != '1' - * ``` - * - * If the values are equal, an `AssertionError` is thrown with a `message`property set equal to the value of the `message` parameter. If the `message`parameter is undefined, a default error - * message is assigned. If the `message`parameter is an instance of an `Error` then it will be thrown instead of the`AssertionError`. - * @since v0.1.21 - */ - function notEqual(actual: unknown, expected: unknown, message?: string | Error): void; - /** - * **Strict assertion mode** - * - * An alias of {@link deepStrictEqual}. - * - * **Legacy assertion mode** - * - * > Stability: 3 - Legacy: Use {@link deepStrictEqual} instead. - * - * Tests for deep equality between the `actual` and `expected` parameters. Consider - * using {@link deepStrictEqual} instead. {@link deepEqual} can have - * surprising results. - * - * _Deep equality_ means that the enumerable "own" properties of child objects - * are also recursively evaluated by the following rules. - * @since v0.1.21 - */ - function deepEqual(actual: unknown, expected: unknown, message?: string | Error): void; - /** - * **Strict assertion mode** - * - * An alias of {@link notDeepStrictEqual}. - * - * **Legacy assertion mode** - * - * > Stability: 3 - Legacy: Use {@link notDeepStrictEqual} instead. - * - * Tests for any deep inequality. Opposite of {@link deepEqual}. - * - * ```js - * import assert from 'assert'; - * - * const obj1 = { - * a: { - * b: 1 - * } - * }; - * const obj2 = { - * a: { - * b: 2 - * } - * }; - * const obj3 = { - * a: { - * b: 1 - * } - * }; - * const obj4 = Object.create(obj1); - * - * assert.notDeepEqual(obj1, obj1); - * // AssertionError: { a: { b: 1 } } notDeepEqual { a: { b: 1 } } - * - * assert.notDeepEqual(obj1, obj2); - * // OK - * - * assert.notDeepEqual(obj1, obj3); - * // AssertionError: { a: { b: 1 } } notDeepEqual { a: { b: 1 } } - * - * assert.notDeepEqual(obj1, obj4); - * // OK - * ``` - * - * If the values are deeply equal, an `AssertionError` is thrown with a`message` property set equal to the value of the `message` parameter. If the`message` parameter is undefined, a default - * error message is assigned. If the`message` parameter is an instance of an `Error` then it will be thrown - * instead of the `AssertionError`. - * @since v0.1.21 - */ - function notDeepEqual(actual: unknown, expected: unknown, message?: string | Error): void; - /** - * Tests strict equality between the `actual` and `expected` parameters as - * determined by [`Object.is()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is). - * - * ```js - * import assert from 'assert/strict'; - * - * assert.strictEqual(1, 2); - * // AssertionError [ERR_ASSERTION]: Expected inputs to be strictly equal: - * // - * // 1 !== 2 - * - * assert.strictEqual(1, 1); - * // OK - * - * assert.strictEqual('Hello foobar', 'Hello World!'); - * // AssertionError [ERR_ASSERTION]: Expected inputs to be strictly equal: - * // + actual - expected - * // - * // + 'Hello foobar' - * // - 'Hello World!' - * // ^ - * - * const apples = 1; - * const oranges = 2; - * assert.strictEqual(apples, oranges, `apples ${apples} !== oranges ${oranges}`); - * // AssertionError [ERR_ASSERTION]: apples 1 !== oranges 2 - * - * assert.strictEqual(1, '1', new TypeError('Inputs are not identical')); - * // TypeError: Inputs are not identical - * ``` - * - * If the values are not strictly equal, an `AssertionError` is thrown with a`message` property set equal to the value of the `message` parameter. If the`message` parameter is undefined, a - * default error message is assigned. If the`message` parameter is an instance of an `Error` then it will be thrown - * instead of the `AssertionError`. - * @since v0.1.21 - */ - function strictEqual(actual: unknown, expected: T, message?: string | Error): asserts actual is T; - /** - * Tests strict inequality between the `actual` and `expected` parameters as - * determined by [`Object.is()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is). - * - * ```js - * import assert from 'assert/strict'; - * - * assert.notStrictEqual(1, 2); - * // OK - * - * assert.notStrictEqual(1, 1); - * // AssertionError [ERR_ASSERTION]: Expected "actual" to be strictly unequal to: - * // - * // 1 - * - * assert.notStrictEqual(1, '1'); - * // OK - * ``` - * - * If the values are strictly equal, an `AssertionError` is thrown with a`message` property set equal to the value of the `message` parameter. If the`message` parameter is undefined, a - * default error message is assigned. If the`message` parameter is an instance of an `Error` then it will be thrown - * instead of the `AssertionError`. - * @since v0.1.21 - */ - function notStrictEqual(actual: unknown, expected: unknown, message?: string | Error): void; - /** - * Tests for deep equality between the `actual` and `expected` parameters. - * "Deep" equality means that the enumerable "own" properties of child objects - * are recursively evaluated also by the following rules. - * @since v1.2.0 - */ - function deepStrictEqual(actual: unknown, expected: T, message?: string | Error): asserts actual is T; - /** - * Tests for deep strict inequality. Opposite of {@link deepStrictEqual}. - * - * ```js - * import assert from 'assert/strict'; - * - * assert.notDeepStrictEqual({ a: 1 }, { a: '1' }); - * // OK - * ``` - * - * If the values are deeply and strictly equal, an `AssertionError` is thrown - * with a `message` property set equal to the value of the `message` parameter. If - * the `message` parameter is undefined, a default error message is assigned. If - * the `message` parameter is an instance of an `Error` then it will be thrown - * instead of the `AssertionError`. - * @since v1.2.0 - */ - function notDeepStrictEqual(actual: unknown, expected: unknown, message?: string | Error): void; - /** - * Expects the function `fn` to throw an error. - * - * If specified, `error` can be a [`Class`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes), - * [`RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions), a validation function, - * a validation object where each property will be tested for strict deep equality, - * or an instance of error where each property will be tested for strict deep - * equality including the non-enumerable `message` and `name` properties. When - * using an object, it is also possible to use a regular expression, when - * validating against a string property. See below for examples. - * - * If specified, `message` will be appended to the message provided by the`AssertionError` if the `fn` call fails to throw or in case the error validation - * fails. - * - * Custom validation object/error instance: - * - * ```js - * import assert from 'assert/strict'; - * - * const err = new TypeError('Wrong value'); - * err.code = 404; - * err.foo = 'bar'; - * err.info = { - * nested: true, - * baz: 'text' - * }; - * err.reg = /abc/i; - * - * assert.throws( - * () => { - * throw err; - * }, - * { - * name: 'TypeError', - * message: 'Wrong value', - * info: { - * nested: true, - * baz: 'text' - * } - * // Only properties on the validation object will be tested for. - * // Using nested objects requires all properties to be present. Otherwise - * // the validation is going to fail. - * } - * ); - * - * // Using regular expressions to validate error properties: - * throws( - * () => { - * throw err; - * }, - * { - * // The `name` and `message` properties are strings and using regular - * // expressions on those will match against the string. If they fail, an - * // error is thrown. - * name: /^TypeError$/, - * message: /Wrong/, - * foo: 'bar', - * info: { - * nested: true, - * // It is not possible to use regular expressions for nested properties! - * baz: 'text' - * }, - * // The `reg` property contains a regular expression and only if the - * // validation object contains an identical regular expression, it is going - * // to pass. - * reg: /abc/i - * } - * ); - * - * // Fails due to the different `message` and `name` properties: - * throws( - * () => { - * const otherErr = new Error('Not found'); - * // Copy all enumerable properties from `err` to `otherErr`. - * for (const [key, value] of Object.entries(err)) { - * otherErr[key] = value; - * } - * throw otherErr; - * }, - * // The error's `message` and `name` properties will also be checked when using - * // an error as validation object. - * err - * ); - * ``` - * - * Validate instanceof using constructor: - * - * ```js - * import assert from 'assert/strict'; - * - * assert.throws( - * () => { - * throw new Error('Wrong value'); - * }, - * Error - * ); - * ``` - * - * Validate error message using [`RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions): - * - * Using a regular expression runs `.toString` on the error object, and will - * therefore also include the error name. - * - * ```js - * import assert from 'assert/strict'; - * - * assert.throws( - * () => { - * throw new Error('Wrong value'); - * }, - * /^Error: Wrong value$/ - * ); - * ``` - * - * Custom error validation: - * - * The function must return `true` to indicate all internal validations passed. - * It will otherwise fail with an `AssertionError`. - * - * ```js - * import assert from 'assert/strict'; - * - * assert.throws( - * () => { - * throw new Error('Wrong value'); - * }, - * (err) => { - * assert(err instanceof Error); - * assert(/value/.test(err)); - * // Avoid returning anything from validation functions besides `true`. - * // Otherwise, it's not clear what part of the validation failed. Instead, - * // throw an error about the specific validation that failed (as done in this - * // example) and add as much helpful debugging information to that error as - * // possible. - * return true; - * }, - * 'unexpected error' - * ); - * ``` - * - * `error` cannot be a string. If a string is provided as the second - * argument, then `error` is assumed to be omitted and the string will be used for`message` instead. This can lead to easy-to-miss mistakes. Using the same - * message as the thrown error message is going to result in an`ERR_AMBIGUOUS_ARGUMENT` error. Please read the example below carefully if using - * a string as the second argument gets considered: - * - * ```js - * import assert from 'assert/strict'; - * - * function throwingFirst() { - * throw new Error('First'); - * } - * - * function throwingSecond() { - * throw new Error('Second'); - * } - * - * function notThrowing() {} - * - * // The second argument is a string and the input function threw an Error. - * // The first case will not throw as it does not match for the error message - * // thrown by the input function! - * assert.throws(throwingFirst, 'Second'); - * // In the next example the message has no benefit over the message from the - * // error and since it is not clear if the user intended to actually match - * // against the error message, Node.js throws an `ERR_AMBIGUOUS_ARGUMENT` error. - * assert.throws(throwingSecond, 'Second'); - * // TypeError [ERR_AMBIGUOUS_ARGUMENT] - * - * // The string is only used (as message) in case the function does not throw: - * assert.throws(notThrowing, 'Second'); - * // AssertionError [ERR_ASSERTION]: Missing expected exception: Second - * - * // If it was intended to match for the error message do this instead: - * // It does not throw because the error messages match. - * assert.throws(throwingSecond, /Second$/); - * - * // If the error message does not match, an AssertionError is thrown. - * assert.throws(throwingFirst, /Second$/); - * // AssertionError [ERR_ASSERTION] - * ``` - * - * Due to the confusing error-prone notation, avoid a string as the second - * argument. - * @since v0.1.21 - */ - function throws(block: () => unknown, message?: string | Error): void; - function throws(block: () => unknown, error: AssertPredicate, message?: string | Error): void; - /** - * Asserts that the function `fn` does not throw an error. - * - * Using `assert.doesNotThrow()` is actually not useful because there - * is no benefit in catching an error and then rethrowing it. Instead, consider - * adding a comment next to the specific code path that should not throw and keep - * error messages as expressive as possible. - * - * When `assert.doesNotThrow()` is called, it will immediately call the `fn`function. - * - * If an error is thrown and it is the same type as that specified by the `error`parameter, then an `AssertionError` is thrown. If the error is of a - * different type, or if the `error` parameter is undefined, the error is - * propagated back to the caller. - * - * If specified, `error` can be a [`Class`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes), - * [`RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions) or a validation - * function. See {@link throws} for more details. - * - * The following, for instance, will throw the `TypeError` because there is no - * matching error type in the assertion: - * - * ```js - * import assert from 'assert/strict'; - * - * assert.doesNotThrow( - * () => { - * throw new TypeError('Wrong value'); - * }, - * SyntaxError - * ); - * ``` - * - * However, the following will result in an `AssertionError` with the message - * 'Got unwanted exception...': - * - * ```js - * import assert from 'assert/strict'; - * - * assert.doesNotThrow( - * () => { - * throw new TypeError('Wrong value'); - * }, - * TypeError - * ); - * ``` - * - * If an `AssertionError` is thrown and a value is provided for the `message`parameter, the value of `message` will be appended to the `AssertionError` message: - * - * ```js - * import assert from 'assert/strict'; - * - * assert.doesNotThrow( - * () => { - * throw new TypeError('Wrong value'); - * }, - * /Wrong value/, - * 'Whoops' - * ); - * // Throws: AssertionError: Got unwanted exception: Whoops - * ``` - * @since v0.1.21 - */ - function doesNotThrow(block: () => unknown, message?: string | Error): void; - function doesNotThrow(block: () => unknown, error: AssertPredicate, message?: string | Error): void; - /** - * Throws `value` if `value` is not `undefined` or `null`. This is useful when - * testing the `error` argument in callbacks. The stack trace contains all frames - * from the error passed to `ifError()` including the potential new frames for`ifError()` itself. - * - * ```js - * import assert from 'assert/strict'; - * - * assert.ifError(null); - * // OK - * assert.ifError(0); - * // AssertionError [ERR_ASSERTION]: ifError got unwanted exception: 0 - * assert.ifError('error'); - * // AssertionError [ERR_ASSERTION]: ifError got unwanted exception: 'error' - * assert.ifError(new Error()); - * // AssertionError [ERR_ASSERTION]: ifError got unwanted exception: Error - * - * // Create some random error frames. - * let err; - * (function errorFrame() { - * err = new Error('test error'); - * })(); - * - * (function ifErrorFrame() { - * assert.ifError(err); - * })(); - * // AssertionError [ERR_ASSERTION]: ifError got unwanted exception: test error - * // at ifErrorFrame - * // at errorFrame - * ``` - * @since v0.1.97 - */ - function ifError(value: unknown): asserts value is null | undefined; - /** - * Awaits the `asyncFn` promise or, if `asyncFn` is a function, immediately - * calls the function and awaits the returned promise to complete. It will then - * check that the promise is rejected. - * - * If `asyncFn` is a function and it throws an error synchronously,`assert.rejects()` will return a rejected `Promise` with that error. If the - * function does not return a promise, `assert.rejects()` will return a rejected`Promise` with an `ERR_INVALID_RETURN_VALUE` error. In both cases the error - * handler is skipped. - * - * Besides the async nature to await the completion behaves identically to {@link throws}. - * - * If specified, `error` can be a [`Class`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes), - * [`RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions), a validation function, - * an object where each property will be tested for, or an instance of error where - * each property will be tested for including the non-enumerable `message` and`name` properties. - * - * If specified, `message` will be the message provided by the `AssertionError` if the `asyncFn` fails to reject. - * - * ```js - * import assert from 'assert/strict'; - * - * await assert.rejects( - * async () => { - * throw new TypeError('Wrong value'); - * }, - * { - * name: 'TypeError', - * message: 'Wrong value' - * } - * ); - * ``` - * - * ```js - * import assert from 'assert/strict'; - * - * await assert.rejects( - * async () => { - * throw new TypeError('Wrong value'); - * }, - * (err) => { - * assert.strictEqual(err.name, 'TypeError'); - * assert.strictEqual(err.message, 'Wrong value'); - * return true; - * } - * ); - * ``` - * - * ```js - * import assert from 'assert/strict'; - * - * assert.rejects( - * Promise.reject(new Error('Wrong value')), - * Error - * ).then(() => { - * // ... - * }); - * ``` - * - * `error` cannot be a string. If a string is provided as the second - * argument, then `error` is assumed to be omitted and the string will be used for`message` instead. This can lead to easy-to-miss mistakes. Please read the - * example in {@link throws} carefully if using a string as the second - * argument gets considered. - * @since v10.0.0 - */ - function rejects(block: (() => Promise) | Promise, message?: string | Error): Promise; - function rejects(block: (() => Promise) | Promise, error: AssertPredicate, message?: string | Error): Promise; - /** - * Awaits the `asyncFn` promise or, if `asyncFn` is a function, immediately - * calls the function and awaits the returned promise to complete. It will then - * check that the promise is not rejected. - * - * If `asyncFn` is a function and it throws an error synchronously,`assert.doesNotReject()` will return a rejected `Promise` with that error. If - * the function does not return a promise, `assert.doesNotReject()` will return a - * rejected `Promise` with an `ERR_INVALID_RETURN_VALUE` error. In both cases - * the error handler is skipped. - * - * Using `assert.doesNotReject()` is actually not useful because there is little - * benefit in catching a rejection and then rejecting it again. Instead, consider - * adding a comment next to the specific code path that should not reject and keep - * error messages as expressive as possible. - * - * If specified, `error` can be a [`Class`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes), - * [`RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions) or a validation - * function. See {@link throws} for more details. - * - * Besides the async nature to await the completion behaves identically to {@link doesNotThrow}. - * - * ```js - * import assert from 'assert/strict'; - * - * await assert.doesNotReject( - * async () => { - * throw new TypeError('Wrong value'); - * }, - * SyntaxError - * ); - * ``` - * - * ```js - * import assert from 'assert/strict'; - * - * assert.doesNotReject(Promise.reject(new TypeError('Wrong value'))) - * .then(() => { - * // ... - * }); - * ``` - * @since v10.0.0 - */ - function doesNotReject(block: (() => Promise) | Promise, message?: string | Error): Promise; - function doesNotReject(block: (() => Promise) | Promise, error: AssertPredicate, message?: string | Error): Promise; - /** - * Expects the `string` input to match the regular expression. - * - * ```js - * import assert from 'assert/strict'; - * - * assert.match('I will fail', /pass/); - * // AssertionError [ERR_ASSERTION]: The input did not match the regular ... - * - * assert.match(123, /pass/); - * // AssertionError [ERR_ASSERTION]: The "string" argument must be of type string. - * - * assert.match('I will pass', /pass/); - * // OK - * ``` - * - * If the values do not match, or if the `string` argument is of another type than`string`, an `AssertionError` is thrown with a `message` property set equal - * to the value of the `message` parameter. If the `message` parameter is - * undefined, a default error message is assigned. If the `message` parameter is an - * instance of an `Error` then it will be thrown instead of the `AssertionError`. - * @since v13.6.0, v12.16.0 - */ - function match(value: string, regExp: RegExp, message?: string | Error): void; - /** - * Expects the `string` input not to match the regular expression. - * - * ```js - * import assert from 'assert/strict'; - * - * assert.doesNotMatch('I will fail', /fail/); - * // AssertionError [ERR_ASSERTION]: The input was expected to not match the ... - * - * assert.doesNotMatch(123, /pass/); - * // AssertionError [ERR_ASSERTION]: The "string" argument must be of type string. - * - * assert.doesNotMatch('I will pass', /different/); - * // OK - * ``` - * - * If the values do match, or if the `string` argument is of another type than`string`, an `AssertionError` is thrown with a `message` property set equal - * to the value of the `message` parameter. If the `message` parameter is - * undefined, a default error message is assigned. If the `message` parameter is an - * instance of an `Error` then it will be thrown instead of the `AssertionError`. - * @since v13.6.0, v12.16.0 - */ - function doesNotMatch(value: string, regExp: RegExp, message?: string | Error): void; - const strict: Omit & { - (value: unknown, message?: string | Error): asserts value; - equal: typeof strictEqual; - notEqual: typeof notStrictEqual; - deepEqual: typeof deepStrictEqual; - notDeepEqual: typeof notDeepStrictEqual; - // Mapped types and assertion functions are incompatible? - // TS2775: Assertions require every name in the call target - // to be declared with an explicit type annotation. - ok: typeof ok; - strictEqual: typeof strictEqual; - deepStrictEqual: typeof deepStrictEqual; - ifError: typeof ifError; - strict: typeof strict; - }; - } - export = assert; -} -declare module 'node:assert' { - import assert = require('assert'); - export = assert; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/assert/strict.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/assert/strict.d.ts deleted file mode 100755 index b4319b97..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/assert/strict.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -declare module 'assert/strict' { - import { strict } from 'node:assert'; - export = strict; -} -declare module 'node:assert/strict' { - import { strict } from 'node:assert'; - export = strict; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/async_hooks.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/async_hooks.d.ts deleted file mode 100755 index 0bf47396..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/async_hooks.d.ts +++ /dev/null @@ -1,501 +0,0 @@ -/** - * The `async_hooks` module provides an API to track asynchronous resources. It - * can be accessed using: - * - * ```js - * import async_hooks from 'async_hooks'; - * ``` - * @experimental - * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/async_hooks.js) - */ -declare module 'async_hooks' { - /** - * ```js - * import { executionAsyncId } from 'async_hooks'; - * - * console.log(executionAsyncId()); // 1 - bootstrap - * fs.open(path, 'r', (err, fd) => { - * console.log(executionAsyncId()); // 6 - open() - * }); - * ``` - * - * The ID returned from `executionAsyncId()` is related to execution timing, not - * causality (which is covered by `triggerAsyncId()`): - * - * ```js - * const server = net.createServer((conn) => { - * // Returns the ID of the server, not of the new connection, because the - * // callback runs in the execution scope of the server's MakeCallback(). - * async_hooks.executionAsyncId(); - * - * }).listen(port, () => { - * // Returns the ID of a TickObject (process.nextTick()) because all - * // callbacks passed to .listen() are wrapped in a nextTick(). - * async_hooks.executionAsyncId(); - * }); - * ``` - * - * Promise contexts may not get precise `executionAsyncIds` by default. - * See the section on `promise execution tracking`. - * @since v8.1.0 - * @return The `asyncId` of the current execution context. Useful to track when something calls. - */ - function executionAsyncId(): number; - /** - * Resource objects returned by `executionAsyncResource()` are most often internal - * Node.js handle objects with undocumented APIs. Using any functions or properties - * on the object is likely to crash your application and should be avoided. - * - * Using `executionAsyncResource()` in the top-level execution context will - * return an empty object as there is no handle or request object to use, - * but having an object representing the top-level can be helpful. - * - * ```js - * import { open } from 'fs'; - * import { executionAsyncId, executionAsyncResource } from 'async_hooks'; - * - * console.log(executionAsyncId(), executionAsyncResource()); // 1 {} - * open(new URL(import.meta.url), 'r', (err, fd) => { - * console.log(executionAsyncId(), executionAsyncResource()); // 7 FSReqWrap - * }); - * ``` - * - * This can be used to implement continuation local storage without the - * use of a tracking `Map` to store the metadata: - * - * ```js - * import { createServer } from 'http'; - * import { - * executionAsyncId, - * executionAsyncResource, - * createHook - * } from 'async_hooks'; - * const sym = Symbol('state'); // Private symbol to avoid pollution - * - * createHook({ - * init(asyncId, type, triggerAsyncId, resource) { - * const cr = executionAsyncResource(); - * if (cr) { - * resource[sym] = cr[sym]; - * } - * } - * }).enable(); - * - * const server = createServer((req, res) => { - * executionAsyncResource()[sym] = { state: req.url }; - * setTimeout(function() { - * res.end(JSON.stringify(executionAsyncResource()[sym])); - * }, 100); - * }).listen(3000); - * ``` - * @since v13.9.0, v12.17.0 - * @return The resource representing the current execution. Useful to store data within the resource. - */ - function executionAsyncResource(): object; - /** - * ```js - * const server = net.createServer((conn) => { - * // The resource that caused (or triggered) this callback to be called - * // was that of the new connection. Thus the return value of triggerAsyncId() - * // is the asyncId of "conn". - * async_hooks.triggerAsyncId(); - * - * }).listen(port, () => { - * // Even though all callbacks passed to .listen() are wrapped in a nextTick() - * // the callback itself exists because the call to the server's .listen() - * // was made. So the return value would be the ID of the server. - * async_hooks.triggerAsyncId(); - * }); - * ``` - * - * Promise contexts may not get valid `triggerAsyncId`s by default. See - * the section on `promise execution tracking`. - * @return The ID of the resource responsible for calling the callback that is currently being executed. - */ - function triggerAsyncId(): number; - interface HookCallbacks { - /** - * Called when a class is constructed that has the possibility to emit an asynchronous event. - * @param asyncId a unique ID for the async resource - * @param type the type of the async resource - * @param triggerAsyncId the unique ID of the async resource in whose execution context this async resource was created - * @param resource reference to the resource representing the async operation, needs to be released during destroy - */ - init?(asyncId: number, type: string, triggerAsyncId: number, resource: object): void; - /** - * When an asynchronous operation is initiated or completes a callback is called to notify the user. - * The before callback is called just before said callback is executed. - * @param asyncId the unique identifier assigned to the resource about to execute the callback. - */ - before?(asyncId: number): void; - /** - * Called immediately after the callback specified in before is completed. - * @param asyncId the unique identifier assigned to the resource which has executed the callback. - */ - after?(asyncId: number): void; - /** - * Called when a promise has resolve() called. This may not be in the same execution id - * as the promise itself. - * @param asyncId the unique id for the promise that was resolve()d. - */ - promiseResolve?(asyncId: number): void; - /** - * Called after the resource corresponding to asyncId is destroyed - * @param asyncId a unique ID for the async resource - */ - destroy?(asyncId: number): void; - } - interface AsyncHook { - /** - * Enable the callbacks for a given AsyncHook instance. If no callbacks are provided enabling is a noop. - */ - enable(): this; - /** - * Disable the callbacks for a given AsyncHook instance from the global pool of AsyncHook callbacks to be executed. Once a hook has been disabled it will not be called again until enabled. - */ - disable(): this; - } - /** - * Registers functions to be called for different lifetime events of each async - * operation. - * - * The callbacks `init()`/`before()`/`after()`/`destroy()` are called for the - * respective asynchronous event during a resource's lifetime. - * - * All callbacks are optional. For example, if only resource cleanup needs to - * be tracked, then only the `destroy` callback needs to be passed. The - * specifics of all functions that can be passed to `callbacks` is in the `Hook Callbacks` section. - * - * ```js - * import { createHook } from 'async_hooks'; - * - * const asyncHook = createHook({ - * init(asyncId, type, triggerAsyncId, resource) { }, - * destroy(asyncId) { } - * }); - * ``` - * - * The callbacks will be inherited via the prototype chain: - * - * ```js - * class MyAsyncCallbacks { - * init(asyncId, type, triggerAsyncId, resource) { } - * destroy(asyncId) {} - * } - * - * class MyAddedCallbacks extends MyAsyncCallbacks { - * before(asyncId) { } - * after(asyncId) { } - * } - * - * const asyncHook = async_hooks.createHook(new MyAddedCallbacks()); - * ``` - * - * Because promises are asynchronous resources whose lifecycle is tracked - * via the async hooks mechanism, the `init()`, `before()`, `after()`, and`destroy()` callbacks _must not_ be async functions that return promises. - * @since v8.1.0 - * @param callbacks The `Hook Callbacks` to register - * @return Instance used for disabling and enabling hooks - */ - function createHook(callbacks: HookCallbacks): AsyncHook; - interface AsyncResourceOptions { - /** - * The ID of the execution context that created this async event. - * @default executionAsyncId() - */ - triggerAsyncId?: number | undefined; - /** - * Disables automatic `emitDestroy` when the object is garbage collected. - * This usually does not need to be set (even if `emitDestroy` is called - * manually), unless the resource's `asyncId` is retrieved and the - * sensitive API's `emitDestroy` is called with it. - * @default false - */ - requireManualDestroy?: boolean | undefined; - } - /** - * The class `AsyncResource` is designed to be extended by the embedder's async - * resources. Using this, users can easily trigger the lifetime events of their - * own resources. - * - * The `init` hook will trigger when an `AsyncResource` is instantiated. - * - * The following is an overview of the `AsyncResource` API. - * - * ```js - * import { AsyncResource, executionAsyncId } from 'async_hooks'; - * - * // AsyncResource() is meant to be extended. Instantiating a - * // new AsyncResource() also triggers init. If triggerAsyncId is omitted then - * // async_hook.executionAsyncId() is used. - * const asyncResource = new AsyncResource( - * type, { triggerAsyncId: executionAsyncId(), requireManualDestroy: false } - * ); - * - * // Run a function in the execution context of the resource. This will - * // * establish the context of the resource - * // * trigger the AsyncHooks before callbacks - * // * call the provided function `fn` with the supplied arguments - * // * trigger the AsyncHooks after callbacks - * // * restore the original execution context - * asyncResource.runInAsyncScope(fn, thisArg, ...args); - * - * // Call AsyncHooks destroy callbacks. - * asyncResource.emitDestroy(); - * - * // Return the unique ID assigned to the AsyncResource instance. - * asyncResource.asyncId(); - * - * // Return the trigger ID for the AsyncResource instance. - * asyncResource.triggerAsyncId(); - * ``` - */ - class AsyncResource { - /** - * AsyncResource() is meant to be extended. Instantiating a - * new AsyncResource() also triggers init. If triggerAsyncId is omitted then - * async_hook.executionAsyncId() is used. - * @param type The type of async event. - * @param triggerAsyncId The ID of the execution context that created - * this async event (default: `executionAsyncId()`), or an - * AsyncResourceOptions object (since v9.3.0) - */ - constructor(type: string, triggerAsyncId?: number | AsyncResourceOptions); - /** - * Binds the given function to the current execution context. - * - * The returned function will have an `asyncResource` property referencing - * the `AsyncResource` to which the function is bound. - * @since v14.8.0, v12.19.0 - * @param fn The function to bind to the current execution context. - * @param type An optional name to associate with the underlying `AsyncResource`. - */ - static bind any, ThisArg>( - fn: Func, - type?: string, - thisArg?: ThisArg - ): Func & { - asyncResource: AsyncResource; - }; - /** - * Binds the given function to execute to this `AsyncResource`'s scope. - * - * The returned function will have an `asyncResource` property referencing - * the `AsyncResource` to which the function is bound. - * @since v14.8.0, v12.19.0 - * @param fn The function to bind to the current `AsyncResource`. - */ - bind any>( - fn: Func - ): Func & { - asyncResource: AsyncResource; - }; - /** - * Call the provided function with the provided arguments in the execution context - * of the async resource. This will establish the context, trigger the AsyncHooks - * before callbacks, call the function, trigger the AsyncHooks after callbacks, and - * then restore the original execution context. - * @since v9.6.0 - * @param fn The function to call in the execution context of this async resource. - * @param thisArg The receiver to be used for the function call. - * @param args Optional arguments to pass to the function. - */ - runInAsyncScope(fn: (this: This, ...args: any[]) => Result, thisArg?: This, ...args: any[]): Result; - /** - * Call all `destroy` hooks. This should only ever be called once. An error will - * be thrown if it is called more than once. This **must** be manually called. If - * the resource is left to be collected by the GC then the `destroy` hooks will - * never be called. - * @return A reference to `asyncResource`. - */ - emitDestroy(): this; - /** - * @return The unique `asyncId` assigned to the resource. - */ - asyncId(): number; - /** - * - * @return The same `triggerAsyncId` that is passed to the `AsyncResource` constructor. - */ - triggerAsyncId(): number; - } - /** - * This class creates stores that stay coherent through asynchronous operations. - * - * While you can create your own implementation on top of the `async_hooks` module,`AsyncLocalStorage` should be preferred as it is a performant and memory safe - * implementation that involves significant optimizations that are non-obvious to - * implement. - * - * The following example uses `AsyncLocalStorage` to build a simple logger - * that assigns IDs to incoming HTTP requests and includes them in messages - * logged within each request. - * - * ```js - * import http from 'http'; - * import { AsyncLocalStorage } from 'async_hooks'; - * - * const asyncLocalStorage = new AsyncLocalStorage(); - * - * function logWithId(msg) { - * const id = asyncLocalStorage.getStore(); - * console.log(`${id !== undefined ? id : '-'}:`, msg); - * } - * - * let idSeq = 0; - * http.createServer((req, res) => { - * asyncLocalStorage.run(idSeq++, () => { - * logWithId('start'); - * // Imagine any chain of async operations here - * setImmediate(() => { - * logWithId('finish'); - * res.end(); - * }); - * }); - * }).listen(8080); - * - * http.get('http://localhost:8080'); - * http.get('http://localhost:8080'); - * // Prints: - * // 0: start - * // 1: start - * // 0: finish - * // 1: finish - * ``` - * - * Each instance of `AsyncLocalStorage` maintains an independent storage context. - * Multiple instances can safely exist simultaneously without risk of interfering - * with each other's data. - * @since v13.10.0, v12.17.0 - */ - class AsyncLocalStorage { - /** - * Disables the instance of `AsyncLocalStorage`. All subsequent calls - * to `asyncLocalStorage.getStore()` will return `undefined` until`asyncLocalStorage.run()` or `asyncLocalStorage.enterWith()` is called again. - * - * When calling `asyncLocalStorage.disable()`, all current contexts linked to the - * instance will be exited. - * - * Calling `asyncLocalStorage.disable()` is required before the`asyncLocalStorage` can be garbage collected. This does not apply to stores - * provided by the `asyncLocalStorage`, as those objects are garbage collected - * along with the corresponding async resources. - * - * Use this method when the `asyncLocalStorage` is not in use anymore - * in the current process. - * @since v13.10.0, v12.17.0 - * @experimental - */ - disable(): void; - /** - * Returns the current store. - * If called outside of an asynchronous context initialized by - * calling `asyncLocalStorage.run()` or `asyncLocalStorage.enterWith()`, it - * returns `undefined`. - * @since v13.10.0, v12.17.0 - */ - getStore(): T | undefined; - /** - * Runs a function synchronously within a context and returns its - * return value. The store is not accessible outside of the callback function. - * The store is accessible to any asynchronous operations created within the - * callback. - * - * The optional `args` are passed to the callback function. - * - * If the callback function throws an error, the error is thrown by `run()` too. - * The stacktrace is not impacted by this call and the context is exited. - * - * Example: - * - * ```js - * const store = { id: 2 }; - * try { - * asyncLocalStorage.run(store, () => { - * asyncLocalStorage.getStore(); // Returns the store object - * setTimeout(() => { - * asyncLocalStorage.getStore(); // Returns the store object - * }, 200); - * throw new Error(); - * }); - * } catch (e) { - * asyncLocalStorage.getStore(); // Returns undefined - * // The error will be caught here - * } - * ``` - * @since v13.10.0, v12.17.0 - */ - run(store: T, callback: (...args: TArgs) => R, ...args: TArgs): R; - /** - * Runs a function synchronously outside of a context and returns its - * return value. The store is not accessible within the callback function or - * the asynchronous operations created within the callback. Any `getStore()`call done within the callback function will always return `undefined`. - * - * The optional `args` are passed to the callback function. - * - * If the callback function throws an error, the error is thrown by `exit()` too. - * The stacktrace is not impacted by this call and the context is re-entered. - * - * Example: - * - * ```js - * // Within a call to run - * try { - * asyncLocalStorage.getStore(); // Returns the store object or value - * asyncLocalStorage.exit(() => { - * asyncLocalStorage.getStore(); // Returns undefined - * throw new Error(); - * }); - * } catch (e) { - * asyncLocalStorage.getStore(); // Returns the same object or value - * // The error will be caught here - * } - * ``` - * @since v13.10.0, v12.17.0 - * @experimental - */ - exit(callback: (...args: TArgs) => R, ...args: TArgs): R; - /** - * Transitions into the context for the remainder of the current - * synchronous execution and then persists the store through any following - * asynchronous calls. - * - * Example: - * - * ```js - * const store = { id: 1 }; - * // Replaces previous store with the given store object - * asyncLocalStorage.enterWith(store); - * asyncLocalStorage.getStore(); // Returns the store object - * someAsyncOperation(() => { - * asyncLocalStorage.getStore(); // Returns the same object - * }); - * ``` - * - * This transition will continue for the _entire_ synchronous execution. - * This means that if, for example, the context is entered within an event - * handler subsequent event handlers will also run within that context unless - * specifically bound to another context with an `AsyncResource`. That is why`run()` should be preferred over `enterWith()` unless there are strong reasons - * to use the latter method. - * - * ```js - * const store = { id: 1 }; - * - * emitter.on('my-event', () => { - * asyncLocalStorage.enterWith(store); - * }); - * emitter.on('my-event', () => { - * asyncLocalStorage.getStore(); // Returns the same object - * }); - * - * asyncLocalStorage.getStore(); // Returns undefined - * emitter.emit('my-event'); - * asyncLocalStorage.getStore(); // Returns the same object - * ``` - * @since v13.11.0, v12.17.0 - * @experimental - */ - enterWith(store: T): void; - } -} -declare module 'node:async_hooks' { - export * from 'async_hooks'; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/buffer.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/buffer.d.ts deleted file mode 100755 index 5ec326d0..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/buffer.d.ts +++ /dev/null @@ -1,2258 +0,0 @@ -/** - * `Buffer` objects are used to represent a fixed-length sequence of bytes. Many - * Node.js APIs support `Buffer`s. - * - * The `Buffer` class is a subclass of JavaScript's [`Uint8Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array) class and - * extends it with methods that cover additional use cases. Node.js APIs accept - * plain [`Uint8Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array) s wherever `Buffer`s are supported as well. - * - * While the `Buffer` class is available within the global scope, it is still - * recommended to explicitly reference it via an import or require statement. - * - * ```js - * import { Buffer } from 'buffer'; - * - * // Creates a zero-filled Buffer of length 10. - * const buf1 = Buffer.alloc(10); - * - * // Creates a Buffer of length 10, - * // filled with bytes which all have the value `1`. - * const buf2 = Buffer.alloc(10, 1); - * - * // Creates an uninitialized buffer of length 10. - * // This is faster than calling Buffer.alloc() but the returned - * // Buffer instance might contain old data that needs to be - * // overwritten using fill(), write(), or other functions that fill the Buffer's - * // contents. - * const buf3 = Buffer.allocUnsafe(10); - * - * // Creates a Buffer containing the bytes [1, 2, 3]. - * const buf4 = Buffer.from([1, 2, 3]); - * - * // Creates a Buffer containing the bytes [1, 1, 1, 1] – the entries - * // are all truncated using `(value & 255)` to fit into the range 0–255. - * const buf5 = Buffer.from([257, 257.5, -255, '1']); - * - * // Creates a Buffer containing the UTF-8-encoded bytes for the string 'tést': - * // [0x74, 0xc3, 0xa9, 0x73, 0x74] (in hexadecimal notation) - * // [116, 195, 169, 115, 116] (in decimal notation) - * const buf6 = Buffer.from('tést'); - * - * // Creates a Buffer containing the Latin-1 bytes [0x74, 0xe9, 0x73, 0x74]. - * const buf7 = Buffer.from('tést', 'latin1'); - * ``` - * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/buffer.js) - */ -declare module 'buffer' { - import { BinaryLike } from 'node:crypto'; - import { ReadableStream as WebReadableStream } from 'node:stream/web'; - export const INSPECT_MAX_BYTES: number; - export const kMaxLength: number; - export const kStringMaxLength: number; - export const constants: { - MAX_LENGTH: number; - MAX_STRING_LENGTH: number; - }; - export type TranscodeEncoding = 'ascii' | 'utf8' | 'utf16le' | 'ucs2' | 'latin1' | 'binary'; - /** - * Re-encodes the given `Buffer` or `Uint8Array` instance from one character - * encoding to another. Returns a new `Buffer` instance. - * - * Throws if the `fromEnc` or `toEnc` specify invalid character encodings or if - * conversion from `fromEnc` to `toEnc` is not permitted. - * - * Encodings supported by `buffer.transcode()` are: `'ascii'`, `'utf8'`,`'utf16le'`, `'ucs2'`, `'latin1'`, and `'binary'`. - * - * The transcoding process will use substitution characters if a given byte - * sequence cannot be adequately represented in the target encoding. For instance: - * - * ```js - * import { Buffer, transcode } from 'buffer'; - * - * const newBuf = transcode(Buffer.from('€'), 'utf8', 'ascii'); - * console.log(newBuf.toString('ascii')); - * // Prints: '?' - * ``` - * - * Because the Euro (`€`) sign is not representable in US-ASCII, it is replaced - * with `?` in the transcoded `Buffer`. - * @since v7.1.0 - * @param source A `Buffer` or `Uint8Array` instance. - * @param fromEnc The current encoding. - * @param toEnc To target encoding. - */ - export function transcode(source: Uint8Array, fromEnc: TranscodeEncoding, toEnc: TranscodeEncoding): Buffer; - export const SlowBuffer: { - /** @deprecated since v6.0.0, use `Buffer.allocUnsafeSlow()` */ - new (size: number): Buffer; - prototype: Buffer; - }; - /** - * Resolves a `'blob:nodedata:...'` an associated `Blob` object registered using - * a prior call to `URL.createObjectURL()`. - * @since v16.7.0 - * @experimental - * @param id A `'blob:nodedata:...` URL string returned by a prior call to `URL.createObjectURL()`. - */ - export function resolveObjectURL(id: string): Blob | undefined; - export { Buffer }; - /** - * @experimental - */ - export interface BlobOptions { - /** - * @default 'utf8' - */ - encoding?: BufferEncoding | undefined; - /** - * The Blob content-type. The intent is for `type` to convey - * the MIME media type of the data, however no validation of the type format - * is performed. - */ - type?: string | undefined; - } - /** - * A [`Blob`](https://developer.mozilla.org/en-US/docs/Web/API/Blob) encapsulates immutable, raw data that can be safely shared across - * multiple worker threads. - * @since v15.7.0, v14.18.0 - */ - export class Blob { - /** - * The total size of the `Blob` in bytes. - * @since v15.7.0, v14.18.0 - */ - readonly size: number; - /** - * The content-type of the `Blob`. - * @since v15.7.0, v14.18.0 - */ - readonly type: string; - /** - * Creates a new `Blob` object containing a concatenation of the given sources. - * - * {ArrayBuffer}, {TypedArray}, {DataView}, and {Buffer} sources are copied into - * the 'Blob' and can therefore be safely modified after the 'Blob' is created. - * - * String sources are also copied into the `Blob`. - */ - constructor(sources: Array, options?: BlobOptions); - /** - * Returns a promise that fulfills with an [ArrayBuffer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer) containing a copy of - * the `Blob` data. - * @since v15.7.0, v14.18.0 - */ - arrayBuffer(): Promise; - /** - * Creates and returns a new `Blob` containing a subset of this `Blob` objects - * data. The original `Blob` is not altered. - * @since v15.7.0, v14.18.0 - * @param start The starting index. - * @param end The ending index. - * @param type The content-type for the new `Blob` - */ - slice(start?: number, end?: number, type?: string): Blob; - /** - * Returns a promise that fulfills with the contents of the `Blob` decoded as a - * UTF-8 string. - * @since v15.7.0, v14.18.0 - */ - text(): Promise; - /** - * Returns a new (WHATWG) `ReadableStream` that allows the content of the `Blob` to be read. - * @since v16.7.0 - */ - stream(): WebReadableStream; - } - export import atob = globalThis.atob; - export import btoa = globalThis.btoa; - - import { Blob as NodeBlob } from 'buffer'; - // This conditional type will be the existing global Blob in a browser, or - // the copy below in a Node environment. - type __Blob = typeof globalThis extends { onmessage: any, Blob: infer T } - ? T : NodeBlob; - global { - // Buffer class - type BufferEncoding = 'ascii' | 'utf8' | 'utf-8' | 'utf16le' | 'ucs2' | 'ucs-2' | 'base64' | 'base64url' | 'latin1' | 'binary' | 'hex'; - type WithImplicitCoercion = - | T - | { - valueOf(): T; - }; - /** - * Raw data is stored in instances of the Buffer class. - * A Buffer is similar to an array of integers but corresponds to a raw memory allocation outside the V8 heap. A Buffer cannot be resized. - * Valid string encodings: 'ascii'|'utf8'|'utf16le'|'ucs2'(alias of 'utf16le')|'base64'|'base64url'|'binary'(deprecated)|'hex' - */ - interface BufferConstructor { - /** - * Allocates a new buffer containing the given {str}. - * - * @param str String to store in buffer. - * @param encoding encoding to use, optional. Default is 'utf8' - * @deprecated since v10.0.0 - Use `Buffer.from(string[, encoding])` instead. - */ - new (str: string, encoding?: BufferEncoding): Buffer; - /** - * Allocates a new buffer of {size} octets. - * - * @param size count of octets to allocate. - * @deprecated since v10.0.0 - Use `Buffer.alloc()` instead (also see `Buffer.allocUnsafe()`). - */ - new (size: number): Buffer; - /** - * Allocates a new buffer containing the given {array} of octets. - * - * @param array The octets to store. - * @deprecated since v10.0.0 - Use `Buffer.from(array)` instead. - */ - new (array: Uint8Array): Buffer; - /** - * Produces a Buffer backed by the same allocated memory as - * the given {ArrayBuffer}/{SharedArrayBuffer}. - * - * - * @param arrayBuffer The ArrayBuffer with which to share memory. - * @deprecated since v10.0.0 - Use `Buffer.from(arrayBuffer[, byteOffset[, length]])` instead. - */ - new (arrayBuffer: ArrayBuffer | SharedArrayBuffer): Buffer; - /** - * Allocates a new buffer containing the given {array} of octets. - * - * @param array The octets to store. - * @deprecated since v10.0.0 - Use `Buffer.from(array)` instead. - */ - new (array: ReadonlyArray): Buffer; - /** - * Copies the passed {buffer} data onto a new {Buffer} instance. - * - * @param buffer The buffer to copy. - * @deprecated since v10.0.0 - Use `Buffer.from(buffer)` instead. - */ - new (buffer: Buffer): Buffer; - /** - * Allocates a new `Buffer` using an `array` of bytes in the range `0` – `255`. - * Array entries outside that range will be truncated to fit into it. - * - * ```js - * import { Buffer } from 'buffer'; - * - * // Creates a new Buffer containing the UTF-8 bytes of the string 'buffer'. - * const buf = Buffer.from([0x62, 0x75, 0x66, 0x66, 0x65, 0x72]); - * ``` - * - * A `TypeError` will be thrown if `array` is not an `Array` or another type - * appropriate for `Buffer.from()` variants. - * - * `Buffer.from(array)` and `Buffer.from(string)` may also use the internal`Buffer` pool like `Buffer.allocUnsafe()` does. - * @since v5.10.0 - */ - from(arrayBuffer: WithImplicitCoercion, byteOffset?: number, length?: number): Buffer; - /** - * Creates a new Buffer using the passed {data} - * @param data data to create a new Buffer - */ - from(data: Uint8Array | ReadonlyArray): Buffer; - from(data: WithImplicitCoercion | string>): Buffer; - /** - * Creates a new Buffer containing the given JavaScript string {str}. - * If provided, the {encoding} parameter identifies the character encoding. - * If not provided, {encoding} defaults to 'utf8'. - */ - from( - str: - | WithImplicitCoercion - | { - [Symbol.toPrimitive](hint: 'string'): string; - }, - encoding?: BufferEncoding - ): Buffer; - /** - * Creates a new Buffer using the passed {data} - * @param values to create a new Buffer - */ - of(...items: number[]): Buffer; - /** - * Returns `true` if `obj` is a `Buffer`, `false` otherwise. - * - * ```js - * import { Buffer } from 'buffer'; - * - * Buffer.isBuffer(Buffer.alloc(10)); // true - * Buffer.isBuffer(Buffer.from('foo')); // true - * Buffer.isBuffer('a string'); // false - * Buffer.isBuffer([]); // false - * Buffer.isBuffer(new Uint8Array(1024)); // false - * ``` - * @since v0.1.101 - */ - isBuffer(obj: any): obj is Buffer; - /** - * Returns `true` if `encoding` is the name of a supported character encoding, - * or `false` otherwise. - * - * ```js - * import { Buffer } from 'buffer'; - * - * console.log(Buffer.isEncoding('utf8')); - * // Prints: true - * - * console.log(Buffer.isEncoding('hex')); - * // Prints: true - * - * console.log(Buffer.isEncoding('utf/8')); - * // Prints: false - * - * console.log(Buffer.isEncoding('')); - * // Prints: false - * ``` - * @since v0.9.1 - * @param encoding A character encoding name to check. - */ - isEncoding(encoding: string): encoding is BufferEncoding; - /** - * Returns the byte length of a string when encoded using `encoding`. - * This is not the same as [`String.prototype.length`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/length), which does not account - * for the encoding that is used to convert the string into bytes. - * - * For `'base64'`, `'base64url'`, and `'hex'`, this function assumes valid input. - * For strings that contain non-base64/hex-encoded data (e.g. whitespace), the - * return value might be greater than the length of a `Buffer` created from the - * string. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const str = '\u00bd + \u00bc = \u00be'; - * - * console.log(`${str}: ${str.length} characters, ` + - * `${Buffer.byteLength(str, 'utf8')} bytes`); - * // Prints: ½ + ¼ = ¾: 9 characters, 12 bytes - * ``` - * - * When `string` is a - * `Buffer`/[`DataView`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView)/[`TypedArray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/- - * Reference/Global_Objects/TypedArray)/[`ArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer)/[`SharedArrayBuffer`](https://develop- - * er.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer), the byte length as reported by `.byteLength`is returned. - * @since v0.1.90 - * @param string A value to calculate the length of. - * @param [encoding='utf8'] If `string` is a string, this is its encoding. - * @return The number of bytes contained within `string`. - */ - byteLength(string: string | NodeJS.ArrayBufferView | ArrayBuffer | SharedArrayBuffer, encoding?: BufferEncoding): number; - /** - * Returns a new `Buffer` which is the result of concatenating all the `Buffer`instances in the `list` together. - * - * If the list has no items, or if the `totalLength` is 0, then a new zero-length`Buffer` is returned. - * - * If `totalLength` is not provided, it is calculated from the `Buffer` instances - * in `list` by adding their lengths. - * - * If `totalLength` is provided, it is coerced to an unsigned integer. If the - * combined length of the `Buffer`s in `list` exceeds `totalLength`, the result is - * truncated to `totalLength`. - * - * ```js - * import { Buffer } from 'buffer'; - * - * // Create a single `Buffer` from a list of three `Buffer` instances. - * - * const buf1 = Buffer.alloc(10); - * const buf2 = Buffer.alloc(14); - * const buf3 = Buffer.alloc(18); - * const totalLength = buf1.length + buf2.length + buf3.length; - * - * console.log(totalLength); - * // Prints: 42 - * - * const bufA = Buffer.concat([buf1, buf2, buf3], totalLength); - * - * console.log(bufA); - * // Prints: - * console.log(bufA.length); - * // Prints: 42 - * ``` - * - * `Buffer.concat()` may also use the internal `Buffer` pool like `Buffer.allocUnsafe()` does. - * @since v0.7.11 - * @param list List of `Buffer` or {@link Uint8Array} instances to concatenate. - * @param totalLength Total length of the `Buffer` instances in `list` when concatenated. - */ - concat(list: ReadonlyArray, totalLength?: number): Buffer; - /** - * Compares `buf1` to `buf2`, typically for the purpose of sorting arrays of`Buffer` instances. This is equivalent to calling `buf1.compare(buf2)`. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf1 = Buffer.from('1234'); - * const buf2 = Buffer.from('0123'); - * const arr = [buf1, buf2]; - * - * console.log(arr.sort(Buffer.compare)); - * // Prints: [ , ] - * // (This result is equal to: [buf2, buf1].) - * ``` - * @since v0.11.13 - * @return Either `-1`, `0`, or `1`, depending on the result of the comparison. See `compare` for details. - */ - compare(buf1: Uint8Array, buf2: Uint8Array): -1 | 0 | 1; - /** - * Allocates a new `Buffer` of `size` bytes. If `fill` is `undefined`, the`Buffer` will be zero-filled. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.alloc(5); - * - * console.log(buf); - * // Prints: - * ``` - * - * If `size` is larger than {@link constants.MAX_LENGTH} or smaller than 0, `ERR_INVALID_ARG_VALUE` is thrown. - * - * If `fill` is specified, the allocated `Buffer` will be initialized by calling `buf.fill(fill)`. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.alloc(5, 'a'); - * - * console.log(buf); - * // Prints: - * ``` - * - * If both `fill` and `encoding` are specified, the allocated `Buffer` will be - * initialized by calling `buf.fill(fill, encoding)`. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.alloc(11, 'aGVsbG8gd29ybGQ=', 'base64'); - * - * console.log(buf); - * // Prints: - * ``` - * - * Calling `Buffer.alloc()` can be measurably slower than the alternative `Buffer.allocUnsafe()` but ensures that the newly created `Buffer` instance - * contents will never contain sensitive data from previous allocations, including - * data that might not have been allocated for `Buffer`s. - * - * A `TypeError` will be thrown if `size` is not a number. - * @since v5.10.0 - * @param size The desired length of the new `Buffer`. - * @param [fill=0] A value to pre-fill the new `Buffer` with. - * @param [encoding='utf8'] If `fill` is a string, this is its encoding. - */ - alloc(size: number, fill?: string | Buffer | number, encoding?: BufferEncoding): Buffer; - /** - * Allocates a new `Buffer` of `size` bytes. If `size` is larger than {@link constants.MAX_LENGTH} or smaller than 0, `ERR_INVALID_ARG_VALUE` is thrown. - * - * The underlying memory for `Buffer` instances created in this way is _not_ - * _initialized_. The contents of the newly created `Buffer` are unknown and _may contain sensitive data_. Use `Buffer.alloc()` instead to initialize`Buffer` instances with zeroes. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.allocUnsafe(10); - * - * console.log(buf); - * // Prints (contents may vary): - * - * buf.fill(0); - * - * console.log(buf); - * // Prints: - * ``` - * - * A `TypeError` will be thrown if `size` is not a number. - * - * The `Buffer` module pre-allocates an internal `Buffer` instance of - * size `Buffer.poolSize` that is used as a pool for the fast allocation of new`Buffer` instances created using `Buffer.allocUnsafe()`,`Buffer.from(array)`, `Buffer.concat()`, and the - * deprecated`new Buffer(size)` constructor only when `size` is less than or equal - * to `Buffer.poolSize >> 1` (floor of `Buffer.poolSize` divided by two). - * - * Use of this pre-allocated internal memory pool is a key difference between - * calling `Buffer.alloc(size, fill)` vs. `Buffer.allocUnsafe(size).fill(fill)`. - * Specifically, `Buffer.alloc(size, fill)` will _never_ use the internal `Buffer`pool, while `Buffer.allocUnsafe(size).fill(fill)`_will_ use the internal`Buffer` pool if `size` is less - * than or equal to half `Buffer.poolSize`. The - * difference is subtle but can be important when an application requires the - * additional performance that `Buffer.allocUnsafe()` provides. - * @since v5.10.0 - * @param size The desired length of the new `Buffer`. - */ - allocUnsafe(size: number): Buffer; - /** - * Allocates a new `Buffer` of `size` bytes. If `size` is larger than {@link constants.MAX_LENGTH} or smaller than 0, `ERR_INVALID_ARG_VALUE` is thrown. A zero-length `Buffer` is created - * if `size` is 0. - * - * The underlying memory for `Buffer` instances created in this way is _not_ - * _initialized_. The contents of the newly created `Buffer` are unknown and _may contain sensitive data_. Use `buf.fill(0)` to initialize - * such `Buffer` instances with zeroes. - * - * When using `Buffer.allocUnsafe()` to allocate new `Buffer` instances, - * allocations under 4 KB are sliced from a single pre-allocated `Buffer`. This - * allows applications to avoid the garbage collection overhead of creating many - * individually allocated `Buffer` instances. This approach improves both - * performance and memory usage by eliminating the need to track and clean up as - * many individual `ArrayBuffer` objects. - * - * However, in the case where a developer may need to retain a small chunk of - * memory from a pool for an indeterminate amount of time, it may be appropriate - * to create an un-pooled `Buffer` instance using `Buffer.allocUnsafeSlow()` and - * then copying out the relevant bits. - * - * ```js - * import { Buffer } from 'buffer'; - * - * // Need to keep around a few small chunks of memory. - * const store = []; - * - * socket.on('readable', () => { - * let data; - * while (null !== (data = readable.read())) { - * // Allocate for retained data. - * const sb = Buffer.allocUnsafeSlow(10); - * - * // Copy the data into the new allocation. - * data.copy(sb, 0, 0, 10); - * - * store.push(sb); - * } - * }); - * ``` - * - * A `TypeError` will be thrown if `size` is not a number. - * @since v5.12.0 - * @param size The desired length of the new `Buffer`. - */ - allocUnsafeSlow(size: number): Buffer; - /** - * This is the size (in bytes) of pre-allocated internal `Buffer` instances used - * for pooling. This value may be modified. - * @since v0.11.3 - */ - poolSize: number; - } - interface Buffer extends Uint8Array { - /** - * Writes `string` to `buf` at `offset` according to the character encoding in`encoding`. The `length` parameter is the number of bytes to write. If `buf` did - * not contain enough space to fit the entire string, only part of `string` will be - * written. However, partially encoded characters will not be written. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.alloc(256); - * - * const len = buf.write('\u00bd + \u00bc = \u00be', 0); - * - * console.log(`${len} bytes: ${buf.toString('utf8', 0, len)}`); - * // Prints: 12 bytes: ½ + ¼ = ¾ - * - * const buffer = Buffer.alloc(10); - * - * const length = buffer.write('abcd', 8); - * - * console.log(`${length} bytes: ${buffer.toString('utf8', 8, 10)}`); - * // Prints: 2 bytes : ab - * ``` - * @since v0.1.90 - * @param string String to write to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write `string`. - * @param [length=buf.length - offset] Maximum number of bytes to write (written bytes will not exceed `buf.length - offset`). - * @param [encoding='utf8'] The character encoding of `string`. - * @return Number of bytes written. - */ - write(string: string, encoding?: BufferEncoding): number; - write(string: string, offset: number, encoding?: BufferEncoding): number; - write(string: string, offset: number, length: number, encoding?: BufferEncoding): number; - /** - * Decodes `buf` to a string according to the specified character encoding in`encoding`. `start` and `end` may be passed to decode only a subset of `buf`. - * - * If `encoding` is `'utf8'` and a byte sequence in the input is not valid UTF-8, - * then each invalid byte is replaced with the replacement character `U+FFFD`. - * - * The maximum length of a string instance (in UTF-16 code units) is available - * as {@link constants.MAX_STRING_LENGTH}. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf1 = Buffer.allocUnsafe(26); - * - * for (let i = 0; i < 26; i++) { - * // 97 is the decimal ASCII value for 'a'. - * buf1[i] = i + 97; - * } - * - * console.log(buf1.toString('utf8')); - * // Prints: abcdefghijklmnopqrstuvwxyz - * console.log(buf1.toString('utf8', 0, 5)); - * // Prints: abcde - * - * const buf2 = Buffer.from('tést'); - * - * console.log(buf2.toString('hex')); - * // Prints: 74c3a97374 - * console.log(buf2.toString('utf8', 0, 3)); - * // Prints: té - * console.log(buf2.toString(undefined, 0, 3)); - * // Prints: té - * ``` - * @since v0.1.90 - * @param [encoding='utf8'] The character encoding to use. - * @param [start=0] The byte offset to start decoding at. - * @param [end=buf.length] The byte offset to stop decoding at (not inclusive). - */ - toString(encoding?: BufferEncoding, start?: number, end?: number): string; - /** - * Returns a JSON representation of `buf`. [`JSON.stringify()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify) implicitly calls - * this function when stringifying a `Buffer` instance. - * - * `Buffer.from()` accepts objects in the format returned from this method. - * In particular, `Buffer.from(buf.toJSON())` works like `Buffer.from(buf)`. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.from([0x1, 0x2, 0x3, 0x4, 0x5]); - * const json = JSON.stringify(buf); - * - * console.log(json); - * // Prints: {"type":"Buffer","data":[1,2,3,4,5]} - * - * const copy = JSON.parse(json, (key, value) => { - * return value && value.type === 'Buffer' ? - * Buffer.from(value) : - * value; - * }); - * - * console.log(copy); - * // Prints: - * ``` - * @since v0.9.2 - */ - toJSON(): { - type: 'Buffer'; - data: number[]; - }; - /** - * Returns `true` if both `buf` and `otherBuffer` have exactly the same bytes,`false` otherwise. Equivalent to `buf.compare(otherBuffer) === 0`. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf1 = Buffer.from('ABC'); - * const buf2 = Buffer.from('414243', 'hex'); - * const buf3 = Buffer.from('ABCD'); - * - * console.log(buf1.equals(buf2)); - * // Prints: true - * console.log(buf1.equals(buf3)); - * // Prints: false - * ``` - * @since v0.11.13 - * @param otherBuffer A `Buffer` or {@link Uint8Array} with which to compare `buf`. - */ - equals(otherBuffer: Uint8Array): boolean; - /** - * Compares `buf` with `target` and returns a number indicating whether `buf`comes before, after, or is the same as `target` in sort order. - * Comparison is based on the actual sequence of bytes in each `Buffer`. - * - * * `0` is returned if `target` is the same as `buf` - * * `1` is returned if `target` should come _before_`buf` when sorted. - * * `-1` is returned if `target` should come _after_`buf` when sorted. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf1 = Buffer.from('ABC'); - * const buf2 = Buffer.from('BCD'); - * const buf3 = Buffer.from('ABCD'); - * - * console.log(buf1.compare(buf1)); - * // Prints: 0 - * console.log(buf1.compare(buf2)); - * // Prints: -1 - * console.log(buf1.compare(buf3)); - * // Prints: -1 - * console.log(buf2.compare(buf1)); - * // Prints: 1 - * console.log(buf2.compare(buf3)); - * // Prints: 1 - * console.log([buf1, buf2, buf3].sort(Buffer.compare)); - * // Prints: [ , , ] - * // (This result is equal to: [buf1, buf3, buf2].) - * ``` - * - * The optional `targetStart`, `targetEnd`, `sourceStart`, and `sourceEnd`arguments can be used to limit the comparison to specific ranges within `target`and `buf` respectively. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf1 = Buffer.from([1, 2, 3, 4, 5, 6, 7, 8, 9]); - * const buf2 = Buffer.from([5, 6, 7, 8, 9, 1, 2, 3, 4]); - * - * console.log(buf1.compare(buf2, 5, 9, 0, 4)); - * // Prints: 0 - * console.log(buf1.compare(buf2, 0, 6, 4)); - * // Prints: -1 - * console.log(buf1.compare(buf2, 5, 6, 5)); - * // Prints: 1 - * ``` - * - * `ERR_OUT_OF_RANGE` is thrown if `targetStart < 0`, `sourceStart < 0`,`targetEnd > target.byteLength`, or `sourceEnd > source.byteLength`. - * @since v0.11.13 - * @param target A `Buffer` or {@link Uint8Array} with which to compare `buf`. - * @param [targetStart=0] The offset within `target` at which to begin comparison. - * @param [targetEnd=target.length] The offset within `target` at which to end comparison (not inclusive). - * @param [sourceStart=0] The offset within `buf` at which to begin comparison. - * @param [sourceEnd=buf.length] The offset within `buf` at which to end comparison (not inclusive). - */ - compare(target: Uint8Array, targetStart?: number, targetEnd?: number, sourceStart?: number, sourceEnd?: number): -1 | 0 | 1; - /** - * Copies data from a region of `buf` to a region in `target`, even if the `target`memory region overlaps with `buf`. - * - * [`TypedArray.prototype.set()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set) performs the same operation, and is available - * for all TypedArrays, including Node.js `Buffer`s, although it takes - * different function arguments. - * - * ```js - * import { Buffer } from 'buffer'; - * - * // Create two `Buffer` instances. - * const buf1 = Buffer.allocUnsafe(26); - * const buf2 = Buffer.allocUnsafe(26).fill('!'); - * - * for (let i = 0; i < 26; i++) { - * // 97 is the decimal ASCII value for 'a'. - * buf1[i] = i + 97; - * } - * - * // Copy `buf1` bytes 16 through 19 into `buf2` starting at byte 8 of `buf2`. - * buf1.copy(buf2, 8, 16, 20); - * // This is equivalent to: - * // buf2.set(buf1.subarray(16, 20), 8); - * - * console.log(buf2.toString('ascii', 0, 25)); - * // Prints: !!!!!!!!qrst!!!!!!!!!!!!! - * ``` - * - * ```js - * import { Buffer } from 'buffer'; - * - * // Create a `Buffer` and copy data from one region to an overlapping region - * // within the same `Buffer`. - * - * const buf = Buffer.allocUnsafe(26); - * - * for (let i = 0; i < 26; i++) { - * // 97 is the decimal ASCII value for 'a'. - * buf[i] = i + 97; - * } - * - * buf.copy(buf, 0, 4, 10); - * - * console.log(buf.toString()); - * // Prints: efghijghijklmnopqrstuvwxyz - * ``` - * @since v0.1.90 - * @param target A `Buffer` or {@link Uint8Array} to copy into. - * @param [targetStart=0] The offset within `target` at which to begin writing. - * @param [sourceStart=0] The offset within `buf` from which to begin copying. - * @param [sourceEnd=buf.length] The offset within `buf` at which to stop copying (not inclusive). - * @return The number of bytes copied. - */ - copy(target: Uint8Array, targetStart?: number, sourceStart?: number, sourceEnd?: number): number; - /** - * Returns a new `Buffer` that references the same memory as the original, but - * offset and cropped by the `start` and `end` indices. - * - * This method is not compatible with the `Uint8Array.prototype.slice()`, - * which is a superclass of `Buffer`. To copy the slice, use`Uint8Array.prototype.slice()`. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.from('buffer'); - * - * const copiedBuf = Uint8Array.prototype.slice.call(buf); - * copiedBuf[0]++; - * console.log(copiedBuf.toString()); - * // Prints: cuffer - * - * console.log(buf.toString()); - * // Prints: buffer - * - * // With buf.slice(), the original buffer is modified. - * const notReallyCopiedBuf = buf.slice(); - * notReallyCopiedBuf[0]++; - * console.log(notReallyCopiedBuf.toString()); - * // Prints: cuffer - * console.log(buf.toString()); - * // Also prints: cuffer (!) - * ``` - * @since v0.3.0 - * @deprecated Use `subarray` instead. - * @param [start=0] Where the new `Buffer` will start. - * @param [end=buf.length] Where the new `Buffer` will end (not inclusive). - */ - slice(start?: number, end?: number): Buffer; - /** - * Returns a new `Buffer` that references the same memory as the original, but - * offset and cropped by the `start` and `end` indices. - * - * Specifying `end` greater than `buf.length` will return the same result as - * that of `end` equal to `buf.length`. - * - * This method is inherited from [`TypedArray.prototype.subarray()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/subarray). - * - * Modifying the new `Buffer` slice will modify the memory in the original `Buffer`because the allocated memory of the two objects overlap. - * - * ```js - * import { Buffer } from 'buffer'; - * - * // Create a `Buffer` with the ASCII alphabet, take a slice, and modify one byte - * // from the original `Buffer`. - * - * const buf1 = Buffer.allocUnsafe(26); - * - * for (let i = 0; i < 26; i++) { - * // 97 is the decimal ASCII value for 'a'. - * buf1[i] = i + 97; - * } - * - * const buf2 = buf1.subarray(0, 3); - * - * console.log(buf2.toString('ascii', 0, buf2.length)); - * // Prints: abc - * - * buf1[0] = 33; - * - * console.log(buf2.toString('ascii', 0, buf2.length)); - * // Prints: !bc - * ``` - * - * Specifying negative indexes causes the slice to be generated relative to the - * end of `buf` rather than the beginning. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.from('buffer'); - * - * console.log(buf.subarray(-6, -1).toString()); - * // Prints: buffe - * // (Equivalent to buf.subarray(0, 5).) - * - * console.log(buf.subarray(-6, -2).toString()); - * // Prints: buff - * // (Equivalent to buf.subarray(0, 4).) - * - * console.log(buf.subarray(-5, -2).toString()); - * // Prints: uff - * // (Equivalent to buf.subarray(1, 4).) - * ``` - * @since v3.0.0 - * @param [start=0] Where the new `Buffer` will start. - * @param [end=buf.length] Where the new `Buffer` will end (not inclusive). - */ - subarray(start?: number, end?: number): Buffer; - /** - * Writes `value` to `buf` at the specified `offset` as big-endian. - * - * `value` is interpreted and written as a two's complement signed integer. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.allocUnsafe(8); - * - * buf.writeBigInt64BE(0x0102030405060708n, 0); - * - * console.log(buf); - * // Prints: - * ``` - * @since v12.0.0, v10.20.0 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy: `0 <= offset <= buf.length - 8`. - * @return `offset` plus the number of bytes written. - */ - writeBigInt64BE(value: bigint, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as little-endian. - * - * `value` is interpreted and written as a two's complement signed integer. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.allocUnsafe(8); - * - * buf.writeBigInt64LE(0x0102030405060708n, 0); - * - * console.log(buf); - * // Prints: - * ``` - * @since v12.0.0, v10.20.0 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy: `0 <= offset <= buf.length - 8`. - * @return `offset` plus the number of bytes written. - */ - writeBigInt64LE(value: bigint, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as big-endian. - * - * This function is also available under the `writeBigUint64BE` alias. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.allocUnsafe(8); - * - * buf.writeBigUInt64BE(0xdecafafecacefaden, 0); - * - * console.log(buf); - * // Prints: - * ``` - * @since v12.0.0, v10.20.0 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy: `0 <= offset <= buf.length - 8`. - * @return `offset` plus the number of bytes written. - */ - writeBigUInt64BE(value: bigint, offset?: number): number; - /** - * @alias Buffer.writeBigUInt64BE - * @since v14.10.0, v12.19.0 - */ - writeBigUint64BE(value: bigint, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as little-endian - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.allocUnsafe(8); - * - * buf.writeBigUInt64LE(0xdecafafecacefaden, 0); - * - * console.log(buf); - * // Prints: - * ``` - * - * This function is also available under the `writeBigUint64LE` alias. - * @since v12.0.0, v10.20.0 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy: `0 <= offset <= buf.length - 8`. - * @return `offset` plus the number of bytes written. - */ - writeBigUInt64LE(value: bigint, offset?: number): number; - /** - * @alias Buffer.writeBigUInt64LE - * @since v14.10.0, v12.19.0 - */ - writeBigUint64LE(value: bigint, offset?: number): number; - /** - * Writes `byteLength` bytes of `value` to `buf` at the specified `offset`as little-endian. Supports up to 48 bits of accuracy. Behavior is undefined - * when `value` is anything other than an unsigned integer. - * - * This function is also available under the `writeUintLE` alias. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.allocUnsafe(6); - * - * buf.writeUIntLE(0x1234567890ab, 0, 6); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.5.5 - * @param value Number to be written to `buf`. - * @param offset Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - byteLength`. - * @param byteLength Number of bytes to write. Must satisfy `0 < byteLength <= 6`. - * @return `offset` plus the number of bytes written. - */ - writeUIntLE(value: number, offset: number, byteLength: number): number; - /** - * @alias Buffer.writeUIntLE - * @since v14.9.0, v12.19.0 - */ - writeUintLE(value: number, offset: number, byteLength: number): number; - /** - * Writes `byteLength` bytes of `value` to `buf` at the specified `offset`as big-endian. Supports up to 48 bits of accuracy. Behavior is undefined - * when `value` is anything other than an unsigned integer. - * - * This function is also available under the `writeUintBE` alias. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.allocUnsafe(6); - * - * buf.writeUIntBE(0x1234567890ab, 0, 6); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.5.5 - * @param value Number to be written to `buf`. - * @param offset Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - byteLength`. - * @param byteLength Number of bytes to write. Must satisfy `0 < byteLength <= 6`. - * @return `offset` plus the number of bytes written. - */ - writeUIntBE(value: number, offset: number, byteLength: number): number; - /** - * @alias Buffer.writeUIntBE - * @since v14.9.0, v12.19.0 - */ - writeUintBE(value: number, offset: number, byteLength: number): number; - /** - * Writes `byteLength` bytes of `value` to `buf` at the specified `offset`as little-endian. Supports up to 48 bits of accuracy. Behavior is undefined - * when `value` is anything other than a signed integer. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.allocUnsafe(6); - * - * buf.writeIntLE(0x1234567890ab, 0, 6); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.11.15 - * @param value Number to be written to `buf`. - * @param offset Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - byteLength`. - * @param byteLength Number of bytes to write. Must satisfy `0 < byteLength <= 6`. - * @return `offset` plus the number of bytes written. - */ - writeIntLE(value: number, offset: number, byteLength: number): number; - /** - * Writes `byteLength` bytes of `value` to `buf` at the specified `offset`as big-endian. Supports up to 48 bits of accuracy. Behavior is undefined when`value` is anything other than a - * signed integer. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.allocUnsafe(6); - * - * buf.writeIntBE(0x1234567890ab, 0, 6); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.11.15 - * @param value Number to be written to `buf`. - * @param offset Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - byteLength`. - * @param byteLength Number of bytes to write. Must satisfy `0 < byteLength <= 6`. - * @return `offset` plus the number of bytes written. - */ - writeIntBE(value: number, offset: number, byteLength: number): number; - /** - * Reads an unsigned, big-endian 64-bit integer from `buf` at the specified`offset`. - * - * This function is also available under the `readBigUint64BE` alias. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.from([0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff]); - * - * console.log(buf.readBigUInt64BE(0)); - * // Prints: 4294967295n - * ``` - * @since v12.0.0, v10.20.0 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy: `0 <= offset <= buf.length - 8`. - */ - readBigUInt64BE(offset?: number): bigint; - /** - * @alias Buffer.readBigUInt64BE - * @since v14.10.0, v12.19.0 - */ - readBigUint64BE(offset?: number): bigint; - /** - * Reads an unsigned, little-endian 64-bit integer from `buf` at the specified`offset`. - * - * This function is also available under the `readBigUint64LE` alias. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.from([0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff]); - * - * console.log(buf.readBigUInt64LE(0)); - * // Prints: 18446744069414584320n - * ``` - * @since v12.0.0, v10.20.0 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy: `0 <= offset <= buf.length - 8`. - */ - readBigUInt64LE(offset?: number): bigint; - /** - * @alias Buffer.readBigUInt64LE - * @since v14.10.0, v12.19.0 - */ - readBigUint64LE(offset?: number): bigint; - /** - * Reads a signed, big-endian 64-bit integer from `buf` at the specified `offset`. - * - * Integers read from a `Buffer` are interpreted as two's complement signed - * values. - * @since v12.0.0, v10.20.0 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy: `0 <= offset <= buf.length - 8`. - */ - readBigInt64BE(offset?: number): bigint; - /** - * Reads a signed, little-endian 64-bit integer from `buf` at the specified`offset`. - * - * Integers read from a `Buffer` are interpreted as two's complement signed - * values. - * @since v12.0.0, v10.20.0 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy: `0 <= offset <= buf.length - 8`. - */ - readBigInt64LE(offset?: number): bigint; - /** - * Reads `byteLength` number of bytes from `buf` at the specified `offset`and interprets the result as an unsigned, little-endian integer supporting - * up to 48 bits of accuracy. - * - * This function is also available under the `readUintLE` alias. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.from([0x12, 0x34, 0x56, 0x78, 0x90, 0xab]); - * - * console.log(buf.readUIntLE(0, 6).toString(16)); - * // Prints: ab9078563412 - * ``` - * @since v0.11.15 - * @param offset Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - byteLength`. - * @param byteLength Number of bytes to read. Must satisfy `0 < byteLength <= 6`. - */ - readUIntLE(offset: number, byteLength: number): number; - /** - * @alias Buffer.readUIntLE - * @since v14.9.0, v12.19.0 - */ - readUintLE(offset: number, byteLength: number): number; - /** - * Reads `byteLength` number of bytes from `buf` at the specified `offset`and interprets the result as an unsigned big-endian integer supporting - * up to 48 bits of accuracy. - * - * This function is also available under the `readUintBE` alias. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.from([0x12, 0x34, 0x56, 0x78, 0x90, 0xab]); - * - * console.log(buf.readUIntBE(0, 6).toString(16)); - * // Prints: 1234567890ab - * console.log(buf.readUIntBE(1, 6).toString(16)); - * // Throws ERR_OUT_OF_RANGE. - * ``` - * @since v0.11.15 - * @param offset Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - byteLength`. - * @param byteLength Number of bytes to read. Must satisfy `0 < byteLength <= 6`. - */ - readUIntBE(offset: number, byteLength: number): number; - /** - * @alias Buffer.readUIntBE - * @since v14.9.0, v12.19.0 - */ - readUintBE(offset: number, byteLength: number): number; - /** - * Reads `byteLength` number of bytes from `buf` at the specified `offset`and interprets the result as a little-endian, two's complement signed value - * supporting up to 48 bits of accuracy. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.from([0x12, 0x34, 0x56, 0x78, 0x90, 0xab]); - * - * console.log(buf.readIntLE(0, 6).toString(16)); - * // Prints: -546f87a9cbee - * ``` - * @since v0.11.15 - * @param offset Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - byteLength`. - * @param byteLength Number of bytes to read. Must satisfy `0 < byteLength <= 6`. - */ - readIntLE(offset: number, byteLength: number): number; - /** - * Reads `byteLength` number of bytes from `buf` at the specified `offset`and interprets the result as a big-endian, two's complement signed value - * supporting up to 48 bits of accuracy. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.from([0x12, 0x34, 0x56, 0x78, 0x90, 0xab]); - * - * console.log(buf.readIntBE(0, 6).toString(16)); - * // Prints: 1234567890ab - * console.log(buf.readIntBE(1, 6).toString(16)); - * // Throws ERR_OUT_OF_RANGE. - * console.log(buf.readIntBE(1, 0).toString(16)); - * // Throws ERR_OUT_OF_RANGE. - * ``` - * @since v0.11.15 - * @param offset Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - byteLength`. - * @param byteLength Number of bytes to read. Must satisfy `0 < byteLength <= 6`. - */ - readIntBE(offset: number, byteLength: number): number; - /** - * Reads an unsigned 8-bit integer from `buf` at the specified `offset`. - * - * This function is also available under the `readUint8` alias. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.from([1, -2]); - * - * console.log(buf.readUInt8(0)); - * // Prints: 1 - * console.log(buf.readUInt8(1)); - * // Prints: 254 - * console.log(buf.readUInt8(2)); - * // Throws ERR_OUT_OF_RANGE. - * ``` - * @since v0.5.0 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 1`. - */ - readUInt8(offset?: number): number; - /** - * @alias Buffer.readUInt8 - * @since v14.9.0, v12.19.0 - */ - readUint8(offset?: number): number; - /** - * Reads an unsigned, little-endian 16-bit integer from `buf` at the specified`offset`. - * - * This function is also available under the `readUint16LE` alias. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.from([0x12, 0x34, 0x56]); - * - * console.log(buf.readUInt16LE(0).toString(16)); - * // Prints: 3412 - * console.log(buf.readUInt16LE(1).toString(16)); - * // Prints: 5634 - * console.log(buf.readUInt16LE(2).toString(16)); - * // Throws ERR_OUT_OF_RANGE. - * ``` - * @since v0.5.5 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 2`. - */ - readUInt16LE(offset?: number): number; - /** - * @alias Buffer.readUInt16LE - * @since v14.9.0, v12.19.0 - */ - readUint16LE(offset?: number): number; - /** - * Reads an unsigned, big-endian 16-bit integer from `buf` at the specified`offset`. - * - * This function is also available under the `readUint16BE` alias. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.from([0x12, 0x34, 0x56]); - * - * console.log(buf.readUInt16BE(0).toString(16)); - * // Prints: 1234 - * console.log(buf.readUInt16BE(1).toString(16)); - * // Prints: 3456 - * ``` - * @since v0.5.5 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 2`. - */ - readUInt16BE(offset?: number): number; - /** - * @alias Buffer.readUInt16BE - * @since v14.9.0, v12.19.0 - */ - readUint16BE(offset?: number): number; - /** - * Reads an unsigned, little-endian 32-bit integer from `buf` at the specified`offset`. - * - * This function is also available under the `readUint32LE` alias. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.from([0x12, 0x34, 0x56, 0x78]); - * - * console.log(buf.readUInt32LE(0).toString(16)); - * // Prints: 78563412 - * console.log(buf.readUInt32LE(1).toString(16)); - * // Throws ERR_OUT_OF_RANGE. - * ``` - * @since v0.5.5 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`. - */ - readUInt32LE(offset?: number): number; - /** - * @alias Buffer.readUInt32LE - * @since v14.9.0, v12.19.0 - */ - readUint32LE(offset?: number): number; - /** - * Reads an unsigned, big-endian 32-bit integer from `buf` at the specified`offset`. - * - * This function is also available under the `readUint32BE` alias. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.from([0x12, 0x34, 0x56, 0x78]); - * - * console.log(buf.readUInt32BE(0).toString(16)); - * // Prints: 12345678 - * ``` - * @since v0.5.5 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`. - */ - readUInt32BE(offset?: number): number; - /** - * @alias Buffer.readUInt32BE - * @since v14.9.0, v12.19.0 - */ - readUint32BE(offset?: number): number; - /** - * Reads a signed 8-bit integer from `buf` at the specified `offset`. - * - * Integers read from a `Buffer` are interpreted as two's complement signed values. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.from([-1, 5]); - * - * console.log(buf.readInt8(0)); - * // Prints: -1 - * console.log(buf.readInt8(1)); - * // Prints: 5 - * console.log(buf.readInt8(2)); - * // Throws ERR_OUT_OF_RANGE. - * ``` - * @since v0.5.0 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 1`. - */ - readInt8(offset?: number): number; - /** - * Reads a signed, little-endian 16-bit integer from `buf` at the specified`offset`. - * - * Integers read from a `Buffer` are interpreted as two's complement signed values. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.from([0, 5]); - * - * console.log(buf.readInt16LE(0)); - * // Prints: 1280 - * console.log(buf.readInt16LE(1)); - * // Throws ERR_OUT_OF_RANGE. - * ``` - * @since v0.5.5 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 2`. - */ - readInt16LE(offset?: number): number; - /** - * Reads a signed, big-endian 16-bit integer from `buf` at the specified `offset`. - * - * Integers read from a `Buffer` are interpreted as two's complement signed values. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.from([0, 5]); - * - * console.log(buf.readInt16BE(0)); - * // Prints: 5 - * ``` - * @since v0.5.5 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 2`. - */ - readInt16BE(offset?: number): number; - /** - * Reads a signed, little-endian 32-bit integer from `buf` at the specified`offset`. - * - * Integers read from a `Buffer` are interpreted as two's complement signed values. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.from([0, 0, 0, 5]); - * - * console.log(buf.readInt32LE(0)); - * // Prints: 83886080 - * console.log(buf.readInt32LE(1)); - * // Throws ERR_OUT_OF_RANGE. - * ``` - * @since v0.5.5 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`. - */ - readInt32LE(offset?: number): number; - /** - * Reads a signed, big-endian 32-bit integer from `buf` at the specified `offset`. - * - * Integers read from a `Buffer` are interpreted as two's complement signed values. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.from([0, 0, 0, 5]); - * - * console.log(buf.readInt32BE(0)); - * // Prints: 5 - * ``` - * @since v0.5.5 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`. - */ - readInt32BE(offset?: number): number; - /** - * Reads a 32-bit, little-endian float from `buf` at the specified `offset`. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.from([1, 2, 3, 4]); - * - * console.log(buf.readFloatLE(0)); - * // Prints: 1.539989614439558e-36 - * console.log(buf.readFloatLE(1)); - * // Throws ERR_OUT_OF_RANGE. - * ``` - * @since v0.11.15 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`. - */ - readFloatLE(offset?: number): number; - /** - * Reads a 32-bit, big-endian float from `buf` at the specified `offset`. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.from([1, 2, 3, 4]); - * - * console.log(buf.readFloatBE(0)); - * // Prints: 2.387939260590663e-38 - * ``` - * @since v0.11.15 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`. - */ - readFloatBE(offset?: number): number; - /** - * Reads a 64-bit, little-endian double from `buf` at the specified `offset`. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.from([1, 2, 3, 4, 5, 6, 7, 8]); - * - * console.log(buf.readDoubleLE(0)); - * // Prints: 5.447603722011605e-270 - * console.log(buf.readDoubleLE(1)); - * // Throws ERR_OUT_OF_RANGE. - * ``` - * @since v0.11.15 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 8`. - */ - readDoubleLE(offset?: number): number; - /** - * Reads a 64-bit, big-endian double from `buf` at the specified `offset`. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.from([1, 2, 3, 4, 5, 6, 7, 8]); - * - * console.log(buf.readDoubleBE(0)); - * // Prints: 8.20788039913184e-304 - * ``` - * @since v0.11.15 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 8`. - */ - readDoubleBE(offset?: number): number; - reverse(): this; - /** - * Interprets `buf` as an array of unsigned 16-bit integers and swaps the - * byte order _in-place_. Throws `ERR_INVALID_BUFFER_SIZE` if `buf.length` is not a multiple of 2. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf1 = Buffer.from([0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8]); - * - * console.log(buf1); - * // Prints: - * - * buf1.swap16(); - * - * console.log(buf1); - * // Prints: - * - * const buf2 = Buffer.from([0x1, 0x2, 0x3]); - * - * buf2.swap16(); - * // Throws ERR_INVALID_BUFFER_SIZE. - * ``` - * - * One convenient use of `buf.swap16()` is to perform a fast in-place conversion - * between UTF-16 little-endian and UTF-16 big-endian: - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.from('This is little-endian UTF-16', 'utf16le'); - * buf.swap16(); // Convert to big-endian UTF-16 text. - * ``` - * @since v5.10.0 - * @return A reference to `buf`. - */ - swap16(): Buffer; - /** - * Interprets `buf` as an array of unsigned 32-bit integers and swaps the - * byte order _in-place_. Throws `ERR_INVALID_BUFFER_SIZE` if `buf.length` is not a multiple of 4. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf1 = Buffer.from([0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8]); - * - * console.log(buf1); - * // Prints: - * - * buf1.swap32(); - * - * console.log(buf1); - * // Prints: - * - * const buf2 = Buffer.from([0x1, 0x2, 0x3]); - * - * buf2.swap32(); - * // Throws ERR_INVALID_BUFFER_SIZE. - * ``` - * @since v5.10.0 - * @return A reference to `buf`. - */ - swap32(): Buffer; - /** - * Interprets `buf` as an array of 64-bit numbers and swaps byte order _in-place_. - * Throws `ERR_INVALID_BUFFER_SIZE` if `buf.length` is not a multiple of 8. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf1 = Buffer.from([0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8]); - * - * console.log(buf1); - * // Prints: - * - * buf1.swap64(); - * - * console.log(buf1); - * // Prints: - * - * const buf2 = Buffer.from([0x1, 0x2, 0x3]); - * - * buf2.swap64(); - * // Throws ERR_INVALID_BUFFER_SIZE. - * ``` - * @since v6.3.0 - * @return A reference to `buf`. - */ - swap64(): Buffer; - /** - * Writes `value` to `buf` at the specified `offset`. `value` must be a - * valid unsigned 8-bit integer. Behavior is undefined when `value` is anything - * other than an unsigned 8-bit integer. - * - * This function is also available under the `writeUint8` alias. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.allocUnsafe(4); - * - * buf.writeUInt8(0x3, 0); - * buf.writeUInt8(0x4, 1); - * buf.writeUInt8(0x23, 2); - * buf.writeUInt8(0x42, 3); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.5.0 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 1`. - * @return `offset` plus the number of bytes written. - */ - writeUInt8(value: number, offset?: number): number; - /** - * @alias Buffer.writeUInt8 - * @since v14.9.0, v12.19.0 - */ - writeUint8(value: number, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as little-endian. The `value`must be a valid unsigned 16-bit integer. Behavior is undefined when `value` is - * anything other than an unsigned 16-bit integer. - * - * This function is also available under the `writeUint16LE` alias. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.allocUnsafe(4); - * - * buf.writeUInt16LE(0xdead, 0); - * buf.writeUInt16LE(0xbeef, 2); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.5.5 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 2`. - * @return `offset` plus the number of bytes written. - */ - writeUInt16LE(value: number, offset?: number): number; - /** - * @alias Buffer.writeUInt16LE - * @since v14.9.0, v12.19.0 - */ - writeUint16LE(value: number, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as big-endian. The `value`must be a valid unsigned 16-bit integer. Behavior is undefined when `value`is anything other than an - * unsigned 16-bit integer. - * - * This function is also available under the `writeUint16BE` alias. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.allocUnsafe(4); - * - * buf.writeUInt16BE(0xdead, 0); - * buf.writeUInt16BE(0xbeef, 2); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.5.5 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 2`. - * @return `offset` plus the number of bytes written. - */ - writeUInt16BE(value: number, offset?: number): number; - /** - * @alias Buffer.writeUInt16BE - * @since v14.9.0, v12.19.0 - */ - writeUint16BE(value: number, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as little-endian. The `value`must be a valid unsigned 32-bit integer. Behavior is undefined when `value` is - * anything other than an unsigned 32-bit integer. - * - * This function is also available under the `writeUint32LE` alias. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.allocUnsafe(4); - * - * buf.writeUInt32LE(0xfeedface, 0); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.5.5 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`. - * @return `offset` plus the number of bytes written. - */ - writeUInt32LE(value: number, offset?: number): number; - /** - * @alias Buffer.writeUInt32LE - * @since v14.9.0, v12.19.0 - */ - writeUint32LE(value: number, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as big-endian. The `value`must be a valid unsigned 32-bit integer. Behavior is undefined when `value`is anything other than an - * unsigned 32-bit integer. - * - * This function is also available under the `writeUint32BE` alias. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.allocUnsafe(4); - * - * buf.writeUInt32BE(0xfeedface, 0); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.5.5 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`. - * @return `offset` plus the number of bytes written. - */ - writeUInt32BE(value: number, offset?: number): number; - /** - * @alias Buffer.writeUInt32BE - * @since v14.9.0, v12.19.0 - */ - writeUint32BE(value: number, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset`. `value` must be a valid - * signed 8-bit integer. Behavior is undefined when `value` is anything other than - * a signed 8-bit integer. - * - * `value` is interpreted and written as a two's complement signed integer. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.allocUnsafe(2); - * - * buf.writeInt8(2, 0); - * buf.writeInt8(-2, 1); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.5.0 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 1`. - * @return `offset` plus the number of bytes written. - */ - writeInt8(value: number, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as little-endian. The `value`must be a valid signed 16-bit integer. Behavior is undefined when `value` is - * anything other than a signed 16-bit integer. - * - * The `value` is interpreted and written as a two's complement signed integer. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.allocUnsafe(2); - * - * buf.writeInt16LE(0x0304, 0); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.5.5 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 2`. - * @return `offset` plus the number of bytes written. - */ - writeInt16LE(value: number, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as big-endian. The `value`must be a valid signed 16-bit integer. Behavior is undefined when `value` is - * anything other than a signed 16-bit integer. - * - * The `value` is interpreted and written as a two's complement signed integer. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.allocUnsafe(2); - * - * buf.writeInt16BE(0x0102, 0); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.5.5 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 2`. - * @return `offset` plus the number of bytes written. - */ - writeInt16BE(value: number, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as little-endian. The `value`must be a valid signed 32-bit integer. Behavior is undefined when `value` is - * anything other than a signed 32-bit integer. - * - * The `value` is interpreted and written as a two's complement signed integer. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.allocUnsafe(4); - * - * buf.writeInt32LE(0x05060708, 0); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.5.5 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`. - * @return `offset` plus the number of bytes written. - */ - writeInt32LE(value: number, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as big-endian. The `value`must be a valid signed 32-bit integer. Behavior is undefined when `value` is - * anything other than a signed 32-bit integer. - * - * The `value` is interpreted and written as a two's complement signed integer. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.allocUnsafe(4); - * - * buf.writeInt32BE(0x01020304, 0); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.5.5 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`. - * @return `offset` plus the number of bytes written. - */ - writeInt32BE(value: number, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as little-endian. Behavior is - * undefined when `value` is anything other than a JavaScript number. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.allocUnsafe(4); - * - * buf.writeFloatLE(0xcafebabe, 0); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.11.15 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`. - * @return `offset` plus the number of bytes written. - */ - writeFloatLE(value: number, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as big-endian. Behavior is - * undefined when `value` is anything other than a JavaScript number. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.allocUnsafe(4); - * - * buf.writeFloatBE(0xcafebabe, 0); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.11.15 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`. - * @return `offset` plus the number of bytes written. - */ - writeFloatBE(value: number, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as little-endian. The `value`must be a JavaScript number. Behavior is undefined when `value` is anything - * other than a JavaScript number. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.allocUnsafe(8); - * - * buf.writeDoubleLE(123.456, 0); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.11.15 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 8`. - * @return `offset` plus the number of bytes written. - */ - writeDoubleLE(value: number, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as big-endian. The `value`must be a JavaScript number. Behavior is undefined when `value` is anything - * other than a JavaScript number. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.allocUnsafe(8); - * - * buf.writeDoubleBE(123.456, 0); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.11.15 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 8`. - * @return `offset` plus the number of bytes written. - */ - writeDoubleBE(value: number, offset?: number): number; - /** - * Fills `buf` with the specified `value`. If the `offset` and `end` are not given, - * the entire `buf` will be filled: - * - * ```js - * import { Buffer } from 'buffer'; - * - * // Fill a `Buffer` with the ASCII character 'h'. - * - * const b = Buffer.allocUnsafe(50).fill('h'); - * - * console.log(b.toString()); - * // Prints: hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh - * ``` - * - * `value` is coerced to a `uint32` value if it is not a string, `Buffer`, or - * integer. If the resulting integer is greater than `255` (decimal), `buf` will be - * filled with `value & 255`. - * - * If the final write of a `fill()` operation falls on a multi-byte character, - * then only the bytes of that character that fit into `buf` are written: - * - * ```js - * import { Buffer } from 'buffer'; - * - * // Fill a `Buffer` with character that takes up two bytes in UTF-8. - * - * console.log(Buffer.allocUnsafe(5).fill('\u0222')); - * // Prints: - * ``` - * - * If `value` contains invalid characters, it is truncated; if no valid - * fill data remains, an exception is thrown: - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.allocUnsafe(5); - * - * console.log(buf.fill('a')); - * // Prints: - * console.log(buf.fill('aazz', 'hex')); - * // Prints: - * console.log(buf.fill('zz', 'hex')); - * // Throws an exception. - * ``` - * @since v0.5.0 - * @param value The value with which to fill `buf`. - * @param [offset=0] Number of bytes to skip before starting to fill `buf`. - * @param [end=buf.length] Where to stop filling `buf` (not inclusive). - * @param [encoding='utf8'] The encoding for `value` if `value` is a string. - * @return A reference to `buf`. - */ - fill(value: string | Uint8Array | number, offset?: number, end?: number, encoding?: BufferEncoding): this; - /** - * If `value` is: - * - * * a string, `value` is interpreted according to the character encoding in`encoding`. - * * a `Buffer` or [`Uint8Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array), `value` will be used in its entirety. - * To compare a partial `Buffer`, use `buf.subarray`. - * * a number, `value` will be interpreted as an unsigned 8-bit integer - * value between `0` and `255`. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.from('this is a buffer'); - * - * console.log(buf.indexOf('this')); - * // Prints: 0 - * console.log(buf.indexOf('is')); - * // Prints: 2 - * console.log(buf.indexOf(Buffer.from('a buffer'))); - * // Prints: 8 - * console.log(buf.indexOf(97)); - * // Prints: 8 (97 is the decimal ASCII value for 'a') - * console.log(buf.indexOf(Buffer.from('a buffer example'))); - * // Prints: -1 - * console.log(buf.indexOf(Buffer.from('a buffer example').slice(0, 8))); - * // Prints: 8 - * - * const utf16Buffer = Buffer.from('\u039a\u0391\u03a3\u03a3\u0395', 'utf16le'); - * - * console.log(utf16Buffer.indexOf('\u03a3', 0, 'utf16le')); - * // Prints: 4 - * console.log(utf16Buffer.indexOf('\u03a3', -4, 'utf16le')); - * // Prints: 6 - * ``` - * - * If `value` is not a string, number, or `Buffer`, this method will throw a`TypeError`. If `value` is a number, it will be coerced to a valid byte value, - * an integer between 0 and 255. - * - * If `byteOffset` is not a number, it will be coerced to a number. If the result - * of coercion is `NaN` or `0`, then the entire buffer will be searched. This - * behavior matches [`String.prototype.indexOf()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/indexOf). - * - * ```js - * import { Buffer } from 'buffer'; - * - * const b = Buffer.from('abcdef'); - * - * // Passing a value that's a number, but not a valid byte. - * // Prints: 2, equivalent to searching for 99 or 'c'. - * console.log(b.indexOf(99.9)); - * console.log(b.indexOf(256 + 99)); - * - * // Passing a byteOffset that coerces to NaN or 0. - * // Prints: 1, searching the whole buffer. - * console.log(b.indexOf('b', undefined)); - * console.log(b.indexOf('b', {})); - * console.log(b.indexOf('b', null)); - * console.log(b.indexOf('b', [])); - * ``` - * - * If `value` is an empty string or empty `Buffer` and `byteOffset` is less - * than `buf.length`, `byteOffset` will be returned. If `value` is empty and`byteOffset` is at least `buf.length`, `buf.length` will be returned. - * @since v1.5.0 - * @param value What to search for. - * @param [byteOffset=0] Where to begin searching in `buf`. If negative, then offset is calculated from the end of `buf`. - * @param [encoding='utf8'] If `value` is a string, this is the encoding used to determine the binary representation of the string that will be searched for in `buf`. - * @return The index of the first occurrence of `value` in `buf`, or `-1` if `buf` does not contain `value`. - */ - indexOf(value: string | number | Uint8Array, byteOffset?: number, encoding?: BufferEncoding): number; - /** - * Identical to `buf.indexOf()`, except the last occurrence of `value` is found - * rather than the first occurrence. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.from('this buffer is a buffer'); - * - * console.log(buf.lastIndexOf('this')); - * // Prints: 0 - * console.log(buf.lastIndexOf('buffer')); - * // Prints: 17 - * console.log(buf.lastIndexOf(Buffer.from('buffer'))); - * // Prints: 17 - * console.log(buf.lastIndexOf(97)); - * // Prints: 15 (97 is the decimal ASCII value for 'a') - * console.log(buf.lastIndexOf(Buffer.from('yolo'))); - * // Prints: -1 - * console.log(buf.lastIndexOf('buffer', 5)); - * // Prints: 5 - * console.log(buf.lastIndexOf('buffer', 4)); - * // Prints: -1 - * - * const utf16Buffer = Buffer.from('\u039a\u0391\u03a3\u03a3\u0395', 'utf16le'); - * - * console.log(utf16Buffer.lastIndexOf('\u03a3', undefined, 'utf16le')); - * // Prints: 6 - * console.log(utf16Buffer.lastIndexOf('\u03a3', -5, 'utf16le')); - * // Prints: 4 - * ``` - * - * If `value` is not a string, number, or `Buffer`, this method will throw a`TypeError`. If `value` is a number, it will be coerced to a valid byte value, - * an integer between 0 and 255. - * - * If `byteOffset` is not a number, it will be coerced to a number. Any arguments - * that coerce to `NaN`, like `{}` or `undefined`, will search the whole buffer. - * This behavior matches [`String.prototype.lastIndexOf()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/lastIndexOf). - * - * ```js - * import { Buffer } from 'buffer'; - * - * const b = Buffer.from('abcdef'); - * - * // Passing a value that's a number, but not a valid byte. - * // Prints: 2, equivalent to searching for 99 or 'c'. - * console.log(b.lastIndexOf(99.9)); - * console.log(b.lastIndexOf(256 + 99)); - * - * // Passing a byteOffset that coerces to NaN. - * // Prints: 1, searching the whole buffer. - * console.log(b.lastIndexOf('b', undefined)); - * console.log(b.lastIndexOf('b', {})); - * - * // Passing a byteOffset that coerces to 0. - * // Prints: -1, equivalent to passing 0. - * console.log(b.lastIndexOf('b', null)); - * console.log(b.lastIndexOf('b', [])); - * ``` - * - * If `value` is an empty string or empty `Buffer`, `byteOffset` will be returned. - * @since v6.0.0 - * @param value What to search for. - * @param [byteOffset=buf.length - 1] Where to begin searching in `buf`. If negative, then offset is calculated from the end of `buf`. - * @param [encoding='utf8'] If `value` is a string, this is the encoding used to determine the binary representation of the string that will be searched for in `buf`. - * @return The index of the last occurrence of `value` in `buf`, or `-1` if `buf` does not contain `value`. - */ - lastIndexOf(value: string | number | Uint8Array, byteOffset?: number, encoding?: BufferEncoding): number; - /** - * Creates and returns an [iterator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols) of `[index, byte]` pairs from the contents - * of `buf`. - * - * ```js - * import { Buffer } from 'buffer'; - * - * // Log the entire contents of a `Buffer`. - * - * const buf = Buffer.from('buffer'); - * - * for (const pair of buf.entries()) { - * console.log(pair); - * } - * // Prints: - * // [0, 98] - * // [1, 117] - * // [2, 102] - * // [3, 102] - * // [4, 101] - * // [5, 114] - * ``` - * @since v1.1.0 - */ - entries(): IterableIterator<[number, number]>; - /** - * Equivalent to `buf.indexOf() !== -1`. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.from('this is a buffer'); - * - * console.log(buf.includes('this')); - * // Prints: true - * console.log(buf.includes('is')); - * // Prints: true - * console.log(buf.includes(Buffer.from('a buffer'))); - * // Prints: true - * console.log(buf.includes(97)); - * // Prints: true (97 is the decimal ASCII value for 'a') - * console.log(buf.includes(Buffer.from('a buffer example'))); - * // Prints: false - * console.log(buf.includes(Buffer.from('a buffer example').slice(0, 8))); - * // Prints: true - * console.log(buf.includes('this', 4)); - * // Prints: false - * ``` - * @since v5.3.0 - * @param value What to search for. - * @param [byteOffset=0] Where to begin searching in `buf`. If negative, then offset is calculated from the end of `buf`. - * @param [encoding='utf8'] If `value` is a string, this is its encoding. - * @return `true` if `value` was found in `buf`, `false` otherwise. - */ - includes(value: string | number | Buffer, byteOffset?: number, encoding?: BufferEncoding): boolean; - /** - * Creates and returns an [iterator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols) of `buf` keys (indices). - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.from('buffer'); - * - * for (const key of buf.keys()) { - * console.log(key); - * } - * // Prints: - * // 0 - * // 1 - * // 2 - * // 3 - * // 4 - * // 5 - * ``` - * @since v1.1.0 - */ - keys(): IterableIterator; - /** - * Creates and returns an [iterator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols) for `buf` values (bytes). This function is - * called automatically when a `Buffer` is used in a `for..of` statement. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.from('buffer'); - * - * for (const value of buf.values()) { - * console.log(value); - * } - * // Prints: - * // 98 - * // 117 - * // 102 - * // 102 - * // 101 - * // 114 - * - * for (const value of buf) { - * console.log(value); - * } - * // Prints: - * // 98 - * // 117 - * // 102 - * // 102 - * // 101 - * // 114 - * ``` - * @since v1.1.0 - */ - values(): IterableIterator; - } - var Buffer: BufferConstructor; - /** - * Decodes a string of Base64-encoded data into bytes, and encodes those bytes - * into a string using Latin-1 (ISO-8859-1). - * - * The `data` may be any JavaScript-value that can be coerced into a string. - * - * **This function is only provided for compatibility with legacy web platform APIs** - * **and should never be used in new code, because they use strings to represent** - * **binary data and predate the introduction of typed arrays in JavaScript.** - * **For code running using Node.js APIs, converting between base64-encoded strings** - * **and binary data should be performed using `Buffer.from(str, 'base64')` and`buf.toString('base64')`.** - * @since v15.13.0, v14.17.0 - * @deprecated Use `Buffer.from(data, 'base64')` instead. - * @param data The Base64-encoded input string. - */ - function atob(data: string): string; - /** - * Decodes a string into bytes using Latin-1 (ISO-8859), and encodes those bytes - * into a string using Base64. - * - * The `data` may be any JavaScript-value that can be coerced into a string. - * - * **This function is only provided for compatibility with legacy web platform APIs** - * **and should never be used in new code, because they use strings to represent** - * **binary data and predate the introduction of typed arrays in JavaScript.** - * **For code running using Node.js APIs, converting between base64-encoded strings** - * **and binary data should be performed using `Buffer.from(str, 'base64')` and`buf.toString('base64')`.** - * @since v15.13.0, v14.17.0 - * @deprecated Use `buf.toString('base64')` instead. - * @param data An ASCII (Latin1) string. - */ - function btoa(data: string): string; - - interface Blob extends __Blob {} - /** - * `Blob` class is a global reference for `require('node:buffer').Blob` - * https://nodejs.org/api/buffer.html#class-blob - * @since v18.0.0 - */ - var Blob: typeof globalThis extends { - onmessage: any; - Blob: infer T; - } - ? T - : typeof NodeBlob; - } -} -declare module 'node:buffer' { - export * from 'buffer'; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/child_process.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/child_process.d.ts deleted file mode 100755 index 79c7290e..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/child_process.d.ts +++ /dev/null @@ -1,1369 +0,0 @@ -/** - * The `child_process` module provides the ability to spawn subprocesses in - * a manner that is similar, but not identical, to [`popen(3)`](http://man7.org/linux/man-pages/man3/popen.3.html). This capability - * is primarily provided by the {@link spawn} function: - * - * ```js - * const { spawn } = require('child_process'); - * const ls = spawn('ls', ['-lh', '/usr']); - * - * ls.stdout.on('data', (data) => { - * console.log(`stdout: ${data}`); - * }); - * - * ls.stderr.on('data', (data) => { - * console.error(`stderr: ${data}`); - * }); - * - * ls.on('close', (code) => { - * console.log(`child process exited with code ${code}`); - * }); - * ``` - * - * By default, pipes for `stdin`, `stdout`, and `stderr` are established between - * the parent Node.js process and the spawned subprocess. These pipes have - * limited (and platform-specific) capacity. If the subprocess writes to - * stdout in excess of that limit without the output being captured, the - * subprocess blocks waiting for the pipe buffer to accept more data. This is - * identical to the behavior of pipes in the shell. Use the `{ stdio: 'ignore' }`option if the output will not be consumed. - * - * The command lookup is performed using the `options.env.PATH` environment - * variable if `env` is in the `options` object. Otherwise, `process.env.PATH` is - * used. If `options.env` is set without `PATH`, lookup on Unix is performed - * on a default search path search of `/usr/bin:/bin` (see your operating system's - * manual for execvpe/execvp), on Windows the current processes environment - * variable `PATH` is used. - * - * On Windows, environment variables are case-insensitive. Node.js - * lexicographically sorts the `env` keys and uses the first one that - * case-insensitively matches. Only first (in lexicographic order) entry will be - * passed to the subprocess. This might lead to issues on Windows when passing - * objects to the `env` option that have multiple variants of the same key, such as`PATH` and `Path`. - * - * The {@link spawn} method spawns the child process asynchronously, - * without blocking the Node.js event loop. The {@link spawnSync} function provides equivalent functionality in a synchronous manner that blocks - * the event loop until the spawned process either exits or is terminated. - * - * For convenience, the `child_process` module provides a handful of synchronous - * and asynchronous alternatives to {@link spawn} and {@link spawnSync}. Each of these alternatives are implemented on - * top of {@link spawn} or {@link spawnSync}. - * - * * {@link exec}: spawns a shell and runs a command within that - * shell, passing the `stdout` and `stderr` to a callback function when - * complete. - * * {@link execFile}: similar to {@link exec} except - * that it spawns the command directly without first spawning a shell by - * default. - * * {@link fork}: spawns a new Node.js process and invokes a - * specified module with an IPC communication channel established that allows - * sending messages between parent and child. - * * {@link execSync}: a synchronous version of {@link exec} that will block the Node.js event loop. - * * {@link execFileSync}: a synchronous version of {@link execFile} that will block the Node.js event loop. - * - * For certain use cases, such as automating shell scripts, the `synchronous counterparts` may be more convenient. In many cases, however, - * the synchronous methods can have significant impact on performance due to - * stalling the event loop while spawned processes complete. - * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/child_process.js) - */ -declare module 'child_process' { - import { ObjectEncodingOptions } from 'node:fs'; - import { EventEmitter, Abortable } from 'node:events'; - import * as net from 'node:net'; - import { Writable, Readable, Stream, Pipe } from 'node:stream'; - import { URL } from 'node:url'; - type Serializable = string | object | number | boolean | bigint; - type SendHandle = net.Socket | net.Server; - /** - * Instances of the `ChildProcess` represent spawned child processes. - * - * Instances of `ChildProcess` are not intended to be created directly. Rather, - * use the {@link spawn}, {@link exec},{@link execFile}, or {@link fork} methods to create - * instances of `ChildProcess`. - * @since v2.2.0 - */ - class ChildProcess extends EventEmitter { - /** - * A `Writable Stream` that represents the child process's `stdin`. - * - * If a child process waits to read all of its input, the child will not continue - * until this stream has been closed via `end()`. - * - * If the child was spawned with `stdio[0]` set to anything other than `'pipe'`, - * then this will be `null`. - * - * `subprocess.stdin` is an alias for `subprocess.stdio[0]`. Both properties will - * refer to the same value. - * - * The `subprocess.stdin` property can be `undefined` if the child process could - * not be successfully spawned. - * @since v0.1.90 - */ - stdin: Writable | null; - /** - * A `Readable Stream` that represents the child process's `stdout`. - * - * If the child was spawned with `stdio[1]` set to anything other than `'pipe'`, - * then this will be `null`. - * - * `subprocess.stdout` is an alias for `subprocess.stdio[1]`. Both properties will - * refer to the same value. - * - * ```js - * const { spawn } = require('child_process'); - * - * const subprocess = spawn('ls'); - * - * subprocess.stdout.on('data', (data) => { - * console.log(`Received chunk ${data}`); - * }); - * ``` - * - * The `subprocess.stdout` property can be `null` if the child process could - * not be successfully spawned. - * @since v0.1.90 - */ - stdout: Readable | null; - /** - * A `Readable Stream` that represents the child process's `stderr`. - * - * If the child was spawned with `stdio[2]` set to anything other than `'pipe'`, - * then this will be `null`. - * - * `subprocess.stderr` is an alias for `subprocess.stdio[2]`. Both properties will - * refer to the same value. - * - * The `subprocess.stderr` property can be `null` if the child process could - * not be successfully spawned. - * @since v0.1.90 - */ - stderr: Readable | null; - /** - * The `subprocess.channel` property is a reference to the child's IPC channel. If - * no IPC channel currently exists, this property is `undefined`. - * @since v7.1.0 - */ - readonly channel?: Pipe | null | undefined; - /** - * A sparse array of pipes to the child process, corresponding with positions in - * the `stdio` option passed to {@link spawn} that have been set - * to the value `'pipe'`. `subprocess.stdio[0]`, `subprocess.stdio[1]`, and`subprocess.stdio[2]` are also available as `subprocess.stdin`,`subprocess.stdout`, and `subprocess.stderr`, - * respectively. - * - * In the following example, only the child's fd `1` (stdout) is configured as a - * pipe, so only the parent's `subprocess.stdio[1]` is a stream, all other values - * in the array are `null`. - * - * ```js - * const assert = require('assert'); - * const fs = require('fs'); - * const child_process = require('child_process'); - * - * const subprocess = child_process.spawn('ls', { - * stdio: [ - * 0, // Use parent's stdin for child. - * 'pipe', // Pipe child's stdout to parent. - * fs.openSync('err.out', 'w'), // Direct child's stderr to a file. - * ] - * }); - * - * assert.strictEqual(subprocess.stdio[0], null); - * assert.strictEqual(subprocess.stdio[0], subprocess.stdin); - * - * assert(subprocess.stdout); - * assert.strictEqual(subprocess.stdio[1], subprocess.stdout); - * - * assert.strictEqual(subprocess.stdio[2], null); - * assert.strictEqual(subprocess.stdio[2], subprocess.stderr); - * ``` - * - * The `subprocess.stdio` property can be `undefined` if the child process could - * not be successfully spawned. - * @since v0.7.10 - */ - readonly stdio: [ - Writable | null, - // stdin - Readable | null, - // stdout - Readable | null, - // stderr - Readable | Writable | null | undefined, - // extra - Readable | Writable | null | undefined // extra - ]; - /** - * The `subprocess.killed` property indicates whether the child process - * successfully received a signal from `subprocess.kill()`. The `killed` property - * does not indicate that the child process has been terminated. - * @since v0.5.10 - */ - readonly killed: boolean; - /** - * Returns the process identifier (PID) of the child process. If the child process - * fails to spawn due to errors, then the value is `undefined` and `error` is - * emitted. - * - * ```js - * const { spawn } = require('child_process'); - * const grep = spawn('grep', ['ssh']); - * - * console.log(`Spawned child pid: ${grep.pid}`); - * grep.stdin.end(); - * ``` - * @since v0.1.90 - */ - readonly pid?: number | undefined; - /** - * The `subprocess.connected` property indicates whether it is still possible to - * send and receive messages from a child process. When `subprocess.connected` is`false`, it is no longer possible to send or receive messages. - * @since v0.7.2 - */ - readonly connected: boolean; - /** - * The `subprocess.exitCode` property indicates the exit code of the child process. - * If the child process is still running, the field will be `null`. - */ - readonly exitCode: number | null; - /** - * The `subprocess.signalCode` property indicates the signal received by - * the child process if any, else `null`. - */ - readonly signalCode: NodeJS.Signals | null; - /** - * The `subprocess.spawnargs` property represents the full list of command-line - * arguments the child process was launched with. - */ - readonly spawnargs: string[]; - /** - * The `subprocess.spawnfile` property indicates the executable file name of - * the child process that is launched. - * - * For {@link fork}, its value will be equal to `process.execPath`. - * For {@link spawn}, its value will be the name of - * the executable file. - * For {@link exec}, its value will be the name of the shell - * in which the child process is launched. - */ - readonly spawnfile: string; - /** - * The `subprocess.kill()` method sends a signal to the child process. If no - * argument is given, the process will be sent the `'SIGTERM'` signal. See [`signal(7)`](http://man7.org/linux/man-pages/man7/signal.7.html) for a list of available signals. This function - * returns `true` if [`kill(2)`](http://man7.org/linux/man-pages/man2/kill.2.html) succeeds, and `false` otherwise. - * - * ```js - * const { spawn } = require('child_process'); - * const grep = spawn('grep', ['ssh']); - * - * grep.on('close', (code, signal) => { - * console.log( - * `child process terminated due to receipt of signal ${signal}`); - * }); - * - * // Send SIGHUP to process. - * grep.kill('SIGHUP'); - * ``` - * - * The `ChildProcess` object may emit an `'error'` event if the signal - * cannot be delivered. Sending a signal to a child process that has already exited - * is not an error but may have unforeseen consequences. Specifically, if the - * process identifier (PID) has been reassigned to another process, the signal will - * be delivered to that process instead which can have unexpected results. - * - * While the function is called `kill`, the signal delivered to the child process - * may not actually terminate the process. - * - * See [`kill(2)`](http://man7.org/linux/man-pages/man2/kill.2.html) for reference. - * - * On Windows, where POSIX signals do not exist, the `signal` argument will be - * ignored, and the process will be killed forcefully and abruptly (similar to`'SIGKILL'`). - * See `Signal Events` for more details. - * - * On Linux, child processes of child processes will not be terminated - * when attempting to kill their parent. This is likely to happen when running a - * new process in a shell or with the use of the `shell` option of `ChildProcess`: - * - * ```js - * 'use strict'; - * const { spawn } = require('child_process'); - * - * const subprocess = spawn( - * 'sh', - * [ - * '-c', - * `node -e "setInterval(() => { - * console.log(process.pid, 'is alive') - * }, 500);"`, - * ], { - * stdio: ['inherit', 'inherit', 'inherit'] - * } - * ); - * - * setTimeout(() => { - * subprocess.kill(); // Does not terminate the Node.js process in the shell. - * }, 2000); - * ``` - * @since v0.1.90 - */ - kill(signal?: NodeJS.Signals | number): boolean; - /** - * When an IPC channel has been established between the parent and child ( - * i.e. when using {@link fork}), the `subprocess.send()` method can - * be used to send messages to the child process. When the child process is a - * Node.js instance, these messages can be received via the `'message'` event. - * - * The message goes through serialization and parsing. The resulting - * message might not be the same as what is originally sent. - * - * For example, in the parent script: - * - * ```js - * const cp = require('child_process'); - * const n = cp.fork(`${__dirname}/sub.js`); - * - * n.on('message', (m) => { - * console.log('PARENT got message:', m); - * }); - * - * // Causes the child to print: CHILD got message: { hello: 'world' } - * n.send({ hello: 'world' }); - * ``` - * - * And then the child script, `'sub.js'` might look like this: - * - * ```js - * process.on('message', (m) => { - * console.log('CHILD got message:', m); - * }); - * - * // Causes the parent to print: PARENT got message: { foo: 'bar', baz: null } - * process.send({ foo: 'bar', baz: NaN }); - * ``` - * - * Child Node.js processes will have a `process.send()` method of their own - * that allows the child to send messages back to the parent. - * - * There is a special case when sending a `{cmd: 'NODE_foo'}` message. Messages - * containing a `NODE_` prefix in the `cmd` property are reserved for use within - * Node.js core and will not be emitted in the child's `'message'` event. Rather, such messages are emitted using the`'internalMessage'` event and are consumed internally by Node.js. - * Applications should avoid using such messages or listening for`'internalMessage'` events as it is subject to change without notice. - * - * The optional `sendHandle` argument that may be passed to `subprocess.send()` is - * for passing a TCP server or socket object to the child process. The child will - * receive the object as the second argument passed to the callback function - * registered on the `'message'` event. Any data that is received - * and buffered in the socket will not be sent to the child. - * - * The optional `callback` is a function that is invoked after the message is - * sent but before the child may have received it. The function is called with a - * single argument: `null` on success, or an `Error` object on failure. - * - * If no `callback` function is provided and the message cannot be sent, an`'error'` event will be emitted by the `ChildProcess` object. This can - * happen, for instance, when the child process has already exited. - * - * `subprocess.send()` will return `false` if the channel has closed or when the - * backlog of unsent messages exceeds a threshold that makes it unwise to send - * more. Otherwise, the method returns `true`. The `callback` function can be - * used to implement flow control. - * - * #### Example: sending a server object - * - * The `sendHandle` argument can be used, for instance, to pass the handle of - * a TCP server object to the child process as illustrated in the example below: - * - * ```js - * const subprocess = require('child_process').fork('subprocess.js'); - * - * // Open up the server object and send the handle. - * const server = require('net').createServer(); - * server.on('connection', (socket) => { - * socket.end('handled by parent'); - * }); - * server.listen(1337, () => { - * subprocess.send('server', server); - * }); - * ``` - * - * The child would then receive the server object as: - * - * ```js - * process.on('message', (m, server) => { - * if (m === 'server') { - * server.on('connection', (socket) => { - * socket.end('handled by child'); - * }); - * } - * }); - * ``` - * - * Once the server is now shared between the parent and child, some connections - * can be handled by the parent and some by the child. - * - * While the example above uses a server created using the `net` module, `dgram`module servers use exactly the same workflow with the exceptions of listening on - * a `'message'` event instead of `'connection'` and using `server.bind()` instead - * of `server.listen()`. This is, however, currently only supported on Unix - * platforms. - * - * #### Example: sending a socket object - * - * Similarly, the `sendHandler` argument can be used to pass the handle of a - * socket to the child process. The example below spawns two children that each - * handle connections with "normal" or "special" priority: - * - * ```js - * const { fork } = require('child_process'); - * const normal = fork('subprocess.js', ['normal']); - * const special = fork('subprocess.js', ['special']); - * - * // Open up the server and send sockets to child. Use pauseOnConnect to prevent - * // the sockets from being read before they are sent to the child process. - * const server = require('net').createServer({ pauseOnConnect: true }); - * server.on('connection', (socket) => { - * - * // If this is special priority... - * if (socket.remoteAddress === '74.125.127.100') { - * special.send('socket', socket); - * return; - * } - * // This is normal priority. - * normal.send('socket', socket); - * }); - * server.listen(1337); - * ``` - * - * The `subprocess.js` would receive the socket handle as the second argument - * passed to the event callback function: - * - * ```js - * process.on('message', (m, socket) => { - * if (m === 'socket') { - * if (socket) { - * // Check that the client socket exists. - * // It is possible for the socket to be closed between the time it is - * // sent and the time it is received in the child process. - * socket.end(`Request handled with ${process.argv[2]} priority`); - * } - * } - * }); - * ``` - * - * Do not use `.maxConnections` on a socket that has been passed to a subprocess. - * The parent cannot track when the socket is destroyed. - * - * Any `'message'` handlers in the subprocess should verify that `socket` exists, - * as the connection may have been closed during the time it takes to send the - * connection to the child. - * @since v0.5.9 - * @param options The `options` argument, if present, is an object used to parameterize the sending of certain types of handles. `options` supports the following properties: - */ - send(message: Serializable, callback?: (error: Error | null) => void): boolean; - send(message: Serializable, sendHandle?: SendHandle, callback?: (error: Error | null) => void): boolean; - send(message: Serializable, sendHandle?: SendHandle, options?: MessageOptions, callback?: (error: Error | null) => void): boolean; - /** - * Closes the IPC channel between parent and child, allowing the child to exit - * gracefully once there are no other connections keeping it alive. After calling - * this method the `subprocess.connected` and `process.connected` properties in - * both the parent and child (respectively) will be set to `false`, and it will be - * no longer possible to pass messages between the processes. - * - * The `'disconnect'` event will be emitted when there are no messages in the - * process of being received. This will most often be triggered immediately after - * calling `subprocess.disconnect()`. - * - * When the child process is a Node.js instance (e.g. spawned using {@link fork}), the `process.disconnect()` method can be invoked - * within the child process to close the IPC channel as well. - * @since v0.7.2 - */ - disconnect(): void; - /** - * By default, the parent will wait for the detached child to exit. To prevent the - * parent from waiting for a given `subprocess` to exit, use the`subprocess.unref()` method. Doing so will cause the parent's event loop to not - * include the child in its reference count, allowing the parent to exit - * independently of the child, unless there is an established IPC channel between - * the child and the parent. - * - * ```js - * const { spawn } = require('child_process'); - * - * const subprocess = spawn(process.argv[0], ['child_program.js'], { - * detached: true, - * stdio: 'ignore' - * }); - * - * subprocess.unref(); - * ``` - * @since v0.7.10 - */ - unref(): void; - /** - * Calling `subprocess.ref()` after making a call to `subprocess.unref()` will - * restore the removed reference count for the child process, forcing the parent - * to wait for the child to exit before exiting itself. - * - * ```js - * const { spawn } = require('child_process'); - * - * const subprocess = spawn(process.argv[0], ['child_program.js'], { - * detached: true, - * stdio: 'ignore' - * }); - * - * subprocess.unref(); - * subprocess.ref(); - * ``` - * @since v0.7.10 - */ - ref(): void; - /** - * events.EventEmitter - * 1. close - * 2. disconnect - * 3. error - * 4. exit - * 5. message - * 6. spawn - */ - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: 'close', listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; - addListener(event: 'disconnect', listener: () => void): this; - addListener(event: 'error', listener: (err: Error) => void): this; - addListener(event: 'exit', listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; - addListener(event: 'message', listener: (message: Serializable, sendHandle: SendHandle) => void): this; - addListener(event: 'spawn', listener: () => void): this; - emit(event: string | symbol, ...args: any[]): boolean; - emit(event: 'close', code: number | null, signal: NodeJS.Signals | null): boolean; - emit(event: 'disconnect'): boolean; - emit(event: 'error', err: Error): boolean; - emit(event: 'exit', code: number | null, signal: NodeJS.Signals | null): boolean; - emit(event: 'message', message: Serializable, sendHandle: SendHandle): boolean; - emit(event: 'spawn', listener: () => void): boolean; - on(event: string, listener: (...args: any[]) => void): this; - on(event: 'close', listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; - on(event: 'disconnect', listener: () => void): this; - on(event: 'error', listener: (err: Error) => void): this; - on(event: 'exit', listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; - on(event: 'message', listener: (message: Serializable, sendHandle: SendHandle) => void): this; - on(event: 'spawn', listener: () => void): this; - once(event: string, listener: (...args: any[]) => void): this; - once(event: 'close', listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; - once(event: 'disconnect', listener: () => void): this; - once(event: 'error', listener: (err: Error) => void): this; - once(event: 'exit', listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; - once(event: 'message', listener: (message: Serializable, sendHandle: SendHandle) => void): this; - once(event: 'spawn', listener: () => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: 'close', listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; - prependListener(event: 'disconnect', listener: () => void): this; - prependListener(event: 'error', listener: (err: Error) => void): this; - prependListener(event: 'exit', listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; - prependListener(event: 'message', listener: (message: Serializable, sendHandle: SendHandle) => void): this; - prependListener(event: 'spawn', listener: () => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: 'close', listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; - prependOnceListener(event: 'disconnect', listener: () => void): this; - prependOnceListener(event: 'error', listener: (err: Error) => void): this; - prependOnceListener(event: 'exit', listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; - prependOnceListener(event: 'message', listener: (message: Serializable, sendHandle: SendHandle) => void): this; - prependOnceListener(event: 'spawn', listener: () => void): this; - } - // return this object when stdio option is undefined or not specified - interface ChildProcessWithoutNullStreams extends ChildProcess { - stdin: Writable; - stdout: Readable; - stderr: Readable; - readonly stdio: [ - Writable, - Readable, - Readable, - // stderr - Readable | Writable | null | undefined, - // extra, no modification - Readable | Writable | null | undefined // extra, no modification - ]; - } - // return this object when stdio option is a tuple of 3 - interface ChildProcessByStdio extends ChildProcess { - stdin: I; - stdout: O; - stderr: E; - readonly stdio: [ - I, - O, - E, - Readable | Writable | null | undefined, - // extra, no modification - Readable | Writable | null | undefined // extra, no modification - ]; - } - interface MessageOptions { - keepOpen?: boolean | undefined; - } - type IOType = 'overlapped' | 'pipe' | 'ignore' | 'inherit'; - type StdioOptions = IOType | Array; - type SerializationType = 'json' | 'advanced'; - interface MessagingOptions extends Abortable { - /** - * Specify the kind of serialization used for sending messages between processes. - * @default 'json' - */ - serialization?: SerializationType | undefined; - /** - * The signal value to be used when the spawned process will be killed by the abort signal. - * @default 'SIGTERM' - */ - killSignal?: NodeJS.Signals | number | undefined; - /** - * In milliseconds the maximum amount of time the process is allowed to run. - */ - timeout?: number | undefined; - } - interface ProcessEnvOptions { - uid?: number | undefined; - gid?: number | undefined; - cwd?: string | URL | undefined; - env?: NodeJS.ProcessEnv | undefined; - } - interface CommonOptions extends ProcessEnvOptions { - /** - * @default true - */ - windowsHide?: boolean | undefined; - /** - * @default 0 - */ - timeout?: number | undefined; - } - interface CommonSpawnOptions extends CommonOptions, MessagingOptions, Abortable { - argv0?: string | undefined; - stdio?: StdioOptions | undefined; - shell?: boolean | string | undefined; - windowsVerbatimArguments?: boolean | undefined; - } - interface SpawnOptions extends CommonSpawnOptions { - detached?: boolean | undefined; - } - interface SpawnOptionsWithoutStdio extends SpawnOptions { - stdio?: StdioPipeNamed | StdioPipe[] | undefined; - } - type StdioNull = 'inherit' | 'ignore' | Stream; - type StdioPipeNamed = 'pipe' | 'overlapped'; - type StdioPipe = undefined | null | StdioPipeNamed; - interface SpawnOptionsWithStdioTuple extends SpawnOptions { - stdio: [Stdin, Stdout, Stderr]; - } - /** - * The `child_process.spawn()` method spawns a new process using the given`command`, with command-line arguments in `args`. If omitted, `args` defaults - * to an empty array. - * - * **If the `shell` option is enabled, do not pass unsanitized user input to this** - * **function. Any input containing shell metacharacters may be used to trigger** - * **arbitrary command execution.** - * - * A third argument may be used to specify additional options, with these defaults: - * - * ```js - * const defaults = { - * cwd: undefined, - * env: process.env - * }; - * ``` - * - * Use `cwd` to specify the working directory from which the process is spawned. - * If not given, the default is to inherit the current working directory. If given, - * but the path does not exist, the child process emits an `ENOENT` error - * and exits immediately. `ENOENT` is also emitted when the command - * does not exist. - * - * Use `env` to specify environment variables that will be visible to the new - * process, the default is `process.env`. - * - * `undefined` values in `env` will be ignored. - * - * Example of running `ls -lh /usr`, capturing `stdout`, `stderr`, and the - * exit code: - * - * ```js - * const { spawn } = require('child_process'); - * const ls = spawn('ls', ['-lh', '/usr']); - * - * ls.stdout.on('data', (data) => { - * console.log(`stdout: ${data}`); - * }); - * - * ls.stderr.on('data', (data) => { - * console.error(`stderr: ${data}`); - * }); - * - * ls.on('close', (code) => { - * console.log(`child process exited with code ${code}`); - * }); - * ``` - * - * Example: A very elaborate way to run `ps ax | grep ssh` - * - * ```js - * const { spawn } = require('child_process'); - * const ps = spawn('ps', ['ax']); - * const grep = spawn('grep', ['ssh']); - * - * ps.stdout.on('data', (data) => { - * grep.stdin.write(data); - * }); - * - * ps.stderr.on('data', (data) => { - * console.error(`ps stderr: ${data}`); - * }); - * - * ps.on('close', (code) => { - * if (code !== 0) { - * console.log(`ps process exited with code ${code}`); - * } - * grep.stdin.end(); - * }); - * - * grep.stdout.on('data', (data) => { - * console.log(data.toString()); - * }); - * - * grep.stderr.on('data', (data) => { - * console.error(`grep stderr: ${data}`); - * }); - * - * grep.on('close', (code) => { - * if (code !== 0) { - * console.log(`grep process exited with code ${code}`); - * } - * }); - * ``` - * - * Example of checking for failed `spawn`: - * - * ```js - * const { spawn } = require('child_process'); - * const subprocess = spawn('bad_command'); - * - * subprocess.on('error', (err) => { - * console.error('Failed to start subprocess.'); - * }); - * ``` - * - * Certain platforms (macOS, Linux) will use the value of `argv[0]` for the process - * title while others (Windows, SunOS) will use `command`. - * - * Node.js currently overwrites `argv[0]` with `process.execPath` on startup, so`process.argv[0]` in a Node.js child process will not match the `argv0`parameter passed to `spawn` from the parent, - * retrieve it with the`process.argv0` property instead. - * - * If the `signal` option is enabled, calling `.abort()` on the corresponding`AbortController` is similar to calling `.kill()` on the child process except - * the error passed to the callback will be an `AbortError`: - * - * ```js - * const { spawn } = require('child_process'); - * const controller = new AbortController(); - * const { signal } = controller; - * const grep = spawn('grep', ['ssh'], { signal }); - * grep.on('error', (err) => { - * // This will be called with err being an AbortError if the controller aborts - * }); - * controller.abort(); // Stops the child process - * ``` - * @since v0.1.90 - * @param command The command to run. - * @param args List of string arguments. - */ - function spawn(command: string, options?: SpawnOptionsWithoutStdio): ChildProcessWithoutNullStreams; - function spawn(command: string, options: SpawnOptionsWithStdioTuple): ChildProcessByStdio; - function spawn(command: string, options: SpawnOptionsWithStdioTuple): ChildProcessByStdio; - function spawn(command: string, options: SpawnOptionsWithStdioTuple): ChildProcessByStdio; - function spawn(command: string, options: SpawnOptionsWithStdioTuple): ChildProcessByStdio; - function spawn(command: string, options: SpawnOptionsWithStdioTuple): ChildProcessByStdio; - function spawn(command: string, options: SpawnOptionsWithStdioTuple): ChildProcessByStdio; - function spawn(command: string, options: SpawnOptionsWithStdioTuple): ChildProcessByStdio; - function spawn(command: string, options: SpawnOptionsWithStdioTuple): ChildProcessByStdio; - function spawn(command: string, options: SpawnOptions): ChildProcess; - // overloads of spawn with 'args' - function spawn(command: string, args?: ReadonlyArray, options?: SpawnOptionsWithoutStdio): ChildProcessWithoutNullStreams; - function spawn(command: string, args: ReadonlyArray, options: SpawnOptionsWithStdioTuple): ChildProcessByStdio; - function spawn(command: string, args: ReadonlyArray, options: SpawnOptionsWithStdioTuple): ChildProcessByStdio; - function spawn(command: string, args: ReadonlyArray, options: SpawnOptionsWithStdioTuple): ChildProcessByStdio; - function spawn(command: string, args: ReadonlyArray, options: SpawnOptionsWithStdioTuple): ChildProcessByStdio; - function spawn(command: string, args: ReadonlyArray, options: SpawnOptionsWithStdioTuple): ChildProcessByStdio; - function spawn(command: string, args: ReadonlyArray, options: SpawnOptionsWithStdioTuple): ChildProcessByStdio; - function spawn(command: string, args: ReadonlyArray, options: SpawnOptionsWithStdioTuple): ChildProcessByStdio; - function spawn(command: string, args: ReadonlyArray, options: SpawnOptionsWithStdioTuple): ChildProcessByStdio; - function spawn(command: string, args: ReadonlyArray, options: SpawnOptions): ChildProcess; - interface ExecOptions extends CommonOptions { - shell?: string | undefined; - signal?: AbortSignal | undefined; - maxBuffer?: number | undefined; - killSignal?: NodeJS.Signals | number | undefined; - } - interface ExecOptionsWithStringEncoding extends ExecOptions { - encoding: BufferEncoding; - } - interface ExecOptionsWithBufferEncoding extends ExecOptions { - encoding: BufferEncoding | null; // specify `null`. - } - interface ExecException extends Error { - cmd?: string | undefined; - killed?: boolean | undefined; - code?: number | undefined; - signal?: NodeJS.Signals | undefined; - } - /** - * Spawns a shell then executes the `command` within that shell, buffering any - * generated output. The `command` string passed to the exec function is processed - * directly by the shell and special characters (vary based on [shell](https://en.wikipedia.org/wiki/List_of_command-line_interpreters)) - * need to be dealt with accordingly: - * - * ```js - * const { exec } = require('child_process'); - * - * exec('"/path/to/test file/test.sh" arg1 arg2'); - * // Double quotes are used so that the space in the path is not interpreted as - * // a delimiter of multiple arguments. - * - * exec('echo "The \\$HOME variable is $HOME"'); - * // The $HOME variable is escaped in the first instance, but not in the second. - * ``` - * - * **Never pass unsanitized user input to this function. Any input containing shell** - * **metacharacters may be used to trigger arbitrary command execution.** - * - * If a `callback` function is provided, it is called with the arguments`(error, stdout, stderr)`. On success, `error` will be `null`. On error,`error` will be an instance of `Error`. The - * `error.code` property will be - * the exit code of the process. By convention, any exit code other than `0`indicates an error. `error.signal` will be the signal that terminated the - * process. - * - * The `stdout` and `stderr` arguments passed to the callback will contain the - * stdout and stderr output of the child process. By default, Node.js will decode - * the output as UTF-8 and pass strings to the callback. The `encoding` option - * can be used to specify the character encoding used to decode the stdout and - * stderr output. If `encoding` is `'buffer'`, or an unrecognized character - * encoding, `Buffer` objects will be passed to the callback instead. - * - * ```js - * const { exec } = require('child_process'); - * exec('cat *.js missing_file | wc -l', (error, stdout, stderr) => { - * if (error) { - * console.error(`exec error: ${error}`); - * return; - * } - * console.log(`stdout: ${stdout}`); - * console.error(`stderr: ${stderr}`); - * }); - * ``` - * - * If `timeout` is greater than `0`, the parent will send the signal - * identified by the `killSignal` property (the default is `'SIGTERM'`) if the - * child runs longer than `timeout` milliseconds. - * - * Unlike the [`exec(3)`](http://man7.org/linux/man-pages/man3/exec.3.html) POSIX system call, `child_process.exec()` does not replace - * the existing process and uses a shell to execute the command. - * - * If this method is invoked as its `util.promisify()` ed version, it returns - * a `Promise` for an `Object` with `stdout` and `stderr` properties. The returned`ChildProcess` instance is attached to the `Promise` as a `child` property. In - * case of an error (including any error resulting in an exit code other than 0), a - * rejected promise is returned, with the same `error` object given in the - * callback, but with two additional properties `stdout` and `stderr`. - * - * ```js - * const util = require('util'); - * const exec = util.promisify(require('child_process').exec); - * - * async function lsExample() { - * const { stdout, stderr } = await exec('ls'); - * console.log('stdout:', stdout); - * console.error('stderr:', stderr); - * } - * lsExample(); - * ``` - * - * If the `signal` option is enabled, calling `.abort()` on the corresponding`AbortController` is similar to calling `.kill()` on the child process except - * the error passed to the callback will be an `AbortError`: - * - * ```js - * const { exec } = require('child_process'); - * const controller = new AbortController(); - * const { signal } = controller; - * const child = exec('grep ssh', { signal }, (error) => { - * console.log(error); // an AbortError - * }); - * controller.abort(); - * ``` - * @since v0.1.90 - * @param command The command to run, with space-separated arguments. - * @param callback called with the output when process terminates. - */ - function exec(command: string, callback?: (error: ExecException | null, stdout: string, stderr: string) => void): ChildProcess; - // `options` with `"buffer"` or `null` for `encoding` means stdout/stderr are definitely `Buffer`. - function exec( - command: string, - options: { - encoding: 'buffer' | null; - } & ExecOptions, - callback?: (error: ExecException | null, stdout: Buffer, stderr: Buffer) => void - ): ChildProcess; - // `options` with well known `encoding` means stdout/stderr are definitely `string`. - function exec( - command: string, - options: { - encoding: BufferEncoding; - } & ExecOptions, - callback?: (error: ExecException | null, stdout: string, stderr: string) => void - ): ChildProcess; - // `options` with an `encoding` whose type is `string` means stdout/stderr could either be `Buffer` or `string`. - // There is no guarantee the `encoding` is unknown as `string` is a superset of `BufferEncoding`. - function exec( - command: string, - options: { - encoding: BufferEncoding; - } & ExecOptions, - callback?: (error: ExecException | null, stdout: string | Buffer, stderr: string | Buffer) => void - ): ChildProcess; - // `options` without an `encoding` means stdout/stderr are definitely `string`. - function exec(command: string, options: ExecOptions, callback?: (error: ExecException | null, stdout: string, stderr: string) => void): ChildProcess; - // fallback if nothing else matches. Worst case is always `string | Buffer`. - function exec( - command: string, - options: (ObjectEncodingOptions & ExecOptions) | undefined | null, - callback?: (error: ExecException | null, stdout: string | Buffer, stderr: string | Buffer) => void - ): ChildProcess; - interface PromiseWithChild extends Promise { - child: ChildProcess; - } - namespace exec { - function __promisify__(command: string): PromiseWithChild<{ - stdout: string; - stderr: string; - }>; - function __promisify__( - command: string, - options: { - encoding: 'buffer' | null; - } & ExecOptions - ): PromiseWithChild<{ - stdout: Buffer; - stderr: Buffer; - }>; - function __promisify__( - command: string, - options: { - encoding: BufferEncoding; - } & ExecOptions - ): PromiseWithChild<{ - stdout: string; - stderr: string; - }>; - function __promisify__( - command: string, - options: ExecOptions - ): PromiseWithChild<{ - stdout: string; - stderr: string; - }>; - function __promisify__( - command: string, - options?: (ObjectEncodingOptions & ExecOptions) | null - ): PromiseWithChild<{ - stdout: string | Buffer; - stderr: string | Buffer; - }>; - } - interface ExecFileOptions extends CommonOptions, Abortable { - maxBuffer?: number | undefined; - killSignal?: NodeJS.Signals | number | undefined; - windowsVerbatimArguments?: boolean | undefined; - shell?: boolean | string | undefined; - signal?: AbortSignal | undefined; - } - interface ExecFileOptionsWithStringEncoding extends ExecFileOptions { - encoding: BufferEncoding; - } - interface ExecFileOptionsWithBufferEncoding extends ExecFileOptions { - encoding: 'buffer' | null; - } - interface ExecFileOptionsWithOtherEncoding extends ExecFileOptions { - encoding: BufferEncoding; - } - type ExecFileException = ExecException & NodeJS.ErrnoException; - /** - * The `child_process.execFile()` function is similar to {@link exec} except that it does not spawn a shell by default. Rather, the specified - * executable `file` is spawned directly as a new process making it slightly more - * efficient than {@link exec}. - * - * The same options as {@link exec} are supported. Since a shell is - * not spawned, behaviors such as I/O redirection and file globbing are not - * supported. - * - * ```js - * const { execFile } = require('child_process'); - * const child = execFile('node', ['--version'], (error, stdout, stderr) => { - * if (error) { - * throw error; - * } - * console.log(stdout); - * }); - * ``` - * - * The `stdout` and `stderr` arguments passed to the callback will contain the - * stdout and stderr output of the child process. By default, Node.js will decode - * the output as UTF-8 and pass strings to the callback. The `encoding` option - * can be used to specify the character encoding used to decode the stdout and - * stderr output. If `encoding` is `'buffer'`, or an unrecognized character - * encoding, `Buffer` objects will be passed to the callback instead. - * - * If this method is invoked as its `util.promisify()` ed version, it returns - * a `Promise` for an `Object` with `stdout` and `stderr` properties. The returned`ChildProcess` instance is attached to the `Promise` as a `child` property. In - * case of an error (including any error resulting in an exit code other than 0), a - * rejected promise is returned, with the same `error` object given in the - * callback, but with two additional properties `stdout` and `stderr`. - * - * ```js - * const util = require('util'); - * const execFile = util.promisify(require('child_process').execFile); - * async function getVersion() { - * const { stdout } = await execFile('node', ['--version']); - * console.log(stdout); - * } - * getVersion(); - * ``` - * - * **If the `shell` option is enabled, do not pass unsanitized user input to this** - * **function. Any input containing shell metacharacters may be used to trigger** - * **arbitrary command execution.** - * - * If the `signal` option is enabled, calling `.abort()` on the corresponding`AbortController` is similar to calling `.kill()` on the child process except - * the error passed to the callback will be an `AbortError`: - * - * ```js - * const { execFile } = require('child_process'); - * const controller = new AbortController(); - * const { signal } = controller; - * const child = execFile('node', ['--version'], { signal }, (error) => { - * console.log(error); // an AbortError - * }); - * controller.abort(); - * ``` - * @since v0.1.91 - * @param file The name or path of the executable file to run. - * @param args List of string arguments. - * @param callback Called with the output when process terminates. - */ - function execFile(file: string): ChildProcess; - function execFile(file: string, options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null): ChildProcess; - function execFile(file: string, args?: ReadonlyArray | null): ChildProcess; - function execFile(file: string, args: ReadonlyArray | undefined | null, options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null): ChildProcess; - // no `options` definitely means stdout/stderr are `string`. - function execFile(file: string, callback: (error: ExecFileException | null, stdout: string, stderr: string) => void): ChildProcess; - function execFile(file: string, args: ReadonlyArray | undefined | null, callback: (error: ExecFileException | null, stdout: string, stderr: string) => void): ChildProcess; - // `options` with `"buffer"` or `null` for `encoding` means stdout/stderr are definitely `Buffer`. - function execFile(file: string, options: ExecFileOptionsWithBufferEncoding, callback: (error: ExecFileException | null, stdout: Buffer, stderr: Buffer) => void): ChildProcess; - function execFile( - file: string, - args: ReadonlyArray | undefined | null, - options: ExecFileOptionsWithBufferEncoding, - callback: (error: ExecFileException | null, stdout: Buffer, stderr: Buffer) => void - ): ChildProcess; - // `options` with well known `encoding` means stdout/stderr are definitely `string`. - function execFile(file: string, options: ExecFileOptionsWithStringEncoding, callback: (error: ExecFileException | null, stdout: string, stderr: string) => void): ChildProcess; - function execFile( - file: string, - args: ReadonlyArray | undefined | null, - options: ExecFileOptionsWithStringEncoding, - callback: (error: ExecFileException | null, stdout: string, stderr: string) => void - ): ChildProcess; - // `options` with an `encoding` whose type is `string` means stdout/stderr could either be `Buffer` or `string`. - // There is no guarantee the `encoding` is unknown as `string` is a superset of `BufferEncoding`. - function execFile(file: string, options: ExecFileOptionsWithOtherEncoding, callback: (error: ExecFileException | null, stdout: string | Buffer, stderr: string | Buffer) => void): ChildProcess; - function execFile( - file: string, - args: ReadonlyArray | undefined | null, - options: ExecFileOptionsWithOtherEncoding, - callback: (error: ExecFileException | null, stdout: string | Buffer, stderr: string | Buffer) => void - ): ChildProcess; - // `options` without an `encoding` means stdout/stderr are definitely `string`. - function execFile(file: string, options: ExecFileOptions, callback: (error: ExecFileException | null, stdout: string, stderr: string) => void): ChildProcess; - function execFile( - file: string, - args: ReadonlyArray | undefined | null, - options: ExecFileOptions, - callback: (error: ExecFileException | null, stdout: string, stderr: string) => void - ): ChildProcess; - // fallback if nothing else matches. Worst case is always `string | Buffer`. - function execFile( - file: string, - options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null, - callback: ((error: ExecFileException | null, stdout: string | Buffer, stderr: string | Buffer) => void) | undefined | null - ): ChildProcess; - function execFile( - file: string, - args: ReadonlyArray | undefined | null, - options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null, - callback: ((error: ExecFileException | null, stdout: string | Buffer, stderr: string | Buffer) => void) | undefined | null - ): ChildProcess; - namespace execFile { - function __promisify__(file: string): PromiseWithChild<{ - stdout: string; - stderr: string; - }>; - function __promisify__( - file: string, - args: ReadonlyArray | undefined | null - ): PromiseWithChild<{ - stdout: string; - stderr: string; - }>; - function __promisify__( - file: string, - options: ExecFileOptionsWithBufferEncoding - ): PromiseWithChild<{ - stdout: Buffer; - stderr: Buffer; - }>; - function __promisify__( - file: string, - args: ReadonlyArray | undefined | null, - options: ExecFileOptionsWithBufferEncoding - ): PromiseWithChild<{ - stdout: Buffer; - stderr: Buffer; - }>; - function __promisify__( - file: string, - options: ExecFileOptionsWithStringEncoding - ): PromiseWithChild<{ - stdout: string; - stderr: string; - }>; - function __promisify__( - file: string, - args: ReadonlyArray | undefined | null, - options: ExecFileOptionsWithStringEncoding - ): PromiseWithChild<{ - stdout: string; - stderr: string; - }>; - function __promisify__( - file: string, - options: ExecFileOptionsWithOtherEncoding - ): PromiseWithChild<{ - stdout: string | Buffer; - stderr: string | Buffer; - }>; - function __promisify__( - file: string, - args: ReadonlyArray | undefined | null, - options: ExecFileOptionsWithOtherEncoding - ): PromiseWithChild<{ - stdout: string | Buffer; - stderr: string | Buffer; - }>; - function __promisify__( - file: string, - options: ExecFileOptions - ): PromiseWithChild<{ - stdout: string; - stderr: string; - }>; - function __promisify__( - file: string, - args: ReadonlyArray | undefined | null, - options: ExecFileOptions - ): PromiseWithChild<{ - stdout: string; - stderr: string; - }>; - function __promisify__( - file: string, - options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null - ): PromiseWithChild<{ - stdout: string | Buffer; - stderr: string | Buffer; - }>; - function __promisify__( - file: string, - args: ReadonlyArray | undefined | null, - options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null - ): PromiseWithChild<{ - stdout: string | Buffer; - stderr: string | Buffer; - }>; - } - interface ForkOptions extends ProcessEnvOptions, MessagingOptions, Abortable { - execPath?: string | undefined; - execArgv?: string[] | undefined; - silent?: boolean | undefined; - stdio?: StdioOptions | undefined; - detached?: boolean | undefined; - windowsVerbatimArguments?: boolean | undefined; - } - /** - * The `child_process.fork()` method is a special case of {@link spawn} used specifically to spawn new Node.js processes. - * Like {@link spawn}, a `ChildProcess` object is returned. The - * returned `ChildProcess` will have an additional communication channel - * built-in that allows messages to be passed back and forth between the parent and - * child. See `subprocess.send()` for details. - * - * Keep in mind that spawned Node.js child processes are - * independent of the parent with exception of the IPC communication channel - * that is established between the two. Each process has its own memory, with - * their own V8 instances. Because of the additional resource allocations - * required, spawning a large number of child Node.js processes is not - * recommended. - * - * By default, `child_process.fork()` will spawn new Node.js instances using the `process.execPath` of the parent process. The `execPath` property in the`options` object allows for an alternative - * execution path to be used. - * - * Node.js processes launched with a custom `execPath` will communicate with the - * parent process using the file descriptor (fd) identified using the - * environment variable `NODE_CHANNEL_FD` on the child process. - * - * Unlike the [`fork(2)`](http://man7.org/linux/man-pages/man2/fork.2.html) POSIX system call, `child_process.fork()` does not clone the - * current process. - * - * The `shell` option available in {@link spawn} is not supported by`child_process.fork()` and will be ignored if set. - * - * If the `signal` option is enabled, calling `.abort()` on the corresponding`AbortController` is similar to calling `.kill()` on the child process except - * the error passed to the callback will be an `AbortError`: - * - * ```js - * if (process.argv[2] === 'child') { - * setTimeout(() => { - * console.log(`Hello from ${process.argv[2]}!`); - * }, 1_000); - * } else { - * const { fork } = require('child_process'); - * const controller = new AbortController(); - * const { signal } = controller; - * const child = fork(__filename, ['child'], { signal }); - * child.on('error', (err) => { - * // This will be called with err being an AbortError if the controller aborts - * }); - * controller.abort(); // Stops the child process - * } - * ``` - * @since v0.5.0 - * @param modulePath The module to run in the child. - * @param args List of string arguments. - */ - function fork(modulePath: string, options?: ForkOptions): ChildProcess; - function fork(modulePath: string, args?: ReadonlyArray, options?: ForkOptions): ChildProcess; - interface SpawnSyncOptions extends CommonSpawnOptions { - input?: string | NodeJS.ArrayBufferView | undefined; - maxBuffer?: number | undefined; - encoding?: BufferEncoding | 'buffer' | null | undefined; - } - interface SpawnSyncOptionsWithStringEncoding extends SpawnSyncOptions { - encoding: BufferEncoding; - } - interface SpawnSyncOptionsWithBufferEncoding extends SpawnSyncOptions { - encoding?: 'buffer' | null | undefined; - } - interface SpawnSyncReturns { - pid: number; - output: Array; - stdout: T; - stderr: T; - status: number | null; - signal: NodeJS.Signals | null; - error?: Error | undefined; - } - /** - * The `child_process.spawnSync()` method is generally identical to {@link spawn} with the exception that the function will not return - * until the child process has fully closed. When a timeout has been encountered - * and `killSignal` is sent, the method won't return until the process has - * completely exited. If the process intercepts and handles the `SIGTERM` signal - * and doesn't exit, the parent process will wait until the child process has - * exited. - * - * **If the `shell` option is enabled, do not pass unsanitized user input to this** - * **function. Any input containing shell metacharacters may be used to trigger** - * **arbitrary command execution.** - * @since v0.11.12 - * @param command The command to run. - * @param args List of string arguments. - */ - function spawnSync(command: string): SpawnSyncReturns; - function spawnSync(command: string, options: SpawnSyncOptionsWithStringEncoding): SpawnSyncReturns; - function spawnSync(command: string, options: SpawnSyncOptionsWithBufferEncoding): SpawnSyncReturns; - function spawnSync(command: string, options?: SpawnSyncOptions): SpawnSyncReturns; - function spawnSync(command: string, args: ReadonlyArray): SpawnSyncReturns; - function spawnSync(command: string, args: ReadonlyArray, options: SpawnSyncOptionsWithStringEncoding): SpawnSyncReturns; - function spawnSync(command: string, args: ReadonlyArray, options: SpawnSyncOptionsWithBufferEncoding): SpawnSyncReturns; - function spawnSync(command: string, args?: ReadonlyArray, options?: SpawnSyncOptions): SpawnSyncReturns; - interface CommonExecOptions extends CommonOptions { - input?: string | NodeJS.ArrayBufferView | undefined; - stdio?: StdioOptions | undefined; - killSignal?: NodeJS.Signals | number | undefined; - maxBuffer?: number | undefined; - encoding?: BufferEncoding | 'buffer' | null | undefined; - } - interface ExecSyncOptions extends CommonExecOptions { - shell?: string | undefined; - } - interface ExecSyncOptionsWithStringEncoding extends ExecSyncOptions { - encoding: BufferEncoding; - } - interface ExecSyncOptionsWithBufferEncoding extends ExecSyncOptions { - encoding?: 'buffer' | null | undefined; - } - /** - * The `child_process.execSync()` method is generally identical to {@link exec} with the exception that the method will not return - * until the child process has fully closed. When a timeout has been encountered - * and `killSignal` is sent, the method won't return until the process has - * completely exited. If the child process intercepts and handles the `SIGTERM`signal and doesn't exit, the parent process will wait until the child process - * has exited. - * - * If the process times out or has a non-zero exit code, this method will throw. - * The `Error` object will contain the entire result from {@link spawnSync}. - * - * **Never pass unsanitized user input to this function. Any input containing shell** - * **metacharacters may be used to trigger arbitrary command execution.** - * @since v0.11.12 - * @param command The command to run. - * @return The stdout from the command. - */ - function execSync(command: string): Buffer; - function execSync(command: string, options: ExecSyncOptionsWithStringEncoding): string; - function execSync(command: string, options: ExecSyncOptionsWithBufferEncoding): Buffer; - function execSync(command: string, options?: ExecSyncOptions): string | Buffer; - interface ExecFileSyncOptions extends CommonExecOptions { - shell?: boolean | string | undefined; - } - interface ExecFileSyncOptionsWithStringEncoding extends ExecFileSyncOptions { - encoding: BufferEncoding; - } - interface ExecFileSyncOptionsWithBufferEncoding extends ExecFileSyncOptions { - encoding?: 'buffer' | null; // specify `null`. - } - /** - * The `child_process.execFileSync()` method is generally identical to {@link execFile} with the exception that the method will not - * return until the child process has fully closed. When a timeout has been - * encountered and `killSignal` is sent, the method won't return until the process - * has completely exited. - * - * If the child process intercepts and handles the `SIGTERM` signal and - * does not exit, the parent process will still wait until the child process has - * exited. - * - * If the process times out or has a non-zero exit code, this method will throw an `Error` that will include the full result of the underlying {@link spawnSync}. - * - * **If the `shell` option is enabled, do not pass unsanitized user input to this** - * **function. Any input containing shell metacharacters may be used to trigger** - * **arbitrary command execution.** - * @since v0.11.12 - * @param file The name or path of the executable file to run. - * @param args List of string arguments. - * @return The stdout from the command. - */ - function execFileSync(file: string): Buffer; - function execFileSync(file: string, options: ExecFileSyncOptionsWithStringEncoding): string; - function execFileSync(file: string, options: ExecFileSyncOptionsWithBufferEncoding): Buffer; - function execFileSync(file: string, options?: ExecFileSyncOptions): string | Buffer; - function execFileSync(file: string, args: ReadonlyArray): Buffer; - function execFileSync(file: string, args: ReadonlyArray, options: ExecFileSyncOptionsWithStringEncoding): string; - function execFileSync(file: string, args: ReadonlyArray, options: ExecFileSyncOptionsWithBufferEncoding): Buffer; - function execFileSync(file: string, args?: ReadonlyArray, options?: ExecFileSyncOptions): string | Buffer; -} -declare module 'node:child_process' { - export * from 'child_process'; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/cluster.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/cluster.d.ts deleted file mode 100755 index 37dbc574..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/cluster.d.ts +++ /dev/null @@ -1,410 +0,0 @@ -/** - * Clusters of Node.js processes can be used to run multiple instances of Node.js - * that can distribute workloads among their application threads. When process - * isolation is not needed, use the `worker_threads` module instead, which - * allows running multiple application threads within a single Node.js instance. - * - * The cluster module allows easy creation of child processes that all share - * server ports. - * - * ```js - * import cluster from 'cluster'; - * import http from 'http'; - * import { cpus } from 'os'; - * import process from 'process'; - * - * const numCPUs = cpus().length; - * - * if (cluster.isPrimary) { - * console.log(`Primary ${process.pid} is running`); - * - * // Fork workers. - * for (let i = 0; i < numCPUs; i++) { - * cluster.fork(); - * } - * - * cluster.on('exit', (worker, code, signal) => { - * console.log(`worker ${worker.process.pid} died`); - * }); - * } else { - * // Workers can share any TCP connection - * // In this case it is an HTTP server - * http.createServer((req, res) => { - * res.writeHead(200); - * res.end('hello world\n'); - * }).listen(8000); - * - * console.log(`Worker ${process.pid} started`); - * } - * ``` - * - * Running Node.js will now share port 8000 between the workers: - * - * ```console - * $ node server.js - * Primary 3596 is running - * Worker 4324 started - * Worker 4520 started - * Worker 6056 started - * Worker 5644 started - * ``` - * - * On Windows, it is not yet possible to set up a named pipe server in a worker. - * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/cluster.js) - */ -declare module 'cluster' { - import * as child from 'node:child_process'; - import EventEmitter = require('node:events'); - import * as net from 'node:net'; - export interface ClusterSettings { - execArgv?: string[] | undefined; // default: process.execArgv - exec?: string | undefined; - args?: string[] | undefined; - silent?: boolean | undefined; - stdio?: any[] | undefined; - uid?: number | undefined; - gid?: number | undefined; - inspectPort?: number | (() => number) | undefined; - } - export interface Address { - address: string; - port: number; - addressType: number | 'udp4' | 'udp6'; // 4, 6, -1, "udp4", "udp6" - } - /** - * A `Worker` object contains all public information and method about a worker. - * In the primary it can be obtained using `cluster.workers`. In a worker - * it can be obtained using `cluster.worker`. - * @since v0.7.0 - */ - export class Worker extends EventEmitter { - /** - * Each new worker is given its own unique id, this id is stored in the`id`. - * - * While a worker is alive, this is the key that indexes it in`cluster.workers`. - * @since v0.8.0 - */ - id: number; - /** - * All workers are created using `child_process.fork()`, the returned object - * from this function is stored as `.process`. In a worker, the global `process`is stored. - * - * See: `Child Process module`. - * - * Workers will call `process.exit(0)` if the `'disconnect'` event occurs - * on `process` and `.exitedAfterDisconnect` is not `true`. This protects against - * accidental disconnection. - * @since v0.7.0 - */ - process: child.ChildProcess; - /** - * Send a message to a worker or primary, optionally with a handle. - * - * In the primary, this sends a message to a specific worker. It is identical to `ChildProcess.send()`. - * - * In a worker, this sends a message to the primary. It is identical to`process.send()`. - * - * This example will echo back all messages from the primary: - * - * ```js - * if (cluster.isPrimary) { - * const worker = cluster.fork(); - * worker.send('hi there'); - * - * } else if (cluster.isWorker) { - * process.on('message', (msg) => { - * process.send(msg); - * }); - * } - * ``` - * @since v0.7.0 - * @param options The `options` argument, if present, is an object used to parameterize the sending of certain types of handles. `options` supports the following properties: - */ - send(message: child.Serializable, callback?: (error: Error | null) => void): boolean; - send(message: child.Serializable, sendHandle: child.SendHandle, callback?: (error: Error | null) => void): boolean; - send(message: child.Serializable, sendHandle: child.SendHandle, options?: child.MessageOptions, callback?: (error: Error | null) => void): boolean; - /** - * This function will kill the worker. In the primary worker, it does this by - * disconnecting the `worker.process`, and once disconnected, killing with`signal`. In the worker, it does it by killing the process with `signal`. - * - * The `kill()` function kills the worker process without waiting for a graceful - * disconnect, it has the same behavior as `worker.process.kill()`. - * - * This method is aliased as `worker.destroy()` for backwards compatibility. - * - * In a worker, `process.kill()` exists, but it is not this function; - * it is `kill()`. - * @since v0.9.12 - * @param [signal='SIGTERM'] Name of the kill signal to send to the worker process. - */ - kill(signal?: string): void; - destroy(signal?: string): void; - /** - * In a worker, this function will close all servers, wait for the `'close'` event - * on those servers, and then disconnect the IPC channel. - * - * In the primary, an internal message is sent to the worker causing it to call`.disconnect()` on itself. - * - * Causes `.exitedAfterDisconnect` to be set. - * - * After a server is closed, it will no longer accept new connections, - * but connections may be accepted by any other listening worker. Existing - * connections will be allowed to close as usual. When no more connections exist, - * see `server.close()`, the IPC channel to the worker will close allowing it - * to die gracefully. - * - * The above applies _only_ to server connections, client connections are not - * automatically closed by workers, and disconnect does not wait for them to close - * before exiting. - * - * In a worker, `process.disconnect` exists, but it is not this function; - * it is `disconnect()`. - * - * Because long living server connections may block workers from disconnecting, it - * may be useful to send a message, so application specific actions may be taken to - * close them. It also may be useful to implement a timeout, killing a worker if - * the `'disconnect'` event has not been emitted after some time. - * - * ```js - * if (cluster.isPrimary) { - * const worker = cluster.fork(); - * let timeout; - * - * worker.on('listening', (address) => { - * worker.send('shutdown'); - * worker.disconnect(); - * timeout = setTimeout(() => { - * worker.kill(); - * }, 2000); - * }); - * - * worker.on('disconnect', () => { - * clearTimeout(timeout); - * }); - * - * } else if (cluster.isWorker) { - * const net = require('net'); - * const server = net.createServer((socket) => { - * // Connections never end - * }); - * - * server.listen(8000); - * - * process.on('message', (msg) => { - * if (msg === 'shutdown') { - * // Initiate graceful close of any connections to server - * } - * }); - * } - * ``` - * @since v0.7.7 - * @return A reference to `worker`. - */ - disconnect(): void; - /** - * This function returns `true` if the worker is connected to its primary via its - * IPC channel, `false` otherwise. A worker is connected to its primary after it - * has been created. It is disconnected after the `'disconnect'` event is emitted. - * @since v0.11.14 - */ - isConnected(): boolean; - /** - * This function returns `true` if the worker's process has terminated (either - * because of exiting or being signaled). Otherwise, it returns `false`. - * - * ```js - * import cluster from 'cluster'; - * import http from 'http'; - * import { cpus } from 'os'; - * import process from 'process'; - * - * const numCPUs = cpus().length; - * - * if (cluster.isPrimary) { - * console.log(`Primary ${process.pid} is running`); - * - * // Fork workers. - * for (let i = 0; i < numCPUs; i++) { - * cluster.fork(); - * } - * - * cluster.on('fork', (worker) => { - * console.log('worker is dead:', worker.isDead()); - * }); - * - * cluster.on('exit', (worker, code, signal) => { - * console.log('worker is dead:', worker.isDead()); - * }); - * } else { - * // Workers can share any TCP connection. In this case, it is an HTTP server. - * http.createServer((req, res) => { - * res.writeHead(200); - * res.end(`Current process\n ${process.pid}`); - * process.kill(process.pid); - * }).listen(8000); - * } - * ``` - * @since v0.11.14 - */ - isDead(): boolean; - /** - * This property is `true` if the worker exited due to `.disconnect()`. - * If the worker exited any other way, it is `false`. If the - * worker has not exited, it is `undefined`. - * - * The boolean `worker.exitedAfterDisconnect` allows distinguishing between - * voluntary and accidental exit, the primary may choose not to respawn a worker - * based on this value. - * - * ```js - * cluster.on('exit', (worker, code, signal) => { - * if (worker.exitedAfterDisconnect === true) { - * console.log('Oh, it was just voluntary – no need to worry'); - * } - * }); - * - * // kill worker - * worker.kill(); - * ``` - * @since v6.0.0 - */ - exitedAfterDisconnect: boolean; - /** - * events.EventEmitter - * 1. disconnect - * 2. error - * 3. exit - * 4. listening - * 5. message - * 6. online - */ - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: 'disconnect', listener: () => void): this; - addListener(event: 'error', listener: (error: Error) => void): this; - addListener(event: 'exit', listener: (code: number, signal: string) => void): this; - addListener(event: 'listening', listener: (address: Address) => void): this; - addListener(event: 'message', listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. - addListener(event: 'online', listener: () => void): this; - emit(event: string | symbol, ...args: any[]): boolean; - emit(event: 'disconnect'): boolean; - emit(event: 'error', error: Error): boolean; - emit(event: 'exit', code: number, signal: string): boolean; - emit(event: 'listening', address: Address): boolean; - emit(event: 'message', message: any, handle: net.Socket | net.Server): boolean; - emit(event: 'online'): boolean; - on(event: string, listener: (...args: any[]) => void): this; - on(event: 'disconnect', listener: () => void): this; - on(event: 'error', listener: (error: Error) => void): this; - on(event: 'exit', listener: (code: number, signal: string) => void): this; - on(event: 'listening', listener: (address: Address) => void): this; - on(event: 'message', listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. - on(event: 'online', listener: () => void): this; - once(event: string, listener: (...args: any[]) => void): this; - once(event: 'disconnect', listener: () => void): this; - once(event: 'error', listener: (error: Error) => void): this; - once(event: 'exit', listener: (code: number, signal: string) => void): this; - once(event: 'listening', listener: (address: Address) => void): this; - once(event: 'message', listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. - once(event: 'online', listener: () => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: 'disconnect', listener: () => void): this; - prependListener(event: 'error', listener: (error: Error) => void): this; - prependListener(event: 'exit', listener: (code: number, signal: string) => void): this; - prependListener(event: 'listening', listener: (address: Address) => void): this; - prependListener(event: 'message', listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. - prependListener(event: 'online', listener: () => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: 'disconnect', listener: () => void): this; - prependOnceListener(event: 'error', listener: (error: Error) => void): this; - prependOnceListener(event: 'exit', listener: (code: number, signal: string) => void): this; - prependOnceListener(event: 'listening', listener: (address: Address) => void): this; - prependOnceListener(event: 'message', listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. - prependOnceListener(event: 'online', listener: () => void): this; - } - export interface Cluster extends EventEmitter { - disconnect(callback?: () => void): void; - fork(env?: any): Worker; - /** @deprecated since v16.0.0 - use isPrimary. */ - readonly isMaster: boolean; - readonly isPrimary: boolean; - readonly isWorker: boolean; - schedulingPolicy: number; - readonly settings: ClusterSettings; - /** @deprecated since v16.0.0 - use setupPrimary. */ - setupMaster(settings?: ClusterSettings): void; - /** - * `setupPrimary` is used to change the default 'fork' behavior. Once called, the settings will be present in cluster.settings. - */ - setupPrimary(settings?: ClusterSettings): void; - readonly worker?: Worker | undefined; - readonly workers?: NodeJS.Dict | undefined; - readonly SCHED_NONE: number; - readonly SCHED_RR: number; - /** - * events.EventEmitter - * 1. disconnect - * 2. exit - * 3. fork - * 4. listening - * 5. message - * 6. online - * 7. setup - */ - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: 'disconnect', listener: (worker: Worker) => void): this; - addListener(event: 'exit', listener: (worker: Worker, code: number, signal: string) => void): this; - addListener(event: 'fork', listener: (worker: Worker) => void): this; - addListener(event: 'listening', listener: (worker: Worker, address: Address) => void): this; - addListener(event: 'message', listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. - addListener(event: 'online', listener: (worker: Worker) => void): this; - addListener(event: 'setup', listener: (settings: ClusterSettings) => void): this; - emit(event: string | symbol, ...args: any[]): boolean; - emit(event: 'disconnect', worker: Worker): boolean; - emit(event: 'exit', worker: Worker, code: number, signal: string): boolean; - emit(event: 'fork', worker: Worker): boolean; - emit(event: 'listening', worker: Worker, address: Address): boolean; - emit(event: 'message', worker: Worker, message: any, handle: net.Socket | net.Server): boolean; - emit(event: 'online', worker: Worker): boolean; - emit(event: 'setup', settings: ClusterSettings): boolean; - on(event: string, listener: (...args: any[]) => void): this; - on(event: 'disconnect', listener: (worker: Worker) => void): this; - on(event: 'exit', listener: (worker: Worker, code: number, signal: string) => void): this; - on(event: 'fork', listener: (worker: Worker) => void): this; - on(event: 'listening', listener: (worker: Worker, address: Address) => void): this; - on(event: 'message', listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. - on(event: 'online', listener: (worker: Worker) => void): this; - on(event: 'setup', listener: (settings: ClusterSettings) => void): this; - once(event: string, listener: (...args: any[]) => void): this; - once(event: 'disconnect', listener: (worker: Worker) => void): this; - once(event: 'exit', listener: (worker: Worker, code: number, signal: string) => void): this; - once(event: 'fork', listener: (worker: Worker) => void): this; - once(event: 'listening', listener: (worker: Worker, address: Address) => void): this; - once(event: 'message', listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. - once(event: 'online', listener: (worker: Worker) => void): this; - once(event: 'setup', listener: (settings: ClusterSettings) => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: 'disconnect', listener: (worker: Worker) => void): this; - prependListener(event: 'exit', listener: (worker: Worker, code: number, signal: string) => void): this; - prependListener(event: 'fork', listener: (worker: Worker) => void): this; - prependListener(event: 'listening', listener: (worker: Worker, address: Address) => void): this; - // the handle is a net.Socket or net.Server object, or undefined. - prependListener(event: 'message', listener: (worker: Worker, message: any, handle?: net.Socket | net.Server) => void): this; - prependListener(event: 'online', listener: (worker: Worker) => void): this; - prependListener(event: 'setup', listener: (settings: ClusterSettings) => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: 'disconnect', listener: (worker: Worker) => void): this; - prependOnceListener(event: 'exit', listener: (worker: Worker, code: number, signal: string) => void): this; - prependOnceListener(event: 'fork', listener: (worker: Worker) => void): this; - prependOnceListener(event: 'listening', listener: (worker: Worker, address: Address) => void): this; - // the handle is a net.Socket or net.Server object, or undefined. - prependOnceListener(event: 'message', listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): this; - prependOnceListener(event: 'online', listener: (worker: Worker) => void): this; - prependOnceListener(event: 'setup', listener: (settings: ClusterSettings) => void): this; - } - const cluster: Cluster; - export default cluster; -} -declare module 'node:cluster' { - export * from 'cluster'; - export { default as default } from 'cluster'; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/console.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/console.d.ts deleted file mode 100755 index 16c9137a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/console.d.ts +++ /dev/null @@ -1,412 +0,0 @@ -/** - * The `console` module provides a simple debugging console that is similar to the - * JavaScript console mechanism provided by web browsers. - * - * The module exports two specific components: - * - * * A `Console` class with methods such as `console.log()`, `console.error()` and`console.warn()` that can be used to write to any Node.js stream. - * * A global `console` instance configured to write to `process.stdout` and `process.stderr`. The global `console` can be used without calling`require('console')`. - * - * _**Warning**_: The global console object's methods are neither consistently - * synchronous like the browser APIs they resemble, nor are they consistently - * asynchronous like all other Node.js streams. See the `note on process I/O` for - * more information. - * - * Example using the global `console`: - * - * ```js - * console.log('hello world'); - * // Prints: hello world, to stdout - * console.log('hello %s', 'world'); - * // Prints: hello world, to stdout - * console.error(new Error('Whoops, something bad happened')); - * // Prints error message and stack trace to stderr: - * // Error: Whoops, something bad happened - * // at [eval]:5:15 - * // at Script.runInThisContext (node:vm:132:18) - * // at Object.runInThisContext (node:vm:309:38) - * // at node:internal/process/execution:77:19 - * // at [eval]-wrapper:6:22 - * // at evalScript (node:internal/process/execution:76:60) - * // at node:internal/main/eval_string:23:3 - * - * const name = 'Will Robinson'; - * console.warn(`Danger ${name}! Danger!`); - * // Prints: Danger Will Robinson! Danger!, to stderr - * ``` - * - * Example using the `Console` class: - * - * ```js - * const out = getStreamSomehow(); - * const err = getStreamSomehow(); - * const myConsole = new console.Console(out, err); - * - * myConsole.log('hello world'); - * // Prints: hello world, to out - * myConsole.log('hello %s', 'world'); - * // Prints: hello world, to out - * myConsole.error(new Error('Whoops, something bad happened')); - * // Prints: [Error: Whoops, something bad happened], to err - * - * const name = 'Will Robinson'; - * myConsole.warn(`Danger ${name}! Danger!`); - * // Prints: Danger Will Robinson! Danger!, to err - * ``` - * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/console.js) - */ -declare module 'console' { - import console = require('node:console'); - export = console; -} -declare module 'node:console' { - import { InspectOptions } from 'node:util'; - global { - // This needs to be global to avoid TS2403 in case lib.dom.d.ts is present in the same build - interface Console { - Console: console.ConsoleConstructor; - /** - * `console.assert()` writes a message if `value` is [falsy](https://developer.mozilla.org/en-US/docs/Glossary/Falsy) or omitted. It only - * writes a message and does not otherwise affect execution. The output always - * starts with `"Assertion failed"`. If provided, `message` is formatted using `util.format()`. - * - * If `value` is [truthy](https://developer.mozilla.org/en-US/docs/Glossary/Truthy), nothing happens. - * - * ```js - * console.assert(true, 'does nothing'); - * - * console.assert(false, 'Whoops %s work', 'didn\'t'); - * // Assertion failed: Whoops didn't work - * - * console.assert(); - * // Assertion failed - * ``` - * @since v0.1.101 - * @param value The value tested for being truthy. - * @param message All arguments besides `value` are used as error message. - */ - assert(value: any, message?: string, ...optionalParams: any[]): void; - /** - * When `stdout` is a TTY, calling `console.clear()` will attempt to clear the - * TTY. When `stdout` is not a TTY, this method does nothing. - * - * The specific operation of `console.clear()` can vary across operating systems - * and terminal types. For most Linux operating systems, `console.clear()`operates similarly to the `clear` shell command. On Windows, `console.clear()`will clear only the output in the - * current terminal viewport for the Node.js - * binary. - * @since v8.3.0 - */ - clear(): void; - /** - * Maintains an internal counter specific to `label` and outputs to `stdout` the - * number of times `console.count()` has been called with the given `label`. - * - * ```js - * > console.count() - * default: 1 - * undefined - * > console.count('default') - * default: 2 - * undefined - * > console.count('abc') - * abc: 1 - * undefined - * > console.count('xyz') - * xyz: 1 - * undefined - * > console.count('abc') - * abc: 2 - * undefined - * > console.count() - * default: 3 - * undefined - * > - * ``` - * @since v8.3.0 - * @param label The display label for the counter. - */ - count(label?: string): void; - /** - * Resets the internal counter specific to `label`. - * - * ```js - * > console.count('abc'); - * abc: 1 - * undefined - * > console.countReset('abc'); - * undefined - * > console.count('abc'); - * abc: 1 - * undefined - * > - * ``` - * @since v8.3.0 - * @param label The display label for the counter. - */ - countReset(label?: string): void; - /** - * The `console.debug()` function is an alias for {@link log}. - * @since v8.0.0 - */ - debug(message?: any, ...optionalParams: any[]): void; - /** - * Uses `util.inspect()` on `obj` and prints the resulting string to `stdout`. - * This function bypasses any custom `inspect()` function defined on `obj`. - * @since v0.1.101 - */ - dir(obj: any, options?: InspectOptions): void; - /** - * This method calls `console.log()` passing it the arguments received. - * This method does not produce any XML formatting. - * @since v8.0.0 - */ - dirxml(...data: any[]): void; - /** - * Prints to `stderr` with newline. Multiple arguments can be passed, with the - * first used as the primary message and all additional used as substitution - * values similar to [`printf(3)`](http://man7.org/linux/man-pages/man3/printf.3.html) (the arguments are all passed to `util.format()`). - * - * ```js - * const code = 5; - * console.error('error #%d', code); - * // Prints: error #5, to stderr - * console.error('error', code); - * // Prints: error 5, to stderr - * ``` - * - * If formatting elements (e.g. `%d`) are not found in the first string then `util.inspect()` is called on each argument and the resulting string - * values are concatenated. See `util.format()` for more information. - * @since v0.1.100 - */ - error(message?: any, ...optionalParams: any[]): void; - /** - * Increases indentation of subsequent lines by spaces for `groupIndentation`length. - * - * If one or more `label`s are provided, those are printed first without the - * additional indentation. - * @since v8.5.0 - */ - group(...label: any[]): void; - /** - * An alias for {@link group}. - * @since v8.5.0 - */ - groupCollapsed(...label: any[]): void; - /** - * Decreases indentation of subsequent lines by spaces for `groupIndentation`length. - * @since v8.5.0 - */ - groupEnd(): void; - /** - * The `console.info()` function is an alias for {@link log}. - * @since v0.1.100 - */ - info(message?: any, ...optionalParams: any[]): void; - /** - * Prints to `stdout` with newline. Multiple arguments can be passed, with the - * first used as the primary message and all additional used as substitution - * values similar to [`printf(3)`](http://man7.org/linux/man-pages/man3/printf.3.html) (the arguments are all passed to `util.format()`). - * - * ```js - * const count = 5; - * console.log('count: %d', count); - * // Prints: count: 5, to stdout - * console.log('count:', count); - * // Prints: count: 5, to stdout - * ``` - * - * See `util.format()` for more information. - * @since v0.1.100 - */ - log(message?: any, ...optionalParams: any[]): void; - /** - * Try to construct a table with the columns of the properties of `tabularData`(or use `properties`) and rows of `tabularData` and log it. Falls back to just - * logging the argument if it can’t be parsed as tabular. - * - * ```js - * // These can't be parsed as tabular data - * console.table(Symbol()); - * // Symbol() - * - * console.table(undefined); - * // undefined - * - * console.table([{ a: 1, b: 'Y' }, { a: 'Z', b: 2 }]); - * // ┌─────────┬─────┬─────┐ - * // │ (index) │ a │ b │ - * // ├─────────┼─────┼─────┤ - * // │ 0 │ 1 │ 'Y' │ - * // │ 1 │ 'Z' │ 2 │ - * // └─────────┴─────┴─────┘ - * - * console.table([{ a: 1, b: 'Y' }, { a: 'Z', b: 2 }], ['a']); - * // ┌─────────┬─────┐ - * // │ (index) │ a │ - * // ├─────────┼─────┤ - * // │ 0 │ 1 │ - * // │ 1 │ 'Z' │ - * // └─────────┴─────┘ - * ``` - * @since v10.0.0 - * @param properties Alternate properties for constructing the table. - */ - table(tabularData: any, properties?: ReadonlyArray): void; - /** - * Starts a timer that can be used to compute the duration of an operation. Timers - * are identified by a unique `label`. Use the same `label` when calling {@link timeEnd} to stop the timer and output the elapsed time in - * suitable time units to `stdout`. For example, if the elapsed - * time is 3869ms, `console.timeEnd()` displays "3.869s". - * @since v0.1.104 - */ - time(label?: string): void; - /** - * Stops a timer that was previously started by calling {@link time} and - * prints the result to `stdout`: - * - * ```js - * console.time('100-elements'); - * for (let i = 0; i < 100; i++) {} - * console.timeEnd('100-elements'); - * // prints 100-elements: 225.438ms - * ``` - * @since v0.1.104 - */ - timeEnd(label?: string): void; - /** - * For a timer that was previously started by calling {@link time}, prints - * the elapsed time and other `data` arguments to `stdout`: - * - * ```js - * console.time('process'); - * const value = expensiveProcess1(); // Returns 42 - * console.timeLog('process', value); - * // Prints "process: 365.227ms 42". - * doExpensiveProcess2(value); - * console.timeEnd('process'); - * ``` - * @since v10.7.0 - */ - timeLog(label?: string, ...data: any[]): void; - /** - * Prints to `stderr` the string `'Trace: '`, followed by the `util.format()` formatted message and stack trace to the current position in the code. - * - * ```js - * console.trace('Show me'); - * // Prints: (stack trace will vary based on where trace is called) - * // Trace: Show me - * // at repl:2:9 - * // at REPLServer.defaultEval (repl.js:248:27) - * // at bound (domain.js:287:14) - * // at REPLServer.runBound [as eval] (domain.js:300:12) - * // at REPLServer. (repl.js:412:12) - * // at emitOne (events.js:82:20) - * // at REPLServer.emit (events.js:169:7) - * // at REPLServer.Interface._onLine (readline.js:210:10) - * // at REPLServer.Interface._line (readline.js:549:8) - * // at REPLServer.Interface._ttyWrite (readline.js:826:14) - * ``` - * @since v0.1.104 - */ - trace(message?: any, ...optionalParams: any[]): void; - /** - * The `console.warn()` function is an alias for {@link error}. - * @since v0.1.100 - */ - warn(message?: any, ...optionalParams: any[]): void; - // --- Inspector mode only --- - /** - * This method does not display anything unless used in the inspector. - * Starts a JavaScript CPU profile with an optional label. - */ - profile(label?: string): void; - /** - * This method does not display anything unless used in the inspector. - * Stops the current JavaScript CPU profiling session if one has been started and prints the report to the Profiles panel of the inspector. - */ - profileEnd(label?: string): void; - /** - * This method does not display anything unless used in the inspector. - * Adds an event with the label `label` to the Timeline panel of the inspector. - */ - timeStamp(label?: string): void; - } - /** - * The `console` module provides a simple debugging console that is similar to the - * JavaScript console mechanism provided by web browsers. - * - * The module exports two specific components: - * - * * A `Console` class with methods such as `console.log()`, `console.error()` and`console.warn()` that can be used to write to any Node.js stream. - * * A global `console` instance configured to write to `process.stdout` and `process.stderr`. The global `console` can be used without calling`require('console')`. - * - * _**Warning**_: The global console object's methods are neither consistently - * synchronous like the browser APIs they resemble, nor are they consistently - * asynchronous like all other Node.js streams. See the `note on process I/O` for - * more information. - * - * Example using the global `console`: - * - * ```js - * console.log('hello world'); - * // Prints: hello world, to stdout - * console.log('hello %s', 'world'); - * // Prints: hello world, to stdout - * console.error(new Error('Whoops, something bad happened')); - * // Prints error message and stack trace to stderr: - * // Error: Whoops, something bad happened - * // at [eval]:5:15 - * // at Script.runInThisContext (node:vm:132:18) - * // at Object.runInThisContext (node:vm:309:38) - * // at node:internal/process/execution:77:19 - * // at [eval]-wrapper:6:22 - * // at evalScript (node:internal/process/execution:76:60) - * // at node:internal/main/eval_string:23:3 - * - * const name = 'Will Robinson'; - * console.warn(`Danger ${name}! Danger!`); - * // Prints: Danger Will Robinson! Danger!, to stderr - * ``` - * - * Example using the `Console` class: - * - * ```js - * const out = getStreamSomehow(); - * const err = getStreamSomehow(); - * const myConsole = new console.Console(out, err); - * - * myConsole.log('hello world'); - * // Prints: hello world, to out - * myConsole.log('hello %s', 'world'); - * // Prints: hello world, to out - * myConsole.error(new Error('Whoops, something bad happened')); - * // Prints: [Error: Whoops, something bad happened], to err - * - * const name = 'Will Robinson'; - * myConsole.warn(`Danger ${name}! Danger!`); - * // Prints: Danger Will Robinson! Danger!, to err - * ``` - * @see [source](https://github.com/nodejs/node/blob/v16.4.2/lib/console.js) - */ - namespace console { - interface ConsoleConstructorOptions { - stdout: NodeJS.WritableStream; - stderr?: NodeJS.WritableStream | undefined; - ignoreErrors?: boolean | undefined; - colorMode?: boolean | 'auto' | undefined; - inspectOptions?: InspectOptions | undefined; - /** - * Set group indentation - * @default 2 - */ - groupIndentation?: number | undefined; - } - interface ConsoleConstructor { - prototype: Console; - new (stdout: NodeJS.WritableStream, stderr?: NodeJS.WritableStream, ignoreErrors?: boolean): Console; - new (options: ConsoleConstructorOptions): Console; - } - } - var console: Console; - } - export = globalThis.console; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/constants.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/constants.d.ts deleted file mode 100755 index 208020dc..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/constants.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -/** @deprecated since v6.3.0 - use constants property exposed by the relevant module instead. */ -declare module 'constants' { - import { constants as osConstants, SignalConstants } from 'node:os'; - import { constants as cryptoConstants } from 'node:crypto'; - import { constants as fsConstants } from 'node:fs'; - - const exp: typeof osConstants.errno & - typeof osConstants.priority & - SignalConstants & - typeof cryptoConstants & - typeof fsConstants; - export = exp; -} - -declare module 'node:constants' { - import constants = require('constants'); - export = constants; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/crypto.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/crypto.d.ts deleted file mode 100755 index 888bf729..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/crypto.d.ts +++ /dev/null @@ -1,3964 +0,0 @@ -/** - * The `crypto` module provides cryptographic functionality that includes a set of - * wrappers for OpenSSL's hash, HMAC, cipher, decipher, sign, and verify functions. - * - * ```js - * const { createHmac } = await import('crypto'); - * - * const secret = 'abcdefg'; - * const hash = createHmac('sha256', secret) - * .update('I love cupcakes') - * .digest('hex'); - * console.log(hash); - * // Prints: - * // c0fa1bc00531bd78ef38c628449c5102aeabd49b5dc3a2a516ea6ea959d6658e - * ``` - * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/crypto.js) - */ -declare module 'crypto' { - import * as stream from 'node:stream'; - import { PeerCertificate } from 'node:tls'; - /** - * SPKAC is a Certificate Signing Request mechanism originally implemented by - * Netscape and was specified formally as part of [HTML5's `keygen` element](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/keygen). - * - * `` is deprecated since [HTML 5.2](https://www.w3.org/TR/html52/changes.html#features-removed) and new projects - * should not use this element anymore. - * - * The `crypto` module provides the `Certificate` class for working with SPKAC - * data. The most common usage is handling output generated by the HTML5`` element. Node.js uses [OpenSSL's SPKAC - * implementation](https://www.openssl.org/docs/man1.1.0/apps/openssl-spkac.html) internally. - * @since v0.11.8 - */ - class Certificate { - /** - * ```js - * const { Certificate } = await import('crypto'); - * const spkac = getSpkacSomehow(); - * const challenge = Certificate.exportChallenge(spkac); - * console.log(challenge.toString('utf8')); - * // Prints: the challenge as a UTF8 string - * ``` - * @since v9.0.0 - * @param encoding The `encoding` of the `spkac` string. - * @return The challenge component of the `spkac` data structure, which includes a public key and a challenge. - */ - static exportChallenge(spkac: BinaryLike): Buffer; - /** - * ```js - * const { Certificate } = await import('crypto'); - * const spkac = getSpkacSomehow(); - * const publicKey = Certificate.exportPublicKey(spkac); - * console.log(publicKey); - * // Prints: the public key as - * ``` - * @since v9.0.0 - * @param encoding The `encoding` of the `spkac` string. - * @return The public key component of the `spkac` data structure, which includes a public key and a challenge. - */ - static exportPublicKey(spkac: BinaryLike, encoding?: string): Buffer; - /** - * ```js - * import { Buffer } from 'buffer'; - * const { Certificate } = await import('crypto'); - * - * const spkac = getSpkacSomehow(); - * console.log(Certificate.verifySpkac(Buffer.from(spkac))); - * // Prints: true or false - * ``` - * @since v9.0.0 - * @param encoding The `encoding` of the `spkac` string. - * @return `true` if the given `spkac` data structure is valid, `false` otherwise. - */ - static verifySpkac(spkac: NodeJS.ArrayBufferView): boolean; - /** - * @deprecated - * @param spkac - * @returns The challenge component of the `spkac` data structure, - * which includes a public key and a challenge. - */ - exportChallenge(spkac: BinaryLike): Buffer; - /** - * @deprecated - * @param spkac - * @param encoding The encoding of the spkac string. - * @returns The public key component of the `spkac` data structure, - * which includes a public key and a challenge. - */ - exportPublicKey(spkac: BinaryLike, encoding?: string): Buffer; - /** - * @deprecated - * @param spkac - * @returns `true` if the given `spkac` data structure is valid, - * `false` otherwise. - */ - verifySpkac(spkac: NodeJS.ArrayBufferView): boolean; - } - namespace constants { - // https://nodejs.org/dist/latest-v10.x/docs/api/crypto.html#crypto_crypto_constants - const OPENSSL_VERSION_NUMBER: number; - /** Applies multiple bug workarounds within OpenSSL. See https://www.openssl.org/docs/man1.0.2/ssl/SSL_CTX_set_options.html for detail. */ - const SSL_OP_ALL: number; - /** Allows legacy insecure renegotiation between OpenSSL and unpatched clients or servers. See https://www.openssl.org/docs/man1.0.2/ssl/SSL_CTX_set_options.html. */ - const SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION: number; - /** Attempts to use the server's preferences instead of the client's when selecting a cipher. See https://www.openssl.org/docs/man1.0.2/ssl/SSL_CTX_set_options.html. */ - const SSL_OP_CIPHER_SERVER_PREFERENCE: number; - /** Instructs OpenSSL to use Cisco's "speshul" version of DTLS_BAD_VER. */ - const SSL_OP_CISCO_ANYCONNECT: number; - /** Instructs OpenSSL to turn on cookie exchange. */ - const SSL_OP_COOKIE_EXCHANGE: number; - /** Instructs OpenSSL to add server-hello extension from an early version of the cryptopro draft. */ - const SSL_OP_CRYPTOPRO_TLSEXT_BUG: number; - /** Instructs OpenSSL to disable a SSL 3.0/TLS 1.0 vulnerability workaround added in OpenSSL 0.9.6d. */ - const SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS: number; - /** Instructs OpenSSL to always use the tmp_rsa key when performing RSA operations. */ - const SSL_OP_EPHEMERAL_RSA: number; - /** Allows initial connection to servers that do not support RI. */ - const SSL_OP_LEGACY_SERVER_CONNECT: number; - const SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER: number; - const SSL_OP_MICROSOFT_SESS_ID_BUG: number; - /** Instructs OpenSSL to disable the workaround for a man-in-the-middle protocol-version vulnerability in the SSL 2.0 server implementation. */ - const SSL_OP_MSIE_SSLV2_RSA_PADDING: number; - const SSL_OP_NETSCAPE_CA_DN_BUG: number; - const SSL_OP_NETSCAPE_CHALLENGE_BUG: number; - const SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG: number; - const SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG: number; - /** Instructs OpenSSL to disable support for SSL/TLS compression. */ - const SSL_OP_NO_COMPRESSION: number; - const SSL_OP_NO_QUERY_MTU: number; - /** Instructs OpenSSL to always start a new session when performing renegotiation. */ - const SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION: number; - const SSL_OP_NO_SSLv2: number; - const SSL_OP_NO_SSLv3: number; - const SSL_OP_NO_TICKET: number; - const SSL_OP_NO_TLSv1: number; - const SSL_OP_NO_TLSv1_1: number; - const SSL_OP_NO_TLSv1_2: number; - const SSL_OP_PKCS1_CHECK_1: number; - const SSL_OP_PKCS1_CHECK_2: number; - /** Instructs OpenSSL to always create a new key when using temporary/ephemeral DH parameters. */ - const SSL_OP_SINGLE_DH_USE: number; - /** Instructs OpenSSL to always create a new key when using temporary/ephemeral ECDH parameters. */ - const SSL_OP_SINGLE_ECDH_USE: number; - const SSL_OP_SSLEAY_080_CLIENT_DH_BUG: number; - const SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG: number; - const SSL_OP_TLS_BLOCK_PADDING_BUG: number; - const SSL_OP_TLS_D5_BUG: number; - /** Instructs OpenSSL to disable version rollback attack detection. */ - const SSL_OP_TLS_ROLLBACK_BUG: number; - const ENGINE_METHOD_RSA: number; - const ENGINE_METHOD_DSA: number; - const ENGINE_METHOD_DH: number; - const ENGINE_METHOD_RAND: number; - const ENGINE_METHOD_EC: number; - const ENGINE_METHOD_CIPHERS: number; - const ENGINE_METHOD_DIGESTS: number; - const ENGINE_METHOD_PKEY_METHS: number; - const ENGINE_METHOD_PKEY_ASN1_METHS: number; - const ENGINE_METHOD_ALL: number; - const ENGINE_METHOD_NONE: number; - const DH_CHECK_P_NOT_SAFE_PRIME: number; - const DH_CHECK_P_NOT_PRIME: number; - const DH_UNABLE_TO_CHECK_GENERATOR: number; - const DH_NOT_SUITABLE_GENERATOR: number; - const ALPN_ENABLED: number; - const RSA_PKCS1_PADDING: number; - const RSA_SSLV23_PADDING: number; - const RSA_NO_PADDING: number; - const RSA_PKCS1_OAEP_PADDING: number; - const RSA_X931_PADDING: number; - const RSA_PKCS1_PSS_PADDING: number; - /** Sets the salt length for RSA_PKCS1_PSS_PADDING to the digest size when signing or verifying. */ - const RSA_PSS_SALTLEN_DIGEST: number; - /** Sets the salt length for RSA_PKCS1_PSS_PADDING to the maximum permissible value when signing data. */ - const RSA_PSS_SALTLEN_MAX_SIGN: number; - /** Causes the salt length for RSA_PKCS1_PSS_PADDING to be determined automatically when verifying a signature. */ - const RSA_PSS_SALTLEN_AUTO: number; - const POINT_CONVERSION_COMPRESSED: number; - const POINT_CONVERSION_UNCOMPRESSED: number; - const POINT_CONVERSION_HYBRID: number; - /** Specifies the built-in default cipher list used by Node.js (colon-separated values). */ - const defaultCoreCipherList: string; - /** Specifies the active default cipher list used by the current Node.js process (colon-separated values). */ - const defaultCipherList: string; - } - interface HashOptions extends stream.TransformOptions { - /** - * For XOF hash functions such as `shake256`, the - * outputLength option can be used to specify the desired output length in bytes. - */ - outputLength?: number | undefined; - } - /** @deprecated since v10.0.0 */ - const fips: boolean; - /** - * Creates and returns a `Hash` object that can be used to generate hash digests - * using the given `algorithm`. Optional `options` argument controls stream - * behavior. For XOF hash functions such as `'shake256'`, the `outputLength` option - * can be used to specify the desired output length in bytes. - * - * The `algorithm` is dependent on the available algorithms supported by the - * version of OpenSSL on the platform. Examples are `'sha256'`, `'sha512'`, etc. - * On recent releases of OpenSSL, `openssl list -digest-algorithms` will - * display the available digest algorithms. - * - * Example: generating the sha256 sum of a file - * - * ```js - * import { - * createReadStream - * } from 'fs'; - * import { argv } from 'process'; - * const { - * createHash - * } = await import('crypto'); - * - * const filename = argv[2]; - * - * const hash = createHash('sha256'); - * - * const input = createReadStream(filename); - * input.on('readable', () => { - * // Only one element is going to be produced by the - * // hash stream. - * const data = input.read(); - * if (data) - * hash.update(data); - * else { - * console.log(`${hash.digest('hex')} ${filename}`); - * } - * }); - * ``` - * @since v0.1.92 - * @param options `stream.transform` options - */ - function createHash(algorithm: string, options?: HashOptions): Hash; - /** - * Creates and returns an `Hmac` object that uses the given `algorithm` and `key`. - * Optional `options` argument controls stream behavior. - * - * The `algorithm` is dependent on the available algorithms supported by the - * version of OpenSSL on the platform. Examples are `'sha256'`, `'sha512'`, etc. - * On recent releases of OpenSSL, `openssl list -digest-algorithms` will - * display the available digest algorithms. - * - * The `key` is the HMAC key used to generate the cryptographic HMAC hash. If it is - * a `KeyObject`, its type must be `secret`. - * - * Example: generating the sha256 HMAC of a file - * - * ```js - * import { - * createReadStream - * } from 'fs'; - * import { argv } from 'process'; - * const { - * createHmac - * } = await import('crypto'); - * - * const filename = argv[2]; - * - * const hmac = createHmac('sha256', 'a secret'); - * - * const input = createReadStream(filename); - * input.on('readable', () => { - * // Only one element is going to be produced by the - * // hash stream. - * const data = input.read(); - * if (data) - * hmac.update(data); - * else { - * console.log(`${hmac.digest('hex')} ${filename}`); - * } - * }); - * ``` - * @since v0.1.94 - * @param options `stream.transform` options - */ - function createHmac(algorithm: string, key: BinaryLike | KeyObject, options?: stream.TransformOptions): Hmac; - // https://nodejs.org/api/buffer.html#buffer_buffers_and_character_encodings - type BinaryToTextEncoding = 'base64' | 'base64url' | 'hex' | 'binary'; - type CharacterEncoding = 'utf8' | 'utf-8' | 'utf16le' | 'latin1'; - type LegacyCharacterEncoding = 'ascii' | 'binary' | 'ucs2' | 'ucs-2'; - type Encoding = BinaryToTextEncoding | CharacterEncoding | LegacyCharacterEncoding; - type ECDHKeyFormat = 'compressed' | 'uncompressed' | 'hybrid'; - /** - * The `Hash` class is a utility for creating hash digests of data. It can be - * used in one of two ways: - * - * * As a `stream` that is both readable and writable, where data is written - * to produce a computed hash digest on the readable side, or - * * Using the `hash.update()` and `hash.digest()` methods to produce the - * computed hash. - * - * The {@link createHash} method is used to create `Hash` instances. `Hash`objects are not to be created directly using the `new` keyword. - * - * Example: Using `Hash` objects as streams: - * - * ```js - * const { - * createHash - * } = await import('crypto'); - * - * const hash = createHash('sha256'); - * - * hash.on('readable', () => { - * // Only one element is going to be produced by the - * // hash stream. - * const data = hash.read(); - * if (data) { - * console.log(data.toString('hex')); - * // Prints: - * // 6a2da20943931e9834fc12cfe5bb47bbd9ae43489a30726962b576f4e3993e50 - * } - * }); - * - * hash.write('some data to hash'); - * hash.end(); - * ``` - * - * Example: Using `Hash` and piped streams: - * - * ```js - * import { createReadStream } from 'fs'; - * import { stdout } from 'process'; - * const { createHash } = await import('crypto'); - * - * const hash = createHash('sha256'); - * - * const input = createReadStream('test.js'); - * input.pipe(hash).setEncoding('hex').pipe(stdout); - * ``` - * - * Example: Using the `hash.update()` and `hash.digest()` methods: - * - * ```js - * const { - * createHash - * } = await import('crypto'); - * - * const hash = createHash('sha256'); - * - * hash.update('some data to hash'); - * console.log(hash.digest('hex')); - * // Prints: - * // 6a2da20943931e9834fc12cfe5bb47bbd9ae43489a30726962b576f4e3993e50 - * ``` - * @since v0.1.92 - */ - class Hash extends stream.Transform { - private constructor(); - /** - * Creates a new `Hash` object that contains a deep copy of the internal state - * of the current `Hash` object. - * - * The optional `options` argument controls stream behavior. For XOF hash - * functions such as `'shake256'`, the `outputLength` option can be used to - * specify the desired output length in bytes. - * - * An error is thrown when an attempt is made to copy the `Hash` object after - * its `hash.digest()` method has been called. - * - * ```js - * // Calculate a rolling hash. - * const { - * createHash - * } = await import('crypto'); - * - * const hash = createHash('sha256'); - * - * hash.update('one'); - * console.log(hash.copy().digest('hex')); - * - * hash.update('two'); - * console.log(hash.copy().digest('hex')); - * - * hash.update('three'); - * console.log(hash.copy().digest('hex')); - * - * // Etc. - * ``` - * @since v13.1.0 - * @param options `stream.transform` options - */ - copy(options?: stream.TransformOptions): Hash; - /** - * Updates the hash content with the given `data`, the encoding of which - * is given in `inputEncoding`. - * If `encoding` is not provided, and the `data` is a string, an - * encoding of `'utf8'` is enforced. If `data` is a `Buffer`, `TypedArray`, or`DataView`, then `inputEncoding` is ignored. - * - * This can be called many times with new data as it is streamed. - * @since v0.1.92 - * @param inputEncoding The `encoding` of the `data` string. - */ - update(data: BinaryLike): Hash; - update(data: string, inputEncoding: Encoding): Hash; - /** - * Calculates the digest of all of the data passed to be hashed (using the `hash.update()` method). - * If `encoding` is provided a string will be returned; otherwise - * a `Buffer` is returned. - * - * The `Hash` object can not be used again after `hash.digest()` method has been - * called. Multiple calls will cause an error to be thrown. - * @since v0.1.92 - * @param encoding The `encoding` of the return value. - */ - digest(): Buffer; - digest(encoding: BinaryToTextEncoding): string; - } - /** - * The `Hmac` class is a utility for creating cryptographic HMAC digests. It can - * be used in one of two ways: - * - * * As a `stream` that is both readable and writable, where data is written - * to produce a computed HMAC digest on the readable side, or - * * Using the `hmac.update()` and `hmac.digest()` methods to produce the - * computed HMAC digest. - * - * The {@link createHmac} method is used to create `Hmac` instances. `Hmac`objects are not to be created directly using the `new` keyword. - * - * Example: Using `Hmac` objects as streams: - * - * ```js - * const { - * createHmac - * } = await import('crypto'); - * - * const hmac = createHmac('sha256', 'a secret'); - * - * hmac.on('readable', () => { - * // Only one element is going to be produced by the - * // hash stream. - * const data = hmac.read(); - * if (data) { - * console.log(data.toString('hex')); - * // Prints: - * // 7fd04df92f636fd450bc841c9418e5825c17f33ad9c87c518115a45971f7f77e - * } - * }); - * - * hmac.write('some data to hash'); - * hmac.end(); - * ``` - * - * Example: Using `Hmac` and piped streams: - * - * ```js - * import { createReadStream } from 'fs'; - * import { stdout } from 'process'; - * const { - * createHmac - * } = await import('crypto'); - * - * const hmac = createHmac('sha256', 'a secret'); - * - * const input = createReadStream('test.js'); - * input.pipe(hmac).pipe(stdout); - * ``` - * - * Example: Using the `hmac.update()` and `hmac.digest()` methods: - * - * ```js - * const { - * createHmac - * } = await import('crypto'); - * - * const hmac = createHmac('sha256', 'a secret'); - * - * hmac.update('some data to hash'); - * console.log(hmac.digest('hex')); - * // Prints: - * // 7fd04df92f636fd450bc841c9418e5825c17f33ad9c87c518115a45971f7f77e - * ``` - * @since v0.1.94 - */ - class Hmac extends stream.Transform { - private constructor(); - /** - * Updates the `Hmac` content with the given `data`, the encoding of which - * is given in `inputEncoding`. - * If `encoding` is not provided, and the `data` is a string, an - * encoding of `'utf8'` is enforced. If `data` is a `Buffer`, `TypedArray`, or`DataView`, then `inputEncoding` is ignored. - * - * This can be called many times with new data as it is streamed. - * @since v0.1.94 - * @param inputEncoding The `encoding` of the `data` string. - */ - update(data: BinaryLike): Hmac; - update(data: string, inputEncoding: Encoding): Hmac; - /** - * Calculates the HMAC digest of all of the data passed using `hmac.update()`. - * If `encoding` is - * provided a string is returned; otherwise a `Buffer` is returned; - * - * The `Hmac` object can not be used again after `hmac.digest()` has been - * called. Multiple calls to `hmac.digest()` will result in an error being thrown. - * @since v0.1.94 - * @param encoding The `encoding` of the return value. - */ - digest(): Buffer; - digest(encoding: BinaryToTextEncoding): string; - } - type KeyObjectType = 'secret' | 'public' | 'private'; - interface KeyExportOptions { - type: 'pkcs1' | 'spki' | 'pkcs8' | 'sec1'; - format: T; - cipher?: string | undefined; - passphrase?: string | Buffer | undefined; - } - interface JwkKeyExportOptions { - format: 'jwk'; - } - interface JsonWebKey { - crv?: string | undefined; - d?: string | undefined; - dp?: string | undefined; - dq?: string | undefined; - e?: string | undefined; - k?: string | undefined; - kty?: string | undefined; - n?: string | undefined; - p?: string | undefined; - q?: string | undefined; - qi?: string | undefined; - x?: string | undefined; - y?: string | undefined; - [key: string]: unknown; - } - interface AsymmetricKeyDetails { - /** - * Key size in bits (RSA, DSA). - */ - modulusLength?: number | undefined; - /** - * Public exponent (RSA). - */ - publicExponent?: bigint | undefined; - /** - * Name of the message digest (RSA-PSS). - */ - hashAlgorithm?: string | undefined; - /** - * Name of the message digest used by MGF1 (RSA-PSS). - */ - mgf1HashAlgorithm?: string | undefined; - /** - * Minimal salt length in bytes (RSA-PSS). - */ - saltLength?: number | undefined; - /** - * Size of q in bits (DSA). - */ - divisorLength?: number | undefined; - /** - * Name of the curve (EC). - */ - namedCurve?: string | undefined; - } - /** - * Node.js uses a `KeyObject` class to represent a symmetric or asymmetric key, - * and each kind of key exposes different functions. The {@link createSecretKey}, {@link createPublicKey} and {@link createPrivateKey} methods are used to create `KeyObject`instances. `KeyObject` - * objects are not to be created directly using the `new`keyword. - * - * Most applications should consider using the new `KeyObject` API instead of - * passing keys as strings or `Buffer`s due to improved security features. - * - * `KeyObject` instances can be passed to other threads via `postMessage()`. - * The receiver obtains a cloned `KeyObject`, and the `KeyObject` does not need to - * be listed in the `transferList` argument. - * @since v11.6.0 - */ - class KeyObject { - private constructor(); - /** - * Example: Converting a `CryptoKey` instance to a `KeyObject`: - * - * ```js - * const { webcrypto, KeyObject } = await import('crypto'); - * const { subtle } = webcrypto; - * - * const key = await subtle.generateKey({ - * name: 'HMAC', - * hash: 'SHA-256', - * length: 256 - * }, true, ['sign', 'verify']); - * - * const keyObject = KeyObject.from(key); - * console.log(keyObject.symmetricKeySize); - * // Prints: 32 (symmetric key size in bytes) - * ``` - * @since v15.0.0 - */ - static from(key: webcrypto.CryptoKey): KeyObject; - /** - * For asymmetric keys, this property represents the type of the key. Supported key - * types are: - * - * * `'rsa'` (OID 1.2.840.113549.1.1.1) - * * `'rsa-pss'` (OID 1.2.840.113549.1.1.10) - * * `'dsa'` (OID 1.2.840.10040.4.1) - * * `'ec'` (OID 1.2.840.10045.2.1) - * * `'x25519'` (OID 1.3.101.110) - * * `'x448'` (OID 1.3.101.111) - * * `'ed25519'` (OID 1.3.101.112) - * * `'ed448'` (OID 1.3.101.113) - * * `'dh'` (OID 1.2.840.113549.1.3.1) - * - * This property is `undefined` for unrecognized `KeyObject` types and symmetric - * keys. - * @since v11.6.0 - */ - asymmetricKeyType?: KeyType | undefined; - /** - * For asymmetric keys, this property represents the size of the embedded key in - * bytes. This property is `undefined` for symmetric keys. - */ - asymmetricKeySize?: number | undefined; - /** - * This property exists only on asymmetric keys. Depending on the type of the key, - * this object contains information about the key. None of the information obtained - * through this property can be used to uniquely identify a key or to compromise - * the security of the key. - * - * For RSA-PSS keys, if the key material contains a `RSASSA-PSS-params` sequence, - * the `hashAlgorithm`, `mgf1HashAlgorithm`, and `saltLength` properties will be - * set. - * - * Other key details might be exposed via this API using additional attributes. - * @since v15.7.0 - */ - asymmetricKeyDetails?: AsymmetricKeyDetails | undefined; - /** - * For symmetric keys, the following encoding options can be used: - * - * For public keys, the following encoding options can be used: - * - * For private keys, the following encoding options can be used: - * - * The result type depends on the selected encoding format, when PEM the - * result is a string, when DER it will be a buffer containing the data - * encoded as DER, when [JWK](https://tools.ietf.org/html/rfc7517) it will be an object. - * - * When [JWK](https://tools.ietf.org/html/rfc7517) encoding format was selected, all other encoding options are - * ignored. - * - * PKCS#1, SEC1, and PKCS#8 type keys can be encrypted by using a combination of - * the `cipher` and `format` options. The PKCS#8 `type` can be used with any`format` to encrypt any key algorithm (RSA, EC, or DH) by specifying a`cipher`. PKCS#1 and SEC1 can only be - * encrypted by specifying a `cipher`when the PEM `format` is used. For maximum compatibility, use PKCS#8 for - * encrypted private keys. Since PKCS#8 defines its own - * encryption mechanism, PEM-level encryption is not supported when encrypting - * a PKCS#8 key. See [RFC 5208](https://www.rfc-editor.org/rfc/rfc5208.txt) for PKCS#8 encryption and [RFC 1421](https://www.rfc-editor.org/rfc/rfc1421.txt) for - * PKCS#1 and SEC1 encryption. - * @since v11.6.0 - */ - export(options: KeyExportOptions<'pem'>): string | Buffer; - export(options?: KeyExportOptions<'der'>): Buffer; - export(options?: JwkKeyExportOptions): JsonWebKey; - /** - * For secret keys, this property represents the size of the key in bytes. This - * property is `undefined` for asymmetric keys. - * @since v11.6.0 - */ - symmetricKeySize?: number | undefined; - /** - * Depending on the type of this `KeyObject`, this property is either`'secret'` for secret (symmetric) keys, `'public'` for public (asymmetric) keys - * or `'private'` for private (asymmetric) keys. - * @since v11.6.0 - */ - type: KeyObjectType; - } - type CipherCCMTypes = 'aes-128-ccm' | 'aes-192-ccm' | 'aes-256-ccm' | 'chacha20-poly1305'; - type CipherGCMTypes = 'aes-128-gcm' | 'aes-192-gcm' | 'aes-256-gcm'; - type CipherOCBTypes = 'aes-128-ocb' | 'aes-192-ocb' | 'aes-256-ocb'; - type BinaryLike = string | NodeJS.ArrayBufferView; - type CipherKey = BinaryLike | KeyObject; - interface CipherCCMOptions extends stream.TransformOptions { - authTagLength: number; - } - interface CipherGCMOptions extends stream.TransformOptions { - authTagLength?: number | undefined; - } - interface CipherOCBOptions extends stream.TransformOptions { - authTagLength: number; - } - /** - * Creates and returns a `Cipher` object that uses the given `algorithm` and`password`. - * - * The `options` argument controls stream behavior and is optional except when a - * cipher in CCM or OCB mode (e.g. `'aes-128-ccm'`) is used. In that case, the`authTagLength` option is required and specifies the length of the - * authentication tag in bytes, see `CCM mode`. In GCM mode, the `authTagLength`option is not required but can be used to set the length of the authentication - * tag that will be returned by `getAuthTag()` and defaults to 16 bytes. - * For `chacha20-poly1305`, the `authTagLength` option defaults to 16 bytes. - * - * The `algorithm` is dependent on OpenSSL, examples are `'aes192'`, etc. On - * recent OpenSSL releases, `openssl list -cipher-algorithms` will - * display the available cipher algorithms. - * - * The `password` is used to derive the cipher key and initialization vector (IV). - * The value must be either a `'latin1'` encoded string, a `Buffer`, a`TypedArray`, or a `DataView`. - * - * The implementation of `crypto.createCipher()` derives keys using the OpenSSL - * function [`EVP_BytesToKey`](https://www.openssl.org/docs/man1.1.0/crypto/EVP_BytesToKey.html) with the digest algorithm set to MD5, one - * iteration, and no salt. The lack of salt allows dictionary attacks as the same - * password always creates the same key. The low iteration count and - * non-cryptographically secure hash algorithm allow passwords to be tested very - * rapidly. - * - * In line with OpenSSL's recommendation to use a more modern algorithm instead of [`EVP_BytesToKey`](https://www.openssl.org/docs/man1.1.0/crypto/EVP_BytesToKey.html) it is recommended that - * developers derive a key and IV on - * their own using {@link scrypt} and to use {@link createCipheriv} to create the `Cipher` object. Users should not use ciphers with counter mode - * (e.g. CTR, GCM, or CCM) in `crypto.createCipher()`. A warning is emitted when - * they are used in order to avoid the risk of IV reuse that causes - * vulnerabilities. For the case when IV is reused in GCM, see [Nonce-Disrespecting Adversaries](https://github.com/nonce-disrespect/nonce-disrespect) for details. - * @since v0.1.94 - * @deprecated Since v10.0.0 - Use {@link createCipheriv} instead. - * @param options `stream.transform` options - */ - function createCipher(algorithm: CipherCCMTypes, password: BinaryLike, options: CipherCCMOptions): CipherCCM; - /** @deprecated since v10.0.0 use `createCipheriv()` */ - function createCipher(algorithm: CipherGCMTypes, password: BinaryLike, options?: CipherGCMOptions): CipherGCM; - /** @deprecated since v10.0.0 use `createCipheriv()` */ - function createCipher(algorithm: string, password: BinaryLike, options?: stream.TransformOptions): Cipher; - /** - * Creates and returns a `Cipher` object, with the given `algorithm`, `key` and - * initialization vector (`iv`). - * - * The `options` argument controls stream behavior and is optional except when a - * cipher in CCM or OCB mode (e.g. `'aes-128-ccm'`) is used. In that case, the`authTagLength` option is required and specifies the length of the - * authentication tag in bytes, see `CCM mode`. In GCM mode, the `authTagLength`option is not required but can be used to set the length of the authentication - * tag that will be returned by `getAuthTag()` and defaults to 16 bytes. - * For `chacha20-poly1305`, the `authTagLength` option defaults to 16 bytes. - * - * The `algorithm` is dependent on OpenSSL, examples are `'aes192'`, etc. On - * recent OpenSSL releases, `openssl list -cipher-algorithms` will - * display the available cipher algorithms. - * - * The `key` is the raw key used by the `algorithm` and `iv` is an [initialization vector](https://en.wikipedia.org/wiki/Initialization_vector). Both arguments must be `'utf8'` encoded - * strings,`Buffers`, `TypedArray`, or `DataView`s. The `key` may optionally be - * a `KeyObject` of type `secret`. If the cipher does not need - * an initialization vector, `iv` may be `null`. - * - * When passing strings for `key` or `iv`, please consider `caveats when using strings as inputs to cryptographic APIs`. - * - * Initialization vectors should be unpredictable and unique; ideally, they will be - * cryptographically random. They do not have to be secret: IVs are typically just - * added to ciphertext messages unencrypted. It may sound contradictory that - * something has to be unpredictable and unique, but does not have to be secret; - * remember that an attacker must not be able to predict ahead of time what a - * given IV will be. - * @since v0.1.94 - * @param options `stream.transform` options - */ - function createCipheriv(algorithm: CipherCCMTypes, key: CipherKey, iv: BinaryLike, options: CipherCCMOptions): CipherCCM; - function createCipheriv(algorithm: CipherOCBTypes, key: CipherKey, iv: BinaryLike, options: CipherOCBOptions): CipherOCB; - function createCipheriv(algorithm: CipherGCMTypes, key: CipherKey, iv: BinaryLike, options?: CipherGCMOptions): CipherGCM; - function createCipheriv(algorithm: string, key: CipherKey, iv: BinaryLike | null, options?: stream.TransformOptions): Cipher; - /** - * Instances of the `Cipher` class are used to encrypt data. The class can be - * used in one of two ways: - * - * * As a `stream` that is both readable and writable, where plain unencrypted - * data is written to produce encrypted data on the readable side, or - * * Using the `cipher.update()` and `cipher.final()` methods to produce - * the encrypted data. - * - * The {@link createCipher} or {@link createCipheriv} methods are - * used to create `Cipher` instances. `Cipher` objects are not to be created - * directly using the `new` keyword. - * - * Example: Using `Cipher` objects as streams: - * - * ```js - * const { - * scrypt, - * randomFill, - * createCipheriv - * } = await import('crypto'); - * - * const algorithm = 'aes-192-cbc'; - * const password = 'Password used to generate key'; - * - * // First, we'll generate the key. The key length is dependent on the algorithm. - * // In this case for aes192, it is 24 bytes (192 bits). - * scrypt(password, 'salt', 24, (err, key) => { - * if (err) throw err; - * // Then, we'll generate a random initialization vector - * randomFill(new Uint8Array(16), (err, iv) => { - * if (err) throw err; - * - * // Once we have the key and iv, we can create and use the cipher... - * const cipher = createCipheriv(algorithm, key, iv); - * - * let encrypted = ''; - * cipher.setEncoding('hex'); - * - * cipher.on('data', (chunk) => encrypted += chunk); - * cipher.on('end', () => console.log(encrypted)); - * - * cipher.write('some clear text data'); - * cipher.end(); - * }); - * }); - * ``` - * - * Example: Using `Cipher` and piped streams: - * - * ```js - * import { - * createReadStream, - * createWriteStream, - * } from 'fs'; - * - * import { - * pipeline - * } from 'stream'; - * - * const { - * scrypt, - * randomFill, - * createCipheriv - * } = await import('crypto'); - * - * const algorithm = 'aes-192-cbc'; - * const password = 'Password used to generate key'; - * - * // First, we'll generate the key. The key length is dependent on the algorithm. - * // In this case for aes192, it is 24 bytes (192 bits). - * scrypt(password, 'salt', 24, (err, key) => { - * if (err) throw err; - * // Then, we'll generate a random initialization vector - * randomFill(new Uint8Array(16), (err, iv) => { - * if (err) throw err; - * - * const cipher = createCipheriv(algorithm, key, iv); - * - * const input = createReadStream('test.js'); - * const output = createWriteStream('test.enc'); - * - * pipeline(input, cipher, output, (err) => { - * if (err) throw err; - * }); - * }); - * }); - * ``` - * - * Example: Using the `cipher.update()` and `cipher.final()` methods: - * - * ```js - * const { - * scrypt, - * randomFill, - * createCipheriv - * } = await import('crypto'); - * - * const algorithm = 'aes-192-cbc'; - * const password = 'Password used to generate key'; - * - * // First, we'll generate the key. The key length is dependent on the algorithm. - * // In this case for aes192, it is 24 bytes (192 bits). - * scrypt(password, 'salt', 24, (err, key) => { - * if (err) throw err; - * // Then, we'll generate a random initialization vector - * randomFill(new Uint8Array(16), (err, iv) => { - * if (err) throw err; - * - * const cipher = createCipheriv(algorithm, key, iv); - * - * let encrypted = cipher.update('some clear text data', 'utf8', 'hex'); - * encrypted += cipher.final('hex'); - * console.log(encrypted); - * }); - * }); - * ``` - * @since v0.1.94 - */ - class Cipher extends stream.Transform { - private constructor(); - /** - * Updates the cipher with `data`. If the `inputEncoding` argument is given, - * the `data`argument is a string using the specified encoding. If the `inputEncoding`argument is not given, `data` must be a `Buffer`, `TypedArray`, or`DataView`. If `data` is a `Buffer`, - * `TypedArray`, or `DataView`, then`inputEncoding` is ignored. - * - * The `outputEncoding` specifies the output format of the enciphered - * data. If the `outputEncoding`is specified, a string using the specified encoding is returned. If no`outputEncoding` is provided, a `Buffer` is returned. - * - * The `cipher.update()` method can be called multiple times with new data until `cipher.final()` is called. Calling `cipher.update()` after `cipher.final()` will result in an error being - * thrown. - * @since v0.1.94 - * @param inputEncoding The `encoding` of the data. - * @param outputEncoding The `encoding` of the return value. - */ - update(data: BinaryLike): Buffer; - update(data: string, inputEncoding: Encoding): Buffer; - update(data: NodeJS.ArrayBufferView, inputEncoding: undefined, outputEncoding: Encoding): string; - update(data: string, inputEncoding: Encoding | undefined, outputEncoding: Encoding): string; - /** - * Once the `cipher.final()` method has been called, the `Cipher` object can no - * longer be used to encrypt data. Attempts to call `cipher.final()` more than - * once will result in an error being thrown. - * @since v0.1.94 - * @param outputEncoding The `encoding` of the return value. - * @return Any remaining enciphered contents. If `outputEncoding` is specified, a string is returned. If an `outputEncoding` is not provided, a {@link Buffer} is returned. - */ - final(): Buffer; - final(outputEncoding: BufferEncoding): string; - /** - * When using block encryption algorithms, the `Cipher` class will automatically - * add padding to the input data to the appropriate block size. To disable the - * default padding call `cipher.setAutoPadding(false)`. - * - * When `autoPadding` is `false`, the length of the entire input data must be a - * multiple of the cipher's block size or `cipher.final()` will throw an error. - * Disabling automatic padding is useful for non-standard padding, for instance - * using `0x0` instead of PKCS padding. - * - * The `cipher.setAutoPadding()` method must be called before `cipher.final()`. - * @since v0.7.1 - * @param [autoPadding=true] - * @return for method chaining. - */ - setAutoPadding(autoPadding?: boolean): this; - } - interface CipherCCM extends Cipher { - setAAD( - buffer: NodeJS.ArrayBufferView, - options: { - plaintextLength: number; - } - ): this; - getAuthTag(): Buffer; - } - interface CipherGCM extends Cipher { - setAAD( - buffer: NodeJS.ArrayBufferView, - options?: { - plaintextLength: number; - } - ): this; - getAuthTag(): Buffer; - } - interface CipherOCB extends Cipher { - setAAD( - buffer: NodeJS.ArrayBufferView, - options?: { - plaintextLength: number; - } - ): this; - getAuthTag(): Buffer; - } - /** - * Creates and returns a `Decipher` object that uses the given `algorithm` and`password` (key). - * - * The `options` argument controls stream behavior and is optional except when a - * cipher in CCM or OCB mode (e.g. `'aes-128-ccm'`) is used. In that case, the`authTagLength` option is required and specifies the length of the - * authentication tag in bytes, see `CCM mode`. - * For `chacha20-poly1305`, the `authTagLength` option defaults to 16 bytes. - * - * The implementation of `crypto.createDecipher()` derives keys using the OpenSSL - * function [`EVP_BytesToKey`](https://www.openssl.org/docs/man1.1.0/crypto/EVP_BytesToKey.html) with the digest algorithm set to MD5, one - * iteration, and no salt. The lack of salt allows dictionary attacks as the same - * password always creates the same key. The low iteration count and - * non-cryptographically secure hash algorithm allow passwords to be tested very - * rapidly. - * - * In line with OpenSSL's recommendation to use a more modern algorithm instead of [`EVP_BytesToKey`](https://www.openssl.org/docs/man1.1.0/crypto/EVP_BytesToKey.html) it is recommended that - * developers derive a key and IV on - * their own using {@link scrypt} and to use {@link createDecipheriv} to create the `Decipher` object. - * @since v0.1.94 - * @deprecated Since v10.0.0 - Use {@link createDecipheriv} instead. - * @param options `stream.transform` options - */ - function createDecipher(algorithm: CipherCCMTypes, password: BinaryLike, options: CipherCCMOptions): DecipherCCM; - /** @deprecated since v10.0.0 use `createDecipheriv()` */ - function createDecipher(algorithm: CipherGCMTypes, password: BinaryLike, options?: CipherGCMOptions): DecipherGCM; - /** @deprecated since v10.0.0 use `createDecipheriv()` */ - function createDecipher(algorithm: string, password: BinaryLike, options?: stream.TransformOptions): Decipher; - /** - * Creates and returns a `Decipher` object that uses the given `algorithm`, `key`and initialization vector (`iv`). - * - * The `options` argument controls stream behavior and is optional except when a - * cipher in CCM or OCB mode (e.g. `'aes-128-ccm'`) is used. In that case, the`authTagLength` option is required and specifies the length of the - * authentication tag in bytes, see `CCM mode`. In GCM mode, the `authTagLength`option is not required but can be used to restrict accepted authentication tags - * to those with the specified length. - * For `chacha20-poly1305`, the `authTagLength` option defaults to 16 bytes. - * - * The `algorithm` is dependent on OpenSSL, examples are `'aes192'`, etc. On - * recent OpenSSL releases, `openssl list -cipher-algorithms` will - * display the available cipher algorithms. - * - * The `key` is the raw key used by the `algorithm` and `iv` is an [initialization vector](https://en.wikipedia.org/wiki/Initialization_vector). Both arguments must be `'utf8'` encoded - * strings,`Buffers`, `TypedArray`, or `DataView`s. The `key` may optionally be - * a `KeyObject` of type `secret`. If the cipher does not need - * an initialization vector, `iv` may be `null`. - * - * When passing strings for `key` or `iv`, please consider `caveats when using strings as inputs to cryptographic APIs`. - * - * Initialization vectors should be unpredictable and unique; ideally, they will be - * cryptographically random. They do not have to be secret: IVs are typically just - * added to ciphertext messages unencrypted. It may sound contradictory that - * something has to be unpredictable and unique, but does not have to be secret; - * remember that an attacker must not be able to predict ahead of time what a given - * IV will be. - * @since v0.1.94 - * @param options `stream.transform` options - */ - function createDecipheriv(algorithm: CipherCCMTypes, key: CipherKey, iv: BinaryLike, options: CipherCCMOptions): DecipherCCM; - function createDecipheriv(algorithm: CipherOCBTypes, key: CipherKey, iv: BinaryLike, options: CipherOCBOptions): DecipherOCB; - function createDecipheriv(algorithm: CipherGCMTypes, key: CipherKey, iv: BinaryLike, options?: CipherGCMOptions): DecipherGCM; - function createDecipheriv(algorithm: string, key: CipherKey, iv: BinaryLike | null, options?: stream.TransformOptions): Decipher; - /** - * Instances of the `Decipher` class are used to decrypt data. The class can be - * used in one of two ways: - * - * * As a `stream` that is both readable and writable, where plain encrypted - * data is written to produce unencrypted data on the readable side, or - * * Using the `decipher.update()` and `decipher.final()` methods to - * produce the unencrypted data. - * - * The {@link createDecipher} or {@link createDecipheriv} methods are - * used to create `Decipher` instances. `Decipher` objects are not to be created - * directly using the `new` keyword. - * - * Example: Using `Decipher` objects as streams: - * - * ```js - * import { Buffer } from 'buffer'; - * const { - * scryptSync, - * createDecipheriv - * } = await import('crypto'); - * - * const algorithm = 'aes-192-cbc'; - * const password = 'Password used to generate key'; - * // Key length is dependent on the algorithm. In this case for aes192, it is - * // 24 bytes (192 bits). - * // Use the async `crypto.scrypt()` instead. - * const key = scryptSync(password, 'salt', 24); - * // The IV is usually passed along with the ciphertext. - * const iv = Buffer.alloc(16, 0); // Initialization vector. - * - * const decipher = createDecipheriv(algorithm, key, iv); - * - * let decrypted = ''; - * decipher.on('readable', () => { - * while (null !== (chunk = decipher.read())) { - * decrypted += chunk.toString('utf8'); - * } - * }); - * decipher.on('end', () => { - * console.log(decrypted); - * // Prints: some clear text data - * }); - * - * // Encrypted with same algorithm, key and iv. - * const encrypted = - * 'e5f79c5915c02171eec6b212d5520d44480993d7d622a7c4c2da32f6efda0ffa'; - * decipher.write(encrypted, 'hex'); - * decipher.end(); - * ``` - * - * Example: Using `Decipher` and piped streams: - * - * ```js - * import { - * createReadStream, - * createWriteStream, - * } from 'fs'; - * import { Buffer } from 'buffer'; - * const { - * scryptSync, - * createDecipheriv - * } = await import('crypto'); - * - * const algorithm = 'aes-192-cbc'; - * const password = 'Password used to generate key'; - * // Use the async `crypto.scrypt()` instead. - * const key = scryptSync(password, 'salt', 24); - * // The IV is usually passed along with the ciphertext. - * const iv = Buffer.alloc(16, 0); // Initialization vector. - * - * const decipher = createDecipheriv(algorithm, key, iv); - * - * const input = createReadStream('test.enc'); - * const output = createWriteStream('test.js'); - * - * input.pipe(decipher).pipe(output); - * ``` - * - * Example: Using the `decipher.update()` and `decipher.final()` methods: - * - * ```js - * import { Buffer } from 'buffer'; - * const { - * scryptSync, - * createDecipheriv - * } = await import('crypto'); - * - * const algorithm = 'aes-192-cbc'; - * const password = 'Password used to generate key'; - * // Use the async `crypto.scrypt()` instead. - * const key = scryptSync(password, 'salt', 24); - * // The IV is usually passed along with the ciphertext. - * const iv = Buffer.alloc(16, 0); // Initialization vector. - * - * const decipher = createDecipheriv(algorithm, key, iv); - * - * // Encrypted using same algorithm, key and iv. - * const encrypted = - * 'e5f79c5915c02171eec6b212d5520d44480993d7d622a7c4c2da32f6efda0ffa'; - * let decrypted = decipher.update(encrypted, 'hex', 'utf8'); - * decrypted += decipher.final('utf8'); - * console.log(decrypted); - * // Prints: some clear text data - * ``` - * @since v0.1.94 - */ - class Decipher extends stream.Transform { - private constructor(); - /** - * Updates the decipher with `data`. If the `inputEncoding` argument is given, - * the `data`argument is a string using the specified encoding. If the `inputEncoding`argument is not given, `data` must be a `Buffer`. If `data` is a `Buffer` then `inputEncoding` is - * ignored. - * - * The `outputEncoding` specifies the output format of the enciphered - * data. If the `outputEncoding`is specified, a string using the specified encoding is returned. If no`outputEncoding` is provided, a `Buffer` is returned. - * - * The `decipher.update()` method can be called multiple times with new data until `decipher.final()` is called. Calling `decipher.update()` after `decipher.final()` will result in an error - * being thrown. - * @since v0.1.94 - * @param inputEncoding The `encoding` of the `data` string. - * @param outputEncoding The `encoding` of the return value. - */ - update(data: NodeJS.ArrayBufferView): Buffer; - update(data: string, inputEncoding: Encoding): Buffer; - update(data: NodeJS.ArrayBufferView, inputEncoding: undefined, outputEncoding: Encoding): string; - update(data: string, inputEncoding: Encoding | undefined, outputEncoding: Encoding): string; - /** - * Once the `decipher.final()` method has been called, the `Decipher` object can - * no longer be used to decrypt data. Attempts to call `decipher.final()` more - * than once will result in an error being thrown. - * @since v0.1.94 - * @param outputEncoding The `encoding` of the return value. - * @return Any remaining deciphered contents. If `outputEncoding` is specified, a string is returned. If an `outputEncoding` is not provided, a {@link Buffer} is returned. - */ - final(): Buffer; - final(outputEncoding: BufferEncoding): string; - /** - * When data has been encrypted without standard block padding, calling`decipher.setAutoPadding(false)` will disable automatic padding to prevent `decipher.final()` from checking for and - * removing padding. - * - * Turning auto padding off will only work if the input data's length is a - * multiple of the ciphers block size. - * - * The `decipher.setAutoPadding()` method must be called before `decipher.final()`. - * @since v0.7.1 - * @param [autoPadding=true] - * @return for method chaining. - */ - setAutoPadding(auto_padding?: boolean): this; - } - interface DecipherCCM extends Decipher { - setAuthTag(buffer: NodeJS.ArrayBufferView): this; - setAAD( - buffer: NodeJS.ArrayBufferView, - options: { - plaintextLength: number; - } - ): this; - } - interface DecipherGCM extends Decipher { - setAuthTag(buffer: NodeJS.ArrayBufferView): this; - setAAD( - buffer: NodeJS.ArrayBufferView, - options?: { - plaintextLength: number; - } - ): this; - } - interface DecipherOCB extends Decipher { - setAuthTag(buffer: NodeJS.ArrayBufferView): this; - setAAD( - buffer: NodeJS.ArrayBufferView, - options?: { - plaintextLength: number; - } - ): this; - } - interface PrivateKeyInput { - key: string | Buffer; - format?: KeyFormat | undefined; - type?: 'pkcs1' | 'pkcs8' | 'sec1' | undefined; - passphrase?: string | Buffer | undefined; - } - interface PublicKeyInput { - key: string | Buffer; - format?: KeyFormat | undefined; - type?: 'pkcs1' | 'spki' | undefined; - } - /** - * Asynchronously generates a new random secret key of the given `length`. The`type` will determine which validations will be performed on the `length`. - * - * ```js - * const { - * generateKey - * } = await import('crypto'); - * - * generateKey('hmac', { length: 64 }, (err, key) => { - * if (err) throw err; - * console.log(key.export().toString('hex')); // 46e..........620 - * }); - * ``` - * @since v15.0.0 - * @param type The intended use of the generated secret key. Currently accepted values are `'hmac'` and `'aes'`. - */ - function generateKey( - type: 'hmac' | 'aes', - options: { - length: number; - }, - callback: (err: Error | null, key: KeyObject) => void - ): void; - /** - * Synchronously generates a new random secret key of the given `length`. The`type` will determine which validations will be performed on the `length`. - * - * ```js - * const { - * generateKeySync - * } = await import('crypto'); - * - * const key = generateKeySync('hmac', { length: 64 }); - * console.log(key.export().toString('hex')); // e89..........41e - * ``` - * @since v15.0.0 - * @param type The intended use of the generated secret key. Currently accepted values are `'hmac'` and `'aes'`. - */ - function generateKeySync( - type: 'hmac' | 'aes', - options: { - length: number; - } - ): KeyObject; - interface JsonWebKeyInput { - key: JsonWebKey; - format: 'jwk'; - } - /** - * Creates and returns a new key object containing a private key. If `key` is a - * string or `Buffer`, `format` is assumed to be `'pem'`; otherwise, `key`must be an object with the properties described above. - * - * If the private key is encrypted, a `passphrase` must be specified. The length - * of the passphrase is limited to 1024 bytes. - * @since v11.6.0 - */ - function createPrivateKey(key: PrivateKeyInput | string | Buffer | JsonWebKeyInput): KeyObject; - /** - * Creates and returns a new key object containing a public key. If `key` is a - * string or `Buffer`, `format` is assumed to be `'pem'`; if `key` is a `KeyObject`with type `'private'`, the public key is derived from the given private key; - * otherwise, `key` must be an object with the properties described above. - * - * If the format is `'pem'`, the `'key'` may also be an X.509 certificate. - * - * Because public keys can be derived from private keys, a private key may be - * passed instead of a public key. In that case, this function behaves as if {@link createPrivateKey} had been called, except that the type of the - * returned `KeyObject` will be `'public'` and that the private key cannot be - * extracted from the returned `KeyObject`. Similarly, if a `KeyObject` with type`'private'` is given, a new `KeyObject` with type `'public'` will be returned - * and it will be impossible to extract the private key from the returned object. - * @since v11.6.0 - */ - function createPublicKey(key: PublicKeyInput | string | Buffer | KeyObject | JsonWebKeyInput): KeyObject; - /** - * Creates and returns a new key object containing a secret key for symmetric - * encryption or `Hmac`. - * @since v11.6.0 - * @param encoding The string encoding when `key` is a string. - */ - function createSecretKey(key: NodeJS.ArrayBufferView): KeyObject; - function createSecretKey(key: string, encoding: BufferEncoding): KeyObject; - /** - * Creates and returns a `Sign` object that uses the given `algorithm`. Use {@link getHashes} to obtain the names of the available digest algorithms. - * Optional `options` argument controls the `stream.Writable` behavior. - * - * In some cases, a `Sign` instance can be created using the name of a signature - * algorithm, such as `'RSA-SHA256'`, instead of a digest algorithm. This will use - * the corresponding digest algorithm. This does not work for all signature - * algorithms, such as `'ecdsa-with-SHA256'`, so it is best to always use digest - * algorithm names. - * @since v0.1.92 - * @param options `stream.Writable` options - */ - function createSign(algorithm: string, options?: stream.WritableOptions): Sign; - type DSAEncoding = 'der' | 'ieee-p1363'; - interface SigningOptions { - /** - * @See crypto.constants.RSA_PKCS1_PADDING - */ - padding?: number | undefined; - saltLength?: number | undefined; - dsaEncoding?: DSAEncoding | undefined; - } - interface SignPrivateKeyInput extends PrivateKeyInput, SigningOptions {} - interface SignKeyObjectInput extends SigningOptions { - key: KeyObject; - } - interface VerifyPublicKeyInput extends PublicKeyInput, SigningOptions {} - interface VerifyKeyObjectInput extends SigningOptions { - key: KeyObject; - } - type KeyLike = string | Buffer | KeyObject; - /** - * The `Sign` class is a utility for generating signatures. It can be used in one - * of two ways: - * - * * As a writable `stream`, where data to be signed is written and the `sign.sign()` method is used to generate and return the signature, or - * * Using the `sign.update()` and `sign.sign()` methods to produce the - * signature. - * - * The {@link createSign} method is used to create `Sign` instances. The - * argument is the string name of the hash function to use. `Sign` objects are not - * to be created directly using the `new` keyword. - * - * Example: Using `Sign` and `Verify` objects as streams: - * - * ```js - * const { - * generateKeyPairSync, - * createSign, - * createVerify - * } = await import('crypto'); - * - * const { privateKey, publicKey } = generateKeyPairSync('ec', { - * namedCurve: 'sect239k1' - * }); - * - * const sign = createSign('SHA256'); - * sign.write('some data to sign'); - * sign.end(); - * const signature = sign.sign(privateKey, 'hex'); - * - * const verify = createVerify('SHA256'); - * verify.write('some data to sign'); - * verify.end(); - * console.log(verify.verify(publicKey, signature, 'hex')); - * // Prints: true - * ``` - * - * Example: Using the `sign.update()` and `verify.update()` methods: - * - * ```js - * const { - * generateKeyPairSync, - * createSign, - * createVerify - * } = await import('crypto'); - * - * const { privateKey, publicKey } = generateKeyPairSync('rsa', { - * modulusLength: 2048, - * }); - * - * const sign = createSign('SHA256'); - * sign.update('some data to sign'); - * sign.end(); - * const signature = sign.sign(privateKey); - * - * const verify = createVerify('SHA256'); - * verify.update('some data to sign'); - * verify.end(); - * console.log(verify.verify(publicKey, signature)); - * // Prints: true - * ``` - * @since v0.1.92 - */ - class Sign extends stream.Writable { - private constructor(); - /** - * Updates the `Sign` content with the given `data`, the encoding of which - * is given in `inputEncoding`. - * If `encoding` is not provided, and the `data` is a string, an - * encoding of `'utf8'` is enforced. If `data` is a `Buffer`, `TypedArray`, or`DataView`, then `inputEncoding` is ignored. - * - * This can be called many times with new data as it is streamed. - * @since v0.1.92 - * @param inputEncoding The `encoding` of the `data` string. - */ - update(data: BinaryLike): this; - update(data: string, inputEncoding: Encoding): this; - /** - * Calculates the signature on all the data passed through using either `sign.update()` or `sign.write()`. - * - * If `privateKey` is not a `KeyObject`, this function behaves as if`privateKey` had been passed to {@link createPrivateKey}. If it is an - * object, the following additional properties can be passed: - * - * If `outputEncoding` is provided a string is returned; otherwise a `Buffer` is returned. - * - * The `Sign` object can not be again used after `sign.sign()` method has been - * called. Multiple calls to `sign.sign()` will result in an error being thrown. - * @since v0.1.92 - */ - sign(privateKey: KeyLike | SignKeyObjectInput | SignPrivateKeyInput): Buffer; - sign(privateKey: KeyLike | SignKeyObjectInput | SignPrivateKeyInput, outputFormat: BinaryToTextEncoding): string; - } - /** - * Creates and returns a `Verify` object that uses the given algorithm. - * Use {@link getHashes} to obtain an array of names of the available - * signing algorithms. Optional `options` argument controls the`stream.Writable` behavior. - * - * In some cases, a `Verify` instance can be created using the name of a signature - * algorithm, such as `'RSA-SHA256'`, instead of a digest algorithm. This will use - * the corresponding digest algorithm. This does not work for all signature - * algorithms, such as `'ecdsa-with-SHA256'`, so it is best to always use digest - * algorithm names. - * @since v0.1.92 - * @param options `stream.Writable` options - */ - function createVerify(algorithm: string, options?: stream.WritableOptions): Verify; - /** - * The `Verify` class is a utility for verifying signatures. It can be used in one - * of two ways: - * - * * As a writable `stream` where written data is used to validate against the - * supplied signature, or - * * Using the `verify.update()` and `verify.verify()` methods to verify - * the signature. - * - * The {@link createVerify} method is used to create `Verify` instances.`Verify` objects are not to be created directly using the `new` keyword. - * - * See `Sign` for examples. - * @since v0.1.92 - */ - class Verify extends stream.Writable { - private constructor(); - /** - * Updates the `Verify` content with the given `data`, the encoding of which - * is given in `inputEncoding`. - * If `inputEncoding` is not provided, and the `data` is a string, an - * encoding of `'utf8'` is enforced. If `data` is a `Buffer`, `TypedArray`, or`DataView`, then `inputEncoding` is ignored. - * - * This can be called many times with new data as it is streamed. - * @since v0.1.92 - * @param inputEncoding The `encoding` of the `data` string. - */ - update(data: BinaryLike): Verify; - update(data: string, inputEncoding: Encoding): Verify; - /** - * Verifies the provided data using the given `object` and `signature`. - * - * If `object` is not a `KeyObject`, this function behaves as if`object` had been passed to {@link createPublicKey}. If it is an - * object, the following additional properties can be passed: - * - * The `signature` argument is the previously calculated signature for the data, in - * the `signatureEncoding`. - * If a `signatureEncoding` is specified, the `signature` is expected to be a - * string; otherwise `signature` is expected to be a `Buffer`,`TypedArray`, or `DataView`. - * - * The `verify` object can not be used again after `verify.verify()` has been - * called. Multiple calls to `verify.verify()` will result in an error being - * thrown. - * - * Because public keys can be derived from private keys, a private key may - * be passed instead of a public key. - * @since v0.1.92 - */ - verify(object: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput, signature: NodeJS.ArrayBufferView): boolean; - verify(object: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput, signature: string, signature_format?: BinaryToTextEncoding): boolean; - } - /** - * Creates a `DiffieHellman` key exchange object using the supplied `prime` and an - * optional specific `generator`. - * - * The `generator` argument can be a number, string, or `Buffer`. If`generator` is not specified, the value `2` is used. - * - * If `primeEncoding` is specified, `prime` is expected to be a string; otherwise - * a `Buffer`, `TypedArray`, or `DataView` is expected. - * - * If `generatorEncoding` is specified, `generator` is expected to be a string; - * otherwise a number, `Buffer`, `TypedArray`, or `DataView` is expected. - * @since v0.11.12 - * @param primeEncoding The `encoding` of the `prime` string. - * @param [generator=2] - * @param generatorEncoding The `encoding` of the `generator` string. - */ - function createDiffieHellman(primeLength: number, generator?: number): DiffieHellman; - function createDiffieHellman(prime: ArrayBuffer | NodeJS.ArrayBufferView, generator?: number | ArrayBuffer | NodeJS.ArrayBufferView): DiffieHellman; - function createDiffieHellman(prime: ArrayBuffer | NodeJS.ArrayBufferView, generator: string, generatorEncoding: BinaryToTextEncoding): DiffieHellman; - function createDiffieHellman(prime: string, primeEncoding: BinaryToTextEncoding, generator?: number | ArrayBuffer | NodeJS.ArrayBufferView): DiffieHellman; - function createDiffieHellman(prime: string, primeEncoding: BinaryToTextEncoding, generator: string, generatorEncoding: BinaryToTextEncoding): DiffieHellman; - /** - * The `DiffieHellman` class is a utility for creating Diffie-Hellman key - * exchanges. - * - * Instances of the `DiffieHellman` class can be created using the {@link createDiffieHellman} function. - * - * ```js - * import assert from 'assert'; - * - * const { - * createDiffieHellman - * } = await import('crypto'); - * - * // Generate Alice's keys... - * const alice = createDiffieHellman(2048); - * const aliceKey = alice.generateKeys(); - * - * // Generate Bob's keys... - * const bob = createDiffieHellman(alice.getPrime(), alice.getGenerator()); - * const bobKey = bob.generateKeys(); - * - * // Exchange and generate the secret... - * const aliceSecret = alice.computeSecret(bobKey); - * const bobSecret = bob.computeSecret(aliceKey); - * - * // OK - * assert.strictEqual(aliceSecret.toString('hex'), bobSecret.toString('hex')); - * ``` - * @since v0.5.0 - */ - class DiffieHellman { - private constructor(); - /** - * Generates private and public Diffie-Hellman key values, and returns - * the public key in the specified `encoding`. This key should be - * transferred to the other party. - * If `encoding` is provided a string is returned; otherwise a `Buffer` is returned. - * @since v0.5.0 - * @param encoding The `encoding` of the return value. - */ - generateKeys(): Buffer; - generateKeys(encoding: BinaryToTextEncoding): string; - /** - * Computes the shared secret using `otherPublicKey` as the other - * party's public key and returns the computed shared secret. The supplied - * key is interpreted using the specified `inputEncoding`, and secret is - * encoded using specified `outputEncoding`. - * If the `inputEncoding` is not - * provided, `otherPublicKey` is expected to be a `Buffer`,`TypedArray`, or `DataView`. - * - * If `outputEncoding` is given a string is returned; otherwise, a `Buffer` is returned. - * @since v0.5.0 - * @param inputEncoding The `encoding` of an `otherPublicKey` string. - * @param outputEncoding The `encoding` of the return value. - */ - computeSecret(otherPublicKey: NodeJS.ArrayBufferView, inputEncoding?: null, outputEncoding?: null): Buffer; - computeSecret(otherPublicKey: string, inputEncoding: BinaryToTextEncoding, outputEncoding?: null): Buffer; - computeSecret(otherPublicKey: NodeJS.ArrayBufferView, inputEncoding: null, outputEncoding: BinaryToTextEncoding): string; - computeSecret(otherPublicKey: string, inputEncoding: BinaryToTextEncoding, outputEncoding: BinaryToTextEncoding): string; - /** - * Returns the Diffie-Hellman prime in the specified `encoding`. - * If `encoding` is provided a string is - * returned; otherwise a `Buffer` is returned. - * @since v0.5.0 - * @param encoding The `encoding` of the return value. - */ - getPrime(): Buffer; - getPrime(encoding: BinaryToTextEncoding): string; - /** - * Returns the Diffie-Hellman generator in the specified `encoding`. - * If `encoding` is provided a string is - * returned; otherwise a `Buffer` is returned. - * @since v0.5.0 - * @param encoding The `encoding` of the return value. - */ - getGenerator(): Buffer; - getGenerator(encoding: BinaryToTextEncoding): string; - /** - * Returns the Diffie-Hellman public key in the specified `encoding`. - * If `encoding` is provided a - * string is returned; otherwise a `Buffer` is returned. - * @since v0.5.0 - * @param encoding The `encoding` of the return value. - */ - getPublicKey(): Buffer; - getPublicKey(encoding: BinaryToTextEncoding): string; - /** - * Returns the Diffie-Hellman private key in the specified `encoding`. - * If `encoding` is provided a - * string is returned; otherwise a `Buffer` is returned. - * @since v0.5.0 - * @param encoding The `encoding` of the return value. - */ - getPrivateKey(): Buffer; - getPrivateKey(encoding: BinaryToTextEncoding): string; - /** - * Sets the Diffie-Hellman public key. If the `encoding` argument is provided,`publicKey` is expected - * to be a string. If no `encoding` is provided, `publicKey` is expected - * to be a `Buffer`, `TypedArray`, or `DataView`. - * @since v0.5.0 - * @param encoding The `encoding` of the `publicKey` string. - */ - setPublicKey(publicKey: NodeJS.ArrayBufferView): void; - setPublicKey(publicKey: string, encoding: BufferEncoding): void; - /** - * Sets the Diffie-Hellman private key. If the `encoding` argument is provided,`privateKey` is expected - * to be a string. If no `encoding` is provided, `privateKey` is expected - * to be a `Buffer`, `TypedArray`, or `DataView`. - * @since v0.5.0 - * @param encoding The `encoding` of the `privateKey` string. - */ - setPrivateKey(privateKey: NodeJS.ArrayBufferView): void; - setPrivateKey(privateKey: string, encoding: BufferEncoding): void; - /** - * A bit field containing any warnings and/or errors resulting from a check - * performed during initialization of the `DiffieHellman` object. - * - * The following values are valid for this property (as defined in `constants`module): - * - * * `DH_CHECK_P_NOT_SAFE_PRIME` - * * `DH_CHECK_P_NOT_PRIME` - * * `DH_UNABLE_TO_CHECK_GENERATOR` - * * `DH_NOT_SUITABLE_GENERATOR` - * @since v0.11.12 - */ - verifyError: number; - } - /** - * The `DiffieHellmanGroup` class takes a well-known modp group as its argument. - * It works the same as `DiffieHellman`, except that it does not allow changing its keys after creation. - * In other words, it does not implement `setPublicKey()` or `setPrivateKey()` methods. - * - * ```js - * const { createDiffieHellmanGroup } = await import('node:crypto'); - * const dh = createDiffieHellmanGroup('modp1'); - * ``` - * The name (e.g. `'modp1'`) is taken from [RFC 2412](https://www.rfc-editor.org/rfc/rfc2412.txt) (modp1 and 2) and [RFC 3526](https://www.rfc-editor.org/rfc/rfc3526.txt): - * ```bash - * $ perl -ne 'print "$1\n" if /"(modp\d+)"/' src/node_crypto_groups.h - * modp1 # 768 bits - * modp2 # 1024 bits - * modp5 # 1536 bits - * modp14 # 2048 bits - * modp15 # etc. - * modp16 - * modp17 - * modp18 - * ``` - * @since v0.7.5 - */ - const DiffieHellmanGroup: DiffieHellmanGroupConstructor; - interface DiffieHellmanGroupConstructor { - new(name: string): DiffieHellmanGroup; - (name: string): DiffieHellmanGroup; - readonly prototype: DiffieHellmanGroup; - } - type DiffieHellmanGroup = Omit; - /** - * Creates a predefined `DiffieHellmanGroup` key exchange object. The - * supported groups are: `'modp1'`, `'modp2'`, `'modp5'` (defined in [RFC 2412](https://www.rfc-editor.org/rfc/rfc2412.txt), but see `Caveats`) and `'modp14'`, `'modp15'`,`'modp16'`, `'modp17'`, - * `'modp18'` (defined in [RFC 3526](https://www.rfc-editor.org/rfc/rfc3526.txt)). The - * returned object mimics the interface of objects created by {@link createDiffieHellman}, but will not allow changing - * the keys (with `diffieHellman.setPublicKey()`, for example). The - * advantage of using this method is that the parties do not have to - * generate nor exchange a group modulus beforehand, saving both processor - * and communication time. - * - * Example (obtaining a shared secret): - * - * ```js - * const { - * getDiffieHellman - * } = await import('crypto'); - * const alice = getDiffieHellman('modp14'); - * const bob = getDiffieHellman('modp14'); - * - * alice.generateKeys(); - * bob.generateKeys(); - * - * const aliceSecret = alice.computeSecret(bob.getPublicKey(), null, 'hex'); - * const bobSecret = bob.computeSecret(alice.getPublicKey(), null, 'hex'); - * - * // aliceSecret and bobSecret should be the same - * console.log(aliceSecret === bobSecret); - * ``` - * @since v0.7.5 - */ - function getDiffieHellman(groupName: string): DiffieHellmanGroup; - /** - * An alias for {@link getDiffieHellman} - * @since v0.9.3 - */ - function createDiffieHellmanGroup(name: string): DiffieHellmanGroup; - /** - * Provides an asynchronous Password-Based Key Derivation Function 2 (PBKDF2) - * implementation. A selected HMAC digest algorithm specified by `digest` is - * applied to derive a key of the requested byte length (`keylen`) from the`password`, `salt` and `iterations`. - * - * The supplied `callback` function is called with two arguments: `err` and`derivedKey`. If an error occurs while deriving the key, `err` will be set; - * otherwise `err` will be `null`. By default, the successfully generated`derivedKey` will be passed to the callback as a `Buffer`. An error will be - * thrown if any of the input arguments specify invalid values or types. - * - * If `digest` is `null`, `'sha1'` will be used. This behavior is deprecated, - * please specify a `digest` explicitly. - * - * The `iterations` argument must be a number set as high as possible. The - * higher the number of iterations, the more secure the derived key will be, - * but will take a longer amount of time to complete. - * - * The `salt` should be as unique as possible. It is recommended that a salt is - * random and at least 16 bytes long. See [NIST SP 800-132](https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-132.pdf) for details. - * - * When passing strings for `password` or `salt`, please consider `caveats when using strings as inputs to cryptographic APIs`. - * - * ```js - * const { - * pbkdf2 - * } = await import('crypto'); - * - * pbkdf2('secret', 'salt', 100000, 64, 'sha512', (err, derivedKey) => { - * if (err) throw err; - * console.log(derivedKey.toString('hex')); // '3745e48...08d59ae' - * }); - * ``` - * - * The `crypto.DEFAULT_ENCODING` property can be used to change the way the`derivedKey` is passed to the callback. This property, however, has been - * deprecated and use should be avoided. - * - * ```js - * import crypto from 'crypto'; - * crypto.DEFAULT_ENCODING = 'hex'; - * crypto.pbkdf2('secret', 'salt', 100000, 512, 'sha512', (err, derivedKey) => { - * if (err) throw err; - * console.log(derivedKey); // '3745e48...aa39b34' - * }); - * ``` - * - * An array of supported digest functions can be retrieved using {@link getHashes}. - * - * This API uses libuv's threadpool, which can have surprising and - * negative performance implications for some applications; see the `UV_THREADPOOL_SIZE` documentation for more information. - * @since v0.5.5 - */ - function pbkdf2(password: BinaryLike, salt: BinaryLike, iterations: number, keylen: number, digest: string, callback: (err: Error | null, derivedKey: Buffer) => void): void; - /** - * Provides a synchronous Password-Based Key Derivation Function 2 (PBKDF2) - * implementation. A selected HMAC digest algorithm specified by `digest` is - * applied to derive a key of the requested byte length (`keylen`) from the`password`, `salt` and `iterations`. - * - * If an error occurs an `Error` will be thrown, otherwise the derived key will be - * returned as a `Buffer`. - * - * If `digest` is `null`, `'sha1'` will be used. This behavior is deprecated, - * please specify a `digest` explicitly. - * - * The `iterations` argument must be a number set as high as possible. The - * higher the number of iterations, the more secure the derived key will be, - * but will take a longer amount of time to complete. - * - * The `salt` should be as unique as possible. It is recommended that a salt is - * random and at least 16 bytes long. See [NIST SP 800-132](https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-132.pdf) for details. - * - * When passing strings for `password` or `salt`, please consider `caveats when using strings as inputs to cryptographic APIs`. - * - * ```js - * const { - * pbkdf2Sync - * } = await import('crypto'); - * - * const key = pbkdf2Sync('secret', 'salt', 100000, 64, 'sha512'); - * console.log(key.toString('hex')); // '3745e48...08d59ae' - * ``` - * - * The `crypto.DEFAULT_ENCODING` property may be used to change the way the`derivedKey` is returned. This property, however, is deprecated and use - * should be avoided. - * - * ```js - * import crypto from 'crypto'; - * crypto.DEFAULT_ENCODING = 'hex'; - * const key = crypto.pbkdf2Sync('secret', 'salt', 100000, 512, 'sha512'); - * console.log(key); // '3745e48...aa39b34' - * ``` - * - * An array of supported digest functions can be retrieved using {@link getHashes}. - * @since v0.9.3 - */ - function pbkdf2Sync(password: BinaryLike, salt: BinaryLike, iterations: number, keylen: number, digest: string): Buffer; - /** - * Generates cryptographically strong pseudorandom data. The `size` argument - * is a number indicating the number of bytes to generate. - * - * If a `callback` function is provided, the bytes are generated asynchronously - * and the `callback` function is invoked with two arguments: `err` and `buf`. - * If an error occurs, `err` will be an `Error` object; otherwise it is `null`. The`buf` argument is a `Buffer` containing the generated bytes. - * - * ```js - * // Asynchronous - * const { - * randomBytes - * } = await import('crypto'); - * - * randomBytes(256, (err, buf) => { - * if (err) throw err; - * console.log(`${buf.length} bytes of random data: ${buf.toString('hex')}`); - * }); - * ``` - * - * If the `callback` function is not provided, the random bytes are generated - * synchronously and returned as a `Buffer`. An error will be thrown if - * there is a problem generating the bytes. - * - * ```js - * // Synchronous - * const { - * randomBytes - * } = await import('crypto'); - * - * const buf = randomBytes(256); - * console.log( - * `${buf.length} bytes of random data: ${buf.toString('hex')}`); - * ``` - * - * The `crypto.randomBytes()` method will not complete until there is - * sufficient entropy available. - * This should normally never take longer than a few milliseconds. The only time - * when generating the random bytes may conceivably block for a longer period of - * time is right after boot, when the whole system is still low on entropy. - * - * This API uses libuv's threadpool, which can have surprising and - * negative performance implications for some applications; see the `UV_THREADPOOL_SIZE` documentation for more information. - * - * The asynchronous version of `crypto.randomBytes()` is carried out in a single - * threadpool request. To minimize threadpool task length variation, partition - * large `randomBytes` requests when doing so as part of fulfilling a client - * request. - * @since v0.5.8 - * @param size The number of bytes to generate. The `size` must not be larger than `2**31 - 1`. - * @return if the `callback` function is not provided. - */ - function randomBytes(size: number): Buffer; - function randomBytes(size: number, callback: (err: Error | null, buf: Buffer) => void): void; - function pseudoRandomBytes(size: number): Buffer; - function pseudoRandomBytes(size: number, callback: (err: Error | null, buf: Buffer) => void): void; - /** - * Return a random integer `n` such that `min <= n < max`. This - * implementation avoids [modulo bias](https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle#Modulo_bias). - * - * The range (`max - min`) must be less than 2^48. `min` and `max` must - * be [safe integers](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isSafeInteger). - * - * If the `callback` function is not provided, the random integer is - * generated synchronously. - * - * ```js - * // Asynchronous - * const { - * randomInt - * } = await import('crypto'); - * - * randomInt(3, (err, n) => { - * if (err) throw err; - * console.log(`Random number chosen from (0, 1, 2): ${n}`); - * }); - * ``` - * - * ```js - * // Synchronous - * const { - * randomInt - * } = await import('crypto'); - * - * const n = randomInt(3); - * console.log(`Random number chosen from (0, 1, 2): ${n}`); - * ``` - * - * ```js - * // With `min` argument - * const { - * randomInt - * } = await import('crypto'); - * - * const n = randomInt(1, 7); - * console.log(`The dice rolled: ${n}`); - * ``` - * @since v14.10.0, v12.19.0 - * @param [min=0] Start of random range (inclusive). - * @param max End of random range (exclusive). - * @param callback `function(err, n) {}`. - */ - function randomInt(max: number): number; - function randomInt(min: number, max: number): number; - function randomInt(max: number, callback: (err: Error | null, value: number) => void): void; - function randomInt(min: number, max: number, callback: (err: Error | null, value: number) => void): void; - /** - * Synchronous version of {@link randomFill}. - * - * ```js - * import { Buffer } from 'buffer'; - * const { randomFillSync } = await import('crypto'); - * - * const buf = Buffer.alloc(10); - * console.log(randomFillSync(buf).toString('hex')); - * - * randomFillSync(buf, 5); - * console.log(buf.toString('hex')); - * - * // The above is equivalent to the following: - * randomFillSync(buf, 5, 5); - * console.log(buf.toString('hex')); - * ``` - * - * Any `ArrayBuffer`, `TypedArray` or `DataView` instance may be passed as`buffer`. - * - * ```js - * import { Buffer } from 'buffer'; - * const { randomFillSync } = await import('crypto'); - * - * const a = new Uint32Array(10); - * console.log(Buffer.from(randomFillSync(a).buffer, - * a.byteOffset, a.byteLength).toString('hex')); - * - * const b = new DataView(new ArrayBuffer(10)); - * console.log(Buffer.from(randomFillSync(b).buffer, - * b.byteOffset, b.byteLength).toString('hex')); - * - * const c = new ArrayBuffer(10); - * console.log(Buffer.from(randomFillSync(c)).toString('hex')); - * ``` - * @since v7.10.0, v6.13.0 - * @param buffer Must be supplied. The size of the provided `buffer` must not be larger than `2**31 - 1`. - * @param [offset=0] - * @param [size=buffer.length - offset] - * @return The object passed as `buffer` argument. - */ - function randomFillSync(buffer: T, offset?: number, size?: number): T; - /** - * This function is similar to {@link randomBytes} but requires the first - * argument to be a `Buffer` that will be filled. It also - * requires that a callback is passed in. - * - * If the `callback` function is not provided, an error will be thrown. - * - * ```js - * import { Buffer } from 'buffer'; - * const { randomFill } = await import('crypto'); - * - * const buf = Buffer.alloc(10); - * randomFill(buf, (err, buf) => { - * if (err) throw err; - * console.log(buf.toString('hex')); - * }); - * - * randomFill(buf, 5, (err, buf) => { - * if (err) throw err; - * console.log(buf.toString('hex')); - * }); - * - * // The above is equivalent to the following: - * randomFill(buf, 5, 5, (err, buf) => { - * if (err) throw err; - * console.log(buf.toString('hex')); - * }); - * ``` - * - * Any `ArrayBuffer`, `TypedArray`, or `DataView` instance may be passed as`buffer`. - * - * While this includes instances of `Float32Array` and `Float64Array`, this - * function should not be used to generate random floating-point numbers. The - * result may contain `+Infinity`, `-Infinity`, and `NaN`, and even if the array - * contains finite numbers only, they are not drawn from a uniform random - * distribution and have no meaningful lower or upper bounds. - * - * ```js - * import { Buffer } from 'buffer'; - * const { randomFill } = await import('crypto'); - * - * const a = new Uint32Array(10); - * randomFill(a, (err, buf) => { - * if (err) throw err; - * console.log(Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength) - * .toString('hex')); - * }); - * - * const b = new DataView(new ArrayBuffer(10)); - * randomFill(b, (err, buf) => { - * if (err) throw err; - * console.log(Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength) - * .toString('hex')); - * }); - * - * const c = new ArrayBuffer(10); - * randomFill(c, (err, buf) => { - * if (err) throw err; - * console.log(Buffer.from(buf).toString('hex')); - * }); - * ``` - * - * This API uses libuv's threadpool, which can have surprising and - * negative performance implications for some applications; see the `UV_THREADPOOL_SIZE` documentation for more information. - * - * The asynchronous version of `crypto.randomFill()` is carried out in a single - * threadpool request. To minimize threadpool task length variation, partition - * large `randomFill` requests when doing so as part of fulfilling a client - * request. - * @since v7.10.0, v6.13.0 - * @param buffer Must be supplied. The size of the provided `buffer` must not be larger than `2**31 - 1`. - * @param [offset=0] - * @param [size=buffer.length - offset] - * @param callback `function(err, buf) {}`. - */ - function randomFill(buffer: T, callback: (err: Error | null, buf: T) => void): void; - function randomFill(buffer: T, offset: number, callback: (err: Error | null, buf: T) => void): void; - function randomFill(buffer: T, offset: number, size: number, callback: (err: Error | null, buf: T) => void): void; - interface ScryptOptions { - cost?: number | undefined; - blockSize?: number | undefined; - parallelization?: number | undefined; - N?: number | undefined; - r?: number | undefined; - p?: number | undefined; - maxmem?: number | undefined; - } - /** - * Provides an asynchronous [scrypt](https://en.wikipedia.org/wiki/Scrypt) implementation. Scrypt is a password-based - * key derivation function that is designed to be expensive computationally and - * memory-wise in order to make brute-force attacks unrewarding. - * - * The `salt` should be as unique as possible. It is recommended that a salt is - * random and at least 16 bytes long. See [NIST SP 800-132](https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-132.pdf) for details. - * - * When passing strings for `password` or `salt`, please consider `caveats when using strings as inputs to cryptographic APIs`. - * - * The `callback` function is called with two arguments: `err` and `derivedKey`.`err` is an exception object when key derivation fails, otherwise `err` is`null`. `derivedKey` is passed to the - * callback as a `Buffer`. - * - * An exception is thrown when any of the input arguments specify invalid values - * or types. - * - * ```js - * const { - * scrypt - * } = await import('crypto'); - * - * // Using the factory defaults. - * scrypt('password', 'salt', 64, (err, derivedKey) => { - * if (err) throw err; - * console.log(derivedKey.toString('hex')); // '3745e48...08d59ae' - * }); - * // Using a custom N parameter. Must be a power of two. - * scrypt('password', 'salt', 64, { N: 1024 }, (err, derivedKey) => { - * if (err) throw err; - * console.log(derivedKey.toString('hex')); // '3745e48...aa39b34' - * }); - * ``` - * @since v10.5.0 - */ - function scrypt(password: BinaryLike, salt: BinaryLike, keylen: number, callback: (err: Error | null, derivedKey: Buffer) => void): void; - function scrypt(password: BinaryLike, salt: BinaryLike, keylen: number, options: ScryptOptions, callback: (err: Error | null, derivedKey: Buffer) => void): void; - /** - * Provides a synchronous [scrypt](https://en.wikipedia.org/wiki/Scrypt) implementation. Scrypt is a password-based - * key derivation function that is designed to be expensive computationally and - * memory-wise in order to make brute-force attacks unrewarding. - * - * The `salt` should be as unique as possible. It is recommended that a salt is - * random and at least 16 bytes long. See [NIST SP 800-132](https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-132.pdf) for details. - * - * When passing strings for `password` or `salt`, please consider `caveats when using strings as inputs to cryptographic APIs`. - * - * An exception is thrown when key derivation fails, otherwise the derived key is - * returned as a `Buffer`. - * - * An exception is thrown when any of the input arguments specify invalid values - * or types. - * - * ```js - * const { - * scryptSync - * } = await import('crypto'); - * // Using the factory defaults. - * - * const key1 = scryptSync('password', 'salt', 64); - * console.log(key1.toString('hex')); // '3745e48...08d59ae' - * // Using a custom N parameter. Must be a power of two. - * const key2 = scryptSync('password', 'salt', 64, { N: 1024 }); - * console.log(key2.toString('hex')); // '3745e48...aa39b34' - * ``` - * @since v10.5.0 - */ - function scryptSync(password: BinaryLike, salt: BinaryLike, keylen: number, options?: ScryptOptions): Buffer; - interface RsaPublicKey { - key: KeyLike; - padding?: number | undefined; - } - interface RsaPrivateKey { - key: KeyLike; - passphrase?: string | undefined; - /** - * @default 'sha1' - */ - oaepHash?: string | undefined; - oaepLabel?: NodeJS.TypedArray | undefined; - padding?: number | undefined; - } - /** - * Encrypts the content of `buffer` with `key` and returns a new `Buffer` with encrypted content. The returned data can be decrypted using - * the corresponding private key, for example using {@link privateDecrypt}. - * - * If `key` is not a `KeyObject`, this function behaves as if`key` had been passed to {@link createPublicKey}. If it is an - * object, the `padding` property can be passed. Otherwise, this function uses`RSA_PKCS1_OAEP_PADDING`. - * - * Because RSA public keys can be derived from private keys, a private key may - * be passed instead of a public key. - * @since v0.11.14 - */ - function publicEncrypt(key: RsaPublicKey | RsaPrivateKey | KeyLike, buffer: NodeJS.ArrayBufferView): Buffer; - /** - * Decrypts `buffer` with `key`.`buffer` was previously encrypted using - * the corresponding private key, for example using {@link privateEncrypt}. - * - * If `key` is not a `KeyObject`, this function behaves as if`key` had been passed to {@link createPublicKey}. If it is an - * object, the `padding` property can be passed. Otherwise, this function uses`RSA_PKCS1_PADDING`. - * - * Because RSA public keys can be derived from private keys, a private key may - * be passed instead of a public key. - * @since v1.1.0 - */ - function publicDecrypt(key: RsaPublicKey | RsaPrivateKey | KeyLike, buffer: NodeJS.ArrayBufferView): Buffer; - /** - * Decrypts `buffer` with `privateKey`. `buffer` was previously encrypted using - * the corresponding public key, for example using {@link publicEncrypt}. - * - * If `privateKey` is not a `KeyObject`, this function behaves as if`privateKey` had been passed to {@link createPrivateKey}. If it is an - * object, the `padding` property can be passed. Otherwise, this function uses`RSA_PKCS1_OAEP_PADDING`. - * @since v0.11.14 - */ - function privateDecrypt(privateKey: RsaPrivateKey | KeyLike, buffer: NodeJS.ArrayBufferView): Buffer; - /** - * Encrypts `buffer` with `privateKey`. The returned data can be decrypted using - * the corresponding public key, for example using {@link publicDecrypt}. - * - * If `privateKey` is not a `KeyObject`, this function behaves as if`privateKey` had been passed to {@link createPrivateKey}. If it is an - * object, the `padding` property can be passed. Otherwise, this function uses`RSA_PKCS1_PADDING`. - * @since v1.1.0 - */ - function privateEncrypt(privateKey: RsaPrivateKey | KeyLike, buffer: NodeJS.ArrayBufferView): Buffer; - /** - * ```js - * const { - * getCiphers - * } = await import('crypto'); - * - * console.log(getCiphers()); // ['aes-128-cbc', 'aes-128-ccm', ...] - * ``` - * @since v0.9.3 - * @return An array with the names of the supported cipher algorithms. - */ - function getCiphers(): string[]; - /** - * ```js - * const { - * getCurves - * } = await import('crypto'); - * - * console.log(getCurves()); // ['Oakley-EC2N-3', 'Oakley-EC2N-4', ...] - * ``` - * @since v2.3.0 - * @return An array with the names of the supported elliptic curves. - */ - function getCurves(): string[]; - /** - * @since v10.0.0 - * @return `1` if and only if a FIPS compliant crypto provider is currently in use, `0` otherwise. A future semver-major release may change the return type of this API to a {boolean}. - */ - function getFips(): 1 | 0; - /** - * Enables the FIPS compliant crypto provider in a FIPS-enabled Node.js build. Throws an error if FIPS mode is not available. - * @since v10.0.0 - * @param bool `true` to enable FIPS mode. - */ - function setFips(bool: boolean): void; - /** - * ```js - * const { - * getHashes - * } = await import('crypto'); - * - * console.log(getHashes()); // ['DSA', 'DSA-SHA', 'DSA-SHA1', ...] - * ``` - * @since v0.9.3 - * @return An array of the names of the supported hash algorithms, such as `'RSA-SHA256'`. Hash algorithms are also called "digest" algorithms. - */ - function getHashes(): string[]; - /** - * The `ECDH` class is a utility for creating Elliptic Curve Diffie-Hellman (ECDH) - * key exchanges. - * - * Instances of the `ECDH` class can be created using the {@link createECDH} function. - * - * ```js - * import assert from 'assert'; - * - * const { - * createECDH - * } = await import('crypto'); - * - * // Generate Alice's keys... - * const alice = createECDH('secp521r1'); - * const aliceKey = alice.generateKeys(); - * - * // Generate Bob's keys... - * const bob = createECDH('secp521r1'); - * const bobKey = bob.generateKeys(); - * - * // Exchange and generate the secret... - * const aliceSecret = alice.computeSecret(bobKey); - * const bobSecret = bob.computeSecret(aliceKey); - * - * assert.strictEqual(aliceSecret.toString('hex'), bobSecret.toString('hex')); - * // OK - * ``` - * @since v0.11.14 - */ - class ECDH { - private constructor(); - /** - * Converts the EC Diffie-Hellman public key specified by `key` and `curve` to the - * format specified by `format`. The `format` argument specifies point encoding - * and can be `'compressed'`, `'uncompressed'` or `'hybrid'`. The supplied key is - * interpreted using the specified `inputEncoding`, and the returned key is encoded - * using the specified `outputEncoding`. - * - * Use {@link getCurves} to obtain a list of available curve names. - * On recent OpenSSL releases, `openssl ecparam -list_curves` will also display - * the name and description of each available elliptic curve. - * - * If `format` is not specified the point will be returned in `'uncompressed'`format. - * - * If the `inputEncoding` is not provided, `key` is expected to be a `Buffer`,`TypedArray`, or `DataView`. - * - * Example (uncompressing a key): - * - * ```js - * const { - * createECDH, - * ECDH - * } = await import('crypto'); - * - * const ecdh = createECDH('secp256k1'); - * ecdh.generateKeys(); - * - * const compressedKey = ecdh.getPublicKey('hex', 'compressed'); - * - * const uncompressedKey = ECDH.convertKey(compressedKey, - * 'secp256k1', - * 'hex', - * 'hex', - * 'uncompressed'); - * - * // The converted key and the uncompressed public key should be the same - * console.log(uncompressedKey === ecdh.getPublicKey('hex')); - * ``` - * @since v10.0.0 - * @param inputEncoding The `encoding` of the `key` string. - * @param outputEncoding The `encoding` of the return value. - * @param [format='uncompressed'] - */ - static convertKey( - key: BinaryLike, - curve: string, - inputEncoding?: BinaryToTextEncoding, - outputEncoding?: 'latin1' | 'hex' | 'base64' | 'base64url', - format?: 'uncompressed' | 'compressed' | 'hybrid' - ): Buffer | string; - /** - * Generates private and public EC Diffie-Hellman key values, and returns - * the public key in the specified `format` and `encoding`. This key should be - * transferred to the other party. - * - * The `format` argument specifies point encoding and can be `'compressed'` or`'uncompressed'`. If `format` is not specified, the point will be returned in`'uncompressed'` format. - * - * If `encoding` is provided a string is returned; otherwise a `Buffer` is returned. - * @since v0.11.14 - * @param encoding The `encoding` of the return value. - * @param [format='uncompressed'] - */ - generateKeys(): Buffer; - generateKeys(encoding: BinaryToTextEncoding, format?: ECDHKeyFormat): string; - /** - * Computes the shared secret using `otherPublicKey` as the other - * party's public key and returns the computed shared secret. The supplied - * key is interpreted using specified `inputEncoding`, and the returned secret - * is encoded using the specified `outputEncoding`. - * If the `inputEncoding` is not - * provided, `otherPublicKey` is expected to be a `Buffer`, `TypedArray`, or`DataView`. - * - * If `outputEncoding` is given a string will be returned; otherwise a `Buffer` is returned. - * - * `ecdh.computeSecret` will throw an`ERR_CRYPTO_ECDH_INVALID_PUBLIC_KEY` error when `otherPublicKey`lies outside of the elliptic curve. Since `otherPublicKey` is - * usually supplied from a remote user over an insecure network, - * be sure to handle this exception accordingly. - * @since v0.11.14 - * @param inputEncoding The `encoding` of the `otherPublicKey` string. - * @param outputEncoding The `encoding` of the return value. - */ - computeSecret(otherPublicKey: NodeJS.ArrayBufferView): Buffer; - computeSecret(otherPublicKey: string, inputEncoding: BinaryToTextEncoding): Buffer; - computeSecret(otherPublicKey: NodeJS.ArrayBufferView, outputEncoding: BinaryToTextEncoding): string; - computeSecret(otherPublicKey: string, inputEncoding: BinaryToTextEncoding, outputEncoding: BinaryToTextEncoding): string; - /** - * If `encoding` is specified, a string is returned; otherwise a `Buffer` is - * returned. - * @since v0.11.14 - * @param encoding The `encoding` of the return value. - * @return The EC Diffie-Hellman in the specified `encoding`. - */ - getPrivateKey(): Buffer; - getPrivateKey(encoding: BinaryToTextEncoding): string; - /** - * The `format` argument specifies point encoding and can be `'compressed'` or`'uncompressed'`. If `format` is not specified the point will be returned in`'uncompressed'` format. - * - * If `encoding` is specified, a string is returned; otherwise a `Buffer` is - * returned. - * @since v0.11.14 - * @param [encoding] The `encoding` of the return value. - * @param [format='uncompressed'] - * @return The EC Diffie-Hellman public key in the specified `encoding` and `format`. - */ - getPublicKey(encoding?: null, format?: ECDHKeyFormat): Buffer; - getPublicKey(encoding: BinaryToTextEncoding, format?: ECDHKeyFormat): string; - /** - * Sets the EC Diffie-Hellman private key. - * If `encoding` is provided, `privateKey` is expected - * to be a string; otherwise `privateKey` is expected to be a `Buffer`,`TypedArray`, or `DataView`. - * - * If `privateKey` is not valid for the curve specified when the `ECDH` object was - * created, an error is thrown. Upon setting the private key, the associated - * public point (key) is also generated and set in the `ECDH` object. - * @since v0.11.14 - * @param encoding The `encoding` of the `privateKey` string. - */ - setPrivateKey(privateKey: NodeJS.ArrayBufferView): void; - setPrivateKey(privateKey: string, encoding: BinaryToTextEncoding): void; - } - /** - * Creates an Elliptic Curve Diffie-Hellman (`ECDH`) key exchange object using a - * predefined curve specified by the `curveName` string. Use {@link getCurves} to obtain a list of available curve names. On recent - * OpenSSL releases, `openssl ecparam -list_curves` will also display the name - * and description of each available elliptic curve. - * @since v0.11.14 - */ - function createECDH(curveName: string): ECDH; - /** - * This function is based on a constant-time algorithm. - * Returns true if `a` is equal to `b`, without leaking timing information that - * would allow an attacker to guess one of the values. This is suitable for - * comparing HMAC digests or secret values like authentication cookies or [capability urls](https://www.w3.org/TR/capability-urls/). - * - * `a` and `b` must both be `Buffer`s, `TypedArray`s, or `DataView`s, and they - * must have the same byte length. An error is thrown if `a` and `b` have - * different byte lengths. - * - * If at least one of `a` and `b` is a `TypedArray` with more than one byte per - * entry, such as `Uint16Array`, the result will be computed using the platform - * byte order. - * - * Use of `crypto.timingSafeEqual` does not guarantee that the _surrounding_ code - * is timing-safe. Care should be taken to ensure that the surrounding code does - * not introduce timing vulnerabilities. - * @since v6.6.0 - */ - function timingSafeEqual(a: NodeJS.ArrayBufferView, b: NodeJS.ArrayBufferView): boolean; - /** @deprecated since v10.0.0 */ - const DEFAULT_ENCODING: BufferEncoding; - type KeyType = 'rsa' | 'rsa-pss' | 'dsa' | 'ec' | 'ed25519' | 'ed448' | 'x25519' | 'x448'; - type KeyFormat = 'pem' | 'der'; - interface BasePrivateKeyEncodingOptions { - format: T; - cipher?: string | undefined; - passphrase?: string | undefined; - } - interface KeyPairKeyObjectResult { - publicKey: KeyObject; - privateKey: KeyObject; - } - interface ED25519KeyPairKeyObjectOptions {} - interface ED448KeyPairKeyObjectOptions {} - interface X25519KeyPairKeyObjectOptions {} - interface X448KeyPairKeyObjectOptions {} - interface ECKeyPairKeyObjectOptions { - /** - * Name of the curve to use - */ - namedCurve: string; - } - interface RSAKeyPairKeyObjectOptions { - /** - * Key size in bits - */ - modulusLength: number; - /** - * Public exponent - * @default 0x10001 - */ - publicExponent?: number | undefined; - } - interface RSAPSSKeyPairKeyObjectOptions { - /** - * Key size in bits - */ - modulusLength: number; - /** - * Public exponent - * @default 0x10001 - */ - publicExponent?: number | undefined; - /** - * Name of the message digest - */ - hashAlgorithm?: string; - /** - * Name of the message digest used by MGF1 - */ - mgf1HashAlgorithm?: string; - /** - * Minimal salt length in bytes - */ - saltLength?: string; - } - interface DSAKeyPairKeyObjectOptions { - /** - * Key size in bits - */ - modulusLength: number; - /** - * Size of q in bits - */ - divisorLength: number; - } - interface RSAKeyPairOptions { - /** - * Key size in bits - */ - modulusLength: number; - /** - * Public exponent - * @default 0x10001 - */ - publicExponent?: number | undefined; - publicKeyEncoding: { - type: 'pkcs1' | 'spki'; - format: PubF; - }; - privateKeyEncoding: BasePrivateKeyEncodingOptions & { - type: 'pkcs1' | 'pkcs8'; - }; - } - interface RSAPSSKeyPairOptions { - /** - * Key size in bits - */ - modulusLength: number; - /** - * Public exponent - * @default 0x10001 - */ - publicExponent?: number | undefined; - /** - * Name of the message digest - */ - hashAlgorithm?: string; - /** - * Name of the message digest used by MGF1 - */ - mgf1HashAlgorithm?: string; - /** - * Minimal salt length in bytes - */ - saltLength?: string; - publicKeyEncoding: { - type: 'spki'; - format: PubF; - }; - privateKeyEncoding: BasePrivateKeyEncodingOptions & { - type: 'pkcs8'; - }; - } - interface DSAKeyPairOptions { - /** - * Key size in bits - */ - modulusLength: number; - /** - * Size of q in bits - */ - divisorLength: number; - publicKeyEncoding: { - type: 'spki'; - format: PubF; - }; - privateKeyEncoding: BasePrivateKeyEncodingOptions & { - type: 'pkcs8'; - }; - } - interface ECKeyPairOptions { - /** - * Name of the curve to use. - */ - namedCurve: string; - publicKeyEncoding: { - type: 'pkcs1' | 'spki'; - format: PubF; - }; - privateKeyEncoding: BasePrivateKeyEncodingOptions & { - type: 'sec1' | 'pkcs8'; - }; - } - interface ED25519KeyPairOptions { - publicKeyEncoding: { - type: 'spki'; - format: PubF; - }; - privateKeyEncoding: BasePrivateKeyEncodingOptions & { - type: 'pkcs8'; - }; - } - interface ED448KeyPairOptions { - publicKeyEncoding: { - type: 'spki'; - format: PubF; - }; - privateKeyEncoding: BasePrivateKeyEncodingOptions & { - type: 'pkcs8'; - }; - } - interface X25519KeyPairOptions { - publicKeyEncoding: { - type: 'spki'; - format: PubF; - }; - privateKeyEncoding: BasePrivateKeyEncodingOptions & { - type: 'pkcs8'; - }; - } - interface X448KeyPairOptions { - publicKeyEncoding: { - type: 'spki'; - format: PubF; - }; - privateKeyEncoding: BasePrivateKeyEncodingOptions & { - type: 'pkcs8'; - }; - } - interface KeyPairSyncResult { - publicKey: T1; - privateKey: T2; - } - /** - * Generates a new asymmetric key pair of the given `type`. RSA, RSA-PSS, DSA, EC, - * Ed25519, Ed448, X25519, X448, and DH are currently supported. - * - * If a `publicKeyEncoding` or `privateKeyEncoding` was specified, this function - * behaves as if `keyObject.export()` had been called on its result. Otherwise, - * the respective part of the key is returned as a `KeyObject`. - * - * When encoding public keys, it is recommended to use `'spki'`. When encoding - * private keys, it is recommended to use `'pkcs8'` with a strong passphrase, - * and to keep the passphrase confidential. - * - * ```js - * const { - * generateKeyPairSync - * } = await import('crypto'); - * - * const { - * publicKey, - * privateKey, - * } = generateKeyPairSync('rsa', { - * modulusLength: 4096, - * publicKeyEncoding: { - * type: 'spki', - * format: 'pem' - * }, - * privateKeyEncoding: { - * type: 'pkcs8', - * format: 'pem', - * cipher: 'aes-256-cbc', - * passphrase: 'top secret' - * } - * }); - * ``` - * - * The return value `{ publicKey, privateKey }` represents the generated key pair. - * When PEM encoding was selected, the respective key will be a string, otherwise - * it will be a buffer containing the data encoded as DER. - * @since v10.12.0 - * @param type Must be `'rsa'`, `'rsa-pss'`, `'dsa'`, `'ec'`, `'ed25519'`, `'ed448'`, `'x25519'`, `'x448'`, or `'dh'`. - */ - function generateKeyPairSync(type: 'rsa', options: RSAKeyPairOptions<'pem', 'pem'>): KeyPairSyncResult; - function generateKeyPairSync(type: 'rsa', options: RSAKeyPairOptions<'pem', 'der'>): KeyPairSyncResult; - function generateKeyPairSync(type: 'rsa', options: RSAKeyPairOptions<'der', 'pem'>): KeyPairSyncResult; - function generateKeyPairSync(type: 'rsa', options: RSAKeyPairOptions<'der', 'der'>): KeyPairSyncResult; - function generateKeyPairSync(type: 'rsa', options: RSAKeyPairKeyObjectOptions): KeyPairKeyObjectResult; - function generateKeyPairSync(type: 'rsa-pss', options: RSAPSSKeyPairOptions<'pem', 'pem'>): KeyPairSyncResult; - function generateKeyPairSync(type: 'rsa-pss', options: RSAPSSKeyPairOptions<'pem', 'der'>): KeyPairSyncResult; - function generateKeyPairSync(type: 'rsa-pss', options: RSAPSSKeyPairOptions<'der', 'pem'>): KeyPairSyncResult; - function generateKeyPairSync(type: 'rsa-pss', options: RSAPSSKeyPairOptions<'der', 'der'>): KeyPairSyncResult; - function generateKeyPairSync(type: 'rsa-pss', options: RSAPSSKeyPairKeyObjectOptions): KeyPairKeyObjectResult; - function generateKeyPairSync(type: 'dsa', options: DSAKeyPairOptions<'pem', 'pem'>): KeyPairSyncResult; - function generateKeyPairSync(type: 'dsa', options: DSAKeyPairOptions<'pem', 'der'>): KeyPairSyncResult; - function generateKeyPairSync(type: 'dsa', options: DSAKeyPairOptions<'der', 'pem'>): KeyPairSyncResult; - function generateKeyPairSync(type: 'dsa', options: DSAKeyPairOptions<'der', 'der'>): KeyPairSyncResult; - function generateKeyPairSync(type: 'dsa', options: DSAKeyPairKeyObjectOptions): KeyPairKeyObjectResult; - function generateKeyPairSync(type: 'ec', options: ECKeyPairOptions<'pem', 'pem'>): KeyPairSyncResult; - function generateKeyPairSync(type: 'ec', options: ECKeyPairOptions<'pem', 'der'>): KeyPairSyncResult; - function generateKeyPairSync(type: 'ec', options: ECKeyPairOptions<'der', 'pem'>): KeyPairSyncResult; - function generateKeyPairSync(type: 'ec', options: ECKeyPairOptions<'der', 'der'>): KeyPairSyncResult; - function generateKeyPairSync(type: 'ec', options: ECKeyPairKeyObjectOptions): KeyPairKeyObjectResult; - function generateKeyPairSync(type: 'ed25519', options: ED25519KeyPairOptions<'pem', 'pem'>): KeyPairSyncResult; - function generateKeyPairSync(type: 'ed25519', options: ED25519KeyPairOptions<'pem', 'der'>): KeyPairSyncResult; - function generateKeyPairSync(type: 'ed25519', options: ED25519KeyPairOptions<'der', 'pem'>): KeyPairSyncResult; - function generateKeyPairSync(type: 'ed25519', options: ED25519KeyPairOptions<'der', 'der'>): KeyPairSyncResult; - function generateKeyPairSync(type: 'ed25519', options?: ED25519KeyPairKeyObjectOptions): KeyPairKeyObjectResult; - function generateKeyPairSync(type: 'ed448', options: ED448KeyPairOptions<'pem', 'pem'>): KeyPairSyncResult; - function generateKeyPairSync(type: 'ed448', options: ED448KeyPairOptions<'pem', 'der'>): KeyPairSyncResult; - function generateKeyPairSync(type: 'ed448', options: ED448KeyPairOptions<'der', 'pem'>): KeyPairSyncResult; - function generateKeyPairSync(type: 'ed448', options: ED448KeyPairOptions<'der', 'der'>): KeyPairSyncResult; - function generateKeyPairSync(type: 'ed448', options?: ED448KeyPairKeyObjectOptions): KeyPairKeyObjectResult; - function generateKeyPairSync(type: 'x25519', options: X25519KeyPairOptions<'pem', 'pem'>): KeyPairSyncResult; - function generateKeyPairSync(type: 'x25519', options: X25519KeyPairOptions<'pem', 'der'>): KeyPairSyncResult; - function generateKeyPairSync(type: 'x25519', options: X25519KeyPairOptions<'der', 'pem'>): KeyPairSyncResult; - function generateKeyPairSync(type: 'x25519', options: X25519KeyPairOptions<'der', 'der'>): KeyPairSyncResult; - function generateKeyPairSync(type: 'x25519', options?: X25519KeyPairKeyObjectOptions): KeyPairKeyObjectResult; - function generateKeyPairSync(type: 'x448', options: X448KeyPairOptions<'pem', 'pem'>): KeyPairSyncResult; - function generateKeyPairSync(type: 'x448', options: X448KeyPairOptions<'pem', 'der'>): KeyPairSyncResult; - function generateKeyPairSync(type: 'x448', options: X448KeyPairOptions<'der', 'pem'>): KeyPairSyncResult; - function generateKeyPairSync(type: 'x448', options: X448KeyPairOptions<'der', 'der'>): KeyPairSyncResult; - function generateKeyPairSync(type: 'x448', options?: X448KeyPairKeyObjectOptions): KeyPairKeyObjectResult; - /** - * Generates a new asymmetric key pair of the given `type`. RSA, RSA-PSS, DSA, EC, - * Ed25519, Ed448, X25519, X448, and DH are currently supported. - * - * If a `publicKeyEncoding` or `privateKeyEncoding` was specified, this function - * behaves as if `keyObject.export()` had been called on its result. Otherwise, - * the respective part of the key is returned as a `KeyObject`. - * - * It is recommended to encode public keys as `'spki'` and private keys as`'pkcs8'` with encryption for long-term storage: - * - * ```js - * const { - * generateKeyPair - * } = await import('crypto'); - * - * generateKeyPair('rsa', { - * modulusLength: 4096, - * publicKeyEncoding: { - * type: 'spki', - * format: 'pem' - * }, - * privateKeyEncoding: { - * type: 'pkcs8', - * format: 'pem', - * cipher: 'aes-256-cbc', - * passphrase: 'top secret' - * } - * }, (err, publicKey, privateKey) => { - * // Handle errors and use the generated key pair. - * }); - * ``` - * - * On completion, `callback` will be called with `err` set to `undefined` and`publicKey` / `privateKey` representing the generated key pair. - * - * If this method is invoked as its `util.promisify()` ed version, it returns - * a `Promise` for an `Object` with `publicKey` and `privateKey` properties. - * @since v10.12.0 - * @param type Must be `'rsa'`, `'rsa-pss'`, `'dsa'`, `'ec'`, `'ed25519'`, `'ed448'`, `'x25519'`, `'x448'`, or `'dh'`. - */ - function generateKeyPair(type: 'rsa', options: RSAKeyPairOptions<'pem', 'pem'>, callback: (err: Error | null, publicKey: string, privateKey: string) => void): void; - function generateKeyPair(type: 'rsa', options: RSAKeyPairOptions<'pem', 'der'>, callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void): void; - function generateKeyPair(type: 'rsa', options: RSAKeyPairOptions<'der', 'pem'>, callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void): void; - function generateKeyPair(type: 'rsa', options: RSAKeyPairOptions<'der', 'der'>, callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void): void; - function generateKeyPair(type: 'rsa', options: RSAKeyPairKeyObjectOptions, callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void): void; - function generateKeyPair(type: 'rsa-pss', options: RSAPSSKeyPairOptions<'pem', 'pem'>, callback: (err: Error | null, publicKey: string, privateKey: string) => void): void; - function generateKeyPair(type: 'rsa-pss', options: RSAPSSKeyPairOptions<'pem', 'der'>, callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void): void; - function generateKeyPair(type: 'rsa-pss', options: RSAPSSKeyPairOptions<'der', 'pem'>, callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void): void; - function generateKeyPair(type: 'rsa-pss', options: RSAPSSKeyPairOptions<'der', 'der'>, callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void): void; - function generateKeyPair(type: 'rsa-pss', options: RSAPSSKeyPairKeyObjectOptions, callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void): void; - function generateKeyPair(type: 'dsa', options: DSAKeyPairOptions<'pem', 'pem'>, callback: (err: Error | null, publicKey: string, privateKey: string) => void): void; - function generateKeyPair(type: 'dsa', options: DSAKeyPairOptions<'pem', 'der'>, callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void): void; - function generateKeyPair(type: 'dsa', options: DSAKeyPairOptions<'der', 'pem'>, callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void): void; - function generateKeyPair(type: 'dsa', options: DSAKeyPairOptions<'der', 'der'>, callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void): void; - function generateKeyPair(type: 'dsa', options: DSAKeyPairKeyObjectOptions, callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void): void; - function generateKeyPair(type: 'ec', options: ECKeyPairOptions<'pem', 'pem'>, callback: (err: Error | null, publicKey: string, privateKey: string) => void): void; - function generateKeyPair(type: 'ec', options: ECKeyPairOptions<'pem', 'der'>, callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void): void; - function generateKeyPair(type: 'ec', options: ECKeyPairOptions<'der', 'pem'>, callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void): void; - function generateKeyPair(type: 'ec', options: ECKeyPairOptions<'der', 'der'>, callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void): void; - function generateKeyPair(type: 'ec', options: ECKeyPairKeyObjectOptions, callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void): void; - function generateKeyPair(type: 'ed25519', options: ED25519KeyPairOptions<'pem', 'pem'>, callback: (err: Error | null, publicKey: string, privateKey: string) => void): void; - function generateKeyPair(type: 'ed25519', options: ED25519KeyPairOptions<'pem', 'der'>, callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void): void; - function generateKeyPair(type: 'ed25519', options: ED25519KeyPairOptions<'der', 'pem'>, callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void): void; - function generateKeyPair(type: 'ed25519', options: ED25519KeyPairOptions<'der', 'der'>, callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void): void; - function generateKeyPair(type: 'ed25519', options: ED25519KeyPairKeyObjectOptions | undefined, callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void): void; - function generateKeyPair(type: 'ed448', options: ED448KeyPairOptions<'pem', 'pem'>, callback: (err: Error | null, publicKey: string, privateKey: string) => void): void; - function generateKeyPair(type: 'ed448', options: ED448KeyPairOptions<'pem', 'der'>, callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void): void; - function generateKeyPair(type: 'ed448', options: ED448KeyPairOptions<'der', 'pem'>, callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void): void; - function generateKeyPair(type: 'ed448', options: ED448KeyPairOptions<'der', 'der'>, callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void): void; - function generateKeyPair(type: 'ed448', options: ED448KeyPairKeyObjectOptions | undefined, callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void): void; - function generateKeyPair(type: 'x25519', options: X25519KeyPairOptions<'pem', 'pem'>, callback: (err: Error | null, publicKey: string, privateKey: string) => void): void; - function generateKeyPair(type: 'x25519', options: X25519KeyPairOptions<'pem', 'der'>, callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void): void; - function generateKeyPair(type: 'x25519', options: X25519KeyPairOptions<'der', 'pem'>, callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void): void; - function generateKeyPair(type: 'x25519', options: X25519KeyPairOptions<'der', 'der'>, callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void): void; - function generateKeyPair(type: 'x25519', options: X25519KeyPairKeyObjectOptions | undefined, callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void): void; - function generateKeyPair(type: 'x448', options: X448KeyPairOptions<'pem', 'pem'>, callback: (err: Error | null, publicKey: string, privateKey: string) => void): void; - function generateKeyPair(type: 'x448', options: X448KeyPairOptions<'pem', 'der'>, callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void): void; - function generateKeyPair(type: 'x448', options: X448KeyPairOptions<'der', 'pem'>, callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void): void; - function generateKeyPair(type: 'x448', options: X448KeyPairOptions<'der', 'der'>, callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void): void; - function generateKeyPair(type: 'x448', options: X448KeyPairKeyObjectOptions | undefined, callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void): void; - namespace generateKeyPair { - function __promisify__( - type: 'rsa', - options: RSAKeyPairOptions<'pem', 'pem'> - ): Promise<{ - publicKey: string; - privateKey: string; - }>; - function __promisify__( - type: 'rsa', - options: RSAKeyPairOptions<'pem', 'der'> - ): Promise<{ - publicKey: string; - privateKey: Buffer; - }>; - function __promisify__( - type: 'rsa', - options: RSAKeyPairOptions<'der', 'pem'> - ): Promise<{ - publicKey: Buffer; - privateKey: string; - }>; - function __promisify__( - type: 'rsa', - options: RSAKeyPairOptions<'der', 'der'> - ): Promise<{ - publicKey: Buffer; - privateKey: Buffer; - }>; - function __promisify__(type: 'rsa', options: RSAKeyPairKeyObjectOptions): Promise; - function __promisify__( - type: 'rsa-pss', - options: RSAPSSKeyPairOptions<'pem', 'pem'> - ): Promise<{ - publicKey: string; - privateKey: string; - }>; - function __promisify__( - type: 'rsa-pss', - options: RSAPSSKeyPairOptions<'pem', 'der'> - ): Promise<{ - publicKey: string; - privateKey: Buffer; - }>; - function __promisify__( - type: 'rsa-pss', - options: RSAPSSKeyPairOptions<'der', 'pem'> - ): Promise<{ - publicKey: Buffer; - privateKey: string; - }>; - function __promisify__( - type: 'rsa-pss', - options: RSAPSSKeyPairOptions<'der', 'der'> - ): Promise<{ - publicKey: Buffer; - privateKey: Buffer; - }>; - function __promisify__(type: 'rsa-pss', options: RSAPSSKeyPairKeyObjectOptions): Promise; - function __promisify__( - type: 'dsa', - options: DSAKeyPairOptions<'pem', 'pem'> - ): Promise<{ - publicKey: string; - privateKey: string; - }>; - function __promisify__( - type: 'dsa', - options: DSAKeyPairOptions<'pem', 'der'> - ): Promise<{ - publicKey: string; - privateKey: Buffer; - }>; - function __promisify__( - type: 'dsa', - options: DSAKeyPairOptions<'der', 'pem'> - ): Promise<{ - publicKey: Buffer; - privateKey: string; - }>; - function __promisify__( - type: 'dsa', - options: DSAKeyPairOptions<'der', 'der'> - ): Promise<{ - publicKey: Buffer; - privateKey: Buffer; - }>; - function __promisify__(type: 'dsa', options: DSAKeyPairKeyObjectOptions): Promise; - function __promisify__( - type: 'ec', - options: ECKeyPairOptions<'pem', 'pem'> - ): Promise<{ - publicKey: string; - privateKey: string; - }>; - function __promisify__( - type: 'ec', - options: ECKeyPairOptions<'pem', 'der'> - ): Promise<{ - publicKey: string; - privateKey: Buffer; - }>; - function __promisify__( - type: 'ec', - options: ECKeyPairOptions<'der', 'pem'> - ): Promise<{ - publicKey: Buffer; - privateKey: string; - }>; - function __promisify__( - type: 'ec', - options: ECKeyPairOptions<'der', 'der'> - ): Promise<{ - publicKey: Buffer; - privateKey: Buffer; - }>; - function __promisify__(type: 'ec', options: ECKeyPairKeyObjectOptions): Promise; - function __promisify__( - type: 'ed25519', - options: ED25519KeyPairOptions<'pem', 'pem'> - ): Promise<{ - publicKey: string; - privateKey: string; - }>; - function __promisify__( - type: 'ed25519', - options: ED25519KeyPairOptions<'pem', 'der'> - ): Promise<{ - publicKey: string; - privateKey: Buffer; - }>; - function __promisify__( - type: 'ed25519', - options: ED25519KeyPairOptions<'der', 'pem'> - ): Promise<{ - publicKey: Buffer; - privateKey: string; - }>; - function __promisify__( - type: 'ed25519', - options: ED25519KeyPairOptions<'der', 'der'> - ): Promise<{ - publicKey: Buffer; - privateKey: Buffer; - }>; - function __promisify__(type: 'ed25519', options?: ED25519KeyPairKeyObjectOptions): Promise; - function __promisify__( - type: 'ed448', - options: ED448KeyPairOptions<'pem', 'pem'> - ): Promise<{ - publicKey: string; - privateKey: string; - }>; - function __promisify__( - type: 'ed448', - options: ED448KeyPairOptions<'pem', 'der'> - ): Promise<{ - publicKey: string; - privateKey: Buffer; - }>; - function __promisify__( - type: 'ed448', - options: ED448KeyPairOptions<'der', 'pem'> - ): Promise<{ - publicKey: Buffer; - privateKey: string; - }>; - function __promisify__( - type: 'ed448', - options: ED448KeyPairOptions<'der', 'der'> - ): Promise<{ - publicKey: Buffer; - privateKey: Buffer; - }>; - function __promisify__(type: 'ed448', options?: ED448KeyPairKeyObjectOptions): Promise; - function __promisify__( - type: 'x25519', - options: X25519KeyPairOptions<'pem', 'pem'> - ): Promise<{ - publicKey: string; - privateKey: string; - }>; - function __promisify__( - type: 'x25519', - options: X25519KeyPairOptions<'pem', 'der'> - ): Promise<{ - publicKey: string; - privateKey: Buffer; - }>; - function __promisify__( - type: 'x25519', - options: X25519KeyPairOptions<'der', 'pem'> - ): Promise<{ - publicKey: Buffer; - privateKey: string; - }>; - function __promisify__( - type: 'x25519', - options: X25519KeyPairOptions<'der', 'der'> - ): Promise<{ - publicKey: Buffer; - privateKey: Buffer; - }>; - function __promisify__(type: 'x25519', options?: X25519KeyPairKeyObjectOptions): Promise; - function __promisify__( - type: 'x448', - options: X448KeyPairOptions<'pem', 'pem'> - ): Promise<{ - publicKey: string; - privateKey: string; - }>; - function __promisify__( - type: 'x448', - options: X448KeyPairOptions<'pem', 'der'> - ): Promise<{ - publicKey: string; - privateKey: Buffer; - }>; - function __promisify__( - type: 'x448', - options: X448KeyPairOptions<'der', 'pem'> - ): Promise<{ - publicKey: Buffer; - privateKey: string; - }>; - function __promisify__( - type: 'x448', - options: X448KeyPairOptions<'der', 'der'> - ): Promise<{ - publicKey: Buffer; - privateKey: Buffer; - }>; - function __promisify__(type: 'x448', options?: X448KeyPairKeyObjectOptions): Promise; - } - /** - * Calculates and returns the signature for `data` using the given private key and - * algorithm. If `algorithm` is `null` or `undefined`, then the algorithm is - * dependent upon the key type (especially Ed25519 and Ed448). - * - * If `key` is not a `KeyObject`, this function behaves as if `key` had been - * passed to {@link createPrivateKey}. If it is an object, the following - * additional properties can be passed: - * - * If the `callback` function is provided this function uses libuv's threadpool. - * @since v12.0.0 - */ - function sign(algorithm: string | null | undefined, data: NodeJS.ArrayBufferView, key: KeyLike | SignKeyObjectInput | SignPrivateKeyInput): Buffer; - function sign( - algorithm: string | null | undefined, - data: NodeJS.ArrayBufferView, - key: KeyLike | SignKeyObjectInput | SignPrivateKeyInput, - callback: (error: Error | null, data: Buffer) => void - ): void; - /** - * Verifies the given signature for `data` using the given key and algorithm. If`algorithm` is `null` or `undefined`, then the algorithm is dependent upon the - * key type (especially Ed25519 and Ed448). - * - * If `key` is not a `KeyObject`, this function behaves as if `key` had been - * passed to {@link createPublicKey}. If it is an object, the following - * additional properties can be passed: - * - * The `signature` argument is the previously calculated signature for the `data`. - * - * Because public keys can be derived from private keys, a private key or a public - * key may be passed for `key`. - * - * If the `callback` function is provided this function uses libuv's threadpool. - * @since v12.0.0 - */ - function verify(algorithm: string | null | undefined, data: NodeJS.ArrayBufferView, key: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput, signature: NodeJS.ArrayBufferView): boolean; - function verify( - algorithm: string | null | undefined, - data: NodeJS.ArrayBufferView, - key: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput, - signature: NodeJS.ArrayBufferView, - callback: (error: Error | null, result: boolean) => void - ): void; - /** - * Computes the Diffie-Hellman secret based on a `privateKey` and a `publicKey`. - * Both keys must have the same `asymmetricKeyType`, which must be one of `'dh'`(for Diffie-Hellman), `'ec'` (for ECDH), `'x448'`, or `'x25519'` (for ECDH-ES). - * @since v13.9.0, v12.17.0 - */ - function diffieHellman(options: { privateKey: KeyObject; publicKey: KeyObject }): Buffer; - type CipherMode = 'cbc' | 'ccm' | 'cfb' | 'ctr' | 'ecb' | 'gcm' | 'ocb' | 'ofb' | 'stream' | 'wrap' | 'xts'; - interface CipherInfoOptions { - /** - * A test key length. - */ - keyLength?: number | undefined; - /** - * A test IV length. - */ - ivLength?: number | undefined; - } - interface CipherInfo { - /** - * The name of the cipher. - */ - name: string; - /** - * The nid of the cipher. - */ - nid: number; - /** - * The block size of the cipher in bytes. - * This property is omitted when mode is 'stream'. - */ - blockSize?: number | undefined; - /** - * The expected or default initialization vector length in bytes. - * This property is omitted if the cipher does not use an initialization vector. - */ - ivLength?: number | undefined; - /** - * The expected or default key length in bytes. - */ - keyLength: number; - /** - * The cipher mode. - */ - mode: CipherMode; - } - /** - * Returns information about a given cipher. - * - * Some ciphers accept variable length keys and initialization vectors. By default, - * the `crypto.getCipherInfo()` method will return the default values for these - * ciphers. To test if a given key length or iv length is acceptable for given - * cipher, use the `keyLength` and `ivLength` options. If the given values are - * unacceptable, `undefined` will be returned. - * @since v15.0.0 - * @param nameOrNid The name or nid of the cipher to query. - */ - function getCipherInfo(nameOrNid: string | number, options?: CipherInfoOptions): CipherInfo | undefined; - /** - * HKDF is a simple key derivation function defined in RFC 5869\. The given `ikm`,`salt` and `info` are used with the `digest` to derive a key of `keylen` bytes. - * - * The supplied `callback` function is called with two arguments: `err` and`derivedKey`. If an errors occurs while deriving the key, `err` will be set; - * otherwise `err` will be `null`. The successfully generated `derivedKey` will - * be passed to the callback as an [ArrayBuffer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer). An error will be thrown if any - * of the input arguments specify invalid values or types. - * - * ```js - * import { Buffer } from 'buffer'; - * const { - * hkdf - * } = await import('crypto'); - * - * hkdf('sha512', 'key', 'salt', 'info', 64, (err, derivedKey) => { - * if (err) throw err; - * console.log(Buffer.from(derivedKey).toString('hex')); // '24156e2...5391653' - * }); - * ``` - * @since v15.0.0 - * @param digest The digest algorithm to use. - * @param ikm The input keying material. It must be at least one byte in length. - * @param salt The salt value. Must be provided but can be zero-length. - * @param info Additional info value. Must be provided but can be zero-length, and cannot be more than 1024 bytes. - * @param keylen The length of the key to generate. Must be greater than 0. The maximum allowable value is `255` times the number of bytes produced by the selected digest function (e.g. `sha512` - * generates 64-byte hashes, making the maximum HKDF output 16320 bytes). - */ - function hkdf(digest: string, irm: BinaryLike | KeyObject, salt: BinaryLike, info: BinaryLike, keylen: number, callback: (err: Error | null, derivedKey: ArrayBuffer) => void): void; - /** - * Provides a synchronous HKDF key derivation function as defined in RFC 5869\. The - * given `ikm`, `salt` and `info` are used with the `digest` to derive a key of`keylen` bytes. - * - * The successfully generated `derivedKey` will be returned as an [ArrayBuffer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer). - * - * An error will be thrown if any of the input arguments specify invalid values or - * types, or if the derived key cannot be generated. - * - * ```js - * import { Buffer } from 'buffer'; - * const { - * hkdfSync - * } = await import('crypto'); - * - * const derivedKey = hkdfSync('sha512', 'key', 'salt', 'info', 64); - * console.log(Buffer.from(derivedKey).toString('hex')); // '24156e2...5391653' - * ``` - * @since v15.0.0 - * @param digest The digest algorithm to use. - * @param ikm The input keying material. It must be at least one byte in length. - * @param salt The salt value. Must be provided but can be zero-length. - * @param info Additional info value. Must be provided but can be zero-length, and cannot be more than 1024 bytes. - * @param keylen The length of the key to generate. Must be greater than 0. The maximum allowable value is `255` times the number of bytes produced by the selected digest function (e.g. `sha512` - * generates 64-byte hashes, making the maximum HKDF output 16320 bytes). - */ - function hkdfSync(digest: string, ikm: BinaryLike | KeyObject, salt: BinaryLike, info: BinaryLike, keylen: number): ArrayBuffer; - interface SecureHeapUsage { - /** - * The total allocated secure heap size as specified using the `--secure-heap=n` command-line flag. - */ - total: number; - /** - * The minimum allocation from the secure heap as specified using the `--secure-heap-min` command-line flag. - */ - min: number; - /** - * The total number of bytes currently allocated from the secure heap. - */ - used: number; - /** - * The calculated ratio of `used` to `total` allocated bytes. - */ - utilization: number; - } - /** - * @since v15.6.0 - */ - function secureHeapUsed(): SecureHeapUsage; - interface RandomUUIDOptions { - /** - * By default, to improve performance, - * Node.js will pre-emptively generate and persistently cache enough - * random data to generate up to 128 random UUIDs. To generate a UUID - * without using the cache, set `disableEntropyCache` to `true`. - * - * @default `false` - */ - disableEntropyCache?: boolean | undefined; - } - /** - * Generates a random [RFC 4122](https://www.rfc-editor.org/rfc/rfc4122.txt) version 4 UUID. The UUID is generated using a - * cryptographic pseudorandom number generator. - * @since v15.6.0, v14.17.0 - */ - function randomUUID(options?: RandomUUIDOptions): string; - interface X509CheckOptions { - /** - * @default 'always' - */ - subject: 'always' | 'never'; - /** - * @default true - */ - wildcards: boolean; - /** - * @default true - */ - partialWildcards: boolean; - /** - * @default false - */ - multiLabelWildcards: boolean; - /** - * @default false - */ - singleLabelSubdomains: boolean; - } - /** - * Encapsulates an X509 certificate and provides read-only access to - * its information. - * - * ```js - * const { X509Certificate } = await import('crypto'); - * - * const x509 = new X509Certificate('{... pem encoded cert ...}'); - * - * console.log(x509.subject); - * ``` - * @since v15.6.0 - */ - class X509Certificate { - /** - * Will be \`true\` if this is a Certificate Authority (CA) certificate. - * @since v15.6.0 - */ - readonly ca: boolean; - /** - * The SHA-1 fingerprint of this certificate. - * - * Because SHA-1 is cryptographically broken and because the security of SHA-1 is - * significantly worse than that of algorithms that are commonly used to sign - * certificates, consider using `x509.fingerprint256` instead. - * @since v15.6.0 - */ - readonly fingerprint: string; - /** - * The SHA-256 fingerprint of this certificate. - * @since v15.6.0 - */ - readonly fingerprint256: string; - /** - * The SHA-512 fingerprint of this certificate. - * @since v16.14.0 - */ - readonly fingerprint512: string; - /** - * The complete subject of this certificate. - * @since v15.6.0 - */ - readonly subject: string; - /** - * The subject alternative name specified for this certificate or `undefined` - * if not available. - * @since v15.6.0 - */ - readonly subjectAltName: string | undefined; - /** - * The information access content of this certificate or `undefined` if not - * available. - * @since v15.6.0 - */ - readonly infoAccess: string | undefined; - /** - * An array detailing the key usages for this certificate. - * @since v15.6.0 - */ - readonly keyUsage: string[]; - /** - * The issuer identification included in this certificate. - * @since v15.6.0 - */ - readonly issuer: string; - /** - * The issuer certificate or `undefined` if the issuer certificate is not - * available. - * @since v15.9.0 - */ - readonly issuerCertificate?: X509Certificate | undefined; - /** - * The public key `KeyObject` for this certificate. - * @since v15.6.0 - */ - readonly publicKey: KeyObject; - /** - * A `Buffer` containing the DER encoding of this certificate. - * @since v15.6.0 - */ - readonly raw: Buffer; - /** - * The serial number of this certificate. - * - * Serial numbers are assigned by certificate authorities and do not uniquely - * identify certificates. Consider using `x509.fingerprint256` as a unique - * identifier instead. - * @since v15.6.0 - */ - readonly serialNumber: string; - /** - * The date/time from which this certificate is considered valid. - * @since v15.6.0 - */ - readonly validFrom: string; - /** - * The date/time until which this certificate is considered valid. - * @since v15.6.0 - */ - readonly validTo: string; - constructor(buffer: BinaryLike); - /** - * Checks whether the certificate matches the given email address. - * - * If the `'subject'` option is undefined or set to `'default'`, the certificate - * subject is only considered if the subject alternative name extension either does - * not exist or does not contain any email addresses. - * - * If the `'subject'` option is set to `'always'` and if the subject alternative - * name extension either does not exist or does not contain a matching email - * address, the certificate subject is considered. - * - * If the `'subject'` option is set to `'never'`, the certificate subject is never - * considered, even if the certificate contains no subject alternative names. - * @since v15.6.0 - * @return Returns `email` if the certificate matches, `undefined` if it does not. - */ - checkEmail(email: string, options?: Pick): string | undefined; - /** - * Checks whether the certificate matches the given host name. - * - * If the certificate matches the given host name, the matching subject name is - * returned. The returned name might be an exact match (e.g., `foo.example.com`) - * or it might contain wildcards (e.g., `*.example.com`). Because host name - * comparisons are case-insensitive, the returned subject name might also differ - * from the given `name` in capitalization. - * - * If the `'subject'` option is undefined or set to `'default'`, the certificate - * subject is only considered if the subject alternative name extension either does - * not exist or does not contain any DNS names. This behavior is consistent with [RFC 2818](https://www.rfc-editor.org/rfc/rfc2818.txt) ("HTTP Over TLS"). - * - * If the `'subject'` option is set to `'always'` and if the subject alternative - * name extension either does not exist or does not contain a matching DNS name, - * the certificate subject is considered. - * - * If the `'subject'` option is set to `'never'`, the certificate subject is never - * considered, even if the certificate contains no subject alternative names. - * @since v15.6.0 - * @return Returns a subject name that matches `name`, or `undefined` if no subject name matches `name`. - */ - checkHost(name: string, options?: X509CheckOptions): string | undefined; - /** - * Checks whether the certificate matches the given IP address (IPv4 or IPv6). - * - * Only [RFC 5280](https://www.rfc-editor.org/rfc/rfc5280.txt) `iPAddress` subject alternative names are considered, and they - * must match the given `ip` address exactly. Other subject alternative names as - * well as the subject field of the certificate are ignored. - * @since v15.6.0 - * @return Returns `ip` if the certificate matches, `undefined` if it does not. - */ - checkIP(ip: string): string | undefined; - /** - * Checks whether this certificate was issued by the given `otherCert`. - * @since v15.6.0 - */ - checkIssued(otherCert: X509Certificate): boolean; - /** - * Checks whether the public key for this certificate is consistent with - * the given private key. - * @since v15.6.0 - * @param privateKey A private key. - */ - checkPrivateKey(privateKey: KeyObject): boolean; - /** - * There is no standard JSON encoding for X509 certificates. The`toJSON()` method returns a string containing the PEM encoded - * certificate. - * @since v15.6.0 - */ - toJSON(): string; - /** - * Returns information about this certificate using the legacy `certificate object` encoding. - * @since v15.6.0 - */ - toLegacyObject(): PeerCertificate; - /** - * Returns the PEM-encoded certificate. - * @since v15.6.0 - */ - toString(): string; - /** - * Verifies that this certificate was signed by the given public key. - * Does not perform any other validation checks on the certificate. - * @since v15.6.0 - * @param publicKey A public key. - */ - verify(publicKey: KeyObject): boolean; - } - type LargeNumberLike = NodeJS.ArrayBufferView | SharedArrayBuffer | ArrayBuffer | bigint; - interface GeneratePrimeOptions { - add?: LargeNumberLike | undefined; - rem?: LargeNumberLike | undefined; - /** - * @default false - */ - safe?: boolean | undefined; - bigint?: boolean | undefined; - } - interface GeneratePrimeOptionsBigInt extends GeneratePrimeOptions { - bigint: true; - } - interface GeneratePrimeOptionsArrayBuffer extends GeneratePrimeOptions { - bigint?: false | undefined; - } - /** - * Generates a pseudorandom prime of `size` bits. - * - * If `options.safe` is `true`, the prime will be a safe prime -- that is,`(prime - 1) / 2` will also be a prime. - * - * The `options.add` and `options.rem` parameters can be used to enforce additional - * requirements, e.g., for Diffie-Hellman: - * - * * If `options.add` and `options.rem` are both set, the prime will satisfy the - * condition that `prime % add = rem`. - * * If only `options.add` is set and `options.safe` is not `true`, the prime will - * satisfy the condition that `prime % add = 1`. - * * If only `options.add` is set and `options.safe` is set to `true`, the prime - * will instead satisfy the condition that `prime % add = 3`. This is necessary - * because `prime % add = 1` for `options.add > 2` would contradict the condition - * enforced by `options.safe`. - * * `options.rem` is ignored if `options.add` is not given. - * - * Both `options.add` and `options.rem` must be encoded as big-endian sequences - * if given as an `ArrayBuffer`, `SharedArrayBuffer`, `TypedArray`, `Buffer`, or`DataView`. - * - * By default, the prime is encoded as a big-endian sequence of octets - * in an [ArrayBuffer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer). If the `bigint` option is `true`, then a - * [bigint](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt) is provided. - * @since v15.8.0 - * @param size The size (in bits) of the prime to generate. - */ - function generatePrime(size: number, callback: (err: Error | null, prime: ArrayBuffer) => void): void; - function generatePrime(size: number, options: GeneratePrimeOptionsBigInt, callback: (err: Error | null, prime: bigint) => void): void; - function generatePrime(size: number, options: GeneratePrimeOptionsArrayBuffer, callback: (err: Error | null, prime: ArrayBuffer) => void): void; - function generatePrime(size: number, options: GeneratePrimeOptions, callback: (err: Error | null, prime: ArrayBuffer | bigint) => void): void; - /** - * Generates a pseudorandom prime of `size` bits. - * - * If `options.safe` is `true`, the prime will be a safe prime -- that is,`(prime - 1) / 2` will also be a prime. - * - * The `options.add` and `options.rem` parameters can be used to enforce additional - * requirements, e.g., for Diffie-Hellman: - * - * * If `options.add` and `options.rem` are both set, the prime will satisfy the - * condition that `prime % add = rem`. - * * If only `options.add` is set and `options.safe` is not `true`, the prime will - * satisfy the condition that `prime % add = 1`. - * * If only `options.add` is set and `options.safe` is set to `true`, the prime - * will instead satisfy the condition that `prime % add = 3`. This is necessary - * because `prime % add = 1` for `options.add > 2` would contradict the condition - * enforced by `options.safe`. - * * `options.rem` is ignored if `options.add` is not given. - * - * Both `options.add` and `options.rem` must be encoded as big-endian sequences - * if given as an `ArrayBuffer`, `SharedArrayBuffer`, `TypedArray`, `Buffer`, or`DataView`. - * - * By default, the prime is encoded as a big-endian sequence of octets - * in an [ArrayBuffer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer). If the `bigint` option is `true`, then a - * [bigint](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt) is provided. - * @since v15.8.0 - * @param size The size (in bits) of the prime to generate. - */ - function generatePrimeSync(size: number): ArrayBuffer; - function generatePrimeSync(size: number, options: GeneratePrimeOptionsBigInt): bigint; - function generatePrimeSync(size: number, options: GeneratePrimeOptionsArrayBuffer): ArrayBuffer; - function generatePrimeSync(size: number, options: GeneratePrimeOptions): ArrayBuffer | bigint; - interface CheckPrimeOptions { - /** - * The number of Miller-Rabin probabilistic primality iterations to perform. - * When the value is 0 (zero), a number of checks is used that yields a false positive rate of at most `2**-64` for random input. - * Care must be used when selecting a number of checks. - * Refer to the OpenSSL documentation for the BN_is_prime_ex function nchecks options for more details. - * - * @default 0 - */ - checks?: number | undefined; - } - /** - * Checks the primality of the `candidate`. - * @since v15.8.0 - * @param candidate A possible prime encoded as a sequence of big endian octets of arbitrary length. - */ - function checkPrime(value: LargeNumberLike, callback: (err: Error | null, result: boolean) => void): void; - function checkPrime(value: LargeNumberLike, options: CheckPrimeOptions, callback: (err: Error | null, result: boolean) => void): void; - /** - * Checks the primality of the `candidate`. - * @since v15.8.0 - * @param candidate A possible prime encoded as a sequence of big endian octets of arbitrary length. - * @return `true` if the candidate is a prime with an error probability less than `0.25 ** options.checks`. - */ - function checkPrimeSync(candidate: LargeNumberLike, options?: CheckPrimeOptions): boolean; - /** - * Load and set the `engine` for some or all OpenSSL functions (selected by flags). - * - * `engine` could be either an id or a path to the engine's shared library. - * - * The optional `flags` argument uses `ENGINE_METHOD_ALL` by default. - * The `flags` is a bit field taking one of or a mix of the following flags (defined in `crypto.constants`): - * - * - `crypto.constants.ENGINE_METHOD_RSA` - * - `crypto.constants.ENGINE_METHOD_DSA` - * - `crypto.constants.ENGINE_METHOD_DH` - * - `crypto.constants.ENGINE_METHOD_RAND` - * - `crypto.constants.ENGINE_METHOD_EC` - * - `crypto.constants.ENGINE_METHOD_CIPHERS` - * - `crypto.constants.ENGINE_METHOD_DIGESTS` - * - `crypto.constants.ENGINE_METHOD_PKEY_METHS` - * - `crypto.constants.ENGINE_METHOD_PKEY_ASN1_METHS` - * - `crypto.constants.ENGINE_METHOD_ALL` - * - `crypto.constants.ENGINE_METHOD_NONE` - * - * The flags below are deprecated in OpenSSL-1.1.0. - * - * - `crypto.constants.ENGINE_METHOD_ECDH` - * - `crypto.constants.ENGINE_METHOD_ECDSA` - * - `crypto.constants.ENGINE_METHOD_STORE` - * @since v0.11.11 - * @param [flags=crypto.constants.ENGINE_METHOD_ALL] - */ - function setEngine(engine: string, flags?: number): void; - /** - * A convenient alias for `crypto.webcrypto.getRandomValues()`. - * This implementation is not compliant with the Web Crypto spec, - * to write web-compatible code use `crypto.webcrypto.getRandomValues()` instead. - * @since v17.4.0 - * @returns Returns `typedArray`. - */ - function getRandomValues(typedArray: T): T; - /** - * A convenient alias for `crypto.webcrypto.subtle`. - * @since v17.4.0 - */ - const subtle: webcrypto.SubtleCrypto; - /** - * An implementation of the Web Crypto API standard. - * - * See the {@link https://nodejs.org/docs/latest/api/webcrypto.html Web Crypto API documentation} for details. - * @since v15.0.0 - */ - const webcrypto: webcrypto.Crypto; - namespace webcrypto { - type BufferSource = ArrayBufferView | ArrayBuffer; - type KeyFormat = 'jwk' | 'pkcs8' | 'raw' | 'spki'; - type KeyType = 'private' | 'public' | 'secret'; - type KeyUsage = 'decrypt' | 'deriveBits' | 'deriveKey' | 'encrypt' | 'sign' | 'unwrapKey' | 'verify' | 'wrapKey'; - type AlgorithmIdentifier = Algorithm | string; - type HashAlgorithmIdentifier = AlgorithmIdentifier; - type NamedCurve = string; - type BigInteger = Uint8Array; - interface AesCbcParams extends Algorithm { - iv: BufferSource; - } - interface AesCtrParams extends Algorithm { - counter: BufferSource; - length: number; - } - interface AesDerivedKeyParams extends Algorithm { - length: number; - } - interface AesGcmParams extends Algorithm { - additionalData?: BufferSource; - iv: BufferSource; - tagLength?: number; - } - interface AesKeyAlgorithm extends KeyAlgorithm { - length: number; - } - interface AesKeyGenParams extends Algorithm { - length: number; - } - interface Algorithm { - name: string; - } - interface EcKeyAlgorithm extends KeyAlgorithm { - namedCurve: NamedCurve; - } - interface EcKeyGenParams extends Algorithm { - namedCurve: NamedCurve; - } - interface EcKeyImportParams extends Algorithm { - namedCurve: NamedCurve; - } - interface EcdhKeyDeriveParams extends Algorithm { - public: CryptoKey; - } - interface EcdsaParams extends Algorithm { - hash: HashAlgorithmIdentifier; - } - interface Ed448Params extends Algorithm { - context?: BufferSource; - } - interface HkdfParams extends Algorithm { - hash: HashAlgorithmIdentifier; - info: BufferSource; - salt: BufferSource; - } - interface HmacImportParams extends Algorithm { - hash: HashAlgorithmIdentifier; - length?: number; - } - interface HmacKeyAlgorithm extends KeyAlgorithm { - hash: KeyAlgorithm; - length: number; - } - interface HmacKeyGenParams extends Algorithm { - hash: HashAlgorithmIdentifier; - length?: number; - } - interface JsonWebKey { - alg?: string; - crv?: string; - d?: string; - dp?: string; - dq?: string; - e?: string; - ext?: boolean; - k?: string; - key_ops?: string[]; - kty?: string; - n?: string; - oth?: RsaOtherPrimesInfo[]; - p?: string; - q?: string; - qi?: string; - use?: string; - x?: string; - y?: string; - } - interface KeyAlgorithm { - name: string; - } - interface Pbkdf2Params extends Algorithm { - hash: HashAlgorithmIdentifier; - iterations: number; - salt: BufferSource; - } - interface RsaHashedImportParams extends Algorithm { - hash: HashAlgorithmIdentifier; - } - interface RsaHashedKeyAlgorithm extends RsaKeyAlgorithm { - hash: KeyAlgorithm; - } - interface RsaHashedKeyGenParams extends RsaKeyGenParams { - hash: HashAlgorithmIdentifier; - } - interface RsaKeyAlgorithm extends KeyAlgorithm { - modulusLength: number; - publicExponent: BigInteger; - } - interface RsaKeyGenParams extends Algorithm { - modulusLength: number; - publicExponent: BigInteger; - } - interface RsaOaepParams extends Algorithm { - label?: BufferSource; - } - interface RsaOtherPrimesInfo { - d?: string; - r?: string; - t?: string; - } - interface RsaPssParams extends Algorithm { - saltLength: number; - } - /** - * Calling `require('node:crypto').webcrypto` returns an instance of the `Crypto` class. - * `Crypto` is a singleton that provides access to the remainder of the crypto API. - * @since v15.0.0 - */ - interface Crypto { - /** - * Provides access to the `SubtleCrypto` API. - * @since v15.0.0 - */ - readonly subtle: SubtleCrypto; - /** - * Generates cryptographically strong random values. - * The given `typedArray` is filled with random values, and a reference to `typedArray` is returned. - * - * The given `typedArray` must be an integer-based instance of {@link NodeJS.TypedArray}, i.e. `Float32Array` and `Float64Array` are not accepted. - * - * An error will be thrown if the given `typedArray` is larger than 65,536 bytes. - * @since v15.0.0 - */ - getRandomValues>(typedArray: T): T; - /** - * Generates a random {@link https://www.rfc-editor.org/rfc/rfc4122.txt RFC 4122} version 4 UUID. - * The UUID is generated using a cryptographic pseudorandom number generator. - * @since v16.7.0 - */ - randomUUID(): string; - CryptoKey: CryptoKeyConstructor; - } - // This constructor throws ILLEGAL_CONSTRUCTOR so it should not be newable. - interface CryptoKeyConstructor { - /** Illegal constructor */ - (_: { readonly _: unique symbol }): never; // Allows instanceof to work but not be callable by the user. - readonly length: 0; - readonly name: 'CryptoKey'; - readonly prototype: CryptoKey; - } - /** - * @since v15.0.0 - */ - interface CryptoKey { - /** - * An object detailing the algorithm for which the key can be used along with additional algorithm-specific parameters. - * @since v15.0.0 - */ - readonly algorithm: KeyAlgorithm; - /** - * When `true`, the {@link CryptoKey} can be extracted using either `subtleCrypto.exportKey()` or `subtleCrypto.wrapKey()`. - * @since v15.0.0 - */ - readonly extractable: boolean; - /** - * A string identifying whether the key is a symmetric (`'secret'`) or asymmetric (`'private'` or `'public'`) key. - * @since v15.0.0 - */ - readonly type: KeyType; - /** - * An array of strings identifying the operations for which the key may be used. - * - * The possible usages are: - * - `'encrypt'` - The key may be used to encrypt data. - * - `'decrypt'` - The key may be used to decrypt data. - * - `'sign'` - The key may be used to generate digital signatures. - * - `'verify'` - The key may be used to verify digital signatures. - * - `'deriveKey'` - The key may be used to derive a new key. - * - `'deriveBits'` - The key may be used to derive bits. - * - `'wrapKey'` - The key may be used to wrap another key. - * - `'unwrapKey'` - The key may be used to unwrap another key. - * - * Valid key usages depend on the key algorithm (identified by `cryptokey.algorithm.name`). - * @since v15.0.0 - */ - readonly usages: KeyUsage[]; - } - /** - * The `CryptoKeyPair` is a simple dictionary object with `publicKey` and `privateKey` properties, representing an asymmetric key pair. - * @since v15.0.0 - */ - interface CryptoKeyPair { - /** - * A {@link CryptoKey} whose type will be `'private'`. - * @since v15.0.0 - */ - privateKey: CryptoKey; - /** - * A {@link CryptoKey} whose type will be `'public'`. - * @since v15.0.0 - */ - publicKey: CryptoKey; - } - /** - * @since v15.0.0 - */ - interface SubtleCrypto { - /** - * Using the method and parameters specified in `algorithm` and the keying material provided by `key`, - * `subtle.decrypt()` attempts to decipher the provided `data`. If successful, - * the returned promise will be resolved with an `` containing the plaintext result. - * - * The algorithms currently supported include: - * - * - `'RSA-OAEP'` - * - `'AES-CTR'` - * - `'AES-CBC'` - * - `'AES-GCM'` - * @since v15.0.0 - */ - decrypt(algorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams, key: CryptoKey, data: BufferSource): Promise; - /** - * Using the method and parameters specified in `algorithm` and the keying material provided by `baseKey`, - * `subtle.deriveBits()` attempts to generate `length` bits. - * The Node.js implementation requires that when `length` is a number it must be multiple of `8`. - * When `length` is `null` the maximum number of bits for a given algorithm is generated. This is allowed - * for the `'ECDH'`, `'X25519'`, and `'X448'` algorithms. - * If successful, the returned promise will be resolved with an `` containing the generated data. - * - * The algorithms currently supported include: - * - * - `'ECDH'` - * - `'X25519'` - * - `'X448'` - * - `'HKDF'` - * - `'PBKDF2'` - * @since v15.0.0 - */ - deriveBits(algorithm: EcdhKeyDeriveParams, baseKey: CryptoKey, length: number | null): Promise; - deriveBits(algorithm: AlgorithmIdentifier | HkdfParams | Pbkdf2Params, baseKey: CryptoKey, length: number): Promise; - /** - * Using the method and parameters specified in `algorithm`, and the keying material provided by `baseKey`, - * `subtle.deriveKey()` attempts to generate a new ` based on the method and parameters in `derivedKeyAlgorithm`. - * - * Calling `subtle.deriveKey()` is equivalent to calling `subtle.deriveBits()` to generate raw keying material, - * then passing the result into the `subtle.importKey()` method using the `deriveKeyAlgorithm`, `extractable`, and `keyUsages` parameters as input. - * - * The algorithms currently supported include: - * - * - `'ECDH'` - * - `'X25519'` - * - `'X448'` - * - `'HKDF'` - * - `'PBKDF2'` - * @param keyUsages See {@link https://nodejs.org/docs/latest/api/webcrypto.html#cryptokeyusages Key usages}. - * @since v15.0.0 - */ - deriveKey( - algorithm: AlgorithmIdentifier | EcdhKeyDeriveParams | HkdfParams | Pbkdf2Params, - baseKey: CryptoKey, - derivedKeyAlgorithm: AlgorithmIdentifier | AesDerivedKeyParams | HmacImportParams | HkdfParams | Pbkdf2Params, - extractable: boolean, - keyUsages: ReadonlyArray - ): Promise; - /** - * Using the method identified by `algorithm`, `subtle.digest()` attempts to generate a digest of `data`. - * If successful, the returned promise is resolved with an `` containing the computed digest. - * - * If `algorithm` is provided as a ``, it must be one of: - * - * - `'SHA-1'` - * - `'SHA-256'` - * - `'SHA-384'` - * - `'SHA-512'` - * - * If `algorithm` is provided as an ``, it must have a `name` property whose value is one of the above. - * @since v15.0.0 - */ - digest(algorithm: AlgorithmIdentifier, data: BufferSource): Promise; - /** - * Using the method and parameters specified by `algorithm` and the keying material provided by `key`, - * `subtle.encrypt()` attempts to encipher `data`. If successful, - * the returned promise is resolved with an `` containing the encrypted result. - * - * The algorithms currently supported include: - * - * - `'RSA-OAEP'` - * - `'AES-CTR'` - * - `'AES-CBC'` - * - `'AES-GCM'` - * @since v15.0.0 - */ - encrypt(algorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams, key: CryptoKey, data: BufferSource): Promise; - /** - * Exports the given key into the specified format, if supported. - * - * If the `` is not extractable, the returned promise will reject. - * - * When `format` is either `'pkcs8'` or `'spki'` and the export is successful, - * the returned promise will be resolved with an `` containing the exported key data. - * - * When `format` is `'jwk'` and the export is successful, the returned promise will be resolved with a - * JavaScript object conforming to the {@link https://tools.ietf.org/html/rfc7517 JSON Web Key} specification. - * @param format Must be one of `'raw'`, `'pkcs8'`, `'spki'`, or `'jwk'`. - * @returns `` containing ``. - * @since v15.0.0 - */ - exportKey(format: 'jwk', key: CryptoKey): Promise; - exportKey(format: Exclude, key: CryptoKey): Promise; - /** - * Using the method and parameters provided in `algorithm`, - * `subtle.generateKey()` attempts to generate new keying material. - * Depending the method used, the method may generate either a single `` or a ``. - * - * The `` (public and private key) generating algorithms supported include: - * - * - `'RSASSA-PKCS1-v1_5'` - * - `'RSA-PSS'` - * - `'RSA-OAEP'` - * - `'ECDSA'` - * - `'Ed25519'` - * - `'Ed448'` - * - `'ECDH'` - * - `'X25519'` - * - `'X448'` - * The `` (secret key) generating algorithms supported include: - * - * - `'HMAC'` - * - `'AES-CTR'` - * - `'AES-CBC'` - * - `'AES-GCM'` - * - `'AES-KW'` - * @param keyUsages See {@link https://nodejs.org/docs/latest/api/webcrypto.html#cryptokeyusages Key usages}. - * @since v15.0.0 - */ - generateKey(algorithm: RsaHashedKeyGenParams | EcKeyGenParams, extractable: boolean, keyUsages: ReadonlyArray): Promise; - generateKey(algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params, extractable: boolean, keyUsages: ReadonlyArray): Promise; - generateKey(algorithm: AlgorithmIdentifier, extractable: boolean, keyUsages: KeyUsage[]): Promise; - /** - * The `subtle.importKey()` method attempts to interpret the provided `keyData` as the given `format` - * to create a `` instance using the provided `algorithm`, `extractable`, and `keyUsages` arguments. - * If the import is successful, the returned promise will be resolved with the created ``. - * - * If importing a `'PBKDF2'` key, `extractable` must be `false`. - * @param format Must be one of `'raw'`, `'pkcs8'`, `'spki'`, or `'jwk'`. - * @param keyUsages See {@link https://nodejs.org/docs/latest/api/webcrypto.html#cryptokeyusages Key usages}. - * @since v15.0.0 - */ - importKey( - format: 'jwk', - keyData: JsonWebKey, - algorithm: AlgorithmIdentifier | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | AesKeyAlgorithm, - extractable: boolean, - keyUsages: ReadonlyArray - ): Promise; - importKey( - format: Exclude, - keyData: BufferSource, - algorithm: AlgorithmIdentifier | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | AesKeyAlgorithm, - extractable: boolean, - keyUsages: KeyUsage[] - ): Promise; - /** - * Using the method and parameters given by `algorithm` and the keying material provided by `key`, - * `subtle.sign()` attempts to generate a cryptographic signature of `data`. If successful, - * the returned promise is resolved with an `` containing the generated signature. - * - * The algorithms currently supported include: - * - * - `'RSASSA-PKCS1-v1_5'` - * - `'RSA-PSS'` - * - `'ECDSA'` - * - `'Ed25519'` - * - `'Ed448'` - * - `'HMAC'` - * @since v15.0.0 - */ - sign(algorithm: AlgorithmIdentifier | RsaPssParams | EcdsaParams | Ed448Params, key: CryptoKey, data: BufferSource): Promise; - /** - * In cryptography, "wrapping a key" refers to exporting and then encrypting the keying material. - * The `subtle.unwrapKey()` method attempts to decrypt a wrapped key and create a `` instance. - * It is equivalent to calling `subtle.decrypt()` first on the encrypted key data (using the `wrappedKey`, `unwrapAlgo`, and `unwrappingKey` arguments as input) - * then passing the results in to the `subtle.importKey()` method using the `unwrappedKeyAlgo`, `extractable`, and `keyUsages` arguments as inputs. - * If successful, the returned promise is resolved with a `` object. - * - * The wrapping algorithms currently supported include: - * - * - `'RSA-OAEP'` - * - `'AES-CTR'` - * - `'AES-CBC'` - * - `'AES-GCM'` - * - `'AES-KW'` - * - * The unwrapped key algorithms supported include: - * - * - `'RSASSA-PKCS1-v1_5'` - * - `'RSA-PSS'` - * - `'RSA-OAEP'` - * - `'ECDSA'` - * - `'Ed25519'` - * - `'Ed448'` - * - `'ECDH'` - * - `'X25519'` - * - `'X448'` - * - `'HMAC'` - * - `'AES-CTR'` - * - `'AES-CBC'` - * - `'AES-GCM'` - * - `'AES-KW'` - * @param format Must be one of `'raw'`, `'pkcs8'`, `'spki'`, or `'jwk'`. - * @param keyUsages See {@link https://nodejs.org/docs/latest/api/webcrypto.html#cryptokeyusages Key usages}. - * @since v15.0.0 - */ - unwrapKey( - format: KeyFormat, - wrappedKey: BufferSource, - unwrappingKey: CryptoKey, - unwrapAlgorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams, - unwrappedKeyAlgorithm: AlgorithmIdentifier | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | AesKeyAlgorithm, - extractable: boolean, - keyUsages: KeyUsage[] - ): Promise; - /** - * Using the method and parameters given in `algorithm` and the keying material provided by `key`, - * `subtle.verify()` attempts to verify that `signature` is a valid cryptographic signature of `data`. - * The returned promise is resolved with either `true` or `false`. - * - * The algorithms currently supported include: - * - * - `'RSASSA-PKCS1-v1_5'` - * - `'RSA-PSS'` - * - `'ECDSA'` - * - `'Ed25519'` - * - `'Ed448'` - * - `'HMAC'` - * @since v15.0.0 - */ - verify(algorithm: AlgorithmIdentifier | RsaPssParams | EcdsaParams | Ed448Params, key: CryptoKey, signature: BufferSource, data: BufferSource): Promise; - /** - * In cryptography, "wrapping a key" refers to exporting and then encrypting the keying material. - * The `subtle.wrapKey()` method exports the keying material into the format identified by `format`, - * then encrypts it using the method and parameters specified by `wrapAlgo` and the keying material provided by `wrappingKey`. - * It is the equivalent to calling `subtle.exportKey()` using `format` and `key` as the arguments, - * then passing the result to the `subtle.encrypt()` method using `wrappingKey` and `wrapAlgo` as inputs. - * If successful, the returned promise will be resolved with an `` containing the encrypted key data. - * - * The wrapping algorithms currently supported include: - * - * - `'RSA-OAEP'` - * - `'AES-CTR'` - * - `'AES-CBC'` - * - `'AES-GCM'` - * - `'AES-KW'` - * @param format Must be one of `'raw'`, `'pkcs8'`, `'spki'`, or `'jwk'`. - * @since v15.0.0 - */ - wrapKey(format: KeyFormat, key: CryptoKey, wrappingKey: CryptoKey, wrapAlgorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams): Promise; - } - } -} -declare module 'node:crypto' { - export * from 'crypto'; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/dgram.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/dgram.d.ts deleted file mode 100755 index 247328d2..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/dgram.d.ts +++ /dev/null @@ -1,545 +0,0 @@ -/** - * The `dgram` module provides an implementation of UDP datagram sockets. - * - * ```js - * import dgram from 'dgram'; - * - * const server = dgram.createSocket('udp4'); - * - * server.on('error', (err) => { - * console.log(`server error:\n${err.stack}`); - * server.close(); - * }); - * - * server.on('message', (msg, rinfo) => { - * console.log(`server got: ${msg} from ${rinfo.address}:${rinfo.port}`); - * }); - * - * server.on('listening', () => { - * const address = server.address(); - * console.log(`server listening ${address.address}:${address.port}`); - * }); - * - * server.bind(41234); - * // Prints: server listening 0.0.0.0:41234 - * ``` - * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/dgram.js) - */ -declare module 'dgram' { - import { AddressInfo } from 'node:net'; - import * as dns from 'node:dns'; - import { EventEmitter, Abortable } from 'node:events'; - interface RemoteInfo { - address: string; - family: 'IPv4' | 'IPv6'; - port: number; - size: number; - } - interface BindOptions { - port?: number | undefined; - address?: string | undefined; - exclusive?: boolean | undefined; - fd?: number | undefined; - } - type SocketType = 'udp4' | 'udp6'; - interface SocketOptions extends Abortable { - type: SocketType; - reuseAddr?: boolean | undefined; - /** - * @default false - */ - ipv6Only?: boolean | undefined; - recvBufferSize?: number | undefined; - sendBufferSize?: number | undefined; - lookup?: ((hostname: string, options: dns.LookupOneOptions, callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void) => void) | undefined; - } - /** - * Creates a `dgram.Socket` object. Once the socket is created, calling `socket.bind()` will instruct the socket to begin listening for datagram - * messages. When `address` and `port` are not passed to `socket.bind()` the - * method will bind the socket to the "all interfaces" address on a random port - * (it does the right thing for both `udp4` and `udp6` sockets). The bound address - * and port can be retrieved using `socket.address().address` and `socket.address().port`. - * - * If the `signal` option is enabled, calling `.abort()` on the corresponding`AbortController` is similar to calling `.close()` on the socket: - * - * ```js - * const controller = new AbortController(); - * const { signal } = controller; - * const server = dgram.createSocket({ type: 'udp4', signal }); - * server.on('message', (msg, rinfo) => { - * console.log(`server got: ${msg} from ${rinfo.address}:${rinfo.port}`); - * }); - * // Later, when you want to close the server. - * controller.abort(); - * ``` - * @since v0.11.13 - * @param options Available options are: - * @param callback Attached as a listener for `'message'` events. Optional. - */ - function createSocket(type: SocketType, callback?: (msg: Buffer, rinfo: RemoteInfo) => void): Socket; - function createSocket(options: SocketOptions, callback?: (msg: Buffer, rinfo: RemoteInfo) => void): Socket; - /** - * Encapsulates the datagram functionality. - * - * New instances of `dgram.Socket` are created using {@link createSocket}. - * The `new` keyword is not to be used to create `dgram.Socket` instances. - * @since v0.1.99 - */ - class Socket extends EventEmitter { - /** - * Tells the kernel to join a multicast group at the given `multicastAddress` and`multicastInterface` using the `IP_ADD_MEMBERSHIP` socket option. If the`multicastInterface` argument is not - * specified, the operating system will choose - * one interface and will add membership to it. To add membership to every - * available interface, call `addMembership` multiple times, once per interface. - * - * When called on an unbound socket, this method will implicitly bind to a random - * port, listening on all interfaces. - * - * When sharing a UDP socket across multiple `cluster` workers, the`socket.addMembership()` function must be called only once or an`EADDRINUSE` error will occur: - * - * ```js - * import cluster from 'cluster'; - * import dgram from 'dgram'; - * - * if (cluster.isPrimary) { - * cluster.fork(); // Works ok. - * cluster.fork(); // Fails with EADDRINUSE. - * } else { - * const s = dgram.createSocket('udp4'); - * s.bind(1234, () => { - * s.addMembership('224.0.0.114'); - * }); - * } - * ``` - * @since v0.6.9 - */ - addMembership(multicastAddress: string, multicastInterface?: string): void; - /** - * Returns an object containing the address information for a socket. - * For UDP sockets, this object will contain `address`, `family` and `port`properties. - * - * This method throws `EBADF` if called on an unbound socket. - * @since v0.1.99 - */ - address(): AddressInfo; - /** - * For UDP sockets, causes the `dgram.Socket` to listen for datagram - * messages on a named `port` and optional `address`. If `port` is not - * specified or is `0`, the operating system will attempt to bind to a - * random port. If `address` is not specified, the operating system will - * attempt to listen on all addresses. Once binding is complete, a`'listening'` event is emitted and the optional `callback` function is - * called. - * - * Specifying both a `'listening'` event listener and passing a`callback` to the `socket.bind()` method is not harmful but not very - * useful. - * - * A bound datagram socket keeps the Node.js process running to receive - * datagram messages. - * - * If binding fails, an `'error'` event is generated. In rare case (e.g. - * attempting to bind with a closed socket), an `Error` may be thrown. - * - * Example of a UDP server listening on port 41234: - * - * ```js - * import dgram from 'dgram'; - * - * const server = dgram.createSocket('udp4'); - * - * server.on('error', (err) => { - * console.log(`server error:\n${err.stack}`); - * server.close(); - * }); - * - * server.on('message', (msg, rinfo) => { - * console.log(`server got: ${msg} from ${rinfo.address}:${rinfo.port}`); - * }); - * - * server.on('listening', () => { - * const address = server.address(); - * console.log(`server listening ${address.address}:${address.port}`); - * }); - * - * server.bind(41234); - * // Prints: server listening 0.0.0.0:41234 - * ``` - * @since v0.1.99 - * @param callback with no parameters. Called when binding is complete. - */ - bind(port?: number, address?: string, callback?: () => void): this; - bind(port?: number, callback?: () => void): this; - bind(callback?: () => void): this; - bind(options: BindOptions, callback?: () => void): this; - /** - * Close the underlying socket and stop listening for data on it. If a callback is - * provided, it is added as a listener for the `'close'` event. - * @since v0.1.99 - * @param callback Called when the socket has been closed. - */ - close(callback?: () => void): this; - /** - * Associates the `dgram.Socket` to a remote address and port. Every - * message sent by this handle is automatically sent to that destination. Also, - * the socket will only receive messages from that remote peer. - * Trying to call `connect()` on an already connected socket will result - * in an `ERR_SOCKET_DGRAM_IS_CONNECTED` exception. If `address` is not - * provided, `'127.0.0.1'` (for `udp4` sockets) or `'::1'` (for `udp6` sockets) - * will be used by default. Once the connection is complete, a `'connect'` event - * is emitted and the optional `callback` function is called. In case of failure, - * the `callback` is called or, failing this, an `'error'` event is emitted. - * @since v12.0.0 - * @param callback Called when the connection is completed or on error. - */ - connect(port: number, address?: string, callback?: () => void): void; - connect(port: number, callback: () => void): void; - /** - * A synchronous function that disassociates a connected `dgram.Socket` from - * its remote address. Trying to call `disconnect()` on an unbound or already - * disconnected socket will result in an `ERR_SOCKET_DGRAM_NOT_CONNECTED` exception. - * @since v12.0.0 - */ - disconnect(): void; - /** - * Instructs the kernel to leave a multicast group at `multicastAddress` using the`IP_DROP_MEMBERSHIP` socket option. This method is automatically called by the - * kernel when the socket is closed or the process terminates, so most apps will - * never have reason to call this. - * - * If `multicastInterface` is not specified, the operating system will attempt to - * drop membership on all valid interfaces. - * @since v0.6.9 - */ - dropMembership(multicastAddress: string, multicastInterface?: string): void; - /** - * This method throws `ERR_SOCKET_BUFFER_SIZE` if called on an unbound socket. - * @since v8.7.0 - * @return the `SO_RCVBUF` socket receive buffer size in bytes. - */ - getRecvBufferSize(): number; - /** - * This method throws `ERR_SOCKET_BUFFER_SIZE` if called on an unbound socket. - * @since v8.7.0 - * @return the `SO_SNDBUF` socket send buffer size in bytes. - */ - getSendBufferSize(): number; - /** - * By default, binding a socket will cause it to block the Node.js process from - * exiting as long as the socket is open. The `socket.unref()` method can be used - * to exclude the socket from the reference counting that keeps the Node.js - * process active. The `socket.ref()` method adds the socket back to the reference - * counting and restores the default behavior. - * - * Calling `socket.ref()` multiples times will have no additional effect. - * - * The `socket.ref()` method returns a reference to the socket so calls can be - * chained. - * @since v0.9.1 - */ - ref(): this; - /** - * Returns an object containing the `address`, `family`, and `port` of the remote - * endpoint. This method throws an `ERR_SOCKET_DGRAM_NOT_CONNECTED` exception - * if the socket is not connected. - * @since v12.0.0 - */ - remoteAddress(): AddressInfo; - /** - * Broadcasts a datagram on the socket. - * For connectionless sockets, the destination `port` and `address` must be - * specified. Connected sockets, on the other hand, will use their associated - * remote endpoint, so the `port` and `address` arguments must not be set. - * - * The `msg` argument contains the message to be sent. - * Depending on its type, different behavior can apply. If `msg` is a `Buffer`, - * any `TypedArray` or a `DataView`, - * the `offset` and `length` specify the offset within the `Buffer` where the - * message begins and the number of bytes in the message, respectively. - * If `msg` is a `String`, then it is automatically converted to a `Buffer`with `'utf8'` encoding. With messages that - * contain multi-byte characters, `offset` and `length` will be calculated with - * respect to `byte length` and not the character position. - * If `msg` is an array, `offset` and `length` must not be specified. - * - * The `address` argument is a string. If the value of `address` is a host name, - * DNS will be used to resolve the address of the host. If `address` is not - * provided or otherwise nullish, `'127.0.0.1'` (for `udp4` sockets) or `'::1'`(for `udp6` sockets) will be used by default. - * - * If the socket has not been previously bound with a call to `bind`, the socket - * is assigned a random port number and is bound to the "all interfaces" address - * (`'0.0.0.0'` for `udp4` sockets, `'::0'` for `udp6` sockets.) - * - * An optional `callback` function may be specified to as a way of reporting - * DNS errors or for determining when it is safe to reuse the `buf` object. - * DNS lookups delay the time to send for at least one tick of the - * Node.js event loop. - * - * The only way to know for sure that the datagram has been sent is by using a`callback`. If an error occurs and a `callback` is given, the error will be - * passed as the first argument to the `callback`. If a `callback` is not given, - * the error is emitted as an `'error'` event on the `socket` object. - * - * Offset and length are optional but both _must_ be set if either are used. - * They are supported only when the first argument is a `Buffer`, a `TypedArray`, - * or a `DataView`. - * - * This method throws `ERR_SOCKET_BAD_PORT` if called on an unbound socket. - * - * Example of sending a UDP packet to a port on `localhost`; - * - * ```js - * import dgram from 'dgram'; - * import { Buffer } from 'buffer'; - * - * const message = Buffer.from('Some bytes'); - * const client = dgram.createSocket('udp4'); - * client.send(message, 41234, 'localhost', (err) => { - * client.close(); - * }); - * ``` - * - * Example of sending a UDP packet composed of multiple buffers to a port on`127.0.0.1`; - * - * ```js - * import dgram from 'dgram'; - * import { Buffer } from 'buffer'; - * - * const buf1 = Buffer.from('Some '); - * const buf2 = Buffer.from('bytes'); - * const client = dgram.createSocket('udp4'); - * client.send([buf1, buf2], 41234, (err) => { - * client.close(); - * }); - * ``` - * - * Sending multiple buffers might be faster or slower depending on the - * application and operating system. Run benchmarks to - * determine the optimal strategy on a case-by-case basis. Generally speaking, - * however, sending multiple buffers is faster. - * - * Example of sending a UDP packet using a socket connected to a port on`localhost`: - * - * ```js - * import dgram from 'dgram'; - * import { Buffer } from 'buffer'; - * - * const message = Buffer.from('Some bytes'); - * const client = dgram.createSocket('udp4'); - * client.connect(41234, 'localhost', (err) => { - * client.send(message, (err) => { - * client.close(); - * }); - * }); - * ``` - * @since v0.1.99 - * @param msg Message to be sent. - * @param offset Offset in the buffer where the message starts. - * @param length Number of bytes in the message. - * @param port Destination port. - * @param address Destination host name or IP address. - * @param callback Called when the message has been sent. - */ - send(msg: string | Uint8Array | ReadonlyArray, port?: number, address?: string, callback?: (error: Error | null, bytes: number) => void): void; - send(msg: string | Uint8Array | ReadonlyArray, port?: number, callback?: (error: Error | null, bytes: number) => void): void; - send(msg: string | Uint8Array | ReadonlyArray, callback?: (error: Error | null, bytes: number) => void): void; - send(msg: string | Uint8Array, offset: number, length: number, port?: number, address?: string, callback?: (error: Error | null, bytes: number) => void): void; - send(msg: string | Uint8Array, offset: number, length: number, port?: number, callback?: (error: Error | null, bytes: number) => void): void; - send(msg: string | Uint8Array, offset: number, length: number, callback?: (error: Error | null, bytes: number) => void): void; - /** - * Sets or clears the `SO_BROADCAST` socket option. When set to `true`, UDP - * packets may be sent to a local interface's broadcast address. - * - * This method throws `EBADF` if called on an unbound socket. - * @since v0.6.9 - */ - setBroadcast(flag: boolean): void; - /** - * _All references to scope in this section are referring to [IPv6 Zone Indices](https://en.wikipedia.org/wiki/IPv6_address#Scoped_literal_IPv6_addresses), which are defined by [RFC - * 4007](https://tools.ietf.org/html/rfc4007). In string form, an IP_ - * _with a scope index is written as `'IP%scope'` where scope is an interface name_ - * _or interface number._ - * - * Sets the default outgoing multicast interface of the socket to a chosen - * interface or back to system interface selection. The `multicastInterface` must - * be a valid string representation of an IP from the socket's family. - * - * For IPv4 sockets, this should be the IP configured for the desired physical - * interface. All packets sent to multicast on the socket will be sent on the - * interface determined by the most recent successful use of this call. - * - * For IPv6 sockets, `multicastInterface` should include a scope to indicate the - * interface as in the examples that follow. In IPv6, individual `send` calls can - * also use explicit scope in addresses, so only packets sent to a multicast - * address without specifying an explicit scope are affected by the most recent - * successful use of this call. - * - * This method throws `EBADF` if called on an unbound socket. - * - * #### Example: IPv6 outgoing multicast interface - * - * On most systems, where scope format uses the interface name: - * - * ```js - * const socket = dgram.createSocket('udp6'); - * - * socket.bind(1234, () => { - * socket.setMulticastInterface('::%eth1'); - * }); - * ``` - * - * On Windows, where scope format uses an interface number: - * - * ```js - * const socket = dgram.createSocket('udp6'); - * - * socket.bind(1234, () => { - * socket.setMulticastInterface('::%2'); - * }); - * ``` - * - * #### Example: IPv4 outgoing multicast interface - * - * All systems use an IP of the host on the desired physical interface: - * - * ```js - * const socket = dgram.createSocket('udp4'); - * - * socket.bind(1234, () => { - * socket.setMulticastInterface('10.0.0.2'); - * }); - * ``` - * @since v8.6.0 - */ - setMulticastInterface(multicastInterface: string): void; - /** - * Sets or clears the `IP_MULTICAST_LOOP` socket option. When set to `true`, - * multicast packets will also be received on the local interface. - * - * This method throws `EBADF` if called on an unbound socket. - * @since v0.3.8 - */ - setMulticastLoopback(flag: boolean): boolean; - /** - * Sets the `IP_MULTICAST_TTL` socket option. While TTL generally stands for - * "Time to Live", in this context it specifies the number of IP hops that a - * packet is allowed to travel through, specifically for multicast traffic. Each - * router or gateway that forwards a packet decrements the TTL. If the TTL is - * decremented to 0 by a router, it will not be forwarded. - * - * The `ttl` argument may be between 0 and 255\. The default on most systems is `1`. - * - * This method throws `EBADF` if called on an unbound socket. - * @since v0.3.8 - */ - setMulticastTTL(ttl: number): number; - /** - * Sets the `SO_RCVBUF` socket option. Sets the maximum socket receive buffer - * in bytes. - * - * This method throws `ERR_SOCKET_BUFFER_SIZE` if called on an unbound socket. - * @since v8.7.0 - */ - setRecvBufferSize(size: number): void; - /** - * Sets the `SO_SNDBUF` socket option. Sets the maximum socket send buffer - * in bytes. - * - * This method throws `ERR_SOCKET_BUFFER_SIZE` if called on an unbound socket. - * @since v8.7.0 - */ - setSendBufferSize(size: number): void; - /** - * Sets the `IP_TTL` socket option. While TTL generally stands for "Time to Live", - * in this context it specifies the number of IP hops that a packet is allowed to - * travel through. Each router or gateway that forwards a packet decrements the - * TTL. If the TTL is decremented to 0 by a router, it will not be forwarded. - * Changing TTL values is typically done for network probes or when multicasting. - * - * The `ttl` argument may be between 1 and 255\. The default on most systems - * is 64. - * - * This method throws `EBADF` if called on an unbound socket. - * @since v0.1.101 - */ - setTTL(ttl: number): number; - /** - * By default, binding a socket will cause it to block the Node.js process from - * exiting as long as the socket is open. The `socket.unref()` method can be used - * to exclude the socket from the reference counting that keeps the Node.js - * process active, allowing the process to exit even if the socket is still - * listening. - * - * Calling `socket.unref()` multiple times will have no addition effect. - * - * The `socket.unref()` method returns a reference to the socket so calls can be - * chained. - * @since v0.9.1 - */ - unref(): this; - /** - * Tells the kernel to join a source-specific multicast channel at the given`sourceAddress` and `groupAddress`, using the `multicastInterface` with the`IP_ADD_SOURCE_MEMBERSHIP` socket - * option. If the `multicastInterface` argument - * is not specified, the operating system will choose one interface and will add - * membership to it. To add membership to every available interface, call`socket.addSourceSpecificMembership()` multiple times, once per interface. - * - * When called on an unbound socket, this method will implicitly bind to a random - * port, listening on all interfaces. - * @since v13.1.0, v12.16.0 - */ - addSourceSpecificMembership(sourceAddress: string, groupAddress: string, multicastInterface?: string): void; - /** - * Instructs the kernel to leave a source-specific multicast channel at the given`sourceAddress` and `groupAddress` using the `IP_DROP_SOURCE_MEMBERSHIP`socket option. This method is - * automatically called by the kernel when the - * socket is closed or the process terminates, so most apps will never have - * reason to call this. - * - * If `multicastInterface` is not specified, the operating system will attempt to - * drop membership on all valid interfaces. - * @since v13.1.0, v12.16.0 - */ - dropSourceSpecificMembership(sourceAddress: string, groupAddress: string, multicastInterface?: string): void; - /** - * events.EventEmitter - * 1. close - * 2. connect - * 3. error - * 4. listening - * 5. message - */ - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: 'close', listener: () => void): this; - addListener(event: 'connect', listener: () => void): this; - addListener(event: 'error', listener: (err: Error) => void): this; - addListener(event: 'listening', listener: () => void): this; - addListener(event: 'message', listener: (msg: Buffer, rinfo: RemoteInfo) => void): this; - emit(event: string | symbol, ...args: any[]): boolean; - emit(event: 'close'): boolean; - emit(event: 'connect'): boolean; - emit(event: 'error', err: Error): boolean; - emit(event: 'listening'): boolean; - emit(event: 'message', msg: Buffer, rinfo: RemoteInfo): boolean; - on(event: string, listener: (...args: any[]) => void): this; - on(event: 'close', listener: () => void): this; - on(event: 'connect', listener: () => void): this; - on(event: 'error', listener: (err: Error) => void): this; - on(event: 'listening', listener: () => void): this; - on(event: 'message', listener: (msg: Buffer, rinfo: RemoteInfo) => void): this; - once(event: string, listener: (...args: any[]) => void): this; - once(event: 'close', listener: () => void): this; - once(event: 'connect', listener: () => void): this; - once(event: 'error', listener: (err: Error) => void): this; - once(event: 'listening', listener: () => void): this; - once(event: 'message', listener: (msg: Buffer, rinfo: RemoteInfo) => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: 'close', listener: () => void): this; - prependListener(event: 'connect', listener: () => void): this; - prependListener(event: 'error', listener: (err: Error) => void): this; - prependListener(event: 'listening', listener: () => void): this; - prependListener(event: 'message', listener: (msg: Buffer, rinfo: RemoteInfo) => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: 'close', listener: () => void): this; - prependOnceListener(event: 'connect', listener: () => void): this; - prependOnceListener(event: 'error', listener: (err: Error) => void): this; - prependOnceListener(event: 'listening', listener: () => void): this; - prependOnceListener(event: 'message', listener: (msg: Buffer, rinfo: RemoteInfo) => void): this; - } -} -declare module 'node:dgram' { - export * from 'dgram'; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/diagnostics_channel.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/diagnostics_channel.d.ts deleted file mode 100755 index a87ba8ca..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/diagnostics_channel.d.ts +++ /dev/null @@ -1,153 +0,0 @@ -/** - * The `diagnostics_channel` module provides an API to create named channels - * to report arbitrary message data for diagnostics purposes. - * - * It can be accessed using: - * - * ```js - * import diagnostics_channel from 'diagnostics_channel'; - * ``` - * - * It is intended that a module writer wanting to report diagnostics messages - * will create one or many top-level channels to report messages through. - * Channels may also be acquired at runtime but it is not encouraged - * due to the additional overhead of doing so. Channels may be exported for - * convenience, but as long as the name is known it can be acquired anywhere. - * - * If you intend for your module to produce diagnostics data for others to - * consume it is recommended that you include documentation of what named - * channels are used along with the shape of the message data. Channel names - * should generally include the module name to avoid collisions with data from - * other modules. - * @experimental - * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/diagnostics_channel.js) - */ -declare module 'diagnostics_channel' { - /** - * Check if there are active subscribers to the named channel. This is helpful if - * the message you want to send might be expensive to prepare. - * - * This API is optional but helpful when trying to publish messages from very - * performance-sensitive code. - * - * ```js - * import diagnostics_channel from 'diagnostics_channel'; - * - * if (diagnostics_channel.hasSubscribers('my-channel')) { - * // There are subscribers, prepare and publish message - * } - * ``` - * @since v15.1.0, v14.17.0 - * @param name The channel name - * @return If there are active subscribers - */ - function hasSubscribers(name: string): boolean; - /** - * This is the primary entry-point for anyone wanting to interact with a named - * channel. It produces a channel object which is optimized to reduce overhead at - * publish time as much as possible. - * - * ```js - * import diagnostics_channel from 'diagnostics_channel'; - * - * const channel = diagnostics_channel.channel('my-channel'); - * ``` - * @since v15.1.0, v14.17.0 - * @param name The channel name - * @return The named channel object - */ - function channel(name: string): Channel; - type ChannelListener = (message: unknown, name: string) => void; - /** - * The class `Channel` represents an individual named channel within the data - * pipeline. It is use to track subscribers and to publish messages when there - * are subscribers present. It exists as a separate object to avoid channel - * lookups at publish time, enabling very fast publish speeds and allowing - * for heavy use while incurring very minimal cost. Channels are created with {@link channel}, constructing a channel directly - * with `new Channel(name)` is not supported. - * @since v15.1.0, v14.17.0 - */ - class Channel { - readonly name: string; - /** - * Check if there are active subscribers to this channel. This is helpful if - * the message you want to send might be expensive to prepare. - * - * This API is optional but helpful when trying to publish messages from very - * performance-sensitive code. - * - * ```js - * import diagnostics_channel from 'diagnostics_channel'; - * - * const channel = diagnostics_channel.channel('my-channel'); - * - * if (channel.hasSubscribers) { - * // There are subscribers, prepare and publish message - * } - * ``` - * @since v15.1.0, v14.17.0 - */ - readonly hasSubscribers: boolean; - private constructor(name: string); - /** - * Publish a message to any subscribers to the channel. This will - * trigger message handlers synchronously so they will execute within - * the same context. - * - * ```js - * import diagnostics_channel from 'diagnostics_channel'; - * - * const channel = diagnostics_channel.channel('my-channel'); - * - * channel.publish({ - * some: 'message' - * }); - * ``` - * @since v15.1.0, v14.17.0 - * @param message The message to send to the channel subscribers - */ - publish(message: unknown): void; - /** - * Register a message handler to subscribe to this channel. This message handler - * will be run synchronously whenever a message is published to the channel. Any - * errors thrown in the message handler will trigger an `'uncaughtException'`. - * - * ```js - * import diagnostics_channel from 'diagnostics_channel'; - * - * const channel = diagnostics_channel.channel('my-channel'); - * - * channel.subscribe((message, name) => { - * // Received data - * }); - * ``` - * @since v15.1.0, v14.17.0 - * @param onMessage The handler to receive channel messages - */ - subscribe(onMessage: ChannelListener): void; - /** - * Remove a message handler previously registered to this channel with `channel.subscribe(onMessage)`. - * - * ```js - * import diagnostics_channel from 'diagnostics_channel'; - * - * const channel = diagnostics_channel.channel('my-channel'); - * - * function onMessage(message, name) { - * // Received data - * } - * - * channel.subscribe(onMessage); - * - * channel.unsubscribe(onMessage); - * ``` - * @since v15.1.0, v14.17.0 - * @param onMessage The previous subscribed handler to remove - * @return `true` if the handler was found, `false` otherwise. - */ - unsubscribe(onMessage: ChannelListener): void; - } -} -declare module 'node:diagnostics_channel' { - export * from 'diagnostics_channel'; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/dns.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/dns.d.ts deleted file mode 100755 index 305367b8..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/dns.d.ts +++ /dev/null @@ -1,659 +0,0 @@ -/** - * The `dns` module enables name resolution. For example, use it to look up IP - * addresses of host names. - * - * Although named for the [Domain Name System (DNS)](https://en.wikipedia.org/wiki/Domain_Name_System), it does not always use the - * DNS protocol for lookups. {@link lookup} uses the operating system - * facilities to perform name resolution. It may not need to perform any network - * communication. To perform name resolution the way other applications on the same - * system do, use {@link lookup}. - * - * ```js - * const dns = require('dns'); - * - * dns.lookup('example.org', (err, address, family) => { - * console.log('address: %j family: IPv%s', address, family); - * }); - * // address: "93.184.216.34" family: IPv4 - * ``` - * - * All other functions in the `dns` module connect to an actual DNS server to - * perform name resolution. They will always use the network to perform DNS - * queries. These functions do not use the same set of configuration files used by {@link lookup} (e.g. `/etc/hosts`). Use these functions to always perform - * DNS queries, bypassing other name-resolution facilities. - * - * ```js - * const dns = require('dns'); - * - * dns.resolve4('archive.org', (err, addresses) => { - * if (err) throw err; - * - * console.log(`addresses: ${JSON.stringify(addresses)}`); - * - * addresses.forEach((a) => { - * dns.reverse(a, (err, hostnames) => { - * if (err) { - * throw err; - * } - * console.log(`reverse for ${a}: ${JSON.stringify(hostnames)}`); - * }); - * }); - * }); - * ``` - * - * See the `Implementation considerations section` for more information. - * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/dns.js) - */ -declare module 'dns' { - import * as dnsPromises from 'node:dns/promises'; - // Supported getaddrinfo flags. - export const ADDRCONFIG: number; - export const V4MAPPED: number; - /** - * If `dns.V4MAPPED` is specified, return resolved IPv6 addresses as - * well as IPv4 mapped IPv6 addresses. - */ - export const ALL: number; - export interface LookupOptions { - family?: number | undefined; - hints?: number | undefined; - all?: boolean | undefined; - /** - * @default true - */ - verbatim?: boolean | undefined; - } - export interface LookupOneOptions extends LookupOptions { - all?: false | undefined; - } - export interface LookupAllOptions extends LookupOptions { - all: true; - } - export interface LookupAddress { - address: string; - family: number; - } - /** - * Resolves a host name (e.g. `'nodejs.org'`) into the first found A (IPv4) or - * AAAA (IPv6) record. All `option` properties are optional. If `options` is an - * integer, then it must be `4` or `6` – if `options` is not provided, then IPv4 - * and IPv6 addresses are both returned if found. - * - * With the `all` option set to `true`, the arguments for `callback` change to`(err, addresses)`, with `addresses` being an array of objects with the - * properties `address` and `family`. - * - * On error, `err` is an `Error` object, where `err.code` is the error code. - * Keep in mind that `err.code` will be set to `'ENOTFOUND'` not only when - * the host name does not exist but also when the lookup fails in other ways - * such as no available file descriptors. - * - * `dns.lookup()` does not necessarily have anything to do with the DNS protocol. - * The implementation uses an operating system facility that can associate names - * with addresses, and vice versa. This implementation can have subtle but - * important consequences on the behavior of any Node.js program. Please take some - * time to consult the `Implementation considerations section` before using`dns.lookup()`. - * - * Example usage: - * - * ```js - * const dns = require('dns'); - * const options = { - * family: 6, - * hints: dns.ADDRCONFIG | dns.V4MAPPED, - * }; - * dns.lookup('example.com', options, (err, address, family) => - * console.log('address: %j family: IPv%s', address, family)); - * // address: "2606:2800:220:1:248:1893:25c8:1946" family: IPv6 - * - * // When options.all is true, the result will be an Array. - * options.all = true; - * dns.lookup('example.com', options, (err, addresses) => - * console.log('addresses: %j', addresses)); - * // addresses: [{"address":"2606:2800:220:1:248:1893:25c8:1946","family":6}] - * ``` - * - * If this method is invoked as its `util.promisify()` ed version, and `all`is not set to `true`, it returns a `Promise` for an `Object` with `address` and`family` properties. - * @since v0.1.90 - */ - export function lookup(hostname: string, family: number, callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void): void; - export function lookup(hostname: string, options: LookupOneOptions, callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void): void; - export function lookup(hostname: string, options: LookupAllOptions, callback: (err: NodeJS.ErrnoException | null, addresses: LookupAddress[]) => void): void; - export function lookup(hostname: string, options: LookupOptions, callback: (err: NodeJS.ErrnoException | null, address: string | LookupAddress[], family: number) => void): void; - export function lookup(hostname: string, callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void): void; - export namespace lookup { - function __promisify__(hostname: string, options: LookupAllOptions): Promise; - function __promisify__(hostname: string, options?: LookupOneOptions | number): Promise; - function __promisify__(hostname: string, options: LookupOptions): Promise; - } - /** - * Resolves the given `address` and `port` into a host name and service using - * the operating system's underlying `getnameinfo` implementation. - * - * If `address` is not a valid IP address, a `TypeError` will be thrown. - * The `port` will be coerced to a number. If it is not a legal port, a `TypeError`will be thrown. - * - * On an error, `err` is an `Error` object, where `err.code` is the error code. - * - * ```js - * const dns = require('dns'); - * dns.lookupService('127.0.0.1', 22, (err, hostname, service) => { - * console.log(hostname, service); - * // Prints: localhost ssh - * }); - * ``` - * - * If this method is invoked as its `util.promisify()` ed version, it returns a`Promise` for an `Object` with `hostname` and `service` properties. - * @since v0.11.14 - */ - export function lookupService(address: string, port: number, callback: (err: NodeJS.ErrnoException | null, hostname: string, service: string) => void): void; - export namespace lookupService { - function __promisify__( - address: string, - port: number - ): Promise<{ - hostname: string; - service: string; - }>; - } - export interface ResolveOptions { - ttl: boolean; - } - export interface ResolveWithTtlOptions extends ResolveOptions { - ttl: true; - } - export interface RecordWithTtl { - address: string; - ttl: number; - } - /** @deprecated Use `AnyARecord` or `AnyAaaaRecord` instead. */ - export type AnyRecordWithTtl = AnyARecord | AnyAaaaRecord; - export interface AnyARecord extends RecordWithTtl { - type: 'A'; - } - export interface AnyAaaaRecord extends RecordWithTtl { - type: 'AAAA'; - } - export interface CaaRecord { - critial: number; - issue?: string | undefined; - issuewild?: string | undefined; - iodef?: string | undefined; - contactemail?: string | undefined; - contactphone?: string | undefined; - } - export interface MxRecord { - priority: number; - exchange: string; - } - export interface AnyMxRecord extends MxRecord { - type: 'MX'; - } - export interface NaptrRecord { - flags: string; - service: string; - regexp: string; - replacement: string; - order: number; - preference: number; - } - export interface AnyNaptrRecord extends NaptrRecord { - type: 'NAPTR'; - } - export interface SoaRecord { - nsname: string; - hostmaster: string; - serial: number; - refresh: number; - retry: number; - expire: number; - minttl: number; - } - export interface AnySoaRecord extends SoaRecord { - type: 'SOA'; - } - export interface SrvRecord { - priority: number; - weight: number; - port: number; - name: string; - } - export interface AnySrvRecord extends SrvRecord { - type: 'SRV'; - } - export interface AnyTxtRecord { - type: 'TXT'; - entries: string[]; - } - export interface AnyNsRecord { - type: 'NS'; - value: string; - } - export interface AnyPtrRecord { - type: 'PTR'; - value: string; - } - export interface AnyCnameRecord { - type: 'CNAME'; - value: string; - } - export type AnyRecord = AnyARecord | AnyAaaaRecord | AnyCnameRecord | AnyMxRecord | AnyNaptrRecord | AnyNsRecord | AnyPtrRecord | AnySoaRecord | AnySrvRecord | AnyTxtRecord; - /** - * Uses the DNS protocol to resolve a host name (e.g. `'nodejs.org'`) into an array - * of the resource records. The `callback` function has arguments`(err, records)`. When successful, `records` will be an array of resource - * records. The type and structure of individual results varies based on `rrtype`: - * - * - * - * On error, `err` is an `Error` object, where `err.code` is one of the `DNS error codes`. - * @since v0.1.27 - * @param hostname Host name to resolve. - * @param [rrtype='A'] Resource record type. - */ - export function resolve(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void; - export function resolve(hostname: string, rrtype: 'A', callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void; - export function resolve(hostname: string, rrtype: 'AAAA', callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void; - export function resolve(hostname: string, rrtype: 'ANY', callback: (err: NodeJS.ErrnoException | null, addresses: AnyRecord[]) => void): void; - export function resolve(hostname: string, rrtype: 'CNAME', callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void; - export function resolve(hostname: string, rrtype: 'MX', callback: (err: NodeJS.ErrnoException | null, addresses: MxRecord[]) => void): void; - export function resolve(hostname: string, rrtype: 'NAPTR', callback: (err: NodeJS.ErrnoException | null, addresses: NaptrRecord[]) => void): void; - export function resolve(hostname: string, rrtype: 'NS', callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void; - export function resolve(hostname: string, rrtype: 'PTR', callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void; - export function resolve(hostname: string, rrtype: 'SOA', callback: (err: NodeJS.ErrnoException | null, addresses: SoaRecord) => void): void; - export function resolve(hostname: string, rrtype: 'SRV', callback: (err: NodeJS.ErrnoException | null, addresses: SrvRecord[]) => void): void; - export function resolve(hostname: string, rrtype: 'TXT', callback: (err: NodeJS.ErrnoException | null, addresses: string[][]) => void): void; - export function resolve( - hostname: string, - rrtype: string, - callback: (err: NodeJS.ErrnoException | null, addresses: string[] | MxRecord[] | NaptrRecord[] | SoaRecord | SrvRecord[] | string[][] | AnyRecord[]) => void - ): void; - export namespace resolve { - function __promisify__(hostname: string, rrtype?: 'A' | 'AAAA' | 'CNAME' | 'NS' | 'PTR'): Promise; - function __promisify__(hostname: string, rrtype: 'ANY'): Promise; - function __promisify__(hostname: string, rrtype: 'MX'): Promise; - function __promisify__(hostname: string, rrtype: 'NAPTR'): Promise; - function __promisify__(hostname: string, rrtype: 'SOA'): Promise; - function __promisify__(hostname: string, rrtype: 'SRV'): Promise; - function __promisify__(hostname: string, rrtype: 'TXT'): Promise; - function __promisify__(hostname: string, rrtype: string): Promise; - } - /** - * Uses the DNS protocol to resolve a IPv4 addresses (`A` records) for the`hostname`. The `addresses` argument passed to the `callback` function - * will contain an array of IPv4 addresses (e.g.`['74.125.79.104', '74.125.79.105', '74.125.79.106']`). - * @since v0.1.16 - * @param hostname Host name to resolve. - */ - export function resolve4(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void; - export function resolve4(hostname: string, options: ResolveWithTtlOptions, callback: (err: NodeJS.ErrnoException | null, addresses: RecordWithTtl[]) => void): void; - export function resolve4(hostname: string, options: ResolveOptions, callback: (err: NodeJS.ErrnoException | null, addresses: string[] | RecordWithTtl[]) => void): void; - export namespace resolve4 { - function __promisify__(hostname: string): Promise; - function __promisify__(hostname: string, options: ResolveWithTtlOptions): Promise; - function __promisify__(hostname: string, options?: ResolveOptions): Promise; - } - /** - * Uses the DNS protocol to resolve a IPv6 addresses (`AAAA` records) for the`hostname`. The `addresses` argument passed to the `callback` function - * will contain an array of IPv6 addresses. - * @since v0.1.16 - * @param hostname Host name to resolve. - */ - export function resolve6(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void; - export function resolve6(hostname: string, options: ResolveWithTtlOptions, callback: (err: NodeJS.ErrnoException | null, addresses: RecordWithTtl[]) => void): void; - export function resolve6(hostname: string, options: ResolveOptions, callback: (err: NodeJS.ErrnoException | null, addresses: string[] | RecordWithTtl[]) => void): void; - export namespace resolve6 { - function __promisify__(hostname: string): Promise; - function __promisify__(hostname: string, options: ResolveWithTtlOptions): Promise; - function __promisify__(hostname: string, options?: ResolveOptions): Promise; - } - /** - * Uses the DNS protocol to resolve `CNAME` records for the `hostname`. The`addresses` argument passed to the `callback` function - * will contain an array of canonical name records available for the `hostname`(e.g. `['bar.example.com']`). - * @since v0.3.2 - */ - export function resolveCname(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void; - export namespace resolveCname { - function __promisify__(hostname: string): Promise; - } - /** - * Uses the DNS protocol to resolve `CAA` records for the `hostname`. The`addresses` argument passed to the `callback` function - * will contain an array of certification authority authorization records - * available for the `hostname` (e.g. `[{critical: 0, iodef: 'mailto:pki@example.com'}, {critical: 128, issue: 'pki.example.com'}]`). - * @since v15.0.0, v14.17.0 - */ - export function resolveCaa(hostname: string, callback: (err: NodeJS.ErrnoException | null, records: CaaRecord[]) => void): void; - export namespace resolveCaa { - function __promisify__(hostname: string): Promise; - } - /** - * Uses the DNS protocol to resolve mail exchange records (`MX` records) for the`hostname`. The `addresses` argument passed to the `callback` function will - * contain an array of objects containing both a `priority` and `exchange`property (e.g. `[{priority: 10, exchange: 'mx.example.com'}, ...]`). - * @since v0.1.27 - */ - export function resolveMx(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: MxRecord[]) => void): void; - export namespace resolveMx { - function __promisify__(hostname: string): Promise; - } - /** - * Uses the DNS protocol to resolve regular expression based records (`NAPTR`records) for the `hostname`. The `addresses` argument passed to the `callback`function will contain an array of - * objects with the following properties: - * - * * `flags` - * * `service` - * * `regexp` - * * `replacement` - * * `order` - * * `preference` - * - * ```js - * { - * flags: 's', - * service: 'SIP+D2U', - * regexp: '', - * replacement: '_sip._udp.example.com', - * order: 30, - * preference: 100 - * } - * ``` - * @since v0.9.12 - */ - export function resolveNaptr(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: NaptrRecord[]) => void): void; - export namespace resolveNaptr { - function __promisify__(hostname: string): Promise; - } - /** - * Uses the DNS protocol to resolve name server records (`NS` records) for the`hostname`. The `addresses` argument passed to the `callback` function will - * contain an array of name server records available for `hostname`(e.g. `['ns1.example.com', 'ns2.example.com']`). - * @since v0.1.90 - */ - export function resolveNs(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void; - export namespace resolveNs { - function __promisify__(hostname: string): Promise; - } - /** - * Uses the DNS protocol to resolve pointer records (`PTR` records) for the`hostname`. The `addresses` argument passed to the `callback` function will - * be an array of strings containing the reply records. - * @since v6.0.0 - */ - export function resolvePtr(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void; - export namespace resolvePtr { - function __promisify__(hostname: string): Promise; - } - /** - * Uses the DNS protocol to resolve a start of authority record (`SOA` record) for - * the `hostname`. The `address` argument passed to the `callback` function will - * be an object with the following properties: - * - * * `nsname` - * * `hostmaster` - * * `serial` - * * `refresh` - * * `retry` - * * `expire` - * * `minttl` - * - * ```js - * { - * nsname: 'ns.example.com', - * hostmaster: 'root.example.com', - * serial: 2013101809, - * refresh: 10000, - * retry: 2400, - * expire: 604800, - * minttl: 3600 - * } - * ``` - * @since v0.11.10 - */ - export function resolveSoa(hostname: string, callback: (err: NodeJS.ErrnoException | null, address: SoaRecord) => void): void; - export namespace resolveSoa { - function __promisify__(hostname: string): Promise; - } - /** - * Uses the DNS protocol to resolve service records (`SRV` records) for the`hostname`. The `addresses` argument passed to the `callback` function will - * be an array of objects with the following properties: - * - * * `priority` - * * `weight` - * * `port` - * * `name` - * - * ```js - * { - * priority: 10, - * weight: 5, - * port: 21223, - * name: 'service.example.com' - * } - * ``` - * @since v0.1.27 - */ - export function resolveSrv(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: SrvRecord[]) => void): void; - export namespace resolveSrv { - function __promisify__(hostname: string): Promise; - } - /** - * Uses the DNS protocol to resolve text queries (`TXT` records) for the`hostname`. The `records` argument passed to the `callback` function is a - * two-dimensional array of the text records available for `hostname` (e.g.`[ ['v=spf1 ip4:0.0.0.0 ', '~all' ] ]`). Each sub-array contains TXT chunks of - * one record. Depending on the use case, these could be either joined together or - * treated separately. - * @since v0.1.27 - */ - export function resolveTxt(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[][]) => void): void; - export namespace resolveTxt { - function __promisify__(hostname: string): Promise; - } - /** - * Uses the DNS protocol to resolve all records (also known as `ANY` or `*` query). - * The `ret` argument passed to the `callback` function will be an array containing - * various types of records. Each object has a property `type` that indicates the - * type of the current record. And depending on the `type`, additional properties - * will be present on the object: - * - * - * - * Here is an example of the `ret` object passed to the callback: - * - * ```js - * [ { type: 'A', address: '127.0.0.1', ttl: 299 }, - * { type: 'CNAME', value: 'example.com' }, - * { type: 'MX', exchange: 'alt4.aspmx.l.example.com', priority: 50 }, - * { type: 'NS', value: 'ns1.example.com' }, - * { type: 'TXT', entries: [ 'v=spf1 include:_spf.example.com ~all' ] }, - * { type: 'SOA', - * nsname: 'ns1.example.com', - * hostmaster: 'admin.example.com', - * serial: 156696742, - * refresh: 900, - * retry: 900, - * expire: 1800, - * minttl: 60 } ] - * ``` - * - * DNS server operators may choose not to respond to `ANY`queries. It may be better to call individual methods like {@link resolve4},{@link resolveMx}, and so on. For more details, see [RFC - * 8482](https://tools.ietf.org/html/rfc8482). - */ - export function resolveAny(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: AnyRecord[]) => void): void; - export namespace resolveAny { - function __promisify__(hostname: string): Promise; - } - /** - * Performs a reverse DNS query that resolves an IPv4 or IPv6 address to an - * array of host names. - * - * On error, `err` is an `Error` object, where `err.code` is - * one of the `DNS error codes`. - * @since v0.1.16 - */ - export function reverse(ip: string, callback: (err: NodeJS.ErrnoException | null, hostnames: string[]) => void): void; - /** - * Sets the IP address and port of servers to be used when performing DNS - * resolution. The `servers` argument is an array of [RFC 5952](https://tools.ietf.org/html/rfc5952#section-6) formatted - * addresses. If the port is the IANA default DNS port (53) it can be omitted. - * - * ```js - * dns.setServers([ - * '4.4.4.4', - * '[2001:4860:4860::8888]', - * '4.4.4.4:1053', - * '[2001:4860:4860::8888]:1053', - * ]); - * ``` - * - * An error will be thrown if an invalid address is provided. - * - * The `dns.setServers()` method must not be called while a DNS query is in - * progress. - * - * The {@link setServers} method affects only {@link resolve},`dns.resolve*()` and {@link reverse} (and specifically _not_ {@link lookup}). - * - * This method works much like [resolve.conf](https://man7.org/linux/man-pages/man5/resolv.conf.5.html). - * That is, if attempting to resolve with the first server provided results in a`NOTFOUND` error, the `resolve()` method will _not_ attempt to resolve with - * subsequent servers provided. Fallback DNS servers will only be used if the - * earlier ones time out or result in some other error. - * @since v0.11.3 - * @param servers array of `RFC 5952` formatted addresses - */ - export function setServers(servers: ReadonlyArray): void; - /** - * Returns an array of IP address strings, formatted according to [RFC 5952](https://tools.ietf.org/html/rfc5952#section-6), - * that are currently configured for DNS resolution. A string will include a port - * section if a custom port is used. - * - * ```js - * [ - * '4.4.4.4', - * '2001:4860:4860::8888', - * '4.4.4.4:1053', - * '[2001:4860:4860::8888]:1053', - * ] - * ``` - * @since v0.11.3 - */ - export function getServers(): string[]; - /** - * Set the default value of `verbatim` in {@link lookup} and `dnsPromises.lookup()`. The value could be: - * - * * `ipv4first`: sets default `verbatim` `false`. - * * `verbatim`: sets default `verbatim` `true`. - * - * The default is `ipv4first` and {@link setDefaultResultOrder} have higher - * priority than `--dns-result-order`. When using `worker threads`,{@link setDefaultResultOrder} from the main thread won't affect the default - * dns orders in workers. - * @since v16.4.0, v14.18.0 - * @param order must be `'ipv4first'` or `'verbatim'`. - */ - export function setDefaultResultOrder(order: 'ipv4first' | 'verbatim'): void; - // Error codes - export const NODATA: string; - export const FORMERR: string; - export const SERVFAIL: string; - export const NOTFOUND: string; - export const NOTIMP: string; - export const REFUSED: string; - export const BADQUERY: string; - export const BADNAME: string; - export const BADFAMILY: string; - export const BADRESP: string; - export const CONNREFUSED: string; - export const TIMEOUT: string; - export const EOF: string; - export const FILE: string; - export const NOMEM: string; - export const DESTRUCTION: string; - export const BADSTR: string; - export const BADFLAGS: string; - export const NONAME: string; - export const BADHINTS: string; - export const NOTINITIALIZED: string; - export const LOADIPHLPAPI: string; - export const ADDRGETNETWORKPARAMS: string; - export const CANCELLED: string; - export interface ResolverOptions { - timeout?: number | undefined; - /** - * @default 4 - */ - tries?: number; - } - /** - * An independent resolver for DNS requests. - * - * Creating a new resolver uses the default server settings. Setting - * the servers used for a resolver using `resolver.setServers()` does not affect - * other resolvers: - * - * ```js - * const { Resolver } = require('dns'); - * const resolver = new Resolver(); - * resolver.setServers(['4.4.4.4']); - * - * // This request will use the server at 4.4.4.4, independent of global settings. - * resolver.resolve4('example.org', (err, addresses) => { - * // ... - * }); - * ``` - * - * The following methods from the `dns` module are available: - * - * * `resolver.getServers()` - * * `resolver.resolve()` - * * `resolver.resolve4()` - * * `resolver.resolve6()` - * * `resolver.resolveAny()` - * * `resolver.resolveCaa()` - * * `resolver.resolveCname()` - * * `resolver.resolveMx()` - * * `resolver.resolveNaptr()` - * * `resolver.resolveNs()` - * * `resolver.resolvePtr()` - * * `resolver.resolveSoa()` - * * `resolver.resolveSrv()` - * * `resolver.resolveTxt()` - * * `resolver.reverse()` - * * `resolver.setServers()` - * @since v8.3.0 - */ - export class Resolver { - constructor(options?: ResolverOptions); - /** - * Cancel all outstanding DNS queries made by this resolver. The corresponding - * callbacks will be called with an error with code `ECANCELLED`. - * @since v8.3.0 - */ - cancel(): void; - getServers: typeof getServers; - resolve: typeof resolve; - resolve4: typeof resolve4; - resolve6: typeof resolve6; - resolveAny: typeof resolveAny; - resolveCname: typeof resolveCname; - resolveMx: typeof resolveMx; - resolveNaptr: typeof resolveNaptr; - resolveNs: typeof resolveNs; - resolvePtr: typeof resolvePtr; - resolveSoa: typeof resolveSoa; - resolveSrv: typeof resolveSrv; - resolveTxt: typeof resolveTxt; - reverse: typeof reverse; - /** - * The resolver instance will send its requests from the specified IP address. - * This allows programs to specify outbound interfaces when used on multi-homed - * systems. - * - * If a v4 or v6 address is not specified, it is set to the default, and the - * operating system will choose a local address automatically. - * - * The resolver will use the v4 local address when making requests to IPv4 DNS - * servers, and the v6 local address when making requests to IPv6 DNS servers. - * The `rrtype` of resolution requests has no impact on the local address used. - * @since v15.1.0, v14.17.0 - * @param [ipv4='0.0.0.0'] A string representation of an IPv4 address. - * @param [ipv6='::0'] A string representation of an IPv6 address. - */ - setLocalAddress(ipv4?: string, ipv6?: string): void; - setServers: typeof setServers; - } - export { dnsPromises as promises }; -} -declare module 'node:dns' { - export * from 'dns'; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/dns/promises.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/dns/promises.d.ts deleted file mode 100755 index 77cd807b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/dns/promises.d.ts +++ /dev/null @@ -1,370 +0,0 @@ -/** - * The `dns.promises` API provides an alternative set of asynchronous DNS methods - * that return `Promise` objects rather than using callbacks. The API is accessible - * via `require('dns').promises` or `require('dns/promises')`. - * @since v10.6.0 - */ -declare module 'dns/promises' { - import { - LookupAddress, - LookupOneOptions, - LookupAllOptions, - LookupOptions, - AnyRecord, - CaaRecord, - MxRecord, - NaptrRecord, - SoaRecord, - SrvRecord, - ResolveWithTtlOptions, - RecordWithTtl, - ResolveOptions, - ResolverOptions, - } from 'node:dns'; - /** - * Returns an array of IP address strings, formatted according to [RFC 5952](https://tools.ietf.org/html/rfc5952#section-6), - * that are currently configured for DNS resolution. A string will include a port - * section if a custom port is used. - * - * ```js - * [ - * '4.4.4.4', - * '2001:4860:4860::8888', - * '4.4.4.4:1053', - * '[2001:4860:4860::8888]:1053', - * ] - * ``` - * @since v10.6.0 - */ - function getServers(): string[]; - /** - * Resolves a host name (e.g. `'nodejs.org'`) into the first found A (IPv4) or - * AAAA (IPv6) record. All `option` properties are optional. If `options` is an - * integer, then it must be `4` or `6` – if `options` is not provided, then IPv4 - * and IPv6 addresses are both returned if found. - * - * With the `all` option set to `true`, the `Promise` is resolved with `addresses`being an array of objects with the properties `address` and `family`. - * - * On error, the `Promise` is rejected with an `Error` object, where `err.code`is the error code. - * Keep in mind that `err.code` will be set to `'ENOTFOUND'` not only when - * the host name does not exist but also when the lookup fails in other ways - * such as no available file descriptors. - * - * `dnsPromises.lookup()` does not necessarily have anything to do with the DNS - * protocol. The implementation uses an operating system facility that can - * associate names with addresses, and vice versa. This implementation can have - * subtle but important consequences on the behavior of any Node.js program. Please - * take some time to consult the `Implementation considerations section` before - * using `dnsPromises.lookup()`. - * - * Example usage: - * - * ```js - * const dns = require('dns'); - * const dnsPromises = dns.promises; - * const options = { - * family: 6, - * hints: dns.ADDRCONFIG | dns.V4MAPPED, - * }; - * - * dnsPromises.lookup('example.com', options).then((result) => { - * console.log('address: %j family: IPv%s', result.address, result.family); - * // address: "2606:2800:220:1:248:1893:25c8:1946" family: IPv6 - * }); - * - * // When options.all is true, the result will be an Array. - * options.all = true; - * dnsPromises.lookup('example.com', options).then((result) => { - * console.log('addresses: %j', result); - * // addresses: [{"address":"2606:2800:220:1:248:1893:25c8:1946","family":6}] - * }); - * ``` - * @since v10.6.0 - */ - function lookup(hostname: string, family: number): Promise; - function lookup(hostname: string, options: LookupOneOptions): Promise; - function lookup(hostname: string, options: LookupAllOptions): Promise; - function lookup(hostname: string, options: LookupOptions): Promise; - function lookup(hostname: string): Promise; - /** - * Resolves the given `address` and `port` into a host name and service using - * the operating system's underlying `getnameinfo` implementation. - * - * If `address` is not a valid IP address, a `TypeError` will be thrown. - * The `port` will be coerced to a number. If it is not a legal port, a `TypeError`will be thrown. - * - * On error, the `Promise` is rejected with an `Error` object, where `err.code`is the error code. - * - * ```js - * const dnsPromises = require('dns').promises; - * dnsPromises.lookupService('127.0.0.1', 22).then((result) => { - * console.log(result.hostname, result.service); - * // Prints: localhost ssh - * }); - * ``` - * @since v10.6.0 - */ - function lookupService( - address: string, - port: number - ): Promise<{ - hostname: string; - service: string; - }>; - /** - * Uses the DNS protocol to resolve a host name (e.g. `'nodejs.org'`) into an array - * of the resource records. When successful, the `Promise` is resolved with an - * array of resource records. The type and structure of individual results vary - * based on `rrtype`: - * - * - * - * On error, the `Promise` is rejected with an `Error` object, where `err.code`is one of the `DNS error codes`. - * @since v10.6.0 - * @param hostname Host name to resolve. - * @param [rrtype='A'] Resource record type. - */ - function resolve(hostname: string): Promise; - function resolve(hostname: string, rrtype: 'A'): Promise; - function resolve(hostname: string, rrtype: 'AAAA'): Promise; - function resolve(hostname: string, rrtype: 'ANY'): Promise; - function resolve(hostname: string, rrtype: 'CAA'): Promise; - function resolve(hostname: string, rrtype: 'CNAME'): Promise; - function resolve(hostname: string, rrtype: 'MX'): Promise; - function resolve(hostname: string, rrtype: 'NAPTR'): Promise; - function resolve(hostname: string, rrtype: 'NS'): Promise; - function resolve(hostname: string, rrtype: 'PTR'): Promise; - function resolve(hostname: string, rrtype: 'SOA'): Promise; - function resolve(hostname: string, rrtype: 'SRV'): Promise; - function resolve(hostname: string, rrtype: 'TXT'): Promise; - function resolve(hostname: string, rrtype: string): Promise; - /** - * Uses the DNS protocol to resolve IPv4 addresses (`A` records) for the`hostname`. On success, the `Promise` is resolved with an array of IPv4 - * addresses (e.g. `['74.125.79.104', '74.125.79.105', '74.125.79.106']`). - * @since v10.6.0 - * @param hostname Host name to resolve. - */ - function resolve4(hostname: string): Promise; - function resolve4(hostname: string, options: ResolveWithTtlOptions): Promise; - function resolve4(hostname: string, options: ResolveOptions): Promise; - /** - * Uses the DNS protocol to resolve IPv6 addresses (`AAAA` records) for the`hostname`. On success, the `Promise` is resolved with an array of IPv6 - * addresses. - * @since v10.6.0 - * @param hostname Host name to resolve. - */ - function resolve6(hostname: string): Promise; - function resolve6(hostname: string, options: ResolveWithTtlOptions): Promise; - function resolve6(hostname: string, options: ResolveOptions): Promise; - /** - * Uses the DNS protocol to resolve all records (also known as `ANY` or `*` query). - * On success, the `Promise` is resolved with an array containing various types of - * records. Each object has a property `type` that indicates the type of the - * current record. And depending on the `type`, additional properties will be - * present on the object: - * - * - * - * Here is an example of the result object: - * - * ```js - * [ { type: 'A', address: '127.0.0.1', ttl: 299 }, - * { type: 'CNAME', value: 'example.com' }, - * { type: 'MX', exchange: 'alt4.aspmx.l.example.com', priority: 50 }, - * { type: 'NS', value: 'ns1.example.com' }, - * { type: 'TXT', entries: [ 'v=spf1 include:_spf.example.com ~all' ] }, - * { type: 'SOA', - * nsname: 'ns1.example.com', - * hostmaster: 'admin.example.com', - * serial: 156696742, - * refresh: 900, - * retry: 900, - * expire: 1800, - * minttl: 60 } ] - * ``` - * @since v10.6.0 - */ - function resolveAny(hostname: string): Promise; - /** - * Uses the DNS protocol to resolve `CAA` records for the `hostname`. On success, - * the `Promise` is resolved with an array of objects containing available - * certification authority authorization records available for the `hostname`(e.g. `[{critical: 0, iodef: 'mailto:pki@example.com'},{critical: 128, issue: 'pki.example.com'}]`). - * @since v15.0.0, v14.17.0 - */ - function resolveCaa(hostname: string): Promise; - /** - * Uses the DNS protocol to resolve `CNAME` records for the `hostname`. On success, - * the `Promise` is resolved with an array of canonical name records available for - * the `hostname` (e.g. `['bar.example.com']`). - * @since v10.6.0 - */ - function resolveCname(hostname: string): Promise; - /** - * Uses the DNS protocol to resolve mail exchange records (`MX` records) for the`hostname`. On success, the `Promise` is resolved with an array of objects - * containing both a `priority` and `exchange` property (e.g.`[{priority: 10, exchange: 'mx.example.com'}, ...]`). - * @since v10.6.0 - */ - function resolveMx(hostname: string): Promise; - /** - * Uses the DNS protocol to resolve regular expression based records (`NAPTR`records) for the `hostname`. On success, the `Promise` is resolved with an array - * of objects with the following properties: - * - * * `flags` - * * `service` - * * `regexp` - * * `replacement` - * * `order` - * * `preference` - * - * ```js - * { - * flags: 's', - * service: 'SIP+D2U', - * regexp: '', - * replacement: '_sip._udp.example.com', - * order: 30, - * preference: 100 - * } - * ``` - * @since v10.6.0 - */ - function resolveNaptr(hostname: string): Promise; - /** - * Uses the DNS protocol to resolve name server records (`NS` records) for the`hostname`. On success, the `Promise` is resolved with an array of name server - * records available for `hostname` (e.g.`['ns1.example.com', 'ns2.example.com']`). - * @since v10.6.0 - */ - function resolveNs(hostname: string): Promise; - /** - * Uses the DNS protocol to resolve pointer records (`PTR` records) for the`hostname`. On success, the `Promise` is resolved with an array of strings - * containing the reply records. - * @since v10.6.0 - */ - function resolvePtr(hostname: string): Promise; - /** - * Uses the DNS protocol to resolve a start of authority record (`SOA` record) for - * the `hostname`. On success, the `Promise` is resolved with an object with the - * following properties: - * - * * `nsname` - * * `hostmaster` - * * `serial` - * * `refresh` - * * `retry` - * * `expire` - * * `minttl` - * - * ```js - * { - * nsname: 'ns.example.com', - * hostmaster: 'root.example.com', - * serial: 2013101809, - * refresh: 10000, - * retry: 2400, - * expire: 604800, - * minttl: 3600 - * } - * ``` - * @since v10.6.0 - */ - function resolveSoa(hostname: string): Promise; - /** - * Uses the DNS protocol to resolve service records (`SRV` records) for the`hostname`. On success, the `Promise` is resolved with an array of objects with - * the following properties: - * - * * `priority` - * * `weight` - * * `port` - * * `name` - * - * ```js - * { - * priority: 10, - * weight: 5, - * port: 21223, - * name: 'service.example.com' - * } - * ``` - * @since v10.6.0 - */ - function resolveSrv(hostname: string): Promise; - /** - * Uses the DNS protocol to resolve text queries (`TXT` records) for the`hostname`. On success, the `Promise` is resolved with a two-dimensional array - * of the text records available for `hostname` (e.g.`[ ['v=spf1 ip4:0.0.0.0 ', '~all' ] ]`). Each sub-array contains TXT chunks of - * one record. Depending on the use case, these could be either joined together or - * treated separately. - * @since v10.6.0 - */ - function resolveTxt(hostname: string): Promise; - /** - * Performs a reverse DNS query that resolves an IPv4 or IPv6 address to an - * array of host names. - * - * On error, the `Promise` is rejected with an `Error` object, where `err.code`is one of the `DNS error codes`. - * @since v10.6.0 - */ - function reverse(ip: string): Promise; - /** - * Sets the IP address and port of servers to be used when performing DNS - * resolution. The `servers` argument is an array of [RFC 5952](https://tools.ietf.org/html/rfc5952#section-6) formatted - * addresses. If the port is the IANA default DNS port (53) it can be omitted. - * - * ```js - * dnsPromises.setServers([ - * '4.4.4.4', - * '[2001:4860:4860::8888]', - * '4.4.4.4:1053', - * '[2001:4860:4860::8888]:1053', - * ]); - * ``` - * - * An error will be thrown if an invalid address is provided. - * - * The `dnsPromises.setServers()` method must not be called while a DNS query is in - * progress. - * - * This method works much like [resolve.conf](https://man7.org/linux/man-pages/man5/resolv.conf.5.html). - * That is, if attempting to resolve with the first server provided results in a`NOTFOUND` error, the `resolve()` method will _not_ attempt to resolve with - * subsequent servers provided. Fallback DNS servers will only be used if the - * earlier ones time out or result in some other error. - * @since v10.6.0 - * @param servers array of `RFC 5952` formatted addresses - */ - function setServers(servers: ReadonlyArray): void; - /** - * Set the default value of `verbatim` in `dns.lookup()` and `dnsPromises.lookup()`. The value could be: - * - * * `ipv4first`: sets default `verbatim` `false`. - * * `verbatim`: sets default `verbatim` `true`. - * - * The default is `ipv4first` and `dnsPromises.setDefaultResultOrder()` have - * higher priority than `--dns-result-order`. When using `worker threads`,`dnsPromises.setDefaultResultOrder()` from the main thread won't affect the - * default dns orders in workers. - * @since v16.4.0, v14.18.0 - * @param order must be `'ipv4first'` or `'verbatim'`. - */ - function setDefaultResultOrder(order: 'ipv4first' | 'verbatim'): void; - class Resolver { - constructor(options?: ResolverOptions); - cancel(): void; - getServers: typeof getServers; - resolve: typeof resolve; - resolve4: typeof resolve4; - resolve6: typeof resolve6; - resolveAny: typeof resolveAny; - resolveCname: typeof resolveCname; - resolveMx: typeof resolveMx; - resolveNaptr: typeof resolveNaptr; - resolveNs: typeof resolveNs; - resolvePtr: typeof resolvePtr; - resolveSoa: typeof resolveSoa; - resolveSrv: typeof resolveSrv; - resolveTxt: typeof resolveTxt; - reverse: typeof reverse; - setLocalAddress(ipv4?: string, ipv6?: string): void; - setServers: typeof setServers; - } -} -declare module 'node:dns/promises' { - export * from 'dns/promises'; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/dom-events.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/dom-events.d.ts deleted file mode 100755 index b9c1c3aa..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/dom-events.d.ts +++ /dev/null @@ -1,126 +0,0 @@ -export {}; // Don't export anything! - -//// DOM-like Events -// NB: The Event / EventTarget / EventListener implementations below were copied -// from lib.dom.d.ts, then edited to reflect Node's documentation at -// https://nodejs.org/api/events.html#class-eventtarget. -// Please read that link to understand important implementation differences. - -// This conditional type will be the existing global Event in a browser, or -// the copy below in a Node environment. -type __Event = typeof globalThis extends { onmessage: any, Event: any } -? {} -: { - /** This is not used in Node.js and is provided purely for completeness. */ - readonly bubbles: boolean; - /** Alias for event.stopPropagation(). This is not used in Node.js and is provided purely for completeness. */ - cancelBubble: () => void; - /** True if the event was created with the cancelable option */ - readonly cancelable: boolean; - /** This is not used in Node.js and is provided purely for completeness. */ - readonly composed: boolean; - /** Returns an array containing the current EventTarget as the only entry or empty if the event is not being dispatched. This is not used in Node.js and is provided purely for completeness. */ - composedPath(): [EventTarget?] - /** Alias for event.target. */ - readonly currentTarget: EventTarget | null; - /** Is true if cancelable is true and event.preventDefault() has been called. */ - readonly defaultPrevented: boolean; - /** This is not used in Node.js and is provided purely for completeness. */ - readonly eventPhase: 0 | 2; - /** The `AbortSignal` "abort" event is emitted with `isTrusted` set to `true`. The value is `false` in all other cases. */ - readonly isTrusted: boolean; - /** Sets the `defaultPrevented` property to `true` if `cancelable` is `true`. */ - preventDefault(): void; - /** This is not used in Node.js and is provided purely for completeness. */ - returnValue: boolean; - /** Alias for event.target. */ - readonly srcElement: EventTarget | null; - /** Stops the invocation of event listeners after the current one completes. */ - stopImmediatePropagation(): void; - /** This is not used in Node.js and is provided purely for completeness. */ - stopPropagation(): void; - /** The `EventTarget` dispatching the event */ - readonly target: EventTarget | null; - /** The millisecond timestamp when the Event object was created. */ - readonly timeStamp: number; - /** Returns the type of event, e.g. "click", "hashchange", or "submit". */ - readonly type: string; -}; - -// See comment above explaining conditional type -type __EventTarget = typeof globalThis extends { onmessage: any, EventTarget: any } -? {} -: { - /** - * Adds a new handler for the `type` event. Any given `listener` is added only once per `type` and per `capture` option value. - * - * If the `once` option is true, the `listener` is removed after the next time a `type` event is dispatched. - * - * The `capture` option is not used by Node.js in any functional way other than tracking registered event listeners per the `EventTarget` specification. - * Specifically, the `capture` option is used as part of the key when registering a `listener`. - * Any individual `listener` may be added once with `capture = false`, and once with `capture = true`. - */ - addEventListener( - type: string, - listener: EventListener | EventListenerObject, - options?: AddEventListenerOptions | boolean, - ): void; - /** Dispatches a synthetic event event to target and returns true if either event's cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise. */ - dispatchEvent(event: Event): boolean; - /** Removes the event listener in target's event listener list with the same type, callback, and options. */ - removeEventListener( - type: string, - listener: EventListener | EventListenerObject, - options?: EventListenerOptions | boolean, - ): void; -}; - -interface EventInit { - bubbles?: boolean; - cancelable?: boolean; - composed?: boolean; -} - -interface EventListenerOptions { - /** Not directly used by Node.js. Added for API completeness. Default: `false`. */ - capture?: boolean; -} - -interface AddEventListenerOptions extends EventListenerOptions { - /** When `true`, the listener is automatically removed when it is first invoked. Default: `false`. */ - once?: boolean; - /** When `true`, serves as a hint that the listener will not call the `Event` object's `preventDefault()` method. Default: false. */ - passive?: boolean; -} - -interface EventListener { - (evt: Event): void; -} - -interface EventListenerObject { - handleEvent(object: Event): void; -} - -import {} from 'events'; // Make this an ambient declaration -declare global { - /** An event which takes place in the DOM. */ - interface Event extends __Event {} - var Event: typeof globalThis extends { onmessage: any, Event: infer T } - ? T - : { - prototype: __Event; - new (type: string, eventInitDict?: EventInit): __Event; - }; - - /** - * EventTarget is a DOM interface implemented by objects that can - * receive events and may have listeners for them. - */ - interface EventTarget extends __EventTarget {} - var EventTarget: typeof globalThis extends { onmessage: any, EventTarget: infer T } - ? T - : { - prototype: __EventTarget; - new (): __EventTarget; - }; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/domain.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/domain.d.ts deleted file mode 100755 index fafe68a5..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/domain.d.ts +++ /dev/null @@ -1,170 +0,0 @@ -/** - * **This module is pending deprecation.** Once a replacement API has been - * finalized, this module will be fully deprecated. Most developers should - * **not** have cause to use this module. Users who absolutely must have - * the functionality that domains provide may rely on it for the time being - * but should expect to have to migrate to a different solution - * in the future. - * - * Domains provide a way to handle multiple different IO operations as a - * single group. If any of the event emitters or callbacks registered to a - * domain emit an `'error'` event, or throw an error, then the domain object - * will be notified, rather than losing the context of the error in the`process.on('uncaughtException')` handler, or causing the program to - * exit immediately with an error code. - * @deprecated Since v1.4.2 - Deprecated - * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/domain.js) - */ -declare module 'domain' { - import EventEmitter = require('node:events'); - /** - * The `Domain` class encapsulates the functionality of routing errors and - * uncaught exceptions to the active `Domain` object. - * - * To handle the errors that it catches, listen to its `'error'` event. - */ - class Domain extends EventEmitter { - /** - * An array of timers and event emitters that have been explicitly added - * to the domain. - */ - members: Array; - /** - * The `enter()` method is plumbing used by the `run()`, `bind()`, and`intercept()` methods to set the active domain. It sets `domain.active` and`process.domain` to the domain, and implicitly - * pushes the domain onto the domain - * stack managed by the domain module (see {@link exit} for details on the - * domain stack). The call to `enter()` delimits the beginning of a chain of - * asynchronous calls and I/O operations bound to a domain. - * - * Calling `enter()` changes only the active domain, and does not alter the domain - * itself. `enter()` and `exit()` can be called an arbitrary number of times on a - * single domain. - */ - enter(): void; - /** - * The `exit()` method exits the current domain, popping it off the domain stack. - * Any time execution is going to switch to the context of a different chain of - * asynchronous calls, it's important to ensure that the current domain is exited. - * The call to `exit()` delimits either the end of or an interruption to the chain - * of asynchronous calls and I/O operations bound to a domain. - * - * If there are multiple, nested domains bound to the current execution context,`exit()` will exit any domains nested within this domain. - * - * Calling `exit()` changes only the active domain, and does not alter the domain - * itself. `enter()` and `exit()` can be called an arbitrary number of times on a - * single domain. - */ - exit(): void; - /** - * Run the supplied function in the context of the domain, implicitly - * binding all event emitters, timers, and lowlevel requests that are - * created in that context. Optionally, arguments can be passed to - * the function. - * - * This is the most basic way to use a domain. - * - * ```js - * const domain = require('domain'); - * const fs = require('fs'); - * const d = domain.create(); - * d.on('error', (er) => { - * console.error('Caught error!', er); - * }); - * d.run(() => { - * process.nextTick(() => { - * setTimeout(() => { // Simulating some various async stuff - * fs.open('non-existent file', 'r', (er, fd) => { - * if (er) throw er; - * // proceed... - * }); - * }, 100); - * }); - * }); - * ``` - * - * In this example, the `d.on('error')` handler will be triggered, rather - * than crashing the program. - */ - run(fn: (...args: any[]) => T, ...args: any[]): T; - /** - * Explicitly adds an emitter to the domain. If any event handlers called by - * the emitter throw an error, or if the emitter emits an `'error'` event, it - * will be routed to the domain's `'error'` event, just like with implicit - * binding. - * - * This also works with timers that are returned from `setInterval()` and `setTimeout()`. If their callback function throws, it will be caught by - * the domain `'error'` handler. - * - * If the Timer or `EventEmitter` was already bound to a domain, it is removed - * from that one, and bound to this one instead. - * @param emitter emitter or timer to be added to the domain - */ - add(emitter: EventEmitter | NodeJS.Timer): void; - /** - * The opposite of {@link add}. Removes domain handling from the - * specified emitter. - * @param emitter emitter or timer to be removed from the domain - */ - remove(emitter: EventEmitter | NodeJS.Timer): void; - /** - * The returned function will be a wrapper around the supplied callback - * function. When the returned function is called, any errors that are - * thrown will be routed to the domain's `'error'` event. - * - * ```js - * const d = domain.create(); - * - * function readSomeFile(filename, cb) { - * fs.readFile(filename, 'utf8', d.bind((er, data) => { - * // If this throws, it will also be passed to the domain. - * return cb(er, data ? JSON.parse(data) : null); - * })); - * } - * - * d.on('error', (er) => { - * // An error occurred somewhere. If we throw it now, it will crash the program - * // with the normal line number and stack message. - * }); - * ``` - * @param callback The callback function - * @return The bound function - */ - bind(callback: T): T; - /** - * This method is almost identical to {@link bind}. However, in - * addition to catching thrown errors, it will also intercept `Error` objects sent as the first argument to the function. - * - * In this way, the common `if (err) return callback(err);` pattern can be replaced - * with a single error handler in a single place. - * - * ```js - * const d = domain.create(); - * - * function readSomeFile(filename, cb) { - * fs.readFile(filename, 'utf8', d.intercept((data) => { - * // Note, the first argument is never passed to the - * // callback since it is assumed to be the 'Error' argument - * // and thus intercepted by the domain. - * - * // If this throws, it will also be passed to the domain - * // so the error-handling logic can be moved to the 'error' - * // event on the domain instead of being repeated throughout - * // the program. - * return cb(null, JSON.parse(data)); - * })); - * } - * - * d.on('error', (er) => { - * // An error occurred somewhere. If we throw it now, it will crash the program - * // with the normal line number and stack message. - * }); - * ``` - * @param callback The callback function - * @return The intercepted function - */ - intercept(callback: T): T; - } - function create(): Domain; -} -declare module 'node:domain' { - export * from 'domain'; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/events.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/events.d.ts deleted file mode 100755 index 4633df19..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/events.d.ts +++ /dev/null @@ -1,678 +0,0 @@ -/** - * Much of the Node.js core API is built around an idiomatic asynchronous - * event-driven architecture in which certain kinds of objects (called "emitters") - * emit named events that cause `Function` objects ("listeners") to be called. - * - * For instance: a `net.Server` object emits an event each time a peer - * connects to it; a `fs.ReadStream` emits an event when the file is opened; - * a `stream` emits an event whenever data is available to be read. - * - * All objects that emit events are instances of the `EventEmitter` class. These - * objects expose an `eventEmitter.on()` function that allows one or more - * functions to be attached to named events emitted by the object. Typically, - * event names are camel-cased strings but any valid JavaScript property key - * can be used. - * - * When the `EventEmitter` object emits an event, all of the functions attached - * to that specific event are called _synchronously_. Any values returned by the - * called listeners are _ignored_ and discarded. - * - * The following example shows a simple `EventEmitter` instance with a single - * listener. The `eventEmitter.on()` method is used to register listeners, while - * the `eventEmitter.emit()` method is used to trigger the event. - * - * ```js - * const EventEmitter = require('events'); - * - * class MyEmitter extends EventEmitter {} - * - * const myEmitter = new MyEmitter(); - * myEmitter.on('event', () => { - * console.log('an event occurred!'); - * }); - * myEmitter.emit('event'); - * ``` - * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/events.js) - */ -declare module 'events' { - // NOTE: This class is in the docs but is **not actually exported** by Node. - // If https://github.com/nodejs/node/issues/39903 gets resolved and Node - // actually starts exporting the class, uncomment below. - - // import { EventListener, EventListenerObject } from '__dom-events'; - // /** The NodeEventTarget is a Node.js-specific extension to EventTarget that emulates a subset of the EventEmitter API. */ - // interface NodeEventTarget extends EventTarget { - // /** - // * Node.js-specific extension to the `EventTarget` class that emulates the equivalent `EventEmitter` API. - // * The only difference between `addListener()` and `addEventListener()` is that addListener() will return a reference to the EventTarget. - // */ - // addListener(type: string, listener: EventListener | EventListenerObject, options?: { once: boolean }): this; - // /** Node.js-specific extension to the `EventTarget` class that returns an array of event `type` names for which event listeners are registered. */ - // eventNames(): string[]; - // /** Node.js-specific extension to the `EventTarget` class that returns the number of event listeners registered for the `type`. */ - // listenerCount(type: string): number; - // /** Node.js-specific alias for `eventTarget.removeListener()`. */ - // off(type: string, listener: EventListener | EventListenerObject): this; - // /** Node.js-specific alias for `eventTarget.addListener()`. */ - // on(type: string, listener: EventListener | EventListenerObject, options?: { once: boolean }): this; - // /** Node.js-specific extension to the `EventTarget` class that adds a `once` listener for the given event `type`. This is equivalent to calling `on` with the `once` option set to `true`. */ - // once(type: string, listener: EventListener | EventListenerObject): this; - // /** - // * Node.js-specific extension to the `EventTarget` class. - // * If `type` is specified, removes all registered listeners for `type`, - // * otherwise removes all registered listeners. - // */ - // removeAllListeners(type: string): this; - // /** - // * Node.js-specific extension to the `EventTarget` class that removes the listener for the given `type`. - // * The only difference between `removeListener()` and `removeEventListener()` is that `removeListener()` will return a reference to the `EventTarget`. - // */ - // removeListener(type: string, listener: EventListener | EventListenerObject): this; - // } - - interface EventEmitterOptions { - /** - * Enables automatic capturing of promise rejection. - */ - captureRejections?: boolean | undefined; - } - // Any EventTarget with a Node-style `once` function - interface _NodeEventTarget { - once(eventName: string | symbol, listener: (...args: any[]) => void): this; - } - // Any EventTarget with a DOM-style `addEventListener` - interface _DOMEventTarget { - addEventListener( - eventName: string, - listener: (...args: any[]) => void, - opts?: { - once: boolean; - } - ): any; - } - interface StaticEventEmitterOptions { - signal?: AbortSignal | undefined; - } - interface EventEmitter extends NodeJS.EventEmitter {} - /** - * The `EventEmitter` class is defined and exposed by the `events` module: - * - * ```js - * const EventEmitter = require('events'); - * ``` - * - * All `EventEmitter`s emit the event `'newListener'` when new listeners are - * added and `'removeListener'` when existing listeners are removed. - * - * It supports the following option: - * @since v0.1.26 - */ - class EventEmitter { - constructor(options?: EventEmitterOptions); - /** - * Creates a `Promise` that is fulfilled when the `EventEmitter` emits the given - * event or that is rejected if the `EventEmitter` emits `'error'` while waiting. - * The `Promise` will resolve with an array of all the arguments emitted to the - * given event. - * - * This method is intentionally generic and works with the web platform [EventTarget](https://dom.spec.whatwg.org/#interface-eventtarget) interface, which has no special`'error'` event - * semantics and does not listen to the `'error'` event. - * - * ```js - * const { once, EventEmitter } = require('events'); - * - * async function run() { - * const ee = new EventEmitter(); - * - * process.nextTick(() => { - * ee.emit('myevent', 42); - * }); - * - * const [value] = await once(ee, 'myevent'); - * console.log(value); - * - * const err = new Error('kaboom'); - * process.nextTick(() => { - * ee.emit('error', err); - * }); - * - * try { - * await once(ee, 'myevent'); - * } catch (err) { - * console.log('error happened', err); - * } - * } - * - * run(); - * ``` - * - * The special handling of the `'error'` event is only used when `events.once()`is used to wait for another event. If `events.once()` is used to wait for the - * '`error'` event itself, then it is treated as any other kind of event without - * special handling: - * - * ```js - * const { EventEmitter, once } = require('events'); - * - * const ee = new EventEmitter(); - * - * once(ee, 'error') - * .then(([err]) => console.log('ok', err.message)) - * .catch((err) => console.log('error', err.message)); - * - * ee.emit('error', new Error('boom')); - * - * // Prints: ok boom - * ``` - * - * An `AbortSignal` can be used to cancel waiting for the event: - * - * ```js - * const { EventEmitter, once } = require('events'); - * - * const ee = new EventEmitter(); - * const ac = new AbortController(); - * - * async function foo(emitter, event, signal) { - * try { - * await once(emitter, event, { signal }); - * console.log('event emitted!'); - * } catch (error) { - * if (error.name === 'AbortError') { - * console.error('Waiting for the event was canceled!'); - * } else { - * console.error('There was an error', error.message); - * } - * } - * } - * - * foo(ee, 'foo', ac.signal); - * ac.abort(); // Abort waiting for the event - * ee.emit('foo'); // Prints: Waiting for the event was canceled! - * ``` - * @since v11.13.0, v10.16.0 - */ - static once(emitter: _NodeEventTarget, eventName: string | symbol, options?: StaticEventEmitterOptions): Promise; - static once(emitter: _DOMEventTarget, eventName: string, options?: StaticEventEmitterOptions): Promise; - /** - * ```js - * const { on, EventEmitter } = require('events'); - * - * (async () => { - * const ee = new EventEmitter(); - * - * // Emit later on - * process.nextTick(() => { - * ee.emit('foo', 'bar'); - * ee.emit('foo', 42); - * }); - * - * for await (const event of on(ee, 'foo')) { - * // The execution of this inner block is synchronous and it - * // processes one event at a time (even with await). Do not use - * // if concurrent execution is required. - * console.log(event); // prints ['bar'] [42] - * } - * // Unreachable here - * })(); - * ``` - * - * Returns an `AsyncIterator` that iterates `eventName` events. It will throw - * if the `EventEmitter` emits `'error'`. It removes all listeners when - * exiting the loop. The `value` returned by each iteration is an array - * composed of the emitted event arguments. - * - * An `AbortSignal` can be used to cancel waiting on events: - * - * ```js - * const { on, EventEmitter } = require('events'); - * const ac = new AbortController(); - * - * (async () => { - * const ee = new EventEmitter(); - * - * // Emit later on - * process.nextTick(() => { - * ee.emit('foo', 'bar'); - * ee.emit('foo', 42); - * }); - * - * for await (const event of on(ee, 'foo', { signal: ac.signal })) { - * // The execution of this inner block is synchronous and it - * // processes one event at a time (even with await). Do not use - * // if concurrent execution is required. - * console.log(event); // prints ['bar'] [42] - * } - * // Unreachable here - * })(); - * - * process.nextTick(() => ac.abort()); - * ``` - * @since v13.6.0, v12.16.0 - * @param eventName The name of the event being listened for - * @return that iterates `eventName` events emitted by the `emitter` - */ - static on(emitter: NodeJS.EventEmitter, eventName: string, options?: StaticEventEmitterOptions): AsyncIterableIterator; - /** - * A class method that returns the number of listeners for the given `eventName`registered on the given `emitter`. - * - * ```js - * const { EventEmitter, listenerCount } = require('events'); - * const myEmitter = new EventEmitter(); - * myEmitter.on('event', () => {}); - * myEmitter.on('event', () => {}); - * console.log(listenerCount(myEmitter, 'event')); - * // Prints: 2 - * ``` - * @since v0.9.12 - * @deprecated Since v3.2.0 - Use `listenerCount` instead. - * @param emitter The emitter to query - * @param eventName The event name - */ - static listenerCount(emitter: NodeJS.EventEmitter, eventName: string | symbol): number; - /** - * Returns a copy of the array of listeners for the event named `eventName`. - * - * For `EventEmitter`s this behaves exactly the same as calling `.listeners` on - * the emitter. - * - * For `EventTarget`s this is the only way to get the event listeners for the - * event target. This is useful for debugging and diagnostic purposes. - * - * ```js - * const { getEventListeners, EventEmitter } = require('events'); - * - * { - * const ee = new EventEmitter(); - * const listener = () => console.log('Events are fun'); - * ee.on('foo', listener); - * getEventListeners(ee, 'foo'); // [listener] - * } - * { - * const et = new EventTarget(); - * const listener = () => console.log('Events are fun'); - * et.addEventListener('foo', listener); - * getEventListeners(et, 'foo'); // [listener] - * } - * ``` - * @since v15.2.0, v14.17.0 - */ - static getEventListeners(emitter: _DOMEventTarget | NodeJS.EventEmitter, name: string | symbol): Function[]; - /** - * ```js - * const { - * setMaxListeners, - * EventEmitter - * } = require('events'); - * - * const target = new EventTarget(); - * const emitter = new EventEmitter(); - * - * setMaxListeners(5, target, emitter); - * ``` - * @since v15.4.0 - * @param n A non-negative number. The maximum number of listeners per `EventTarget` event. - * @param eventsTargets Zero or more {EventTarget} or {EventEmitter} instances. If none are specified, `n` is set as the default max for all newly created {EventTarget} and {EventEmitter} - * objects. - */ - static setMaxListeners(n?: number, ...eventTargets: Array<_DOMEventTarget | NodeJS.EventEmitter>): void; - /** - * This symbol shall be used to install a listener for only monitoring `'error'` - * events. Listeners installed using this symbol are called before the regular - * `'error'` listeners are called. - * - * Installing a listener using this symbol does not change the behavior once an - * `'error'` event is emitted, therefore the process will still crash if no - * regular `'error'` listener is installed. - */ - static readonly errorMonitor: unique symbol; - static readonly captureRejectionSymbol: unique symbol; - /** - * Sets or gets the default captureRejection value for all emitters. - */ - // TODO: These should be described using static getter/setter pairs: - static captureRejections: boolean; - static defaultMaxListeners: number; - } - import internal = require('node:events'); - namespace EventEmitter { - // Should just be `export { EventEmitter }`, but that doesn't work in TypeScript 3.4 - export { internal as EventEmitter }; - export interface Abortable { - /** - * When provided the corresponding `AbortController` can be used to cancel an asynchronous action. - */ - signal?: AbortSignal | undefined; - } - } - global { - namespace NodeJS { - interface EventEmitter { - /** - * Alias for `emitter.on(eventName, listener)`. - * @since v0.1.26 - */ - addListener(eventName: string | symbol, listener: (...args: any[]) => void): this; - /** - * Adds the `listener` function to the end of the listeners array for the - * event named `eventName`. No checks are made to see if the `listener` has - * already been added. Multiple calls passing the same combination of `eventName`and `listener` will result in the `listener` being added, and called, multiple - * times. - * - * ```js - * server.on('connection', (stream) => { - * console.log('someone connected!'); - * }); - * ``` - * - * Returns a reference to the `EventEmitter`, so that calls can be chained. - * - * By default, event listeners are invoked in the order they are added. The`emitter.prependListener()` method can be used as an alternative to add the - * event listener to the beginning of the listeners array. - * - * ```js - * const myEE = new EventEmitter(); - * myEE.on('foo', () => console.log('a')); - * myEE.prependListener('foo', () => console.log('b')); - * myEE.emit('foo'); - * // Prints: - * // b - * // a - * ``` - * @since v0.1.101 - * @param eventName The name of the event. - * @param listener The callback function - */ - on(eventName: string | symbol, listener: (...args: any[]) => void): this; - /** - * Adds a **one-time**`listener` function for the event named `eventName`. The - * next time `eventName` is triggered, this listener is removed and then invoked. - * - * ```js - * server.once('connection', (stream) => { - * console.log('Ah, we have our first user!'); - * }); - * ``` - * - * Returns a reference to the `EventEmitter`, so that calls can be chained. - * - * By default, event listeners are invoked in the order they are added. The`emitter.prependOnceListener()` method can be used as an alternative to add the - * event listener to the beginning of the listeners array. - * - * ```js - * const myEE = new EventEmitter(); - * myEE.once('foo', () => console.log('a')); - * myEE.prependOnceListener('foo', () => console.log('b')); - * myEE.emit('foo'); - * // Prints: - * // b - * // a - * ``` - * @since v0.3.0 - * @param eventName The name of the event. - * @param listener The callback function - */ - once(eventName: string | symbol, listener: (...args: any[]) => void): this; - /** - * Removes the specified `listener` from the listener array for the event named`eventName`. - * - * ```js - * const callback = (stream) => { - * console.log('someone connected!'); - * }; - * server.on('connection', callback); - * // ... - * server.removeListener('connection', callback); - * ``` - * - * `removeListener()` will remove, at most, one instance of a listener from the - * listener array. If any single listener has been added multiple times to the - * listener array for the specified `eventName`, then `removeListener()` must be - * called multiple times to remove each instance. - * - * Once an event is emitted, all listeners attached to it at the - * time of emitting are called in order. This implies that any`removeListener()` or `removeAllListeners()` calls _after_ emitting and _before_ the last listener finishes execution - * will not remove them from`emit()` in progress. Subsequent events behave as expected. - * - * ```js - * const myEmitter = new MyEmitter(); - * - * const callbackA = () => { - * console.log('A'); - * myEmitter.removeListener('event', callbackB); - * }; - * - * const callbackB = () => { - * console.log('B'); - * }; - * - * myEmitter.on('event', callbackA); - * - * myEmitter.on('event', callbackB); - * - * // callbackA removes listener callbackB but it will still be called. - * // Internal listener array at time of emit [callbackA, callbackB] - * myEmitter.emit('event'); - * // Prints: - * // A - * // B - * - * // callbackB is now removed. - * // Internal listener array [callbackA] - * myEmitter.emit('event'); - * // Prints: - * // A - * ``` - * - * Because listeners are managed using an internal array, calling this will - * change the position indices of any listener registered _after_ the listener - * being removed. This will not impact the order in which listeners are called, - * but it means that any copies of the listener array as returned by - * the `emitter.listeners()` method will need to be recreated. - * - * When a single function has been added as a handler multiple times for a single - * event (as in the example below), `removeListener()` will remove the most - * recently added instance. In the example the `once('ping')`listener is removed: - * - * ```js - * const ee = new EventEmitter(); - * - * function pong() { - * console.log('pong'); - * } - * - * ee.on('ping', pong); - * ee.once('ping', pong); - * ee.removeListener('ping', pong); - * - * ee.emit('ping'); - * ee.emit('ping'); - * ``` - * - * Returns a reference to the `EventEmitter`, so that calls can be chained. - * @since v0.1.26 - */ - removeListener(eventName: string | symbol, listener: (...args: any[]) => void): this; - /** - * Alias for `emitter.removeListener()`. - * @since v10.0.0 - */ - off(eventName: string | symbol, listener: (...args: any[]) => void): this; - /** - * Removes all listeners, or those of the specified `eventName`. - * - * It is bad practice to remove listeners added elsewhere in the code, - * particularly when the `EventEmitter` instance was created by some other - * component or module (e.g. sockets or file streams). - * - * Returns a reference to the `EventEmitter`, so that calls can be chained. - * @since v0.1.26 - */ - removeAllListeners(event?: string | symbol): this; - /** - * By default `EventEmitter`s will print a warning if more than `10` listeners are - * added for a particular event. This is a useful default that helps finding - * memory leaks. The `emitter.setMaxListeners()` method allows the limit to be - * modified for this specific `EventEmitter` instance. The value can be set to`Infinity` (or `0`) to indicate an unlimited number of listeners. - * - * Returns a reference to the `EventEmitter`, so that calls can be chained. - * @since v0.3.5 - */ - setMaxListeners(n: number): this; - /** - * Returns the current max listener value for the `EventEmitter` which is either - * set by `emitter.setMaxListeners(n)` or defaults to {@link defaultMaxListeners}. - * @since v1.0.0 - */ - getMaxListeners(): number; - /** - * Returns a copy of the array of listeners for the event named `eventName`. - * - * ```js - * server.on('connection', (stream) => { - * console.log('someone connected!'); - * }); - * console.log(util.inspect(server.listeners('connection'))); - * // Prints: [ [Function] ] - * ``` - * @since v0.1.26 - */ - listeners(eventName: string | symbol): Function[]; - /** - * Returns a copy of the array of listeners for the event named `eventName`, - * including any wrappers (such as those created by `.once()`). - * - * ```js - * const emitter = new EventEmitter(); - * emitter.once('log', () => console.log('log once')); - * - * // Returns a new Array with a function `onceWrapper` which has a property - * // `listener` which contains the original listener bound above - * const listeners = emitter.rawListeners('log'); - * const logFnWrapper = listeners[0]; - * - * // Logs "log once" to the console and does not unbind the `once` event - * logFnWrapper.listener(); - * - * // Logs "log once" to the console and removes the listener - * logFnWrapper(); - * - * emitter.on('log', () => console.log('log persistently')); - * // Will return a new Array with a single function bound by `.on()` above - * const newListeners = emitter.rawListeners('log'); - * - * // Logs "log persistently" twice - * newListeners[0](); - * emitter.emit('log'); - * ``` - * @since v9.4.0 - */ - rawListeners(eventName: string | symbol): Function[]; - /** - * Synchronously calls each of the listeners registered for the event named`eventName`, in the order they were registered, passing the supplied arguments - * to each. - * - * Returns `true` if the event had listeners, `false` otherwise. - * - * ```js - * const EventEmitter = require('events'); - * const myEmitter = new EventEmitter(); - * - * // First listener - * myEmitter.on('event', function firstListener() { - * console.log('Helloooo! first listener'); - * }); - * // Second listener - * myEmitter.on('event', function secondListener(arg1, arg2) { - * console.log(`event with parameters ${arg1}, ${arg2} in second listener`); - * }); - * // Third listener - * myEmitter.on('event', function thirdListener(...args) { - * const parameters = args.join(', '); - * console.log(`event with parameters ${parameters} in third listener`); - * }); - * - * console.log(myEmitter.listeners('event')); - * - * myEmitter.emit('event', 1, 2, 3, 4, 5); - * - * // Prints: - * // [ - * // [Function: firstListener], - * // [Function: secondListener], - * // [Function: thirdListener] - * // ] - * // Helloooo! first listener - * // event with parameters 1, 2 in second listener - * // event with parameters 1, 2, 3, 4, 5 in third listener - * ``` - * @since v0.1.26 - */ - emit(eventName: string | symbol, ...args: any[]): boolean; - /** - * Returns the number of listeners listening to the event named `eventName`. - * @since v3.2.0 - * @param eventName The name of the event being listened for - */ - listenerCount(eventName: string | symbol): number; - /** - * Adds the `listener` function to the _beginning_ of the listeners array for the - * event named `eventName`. No checks are made to see if the `listener` has - * already been added. Multiple calls passing the same combination of `eventName`and `listener` will result in the `listener` being added, and called, multiple - * times. - * - * ```js - * server.prependListener('connection', (stream) => { - * console.log('someone connected!'); - * }); - * ``` - * - * Returns a reference to the `EventEmitter`, so that calls can be chained. - * @since v6.0.0 - * @param eventName The name of the event. - * @param listener The callback function - */ - prependListener(eventName: string | symbol, listener: (...args: any[]) => void): this; - /** - * Adds a **one-time**`listener` function for the event named `eventName` to the _beginning_ of the listeners array. The next time `eventName` is triggered, this - * listener is removed, and then invoked. - * - * ```js - * server.prependOnceListener('connection', (stream) => { - * console.log('Ah, we have our first user!'); - * }); - * ``` - * - * Returns a reference to the `EventEmitter`, so that calls can be chained. - * @since v6.0.0 - * @param eventName The name of the event. - * @param listener The callback function - */ - prependOnceListener(eventName: string | symbol, listener: (...args: any[]) => void): this; - /** - * Returns an array listing the events for which the emitter has registered - * listeners. The values in the array are strings or `Symbol`s. - * - * ```js - * const EventEmitter = require('events'); - * const myEE = new EventEmitter(); - * myEE.on('foo', () => {}); - * myEE.on('bar', () => {}); - * - * const sym = Symbol('symbol'); - * myEE.on(sym, () => {}); - * - * console.log(myEE.eventNames()); - * // Prints: [ 'foo', 'bar', Symbol(symbol) ] - * ``` - * @since v6.0.0 - */ - eventNames(): Array; - } - } - } - export = EventEmitter; -} -declare module 'node:events' { - import events = require('events'); - export = events; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/fs.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/fs.d.ts deleted file mode 100755 index 75c53fb0..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/fs.d.ts +++ /dev/null @@ -1,3872 +0,0 @@ -/** - * The `fs` module enables interacting with the file system in a - * way modeled on standard POSIX functions. - * - * To use the promise-based APIs: - * - * ```js - * import * as fs from 'fs/promises'; - * ``` - * - * To use the callback and sync APIs: - * - * ```js - * import * as fs from 'fs'; - * ``` - * - * All file system operations have synchronous, callback, and promise-based - * forms, and are accessible using both CommonJS syntax and ES6 Modules (ESM). - * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/fs.js) - */ -declare module 'fs' { - import * as stream from 'node:stream'; - import { Abortable, EventEmitter } from 'node:events'; - import { URL } from 'node:url'; - import * as promises from 'node:fs/promises'; - export { promises }; - /** - * Valid types for path values in "fs". - */ - export type PathLike = string | Buffer | URL; - export type PathOrFileDescriptor = PathLike | number; - export type TimeLike = string | number | Date; - export type NoParamCallback = (err: NodeJS.ErrnoException | null) => void; - export type BufferEncodingOption = - | 'buffer' - | { - encoding: 'buffer'; - }; - export interface ObjectEncodingOptions { - encoding?: BufferEncoding | null | undefined; - } - export type EncodingOption = ObjectEncodingOptions | BufferEncoding | undefined | null; - export type OpenMode = number | string; - export type Mode = number | string; - export interface StatsBase { - isFile(): boolean; - isDirectory(): boolean; - isBlockDevice(): boolean; - isCharacterDevice(): boolean; - isSymbolicLink(): boolean; - isFIFO(): boolean; - isSocket(): boolean; - dev: T; - ino: T; - mode: T; - nlink: T; - uid: T; - gid: T; - rdev: T; - size: T; - blksize: T; - blocks: T; - atimeMs: T; - mtimeMs: T; - ctimeMs: T; - birthtimeMs: T; - atime: Date; - mtime: Date; - ctime: Date; - birthtime: Date; - } - export interface Stats extends StatsBase {} - /** - * A `fs.Stats` object provides information about a file. - * - * Objects returned from {@link stat}, {@link lstat} and {@link fstat} and - * their synchronous counterparts are of this type. - * If `bigint` in the `options` passed to those methods is true, the numeric values - * will be `bigint` instead of `number`, and the object will contain additional - * nanosecond-precision properties suffixed with `Ns`. - * - * ```console - * Stats { - * dev: 2114, - * ino: 48064969, - * mode: 33188, - * nlink: 1, - * uid: 85, - * gid: 100, - * rdev: 0, - * size: 527, - * blksize: 4096, - * blocks: 8, - * atimeMs: 1318289051000.1, - * mtimeMs: 1318289051000.1, - * ctimeMs: 1318289051000.1, - * birthtimeMs: 1318289051000.1, - * atime: Mon, 10 Oct 2011 23:24:11 GMT, - * mtime: Mon, 10 Oct 2011 23:24:11 GMT, - * ctime: Mon, 10 Oct 2011 23:24:11 GMT, - * birthtime: Mon, 10 Oct 2011 23:24:11 GMT } - * ``` - * - * `bigint` version: - * - * ```console - * BigIntStats { - * dev: 2114n, - * ino: 48064969n, - * mode: 33188n, - * nlink: 1n, - * uid: 85n, - * gid: 100n, - * rdev: 0n, - * size: 527n, - * blksize: 4096n, - * blocks: 8n, - * atimeMs: 1318289051000n, - * mtimeMs: 1318289051000n, - * ctimeMs: 1318289051000n, - * birthtimeMs: 1318289051000n, - * atimeNs: 1318289051000000000n, - * mtimeNs: 1318289051000000000n, - * ctimeNs: 1318289051000000000n, - * birthtimeNs: 1318289051000000000n, - * atime: Mon, 10 Oct 2011 23:24:11 GMT, - * mtime: Mon, 10 Oct 2011 23:24:11 GMT, - * ctime: Mon, 10 Oct 2011 23:24:11 GMT, - * birthtime: Mon, 10 Oct 2011 23:24:11 GMT } - * ``` - * @since v0.1.21 - */ - export class Stats {} - /** - * A representation of a directory entry, which can be a file or a subdirectory - * within the directory, as returned by reading from an `fs.Dir`. The - * directory entry is a combination of the file name and file type pairs. - * - * Additionally, when {@link readdir} or {@link readdirSync} is called with - * the `withFileTypes` option set to `true`, the resulting array is filled with `fs.Dirent` objects, rather than strings or `Buffer` s. - * @since v10.10.0 - */ - export class Dirent { - /** - * Returns `true` if the `fs.Dirent` object describes a regular file. - * @since v10.10.0 - */ - isFile(): boolean; - /** - * Returns `true` if the `fs.Dirent` object describes a file system - * directory. - * @since v10.10.0 - */ - isDirectory(): boolean; - /** - * Returns `true` if the `fs.Dirent` object describes a block device. - * @since v10.10.0 - */ - isBlockDevice(): boolean; - /** - * Returns `true` if the `fs.Dirent` object describes a character device. - * @since v10.10.0 - */ - isCharacterDevice(): boolean; - /** - * Returns `true` if the `fs.Dirent` object describes a symbolic link. - * @since v10.10.0 - */ - isSymbolicLink(): boolean; - /** - * Returns `true` if the `fs.Dirent` object describes a first-in-first-out - * (FIFO) pipe. - * @since v10.10.0 - */ - isFIFO(): boolean; - /** - * Returns `true` if the `fs.Dirent` object describes a socket. - * @since v10.10.0 - */ - isSocket(): boolean; - /** - * The file name that this `fs.Dirent` object refers to. The type of this - * value is determined by the `options.encoding` passed to {@link readdir} or {@link readdirSync}. - * @since v10.10.0 - */ - name: string; - } - /** - * A class representing a directory stream. - * - * Created by {@link opendir}, {@link opendirSync}, or `fsPromises.opendir()`. - * - * ```js - * import { opendir } from 'fs/promises'; - * - * try { - * const dir = await opendir('./'); - * for await (const dirent of dir) - * console.log(dirent.name); - * } catch (err) { - * console.error(err); - * } - * ``` - * - * When using the async iterator, the `fs.Dir` object will be automatically - * closed after the iterator exits. - * @since v12.12.0 - */ - export class Dir implements AsyncIterable { - /** - * The read-only path of this directory as was provided to {@link opendir},{@link opendirSync}, or `fsPromises.opendir()`. - * @since v12.12.0 - */ - readonly path: string; - /** - * Asynchronously iterates over the directory via `readdir(3)` until all entries have been read. - */ - [Symbol.asyncIterator](): AsyncIterableIterator; - /** - * Asynchronously close the directory's underlying resource handle. - * Subsequent reads will result in errors. - * - * A promise is returned that will be resolved after the resource has been - * closed. - * @since v12.12.0 - */ - close(): Promise; - close(cb: NoParamCallback): void; - /** - * Synchronously close the directory's underlying resource handle. - * Subsequent reads will result in errors. - * @since v12.12.0 - */ - closeSync(): void; - /** - * Asynchronously read the next directory entry via [`readdir(3)`](http://man7.org/linux/man-pages/man3/readdir.3.html) as an `fs.Dirent`. - * - * A promise is returned that will be resolved with an `fs.Dirent`, or `null`if there are no more directory entries to read. - * - * Directory entries returned by this function are in no particular order as - * provided by the operating system's underlying directory mechanisms. - * Entries added or removed while iterating over the directory might not be - * included in the iteration results. - * @since v12.12.0 - * @return containing {fs.Dirent|null} - */ - read(): Promise; - read(cb: (err: NodeJS.ErrnoException | null, dirEnt: Dirent | null) => void): void; - /** - * Synchronously read the next directory entry as an `fs.Dirent`. See the - * POSIX [`readdir(3)`](http://man7.org/linux/man-pages/man3/readdir.3.html) documentation for more detail. - * - * If there are no more directory entries to read, `null` will be returned. - * - * Directory entries returned by this function are in no particular order as - * provided by the operating system's underlying directory mechanisms. - * Entries added or removed while iterating over the directory might not be - * included in the iteration results. - * @since v12.12.0 - */ - readSync(): Dirent | null; - } - /** - * Class: fs.StatWatcher - * @since v14.3.0, v12.20.0 - * Extends `EventEmitter` - * A successful call to {@link watchFile} method will return a new fs.StatWatcher object. - */ - export interface StatWatcher extends EventEmitter { - /** - * When called, requests that the Node.js event loop _not_ exit so long as the `fs.StatWatcher` is active. Calling `watcher.ref()` multiple times will have - * no effect. - * - * By default, all `fs.StatWatcher` objects are "ref'ed", making it normally - * unnecessary to call `watcher.ref()` unless `watcher.unref()` had been - * called previously. - * @since v14.3.0, v12.20.0 - */ - ref(): this; - /** - * When called, the active `fs.StatWatcher` object will not require the Node.js - * event loop to remain active. If there is no other activity keeping the - * event loop running, the process may exit before the `fs.StatWatcher` object's - * callback is invoked. Calling `watcher.unref()` multiple times will have - * no effect. - * @since v14.3.0, v12.20.0 - */ - unref(): this; - } - export interface FSWatcher extends EventEmitter { - /** - * Stop watching for changes on the given `fs.FSWatcher`. Once stopped, the `fs.FSWatcher` object is no longer usable. - * @since v0.5.8 - */ - close(): void; - /** - * events.EventEmitter - * 1. change - * 2. error - */ - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: 'change', listener: (eventType: string, filename: string | Buffer) => void): this; - addListener(event: 'error', listener: (error: Error) => void): this; - addListener(event: 'close', listener: () => void): this; - on(event: string, listener: (...args: any[]) => void): this; - on(event: 'change', listener: (eventType: string, filename: string | Buffer) => void): this; - on(event: 'error', listener: (error: Error) => void): this; - on(event: 'close', listener: () => void): this; - once(event: string, listener: (...args: any[]) => void): this; - once(event: 'change', listener: (eventType: string, filename: string | Buffer) => void): this; - once(event: 'error', listener: (error: Error) => void): this; - once(event: 'close', listener: () => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: 'change', listener: (eventType: string, filename: string | Buffer) => void): this; - prependListener(event: 'error', listener: (error: Error) => void): this; - prependListener(event: 'close', listener: () => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: 'change', listener: (eventType: string, filename: string | Buffer) => void): this; - prependOnceListener(event: 'error', listener: (error: Error) => void): this; - prependOnceListener(event: 'close', listener: () => void): this; - } - /** - * Instances of `fs.ReadStream` are created and returned using the {@link createReadStream} function. - * @since v0.1.93 - */ - export class ReadStream extends stream.Readable { - close(callback?: (err?: NodeJS.ErrnoException | null) => void): void; - /** - * The number of bytes that have been read so far. - * @since v6.4.0 - */ - bytesRead: number; - /** - * The path to the file the stream is reading from as specified in the first - * argument to `fs.createReadStream()`. If `path` is passed as a string, then`readStream.path` will be a string. If `path` is passed as a `Buffer`, then`readStream.path` will be a - * `Buffer`. If `fd` is specified, then`readStream.path` will be `undefined`. - * @since v0.1.93 - */ - path: string | Buffer; - /** - * This property is `true` if the underlying file has not been opened yet, - * i.e. before the `'ready'` event is emitted. - * @since v11.2.0, v10.16.0 - */ - pending: boolean; - /** - * events.EventEmitter - * 1. open - * 2. close - * 3. ready - */ - addListener(event: 'close', listener: () => void): this; - addListener(event: 'data', listener: (chunk: Buffer | string) => void): this; - addListener(event: 'end', listener: () => void): this; - addListener(event: 'error', listener: (err: Error) => void): this; - addListener(event: 'open', listener: (fd: number) => void): this; - addListener(event: 'pause', listener: () => void): this; - addListener(event: 'readable', listener: () => void): this; - addListener(event: 'ready', listener: () => void): this; - addListener(event: 'resume', listener: () => void): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - on(event: 'close', listener: () => void): this; - on(event: 'data', listener: (chunk: Buffer | string) => void): this; - on(event: 'end', listener: () => void): this; - on(event: 'error', listener: (err: Error) => void): this; - on(event: 'open', listener: (fd: number) => void): this; - on(event: 'pause', listener: () => void): this; - on(event: 'readable', listener: () => void): this; - on(event: 'ready', listener: () => void): this; - on(event: 'resume', listener: () => void): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once(event: 'close', listener: () => void): this; - once(event: 'data', listener: (chunk: Buffer | string) => void): this; - once(event: 'end', listener: () => void): this; - once(event: 'error', listener: (err: Error) => void): this; - once(event: 'open', listener: (fd: number) => void): this; - once(event: 'pause', listener: () => void): this; - once(event: 'readable', listener: () => void): this; - once(event: 'ready', listener: () => void): this; - once(event: 'resume', listener: () => void): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener(event: 'close', listener: () => void): this; - prependListener(event: 'data', listener: (chunk: Buffer | string) => void): this; - prependListener(event: 'end', listener: () => void): this; - prependListener(event: 'error', listener: (err: Error) => void): this; - prependListener(event: 'open', listener: (fd: number) => void): this; - prependListener(event: 'pause', listener: () => void): this; - prependListener(event: 'readable', listener: () => void): this; - prependListener(event: 'ready', listener: () => void): this; - prependListener(event: 'resume', listener: () => void): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - prependOnceListener(event: 'close', listener: () => void): this; - prependOnceListener(event: 'data', listener: (chunk: Buffer | string) => void): this; - prependOnceListener(event: 'end', listener: () => void): this; - prependOnceListener(event: 'error', listener: (err: Error) => void): this; - prependOnceListener(event: 'open', listener: (fd: number) => void): this; - prependOnceListener(event: 'pause', listener: () => void): this; - prependOnceListener(event: 'readable', listener: () => void): this; - prependOnceListener(event: 'ready', listener: () => void): this; - prependOnceListener(event: 'resume', listener: () => void): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - } - /** - * * Extends `stream.Writable` - * - * Instances of `fs.WriteStream` are created and returned using the {@link createWriteStream} function. - * @since v0.1.93 - */ - export class WriteStream extends stream.Writable { - /** - * Closes `writeStream`. Optionally accepts a - * callback that will be executed once the `writeStream`is closed. - * @since v0.9.4 - */ - close(callback?: (err?: NodeJS.ErrnoException | null) => void): void; - /** - * The number of bytes written so far. Does not include data that is still queued - * for writing. - * @since v0.4.7 - */ - bytesWritten: number; - /** - * The path to the file the stream is writing to as specified in the first - * argument to {@link createWriteStream}. If `path` is passed as a string, then`writeStream.path` will be a string. If `path` is passed as a `Buffer`, then`writeStream.path` will be a - * `Buffer`. - * @since v0.1.93 - */ - path: string | Buffer; - /** - * This property is `true` if the underlying file has not been opened yet, - * i.e. before the `'ready'` event is emitted. - * @since v11.2.0 - */ - pending: boolean; - /** - * events.EventEmitter - * 1. open - * 2. close - * 3. ready - */ - addListener(event: 'close', listener: () => void): this; - addListener(event: 'drain', listener: () => void): this; - addListener(event: 'error', listener: (err: Error) => void): this; - addListener(event: 'finish', listener: () => void): this; - addListener(event: 'open', listener: (fd: number) => void): this; - addListener(event: 'pipe', listener: (src: stream.Readable) => void): this; - addListener(event: 'ready', listener: () => void): this; - addListener(event: 'unpipe', listener: (src: stream.Readable) => void): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - on(event: 'close', listener: () => void): this; - on(event: 'drain', listener: () => void): this; - on(event: 'error', listener: (err: Error) => void): this; - on(event: 'finish', listener: () => void): this; - on(event: 'open', listener: (fd: number) => void): this; - on(event: 'pipe', listener: (src: stream.Readable) => void): this; - on(event: 'ready', listener: () => void): this; - on(event: 'unpipe', listener: (src: stream.Readable) => void): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once(event: 'close', listener: () => void): this; - once(event: 'drain', listener: () => void): this; - once(event: 'error', listener: (err: Error) => void): this; - once(event: 'finish', listener: () => void): this; - once(event: 'open', listener: (fd: number) => void): this; - once(event: 'pipe', listener: (src: stream.Readable) => void): this; - once(event: 'ready', listener: () => void): this; - once(event: 'unpipe', listener: (src: stream.Readable) => void): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener(event: 'close', listener: () => void): this; - prependListener(event: 'drain', listener: () => void): this; - prependListener(event: 'error', listener: (err: Error) => void): this; - prependListener(event: 'finish', listener: () => void): this; - prependListener(event: 'open', listener: (fd: number) => void): this; - prependListener(event: 'pipe', listener: (src: stream.Readable) => void): this; - prependListener(event: 'ready', listener: () => void): this; - prependListener(event: 'unpipe', listener: (src: stream.Readable) => void): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - prependOnceListener(event: 'close', listener: () => void): this; - prependOnceListener(event: 'drain', listener: () => void): this; - prependOnceListener(event: 'error', listener: (err: Error) => void): this; - prependOnceListener(event: 'finish', listener: () => void): this; - prependOnceListener(event: 'open', listener: (fd: number) => void): this; - prependOnceListener(event: 'pipe', listener: (src: stream.Readable) => void): this; - prependOnceListener(event: 'ready', listener: () => void): this; - prependOnceListener(event: 'unpipe', listener: (src: stream.Readable) => void): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - } - /** - * Asynchronously rename file at `oldPath` to the pathname provided - * as `newPath`. In the case that `newPath` already exists, it will - * be overwritten. If there is a directory at `newPath`, an error will - * be raised instead. No arguments other than a possible exception are - * given to the completion callback. - * - * See also: [`rename(2)`](http://man7.org/linux/man-pages/man2/rename.2.html). - * - * ```js - * import { rename } from 'fs'; - * - * rename('oldFile.txt', 'newFile.txt', (err) => { - * if (err) throw err; - * console.log('Rename complete!'); - * }); - * ``` - * @since v0.0.2 - */ - export function rename(oldPath: PathLike, newPath: PathLike, callback: NoParamCallback): void; - export namespace rename { - /** - * Asynchronous rename(2) - Change the name or location of a file or directory. - * @param oldPath A path to a file. If a URL is provided, it must use the `file:` protocol. - * URL support is _experimental_. - * @param newPath A path to a file. If a URL is provided, it must use the `file:` protocol. - * URL support is _experimental_. - */ - function __promisify__(oldPath: PathLike, newPath: PathLike): Promise; - } - /** - * Renames the file from `oldPath` to `newPath`. Returns `undefined`. - * - * See the POSIX [`rename(2)`](http://man7.org/linux/man-pages/man2/rename.2.html) documentation for more details. - * @since v0.1.21 - */ - export function renameSync(oldPath: PathLike, newPath: PathLike): void; - /** - * Truncates the file. No arguments other than a possible exception are - * given to the completion callback. A file descriptor can also be passed as the - * first argument. In this case, `fs.ftruncate()` is called. - * - * ```js - * import { truncate } from 'fs'; - * // Assuming that 'path/file.txt' is a regular file. - * truncate('path/file.txt', (err) => { - * if (err) throw err; - * console.log('path/file.txt was truncated'); - * }); - * ``` - * - * Passing a file descriptor is deprecated and may result in an error being thrown - * in the future. - * - * See the POSIX [`truncate(2)`](http://man7.org/linux/man-pages/man2/truncate.2.html) documentation for more details. - * @since v0.8.6 - * @param [len=0] - */ - export function truncate(path: PathLike, len: number | undefined | null, callback: NoParamCallback): void; - /** - * Asynchronous truncate(2) - Truncate a file to a specified length. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - export function truncate(path: PathLike, callback: NoParamCallback): void; - export namespace truncate { - /** - * Asynchronous truncate(2) - Truncate a file to a specified length. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param len If not specified, defaults to `0`. - */ - function __promisify__(path: PathLike, len?: number | null): Promise; - } - /** - * Truncates the file. Returns `undefined`. A file descriptor can also be - * passed as the first argument. In this case, `fs.ftruncateSync()` is called. - * - * Passing a file descriptor is deprecated and may result in an error being thrown - * in the future. - * @since v0.8.6 - * @param [len=0] - */ - export function truncateSync(path: PathLike, len?: number | null): void; - /** - * Truncates the file descriptor. No arguments other than a possible exception are - * given to the completion callback. - * - * See the POSIX [`ftruncate(2)`](http://man7.org/linux/man-pages/man2/ftruncate.2.html) documentation for more detail. - * - * If the file referred to by the file descriptor was larger than `len` bytes, only - * the first `len` bytes will be retained in the file. - * - * For example, the following program retains only the first four bytes of the - * file: - * - * ```js - * import { open, close, ftruncate } from 'fs'; - * - * function closeFd(fd) { - * close(fd, (err) => { - * if (err) throw err; - * }); - * } - * - * open('temp.txt', 'r+', (err, fd) => { - * if (err) throw err; - * - * try { - * ftruncate(fd, 4, (err) => { - * closeFd(fd); - * if (err) throw err; - * }); - * } catch (err) { - * closeFd(fd); - * if (err) throw err; - * } - * }); - * ``` - * - * If the file previously was shorter than `len` bytes, it is extended, and the - * extended part is filled with null bytes (`'\0'`): - * - * If `len` is negative then `0` will be used. - * @since v0.8.6 - * @param [len=0] - */ - export function ftruncate(fd: number, len: number | undefined | null, callback: NoParamCallback): void; - /** - * Asynchronous ftruncate(2) - Truncate a file to a specified length. - * @param fd A file descriptor. - */ - export function ftruncate(fd: number, callback: NoParamCallback): void; - export namespace ftruncate { - /** - * Asynchronous ftruncate(2) - Truncate a file to a specified length. - * @param fd A file descriptor. - * @param len If not specified, defaults to `0`. - */ - function __promisify__(fd: number, len?: number | null): Promise; - } - /** - * Truncates the file descriptor. Returns `undefined`. - * - * For detailed information, see the documentation of the asynchronous version of - * this API: {@link ftruncate}. - * @since v0.8.6 - * @param [len=0] - */ - export function ftruncateSync(fd: number, len?: number | null): void; - /** - * Asynchronously changes owner and group of a file. No arguments other than a - * possible exception are given to the completion callback. - * - * See the POSIX [`chown(2)`](http://man7.org/linux/man-pages/man2/chown.2.html) documentation for more detail. - * @since v0.1.97 - */ - export function chown(path: PathLike, uid: number, gid: number, callback: NoParamCallback): void; - export namespace chown { - /** - * Asynchronous chown(2) - Change ownership of a file. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - function __promisify__(path: PathLike, uid: number, gid: number): Promise; - } - /** - * Synchronously changes owner and group of a file. Returns `undefined`. - * This is the synchronous version of {@link chown}. - * - * See the POSIX [`chown(2)`](http://man7.org/linux/man-pages/man2/chown.2.html) documentation for more detail. - * @since v0.1.97 - */ - export function chownSync(path: PathLike, uid: number, gid: number): void; - /** - * Sets the owner of the file. No arguments other than a possible exception are - * given to the completion callback. - * - * See the POSIX [`fchown(2)`](http://man7.org/linux/man-pages/man2/fchown.2.html) documentation for more detail. - * @since v0.4.7 - */ - export function fchown(fd: number, uid: number, gid: number, callback: NoParamCallback): void; - export namespace fchown { - /** - * Asynchronous fchown(2) - Change ownership of a file. - * @param fd A file descriptor. - */ - function __promisify__(fd: number, uid: number, gid: number): Promise; - } - /** - * Sets the owner of the file. Returns `undefined`. - * - * See the POSIX [`fchown(2)`](http://man7.org/linux/man-pages/man2/fchown.2.html) documentation for more detail. - * @since v0.4.7 - * @param uid The file's new owner's user id. - * @param gid The file's new group's group id. - */ - export function fchownSync(fd: number, uid: number, gid: number): void; - /** - * Set the owner of the symbolic link. No arguments other than a possible - * exception are given to the completion callback. - * - * See the POSIX [`lchown(2)`](http://man7.org/linux/man-pages/man2/lchown.2.html) documentation for more detail. - */ - export function lchown(path: PathLike, uid: number, gid: number, callback: NoParamCallback): void; - export namespace lchown { - /** - * Asynchronous lchown(2) - Change ownership of a file. Does not dereference symbolic links. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - function __promisify__(path: PathLike, uid: number, gid: number): Promise; - } - /** - * Set the owner for the path. Returns `undefined`. - * - * See the POSIX [`lchown(2)`](http://man7.org/linux/man-pages/man2/lchown.2.html) documentation for more details. - * @param uid The file's new owner's user id. - * @param gid The file's new group's group id. - */ - export function lchownSync(path: PathLike, uid: number, gid: number): void; - /** - * Changes the access and modification times of a file in the same way as {@link utimes}, with the difference that if the path refers to a symbolic - * link, then the link is not dereferenced: instead, the timestamps of the - * symbolic link itself are changed. - * - * No arguments other than a possible exception are given to the completion - * callback. - * @since v14.5.0, v12.19.0 - */ - export function lutimes(path: PathLike, atime: TimeLike, mtime: TimeLike, callback: NoParamCallback): void; - export namespace lutimes { - /** - * Changes the access and modification times of a file in the same way as `fsPromises.utimes()`, - * with the difference that if the path refers to a symbolic link, then the link is not - * dereferenced: instead, the timestamps of the symbolic link itself are changed. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param atime The last access time. If a string is provided, it will be coerced to number. - * @param mtime The last modified time. If a string is provided, it will be coerced to number. - */ - function __promisify__(path: PathLike, atime: TimeLike, mtime: TimeLike): Promise; - } - /** - * Change the file system timestamps of the symbolic link referenced by `path`. - * Returns `undefined`, or throws an exception when parameters are incorrect or - * the operation fails. This is the synchronous version of {@link lutimes}. - * @since v14.5.0, v12.19.0 - */ - export function lutimesSync(path: PathLike, atime: TimeLike, mtime: TimeLike): void; - /** - * Asynchronously changes the permissions of a file. No arguments other than a - * possible exception are given to the completion callback. - * - * See the POSIX [`chmod(2)`](http://man7.org/linux/man-pages/man2/chmod.2.html) documentation for more detail. - * - * ```js - * import { chmod } from 'fs'; - * - * chmod('my_file.txt', 0o775, (err) => { - * if (err) throw err; - * console.log('The permissions for file "my_file.txt" have been changed!'); - * }); - * ``` - * @since v0.1.30 - */ - export function chmod(path: PathLike, mode: Mode, callback: NoParamCallback): void; - export namespace chmod { - /** - * Asynchronous chmod(2) - Change permissions of a file. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param mode A file mode. If a string is passed, it is parsed as an octal integer. - */ - function __promisify__(path: PathLike, mode: Mode): Promise; - } - /** - * For detailed information, see the documentation of the asynchronous version of - * this API: {@link chmod}. - * - * See the POSIX [`chmod(2)`](http://man7.org/linux/man-pages/man2/chmod.2.html) documentation for more detail. - * @since v0.6.7 - */ - export function chmodSync(path: PathLike, mode: Mode): void; - /** - * Sets the permissions on the file. No arguments other than a possible exception - * are given to the completion callback. - * - * See the POSIX [`fchmod(2)`](http://man7.org/linux/man-pages/man2/fchmod.2.html) documentation for more detail. - * @since v0.4.7 - */ - export function fchmod(fd: number, mode: Mode, callback: NoParamCallback): void; - export namespace fchmod { - /** - * Asynchronous fchmod(2) - Change permissions of a file. - * @param fd A file descriptor. - * @param mode A file mode. If a string is passed, it is parsed as an octal integer. - */ - function __promisify__(fd: number, mode: Mode): Promise; - } - /** - * Sets the permissions on the file. Returns `undefined`. - * - * See the POSIX [`fchmod(2)`](http://man7.org/linux/man-pages/man2/fchmod.2.html) documentation for more detail. - * @since v0.4.7 - */ - export function fchmodSync(fd: number, mode: Mode): void; - /** - * Changes the permissions on a symbolic link. No arguments other than a possible - * exception are given to the completion callback. - * - * This method is only implemented on macOS. - * - * See the POSIX [`lchmod(2)`](https://www.freebsd.org/cgi/man.cgi?query=lchmod&sektion=2) documentation for more detail. - * @deprecated Since v0.4.7 - */ - export function lchmod(path: PathLike, mode: Mode, callback: NoParamCallback): void; - /** @deprecated */ - export namespace lchmod { - /** - * Asynchronous lchmod(2) - Change permissions of a file. Does not dereference symbolic links. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param mode A file mode. If a string is passed, it is parsed as an octal integer. - */ - function __promisify__(path: PathLike, mode: Mode): Promise; - } - /** - * Changes the permissions on a symbolic link. Returns `undefined`. - * - * This method is only implemented on macOS. - * - * See the POSIX [`lchmod(2)`](https://www.freebsd.org/cgi/man.cgi?query=lchmod&sektion=2) documentation for more detail. - * @deprecated Since v0.4.7 - */ - export function lchmodSync(path: PathLike, mode: Mode): void; - /** - * Asynchronous [`stat(2)`](http://man7.org/linux/man-pages/man2/stat.2.html). The callback gets two arguments `(err, stats)` where`stats` is an `fs.Stats` object. - * - * In case of an error, the `err.code` will be one of `Common System Errors`. - * - * Using `fs.stat()` to check for the existence of a file before calling`fs.open()`, `fs.readFile()` or `fs.writeFile()` is not recommended. - * Instead, user code should open/read/write the file directly and handle the - * error raised if the file is not available. - * - * To check if a file exists without manipulating it afterwards, {@link access} is recommended. - * - * For example, given the following directory structure: - * - * ```text - * - txtDir - * -- file.txt - * - app.js - * ``` - * - * The next program will check for the stats of the given paths: - * - * ```js - * import { stat } from 'fs'; - * - * const pathsToCheck = ['./txtDir', './txtDir/file.txt']; - * - * for (let i = 0; i < pathsToCheck.length; i++) { - * stat(pathsToCheck[i], (err, stats) => { - * console.log(stats.isDirectory()); - * console.log(stats); - * }); - * } - * ``` - * - * The resulting output will resemble: - * - * ```console - * true - * Stats { - * dev: 16777220, - * mode: 16877, - * nlink: 3, - * uid: 501, - * gid: 20, - * rdev: 0, - * blksize: 4096, - * ino: 14214262, - * size: 96, - * blocks: 0, - * atimeMs: 1561174653071.963, - * mtimeMs: 1561174614583.3518, - * ctimeMs: 1561174626623.5366, - * birthtimeMs: 1561174126937.2893, - * atime: 2019-06-22T03:37:33.072Z, - * mtime: 2019-06-22T03:36:54.583Z, - * ctime: 2019-06-22T03:37:06.624Z, - * birthtime: 2019-06-22T03:28:46.937Z - * } - * false - * Stats { - * dev: 16777220, - * mode: 33188, - * nlink: 1, - * uid: 501, - * gid: 20, - * rdev: 0, - * blksize: 4096, - * ino: 14214074, - * size: 8, - * blocks: 8, - * atimeMs: 1561174616618.8555, - * mtimeMs: 1561174614584, - * ctimeMs: 1561174614583.8145, - * birthtimeMs: 1561174007710.7478, - * atime: 2019-06-22T03:36:56.619Z, - * mtime: 2019-06-22T03:36:54.584Z, - * ctime: 2019-06-22T03:36:54.584Z, - * birthtime: 2019-06-22T03:26:47.711Z - * } - * ``` - * @since v0.0.2 - */ - export function stat(path: PathLike, callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void): void; - export function stat( - path: PathLike, - options: - | (StatOptions & { - bigint?: false | undefined; - }) - | undefined, - callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void - ): void; - export function stat( - path: PathLike, - options: StatOptions & { - bigint: true; - }, - callback: (err: NodeJS.ErrnoException | null, stats: BigIntStats) => void - ): void; - export function stat(path: PathLike, options: StatOptions | undefined, callback: (err: NodeJS.ErrnoException | null, stats: Stats | BigIntStats) => void): void; - export namespace stat { - /** - * Asynchronous stat(2) - Get file status. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - function __promisify__( - path: PathLike, - options?: StatOptions & { - bigint?: false | undefined; - } - ): Promise; - function __promisify__( - path: PathLike, - options: StatOptions & { - bigint: true; - } - ): Promise; - function __promisify__(path: PathLike, options?: StatOptions): Promise; - } - export interface StatSyncFn extends Function { - (path: PathLike, options?: undefined): Stats; - ( - path: PathLike, - options?: StatSyncOptions & { - bigint?: false | undefined; - throwIfNoEntry: false; - } - ): Stats | undefined; - ( - path: PathLike, - options: StatSyncOptions & { - bigint: true; - throwIfNoEntry: false; - } - ): BigIntStats | undefined; - ( - path: PathLike, - options?: StatSyncOptions & { - bigint?: false | undefined; - } - ): Stats; - ( - path: PathLike, - options: StatSyncOptions & { - bigint: true; - } - ): BigIntStats; - ( - path: PathLike, - options: StatSyncOptions & { - bigint: boolean; - throwIfNoEntry?: false | undefined; - } - ): Stats | BigIntStats; - (path: PathLike, options?: StatSyncOptions): Stats | BigIntStats | undefined; - } - /** - * Synchronous stat(2) - Get file status. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - export const statSync: StatSyncFn; - /** - * Invokes the callback with the `fs.Stats` for the file descriptor. - * - * See the POSIX [`fstat(2)`](http://man7.org/linux/man-pages/man2/fstat.2.html) documentation for more detail. - * @since v0.1.95 - */ - export function fstat(fd: number, callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void): void; - export function fstat( - fd: number, - options: - | (StatOptions & { - bigint?: false | undefined; - }) - | undefined, - callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void - ): void; - export function fstat( - fd: number, - options: StatOptions & { - bigint: true; - }, - callback: (err: NodeJS.ErrnoException | null, stats: BigIntStats) => void - ): void; - export function fstat(fd: number, options: StatOptions | undefined, callback: (err: NodeJS.ErrnoException | null, stats: Stats | BigIntStats) => void): void; - export namespace fstat { - /** - * Asynchronous fstat(2) - Get file status. - * @param fd A file descriptor. - */ - function __promisify__( - fd: number, - options?: StatOptions & { - bigint?: false | undefined; - } - ): Promise; - function __promisify__( - fd: number, - options: StatOptions & { - bigint: true; - } - ): Promise; - function __promisify__(fd: number, options?: StatOptions): Promise; - } - /** - * Retrieves the `fs.Stats` for the file descriptor. - * - * See the POSIX [`fstat(2)`](http://man7.org/linux/man-pages/man2/fstat.2.html) documentation for more detail. - * @since v0.1.95 - */ - export function fstatSync( - fd: number, - options?: StatOptions & { - bigint?: false | undefined; - } - ): Stats; - export function fstatSync( - fd: number, - options: StatOptions & { - bigint: true; - } - ): BigIntStats; - export function fstatSync(fd: number, options?: StatOptions): Stats | BigIntStats; - /** - * Retrieves the `fs.Stats` for the symbolic link referred to by the path. - * The callback gets two arguments `(err, stats)` where `stats` is a `fs.Stats` object. `lstat()` is identical to `stat()`, except that if `path` is a symbolic - * link, then the link itself is stat-ed, not the file that it refers to. - * - * See the POSIX [`lstat(2)`](http://man7.org/linux/man-pages/man2/lstat.2.html) documentation for more details. - * @since v0.1.30 - */ - export function lstat(path: PathLike, callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void): void; - export function lstat( - path: PathLike, - options: - | (StatOptions & { - bigint?: false | undefined; - }) - | undefined, - callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void - ): void; - export function lstat( - path: PathLike, - options: StatOptions & { - bigint: true; - }, - callback: (err: NodeJS.ErrnoException | null, stats: BigIntStats) => void - ): void; - export function lstat(path: PathLike, options: StatOptions | undefined, callback: (err: NodeJS.ErrnoException | null, stats: Stats | BigIntStats) => void): void; - export namespace lstat { - /** - * Asynchronous lstat(2) - Get file status. Does not dereference symbolic links. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - function __promisify__( - path: PathLike, - options?: StatOptions & { - bigint?: false | undefined; - } - ): Promise; - function __promisify__( - path: PathLike, - options: StatOptions & { - bigint: true; - } - ): Promise; - function __promisify__(path: PathLike, options?: StatOptions): Promise; - } - /** - * Synchronous lstat(2) - Get file status. Does not dereference symbolic links. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - export const lstatSync: StatSyncFn; - /** - * Creates a new link from the `existingPath` to the `newPath`. See the POSIX [`link(2)`](http://man7.org/linux/man-pages/man2/link.2.html) documentation for more detail. No arguments other than - * a possible - * exception are given to the completion callback. - * @since v0.1.31 - */ - export function link(existingPath: PathLike, newPath: PathLike, callback: NoParamCallback): void; - export namespace link { - /** - * Asynchronous link(2) - Create a new link (also known as a hard link) to an existing file. - * @param existingPath A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param newPath A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - function __promisify__(existingPath: PathLike, newPath: PathLike): Promise; - } - /** - * Creates a new link from the `existingPath` to the `newPath`. See the POSIX [`link(2)`](http://man7.org/linux/man-pages/man2/link.2.html) documentation for more detail. Returns `undefined`. - * @since v0.1.31 - */ - export function linkSync(existingPath: PathLike, newPath: PathLike): void; - /** - * Creates the link called `path` pointing to `target`. No arguments other than a - * possible exception are given to the completion callback. - * - * See the POSIX [`symlink(2)`](http://man7.org/linux/man-pages/man2/symlink.2.html) documentation for more details. - * - * The `type` argument is only available on Windows and ignored on other platforms. - * It can be set to `'dir'`, `'file'`, or `'junction'`. If the `type` argument is - * not set, Node.js will autodetect `target` type and use `'file'` or `'dir'`. If - * the `target` does not exist, `'file'` will be used. Windows junction points - * require the destination path to be absolute. When using `'junction'`, the`target` argument will automatically be normalized to absolute path. - * - * Relative targets are relative to the link’s parent directory. - * - * ```js - * import { symlink } from 'fs'; - * - * symlink('./mew', './mewtwo', callback); - * ``` - * - * The above example creates a symbolic link `mewtwo` which points to `mew` in the - * same directory: - * - * ```bash - * $ tree . - * . - * ├── mew - * └── mewtwo -> ./mew - * ``` - * @since v0.1.31 - */ - export function symlink(target: PathLike, path: PathLike, type: symlink.Type | undefined | null, callback: NoParamCallback): void; - /** - * Asynchronous symlink(2) - Create a new symbolic link to an existing file. - * @param target A path to an existing file. If a URL is provided, it must use the `file:` protocol. - * @param path A path to the new symlink. If a URL is provided, it must use the `file:` protocol. - */ - export function symlink(target: PathLike, path: PathLike, callback: NoParamCallback): void; - export namespace symlink { - /** - * Asynchronous symlink(2) - Create a new symbolic link to an existing file. - * @param target A path to an existing file. If a URL is provided, it must use the `file:` protocol. - * @param path A path to the new symlink. If a URL is provided, it must use the `file:` protocol. - * @param type May be set to `'dir'`, `'file'`, or `'junction'` (default is `'file'`) and is only available on Windows (ignored on other platforms). - * When using `'junction'`, the `target` argument will automatically be normalized to an absolute path. - */ - function __promisify__(target: PathLike, path: PathLike, type?: string | null): Promise; - type Type = 'dir' | 'file' | 'junction'; - } - /** - * Returns `undefined`. - * - * For detailed information, see the documentation of the asynchronous version of - * this API: {@link symlink}. - * @since v0.1.31 - */ - export function symlinkSync(target: PathLike, path: PathLike, type?: symlink.Type | null): void; - /** - * Reads the contents of the symbolic link referred to by `path`. The callback gets - * two arguments `(err, linkString)`. - * - * See the POSIX [`readlink(2)`](http://man7.org/linux/man-pages/man2/readlink.2.html) documentation for more details. - * - * The optional `options` argument can be a string specifying an encoding, or an - * object with an `encoding` property specifying the character encoding to use for - * the link path passed to the callback. If the `encoding` is set to `'buffer'`, - * the link path returned will be passed as a `Buffer` object. - * @since v0.1.31 - */ - export function readlink(path: PathLike, options: EncodingOption, callback: (err: NodeJS.ErrnoException | null, linkString: string) => void): void; - /** - * Asynchronous readlink(2) - read value of a symbolic link. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function readlink(path: PathLike, options: BufferEncodingOption, callback: (err: NodeJS.ErrnoException | null, linkString: Buffer) => void): void; - /** - * Asynchronous readlink(2) - read value of a symbolic link. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function readlink(path: PathLike, options: EncodingOption, callback: (err: NodeJS.ErrnoException | null, linkString: string | Buffer) => void): void; - /** - * Asynchronous readlink(2) - read value of a symbolic link. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - export function readlink(path: PathLike, callback: (err: NodeJS.ErrnoException | null, linkString: string) => void): void; - export namespace readlink { - /** - * Asynchronous readlink(2) - read value of a symbolic link. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function __promisify__(path: PathLike, options?: EncodingOption): Promise; - /** - * Asynchronous readlink(2) - read value of a symbolic link. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function __promisify__(path: PathLike, options: BufferEncodingOption): Promise; - /** - * Asynchronous readlink(2) - read value of a symbolic link. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function __promisify__(path: PathLike, options?: EncodingOption): Promise; - } - /** - * Returns the symbolic link's string value. - * - * See the POSIX [`readlink(2)`](http://man7.org/linux/man-pages/man2/readlink.2.html) documentation for more details. - * - * The optional `options` argument can be a string specifying an encoding, or an - * object with an `encoding` property specifying the character encoding to use for - * the link path returned. If the `encoding` is set to `'buffer'`, - * the link path returned will be passed as a `Buffer` object. - * @since v0.1.31 - */ - export function readlinkSync(path: PathLike, options?: EncodingOption): string; - /** - * Synchronous readlink(2) - read value of a symbolic link. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function readlinkSync(path: PathLike, options: BufferEncodingOption): Buffer; - /** - * Synchronous readlink(2) - read value of a symbolic link. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function readlinkSync(path: PathLike, options?: EncodingOption): string | Buffer; - /** - * Asynchronously computes the canonical pathname by resolving `.`, `..` and - * symbolic links. - * - * A canonical pathname is not necessarily unique. Hard links and bind mounts can - * expose a file system entity through many pathnames. - * - * This function behaves like [`realpath(3)`](http://man7.org/linux/man-pages/man3/realpath.3.html), with some exceptions: - * - * 1. No case conversion is performed on case-insensitive file systems. - * 2. The maximum number of symbolic links is platform-independent and generally - * (much) higher than what the native [`realpath(3)`](http://man7.org/linux/man-pages/man3/realpath.3.html) implementation supports. - * - * The `callback` gets two arguments `(err, resolvedPath)`. May use `process.cwd`to resolve relative paths. - * - * Only paths that can be converted to UTF8 strings are supported. - * - * The optional `options` argument can be a string specifying an encoding, or an - * object with an `encoding` property specifying the character encoding to use for - * the path passed to the callback. If the `encoding` is set to `'buffer'`, - * the path returned will be passed as a `Buffer` object. - * - * If `path` resolves to a socket or a pipe, the function will return a system - * dependent name for that object. - * @since v0.1.31 - */ - export function realpath(path: PathLike, options: EncodingOption, callback: (err: NodeJS.ErrnoException | null, resolvedPath: string) => void): void; - /** - * Asynchronous realpath(3) - return the canonicalized absolute pathname. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function realpath(path: PathLike, options: BufferEncodingOption, callback: (err: NodeJS.ErrnoException | null, resolvedPath: Buffer) => void): void; - /** - * Asynchronous realpath(3) - return the canonicalized absolute pathname. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function realpath(path: PathLike, options: EncodingOption, callback: (err: NodeJS.ErrnoException | null, resolvedPath: string | Buffer) => void): void; - /** - * Asynchronous realpath(3) - return the canonicalized absolute pathname. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - export function realpath(path: PathLike, callback: (err: NodeJS.ErrnoException | null, resolvedPath: string) => void): void; - export namespace realpath { - /** - * Asynchronous realpath(3) - return the canonicalized absolute pathname. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function __promisify__(path: PathLike, options?: EncodingOption): Promise; - /** - * Asynchronous realpath(3) - return the canonicalized absolute pathname. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function __promisify__(path: PathLike, options: BufferEncodingOption): Promise; - /** - * Asynchronous realpath(3) - return the canonicalized absolute pathname. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function __promisify__(path: PathLike, options?: EncodingOption): Promise; - /** - * Asynchronous [`realpath(3)`](http://man7.org/linux/man-pages/man3/realpath.3.html). - * - * The `callback` gets two arguments `(err, resolvedPath)`. - * - * Only paths that can be converted to UTF8 strings are supported. - * - * The optional `options` argument can be a string specifying an encoding, or an - * object with an `encoding` property specifying the character encoding to use for - * the path passed to the callback. If the `encoding` is set to `'buffer'`, - * the path returned will be passed as a `Buffer` object. - * - * On Linux, when Node.js is linked against musl libc, the procfs file system must - * be mounted on `/proc` in order for this function to work. Glibc does not have - * this restriction. - * @since v9.2.0 - */ - function native(path: PathLike, options: EncodingOption, callback: (err: NodeJS.ErrnoException | null, resolvedPath: string) => void): void; - function native(path: PathLike, options: BufferEncodingOption, callback: (err: NodeJS.ErrnoException | null, resolvedPath: Buffer) => void): void; - function native(path: PathLike, options: EncodingOption, callback: (err: NodeJS.ErrnoException | null, resolvedPath: string | Buffer) => void): void; - function native(path: PathLike, callback: (err: NodeJS.ErrnoException | null, resolvedPath: string) => void): void; - } - /** - * Returns the resolved pathname. - * - * For detailed information, see the documentation of the asynchronous version of - * this API: {@link realpath}. - * @since v0.1.31 - */ - export function realpathSync(path: PathLike, options?: EncodingOption): string; - /** - * Synchronous realpath(3) - return the canonicalized absolute pathname. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function realpathSync(path: PathLike, options: BufferEncodingOption): Buffer; - /** - * Synchronous realpath(3) - return the canonicalized absolute pathname. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function realpathSync(path: PathLike, options?: EncodingOption): string | Buffer; - export namespace realpathSync { - function native(path: PathLike, options?: EncodingOption): string; - function native(path: PathLike, options: BufferEncodingOption): Buffer; - function native(path: PathLike, options?: EncodingOption): string | Buffer; - } - /** - * Asynchronously removes a file or symbolic link. No arguments other than a - * possible exception are given to the completion callback. - * - * ```js - * import { unlink } from 'fs'; - * // Assuming that 'path/file.txt' is a regular file. - * unlink('path/file.txt', (err) => { - * if (err) throw err; - * console.log('path/file.txt was deleted'); - * }); - * ``` - * - * `fs.unlink()` will not work on a directory, empty or otherwise. To remove a - * directory, use {@link rmdir}. - * - * See the POSIX [`unlink(2)`](http://man7.org/linux/man-pages/man2/unlink.2.html) documentation for more details. - * @since v0.0.2 - */ - export function unlink(path: PathLike, callback: NoParamCallback): void; - export namespace unlink { - /** - * Asynchronous unlink(2) - delete a name and possibly the file it refers to. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - function __promisify__(path: PathLike): Promise; - } - /** - * Synchronous [`unlink(2)`](http://man7.org/linux/man-pages/man2/unlink.2.html). Returns `undefined`. - * @since v0.1.21 - */ - export function unlinkSync(path: PathLike): void; - export interface RmDirOptions { - /** - * If an `EBUSY`, `EMFILE`, `ENFILE`, `ENOTEMPTY`, or - * `EPERM` error is encountered, Node.js will retry the operation with a linear - * backoff wait of `retryDelay` ms longer on each try. This option represents the - * number of retries. This option is ignored if the `recursive` option is not - * `true`. - * @default 0 - */ - maxRetries?: number | undefined; - /** - * @deprecated since v14.14.0 In future versions of Node.js and will trigger a warning - * `fs.rmdir(path, { recursive: true })` will throw if `path` does not exist or is a file. - * Use `fs.rm(path, { recursive: true, force: true })` instead. - * - * If `true`, perform a recursive directory removal. In - * recursive mode, operations are retried on failure. - * @default false - */ - recursive?: boolean | undefined; - /** - * The amount of time in milliseconds to wait between retries. - * This option is ignored if the `recursive` option is not `true`. - * @default 100 - */ - retryDelay?: number | undefined; - } - /** - * Asynchronous [`rmdir(2)`](http://man7.org/linux/man-pages/man2/rmdir.2.html). No arguments other than a possible exception are given - * to the completion callback. - * - * Using `fs.rmdir()` on a file (not a directory) results in an `ENOENT` error on - * Windows and an `ENOTDIR` error on POSIX. - * - * To get a behavior similar to the `rm -rf` Unix command, use {@link rm} with options `{ recursive: true, force: true }`. - * @since v0.0.2 - */ - export function rmdir(path: PathLike, callback: NoParamCallback): void; - export function rmdir(path: PathLike, options: RmDirOptions, callback: NoParamCallback): void; - export namespace rmdir { - /** - * Asynchronous rmdir(2) - delete a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - function __promisify__(path: PathLike, options?: RmDirOptions): Promise; - } - /** - * Synchronous [`rmdir(2)`](http://man7.org/linux/man-pages/man2/rmdir.2.html). Returns `undefined`. - * - * Using `fs.rmdirSync()` on a file (not a directory) results in an `ENOENT` error - * on Windows and an `ENOTDIR` error on POSIX. - * - * To get a behavior similar to the `rm -rf` Unix command, use {@link rmSync} with options `{ recursive: true, force: true }`. - * @since v0.1.21 - */ - export function rmdirSync(path: PathLike, options?: RmDirOptions): void; - export interface RmOptions { - /** - * When `true`, exceptions will be ignored if `path` does not exist. - * @default false - */ - force?: boolean | undefined; - /** - * If an `EBUSY`, `EMFILE`, `ENFILE`, `ENOTEMPTY`, or - * `EPERM` error is encountered, Node.js will retry the operation with a linear - * backoff wait of `retryDelay` ms longer on each try. This option represents the - * number of retries. This option is ignored if the `recursive` option is not - * `true`. - * @default 0 - */ - maxRetries?: number | undefined; - /** - * If `true`, perform a recursive directory removal. In - * recursive mode, operations are retried on failure. - * @default false - */ - recursive?: boolean | undefined; - /** - * The amount of time in milliseconds to wait between retries. - * This option is ignored if the `recursive` option is not `true`. - * @default 100 - */ - retryDelay?: number | undefined; - } - /** - * Asynchronously removes files and directories (modeled on the standard POSIX `rm`utility). No arguments other than a possible exception are given to the - * completion callback. - * @since v14.14.0 - */ - export function rm(path: PathLike, callback: NoParamCallback): void; - export function rm(path: PathLike, options: RmOptions, callback: NoParamCallback): void; - export namespace rm { - /** - * Asynchronously removes files and directories (modeled on the standard POSIX `rm` utility). - */ - function __promisify__(path: PathLike, options?: RmOptions): Promise; - } - /** - * Synchronously removes files and directories (modeled on the standard POSIX `rm`utility). Returns `undefined`. - * @since v14.14.0 - */ - export function rmSync(path: PathLike, options?: RmOptions): void; - export interface MakeDirectoryOptions { - /** - * Indicates whether parent folders should be created. - * If a folder was created, the path to the first created folder will be returned. - * @default false - */ - recursive?: boolean | undefined; - /** - * A file mode. If a string is passed, it is parsed as an octal integer. If not specified - * @default 0o777 - */ - mode?: Mode | undefined; - } - /** - * Asynchronously creates a directory. - * - * The callback is given a possible exception and, if `recursive` is `true`, the - * first directory path created, `(err[, path])`.`path` can still be `undefined` when `recursive` is `true`, if no directory was - * created. - * - * The optional `options` argument can be an integer specifying `mode` (permission - * and sticky bits), or an object with a `mode` property and a `recursive`property indicating whether parent directories should be created. Calling`fs.mkdir()` when `path` is a directory that - * exists results in an error only - * when `recursive` is false. - * - * ```js - * import { mkdir } from 'fs'; - * - * // Creates /tmp/a/apple, regardless of whether `/tmp` and /tmp/a exist. - * mkdir('/tmp/a/apple', { recursive: true }, (err) => { - * if (err) throw err; - * }); - * ``` - * - * On Windows, using `fs.mkdir()` on the root directory even with recursion will - * result in an error: - * - * ```js - * import { mkdir } from 'fs'; - * - * mkdir('/', { recursive: true }, (err) => { - * // => [Error: EPERM: operation not permitted, mkdir 'C:\'] - * }); - * ``` - * - * See the POSIX [`mkdir(2)`](http://man7.org/linux/man-pages/man2/mkdir.2.html) documentation for more details. - * @since v0.1.8 - */ - export function mkdir( - path: PathLike, - options: MakeDirectoryOptions & { - recursive: true; - }, - callback: (err: NodeJS.ErrnoException | null, path?: string) => void - ): void; - /** - * Asynchronous mkdir(2) - create a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders - * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. - */ - export function mkdir( - path: PathLike, - options: - | Mode - | (MakeDirectoryOptions & { - recursive?: false | undefined; - }) - | null - | undefined, - callback: NoParamCallback - ): void; - /** - * Asynchronous mkdir(2) - create a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders - * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. - */ - export function mkdir(path: PathLike, options: Mode | MakeDirectoryOptions | null | undefined, callback: (err: NodeJS.ErrnoException | null, path?: string) => void): void; - /** - * Asynchronous mkdir(2) - create a directory with a mode of `0o777`. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - export function mkdir(path: PathLike, callback: NoParamCallback): void; - export namespace mkdir { - /** - * Asynchronous mkdir(2) - create a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders - * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. - */ - function __promisify__( - path: PathLike, - options: MakeDirectoryOptions & { - recursive: true; - } - ): Promise; - /** - * Asynchronous mkdir(2) - create a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders - * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. - */ - function __promisify__( - path: PathLike, - options?: - | Mode - | (MakeDirectoryOptions & { - recursive?: false | undefined; - }) - | null - ): Promise; - /** - * Asynchronous mkdir(2) - create a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders - * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. - */ - function __promisify__(path: PathLike, options?: Mode | MakeDirectoryOptions | null): Promise; - } - /** - * Synchronously creates a directory. Returns `undefined`, or if `recursive` is`true`, the first directory path created. - * This is the synchronous version of {@link mkdir}. - * - * See the POSIX [`mkdir(2)`](http://man7.org/linux/man-pages/man2/mkdir.2.html) documentation for more details. - * @since v0.1.21 - */ - export function mkdirSync( - path: PathLike, - options: MakeDirectoryOptions & { - recursive: true; - } - ): string | undefined; - /** - * Synchronous mkdir(2) - create a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders - * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. - */ - export function mkdirSync( - path: PathLike, - options?: - | Mode - | (MakeDirectoryOptions & { - recursive?: false | undefined; - }) - | null - ): void; - /** - * Synchronous mkdir(2) - create a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders - * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. - */ - export function mkdirSync(path: PathLike, options?: Mode | MakeDirectoryOptions | null): string | undefined; - /** - * Creates a unique temporary directory. - * - * Generates six random characters to be appended behind a required`prefix` to create a unique temporary directory. Due to platform - * inconsistencies, avoid trailing `X` characters in `prefix`. Some platforms, - * notably the BSDs, can return more than six random characters, and replace - * trailing `X` characters in `prefix` with random characters. - * - * The created directory path is passed as a string to the callback's second - * parameter. - * - * The optional `options` argument can be a string specifying an encoding, or an - * object with an `encoding` property specifying the character encoding to use. - * - * ```js - * import { mkdtemp } from 'fs'; - * - * mkdtemp(path.join(os.tmpdir(), 'foo-'), (err, directory) => { - * if (err) throw err; - * console.log(directory); - * // Prints: /tmp/foo-itXde2 or C:\Users\...\AppData\Local\Temp\foo-itXde2 - * }); - * ``` - * - * The `fs.mkdtemp()` method will append the six randomly selected characters - * directly to the `prefix` string. For instance, given a directory `/tmp`, if the - * intention is to create a temporary directory _within_`/tmp`, the `prefix`must end with a trailing platform-specific path separator - * (`require('path').sep`). - * - * ```js - * import { tmpdir } from 'os'; - * import { mkdtemp } from 'fs'; - * - * // The parent directory for the new temporary directory - * const tmpDir = tmpdir(); - * - * // This method is *INCORRECT*: - * mkdtemp(tmpDir, (err, directory) => { - * if (err) throw err; - * console.log(directory); - * // Will print something similar to `/tmpabc123`. - * // A new temporary directory is created at the file system root - * // rather than *within* the /tmp directory. - * }); - * - * // This method is *CORRECT*: - * import { sep } from 'path'; - * mkdtemp(`${tmpDir}${sep}`, (err, directory) => { - * if (err) throw err; - * console.log(directory); - * // Will print something similar to `/tmp/abc123`. - * // A new temporary directory is created within - * // the /tmp directory. - * }); - * ``` - * @since v5.10.0 - */ - export function mkdtemp(prefix: string, options: EncodingOption, callback: (err: NodeJS.ErrnoException | null, folder: string) => void): void; - /** - * Asynchronously creates a unique temporary directory. - * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function mkdtemp( - prefix: string, - options: - | 'buffer' - | { - encoding: 'buffer'; - }, - callback: (err: NodeJS.ErrnoException | null, folder: Buffer) => void - ): void; - /** - * Asynchronously creates a unique temporary directory. - * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function mkdtemp(prefix: string, options: EncodingOption, callback: (err: NodeJS.ErrnoException | null, folder: string | Buffer) => void): void; - /** - * Asynchronously creates a unique temporary directory. - * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. - */ - export function mkdtemp(prefix: string, callback: (err: NodeJS.ErrnoException | null, folder: string) => void): void; - export namespace mkdtemp { - /** - * Asynchronously creates a unique temporary directory. - * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function __promisify__(prefix: string, options?: EncodingOption): Promise; - /** - * Asynchronously creates a unique temporary directory. - * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function __promisify__(prefix: string, options: BufferEncodingOption): Promise; - /** - * Asynchronously creates a unique temporary directory. - * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function __promisify__(prefix: string, options?: EncodingOption): Promise; - } - /** - * Returns the created directory path. - * - * For detailed information, see the documentation of the asynchronous version of - * this API: {@link mkdtemp}. - * - * The optional `options` argument can be a string specifying an encoding, or an - * object with an `encoding` property specifying the character encoding to use. - * @since v5.10.0 - */ - export function mkdtempSync(prefix: string, options?: EncodingOption): string; - /** - * Synchronously creates a unique temporary directory. - * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function mkdtempSync(prefix: string, options: BufferEncodingOption): Buffer; - /** - * Synchronously creates a unique temporary directory. - * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function mkdtempSync(prefix: string, options?: EncodingOption): string | Buffer; - /** - * Reads the contents of a directory. The callback gets two arguments `(err, files)`where `files` is an array of the names of the files in the directory excluding`'.'` and `'..'`. - * - * See the POSIX [`readdir(3)`](http://man7.org/linux/man-pages/man3/readdir.3.html) documentation for more details. - * - * The optional `options` argument can be a string specifying an encoding, or an - * object with an `encoding` property specifying the character encoding to use for - * the filenames passed to the callback. If the `encoding` is set to `'buffer'`, - * the filenames returned will be passed as `Buffer` objects. - * - * If `options.withFileTypes` is set to `true`, the `files` array will contain `fs.Dirent` objects. - * @since v0.1.8 - */ - export function readdir( - path: PathLike, - options: - | { - encoding: BufferEncoding | null; - withFileTypes?: false | undefined; - } - | BufferEncoding - | undefined - | null, - callback: (err: NodeJS.ErrnoException | null, files: string[]) => void - ): void; - /** - * Asynchronous readdir(3) - read a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function readdir( - path: PathLike, - options: - | { - encoding: 'buffer'; - withFileTypes?: false | undefined; - } - | 'buffer', - callback: (err: NodeJS.ErrnoException | null, files: Buffer[]) => void - ): void; - /** - * Asynchronous readdir(3) - read a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function readdir( - path: PathLike, - options: - | (ObjectEncodingOptions & { - withFileTypes?: false | undefined; - }) - | BufferEncoding - | undefined - | null, - callback: (err: NodeJS.ErrnoException | null, files: string[] | Buffer[]) => void - ): void; - /** - * Asynchronous readdir(3) - read a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - export function readdir(path: PathLike, callback: (err: NodeJS.ErrnoException | null, files: string[]) => void): void; - /** - * Asynchronous readdir(3) - read a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options If called with `withFileTypes: true` the result data will be an array of Dirent. - */ - export function readdir( - path: PathLike, - options: ObjectEncodingOptions & { - withFileTypes: true; - }, - callback: (err: NodeJS.ErrnoException | null, files: Dirent[]) => void - ): void; - export namespace readdir { - /** - * Asynchronous readdir(3) - read a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function __promisify__( - path: PathLike, - options?: - | { - encoding: BufferEncoding | null; - withFileTypes?: false | undefined; - } - | BufferEncoding - | null - ): Promise; - /** - * Asynchronous readdir(3) - read a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function __promisify__( - path: PathLike, - options: - | 'buffer' - | { - encoding: 'buffer'; - withFileTypes?: false | undefined; - } - ): Promise; - /** - * Asynchronous readdir(3) - read a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function __promisify__( - path: PathLike, - options?: - | (ObjectEncodingOptions & { - withFileTypes?: false | undefined; - }) - | BufferEncoding - | null - ): Promise; - /** - * Asynchronous readdir(3) - read a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options If called with `withFileTypes: true` the result data will be an array of Dirent - */ - function __promisify__( - path: PathLike, - options: ObjectEncodingOptions & { - withFileTypes: true; - } - ): Promise; - } - /** - * Reads the contents of the directory. - * - * See the POSIX [`readdir(3)`](http://man7.org/linux/man-pages/man3/readdir.3.html) documentation for more details. - * - * The optional `options` argument can be a string specifying an encoding, or an - * object with an `encoding` property specifying the character encoding to use for - * the filenames returned. If the `encoding` is set to `'buffer'`, - * the filenames returned will be passed as `Buffer` objects. - * - * If `options.withFileTypes` is set to `true`, the result will contain `fs.Dirent` objects. - * @since v0.1.21 - */ - export function readdirSync( - path: PathLike, - options?: - | { - encoding: BufferEncoding | null; - withFileTypes?: false | undefined; - } - | BufferEncoding - | null - ): string[]; - /** - * Synchronous readdir(3) - read a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function readdirSync( - path: PathLike, - options: - | { - encoding: 'buffer'; - withFileTypes?: false | undefined; - } - | 'buffer' - ): Buffer[]; - /** - * Synchronous readdir(3) - read a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function readdirSync( - path: PathLike, - options?: - | (ObjectEncodingOptions & { - withFileTypes?: false | undefined; - }) - | BufferEncoding - | null - ): string[] | Buffer[]; - /** - * Synchronous readdir(3) - read a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options If called with `withFileTypes: true` the result data will be an array of Dirent. - */ - export function readdirSync( - path: PathLike, - options: ObjectEncodingOptions & { - withFileTypes: true; - } - ): Dirent[]; - /** - * Closes the file descriptor. No arguments other than a possible exception are - * given to the completion callback. - * - * Calling `fs.close()` on any file descriptor (`fd`) that is currently in use - * through any other `fs` operation may lead to undefined behavior. - * - * See the POSIX [`close(2)`](http://man7.org/linux/man-pages/man2/close.2.html) documentation for more detail. - * @since v0.0.2 - */ - export function close(fd: number, callback?: NoParamCallback): void; - export namespace close { - /** - * Asynchronous close(2) - close a file descriptor. - * @param fd A file descriptor. - */ - function __promisify__(fd: number): Promise; - } - /** - * Closes the file descriptor. Returns `undefined`. - * - * Calling `fs.closeSync()` on any file descriptor (`fd`) that is currently in use - * through any other `fs` operation may lead to undefined behavior. - * - * See the POSIX [`close(2)`](http://man7.org/linux/man-pages/man2/close.2.html) documentation for more detail. - * @since v0.1.21 - */ - export function closeSync(fd: number): void; - /** - * Asynchronous file open. See the POSIX [`open(2)`](http://man7.org/linux/man-pages/man2/open.2.html) documentation for more details. - * - * `mode` sets the file mode (permission and sticky bits), but only if the file was - * created. On Windows, only the write permission can be manipulated; see {@link chmod}. - * - * The callback gets two arguments `(err, fd)`. - * - * Some characters (`< > : " / \ | ? *`) are reserved under Windows as documented - * by [Naming Files, Paths, and Namespaces](https://docs.microsoft.com/en-us/windows/desktop/FileIO/naming-a-file). Under NTFS, if the filename contains - * a colon, Node.js will open a file system stream, as described by [this MSDN page](https://docs.microsoft.com/en-us/windows/desktop/FileIO/using-streams). - * - * Functions based on `fs.open()` exhibit this behavior as well:`fs.writeFile()`, `fs.readFile()`, etc. - * @since v0.0.2 - * @param [flags='r'] See `support of file system `flags``. - * @param [mode=0o666] - */ - export function open(path: PathLike, flags: OpenMode | undefined, mode: Mode | undefined | null, callback: (err: NodeJS.ErrnoException | null, fd: number) => void): void; - /** - * Asynchronous open(2) - open and possibly create a file. If the file is created, its mode will be `0o666`. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param [flags='r'] See `support of file system `flags``. - */ - export function open(path: PathLike, flags: OpenMode | undefined, callback: (err: NodeJS.ErrnoException | null, fd: number) => void): void; - /** - * Asynchronous open(2) - open and possibly create a file. If the file is created, its mode will be `0o666`. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - export function open(path: PathLike, callback: (err: NodeJS.ErrnoException | null, fd: number) => void): void; - - export namespace open { - /** - * Asynchronous open(2) - open and possibly create a file. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param mode A file mode. If a string is passed, it is parsed as an octal integer. If not supplied, defaults to `0o666`. - */ - function __promisify__(path: PathLike, flags: OpenMode, mode?: Mode | null): Promise; - } - /** - * Returns an integer representing the file descriptor. - * - * For detailed information, see the documentation of the asynchronous version of - * this API: {@link open}. - * @since v0.1.21 - * @param [flags='r'] - * @param [mode=0o666] - */ - export function openSync(path: PathLike, flags: OpenMode, mode?: Mode | null): number; - /** - * Change the file system timestamps of the object referenced by `path`. - * - * The `atime` and `mtime` arguments follow these rules: - * - * * Values can be either numbers representing Unix epoch time in seconds,`Date`s, or a numeric string like `'123456789.0'`. - * * If the value can not be converted to a number, or is `NaN`, `Infinity` or`-Infinity`, an `Error` will be thrown. - * @since v0.4.2 - */ - export function utimes(path: PathLike, atime: TimeLike, mtime: TimeLike, callback: NoParamCallback): void; - export namespace utimes { - /** - * Asynchronously change file timestamps of the file referenced by the supplied path. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param atime The last access time. If a string is provided, it will be coerced to number. - * @param mtime The last modified time. If a string is provided, it will be coerced to number. - */ - function __promisify__(path: PathLike, atime: TimeLike, mtime: TimeLike): Promise; - } - /** - * Returns `undefined`. - * - * For detailed information, see the documentation of the asynchronous version of - * this API: {@link utimes}. - * @since v0.4.2 - */ - export function utimesSync(path: PathLike, atime: TimeLike, mtime: TimeLike): void; - /** - * Change the file system timestamps of the object referenced by the supplied file - * descriptor. See {@link utimes}. - * @since v0.4.2 - */ - export function futimes(fd: number, atime: TimeLike, mtime: TimeLike, callback: NoParamCallback): void; - export namespace futimes { - /** - * Asynchronously change file timestamps of the file referenced by the supplied file descriptor. - * @param fd A file descriptor. - * @param atime The last access time. If a string is provided, it will be coerced to number. - * @param mtime The last modified time. If a string is provided, it will be coerced to number. - */ - function __promisify__(fd: number, atime: TimeLike, mtime: TimeLike): Promise; - } - /** - * Synchronous version of {@link futimes}. Returns `undefined`. - * @since v0.4.2 - */ - export function futimesSync(fd: number, atime: TimeLike, mtime: TimeLike): void; - /** - * Request that all data for the open file descriptor is flushed to the storage - * device. The specific implementation is operating system and device specific. - * Refer to the POSIX [`fsync(2)`](http://man7.org/linux/man-pages/man2/fsync.2.html) documentation for more detail. No arguments other - * than a possible exception are given to the completion callback. - * @since v0.1.96 - */ - export function fsync(fd: number, callback: NoParamCallback): void; - export namespace fsync { - /** - * Asynchronous fsync(2) - synchronize a file's in-core state with the underlying storage device. - * @param fd A file descriptor. - */ - function __promisify__(fd: number): Promise; - } - /** - * Request that all data for the open file descriptor is flushed to the storage - * device. The specific implementation is operating system and device specific. - * Refer to the POSIX [`fsync(2)`](http://man7.org/linux/man-pages/man2/fsync.2.html) documentation for more detail. Returns `undefined`. - * @since v0.1.96 - */ - export function fsyncSync(fd: number): void; - /** - * Write `buffer` to the file specified by `fd`. - * - * `offset` determines the part of the buffer to be written, and `length` is - * an integer specifying the number of bytes to write. - * - * `position` refers to the offset from the beginning of the file where this data - * should be written. If `typeof position !== 'number'`, the data will be written - * at the current position. See [`pwrite(2)`](http://man7.org/linux/man-pages/man2/pwrite.2.html). - * - * The callback will be given three arguments `(err, bytesWritten, buffer)` where`bytesWritten` specifies how many _bytes_ were written from `buffer`. - * - * If this method is invoked as its `util.promisify()` ed version, it returns - * a promise for an `Object` with `bytesWritten` and `buffer` properties. - * - * It is unsafe to use `fs.write()` multiple times on the same file without waiting - * for the callback. For this scenario, {@link createWriteStream} is - * recommended. - * - * On Linux, positional writes don't work when the file is opened in append mode. - * The kernel ignores the position argument and always appends the data to - * the end of the file. - * @since v0.0.2 - */ - export function write( - fd: number, - buffer: TBuffer, - offset: number | undefined | null, - length: number | undefined | null, - position: number | undefined | null, - callback: (err: NodeJS.ErrnoException | null, written: number, buffer: TBuffer) => void - ): void; - /** - * Asynchronously writes `buffer` to the file referenced by the supplied file descriptor. - * @param fd A file descriptor. - * @param offset The part of the buffer to be written. If not supplied, defaults to `0`. - * @param length The number of bytes to write. If not supplied, defaults to `buffer.length - offset`. - */ - export function write( - fd: number, - buffer: TBuffer, - offset: number | undefined | null, - length: number | undefined | null, - callback: (err: NodeJS.ErrnoException | null, written: number, buffer: TBuffer) => void - ): void; - /** - * Asynchronously writes `buffer` to the file referenced by the supplied file descriptor. - * @param fd A file descriptor. - * @param offset The part of the buffer to be written. If not supplied, defaults to `0`. - */ - export function write( - fd: number, - buffer: TBuffer, - offset: number | undefined | null, - callback: (err: NodeJS.ErrnoException | null, written: number, buffer: TBuffer) => void - ): void; - /** - * Asynchronously writes `buffer` to the file referenced by the supplied file descriptor. - * @param fd A file descriptor. - */ - export function write(fd: number, buffer: TBuffer, callback: (err: NodeJS.ErrnoException | null, written: number, buffer: TBuffer) => void): void; - /** - * Asynchronously writes `string` to the file referenced by the supplied file descriptor. - * @param fd A file descriptor. - * @param string A string to write. - * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. - * @param encoding The expected string encoding. - */ - export function write( - fd: number, - string: string, - position: number | undefined | null, - encoding: BufferEncoding | undefined | null, - callback: (err: NodeJS.ErrnoException | null, written: number, str: string) => void - ): void; - /** - * Asynchronously writes `string` to the file referenced by the supplied file descriptor. - * @param fd A file descriptor. - * @param string A string to write. - * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. - */ - export function write(fd: number, string: string, position: number | undefined | null, callback: (err: NodeJS.ErrnoException | null, written: number, str: string) => void): void; - /** - * Asynchronously writes `string` to the file referenced by the supplied file descriptor. - * @param fd A file descriptor. - * @param string A string to write. - */ - export function write(fd: number, string: string, callback: (err: NodeJS.ErrnoException | null, written: number, str: string) => void): void; - export namespace write { - /** - * Asynchronously writes `buffer` to the file referenced by the supplied file descriptor. - * @param fd A file descriptor. - * @param offset The part of the buffer to be written. If not supplied, defaults to `0`. - * @param length The number of bytes to write. If not supplied, defaults to `buffer.length - offset`. - * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. - */ - function __promisify__( - fd: number, - buffer?: TBuffer, - offset?: number, - length?: number, - position?: number | null - ): Promise<{ - bytesWritten: number; - buffer: TBuffer; - }>; - /** - * Asynchronously writes `string` to the file referenced by the supplied file descriptor. - * @param fd A file descriptor. - * @param string A string to write. - * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. - * @param encoding The expected string encoding. - */ - function __promisify__( - fd: number, - string: string, - position?: number | null, - encoding?: BufferEncoding | null - ): Promise<{ - bytesWritten: number; - buffer: string; - }>; - } - /** - * For detailed information, see the documentation of the asynchronous version of - * this API: {@link write}. - * @since v0.1.21 - * @return The number of bytes written. - */ - export function writeSync(fd: number, buffer: NodeJS.ArrayBufferView, offset?: number | null, length?: number | null, position?: number | null): number; - /** - * Synchronously writes `string` to the file referenced by the supplied file descriptor, returning the number of bytes written. - * @param fd A file descriptor. - * @param string A string to write. - * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. - * @param encoding The expected string encoding. - */ - export function writeSync(fd: number, string: string, position?: number | null, encoding?: BufferEncoding | null): number; - export type ReadPosition = number | bigint; - export interface ReadSyncOptions { - /** - * @default 0 - */ - offset?: number | undefined; - /** - * @default `length of buffer` - */ - length?: number | undefined; - /** - * @default null - */ - position?: ReadPosition | null | undefined; - } - export interface ReadAsyncOptions extends ReadSyncOptions { - buffer?: TBuffer; - } - /** - * Read data from the file specified by `fd`. - * - * The callback is given the three arguments, `(err, bytesRead, buffer)`. - * - * If the file is not modified concurrently, the end-of-file is reached when the - * number of bytes read is zero. - * - * If this method is invoked as its `util.promisify()` ed version, it returns - * a promise for an `Object` with `bytesRead` and `buffer` properties. - * @since v0.0.2 - * @param buffer The buffer that the data will be written to. - * @param offset The position in `buffer` to write the data to. - * @param length The number of bytes to read. - * @param position Specifies where to begin reading from in the file. If `position` is `null` or `-1 `, data will be read from the current file position, and the file position will be updated. If - * `position` is an integer, the file position will be unchanged. - */ - export function read( - fd: number, - buffer: TBuffer, - offset: number, - length: number, - position: ReadPosition | null, - callback: (err: NodeJS.ErrnoException | null, bytesRead: number, buffer: TBuffer) => void - ): void; - /** - * Similar to the above `fs.read` function, this version takes an optional `options` object. - * If not otherwise specified in an `options` object, - * `buffer` defaults to `Buffer.alloc(16384)`, - * `offset` defaults to `0`, - * `length` defaults to `buffer.byteLength`, `- offset` as of Node 17.6.0 - * `position` defaults to `null` - * @since v12.17.0, 13.11.0 - */ - export function read( - fd: number, - options: ReadAsyncOptions, - callback: (err: NodeJS.ErrnoException | null, bytesRead: number, buffer: TBuffer) => void - ): void; - export function read(fd: number, callback: (err: NodeJS.ErrnoException | null, bytesRead: number, buffer: NodeJS.ArrayBufferView) => void): void; - export namespace read { - /** - * @param fd A file descriptor. - * @param buffer The buffer that the data will be written to. - * @param offset The offset in the buffer at which to start writing. - * @param length The number of bytes to read. - * @param position The offset from the beginning of the file from which data should be read. If `null`, data will be read from the current position. - */ - function __promisify__( - fd: number, - buffer: TBuffer, - offset: number, - length: number, - position: number | null - ): Promise<{ - bytesRead: number; - buffer: TBuffer; - }>; - function __promisify__( - fd: number, - options: ReadAsyncOptions - ): Promise<{ - bytesRead: number; - buffer: TBuffer; - }>; - function __promisify__(fd: number): Promise<{ - bytesRead: number; - buffer: NodeJS.ArrayBufferView; - }>; - } - /** - * Returns the number of `bytesRead`. - * - * For detailed information, see the documentation of the asynchronous version of - * this API: {@link read}. - * @since v0.1.21 - */ - export function readSync(fd: number, buffer: NodeJS.ArrayBufferView, offset: number, length: number, position: ReadPosition | null): number; - /** - * Similar to the above `fs.readSync` function, this version takes an optional `options` object. - * If no `options` object is specified, it will default with the above values. - */ - export function readSync(fd: number, buffer: NodeJS.ArrayBufferView, opts?: ReadSyncOptions): number; - /** - * Asynchronously reads the entire contents of a file. - * - * ```js - * import { readFile } from 'fs'; - * - * readFile('/etc/passwd', (err, data) => { - * if (err) throw err; - * console.log(data); - * }); - * ``` - * - * The callback is passed two arguments `(err, data)`, where `data` is the - * contents of the file. - * - * If no encoding is specified, then the raw buffer is returned. - * - * If `options` is a string, then it specifies the encoding: - * - * ```js - * import { readFile } from 'fs'; - * - * readFile('/etc/passwd', 'utf8', callback); - * ``` - * - * When the path is a directory, the behavior of `fs.readFile()` and {@link readFileSync} is platform-specific. On macOS, Linux, and Windows, an - * error will be returned. On FreeBSD, a representation of the directory's contents - * will be returned. - * - * ```js - * import { readFile } from 'fs'; - * - * // macOS, Linux, and Windows - * readFile('', (err, data) => { - * // => [Error: EISDIR: illegal operation on a directory, read ] - * }); - * - * // FreeBSD - * readFile('', (err, data) => { - * // => null, - * }); - * ``` - * - * It is possible to abort an ongoing request using an `AbortSignal`. If a - * request is aborted the callback is called with an `AbortError`: - * - * ```js - * import { readFile } from 'fs'; - * - * const controller = new AbortController(); - * const signal = controller.signal; - * readFile(fileInfo[0].name, { signal }, (err, buf) => { - * // ... - * }); - * // When you want to abort the request - * controller.abort(); - * ``` - * - * The `fs.readFile()` function buffers the entire file. To minimize memory costs, - * when possible prefer streaming via `fs.createReadStream()`. - * - * Aborting an ongoing request does not abort individual operating - * system requests but rather the internal buffering `fs.readFile` performs. - * @since v0.1.29 - * @param path filename or file descriptor - */ - export function readFile( - path: PathOrFileDescriptor, - options: - | ({ - encoding?: null | undefined; - flag?: string | undefined; - } & Abortable) - | undefined - | null, - callback: (err: NodeJS.ErrnoException | null, data: Buffer) => void - ): void; - /** - * Asynchronously reads the entire contents of a file. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * If a file descriptor is provided, the underlying file will _not_ be closed automatically. - * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag. - * If a flag is not provided, it defaults to `'r'`. - */ - export function readFile( - path: PathOrFileDescriptor, - options: - | ({ - encoding: BufferEncoding; - flag?: string | undefined; - } & Abortable) - | BufferEncoding, - callback: (err: NodeJS.ErrnoException | null, data: string) => void - ): void; - /** - * Asynchronously reads the entire contents of a file. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * If a file descriptor is provided, the underlying file will _not_ be closed automatically. - * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag. - * If a flag is not provided, it defaults to `'r'`. - */ - export function readFile( - path: PathOrFileDescriptor, - options: - | (ObjectEncodingOptions & { - flag?: string | undefined; - } & Abortable) - | BufferEncoding - | undefined - | null, - callback: (err: NodeJS.ErrnoException | null, data: string | Buffer) => void - ): void; - /** - * Asynchronously reads the entire contents of a file. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * If a file descriptor is provided, the underlying file will _not_ be closed automatically. - */ - export function readFile(path: PathOrFileDescriptor, callback: (err: NodeJS.ErrnoException | null, data: Buffer) => void): void; - export namespace readFile { - /** - * Asynchronously reads the entire contents of a file. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * If a file descriptor is provided, the underlying file will _not_ be closed automatically. - * @param options An object that may contain an optional flag. - * If a flag is not provided, it defaults to `'r'`. - */ - function __promisify__( - path: PathOrFileDescriptor, - options?: { - encoding?: null | undefined; - flag?: string | undefined; - } | null - ): Promise; - /** - * Asynchronously reads the entire contents of a file. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * URL support is _experimental_. - * If a file descriptor is provided, the underlying file will _not_ be closed automatically. - * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag. - * If a flag is not provided, it defaults to `'r'`. - */ - function __promisify__( - path: PathOrFileDescriptor, - options: - | { - encoding: BufferEncoding; - flag?: string | undefined; - } - | BufferEncoding - ): Promise; - /** - * Asynchronously reads the entire contents of a file. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * URL support is _experimental_. - * If a file descriptor is provided, the underlying file will _not_ be closed automatically. - * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag. - * If a flag is not provided, it defaults to `'r'`. - */ - function __promisify__( - path: PathOrFileDescriptor, - options?: - | (ObjectEncodingOptions & { - flag?: string | undefined; - }) - | BufferEncoding - | null - ): Promise; - } - /** - * Returns the contents of the `path`. - * - * For detailed information, see the documentation of the asynchronous version of - * this API: {@link readFile}. - * - * If the `encoding` option is specified then this function returns a - * string. Otherwise it returns a buffer. - * - * Similar to {@link readFile}, when the path is a directory, the behavior of`fs.readFileSync()` is platform-specific. - * - * ```js - * import { readFileSync } from 'fs'; - * - * // macOS, Linux, and Windows - * readFileSync(''); - * // => [Error: EISDIR: illegal operation on a directory, read ] - * - * // FreeBSD - * readFileSync(''); // => - * ``` - * @since v0.1.8 - * @param path filename or file descriptor - */ - export function readFileSync( - path: PathOrFileDescriptor, - options?: { - encoding?: null | undefined; - flag?: string | undefined; - } | null - ): Buffer; - /** - * Synchronously reads the entire contents of a file. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * If a file descriptor is provided, the underlying file will _not_ be closed automatically. - * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag. - * If a flag is not provided, it defaults to `'r'`. - */ - export function readFileSync( - path: PathOrFileDescriptor, - options: - | { - encoding: BufferEncoding; - flag?: string | undefined; - } - | BufferEncoding - ): string; - /** - * Synchronously reads the entire contents of a file. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * If a file descriptor is provided, the underlying file will _not_ be closed automatically. - * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag. - * If a flag is not provided, it defaults to `'r'`. - */ - export function readFileSync( - path: PathOrFileDescriptor, - options?: - | (ObjectEncodingOptions & { - flag?: string | undefined; - }) - | BufferEncoding - | null - ): string | Buffer; - export type WriteFileOptions = - | (ObjectEncodingOptions & - Abortable & { - mode?: Mode | undefined; - flag?: string | undefined; - }) - | BufferEncoding - | null; - /** - * When `file` is a filename, asynchronously writes data to the file, replacing the - * file if it already exists. `data` can be a string or a buffer. - * - * When `file` is a file descriptor, the behavior is similar to calling`fs.write()` directly (which is recommended). See the notes below on using - * a file descriptor. - * - * The `encoding` option is ignored if `data` is a buffer. - * - * The `mode` option only affects the newly created file. See {@link open} for more details. - * - * ```js - * import { writeFile } from 'fs'; - * import { Buffer } from 'buffer'; - * - * const data = new Uint8Array(Buffer.from('Hello Node.js')); - * writeFile('message.txt', data, (err) => { - * if (err) throw err; - * console.log('The file has been saved!'); - * }); - * ``` - * - * If `options` is a string, then it specifies the encoding: - * - * ```js - * import { writeFile } from 'fs'; - * - * writeFile('message.txt', 'Hello Node.js', 'utf8', callback); - * ``` - * - * It is unsafe to use `fs.writeFile()` multiple times on the same file without - * waiting for the callback. For this scenario, {@link createWriteStream} is - * recommended. - * - * Similarly to `fs.readFile` \- `fs.writeFile` is a convenience method that - * performs multiple `write` calls internally to write the buffer passed to it. - * For performance sensitive code consider using {@link createWriteStream}. - * - * It is possible to use an `AbortSignal` to cancel an `fs.writeFile()`. - * Cancelation is "best effort", and some amount of data is likely still - * to be written. - * - * ```js - * import { writeFile } from 'fs'; - * import { Buffer } from 'buffer'; - * - * const controller = new AbortController(); - * const { signal } = controller; - * const data = new Uint8Array(Buffer.from('Hello Node.js')); - * writeFile('message.txt', data, { signal }, (err) => { - * // When a request is aborted - the callback is called with an AbortError - * }); - * // When the request should be aborted - * controller.abort(); - * ``` - * - * Aborting an ongoing request does not abort individual operating - * system requests but rather the internal buffering `fs.writeFile` performs. - * @since v0.1.29 - * @param file filename or file descriptor - */ - export function writeFile(file: PathOrFileDescriptor, data: string | NodeJS.ArrayBufferView, options: WriteFileOptions, callback: NoParamCallback): void; - /** - * Asynchronously writes data to a file, replacing the file if it already exists. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * If a file descriptor is provided, the underlying file will _not_ be closed automatically. - * @param data The data to write. If something other than a Buffer or Uint8Array is provided, the value is coerced to a string. - */ - export function writeFile(path: PathOrFileDescriptor, data: string | NodeJS.ArrayBufferView, callback: NoParamCallback): void; - export namespace writeFile { - /** - * Asynchronously writes data to a file, replacing the file if it already exists. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * URL support is _experimental_. - * If a file descriptor is provided, the underlying file will _not_ be closed automatically. - * @param data The data to write. If something other than a Buffer or Uint8Array is provided, the value is coerced to a string. - * @param options Either the encoding for the file, or an object optionally specifying the encoding, file mode, and flag. - * If `encoding` is not supplied, the default of `'utf8'` is used. - * If `mode` is not supplied, the default of `0o666` is used. - * If `mode` is a string, it is parsed as an octal integer. - * If `flag` is not supplied, the default of `'w'` is used. - */ - function __promisify__(path: PathOrFileDescriptor, data: string | NodeJS.ArrayBufferView, options?: WriteFileOptions): Promise; - } - /** - * Returns `undefined`. - * - * The `mode` option only affects the newly created file. See {@link open} for more details. - * - * For detailed information, see the documentation of the asynchronous version of - * this API: {@link writeFile}. - * @since v0.1.29 - * @param file filename or file descriptor - */ - export function writeFileSync(file: PathOrFileDescriptor, data: string | NodeJS.ArrayBufferView, options?: WriteFileOptions): void; - /** - * Asynchronously append data to a file, creating the file if it does not yet - * exist. `data` can be a string or a `Buffer`. - * - * The `mode` option only affects the newly created file. See {@link open} for more details. - * - * ```js - * import { appendFile } from 'fs'; - * - * appendFile('message.txt', 'data to append', (err) => { - * if (err) throw err; - * console.log('The "data to append" was appended to file!'); - * }); - * ``` - * - * If `options` is a string, then it specifies the encoding: - * - * ```js - * import { appendFile } from 'fs'; - * - * appendFile('message.txt', 'data to append', 'utf8', callback); - * ``` - * - * The `path` may be specified as a numeric file descriptor that has been opened - * for appending (using `fs.open()` or `fs.openSync()`). The file descriptor will - * not be closed automatically. - * - * ```js - * import { open, close, appendFile } from 'fs'; - * - * function closeFd(fd) { - * close(fd, (err) => { - * if (err) throw err; - * }); - * } - * - * open('message.txt', 'a', (err, fd) => { - * if (err) throw err; - * - * try { - * appendFile(fd, 'data to append', 'utf8', (err) => { - * closeFd(fd); - * if (err) throw err; - * }); - * } catch (err) { - * closeFd(fd); - * throw err; - * } - * }); - * ``` - * @since v0.6.7 - * @param path filename or file descriptor - */ - export function appendFile(path: PathOrFileDescriptor, data: string | Uint8Array, options: WriteFileOptions, callback: NoParamCallback): void; - /** - * Asynchronously append data to a file, creating the file if it does not exist. - * @param file A path to a file. If a URL is provided, it must use the `file:` protocol. - * If a file descriptor is provided, the underlying file will _not_ be closed automatically. - * @param data The data to write. If something other than a Buffer or Uint8Array is provided, the value is coerced to a string. - */ - export function appendFile(file: PathOrFileDescriptor, data: string | Uint8Array, callback: NoParamCallback): void; - export namespace appendFile { - /** - * Asynchronously append data to a file, creating the file if it does not exist. - * @param file A path to a file. If a URL is provided, it must use the `file:` protocol. - * URL support is _experimental_. - * If a file descriptor is provided, the underlying file will _not_ be closed automatically. - * @param data The data to write. If something other than a Buffer or Uint8Array is provided, the value is coerced to a string. - * @param options Either the encoding for the file, or an object optionally specifying the encoding, file mode, and flag. - * If `encoding` is not supplied, the default of `'utf8'` is used. - * If `mode` is not supplied, the default of `0o666` is used. - * If `mode` is a string, it is parsed as an octal integer. - * If `flag` is not supplied, the default of `'a'` is used. - */ - function __promisify__(file: PathOrFileDescriptor, data: string | Uint8Array, options?: WriteFileOptions): Promise; - } - /** - * Synchronously append data to a file, creating the file if it does not yet - * exist. `data` can be a string or a `Buffer`. - * - * The `mode` option only affects the newly created file. See {@link open} for more details. - * - * ```js - * import { appendFileSync } from 'fs'; - * - * try { - * appendFileSync('message.txt', 'data to append'); - * console.log('The "data to append" was appended to file!'); - * } catch (err) { - * // Handle the error - * } - * ``` - * - * If `options` is a string, then it specifies the encoding: - * - * ```js - * import { appendFileSync } from 'fs'; - * - * appendFileSync('message.txt', 'data to append', 'utf8'); - * ``` - * - * The `path` may be specified as a numeric file descriptor that has been opened - * for appending (using `fs.open()` or `fs.openSync()`). The file descriptor will - * not be closed automatically. - * - * ```js - * import { openSync, closeSync, appendFileSync } from 'fs'; - * - * let fd; - * - * try { - * fd = openSync('message.txt', 'a'); - * appendFileSync(fd, 'data to append', 'utf8'); - * } catch (err) { - * // Handle the error - * } finally { - * if (fd !== undefined) - * closeSync(fd); - * } - * ``` - * @since v0.6.7 - * @param path filename or file descriptor - */ - export function appendFileSync(path: PathOrFileDescriptor, data: string | Uint8Array, options?: WriteFileOptions): void; - /** - * Watch for changes on `filename`. The callback `listener` will be called each - * time the file is accessed. - * - * The `options` argument may be omitted. If provided, it should be an object. The`options` object may contain a boolean named `persistent` that indicates - * whether the process should continue to run as long as files are being watched. - * The `options` object may specify an `interval` property indicating how often the - * target should be polled in milliseconds. - * - * The `listener` gets two arguments the current stat object and the previous - * stat object: - * - * ```js - * import { watchFile } from 'fs'; - * - * watchFile('message.text', (curr, prev) => { - * console.log(`the current mtime is: ${curr.mtime}`); - * console.log(`the previous mtime was: ${prev.mtime}`); - * }); - * ``` - * - * These stat objects are instances of `fs.Stat`. If the `bigint` option is `true`, - * the numeric values in these objects are specified as `BigInt`s. - * - * To be notified when the file was modified, not just accessed, it is necessary - * to compare `curr.mtimeMs` and `prev.mtimeMs`. - * - * When an `fs.watchFile` operation results in an `ENOENT` error, it - * will invoke the listener once, with all the fields zeroed (or, for dates, the - * Unix Epoch). If the file is created later on, the listener will be called - * again, with the latest stat objects. This is a change in functionality since - * v0.10. - * - * Using {@link watch} is more efficient than `fs.watchFile` and`fs.unwatchFile`. `fs.watch` should be used instead of `fs.watchFile` and`fs.unwatchFile` when possible. - * - * When a file being watched by `fs.watchFile()` disappears and reappears, - * then the contents of `previous` in the second callback event (the file's - * reappearance) will be the same as the contents of `previous` in the first - * callback event (its disappearance). - * - * This happens when: - * - * * the file is deleted, followed by a restore - * * the file is renamed and then renamed a second time back to its original name - * @since v0.1.31 - */ - export interface WatchFileOptions { - bigint?: boolean | undefined; - persistent?: boolean | undefined; - interval?: number | undefined; - } - /** - * Watch for changes on `filename`. The callback `listener` will be called each - * time the file is accessed. - * - * The `options` argument may be omitted. If provided, it should be an object. The`options` object may contain a boolean named `persistent` that indicates - * whether the process should continue to run as long as files are being watched. - * The `options` object may specify an `interval` property indicating how often the - * target should be polled in milliseconds. - * - * The `listener` gets two arguments the current stat object and the previous - * stat object: - * - * ```js - * import { watchFile } from 'fs'; - * - * watchFile('message.text', (curr, prev) => { - * console.log(`the current mtime is: ${curr.mtime}`); - * console.log(`the previous mtime was: ${prev.mtime}`); - * }); - * ``` - * - * These stat objects are instances of `fs.Stat`. If the `bigint` option is `true`, - * the numeric values in these objects are specified as `BigInt`s. - * - * To be notified when the file was modified, not just accessed, it is necessary - * to compare `curr.mtimeMs` and `prev.mtimeMs`. - * - * When an `fs.watchFile` operation results in an `ENOENT` error, it - * will invoke the listener once, with all the fields zeroed (or, for dates, the - * Unix Epoch). If the file is created later on, the listener will be called - * again, with the latest stat objects. This is a change in functionality since - * v0.10. - * - * Using {@link watch} is more efficient than `fs.watchFile` and`fs.unwatchFile`. `fs.watch` should be used instead of `fs.watchFile` and`fs.unwatchFile` when possible. - * - * When a file being watched by `fs.watchFile()` disappears and reappears, - * then the contents of `previous` in the second callback event (the file's - * reappearance) will be the same as the contents of `previous` in the first - * callback event (its disappearance). - * - * This happens when: - * - * * the file is deleted, followed by a restore - * * the file is renamed and then renamed a second time back to its original name - * @since v0.1.31 - */ - export function watchFile( - filename: PathLike, - options: - | (WatchFileOptions & { - bigint?: false | undefined; - }) - | undefined, - listener: (curr: Stats, prev: Stats) => void - ): StatWatcher; - export function watchFile( - filename: PathLike, - options: - | (WatchFileOptions & { - bigint: true; - }) - | undefined, - listener: (curr: BigIntStats, prev: BigIntStats) => void - ): StatWatcher; - /** - * Watch for changes on `filename`. The callback `listener` will be called each time the file is accessed. - * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol. - */ - export function watchFile(filename: PathLike, listener: (curr: Stats, prev: Stats) => void): StatWatcher; - /** - * Stop watching for changes on `filename`. If `listener` is specified, only that - * particular listener is removed. Otherwise, _all_ listeners are removed, - * effectively stopping watching of `filename`. - * - * Calling `fs.unwatchFile()` with a filename that is not being watched is a - * no-op, not an error. - * - * Using {@link watch} is more efficient than `fs.watchFile()` and`fs.unwatchFile()`. `fs.watch()` should be used instead of `fs.watchFile()`and `fs.unwatchFile()` when possible. - * @since v0.1.31 - * @param listener Optional, a listener previously attached using `fs.watchFile()` - */ - export function unwatchFile(filename: PathLike, listener?: (curr: Stats, prev: Stats) => void): void; - export interface WatchOptions extends Abortable { - encoding?: BufferEncoding | 'buffer' | undefined; - persistent?: boolean | undefined; - recursive?: boolean | undefined; - } - export type WatchEventType = 'rename' | 'change'; - export type WatchListener = (event: WatchEventType, filename: T) => void; - /** - * Watch for changes on `filename`, where `filename` is either a file or a - * directory. - * - * The second argument is optional. If `options` is provided as a string, it - * specifies the `encoding`. Otherwise `options` should be passed as an object. - * - * The listener callback gets two arguments `(eventType, filename)`. `eventType`is either `'rename'` or `'change'`, and `filename` is the name of the file - * which triggered the event. - * - * On most platforms, `'rename'` is emitted whenever a filename appears or - * disappears in the directory. - * - * The listener callback is attached to the `'change'` event fired by `fs.FSWatcher`, but it is not the same thing as the `'change'` value of`eventType`. - * - * If a `signal` is passed, aborting the corresponding AbortController will close - * the returned `fs.FSWatcher`. - * @since v0.5.10 - * @param listener - */ - export function watch( - filename: PathLike, - options: - | (WatchOptions & { - encoding: 'buffer'; - }) - | 'buffer', - listener?: WatchListener - ): FSWatcher; - /** - * Watch for changes on `filename`, where `filename` is either a file or a directory, returning an `FSWatcher`. - * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol. - * @param options Either the encoding for the filename provided to the listener, or an object optionally specifying encoding, persistent, and recursive options. - * If `encoding` is not supplied, the default of `'utf8'` is used. - * If `persistent` is not supplied, the default of `true` is used. - * If `recursive` is not supplied, the default of `false` is used. - */ - export function watch(filename: PathLike, options?: WatchOptions | BufferEncoding | null, listener?: WatchListener): FSWatcher; - /** - * Watch for changes on `filename`, where `filename` is either a file or a directory, returning an `FSWatcher`. - * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol. - * @param options Either the encoding for the filename provided to the listener, or an object optionally specifying encoding, persistent, and recursive options. - * If `encoding` is not supplied, the default of `'utf8'` is used. - * If `persistent` is not supplied, the default of `true` is used. - * If `recursive` is not supplied, the default of `false` is used. - */ - export function watch(filename: PathLike, options: WatchOptions | string, listener?: WatchListener): FSWatcher; - /** - * Watch for changes on `filename`, where `filename` is either a file or a directory, returning an `FSWatcher`. - * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol. - */ - export function watch(filename: PathLike, listener?: WatchListener): FSWatcher; - /** - * Test whether or not the given path exists by checking with the file system. - * Then call the `callback` argument with either true or false: - * - * ```js - * import { exists } from 'fs'; - * - * exists('/etc/passwd', (e) => { - * console.log(e ? 'it exists' : 'no passwd!'); - * }); - * ``` - * - * **The parameters for this callback are not consistent with other Node.js** - * **callbacks.** Normally, the first parameter to a Node.js callback is an `err`parameter, optionally followed by other parameters. The `fs.exists()` callback - * has only one boolean parameter. This is one reason `fs.access()` is recommended - * instead of `fs.exists()`. - * - * Using `fs.exists()` to check for the existence of a file before calling`fs.open()`, `fs.readFile()` or `fs.writeFile()` is not recommended. Doing - * so introduces a race condition, since other processes may change the file's - * state between the two calls. Instead, user code should open/read/write the - * file directly and handle the error raised if the file does not exist. - * - * **write (NOT RECOMMENDED)** - * - * ```js - * import { exists, open, close } from 'fs'; - * - * exists('myfile', (e) => { - * if (e) { - * console.error('myfile already exists'); - * } else { - * open('myfile', 'wx', (err, fd) => { - * if (err) throw err; - * - * try { - * writeMyData(fd); - * } finally { - * close(fd, (err) => { - * if (err) throw err; - * }); - * } - * }); - * } - * }); - * ``` - * - * **write (RECOMMENDED)** - * - * ```js - * import { open, close } from 'fs'; - * open('myfile', 'wx', (err, fd) => { - * if (err) { - * if (err.code === 'EEXIST') { - * console.error('myfile already exists'); - * return; - * } - * - * throw err; - * } - * - * try { - * writeMyData(fd); - * } finally { - * close(fd, (err) => { - * if (err) throw err; - * }); - * } - * }); - * ``` - * - * **read (NOT RECOMMENDED)** - * - * ```js - * import { open, close, exists } from 'fs'; - * - * exists('myfile', (e) => { - * if (e) { - * open('myfile', 'r', (err, fd) => { - * if (err) throw err; - * - * try { - * readMyData(fd); - * } finally { - * close(fd, (err) => { - * if (err) throw err; - * }); - * } - * }); - * } else { - * console.error('myfile does not exist'); - * } - * }); - * ``` - * - * **read (RECOMMENDED)** - * - * ```js - * import { open, close } from 'fs'; - * - * open('myfile', 'r', (err, fd) => { - * if (err) { - * if (err.code === 'ENOENT') { - * console.error('myfile does not exist'); - * return; - * } - * - * throw err; - * } - * - * try { - * readMyData(fd); - * } finally { - * close(fd, (err) => { - * if (err) throw err; - * }); - * } - * }); - * ``` - * - * The "not recommended" examples above check for existence and then use the - * file; the "recommended" examples are better because they use the file directly - * and handle the error, if any. - * - * In general, check for the existence of a file only if the file won’t be - * used directly, for example when its existence is a signal from another - * process. - * @since v0.0.2 - * @deprecated Since v1.0.0 - Use {@link stat} or {@link access} instead. - */ - export function exists(path: PathLike, callback: (exists: boolean) => void): void; - /** @deprecated */ - export namespace exists { - /** - * @param path A path to a file or directory. If a URL is provided, it must use the `file:` protocol. - * URL support is _experimental_. - */ - function __promisify__(path: PathLike): Promise; - } - /** - * Returns `true` if the path exists, `false` otherwise. - * - * For detailed information, see the documentation of the asynchronous version of - * this API: {@link exists}. - * - * `fs.exists()` is deprecated, but `fs.existsSync()` is not. The `callback`parameter to `fs.exists()` accepts parameters that are inconsistent with other - * Node.js callbacks. `fs.existsSync()` does not use a callback. - * - * ```js - * import { existsSync } from 'fs'; - * - * if (existsSync('/etc/passwd')) - * console.log('The path exists.'); - * ``` - * @since v0.1.21 - */ - export function existsSync(path: PathLike): boolean; - export namespace constants { - // File Access Constants - /** Constant for fs.access(). File is visible to the calling process. */ - const F_OK: number; - /** Constant for fs.access(). File can be read by the calling process. */ - const R_OK: number; - /** Constant for fs.access(). File can be written by the calling process. */ - const W_OK: number; - /** Constant for fs.access(). File can be executed by the calling process. */ - const X_OK: number; - // File Copy Constants - /** Constant for fs.copyFile. Flag indicating the destination file should not be overwritten if it already exists. */ - const COPYFILE_EXCL: number; - /** - * Constant for fs.copyFile. copy operation will attempt to create a copy-on-write reflink. - * If the underlying platform does not support copy-on-write, then a fallback copy mechanism is used. - */ - const COPYFILE_FICLONE: number; - /** - * Constant for fs.copyFile. Copy operation will attempt to create a copy-on-write reflink. - * If the underlying platform does not support copy-on-write, then the operation will fail with an error. - */ - const COPYFILE_FICLONE_FORCE: number; - // File Open Constants - /** Constant for fs.open(). Flag indicating to open a file for read-only access. */ - const O_RDONLY: number; - /** Constant for fs.open(). Flag indicating to open a file for write-only access. */ - const O_WRONLY: number; - /** Constant for fs.open(). Flag indicating to open a file for read-write access. */ - const O_RDWR: number; - /** Constant for fs.open(). Flag indicating to create the file if it does not already exist. */ - const O_CREAT: number; - /** Constant for fs.open(). Flag indicating that opening a file should fail if the O_CREAT flag is set and the file already exists. */ - const O_EXCL: number; - /** - * Constant for fs.open(). Flag indicating that if path identifies a terminal device, - * opening the path shall not cause that terminal to become the controlling terminal for the process - * (if the process does not already have one). - */ - const O_NOCTTY: number; - /** Constant for fs.open(). Flag indicating that if the file exists and is a regular file, and the file is opened successfully for write access, its length shall be truncated to zero. */ - const O_TRUNC: number; - /** Constant for fs.open(). Flag indicating that data will be appended to the end of the file. */ - const O_APPEND: number; - /** Constant for fs.open(). Flag indicating that the open should fail if the path is not a directory. */ - const O_DIRECTORY: number; - /** - * constant for fs.open(). - * Flag indicating reading accesses to the file system will no longer result in - * an update to the atime information associated with the file. - * This flag is available on Linux operating systems only. - */ - const O_NOATIME: number; - /** Constant for fs.open(). Flag indicating that the open should fail if the path is a symbolic link. */ - const O_NOFOLLOW: number; - /** Constant for fs.open(). Flag indicating that the file is opened for synchronous I/O. */ - const O_SYNC: number; - /** Constant for fs.open(). Flag indicating that the file is opened for synchronous I/O with write operations waiting for data integrity. */ - const O_DSYNC: number; - /** Constant for fs.open(). Flag indicating to open the symbolic link itself rather than the resource it is pointing to. */ - const O_SYMLINK: number; - /** Constant for fs.open(). When set, an attempt will be made to minimize caching effects of file I/O. */ - const O_DIRECT: number; - /** Constant for fs.open(). Flag indicating to open the file in nonblocking mode when possible. */ - const O_NONBLOCK: number; - // File Type Constants - /** Constant for fs.Stats mode property for determining a file's type. Bit mask used to extract the file type code. */ - const S_IFMT: number; - /** Constant for fs.Stats mode property for determining a file's type. File type constant for a regular file. */ - const S_IFREG: number; - /** Constant for fs.Stats mode property for determining a file's type. File type constant for a directory. */ - const S_IFDIR: number; - /** Constant for fs.Stats mode property for determining a file's type. File type constant for a character-oriented device file. */ - const S_IFCHR: number; - /** Constant for fs.Stats mode property for determining a file's type. File type constant for a block-oriented device file. */ - const S_IFBLK: number; - /** Constant for fs.Stats mode property for determining a file's type. File type constant for a FIFO/pipe. */ - const S_IFIFO: number; - /** Constant for fs.Stats mode property for determining a file's type. File type constant for a symbolic link. */ - const S_IFLNK: number; - /** Constant for fs.Stats mode property for determining a file's type. File type constant for a socket. */ - const S_IFSOCK: number; - // File Mode Constants - /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable, writable and executable by owner. */ - const S_IRWXU: number; - /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable by owner. */ - const S_IRUSR: number; - /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating writable by owner. */ - const S_IWUSR: number; - /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating executable by owner. */ - const S_IXUSR: number; - /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable, writable and executable by group. */ - const S_IRWXG: number; - /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable by group. */ - const S_IRGRP: number; - /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating writable by group. */ - const S_IWGRP: number; - /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating executable by group. */ - const S_IXGRP: number; - /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable, writable and executable by others. */ - const S_IRWXO: number; - /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable by others. */ - const S_IROTH: number; - /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating writable by others. */ - const S_IWOTH: number; - /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating executable by others. */ - const S_IXOTH: number; - /** - * When set, a memory file mapping is used to access the file. This flag - * is available on Windows operating systems only. On other operating systems, - * this flag is ignored. - */ - const UV_FS_O_FILEMAP: number; - } - /** - * Tests a user's permissions for the file or directory specified by `path`. - * The `mode` argument is an optional integer that specifies the accessibility - * checks to be performed. `mode` should be either the value `fs.constants.F_OK`or a mask consisting of the bitwise OR of any of `fs.constants.R_OK`,`fs.constants.W_OK`, and `fs.constants.X_OK` - * (e.g.`fs.constants.W_OK | fs.constants.R_OK`). Check `File access constants` for - * possible values of `mode`. - * - * The final argument, `callback`, is a callback function that is invoked with - * a possible error argument. If any of the accessibility checks fail, the error - * argument will be an `Error` object. The following examples check if`package.json` exists, and if it is readable or writable. - * - * ```js - * import { access, constants } from 'fs'; - * - * const file = 'package.json'; - * - * // Check if the file exists in the current directory. - * access(file, constants.F_OK, (err) => { - * console.log(`${file} ${err ? 'does not exist' : 'exists'}`); - * }); - * - * // Check if the file is readable. - * access(file, constants.R_OK, (err) => { - * console.log(`${file} ${err ? 'is not readable' : 'is readable'}`); - * }); - * - * // Check if the file is writable. - * access(file, constants.W_OK, (err) => { - * console.log(`${file} ${err ? 'is not writable' : 'is writable'}`); - * }); - * - * // Check if the file is readable and writable. - * access(file, constants.R_OK | constants.W_OK, (err) => { - * console.log(`${file} ${err ? 'is not' : 'is'} readable and writable`); - * }); - * ``` - * - * Do not use `fs.access()` to check for the accessibility of a file before calling`fs.open()`, `fs.readFile()` or `fs.writeFile()`. Doing - * so introduces a race condition, since other processes may change the file's - * state between the two calls. Instead, user code should open/read/write the - * file directly and handle the error raised if the file is not accessible. - * - * **write (NOT RECOMMENDED)** - * - * ```js - * import { access, open, close } from 'fs'; - * - * access('myfile', (err) => { - * if (!err) { - * console.error('myfile already exists'); - * return; - * } - * - * open('myfile', 'wx', (err, fd) => { - * if (err) throw err; - * - * try { - * writeMyData(fd); - * } finally { - * close(fd, (err) => { - * if (err) throw err; - * }); - * } - * }); - * }); - * ``` - * - * **write (RECOMMENDED)** - * - * ```js - * import { open, close } from 'fs'; - * - * open('myfile', 'wx', (err, fd) => { - * if (err) { - * if (err.code === 'EEXIST') { - * console.error('myfile already exists'); - * return; - * } - * - * throw err; - * } - * - * try { - * writeMyData(fd); - * } finally { - * close(fd, (err) => { - * if (err) throw err; - * }); - * } - * }); - * ``` - * - * **read (NOT RECOMMENDED)** - * - * ```js - * import { access, open, close } from 'fs'; - * access('myfile', (err) => { - * if (err) { - * if (err.code === 'ENOENT') { - * console.error('myfile does not exist'); - * return; - * } - * - * throw err; - * } - * - * open('myfile', 'r', (err, fd) => { - * if (err) throw err; - * - * try { - * readMyData(fd); - * } finally { - * close(fd, (err) => { - * if (err) throw err; - * }); - * } - * }); - * }); - * ``` - * - * **read (RECOMMENDED)** - * - * ```js - * import { open, close } from 'fs'; - * - * open('myfile', 'r', (err, fd) => { - * if (err) { - * if (err.code === 'ENOENT') { - * console.error('myfile does not exist'); - * return; - * } - * - * throw err; - * } - * - * try { - * readMyData(fd); - * } finally { - * close(fd, (err) => { - * if (err) throw err; - * }); - * } - * }); - * ``` - * - * The "not recommended" examples above check for accessibility and then use the - * file; the "recommended" examples are better because they use the file directly - * and handle the error, if any. - * - * In general, check for the accessibility of a file only if the file will not be - * used directly, for example when its accessibility is a signal from another - * process. - * - * On Windows, access-control policies (ACLs) on a directory may limit access to - * a file or directory. The `fs.access()` function, however, does not check the - * ACL and therefore may report that a path is accessible even if the ACL restricts - * the user from reading or writing to it. - * @since v0.11.15 - * @param [mode=fs.constants.F_OK] - */ - export function access(path: PathLike, mode: number | undefined, callback: NoParamCallback): void; - /** - * Asynchronously tests a user's permissions for the file specified by path. - * @param path A path to a file or directory. If a URL is provided, it must use the `file:` protocol. - */ - export function access(path: PathLike, callback: NoParamCallback): void; - export namespace access { - /** - * Asynchronously tests a user's permissions for the file specified by path. - * @param path A path to a file or directory. If a URL is provided, it must use the `file:` protocol. - * URL support is _experimental_. - */ - function __promisify__(path: PathLike, mode?: number): Promise; - } - /** - * Synchronously tests a user's permissions for the file or directory specified - * by `path`. The `mode` argument is an optional integer that specifies the - * accessibility checks to be performed. `mode` should be either the value`fs.constants.F_OK` or a mask consisting of the bitwise OR of any of`fs.constants.R_OK`, `fs.constants.W_OK`, and - * `fs.constants.X_OK` (e.g.`fs.constants.W_OK | fs.constants.R_OK`). Check `File access constants` for - * possible values of `mode`. - * - * If any of the accessibility checks fail, an `Error` will be thrown. Otherwise, - * the method will return `undefined`. - * - * ```js - * import { accessSync, constants } from 'fs'; - * - * try { - * accessSync('etc/passwd', constants.R_OK | constants.W_OK); - * console.log('can read/write'); - * } catch (err) { - * console.error('no access!'); - * } - * ``` - * @since v0.11.15 - * @param [mode=fs.constants.F_OK] - */ - export function accessSync(path: PathLike, mode?: number): void; - interface StreamOptions { - flags?: string | undefined; - encoding?: BufferEncoding | undefined; - fd?: number | promises.FileHandle | undefined; - mode?: number | undefined; - autoClose?: boolean | undefined; - /** - * @default false - */ - emitClose?: boolean | undefined; - start?: number | undefined; - highWaterMark?: number | undefined; - } - interface ReadStreamOptions extends StreamOptions { - end?: number | undefined; - } - /** - * Unlike the 16 kb default `highWaterMark` for a `stream.Readable`, the stream - * returned by this method has a default `highWaterMark` of 64 kb. - * - * `options` can include `start` and `end` values to read a range of bytes from - * the file instead of the entire file. Both `start` and `end` are inclusive and - * start counting at 0, allowed values are in the - * \[0, [`Number.MAX_SAFE_INTEGER`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER)\] range. If `fd` is specified and `start` is - * omitted or `undefined`, `fs.createReadStream()` reads sequentially from the - * current file position. The `encoding` can be any one of those accepted by `Buffer`. - * - * If `fd` is specified, `ReadStream` will ignore the `path` argument and will use - * the specified file descriptor. This means that no `'open'` event will be - * emitted. `fd` should be blocking; non-blocking `fd`s should be passed to `net.Socket`. - * - * If `fd` points to a character device that only supports blocking reads - * (such as keyboard or sound card), read operations do not finish until data is - * available. This can prevent the process from exiting and the stream from - * closing naturally. - * - * By default, the stream will emit a `'close'` event after it has been - * destroyed. Set the `emitClose` option to `false` to change this behavior. - * - * By providing the `fs` option, it is possible to override the corresponding `fs`implementations for `open`, `read`, and `close`. When providing the `fs` option, - * an override for `read` is required. If no `fd` is provided, an override for`open` is also required. If `autoClose` is `true`, an override for `close` is - * also required. - * - * ```js - * import { createReadStream } from 'fs'; - * - * // Create a stream from some character device. - * const stream = createReadStream('/dev/input/event0'); - * setTimeout(() => { - * stream.close(); // This may not close the stream. - * // Artificially marking end-of-stream, as if the underlying resource had - * // indicated end-of-file by itself, allows the stream to close. - * // This does not cancel pending read operations, and if there is such an - * // operation, the process may still not be able to exit successfully - * // until it finishes. - * stream.push(null); - * stream.read(0); - * }, 100); - * ``` - * - * If `autoClose` is false, then the file descriptor won't be closed, even if - * there's an error. It is the application's responsibility to close it and make - * sure there's no file descriptor leak. If `autoClose` is set to true (default - * behavior), on `'error'` or `'end'` the file descriptor will be closed - * automatically. - * - * `mode` sets the file mode (permission and sticky bits), but only if the - * file was created. - * - * An example to read the last 10 bytes of a file which is 100 bytes long: - * - * ```js - * import { createReadStream } from 'fs'; - * - * createReadStream('sample.txt', { start: 90, end: 99 }); - * ``` - * - * If `options` is a string, then it specifies the encoding. - * @since v0.1.31 - */ - export function createReadStream(path: PathLike, options?: BufferEncoding | ReadStreamOptions): ReadStream; - /** - * `options` may also include a `start` option to allow writing data at some - * position past the beginning of the file, allowed values are in the - * \[0, [`Number.MAX_SAFE_INTEGER`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER)\] range. Modifying a file rather than - * replacing it may require the `flags` option to be set to `r+` rather than the - * default `w`. The `encoding` can be any one of those accepted by `Buffer`. - * - * If `autoClose` is set to true (default behavior) on `'error'` or `'finish'`the file descriptor will be closed automatically. If `autoClose` is false, - * then the file descriptor won't be closed, even if there's an error. - * It is the application's responsibility to close it and make sure there's no - * file descriptor leak. - * - * By default, the stream will emit a `'close'` event after it has been - * destroyed. Set the `emitClose` option to `false` to change this behavior. - * - * By providing the `fs` option it is possible to override the corresponding `fs`implementations for `open`, `write`, `writev` and `close`. Overriding `write()`without `writev()` can reduce - * performance as some optimizations (`_writev()`) - * will be disabled. When providing the `fs` option, overrides for at least one of`write` and `writev` are required. If no `fd` option is supplied, an override - * for `open` is also required. If `autoClose` is `true`, an override for `close`is also required. - * - * Like `fs.ReadStream`, if `fd` is specified, `fs.WriteStream` will ignore the`path` argument and will use the specified file descriptor. This means that no`'open'` event will be - * emitted. `fd` should be blocking; non-blocking `fd`s - * should be passed to `net.Socket`. - * - * If `options` is a string, then it specifies the encoding. - * @since v0.1.31 - */ - export function createWriteStream(path: PathLike, options?: BufferEncoding | StreamOptions): WriteStream; - /** - * Forces all currently queued I/O operations associated with the file to the - * operating system's synchronized I/O completion state. Refer to the POSIX [`fdatasync(2)`](http://man7.org/linux/man-pages/man2/fdatasync.2.html) documentation for details. No arguments other - * than a possible - * exception are given to the completion callback. - * @since v0.1.96 - */ - export function fdatasync(fd: number, callback: NoParamCallback): void; - export namespace fdatasync { - /** - * Asynchronous fdatasync(2) - synchronize a file's in-core state with storage device. - * @param fd A file descriptor. - */ - function __promisify__(fd: number): Promise; - } - /** - * Forces all currently queued I/O operations associated with the file to the - * operating system's synchronized I/O completion state. Refer to the POSIX [`fdatasync(2)`](http://man7.org/linux/man-pages/man2/fdatasync.2.html) documentation for details. Returns `undefined`. - * @since v0.1.96 - */ - export function fdatasyncSync(fd: number): void; - /** - * Asynchronously copies `src` to `dest`. By default, `dest` is overwritten if it - * already exists. No arguments other than a possible exception are given to the - * callback function. Node.js makes no guarantees about the atomicity of the copy - * operation. If an error occurs after the destination file has been opened for - * writing, Node.js will attempt to remove the destination. - * - * `mode` is an optional integer that specifies the behavior - * of the copy operation. It is possible to create a mask consisting of the bitwise - * OR of two or more values (e.g.`fs.constants.COPYFILE_EXCL | fs.constants.COPYFILE_FICLONE`). - * - * * `fs.constants.COPYFILE_EXCL`: The copy operation will fail if `dest` already - * exists. - * * `fs.constants.COPYFILE_FICLONE`: The copy operation will attempt to create a - * copy-on-write reflink. If the platform does not support copy-on-write, then a - * fallback copy mechanism is used. - * * `fs.constants.COPYFILE_FICLONE_FORCE`: The copy operation will attempt to - * create a copy-on-write reflink. If the platform does not support - * copy-on-write, then the operation will fail. - * - * ```js - * import { copyFile, constants } from 'fs'; - * - * function callback(err) { - * if (err) throw err; - * console.log('source.txt was copied to destination.txt'); - * } - * - * // destination.txt will be created or overwritten by default. - * copyFile('source.txt', 'destination.txt', callback); - * - * // By using COPYFILE_EXCL, the operation will fail if destination.txt exists. - * copyFile('source.txt', 'destination.txt', constants.COPYFILE_EXCL, callback); - * ``` - * @since v8.5.0 - * @param src source filename to copy - * @param dest destination filename of the copy operation - * @param [mode=0] modifiers for copy operation. - */ - export function copyFile(src: PathLike, dest: PathLike, callback: NoParamCallback): void; - export function copyFile(src: PathLike, dest: PathLike, mode: number, callback: NoParamCallback): void; - export namespace copyFile { - function __promisify__(src: PathLike, dst: PathLike, mode?: number): Promise; - } - /** - * Synchronously copies `src` to `dest`. By default, `dest` is overwritten if it - * already exists. Returns `undefined`. Node.js makes no guarantees about the - * atomicity of the copy operation. If an error occurs after the destination file - * has been opened for writing, Node.js will attempt to remove the destination. - * - * `mode` is an optional integer that specifies the behavior - * of the copy operation. It is possible to create a mask consisting of the bitwise - * OR of two or more values (e.g.`fs.constants.COPYFILE_EXCL | fs.constants.COPYFILE_FICLONE`). - * - * * `fs.constants.COPYFILE_EXCL`: The copy operation will fail if `dest` already - * exists. - * * `fs.constants.COPYFILE_FICLONE`: The copy operation will attempt to create a - * copy-on-write reflink. If the platform does not support copy-on-write, then a - * fallback copy mechanism is used. - * * `fs.constants.COPYFILE_FICLONE_FORCE`: The copy operation will attempt to - * create a copy-on-write reflink. If the platform does not support - * copy-on-write, then the operation will fail. - * - * ```js - * import { copyFileSync, constants } from 'fs'; - * - * // destination.txt will be created or overwritten by default. - * copyFileSync('source.txt', 'destination.txt'); - * console.log('source.txt was copied to destination.txt'); - * - * // By using COPYFILE_EXCL, the operation will fail if destination.txt exists. - * copyFileSync('source.txt', 'destination.txt', constants.COPYFILE_EXCL); - * ``` - * @since v8.5.0 - * @param src source filename to copy - * @param dest destination filename of the copy operation - * @param [mode=0] modifiers for copy operation. - */ - export function copyFileSync(src: PathLike, dest: PathLike, mode?: number): void; - /** - * Write an array of `ArrayBufferView`s to the file specified by `fd` using`writev()`. - * - * `position` is the offset from the beginning of the file where this data - * should be written. If `typeof position !== 'number'`, the data will be written - * at the current position. - * - * The callback will be given three arguments: `err`, `bytesWritten`, and`buffers`. `bytesWritten` is how many bytes were written from `buffers`. - * - * If this method is `util.promisify()` ed, it returns a promise for an`Object` with `bytesWritten` and `buffers` properties. - * - * It is unsafe to use `fs.writev()` multiple times on the same file without - * waiting for the callback. For this scenario, use {@link createWriteStream}. - * - * On Linux, positional writes don't work when the file is opened in append mode. - * The kernel ignores the position argument and always appends the data to - * the end of the file. - * @since v12.9.0 - */ - export function writev(fd: number, buffers: ReadonlyArray, cb: (err: NodeJS.ErrnoException | null, bytesWritten: number, buffers: NodeJS.ArrayBufferView[]) => void): void; - export function writev( - fd: number, - buffers: ReadonlyArray, - position: number, - cb: (err: NodeJS.ErrnoException | null, bytesWritten: number, buffers: NodeJS.ArrayBufferView[]) => void - ): void; - export interface WriteVResult { - bytesWritten: number; - buffers: NodeJS.ArrayBufferView[]; - } - export namespace writev { - function __promisify__(fd: number, buffers: ReadonlyArray, position?: number): Promise; - } - /** - * For detailed information, see the documentation of the asynchronous version of - * this API: {@link writev}. - * @since v12.9.0 - * @return The number of bytes written. - */ - export function writevSync(fd: number, buffers: ReadonlyArray, position?: number): number; - /** - * Read from a file specified by `fd` and write to an array of `ArrayBufferView`s - * using `readv()`. - * - * `position` is the offset from the beginning of the file from where data - * should be read. If `typeof position !== 'number'`, the data will be read - * from the current position. - * - * The callback will be given three arguments: `err`, `bytesRead`, and`buffers`. `bytesRead` is how many bytes were read from the file. - * - * If this method is invoked as its `util.promisify()` ed version, it returns - * a promise for an `Object` with `bytesRead` and `buffers` properties. - * @since v13.13.0, v12.17.0 - */ - export function readv(fd: number, buffers: ReadonlyArray, cb: (err: NodeJS.ErrnoException | null, bytesRead: number, buffers: NodeJS.ArrayBufferView[]) => void): void; - export function readv( - fd: number, - buffers: ReadonlyArray, - position: number, - cb: (err: NodeJS.ErrnoException | null, bytesRead: number, buffers: NodeJS.ArrayBufferView[]) => void - ): void; - export interface ReadVResult { - bytesRead: number; - buffers: NodeJS.ArrayBufferView[]; - } - export namespace readv { - function __promisify__(fd: number, buffers: ReadonlyArray, position?: number): Promise; - } - /** - * For detailed information, see the documentation of the asynchronous version of - * this API: {@link readv}. - * @since v13.13.0, v12.17.0 - * @return The number of bytes read. - */ - export function readvSync(fd: number, buffers: ReadonlyArray, position?: number): number; - export interface OpenDirOptions { - encoding?: BufferEncoding | undefined; - /** - * Number of directory entries that are buffered - * internally when reading from the directory. Higher values lead to better - * performance but higher memory usage. - * @default 32 - */ - bufferSize?: number | undefined; - } - /** - * Synchronously open a directory. See [`opendir(3)`](http://man7.org/linux/man-pages/man3/opendir.3.html). - * - * Creates an `fs.Dir`, which contains all further functions for reading from - * and cleaning up the directory. - * - * The `encoding` option sets the encoding for the `path` while opening the - * directory and subsequent read operations. - * @since v12.12.0 - */ - export function opendirSync(path: PathLike, options?: OpenDirOptions): Dir; - /** - * Asynchronously open a directory. See the POSIX [`opendir(3)`](http://man7.org/linux/man-pages/man3/opendir.3.html) documentation for - * more details. - * - * Creates an `fs.Dir`, which contains all further functions for reading from - * and cleaning up the directory. - * - * The `encoding` option sets the encoding for the `path` while opening the - * directory and subsequent read operations. - * @since v12.12.0 - */ - export function opendir(path: PathLike, cb: (err: NodeJS.ErrnoException | null, dir: Dir) => void): void; - export function opendir(path: PathLike, options: OpenDirOptions, cb: (err: NodeJS.ErrnoException | null, dir: Dir) => void): void; - export namespace opendir { - function __promisify__(path: PathLike, options?: OpenDirOptions): Promise; - } - export interface BigIntStats extends StatsBase { - atimeNs: bigint; - mtimeNs: bigint; - ctimeNs: bigint; - birthtimeNs: bigint; - } - export interface BigIntOptions { - bigint: true; - } - export interface StatOptions { - bigint?: boolean | undefined; - } - export interface StatSyncOptions extends StatOptions { - throwIfNoEntry?: boolean | undefined; - } - interface CopyOptionsBase { - /** - * Dereference symlinks - * @default false - */ - dereference?: boolean; - /** - * When `force` is `false`, and the destination - * exists, throw an error. - * @default false - */ - errorOnExist?: boolean; - /** - * Overwrite existing file or directory. _The copy - * operation will ignore errors if you set this to false and the destination - * exists. Use the `errorOnExist` option to change this behavior. - * @default true - */ - force?: boolean; - /** - * When `true` timestamps from `src` will - * be preserved. - * @default false - */ - preserveTimestamps?: boolean; - /** - * Copy directories recursively. - * @default false - */ - recursive?: boolean; - /** - * When true, path resolution for symlinks will be skipped - * @default false - */ - verbatimSymlinks?: boolean; - } - export interface CopyOptions extends CopyOptionsBase { - /** - * Function to filter copied files/directories. Return - * `true` to copy the item, `false` to ignore it. - */ - filter?(source: string, destination: string): boolean | Promise; - } - export interface CopySyncOptions extends CopyOptionsBase { - /** - * Function to filter copied files/directories. Return - * `true` to copy the item, `false` to ignore it. - */ - filter?(source: string, destination: string): boolean; - } - /** - * Asynchronously copies the entire directory structure from `src` to `dest`, - * including subdirectories and files. - * - * When copying a directory to another directory, globs are not supported and - * behavior is similar to `cp dir1/ dir2/`. - * @since v16.7.0 - * @experimental - * @param src source path to copy. - * @param dest destination path to copy to. - */ - export function cp(source: string | URL, destination: string | URL, callback: (err: NodeJS.ErrnoException | null) => void): void; - export function cp(source: string | URL, destination: string | URL, opts: CopyOptions, callback: (err: NodeJS.ErrnoException | null) => void): void; - /** - * Synchronously copies the entire directory structure from `src` to `dest`, - * including subdirectories and files. - * - * When copying a directory to another directory, globs are not supported and - * behavior is similar to `cp dir1/ dir2/`. - * @since v16.7.0 - * @experimental - * @param src source path to copy. - * @param dest destination path to copy to. - */ - export function cpSync(source: string | URL, destination: string | URL, opts?: CopySyncOptions): void; -} -declare module 'node:fs' { - export * from 'fs'; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/fs/promises.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/fs/promises.d.ts deleted file mode 100755 index aca2fd51..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/fs/promises.d.ts +++ /dev/null @@ -1,1138 +0,0 @@ -/** - * The `fs/promises` API provides asynchronous file system methods that return - * promises. - * - * The promise APIs use the underlying Node.js threadpool to perform file - * system operations off the event loop thread. These operations are not - * synchronized or threadsafe. Care must be taken when performing multiple - * concurrent modifications on the same file or data corruption may occur. - * @since v10.0.0 - */ -declare module 'fs/promises' { - import { Abortable } from 'node:events'; - import { Stream } from 'node:stream'; - import { ReadableStream } from 'node:stream/web'; - import { - BigIntStats, - BufferEncodingOption, - constants as fsConstants, - CopyOptions, - Dir, - Dirent, - MakeDirectoryOptions, - Mode, - ObjectEncodingOptions, - OpenDirOptions, - OpenMode, - PathLike, - ReadStream, - ReadVResult, - RmDirOptions, - RmOptions, - StatOptions, - Stats, - TimeLike, - WatchEventType, - WatchOptions, - WriteStream, - WriteVResult, - } from 'node:fs'; - import { Interface as ReadlineInterface } from 'node:readline'; - - interface FileChangeInfo { - eventType: WatchEventType; - filename: T; - } - interface FlagAndOpenMode { - mode?: Mode | undefined; - flag?: OpenMode | undefined; - } - interface FileReadResult { - bytesRead: number; - buffer: T; - } - interface FileReadOptions { - /** - * @default `Buffer.alloc(0xffff)` - */ - buffer?: T; - /** - * @default 0 - */ - offset?: number | null; - /** - * @default `buffer.byteLength` - */ - length?: number | null; - position?: number | null; - } - interface CreateReadStreamOptions { - encoding?: BufferEncoding | null | undefined; - autoClose?: boolean | undefined; - emitClose?: boolean | undefined; - start?: number | undefined; - end?: number | undefined; - highWaterMark?: number | undefined; - } - interface CreateWriteStreamOptions { - encoding?: BufferEncoding | null | undefined; - autoClose?: boolean | undefined; - emitClose?: boolean | undefined; - start?: number | undefined; - } - // TODO: Add `EventEmitter` close - interface FileHandle { - /** - * The numeric file descriptor managed by the {FileHandle} object. - * @since v10.0.0 - */ - readonly fd: number; - /** - * Alias of `filehandle.writeFile()`. - * - * When operating on file handles, the mode cannot be changed from what it was set - * to with `fsPromises.open()`. Therefore, this is equivalent to `filehandle.writeFile()`. - * @since v10.0.0 - * @return Fulfills with `undefined` upon success. - */ - appendFile(data: string | Uint8Array, options?: (ObjectEncodingOptions & FlagAndOpenMode) | BufferEncoding | null): Promise; - /** - * Changes the ownership of the file. A wrapper for [`chown(2)`](http://man7.org/linux/man-pages/man2/chown.2.html). - * @since v10.0.0 - * @param uid The file's new owner's user id. - * @param gid The file's new group's group id. - * @return Fulfills with `undefined` upon success. - */ - chown(uid: number, gid: number): Promise; - /** - * Modifies the permissions on the file. See [`chmod(2)`](http://man7.org/linux/man-pages/man2/chmod.2.html). - * @since v10.0.0 - * @param mode the file mode bit mask. - * @return Fulfills with `undefined` upon success. - */ - chmod(mode: Mode): Promise; - /** - * Unlike the 16 kb default `highWaterMark` for a `stream.Readable`, the stream - * returned by this method has a default `highWaterMark` of 64 kb. - * - * `options` can include `start` and `end` values to read a range of bytes from - * the file instead of the entire file. Both `start` and `end` are inclusive and - * start counting at 0, allowed values are in the - * \[0, [`Number.MAX_SAFE_INTEGER`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER)\] range. If `start` is - * omitted or `undefined`, `filehandle.createReadStream()` reads sequentially from - * the current file position. The `encoding` can be any one of those accepted by `Buffer`. - * - * If the `FileHandle` points to a character device that only supports blocking - * reads (such as keyboard or sound card), read operations do not finish until data - * is available. This can prevent the process from exiting and the stream from - * closing naturally. - * - * By default, the stream will emit a `'close'` event after it has been - * destroyed. Set the `emitClose` option to `false` to change this behavior. - * - * ```js - * import { open } from 'fs/promises'; - * - * const fd = await open('/dev/input/event0'); - * // Create a stream from some character device. - * const stream = fd.createReadStream(); - * setTimeout(() => { - * stream.close(); // This may not close the stream. - * // Artificially marking end-of-stream, as if the underlying resource had - * // indicated end-of-file by itself, allows the stream to close. - * // This does not cancel pending read operations, and if there is such an - * // operation, the process may still not be able to exit successfully - * // until it finishes. - * stream.push(null); - * stream.read(0); - * }, 100); - * ``` - * - * If `autoClose` is false, then the file descriptor won't be closed, even if - * there's an error. It is the application's responsibility to close it and make - * sure there's no file descriptor leak. If `autoClose` is set to true (default - * behavior), on `'error'` or `'end'` the file descriptor will be closed - * automatically. - * - * An example to read the last 10 bytes of a file which is 100 bytes long: - * - * ```js - * import { open } from 'fs/promises'; - * - * const fd = await open('sample.txt'); - * fd.createReadStream({ start: 90, end: 99 }); - * ``` - * @since v16.11.0 - */ - createReadStream(options?: CreateReadStreamOptions): ReadStream; - /** - * `options` may also include a `start` option to allow writing data at some - * position past the beginning of the file, allowed values are in the - * \[0, [`Number.MAX_SAFE_INTEGER`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER)\] range. Modifying a file rather than - * replacing it may require the `flags` `open` option to be set to `r+` rather than - * the default `r`. The `encoding` can be any one of those accepted by `Buffer`. - * - * If `autoClose` is set to true (default behavior) on `'error'` or `'finish'`the file descriptor will be closed automatically. If `autoClose` is false, - * then the file descriptor won't be closed, even if there's an error. - * It is the application's responsibility to close it and make sure there's no - * file descriptor leak. - * - * By default, the stream will emit a `'close'` event after it has been - * destroyed. Set the `emitClose` option to `false` to change this behavior. - * @since v16.11.0 - */ - createWriteStream(options?: CreateWriteStreamOptions): WriteStream; - /** - * Forces all currently queued I/O operations associated with the file to the - * operating system's synchronized I/O completion state. Refer to the POSIX [`fdatasync(2)`](http://man7.org/linux/man-pages/man2/fdatasync.2.html) documentation for details. - * - * Unlike `filehandle.sync` this method does not flush modified metadata. - * @since v10.0.0 - * @return Fulfills with `undefined` upon success. - */ - datasync(): Promise; - /** - * Request that all data for the open file descriptor is flushed to the storage - * device. The specific implementation is operating system and device specific. - * Refer to the POSIX [`fsync(2)`](http://man7.org/linux/man-pages/man2/fsync.2.html) documentation for more detail. - * @since v10.0.0 - * @return Fufills with `undefined` upon success. - */ - sync(): Promise; - /** - * Reads data from the file and stores that in the given buffer. - * - * If the file is not modified concurrently, the end-of-file is reached when the - * number of bytes read is zero. - * @since v10.0.0 - * @param buffer A buffer that will be filled with the file data read. - * @param offset The location in the buffer at which to start filling. - * @param length The number of bytes to read. - * @param position The location where to begin reading data from the file. If `null`, data will be read from the current file position, and the position will be updated. If `position` is an - * integer, the current file position will remain unchanged. - * @return Fulfills upon success with an object with two properties: - */ - read(buffer: T, offset?: number | null, length?: number | null, position?: number | null): Promise>; - read(options?: FileReadOptions): Promise>; - /** - * Returns a `ReadableStream` that may be used to read the files data. - * - * An error will be thrown if this method is called more than once or is called after the `FileHandle` is closed - * or closing. - * - * ```js - * import { open } from 'node:fs/promises'; - * - * const file = await open('./some/file/to/read'); - * - * for await (const chunk of file.readableWebStream()) - * console.log(chunk); - * - * await file.close(); - * ``` - * - * While the `ReadableStream` will read the file to completion, it will not close the `FileHandle` automatically. User code must still call the `fileHandle.close()` method. - * - * @since v17.0.0 - * @experimental - */ - readableWebStream(): ReadableStream; - /** - * Asynchronously reads the entire contents of a file. - * - * If `options` is a string, then it specifies the `encoding`. - * - * The `FileHandle` has to support reading. - * - * If one or more `filehandle.read()` calls are made on a file handle and then a`filehandle.readFile()` call is made, the data will be read from the current - * position till the end of the file. It doesn't always read from the beginning - * of the file. - * @since v10.0.0 - * @return Fulfills upon a successful read with the contents of the file. If no encoding is specified (using `options.encoding`), the data is returned as a {Buffer} object. Otherwise, the - * data will be a string. - */ - readFile( - options?: { - encoding?: null | undefined; - flag?: OpenMode | undefined; - } | null - ): Promise; - /** - * Asynchronously reads the entire contents of a file. The underlying file will _not_ be closed automatically. - * The `FileHandle` must have been opened for reading. - * @param options An object that may contain an optional flag. - * If a flag is not provided, it defaults to `'r'`. - */ - readFile( - options: - | { - encoding: BufferEncoding; - flag?: OpenMode | undefined; - } - | BufferEncoding - ): Promise; - /** - * Asynchronously reads the entire contents of a file. The underlying file will _not_ be closed automatically. - * The `FileHandle` must have been opened for reading. - * @param options An object that may contain an optional flag. - * If a flag is not provided, it defaults to `'r'`. - */ - readFile( - options?: - | (ObjectEncodingOptions & { - flag?: OpenMode | undefined; - }) - | BufferEncoding - | null - ): Promise; - /** - * Convenience method to create a `readline` interface and stream over the file. For example: - * - * ```js - * import { open } from 'node:fs/promises'; - * - * const file = await open('./some/file/to/read'); - * - * for await (const line of file.readLines()) { - * console.log(line); - * } - * ``` - * - * @since v18.11.0 - * @param options See `filehandle.createReadStream()` for the options. - */ - readLines(options?: CreateReadStreamOptions): ReadlineInterface; - /** - * @since v10.0.0 - * @return Fulfills with an {fs.Stats} for the file. - */ - stat( - opts?: StatOptions & { - bigint?: false | undefined; - } - ): Promise; - stat( - opts: StatOptions & { - bigint: true; - } - ): Promise; - stat(opts?: StatOptions): Promise; - /** - * Truncates the file. - * - * If the file was larger than `len` bytes, only the first `len` bytes will be - * retained in the file. - * - * The following example retains only the first four bytes of the file: - * - * ```js - * import { open } from 'fs/promises'; - * - * let filehandle = null; - * try { - * filehandle = await open('temp.txt', 'r+'); - * await filehandle.truncate(4); - * } finally { - * await filehandle?.close(); - * } - * ``` - * - * If the file previously was shorter than `len` bytes, it is extended, and the - * extended part is filled with null bytes (`'\0'`): - * - * If `len` is negative then `0` will be used. - * @since v10.0.0 - * @param [len=0] - * @return Fulfills with `undefined` upon success. - */ - truncate(len?: number): Promise; - /** - * Change the file system timestamps of the object referenced by the `FileHandle` then resolves the promise with no arguments upon success. - * @since v10.0.0 - */ - utimes(atime: TimeLike, mtime: TimeLike): Promise; - /** - * Asynchronously writes data to a file, replacing the file if it already exists.`data` can be a string, a buffer, an - * [AsyncIterable](https://tc39.github.io/ecma262/#sec-asynciterable-interface) or - * [Iterable](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#The_iterable_protocol) object. - * The promise is resolved with no arguments upon success. - * - * If `options` is a string, then it specifies the `encoding`. - * - * The `FileHandle` has to support writing. - * - * It is unsafe to use `filehandle.writeFile()` multiple times on the same file - * without waiting for the promise to be resolved (or rejected). - * - * If one or more `filehandle.write()` calls are made on a file handle and then a`filehandle.writeFile()` call is made, the data will be written from the - * current position till the end of the file. It doesn't always write from the - * beginning of the file. - * @since v10.0.0 - */ - writeFile(data: string | Uint8Array, options?: (ObjectEncodingOptions & FlagAndOpenMode & Abortable) | BufferEncoding | null): Promise; - /** - * Write `buffer` to the file. - * - * The promise is resolved with an object containing two properties: - * - * It is unsafe to use `filehandle.write()` multiple times on the same file - * without waiting for the promise to be resolved (or rejected). For this - * scenario, use `filehandle.createWriteStream()`. - * - * On Linux, positional writes do not work when the file is opened in append mode. - * The kernel ignores the position argument and always appends the data to - * the end of the file. - * @since v10.0.0 - * @param [offset=0] The start position from within `buffer` where the data to write begins. - * @param [length=buffer.byteLength - offset] The number of bytes from `buffer` to write. - * @param position The offset from the beginning of the file where the data from `buffer` should be written. If `position` is not a `number`, the data will be written at the current position. - * See the POSIX pwrite(2) documentation for more detail. - */ - write( - buffer: TBuffer, - offset?: number | null, - length?: number | null, - position?: number | null - ): Promise<{ - bytesWritten: number; - buffer: TBuffer; - }>; - write( - data: string, - position?: number | null, - encoding?: BufferEncoding | null - ): Promise<{ - bytesWritten: number; - buffer: string; - }>; - /** - * Write an array of [ArrayBufferView](https://developer.mozilla.org/en-US/docs/Web/API/ArrayBufferView) s to the file. - * - * The promise is resolved with an object containing a two properties: - * - * It is unsafe to call `writev()` multiple times on the same file without waiting - * for the promise to be resolved (or rejected). - * - * On Linux, positional writes don't work when the file is opened in append mode. - * The kernel ignores the position argument and always appends the data to - * the end of the file. - * @since v12.9.0 - * @param position The offset from the beginning of the file where the data from `buffers` should be written. If `position` is not a `number`, the data will be written at the current - * position. - */ - writev(buffers: ReadonlyArray, position?: number): Promise; - /** - * Read from a file and write to an array of [ArrayBufferView](https://developer.mozilla.org/en-US/docs/Web/API/ArrayBufferView) s - * @since v13.13.0, v12.17.0 - * @param position The offset from the beginning of the file where the data should be read from. If `position` is not a `number`, the data will be read from the current position. - * @return Fulfills upon success an object containing two properties: - */ - readv(buffers: ReadonlyArray, position?: number): Promise; - /** - * Closes the file handle after waiting for any pending operation on the handle to - * complete. - * - * ```js - * import { open } from 'fs/promises'; - * - * let filehandle; - * try { - * filehandle = await open('thefile.txt', 'r'); - * } finally { - * await filehandle?.close(); - * } - * ``` - * @since v10.0.0 - * @return Fulfills with `undefined` upon success. - */ - close(): Promise; - } - - const constants: typeof fsConstants; - - /** - * Tests a user's permissions for the file or directory specified by `path`. - * The `mode` argument is an optional integer that specifies the accessibility - * checks to be performed. `mode` should be either the value `fs.constants.F_OK`or a mask consisting of the bitwise OR of any of `fs.constants.R_OK`,`fs.constants.W_OK`, and `fs.constants.X_OK` - * (e.g.`fs.constants.W_OK | fs.constants.R_OK`). Check `File access constants` for - * possible values of `mode`. - * - * If the accessibility check is successful, the promise is resolved with no - * value. If any of the accessibility checks fail, the promise is rejected - * with an [Error](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error) object. The following example checks if the file`/etc/passwd` can be read and - * written by the current process. - * - * ```js - * import { access } from 'fs/promises'; - * import { constants } from 'fs'; - * - * try { - * await access('/etc/passwd', constants.R_OK | constants.W_OK); - * console.log('can access'); - * } catch { - * console.error('cannot access'); - * } - * ``` - * - * Using `fsPromises.access()` to check for the accessibility of a file before - * calling `fsPromises.open()` is not recommended. Doing so introduces a race - * condition, since other processes may change the file's state between the two - * calls. Instead, user code should open/read/write the file directly and handle - * the error raised if the file is not accessible. - * @since v10.0.0 - * @param [mode=fs.constants.F_OK] - * @return Fulfills with `undefined` upon success. - */ - function access(path: PathLike, mode?: number): Promise; - /** - * Asynchronously copies `src` to `dest`. By default, `dest` is overwritten if it - * already exists. - * - * No guarantees are made about the atomicity of the copy operation. If an - * error occurs after the destination file has been opened for writing, an attempt - * will be made to remove the destination. - * - * ```js - * import { constants } from 'fs'; - * import { copyFile } from 'fs/promises'; - * - * try { - * await copyFile('source.txt', 'destination.txt'); - * console.log('source.txt was copied to destination.txt'); - * } catch { - * console.log('The file could not be copied'); - * } - * - * // By using COPYFILE_EXCL, the operation will fail if destination.txt exists. - * try { - * await copyFile('source.txt', 'destination.txt', constants.COPYFILE_EXCL); - * console.log('source.txt was copied to destination.txt'); - * } catch { - * console.log('The file could not be copied'); - * } - * ``` - * @since v10.0.0 - * @param src source filename to copy - * @param dest destination filename of the copy operation - * @param [mode=0] Optional modifiers that specify the behavior of the copy operation. It is possible to create a mask consisting of the bitwise OR of two or more values (e.g. - * `fs.constants.COPYFILE_EXCL | fs.constants.COPYFILE_FICLONE`) - * @return Fulfills with `undefined` upon success. - */ - function copyFile(src: PathLike, dest: PathLike, mode?: number): Promise; - /** - * Opens a `FileHandle`. - * - * Refer to the POSIX [`open(2)`](http://man7.org/linux/man-pages/man2/open.2.html) documentation for more detail. - * - * Some characters (`< > : " / \ | ? *`) are reserved under Windows as documented - * by [Naming Files, Paths, and Namespaces](https://docs.microsoft.com/en-us/windows/desktop/FileIO/naming-a-file). Under NTFS, if the filename contains - * a colon, Node.js will open a file system stream, as described by [this MSDN page](https://docs.microsoft.com/en-us/windows/desktop/FileIO/using-streams). - * @since v10.0.0 - * @param [flags='r'] See `support of file system `flags``. - * @param [mode=0o666] Sets the file mode (permission and sticky bits) if the file is created. - * @return Fulfills with a {FileHandle} object. - */ - function open(path: PathLike, flags?: string | number, mode?: Mode): Promise; - /** - * Renames `oldPath` to `newPath`. - * @since v10.0.0 - * @return Fulfills with `undefined` upon success. - */ - function rename(oldPath: PathLike, newPath: PathLike): Promise; - /** - * Truncates (shortens or extends the length) of the content at `path` to `len`bytes. - * @since v10.0.0 - * @param [len=0] - * @return Fulfills with `undefined` upon success. - */ - function truncate(path: PathLike, len?: number): Promise; - /** - * Removes the directory identified by `path`. - * - * Using `fsPromises.rmdir()` on a file (not a directory) results in the - * promise being rejected with an `ENOENT` error on Windows and an `ENOTDIR`error on POSIX. - * - * To get a behavior similar to the `rm -rf` Unix command, use `fsPromises.rm()` with options `{ recursive: true, force: true }`. - * @since v10.0.0 - * @return Fulfills with `undefined` upon success. - */ - function rmdir(path: PathLike, options?: RmDirOptions): Promise; - /** - * Removes files and directories (modeled on the standard POSIX `rm` utility). - * @since v14.14.0 - * @return Fulfills with `undefined` upon success. - */ - function rm(path: PathLike, options?: RmOptions): Promise; - /** - * Asynchronously creates a directory. - * - * The optional `options` argument can be an integer specifying `mode` (permission - * and sticky bits), or an object with a `mode` property and a `recursive`property indicating whether parent directories should be created. Calling`fsPromises.mkdir()` when `path` is a directory - * that exists results in a - * rejection only when `recursive` is false. - * @since v10.0.0 - * @return Upon success, fulfills with `undefined` if `recursive` is `false`, or the first directory path created if `recursive` is `true`. - */ - function mkdir( - path: PathLike, - options: MakeDirectoryOptions & { - recursive: true; - } - ): Promise; - /** - * Asynchronous mkdir(2) - create a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders - * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. - */ - function mkdir( - path: PathLike, - options?: - | Mode - | (MakeDirectoryOptions & { - recursive?: false | undefined; - }) - | null - ): Promise; - /** - * Asynchronous mkdir(2) - create a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders - * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. - */ - function mkdir(path: PathLike, options?: Mode | MakeDirectoryOptions | null): Promise; - /** - * Reads the contents of a directory. - * - * The optional `options` argument can be a string specifying an encoding, or an - * object with an `encoding` property specifying the character encoding to use for - * the filenames. If the `encoding` is set to `'buffer'`, the filenames returned - * will be passed as `Buffer` objects. - * - * If `options.withFileTypes` is set to `true`, the resolved array will contain `fs.Dirent` objects. - * - * ```js - * import { readdir } from 'fs/promises'; - * - * try { - * const files = await readdir(path); - * for (const file of files) - * console.log(file); - * } catch (err) { - * console.error(err); - * } - * ``` - * @since v10.0.0 - * @return Fulfills with an array of the names of the files in the directory excluding `'.'` and `'..'`. - */ - function readdir( - path: PathLike, - options?: - | (ObjectEncodingOptions & { - withFileTypes?: false | undefined; - }) - | BufferEncoding - | null - ): Promise; - /** - * Asynchronous readdir(3) - read a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function readdir( - path: PathLike, - options: - | { - encoding: 'buffer'; - withFileTypes?: false | undefined; - } - | 'buffer' - ): Promise; - /** - * Asynchronous readdir(3) - read a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function readdir( - path: PathLike, - options?: - | (ObjectEncodingOptions & { - withFileTypes?: false | undefined; - }) - | BufferEncoding - | null - ): Promise; - /** - * Asynchronous readdir(3) - read a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options If called with `withFileTypes: true` the result data will be an array of Dirent. - */ - function readdir( - path: PathLike, - options: ObjectEncodingOptions & { - withFileTypes: true; - } - ): Promise; - /** - * Reads the contents of the symbolic link referred to by `path`. See the POSIX [`readlink(2)`](http://man7.org/linux/man-pages/man2/readlink.2.html) documentation for more detail. The promise is - * resolved with the`linkString` upon success. - * - * The optional `options` argument can be a string specifying an encoding, or an - * object with an `encoding` property specifying the character encoding to use for - * the link path returned. If the `encoding` is set to `'buffer'`, the link path - * returned will be passed as a `Buffer` object. - * @since v10.0.0 - * @return Fulfills with the `linkString` upon success. - */ - function readlink(path: PathLike, options?: ObjectEncodingOptions | BufferEncoding | null): Promise; - /** - * Asynchronous readlink(2) - read value of a symbolic link. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function readlink(path: PathLike, options: BufferEncodingOption): Promise; - /** - * Asynchronous readlink(2) - read value of a symbolic link. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function readlink(path: PathLike, options?: ObjectEncodingOptions | string | null): Promise; - /** - * Creates a symbolic link. - * - * The `type` argument is only used on Windows platforms and can be one of `'dir'`,`'file'`, or `'junction'`. Windows junction points require the destination path - * to be absolute. When using `'junction'`, the `target` argument will - * automatically be normalized to absolute path. - * @since v10.0.0 - * @param [type='file'] - * @return Fulfills with `undefined` upon success. - */ - function symlink(target: PathLike, path: PathLike, type?: string | null): Promise; - /** - * Equivalent to `fsPromises.stat()` unless `path` refers to a symbolic link, - * in which case the link itself is stat-ed, not the file that it refers to. - * Refer to the POSIX [`lstat(2)`](http://man7.org/linux/man-pages/man2/lstat.2.html) document for more detail. - * @since v10.0.0 - * @return Fulfills with the {fs.Stats} object for the given symbolic link `path`. - */ - function lstat( - path: PathLike, - opts?: StatOptions & { - bigint?: false | undefined; - } - ): Promise; - function lstat( - path: PathLike, - opts: StatOptions & { - bigint: true; - } - ): Promise; - function lstat(path: PathLike, opts?: StatOptions): Promise; - /** - * @since v10.0.0 - * @return Fulfills with the {fs.Stats} object for the given `path`. - */ - function stat( - path: PathLike, - opts?: StatOptions & { - bigint?: false | undefined; - } - ): Promise; - function stat( - path: PathLike, - opts: StatOptions & { - bigint: true; - } - ): Promise; - function stat(path: PathLike, opts?: StatOptions): Promise; - /** - * Creates a new link from the `existingPath` to the `newPath`. See the POSIX [`link(2)`](http://man7.org/linux/man-pages/man2/link.2.html) documentation for more detail. - * @since v10.0.0 - * @return Fulfills with `undefined` upon success. - */ - function link(existingPath: PathLike, newPath: PathLike): Promise; - /** - * If `path` refers to a symbolic link, then the link is removed without affecting - * the file or directory to which that link refers. If the `path` refers to a file - * path that is not a symbolic link, the file is deleted. See the POSIX [`unlink(2)`](http://man7.org/linux/man-pages/man2/unlink.2.html) documentation for more detail. - * @since v10.0.0 - * @return Fulfills with `undefined` upon success. - */ - function unlink(path: PathLike): Promise; - /** - * Changes the permissions of a file. - * @since v10.0.0 - * @return Fulfills with `undefined` upon success. - */ - function chmod(path: PathLike, mode: Mode): Promise; - /** - * Changes the permissions on a symbolic link. - * - * This method is only implemented on macOS. - * @deprecated Since v10.0.0 - * @return Fulfills with `undefined` upon success. - */ - function lchmod(path: PathLike, mode: Mode): Promise; - /** - * Changes the ownership on a symbolic link. - * @since v10.0.0 - * @return Fulfills with `undefined` upon success. - */ - function lchown(path: PathLike, uid: number, gid: number): Promise; - /** - * Changes the access and modification times of a file in the same way as `fsPromises.utimes()`, with the difference that if the path refers to a - * symbolic link, then the link is not dereferenced: instead, the timestamps of - * the symbolic link itself are changed. - * @since v14.5.0, v12.19.0 - * @return Fulfills with `undefined` upon success. - */ - function lutimes(path: PathLike, atime: TimeLike, mtime: TimeLike): Promise; - /** - * Changes the ownership of a file. - * @since v10.0.0 - * @return Fulfills with `undefined` upon success. - */ - function chown(path: PathLike, uid: number, gid: number): Promise; - /** - * Change the file system timestamps of the object referenced by `path`. - * - * The `atime` and `mtime` arguments follow these rules: - * - * * Values can be either numbers representing Unix epoch time, `Date`s, or a - * numeric string like `'123456789.0'`. - * * If the value can not be converted to a number, or is `NaN`, `Infinity` or`-Infinity`, an `Error` will be thrown. - * @since v10.0.0 - * @return Fulfills with `undefined` upon success. - */ - function utimes(path: PathLike, atime: TimeLike, mtime: TimeLike): Promise; - /** - * Determines the actual location of `path` using the same semantics as the`fs.realpath.native()` function. - * - * Only paths that can be converted to UTF8 strings are supported. - * - * The optional `options` argument can be a string specifying an encoding, or an - * object with an `encoding` property specifying the character encoding to use for - * the path. If the `encoding` is set to `'buffer'`, the path returned will be - * passed as a `Buffer` object. - * - * On Linux, when Node.js is linked against musl libc, the procfs file system must - * be mounted on `/proc` in order for this function to work. Glibc does not have - * this restriction. - * @since v10.0.0 - * @return Fulfills with the resolved path upon success. - */ - function realpath(path: PathLike, options?: ObjectEncodingOptions | BufferEncoding | null): Promise; - /** - * Asynchronous realpath(3) - return the canonicalized absolute pathname. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function realpath(path: PathLike, options: BufferEncodingOption): Promise; - /** - * Asynchronous realpath(3) - return the canonicalized absolute pathname. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function realpath(path: PathLike, options?: ObjectEncodingOptions | BufferEncoding | null): Promise; - /** - * Creates a unique temporary directory. A unique directory name is generated by - * appending six random characters to the end of the provided `prefix`. Due to - * platform inconsistencies, avoid trailing `X` characters in `prefix`. Some - * platforms, notably the BSDs, can return more than six random characters, and - * replace trailing `X` characters in `prefix` with random characters. - * - * The optional `options` argument can be a string specifying an encoding, or an - * object with an `encoding` property specifying the character encoding to use. - * - * ```js - * import { mkdtemp } from 'fs/promises'; - * - * try { - * await mkdtemp(path.join(os.tmpdir(), 'foo-')); - * } catch (err) { - * console.error(err); - * } - * ``` - * - * The `fsPromises.mkdtemp()` method will append the six randomly selected - * characters directly to the `prefix` string. For instance, given a directory`/tmp`, if the intention is to create a temporary directory _within_`/tmp`, the`prefix` must end with a trailing - * platform-specific path separator - * (`require('path').sep`). - * @since v10.0.0 - * @return Fulfills with a string containing the filesystem path of the newly created temporary directory. - */ - function mkdtemp(prefix: string, options?: ObjectEncodingOptions | BufferEncoding | null): Promise; - /** - * Asynchronously creates a unique temporary directory. - * Generates six random characters to be appended behind a required `prefix` to create a unique temporary directory. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function mkdtemp(prefix: string, options: BufferEncodingOption): Promise; - /** - * Asynchronously creates a unique temporary directory. - * Generates six random characters to be appended behind a required `prefix` to create a unique temporary directory. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function mkdtemp(prefix: string, options?: ObjectEncodingOptions | BufferEncoding | null): Promise; - /** - * Asynchronously writes data to a file, replacing the file if it already exists.`data` can be a string, a buffer, an - * [AsyncIterable](https://tc39.github.io/ecma262/#sec-asynciterable-interface) or - * [Iterable](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#The_iterable_protocol) object. - * - * The `encoding` option is ignored if `data` is a buffer. - * - * If `options` is a string, then it specifies the encoding. - * - * The `mode` option only affects the newly created file. See `fs.open()` for more details. - * - * Any specified `FileHandle` has to support writing. - * - * It is unsafe to use `fsPromises.writeFile()` multiple times on the same file - * without waiting for the promise to be settled. - * - * Similarly to `fsPromises.readFile` \- `fsPromises.writeFile` is a convenience - * method that performs multiple `write` calls internally to write the buffer - * passed to it. For performance sensitive code consider using `fs.createWriteStream()` or `filehandle.createWriteStream()`. - * - * It is possible to use an `AbortSignal` to cancel an `fsPromises.writeFile()`. - * Cancelation is "best effort", and some amount of data is likely still - * to be written. - * - * ```js - * import { writeFile } from 'fs/promises'; - * import { Buffer } from 'buffer'; - * - * try { - * const controller = new AbortController(); - * const { signal } = controller; - * const data = new Uint8Array(Buffer.from('Hello Node.js')); - * const promise = writeFile('message.txt', data, { signal }); - * - * // Abort the request before the promise settles. - * controller.abort(); - * - * await promise; - * } catch (err) { - * // When a request is aborted - err is an AbortError - * console.error(err); - * } - * ``` - * - * Aborting an ongoing request does not abort individual operating - * system requests but rather the internal buffering `fs.writeFile` performs. - * @since v10.0.0 - * @param file filename or `FileHandle` - * @return Fulfills with `undefined` upon success. - */ - function writeFile( - file: PathLike | FileHandle, - data: string | NodeJS.ArrayBufferView | Iterable | AsyncIterable | Stream, - options?: - | (ObjectEncodingOptions & { - mode?: Mode | undefined; - flag?: OpenMode | undefined; - } & Abortable) - | BufferEncoding - | null - ): Promise; - /** - * Asynchronously append data to a file, creating the file if it does not yet - * exist. `data` can be a string or a `Buffer`. - * - * If `options` is a string, then it specifies the `encoding`. - * - * The `mode` option only affects the newly created file. See `fs.open()` for more details. - * - * The `path` may be specified as a `FileHandle` that has been opened - * for appending (using `fsPromises.open()`). - * @since v10.0.0 - * @param path filename or {FileHandle} - * @return Fulfills with `undefined` upon success. - */ - function appendFile(path: PathLike | FileHandle, data: string | Uint8Array, options?: (ObjectEncodingOptions & FlagAndOpenMode) | BufferEncoding | null): Promise; - /** - * Asynchronously reads the entire contents of a file. - * - * If no encoding is specified (using `options.encoding`), the data is returned - * as a `Buffer` object. Otherwise, the data will be a string. - * - * If `options` is a string, then it specifies the encoding. - * - * When the `path` is a directory, the behavior of `fsPromises.readFile()` is - * platform-specific. On macOS, Linux, and Windows, the promise will be rejected - * with an error. On FreeBSD, a representation of the directory's contents will be - * returned. - * - * It is possible to abort an ongoing `readFile` using an `AbortSignal`. If a - * request is aborted the promise returned is rejected with an `AbortError`: - * - * ```js - * import { readFile } from 'fs/promises'; - * - * try { - * const controller = new AbortController(); - * const { signal } = controller; - * const promise = readFile(fileName, { signal }); - * - * // Abort the request before the promise settles. - * controller.abort(); - * - * await promise; - * } catch (err) { - * // When a request is aborted - err is an AbortError - * console.error(err); - * } - * ``` - * - * Aborting an ongoing request does not abort individual operating - * system requests but rather the internal buffering `fs.readFile` performs. - * - * Any specified `FileHandle` has to support reading. - * @since v10.0.0 - * @param path filename or `FileHandle` - * @return Fulfills with the contents of the file. - */ - function readFile( - path: PathLike | FileHandle, - options?: - | ({ - encoding?: null | undefined; - flag?: OpenMode | undefined; - } & Abortable) - | null - ): Promise; - /** - * Asynchronously reads the entire contents of a file. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * If a `FileHandle` is provided, the underlying file will _not_ be closed automatically. - * @param options An object that may contain an optional flag. - * If a flag is not provided, it defaults to `'r'`. - */ - function readFile( - path: PathLike | FileHandle, - options: - | ({ - encoding: BufferEncoding; - flag?: OpenMode | undefined; - } & Abortable) - | BufferEncoding - ): Promise; - /** - * Asynchronously reads the entire contents of a file. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * If a `FileHandle` is provided, the underlying file will _not_ be closed automatically. - * @param options An object that may contain an optional flag. - * If a flag is not provided, it defaults to `'r'`. - */ - function readFile( - path: PathLike | FileHandle, - options?: - | (ObjectEncodingOptions & - Abortable & { - flag?: OpenMode | undefined; - }) - | BufferEncoding - | null - ): Promise; - /** - * Asynchronously open a directory for iterative scanning. See the POSIX [`opendir(3)`](http://man7.org/linux/man-pages/man3/opendir.3.html) documentation for more detail. - * - * Creates an `fs.Dir`, which contains all further functions for reading from - * and cleaning up the directory. - * - * The `encoding` option sets the encoding for the `path` while opening the - * directory and subsequent read operations. - * - * Example using async iteration: - * - * ```js - * import { opendir } from 'fs/promises'; - * - * try { - * const dir = await opendir('./'); - * for await (const dirent of dir) - * console.log(dirent.name); - * } catch (err) { - * console.error(err); - * } - * ``` - * - * When using the async iterator, the `fs.Dir` object will be automatically - * closed after the iterator exits. - * @since v12.12.0 - * @return Fulfills with an {fs.Dir}. - */ - function opendir(path: PathLike, options?: OpenDirOptions): Promise; - /** - * Returns an async iterator that watches for changes on `filename`, where `filename`is either a file or a directory. - * - * ```js - * const { watch } = require('fs/promises'); - * - * const ac = new AbortController(); - * const { signal } = ac; - * setTimeout(() => ac.abort(), 10000); - * - * (async () => { - * try { - * const watcher = watch(__filename, { signal }); - * for await (const event of watcher) - * console.log(event); - * } catch (err) { - * if (err.name === 'AbortError') - * return; - * throw err; - * } - * })(); - * ``` - * - * On most platforms, `'rename'` is emitted whenever a filename appears or - * disappears in the directory. - * - * All the `caveats` for `fs.watch()` also apply to `fsPromises.watch()`. - * @since v15.9.0, v14.18.0 - * @return of objects with the properties: - */ - function watch( - filename: PathLike, - options: - | (WatchOptions & { - encoding: 'buffer'; - }) - | 'buffer' - ): AsyncIterable>; - /** - * Watch for changes on `filename`, where `filename` is either a file or a directory, returning an `FSWatcher`. - * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol. - * @param options Either the encoding for the filename provided to the listener, or an object optionally specifying encoding, persistent, and recursive options. - * If `encoding` is not supplied, the default of `'utf8'` is used. - * If `persistent` is not supplied, the default of `true` is used. - * If `recursive` is not supplied, the default of `false` is used. - */ - function watch(filename: PathLike, options?: WatchOptions | BufferEncoding): AsyncIterable>; - /** - * Watch for changes on `filename`, where `filename` is either a file or a directory, returning an `FSWatcher`. - * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol. - * @param options Either the encoding for the filename provided to the listener, or an object optionally specifying encoding, persistent, and recursive options. - * If `encoding` is not supplied, the default of `'utf8'` is used. - * If `persistent` is not supplied, the default of `true` is used. - * If `recursive` is not supplied, the default of `false` is used. - */ - function watch(filename: PathLike, options: WatchOptions | string): AsyncIterable> | AsyncIterable>; - /** - * Asynchronously copies the entire directory structure from `src` to `dest`, - * including subdirectories and files. - * - * When copying a directory to another directory, globs are not supported and - * behavior is similar to `cp dir1/ dir2/`. - * @since v16.7.0 - * @experimental - * @param src source path to copy. - * @param dest destination path to copy to. - * @return Fulfills with `undefined` upon success. - */ - function cp(source: string | URL, destination: string | URL, opts?: CopyOptions): Promise; -} -declare module 'node:fs/promises' { - export * from 'fs/promises'; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/globals.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/globals.d.ts deleted file mode 100755 index 80fd4cf3..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/globals.d.ts +++ /dev/null @@ -1,300 +0,0 @@ -// Declare "static" methods in Error -interface ErrorConstructor { - /** Create .stack property on a target object */ - captureStackTrace(targetObject: object, constructorOpt?: Function): void; - - /** - * Optional override for formatting stack traces - * - * @see https://v8.dev/docs/stack-trace-api#customizing-stack-traces - */ - prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined; - - stackTraceLimit: number; -} - -/*-----------------------------------------------* - * * - * GLOBAL * - * * - ------------------------------------------------*/ - -// For backwards compability -interface NodeRequire extends NodeJS.Require { } -interface RequireResolve extends NodeJS.RequireResolve { } -interface NodeModule extends NodeJS.Module { } - -declare var process: NodeJS.Process; -declare var console: Console; - -declare var __filename: string; -declare var __dirname: string; - -declare var require: NodeRequire; -declare var module: NodeModule; - -// Same as module.exports -declare var exports: any; - -/** - * Only available if `--expose-gc` is passed to the process. - */ -declare var gc: undefined | (() => void); - -//#region borrowed -// from https://github.com/microsoft/TypeScript/blob/38da7c600c83e7b31193a62495239a0fe478cb67/lib/lib.webworker.d.ts#L633 until moved to separate lib -/** A controller object that allows you to abort one or more DOM requests as and when desired. */ -interface AbortController { - /** - * Returns the AbortSignal object associated with this object. - */ - - readonly signal: AbortSignal; - /** - * Invoking this method will set this object's AbortSignal's aborted flag and signal to any observers that the associated activity is to be aborted. - */ - abort(): void; -} - -/** A signal object that allows you to communicate with a DOM request (such as a Fetch) and abort it if required via an AbortController object. */ -interface AbortSignal extends EventTarget { - /** - * Returns true if this AbortSignal's AbortController has signaled to abort, and false otherwise. - */ - readonly aborted: boolean; -} - -declare var AbortController: typeof globalThis extends {onmessage: any; AbortController: infer T} - ? T - : { - prototype: AbortController; - new(): AbortController; - }; - -declare var AbortSignal: typeof globalThis extends {onmessage: any; AbortSignal: infer T} - ? T - : { - prototype: AbortSignal; - new(): AbortSignal; - abort(reason?: any): AbortSignal; - timeout(milliseconds: number): AbortSignal; - }; -//#endregion borrowed - -//#region ArrayLike.at() -interface RelativeIndexable { - /** - * Takes an integer value and returns the item at that index, - * allowing for positive and negative integers. - * Negative integers count back from the last item in the array. - */ - at(index: number): T | undefined; -} -interface String extends RelativeIndexable {} -interface Array extends RelativeIndexable {} -interface ReadonlyArray extends RelativeIndexable {} -interface Int8Array extends RelativeIndexable {} -interface Uint8Array extends RelativeIndexable {} -interface Uint8ClampedArray extends RelativeIndexable {} -interface Int16Array extends RelativeIndexable {} -interface Uint16Array extends RelativeIndexable {} -interface Int32Array extends RelativeIndexable {} -interface Uint32Array extends RelativeIndexable {} -interface Float32Array extends RelativeIndexable {} -interface Float64Array extends RelativeIndexable {} -interface BigInt64Array extends RelativeIndexable {} -interface BigUint64Array extends RelativeIndexable {} -//#endregion ArrayLike.at() end - -/** - * @since v17.0.0 - * - * Creates a deep clone of an object. - */ -declare function structuredClone( - value: T, - transfer?: { transfer: ReadonlyArray }, -): T; - -/*----------------------------------------------* -* * -* GLOBAL INTERFACES * -* * -*-----------------------------------------------*/ -declare namespace NodeJS { - interface CallSite { - /** - * Value of "this" - */ - getThis(): unknown; - - /** - * Type of "this" as a string. - * This is the name of the function stored in the constructor field of - * "this", if available. Otherwise the object's [[Class]] internal - * property. - */ - getTypeName(): string | null; - - /** - * Current function - */ - getFunction(): Function | undefined; - - /** - * Name of the current function, typically its name property. - * If a name property is not available an attempt will be made to try - * to infer a name from the function's context. - */ - getFunctionName(): string | null; - - /** - * Name of the property [of "this" or one of its prototypes] that holds - * the current function - */ - getMethodName(): string | null; - - /** - * Name of the script [if this function was defined in a script] - */ - getFileName(): string | null; - - /** - * Current line number [if this function was defined in a script] - */ - getLineNumber(): number | null; - - /** - * Current column number [if this function was defined in a script] - */ - getColumnNumber(): number | null; - - /** - * A call site object representing the location where eval was called - * [if this function was created using a call to eval] - */ - getEvalOrigin(): string | undefined; - - /** - * Is this a toplevel invocation, that is, is "this" the global object? - */ - isToplevel(): boolean; - - /** - * Does this call take place in code defined by a call to eval? - */ - isEval(): boolean; - - /** - * Is this call in native V8 code? - */ - isNative(): boolean; - - /** - * Is this a constructor call? - */ - isConstructor(): boolean; - } - - interface ErrnoException extends Error { - errno?: number | undefined; - code?: string | undefined; - path?: string | undefined; - syscall?: string | undefined; - } - - interface ReadableStream extends EventEmitter { - readable: boolean; - read(size?: number): string | Buffer; - setEncoding(encoding: BufferEncoding): this; - pause(): this; - resume(): this; - isPaused(): boolean; - pipe(destination: T, options?: { end?: boolean | undefined; }): T; - unpipe(destination?: WritableStream): this; - unshift(chunk: string | Uint8Array, encoding?: BufferEncoding): void; - wrap(oldStream: ReadableStream): this; - [Symbol.asyncIterator](): AsyncIterableIterator; - } - - interface WritableStream extends EventEmitter { - writable: boolean; - write(buffer: Uint8Array | string, cb?: (err?: Error | null) => void): boolean; - write(str: string, encoding?: BufferEncoding, cb?: (err?: Error | null) => void): boolean; - end(cb?: () => void): this; - end(data: string | Uint8Array, cb?: () => void): this; - end(str: string, encoding?: BufferEncoding, cb?: () => void): this; - } - - interface ReadWriteStream extends ReadableStream, WritableStream { } - - interface RefCounted { - ref(): this; - unref(): this; - } - - type TypedArray = - | Uint8Array - | Uint8ClampedArray - | Uint16Array - | Uint32Array - | Int8Array - | Int16Array - | Int32Array - | BigUint64Array - | BigInt64Array - | Float32Array - | Float64Array; - type ArrayBufferView = TypedArray | DataView; - - interface Require { - (id: string): any; - resolve: RequireResolve; - cache: Dict; - /** - * @deprecated - */ - extensions: RequireExtensions; - main: Module | undefined; - } - - interface RequireResolve { - (id: string, options?: { paths?: string[] | undefined; }): string; - paths(request: string): string[] | null; - } - - interface RequireExtensions extends Dict<(m: Module, filename: string) => any> { - '.js': (m: Module, filename: string) => any; - '.json': (m: Module, filename: string) => any; - '.node': (m: Module, filename: string) => any; - } - interface Module { - /** - * `true` if the module is running during the Node.js preload - */ - isPreloading: boolean; - exports: any; - require: Require; - id: string; - filename: string; - loaded: boolean; - /** @deprecated since v14.6.0 Please use `require.main` and `module.children` instead. */ - parent: Module | null | undefined; - children: Module[]; - /** - * @since v11.14.0 - * - * The directory name of the module. This is usually the same as the path.dirname() of the module.id. - */ - path: string; - paths: string[]; - } - - interface Dict { - [key: string]: T | undefined; - } - - interface ReadOnlyDict { - readonly [key: string]: T | undefined; - } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/globals.global.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/globals.global.d.ts deleted file mode 100755 index ef1198c0..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/globals.global.d.ts +++ /dev/null @@ -1 +0,0 @@ -declare var global: typeof globalThis; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/http.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/http.d.ts deleted file mode 100755 index af826c16..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/http.d.ts +++ /dev/null @@ -1,1614 +0,0 @@ -/** - * To use the HTTP server and client one must `require('http')`. - * - * The HTTP interfaces in Node.js are designed to support many features - * of the protocol which have been traditionally difficult to use. - * In particular, large, possibly chunk-encoded, messages. The interface is - * careful to never buffer entire requests or responses, so the - * user is able to stream data. - * - * HTTP message headers are represented by an object like this: - * - * ```js - * { 'content-length': '123', - * 'content-type': 'text/plain', - * 'connection': 'keep-alive', - * 'host': 'example.com', - * 'accept': '*' } - * ``` - * - * Keys are lowercased. Values are not modified. - * - * In order to support the full spectrum of possible HTTP applications, the Node.js - * HTTP API is very low-level. It deals with stream handling and message - * parsing only. It parses a message into headers and body but it does not - * parse the actual headers or the body. - * - * See `message.headers` for details on how duplicate headers are handled. - * - * The raw headers as they were received are retained in the `rawHeaders`property, which is an array of `[key, value, key2, value2, ...]`. For - * example, the previous message header object might have a `rawHeaders`list like the following: - * - * ```js - * [ 'ConTent-Length', '123456', - * 'content-LENGTH', '123', - * 'content-type', 'text/plain', - * 'CONNECTION', 'keep-alive', - * 'Host', 'example.com', - * 'accepT', '*' ] - * ``` - * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/http.js) - */ -declare module 'http' { - import * as stream from 'node:stream'; - import { URL } from 'node:url'; - import { TcpSocketConnectOpts, Socket, Server as NetServer, LookupFunction } from 'node:net'; - // incoming headers will never contain number - interface IncomingHttpHeaders extends NodeJS.Dict { - accept?: string | undefined; - 'accept-language'?: string | undefined; - 'accept-patch'?: string | undefined; - 'accept-ranges'?: string | undefined; - 'access-control-allow-credentials'?: string | undefined; - 'access-control-allow-headers'?: string | undefined; - 'access-control-allow-methods'?: string | undefined; - 'access-control-allow-origin'?: string | undefined; - 'access-control-expose-headers'?: string | undefined; - 'access-control-max-age'?: string | undefined; - 'access-control-request-headers'?: string | undefined; - 'access-control-request-method'?: string | undefined; - age?: string | undefined; - allow?: string | undefined; - 'alt-svc'?: string | undefined; - authorization?: string | undefined; - 'cache-control'?: string | undefined; - connection?: string | undefined; - 'content-disposition'?: string | undefined; - 'content-encoding'?: string | undefined; - 'content-language'?: string | undefined; - 'content-length'?: string | undefined; - 'content-location'?: string | undefined; - 'content-range'?: string | undefined; - 'content-type'?: string | undefined; - cookie?: string | undefined; - date?: string | undefined; - etag?: string | undefined; - expect?: string | undefined; - expires?: string | undefined; - forwarded?: string | undefined; - from?: string | undefined; - host?: string | undefined; - 'if-match'?: string | undefined; - 'if-modified-since'?: string | undefined; - 'if-none-match'?: string | undefined; - 'if-unmodified-since'?: string | undefined; - 'last-modified'?: string | undefined; - location?: string | undefined; - origin?: string | undefined; - pragma?: string | undefined; - 'proxy-authenticate'?: string | undefined; - 'proxy-authorization'?: string | undefined; - 'public-key-pins'?: string | undefined; - range?: string | undefined; - referer?: string | undefined; - 'retry-after'?: string | undefined; - 'sec-websocket-accept'?: string | undefined; - 'sec-websocket-extensions'?: string | undefined; - 'sec-websocket-key'?: string | undefined; - 'sec-websocket-protocol'?: string | undefined; - 'sec-websocket-version'?: string | undefined; - 'set-cookie'?: string[] | undefined; - 'strict-transport-security'?: string | undefined; - tk?: string | undefined; - trailer?: string | undefined; - 'transfer-encoding'?: string | undefined; - upgrade?: string | undefined; - 'user-agent'?: string | undefined; - vary?: string | undefined; - via?: string | undefined; - warning?: string | undefined; - 'www-authenticate'?: string | undefined; - } - // outgoing headers allows numbers (as they are converted internally to strings) - type OutgoingHttpHeader = number | string | string[]; - interface OutgoingHttpHeaders extends NodeJS.Dict {} - interface ClientRequestArgs { - signal?: AbortSignal | undefined; - protocol?: string | null | undefined; - host?: string | null | undefined; - hostname?: string | null | undefined; - family?: number | undefined; - port?: number | string | null | undefined; - defaultPort?: number | string | undefined; - localAddress?: string | undefined; - socketPath?: string | undefined; - /** - * @default 8192 - */ - maxHeaderSize?: number | undefined; - method?: string | undefined; - path?: string | null | undefined; - headers?: OutgoingHttpHeaders | undefined; - auth?: string | null | undefined; - agent?: Agent | boolean | undefined; - _defaultAgent?: Agent | undefined; - timeout?: number | undefined; - setHost?: boolean | undefined; - // https://github.com/nodejs/node/blob/master/lib/_http_client.js#L278 - createConnection?: - | ((options: ClientRequestArgs, oncreate: (err: Error, socket: Socket) => void) => Socket) - | undefined; - lookup?: LookupFunction | undefined; - } - interface ServerOptions< - Request extends typeof IncomingMessage = typeof IncomingMessage, - Response extends typeof ServerResponse = typeof ServerResponse, - > { - IncomingMessage?: Request | undefined; - ServerResponse?: Response | undefined; - /** - * Optionally overrides the value of - * `--max-http-header-size` for requests received by this server, i.e. - * the maximum length of request headers in bytes. - * @default 8192 - */ - maxHeaderSize?: number | undefined; - /** - * Use an insecure HTTP parser that accepts invalid HTTP headers when true. - * Using the insecure parser should be avoided. - * See --insecure-http-parser for more information. - * @default false - */ - insecureHTTPParser?: boolean | undefined; - /** - * If set to `true`, it disables the use of Nagle's algorithm immediately after a new incoming connection is received. - * @default false - * @since v16.5.0 - */ - noDelay?: boolean | undefined; - /** - * If set to `true`, it enables keep-alive functionality on the socket immediately after a new incoming connection is received, - * similarly on what is done in `socket.setKeepAlive([enable][, initialDelay])`. - * @default false - * @since v16.5.0 - */ - keepAlive?: boolean | undefined; - /** - * If set to a positive number, it sets the initial delay before the first keepalive probe is sent on an idle socket. - * @default 0 - * @since v16.5.0 - */ - keepAliveInitialDelay?: number | undefined; - } - type RequestListener< - Request extends typeof IncomingMessage = typeof IncomingMessage, - Response extends typeof ServerResponse = typeof ServerResponse, - > = (req: InstanceType, res: InstanceType & { req: InstanceType }) => void; - /** - * @since v0.1.17 - */ - class Server< - Request extends typeof IncomingMessage = typeof IncomingMessage, - Response extends typeof ServerResponse = typeof ServerResponse, - > extends NetServer { - constructor(requestListener?: RequestListener); - constructor(options: ServerOptions, requestListener?: RequestListener); - /** - * Sets the timeout value for sockets, and emits a `'timeout'` event on - * the Server object, passing the socket as an argument, if a timeout - * occurs. - * - * If there is a `'timeout'` event listener on the Server object, then it - * will be called with the timed-out socket as an argument. - * - * By default, the Server does not timeout sockets. However, if a callback - * is assigned to the Server's `'timeout'` event, timeouts must be handled - * explicitly. - * @since v0.9.12 - * @param [msecs=0 (no timeout)] - */ - setTimeout(msecs?: number, callback?: () => void): this; - setTimeout(callback: () => void): this; - /** - * Limits maximum incoming headers count. If set to 0, no limit will be applied. - * @since v0.7.0 - */ - maxHeadersCount: number | null; - /** - * The maximum number of requests socket can handle - * before closing keep alive connection. - * - * A value of `0` will disable the limit. - * - * When the limit is reached it will set the `Connection` header value to `close`, - * but will not actually close the connection, subsequent requests sent - * after the limit is reached will get `503 Service Unavailable` as a response. - * @since v16.10.0 - */ - maxRequestsPerSocket: number | null; - /** - * The number of milliseconds of inactivity before a socket is presumed - * to have timed out. - * - * A value of `0` will disable the timeout behavior on incoming connections. - * - * The socket timeout logic is set up on connection, so changing this - * value only affects new connections to the server, not any existing connections. - * @since v0.9.12 - */ - timeout: number; - /** - * Limit the amount of time the parser will wait to receive the complete HTTP - * headers. - * - * If the timeout expires, the server responds with status 408 without - * forwarding the request to the request listener and then closes the connection. - * - * It must be set to a non-zero value (e.g. 120 seconds) to protect against - * potential Denial-of-Service attacks in case the server is deployed without a - * reverse proxy in front. - * @since v11.3.0, v10.14.0 - */ - headersTimeout: number; - /** - * The number of milliseconds of inactivity a server needs to wait for additional - * incoming data, after it has finished writing the last response, before a socket - * will be destroyed. If the server receives new data before the keep-alive - * timeout has fired, it will reset the regular inactivity timeout, i.e.,`server.timeout`. - * - * A value of `0` will disable the keep-alive timeout behavior on incoming - * connections. - * A value of `0` makes the http server behave similarly to Node.js versions prior - * to 8.0.0, which did not have a keep-alive timeout. - * - * The socket timeout logic is set up on connection, so changing this value only - * affects new connections to the server, not any existing connections. - * @since v8.0.0 - */ - keepAliveTimeout: number; - /** - * Sets the timeout value in milliseconds for receiving the entire request from - * the client. - * - * If the timeout expires, the server responds with status 408 without - * forwarding the request to the request listener and then closes the connection. - * - * It must be set to a non-zero value (e.g. 120 seconds) to protect against - * potential Denial-of-Service attacks in case the server is deployed without a - * reverse proxy in front. - * @since v14.11.0 - */ - requestTimeout: number; - /** - * Closes all connections connected to this server. - * @since v18.2.0 - */ - closeAllConnections(): void; - /** - * Closes all connections connected to this server which are not sending a request or waiting for a response. - * @since v18.2.0 - */ - closeIdleConnections(): void; - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: 'close', listener: () => void): this; - addListener(event: 'connection', listener: (socket: Socket) => void): this; - addListener(event: 'error', listener: (err: Error) => void): this; - addListener(event: 'listening', listener: () => void): this; - addListener(event: 'checkContinue', listener: RequestListener): this; - addListener(event: 'checkExpectation', listener: RequestListener): this; - addListener(event: 'clientError', listener: (err: Error, socket: stream.Duplex) => void): this; - addListener( - event: 'connect', - listener: (req: InstanceType, socket: stream.Duplex, head: Buffer) => void, - ): this; - addListener(event: 'request', listener: RequestListener): this; - addListener( - event: 'upgrade', - listener: (req: InstanceType, socket: stream.Duplex, head: Buffer) => void, - ): this; - emit(event: string, ...args: any[]): boolean; - emit(event: 'close'): boolean; - emit(event: 'connection', socket: Socket): boolean; - emit(event: 'error', err: Error): boolean; - emit(event: 'listening'): boolean; - emit( - event: 'checkContinue', - req: InstanceType, - res: InstanceType & { req: InstanceType }, - ): boolean; - emit( - event: 'checkExpectation', - req: InstanceType, - res: InstanceType & { req: InstanceType }, - ): boolean; - emit(event: 'clientError', err: Error, socket: stream.Duplex): boolean; - emit(event: 'connect', req: InstanceType, socket: stream.Duplex, head: Buffer): boolean; - emit( - event: 'request', - req: InstanceType, - res: InstanceType & { req: InstanceType }, - ): boolean; - emit(event: 'upgrade', req: InstanceType, socket: stream.Duplex, head: Buffer): boolean; - on(event: string, listener: (...args: any[]) => void): this; - on(event: 'close', listener: () => void): this; - on(event: 'connection', listener: (socket: Socket) => void): this; - on(event: 'error', listener: (err: Error) => void): this; - on(event: 'listening', listener: () => void): this; - on(event: 'checkContinue', listener: RequestListener): this; - on(event: 'checkExpectation', listener: RequestListener): this; - on(event: 'clientError', listener: (err: Error, socket: stream.Duplex) => void): this; - on(event: 'connect', listener: (req: InstanceType, socket: stream.Duplex, head: Buffer) => void): this; - on(event: 'request', listener: RequestListener): this; - on(event: 'upgrade', listener: (req: InstanceType, socket: stream.Duplex, head: Buffer) => void): this; - once(event: string, listener: (...args: any[]) => void): this; - once(event: 'close', listener: () => void): this; - once(event: 'connection', listener: (socket: Socket) => void): this; - once(event: 'error', listener: (err: Error) => void): this; - once(event: 'listening', listener: () => void): this; - once(event: 'checkContinue', listener: RequestListener): this; - once(event: 'checkExpectation', listener: RequestListener): this; - once(event: 'clientError', listener: (err: Error, socket: stream.Duplex) => void): this; - once( - event: 'connect', - listener: (req: InstanceType, socket: stream.Duplex, head: Buffer) => void, - ): this; - once(event: 'request', listener: RequestListener): this; - once( - event: 'upgrade', - listener: (req: InstanceType, socket: stream.Duplex, head: Buffer) => void, - ): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: 'close', listener: () => void): this; - prependListener(event: 'connection', listener: (socket: Socket) => void): this; - prependListener(event: 'error', listener: (err: Error) => void): this; - prependListener(event: 'listening', listener: () => void): this; - prependListener(event: 'checkContinue', listener: RequestListener): this; - prependListener(event: 'checkExpectation', listener: RequestListener): this; - prependListener(event: 'clientError', listener: (err: Error, socket: stream.Duplex) => void): this; - prependListener( - event: 'connect', - listener: (req: InstanceType, socket: stream.Duplex, head: Buffer) => void, - ): this; - prependListener(event: 'request', listener: RequestListener): this; - prependListener( - event: 'upgrade', - listener: (req: InstanceType, socket: stream.Duplex, head: Buffer) => void, - ): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: 'close', listener: () => void): this; - prependOnceListener(event: 'connection', listener: (socket: Socket) => void): this; - prependOnceListener(event: 'error', listener: (err: Error) => void): this; - prependOnceListener(event: 'listening', listener: () => void): this; - prependOnceListener(event: 'checkContinue', listener: RequestListener): this; - prependOnceListener(event: 'checkExpectation', listener: RequestListener): this; - prependOnceListener(event: 'clientError', listener: (err: Error, socket: stream.Duplex) => void): this; - prependOnceListener( - event: 'connect', - listener: (req: InstanceType, socket: stream.Duplex, head: Buffer) => void, - ): this; - prependOnceListener(event: 'request', listener: RequestListener): this; - prependOnceListener( - event: 'upgrade', - listener: (req: InstanceType, socket: stream.Duplex, head: Buffer) => void, - ): this; - } - /** - * This class serves as the parent class of {@link ClientRequest} and {@link ServerResponse}. It is an abstract of outgoing message from - * the perspective of the participants of HTTP transaction. - * @since v0.1.17 - */ - class OutgoingMessage extends stream.Writable { - readonly req: Request; - chunkedEncoding: boolean; - shouldKeepAlive: boolean; - useChunkedEncodingByDefault: boolean; - sendDate: boolean; - /** - * @deprecated Use `writableEnded` instead. - */ - finished: boolean; - /** - * Read-only. `true` if the headers were sent, otherwise `false`. - * @since v0.9.3 - */ - readonly headersSent: boolean; - /** - * Aliases of `outgoingMessage.socket` - * @since v0.3.0 - * @deprecated Since v15.12.0,v14.17.1 - Use `socket` instead. - */ - readonly connection: Socket | null; - /** - * Reference to the underlying socket. Usually, users will not want to access - * this property. - * - * After calling `outgoingMessage.end()`, this property will be nulled. - * @since v0.3.0 - */ - readonly socket: Socket | null; - constructor(); - /** - * Once a socket is associated with the message and is connected,`socket.setTimeout()` will be called with `msecs` as the first parameter. - * @since v0.9.12 - * @param callback Optional function to be called when a timeout occurs. Same as binding to the `timeout` event. - */ - setTimeout(msecs: number, callback?: () => void): this; - /** - * Sets a single header value for the header object. - * @since v0.4.0 - * @param name Header name - * @param value Header value - */ - setHeader(name: string, value: number | string | ReadonlyArray): this; - /** - * Gets the value of HTTP header with the given name. If such a name doesn't - * exist in message, it will be `undefined`. - * @since v0.4.0 - * @param name Name of header - */ - getHeader(name: string): number | string | string[] | undefined; - /** - * Returns a shallow copy of the current outgoing headers. Since a shallow - * copy is used, array values may be mutated without additional calls to - * various header-related HTTP module methods. The keys of the returned - * object are the header names and the values are the respective header - * values. All header names are lowercase. - * - * The object returned by the `outgoingMessage.getHeaders()` method does - * not prototypically inherit from the JavaScript Object. This means that - * typical Object methods such as `obj.toString()`, `obj.hasOwnProperty()`, - * and others are not defined and will not work. - * - * ```js - * outgoingMessage.setHeader('Foo', 'bar'); - * outgoingMessage.setHeader('Set-Cookie', ['foo=bar', 'bar=baz']); - * - * const headers = outgoingMessage.getHeaders(); - * // headers === { foo: 'bar', 'set-cookie': ['foo=bar', 'bar=baz'] } - * ``` - * @since v7.7.0 - */ - getHeaders(): OutgoingHttpHeaders; - /** - * Returns an array of names of headers of the outgoing outgoingMessage. All - * names are lowercase. - * @since v7.7.0 - */ - getHeaderNames(): string[]; - /** - * Returns `true` if the header identified by `name` is currently set in the - * outgoing headers. The header name is case-insensitive. - * - * ```js - * const hasContentType = outgoingMessage.hasHeader('content-type'); - * ``` - * @since v7.7.0 - */ - hasHeader(name: string): boolean; - /** - * Removes a header that is queued for implicit sending. - * - * ```js - * outgoingMessage.removeHeader('Content-Encoding'); - * ``` - * @since v0.4.0 - * @param name Header name - */ - removeHeader(name: string): void; - /** - * Adds HTTP trailers (headers but at the end of the message) to the message. - * - * Trailers are **only** be emitted if the message is chunked encoded. If not, - * the trailer will be silently discarded. - * - * HTTP requires the `Trailer` header to be sent to emit trailers, - * with a list of header fields in its value, e.g. - * - * ```js - * message.writeHead(200, { 'Content-Type': 'text/plain', - * 'Trailer': 'Content-MD5' }); - * message.write(fileData); - * message.addTrailers({ 'Content-MD5': '7895bf4b8828b55ceaf47747b4bca667' }); - * message.end(); - * ``` - * - * Attempting to set a header field name or value that contains invalid characters - * will result in a `TypeError` being thrown. - * @since v0.3.0 - */ - addTrailers(headers: OutgoingHttpHeaders | ReadonlyArray<[string, string]>): void; - /** - * Compulsorily flushes the message headers - * - * For efficiency reason, Node.js normally buffers the message headers - * until `outgoingMessage.end()` is called or the first chunk of message data - * is written. It then tries to pack the headers and data into a single TCP - * packet. - * - * It is usually desired (it saves a TCP round-trip), but not when the first - * data is not sent until possibly much later. `outgoingMessage.flushHeaders()`bypasses the optimization and kickstarts the request. - * @since v1.6.0 - */ - flushHeaders(): void; - } - /** - * This object is created internally by an HTTP server, not by the user. It is - * passed as the second parameter to the `'request'` event. - * @since v0.1.17 - */ - class ServerResponse extends OutgoingMessage { - /** - * When using implicit headers (not calling `response.writeHead()` explicitly), - * this property controls the status code that will be sent to the client when - * the headers get flushed. - * - * ```js - * response.statusCode = 404; - * ``` - * - * After response header was sent to the client, this property indicates the - * status code which was sent out. - * @since v0.4.0 - */ - statusCode: number; - /** - * When using implicit headers (not calling `response.writeHead()` explicitly), - * this property controls the status message that will be sent to the client when - * the headers get flushed. If this is left as `undefined` then the standard - * message for the status code will be used. - * - * ```js - * response.statusMessage = 'Not found'; - * ``` - * - * After response header was sent to the client, this property indicates the - * status message which was sent out. - * @since v0.11.8 - */ - statusMessage: string; - constructor(req: Request); - assignSocket(socket: Socket): void; - detachSocket(socket: Socket): void; - /** - * Sends an HTTP/1.1 100 Continue message to the client, indicating that - * the request body should be sent. See the `'checkContinue'` event on`Server`. - * @since v0.3.0 - */ - writeContinue(callback?: () => void): void; - /** - * Sends an HTTP/1.1 103 Early Hints message to the client with a Link header, - * indicating that the user agent can preload/preconnect the linked resources. - * The `hints` is an object containing the values of headers to be sent with - * early hints message. The optional `callback` argument will be called when - * the response message has been written. - * - * Example: - * - * ```js - * const earlyHintsLink = '; rel=preload; as=style'; - * response.writeEarlyHints({ - * 'link': earlyHintsLink, - * }); - * - * const earlyHintsLinks = [ - * '; rel=preload; as=style', - * '; rel=preload; as=script', - * ]; - * response.writeEarlyHints({ - * 'link': earlyHintsLinks, - * 'x-trace-id': 'id for diagnostics' - * }); - * - * const earlyHintsCallback = () => console.log('early hints message sent'); - * response.writeEarlyHints({ - * 'link': earlyHintsLinks - * }, earlyHintsCallback); - * ``` - * - * @since v18.11.0 - * @param hints An object containing the values of headers - * @param callback Will be called when the response message has been written - */ - writeEarlyHints(hints: Record, callback?: () => void): void; - /** - * Sends a response header to the request. The status code is a 3-digit HTTP - * status code, like `404`. The last argument, `headers`, are the response headers. - * Optionally one can give a human-readable `statusMessage` as the second - * argument. - * - * `headers` may be an `Array` where the keys and values are in the same list. - * It is _not_ a list of tuples. So, the even-numbered offsets are key values, - * and the odd-numbered offsets are the associated values. The array is in the same - * format as `request.rawHeaders`. - * - * Returns a reference to the `ServerResponse`, so that calls can be chained. - * - * ```js - * const body = 'hello world'; - * response - * .writeHead(200, { - * 'Content-Length': Buffer.byteLength(body), - * 'Content-Type': 'text/plain' - * }) - * .end(body); - * ``` - * - * This method must only be called once on a message and it must - * be called before `response.end()` is called. - * - * If `response.write()` or `response.end()` are called before calling - * this, the implicit/mutable headers will be calculated and call this function. - * - * When headers have been set with `response.setHeader()`, they will be merged - * with any headers passed to `response.writeHead()`, with the headers passed - * to `response.writeHead()` given precedence. - * - * If this method is called and `response.setHeader()` has not been called, - * it will directly write the supplied header values onto the network channel - * without caching internally, and the `response.getHeader()` on the header - * will not yield the expected result. If progressive population of headers is - * desired with potential future retrieval and modification, use `response.setHeader()` instead. - * - * ```js - * // Returns content-type = text/plain - * const server = http.createServer((req, res) => { - * res.setHeader('Content-Type', 'text/html'); - * res.setHeader('X-Foo', 'bar'); - * res.writeHead(200, { 'Content-Type': 'text/plain' }); - * res.end('ok'); - * }); - * ``` - * - * `Content-Length` is given in bytes, not characters. Use `Buffer.byteLength()` to determine the length of the body in bytes. Node.js - * does not check whether `Content-Length` and the length of the body which has - * been transmitted are equal or not. - * - * Attempting to set a header field name or value that contains invalid characters - * will result in a `TypeError` being thrown. - * @since v0.1.30 - */ - writeHead( - statusCode: number, - statusMessage?: string, - headers?: OutgoingHttpHeaders | OutgoingHttpHeader[], - ): this; - writeHead(statusCode: number, headers?: OutgoingHttpHeaders | OutgoingHttpHeader[]): this; - /** - * Sends an HTTP/1.1 102 Processing message to the client, indicating that - * the request body should be sent. - * @since v10.0.0 - */ - writeProcessing(): void; - } - interface InformationEvent { - statusCode: number; - statusMessage: string; - httpVersion: string; - httpVersionMajor: number; - httpVersionMinor: number; - headers: IncomingHttpHeaders; - rawHeaders: string[]; - } - /** - * This object is created internally and returned from {@link request}. It - * represents an _in-progress_ request whose header has already been queued. The - * header is still mutable using the `setHeader(name, value)`,`getHeader(name)`, `removeHeader(name)` API. The actual header will - * be sent along with the first data chunk or when calling `request.end()`. - * - * To get the response, add a listener for `'response'` to the request object.`'response'` will be emitted from the request object when the response - * headers have been received. The `'response'` event is executed with one - * argument which is an instance of {@link IncomingMessage}. - * - * During the `'response'` event, one can add listeners to the - * response object; particularly to listen for the `'data'` event. - * - * If no `'response'` handler is added, then the response will be - * entirely discarded. However, if a `'response'` event handler is added, - * then the data from the response object **must** be consumed, either by - * calling `response.read()` whenever there is a `'readable'` event, or - * by adding a `'data'` handler, or by calling the `.resume()` method. - * Until the data is consumed, the `'end'` event will not fire. Also, until - * the data is read it will consume memory that can eventually lead to a - * 'process out of memory' error. - * - * For backward compatibility, `res` will only emit `'error'` if there is an`'error'` listener registered. - * - * Node.js does not check whether Content-Length and the length of the - * body which has been transmitted are equal or not. - * @since v0.1.17 - */ - class ClientRequest extends OutgoingMessage { - /** - * The `request.aborted` property will be `true` if the request has - * been aborted. - * @since v0.11.14 - * @deprecated Since v17.0.0,v16.12.0 - Check `destroyed` instead. - */ - aborted: boolean; - /** - * The request host. - * @since v14.5.0, v12.19.0 - */ - host: string; - /** - * The request protocol. - * @since v14.5.0, v12.19.0 - */ - protocol: string; - /** - * When sending request through a keep-alive enabled agent, the underlying socket - * might be reused. But if server closes connection at unfortunate time, client - * may run into a 'ECONNRESET' error. - * - * ```js - * const http = require('http'); - * - * // Server has a 5 seconds keep-alive timeout by default - * http - * .createServer((req, res) => { - * res.write('hello\n'); - * res.end(); - * }) - * .listen(3000); - * - * setInterval(() => { - * // Adapting a keep-alive agent - * http.get('http://localhost:3000', { agent }, (res) => { - * res.on('data', (data) => { - * // Do nothing - * }); - * }); - * }, 5000); // Sending request on 5s interval so it's easy to hit idle timeout - * ``` - * - * By marking a request whether it reused socket or not, we can do - * automatic error retry base on it. - * - * ```js - * const http = require('http'); - * const agent = new http.Agent({ keepAlive: true }); - * - * function retriableRequest() { - * const req = http - * .get('http://localhost:3000', { agent }, (res) => { - * // ... - * }) - * .on('error', (err) => { - * // Check if retry is needed - * if (req.reusedSocket && err.code === 'ECONNRESET') { - * retriableRequest(); - * } - * }); - * } - * - * retriableRequest(); - * ``` - * @since v13.0.0, v12.16.0 - */ - reusedSocket: boolean; - /** - * Limits maximum response headers count. If set to 0, no limit will be applied. - */ - maxHeadersCount: number; - constructor(url: string | URL | ClientRequestArgs, cb?: (res: IncomingMessage) => void); - /** - * The request method. - * @since v0.1.97 - */ - method: string; - /** - * The request path. - * @since v0.4.0 - */ - path: string; - /** - * Marks the request as aborting. Calling this will cause remaining data - * in the response to be dropped and the socket to be destroyed. - * @since v0.3.8 - * @deprecated Since v14.1.0,v13.14.0 - Use `destroy` instead. - */ - abort(): void; - onSocket(socket: Socket): void; - /** - * Once a socket is assigned to this request and is connected `socket.setTimeout()` will be called. - * @since v0.5.9 - * @param timeout Milliseconds before a request times out. - * @param callback Optional function to be called when a timeout occurs. Same as binding to the `'timeout'` event. - */ - setTimeout(timeout: number, callback?: () => void): this; - /** - * Once a socket is assigned to this request and is connected `socket.setNoDelay()` will be called. - * @since v0.5.9 - */ - setNoDelay(noDelay?: boolean): void; - /** - * Once a socket is assigned to this request and is connected `socket.setKeepAlive()` will be called. - * @since v0.5.9 - */ - setSocketKeepAlive(enable?: boolean, initialDelay?: number): void; - /** - * Returns an array containing the unique names of the current outgoing raw - * headers. Header names are returned with their exact casing being set. - * - * ```js - * request.setHeader('Foo', 'bar'); - * request.setHeader('Set-Cookie', ['foo=bar', 'bar=baz']); - * - * const headerNames = request.getRawHeaderNames(); - * // headerNames === ['Foo', 'Set-Cookie'] - * ``` - * @since v15.13.0, v14.17.0 - */ - getRawHeaderNames(): string[]; - /** - * @deprecated - */ - addListener(event: 'abort', listener: () => void): this; - addListener( - event: 'connect', - listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void, - ): this; - addListener(event: 'continue', listener: () => void): this; - addListener(event: 'information', listener: (info: InformationEvent) => void): this; - addListener(event: 'response', listener: (response: IncomingMessage) => void): this; - addListener(event: 'socket', listener: (socket: Socket) => void): this; - addListener(event: 'timeout', listener: () => void): this; - addListener( - event: 'upgrade', - listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void, - ): this; - addListener(event: 'close', listener: () => void): this; - addListener(event: 'drain', listener: () => void): this; - addListener(event: 'error', listener: (err: Error) => void): this; - addListener(event: 'finish', listener: () => void): this; - addListener(event: 'pipe', listener: (src: stream.Readable) => void): this; - addListener(event: 'unpipe', listener: (src: stream.Readable) => void): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - /** - * @deprecated - */ - on(event: 'abort', listener: () => void): this; - on(event: 'connect', listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this; - on(event: 'continue', listener: () => void): this; - on(event: 'information', listener: (info: InformationEvent) => void): this; - on(event: 'response', listener: (response: IncomingMessage) => void): this; - on(event: 'socket', listener: (socket: Socket) => void): this; - on(event: 'timeout', listener: () => void): this; - on(event: 'upgrade', listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this; - on(event: 'close', listener: () => void): this; - on(event: 'drain', listener: () => void): this; - on(event: 'error', listener: (err: Error) => void): this; - on(event: 'finish', listener: () => void): this; - on(event: 'pipe', listener: (src: stream.Readable) => void): this; - on(event: 'unpipe', listener: (src: stream.Readable) => void): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - /** - * @deprecated - */ - once(event: 'abort', listener: () => void): this; - once(event: 'connect', listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this; - once(event: 'continue', listener: () => void): this; - once(event: 'information', listener: (info: InformationEvent) => void): this; - once(event: 'response', listener: (response: IncomingMessage) => void): this; - once(event: 'socket', listener: (socket: Socket) => void): this; - once(event: 'timeout', listener: () => void): this; - once(event: 'upgrade', listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this; - once(event: 'close', listener: () => void): this; - once(event: 'drain', listener: () => void): this; - once(event: 'error', listener: (err: Error) => void): this; - once(event: 'finish', listener: () => void): this; - once(event: 'pipe', listener: (src: stream.Readable) => void): this; - once(event: 'unpipe', listener: (src: stream.Readable) => void): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - /** - * @deprecated - */ - prependListener(event: 'abort', listener: () => void): this; - prependListener( - event: 'connect', - listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void, - ): this; - prependListener(event: 'continue', listener: () => void): this; - prependListener(event: 'information', listener: (info: InformationEvent) => void): this; - prependListener(event: 'response', listener: (response: IncomingMessage) => void): this; - prependListener(event: 'socket', listener: (socket: Socket) => void): this; - prependListener(event: 'timeout', listener: () => void): this; - prependListener( - event: 'upgrade', - listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void, - ): this; - prependListener(event: 'close', listener: () => void): this; - prependListener(event: 'drain', listener: () => void): this; - prependListener(event: 'error', listener: (err: Error) => void): this; - prependListener(event: 'finish', listener: () => void): this; - prependListener(event: 'pipe', listener: (src: stream.Readable) => void): this; - prependListener(event: 'unpipe', listener: (src: stream.Readable) => void): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - /** - * @deprecated - */ - prependOnceListener(event: 'abort', listener: () => void): this; - prependOnceListener( - event: 'connect', - listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void, - ): this; - prependOnceListener(event: 'continue', listener: () => void): this; - prependOnceListener(event: 'information', listener: (info: InformationEvent) => void): this; - prependOnceListener(event: 'response', listener: (response: IncomingMessage) => void): this; - prependOnceListener(event: 'socket', listener: (socket: Socket) => void): this; - prependOnceListener(event: 'timeout', listener: () => void): this; - prependOnceListener( - event: 'upgrade', - listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void, - ): this; - prependOnceListener(event: 'close', listener: () => void): this; - prependOnceListener(event: 'drain', listener: () => void): this; - prependOnceListener(event: 'error', listener: (err: Error) => void): this; - prependOnceListener(event: 'finish', listener: () => void): this; - prependOnceListener(event: 'pipe', listener: (src: stream.Readable) => void): this; - prependOnceListener(event: 'unpipe', listener: (src: stream.Readable) => void): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - } - /** - * An `IncomingMessage` object is created by {@link Server} or {@link ClientRequest} and passed as the first argument to the `'request'` and `'response'` event respectively. It may be used to - * access response - * status, headers and data. - * - * Different from its `socket` value which is a subclass of `stream.Duplex`, the`IncomingMessage` itself extends `stream.Readable` and is created separately to - * parse and emit the incoming HTTP headers and payload, as the underlying socket - * may be reused multiple times in case of keep-alive. - * @since v0.1.17 - */ - class IncomingMessage extends stream.Readable { - constructor(socket: Socket); - /** - * The `message.aborted` property will be `true` if the request has - * been aborted. - * @since v10.1.0 - * @deprecated Since v17.0.0,v16.12.0 - Check `message.destroyed` from stream.Readable. - */ - aborted: boolean; - /** - * In case of server request, the HTTP version sent by the client. In the case of - * client response, the HTTP version of the connected-to server. - * Probably either `'1.1'` or `'1.0'`. - * - * Also `message.httpVersionMajor` is the first integer and`message.httpVersionMinor` is the second. - * @since v0.1.1 - */ - httpVersion: string; - httpVersionMajor: number; - httpVersionMinor: number; - /** - * The `message.complete` property will be `true` if a complete HTTP message has - * been received and successfully parsed. - * - * This property is particularly useful as a means of determining if a client or - * server fully transmitted a message before a connection was terminated: - * - * ```js - * const req = http.request({ - * host: '127.0.0.1', - * port: 8080, - * method: 'POST' - * }, (res) => { - * res.resume(); - * res.on('end', () => { - * if (!res.complete) - * console.error( - * 'The connection was terminated while the message was still being sent'); - * }); - * }); - * ``` - * @since v0.3.0 - */ - complete: boolean; - /** - * Alias for `message.socket`. - * @since v0.1.90 - * @deprecated Since v16.0.0 - Use `socket`. - */ - connection: Socket; - /** - * The `net.Socket` object associated with the connection. - * - * With HTTPS support, use `request.socket.getPeerCertificate()` to obtain the - * client's authentication details. - * - * This property is guaranteed to be an instance of the `net.Socket` class, - * a subclass of `stream.Duplex`, unless the user specified a socket - * type other than `net.Socket` or internally nulled. - * @since v0.3.0 - */ - socket: Socket; - /** - * The request/response headers object. - * - * Key-value pairs of header names and values. Header names are lower-cased. - * - * ```js - * // Prints something like: - * // - * // { 'user-agent': 'curl/7.22.0', - * // host: '127.0.0.1:8000', - * // accept: '*' } - * console.log(request.getHeaders()); - * ``` - * - * Duplicates in raw headers are handled in the following ways, depending on the - * header name: - * - * * Duplicates of `age`, `authorization`, `content-length`, `content-type`,`etag`, `expires`, `from`, `host`, `if-modified-since`, `if-unmodified-since`,`last-modified`, `location`, - * `max-forwards`, `proxy-authorization`, `referer`,`retry-after`, `server`, or `user-agent` are discarded. - * * `set-cookie` is always an array. Duplicates are added to the array. - * * For duplicate `cookie` headers, the values are joined together with '; '. - * * For all other headers, the values are joined together with ', '. - * @since v0.1.5 - */ - headers: IncomingHttpHeaders; - /** - * The raw request/response headers list exactly as they were received. - * - * The keys and values are in the same list. It is _not_ a - * list of tuples. So, the even-numbered offsets are key values, and the - * odd-numbered offsets are the associated values. - * - * Header names are not lowercased, and duplicates are not merged. - * - * ```js - * // Prints something like: - * // - * // [ 'user-agent', - * // 'this is invalid because there can be only one', - * // 'User-Agent', - * // 'curl/7.22.0', - * // 'Host', - * // '127.0.0.1:8000', - * // 'ACCEPT', - * // '*' ] - * console.log(request.rawHeaders); - * ``` - * @since v0.11.6 - */ - rawHeaders: string[]; - /** - * The request/response trailers object. Only populated at the `'end'` event. - * @since v0.3.0 - */ - trailers: NodeJS.Dict; - /** - * The raw request/response trailer keys and values exactly as they were - * received. Only populated at the `'end'` event. - * @since v0.11.6 - */ - rawTrailers: string[]; - /** - * Calls `message.socket.setTimeout(msecs, callback)`. - * @since v0.5.9 - */ - setTimeout(msecs: number, callback?: () => void): this; - /** - * **Only valid for request obtained from {@link Server}.** - * - * The request method as a string. Read only. Examples: `'GET'`, `'DELETE'`. - * @since v0.1.1 - */ - method?: string | undefined; - /** - * **Only valid for request obtained from {@link Server}.** - * - * Request URL string. This contains only the URL that is present in the actual - * HTTP request. Take the following request: - * - * ```http - * GET /status?name=ryan HTTP/1.1 - * Accept: text/plain - * ``` - * - * To parse the URL into its parts: - * - * ```js - * new URL(request.url, `http://${request.getHeaders().host}`); - * ``` - * - * When `request.url` is `'/status?name=ryan'` and`request.getHeaders().host` is `'localhost:3000'`: - * - * ```console - * $ node - * > new URL(request.url, `http://${request.getHeaders().host}`) - * URL { - * href: 'http://localhost:3000/status?name=ryan', - * origin: 'http://localhost:3000', - * protocol: 'http:', - * username: '', - * password: '', - * host: 'localhost:3000', - * hostname: 'localhost', - * port: '3000', - * pathname: '/status', - * search: '?name=ryan', - * searchParams: URLSearchParams { 'name' => 'ryan' }, - * hash: '' - * } - * ``` - * @since v0.1.90 - */ - url?: string | undefined; - /** - * **Only valid for response obtained from {@link ClientRequest}.** - * - * The 3-digit HTTP response status code. E.G. `404`. - * @since v0.1.1 - */ - statusCode?: number | undefined; - /** - * **Only valid for response obtained from {@link ClientRequest}.** - * - * The HTTP response status message (reason phrase). E.G. `OK` or `Internal Server Error`. - * @since v0.11.10 - */ - statusMessage?: string | undefined; - /** - * Calls `destroy()` on the socket that received the `IncomingMessage`. If `error`is provided, an `'error'` event is emitted on the socket and `error` is passed - * as an argument to any listeners on the event. - * @since v0.3.0 - */ - destroy(error?: Error): this; - } - interface AgentOptions extends Partial { - /** - * Keep sockets around in a pool to be used by other requests in the future. Default = false - */ - keepAlive?: boolean | undefined; - /** - * When using HTTP KeepAlive, how often to send TCP KeepAlive packets over sockets being kept alive. Default = 1000. - * Only relevant if keepAlive is set to true. - */ - keepAliveMsecs?: number | undefined; - /** - * Maximum number of sockets to allow per host. Default for Node 0.10 is 5, default for Node 0.12 is Infinity - */ - maxSockets?: number | undefined; - /** - * Maximum number of sockets allowed for all hosts in total. Each request will use a new socket until the maximum is reached. Default: Infinity. - */ - maxTotalSockets?: number | undefined; - /** - * Maximum number of sockets to leave open in a free state. Only relevant if keepAlive is set to true. Default = 256. - */ - maxFreeSockets?: number | undefined; - /** - * Socket timeout in milliseconds. This will set the timeout after the socket is connected. - */ - timeout?: number | undefined; - /** - * Scheduling strategy to apply when picking the next free socket to use. - * @default `lifo` - */ - scheduling?: 'fifo' | 'lifo' | undefined; - } - /** - * An `Agent` is responsible for managing connection persistence - * and reuse for HTTP clients. It maintains a queue of pending requests - * for a given host and port, reusing a single socket connection for each - * until the queue is empty, at which time the socket is either destroyed - * or put into a pool where it is kept to be used again for requests to the - * same host and port. Whether it is destroyed or pooled depends on the`keepAlive` `option`. - * - * Pooled connections have TCP Keep-Alive enabled for them, but servers may - * still close idle connections, in which case they will be removed from the - * pool and a new connection will be made when a new HTTP request is made for - * that host and port. Servers may also refuse to allow multiple requests - * over the same connection, in which case the connection will have to be - * remade for every request and cannot be pooled. The `Agent` will still make - * the requests to that server, but each one will occur over a new connection. - * - * When a connection is closed by the client or the server, it is removed - * from the pool. Any unused sockets in the pool will be unrefed so as not - * to keep the Node.js process running when there are no outstanding requests. - * (see `socket.unref()`). - * - * It is good practice, to `destroy()` an `Agent` instance when it is no - * longer in use, because unused sockets consume OS resources. - * - * Sockets are removed from an agent when the socket emits either - * a `'close'` event or an `'agentRemove'` event. When intending to keep one - * HTTP request open for a long time without keeping it in the agent, something - * like the following may be done: - * - * ```js - * http.get(options, (res) => { - * // Do stuff - * }).on('socket', (socket) => { - * socket.emit('agentRemove'); - * }); - * ``` - * - * An agent may also be used for an individual request. By providing`{agent: false}` as an option to the `http.get()` or `http.request()`functions, a one-time use `Agent` with default options - * will be used - * for the client connection. - * - * `agent:false`: - * - * ```js - * http.get({ - * hostname: 'localhost', - * port: 80, - * path: '/', - * agent: false // Create a new agent just for this one request - * }, (res) => { - * // Do stuff with response - * }); - * ``` - * @since v0.3.4 - */ - class Agent { - /** - * By default set to 256\. For agents with `keepAlive` enabled, this - * sets the maximum number of sockets that will be left open in the free - * state. - * @since v0.11.7 - */ - maxFreeSockets: number; - /** - * By default set to `Infinity`. Determines how many concurrent sockets the agent - * can have open per origin. Origin is the returned value of `agent.getName()`. - * @since v0.3.6 - */ - maxSockets: number; - /** - * By default set to `Infinity`. Determines how many concurrent sockets the agent - * can have open. Unlike `maxSockets`, this parameter applies across all origins. - * @since v14.5.0, v12.19.0 - */ - maxTotalSockets: number; - /** - * An object which contains arrays of sockets currently awaiting use by - * the agent when `keepAlive` is enabled. Do not modify. - * - * Sockets in the `freeSockets` list will be automatically destroyed and - * removed from the array on `'timeout'`. - * @since v0.11.4 - */ - readonly freeSockets: NodeJS.ReadOnlyDict; - /** - * An object which contains arrays of sockets currently in use by the - * agent. Do not modify. - * @since v0.3.6 - */ - readonly sockets: NodeJS.ReadOnlyDict; - /** - * An object which contains queues of requests that have not yet been assigned to - * sockets. Do not modify. - * @since v0.5.9 - */ - readonly requests: NodeJS.ReadOnlyDict; - constructor(opts?: AgentOptions); - /** - * Destroy any sockets that are currently in use by the agent. - * - * It is usually not necessary to do this. However, if using an - * agent with `keepAlive` enabled, then it is best to explicitly shut down - * the agent when it is no longer needed. Otherwise, - * sockets might stay open for quite a long time before the server - * terminates them. - * @since v0.11.4 - */ - destroy(): void; - } - const METHODS: string[]; - const STATUS_CODES: { - [errorCode: number]: string | undefined; - [errorCode: string]: string | undefined; - }; - /** - * Returns a new instance of {@link Server}. - * - * The `requestListener` is a function which is automatically - * added to the `'request'` event. - * @since v0.1.13 - */ - function createServer< - Request extends typeof IncomingMessage = typeof IncomingMessage, - Response extends typeof ServerResponse = typeof ServerResponse, - >(requestListener?: RequestListener): Server; - function createServer< - Request extends typeof IncomingMessage = typeof IncomingMessage, - Response extends typeof ServerResponse = typeof ServerResponse, - >( - options: ServerOptions, - requestListener?: RequestListener, - ): Server; - // although RequestOptions are passed as ClientRequestArgs to ClientRequest directly, - // create interface RequestOptions would make the naming more clear to developers - interface RequestOptions extends ClientRequestArgs {} - /** - * `options` in `socket.connect()` are also supported. - * - * Node.js maintains several connections per server to make HTTP requests. - * This function allows one to transparently issue requests. - * - * `url` can be a string or a `URL` object. If `url` is a - * string, it is automatically parsed with `new URL()`. If it is a `URL` object, it will be automatically converted to an ordinary `options` object. - * - * If both `url` and `options` are specified, the objects are merged, with the`options` properties taking precedence. - * - * The optional `callback` parameter will be added as a one-time listener for - * the `'response'` event. - * - * `http.request()` returns an instance of the {@link ClientRequest} class. The `ClientRequest` instance is a writable stream. If one needs to - * upload a file with a POST request, then write to the `ClientRequest` object. - * - * ```js - * const http = require('http'); - * - * const postData = JSON.stringify({ - * 'msg': 'Hello World!' - * }); - * - * const options = { - * hostname: 'www.google.com', - * port: 80, - * path: '/upload', - * method: 'POST', - * headers: { - * 'Content-Type': 'application/json', - * 'Content-Length': Buffer.byteLength(postData) - * } - * }; - * - * const req = http.request(options, (res) => { - * console.log(`STATUS: ${res.statusCode}`); - * console.log(`HEADERS: ${JSON.stringify(res.headers)}`); - * res.setEncoding('utf8'); - * res.on('data', (chunk) => { - * console.log(`BODY: ${chunk}`); - * }); - * res.on('end', () => { - * console.log('No more data in response.'); - * }); - * }); - * - * req.on('error', (e) => { - * console.error(`problem with request: ${e.message}`); - * }); - * - * // Write data to request body - * req.write(postData); - * req.end(); - * ``` - * - * In the example `req.end()` was called. With `http.request()` one - * must always call `req.end()` to signify the end of the request - - * even if there is no data being written to the request body. - * - * If any error is encountered during the request (be that with DNS resolution, - * TCP level errors, or actual HTTP parse errors) an `'error'` event is emitted - * on the returned request object. As with all `'error'` events, if no listeners - * are registered the error will be thrown. - * - * There are a few special headers that should be noted. - * - * * Sending a 'Connection: keep-alive' will notify Node.js that the connection to - * the server should be persisted until the next request. - * * Sending a 'Content-Length' header will disable the default chunked encoding. - * * Sending an 'Expect' header will immediately send the request headers. - * Usually, when sending 'Expect: 100-continue', both a timeout and a listener - * for the `'continue'` event should be set. See RFC 2616 Section 8.2.3 for more - * information. - * * Sending an Authorization header will override using the `auth` option - * to compute basic authentication. - * - * Example using a `URL` as `options`: - * - * ```js - * const options = new URL('http://abc:xyz@example.com'); - * - * const req = http.request(options, (res) => { - * // ... - * }); - * ``` - * - * In a successful request, the following events will be emitted in the following - * order: - * - * * `'socket'` - * * `'response'` - * * `'data'` any number of times, on the `res` object - * (`'data'` will not be emitted at all if the response body is empty, for - * instance, in most redirects) - * * `'end'` on the `res` object - * * `'close'` - * - * In the case of a connection error, the following events will be emitted: - * - * * `'socket'` - * * `'error'` - * * `'close'` - * - * In the case of a premature connection close before the response is received, - * the following events will be emitted in the following order: - * - * * `'socket'` - * * `'error'` with an error with message `'Error: socket hang up'` and code`'ECONNRESET'` - * * `'close'` - * - * In the case of a premature connection close after the response is received, - * the following events will be emitted in the following order: - * - * * `'socket'` - * * `'response'` - * * `'data'` any number of times, on the `res` object - * * (connection closed here) - * * `'aborted'` on the `res` object - * * `'error'` on the `res` object with an error with message`'Error: aborted'` and code `'ECONNRESET'`. - * * `'close'` - * * `'close'` on the `res` object - * - * If `req.destroy()` is called before a socket is assigned, the following - * events will be emitted in the following order: - * - * * (`req.destroy()` called here) - * * `'error'` with an error with message `'Error: socket hang up'` and code`'ECONNRESET'` - * * `'close'` - * - * If `req.destroy()` is called before the connection succeeds, the following - * events will be emitted in the following order: - * - * * `'socket'` - * * (`req.destroy()` called here) - * * `'error'` with an error with message `'Error: socket hang up'` and code`'ECONNRESET'` - * * `'close'` - * - * If `req.destroy()` is called after the response is received, the following - * events will be emitted in the following order: - * - * * `'socket'` - * * `'response'` - * * `'data'` any number of times, on the `res` object - * * (`req.destroy()` called here) - * * `'aborted'` on the `res` object - * * `'error'` on the `res` object with an error with message`'Error: aborted'` and code `'ECONNRESET'`. - * * `'close'` - * * `'close'` on the `res` object - * - * If `req.abort()` is called before a socket is assigned, the following - * events will be emitted in the following order: - * - * * (`req.abort()` called here) - * * `'abort'` - * * `'close'` - * - * If `req.abort()` is called before the connection succeeds, the following - * events will be emitted in the following order: - * - * * `'socket'` - * * (`req.abort()` called here) - * * `'abort'` - * * `'error'` with an error with message `'Error: socket hang up'` and code`'ECONNRESET'` - * * `'close'` - * - * If `req.abort()` is called after the response is received, the following - * events will be emitted in the following order: - * - * * `'socket'` - * * `'response'` - * * `'data'` any number of times, on the `res` object - * * (`req.abort()` called here) - * * `'abort'` - * * `'aborted'` on the `res` object - * * `'error'` on the `res` object with an error with message`'Error: aborted'` and code `'ECONNRESET'`. - * * `'close'` - * * `'close'` on the `res` object - * - * Setting the `timeout` option or using the `setTimeout()` function will - * not abort the request or do anything besides add a `'timeout'` event. - * - * Passing an `AbortSignal` and then calling `abort` on the corresponding`AbortController` will behave the same way as calling `.destroy()` on the - * request itself. - * @since v0.3.6 - */ - function request(options: RequestOptions | string | URL, callback?: (res: IncomingMessage) => void): ClientRequest; - function request( - url: string | URL, - options: RequestOptions, - callback?: (res: IncomingMessage) => void, - ): ClientRequest; - /** - * Since most requests are GET requests without bodies, Node.js provides this - * convenience method. The only difference between this method and {@link request} is that it sets the method to GET and calls `req.end()`automatically. The callback must take care to consume the - * response - * data for reasons stated in {@link ClientRequest} section. - * - * The `callback` is invoked with a single argument that is an instance of {@link IncomingMessage}. - * - * JSON fetching example: - * - * ```js - * http.get('http://localhost:8000/', (res) => { - * const { statusCode } = res; - * const contentType = res.headers['content-type']; - * - * let error; - * // Any 2xx status code signals a successful response but - * // here we're only checking for 200. - * if (statusCode !== 200) { - * error = new Error('Request Failed.\n' + - * `Status Code: ${statusCode}`); - * } else if (!/^application\/json/.test(contentType)) { - * error = new Error('Invalid content-type.\n' + - * `Expected application/json but received ${contentType}`); - * } - * if (error) { - * console.error(error.message); - * // Consume response data to free up memory - * res.resume(); - * return; - * } - * - * res.setEncoding('utf8'); - * let rawData = ''; - * res.on('data', (chunk) => { rawData += chunk; }); - * res.on('end', () => { - * try { - * const parsedData = JSON.parse(rawData); - * console.log(parsedData); - * } catch (e) { - * console.error(e.message); - * } - * }); - * }).on('error', (e) => { - * console.error(`Got error: ${e.message}`); - * }); - * - * // Create a local server to receive data from - * const server = http.createServer((req, res) => { - * res.writeHead(200, { 'Content-Type': 'application/json' }); - * res.end(JSON.stringify({ - * data: 'Hello World!' - * })); - * }); - * - * server.listen(8000); - * ``` - * @since v0.3.6 - * @param options Accepts the same `options` as {@link request}, with the `method` always set to `GET`. Properties that are inherited from the prototype are ignored. - */ - function get(options: RequestOptions | string | URL, callback?: (res: IncomingMessage) => void): ClientRequest; - function get(url: string | URL, options: RequestOptions, callback?: (res: IncomingMessage) => void): ClientRequest; - - /** - * Performs the low-level validations on the provided name that are done when `res.setHeader(name, value)` is called. - * Passing illegal value as name will result in a TypeError being thrown, identified by `code: 'ERR_INVALID_HTTP_TOKEN'`. - * @param name Header name - * @since v14.3.0 - */ - function validateHeaderName(name: string): void; - /** - * Performs the low-level validations on the provided value that are done when `res.setHeader(name, value)` is called. - * Passing illegal value as value will result in a TypeError being thrown. - * - Undefined value error is identified by `code: 'ERR_HTTP_INVALID_HEADER_VALUE'`. - * - Invalid value character error is identified by `code: 'ERR_INVALID_CHAR'`. - * @param name Header name - * @param value Header value - * @since v14.3.0 - */ - function validateHeaderValue(name: string, value: string): void; - - /** - * Set the maximum number of idle HTTP parsers. Default: 1000. - * @param count - * @since v18.8.0, v16.18.0 - */ - function setMaxIdleHTTPParsers(count: number): void; - - let globalAgent: Agent; - /** - * Read-only property specifying the maximum allowed size of HTTP headers in bytes. - * Defaults to 16KB. Configurable using the `--max-http-header-size` CLI option. - */ - const maxHeaderSize: number; -} -declare module 'node:http' { - export * from 'http'; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/http2.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/http2.d.ts deleted file mode 100755 index 0e368260..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/http2.d.ts +++ /dev/null @@ -1,2134 +0,0 @@ -/** - * The `http2` module provides an implementation of the [HTTP/2](https://tools.ietf.org/html/rfc7540) protocol. It - * can be accessed using: - * - * ```js - * const http2 = require('http2'); - * ``` - * @since v8.4.0 - * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/http2.js) - */ -declare module 'http2' { - import EventEmitter = require('node:events'); - import * as fs from 'node:fs'; - import * as net from 'node:net'; - import * as stream from 'node:stream'; - import * as tls from 'node:tls'; - import * as url from 'node:url'; - import { IncomingHttpHeaders as Http1IncomingHttpHeaders, OutgoingHttpHeaders, IncomingMessage, ServerResponse } from 'node:http'; - export { OutgoingHttpHeaders } from 'node:http'; - export interface IncomingHttpStatusHeader { - ':status'?: number | undefined; - } - export interface IncomingHttpHeaders extends Http1IncomingHttpHeaders { - ':path'?: string | undefined; - ':method'?: string | undefined; - ':authority'?: string | undefined; - ':scheme'?: string | undefined; - } - // Http2Stream - export interface StreamPriorityOptions { - exclusive?: boolean | undefined; - parent?: number | undefined; - weight?: number | undefined; - silent?: boolean | undefined; - } - export interface StreamState { - localWindowSize?: number | undefined; - state?: number | undefined; - localClose?: number | undefined; - remoteClose?: number | undefined; - sumDependencyWeight?: number | undefined; - weight?: number | undefined; - } - export interface ServerStreamResponseOptions { - endStream?: boolean | undefined; - waitForTrailers?: boolean | undefined; - } - export interface StatOptions { - offset: number; - length: number; - } - export interface ServerStreamFileResponseOptions { - statCheck?(stats: fs.Stats, headers: OutgoingHttpHeaders, statOptions: StatOptions): void | boolean; - waitForTrailers?: boolean | undefined; - offset?: number | undefined; - length?: number | undefined; - } - export interface ServerStreamFileResponseOptionsWithError extends ServerStreamFileResponseOptions { - onError?(err: NodeJS.ErrnoException): void; - } - export interface Http2Stream extends stream.Duplex { - /** - * Set to `true` if the `Http2Stream` instance was aborted abnormally. When set, - * the `'aborted'` event will have been emitted. - * @since v8.4.0 - */ - readonly aborted: boolean; - /** - * This property shows the number of characters currently buffered to be written. - * See `net.Socket.bufferSize` for details. - * @since v11.2.0, v10.16.0 - */ - readonly bufferSize: number; - /** - * Set to `true` if the `Http2Stream` instance has been closed. - * @since v9.4.0 - */ - readonly closed: boolean; - /** - * Set to `true` if the `Http2Stream` instance has been destroyed and is no longer - * usable. - * @since v8.4.0 - */ - readonly destroyed: boolean; - /** - * Set to `true` if the `END_STREAM` flag was set in the request or response - * HEADERS frame received, indicating that no additional data should be received - * and the readable side of the `Http2Stream` will be closed. - * @since v10.11.0 - */ - readonly endAfterHeaders: boolean; - /** - * The numeric stream identifier of this `Http2Stream` instance. Set to `undefined`if the stream identifier has not yet been assigned. - * @since v8.4.0 - */ - readonly id?: number | undefined; - /** - * Set to `true` if the `Http2Stream` instance has not yet been assigned a - * numeric stream identifier. - * @since v9.4.0 - */ - readonly pending: boolean; - /** - * Set to the `RST_STREAM` `error code` reported when the `Http2Stream` is - * destroyed after either receiving an `RST_STREAM` frame from the connected peer, - * calling `http2stream.close()`, or `http2stream.destroy()`. Will be`undefined` if the `Http2Stream` has not been closed. - * @since v8.4.0 - */ - readonly rstCode: number; - /** - * An object containing the outbound headers sent for this `Http2Stream`. - * @since v9.5.0 - */ - readonly sentHeaders: OutgoingHttpHeaders; - /** - * An array of objects containing the outbound informational (additional) headers - * sent for this `Http2Stream`. - * @since v9.5.0 - */ - readonly sentInfoHeaders?: OutgoingHttpHeaders[] | undefined; - /** - * An object containing the outbound trailers sent for this `HttpStream`. - * @since v9.5.0 - */ - readonly sentTrailers?: OutgoingHttpHeaders | undefined; - /** - * A reference to the `Http2Session` instance that owns this `Http2Stream`. The - * value will be `undefined` after the `Http2Stream` instance is destroyed. - * @since v8.4.0 - */ - readonly session: Http2Session; - /** - * Provides miscellaneous information about the current state of the`Http2Stream`. - * - * A current state of this `Http2Stream`. - * @since v8.4.0 - */ - readonly state: StreamState; - /** - * Closes the `Http2Stream` instance by sending an `RST_STREAM` frame to the - * connected HTTP/2 peer. - * @since v8.4.0 - * @param [code=http2.constants.NGHTTP2_NO_ERROR] Unsigned 32-bit integer identifying the error code. - * @param callback An optional function registered to listen for the `'close'` event. - */ - close(code?: number, callback?: () => void): void; - /** - * Updates the priority for this `Http2Stream` instance. - * @since v8.4.0 - */ - priority(options: StreamPriorityOptions): void; - /** - * ```js - * const http2 = require('http2'); - * const client = http2.connect('http://example.org:8000'); - * const { NGHTTP2_CANCEL } = http2.constants; - * const req = client.request({ ':path': '/' }); - * - * // Cancel the stream if there's no activity after 5 seconds - * req.setTimeout(5000, () => req.close(NGHTTP2_CANCEL)); - * ``` - * @since v8.4.0 - */ - setTimeout(msecs: number, callback?: () => void): void; - /** - * Sends a trailing `HEADERS` frame to the connected HTTP/2 peer. This method - * will cause the `Http2Stream` to be immediately closed and must only be - * called after the `'wantTrailers'` event has been emitted. When sending a - * request or sending a response, the `options.waitForTrailers` option must be set - * in order to keep the `Http2Stream` open after the final `DATA` frame so that - * trailers can be sent. - * - * ```js - * const http2 = require('http2'); - * const server = http2.createServer(); - * server.on('stream', (stream) => { - * stream.respond(undefined, { waitForTrailers: true }); - * stream.on('wantTrailers', () => { - * stream.sendTrailers({ xyz: 'abc' }); - * }); - * stream.end('Hello World'); - * }); - * ``` - * - * The HTTP/1 specification forbids trailers from containing HTTP/2 pseudo-header - * fields (e.g. `':method'`, `':path'`, etc). - * @since v10.0.0 - */ - sendTrailers(headers: OutgoingHttpHeaders): void; - addListener(event: 'aborted', listener: () => void): this; - addListener(event: 'close', listener: () => void): this; - addListener(event: 'data', listener: (chunk: Buffer | string) => void): this; - addListener(event: 'drain', listener: () => void): this; - addListener(event: 'end', listener: () => void): this; - addListener(event: 'error', listener: (err: Error) => void): this; - addListener(event: 'finish', listener: () => void): this; - addListener(event: 'frameError', listener: (frameType: number, errorCode: number) => void): this; - addListener(event: 'pipe', listener: (src: stream.Readable) => void): this; - addListener(event: 'unpipe', listener: (src: stream.Readable) => void): this; - addListener(event: 'streamClosed', listener: (code: number) => void): this; - addListener(event: 'timeout', listener: () => void): this; - addListener(event: 'trailers', listener: (trailers: IncomingHttpHeaders, flags: number) => void): this; - addListener(event: 'wantTrailers', listener: () => void): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - emit(event: 'aborted'): boolean; - emit(event: 'close'): boolean; - emit(event: 'data', chunk: Buffer | string): boolean; - emit(event: 'drain'): boolean; - emit(event: 'end'): boolean; - emit(event: 'error', err: Error): boolean; - emit(event: 'finish'): boolean; - emit(event: 'frameError', frameType: number, errorCode: number): boolean; - emit(event: 'pipe', src: stream.Readable): boolean; - emit(event: 'unpipe', src: stream.Readable): boolean; - emit(event: 'streamClosed', code: number): boolean; - emit(event: 'timeout'): boolean; - emit(event: 'trailers', trailers: IncomingHttpHeaders, flags: number): boolean; - emit(event: 'wantTrailers'): boolean; - emit(event: string | symbol, ...args: any[]): boolean; - on(event: 'aborted', listener: () => void): this; - on(event: 'close', listener: () => void): this; - on(event: 'data', listener: (chunk: Buffer | string) => void): this; - on(event: 'drain', listener: () => void): this; - on(event: 'end', listener: () => void): this; - on(event: 'error', listener: (err: Error) => void): this; - on(event: 'finish', listener: () => void): this; - on(event: 'frameError', listener: (frameType: number, errorCode: number) => void): this; - on(event: 'pipe', listener: (src: stream.Readable) => void): this; - on(event: 'unpipe', listener: (src: stream.Readable) => void): this; - on(event: 'streamClosed', listener: (code: number) => void): this; - on(event: 'timeout', listener: () => void): this; - on(event: 'trailers', listener: (trailers: IncomingHttpHeaders, flags: number) => void): this; - on(event: 'wantTrailers', listener: () => void): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once(event: 'aborted', listener: () => void): this; - once(event: 'close', listener: () => void): this; - once(event: 'data', listener: (chunk: Buffer | string) => void): this; - once(event: 'drain', listener: () => void): this; - once(event: 'end', listener: () => void): this; - once(event: 'error', listener: (err: Error) => void): this; - once(event: 'finish', listener: () => void): this; - once(event: 'frameError', listener: (frameType: number, errorCode: number) => void): this; - once(event: 'pipe', listener: (src: stream.Readable) => void): this; - once(event: 'unpipe', listener: (src: stream.Readable) => void): this; - once(event: 'streamClosed', listener: (code: number) => void): this; - once(event: 'timeout', listener: () => void): this; - once(event: 'trailers', listener: (trailers: IncomingHttpHeaders, flags: number) => void): this; - once(event: 'wantTrailers', listener: () => void): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener(event: 'aborted', listener: () => void): this; - prependListener(event: 'close', listener: () => void): this; - prependListener(event: 'data', listener: (chunk: Buffer | string) => void): this; - prependListener(event: 'drain', listener: () => void): this; - prependListener(event: 'end', listener: () => void): this; - prependListener(event: 'error', listener: (err: Error) => void): this; - prependListener(event: 'finish', listener: () => void): this; - prependListener(event: 'frameError', listener: (frameType: number, errorCode: number) => void): this; - prependListener(event: 'pipe', listener: (src: stream.Readable) => void): this; - prependListener(event: 'unpipe', listener: (src: stream.Readable) => void): this; - prependListener(event: 'streamClosed', listener: (code: number) => void): this; - prependListener(event: 'timeout', listener: () => void): this; - prependListener(event: 'trailers', listener: (trailers: IncomingHttpHeaders, flags: number) => void): this; - prependListener(event: 'wantTrailers', listener: () => void): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - prependOnceListener(event: 'aborted', listener: () => void): this; - prependOnceListener(event: 'close', listener: () => void): this; - prependOnceListener(event: 'data', listener: (chunk: Buffer | string) => void): this; - prependOnceListener(event: 'drain', listener: () => void): this; - prependOnceListener(event: 'end', listener: () => void): this; - prependOnceListener(event: 'error', listener: (err: Error) => void): this; - prependOnceListener(event: 'finish', listener: () => void): this; - prependOnceListener(event: 'frameError', listener: (frameType: number, errorCode: number) => void): this; - prependOnceListener(event: 'pipe', listener: (src: stream.Readable) => void): this; - prependOnceListener(event: 'unpipe', listener: (src: stream.Readable) => void): this; - prependOnceListener(event: 'streamClosed', listener: (code: number) => void): this; - prependOnceListener(event: 'timeout', listener: () => void): this; - prependOnceListener(event: 'trailers', listener: (trailers: IncomingHttpHeaders, flags: number) => void): this; - prependOnceListener(event: 'wantTrailers', listener: () => void): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - } - export interface ClientHttp2Stream extends Http2Stream { - addListener(event: 'continue', listener: () => {}): this; - addListener(event: 'headers', listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; - addListener(event: 'push', listener: (headers: IncomingHttpHeaders, flags: number) => void): this; - addListener(event: 'response', listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - emit(event: 'continue'): boolean; - emit(event: 'headers', headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number): boolean; - emit(event: 'push', headers: IncomingHttpHeaders, flags: number): boolean; - emit(event: 'response', headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number): boolean; - emit(event: string | symbol, ...args: any[]): boolean; - on(event: 'continue', listener: () => {}): this; - on(event: 'headers', listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; - on(event: 'push', listener: (headers: IncomingHttpHeaders, flags: number) => void): this; - on(event: 'response', listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once(event: 'continue', listener: () => {}): this; - once(event: 'headers', listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; - once(event: 'push', listener: (headers: IncomingHttpHeaders, flags: number) => void): this; - once(event: 'response', listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener(event: 'continue', listener: () => {}): this; - prependListener(event: 'headers', listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; - prependListener(event: 'push', listener: (headers: IncomingHttpHeaders, flags: number) => void): this; - prependListener(event: 'response', listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - prependOnceListener(event: 'continue', listener: () => {}): this; - prependOnceListener(event: 'headers', listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; - prependOnceListener(event: 'push', listener: (headers: IncomingHttpHeaders, flags: number) => void): this; - prependOnceListener(event: 'response', listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - } - export interface ServerHttp2Stream extends Http2Stream { - /** - * True if headers were sent, false otherwise (read-only). - * @since v8.4.0 - */ - readonly headersSent: boolean; - /** - * Read-only property mapped to the `SETTINGS_ENABLE_PUSH` flag of the remote - * client's most recent `SETTINGS` frame. Will be `true` if the remote peer - * accepts push streams, `false` otherwise. Settings are the same for every`Http2Stream` in the same `Http2Session`. - * @since v8.4.0 - */ - readonly pushAllowed: boolean; - /** - * Sends an additional informational `HEADERS` frame to the connected HTTP/2 peer. - * @since v8.4.0 - */ - additionalHeaders(headers: OutgoingHttpHeaders): void; - /** - * Initiates a push stream. The callback is invoked with the new `Http2Stream`instance created for the push stream passed as the second argument, or an`Error` passed as the first argument. - * - * ```js - * const http2 = require('http2'); - * const server = http2.createServer(); - * server.on('stream', (stream) => { - * stream.respond({ ':status': 200 }); - * stream.pushStream({ ':path': '/' }, (err, pushStream, headers) => { - * if (err) throw err; - * pushStream.respond({ ':status': 200 }); - * pushStream.end('some pushed data'); - * }); - * stream.end('some data'); - * }); - * ``` - * - * Setting the weight of a push stream is not allowed in the `HEADERS` frame. Pass - * a `weight` value to `http2stream.priority` with the `silent` option set to`true` to enable server-side bandwidth balancing between concurrent streams. - * - * Calling `http2stream.pushStream()` from within a pushed stream is not permitted - * and will throw an error. - * @since v8.4.0 - * @param callback Callback that is called once the push stream has been initiated. - */ - pushStream(headers: OutgoingHttpHeaders, callback?: (err: Error | null, pushStream: ServerHttp2Stream, headers: OutgoingHttpHeaders) => void): void; - pushStream(headers: OutgoingHttpHeaders, options?: StreamPriorityOptions, callback?: (err: Error | null, pushStream: ServerHttp2Stream, headers: OutgoingHttpHeaders) => void): void; - /** - * ```js - * const http2 = require('http2'); - * const server = http2.createServer(); - * server.on('stream', (stream) => { - * stream.respond({ ':status': 200 }); - * stream.end('some data'); - * }); - * ``` - * - * When the `options.waitForTrailers` option is set, the `'wantTrailers'` event - * will be emitted immediately after queuing the last chunk of payload data to be - * sent. The `http2stream.sendTrailers()` method can then be used to sent trailing - * header fields to the peer. - * - * When `options.waitForTrailers` is set, the `Http2Stream` will not automatically - * close when the final `DATA` frame is transmitted. User code must call either`http2stream.sendTrailers()` or `http2stream.close()` to close the`Http2Stream`. - * - * ```js - * const http2 = require('http2'); - * const server = http2.createServer(); - * server.on('stream', (stream) => { - * stream.respond({ ':status': 200 }, { waitForTrailers: true }); - * stream.on('wantTrailers', () => { - * stream.sendTrailers({ ABC: 'some value to send' }); - * }); - * stream.end('some data'); - * }); - * ``` - * @since v8.4.0 - */ - respond(headers?: OutgoingHttpHeaders, options?: ServerStreamResponseOptions): void; - /** - * Initiates a response whose data is read from the given file descriptor. No - * validation is performed on the given file descriptor. If an error occurs while - * attempting to read data using the file descriptor, the `Http2Stream` will be - * closed using an `RST_STREAM` frame using the standard `INTERNAL_ERROR` code. - * - * When used, the `Http2Stream` object's `Duplex` interface will be closed - * automatically. - * - * ```js - * const http2 = require('http2'); - * const fs = require('fs'); - * - * const server = http2.createServer(); - * server.on('stream', (stream) => { - * const fd = fs.openSync('/some/file', 'r'); - * - * const stat = fs.fstatSync(fd); - * const headers = { - * 'content-length': stat.size, - * 'last-modified': stat.mtime.toUTCString(), - * 'content-type': 'text/plain; charset=utf-8' - * }; - * stream.respondWithFD(fd, headers); - * stream.on('close', () => fs.closeSync(fd)); - * }); - * ``` - * - * The optional `options.statCheck` function may be specified to give user code - * an opportunity to set additional content headers based on the `fs.Stat` details - * of the given fd. If the `statCheck` function is provided, the`http2stream.respondWithFD()` method will perform an `fs.fstat()` call to - * collect details on the provided file descriptor. - * - * The `offset` and `length` options may be used to limit the response to a - * specific range subset. This can be used, for instance, to support HTTP Range - * requests. - * - * The file descriptor or `FileHandle` is not closed when the stream is closed, - * so it will need to be closed manually once it is no longer needed. - * Using the same file descriptor concurrently for multiple streams - * is not supported and may result in data loss. Re-using a file descriptor - * after a stream has finished is supported. - * - * When the `options.waitForTrailers` option is set, the `'wantTrailers'` event - * will be emitted immediately after queuing the last chunk of payload data to be - * sent. The `http2stream.sendTrailers()` method can then be used to sent trailing - * header fields to the peer. - * - * When `options.waitForTrailers` is set, the `Http2Stream` will not automatically - * close when the final `DATA` frame is transmitted. User code _must_ call either`http2stream.sendTrailers()` or `http2stream.close()` to close the`Http2Stream`. - * - * ```js - * const http2 = require('http2'); - * const fs = require('fs'); - * - * const server = http2.createServer(); - * server.on('stream', (stream) => { - * const fd = fs.openSync('/some/file', 'r'); - * - * const stat = fs.fstatSync(fd); - * const headers = { - * 'content-length': stat.size, - * 'last-modified': stat.mtime.toUTCString(), - * 'content-type': 'text/plain; charset=utf-8' - * }; - * stream.respondWithFD(fd, headers, { waitForTrailers: true }); - * stream.on('wantTrailers', () => { - * stream.sendTrailers({ ABC: 'some value to send' }); - * }); - * - * stream.on('close', () => fs.closeSync(fd)); - * }); - * ``` - * @since v8.4.0 - * @param fd A readable file descriptor. - */ - respondWithFD(fd: number | fs.promises.FileHandle, headers?: OutgoingHttpHeaders, options?: ServerStreamFileResponseOptions): void; - /** - * Sends a regular file as the response. The `path` must specify a regular file - * or an `'error'` event will be emitted on the `Http2Stream` object. - * - * When used, the `Http2Stream` object's `Duplex` interface will be closed - * automatically. - * - * The optional `options.statCheck` function may be specified to give user code - * an opportunity to set additional content headers based on the `fs.Stat` details - * of the given file: - * - * If an error occurs while attempting to read the file data, the `Http2Stream`will be closed using an `RST_STREAM` frame using the standard `INTERNAL_ERROR`code. If the `onError` callback is - * defined, then it will be called. Otherwise - * the stream will be destroyed. - * - * Example using a file path: - * - * ```js - * const http2 = require('http2'); - * const server = http2.createServer(); - * server.on('stream', (stream) => { - * function statCheck(stat, headers) { - * headers['last-modified'] = stat.mtime.toUTCString(); - * } - * - * function onError(err) { - * // stream.respond() can throw if the stream has been destroyed by - * // the other side. - * try { - * if (err.code === 'ENOENT') { - * stream.respond({ ':status': 404 }); - * } else { - * stream.respond({ ':status': 500 }); - * } - * } catch (err) { - * // Perform actual error handling. - * console.log(err); - * } - * stream.end(); - * } - * - * stream.respondWithFile('/some/file', - * { 'content-type': 'text/plain; charset=utf-8' }, - * { statCheck, onError }); - * }); - * ``` - * - * The `options.statCheck` function may also be used to cancel the send operation - * by returning `false`. For instance, a conditional request may check the stat - * results to determine if the file has been modified to return an appropriate`304` response: - * - * ```js - * const http2 = require('http2'); - * const server = http2.createServer(); - * server.on('stream', (stream) => { - * function statCheck(stat, headers) { - * // Check the stat here... - * stream.respond({ ':status': 304 }); - * return false; // Cancel the send operation - * } - * stream.respondWithFile('/some/file', - * { 'content-type': 'text/plain; charset=utf-8' }, - * { statCheck }); - * }); - * ``` - * - * The `content-length` header field will be automatically set. - * - * The `offset` and `length` options may be used to limit the response to a - * specific range subset. This can be used, for instance, to support HTTP Range - * requests. - * - * The `options.onError` function may also be used to handle all the errors - * that could happen before the delivery of the file is initiated. The - * default behavior is to destroy the stream. - * - * When the `options.waitForTrailers` option is set, the `'wantTrailers'` event - * will be emitted immediately after queuing the last chunk of payload data to be - * sent. The `http2stream.sendTrailers()` method can then be used to sent trailing - * header fields to the peer. - * - * When `options.waitForTrailers` is set, the `Http2Stream` will not automatically - * close when the final `DATA` frame is transmitted. User code must call either`http2stream.sendTrailers()` or `http2stream.close()` to close the`Http2Stream`. - * - * ```js - * const http2 = require('http2'); - * const server = http2.createServer(); - * server.on('stream', (stream) => { - * stream.respondWithFile('/some/file', - * { 'content-type': 'text/plain; charset=utf-8' }, - * { waitForTrailers: true }); - * stream.on('wantTrailers', () => { - * stream.sendTrailers({ ABC: 'some value to send' }); - * }); - * }); - * ``` - * @since v8.4.0 - */ - respondWithFile(path: string, headers?: OutgoingHttpHeaders, options?: ServerStreamFileResponseOptionsWithError): void; - } - // Http2Session - export interface Settings { - headerTableSize?: number | undefined; - enablePush?: boolean | undefined; - initialWindowSize?: number | undefined; - maxFrameSize?: number | undefined; - maxConcurrentStreams?: number | undefined; - maxHeaderListSize?: number | undefined; - enableConnectProtocol?: boolean | undefined; - } - export interface ClientSessionRequestOptions { - endStream?: boolean | undefined; - exclusive?: boolean | undefined; - parent?: number | undefined; - weight?: number | undefined; - waitForTrailers?: boolean | undefined; - signal?: AbortSignal | undefined; - } - export interface SessionState { - effectiveLocalWindowSize?: number | undefined; - effectiveRecvDataLength?: number | undefined; - nextStreamID?: number | undefined; - localWindowSize?: number | undefined; - lastProcStreamID?: number | undefined; - remoteWindowSize?: number | undefined; - outboundQueueSize?: number | undefined; - deflateDynamicTableSize?: number | undefined; - inflateDynamicTableSize?: number | undefined; - } - export interface Http2Session extends EventEmitter { - /** - * Value will be `undefined` if the `Http2Session` is not yet connected to a - * socket, `h2c` if the `Http2Session` is not connected to a `TLSSocket`, or - * will return the value of the connected `TLSSocket`'s own `alpnProtocol`property. - * @since v9.4.0 - */ - readonly alpnProtocol?: string | undefined; - /** - * Will be `true` if this `Http2Session` instance has been closed, otherwise`false`. - * @since v9.4.0 - */ - readonly closed: boolean; - /** - * Will be `true` if this `Http2Session` instance is still connecting, will be set - * to `false` before emitting `connect` event and/or calling the `http2.connect`callback. - * @since v10.0.0 - */ - readonly connecting: boolean; - /** - * Will be `true` if this `Http2Session` instance has been destroyed and must no - * longer be used, otherwise `false`. - * @since v8.4.0 - */ - readonly destroyed: boolean; - /** - * Value is `undefined` if the `Http2Session` session socket has not yet been - * connected, `true` if the `Http2Session` is connected with a `TLSSocket`, - * and `false` if the `Http2Session` is connected to any other kind of socket - * or stream. - * @since v9.4.0 - */ - readonly encrypted?: boolean | undefined; - /** - * A prototype-less object describing the current local settings of this`Http2Session`. The local settings are local to _this_`Http2Session` instance. - * @since v8.4.0 - */ - readonly localSettings: Settings; - /** - * If the `Http2Session` is connected to a `TLSSocket`, the `originSet` property - * will return an `Array` of origins for which the `Http2Session` may be - * considered authoritative. - * - * The `originSet` property is only available when using a secure TLS connection. - * @since v9.4.0 - */ - readonly originSet?: string[] | undefined; - /** - * Indicates whether the `Http2Session` is currently waiting for acknowledgment of - * a sent `SETTINGS` frame. Will be `true` after calling the`http2session.settings()` method. Will be `false` once all sent `SETTINGS`frames have been acknowledged. - * @since v8.4.0 - */ - readonly pendingSettingsAck: boolean; - /** - * A prototype-less object describing the current remote settings of this`Http2Session`. The remote settings are set by the _connected_ HTTP/2 peer. - * @since v8.4.0 - */ - readonly remoteSettings: Settings; - /** - * Returns a `Proxy` object that acts as a `net.Socket` (or `tls.TLSSocket`) but - * limits available methods to ones safe to use with HTTP/2. - * - * `destroy`, `emit`, `end`, `pause`, `read`, `resume`, and `write` will throw - * an error with code `ERR_HTTP2_NO_SOCKET_MANIPULATION`. See `Http2Session and Sockets` for more information. - * - * `setTimeout` method will be called on this `Http2Session`. - * - * All other interactions will be routed directly to the socket. - * @since v8.4.0 - */ - readonly socket: net.Socket | tls.TLSSocket; - /** - * Provides miscellaneous information about the current state of the`Http2Session`. - * - * An object describing the current status of this `Http2Session`. - * @since v8.4.0 - */ - readonly state: SessionState; - /** - * The `http2session.type` will be equal to`http2.constants.NGHTTP2_SESSION_SERVER` if this `Http2Session` instance is a - * server, and `http2.constants.NGHTTP2_SESSION_CLIENT` if the instance is a - * client. - * @since v8.4.0 - */ - readonly type: number; - /** - * Gracefully closes the `Http2Session`, allowing any existing streams to - * complete on their own and preventing new `Http2Stream` instances from being - * created. Once closed, `http2session.destroy()`_might_ be called if there - * are no open `Http2Stream` instances. - * - * If specified, the `callback` function is registered as a handler for the`'close'` event. - * @since v9.4.0 - */ - close(callback?: () => void): void; - /** - * Immediately terminates the `Http2Session` and the associated `net.Socket` or`tls.TLSSocket`. - * - * Once destroyed, the `Http2Session` will emit the `'close'` event. If `error`is not undefined, an `'error'` event will be emitted immediately before the`'close'` event. - * - * If there are any remaining open `Http2Streams` associated with the`Http2Session`, those will also be destroyed. - * @since v8.4.0 - * @param error An `Error` object if the `Http2Session` is being destroyed due to an error. - * @param code The HTTP/2 error code to send in the final `GOAWAY` frame. If unspecified, and `error` is not undefined, the default is `INTERNAL_ERROR`, otherwise defaults to `NO_ERROR`. - */ - destroy(error?: Error, code?: number): void; - /** - * Transmits a `GOAWAY` frame to the connected peer _without_ shutting down the`Http2Session`. - * @since v9.4.0 - * @param code An HTTP/2 error code - * @param lastStreamID The numeric ID of the last processed `Http2Stream` - * @param opaqueData A `TypedArray` or `DataView` instance containing additional data to be carried within the `GOAWAY` frame. - */ - goaway(code?: number, lastStreamID?: number, opaqueData?: NodeJS.ArrayBufferView): void; - /** - * Sends a `PING` frame to the connected HTTP/2 peer. A `callback` function must - * be provided. The method will return `true` if the `PING` was sent, `false`otherwise. - * - * The maximum number of outstanding (unacknowledged) pings is determined by the`maxOutstandingPings` configuration option. The default maximum is 10. - * - * If provided, the `payload` must be a `Buffer`, `TypedArray`, or `DataView`containing 8 bytes of data that will be transmitted with the `PING` and - * returned with the ping acknowledgment. - * - * The callback will be invoked with three arguments: an error argument that will - * be `null` if the `PING` was successfully acknowledged, a `duration` argument - * that reports the number of milliseconds elapsed since the ping was sent and the - * acknowledgment was received, and a `Buffer` containing the 8-byte `PING`payload. - * - * ```js - * session.ping(Buffer.from('abcdefgh'), (err, duration, payload) => { - * if (!err) { - * console.log(`Ping acknowledged in ${duration} milliseconds`); - * console.log(`With payload '${payload.toString()}'`); - * } - * }); - * ``` - * - * If the `payload` argument is not specified, the default payload will be the - * 64-bit timestamp (little endian) marking the start of the `PING` duration. - * @since v8.9.3 - * @param payload Optional ping payload. - */ - ping(callback: (err: Error | null, duration: number, payload: Buffer) => void): boolean; - ping(payload: NodeJS.ArrayBufferView, callback: (err: Error | null, duration: number, payload: Buffer) => void): boolean; - /** - * Calls `ref()` on this `Http2Session`instance's underlying `net.Socket`. - * @since v9.4.0 - */ - ref(): void; - /** - * Sets the local endpoint's window size. - * The `windowSize` is the total window size to set, not - * the delta. - * - * ```js - * const http2 = require('http2'); - * - * const server = http2.createServer(); - * const expectedWindowSize = 2 ** 20; - * server.on('connect', (session) => { - * - * // Set local window size to be 2 ** 20 - * session.setLocalWindowSize(expectedWindowSize); - * }); - * ``` - * @since v15.3.0, v14.18.0 - */ - setLocalWindowSize(windowSize: number): void; - /** - * Used to set a callback function that is called when there is no activity on - * the `Http2Session` after `msecs` milliseconds. The given `callback` is - * registered as a listener on the `'timeout'` event. - * @since v8.4.0 - */ - setTimeout(msecs: number, callback?: () => void): void; - /** - * Updates the current local settings for this `Http2Session` and sends a new`SETTINGS` frame to the connected HTTP/2 peer. - * - * Once called, the `http2session.pendingSettingsAck` property will be `true`while the session is waiting for the remote peer to acknowledge the new - * settings. - * - * The new settings will not become effective until the `SETTINGS` acknowledgment - * is received and the `'localSettings'` event is emitted. It is possible to send - * multiple `SETTINGS` frames while acknowledgment is still pending. - * @since v8.4.0 - * @param callback Callback that is called once the session is connected or right away if the session is already connected. - */ - settings(settings: Settings, callback?: (err: Error | null, settings: Settings, duration: number) => void): void; - /** - * Calls `unref()` on this `Http2Session`instance's underlying `net.Socket`. - * @since v9.4.0 - */ - unref(): void; - addListener(event: 'close', listener: () => void): this; - addListener(event: 'error', listener: (err: Error) => void): this; - addListener(event: 'frameError', listener: (frameType: number, errorCode: number, streamID: number) => void): this; - addListener(event: 'goaway', listener: (errorCode: number, lastStreamID: number, opaqueData: Buffer) => void): this; - addListener(event: 'localSettings', listener: (settings: Settings) => void): this; - addListener(event: 'ping', listener: () => void): this; - addListener(event: 'remoteSettings', listener: (settings: Settings) => void): this; - addListener(event: 'timeout', listener: () => void): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - emit(event: 'close'): boolean; - emit(event: 'error', err: Error): boolean; - emit(event: 'frameError', frameType: number, errorCode: number, streamID: number): boolean; - emit(event: 'goaway', errorCode: number, lastStreamID: number, opaqueData: Buffer): boolean; - emit(event: 'localSettings', settings: Settings): boolean; - emit(event: 'ping'): boolean; - emit(event: 'remoteSettings', settings: Settings): boolean; - emit(event: 'timeout'): boolean; - emit(event: string | symbol, ...args: any[]): boolean; - on(event: 'close', listener: () => void): this; - on(event: 'error', listener: (err: Error) => void): this; - on(event: 'frameError', listener: (frameType: number, errorCode: number, streamID: number) => void): this; - on(event: 'goaway', listener: (errorCode: number, lastStreamID: number, opaqueData: Buffer) => void): this; - on(event: 'localSettings', listener: (settings: Settings) => void): this; - on(event: 'ping', listener: () => void): this; - on(event: 'remoteSettings', listener: (settings: Settings) => void): this; - on(event: 'timeout', listener: () => void): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once(event: 'close', listener: () => void): this; - once(event: 'error', listener: (err: Error) => void): this; - once(event: 'frameError', listener: (frameType: number, errorCode: number, streamID: number) => void): this; - once(event: 'goaway', listener: (errorCode: number, lastStreamID: number, opaqueData: Buffer) => void): this; - once(event: 'localSettings', listener: (settings: Settings) => void): this; - once(event: 'ping', listener: () => void): this; - once(event: 'remoteSettings', listener: (settings: Settings) => void): this; - once(event: 'timeout', listener: () => void): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener(event: 'close', listener: () => void): this; - prependListener(event: 'error', listener: (err: Error) => void): this; - prependListener(event: 'frameError', listener: (frameType: number, errorCode: number, streamID: number) => void): this; - prependListener(event: 'goaway', listener: (errorCode: number, lastStreamID: number, opaqueData: Buffer) => void): this; - prependListener(event: 'localSettings', listener: (settings: Settings) => void): this; - prependListener(event: 'ping', listener: () => void): this; - prependListener(event: 'remoteSettings', listener: (settings: Settings) => void): this; - prependListener(event: 'timeout', listener: () => void): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - prependOnceListener(event: 'close', listener: () => void): this; - prependOnceListener(event: 'error', listener: (err: Error) => void): this; - prependOnceListener(event: 'frameError', listener: (frameType: number, errorCode: number, streamID: number) => void): this; - prependOnceListener(event: 'goaway', listener: (errorCode: number, lastStreamID: number, opaqueData: Buffer) => void): this; - prependOnceListener(event: 'localSettings', listener: (settings: Settings) => void): this; - prependOnceListener(event: 'ping', listener: () => void): this; - prependOnceListener(event: 'remoteSettings', listener: (settings: Settings) => void): this; - prependOnceListener(event: 'timeout', listener: () => void): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - } - export interface ClientHttp2Session extends Http2Session { - /** - * For HTTP/2 Client `Http2Session` instances only, the `http2session.request()`creates and returns an `Http2Stream` instance that can be used to send an - * HTTP/2 request to the connected server. - * - * When a `ClientHttp2Session` is first created, the socket may not yet be - * connected. if `clienthttp2session.request()` is called during this time, the - * actual request will be deferred until the socket is ready to go. - * If the `session` is closed before the actual request be executed, an`ERR_HTTP2_GOAWAY_SESSION` is thrown. - * - * This method is only available if `http2session.type` is equal to`http2.constants.NGHTTP2_SESSION_CLIENT`. - * - * ```js - * const http2 = require('http2'); - * const clientSession = http2.connect('https://localhost:1234'); - * const { - * HTTP2_HEADER_PATH, - * HTTP2_HEADER_STATUS - * } = http2.constants; - * - * const req = clientSession.request({ [HTTP2_HEADER_PATH]: '/' }); - * req.on('response', (headers) => { - * console.log(headers[HTTP2_HEADER_STATUS]); - * req.on('data', (chunk) => { // .. }); - * req.on('end', () => { // .. }); - * }); - * ``` - * - * When the `options.waitForTrailers` option is set, the `'wantTrailers'` event - * is emitted immediately after queuing the last chunk of payload data to be sent. - * The `http2stream.sendTrailers()` method can then be called to send trailing - * headers to the peer. - * - * When `options.waitForTrailers` is set, the `Http2Stream` will not automatically - * close when the final `DATA` frame is transmitted. User code must call either`http2stream.sendTrailers()` or `http2stream.close()` to close the`Http2Stream`. - * - * When `options.signal` is set with an `AbortSignal` and then `abort` on the - * corresponding `AbortController` is called, the request will emit an `'error'`event with an `AbortError` error. - * - * The `:method` and `:path` pseudo-headers are not specified within `headers`, - * they respectively default to: - * - * * `:method` \= `'GET'` - * * `:path` \= `/` - * @since v8.4.0 - */ - request(headers?: OutgoingHttpHeaders, options?: ClientSessionRequestOptions): ClientHttp2Stream; - addListener(event: 'altsvc', listener: (alt: string, origin: string, stream: number) => void): this; - addListener(event: 'origin', listener: (origins: string[]) => void): this; - addListener(event: 'connect', listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this; - addListener(event: 'stream', listener: (stream: ClientHttp2Stream, headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - emit(event: 'altsvc', alt: string, origin: string, stream: number): boolean; - emit(event: 'origin', origins: ReadonlyArray): boolean; - emit(event: 'connect', session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket): boolean; - emit(event: 'stream', stream: ClientHttp2Stream, headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number): boolean; - emit(event: string | symbol, ...args: any[]): boolean; - on(event: 'altsvc', listener: (alt: string, origin: string, stream: number) => void): this; - on(event: 'origin', listener: (origins: string[]) => void): this; - on(event: 'connect', listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this; - on(event: 'stream', listener: (stream: ClientHttp2Stream, headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once(event: 'altsvc', listener: (alt: string, origin: string, stream: number) => void): this; - once(event: 'origin', listener: (origins: string[]) => void): this; - once(event: 'connect', listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this; - once(event: 'stream', listener: (stream: ClientHttp2Stream, headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener(event: 'altsvc', listener: (alt: string, origin: string, stream: number) => void): this; - prependListener(event: 'origin', listener: (origins: string[]) => void): this; - prependListener(event: 'connect', listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this; - prependListener(event: 'stream', listener: (stream: ClientHttp2Stream, headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - prependOnceListener(event: 'altsvc', listener: (alt: string, origin: string, stream: number) => void): this; - prependOnceListener(event: 'origin', listener: (origins: string[]) => void): this; - prependOnceListener(event: 'connect', listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this; - prependOnceListener(event: 'stream', listener: (stream: ClientHttp2Stream, headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - } - export interface AlternativeServiceOptions { - origin: number | string | url.URL; - } - export interface ServerHttp2Session extends Http2Session { - readonly server: Http2Server | Http2SecureServer; - /** - * Submits an `ALTSVC` frame (as defined by [RFC 7838](https://tools.ietf.org/html/rfc7838)) to the connected client. - * - * ```js - * const http2 = require('http2'); - * - * const server = http2.createServer(); - * server.on('session', (session) => { - * // Set altsvc for origin https://example.org:80 - * session.altsvc('h2=":8000"', 'https://example.org:80'); - * }); - * - * server.on('stream', (stream) => { - * // Set altsvc for a specific stream - * stream.session.altsvc('h2=":8000"', stream.id); - * }); - * ``` - * - * Sending an `ALTSVC` frame with a specific stream ID indicates that the alternate - * service is associated with the origin of the given `Http2Stream`. - * - * The `alt` and origin string _must_ contain only ASCII bytes and are - * strictly interpreted as a sequence of ASCII bytes. The special value `'clear'`may be passed to clear any previously set alternative service for a given - * domain. - * - * When a string is passed for the `originOrStream` argument, it will be parsed as - * a URL and the origin will be derived. For instance, the origin for the - * HTTP URL `'https://example.org/foo/bar'` is the ASCII string`'https://example.org'`. An error will be thrown if either the given string - * cannot be parsed as a URL or if a valid origin cannot be derived. - * - * A `URL` object, or any object with an `origin` property, may be passed as`originOrStream`, in which case the value of the `origin` property will be - * used. The value of the `origin` property _must_ be a properly serialized - * ASCII origin. - * @since v9.4.0 - * @param alt A description of the alternative service configuration as defined by `RFC 7838`. - * @param originOrStream Either a URL string specifying the origin (or an `Object` with an `origin` property) or the numeric identifier of an active `Http2Stream` as given by the - * `http2stream.id` property. - */ - altsvc(alt: string, originOrStream: number | string | url.URL | AlternativeServiceOptions): void; - /** - * Submits an `ORIGIN` frame (as defined by [RFC 8336](https://tools.ietf.org/html/rfc8336)) to the connected client - * to advertise the set of origins for which the server is capable of providing - * authoritative responses. - * - * ```js - * const http2 = require('http2'); - * const options = getSecureOptionsSomehow(); - * const server = http2.createSecureServer(options); - * server.on('stream', (stream) => { - * stream.respond(); - * stream.end('ok'); - * }); - * server.on('session', (session) => { - * session.origin('https://example.com', 'https://example.org'); - * }); - * ``` - * - * When a string is passed as an `origin`, it will be parsed as a URL and the - * origin will be derived. For instance, the origin for the HTTP URL`'https://example.org/foo/bar'` is the ASCII string`'https://example.org'`. An error will be thrown if either the given - * string - * cannot be parsed as a URL or if a valid origin cannot be derived. - * - * A `URL` object, or any object with an `origin` property, may be passed as - * an `origin`, in which case the value of the `origin` property will be - * used. The value of the `origin` property _must_ be a properly serialized - * ASCII origin. - * - * Alternatively, the `origins` option may be used when creating a new HTTP/2 - * server using the `http2.createSecureServer()` method: - * - * ```js - * const http2 = require('http2'); - * const options = getSecureOptionsSomehow(); - * options.origins = ['https://example.com', 'https://example.org']; - * const server = http2.createSecureServer(options); - * server.on('stream', (stream) => { - * stream.respond(); - * stream.end('ok'); - * }); - * ``` - * @since v10.12.0 - * @param origins One or more URL Strings passed as separate arguments. - */ - origin( - ...origins: Array< - | string - | url.URL - | { - origin: string; - } - > - ): void; - addListener(event: 'connect', listener: (session: ServerHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this; - addListener(event: 'stream', listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - emit(event: 'connect', session: ServerHttp2Session, socket: net.Socket | tls.TLSSocket): boolean; - emit(event: 'stream', stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number): boolean; - emit(event: string | symbol, ...args: any[]): boolean; - on(event: 'connect', listener: (session: ServerHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this; - on(event: 'stream', listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once(event: 'connect', listener: (session: ServerHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this; - once(event: 'stream', listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener(event: 'connect', listener: (session: ServerHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this; - prependListener(event: 'stream', listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - prependOnceListener(event: 'connect', listener: (session: ServerHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this; - prependOnceListener(event: 'stream', listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - } - // Http2Server - export interface SessionOptions { - maxDeflateDynamicTableSize?: number | undefined; - maxSessionMemory?: number | undefined; - maxHeaderListPairs?: number | undefined; - maxOutstandingPings?: number | undefined; - maxSendHeaderBlockLength?: number | undefined; - paddingStrategy?: number | undefined; - peerMaxConcurrentStreams?: number | undefined; - settings?: Settings | undefined; - /** - * Specifies a timeout in milliseconds that - * a server should wait when an [`'unknownProtocol'`][] is emitted. If the - * socket has not been destroyed by that time the server will destroy it. - * @default 100000 - */ - unknownProtocolTimeout?: number | undefined; - selectPadding?(frameLen: number, maxFrameLen: number): number; - createConnection?(authority: url.URL, option: SessionOptions): stream.Duplex; - } - export interface ClientSessionOptions extends SessionOptions { - maxReservedRemoteStreams?: number | undefined; - createConnection?: ((authority: url.URL, option: SessionOptions) => stream.Duplex) | undefined; - protocol?: 'http:' | 'https:' | undefined; - } - export interface ServerSessionOptions extends SessionOptions { - Http1IncomingMessage?: typeof IncomingMessage | undefined; - Http1ServerResponse?: typeof ServerResponse | undefined; - Http2ServerRequest?: typeof Http2ServerRequest | undefined; - Http2ServerResponse?: typeof Http2ServerResponse | undefined; - } - export interface SecureClientSessionOptions extends ClientSessionOptions, tls.ConnectionOptions {} - export interface SecureServerSessionOptions extends ServerSessionOptions, tls.TlsOptions {} - export interface ServerOptions extends ServerSessionOptions {} - export interface SecureServerOptions extends SecureServerSessionOptions { - allowHTTP1?: boolean | undefined; - origins?: string[] | undefined; - } - interface HTTP2ServerCommon { - setTimeout(msec?: number, callback?: () => void): this; - /** - * Throws ERR_HTTP2_INVALID_SETTING_VALUE for invalid settings values. - * Throws ERR_INVALID_ARG_TYPE for invalid settings argument. - */ - updateSettings(settings: Settings): void; - } - export interface Http2Server extends net.Server, HTTP2ServerCommon { - addListener(event: 'checkContinue', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; - addListener(event: 'request', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; - addListener(event: 'session', listener: (session: ServerHttp2Session) => void): this; - addListener(event: 'sessionError', listener: (err: Error) => void): this; - addListener(event: 'stream', listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; - addListener(event: 'timeout', listener: () => void): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - emit(event: 'checkContinue', request: Http2ServerRequest, response: Http2ServerResponse): boolean; - emit(event: 'request', request: Http2ServerRequest, response: Http2ServerResponse): boolean; - emit(event: 'session', session: ServerHttp2Session): boolean; - emit(event: 'sessionError', err: Error): boolean; - emit(event: 'stream', stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number): boolean; - emit(event: 'timeout'): boolean; - emit(event: string | symbol, ...args: any[]): boolean; - on(event: 'checkContinue', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; - on(event: 'request', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; - on(event: 'session', listener: (session: ServerHttp2Session) => void): this; - on(event: 'sessionError', listener: (err: Error) => void): this; - on(event: 'stream', listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; - on(event: 'timeout', listener: () => void): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once(event: 'checkContinue', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; - once(event: 'request', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; - once(event: 'session', listener: (session: ServerHttp2Session) => void): this; - once(event: 'sessionError', listener: (err: Error) => void): this; - once(event: 'stream', listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; - once(event: 'timeout', listener: () => void): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener(event: 'checkContinue', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; - prependListener(event: 'request', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; - prependListener(event: 'session', listener: (session: ServerHttp2Session) => void): this; - prependListener(event: 'sessionError', listener: (err: Error) => void): this; - prependListener(event: 'stream', listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; - prependListener(event: 'timeout', listener: () => void): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - prependOnceListener(event: 'checkContinue', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; - prependOnceListener(event: 'request', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; - prependOnceListener(event: 'session', listener: (session: ServerHttp2Session) => void): this; - prependOnceListener(event: 'sessionError', listener: (err: Error) => void): this; - prependOnceListener(event: 'stream', listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; - prependOnceListener(event: 'timeout', listener: () => void): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - } - export interface Http2SecureServer extends tls.Server, HTTP2ServerCommon { - addListener(event: 'checkContinue', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; - addListener(event: 'request', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; - addListener(event: 'session', listener: (session: ServerHttp2Session) => void): this; - addListener(event: 'sessionError', listener: (err: Error) => void): this; - addListener(event: 'stream', listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; - addListener(event: 'timeout', listener: () => void): this; - addListener(event: 'unknownProtocol', listener: (socket: tls.TLSSocket) => void): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - emit(event: 'checkContinue', request: Http2ServerRequest, response: Http2ServerResponse): boolean; - emit(event: 'request', request: Http2ServerRequest, response: Http2ServerResponse): boolean; - emit(event: 'session', session: ServerHttp2Session): boolean; - emit(event: 'sessionError', err: Error): boolean; - emit(event: 'stream', stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number): boolean; - emit(event: 'timeout'): boolean; - emit(event: 'unknownProtocol', socket: tls.TLSSocket): boolean; - emit(event: string | symbol, ...args: any[]): boolean; - on(event: 'checkContinue', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; - on(event: 'request', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; - on(event: 'session', listener: (session: ServerHttp2Session) => void): this; - on(event: 'sessionError', listener: (err: Error) => void): this; - on(event: 'stream', listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; - on(event: 'timeout', listener: () => void): this; - on(event: 'unknownProtocol', listener: (socket: tls.TLSSocket) => void): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once(event: 'checkContinue', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; - once(event: 'request', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; - once(event: 'session', listener: (session: ServerHttp2Session) => void): this; - once(event: 'sessionError', listener: (err: Error) => void): this; - once(event: 'stream', listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; - once(event: 'timeout', listener: () => void): this; - once(event: 'unknownProtocol', listener: (socket: tls.TLSSocket) => void): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener(event: 'checkContinue', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; - prependListener(event: 'request', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; - prependListener(event: 'session', listener: (session: ServerHttp2Session) => void): this; - prependListener(event: 'sessionError', listener: (err: Error) => void): this; - prependListener(event: 'stream', listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; - prependListener(event: 'timeout', listener: () => void): this; - prependListener(event: 'unknownProtocol', listener: (socket: tls.TLSSocket) => void): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - prependOnceListener(event: 'checkContinue', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; - prependOnceListener(event: 'request', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; - prependOnceListener(event: 'session', listener: (session: ServerHttp2Session) => void): this; - prependOnceListener(event: 'sessionError', listener: (err: Error) => void): this; - prependOnceListener(event: 'stream', listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; - prependOnceListener(event: 'timeout', listener: () => void): this; - prependOnceListener(event: 'unknownProtocol', listener: (socket: tls.TLSSocket) => void): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - } - /** - * A `Http2ServerRequest` object is created by {@link Server} or {@link SecureServer} and passed as the first argument to the `'request'` event. It may be used to access a request status, - * headers, and - * data. - * @since v8.4.0 - */ - export class Http2ServerRequest extends stream.Readable { - constructor(stream: ServerHttp2Stream, headers: IncomingHttpHeaders, options: stream.ReadableOptions, rawHeaders: ReadonlyArray); - /** - * The `request.aborted` property will be `true` if the request has - * been aborted. - * @since v10.1.0 - */ - readonly aborted: boolean; - /** - * The request authority pseudo header field. Because HTTP/2 allows requests - * to set either `:authority` or `host`, this value is derived from`req.headers[':authority']` if present. Otherwise, it is derived from`req.headers['host']`. - * @since v8.4.0 - */ - readonly authority: string; - /** - * See `request.socket`. - * @since v8.4.0 - * @deprecated Since v13.0.0 - Use `socket`. - */ - readonly connection: net.Socket | tls.TLSSocket; - /** - * The `request.complete` property will be `true` if the request has - * been completed, aborted, or destroyed. - * @since v12.10.0 - */ - readonly complete: boolean; - /** - * The request/response headers object. - * - * Key-value pairs of header names and values. Header names are lower-cased. - * - * ```js - * // Prints something like: - * // - * // { 'user-agent': 'curl/7.22.0', - * // host: '127.0.0.1:8000', - * // accept: '*' } - * console.log(request.headers); - * ``` - * - * See `HTTP/2 Headers Object`. - * - * In HTTP/2, the request path, host name, protocol, and method are represented as - * special headers prefixed with the `:` character (e.g. `':path'`). These special - * headers will be included in the `request.headers` object. Care must be taken not - * to inadvertently modify these special headers or errors may occur. For instance, - * removing all headers from the request will cause errors to occur: - * - * ```js - * removeAllHeaders(request.headers); - * assert(request.url); // Fails because the :path header has been removed - * ``` - * @since v8.4.0 - */ - readonly headers: IncomingHttpHeaders; - /** - * In case of server request, the HTTP version sent by the client. In the case of - * client response, the HTTP version of the connected-to server. Returns`'2.0'`. - * - * Also `message.httpVersionMajor` is the first integer and`message.httpVersionMinor` is the second. - * @since v8.4.0 - */ - readonly httpVersion: string; - readonly httpVersionMinor: number; - readonly httpVersionMajor: number; - /** - * The request method as a string. Read-only. Examples: `'GET'`, `'DELETE'`. - * @since v8.4.0 - */ - readonly method: string; - /** - * The raw request/response headers list exactly as they were received. - * - * The keys and values are in the same list. It is _not_ a - * list of tuples. So, the even-numbered offsets are key values, and the - * odd-numbered offsets are the associated values. - * - * Header names are not lowercased, and duplicates are not merged. - * - * ```js - * // Prints something like: - * // - * // [ 'user-agent', - * // 'this is invalid because there can be only one', - * // 'User-Agent', - * // 'curl/7.22.0', - * // 'Host', - * // '127.0.0.1:8000', - * // 'ACCEPT', - * // '*' ] - * console.log(request.rawHeaders); - * ``` - * @since v8.4.0 - */ - readonly rawHeaders: string[]; - /** - * The raw request/response trailer keys and values exactly as they were - * received. Only populated at the `'end'` event. - * @since v8.4.0 - */ - readonly rawTrailers: string[]; - /** - * The request scheme pseudo header field indicating the scheme - * portion of the target URL. - * @since v8.4.0 - */ - readonly scheme: string; - /** - * Returns a `Proxy` object that acts as a `net.Socket` (or `tls.TLSSocket`) but - * applies getters, setters, and methods based on HTTP/2 logic. - * - * `destroyed`, `readable`, and `writable` properties will be retrieved from and - * set on `request.stream`. - * - * `destroy`, `emit`, `end`, `on` and `once` methods will be called on`request.stream`. - * - * `setTimeout` method will be called on `request.stream.session`. - * - * `pause`, `read`, `resume`, and `write` will throw an error with code`ERR_HTTP2_NO_SOCKET_MANIPULATION`. See `Http2Session and Sockets` for - * more information. - * - * All other interactions will be routed directly to the socket. With TLS support, - * use `request.socket.getPeerCertificate()` to obtain the client's - * authentication details. - * @since v8.4.0 - */ - readonly socket: net.Socket | tls.TLSSocket; - /** - * The `Http2Stream` object backing the request. - * @since v8.4.0 - */ - readonly stream: ServerHttp2Stream; - /** - * The request/response trailers object. Only populated at the `'end'` event. - * @since v8.4.0 - */ - readonly trailers: IncomingHttpHeaders; - /** - * Request URL string. This contains only the URL that is present in the actual - * HTTP request. If the request is: - * - * ```http - * GET /status?name=ryan HTTP/1.1 - * Accept: text/plain - * ``` - * - * Then `request.url` will be: - * - * ```js - * '/status?name=ryan' - * ``` - * - * To parse the url into its parts, `new URL()` can be used: - * - * ```console - * $ node - * > new URL('/status?name=ryan', 'http://example.com') - * URL { - * href: 'http://example.com/status?name=ryan', - * origin: 'http://example.com', - * protocol: 'http:', - * username: '', - * password: '', - * host: 'example.com', - * hostname: 'example.com', - * port: '', - * pathname: '/status', - * search: '?name=ryan', - * searchParams: URLSearchParams { 'name' => 'ryan' }, - * hash: '' - * } - * ``` - * @since v8.4.0 - */ - url: string; - /** - * Sets the `Http2Stream`'s timeout value to `msecs`. If a callback is - * provided, then it is added as a listener on the `'timeout'` event on - * the response object. - * - * If no `'timeout'` listener is added to the request, the response, or - * the server, then `Http2Stream` s are destroyed when they time out. If a - * handler is assigned to the request, the response, or the server's `'timeout'`events, timed out sockets must be handled explicitly. - * @since v8.4.0 - */ - setTimeout(msecs: number, callback?: () => void): void; - read(size?: number): Buffer | string | null; - addListener(event: 'aborted', listener: (hadError: boolean, code: number) => void): this; - addListener(event: 'close', listener: () => void): this; - addListener(event: 'data', listener: (chunk: Buffer | string) => void): this; - addListener(event: 'end', listener: () => void): this; - addListener(event: 'readable', listener: () => void): this; - addListener(event: 'error', listener: (err: Error) => void): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - emit(event: 'aborted', hadError: boolean, code: number): boolean; - emit(event: 'close'): boolean; - emit(event: 'data', chunk: Buffer | string): boolean; - emit(event: 'end'): boolean; - emit(event: 'readable'): boolean; - emit(event: 'error', err: Error): boolean; - emit(event: string | symbol, ...args: any[]): boolean; - on(event: 'aborted', listener: (hadError: boolean, code: number) => void): this; - on(event: 'close', listener: () => void): this; - on(event: 'data', listener: (chunk: Buffer | string) => void): this; - on(event: 'end', listener: () => void): this; - on(event: 'readable', listener: () => void): this; - on(event: 'error', listener: (err: Error) => void): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once(event: 'aborted', listener: (hadError: boolean, code: number) => void): this; - once(event: 'close', listener: () => void): this; - once(event: 'data', listener: (chunk: Buffer | string) => void): this; - once(event: 'end', listener: () => void): this; - once(event: 'readable', listener: () => void): this; - once(event: 'error', listener: (err: Error) => void): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener(event: 'aborted', listener: (hadError: boolean, code: number) => void): this; - prependListener(event: 'close', listener: () => void): this; - prependListener(event: 'data', listener: (chunk: Buffer | string) => void): this; - prependListener(event: 'end', listener: () => void): this; - prependListener(event: 'readable', listener: () => void): this; - prependListener(event: 'error', listener: (err: Error) => void): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - prependOnceListener(event: 'aborted', listener: (hadError: boolean, code: number) => void): this; - prependOnceListener(event: 'close', listener: () => void): this; - prependOnceListener(event: 'data', listener: (chunk: Buffer | string) => void): this; - prependOnceListener(event: 'end', listener: () => void): this; - prependOnceListener(event: 'readable', listener: () => void): this; - prependOnceListener(event: 'error', listener: (err: Error) => void): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - } - /** - * This object is created internally by an HTTP server, not by the user. It is - * passed as the second parameter to the `'request'` event. - * @since v8.4.0 - */ - export class Http2ServerResponse extends stream.Writable { - constructor(stream: ServerHttp2Stream); - /** - * See `response.socket`. - * @since v8.4.0 - * @deprecated Since v13.0.0 - Use `socket`. - */ - readonly connection: net.Socket | tls.TLSSocket; - /** - * Boolean value that indicates whether the response has completed. Starts - * as `false`. After `response.end()` executes, the value will be `true`. - * @since v8.4.0 - * @deprecated Since v13.4.0,v12.16.0 - Use `writableEnded`. - */ - readonly finished: boolean; - /** - * True if headers were sent, false otherwise (read-only). - * @since v8.4.0 - */ - readonly headersSent: boolean; - /** - * A reference to the original HTTP2 request object. - * @since v15.7.0 - */ - readonly req: Http2ServerRequest; - /** - * Returns a `Proxy` object that acts as a `net.Socket` (or `tls.TLSSocket`) but - * applies getters, setters, and methods based on HTTP/2 logic. - * - * `destroyed`, `readable`, and `writable` properties will be retrieved from and - * set on `response.stream`. - * - * `destroy`, `emit`, `end`, `on` and `once` methods will be called on`response.stream`. - * - * `setTimeout` method will be called on `response.stream.session`. - * - * `pause`, `read`, `resume`, and `write` will throw an error with code`ERR_HTTP2_NO_SOCKET_MANIPULATION`. See `Http2Session and Sockets` for - * more information. - * - * All other interactions will be routed directly to the socket. - * - * ```js - * const http2 = require('http2'); - * const server = http2.createServer((req, res) => { - * const ip = req.socket.remoteAddress; - * const port = req.socket.remotePort; - * res.end(`Your IP address is ${ip} and your source port is ${port}.`); - * }).listen(3000); - * ``` - * @since v8.4.0 - */ - readonly socket: net.Socket | tls.TLSSocket; - /** - * The `Http2Stream` object backing the response. - * @since v8.4.0 - */ - readonly stream: ServerHttp2Stream; - /** - * When true, the Date header will be automatically generated and sent in - * the response if it is not already present in the headers. Defaults to true. - * - * This should only be disabled for testing; HTTP requires the Date header - * in responses. - * @since v8.4.0 - */ - sendDate: boolean; - /** - * When using implicit headers (not calling `response.writeHead()` explicitly), - * this property controls the status code that will be sent to the client when - * the headers get flushed. - * - * ```js - * response.statusCode = 404; - * ``` - * - * After response header was sent to the client, this property indicates the - * status code which was sent out. - * @since v8.4.0 - */ - statusCode: number; - /** - * Status message is not supported by HTTP/2 (RFC 7540 8.1.2.4). It returns - * an empty string. - * @since v8.4.0 - */ - statusMessage: ''; - /** - * This method adds HTTP trailing headers (a header but at the end of the - * message) to the response. - * - * Attempting to set a header field name or value that contains invalid characters - * will result in a `TypeError` being thrown. - * @since v8.4.0 - */ - addTrailers(trailers: OutgoingHttpHeaders): void; - /** - * This method signals to the server that all of the response headers and body - * have been sent; that server should consider this message complete. - * The method, `response.end()`, MUST be called on each response. - * - * If `data` is specified, it is equivalent to calling `response.write(data, encoding)` followed by `response.end(callback)`. - * - * If `callback` is specified, it will be called when the response stream - * is finished. - * @since v8.4.0 - */ - end(callback?: () => void): this; - end(data: string | Uint8Array, callback?: () => void): this; - end(data: string | Uint8Array, encoding: BufferEncoding, callback?: () => void): this; - /** - * Reads out a header that has already been queued but not sent to the client. - * The name is case-insensitive. - * - * ```js - * const contentType = response.getHeader('content-type'); - * ``` - * @since v8.4.0 - */ - getHeader(name: string): string; - /** - * Returns an array containing the unique names of the current outgoing headers. - * All header names are lowercase. - * - * ```js - * response.setHeader('Foo', 'bar'); - * response.setHeader('Set-Cookie', ['foo=bar', 'bar=baz']); - * - * const headerNames = response.getHeaderNames(); - * // headerNames === ['foo', 'set-cookie'] - * ``` - * @since v8.4.0 - */ - getHeaderNames(): string[]; - /** - * Returns a shallow copy of the current outgoing headers. Since a shallow copy - * is used, array values may be mutated without additional calls to various - * header-related http module methods. The keys of the returned object are the - * header names and the values are the respective header values. All header names - * are lowercase. - * - * The object returned by the `response.getHeaders()` method _does not_prototypically inherit from the JavaScript `Object`. This means that typical`Object` methods such as `obj.toString()`, - * `obj.hasOwnProperty()`, and others - * are not defined and _will not work_. - * - * ```js - * response.setHeader('Foo', 'bar'); - * response.setHeader('Set-Cookie', ['foo=bar', 'bar=baz']); - * - * const headers = response.getHeaders(); - * // headers === { foo: 'bar', 'set-cookie': ['foo=bar', 'bar=baz'] } - * ``` - * @since v8.4.0 - */ - getHeaders(): OutgoingHttpHeaders; - /** - * Returns `true` if the header identified by `name` is currently set in the - * outgoing headers. The header name matching is case-insensitive. - * - * ```js - * const hasContentType = response.hasHeader('content-type'); - * ``` - * @since v8.4.0 - */ - hasHeader(name: string): boolean; - /** - * Removes a header that has been queued for implicit sending. - * - * ```js - * response.removeHeader('Content-Encoding'); - * ``` - * @since v8.4.0 - */ - removeHeader(name: string): void; - /** - * Sets a single header value for implicit headers. If this header already exists - * in the to-be-sent headers, its value will be replaced. Use an array of strings - * here to send multiple headers with the same name. - * - * ```js - * response.setHeader('Content-Type', 'text/html; charset=utf-8'); - * ``` - * - * or - * - * ```js - * response.setHeader('Set-Cookie', ['type=ninja', 'language=javascript']); - * ``` - * - * Attempting to set a header field name or value that contains invalid characters - * will result in a `TypeError` being thrown. - * - * When headers have been set with `response.setHeader()`, they will be merged - * with any headers passed to `response.writeHead()`, with the headers passed - * to `response.writeHead()` given precedence. - * - * ```js - * // Returns content-type = text/plain - * const server = http2.createServer((req, res) => { - * res.setHeader('Content-Type', 'text/html; charset=utf-8'); - * res.setHeader('X-Foo', 'bar'); - * res.writeHead(200, { 'Content-Type': 'text/plain; charset=utf-8' }); - * res.end('ok'); - * }); - * ``` - * @since v8.4.0 - */ - setHeader(name: string, value: number | string | ReadonlyArray): void; - /** - * Sets the `Http2Stream`'s timeout value to `msecs`. If a callback is - * provided, then it is added as a listener on the `'timeout'` event on - * the response object. - * - * If no `'timeout'` listener is added to the request, the response, or - * the server, then `Http2Stream` s are destroyed when they time out. If a - * handler is assigned to the request, the response, or the server's `'timeout'`events, timed out sockets must be handled explicitly. - * @since v8.4.0 - */ - setTimeout(msecs: number, callback?: () => void): void; - /** - * If this method is called and `response.writeHead()` has not been called, - * it will switch to implicit header mode and flush the implicit headers. - * - * This sends a chunk of the response body. This method may - * be called multiple times to provide successive parts of the body. - * - * In the `http` module, the response body is omitted when the - * request is a HEAD request. Similarly, the `204` and `304` responses _must not_ include a message body. - * - * `chunk` can be a string or a buffer. If `chunk` is a string, - * the second parameter specifies how to encode it into a byte stream. - * By default the `encoding` is `'utf8'`. `callback` will be called when this chunk - * of data is flushed. - * - * This is the raw HTTP body and has nothing to do with higher-level multi-part - * body encodings that may be used. - * - * The first time `response.write()` is called, it will send the buffered - * header information and the first chunk of the body to the client. The second - * time `response.write()` is called, Node.js assumes data will be streamed, - * and sends the new data separately. That is, the response is buffered up to the - * first chunk of the body. - * - * Returns `true` if the entire data was flushed successfully to the kernel - * buffer. Returns `false` if all or part of the data was queued in user memory.`'drain'` will be emitted when the buffer is free again. - * @since v8.4.0 - */ - write(chunk: string | Uint8Array, callback?: (err: Error) => void): boolean; - write(chunk: string | Uint8Array, encoding: BufferEncoding, callback?: (err: Error) => void): boolean; - /** - * Sends a status `100 Continue` to the client, indicating that the request body - * should be sent. See the `'checkContinue'` event on `Http2Server` and`Http2SecureServer`. - * @since v8.4.0 - */ - writeContinue(): void; - /** - * Sends a status `103 Early Hints` to the client with a Link header, - * indicating that the user agent can preload/preconnect the linked resources. - * The `hints` is an object containing the values of headers to be sent with - * early hints message. - * - * Example: - * - * ```js - * const earlyHintsLink = '; rel=preload; as=style'; - * response.writeEarlyHints({ - * 'link': earlyHintsLink, - * }); - * - * const earlyHintsLinks = [ - * '; rel=preload; as=style', - * '; rel=preload; as=script', - * ]; - * response.writeEarlyHints({ - * 'link': earlyHintsLinks, - * 'x-trace-id': 'id for diagnostics' - * }); - * ``` - * - * @since v18.11.0 - * @param hints An object containing the values of headers - */ - writeEarlyHints(hints: Record): void; - /** - * Sends a response header to the request. The status code is a 3-digit HTTP - * status code, like `404`. The last argument, `headers`, are the response headers. - * - * Returns a reference to the `Http2ServerResponse`, so that calls can be chained. - * - * For compatibility with `HTTP/1`, a human-readable `statusMessage` may be - * passed as the second argument. However, because the `statusMessage` has no - * meaning within HTTP/2, the argument will have no effect and a process warning - * will be emitted. - * - * ```js - * const body = 'hello world'; - * response.writeHead(200, { - * 'Content-Length': Buffer.byteLength(body), - * 'Content-Type': 'text/plain; charset=utf-8', - * }); - * ``` - * - * `Content-Length` is given in bytes not characters. The`Buffer.byteLength()` API may be used to determine the number of bytes in a - * given encoding. On outbound messages, Node.js does not check if Content-Length - * and the length of the body being transmitted are equal or not. However, when - * receiving messages, Node.js will automatically reject messages when the`Content-Length` does not match the actual payload size. - * - * This method may be called at most one time on a message before `response.end()` is called. - * - * If `response.write()` or `response.end()` are called before calling - * this, the implicit/mutable headers will be calculated and call this function. - * - * When headers have been set with `response.setHeader()`, they will be merged - * with any headers passed to `response.writeHead()`, with the headers passed - * to `response.writeHead()` given precedence. - * - * ```js - * // Returns content-type = text/plain - * const server = http2.createServer((req, res) => { - * res.setHeader('Content-Type', 'text/html; charset=utf-8'); - * res.setHeader('X-Foo', 'bar'); - * res.writeHead(200, { 'Content-Type': 'text/plain; charset=utf-8' }); - * res.end('ok'); - * }); - * ``` - * - * Attempting to set a header field name or value that contains invalid characters - * will result in a `TypeError` being thrown. - * @since v8.4.0 - */ - writeHead(statusCode: number, headers?: OutgoingHttpHeaders): this; - writeHead(statusCode: number, statusMessage: string, headers?: OutgoingHttpHeaders): this; - /** - * Call `http2stream.pushStream()` with the given headers, and wrap the - * given `Http2Stream` on a newly created `Http2ServerResponse` as the callback - * parameter if successful. When `Http2ServerRequest` is closed, the callback is - * called with an error `ERR_HTTP2_INVALID_STREAM`. - * @since v8.4.0 - * @param headers An object describing the headers - * @param callback Called once `http2stream.pushStream()` is finished, or either when the attempt to create the pushed `Http2Stream` has failed or has been rejected, or the state of - * `Http2ServerRequest` is closed prior to calling the `http2stream.pushStream()` method - */ - createPushResponse(headers: OutgoingHttpHeaders, callback: (err: Error | null, res: Http2ServerResponse) => void): void; - addListener(event: 'close', listener: () => void): this; - addListener(event: 'drain', listener: () => void): this; - addListener(event: 'error', listener: (error: Error) => void): this; - addListener(event: 'finish', listener: () => void): this; - addListener(event: 'pipe', listener: (src: stream.Readable) => void): this; - addListener(event: 'unpipe', listener: (src: stream.Readable) => void): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - emit(event: 'close'): boolean; - emit(event: 'drain'): boolean; - emit(event: 'error', error: Error): boolean; - emit(event: 'finish'): boolean; - emit(event: 'pipe', src: stream.Readable): boolean; - emit(event: 'unpipe', src: stream.Readable): boolean; - emit(event: string | symbol, ...args: any[]): boolean; - on(event: 'close', listener: () => void): this; - on(event: 'drain', listener: () => void): this; - on(event: 'error', listener: (error: Error) => void): this; - on(event: 'finish', listener: () => void): this; - on(event: 'pipe', listener: (src: stream.Readable) => void): this; - on(event: 'unpipe', listener: (src: stream.Readable) => void): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once(event: 'close', listener: () => void): this; - once(event: 'drain', listener: () => void): this; - once(event: 'error', listener: (error: Error) => void): this; - once(event: 'finish', listener: () => void): this; - once(event: 'pipe', listener: (src: stream.Readable) => void): this; - once(event: 'unpipe', listener: (src: stream.Readable) => void): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener(event: 'close', listener: () => void): this; - prependListener(event: 'drain', listener: () => void): this; - prependListener(event: 'error', listener: (error: Error) => void): this; - prependListener(event: 'finish', listener: () => void): this; - prependListener(event: 'pipe', listener: (src: stream.Readable) => void): this; - prependListener(event: 'unpipe', listener: (src: stream.Readable) => void): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - prependOnceListener(event: 'close', listener: () => void): this; - prependOnceListener(event: 'drain', listener: () => void): this; - prependOnceListener(event: 'error', listener: (error: Error) => void): this; - prependOnceListener(event: 'finish', listener: () => void): this; - prependOnceListener(event: 'pipe', listener: (src: stream.Readable) => void): this; - prependOnceListener(event: 'unpipe', listener: (src: stream.Readable) => void): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - } - export namespace constants { - const NGHTTP2_SESSION_SERVER: number; - const NGHTTP2_SESSION_CLIENT: number; - const NGHTTP2_STREAM_STATE_IDLE: number; - const NGHTTP2_STREAM_STATE_OPEN: number; - const NGHTTP2_STREAM_STATE_RESERVED_LOCAL: number; - const NGHTTP2_STREAM_STATE_RESERVED_REMOTE: number; - const NGHTTP2_STREAM_STATE_HALF_CLOSED_LOCAL: number; - const NGHTTP2_STREAM_STATE_HALF_CLOSED_REMOTE: number; - const NGHTTP2_STREAM_STATE_CLOSED: number; - const NGHTTP2_NO_ERROR: number; - const NGHTTP2_PROTOCOL_ERROR: number; - const NGHTTP2_INTERNAL_ERROR: number; - const NGHTTP2_FLOW_CONTROL_ERROR: number; - const NGHTTP2_SETTINGS_TIMEOUT: number; - const NGHTTP2_STREAM_CLOSED: number; - const NGHTTP2_FRAME_SIZE_ERROR: number; - const NGHTTP2_REFUSED_STREAM: number; - const NGHTTP2_CANCEL: number; - const NGHTTP2_COMPRESSION_ERROR: number; - const NGHTTP2_CONNECT_ERROR: number; - const NGHTTP2_ENHANCE_YOUR_CALM: number; - const NGHTTP2_INADEQUATE_SECURITY: number; - const NGHTTP2_HTTP_1_1_REQUIRED: number; - const NGHTTP2_ERR_FRAME_SIZE_ERROR: number; - const NGHTTP2_FLAG_NONE: number; - const NGHTTP2_FLAG_END_STREAM: number; - const NGHTTP2_FLAG_END_HEADERS: number; - const NGHTTP2_FLAG_ACK: number; - const NGHTTP2_FLAG_PADDED: number; - const NGHTTP2_FLAG_PRIORITY: number; - const DEFAULT_SETTINGS_HEADER_TABLE_SIZE: number; - const DEFAULT_SETTINGS_ENABLE_PUSH: number; - const DEFAULT_SETTINGS_INITIAL_WINDOW_SIZE: number; - const DEFAULT_SETTINGS_MAX_FRAME_SIZE: number; - const MAX_MAX_FRAME_SIZE: number; - const MIN_MAX_FRAME_SIZE: number; - const MAX_INITIAL_WINDOW_SIZE: number; - const NGHTTP2_DEFAULT_WEIGHT: number; - const NGHTTP2_SETTINGS_HEADER_TABLE_SIZE: number; - const NGHTTP2_SETTINGS_ENABLE_PUSH: number; - const NGHTTP2_SETTINGS_MAX_CONCURRENT_STREAMS: number; - const NGHTTP2_SETTINGS_INITIAL_WINDOW_SIZE: number; - const NGHTTP2_SETTINGS_MAX_FRAME_SIZE: number; - const NGHTTP2_SETTINGS_MAX_HEADER_LIST_SIZE: number; - const PADDING_STRATEGY_NONE: number; - const PADDING_STRATEGY_MAX: number; - const PADDING_STRATEGY_CALLBACK: number; - const HTTP2_HEADER_STATUS: string; - const HTTP2_HEADER_METHOD: string; - const HTTP2_HEADER_AUTHORITY: string; - const HTTP2_HEADER_SCHEME: string; - const HTTP2_HEADER_PATH: string; - const HTTP2_HEADER_ACCEPT_CHARSET: string; - const HTTP2_HEADER_ACCEPT_ENCODING: string; - const HTTP2_HEADER_ACCEPT_LANGUAGE: string; - const HTTP2_HEADER_ACCEPT_RANGES: string; - const HTTP2_HEADER_ACCEPT: string; - const HTTP2_HEADER_ACCESS_CONTROL_ALLOW_ORIGIN: string; - const HTTP2_HEADER_AGE: string; - const HTTP2_HEADER_ALLOW: string; - const HTTP2_HEADER_AUTHORIZATION: string; - const HTTP2_HEADER_CACHE_CONTROL: string; - const HTTP2_HEADER_CONNECTION: string; - const HTTP2_HEADER_CONTENT_DISPOSITION: string; - const HTTP2_HEADER_CONTENT_ENCODING: string; - const HTTP2_HEADER_CONTENT_LANGUAGE: string; - const HTTP2_HEADER_CONTENT_LENGTH: string; - const HTTP2_HEADER_CONTENT_LOCATION: string; - const HTTP2_HEADER_CONTENT_MD5: string; - const HTTP2_HEADER_CONTENT_RANGE: string; - const HTTP2_HEADER_CONTENT_TYPE: string; - const HTTP2_HEADER_COOKIE: string; - const HTTP2_HEADER_DATE: string; - const HTTP2_HEADER_ETAG: string; - const HTTP2_HEADER_EXPECT: string; - const HTTP2_HEADER_EXPIRES: string; - const HTTP2_HEADER_FROM: string; - const HTTP2_HEADER_HOST: string; - const HTTP2_HEADER_IF_MATCH: string; - const HTTP2_HEADER_IF_MODIFIED_SINCE: string; - const HTTP2_HEADER_IF_NONE_MATCH: string; - const HTTP2_HEADER_IF_RANGE: string; - const HTTP2_HEADER_IF_UNMODIFIED_SINCE: string; - const HTTP2_HEADER_LAST_MODIFIED: string; - const HTTP2_HEADER_LINK: string; - const HTTP2_HEADER_LOCATION: string; - const HTTP2_HEADER_MAX_FORWARDS: string; - const HTTP2_HEADER_PREFER: string; - const HTTP2_HEADER_PROXY_AUTHENTICATE: string; - const HTTP2_HEADER_PROXY_AUTHORIZATION: string; - const HTTP2_HEADER_RANGE: string; - const HTTP2_HEADER_REFERER: string; - const HTTP2_HEADER_REFRESH: string; - const HTTP2_HEADER_RETRY_AFTER: string; - const HTTP2_HEADER_SERVER: string; - const HTTP2_HEADER_SET_COOKIE: string; - const HTTP2_HEADER_STRICT_TRANSPORT_SECURITY: string; - const HTTP2_HEADER_TRANSFER_ENCODING: string; - const HTTP2_HEADER_TE: string; - const HTTP2_HEADER_UPGRADE: string; - const HTTP2_HEADER_USER_AGENT: string; - const HTTP2_HEADER_VARY: string; - const HTTP2_HEADER_VIA: string; - const HTTP2_HEADER_WWW_AUTHENTICATE: string; - const HTTP2_HEADER_HTTP2_SETTINGS: string; - const HTTP2_HEADER_KEEP_ALIVE: string; - const HTTP2_HEADER_PROXY_CONNECTION: string; - const HTTP2_METHOD_ACL: string; - const HTTP2_METHOD_BASELINE_CONTROL: string; - const HTTP2_METHOD_BIND: string; - const HTTP2_METHOD_CHECKIN: string; - const HTTP2_METHOD_CHECKOUT: string; - const HTTP2_METHOD_CONNECT: string; - const HTTP2_METHOD_COPY: string; - const HTTP2_METHOD_DELETE: string; - const HTTP2_METHOD_GET: string; - const HTTP2_METHOD_HEAD: string; - const HTTP2_METHOD_LABEL: string; - const HTTP2_METHOD_LINK: string; - const HTTP2_METHOD_LOCK: string; - const HTTP2_METHOD_MERGE: string; - const HTTP2_METHOD_MKACTIVITY: string; - const HTTP2_METHOD_MKCALENDAR: string; - const HTTP2_METHOD_MKCOL: string; - const HTTP2_METHOD_MKREDIRECTREF: string; - const HTTP2_METHOD_MKWORKSPACE: string; - const HTTP2_METHOD_MOVE: string; - const HTTP2_METHOD_OPTIONS: string; - const HTTP2_METHOD_ORDERPATCH: string; - const HTTP2_METHOD_PATCH: string; - const HTTP2_METHOD_POST: string; - const HTTP2_METHOD_PRI: string; - const HTTP2_METHOD_PROPFIND: string; - const HTTP2_METHOD_PROPPATCH: string; - const HTTP2_METHOD_PUT: string; - const HTTP2_METHOD_REBIND: string; - const HTTP2_METHOD_REPORT: string; - const HTTP2_METHOD_SEARCH: string; - const HTTP2_METHOD_TRACE: string; - const HTTP2_METHOD_UNBIND: string; - const HTTP2_METHOD_UNCHECKOUT: string; - const HTTP2_METHOD_UNLINK: string; - const HTTP2_METHOD_UNLOCK: string; - const HTTP2_METHOD_UPDATE: string; - const HTTP2_METHOD_UPDATEREDIRECTREF: string; - const HTTP2_METHOD_VERSION_CONTROL: string; - const HTTP_STATUS_CONTINUE: number; - const HTTP_STATUS_SWITCHING_PROTOCOLS: number; - const HTTP_STATUS_PROCESSING: number; - const HTTP_STATUS_OK: number; - const HTTP_STATUS_CREATED: number; - const HTTP_STATUS_ACCEPTED: number; - const HTTP_STATUS_NON_AUTHORITATIVE_INFORMATION: number; - const HTTP_STATUS_NO_CONTENT: number; - const HTTP_STATUS_RESET_CONTENT: number; - const HTTP_STATUS_PARTIAL_CONTENT: number; - const HTTP_STATUS_MULTI_STATUS: number; - const HTTP_STATUS_ALREADY_REPORTED: number; - const HTTP_STATUS_IM_USED: number; - const HTTP_STATUS_MULTIPLE_CHOICES: number; - const HTTP_STATUS_MOVED_PERMANENTLY: number; - const HTTP_STATUS_FOUND: number; - const HTTP_STATUS_SEE_OTHER: number; - const HTTP_STATUS_NOT_MODIFIED: number; - const HTTP_STATUS_USE_PROXY: number; - const HTTP_STATUS_TEMPORARY_REDIRECT: number; - const HTTP_STATUS_PERMANENT_REDIRECT: number; - const HTTP_STATUS_BAD_REQUEST: number; - const HTTP_STATUS_UNAUTHORIZED: number; - const HTTP_STATUS_PAYMENT_REQUIRED: number; - const HTTP_STATUS_FORBIDDEN: number; - const HTTP_STATUS_NOT_FOUND: number; - const HTTP_STATUS_METHOD_NOT_ALLOWED: number; - const HTTP_STATUS_NOT_ACCEPTABLE: number; - const HTTP_STATUS_PROXY_AUTHENTICATION_REQUIRED: number; - const HTTP_STATUS_REQUEST_TIMEOUT: number; - const HTTP_STATUS_CONFLICT: number; - const HTTP_STATUS_GONE: number; - const HTTP_STATUS_LENGTH_REQUIRED: number; - const HTTP_STATUS_PRECONDITION_FAILED: number; - const HTTP_STATUS_PAYLOAD_TOO_LARGE: number; - const HTTP_STATUS_URI_TOO_LONG: number; - const HTTP_STATUS_UNSUPPORTED_MEDIA_TYPE: number; - const HTTP_STATUS_RANGE_NOT_SATISFIABLE: number; - const HTTP_STATUS_EXPECTATION_FAILED: number; - const HTTP_STATUS_TEAPOT: number; - const HTTP_STATUS_MISDIRECTED_REQUEST: number; - const HTTP_STATUS_UNPROCESSABLE_ENTITY: number; - const HTTP_STATUS_LOCKED: number; - const HTTP_STATUS_FAILED_DEPENDENCY: number; - const HTTP_STATUS_UNORDERED_COLLECTION: number; - const HTTP_STATUS_UPGRADE_REQUIRED: number; - const HTTP_STATUS_PRECONDITION_REQUIRED: number; - const HTTP_STATUS_TOO_MANY_REQUESTS: number; - const HTTP_STATUS_REQUEST_HEADER_FIELDS_TOO_LARGE: number; - const HTTP_STATUS_UNAVAILABLE_FOR_LEGAL_REASONS: number; - const HTTP_STATUS_INTERNAL_SERVER_ERROR: number; - const HTTP_STATUS_NOT_IMPLEMENTED: number; - const HTTP_STATUS_BAD_GATEWAY: number; - const HTTP_STATUS_SERVICE_UNAVAILABLE: number; - const HTTP_STATUS_GATEWAY_TIMEOUT: number; - const HTTP_STATUS_HTTP_VERSION_NOT_SUPPORTED: number; - const HTTP_STATUS_VARIANT_ALSO_NEGOTIATES: number; - const HTTP_STATUS_INSUFFICIENT_STORAGE: number; - const HTTP_STATUS_LOOP_DETECTED: number; - const HTTP_STATUS_BANDWIDTH_LIMIT_EXCEEDED: number; - const HTTP_STATUS_NOT_EXTENDED: number; - const HTTP_STATUS_NETWORK_AUTHENTICATION_REQUIRED: number; - } - /** - * This symbol can be set as a property on the HTTP/2 headers object with - * an array value in order to provide a list of headers considered sensitive. - */ - export const sensitiveHeaders: symbol; - /** - * Returns an object containing the default settings for an `Http2Session`instance. This method returns a new object instance every time it is called - * so instances returned may be safely modified for use. - * @since v8.4.0 - */ - export function getDefaultSettings(): Settings; - /** - * Returns a `Buffer` instance containing serialized representation of the given - * HTTP/2 settings as specified in the [HTTP/2](https://tools.ietf.org/html/rfc7540) specification. This is intended - * for use with the `HTTP2-Settings` header field. - * - * ```js - * const http2 = require('http2'); - * - * const packed = http2.getPackedSettings({ enablePush: false }); - * - * console.log(packed.toString('base64')); - * // Prints: AAIAAAAA - * ``` - * @since v8.4.0 - */ - export function getPackedSettings(settings: Settings): Buffer; - /** - * Returns a `HTTP/2 Settings Object` containing the deserialized settings from - * the given `Buffer` as generated by `http2.getPackedSettings()`. - * @since v8.4.0 - * @param buf The packed settings. - */ - export function getUnpackedSettings(buf: Uint8Array): Settings; - /** - * Returns a `net.Server` instance that creates and manages `Http2Session`instances. - * - * Since there are no browsers known that support [unencrypted HTTP/2](https://http2.github.io/faq/#does-http2-require-encryption), the use of {@link createSecureServer} is necessary when - * communicating - * with browser clients. - * - * ```js - * const http2 = require('http2'); - * - * // Create an unencrypted HTTP/2 server. - * // Since there are no browsers known that support - * // unencrypted HTTP/2, the use of `http2.createSecureServer()` - * // is necessary when communicating with browser clients. - * const server = http2.createServer(); - * - * server.on('stream', (stream, headers) => { - * stream.respond({ - * 'content-type': 'text/html; charset=utf-8', - * ':status': 200 - * }); - * stream.end('

Hello World

'); - * }); - * - * server.listen(80); - * ``` - * @since v8.4.0 - * @param onRequestHandler See `Compatibility API` - */ - export function createServer(onRequestHandler?: (request: Http2ServerRequest, response: Http2ServerResponse) => void): Http2Server; - export function createServer(options: ServerOptions, onRequestHandler?: (request: Http2ServerRequest, response: Http2ServerResponse) => void): Http2Server; - /** - * Returns a `tls.Server` instance that creates and manages `Http2Session`instances. - * - * ```js - * const http2 = require('http2'); - * const fs = require('fs'); - * - * const options = { - * key: fs.readFileSync('server-key.pem'), - * cert: fs.readFileSync('server-cert.pem') - * }; - * - * // Create a secure HTTP/2 server - * const server = http2.createSecureServer(options); - * - * server.on('stream', (stream, headers) => { - * stream.respond({ - * 'content-type': 'text/html; charset=utf-8', - * ':status': 200 - * }); - * stream.end('

Hello World

'); - * }); - * - * server.listen(80); - * ``` - * @since v8.4.0 - * @param onRequestHandler See `Compatibility API` - */ - export function createSecureServer(onRequestHandler?: (request: Http2ServerRequest, response: Http2ServerResponse) => void): Http2SecureServer; - export function createSecureServer(options: SecureServerOptions, onRequestHandler?: (request: Http2ServerRequest, response: Http2ServerResponse) => void): Http2SecureServer; - /** - * Returns a `ClientHttp2Session` instance. - * - * ```js - * const http2 = require('http2'); - * const client = http2.connect('https://localhost:1234'); - * - * // Use the client - * - * client.close(); - * ``` - * @since v8.4.0 - * @param authority The remote HTTP/2 server to connect to. This must be in the form of a minimal, valid URL with the `http://` or `https://` prefix, host name, and IP port (if a non-default port - * is used). Userinfo (user ID and password), path, querystring, and fragment details in the URL will be ignored. - * @param listener Will be registered as a one-time listener of the {@link 'connect'} event. - */ - export function connect(authority: string | url.URL, listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void): ClientHttp2Session; - export function connect( - authority: string | url.URL, - options?: ClientSessionOptions | SecureClientSessionOptions, - listener?: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void - ): ClientHttp2Session; -} -declare module 'node:http2' { - export * from 'http2'; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/https.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/https.d.ts deleted file mode 100755 index aae4a958..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/https.d.ts +++ /dev/null @@ -1,541 +0,0 @@ -/** - * HTTPS is the HTTP protocol over TLS/SSL. In Node.js this is implemented as a - * separate module. - * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/https.js) - */ -declare module 'https' { - import { Duplex } from 'node:stream'; - import * as tls from 'node:tls'; - import * as http from 'node:http'; - import { URL } from 'node:url'; - type ServerOptions< - Request extends typeof http.IncomingMessage = typeof http.IncomingMessage, - Response extends typeof http.ServerResponse = typeof http.ServerResponse, - > = tls.SecureContextOptions & tls.TlsOptions & http.ServerOptions; - type RequestOptions = http.RequestOptions & - tls.SecureContextOptions & { - rejectUnauthorized?: boolean | undefined; // Defaults to true - servername?: string | undefined; // SNI TLS Extension - }; - interface AgentOptions extends http.AgentOptions, tls.ConnectionOptions { - rejectUnauthorized?: boolean | undefined; - maxCachedSessions?: number | undefined; - } - /** - * An `Agent` object for HTTPS similar to `http.Agent`. See {@link request} for more information. - * @since v0.4.5 - */ - class Agent extends http.Agent { - constructor(options?: AgentOptions); - options: AgentOptions; - } - interface Server< - Request extends typeof http.IncomingMessage = typeof http.IncomingMessage, - Response extends typeof http.ServerResponse = typeof http.ServerResponse, - > extends http.Server {} - /** - * See `http.Server` for more information. - * @since v0.3.4 - */ - class Server< - Request extends typeof http.IncomingMessage = typeof http.IncomingMessage, - Response extends typeof http.ServerResponse = typeof http.ServerResponse, - > extends tls.Server { - constructor(requestListener?: http.RequestListener); - constructor( - options: ServerOptions, - requestListener?: http.RequestListener, - ); - /** - * Closes all connections connected to this server. - * @since v18.2.0 - */ - closeAllConnections(): void; - /** - * Closes all connections connected to this server which are not sending a request or waiting for a response. - * @since v18.2.0 - */ - closeIdleConnections(): void; - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: 'keylog', listener: (line: Buffer, tlsSocket: tls.TLSSocket) => void): this; - addListener( - event: 'newSession', - listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void, - ): this; - addListener( - event: 'OCSPRequest', - listener: ( - certificate: Buffer, - issuer: Buffer, - callback: (err: Error | null, resp: Buffer) => void, - ) => void, - ): this; - addListener( - event: 'resumeSession', - listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void, - ): this; - addListener(event: 'secureConnection', listener: (tlsSocket: tls.TLSSocket) => void): this; - addListener(event: 'tlsClientError', listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this; - addListener(event: 'close', listener: () => void): this; - addListener(event: 'connection', listener: (socket: Duplex) => void): this; - addListener(event: 'error', listener: (err: Error) => void): this; - addListener(event: 'listening', listener: () => void): this; - addListener(event: 'checkContinue', listener: http.RequestListener): this; - addListener(event: 'checkExpectation', listener: http.RequestListener): this; - addListener(event: 'clientError', listener: (err: Error, socket: Duplex) => void): this; - addListener( - event: 'connect', - listener: (req: InstanceType, socket: Duplex, head: Buffer) => void, - ): this; - addListener(event: 'request', listener: http.RequestListener): this; - addListener( - event: 'upgrade', - listener: (req: InstanceType, socket: Duplex, head: Buffer) => void, - ): this; - emit(event: string, ...args: any[]): boolean; - emit(event: 'keylog', line: Buffer, tlsSocket: tls.TLSSocket): boolean; - emit( - event: 'newSession', - sessionId: Buffer, - sessionData: Buffer, - callback: (err: Error, resp: Buffer) => void, - ): boolean; - emit( - event: 'OCSPRequest', - certificate: Buffer, - issuer: Buffer, - callback: (err: Error | null, resp: Buffer) => void, - ): boolean; - emit(event: 'resumeSession', sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void): boolean; - emit(event: 'secureConnection', tlsSocket: tls.TLSSocket): boolean; - emit(event: 'tlsClientError', err: Error, tlsSocket: tls.TLSSocket): boolean; - emit(event: 'close'): boolean; - emit(event: 'connection', socket: Duplex): boolean; - emit(event: 'error', err: Error): boolean; - emit(event: 'listening'): boolean; - emit( - event: 'checkContinue', - req: InstanceType, - res: InstanceType & { req: InstanceType }, - ): boolean; - emit( - event: 'checkExpectation', - req: InstanceType, - res: InstanceType & { req: InstanceType }, - ): boolean; - emit(event: 'clientError', err: Error, socket: Duplex): boolean; - emit(event: 'connect', req: InstanceType, socket: Duplex, head: Buffer): boolean; - emit( - event: 'request', - req: InstanceType, - res: InstanceType & { req: InstanceType }, - ): boolean; - emit(event: 'upgrade', req: InstanceType, socket: Duplex, head: Buffer): boolean; - on(event: string, listener: (...args: any[]) => void): this; - on(event: 'keylog', listener: (line: Buffer, tlsSocket: tls.TLSSocket) => void): this; - on( - event: 'newSession', - listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void, - ): this; - on( - event: 'OCSPRequest', - listener: ( - certificate: Buffer, - issuer: Buffer, - callback: (err: Error | null, resp: Buffer) => void, - ) => void, - ): this; - on( - event: 'resumeSession', - listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void, - ): this; - on(event: 'secureConnection', listener: (tlsSocket: tls.TLSSocket) => void): this; - on(event: 'tlsClientError', listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this; - on(event: 'close', listener: () => void): this; - on(event: 'connection', listener: (socket: Duplex) => void): this; - on(event: 'error', listener: (err: Error) => void): this; - on(event: 'listening', listener: () => void): this; - on(event: 'checkContinue', listener: http.RequestListener): this; - on(event: 'checkExpectation', listener: http.RequestListener): this; - on(event: 'clientError', listener: (err: Error, socket: Duplex) => void): this; - on(event: 'connect', listener: (req: InstanceType, socket: Duplex, head: Buffer) => void): this; - on(event: 'request', listener: http.RequestListener): this; - on(event: 'upgrade', listener: (req: InstanceType, socket: Duplex, head: Buffer) => void): this; - once(event: string, listener: (...args: any[]) => void): this; - once(event: 'keylog', listener: (line: Buffer, tlsSocket: tls.TLSSocket) => void): this; - once( - event: 'newSession', - listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void, - ): this; - once( - event: 'OCSPRequest', - listener: ( - certificate: Buffer, - issuer: Buffer, - callback: (err: Error | null, resp: Buffer) => void, - ) => void, - ): this; - once( - event: 'resumeSession', - listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void, - ): this; - once(event: 'secureConnection', listener: (tlsSocket: tls.TLSSocket) => void): this; - once(event: 'tlsClientError', listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this; - once(event: 'close', listener: () => void): this; - once(event: 'connection', listener: (socket: Duplex) => void): this; - once(event: 'error', listener: (err: Error) => void): this; - once(event: 'listening', listener: () => void): this; - once(event: 'checkContinue', listener: http.RequestListener): this; - once(event: 'checkExpectation', listener: http.RequestListener): this; - once(event: 'clientError', listener: (err: Error, socket: Duplex) => void): this; - once(event: 'connect', listener: (req: InstanceType, socket: Duplex, head: Buffer) => void): this; - once(event: 'request', listener: http.RequestListener): this; - once(event: 'upgrade', listener: (req: InstanceType, socket: Duplex, head: Buffer) => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: 'keylog', listener: (line: Buffer, tlsSocket: tls.TLSSocket) => void): this; - prependListener( - event: 'newSession', - listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void, - ): this; - prependListener( - event: 'OCSPRequest', - listener: ( - certificate: Buffer, - issuer: Buffer, - callback: (err: Error | null, resp: Buffer) => void, - ) => void, - ): this; - prependListener( - event: 'resumeSession', - listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void, - ): this; - prependListener(event: 'secureConnection', listener: (tlsSocket: tls.TLSSocket) => void): this; - prependListener(event: 'tlsClientError', listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this; - prependListener(event: 'close', listener: () => void): this; - prependListener(event: 'connection', listener: (socket: Duplex) => void): this; - prependListener(event: 'error', listener: (err: Error) => void): this; - prependListener(event: 'listening', listener: () => void): this; - prependListener(event: 'checkContinue', listener: http.RequestListener): this; - prependListener(event: 'checkExpectation', listener: http.RequestListener): this; - prependListener(event: 'clientError', listener: (err: Error, socket: Duplex) => void): this; - prependListener( - event: 'connect', - listener: (req: InstanceType, socket: Duplex, head: Buffer) => void, - ): this; - prependListener(event: 'request', listener: http.RequestListener): this; - prependListener( - event: 'upgrade', - listener: (req: InstanceType, socket: Duplex, head: Buffer) => void, - ): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: 'keylog', listener: (line: Buffer, tlsSocket: tls.TLSSocket) => void): this; - prependOnceListener( - event: 'newSession', - listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void, - ): this; - prependOnceListener( - event: 'OCSPRequest', - listener: ( - certificate: Buffer, - issuer: Buffer, - callback: (err: Error | null, resp: Buffer) => void, - ) => void, - ): this; - prependOnceListener( - event: 'resumeSession', - listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void, - ): this; - prependOnceListener(event: 'secureConnection', listener: (tlsSocket: tls.TLSSocket) => void): this; - prependOnceListener(event: 'tlsClientError', listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this; - prependOnceListener(event: 'close', listener: () => void): this; - prependOnceListener(event: 'connection', listener: (socket: Duplex) => void): this; - prependOnceListener(event: 'error', listener: (err: Error) => void): this; - prependOnceListener(event: 'listening', listener: () => void): this; - prependOnceListener(event: 'checkContinue', listener: http.RequestListener): this; - prependOnceListener(event: 'checkExpectation', listener: http.RequestListener): this; - prependOnceListener(event: 'clientError', listener: (err: Error, socket: Duplex) => void): this; - prependOnceListener( - event: 'connect', - listener: (req: InstanceType, socket: Duplex, head: Buffer) => void, - ): this; - prependOnceListener(event: 'request', listener: http.RequestListener): this; - prependOnceListener( - event: 'upgrade', - listener: (req: InstanceType, socket: Duplex, head: Buffer) => void, - ): this; - } - /** - * ```js - * // curl -k https://localhost:8000/ - * const https = require('https'); - * const fs = require('fs'); - * - * const options = { - * key: fs.readFileSync('test/fixtures/keys/agent2-key.pem'), - * cert: fs.readFileSync('test/fixtures/keys/agent2-cert.pem') - * }; - * - * https.createServer(options, (req, res) => { - * res.writeHead(200); - * res.end('hello world\n'); - * }).listen(8000); - * ``` - * - * Or - * - * ```js - * const https = require('https'); - * const fs = require('fs'); - * - * const options = { - * pfx: fs.readFileSync('test/fixtures/test_cert.pfx'), - * passphrase: 'sample' - * }; - * - * https.createServer(options, (req, res) => { - * res.writeHead(200); - * res.end('hello world\n'); - * }).listen(8000); - * ``` - * @since v0.3.4 - * @param options Accepts `options` from `createServer`, `createSecureContext` and `createServer`. - * @param requestListener A listener to be added to the `'request'` event. - */ - function createServer< - Request extends typeof http.IncomingMessage = typeof http.IncomingMessage, - Response extends typeof http.ServerResponse = typeof http.ServerResponse, - >(requestListener?: http.RequestListener): Server; - function createServer< - Request extends typeof http.IncomingMessage = typeof http.IncomingMessage, - Response extends typeof http.ServerResponse = typeof http.ServerResponse, - >( - options: ServerOptions, - requestListener?: http.RequestListener, - ): Server; - /** - * Makes a request to a secure web server. - * - * The following additional `options` from `tls.connect()` are also accepted:`ca`, `cert`, `ciphers`, `clientCertEngine`, `crl`, `dhparam`, `ecdhCurve`,`honorCipherOrder`, `key`, `passphrase`, - * `pfx`, `rejectUnauthorized`,`secureOptions`, `secureProtocol`, `servername`, `sessionIdContext`,`highWaterMark`. - * - * `options` can be an object, a string, or a `URL` object. If `options` is a - * string, it is automatically parsed with `new URL()`. If it is a `URL` object, it will be automatically converted to an ordinary `options` object. - * - * `https.request()` returns an instance of the `http.ClientRequest` class. The `ClientRequest` instance is a writable stream. If one needs to - * upload a file with a POST request, then write to the `ClientRequest` object. - * - * ```js - * const https = require('https'); - * - * const options = { - * hostname: 'encrypted.google.com', - * port: 443, - * path: '/', - * method: 'GET' - * }; - * - * const req = https.request(options, (res) => { - * console.log('statusCode:', res.statusCode); - * console.log('headers:', res.headers); - * - * res.on('data', (d) => { - * process.stdout.write(d); - * }); - * }); - * - * req.on('error', (e) => { - * console.error(e); - * }); - * req.end(); - * ``` - * - * Example using options from `tls.connect()`: - * - * ```js - * const options = { - * hostname: 'encrypted.google.com', - * port: 443, - * path: '/', - * method: 'GET', - * key: fs.readFileSync('test/fixtures/keys/agent2-key.pem'), - * cert: fs.readFileSync('test/fixtures/keys/agent2-cert.pem') - * }; - * options.agent = new https.Agent(options); - * - * const req = https.request(options, (res) => { - * // ... - * }); - * ``` - * - * Alternatively, opt out of connection pooling by not using an `Agent`. - * - * ```js - * const options = { - * hostname: 'encrypted.google.com', - * port: 443, - * path: '/', - * method: 'GET', - * key: fs.readFileSync('test/fixtures/keys/agent2-key.pem'), - * cert: fs.readFileSync('test/fixtures/keys/agent2-cert.pem'), - * agent: false - * }; - * - * const req = https.request(options, (res) => { - * // ... - * }); - * ``` - * - * Example using a `URL` as `options`: - * - * ```js - * const options = new URL('https://abc:xyz@example.com'); - * - * const req = https.request(options, (res) => { - * // ... - * }); - * ``` - * - * Example pinning on certificate fingerprint, or the public key (similar to`pin-sha256`): - * - * ```js - * const tls = require('tls'); - * const https = require('https'); - * const crypto = require('crypto'); - * - * function sha256(s) { - * return crypto.createHash('sha256').update(s).digest('base64'); - * } - * const options = { - * hostname: 'github.com', - * port: 443, - * path: '/', - * method: 'GET', - * checkServerIdentity: function(host, cert) { - * // Make sure the certificate is issued to the host we are connected to - * const err = tls.checkServerIdentity(host, cert); - * if (err) { - * return err; - * } - * - * // Pin the public key, similar to HPKP pin-sha25 pinning - * const pubkey256 = 'pL1+qb9HTMRZJmuC/bB/ZI9d302BYrrqiVuRyW+DGrU='; - * if (sha256(cert.pubkey) !== pubkey256) { - * const msg = 'Certificate verification error: ' + - * `The public key of '${cert.subject.CN}' ` + - * 'does not match our pinned fingerprint'; - * return new Error(msg); - * } - * - * // Pin the exact certificate, rather than the pub key - * const cert256 = '25:FE:39:32:D9:63:8C:8A:FC:A1:9A:29:87:' + - * 'D8:3E:4C:1D:98:DB:71:E4:1A:48:03:98:EA:22:6A:BD:8B:93:16'; - * if (cert.fingerprint256 !== cert256) { - * const msg = 'Certificate verification error: ' + - * `The certificate of '${cert.subject.CN}' ` + - * 'does not match our pinned fingerprint'; - * return new Error(msg); - * } - * - * // This loop is informational only. - * // Print the certificate and public key fingerprints of all certs in the - * // chain. Its common to pin the public key of the issuer on the public - * // internet, while pinning the public key of the service in sensitive - * // environments. - * do { - * console.log('Subject Common Name:', cert.subject.CN); - * console.log(' Certificate SHA256 fingerprint:', cert.fingerprint256); - * - * hash = crypto.createHash('sha256'); - * console.log(' Public key ping-sha256:', sha256(cert.pubkey)); - * - * lastprint256 = cert.fingerprint256; - * cert = cert.issuerCertificate; - * } while (cert.fingerprint256 !== lastprint256); - * - * }, - * }; - * - * options.agent = new https.Agent(options); - * const req = https.request(options, (res) => { - * console.log('All OK. Server matched our pinned cert or public key'); - * console.log('statusCode:', res.statusCode); - * // Print the HPKP values - * console.log('headers:', res.headers['public-key-pins']); - * - * res.on('data', (d) => {}); - * }); - * - * req.on('error', (e) => { - * console.error(e.message); - * }); - * req.end(); - * ``` - * - * Outputs for example: - * - * ```text - * Subject Common Name: github.com - * Certificate SHA256 fingerprint: 25:FE:39:32:D9:63:8C:8A:FC:A1:9A:29:87:D8:3E:4C:1D:98:DB:71:E4:1A:48:03:98:EA:22:6A:BD:8B:93:16 - * Public key ping-sha256: pL1+qb9HTMRZJmuC/bB/ZI9d302BYrrqiVuRyW+DGrU= - * Subject Common Name: DigiCert SHA2 Extended Validation Server CA - * Certificate SHA256 fingerprint: 40:3E:06:2A:26:53:05:91:13:28:5B:AF:80:A0:D4:AE:42:2C:84:8C:9F:78:FA:D0:1F:C9:4B:C5:B8:7F:EF:1A - * Public key ping-sha256: RRM1dGqnDFsCJXBTHky16vi1obOlCgFFn/yOhI/y+ho= - * Subject Common Name: DigiCert High Assurance EV Root CA - * Certificate SHA256 fingerprint: 74:31:E5:F4:C3:C1:CE:46:90:77:4F:0B:61:E0:54:40:88:3B:A9:A0:1E:D0:0B:A6:AB:D7:80:6E:D3:B1:18:CF - * Public key ping-sha256: WoiWRyIOVNa9ihaBciRSC7XHjliYS9VwUGOIud4PB18= - * All OK. Server matched our pinned cert or public key - * statusCode: 200 - * headers: max-age=0; pin-sha256="WoiWRyIOVNa9ihaBciRSC7XHjliYS9VwUGOIud4PB18="; pin-sha256="RRM1dGqnDFsCJXBTHky16vi1obOlCgFFn/yOhI/y+ho="; - * pin-sha256="k2v657xBsOVe1PQRwOsHsw3bsGT2VzIqz5K+59sNQws="; pin-sha256="K87oWBWM9UZfyddvDfoxL+8lpNyoUB2ptGtn0fv6G2Q="; pin-sha256="IQBnNBEiFuhj+8x6X8XLgh01V9Ic5/V3IRQLNFFc7v4="; - * pin-sha256="iie1VXtL7HzAMF+/PVPR9xzT80kQxdZeJ+zduCB3uj0="; pin-sha256="LvRiGEjRqfzurezaWuj8Wie2gyHMrW5Q06LspMnox7A="; includeSubDomains - * ``` - * @since v0.3.6 - * @param options Accepts all `options` from `request`, with some differences in default values: - */ - function request( - options: RequestOptions | string | URL, - callback?: (res: http.IncomingMessage) => void, - ): http.ClientRequest; - function request( - url: string | URL, - options: RequestOptions, - callback?: (res: http.IncomingMessage) => void, - ): http.ClientRequest; - /** - * Like `http.get()` but for HTTPS. - * - * `options` can be an object, a string, or a `URL` object. If `options` is a - * string, it is automatically parsed with `new URL()`. If it is a `URL` object, it will be automatically converted to an ordinary `options` object. - * - * ```js - * const https = require('https'); - * - * https.get('https://encrypted.google.com/', (res) => { - * console.log('statusCode:', res.statusCode); - * console.log('headers:', res.headers); - * - * res.on('data', (d) => { - * process.stdout.write(d); - * }); - * - * }).on('error', (e) => { - * console.error(e); - * }); - * ``` - * @since v0.3.6 - * @param options Accepts the same `options` as {@link request}, with the `method` always set to `GET`. - */ - function get( - options: RequestOptions | string | URL, - callback?: (res: http.IncomingMessage) => void, - ): http.ClientRequest; - function get( - url: string | URL, - options: RequestOptions, - callback?: (res: http.IncomingMessage) => void, - ): http.ClientRequest; - let globalAgent: Agent; -} -declare module 'node:https' { - export * from 'https'; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/index.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/index.d.ts deleted file mode 100755 index 4baa378b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/index.d.ts +++ /dev/null @@ -1,133 +0,0 @@ -// Type definitions for non-npm package Node.js 18.11 -// Project: https://nodejs.org/ -// Definitions by: Microsoft TypeScript -// DefinitelyTyped -// Alberto Schiabel -// Alvis HT Tang -// Andrew Makarov -// Benjamin Toueg -// Chigozirim C. -// David Junger -// Deividas Bakanas -// Eugene Y. Q. Shen -// Hannes Magnusson -// Huw -// Kelvin Jin -// Klaus Meinhardt -// Lishude -// Mariusz Wiktorczyk -// Mohsen Azimi -// Nicolas Even -// Nikita Galkin -// Parambir Singh -// Sebastian Silbermann -// Simon Schick -// Thomas den Hollander -// Wilco Bakker -// wwwy3y3 -// Samuel Ainsworth -// Kyle Uehlein -// Thanik Bhongbhibhat -// Marcin Kopacz -// Trivikram Kamat -// Junxiao Shi -// Ilia Baryshnikov -// ExE Boss -// Piotr Błażejewicz -// Anna Henningsen -// Victor Perin -// Yongsheng Zhang -// NodeJS Contributors -// Linus Unnebäck -// wafuwafu13 -// Matteo Collina -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/** - * License for programmatically and manually incorporated - * documentation aka. `JSDoc` from https://github.com/nodejs/node/tree/master/doc - * - * Copyright Node.js contributors. All rights reserved. - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to - * deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS - * IN THE SOFTWARE. - */ - -// NOTE: These definitions support NodeJS and TypeScript 4.9+. - -// Reference required types from the default lib: -/// -/// -/// -/// - -// Base definitions for all NodeJS modules that are not specific to any version of TypeScript: -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// - -/// diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/inspector.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/inspector.d.ts deleted file mode 100755 index eba0b55d..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/inspector.d.ts +++ /dev/null @@ -1,2741 +0,0 @@ -// eslint-disable-next-line dt-header -// Type definitions for inspector - -// These definitions are auto-generated. -// Please see https://github.com/DefinitelyTyped/DefinitelyTyped/pull/19330 -// for more information. - -// tslint:disable:max-line-length - -/** - * The `inspector` module provides an API for interacting with the V8 inspector. - * - * It can be accessed using: - * - * ```js - * const inspector = require('inspector'); - * ``` - * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/inspector.js) - */ -declare module 'inspector' { - import EventEmitter = require('node:events'); - interface InspectorNotification { - method: string; - params: T; - } - namespace Schema { - /** - * Description of the protocol domain. - */ - interface Domain { - /** - * Domain name. - */ - name: string; - /** - * Domain version. - */ - version: string; - } - interface GetDomainsReturnType { - /** - * List of supported domains. - */ - domains: Domain[]; - } - } - namespace Runtime { - /** - * Unique script identifier. - */ - type ScriptId = string; - /** - * Unique object identifier. - */ - type RemoteObjectId = string; - /** - * Primitive value which cannot be JSON-stringified. - */ - type UnserializableValue = string; - /** - * Mirror object referencing original JavaScript object. - */ - interface RemoteObject { - /** - * Object type. - */ - type: string; - /** - * Object subtype hint. Specified for object type values only. - */ - subtype?: string | undefined; - /** - * Object class (constructor) name. Specified for object type values only. - */ - className?: string | undefined; - /** - * Remote object value in case of primitive values or JSON values (if it was requested). - */ - value?: any; - /** - * Primitive value which can not be JSON-stringified does not have value, but gets this property. - */ - unserializableValue?: UnserializableValue | undefined; - /** - * String representation of the object. - */ - description?: string | undefined; - /** - * Unique object identifier (for non-primitive values). - */ - objectId?: RemoteObjectId | undefined; - /** - * Preview containing abbreviated property values. Specified for object type values only. - * @experimental - */ - preview?: ObjectPreview | undefined; - /** - * @experimental - */ - customPreview?: CustomPreview | undefined; - } - /** - * @experimental - */ - interface CustomPreview { - header: string; - hasBody: boolean; - formatterObjectId: RemoteObjectId; - bindRemoteObjectFunctionId: RemoteObjectId; - configObjectId?: RemoteObjectId | undefined; - } - /** - * Object containing abbreviated remote object value. - * @experimental - */ - interface ObjectPreview { - /** - * Object type. - */ - type: string; - /** - * Object subtype hint. Specified for object type values only. - */ - subtype?: string | undefined; - /** - * String representation of the object. - */ - description?: string | undefined; - /** - * True iff some of the properties or entries of the original object did not fit. - */ - overflow: boolean; - /** - * List of the properties. - */ - properties: PropertyPreview[]; - /** - * List of the entries. Specified for map and set subtype values only. - */ - entries?: EntryPreview[] | undefined; - } - /** - * @experimental - */ - interface PropertyPreview { - /** - * Property name. - */ - name: string; - /** - * Object type. Accessor means that the property itself is an accessor property. - */ - type: string; - /** - * User-friendly property value string. - */ - value?: string | undefined; - /** - * Nested value preview. - */ - valuePreview?: ObjectPreview | undefined; - /** - * Object subtype hint. Specified for object type values only. - */ - subtype?: string | undefined; - } - /** - * @experimental - */ - interface EntryPreview { - /** - * Preview of the key. Specified for map-like collection entries. - */ - key?: ObjectPreview | undefined; - /** - * Preview of the value. - */ - value: ObjectPreview; - } - /** - * Object property descriptor. - */ - interface PropertyDescriptor { - /** - * Property name or symbol description. - */ - name: string; - /** - * The value associated with the property. - */ - value?: RemoteObject | undefined; - /** - * True if the value associated with the property may be changed (data descriptors only). - */ - writable?: boolean | undefined; - /** - * A function which serves as a getter for the property, or undefined if there is no getter (accessor descriptors only). - */ - get?: RemoteObject | undefined; - /** - * A function which serves as a setter for the property, or undefined if there is no setter (accessor descriptors only). - */ - set?: RemoteObject | undefined; - /** - * True if the type of this property descriptor may be changed and if the property may be deleted from the corresponding object. - */ - configurable: boolean; - /** - * True if this property shows up during enumeration of the properties on the corresponding object. - */ - enumerable: boolean; - /** - * True if the result was thrown during the evaluation. - */ - wasThrown?: boolean | undefined; - /** - * True if the property is owned for the object. - */ - isOwn?: boolean | undefined; - /** - * Property symbol object, if the property is of the symbol type. - */ - symbol?: RemoteObject | undefined; - } - /** - * Object internal property descriptor. This property isn't normally visible in JavaScript code. - */ - interface InternalPropertyDescriptor { - /** - * Conventional property name. - */ - name: string; - /** - * The value associated with the property. - */ - value?: RemoteObject | undefined; - } - /** - * Represents function call argument. Either remote object id objectId, primitive value, unserializable primitive value or neither of (for undefined) them should be specified. - */ - interface CallArgument { - /** - * Primitive value or serializable javascript object. - */ - value?: any; - /** - * Primitive value which can not be JSON-stringified. - */ - unserializableValue?: UnserializableValue | undefined; - /** - * Remote object handle. - */ - objectId?: RemoteObjectId | undefined; - } - /** - * Id of an execution context. - */ - type ExecutionContextId = number; - /** - * Description of an isolated world. - */ - interface ExecutionContextDescription { - /** - * Unique id of the execution context. It can be used to specify in which execution context script evaluation should be performed. - */ - id: ExecutionContextId; - /** - * Execution context origin. - */ - origin: string; - /** - * Human readable name describing given context. - */ - name: string; - /** - * Embedder-specific auxiliary data. - */ - auxData?: {} | undefined; - } - /** - * Detailed information about exception (or error) that was thrown during script compilation or execution. - */ - interface ExceptionDetails { - /** - * Exception id. - */ - exceptionId: number; - /** - * Exception text, which should be used together with exception object when available. - */ - text: string; - /** - * Line number of the exception location (0-based). - */ - lineNumber: number; - /** - * Column number of the exception location (0-based). - */ - columnNumber: number; - /** - * Script ID of the exception location. - */ - scriptId?: ScriptId | undefined; - /** - * URL of the exception location, to be used when the script was not reported. - */ - url?: string | undefined; - /** - * JavaScript stack trace if available. - */ - stackTrace?: StackTrace | undefined; - /** - * Exception object if available. - */ - exception?: RemoteObject | undefined; - /** - * Identifier of the context where exception happened. - */ - executionContextId?: ExecutionContextId | undefined; - } - /** - * Number of milliseconds since epoch. - */ - type Timestamp = number; - /** - * Stack entry for runtime errors and assertions. - */ - interface CallFrame { - /** - * JavaScript function name. - */ - functionName: string; - /** - * JavaScript script id. - */ - scriptId: ScriptId; - /** - * JavaScript script name or url. - */ - url: string; - /** - * JavaScript script line number (0-based). - */ - lineNumber: number; - /** - * JavaScript script column number (0-based). - */ - columnNumber: number; - } - /** - * Call frames for assertions or error messages. - */ - interface StackTrace { - /** - * String label of this stack trace. For async traces this may be a name of the function that initiated the async call. - */ - description?: string | undefined; - /** - * JavaScript function name. - */ - callFrames: CallFrame[]; - /** - * Asynchronous JavaScript stack trace that preceded this stack, if available. - */ - parent?: StackTrace | undefined; - /** - * Asynchronous JavaScript stack trace that preceded this stack, if available. - * @experimental - */ - parentId?: StackTraceId | undefined; - } - /** - * Unique identifier of current debugger. - * @experimental - */ - type UniqueDebuggerId = string; - /** - * If debuggerId is set stack trace comes from another debugger and can be resolved there. This allows to track cross-debugger calls. See Runtime.StackTrace and Debugger.paused for usages. - * @experimental - */ - interface StackTraceId { - id: string; - debuggerId?: UniqueDebuggerId | undefined; - } - interface EvaluateParameterType { - /** - * Expression to evaluate. - */ - expression: string; - /** - * Symbolic group name that can be used to release multiple objects. - */ - objectGroup?: string | undefined; - /** - * Determines whether Command Line API should be available during the evaluation. - */ - includeCommandLineAPI?: boolean | undefined; - /** - * In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides setPauseOnException state. - */ - silent?: boolean | undefined; - /** - * Specifies in which execution context to perform evaluation. If the parameter is omitted the evaluation will be performed in the context of the inspected page. - */ - contextId?: ExecutionContextId | undefined; - /** - * Whether the result is expected to be a JSON object that should be sent by value. - */ - returnByValue?: boolean | undefined; - /** - * Whether preview should be generated for the result. - * @experimental - */ - generatePreview?: boolean | undefined; - /** - * Whether execution should be treated as initiated by user in the UI. - */ - userGesture?: boolean | undefined; - /** - * Whether execution should await for resulting value and return once awaited promise is resolved. - */ - awaitPromise?: boolean | undefined; - } - interface AwaitPromiseParameterType { - /** - * Identifier of the promise. - */ - promiseObjectId: RemoteObjectId; - /** - * Whether the result is expected to be a JSON object that should be sent by value. - */ - returnByValue?: boolean | undefined; - /** - * Whether preview should be generated for the result. - */ - generatePreview?: boolean | undefined; - } - interface CallFunctionOnParameterType { - /** - * Declaration of the function to call. - */ - functionDeclaration: string; - /** - * Identifier of the object to call function on. Either objectId or executionContextId should be specified. - */ - objectId?: RemoteObjectId | undefined; - /** - * Call arguments. All call arguments must belong to the same JavaScript world as the target object. - */ - arguments?: CallArgument[] | undefined; - /** - * In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides setPauseOnException state. - */ - silent?: boolean | undefined; - /** - * Whether the result is expected to be a JSON object which should be sent by value. - */ - returnByValue?: boolean | undefined; - /** - * Whether preview should be generated for the result. - * @experimental - */ - generatePreview?: boolean | undefined; - /** - * Whether execution should be treated as initiated by user in the UI. - */ - userGesture?: boolean | undefined; - /** - * Whether execution should await for resulting value and return once awaited promise is resolved. - */ - awaitPromise?: boolean | undefined; - /** - * Specifies execution context which global object will be used to call function on. Either executionContextId or objectId should be specified. - */ - executionContextId?: ExecutionContextId | undefined; - /** - * Symbolic group name that can be used to release multiple objects. If objectGroup is not specified and objectId is, objectGroup will be inherited from object. - */ - objectGroup?: string | undefined; - } - interface GetPropertiesParameterType { - /** - * Identifier of the object to return properties for. - */ - objectId: RemoteObjectId; - /** - * If true, returns properties belonging only to the element itself, not to its prototype chain. - */ - ownProperties?: boolean | undefined; - /** - * If true, returns accessor properties (with getter/setter) only; internal properties are not returned either. - * @experimental - */ - accessorPropertiesOnly?: boolean | undefined; - /** - * Whether preview should be generated for the results. - * @experimental - */ - generatePreview?: boolean | undefined; - } - interface ReleaseObjectParameterType { - /** - * Identifier of the object to release. - */ - objectId: RemoteObjectId; - } - interface ReleaseObjectGroupParameterType { - /** - * Symbolic object group name. - */ - objectGroup: string; - } - interface SetCustomObjectFormatterEnabledParameterType { - enabled: boolean; - } - interface CompileScriptParameterType { - /** - * Expression to compile. - */ - expression: string; - /** - * Source url to be set for the script. - */ - sourceURL: string; - /** - * Specifies whether the compiled script should be persisted. - */ - persistScript: boolean; - /** - * Specifies in which execution context to perform script run. If the parameter is omitted the evaluation will be performed in the context of the inspected page. - */ - executionContextId?: ExecutionContextId | undefined; - } - interface RunScriptParameterType { - /** - * Id of the script to run. - */ - scriptId: ScriptId; - /** - * Specifies in which execution context to perform script run. If the parameter is omitted the evaluation will be performed in the context of the inspected page. - */ - executionContextId?: ExecutionContextId | undefined; - /** - * Symbolic group name that can be used to release multiple objects. - */ - objectGroup?: string | undefined; - /** - * In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides setPauseOnException state. - */ - silent?: boolean | undefined; - /** - * Determines whether Command Line API should be available during the evaluation. - */ - includeCommandLineAPI?: boolean | undefined; - /** - * Whether the result is expected to be a JSON object which should be sent by value. - */ - returnByValue?: boolean | undefined; - /** - * Whether preview should be generated for the result. - */ - generatePreview?: boolean | undefined; - /** - * Whether execution should await for resulting value and return once awaited promise is resolved. - */ - awaitPromise?: boolean | undefined; - } - interface QueryObjectsParameterType { - /** - * Identifier of the prototype to return objects for. - */ - prototypeObjectId: RemoteObjectId; - } - interface GlobalLexicalScopeNamesParameterType { - /** - * Specifies in which execution context to lookup global scope variables. - */ - executionContextId?: ExecutionContextId | undefined; - } - interface EvaluateReturnType { - /** - * Evaluation result. - */ - result: RemoteObject; - /** - * Exception details. - */ - exceptionDetails?: ExceptionDetails | undefined; - } - interface AwaitPromiseReturnType { - /** - * Promise result. Will contain rejected value if promise was rejected. - */ - result: RemoteObject; - /** - * Exception details if stack strace is available. - */ - exceptionDetails?: ExceptionDetails | undefined; - } - interface CallFunctionOnReturnType { - /** - * Call result. - */ - result: RemoteObject; - /** - * Exception details. - */ - exceptionDetails?: ExceptionDetails | undefined; - } - interface GetPropertiesReturnType { - /** - * Object properties. - */ - result: PropertyDescriptor[]; - /** - * Internal object properties (only of the element itself). - */ - internalProperties?: InternalPropertyDescriptor[] | undefined; - /** - * Exception details. - */ - exceptionDetails?: ExceptionDetails | undefined; - } - interface CompileScriptReturnType { - /** - * Id of the script. - */ - scriptId?: ScriptId | undefined; - /** - * Exception details. - */ - exceptionDetails?: ExceptionDetails | undefined; - } - interface RunScriptReturnType { - /** - * Run result. - */ - result: RemoteObject; - /** - * Exception details. - */ - exceptionDetails?: ExceptionDetails | undefined; - } - interface QueryObjectsReturnType { - /** - * Array with objects. - */ - objects: RemoteObject; - } - interface GlobalLexicalScopeNamesReturnType { - names: string[]; - } - interface ExecutionContextCreatedEventDataType { - /** - * A newly created execution context. - */ - context: ExecutionContextDescription; - } - interface ExecutionContextDestroyedEventDataType { - /** - * Id of the destroyed context - */ - executionContextId: ExecutionContextId; - } - interface ExceptionThrownEventDataType { - /** - * Timestamp of the exception. - */ - timestamp: Timestamp; - exceptionDetails: ExceptionDetails; - } - interface ExceptionRevokedEventDataType { - /** - * Reason describing why exception was revoked. - */ - reason: string; - /** - * The id of revoked exception, as reported in exceptionThrown. - */ - exceptionId: number; - } - interface ConsoleAPICalledEventDataType { - /** - * Type of the call. - */ - type: string; - /** - * Call arguments. - */ - args: RemoteObject[]; - /** - * Identifier of the context where the call was made. - */ - executionContextId: ExecutionContextId; - /** - * Call timestamp. - */ - timestamp: Timestamp; - /** - * Stack trace captured when the call was made. - */ - stackTrace?: StackTrace | undefined; - /** - * Console context descriptor for calls on non-default console context (not console.*): 'anonymous#unique-logger-id' for call on unnamed context, 'name#unique-logger-id' for call on named context. - * @experimental - */ - context?: string | undefined; - } - interface InspectRequestedEventDataType { - object: RemoteObject; - hints: {}; - } - } - namespace Debugger { - /** - * Breakpoint identifier. - */ - type BreakpointId = string; - /** - * Call frame identifier. - */ - type CallFrameId = string; - /** - * Location in the source code. - */ - interface Location { - /** - * Script identifier as reported in the Debugger.scriptParsed. - */ - scriptId: Runtime.ScriptId; - /** - * Line number in the script (0-based). - */ - lineNumber: number; - /** - * Column number in the script (0-based). - */ - columnNumber?: number | undefined; - } - /** - * Location in the source code. - * @experimental - */ - interface ScriptPosition { - lineNumber: number; - columnNumber: number; - } - /** - * JavaScript call frame. Array of call frames form the call stack. - */ - interface CallFrame { - /** - * Call frame identifier. This identifier is only valid while the virtual machine is paused. - */ - callFrameId: CallFrameId; - /** - * Name of the JavaScript function called on this call frame. - */ - functionName: string; - /** - * Location in the source code. - */ - functionLocation?: Location | undefined; - /** - * Location in the source code. - */ - location: Location; - /** - * JavaScript script name or url. - */ - url: string; - /** - * Scope chain for this call frame. - */ - scopeChain: Scope[]; - /** - * this object for this call frame. - */ - this: Runtime.RemoteObject; - /** - * The value being returned, if the function is at return point. - */ - returnValue?: Runtime.RemoteObject | undefined; - } - /** - * Scope description. - */ - interface Scope { - /** - * Scope type. - */ - type: string; - /** - * Object representing the scope. For global and with scopes it represents the actual object; for the rest of the scopes, it is artificial transient object enumerating scope variables as its properties. - */ - object: Runtime.RemoteObject; - name?: string | undefined; - /** - * Location in the source code where scope starts - */ - startLocation?: Location | undefined; - /** - * Location in the source code where scope ends - */ - endLocation?: Location | undefined; - } - /** - * Search match for resource. - */ - interface SearchMatch { - /** - * Line number in resource content. - */ - lineNumber: number; - /** - * Line with match content. - */ - lineContent: string; - } - interface BreakLocation { - /** - * Script identifier as reported in the Debugger.scriptParsed. - */ - scriptId: Runtime.ScriptId; - /** - * Line number in the script (0-based). - */ - lineNumber: number; - /** - * Column number in the script (0-based). - */ - columnNumber?: number | undefined; - type?: string | undefined; - } - interface SetBreakpointsActiveParameterType { - /** - * New value for breakpoints active state. - */ - active: boolean; - } - interface SetSkipAllPausesParameterType { - /** - * New value for skip pauses state. - */ - skip: boolean; - } - interface SetBreakpointByUrlParameterType { - /** - * Line number to set breakpoint at. - */ - lineNumber: number; - /** - * URL of the resources to set breakpoint on. - */ - url?: string | undefined; - /** - * Regex pattern for the URLs of the resources to set breakpoints on. Either url or urlRegex must be specified. - */ - urlRegex?: string | undefined; - /** - * Script hash of the resources to set breakpoint on. - */ - scriptHash?: string | undefined; - /** - * Offset in the line to set breakpoint at. - */ - columnNumber?: number | undefined; - /** - * Expression to use as a breakpoint condition. When specified, debugger will only stop on the breakpoint if this expression evaluates to true. - */ - condition?: string | undefined; - } - interface SetBreakpointParameterType { - /** - * Location to set breakpoint in. - */ - location: Location; - /** - * Expression to use as a breakpoint condition. When specified, debugger will only stop on the breakpoint if this expression evaluates to true. - */ - condition?: string | undefined; - } - interface RemoveBreakpointParameterType { - breakpointId: BreakpointId; - } - interface GetPossibleBreakpointsParameterType { - /** - * Start of range to search possible breakpoint locations in. - */ - start: Location; - /** - * End of range to search possible breakpoint locations in (excluding). When not specified, end of scripts is used as end of range. - */ - end?: Location | undefined; - /** - * Only consider locations which are in the same (non-nested) function as start. - */ - restrictToFunction?: boolean | undefined; - } - interface ContinueToLocationParameterType { - /** - * Location to continue to. - */ - location: Location; - targetCallFrames?: string | undefined; - } - interface PauseOnAsyncCallParameterType { - /** - * Debugger will pause when async call with given stack trace is started. - */ - parentStackTraceId: Runtime.StackTraceId; - } - interface StepIntoParameterType { - /** - * Debugger will issue additional Debugger.paused notification if any async task is scheduled before next pause. - * @experimental - */ - breakOnAsyncCall?: boolean | undefined; - } - interface GetStackTraceParameterType { - stackTraceId: Runtime.StackTraceId; - } - interface SearchInContentParameterType { - /** - * Id of the script to search in. - */ - scriptId: Runtime.ScriptId; - /** - * String to search for. - */ - query: string; - /** - * If true, search is case sensitive. - */ - caseSensitive?: boolean | undefined; - /** - * If true, treats string parameter as regex. - */ - isRegex?: boolean | undefined; - } - interface SetScriptSourceParameterType { - /** - * Id of the script to edit. - */ - scriptId: Runtime.ScriptId; - /** - * New content of the script. - */ - scriptSource: string; - /** - * If true the change will not actually be applied. Dry run may be used to get result description without actually modifying the code. - */ - dryRun?: boolean | undefined; - } - interface RestartFrameParameterType { - /** - * Call frame identifier to evaluate on. - */ - callFrameId: CallFrameId; - } - interface GetScriptSourceParameterType { - /** - * Id of the script to get source for. - */ - scriptId: Runtime.ScriptId; - } - interface SetPauseOnExceptionsParameterType { - /** - * Pause on exceptions mode. - */ - state: string; - } - interface EvaluateOnCallFrameParameterType { - /** - * Call frame identifier to evaluate on. - */ - callFrameId: CallFrameId; - /** - * Expression to evaluate. - */ - expression: string; - /** - * String object group name to put result into (allows rapid releasing resulting object handles using releaseObjectGroup). - */ - objectGroup?: string | undefined; - /** - * Specifies whether command line API should be available to the evaluated expression, defaults to false. - */ - includeCommandLineAPI?: boolean | undefined; - /** - * In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides setPauseOnException state. - */ - silent?: boolean | undefined; - /** - * Whether the result is expected to be a JSON object that should be sent by value. - */ - returnByValue?: boolean | undefined; - /** - * Whether preview should be generated for the result. - * @experimental - */ - generatePreview?: boolean | undefined; - /** - * Whether to throw an exception if side effect cannot be ruled out during evaluation. - */ - throwOnSideEffect?: boolean | undefined; - } - interface SetVariableValueParameterType { - /** - * 0-based number of scope as was listed in scope chain. Only 'local', 'closure' and 'catch' scope types are allowed. Other scopes could be manipulated manually. - */ - scopeNumber: number; - /** - * Variable name. - */ - variableName: string; - /** - * New variable value. - */ - newValue: Runtime.CallArgument; - /** - * Id of callframe that holds variable. - */ - callFrameId: CallFrameId; - } - interface SetReturnValueParameterType { - /** - * New return value. - */ - newValue: Runtime.CallArgument; - } - interface SetAsyncCallStackDepthParameterType { - /** - * Maximum depth of async call stacks. Setting to 0 will effectively disable collecting async call stacks (default). - */ - maxDepth: number; - } - interface SetBlackboxPatternsParameterType { - /** - * Array of regexps that will be used to check script url for blackbox state. - */ - patterns: string[]; - } - interface SetBlackboxedRangesParameterType { - /** - * Id of the script. - */ - scriptId: Runtime.ScriptId; - positions: ScriptPosition[]; - } - interface EnableReturnType { - /** - * Unique identifier of the debugger. - * @experimental - */ - debuggerId: Runtime.UniqueDebuggerId; - } - interface SetBreakpointByUrlReturnType { - /** - * Id of the created breakpoint for further reference. - */ - breakpointId: BreakpointId; - /** - * List of the locations this breakpoint resolved into upon addition. - */ - locations: Location[]; - } - interface SetBreakpointReturnType { - /** - * Id of the created breakpoint for further reference. - */ - breakpointId: BreakpointId; - /** - * Location this breakpoint resolved into. - */ - actualLocation: Location; - } - interface GetPossibleBreakpointsReturnType { - /** - * List of the possible breakpoint locations. - */ - locations: BreakLocation[]; - } - interface GetStackTraceReturnType { - stackTrace: Runtime.StackTrace; - } - interface SearchInContentReturnType { - /** - * List of search matches. - */ - result: SearchMatch[]; - } - interface SetScriptSourceReturnType { - /** - * New stack trace in case editing has happened while VM was stopped. - */ - callFrames?: CallFrame[] | undefined; - /** - * Whether current call stack was modified after applying the changes. - */ - stackChanged?: boolean | undefined; - /** - * Async stack trace, if any. - */ - asyncStackTrace?: Runtime.StackTrace | undefined; - /** - * Async stack trace, if any. - * @experimental - */ - asyncStackTraceId?: Runtime.StackTraceId | undefined; - /** - * Exception details if any. - */ - exceptionDetails?: Runtime.ExceptionDetails | undefined; - } - interface RestartFrameReturnType { - /** - * New stack trace. - */ - callFrames: CallFrame[]; - /** - * Async stack trace, if any. - */ - asyncStackTrace?: Runtime.StackTrace | undefined; - /** - * Async stack trace, if any. - * @experimental - */ - asyncStackTraceId?: Runtime.StackTraceId | undefined; - } - interface GetScriptSourceReturnType { - /** - * Script source. - */ - scriptSource: string; - } - interface EvaluateOnCallFrameReturnType { - /** - * Object wrapper for the evaluation result. - */ - result: Runtime.RemoteObject; - /** - * Exception details. - */ - exceptionDetails?: Runtime.ExceptionDetails | undefined; - } - interface ScriptParsedEventDataType { - /** - * Identifier of the script parsed. - */ - scriptId: Runtime.ScriptId; - /** - * URL or name of the script parsed (if any). - */ - url: string; - /** - * Line offset of the script within the resource with given URL (for script tags). - */ - startLine: number; - /** - * Column offset of the script within the resource with given URL. - */ - startColumn: number; - /** - * Last line of the script. - */ - endLine: number; - /** - * Length of the last line of the script. - */ - endColumn: number; - /** - * Specifies script creation context. - */ - executionContextId: Runtime.ExecutionContextId; - /** - * Content hash of the script. - */ - hash: string; - /** - * Embedder-specific auxiliary data. - */ - executionContextAuxData?: {} | undefined; - /** - * True, if this script is generated as a result of the live edit operation. - * @experimental - */ - isLiveEdit?: boolean | undefined; - /** - * URL of source map associated with script (if any). - */ - sourceMapURL?: string | undefined; - /** - * True, if this script has sourceURL. - */ - hasSourceURL?: boolean | undefined; - /** - * True, if this script is ES6 module. - */ - isModule?: boolean | undefined; - /** - * This script length. - */ - length?: number | undefined; - /** - * JavaScript top stack frame of where the script parsed event was triggered if available. - * @experimental - */ - stackTrace?: Runtime.StackTrace | undefined; - } - interface ScriptFailedToParseEventDataType { - /** - * Identifier of the script parsed. - */ - scriptId: Runtime.ScriptId; - /** - * URL or name of the script parsed (if any). - */ - url: string; - /** - * Line offset of the script within the resource with given URL (for script tags). - */ - startLine: number; - /** - * Column offset of the script within the resource with given URL. - */ - startColumn: number; - /** - * Last line of the script. - */ - endLine: number; - /** - * Length of the last line of the script. - */ - endColumn: number; - /** - * Specifies script creation context. - */ - executionContextId: Runtime.ExecutionContextId; - /** - * Content hash of the script. - */ - hash: string; - /** - * Embedder-specific auxiliary data. - */ - executionContextAuxData?: {} | undefined; - /** - * URL of source map associated with script (if any). - */ - sourceMapURL?: string | undefined; - /** - * True, if this script has sourceURL. - */ - hasSourceURL?: boolean | undefined; - /** - * True, if this script is ES6 module. - */ - isModule?: boolean | undefined; - /** - * This script length. - */ - length?: number | undefined; - /** - * JavaScript top stack frame of where the script parsed event was triggered if available. - * @experimental - */ - stackTrace?: Runtime.StackTrace | undefined; - } - interface BreakpointResolvedEventDataType { - /** - * Breakpoint unique identifier. - */ - breakpointId: BreakpointId; - /** - * Actual breakpoint location. - */ - location: Location; - } - interface PausedEventDataType { - /** - * Call stack the virtual machine stopped on. - */ - callFrames: CallFrame[]; - /** - * Pause reason. - */ - reason: string; - /** - * Object containing break-specific auxiliary properties. - */ - data?: {} | undefined; - /** - * Hit breakpoints IDs - */ - hitBreakpoints?: string[] | undefined; - /** - * Async stack trace, if any. - */ - asyncStackTrace?: Runtime.StackTrace | undefined; - /** - * Async stack trace, if any. - * @experimental - */ - asyncStackTraceId?: Runtime.StackTraceId | undefined; - /** - * Just scheduled async call will have this stack trace as parent stack during async execution. This field is available only after Debugger.stepInto call with breakOnAsynCall flag. - * @experimental - */ - asyncCallStackTraceId?: Runtime.StackTraceId | undefined; - } - } - namespace Console { - /** - * Console message. - */ - interface ConsoleMessage { - /** - * Message source. - */ - source: string; - /** - * Message severity. - */ - level: string; - /** - * Message text. - */ - text: string; - /** - * URL of the message origin. - */ - url?: string | undefined; - /** - * Line number in the resource that generated this message (1-based). - */ - line?: number | undefined; - /** - * Column number in the resource that generated this message (1-based). - */ - column?: number | undefined; - } - interface MessageAddedEventDataType { - /** - * Console message that has been added. - */ - message: ConsoleMessage; - } - } - namespace Profiler { - /** - * Profile node. Holds callsite information, execution statistics and child nodes. - */ - interface ProfileNode { - /** - * Unique id of the node. - */ - id: number; - /** - * Function location. - */ - callFrame: Runtime.CallFrame; - /** - * Number of samples where this node was on top of the call stack. - */ - hitCount?: number | undefined; - /** - * Child node ids. - */ - children?: number[] | undefined; - /** - * The reason of being not optimized. The function may be deoptimized or marked as don't optimize. - */ - deoptReason?: string | undefined; - /** - * An array of source position ticks. - */ - positionTicks?: PositionTickInfo[] | undefined; - } - /** - * Profile. - */ - interface Profile { - /** - * The list of profile nodes. First item is the root node. - */ - nodes: ProfileNode[]; - /** - * Profiling start timestamp in microseconds. - */ - startTime: number; - /** - * Profiling end timestamp in microseconds. - */ - endTime: number; - /** - * Ids of samples top nodes. - */ - samples?: number[] | undefined; - /** - * Time intervals between adjacent samples in microseconds. The first delta is relative to the profile startTime. - */ - timeDeltas?: number[] | undefined; - } - /** - * Specifies a number of samples attributed to a certain source position. - */ - interface PositionTickInfo { - /** - * Source line number (1-based). - */ - line: number; - /** - * Number of samples attributed to the source line. - */ - ticks: number; - } - /** - * Coverage data for a source range. - */ - interface CoverageRange { - /** - * JavaScript script source offset for the range start. - */ - startOffset: number; - /** - * JavaScript script source offset for the range end. - */ - endOffset: number; - /** - * Collected execution count of the source range. - */ - count: number; - } - /** - * Coverage data for a JavaScript function. - */ - interface FunctionCoverage { - /** - * JavaScript function name. - */ - functionName: string; - /** - * Source ranges inside the function with coverage data. - */ - ranges: CoverageRange[]; - /** - * Whether coverage data for this function has block granularity. - */ - isBlockCoverage: boolean; - } - /** - * Coverage data for a JavaScript script. - */ - interface ScriptCoverage { - /** - * JavaScript script id. - */ - scriptId: Runtime.ScriptId; - /** - * JavaScript script name or url. - */ - url: string; - /** - * Functions contained in the script that has coverage data. - */ - functions: FunctionCoverage[]; - } - /** - * Describes a type collected during runtime. - * @experimental - */ - interface TypeObject { - /** - * Name of a type collected with type profiling. - */ - name: string; - } - /** - * Source offset and types for a parameter or return value. - * @experimental - */ - interface TypeProfileEntry { - /** - * Source offset of the parameter or end of function for return values. - */ - offset: number; - /** - * The types for this parameter or return value. - */ - types: TypeObject[]; - } - /** - * Type profile data collected during runtime for a JavaScript script. - * @experimental - */ - interface ScriptTypeProfile { - /** - * JavaScript script id. - */ - scriptId: Runtime.ScriptId; - /** - * JavaScript script name or url. - */ - url: string; - /** - * Type profile entries for parameters and return values of the functions in the script. - */ - entries: TypeProfileEntry[]; - } - interface SetSamplingIntervalParameterType { - /** - * New sampling interval in microseconds. - */ - interval: number; - } - interface StartPreciseCoverageParameterType { - /** - * Collect accurate call counts beyond simple 'covered' or 'not covered'. - */ - callCount?: boolean | undefined; - /** - * Collect block-based coverage. - */ - detailed?: boolean | undefined; - } - interface StopReturnType { - /** - * Recorded profile. - */ - profile: Profile; - } - interface TakePreciseCoverageReturnType { - /** - * Coverage data for the current isolate. - */ - result: ScriptCoverage[]; - } - interface GetBestEffortCoverageReturnType { - /** - * Coverage data for the current isolate. - */ - result: ScriptCoverage[]; - } - interface TakeTypeProfileReturnType { - /** - * Type profile for all scripts since startTypeProfile() was turned on. - */ - result: ScriptTypeProfile[]; - } - interface ConsoleProfileStartedEventDataType { - id: string; - /** - * Location of console.profile(). - */ - location: Debugger.Location; - /** - * Profile title passed as an argument to console.profile(). - */ - title?: string | undefined; - } - interface ConsoleProfileFinishedEventDataType { - id: string; - /** - * Location of console.profileEnd(). - */ - location: Debugger.Location; - profile: Profile; - /** - * Profile title passed as an argument to console.profile(). - */ - title?: string | undefined; - } - } - namespace HeapProfiler { - /** - * Heap snapshot object id. - */ - type HeapSnapshotObjectId = string; - /** - * Sampling Heap Profile node. Holds callsite information, allocation statistics and child nodes. - */ - interface SamplingHeapProfileNode { - /** - * Function location. - */ - callFrame: Runtime.CallFrame; - /** - * Allocations size in bytes for the node excluding children. - */ - selfSize: number; - /** - * Child nodes. - */ - children: SamplingHeapProfileNode[]; - } - /** - * Profile. - */ - interface SamplingHeapProfile { - head: SamplingHeapProfileNode; - } - interface StartTrackingHeapObjectsParameterType { - trackAllocations?: boolean | undefined; - } - interface StopTrackingHeapObjectsParameterType { - /** - * If true 'reportHeapSnapshotProgress' events will be generated while snapshot is being taken when the tracking is stopped. - */ - reportProgress?: boolean | undefined; - } - interface TakeHeapSnapshotParameterType { - /** - * If true 'reportHeapSnapshotProgress' events will be generated while snapshot is being taken. - */ - reportProgress?: boolean | undefined; - } - interface GetObjectByHeapObjectIdParameterType { - objectId: HeapSnapshotObjectId; - /** - * Symbolic group name that can be used to release multiple objects. - */ - objectGroup?: string | undefined; - } - interface AddInspectedHeapObjectParameterType { - /** - * Heap snapshot object id to be accessible by means of $x command line API. - */ - heapObjectId: HeapSnapshotObjectId; - } - interface GetHeapObjectIdParameterType { - /** - * Identifier of the object to get heap object id for. - */ - objectId: Runtime.RemoteObjectId; - } - interface StartSamplingParameterType { - /** - * Average sample interval in bytes. Poisson distribution is used for the intervals. The default value is 32768 bytes. - */ - samplingInterval?: number | undefined; - } - interface GetObjectByHeapObjectIdReturnType { - /** - * Evaluation result. - */ - result: Runtime.RemoteObject; - } - interface GetHeapObjectIdReturnType { - /** - * Id of the heap snapshot object corresponding to the passed remote object id. - */ - heapSnapshotObjectId: HeapSnapshotObjectId; - } - interface StopSamplingReturnType { - /** - * Recorded sampling heap profile. - */ - profile: SamplingHeapProfile; - } - interface GetSamplingProfileReturnType { - /** - * Return the sampling profile being collected. - */ - profile: SamplingHeapProfile; - } - interface AddHeapSnapshotChunkEventDataType { - chunk: string; - } - interface ReportHeapSnapshotProgressEventDataType { - done: number; - total: number; - finished?: boolean | undefined; - } - interface LastSeenObjectIdEventDataType { - lastSeenObjectId: number; - timestamp: number; - } - interface HeapStatsUpdateEventDataType { - /** - * An array of triplets. Each triplet describes a fragment. The first integer is the fragment index, the second integer is a total count of objects for the fragment, the third integer is a total size of the objects for the fragment. - */ - statsUpdate: number[]; - } - } - namespace NodeTracing { - interface TraceConfig { - /** - * Controls how the trace buffer stores data. - */ - recordMode?: string | undefined; - /** - * Included category filters. - */ - includedCategories: string[]; - } - interface StartParameterType { - traceConfig: TraceConfig; - } - interface GetCategoriesReturnType { - /** - * A list of supported tracing categories. - */ - categories: string[]; - } - interface DataCollectedEventDataType { - value: Array<{}>; - } - } - namespace NodeWorker { - type WorkerID = string; - /** - * Unique identifier of attached debugging session. - */ - type SessionID = string; - interface WorkerInfo { - workerId: WorkerID; - type: string; - title: string; - url: string; - } - interface SendMessageToWorkerParameterType { - message: string; - /** - * Identifier of the session. - */ - sessionId: SessionID; - } - interface EnableParameterType { - /** - * Whether to new workers should be paused until the frontend sends `Runtime.runIfWaitingForDebugger` - * message to run them. - */ - waitForDebuggerOnStart: boolean; - } - interface DetachParameterType { - sessionId: SessionID; - } - interface AttachedToWorkerEventDataType { - /** - * Identifier assigned to the session used to send/receive messages. - */ - sessionId: SessionID; - workerInfo: WorkerInfo; - waitingForDebugger: boolean; - } - interface DetachedFromWorkerEventDataType { - /** - * Detached session identifier. - */ - sessionId: SessionID; - } - interface ReceivedMessageFromWorkerEventDataType { - /** - * Identifier of a session which sends a message. - */ - sessionId: SessionID; - message: string; - } - } - namespace NodeRuntime { - interface NotifyWhenWaitingForDisconnectParameterType { - enabled: boolean; - } - } - /** - * The `inspector.Session` is used for dispatching messages to the V8 inspector - * back-end and receiving message responses and notifications. - */ - class Session extends EventEmitter { - /** - * Create a new instance of the inspector.Session class. - * The inspector session needs to be connected through session.connect() before the messages can be dispatched to the inspector backend. - */ - constructor(); - /** - * Connects a session to the inspector back-end. - * @since v8.0.0 - */ - connect(): void; - /** - * Immediately close the session. All pending message callbacks will be called - * with an error. `session.connect()` will need to be called to be able to send - * messages again. Reconnected session will lose all inspector state, such as - * enabled agents or configured breakpoints. - * @since v8.0.0 - */ - disconnect(): void; - /** - * Posts a message to the inspector back-end. `callback` will be notified when - * a response is received. `callback` is a function that accepts two optional - * arguments: error and message-specific result. - * - * ```js - * session.post('Runtime.evaluate', { expression: '2 + 2' }, - * (error, { result }) => console.log(result)); - * // Output: { type: 'number', value: 4, description: '4' } - * ``` - * - * The latest version of the V8 inspector protocol is published on the [Chrome DevTools Protocol Viewer](https://chromedevtools.github.io/devtools-protocol/v8/). - * - * Node.js inspector supports all the Chrome DevTools Protocol domains declared - * by V8\. Chrome DevTools Protocol domain provides an interface for interacting - * with one of the runtime agents used to inspect the application state and listen - * to the run-time events. - * - * ## Example usage - * - * Apart from the debugger, various V8 Profilers are available through the DevTools - * protocol. - * @since v8.0.0 - */ - post(method: string, params?: {}, callback?: (err: Error | null, params?: {}) => void): void; - post(method: string, callback?: (err: Error | null, params?: {}) => void): void; - /** - * Returns supported domains. - */ - post(method: 'Schema.getDomains', callback?: (err: Error | null, params: Schema.GetDomainsReturnType) => void): void; - /** - * Evaluates expression on global object. - */ - post(method: 'Runtime.evaluate', params?: Runtime.EvaluateParameterType, callback?: (err: Error | null, params: Runtime.EvaluateReturnType) => void): void; - post(method: 'Runtime.evaluate', callback?: (err: Error | null, params: Runtime.EvaluateReturnType) => void): void; - /** - * Add handler to promise with given promise object id. - */ - post(method: 'Runtime.awaitPromise', params?: Runtime.AwaitPromiseParameterType, callback?: (err: Error | null, params: Runtime.AwaitPromiseReturnType) => void): void; - post(method: 'Runtime.awaitPromise', callback?: (err: Error | null, params: Runtime.AwaitPromiseReturnType) => void): void; - /** - * Calls function with given declaration on the given object. Object group of the result is inherited from the target object. - */ - post(method: 'Runtime.callFunctionOn', params?: Runtime.CallFunctionOnParameterType, callback?: (err: Error | null, params: Runtime.CallFunctionOnReturnType) => void): void; - post(method: 'Runtime.callFunctionOn', callback?: (err: Error | null, params: Runtime.CallFunctionOnReturnType) => void): void; - /** - * Returns properties of a given object. Object group of the result is inherited from the target object. - */ - post(method: 'Runtime.getProperties', params?: Runtime.GetPropertiesParameterType, callback?: (err: Error | null, params: Runtime.GetPropertiesReturnType) => void): void; - post(method: 'Runtime.getProperties', callback?: (err: Error | null, params: Runtime.GetPropertiesReturnType) => void): void; - /** - * Releases remote object with given id. - */ - post(method: 'Runtime.releaseObject', params?: Runtime.ReleaseObjectParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Runtime.releaseObject', callback?: (err: Error | null) => void): void; - /** - * Releases all remote objects that belong to a given group. - */ - post(method: 'Runtime.releaseObjectGroup', params?: Runtime.ReleaseObjectGroupParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Runtime.releaseObjectGroup', callback?: (err: Error | null) => void): void; - /** - * Tells inspected instance to run if it was waiting for debugger to attach. - */ - post(method: 'Runtime.runIfWaitingForDebugger', callback?: (err: Error | null) => void): void; - /** - * Enables reporting of execution contexts creation by means of executionContextCreated event. When the reporting gets enabled the event will be sent immediately for each existing execution context. - */ - post(method: 'Runtime.enable', callback?: (err: Error | null) => void): void; - /** - * Disables reporting of execution contexts creation. - */ - post(method: 'Runtime.disable', callback?: (err: Error | null) => void): void; - /** - * Discards collected exceptions and console API calls. - */ - post(method: 'Runtime.discardConsoleEntries', callback?: (err: Error | null) => void): void; - /** - * @experimental - */ - post(method: 'Runtime.setCustomObjectFormatterEnabled', params?: Runtime.SetCustomObjectFormatterEnabledParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Runtime.setCustomObjectFormatterEnabled', callback?: (err: Error | null) => void): void; - /** - * Compiles expression. - */ - post(method: 'Runtime.compileScript', params?: Runtime.CompileScriptParameterType, callback?: (err: Error | null, params: Runtime.CompileScriptReturnType) => void): void; - post(method: 'Runtime.compileScript', callback?: (err: Error | null, params: Runtime.CompileScriptReturnType) => void): void; - /** - * Runs script with given id in a given context. - */ - post(method: 'Runtime.runScript', params?: Runtime.RunScriptParameterType, callback?: (err: Error | null, params: Runtime.RunScriptReturnType) => void): void; - post(method: 'Runtime.runScript', callback?: (err: Error | null, params: Runtime.RunScriptReturnType) => void): void; - post(method: 'Runtime.queryObjects', params?: Runtime.QueryObjectsParameterType, callback?: (err: Error | null, params: Runtime.QueryObjectsReturnType) => void): void; - post(method: 'Runtime.queryObjects', callback?: (err: Error | null, params: Runtime.QueryObjectsReturnType) => void): void; - /** - * Returns all let, const and class variables from global scope. - */ - post( - method: 'Runtime.globalLexicalScopeNames', - params?: Runtime.GlobalLexicalScopeNamesParameterType, - callback?: (err: Error | null, params: Runtime.GlobalLexicalScopeNamesReturnType) => void - ): void; - post(method: 'Runtime.globalLexicalScopeNames', callback?: (err: Error | null, params: Runtime.GlobalLexicalScopeNamesReturnType) => void): void; - /** - * Enables debugger for the given page. Clients should not assume that the debugging has been enabled until the result for this command is received. - */ - post(method: 'Debugger.enable', callback?: (err: Error | null, params: Debugger.EnableReturnType) => void): void; - /** - * Disables debugger for given page. - */ - post(method: 'Debugger.disable', callback?: (err: Error | null) => void): void; - /** - * Activates / deactivates all breakpoints on the page. - */ - post(method: 'Debugger.setBreakpointsActive', params?: Debugger.SetBreakpointsActiveParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Debugger.setBreakpointsActive', callback?: (err: Error | null) => void): void; - /** - * Makes page not interrupt on any pauses (breakpoint, exception, dom exception etc). - */ - post(method: 'Debugger.setSkipAllPauses', params?: Debugger.SetSkipAllPausesParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Debugger.setSkipAllPauses', callback?: (err: Error | null) => void): void; - /** - * Sets JavaScript breakpoint at given location specified either by URL or URL regex. Once this command is issued, all existing parsed scripts will have breakpoints resolved and returned in locations property. Further matching script parsing will result in subsequent breakpointResolved events issued. This logical breakpoint will survive page reloads. - */ - post(method: 'Debugger.setBreakpointByUrl', params?: Debugger.SetBreakpointByUrlParameterType, callback?: (err: Error | null, params: Debugger.SetBreakpointByUrlReturnType) => void): void; - post(method: 'Debugger.setBreakpointByUrl', callback?: (err: Error | null, params: Debugger.SetBreakpointByUrlReturnType) => void): void; - /** - * Sets JavaScript breakpoint at a given location. - */ - post(method: 'Debugger.setBreakpoint', params?: Debugger.SetBreakpointParameterType, callback?: (err: Error | null, params: Debugger.SetBreakpointReturnType) => void): void; - post(method: 'Debugger.setBreakpoint', callback?: (err: Error | null, params: Debugger.SetBreakpointReturnType) => void): void; - /** - * Removes JavaScript breakpoint. - */ - post(method: 'Debugger.removeBreakpoint', params?: Debugger.RemoveBreakpointParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Debugger.removeBreakpoint', callback?: (err: Error | null) => void): void; - /** - * Returns possible locations for breakpoint. scriptId in start and end range locations should be the same. - */ - post( - method: 'Debugger.getPossibleBreakpoints', - params?: Debugger.GetPossibleBreakpointsParameterType, - callback?: (err: Error | null, params: Debugger.GetPossibleBreakpointsReturnType) => void - ): void; - post(method: 'Debugger.getPossibleBreakpoints', callback?: (err: Error | null, params: Debugger.GetPossibleBreakpointsReturnType) => void): void; - /** - * Continues execution until specific location is reached. - */ - post(method: 'Debugger.continueToLocation', params?: Debugger.ContinueToLocationParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Debugger.continueToLocation', callback?: (err: Error | null) => void): void; - /** - * @experimental - */ - post(method: 'Debugger.pauseOnAsyncCall', params?: Debugger.PauseOnAsyncCallParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Debugger.pauseOnAsyncCall', callback?: (err: Error | null) => void): void; - /** - * Steps over the statement. - */ - post(method: 'Debugger.stepOver', callback?: (err: Error | null) => void): void; - /** - * Steps into the function call. - */ - post(method: 'Debugger.stepInto', params?: Debugger.StepIntoParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Debugger.stepInto', callback?: (err: Error | null) => void): void; - /** - * Steps out of the function call. - */ - post(method: 'Debugger.stepOut', callback?: (err: Error | null) => void): void; - /** - * Stops on the next JavaScript statement. - */ - post(method: 'Debugger.pause', callback?: (err: Error | null) => void): void; - /** - * This method is deprecated - use Debugger.stepInto with breakOnAsyncCall and Debugger.pauseOnAsyncTask instead. Steps into next scheduled async task if any is scheduled before next pause. Returns success when async task is actually scheduled, returns error if no task were scheduled or another scheduleStepIntoAsync was called. - * @experimental - */ - post(method: 'Debugger.scheduleStepIntoAsync', callback?: (err: Error | null) => void): void; - /** - * Resumes JavaScript execution. - */ - post(method: 'Debugger.resume', callback?: (err: Error | null) => void): void; - /** - * Returns stack trace with given stackTraceId. - * @experimental - */ - post(method: 'Debugger.getStackTrace', params?: Debugger.GetStackTraceParameterType, callback?: (err: Error | null, params: Debugger.GetStackTraceReturnType) => void): void; - post(method: 'Debugger.getStackTrace', callback?: (err: Error | null, params: Debugger.GetStackTraceReturnType) => void): void; - /** - * Searches for given string in script content. - */ - post(method: 'Debugger.searchInContent', params?: Debugger.SearchInContentParameterType, callback?: (err: Error | null, params: Debugger.SearchInContentReturnType) => void): void; - post(method: 'Debugger.searchInContent', callback?: (err: Error | null, params: Debugger.SearchInContentReturnType) => void): void; - /** - * Edits JavaScript source live. - */ - post(method: 'Debugger.setScriptSource', params?: Debugger.SetScriptSourceParameterType, callback?: (err: Error | null, params: Debugger.SetScriptSourceReturnType) => void): void; - post(method: 'Debugger.setScriptSource', callback?: (err: Error | null, params: Debugger.SetScriptSourceReturnType) => void): void; - /** - * Restarts particular call frame from the beginning. - */ - post(method: 'Debugger.restartFrame', params?: Debugger.RestartFrameParameterType, callback?: (err: Error | null, params: Debugger.RestartFrameReturnType) => void): void; - post(method: 'Debugger.restartFrame', callback?: (err: Error | null, params: Debugger.RestartFrameReturnType) => void): void; - /** - * Returns source for the script with given id. - */ - post(method: 'Debugger.getScriptSource', params?: Debugger.GetScriptSourceParameterType, callback?: (err: Error | null, params: Debugger.GetScriptSourceReturnType) => void): void; - post(method: 'Debugger.getScriptSource', callback?: (err: Error | null, params: Debugger.GetScriptSourceReturnType) => void): void; - /** - * Defines pause on exceptions state. Can be set to stop on all exceptions, uncaught exceptions or no exceptions. Initial pause on exceptions state is none. - */ - post(method: 'Debugger.setPauseOnExceptions', params?: Debugger.SetPauseOnExceptionsParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Debugger.setPauseOnExceptions', callback?: (err: Error | null) => void): void; - /** - * Evaluates expression on a given call frame. - */ - post(method: 'Debugger.evaluateOnCallFrame', params?: Debugger.EvaluateOnCallFrameParameterType, callback?: (err: Error | null, params: Debugger.EvaluateOnCallFrameReturnType) => void): void; - post(method: 'Debugger.evaluateOnCallFrame', callback?: (err: Error | null, params: Debugger.EvaluateOnCallFrameReturnType) => void): void; - /** - * Changes value of variable in a callframe. Object-based scopes are not supported and must be mutated manually. - */ - post(method: 'Debugger.setVariableValue', params?: Debugger.SetVariableValueParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Debugger.setVariableValue', callback?: (err: Error | null) => void): void; - /** - * Changes return value in top frame. Available only at return break position. - * @experimental - */ - post(method: 'Debugger.setReturnValue', params?: Debugger.SetReturnValueParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Debugger.setReturnValue', callback?: (err: Error | null) => void): void; - /** - * Enables or disables async call stacks tracking. - */ - post(method: 'Debugger.setAsyncCallStackDepth', params?: Debugger.SetAsyncCallStackDepthParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Debugger.setAsyncCallStackDepth', callback?: (err: Error | null) => void): void; - /** - * Replace previous blackbox patterns with passed ones. Forces backend to skip stepping/pausing in scripts with url matching one of the patterns. VM will try to leave blackboxed script by performing 'step in' several times, finally resorting to 'step out' if unsuccessful. - * @experimental - */ - post(method: 'Debugger.setBlackboxPatterns', params?: Debugger.SetBlackboxPatternsParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Debugger.setBlackboxPatterns', callback?: (err: Error | null) => void): void; - /** - * Makes backend skip steps in the script in blackboxed ranges. VM will try leave blacklisted scripts by performing 'step in' several times, finally resorting to 'step out' if unsuccessful. Positions array contains positions where blackbox state is changed. First interval isn't blackboxed. Array should be sorted. - * @experimental - */ - post(method: 'Debugger.setBlackboxedRanges', params?: Debugger.SetBlackboxedRangesParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Debugger.setBlackboxedRanges', callback?: (err: Error | null) => void): void; - /** - * Enables console domain, sends the messages collected so far to the client by means of the messageAdded notification. - */ - post(method: 'Console.enable', callback?: (err: Error | null) => void): void; - /** - * Disables console domain, prevents further console messages from being reported to the client. - */ - post(method: 'Console.disable', callback?: (err: Error | null) => void): void; - /** - * Does nothing. - */ - post(method: 'Console.clearMessages', callback?: (err: Error | null) => void): void; - post(method: 'Profiler.enable', callback?: (err: Error | null) => void): void; - post(method: 'Profiler.disable', callback?: (err: Error | null) => void): void; - /** - * Changes CPU profiler sampling interval. Must be called before CPU profiles recording started. - */ - post(method: 'Profiler.setSamplingInterval', params?: Profiler.SetSamplingIntervalParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Profiler.setSamplingInterval', callback?: (err: Error | null) => void): void; - post(method: 'Profiler.start', callback?: (err: Error | null) => void): void; - post(method: 'Profiler.stop', callback?: (err: Error | null, params: Profiler.StopReturnType) => void): void; - /** - * Enable precise code coverage. Coverage data for JavaScript executed before enabling precise code coverage may be incomplete. Enabling prevents running optimized code and resets execution counters. - */ - post(method: 'Profiler.startPreciseCoverage', params?: Profiler.StartPreciseCoverageParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Profiler.startPreciseCoverage', callback?: (err: Error | null) => void): void; - /** - * Disable precise code coverage. Disabling releases unnecessary execution count records and allows executing optimized code. - */ - post(method: 'Profiler.stopPreciseCoverage', callback?: (err: Error | null) => void): void; - /** - * Collect coverage data for the current isolate, and resets execution counters. Precise code coverage needs to have started. - */ - post(method: 'Profiler.takePreciseCoverage', callback?: (err: Error | null, params: Profiler.TakePreciseCoverageReturnType) => void): void; - /** - * Collect coverage data for the current isolate. The coverage data may be incomplete due to garbage collection. - */ - post(method: 'Profiler.getBestEffortCoverage', callback?: (err: Error | null, params: Profiler.GetBestEffortCoverageReturnType) => void): void; - /** - * Enable type profile. - * @experimental - */ - post(method: 'Profiler.startTypeProfile', callback?: (err: Error | null) => void): void; - /** - * Disable type profile. Disabling releases type profile data collected so far. - * @experimental - */ - post(method: 'Profiler.stopTypeProfile', callback?: (err: Error | null) => void): void; - /** - * Collect type profile. - * @experimental - */ - post(method: 'Profiler.takeTypeProfile', callback?: (err: Error | null, params: Profiler.TakeTypeProfileReturnType) => void): void; - post(method: 'HeapProfiler.enable', callback?: (err: Error | null) => void): void; - post(method: 'HeapProfiler.disable', callback?: (err: Error | null) => void): void; - post(method: 'HeapProfiler.startTrackingHeapObjects', params?: HeapProfiler.StartTrackingHeapObjectsParameterType, callback?: (err: Error | null) => void): void; - post(method: 'HeapProfiler.startTrackingHeapObjects', callback?: (err: Error | null) => void): void; - post(method: 'HeapProfiler.stopTrackingHeapObjects', params?: HeapProfiler.StopTrackingHeapObjectsParameterType, callback?: (err: Error | null) => void): void; - post(method: 'HeapProfiler.stopTrackingHeapObjects', callback?: (err: Error | null) => void): void; - post(method: 'HeapProfiler.takeHeapSnapshot', params?: HeapProfiler.TakeHeapSnapshotParameterType, callback?: (err: Error | null) => void): void; - post(method: 'HeapProfiler.takeHeapSnapshot', callback?: (err: Error | null) => void): void; - post(method: 'HeapProfiler.collectGarbage', callback?: (err: Error | null) => void): void; - post( - method: 'HeapProfiler.getObjectByHeapObjectId', - params?: HeapProfiler.GetObjectByHeapObjectIdParameterType, - callback?: (err: Error | null, params: HeapProfiler.GetObjectByHeapObjectIdReturnType) => void - ): void; - post(method: 'HeapProfiler.getObjectByHeapObjectId', callback?: (err: Error | null, params: HeapProfiler.GetObjectByHeapObjectIdReturnType) => void): void; - /** - * Enables console to refer to the node with given id via $x (see Command Line API for more details $x functions). - */ - post(method: 'HeapProfiler.addInspectedHeapObject', params?: HeapProfiler.AddInspectedHeapObjectParameterType, callback?: (err: Error | null) => void): void; - post(method: 'HeapProfiler.addInspectedHeapObject', callback?: (err: Error | null) => void): void; - post(method: 'HeapProfiler.getHeapObjectId', params?: HeapProfiler.GetHeapObjectIdParameterType, callback?: (err: Error | null, params: HeapProfiler.GetHeapObjectIdReturnType) => void): void; - post(method: 'HeapProfiler.getHeapObjectId', callback?: (err: Error | null, params: HeapProfiler.GetHeapObjectIdReturnType) => void): void; - post(method: 'HeapProfiler.startSampling', params?: HeapProfiler.StartSamplingParameterType, callback?: (err: Error | null) => void): void; - post(method: 'HeapProfiler.startSampling', callback?: (err: Error | null) => void): void; - post(method: 'HeapProfiler.stopSampling', callback?: (err: Error | null, params: HeapProfiler.StopSamplingReturnType) => void): void; - post(method: 'HeapProfiler.getSamplingProfile', callback?: (err: Error | null, params: HeapProfiler.GetSamplingProfileReturnType) => void): void; - /** - * Gets supported tracing categories. - */ - post(method: 'NodeTracing.getCategories', callback?: (err: Error | null, params: NodeTracing.GetCategoriesReturnType) => void): void; - /** - * Start trace events collection. - */ - post(method: 'NodeTracing.start', params?: NodeTracing.StartParameterType, callback?: (err: Error | null) => void): void; - post(method: 'NodeTracing.start', callback?: (err: Error | null) => void): void; - /** - * Stop trace events collection. Remaining collected events will be sent as a sequence of - * dataCollected events followed by tracingComplete event. - */ - post(method: 'NodeTracing.stop', callback?: (err: Error | null) => void): void; - /** - * Sends protocol message over session with given id. - */ - post(method: 'NodeWorker.sendMessageToWorker', params?: NodeWorker.SendMessageToWorkerParameterType, callback?: (err: Error | null) => void): void; - post(method: 'NodeWorker.sendMessageToWorker', callback?: (err: Error | null) => void): void; - /** - * Instructs the inspector to attach to running workers. Will also attach to new workers - * as they start - */ - post(method: 'NodeWorker.enable', params?: NodeWorker.EnableParameterType, callback?: (err: Error | null) => void): void; - post(method: 'NodeWorker.enable', callback?: (err: Error | null) => void): void; - /** - * Detaches from all running workers and disables attaching to new workers as they are started. - */ - post(method: 'NodeWorker.disable', callback?: (err: Error | null) => void): void; - /** - * Detached from the worker with given sessionId. - */ - post(method: 'NodeWorker.detach', params?: NodeWorker.DetachParameterType, callback?: (err: Error | null) => void): void; - post(method: 'NodeWorker.detach', callback?: (err: Error | null) => void): void; - /** - * Enable the `NodeRuntime.waitingForDisconnect`. - */ - post(method: 'NodeRuntime.notifyWhenWaitingForDisconnect', params?: NodeRuntime.NotifyWhenWaitingForDisconnectParameterType, callback?: (err: Error | null) => void): void; - post(method: 'NodeRuntime.notifyWhenWaitingForDisconnect', callback?: (err: Error | null) => void): void; - // Events - addListener(event: string, listener: (...args: any[]) => void): this; - /** - * Emitted when any notification from the V8 Inspector is received. - */ - addListener(event: 'inspectorNotification', listener: (message: InspectorNotification<{}>) => void): this; - /** - * Issued when new execution context is created. - */ - addListener(event: 'Runtime.executionContextCreated', listener: (message: InspectorNotification) => void): this; - /** - * Issued when execution context is destroyed. - */ - addListener(event: 'Runtime.executionContextDestroyed', listener: (message: InspectorNotification) => void): this; - /** - * Issued when all executionContexts were cleared in browser - */ - addListener(event: 'Runtime.executionContextsCleared', listener: () => void): this; - /** - * Issued when exception was thrown and unhandled. - */ - addListener(event: 'Runtime.exceptionThrown', listener: (message: InspectorNotification) => void): this; - /** - * Issued when unhandled exception was revoked. - */ - addListener(event: 'Runtime.exceptionRevoked', listener: (message: InspectorNotification) => void): this; - /** - * Issued when console API was called. - */ - addListener(event: 'Runtime.consoleAPICalled', listener: (message: InspectorNotification) => void): this; - /** - * Issued when object should be inspected (for example, as a result of inspect() command line API call). - */ - addListener(event: 'Runtime.inspectRequested', listener: (message: InspectorNotification) => void): this; - /** - * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger. - */ - addListener(event: 'Debugger.scriptParsed', listener: (message: InspectorNotification) => void): this; - /** - * Fired when virtual machine fails to parse the script. - */ - addListener(event: 'Debugger.scriptFailedToParse', listener: (message: InspectorNotification) => void): this; - /** - * Fired when breakpoint is resolved to an actual script and location. - */ - addListener(event: 'Debugger.breakpointResolved', listener: (message: InspectorNotification) => void): this; - /** - * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. - */ - addListener(event: 'Debugger.paused', listener: (message: InspectorNotification) => void): this; - /** - * Fired when the virtual machine resumed execution. - */ - addListener(event: 'Debugger.resumed', listener: () => void): this; - /** - * Issued when new console message is added. - */ - addListener(event: 'Console.messageAdded', listener: (message: InspectorNotification) => void): this; - /** - * Sent when new profile recording is started using console.profile() call. - */ - addListener(event: 'Profiler.consoleProfileStarted', listener: (message: InspectorNotification) => void): this; - addListener(event: 'Profiler.consoleProfileFinished', listener: (message: InspectorNotification) => void): this; - addListener(event: 'HeapProfiler.addHeapSnapshotChunk', listener: (message: InspectorNotification) => void): this; - addListener(event: 'HeapProfiler.resetProfiles', listener: () => void): this; - addListener(event: 'HeapProfiler.reportHeapSnapshotProgress', listener: (message: InspectorNotification) => void): this; - /** - * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. - */ - addListener(event: 'HeapProfiler.lastSeenObjectId', listener: (message: InspectorNotification) => void): this; - /** - * If heap objects tracking has been started then backend may send update for one or more fragments - */ - addListener(event: 'HeapProfiler.heapStatsUpdate', listener: (message: InspectorNotification) => void): this; - /** - * Contains an bucket of collected trace events. - */ - addListener(event: 'NodeTracing.dataCollected', listener: (message: InspectorNotification) => void): this; - /** - * Signals that tracing is stopped and there is no trace buffers pending flush, all data were - * delivered via dataCollected events. - */ - addListener(event: 'NodeTracing.tracingComplete', listener: () => void): this; - /** - * Issued when attached to a worker. - */ - addListener(event: 'NodeWorker.attachedToWorker', listener: (message: InspectorNotification) => void): this; - /** - * Issued when detached from the worker. - */ - addListener(event: 'NodeWorker.detachedFromWorker', listener: (message: InspectorNotification) => void): this; - /** - * Notifies about a new protocol message received from the session - * (session ID is provided in attachedToWorker notification). - */ - addListener(event: 'NodeWorker.receivedMessageFromWorker', listener: (message: InspectorNotification) => void): this; - /** - * This event is fired instead of `Runtime.executionContextDestroyed` when - * enabled. - * It is fired when the Node process finished all code execution and is - * waiting for all frontends to disconnect. - */ - addListener(event: 'NodeRuntime.waitingForDisconnect', listener: () => void): this; - emit(event: string | symbol, ...args: any[]): boolean; - emit(event: 'inspectorNotification', message: InspectorNotification<{}>): boolean; - emit(event: 'Runtime.executionContextCreated', message: InspectorNotification): boolean; - emit(event: 'Runtime.executionContextDestroyed', message: InspectorNotification): boolean; - emit(event: 'Runtime.executionContextsCleared'): boolean; - emit(event: 'Runtime.exceptionThrown', message: InspectorNotification): boolean; - emit(event: 'Runtime.exceptionRevoked', message: InspectorNotification): boolean; - emit(event: 'Runtime.consoleAPICalled', message: InspectorNotification): boolean; - emit(event: 'Runtime.inspectRequested', message: InspectorNotification): boolean; - emit(event: 'Debugger.scriptParsed', message: InspectorNotification): boolean; - emit(event: 'Debugger.scriptFailedToParse', message: InspectorNotification): boolean; - emit(event: 'Debugger.breakpointResolved', message: InspectorNotification): boolean; - emit(event: 'Debugger.paused', message: InspectorNotification): boolean; - emit(event: 'Debugger.resumed'): boolean; - emit(event: 'Console.messageAdded', message: InspectorNotification): boolean; - emit(event: 'Profiler.consoleProfileStarted', message: InspectorNotification): boolean; - emit(event: 'Profiler.consoleProfileFinished', message: InspectorNotification): boolean; - emit(event: 'HeapProfiler.addHeapSnapshotChunk', message: InspectorNotification): boolean; - emit(event: 'HeapProfiler.resetProfiles'): boolean; - emit(event: 'HeapProfiler.reportHeapSnapshotProgress', message: InspectorNotification): boolean; - emit(event: 'HeapProfiler.lastSeenObjectId', message: InspectorNotification): boolean; - emit(event: 'HeapProfiler.heapStatsUpdate', message: InspectorNotification): boolean; - emit(event: 'NodeTracing.dataCollected', message: InspectorNotification): boolean; - emit(event: 'NodeTracing.tracingComplete'): boolean; - emit(event: 'NodeWorker.attachedToWorker', message: InspectorNotification): boolean; - emit(event: 'NodeWorker.detachedFromWorker', message: InspectorNotification): boolean; - emit(event: 'NodeWorker.receivedMessageFromWorker', message: InspectorNotification): boolean; - emit(event: 'NodeRuntime.waitingForDisconnect'): boolean; - on(event: string, listener: (...args: any[]) => void): this; - /** - * Emitted when any notification from the V8 Inspector is received. - */ - on(event: 'inspectorNotification', listener: (message: InspectorNotification<{}>) => void): this; - /** - * Issued when new execution context is created. - */ - on(event: 'Runtime.executionContextCreated', listener: (message: InspectorNotification) => void): this; - /** - * Issued when execution context is destroyed. - */ - on(event: 'Runtime.executionContextDestroyed', listener: (message: InspectorNotification) => void): this; - /** - * Issued when all executionContexts were cleared in browser - */ - on(event: 'Runtime.executionContextsCleared', listener: () => void): this; - /** - * Issued when exception was thrown and unhandled. - */ - on(event: 'Runtime.exceptionThrown', listener: (message: InspectorNotification) => void): this; - /** - * Issued when unhandled exception was revoked. - */ - on(event: 'Runtime.exceptionRevoked', listener: (message: InspectorNotification) => void): this; - /** - * Issued when console API was called. - */ - on(event: 'Runtime.consoleAPICalled', listener: (message: InspectorNotification) => void): this; - /** - * Issued when object should be inspected (for example, as a result of inspect() command line API call). - */ - on(event: 'Runtime.inspectRequested', listener: (message: InspectorNotification) => void): this; - /** - * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger. - */ - on(event: 'Debugger.scriptParsed', listener: (message: InspectorNotification) => void): this; - /** - * Fired when virtual machine fails to parse the script. - */ - on(event: 'Debugger.scriptFailedToParse', listener: (message: InspectorNotification) => void): this; - /** - * Fired when breakpoint is resolved to an actual script and location. - */ - on(event: 'Debugger.breakpointResolved', listener: (message: InspectorNotification) => void): this; - /** - * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. - */ - on(event: 'Debugger.paused', listener: (message: InspectorNotification) => void): this; - /** - * Fired when the virtual machine resumed execution. - */ - on(event: 'Debugger.resumed', listener: () => void): this; - /** - * Issued when new console message is added. - */ - on(event: 'Console.messageAdded', listener: (message: InspectorNotification) => void): this; - /** - * Sent when new profile recording is started using console.profile() call. - */ - on(event: 'Profiler.consoleProfileStarted', listener: (message: InspectorNotification) => void): this; - on(event: 'Profiler.consoleProfileFinished', listener: (message: InspectorNotification) => void): this; - on(event: 'HeapProfiler.addHeapSnapshotChunk', listener: (message: InspectorNotification) => void): this; - on(event: 'HeapProfiler.resetProfiles', listener: () => void): this; - on(event: 'HeapProfiler.reportHeapSnapshotProgress', listener: (message: InspectorNotification) => void): this; - /** - * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. - */ - on(event: 'HeapProfiler.lastSeenObjectId', listener: (message: InspectorNotification) => void): this; - /** - * If heap objects tracking has been started then backend may send update for one or more fragments - */ - on(event: 'HeapProfiler.heapStatsUpdate', listener: (message: InspectorNotification) => void): this; - /** - * Contains an bucket of collected trace events. - */ - on(event: 'NodeTracing.dataCollected', listener: (message: InspectorNotification) => void): this; - /** - * Signals that tracing is stopped and there is no trace buffers pending flush, all data were - * delivered via dataCollected events. - */ - on(event: 'NodeTracing.tracingComplete', listener: () => void): this; - /** - * Issued when attached to a worker. - */ - on(event: 'NodeWorker.attachedToWorker', listener: (message: InspectorNotification) => void): this; - /** - * Issued when detached from the worker. - */ - on(event: 'NodeWorker.detachedFromWorker', listener: (message: InspectorNotification) => void): this; - /** - * Notifies about a new protocol message received from the session - * (session ID is provided in attachedToWorker notification). - */ - on(event: 'NodeWorker.receivedMessageFromWorker', listener: (message: InspectorNotification) => void): this; - /** - * This event is fired instead of `Runtime.executionContextDestroyed` when - * enabled. - * It is fired when the Node process finished all code execution and is - * waiting for all frontends to disconnect. - */ - on(event: 'NodeRuntime.waitingForDisconnect', listener: () => void): this; - once(event: string, listener: (...args: any[]) => void): this; - /** - * Emitted when any notification from the V8 Inspector is received. - */ - once(event: 'inspectorNotification', listener: (message: InspectorNotification<{}>) => void): this; - /** - * Issued when new execution context is created. - */ - once(event: 'Runtime.executionContextCreated', listener: (message: InspectorNotification) => void): this; - /** - * Issued when execution context is destroyed. - */ - once(event: 'Runtime.executionContextDestroyed', listener: (message: InspectorNotification) => void): this; - /** - * Issued when all executionContexts were cleared in browser - */ - once(event: 'Runtime.executionContextsCleared', listener: () => void): this; - /** - * Issued when exception was thrown and unhandled. - */ - once(event: 'Runtime.exceptionThrown', listener: (message: InspectorNotification) => void): this; - /** - * Issued when unhandled exception was revoked. - */ - once(event: 'Runtime.exceptionRevoked', listener: (message: InspectorNotification) => void): this; - /** - * Issued when console API was called. - */ - once(event: 'Runtime.consoleAPICalled', listener: (message: InspectorNotification) => void): this; - /** - * Issued when object should be inspected (for example, as a result of inspect() command line API call). - */ - once(event: 'Runtime.inspectRequested', listener: (message: InspectorNotification) => void): this; - /** - * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger. - */ - once(event: 'Debugger.scriptParsed', listener: (message: InspectorNotification) => void): this; - /** - * Fired when virtual machine fails to parse the script. - */ - once(event: 'Debugger.scriptFailedToParse', listener: (message: InspectorNotification) => void): this; - /** - * Fired when breakpoint is resolved to an actual script and location. - */ - once(event: 'Debugger.breakpointResolved', listener: (message: InspectorNotification) => void): this; - /** - * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. - */ - once(event: 'Debugger.paused', listener: (message: InspectorNotification) => void): this; - /** - * Fired when the virtual machine resumed execution. - */ - once(event: 'Debugger.resumed', listener: () => void): this; - /** - * Issued when new console message is added. - */ - once(event: 'Console.messageAdded', listener: (message: InspectorNotification) => void): this; - /** - * Sent when new profile recording is started using console.profile() call. - */ - once(event: 'Profiler.consoleProfileStarted', listener: (message: InspectorNotification) => void): this; - once(event: 'Profiler.consoleProfileFinished', listener: (message: InspectorNotification) => void): this; - once(event: 'HeapProfiler.addHeapSnapshotChunk', listener: (message: InspectorNotification) => void): this; - once(event: 'HeapProfiler.resetProfiles', listener: () => void): this; - once(event: 'HeapProfiler.reportHeapSnapshotProgress', listener: (message: InspectorNotification) => void): this; - /** - * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. - */ - once(event: 'HeapProfiler.lastSeenObjectId', listener: (message: InspectorNotification) => void): this; - /** - * If heap objects tracking has been started then backend may send update for one or more fragments - */ - once(event: 'HeapProfiler.heapStatsUpdate', listener: (message: InspectorNotification) => void): this; - /** - * Contains an bucket of collected trace events. - */ - once(event: 'NodeTracing.dataCollected', listener: (message: InspectorNotification) => void): this; - /** - * Signals that tracing is stopped and there is no trace buffers pending flush, all data were - * delivered via dataCollected events. - */ - once(event: 'NodeTracing.tracingComplete', listener: () => void): this; - /** - * Issued when attached to a worker. - */ - once(event: 'NodeWorker.attachedToWorker', listener: (message: InspectorNotification) => void): this; - /** - * Issued when detached from the worker. - */ - once(event: 'NodeWorker.detachedFromWorker', listener: (message: InspectorNotification) => void): this; - /** - * Notifies about a new protocol message received from the session - * (session ID is provided in attachedToWorker notification). - */ - once(event: 'NodeWorker.receivedMessageFromWorker', listener: (message: InspectorNotification) => void): this; - /** - * This event is fired instead of `Runtime.executionContextDestroyed` when - * enabled. - * It is fired when the Node process finished all code execution and is - * waiting for all frontends to disconnect. - */ - once(event: 'NodeRuntime.waitingForDisconnect', listener: () => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - /** - * Emitted when any notification from the V8 Inspector is received. - */ - prependListener(event: 'inspectorNotification', listener: (message: InspectorNotification<{}>) => void): this; - /** - * Issued when new execution context is created. - */ - prependListener(event: 'Runtime.executionContextCreated', listener: (message: InspectorNotification) => void): this; - /** - * Issued when execution context is destroyed. - */ - prependListener(event: 'Runtime.executionContextDestroyed', listener: (message: InspectorNotification) => void): this; - /** - * Issued when all executionContexts were cleared in browser - */ - prependListener(event: 'Runtime.executionContextsCleared', listener: () => void): this; - /** - * Issued when exception was thrown and unhandled. - */ - prependListener(event: 'Runtime.exceptionThrown', listener: (message: InspectorNotification) => void): this; - /** - * Issued when unhandled exception was revoked. - */ - prependListener(event: 'Runtime.exceptionRevoked', listener: (message: InspectorNotification) => void): this; - /** - * Issued when console API was called. - */ - prependListener(event: 'Runtime.consoleAPICalled', listener: (message: InspectorNotification) => void): this; - /** - * Issued when object should be inspected (for example, as a result of inspect() command line API call). - */ - prependListener(event: 'Runtime.inspectRequested', listener: (message: InspectorNotification) => void): this; - /** - * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger. - */ - prependListener(event: 'Debugger.scriptParsed', listener: (message: InspectorNotification) => void): this; - /** - * Fired when virtual machine fails to parse the script. - */ - prependListener(event: 'Debugger.scriptFailedToParse', listener: (message: InspectorNotification) => void): this; - /** - * Fired when breakpoint is resolved to an actual script and location. - */ - prependListener(event: 'Debugger.breakpointResolved', listener: (message: InspectorNotification) => void): this; - /** - * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. - */ - prependListener(event: 'Debugger.paused', listener: (message: InspectorNotification) => void): this; - /** - * Fired when the virtual machine resumed execution. - */ - prependListener(event: 'Debugger.resumed', listener: () => void): this; - /** - * Issued when new console message is added. - */ - prependListener(event: 'Console.messageAdded', listener: (message: InspectorNotification) => void): this; - /** - * Sent when new profile recording is started using console.profile() call. - */ - prependListener(event: 'Profiler.consoleProfileStarted', listener: (message: InspectorNotification) => void): this; - prependListener(event: 'Profiler.consoleProfileFinished', listener: (message: InspectorNotification) => void): this; - prependListener(event: 'HeapProfiler.addHeapSnapshotChunk', listener: (message: InspectorNotification) => void): this; - prependListener(event: 'HeapProfiler.resetProfiles', listener: () => void): this; - prependListener(event: 'HeapProfiler.reportHeapSnapshotProgress', listener: (message: InspectorNotification) => void): this; - /** - * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. - */ - prependListener(event: 'HeapProfiler.lastSeenObjectId', listener: (message: InspectorNotification) => void): this; - /** - * If heap objects tracking has been started then backend may send update for one or more fragments - */ - prependListener(event: 'HeapProfiler.heapStatsUpdate', listener: (message: InspectorNotification) => void): this; - /** - * Contains an bucket of collected trace events. - */ - prependListener(event: 'NodeTracing.dataCollected', listener: (message: InspectorNotification) => void): this; - /** - * Signals that tracing is stopped and there is no trace buffers pending flush, all data were - * delivered via dataCollected events. - */ - prependListener(event: 'NodeTracing.tracingComplete', listener: () => void): this; - /** - * Issued when attached to a worker. - */ - prependListener(event: 'NodeWorker.attachedToWorker', listener: (message: InspectorNotification) => void): this; - /** - * Issued when detached from the worker. - */ - prependListener(event: 'NodeWorker.detachedFromWorker', listener: (message: InspectorNotification) => void): this; - /** - * Notifies about a new protocol message received from the session - * (session ID is provided in attachedToWorker notification). - */ - prependListener(event: 'NodeWorker.receivedMessageFromWorker', listener: (message: InspectorNotification) => void): this; - /** - * This event is fired instead of `Runtime.executionContextDestroyed` when - * enabled. - * It is fired when the Node process finished all code execution and is - * waiting for all frontends to disconnect. - */ - prependListener(event: 'NodeRuntime.waitingForDisconnect', listener: () => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - /** - * Emitted when any notification from the V8 Inspector is received. - */ - prependOnceListener(event: 'inspectorNotification', listener: (message: InspectorNotification<{}>) => void): this; - /** - * Issued when new execution context is created. - */ - prependOnceListener(event: 'Runtime.executionContextCreated', listener: (message: InspectorNotification) => void): this; - /** - * Issued when execution context is destroyed. - */ - prependOnceListener(event: 'Runtime.executionContextDestroyed', listener: (message: InspectorNotification) => void): this; - /** - * Issued when all executionContexts were cleared in browser - */ - prependOnceListener(event: 'Runtime.executionContextsCleared', listener: () => void): this; - /** - * Issued when exception was thrown and unhandled. - */ - prependOnceListener(event: 'Runtime.exceptionThrown', listener: (message: InspectorNotification) => void): this; - /** - * Issued when unhandled exception was revoked. - */ - prependOnceListener(event: 'Runtime.exceptionRevoked', listener: (message: InspectorNotification) => void): this; - /** - * Issued when console API was called. - */ - prependOnceListener(event: 'Runtime.consoleAPICalled', listener: (message: InspectorNotification) => void): this; - /** - * Issued when object should be inspected (for example, as a result of inspect() command line API call). - */ - prependOnceListener(event: 'Runtime.inspectRequested', listener: (message: InspectorNotification) => void): this; - /** - * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger. - */ - prependOnceListener(event: 'Debugger.scriptParsed', listener: (message: InspectorNotification) => void): this; - /** - * Fired when virtual machine fails to parse the script. - */ - prependOnceListener(event: 'Debugger.scriptFailedToParse', listener: (message: InspectorNotification) => void): this; - /** - * Fired when breakpoint is resolved to an actual script and location. - */ - prependOnceListener(event: 'Debugger.breakpointResolved', listener: (message: InspectorNotification) => void): this; - /** - * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. - */ - prependOnceListener(event: 'Debugger.paused', listener: (message: InspectorNotification) => void): this; - /** - * Fired when the virtual machine resumed execution. - */ - prependOnceListener(event: 'Debugger.resumed', listener: () => void): this; - /** - * Issued when new console message is added. - */ - prependOnceListener(event: 'Console.messageAdded', listener: (message: InspectorNotification) => void): this; - /** - * Sent when new profile recording is started using console.profile() call. - */ - prependOnceListener(event: 'Profiler.consoleProfileStarted', listener: (message: InspectorNotification) => void): this; - prependOnceListener(event: 'Profiler.consoleProfileFinished', listener: (message: InspectorNotification) => void): this; - prependOnceListener(event: 'HeapProfiler.addHeapSnapshotChunk', listener: (message: InspectorNotification) => void): this; - prependOnceListener(event: 'HeapProfiler.resetProfiles', listener: () => void): this; - prependOnceListener(event: 'HeapProfiler.reportHeapSnapshotProgress', listener: (message: InspectorNotification) => void): this; - /** - * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. - */ - prependOnceListener(event: 'HeapProfiler.lastSeenObjectId', listener: (message: InspectorNotification) => void): this; - /** - * If heap objects tracking has been started then backend may send update for one or more fragments - */ - prependOnceListener(event: 'HeapProfiler.heapStatsUpdate', listener: (message: InspectorNotification) => void): this; - /** - * Contains an bucket of collected trace events. - */ - prependOnceListener(event: 'NodeTracing.dataCollected', listener: (message: InspectorNotification) => void): this; - /** - * Signals that tracing is stopped and there is no trace buffers pending flush, all data were - * delivered via dataCollected events. - */ - prependOnceListener(event: 'NodeTracing.tracingComplete', listener: () => void): this; - /** - * Issued when attached to a worker. - */ - prependOnceListener(event: 'NodeWorker.attachedToWorker', listener: (message: InspectorNotification) => void): this; - /** - * Issued when detached from the worker. - */ - prependOnceListener(event: 'NodeWorker.detachedFromWorker', listener: (message: InspectorNotification) => void): this; - /** - * Notifies about a new protocol message received from the session - * (session ID is provided in attachedToWorker notification). - */ - prependOnceListener(event: 'NodeWorker.receivedMessageFromWorker', listener: (message: InspectorNotification) => void): this; - /** - * This event is fired instead of `Runtime.executionContextDestroyed` when - * enabled. - * It is fired when the Node process finished all code execution and is - * waiting for all frontends to disconnect. - */ - prependOnceListener(event: 'NodeRuntime.waitingForDisconnect', listener: () => void): this; - } - /** - * Activate inspector on host and port. Equivalent to`node --inspect=[[host:]port]`, but can be done programmatically after node has - * started. - * - * If wait is `true`, will block until a client has connected to the inspect port - * and flow control has been passed to the debugger client. - * - * See the `security warning` regarding the `host`parameter usage. - * @param [port='what was specified on the CLI'] Port to listen on for inspector connections. Optional. - * @param [host='what was specified on the CLI'] Host to listen on for inspector connections. Optional. - * @param [wait=false] Block until a client has connected. Optional. - */ - function open(port?: number, host?: string, wait?: boolean): void; - /** - * Deactivate the inspector. Blocks until there are no active connections. - */ - function close(): void; - /** - * Return the URL of the active inspector, or `undefined` if there is none. - * - * ```console - * $ node --inspect -p 'inspector.url()' - * Debugger listening on ws://127.0.0.1:9229/166e272e-7a30-4d09-97ce-f1c012b43c34 - * For help, see: https://nodejs.org/en/docs/inspector - * ws://127.0.0.1:9229/166e272e-7a30-4d09-97ce-f1c012b43c34 - * - * $ node --inspect=localhost:3000 -p 'inspector.url()' - * Debugger listening on ws://localhost:3000/51cf8d0e-3c36-4c59-8efd-54519839e56a - * For help, see: https://nodejs.org/en/docs/inspector - * ws://localhost:3000/51cf8d0e-3c36-4c59-8efd-54519839e56a - * - * $ node -p 'inspector.url()' - * undefined - * ``` - */ - function url(): string | undefined; - /** - * Blocks until a client (existing or connected later) has sent`Runtime.runIfWaitingForDebugger` command. - * - * An exception will be thrown if there is no active inspector. - * @since v12.7.0 - */ - function waitForDebugger(): void; -} -/** - * The inspector module provides an API for interacting with the V8 inspector. - */ -declare module 'node:inspector' { - import inspector = require('inspector'); - export = inspector; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/module.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/module.d.ts deleted file mode 100755 index d83aec94..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/module.d.ts +++ /dev/null @@ -1,114 +0,0 @@ -/** - * @since v0.3.7 - */ -declare module 'module' { - import { URL } from 'node:url'; - namespace Module { - /** - * The `module.syncBuiltinESMExports()` method updates all the live bindings for - * builtin `ES Modules` to match the properties of the `CommonJS` exports. It - * does not add or remove exported names from the `ES Modules`. - * - * ```js - * const fs = require('fs'); - * const assert = require('assert'); - * const { syncBuiltinESMExports } = require('module'); - * - * fs.readFile = newAPI; - * - * delete fs.readFileSync; - * - * function newAPI() { - * // ... - * } - * - * fs.newAPI = newAPI; - * - * syncBuiltinESMExports(); - * - * import('fs').then((esmFS) => { - * // It syncs the existing readFile property with the new value - * assert.strictEqual(esmFS.readFile, newAPI); - * // readFileSync has been deleted from the required fs - * assert.strictEqual('readFileSync' in fs, false); - * // syncBuiltinESMExports() does not remove readFileSync from esmFS - * assert.strictEqual('readFileSync' in esmFS, true); - * // syncBuiltinESMExports() does not add names - * assert.strictEqual(esmFS.newAPI, undefined); - * }); - * ``` - * @since v12.12.0 - */ - function syncBuiltinESMExports(): void; - /** - * `path` is the resolved path for the file for which a corresponding source map - * should be fetched. - * @since v13.7.0, v12.17.0 - */ - function findSourceMap(path: string, error?: Error): SourceMap; - interface SourceMapPayload { - file: string; - version: number; - sources: string[]; - sourcesContent: string[]; - names: string[]; - mappings: string; - sourceRoot: string; - } - interface SourceMapping { - generatedLine: number; - generatedColumn: number; - originalSource: string; - originalLine: number; - originalColumn: number; - } - /** - * @since v13.7.0, v12.17.0 - */ - class SourceMap { - /** - * Getter for the payload used to construct the `SourceMap` instance. - */ - readonly payload: SourceMapPayload; - constructor(payload: SourceMapPayload); - /** - * Given a line number and column number in the generated source file, returns - * an object representing the position in the original file. The object returned - * consists of the following keys: - */ - findEntry(line: number, column: number): SourceMapping; - } - } - interface Module extends NodeModule {} - class Module { - static runMain(): void; - static wrap(code: string): string; - static createRequire(path: string | URL): NodeRequire; - static builtinModules: string[]; - static Module: typeof Module; - constructor(id: string, parent?: Module); - } - global { - interface ImportMeta { - url: string; - /** - * @experimental - * This feature is only available with the `--experimental-import-meta-resolve` - * command flag enabled. - * - * Provides a module-relative resolution function scoped to each module, returning - * the URL string. - * - * @param specified The module specifier to resolve relative to `parent`. - * @param parent The absolute parent module URL to resolve from. If none - * is specified, the value of `import.meta.url` is used as the default. - */ - resolve?(specified: string, parent?: string | URL): Promise; - } - } - export = Module; -} -declare module 'node:module' { - import module = require('module'); - export = module; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/net.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/net.d.ts deleted file mode 100755 index b7355383..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/net.d.ts +++ /dev/null @@ -1,869 +0,0 @@ -/** - * > Stability: 2 - Stable - * - * The `net` module provides an asynchronous network API for creating stream-based - * TCP or `IPC` servers ({@link createServer}) and clients - * ({@link createConnection}). - * - * It can be accessed using: - * - * ```js - * const net = require('net'); - * ``` - * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/net.js) - */ -declare module 'net' { - import * as stream from 'node:stream'; - import { Abortable, EventEmitter } from 'node:events'; - import * as dns from 'node:dns'; - type LookupFunction = (hostname: string, options: dns.LookupOneOptions, callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void) => void; - interface AddressInfo { - address: string; - family: string; - port: number; - } - interface SocketConstructorOpts { - fd?: number | undefined; - allowHalfOpen?: boolean | undefined; - readable?: boolean | undefined; - writable?: boolean | undefined; - signal?: AbortSignal; - } - interface OnReadOpts { - buffer: Uint8Array | (() => Uint8Array); - /** - * This function is called for every chunk of incoming data. - * Two arguments are passed to it: the number of bytes written to buffer and a reference to buffer. - * Return false from this function to implicitly pause() the socket. - */ - callback(bytesWritten: number, buf: Uint8Array): boolean; - } - interface ConnectOpts { - /** - * If specified, incoming data is stored in a single buffer and passed to the supplied callback when data arrives on the socket. - * Note: this will cause the streaming functionality to not provide any data, however events like 'error', 'end', and 'close' will - * still be emitted as normal and methods like pause() and resume() will also behave as expected. - */ - onread?: OnReadOpts | undefined; - } - interface TcpSocketConnectOpts extends ConnectOpts { - port: number; - host?: string | undefined; - localAddress?: string | undefined; - localPort?: number | undefined; - hints?: number | undefined; - family?: number | undefined; - lookup?: LookupFunction | undefined; - noDelay?: boolean | undefined; - keepAlive?: boolean | undefined; - keepAliveInitialDelay?: number | undefined; - } - interface IpcSocketConnectOpts extends ConnectOpts { - path: string; - } - type SocketConnectOpts = TcpSocketConnectOpts | IpcSocketConnectOpts; - type SocketReadyState = 'opening' | 'open' | 'readOnly' | 'writeOnly' | 'closed'; - /** - * This class is an abstraction of a TCP socket or a streaming `IPC` endpoint - * (uses named pipes on Windows, and Unix domain sockets otherwise). It is also - * an `EventEmitter`. - * - * A `net.Socket` can be created by the user and used directly to interact with - * a server. For example, it is returned by {@link createConnection}, - * so the user can use it to talk to the server. - * - * It can also be created by Node.js and passed to the user when a connection - * is received. For example, it is passed to the listeners of a `'connection'` event emitted on a {@link Server}, so the user can use - * it to interact with the client. - * @since v0.3.4 - */ - class Socket extends stream.Duplex { - constructor(options?: SocketConstructorOpts); - /** - * Sends data on the socket. The second parameter specifies the encoding in the - * case of a string. It defaults to UTF8 encoding. - * - * Returns `true` if the entire data was flushed successfully to the kernel - * buffer. Returns `false` if all or part of the data was queued in user memory.`'drain'` will be emitted when the buffer is again free. - * - * The optional `callback` parameter will be executed when the data is finally - * written out, which may not be immediately. - * - * See `Writable` stream `write()` method for more - * information. - * @since v0.1.90 - * @param [encoding='utf8'] Only used when data is `string`. - */ - write(buffer: Uint8Array | string, cb?: (err?: Error) => void): boolean; - write(str: Uint8Array | string, encoding?: BufferEncoding, cb?: (err?: Error) => void): boolean; - /** - * Initiate a connection on a given socket. - * - * Possible signatures: - * - * * `socket.connect(options[, connectListener])` - * * `socket.connect(path[, connectListener])` for `IPC` connections. - * * `socket.connect(port[, host][, connectListener])` for TCP connections. - * * Returns: `net.Socket` The socket itself. - * - * This function is asynchronous. When the connection is established, the `'connect'` event will be emitted. If there is a problem connecting, - * instead of a `'connect'` event, an `'error'` event will be emitted with - * the error passed to the `'error'` listener. - * The last parameter `connectListener`, if supplied, will be added as a listener - * for the `'connect'` event **once**. - * - * This function should only be used for reconnecting a socket after`'close'` has been emitted or otherwise it may lead to undefined - * behavior. - */ - connect(options: SocketConnectOpts, connectionListener?: () => void): this; - connect(port: number, host: string, connectionListener?: () => void): this; - connect(port: number, connectionListener?: () => void): this; - connect(path: string, connectionListener?: () => void): this; - /** - * Set the encoding for the socket as a `Readable Stream`. See `readable.setEncoding()` for more information. - * @since v0.1.90 - * @return The socket itself. - */ - setEncoding(encoding?: BufferEncoding): this; - /** - * Pauses the reading of data. That is, `'data'` events will not be emitted. - * Useful to throttle back an upload. - * @return The socket itself. - */ - pause(): this; - /** - * Close the TCP connection by sending an RST packet and destroy the stream. - * If this TCP socket is in connecting status, it will send an RST packet - * and destroy this TCP socket once it is connected. Otherwise, it will call - * `socket.destroy` with an `ERR_SOCKET_CLOSED` Error. If this is not a TCP socket - * (for example, a pipe), calling this method will immediately throw - * an `ERR_INVALID_HANDLE_TYPE` Error. - * @since v18.3.0 - * @return The socket itself. - */ - resetAndDestroy(): this; - /** - * Resumes reading after a call to `socket.pause()`. - * @return The socket itself. - */ - resume(): this; - /** - * Sets the socket to timeout after `timeout` milliseconds of inactivity on - * the socket. By default `net.Socket` do not have a timeout. - * - * When an idle timeout is triggered the socket will receive a `'timeout'` event but the connection will not be severed. The user must manually call `socket.end()` or `socket.destroy()` to - * end the connection. - * - * ```js - * socket.setTimeout(3000); - * socket.on('timeout', () => { - * console.log('socket timeout'); - * socket.end(); - * }); - * ``` - * - * If `timeout` is 0, then the existing idle timeout is disabled. - * - * The optional `callback` parameter will be added as a one-time listener for the `'timeout'` event. - * @since v0.1.90 - * @return The socket itself. - */ - setTimeout(timeout: number, callback?: () => void): this; - /** - * Enable/disable the use of Nagle's algorithm. - * - * When a TCP connection is created, it will have Nagle's algorithm enabled. - * - * Nagle's algorithm delays data before it is sent via the network. It attempts - * to optimize throughput at the expense of latency. - * - * Passing `true` for `noDelay` or not passing an argument will disable Nagle's - * algorithm for the socket. Passing `false` for `noDelay` will enable Nagle's - * algorithm. - * @since v0.1.90 - * @param [noDelay=true] - * @return The socket itself. - */ - setNoDelay(noDelay?: boolean): this; - /** - * Enable/disable keep-alive functionality, and optionally set the initial - * delay before the first keepalive probe is sent on an idle socket. - * - * Set `initialDelay` (in milliseconds) to set the delay between the last - * data packet received and the first keepalive probe. Setting `0` for`initialDelay` will leave the value unchanged from the default - * (or previous) setting. - * - * Enabling the keep-alive functionality will set the following socket options: - * - * * `SO_KEEPALIVE=1` - * * `TCP_KEEPIDLE=initialDelay` - * * `TCP_KEEPCNT=10` - * * `TCP_KEEPINTVL=1` - * @since v0.1.92 - * @param [enable=false] - * @param [initialDelay=0] - * @return The socket itself. - */ - setKeepAlive(enable?: boolean, initialDelay?: number): this; - /** - * Returns the bound `address`, the address `family` name and `port` of the - * socket as reported by the operating system:`{ port: 12346, family: 'IPv4', address: '127.0.0.1' }` - * @since v0.1.90 - */ - address(): AddressInfo | {}; - /** - * Calling `unref()` on a socket will allow the program to exit if this is the only - * active socket in the event system. If the socket is already `unref`ed calling`unref()` again will have no effect. - * @since v0.9.1 - * @return The socket itself. - */ - unref(): this; - /** - * Opposite of `unref()`, calling `ref()` on a previously `unref`ed socket will _not_ let the program exit if it's the only socket left (the default behavior). - * If the socket is `ref`ed calling `ref` again will have no effect. - * @since v0.9.1 - * @return The socket itself. - */ - ref(): this; - /** - * This property shows the number of characters buffered for writing. The buffer - * may contain strings whose length after encoding is not yet known. So this number - * is only an approximation of the number of bytes in the buffer. - * - * `net.Socket` has the property that `socket.write()` always works. This is to - * help users get up and running quickly. The computer cannot always keep up - * with the amount of data that is written to a socket. The network connection - * simply might be too slow. Node.js will internally queue up the data written to a - * socket and send it out over the wire when it is possible. - * - * The consequence of this internal buffering is that memory may grow. - * Users who experience large or growing `bufferSize` should attempt to - * "throttle" the data flows in their program with `socket.pause()` and `socket.resume()`. - * @since v0.3.8 - * @deprecated Since v14.6.0 - Use `writableLength` instead. - */ - readonly bufferSize: number; - /** - * The amount of received bytes. - * @since v0.5.3 - */ - readonly bytesRead: number; - /** - * The amount of bytes sent. - * @since v0.5.3 - */ - readonly bytesWritten: number; - /** - * If `true`,`socket.connect(options[, connectListener])` was - * called and has not yet finished. It will stay `true` until the socket becomes - * connected, then it is set to `false` and the `'connect'` event is emitted. Note - * that the `socket.connect(options[, connectListener])` callback is a listener for the `'connect'` event. - * @since v6.1.0 - */ - readonly connecting: boolean; - /** - * See `writable.destroyed` for further details. - */ - readonly destroyed: boolean; - /** - * The string representation of the local IP address the remote client is - * connecting on. For example, in a server listening on `'0.0.0.0'`, if a client - * connects on `'192.168.1.1'`, the value of `socket.localAddress` would be`'192.168.1.1'`. - * @since v0.9.6 - */ - readonly localAddress?: string; - /** - * The numeric representation of the local port. For example, `80` or `21`. - * @since v0.9.6 - */ - readonly localPort?: number; - /** - * The string representation of the local IP family. `'IPv4'` or `'IPv6'`. - * @since v18.8.0 - */ - readonly localFamily?: string; - /** - * This property represents the state of the connection as a string. - * @see {https://nodejs.org/api/net.html#socketreadystate} - * @since v0.5.0 - */ - readonly readyState: SocketReadyState; - /** - * The string representation of the remote IP address. For example,`'74.125.127.100'` or `'2001:4860:a005::68'`. Value may be `undefined` if - * the socket is destroyed (for example, if the client disconnected). - * @since v0.5.10 - */ - readonly remoteAddress?: string | undefined; - /** - * The string representation of the remote IP family. `'IPv4'` or `'IPv6'`. - * @since v0.11.14 - */ - readonly remoteFamily?: string | undefined; - /** - * The numeric representation of the remote port. For example, `80` or `21`. - * @since v0.5.10 - */ - readonly remotePort?: number | undefined; - /** - * The socket timeout in milliseconds as set by socket.setTimeout(). It is undefined if a timeout has not been set. - * @since v10.7.0 - */ - readonly timeout?: number | undefined; - /** - * Half-closes the socket. i.e., it sends a FIN packet. It is possible the - * server will still send some data. - * - * See `writable.end()` for further details. - * @since v0.1.90 - * @param [encoding='utf8'] Only used when data is `string`. - * @param callback Optional callback for when the socket is finished. - * @return The socket itself. - */ - end(callback?: () => void): this; - end(buffer: Uint8Array | string, callback?: () => void): this; - end(str: Uint8Array | string, encoding?: BufferEncoding, callback?: () => void): this; - /** - * events.EventEmitter - * 1. close - * 2. connect - * 3. data - * 4. drain - * 5. end - * 6. error - * 7. lookup - * 8. ready - * 9. timeout - */ - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: 'close', listener: (hadError: boolean) => void): this; - addListener(event: 'connect', listener: () => void): this; - addListener(event: 'data', listener: (data: Buffer) => void): this; - addListener(event: 'drain', listener: () => void): this; - addListener(event: 'end', listener: () => void): this; - addListener(event: 'error', listener: (err: Error) => void): this; - addListener(event: 'lookup', listener: (err: Error, address: string, family: string | number, host: string) => void): this; - addListener(event: 'ready', listener: () => void): this; - addListener(event: 'timeout', listener: () => void): this; - emit(event: string | symbol, ...args: any[]): boolean; - emit(event: 'close', hadError: boolean): boolean; - emit(event: 'connect'): boolean; - emit(event: 'data', data: Buffer): boolean; - emit(event: 'drain'): boolean; - emit(event: 'end'): boolean; - emit(event: 'error', err: Error): boolean; - emit(event: 'lookup', err: Error, address: string, family: string | number, host: string): boolean; - emit(event: 'ready'): boolean; - emit(event: 'timeout'): boolean; - on(event: string, listener: (...args: any[]) => void): this; - on(event: 'close', listener: (hadError: boolean) => void): this; - on(event: 'connect', listener: () => void): this; - on(event: 'data', listener: (data: Buffer) => void): this; - on(event: 'drain', listener: () => void): this; - on(event: 'end', listener: () => void): this; - on(event: 'error', listener: (err: Error) => void): this; - on(event: 'lookup', listener: (err: Error, address: string, family: string | number, host: string) => void): this; - on(event: 'ready', listener: () => void): this; - on(event: 'timeout', listener: () => void): this; - once(event: string, listener: (...args: any[]) => void): this; - once(event: 'close', listener: (hadError: boolean) => void): this; - once(event: 'connect', listener: () => void): this; - once(event: 'data', listener: (data: Buffer) => void): this; - once(event: 'drain', listener: () => void): this; - once(event: 'end', listener: () => void): this; - once(event: 'error', listener: (err: Error) => void): this; - once(event: 'lookup', listener: (err: Error, address: string, family: string | number, host: string) => void): this; - once(event: 'ready', listener: () => void): this; - once(event: 'timeout', listener: () => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: 'close', listener: (hadError: boolean) => void): this; - prependListener(event: 'connect', listener: () => void): this; - prependListener(event: 'data', listener: (data: Buffer) => void): this; - prependListener(event: 'drain', listener: () => void): this; - prependListener(event: 'end', listener: () => void): this; - prependListener(event: 'error', listener: (err: Error) => void): this; - prependListener(event: 'lookup', listener: (err: Error, address: string, family: string | number, host: string) => void): this; - prependListener(event: 'ready', listener: () => void): this; - prependListener(event: 'timeout', listener: () => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: 'close', listener: (hadError: boolean) => void): this; - prependOnceListener(event: 'connect', listener: () => void): this; - prependOnceListener(event: 'data', listener: (data: Buffer) => void): this; - prependOnceListener(event: 'drain', listener: () => void): this; - prependOnceListener(event: 'end', listener: () => void): this; - prependOnceListener(event: 'error', listener: (err: Error) => void): this; - prependOnceListener(event: 'lookup', listener: (err: Error, address: string, family: string | number, host: string) => void): this; - prependOnceListener(event: 'ready', listener: () => void): this; - prependOnceListener(event: 'timeout', listener: () => void): this; - } - interface ListenOptions extends Abortable { - port?: number | undefined; - host?: string | undefined; - backlog?: number | undefined; - path?: string | undefined; - exclusive?: boolean | undefined; - readableAll?: boolean | undefined; - writableAll?: boolean | undefined; - /** - * @default false - */ - ipv6Only?: boolean | undefined; - } - interface ServerOpts { - /** - * Indicates whether half-opened TCP connections are allowed. - * @default false - */ - allowHalfOpen?: boolean | undefined; - /** - * Indicates whether the socket should be paused on incoming connections. - * @default false - */ - pauseOnConnect?: boolean | undefined; - /** - * If set to `true`, it disables the use of Nagle's algorithm immediately after a new incoming connection is received. - * @default false - * @since v16.5.0 - */ - noDelay?: boolean | undefined; - /** - * If set to `true`, it enables keep-alive functionality on the socket immediately after a new incoming connection is received, - * similarly on what is done in `socket.setKeepAlive([enable][, initialDelay])`. - * @default false - * @since v16.5.0 - */ - keepAlive?: boolean | undefined; - /** - * If set to a positive number, it sets the initial delay before the first keepalive probe is sent on an idle socket. - * @default 0 - * @since v16.5.0 - */ - keepAliveInitialDelay?: number | undefined; - } - interface DropArgument { - localAddress?: string; - localPort?: number; - localFamily?: string; - remoteAddress?: string; - remotePort?: number; - remoteFamily?: string; - } - /** - * This class is used to create a TCP or `IPC` server. - * @since v0.1.90 - */ - class Server extends EventEmitter { - constructor(connectionListener?: (socket: Socket) => void); - constructor(options?: ServerOpts, connectionListener?: (socket: Socket) => void); - /** - * Start a server listening for connections. A `net.Server` can be a TCP or - * an `IPC` server depending on what it listens to. - * - * Possible signatures: - * - * * `server.listen(handle[, backlog][, callback])` - * * `server.listen(options[, callback])` - * * `server.listen(path[, backlog][, callback])` for `IPC` servers - * * `server.listen([port[, host[, backlog]]][, callback])` for TCP servers - * - * This function is asynchronous. When the server starts listening, the `'listening'` event will be emitted. The last parameter `callback`will be added as a listener for the `'listening'` - * event. - * - * All `listen()` methods can take a `backlog` parameter to specify the maximum - * length of the queue of pending connections. The actual length will be determined - * by the OS through sysctl settings such as `tcp_max_syn_backlog` and `somaxconn`on Linux. The default value of this parameter is 511 (not 512). - * - * All {@link Socket} are set to `SO_REUSEADDR` (see [`socket(7)`](https://man7.org/linux/man-pages/man7/socket.7.html) for - * details). - * - * The `server.listen()` method can be called again if and only if there was an - * error during the first `server.listen()` call or `server.close()` has been - * called. Otherwise, an `ERR_SERVER_ALREADY_LISTEN` error will be thrown. - * - * One of the most common errors raised when listening is `EADDRINUSE`. - * This happens when another server is already listening on the requested`port`/`path`/`handle`. One way to handle this would be to retry - * after a certain amount of time: - * - * ```js - * server.on('error', (e) => { - * if (e.code === 'EADDRINUSE') { - * console.log('Address in use, retrying...'); - * setTimeout(() => { - * server.close(); - * server.listen(PORT, HOST); - * }, 1000); - * } - * }); - * ``` - */ - listen(port?: number, hostname?: string, backlog?: number, listeningListener?: () => void): this; - listen(port?: number, hostname?: string, listeningListener?: () => void): this; - listen(port?: number, backlog?: number, listeningListener?: () => void): this; - listen(port?: number, listeningListener?: () => void): this; - listen(path: string, backlog?: number, listeningListener?: () => void): this; - listen(path: string, listeningListener?: () => void): this; - listen(options: ListenOptions, listeningListener?: () => void): this; - listen(handle: any, backlog?: number, listeningListener?: () => void): this; - listen(handle: any, listeningListener?: () => void): this; - /** - * Stops the server from accepting new connections and keeps existing - * connections. This function is asynchronous, the server is finally closed - * when all connections are ended and the server emits a `'close'` event. - * The optional `callback` will be called once the `'close'` event occurs. Unlike - * that event, it will be called with an `Error` as its only argument if the server - * was not open when it was closed. - * @since v0.1.90 - * @param callback Called when the server is closed. - */ - close(callback?: (err?: Error) => void): this; - /** - * Returns the bound `address`, the address `family` name, and `port` of the server - * as reported by the operating system if listening on an IP socket - * (useful to find which port was assigned when getting an OS-assigned address):`{ port: 12346, family: 'IPv4', address: '127.0.0.1' }`. - * - * For a server listening on a pipe or Unix domain socket, the name is returned - * as a string. - * - * ```js - * const server = net.createServer((socket) => { - * socket.end('goodbye\n'); - * }).on('error', (err) => { - * // Handle errors here. - * throw err; - * }); - * - * // Grab an arbitrary unused port. - * server.listen(() => { - * console.log('opened server on', server.address()); - * }); - * ``` - * - * `server.address()` returns `null` before the `'listening'` event has been - * emitted or after calling `server.close()`. - * @since v0.1.90 - */ - address(): AddressInfo | string | null; - /** - * Asynchronously get the number of concurrent connections on the server. Works - * when sockets were sent to forks. - * - * Callback should take two arguments `err` and `count`. - * @since v0.9.7 - */ - getConnections(cb: (error: Error | null, count: number) => void): void; - /** - * Opposite of `unref()`, calling `ref()` on a previously `unref`ed server will _not_ let the program exit if it's the only server left (the default behavior). - * If the server is `ref`ed calling `ref()` again will have no effect. - * @since v0.9.1 - */ - ref(): this; - /** - * Calling `unref()` on a server will allow the program to exit if this is the only - * active server in the event system. If the server is already `unref`ed calling`unref()` again will have no effect. - * @since v0.9.1 - */ - unref(): this; - /** - * Set this property to reject connections when the server's connection count gets - * high. - * - * It is not recommended to use this option once a socket has been sent to a child - * with `child_process.fork()`. - * @since v0.2.0 - */ - maxConnections: number; - connections: number; - /** - * Indicates whether or not the server is listening for connections. - * @since v5.7.0 - */ - listening: boolean; - /** - * events.EventEmitter - * 1. close - * 2. connection - * 3. error - * 4. listening - * 5. drop - */ - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: 'close', listener: () => void): this; - addListener(event: 'connection', listener: (socket: Socket) => void): this; - addListener(event: 'error', listener: (err: Error) => void): this; - addListener(event: 'listening', listener: () => void): this; - addListener(event: 'drop', listener: (data?: DropArgument) => void): this; - emit(event: string | symbol, ...args: any[]): boolean; - emit(event: 'close'): boolean; - emit(event: 'connection', socket: Socket): boolean; - emit(event: 'error', err: Error): boolean; - emit(event: 'listening'): boolean; - emit(event: 'drop', data?: DropArgument): boolean; - on(event: string, listener: (...args: any[]) => void): this; - on(event: 'close', listener: () => void): this; - on(event: 'connection', listener: (socket: Socket) => void): this; - on(event: 'error', listener: (err: Error) => void): this; - on(event: 'listening', listener: () => void): this; - on(event: 'drop', listener: (data?: DropArgument) => void): this; - once(event: string, listener: (...args: any[]) => void): this; - once(event: 'close', listener: () => void): this; - once(event: 'connection', listener: (socket: Socket) => void): this; - once(event: 'error', listener: (err: Error) => void): this; - once(event: 'listening', listener: () => void): this; - once(event: 'drop', listener: (data?: DropArgument) => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: 'close', listener: () => void): this; - prependListener(event: 'connection', listener: (socket: Socket) => void): this; - prependListener(event: 'error', listener: (err: Error) => void): this; - prependListener(event: 'listening', listener: () => void): this; - prependListener(event: 'drop', listener: (data?: DropArgument) => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: 'close', listener: () => void): this; - prependOnceListener(event: 'connection', listener: (socket: Socket) => void): this; - prependOnceListener(event: 'error', listener: (err: Error) => void): this; - prependOnceListener(event: 'listening', listener: () => void): this; - prependOnceListener(event: 'drop', listener: (data?: DropArgument) => void): this; - } - type IPVersion = 'ipv4' | 'ipv6'; - /** - * The `BlockList` object can be used with some network APIs to specify rules for - * disabling inbound or outbound access to specific IP addresses, IP ranges, or - * IP subnets. - * @since v15.0.0, v14.18.0 - */ - class BlockList { - /** - * Adds a rule to block the given IP address. - * @since v15.0.0, v14.18.0 - * @param address An IPv4 or IPv6 address. - * @param [type='ipv4'] Either `'ipv4'` or `'ipv6'`. - */ - addAddress(address: string, type?: IPVersion): void; - addAddress(address: SocketAddress): void; - /** - * Adds a rule to block a range of IP addresses from `start` (inclusive) to`end` (inclusive). - * @since v15.0.0, v14.18.0 - * @param start The starting IPv4 or IPv6 address in the range. - * @param end The ending IPv4 or IPv6 address in the range. - * @param [type='ipv4'] Either `'ipv4'` or `'ipv6'`. - */ - addRange(start: string, end: string, type?: IPVersion): void; - addRange(start: SocketAddress, end: SocketAddress): void; - /** - * Adds a rule to block a range of IP addresses specified as a subnet mask. - * @since v15.0.0, v14.18.0 - * @param net The network IPv4 or IPv6 address. - * @param prefix The number of CIDR prefix bits. For IPv4, this must be a value between `0` and `32`. For IPv6, this must be between `0` and `128`. - * @param [type='ipv4'] Either `'ipv4'` or `'ipv6'`. - */ - addSubnet(net: SocketAddress, prefix: number): void; - addSubnet(net: string, prefix: number, type?: IPVersion): void; - /** - * Returns `true` if the given IP address matches any of the rules added to the`BlockList`. - * - * ```js - * const blockList = new net.BlockList(); - * blockList.addAddress('123.123.123.123'); - * blockList.addRange('10.0.0.1', '10.0.0.10'); - * blockList.addSubnet('8592:757c:efae:4e45::', 64, 'ipv6'); - * - * console.log(blockList.check('123.123.123.123')); // Prints: true - * console.log(blockList.check('10.0.0.3')); // Prints: true - * console.log(blockList.check('222.111.111.222')); // Prints: false - * - * // IPv6 notation for IPv4 addresses works: - * console.log(blockList.check('::ffff:7b7b:7b7b', 'ipv6')); // Prints: true - * console.log(blockList.check('::ffff:123.123.123.123', 'ipv6')); // Prints: true - * ``` - * @since v15.0.0, v14.18.0 - * @param address The IP address to check - * @param [type='ipv4'] Either `'ipv4'` or `'ipv6'`. - */ - check(address: SocketAddress): boolean; - check(address: string, type?: IPVersion): boolean; - } - interface TcpNetConnectOpts extends TcpSocketConnectOpts, SocketConstructorOpts { - timeout?: number | undefined; - } - interface IpcNetConnectOpts extends IpcSocketConnectOpts, SocketConstructorOpts { - timeout?: number | undefined; - } - type NetConnectOpts = TcpNetConnectOpts | IpcNetConnectOpts; - /** - * Creates a new TCP or `IPC` server. - * - * If `allowHalfOpen` is set to `true`, when the other end of the socket - * signals the end of transmission, the server will only send back the end of - * transmission when `socket.end()` is explicitly called. For example, in the - * context of TCP, when a FIN packed is received, a FIN packed is sent - * back only when `socket.end()` is explicitly called. Until then the - * connection is half-closed (non-readable but still writable). See `'end'` event and [RFC 1122](https://tools.ietf.org/html/rfc1122) (section 4.2.2.13) for more information. - * - * If `pauseOnConnect` is set to `true`, then the socket associated with each - * incoming connection will be paused, and no data will be read from its handle. - * This allows connections to be passed between processes without any data being - * read by the original process. To begin reading data from a paused socket, call `socket.resume()`. - * - * The server can be a TCP server or an `IPC` server, depending on what it `listen()` to. - * - * Here is an example of a TCP echo server which listens for connections - * on port 8124: - * - * ```js - * const net = require('net'); - * const server = net.createServer((c) => { - * // 'connection' listener. - * console.log('client connected'); - * c.on('end', () => { - * console.log('client disconnected'); - * }); - * c.write('hello\r\n'); - * c.pipe(c); - * }); - * server.on('error', (err) => { - * throw err; - * }); - * server.listen(8124, () => { - * console.log('server bound'); - * }); - * ``` - * - * Test this by using `telnet`: - * - * ```console - * $ telnet localhost 8124 - * ``` - * - * To listen on the socket `/tmp/echo.sock`: - * - * ```js - * server.listen('/tmp/echo.sock', () => { - * console.log('server bound'); - * }); - * ``` - * - * Use `nc` to connect to a Unix domain socket server: - * - * ```console - * $ nc -U /tmp/echo.sock - * ``` - * @since v0.5.0 - * @param connectionListener Automatically set as a listener for the {@link 'connection'} event. - */ - function createServer(connectionListener?: (socket: Socket) => void): Server; - function createServer(options?: ServerOpts, connectionListener?: (socket: Socket) => void): Server; - /** - * Aliases to {@link createConnection}. - * - * Possible signatures: - * - * * {@link connect} - * * {@link connect} for `IPC` connections. - * * {@link connect} for TCP connections. - */ - function connect(options: NetConnectOpts, connectionListener?: () => void): Socket; - function connect(port: number, host?: string, connectionListener?: () => void): Socket; - function connect(path: string, connectionListener?: () => void): Socket; - /** - * A factory function, which creates a new {@link Socket}, - * immediately initiates connection with `socket.connect()`, - * then returns the `net.Socket` that starts the connection. - * - * When the connection is established, a `'connect'` event will be emitted - * on the returned socket. The last parameter `connectListener`, if supplied, - * will be added as a listener for the `'connect'` event **once**. - * - * Possible signatures: - * - * * {@link createConnection} - * * {@link createConnection} for `IPC` connections. - * * {@link createConnection} for TCP connections. - * - * The {@link connect} function is an alias to this function. - */ - function createConnection(options: NetConnectOpts, connectionListener?: () => void): Socket; - function createConnection(port: number, host?: string, connectionListener?: () => void): Socket; - function createConnection(path: string, connectionListener?: () => void): Socket; - /** - * Returns `6` if `input` is an IPv6 address. Returns `4` if `input` is an IPv4 - * address in [dot-decimal notation](https://en.wikipedia.org/wiki/Dot-decimal_notation) with no leading zeroes. Otherwise, returns`0`. - * - * ```js - * net.isIP('::1'); // returns 6 - * net.isIP('127.0.0.1'); // returns 4 - * net.isIP('127.000.000.001'); // returns 0 - * net.isIP('127.0.0.1/24'); // returns 0 - * net.isIP('fhqwhgads'); // returns 0 - * ``` - * @since v0.3.0 - */ - function isIP(input: string): number; - /** - * Returns `true` if `input` is an IPv4 address in [dot-decimal notation](https://en.wikipedia.org/wiki/Dot-decimal_notation) with no - * leading zeroes. Otherwise, returns `false`. - * - * ```js - * net.isIPv4('127.0.0.1'); // returns true - * net.isIPv4('127.000.000.001'); // returns false - * net.isIPv4('127.0.0.1/24'); // returns false - * net.isIPv4('fhqwhgads'); // returns false - * ``` - * @since v0.3.0 - */ - function isIPv4(input: string): boolean; - /** - * Returns `true` if `input` is an IPv6 address. Otherwise, returns `false`. - * - * ```js - * net.isIPv6('::1'); // returns true - * net.isIPv6('fhqwhgads'); // returns false - * ``` - * @since v0.3.0 - */ - function isIPv6(input: string): boolean; - interface SocketAddressInitOptions { - /** - * The network address as either an IPv4 or IPv6 string. - * @default 127.0.0.1 - */ - address?: string | undefined; - /** - * @default `'ipv4'` - */ - family?: IPVersion | undefined; - /** - * An IPv6 flow-label used only if `family` is `'ipv6'`. - * @default 0 - */ - flowlabel?: number | undefined; - /** - * An IP port. - * @default 0 - */ - port?: number | undefined; - } - /** - * @since v15.14.0, v14.18.0 - */ - class SocketAddress { - constructor(options: SocketAddressInitOptions); - /** - * @since v15.14.0, v14.18.0 - */ - readonly address: string; - /** - * Either \`'ipv4'\` or \`'ipv6'\`. - * @since v15.14.0, v14.18.0 - */ - readonly family: IPVersion; - /** - * @since v15.14.0, v14.18.0 - */ - readonly port: number; - /** - * @since v15.14.0, v14.18.0 - */ - readonly flowlabel: number; - } -} -declare module 'node:net' { - export * from 'net'; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/os.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/os.d.ts deleted file mode 100755 index 3c555992..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/os.d.ts +++ /dev/null @@ -1,466 +0,0 @@ -/** - * The `os` module provides operating system-related utility methods and - * properties. It can be accessed using: - * - * ```js - * const os = require('os'); - * ``` - * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/os.js) - */ -declare module 'os' { - interface CpuInfo { - model: string; - speed: number; - times: { - user: number; - nice: number; - sys: number; - idle: number; - irq: number; - }; - } - interface NetworkInterfaceBase { - address: string; - netmask: string; - mac: string; - internal: boolean; - cidr: string | null; - } - interface NetworkInterfaceInfoIPv4 extends NetworkInterfaceBase { - family: 'IPv4'; - scopeid?: undefined; - } - interface NetworkInterfaceInfoIPv6 extends NetworkInterfaceBase { - family: 'IPv6'; - scopeid: number; - } - interface UserInfo { - username: T; - uid: number; - gid: number; - shell: T; - homedir: T; - } - type NetworkInterfaceInfo = NetworkInterfaceInfoIPv4 | NetworkInterfaceInfoIPv6; - /** - * Returns the host name of the operating system as a string. - * @since v0.3.3 - */ - function hostname(): string; - /** - * Returns an array containing the 1, 5, and 15 minute load averages. - * - * The load average is a measure of system activity calculated by the operating - * system and expressed as a fractional number. - * - * The load average is a Unix-specific concept. On Windows, the return value is - * always `[0, 0, 0]`. - * @since v0.3.3 - */ - function loadavg(): number[]; - /** - * Returns the system uptime in number of seconds. - * @since v0.3.3 - */ - function uptime(): number; - /** - * Returns the amount of free system memory in bytes as an integer. - * @since v0.3.3 - */ - function freemem(): number; - /** - * Returns the total amount of system memory in bytes as an integer. - * @since v0.3.3 - */ - function totalmem(): number; - /** - * Returns an array of objects containing information about each logical CPU core. - * - * The properties included on each object include: - * - * ```js - * [ - * { - * model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz', - * speed: 2926, - * times: { - * user: 252020, - * nice: 0, - * sys: 30340, - * idle: 1070356870, - * irq: 0 - * } - * }, - * { - * model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz', - * speed: 2926, - * times: { - * user: 306960, - * nice: 0, - * sys: 26980, - * idle: 1071569080, - * irq: 0 - * } - * }, - * { - * model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz', - * speed: 2926, - * times: { - * user: 248450, - * nice: 0, - * sys: 21750, - * idle: 1070919370, - * irq: 0 - * } - * }, - * { - * model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz', - * speed: 2926, - * times: { - * user: 256880, - * nice: 0, - * sys: 19430, - * idle: 1070905480, - * irq: 20 - * } - * }, - * ] - * ``` - * - * `nice` values are POSIX-only. On Windows, the `nice` values of all processors - * are always 0. - * @since v0.3.3 - */ - function cpus(): CpuInfo[]; - /** - * Returns the operating system name as returned by [`uname(3)`](https://linux.die.net/man/3/uname). For example, it - * returns `'Linux'` on Linux, `'Darwin'` on macOS, and `'Windows_NT'` on Windows. - * - * See [https://en.wikipedia.org/wiki/Uname#Examples](https://en.wikipedia.org/wiki/Uname#Examples) for additional information - * about the output of running [`uname(3)`](https://linux.die.net/man/3/uname) on various operating systems. - * @since v0.3.3 - */ - function type(): string; - /** - * Returns the operating system as a string. - * - * On POSIX systems, the operating system release is determined by calling [`uname(3)`](https://linux.die.net/man/3/uname). On Windows, `GetVersionExW()` is used. See - * [https://en.wikipedia.org/wiki/Uname#Examples](https://en.wikipedia.org/wiki/Uname#Examples) for more information. - * @since v0.3.3 - */ - function release(): string; - /** - * Returns an object containing network interfaces that have been assigned a - * network address. - * - * Each key on the returned object identifies a network interface. The associated - * value is an array of objects that each describe an assigned network address. - * - * The properties available on the assigned network address object include: - * - * ```js - * { - * lo: [ - * { - * address: '127.0.0.1', - * netmask: '255.0.0.0', - * family: 'IPv4', - * mac: '00:00:00:00:00:00', - * internal: true, - * cidr: '127.0.0.1/8' - * }, - * { - * address: '::1', - * netmask: 'ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff', - * family: 'IPv6', - * mac: '00:00:00:00:00:00', - * scopeid: 0, - * internal: true, - * cidr: '::1/128' - * } - * ], - * eth0: [ - * { - * address: '192.168.1.108', - * netmask: '255.255.255.0', - * family: 'IPv4', - * mac: '01:02:03:0a:0b:0c', - * internal: false, - * cidr: '192.168.1.108/24' - * }, - * { - * address: 'fe80::a00:27ff:fe4e:66a1', - * netmask: 'ffff:ffff:ffff:ffff::', - * family: 'IPv6', - * mac: '01:02:03:0a:0b:0c', - * scopeid: 1, - * internal: false, - * cidr: 'fe80::a00:27ff:fe4e:66a1/64' - * } - * ] - * } - * ``` - * @since v0.6.0 - */ - function networkInterfaces(): NodeJS.Dict; - /** - * Returns the string path of the current user's home directory. - * - * On POSIX, it uses the `$HOME` environment variable if defined. Otherwise it - * uses the [effective UID](https://en.wikipedia.org/wiki/User_identifier#Effective_user_ID) to look up the user's home directory. - * - * On Windows, it uses the `USERPROFILE` environment variable if defined. - * Otherwise it uses the path to the profile directory of the current user. - * @since v2.3.0 - */ - function homedir(): string; - /** - * Returns information about the currently effective user. On POSIX platforms, - * this is typically a subset of the password file. The returned object includes - * the `username`, `uid`, `gid`, `shell`, and `homedir`. On Windows, the `uid` and`gid` fields are `-1`, and `shell` is `null`. - * - * The value of `homedir` returned by `os.userInfo()` is provided by the operating - * system. This differs from the result of `os.homedir()`, which queries - * environment variables for the home directory before falling back to the - * operating system response. - * - * Throws a `SystemError` if a user has no `username` or `homedir`. - * @since v6.0.0 - */ - function userInfo(options: { encoding: 'buffer' }): UserInfo; - function userInfo(options?: { encoding: BufferEncoding }): UserInfo; - type SignalConstants = { - [key in NodeJS.Signals]: number; - }; - namespace constants { - const UV_UDP_REUSEADDR: number; - namespace signals {} - const signals: SignalConstants; - namespace errno { - const E2BIG: number; - const EACCES: number; - const EADDRINUSE: number; - const EADDRNOTAVAIL: number; - const EAFNOSUPPORT: number; - const EAGAIN: number; - const EALREADY: number; - const EBADF: number; - const EBADMSG: number; - const EBUSY: number; - const ECANCELED: number; - const ECHILD: number; - const ECONNABORTED: number; - const ECONNREFUSED: number; - const ECONNRESET: number; - const EDEADLK: number; - const EDESTADDRREQ: number; - const EDOM: number; - const EDQUOT: number; - const EEXIST: number; - const EFAULT: number; - const EFBIG: number; - const EHOSTUNREACH: number; - const EIDRM: number; - const EILSEQ: number; - const EINPROGRESS: number; - const EINTR: number; - const EINVAL: number; - const EIO: number; - const EISCONN: number; - const EISDIR: number; - const ELOOP: number; - const EMFILE: number; - const EMLINK: number; - const EMSGSIZE: number; - const EMULTIHOP: number; - const ENAMETOOLONG: number; - const ENETDOWN: number; - const ENETRESET: number; - const ENETUNREACH: number; - const ENFILE: number; - const ENOBUFS: number; - const ENODATA: number; - const ENODEV: number; - const ENOENT: number; - const ENOEXEC: number; - const ENOLCK: number; - const ENOLINK: number; - const ENOMEM: number; - const ENOMSG: number; - const ENOPROTOOPT: number; - const ENOSPC: number; - const ENOSR: number; - const ENOSTR: number; - const ENOSYS: number; - const ENOTCONN: number; - const ENOTDIR: number; - const ENOTEMPTY: number; - const ENOTSOCK: number; - const ENOTSUP: number; - const ENOTTY: number; - const ENXIO: number; - const EOPNOTSUPP: number; - const EOVERFLOW: number; - const EPERM: number; - const EPIPE: number; - const EPROTO: number; - const EPROTONOSUPPORT: number; - const EPROTOTYPE: number; - const ERANGE: number; - const EROFS: number; - const ESPIPE: number; - const ESRCH: number; - const ESTALE: number; - const ETIME: number; - const ETIMEDOUT: number; - const ETXTBSY: number; - const EWOULDBLOCK: number; - const EXDEV: number; - const WSAEINTR: number; - const WSAEBADF: number; - const WSAEACCES: number; - const WSAEFAULT: number; - const WSAEINVAL: number; - const WSAEMFILE: number; - const WSAEWOULDBLOCK: number; - const WSAEINPROGRESS: number; - const WSAEALREADY: number; - const WSAENOTSOCK: number; - const WSAEDESTADDRREQ: number; - const WSAEMSGSIZE: number; - const WSAEPROTOTYPE: number; - const WSAENOPROTOOPT: number; - const WSAEPROTONOSUPPORT: number; - const WSAESOCKTNOSUPPORT: number; - const WSAEOPNOTSUPP: number; - const WSAEPFNOSUPPORT: number; - const WSAEAFNOSUPPORT: number; - const WSAEADDRINUSE: number; - const WSAEADDRNOTAVAIL: number; - const WSAENETDOWN: number; - const WSAENETUNREACH: number; - const WSAENETRESET: number; - const WSAECONNABORTED: number; - const WSAECONNRESET: number; - const WSAENOBUFS: number; - const WSAEISCONN: number; - const WSAENOTCONN: number; - const WSAESHUTDOWN: number; - const WSAETOOMANYREFS: number; - const WSAETIMEDOUT: number; - const WSAECONNREFUSED: number; - const WSAELOOP: number; - const WSAENAMETOOLONG: number; - const WSAEHOSTDOWN: number; - const WSAEHOSTUNREACH: number; - const WSAENOTEMPTY: number; - const WSAEPROCLIM: number; - const WSAEUSERS: number; - const WSAEDQUOT: number; - const WSAESTALE: number; - const WSAEREMOTE: number; - const WSASYSNOTREADY: number; - const WSAVERNOTSUPPORTED: number; - const WSANOTINITIALISED: number; - const WSAEDISCON: number; - const WSAENOMORE: number; - const WSAECANCELLED: number; - const WSAEINVALIDPROCTABLE: number; - const WSAEINVALIDPROVIDER: number; - const WSAEPROVIDERFAILEDINIT: number; - const WSASYSCALLFAILURE: number; - const WSASERVICE_NOT_FOUND: number; - const WSATYPE_NOT_FOUND: number; - const WSA_E_NO_MORE: number; - const WSA_E_CANCELLED: number; - const WSAEREFUSED: number; - } - namespace priority { - const PRIORITY_LOW: number; - const PRIORITY_BELOW_NORMAL: number; - const PRIORITY_NORMAL: number; - const PRIORITY_ABOVE_NORMAL: number; - const PRIORITY_HIGH: number; - const PRIORITY_HIGHEST: number; - } - } - const devNull: string; - const EOL: string; - /** - * Returns the operating system CPU architecture for which the Node.js binary was - * compiled. Possible values are `'arm'`, `'arm64'`, `'ia32'`, `'mips'`,`'mipsel'`, `'ppc'`, `'ppc64'`, `'s390'`, `'s390x'`, and `'x64'`. - * - * The return value is equivalent to `process.arch`. - * @since v0.5.0 - */ - function arch(): string; - /** - * Returns a string identifying the kernel version. - * - * On POSIX systems, the operating system release is determined by calling [`uname(3)`](https://linux.die.net/man/3/uname). On Windows, `RtlGetVersion()` is used, and if it is not - * available, `GetVersionExW()` will be used. See [https://en.wikipedia.org/wiki/Uname#Examples](https://en.wikipedia.org/wiki/Uname#Examples) for more information. - * @since v13.11.0, v12.17.0 - */ - function version(): string; - /** - * Returns a string identifying the operating system platform for which - * the Node.js binary was compiled. The value is set at compile time. - * Possible values are `'aix'`, `'darwin'`, `'freebsd'`,`'linux'`,`'openbsd'`, `'sunos'`, and `'win32'`. - * - * The return value is equivalent to `process.platform`. - * - * The value `'android'` may also be returned if Node.js is built on the Android - * operating system. [Android support is experimental](https://github.com/nodejs/node/blob/HEAD/BUILDING.md#androidandroid-based-devices-eg-firefox-os). - * @since v0.5.0 - */ - function platform(): NodeJS.Platform; - /** - * Returns the machine type as a string, such as arm, aarch64, mips, mips64, ppc64, ppc64le, s390, s390x, i386, i686, x86_64. - * - * On POSIX systems, the machine type is determined by calling [`uname(3)`](https://linux.die.net/man/3/uname). - * On Windows, `RtlGetVersion()` is used, and if it is not available, `GetVersionExW()` will be used. - * See [https://en.wikipedia.org/wiki/Uname#Examples](https://en.wikipedia.org/wiki/Uname#Examples) for more information. - * @since v18.9.0 - */ - function machine(): string; - /** - * Returns the operating system's default directory for temporary files as a - * string. - * @since v0.9.9 - */ - function tmpdir(): string; - /** - * Returns a string identifying the endianness of the CPU for which the Node.js - * binary was compiled. - * - * Possible values are `'BE'` for big endian and `'LE'` for little endian. - * @since v0.9.4 - */ - function endianness(): 'BE' | 'LE'; - /** - * Returns the scheduling priority for the process specified by `pid`. If `pid` is - * not provided or is `0`, the priority of the current process is returned. - * @since v10.10.0 - * @param [pid=0] The process ID to retrieve scheduling priority for. - */ - function getPriority(pid?: number): number; - /** - * Attempts to set the scheduling priority for the process specified by `pid`. If`pid` is not provided or is `0`, the process ID of the current process is used. - * - * The `priority` input must be an integer between `-20` (high priority) and `19`(low priority). Due to differences between Unix priority levels and Windows - * priority classes, `priority` is mapped to one of six priority constants in`os.constants.priority`. When retrieving a process priority level, this range - * mapping may cause the return value to be slightly different on Windows. To avoid - * confusion, set `priority` to one of the priority constants. - * - * On Windows, setting priority to `PRIORITY_HIGHEST` requires elevated user - * privileges. Otherwise the set priority will be silently reduced to`PRIORITY_HIGH`. - * @since v10.10.0 - * @param [pid=0] The process ID to set scheduling priority for. - * @param priority The scheduling priority to assign to the process. - */ - function setPriority(priority: number): void; - function setPriority(pid: number, priority: number): void; -} -declare module 'node:os' { - export * from 'os'; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/package.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/package.json deleted file mode 100755 index ea13d045..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/package.json +++ /dev/null @@ -1,232 +0,0 @@ -{ - "name": "@types/node", - "version": "18.11.9", - "description": "TypeScript definitions for Node.js", - "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node", - "license": "MIT", - "contributors": [ - { - "name": "Microsoft TypeScript", - "url": "https://github.com/Microsoft", - "githubUsername": "Microsoft" - }, - { - "name": "DefinitelyTyped", - "url": "https://github.com/DefinitelyTyped", - "githubUsername": "DefinitelyTyped" - }, - { - "name": "Alberto Schiabel", - "url": "https://github.com/jkomyno", - "githubUsername": "jkomyno" - }, - { - "name": "Alvis HT Tang", - "url": "https://github.com/alvis", - "githubUsername": "alvis" - }, - { - "name": "Andrew Makarov", - "url": "https://github.com/r3nya", - "githubUsername": "r3nya" - }, - { - "name": "Benjamin Toueg", - "url": "https://github.com/btoueg", - "githubUsername": "btoueg" - }, - { - "name": "Chigozirim C.", - "url": "https://github.com/smac89", - "githubUsername": "smac89" - }, - { - "name": "David Junger", - "url": "https://github.com/touffy", - "githubUsername": "touffy" - }, - { - "name": "Deividas Bakanas", - "url": "https://github.com/DeividasBakanas", - "githubUsername": "DeividasBakanas" - }, - { - "name": "Eugene Y. Q. Shen", - "url": "https://github.com/eyqs", - "githubUsername": "eyqs" - }, - { - "name": "Hannes Magnusson", - "url": "https://github.com/Hannes-Magnusson-CK", - "githubUsername": "Hannes-Magnusson-CK" - }, - { - "name": "Huw", - "url": "https://github.com/hoo29", - "githubUsername": "hoo29" - }, - { - "name": "Kelvin Jin", - "url": "https://github.com/kjin", - "githubUsername": "kjin" - }, - { - "name": "Klaus Meinhardt", - "url": "https://github.com/ajafff", - "githubUsername": "ajafff" - }, - { - "name": "Lishude", - "url": "https://github.com/islishude", - "githubUsername": "islishude" - }, - { - "name": "Mariusz Wiktorczyk", - "url": "https://github.com/mwiktorczyk", - "githubUsername": "mwiktorczyk" - }, - { - "name": "Mohsen Azimi", - "url": "https://github.com/mohsen1", - "githubUsername": "mohsen1" - }, - { - "name": "Nicolas Even", - "url": "https://github.com/n-e", - "githubUsername": "n-e" - }, - { - "name": "Nikita Galkin", - "url": "https://github.com/galkin", - "githubUsername": "galkin" - }, - { - "name": "Parambir Singh", - "url": "https://github.com/parambirs", - "githubUsername": "parambirs" - }, - { - "name": "Sebastian Silbermann", - "url": "https://github.com/eps1lon", - "githubUsername": "eps1lon" - }, - { - "name": "Simon Schick", - "url": "https://github.com/SimonSchick", - "githubUsername": "SimonSchick" - }, - { - "name": "Thomas den Hollander", - "url": "https://github.com/ThomasdenH", - "githubUsername": "ThomasdenH" - }, - { - "name": "Wilco Bakker", - "url": "https://github.com/WilcoBakker", - "githubUsername": "WilcoBakker" - }, - { - "name": "wwwy3y3", - "url": "https://github.com/wwwy3y3", - "githubUsername": "wwwy3y3" - }, - { - "name": "Samuel Ainsworth", - "url": "https://github.com/samuela", - "githubUsername": "samuela" - }, - { - "name": "Kyle Uehlein", - "url": "https://github.com/kuehlein", - "githubUsername": "kuehlein" - }, - { - "name": "Thanik Bhongbhibhat", - "url": "https://github.com/bhongy", - "githubUsername": "bhongy" - }, - { - "name": "Marcin Kopacz", - "url": "https://github.com/chyzwar", - "githubUsername": "chyzwar" - }, - { - "name": "Trivikram Kamat", - "url": "https://github.com/trivikr", - "githubUsername": "trivikr" - }, - { - "name": "Junxiao Shi", - "url": "https://github.com/yoursunny", - "githubUsername": "yoursunny" - }, - { - "name": "Ilia Baryshnikov", - "url": "https://github.com/qwelias", - "githubUsername": "qwelias" - }, - { - "name": "ExE Boss", - "url": "https://github.com/ExE-Boss", - "githubUsername": "ExE-Boss" - }, - { - "name": "Piotr Błażejewicz", - "url": "https://github.com/peterblazejewicz", - "githubUsername": "peterblazejewicz" - }, - { - "name": "Anna Henningsen", - "url": "https://github.com/addaleax", - "githubUsername": "addaleax" - }, - { - "name": "Victor Perin", - "url": "https://github.com/victorperin", - "githubUsername": "victorperin" - }, - { - "name": "Yongsheng Zhang", - "url": "https://github.com/ZYSzys", - "githubUsername": "ZYSzys" - }, - { - "name": "NodeJS Contributors", - "url": "https://github.com/NodeJS", - "githubUsername": "NodeJS" - }, - { - "name": "Linus Unnebäck", - "url": "https://github.com/LinusU", - "githubUsername": "LinusU" - }, - { - "name": "wafuwafu13", - "url": "https://github.com/wafuwafu13", - "githubUsername": "wafuwafu13" - }, - { - "name": "Matteo Collina", - "url": "https://github.com/mcollina", - "githubUsername": "mcollina" - } - ], - "main": "", - "types": "index.d.ts", - "typesVersions": { - "<4.9.0-0": { - "*": [ - "ts4.8/*" - ] - } - }, - "repository": { - "type": "git", - "url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git", - "directory": "types/node" - }, - "scripts": {}, - "dependencies": {}, - "typesPublisherContentHash": "c4994f0d5655c5ba44d4248f7f2765c3b1f8319a258377d18d73093af02d11b3", - "typeScriptVersion": "4.1" -} \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/path.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/path.d.ts deleted file mode 100755 index 1d33f792..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/path.d.ts +++ /dev/null @@ -1,191 +0,0 @@ -declare module 'path/posix' { - import path = require('path'); - export = path; -} -declare module 'path/win32' { - import path = require('path'); - export = path; -} -/** - * The `path` module provides utilities for working with file and directory paths. - * It can be accessed using: - * - * ```js - * const path = require('path'); - * ``` - * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/path.js) - */ -declare module 'path' { - namespace path { - /** - * A parsed path object generated by path.parse() or consumed by path.format(). - */ - interface ParsedPath { - /** - * The root of the path such as '/' or 'c:\' - */ - root: string; - /** - * The full directory path such as '/home/user/dir' or 'c:\path\dir' - */ - dir: string; - /** - * The file name including extension (if any) such as 'index.html' - */ - base: string; - /** - * The file extension (if any) such as '.html' - */ - ext: string; - /** - * The file name without extension (if any) such as 'index' - */ - name: string; - } - interface FormatInputPathObject { - /** - * The root of the path such as '/' or 'c:\' - */ - root?: string | undefined; - /** - * The full directory path such as '/home/user/dir' or 'c:\path\dir' - */ - dir?: string | undefined; - /** - * The file name including extension (if any) such as 'index.html' - */ - base?: string | undefined; - /** - * The file extension (if any) such as '.html' - */ - ext?: string | undefined; - /** - * The file name without extension (if any) such as 'index' - */ - name?: string | undefined; - } - interface PlatformPath { - /** - * Normalize a string path, reducing '..' and '.' parts. - * When multiple slashes are found, they're replaced by a single one; when the path contains a trailing slash, it is preserved. On Windows backslashes are used. - * - * @param path string path to normalize. - * @throws {TypeError} if `path` is not a string. - */ - normalize(path: string): string; - /** - * Join all arguments together and normalize the resulting path. - * - * @param paths paths to join. - * @throws {TypeError} if any of the path segments is not a string. - */ - join(...paths: string[]): string; - /** - * The right-most parameter is considered {to}. Other parameters are considered an array of {from}. - * - * Starting from leftmost {from} parameter, resolves {to} to an absolute path. - * - * If {to} isn't already absolute, {from} arguments are prepended in right to left order, - * until an absolute path is found. If after using all {from} paths still no absolute path is found, - * the current working directory is used as well. The resulting path is normalized, - * and trailing slashes are removed unless the path gets resolved to the root directory. - * - * @param paths A sequence of paths or path segments. - * @throws {TypeError} if any of the arguments is not a string. - */ - resolve(...paths: string[]): string; - /** - * Determines whether {path} is an absolute path. An absolute path will always resolve to the same location, regardless of the working directory. - * - * If the given {path} is a zero-length string, `false` will be returned. - * - * @param path path to test. - * @throws {TypeError} if `path` is not a string. - */ - isAbsolute(path: string): boolean; - /** - * Solve the relative path from {from} to {to} based on the current working directory. - * At times we have two absolute paths, and we need to derive the relative path from one to the other. This is actually the reverse transform of path.resolve. - * - * @throws {TypeError} if either `from` or `to` is not a string. - */ - relative(from: string, to: string): string; - /** - * Return the directory name of a path. Similar to the Unix dirname command. - * - * @param path the path to evaluate. - * @throws {TypeError} if `path` is not a string. - */ - dirname(path: string): string; - /** - * Return the last portion of a path. Similar to the Unix basename command. - * Often used to extract the file name from a fully qualified path. - * - * @param path the path to evaluate. - * @param suffix optionally, an extension to remove from the result. - * @throws {TypeError} if `path` is not a string or if `ext` is given and is not a string. - */ - basename(path: string, suffix?: string): string; - /** - * Return the extension of the path, from the last '.' to end of string in the last portion of the path. - * If there is no '.' in the last portion of the path or the first character of it is '.', then it returns an empty string. - * - * @param path the path to evaluate. - * @throws {TypeError} if `path` is not a string. - */ - extname(path: string): string; - /** - * The platform-specific file separator. '\\' or '/'. - */ - readonly sep: '\\' | '/'; - /** - * The platform-specific file delimiter. ';' or ':'. - */ - readonly delimiter: ';' | ':'; - /** - * Returns an object from a path string - the opposite of format(). - * - * @param path path to evaluate. - * @throws {TypeError} if `path` is not a string. - */ - parse(path: string): ParsedPath; - /** - * Returns a path string from an object - the opposite of parse(). - * - * @param pathObject path to evaluate. - */ - format(pathObject: FormatInputPathObject): string; - /** - * On Windows systems only, returns an equivalent namespace-prefixed path for the given path. - * If path is not a string, path will be returned without modifications. - * This method is meaningful only on Windows system. - * On POSIX systems, the method is non-operational and always returns path without modifications. - */ - toNamespacedPath(path: string): string; - /** - * Posix specific pathing. - * Same as parent object on posix. - */ - readonly posix: PlatformPath; - /** - * Windows specific pathing. - * Same as parent object on windows - */ - readonly win32: PlatformPath; - } - } - const path: path.PlatformPath; - export = path; -} -declare module 'node:path' { - import path = require('path'); - export = path; -} -declare module 'node:path/posix' { - import path = require('path/posix'); - export = path; -} -declare module 'node:path/win32' { - import path = require('path/win32'); - export = path; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/perf_hooks.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/perf_hooks.d.ts deleted file mode 100755 index 5c0b228e..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/perf_hooks.d.ts +++ /dev/null @@ -1,625 +0,0 @@ -/** - * This module provides an implementation of a subset of the W3C [Web Performance APIs](https://w3c.github.io/perf-timing-primer/) as well as additional APIs for - * Node.js-specific performance measurements. - * - * Node.js supports the following [Web Performance APIs](https://w3c.github.io/perf-timing-primer/): - * - * * [High Resolution Time](https://www.w3.org/TR/hr-time-2) - * * [Performance Timeline](https://w3c.github.io/performance-timeline/) - * * [User Timing](https://www.w3.org/TR/user-timing/) - * - * ```js - * const { PerformanceObserver, performance } = require('perf_hooks'); - * - * const obs = new PerformanceObserver((items) => { - * console.log(items.getEntries()[0].duration); - * performance.clearMarks(); - * }); - * obs.observe({ type: 'measure' }); - * performance.measure('Start to Now'); - * - * performance.mark('A'); - * doSomeLongRunningProcess(() => { - * performance.measure('A to Now', 'A'); - * - * performance.mark('B'); - * performance.measure('A to B', 'A', 'B'); - * }); - * ``` - * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/perf_hooks.js) - */ -declare module 'perf_hooks' { - import { AsyncResource } from 'node:async_hooks'; - type EntryType = 'node' | 'mark' | 'measure' | 'gc' | 'function' | 'http2' | 'http'; - interface NodeGCPerformanceDetail { - /** - * When `performanceEntry.entryType` is equal to 'gc', `the performance.kind` property identifies - * the type of garbage collection operation that occurred. - * See perf_hooks.constants for valid values. - */ - readonly kind?: number | undefined; - /** - * When `performanceEntry.entryType` is equal to 'gc', the `performance.flags` - * property contains additional information about garbage collection operation. - * See perf_hooks.constants for valid values. - */ - readonly flags?: number | undefined; - } - /** - * @since v8.5.0 - */ - class PerformanceEntry { - protected constructor(); - /** - * The total number of milliseconds elapsed for this entry. This value will not - * be meaningful for all Performance Entry types. - * @since v8.5.0 - */ - readonly duration: number; - /** - * The name of the performance entry. - * @since v8.5.0 - */ - readonly name: string; - /** - * The high resolution millisecond timestamp marking the starting time of the - * Performance Entry. - * @since v8.5.0 - */ - readonly startTime: number; - /** - * The type of the performance entry. It may be one of: - * - * * `'node'` (Node.js only) - * * `'mark'` (available on the Web) - * * `'measure'` (available on the Web) - * * `'gc'` (Node.js only) - * * `'function'` (Node.js only) - * * `'http2'` (Node.js only) - * * `'http'` (Node.js only) - * @since v8.5.0 - */ - readonly entryType: EntryType; - /** - * Additional detail specific to the `entryType`. - * @since v16.0.0 - */ - readonly detail?: NodeGCPerformanceDetail | unknown | undefined; // TODO: Narrow this based on entry type. - toJSON(): any; - } - class PerformanceMark extends PerformanceEntry { - readonly duration: 0; - readonly entryType: 'mark'; - } - class PerformanceMeasure extends PerformanceEntry { - readonly entryType: 'measure'; - } - /** - * _This property is an extension by Node.js. It is not available in Web browsers._ - * - * Provides timing details for Node.js itself. The constructor of this class - * is not exposed to users. - * @since v8.5.0 - */ - class PerformanceNodeTiming extends PerformanceEntry { - /** - * The high resolution millisecond timestamp at which the Node.js process - * completed bootstrapping. If bootstrapping has not yet finished, the property - * has the value of -1. - * @since v8.5.0 - */ - readonly bootstrapComplete: number; - /** - * The high resolution millisecond timestamp at which the Node.js environment was - * initialized. - * @since v8.5.0 - */ - readonly environment: number; - /** - * The high resolution millisecond timestamp of the amount of time the event loop - * has been idle within the event loop's event provider (e.g. `epoll_wait`). This - * does not take CPU usage into consideration. If the event loop has not yet - * started (e.g., in the first tick of the main script), the property has the - * value of 0. - * @since v14.10.0, v12.19.0 - */ - readonly idleTime: number; - /** - * The high resolution millisecond timestamp at which the Node.js event loop - * exited. If the event loop has not yet exited, the property has the value of -1\. - * It can only have a value of not -1 in a handler of the `'exit'` event. - * @since v8.5.0 - */ - readonly loopExit: number; - /** - * The high resolution millisecond timestamp at which the Node.js event loop - * started. If the event loop has not yet started (e.g., in the first tick of the - * main script), the property has the value of -1. - * @since v8.5.0 - */ - readonly loopStart: number; - /** - * The high resolution millisecond timestamp at which the V8 platform was - * initialized. - * @since v8.5.0 - */ - readonly v8Start: number; - } - interface EventLoopUtilization { - idle: number; - active: number; - utilization: number; - } - /** - * @param util1 The result of a previous call to eventLoopUtilization() - * @param util2 The result of a previous call to eventLoopUtilization() prior to util1 - */ - type EventLoopUtilityFunction = (util1?: EventLoopUtilization, util2?: EventLoopUtilization) => EventLoopUtilization; - interface MarkOptions { - /** - * Additional optional detail to include with the mark. - */ - detail?: unknown | undefined; - /** - * An optional timestamp to be used as the mark time. - * @default `performance.now()`. - */ - startTime?: number | undefined; - } - interface MeasureOptions { - /** - * Additional optional detail to include with the mark. - */ - detail?: unknown | undefined; - /** - * Duration between start and end times. - */ - duration?: number | undefined; - /** - * Timestamp to be used as the end time, or a string identifying a previously recorded mark. - */ - end?: number | string | undefined; - /** - * Timestamp to be used as the start time, or a string identifying a previously recorded mark. - */ - start?: number | string | undefined; - } - interface TimerifyOptions { - /** - * A histogram object created using - * `perf_hooks.createHistogram()` that will record runtime durations in - * nanoseconds. - */ - histogram?: RecordableHistogram | undefined; - } - interface Performance { - /** - * If name is not provided, removes all PerformanceMark objects from the Performance Timeline. - * If name is provided, removes only the named mark. - * @param name - */ - clearMarks(name?: string): void; - /** - * If name is not provided, removes all PerformanceMeasure objects from the Performance Timeline. - * If name is provided, removes only the named measure. - * @param name - * @since v16.7.0 - */ - clearMeasures(name?: string): void; - /** - * Returns a list of `PerformanceEntry` objects in chronological order with respect to `performanceEntry.startTime`. - * If you are only interested in performance entries of certain types or that have certain names, see - * `performance.getEntriesByType()` and `performance.getEntriesByName()`. - * @since v16.7.0 - */ - getEntries(): PerformanceEntry[]; - /** - * Returns a list of `PerformanceEntry` objects in chronological order with respect to `performanceEntry.startTime` - * whose `performanceEntry.name` is equal to `name`, and optionally, whose `performanceEntry.entryType` is equal to `type`. - * @param name - * @param type - * @since v16.7.0 - */ - getEntriesByName(name: string, type?: EntryType): PerformanceEntry[]; - /** - * Returns a list of `PerformanceEntry` objects in chronological order with respect to `performanceEntry.startTime` - * whose `performanceEntry.entryType` is equal to `type`. - * @param type - * @since v16.7.0 - */ - getEntriesByType(type: EntryType): PerformanceEntry[]; - /** - * Creates a new PerformanceMark entry in the Performance Timeline. - * A PerformanceMark is a subclass of PerformanceEntry whose performanceEntry.entryType is always 'mark', - * and whose performanceEntry.duration is always 0. - * Performance marks are used to mark specific significant moments in the Performance Timeline. - * @param name - * @return The PerformanceMark entry that was created - */ - mark(name?: string, options?: MarkOptions): PerformanceMark; - /** - * Creates a new PerformanceMeasure entry in the Performance Timeline. - * A PerformanceMeasure is a subclass of PerformanceEntry whose performanceEntry.entryType is always 'measure', - * and whose performanceEntry.duration measures the number of milliseconds elapsed since startMark and endMark. - * - * The startMark argument may identify any existing PerformanceMark in the the Performance Timeline, or may identify - * any of the timestamp properties provided by the PerformanceNodeTiming class. If the named startMark does not exist, - * then startMark is set to timeOrigin by default. - * - * The endMark argument must identify any existing PerformanceMark in the the Performance Timeline or any of the timestamp - * properties provided by the PerformanceNodeTiming class. If the named endMark does not exist, an error will be thrown. - * @param name - * @param startMark - * @param endMark - * @return The PerformanceMeasure entry that was created - */ - measure(name: string, startMark?: string, endMark?: string): PerformanceMeasure; - measure(name: string, options: MeasureOptions): PerformanceMeasure; - /** - * An instance of the PerformanceNodeTiming class that provides performance metrics for specific Node.js operational milestones. - */ - readonly nodeTiming: PerformanceNodeTiming; - /** - * @return the current high resolution millisecond timestamp - */ - now(): number; - /** - * The timeOrigin specifies the high resolution millisecond timestamp from which all performance metric durations are measured. - */ - readonly timeOrigin: number; - /** - * Wraps a function within a new function that measures the running time of the wrapped function. - * A PerformanceObserver must be subscribed to the 'function' event type in order for the timing details to be accessed. - * @param fn - */ - timerify any>(fn: T, options?: TimerifyOptions): T; - /** - * eventLoopUtilization is similar to CPU utilization except that it is calculated using high precision wall-clock time. - * It represents the percentage of time the event loop has spent outside the event loop's event provider (e.g. epoll_wait). - * No other CPU idle time is taken into consideration. - */ - eventLoopUtilization: EventLoopUtilityFunction; - } - interface PerformanceObserverEntryList { - /** - * Returns a list of `PerformanceEntry` objects in chronological order - * with respect to `performanceEntry.startTime`. - * - * ```js - * const { - * performance, - * PerformanceObserver - * } = require('perf_hooks'); - * - * const obs = new PerformanceObserver((perfObserverList, observer) => { - * console.log(perfObserverList.getEntries()); - * - * * [ - * * PerformanceEntry { - * * name: 'test', - * * entryType: 'mark', - * * startTime: 81.465639, - * * duration: 0 - * * }, - * * PerformanceEntry { - * * name: 'meow', - * * entryType: 'mark', - * * startTime: 81.860064, - * * duration: 0 - * * } - * * ] - * - * - * performance.clearMarks(); - * performance.clearMeasures(); - * observer.disconnect(); - * }); - * obs.observe({ type: 'mark' }); - * - * performance.mark('test'); - * performance.mark('meow'); - * ``` - * @since v8.5.0 - */ - getEntries(): PerformanceEntry[]; - /** - * Returns a list of `PerformanceEntry` objects in chronological order - * with respect to `performanceEntry.startTime` whose `performanceEntry.name` is - * equal to `name`, and optionally, whose `performanceEntry.entryType` is equal to`type`. - * - * ```js - * const { - * performance, - * PerformanceObserver - * } = require('perf_hooks'); - * - * const obs = new PerformanceObserver((perfObserverList, observer) => { - * console.log(perfObserverList.getEntriesByName('meow')); - * - * * [ - * * PerformanceEntry { - * * name: 'meow', - * * entryType: 'mark', - * * startTime: 98.545991, - * * duration: 0 - * * } - * * ] - * - * console.log(perfObserverList.getEntriesByName('nope')); // [] - * - * console.log(perfObserverList.getEntriesByName('test', 'mark')); - * - * * [ - * * PerformanceEntry { - * * name: 'test', - * * entryType: 'mark', - * * startTime: 63.518931, - * * duration: 0 - * * } - * * ] - * - * console.log(perfObserverList.getEntriesByName('test', 'measure')); // [] - * - * performance.clearMarks(); - * performance.clearMeasures(); - * observer.disconnect(); - * }); - * obs.observe({ entryTypes: ['mark', 'measure'] }); - * - * performance.mark('test'); - * performance.mark('meow'); - * ``` - * @since v8.5.0 - */ - getEntriesByName(name: string, type?: EntryType): PerformanceEntry[]; - /** - * Returns a list of `PerformanceEntry` objects in chronological order - * with respect to `performanceEntry.startTime` whose `performanceEntry.entryType`is equal to `type`. - * - * ```js - * const { - * performance, - * PerformanceObserver - * } = require('perf_hooks'); - * - * const obs = new PerformanceObserver((perfObserverList, observer) => { - * console.log(perfObserverList.getEntriesByType('mark')); - * - * * [ - * * PerformanceEntry { - * * name: 'test', - * * entryType: 'mark', - * * startTime: 55.897834, - * * duration: 0 - * * }, - * * PerformanceEntry { - * * name: 'meow', - * * entryType: 'mark', - * * startTime: 56.350146, - * * duration: 0 - * * } - * * ] - * - * performance.clearMarks(); - * performance.clearMeasures(); - * observer.disconnect(); - * }); - * obs.observe({ type: 'mark' }); - * - * performance.mark('test'); - * performance.mark('meow'); - * ``` - * @since v8.5.0 - */ - getEntriesByType(type: EntryType): PerformanceEntry[]; - } - type PerformanceObserverCallback = (list: PerformanceObserverEntryList, observer: PerformanceObserver) => void; - class PerformanceObserver extends AsyncResource { - constructor(callback: PerformanceObserverCallback); - /** - * Disconnects the `PerformanceObserver` instance from all notifications. - * @since v8.5.0 - */ - disconnect(): void; - /** - * Subscribes the `PerformanceObserver` instance to notifications of new `PerformanceEntry` instances identified either by `options.entryTypes`or `options.type`: - * - * ```js - * const { - * performance, - * PerformanceObserver - * } = require('perf_hooks'); - * - * const obs = new PerformanceObserver((list, observer) => { - * // Called once asynchronously. `list` contains three items. - * }); - * obs.observe({ type: 'mark' }); - * - * for (let n = 0; n < 3; n++) - * performance.mark(`test${n}`); - * ``` - * @since v8.5.0 - */ - observe( - options: - | { - entryTypes: ReadonlyArray; - buffered?: boolean | undefined; - } - | { - type: EntryType; - buffered?: boolean | undefined; - } - ): void; - } - namespace constants { - const NODE_PERFORMANCE_GC_MAJOR: number; - const NODE_PERFORMANCE_GC_MINOR: number; - const NODE_PERFORMANCE_GC_INCREMENTAL: number; - const NODE_PERFORMANCE_GC_WEAKCB: number; - const NODE_PERFORMANCE_GC_FLAGS_NO: number; - const NODE_PERFORMANCE_GC_FLAGS_CONSTRUCT_RETAINED: number; - const NODE_PERFORMANCE_GC_FLAGS_FORCED: number; - const NODE_PERFORMANCE_GC_FLAGS_SYNCHRONOUS_PHANTOM_PROCESSING: number; - const NODE_PERFORMANCE_GC_FLAGS_ALL_AVAILABLE_GARBAGE: number; - const NODE_PERFORMANCE_GC_FLAGS_ALL_EXTERNAL_MEMORY: number; - const NODE_PERFORMANCE_GC_FLAGS_SCHEDULE_IDLE: number; - } - const performance: Performance; - interface EventLoopMonitorOptions { - /** - * The sampling rate in milliseconds. - * Must be greater than zero. - * @default 10 - */ - resolution?: number | undefined; - } - interface Histogram { - /** - * Returns a `Map` object detailing the accumulated percentile distribution. - * @since v11.10.0 - */ - readonly percentiles: Map; - /** - * The number of times the event loop delay exceeded the maximum 1 hour event - * loop delay threshold. - * @since v11.10.0 - */ - readonly exceeds: number; - /** - * The minimum recorded event loop delay. - * @since v11.10.0 - */ - readonly min: number; - /** - * The maximum recorded event loop delay. - * @since v11.10.0 - */ - readonly max: number; - /** - * The mean of the recorded event loop delays. - * @since v11.10.0 - */ - readonly mean: number; - /** - * The standard deviation of the recorded event loop delays. - * @since v11.10.0 - */ - readonly stddev: number; - /** - * Resets the collected histogram data. - * @since v11.10.0 - */ - reset(): void; - /** - * Returns the value at the given percentile. - * @since v11.10.0 - * @param percentile A percentile value in the range (0, 100]. - */ - percentile(percentile: number): number; - } - interface IntervalHistogram extends Histogram { - /** - * Enables the update interval timer. Returns `true` if the timer was - * started, `false` if it was already started. - * @since v11.10.0 - */ - enable(): boolean; - /** - * Disables the update interval timer. Returns `true` if the timer was - * stopped, `false` if it was already stopped. - * @since v11.10.0 - */ - disable(): boolean; - } - interface RecordableHistogram extends Histogram { - /** - * @since v15.9.0, v14.18.0 - * @param val The amount to record in the histogram. - */ - record(val: number | bigint): void; - /** - * Calculates the amount of time (in nanoseconds) that has passed since the - * previous call to `recordDelta()` and records that amount in the histogram. - * - * ## Examples - * @since v15.9.0, v14.18.0 - */ - recordDelta(): void; - /** - * Adds the values from other to this histogram. - * @since v17.4.0, v16.14.0 - * @param other Recordable Histogram to combine with - */ - add(other: RecordableHistogram): void; - } - /** - * _This property is an extension by Node.js. It is not available in Web browsers._ - * - * Creates an `IntervalHistogram` object that samples and reports the event loop - * delay over time. The delays will be reported in nanoseconds. - * - * Using a timer to detect approximate event loop delay works because the - * execution of timers is tied specifically to the lifecycle of the libuv - * event loop. That is, a delay in the loop will cause a delay in the execution - * of the timer, and those delays are specifically what this API is intended to - * detect. - * - * ```js - * const { monitorEventLoopDelay } = require('perf_hooks'); - * const h = monitorEventLoopDelay({ resolution: 20 }); - * h.enable(); - * // Do something. - * h.disable(); - * console.log(h.min); - * console.log(h.max); - * console.log(h.mean); - * console.log(h.stddev); - * console.log(h.percentiles); - * console.log(h.percentile(50)); - * console.log(h.percentile(99)); - * ``` - * @since v11.10.0 - */ - function monitorEventLoopDelay(options?: EventLoopMonitorOptions): IntervalHistogram; - interface CreateHistogramOptions { - /** - * The minimum recordable value. Must be an integer value greater than 0. - * @default 1 - */ - min?: number | bigint | undefined; - /** - * The maximum recordable value. Must be an integer value greater than min. - * @default Number.MAX_SAFE_INTEGER - */ - max?: number | bigint | undefined; - /** - * The number of accuracy digits. Must be a number between 1 and 5. - * @default 3 - */ - figures?: number | undefined; - } - /** - * Returns a `RecordableHistogram`. - * @since v15.9.0, v14.18.0 - */ - function createHistogram(options?: CreateHistogramOptions): RecordableHistogram; - - import { performance as _performance } from 'perf_hooks'; - global { - /** - * `performance` is a global reference for `require('perf_hooks').performance` - * https://nodejs.org/api/globals.html#performance - * @since v16.0.0 - */ - var performance: typeof globalThis extends { - onmessage: any; - performance: infer T; - } - ? T - : typeof _performance; - } -} -declare module 'node:perf_hooks' { - export * from 'perf_hooks'; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/process.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/process.d.ts deleted file mode 100755 index 12148f91..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/process.d.ts +++ /dev/null @@ -1,1482 +0,0 @@ -declare module 'process' { - import * as tty from 'node:tty'; - import { Worker } from 'node:worker_threads'; - global { - var process: NodeJS.Process; - namespace NodeJS { - // this namespace merge is here because these are specifically used - // as the type for process.stdin, process.stdout, and process.stderr. - // they can't live in tty.d.ts because we need to disambiguate the imported name. - interface ReadStream extends tty.ReadStream {} - interface WriteStream extends tty.WriteStream {} - interface MemoryUsageFn { - /** - * The `process.memoryUsage()` method iterate over each page to gather informations about memory - * usage which can be slow depending on the program memory allocations. - */ - (): MemoryUsage; - /** - * method returns an integer representing the Resident Set Size (RSS) in bytes. - */ - rss(): number; - } - interface MemoryUsage { - rss: number; - heapTotal: number; - heapUsed: number; - external: number; - arrayBuffers: number; - } - interface CpuUsage { - user: number; - system: number; - } - interface ProcessRelease { - name: string; - sourceUrl?: string | undefined; - headersUrl?: string | undefined; - libUrl?: string | undefined; - lts?: string | undefined; - } - interface ProcessVersions extends Dict { - http_parser: string; - node: string; - v8: string; - ares: string; - uv: string; - zlib: string; - modules: string; - openssl: string; - } - type Platform = 'aix' | 'android' | 'darwin' | 'freebsd' | 'haiku' | 'linux' | 'openbsd' | 'sunos' | 'win32' | 'cygwin' | 'netbsd'; - type Architecture = 'arm' | 'arm64' | 'ia32' | 'mips' | 'mipsel' | 'ppc' | 'ppc64' | 's390' | 's390x' | 'x64'; - type Signals = - | 'SIGABRT' - | 'SIGALRM' - | 'SIGBUS' - | 'SIGCHLD' - | 'SIGCONT' - | 'SIGFPE' - | 'SIGHUP' - | 'SIGILL' - | 'SIGINT' - | 'SIGIO' - | 'SIGIOT' - | 'SIGKILL' - | 'SIGPIPE' - | 'SIGPOLL' - | 'SIGPROF' - | 'SIGPWR' - | 'SIGQUIT' - | 'SIGSEGV' - | 'SIGSTKFLT' - | 'SIGSTOP' - | 'SIGSYS' - | 'SIGTERM' - | 'SIGTRAP' - | 'SIGTSTP' - | 'SIGTTIN' - | 'SIGTTOU' - | 'SIGUNUSED' - | 'SIGURG' - | 'SIGUSR1' - | 'SIGUSR2' - | 'SIGVTALRM' - | 'SIGWINCH' - | 'SIGXCPU' - | 'SIGXFSZ' - | 'SIGBREAK' - | 'SIGLOST' - | 'SIGINFO'; - type UncaughtExceptionOrigin = 'uncaughtException' | 'unhandledRejection'; - type MultipleResolveType = 'resolve' | 'reject'; - type BeforeExitListener = (code: number) => void; - type DisconnectListener = () => void; - type ExitListener = (code: number) => void; - type RejectionHandledListener = (promise: Promise) => void; - type UncaughtExceptionListener = (error: Error, origin: UncaughtExceptionOrigin) => void; - /** - * Most of the time the unhandledRejection will be an Error, but this should not be relied upon - * as *anything* can be thrown/rejected, it is therefore unsafe to assume that the value is an Error. - */ - type UnhandledRejectionListener = (reason: unknown, promise: Promise) => void; - type WarningListener = (warning: Error) => void; - type MessageListener = (message: unknown, sendHandle: unknown) => void; - type SignalsListener = (signal: Signals) => void; - type MultipleResolveListener = (type: MultipleResolveType, promise: Promise, value: unknown) => void; - type WorkerListener = (worker: Worker) => void; - interface Socket extends ReadWriteStream { - isTTY?: true | undefined; - } - // Alias for compatibility - interface ProcessEnv extends Dict { - /** - * Can be used to change the default timezone at runtime - */ - TZ?: string; - } - interface HRTime { - (time?: [number, number]): [number, number]; - bigint(): bigint; - } - interface ProcessReport { - /** - * Directory where the report is written. - * working directory of the Node.js process. - * @default '' indicating that reports are written to the current - */ - directory: string; - /** - * Filename where the report is written. - * The default value is the empty string. - * @default '' the output filename will be comprised of a timestamp, - * PID, and sequence number. - */ - filename: string; - /** - * Returns a JSON-formatted diagnostic report for the running process. - * The report's JavaScript stack trace is taken from err, if present. - */ - getReport(err?: Error): string; - /** - * If true, a diagnostic report is generated on fatal errors, - * such as out of memory errors or failed C++ assertions. - * @default false - */ - reportOnFatalError: boolean; - /** - * If true, a diagnostic report is generated when the process - * receives the signal specified by process.report.signal. - * @default false - */ - reportOnSignal: boolean; - /** - * If true, a diagnostic report is generated on uncaught exception. - * @default false - */ - reportOnUncaughtException: boolean; - /** - * The signal used to trigger the creation of a diagnostic report. - * @default 'SIGUSR2' - */ - signal: Signals; - /** - * Writes a diagnostic report to a file. If filename is not provided, the default filename - * includes the date, time, PID, and a sequence number. - * The report's JavaScript stack trace is taken from err, if present. - * - * @param fileName Name of the file where the report is written. - * This should be a relative path, that will be appended to the directory specified in - * `process.report.directory`, or the current working directory of the Node.js process, - * if unspecified. - * @param error A custom error used for reporting the JavaScript stack. - * @return Filename of the generated report. - */ - writeReport(fileName?: string): string; - writeReport(error?: Error): string; - writeReport(fileName?: string, err?: Error): string; - } - interface ResourceUsage { - fsRead: number; - fsWrite: number; - involuntaryContextSwitches: number; - ipcReceived: number; - ipcSent: number; - majorPageFault: number; - maxRSS: number; - minorPageFault: number; - sharedMemorySize: number; - signalsCount: number; - swappedOut: number; - systemCPUTime: number; - unsharedDataSize: number; - unsharedStackSize: number; - userCPUTime: number; - voluntaryContextSwitches: number; - } - interface EmitWarningOptions { - /** - * When `warning` is a `string`, `type` is the name to use for the _type_ of warning being emitted. - * - * @default 'Warning' - */ - type?: string | undefined; - /** - * A unique identifier for the warning instance being emitted. - */ - code?: string | undefined; - /** - * When `warning` is a `string`, `ctor` is an optional function used to limit the generated stack trace. - * - * @default process.emitWarning - */ - ctor?: Function | undefined; - /** - * Additional text to include with the error. - */ - detail?: string | undefined; - } - interface ProcessConfig { - readonly target_defaults: { - readonly cflags: any[]; - readonly default_configuration: string; - readonly defines: string[]; - readonly include_dirs: string[]; - readonly libraries: string[]; - }; - readonly variables: { - readonly clang: number; - readonly host_arch: string; - readonly node_install_npm: boolean; - readonly node_install_waf: boolean; - readonly node_prefix: string; - readonly node_shared_openssl: boolean; - readonly node_shared_v8: boolean; - readonly node_shared_zlib: boolean; - readonly node_use_dtrace: boolean; - readonly node_use_etw: boolean; - readonly node_use_openssl: boolean; - readonly target_arch: string; - readonly v8_no_strict_aliasing: number; - readonly v8_use_snapshot: boolean; - readonly visibility: string; - }; - } - interface Process extends EventEmitter { - /** - * The `process.stdout` property returns a stream connected to`stdout` (fd `1`). It is a `net.Socket` (which is a `Duplex` stream) unless fd `1` refers to a file, in which case it is - * a `Writable` stream. - * - * For example, to copy `process.stdin` to `process.stdout`: - * - * ```js - * import { stdin, stdout } from 'process'; - * - * stdin.pipe(stdout); - * ``` - * - * `process.stdout` differs from other Node.js streams in important ways. See `note on process I/O` for more information. - */ - stdout: WriteStream & { - fd: 1; - }; - /** - * The `process.stderr` property returns a stream connected to`stderr` (fd `2`). It is a `net.Socket` (which is a `Duplex` stream) unless fd `2` refers to a file, in which case it is - * a `Writable` stream. - * - * `process.stderr` differs from other Node.js streams in important ways. See `note on process I/O` for more information. - */ - stderr: WriteStream & { - fd: 2; - }; - /** - * The `process.stdin` property returns a stream connected to`stdin` (fd `0`). It is a `net.Socket` (which is a `Duplex` stream) unless fd `0` refers to a file, in which case it is - * a `Readable` stream. - * - * For details of how to read from `stdin` see `readable.read()`. - * - * As a `Duplex` stream, `process.stdin` can also be used in "old" mode that - * is compatible with scripts written for Node.js prior to v0.10\. - * For more information see `Stream compatibility`. - * - * In "old" streams mode the `stdin` stream is paused by default, so one - * must call `process.stdin.resume()` to read from it. Note also that calling`process.stdin.resume()` itself would switch stream to "old" mode. - */ - stdin: ReadStream & { - fd: 0; - }; - openStdin(): Socket; - /** - * The `process.argv` property returns an array containing the command-line - * arguments passed when the Node.js process was launched. The first element will - * be {@link execPath}. See `process.argv0` if access to the original value - * of `argv[0]` is needed. The second element will be the path to the JavaScript - * file being executed. The remaining elements will be any additional command-line - * arguments. - * - * For example, assuming the following script for `process-args.js`: - * - * ```js - * import { argv } from 'process'; - * - * // print process.argv - * argv.forEach((val, index) => { - * console.log(`${index}: ${val}`); - * }); - * ``` - * - * Launching the Node.js process as: - * - * ```console - * $ node process-args.js one two=three four - * ``` - * - * Would generate the output: - * - * ```text - * 0: /usr/local/bin/node - * 1: /Users/mjr/work/node/process-args.js - * 2: one - * 3: two=three - * 4: four - * ``` - * @since v0.1.27 - */ - argv: string[]; - /** - * The `process.argv0` property stores a read-only copy of the original value of`argv[0]` passed when Node.js starts. - * - * ```console - * $ bash -c 'exec -a customArgv0 ./node' - * > process.argv[0] - * '/Volumes/code/external/node/out/Release/node' - * > process.argv0 - * 'customArgv0' - * ``` - * @since v6.4.0 - */ - argv0: string; - /** - * The `process.execArgv` property returns the set of Node.js-specific command-line - * options passed when the Node.js process was launched. These options do not - * appear in the array returned by the {@link argv} property, and do not - * include the Node.js executable, the name of the script, or any options following - * the script name. These options are useful in order to spawn child processes with - * the same execution environment as the parent. - * - * ```console - * $ node --harmony script.js --version - * ``` - * - * Results in `process.execArgv`: - * - * ```js - * ['--harmony'] - * ``` - * - * And `process.argv`: - * - * ```js - * ['/usr/local/bin/node', 'script.js', '--version'] - * ``` - * - * Refer to `Worker constructor` for the detailed behavior of worker - * threads with this property. - * @since v0.7.7 - */ - execArgv: string[]; - /** - * The `process.execPath` property returns the absolute pathname of the executable - * that started the Node.js process. Symbolic links, if any, are resolved. - * - * ```js - * '/usr/local/bin/node' - * ``` - * @since v0.1.100 - */ - execPath: string; - /** - * The `process.abort()` method causes the Node.js process to exit immediately and - * generate a core file. - * - * This feature is not available in `Worker` threads. - * @since v0.7.0 - */ - abort(): never; - /** - * The `process.chdir()` method changes the current working directory of the - * Node.js process or throws an exception if doing so fails (for instance, if - * the specified `directory` does not exist). - * - * ```js - * import { chdir, cwd } from 'process'; - * - * console.log(`Starting directory: ${cwd()}`); - * try { - * chdir('/tmp'); - * console.log(`New directory: ${cwd()}`); - * } catch (err) { - * console.error(`chdir: ${err}`); - * } - * ``` - * - * This feature is not available in `Worker` threads. - * @since v0.1.17 - */ - chdir(directory: string): void; - /** - * The `process.cwd()` method returns the current working directory of the Node.js - * process. - * - * ```js - * import { cwd } from 'process'; - * - * console.log(`Current directory: ${cwd()}`); - * ``` - * @since v0.1.8 - */ - cwd(): string; - /** - * The port used by the Node.js debugger when enabled. - * - * ```js - * import process from 'process'; - * - * process.debugPort = 5858; - * ``` - * @since v0.7.2 - */ - debugPort: number; - /** - * The `process.emitWarning()` method can be used to emit custom or application - * specific process warnings. These can be listened for by adding a handler to the `'warning'` event. - * - * ```js - * import { emitWarning } from 'process'; - * - * // Emit a warning with a code and additional detail. - * emitWarning('Something happened!', { - * code: 'MY_WARNING', - * detail: 'This is some additional information' - * }); - * // Emits: - * // (node:56338) [MY_WARNING] Warning: Something happened! - * // This is some additional information - * ``` - * - * In this example, an `Error` object is generated internally by`process.emitWarning()` and passed through to the `'warning'` handler. - * - * ```js - * import process from 'process'; - * - * process.on('warning', (warning) => { - * console.warn(warning.name); // 'Warning' - * console.warn(warning.message); // 'Something happened!' - * console.warn(warning.code); // 'MY_WARNING' - * console.warn(warning.stack); // Stack trace - * console.warn(warning.detail); // 'This is some additional information' - * }); - * ``` - * - * If `warning` is passed as an `Error` object, the `options` argument is ignored. - * @since v8.0.0 - * @param warning The warning to emit. - */ - emitWarning(warning: string | Error, ctor?: Function): void; - emitWarning(warning: string | Error, type?: string, ctor?: Function): void; - emitWarning(warning: string | Error, type?: string, code?: string, ctor?: Function): void; - emitWarning(warning: string | Error, options?: EmitWarningOptions): void; - /** - * The `process.env` property returns an object containing the user environment. - * See [`environ(7)`](http://man7.org/linux/man-pages/man7/environ.7.html). - * - * An example of this object looks like: - * - * ```js - * { - * TERM: 'xterm-256color', - * SHELL: '/usr/local/bin/bash', - * USER: 'maciej', - * PATH: '~/.bin/:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin', - * PWD: '/Users/maciej', - * EDITOR: 'vim', - * SHLVL: '1', - * HOME: '/Users/maciej', - * LOGNAME: 'maciej', - * _: '/usr/local/bin/node' - * } - * ``` - * - * It is possible to modify this object, but such modifications will not be - * reflected outside the Node.js process, or (unless explicitly requested) - * to other `Worker` threads. - * In other words, the following example would not work: - * - * ```console - * $ node -e 'process.env.foo = "bar"' && echo $foo - * ``` - * - * While the following will: - * - * ```js - * import { env } from 'process'; - * - * env.foo = 'bar'; - * console.log(env.foo); - * ``` - * - * Assigning a property on `process.env` will implicitly convert the value - * to a string. **This behavior is deprecated.** Future versions of Node.js may - * throw an error when the value is not a string, number, or boolean. - * - * ```js - * import { env } from 'process'; - * - * env.test = null; - * console.log(env.test); - * // => 'null' - * env.test = undefined; - * console.log(env.test); - * // => 'undefined' - * ``` - * - * Use `delete` to delete a property from `process.env`. - * - * ```js - * import { env } from 'process'; - * - * env.TEST = 1; - * delete env.TEST; - * console.log(env.TEST); - * // => undefined - * ``` - * - * On Windows operating systems, environment variables are case-insensitive. - * - * ```js - * import { env } from 'process'; - * - * env.TEST = 1; - * console.log(env.test); - * // => 1 - * ``` - * - * Unless explicitly specified when creating a `Worker` instance, - * each `Worker` thread has its own copy of `process.env`, based on its - * parent thread’s `process.env`, or whatever was specified as the `env` option - * to the `Worker` constructor. Changes to `process.env` will not be visible - * across `Worker` threads, and only the main thread can make changes that - * are visible to the operating system or to native add-ons. - * @since v0.1.27 - */ - env: ProcessEnv; - /** - * The `process.exit()` method instructs Node.js to terminate the process - * synchronously with an exit status of `code`. If `code` is omitted, exit uses - * either the 'success' code `0` or the value of `process.exitCode` if it has been - * set. Node.js will not terminate until all the `'exit'` event listeners are - * called. - * - * To exit with a 'failure' code: - * - * ```js - * import { exit } from 'process'; - * - * exit(1); - * ``` - * - * The shell that executed Node.js should see the exit code as `1`. - * - * Calling `process.exit()` will force the process to exit as quickly as possible - * even if there are still asynchronous operations pending that have not yet - * completed fully, including I/O operations to `process.stdout` and`process.stderr`. - * - * In most situations, it is not actually necessary to call `process.exit()`explicitly. The Node.js process will exit on its own _if there is no additional_ - * _work pending_ in the event loop. The `process.exitCode` property can be set to - * tell the process which exit code to use when the process exits gracefully. - * - * For instance, the following example illustrates a _misuse_ of the`process.exit()` method that could lead to data printed to stdout being - * truncated and lost: - * - * ```js - * import { exit } from 'process'; - * - * // This is an example of what *not* to do: - * if (someConditionNotMet()) { - * printUsageToStdout(); - * exit(1); - * } - * ``` - * - * The reason this is problematic is because writes to `process.stdout` in Node.js - * are sometimes _asynchronous_ and may occur over multiple ticks of the Node.js - * event loop. Calling `process.exit()`, however, forces the process to exit _before_ those additional writes to `stdout` can be performed. - * - * Rather than calling `process.exit()` directly, the code _should_ set the`process.exitCode` and allow the process to exit naturally by avoiding - * scheduling any additional work for the event loop: - * - * ```js - * import process from 'process'; - * - * // How to properly set the exit code while letting - * // the process exit gracefully. - * if (someConditionNotMet()) { - * printUsageToStdout(); - * process.exitCode = 1; - * } - * ``` - * - * If it is necessary to terminate the Node.js process due to an error condition, - * throwing an _uncaught_ error and allowing the process to terminate accordingly - * is safer than calling `process.exit()`. - * - * In `Worker` threads, this function stops the current thread rather - * than the current process. - * @since v0.1.13 - * @param [code=0] The exit code. - */ - exit(code?: number): never; - /** - * A number which will be the process exit code, when the process either - * exits gracefully, or is exited via {@link exit} without specifying - * a code. - * - * Specifying a code to {@link exit} will override any - * previous setting of `process.exitCode`. - * @since v0.11.8 - */ - exitCode?: number | undefined; - /** - * The `process.getgid()` method returns the numerical group identity of the - * process. (See [`getgid(2)`](http://man7.org/linux/man-pages/man2/getgid.2.html).) - * - * ```js - * import process from 'process'; - * - * if (process.getgid) { - * console.log(`Current gid: ${process.getgid()}`); - * } - * ``` - * - * This function is only available on POSIX platforms (i.e. not Windows or - * Android). - * @since v0.1.31 - */ - getgid?: () => number; - /** - * The `process.setgid()` method sets the group identity of the process. (See [`setgid(2)`](http://man7.org/linux/man-pages/man2/setgid.2.html).) The `id` can be passed as either a - * numeric ID or a group name - * string. If a group name is specified, this method blocks while resolving the - * associated numeric ID. - * - * ```js - * import process from 'process'; - * - * if (process.getgid && process.setgid) { - * console.log(`Current gid: ${process.getgid()}`); - * try { - * process.setgid(501); - * console.log(`New gid: ${process.getgid()}`); - * } catch (err) { - * console.log(`Failed to set gid: ${err}`); - * } - * } - * ``` - * - * This function is only available on POSIX platforms (i.e. not Windows or - * Android). - * This feature is not available in `Worker` threads. - * @since v0.1.31 - * @param id The group name or ID - */ - setgid?: (id: number | string) => void; - /** - * The `process.getuid()` method returns the numeric user identity of the process. - * (See [`getuid(2)`](http://man7.org/linux/man-pages/man2/getuid.2.html).) - * - * ```js - * import process from 'process'; - * - * if (process.getuid) { - * console.log(`Current uid: ${process.getuid()}`); - * } - * ``` - * - * This function is only available on POSIX platforms (i.e. not Windows or - * Android). - * @since v0.1.28 - */ - getuid?: () => number; - /** - * The `process.setuid(id)` method sets the user identity of the process. (See [`setuid(2)`](http://man7.org/linux/man-pages/man2/setuid.2.html).) The `id` can be passed as either a - * numeric ID or a username string. - * If a username is specified, the method blocks while resolving the associated - * numeric ID. - * - * ```js - * import process from 'process'; - * - * if (process.getuid && process.setuid) { - * console.log(`Current uid: ${process.getuid()}`); - * try { - * process.setuid(501); - * console.log(`New uid: ${process.getuid()}`); - * } catch (err) { - * console.log(`Failed to set uid: ${err}`); - * } - * } - * ``` - * - * This function is only available on POSIX platforms (i.e. not Windows or - * Android). - * This feature is not available in `Worker` threads. - * @since v0.1.28 - */ - setuid?: (id: number | string) => void; - /** - * The `process.geteuid()` method returns the numerical effective user identity of - * the process. (See [`geteuid(2)`](http://man7.org/linux/man-pages/man2/geteuid.2.html).) - * - * ```js - * import process from 'process'; - * - * if (process.geteuid) { - * console.log(`Current uid: ${process.geteuid()}`); - * } - * ``` - * - * This function is only available on POSIX platforms (i.e. not Windows or - * Android). - * @since v2.0.0 - */ - geteuid?: () => number; - /** - * The `process.seteuid()` method sets the effective user identity of the process. - * (See [`seteuid(2)`](http://man7.org/linux/man-pages/man2/seteuid.2.html).) The `id` can be passed as either a numeric ID or a username - * string. If a username is specified, the method blocks while resolving the - * associated numeric ID. - * - * ```js - * import process from 'process'; - * - * if (process.geteuid && process.seteuid) { - * console.log(`Current uid: ${process.geteuid()}`); - * try { - * process.seteuid(501); - * console.log(`New uid: ${process.geteuid()}`); - * } catch (err) { - * console.log(`Failed to set uid: ${err}`); - * } - * } - * ``` - * - * This function is only available on POSIX platforms (i.e. not Windows or - * Android). - * This feature is not available in `Worker` threads. - * @since v2.0.0 - * @param id A user name or ID - */ - seteuid?: (id: number | string) => void; - /** - * The `process.getegid()` method returns the numerical effective group identity - * of the Node.js process. (See [`getegid(2)`](http://man7.org/linux/man-pages/man2/getegid.2.html).) - * - * ```js - * import process from 'process'; - * - * if (process.getegid) { - * console.log(`Current gid: ${process.getegid()}`); - * } - * ``` - * - * This function is only available on POSIX platforms (i.e. not Windows or - * Android). - * @since v2.0.0 - */ - getegid?: () => number; - /** - * The `process.setegid()` method sets the effective group identity of the process. - * (See [`setegid(2)`](http://man7.org/linux/man-pages/man2/setegid.2.html).) The `id` can be passed as either a numeric ID or a group - * name string. If a group name is specified, this method blocks while resolving - * the associated a numeric ID. - * - * ```js - * import process from 'process'; - * - * if (process.getegid && process.setegid) { - * console.log(`Current gid: ${process.getegid()}`); - * try { - * process.setegid(501); - * console.log(`New gid: ${process.getegid()}`); - * } catch (err) { - * console.log(`Failed to set gid: ${err}`); - * } - * } - * ``` - * - * This function is only available on POSIX platforms (i.e. not Windows or - * Android). - * This feature is not available in `Worker` threads. - * @since v2.0.0 - * @param id A group name or ID - */ - setegid?: (id: number | string) => void; - /** - * The `process.getgroups()` method returns an array with the supplementary group - * IDs. POSIX leaves it unspecified if the effective group ID is included but - * Node.js ensures it always is. - * - * ```js - * import process from 'process'; - * - * if (process.getgroups) { - * console.log(process.getgroups()); // [ 16, 21, 297 ] - * } - * ``` - * - * This function is only available on POSIX platforms (i.e. not Windows or - * Android). - * @since v0.9.4 - */ - getgroups?: () => number[]; - /** - * The `process.setgroups()` method sets the supplementary group IDs for the - * Node.js process. This is a privileged operation that requires the Node.js - * process to have `root` or the `CAP_SETGID` capability. - * - * The `groups` array can contain numeric group IDs, group names, or both. - * - * ```js - * import process from 'process'; - * - * if (process.getgroups && process.setgroups) { - * try { - * process.setgroups([501]); - * console.log(process.getgroups()); // new groups - * } catch (err) { - * console.log(`Failed to set groups: ${err}`); - * } - * } - * ``` - * - * This function is only available on POSIX platforms (i.e. not Windows or - * Android). - * This feature is not available in `Worker` threads. - * @since v0.9.4 - */ - setgroups?: (groups: ReadonlyArray) => void; - /** - * The `process.setUncaughtExceptionCaptureCallback()` function sets a function - * that will be invoked when an uncaught exception occurs, which will receive the - * exception value itself as its first argument. - * - * If such a function is set, the `'uncaughtException'` event will - * not be emitted. If `--abort-on-uncaught-exception` was passed from the - * command line or set through `v8.setFlagsFromString()`, the process will - * not abort. Actions configured to take place on exceptions such as report - * generations will be affected too - * - * To unset the capture function,`process.setUncaughtExceptionCaptureCallback(null)` may be used. Calling this - * method with a non-`null` argument while another capture function is set will - * throw an error. - * - * Using this function is mutually exclusive with using the deprecated `domain` built-in module. - * @since v9.3.0 - */ - setUncaughtExceptionCaptureCallback(cb: ((err: Error) => void) | null): void; - /** - * Indicates whether a callback has been set using {@link setUncaughtExceptionCaptureCallback}. - * @since v9.3.0 - */ - hasUncaughtExceptionCaptureCallback(): boolean; - /** - * The `process.version` property contains the Node.js version string. - * - * ```js - * import { version } from 'process'; - * - * console.log(`Version: ${version}`); - * // Version: v14.8.0 - * ``` - * - * To get the version string without the prepended _v_, use`process.versions.node`. - * @since v0.1.3 - */ - readonly version: string; - /** - * The `process.versions` property returns an object listing the version strings of - * Node.js and its dependencies. `process.versions.modules` indicates the current - * ABI version, which is increased whenever a C++ API changes. Node.js will refuse - * to load modules that were compiled against a different module ABI version. - * - * ```js - * import { versions } from 'process'; - * - * console.log(versions); - * ``` - * - * Will generate an object similar to: - * - * ```console - * { node: '11.13.0', - * v8: '7.0.276.38-node.18', - * uv: '1.27.0', - * zlib: '1.2.11', - * brotli: '1.0.7', - * ares: '1.15.0', - * modules: '67', - * nghttp2: '1.34.0', - * napi: '4', - * llhttp: '1.1.1', - * openssl: '1.1.1b', - * cldr: '34.0', - * icu: '63.1', - * tz: '2018e', - * unicode: '11.0' } - * ``` - * @since v0.2.0 - */ - readonly versions: ProcessVersions; - /** - * The `process.config` property returns an `Object` containing the JavaScript - * representation of the configure options used to compile the current Node.js - * executable. This is the same as the `config.gypi` file that was produced when - * running the `./configure` script. - * - * An example of the possible output looks like: - * - * ```js - * { - * target_defaults: - * { cflags: [], - * default_configuration: 'Release', - * defines: [], - * include_dirs: [], - * libraries: [] }, - * variables: - * { - * host_arch: 'x64', - * napi_build_version: 5, - * node_install_npm: 'true', - * node_prefix: '', - * node_shared_cares: 'false', - * node_shared_http_parser: 'false', - * node_shared_libuv: 'false', - * node_shared_zlib: 'false', - * node_use_dtrace: 'false', - * node_use_openssl: 'true', - * node_shared_openssl: 'false', - * strict_aliasing: 'true', - * target_arch: 'x64', - * v8_use_snapshot: 1 - * } - * } - * ``` - * - * The `process.config` property is **not** read-only and there are existing - * modules in the ecosystem that are known to extend, modify, or entirely replace - * the value of `process.config`. - * - * Modifying the `process.config` property, or any child-property of the`process.config` object has been deprecated. The `process.config` will be made - * read-only in a future release. - * @since v0.7.7 - */ - readonly config: ProcessConfig; - /** - * The `process.kill()` method sends the `signal` to the process identified by`pid`. - * - * Signal names are strings such as `'SIGINT'` or `'SIGHUP'`. See `Signal Events` and [`kill(2)`](http://man7.org/linux/man-pages/man2/kill.2.html) for more information. - * - * This method will throw an error if the target `pid` does not exist. As a special - * case, a signal of `0` can be used to test for the existence of a process. - * Windows platforms will throw an error if the `pid` is used to kill a process - * group. - * - * Even though the name of this function is `process.kill()`, it is really just a - * signal sender, like the `kill` system call. The signal sent may do something - * other than kill the target process. - * - * ```js - * import process, { kill } from 'process'; - * - * process.on('SIGHUP', () => { - * console.log('Got SIGHUP signal.'); - * }); - * - * setTimeout(() => { - * console.log('Exiting.'); - * process.exit(0); - * }, 100); - * - * kill(process.pid, 'SIGHUP'); - * ``` - * - * When `SIGUSR1` is received by a Node.js process, Node.js will start the - * debugger. See `Signal Events`. - * @since v0.0.6 - * @param pid A process ID - * @param [signal='SIGTERM'] The signal to send, either as a string or number. - */ - kill(pid: number, signal?: string | number): true; - /** - * The `process.pid` property returns the PID of the process. - * - * ```js - * import { pid } from 'process'; - * - * console.log(`This process is pid ${pid}`); - * ``` - * @since v0.1.15 - */ - readonly pid: number; - /** - * The `process.ppid` property returns the PID of the parent of the - * current process. - * - * ```js - * import { ppid } from 'process'; - * - * console.log(`The parent process is pid ${ppid}`); - * ``` - * @since v9.2.0, v8.10.0, v6.13.0 - */ - readonly ppid: number; - /** - * The `process.title` property returns the current process title (i.e. returns - * the current value of `ps`). Assigning a new value to `process.title` modifies - * the current value of `ps`. - * - * When a new value is assigned, different platforms will impose different maximum - * length restrictions on the title. Usually such restrictions are quite limited. - * For instance, on Linux and macOS, `process.title` is limited to the size of the - * binary name plus the length of the command-line arguments because setting the`process.title` overwrites the `argv` memory of the process. Node.js v0.8 - * allowed for longer process title strings by also overwriting the `environ`memory but that was potentially insecure and confusing in some (rather obscure) - * cases. - * - * Assigning a value to `process.title` might not result in an accurate label - * within process manager applications such as macOS Activity Monitor or Windows - * Services Manager. - * @since v0.1.104 - */ - title: string; - /** - * The operating system CPU architecture for which the Node.js binary was compiled. - * Possible values are: `'arm'`, `'arm64'`, `'ia32'`, `'mips'`,`'mipsel'`, `'ppc'`,`'ppc64'`, `'s390'`, `'s390x'`, and `'x64'`. - * - * ```js - * import { arch } from 'process'; - * - * console.log(`This processor architecture is ${arch}`); - * ``` - * @since v0.5.0 - */ - readonly arch: Architecture; - /** - * The `process.platform` property returns a string identifying the operating - * system platform for which the Node.js binary was compiled. - * - * Currently possible values are: - * - * * `'aix'` - * * `'darwin'` - * * `'freebsd'` - * * `'linux'` - * * `'openbsd'` - * * `'sunos'` - * * `'win32'` - * - * ```js - * import { platform } from 'process'; - * - * console.log(`This platform is ${platform}`); - * ``` - * - * The value `'android'` may also be returned if the Node.js is built on the - * Android operating system. However, Android support in Node.js [is experimental](https://github.com/nodejs/node/blob/HEAD/BUILDING.md#androidandroid-based-devices-eg-firefox-os). - * @since v0.1.16 - */ - readonly platform: Platform; - /** - * The `process.mainModule` property provides an alternative way of retrieving `require.main`. The difference is that if the main module changes at - * runtime, `require.main` may still refer to the original main module in - * modules that were required before the change occurred. Generally, it's - * safe to assume that the two refer to the same module. - * - * As with `require.main`, `process.mainModule` will be `undefined` if there - * is no entry script. - * @since v0.1.17 - * @deprecated Since v14.0.0 - Use `main` instead. - */ - mainModule?: Module | undefined; - memoryUsage: MemoryUsageFn; - /** - * The `process.cpuUsage()` method returns the user and system CPU time usage of - * the current process, in an object with properties `user` and `system`, whose - * values are microsecond values (millionth of a second). These values measure time - * spent in user and system code respectively, and may end up being greater than - * actual elapsed time if multiple CPU cores are performing work for this process. - * - * The result of a previous call to `process.cpuUsage()` can be passed as the - * argument to the function, to get a diff reading. - * - * ```js - * import { cpuUsage } from 'process'; - * - * const startUsage = cpuUsage(); - * // { user: 38579, system: 6986 } - * - * // spin the CPU for 500 milliseconds - * const now = Date.now(); - * while (Date.now() - now < 500); - * - * console.log(cpuUsage(startUsage)); - * // { user: 514883, system: 11226 } - * ``` - * @since v6.1.0 - * @param previousValue A previous return value from calling `process.cpuUsage()` - */ - cpuUsage(previousValue?: CpuUsage): CpuUsage; - /** - * `process.nextTick()` adds `callback` to the "next tick queue". This queue is - * fully drained after the current operation on the JavaScript stack runs to - * completion and before the event loop is allowed to continue. It's possible to - * create an infinite loop if one were to recursively call `process.nextTick()`. - * See the [Event Loop](https://nodejs.org/en/docs/guides/event-loop-timers-and-nexttick/#process-nexttick) guide for more background. - * - * ```js - * import { nextTick } from 'process'; - * - * console.log('start'); - * nextTick(() => { - * console.log('nextTick callback'); - * }); - * console.log('scheduled'); - * // Output: - * // start - * // scheduled - * // nextTick callback - * ``` - * - * This is important when developing APIs in order to give users the opportunity - * to assign event handlers _after_ an object has been constructed but before any - * I/O has occurred: - * - * ```js - * import { nextTick } from 'process'; - * - * function MyThing(options) { - * this.setupOptions(options); - * - * nextTick(() => { - * this.startDoingStuff(); - * }); - * } - * - * const thing = new MyThing(); - * thing.getReadyForStuff(); - * - * // thing.startDoingStuff() gets called now, not before. - * ``` - * - * It is very important for APIs to be either 100% synchronous or 100% - * asynchronous. Consider this example: - * - * ```js - * // WARNING! DO NOT USE! BAD UNSAFE HAZARD! - * function maybeSync(arg, cb) { - * if (arg) { - * cb(); - * return; - * } - * - * fs.stat('file', cb); - * } - * ``` - * - * This API is hazardous because in the following case: - * - * ```js - * const maybeTrue = Math.random() > 0.5; - * - * maybeSync(maybeTrue, () => { - * foo(); - * }); - * - * bar(); - * ``` - * - * It is not clear whether `foo()` or `bar()` will be called first. - * - * The following approach is much better: - * - * ```js - * import { nextTick } from 'process'; - * - * function definitelyAsync(arg, cb) { - * if (arg) { - * nextTick(cb); - * return; - * } - * - * fs.stat('file', cb); - * } - * ``` - * @since v0.1.26 - * @param args Additional arguments to pass when invoking the `callback` - */ - nextTick(callback: Function, ...args: any[]): void; - /** - * The `process.release` property returns an `Object` containing metadata related - * to the current release, including URLs for the source tarball and headers-only - * tarball. - * - * `process.release` contains the following properties: - * - * ```js - * { - * name: 'node', - * lts: 'Erbium', - * sourceUrl: 'https://nodejs.org/download/release/v12.18.1/node-v12.18.1.tar.gz', - * headersUrl: 'https://nodejs.org/download/release/v12.18.1/node-v12.18.1-headers.tar.gz', - * libUrl: 'https://nodejs.org/download/release/v12.18.1/win-x64/node.lib' - * } - * ``` - * - * In custom builds from non-release versions of the source tree, only the`name` property may be present. The additional properties should not be - * relied upon to exist. - * @since v3.0.0 - */ - readonly release: ProcessRelease; - features: { - inspector: boolean; - debug: boolean; - uv: boolean; - ipv6: boolean; - tls_alpn: boolean; - tls_sni: boolean; - tls_ocsp: boolean; - tls: boolean; - }; - /** - * `process.umask()` returns the Node.js process's file mode creation mask. Child - * processes inherit the mask from the parent process. - * @since v0.1.19 - * @deprecated Calling `process.umask()` with no argument causes the process-wide umask to be written twice. This introduces a race condition between threads, and is a potential * - * security vulnerability. There is no safe, cross-platform alternative API. - */ - umask(): number; - /** - * Can only be set if not in worker thread. - */ - umask(mask: string | number): number; - /** - * The `process.uptime()` method returns the number of seconds the current Node.js - * process has been running. - * - * The return value includes fractions of a second. Use `Math.floor()` to get whole - * seconds. - * @since v0.5.0 - */ - uptime(): number; - hrtime: HRTime; - /** - * If Node.js is spawned with an IPC channel, the `process.send()` method can be - * used to send messages to the parent process. Messages will be received as a `'message'` event on the parent's `ChildProcess` object. - * - * If Node.js was not spawned with an IPC channel, `process.send` will be`undefined`. - * - * The message goes through serialization and parsing. The resulting message might - * not be the same as what is originally sent. - * @since v0.5.9 - * @param options used to parameterize the sending of certain types of handles.`options` supports the following properties: - */ - send?( - message: any, - sendHandle?: any, - options?: { - swallowErrors?: boolean | undefined; - }, - callback?: (error: Error | null) => void - ): boolean; - /** - * If the Node.js process is spawned with an IPC channel (see the `Child Process` and `Cluster` documentation), the `process.disconnect()` method will close the - * IPC channel to the parent process, allowing the child process to exit gracefully - * once there are no other connections keeping it alive. - * - * The effect of calling `process.disconnect()` is the same as calling `ChildProcess.disconnect()` from the parent process. - * - * If the Node.js process was not spawned with an IPC channel,`process.disconnect()` will be `undefined`. - * @since v0.7.2 - */ - disconnect(): void; - /** - * If the Node.js process is spawned with an IPC channel (see the `Child Process` and `Cluster` documentation), the `process.connected` property will return`true` so long as the IPC - * channel is connected and will return `false` after`process.disconnect()` is called. - * - * Once `process.connected` is `false`, it is no longer possible to send messages - * over the IPC channel using `process.send()`. - * @since v0.7.2 - */ - connected: boolean; - /** - * The `process.allowedNodeEnvironmentFlags` property is a special, - * read-only `Set` of flags allowable within the `NODE_OPTIONS` environment variable. - * - * `process.allowedNodeEnvironmentFlags` extends `Set`, but overrides`Set.prototype.has` to recognize several different possible flag - * representations. `process.allowedNodeEnvironmentFlags.has()` will - * return `true` in the following cases: - * - * * Flags may omit leading single (`-`) or double (`--`) dashes; e.g.,`inspect-brk` for `--inspect-brk`, or `r` for `-r`. - * * Flags passed through to V8 (as listed in `--v8-options`) may replace - * one or more _non-leading_ dashes for an underscore, or vice-versa; - * e.g., `--perf_basic_prof`, `--perf-basic-prof`, `--perf_basic-prof`, - * etc. - * * Flags may contain one or more equals (`=`) characters; all - * characters after and including the first equals will be ignored; - * e.g., `--stack-trace-limit=100`. - * * Flags _must_ be allowable within `NODE_OPTIONS`. - * - * When iterating over `process.allowedNodeEnvironmentFlags`, flags will - * appear only _once_; each will begin with one or more dashes. Flags - * passed through to V8 will contain underscores instead of non-leading - * dashes: - * - * ```js - * import { allowedNodeEnvironmentFlags } from 'process'; - * - * allowedNodeEnvironmentFlags.forEach((flag) => { - * // -r - * // --inspect-brk - * // --abort_on_uncaught_exception - * // ... - * }); - * ``` - * - * The methods `add()`, `clear()`, and `delete()` of`process.allowedNodeEnvironmentFlags` do nothing, and will fail - * silently. - * - * If Node.js was compiled _without_ `NODE_OPTIONS` support (shown in {@link config}), `process.allowedNodeEnvironmentFlags` will - * contain what _would have_ been allowable. - * @since v10.10.0 - */ - allowedNodeEnvironmentFlags: ReadonlySet; - /** - * `process.report` is an object whose methods are used to generate diagnostic - * reports for the current process. Additional documentation is available in the `report documentation`. - * @since v11.8.0 - */ - report?: ProcessReport | undefined; - /** - * ```js - * import { resourceUsage } from 'process'; - * - * console.log(resourceUsage()); - * /* - * Will output: - * { - * userCPUTime: 82872, - * systemCPUTime: 4143, - * maxRSS: 33164, - * sharedMemorySize: 0, - * unsharedDataSize: 0, - * unsharedStackSize: 0, - * minorPageFault: 2469, - * majorPageFault: 0, - * swappedOut: 0, - * fsRead: 0, - * fsWrite: 8, - * ipcSent: 0, - * ipcReceived: 0, - * signalsCount: 0, - * voluntaryContextSwitches: 79, - * involuntaryContextSwitches: 1 - * } - * - * ``` - * @since v12.6.0 - * @return the resource usage for the current process. All of these values come from the `uv_getrusage` call which returns a [`uv_rusage_t` struct][uv_rusage_t]. - */ - resourceUsage(): ResourceUsage; - /** - * The `process.traceDeprecation` property indicates whether the`--trace-deprecation` flag is set on the current Node.js process. See the - * documentation for the `'warning' event` and the `emitWarning() method` for more information about this - * flag's behavior. - * @since v0.8.0 - */ - traceDeprecation: boolean; - /* EventEmitter */ - addListener(event: 'beforeExit', listener: BeforeExitListener): this; - addListener(event: 'disconnect', listener: DisconnectListener): this; - addListener(event: 'exit', listener: ExitListener): this; - addListener(event: 'rejectionHandled', listener: RejectionHandledListener): this; - addListener(event: 'uncaughtException', listener: UncaughtExceptionListener): this; - addListener(event: 'uncaughtExceptionMonitor', listener: UncaughtExceptionListener): this; - addListener(event: 'unhandledRejection', listener: UnhandledRejectionListener): this; - addListener(event: 'warning', listener: WarningListener): this; - addListener(event: 'message', listener: MessageListener): this; - addListener(event: Signals, listener: SignalsListener): this; - addListener(event: 'multipleResolves', listener: MultipleResolveListener): this; - addListener(event: 'worker', listener: WorkerListener): this; - emit(event: 'beforeExit', code: number): boolean; - emit(event: 'disconnect'): boolean; - emit(event: 'exit', code: number): boolean; - emit(event: 'rejectionHandled', promise: Promise): boolean; - emit(event: 'uncaughtException', error: Error): boolean; - emit(event: 'uncaughtExceptionMonitor', error: Error): boolean; - emit(event: 'unhandledRejection', reason: unknown, promise: Promise): boolean; - emit(event: 'warning', warning: Error): boolean; - emit(event: 'message', message: unknown, sendHandle: unknown): this; - emit(event: Signals, signal?: Signals): boolean; - emit(event: 'multipleResolves', type: MultipleResolveType, promise: Promise, value: unknown): this; - emit(event: 'worker', listener: WorkerListener): this; - on(event: 'beforeExit', listener: BeforeExitListener): this; - on(event: 'disconnect', listener: DisconnectListener): this; - on(event: 'exit', listener: ExitListener): this; - on(event: 'rejectionHandled', listener: RejectionHandledListener): this; - on(event: 'uncaughtException', listener: UncaughtExceptionListener): this; - on(event: 'uncaughtExceptionMonitor', listener: UncaughtExceptionListener): this; - on(event: 'unhandledRejection', listener: UnhandledRejectionListener): this; - on(event: 'warning', listener: WarningListener): this; - on(event: 'message', listener: MessageListener): this; - on(event: Signals, listener: SignalsListener): this; - on(event: 'multipleResolves', listener: MultipleResolveListener): this; - on(event: 'worker', listener: WorkerListener): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once(event: 'beforeExit', listener: BeforeExitListener): this; - once(event: 'disconnect', listener: DisconnectListener): this; - once(event: 'exit', listener: ExitListener): this; - once(event: 'rejectionHandled', listener: RejectionHandledListener): this; - once(event: 'uncaughtException', listener: UncaughtExceptionListener): this; - once(event: 'uncaughtExceptionMonitor', listener: UncaughtExceptionListener): this; - once(event: 'unhandledRejection', listener: UnhandledRejectionListener): this; - once(event: 'warning', listener: WarningListener): this; - once(event: 'message', listener: MessageListener): this; - once(event: Signals, listener: SignalsListener): this; - once(event: 'multipleResolves', listener: MultipleResolveListener): this; - once(event: 'worker', listener: WorkerListener): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener(event: 'beforeExit', listener: BeforeExitListener): this; - prependListener(event: 'disconnect', listener: DisconnectListener): this; - prependListener(event: 'exit', listener: ExitListener): this; - prependListener(event: 'rejectionHandled', listener: RejectionHandledListener): this; - prependListener(event: 'uncaughtException', listener: UncaughtExceptionListener): this; - prependListener(event: 'uncaughtExceptionMonitor', listener: UncaughtExceptionListener): this; - prependListener(event: 'unhandledRejection', listener: UnhandledRejectionListener): this; - prependListener(event: 'warning', listener: WarningListener): this; - prependListener(event: 'message', listener: MessageListener): this; - prependListener(event: Signals, listener: SignalsListener): this; - prependListener(event: 'multipleResolves', listener: MultipleResolveListener): this; - prependListener(event: 'worker', listener: WorkerListener): this; - prependOnceListener(event: 'beforeExit', listener: BeforeExitListener): this; - prependOnceListener(event: 'disconnect', listener: DisconnectListener): this; - prependOnceListener(event: 'exit', listener: ExitListener): this; - prependOnceListener(event: 'rejectionHandled', listener: RejectionHandledListener): this; - prependOnceListener(event: 'uncaughtException', listener: UncaughtExceptionListener): this; - prependOnceListener(event: 'uncaughtExceptionMonitor', listener: UncaughtExceptionListener): this; - prependOnceListener(event: 'unhandledRejection', listener: UnhandledRejectionListener): this; - prependOnceListener(event: 'warning', listener: WarningListener): this; - prependOnceListener(event: 'message', listener: MessageListener): this; - prependOnceListener(event: Signals, listener: SignalsListener): this; - prependOnceListener(event: 'multipleResolves', listener: MultipleResolveListener): this; - prependOnceListener(event: 'worker', listener: WorkerListener): this; - listeners(event: 'beforeExit'): BeforeExitListener[]; - listeners(event: 'disconnect'): DisconnectListener[]; - listeners(event: 'exit'): ExitListener[]; - listeners(event: 'rejectionHandled'): RejectionHandledListener[]; - listeners(event: 'uncaughtException'): UncaughtExceptionListener[]; - listeners(event: 'uncaughtExceptionMonitor'): UncaughtExceptionListener[]; - listeners(event: 'unhandledRejection'): UnhandledRejectionListener[]; - listeners(event: 'warning'): WarningListener[]; - listeners(event: 'message'): MessageListener[]; - listeners(event: Signals): SignalsListener[]; - listeners(event: 'multipleResolves'): MultipleResolveListener[]; - listeners(event: 'worker'): WorkerListener[]; - } - } - } - export = process; -} -declare module 'node:process' { - import process = require('process'); - export = process; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/punycode.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/punycode.d.ts deleted file mode 100755 index 87ebbb90..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/punycode.d.ts +++ /dev/null @@ -1,117 +0,0 @@ -/** - * **The version of the punycode module bundled in Node.js is being deprecated.**In a future major version of Node.js this module will be removed. Users - * currently depending on the `punycode` module should switch to using the - * userland-provided [Punycode.js](https://github.com/bestiejs/punycode.js) module instead. For punycode-based URL - * encoding, see `url.domainToASCII` or, more generally, the `WHATWG URL API`. - * - * The `punycode` module is a bundled version of the [Punycode.js](https://github.com/bestiejs/punycode.js) module. It - * can be accessed using: - * - * ```js - * const punycode = require('punycode'); - * ``` - * - * [Punycode](https://tools.ietf.org/html/rfc3492) is a character encoding scheme defined by RFC 3492 that is - * primarily intended for use in Internationalized Domain Names. Because host - * names in URLs are limited to ASCII characters only, Domain Names that contain - * non-ASCII characters must be converted into ASCII using the Punycode scheme. - * For instance, the Japanese character that translates into the English word,`'example'` is `'例'`. The Internationalized Domain Name, `'例.com'` (equivalent - * to `'example.com'`) is represented by Punycode as the ASCII string`'xn--fsq.com'`. - * - * The `punycode` module provides a simple implementation of the Punycode standard. - * - * The `punycode` module is a third-party dependency used by Node.js and - * made available to developers as a convenience. Fixes or other modifications to - * the module must be directed to the [Punycode.js](https://github.com/bestiejs/punycode.js) project. - * @deprecated Since v7.0.0 - Deprecated - * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/punycode.js) - */ -declare module 'punycode' { - /** - * The `punycode.decode()` method converts a [Punycode](https://tools.ietf.org/html/rfc3492) string of ASCII-only - * characters to the equivalent string of Unicode codepoints. - * - * ```js - * punycode.decode('maana-pta'); // 'mañana' - * punycode.decode('--dqo34k'); // '☃-⌘' - * ``` - * @since v0.5.1 - */ - function decode(string: string): string; - /** - * The `punycode.encode()` method converts a string of Unicode codepoints to a [Punycode](https://tools.ietf.org/html/rfc3492) string of ASCII-only characters. - * - * ```js - * punycode.encode('mañana'); // 'maana-pta' - * punycode.encode('☃-⌘'); // '--dqo34k' - * ``` - * @since v0.5.1 - */ - function encode(string: string): string; - /** - * The `punycode.toUnicode()` method converts a string representing a domain name - * containing [Punycode](https://tools.ietf.org/html/rfc3492) encoded characters into Unicode. Only the [Punycode](https://tools.ietf.org/html/rfc3492) encoded parts of the domain name are be - * converted. - * - * ```js - * // decode domain names - * punycode.toUnicode('xn--maana-pta.com'); // 'mañana.com' - * punycode.toUnicode('xn----dqo34k.com'); // '☃-⌘.com' - * punycode.toUnicode('example.com'); // 'example.com' - * ``` - * @since v0.6.1 - */ - function toUnicode(domain: string): string; - /** - * The `punycode.toASCII()` method converts a Unicode string representing an - * Internationalized Domain Name to [Punycode](https://tools.ietf.org/html/rfc3492). Only the non-ASCII parts of the - * domain name will be converted. Calling `punycode.toASCII()` on a string that - * already only contains ASCII characters will have no effect. - * - * ```js - * // encode domain names - * punycode.toASCII('mañana.com'); // 'xn--maana-pta.com' - * punycode.toASCII('☃-⌘.com'); // 'xn----dqo34k.com' - * punycode.toASCII('example.com'); // 'example.com' - * ``` - * @since v0.6.1 - */ - function toASCII(domain: string): string; - /** - * @deprecated since v7.0.0 - * The version of the punycode module bundled in Node.js is being deprecated. - * In a future major version of Node.js this module will be removed. - * Users currently depending on the punycode module should switch to using - * the userland-provided Punycode.js module instead. - */ - const ucs2: ucs2; - interface ucs2 { - /** - * @deprecated since v7.0.0 - * The version of the punycode module bundled in Node.js is being deprecated. - * In a future major version of Node.js this module will be removed. - * Users currently depending on the punycode module should switch to using - * the userland-provided Punycode.js module instead. - */ - decode(string: string): number[]; - /** - * @deprecated since v7.0.0 - * The version of the punycode module bundled in Node.js is being deprecated. - * In a future major version of Node.js this module will be removed. - * Users currently depending on the punycode module should switch to using - * the userland-provided Punycode.js module instead. - */ - encode(codePoints: ReadonlyArray): string; - } - /** - * @deprecated since v7.0.0 - * The version of the punycode module bundled in Node.js is being deprecated. - * In a future major version of Node.js this module will be removed. - * Users currently depending on the punycode module should switch to using - * the userland-provided Punycode.js module instead. - */ - const version: string; -} -declare module 'node:punycode' { - export * from 'punycode'; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/querystring.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/querystring.d.ts deleted file mode 100755 index e1185478..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/querystring.d.ts +++ /dev/null @@ -1,131 +0,0 @@ -/** - * The `querystring` module provides utilities for parsing and formatting URL - * query strings. It can be accessed using: - * - * ```js - * const querystring = require('querystring'); - * ``` - * - * `querystring` is more performant than `URLSearchParams` but is not a - * standardized API. Use `URLSearchParams` when performance is not critical - * or when compatibility with browser code is desirable. - * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/querystring.js) - */ -declare module 'querystring' { - interface StringifyOptions { - encodeURIComponent?: ((str: string) => string) | undefined; - } - interface ParseOptions { - maxKeys?: number | undefined; - decodeURIComponent?: ((str: string) => string) | undefined; - } - interface ParsedUrlQuery extends NodeJS.Dict {} - interface ParsedUrlQueryInput extends NodeJS.Dict | ReadonlyArray | ReadonlyArray | null> {} - /** - * The `querystring.stringify()` method produces a URL query string from a - * given `obj` by iterating through the object's "own properties". - * - * It serializes the following types of values passed in `obj`:[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type) | - * [number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type) | - * [bigint](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt) | - * [boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type) | - * [string\[\]](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type) | - * [number\[\]](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type) | - * [bigint\[\]](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt) | - * [boolean\[\]](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type) The numeric values must be finite. Any other input values will be coerced to - * empty strings. - * - * ```js - * querystring.stringify({ foo: 'bar', baz: ['qux', 'quux'], corge: '' }); - * // Returns 'foo=bar&baz=qux&baz=quux&corge=' - * - * querystring.stringify({ foo: 'bar', baz: 'qux' }, ';', ':'); - * // Returns 'foo:bar;baz:qux' - * ``` - * - * By default, characters requiring percent-encoding within the query string will - * be encoded as UTF-8\. If an alternative encoding is required, then an alternative`encodeURIComponent` option will need to be specified: - * - * ```js - * // Assuming gbkEncodeURIComponent function already exists, - * - * querystring.stringify({ w: '中文', foo: 'bar' }, null, null, - * { encodeURIComponent: gbkEncodeURIComponent }); - * ``` - * @since v0.1.25 - * @param obj The object to serialize into a URL query string - * @param [sep='&'] The substring used to delimit key and value pairs in the query string. - * @param [eq='='] . The substring used to delimit keys and values in the query string. - */ - function stringify(obj?: ParsedUrlQueryInput, sep?: string, eq?: string, options?: StringifyOptions): string; - /** - * The `querystring.parse()` method parses a URL query string (`str`) into a - * collection of key and value pairs. - * - * For example, the query string `'foo=bar&abc=xyz&abc=123'` is parsed into: - * - * ```js - * { - * foo: 'bar', - * abc: ['xyz', '123'] - * } - * ``` - * - * The object returned by the `querystring.parse()` method _does not_prototypically inherit from the JavaScript `Object`. This means that typical`Object` methods such as `obj.toString()`, - * `obj.hasOwnProperty()`, and others - * are not defined and _will not work_. - * - * By default, percent-encoded characters within the query string will be assumed - * to use UTF-8 encoding. If an alternative character encoding is used, then an - * alternative `decodeURIComponent` option will need to be specified: - * - * ```js - * // Assuming gbkDecodeURIComponent function already exists... - * - * querystring.parse('w=%D6%D0%CE%C4&foo=bar', null, null, - * { decodeURIComponent: gbkDecodeURIComponent }); - * ``` - * @since v0.1.25 - * @param str The URL query string to parse - * @param [sep='&'] The substring used to delimit key and value pairs in the query string. - * @param [eq='='] . The substring used to delimit keys and values in the query string. - */ - function parse(str: string, sep?: string, eq?: string, options?: ParseOptions): ParsedUrlQuery; - /** - * The querystring.encode() function is an alias for querystring.stringify(). - */ - const encode: typeof stringify; - /** - * The querystring.decode() function is an alias for querystring.parse(). - */ - const decode: typeof parse; - /** - * The `querystring.escape()` method performs URL percent-encoding on the given`str` in a manner that is optimized for the specific requirements of URL - * query strings. - * - * The `querystring.escape()` method is used by `querystring.stringify()` and is - * generally not expected to be used directly. It is exported primarily to allow - * application code to provide a replacement percent-encoding implementation if - * necessary by assigning `querystring.escape` to an alternative function. - * @since v0.1.25 - */ - function escape(str: string): string; - /** - * The `querystring.unescape()` method performs decoding of URL percent-encoded - * characters on the given `str`. - * - * The `querystring.unescape()` method is used by `querystring.parse()` and is - * generally not expected to be used directly. It is exported primarily to allow - * application code to provide a replacement decoding implementation if - * necessary by assigning `querystring.unescape` to an alternative function. - * - * By default, the `querystring.unescape()` method will attempt to use the - * JavaScript built-in `decodeURIComponent()` method to decode. If that fails, - * a safer equivalent that does not throw on malformed URLs will be used. - * @since v0.1.25 - */ - function unescape(str: string): string; -} -declare module 'node:querystring' { - export * from 'querystring'; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/readline.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/readline.d.ts deleted file mode 100755 index 6ab64acb..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/readline.d.ts +++ /dev/null @@ -1,653 +0,0 @@ -/** - * The `readline` module provides an interface for reading data from a `Readable` stream (such as `process.stdin`) one line at a time. - * - * To use the promise-based APIs: - * - * ```js - * import * as readline from 'node:readline/promises'; - * ``` - * - * To use the callback and sync APIs: - * - * ```js - * import * as readline from 'node:readline'; - * ``` - * - * The following simple example illustrates the basic use of the `readline` module. - * - * ```js - * import * as readline from 'node:readline/promises'; - * import { stdin as input, stdout as output } from 'node:process'; - * - * const rl = readline.createInterface({ input, output }); - * - * const answer = await rl.question('What do you think of Node.js? '); - * - * console.log(`Thank you for your valuable feedback: ${answer}`); - * - * rl.close(); - * ``` - * - * Once this code is invoked, the Node.js application will not terminate until the`readline.Interface` is closed because the interface waits for data to be - * received on the `input` stream. - * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/readline.js) - */ -declare module 'readline' { - import { Abortable, EventEmitter } from 'node:events'; - import * as promises from 'node:readline/promises'; - - export { promises }; - export interface Key { - sequence?: string | undefined; - name?: string | undefined; - ctrl?: boolean | undefined; - meta?: boolean | undefined; - shift?: boolean | undefined; - } - /** - * Instances of the `readline.Interface` class are constructed using the`readline.createInterface()` method. Every instance is associated with a - * single `input` `Readable` stream and a single `output` `Writable` stream. - * The `output` stream is used to print prompts for user input that arrives on, - * and is read from, the `input` stream. - * @since v0.1.104 - */ - export class Interface extends EventEmitter { - readonly terminal: boolean; - /** - * The current input data being processed by node. - * - * This can be used when collecting input from a TTY stream to retrieve the - * current value that has been processed thus far, prior to the `line` event - * being emitted. Once the `line` event has been emitted, this property will - * be an empty string. - * - * Be aware that modifying the value during the instance runtime may have - * unintended consequences if `rl.cursor` is not also controlled. - * - * **If not using a TTY stream for input, use the `'line'` event.** - * - * One possible use case would be as follows: - * - * ```js - * const values = ['lorem ipsum', 'dolor sit amet']; - * const rl = readline.createInterface(process.stdin); - * const showResults = debounce(() => { - * console.log( - * '\n', - * values.filter((val) => val.startsWith(rl.line)).join(' ') - * ); - * }, 300); - * process.stdin.on('keypress', (c, k) => { - * showResults(); - * }); - * ``` - * @since v0.1.98 - */ - readonly line: string; - /** - * The cursor position relative to `rl.line`. - * - * This will track where the current cursor lands in the input string, when - * reading input from a TTY stream. The position of cursor determines the - * portion of the input string that will be modified as input is processed, - * as well as the column where the terminal caret will be rendered. - * @since v0.1.98 - */ - readonly cursor: number; - /** - * NOTE: According to the documentation: - * - * > Instances of the `readline.Interface` class are constructed using the - * > `readline.createInterface()` method. - * - * @see https://nodejs.org/dist/latest-v10.x/docs/api/readline.html#readline_class_interface - */ - protected constructor(input: NodeJS.ReadableStream, output?: NodeJS.WritableStream, completer?: Completer | AsyncCompleter, terminal?: boolean); - /** - * NOTE: According to the documentation: - * - * > Instances of the `readline.Interface` class are constructed using the - * > `readline.createInterface()` method. - * - * @see https://nodejs.org/dist/latest-v10.x/docs/api/readline.html#readline_class_interface - */ - protected constructor(options: ReadLineOptions); - /** - * The `rl.getPrompt()` method returns the current prompt used by `rl.prompt()`. - * @since v15.3.0 - * @return the current prompt string - */ - getPrompt(): string; - /** - * The `rl.setPrompt()` method sets the prompt that will be written to `output`whenever `rl.prompt()` is called. - * @since v0.1.98 - */ - setPrompt(prompt: string): void; - /** - * The `rl.prompt()` method writes the `readline.Interface` instances configured`prompt` to a new line in `output` in order to provide a user with a new - * location at which to provide input. - * - * When called, `rl.prompt()` will resume the `input` stream if it has been - * paused. - * - * If the `readline.Interface` was created with `output` set to `null` or`undefined` the prompt is not written. - * @since v0.1.98 - * @param preserveCursor If `true`, prevents the cursor placement from being reset to `0`. - */ - prompt(preserveCursor?: boolean): void; - /** - * The `rl.question()` method displays the `query` by writing it to the `output`, - * waits for user input to be provided on `input`, then invokes the `callback`function passing the provided input as the first argument. - * - * When called, `rl.question()` will resume the `input` stream if it has been - * paused. - * - * If the `readline.Interface` was created with `output` set to `null` or`undefined` the `query` is not written. - * - * The `callback` function passed to `rl.question()` does not follow the typical - * pattern of accepting an `Error` object or `null` as the first argument. - * The `callback` is called with the provided answer as the only argument. - * - * Example usage: - * - * ```js - * rl.question('What is your favorite food? ', (answer) => { - * console.log(`Oh, so your favorite food is ${answer}`); - * }); - * ``` - * - * Using an `AbortController` to cancel a question. - * - * ```js - * const ac = new AbortController(); - * const signal = ac.signal; - * - * rl.question('What is your favorite food? ', { signal }, (answer) => { - * console.log(`Oh, so your favorite food is ${answer}`); - * }); - * - * signal.addEventListener('abort', () => { - * console.log('The food question timed out'); - * }, { once: true }); - * - * setTimeout(() => ac.abort(), 10000); - * ``` - * - * If this method is invoked as it's util.promisify()ed version, it returns a - * Promise that fulfills with the answer. If the question is canceled using - * an `AbortController` it will reject with an `AbortError`. - * - * ```js - * const util = require('util'); - * const question = util.promisify(rl.question).bind(rl); - * - * async function questionExample() { - * try { - * const answer = await question('What is you favorite food? '); - * console.log(`Oh, so your favorite food is ${answer}`); - * } catch (err) { - * console.error('Question rejected', err); - * } - * } - * questionExample(); - * ``` - * @since v0.3.3 - * @param query A statement or query to write to `output`, prepended to the prompt. - * @param callback A callback function that is invoked with the user's input in response to the `query`. - */ - question(query: string, callback: (answer: string) => void): void; - question(query: string, options: Abortable, callback: (answer: string) => void): void; - /** - * The `rl.pause()` method pauses the `input` stream, allowing it to be resumed - * later if necessary. - * - * Calling `rl.pause()` does not immediately pause other events (including`'line'`) from being emitted by the `readline.Interface` instance. - * @since v0.3.4 - */ - pause(): this; - /** - * The `rl.resume()` method resumes the `input` stream if it has been paused. - * @since v0.3.4 - */ - resume(): this; - /** - * The `rl.close()` method closes the `readline.Interface` instance and - * relinquishes control over the `input` and `output` streams. When called, - * the `'close'` event will be emitted. - * - * Calling `rl.close()` does not immediately stop other events (including `'line'`) - * from being emitted by the `readline.Interface` instance. - * @since v0.1.98 - */ - close(): void; - /** - * The `rl.write()` method will write either `data` or a key sequence identified - * by `key` to the `output`. The `key` argument is supported only if `output` is - * a `TTY` text terminal. See `TTY keybindings` for a list of key - * combinations. - * - * If `key` is specified, `data` is ignored. - * - * When called, `rl.write()` will resume the `input` stream if it has been - * paused. - * - * If the `readline.Interface` was created with `output` set to `null` or`undefined` the `data` and `key` are not written. - * - * ```js - * rl.write('Delete this!'); - * // Simulate Ctrl+U to delete the line written previously - * rl.write(null, { ctrl: true, name: 'u' }); - * ``` - * - * The `rl.write()` method will write the data to the `readline` `Interface`'s`input`_as if it were provided by the user_. - * @since v0.1.98 - */ - write(data: string | Buffer, key?: Key): void; - write(data: undefined | null | string | Buffer, key: Key): void; - /** - * Returns the real position of the cursor in relation to the input - * prompt + string. Long input (wrapping) strings, as well as multiple - * line prompts are included in the calculations. - * @since v13.5.0, v12.16.0 - */ - getCursorPos(): CursorPos; - /** - * events.EventEmitter - * 1. close - * 2. line - * 3. pause - * 4. resume - * 5. SIGCONT - * 6. SIGINT - * 7. SIGTSTP - * 8. history - */ - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: 'close', listener: () => void): this; - addListener(event: 'line', listener: (input: string) => void): this; - addListener(event: 'pause', listener: () => void): this; - addListener(event: 'resume', listener: () => void): this; - addListener(event: 'SIGCONT', listener: () => void): this; - addListener(event: 'SIGINT', listener: () => void): this; - addListener(event: 'SIGTSTP', listener: () => void): this; - addListener(event: 'history', listener: (history: string[]) => void): this; - emit(event: string | symbol, ...args: any[]): boolean; - emit(event: 'close'): boolean; - emit(event: 'line', input: string): boolean; - emit(event: 'pause'): boolean; - emit(event: 'resume'): boolean; - emit(event: 'SIGCONT'): boolean; - emit(event: 'SIGINT'): boolean; - emit(event: 'SIGTSTP'): boolean; - emit(event: 'history', history: string[]): boolean; - on(event: string, listener: (...args: any[]) => void): this; - on(event: 'close', listener: () => void): this; - on(event: 'line', listener: (input: string) => void): this; - on(event: 'pause', listener: () => void): this; - on(event: 'resume', listener: () => void): this; - on(event: 'SIGCONT', listener: () => void): this; - on(event: 'SIGINT', listener: () => void): this; - on(event: 'SIGTSTP', listener: () => void): this; - on(event: 'history', listener: (history: string[]) => void): this; - once(event: string, listener: (...args: any[]) => void): this; - once(event: 'close', listener: () => void): this; - once(event: 'line', listener: (input: string) => void): this; - once(event: 'pause', listener: () => void): this; - once(event: 'resume', listener: () => void): this; - once(event: 'SIGCONT', listener: () => void): this; - once(event: 'SIGINT', listener: () => void): this; - once(event: 'SIGTSTP', listener: () => void): this; - once(event: 'history', listener: (history: string[]) => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: 'close', listener: () => void): this; - prependListener(event: 'line', listener: (input: string) => void): this; - prependListener(event: 'pause', listener: () => void): this; - prependListener(event: 'resume', listener: () => void): this; - prependListener(event: 'SIGCONT', listener: () => void): this; - prependListener(event: 'SIGINT', listener: () => void): this; - prependListener(event: 'SIGTSTP', listener: () => void): this; - prependListener(event: 'history', listener: (history: string[]) => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: 'close', listener: () => void): this; - prependOnceListener(event: 'line', listener: (input: string) => void): this; - prependOnceListener(event: 'pause', listener: () => void): this; - prependOnceListener(event: 'resume', listener: () => void): this; - prependOnceListener(event: 'SIGCONT', listener: () => void): this; - prependOnceListener(event: 'SIGINT', listener: () => void): this; - prependOnceListener(event: 'SIGTSTP', listener: () => void): this; - prependOnceListener(event: 'history', listener: (history: string[]) => void): this; - [Symbol.asyncIterator](): AsyncIterableIterator; - } - export type ReadLine = Interface; // type forwarded for backwards compatibility - export type Completer = (line: string) => CompleterResult; - export type AsyncCompleter = (line: string, callback: (err?: null | Error, result?: CompleterResult) => void) => void; - export type CompleterResult = [string[], string]; - export interface ReadLineOptions { - input: NodeJS.ReadableStream; - output?: NodeJS.WritableStream | undefined; - completer?: Completer | AsyncCompleter | undefined; - terminal?: boolean | undefined; - /** - * Initial list of history lines. This option makes sense - * only if `terminal` is set to `true` by the user or by an internal `output` - * check, otherwise the history caching mechanism is not initialized at all. - * @default [] - */ - history?: string[] | undefined; - historySize?: number | undefined; - prompt?: string | undefined; - crlfDelay?: number | undefined; - /** - * If `true`, when a new input line added - * to the history list duplicates an older one, this removes the older line - * from the list. - * @default false - */ - removeHistoryDuplicates?: boolean | undefined; - escapeCodeTimeout?: number | undefined; - tabSize?: number | undefined; - } - /** - * The `readline.createInterface()` method creates a new `readline.Interface`instance. - * - * ```js - * const readline = require('readline'); - * const rl = readline.createInterface({ - * input: process.stdin, - * output: process.stdout - * }); - * ``` - * - * Once the `readline.Interface` instance is created, the most common case is to - * listen for the `'line'` event: - * - * ```js - * rl.on('line', (line) => { - * console.log(`Received: ${line}`); - * }); - * ``` - * - * If `terminal` is `true` for this instance then the `output` stream will get - * the best compatibility if it defines an `output.columns` property and emits - * a `'resize'` event on the `output` if or when the columns ever change - * (`process.stdout` does this automatically when it is a TTY). - * - * When creating a `readline.Interface` using `stdin` as input, the program - * will not terminate until it receives `EOF` (Ctrl+D on - * Linux/macOS, Ctrl+Z followed by Return on - * Windows). - * If you want your application to exit without waiting for user input, you can `unref()` the standard input stream: - * - * ```js - * process.stdin.unref(); - * ``` - * @since v0.1.98 - */ - export function createInterface(input: NodeJS.ReadableStream, output?: NodeJS.WritableStream, completer?: Completer | AsyncCompleter, terminal?: boolean): Interface; - export function createInterface(options: ReadLineOptions): Interface; - /** - * The `readline.emitKeypressEvents()` method causes the given `Readable` stream to begin emitting `'keypress'` events corresponding to received input. - * - * Optionally, `interface` specifies a `readline.Interface` instance for which - * autocompletion is disabled when copy-pasted input is detected. - * - * If the `stream` is a `TTY`, then it must be in raw mode. - * - * This is automatically called by any readline instance on its `input` if the`input` is a terminal. Closing the `readline` instance does not stop - * the `input` from emitting `'keypress'` events. - * - * ```js - * readline.emitKeypressEvents(process.stdin); - * if (process.stdin.isTTY) - * process.stdin.setRawMode(true); - * ``` - * - * ## Example: Tiny CLI - * - * The following example illustrates the use of `readline.Interface` class to - * implement a small command-line interface: - * - * ```js - * const readline = require('readline'); - * const rl = readline.createInterface({ - * input: process.stdin, - * output: process.stdout, - * prompt: 'OHAI> ' - * }); - * - * rl.prompt(); - * - * rl.on('line', (line) => { - * switch (line.trim()) { - * case 'hello': - * console.log('world!'); - * break; - * default: - * console.log(`Say what? I might have heard '${line.trim()}'`); - * break; - * } - * rl.prompt(); - * }).on('close', () => { - * console.log('Have a great day!'); - * process.exit(0); - * }); - * ``` - * - * ## Example: Read file stream line-by-Line - * - * A common use case for `readline` is to consume an input file one line at a - * time. The easiest way to do so is leveraging the `fs.ReadStream` API as - * well as a `for await...of` loop: - * - * ```js - * const fs = require('fs'); - * const readline = require('readline'); - * - * async function processLineByLine() { - * const fileStream = fs.createReadStream('input.txt'); - * - * const rl = readline.createInterface({ - * input: fileStream, - * crlfDelay: Infinity - * }); - * // Note: we use the crlfDelay option to recognize all instances of CR LF - * // ('\r\n') in input.txt as a single line break. - * - * for await (const line of rl) { - * // Each line in input.txt will be successively available here as `line`. - * console.log(`Line from file: ${line}`); - * } - * } - * - * processLineByLine(); - * ``` - * - * Alternatively, one could use the `'line'` event: - * - * ```js - * const fs = require('fs'); - * const readline = require('readline'); - * - * const rl = readline.createInterface({ - * input: fs.createReadStream('sample.txt'), - * crlfDelay: Infinity - * }); - * - * rl.on('line', (line) => { - * console.log(`Line from file: ${line}`); - * }); - * ``` - * - * Currently, `for await...of` loop can be a bit slower. If `async` / `await`flow and speed are both essential, a mixed approach can be applied: - * - * ```js - * const { once } = require('events'); - * const { createReadStream } = require('fs'); - * const { createInterface } = require('readline'); - * - * (async function processLineByLine() { - * try { - * const rl = createInterface({ - * input: createReadStream('big-file.txt'), - * crlfDelay: Infinity - * }); - * - * rl.on('line', (line) => { - * // Process the line. - * }); - * - * await once(rl, 'close'); - * - * console.log('File processed.'); - * } catch (err) { - * console.error(err); - * } - * })(); - * ``` - * @since v0.7.7 - */ - export function emitKeypressEvents(stream: NodeJS.ReadableStream, readlineInterface?: Interface): void; - export type Direction = -1 | 0 | 1; - export interface CursorPos { - rows: number; - cols: number; - } - /** - * The `readline.clearLine()` method clears current line of given `TTY` stream - * in a specified direction identified by `dir`. - * @since v0.7.7 - * @param callback Invoked once the operation completes. - * @return `false` if `stream` wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`. - */ - export function clearLine(stream: NodeJS.WritableStream, dir: Direction, callback?: () => void): boolean; - /** - * The `readline.clearScreenDown()` method clears the given `TTY` stream from - * the current position of the cursor down. - * @since v0.7.7 - * @param callback Invoked once the operation completes. - * @return `false` if `stream` wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`. - */ - export function clearScreenDown(stream: NodeJS.WritableStream, callback?: () => void): boolean; - /** - * The `readline.cursorTo()` method moves cursor to the specified position in a - * given `TTY` `stream`. - * @since v0.7.7 - * @param callback Invoked once the operation completes. - * @return `false` if `stream` wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`. - */ - export function cursorTo(stream: NodeJS.WritableStream, x: number, y?: number, callback?: () => void): boolean; - /** - * The `readline.moveCursor()` method moves the cursor _relative_ to its current - * position in a given `TTY` `stream`. - * - * ## Example: Tiny CLI - * - * The following example illustrates the use of `readline.Interface` class to - * implement a small command-line interface: - * - * ```js - * const readline = require('readline'); - * const rl = readline.createInterface({ - * input: process.stdin, - * output: process.stdout, - * prompt: 'OHAI> ' - * }); - * - * rl.prompt(); - * - * rl.on('line', (line) => { - * switch (line.trim()) { - * case 'hello': - * console.log('world!'); - * break; - * default: - * console.log(`Say what? I might have heard '${line.trim()}'`); - * break; - * } - * rl.prompt(); - * }).on('close', () => { - * console.log('Have a great day!'); - * process.exit(0); - * }); - * ``` - * - * ## Example: Read file stream line-by-Line - * - * A common use case for `readline` is to consume an input file one line at a - * time. The easiest way to do so is leveraging the `fs.ReadStream` API as - * well as a `for await...of` loop: - * - * ```js - * const fs = require('fs'); - * const readline = require('readline'); - * - * async function processLineByLine() { - * const fileStream = fs.createReadStream('input.txt'); - * - * const rl = readline.createInterface({ - * input: fileStream, - * crlfDelay: Infinity - * }); - * // Note: we use the crlfDelay option to recognize all instances of CR LF - * // ('\r\n') in input.txt as a single line break. - * - * for await (const line of rl) { - * // Each line in input.txt will be successively available here as `line`. - * console.log(`Line from file: ${line}`); - * } - * } - * - * processLineByLine(); - * ``` - * - * Alternatively, one could use the `'line'` event: - * - * ```js - * const fs = require('fs'); - * const readline = require('readline'); - * - * const rl = readline.createInterface({ - * input: fs.createReadStream('sample.txt'), - * crlfDelay: Infinity - * }); - * - * rl.on('line', (line) => { - * console.log(`Line from file: ${line}`); - * }); - * ``` - * - * Currently, `for await...of` loop can be a bit slower. If `async` / `await`flow and speed are both essential, a mixed approach can be applied: - * - * ```js - * const { once } = require('events'); - * const { createReadStream } = require('fs'); - * const { createInterface } = require('readline'); - * - * (async function processLineByLine() { - * try { - * const rl = createInterface({ - * input: createReadStream('big-file.txt'), - * crlfDelay: Infinity - * }); - * - * rl.on('line', (line) => { - * // Process the line. - * }); - * - * await once(rl, 'close'); - * - * console.log('File processed.'); - * } catch (err) { - * console.error(err); - * } - * })(); - * ``` - * @since v0.7.7 - * @param callback Invoked once the operation completes. - * @return `false` if `stream` wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`. - */ - export function moveCursor(stream: NodeJS.WritableStream, dx: number, dy: number, callback?: () => void): boolean; -} -declare module 'node:readline' { - export * from 'readline'; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/readline/promises.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/readline/promises.d.ts deleted file mode 100755 index 8f9f06f0..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/readline/promises.d.ts +++ /dev/null @@ -1,143 +0,0 @@ -/** - * The `readline/promise` module provides an API for reading lines of input from a Readable stream one line at a time. - * - * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/readline/promises.js) - * @since v17.0.0 - */ -declare module 'readline/promises' { - import { Interface as _Interface, ReadLineOptions, Completer, AsyncCompleter, Direction } from 'node:readline'; - import { Abortable } from 'node:events'; - - class Interface extends _Interface { - /** - * The rl.question() method displays the query by writing it to the output, waits for user input to be provided on input, - * then invokes the callback function passing the provided input as the first argument. - * - * When called, rl.question() will resume the input stream if it has been paused. - * - * If the readlinePromises.Interface was created with output set to null or undefined the query is not written. - * - * If the question is called after rl.close(), it returns a rejected promise. - * - * Example usage: - * - * ```js - * const answer = await rl.question('What is your favorite food? '); - * console.log(`Oh, so your favorite food is ${answer}`); - * ``` - * - * Using an AbortSignal to cancel a question. - * - * ```js - * const signal = AbortSignal.timeout(10_000); - * - * signal.addEventListener('abort', () => { - * console.log('The food question timed out'); - * }, { once: true }); - * - * const answer = await rl.question('What is your favorite food? ', { signal }); - * console.log(`Oh, so your favorite food is ${answer}`); - * ``` - * - * @since v17.0.0 - * @param query A statement or query to write to output, prepended to the prompt. - */ - question(query: string): Promise; - question(query: string, options: Abortable): Promise; - } - - class Readline { - /** - * @param stream A TTY stream. - */ - constructor(stream: NodeJS.WritableStream, options?: { autoCommit?: boolean }); - /** - * The `rl.clearLine()` method adds to the internal list of pending action an action that clears current line of the associated `stream` in a specified direction identified by `dir`. - * Call `rl.commit()` to see the effect of this method, unless `autoCommit: true` was passed to the constructor. - */ - clearLine(dir: Direction): this; - /** - * The `rl.clearScreenDown()` method adds to the internal list of pending action an action that clears the associated `stream` from the current position of the cursor down. - * Call `rl.commit()` to see the effect of this method, unless `autoCommit: true` was passed to the constructor. - */ - clearScreenDown(): this; - /** - * The `rl.commit()` method sends all the pending actions to the associated `stream` and clears the internal list of pending actions. - */ - commit(): Promise; - /** - * The `rl.cursorTo()` method adds to the internal list of pending action an action that moves cursor to the specified position in the associated `stream`. - * Call `rl.commit()` to see the effect of this method, unless `autoCommit: true` was passed to the constructor. - */ - cursorTo(x: number, y?: number): this; - /** - * The `rl.moveCursor()` method adds to the internal list of pending action an action that moves the cursor relative to its current position in the associated `stream`. - * Call `rl.commit()` to see the effect of this method, unless autoCommit: true was passed to the constructor. - */ - moveCursor(dx: number, dy: number): this; - /** - * The `rl.rollback()` method clears the internal list of pending actions without sending it to the associated `stream`. - */ - rollback(): this; - } - - /** - * The `readlinePromises.createInterface()` method creates a new `readlinePromises.Interface` instance. - * - * ```js - * const readlinePromises = require('node:readline/promises'); - * const rl = readlinePromises.createInterface({ - * input: process.stdin, - * output: process.stdout - * }); - * ``` - * - * Once the `readlinePromises.Interface` instance is created, the most common case is to listen for the `'line'` event: - * - * ```js - * rl.on('line', (line) => { - * console.log(`Received: ${line}`); - * }); - * ``` - * - * If `terminal` is `true` for this instance then the `output` stream will get the best compatibility if it defines an `output.columns` property, - * and emits a `'resize'` event on the `output`, if or when the columns ever change (`process.stdout` does this automatically when it is a TTY). - * - * ## Use of the `completer` function - * - * The `completer` function takes the current line entered by the user as an argument, and returns an `Array` with 2 entries: - * - * - An Array with matching entries for the completion. - * - The substring that was used for the matching. - * - * For instance: `[[substr1, substr2, ...], originalsubstring]`. - * - * ```js - * function completer(line) { - * const completions = '.help .error .exit .quit .q'.split(' '); - * const hits = completions.filter((c) => c.startsWith(line)); - * // Show all completions if none found - * return [hits.length ? hits : completions, line]; - * } - * ``` - * - * The `completer` function can also returns a `Promise`, or be asynchronous: - * - * ```js - * async function completer(linePartial) { - * await someAsyncWork(); - * return [['123'], linePartial]; - * } - * ``` - */ - function createInterface( - input: NodeJS.ReadableStream, - output?: NodeJS.WritableStream, - completer?: Completer | AsyncCompleter, - terminal?: boolean, - ): Interface; - function createInterface(options: ReadLineOptions): Interface; -} -declare module 'node:readline/promises' { - export * from 'readline/promises'; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/repl.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/repl.d.ts deleted file mode 100755 index be42ccc4..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/repl.d.ts +++ /dev/null @@ -1,424 +0,0 @@ -/** - * The `repl` module provides a Read-Eval-Print-Loop (REPL) implementation that - * is available both as a standalone program or includible in other applications. - * It can be accessed using: - * - * ```js - * const repl = require('repl'); - * ``` - * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/repl.js) - */ -declare module 'repl' { - import { Interface, Completer, AsyncCompleter } from 'node:readline'; - import { Context } from 'node:vm'; - import { InspectOptions } from 'node:util'; - interface ReplOptions { - /** - * The input prompt to display. - * @default "> " - */ - prompt?: string | undefined; - /** - * The `Readable` stream from which REPL input will be read. - * @default process.stdin - */ - input?: NodeJS.ReadableStream | undefined; - /** - * The `Writable` stream to which REPL output will be written. - * @default process.stdout - */ - output?: NodeJS.WritableStream | undefined; - /** - * If `true`, specifies that the output should be treated as a TTY terminal, and have - * ANSI/VT100 escape codes written to it. - * Default: checking the value of the `isTTY` property on the output stream upon - * instantiation. - */ - terminal?: boolean | undefined; - /** - * The function to be used when evaluating each given line of input. - * Default: an async wrapper for the JavaScript `eval()` function. An `eval` function can - * error with `repl.Recoverable` to indicate the input was incomplete and prompt for - * additional lines. - * - * @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_default_evaluation - * @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_custom_evaluation_functions - */ - eval?: REPLEval | undefined; - /** - * Defines if the repl prints output previews or not. - * @default `true` Always `false` in case `terminal` is falsy. - */ - preview?: boolean | undefined; - /** - * If `true`, specifies that the default `writer` function should include ANSI color - * styling to REPL output. If a custom `writer` function is provided then this has no - * effect. - * Default: the REPL instance's `terminal` value. - */ - useColors?: boolean | undefined; - /** - * If `true`, specifies that the default evaluation function will use the JavaScript - * `global` as the context as opposed to creating a new separate context for the REPL - * instance. The node CLI REPL sets this value to `true`. - * Default: `false`. - */ - useGlobal?: boolean | undefined; - /** - * If `true`, specifies that the default writer will not output the return value of a - * command if it evaluates to `undefined`. - * Default: `false`. - */ - ignoreUndefined?: boolean | undefined; - /** - * The function to invoke to format the output of each command before writing to `output`. - * Default: a wrapper for `util.inspect`. - * - * @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_customizing_repl_output - */ - writer?: REPLWriter | undefined; - /** - * An optional function used for custom Tab auto completion. - * - * @see https://nodejs.org/dist/latest-v11.x/docs/api/readline.html#readline_use_of_the_completer_function - */ - completer?: Completer | AsyncCompleter | undefined; - /** - * A flag that specifies whether the default evaluator executes all JavaScript commands in - * strict mode or default (sloppy) mode. - * Accepted values are: - * - `repl.REPL_MODE_SLOPPY` - evaluates expressions in sloppy mode. - * - `repl.REPL_MODE_STRICT` - evaluates expressions in strict mode. This is equivalent to - * prefacing every repl statement with `'use strict'`. - */ - replMode?: typeof REPL_MODE_SLOPPY | typeof REPL_MODE_STRICT | undefined; - /** - * Stop evaluating the current piece of code when `SIGINT` is received, i.e. `Ctrl+C` is - * pressed. This cannot be used together with a custom `eval` function. - * Default: `false`. - */ - breakEvalOnSigint?: boolean | undefined; - } - type REPLEval = (this: REPLServer, evalCmd: string, context: Context, file: string, cb: (err: Error | null, result: any) => void) => void; - type REPLWriter = (this: REPLServer, obj: any) => string; - /** - * This is the default "writer" value, if none is passed in the REPL options, - * and it can be overridden by custom print functions. - */ - const writer: REPLWriter & { - options: InspectOptions; - }; - type REPLCommandAction = (this: REPLServer, text: string) => void; - interface REPLCommand { - /** - * Help text to be displayed when `.help` is entered. - */ - help?: string | undefined; - /** - * The function to execute, optionally accepting a single string argument. - */ - action: REPLCommandAction; - } - /** - * Instances of `repl.REPLServer` are created using the {@link start} method - * or directly using the JavaScript `new` keyword. - * - * ```js - * const repl = require('repl'); - * - * const options = { useColors: true }; - * - * const firstInstance = repl.start(options); - * const secondInstance = new repl.REPLServer(options); - * ``` - * @since v0.1.91 - */ - class REPLServer extends Interface { - /** - * The `vm.Context` provided to the `eval` function to be used for JavaScript - * evaluation. - */ - readonly context: Context; - /** - * @deprecated since v14.3.0 - Use `input` instead. - */ - readonly inputStream: NodeJS.ReadableStream; - /** - * @deprecated since v14.3.0 - Use `output` instead. - */ - readonly outputStream: NodeJS.WritableStream; - /** - * The `Readable` stream from which REPL input will be read. - */ - readonly input: NodeJS.ReadableStream; - /** - * The `Writable` stream to which REPL output will be written. - */ - readonly output: NodeJS.WritableStream; - /** - * The commands registered via `replServer.defineCommand()`. - */ - readonly commands: NodeJS.ReadOnlyDict; - /** - * A value indicating whether the REPL is currently in "editor mode". - * - * @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_commands_and_special_keys - */ - readonly editorMode: boolean; - /** - * A value indicating whether the `_` variable has been assigned. - * - * @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_assignment_of_the_underscore_variable - */ - readonly underscoreAssigned: boolean; - /** - * The last evaluation result from the REPL (assigned to the `_` variable inside of the REPL). - * - * @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_assignment_of_the_underscore_variable - */ - readonly last: any; - /** - * A value indicating whether the `_error` variable has been assigned. - * - * @since v9.8.0 - * @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_assignment_of_the_underscore_variable - */ - readonly underscoreErrAssigned: boolean; - /** - * The last error raised inside the REPL (assigned to the `_error` variable inside of the REPL). - * - * @since v9.8.0 - * @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_assignment_of_the_underscore_variable - */ - readonly lastError: any; - /** - * Specified in the REPL options, this is the function to be used when evaluating each - * given line of input. If not specified in the REPL options, this is an async wrapper - * for the JavaScript `eval()` function. - */ - readonly eval: REPLEval; - /** - * Specified in the REPL options, this is a value indicating whether the default - * `writer` function should include ANSI color styling to REPL output. - */ - readonly useColors: boolean; - /** - * Specified in the REPL options, this is a value indicating whether the default `eval` - * function will use the JavaScript `global` as the context as opposed to creating a new - * separate context for the REPL instance. - */ - readonly useGlobal: boolean; - /** - * Specified in the REPL options, this is a value indicating whether the default `writer` - * function should output the result of a command if it evaluates to `undefined`. - */ - readonly ignoreUndefined: boolean; - /** - * Specified in the REPL options, this is the function to invoke to format the output of - * each command before writing to `outputStream`. If not specified in the REPL options, - * this will be a wrapper for `util.inspect`. - */ - readonly writer: REPLWriter; - /** - * Specified in the REPL options, this is the function to use for custom Tab auto-completion. - */ - readonly completer: Completer | AsyncCompleter; - /** - * Specified in the REPL options, this is a flag that specifies whether the default `eval` - * function should execute all JavaScript commands in strict mode or default (sloppy) mode. - * Possible values are: - * - `repl.REPL_MODE_SLOPPY` - evaluates expressions in sloppy mode. - * - `repl.REPL_MODE_STRICT` - evaluates expressions in strict mode. This is equivalent to - * prefacing every repl statement with `'use strict'`. - */ - readonly replMode: typeof REPL_MODE_SLOPPY | typeof REPL_MODE_STRICT; - /** - * NOTE: According to the documentation: - * - * > Instances of `repl.REPLServer` are created using the `repl.start()` method and - * > _should not_ be created directly using the JavaScript `new` keyword. - * - * `REPLServer` cannot be subclassed due to implementation specifics in NodeJS. - * - * @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_class_replserver - */ - private constructor(); - /** - * The `replServer.defineCommand()` method is used to add new `.`\-prefixed commands - * to the REPL instance. Such commands are invoked by typing a `.` followed by the`keyword`. The `cmd` is either a `Function` or an `Object` with the following - * properties: - * - * The following example shows two new commands added to the REPL instance: - * - * ```js - * const repl = require('repl'); - * - * const replServer = repl.start({ prompt: '> ' }); - * replServer.defineCommand('sayhello', { - * help: 'Say hello', - * action(name) { - * this.clearBufferedCommand(); - * console.log(`Hello, ${name}!`); - * this.displayPrompt(); - * } - * }); - * replServer.defineCommand('saybye', function saybye() { - * console.log('Goodbye!'); - * this.close(); - * }); - * ``` - * - * The new commands can then be used from within the REPL instance: - * - * ```console - * > .sayhello Node.js User - * Hello, Node.js User! - * > .saybye - * Goodbye! - * ``` - * @since v0.3.0 - * @param keyword The command keyword (_without_ a leading `.` character). - * @param cmd The function to invoke when the command is processed. - */ - defineCommand(keyword: string, cmd: REPLCommandAction | REPLCommand): void; - /** - * The `replServer.displayPrompt()` method readies the REPL instance for input - * from the user, printing the configured `prompt` to a new line in the `output`and resuming the `input` to accept new input. - * - * When multi-line input is being entered, an ellipsis is printed rather than the - * 'prompt'. - * - * When `preserveCursor` is `true`, the cursor placement will not be reset to `0`. - * - * The `replServer.displayPrompt` method is primarily intended to be called from - * within the action function for commands registered using the`replServer.defineCommand()` method. - * @since v0.1.91 - */ - displayPrompt(preserveCursor?: boolean): void; - /** - * The `replServer.clearBufferedCommand()` method clears any command that has been - * buffered but not yet executed. This method is primarily intended to be - * called from within the action function for commands registered using the`replServer.defineCommand()` method. - * @since v9.0.0 - */ - clearBufferedCommand(): void; - /** - * Initializes a history log file for the REPL instance. When executing the - * Node.js binary and using the command-line REPL, a history file is initialized - * by default. However, this is not the case when creating a REPL - * programmatically. Use this method to initialize a history log file when working - * with REPL instances programmatically. - * @since v11.10.0 - * @param historyPath the path to the history file - * @param callback called when history writes are ready or upon error - */ - setupHistory(path: string, callback: (err: Error | null, repl: this) => void): void; - /** - * events.EventEmitter - * 1. close - inherited from `readline.Interface` - * 2. line - inherited from `readline.Interface` - * 3. pause - inherited from `readline.Interface` - * 4. resume - inherited from `readline.Interface` - * 5. SIGCONT - inherited from `readline.Interface` - * 6. SIGINT - inherited from `readline.Interface` - * 7. SIGTSTP - inherited from `readline.Interface` - * 8. exit - * 9. reset - */ - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: 'close', listener: () => void): this; - addListener(event: 'line', listener: (input: string) => void): this; - addListener(event: 'pause', listener: () => void): this; - addListener(event: 'resume', listener: () => void): this; - addListener(event: 'SIGCONT', listener: () => void): this; - addListener(event: 'SIGINT', listener: () => void): this; - addListener(event: 'SIGTSTP', listener: () => void): this; - addListener(event: 'exit', listener: () => void): this; - addListener(event: 'reset', listener: (context: Context) => void): this; - emit(event: string | symbol, ...args: any[]): boolean; - emit(event: 'close'): boolean; - emit(event: 'line', input: string): boolean; - emit(event: 'pause'): boolean; - emit(event: 'resume'): boolean; - emit(event: 'SIGCONT'): boolean; - emit(event: 'SIGINT'): boolean; - emit(event: 'SIGTSTP'): boolean; - emit(event: 'exit'): boolean; - emit(event: 'reset', context: Context): boolean; - on(event: string, listener: (...args: any[]) => void): this; - on(event: 'close', listener: () => void): this; - on(event: 'line', listener: (input: string) => void): this; - on(event: 'pause', listener: () => void): this; - on(event: 'resume', listener: () => void): this; - on(event: 'SIGCONT', listener: () => void): this; - on(event: 'SIGINT', listener: () => void): this; - on(event: 'SIGTSTP', listener: () => void): this; - on(event: 'exit', listener: () => void): this; - on(event: 'reset', listener: (context: Context) => void): this; - once(event: string, listener: (...args: any[]) => void): this; - once(event: 'close', listener: () => void): this; - once(event: 'line', listener: (input: string) => void): this; - once(event: 'pause', listener: () => void): this; - once(event: 'resume', listener: () => void): this; - once(event: 'SIGCONT', listener: () => void): this; - once(event: 'SIGINT', listener: () => void): this; - once(event: 'SIGTSTP', listener: () => void): this; - once(event: 'exit', listener: () => void): this; - once(event: 'reset', listener: (context: Context) => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: 'close', listener: () => void): this; - prependListener(event: 'line', listener: (input: string) => void): this; - prependListener(event: 'pause', listener: () => void): this; - prependListener(event: 'resume', listener: () => void): this; - prependListener(event: 'SIGCONT', listener: () => void): this; - prependListener(event: 'SIGINT', listener: () => void): this; - prependListener(event: 'SIGTSTP', listener: () => void): this; - prependListener(event: 'exit', listener: () => void): this; - prependListener(event: 'reset', listener: (context: Context) => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: 'close', listener: () => void): this; - prependOnceListener(event: 'line', listener: (input: string) => void): this; - prependOnceListener(event: 'pause', listener: () => void): this; - prependOnceListener(event: 'resume', listener: () => void): this; - prependOnceListener(event: 'SIGCONT', listener: () => void): this; - prependOnceListener(event: 'SIGINT', listener: () => void): this; - prependOnceListener(event: 'SIGTSTP', listener: () => void): this; - prependOnceListener(event: 'exit', listener: () => void): this; - prependOnceListener(event: 'reset', listener: (context: Context) => void): this; - } - /** - * A flag passed in the REPL options. Evaluates expressions in sloppy mode. - */ - const REPL_MODE_SLOPPY: unique symbol; - /** - * A flag passed in the REPL options. Evaluates expressions in strict mode. - * This is equivalent to prefacing every repl statement with `'use strict'`. - */ - const REPL_MODE_STRICT: unique symbol; - /** - * The `repl.start()` method creates and starts a {@link REPLServer} instance. - * - * If `options` is a string, then it specifies the input prompt: - * - * ```js - * const repl = require('repl'); - * - * // a Unix style prompt - * repl.start('$ '); - * ``` - * @since v0.1.91 - */ - function start(options?: string | ReplOptions): REPLServer; - /** - * Indicates a recoverable error that a `REPLServer` can use to support multi-line input. - * - * @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_recoverable_errors - */ - class Recoverable extends SyntaxError { - err: Error; - constructor(err: Error); - } -} -declare module 'node:repl' { - export * from 'repl'; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/stream.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/stream.d.ts deleted file mode 100755 index 711fd9ca..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/stream.d.ts +++ /dev/null @@ -1,1340 +0,0 @@ -/** - * A stream is an abstract interface for working with streaming data in Node.js. - * The `stream` module provides an API for implementing the stream interface. - * - * There are many stream objects provided by Node.js. For instance, a `request to an HTTP server` and `process.stdout` are both stream instances. - * - * Streams can be readable, writable, or both. All streams are instances of `EventEmitter`. - * - * To access the `stream` module: - * - * ```js - * const stream = require('stream'); - * ``` - * - * The `stream` module is useful for creating new types of stream instances. It is - * usually not necessary to use the `stream` module to consume streams. - * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/stream.js) - */ -declare module 'stream' { - import { EventEmitter, Abortable } from 'node:events'; - import { Blob as NodeBlob } from "node:buffer"; - import * as streamPromises from 'node:stream/promises'; - import * as streamConsumers from 'node:stream/consumers'; - import * as streamWeb from 'node:stream/web'; - class internal extends EventEmitter { - pipe( - destination: T, - options?: { - end?: boolean | undefined; - } - ): T; - } - namespace internal { - class Stream extends internal { - constructor(opts?: ReadableOptions); - } - interface StreamOptions extends Abortable { - emitClose?: boolean | undefined; - highWaterMark?: number | undefined; - objectMode?: boolean | undefined; - construct?(this: T, callback: (error?: Error | null) => void): void; - destroy?(this: T, error: Error | null, callback: (error: Error | null) => void): void; - autoDestroy?: boolean | undefined; - } - interface ReadableOptions extends StreamOptions { - encoding?: BufferEncoding | undefined; - read?(this: Readable, size: number): void; - } - /** - * @since v0.9.4 - */ - class Readable extends Stream implements NodeJS.ReadableStream { - /** - * A utility method for creating Readable Streams out of iterators. - */ - static from(iterable: Iterable | AsyncIterable, options?: ReadableOptions): Readable; - /** - * A utility method for creating a `Readable` from a web `ReadableStream`. - * @since v17.0.0 - * @experimental - */ - static fromWeb(readableStream: streamWeb.ReadableStream, options?: Pick): Readable; - /** - * Returns whether the stream has been read from or cancelled. - * @since v16.8.0 - */ - static isDisturbed(stream: Readable | NodeJS.ReadableStream): boolean; - /** - * A utility method for creating a web `ReadableStream` from a `Readable`. - * @since v17.0.0 - * @experimental - */ - static toWeb(streamReadable: Readable): streamWeb.ReadableStream; - /** - * Returns whether the stream was destroyed or errored before emitting `'end'`. - * @since v16.8.0 - * @experimental - */ - readonly readableAborted: boolean; - /** - * Is `true` if it is safe to call `readable.read()`, which means - * the stream has not been destroyed or emitted `'error'` or `'end'`. - * @since v11.4.0 - */ - readable: boolean; - /** - * Returns whether `'data'` has been emitted. - * @since v16.7.0, v14.18.0 - * @experimental - */ - readonly readableDidRead: boolean; - /** - * Getter for the property `encoding` of a given `Readable` stream. The `encoding`property can be set using the `readable.setEncoding()` method. - * @since v12.7.0 - */ - readonly readableEncoding: BufferEncoding | null; - /** - * Becomes `true` when `'end'` event is emitted. - * @since v12.9.0 - */ - readonly readableEnded: boolean; - /** - * This property reflects the current state of a `Readable` stream as described - * in the `Three states` section. - * @since v9.4.0 - */ - readonly readableFlowing: boolean | null; - /** - * Returns the value of `highWaterMark` passed when creating this `Readable`. - * @since v9.3.0 - */ - readonly readableHighWaterMark: number; - /** - * This property contains the number of bytes (or objects) in the queue - * ready to be read. The value provides introspection data regarding - * the status of the `highWaterMark`. - * @since v9.4.0 - */ - readonly readableLength: number; - /** - * Getter for the property `objectMode` of a given `Readable` stream. - * @since v12.3.0 - */ - readonly readableObjectMode: boolean; - /** - * Is `true` after `readable.destroy()` has been called. - * @since v8.0.0 - */ - destroyed: boolean; - /** - * Is true after 'close' has been emitted. - * @since v18.0.0 - */ - readonly closed: boolean; - /** - * Returns error if the stream has been destroyed with an error. - * @since v18.0.0 - */ - readonly errored: Error | null; - constructor(opts?: ReadableOptions); - _construct?(callback: (error?: Error | null) => void): void; - _read(size: number): void; - /** - * The `readable.read()` method reads data out of the internal buffer and - * returns it. If no data is available to be read, `null` is returned. By default, - * the data is returned as a `Buffer` object unless an encoding has been - * specified using the `readable.setEncoding()` method or the stream is operating - * in object mode. - * - * The optional `size` argument specifies a specific number of bytes to read. If`size` bytes are not available to be read, `null` will be returned _unless_the stream has ended, in which - * case all of the data remaining in the internal - * buffer will be returned. - * - * If the `size` argument is not specified, all of the data contained in the - * internal buffer will be returned. - * - * The `size` argument must be less than or equal to 1 GiB. - * - * The `readable.read()` method should only be called on `Readable` streams - * operating in paused mode. In flowing mode, `readable.read()` is called - * automatically until the internal buffer is fully drained. - * - * ```js - * const readable = getReadableStreamSomehow(); - * - * // 'readable' may be triggered multiple times as data is buffered in - * readable.on('readable', () => { - * let chunk; - * console.log('Stream is readable (new data received in buffer)'); - * // Use a loop to make sure we read all currently available data - * while (null !== (chunk = readable.read())) { - * console.log(`Read ${chunk.length} bytes of data...`); - * } - * }); - * - * // 'end' will be triggered once when there is no more data available - * readable.on('end', () => { - * console.log('Reached end of stream.'); - * }); - * ``` - * - * Each call to `readable.read()` returns a chunk of data, or `null`. The chunks - * are not concatenated. A `while` loop is necessary to consume all data - * currently in the buffer. When reading a large file `.read()` may return `null`, - * having consumed all buffered content so far, but there is still more data to - * come not yet buffered. In this case a new `'readable'` event will be emitted - * when there is more data in the buffer. Finally the `'end'` event will be - * emitted when there is no more data to come. - * - * Therefore to read a file's whole contents from a `readable`, it is necessary - * to collect chunks across multiple `'readable'` events: - * - * ```js - * const chunks = []; - * - * readable.on('readable', () => { - * let chunk; - * while (null !== (chunk = readable.read())) { - * chunks.push(chunk); - * } - * }); - * - * readable.on('end', () => { - * const content = chunks.join(''); - * }); - * ``` - * - * A `Readable` stream in object mode will always return a single item from - * a call to `readable.read(size)`, regardless of the value of the`size` argument. - * - * If the `readable.read()` method returns a chunk of data, a `'data'` event will - * also be emitted. - * - * Calling {@link read} after the `'end'` event has - * been emitted will return `null`. No runtime error will be raised. - * @since v0.9.4 - * @param size Optional argument to specify how much data to read. - */ - read(size?: number): any; - /** - * The `readable.setEncoding()` method sets the character encoding for - * data read from the `Readable` stream. - * - * By default, no encoding is assigned and stream data will be returned as`Buffer` objects. Setting an encoding causes the stream data - * to be returned as strings of the specified encoding rather than as `Buffer`objects. For instance, calling `readable.setEncoding('utf8')` will cause the - * output data to be interpreted as UTF-8 data, and passed as strings. Calling`readable.setEncoding('hex')` will cause the data to be encoded in hexadecimal - * string format. - * - * The `Readable` stream will properly handle multi-byte characters delivered - * through the stream that would otherwise become improperly decoded if simply - * pulled from the stream as `Buffer` objects. - * - * ```js - * const readable = getReadableStreamSomehow(); - * readable.setEncoding('utf8'); - * readable.on('data', (chunk) => { - * assert.equal(typeof chunk, 'string'); - * console.log('Got %d characters of string data:', chunk.length); - * }); - * ``` - * @since v0.9.4 - * @param encoding The encoding to use. - */ - setEncoding(encoding: BufferEncoding): this; - /** - * The `readable.pause()` method will cause a stream in flowing mode to stop - * emitting `'data'` events, switching out of flowing mode. Any data that - * becomes available will remain in the internal buffer. - * - * ```js - * const readable = getReadableStreamSomehow(); - * readable.on('data', (chunk) => { - * console.log(`Received ${chunk.length} bytes of data.`); - * readable.pause(); - * console.log('There will be no additional data for 1 second.'); - * setTimeout(() => { - * console.log('Now data will start flowing again.'); - * readable.resume(); - * }, 1000); - * }); - * ``` - * - * The `readable.pause()` method has no effect if there is a `'readable'`event listener. - * @since v0.9.4 - */ - pause(): this; - /** - * The `readable.resume()` method causes an explicitly paused `Readable` stream to - * resume emitting `'data'` events, switching the stream into flowing mode. - * - * The `readable.resume()` method can be used to fully consume the data from a - * stream without actually processing any of that data: - * - * ```js - * getReadableStreamSomehow() - * .resume() - * .on('end', () => { - * console.log('Reached the end, but did not read anything.'); - * }); - * ``` - * - * The `readable.resume()` method has no effect if there is a `'readable'`event listener. - * @since v0.9.4 - */ - resume(): this; - /** - * The `readable.isPaused()` method returns the current operating state of the`Readable`. This is used primarily by the mechanism that underlies the`readable.pipe()` method. In most - * typical cases, there will be no reason to - * use this method directly. - * - * ```js - * const readable = new stream.Readable(); - * - * readable.isPaused(); // === false - * readable.pause(); - * readable.isPaused(); // === true - * readable.resume(); - * readable.isPaused(); // === false - * ``` - * @since v0.11.14 - */ - isPaused(): boolean; - /** - * The `readable.unpipe()` method detaches a `Writable` stream previously attached - * using the {@link pipe} method. - * - * If the `destination` is not specified, then _all_ pipes are detached. - * - * If the `destination` is specified, but no pipe is set up for it, then - * the method does nothing. - * - * ```js - * const fs = require('fs'); - * const readable = getReadableStreamSomehow(); - * const writable = fs.createWriteStream('file.txt'); - * // All the data from readable goes into 'file.txt', - * // but only for the first second. - * readable.pipe(writable); - * setTimeout(() => { - * console.log('Stop writing to file.txt.'); - * readable.unpipe(writable); - * console.log('Manually close the file stream.'); - * writable.end(); - * }, 1000); - * ``` - * @since v0.9.4 - * @param destination Optional specific stream to unpipe - */ - unpipe(destination?: NodeJS.WritableStream): this; - /** - * Passing `chunk` as `null` signals the end of the stream (EOF) and behaves the - * same as `readable.push(null)`, after which no more data can be written. The EOF - * signal is put at the end of the buffer and any buffered data will still be - * flushed. - * - * The `readable.unshift()` method pushes a chunk of data back into the internal - * buffer. This is useful in certain situations where a stream is being consumed by - * code that needs to "un-consume" some amount of data that it has optimistically - * pulled out of the source, so that the data can be passed on to some other party. - * - * The `stream.unshift(chunk)` method cannot be called after the `'end'` event - * has been emitted or a runtime error will be thrown. - * - * Developers using `stream.unshift()` often should consider switching to - * use of a `Transform` stream instead. See the `API for stream implementers` section for more information. - * - * ```js - * // Pull off a header delimited by \n\n. - * // Use unshift() if we get too much. - * // Call the callback with (error, header, stream). - * const { StringDecoder } = require('string_decoder'); - * function parseHeader(stream, callback) { - * stream.on('error', callback); - * stream.on('readable', onReadable); - * const decoder = new StringDecoder('utf8'); - * let header = ''; - * function onReadable() { - * let chunk; - * while (null !== (chunk = stream.read())) { - * const str = decoder.write(chunk); - * if (str.includes('\n\n')) { - * // Found the header boundary. - * const split = str.split(/\n\n/); - * header += split.shift(); - * const remaining = split.join('\n\n'); - * const buf = Buffer.from(remaining, 'utf8'); - * stream.removeListener('error', callback); - * // Remove the 'readable' listener before unshifting. - * stream.removeListener('readable', onReadable); - * if (buf.length) - * stream.unshift(buf); - * // Now the body of the message can be read from the stream. - * callback(null, header, stream); - * return; - * } - * // Still reading the header. - * header += str; - * } - * } - * } - * ``` - * - * Unlike {@link push}, `stream.unshift(chunk)` will not - * end the reading process by resetting the internal reading state of the stream. - * This can cause unexpected results if `readable.unshift()` is called during a - * read (i.e. from within a {@link _read} implementation on a - * custom stream). Following the call to `readable.unshift()` with an immediate {@link push} will reset the reading state appropriately, - * however it is best to simply avoid calling `readable.unshift()` while in the - * process of performing a read. - * @since v0.9.11 - * @param chunk Chunk of data to unshift onto the read queue. For streams not operating in object mode, `chunk` must be a string, `Buffer`, `Uint8Array` or `null`. For object mode - * streams, `chunk` may be any JavaScript value. - * @param encoding Encoding of string chunks. Must be a valid `Buffer` encoding, such as `'utf8'` or `'ascii'`. - */ - unshift(chunk: any, encoding?: BufferEncoding): void; - /** - * Prior to Node.js 0.10, streams did not implement the entire `stream` module API - * as it is currently defined. (See `Compatibility` for more information.) - * - * When using an older Node.js library that emits `'data'` events and has a {@link pause} method that is advisory only, the`readable.wrap()` method can be used to create a `Readable` - * stream that uses - * the old stream as its data source. - * - * It will rarely be necessary to use `readable.wrap()` but the method has been - * provided as a convenience for interacting with older Node.js applications and - * libraries. - * - * ```js - * const { OldReader } = require('./old-api-module.js'); - * const { Readable } = require('stream'); - * const oreader = new OldReader(); - * const myReader = new Readable().wrap(oreader); - * - * myReader.on('readable', () => { - * myReader.read(); // etc. - * }); - * ``` - * @since v0.9.4 - * @param stream An "old style" readable stream - */ - wrap(stream: NodeJS.ReadableStream): this; - push(chunk: any, encoding?: BufferEncoding): boolean; - _destroy(error: Error | null, callback: (error?: Error | null) => void): void; - /** - * Destroy the stream. Optionally emit an `'error'` event, and emit a `'close'`event (unless `emitClose` is set to `false`). After this call, the readable - * stream will release any internal resources and subsequent calls to `push()`will be ignored. - * - * Once `destroy()` has been called any further calls will be a no-op and no - * further errors except from `_destroy()` may be emitted as `'error'`. - * - * Implementors should not override this method, but instead implement `readable._destroy()`. - * @since v8.0.0 - * @param error Error which will be passed as payload in `'error'` event - */ - destroy(error?: Error): this; - /** - * Event emitter - * The defined events on documents including: - * 1. close - * 2. data - * 3. end - * 4. error - * 5. pause - * 6. readable - * 7. resume - */ - addListener(event: 'close', listener: () => void): this; - addListener(event: 'data', listener: (chunk: any) => void): this; - addListener(event: 'end', listener: () => void): this; - addListener(event: 'error', listener: (err: Error) => void): this; - addListener(event: 'pause', listener: () => void): this; - addListener(event: 'readable', listener: () => void): this; - addListener(event: 'resume', listener: () => void): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - emit(event: 'close'): boolean; - emit(event: 'data', chunk: any): boolean; - emit(event: 'end'): boolean; - emit(event: 'error', err: Error): boolean; - emit(event: 'pause'): boolean; - emit(event: 'readable'): boolean; - emit(event: 'resume'): boolean; - emit(event: string | symbol, ...args: any[]): boolean; - on(event: 'close', listener: () => void): this; - on(event: 'data', listener: (chunk: any) => void): this; - on(event: 'end', listener: () => void): this; - on(event: 'error', listener: (err: Error) => void): this; - on(event: 'pause', listener: () => void): this; - on(event: 'readable', listener: () => void): this; - on(event: 'resume', listener: () => void): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once(event: 'close', listener: () => void): this; - once(event: 'data', listener: (chunk: any) => void): this; - once(event: 'end', listener: () => void): this; - once(event: 'error', listener: (err: Error) => void): this; - once(event: 'pause', listener: () => void): this; - once(event: 'readable', listener: () => void): this; - once(event: 'resume', listener: () => void): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener(event: 'close', listener: () => void): this; - prependListener(event: 'data', listener: (chunk: any) => void): this; - prependListener(event: 'end', listener: () => void): this; - prependListener(event: 'error', listener: (err: Error) => void): this; - prependListener(event: 'pause', listener: () => void): this; - prependListener(event: 'readable', listener: () => void): this; - prependListener(event: 'resume', listener: () => void): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - prependOnceListener(event: 'close', listener: () => void): this; - prependOnceListener(event: 'data', listener: (chunk: any) => void): this; - prependOnceListener(event: 'end', listener: () => void): this; - prependOnceListener(event: 'error', listener: (err: Error) => void): this; - prependOnceListener(event: 'pause', listener: () => void): this; - prependOnceListener(event: 'readable', listener: () => void): this; - prependOnceListener(event: 'resume', listener: () => void): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - removeListener(event: 'close', listener: () => void): this; - removeListener(event: 'data', listener: (chunk: any) => void): this; - removeListener(event: 'end', listener: () => void): this; - removeListener(event: 'error', listener: (err: Error) => void): this; - removeListener(event: 'pause', listener: () => void): this; - removeListener(event: 'readable', listener: () => void): this; - removeListener(event: 'resume', listener: () => void): this; - removeListener(event: string | symbol, listener: (...args: any[]) => void): this; - [Symbol.asyncIterator](): AsyncIterableIterator; - } - interface WritableOptions extends StreamOptions { - decodeStrings?: boolean | undefined; - defaultEncoding?: BufferEncoding | undefined; - write?(this: Writable, chunk: any, encoding: BufferEncoding, callback: (error?: Error | null) => void): void; - writev?( - this: Writable, - chunks: Array<{ - chunk: any; - encoding: BufferEncoding; - }>, - callback: (error?: Error | null) => void - ): void; - final?(this: Writable, callback: (error?: Error | null) => void): void; - } - /** - * @since v0.9.4 - */ - class Writable extends Stream implements NodeJS.WritableStream { - /** - * A utility method for creating a `Writable` from a web `WritableStream`. - * @since v17.0.0 - * @experimental - */ - static fromWeb(writableStream: streamWeb.WritableStream, options?: Pick): Writable; - /** - * A utility method for creating a web `WritableStream` from a `Writable`. - * @since v17.0.0 - * @experimental - */ - static toWeb(streamWritable: Writable): streamWeb.WritableStream; - /** - * Is `true` if it is safe to call `writable.write()`, which means - * the stream has not been destroyed, errored or ended. - * @since v11.4.0 - */ - readonly writable: boolean; - /** - * Is `true` after `writable.end()` has been called. This property - * does not indicate whether the data has been flushed, for this use `writable.writableFinished` instead. - * @since v12.9.0 - */ - readonly writableEnded: boolean; - /** - * Is set to `true` immediately before the `'finish'` event is emitted. - * @since v12.6.0 - */ - readonly writableFinished: boolean; - /** - * Return the value of `highWaterMark` passed when creating this `Writable`. - * @since v9.3.0 - */ - readonly writableHighWaterMark: number; - /** - * This property contains the number of bytes (or objects) in the queue - * ready to be written. The value provides introspection data regarding - * the status of the `highWaterMark`. - * @since v9.4.0 - */ - readonly writableLength: number; - /** - * Getter for the property `objectMode` of a given `Writable` stream. - * @since v12.3.0 - */ - readonly writableObjectMode: boolean; - /** - * Number of times `writable.uncork()` needs to be - * called in order to fully uncork the stream. - * @since v13.2.0, v12.16.0 - */ - readonly writableCorked: number; - /** - * Is `true` after `writable.destroy()` has been called. - * @since v8.0.0 - */ - destroyed: boolean; - /** - * Is true after 'close' has been emitted. - * @since v18.0.0 - */ - readonly closed: boolean; - /** - * Returns error if the stream has been destroyed with an error. - * @since v18.0.0 - */ - readonly errored: Error | null; - /** - * Is `true` if the stream's buffer has been full and stream will emit 'drain'. - * @since v15.2.0, v14.17.0 - */ - readonly writableNeedDrain: boolean; - constructor(opts?: WritableOptions); - _write(chunk: any, encoding: BufferEncoding, callback: (error?: Error | null) => void): void; - _writev?( - chunks: Array<{ - chunk: any; - encoding: BufferEncoding; - }>, - callback: (error?: Error | null) => void - ): void; - _construct?(callback: (error?: Error | null) => void): void; - _destroy(error: Error | null, callback: (error?: Error | null) => void): void; - _final(callback: (error?: Error | null) => void): void; - /** - * The `writable.write()` method writes some data to the stream, and calls the - * supplied `callback` once the data has been fully handled. If an error - * occurs, the `callback` will be called with the error as its - * first argument. The `callback` is called asynchronously and before `'error'` is - * emitted. - * - * The return value is `true` if the internal buffer is less than the`highWaterMark` configured when the stream was created after admitting `chunk`. - * If `false` is returned, further attempts to write data to the stream should - * stop until the `'drain'` event is emitted. - * - * While a stream is not draining, calls to `write()` will buffer `chunk`, and - * return false. Once all currently buffered chunks are drained (accepted for - * delivery by the operating system), the `'drain'` event will be emitted. - * Once `write()` returns false, do not write more chunks - * until the `'drain'` event is emitted. While calling `write()` on a stream that - * is not draining is allowed, Node.js will buffer all written chunks until - * maximum memory usage occurs, at which point it will abort unconditionally. - * Even before it aborts, high memory usage will cause poor garbage collector - * performance and high RSS (which is not typically released back to the system, - * even after the memory is no longer required). Since TCP sockets may never - * drain if the remote peer does not read the data, writing a socket that is - * not draining may lead to a remotely exploitable vulnerability. - * - * Writing data while the stream is not draining is particularly - * problematic for a `Transform`, because the `Transform` streams are paused - * by default until they are piped or a `'data'` or `'readable'` event handler - * is added. - * - * If the data to be written can be generated or fetched on demand, it is - * recommended to encapsulate the logic into a `Readable` and use {@link pipe}. However, if calling `write()` is preferred, it is - * possible to respect backpressure and avoid memory issues using the `'drain'` event: - * - * ```js - * function write(data, cb) { - * if (!stream.write(data)) { - * stream.once('drain', cb); - * } else { - * process.nextTick(cb); - * } - * } - * - * // Wait for cb to be called before doing any other write. - * write('hello', () => { - * console.log('Write completed, do more writes now.'); - * }); - * ``` - * - * A `Writable` stream in object mode will always ignore the `encoding` argument. - * @since v0.9.4 - * @param chunk Optional data to write. For streams not operating in object mode, `chunk` must be a string, `Buffer` or `Uint8Array`. For object mode streams, `chunk` may be any - * JavaScript value other than `null`. - * @param [encoding='utf8'] The encoding, if `chunk` is a string. - * @param callback Callback for when this chunk of data is flushed. - * @return `false` if the stream wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`. - */ - write(chunk: any, callback?: (error: Error | null | undefined) => void): boolean; - write(chunk: any, encoding: BufferEncoding, callback?: (error: Error | null | undefined) => void): boolean; - /** - * The `writable.setDefaultEncoding()` method sets the default `encoding` for a `Writable` stream. - * @since v0.11.15 - * @param encoding The new default encoding - */ - setDefaultEncoding(encoding: BufferEncoding): this; - /** - * Calling the `writable.end()` method signals that no more data will be written - * to the `Writable`. The optional `chunk` and `encoding` arguments allow one - * final additional chunk of data to be written immediately before closing the - * stream. - * - * Calling the {@link write} method after calling {@link end} will raise an error. - * - * ```js - * // Write 'hello, ' and then end with 'world!'. - * const fs = require('fs'); - * const file = fs.createWriteStream('example.txt'); - * file.write('hello, '); - * file.end('world!'); - * // Writing more now is not allowed! - * ``` - * @since v0.9.4 - * @param chunk Optional data to write. For streams not operating in object mode, `chunk` must be a string, `Buffer` or `Uint8Array`. For object mode streams, `chunk` may be any - * JavaScript value other than `null`. - * @param encoding The encoding if `chunk` is a string - * @param callback Callback for when the stream is finished. - */ - end(cb?: () => void): this; - end(chunk: any, cb?: () => void): this; - end(chunk: any, encoding: BufferEncoding, cb?: () => void): this; - /** - * The `writable.cork()` method forces all written data to be buffered in memory. - * The buffered data will be flushed when either the {@link uncork} or {@link end} methods are called. - * - * The primary intent of `writable.cork()` is to accommodate a situation in which - * several small chunks are written to the stream in rapid succession. Instead of - * immediately forwarding them to the underlying destination, `writable.cork()`buffers all the chunks until `writable.uncork()` is called, which will pass them - * all to `writable._writev()`, if present. This prevents a head-of-line blocking - * situation where data is being buffered while waiting for the first small chunk - * to be processed. However, use of `writable.cork()` without implementing`writable._writev()` may have an adverse effect on throughput. - * - * See also: `writable.uncork()`, `writable._writev()`. - * @since v0.11.2 - */ - cork(): void; - /** - * The `writable.uncork()` method flushes all data buffered since {@link cork} was called. - * - * When using `writable.cork()` and `writable.uncork()` to manage the buffering - * of writes to a stream, defer calls to `writable.uncork()` using`process.nextTick()`. Doing so allows batching of all`writable.write()` calls that occur within a given Node.js event - * loop phase. - * - * ```js - * stream.cork(); - * stream.write('some '); - * stream.write('data '); - * process.nextTick(() => stream.uncork()); - * ``` - * - * If the `writable.cork()` method is called multiple times on a stream, the - * same number of calls to `writable.uncork()` must be called to flush the buffered - * data. - * - * ```js - * stream.cork(); - * stream.write('some '); - * stream.cork(); - * stream.write('data '); - * process.nextTick(() => { - * stream.uncork(); - * // The data will not be flushed until uncork() is called a second time. - * stream.uncork(); - * }); - * ``` - * - * See also: `writable.cork()`. - * @since v0.11.2 - */ - uncork(): void; - /** - * Destroy the stream. Optionally emit an `'error'` event, and emit a `'close'`event (unless `emitClose` is set to `false`). After this call, the writable - * stream has ended and subsequent calls to `write()` or `end()` will result in - * an `ERR_STREAM_DESTROYED` error. - * This is a destructive and immediate way to destroy a stream. Previous calls to`write()` may not have drained, and may trigger an `ERR_STREAM_DESTROYED` error. - * Use `end()` instead of destroy if data should flush before close, or wait for - * the `'drain'` event before destroying the stream. - * - * Once `destroy()` has been called any further calls will be a no-op and no - * further errors except from `_destroy()` may be emitted as `'error'`. - * - * Implementors should not override this method, - * but instead implement `writable._destroy()`. - * @since v8.0.0 - * @param error Optional, an error to emit with `'error'` event. - */ - destroy(error?: Error): this; - /** - * Event emitter - * The defined events on documents including: - * 1. close - * 2. drain - * 3. error - * 4. finish - * 5. pipe - * 6. unpipe - */ - addListener(event: 'close', listener: () => void): this; - addListener(event: 'drain', listener: () => void): this; - addListener(event: 'error', listener: (err: Error) => void): this; - addListener(event: 'finish', listener: () => void): this; - addListener(event: 'pipe', listener: (src: Readable) => void): this; - addListener(event: 'unpipe', listener: (src: Readable) => void): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - emit(event: 'close'): boolean; - emit(event: 'drain'): boolean; - emit(event: 'error', err: Error): boolean; - emit(event: 'finish'): boolean; - emit(event: 'pipe', src: Readable): boolean; - emit(event: 'unpipe', src: Readable): boolean; - emit(event: string | symbol, ...args: any[]): boolean; - on(event: 'close', listener: () => void): this; - on(event: 'drain', listener: () => void): this; - on(event: 'error', listener: (err: Error) => void): this; - on(event: 'finish', listener: () => void): this; - on(event: 'pipe', listener: (src: Readable) => void): this; - on(event: 'unpipe', listener: (src: Readable) => void): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once(event: 'close', listener: () => void): this; - once(event: 'drain', listener: () => void): this; - once(event: 'error', listener: (err: Error) => void): this; - once(event: 'finish', listener: () => void): this; - once(event: 'pipe', listener: (src: Readable) => void): this; - once(event: 'unpipe', listener: (src: Readable) => void): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener(event: 'close', listener: () => void): this; - prependListener(event: 'drain', listener: () => void): this; - prependListener(event: 'error', listener: (err: Error) => void): this; - prependListener(event: 'finish', listener: () => void): this; - prependListener(event: 'pipe', listener: (src: Readable) => void): this; - prependListener(event: 'unpipe', listener: (src: Readable) => void): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - prependOnceListener(event: 'close', listener: () => void): this; - prependOnceListener(event: 'drain', listener: () => void): this; - prependOnceListener(event: 'error', listener: (err: Error) => void): this; - prependOnceListener(event: 'finish', listener: () => void): this; - prependOnceListener(event: 'pipe', listener: (src: Readable) => void): this; - prependOnceListener(event: 'unpipe', listener: (src: Readable) => void): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - removeListener(event: 'close', listener: () => void): this; - removeListener(event: 'drain', listener: () => void): this; - removeListener(event: 'error', listener: (err: Error) => void): this; - removeListener(event: 'finish', listener: () => void): this; - removeListener(event: 'pipe', listener: (src: Readable) => void): this; - removeListener(event: 'unpipe', listener: (src: Readable) => void): this; - removeListener(event: string | symbol, listener: (...args: any[]) => void): this; - } - interface DuplexOptions extends ReadableOptions, WritableOptions { - allowHalfOpen?: boolean | undefined; - readableObjectMode?: boolean | undefined; - writableObjectMode?: boolean | undefined; - readableHighWaterMark?: number | undefined; - writableHighWaterMark?: number | undefined; - writableCorked?: number | undefined; - construct?(this: Duplex, callback: (error?: Error | null) => void): void; - read?(this: Duplex, size: number): void; - write?(this: Duplex, chunk: any, encoding: BufferEncoding, callback: (error?: Error | null) => void): void; - writev?( - this: Duplex, - chunks: Array<{ - chunk: any; - encoding: BufferEncoding; - }>, - callback: (error?: Error | null) => void - ): void; - final?(this: Duplex, callback: (error?: Error | null) => void): void; - destroy?(this: Duplex, error: Error | null, callback: (error: Error | null) => void): void; - } - /** - * Duplex streams are streams that implement both the `Readable` and `Writable` interfaces. - * - * Examples of `Duplex` streams include: - * - * * `TCP sockets` - * * `zlib streams` - * * `crypto streams` - * @since v0.9.4 - */ - class Duplex extends Readable implements Writable { - readonly writable: boolean; - readonly writableEnded: boolean; - readonly writableFinished: boolean; - readonly writableHighWaterMark: number; - readonly writableLength: number; - readonly writableObjectMode: boolean; - readonly writableCorked: number; - readonly writableNeedDrain: boolean; - readonly closed: boolean; - readonly errored: Error | null; - /** - * If `false` then the stream will automatically end the writable side when the - * readable side ends. Set initially by the `allowHalfOpen` constructor option, - * which defaults to `false`. - * - * This can be changed manually to change the half-open behavior of an existing`Duplex` stream instance, but must be changed before the `'end'` event is - * emitted. - * @since v0.9.4 - */ - allowHalfOpen: boolean; - constructor(opts?: DuplexOptions); - /** - * A utility method for creating duplex streams. - * - * - `Stream` converts writable stream into writable `Duplex` and readable stream - * to `Duplex`. - * - `Blob` converts into readable `Duplex`. - * - `string` converts into readable `Duplex`. - * - `ArrayBuffer` converts into readable `Duplex`. - * - `AsyncIterable` converts into a readable `Duplex`. Cannot yield `null`. - * - `AsyncGeneratorFunction` converts into a readable/writable transform - * `Duplex`. Must take a source `AsyncIterable` as first parameter. Cannot yield - * `null`. - * - `AsyncFunction` converts into a writable `Duplex`. Must return - * either `null` or `undefined` - * - `Object ({ writable, readable })` converts `readable` and - * `writable` into `Stream` and then combines them into `Duplex` where the - * `Duplex` will write to the `writable` and read from the `readable`. - * - `Promise` converts into readable `Duplex`. Value `null` is ignored. - * - * @since v16.8.0 - */ - static from(src: Stream | NodeBlob | ArrayBuffer | string | Iterable | AsyncIterable | AsyncGeneratorFunction | Promise | Object): Duplex; - _write(chunk: any, encoding: BufferEncoding, callback: (error?: Error | null) => void): void; - _writev?( - chunks: Array<{ - chunk: any; - encoding: BufferEncoding; - }>, - callback: (error?: Error | null) => void - ): void; - _destroy(error: Error | null, callback: (error: Error | null) => void): void; - _final(callback: (error?: Error | null) => void): void; - write(chunk: any, encoding?: BufferEncoding, cb?: (error: Error | null | undefined) => void): boolean; - write(chunk: any, cb?: (error: Error | null | undefined) => void): boolean; - setDefaultEncoding(encoding: BufferEncoding): this; - end(cb?: () => void): this; - end(chunk: any, cb?: () => void): this; - end(chunk: any, encoding?: BufferEncoding, cb?: () => void): this; - cork(): void; - uncork(): void; - } - type TransformCallback = (error?: Error | null, data?: any) => void; - interface TransformOptions extends DuplexOptions { - construct?(this: Transform, callback: (error?: Error | null) => void): void; - read?(this: Transform, size: number): void; - write?(this: Transform, chunk: any, encoding: BufferEncoding, callback: (error?: Error | null) => void): void; - writev?( - this: Transform, - chunks: Array<{ - chunk: any; - encoding: BufferEncoding; - }>, - callback: (error?: Error | null) => void - ): void; - final?(this: Transform, callback: (error?: Error | null) => void): void; - destroy?(this: Transform, error: Error | null, callback: (error: Error | null) => void): void; - transform?(this: Transform, chunk: any, encoding: BufferEncoding, callback: TransformCallback): void; - flush?(this: Transform, callback: TransformCallback): void; - } - /** - * Transform streams are `Duplex` streams where the output is in some way - * related to the input. Like all `Duplex` streams, `Transform` streams - * implement both the `Readable` and `Writable` interfaces. - * - * Examples of `Transform` streams include: - * - * * `zlib streams` - * * `crypto streams` - * @since v0.9.4 - */ - class Transform extends Duplex { - constructor(opts?: TransformOptions); - _transform(chunk: any, encoding: BufferEncoding, callback: TransformCallback): void; - _flush(callback: TransformCallback): void; - } - /** - * The `stream.PassThrough` class is a trivial implementation of a `Transform` stream that simply passes the input bytes across to the output. Its purpose is - * primarily for examples and testing, but there are some use cases where`stream.PassThrough` is useful as a building block for novel sorts of streams. - */ - class PassThrough extends Transform {} - /** - * Attaches an AbortSignal to a readable or writeable stream. This lets code - * control stream destruction using an `AbortController`. - * - * Calling `abort` on the `AbortController` corresponding to the passed`AbortSignal` will behave the same way as calling `.destroy(new AbortError())`on the stream. - * - * ```js - * const fs = require('fs'); - * - * const controller = new AbortController(); - * const read = addAbortSignal( - * controller.signal, - * fs.createReadStream(('object.json')) - * ); - * // Later, abort the operation closing the stream - * controller.abort(); - * ``` - * - * Or using an `AbortSignal` with a readable stream as an async iterable: - * - * ```js - * const controller = new AbortController(); - * setTimeout(() => controller.abort(), 10_000); // set a timeout - * const stream = addAbortSignal( - * controller.signal, - * fs.createReadStream(('object.json')) - * ); - * (async () => { - * try { - * for await (const chunk of stream) { - * await process(chunk); - * } - * } catch (e) { - * if (e.name === 'AbortError') { - * // The operation was cancelled - * } else { - * throw e; - * } - * } - * })(); - * ``` - * @since v15.4.0 - * @param signal A signal representing possible cancellation - * @param stream a stream to attach a signal to - */ - function addAbortSignal(signal: AbortSignal, stream: T): T; - interface FinishedOptions extends Abortable { - error?: boolean | undefined; - readable?: boolean | undefined; - writable?: boolean | undefined; - } - /** - * A function to get notified when a stream is no longer readable, writable - * or has experienced an error or a premature close event. - * - * ```js - * const { finished } = require('stream'); - * - * const rs = fs.createReadStream('archive.tar'); - * - * finished(rs, (err) => { - * if (err) { - * console.error('Stream failed.', err); - * } else { - * console.log('Stream is done reading.'); - * } - * }); - * - * rs.resume(); // Drain the stream. - * ``` - * - * Especially useful in error handling scenarios where a stream is destroyed - * prematurely (like an aborted HTTP request), and will not emit `'end'`or `'finish'`. - * - * The `finished` API provides promise version: - * - * ```js - * const { finished } = require('stream/promises'); - * - * const rs = fs.createReadStream('archive.tar'); - * - * async function run() { - * await finished(rs); - * console.log('Stream is done reading.'); - * } - * - * run().catch(console.error); - * rs.resume(); // Drain the stream. - * ``` - * - * `stream.finished()` leaves dangling event listeners (in particular`'error'`, `'end'`, `'finish'` and `'close'`) after `callback` has been - * invoked. The reason for this is so that unexpected `'error'` events (due to - * incorrect stream implementations) do not cause unexpected crashes. - * If this is unwanted behavior then the returned cleanup function needs to be - * invoked in the callback: - * - * ```js - * const cleanup = finished(rs, (err) => { - * cleanup(); - * // ... - * }); - * ``` - * @since v10.0.0 - * @param stream A readable and/or writable stream. - * @param callback A callback function that takes an optional error argument. - * @return A cleanup function which removes all registered listeners. - */ - function finished(stream: NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream, options: FinishedOptions, callback: (err?: NodeJS.ErrnoException | null) => void): () => void; - function finished(stream: NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream, callback: (err?: NodeJS.ErrnoException | null) => void): () => void; - namespace finished { - function __promisify__(stream: NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream, options?: FinishedOptions): Promise; - } - type PipelineSourceFunction = () => Iterable | AsyncIterable; - type PipelineSource = Iterable | AsyncIterable | NodeJS.ReadableStream | PipelineSourceFunction; - type PipelineTransform, U> = - | NodeJS.ReadWriteStream - | ((source: S extends (...args: any[]) => Iterable | AsyncIterable ? AsyncIterable : S) => AsyncIterable); - type PipelineTransformSource = PipelineSource | PipelineTransform; - type PipelineDestinationIterableFunction = (source: AsyncIterable) => AsyncIterable; - type PipelineDestinationPromiseFunction = (source: AsyncIterable) => Promise

; - type PipelineDestination, P> = S extends PipelineTransformSource - ? NodeJS.WritableStream | PipelineDestinationIterableFunction | PipelineDestinationPromiseFunction - : never; - type PipelineCallback> = S extends PipelineDestinationPromiseFunction - ? (err: NodeJS.ErrnoException | null, value: P) => void - : (err: NodeJS.ErrnoException | null) => void; - type PipelinePromise> = S extends PipelineDestinationPromiseFunction ? Promise

: Promise; - interface PipelineOptions { - signal: AbortSignal; - } - /** - * A module method to pipe between streams and generators forwarding errors and - * properly cleaning up and provide a callback when the pipeline is complete. - * - * ```js - * const { pipeline } = require('stream'); - * const fs = require('fs'); - * const zlib = require('zlib'); - * - * // Use the pipeline API to easily pipe a series of streams - * // together and get notified when the pipeline is fully done. - * - * // A pipeline to gzip a potentially huge tar file efficiently: - * - * pipeline( - * fs.createReadStream('archive.tar'), - * zlib.createGzip(), - * fs.createWriteStream('archive.tar.gz'), - * (err) => { - * if (err) { - * console.error('Pipeline failed.', err); - * } else { - * console.log('Pipeline succeeded.'); - * } - * } - * ); - * ``` - * - * The `pipeline` API provides a promise version, which can also - * receive an options argument as the last parameter with a`signal` `AbortSignal` property. When the signal is aborted,`destroy` will be called on the underlying pipeline, with - * an`AbortError`. - * - * ```js - * const { pipeline } = require('stream/promises'); - * - * async function run() { - * await pipeline( - * fs.createReadStream('archive.tar'), - * zlib.createGzip(), - * fs.createWriteStream('archive.tar.gz') - * ); - * console.log('Pipeline succeeded.'); - * } - * - * run().catch(console.error); - * ``` - * - * To use an `AbortSignal`, pass it inside an options object, - * as the last argument: - * - * ```js - * const { pipeline } = require('stream/promises'); - * - * async function run() { - * const ac = new AbortController(); - * const signal = ac.signal; - * - * setTimeout(() => ac.abort(), 1); - * await pipeline( - * fs.createReadStream('archive.tar'), - * zlib.createGzip(), - * fs.createWriteStream('archive.tar.gz'), - * { signal }, - * ); - * } - * - * run().catch(console.error); // AbortError - * ``` - * - * The `pipeline` API also supports async generators: - * - * ```js - * const { pipeline } = require('stream/promises'); - * const fs = require('fs'); - * - * async function run() { - * await pipeline( - * fs.createReadStream('lowercase.txt'), - * async function* (source, { signal }) { - * source.setEncoding('utf8'); // Work with strings rather than `Buffer`s. - * for await (const chunk of source) { - * yield await processChunk(chunk, { signal }); - * } - * }, - * fs.createWriteStream('uppercase.txt') - * ); - * console.log('Pipeline succeeded.'); - * } - * - * run().catch(console.error); - * ``` - * - * Remember to handle the `signal` argument passed into the async generator. - * Especially in the case where the async generator is the source for the - * pipeline (i.e. first argument) or the pipeline will never complete. - * - * ```js - * const { pipeline } = require('stream/promises'); - * const fs = require('fs'); - * - * async function run() { - * await pipeline( - * async function* ({ signal }) { - * await someLongRunningfn({ signal }); - * yield 'asd'; - * }, - * fs.createWriteStream('uppercase.txt') - * ); - * console.log('Pipeline succeeded.'); - * } - * - * run().catch(console.error); - * ``` - * - * `stream.pipeline()` will call `stream.destroy(err)` on all streams except: - * - * * `Readable` streams which have emitted `'end'` or `'close'`. - * * `Writable` streams which have emitted `'finish'` or `'close'`. - * - * `stream.pipeline()` leaves dangling event listeners on the streams - * after the `callback` has been invoked. In the case of reuse of streams after - * failure, this can cause event listener leaks and swallowed errors. If the last - * stream is readable, dangling event listeners will be removed so that the last - * stream can be consumed later. - * - * `stream.pipeline()` closes all the streams when an error is raised. - * The `IncomingRequest` usage with `pipeline` could lead to an unexpected behavior - * once it would destroy the socket without sending the expected response. - * See the example below: - * - * ```js - * const fs = require('fs'); - * const http = require('http'); - * const { pipeline } = require('stream'); - * - * const server = http.createServer((req, res) => { - * const fileStream = fs.createReadStream('./fileNotExist.txt'); - * pipeline(fileStream, res, (err) => { - * if (err) { - * console.log(err); // No such file - * // this message can't be sent once `pipeline` already destroyed the socket - * return res.end('error!!!'); - * } - * }); - * }); - * ``` - * @since v10.0.0 - * @param callback Called when the pipeline is fully done. - */ - function pipeline, B extends PipelineDestination>( - source: A, - destination: B, - callback?: PipelineCallback - ): B extends NodeJS.WritableStream ? B : NodeJS.WritableStream; - function pipeline, T1 extends PipelineTransform, B extends PipelineDestination>( - source: A, - transform1: T1, - destination: B, - callback?: PipelineCallback - ): B extends NodeJS.WritableStream ? B : NodeJS.WritableStream; - function pipeline, T1 extends PipelineTransform, T2 extends PipelineTransform, B extends PipelineDestination>( - source: A, - transform1: T1, - transform2: T2, - destination: B, - callback?: PipelineCallback - ): B extends NodeJS.WritableStream ? B : NodeJS.WritableStream; - function pipeline< - A extends PipelineSource, - T1 extends PipelineTransform, - T2 extends PipelineTransform, - T3 extends PipelineTransform, - B extends PipelineDestination - >(source: A, transform1: T1, transform2: T2, transform3: T3, destination: B, callback?: PipelineCallback): B extends NodeJS.WritableStream ? B : NodeJS.WritableStream; - function pipeline< - A extends PipelineSource, - T1 extends PipelineTransform, - T2 extends PipelineTransform, - T3 extends PipelineTransform, - T4 extends PipelineTransform, - B extends PipelineDestination - >(source: A, transform1: T1, transform2: T2, transform3: T3, transform4: T4, destination: B, callback?: PipelineCallback): B extends NodeJS.WritableStream ? B : NodeJS.WritableStream; - function pipeline( - streams: ReadonlyArray, - callback?: (err: NodeJS.ErrnoException | null) => void - ): NodeJS.WritableStream; - function pipeline( - stream1: NodeJS.ReadableStream, - stream2: NodeJS.ReadWriteStream | NodeJS.WritableStream, - ...streams: Array void)> - ): NodeJS.WritableStream; - namespace pipeline { - function __promisify__, B extends PipelineDestination>(source: A, destination: B, options?: PipelineOptions): PipelinePromise; - function __promisify__, T1 extends PipelineTransform, B extends PipelineDestination>( - source: A, - transform1: T1, - destination: B, - options?: PipelineOptions - ): PipelinePromise; - function __promisify__, T1 extends PipelineTransform, T2 extends PipelineTransform, B extends PipelineDestination>( - source: A, - transform1: T1, - transform2: T2, - destination: B, - options?: PipelineOptions - ): PipelinePromise; - function __promisify__< - A extends PipelineSource, - T1 extends PipelineTransform, - T2 extends PipelineTransform, - T3 extends PipelineTransform, - B extends PipelineDestination - >(source: A, transform1: T1, transform2: T2, transform3: T3, destination: B, options?: PipelineOptions): PipelinePromise; - function __promisify__< - A extends PipelineSource, - T1 extends PipelineTransform, - T2 extends PipelineTransform, - T3 extends PipelineTransform, - T4 extends PipelineTransform, - B extends PipelineDestination - >(source: A, transform1: T1, transform2: T2, transform3: T3, transform4: T4, destination: B, options?: PipelineOptions): PipelinePromise; - function __promisify__(streams: ReadonlyArray, options?: PipelineOptions): Promise; - function __promisify__( - stream1: NodeJS.ReadableStream, - stream2: NodeJS.ReadWriteStream | NodeJS.WritableStream, - ...streams: Array - ): Promise; - } - interface Pipe { - close(): void; - hasRef(): boolean; - ref(): void; - unref(): void; - } - - /** - * Returns whether the stream has encountered an error. - * @since v17.3.0 - */ - function isErrored(stream: Readable | Writable | NodeJS.ReadableStream | NodeJS.WritableStream): boolean; - - /** - * Returns whether the stream is readable. - * @since v17.4.0 - */ - function isReadable(stream: Readable | NodeJS.ReadableStream): boolean; - - const promises: typeof streamPromises; - const consumers: typeof streamConsumers; - } - export = internal; -} -declare module 'node:stream' { - import stream = require('stream'); - export = stream; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/stream/consumers.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/stream/consumers.d.ts deleted file mode 100755 index 1ebf12e1..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/stream/consumers.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -declare module 'stream/consumers' { - import { Blob as NodeBlob } from "node:buffer"; - import { Readable } from 'node:stream'; - function buffer(stream: NodeJS.ReadableStream | Readable | AsyncIterator): Promise; - function text(stream: NodeJS.ReadableStream | Readable | AsyncIterator): Promise; - function arrayBuffer(stream: NodeJS.ReadableStream | Readable | AsyncIterator): Promise; - function blob(stream: NodeJS.ReadableStream | Readable | AsyncIterator): Promise; - function json(stream: NodeJS.ReadableStream | Readable | AsyncIterator): Promise; -} -declare module 'node:stream/consumers' { - export * from 'stream/consumers'; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/stream/promises.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/stream/promises.d.ts deleted file mode 100755 index b427073d..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/stream/promises.d.ts +++ /dev/null @@ -1,42 +0,0 @@ -declare module 'stream/promises' { - import { FinishedOptions, PipelineSource, PipelineTransform, PipelineDestination, PipelinePromise, PipelineOptions } from 'node:stream'; - function finished(stream: NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream, options?: FinishedOptions): Promise; - function pipeline, B extends PipelineDestination>(source: A, destination: B, options?: PipelineOptions): PipelinePromise; - function pipeline, T1 extends PipelineTransform, B extends PipelineDestination>( - source: A, - transform1: T1, - destination: B, - options?: PipelineOptions - ): PipelinePromise; - function pipeline, T1 extends PipelineTransform, T2 extends PipelineTransform, B extends PipelineDestination>( - source: A, - transform1: T1, - transform2: T2, - destination: B, - options?: PipelineOptions - ): PipelinePromise; - function pipeline< - A extends PipelineSource, - T1 extends PipelineTransform, - T2 extends PipelineTransform, - T3 extends PipelineTransform, - B extends PipelineDestination - >(source: A, transform1: T1, transform2: T2, transform3: T3, destination: B, options?: PipelineOptions): PipelinePromise; - function pipeline< - A extends PipelineSource, - T1 extends PipelineTransform, - T2 extends PipelineTransform, - T3 extends PipelineTransform, - T4 extends PipelineTransform, - B extends PipelineDestination - >(source: A, transform1: T1, transform2: T2, transform3: T3, transform4: T4, destination: B, options?: PipelineOptions): PipelinePromise; - function pipeline(streams: ReadonlyArray, options?: PipelineOptions): Promise; - function pipeline( - stream1: NodeJS.ReadableStream, - stream2: NodeJS.ReadWriteStream | NodeJS.WritableStream, - ...streams: Array - ): Promise; -} -declare module 'node:stream/promises' { - export * from 'stream/promises'; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/stream/web.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/stream/web.d.ts deleted file mode 100755 index f9ef0570..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/stream/web.d.ts +++ /dev/null @@ -1,330 +0,0 @@ -declare module 'stream/web' { - // stub module, pending copy&paste from .d.ts or manual impl - // copy from lib.dom.d.ts - interface ReadableWritablePair { - readable: ReadableStream; - /** - * Provides a convenient, chainable way of piping this readable stream - * through a transform stream (or any other { writable, readable } - * pair). It simply pipes the stream into the writable side of the - * supplied pair, and returns the readable side for further use. - * - * Piping a stream will lock it for the duration of the pipe, preventing - * any other consumer from acquiring a reader. - */ - writable: WritableStream; - } - interface StreamPipeOptions { - preventAbort?: boolean; - preventCancel?: boolean; - /** - * Pipes this readable stream to a given writable stream destination. - * The way in which the piping process behaves under various error - * conditions can be customized with a number of passed options. It - * returns a promise that fulfills when the piping process completes - * successfully, or rejects if any errors were encountered. - * - * Piping a stream will lock it for the duration of the pipe, preventing - * any other consumer from acquiring a reader. - * - * Errors and closures of the source and destination streams propagate - * as follows: - * - * An error in this source readable stream will abort destination, - * unless preventAbort is truthy. The returned promise will be rejected - * with the source's error, or with any error that occurs during - * aborting the destination. - * - * An error in destination will cancel this source readable stream, - * unless preventCancel is truthy. The returned promise will be rejected - * with the destination's error, or with any error that occurs during - * canceling the source. - * - * When this source readable stream closes, destination will be closed, - * unless preventClose is truthy. The returned promise will be fulfilled - * once this process completes, unless an error is encountered while - * closing the destination, in which case it will be rejected with that - * error. - * - * If destination starts out closed or closing, this source readable - * stream will be canceled, unless preventCancel is true. The returned - * promise will be rejected with an error indicating piping to a closed - * stream failed, or with any error that occurs during canceling the - * source. - * - * The signal option can be set to an AbortSignal to allow aborting an - * ongoing pipe operation via the corresponding AbortController. In this - * case, this source readable stream will be canceled, and destination - * aborted, unless the respective options preventCancel or preventAbort - * are set. - */ - preventClose?: boolean; - signal?: AbortSignal; - } - interface ReadableStreamGenericReader { - readonly closed: Promise; - cancel(reason?: any): Promise; - } - interface ReadableStreamDefaultReadValueResult { - done: false; - value: T; - } - interface ReadableStreamDefaultReadDoneResult { - done: true; - value?: undefined; - } - type ReadableStreamController = ReadableStreamDefaultController; - type ReadableStreamDefaultReadResult = ReadableStreamDefaultReadValueResult | ReadableStreamDefaultReadDoneResult; - interface ReadableByteStreamControllerCallback { - (controller: ReadableByteStreamController): void | PromiseLike; - } - interface UnderlyingSinkAbortCallback { - (reason?: any): void | PromiseLike; - } - interface UnderlyingSinkCloseCallback { - (): void | PromiseLike; - } - interface UnderlyingSinkStartCallback { - (controller: WritableStreamDefaultController): any; - } - interface UnderlyingSinkWriteCallback { - (chunk: W, controller: WritableStreamDefaultController): void | PromiseLike; - } - interface UnderlyingSourceCancelCallback { - (reason?: any): void | PromiseLike; - } - interface UnderlyingSourcePullCallback { - (controller: ReadableStreamController): void | PromiseLike; - } - interface UnderlyingSourceStartCallback { - (controller: ReadableStreamController): any; - } - interface TransformerFlushCallback { - (controller: TransformStreamDefaultController): void | PromiseLike; - } - interface TransformerStartCallback { - (controller: TransformStreamDefaultController): any; - } - interface TransformerTransformCallback { - (chunk: I, controller: TransformStreamDefaultController): void | PromiseLike; - } - interface UnderlyingByteSource { - autoAllocateChunkSize?: number; - cancel?: ReadableStreamErrorCallback; - pull?: ReadableByteStreamControllerCallback; - start?: ReadableByteStreamControllerCallback; - type: 'bytes'; - } - interface UnderlyingSource { - cancel?: UnderlyingSourceCancelCallback; - pull?: UnderlyingSourcePullCallback; - start?: UnderlyingSourceStartCallback; - type?: undefined; - } - interface UnderlyingSink { - abort?: UnderlyingSinkAbortCallback; - close?: UnderlyingSinkCloseCallback; - start?: UnderlyingSinkStartCallback; - type?: undefined; - write?: UnderlyingSinkWriteCallback; - } - interface ReadableStreamErrorCallback { - (reason: any): void | PromiseLike; - } - /** This Streams API interface represents a readable stream of byte data. */ - interface ReadableStream { - readonly locked: boolean; - cancel(reason?: any): Promise; - getReader(): ReadableStreamDefaultReader; - pipeThrough(transform: ReadableWritablePair, options?: StreamPipeOptions): ReadableStream; - pipeTo(destination: WritableStream, options?: StreamPipeOptions): Promise; - tee(): [ReadableStream, ReadableStream]; - values(options?: { preventCancel?: boolean }): AsyncIterableIterator; - [Symbol.asyncIterator](): AsyncIterableIterator; - } - const ReadableStream: { - prototype: ReadableStream; - new (underlyingSource: UnderlyingByteSource, strategy?: QueuingStrategy): ReadableStream; - new (underlyingSource?: UnderlyingSource, strategy?: QueuingStrategy): ReadableStream; - }; - interface ReadableStreamDefaultReader extends ReadableStreamGenericReader { - read(): Promise>; - releaseLock(): void; - } - const ReadableStreamDefaultReader: { - prototype: ReadableStreamDefaultReader; - new (stream: ReadableStream): ReadableStreamDefaultReader; - }; - const ReadableStreamBYOBReader: any; - const ReadableStreamBYOBRequest: any; - interface ReadableByteStreamController { - readonly byobRequest: undefined; - readonly desiredSize: number | null; - close(): void; - enqueue(chunk: ArrayBufferView): void; - error(error?: any): void; - } - const ReadableByteStreamController: { - prototype: ReadableByteStreamController; - new (): ReadableByteStreamController; - }; - interface ReadableStreamDefaultController { - readonly desiredSize: number | null; - close(): void; - enqueue(chunk?: R): void; - error(e?: any): void; - } - const ReadableStreamDefaultController: { - prototype: ReadableStreamDefaultController; - new (): ReadableStreamDefaultController; - }; - interface Transformer { - flush?: TransformerFlushCallback; - readableType?: undefined; - start?: TransformerStartCallback; - transform?: TransformerTransformCallback; - writableType?: undefined; - } - interface TransformStream { - readonly readable: ReadableStream; - readonly writable: WritableStream; - } - const TransformStream: { - prototype: TransformStream; - new (transformer?: Transformer, writableStrategy?: QueuingStrategy, readableStrategy?: QueuingStrategy): TransformStream; - }; - interface TransformStreamDefaultController { - readonly desiredSize: number | null; - enqueue(chunk?: O): void; - error(reason?: any): void; - terminate(): void; - } - const TransformStreamDefaultController: { - prototype: TransformStreamDefaultController; - new (): TransformStreamDefaultController; - }; - /** - * This Streams API interface provides a standard abstraction for writing - * streaming data to a destination, known as a sink. This object comes with - * built-in back pressure and queuing. - */ - interface WritableStream { - readonly locked: boolean; - abort(reason?: any): Promise; - close(): Promise; - getWriter(): WritableStreamDefaultWriter; - } - const WritableStream: { - prototype: WritableStream; - new (underlyingSink?: UnderlyingSink, strategy?: QueuingStrategy): WritableStream; - }; - /** - * This Streams API interface is the object returned by - * WritableStream.getWriter() and once created locks the < writer to the - * WritableStream ensuring that no other streams can write to the underlying - * sink. - */ - interface WritableStreamDefaultWriter { - readonly closed: Promise; - readonly desiredSize: number | null; - readonly ready: Promise; - abort(reason?: any): Promise; - close(): Promise; - releaseLock(): void; - write(chunk?: W): Promise; - } - const WritableStreamDefaultWriter: { - prototype: WritableStreamDefaultWriter; - new (stream: WritableStream): WritableStreamDefaultWriter; - }; - /** - * This Streams API interface represents a controller allowing control of a - * WritableStream's state. When constructing a WritableStream, the - * underlying sink is given a corresponding WritableStreamDefaultController - * instance to manipulate. - */ - interface WritableStreamDefaultController { - error(e?: any): void; - } - const WritableStreamDefaultController: { - prototype: WritableStreamDefaultController; - new (): WritableStreamDefaultController; - }; - interface QueuingStrategy { - highWaterMark?: number; - size?: QueuingStrategySize; - } - interface QueuingStrategySize { - (chunk?: T): number; - } - interface QueuingStrategyInit { - /** - * Creates a new ByteLengthQueuingStrategy with the provided high water - * mark. - * - * Note that the provided high water mark will not be validated ahead of - * time. Instead, if it is negative, NaN, or not a number, the resulting - * ByteLengthQueuingStrategy will cause the corresponding stream - * constructor to throw. - */ - highWaterMark: number; - } - /** - * This Streams API interface provides a built-in byte length queuing - * strategy that can be used when constructing streams. - */ - interface ByteLengthQueuingStrategy extends QueuingStrategy { - readonly highWaterMark: number; - readonly size: QueuingStrategySize; - } - const ByteLengthQueuingStrategy: { - prototype: ByteLengthQueuingStrategy; - new (init: QueuingStrategyInit): ByteLengthQueuingStrategy; - }; - /** - * This Streams API interface provides a built-in byte length queuing - * strategy that can be used when constructing streams. - */ - interface CountQueuingStrategy extends QueuingStrategy { - readonly highWaterMark: number; - readonly size: QueuingStrategySize; - } - const CountQueuingStrategy: { - prototype: CountQueuingStrategy; - new (init: QueuingStrategyInit): CountQueuingStrategy; - }; - interface TextEncoderStream { - /** Returns "utf-8". */ - readonly encoding: 'utf-8'; - readonly readable: ReadableStream; - readonly writable: WritableStream; - readonly [Symbol.toStringTag]: string; - } - const TextEncoderStream: { - prototype: TextEncoderStream; - new (): TextEncoderStream; - }; - interface TextDecoderOptions { - fatal?: boolean; - ignoreBOM?: boolean; - } - type BufferSource = ArrayBufferView | ArrayBuffer; - interface TextDecoderStream { - /** Returns encoding's name, lower cased. */ - readonly encoding: string; - /** Returns `true` if error mode is "fatal", and `false` otherwise. */ - readonly fatal: boolean; - /** Returns `true` if ignore BOM flag is set, and `false` otherwise. */ - readonly ignoreBOM: boolean; - readonly readable: ReadableStream; - readonly writable: WritableStream; - readonly [Symbol.toStringTag]: string; - } - const TextDecoderStream: { - prototype: TextDecoderStream; - new (label?: string, options?: TextDecoderOptions): TextDecoderStream; - }; -} -declare module 'node:stream/web' { - export * from 'stream/web'; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/string_decoder.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/string_decoder.d.ts deleted file mode 100755 index a5858041..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/string_decoder.d.ts +++ /dev/null @@ -1,67 +0,0 @@ -/** - * The `string_decoder` module provides an API for decoding `Buffer` objects into - * strings in a manner that preserves encoded multi-byte UTF-8 and UTF-16 - * characters. It can be accessed using: - * - * ```js - * const { StringDecoder } = require('string_decoder'); - * ``` - * - * The following example shows the basic use of the `StringDecoder` class. - * - * ```js - * const { StringDecoder } = require('string_decoder'); - * const decoder = new StringDecoder('utf8'); - * - * const cent = Buffer.from([0xC2, 0xA2]); - * console.log(decoder.write(cent)); - * - * const euro = Buffer.from([0xE2, 0x82, 0xAC]); - * console.log(decoder.write(euro)); - * ``` - * - * When a `Buffer` instance is written to the `StringDecoder` instance, an - * internal buffer is used to ensure that the decoded string does not contain - * any incomplete multibyte characters. These are held in the buffer until the - * next call to `stringDecoder.write()` or until `stringDecoder.end()` is called. - * - * In the following example, the three UTF-8 encoded bytes of the European Euro - * symbol (`€`) are written over three separate operations: - * - * ```js - * const { StringDecoder } = require('string_decoder'); - * const decoder = new StringDecoder('utf8'); - * - * decoder.write(Buffer.from([0xE2])); - * decoder.write(Buffer.from([0x82])); - * console.log(decoder.end(Buffer.from([0xAC]))); - * ``` - * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/string_decoder.js) - */ -declare module 'string_decoder' { - class StringDecoder { - constructor(encoding?: BufferEncoding); - /** - * Returns a decoded string, ensuring that any incomplete multibyte characters at - * the end of the `Buffer`, or `TypedArray`, or `DataView` are omitted from the - * returned string and stored in an internal buffer for the next call to`stringDecoder.write()` or `stringDecoder.end()`. - * @since v0.1.99 - * @param buffer A `Buffer`, or `TypedArray`, or `DataView` containing the bytes to decode. - */ - write(buffer: Buffer): string; - /** - * Returns any remaining input stored in the internal buffer as a string. Bytes - * representing incomplete UTF-8 and UTF-16 characters will be replaced with - * substitution characters appropriate for the character encoding. - * - * If the `buffer` argument is provided, one final call to `stringDecoder.write()`is performed before returning the remaining input. - * After `end()` is called, the `stringDecoder` object can be reused for new input. - * @since v0.9.3 - * @param buffer A `Buffer`, or `TypedArray`, or `DataView` containing the bytes to decode. - */ - end(buffer?: Buffer): string; - } -} -declare module 'node:string_decoder' { - export * from 'string_decoder'; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/test.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/test.d.ts deleted file mode 100755 index 29dd0eea..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/test.d.ts +++ /dev/null @@ -1,374 +0,0 @@ -/** - * The `node:test` module provides a standalone testing module. - * @see [source](https://github.com/nodejs/node/blob/v18.8.0/lib/test.js) - */ -declare module 'node:test' { - /** - * Programmatically start the test runner. - * @since v18.9.0 - * @param options Configuration options for running tests. - * @returns A {@link TapStream} that emits events about the test execution. - */ - function run(options?: RunOptions): TapStream; - - /** - * The `test()` function is the value imported from the test module. Each invocation of this - * function results in the creation of a test point in the TAP output. - * - * The {@link TestContext} object passed to the fn argument can be used to perform actions - * related to the current test. Examples include skipping the test, adding additional TAP - * diagnostic information, or creating subtests. - * - * `test()` returns a {@link Promise} that resolves once the test completes. The return value - * can usually be discarded for top level tests. However, the return value from subtests should - * be used to prevent the parent test from finishing first and cancelling the subtest as shown - * in the following example. - * - * ```js - * test('top level test', async (t) => { - * // The setTimeout() in the following subtest would cause it to outlive its - * // parent test if 'await' is removed on the next line. Once the parent test - * // completes, it will cancel any outstanding subtests. - * await t.test('longer running subtest', async (t) => { - * return new Promise((resolve, reject) => { - * setTimeout(resolve, 1000); - * }); - * }); - * }); - * ``` - * @since v18.0.0 - * @param name The name of the test, which is displayed when reporting test results. - * Default: The `name` property of fn, or `''` if `fn` does not have a name. - * @param options Configuration options for the test - * @param fn The function under test. The first argument to this function is a - * {@link TestContext} object. If the test uses callbacks, the callback function is - * passed as the second argument. Default: A no-op function. - * @returns A {@link Promise} resolved with `undefined` once the test completes. - */ - function test(name?: string, fn?: TestFn): Promise; - function test(name?: string, options?: TestOptions, fn?: TestFn): Promise; - function test(options?: TestOptions, fn?: TestFn): Promise; - function test(fn?: TestFn): Promise; - - /** - * @since v18.6.0 - * @param name The name of the suite, which is displayed when reporting suite results. - * Default: The `name` property of fn, or `''` if `fn` does not have a name. - * @param options Configuration options for the suite - * @param fn The function under suite. Default: A no-op function. - */ - function describe(name?: string, options?: TestOptions, fn?: SuiteFn): void; - function describe(name?: string, fn?: SuiteFn): void; - function describe(options?: TestOptions, fn?: SuiteFn): void; - function describe(fn?: SuiteFn): void; - - /** - * @since v18.6.0 - * @param name The name of the test, which is displayed when reporting test results. - * Default: The `name` property of fn, or `''` if `fn` does not have a name. - * @param options Configuration options for the test - * @param fn The function under test. If the test uses callbacks, the callback function is - * passed as the second argument. Default: A no-op function. - */ - function it(name?: string, options?: TestOptions, fn?: ItFn): void; - function it(name?: string, fn?: ItFn): void; - function it(options?: TestOptions, fn?: ItFn): void; - function it(fn?: ItFn): void; - - /** - * The type of a function under test. The first argument to this function is a - * {@link TestContext} object. If the test uses callbacks, the callback function is passed as - * the second argument. - */ - type TestFn = (t: TestContext, done: (result?: any) => void) => any; - - /** - * The type of a function under Suite. - * If the test uses callbacks, the callback function is passed as an argument - */ - type SuiteFn = (done: (result?: any) => void) => void; - - /** - * The type of a function under test. - * If the test uses callbacks, the callback function is passed as an argument - */ - type ItFn = (done: (result?: any) => void) => any; - - interface RunOptions { - /** - * @default false - */ - concurrency?: number | boolean; - - /** - * An array containing the list of files to run. If unspecified, the test runner execution model will be used. - */ - files?: readonly string[]; - - /** - * Allows aborting an in-progress test. - * @default undefined - */ - signal?: AbortSignal; - - /** - * A number of milliseconds the test will fail after. If unspecified, subtests inherit this - * value from their parent. - * @default Infinity - */ - timeout?: number; - } - - /** - * A successful call of the run() method will return a new TapStream object, streaming a TAP output. - * TapStream will emit events in the order of the tests' definitions. - * @since v18.9.0 - */ - interface TapStream extends NodeJS.ReadableStream { - addListener(event: 'test:diagnostic', listener: (message: string) => void): this; - addListener(event: 'test:fail', listener: (data: TestFail) => void): this; - addListener(event: 'test:pass', listener: (data: TestPass) => void): this; - addListener(event: string, listener: (...args: any[]) => void): this; - emit(event: 'test:diagnostic', message: string): boolean; - emit(event: 'test:fail', data: TestFail): boolean; - emit(event: 'test:pass', data: TestPass): boolean; - emit(event: string | symbol, ...args: any[]): boolean; - on(event: 'test:diagnostic', listener: (message: string) => void): this; - on(event: 'test:fail', listener: (data: TestFail) => void): this; - on(event: 'test:pass', listener: (data: TestPass) => void): this; - on(event: string, listener: (...args: any[]) => void): this; - once(event: 'test:diagnostic', listener: (message: string) => void): this; - once(event: 'test:fail', listener: (data: TestFail) => void): this; - once(event: 'test:pass', listener: (data: TestPass) => void): this; - once(event: string, listener: (...args: any[]) => void): this; - prependListener(event: 'test:diagnostic', listener: (message: string) => void): this; - prependListener(event: 'test:fail', listener: (data: TestFail) => void): this; - prependListener(event: 'test:pass', listener: (data: TestPass) => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: 'test:diagnostic', listener: (message: string) => void): this; - prependOnceListener(event: 'test:fail', listener: (data: TestFail) => void): this; - prependOnceListener(event: 'test:pass', listener: (data: TestPass) => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - } - - interface TestFail { - /** - * The test duration. - */ - duration: number; - - /** - * The failure casing test to fail. - */ - error: Error; - - /** - * The test name. - */ - name: string; - - /** - * The ordinal number of the test. - */ - testNumber: number; - - /** - * Present if `context.todo` is called. - */ - todo?: string; - - /** - * Present if `context.skip` is called. - */ - skip?: string; - } - - interface TestPass { - /** - * The test duration. - */ - duration: number; - - /** - * The test name. - */ - name: string; - - /** - * The ordinal number of the test. - */ - testNumber: number; - - /** - * Present if `context.todo` is called. - */ - todo?: string; - - /** - * Present if `context.skip` is called. - */ - skip?: string; - } - - /** - * An instance of `TestContext` is passed to each test function in order to interact with the - * test runner. However, the `TestContext` constructor is not exposed as part of the API. - * @since v18.0.0 - */ - interface TestContext { - /** - * This function is used to write TAP diagnostics to the output. Any diagnostic information is - * included at the end of the test's results. This function does not return a value. - * @param message Message to be displayed as a TAP diagnostic. - * @since v18.0.0 - */ - diagnostic(message: string): void; - - /** - * If `shouldRunOnlyTests` is truthy, the test context will only run tests that have the `only` - * option set. Otherwise, all tests are run. If Node.js was not started with the `--test-only` - * command-line option, this function is a no-op. - * @param shouldRunOnlyTests Whether or not to run `only` tests. - * @since v18.0.0 - */ - runOnly(shouldRunOnlyTests: boolean): void; - - /** - * This function causes the test's output to indicate the test as skipped. If `message` is - * provided, it is included in the TAP output. Calling `skip()` does not terminate execution of - * the test function. This function does not return a value. - * @param message Optional skip message to be displayed in TAP output. - * @since v18.0.0 - */ - skip(message?: string): void; - - /** - * This function adds a `TODO` directive to the test's output. If `message` is provided, it is - * included in the TAP output. Calling `todo()` does not terminate execution of the test - * function. This function does not return a value. - * @param message Optional `TODO` message to be displayed in TAP output. - * @since v18.0.0 - */ - todo(message?: string): void; - - /** - * This function is used to create subtests under the current test. This function behaves in - * the same fashion as the top level {@link test} function. - * @since v18.0.0 - * @param name The name of the test, which is displayed when reporting test results. - * Default: The `name` property of fn, or `''` if `fn` does not have a name. - * @param options Configuration options for the test - * @param fn The function under test. This first argument to this function is a - * {@link TestContext} object. If the test uses callbacks, the callback function is - * passed as the second argument. Default: A no-op function. - * @returns A {@link Promise} resolved with `undefined` once the test completes. - */ - test: typeof test; - } - - interface TestOptions { - /** - * The number of tests that can be run at the same time. If unspecified, subtests inherit this - * value from their parent. - * @default 1 - */ - concurrency?: number; - - /** - * If truthy, and the test context is configured to run `only` tests, then this test will be - * run. Otherwise, the test is skipped. - * @default false - */ - only?: boolean; - - /** - * Allows aborting an in-progress test. - * @since v18.8.0 - */ - signal?: AbortSignal; - - /** - * If truthy, the test is skipped. If a string is provided, that string is displayed in the - * test results as the reason for skipping the test. - * @default false - */ - skip?: boolean | string; - - /** - * A number of milliseconds the test will fail after. If unspecified, subtests inherit this - * value from their parent. - * @default Infinity - * @since v18.7.0 - */ - timeout?: number; - - /** - * If truthy, the test marked as `TODO`. If a string is provided, that string is displayed in - * the test results as the reason why the test is `TODO`. - * @default false - */ - todo?: boolean | string; - } - - /** - * This function is used to create a hook running before running a suite. - * @param fn The hook function. If the hook uses callbacks, the callback function is passed as - * the second argument. Default: A no-op function. - * @param options Configuration options for the hook. - * @since v18.8.0 - */ - function before(fn?: HookFn, options?: HookOptions): void; - - /** - * This function is used to create a hook running after running a suite. - * @param fn The hook function. If the hook uses callbacks, the callback function is passed as - * the second argument. Default: A no-op function. - * @param options Configuration options for the hook. - * @since v18.8.0 - */ - function after(fn?: HookFn, options?: HookOptions): void; - - /** - * This function is used to create a hook running before each subtest of the current suite. - * @param fn The hook function. If the hook uses callbacks, the callback function is passed as - * the second argument. Default: A no-op function. - * @param options Configuration options for the hook. - * @since v18.8.0 - */ - function beforeEach(fn?: HookFn, options?: HookOptions): void; - - /** - * This function is used to create a hook running after each subtest of the current test. - * @param fn The hook function. If the hook uses callbacks, the callback function is passed as - * the second argument. Default: A no-op function. - * @param options Configuration options for the hook. - * @since v18.8.0 - */ - function afterEach(fn?: HookFn, options?: HookOptions): void; - - /** - * The hook function. If the hook uses callbacks, the callback function is passed as the - * second argument. - */ - type HookFn = (done: (result?: any) => void) => any; - - /** - * Configuration options for hooks. - * @since v18.8.0 - */ - interface HookOptions { - /** - * Allows aborting an in-progress hook. - */ - signal?: AbortSignal; - - /** - * A number of milliseconds the hook will fail after. If unspecified, subtests inherit this - * value from their parent. - * @default Infinity - */ - timeout?: number; - } - - export { test as default, run, test, describe, it, before, after, beforeEach, afterEach }; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/timers.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/timers.d.ts deleted file mode 100755 index b26f3ced..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/timers.d.ts +++ /dev/null @@ -1,94 +0,0 @@ -/** - * The `timer` module exposes a global API for scheduling functions to - * be called at some future period of time. Because the timer functions are - * globals, there is no need to call `require('timers')` to use the API. - * - * The timer functions within Node.js implement a similar API as the timers API - * provided by Web Browsers but use a different internal implementation that is - * built around the Node.js [Event Loop](https://nodejs.org/en/docs/guides/event-loop-timers-and-nexttick/#setimmediate-vs-settimeout). - * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/timers.js) - */ -declare module 'timers' { - import { Abortable } from 'node:events'; - import { setTimeout as setTimeoutPromise, setImmediate as setImmediatePromise, setInterval as setIntervalPromise } from 'node:timers/promises'; - interface TimerOptions extends Abortable { - /** - * Set to `false` to indicate that the scheduled `Timeout` - * should not require the Node.js event loop to remain active. - * @default true - */ - ref?: boolean | undefined; - } - let setTimeout: typeof global.setTimeout; - let clearTimeout: typeof global.clearTimeout; - let setInterval: typeof global.setInterval; - let clearInterval: typeof global.clearInterval; - let setImmediate: typeof global.setImmediate; - let clearImmediate: typeof global.clearImmediate; - global { - namespace NodeJS { - // compatibility with older typings - interface Timer extends RefCounted { - hasRef(): boolean; - refresh(): this; - [Symbol.toPrimitive](): number; - } - interface Immediate extends RefCounted { - /** - * If true, the `Immediate` object will keep the Node.js event loop active. - * @since v11.0.0 - */ - hasRef(): boolean; - _onImmediate: Function; // to distinguish it from the Timeout class - } - interface Timeout extends Timer { - /** - * If true, the `Timeout` object will keep the Node.js event loop active. - * @since v11.0.0 - */ - hasRef(): boolean; - /** - * Sets the timer's start time to the current time, and reschedules the timer to - * call its callback at the previously specified duration adjusted to the current - * time. This is useful for refreshing a timer without allocating a new - * JavaScript object. - * - * Using this on a timer that has already called its callback will reactivate the - * timer. - * @since v10.2.0 - * @return a reference to `timeout` - */ - refresh(): this; - [Symbol.toPrimitive](): number; - } - } - function setTimeout(callback: (...args: TArgs) => void, ms?: number, ...args: TArgs): NodeJS.Timeout; - // util.promisify no rest args compability - // tslint:disable-next-line void-return - function setTimeout(callback: (args: void) => void, ms?: number): NodeJS.Timeout; - namespace setTimeout { - const __promisify__: typeof setTimeoutPromise; - } - function clearTimeout(timeoutId: NodeJS.Timeout | string | number | undefined): void; - function setInterval(callback: (...args: TArgs) => void, ms?: number, ...args: TArgs): NodeJS.Timer; - // util.promisify no rest args compability - // tslint:disable-next-line void-return - function setInterval(callback: (args: void) => void, ms?: number): NodeJS.Timer; - namespace setInterval { - const __promisify__: typeof setIntervalPromise; - } - function clearInterval(intervalId: NodeJS.Timeout | string | number | undefined): void; - function setImmediate(callback: (...args: TArgs) => void, ...args: TArgs): NodeJS.Immediate; - // util.promisify no rest args compability - // tslint:disable-next-line void-return - function setImmediate(callback: (args: void) => void): NodeJS.Immediate; - namespace setImmediate { - const __promisify__: typeof setImmediatePromise; - } - function clearImmediate(immediateId: NodeJS.Immediate | undefined): void; - function queueMicrotask(callback: () => void): void; - } -} -declare module 'node:timers' { - export * from 'timers'; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/timers/promises.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/timers/promises.d.ts deleted file mode 100755 index fd778880..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/timers/promises.d.ts +++ /dev/null @@ -1,68 +0,0 @@ -/** - * The `timers/promises` API provides an alternative set of timer functions - * that return `Promise` objects. The API is accessible via`require('timers/promises')`. - * - * ```js - * import { - * setTimeout, - * setImmediate, - * setInterval, - * } from 'timers/promises'; - * ``` - * @since v15.0.0 - */ -declare module 'timers/promises' { - import { TimerOptions } from 'node:timers'; - /** - * ```js - * import { - * setTimeout, - * } from 'timers/promises'; - * - * const res = await setTimeout(100, 'result'); - * - * console.log(res); // Prints 'result' - * ``` - * @since v15.0.0 - * @param [delay=1] The number of milliseconds to wait before fulfilling the promise. - * @param value A value with which the promise is fulfilled. - */ - function setTimeout(delay?: number, value?: T, options?: TimerOptions): Promise; - /** - * ```js - * import { - * setImmediate, - * } from 'timers/promises'; - * - * const res = await setImmediate('result'); - * - * console.log(res); // Prints 'result' - * ``` - * @since v15.0.0 - * @param value A value with which the promise is fulfilled. - */ - function setImmediate(value?: T, options?: TimerOptions): Promise; - /** - * Returns an async iterator that generates values in an interval of `delay` ms. - * - * ```js - * import { - * setInterval, - * } from 'timers/promises'; - * - * const interval = 100; - * for await (const startTime of setInterval(interval, Date.now())) { - * const now = Date.now(); - * console.log(now); - * if ((now - startTime) > 1000) - * break; - * } - * console.log(Date.now()); - * ``` - * @since v15.9.0 - */ - function setInterval(delay?: number, value?: T, options?: TimerOptions): AsyncIterable; -} -declare module 'node:timers/promises' { - export * from 'timers/promises'; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/tls.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/tls.d.ts deleted file mode 100755 index 2cbc7165..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/tls.d.ts +++ /dev/null @@ -1,1028 +0,0 @@ -/** - * The `tls` module provides an implementation of the Transport Layer Security - * (TLS) and Secure Socket Layer (SSL) protocols that is built on top of OpenSSL. - * The module can be accessed using: - * - * ```js - * const tls = require('tls'); - * ``` - * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/tls.js) - */ -declare module 'tls' { - import { X509Certificate } from 'node:crypto'; - import * as net from 'node:net'; - import * as stream from 'stream'; - const CLIENT_RENEG_LIMIT: number; - const CLIENT_RENEG_WINDOW: number; - interface Certificate { - /** - * Country code. - */ - C: string; - /** - * Street. - */ - ST: string; - /** - * Locality. - */ - L: string; - /** - * Organization. - */ - O: string; - /** - * Organizational unit. - */ - OU: string; - /** - * Common name. - */ - CN: string; - } - interface PeerCertificate { - subject: Certificate; - issuer: Certificate; - subjectaltname: string; - infoAccess: NodeJS.Dict; - modulus: string; - exponent: string; - valid_from: string; - valid_to: string; - fingerprint: string; - fingerprint256: string; - ext_key_usage: string[]; - serialNumber: string; - raw: Buffer; - } - interface DetailedPeerCertificate extends PeerCertificate { - issuerCertificate: DetailedPeerCertificate; - } - interface CipherNameAndProtocol { - /** - * The cipher name. - */ - name: string; - /** - * SSL/TLS protocol version. - */ - version: string; - /** - * IETF name for the cipher suite. - */ - standardName: string; - } - interface EphemeralKeyInfo { - /** - * The supported types are 'DH' and 'ECDH'. - */ - type: string; - /** - * The name property is available only when type is 'ECDH'. - */ - name?: string | undefined; - /** - * The size of parameter of an ephemeral key exchange. - */ - size: number; - } - interface KeyObject { - /** - * Private keys in PEM format. - */ - pem: string | Buffer; - /** - * Optional passphrase. - */ - passphrase?: string | undefined; - } - interface PxfObject { - /** - * PFX or PKCS12 encoded private key and certificate chain. - */ - buf: string | Buffer; - /** - * Optional passphrase. - */ - passphrase?: string | undefined; - } - interface TLSSocketOptions extends SecureContextOptions, CommonConnectionOptions { - /** - * If true the TLS socket will be instantiated in server-mode. - * Defaults to false. - */ - isServer?: boolean | undefined; - /** - * An optional net.Server instance. - */ - server?: net.Server | undefined; - /** - * An optional Buffer instance containing a TLS session. - */ - session?: Buffer | undefined; - /** - * If true, specifies that the OCSP status request extension will be - * added to the client hello and an 'OCSPResponse' event will be - * emitted on the socket before establishing a secure communication - */ - requestOCSP?: boolean | undefined; - } - /** - * Performs transparent encryption of written data and all required TLS - * negotiation. - * - * Instances of `tls.TLSSocket` implement the duplex `Stream` interface. - * - * Methods that return TLS connection metadata (e.g.{@link TLSSocket.getPeerCertificate} will only return data while the - * connection is open. - * @since v0.11.4 - */ - class TLSSocket extends net.Socket { - /** - * Construct a new tls.TLSSocket object from an existing TCP socket. - */ - constructor(socket: net.Socket, options?: TLSSocketOptions); - /** - * This property is `true` if the peer certificate was signed by one of the CAs - * specified when creating the `tls.TLSSocket` instance, otherwise `false`. - * @since v0.11.4 - */ - authorized: boolean; - /** - * Returns the reason why the peer's certificate was not been verified. This - * property is set only when `tlsSocket.authorized === false`. - * @since v0.11.4 - */ - authorizationError: Error; - /** - * Always returns `true`. This may be used to distinguish TLS sockets from regular`net.Socket` instances. - * @since v0.11.4 - */ - encrypted: true; - /** - * String containing the selected ALPN protocol. - * Before a handshake has completed, this value is always null. - * When a handshake is completed but not ALPN protocol was selected, tlsSocket.alpnProtocol equals false. - */ - alpnProtocol: string | false | null; - /** - * Returns an object representing the local certificate. The returned object has - * some properties corresponding to the fields of the certificate. - * - * See {@link TLSSocket.getPeerCertificate} for an example of the certificate - * structure. - * - * If there is no local certificate, an empty object will be returned. If the - * socket has been destroyed, `null` will be returned. - * @since v11.2.0 - */ - getCertificate(): PeerCertificate | object | null; - /** - * Returns an object containing information on the negotiated cipher suite. - * - * For example: - * - * ```json - * { - * "name": "AES128-SHA256", - * "standardName": "TLS_RSA_WITH_AES_128_CBC_SHA256", - * "version": "TLSv1.2" - * } - * ``` - * - * See [SSL\_CIPHER\_get\_name](https://www.openssl.org/docs/man1.1.1/man3/SSL_CIPHER_get_name.html) for more information. - * @since v0.11.4 - */ - getCipher(): CipherNameAndProtocol; - /** - * Returns an object representing the type, name, and size of parameter of - * an ephemeral key exchange in `perfect forward secrecy` on a client - * connection. It returns an empty object when the key exchange is not - * ephemeral. As this is only supported on a client socket; `null` is returned - * if called on a server socket. The supported types are `'DH'` and `'ECDH'`. The`name` property is available only when type is `'ECDH'`. - * - * For example: `{ type: 'ECDH', name: 'prime256v1', size: 256 }`. - * @since v5.0.0 - */ - getEphemeralKeyInfo(): EphemeralKeyInfo | object | null; - /** - * As the `Finished` messages are message digests of the complete handshake - * (with a total of 192 bits for TLS 1.0 and more for SSL 3.0), they can - * be used for external authentication procedures when the authentication - * provided by SSL/TLS is not desired or is not enough. - * - * Corresponds to the `SSL_get_finished` routine in OpenSSL and may be used - * to implement the `tls-unique` channel binding from [RFC 5929](https://tools.ietf.org/html/rfc5929). - * @since v9.9.0 - * @return The latest `Finished` message that has been sent to the socket as part of a SSL/TLS handshake, or `undefined` if no `Finished` message has been sent yet. - */ - getFinished(): Buffer | undefined; - /** - * Returns an object representing the peer's certificate. If the peer does not - * provide a certificate, an empty object will be returned. If the socket has been - * destroyed, `null` will be returned. - * - * If the full certificate chain was requested, each certificate will include an`issuerCertificate` property containing an object representing its issuer's - * certificate. - * @since v0.11.4 - * @param detailed Include the full certificate chain if `true`, otherwise include just the peer's certificate. - * @return A certificate object. - */ - getPeerCertificate(detailed: true): DetailedPeerCertificate; - getPeerCertificate(detailed?: false): PeerCertificate; - getPeerCertificate(detailed?: boolean): PeerCertificate | DetailedPeerCertificate; - /** - * As the `Finished` messages are message digests of the complete handshake - * (with a total of 192 bits for TLS 1.0 and more for SSL 3.0), they can - * be used for external authentication procedures when the authentication - * provided by SSL/TLS is not desired or is not enough. - * - * Corresponds to the `SSL_get_peer_finished` routine in OpenSSL and may be used - * to implement the `tls-unique` channel binding from [RFC 5929](https://tools.ietf.org/html/rfc5929). - * @since v9.9.0 - * @return The latest `Finished` message that is expected or has actually been received from the socket as part of a SSL/TLS handshake, or `undefined` if there is no `Finished` message so - * far. - */ - getPeerFinished(): Buffer | undefined; - /** - * Returns a string containing the negotiated SSL/TLS protocol version of the - * current connection. The value `'unknown'` will be returned for connected - * sockets that have not completed the handshaking process. The value `null` will - * be returned for server sockets or disconnected client sockets. - * - * Protocol versions are: - * - * * `'SSLv3'` - * * `'TLSv1'` - * * `'TLSv1.1'` - * * `'TLSv1.2'` - * * `'TLSv1.3'` - * - * See the OpenSSL [`SSL_get_version`](https://www.openssl.org/docs/man1.1.1/man3/SSL_get_version.html) documentation for more information. - * @since v5.7.0 - */ - getProtocol(): string | null; - /** - * Returns the TLS session data or `undefined` if no session was - * negotiated. On the client, the data can be provided to the `session` option of {@link connect} to resume the connection. On the server, it may be useful - * for debugging. - * - * See `Session Resumption` for more information. - * - * Note: `getSession()` works only for TLSv1.2 and below. For TLSv1.3, applications - * must use the `'session'` event (it also works for TLSv1.2 and below). - * @since v0.11.4 - */ - getSession(): Buffer | undefined; - /** - * See [SSL\_get\_shared\_sigalgs](https://www.openssl.org/docs/man1.1.1/man3/SSL_get_shared_sigalgs.html) for more information. - * @since v12.11.0 - * @return List of signature algorithms shared between the server and the client in the order of decreasing preference. - */ - getSharedSigalgs(): string[]; - /** - * For a client, returns the TLS session ticket if one is available, or`undefined`. For a server, always returns `undefined`. - * - * It may be useful for debugging. - * - * See `Session Resumption` for more information. - * @since v0.11.4 - */ - getTLSTicket(): Buffer | undefined; - /** - * See `Session Resumption` for more information. - * @since v0.5.6 - * @return `true` if the session was reused, `false` otherwise. - */ - isSessionReused(): boolean; - /** - * The `tlsSocket.renegotiate()` method initiates a TLS renegotiation process. - * Upon completion, the `callback` function will be passed a single argument - * that is either an `Error` (if the request failed) or `null`. - * - * This method can be used to request a peer's certificate after the secure - * connection has been established. - * - * When running as the server, the socket will be destroyed with an error after`handshakeTimeout` timeout. - * - * For TLSv1.3, renegotiation cannot be initiated, it is not supported by the - * protocol. - * @since v0.11.8 - * @param callback If `renegotiate()` returned `true`, callback is attached once to the `'secure'` event. If `renegotiate()` returned `false`, `callback` will be called in the next tick with - * an error, unless the `tlsSocket` has been destroyed, in which case `callback` will not be called at all. - * @return `true` if renegotiation was initiated, `false` otherwise. - */ - renegotiate( - options: { - rejectUnauthorized?: boolean | undefined; - requestCert?: boolean | undefined; - }, - callback: (err: Error | null) => void - ): undefined | boolean; - /** - * The `tlsSocket.setMaxSendFragment()` method sets the maximum TLS fragment size. - * Returns `true` if setting the limit succeeded; `false` otherwise. - * - * Smaller fragment sizes decrease the buffering latency on the client: larger - * fragments are buffered by the TLS layer until the entire fragment is received - * and its integrity is verified; large fragments can span multiple roundtrips - * and their processing can be delayed due to packet loss or reordering. However, - * smaller fragments add extra TLS framing bytes and CPU overhead, which may - * decrease overall server throughput. - * @since v0.11.11 - * @param [size=16384] The maximum TLS fragment size. The maximum value is `16384`. - */ - setMaxSendFragment(size: number): boolean; - /** - * Disables TLS renegotiation for this `TLSSocket` instance. Once called, attempts - * to renegotiate will trigger an `'error'` event on the `TLSSocket`. - * @since v8.4.0 - */ - disableRenegotiation(): void; - /** - * When enabled, TLS packet trace information is written to `stderr`. This can be - * used to debug TLS connection problems. - * - * The format of the output is identical to the output of`openssl s_client -trace` or `openssl s_server -trace`. While it is produced by - * OpenSSL's `SSL_trace()` function, the format is undocumented, can change - * without notice, and should not be relied on. - * @since v12.2.0 - */ - enableTrace(): void; - /** - * Returns the peer certificate as an `X509Certificate` object. - * - * If there is no peer certificate, or the socket has been destroyed,`undefined` will be returned. - * @since v15.9.0 - */ - getPeerX509Certificate(): X509Certificate | undefined; - /** - * Returns the local certificate as an `X509Certificate` object. - * - * If there is no local certificate, or the socket has been destroyed,`undefined` will be returned. - * @since v15.9.0 - */ - getX509Certificate(): X509Certificate | undefined; - /** - * Keying material is used for validations to prevent different kind of attacks in - * network protocols, for example in the specifications of IEEE 802.1X. - * - * Example - * - * ```js - * const keyingMaterial = tlsSocket.exportKeyingMaterial( - * 128, - * 'client finished'); - * - * /* - * Example return value of keyingMaterial: - * - * - * ``` - * - * See the OpenSSL [`SSL_export_keying_material`](https://www.openssl.org/docs/man1.1.1/man3/SSL_export_keying_material.html) documentation for more - * information. - * @since v13.10.0, v12.17.0 - * @param length number of bytes to retrieve from keying material - * @param label an application specific label, typically this will be a value from the [IANA Exporter Label - * Registry](https://www.iana.org/assignments/tls-parameters/tls-parameters.xhtml#exporter-labels). - * @param context Optionally provide a context. - * @return requested bytes of the keying material - */ - exportKeyingMaterial(length: number, label: string, context: Buffer): Buffer; - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: 'OCSPResponse', listener: (response: Buffer) => void): this; - addListener(event: 'secureConnect', listener: () => void): this; - addListener(event: 'session', listener: (session: Buffer) => void): this; - addListener(event: 'keylog', listener: (line: Buffer) => void): this; - emit(event: string | symbol, ...args: any[]): boolean; - emit(event: 'OCSPResponse', response: Buffer): boolean; - emit(event: 'secureConnect'): boolean; - emit(event: 'session', session: Buffer): boolean; - emit(event: 'keylog', line: Buffer): boolean; - on(event: string, listener: (...args: any[]) => void): this; - on(event: 'OCSPResponse', listener: (response: Buffer) => void): this; - on(event: 'secureConnect', listener: () => void): this; - on(event: 'session', listener: (session: Buffer) => void): this; - on(event: 'keylog', listener: (line: Buffer) => void): this; - once(event: string, listener: (...args: any[]) => void): this; - once(event: 'OCSPResponse', listener: (response: Buffer) => void): this; - once(event: 'secureConnect', listener: () => void): this; - once(event: 'session', listener: (session: Buffer) => void): this; - once(event: 'keylog', listener: (line: Buffer) => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: 'OCSPResponse', listener: (response: Buffer) => void): this; - prependListener(event: 'secureConnect', listener: () => void): this; - prependListener(event: 'session', listener: (session: Buffer) => void): this; - prependListener(event: 'keylog', listener: (line: Buffer) => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: 'OCSPResponse', listener: (response: Buffer) => void): this; - prependOnceListener(event: 'secureConnect', listener: () => void): this; - prependOnceListener(event: 'session', listener: (session: Buffer) => void): this; - prependOnceListener(event: 'keylog', listener: (line: Buffer) => void): this; - } - interface CommonConnectionOptions { - /** - * An optional TLS context object from tls.createSecureContext() - */ - secureContext?: SecureContext | undefined; - /** - * When enabled, TLS packet trace information is written to `stderr`. This can be - * used to debug TLS connection problems. - * @default false - */ - enableTrace?: boolean | undefined; - /** - * If true the server will request a certificate from clients that - * connect and attempt to verify that certificate. Defaults to - * false. - */ - requestCert?: boolean | undefined; - /** - * An array of strings or a Buffer naming possible ALPN protocols. - * (Protocols should be ordered by their priority.) - */ - ALPNProtocols?: string[] | Uint8Array[] | Uint8Array | undefined; - /** - * SNICallback(servername, cb) A function that will be - * called if the client supports SNI TLS extension. Two arguments - * will be passed when called: servername and cb. SNICallback should - * invoke cb(null, ctx), where ctx is a SecureContext instance. - * (tls.createSecureContext(...) can be used to get a proper - * SecureContext.) If SNICallback wasn't provided the default callback - * with high-level API will be used (see below). - */ - SNICallback?: ((servername: string, cb: (err: Error | null, ctx?: SecureContext) => void) => void) | undefined; - /** - * If true the server will reject any connection which is not - * authorized with the list of supplied CAs. This option only has an - * effect if requestCert is true. - * @default true - */ - rejectUnauthorized?: boolean | undefined; - } - interface TlsOptions extends SecureContextOptions, CommonConnectionOptions, net.ServerOpts { - /** - * Abort the connection if the SSL/TLS handshake does not finish in the - * specified number of milliseconds. A 'tlsClientError' is emitted on - * the tls.Server object whenever a handshake times out. Default: - * 120000 (120 seconds). - */ - handshakeTimeout?: number | undefined; - /** - * The number of seconds after which a TLS session created by the - * server will no longer be resumable. See Session Resumption for more - * information. Default: 300. - */ - sessionTimeout?: number | undefined; - /** - * 48-bytes of cryptographically strong pseudo-random data. - */ - ticketKeys?: Buffer | undefined; - /** - * - * @param socket - * @param identity identity parameter sent from the client. - * @return pre-shared key that must either be - * a buffer or `null` to stop the negotiation process. Returned PSK must be - * compatible with the selected cipher's digest. - * - * When negotiating TLS-PSK (pre-shared keys), this function is called - * with the identity provided by the client. - * If the return value is `null` the negotiation process will stop and an - * "unknown_psk_identity" alert message will be sent to the other party. - * If the server wishes to hide the fact that the PSK identity was not known, - * the callback must provide some random data as `psk` to make the connection - * fail with "decrypt_error" before negotiation is finished. - * PSK ciphers are disabled by default, and using TLS-PSK thus - * requires explicitly specifying a cipher suite with the `ciphers` option. - * More information can be found in the RFC 4279. - */ - pskCallback?(socket: TLSSocket, identity: string): DataView | NodeJS.TypedArray | null; - /** - * hint to send to a client to help - * with selecting the identity during TLS-PSK negotiation. Will be ignored - * in TLS 1.3. Upon failing to set pskIdentityHint `tlsClientError` will be - * emitted with `ERR_TLS_PSK_SET_IDENTIY_HINT_FAILED` code. - */ - pskIdentityHint?: string | undefined; - } - interface PSKCallbackNegotation { - psk: DataView | NodeJS.TypedArray; - identity: string; - } - interface ConnectionOptions extends SecureContextOptions, CommonConnectionOptions { - host?: string | undefined; - port?: number | undefined; - path?: string | undefined; // Creates unix socket connection to path. If this option is specified, `host` and `port` are ignored. - socket?: stream.Duplex | undefined; // Establish secure connection on a given socket rather than creating a new socket - checkServerIdentity?: typeof checkServerIdentity | undefined; - servername?: string | undefined; // SNI TLS Extension - session?: Buffer | undefined; - minDHSize?: number | undefined; - lookup?: net.LookupFunction | undefined; - timeout?: number | undefined; - /** - * When negotiating TLS-PSK (pre-shared keys), this function is called - * with optional identity `hint` provided by the server or `null` - * in case of TLS 1.3 where `hint` was removed. - * It will be necessary to provide a custom `tls.checkServerIdentity()` - * for the connection as the default one will try to check hostname/IP - * of the server against the certificate but that's not applicable for PSK - * because there won't be a certificate present. - * More information can be found in the RFC 4279. - * - * @param hint message sent from the server to help client - * decide which identity to use during negotiation. - * Always `null` if TLS 1.3 is used. - * @returns Return `null` to stop the negotiation process. `psk` must be - * compatible with the selected cipher's digest. - * `identity` must use UTF-8 encoding. - */ - pskCallback?(hint: string | null): PSKCallbackNegotation | null; - } - /** - * Accepts encrypted connections using TLS or SSL. - * @since v0.3.2 - */ - class Server extends net.Server { - constructor(secureConnectionListener?: (socket: TLSSocket) => void); - constructor(options: TlsOptions, secureConnectionListener?: (socket: TLSSocket) => void); - /** - * The `server.addContext()` method adds a secure context that will be used if - * the client request's SNI name matches the supplied `hostname` (or wildcard). - * - * When there are multiple matching contexts, the most recently added one is - * used. - * @since v0.5.3 - * @param hostname A SNI host name or wildcard (e.g. `'*'`) - * @param context An object containing any of the possible properties from the {@link createSecureContext} `options` arguments (e.g. `key`, `cert`, `ca`, etc). - */ - addContext(hostname: string, context: SecureContextOptions): void; - /** - * Returns the session ticket keys. - * - * See `Session Resumption` for more information. - * @since v3.0.0 - * @return A 48-byte buffer containing the session ticket keys. - */ - getTicketKeys(): Buffer; - /** - * The `server.setSecureContext()` method replaces the secure context of an - * existing server. Existing connections to the server are not interrupted. - * @since v11.0.0 - * @param options An object containing any of the possible properties from the {@link createSecureContext} `options` arguments (e.g. `key`, `cert`, `ca`, etc). - */ - setSecureContext(options: SecureContextOptions): void; - /** - * Sets the session ticket keys. - * - * Changes to the ticket keys are effective only for future server connections. - * Existing or currently pending server connections will use the previous keys. - * - * See `Session Resumption` for more information. - * @since v3.0.0 - * @param keys A 48-byte buffer containing the session ticket keys. - */ - setTicketKeys(keys: Buffer): void; - /** - * events.EventEmitter - * 1. tlsClientError - * 2. newSession - * 3. OCSPRequest - * 4. resumeSession - * 5. secureConnection - * 6. keylog - */ - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: 'tlsClientError', listener: (err: Error, tlsSocket: TLSSocket) => void): this; - addListener(event: 'newSession', listener: (sessionId: Buffer, sessionData: Buffer, callback: () => void) => void): this; - addListener(event: 'OCSPRequest', listener: (certificate: Buffer, issuer: Buffer, callback: (err: Error | null, resp: Buffer) => void) => void): this; - addListener(event: 'resumeSession', listener: (sessionId: Buffer, callback: (err: Error | null, sessionData: Buffer | null) => void) => void): this; - addListener(event: 'secureConnection', listener: (tlsSocket: TLSSocket) => void): this; - addListener(event: 'keylog', listener: (line: Buffer, tlsSocket: TLSSocket) => void): this; - emit(event: string | symbol, ...args: any[]): boolean; - emit(event: 'tlsClientError', err: Error, tlsSocket: TLSSocket): boolean; - emit(event: 'newSession', sessionId: Buffer, sessionData: Buffer, callback: () => void): boolean; - emit(event: 'OCSPRequest', certificate: Buffer, issuer: Buffer, callback: (err: Error | null, resp: Buffer) => void): boolean; - emit(event: 'resumeSession', sessionId: Buffer, callback: (err: Error | null, sessionData: Buffer | null) => void): boolean; - emit(event: 'secureConnection', tlsSocket: TLSSocket): boolean; - emit(event: 'keylog', line: Buffer, tlsSocket: TLSSocket): boolean; - on(event: string, listener: (...args: any[]) => void): this; - on(event: 'tlsClientError', listener: (err: Error, tlsSocket: TLSSocket) => void): this; - on(event: 'newSession', listener: (sessionId: Buffer, sessionData: Buffer, callback: () => void) => void): this; - on(event: 'OCSPRequest', listener: (certificate: Buffer, issuer: Buffer, callback: (err: Error | null, resp: Buffer) => void) => void): this; - on(event: 'resumeSession', listener: (sessionId: Buffer, callback: (err: Error | null, sessionData: Buffer | null) => void) => void): this; - on(event: 'secureConnection', listener: (tlsSocket: TLSSocket) => void): this; - on(event: 'keylog', listener: (line: Buffer, tlsSocket: TLSSocket) => void): this; - once(event: string, listener: (...args: any[]) => void): this; - once(event: 'tlsClientError', listener: (err: Error, tlsSocket: TLSSocket) => void): this; - once(event: 'newSession', listener: (sessionId: Buffer, sessionData: Buffer, callback: () => void) => void): this; - once(event: 'OCSPRequest', listener: (certificate: Buffer, issuer: Buffer, callback: (err: Error | null, resp: Buffer) => void) => void): this; - once(event: 'resumeSession', listener: (sessionId: Buffer, callback: (err: Error | null, sessionData: Buffer | null) => void) => void): this; - once(event: 'secureConnection', listener: (tlsSocket: TLSSocket) => void): this; - once(event: 'keylog', listener: (line: Buffer, tlsSocket: TLSSocket) => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: 'tlsClientError', listener: (err: Error, tlsSocket: TLSSocket) => void): this; - prependListener(event: 'newSession', listener: (sessionId: Buffer, sessionData: Buffer, callback: () => void) => void): this; - prependListener(event: 'OCSPRequest', listener: (certificate: Buffer, issuer: Buffer, callback: (err: Error | null, resp: Buffer) => void) => void): this; - prependListener(event: 'resumeSession', listener: (sessionId: Buffer, callback: (err: Error | null, sessionData: Buffer | null) => void) => void): this; - prependListener(event: 'secureConnection', listener: (tlsSocket: TLSSocket) => void): this; - prependListener(event: 'keylog', listener: (line: Buffer, tlsSocket: TLSSocket) => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: 'tlsClientError', listener: (err: Error, tlsSocket: TLSSocket) => void): this; - prependOnceListener(event: 'newSession', listener: (sessionId: Buffer, sessionData: Buffer, callback: () => void) => void): this; - prependOnceListener(event: 'OCSPRequest', listener: (certificate: Buffer, issuer: Buffer, callback: (err: Error | null, resp: Buffer) => void) => void): this; - prependOnceListener(event: 'resumeSession', listener: (sessionId: Buffer, callback: (err: Error | null, sessionData: Buffer | null) => void) => void): this; - prependOnceListener(event: 'secureConnection', listener: (tlsSocket: TLSSocket) => void): this; - prependOnceListener(event: 'keylog', listener: (line: Buffer, tlsSocket: TLSSocket) => void): this; - } - /** - * @deprecated since v0.11.3 Use `tls.TLSSocket` instead. - */ - interface SecurePair { - encrypted: TLSSocket; - cleartext: TLSSocket; - } - type SecureVersion = 'TLSv1.3' | 'TLSv1.2' | 'TLSv1.1' | 'TLSv1'; - interface SecureContextOptions { - /** - * Optionally override the trusted CA certificates. Default is to trust - * the well-known CAs curated by Mozilla. Mozilla's CAs are completely - * replaced when CAs are explicitly specified using this option. - */ - ca?: string | Buffer | Array | undefined; - /** - * Cert chains in PEM format. One cert chain should be provided per - * private key. Each cert chain should consist of the PEM formatted - * certificate for a provided private key, followed by the PEM - * formatted intermediate certificates (if any), in order, and not - * including the root CA (the root CA must be pre-known to the peer, - * see ca). When providing multiple cert chains, they do not have to - * be in the same order as their private keys in key. If the - * intermediate certificates are not provided, the peer will not be - * able to validate the certificate, and the handshake will fail. - */ - cert?: string | Buffer | Array | undefined; - /** - * Colon-separated list of supported signature algorithms. The list - * can contain digest algorithms (SHA256, MD5 etc.), public key - * algorithms (RSA-PSS, ECDSA etc.), combination of both (e.g - * 'RSA+SHA384') or TLS v1.3 scheme names (e.g. rsa_pss_pss_sha512). - */ - sigalgs?: string | undefined; - /** - * Cipher suite specification, replacing the default. For more - * information, see modifying the default cipher suite. Permitted - * ciphers can be obtained via tls.getCiphers(). Cipher names must be - * uppercased in order for OpenSSL to accept them. - */ - ciphers?: string | undefined; - /** - * Name of an OpenSSL engine which can provide the client certificate. - */ - clientCertEngine?: string | undefined; - /** - * PEM formatted CRLs (Certificate Revocation Lists). - */ - crl?: string | Buffer | Array | undefined; - /** - * Diffie Hellman parameters, required for Perfect Forward Secrecy. Use - * openssl dhparam to create the parameters. The key length must be - * greater than or equal to 1024 bits or else an error will be thrown. - * Although 1024 bits is permissible, use 2048 bits or larger for - * stronger security. If omitted or invalid, the parameters are - * silently discarded and DHE ciphers will not be available. - */ - dhparam?: string | Buffer | undefined; - /** - * A string describing a named curve or a colon separated list of curve - * NIDs or names, for example P-521:P-384:P-256, to use for ECDH key - * agreement. Set to auto to select the curve automatically. Use - * crypto.getCurves() to obtain a list of available curve names. On - * recent releases, openssl ecparam -list_curves will also display the - * name and description of each available elliptic curve. Default: - * tls.DEFAULT_ECDH_CURVE. - */ - ecdhCurve?: string | undefined; - /** - * Attempt to use the server's cipher suite preferences instead of the - * client's. When true, causes SSL_OP_CIPHER_SERVER_PREFERENCE to be - * set in secureOptions - */ - honorCipherOrder?: boolean | undefined; - /** - * Private keys in PEM format. PEM allows the option of private keys - * being encrypted. Encrypted keys will be decrypted with - * options.passphrase. Multiple keys using different algorithms can be - * provided either as an array of unencrypted key strings or buffers, - * or an array of objects in the form {pem: [, - * passphrase: ]}. The object form can only occur in an array. - * object.passphrase is optional. Encrypted keys will be decrypted with - * object.passphrase if provided, or options.passphrase if it is not. - */ - key?: string | Buffer | Array | undefined; - /** - * Name of an OpenSSL engine to get private key from. Should be used - * together with privateKeyIdentifier. - */ - privateKeyEngine?: string | undefined; - /** - * Identifier of a private key managed by an OpenSSL engine. Should be - * used together with privateKeyEngine. Should not be set together with - * key, because both options define a private key in different ways. - */ - privateKeyIdentifier?: string | undefined; - /** - * Optionally set the maximum TLS version to allow. One - * of `'TLSv1.3'`, `'TLSv1.2'`, `'TLSv1.1'`, or `'TLSv1'`. Cannot be specified along with the - * `secureProtocol` option, use one or the other. - * **Default:** `'TLSv1.3'`, unless changed using CLI options. Using - * `--tls-max-v1.2` sets the default to `'TLSv1.2'`. Using `--tls-max-v1.3` sets the default to - * `'TLSv1.3'`. If multiple of the options are provided, the highest maximum is used. - */ - maxVersion?: SecureVersion | undefined; - /** - * Optionally set the minimum TLS version to allow. One - * of `'TLSv1.3'`, `'TLSv1.2'`, `'TLSv1.1'`, or `'TLSv1'`. Cannot be specified along with the - * `secureProtocol` option, use one or the other. It is not recommended to use - * less than TLSv1.2, but it may be required for interoperability. - * **Default:** `'TLSv1.2'`, unless changed using CLI options. Using - * `--tls-v1.0` sets the default to `'TLSv1'`. Using `--tls-v1.1` sets the default to - * `'TLSv1.1'`. Using `--tls-min-v1.3` sets the default to - * 'TLSv1.3'. If multiple of the options are provided, the lowest minimum is used. - */ - minVersion?: SecureVersion | undefined; - /** - * Shared passphrase used for a single private key and/or a PFX. - */ - passphrase?: string | undefined; - /** - * PFX or PKCS12 encoded private key and certificate chain. pfx is an - * alternative to providing key and cert individually. PFX is usually - * encrypted, if it is, passphrase will be used to decrypt it. Multiple - * PFX can be provided either as an array of unencrypted PFX buffers, - * or an array of objects in the form {buf: [, - * passphrase: ]}. The object form can only occur in an array. - * object.passphrase is optional. Encrypted PFX will be decrypted with - * object.passphrase if provided, or options.passphrase if it is not. - */ - pfx?: string | Buffer | Array | undefined; - /** - * Optionally affect the OpenSSL protocol behavior, which is not - * usually necessary. This should be used carefully if at all! Value is - * a numeric bitmask of the SSL_OP_* options from OpenSSL Options - */ - secureOptions?: number | undefined; // Value is a numeric bitmask of the `SSL_OP_*` options - /** - * Legacy mechanism to select the TLS protocol version to use, it does - * not support independent control of the minimum and maximum version, - * and does not support limiting the protocol to TLSv1.3. Use - * minVersion and maxVersion instead. The possible values are listed as - * SSL_METHODS, use the function names as strings. For example, use - * 'TLSv1_1_method' to force TLS version 1.1, or 'TLS_method' to allow - * any TLS protocol version up to TLSv1.3. It is not recommended to use - * TLS versions less than 1.2, but it may be required for - * interoperability. Default: none, see minVersion. - */ - secureProtocol?: string | undefined; - /** - * Opaque identifier used by servers to ensure session state is not - * shared between applications. Unused by clients. - */ - sessionIdContext?: string | undefined; - /** - * 48-bytes of cryptographically strong pseudo-random data. - * See Session Resumption for more information. - */ - ticketKeys?: Buffer | undefined; - /** - * The number of seconds after which a TLS session created by the - * server will no longer be resumable. See Session Resumption for more - * information. Default: 300. - */ - sessionTimeout?: number | undefined; - } - interface SecureContext { - context: any; - } - /** - * Verifies the certificate `cert` is issued to `hostname`. - * - * Returns [Error](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error) object, populating it with `reason`, `host`, and `cert` on - * failure. On success, returns [undefined](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Undefined_type). - * - * This function is intended to be used in combination with the`checkServerIdentity` option that can be passed to {@link connect} and as - * such operates on a `certificate object`. For other purposes, consider using `x509.checkHost()` instead. - * - * This function can be overwritten by providing an alternative function as the`options.checkServerIdentity` option that is passed to `tls.connect()`. The - * overwriting function can call `tls.checkServerIdentity()` of course, to augment - * the checks done with additional verification. - * - * This function is only called if the certificate passed all other checks, such as - * being issued by trusted CA (`options.ca`). - * - * Earlier versions of Node.js incorrectly accepted certificates for a given`hostname` if a matching `uniformResourceIdentifier` subject alternative name - * was present (see [CVE-2021-44531](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-44531)). Applications that wish to accept`uniformResourceIdentifier` subject alternative names can use - * a custom`options.checkServerIdentity` function that implements the desired behavior. - * @since v0.8.4 - * @param hostname The host name or IP address to verify the certificate against. - * @param cert A `certificate object` representing the peer's certificate. - */ - function checkServerIdentity(hostname: string, cert: PeerCertificate): Error | undefined; - /** - * Creates a new {@link Server}. The `secureConnectionListener`, if provided, is - * automatically set as a listener for the `'secureConnection'` event. - * - * The `ticketKeys` options is automatically shared between `cluster` module - * workers. - * - * The following illustrates a simple echo server: - * - * ```js - * const tls = require('tls'); - * const fs = require('fs'); - * - * const options = { - * key: fs.readFileSync('server-key.pem'), - * cert: fs.readFileSync('server-cert.pem'), - * - * // This is necessary only if using client certificate authentication. - * requestCert: true, - * - * // This is necessary only if the client uses a self-signed certificate. - * ca: [ fs.readFileSync('client-cert.pem') ] - * }; - * - * const server = tls.createServer(options, (socket) => { - * console.log('server connected', - * socket.authorized ? 'authorized' : 'unauthorized'); - * socket.write('welcome!\n'); - * socket.setEncoding('utf8'); - * socket.pipe(socket); - * }); - * server.listen(8000, () => { - * console.log('server bound'); - * }); - * ``` - * - * The server can be tested by connecting to it using the example client from {@link connect}. - * @since v0.3.2 - */ - function createServer(secureConnectionListener?: (socket: TLSSocket) => void): Server; - function createServer(options: TlsOptions, secureConnectionListener?: (socket: TLSSocket) => void): Server; - /** - * The `callback` function, if specified, will be added as a listener for the `'secureConnect'` event. - * - * `tls.connect()` returns a {@link TLSSocket} object. - * - * Unlike the `https` API, `tls.connect()` does not enable the - * SNI (Server Name Indication) extension by default, which may cause some - * servers to return an incorrect certificate or reject the connection - * altogether. To enable SNI, set the `servername` option in addition - * to `host`. - * - * The following illustrates a client for the echo server example from {@link createServer}: - * - * ```js - * // Assumes an echo server that is listening on port 8000. - * const tls = require('tls'); - * const fs = require('fs'); - * - * const options = { - * // Necessary only if the server requires client certificate authentication. - * key: fs.readFileSync('client-key.pem'), - * cert: fs.readFileSync('client-cert.pem'), - * - * // Necessary only if the server uses a self-signed certificate. - * ca: [ fs.readFileSync('server-cert.pem') ], - * - * // Necessary only if the server's cert isn't for "localhost". - * checkServerIdentity: () => { return null; }, - * }; - * - * const socket = tls.connect(8000, options, () => { - * console.log('client connected', - * socket.authorized ? 'authorized' : 'unauthorized'); - * process.stdin.pipe(socket); - * process.stdin.resume(); - * }); - * socket.setEncoding('utf8'); - * socket.on('data', (data) => { - * console.log(data); - * }); - * socket.on('end', () => { - * console.log('server ends connection'); - * }); - * ``` - * @since v0.11.3 - */ - function connect(options: ConnectionOptions, secureConnectListener?: () => void): TLSSocket; - function connect(port: number, host?: string, options?: ConnectionOptions, secureConnectListener?: () => void): TLSSocket; - function connect(port: number, options?: ConnectionOptions, secureConnectListener?: () => void): TLSSocket; - /** - * Creates a new secure pair object with two streams, one of which reads and writes - * the encrypted data and the other of which reads and writes the cleartext data. - * Generally, the encrypted stream is piped to/from an incoming encrypted data - * stream and the cleartext one is used as a replacement for the initial encrypted - * stream. - * - * `tls.createSecurePair()` returns a `tls.SecurePair` object with `cleartext` and`encrypted` stream properties. - * - * Using `cleartext` has the same API as {@link TLSSocket}. - * - * The `tls.createSecurePair()` method is now deprecated in favor of`tls.TLSSocket()`. For example, the code: - * - * ```js - * pair = tls.createSecurePair(// ... ); - * pair.encrypted.pipe(socket); - * socket.pipe(pair.encrypted); - * ``` - * - * can be replaced by: - * - * ```js - * secureSocket = tls.TLSSocket(socket, options); - * ``` - * - * where `secureSocket` has the same API as `pair.cleartext`. - * @since v0.3.2 - * @deprecated Since v0.11.3 - Use {@link TLSSocket} instead. - * @param context A secure context object as returned by `tls.createSecureContext()` - * @param isServer `true` to specify that this TLS connection should be opened as a server. - * @param requestCert `true` to specify whether a server should request a certificate from a connecting client. Only applies when `isServer` is `true`. - * @param rejectUnauthorized If not `false` a server automatically reject clients with invalid certificates. Only applies when `isServer` is `true`. - */ - function createSecurePair(context?: SecureContext, isServer?: boolean, requestCert?: boolean, rejectUnauthorized?: boolean): SecurePair; - /** - * {@link createServer} sets the default value of the `honorCipherOrder` option - * to `true`, other APIs that create secure contexts leave it unset. - * - * {@link createServer} uses a 128 bit truncated SHA1 hash value generated - * from `process.argv` as the default value of the `sessionIdContext` option, other - * APIs that create secure contexts have no default value. - * - * The `tls.createSecureContext()` method creates a `SecureContext` object. It is - * usable as an argument to several `tls` APIs, such as {@link createServer} and `server.addContext()`, but has no public methods. - * - * A key is _required_ for ciphers that use certificates. Either `key` or`pfx` can be used to provide it. - * - * If the `ca` option is not given, then Node.js will default to using [Mozilla's publicly trusted list of - * CAs](https://hg.mozilla.org/mozilla-central/raw-file/tip/security/nss/lib/ckfw/builtins/certdata.txt). - * @since v0.11.13 - */ - function createSecureContext(options?: SecureContextOptions): SecureContext; - /** - * Returns an array with the names of the supported TLS ciphers. The names are - * lower-case for historical reasons, but must be uppercased to be used in - * the `ciphers` option of {@link createSecureContext}. - * - * Not all supported ciphers are enabled by default. See `Modifying the default TLS cipher suite`. - * - * Cipher names that start with `'tls_'` are for TLSv1.3, all the others are for - * TLSv1.2 and below. - * - * ```js - * console.log(tls.getCiphers()); // ['aes128-gcm-sha256', 'aes128-sha', ...] - * ``` - * @since v0.10.2 - */ - function getCiphers(): string[]; - /** - * The default curve name to use for ECDH key agreement in a tls server. - * The default value is 'auto'. See tls.createSecureContext() for further - * information. - */ - let DEFAULT_ECDH_CURVE: string; - /** - * The default value of the maxVersion option of - * tls.createSecureContext(). It can be assigned any of the supported TLS - * protocol versions, 'TLSv1.3', 'TLSv1.2', 'TLSv1.1', or 'TLSv1'. Default: - * 'TLSv1.3', unless changed using CLI options. Using --tls-max-v1.2 sets - * the default to 'TLSv1.2'. Using --tls-max-v1.3 sets the default to - * 'TLSv1.3'. If multiple of the options are provided, the highest maximum - * is used. - */ - let DEFAULT_MAX_VERSION: SecureVersion; - /** - * The default value of the minVersion option of tls.createSecureContext(). - * It can be assigned any of the supported TLS protocol versions, - * 'TLSv1.3', 'TLSv1.2', 'TLSv1.1', or 'TLSv1'. Default: 'TLSv1.2', unless - * changed using CLI options. Using --tls-min-v1.0 sets the default to - * 'TLSv1'. Using --tls-min-v1.1 sets the default to 'TLSv1.1'. Using - * --tls-min-v1.3 sets the default to 'TLSv1.3'. If multiple of the options - * are provided, the lowest minimum is used. - */ - let DEFAULT_MIN_VERSION: SecureVersion; - /** - * An immutable array of strings representing the root certificates (in PEM - * format) used for verifying peer certificates. This is the default value - * of the ca option to tls.createSecureContext(). - */ - const rootCertificates: ReadonlyArray; -} -declare module 'node:tls' { - export * from 'tls'; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/trace_events.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/trace_events.d.ts deleted file mode 100755 index d47aa931..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/trace_events.d.ts +++ /dev/null @@ -1,171 +0,0 @@ -/** - * The `trace_events` module provides a mechanism to centralize tracing information - * generated by V8, Node.js core, and userspace code. - * - * Tracing can be enabled with the `--trace-event-categories` command-line flag - * or by using the `trace_events` module. The `--trace-event-categories` flag - * accepts a list of comma-separated category names. - * - * The available categories are: - * - * * `node`: An empty placeholder. - * * `node.async_hooks`: Enables capture of detailed `async_hooks` trace data. - * The `async_hooks` events have a unique `asyncId` and a special `triggerId` `triggerAsyncId` property. - * * `node.bootstrap`: Enables capture of Node.js bootstrap milestones. - * * `node.console`: Enables capture of `console.time()` and `console.count()`output. - * * `node.dns.native`: Enables capture of trace data for DNS queries. - * * `node.environment`: Enables capture of Node.js Environment milestones. - * * `node.fs.sync`: Enables capture of trace data for file system sync methods. - * * `node.perf`: Enables capture of `Performance API` measurements. - * * `node.perf.usertiming`: Enables capture of only Performance API User Timing - * measures and marks. - * * `node.perf.timerify`: Enables capture of only Performance API timerify - * measurements. - * * `node.promises.rejections`: Enables capture of trace data tracking the number - * of unhandled Promise rejections and handled-after-rejections. - * * `node.vm.script`: Enables capture of trace data for the `vm` module's`runInNewContext()`, `runInContext()`, and `runInThisContext()` methods. - * * `v8`: The `V8` events are GC, compiling, and execution related. - * - * By default the `node`, `node.async_hooks`, and `v8` categories are enabled. - * - * ```bash - * node --trace-event-categories v8,node,node.async_hooks server.js - * ``` - * - * Prior versions of Node.js required the use of the `--trace-events-enabled`flag to enable trace events. This requirement has been removed. However, the`--trace-events-enabled` flag _may_ still be - * used and will enable the`node`, `node.async_hooks`, and `v8` trace event categories by default. - * - * ```bash - * node --trace-events-enabled - * - * # is equivalent to - * - * node --trace-event-categories v8,node,node.async_hooks - * ``` - * - * Alternatively, trace events may be enabled using the `trace_events` module: - * - * ```js - * const trace_events = require('trace_events'); - * const tracing = trace_events.createTracing({ categories: ['node.perf'] }); - * tracing.enable(); // Enable trace event capture for the 'node.perf' category - * - * // do work - * - * tracing.disable(); // Disable trace event capture for the 'node.perf' category - * ``` - * - * Running Node.js with tracing enabled will produce log files that can be opened - * in the [`chrome://tracing`](https://www.chromium.org/developers/how-tos/trace-event-profiling-tool) tab of Chrome. - * - * The logging file is by default called `node_trace.${rotation}.log`, where`${rotation}` is an incrementing log-rotation id. The filepath pattern can - * be specified with `--trace-event-file-pattern` that accepts a template - * string that supports `${rotation}` and `${pid}`: - * - * ```bash - * node --trace-event-categories v8 --trace-event-file-pattern '${pid}-${rotation}.log' server.js - * ``` - * - * To guarantee that the log file is properly generated after signal events like`SIGINT`, `SIGTERM`, or `SIGBREAK`, make sure to have the appropriate handlers - * in your code, such as: - * - * ```js - * process.on('SIGINT', function onSigint() { - * console.info('Received SIGINT.'); - * process.exit(130); // Or applicable exit code depending on OS and signal - * }); - * ``` - * - * The tracing system uses the same time source - * as the one used by `process.hrtime()`. - * However the trace-event timestamps are expressed in microseconds, - * unlike `process.hrtime()` which returns nanoseconds. - * - * The features from this module are not available in `Worker` threads. - * @experimental - * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/trace_events.js) - */ -declare module 'trace_events' { - /** - * The `Tracing` object is used to enable or disable tracing for sets of - * categories. Instances are created using the - * `trace_events.createTracing()` method. - * - * When created, the `Tracing` object is disabled. Calling the - * `tracing.enable()` method adds the categories to the set of enabled trace - * event categories. Calling `tracing.disable()` will remove the categories - * from the set of enabled trace event categories. - */ - interface Tracing { - /** - * A comma-separated list of the trace event categories covered by this - * `Tracing` object. - */ - readonly categories: string; - /** - * Disables this `Tracing` object. - * - * Only trace event categories _not_ covered by other enabled `Tracing` - * objects and _not_ specified by the `--trace-event-categories` flag - * will be disabled. - */ - disable(): void; - /** - * Enables this `Tracing` object for the set of categories covered by - * the `Tracing` object. - */ - enable(): void; - /** - * `true` only if the `Tracing` object has been enabled. - */ - readonly enabled: boolean; - } - interface CreateTracingOptions { - /** - * An array of trace category names. Values included in the array are - * coerced to a string when possible. An error will be thrown if the - * value cannot be coerced. - */ - categories: string[]; - } - /** - * Creates and returns a `Tracing` object for the given set of `categories`. - * - * ```js - * const trace_events = require('trace_events'); - * const categories = ['node.perf', 'node.async_hooks']; - * const tracing = trace_events.createTracing({ categories }); - * tracing.enable(); - * // do stuff - * tracing.disable(); - * ``` - * @since v10.0.0 - * @return . - */ - function createTracing(options: CreateTracingOptions): Tracing; - /** - * Returns a comma-separated list of all currently-enabled trace event - * categories. The current set of enabled trace event categories is determined - * by the _union_ of all currently-enabled `Tracing` objects and any categories - * enabled using the `--trace-event-categories` flag. - * - * Given the file `test.js` below, the command`node --trace-event-categories node.perf test.js` will print`'node.async_hooks,node.perf'` to the console. - * - * ```js - * const trace_events = require('trace_events'); - * const t1 = trace_events.createTracing({ categories: ['node.async_hooks'] }); - * const t2 = trace_events.createTracing({ categories: ['node.perf'] }); - * const t3 = trace_events.createTracing({ categories: ['v8'] }); - * - * t1.enable(); - * t2.enable(); - * - * console.log(trace_events.getEnabledCategories()); - * ``` - * @since v10.0.0 - */ - function getEnabledCategories(): string | undefined; -} -declare module 'node:trace_events' { - export * from 'trace_events'; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/assert.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/assert.d.ts deleted file mode 100755 index e8595e63..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/assert.d.ts +++ /dev/null @@ -1,961 +0,0 @@ -/** - * The `assert` module provides a set of assertion functions for verifying - * invariants. - * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/assert.js) - */ -declare module 'assert' { - /** - * An alias of {@link ok}. - * @since v0.5.9 - * @param value The input that is checked for being truthy. - */ - function assert(value: unknown, message?: string | Error): asserts value; - namespace assert { - /** - * Indicates the failure of an assertion. All errors thrown by the `assert` module - * will be instances of the `AssertionError` class. - */ - class AssertionError extends Error { - actual: unknown; - expected: unknown; - operator: string; - generatedMessage: boolean; - code: 'ERR_ASSERTION'; - constructor(options?: { - /** If provided, the error message is set to this value. */ - message?: string | undefined; - /** The `actual` property on the error instance. */ - actual?: unknown | undefined; - /** The `expected` property on the error instance. */ - expected?: unknown | undefined; - /** The `operator` property on the error instance. */ - operator?: string | undefined; - /** If provided, the generated stack trace omits frames before this function. */ - // tslint:disable-next-line:ban-types - stackStartFn?: Function | undefined; - }); - } - /** - * This feature is currently experimental and behavior might still change. - * @since v14.2.0, v12.19.0 - * @experimental - */ - class CallTracker { - /** - * The wrapper function is expected to be called exactly `exact` times. If the - * function has not been called exactly `exact` times when `tracker.verify()` is called, then `tracker.verify()` will throw an - * error. - * - * ```js - * import assert from 'assert'; - * - * // Creates call tracker. - * const tracker = new assert.CallTracker(); - * - * function func() {} - * - * // Returns a function that wraps func() that must be called exact times - * // before tracker.verify(). - * const callsfunc = tracker.calls(func); - * ``` - * @since v14.2.0, v12.19.0 - * @param [fn='A no-op function'] - * @param [exact=1] - * @return that wraps `fn`. - */ - calls(exact?: number): () => void; - calls any>(fn?: Func, exact?: number): Func; - /** - * Example: - * - * ```js - * import assert from 'node:assert'; - * - * const tracker = new assert.CallTracker(); - * - * function func() {} - * const callsfunc = tracker.calls(func); - * callsfunc(1, 2, 3); - * - * assert.deepStrictEqual(tracker.getCalls(callsfunc), - * [{ thisArg: this, arguments: [1, 2, 3 ] }]); - * ``` - * - * @since v18.8.0, v16.18.0 - * @params fn - * @returns An Array with the calls to a tracked function. - */ - getCalls(fn: Function): CallTrackerCall[]; - /** - * The arrays contains information about the expected and actual number of calls of - * the functions that have not been called the expected number of times. - * - * ```js - * import assert from 'assert'; - * - * // Creates call tracker. - * const tracker = new assert.CallTracker(); - * - * function func() {} - * - * function foo() {} - * - * // Returns a function that wraps func() that must be called exact times - * // before tracker.verify(). - * const callsfunc = tracker.calls(func, 2); - * - * // Returns an array containing information on callsfunc() - * tracker.report(); - * // [ - * // { - * // message: 'Expected the func function to be executed 2 time(s) but was - * // executed 0 time(s).', - * // actual: 0, - * // expected: 2, - * // operator: 'func', - * // stack: stack trace - * // } - * // ] - * ``` - * @since v14.2.0, v12.19.0 - * @return of objects containing information about the wrapper functions returned by `calls`. - */ - report(): CallTrackerReportInformation[]; - /** - * Reset calls of the call tracker. - * If a tracked function is passed as an argument, the calls will be reset for it. - * If no arguments are passed, all tracked functions will be reset. - * - * ```js - * import assert from 'node:assert'; - * - * const tracker = new assert.CallTracker(); - * - * function func() {} - * const callsfunc = tracker.calls(func); - * - * callsfunc(); - * // Tracker was called once - * tracker.getCalls(callsfunc).length === 1; - * - * tracker.reset(callsfunc); - * tracker.getCalls(callsfunc).length === 0; - * ``` - * - * @since v18.8.0, v16.18.0 - * @param fn a tracked function to reset. - */ - reset(fn?: Function): void; - /** - * Iterates through the list of functions passed to `tracker.calls()` and will throw an error for functions that - * have not been called the expected number of times. - * - * ```js - * import assert from 'assert'; - * - * // Creates call tracker. - * const tracker = new assert.CallTracker(); - * - * function func() {} - * - * // Returns a function that wraps func() that must be called exact times - * // before tracker.verify(). - * const callsfunc = tracker.calls(func, 2); - * - * callsfunc(); - * - * // Will throw an error since callsfunc() was only called once. - * tracker.verify(); - * ``` - * @since v14.2.0, v12.19.0 - */ - verify(): void; - } - interface CallTrackerCall { - thisArg: object; - arguments: unknown[]; - } - interface CallTrackerReportInformation { - message: string; - /** The actual number of times the function was called. */ - actual: number; - /** The number of times the function was expected to be called. */ - expected: number; - /** The name of the function that is wrapped. */ - operator: string; - /** A stack trace of the function. */ - stack: object; - } - type AssertPredicate = RegExp | (new () => object) | ((thrown: unknown) => boolean) | object | Error; - /** - * Throws an `AssertionError` with the provided error message or a default - * error message. If the `message` parameter is an instance of an `Error` then - * it will be thrown instead of the `AssertionError`. - * - * ```js - * import assert from 'assert/strict'; - * - * assert.fail(); - * // AssertionError [ERR_ASSERTION]: Failed - * - * assert.fail('boom'); - * // AssertionError [ERR_ASSERTION]: boom - * - * assert.fail(new TypeError('need array')); - * // TypeError: need array - * ``` - * - * Using `assert.fail()` with more than two arguments is possible but deprecated. - * See below for further details. - * @since v0.1.21 - * @param [message='Failed'] - */ - function fail(message?: string | Error): never; - /** @deprecated since v10.0.0 - use fail([message]) or other assert functions instead. */ - function fail( - actual: unknown, - expected: unknown, - message?: string | Error, - operator?: string, - // tslint:disable-next-line:ban-types - stackStartFn?: Function - ): never; - /** - * Tests if `value` is truthy. It is equivalent to`assert.equal(!!value, true, message)`. - * - * If `value` is not truthy, an `AssertionError` is thrown with a `message`property set equal to the value of the `message` parameter. If the `message`parameter is `undefined`, a default - * error message is assigned. If the `message`parameter is an instance of an `Error` then it will be thrown instead of the`AssertionError`. - * If no arguments are passed in at all `message` will be set to the string:`` 'No value argument passed to `assert.ok()`' ``. - * - * Be aware that in the `repl` the error message will be different to the one - * thrown in a file! See below for further details. - * - * ```js - * import assert from 'assert/strict'; - * - * assert.ok(true); - * // OK - * assert.ok(1); - * // OK - * - * assert.ok(); - * // AssertionError: No value argument passed to `assert.ok()` - * - * assert.ok(false, 'it\'s false'); - * // AssertionError: it's false - * - * // In the repl: - * assert.ok(typeof 123 === 'string'); - * // AssertionError: false == true - * - * // In a file (e.g. test.js): - * assert.ok(typeof 123 === 'string'); - * // AssertionError: The expression evaluated to a falsy value: - * // - * // assert.ok(typeof 123 === 'string') - * - * assert.ok(false); - * // AssertionError: The expression evaluated to a falsy value: - * // - * // assert.ok(false) - * - * assert.ok(0); - * // AssertionError: The expression evaluated to a falsy value: - * // - * // assert.ok(0) - * ``` - * - * ```js - * import assert from 'assert/strict'; - * - * // Using `assert()` works the same: - * assert(0); - * // AssertionError: The expression evaluated to a falsy value: - * // - * // assert(0) - * ``` - * @since v0.1.21 - */ - function ok(value: unknown, message?: string | Error): asserts value; - /** - * **Strict assertion mode** - * - * An alias of {@link strictEqual}. - * - * **Legacy assertion mode** - * - * > Stability: 3 - Legacy: Use {@link strictEqual} instead. - * - * Tests shallow, coercive equality between the `actual` and `expected` parameters - * using the [`==` operator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Equality). `NaN` is specially handled - * and treated as being identical if both sides are `NaN`. - * - * ```js - * import assert from 'assert'; - * - * assert.equal(1, 1); - * // OK, 1 == 1 - * assert.equal(1, '1'); - * // OK, 1 == '1' - * assert.equal(NaN, NaN); - * // OK - * - * assert.equal(1, 2); - * // AssertionError: 1 == 2 - * assert.equal({ a: { b: 1 } }, { a: { b: 1 } }); - * // AssertionError: { a: { b: 1 } } == { a: { b: 1 } } - * ``` - * - * If the values are not equal, an `AssertionError` is thrown with a `message`property set equal to the value of the `message` parameter. If the `message`parameter is undefined, a default - * error message is assigned. If the `message`parameter is an instance of an `Error` then it will be thrown instead of the`AssertionError`. - * @since v0.1.21 - */ - function equal(actual: unknown, expected: unknown, message?: string | Error): void; - /** - * **Strict assertion mode** - * - * An alias of {@link notStrictEqual}. - * - * **Legacy assertion mode** - * - * > Stability: 3 - Legacy: Use {@link notStrictEqual} instead. - * - * Tests shallow, coercive inequality with the [`!=` operator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Inequality). `NaN` is - * specially handled and treated as being identical if both sides are `NaN`. - * - * ```js - * import assert from 'assert'; - * - * assert.notEqual(1, 2); - * // OK - * - * assert.notEqual(1, 1); - * // AssertionError: 1 != 1 - * - * assert.notEqual(1, '1'); - * // AssertionError: 1 != '1' - * ``` - * - * If the values are equal, an `AssertionError` is thrown with a `message`property set equal to the value of the `message` parameter. If the `message`parameter is undefined, a default error - * message is assigned. If the `message`parameter is an instance of an `Error` then it will be thrown instead of the`AssertionError`. - * @since v0.1.21 - */ - function notEqual(actual: unknown, expected: unknown, message?: string | Error): void; - /** - * **Strict assertion mode** - * - * An alias of {@link deepStrictEqual}. - * - * **Legacy assertion mode** - * - * > Stability: 3 - Legacy: Use {@link deepStrictEqual} instead. - * - * Tests for deep equality between the `actual` and `expected` parameters. Consider - * using {@link deepStrictEqual} instead. {@link deepEqual} can have - * surprising results. - * - * _Deep equality_ means that the enumerable "own" properties of child objects - * are also recursively evaluated by the following rules. - * @since v0.1.21 - */ - function deepEqual(actual: unknown, expected: unknown, message?: string | Error): void; - /** - * **Strict assertion mode** - * - * An alias of {@link notDeepStrictEqual}. - * - * **Legacy assertion mode** - * - * > Stability: 3 - Legacy: Use {@link notDeepStrictEqual} instead. - * - * Tests for any deep inequality. Opposite of {@link deepEqual}. - * - * ```js - * import assert from 'assert'; - * - * const obj1 = { - * a: { - * b: 1 - * } - * }; - * const obj2 = { - * a: { - * b: 2 - * } - * }; - * const obj3 = { - * a: { - * b: 1 - * } - * }; - * const obj4 = Object.create(obj1); - * - * assert.notDeepEqual(obj1, obj1); - * // AssertionError: { a: { b: 1 } } notDeepEqual { a: { b: 1 } } - * - * assert.notDeepEqual(obj1, obj2); - * // OK - * - * assert.notDeepEqual(obj1, obj3); - * // AssertionError: { a: { b: 1 } } notDeepEqual { a: { b: 1 } } - * - * assert.notDeepEqual(obj1, obj4); - * // OK - * ``` - * - * If the values are deeply equal, an `AssertionError` is thrown with a`message` property set equal to the value of the `message` parameter. If the`message` parameter is undefined, a default - * error message is assigned. If the`message` parameter is an instance of an `Error` then it will be thrown - * instead of the `AssertionError`. - * @since v0.1.21 - */ - function notDeepEqual(actual: unknown, expected: unknown, message?: string | Error): void; - /** - * Tests strict equality between the `actual` and `expected` parameters as - * determined by [`Object.is()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is). - * - * ```js - * import assert from 'assert/strict'; - * - * assert.strictEqual(1, 2); - * // AssertionError [ERR_ASSERTION]: Expected inputs to be strictly equal: - * // - * // 1 !== 2 - * - * assert.strictEqual(1, 1); - * // OK - * - * assert.strictEqual('Hello foobar', 'Hello World!'); - * // AssertionError [ERR_ASSERTION]: Expected inputs to be strictly equal: - * // + actual - expected - * // - * // + 'Hello foobar' - * // - 'Hello World!' - * // ^ - * - * const apples = 1; - * const oranges = 2; - * assert.strictEqual(apples, oranges, `apples ${apples} !== oranges ${oranges}`); - * // AssertionError [ERR_ASSERTION]: apples 1 !== oranges 2 - * - * assert.strictEqual(1, '1', new TypeError('Inputs are not identical')); - * // TypeError: Inputs are not identical - * ``` - * - * If the values are not strictly equal, an `AssertionError` is thrown with a`message` property set equal to the value of the `message` parameter. If the`message` parameter is undefined, a - * default error message is assigned. If the`message` parameter is an instance of an `Error` then it will be thrown - * instead of the `AssertionError`. - * @since v0.1.21 - */ - function strictEqual(actual: unknown, expected: T, message?: string | Error): asserts actual is T; - /** - * Tests strict inequality between the `actual` and `expected` parameters as - * determined by [`Object.is()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is). - * - * ```js - * import assert from 'assert/strict'; - * - * assert.notStrictEqual(1, 2); - * // OK - * - * assert.notStrictEqual(1, 1); - * // AssertionError [ERR_ASSERTION]: Expected "actual" to be strictly unequal to: - * // - * // 1 - * - * assert.notStrictEqual(1, '1'); - * // OK - * ``` - * - * If the values are strictly equal, an `AssertionError` is thrown with a`message` property set equal to the value of the `message` parameter. If the`message` parameter is undefined, a - * default error message is assigned. If the`message` parameter is an instance of an `Error` then it will be thrown - * instead of the `AssertionError`. - * @since v0.1.21 - */ - function notStrictEqual(actual: unknown, expected: unknown, message?: string | Error): void; - /** - * Tests for deep equality between the `actual` and `expected` parameters. - * "Deep" equality means that the enumerable "own" properties of child objects - * are recursively evaluated also by the following rules. - * @since v1.2.0 - */ - function deepStrictEqual(actual: unknown, expected: T, message?: string | Error): asserts actual is T; - /** - * Tests for deep strict inequality. Opposite of {@link deepStrictEqual}. - * - * ```js - * import assert from 'assert/strict'; - * - * assert.notDeepStrictEqual({ a: 1 }, { a: '1' }); - * // OK - * ``` - * - * If the values are deeply and strictly equal, an `AssertionError` is thrown - * with a `message` property set equal to the value of the `message` parameter. If - * the `message` parameter is undefined, a default error message is assigned. If - * the `message` parameter is an instance of an `Error` then it will be thrown - * instead of the `AssertionError`. - * @since v1.2.0 - */ - function notDeepStrictEqual(actual: unknown, expected: unknown, message?: string | Error): void; - /** - * Expects the function `fn` to throw an error. - * - * If specified, `error` can be a [`Class`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes), - * [`RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions), a validation function, - * a validation object where each property will be tested for strict deep equality, - * or an instance of error where each property will be tested for strict deep - * equality including the non-enumerable `message` and `name` properties. When - * using an object, it is also possible to use a regular expression, when - * validating against a string property. See below for examples. - * - * If specified, `message` will be appended to the message provided by the`AssertionError` if the `fn` call fails to throw or in case the error validation - * fails. - * - * Custom validation object/error instance: - * - * ```js - * import assert from 'assert/strict'; - * - * const err = new TypeError('Wrong value'); - * err.code = 404; - * err.foo = 'bar'; - * err.info = { - * nested: true, - * baz: 'text' - * }; - * err.reg = /abc/i; - * - * assert.throws( - * () => { - * throw err; - * }, - * { - * name: 'TypeError', - * message: 'Wrong value', - * info: { - * nested: true, - * baz: 'text' - * } - * // Only properties on the validation object will be tested for. - * // Using nested objects requires all properties to be present. Otherwise - * // the validation is going to fail. - * } - * ); - * - * // Using regular expressions to validate error properties: - * throws( - * () => { - * throw err; - * }, - * { - * // The `name` and `message` properties are strings and using regular - * // expressions on those will match against the string. If they fail, an - * // error is thrown. - * name: /^TypeError$/, - * message: /Wrong/, - * foo: 'bar', - * info: { - * nested: true, - * // It is not possible to use regular expressions for nested properties! - * baz: 'text' - * }, - * // The `reg` property contains a regular expression and only if the - * // validation object contains an identical regular expression, it is going - * // to pass. - * reg: /abc/i - * } - * ); - * - * // Fails due to the different `message` and `name` properties: - * throws( - * () => { - * const otherErr = new Error('Not found'); - * // Copy all enumerable properties from `err` to `otherErr`. - * for (const [key, value] of Object.entries(err)) { - * otherErr[key] = value; - * } - * throw otherErr; - * }, - * // The error's `message` and `name` properties will also be checked when using - * // an error as validation object. - * err - * ); - * ``` - * - * Validate instanceof using constructor: - * - * ```js - * import assert from 'assert/strict'; - * - * assert.throws( - * () => { - * throw new Error('Wrong value'); - * }, - * Error - * ); - * ``` - * - * Validate error message using [`RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions): - * - * Using a regular expression runs `.toString` on the error object, and will - * therefore also include the error name. - * - * ```js - * import assert from 'assert/strict'; - * - * assert.throws( - * () => { - * throw new Error('Wrong value'); - * }, - * /^Error: Wrong value$/ - * ); - * ``` - * - * Custom error validation: - * - * The function must return `true` to indicate all internal validations passed. - * It will otherwise fail with an `AssertionError`. - * - * ```js - * import assert from 'assert/strict'; - * - * assert.throws( - * () => { - * throw new Error('Wrong value'); - * }, - * (err) => { - * assert(err instanceof Error); - * assert(/value/.test(err)); - * // Avoid returning anything from validation functions besides `true`. - * // Otherwise, it's not clear what part of the validation failed. Instead, - * // throw an error about the specific validation that failed (as done in this - * // example) and add as much helpful debugging information to that error as - * // possible. - * return true; - * }, - * 'unexpected error' - * ); - * ``` - * - * `error` cannot be a string. If a string is provided as the second - * argument, then `error` is assumed to be omitted and the string will be used for`message` instead. This can lead to easy-to-miss mistakes. Using the same - * message as the thrown error message is going to result in an`ERR_AMBIGUOUS_ARGUMENT` error. Please read the example below carefully if using - * a string as the second argument gets considered: - * - * ```js - * import assert from 'assert/strict'; - * - * function throwingFirst() { - * throw new Error('First'); - * } - * - * function throwingSecond() { - * throw new Error('Second'); - * } - * - * function notThrowing() {} - * - * // The second argument is a string and the input function threw an Error. - * // The first case will not throw as it does not match for the error message - * // thrown by the input function! - * assert.throws(throwingFirst, 'Second'); - * // In the next example the message has no benefit over the message from the - * // error and since it is not clear if the user intended to actually match - * // against the error message, Node.js throws an `ERR_AMBIGUOUS_ARGUMENT` error. - * assert.throws(throwingSecond, 'Second'); - * // TypeError [ERR_AMBIGUOUS_ARGUMENT] - * - * // The string is only used (as message) in case the function does not throw: - * assert.throws(notThrowing, 'Second'); - * // AssertionError [ERR_ASSERTION]: Missing expected exception: Second - * - * // If it was intended to match for the error message do this instead: - * // It does not throw because the error messages match. - * assert.throws(throwingSecond, /Second$/); - * - * // If the error message does not match, an AssertionError is thrown. - * assert.throws(throwingFirst, /Second$/); - * // AssertionError [ERR_ASSERTION] - * ``` - * - * Due to the confusing error-prone notation, avoid a string as the second - * argument. - * @since v0.1.21 - */ - function throws(block: () => unknown, message?: string | Error): void; - function throws(block: () => unknown, error: AssertPredicate, message?: string | Error): void; - /** - * Asserts that the function `fn` does not throw an error. - * - * Using `assert.doesNotThrow()` is actually not useful because there - * is no benefit in catching an error and then rethrowing it. Instead, consider - * adding a comment next to the specific code path that should not throw and keep - * error messages as expressive as possible. - * - * When `assert.doesNotThrow()` is called, it will immediately call the `fn`function. - * - * If an error is thrown and it is the same type as that specified by the `error`parameter, then an `AssertionError` is thrown. If the error is of a - * different type, or if the `error` parameter is undefined, the error is - * propagated back to the caller. - * - * If specified, `error` can be a [`Class`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes), - * [`RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions) or a validation - * function. See {@link throws} for more details. - * - * The following, for instance, will throw the `TypeError` because there is no - * matching error type in the assertion: - * - * ```js - * import assert from 'assert/strict'; - * - * assert.doesNotThrow( - * () => { - * throw new TypeError('Wrong value'); - * }, - * SyntaxError - * ); - * ``` - * - * However, the following will result in an `AssertionError` with the message - * 'Got unwanted exception...': - * - * ```js - * import assert from 'assert/strict'; - * - * assert.doesNotThrow( - * () => { - * throw new TypeError('Wrong value'); - * }, - * TypeError - * ); - * ``` - * - * If an `AssertionError` is thrown and a value is provided for the `message`parameter, the value of `message` will be appended to the `AssertionError` message: - * - * ```js - * import assert from 'assert/strict'; - * - * assert.doesNotThrow( - * () => { - * throw new TypeError('Wrong value'); - * }, - * /Wrong value/, - * 'Whoops' - * ); - * // Throws: AssertionError: Got unwanted exception: Whoops - * ``` - * @since v0.1.21 - */ - function doesNotThrow(block: () => unknown, message?: string | Error): void; - function doesNotThrow(block: () => unknown, error: AssertPredicate, message?: string | Error): void; - /** - * Throws `value` if `value` is not `undefined` or `null`. This is useful when - * testing the `error` argument in callbacks. The stack trace contains all frames - * from the error passed to `ifError()` including the potential new frames for`ifError()` itself. - * - * ```js - * import assert from 'assert/strict'; - * - * assert.ifError(null); - * // OK - * assert.ifError(0); - * // AssertionError [ERR_ASSERTION]: ifError got unwanted exception: 0 - * assert.ifError('error'); - * // AssertionError [ERR_ASSERTION]: ifError got unwanted exception: 'error' - * assert.ifError(new Error()); - * // AssertionError [ERR_ASSERTION]: ifError got unwanted exception: Error - * - * // Create some random error frames. - * let err; - * (function errorFrame() { - * err = new Error('test error'); - * })(); - * - * (function ifErrorFrame() { - * assert.ifError(err); - * })(); - * // AssertionError [ERR_ASSERTION]: ifError got unwanted exception: test error - * // at ifErrorFrame - * // at errorFrame - * ``` - * @since v0.1.97 - */ - function ifError(value: unknown): asserts value is null | undefined; - /** - * Awaits the `asyncFn` promise or, if `asyncFn` is a function, immediately - * calls the function and awaits the returned promise to complete. It will then - * check that the promise is rejected. - * - * If `asyncFn` is a function and it throws an error synchronously,`assert.rejects()` will return a rejected `Promise` with that error. If the - * function does not return a promise, `assert.rejects()` will return a rejected`Promise` with an `ERR_INVALID_RETURN_VALUE` error. In both cases the error - * handler is skipped. - * - * Besides the async nature to await the completion behaves identically to {@link throws}. - * - * If specified, `error` can be a [`Class`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes), - * [`RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions), a validation function, - * an object where each property will be tested for, or an instance of error where - * each property will be tested for including the non-enumerable `message` and`name` properties. - * - * If specified, `message` will be the message provided by the `AssertionError` if the `asyncFn` fails to reject. - * - * ```js - * import assert from 'assert/strict'; - * - * await assert.rejects( - * async () => { - * throw new TypeError('Wrong value'); - * }, - * { - * name: 'TypeError', - * message: 'Wrong value' - * } - * ); - * ``` - * - * ```js - * import assert from 'assert/strict'; - * - * await assert.rejects( - * async () => { - * throw new TypeError('Wrong value'); - * }, - * (err) => { - * assert.strictEqual(err.name, 'TypeError'); - * assert.strictEqual(err.message, 'Wrong value'); - * return true; - * } - * ); - * ``` - * - * ```js - * import assert from 'assert/strict'; - * - * assert.rejects( - * Promise.reject(new Error('Wrong value')), - * Error - * ).then(() => { - * // ... - * }); - * ``` - * - * `error` cannot be a string. If a string is provided as the second - * argument, then `error` is assumed to be omitted and the string will be used for`message` instead. This can lead to easy-to-miss mistakes. Please read the - * example in {@link throws} carefully if using a string as the second - * argument gets considered. - * @since v10.0.0 - */ - function rejects(block: (() => Promise) | Promise, message?: string | Error): Promise; - function rejects(block: (() => Promise) | Promise, error: AssertPredicate, message?: string | Error): Promise; - /** - * Awaits the `asyncFn` promise or, if `asyncFn` is a function, immediately - * calls the function and awaits the returned promise to complete. It will then - * check that the promise is not rejected. - * - * If `asyncFn` is a function and it throws an error synchronously,`assert.doesNotReject()` will return a rejected `Promise` with that error. If - * the function does not return a promise, `assert.doesNotReject()` will return a - * rejected `Promise` with an `ERR_INVALID_RETURN_VALUE` error. In both cases - * the error handler is skipped. - * - * Using `assert.doesNotReject()` is actually not useful because there is little - * benefit in catching a rejection and then rejecting it again. Instead, consider - * adding a comment next to the specific code path that should not reject and keep - * error messages as expressive as possible. - * - * If specified, `error` can be a [`Class`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes), - * [`RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions) or a validation - * function. See {@link throws} for more details. - * - * Besides the async nature to await the completion behaves identically to {@link doesNotThrow}. - * - * ```js - * import assert from 'assert/strict'; - * - * await assert.doesNotReject( - * async () => { - * throw new TypeError('Wrong value'); - * }, - * SyntaxError - * ); - * ``` - * - * ```js - * import assert from 'assert/strict'; - * - * assert.doesNotReject(Promise.reject(new TypeError('Wrong value'))) - * .then(() => { - * // ... - * }); - * ``` - * @since v10.0.0 - */ - function doesNotReject(block: (() => Promise) | Promise, message?: string | Error): Promise; - function doesNotReject(block: (() => Promise) | Promise, error: AssertPredicate, message?: string | Error): Promise; - /** - * Expects the `string` input to match the regular expression. - * - * ```js - * import assert from 'assert/strict'; - * - * assert.match('I will fail', /pass/); - * // AssertionError [ERR_ASSERTION]: The input did not match the regular ... - * - * assert.match(123, /pass/); - * // AssertionError [ERR_ASSERTION]: The "string" argument must be of type string. - * - * assert.match('I will pass', /pass/); - * // OK - * ``` - * - * If the values do not match, or if the `string` argument is of another type than`string`, an `AssertionError` is thrown with a `message` property set equal - * to the value of the `message` parameter. If the `message` parameter is - * undefined, a default error message is assigned. If the `message` parameter is an - * instance of an `Error` then it will be thrown instead of the `AssertionError`. - * @since v13.6.0, v12.16.0 - */ - function match(value: string, regExp: RegExp, message?: string | Error): void; - /** - * Expects the `string` input not to match the regular expression. - * - * ```js - * import assert from 'assert/strict'; - * - * assert.doesNotMatch('I will fail', /fail/); - * // AssertionError [ERR_ASSERTION]: The input was expected to not match the ... - * - * assert.doesNotMatch(123, /pass/); - * // AssertionError [ERR_ASSERTION]: The "string" argument must be of type string. - * - * assert.doesNotMatch('I will pass', /different/); - * // OK - * ``` - * - * If the values do match, or if the `string` argument is of another type than`string`, an `AssertionError` is thrown with a `message` property set equal - * to the value of the `message` parameter. If the `message` parameter is - * undefined, a default error message is assigned. If the `message` parameter is an - * instance of an `Error` then it will be thrown instead of the `AssertionError`. - * @since v13.6.0, v12.16.0 - */ - function doesNotMatch(value: string, regExp: RegExp, message?: string | Error): void; - const strict: Omit & { - (value: unknown, message?: string | Error): asserts value; - equal: typeof strictEqual; - notEqual: typeof notStrictEqual; - deepEqual: typeof deepStrictEqual; - notDeepEqual: typeof notDeepStrictEqual; - // Mapped types and assertion functions are incompatible? - // TS2775: Assertions require every name in the call target - // to be declared with an explicit type annotation. - ok: typeof ok; - strictEqual: typeof strictEqual; - deepStrictEqual: typeof deepStrictEqual; - ifError: typeof ifError; - strict: typeof strict; - }; - } - export = assert; -} -declare module 'node:assert' { - import assert = require('assert'); - export = assert; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/assert/strict.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/assert/strict.d.ts deleted file mode 100755 index b4319b97..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/assert/strict.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -declare module 'assert/strict' { - import { strict } from 'node:assert'; - export = strict; -} -declare module 'node:assert/strict' { - import { strict } from 'node:assert'; - export = strict; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/async_hooks.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/async_hooks.d.ts deleted file mode 100755 index 0bf47396..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/async_hooks.d.ts +++ /dev/null @@ -1,501 +0,0 @@ -/** - * The `async_hooks` module provides an API to track asynchronous resources. It - * can be accessed using: - * - * ```js - * import async_hooks from 'async_hooks'; - * ``` - * @experimental - * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/async_hooks.js) - */ -declare module 'async_hooks' { - /** - * ```js - * import { executionAsyncId } from 'async_hooks'; - * - * console.log(executionAsyncId()); // 1 - bootstrap - * fs.open(path, 'r', (err, fd) => { - * console.log(executionAsyncId()); // 6 - open() - * }); - * ``` - * - * The ID returned from `executionAsyncId()` is related to execution timing, not - * causality (which is covered by `triggerAsyncId()`): - * - * ```js - * const server = net.createServer((conn) => { - * // Returns the ID of the server, not of the new connection, because the - * // callback runs in the execution scope of the server's MakeCallback(). - * async_hooks.executionAsyncId(); - * - * }).listen(port, () => { - * // Returns the ID of a TickObject (process.nextTick()) because all - * // callbacks passed to .listen() are wrapped in a nextTick(). - * async_hooks.executionAsyncId(); - * }); - * ``` - * - * Promise contexts may not get precise `executionAsyncIds` by default. - * See the section on `promise execution tracking`. - * @since v8.1.0 - * @return The `asyncId` of the current execution context. Useful to track when something calls. - */ - function executionAsyncId(): number; - /** - * Resource objects returned by `executionAsyncResource()` are most often internal - * Node.js handle objects with undocumented APIs. Using any functions or properties - * on the object is likely to crash your application and should be avoided. - * - * Using `executionAsyncResource()` in the top-level execution context will - * return an empty object as there is no handle or request object to use, - * but having an object representing the top-level can be helpful. - * - * ```js - * import { open } from 'fs'; - * import { executionAsyncId, executionAsyncResource } from 'async_hooks'; - * - * console.log(executionAsyncId(), executionAsyncResource()); // 1 {} - * open(new URL(import.meta.url), 'r', (err, fd) => { - * console.log(executionAsyncId(), executionAsyncResource()); // 7 FSReqWrap - * }); - * ``` - * - * This can be used to implement continuation local storage without the - * use of a tracking `Map` to store the metadata: - * - * ```js - * import { createServer } from 'http'; - * import { - * executionAsyncId, - * executionAsyncResource, - * createHook - * } from 'async_hooks'; - * const sym = Symbol('state'); // Private symbol to avoid pollution - * - * createHook({ - * init(asyncId, type, triggerAsyncId, resource) { - * const cr = executionAsyncResource(); - * if (cr) { - * resource[sym] = cr[sym]; - * } - * } - * }).enable(); - * - * const server = createServer((req, res) => { - * executionAsyncResource()[sym] = { state: req.url }; - * setTimeout(function() { - * res.end(JSON.stringify(executionAsyncResource()[sym])); - * }, 100); - * }).listen(3000); - * ``` - * @since v13.9.0, v12.17.0 - * @return The resource representing the current execution. Useful to store data within the resource. - */ - function executionAsyncResource(): object; - /** - * ```js - * const server = net.createServer((conn) => { - * // The resource that caused (or triggered) this callback to be called - * // was that of the new connection. Thus the return value of triggerAsyncId() - * // is the asyncId of "conn". - * async_hooks.triggerAsyncId(); - * - * }).listen(port, () => { - * // Even though all callbacks passed to .listen() are wrapped in a nextTick() - * // the callback itself exists because the call to the server's .listen() - * // was made. So the return value would be the ID of the server. - * async_hooks.triggerAsyncId(); - * }); - * ``` - * - * Promise contexts may not get valid `triggerAsyncId`s by default. See - * the section on `promise execution tracking`. - * @return The ID of the resource responsible for calling the callback that is currently being executed. - */ - function triggerAsyncId(): number; - interface HookCallbacks { - /** - * Called when a class is constructed that has the possibility to emit an asynchronous event. - * @param asyncId a unique ID for the async resource - * @param type the type of the async resource - * @param triggerAsyncId the unique ID of the async resource in whose execution context this async resource was created - * @param resource reference to the resource representing the async operation, needs to be released during destroy - */ - init?(asyncId: number, type: string, triggerAsyncId: number, resource: object): void; - /** - * When an asynchronous operation is initiated or completes a callback is called to notify the user. - * The before callback is called just before said callback is executed. - * @param asyncId the unique identifier assigned to the resource about to execute the callback. - */ - before?(asyncId: number): void; - /** - * Called immediately after the callback specified in before is completed. - * @param asyncId the unique identifier assigned to the resource which has executed the callback. - */ - after?(asyncId: number): void; - /** - * Called when a promise has resolve() called. This may not be in the same execution id - * as the promise itself. - * @param asyncId the unique id for the promise that was resolve()d. - */ - promiseResolve?(asyncId: number): void; - /** - * Called after the resource corresponding to asyncId is destroyed - * @param asyncId a unique ID for the async resource - */ - destroy?(asyncId: number): void; - } - interface AsyncHook { - /** - * Enable the callbacks for a given AsyncHook instance. If no callbacks are provided enabling is a noop. - */ - enable(): this; - /** - * Disable the callbacks for a given AsyncHook instance from the global pool of AsyncHook callbacks to be executed. Once a hook has been disabled it will not be called again until enabled. - */ - disable(): this; - } - /** - * Registers functions to be called for different lifetime events of each async - * operation. - * - * The callbacks `init()`/`before()`/`after()`/`destroy()` are called for the - * respective asynchronous event during a resource's lifetime. - * - * All callbacks are optional. For example, if only resource cleanup needs to - * be tracked, then only the `destroy` callback needs to be passed. The - * specifics of all functions that can be passed to `callbacks` is in the `Hook Callbacks` section. - * - * ```js - * import { createHook } from 'async_hooks'; - * - * const asyncHook = createHook({ - * init(asyncId, type, triggerAsyncId, resource) { }, - * destroy(asyncId) { } - * }); - * ``` - * - * The callbacks will be inherited via the prototype chain: - * - * ```js - * class MyAsyncCallbacks { - * init(asyncId, type, triggerAsyncId, resource) { } - * destroy(asyncId) {} - * } - * - * class MyAddedCallbacks extends MyAsyncCallbacks { - * before(asyncId) { } - * after(asyncId) { } - * } - * - * const asyncHook = async_hooks.createHook(new MyAddedCallbacks()); - * ``` - * - * Because promises are asynchronous resources whose lifecycle is tracked - * via the async hooks mechanism, the `init()`, `before()`, `after()`, and`destroy()` callbacks _must not_ be async functions that return promises. - * @since v8.1.0 - * @param callbacks The `Hook Callbacks` to register - * @return Instance used for disabling and enabling hooks - */ - function createHook(callbacks: HookCallbacks): AsyncHook; - interface AsyncResourceOptions { - /** - * The ID of the execution context that created this async event. - * @default executionAsyncId() - */ - triggerAsyncId?: number | undefined; - /** - * Disables automatic `emitDestroy` when the object is garbage collected. - * This usually does not need to be set (even if `emitDestroy` is called - * manually), unless the resource's `asyncId` is retrieved and the - * sensitive API's `emitDestroy` is called with it. - * @default false - */ - requireManualDestroy?: boolean | undefined; - } - /** - * The class `AsyncResource` is designed to be extended by the embedder's async - * resources. Using this, users can easily trigger the lifetime events of their - * own resources. - * - * The `init` hook will trigger when an `AsyncResource` is instantiated. - * - * The following is an overview of the `AsyncResource` API. - * - * ```js - * import { AsyncResource, executionAsyncId } from 'async_hooks'; - * - * // AsyncResource() is meant to be extended. Instantiating a - * // new AsyncResource() also triggers init. If triggerAsyncId is omitted then - * // async_hook.executionAsyncId() is used. - * const asyncResource = new AsyncResource( - * type, { triggerAsyncId: executionAsyncId(), requireManualDestroy: false } - * ); - * - * // Run a function in the execution context of the resource. This will - * // * establish the context of the resource - * // * trigger the AsyncHooks before callbacks - * // * call the provided function `fn` with the supplied arguments - * // * trigger the AsyncHooks after callbacks - * // * restore the original execution context - * asyncResource.runInAsyncScope(fn, thisArg, ...args); - * - * // Call AsyncHooks destroy callbacks. - * asyncResource.emitDestroy(); - * - * // Return the unique ID assigned to the AsyncResource instance. - * asyncResource.asyncId(); - * - * // Return the trigger ID for the AsyncResource instance. - * asyncResource.triggerAsyncId(); - * ``` - */ - class AsyncResource { - /** - * AsyncResource() is meant to be extended. Instantiating a - * new AsyncResource() also triggers init. If triggerAsyncId is omitted then - * async_hook.executionAsyncId() is used. - * @param type The type of async event. - * @param triggerAsyncId The ID of the execution context that created - * this async event (default: `executionAsyncId()`), or an - * AsyncResourceOptions object (since v9.3.0) - */ - constructor(type: string, triggerAsyncId?: number | AsyncResourceOptions); - /** - * Binds the given function to the current execution context. - * - * The returned function will have an `asyncResource` property referencing - * the `AsyncResource` to which the function is bound. - * @since v14.8.0, v12.19.0 - * @param fn The function to bind to the current execution context. - * @param type An optional name to associate with the underlying `AsyncResource`. - */ - static bind any, ThisArg>( - fn: Func, - type?: string, - thisArg?: ThisArg - ): Func & { - asyncResource: AsyncResource; - }; - /** - * Binds the given function to execute to this `AsyncResource`'s scope. - * - * The returned function will have an `asyncResource` property referencing - * the `AsyncResource` to which the function is bound. - * @since v14.8.0, v12.19.0 - * @param fn The function to bind to the current `AsyncResource`. - */ - bind any>( - fn: Func - ): Func & { - asyncResource: AsyncResource; - }; - /** - * Call the provided function with the provided arguments in the execution context - * of the async resource. This will establish the context, trigger the AsyncHooks - * before callbacks, call the function, trigger the AsyncHooks after callbacks, and - * then restore the original execution context. - * @since v9.6.0 - * @param fn The function to call in the execution context of this async resource. - * @param thisArg The receiver to be used for the function call. - * @param args Optional arguments to pass to the function. - */ - runInAsyncScope(fn: (this: This, ...args: any[]) => Result, thisArg?: This, ...args: any[]): Result; - /** - * Call all `destroy` hooks. This should only ever be called once. An error will - * be thrown if it is called more than once. This **must** be manually called. If - * the resource is left to be collected by the GC then the `destroy` hooks will - * never be called. - * @return A reference to `asyncResource`. - */ - emitDestroy(): this; - /** - * @return The unique `asyncId` assigned to the resource. - */ - asyncId(): number; - /** - * - * @return The same `triggerAsyncId` that is passed to the `AsyncResource` constructor. - */ - triggerAsyncId(): number; - } - /** - * This class creates stores that stay coherent through asynchronous operations. - * - * While you can create your own implementation on top of the `async_hooks` module,`AsyncLocalStorage` should be preferred as it is a performant and memory safe - * implementation that involves significant optimizations that are non-obvious to - * implement. - * - * The following example uses `AsyncLocalStorage` to build a simple logger - * that assigns IDs to incoming HTTP requests and includes them in messages - * logged within each request. - * - * ```js - * import http from 'http'; - * import { AsyncLocalStorage } from 'async_hooks'; - * - * const asyncLocalStorage = new AsyncLocalStorage(); - * - * function logWithId(msg) { - * const id = asyncLocalStorage.getStore(); - * console.log(`${id !== undefined ? id : '-'}:`, msg); - * } - * - * let idSeq = 0; - * http.createServer((req, res) => { - * asyncLocalStorage.run(idSeq++, () => { - * logWithId('start'); - * // Imagine any chain of async operations here - * setImmediate(() => { - * logWithId('finish'); - * res.end(); - * }); - * }); - * }).listen(8080); - * - * http.get('http://localhost:8080'); - * http.get('http://localhost:8080'); - * // Prints: - * // 0: start - * // 1: start - * // 0: finish - * // 1: finish - * ``` - * - * Each instance of `AsyncLocalStorage` maintains an independent storage context. - * Multiple instances can safely exist simultaneously without risk of interfering - * with each other's data. - * @since v13.10.0, v12.17.0 - */ - class AsyncLocalStorage { - /** - * Disables the instance of `AsyncLocalStorage`. All subsequent calls - * to `asyncLocalStorage.getStore()` will return `undefined` until`asyncLocalStorage.run()` or `asyncLocalStorage.enterWith()` is called again. - * - * When calling `asyncLocalStorage.disable()`, all current contexts linked to the - * instance will be exited. - * - * Calling `asyncLocalStorage.disable()` is required before the`asyncLocalStorage` can be garbage collected. This does not apply to stores - * provided by the `asyncLocalStorage`, as those objects are garbage collected - * along with the corresponding async resources. - * - * Use this method when the `asyncLocalStorage` is not in use anymore - * in the current process. - * @since v13.10.0, v12.17.0 - * @experimental - */ - disable(): void; - /** - * Returns the current store. - * If called outside of an asynchronous context initialized by - * calling `asyncLocalStorage.run()` or `asyncLocalStorage.enterWith()`, it - * returns `undefined`. - * @since v13.10.0, v12.17.0 - */ - getStore(): T | undefined; - /** - * Runs a function synchronously within a context and returns its - * return value. The store is not accessible outside of the callback function. - * The store is accessible to any asynchronous operations created within the - * callback. - * - * The optional `args` are passed to the callback function. - * - * If the callback function throws an error, the error is thrown by `run()` too. - * The stacktrace is not impacted by this call and the context is exited. - * - * Example: - * - * ```js - * const store = { id: 2 }; - * try { - * asyncLocalStorage.run(store, () => { - * asyncLocalStorage.getStore(); // Returns the store object - * setTimeout(() => { - * asyncLocalStorage.getStore(); // Returns the store object - * }, 200); - * throw new Error(); - * }); - * } catch (e) { - * asyncLocalStorage.getStore(); // Returns undefined - * // The error will be caught here - * } - * ``` - * @since v13.10.0, v12.17.0 - */ - run(store: T, callback: (...args: TArgs) => R, ...args: TArgs): R; - /** - * Runs a function synchronously outside of a context and returns its - * return value. The store is not accessible within the callback function or - * the asynchronous operations created within the callback. Any `getStore()`call done within the callback function will always return `undefined`. - * - * The optional `args` are passed to the callback function. - * - * If the callback function throws an error, the error is thrown by `exit()` too. - * The stacktrace is not impacted by this call and the context is re-entered. - * - * Example: - * - * ```js - * // Within a call to run - * try { - * asyncLocalStorage.getStore(); // Returns the store object or value - * asyncLocalStorage.exit(() => { - * asyncLocalStorage.getStore(); // Returns undefined - * throw new Error(); - * }); - * } catch (e) { - * asyncLocalStorage.getStore(); // Returns the same object or value - * // The error will be caught here - * } - * ``` - * @since v13.10.0, v12.17.0 - * @experimental - */ - exit(callback: (...args: TArgs) => R, ...args: TArgs): R; - /** - * Transitions into the context for the remainder of the current - * synchronous execution and then persists the store through any following - * asynchronous calls. - * - * Example: - * - * ```js - * const store = { id: 1 }; - * // Replaces previous store with the given store object - * asyncLocalStorage.enterWith(store); - * asyncLocalStorage.getStore(); // Returns the store object - * someAsyncOperation(() => { - * asyncLocalStorage.getStore(); // Returns the same object - * }); - * ``` - * - * This transition will continue for the _entire_ synchronous execution. - * This means that if, for example, the context is entered within an event - * handler subsequent event handlers will also run within that context unless - * specifically bound to another context with an `AsyncResource`. That is why`run()` should be preferred over `enterWith()` unless there are strong reasons - * to use the latter method. - * - * ```js - * const store = { id: 1 }; - * - * emitter.on('my-event', () => { - * asyncLocalStorage.enterWith(store); - * }); - * emitter.on('my-event', () => { - * asyncLocalStorage.getStore(); // Returns the same object - * }); - * - * asyncLocalStorage.getStore(); // Returns undefined - * emitter.emit('my-event'); - * asyncLocalStorage.getStore(); // Returns the same object - * ``` - * @since v13.11.0, v12.17.0 - * @experimental - */ - enterWith(store: T): void; - } -} -declare module 'node:async_hooks' { - export * from 'async_hooks'; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/buffer.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/buffer.d.ts deleted file mode 100755 index ea859cd2..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/buffer.d.ts +++ /dev/null @@ -1,2259 +0,0 @@ -/** - * `Buffer` objects are used to represent a fixed-length sequence of bytes. Many - * Node.js APIs support `Buffer`s. - * - * The `Buffer` class is a subclass of JavaScript's [`Uint8Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array) class and - * extends it with methods that cover additional use cases. Node.js APIs accept - * plain [`Uint8Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array) s wherever `Buffer`s are supported as well. - * - * While the `Buffer` class is available within the global scope, it is still - * recommended to explicitly reference it via an import or require statement. - * - * ```js - * import { Buffer } from 'buffer'; - * - * // Creates a zero-filled Buffer of length 10. - * const buf1 = Buffer.alloc(10); - * - * // Creates a Buffer of length 10, - * // filled with bytes which all have the value `1`. - * const buf2 = Buffer.alloc(10, 1); - * - * // Creates an uninitialized buffer of length 10. - * // This is faster than calling Buffer.alloc() but the returned - * // Buffer instance might contain old data that needs to be - * // overwritten using fill(), write(), or other functions that fill the Buffer's - * // contents. - * const buf3 = Buffer.allocUnsafe(10); - * - * // Creates a Buffer containing the bytes [1, 2, 3]. - * const buf4 = Buffer.from([1, 2, 3]); - * - * // Creates a Buffer containing the bytes [1, 1, 1, 1] – the entries - * // are all truncated using `(value & 255)` to fit into the range 0–255. - * const buf5 = Buffer.from([257, 257.5, -255, '1']); - * - * // Creates a Buffer containing the UTF-8-encoded bytes for the string 'tést': - * // [0x74, 0xc3, 0xa9, 0x73, 0x74] (in hexadecimal notation) - * // [116, 195, 169, 115, 116] (in decimal notation) - * const buf6 = Buffer.from('tést'); - * - * // Creates a Buffer containing the Latin-1 bytes [0x74, 0xe9, 0x73, 0x74]. - * const buf7 = Buffer.from('tést', 'latin1'); - * ``` - * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/buffer.js) - */ -declare module 'buffer' { - import { BinaryLike } from 'node:crypto'; - import { ReadableStream as WebReadableStream } from 'node:stream/web'; - export const INSPECT_MAX_BYTES: number; - export const kMaxLength: number; - export const kStringMaxLength: number; - export const constants: { - MAX_LENGTH: number; - MAX_STRING_LENGTH: number; - }; - export type TranscodeEncoding = 'ascii' | 'utf8' | 'utf16le' | 'ucs2' | 'latin1' | 'binary'; - /** - * Re-encodes the given `Buffer` or `Uint8Array` instance from one character - * encoding to another. Returns a new `Buffer` instance. - * - * Throws if the `fromEnc` or `toEnc` specify invalid character encodings or if - * conversion from `fromEnc` to `toEnc` is not permitted. - * - * Encodings supported by `buffer.transcode()` are: `'ascii'`, `'utf8'`,`'utf16le'`, `'ucs2'`, `'latin1'`, and `'binary'`. - * - * The transcoding process will use substitution characters if a given byte - * sequence cannot be adequately represented in the target encoding. For instance: - * - * ```js - * import { Buffer, transcode } from 'buffer'; - * - * const newBuf = transcode(Buffer.from('€'), 'utf8', 'ascii'); - * console.log(newBuf.toString('ascii')); - * // Prints: '?' - * ``` - * - * Because the Euro (`€`) sign is not representable in US-ASCII, it is replaced - * with `?` in the transcoded `Buffer`. - * @since v7.1.0 - * @param source A `Buffer` or `Uint8Array` instance. - * @param fromEnc The current encoding. - * @param toEnc To target encoding. - */ - export function transcode(source: Uint8Array, fromEnc: TranscodeEncoding, toEnc: TranscodeEncoding): Buffer; - export const SlowBuffer: { - /** @deprecated since v6.0.0, use `Buffer.allocUnsafeSlow()` */ - new (size: number): Buffer; - prototype: Buffer; - }; - /** - * Resolves a `'blob:nodedata:...'` an associated `Blob` object registered using - * a prior call to `URL.createObjectURL()`. - * @since v16.7.0 - * @experimental - * @param id A `'blob:nodedata:...` URL string returned by a prior call to `URL.createObjectURL()`. - */ - export function resolveObjectURL(id: string): Blob | undefined; - export { Buffer }; - /** - * @experimental - */ - export interface BlobOptions { - /** - * @default 'utf8' - */ - encoding?: BufferEncoding | undefined; - /** - * The Blob content-type. The intent is for `type` to convey - * the MIME media type of the data, however no validation of the type format - * is performed. - */ - type?: string | undefined; - } - /** - * A [`Blob`](https://developer.mozilla.org/en-US/docs/Web/API/Blob) encapsulates immutable, raw data that can be safely shared across - * multiple worker threads. - * @since v15.7.0, v14.18.0 - */ - export class Blob { - /** - * The total size of the `Blob` in bytes. - * @since v15.7.0, v14.18.0 - */ - readonly size: number; - /** - * The content-type of the `Blob`. - * @since v15.7.0, v14.18.0 - */ - readonly type: string; - /** - * Creates a new `Blob` object containing a concatenation of the given sources. - * - * {ArrayBuffer}, {TypedArray}, {DataView}, and {Buffer} sources are copied into - * the 'Blob' and can therefore be safely modified after the 'Blob' is created. - * - * String sources are also copied into the `Blob`. - */ - constructor(sources: Array, options?: BlobOptions); - /** - * Returns a promise that fulfills with an [ArrayBuffer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer) containing a copy of - * the `Blob` data. - * @since v15.7.0, v14.18.0 - */ - arrayBuffer(): Promise; - /** - * Creates and returns a new `Blob` containing a subset of this `Blob` objects - * data. The original `Blob` is not altered. - * @since v15.7.0, v14.18.0 - * @param start The starting index. - * @param end The ending index. - * @param type The content-type for the new `Blob` - */ - slice(start?: number, end?: number, type?: string): Blob; - /** - * Returns a promise that fulfills with the contents of the `Blob` decoded as a - * UTF-8 string. - * @since v15.7.0, v14.18.0 - */ - text(): Promise; - /** - * Returns a new (WHATWG) `ReadableStream` that allows the content of the `Blob` to be read. - * @since v16.7.0 - */ - stream(): WebReadableStream; - } - export import atob = globalThis.atob; - export import btoa = globalThis.btoa; - - import { Blob as NodeBlob } from 'buffer'; - // This conditional type will be the existing global Blob in a browser, or - // the copy below in a Node environment. - type __Blob = typeof globalThis extends { onmessage: any, Blob: any } - ? {} : NodeBlob; - - global { - // Buffer class - type BufferEncoding = 'ascii' | 'utf8' | 'utf-8' | 'utf16le' | 'ucs2' | 'ucs-2' | 'base64' | 'base64url' | 'latin1' | 'binary' | 'hex'; - type WithImplicitCoercion = - | T - | { - valueOf(): T; - }; - /** - * Raw data is stored in instances of the Buffer class. - * A Buffer is similar to an array of integers but corresponds to a raw memory allocation outside the V8 heap. A Buffer cannot be resized. - * Valid string encodings: 'ascii'|'utf8'|'utf16le'|'ucs2'(alias of 'utf16le')|'base64'|'base64url'|'binary'(deprecated)|'hex' - */ - interface BufferConstructor { - /** - * Allocates a new buffer containing the given {str}. - * - * @param str String to store in buffer. - * @param encoding encoding to use, optional. Default is 'utf8' - * @deprecated since v10.0.0 - Use `Buffer.from(string[, encoding])` instead. - */ - new (str: string, encoding?: BufferEncoding): Buffer; - /** - * Allocates a new buffer of {size} octets. - * - * @param size count of octets to allocate. - * @deprecated since v10.0.0 - Use `Buffer.alloc()` instead (also see `Buffer.allocUnsafe()`). - */ - new (size: number): Buffer; - /** - * Allocates a new buffer containing the given {array} of octets. - * - * @param array The octets to store. - * @deprecated since v10.0.0 - Use `Buffer.from(array)` instead. - */ - new (array: Uint8Array): Buffer; - /** - * Produces a Buffer backed by the same allocated memory as - * the given {ArrayBuffer}/{SharedArrayBuffer}. - * - * - * @param arrayBuffer The ArrayBuffer with which to share memory. - * @deprecated since v10.0.0 - Use `Buffer.from(arrayBuffer[, byteOffset[, length]])` instead. - */ - new (arrayBuffer: ArrayBuffer | SharedArrayBuffer): Buffer; - /** - * Allocates a new buffer containing the given {array} of octets. - * - * @param array The octets to store. - * @deprecated since v10.0.0 - Use `Buffer.from(array)` instead. - */ - new (array: ReadonlyArray): Buffer; - /** - * Copies the passed {buffer} data onto a new {Buffer} instance. - * - * @param buffer The buffer to copy. - * @deprecated since v10.0.0 - Use `Buffer.from(buffer)` instead. - */ - new (buffer: Buffer): Buffer; - /** - * Allocates a new `Buffer` using an `array` of bytes in the range `0` – `255`. - * Array entries outside that range will be truncated to fit into it. - * - * ```js - * import { Buffer } from 'buffer'; - * - * // Creates a new Buffer containing the UTF-8 bytes of the string 'buffer'. - * const buf = Buffer.from([0x62, 0x75, 0x66, 0x66, 0x65, 0x72]); - * ``` - * - * A `TypeError` will be thrown if `array` is not an `Array` or another type - * appropriate for `Buffer.from()` variants. - * - * `Buffer.from(array)` and `Buffer.from(string)` may also use the internal`Buffer` pool like `Buffer.allocUnsafe()` does. - * @since v5.10.0 - */ - from(arrayBuffer: WithImplicitCoercion, byteOffset?: number, length?: number): Buffer; - /** - * Creates a new Buffer using the passed {data} - * @param data data to create a new Buffer - */ - from(data: Uint8Array | ReadonlyArray): Buffer; - from(data: WithImplicitCoercion | string>): Buffer; - /** - * Creates a new Buffer containing the given JavaScript string {str}. - * If provided, the {encoding} parameter identifies the character encoding. - * If not provided, {encoding} defaults to 'utf8'. - */ - from( - str: - | WithImplicitCoercion - | { - [Symbol.toPrimitive](hint: 'string'): string; - }, - encoding?: BufferEncoding - ): Buffer; - /** - * Creates a new Buffer using the passed {data} - * @param values to create a new Buffer - */ - of(...items: number[]): Buffer; - /** - * Returns `true` if `obj` is a `Buffer`, `false` otherwise. - * - * ```js - * import { Buffer } from 'buffer'; - * - * Buffer.isBuffer(Buffer.alloc(10)); // true - * Buffer.isBuffer(Buffer.from('foo')); // true - * Buffer.isBuffer('a string'); // false - * Buffer.isBuffer([]); // false - * Buffer.isBuffer(new Uint8Array(1024)); // false - * ``` - * @since v0.1.101 - */ - isBuffer(obj: any): obj is Buffer; - /** - * Returns `true` if `encoding` is the name of a supported character encoding, - * or `false` otherwise. - * - * ```js - * import { Buffer } from 'buffer'; - * - * console.log(Buffer.isEncoding('utf8')); - * // Prints: true - * - * console.log(Buffer.isEncoding('hex')); - * // Prints: true - * - * console.log(Buffer.isEncoding('utf/8')); - * // Prints: false - * - * console.log(Buffer.isEncoding('')); - * // Prints: false - * ``` - * @since v0.9.1 - * @param encoding A character encoding name to check. - */ - isEncoding(encoding: string): encoding is BufferEncoding; - /** - * Returns the byte length of a string when encoded using `encoding`. - * This is not the same as [`String.prototype.length`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/length), which does not account - * for the encoding that is used to convert the string into bytes. - * - * For `'base64'`, `'base64url'`, and `'hex'`, this function assumes valid input. - * For strings that contain non-base64/hex-encoded data (e.g. whitespace), the - * return value might be greater than the length of a `Buffer` created from the - * string. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const str = '\u00bd + \u00bc = \u00be'; - * - * console.log(`${str}: ${str.length} characters, ` + - * `${Buffer.byteLength(str, 'utf8')} bytes`); - * // Prints: ½ + ¼ = ¾: 9 characters, 12 bytes - * ``` - * - * When `string` is a - * `Buffer`/[`DataView`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView)/[`TypedArray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/- - * Reference/Global_Objects/TypedArray)/[`ArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer)/[`SharedArrayBuffer`](https://develop- - * er.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer), the byte length as reported by `.byteLength`is returned. - * @since v0.1.90 - * @param string A value to calculate the length of. - * @param [encoding='utf8'] If `string` is a string, this is its encoding. - * @return The number of bytes contained within `string`. - */ - byteLength(string: string | NodeJS.ArrayBufferView | ArrayBuffer | SharedArrayBuffer, encoding?: BufferEncoding): number; - /** - * Returns a new `Buffer` which is the result of concatenating all the `Buffer`instances in the `list` together. - * - * If the list has no items, or if the `totalLength` is 0, then a new zero-length`Buffer` is returned. - * - * If `totalLength` is not provided, it is calculated from the `Buffer` instances - * in `list` by adding their lengths. - * - * If `totalLength` is provided, it is coerced to an unsigned integer. If the - * combined length of the `Buffer`s in `list` exceeds `totalLength`, the result is - * truncated to `totalLength`. - * - * ```js - * import { Buffer } from 'buffer'; - * - * // Create a single `Buffer` from a list of three `Buffer` instances. - * - * const buf1 = Buffer.alloc(10); - * const buf2 = Buffer.alloc(14); - * const buf3 = Buffer.alloc(18); - * const totalLength = buf1.length + buf2.length + buf3.length; - * - * console.log(totalLength); - * // Prints: 42 - * - * const bufA = Buffer.concat([buf1, buf2, buf3], totalLength); - * - * console.log(bufA); - * // Prints: - * console.log(bufA.length); - * // Prints: 42 - * ``` - * - * `Buffer.concat()` may also use the internal `Buffer` pool like `Buffer.allocUnsafe()` does. - * @since v0.7.11 - * @param list List of `Buffer` or {@link Uint8Array} instances to concatenate. - * @param totalLength Total length of the `Buffer` instances in `list` when concatenated. - */ - concat(list: ReadonlyArray, totalLength?: number): Buffer; - /** - * Compares `buf1` to `buf2`, typically for the purpose of sorting arrays of`Buffer` instances. This is equivalent to calling `buf1.compare(buf2)`. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf1 = Buffer.from('1234'); - * const buf2 = Buffer.from('0123'); - * const arr = [buf1, buf2]; - * - * console.log(arr.sort(Buffer.compare)); - * // Prints: [ , ] - * // (This result is equal to: [buf2, buf1].) - * ``` - * @since v0.11.13 - * @return Either `-1`, `0`, or `1`, depending on the result of the comparison. See `compare` for details. - */ - compare(buf1: Uint8Array, buf2: Uint8Array): -1 | 0 | 1; - /** - * Allocates a new `Buffer` of `size` bytes. If `fill` is `undefined`, the`Buffer` will be zero-filled. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.alloc(5); - * - * console.log(buf); - * // Prints: - * ``` - * - * If `size` is larger than {@link constants.MAX_LENGTH} or smaller than 0, `ERR_INVALID_ARG_VALUE` is thrown. - * - * If `fill` is specified, the allocated `Buffer` will be initialized by calling `buf.fill(fill)`. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.alloc(5, 'a'); - * - * console.log(buf); - * // Prints: - * ``` - * - * If both `fill` and `encoding` are specified, the allocated `Buffer` will be - * initialized by calling `buf.fill(fill, encoding)`. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.alloc(11, 'aGVsbG8gd29ybGQ=', 'base64'); - * - * console.log(buf); - * // Prints: - * ``` - * - * Calling `Buffer.alloc()` can be measurably slower than the alternative `Buffer.allocUnsafe()` but ensures that the newly created `Buffer` instance - * contents will never contain sensitive data from previous allocations, including - * data that might not have been allocated for `Buffer`s. - * - * A `TypeError` will be thrown if `size` is not a number. - * @since v5.10.0 - * @param size The desired length of the new `Buffer`. - * @param [fill=0] A value to pre-fill the new `Buffer` with. - * @param [encoding='utf8'] If `fill` is a string, this is its encoding. - */ - alloc(size: number, fill?: string | Buffer | number, encoding?: BufferEncoding): Buffer; - /** - * Allocates a new `Buffer` of `size` bytes. If `size` is larger than {@link constants.MAX_LENGTH} or smaller than 0, `ERR_INVALID_ARG_VALUE` is thrown. - * - * The underlying memory for `Buffer` instances created in this way is _not_ - * _initialized_. The contents of the newly created `Buffer` are unknown and _may contain sensitive data_. Use `Buffer.alloc()` instead to initialize`Buffer` instances with zeroes. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.allocUnsafe(10); - * - * console.log(buf); - * // Prints (contents may vary): - * - * buf.fill(0); - * - * console.log(buf); - * // Prints: - * ``` - * - * A `TypeError` will be thrown if `size` is not a number. - * - * The `Buffer` module pre-allocates an internal `Buffer` instance of - * size `Buffer.poolSize` that is used as a pool for the fast allocation of new`Buffer` instances created using `Buffer.allocUnsafe()`,`Buffer.from(array)`, `Buffer.concat()`, and the - * deprecated`new Buffer(size)` constructor only when `size` is less than or equal - * to `Buffer.poolSize >> 1` (floor of `Buffer.poolSize` divided by two). - * - * Use of this pre-allocated internal memory pool is a key difference between - * calling `Buffer.alloc(size, fill)` vs. `Buffer.allocUnsafe(size).fill(fill)`. - * Specifically, `Buffer.alloc(size, fill)` will _never_ use the internal `Buffer`pool, while `Buffer.allocUnsafe(size).fill(fill)`_will_ use the internal`Buffer` pool if `size` is less - * than or equal to half `Buffer.poolSize`. The - * difference is subtle but can be important when an application requires the - * additional performance that `Buffer.allocUnsafe()` provides. - * @since v5.10.0 - * @param size The desired length of the new `Buffer`. - */ - allocUnsafe(size: number): Buffer; - /** - * Allocates a new `Buffer` of `size` bytes. If `size` is larger than {@link constants.MAX_LENGTH} or smaller than 0, `ERR_INVALID_ARG_VALUE` is thrown. A zero-length `Buffer` is created - * if `size` is 0. - * - * The underlying memory for `Buffer` instances created in this way is _not_ - * _initialized_. The contents of the newly created `Buffer` are unknown and _may contain sensitive data_. Use `buf.fill(0)` to initialize - * such `Buffer` instances with zeroes. - * - * When using `Buffer.allocUnsafe()` to allocate new `Buffer` instances, - * allocations under 4 KB are sliced from a single pre-allocated `Buffer`. This - * allows applications to avoid the garbage collection overhead of creating many - * individually allocated `Buffer` instances. This approach improves both - * performance and memory usage by eliminating the need to track and clean up as - * many individual `ArrayBuffer` objects. - * - * However, in the case where a developer may need to retain a small chunk of - * memory from a pool for an indeterminate amount of time, it may be appropriate - * to create an un-pooled `Buffer` instance using `Buffer.allocUnsafeSlow()` and - * then copying out the relevant bits. - * - * ```js - * import { Buffer } from 'buffer'; - * - * // Need to keep around a few small chunks of memory. - * const store = []; - * - * socket.on('readable', () => { - * let data; - * while (null !== (data = readable.read())) { - * // Allocate for retained data. - * const sb = Buffer.allocUnsafeSlow(10); - * - * // Copy the data into the new allocation. - * data.copy(sb, 0, 0, 10); - * - * store.push(sb); - * } - * }); - * ``` - * - * A `TypeError` will be thrown if `size` is not a number. - * @since v5.12.0 - * @param size The desired length of the new `Buffer`. - */ - allocUnsafeSlow(size: number): Buffer; - /** - * This is the size (in bytes) of pre-allocated internal `Buffer` instances used - * for pooling. This value may be modified. - * @since v0.11.3 - */ - poolSize: number; - } - interface Buffer extends Uint8Array { - /** - * Writes `string` to `buf` at `offset` according to the character encoding in`encoding`. The `length` parameter is the number of bytes to write. If `buf` did - * not contain enough space to fit the entire string, only part of `string` will be - * written. However, partially encoded characters will not be written. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.alloc(256); - * - * const len = buf.write('\u00bd + \u00bc = \u00be', 0); - * - * console.log(`${len} bytes: ${buf.toString('utf8', 0, len)}`); - * // Prints: 12 bytes: ½ + ¼ = ¾ - * - * const buffer = Buffer.alloc(10); - * - * const length = buffer.write('abcd', 8); - * - * console.log(`${length} bytes: ${buffer.toString('utf8', 8, 10)}`); - * // Prints: 2 bytes : ab - * ``` - * @since v0.1.90 - * @param string String to write to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write `string`. - * @param [length=buf.length - offset] Maximum number of bytes to write (written bytes will not exceed `buf.length - offset`). - * @param [encoding='utf8'] The character encoding of `string`. - * @return Number of bytes written. - */ - write(string: string, encoding?: BufferEncoding): number; - write(string: string, offset: number, encoding?: BufferEncoding): number; - write(string: string, offset: number, length: number, encoding?: BufferEncoding): number; - /** - * Decodes `buf` to a string according to the specified character encoding in`encoding`. `start` and `end` may be passed to decode only a subset of `buf`. - * - * If `encoding` is `'utf8'` and a byte sequence in the input is not valid UTF-8, - * then each invalid byte is replaced with the replacement character `U+FFFD`. - * - * The maximum length of a string instance (in UTF-16 code units) is available - * as {@link constants.MAX_STRING_LENGTH}. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf1 = Buffer.allocUnsafe(26); - * - * for (let i = 0; i < 26; i++) { - * // 97 is the decimal ASCII value for 'a'. - * buf1[i] = i + 97; - * } - * - * console.log(buf1.toString('utf8')); - * // Prints: abcdefghijklmnopqrstuvwxyz - * console.log(buf1.toString('utf8', 0, 5)); - * // Prints: abcde - * - * const buf2 = Buffer.from('tést'); - * - * console.log(buf2.toString('hex')); - * // Prints: 74c3a97374 - * console.log(buf2.toString('utf8', 0, 3)); - * // Prints: té - * console.log(buf2.toString(undefined, 0, 3)); - * // Prints: té - * ``` - * @since v0.1.90 - * @param [encoding='utf8'] The character encoding to use. - * @param [start=0] The byte offset to start decoding at. - * @param [end=buf.length] The byte offset to stop decoding at (not inclusive). - */ - toString(encoding?: BufferEncoding, start?: number, end?: number): string; - /** - * Returns a JSON representation of `buf`. [`JSON.stringify()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify) implicitly calls - * this function when stringifying a `Buffer` instance. - * - * `Buffer.from()` accepts objects in the format returned from this method. - * In particular, `Buffer.from(buf.toJSON())` works like `Buffer.from(buf)`. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.from([0x1, 0x2, 0x3, 0x4, 0x5]); - * const json = JSON.stringify(buf); - * - * console.log(json); - * // Prints: {"type":"Buffer","data":[1,2,3,4,5]} - * - * const copy = JSON.parse(json, (key, value) => { - * return value && value.type === 'Buffer' ? - * Buffer.from(value) : - * value; - * }); - * - * console.log(copy); - * // Prints: - * ``` - * @since v0.9.2 - */ - toJSON(): { - type: 'Buffer'; - data: number[]; - }; - /** - * Returns `true` if both `buf` and `otherBuffer` have exactly the same bytes,`false` otherwise. Equivalent to `buf.compare(otherBuffer) === 0`. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf1 = Buffer.from('ABC'); - * const buf2 = Buffer.from('414243', 'hex'); - * const buf3 = Buffer.from('ABCD'); - * - * console.log(buf1.equals(buf2)); - * // Prints: true - * console.log(buf1.equals(buf3)); - * // Prints: false - * ``` - * @since v0.11.13 - * @param otherBuffer A `Buffer` or {@link Uint8Array} with which to compare `buf`. - */ - equals(otherBuffer: Uint8Array): boolean; - /** - * Compares `buf` with `target` and returns a number indicating whether `buf`comes before, after, or is the same as `target` in sort order. - * Comparison is based on the actual sequence of bytes in each `Buffer`. - * - * * `0` is returned if `target` is the same as `buf` - * * `1` is returned if `target` should come _before_`buf` when sorted. - * * `-1` is returned if `target` should come _after_`buf` when sorted. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf1 = Buffer.from('ABC'); - * const buf2 = Buffer.from('BCD'); - * const buf3 = Buffer.from('ABCD'); - * - * console.log(buf1.compare(buf1)); - * // Prints: 0 - * console.log(buf1.compare(buf2)); - * // Prints: -1 - * console.log(buf1.compare(buf3)); - * // Prints: -1 - * console.log(buf2.compare(buf1)); - * // Prints: 1 - * console.log(buf2.compare(buf3)); - * // Prints: 1 - * console.log([buf1, buf2, buf3].sort(Buffer.compare)); - * // Prints: [ , , ] - * // (This result is equal to: [buf1, buf3, buf2].) - * ``` - * - * The optional `targetStart`, `targetEnd`, `sourceStart`, and `sourceEnd`arguments can be used to limit the comparison to specific ranges within `target`and `buf` respectively. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf1 = Buffer.from([1, 2, 3, 4, 5, 6, 7, 8, 9]); - * const buf2 = Buffer.from([5, 6, 7, 8, 9, 1, 2, 3, 4]); - * - * console.log(buf1.compare(buf2, 5, 9, 0, 4)); - * // Prints: 0 - * console.log(buf1.compare(buf2, 0, 6, 4)); - * // Prints: -1 - * console.log(buf1.compare(buf2, 5, 6, 5)); - * // Prints: 1 - * ``` - * - * `ERR_OUT_OF_RANGE` is thrown if `targetStart < 0`, `sourceStart < 0`,`targetEnd > target.byteLength`, or `sourceEnd > source.byteLength`. - * @since v0.11.13 - * @param target A `Buffer` or {@link Uint8Array} with which to compare `buf`. - * @param [targetStart=0] The offset within `target` at which to begin comparison. - * @param [targetEnd=target.length] The offset within `target` at which to end comparison (not inclusive). - * @param [sourceStart=0] The offset within `buf` at which to begin comparison. - * @param [sourceEnd=buf.length] The offset within `buf` at which to end comparison (not inclusive). - */ - compare(target: Uint8Array, targetStart?: number, targetEnd?: number, sourceStart?: number, sourceEnd?: number): -1 | 0 | 1; - /** - * Copies data from a region of `buf` to a region in `target`, even if the `target`memory region overlaps with `buf`. - * - * [`TypedArray.prototype.set()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set) performs the same operation, and is available - * for all TypedArrays, including Node.js `Buffer`s, although it takes - * different function arguments. - * - * ```js - * import { Buffer } from 'buffer'; - * - * // Create two `Buffer` instances. - * const buf1 = Buffer.allocUnsafe(26); - * const buf2 = Buffer.allocUnsafe(26).fill('!'); - * - * for (let i = 0; i < 26; i++) { - * // 97 is the decimal ASCII value for 'a'. - * buf1[i] = i + 97; - * } - * - * // Copy `buf1` bytes 16 through 19 into `buf2` starting at byte 8 of `buf2`. - * buf1.copy(buf2, 8, 16, 20); - * // This is equivalent to: - * // buf2.set(buf1.subarray(16, 20), 8); - * - * console.log(buf2.toString('ascii', 0, 25)); - * // Prints: !!!!!!!!qrst!!!!!!!!!!!!! - * ``` - * - * ```js - * import { Buffer } from 'buffer'; - * - * // Create a `Buffer` and copy data from one region to an overlapping region - * // within the same `Buffer`. - * - * const buf = Buffer.allocUnsafe(26); - * - * for (let i = 0; i < 26; i++) { - * // 97 is the decimal ASCII value for 'a'. - * buf[i] = i + 97; - * } - * - * buf.copy(buf, 0, 4, 10); - * - * console.log(buf.toString()); - * // Prints: efghijghijklmnopqrstuvwxyz - * ``` - * @since v0.1.90 - * @param target A `Buffer` or {@link Uint8Array} to copy into. - * @param [targetStart=0] The offset within `target` at which to begin writing. - * @param [sourceStart=0] The offset within `buf` from which to begin copying. - * @param [sourceEnd=buf.length] The offset within `buf` at which to stop copying (not inclusive). - * @return The number of bytes copied. - */ - copy(target: Uint8Array, targetStart?: number, sourceStart?: number, sourceEnd?: number): number; - /** - * Returns a new `Buffer` that references the same memory as the original, but - * offset and cropped by the `start` and `end` indices. - * - * This method is not compatible with the `Uint8Array.prototype.slice()`, - * which is a superclass of `Buffer`. To copy the slice, use`Uint8Array.prototype.slice()`. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.from('buffer'); - * - * const copiedBuf = Uint8Array.prototype.slice.call(buf); - * copiedBuf[0]++; - * console.log(copiedBuf.toString()); - * // Prints: cuffer - * - * console.log(buf.toString()); - * // Prints: buffer - * - * // With buf.slice(), the original buffer is modified. - * const notReallyCopiedBuf = buf.slice(); - * notReallyCopiedBuf[0]++; - * console.log(notReallyCopiedBuf.toString()); - * // Prints: cuffer - * console.log(buf.toString()); - * // Also prints: cuffer (!) - * ``` - * @since v0.3.0 - * @deprecated Use `subarray` instead. - * @param [start=0] Where the new `Buffer` will start. - * @param [end=buf.length] Where the new `Buffer` will end (not inclusive). - */ - slice(start?: number, end?: number): Buffer; - /** - * Returns a new `Buffer` that references the same memory as the original, but - * offset and cropped by the `start` and `end` indices. - * - * Specifying `end` greater than `buf.length` will return the same result as - * that of `end` equal to `buf.length`. - * - * This method is inherited from [`TypedArray.prototype.subarray()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/subarray). - * - * Modifying the new `Buffer` slice will modify the memory in the original `Buffer`because the allocated memory of the two objects overlap. - * - * ```js - * import { Buffer } from 'buffer'; - * - * // Create a `Buffer` with the ASCII alphabet, take a slice, and modify one byte - * // from the original `Buffer`. - * - * const buf1 = Buffer.allocUnsafe(26); - * - * for (let i = 0; i < 26; i++) { - * // 97 is the decimal ASCII value for 'a'. - * buf1[i] = i + 97; - * } - * - * const buf2 = buf1.subarray(0, 3); - * - * console.log(buf2.toString('ascii', 0, buf2.length)); - * // Prints: abc - * - * buf1[0] = 33; - * - * console.log(buf2.toString('ascii', 0, buf2.length)); - * // Prints: !bc - * ``` - * - * Specifying negative indexes causes the slice to be generated relative to the - * end of `buf` rather than the beginning. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.from('buffer'); - * - * console.log(buf.subarray(-6, -1).toString()); - * // Prints: buffe - * // (Equivalent to buf.subarray(0, 5).) - * - * console.log(buf.subarray(-6, -2).toString()); - * // Prints: buff - * // (Equivalent to buf.subarray(0, 4).) - * - * console.log(buf.subarray(-5, -2).toString()); - * // Prints: uff - * // (Equivalent to buf.subarray(1, 4).) - * ``` - * @since v3.0.0 - * @param [start=0] Where the new `Buffer` will start. - * @param [end=buf.length] Where the new `Buffer` will end (not inclusive). - */ - subarray(start?: number, end?: number): Buffer; - /** - * Writes `value` to `buf` at the specified `offset` as big-endian. - * - * `value` is interpreted and written as a two's complement signed integer. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.allocUnsafe(8); - * - * buf.writeBigInt64BE(0x0102030405060708n, 0); - * - * console.log(buf); - * // Prints: - * ``` - * @since v12.0.0, v10.20.0 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy: `0 <= offset <= buf.length - 8`. - * @return `offset` plus the number of bytes written. - */ - writeBigInt64BE(value: bigint, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as little-endian. - * - * `value` is interpreted and written as a two's complement signed integer. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.allocUnsafe(8); - * - * buf.writeBigInt64LE(0x0102030405060708n, 0); - * - * console.log(buf); - * // Prints: - * ``` - * @since v12.0.0, v10.20.0 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy: `0 <= offset <= buf.length - 8`. - * @return `offset` plus the number of bytes written. - */ - writeBigInt64LE(value: bigint, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as big-endian. - * - * This function is also available under the `writeBigUint64BE` alias. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.allocUnsafe(8); - * - * buf.writeBigUInt64BE(0xdecafafecacefaden, 0); - * - * console.log(buf); - * // Prints: - * ``` - * @since v12.0.0, v10.20.0 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy: `0 <= offset <= buf.length - 8`. - * @return `offset` plus the number of bytes written. - */ - writeBigUInt64BE(value: bigint, offset?: number): number; - /** - * @alias Buffer.writeBigUInt64BE - * @since v14.10.0, v12.19.0 - */ - writeBigUint64BE(value: bigint, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as little-endian - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.allocUnsafe(8); - * - * buf.writeBigUInt64LE(0xdecafafecacefaden, 0); - * - * console.log(buf); - * // Prints: - * ``` - * - * This function is also available under the `writeBigUint64LE` alias. - * @since v12.0.0, v10.20.0 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy: `0 <= offset <= buf.length - 8`. - * @return `offset` plus the number of bytes written. - */ - writeBigUInt64LE(value: bigint, offset?: number): number; - /** - * @alias Buffer.writeBigUInt64LE - * @since v14.10.0, v12.19.0 - */ - writeBigUint64LE(value: bigint, offset?: number): number; - /** - * Writes `byteLength` bytes of `value` to `buf` at the specified `offset`as little-endian. Supports up to 48 bits of accuracy. Behavior is undefined - * when `value` is anything other than an unsigned integer. - * - * This function is also available under the `writeUintLE` alias. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.allocUnsafe(6); - * - * buf.writeUIntLE(0x1234567890ab, 0, 6); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.5.5 - * @param value Number to be written to `buf`. - * @param offset Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - byteLength`. - * @param byteLength Number of bytes to write. Must satisfy `0 < byteLength <= 6`. - * @return `offset` plus the number of bytes written. - */ - writeUIntLE(value: number, offset: number, byteLength: number): number; - /** - * @alias Buffer.writeUIntLE - * @since v14.9.0, v12.19.0 - */ - writeUintLE(value: number, offset: number, byteLength: number): number; - /** - * Writes `byteLength` bytes of `value` to `buf` at the specified `offset`as big-endian. Supports up to 48 bits of accuracy. Behavior is undefined - * when `value` is anything other than an unsigned integer. - * - * This function is also available under the `writeUintBE` alias. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.allocUnsafe(6); - * - * buf.writeUIntBE(0x1234567890ab, 0, 6); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.5.5 - * @param value Number to be written to `buf`. - * @param offset Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - byteLength`. - * @param byteLength Number of bytes to write. Must satisfy `0 < byteLength <= 6`. - * @return `offset` plus the number of bytes written. - */ - writeUIntBE(value: number, offset: number, byteLength: number): number; - /** - * @alias Buffer.writeUIntBE - * @since v14.9.0, v12.19.0 - */ - writeUintBE(value: number, offset: number, byteLength: number): number; - /** - * Writes `byteLength` bytes of `value` to `buf` at the specified `offset`as little-endian. Supports up to 48 bits of accuracy. Behavior is undefined - * when `value` is anything other than a signed integer. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.allocUnsafe(6); - * - * buf.writeIntLE(0x1234567890ab, 0, 6); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.11.15 - * @param value Number to be written to `buf`. - * @param offset Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - byteLength`. - * @param byteLength Number of bytes to write. Must satisfy `0 < byteLength <= 6`. - * @return `offset` plus the number of bytes written. - */ - writeIntLE(value: number, offset: number, byteLength: number): number; - /** - * Writes `byteLength` bytes of `value` to `buf` at the specified `offset`as big-endian. Supports up to 48 bits of accuracy. Behavior is undefined when`value` is anything other than a - * signed integer. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.allocUnsafe(6); - * - * buf.writeIntBE(0x1234567890ab, 0, 6); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.11.15 - * @param value Number to be written to `buf`. - * @param offset Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - byteLength`. - * @param byteLength Number of bytes to write. Must satisfy `0 < byteLength <= 6`. - * @return `offset` plus the number of bytes written. - */ - writeIntBE(value: number, offset: number, byteLength: number): number; - /** - * Reads an unsigned, big-endian 64-bit integer from `buf` at the specified`offset`. - * - * This function is also available under the `readBigUint64BE` alias. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.from([0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff]); - * - * console.log(buf.readBigUInt64BE(0)); - * // Prints: 4294967295n - * ``` - * @since v12.0.0, v10.20.0 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy: `0 <= offset <= buf.length - 8`. - */ - readBigUInt64BE(offset?: number): bigint; - /** - * @alias Buffer.readBigUInt64BE - * @since v14.10.0, v12.19.0 - */ - readBigUint64BE(offset?: number): bigint; - /** - * Reads an unsigned, little-endian 64-bit integer from `buf` at the specified`offset`. - * - * This function is also available under the `readBigUint64LE` alias. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.from([0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff]); - * - * console.log(buf.readBigUInt64LE(0)); - * // Prints: 18446744069414584320n - * ``` - * @since v12.0.0, v10.20.0 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy: `0 <= offset <= buf.length - 8`. - */ - readBigUInt64LE(offset?: number): bigint; - /** - * @alias Buffer.readBigUInt64LE - * @since v14.10.0, v12.19.0 - */ - readBigUint64LE(offset?: number): bigint; - /** - * Reads a signed, big-endian 64-bit integer from `buf` at the specified `offset`. - * - * Integers read from a `Buffer` are interpreted as two's complement signed - * values. - * @since v12.0.0, v10.20.0 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy: `0 <= offset <= buf.length - 8`. - */ - readBigInt64BE(offset?: number): bigint; - /** - * Reads a signed, little-endian 64-bit integer from `buf` at the specified`offset`. - * - * Integers read from a `Buffer` are interpreted as two's complement signed - * values. - * @since v12.0.0, v10.20.0 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy: `0 <= offset <= buf.length - 8`. - */ - readBigInt64LE(offset?: number): bigint; - /** - * Reads `byteLength` number of bytes from `buf` at the specified `offset`and interprets the result as an unsigned, little-endian integer supporting - * up to 48 bits of accuracy. - * - * This function is also available under the `readUintLE` alias. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.from([0x12, 0x34, 0x56, 0x78, 0x90, 0xab]); - * - * console.log(buf.readUIntLE(0, 6).toString(16)); - * // Prints: ab9078563412 - * ``` - * @since v0.11.15 - * @param offset Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - byteLength`. - * @param byteLength Number of bytes to read. Must satisfy `0 < byteLength <= 6`. - */ - readUIntLE(offset: number, byteLength: number): number; - /** - * @alias Buffer.readUIntLE - * @since v14.9.0, v12.19.0 - */ - readUintLE(offset: number, byteLength: number): number; - /** - * Reads `byteLength` number of bytes from `buf` at the specified `offset`and interprets the result as an unsigned big-endian integer supporting - * up to 48 bits of accuracy. - * - * This function is also available under the `readUintBE` alias. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.from([0x12, 0x34, 0x56, 0x78, 0x90, 0xab]); - * - * console.log(buf.readUIntBE(0, 6).toString(16)); - * // Prints: 1234567890ab - * console.log(buf.readUIntBE(1, 6).toString(16)); - * // Throws ERR_OUT_OF_RANGE. - * ``` - * @since v0.11.15 - * @param offset Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - byteLength`. - * @param byteLength Number of bytes to read. Must satisfy `0 < byteLength <= 6`. - */ - readUIntBE(offset: number, byteLength: number): number; - /** - * @alias Buffer.readUIntBE - * @since v14.9.0, v12.19.0 - */ - readUintBE(offset: number, byteLength: number): number; - /** - * Reads `byteLength` number of bytes from `buf` at the specified `offset`and interprets the result as a little-endian, two's complement signed value - * supporting up to 48 bits of accuracy. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.from([0x12, 0x34, 0x56, 0x78, 0x90, 0xab]); - * - * console.log(buf.readIntLE(0, 6).toString(16)); - * // Prints: -546f87a9cbee - * ``` - * @since v0.11.15 - * @param offset Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - byteLength`. - * @param byteLength Number of bytes to read. Must satisfy `0 < byteLength <= 6`. - */ - readIntLE(offset: number, byteLength: number): number; - /** - * Reads `byteLength` number of bytes from `buf` at the specified `offset`and interprets the result as a big-endian, two's complement signed value - * supporting up to 48 bits of accuracy. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.from([0x12, 0x34, 0x56, 0x78, 0x90, 0xab]); - * - * console.log(buf.readIntBE(0, 6).toString(16)); - * // Prints: 1234567890ab - * console.log(buf.readIntBE(1, 6).toString(16)); - * // Throws ERR_OUT_OF_RANGE. - * console.log(buf.readIntBE(1, 0).toString(16)); - * // Throws ERR_OUT_OF_RANGE. - * ``` - * @since v0.11.15 - * @param offset Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - byteLength`. - * @param byteLength Number of bytes to read. Must satisfy `0 < byteLength <= 6`. - */ - readIntBE(offset: number, byteLength: number): number; - /** - * Reads an unsigned 8-bit integer from `buf` at the specified `offset`. - * - * This function is also available under the `readUint8` alias. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.from([1, -2]); - * - * console.log(buf.readUInt8(0)); - * // Prints: 1 - * console.log(buf.readUInt8(1)); - * // Prints: 254 - * console.log(buf.readUInt8(2)); - * // Throws ERR_OUT_OF_RANGE. - * ``` - * @since v0.5.0 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 1`. - */ - readUInt8(offset?: number): number; - /** - * @alias Buffer.readUInt8 - * @since v14.9.0, v12.19.0 - */ - readUint8(offset?: number): number; - /** - * Reads an unsigned, little-endian 16-bit integer from `buf` at the specified`offset`. - * - * This function is also available under the `readUint16LE` alias. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.from([0x12, 0x34, 0x56]); - * - * console.log(buf.readUInt16LE(0).toString(16)); - * // Prints: 3412 - * console.log(buf.readUInt16LE(1).toString(16)); - * // Prints: 5634 - * console.log(buf.readUInt16LE(2).toString(16)); - * // Throws ERR_OUT_OF_RANGE. - * ``` - * @since v0.5.5 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 2`. - */ - readUInt16LE(offset?: number): number; - /** - * @alias Buffer.readUInt16LE - * @since v14.9.0, v12.19.0 - */ - readUint16LE(offset?: number): number; - /** - * Reads an unsigned, big-endian 16-bit integer from `buf` at the specified`offset`. - * - * This function is also available under the `readUint16BE` alias. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.from([0x12, 0x34, 0x56]); - * - * console.log(buf.readUInt16BE(0).toString(16)); - * // Prints: 1234 - * console.log(buf.readUInt16BE(1).toString(16)); - * // Prints: 3456 - * ``` - * @since v0.5.5 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 2`. - */ - readUInt16BE(offset?: number): number; - /** - * @alias Buffer.readUInt16BE - * @since v14.9.0, v12.19.0 - */ - readUint16BE(offset?: number): number; - /** - * Reads an unsigned, little-endian 32-bit integer from `buf` at the specified`offset`. - * - * This function is also available under the `readUint32LE` alias. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.from([0x12, 0x34, 0x56, 0x78]); - * - * console.log(buf.readUInt32LE(0).toString(16)); - * // Prints: 78563412 - * console.log(buf.readUInt32LE(1).toString(16)); - * // Throws ERR_OUT_OF_RANGE. - * ``` - * @since v0.5.5 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`. - */ - readUInt32LE(offset?: number): number; - /** - * @alias Buffer.readUInt32LE - * @since v14.9.0, v12.19.0 - */ - readUint32LE(offset?: number): number; - /** - * Reads an unsigned, big-endian 32-bit integer from `buf` at the specified`offset`. - * - * This function is also available under the `readUint32BE` alias. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.from([0x12, 0x34, 0x56, 0x78]); - * - * console.log(buf.readUInt32BE(0).toString(16)); - * // Prints: 12345678 - * ``` - * @since v0.5.5 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`. - */ - readUInt32BE(offset?: number): number; - /** - * @alias Buffer.readUInt32BE - * @since v14.9.0, v12.19.0 - */ - readUint32BE(offset?: number): number; - /** - * Reads a signed 8-bit integer from `buf` at the specified `offset`. - * - * Integers read from a `Buffer` are interpreted as two's complement signed values. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.from([-1, 5]); - * - * console.log(buf.readInt8(0)); - * // Prints: -1 - * console.log(buf.readInt8(1)); - * // Prints: 5 - * console.log(buf.readInt8(2)); - * // Throws ERR_OUT_OF_RANGE. - * ``` - * @since v0.5.0 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 1`. - */ - readInt8(offset?: number): number; - /** - * Reads a signed, little-endian 16-bit integer from `buf` at the specified`offset`. - * - * Integers read from a `Buffer` are interpreted as two's complement signed values. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.from([0, 5]); - * - * console.log(buf.readInt16LE(0)); - * // Prints: 1280 - * console.log(buf.readInt16LE(1)); - * // Throws ERR_OUT_OF_RANGE. - * ``` - * @since v0.5.5 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 2`. - */ - readInt16LE(offset?: number): number; - /** - * Reads a signed, big-endian 16-bit integer from `buf` at the specified `offset`. - * - * Integers read from a `Buffer` are interpreted as two's complement signed values. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.from([0, 5]); - * - * console.log(buf.readInt16BE(0)); - * // Prints: 5 - * ``` - * @since v0.5.5 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 2`. - */ - readInt16BE(offset?: number): number; - /** - * Reads a signed, little-endian 32-bit integer from `buf` at the specified`offset`. - * - * Integers read from a `Buffer` are interpreted as two's complement signed values. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.from([0, 0, 0, 5]); - * - * console.log(buf.readInt32LE(0)); - * // Prints: 83886080 - * console.log(buf.readInt32LE(1)); - * // Throws ERR_OUT_OF_RANGE. - * ``` - * @since v0.5.5 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`. - */ - readInt32LE(offset?: number): number; - /** - * Reads a signed, big-endian 32-bit integer from `buf` at the specified `offset`. - * - * Integers read from a `Buffer` are interpreted as two's complement signed values. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.from([0, 0, 0, 5]); - * - * console.log(buf.readInt32BE(0)); - * // Prints: 5 - * ``` - * @since v0.5.5 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`. - */ - readInt32BE(offset?: number): number; - /** - * Reads a 32-bit, little-endian float from `buf` at the specified `offset`. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.from([1, 2, 3, 4]); - * - * console.log(buf.readFloatLE(0)); - * // Prints: 1.539989614439558e-36 - * console.log(buf.readFloatLE(1)); - * // Throws ERR_OUT_OF_RANGE. - * ``` - * @since v0.11.15 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`. - */ - readFloatLE(offset?: number): number; - /** - * Reads a 32-bit, big-endian float from `buf` at the specified `offset`. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.from([1, 2, 3, 4]); - * - * console.log(buf.readFloatBE(0)); - * // Prints: 2.387939260590663e-38 - * ``` - * @since v0.11.15 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`. - */ - readFloatBE(offset?: number): number; - /** - * Reads a 64-bit, little-endian double from `buf` at the specified `offset`. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.from([1, 2, 3, 4, 5, 6, 7, 8]); - * - * console.log(buf.readDoubleLE(0)); - * // Prints: 5.447603722011605e-270 - * console.log(buf.readDoubleLE(1)); - * // Throws ERR_OUT_OF_RANGE. - * ``` - * @since v0.11.15 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 8`. - */ - readDoubleLE(offset?: number): number; - /** - * Reads a 64-bit, big-endian double from `buf` at the specified `offset`. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.from([1, 2, 3, 4, 5, 6, 7, 8]); - * - * console.log(buf.readDoubleBE(0)); - * // Prints: 8.20788039913184e-304 - * ``` - * @since v0.11.15 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 8`. - */ - readDoubleBE(offset?: number): number; - reverse(): this; - /** - * Interprets `buf` as an array of unsigned 16-bit integers and swaps the - * byte order _in-place_. Throws `ERR_INVALID_BUFFER_SIZE` if `buf.length` is not a multiple of 2. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf1 = Buffer.from([0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8]); - * - * console.log(buf1); - * // Prints: - * - * buf1.swap16(); - * - * console.log(buf1); - * // Prints: - * - * const buf2 = Buffer.from([0x1, 0x2, 0x3]); - * - * buf2.swap16(); - * // Throws ERR_INVALID_BUFFER_SIZE. - * ``` - * - * One convenient use of `buf.swap16()` is to perform a fast in-place conversion - * between UTF-16 little-endian and UTF-16 big-endian: - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.from('This is little-endian UTF-16', 'utf16le'); - * buf.swap16(); // Convert to big-endian UTF-16 text. - * ``` - * @since v5.10.0 - * @return A reference to `buf`. - */ - swap16(): Buffer; - /** - * Interprets `buf` as an array of unsigned 32-bit integers and swaps the - * byte order _in-place_. Throws `ERR_INVALID_BUFFER_SIZE` if `buf.length` is not a multiple of 4. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf1 = Buffer.from([0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8]); - * - * console.log(buf1); - * // Prints: - * - * buf1.swap32(); - * - * console.log(buf1); - * // Prints: - * - * const buf2 = Buffer.from([0x1, 0x2, 0x3]); - * - * buf2.swap32(); - * // Throws ERR_INVALID_BUFFER_SIZE. - * ``` - * @since v5.10.0 - * @return A reference to `buf`. - */ - swap32(): Buffer; - /** - * Interprets `buf` as an array of 64-bit numbers and swaps byte order _in-place_. - * Throws `ERR_INVALID_BUFFER_SIZE` if `buf.length` is not a multiple of 8. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf1 = Buffer.from([0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8]); - * - * console.log(buf1); - * // Prints: - * - * buf1.swap64(); - * - * console.log(buf1); - * // Prints: - * - * const buf2 = Buffer.from([0x1, 0x2, 0x3]); - * - * buf2.swap64(); - * // Throws ERR_INVALID_BUFFER_SIZE. - * ``` - * @since v6.3.0 - * @return A reference to `buf`. - */ - swap64(): Buffer; - /** - * Writes `value` to `buf` at the specified `offset`. `value` must be a - * valid unsigned 8-bit integer. Behavior is undefined when `value` is anything - * other than an unsigned 8-bit integer. - * - * This function is also available under the `writeUint8` alias. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.allocUnsafe(4); - * - * buf.writeUInt8(0x3, 0); - * buf.writeUInt8(0x4, 1); - * buf.writeUInt8(0x23, 2); - * buf.writeUInt8(0x42, 3); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.5.0 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 1`. - * @return `offset` plus the number of bytes written. - */ - writeUInt8(value: number, offset?: number): number; - /** - * @alias Buffer.writeUInt8 - * @since v14.9.0, v12.19.0 - */ - writeUint8(value: number, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as little-endian. The `value`must be a valid unsigned 16-bit integer. Behavior is undefined when `value` is - * anything other than an unsigned 16-bit integer. - * - * This function is also available under the `writeUint16LE` alias. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.allocUnsafe(4); - * - * buf.writeUInt16LE(0xdead, 0); - * buf.writeUInt16LE(0xbeef, 2); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.5.5 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 2`. - * @return `offset` plus the number of bytes written. - */ - writeUInt16LE(value: number, offset?: number): number; - /** - * @alias Buffer.writeUInt16LE - * @since v14.9.0, v12.19.0 - */ - writeUint16LE(value: number, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as big-endian. The `value`must be a valid unsigned 16-bit integer. Behavior is undefined when `value`is anything other than an - * unsigned 16-bit integer. - * - * This function is also available under the `writeUint16BE` alias. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.allocUnsafe(4); - * - * buf.writeUInt16BE(0xdead, 0); - * buf.writeUInt16BE(0xbeef, 2); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.5.5 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 2`. - * @return `offset` plus the number of bytes written. - */ - writeUInt16BE(value: number, offset?: number): number; - /** - * @alias Buffer.writeUInt16BE - * @since v14.9.0, v12.19.0 - */ - writeUint16BE(value: number, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as little-endian. The `value`must be a valid unsigned 32-bit integer. Behavior is undefined when `value` is - * anything other than an unsigned 32-bit integer. - * - * This function is also available under the `writeUint32LE` alias. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.allocUnsafe(4); - * - * buf.writeUInt32LE(0xfeedface, 0); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.5.5 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`. - * @return `offset` plus the number of bytes written. - */ - writeUInt32LE(value: number, offset?: number): number; - /** - * @alias Buffer.writeUInt32LE - * @since v14.9.0, v12.19.0 - */ - writeUint32LE(value: number, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as big-endian. The `value`must be a valid unsigned 32-bit integer. Behavior is undefined when `value`is anything other than an - * unsigned 32-bit integer. - * - * This function is also available under the `writeUint32BE` alias. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.allocUnsafe(4); - * - * buf.writeUInt32BE(0xfeedface, 0); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.5.5 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`. - * @return `offset` plus the number of bytes written. - */ - writeUInt32BE(value: number, offset?: number): number; - /** - * @alias Buffer.writeUInt32BE - * @since v14.9.0, v12.19.0 - */ - writeUint32BE(value: number, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset`. `value` must be a valid - * signed 8-bit integer. Behavior is undefined when `value` is anything other than - * a signed 8-bit integer. - * - * `value` is interpreted and written as a two's complement signed integer. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.allocUnsafe(2); - * - * buf.writeInt8(2, 0); - * buf.writeInt8(-2, 1); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.5.0 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 1`. - * @return `offset` plus the number of bytes written. - */ - writeInt8(value: number, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as little-endian. The `value`must be a valid signed 16-bit integer. Behavior is undefined when `value` is - * anything other than a signed 16-bit integer. - * - * The `value` is interpreted and written as a two's complement signed integer. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.allocUnsafe(2); - * - * buf.writeInt16LE(0x0304, 0); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.5.5 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 2`. - * @return `offset` plus the number of bytes written. - */ - writeInt16LE(value: number, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as big-endian. The `value`must be a valid signed 16-bit integer. Behavior is undefined when `value` is - * anything other than a signed 16-bit integer. - * - * The `value` is interpreted and written as a two's complement signed integer. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.allocUnsafe(2); - * - * buf.writeInt16BE(0x0102, 0); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.5.5 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 2`. - * @return `offset` plus the number of bytes written. - */ - writeInt16BE(value: number, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as little-endian. The `value`must be a valid signed 32-bit integer. Behavior is undefined when `value` is - * anything other than a signed 32-bit integer. - * - * The `value` is interpreted and written as a two's complement signed integer. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.allocUnsafe(4); - * - * buf.writeInt32LE(0x05060708, 0); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.5.5 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`. - * @return `offset` plus the number of bytes written. - */ - writeInt32LE(value: number, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as big-endian. The `value`must be a valid signed 32-bit integer. Behavior is undefined when `value` is - * anything other than a signed 32-bit integer. - * - * The `value` is interpreted and written as a two's complement signed integer. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.allocUnsafe(4); - * - * buf.writeInt32BE(0x01020304, 0); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.5.5 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`. - * @return `offset` plus the number of bytes written. - */ - writeInt32BE(value: number, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as little-endian. Behavior is - * undefined when `value` is anything other than a JavaScript number. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.allocUnsafe(4); - * - * buf.writeFloatLE(0xcafebabe, 0); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.11.15 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`. - * @return `offset` plus the number of bytes written. - */ - writeFloatLE(value: number, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as big-endian. Behavior is - * undefined when `value` is anything other than a JavaScript number. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.allocUnsafe(4); - * - * buf.writeFloatBE(0xcafebabe, 0); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.11.15 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`. - * @return `offset` plus the number of bytes written. - */ - writeFloatBE(value: number, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as little-endian. The `value`must be a JavaScript number. Behavior is undefined when `value` is anything - * other than a JavaScript number. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.allocUnsafe(8); - * - * buf.writeDoubleLE(123.456, 0); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.11.15 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 8`. - * @return `offset` plus the number of bytes written. - */ - writeDoubleLE(value: number, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as big-endian. The `value`must be a JavaScript number. Behavior is undefined when `value` is anything - * other than a JavaScript number. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.allocUnsafe(8); - * - * buf.writeDoubleBE(123.456, 0); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.11.15 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 8`. - * @return `offset` plus the number of bytes written. - */ - writeDoubleBE(value: number, offset?: number): number; - /** - * Fills `buf` with the specified `value`. If the `offset` and `end` are not given, - * the entire `buf` will be filled: - * - * ```js - * import { Buffer } from 'buffer'; - * - * // Fill a `Buffer` with the ASCII character 'h'. - * - * const b = Buffer.allocUnsafe(50).fill('h'); - * - * console.log(b.toString()); - * // Prints: hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh - * ``` - * - * `value` is coerced to a `uint32` value if it is not a string, `Buffer`, or - * integer. If the resulting integer is greater than `255` (decimal), `buf` will be - * filled with `value & 255`. - * - * If the final write of a `fill()` operation falls on a multi-byte character, - * then only the bytes of that character that fit into `buf` are written: - * - * ```js - * import { Buffer } from 'buffer'; - * - * // Fill a `Buffer` with character that takes up two bytes in UTF-8. - * - * console.log(Buffer.allocUnsafe(5).fill('\u0222')); - * // Prints: - * ``` - * - * If `value` contains invalid characters, it is truncated; if no valid - * fill data remains, an exception is thrown: - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.allocUnsafe(5); - * - * console.log(buf.fill('a')); - * // Prints: - * console.log(buf.fill('aazz', 'hex')); - * // Prints: - * console.log(buf.fill('zz', 'hex')); - * // Throws an exception. - * ``` - * @since v0.5.0 - * @param value The value with which to fill `buf`. - * @param [offset=0] Number of bytes to skip before starting to fill `buf`. - * @param [end=buf.length] Where to stop filling `buf` (not inclusive). - * @param [encoding='utf8'] The encoding for `value` if `value` is a string. - * @return A reference to `buf`. - */ - fill(value: string | Uint8Array | number, offset?: number, end?: number, encoding?: BufferEncoding): this; - /** - * If `value` is: - * - * * a string, `value` is interpreted according to the character encoding in`encoding`. - * * a `Buffer` or [`Uint8Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array), `value` will be used in its entirety. - * To compare a partial `Buffer`, use `buf.subarray`. - * * a number, `value` will be interpreted as an unsigned 8-bit integer - * value between `0` and `255`. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.from('this is a buffer'); - * - * console.log(buf.indexOf('this')); - * // Prints: 0 - * console.log(buf.indexOf('is')); - * // Prints: 2 - * console.log(buf.indexOf(Buffer.from('a buffer'))); - * // Prints: 8 - * console.log(buf.indexOf(97)); - * // Prints: 8 (97 is the decimal ASCII value for 'a') - * console.log(buf.indexOf(Buffer.from('a buffer example'))); - * // Prints: -1 - * console.log(buf.indexOf(Buffer.from('a buffer example').slice(0, 8))); - * // Prints: 8 - * - * const utf16Buffer = Buffer.from('\u039a\u0391\u03a3\u03a3\u0395', 'utf16le'); - * - * console.log(utf16Buffer.indexOf('\u03a3', 0, 'utf16le')); - * // Prints: 4 - * console.log(utf16Buffer.indexOf('\u03a3', -4, 'utf16le')); - * // Prints: 6 - * ``` - * - * If `value` is not a string, number, or `Buffer`, this method will throw a`TypeError`. If `value` is a number, it will be coerced to a valid byte value, - * an integer between 0 and 255. - * - * If `byteOffset` is not a number, it will be coerced to a number. If the result - * of coercion is `NaN` or `0`, then the entire buffer will be searched. This - * behavior matches [`String.prototype.indexOf()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/indexOf). - * - * ```js - * import { Buffer } from 'buffer'; - * - * const b = Buffer.from('abcdef'); - * - * // Passing a value that's a number, but not a valid byte. - * // Prints: 2, equivalent to searching for 99 or 'c'. - * console.log(b.indexOf(99.9)); - * console.log(b.indexOf(256 + 99)); - * - * // Passing a byteOffset that coerces to NaN or 0. - * // Prints: 1, searching the whole buffer. - * console.log(b.indexOf('b', undefined)); - * console.log(b.indexOf('b', {})); - * console.log(b.indexOf('b', null)); - * console.log(b.indexOf('b', [])); - * ``` - * - * If `value` is an empty string or empty `Buffer` and `byteOffset` is less - * than `buf.length`, `byteOffset` will be returned. If `value` is empty and`byteOffset` is at least `buf.length`, `buf.length` will be returned. - * @since v1.5.0 - * @param value What to search for. - * @param [byteOffset=0] Where to begin searching in `buf`. If negative, then offset is calculated from the end of `buf`. - * @param [encoding='utf8'] If `value` is a string, this is the encoding used to determine the binary representation of the string that will be searched for in `buf`. - * @return The index of the first occurrence of `value` in `buf`, or `-1` if `buf` does not contain `value`. - */ - indexOf(value: string | number | Uint8Array, byteOffset?: number, encoding?: BufferEncoding): number; - /** - * Identical to `buf.indexOf()`, except the last occurrence of `value` is found - * rather than the first occurrence. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.from('this buffer is a buffer'); - * - * console.log(buf.lastIndexOf('this')); - * // Prints: 0 - * console.log(buf.lastIndexOf('buffer')); - * // Prints: 17 - * console.log(buf.lastIndexOf(Buffer.from('buffer'))); - * // Prints: 17 - * console.log(buf.lastIndexOf(97)); - * // Prints: 15 (97 is the decimal ASCII value for 'a') - * console.log(buf.lastIndexOf(Buffer.from('yolo'))); - * // Prints: -1 - * console.log(buf.lastIndexOf('buffer', 5)); - * // Prints: 5 - * console.log(buf.lastIndexOf('buffer', 4)); - * // Prints: -1 - * - * const utf16Buffer = Buffer.from('\u039a\u0391\u03a3\u03a3\u0395', 'utf16le'); - * - * console.log(utf16Buffer.lastIndexOf('\u03a3', undefined, 'utf16le')); - * // Prints: 6 - * console.log(utf16Buffer.lastIndexOf('\u03a3', -5, 'utf16le')); - * // Prints: 4 - * ``` - * - * If `value` is not a string, number, or `Buffer`, this method will throw a`TypeError`. If `value` is a number, it will be coerced to a valid byte value, - * an integer between 0 and 255. - * - * If `byteOffset` is not a number, it will be coerced to a number. Any arguments - * that coerce to `NaN`, like `{}` or `undefined`, will search the whole buffer. - * This behavior matches [`String.prototype.lastIndexOf()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/lastIndexOf). - * - * ```js - * import { Buffer } from 'buffer'; - * - * const b = Buffer.from('abcdef'); - * - * // Passing a value that's a number, but not a valid byte. - * // Prints: 2, equivalent to searching for 99 or 'c'. - * console.log(b.lastIndexOf(99.9)); - * console.log(b.lastIndexOf(256 + 99)); - * - * // Passing a byteOffset that coerces to NaN. - * // Prints: 1, searching the whole buffer. - * console.log(b.lastIndexOf('b', undefined)); - * console.log(b.lastIndexOf('b', {})); - * - * // Passing a byteOffset that coerces to 0. - * // Prints: -1, equivalent to passing 0. - * console.log(b.lastIndexOf('b', null)); - * console.log(b.lastIndexOf('b', [])); - * ``` - * - * If `value` is an empty string or empty `Buffer`, `byteOffset` will be returned. - * @since v6.0.0 - * @param value What to search for. - * @param [byteOffset=buf.length - 1] Where to begin searching in `buf`. If negative, then offset is calculated from the end of `buf`. - * @param [encoding='utf8'] If `value` is a string, this is the encoding used to determine the binary representation of the string that will be searched for in `buf`. - * @return The index of the last occurrence of `value` in `buf`, or `-1` if `buf` does not contain `value`. - */ - lastIndexOf(value: string | number | Uint8Array, byteOffset?: number, encoding?: BufferEncoding): number; - /** - * Creates and returns an [iterator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols) of `[index, byte]` pairs from the contents - * of `buf`. - * - * ```js - * import { Buffer } from 'buffer'; - * - * // Log the entire contents of a `Buffer`. - * - * const buf = Buffer.from('buffer'); - * - * for (const pair of buf.entries()) { - * console.log(pair); - * } - * // Prints: - * // [0, 98] - * // [1, 117] - * // [2, 102] - * // [3, 102] - * // [4, 101] - * // [5, 114] - * ``` - * @since v1.1.0 - */ - entries(): IterableIterator<[number, number]>; - /** - * Equivalent to `buf.indexOf() !== -1`. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.from('this is a buffer'); - * - * console.log(buf.includes('this')); - * // Prints: true - * console.log(buf.includes('is')); - * // Prints: true - * console.log(buf.includes(Buffer.from('a buffer'))); - * // Prints: true - * console.log(buf.includes(97)); - * // Prints: true (97 is the decimal ASCII value for 'a') - * console.log(buf.includes(Buffer.from('a buffer example'))); - * // Prints: false - * console.log(buf.includes(Buffer.from('a buffer example').slice(0, 8))); - * // Prints: true - * console.log(buf.includes('this', 4)); - * // Prints: false - * ``` - * @since v5.3.0 - * @param value What to search for. - * @param [byteOffset=0] Where to begin searching in `buf`. If negative, then offset is calculated from the end of `buf`. - * @param [encoding='utf8'] If `value` is a string, this is its encoding. - * @return `true` if `value` was found in `buf`, `false` otherwise. - */ - includes(value: string | number | Buffer, byteOffset?: number, encoding?: BufferEncoding): boolean; - /** - * Creates and returns an [iterator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols) of `buf` keys (indices). - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.from('buffer'); - * - * for (const key of buf.keys()) { - * console.log(key); - * } - * // Prints: - * // 0 - * // 1 - * // 2 - * // 3 - * // 4 - * // 5 - * ``` - * @since v1.1.0 - */ - keys(): IterableIterator; - /** - * Creates and returns an [iterator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols) for `buf` values (bytes). This function is - * called automatically when a `Buffer` is used in a `for..of` statement. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.from('buffer'); - * - * for (const value of buf.values()) { - * console.log(value); - * } - * // Prints: - * // 98 - * // 117 - * // 102 - * // 102 - * // 101 - * // 114 - * - * for (const value of buf) { - * console.log(value); - * } - * // Prints: - * // 98 - * // 117 - * // 102 - * // 102 - * // 101 - * // 114 - * ``` - * @since v1.1.0 - */ - values(): IterableIterator; - } - var Buffer: BufferConstructor; - /** - * Decodes a string of Base64-encoded data into bytes, and encodes those bytes - * into a string using Latin-1 (ISO-8859-1). - * - * The `data` may be any JavaScript-value that can be coerced into a string. - * - * **This function is only provided for compatibility with legacy web platform APIs** - * **and should never be used in new code, because they use strings to represent** - * **binary data and predate the introduction of typed arrays in JavaScript.** - * **For code running using Node.js APIs, converting between base64-encoded strings** - * **and binary data should be performed using `Buffer.from(str, 'base64')` and`buf.toString('base64')`.** - * @since v15.13.0, v14.17.0 - * @deprecated Use `Buffer.from(data, 'base64')` instead. - * @param data The Base64-encoded input string. - */ - function atob(data: string): string; - /** - * Decodes a string into bytes using Latin-1 (ISO-8859), and encodes those bytes - * into a string using Base64. - * - * The `data` may be any JavaScript-value that can be coerced into a string. - * - * **This function is only provided for compatibility with legacy web platform APIs** - * **and should never be used in new code, because they use strings to represent** - * **binary data and predate the introduction of typed arrays in JavaScript.** - * **For code running using Node.js APIs, converting between base64-encoded strings** - * **and binary data should be performed using `Buffer.from(str, 'base64')` and`buf.toString('base64')`.** - * @since v15.13.0, v14.17.0 - * @deprecated Use `buf.toString('base64')` instead. - * @param data An ASCII (Latin1) string. - */ - function btoa(data: string): string; - - interface Blob extends __Blob {} - /** - * `Blob` class is a global reference for `require('node:buffer').Blob` - * https://nodejs.org/api/buffer.html#class-blob - * @since v18.0.0 - */ - var Blob: typeof globalThis extends { - onmessage: any; - Blob: infer T; - } - ? T - : typeof NodeBlob; - } -} -declare module 'node:buffer' { - export * from 'buffer'; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/child_process.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/child_process.d.ts deleted file mode 100755 index 79c7290e..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/child_process.d.ts +++ /dev/null @@ -1,1369 +0,0 @@ -/** - * The `child_process` module provides the ability to spawn subprocesses in - * a manner that is similar, but not identical, to [`popen(3)`](http://man7.org/linux/man-pages/man3/popen.3.html). This capability - * is primarily provided by the {@link spawn} function: - * - * ```js - * const { spawn } = require('child_process'); - * const ls = spawn('ls', ['-lh', '/usr']); - * - * ls.stdout.on('data', (data) => { - * console.log(`stdout: ${data}`); - * }); - * - * ls.stderr.on('data', (data) => { - * console.error(`stderr: ${data}`); - * }); - * - * ls.on('close', (code) => { - * console.log(`child process exited with code ${code}`); - * }); - * ``` - * - * By default, pipes for `stdin`, `stdout`, and `stderr` are established between - * the parent Node.js process and the spawned subprocess. These pipes have - * limited (and platform-specific) capacity. If the subprocess writes to - * stdout in excess of that limit without the output being captured, the - * subprocess blocks waiting for the pipe buffer to accept more data. This is - * identical to the behavior of pipes in the shell. Use the `{ stdio: 'ignore' }`option if the output will not be consumed. - * - * The command lookup is performed using the `options.env.PATH` environment - * variable if `env` is in the `options` object. Otherwise, `process.env.PATH` is - * used. If `options.env` is set without `PATH`, lookup on Unix is performed - * on a default search path search of `/usr/bin:/bin` (see your operating system's - * manual for execvpe/execvp), on Windows the current processes environment - * variable `PATH` is used. - * - * On Windows, environment variables are case-insensitive. Node.js - * lexicographically sorts the `env` keys and uses the first one that - * case-insensitively matches. Only first (in lexicographic order) entry will be - * passed to the subprocess. This might lead to issues on Windows when passing - * objects to the `env` option that have multiple variants of the same key, such as`PATH` and `Path`. - * - * The {@link spawn} method spawns the child process asynchronously, - * without blocking the Node.js event loop. The {@link spawnSync} function provides equivalent functionality in a synchronous manner that blocks - * the event loop until the spawned process either exits or is terminated. - * - * For convenience, the `child_process` module provides a handful of synchronous - * and asynchronous alternatives to {@link spawn} and {@link spawnSync}. Each of these alternatives are implemented on - * top of {@link spawn} or {@link spawnSync}. - * - * * {@link exec}: spawns a shell and runs a command within that - * shell, passing the `stdout` and `stderr` to a callback function when - * complete. - * * {@link execFile}: similar to {@link exec} except - * that it spawns the command directly without first spawning a shell by - * default. - * * {@link fork}: spawns a new Node.js process and invokes a - * specified module with an IPC communication channel established that allows - * sending messages between parent and child. - * * {@link execSync}: a synchronous version of {@link exec} that will block the Node.js event loop. - * * {@link execFileSync}: a synchronous version of {@link execFile} that will block the Node.js event loop. - * - * For certain use cases, such as automating shell scripts, the `synchronous counterparts` may be more convenient. In many cases, however, - * the synchronous methods can have significant impact on performance due to - * stalling the event loop while spawned processes complete. - * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/child_process.js) - */ -declare module 'child_process' { - import { ObjectEncodingOptions } from 'node:fs'; - import { EventEmitter, Abortable } from 'node:events'; - import * as net from 'node:net'; - import { Writable, Readable, Stream, Pipe } from 'node:stream'; - import { URL } from 'node:url'; - type Serializable = string | object | number | boolean | bigint; - type SendHandle = net.Socket | net.Server; - /** - * Instances of the `ChildProcess` represent spawned child processes. - * - * Instances of `ChildProcess` are not intended to be created directly. Rather, - * use the {@link spawn}, {@link exec},{@link execFile}, or {@link fork} methods to create - * instances of `ChildProcess`. - * @since v2.2.0 - */ - class ChildProcess extends EventEmitter { - /** - * A `Writable Stream` that represents the child process's `stdin`. - * - * If a child process waits to read all of its input, the child will not continue - * until this stream has been closed via `end()`. - * - * If the child was spawned with `stdio[0]` set to anything other than `'pipe'`, - * then this will be `null`. - * - * `subprocess.stdin` is an alias for `subprocess.stdio[0]`. Both properties will - * refer to the same value. - * - * The `subprocess.stdin` property can be `undefined` if the child process could - * not be successfully spawned. - * @since v0.1.90 - */ - stdin: Writable | null; - /** - * A `Readable Stream` that represents the child process's `stdout`. - * - * If the child was spawned with `stdio[1]` set to anything other than `'pipe'`, - * then this will be `null`. - * - * `subprocess.stdout` is an alias for `subprocess.stdio[1]`. Both properties will - * refer to the same value. - * - * ```js - * const { spawn } = require('child_process'); - * - * const subprocess = spawn('ls'); - * - * subprocess.stdout.on('data', (data) => { - * console.log(`Received chunk ${data}`); - * }); - * ``` - * - * The `subprocess.stdout` property can be `null` if the child process could - * not be successfully spawned. - * @since v0.1.90 - */ - stdout: Readable | null; - /** - * A `Readable Stream` that represents the child process's `stderr`. - * - * If the child was spawned with `stdio[2]` set to anything other than `'pipe'`, - * then this will be `null`. - * - * `subprocess.stderr` is an alias for `subprocess.stdio[2]`. Both properties will - * refer to the same value. - * - * The `subprocess.stderr` property can be `null` if the child process could - * not be successfully spawned. - * @since v0.1.90 - */ - stderr: Readable | null; - /** - * The `subprocess.channel` property is a reference to the child's IPC channel. If - * no IPC channel currently exists, this property is `undefined`. - * @since v7.1.0 - */ - readonly channel?: Pipe | null | undefined; - /** - * A sparse array of pipes to the child process, corresponding with positions in - * the `stdio` option passed to {@link spawn} that have been set - * to the value `'pipe'`. `subprocess.stdio[0]`, `subprocess.stdio[1]`, and`subprocess.stdio[2]` are also available as `subprocess.stdin`,`subprocess.stdout`, and `subprocess.stderr`, - * respectively. - * - * In the following example, only the child's fd `1` (stdout) is configured as a - * pipe, so only the parent's `subprocess.stdio[1]` is a stream, all other values - * in the array are `null`. - * - * ```js - * const assert = require('assert'); - * const fs = require('fs'); - * const child_process = require('child_process'); - * - * const subprocess = child_process.spawn('ls', { - * stdio: [ - * 0, // Use parent's stdin for child. - * 'pipe', // Pipe child's stdout to parent. - * fs.openSync('err.out', 'w'), // Direct child's stderr to a file. - * ] - * }); - * - * assert.strictEqual(subprocess.stdio[0], null); - * assert.strictEqual(subprocess.stdio[0], subprocess.stdin); - * - * assert(subprocess.stdout); - * assert.strictEqual(subprocess.stdio[1], subprocess.stdout); - * - * assert.strictEqual(subprocess.stdio[2], null); - * assert.strictEqual(subprocess.stdio[2], subprocess.stderr); - * ``` - * - * The `subprocess.stdio` property can be `undefined` if the child process could - * not be successfully spawned. - * @since v0.7.10 - */ - readonly stdio: [ - Writable | null, - // stdin - Readable | null, - // stdout - Readable | null, - // stderr - Readable | Writable | null | undefined, - // extra - Readable | Writable | null | undefined // extra - ]; - /** - * The `subprocess.killed` property indicates whether the child process - * successfully received a signal from `subprocess.kill()`. The `killed` property - * does not indicate that the child process has been terminated. - * @since v0.5.10 - */ - readonly killed: boolean; - /** - * Returns the process identifier (PID) of the child process. If the child process - * fails to spawn due to errors, then the value is `undefined` and `error` is - * emitted. - * - * ```js - * const { spawn } = require('child_process'); - * const grep = spawn('grep', ['ssh']); - * - * console.log(`Spawned child pid: ${grep.pid}`); - * grep.stdin.end(); - * ``` - * @since v0.1.90 - */ - readonly pid?: number | undefined; - /** - * The `subprocess.connected` property indicates whether it is still possible to - * send and receive messages from a child process. When `subprocess.connected` is`false`, it is no longer possible to send or receive messages. - * @since v0.7.2 - */ - readonly connected: boolean; - /** - * The `subprocess.exitCode` property indicates the exit code of the child process. - * If the child process is still running, the field will be `null`. - */ - readonly exitCode: number | null; - /** - * The `subprocess.signalCode` property indicates the signal received by - * the child process if any, else `null`. - */ - readonly signalCode: NodeJS.Signals | null; - /** - * The `subprocess.spawnargs` property represents the full list of command-line - * arguments the child process was launched with. - */ - readonly spawnargs: string[]; - /** - * The `subprocess.spawnfile` property indicates the executable file name of - * the child process that is launched. - * - * For {@link fork}, its value will be equal to `process.execPath`. - * For {@link spawn}, its value will be the name of - * the executable file. - * For {@link exec}, its value will be the name of the shell - * in which the child process is launched. - */ - readonly spawnfile: string; - /** - * The `subprocess.kill()` method sends a signal to the child process. If no - * argument is given, the process will be sent the `'SIGTERM'` signal. See [`signal(7)`](http://man7.org/linux/man-pages/man7/signal.7.html) for a list of available signals. This function - * returns `true` if [`kill(2)`](http://man7.org/linux/man-pages/man2/kill.2.html) succeeds, and `false` otherwise. - * - * ```js - * const { spawn } = require('child_process'); - * const grep = spawn('grep', ['ssh']); - * - * grep.on('close', (code, signal) => { - * console.log( - * `child process terminated due to receipt of signal ${signal}`); - * }); - * - * // Send SIGHUP to process. - * grep.kill('SIGHUP'); - * ``` - * - * The `ChildProcess` object may emit an `'error'` event if the signal - * cannot be delivered. Sending a signal to a child process that has already exited - * is not an error but may have unforeseen consequences. Specifically, if the - * process identifier (PID) has been reassigned to another process, the signal will - * be delivered to that process instead which can have unexpected results. - * - * While the function is called `kill`, the signal delivered to the child process - * may not actually terminate the process. - * - * See [`kill(2)`](http://man7.org/linux/man-pages/man2/kill.2.html) for reference. - * - * On Windows, where POSIX signals do not exist, the `signal` argument will be - * ignored, and the process will be killed forcefully and abruptly (similar to`'SIGKILL'`). - * See `Signal Events` for more details. - * - * On Linux, child processes of child processes will not be terminated - * when attempting to kill their parent. This is likely to happen when running a - * new process in a shell or with the use of the `shell` option of `ChildProcess`: - * - * ```js - * 'use strict'; - * const { spawn } = require('child_process'); - * - * const subprocess = spawn( - * 'sh', - * [ - * '-c', - * `node -e "setInterval(() => { - * console.log(process.pid, 'is alive') - * }, 500);"`, - * ], { - * stdio: ['inherit', 'inherit', 'inherit'] - * } - * ); - * - * setTimeout(() => { - * subprocess.kill(); // Does not terminate the Node.js process in the shell. - * }, 2000); - * ``` - * @since v0.1.90 - */ - kill(signal?: NodeJS.Signals | number): boolean; - /** - * When an IPC channel has been established between the parent and child ( - * i.e. when using {@link fork}), the `subprocess.send()` method can - * be used to send messages to the child process. When the child process is a - * Node.js instance, these messages can be received via the `'message'` event. - * - * The message goes through serialization and parsing. The resulting - * message might not be the same as what is originally sent. - * - * For example, in the parent script: - * - * ```js - * const cp = require('child_process'); - * const n = cp.fork(`${__dirname}/sub.js`); - * - * n.on('message', (m) => { - * console.log('PARENT got message:', m); - * }); - * - * // Causes the child to print: CHILD got message: { hello: 'world' } - * n.send({ hello: 'world' }); - * ``` - * - * And then the child script, `'sub.js'` might look like this: - * - * ```js - * process.on('message', (m) => { - * console.log('CHILD got message:', m); - * }); - * - * // Causes the parent to print: PARENT got message: { foo: 'bar', baz: null } - * process.send({ foo: 'bar', baz: NaN }); - * ``` - * - * Child Node.js processes will have a `process.send()` method of their own - * that allows the child to send messages back to the parent. - * - * There is a special case when sending a `{cmd: 'NODE_foo'}` message. Messages - * containing a `NODE_` prefix in the `cmd` property are reserved for use within - * Node.js core and will not be emitted in the child's `'message'` event. Rather, such messages are emitted using the`'internalMessage'` event and are consumed internally by Node.js. - * Applications should avoid using such messages or listening for`'internalMessage'` events as it is subject to change without notice. - * - * The optional `sendHandle` argument that may be passed to `subprocess.send()` is - * for passing a TCP server or socket object to the child process. The child will - * receive the object as the second argument passed to the callback function - * registered on the `'message'` event. Any data that is received - * and buffered in the socket will not be sent to the child. - * - * The optional `callback` is a function that is invoked after the message is - * sent but before the child may have received it. The function is called with a - * single argument: `null` on success, or an `Error` object on failure. - * - * If no `callback` function is provided and the message cannot be sent, an`'error'` event will be emitted by the `ChildProcess` object. This can - * happen, for instance, when the child process has already exited. - * - * `subprocess.send()` will return `false` if the channel has closed or when the - * backlog of unsent messages exceeds a threshold that makes it unwise to send - * more. Otherwise, the method returns `true`. The `callback` function can be - * used to implement flow control. - * - * #### Example: sending a server object - * - * The `sendHandle` argument can be used, for instance, to pass the handle of - * a TCP server object to the child process as illustrated in the example below: - * - * ```js - * const subprocess = require('child_process').fork('subprocess.js'); - * - * // Open up the server object and send the handle. - * const server = require('net').createServer(); - * server.on('connection', (socket) => { - * socket.end('handled by parent'); - * }); - * server.listen(1337, () => { - * subprocess.send('server', server); - * }); - * ``` - * - * The child would then receive the server object as: - * - * ```js - * process.on('message', (m, server) => { - * if (m === 'server') { - * server.on('connection', (socket) => { - * socket.end('handled by child'); - * }); - * } - * }); - * ``` - * - * Once the server is now shared between the parent and child, some connections - * can be handled by the parent and some by the child. - * - * While the example above uses a server created using the `net` module, `dgram`module servers use exactly the same workflow with the exceptions of listening on - * a `'message'` event instead of `'connection'` and using `server.bind()` instead - * of `server.listen()`. This is, however, currently only supported on Unix - * platforms. - * - * #### Example: sending a socket object - * - * Similarly, the `sendHandler` argument can be used to pass the handle of a - * socket to the child process. The example below spawns two children that each - * handle connections with "normal" or "special" priority: - * - * ```js - * const { fork } = require('child_process'); - * const normal = fork('subprocess.js', ['normal']); - * const special = fork('subprocess.js', ['special']); - * - * // Open up the server and send sockets to child. Use pauseOnConnect to prevent - * // the sockets from being read before they are sent to the child process. - * const server = require('net').createServer({ pauseOnConnect: true }); - * server.on('connection', (socket) => { - * - * // If this is special priority... - * if (socket.remoteAddress === '74.125.127.100') { - * special.send('socket', socket); - * return; - * } - * // This is normal priority. - * normal.send('socket', socket); - * }); - * server.listen(1337); - * ``` - * - * The `subprocess.js` would receive the socket handle as the second argument - * passed to the event callback function: - * - * ```js - * process.on('message', (m, socket) => { - * if (m === 'socket') { - * if (socket) { - * // Check that the client socket exists. - * // It is possible for the socket to be closed between the time it is - * // sent and the time it is received in the child process. - * socket.end(`Request handled with ${process.argv[2]} priority`); - * } - * } - * }); - * ``` - * - * Do not use `.maxConnections` on a socket that has been passed to a subprocess. - * The parent cannot track when the socket is destroyed. - * - * Any `'message'` handlers in the subprocess should verify that `socket` exists, - * as the connection may have been closed during the time it takes to send the - * connection to the child. - * @since v0.5.9 - * @param options The `options` argument, if present, is an object used to parameterize the sending of certain types of handles. `options` supports the following properties: - */ - send(message: Serializable, callback?: (error: Error | null) => void): boolean; - send(message: Serializable, sendHandle?: SendHandle, callback?: (error: Error | null) => void): boolean; - send(message: Serializable, sendHandle?: SendHandle, options?: MessageOptions, callback?: (error: Error | null) => void): boolean; - /** - * Closes the IPC channel between parent and child, allowing the child to exit - * gracefully once there are no other connections keeping it alive. After calling - * this method the `subprocess.connected` and `process.connected` properties in - * both the parent and child (respectively) will be set to `false`, and it will be - * no longer possible to pass messages between the processes. - * - * The `'disconnect'` event will be emitted when there are no messages in the - * process of being received. This will most often be triggered immediately after - * calling `subprocess.disconnect()`. - * - * When the child process is a Node.js instance (e.g. spawned using {@link fork}), the `process.disconnect()` method can be invoked - * within the child process to close the IPC channel as well. - * @since v0.7.2 - */ - disconnect(): void; - /** - * By default, the parent will wait for the detached child to exit. To prevent the - * parent from waiting for a given `subprocess` to exit, use the`subprocess.unref()` method. Doing so will cause the parent's event loop to not - * include the child in its reference count, allowing the parent to exit - * independently of the child, unless there is an established IPC channel between - * the child and the parent. - * - * ```js - * const { spawn } = require('child_process'); - * - * const subprocess = spawn(process.argv[0], ['child_program.js'], { - * detached: true, - * stdio: 'ignore' - * }); - * - * subprocess.unref(); - * ``` - * @since v0.7.10 - */ - unref(): void; - /** - * Calling `subprocess.ref()` after making a call to `subprocess.unref()` will - * restore the removed reference count for the child process, forcing the parent - * to wait for the child to exit before exiting itself. - * - * ```js - * const { spawn } = require('child_process'); - * - * const subprocess = spawn(process.argv[0], ['child_program.js'], { - * detached: true, - * stdio: 'ignore' - * }); - * - * subprocess.unref(); - * subprocess.ref(); - * ``` - * @since v0.7.10 - */ - ref(): void; - /** - * events.EventEmitter - * 1. close - * 2. disconnect - * 3. error - * 4. exit - * 5. message - * 6. spawn - */ - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: 'close', listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; - addListener(event: 'disconnect', listener: () => void): this; - addListener(event: 'error', listener: (err: Error) => void): this; - addListener(event: 'exit', listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; - addListener(event: 'message', listener: (message: Serializable, sendHandle: SendHandle) => void): this; - addListener(event: 'spawn', listener: () => void): this; - emit(event: string | symbol, ...args: any[]): boolean; - emit(event: 'close', code: number | null, signal: NodeJS.Signals | null): boolean; - emit(event: 'disconnect'): boolean; - emit(event: 'error', err: Error): boolean; - emit(event: 'exit', code: number | null, signal: NodeJS.Signals | null): boolean; - emit(event: 'message', message: Serializable, sendHandle: SendHandle): boolean; - emit(event: 'spawn', listener: () => void): boolean; - on(event: string, listener: (...args: any[]) => void): this; - on(event: 'close', listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; - on(event: 'disconnect', listener: () => void): this; - on(event: 'error', listener: (err: Error) => void): this; - on(event: 'exit', listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; - on(event: 'message', listener: (message: Serializable, sendHandle: SendHandle) => void): this; - on(event: 'spawn', listener: () => void): this; - once(event: string, listener: (...args: any[]) => void): this; - once(event: 'close', listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; - once(event: 'disconnect', listener: () => void): this; - once(event: 'error', listener: (err: Error) => void): this; - once(event: 'exit', listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; - once(event: 'message', listener: (message: Serializable, sendHandle: SendHandle) => void): this; - once(event: 'spawn', listener: () => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: 'close', listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; - prependListener(event: 'disconnect', listener: () => void): this; - prependListener(event: 'error', listener: (err: Error) => void): this; - prependListener(event: 'exit', listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; - prependListener(event: 'message', listener: (message: Serializable, sendHandle: SendHandle) => void): this; - prependListener(event: 'spawn', listener: () => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: 'close', listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; - prependOnceListener(event: 'disconnect', listener: () => void): this; - prependOnceListener(event: 'error', listener: (err: Error) => void): this; - prependOnceListener(event: 'exit', listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; - prependOnceListener(event: 'message', listener: (message: Serializable, sendHandle: SendHandle) => void): this; - prependOnceListener(event: 'spawn', listener: () => void): this; - } - // return this object when stdio option is undefined or not specified - interface ChildProcessWithoutNullStreams extends ChildProcess { - stdin: Writable; - stdout: Readable; - stderr: Readable; - readonly stdio: [ - Writable, - Readable, - Readable, - // stderr - Readable | Writable | null | undefined, - // extra, no modification - Readable | Writable | null | undefined // extra, no modification - ]; - } - // return this object when stdio option is a tuple of 3 - interface ChildProcessByStdio extends ChildProcess { - stdin: I; - stdout: O; - stderr: E; - readonly stdio: [ - I, - O, - E, - Readable | Writable | null | undefined, - // extra, no modification - Readable | Writable | null | undefined // extra, no modification - ]; - } - interface MessageOptions { - keepOpen?: boolean | undefined; - } - type IOType = 'overlapped' | 'pipe' | 'ignore' | 'inherit'; - type StdioOptions = IOType | Array; - type SerializationType = 'json' | 'advanced'; - interface MessagingOptions extends Abortable { - /** - * Specify the kind of serialization used for sending messages between processes. - * @default 'json' - */ - serialization?: SerializationType | undefined; - /** - * The signal value to be used when the spawned process will be killed by the abort signal. - * @default 'SIGTERM' - */ - killSignal?: NodeJS.Signals | number | undefined; - /** - * In milliseconds the maximum amount of time the process is allowed to run. - */ - timeout?: number | undefined; - } - interface ProcessEnvOptions { - uid?: number | undefined; - gid?: number | undefined; - cwd?: string | URL | undefined; - env?: NodeJS.ProcessEnv | undefined; - } - interface CommonOptions extends ProcessEnvOptions { - /** - * @default true - */ - windowsHide?: boolean | undefined; - /** - * @default 0 - */ - timeout?: number | undefined; - } - interface CommonSpawnOptions extends CommonOptions, MessagingOptions, Abortable { - argv0?: string | undefined; - stdio?: StdioOptions | undefined; - shell?: boolean | string | undefined; - windowsVerbatimArguments?: boolean | undefined; - } - interface SpawnOptions extends CommonSpawnOptions { - detached?: boolean | undefined; - } - interface SpawnOptionsWithoutStdio extends SpawnOptions { - stdio?: StdioPipeNamed | StdioPipe[] | undefined; - } - type StdioNull = 'inherit' | 'ignore' | Stream; - type StdioPipeNamed = 'pipe' | 'overlapped'; - type StdioPipe = undefined | null | StdioPipeNamed; - interface SpawnOptionsWithStdioTuple extends SpawnOptions { - stdio: [Stdin, Stdout, Stderr]; - } - /** - * The `child_process.spawn()` method spawns a new process using the given`command`, with command-line arguments in `args`. If omitted, `args` defaults - * to an empty array. - * - * **If the `shell` option is enabled, do not pass unsanitized user input to this** - * **function. Any input containing shell metacharacters may be used to trigger** - * **arbitrary command execution.** - * - * A third argument may be used to specify additional options, with these defaults: - * - * ```js - * const defaults = { - * cwd: undefined, - * env: process.env - * }; - * ``` - * - * Use `cwd` to specify the working directory from which the process is spawned. - * If not given, the default is to inherit the current working directory. If given, - * but the path does not exist, the child process emits an `ENOENT` error - * and exits immediately. `ENOENT` is also emitted when the command - * does not exist. - * - * Use `env` to specify environment variables that will be visible to the new - * process, the default is `process.env`. - * - * `undefined` values in `env` will be ignored. - * - * Example of running `ls -lh /usr`, capturing `stdout`, `stderr`, and the - * exit code: - * - * ```js - * const { spawn } = require('child_process'); - * const ls = spawn('ls', ['-lh', '/usr']); - * - * ls.stdout.on('data', (data) => { - * console.log(`stdout: ${data}`); - * }); - * - * ls.stderr.on('data', (data) => { - * console.error(`stderr: ${data}`); - * }); - * - * ls.on('close', (code) => { - * console.log(`child process exited with code ${code}`); - * }); - * ``` - * - * Example: A very elaborate way to run `ps ax | grep ssh` - * - * ```js - * const { spawn } = require('child_process'); - * const ps = spawn('ps', ['ax']); - * const grep = spawn('grep', ['ssh']); - * - * ps.stdout.on('data', (data) => { - * grep.stdin.write(data); - * }); - * - * ps.stderr.on('data', (data) => { - * console.error(`ps stderr: ${data}`); - * }); - * - * ps.on('close', (code) => { - * if (code !== 0) { - * console.log(`ps process exited with code ${code}`); - * } - * grep.stdin.end(); - * }); - * - * grep.stdout.on('data', (data) => { - * console.log(data.toString()); - * }); - * - * grep.stderr.on('data', (data) => { - * console.error(`grep stderr: ${data}`); - * }); - * - * grep.on('close', (code) => { - * if (code !== 0) { - * console.log(`grep process exited with code ${code}`); - * } - * }); - * ``` - * - * Example of checking for failed `spawn`: - * - * ```js - * const { spawn } = require('child_process'); - * const subprocess = spawn('bad_command'); - * - * subprocess.on('error', (err) => { - * console.error('Failed to start subprocess.'); - * }); - * ``` - * - * Certain platforms (macOS, Linux) will use the value of `argv[0]` for the process - * title while others (Windows, SunOS) will use `command`. - * - * Node.js currently overwrites `argv[0]` with `process.execPath` on startup, so`process.argv[0]` in a Node.js child process will not match the `argv0`parameter passed to `spawn` from the parent, - * retrieve it with the`process.argv0` property instead. - * - * If the `signal` option is enabled, calling `.abort()` on the corresponding`AbortController` is similar to calling `.kill()` on the child process except - * the error passed to the callback will be an `AbortError`: - * - * ```js - * const { spawn } = require('child_process'); - * const controller = new AbortController(); - * const { signal } = controller; - * const grep = spawn('grep', ['ssh'], { signal }); - * grep.on('error', (err) => { - * // This will be called with err being an AbortError if the controller aborts - * }); - * controller.abort(); // Stops the child process - * ``` - * @since v0.1.90 - * @param command The command to run. - * @param args List of string arguments. - */ - function spawn(command: string, options?: SpawnOptionsWithoutStdio): ChildProcessWithoutNullStreams; - function spawn(command: string, options: SpawnOptionsWithStdioTuple): ChildProcessByStdio; - function spawn(command: string, options: SpawnOptionsWithStdioTuple): ChildProcessByStdio; - function spawn(command: string, options: SpawnOptionsWithStdioTuple): ChildProcessByStdio; - function spawn(command: string, options: SpawnOptionsWithStdioTuple): ChildProcessByStdio; - function spawn(command: string, options: SpawnOptionsWithStdioTuple): ChildProcessByStdio; - function spawn(command: string, options: SpawnOptionsWithStdioTuple): ChildProcessByStdio; - function spawn(command: string, options: SpawnOptionsWithStdioTuple): ChildProcessByStdio; - function spawn(command: string, options: SpawnOptionsWithStdioTuple): ChildProcessByStdio; - function spawn(command: string, options: SpawnOptions): ChildProcess; - // overloads of spawn with 'args' - function spawn(command: string, args?: ReadonlyArray, options?: SpawnOptionsWithoutStdio): ChildProcessWithoutNullStreams; - function spawn(command: string, args: ReadonlyArray, options: SpawnOptionsWithStdioTuple): ChildProcessByStdio; - function spawn(command: string, args: ReadonlyArray, options: SpawnOptionsWithStdioTuple): ChildProcessByStdio; - function spawn(command: string, args: ReadonlyArray, options: SpawnOptionsWithStdioTuple): ChildProcessByStdio; - function spawn(command: string, args: ReadonlyArray, options: SpawnOptionsWithStdioTuple): ChildProcessByStdio; - function spawn(command: string, args: ReadonlyArray, options: SpawnOptionsWithStdioTuple): ChildProcessByStdio; - function spawn(command: string, args: ReadonlyArray, options: SpawnOptionsWithStdioTuple): ChildProcessByStdio; - function spawn(command: string, args: ReadonlyArray, options: SpawnOptionsWithStdioTuple): ChildProcessByStdio; - function spawn(command: string, args: ReadonlyArray, options: SpawnOptionsWithStdioTuple): ChildProcessByStdio; - function spawn(command: string, args: ReadonlyArray, options: SpawnOptions): ChildProcess; - interface ExecOptions extends CommonOptions { - shell?: string | undefined; - signal?: AbortSignal | undefined; - maxBuffer?: number | undefined; - killSignal?: NodeJS.Signals | number | undefined; - } - interface ExecOptionsWithStringEncoding extends ExecOptions { - encoding: BufferEncoding; - } - interface ExecOptionsWithBufferEncoding extends ExecOptions { - encoding: BufferEncoding | null; // specify `null`. - } - interface ExecException extends Error { - cmd?: string | undefined; - killed?: boolean | undefined; - code?: number | undefined; - signal?: NodeJS.Signals | undefined; - } - /** - * Spawns a shell then executes the `command` within that shell, buffering any - * generated output. The `command` string passed to the exec function is processed - * directly by the shell and special characters (vary based on [shell](https://en.wikipedia.org/wiki/List_of_command-line_interpreters)) - * need to be dealt with accordingly: - * - * ```js - * const { exec } = require('child_process'); - * - * exec('"/path/to/test file/test.sh" arg1 arg2'); - * // Double quotes are used so that the space in the path is not interpreted as - * // a delimiter of multiple arguments. - * - * exec('echo "The \\$HOME variable is $HOME"'); - * // The $HOME variable is escaped in the first instance, but not in the second. - * ``` - * - * **Never pass unsanitized user input to this function. Any input containing shell** - * **metacharacters may be used to trigger arbitrary command execution.** - * - * If a `callback` function is provided, it is called with the arguments`(error, stdout, stderr)`. On success, `error` will be `null`. On error,`error` will be an instance of `Error`. The - * `error.code` property will be - * the exit code of the process. By convention, any exit code other than `0`indicates an error. `error.signal` will be the signal that terminated the - * process. - * - * The `stdout` and `stderr` arguments passed to the callback will contain the - * stdout and stderr output of the child process. By default, Node.js will decode - * the output as UTF-8 and pass strings to the callback. The `encoding` option - * can be used to specify the character encoding used to decode the stdout and - * stderr output. If `encoding` is `'buffer'`, or an unrecognized character - * encoding, `Buffer` objects will be passed to the callback instead. - * - * ```js - * const { exec } = require('child_process'); - * exec('cat *.js missing_file | wc -l', (error, stdout, stderr) => { - * if (error) { - * console.error(`exec error: ${error}`); - * return; - * } - * console.log(`stdout: ${stdout}`); - * console.error(`stderr: ${stderr}`); - * }); - * ``` - * - * If `timeout` is greater than `0`, the parent will send the signal - * identified by the `killSignal` property (the default is `'SIGTERM'`) if the - * child runs longer than `timeout` milliseconds. - * - * Unlike the [`exec(3)`](http://man7.org/linux/man-pages/man3/exec.3.html) POSIX system call, `child_process.exec()` does not replace - * the existing process and uses a shell to execute the command. - * - * If this method is invoked as its `util.promisify()` ed version, it returns - * a `Promise` for an `Object` with `stdout` and `stderr` properties. The returned`ChildProcess` instance is attached to the `Promise` as a `child` property. In - * case of an error (including any error resulting in an exit code other than 0), a - * rejected promise is returned, with the same `error` object given in the - * callback, but with two additional properties `stdout` and `stderr`. - * - * ```js - * const util = require('util'); - * const exec = util.promisify(require('child_process').exec); - * - * async function lsExample() { - * const { stdout, stderr } = await exec('ls'); - * console.log('stdout:', stdout); - * console.error('stderr:', stderr); - * } - * lsExample(); - * ``` - * - * If the `signal` option is enabled, calling `.abort()` on the corresponding`AbortController` is similar to calling `.kill()` on the child process except - * the error passed to the callback will be an `AbortError`: - * - * ```js - * const { exec } = require('child_process'); - * const controller = new AbortController(); - * const { signal } = controller; - * const child = exec('grep ssh', { signal }, (error) => { - * console.log(error); // an AbortError - * }); - * controller.abort(); - * ``` - * @since v0.1.90 - * @param command The command to run, with space-separated arguments. - * @param callback called with the output when process terminates. - */ - function exec(command: string, callback?: (error: ExecException | null, stdout: string, stderr: string) => void): ChildProcess; - // `options` with `"buffer"` or `null` for `encoding` means stdout/stderr are definitely `Buffer`. - function exec( - command: string, - options: { - encoding: 'buffer' | null; - } & ExecOptions, - callback?: (error: ExecException | null, stdout: Buffer, stderr: Buffer) => void - ): ChildProcess; - // `options` with well known `encoding` means stdout/stderr are definitely `string`. - function exec( - command: string, - options: { - encoding: BufferEncoding; - } & ExecOptions, - callback?: (error: ExecException | null, stdout: string, stderr: string) => void - ): ChildProcess; - // `options` with an `encoding` whose type is `string` means stdout/stderr could either be `Buffer` or `string`. - // There is no guarantee the `encoding` is unknown as `string` is a superset of `BufferEncoding`. - function exec( - command: string, - options: { - encoding: BufferEncoding; - } & ExecOptions, - callback?: (error: ExecException | null, stdout: string | Buffer, stderr: string | Buffer) => void - ): ChildProcess; - // `options` without an `encoding` means stdout/stderr are definitely `string`. - function exec(command: string, options: ExecOptions, callback?: (error: ExecException | null, stdout: string, stderr: string) => void): ChildProcess; - // fallback if nothing else matches. Worst case is always `string | Buffer`. - function exec( - command: string, - options: (ObjectEncodingOptions & ExecOptions) | undefined | null, - callback?: (error: ExecException | null, stdout: string | Buffer, stderr: string | Buffer) => void - ): ChildProcess; - interface PromiseWithChild extends Promise { - child: ChildProcess; - } - namespace exec { - function __promisify__(command: string): PromiseWithChild<{ - stdout: string; - stderr: string; - }>; - function __promisify__( - command: string, - options: { - encoding: 'buffer' | null; - } & ExecOptions - ): PromiseWithChild<{ - stdout: Buffer; - stderr: Buffer; - }>; - function __promisify__( - command: string, - options: { - encoding: BufferEncoding; - } & ExecOptions - ): PromiseWithChild<{ - stdout: string; - stderr: string; - }>; - function __promisify__( - command: string, - options: ExecOptions - ): PromiseWithChild<{ - stdout: string; - stderr: string; - }>; - function __promisify__( - command: string, - options?: (ObjectEncodingOptions & ExecOptions) | null - ): PromiseWithChild<{ - stdout: string | Buffer; - stderr: string | Buffer; - }>; - } - interface ExecFileOptions extends CommonOptions, Abortable { - maxBuffer?: number | undefined; - killSignal?: NodeJS.Signals | number | undefined; - windowsVerbatimArguments?: boolean | undefined; - shell?: boolean | string | undefined; - signal?: AbortSignal | undefined; - } - interface ExecFileOptionsWithStringEncoding extends ExecFileOptions { - encoding: BufferEncoding; - } - interface ExecFileOptionsWithBufferEncoding extends ExecFileOptions { - encoding: 'buffer' | null; - } - interface ExecFileOptionsWithOtherEncoding extends ExecFileOptions { - encoding: BufferEncoding; - } - type ExecFileException = ExecException & NodeJS.ErrnoException; - /** - * The `child_process.execFile()` function is similar to {@link exec} except that it does not spawn a shell by default. Rather, the specified - * executable `file` is spawned directly as a new process making it slightly more - * efficient than {@link exec}. - * - * The same options as {@link exec} are supported. Since a shell is - * not spawned, behaviors such as I/O redirection and file globbing are not - * supported. - * - * ```js - * const { execFile } = require('child_process'); - * const child = execFile('node', ['--version'], (error, stdout, stderr) => { - * if (error) { - * throw error; - * } - * console.log(stdout); - * }); - * ``` - * - * The `stdout` and `stderr` arguments passed to the callback will contain the - * stdout and stderr output of the child process. By default, Node.js will decode - * the output as UTF-8 and pass strings to the callback. The `encoding` option - * can be used to specify the character encoding used to decode the stdout and - * stderr output. If `encoding` is `'buffer'`, or an unrecognized character - * encoding, `Buffer` objects will be passed to the callback instead. - * - * If this method is invoked as its `util.promisify()` ed version, it returns - * a `Promise` for an `Object` with `stdout` and `stderr` properties. The returned`ChildProcess` instance is attached to the `Promise` as a `child` property. In - * case of an error (including any error resulting in an exit code other than 0), a - * rejected promise is returned, with the same `error` object given in the - * callback, but with two additional properties `stdout` and `stderr`. - * - * ```js - * const util = require('util'); - * const execFile = util.promisify(require('child_process').execFile); - * async function getVersion() { - * const { stdout } = await execFile('node', ['--version']); - * console.log(stdout); - * } - * getVersion(); - * ``` - * - * **If the `shell` option is enabled, do not pass unsanitized user input to this** - * **function. Any input containing shell metacharacters may be used to trigger** - * **arbitrary command execution.** - * - * If the `signal` option is enabled, calling `.abort()` on the corresponding`AbortController` is similar to calling `.kill()` on the child process except - * the error passed to the callback will be an `AbortError`: - * - * ```js - * const { execFile } = require('child_process'); - * const controller = new AbortController(); - * const { signal } = controller; - * const child = execFile('node', ['--version'], { signal }, (error) => { - * console.log(error); // an AbortError - * }); - * controller.abort(); - * ``` - * @since v0.1.91 - * @param file The name or path of the executable file to run. - * @param args List of string arguments. - * @param callback Called with the output when process terminates. - */ - function execFile(file: string): ChildProcess; - function execFile(file: string, options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null): ChildProcess; - function execFile(file: string, args?: ReadonlyArray | null): ChildProcess; - function execFile(file: string, args: ReadonlyArray | undefined | null, options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null): ChildProcess; - // no `options` definitely means stdout/stderr are `string`. - function execFile(file: string, callback: (error: ExecFileException | null, stdout: string, stderr: string) => void): ChildProcess; - function execFile(file: string, args: ReadonlyArray | undefined | null, callback: (error: ExecFileException | null, stdout: string, stderr: string) => void): ChildProcess; - // `options` with `"buffer"` or `null` for `encoding` means stdout/stderr are definitely `Buffer`. - function execFile(file: string, options: ExecFileOptionsWithBufferEncoding, callback: (error: ExecFileException | null, stdout: Buffer, stderr: Buffer) => void): ChildProcess; - function execFile( - file: string, - args: ReadonlyArray | undefined | null, - options: ExecFileOptionsWithBufferEncoding, - callback: (error: ExecFileException | null, stdout: Buffer, stderr: Buffer) => void - ): ChildProcess; - // `options` with well known `encoding` means stdout/stderr are definitely `string`. - function execFile(file: string, options: ExecFileOptionsWithStringEncoding, callback: (error: ExecFileException | null, stdout: string, stderr: string) => void): ChildProcess; - function execFile( - file: string, - args: ReadonlyArray | undefined | null, - options: ExecFileOptionsWithStringEncoding, - callback: (error: ExecFileException | null, stdout: string, stderr: string) => void - ): ChildProcess; - // `options` with an `encoding` whose type is `string` means stdout/stderr could either be `Buffer` or `string`. - // There is no guarantee the `encoding` is unknown as `string` is a superset of `BufferEncoding`. - function execFile(file: string, options: ExecFileOptionsWithOtherEncoding, callback: (error: ExecFileException | null, stdout: string | Buffer, stderr: string | Buffer) => void): ChildProcess; - function execFile( - file: string, - args: ReadonlyArray | undefined | null, - options: ExecFileOptionsWithOtherEncoding, - callback: (error: ExecFileException | null, stdout: string | Buffer, stderr: string | Buffer) => void - ): ChildProcess; - // `options` without an `encoding` means stdout/stderr are definitely `string`. - function execFile(file: string, options: ExecFileOptions, callback: (error: ExecFileException | null, stdout: string, stderr: string) => void): ChildProcess; - function execFile( - file: string, - args: ReadonlyArray | undefined | null, - options: ExecFileOptions, - callback: (error: ExecFileException | null, stdout: string, stderr: string) => void - ): ChildProcess; - // fallback if nothing else matches. Worst case is always `string | Buffer`. - function execFile( - file: string, - options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null, - callback: ((error: ExecFileException | null, stdout: string | Buffer, stderr: string | Buffer) => void) | undefined | null - ): ChildProcess; - function execFile( - file: string, - args: ReadonlyArray | undefined | null, - options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null, - callback: ((error: ExecFileException | null, stdout: string | Buffer, stderr: string | Buffer) => void) | undefined | null - ): ChildProcess; - namespace execFile { - function __promisify__(file: string): PromiseWithChild<{ - stdout: string; - stderr: string; - }>; - function __promisify__( - file: string, - args: ReadonlyArray | undefined | null - ): PromiseWithChild<{ - stdout: string; - stderr: string; - }>; - function __promisify__( - file: string, - options: ExecFileOptionsWithBufferEncoding - ): PromiseWithChild<{ - stdout: Buffer; - stderr: Buffer; - }>; - function __promisify__( - file: string, - args: ReadonlyArray | undefined | null, - options: ExecFileOptionsWithBufferEncoding - ): PromiseWithChild<{ - stdout: Buffer; - stderr: Buffer; - }>; - function __promisify__( - file: string, - options: ExecFileOptionsWithStringEncoding - ): PromiseWithChild<{ - stdout: string; - stderr: string; - }>; - function __promisify__( - file: string, - args: ReadonlyArray | undefined | null, - options: ExecFileOptionsWithStringEncoding - ): PromiseWithChild<{ - stdout: string; - stderr: string; - }>; - function __promisify__( - file: string, - options: ExecFileOptionsWithOtherEncoding - ): PromiseWithChild<{ - stdout: string | Buffer; - stderr: string | Buffer; - }>; - function __promisify__( - file: string, - args: ReadonlyArray | undefined | null, - options: ExecFileOptionsWithOtherEncoding - ): PromiseWithChild<{ - stdout: string | Buffer; - stderr: string | Buffer; - }>; - function __promisify__( - file: string, - options: ExecFileOptions - ): PromiseWithChild<{ - stdout: string; - stderr: string; - }>; - function __promisify__( - file: string, - args: ReadonlyArray | undefined | null, - options: ExecFileOptions - ): PromiseWithChild<{ - stdout: string; - stderr: string; - }>; - function __promisify__( - file: string, - options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null - ): PromiseWithChild<{ - stdout: string | Buffer; - stderr: string | Buffer; - }>; - function __promisify__( - file: string, - args: ReadonlyArray | undefined | null, - options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null - ): PromiseWithChild<{ - stdout: string | Buffer; - stderr: string | Buffer; - }>; - } - interface ForkOptions extends ProcessEnvOptions, MessagingOptions, Abortable { - execPath?: string | undefined; - execArgv?: string[] | undefined; - silent?: boolean | undefined; - stdio?: StdioOptions | undefined; - detached?: boolean | undefined; - windowsVerbatimArguments?: boolean | undefined; - } - /** - * The `child_process.fork()` method is a special case of {@link spawn} used specifically to spawn new Node.js processes. - * Like {@link spawn}, a `ChildProcess` object is returned. The - * returned `ChildProcess` will have an additional communication channel - * built-in that allows messages to be passed back and forth between the parent and - * child. See `subprocess.send()` for details. - * - * Keep in mind that spawned Node.js child processes are - * independent of the parent with exception of the IPC communication channel - * that is established between the two. Each process has its own memory, with - * their own V8 instances. Because of the additional resource allocations - * required, spawning a large number of child Node.js processes is not - * recommended. - * - * By default, `child_process.fork()` will spawn new Node.js instances using the `process.execPath` of the parent process. The `execPath` property in the`options` object allows for an alternative - * execution path to be used. - * - * Node.js processes launched with a custom `execPath` will communicate with the - * parent process using the file descriptor (fd) identified using the - * environment variable `NODE_CHANNEL_FD` on the child process. - * - * Unlike the [`fork(2)`](http://man7.org/linux/man-pages/man2/fork.2.html) POSIX system call, `child_process.fork()` does not clone the - * current process. - * - * The `shell` option available in {@link spawn} is not supported by`child_process.fork()` and will be ignored if set. - * - * If the `signal` option is enabled, calling `.abort()` on the corresponding`AbortController` is similar to calling `.kill()` on the child process except - * the error passed to the callback will be an `AbortError`: - * - * ```js - * if (process.argv[2] === 'child') { - * setTimeout(() => { - * console.log(`Hello from ${process.argv[2]}!`); - * }, 1_000); - * } else { - * const { fork } = require('child_process'); - * const controller = new AbortController(); - * const { signal } = controller; - * const child = fork(__filename, ['child'], { signal }); - * child.on('error', (err) => { - * // This will be called with err being an AbortError if the controller aborts - * }); - * controller.abort(); // Stops the child process - * } - * ``` - * @since v0.5.0 - * @param modulePath The module to run in the child. - * @param args List of string arguments. - */ - function fork(modulePath: string, options?: ForkOptions): ChildProcess; - function fork(modulePath: string, args?: ReadonlyArray, options?: ForkOptions): ChildProcess; - interface SpawnSyncOptions extends CommonSpawnOptions { - input?: string | NodeJS.ArrayBufferView | undefined; - maxBuffer?: number | undefined; - encoding?: BufferEncoding | 'buffer' | null | undefined; - } - interface SpawnSyncOptionsWithStringEncoding extends SpawnSyncOptions { - encoding: BufferEncoding; - } - interface SpawnSyncOptionsWithBufferEncoding extends SpawnSyncOptions { - encoding?: 'buffer' | null | undefined; - } - interface SpawnSyncReturns { - pid: number; - output: Array; - stdout: T; - stderr: T; - status: number | null; - signal: NodeJS.Signals | null; - error?: Error | undefined; - } - /** - * The `child_process.spawnSync()` method is generally identical to {@link spawn} with the exception that the function will not return - * until the child process has fully closed. When a timeout has been encountered - * and `killSignal` is sent, the method won't return until the process has - * completely exited. If the process intercepts and handles the `SIGTERM` signal - * and doesn't exit, the parent process will wait until the child process has - * exited. - * - * **If the `shell` option is enabled, do not pass unsanitized user input to this** - * **function. Any input containing shell metacharacters may be used to trigger** - * **arbitrary command execution.** - * @since v0.11.12 - * @param command The command to run. - * @param args List of string arguments. - */ - function spawnSync(command: string): SpawnSyncReturns; - function spawnSync(command: string, options: SpawnSyncOptionsWithStringEncoding): SpawnSyncReturns; - function spawnSync(command: string, options: SpawnSyncOptionsWithBufferEncoding): SpawnSyncReturns; - function spawnSync(command: string, options?: SpawnSyncOptions): SpawnSyncReturns; - function spawnSync(command: string, args: ReadonlyArray): SpawnSyncReturns; - function spawnSync(command: string, args: ReadonlyArray, options: SpawnSyncOptionsWithStringEncoding): SpawnSyncReturns; - function spawnSync(command: string, args: ReadonlyArray, options: SpawnSyncOptionsWithBufferEncoding): SpawnSyncReturns; - function spawnSync(command: string, args?: ReadonlyArray, options?: SpawnSyncOptions): SpawnSyncReturns; - interface CommonExecOptions extends CommonOptions { - input?: string | NodeJS.ArrayBufferView | undefined; - stdio?: StdioOptions | undefined; - killSignal?: NodeJS.Signals | number | undefined; - maxBuffer?: number | undefined; - encoding?: BufferEncoding | 'buffer' | null | undefined; - } - interface ExecSyncOptions extends CommonExecOptions { - shell?: string | undefined; - } - interface ExecSyncOptionsWithStringEncoding extends ExecSyncOptions { - encoding: BufferEncoding; - } - interface ExecSyncOptionsWithBufferEncoding extends ExecSyncOptions { - encoding?: 'buffer' | null | undefined; - } - /** - * The `child_process.execSync()` method is generally identical to {@link exec} with the exception that the method will not return - * until the child process has fully closed. When a timeout has been encountered - * and `killSignal` is sent, the method won't return until the process has - * completely exited. If the child process intercepts and handles the `SIGTERM`signal and doesn't exit, the parent process will wait until the child process - * has exited. - * - * If the process times out or has a non-zero exit code, this method will throw. - * The `Error` object will contain the entire result from {@link spawnSync}. - * - * **Never pass unsanitized user input to this function. Any input containing shell** - * **metacharacters may be used to trigger arbitrary command execution.** - * @since v0.11.12 - * @param command The command to run. - * @return The stdout from the command. - */ - function execSync(command: string): Buffer; - function execSync(command: string, options: ExecSyncOptionsWithStringEncoding): string; - function execSync(command: string, options: ExecSyncOptionsWithBufferEncoding): Buffer; - function execSync(command: string, options?: ExecSyncOptions): string | Buffer; - interface ExecFileSyncOptions extends CommonExecOptions { - shell?: boolean | string | undefined; - } - interface ExecFileSyncOptionsWithStringEncoding extends ExecFileSyncOptions { - encoding: BufferEncoding; - } - interface ExecFileSyncOptionsWithBufferEncoding extends ExecFileSyncOptions { - encoding?: 'buffer' | null; // specify `null`. - } - /** - * The `child_process.execFileSync()` method is generally identical to {@link execFile} with the exception that the method will not - * return until the child process has fully closed. When a timeout has been - * encountered and `killSignal` is sent, the method won't return until the process - * has completely exited. - * - * If the child process intercepts and handles the `SIGTERM` signal and - * does not exit, the parent process will still wait until the child process has - * exited. - * - * If the process times out or has a non-zero exit code, this method will throw an `Error` that will include the full result of the underlying {@link spawnSync}. - * - * **If the `shell` option is enabled, do not pass unsanitized user input to this** - * **function. Any input containing shell metacharacters may be used to trigger** - * **arbitrary command execution.** - * @since v0.11.12 - * @param file The name or path of the executable file to run. - * @param args List of string arguments. - * @return The stdout from the command. - */ - function execFileSync(file: string): Buffer; - function execFileSync(file: string, options: ExecFileSyncOptionsWithStringEncoding): string; - function execFileSync(file: string, options: ExecFileSyncOptionsWithBufferEncoding): Buffer; - function execFileSync(file: string, options?: ExecFileSyncOptions): string | Buffer; - function execFileSync(file: string, args: ReadonlyArray): Buffer; - function execFileSync(file: string, args: ReadonlyArray, options: ExecFileSyncOptionsWithStringEncoding): string; - function execFileSync(file: string, args: ReadonlyArray, options: ExecFileSyncOptionsWithBufferEncoding): Buffer; - function execFileSync(file: string, args?: ReadonlyArray, options?: ExecFileSyncOptions): string | Buffer; -} -declare module 'node:child_process' { - export * from 'child_process'; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/cluster.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/cluster.d.ts deleted file mode 100755 index 37dbc574..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/cluster.d.ts +++ /dev/null @@ -1,410 +0,0 @@ -/** - * Clusters of Node.js processes can be used to run multiple instances of Node.js - * that can distribute workloads among their application threads. When process - * isolation is not needed, use the `worker_threads` module instead, which - * allows running multiple application threads within a single Node.js instance. - * - * The cluster module allows easy creation of child processes that all share - * server ports. - * - * ```js - * import cluster from 'cluster'; - * import http from 'http'; - * import { cpus } from 'os'; - * import process from 'process'; - * - * const numCPUs = cpus().length; - * - * if (cluster.isPrimary) { - * console.log(`Primary ${process.pid} is running`); - * - * // Fork workers. - * for (let i = 0; i < numCPUs; i++) { - * cluster.fork(); - * } - * - * cluster.on('exit', (worker, code, signal) => { - * console.log(`worker ${worker.process.pid} died`); - * }); - * } else { - * // Workers can share any TCP connection - * // In this case it is an HTTP server - * http.createServer((req, res) => { - * res.writeHead(200); - * res.end('hello world\n'); - * }).listen(8000); - * - * console.log(`Worker ${process.pid} started`); - * } - * ``` - * - * Running Node.js will now share port 8000 between the workers: - * - * ```console - * $ node server.js - * Primary 3596 is running - * Worker 4324 started - * Worker 4520 started - * Worker 6056 started - * Worker 5644 started - * ``` - * - * On Windows, it is not yet possible to set up a named pipe server in a worker. - * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/cluster.js) - */ -declare module 'cluster' { - import * as child from 'node:child_process'; - import EventEmitter = require('node:events'); - import * as net from 'node:net'; - export interface ClusterSettings { - execArgv?: string[] | undefined; // default: process.execArgv - exec?: string | undefined; - args?: string[] | undefined; - silent?: boolean | undefined; - stdio?: any[] | undefined; - uid?: number | undefined; - gid?: number | undefined; - inspectPort?: number | (() => number) | undefined; - } - export interface Address { - address: string; - port: number; - addressType: number | 'udp4' | 'udp6'; // 4, 6, -1, "udp4", "udp6" - } - /** - * A `Worker` object contains all public information and method about a worker. - * In the primary it can be obtained using `cluster.workers`. In a worker - * it can be obtained using `cluster.worker`. - * @since v0.7.0 - */ - export class Worker extends EventEmitter { - /** - * Each new worker is given its own unique id, this id is stored in the`id`. - * - * While a worker is alive, this is the key that indexes it in`cluster.workers`. - * @since v0.8.0 - */ - id: number; - /** - * All workers are created using `child_process.fork()`, the returned object - * from this function is stored as `.process`. In a worker, the global `process`is stored. - * - * See: `Child Process module`. - * - * Workers will call `process.exit(0)` if the `'disconnect'` event occurs - * on `process` and `.exitedAfterDisconnect` is not `true`. This protects against - * accidental disconnection. - * @since v0.7.0 - */ - process: child.ChildProcess; - /** - * Send a message to a worker or primary, optionally with a handle. - * - * In the primary, this sends a message to a specific worker. It is identical to `ChildProcess.send()`. - * - * In a worker, this sends a message to the primary. It is identical to`process.send()`. - * - * This example will echo back all messages from the primary: - * - * ```js - * if (cluster.isPrimary) { - * const worker = cluster.fork(); - * worker.send('hi there'); - * - * } else if (cluster.isWorker) { - * process.on('message', (msg) => { - * process.send(msg); - * }); - * } - * ``` - * @since v0.7.0 - * @param options The `options` argument, if present, is an object used to parameterize the sending of certain types of handles. `options` supports the following properties: - */ - send(message: child.Serializable, callback?: (error: Error | null) => void): boolean; - send(message: child.Serializable, sendHandle: child.SendHandle, callback?: (error: Error | null) => void): boolean; - send(message: child.Serializable, sendHandle: child.SendHandle, options?: child.MessageOptions, callback?: (error: Error | null) => void): boolean; - /** - * This function will kill the worker. In the primary worker, it does this by - * disconnecting the `worker.process`, and once disconnected, killing with`signal`. In the worker, it does it by killing the process with `signal`. - * - * The `kill()` function kills the worker process without waiting for a graceful - * disconnect, it has the same behavior as `worker.process.kill()`. - * - * This method is aliased as `worker.destroy()` for backwards compatibility. - * - * In a worker, `process.kill()` exists, but it is not this function; - * it is `kill()`. - * @since v0.9.12 - * @param [signal='SIGTERM'] Name of the kill signal to send to the worker process. - */ - kill(signal?: string): void; - destroy(signal?: string): void; - /** - * In a worker, this function will close all servers, wait for the `'close'` event - * on those servers, and then disconnect the IPC channel. - * - * In the primary, an internal message is sent to the worker causing it to call`.disconnect()` on itself. - * - * Causes `.exitedAfterDisconnect` to be set. - * - * After a server is closed, it will no longer accept new connections, - * but connections may be accepted by any other listening worker. Existing - * connections will be allowed to close as usual. When no more connections exist, - * see `server.close()`, the IPC channel to the worker will close allowing it - * to die gracefully. - * - * The above applies _only_ to server connections, client connections are not - * automatically closed by workers, and disconnect does not wait for them to close - * before exiting. - * - * In a worker, `process.disconnect` exists, but it is not this function; - * it is `disconnect()`. - * - * Because long living server connections may block workers from disconnecting, it - * may be useful to send a message, so application specific actions may be taken to - * close them. It also may be useful to implement a timeout, killing a worker if - * the `'disconnect'` event has not been emitted after some time. - * - * ```js - * if (cluster.isPrimary) { - * const worker = cluster.fork(); - * let timeout; - * - * worker.on('listening', (address) => { - * worker.send('shutdown'); - * worker.disconnect(); - * timeout = setTimeout(() => { - * worker.kill(); - * }, 2000); - * }); - * - * worker.on('disconnect', () => { - * clearTimeout(timeout); - * }); - * - * } else if (cluster.isWorker) { - * const net = require('net'); - * const server = net.createServer((socket) => { - * // Connections never end - * }); - * - * server.listen(8000); - * - * process.on('message', (msg) => { - * if (msg === 'shutdown') { - * // Initiate graceful close of any connections to server - * } - * }); - * } - * ``` - * @since v0.7.7 - * @return A reference to `worker`. - */ - disconnect(): void; - /** - * This function returns `true` if the worker is connected to its primary via its - * IPC channel, `false` otherwise. A worker is connected to its primary after it - * has been created. It is disconnected after the `'disconnect'` event is emitted. - * @since v0.11.14 - */ - isConnected(): boolean; - /** - * This function returns `true` if the worker's process has terminated (either - * because of exiting or being signaled). Otherwise, it returns `false`. - * - * ```js - * import cluster from 'cluster'; - * import http from 'http'; - * import { cpus } from 'os'; - * import process from 'process'; - * - * const numCPUs = cpus().length; - * - * if (cluster.isPrimary) { - * console.log(`Primary ${process.pid} is running`); - * - * // Fork workers. - * for (let i = 0; i < numCPUs; i++) { - * cluster.fork(); - * } - * - * cluster.on('fork', (worker) => { - * console.log('worker is dead:', worker.isDead()); - * }); - * - * cluster.on('exit', (worker, code, signal) => { - * console.log('worker is dead:', worker.isDead()); - * }); - * } else { - * // Workers can share any TCP connection. In this case, it is an HTTP server. - * http.createServer((req, res) => { - * res.writeHead(200); - * res.end(`Current process\n ${process.pid}`); - * process.kill(process.pid); - * }).listen(8000); - * } - * ``` - * @since v0.11.14 - */ - isDead(): boolean; - /** - * This property is `true` if the worker exited due to `.disconnect()`. - * If the worker exited any other way, it is `false`. If the - * worker has not exited, it is `undefined`. - * - * The boolean `worker.exitedAfterDisconnect` allows distinguishing between - * voluntary and accidental exit, the primary may choose not to respawn a worker - * based on this value. - * - * ```js - * cluster.on('exit', (worker, code, signal) => { - * if (worker.exitedAfterDisconnect === true) { - * console.log('Oh, it was just voluntary – no need to worry'); - * } - * }); - * - * // kill worker - * worker.kill(); - * ``` - * @since v6.0.0 - */ - exitedAfterDisconnect: boolean; - /** - * events.EventEmitter - * 1. disconnect - * 2. error - * 3. exit - * 4. listening - * 5. message - * 6. online - */ - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: 'disconnect', listener: () => void): this; - addListener(event: 'error', listener: (error: Error) => void): this; - addListener(event: 'exit', listener: (code: number, signal: string) => void): this; - addListener(event: 'listening', listener: (address: Address) => void): this; - addListener(event: 'message', listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. - addListener(event: 'online', listener: () => void): this; - emit(event: string | symbol, ...args: any[]): boolean; - emit(event: 'disconnect'): boolean; - emit(event: 'error', error: Error): boolean; - emit(event: 'exit', code: number, signal: string): boolean; - emit(event: 'listening', address: Address): boolean; - emit(event: 'message', message: any, handle: net.Socket | net.Server): boolean; - emit(event: 'online'): boolean; - on(event: string, listener: (...args: any[]) => void): this; - on(event: 'disconnect', listener: () => void): this; - on(event: 'error', listener: (error: Error) => void): this; - on(event: 'exit', listener: (code: number, signal: string) => void): this; - on(event: 'listening', listener: (address: Address) => void): this; - on(event: 'message', listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. - on(event: 'online', listener: () => void): this; - once(event: string, listener: (...args: any[]) => void): this; - once(event: 'disconnect', listener: () => void): this; - once(event: 'error', listener: (error: Error) => void): this; - once(event: 'exit', listener: (code: number, signal: string) => void): this; - once(event: 'listening', listener: (address: Address) => void): this; - once(event: 'message', listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. - once(event: 'online', listener: () => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: 'disconnect', listener: () => void): this; - prependListener(event: 'error', listener: (error: Error) => void): this; - prependListener(event: 'exit', listener: (code: number, signal: string) => void): this; - prependListener(event: 'listening', listener: (address: Address) => void): this; - prependListener(event: 'message', listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. - prependListener(event: 'online', listener: () => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: 'disconnect', listener: () => void): this; - prependOnceListener(event: 'error', listener: (error: Error) => void): this; - prependOnceListener(event: 'exit', listener: (code: number, signal: string) => void): this; - prependOnceListener(event: 'listening', listener: (address: Address) => void): this; - prependOnceListener(event: 'message', listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. - prependOnceListener(event: 'online', listener: () => void): this; - } - export interface Cluster extends EventEmitter { - disconnect(callback?: () => void): void; - fork(env?: any): Worker; - /** @deprecated since v16.0.0 - use isPrimary. */ - readonly isMaster: boolean; - readonly isPrimary: boolean; - readonly isWorker: boolean; - schedulingPolicy: number; - readonly settings: ClusterSettings; - /** @deprecated since v16.0.0 - use setupPrimary. */ - setupMaster(settings?: ClusterSettings): void; - /** - * `setupPrimary` is used to change the default 'fork' behavior. Once called, the settings will be present in cluster.settings. - */ - setupPrimary(settings?: ClusterSettings): void; - readonly worker?: Worker | undefined; - readonly workers?: NodeJS.Dict | undefined; - readonly SCHED_NONE: number; - readonly SCHED_RR: number; - /** - * events.EventEmitter - * 1. disconnect - * 2. exit - * 3. fork - * 4. listening - * 5. message - * 6. online - * 7. setup - */ - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: 'disconnect', listener: (worker: Worker) => void): this; - addListener(event: 'exit', listener: (worker: Worker, code: number, signal: string) => void): this; - addListener(event: 'fork', listener: (worker: Worker) => void): this; - addListener(event: 'listening', listener: (worker: Worker, address: Address) => void): this; - addListener(event: 'message', listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. - addListener(event: 'online', listener: (worker: Worker) => void): this; - addListener(event: 'setup', listener: (settings: ClusterSettings) => void): this; - emit(event: string | symbol, ...args: any[]): boolean; - emit(event: 'disconnect', worker: Worker): boolean; - emit(event: 'exit', worker: Worker, code: number, signal: string): boolean; - emit(event: 'fork', worker: Worker): boolean; - emit(event: 'listening', worker: Worker, address: Address): boolean; - emit(event: 'message', worker: Worker, message: any, handle: net.Socket | net.Server): boolean; - emit(event: 'online', worker: Worker): boolean; - emit(event: 'setup', settings: ClusterSettings): boolean; - on(event: string, listener: (...args: any[]) => void): this; - on(event: 'disconnect', listener: (worker: Worker) => void): this; - on(event: 'exit', listener: (worker: Worker, code: number, signal: string) => void): this; - on(event: 'fork', listener: (worker: Worker) => void): this; - on(event: 'listening', listener: (worker: Worker, address: Address) => void): this; - on(event: 'message', listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. - on(event: 'online', listener: (worker: Worker) => void): this; - on(event: 'setup', listener: (settings: ClusterSettings) => void): this; - once(event: string, listener: (...args: any[]) => void): this; - once(event: 'disconnect', listener: (worker: Worker) => void): this; - once(event: 'exit', listener: (worker: Worker, code: number, signal: string) => void): this; - once(event: 'fork', listener: (worker: Worker) => void): this; - once(event: 'listening', listener: (worker: Worker, address: Address) => void): this; - once(event: 'message', listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. - once(event: 'online', listener: (worker: Worker) => void): this; - once(event: 'setup', listener: (settings: ClusterSettings) => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: 'disconnect', listener: (worker: Worker) => void): this; - prependListener(event: 'exit', listener: (worker: Worker, code: number, signal: string) => void): this; - prependListener(event: 'fork', listener: (worker: Worker) => void): this; - prependListener(event: 'listening', listener: (worker: Worker, address: Address) => void): this; - // the handle is a net.Socket or net.Server object, or undefined. - prependListener(event: 'message', listener: (worker: Worker, message: any, handle?: net.Socket | net.Server) => void): this; - prependListener(event: 'online', listener: (worker: Worker) => void): this; - prependListener(event: 'setup', listener: (settings: ClusterSettings) => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: 'disconnect', listener: (worker: Worker) => void): this; - prependOnceListener(event: 'exit', listener: (worker: Worker, code: number, signal: string) => void): this; - prependOnceListener(event: 'fork', listener: (worker: Worker) => void): this; - prependOnceListener(event: 'listening', listener: (worker: Worker, address: Address) => void): this; - // the handle is a net.Socket or net.Server object, or undefined. - prependOnceListener(event: 'message', listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): this; - prependOnceListener(event: 'online', listener: (worker: Worker) => void): this; - prependOnceListener(event: 'setup', listener: (settings: ClusterSettings) => void): this; - } - const cluster: Cluster; - export default cluster; -} -declare module 'node:cluster' { - export * from 'cluster'; - export { default as default } from 'cluster'; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/console.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/console.d.ts deleted file mode 100755 index 16c9137a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/console.d.ts +++ /dev/null @@ -1,412 +0,0 @@ -/** - * The `console` module provides a simple debugging console that is similar to the - * JavaScript console mechanism provided by web browsers. - * - * The module exports two specific components: - * - * * A `Console` class with methods such as `console.log()`, `console.error()` and`console.warn()` that can be used to write to any Node.js stream. - * * A global `console` instance configured to write to `process.stdout` and `process.stderr`. The global `console` can be used without calling`require('console')`. - * - * _**Warning**_: The global console object's methods are neither consistently - * synchronous like the browser APIs they resemble, nor are they consistently - * asynchronous like all other Node.js streams. See the `note on process I/O` for - * more information. - * - * Example using the global `console`: - * - * ```js - * console.log('hello world'); - * // Prints: hello world, to stdout - * console.log('hello %s', 'world'); - * // Prints: hello world, to stdout - * console.error(new Error('Whoops, something bad happened')); - * // Prints error message and stack trace to stderr: - * // Error: Whoops, something bad happened - * // at [eval]:5:15 - * // at Script.runInThisContext (node:vm:132:18) - * // at Object.runInThisContext (node:vm:309:38) - * // at node:internal/process/execution:77:19 - * // at [eval]-wrapper:6:22 - * // at evalScript (node:internal/process/execution:76:60) - * // at node:internal/main/eval_string:23:3 - * - * const name = 'Will Robinson'; - * console.warn(`Danger ${name}! Danger!`); - * // Prints: Danger Will Robinson! Danger!, to stderr - * ``` - * - * Example using the `Console` class: - * - * ```js - * const out = getStreamSomehow(); - * const err = getStreamSomehow(); - * const myConsole = new console.Console(out, err); - * - * myConsole.log('hello world'); - * // Prints: hello world, to out - * myConsole.log('hello %s', 'world'); - * // Prints: hello world, to out - * myConsole.error(new Error('Whoops, something bad happened')); - * // Prints: [Error: Whoops, something bad happened], to err - * - * const name = 'Will Robinson'; - * myConsole.warn(`Danger ${name}! Danger!`); - * // Prints: Danger Will Robinson! Danger!, to err - * ``` - * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/console.js) - */ -declare module 'console' { - import console = require('node:console'); - export = console; -} -declare module 'node:console' { - import { InspectOptions } from 'node:util'; - global { - // This needs to be global to avoid TS2403 in case lib.dom.d.ts is present in the same build - interface Console { - Console: console.ConsoleConstructor; - /** - * `console.assert()` writes a message if `value` is [falsy](https://developer.mozilla.org/en-US/docs/Glossary/Falsy) or omitted. It only - * writes a message and does not otherwise affect execution. The output always - * starts with `"Assertion failed"`. If provided, `message` is formatted using `util.format()`. - * - * If `value` is [truthy](https://developer.mozilla.org/en-US/docs/Glossary/Truthy), nothing happens. - * - * ```js - * console.assert(true, 'does nothing'); - * - * console.assert(false, 'Whoops %s work', 'didn\'t'); - * // Assertion failed: Whoops didn't work - * - * console.assert(); - * // Assertion failed - * ``` - * @since v0.1.101 - * @param value The value tested for being truthy. - * @param message All arguments besides `value` are used as error message. - */ - assert(value: any, message?: string, ...optionalParams: any[]): void; - /** - * When `stdout` is a TTY, calling `console.clear()` will attempt to clear the - * TTY. When `stdout` is not a TTY, this method does nothing. - * - * The specific operation of `console.clear()` can vary across operating systems - * and terminal types. For most Linux operating systems, `console.clear()`operates similarly to the `clear` shell command. On Windows, `console.clear()`will clear only the output in the - * current terminal viewport for the Node.js - * binary. - * @since v8.3.0 - */ - clear(): void; - /** - * Maintains an internal counter specific to `label` and outputs to `stdout` the - * number of times `console.count()` has been called with the given `label`. - * - * ```js - * > console.count() - * default: 1 - * undefined - * > console.count('default') - * default: 2 - * undefined - * > console.count('abc') - * abc: 1 - * undefined - * > console.count('xyz') - * xyz: 1 - * undefined - * > console.count('abc') - * abc: 2 - * undefined - * > console.count() - * default: 3 - * undefined - * > - * ``` - * @since v8.3.0 - * @param label The display label for the counter. - */ - count(label?: string): void; - /** - * Resets the internal counter specific to `label`. - * - * ```js - * > console.count('abc'); - * abc: 1 - * undefined - * > console.countReset('abc'); - * undefined - * > console.count('abc'); - * abc: 1 - * undefined - * > - * ``` - * @since v8.3.0 - * @param label The display label for the counter. - */ - countReset(label?: string): void; - /** - * The `console.debug()` function is an alias for {@link log}. - * @since v8.0.0 - */ - debug(message?: any, ...optionalParams: any[]): void; - /** - * Uses `util.inspect()` on `obj` and prints the resulting string to `stdout`. - * This function bypasses any custom `inspect()` function defined on `obj`. - * @since v0.1.101 - */ - dir(obj: any, options?: InspectOptions): void; - /** - * This method calls `console.log()` passing it the arguments received. - * This method does not produce any XML formatting. - * @since v8.0.0 - */ - dirxml(...data: any[]): void; - /** - * Prints to `stderr` with newline. Multiple arguments can be passed, with the - * first used as the primary message and all additional used as substitution - * values similar to [`printf(3)`](http://man7.org/linux/man-pages/man3/printf.3.html) (the arguments are all passed to `util.format()`). - * - * ```js - * const code = 5; - * console.error('error #%d', code); - * // Prints: error #5, to stderr - * console.error('error', code); - * // Prints: error 5, to stderr - * ``` - * - * If formatting elements (e.g. `%d`) are not found in the first string then `util.inspect()` is called on each argument and the resulting string - * values are concatenated. See `util.format()` for more information. - * @since v0.1.100 - */ - error(message?: any, ...optionalParams: any[]): void; - /** - * Increases indentation of subsequent lines by spaces for `groupIndentation`length. - * - * If one or more `label`s are provided, those are printed first without the - * additional indentation. - * @since v8.5.0 - */ - group(...label: any[]): void; - /** - * An alias for {@link group}. - * @since v8.5.0 - */ - groupCollapsed(...label: any[]): void; - /** - * Decreases indentation of subsequent lines by spaces for `groupIndentation`length. - * @since v8.5.0 - */ - groupEnd(): void; - /** - * The `console.info()` function is an alias for {@link log}. - * @since v0.1.100 - */ - info(message?: any, ...optionalParams: any[]): void; - /** - * Prints to `stdout` with newline. Multiple arguments can be passed, with the - * first used as the primary message and all additional used as substitution - * values similar to [`printf(3)`](http://man7.org/linux/man-pages/man3/printf.3.html) (the arguments are all passed to `util.format()`). - * - * ```js - * const count = 5; - * console.log('count: %d', count); - * // Prints: count: 5, to stdout - * console.log('count:', count); - * // Prints: count: 5, to stdout - * ``` - * - * See `util.format()` for more information. - * @since v0.1.100 - */ - log(message?: any, ...optionalParams: any[]): void; - /** - * Try to construct a table with the columns of the properties of `tabularData`(or use `properties`) and rows of `tabularData` and log it. Falls back to just - * logging the argument if it can’t be parsed as tabular. - * - * ```js - * // These can't be parsed as tabular data - * console.table(Symbol()); - * // Symbol() - * - * console.table(undefined); - * // undefined - * - * console.table([{ a: 1, b: 'Y' }, { a: 'Z', b: 2 }]); - * // ┌─────────┬─────┬─────┐ - * // │ (index) │ a │ b │ - * // ├─────────┼─────┼─────┤ - * // │ 0 │ 1 │ 'Y' │ - * // │ 1 │ 'Z' │ 2 │ - * // └─────────┴─────┴─────┘ - * - * console.table([{ a: 1, b: 'Y' }, { a: 'Z', b: 2 }], ['a']); - * // ┌─────────┬─────┐ - * // │ (index) │ a │ - * // ├─────────┼─────┤ - * // │ 0 │ 1 │ - * // │ 1 │ 'Z' │ - * // └─────────┴─────┘ - * ``` - * @since v10.0.0 - * @param properties Alternate properties for constructing the table. - */ - table(tabularData: any, properties?: ReadonlyArray): void; - /** - * Starts a timer that can be used to compute the duration of an operation. Timers - * are identified by a unique `label`. Use the same `label` when calling {@link timeEnd} to stop the timer and output the elapsed time in - * suitable time units to `stdout`. For example, if the elapsed - * time is 3869ms, `console.timeEnd()` displays "3.869s". - * @since v0.1.104 - */ - time(label?: string): void; - /** - * Stops a timer that was previously started by calling {@link time} and - * prints the result to `stdout`: - * - * ```js - * console.time('100-elements'); - * for (let i = 0; i < 100; i++) {} - * console.timeEnd('100-elements'); - * // prints 100-elements: 225.438ms - * ``` - * @since v0.1.104 - */ - timeEnd(label?: string): void; - /** - * For a timer that was previously started by calling {@link time}, prints - * the elapsed time and other `data` arguments to `stdout`: - * - * ```js - * console.time('process'); - * const value = expensiveProcess1(); // Returns 42 - * console.timeLog('process', value); - * // Prints "process: 365.227ms 42". - * doExpensiveProcess2(value); - * console.timeEnd('process'); - * ``` - * @since v10.7.0 - */ - timeLog(label?: string, ...data: any[]): void; - /** - * Prints to `stderr` the string `'Trace: '`, followed by the `util.format()` formatted message and stack trace to the current position in the code. - * - * ```js - * console.trace('Show me'); - * // Prints: (stack trace will vary based on where trace is called) - * // Trace: Show me - * // at repl:2:9 - * // at REPLServer.defaultEval (repl.js:248:27) - * // at bound (domain.js:287:14) - * // at REPLServer.runBound [as eval] (domain.js:300:12) - * // at REPLServer. (repl.js:412:12) - * // at emitOne (events.js:82:20) - * // at REPLServer.emit (events.js:169:7) - * // at REPLServer.Interface._onLine (readline.js:210:10) - * // at REPLServer.Interface._line (readline.js:549:8) - * // at REPLServer.Interface._ttyWrite (readline.js:826:14) - * ``` - * @since v0.1.104 - */ - trace(message?: any, ...optionalParams: any[]): void; - /** - * The `console.warn()` function is an alias for {@link error}. - * @since v0.1.100 - */ - warn(message?: any, ...optionalParams: any[]): void; - // --- Inspector mode only --- - /** - * This method does not display anything unless used in the inspector. - * Starts a JavaScript CPU profile with an optional label. - */ - profile(label?: string): void; - /** - * This method does not display anything unless used in the inspector. - * Stops the current JavaScript CPU profiling session if one has been started and prints the report to the Profiles panel of the inspector. - */ - profileEnd(label?: string): void; - /** - * This method does not display anything unless used in the inspector. - * Adds an event with the label `label` to the Timeline panel of the inspector. - */ - timeStamp(label?: string): void; - } - /** - * The `console` module provides a simple debugging console that is similar to the - * JavaScript console mechanism provided by web browsers. - * - * The module exports two specific components: - * - * * A `Console` class with methods such as `console.log()`, `console.error()` and`console.warn()` that can be used to write to any Node.js stream. - * * A global `console` instance configured to write to `process.stdout` and `process.stderr`. The global `console` can be used without calling`require('console')`. - * - * _**Warning**_: The global console object's methods are neither consistently - * synchronous like the browser APIs they resemble, nor are they consistently - * asynchronous like all other Node.js streams. See the `note on process I/O` for - * more information. - * - * Example using the global `console`: - * - * ```js - * console.log('hello world'); - * // Prints: hello world, to stdout - * console.log('hello %s', 'world'); - * // Prints: hello world, to stdout - * console.error(new Error('Whoops, something bad happened')); - * // Prints error message and stack trace to stderr: - * // Error: Whoops, something bad happened - * // at [eval]:5:15 - * // at Script.runInThisContext (node:vm:132:18) - * // at Object.runInThisContext (node:vm:309:38) - * // at node:internal/process/execution:77:19 - * // at [eval]-wrapper:6:22 - * // at evalScript (node:internal/process/execution:76:60) - * // at node:internal/main/eval_string:23:3 - * - * const name = 'Will Robinson'; - * console.warn(`Danger ${name}! Danger!`); - * // Prints: Danger Will Robinson! Danger!, to stderr - * ``` - * - * Example using the `Console` class: - * - * ```js - * const out = getStreamSomehow(); - * const err = getStreamSomehow(); - * const myConsole = new console.Console(out, err); - * - * myConsole.log('hello world'); - * // Prints: hello world, to out - * myConsole.log('hello %s', 'world'); - * // Prints: hello world, to out - * myConsole.error(new Error('Whoops, something bad happened')); - * // Prints: [Error: Whoops, something bad happened], to err - * - * const name = 'Will Robinson'; - * myConsole.warn(`Danger ${name}! Danger!`); - * // Prints: Danger Will Robinson! Danger!, to err - * ``` - * @see [source](https://github.com/nodejs/node/blob/v16.4.2/lib/console.js) - */ - namespace console { - interface ConsoleConstructorOptions { - stdout: NodeJS.WritableStream; - stderr?: NodeJS.WritableStream | undefined; - ignoreErrors?: boolean | undefined; - colorMode?: boolean | 'auto' | undefined; - inspectOptions?: InspectOptions | undefined; - /** - * Set group indentation - * @default 2 - */ - groupIndentation?: number | undefined; - } - interface ConsoleConstructor { - prototype: Console; - new (stdout: NodeJS.WritableStream, stderr?: NodeJS.WritableStream, ignoreErrors?: boolean): Console; - new (options: ConsoleConstructorOptions): Console; - } - } - var console: Console; - } - export = globalThis.console; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/constants.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/constants.d.ts deleted file mode 100755 index 208020dc..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/constants.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -/** @deprecated since v6.3.0 - use constants property exposed by the relevant module instead. */ -declare module 'constants' { - import { constants as osConstants, SignalConstants } from 'node:os'; - import { constants as cryptoConstants } from 'node:crypto'; - import { constants as fsConstants } from 'node:fs'; - - const exp: typeof osConstants.errno & - typeof osConstants.priority & - SignalConstants & - typeof cryptoConstants & - typeof fsConstants; - export = exp; -} - -declare module 'node:constants' { - import constants = require('constants'); - export = constants; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/crypto.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/crypto.d.ts deleted file mode 100755 index 888bf729..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/crypto.d.ts +++ /dev/null @@ -1,3964 +0,0 @@ -/** - * The `crypto` module provides cryptographic functionality that includes a set of - * wrappers for OpenSSL's hash, HMAC, cipher, decipher, sign, and verify functions. - * - * ```js - * const { createHmac } = await import('crypto'); - * - * const secret = 'abcdefg'; - * const hash = createHmac('sha256', secret) - * .update('I love cupcakes') - * .digest('hex'); - * console.log(hash); - * // Prints: - * // c0fa1bc00531bd78ef38c628449c5102aeabd49b5dc3a2a516ea6ea959d6658e - * ``` - * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/crypto.js) - */ -declare module 'crypto' { - import * as stream from 'node:stream'; - import { PeerCertificate } from 'node:tls'; - /** - * SPKAC is a Certificate Signing Request mechanism originally implemented by - * Netscape and was specified formally as part of [HTML5's `keygen` element](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/keygen). - * - * `` is deprecated since [HTML 5.2](https://www.w3.org/TR/html52/changes.html#features-removed) and new projects - * should not use this element anymore. - * - * The `crypto` module provides the `Certificate` class for working with SPKAC - * data. The most common usage is handling output generated by the HTML5`` element. Node.js uses [OpenSSL's SPKAC - * implementation](https://www.openssl.org/docs/man1.1.0/apps/openssl-spkac.html) internally. - * @since v0.11.8 - */ - class Certificate { - /** - * ```js - * const { Certificate } = await import('crypto'); - * const spkac = getSpkacSomehow(); - * const challenge = Certificate.exportChallenge(spkac); - * console.log(challenge.toString('utf8')); - * // Prints: the challenge as a UTF8 string - * ``` - * @since v9.0.0 - * @param encoding The `encoding` of the `spkac` string. - * @return The challenge component of the `spkac` data structure, which includes a public key and a challenge. - */ - static exportChallenge(spkac: BinaryLike): Buffer; - /** - * ```js - * const { Certificate } = await import('crypto'); - * const spkac = getSpkacSomehow(); - * const publicKey = Certificate.exportPublicKey(spkac); - * console.log(publicKey); - * // Prints: the public key as - * ``` - * @since v9.0.0 - * @param encoding The `encoding` of the `spkac` string. - * @return The public key component of the `spkac` data structure, which includes a public key and a challenge. - */ - static exportPublicKey(spkac: BinaryLike, encoding?: string): Buffer; - /** - * ```js - * import { Buffer } from 'buffer'; - * const { Certificate } = await import('crypto'); - * - * const spkac = getSpkacSomehow(); - * console.log(Certificate.verifySpkac(Buffer.from(spkac))); - * // Prints: true or false - * ``` - * @since v9.0.0 - * @param encoding The `encoding` of the `spkac` string. - * @return `true` if the given `spkac` data structure is valid, `false` otherwise. - */ - static verifySpkac(spkac: NodeJS.ArrayBufferView): boolean; - /** - * @deprecated - * @param spkac - * @returns The challenge component of the `spkac` data structure, - * which includes a public key and a challenge. - */ - exportChallenge(spkac: BinaryLike): Buffer; - /** - * @deprecated - * @param spkac - * @param encoding The encoding of the spkac string. - * @returns The public key component of the `spkac` data structure, - * which includes a public key and a challenge. - */ - exportPublicKey(spkac: BinaryLike, encoding?: string): Buffer; - /** - * @deprecated - * @param spkac - * @returns `true` if the given `spkac` data structure is valid, - * `false` otherwise. - */ - verifySpkac(spkac: NodeJS.ArrayBufferView): boolean; - } - namespace constants { - // https://nodejs.org/dist/latest-v10.x/docs/api/crypto.html#crypto_crypto_constants - const OPENSSL_VERSION_NUMBER: number; - /** Applies multiple bug workarounds within OpenSSL. See https://www.openssl.org/docs/man1.0.2/ssl/SSL_CTX_set_options.html for detail. */ - const SSL_OP_ALL: number; - /** Allows legacy insecure renegotiation between OpenSSL and unpatched clients or servers. See https://www.openssl.org/docs/man1.0.2/ssl/SSL_CTX_set_options.html. */ - const SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION: number; - /** Attempts to use the server's preferences instead of the client's when selecting a cipher. See https://www.openssl.org/docs/man1.0.2/ssl/SSL_CTX_set_options.html. */ - const SSL_OP_CIPHER_SERVER_PREFERENCE: number; - /** Instructs OpenSSL to use Cisco's "speshul" version of DTLS_BAD_VER. */ - const SSL_OP_CISCO_ANYCONNECT: number; - /** Instructs OpenSSL to turn on cookie exchange. */ - const SSL_OP_COOKIE_EXCHANGE: number; - /** Instructs OpenSSL to add server-hello extension from an early version of the cryptopro draft. */ - const SSL_OP_CRYPTOPRO_TLSEXT_BUG: number; - /** Instructs OpenSSL to disable a SSL 3.0/TLS 1.0 vulnerability workaround added in OpenSSL 0.9.6d. */ - const SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS: number; - /** Instructs OpenSSL to always use the tmp_rsa key when performing RSA operations. */ - const SSL_OP_EPHEMERAL_RSA: number; - /** Allows initial connection to servers that do not support RI. */ - const SSL_OP_LEGACY_SERVER_CONNECT: number; - const SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER: number; - const SSL_OP_MICROSOFT_SESS_ID_BUG: number; - /** Instructs OpenSSL to disable the workaround for a man-in-the-middle protocol-version vulnerability in the SSL 2.0 server implementation. */ - const SSL_OP_MSIE_SSLV2_RSA_PADDING: number; - const SSL_OP_NETSCAPE_CA_DN_BUG: number; - const SSL_OP_NETSCAPE_CHALLENGE_BUG: number; - const SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG: number; - const SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG: number; - /** Instructs OpenSSL to disable support for SSL/TLS compression. */ - const SSL_OP_NO_COMPRESSION: number; - const SSL_OP_NO_QUERY_MTU: number; - /** Instructs OpenSSL to always start a new session when performing renegotiation. */ - const SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION: number; - const SSL_OP_NO_SSLv2: number; - const SSL_OP_NO_SSLv3: number; - const SSL_OP_NO_TICKET: number; - const SSL_OP_NO_TLSv1: number; - const SSL_OP_NO_TLSv1_1: number; - const SSL_OP_NO_TLSv1_2: number; - const SSL_OP_PKCS1_CHECK_1: number; - const SSL_OP_PKCS1_CHECK_2: number; - /** Instructs OpenSSL to always create a new key when using temporary/ephemeral DH parameters. */ - const SSL_OP_SINGLE_DH_USE: number; - /** Instructs OpenSSL to always create a new key when using temporary/ephemeral ECDH parameters. */ - const SSL_OP_SINGLE_ECDH_USE: number; - const SSL_OP_SSLEAY_080_CLIENT_DH_BUG: number; - const SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG: number; - const SSL_OP_TLS_BLOCK_PADDING_BUG: number; - const SSL_OP_TLS_D5_BUG: number; - /** Instructs OpenSSL to disable version rollback attack detection. */ - const SSL_OP_TLS_ROLLBACK_BUG: number; - const ENGINE_METHOD_RSA: number; - const ENGINE_METHOD_DSA: number; - const ENGINE_METHOD_DH: number; - const ENGINE_METHOD_RAND: number; - const ENGINE_METHOD_EC: number; - const ENGINE_METHOD_CIPHERS: number; - const ENGINE_METHOD_DIGESTS: number; - const ENGINE_METHOD_PKEY_METHS: number; - const ENGINE_METHOD_PKEY_ASN1_METHS: number; - const ENGINE_METHOD_ALL: number; - const ENGINE_METHOD_NONE: number; - const DH_CHECK_P_NOT_SAFE_PRIME: number; - const DH_CHECK_P_NOT_PRIME: number; - const DH_UNABLE_TO_CHECK_GENERATOR: number; - const DH_NOT_SUITABLE_GENERATOR: number; - const ALPN_ENABLED: number; - const RSA_PKCS1_PADDING: number; - const RSA_SSLV23_PADDING: number; - const RSA_NO_PADDING: number; - const RSA_PKCS1_OAEP_PADDING: number; - const RSA_X931_PADDING: number; - const RSA_PKCS1_PSS_PADDING: number; - /** Sets the salt length for RSA_PKCS1_PSS_PADDING to the digest size when signing or verifying. */ - const RSA_PSS_SALTLEN_DIGEST: number; - /** Sets the salt length for RSA_PKCS1_PSS_PADDING to the maximum permissible value when signing data. */ - const RSA_PSS_SALTLEN_MAX_SIGN: number; - /** Causes the salt length for RSA_PKCS1_PSS_PADDING to be determined automatically when verifying a signature. */ - const RSA_PSS_SALTLEN_AUTO: number; - const POINT_CONVERSION_COMPRESSED: number; - const POINT_CONVERSION_UNCOMPRESSED: number; - const POINT_CONVERSION_HYBRID: number; - /** Specifies the built-in default cipher list used by Node.js (colon-separated values). */ - const defaultCoreCipherList: string; - /** Specifies the active default cipher list used by the current Node.js process (colon-separated values). */ - const defaultCipherList: string; - } - interface HashOptions extends stream.TransformOptions { - /** - * For XOF hash functions such as `shake256`, the - * outputLength option can be used to specify the desired output length in bytes. - */ - outputLength?: number | undefined; - } - /** @deprecated since v10.0.0 */ - const fips: boolean; - /** - * Creates and returns a `Hash` object that can be used to generate hash digests - * using the given `algorithm`. Optional `options` argument controls stream - * behavior. For XOF hash functions such as `'shake256'`, the `outputLength` option - * can be used to specify the desired output length in bytes. - * - * The `algorithm` is dependent on the available algorithms supported by the - * version of OpenSSL on the platform. Examples are `'sha256'`, `'sha512'`, etc. - * On recent releases of OpenSSL, `openssl list -digest-algorithms` will - * display the available digest algorithms. - * - * Example: generating the sha256 sum of a file - * - * ```js - * import { - * createReadStream - * } from 'fs'; - * import { argv } from 'process'; - * const { - * createHash - * } = await import('crypto'); - * - * const filename = argv[2]; - * - * const hash = createHash('sha256'); - * - * const input = createReadStream(filename); - * input.on('readable', () => { - * // Only one element is going to be produced by the - * // hash stream. - * const data = input.read(); - * if (data) - * hash.update(data); - * else { - * console.log(`${hash.digest('hex')} ${filename}`); - * } - * }); - * ``` - * @since v0.1.92 - * @param options `stream.transform` options - */ - function createHash(algorithm: string, options?: HashOptions): Hash; - /** - * Creates and returns an `Hmac` object that uses the given `algorithm` and `key`. - * Optional `options` argument controls stream behavior. - * - * The `algorithm` is dependent on the available algorithms supported by the - * version of OpenSSL on the platform. Examples are `'sha256'`, `'sha512'`, etc. - * On recent releases of OpenSSL, `openssl list -digest-algorithms` will - * display the available digest algorithms. - * - * The `key` is the HMAC key used to generate the cryptographic HMAC hash. If it is - * a `KeyObject`, its type must be `secret`. - * - * Example: generating the sha256 HMAC of a file - * - * ```js - * import { - * createReadStream - * } from 'fs'; - * import { argv } from 'process'; - * const { - * createHmac - * } = await import('crypto'); - * - * const filename = argv[2]; - * - * const hmac = createHmac('sha256', 'a secret'); - * - * const input = createReadStream(filename); - * input.on('readable', () => { - * // Only one element is going to be produced by the - * // hash stream. - * const data = input.read(); - * if (data) - * hmac.update(data); - * else { - * console.log(`${hmac.digest('hex')} ${filename}`); - * } - * }); - * ``` - * @since v0.1.94 - * @param options `stream.transform` options - */ - function createHmac(algorithm: string, key: BinaryLike | KeyObject, options?: stream.TransformOptions): Hmac; - // https://nodejs.org/api/buffer.html#buffer_buffers_and_character_encodings - type BinaryToTextEncoding = 'base64' | 'base64url' | 'hex' | 'binary'; - type CharacterEncoding = 'utf8' | 'utf-8' | 'utf16le' | 'latin1'; - type LegacyCharacterEncoding = 'ascii' | 'binary' | 'ucs2' | 'ucs-2'; - type Encoding = BinaryToTextEncoding | CharacterEncoding | LegacyCharacterEncoding; - type ECDHKeyFormat = 'compressed' | 'uncompressed' | 'hybrid'; - /** - * The `Hash` class is a utility for creating hash digests of data. It can be - * used in one of two ways: - * - * * As a `stream` that is both readable and writable, where data is written - * to produce a computed hash digest on the readable side, or - * * Using the `hash.update()` and `hash.digest()` methods to produce the - * computed hash. - * - * The {@link createHash} method is used to create `Hash` instances. `Hash`objects are not to be created directly using the `new` keyword. - * - * Example: Using `Hash` objects as streams: - * - * ```js - * const { - * createHash - * } = await import('crypto'); - * - * const hash = createHash('sha256'); - * - * hash.on('readable', () => { - * // Only one element is going to be produced by the - * // hash stream. - * const data = hash.read(); - * if (data) { - * console.log(data.toString('hex')); - * // Prints: - * // 6a2da20943931e9834fc12cfe5bb47bbd9ae43489a30726962b576f4e3993e50 - * } - * }); - * - * hash.write('some data to hash'); - * hash.end(); - * ``` - * - * Example: Using `Hash` and piped streams: - * - * ```js - * import { createReadStream } from 'fs'; - * import { stdout } from 'process'; - * const { createHash } = await import('crypto'); - * - * const hash = createHash('sha256'); - * - * const input = createReadStream('test.js'); - * input.pipe(hash).setEncoding('hex').pipe(stdout); - * ``` - * - * Example: Using the `hash.update()` and `hash.digest()` methods: - * - * ```js - * const { - * createHash - * } = await import('crypto'); - * - * const hash = createHash('sha256'); - * - * hash.update('some data to hash'); - * console.log(hash.digest('hex')); - * // Prints: - * // 6a2da20943931e9834fc12cfe5bb47bbd9ae43489a30726962b576f4e3993e50 - * ``` - * @since v0.1.92 - */ - class Hash extends stream.Transform { - private constructor(); - /** - * Creates a new `Hash` object that contains a deep copy of the internal state - * of the current `Hash` object. - * - * The optional `options` argument controls stream behavior. For XOF hash - * functions such as `'shake256'`, the `outputLength` option can be used to - * specify the desired output length in bytes. - * - * An error is thrown when an attempt is made to copy the `Hash` object after - * its `hash.digest()` method has been called. - * - * ```js - * // Calculate a rolling hash. - * const { - * createHash - * } = await import('crypto'); - * - * const hash = createHash('sha256'); - * - * hash.update('one'); - * console.log(hash.copy().digest('hex')); - * - * hash.update('two'); - * console.log(hash.copy().digest('hex')); - * - * hash.update('three'); - * console.log(hash.copy().digest('hex')); - * - * // Etc. - * ``` - * @since v13.1.0 - * @param options `stream.transform` options - */ - copy(options?: stream.TransformOptions): Hash; - /** - * Updates the hash content with the given `data`, the encoding of which - * is given in `inputEncoding`. - * If `encoding` is not provided, and the `data` is a string, an - * encoding of `'utf8'` is enforced. If `data` is a `Buffer`, `TypedArray`, or`DataView`, then `inputEncoding` is ignored. - * - * This can be called many times with new data as it is streamed. - * @since v0.1.92 - * @param inputEncoding The `encoding` of the `data` string. - */ - update(data: BinaryLike): Hash; - update(data: string, inputEncoding: Encoding): Hash; - /** - * Calculates the digest of all of the data passed to be hashed (using the `hash.update()` method). - * If `encoding` is provided a string will be returned; otherwise - * a `Buffer` is returned. - * - * The `Hash` object can not be used again after `hash.digest()` method has been - * called. Multiple calls will cause an error to be thrown. - * @since v0.1.92 - * @param encoding The `encoding` of the return value. - */ - digest(): Buffer; - digest(encoding: BinaryToTextEncoding): string; - } - /** - * The `Hmac` class is a utility for creating cryptographic HMAC digests. It can - * be used in one of two ways: - * - * * As a `stream` that is both readable and writable, where data is written - * to produce a computed HMAC digest on the readable side, or - * * Using the `hmac.update()` and `hmac.digest()` methods to produce the - * computed HMAC digest. - * - * The {@link createHmac} method is used to create `Hmac` instances. `Hmac`objects are not to be created directly using the `new` keyword. - * - * Example: Using `Hmac` objects as streams: - * - * ```js - * const { - * createHmac - * } = await import('crypto'); - * - * const hmac = createHmac('sha256', 'a secret'); - * - * hmac.on('readable', () => { - * // Only one element is going to be produced by the - * // hash stream. - * const data = hmac.read(); - * if (data) { - * console.log(data.toString('hex')); - * // Prints: - * // 7fd04df92f636fd450bc841c9418e5825c17f33ad9c87c518115a45971f7f77e - * } - * }); - * - * hmac.write('some data to hash'); - * hmac.end(); - * ``` - * - * Example: Using `Hmac` and piped streams: - * - * ```js - * import { createReadStream } from 'fs'; - * import { stdout } from 'process'; - * const { - * createHmac - * } = await import('crypto'); - * - * const hmac = createHmac('sha256', 'a secret'); - * - * const input = createReadStream('test.js'); - * input.pipe(hmac).pipe(stdout); - * ``` - * - * Example: Using the `hmac.update()` and `hmac.digest()` methods: - * - * ```js - * const { - * createHmac - * } = await import('crypto'); - * - * const hmac = createHmac('sha256', 'a secret'); - * - * hmac.update('some data to hash'); - * console.log(hmac.digest('hex')); - * // Prints: - * // 7fd04df92f636fd450bc841c9418e5825c17f33ad9c87c518115a45971f7f77e - * ``` - * @since v0.1.94 - */ - class Hmac extends stream.Transform { - private constructor(); - /** - * Updates the `Hmac` content with the given `data`, the encoding of which - * is given in `inputEncoding`. - * If `encoding` is not provided, and the `data` is a string, an - * encoding of `'utf8'` is enforced. If `data` is a `Buffer`, `TypedArray`, or`DataView`, then `inputEncoding` is ignored. - * - * This can be called many times with new data as it is streamed. - * @since v0.1.94 - * @param inputEncoding The `encoding` of the `data` string. - */ - update(data: BinaryLike): Hmac; - update(data: string, inputEncoding: Encoding): Hmac; - /** - * Calculates the HMAC digest of all of the data passed using `hmac.update()`. - * If `encoding` is - * provided a string is returned; otherwise a `Buffer` is returned; - * - * The `Hmac` object can not be used again after `hmac.digest()` has been - * called. Multiple calls to `hmac.digest()` will result in an error being thrown. - * @since v0.1.94 - * @param encoding The `encoding` of the return value. - */ - digest(): Buffer; - digest(encoding: BinaryToTextEncoding): string; - } - type KeyObjectType = 'secret' | 'public' | 'private'; - interface KeyExportOptions { - type: 'pkcs1' | 'spki' | 'pkcs8' | 'sec1'; - format: T; - cipher?: string | undefined; - passphrase?: string | Buffer | undefined; - } - interface JwkKeyExportOptions { - format: 'jwk'; - } - interface JsonWebKey { - crv?: string | undefined; - d?: string | undefined; - dp?: string | undefined; - dq?: string | undefined; - e?: string | undefined; - k?: string | undefined; - kty?: string | undefined; - n?: string | undefined; - p?: string | undefined; - q?: string | undefined; - qi?: string | undefined; - x?: string | undefined; - y?: string | undefined; - [key: string]: unknown; - } - interface AsymmetricKeyDetails { - /** - * Key size in bits (RSA, DSA). - */ - modulusLength?: number | undefined; - /** - * Public exponent (RSA). - */ - publicExponent?: bigint | undefined; - /** - * Name of the message digest (RSA-PSS). - */ - hashAlgorithm?: string | undefined; - /** - * Name of the message digest used by MGF1 (RSA-PSS). - */ - mgf1HashAlgorithm?: string | undefined; - /** - * Minimal salt length in bytes (RSA-PSS). - */ - saltLength?: number | undefined; - /** - * Size of q in bits (DSA). - */ - divisorLength?: number | undefined; - /** - * Name of the curve (EC). - */ - namedCurve?: string | undefined; - } - /** - * Node.js uses a `KeyObject` class to represent a symmetric or asymmetric key, - * and each kind of key exposes different functions. The {@link createSecretKey}, {@link createPublicKey} and {@link createPrivateKey} methods are used to create `KeyObject`instances. `KeyObject` - * objects are not to be created directly using the `new`keyword. - * - * Most applications should consider using the new `KeyObject` API instead of - * passing keys as strings or `Buffer`s due to improved security features. - * - * `KeyObject` instances can be passed to other threads via `postMessage()`. - * The receiver obtains a cloned `KeyObject`, and the `KeyObject` does not need to - * be listed in the `transferList` argument. - * @since v11.6.0 - */ - class KeyObject { - private constructor(); - /** - * Example: Converting a `CryptoKey` instance to a `KeyObject`: - * - * ```js - * const { webcrypto, KeyObject } = await import('crypto'); - * const { subtle } = webcrypto; - * - * const key = await subtle.generateKey({ - * name: 'HMAC', - * hash: 'SHA-256', - * length: 256 - * }, true, ['sign', 'verify']); - * - * const keyObject = KeyObject.from(key); - * console.log(keyObject.symmetricKeySize); - * // Prints: 32 (symmetric key size in bytes) - * ``` - * @since v15.0.0 - */ - static from(key: webcrypto.CryptoKey): KeyObject; - /** - * For asymmetric keys, this property represents the type of the key. Supported key - * types are: - * - * * `'rsa'` (OID 1.2.840.113549.1.1.1) - * * `'rsa-pss'` (OID 1.2.840.113549.1.1.10) - * * `'dsa'` (OID 1.2.840.10040.4.1) - * * `'ec'` (OID 1.2.840.10045.2.1) - * * `'x25519'` (OID 1.3.101.110) - * * `'x448'` (OID 1.3.101.111) - * * `'ed25519'` (OID 1.3.101.112) - * * `'ed448'` (OID 1.3.101.113) - * * `'dh'` (OID 1.2.840.113549.1.3.1) - * - * This property is `undefined` for unrecognized `KeyObject` types and symmetric - * keys. - * @since v11.6.0 - */ - asymmetricKeyType?: KeyType | undefined; - /** - * For asymmetric keys, this property represents the size of the embedded key in - * bytes. This property is `undefined` for symmetric keys. - */ - asymmetricKeySize?: number | undefined; - /** - * This property exists only on asymmetric keys. Depending on the type of the key, - * this object contains information about the key. None of the information obtained - * through this property can be used to uniquely identify a key or to compromise - * the security of the key. - * - * For RSA-PSS keys, if the key material contains a `RSASSA-PSS-params` sequence, - * the `hashAlgorithm`, `mgf1HashAlgorithm`, and `saltLength` properties will be - * set. - * - * Other key details might be exposed via this API using additional attributes. - * @since v15.7.0 - */ - asymmetricKeyDetails?: AsymmetricKeyDetails | undefined; - /** - * For symmetric keys, the following encoding options can be used: - * - * For public keys, the following encoding options can be used: - * - * For private keys, the following encoding options can be used: - * - * The result type depends on the selected encoding format, when PEM the - * result is a string, when DER it will be a buffer containing the data - * encoded as DER, when [JWK](https://tools.ietf.org/html/rfc7517) it will be an object. - * - * When [JWK](https://tools.ietf.org/html/rfc7517) encoding format was selected, all other encoding options are - * ignored. - * - * PKCS#1, SEC1, and PKCS#8 type keys can be encrypted by using a combination of - * the `cipher` and `format` options. The PKCS#8 `type` can be used with any`format` to encrypt any key algorithm (RSA, EC, or DH) by specifying a`cipher`. PKCS#1 and SEC1 can only be - * encrypted by specifying a `cipher`when the PEM `format` is used. For maximum compatibility, use PKCS#8 for - * encrypted private keys. Since PKCS#8 defines its own - * encryption mechanism, PEM-level encryption is not supported when encrypting - * a PKCS#8 key. See [RFC 5208](https://www.rfc-editor.org/rfc/rfc5208.txt) for PKCS#8 encryption and [RFC 1421](https://www.rfc-editor.org/rfc/rfc1421.txt) for - * PKCS#1 and SEC1 encryption. - * @since v11.6.0 - */ - export(options: KeyExportOptions<'pem'>): string | Buffer; - export(options?: KeyExportOptions<'der'>): Buffer; - export(options?: JwkKeyExportOptions): JsonWebKey; - /** - * For secret keys, this property represents the size of the key in bytes. This - * property is `undefined` for asymmetric keys. - * @since v11.6.0 - */ - symmetricKeySize?: number | undefined; - /** - * Depending on the type of this `KeyObject`, this property is either`'secret'` for secret (symmetric) keys, `'public'` for public (asymmetric) keys - * or `'private'` for private (asymmetric) keys. - * @since v11.6.0 - */ - type: KeyObjectType; - } - type CipherCCMTypes = 'aes-128-ccm' | 'aes-192-ccm' | 'aes-256-ccm' | 'chacha20-poly1305'; - type CipherGCMTypes = 'aes-128-gcm' | 'aes-192-gcm' | 'aes-256-gcm'; - type CipherOCBTypes = 'aes-128-ocb' | 'aes-192-ocb' | 'aes-256-ocb'; - type BinaryLike = string | NodeJS.ArrayBufferView; - type CipherKey = BinaryLike | KeyObject; - interface CipherCCMOptions extends stream.TransformOptions { - authTagLength: number; - } - interface CipherGCMOptions extends stream.TransformOptions { - authTagLength?: number | undefined; - } - interface CipherOCBOptions extends stream.TransformOptions { - authTagLength: number; - } - /** - * Creates and returns a `Cipher` object that uses the given `algorithm` and`password`. - * - * The `options` argument controls stream behavior and is optional except when a - * cipher in CCM or OCB mode (e.g. `'aes-128-ccm'`) is used. In that case, the`authTagLength` option is required and specifies the length of the - * authentication tag in bytes, see `CCM mode`. In GCM mode, the `authTagLength`option is not required but can be used to set the length of the authentication - * tag that will be returned by `getAuthTag()` and defaults to 16 bytes. - * For `chacha20-poly1305`, the `authTagLength` option defaults to 16 bytes. - * - * The `algorithm` is dependent on OpenSSL, examples are `'aes192'`, etc. On - * recent OpenSSL releases, `openssl list -cipher-algorithms` will - * display the available cipher algorithms. - * - * The `password` is used to derive the cipher key and initialization vector (IV). - * The value must be either a `'latin1'` encoded string, a `Buffer`, a`TypedArray`, or a `DataView`. - * - * The implementation of `crypto.createCipher()` derives keys using the OpenSSL - * function [`EVP_BytesToKey`](https://www.openssl.org/docs/man1.1.0/crypto/EVP_BytesToKey.html) with the digest algorithm set to MD5, one - * iteration, and no salt. The lack of salt allows dictionary attacks as the same - * password always creates the same key. The low iteration count and - * non-cryptographically secure hash algorithm allow passwords to be tested very - * rapidly. - * - * In line with OpenSSL's recommendation to use a more modern algorithm instead of [`EVP_BytesToKey`](https://www.openssl.org/docs/man1.1.0/crypto/EVP_BytesToKey.html) it is recommended that - * developers derive a key and IV on - * their own using {@link scrypt} and to use {@link createCipheriv} to create the `Cipher` object. Users should not use ciphers with counter mode - * (e.g. CTR, GCM, or CCM) in `crypto.createCipher()`. A warning is emitted when - * they are used in order to avoid the risk of IV reuse that causes - * vulnerabilities. For the case when IV is reused in GCM, see [Nonce-Disrespecting Adversaries](https://github.com/nonce-disrespect/nonce-disrespect) for details. - * @since v0.1.94 - * @deprecated Since v10.0.0 - Use {@link createCipheriv} instead. - * @param options `stream.transform` options - */ - function createCipher(algorithm: CipherCCMTypes, password: BinaryLike, options: CipherCCMOptions): CipherCCM; - /** @deprecated since v10.0.0 use `createCipheriv()` */ - function createCipher(algorithm: CipherGCMTypes, password: BinaryLike, options?: CipherGCMOptions): CipherGCM; - /** @deprecated since v10.0.0 use `createCipheriv()` */ - function createCipher(algorithm: string, password: BinaryLike, options?: stream.TransformOptions): Cipher; - /** - * Creates and returns a `Cipher` object, with the given `algorithm`, `key` and - * initialization vector (`iv`). - * - * The `options` argument controls stream behavior and is optional except when a - * cipher in CCM or OCB mode (e.g. `'aes-128-ccm'`) is used. In that case, the`authTagLength` option is required and specifies the length of the - * authentication tag in bytes, see `CCM mode`. In GCM mode, the `authTagLength`option is not required but can be used to set the length of the authentication - * tag that will be returned by `getAuthTag()` and defaults to 16 bytes. - * For `chacha20-poly1305`, the `authTagLength` option defaults to 16 bytes. - * - * The `algorithm` is dependent on OpenSSL, examples are `'aes192'`, etc. On - * recent OpenSSL releases, `openssl list -cipher-algorithms` will - * display the available cipher algorithms. - * - * The `key` is the raw key used by the `algorithm` and `iv` is an [initialization vector](https://en.wikipedia.org/wiki/Initialization_vector). Both arguments must be `'utf8'` encoded - * strings,`Buffers`, `TypedArray`, or `DataView`s. The `key` may optionally be - * a `KeyObject` of type `secret`. If the cipher does not need - * an initialization vector, `iv` may be `null`. - * - * When passing strings for `key` or `iv`, please consider `caveats when using strings as inputs to cryptographic APIs`. - * - * Initialization vectors should be unpredictable and unique; ideally, they will be - * cryptographically random. They do not have to be secret: IVs are typically just - * added to ciphertext messages unencrypted. It may sound contradictory that - * something has to be unpredictable and unique, but does not have to be secret; - * remember that an attacker must not be able to predict ahead of time what a - * given IV will be. - * @since v0.1.94 - * @param options `stream.transform` options - */ - function createCipheriv(algorithm: CipherCCMTypes, key: CipherKey, iv: BinaryLike, options: CipherCCMOptions): CipherCCM; - function createCipheriv(algorithm: CipherOCBTypes, key: CipherKey, iv: BinaryLike, options: CipherOCBOptions): CipherOCB; - function createCipheriv(algorithm: CipherGCMTypes, key: CipherKey, iv: BinaryLike, options?: CipherGCMOptions): CipherGCM; - function createCipheriv(algorithm: string, key: CipherKey, iv: BinaryLike | null, options?: stream.TransformOptions): Cipher; - /** - * Instances of the `Cipher` class are used to encrypt data. The class can be - * used in one of two ways: - * - * * As a `stream` that is both readable and writable, where plain unencrypted - * data is written to produce encrypted data on the readable side, or - * * Using the `cipher.update()` and `cipher.final()` methods to produce - * the encrypted data. - * - * The {@link createCipher} or {@link createCipheriv} methods are - * used to create `Cipher` instances. `Cipher` objects are not to be created - * directly using the `new` keyword. - * - * Example: Using `Cipher` objects as streams: - * - * ```js - * const { - * scrypt, - * randomFill, - * createCipheriv - * } = await import('crypto'); - * - * const algorithm = 'aes-192-cbc'; - * const password = 'Password used to generate key'; - * - * // First, we'll generate the key. The key length is dependent on the algorithm. - * // In this case for aes192, it is 24 bytes (192 bits). - * scrypt(password, 'salt', 24, (err, key) => { - * if (err) throw err; - * // Then, we'll generate a random initialization vector - * randomFill(new Uint8Array(16), (err, iv) => { - * if (err) throw err; - * - * // Once we have the key and iv, we can create and use the cipher... - * const cipher = createCipheriv(algorithm, key, iv); - * - * let encrypted = ''; - * cipher.setEncoding('hex'); - * - * cipher.on('data', (chunk) => encrypted += chunk); - * cipher.on('end', () => console.log(encrypted)); - * - * cipher.write('some clear text data'); - * cipher.end(); - * }); - * }); - * ``` - * - * Example: Using `Cipher` and piped streams: - * - * ```js - * import { - * createReadStream, - * createWriteStream, - * } from 'fs'; - * - * import { - * pipeline - * } from 'stream'; - * - * const { - * scrypt, - * randomFill, - * createCipheriv - * } = await import('crypto'); - * - * const algorithm = 'aes-192-cbc'; - * const password = 'Password used to generate key'; - * - * // First, we'll generate the key. The key length is dependent on the algorithm. - * // In this case for aes192, it is 24 bytes (192 bits). - * scrypt(password, 'salt', 24, (err, key) => { - * if (err) throw err; - * // Then, we'll generate a random initialization vector - * randomFill(new Uint8Array(16), (err, iv) => { - * if (err) throw err; - * - * const cipher = createCipheriv(algorithm, key, iv); - * - * const input = createReadStream('test.js'); - * const output = createWriteStream('test.enc'); - * - * pipeline(input, cipher, output, (err) => { - * if (err) throw err; - * }); - * }); - * }); - * ``` - * - * Example: Using the `cipher.update()` and `cipher.final()` methods: - * - * ```js - * const { - * scrypt, - * randomFill, - * createCipheriv - * } = await import('crypto'); - * - * const algorithm = 'aes-192-cbc'; - * const password = 'Password used to generate key'; - * - * // First, we'll generate the key. The key length is dependent on the algorithm. - * // In this case for aes192, it is 24 bytes (192 bits). - * scrypt(password, 'salt', 24, (err, key) => { - * if (err) throw err; - * // Then, we'll generate a random initialization vector - * randomFill(new Uint8Array(16), (err, iv) => { - * if (err) throw err; - * - * const cipher = createCipheriv(algorithm, key, iv); - * - * let encrypted = cipher.update('some clear text data', 'utf8', 'hex'); - * encrypted += cipher.final('hex'); - * console.log(encrypted); - * }); - * }); - * ``` - * @since v0.1.94 - */ - class Cipher extends stream.Transform { - private constructor(); - /** - * Updates the cipher with `data`. If the `inputEncoding` argument is given, - * the `data`argument is a string using the specified encoding. If the `inputEncoding`argument is not given, `data` must be a `Buffer`, `TypedArray`, or`DataView`. If `data` is a `Buffer`, - * `TypedArray`, or `DataView`, then`inputEncoding` is ignored. - * - * The `outputEncoding` specifies the output format of the enciphered - * data. If the `outputEncoding`is specified, a string using the specified encoding is returned. If no`outputEncoding` is provided, a `Buffer` is returned. - * - * The `cipher.update()` method can be called multiple times with new data until `cipher.final()` is called. Calling `cipher.update()` after `cipher.final()` will result in an error being - * thrown. - * @since v0.1.94 - * @param inputEncoding The `encoding` of the data. - * @param outputEncoding The `encoding` of the return value. - */ - update(data: BinaryLike): Buffer; - update(data: string, inputEncoding: Encoding): Buffer; - update(data: NodeJS.ArrayBufferView, inputEncoding: undefined, outputEncoding: Encoding): string; - update(data: string, inputEncoding: Encoding | undefined, outputEncoding: Encoding): string; - /** - * Once the `cipher.final()` method has been called, the `Cipher` object can no - * longer be used to encrypt data. Attempts to call `cipher.final()` more than - * once will result in an error being thrown. - * @since v0.1.94 - * @param outputEncoding The `encoding` of the return value. - * @return Any remaining enciphered contents. If `outputEncoding` is specified, a string is returned. If an `outputEncoding` is not provided, a {@link Buffer} is returned. - */ - final(): Buffer; - final(outputEncoding: BufferEncoding): string; - /** - * When using block encryption algorithms, the `Cipher` class will automatically - * add padding to the input data to the appropriate block size. To disable the - * default padding call `cipher.setAutoPadding(false)`. - * - * When `autoPadding` is `false`, the length of the entire input data must be a - * multiple of the cipher's block size or `cipher.final()` will throw an error. - * Disabling automatic padding is useful for non-standard padding, for instance - * using `0x0` instead of PKCS padding. - * - * The `cipher.setAutoPadding()` method must be called before `cipher.final()`. - * @since v0.7.1 - * @param [autoPadding=true] - * @return for method chaining. - */ - setAutoPadding(autoPadding?: boolean): this; - } - interface CipherCCM extends Cipher { - setAAD( - buffer: NodeJS.ArrayBufferView, - options: { - plaintextLength: number; - } - ): this; - getAuthTag(): Buffer; - } - interface CipherGCM extends Cipher { - setAAD( - buffer: NodeJS.ArrayBufferView, - options?: { - plaintextLength: number; - } - ): this; - getAuthTag(): Buffer; - } - interface CipherOCB extends Cipher { - setAAD( - buffer: NodeJS.ArrayBufferView, - options?: { - plaintextLength: number; - } - ): this; - getAuthTag(): Buffer; - } - /** - * Creates and returns a `Decipher` object that uses the given `algorithm` and`password` (key). - * - * The `options` argument controls stream behavior and is optional except when a - * cipher in CCM or OCB mode (e.g. `'aes-128-ccm'`) is used. In that case, the`authTagLength` option is required and specifies the length of the - * authentication tag in bytes, see `CCM mode`. - * For `chacha20-poly1305`, the `authTagLength` option defaults to 16 bytes. - * - * The implementation of `crypto.createDecipher()` derives keys using the OpenSSL - * function [`EVP_BytesToKey`](https://www.openssl.org/docs/man1.1.0/crypto/EVP_BytesToKey.html) with the digest algorithm set to MD5, one - * iteration, and no salt. The lack of salt allows dictionary attacks as the same - * password always creates the same key. The low iteration count and - * non-cryptographically secure hash algorithm allow passwords to be tested very - * rapidly. - * - * In line with OpenSSL's recommendation to use a more modern algorithm instead of [`EVP_BytesToKey`](https://www.openssl.org/docs/man1.1.0/crypto/EVP_BytesToKey.html) it is recommended that - * developers derive a key and IV on - * their own using {@link scrypt} and to use {@link createDecipheriv} to create the `Decipher` object. - * @since v0.1.94 - * @deprecated Since v10.0.0 - Use {@link createDecipheriv} instead. - * @param options `stream.transform` options - */ - function createDecipher(algorithm: CipherCCMTypes, password: BinaryLike, options: CipherCCMOptions): DecipherCCM; - /** @deprecated since v10.0.0 use `createDecipheriv()` */ - function createDecipher(algorithm: CipherGCMTypes, password: BinaryLike, options?: CipherGCMOptions): DecipherGCM; - /** @deprecated since v10.0.0 use `createDecipheriv()` */ - function createDecipher(algorithm: string, password: BinaryLike, options?: stream.TransformOptions): Decipher; - /** - * Creates and returns a `Decipher` object that uses the given `algorithm`, `key`and initialization vector (`iv`). - * - * The `options` argument controls stream behavior and is optional except when a - * cipher in CCM or OCB mode (e.g. `'aes-128-ccm'`) is used. In that case, the`authTagLength` option is required and specifies the length of the - * authentication tag in bytes, see `CCM mode`. In GCM mode, the `authTagLength`option is not required but can be used to restrict accepted authentication tags - * to those with the specified length. - * For `chacha20-poly1305`, the `authTagLength` option defaults to 16 bytes. - * - * The `algorithm` is dependent on OpenSSL, examples are `'aes192'`, etc. On - * recent OpenSSL releases, `openssl list -cipher-algorithms` will - * display the available cipher algorithms. - * - * The `key` is the raw key used by the `algorithm` and `iv` is an [initialization vector](https://en.wikipedia.org/wiki/Initialization_vector). Both arguments must be `'utf8'` encoded - * strings,`Buffers`, `TypedArray`, or `DataView`s. The `key` may optionally be - * a `KeyObject` of type `secret`. If the cipher does not need - * an initialization vector, `iv` may be `null`. - * - * When passing strings for `key` or `iv`, please consider `caveats when using strings as inputs to cryptographic APIs`. - * - * Initialization vectors should be unpredictable and unique; ideally, they will be - * cryptographically random. They do not have to be secret: IVs are typically just - * added to ciphertext messages unencrypted. It may sound contradictory that - * something has to be unpredictable and unique, but does not have to be secret; - * remember that an attacker must not be able to predict ahead of time what a given - * IV will be. - * @since v0.1.94 - * @param options `stream.transform` options - */ - function createDecipheriv(algorithm: CipherCCMTypes, key: CipherKey, iv: BinaryLike, options: CipherCCMOptions): DecipherCCM; - function createDecipheriv(algorithm: CipherOCBTypes, key: CipherKey, iv: BinaryLike, options: CipherOCBOptions): DecipherOCB; - function createDecipheriv(algorithm: CipherGCMTypes, key: CipherKey, iv: BinaryLike, options?: CipherGCMOptions): DecipherGCM; - function createDecipheriv(algorithm: string, key: CipherKey, iv: BinaryLike | null, options?: stream.TransformOptions): Decipher; - /** - * Instances of the `Decipher` class are used to decrypt data. The class can be - * used in one of two ways: - * - * * As a `stream` that is both readable and writable, where plain encrypted - * data is written to produce unencrypted data on the readable side, or - * * Using the `decipher.update()` and `decipher.final()` methods to - * produce the unencrypted data. - * - * The {@link createDecipher} or {@link createDecipheriv} methods are - * used to create `Decipher` instances. `Decipher` objects are not to be created - * directly using the `new` keyword. - * - * Example: Using `Decipher` objects as streams: - * - * ```js - * import { Buffer } from 'buffer'; - * const { - * scryptSync, - * createDecipheriv - * } = await import('crypto'); - * - * const algorithm = 'aes-192-cbc'; - * const password = 'Password used to generate key'; - * // Key length is dependent on the algorithm. In this case for aes192, it is - * // 24 bytes (192 bits). - * // Use the async `crypto.scrypt()` instead. - * const key = scryptSync(password, 'salt', 24); - * // The IV is usually passed along with the ciphertext. - * const iv = Buffer.alloc(16, 0); // Initialization vector. - * - * const decipher = createDecipheriv(algorithm, key, iv); - * - * let decrypted = ''; - * decipher.on('readable', () => { - * while (null !== (chunk = decipher.read())) { - * decrypted += chunk.toString('utf8'); - * } - * }); - * decipher.on('end', () => { - * console.log(decrypted); - * // Prints: some clear text data - * }); - * - * // Encrypted with same algorithm, key and iv. - * const encrypted = - * 'e5f79c5915c02171eec6b212d5520d44480993d7d622a7c4c2da32f6efda0ffa'; - * decipher.write(encrypted, 'hex'); - * decipher.end(); - * ``` - * - * Example: Using `Decipher` and piped streams: - * - * ```js - * import { - * createReadStream, - * createWriteStream, - * } from 'fs'; - * import { Buffer } from 'buffer'; - * const { - * scryptSync, - * createDecipheriv - * } = await import('crypto'); - * - * const algorithm = 'aes-192-cbc'; - * const password = 'Password used to generate key'; - * // Use the async `crypto.scrypt()` instead. - * const key = scryptSync(password, 'salt', 24); - * // The IV is usually passed along with the ciphertext. - * const iv = Buffer.alloc(16, 0); // Initialization vector. - * - * const decipher = createDecipheriv(algorithm, key, iv); - * - * const input = createReadStream('test.enc'); - * const output = createWriteStream('test.js'); - * - * input.pipe(decipher).pipe(output); - * ``` - * - * Example: Using the `decipher.update()` and `decipher.final()` methods: - * - * ```js - * import { Buffer } from 'buffer'; - * const { - * scryptSync, - * createDecipheriv - * } = await import('crypto'); - * - * const algorithm = 'aes-192-cbc'; - * const password = 'Password used to generate key'; - * // Use the async `crypto.scrypt()` instead. - * const key = scryptSync(password, 'salt', 24); - * // The IV is usually passed along with the ciphertext. - * const iv = Buffer.alloc(16, 0); // Initialization vector. - * - * const decipher = createDecipheriv(algorithm, key, iv); - * - * // Encrypted using same algorithm, key and iv. - * const encrypted = - * 'e5f79c5915c02171eec6b212d5520d44480993d7d622a7c4c2da32f6efda0ffa'; - * let decrypted = decipher.update(encrypted, 'hex', 'utf8'); - * decrypted += decipher.final('utf8'); - * console.log(decrypted); - * // Prints: some clear text data - * ``` - * @since v0.1.94 - */ - class Decipher extends stream.Transform { - private constructor(); - /** - * Updates the decipher with `data`. If the `inputEncoding` argument is given, - * the `data`argument is a string using the specified encoding. If the `inputEncoding`argument is not given, `data` must be a `Buffer`. If `data` is a `Buffer` then `inputEncoding` is - * ignored. - * - * The `outputEncoding` specifies the output format of the enciphered - * data. If the `outputEncoding`is specified, a string using the specified encoding is returned. If no`outputEncoding` is provided, a `Buffer` is returned. - * - * The `decipher.update()` method can be called multiple times with new data until `decipher.final()` is called. Calling `decipher.update()` after `decipher.final()` will result in an error - * being thrown. - * @since v0.1.94 - * @param inputEncoding The `encoding` of the `data` string. - * @param outputEncoding The `encoding` of the return value. - */ - update(data: NodeJS.ArrayBufferView): Buffer; - update(data: string, inputEncoding: Encoding): Buffer; - update(data: NodeJS.ArrayBufferView, inputEncoding: undefined, outputEncoding: Encoding): string; - update(data: string, inputEncoding: Encoding | undefined, outputEncoding: Encoding): string; - /** - * Once the `decipher.final()` method has been called, the `Decipher` object can - * no longer be used to decrypt data. Attempts to call `decipher.final()` more - * than once will result in an error being thrown. - * @since v0.1.94 - * @param outputEncoding The `encoding` of the return value. - * @return Any remaining deciphered contents. If `outputEncoding` is specified, a string is returned. If an `outputEncoding` is not provided, a {@link Buffer} is returned. - */ - final(): Buffer; - final(outputEncoding: BufferEncoding): string; - /** - * When data has been encrypted without standard block padding, calling`decipher.setAutoPadding(false)` will disable automatic padding to prevent `decipher.final()` from checking for and - * removing padding. - * - * Turning auto padding off will only work if the input data's length is a - * multiple of the ciphers block size. - * - * The `decipher.setAutoPadding()` method must be called before `decipher.final()`. - * @since v0.7.1 - * @param [autoPadding=true] - * @return for method chaining. - */ - setAutoPadding(auto_padding?: boolean): this; - } - interface DecipherCCM extends Decipher { - setAuthTag(buffer: NodeJS.ArrayBufferView): this; - setAAD( - buffer: NodeJS.ArrayBufferView, - options: { - plaintextLength: number; - } - ): this; - } - interface DecipherGCM extends Decipher { - setAuthTag(buffer: NodeJS.ArrayBufferView): this; - setAAD( - buffer: NodeJS.ArrayBufferView, - options?: { - plaintextLength: number; - } - ): this; - } - interface DecipherOCB extends Decipher { - setAuthTag(buffer: NodeJS.ArrayBufferView): this; - setAAD( - buffer: NodeJS.ArrayBufferView, - options?: { - plaintextLength: number; - } - ): this; - } - interface PrivateKeyInput { - key: string | Buffer; - format?: KeyFormat | undefined; - type?: 'pkcs1' | 'pkcs8' | 'sec1' | undefined; - passphrase?: string | Buffer | undefined; - } - interface PublicKeyInput { - key: string | Buffer; - format?: KeyFormat | undefined; - type?: 'pkcs1' | 'spki' | undefined; - } - /** - * Asynchronously generates a new random secret key of the given `length`. The`type` will determine which validations will be performed on the `length`. - * - * ```js - * const { - * generateKey - * } = await import('crypto'); - * - * generateKey('hmac', { length: 64 }, (err, key) => { - * if (err) throw err; - * console.log(key.export().toString('hex')); // 46e..........620 - * }); - * ``` - * @since v15.0.0 - * @param type The intended use of the generated secret key. Currently accepted values are `'hmac'` and `'aes'`. - */ - function generateKey( - type: 'hmac' | 'aes', - options: { - length: number; - }, - callback: (err: Error | null, key: KeyObject) => void - ): void; - /** - * Synchronously generates a new random secret key of the given `length`. The`type` will determine which validations will be performed on the `length`. - * - * ```js - * const { - * generateKeySync - * } = await import('crypto'); - * - * const key = generateKeySync('hmac', { length: 64 }); - * console.log(key.export().toString('hex')); // e89..........41e - * ``` - * @since v15.0.0 - * @param type The intended use of the generated secret key. Currently accepted values are `'hmac'` and `'aes'`. - */ - function generateKeySync( - type: 'hmac' | 'aes', - options: { - length: number; - } - ): KeyObject; - interface JsonWebKeyInput { - key: JsonWebKey; - format: 'jwk'; - } - /** - * Creates and returns a new key object containing a private key. If `key` is a - * string or `Buffer`, `format` is assumed to be `'pem'`; otherwise, `key`must be an object with the properties described above. - * - * If the private key is encrypted, a `passphrase` must be specified. The length - * of the passphrase is limited to 1024 bytes. - * @since v11.6.0 - */ - function createPrivateKey(key: PrivateKeyInput | string | Buffer | JsonWebKeyInput): KeyObject; - /** - * Creates and returns a new key object containing a public key. If `key` is a - * string or `Buffer`, `format` is assumed to be `'pem'`; if `key` is a `KeyObject`with type `'private'`, the public key is derived from the given private key; - * otherwise, `key` must be an object with the properties described above. - * - * If the format is `'pem'`, the `'key'` may also be an X.509 certificate. - * - * Because public keys can be derived from private keys, a private key may be - * passed instead of a public key. In that case, this function behaves as if {@link createPrivateKey} had been called, except that the type of the - * returned `KeyObject` will be `'public'` and that the private key cannot be - * extracted from the returned `KeyObject`. Similarly, if a `KeyObject` with type`'private'` is given, a new `KeyObject` with type `'public'` will be returned - * and it will be impossible to extract the private key from the returned object. - * @since v11.6.0 - */ - function createPublicKey(key: PublicKeyInput | string | Buffer | KeyObject | JsonWebKeyInput): KeyObject; - /** - * Creates and returns a new key object containing a secret key for symmetric - * encryption or `Hmac`. - * @since v11.6.0 - * @param encoding The string encoding when `key` is a string. - */ - function createSecretKey(key: NodeJS.ArrayBufferView): KeyObject; - function createSecretKey(key: string, encoding: BufferEncoding): KeyObject; - /** - * Creates and returns a `Sign` object that uses the given `algorithm`. Use {@link getHashes} to obtain the names of the available digest algorithms. - * Optional `options` argument controls the `stream.Writable` behavior. - * - * In some cases, a `Sign` instance can be created using the name of a signature - * algorithm, such as `'RSA-SHA256'`, instead of a digest algorithm. This will use - * the corresponding digest algorithm. This does not work for all signature - * algorithms, such as `'ecdsa-with-SHA256'`, so it is best to always use digest - * algorithm names. - * @since v0.1.92 - * @param options `stream.Writable` options - */ - function createSign(algorithm: string, options?: stream.WritableOptions): Sign; - type DSAEncoding = 'der' | 'ieee-p1363'; - interface SigningOptions { - /** - * @See crypto.constants.RSA_PKCS1_PADDING - */ - padding?: number | undefined; - saltLength?: number | undefined; - dsaEncoding?: DSAEncoding | undefined; - } - interface SignPrivateKeyInput extends PrivateKeyInput, SigningOptions {} - interface SignKeyObjectInput extends SigningOptions { - key: KeyObject; - } - interface VerifyPublicKeyInput extends PublicKeyInput, SigningOptions {} - interface VerifyKeyObjectInput extends SigningOptions { - key: KeyObject; - } - type KeyLike = string | Buffer | KeyObject; - /** - * The `Sign` class is a utility for generating signatures. It can be used in one - * of two ways: - * - * * As a writable `stream`, where data to be signed is written and the `sign.sign()` method is used to generate and return the signature, or - * * Using the `sign.update()` and `sign.sign()` methods to produce the - * signature. - * - * The {@link createSign} method is used to create `Sign` instances. The - * argument is the string name of the hash function to use. `Sign` objects are not - * to be created directly using the `new` keyword. - * - * Example: Using `Sign` and `Verify` objects as streams: - * - * ```js - * const { - * generateKeyPairSync, - * createSign, - * createVerify - * } = await import('crypto'); - * - * const { privateKey, publicKey } = generateKeyPairSync('ec', { - * namedCurve: 'sect239k1' - * }); - * - * const sign = createSign('SHA256'); - * sign.write('some data to sign'); - * sign.end(); - * const signature = sign.sign(privateKey, 'hex'); - * - * const verify = createVerify('SHA256'); - * verify.write('some data to sign'); - * verify.end(); - * console.log(verify.verify(publicKey, signature, 'hex')); - * // Prints: true - * ``` - * - * Example: Using the `sign.update()` and `verify.update()` methods: - * - * ```js - * const { - * generateKeyPairSync, - * createSign, - * createVerify - * } = await import('crypto'); - * - * const { privateKey, publicKey } = generateKeyPairSync('rsa', { - * modulusLength: 2048, - * }); - * - * const sign = createSign('SHA256'); - * sign.update('some data to sign'); - * sign.end(); - * const signature = sign.sign(privateKey); - * - * const verify = createVerify('SHA256'); - * verify.update('some data to sign'); - * verify.end(); - * console.log(verify.verify(publicKey, signature)); - * // Prints: true - * ``` - * @since v0.1.92 - */ - class Sign extends stream.Writable { - private constructor(); - /** - * Updates the `Sign` content with the given `data`, the encoding of which - * is given in `inputEncoding`. - * If `encoding` is not provided, and the `data` is a string, an - * encoding of `'utf8'` is enforced. If `data` is a `Buffer`, `TypedArray`, or`DataView`, then `inputEncoding` is ignored. - * - * This can be called many times with new data as it is streamed. - * @since v0.1.92 - * @param inputEncoding The `encoding` of the `data` string. - */ - update(data: BinaryLike): this; - update(data: string, inputEncoding: Encoding): this; - /** - * Calculates the signature on all the data passed through using either `sign.update()` or `sign.write()`. - * - * If `privateKey` is not a `KeyObject`, this function behaves as if`privateKey` had been passed to {@link createPrivateKey}. If it is an - * object, the following additional properties can be passed: - * - * If `outputEncoding` is provided a string is returned; otherwise a `Buffer` is returned. - * - * The `Sign` object can not be again used after `sign.sign()` method has been - * called. Multiple calls to `sign.sign()` will result in an error being thrown. - * @since v0.1.92 - */ - sign(privateKey: KeyLike | SignKeyObjectInput | SignPrivateKeyInput): Buffer; - sign(privateKey: KeyLike | SignKeyObjectInput | SignPrivateKeyInput, outputFormat: BinaryToTextEncoding): string; - } - /** - * Creates and returns a `Verify` object that uses the given algorithm. - * Use {@link getHashes} to obtain an array of names of the available - * signing algorithms. Optional `options` argument controls the`stream.Writable` behavior. - * - * In some cases, a `Verify` instance can be created using the name of a signature - * algorithm, such as `'RSA-SHA256'`, instead of a digest algorithm. This will use - * the corresponding digest algorithm. This does not work for all signature - * algorithms, such as `'ecdsa-with-SHA256'`, so it is best to always use digest - * algorithm names. - * @since v0.1.92 - * @param options `stream.Writable` options - */ - function createVerify(algorithm: string, options?: stream.WritableOptions): Verify; - /** - * The `Verify` class is a utility for verifying signatures. It can be used in one - * of two ways: - * - * * As a writable `stream` where written data is used to validate against the - * supplied signature, or - * * Using the `verify.update()` and `verify.verify()` methods to verify - * the signature. - * - * The {@link createVerify} method is used to create `Verify` instances.`Verify` objects are not to be created directly using the `new` keyword. - * - * See `Sign` for examples. - * @since v0.1.92 - */ - class Verify extends stream.Writable { - private constructor(); - /** - * Updates the `Verify` content with the given `data`, the encoding of which - * is given in `inputEncoding`. - * If `inputEncoding` is not provided, and the `data` is a string, an - * encoding of `'utf8'` is enforced. If `data` is a `Buffer`, `TypedArray`, or`DataView`, then `inputEncoding` is ignored. - * - * This can be called many times with new data as it is streamed. - * @since v0.1.92 - * @param inputEncoding The `encoding` of the `data` string. - */ - update(data: BinaryLike): Verify; - update(data: string, inputEncoding: Encoding): Verify; - /** - * Verifies the provided data using the given `object` and `signature`. - * - * If `object` is not a `KeyObject`, this function behaves as if`object` had been passed to {@link createPublicKey}. If it is an - * object, the following additional properties can be passed: - * - * The `signature` argument is the previously calculated signature for the data, in - * the `signatureEncoding`. - * If a `signatureEncoding` is specified, the `signature` is expected to be a - * string; otherwise `signature` is expected to be a `Buffer`,`TypedArray`, or `DataView`. - * - * The `verify` object can not be used again after `verify.verify()` has been - * called. Multiple calls to `verify.verify()` will result in an error being - * thrown. - * - * Because public keys can be derived from private keys, a private key may - * be passed instead of a public key. - * @since v0.1.92 - */ - verify(object: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput, signature: NodeJS.ArrayBufferView): boolean; - verify(object: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput, signature: string, signature_format?: BinaryToTextEncoding): boolean; - } - /** - * Creates a `DiffieHellman` key exchange object using the supplied `prime` and an - * optional specific `generator`. - * - * The `generator` argument can be a number, string, or `Buffer`. If`generator` is not specified, the value `2` is used. - * - * If `primeEncoding` is specified, `prime` is expected to be a string; otherwise - * a `Buffer`, `TypedArray`, or `DataView` is expected. - * - * If `generatorEncoding` is specified, `generator` is expected to be a string; - * otherwise a number, `Buffer`, `TypedArray`, or `DataView` is expected. - * @since v0.11.12 - * @param primeEncoding The `encoding` of the `prime` string. - * @param [generator=2] - * @param generatorEncoding The `encoding` of the `generator` string. - */ - function createDiffieHellman(primeLength: number, generator?: number): DiffieHellman; - function createDiffieHellman(prime: ArrayBuffer | NodeJS.ArrayBufferView, generator?: number | ArrayBuffer | NodeJS.ArrayBufferView): DiffieHellman; - function createDiffieHellman(prime: ArrayBuffer | NodeJS.ArrayBufferView, generator: string, generatorEncoding: BinaryToTextEncoding): DiffieHellman; - function createDiffieHellman(prime: string, primeEncoding: BinaryToTextEncoding, generator?: number | ArrayBuffer | NodeJS.ArrayBufferView): DiffieHellman; - function createDiffieHellman(prime: string, primeEncoding: BinaryToTextEncoding, generator: string, generatorEncoding: BinaryToTextEncoding): DiffieHellman; - /** - * The `DiffieHellman` class is a utility for creating Diffie-Hellman key - * exchanges. - * - * Instances of the `DiffieHellman` class can be created using the {@link createDiffieHellman} function. - * - * ```js - * import assert from 'assert'; - * - * const { - * createDiffieHellman - * } = await import('crypto'); - * - * // Generate Alice's keys... - * const alice = createDiffieHellman(2048); - * const aliceKey = alice.generateKeys(); - * - * // Generate Bob's keys... - * const bob = createDiffieHellman(alice.getPrime(), alice.getGenerator()); - * const bobKey = bob.generateKeys(); - * - * // Exchange and generate the secret... - * const aliceSecret = alice.computeSecret(bobKey); - * const bobSecret = bob.computeSecret(aliceKey); - * - * // OK - * assert.strictEqual(aliceSecret.toString('hex'), bobSecret.toString('hex')); - * ``` - * @since v0.5.0 - */ - class DiffieHellman { - private constructor(); - /** - * Generates private and public Diffie-Hellman key values, and returns - * the public key in the specified `encoding`. This key should be - * transferred to the other party. - * If `encoding` is provided a string is returned; otherwise a `Buffer` is returned. - * @since v0.5.0 - * @param encoding The `encoding` of the return value. - */ - generateKeys(): Buffer; - generateKeys(encoding: BinaryToTextEncoding): string; - /** - * Computes the shared secret using `otherPublicKey` as the other - * party's public key and returns the computed shared secret. The supplied - * key is interpreted using the specified `inputEncoding`, and secret is - * encoded using specified `outputEncoding`. - * If the `inputEncoding` is not - * provided, `otherPublicKey` is expected to be a `Buffer`,`TypedArray`, or `DataView`. - * - * If `outputEncoding` is given a string is returned; otherwise, a `Buffer` is returned. - * @since v0.5.0 - * @param inputEncoding The `encoding` of an `otherPublicKey` string. - * @param outputEncoding The `encoding` of the return value. - */ - computeSecret(otherPublicKey: NodeJS.ArrayBufferView, inputEncoding?: null, outputEncoding?: null): Buffer; - computeSecret(otherPublicKey: string, inputEncoding: BinaryToTextEncoding, outputEncoding?: null): Buffer; - computeSecret(otherPublicKey: NodeJS.ArrayBufferView, inputEncoding: null, outputEncoding: BinaryToTextEncoding): string; - computeSecret(otherPublicKey: string, inputEncoding: BinaryToTextEncoding, outputEncoding: BinaryToTextEncoding): string; - /** - * Returns the Diffie-Hellman prime in the specified `encoding`. - * If `encoding` is provided a string is - * returned; otherwise a `Buffer` is returned. - * @since v0.5.0 - * @param encoding The `encoding` of the return value. - */ - getPrime(): Buffer; - getPrime(encoding: BinaryToTextEncoding): string; - /** - * Returns the Diffie-Hellman generator in the specified `encoding`. - * If `encoding` is provided a string is - * returned; otherwise a `Buffer` is returned. - * @since v0.5.0 - * @param encoding The `encoding` of the return value. - */ - getGenerator(): Buffer; - getGenerator(encoding: BinaryToTextEncoding): string; - /** - * Returns the Diffie-Hellman public key in the specified `encoding`. - * If `encoding` is provided a - * string is returned; otherwise a `Buffer` is returned. - * @since v0.5.0 - * @param encoding The `encoding` of the return value. - */ - getPublicKey(): Buffer; - getPublicKey(encoding: BinaryToTextEncoding): string; - /** - * Returns the Diffie-Hellman private key in the specified `encoding`. - * If `encoding` is provided a - * string is returned; otherwise a `Buffer` is returned. - * @since v0.5.0 - * @param encoding The `encoding` of the return value. - */ - getPrivateKey(): Buffer; - getPrivateKey(encoding: BinaryToTextEncoding): string; - /** - * Sets the Diffie-Hellman public key. If the `encoding` argument is provided,`publicKey` is expected - * to be a string. If no `encoding` is provided, `publicKey` is expected - * to be a `Buffer`, `TypedArray`, or `DataView`. - * @since v0.5.0 - * @param encoding The `encoding` of the `publicKey` string. - */ - setPublicKey(publicKey: NodeJS.ArrayBufferView): void; - setPublicKey(publicKey: string, encoding: BufferEncoding): void; - /** - * Sets the Diffie-Hellman private key. If the `encoding` argument is provided,`privateKey` is expected - * to be a string. If no `encoding` is provided, `privateKey` is expected - * to be a `Buffer`, `TypedArray`, or `DataView`. - * @since v0.5.0 - * @param encoding The `encoding` of the `privateKey` string. - */ - setPrivateKey(privateKey: NodeJS.ArrayBufferView): void; - setPrivateKey(privateKey: string, encoding: BufferEncoding): void; - /** - * A bit field containing any warnings and/or errors resulting from a check - * performed during initialization of the `DiffieHellman` object. - * - * The following values are valid for this property (as defined in `constants`module): - * - * * `DH_CHECK_P_NOT_SAFE_PRIME` - * * `DH_CHECK_P_NOT_PRIME` - * * `DH_UNABLE_TO_CHECK_GENERATOR` - * * `DH_NOT_SUITABLE_GENERATOR` - * @since v0.11.12 - */ - verifyError: number; - } - /** - * The `DiffieHellmanGroup` class takes a well-known modp group as its argument. - * It works the same as `DiffieHellman`, except that it does not allow changing its keys after creation. - * In other words, it does not implement `setPublicKey()` or `setPrivateKey()` methods. - * - * ```js - * const { createDiffieHellmanGroup } = await import('node:crypto'); - * const dh = createDiffieHellmanGroup('modp1'); - * ``` - * The name (e.g. `'modp1'`) is taken from [RFC 2412](https://www.rfc-editor.org/rfc/rfc2412.txt) (modp1 and 2) and [RFC 3526](https://www.rfc-editor.org/rfc/rfc3526.txt): - * ```bash - * $ perl -ne 'print "$1\n" if /"(modp\d+)"/' src/node_crypto_groups.h - * modp1 # 768 bits - * modp2 # 1024 bits - * modp5 # 1536 bits - * modp14 # 2048 bits - * modp15 # etc. - * modp16 - * modp17 - * modp18 - * ``` - * @since v0.7.5 - */ - const DiffieHellmanGroup: DiffieHellmanGroupConstructor; - interface DiffieHellmanGroupConstructor { - new(name: string): DiffieHellmanGroup; - (name: string): DiffieHellmanGroup; - readonly prototype: DiffieHellmanGroup; - } - type DiffieHellmanGroup = Omit; - /** - * Creates a predefined `DiffieHellmanGroup` key exchange object. The - * supported groups are: `'modp1'`, `'modp2'`, `'modp5'` (defined in [RFC 2412](https://www.rfc-editor.org/rfc/rfc2412.txt), but see `Caveats`) and `'modp14'`, `'modp15'`,`'modp16'`, `'modp17'`, - * `'modp18'` (defined in [RFC 3526](https://www.rfc-editor.org/rfc/rfc3526.txt)). The - * returned object mimics the interface of objects created by {@link createDiffieHellman}, but will not allow changing - * the keys (with `diffieHellman.setPublicKey()`, for example). The - * advantage of using this method is that the parties do not have to - * generate nor exchange a group modulus beforehand, saving both processor - * and communication time. - * - * Example (obtaining a shared secret): - * - * ```js - * const { - * getDiffieHellman - * } = await import('crypto'); - * const alice = getDiffieHellman('modp14'); - * const bob = getDiffieHellman('modp14'); - * - * alice.generateKeys(); - * bob.generateKeys(); - * - * const aliceSecret = alice.computeSecret(bob.getPublicKey(), null, 'hex'); - * const bobSecret = bob.computeSecret(alice.getPublicKey(), null, 'hex'); - * - * // aliceSecret and bobSecret should be the same - * console.log(aliceSecret === bobSecret); - * ``` - * @since v0.7.5 - */ - function getDiffieHellman(groupName: string): DiffieHellmanGroup; - /** - * An alias for {@link getDiffieHellman} - * @since v0.9.3 - */ - function createDiffieHellmanGroup(name: string): DiffieHellmanGroup; - /** - * Provides an asynchronous Password-Based Key Derivation Function 2 (PBKDF2) - * implementation. A selected HMAC digest algorithm specified by `digest` is - * applied to derive a key of the requested byte length (`keylen`) from the`password`, `salt` and `iterations`. - * - * The supplied `callback` function is called with two arguments: `err` and`derivedKey`. If an error occurs while deriving the key, `err` will be set; - * otherwise `err` will be `null`. By default, the successfully generated`derivedKey` will be passed to the callback as a `Buffer`. An error will be - * thrown if any of the input arguments specify invalid values or types. - * - * If `digest` is `null`, `'sha1'` will be used. This behavior is deprecated, - * please specify a `digest` explicitly. - * - * The `iterations` argument must be a number set as high as possible. The - * higher the number of iterations, the more secure the derived key will be, - * but will take a longer amount of time to complete. - * - * The `salt` should be as unique as possible. It is recommended that a salt is - * random and at least 16 bytes long. See [NIST SP 800-132](https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-132.pdf) for details. - * - * When passing strings for `password` or `salt`, please consider `caveats when using strings as inputs to cryptographic APIs`. - * - * ```js - * const { - * pbkdf2 - * } = await import('crypto'); - * - * pbkdf2('secret', 'salt', 100000, 64, 'sha512', (err, derivedKey) => { - * if (err) throw err; - * console.log(derivedKey.toString('hex')); // '3745e48...08d59ae' - * }); - * ``` - * - * The `crypto.DEFAULT_ENCODING` property can be used to change the way the`derivedKey` is passed to the callback. This property, however, has been - * deprecated and use should be avoided. - * - * ```js - * import crypto from 'crypto'; - * crypto.DEFAULT_ENCODING = 'hex'; - * crypto.pbkdf2('secret', 'salt', 100000, 512, 'sha512', (err, derivedKey) => { - * if (err) throw err; - * console.log(derivedKey); // '3745e48...aa39b34' - * }); - * ``` - * - * An array of supported digest functions can be retrieved using {@link getHashes}. - * - * This API uses libuv's threadpool, which can have surprising and - * negative performance implications for some applications; see the `UV_THREADPOOL_SIZE` documentation for more information. - * @since v0.5.5 - */ - function pbkdf2(password: BinaryLike, salt: BinaryLike, iterations: number, keylen: number, digest: string, callback: (err: Error | null, derivedKey: Buffer) => void): void; - /** - * Provides a synchronous Password-Based Key Derivation Function 2 (PBKDF2) - * implementation. A selected HMAC digest algorithm specified by `digest` is - * applied to derive a key of the requested byte length (`keylen`) from the`password`, `salt` and `iterations`. - * - * If an error occurs an `Error` will be thrown, otherwise the derived key will be - * returned as a `Buffer`. - * - * If `digest` is `null`, `'sha1'` will be used. This behavior is deprecated, - * please specify a `digest` explicitly. - * - * The `iterations` argument must be a number set as high as possible. The - * higher the number of iterations, the more secure the derived key will be, - * but will take a longer amount of time to complete. - * - * The `salt` should be as unique as possible. It is recommended that a salt is - * random and at least 16 bytes long. See [NIST SP 800-132](https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-132.pdf) for details. - * - * When passing strings for `password` or `salt`, please consider `caveats when using strings as inputs to cryptographic APIs`. - * - * ```js - * const { - * pbkdf2Sync - * } = await import('crypto'); - * - * const key = pbkdf2Sync('secret', 'salt', 100000, 64, 'sha512'); - * console.log(key.toString('hex')); // '3745e48...08d59ae' - * ``` - * - * The `crypto.DEFAULT_ENCODING` property may be used to change the way the`derivedKey` is returned. This property, however, is deprecated and use - * should be avoided. - * - * ```js - * import crypto from 'crypto'; - * crypto.DEFAULT_ENCODING = 'hex'; - * const key = crypto.pbkdf2Sync('secret', 'salt', 100000, 512, 'sha512'); - * console.log(key); // '3745e48...aa39b34' - * ``` - * - * An array of supported digest functions can be retrieved using {@link getHashes}. - * @since v0.9.3 - */ - function pbkdf2Sync(password: BinaryLike, salt: BinaryLike, iterations: number, keylen: number, digest: string): Buffer; - /** - * Generates cryptographically strong pseudorandom data. The `size` argument - * is a number indicating the number of bytes to generate. - * - * If a `callback` function is provided, the bytes are generated asynchronously - * and the `callback` function is invoked with two arguments: `err` and `buf`. - * If an error occurs, `err` will be an `Error` object; otherwise it is `null`. The`buf` argument is a `Buffer` containing the generated bytes. - * - * ```js - * // Asynchronous - * const { - * randomBytes - * } = await import('crypto'); - * - * randomBytes(256, (err, buf) => { - * if (err) throw err; - * console.log(`${buf.length} bytes of random data: ${buf.toString('hex')}`); - * }); - * ``` - * - * If the `callback` function is not provided, the random bytes are generated - * synchronously and returned as a `Buffer`. An error will be thrown if - * there is a problem generating the bytes. - * - * ```js - * // Synchronous - * const { - * randomBytes - * } = await import('crypto'); - * - * const buf = randomBytes(256); - * console.log( - * `${buf.length} bytes of random data: ${buf.toString('hex')}`); - * ``` - * - * The `crypto.randomBytes()` method will not complete until there is - * sufficient entropy available. - * This should normally never take longer than a few milliseconds. The only time - * when generating the random bytes may conceivably block for a longer period of - * time is right after boot, when the whole system is still low on entropy. - * - * This API uses libuv's threadpool, which can have surprising and - * negative performance implications for some applications; see the `UV_THREADPOOL_SIZE` documentation for more information. - * - * The asynchronous version of `crypto.randomBytes()` is carried out in a single - * threadpool request. To minimize threadpool task length variation, partition - * large `randomBytes` requests when doing so as part of fulfilling a client - * request. - * @since v0.5.8 - * @param size The number of bytes to generate. The `size` must not be larger than `2**31 - 1`. - * @return if the `callback` function is not provided. - */ - function randomBytes(size: number): Buffer; - function randomBytes(size: number, callback: (err: Error | null, buf: Buffer) => void): void; - function pseudoRandomBytes(size: number): Buffer; - function pseudoRandomBytes(size: number, callback: (err: Error | null, buf: Buffer) => void): void; - /** - * Return a random integer `n` such that `min <= n < max`. This - * implementation avoids [modulo bias](https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle#Modulo_bias). - * - * The range (`max - min`) must be less than 2^48. `min` and `max` must - * be [safe integers](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isSafeInteger). - * - * If the `callback` function is not provided, the random integer is - * generated synchronously. - * - * ```js - * // Asynchronous - * const { - * randomInt - * } = await import('crypto'); - * - * randomInt(3, (err, n) => { - * if (err) throw err; - * console.log(`Random number chosen from (0, 1, 2): ${n}`); - * }); - * ``` - * - * ```js - * // Synchronous - * const { - * randomInt - * } = await import('crypto'); - * - * const n = randomInt(3); - * console.log(`Random number chosen from (0, 1, 2): ${n}`); - * ``` - * - * ```js - * // With `min` argument - * const { - * randomInt - * } = await import('crypto'); - * - * const n = randomInt(1, 7); - * console.log(`The dice rolled: ${n}`); - * ``` - * @since v14.10.0, v12.19.0 - * @param [min=0] Start of random range (inclusive). - * @param max End of random range (exclusive). - * @param callback `function(err, n) {}`. - */ - function randomInt(max: number): number; - function randomInt(min: number, max: number): number; - function randomInt(max: number, callback: (err: Error | null, value: number) => void): void; - function randomInt(min: number, max: number, callback: (err: Error | null, value: number) => void): void; - /** - * Synchronous version of {@link randomFill}. - * - * ```js - * import { Buffer } from 'buffer'; - * const { randomFillSync } = await import('crypto'); - * - * const buf = Buffer.alloc(10); - * console.log(randomFillSync(buf).toString('hex')); - * - * randomFillSync(buf, 5); - * console.log(buf.toString('hex')); - * - * // The above is equivalent to the following: - * randomFillSync(buf, 5, 5); - * console.log(buf.toString('hex')); - * ``` - * - * Any `ArrayBuffer`, `TypedArray` or `DataView` instance may be passed as`buffer`. - * - * ```js - * import { Buffer } from 'buffer'; - * const { randomFillSync } = await import('crypto'); - * - * const a = new Uint32Array(10); - * console.log(Buffer.from(randomFillSync(a).buffer, - * a.byteOffset, a.byteLength).toString('hex')); - * - * const b = new DataView(new ArrayBuffer(10)); - * console.log(Buffer.from(randomFillSync(b).buffer, - * b.byteOffset, b.byteLength).toString('hex')); - * - * const c = new ArrayBuffer(10); - * console.log(Buffer.from(randomFillSync(c)).toString('hex')); - * ``` - * @since v7.10.0, v6.13.0 - * @param buffer Must be supplied. The size of the provided `buffer` must not be larger than `2**31 - 1`. - * @param [offset=0] - * @param [size=buffer.length - offset] - * @return The object passed as `buffer` argument. - */ - function randomFillSync(buffer: T, offset?: number, size?: number): T; - /** - * This function is similar to {@link randomBytes} but requires the first - * argument to be a `Buffer` that will be filled. It also - * requires that a callback is passed in. - * - * If the `callback` function is not provided, an error will be thrown. - * - * ```js - * import { Buffer } from 'buffer'; - * const { randomFill } = await import('crypto'); - * - * const buf = Buffer.alloc(10); - * randomFill(buf, (err, buf) => { - * if (err) throw err; - * console.log(buf.toString('hex')); - * }); - * - * randomFill(buf, 5, (err, buf) => { - * if (err) throw err; - * console.log(buf.toString('hex')); - * }); - * - * // The above is equivalent to the following: - * randomFill(buf, 5, 5, (err, buf) => { - * if (err) throw err; - * console.log(buf.toString('hex')); - * }); - * ``` - * - * Any `ArrayBuffer`, `TypedArray`, or `DataView` instance may be passed as`buffer`. - * - * While this includes instances of `Float32Array` and `Float64Array`, this - * function should not be used to generate random floating-point numbers. The - * result may contain `+Infinity`, `-Infinity`, and `NaN`, and even if the array - * contains finite numbers only, they are not drawn from a uniform random - * distribution and have no meaningful lower or upper bounds. - * - * ```js - * import { Buffer } from 'buffer'; - * const { randomFill } = await import('crypto'); - * - * const a = new Uint32Array(10); - * randomFill(a, (err, buf) => { - * if (err) throw err; - * console.log(Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength) - * .toString('hex')); - * }); - * - * const b = new DataView(new ArrayBuffer(10)); - * randomFill(b, (err, buf) => { - * if (err) throw err; - * console.log(Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength) - * .toString('hex')); - * }); - * - * const c = new ArrayBuffer(10); - * randomFill(c, (err, buf) => { - * if (err) throw err; - * console.log(Buffer.from(buf).toString('hex')); - * }); - * ``` - * - * This API uses libuv's threadpool, which can have surprising and - * negative performance implications for some applications; see the `UV_THREADPOOL_SIZE` documentation for more information. - * - * The asynchronous version of `crypto.randomFill()` is carried out in a single - * threadpool request. To minimize threadpool task length variation, partition - * large `randomFill` requests when doing so as part of fulfilling a client - * request. - * @since v7.10.0, v6.13.0 - * @param buffer Must be supplied. The size of the provided `buffer` must not be larger than `2**31 - 1`. - * @param [offset=0] - * @param [size=buffer.length - offset] - * @param callback `function(err, buf) {}`. - */ - function randomFill(buffer: T, callback: (err: Error | null, buf: T) => void): void; - function randomFill(buffer: T, offset: number, callback: (err: Error | null, buf: T) => void): void; - function randomFill(buffer: T, offset: number, size: number, callback: (err: Error | null, buf: T) => void): void; - interface ScryptOptions { - cost?: number | undefined; - blockSize?: number | undefined; - parallelization?: number | undefined; - N?: number | undefined; - r?: number | undefined; - p?: number | undefined; - maxmem?: number | undefined; - } - /** - * Provides an asynchronous [scrypt](https://en.wikipedia.org/wiki/Scrypt) implementation. Scrypt is a password-based - * key derivation function that is designed to be expensive computationally and - * memory-wise in order to make brute-force attacks unrewarding. - * - * The `salt` should be as unique as possible. It is recommended that a salt is - * random and at least 16 bytes long. See [NIST SP 800-132](https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-132.pdf) for details. - * - * When passing strings for `password` or `salt`, please consider `caveats when using strings as inputs to cryptographic APIs`. - * - * The `callback` function is called with two arguments: `err` and `derivedKey`.`err` is an exception object when key derivation fails, otherwise `err` is`null`. `derivedKey` is passed to the - * callback as a `Buffer`. - * - * An exception is thrown when any of the input arguments specify invalid values - * or types. - * - * ```js - * const { - * scrypt - * } = await import('crypto'); - * - * // Using the factory defaults. - * scrypt('password', 'salt', 64, (err, derivedKey) => { - * if (err) throw err; - * console.log(derivedKey.toString('hex')); // '3745e48...08d59ae' - * }); - * // Using a custom N parameter. Must be a power of two. - * scrypt('password', 'salt', 64, { N: 1024 }, (err, derivedKey) => { - * if (err) throw err; - * console.log(derivedKey.toString('hex')); // '3745e48...aa39b34' - * }); - * ``` - * @since v10.5.0 - */ - function scrypt(password: BinaryLike, salt: BinaryLike, keylen: number, callback: (err: Error | null, derivedKey: Buffer) => void): void; - function scrypt(password: BinaryLike, salt: BinaryLike, keylen: number, options: ScryptOptions, callback: (err: Error | null, derivedKey: Buffer) => void): void; - /** - * Provides a synchronous [scrypt](https://en.wikipedia.org/wiki/Scrypt) implementation. Scrypt is a password-based - * key derivation function that is designed to be expensive computationally and - * memory-wise in order to make brute-force attacks unrewarding. - * - * The `salt` should be as unique as possible. It is recommended that a salt is - * random and at least 16 bytes long. See [NIST SP 800-132](https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-132.pdf) for details. - * - * When passing strings for `password` or `salt`, please consider `caveats when using strings as inputs to cryptographic APIs`. - * - * An exception is thrown when key derivation fails, otherwise the derived key is - * returned as a `Buffer`. - * - * An exception is thrown when any of the input arguments specify invalid values - * or types. - * - * ```js - * const { - * scryptSync - * } = await import('crypto'); - * // Using the factory defaults. - * - * const key1 = scryptSync('password', 'salt', 64); - * console.log(key1.toString('hex')); // '3745e48...08d59ae' - * // Using a custom N parameter. Must be a power of two. - * const key2 = scryptSync('password', 'salt', 64, { N: 1024 }); - * console.log(key2.toString('hex')); // '3745e48...aa39b34' - * ``` - * @since v10.5.0 - */ - function scryptSync(password: BinaryLike, salt: BinaryLike, keylen: number, options?: ScryptOptions): Buffer; - interface RsaPublicKey { - key: KeyLike; - padding?: number | undefined; - } - interface RsaPrivateKey { - key: KeyLike; - passphrase?: string | undefined; - /** - * @default 'sha1' - */ - oaepHash?: string | undefined; - oaepLabel?: NodeJS.TypedArray | undefined; - padding?: number | undefined; - } - /** - * Encrypts the content of `buffer` with `key` and returns a new `Buffer` with encrypted content. The returned data can be decrypted using - * the corresponding private key, for example using {@link privateDecrypt}. - * - * If `key` is not a `KeyObject`, this function behaves as if`key` had been passed to {@link createPublicKey}. If it is an - * object, the `padding` property can be passed. Otherwise, this function uses`RSA_PKCS1_OAEP_PADDING`. - * - * Because RSA public keys can be derived from private keys, a private key may - * be passed instead of a public key. - * @since v0.11.14 - */ - function publicEncrypt(key: RsaPublicKey | RsaPrivateKey | KeyLike, buffer: NodeJS.ArrayBufferView): Buffer; - /** - * Decrypts `buffer` with `key`.`buffer` was previously encrypted using - * the corresponding private key, for example using {@link privateEncrypt}. - * - * If `key` is not a `KeyObject`, this function behaves as if`key` had been passed to {@link createPublicKey}. If it is an - * object, the `padding` property can be passed. Otherwise, this function uses`RSA_PKCS1_PADDING`. - * - * Because RSA public keys can be derived from private keys, a private key may - * be passed instead of a public key. - * @since v1.1.0 - */ - function publicDecrypt(key: RsaPublicKey | RsaPrivateKey | KeyLike, buffer: NodeJS.ArrayBufferView): Buffer; - /** - * Decrypts `buffer` with `privateKey`. `buffer` was previously encrypted using - * the corresponding public key, for example using {@link publicEncrypt}. - * - * If `privateKey` is not a `KeyObject`, this function behaves as if`privateKey` had been passed to {@link createPrivateKey}. If it is an - * object, the `padding` property can be passed. Otherwise, this function uses`RSA_PKCS1_OAEP_PADDING`. - * @since v0.11.14 - */ - function privateDecrypt(privateKey: RsaPrivateKey | KeyLike, buffer: NodeJS.ArrayBufferView): Buffer; - /** - * Encrypts `buffer` with `privateKey`. The returned data can be decrypted using - * the corresponding public key, for example using {@link publicDecrypt}. - * - * If `privateKey` is not a `KeyObject`, this function behaves as if`privateKey` had been passed to {@link createPrivateKey}. If it is an - * object, the `padding` property can be passed. Otherwise, this function uses`RSA_PKCS1_PADDING`. - * @since v1.1.0 - */ - function privateEncrypt(privateKey: RsaPrivateKey | KeyLike, buffer: NodeJS.ArrayBufferView): Buffer; - /** - * ```js - * const { - * getCiphers - * } = await import('crypto'); - * - * console.log(getCiphers()); // ['aes-128-cbc', 'aes-128-ccm', ...] - * ``` - * @since v0.9.3 - * @return An array with the names of the supported cipher algorithms. - */ - function getCiphers(): string[]; - /** - * ```js - * const { - * getCurves - * } = await import('crypto'); - * - * console.log(getCurves()); // ['Oakley-EC2N-3', 'Oakley-EC2N-4', ...] - * ``` - * @since v2.3.0 - * @return An array with the names of the supported elliptic curves. - */ - function getCurves(): string[]; - /** - * @since v10.0.0 - * @return `1` if and only if a FIPS compliant crypto provider is currently in use, `0` otherwise. A future semver-major release may change the return type of this API to a {boolean}. - */ - function getFips(): 1 | 0; - /** - * Enables the FIPS compliant crypto provider in a FIPS-enabled Node.js build. Throws an error if FIPS mode is not available. - * @since v10.0.0 - * @param bool `true` to enable FIPS mode. - */ - function setFips(bool: boolean): void; - /** - * ```js - * const { - * getHashes - * } = await import('crypto'); - * - * console.log(getHashes()); // ['DSA', 'DSA-SHA', 'DSA-SHA1', ...] - * ``` - * @since v0.9.3 - * @return An array of the names of the supported hash algorithms, such as `'RSA-SHA256'`. Hash algorithms are also called "digest" algorithms. - */ - function getHashes(): string[]; - /** - * The `ECDH` class is a utility for creating Elliptic Curve Diffie-Hellman (ECDH) - * key exchanges. - * - * Instances of the `ECDH` class can be created using the {@link createECDH} function. - * - * ```js - * import assert from 'assert'; - * - * const { - * createECDH - * } = await import('crypto'); - * - * // Generate Alice's keys... - * const alice = createECDH('secp521r1'); - * const aliceKey = alice.generateKeys(); - * - * // Generate Bob's keys... - * const bob = createECDH('secp521r1'); - * const bobKey = bob.generateKeys(); - * - * // Exchange and generate the secret... - * const aliceSecret = alice.computeSecret(bobKey); - * const bobSecret = bob.computeSecret(aliceKey); - * - * assert.strictEqual(aliceSecret.toString('hex'), bobSecret.toString('hex')); - * // OK - * ``` - * @since v0.11.14 - */ - class ECDH { - private constructor(); - /** - * Converts the EC Diffie-Hellman public key specified by `key` and `curve` to the - * format specified by `format`. The `format` argument specifies point encoding - * and can be `'compressed'`, `'uncompressed'` or `'hybrid'`. The supplied key is - * interpreted using the specified `inputEncoding`, and the returned key is encoded - * using the specified `outputEncoding`. - * - * Use {@link getCurves} to obtain a list of available curve names. - * On recent OpenSSL releases, `openssl ecparam -list_curves` will also display - * the name and description of each available elliptic curve. - * - * If `format` is not specified the point will be returned in `'uncompressed'`format. - * - * If the `inputEncoding` is not provided, `key` is expected to be a `Buffer`,`TypedArray`, or `DataView`. - * - * Example (uncompressing a key): - * - * ```js - * const { - * createECDH, - * ECDH - * } = await import('crypto'); - * - * const ecdh = createECDH('secp256k1'); - * ecdh.generateKeys(); - * - * const compressedKey = ecdh.getPublicKey('hex', 'compressed'); - * - * const uncompressedKey = ECDH.convertKey(compressedKey, - * 'secp256k1', - * 'hex', - * 'hex', - * 'uncompressed'); - * - * // The converted key and the uncompressed public key should be the same - * console.log(uncompressedKey === ecdh.getPublicKey('hex')); - * ``` - * @since v10.0.0 - * @param inputEncoding The `encoding` of the `key` string. - * @param outputEncoding The `encoding` of the return value. - * @param [format='uncompressed'] - */ - static convertKey( - key: BinaryLike, - curve: string, - inputEncoding?: BinaryToTextEncoding, - outputEncoding?: 'latin1' | 'hex' | 'base64' | 'base64url', - format?: 'uncompressed' | 'compressed' | 'hybrid' - ): Buffer | string; - /** - * Generates private and public EC Diffie-Hellman key values, and returns - * the public key in the specified `format` and `encoding`. This key should be - * transferred to the other party. - * - * The `format` argument specifies point encoding and can be `'compressed'` or`'uncompressed'`. If `format` is not specified, the point will be returned in`'uncompressed'` format. - * - * If `encoding` is provided a string is returned; otherwise a `Buffer` is returned. - * @since v0.11.14 - * @param encoding The `encoding` of the return value. - * @param [format='uncompressed'] - */ - generateKeys(): Buffer; - generateKeys(encoding: BinaryToTextEncoding, format?: ECDHKeyFormat): string; - /** - * Computes the shared secret using `otherPublicKey` as the other - * party's public key and returns the computed shared secret. The supplied - * key is interpreted using specified `inputEncoding`, and the returned secret - * is encoded using the specified `outputEncoding`. - * If the `inputEncoding` is not - * provided, `otherPublicKey` is expected to be a `Buffer`, `TypedArray`, or`DataView`. - * - * If `outputEncoding` is given a string will be returned; otherwise a `Buffer` is returned. - * - * `ecdh.computeSecret` will throw an`ERR_CRYPTO_ECDH_INVALID_PUBLIC_KEY` error when `otherPublicKey`lies outside of the elliptic curve. Since `otherPublicKey` is - * usually supplied from a remote user over an insecure network, - * be sure to handle this exception accordingly. - * @since v0.11.14 - * @param inputEncoding The `encoding` of the `otherPublicKey` string. - * @param outputEncoding The `encoding` of the return value. - */ - computeSecret(otherPublicKey: NodeJS.ArrayBufferView): Buffer; - computeSecret(otherPublicKey: string, inputEncoding: BinaryToTextEncoding): Buffer; - computeSecret(otherPublicKey: NodeJS.ArrayBufferView, outputEncoding: BinaryToTextEncoding): string; - computeSecret(otherPublicKey: string, inputEncoding: BinaryToTextEncoding, outputEncoding: BinaryToTextEncoding): string; - /** - * If `encoding` is specified, a string is returned; otherwise a `Buffer` is - * returned. - * @since v0.11.14 - * @param encoding The `encoding` of the return value. - * @return The EC Diffie-Hellman in the specified `encoding`. - */ - getPrivateKey(): Buffer; - getPrivateKey(encoding: BinaryToTextEncoding): string; - /** - * The `format` argument specifies point encoding and can be `'compressed'` or`'uncompressed'`. If `format` is not specified the point will be returned in`'uncompressed'` format. - * - * If `encoding` is specified, a string is returned; otherwise a `Buffer` is - * returned. - * @since v0.11.14 - * @param [encoding] The `encoding` of the return value. - * @param [format='uncompressed'] - * @return The EC Diffie-Hellman public key in the specified `encoding` and `format`. - */ - getPublicKey(encoding?: null, format?: ECDHKeyFormat): Buffer; - getPublicKey(encoding: BinaryToTextEncoding, format?: ECDHKeyFormat): string; - /** - * Sets the EC Diffie-Hellman private key. - * If `encoding` is provided, `privateKey` is expected - * to be a string; otherwise `privateKey` is expected to be a `Buffer`,`TypedArray`, or `DataView`. - * - * If `privateKey` is not valid for the curve specified when the `ECDH` object was - * created, an error is thrown. Upon setting the private key, the associated - * public point (key) is also generated and set in the `ECDH` object. - * @since v0.11.14 - * @param encoding The `encoding` of the `privateKey` string. - */ - setPrivateKey(privateKey: NodeJS.ArrayBufferView): void; - setPrivateKey(privateKey: string, encoding: BinaryToTextEncoding): void; - } - /** - * Creates an Elliptic Curve Diffie-Hellman (`ECDH`) key exchange object using a - * predefined curve specified by the `curveName` string. Use {@link getCurves} to obtain a list of available curve names. On recent - * OpenSSL releases, `openssl ecparam -list_curves` will also display the name - * and description of each available elliptic curve. - * @since v0.11.14 - */ - function createECDH(curveName: string): ECDH; - /** - * This function is based on a constant-time algorithm. - * Returns true if `a` is equal to `b`, without leaking timing information that - * would allow an attacker to guess one of the values. This is suitable for - * comparing HMAC digests or secret values like authentication cookies or [capability urls](https://www.w3.org/TR/capability-urls/). - * - * `a` and `b` must both be `Buffer`s, `TypedArray`s, or `DataView`s, and they - * must have the same byte length. An error is thrown if `a` and `b` have - * different byte lengths. - * - * If at least one of `a` and `b` is a `TypedArray` with more than one byte per - * entry, such as `Uint16Array`, the result will be computed using the platform - * byte order. - * - * Use of `crypto.timingSafeEqual` does not guarantee that the _surrounding_ code - * is timing-safe. Care should be taken to ensure that the surrounding code does - * not introduce timing vulnerabilities. - * @since v6.6.0 - */ - function timingSafeEqual(a: NodeJS.ArrayBufferView, b: NodeJS.ArrayBufferView): boolean; - /** @deprecated since v10.0.0 */ - const DEFAULT_ENCODING: BufferEncoding; - type KeyType = 'rsa' | 'rsa-pss' | 'dsa' | 'ec' | 'ed25519' | 'ed448' | 'x25519' | 'x448'; - type KeyFormat = 'pem' | 'der'; - interface BasePrivateKeyEncodingOptions { - format: T; - cipher?: string | undefined; - passphrase?: string | undefined; - } - interface KeyPairKeyObjectResult { - publicKey: KeyObject; - privateKey: KeyObject; - } - interface ED25519KeyPairKeyObjectOptions {} - interface ED448KeyPairKeyObjectOptions {} - interface X25519KeyPairKeyObjectOptions {} - interface X448KeyPairKeyObjectOptions {} - interface ECKeyPairKeyObjectOptions { - /** - * Name of the curve to use - */ - namedCurve: string; - } - interface RSAKeyPairKeyObjectOptions { - /** - * Key size in bits - */ - modulusLength: number; - /** - * Public exponent - * @default 0x10001 - */ - publicExponent?: number | undefined; - } - interface RSAPSSKeyPairKeyObjectOptions { - /** - * Key size in bits - */ - modulusLength: number; - /** - * Public exponent - * @default 0x10001 - */ - publicExponent?: number | undefined; - /** - * Name of the message digest - */ - hashAlgorithm?: string; - /** - * Name of the message digest used by MGF1 - */ - mgf1HashAlgorithm?: string; - /** - * Minimal salt length in bytes - */ - saltLength?: string; - } - interface DSAKeyPairKeyObjectOptions { - /** - * Key size in bits - */ - modulusLength: number; - /** - * Size of q in bits - */ - divisorLength: number; - } - interface RSAKeyPairOptions { - /** - * Key size in bits - */ - modulusLength: number; - /** - * Public exponent - * @default 0x10001 - */ - publicExponent?: number | undefined; - publicKeyEncoding: { - type: 'pkcs1' | 'spki'; - format: PubF; - }; - privateKeyEncoding: BasePrivateKeyEncodingOptions & { - type: 'pkcs1' | 'pkcs8'; - }; - } - interface RSAPSSKeyPairOptions { - /** - * Key size in bits - */ - modulusLength: number; - /** - * Public exponent - * @default 0x10001 - */ - publicExponent?: number | undefined; - /** - * Name of the message digest - */ - hashAlgorithm?: string; - /** - * Name of the message digest used by MGF1 - */ - mgf1HashAlgorithm?: string; - /** - * Minimal salt length in bytes - */ - saltLength?: string; - publicKeyEncoding: { - type: 'spki'; - format: PubF; - }; - privateKeyEncoding: BasePrivateKeyEncodingOptions & { - type: 'pkcs8'; - }; - } - interface DSAKeyPairOptions { - /** - * Key size in bits - */ - modulusLength: number; - /** - * Size of q in bits - */ - divisorLength: number; - publicKeyEncoding: { - type: 'spki'; - format: PubF; - }; - privateKeyEncoding: BasePrivateKeyEncodingOptions & { - type: 'pkcs8'; - }; - } - interface ECKeyPairOptions { - /** - * Name of the curve to use. - */ - namedCurve: string; - publicKeyEncoding: { - type: 'pkcs1' | 'spki'; - format: PubF; - }; - privateKeyEncoding: BasePrivateKeyEncodingOptions & { - type: 'sec1' | 'pkcs8'; - }; - } - interface ED25519KeyPairOptions { - publicKeyEncoding: { - type: 'spki'; - format: PubF; - }; - privateKeyEncoding: BasePrivateKeyEncodingOptions & { - type: 'pkcs8'; - }; - } - interface ED448KeyPairOptions { - publicKeyEncoding: { - type: 'spki'; - format: PubF; - }; - privateKeyEncoding: BasePrivateKeyEncodingOptions & { - type: 'pkcs8'; - }; - } - interface X25519KeyPairOptions { - publicKeyEncoding: { - type: 'spki'; - format: PubF; - }; - privateKeyEncoding: BasePrivateKeyEncodingOptions & { - type: 'pkcs8'; - }; - } - interface X448KeyPairOptions { - publicKeyEncoding: { - type: 'spki'; - format: PubF; - }; - privateKeyEncoding: BasePrivateKeyEncodingOptions & { - type: 'pkcs8'; - }; - } - interface KeyPairSyncResult { - publicKey: T1; - privateKey: T2; - } - /** - * Generates a new asymmetric key pair of the given `type`. RSA, RSA-PSS, DSA, EC, - * Ed25519, Ed448, X25519, X448, and DH are currently supported. - * - * If a `publicKeyEncoding` or `privateKeyEncoding` was specified, this function - * behaves as if `keyObject.export()` had been called on its result. Otherwise, - * the respective part of the key is returned as a `KeyObject`. - * - * When encoding public keys, it is recommended to use `'spki'`. When encoding - * private keys, it is recommended to use `'pkcs8'` with a strong passphrase, - * and to keep the passphrase confidential. - * - * ```js - * const { - * generateKeyPairSync - * } = await import('crypto'); - * - * const { - * publicKey, - * privateKey, - * } = generateKeyPairSync('rsa', { - * modulusLength: 4096, - * publicKeyEncoding: { - * type: 'spki', - * format: 'pem' - * }, - * privateKeyEncoding: { - * type: 'pkcs8', - * format: 'pem', - * cipher: 'aes-256-cbc', - * passphrase: 'top secret' - * } - * }); - * ``` - * - * The return value `{ publicKey, privateKey }` represents the generated key pair. - * When PEM encoding was selected, the respective key will be a string, otherwise - * it will be a buffer containing the data encoded as DER. - * @since v10.12.0 - * @param type Must be `'rsa'`, `'rsa-pss'`, `'dsa'`, `'ec'`, `'ed25519'`, `'ed448'`, `'x25519'`, `'x448'`, or `'dh'`. - */ - function generateKeyPairSync(type: 'rsa', options: RSAKeyPairOptions<'pem', 'pem'>): KeyPairSyncResult; - function generateKeyPairSync(type: 'rsa', options: RSAKeyPairOptions<'pem', 'der'>): KeyPairSyncResult; - function generateKeyPairSync(type: 'rsa', options: RSAKeyPairOptions<'der', 'pem'>): KeyPairSyncResult; - function generateKeyPairSync(type: 'rsa', options: RSAKeyPairOptions<'der', 'der'>): KeyPairSyncResult; - function generateKeyPairSync(type: 'rsa', options: RSAKeyPairKeyObjectOptions): KeyPairKeyObjectResult; - function generateKeyPairSync(type: 'rsa-pss', options: RSAPSSKeyPairOptions<'pem', 'pem'>): KeyPairSyncResult; - function generateKeyPairSync(type: 'rsa-pss', options: RSAPSSKeyPairOptions<'pem', 'der'>): KeyPairSyncResult; - function generateKeyPairSync(type: 'rsa-pss', options: RSAPSSKeyPairOptions<'der', 'pem'>): KeyPairSyncResult; - function generateKeyPairSync(type: 'rsa-pss', options: RSAPSSKeyPairOptions<'der', 'der'>): KeyPairSyncResult; - function generateKeyPairSync(type: 'rsa-pss', options: RSAPSSKeyPairKeyObjectOptions): KeyPairKeyObjectResult; - function generateKeyPairSync(type: 'dsa', options: DSAKeyPairOptions<'pem', 'pem'>): KeyPairSyncResult; - function generateKeyPairSync(type: 'dsa', options: DSAKeyPairOptions<'pem', 'der'>): KeyPairSyncResult; - function generateKeyPairSync(type: 'dsa', options: DSAKeyPairOptions<'der', 'pem'>): KeyPairSyncResult; - function generateKeyPairSync(type: 'dsa', options: DSAKeyPairOptions<'der', 'der'>): KeyPairSyncResult; - function generateKeyPairSync(type: 'dsa', options: DSAKeyPairKeyObjectOptions): KeyPairKeyObjectResult; - function generateKeyPairSync(type: 'ec', options: ECKeyPairOptions<'pem', 'pem'>): KeyPairSyncResult; - function generateKeyPairSync(type: 'ec', options: ECKeyPairOptions<'pem', 'der'>): KeyPairSyncResult; - function generateKeyPairSync(type: 'ec', options: ECKeyPairOptions<'der', 'pem'>): KeyPairSyncResult; - function generateKeyPairSync(type: 'ec', options: ECKeyPairOptions<'der', 'der'>): KeyPairSyncResult; - function generateKeyPairSync(type: 'ec', options: ECKeyPairKeyObjectOptions): KeyPairKeyObjectResult; - function generateKeyPairSync(type: 'ed25519', options: ED25519KeyPairOptions<'pem', 'pem'>): KeyPairSyncResult; - function generateKeyPairSync(type: 'ed25519', options: ED25519KeyPairOptions<'pem', 'der'>): KeyPairSyncResult; - function generateKeyPairSync(type: 'ed25519', options: ED25519KeyPairOptions<'der', 'pem'>): KeyPairSyncResult; - function generateKeyPairSync(type: 'ed25519', options: ED25519KeyPairOptions<'der', 'der'>): KeyPairSyncResult; - function generateKeyPairSync(type: 'ed25519', options?: ED25519KeyPairKeyObjectOptions): KeyPairKeyObjectResult; - function generateKeyPairSync(type: 'ed448', options: ED448KeyPairOptions<'pem', 'pem'>): KeyPairSyncResult; - function generateKeyPairSync(type: 'ed448', options: ED448KeyPairOptions<'pem', 'der'>): KeyPairSyncResult; - function generateKeyPairSync(type: 'ed448', options: ED448KeyPairOptions<'der', 'pem'>): KeyPairSyncResult; - function generateKeyPairSync(type: 'ed448', options: ED448KeyPairOptions<'der', 'der'>): KeyPairSyncResult; - function generateKeyPairSync(type: 'ed448', options?: ED448KeyPairKeyObjectOptions): KeyPairKeyObjectResult; - function generateKeyPairSync(type: 'x25519', options: X25519KeyPairOptions<'pem', 'pem'>): KeyPairSyncResult; - function generateKeyPairSync(type: 'x25519', options: X25519KeyPairOptions<'pem', 'der'>): KeyPairSyncResult; - function generateKeyPairSync(type: 'x25519', options: X25519KeyPairOptions<'der', 'pem'>): KeyPairSyncResult; - function generateKeyPairSync(type: 'x25519', options: X25519KeyPairOptions<'der', 'der'>): KeyPairSyncResult; - function generateKeyPairSync(type: 'x25519', options?: X25519KeyPairKeyObjectOptions): KeyPairKeyObjectResult; - function generateKeyPairSync(type: 'x448', options: X448KeyPairOptions<'pem', 'pem'>): KeyPairSyncResult; - function generateKeyPairSync(type: 'x448', options: X448KeyPairOptions<'pem', 'der'>): KeyPairSyncResult; - function generateKeyPairSync(type: 'x448', options: X448KeyPairOptions<'der', 'pem'>): KeyPairSyncResult; - function generateKeyPairSync(type: 'x448', options: X448KeyPairOptions<'der', 'der'>): KeyPairSyncResult; - function generateKeyPairSync(type: 'x448', options?: X448KeyPairKeyObjectOptions): KeyPairKeyObjectResult; - /** - * Generates a new asymmetric key pair of the given `type`. RSA, RSA-PSS, DSA, EC, - * Ed25519, Ed448, X25519, X448, and DH are currently supported. - * - * If a `publicKeyEncoding` or `privateKeyEncoding` was specified, this function - * behaves as if `keyObject.export()` had been called on its result. Otherwise, - * the respective part of the key is returned as a `KeyObject`. - * - * It is recommended to encode public keys as `'spki'` and private keys as`'pkcs8'` with encryption for long-term storage: - * - * ```js - * const { - * generateKeyPair - * } = await import('crypto'); - * - * generateKeyPair('rsa', { - * modulusLength: 4096, - * publicKeyEncoding: { - * type: 'spki', - * format: 'pem' - * }, - * privateKeyEncoding: { - * type: 'pkcs8', - * format: 'pem', - * cipher: 'aes-256-cbc', - * passphrase: 'top secret' - * } - * }, (err, publicKey, privateKey) => { - * // Handle errors and use the generated key pair. - * }); - * ``` - * - * On completion, `callback` will be called with `err` set to `undefined` and`publicKey` / `privateKey` representing the generated key pair. - * - * If this method is invoked as its `util.promisify()` ed version, it returns - * a `Promise` for an `Object` with `publicKey` and `privateKey` properties. - * @since v10.12.0 - * @param type Must be `'rsa'`, `'rsa-pss'`, `'dsa'`, `'ec'`, `'ed25519'`, `'ed448'`, `'x25519'`, `'x448'`, or `'dh'`. - */ - function generateKeyPair(type: 'rsa', options: RSAKeyPairOptions<'pem', 'pem'>, callback: (err: Error | null, publicKey: string, privateKey: string) => void): void; - function generateKeyPair(type: 'rsa', options: RSAKeyPairOptions<'pem', 'der'>, callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void): void; - function generateKeyPair(type: 'rsa', options: RSAKeyPairOptions<'der', 'pem'>, callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void): void; - function generateKeyPair(type: 'rsa', options: RSAKeyPairOptions<'der', 'der'>, callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void): void; - function generateKeyPair(type: 'rsa', options: RSAKeyPairKeyObjectOptions, callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void): void; - function generateKeyPair(type: 'rsa-pss', options: RSAPSSKeyPairOptions<'pem', 'pem'>, callback: (err: Error | null, publicKey: string, privateKey: string) => void): void; - function generateKeyPair(type: 'rsa-pss', options: RSAPSSKeyPairOptions<'pem', 'der'>, callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void): void; - function generateKeyPair(type: 'rsa-pss', options: RSAPSSKeyPairOptions<'der', 'pem'>, callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void): void; - function generateKeyPair(type: 'rsa-pss', options: RSAPSSKeyPairOptions<'der', 'der'>, callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void): void; - function generateKeyPair(type: 'rsa-pss', options: RSAPSSKeyPairKeyObjectOptions, callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void): void; - function generateKeyPair(type: 'dsa', options: DSAKeyPairOptions<'pem', 'pem'>, callback: (err: Error | null, publicKey: string, privateKey: string) => void): void; - function generateKeyPair(type: 'dsa', options: DSAKeyPairOptions<'pem', 'der'>, callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void): void; - function generateKeyPair(type: 'dsa', options: DSAKeyPairOptions<'der', 'pem'>, callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void): void; - function generateKeyPair(type: 'dsa', options: DSAKeyPairOptions<'der', 'der'>, callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void): void; - function generateKeyPair(type: 'dsa', options: DSAKeyPairKeyObjectOptions, callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void): void; - function generateKeyPair(type: 'ec', options: ECKeyPairOptions<'pem', 'pem'>, callback: (err: Error | null, publicKey: string, privateKey: string) => void): void; - function generateKeyPair(type: 'ec', options: ECKeyPairOptions<'pem', 'der'>, callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void): void; - function generateKeyPair(type: 'ec', options: ECKeyPairOptions<'der', 'pem'>, callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void): void; - function generateKeyPair(type: 'ec', options: ECKeyPairOptions<'der', 'der'>, callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void): void; - function generateKeyPair(type: 'ec', options: ECKeyPairKeyObjectOptions, callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void): void; - function generateKeyPair(type: 'ed25519', options: ED25519KeyPairOptions<'pem', 'pem'>, callback: (err: Error | null, publicKey: string, privateKey: string) => void): void; - function generateKeyPair(type: 'ed25519', options: ED25519KeyPairOptions<'pem', 'der'>, callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void): void; - function generateKeyPair(type: 'ed25519', options: ED25519KeyPairOptions<'der', 'pem'>, callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void): void; - function generateKeyPair(type: 'ed25519', options: ED25519KeyPairOptions<'der', 'der'>, callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void): void; - function generateKeyPair(type: 'ed25519', options: ED25519KeyPairKeyObjectOptions | undefined, callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void): void; - function generateKeyPair(type: 'ed448', options: ED448KeyPairOptions<'pem', 'pem'>, callback: (err: Error | null, publicKey: string, privateKey: string) => void): void; - function generateKeyPair(type: 'ed448', options: ED448KeyPairOptions<'pem', 'der'>, callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void): void; - function generateKeyPair(type: 'ed448', options: ED448KeyPairOptions<'der', 'pem'>, callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void): void; - function generateKeyPair(type: 'ed448', options: ED448KeyPairOptions<'der', 'der'>, callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void): void; - function generateKeyPair(type: 'ed448', options: ED448KeyPairKeyObjectOptions | undefined, callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void): void; - function generateKeyPair(type: 'x25519', options: X25519KeyPairOptions<'pem', 'pem'>, callback: (err: Error | null, publicKey: string, privateKey: string) => void): void; - function generateKeyPair(type: 'x25519', options: X25519KeyPairOptions<'pem', 'der'>, callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void): void; - function generateKeyPair(type: 'x25519', options: X25519KeyPairOptions<'der', 'pem'>, callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void): void; - function generateKeyPair(type: 'x25519', options: X25519KeyPairOptions<'der', 'der'>, callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void): void; - function generateKeyPair(type: 'x25519', options: X25519KeyPairKeyObjectOptions | undefined, callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void): void; - function generateKeyPair(type: 'x448', options: X448KeyPairOptions<'pem', 'pem'>, callback: (err: Error | null, publicKey: string, privateKey: string) => void): void; - function generateKeyPair(type: 'x448', options: X448KeyPairOptions<'pem', 'der'>, callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void): void; - function generateKeyPair(type: 'x448', options: X448KeyPairOptions<'der', 'pem'>, callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void): void; - function generateKeyPair(type: 'x448', options: X448KeyPairOptions<'der', 'der'>, callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void): void; - function generateKeyPair(type: 'x448', options: X448KeyPairKeyObjectOptions | undefined, callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void): void; - namespace generateKeyPair { - function __promisify__( - type: 'rsa', - options: RSAKeyPairOptions<'pem', 'pem'> - ): Promise<{ - publicKey: string; - privateKey: string; - }>; - function __promisify__( - type: 'rsa', - options: RSAKeyPairOptions<'pem', 'der'> - ): Promise<{ - publicKey: string; - privateKey: Buffer; - }>; - function __promisify__( - type: 'rsa', - options: RSAKeyPairOptions<'der', 'pem'> - ): Promise<{ - publicKey: Buffer; - privateKey: string; - }>; - function __promisify__( - type: 'rsa', - options: RSAKeyPairOptions<'der', 'der'> - ): Promise<{ - publicKey: Buffer; - privateKey: Buffer; - }>; - function __promisify__(type: 'rsa', options: RSAKeyPairKeyObjectOptions): Promise; - function __promisify__( - type: 'rsa-pss', - options: RSAPSSKeyPairOptions<'pem', 'pem'> - ): Promise<{ - publicKey: string; - privateKey: string; - }>; - function __promisify__( - type: 'rsa-pss', - options: RSAPSSKeyPairOptions<'pem', 'der'> - ): Promise<{ - publicKey: string; - privateKey: Buffer; - }>; - function __promisify__( - type: 'rsa-pss', - options: RSAPSSKeyPairOptions<'der', 'pem'> - ): Promise<{ - publicKey: Buffer; - privateKey: string; - }>; - function __promisify__( - type: 'rsa-pss', - options: RSAPSSKeyPairOptions<'der', 'der'> - ): Promise<{ - publicKey: Buffer; - privateKey: Buffer; - }>; - function __promisify__(type: 'rsa-pss', options: RSAPSSKeyPairKeyObjectOptions): Promise; - function __promisify__( - type: 'dsa', - options: DSAKeyPairOptions<'pem', 'pem'> - ): Promise<{ - publicKey: string; - privateKey: string; - }>; - function __promisify__( - type: 'dsa', - options: DSAKeyPairOptions<'pem', 'der'> - ): Promise<{ - publicKey: string; - privateKey: Buffer; - }>; - function __promisify__( - type: 'dsa', - options: DSAKeyPairOptions<'der', 'pem'> - ): Promise<{ - publicKey: Buffer; - privateKey: string; - }>; - function __promisify__( - type: 'dsa', - options: DSAKeyPairOptions<'der', 'der'> - ): Promise<{ - publicKey: Buffer; - privateKey: Buffer; - }>; - function __promisify__(type: 'dsa', options: DSAKeyPairKeyObjectOptions): Promise; - function __promisify__( - type: 'ec', - options: ECKeyPairOptions<'pem', 'pem'> - ): Promise<{ - publicKey: string; - privateKey: string; - }>; - function __promisify__( - type: 'ec', - options: ECKeyPairOptions<'pem', 'der'> - ): Promise<{ - publicKey: string; - privateKey: Buffer; - }>; - function __promisify__( - type: 'ec', - options: ECKeyPairOptions<'der', 'pem'> - ): Promise<{ - publicKey: Buffer; - privateKey: string; - }>; - function __promisify__( - type: 'ec', - options: ECKeyPairOptions<'der', 'der'> - ): Promise<{ - publicKey: Buffer; - privateKey: Buffer; - }>; - function __promisify__(type: 'ec', options: ECKeyPairKeyObjectOptions): Promise; - function __promisify__( - type: 'ed25519', - options: ED25519KeyPairOptions<'pem', 'pem'> - ): Promise<{ - publicKey: string; - privateKey: string; - }>; - function __promisify__( - type: 'ed25519', - options: ED25519KeyPairOptions<'pem', 'der'> - ): Promise<{ - publicKey: string; - privateKey: Buffer; - }>; - function __promisify__( - type: 'ed25519', - options: ED25519KeyPairOptions<'der', 'pem'> - ): Promise<{ - publicKey: Buffer; - privateKey: string; - }>; - function __promisify__( - type: 'ed25519', - options: ED25519KeyPairOptions<'der', 'der'> - ): Promise<{ - publicKey: Buffer; - privateKey: Buffer; - }>; - function __promisify__(type: 'ed25519', options?: ED25519KeyPairKeyObjectOptions): Promise; - function __promisify__( - type: 'ed448', - options: ED448KeyPairOptions<'pem', 'pem'> - ): Promise<{ - publicKey: string; - privateKey: string; - }>; - function __promisify__( - type: 'ed448', - options: ED448KeyPairOptions<'pem', 'der'> - ): Promise<{ - publicKey: string; - privateKey: Buffer; - }>; - function __promisify__( - type: 'ed448', - options: ED448KeyPairOptions<'der', 'pem'> - ): Promise<{ - publicKey: Buffer; - privateKey: string; - }>; - function __promisify__( - type: 'ed448', - options: ED448KeyPairOptions<'der', 'der'> - ): Promise<{ - publicKey: Buffer; - privateKey: Buffer; - }>; - function __promisify__(type: 'ed448', options?: ED448KeyPairKeyObjectOptions): Promise; - function __promisify__( - type: 'x25519', - options: X25519KeyPairOptions<'pem', 'pem'> - ): Promise<{ - publicKey: string; - privateKey: string; - }>; - function __promisify__( - type: 'x25519', - options: X25519KeyPairOptions<'pem', 'der'> - ): Promise<{ - publicKey: string; - privateKey: Buffer; - }>; - function __promisify__( - type: 'x25519', - options: X25519KeyPairOptions<'der', 'pem'> - ): Promise<{ - publicKey: Buffer; - privateKey: string; - }>; - function __promisify__( - type: 'x25519', - options: X25519KeyPairOptions<'der', 'der'> - ): Promise<{ - publicKey: Buffer; - privateKey: Buffer; - }>; - function __promisify__(type: 'x25519', options?: X25519KeyPairKeyObjectOptions): Promise; - function __promisify__( - type: 'x448', - options: X448KeyPairOptions<'pem', 'pem'> - ): Promise<{ - publicKey: string; - privateKey: string; - }>; - function __promisify__( - type: 'x448', - options: X448KeyPairOptions<'pem', 'der'> - ): Promise<{ - publicKey: string; - privateKey: Buffer; - }>; - function __promisify__( - type: 'x448', - options: X448KeyPairOptions<'der', 'pem'> - ): Promise<{ - publicKey: Buffer; - privateKey: string; - }>; - function __promisify__( - type: 'x448', - options: X448KeyPairOptions<'der', 'der'> - ): Promise<{ - publicKey: Buffer; - privateKey: Buffer; - }>; - function __promisify__(type: 'x448', options?: X448KeyPairKeyObjectOptions): Promise; - } - /** - * Calculates and returns the signature for `data` using the given private key and - * algorithm. If `algorithm` is `null` or `undefined`, then the algorithm is - * dependent upon the key type (especially Ed25519 and Ed448). - * - * If `key` is not a `KeyObject`, this function behaves as if `key` had been - * passed to {@link createPrivateKey}. If it is an object, the following - * additional properties can be passed: - * - * If the `callback` function is provided this function uses libuv's threadpool. - * @since v12.0.0 - */ - function sign(algorithm: string | null | undefined, data: NodeJS.ArrayBufferView, key: KeyLike | SignKeyObjectInput | SignPrivateKeyInput): Buffer; - function sign( - algorithm: string | null | undefined, - data: NodeJS.ArrayBufferView, - key: KeyLike | SignKeyObjectInput | SignPrivateKeyInput, - callback: (error: Error | null, data: Buffer) => void - ): void; - /** - * Verifies the given signature for `data` using the given key and algorithm. If`algorithm` is `null` or `undefined`, then the algorithm is dependent upon the - * key type (especially Ed25519 and Ed448). - * - * If `key` is not a `KeyObject`, this function behaves as if `key` had been - * passed to {@link createPublicKey}. If it is an object, the following - * additional properties can be passed: - * - * The `signature` argument is the previously calculated signature for the `data`. - * - * Because public keys can be derived from private keys, a private key or a public - * key may be passed for `key`. - * - * If the `callback` function is provided this function uses libuv's threadpool. - * @since v12.0.0 - */ - function verify(algorithm: string | null | undefined, data: NodeJS.ArrayBufferView, key: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput, signature: NodeJS.ArrayBufferView): boolean; - function verify( - algorithm: string | null | undefined, - data: NodeJS.ArrayBufferView, - key: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput, - signature: NodeJS.ArrayBufferView, - callback: (error: Error | null, result: boolean) => void - ): void; - /** - * Computes the Diffie-Hellman secret based on a `privateKey` and a `publicKey`. - * Both keys must have the same `asymmetricKeyType`, which must be one of `'dh'`(for Diffie-Hellman), `'ec'` (for ECDH), `'x448'`, or `'x25519'` (for ECDH-ES). - * @since v13.9.0, v12.17.0 - */ - function diffieHellman(options: { privateKey: KeyObject; publicKey: KeyObject }): Buffer; - type CipherMode = 'cbc' | 'ccm' | 'cfb' | 'ctr' | 'ecb' | 'gcm' | 'ocb' | 'ofb' | 'stream' | 'wrap' | 'xts'; - interface CipherInfoOptions { - /** - * A test key length. - */ - keyLength?: number | undefined; - /** - * A test IV length. - */ - ivLength?: number | undefined; - } - interface CipherInfo { - /** - * The name of the cipher. - */ - name: string; - /** - * The nid of the cipher. - */ - nid: number; - /** - * The block size of the cipher in bytes. - * This property is omitted when mode is 'stream'. - */ - blockSize?: number | undefined; - /** - * The expected or default initialization vector length in bytes. - * This property is omitted if the cipher does not use an initialization vector. - */ - ivLength?: number | undefined; - /** - * The expected or default key length in bytes. - */ - keyLength: number; - /** - * The cipher mode. - */ - mode: CipherMode; - } - /** - * Returns information about a given cipher. - * - * Some ciphers accept variable length keys and initialization vectors. By default, - * the `crypto.getCipherInfo()` method will return the default values for these - * ciphers. To test if a given key length or iv length is acceptable for given - * cipher, use the `keyLength` and `ivLength` options. If the given values are - * unacceptable, `undefined` will be returned. - * @since v15.0.0 - * @param nameOrNid The name or nid of the cipher to query. - */ - function getCipherInfo(nameOrNid: string | number, options?: CipherInfoOptions): CipherInfo | undefined; - /** - * HKDF is a simple key derivation function defined in RFC 5869\. The given `ikm`,`salt` and `info` are used with the `digest` to derive a key of `keylen` bytes. - * - * The supplied `callback` function is called with two arguments: `err` and`derivedKey`. If an errors occurs while deriving the key, `err` will be set; - * otherwise `err` will be `null`. The successfully generated `derivedKey` will - * be passed to the callback as an [ArrayBuffer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer). An error will be thrown if any - * of the input arguments specify invalid values or types. - * - * ```js - * import { Buffer } from 'buffer'; - * const { - * hkdf - * } = await import('crypto'); - * - * hkdf('sha512', 'key', 'salt', 'info', 64, (err, derivedKey) => { - * if (err) throw err; - * console.log(Buffer.from(derivedKey).toString('hex')); // '24156e2...5391653' - * }); - * ``` - * @since v15.0.0 - * @param digest The digest algorithm to use. - * @param ikm The input keying material. It must be at least one byte in length. - * @param salt The salt value. Must be provided but can be zero-length. - * @param info Additional info value. Must be provided but can be zero-length, and cannot be more than 1024 bytes. - * @param keylen The length of the key to generate. Must be greater than 0. The maximum allowable value is `255` times the number of bytes produced by the selected digest function (e.g. `sha512` - * generates 64-byte hashes, making the maximum HKDF output 16320 bytes). - */ - function hkdf(digest: string, irm: BinaryLike | KeyObject, salt: BinaryLike, info: BinaryLike, keylen: number, callback: (err: Error | null, derivedKey: ArrayBuffer) => void): void; - /** - * Provides a synchronous HKDF key derivation function as defined in RFC 5869\. The - * given `ikm`, `salt` and `info` are used with the `digest` to derive a key of`keylen` bytes. - * - * The successfully generated `derivedKey` will be returned as an [ArrayBuffer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer). - * - * An error will be thrown if any of the input arguments specify invalid values or - * types, or if the derived key cannot be generated. - * - * ```js - * import { Buffer } from 'buffer'; - * const { - * hkdfSync - * } = await import('crypto'); - * - * const derivedKey = hkdfSync('sha512', 'key', 'salt', 'info', 64); - * console.log(Buffer.from(derivedKey).toString('hex')); // '24156e2...5391653' - * ``` - * @since v15.0.0 - * @param digest The digest algorithm to use. - * @param ikm The input keying material. It must be at least one byte in length. - * @param salt The salt value. Must be provided but can be zero-length. - * @param info Additional info value. Must be provided but can be zero-length, and cannot be more than 1024 bytes. - * @param keylen The length of the key to generate. Must be greater than 0. The maximum allowable value is `255` times the number of bytes produced by the selected digest function (e.g. `sha512` - * generates 64-byte hashes, making the maximum HKDF output 16320 bytes). - */ - function hkdfSync(digest: string, ikm: BinaryLike | KeyObject, salt: BinaryLike, info: BinaryLike, keylen: number): ArrayBuffer; - interface SecureHeapUsage { - /** - * The total allocated secure heap size as specified using the `--secure-heap=n` command-line flag. - */ - total: number; - /** - * The minimum allocation from the secure heap as specified using the `--secure-heap-min` command-line flag. - */ - min: number; - /** - * The total number of bytes currently allocated from the secure heap. - */ - used: number; - /** - * The calculated ratio of `used` to `total` allocated bytes. - */ - utilization: number; - } - /** - * @since v15.6.0 - */ - function secureHeapUsed(): SecureHeapUsage; - interface RandomUUIDOptions { - /** - * By default, to improve performance, - * Node.js will pre-emptively generate and persistently cache enough - * random data to generate up to 128 random UUIDs. To generate a UUID - * without using the cache, set `disableEntropyCache` to `true`. - * - * @default `false` - */ - disableEntropyCache?: boolean | undefined; - } - /** - * Generates a random [RFC 4122](https://www.rfc-editor.org/rfc/rfc4122.txt) version 4 UUID. The UUID is generated using a - * cryptographic pseudorandom number generator. - * @since v15.6.0, v14.17.0 - */ - function randomUUID(options?: RandomUUIDOptions): string; - interface X509CheckOptions { - /** - * @default 'always' - */ - subject: 'always' | 'never'; - /** - * @default true - */ - wildcards: boolean; - /** - * @default true - */ - partialWildcards: boolean; - /** - * @default false - */ - multiLabelWildcards: boolean; - /** - * @default false - */ - singleLabelSubdomains: boolean; - } - /** - * Encapsulates an X509 certificate and provides read-only access to - * its information. - * - * ```js - * const { X509Certificate } = await import('crypto'); - * - * const x509 = new X509Certificate('{... pem encoded cert ...}'); - * - * console.log(x509.subject); - * ``` - * @since v15.6.0 - */ - class X509Certificate { - /** - * Will be \`true\` if this is a Certificate Authority (CA) certificate. - * @since v15.6.0 - */ - readonly ca: boolean; - /** - * The SHA-1 fingerprint of this certificate. - * - * Because SHA-1 is cryptographically broken and because the security of SHA-1 is - * significantly worse than that of algorithms that are commonly used to sign - * certificates, consider using `x509.fingerprint256` instead. - * @since v15.6.0 - */ - readonly fingerprint: string; - /** - * The SHA-256 fingerprint of this certificate. - * @since v15.6.0 - */ - readonly fingerprint256: string; - /** - * The SHA-512 fingerprint of this certificate. - * @since v16.14.0 - */ - readonly fingerprint512: string; - /** - * The complete subject of this certificate. - * @since v15.6.0 - */ - readonly subject: string; - /** - * The subject alternative name specified for this certificate or `undefined` - * if not available. - * @since v15.6.0 - */ - readonly subjectAltName: string | undefined; - /** - * The information access content of this certificate or `undefined` if not - * available. - * @since v15.6.0 - */ - readonly infoAccess: string | undefined; - /** - * An array detailing the key usages for this certificate. - * @since v15.6.0 - */ - readonly keyUsage: string[]; - /** - * The issuer identification included in this certificate. - * @since v15.6.0 - */ - readonly issuer: string; - /** - * The issuer certificate or `undefined` if the issuer certificate is not - * available. - * @since v15.9.0 - */ - readonly issuerCertificate?: X509Certificate | undefined; - /** - * The public key `KeyObject` for this certificate. - * @since v15.6.0 - */ - readonly publicKey: KeyObject; - /** - * A `Buffer` containing the DER encoding of this certificate. - * @since v15.6.0 - */ - readonly raw: Buffer; - /** - * The serial number of this certificate. - * - * Serial numbers are assigned by certificate authorities and do not uniquely - * identify certificates. Consider using `x509.fingerprint256` as a unique - * identifier instead. - * @since v15.6.0 - */ - readonly serialNumber: string; - /** - * The date/time from which this certificate is considered valid. - * @since v15.6.0 - */ - readonly validFrom: string; - /** - * The date/time until which this certificate is considered valid. - * @since v15.6.0 - */ - readonly validTo: string; - constructor(buffer: BinaryLike); - /** - * Checks whether the certificate matches the given email address. - * - * If the `'subject'` option is undefined or set to `'default'`, the certificate - * subject is only considered if the subject alternative name extension either does - * not exist or does not contain any email addresses. - * - * If the `'subject'` option is set to `'always'` and if the subject alternative - * name extension either does not exist or does not contain a matching email - * address, the certificate subject is considered. - * - * If the `'subject'` option is set to `'never'`, the certificate subject is never - * considered, even if the certificate contains no subject alternative names. - * @since v15.6.0 - * @return Returns `email` if the certificate matches, `undefined` if it does not. - */ - checkEmail(email: string, options?: Pick): string | undefined; - /** - * Checks whether the certificate matches the given host name. - * - * If the certificate matches the given host name, the matching subject name is - * returned. The returned name might be an exact match (e.g., `foo.example.com`) - * or it might contain wildcards (e.g., `*.example.com`). Because host name - * comparisons are case-insensitive, the returned subject name might also differ - * from the given `name` in capitalization. - * - * If the `'subject'` option is undefined or set to `'default'`, the certificate - * subject is only considered if the subject alternative name extension either does - * not exist or does not contain any DNS names. This behavior is consistent with [RFC 2818](https://www.rfc-editor.org/rfc/rfc2818.txt) ("HTTP Over TLS"). - * - * If the `'subject'` option is set to `'always'` and if the subject alternative - * name extension either does not exist or does not contain a matching DNS name, - * the certificate subject is considered. - * - * If the `'subject'` option is set to `'never'`, the certificate subject is never - * considered, even if the certificate contains no subject alternative names. - * @since v15.6.0 - * @return Returns a subject name that matches `name`, or `undefined` if no subject name matches `name`. - */ - checkHost(name: string, options?: X509CheckOptions): string | undefined; - /** - * Checks whether the certificate matches the given IP address (IPv4 or IPv6). - * - * Only [RFC 5280](https://www.rfc-editor.org/rfc/rfc5280.txt) `iPAddress` subject alternative names are considered, and they - * must match the given `ip` address exactly. Other subject alternative names as - * well as the subject field of the certificate are ignored. - * @since v15.6.0 - * @return Returns `ip` if the certificate matches, `undefined` if it does not. - */ - checkIP(ip: string): string | undefined; - /** - * Checks whether this certificate was issued by the given `otherCert`. - * @since v15.6.0 - */ - checkIssued(otherCert: X509Certificate): boolean; - /** - * Checks whether the public key for this certificate is consistent with - * the given private key. - * @since v15.6.0 - * @param privateKey A private key. - */ - checkPrivateKey(privateKey: KeyObject): boolean; - /** - * There is no standard JSON encoding for X509 certificates. The`toJSON()` method returns a string containing the PEM encoded - * certificate. - * @since v15.6.0 - */ - toJSON(): string; - /** - * Returns information about this certificate using the legacy `certificate object` encoding. - * @since v15.6.0 - */ - toLegacyObject(): PeerCertificate; - /** - * Returns the PEM-encoded certificate. - * @since v15.6.0 - */ - toString(): string; - /** - * Verifies that this certificate was signed by the given public key. - * Does not perform any other validation checks on the certificate. - * @since v15.6.0 - * @param publicKey A public key. - */ - verify(publicKey: KeyObject): boolean; - } - type LargeNumberLike = NodeJS.ArrayBufferView | SharedArrayBuffer | ArrayBuffer | bigint; - interface GeneratePrimeOptions { - add?: LargeNumberLike | undefined; - rem?: LargeNumberLike | undefined; - /** - * @default false - */ - safe?: boolean | undefined; - bigint?: boolean | undefined; - } - interface GeneratePrimeOptionsBigInt extends GeneratePrimeOptions { - bigint: true; - } - interface GeneratePrimeOptionsArrayBuffer extends GeneratePrimeOptions { - bigint?: false | undefined; - } - /** - * Generates a pseudorandom prime of `size` bits. - * - * If `options.safe` is `true`, the prime will be a safe prime -- that is,`(prime - 1) / 2` will also be a prime. - * - * The `options.add` and `options.rem` parameters can be used to enforce additional - * requirements, e.g., for Diffie-Hellman: - * - * * If `options.add` and `options.rem` are both set, the prime will satisfy the - * condition that `prime % add = rem`. - * * If only `options.add` is set and `options.safe` is not `true`, the prime will - * satisfy the condition that `prime % add = 1`. - * * If only `options.add` is set and `options.safe` is set to `true`, the prime - * will instead satisfy the condition that `prime % add = 3`. This is necessary - * because `prime % add = 1` for `options.add > 2` would contradict the condition - * enforced by `options.safe`. - * * `options.rem` is ignored if `options.add` is not given. - * - * Both `options.add` and `options.rem` must be encoded as big-endian sequences - * if given as an `ArrayBuffer`, `SharedArrayBuffer`, `TypedArray`, `Buffer`, or`DataView`. - * - * By default, the prime is encoded as a big-endian sequence of octets - * in an [ArrayBuffer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer). If the `bigint` option is `true`, then a - * [bigint](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt) is provided. - * @since v15.8.0 - * @param size The size (in bits) of the prime to generate. - */ - function generatePrime(size: number, callback: (err: Error | null, prime: ArrayBuffer) => void): void; - function generatePrime(size: number, options: GeneratePrimeOptionsBigInt, callback: (err: Error | null, prime: bigint) => void): void; - function generatePrime(size: number, options: GeneratePrimeOptionsArrayBuffer, callback: (err: Error | null, prime: ArrayBuffer) => void): void; - function generatePrime(size: number, options: GeneratePrimeOptions, callback: (err: Error | null, prime: ArrayBuffer | bigint) => void): void; - /** - * Generates a pseudorandom prime of `size` bits. - * - * If `options.safe` is `true`, the prime will be a safe prime -- that is,`(prime - 1) / 2` will also be a prime. - * - * The `options.add` and `options.rem` parameters can be used to enforce additional - * requirements, e.g., for Diffie-Hellman: - * - * * If `options.add` and `options.rem` are both set, the prime will satisfy the - * condition that `prime % add = rem`. - * * If only `options.add` is set and `options.safe` is not `true`, the prime will - * satisfy the condition that `prime % add = 1`. - * * If only `options.add` is set and `options.safe` is set to `true`, the prime - * will instead satisfy the condition that `prime % add = 3`. This is necessary - * because `prime % add = 1` for `options.add > 2` would contradict the condition - * enforced by `options.safe`. - * * `options.rem` is ignored if `options.add` is not given. - * - * Both `options.add` and `options.rem` must be encoded as big-endian sequences - * if given as an `ArrayBuffer`, `SharedArrayBuffer`, `TypedArray`, `Buffer`, or`DataView`. - * - * By default, the prime is encoded as a big-endian sequence of octets - * in an [ArrayBuffer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer). If the `bigint` option is `true`, then a - * [bigint](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt) is provided. - * @since v15.8.0 - * @param size The size (in bits) of the prime to generate. - */ - function generatePrimeSync(size: number): ArrayBuffer; - function generatePrimeSync(size: number, options: GeneratePrimeOptionsBigInt): bigint; - function generatePrimeSync(size: number, options: GeneratePrimeOptionsArrayBuffer): ArrayBuffer; - function generatePrimeSync(size: number, options: GeneratePrimeOptions): ArrayBuffer | bigint; - interface CheckPrimeOptions { - /** - * The number of Miller-Rabin probabilistic primality iterations to perform. - * When the value is 0 (zero), a number of checks is used that yields a false positive rate of at most `2**-64` for random input. - * Care must be used when selecting a number of checks. - * Refer to the OpenSSL documentation for the BN_is_prime_ex function nchecks options for more details. - * - * @default 0 - */ - checks?: number | undefined; - } - /** - * Checks the primality of the `candidate`. - * @since v15.8.0 - * @param candidate A possible prime encoded as a sequence of big endian octets of arbitrary length. - */ - function checkPrime(value: LargeNumberLike, callback: (err: Error | null, result: boolean) => void): void; - function checkPrime(value: LargeNumberLike, options: CheckPrimeOptions, callback: (err: Error | null, result: boolean) => void): void; - /** - * Checks the primality of the `candidate`. - * @since v15.8.0 - * @param candidate A possible prime encoded as a sequence of big endian octets of arbitrary length. - * @return `true` if the candidate is a prime with an error probability less than `0.25 ** options.checks`. - */ - function checkPrimeSync(candidate: LargeNumberLike, options?: CheckPrimeOptions): boolean; - /** - * Load and set the `engine` for some or all OpenSSL functions (selected by flags). - * - * `engine` could be either an id or a path to the engine's shared library. - * - * The optional `flags` argument uses `ENGINE_METHOD_ALL` by default. - * The `flags` is a bit field taking one of or a mix of the following flags (defined in `crypto.constants`): - * - * - `crypto.constants.ENGINE_METHOD_RSA` - * - `crypto.constants.ENGINE_METHOD_DSA` - * - `crypto.constants.ENGINE_METHOD_DH` - * - `crypto.constants.ENGINE_METHOD_RAND` - * - `crypto.constants.ENGINE_METHOD_EC` - * - `crypto.constants.ENGINE_METHOD_CIPHERS` - * - `crypto.constants.ENGINE_METHOD_DIGESTS` - * - `crypto.constants.ENGINE_METHOD_PKEY_METHS` - * - `crypto.constants.ENGINE_METHOD_PKEY_ASN1_METHS` - * - `crypto.constants.ENGINE_METHOD_ALL` - * - `crypto.constants.ENGINE_METHOD_NONE` - * - * The flags below are deprecated in OpenSSL-1.1.0. - * - * - `crypto.constants.ENGINE_METHOD_ECDH` - * - `crypto.constants.ENGINE_METHOD_ECDSA` - * - `crypto.constants.ENGINE_METHOD_STORE` - * @since v0.11.11 - * @param [flags=crypto.constants.ENGINE_METHOD_ALL] - */ - function setEngine(engine: string, flags?: number): void; - /** - * A convenient alias for `crypto.webcrypto.getRandomValues()`. - * This implementation is not compliant with the Web Crypto spec, - * to write web-compatible code use `crypto.webcrypto.getRandomValues()` instead. - * @since v17.4.0 - * @returns Returns `typedArray`. - */ - function getRandomValues(typedArray: T): T; - /** - * A convenient alias for `crypto.webcrypto.subtle`. - * @since v17.4.0 - */ - const subtle: webcrypto.SubtleCrypto; - /** - * An implementation of the Web Crypto API standard. - * - * See the {@link https://nodejs.org/docs/latest/api/webcrypto.html Web Crypto API documentation} for details. - * @since v15.0.0 - */ - const webcrypto: webcrypto.Crypto; - namespace webcrypto { - type BufferSource = ArrayBufferView | ArrayBuffer; - type KeyFormat = 'jwk' | 'pkcs8' | 'raw' | 'spki'; - type KeyType = 'private' | 'public' | 'secret'; - type KeyUsage = 'decrypt' | 'deriveBits' | 'deriveKey' | 'encrypt' | 'sign' | 'unwrapKey' | 'verify' | 'wrapKey'; - type AlgorithmIdentifier = Algorithm | string; - type HashAlgorithmIdentifier = AlgorithmIdentifier; - type NamedCurve = string; - type BigInteger = Uint8Array; - interface AesCbcParams extends Algorithm { - iv: BufferSource; - } - interface AesCtrParams extends Algorithm { - counter: BufferSource; - length: number; - } - interface AesDerivedKeyParams extends Algorithm { - length: number; - } - interface AesGcmParams extends Algorithm { - additionalData?: BufferSource; - iv: BufferSource; - tagLength?: number; - } - interface AesKeyAlgorithm extends KeyAlgorithm { - length: number; - } - interface AesKeyGenParams extends Algorithm { - length: number; - } - interface Algorithm { - name: string; - } - interface EcKeyAlgorithm extends KeyAlgorithm { - namedCurve: NamedCurve; - } - interface EcKeyGenParams extends Algorithm { - namedCurve: NamedCurve; - } - interface EcKeyImportParams extends Algorithm { - namedCurve: NamedCurve; - } - interface EcdhKeyDeriveParams extends Algorithm { - public: CryptoKey; - } - interface EcdsaParams extends Algorithm { - hash: HashAlgorithmIdentifier; - } - interface Ed448Params extends Algorithm { - context?: BufferSource; - } - interface HkdfParams extends Algorithm { - hash: HashAlgorithmIdentifier; - info: BufferSource; - salt: BufferSource; - } - interface HmacImportParams extends Algorithm { - hash: HashAlgorithmIdentifier; - length?: number; - } - interface HmacKeyAlgorithm extends KeyAlgorithm { - hash: KeyAlgorithm; - length: number; - } - interface HmacKeyGenParams extends Algorithm { - hash: HashAlgorithmIdentifier; - length?: number; - } - interface JsonWebKey { - alg?: string; - crv?: string; - d?: string; - dp?: string; - dq?: string; - e?: string; - ext?: boolean; - k?: string; - key_ops?: string[]; - kty?: string; - n?: string; - oth?: RsaOtherPrimesInfo[]; - p?: string; - q?: string; - qi?: string; - use?: string; - x?: string; - y?: string; - } - interface KeyAlgorithm { - name: string; - } - interface Pbkdf2Params extends Algorithm { - hash: HashAlgorithmIdentifier; - iterations: number; - salt: BufferSource; - } - interface RsaHashedImportParams extends Algorithm { - hash: HashAlgorithmIdentifier; - } - interface RsaHashedKeyAlgorithm extends RsaKeyAlgorithm { - hash: KeyAlgorithm; - } - interface RsaHashedKeyGenParams extends RsaKeyGenParams { - hash: HashAlgorithmIdentifier; - } - interface RsaKeyAlgorithm extends KeyAlgorithm { - modulusLength: number; - publicExponent: BigInteger; - } - interface RsaKeyGenParams extends Algorithm { - modulusLength: number; - publicExponent: BigInteger; - } - interface RsaOaepParams extends Algorithm { - label?: BufferSource; - } - interface RsaOtherPrimesInfo { - d?: string; - r?: string; - t?: string; - } - interface RsaPssParams extends Algorithm { - saltLength: number; - } - /** - * Calling `require('node:crypto').webcrypto` returns an instance of the `Crypto` class. - * `Crypto` is a singleton that provides access to the remainder of the crypto API. - * @since v15.0.0 - */ - interface Crypto { - /** - * Provides access to the `SubtleCrypto` API. - * @since v15.0.0 - */ - readonly subtle: SubtleCrypto; - /** - * Generates cryptographically strong random values. - * The given `typedArray` is filled with random values, and a reference to `typedArray` is returned. - * - * The given `typedArray` must be an integer-based instance of {@link NodeJS.TypedArray}, i.e. `Float32Array` and `Float64Array` are not accepted. - * - * An error will be thrown if the given `typedArray` is larger than 65,536 bytes. - * @since v15.0.0 - */ - getRandomValues>(typedArray: T): T; - /** - * Generates a random {@link https://www.rfc-editor.org/rfc/rfc4122.txt RFC 4122} version 4 UUID. - * The UUID is generated using a cryptographic pseudorandom number generator. - * @since v16.7.0 - */ - randomUUID(): string; - CryptoKey: CryptoKeyConstructor; - } - // This constructor throws ILLEGAL_CONSTRUCTOR so it should not be newable. - interface CryptoKeyConstructor { - /** Illegal constructor */ - (_: { readonly _: unique symbol }): never; // Allows instanceof to work but not be callable by the user. - readonly length: 0; - readonly name: 'CryptoKey'; - readonly prototype: CryptoKey; - } - /** - * @since v15.0.0 - */ - interface CryptoKey { - /** - * An object detailing the algorithm for which the key can be used along with additional algorithm-specific parameters. - * @since v15.0.0 - */ - readonly algorithm: KeyAlgorithm; - /** - * When `true`, the {@link CryptoKey} can be extracted using either `subtleCrypto.exportKey()` or `subtleCrypto.wrapKey()`. - * @since v15.0.0 - */ - readonly extractable: boolean; - /** - * A string identifying whether the key is a symmetric (`'secret'`) or asymmetric (`'private'` or `'public'`) key. - * @since v15.0.0 - */ - readonly type: KeyType; - /** - * An array of strings identifying the operations for which the key may be used. - * - * The possible usages are: - * - `'encrypt'` - The key may be used to encrypt data. - * - `'decrypt'` - The key may be used to decrypt data. - * - `'sign'` - The key may be used to generate digital signatures. - * - `'verify'` - The key may be used to verify digital signatures. - * - `'deriveKey'` - The key may be used to derive a new key. - * - `'deriveBits'` - The key may be used to derive bits. - * - `'wrapKey'` - The key may be used to wrap another key. - * - `'unwrapKey'` - The key may be used to unwrap another key. - * - * Valid key usages depend on the key algorithm (identified by `cryptokey.algorithm.name`). - * @since v15.0.0 - */ - readonly usages: KeyUsage[]; - } - /** - * The `CryptoKeyPair` is a simple dictionary object with `publicKey` and `privateKey` properties, representing an asymmetric key pair. - * @since v15.0.0 - */ - interface CryptoKeyPair { - /** - * A {@link CryptoKey} whose type will be `'private'`. - * @since v15.0.0 - */ - privateKey: CryptoKey; - /** - * A {@link CryptoKey} whose type will be `'public'`. - * @since v15.0.0 - */ - publicKey: CryptoKey; - } - /** - * @since v15.0.0 - */ - interface SubtleCrypto { - /** - * Using the method and parameters specified in `algorithm` and the keying material provided by `key`, - * `subtle.decrypt()` attempts to decipher the provided `data`. If successful, - * the returned promise will be resolved with an `` containing the plaintext result. - * - * The algorithms currently supported include: - * - * - `'RSA-OAEP'` - * - `'AES-CTR'` - * - `'AES-CBC'` - * - `'AES-GCM'` - * @since v15.0.0 - */ - decrypt(algorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams, key: CryptoKey, data: BufferSource): Promise; - /** - * Using the method and parameters specified in `algorithm` and the keying material provided by `baseKey`, - * `subtle.deriveBits()` attempts to generate `length` bits. - * The Node.js implementation requires that when `length` is a number it must be multiple of `8`. - * When `length` is `null` the maximum number of bits for a given algorithm is generated. This is allowed - * for the `'ECDH'`, `'X25519'`, and `'X448'` algorithms. - * If successful, the returned promise will be resolved with an `` containing the generated data. - * - * The algorithms currently supported include: - * - * - `'ECDH'` - * - `'X25519'` - * - `'X448'` - * - `'HKDF'` - * - `'PBKDF2'` - * @since v15.0.0 - */ - deriveBits(algorithm: EcdhKeyDeriveParams, baseKey: CryptoKey, length: number | null): Promise; - deriveBits(algorithm: AlgorithmIdentifier | HkdfParams | Pbkdf2Params, baseKey: CryptoKey, length: number): Promise; - /** - * Using the method and parameters specified in `algorithm`, and the keying material provided by `baseKey`, - * `subtle.deriveKey()` attempts to generate a new ` based on the method and parameters in `derivedKeyAlgorithm`. - * - * Calling `subtle.deriveKey()` is equivalent to calling `subtle.deriveBits()` to generate raw keying material, - * then passing the result into the `subtle.importKey()` method using the `deriveKeyAlgorithm`, `extractable`, and `keyUsages` parameters as input. - * - * The algorithms currently supported include: - * - * - `'ECDH'` - * - `'X25519'` - * - `'X448'` - * - `'HKDF'` - * - `'PBKDF2'` - * @param keyUsages See {@link https://nodejs.org/docs/latest/api/webcrypto.html#cryptokeyusages Key usages}. - * @since v15.0.0 - */ - deriveKey( - algorithm: AlgorithmIdentifier | EcdhKeyDeriveParams | HkdfParams | Pbkdf2Params, - baseKey: CryptoKey, - derivedKeyAlgorithm: AlgorithmIdentifier | AesDerivedKeyParams | HmacImportParams | HkdfParams | Pbkdf2Params, - extractable: boolean, - keyUsages: ReadonlyArray - ): Promise; - /** - * Using the method identified by `algorithm`, `subtle.digest()` attempts to generate a digest of `data`. - * If successful, the returned promise is resolved with an `` containing the computed digest. - * - * If `algorithm` is provided as a ``, it must be one of: - * - * - `'SHA-1'` - * - `'SHA-256'` - * - `'SHA-384'` - * - `'SHA-512'` - * - * If `algorithm` is provided as an ``, it must have a `name` property whose value is one of the above. - * @since v15.0.0 - */ - digest(algorithm: AlgorithmIdentifier, data: BufferSource): Promise; - /** - * Using the method and parameters specified by `algorithm` and the keying material provided by `key`, - * `subtle.encrypt()` attempts to encipher `data`. If successful, - * the returned promise is resolved with an `` containing the encrypted result. - * - * The algorithms currently supported include: - * - * - `'RSA-OAEP'` - * - `'AES-CTR'` - * - `'AES-CBC'` - * - `'AES-GCM'` - * @since v15.0.0 - */ - encrypt(algorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams, key: CryptoKey, data: BufferSource): Promise; - /** - * Exports the given key into the specified format, if supported. - * - * If the `` is not extractable, the returned promise will reject. - * - * When `format` is either `'pkcs8'` or `'spki'` and the export is successful, - * the returned promise will be resolved with an `` containing the exported key data. - * - * When `format` is `'jwk'` and the export is successful, the returned promise will be resolved with a - * JavaScript object conforming to the {@link https://tools.ietf.org/html/rfc7517 JSON Web Key} specification. - * @param format Must be one of `'raw'`, `'pkcs8'`, `'spki'`, or `'jwk'`. - * @returns `` containing ``. - * @since v15.0.0 - */ - exportKey(format: 'jwk', key: CryptoKey): Promise; - exportKey(format: Exclude, key: CryptoKey): Promise; - /** - * Using the method and parameters provided in `algorithm`, - * `subtle.generateKey()` attempts to generate new keying material. - * Depending the method used, the method may generate either a single `` or a ``. - * - * The `` (public and private key) generating algorithms supported include: - * - * - `'RSASSA-PKCS1-v1_5'` - * - `'RSA-PSS'` - * - `'RSA-OAEP'` - * - `'ECDSA'` - * - `'Ed25519'` - * - `'Ed448'` - * - `'ECDH'` - * - `'X25519'` - * - `'X448'` - * The `` (secret key) generating algorithms supported include: - * - * - `'HMAC'` - * - `'AES-CTR'` - * - `'AES-CBC'` - * - `'AES-GCM'` - * - `'AES-KW'` - * @param keyUsages See {@link https://nodejs.org/docs/latest/api/webcrypto.html#cryptokeyusages Key usages}. - * @since v15.0.0 - */ - generateKey(algorithm: RsaHashedKeyGenParams | EcKeyGenParams, extractable: boolean, keyUsages: ReadonlyArray): Promise; - generateKey(algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params, extractable: boolean, keyUsages: ReadonlyArray): Promise; - generateKey(algorithm: AlgorithmIdentifier, extractable: boolean, keyUsages: KeyUsage[]): Promise; - /** - * The `subtle.importKey()` method attempts to interpret the provided `keyData` as the given `format` - * to create a `` instance using the provided `algorithm`, `extractable`, and `keyUsages` arguments. - * If the import is successful, the returned promise will be resolved with the created ``. - * - * If importing a `'PBKDF2'` key, `extractable` must be `false`. - * @param format Must be one of `'raw'`, `'pkcs8'`, `'spki'`, or `'jwk'`. - * @param keyUsages See {@link https://nodejs.org/docs/latest/api/webcrypto.html#cryptokeyusages Key usages}. - * @since v15.0.0 - */ - importKey( - format: 'jwk', - keyData: JsonWebKey, - algorithm: AlgorithmIdentifier | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | AesKeyAlgorithm, - extractable: boolean, - keyUsages: ReadonlyArray - ): Promise; - importKey( - format: Exclude, - keyData: BufferSource, - algorithm: AlgorithmIdentifier | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | AesKeyAlgorithm, - extractable: boolean, - keyUsages: KeyUsage[] - ): Promise; - /** - * Using the method and parameters given by `algorithm` and the keying material provided by `key`, - * `subtle.sign()` attempts to generate a cryptographic signature of `data`. If successful, - * the returned promise is resolved with an `` containing the generated signature. - * - * The algorithms currently supported include: - * - * - `'RSASSA-PKCS1-v1_5'` - * - `'RSA-PSS'` - * - `'ECDSA'` - * - `'Ed25519'` - * - `'Ed448'` - * - `'HMAC'` - * @since v15.0.0 - */ - sign(algorithm: AlgorithmIdentifier | RsaPssParams | EcdsaParams | Ed448Params, key: CryptoKey, data: BufferSource): Promise; - /** - * In cryptography, "wrapping a key" refers to exporting and then encrypting the keying material. - * The `subtle.unwrapKey()` method attempts to decrypt a wrapped key and create a `` instance. - * It is equivalent to calling `subtle.decrypt()` first on the encrypted key data (using the `wrappedKey`, `unwrapAlgo`, and `unwrappingKey` arguments as input) - * then passing the results in to the `subtle.importKey()` method using the `unwrappedKeyAlgo`, `extractable`, and `keyUsages` arguments as inputs. - * If successful, the returned promise is resolved with a `` object. - * - * The wrapping algorithms currently supported include: - * - * - `'RSA-OAEP'` - * - `'AES-CTR'` - * - `'AES-CBC'` - * - `'AES-GCM'` - * - `'AES-KW'` - * - * The unwrapped key algorithms supported include: - * - * - `'RSASSA-PKCS1-v1_5'` - * - `'RSA-PSS'` - * - `'RSA-OAEP'` - * - `'ECDSA'` - * - `'Ed25519'` - * - `'Ed448'` - * - `'ECDH'` - * - `'X25519'` - * - `'X448'` - * - `'HMAC'` - * - `'AES-CTR'` - * - `'AES-CBC'` - * - `'AES-GCM'` - * - `'AES-KW'` - * @param format Must be one of `'raw'`, `'pkcs8'`, `'spki'`, or `'jwk'`. - * @param keyUsages See {@link https://nodejs.org/docs/latest/api/webcrypto.html#cryptokeyusages Key usages}. - * @since v15.0.0 - */ - unwrapKey( - format: KeyFormat, - wrappedKey: BufferSource, - unwrappingKey: CryptoKey, - unwrapAlgorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams, - unwrappedKeyAlgorithm: AlgorithmIdentifier | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | AesKeyAlgorithm, - extractable: boolean, - keyUsages: KeyUsage[] - ): Promise; - /** - * Using the method and parameters given in `algorithm` and the keying material provided by `key`, - * `subtle.verify()` attempts to verify that `signature` is a valid cryptographic signature of `data`. - * The returned promise is resolved with either `true` or `false`. - * - * The algorithms currently supported include: - * - * - `'RSASSA-PKCS1-v1_5'` - * - `'RSA-PSS'` - * - `'ECDSA'` - * - `'Ed25519'` - * - `'Ed448'` - * - `'HMAC'` - * @since v15.0.0 - */ - verify(algorithm: AlgorithmIdentifier | RsaPssParams | EcdsaParams | Ed448Params, key: CryptoKey, signature: BufferSource, data: BufferSource): Promise; - /** - * In cryptography, "wrapping a key" refers to exporting and then encrypting the keying material. - * The `subtle.wrapKey()` method exports the keying material into the format identified by `format`, - * then encrypts it using the method and parameters specified by `wrapAlgo` and the keying material provided by `wrappingKey`. - * It is the equivalent to calling `subtle.exportKey()` using `format` and `key` as the arguments, - * then passing the result to the `subtle.encrypt()` method using `wrappingKey` and `wrapAlgo` as inputs. - * If successful, the returned promise will be resolved with an `` containing the encrypted key data. - * - * The wrapping algorithms currently supported include: - * - * - `'RSA-OAEP'` - * - `'AES-CTR'` - * - `'AES-CBC'` - * - `'AES-GCM'` - * - `'AES-KW'` - * @param format Must be one of `'raw'`, `'pkcs8'`, `'spki'`, or `'jwk'`. - * @since v15.0.0 - */ - wrapKey(format: KeyFormat, key: CryptoKey, wrappingKey: CryptoKey, wrapAlgorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams): Promise; - } - } -} -declare module 'node:crypto' { - export * from 'crypto'; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/dgram.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/dgram.d.ts deleted file mode 100755 index 247328d2..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/dgram.d.ts +++ /dev/null @@ -1,545 +0,0 @@ -/** - * The `dgram` module provides an implementation of UDP datagram sockets. - * - * ```js - * import dgram from 'dgram'; - * - * const server = dgram.createSocket('udp4'); - * - * server.on('error', (err) => { - * console.log(`server error:\n${err.stack}`); - * server.close(); - * }); - * - * server.on('message', (msg, rinfo) => { - * console.log(`server got: ${msg} from ${rinfo.address}:${rinfo.port}`); - * }); - * - * server.on('listening', () => { - * const address = server.address(); - * console.log(`server listening ${address.address}:${address.port}`); - * }); - * - * server.bind(41234); - * // Prints: server listening 0.0.0.0:41234 - * ``` - * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/dgram.js) - */ -declare module 'dgram' { - import { AddressInfo } from 'node:net'; - import * as dns from 'node:dns'; - import { EventEmitter, Abortable } from 'node:events'; - interface RemoteInfo { - address: string; - family: 'IPv4' | 'IPv6'; - port: number; - size: number; - } - interface BindOptions { - port?: number | undefined; - address?: string | undefined; - exclusive?: boolean | undefined; - fd?: number | undefined; - } - type SocketType = 'udp4' | 'udp6'; - interface SocketOptions extends Abortable { - type: SocketType; - reuseAddr?: boolean | undefined; - /** - * @default false - */ - ipv6Only?: boolean | undefined; - recvBufferSize?: number | undefined; - sendBufferSize?: number | undefined; - lookup?: ((hostname: string, options: dns.LookupOneOptions, callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void) => void) | undefined; - } - /** - * Creates a `dgram.Socket` object. Once the socket is created, calling `socket.bind()` will instruct the socket to begin listening for datagram - * messages. When `address` and `port` are not passed to `socket.bind()` the - * method will bind the socket to the "all interfaces" address on a random port - * (it does the right thing for both `udp4` and `udp6` sockets). The bound address - * and port can be retrieved using `socket.address().address` and `socket.address().port`. - * - * If the `signal` option is enabled, calling `.abort()` on the corresponding`AbortController` is similar to calling `.close()` on the socket: - * - * ```js - * const controller = new AbortController(); - * const { signal } = controller; - * const server = dgram.createSocket({ type: 'udp4', signal }); - * server.on('message', (msg, rinfo) => { - * console.log(`server got: ${msg} from ${rinfo.address}:${rinfo.port}`); - * }); - * // Later, when you want to close the server. - * controller.abort(); - * ``` - * @since v0.11.13 - * @param options Available options are: - * @param callback Attached as a listener for `'message'` events. Optional. - */ - function createSocket(type: SocketType, callback?: (msg: Buffer, rinfo: RemoteInfo) => void): Socket; - function createSocket(options: SocketOptions, callback?: (msg: Buffer, rinfo: RemoteInfo) => void): Socket; - /** - * Encapsulates the datagram functionality. - * - * New instances of `dgram.Socket` are created using {@link createSocket}. - * The `new` keyword is not to be used to create `dgram.Socket` instances. - * @since v0.1.99 - */ - class Socket extends EventEmitter { - /** - * Tells the kernel to join a multicast group at the given `multicastAddress` and`multicastInterface` using the `IP_ADD_MEMBERSHIP` socket option. If the`multicastInterface` argument is not - * specified, the operating system will choose - * one interface and will add membership to it. To add membership to every - * available interface, call `addMembership` multiple times, once per interface. - * - * When called on an unbound socket, this method will implicitly bind to a random - * port, listening on all interfaces. - * - * When sharing a UDP socket across multiple `cluster` workers, the`socket.addMembership()` function must be called only once or an`EADDRINUSE` error will occur: - * - * ```js - * import cluster from 'cluster'; - * import dgram from 'dgram'; - * - * if (cluster.isPrimary) { - * cluster.fork(); // Works ok. - * cluster.fork(); // Fails with EADDRINUSE. - * } else { - * const s = dgram.createSocket('udp4'); - * s.bind(1234, () => { - * s.addMembership('224.0.0.114'); - * }); - * } - * ``` - * @since v0.6.9 - */ - addMembership(multicastAddress: string, multicastInterface?: string): void; - /** - * Returns an object containing the address information for a socket. - * For UDP sockets, this object will contain `address`, `family` and `port`properties. - * - * This method throws `EBADF` if called on an unbound socket. - * @since v0.1.99 - */ - address(): AddressInfo; - /** - * For UDP sockets, causes the `dgram.Socket` to listen for datagram - * messages on a named `port` and optional `address`. If `port` is not - * specified or is `0`, the operating system will attempt to bind to a - * random port. If `address` is not specified, the operating system will - * attempt to listen on all addresses. Once binding is complete, a`'listening'` event is emitted and the optional `callback` function is - * called. - * - * Specifying both a `'listening'` event listener and passing a`callback` to the `socket.bind()` method is not harmful but not very - * useful. - * - * A bound datagram socket keeps the Node.js process running to receive - * datagram messages. - * - * If binding fails, an `'error'` event is generated. In rare case (e.g. - * attempting to bind with a closed socket), an `Error` may be thrown. - * - * Example of a UDP server listening on port 41234: - * - * ```js - * import dgram from 'dgram'; - * - * const server = dgram.createSocket('udp4'); - * - * server.on('error', (err) => { - * console.log(`server error:\n${err.stack}`); - * server.close(); - * }); - * - * server.on('message', (msg, rinfo) => { - * console.log(`server got: ${msg} from ${rinfo.address}:${rinfo.port}`); - * }); - * - * server.on('listening', () => { - * const address = server.address(); - * console.log(`server listening ${address.address}:${address.port}`); - * }); - * - * server.bind(41234); - * // Prints: server listening 0.0.0.0:41234 - * ``` - * @since v0.1.99 - * @param callback with no parameters. Called when binding is complete. - */ - bind(port?: number, address?: string, callback?: () => void): this; - bind(port?: number, callback?: () => void): this; - bind(callback?: () => void): this; - bind(options: BindOptions, callback?: () => void): this; - /** - * Close the underlying socket and stop listening for data on it. If a callback is - * provided, it is added as a listener for the `'close'` event. - * @since v0.1.99 - * @param callback Called when the socket has been closed. - */ - close(callback?: () => void): this; - /** - * Associates the `dgram.Socket` to a remote address and port. Every - * message sent by this handle is automatically sent to that destination. Also, - * the socket will only receive messages from that remote peer. - * Trying to call `connect()` on an already connected socket will result - * in an `ERR_SOCKET_DGRAM_IS_CONNECTED` exception. If `address` is not - * provided, `'127.0.0.1'` (for `udp4` sockets) or `'::1'` (for `udp6` sockets) - * will be used by default. Once the connection is complete, a `'connect'` event - * is emitted and the optional `callback` function is called. In case of failure, - * the `callback` is called or, failing this, an `'error'` event is emitted. - * @since v12.0.0 - * @param callback Called when the connection is completed or on error. - */ - connect(port: number, address?: string, callback?: () => void): void; - connect(port: number, callback: () => void): void; - /** - * A synchronous function that disassociates a connected `dgram.Socket` from - * its remote address. Trying to call `disconnect()` on an unbound or already - * disconnected socket will result in an `ERR_SOCKET_DGRAM_NOT_CONNECTED` exception. - * @since v12.0.0 - */ - disconnect(): void; - /** - * Instructs the kernel to leave a multicast group at `multicastAddress` using the`IP_DROP_MEMBERSHIP` socket option. This method is automatically called by the - * kernel when the socket is closed or the process terminates, so most apps will - * never have reason to call this. - * - * If `multicastInterface` is not specified, the operating system will attempt to - * drop membership on all valid interfaces. - * @since v0.6.9 - */ - dropMembership(multicastAddress: string, multicastInterface?: string): void; - /** - * This method throws `ERR_SOCKET_BUFFER_SIZE` if called on an unbound socket. - * @since v8.7.0 - * @return the `SO_RCVBUF` socket receive buffer size in bytes. - */ - getRecvBufferSize(): number; - /** - * This method throws `ERR_SOCKET_BUFFER_SIZE` if called on an unbound socket. - * @since v8.7.0 - * @return the `SO_SNDBUF` socket send buffer size in bytes. - */ - getSendBufferSize(): number; - /** - * By default, binding a socket will cause it to block the Node.js process from - * exiting as long as the socket is open. The `socket.unref()` method can be used - * to exclude the socket from the reference counting that keeps the Node.js - * process active. The `socket.ref()` method adds the socket back to the reference - * counting and restores the default behavior. - * - * Calling `socket.ref()` multiples times will have no additional effect. - * - * The `socket.ref()` method returns a reference to the socket so calls can be - * chained. - * @since v0.9.1 - */ - ref(): this; - /** - * Returns an object containing the `address`, `family`, and `port` of the remote - * endpoint. This method throws an `ERR_SOCKET_DGRAM_NOT_CONNECTED` exception - * if the socket is not connected. - * @since v12.0.0 - */ - remoteAddress(): AddressInfo; - /** - * Broadcasts a datagram on the socket. - * For connectionless sockets, the destination `port` and `address` must be - * specified. Connected sockets, on the other hand, will use their associated - * remote endpoint, so the `port` and `address` arguments must not be set. - * - * The `msg` argument contains the message to be sent. - * Depending on its type, different behavior can apply. If `msg` is a `Buffer`, - * any `TypedArray` or a `DataView`, - * the `offset` and `length` specify the offset within the `Buffer` where the - * message begins and the number of bytes in the message, respectively. - * If `msg` is a `String`, then it is automatically converted to a `Buffer`with `'utf8'` encoding. With messages that - * contain multi-byte characters, `offset` and `length` will be calculated with - * respect to `byte length` and not the character position. - * If `msg` is an array, `offset` and `length` must not be specified. - * - * The `address` argument is a string. If the value of `address` is a host name, - * DNS will be used to resolve the address of the host. If `address` is not - * provided or otherwise nullish, `'127.0.0.1'` (for `udp4` sockets) or `'::1'`(for `udp6` sockets) will be used by default. - * - * If the socket has not been previously bound with a call to `bind`, the socket - * is assigned a random port number and is bound to the "all interfaces" address - * (`'0.0.0.0'` for `udp4` sockets, `'::0'` for `udp6` sockets.) - * - * An optional `callback` function may be specified to as a way of reporting - * DNS errors or for determining when it is safe to reuse the `buf` object. - * DNS lookups delay the time to send for at least one tick of the - * Node.js event loop. - * - * The only way to know for sure that the datagram has been sent is by using a`callback`. If an error occurs and a `callback` is given, the error will be - * passed as the first argument to the `callback`. If a `callback` is not given, - * the error is emitted as an `'error'` event on the `socket` object. - * - * Offset and length are optional but both _must_ be set if either are used. - * They are supported only when the first argument is a `Buffer`, a `TypedArray`, - * or a `DataView`. - * - * This method throws `ERR_SOCKET_BAD_PORT` if called on an unbound socket. - * - * Example of sending a UDP packet to a port on `localhost`; - * - * ```js - * import dgram from 'dgram'; - * import { Buffer } from 'buffer'; - * - * const message = Buffer.from('Some bytes'); - * const client = dgram.createSocket('udp4'); - * client.send(message, 41234, 'localhost', (err) => { - * client.close(); - * }); - * ``` - * - * Example of sending a UDP packet composed of multiple buffers to a port on`127.0.0.1`; - * - * ```js - * import dgram from 'dgram'; - * import { Buffer } from 'buffer'; - * - * const buf1 = Buffer.from('Some '); - * const buf2 = Buffer.from('bytes'); - * const client = dgram.createSocket('udp4'); - * client.send([buf1, buf2], 41234, (err) => { - * client.close(); - * }); - * ``` - * - * Sending multiple buffers might be faster or slower depending on the - * application and operating system. Run benchmarks to - * determine the optimal strategy on a case-by-case basis. Generally speaking, - * however, sending multiple buffers is faster. - * - * Example of sending a UDP packet using a socket connected to a port on`localhost`: - * - * ```js - * import dgram from 'dgram'; - * import { Buffer } from 'buffer'; - * - * const message = Buffer.from('Some bytes'); - * const client = dgram.createSocket('udp4'); - * client.connect(41234, 'localhost', (err) => { - * client.send(message, (err) => { - * client.close(); - * }); - * }); - * ``` - * @since v0.1.99 - * @param msg Message to be sent. - * @param offset Offset in the buffer where the message starts. - * @param length Number of bytes in the message. - * @param port Destination port. - * @param address Destination host name or IP address. - * @param callback Called when the message has been sent. - */ - send(msg: string | Uint8Array | ReadonlyArray, port?: number, address?: string, callback?: (error: Error | null, bytes: number) => void): void; - send(msg: string | Uint8Array | ReadonlyArray, port?: number, callback?: (error: Error | null, bytes: number) => void): void; - send(msg: string | Uint8Array | ReadonlyArray, callback?: (error: Error | null, bytes: number) => void): void; - send(msg: string | Uint8Array, offset: number, length: number, port?: number, address?: string, callback?: (error: Error | null, bytes: number) => void): void; - send(msg: string | Uint8Array, offset: number, length: number, port?: number, callback?: (error: Error | null, bytes: number) => void): void; - send(msg: string | Uint8Array, offset: number, length: number, callback?: (error: Error | null, bytes: number) => void): void; - /** - * Sets or clears the `SO_BROADCAST` socket option. When set to `true`, UDP - * packets may be sent to a local interface's broadcast address. - * - * This method throws `EBADF` if called on an unbound socket. - * @since v0.6.9 - */ - setBroadcast(flag: boolean): void; - /** - * _All references to scope in this section are referring to [IPv6 Zone Indices](https://en.wikipedia.org/wiki/IPv6_address#Scoped_literal_IPv6_addresses), which are defined by [RFC - * 4007](https://tools.ietf.org/html/rfc4007). In string form, an IP_ - * _with a scope index is written as `'IP%scope'` where scope is an interface name_ - * _or interface number._ - * - * Sets the default outgoing multicast interface of the socket to a chosen - * interface or back to system interface selection. The `multicastInterface` must - * be a valid string representation of an IP from the socket's family. - * - * For IPv4 sockets, this should be the IP configured for the desired physical - * interface. All packets sent to multicast on the socket will be sent on the - * interface determined by the most recent successful use of this call. - * - * For IPv6 sockets, `multicastInterface` should include a scope to indicate the - * interface as in the examples that follow. In IPv6, individual `send` calls can - * also use explicit scope in addresses, so only packets sent to a multicast - * address without specifying an explicit scope are affected by the most recent - * successful use of this call. - * - * This method throws `EBADF` if called on an unbound socket. - * - * #### Example: IPv6 outgoing multicast interface - * - * On most systems, where scope format uses the interface name: - * - * ```js - * const socket = dgram.createSocket('udp6'); - * - * socket.bind(1234, () => { - * socket.setMulticastInterface('::%eth1'); - * }); - * ``` - * - * On Windows, where scope format uses an interface number: - * - * ```js - * const socket = dgram.createSocket('udp6'); - * - * socket.bind(1234, () => { - * socket.setMulticastInterface('::%2'); - * }); - * ``` - * - * #### Example: IPv4 outgoing multicast interface - * - * All systems use an IP of the host on the desired physical interface: - * - * ```js - * const socket = dgram.createSocket('udp4'); - * - * socket.bind(1234, () => { - * socket.setMulticastInterface('10.0.0.2'); - * }); - * ``` - * @since v8.6.0 - */ - setMulticastInterface(multicastInterface: string): void; - /** - * Sets or clears the `IP_MULTICAST_LOOP` socket option. When set to `true`, - * multicast packets will also be received on the local interface. - * - * This method throws `EBADF` if called on an unbound socket. - * @since v0.3.8 - */ - setMulticastLoopback(flag: boolean): boolean; - /** - * Sets the `IP_MULTICAST_TTL` socket option. While TTL generally stands for - * "Time to Live", in this context it specifies the number of IP hops that a - * packet is allowed to travel through, specifically for multicast traffic. Each - * router or gateway that forwards a packet decrements the TTL. If the TTL is - * decremented to 0 by a router, it will not be forwarded. - * - * The `ttl` argument may be between 0 and 255\. The default on most systems is `1`. - * - * This method throws `EBADF` if called on an unbound socket. - * @since v0.3.8 - */ - setMulticastTTL(ttl: number): number; - /** - * Sets the `SO_RCVBUF` socket option. Sets the maximum socket receive buffer - * in bytes. - * - * This method throws `ERR_SOCKET_BUFFER_SIZE` if called on an unbound socket. - * @since v8.7.0 - */ - setRecvBufferSize(size: number): void; - /** - * Sets the `SO_SNDBUF` socket option. Sets the maximum socket send buffer - * in bytes. - * - * This method throws `ERR_SOCKET_BUFFER_SIZE` if called on an unbound socket. - * @since v8.7.0 - */ - setSendBufferSize(size: number): void; - /** - * Sets the `IP_TTL` socket option. While TTL generally stands for "Time to Live", - * in this context it specifies the number of IP hops that a packet is allowed to - * travel through. Each router or gateway that forwards a packet decrements the - * TTL. If the TTL is decremented to 0 by a router, it will not be forwarded. - * Changing TTL values is typically done for network probes or when multicasting. - * - * The `ttl` argument may be between 1 and 255\. The default on most systems - * is 64. - * - * This method throws `EBADF` if called on an unbound socket. - * @since v0.1.101 - */ - setTTL(ttl: number): number; - /** - * By default, binding a socket will cause it to block the Node.js process from - * exiting as long as the socket is open. The `socket.unref()` method can be used - * to exclude the socket from the reference counting that keeps the Node.js - * process active, allowing the process to exit even if the socket is still - * listening. - * - * Calling `socket.unref()` multiple times will have no addition effect. - * - * The `socket.unref()` method returns a reference to the socket so calls can be - * chained. - * @since v0.9.1 - */ - unref(): this; - /** - * Tells the kernel to join a source-specific multicast channel at the given`sourceAddress` and `groupAddress`, using the `multicastInterface` with the`IP_ADD_SOURCE_MEMBERSHIP` socket - * option. If the `multicastInterface` argument - * is not specified, the operating system will choose one interface and will add - * membership to it. To add membership to every available interface, call`socket.addSourceSpecificMembership()` multiple times, once per interface. - * - * When called on an unbound socket, this method will implicitly bind to a random - * port, listening on all interfaces. - * @since v13.1.0, v12.16.0 - */ - addSourceSpecificMembership(sourceAddress: string, groupAddress: string, multicastInterface?: string): void; - /** - * Instructs the kernel to leave a source-specific multicast channel at the given`sourceAddress` and `groupAddress` using the `IP_DROP_SOURCE_MEMBERSHIP`socket option. This method is - * automatically called by the kernel when the - * socket is closed or the process terminates, so most apps will never have - * reason to call this. - * - * If `multicastInterface` is not specified, the operating system will attempt to - * drop membership on all valid interfaces. - * @since v13.1.0, v12.16.0 - */ - dropSourceSpecificMembership(sourceAddress: string, groupAddress: string, multicastInterface?: string): void; - /** - * events.EventEmitter - * 1. close - * 2. connect - * 3. error - * 4. listening - * 5. message - */ - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: 'close', listener: () => void): this; - addListener(event: 'connect', listener: () => void): this; - addListener(event: 'error', listener: (err: Error) => void): this; - addListener(event: 'listening', listener: () => void): this; - addListener(event: 'message', listener: (msg: Buffer, rinfo: RemoteInfo) => void): this; - emit(event: string | symbol, ...args: any[]): boolean; - emit(event: 'close'): boolean; - emit(event: 'connect'): boolean; - emit(event: 'error', err: Error): boolean; - emit(event: 'listening'): boolean; - emit(event: 'message', msg: Buffer, rinfo: RemoteInfo): boolean; - on(event: string, listener: (...args: any[]) => void): this; - on(event: 'close', listener: () => void): this; - on(event: 'connect', listener: () => void): this; - on(event: 'error', listener: (err: Error) => void): this; - on(event: 'listening', listener: () => void): this; - on(event: 'message', listener: (msg: Buffer, rinfo: RemoteInfo) => void): this; - once(event: string, listener: (...args: any[]) => void): this; - once(event: 'close', listener: () => void): this; - once(event: 'connect', listener: () => void): this; - once(event: 'error', listener: (err: Error) => void): this; - once(event: 'listening', listener: () => void): this; - once(event: 'message', listener: (msg: Buffer, rinfo: RemoteInfo) => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: 'close', listener: () => void): this; - prependListener(event: 'connect', listener: () => void): this; - prependListener(event: 'error', listener: (err: Error) => void): this; - prependListener(event: 'listening', listener: () => void): this; - prependListener(event: 'message', listener: (msg: Buffer, rinfo: RemoteInfo) => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: 'close', listener: () => void): this; - prependOnceListener(event: 'connect', listener: () => void): this; - prependOnceListener(event: 'error', listener: (err: Error) => void): this; - prependOnceListener(event: 'listening', listener: () => void): this; - prependOnceListener(event: 'message', listener: (msg: Buffer, rinfo: RemoteInfo) => void): this; - } -} -declare module 'node:dgram' { - export * from 'dgram'; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/diagnostics_channel.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/diagnostics_channel.d.ts deleted file mode 100755 index a87ba8ca..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/diagnostics_channel.d.ts +++ /dev/null @@ -1,153 +0,0 @@ -/** - * The `diagnostics_channel` module provides an API to create named channels - * to report arbitrary message data for diagnostics purposes. - * - * It can be accessed using: - * - * ```js - * import diagnostics_channel from 'diagnostics_channel'; - * ``` - * - * It is intended that a module writer wanting to report diagnostics messages - * will create one or many top-level channels to report messages through. - * Channels may also be acquired at runtime but it is not encouraged - * due to the additional overhead of doing so. Channels may be exported for - * convenience, but as long as the name is known it can be acquired anywhere. - * - * If you intend for your module to produce diagnostics data for others to - * consume it is recommended that you include documentation of what named - * channels are used along with the shape of the message data. Channel names - * should generally include the module name to avoid collisions with data from - * other modules. - * @experimental - * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/diagnostics_channel.js) - */ -declare module 'diagnostics_channel' { - /** - * Check if there are active subscribers to the named channel. This is helpful if - * the message you want to send might be expensive to prepare. - * - * This API is optional but helpful when trying to publish messages from very - * performance-sensitive code. - * - * ```js - * import diagnostics_channel from 'diagnostics_channel'; - * - * if (diagnostics_channel.hasSubscribers('my-channel')) { - * // There are subscribers, prepare and publish message - * } - * ``` - * @since v15.1.0, v14.17.0 - * @param name The channel name - * @return If there are active subscribers - */ - function hasSubscribers(name: string): boolean; - /** - * This is the primary entry-point for anyone wanting to interact with a named - * channel. It produces a channel object which is optimized to reduce overhead at - * publish time as much as possible. - * - * ```js - * import diagnostics_channel from 'diagnostics_channel'; - * - * const channel = diagnostics_channel.channel('my-channel'); - * ``` - * @since v15.1.0, v14.17.0 - * @param name The channel name - * @return The named channel object - */ - function channel(name: string): Channel; - type ChannelListener = (message: unknown, name: string) => void; - /** - * The class `Channel` represents an individual named channel within the data - * pipeline. It is use to track subscribers and to publish messages when there - * are subscribers present. It exists as a separate object to avoid channel - * lookups at publish time, enabling very fast publish speeds and allowing - * for heavy use while incurring very minimal cost. Channels are created with {@link channel}, constructing a channel directly - * with `new Channel(name)` is not supported. - * @since v15.1.0, v14.17.0 - */ - class Channel { - readonly name: string; - /** - * Check if there are active subscribers to this channel. This is helpful if - * the message you want to send might be expensive to prepare. - * - * This API is optional but helpful when trying to publish messages from very - * performance-sensitive code. - * - * ```js - * import diagnostics_channel from 'diagnostics_channel'; - * - * const channel = diagnostics_channel.channel('my-channel'); - * - * if (channel.hasSubscribers) { - * // There are subscribers, prepare and publish message - * } - * ``` - * @since v15.1.0, v14.17.0 - */ - readonly hasSubscribers: boolean; - private constructor(name: string); - /** - * Publish a message to any subscribers to the channel. This will - * trigger message handlers synchronously so they will execute within - * the same context. - * - * ```js - * import diagnostics_channel from 'diagnostics_channel'; - * - * const channel = diagnostics_channel.channel('my-channel'); - * - * channel.publish({ - * some: 'message' - * }); - * ``` - * @since v15.1.0, v14.17.0 - * @param message The message to send to the channel subscribers - */ - publish(message: unknown): void; - /** - * Register a message handler to subscribe to this channel. This message handler - * will be run synchronously whenever a message is published to the channel. Any - * errors thrown in the message handler will trigger an `'uncaughtException'`. - * - * ```js - * import diagnostics_channel from 'diagnostics_channel'; - * - * const channel = diagnostics_channel.channel('my-channel'); - * - * channel.subscribe((message, name) => { - * // Received data - * }); - * ``` - * @since v15.1.0, v14.17.0 - * @param onMessage The handler to receive channel messages - */ - subscribe(onMessage: ChannelListener): void; - /** - * Remove a message handler previously registered to this channel with `channel.subscribe(onMessage)`. - * - * ```js - * import diagnostics_channel from 'diagnostics_channel'; - * - * const channel = diagnostics_channel.channel('my-channel'); - * - * function onMessage(message, name) { - * // Received data - * } - * - * channel.subscribe(onMessage); - * - * channel.unsubscribe(onMessage); - * ``` - * @since v15.1.0, v14.17.0 - * @param onMessage The previous subscribed handler to remove - * @return `true` if the handler was found, `false` otherwise. - */ - unsubscribe(onMessage: ChannelListener): void; - } -} -declare module 'node:diagnostics_channel' { - export * from 'diagnostics_channel'; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/dns.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/dns.d.ts deleted file mode 100755 index 305367b8..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/dns.d.ts +++ /dev/null @@ -1,659 +0,0 @@ -/** - * The `dns` module enables name resolution. For example, use it to look up IP - * addresses of host names. - * - * Although named for the [Domain Name System (DNS)](https://en.wikipedia.org/wiki/Domain_Name_System), it does not always use the - * DNS protocol for lookups. {@link lookup} uses the operating system - * facilities to perform name resolution. It may not need to perform any network - * communication. To perform name resolution the way other applications on the same - * system do, use {@link lookup}. - * - * ```js - * const dns = require('dns'); - * - * dns.lookup('example.org', (err, address, family) => { - * console.log('address: %j family: IPv%s', address, family); - * }); - * // address: "93.184.216.34" family: IPv4 - * ``` - * - * All other functions in the `dns` module connect to an actual DNS server to - * perform name resolution. They will always use the network to perform DNS - * queries. These functions do not use the same set of configuration files used by {@link lookup} (e.g. `/etc/hosts`). Use these functions to always perform - * DNS queries, bypassing other name-resolution facilities. - * - * ```js - * const dns = require('dns'); - * - * dns.resolve4('archive.org', (err, addresses) => { - * if (err) throw err; - * - * console.log(`addresses: ${JSON.stringify(addresses)}`); - * - * addresses.forEach((a) => { - * dns.reverse(a, (err, hostnames) => { - * if (err) { - * throw err; - * } - * console.log(`reverse for ${a}: ${JSON.stringify(hostnames)}`); - * }); - * }); - * }); - * ``` - * - * See the `Implementation considerations section` for more information. - * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/dns.js) - */ -declare module 'dns' { - import * as dnsPromises from 'node:dns/promises'; - // Supported getaddrinfo flags. - export const ADDRCONFIG: number; - export const V4MAPPED: number; - /** - * If `dns.V4MAPPED` is specified, return resolved IPv6 addresses as - * well as IPv4 mapped IPv6 addresses. - */ - export const ALL: number; - export interface LookupOptions { - family?: number | undefined; - hints?: number | undefined; - all?: boolean | undefined; - /** - * @default true - */ - verbatim?: boolean | undefined; - } - export interface LookupOneOptions extends LookupOptions { - all?: false | undefined; - } - export interface LookupAllOptions extends LookupOptions { - all: true; - } - export interface LookupAddress { - address: string; - family: number; - } - /** - * Resolves a host name (e.g. `'nodejs.org'`) into the first found A (IPv4) or - * AAAA (IPv6) record. All `option` properties are optional. If `options` is an - * integer, then it must be `4` or `6` – if `options` is not provided, then IPv4 - * and IPv6 addresses are both returned if found. - * - * With the `all` option set to `true`, the arguments for `callback` change to`(err, addresses)`, with `addresses` being an array of objects with the - * properties `address` and `family`. - * - * On error, `err` is an `Error` object, where `err.code` is the error code. - * Keep in mind that `err.code` will be set to `'ENOTFOUND'` not only when - * the host name does not exist but also when the lookup fails in other ways - * such as no available file descriptors. - * - * `dns.lookup()` does not necessarily have anything to do with the DNS protocol. - * The implementation uses an operating system facility that can associate names - * with addresses, and vice versa. This implementation can have subtle but - * important consequences on the behavior of any Node.js program. Please take some - * time to consult the `Implementation considerations section` before using`dns.lookup()`. - * - * Example usage: - * - * ```js - * const dns = require('dns'); - * const options = { - * family: 6, - * hints: dns.ADDRCONFIG | dns.V4MAPPED, - * }; - * dns.lookup('example.com', options, (err, address, family) => - * console.log('address: %j family: IPv%s', address, family)); - * // address: "2606:2800:220:1:248:1893:25c8:1946" family: IPv6 - * - * // When options.all is true, the result will be an Array. - * options.all = true; - * dns.lookup('example.com', options, (err, addresses) => - * console.log('addresses: %j', addresses)); - * // addresses: [{"address":"2606:2800:220:1:248:1893:25c8:1946","family":6}] - * ``` - * - * If this method is invoked as its `util.promisify()` ed version, and `all`is not set to `true`, it returns a `Promise` for an `Object` with `address` and`family` properties. - * @since v0.1.90 - */ - export function lookup(hostname: string, family: number, callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void): void; - export function lookup(hostname: string, options: LookupOneOptions, callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void): void; - export function lookup(hostname: string, options: LookupAllOptions, callback: (err: NodeJS.ErrnoException | null, addresses: LookupAddress[]) => void): void; - export function lookup(hostname: string, options: LookupOptions, callback: (err: NodeJS.ErrnoException | null, address: string | LookupAddress[], family: number) => void): void; - export function lookup(hostname: string, callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void): void; - export namespace lookup { - function __promisify__(hostname: string, options: LookupAllOptions): Promise; - function __promisify__(hostname: string, options?: LookupOneOptions | number): Promise; - function __promisify__(hostname: string, options: LookupOptions): Promise; - } - /** - * Resolves the given `address` and `port` into a host name and service using - * the operating system's underlying `getnameinfo` implementation. - * - * If `address` is not a valid IP address, a `TypeError` will be thrown. - * The `port` will be coerced to a number. If it is not a legal port, a `TypeError`will be thrown. - * - * On an error, `err` is an `Error` object, where `err.code` is the error code. - * - * ```js - * const dns = require('dns'); - * dns.lookupService('127.0.0.1', 22, (err, hostname, service) => { - * console.log(hostname, service); - * // Prints: localhost ssh - * }); - * ``` - * - * If this method is invoked as its `util.promisify()` ed version, it returns a`Promise` for an `Object` with `hostname` and `service` properties. - * @since v0.11.14 - */ - export function lookupService(address: string, port: number, callback: (err: NodeJS.ErrnoException | null, hostname: string, service: string) => void): void; - export namespace lookupService { - function __promisify__( - address: string, - port: number - ): Promise<{ - hostname: string; - service: string; - }>; - } - export interface ResolveOptions { - ttl: boolean; - } - export interface ResolveWithTtlOptions extends ResolveOptions { - ttl: true; - } - export interface RecordWithTtl { - address: string; - ttl: number; - } - /** @deprecated Use `AnyARecord` or `AnyAaaaRecord` instead. */ - export type AnyRecordWithTtl = AnyARecord | AnyAaaaRecord; - export interface AnyARecord extends RecordWithTtl { - type: 'A'; - } - export interface AnyAaaaRecord extends RecordWithTtl { - type: 'AAAA'; - } - export interface CaaRecord { - critial: number; - issue?: string | undefined; - issuewild?: string | undefined; - iodef?: string | undefined; - contactemail?: string | undefined; - contactphone?: string | undefined; - } - export interface MxRecord { - priority: number; - exchange: string; - } - export interface AnyMxRecord extends MxRecord { - type: 'MX'; - } - export interface NaptrRecord { - flags: string; - service: string; - regexp: string; - replacement: string; - order: number; - preference: number; - } - export interface AnyNaptrRecord extends NaptrRecord { - type: 'NAPTR'; - } - export interface SoaRecord { - nsname: string; - hostmaster: string; - serial: number; - refresh: number; - retry: number; - expire: number; - minttl: number; - } - export interface AnySoaRecord extends SoaRecord { - type: 'SOA'; - } - export interface SrvRecord { - priority: number; - weight: number; - port: number; - name: string; - } - export interface AnySrvRecord extends SrvRecord { - type: 'SRV'; - } - export interface AnyTxtRecord { - type: 'TXT'; - entries: string[]; - } - export interface AnyNsRecord { - type: 'NS'; - value: string; - } - export interface AnyPtrRecord { - type: 'PTR'; - value: string; - } - export interface AnyCnameRecord { - type: 'CNAME'; - value: string; - } - export type AnyRecord = AnyARecord | AnyAaaaRecord | AnyCnameRecord | AnyMxRecord | AnyNaptrRecord | AnyNsRecord | AnyPtrRecord | AnySoaRecord | AnySrvRecord | AnyTxtRecord; - /** - * Uses the DNS protocol to resolve a host name (e.g. `'nodejs.org'`) into an array - * of the resource records. The `callback` function has arguments`(err, records)`. When successful, `records` will be an array of resource - * records. The type and structure of individual results varies based on `rrtype`: - * - * - * - * On error, `err` is an `Error` object, where `err.code` is one of the `DNS error codes`. - * @since v0.1.27 - * @param hostname Host name to resolve. - * @param [rrtype='A'] Resource record type. - */ - export function resolve(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void; - export function resolve(hostname: string, rrtype: 'A', callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void; - export function resolve(hostname: string, rrtype: 'AAAA', callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void; - export function resolve(hostname: string, rrtype: 'ANY', callback: (err: NodeJS.ErrnoException | null, addresses: AnyRecord[]) => void): void; - export function resolve(hostname: string, rrtype: 'CNAME', callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void; - export function resolve(hostname: string, rrtype: 'MX', callback: (err: NodeJS.ErrnoException | null, addresses: MxRecord[]) => void): void; - export function resolve(hostname: string, rrtype: 'NAPTR', callback: (err: NodeJS.ErrnoException | null, addresses: NaptrRecord[]) => void): void; - export function resolve(hostname: string, rrtype: 'NS', callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void; - export function resolve(hostname: string, rrtype: 'PTR', callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void; - export function resolve(hostname: string, rrtype: 'SOA', callback: (err: NodeJS.ErrnoException | null, addresses: SoaRecord) => void): void; - export function resolve(hostname: string, rrtype: 'SRV', callback: (err: NodeJS.ErrnoException | null, addresses: SrvRecord[]) => void): void; - export function resolve(hostname: string, rrtype: 'TXT', callback: (err: NodeJS.ErrnoException | null, addresses: string[][]) => void): void; - export function resolve( - hostname: string, - rrtype: string, - callback: (err: NodeJS.ErrnoException | null, addresses: string[] | MxRecord[] | NaptrRecord[] | SoaRecord | SrvRecord[] | string[][] | AnyRecord[]) => void - ): void; - export namespace resolve { - function __promisify__(hostname: string, rrtype?: 'A' | 'AAAA' | 'CNAME' | 'NS' | 'PTR'): Promise; - function __promisify__(hostname: string, rrtype: 'ANY'): Promise; - function __promisify__(hostname: string, rrtype: 'MX'): Promise; - function __promisify__(hostname: string, rrtype: 'NAPTR'): Promise; - function __promisify__(hostname: string, rrtype: 'SOA'): Promise; - function __promisify__(hostname: string, rrtype: 'SRV'): Promise; - function __promisify__(hostname: string, rrtype: 'TXT'): Promise; - function __promisify__(hostname: string, rrtype: string): Promise; - } - /** - * Uses the DNS protocol to resolve a IPv4 addresses (`A` records) for the`hostname`. The `addresses` argument passed to the `callback` function - * will contain an array of IPv4 addresses (e.g.`['74.125.79.104', '74.125.79.105', '74.125.79.106']`). - * @since v0.1.16 - * @param hostname Host name to resolve. - */ - export function resolve4(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void; - export function resolve4(hostname: string, options: ResolveWithTtlOptions, callback: (err: NodeJS.ErrnoException | null, addresses: RecordWithTtl[]) => void): void; - export function resolve4(hostname: string, options: ResolveOptions, callback: (err: NodeJS.ErrnoException | null, addresses: string[] | RecordWithTtl[]) => void): void; - export namespace resolve4 { - function __promisify__(hostname: string): Promise; - function __promisify__(hostname: string, options: ResolveWithTtlOptions): Promise; - function __promisify__(hostname: string, options?: ResolveOptions): Promise; - } - /** - * Uses the DNS protocol to resolve a IPv6 addresses (`AAAA` records) for the`hostname`. The `addresses` argument passed to the `callback` function - * will contain an array of IPv6 addresses. - * @since v0.1.16 - * @param hostname Host name to resolve. - */ - export function resolve6(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void; - export function resolve6(hostname: string, options: ResolveWithTtlOptions, callback: (err: NodeJS.ErrnoException | null, addresses: RecordWithTtl[]) => void): void; - export function resolve6(hostname: string, options: ResolveOptions, callback: (err: NodeJS.ErrnoException | null, addresses: string[] | RecordWithTtl[]) => void): void; - export namespace resolve6 { - function __promisify__(hostname: string): Promise; - function __promisify__(hostname: string, options: ResolveWithTtlOptions): Promise; - function __promisify__(hostname: string, options?: ResolveOptions): Promise; - } - /** - * Uses the DNS protocol to resolve `CNAME` records for the `hostname`. The`addresses` argument passed to the `callback` function - * will contain an array of canonical name records available for the `hostname`(e.g. `['bar.example.com']`). - * @since v0.3.2 - */ - export function resolveCname(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void; - export namespace resolveCname { - function __promisify__(hostname: string): Promise; - } - /** - * Uses the DNS protocol to resolve `CAA` records for the `hostname`. The`addresses` argument passed to the `callback` function - * will contain an array of certification authority authorization records - * available for the `hostname` (e.g. `[{critical: 0, iodef: 'mailto:pki@example.com'}, {critical: 128, issue: 'pki.example.com'}]`). - * @since v15.0.0, v14.17.0 - */ - export function resolveCaa(hostname: string, callback: (err: NodeJS.ErrnoException | null, records: CaaRecord[]) => void): void; - export namespace resolveCaa { - function __promisify__(hostname: string): Promise; - } - /** - * Uses the DNS protocol to resolve mail exchange records (`MX` records) for the`hostname`. The `addresses` argument passed to the `callback` function will - * contain an array of objects containing both a `priority` and `exchange`property (e.g. `[{priority: 10, exchange: 'mx.example.com'}, ...]`). - * @since v0.1.27 - */ - export function resolveMx(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: MxRecord[]) => void): void; - export namespace resolveMx { - function __promisify__(hostname: string): Promise; - } - /** - * Uses the DNS protocol to resolve regular expression based records (`NAPTR`records) for the `hostname`. The `addresses` argument passed to the `callback`function will contain an array of - * objects with the following properties: - * - * * `flags` - * * `service` - * * `regexp` - * * `replacement` - * * `order` - * * `preference` - * - * ```js - * { - * flags: 's', - * service: 'SIP+D2U', - * regexp: '', - * replacement: '_sip._udp.example.com', - * order: 30, - * preference: 100 - * } - * ``` - * @since v0.9.12 - */ - export function resolveNaptr(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: NaptrRecord[]) => void): void; - export namespace resolveNaptr { - function __promisify__(hostname: string): Promise; - } - /** - * Uses the DNS protocol to resolve name server records (`NS` records) for the`hostname`. The `addresses` argument passed to the `callback` function will - * contain an array of name server records available for `hostname`(e.g. `['ns1.example.com', 'ns2.example.com']`). - * @since v0.1.90 - */ - export function resolveNs(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void; - export namespace resolveNs { - function __promisify__(hostname: string): Promise; - } - /** - * Uses the DNS protocol to resolve pointer records (`PTR` records) for the`hostname`. The `addresses` argument passed to the `callback` function will - * be an array of strings containing the reply records. - * @since v6.0.0 - */ - export function resolvePtr(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void; - export namespace resolvePtr { - function __promisify__(hostname: string): Promise; - } - /** - * Uses the DNS protocol to resolve a start of authority record (`SOA` record) for - * the `hostname`. The `address` argument passed to the `callback` function will - * be an object with the following properties: - * - * * `nsname` - * * `hostmaster` - * * `serial` - * * `refresh` - * * `retry` - * * `expire` - * * `minttl` - * - * ```js - * { - * nsname: 'ns.example.com', - * hostmaster: 'root.example.com', - * serial: 2013101809, - * refresh: 10000, - * retry: 2400, - * expire: 604800, - * minttl: 3600 - * } - * ``` - * @since v0.11.10 - */ - export function resolveSoa(hostname: string, callback: (err: NodeJS.ErrnoException | null, address: SoaRecord) => void): void; - export namespace resolveSoa { - function __promisify__(hostname: string): Promise; - } - /** - * Uses the DNS protocol to resolve service records (`SRV` records) for the`hostname`. The `addresses` argument passed to the `callback` function will - * be an array of objects with the following properties: - * - * * `priority` - * * `weight` - * * `port` - * * `name` - * - * ```js - * { - * priority: 10, - * weight: 5, - * port: 21223, - * name: 'service.example.com' - * } - * ``` - * @since v0.1.27 - */ - export function resolveSrv(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: SrvRecord[]) => void): void; - export namespace resolveSrv { - function __promisify__(hostname: string): Promise; - } - /** - * Uses the DNS protocol to resolve text queries (`TXT` records) for the`hostname`. The `records` argument passed to the `callback` function is a - * two-dimensional array of the text records available for `hostname` (e.g.`[ ['v=spf1 ip4:0.0.0.0 ', '~all' ] ]`). Each sub-array contains TXT chunks of - * one record. Depending on the use case, these could be either joined together or - * treated separately. - * @since v0.1.27 - */ - export function resolveTxt(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[][]) => void): void; - export namespace resolveTxt { - function __promisify__(hostname: string): Promise; - } - /** - * Uses the DNS protocol to resolve all records (also known as `ANY` or `*` query). - * The `ret` argument passed to the `callback` function will be an array containing - * various types of records. Each object has a property `type` that indicates the - * type of the current record. And depending on the `type`, additional properties - * will be present on the object: - * - * - * - * Here is an example of the `ret` object passed to the callback: - * - * ```js - * [ { type: 'A', address: '127.0.0.1', ttl: 299 }, - * { type: 'CNAME', value: 'example.com' }, - * { type: 'MX', exchange: 'alt4.aspmx.l.example.com', priority: 50 }, - * { type: 'NS', value: 'ns1.example.com' }, - * { type: 'TXT', entries: [ 'v=spf1 include:_spf.example.com ~all' ] }, - * { type: 'SOA', - * nsname: 'ns1.example.com', - * hostmaster: 'admin.example.com', - * serial: 156696742, - * refresh: 900, - * retry: 900, - * expire: 1800, - * minttl: 60 } ] - * ``` - * - * DNS server operators may choose not to respond to `ANY`queries. It may be better to call individual methods like {@link resolve4},{@link resolveMx}, and so on. For more details, see [RFC - * 8482](https://tools.ietf.org/html/rfc8482). - */ - export function resolveAny(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: AnyRecord[]) => void): void; - export namespace resolveAny { - function __promisify__(hostname: string): Promise; - } - /** - * Performs a reverse DNS query that resolves an IPv4 or IPv6 address to an - * array of host names. - * - * On error, `err` is an `Error` object, where `err.code` is - * one of the `DNS error codes`. - * @since v0.1.16 - */ - export function reverse(ip: string, callback: (err: NodeJS.ErrnoException | null, hostnames: string[]) => void): void; - /** - * Sets the IP address and port of servers to be used when performing DNS - * resolution. The `servers` argument is an array of [RFC 5952](https://tools.ietf.org/html/rfc5952#section-6) formatted - * addresses. If the port is the IANA default DNS port (53) it can be omitted. - * - * ```js - * dns.setServers([ - * '4.4.4.4', - * '[2001:4860:4860::8888]', - * '4.4.4.4:1053', - * '[2001:4860:4860::8888]:1053', - * ]); - * ``` - * - * An error will be thrown if an invalid address is provided. - * - * The `dns.setServers()` method must not be called while a DNS query is in - * progress. - * - * The {@link setServers} method affects only {@link resolve},`dns.resolve*()` and {@link reverse} (and specifically _not_ {@link lookup}). - * - * This method works much like [resolve.conf](https://man7.org/linux/man-pages/man5/resolv.conf.5.html). - * That is, if attempting to resolve with the first server provided results in a`NOTFOUND` error, the `resolve()` method will _not_ attempt to resolve with - * subsequent servers provided. Fallback DNS servers will only be used if the - * earlier ones time out or result in some other error. - * @since v0.11.3 - * @param servers array of `RFC 5952` formatted addresses - */ - export function setServers(servers: ReadonlyArray): void; - /** - * Returns an array of IP address strings, formatted according to [RFC 5952](https://tools.ietf.org/html/rfc5952#section-6), - * that are currently configured for DNS resolution. A string will include a port - * section if a custom port is used. - * - * ```js - * [ - * '4.4.4.4', - * '2001:4860:4860::8888', - * '4.4.4.4:1053', - * '[2001:4860:4860::8888]:1053', - * ] - * ``` - * @since v0.11.3 - */ - export function getServers(): string[]; - /** - * Set the default value of `verbatim` in {@link lookup} and `dnsPromises.lookup()`. The value could be: - * - * * `ipv4first`: sets default `verbatim` `false`. - * * `verbatim`: sets default `verbatim` `true`. - * - * The default is `ipv4first` and {@link setDefaultResultOrder} have higher - * priority than `--dns-result-order`. When using `worker threads`,{@link setDefaultResultOrder} from the main thread won't affect the default - * dns orders in workers. - * @since v16.4.0, v14.18.0 - * @param order must be `'ipv4first'` or `'verbatim'`. - */ - export function setDefaultResultOrder(order: 'ipv4first' | 'verbatim'): void; - // Error codes - export const NODATA: string; - export const FORMERR: string; - export const SERVFAIL: string; - export const NOTFOUND: string; - export const NOTIMP: string; - export const REFUSED: string; - export const BADQUERY: string; - export const BADNAME: string; - export const BADFAMILY: string; - export const BADRESP: string; - export const CONNREFUSED: string; - export const TIMEOUT: string; - export const EOF: string; - export const FILE: string; - export const NOMEM: string; - export const DESTRUCTION: string; - export const BADSTR: string; - export const BADFLAGS: string; - export const NONAME: string; - export const BADHINTS: string; - export const NOTINITIALIZED: string; - export const LOADIPHLPAPI: string; - export const ADDRGETNETWORKPARAMS: string; - export const CANCELLED: string; - export interface ResolverOptions { - timeout?: number | undefined; - /** - * @default 4 - */ - tries?: number; - } - /** - * An independent resolver for DNS requests. - * - * Creating a new resolver uses the default server settings. Setting - * the servers used for a resolver using `resolver.setServers()` does not affect - * other resolvers: - * - * ```js - * const { Resolver } = require('dns'); - * const resolver = new Resolver(); - * resolver.setServers(['4.4.4.4']); - * - * // This request will use the server at 4.4.4.4, independent of global settings. - * resolver.resolve4('example.org', (err, addresses) => { - * // ... - * }); - * ``` - * - * The following methods from the `dns` module are available: - * - * * `resolver.getServers()` - * * `resolver.resolve()` - * * `resolver.resolve4()` - * * `resolver.resolve6()` - * * `resolver.resolveAny()` - * * `resolver.resolveCaa()` - * * `resolver.resolveCname()` - * * `resolver.resolveMx()` - * * `resolver.resolveNaptr()` - * * `resolver.resolveNs()` - * * `resolver.resolvePtr()` - * * `resolver.resolveSoa()` - * * `resolver.resolveSrv()` - * * `resolver.resolveTxt()` - * * `resolver.reverse()` - * * `resolver.setServers()` - * @since v8.3.0 - */ - export class Resolver { - constructor(options?: ResolverOptions); - /** - * Cancel all outstanding DNS queries made by this resolver. The corresponding - * callbacks will be called with an error with code `ECANCELLED`. - * @since v8.3.0 - */ - cancel(): void; - getServers: typeof getServers; - resolve: typeof resolve; - resolve4: typeof resolve4; - resolve6: typeof resolve6; - resolveAny: typeof resolveAny; - resolveCname: typeof resolveCname; - resolveMx: typeof resolveMx; - resolveNaptr: typeof resolveNaptr; - resolveNs: typeof resolveNs; - resolvePtr: typeof resolvePtr; - resolveSoa: typeof resolveSoa; - resolveSrv: typeof resolveSrv; - resolveTxt: typeof resolveTxt; - reverse: typeof reverse; - /** - * The resolver instance will send its requests from the specified IP address. - * This allows programs to specify outbound interfaces when used on multi-homed - * systems. - * - * If a v4 or v6 address is not specified, it is set to the default, and the - * operating system will choose a local address automatically. - * - * The resolver will use the v4 local address when making requests to IPv4 DNS - * servers, and the v6 local address when making requests to IPv6 DNS servers. - * The `rrtype` of resolution requests has no impact on the local address used. - * @since v15.1.0, v14.17.0 - * @param [ipv4='0.0.0.0'] A string representation of an IPv4 address. - * @param [ipv6='::0'] A string representation of an IPv6 address. - */ - setLocalAddress(ipv4?: string, ipv6?: string): void; - setServers: typeof setServers; - } - export { dnsPromises as promises }; -} -declare module 'node:dns' { - export * from 'dns'; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/dns/promises.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/dns/promises.d.ts deleted file mode 100755 index 77cd807b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/dns/promises.d.ts +++ /dev/null @@ -1,370 +0,0 @@ -/** - * The `dns.promises` API provides an alternative set of asynchronous DNS methods - * that return `Promise` objects rather than using callbacks. The API is accessible - * via `require('dns').promises` or `require('dns/promises')`. - * @since v10.6.0 - */ -declare module 'dns/promises' { - import { - LookupAddress, - LookupOneOptions, - LookupAllOptions, - LookupOptions, - AnyRecord, - CaaRecord, - MxRecord, - NaptrRecord, - SoaRecord, - SrvRecord, - ResolveWithTtlOptions, - RecordWithTtl, - ResolveOptions, - ResolverOptions, - } from 'node:dns'; - /** - * Returns an array of IP address strings, formatted according to [RFC 5952](https://tools.ietf.org/html/rfc5952#section-6), - * that are currently configured for DNS resolution. A string will include a port - * section if a custom port is used. - * - * ```js - * [ - * '4.4.4.4', - * '2001:4860:4860::8888', - * '4.4.4.4:1053', - * '[2001:4860:4860::8888]:1053', - * ] - * ``` - * @since v10.6.0 - */ - function getServers(): string[]; - /** - * Resolves a host name (e.g. `'nodejs.org'`) into the first found A (IPv4) or - * AAAA (IPv6) record. All `option` properties are optional. If `options` is an - * integer, then it must be `4` or `6` – if `options` is not provided, then IPv4 - * and IPv6 addresses are both returned if found. - * - * With the `all` option set to `true`, the `Promise` is resolved with `addresses`being an array of objects with the properties `address` and `family`. - * - * On error, the `Promise` is rejected with an `Error` object, where `err.code`is the error code. - * Keep in mind that `err.code` will be set to `'ENOTFOUND'` not only when - * the host name does not exist but also when the lookup fails in other ways - * such as no available file descriptors. - * - * `dnsPromises.lookup()` does not necessarily have anything to do with the DNS - * protocol. The implementation uses an operating system facility that can - * associate names with addresses, and vice versa. This implementation can have - * subtle but important consequences on the behavior of any Node.js program. Please - * take some time to consult the `Implementation considerations section` before - * using `dnsPromises.lookup()`. - * - * Example usage: - * - * ```js - * const dns = require('dns'); - * const dnsPromises = dns.promises; - * const options = { - * family: 6, - * hints: dns.ADDRCONFIG | dns.V4MAPPED, - * }; - * - * dnsPromises.lookup('example.com', options).then((result) => { - * console.log('address: %j family: IPv%s', result.address, result.family); - * // address: "2606:2800:220:1:248:1893:25c8:1946" family: IPv6 - * }); - * - * // When options.all is true, the result will be an Array. - * options.all = true; - * dnsPromises.lookup('example.com', options).then((result) => { - * console.log('addresses: %j', result); - * // addresses: [{"address":"2606:2800:220:1:248:1893:25c8:1946","family":6}] - * }); - * ``` - * @since v10.6.0 - */ - function lookup(hostname: string, family: number): Promise; - function lookup(hostname: string, options: LookupOneOptions): Promise; - function lookup(hostname: string, options: LookupAllOptions): Promise; - function lookup(hostname: string, options: LookupOptions): Promise; - function lookup(hostname: string): Promise; - /** - * Resolves the given `address` and `port` into a host name and service using - * the operating system's underlying `getnameinfo` implementation. - * - * If `address` is not a valid IP address, a `TypeError` will be thrown. - * The `port` will be coerced to a number. If it is not a legal port, a `TypeError`will be thrown. - * - * On error, the `Promise` is rejected with an `Error` object, where `err.code`is the error code. - * - * ```js - * const dnsPromises = require('dns').promises; - * dnsPromises.lookupService('127.0.0.1', 22).then((result) => { - * console.log(result.hostname, result.service); - * // Prints: localhost ssh - * }); - * ``` - * @since v10.6.0 - */ - function lookupService( - address: string, - port: number - ): Promise<{ - hostname: string; - service: string; - }>; - /** - * Uses the DNS protocol to resolve a host name (e.g. `'nodejs.org'`) into an array - * of the resource records. When successful, the `Promise` is resolved with an - * array of resource records. The type and structure of individual results vary - * based on `rrtype`: - * - * - * - * On error, the `Promise` is rejected with an `Error` object, where `err.code`is one of the `DNS error codes`. - * @since v10.6.0 - * @param hostname Host name to resolve. - * @param [rrtype='A'] Resource record type. - */ - function resolve(hostname: string): Promise; - function resolve(hostname: string, rrtype: 'A'): Promise; - function resolve(hostname: string, rrtype: 'AAAA'): Promise; - function resolve(hostname: string, rrtype: 'ANY'): Promise; - function resolve(hostname: string, rrtype: 'CAA'): Promise; - function resolve(hostname: string, rrtype: 'CNAME'): Promise; - function resolve(hostname: string, rrtype: 'MX'): Promise; - function resolve(hostname: string, rrtype: 'NAPTR'): Promise; - function resolve(hostname: string, rrtype: 'NS'): Promise; - function resolve(hostname: string, rrtype: 'PTR'): Promise; - function resolve(hostname: string, rrtype: 'SOA'): Promise; - function resolve(hostname: string, rrtype: 'SRV'): Promise; - function resolve(hostname: string, rrtype: 'TXT'): Promise; - function resolve(hostname: string, rrtype: string): Promise; - /** - * Uses the DNS protocol to resolve IPv4 addresses (`A` records) for the`hostname`. On success, the `Promise` is resolved with an array of IPv4 - * addresses (e.g. `['74.125.79.104', '74.125.79.105', '74.125.79.106']`). - * @since v10.6.0 - * @param hostname Host name to resolve. - */ - function resolve4(hostname: string): Promise; - function resolve4(hostname: string, options: ResolveWithTtlOptions): Promise; - function resolve4(hostname: string, options: ResolveOptions): Promise; - /** - * Uses the DNS protocol to resolve IPv6 addresses (`AAAA` records) for the`hostname`. On success, the `Promise` is resolved with an array of IPv6 - * addresses. - * @since v10.6.0 - * @param hostname Host name to resolve. - */ - function resolve6(hostname: string): Promise; - function resolve6(hostname: string, options: ResolveWithTtlOptions): Promise; - function resolve6(hostname: string, options: ResolveOptions): Promise; - /** - * Uses the DNS protocol to resolve all records (also known as `ANY` or `*` query). - * On success, the `Promise` is resolved with an array containing various types of - * records. Each object has a property `type` that indicates the type of the - * current record. And depending on the `type`, additional properties will be - * present on the object: - * - * - * - * Here is an example of the result object: - * - * ```js - * [ { type: 'A', address: '127.0.0.1', ttl: 299 }, - * { type: 'CNAME', value: 'example.com' }, - * { type: 'MX', exchange: 'alt4.aspmx.l.example.com', priority: 50 }, - * { type: 'NS', value: 'ns1.example.com' }, - * { type: 'TXT', entries: [ 'v=spf1 include:_spf.example.com ~all' ] }, - * { type: 'SOA', - * nsname: 'ns1.example.com', - * hostmaster: 'admin.example.com', - * serial: 156696742, - * refresh: 900, - * retry: 900, - * expire: 1800, - * minttl: 60 } ] - * ``` - * @since v10.6.0 - */ - function resolveAny(hostname: string): Promise; - /** - * Uses the DNS protocol to resolve `CAA` records for the `hostname`. On success, - * the `Promise` is resolved with an array of objects containing available - * certification authority authorization records available for the `hostname`(e.g. `[{critical: 0, iodef: 'mailto:pki@example.com'},{critical: 128, issue: 'pki.example.com'}]`). - * @since v15.0.0, v14.17.0 - */ - function resolveCaa(hostname: string): Promise; - /** - * Uses the DNS protocol to resolve `CNAME` records for the `hostname`. On success, - * the `Promise` is resolved with an array of canonical name records available for - * the `hostname` (e.g. `['bar.example.com']`). - * @since v10.6.0 - */ - function resolveCname(hostname: string): Promise; - /** - * Uses the DNS protocol to resolve mail exchange records (`MX` records) for the`hostname`. On success, the `Promise` is resolved with an array of objects - * containing both a `priority` and `exchange` property (e.g.`[{priority: 10, exchange: 'mx.example.com'}, ...]`). - * @since v10.6.0 - */ - function resolveMx(hostname: string): Promise; - /** - * Uses the DNS protocol to resolve regular expression based records (`NAPTR`records) for the `hostname`. On success, the `Promise` is resolved with an array - * of objects with the following properties: - * - * * `flags` - * * `service` - * * `regexp` - * * `replacement` - * * `order` - * * `preference` - * - * ```js - * { - * flags: 's', - * service: 'SIP+D2U', - * regexp: '', - * replacement: '_sip._udp.example.com', - * order: 30, - * preference: 100 - * } - * ``` - * @since v10.6.0 - */ - function resolveNaptr(hostname: string): Promise; - /** - * Uses the DNS protocol to resolve name server records (`NS` records) for the`hostname`. On success, the `Promise` is resolved with an array of name server - * records available for `hostname` (e.g.`['ns1.example.com', 'ns2.example.com']`). - * @since v10.6.0 - */ - function resolveNs(hostname: string): Promise; - /** - * Uses the DNS protocol to resolve pointer records (`PTR` records) for the`hostname`. On success, the `Promise` is resolved with an array of strings - * containing the reply records. - * @since v10.6.0 - */ - function resolvePtr(hostname: string): Promise; - /** - * Uses the DNS protocol to resolve a start of authority record (`SOA` record) for - * the `hostname`. On success, the `Promise` is resolved with an object with the - * following properties: - * - * * `nsname` - * * `hostmaster` - * * `serial` - * * `refresh` - * * `retry` - * * `expire` - * * `minttl` - * - * ```js - * { - * nsname: 'ns.example.com', - * hostmaster: 'root.example.com', - * serial: 2013101809, - * refresh: 10000, - * retry: 2400, - * expire: 604800, - * minttl: 3600 - * } - * ``` - * @since v10.6.0 - */ - function resolveSoa(hostname: string): Promise; - /** - * Uses the DNS protocol to resolve service records (`SRV` records) for the`hostname`. On success, the `Promise` is resolved with an array of objects with - * the following properties: - * - * * `priority` - * * `weight` - * * `port` - * * `name` - * - * ```js - * { - * priority: 10, - * weight: 5, - * port: 21223, - * name: 'service.example.com' - * } - * ``` - * @since v10.6.0 - */ - function resolveSrv(hostname: string): Promise; - /** - * Uses the DNS protocol to resolve text queries (`TXT` records) for the`hostname`. On success, the `Promise` is resolved with a two-dimensional array - * of the text records available for `hostname` (e.g.`[ ['v=spf1 ip4:0.0.0.0 ', '~all' ] ]`). Each sub-array contains TXT chunks of - * one record. Depending on the use case, these could be either joined together or - * treated separately. - * @since v10.6.0 - */ - function resolveTxt(hostname: string): Promise; - /** - * Performs a reverse DNS query that resolves an IPv4 or IPv6 address to an - * array of host names. - * - * On error, the `Promise` is rejected with an `Error` object, where `err.code`is one of the `DNS error codes`. - * @since v10.6.0 - */ - function reverse(ip: string): Promise; - /** - * Sets the IP address and port of servers to be used when performing DNS - * resolution. The `servers` argument is an array of [RFC 5952](https://tools.ietf.org/html/rfc5952#section-6) formatted - * addresses. If the port is the IANA default DNS port (53) it can be omitted. - * - * ```js - * dnsPromises.setServers([ - * '4.4.4.4', - * '[2001:4860:4860::8888]', - * '4.4.4.4:1053', - * '[2001:4860:4860::8888]:1053', - * ]); - * ``` - * - * An error will be thrown if an invalid address is provided. - * - * The `dnsPromises.setServers()` method must not be called while a DNS query is in - * progress. - * - * This method works much like [resolve.conf](https://man7.org/linux/man-pages/man5/resolv.conf.5.html). - * That is, if attempting to resolve with the first server provided results in a`NOTFOUND` error, the `resolve()` method will _not_ attempt to resolve with - * subsequent servers provided. Fallback DNS servers will only be used if the - * earlier ones time out or result in some other error. - * @since v10.6.0 - * @param servers array of `RFC 5952` formatted addresses - */ - function setServers(servers: ReadonlyArray): void; - /** - * Set the default value of `verbatim` in `dns.lookup()` and `dnsPromises.lookup()`. The value could be: - * - * * `ipv4first`: sets default `verbatim` `false`. - * * `verbatim`: sets default `verbatim` `true`. - * - * The default is `ipv4first` and `dnsPromises.setDefaultResultOrder()` have - * higher priority than `--dns-result-order`. When using `worker threads`,`dnsPromises.setDefaultResultOrder()` from the main thread won't affect the - * default dns orders in workers. - * @since v16.4.0, v14.18.0 - * @param order must be `'ipv4first'` or `'verbatim'`. - */ - function setDefaultResultOrder(order: 'ipv4first' | 'verbatim'): void; - class Resolver { - constructor(options?: ResolverOptions); - cancel(): void; - getServers: typeof getServers; - resolve: typeof resolve; - resolve4: typeof resolve4; - resolve6: typeof resolve6; - resolveAny: typeof resolveAny; - resolveCname: typeof resolveCname; - resolveMx: typeof resolveMx; - resolveNaptr: typeof resolveNaptr; - resolveNs: typeof resolveNs; - resolvePtr: typeof resolvePtr; - resolveSoa: typeof resolveSoa; - resolveSrv: typeof resolveSrv; - resolveTxt: typeof resolveTxt; - reverse: typeof reverse; - setLocalAddress(ipv4?: string, ipv6?: string): void; - setServers: typeof setServers; - } -} -declare module 'node:dns/promises' { - export * from 'dns/promises'; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/dom-events.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/dom-events.d.ts deleted file mode 100755 index b9c1c3aa..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/dom-events.d.ts +++ /dev/null @@ -1,126 +0,0 @@ -export {}; // Don't export anything! - -//// DOM-like Events -// NB: The Event / EventTarget / EventListener implementations below were copied -// from lib.dom.d.ts, then edited to reflect Node's documentation at -// https://nodejs.org/api/events.html#class-eventtarget. -// Please read that link to understand important implementation differences. - -// This conditional type will be the existing global Event in a browser, or -// the copy below in a Node environment. -type __Event = typeof globalThis extends { onmessage: any, Event: any } -? {} -: { - /** This is not used in Node.js and is provided purely for completeness. */ - readonly bubbles: boolean; - /** Alias for event.stopPropagation(). This is not used in Node.js and is provided purely for completeness. */ - cancelBubble: () => void; - /** True if the event was created with the cancelable option */ - readonly cancelable: boolean; - /** This is not used in Node.js and is provided purely for completeness. */ - readonly composed: boolean; - /** Returns an array containing the current EventTarget as the only entry or empty if the event is not being dispatched. This is not used in Node.js and is provided purely for completeness. */ - composedPath(): [EventTarget?] - /** Alias for event.target. */ - readonly currentTarget: EventTarget | null; - /** Is true if cancelable is true and event.preventDefault() has been called. */ - readonly defaultPrevented: boolean; - /** This is not used in Node.js and is provided purely for completeness. */ - readonly eventPhase: 0 | 2; - /** The `AbortSignal` "abort" event is emitted with `isTrusted` set to `true`. The value is `false` in all other cases. */ - readonly isTrusted: boolean; - /** Sets the `defaultPrevented` property to `true` if `cancelable` is `true`. */ - preventDefault(): void; - /** This is not used in Node.js and is provided purely for completeness. */ - returnValue: boolean; - /** Alias for event.target. */ - readonly srcElement: EventTarget | null; - /** Stops the invocation of event listeners after the current one completes. */ - stopImmediatePropagation(): void; - /** This is not used in Node.js and is provided purely for completeness. */ - stopPropagation(): void; - /** The `EventTarget` dispatching the event */ - readonly target: EventTarget | null; - /** The millisecond timestamp when the Event object was created. */ - readonly timeStamp: number; - /** Returns the type of event, e.g. "click", "hashchange", or "submit". */ - readonly type: string; -}; - -// See comment above explaining conditional type -type __EventTarget = typeof globalThis extends { onmessage: any, EventTarget: any } -? {} -: { - /** - * Adds a new handler for the `type` event. Any given `listener` is added only once per `type` and per `capture` option value. - * - * If the `once` option is true, the `listener` is removed after the next time a `type` event is dispatched. - * - * The `capture` option is not used by Node.js in any functional way other than tracking registered event listeners per the `EventTarget` specification. - * Specifically, the `capture` option is used as part of the key when registering a `listener`. - * Any individual `listener` may be added once with `capture = false`, and once with `capture = true`. - */ - addEventListener( - type: string, - listener: EventListener | EventListenerObject, - options?: AddEventListenerOptions | boolean, - ): void; - /** Dispatches a synthetic event event to target and returns true if either event's cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise. */ - dispatchEvent(event: Event): boolean; - /** Removes the event listener in target's event listener list with the same type, callback, and options. */ - removeEventListener( - type: string, - listener: EventListener | EventListenerObject, - options?: EventListenerOptions | boolean, - ): void; -}; - -interface EventInit { - bubbles?: boolean; - cancelable?: boolean; - composed?: boolean; -} - -interface EventListenerOptions { - /** Not directly used by Node.js. Added for API completeness. Default: `false`. */ - capture?: boolean; -} - -interface AddEventListenerOptions extends EventListenerOptions { - /** When `true`, the listener is automatically removed when it is first invoked. Default: `false`. */ - once?: boolean; - /** When `true`, serves as a hint that the listener will not call the `Event` object's `preventDefault()` method. Default: false. */ - passive?: boolean; -} - -interface EventListener { - (evt: Event): void; -} - -interface EventListenerObject { - handleEvent(object: Event): void; -} - -import {} from 'events'; // Make this an ambient declaration -declare global { - /** An event which takes place in the DOM. */ - interface Event extends __Event {} - var Event: typeof globalThis extends { onmessage: any, Event: infer T } - ? T - : { - prototype: __Event; - new (type: string, eventInitDict?: EventInit): __Event; - }; - - /** - * EventTarget is a DOM interface implemented by objects that can - * receive events and may have listeners for them. - */ - interface EventTarget extends __EventTarget {} - var EventTarget: typeof globalThis extends { onmessage: any, EventTarget: infer T } - ? T - : { - prototype: __EventTarget; - new (): __EventTarget; - }; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/domain.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/domain.d.ts deleted file mode 100755 index fafe68a5..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/domain.d.ts +++ /dev/null @@ -1,170 +0,0 @@ -/** - * **This module is pending deprecation.** Once a replacement API has been - * finalized, this module will be fully deprecated. Most developers should - * **not** have cause to use this module. Users who absolutely must have - * the functionality that domains provide may rely on it for the time being - * but should expect to have to migrate to a different solution - * in the future. - * - * Domains provide a way to handle multiple different IO operations as a - * single group. If any of the event emitters or callbacks registered to a - * domain emit an `'error'` event, or throw an error, then the domain object - * will be notified, rather than losing the context of the error in the`process.on('uncaughtException')` handler, or causing the program to - * exit immediately with an error code. - * @deprecated Since v1.4.2 - Deprecated - * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/domain.js) - */ -declare module 'domain' { - import EventEmitter = require('node:events'); - /** - * The `Domain` class encapsulates the functionality of routing errors and - * uncaught exceptions to the active `Domain` object. - * - * To handle the errors that it catches, listen to its `'error'` event. - */ - class Domain extends EventEmitter { - /** - * An array of timers and event emitters that have been explicitly added - * to the domain. - */ - members: Array; - /** - * The `enter()` method is plumbing used by the `run()`, `bind()`, and`intercept()` methods to set the active domain. It sets `domain.active` and`process.domain` to the domain, and implicitly - * pushes the domain onto the domain - * stack managed by the domain module (see {@link exit} for details on the - * domain stack). The call to `enter()` delimits the beginning of a chain of - * asynchronous calls and I/O operations bound to a domain. - * - * Calling `enter()` changes only the active domain, and does not alter the domain - * itself. `enter()` and `exit()` can be called an arbitrary number of times on a - * single domain. - */ - enter(): void; - /** - * The `exit()` method exits the current domain, popping it off the domain stack. - * Any time execution is going to switch to the context of a different chain of - * asynchronous calls, it's important to ensure that the current domain is exited. - * The call to `exit()` delimits either the end of or an interruption to the chain - * of asynchronous calls and I/O operations bound to a domain. - * - * If there are multiple, nested domains bound to the current execution context,`exit()` will exit any domains nested within this domain. - * - * Calling `exit()` changes only the active domain, and does not alter the domain - * itself. `enter()` and `exit()` can be called an arbitrary number of times on a - * single domain. - */ - exit(): void; - /** - * Run the supplied function in the context of the domain, implicitly - * binding all event emitters, timers, and lowlevel requests that are - * created in that context. Optionally, arguments can be passed to - * the function. - * - * This is the most basic way to use a domain. - * - * ```js - * const domain = require('domain'); - * const fs = require('fs'); - * const d = domain.create(); - * d.on('error', (er) => { - * console.error('Caught error!', er); - * }); - * d.run(() => { - * process.nextTick(() => { - * setTimeout(() => { // Simulating some various async stuff - * fs.open('non-existent file', 'r', (er, fd) => { - * if (er) throw er; - * // proceed... - * }); - * }, 100); - * }); - * }); - * ``` - * - * In this example, the `d.on('error')` handler will be triggered, rather - * than crashing the program. - */ - run(fn: (...args: any[]) => T, ...args: any[]): T; - /** - * Explicitly adds an emitter to the domain. If any event handlers called by - * the emitter throw an error, or if the emitter emits an `'error'` event, it - * will be routed to the domain's `'error'` event, just like with implicit - * binding. - * - * This also works with timers that are returned from `setInterval()` and `setTimeout()`. If their callback function throws, it will be caught by - * the domain `'error'` handler. - * - * If the Timer or `EventEmitter` was already bound to a domain, it is removed - * from that one, and bound to this one instead. - * @param emitter emitter or timer to be added to the domain - */ - add(emitter: EventEmitter | NodeJS.Timer): void; - /** - * The opposite of {@link add}. Removes domain handling from the - * specified emitter. - * @param emitter emitter or timer to be removed from the domain - */ - remove(emitter: EventEmitter | NodeJS.Timer): void; - /** - * The returned function will be a wrapper around the supplied callback - * function. When the returned function is called, any errors that are - * thrown will be routed to the domain's `'error'` event. - * - * ```js - * const d = domain.create(); - * - * function readSomeFile(filename, cb) { - * fs.readFile(filename, 'utf8', d.bind((er, data) => { - * // If this throws, it will also be passed to the domain. - * return cb(er, data ? JSON.parse(data) : null); - * })); - * } - * - * d.on('error', (er) => { - * // An error occurred somewhere. If we throw it now, it will crash the program - * // with the normal line number and stack message. - * }); - * ``` - * @param callback The callback function - * @return The bound function - */ - bind(callback: T): T; - /** - * This method is almost identical to {@link bind}. However, in - * addition to catching thrown errors, it will also intercept `Error` objects sent as the first argument to the function. - * - * In this way, the common `if (err) return callback(err);` pattern can be replaced - * with a single error handler in a single place. - * - * ```js - * const d = domain.create(); - * - * function readSomeFile(filename, cb) { - * fs.readFile(filename, 'utf8', d.intercept((data) => { - * // Note, the first argument is never passed to the - * // callback since it is assumed to be the 'Error' argument - * // and thus intercepted by the domain. - * - * // If this throws, it will also be passed to the domain - * // so the error-handling logic can be moved to the 'error' - * // event on the domain instead of being repeated throughout - * // the program. - * return cb(null, JSON.parse(data)); - * })); - * } - * - * d.on('error', (er) => { - * // An error occurred somewhere. If we throw it now, it will crash the program - * // with the normal line number and stack message. - * }); - * ``` - * @param callback The callback function - * @return The intercepted function - */ - intercept(callback: T): T; - } - function create(): Domain; -} -declare module 'node:domain' { - export * from 'domain'; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/events.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/events.d.ts deleted file mode 100755 index 4633df19..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/events.d.ts +++ /dev/null @@ -1,678 +0,0 @@ -/** - * Much of the Node.js core API is built around an idiomatic asynchronous - * event-driven architecture in which certain kinds of objects (called "emitters") - * emit named events that cause `Function` objects ("listeners") to be called. - * - * For instance: a `net.Server` object emits an event each time a peer - * connects to it; a `fs.ReadStream` emits an event when the file is opened; - * a `stream` emits an event whenever data is available to be read. - * - * All objects that emit events are instances of the `EventEmitter` class. These - * objects expose an `eventEmitter.on()` function that allows one or more - * functions to be attached to named events emitted by the object. Typically, - * event names are camel-cased strings but any valid JavaScript property key - * can be used. - * - * When the `EventEmitter` object emits an event, all of the functions attached - * to that specific event are called _synchronously_. Any values returned by the - * called listeners are _ignored_ and discarded. - * - * The following example shows a simple `EventEmitter` instance with a single - * listener. The `eventEmitter.on()` method is used to register listeners, while - * the `eventEmitter.emit()` method is used to trigger the event. - * - * ```js - * const EventEmitter = require('events'); - * - * class MyEmitter extends EventEmitter {} - * - * const myEmitter = new MyEmitter(); - * myEmitter.on('event', () => { - * console.log('an event occurred!'); - * }); - * myEmitter.emit('event'); - * ``` - * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/events.js) - */ -declare module 'events' { - // NOTE: This class is in the docs but is **not actually exported** by Node. - // If https://github.com/nodejs/node/issues/39903 gets resolved and Node - // actually starts exporting the class, uncomment below. - - // import { EventListener, EventListenerObject } from '__dom-events'; - // /** The NodeEventTarget is a Node.js-specific extension to EventTarget that emulates a subset of the EventEmitter API. */ - // interface NodeEventTarget extends EventTarget { - // /** - // * Node.js-specific extension to the `EventTarget` class that emulates the equivalent `EventEmitter` API. - // * The only difference between `addListener()` and `addEventListener()` is that addListener() will return a reference to the EventTarget. - // */ - // addListener(type: string, listener: EventListener | EventListenerObject, options?: { once: boolean }): this; - // /** Node.js-specific extension to the `EventTarget` class that returns an array of event `type` names for which event listeners are registered. */ - // eventNames(): string[]; - // /** Node.js-specific extension to the `EventTarget` class that returns the number of event listeners registered for the `type`. */ - // listenerCount(type: string): number; - // /** Node.js-specific alias for `eventTarget.removeListener()`. */ - // off(type: string, listener: EventListener | EventListenerObject): this; - // /** Node.js-specific alias for `eventTarget.addListener()`. */ - // on(type: string, listener: EventListener | EventListenerObject, options?: { once: boolean }): this; - // /** Node.js-specific extension to the `EventTarget` class that adds a `once` listener for the given event `type`. This is equivalent to calling `on` with the `once` option set to `true`. */ - // once(type: string, listener: EventListener | EventListenerObject): this; - // /** - // * Node.js-specific extension to the `EventTarget` class. - // * If `type` is specified, removes all registered listeners for `type`, - // * otherwise removes all registered listeners. - // */ - // removeAllListeners(type: string): this; - // /** - // * Node.js-specific extension to the `EventTarget` class that removes the listener for the given `type`. - // * The only difference between `removeListener()` and `removeEventListener()` is that `removeListener()` will return a reference to the `EventTarget`. - // */ - // removeListener(type: string, listener: EventListener | EventListenerObject): this; - // } - - interface EventEmitterOptions { - /** - * Enables automatic capturing of promise rejection. - */ - captureRejections?: boolean | undefined; - } - // Any EventTarget with a Node-style `once` function - interface _NodeEventTarget { - once(eventName: string | symbol, listener: (...args: any[]) => void): this; - } - // Any EventTarget with a DOM-style `addEventListener` - interface _DOMEventTarget { - addEventListener( - eventName: string, - listener: (...args: any[]) => void, - opts?: { - once: boolean; - } - ): any; - } - interface StaticEventEmitterOptions { - signal?: AbortSignal | undefined; - } - interface EventEmitter extends NodeJS.EventEmitter {} - /** - * The `EventEmitter` class is defined and exposed by the `events` module: - * - * ```js - * const EventEmitter = require('events'); - * ``` - * - * All `EventEmitter`s emit the event `'newListener'` when new listeners are - * added and `'removeListener'` when existing listeners are removed. - * - * It supports the following option: - * @since v0.1.26 - */ - class EventEmitter { - constructor(options?: EventEmitterOptions); - /** - * Creates a `Promise` that is fulfilled when the `EventEmitter` emits the given - * event or that is rejected if the `EventEmitter` emits `'error'` while waiting. - * The `Promise` will resolve with an array of all the arguments emitted to the - * given event. - * - * This method is intentionally generic and works with the web platform [EventTarget](https://dom.spec.whatwg.org/#interface-eventtarget) interface, which has no special`'error'` event - * semantics and does not listen to the `'error'` event. - * - * ```js - * const { once, EventEmitter } = require('events'); - * - * async function run() { - * const ee = new EventEmitter(); - * - * process.nextTick(() => { - * ee.emit('myevent', 42); - * }); - * - * const [value] = await once(ee, 'myevent'); - * console.log(value); - * - * const err = new Error('kaboom'); - * process.nextTick(() => { - * ee.emit('error', err); - * }); - * - * try { - * await once(ee, 'myevent'); - * } catch (err) { - * console.log('error happened', err); - * } - * } - * - * run(); - * ``` - * - * The special handling of the `'error'` event is only used when `events.once()`is used to wait for another event. If `events.once()` is used to wait for the - * '`error'` event itself, then it is treated as any other kind of event without - * special handling: - * - * ```js - * const { EventEmitter, once } = require('events'); - * - * const ee = new EventEmitter(); - * - * once(ee, 'error') - * .then(([err]) => console.log('ok', err.message)) - * .catch((err) => console.log('error', err.message)); - * - * ee.emit('error', new Error('boom')); - * - * // Prints: ok boom - * ``` - * - * An `AbortSignal` can be used to cancel waiting for the event: - * - * ```js - * const { EventEmitter, once } = require('events'); - * - * const ee = new EventEmitter(); - * const ac = new AbortController(); - * - * async function foo(emitter, event, signal) { - * try { - * await once(emitter, event, { signal }); - * console.log('event emitted!'); - * } catch (error) { - * if (error.name === 'AbortError') { - * console.error('Waiting for the event was canceled!'); - * } else { - * console.error('There was an error', error.message); - * } - * } - * } - * - * foo(ee, 'foo', ac.signal); - * ac.abort(); // Abort waiting for the event - * ee.emit('foo'); // Prints: Waiting for the event was canceled! - * ``` - * @since v11.13.0, v10.16.0 - */ - static once(emitter: _NodeEventTarget, eventName: string | symbol, options?: StaticEventEmitterOptions): Promise; - static once(emitter: _DOMEventTarget, eventName: string, options?: StaticEventEmitterOptions): Promise; - /** - * ```js - * const { on, EventEmitter } = require('events'); - * - * (async () => { - * const ee = new EventEmitter(); - * - * // Emit later on - * process.nextTick(() => { - * ee.emit('foo', 'bar'); - * ee.emit('foo', 42); - * }); - * - * for await (const event of on(ee, 'foo')) { - * // The execution of this inner block is synchronous and it - * // processes one event at a time (even with await). Do not use - * // if concurrent execution is required. - * console.log(event); // prints ['bar'] [42] - * } - * // Unreachable here - * })(); - * ``` - * - * Returns an `AsyncIterator` that iterates `eventName` events. It will throw - * if the `EventEmitter` emits `'error'`. It removes all listeners when - * exiting the loop. The `value` returned by each iteration is an array - * composed of the emitted event arguments. - * - * An `AbortSignal` can be used to cancel waiting on events: - * - * ```js - * const { on, EventEmitter } = require('events'); - * const ac = new AbortController(); - * - * (async () => { - * const ee = new EventEmitter(); - * - * // Emit later on - * process.nextTick(() => { - * ee.emit('foo', 'bar'); - * ee.emit('foo', 42); - * }); - * - * for await (const event of on(ee, 'foo', { signal: ac.signal })) { - * // The execution of this inner block is synchronous and it - * // processes one event at a time (even with await). Do not use - * // if concurrent execution is required. - * console.log(event); // prints ['bar'] [42] - * } - * // Unreachable here - * })(); - * - * process.nextTick(() => ac.abort()); - * ``` - * @since v13.6.0, v12.16.0 - * @param eventName The name of the event being listened for - * @return that iterates `eventName` events emitted by the `emitter` - */ - static on(emitter: NodeJS.EventEmitter, eventName: string, options?: StaticEventEmitterOptions): AsyncIterableIterator; - /** - * A class method that returns the number of listeners for the given `eventName`registered on the given `emitter`. - * - * ```js - * const { EventEmitter, listenerCount } = require('events'); - * const myEmitter = new EventEmitter(); - * myEmitter.on('event', () => {}); - * myEmitter.on('event', () => {}); - * console.log(listenerCount(myEmitter, 'event')); - * // Prints: 2 - * ``` - * @since v0.9.12 - * @deprecated Since v3.2.0 - Use `listenerCount` instead. - * @param emitter The emitter to query - * @param eventName The event name - */ - static listenerCount(emitter: NodeJS.EventEmitter, eventName: string | symbol): number; - /** - * Returns a copy of the array of listeners for the event named `eventName`. - * - * For `EventEmitter`s this behaves exactly the same as calling `.listeners` on - * the emitter. - * - * For `EventTarget`s this is the only way to get the event listeners for the - * event target. This is useful for debugging and diagnostic purposes. - * - * ```js - * const { getEventListeners, EventEmitter } = require('events'); - * - * { - * const ee = new EventEmitter(); - * const listener = () => console.log('Events are fun'); - * ee.on('foo', listener); - * getEventListeners(ee, 'foo'); // [listener] - * } - * { - * const et = new EventTarget(); - * const listener = () => console.log('Events are fun'); - * et.addEventListener('foo', listener); - * getEventListeners(et, 'foo'); // [listener] - * } - * ``` - * @since v15.2.0, v14.17.0 - */ - static getEventListeners(emitter: _DOMEventTarget | NodeJS.EventEmitter, name: string | symbol): Function[]; - /** - * ```js - * const { - * setMaxListeners, - * EventEmitter - * } = require('events'); - * - * const target = new EventTarget(); - * const emitter = new EventEmitter(); - * - * setMaxListeners(5, target, emitter); - * ``` - * @since v15.4.0 - * @param n A non-negative number. The maximum number of listeners per `EventTarget` event. - * @param eventsTargets Zero or more {EventTarget} or {EventEmitter} instances. If none are specified, `n` is set as the default max for all newly created {EventTarget} and {EventEmitter} - * objects. - */ - static setMaxListeners(n?: number, ...eventTargets: Array<_DOMEventTarget | NodeJS.EventEmitter>): void; - /** - * This symbol shall be used to install a listener for only monitoring `'error'` - * events. Listeners installed using this symbol are called before the regular - * `'error'` listeners are called. - * - * Installing a listener using this symbol does not change the behavior once an - * `'error'` event is emitted, therefore the process will still crash if no - * regular `'error'` listener is installed. - */ - static readonly errorMonitor: unique symbol; - static readonly captureRejectionSymbol: unique symbol; - /** - * Sets or gets the default captureRejection value for all emitters. - */ - // TODO: These should be described using static getter/setter pairs: - static captureRejections: boolean; - static defaultMaxListeners: number; - } - import internal = require('node:events'); - namespace EventEmitter { - // Should just be `export { EventEmitter }`, but that doesn't work in TypeScript 3.4 - export { internal as EventEmitter }; - export interface Abortable { - /** - * When provided the corresponding `AbortController` can be used to cancel an asynchronous action. - */ - signal?: AbortSignal | undefined; - } - } - global { - namespace NodeJS { - interface EventEmitter { - /** - * Alias for `emitter.on(eventName, listener)`. - * @since v0.1.26 - */ - addListener(eventName: string | symbol, listener: (...args: any[]) => void): this; - /** - * Adds the `listener` function to the end of the listeners array for the - * event named `eventName`. No checks are made to see if the `listener` has - * already been added. Multiple calls passing the same combination of `eventName`and `listener` will result in the `listener` being added, and called, multiple - * times. - * - * ```js - * server.on('connection', (stream) => { - * console.log('someone connected!'); - * }); - * ``` - * - * Returns a reference to the `EventEmitter`, so that calls can be chained. - * - * By default, event listeners are invoked in the order they are added. The`emitter.prependListener()` method can be used as an alternative to add the - * event listener to the beginning of the listeners array. - * - * ```js - * const myEE = new EventEmitter(); - * myEE.on('foo', () => console.log('a')); - * myEE.prependListener('foo', () => console.log('b')); - * myEE.emit('foo'); - * // Prints: - * // b - * // a - * ``` - * @since v0.1.101 - * @param eventName The name of the event. - * @param listener The callback function - */ - on(eventName: string | symbol, listener: (...args: any[]) => void): this; - /** - * Adds a **one-time**`listener` function for the event named `eventName`. The - * next time `eventName` is triggered, this listener is removed and then invoked. - * - * ```js - * server.once('connection', (stream) => { - * console.log('Ah, we have our first user!'); - * }); - * ``` - * - * Returns a reference to the `EventEmitter`, so that calls can be chained. - * - * By default, event listeners are invoked in the order they are added. The`emitter.prependOnceListener()` method can be used as an alternative to add the - * event listener to the beginning of the listeners array. - * - * ```js - * const myEE = new EventEmitter(); - * myEE.once('foo', () => console.log('a')); - * myEE.prependOnceListener('foo', () => console.log('b')); - * myEE.emit('foo'); - * // Prints: - * // b - * // a - * ``` - * @since v0.3.0 - * @param eventName The name of the event. - * @param listener The callback function - */ - once(eventName: string | symbol, listener: (...args: any[]) => void): this; - /** - * Removes the specified `listener` from the listener array for the event named`eventName`. - * - * ```js - * const callback = (stream) => { - * console.log('someone connected!'); - * }; - * server.on('connection', callback); - * // ... - * server.removeListener('connection', callback); - * ``` - * - * `removeListener()` will remove, at most, one instance of a listener from the - * listener array. If any single listener has been added multiple times to the - * listener array for the specified `eventName`, then `removeListener()` must be - * called multiple times to remove each instance. - * - * Once an event is emitted, all listeners attached to it at the - * time of emitting are called in order. This implies that any`removeListener()` or `removeAllListeners()` calls _after_ emitting and _before_ the last listener finishes execution - * will not remove them from`emit()` in progress. Subsequent events behave as expected. - * - * ```js - * const myEmitter = new MyEmitter(); - * - * const callbackA = () => { - * console.log('A'); - * myEmitter.removeListener('event', callbackB); - * }; - * - * const callbackB = () => { - * console.log('B'); - * }; - * - * myEmitter.on('event', callbackA); - * - * myEmitter.on('event', callbackB); - * - * // callbackA removes listener callbackB but it will still be called. - * // Internal listener array at time of emit [callbackA, callbackB] - * myEmitter.emit('event'); - * // Prints: - * // A - * // B - * - * // callbackB is now removed. - * // Internal listener array [callbackA] - * myEmitter.emit('event'); - * // Prints: - * // A - * ``` - * - * Because listeners are managed using an internal array, calling this will - * change the position indices of any listener registered _after_ the listener - * being removed. This will not impact the order in which listeners are called, - * but it means that any copies of the listener array as returned by - * the `emitter.listeners()` method will need to be recreated. - * - * When a single function has been added as a handler multiple times for a single - * event (as in the example below), `removeListener()` will remove the most - * recently added instance. In the example the `once('ping')`listener is removed: - * - * ```js - * const ee = new EventEmitter(); - * - * function pong() { - * console.log('pong'); - * } - * - * ee.on('ping', pong); - * ee.once('ping', pong); - * ee.removeListener('ping', pong); - * - * ee.emit('ping'); - * ee.emit('ping'); - * ``` - * - * Returns a reference to the `EventEmitter`, so that calls can be chained. - * @since v0.1.26 - */ - removeListener(eventName: string | symbol, listener: (...args: any[]) => void): this; - /** - * Alias for `emitter.removeListener()`. - * @since v10.0.0 - */ - off(eventName: string | symbol, listener: (...args: any[]) => void): this; - /** - * Removes all listeners, or those of the specified `eventName`. - * - * It is bad practice to remove listeners added elsewhere in the code, - * particularly when the `EventEmitter` instance was created by some other - * component or module (e.g. sockets or file streams). - * - * Returns a reference to the `EventEmitter`, so that calls can be chained. - * @since v0.1.26 - */ - removeAllListeners(event?: string | symbol): this; - /** - * By default `EventEmitter`s will print a warning if more than `10` listeners are - * added for a particular event. This is a useful default that helps finding - * memory leaks. The `emitter.setMaxListeners()` method allows the limit to be - * modified for this specific `EventEmitter` instance. The value can be set to`Infinity` (or `0`) to indicate an unlimited number of listeners. - * - * Returns a reference to the `EventEmitter`, so that calls can be chained. - * @since v0.3.5 - */ - setMaxListeners(n: number): this; - /** - * Returns the current max listener value for the `EventEmitter` which is either - * set by `emitter.setMaxListeners(n)` or defaults to {@link defaultMaxListeners}. - * @since v1.0.0 - */ - getMaxListeners(): number; - /** - * Returns a copy of the array of listeners for the event named `eventName`. - * - * ```js - * server.on('connection', (stream) => { - * console.log('someone connected!'); - * }); - * console.log(util.inspect(server.listeners('connection'))); - * // Prints: [ [Function] ] - * ``` - * @since v0.1.26 - */ - listeners(eventName: string | symbol): Function[]; - /** - * Returns a copy of the array of listeners for the event named `eventName`, - * including any wrappers (such as those created by `.once()`). - * - * ```js - * const emitter = new EventEmitter(); - * emitter.once('log', () => console.log('log once')); - * - * // Returns a new Array with a function `onceWrapper` which has a property - * // `listener` which contains the original listener bound above - * const listeners = emitter.rawListeners('log'); - * const logFnWrapper = listeners[0]; - * - * // Logs "log once" to the console and does not unbind the `once` event - * logFnWrapper.listener(); - * - * // Logs "log once" to the console and removes the listener - * logFnWrapper(); - * - * emitter.on('log', () => console.log('log persistently')); - * // Will return a new Array with a single function bound by `.on()` above - * const newListeners = emitter.rawListeners('log'); - * - * // Logs "log persistently" twice - * newListeners[0](); - * emitter.emit('log'); - * ``` - * @since v9.4.0 - */ - rawListeners(eventName: string | symbol): Function[]; - /** - * Synchronously calls each of the listeners registered for the event named`eventName`, in the order they were registered, passing the supplied arguments - * to each. - * - * Returns `true` if the event had listeners, `false` otherwise. - * - * ```js - * const EventEmitter = require('events'); - * const myEmitter = new EventEmitter(); - * - * // First listener - * myEmitter.on('event', function firstListener() { - * console.log('Helloooo! first listener'); - * }); - * // Second listener - * myEmitter.on('event', function secondListener(arg1, arg2) { - * console.log(`event with parameters ${arg1}, ${arg2} in second listener`); - * }); - * // Third listener - * myEmitter.on('event', function thirdListener(...args) { - * const parameters = args.join(', '); - * console.log(`event with parameters ${parameters} in third listener`); - * }); - * - * console.log(myEmitter.listeners('event')); - * - * myEmitter.emit('event', 1, 2, 3, 4, 5); - * - * // Prints: - * // [ - * // [Function: firstListener], - * // [Function: secondListener], - * // [Function: thirdListener] - * // ] - * // Helloooo! first listener - * // event with parameters 1, 2 in second listener - * // event with parameters 1, 2, 3, 4, 5 in third listener - * ``` - * @since v0.1.26 - */ - emit(eventName: string | symbol, ...args: any[]): boolean; - /** - * Returns the number of listeners listening to the event named `eventName`. - * @since v3.2.0 - * @param eventName The name of the event being listened for - */ - listenerCount(eventName: string | symbol): number; - /** - * Adds the `listener` function to the _beginning_ of the listeners array for the - * event named `eventName`. No checks are made to see if the `listener` has - * already been added. Multiple calls passing the same combination of `eventName`and `listener` will result in the `listener` being added, and called, multiple - * times. - * - * ```js - * server.prependListener('connection', (stream) => { - * console.log('someone connected!'); - * }); - * ``` - * - * Returns a reference to the `EventEmitter`, so that calls can be chained. - * @since v6.0.0 - * @param eventName The name of the event. - * @param listener The callback function - */ - prependListener(eventName: string | symbol, listener: (...args: any[]) => void): this; - /** - * Adds a **one-time**`listener` function for the event named `eventName` to the _beginning_ of the listeners array. The next time `eventName` is triggered, this - * listener is removed, and then invoked. - * - * ```js - * server.prependOnceListener('connection', (stream) => { - * console.log('Ah, we have our first user!'); - * }); - * ``` - * - * Returns a reference to the `EventEmitter`, so that calls can be chained. - * @since v6.0.0 - * @param eventName The name of the event. - * @param listener The callback function - */ - prependOnceListener(eventName: string | symbol, listener: (...args: any[]) => void): this; - /** - * Returns an array listing the events for which the emitter has registered - * listeners. The values in the array are strings or `Symbol`s. - * - * ```js - * const EventEmitter = require('events'); - * const myEE = new EventEmitter(); - * myEE.on('foo', () => {}); - * myEE.on('bar', () => {}); - * - * const sym = Symbol('symbol'); - * myEE.on(sym, () => {}); - * - * console.log(myEE.eventNames()); - * // Prints: [ 'foo', 'bar', Symbol(symbol) ] - * ``` - * @since v6.0.0 - */ - eventNames(): Array; - } - } - } - export = EventEmitter; -} -declare module 'node:events' { - import events = require('events'); - export = events; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/fs.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/fs.d.ts deleted file mode 100755 index 75c53fb0..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/fs.d.ts +++ /dev/null @@ -1,3872 +0,0 @@ -/** - * The `fs` module enables interacting with the file system in a - * way modeled on standard POSIX functions. - * - * To use the promise-based APIs: - * - * ```js - * import * as fs from 'fs/promises'; - * ``` - * - * To use the callback and sync APIs: - * - * ```js - * import * as fs from 'fs'; - * ``` - * - * All file system operations have synchronous, callback, and promise-based - * forms, and are accessible using both CommonJS syntax and ES6 Modules (ESM). - * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/fs.js) - */ -declare module 'fs' { - import * as stream from 'node:stream'; - import { Abortable, EventEmitter } from 'node:events'; - import { URL } from 'node:url'; - import * as promises from 'node:fs/promises'; - export { promises }; - /** - * Valid types for path values in "fs". - */ - export type PathLike = string | Buffer | URL; - export type PathOrFileDescriptor = PathLike | number; - export type TimeLike = string | number | Date; - export type NoParamCallback = (err: NodeJS.ErrnoException | null) => void; - export type BufferEncodingOption = - | 'buffer' - | { - encoding: 'buffer'; - }; - export interface ObjectEncodingOptions { - encoding?: BufferEncoding | null | undefined; - } - export type EncodingOption = ObjectEncodingOptions | BufferEncoding | undefined | null; - export type OpenMode = number | string; - export type Mode = number | string; - export interface StatsBase { - isFile(): boolean; - isDirectory(): boolean; - isBlockDevice(): boolean; - isCharacterDevice(): boolean; - isSymbolicLink(): boolean; - isFIFO(): boolean; - isSocket(): boolean; - dev: T; - ino: T; - mode: T; - nlink: T; - uid: T; - gid: T; - rdev: T; - size: T; - blksize: T; - blocks: T; - atimeMs: T; - mtimeMs: T; - ctimeMs: T; - birthtimeMs: T; - atime: Date; - mtime: Date; - ctime: Date; - birthtime: Date; - } - export interface Stats extends StatsBase {} - /** - * A `fs.Stats` object provides information about a file. - * - * Objects returned from {@link stat}, {@link lstat} and {@link fstat} and - * their synchronous counterparts are of this type. - * If `bigint` in the `options` passed to those methods is true, the numeric values - * will be `bigint` instead of `number`, and the object will contain additional - * nanosecond-precision properties suffixed with `Ns`. - * - * ```console - * Stats { - * dev: 2114, - * ino: 48064969, - * mode: 33188, - * nlink: 1, - * uid: 85, - * gid: 100, - * rdev: 0, - * size: 527, - * blksize: 4096, - * blocks: 8, - * atimeMs: 1318289051000.1, - * mtimeMs: 1318289051000.1, - * ctimeMs: 1318289051000.1, - * birthtimeMs: 1318289051000.1, - * atime: Mon, 10 Oct 2011 23:24:11 GMT, - * mtime: Mon, 10 Oct 2011 23:24:11 GMT, - * ctime: Mon, 10 Oct 2011 23:24:11 GMT, - * birthtime: Mon, 10 Oct 2011 23:24:11 GMT } - * ``` - * - * `bigint` version: - * - * ```console - * BigIntStats { - * dev: 2114n, - * ino: 48064969n, - * mode: 33188n, - * nlink: 1n, - * uid: 85n, - * gid: 100n, - * rdev: 0n, - * size: 527n, - * blksize: 4096n, - * blocks: 8n, - * atimeMs: 1318289051000n, - * mtimeMs: 1318289051000n, - * ctimeMs: 1318289051000n, - * birthtimeMs: 1318289051000n, - * atimeNs: 1318289051000000000n, - * mtimeNs: 1318289051000000000n, - * ctimeNs: 1318289051000000000n, - * birthtimeNs: 1318289051000000000n, - * atime: Mon, 10 Oct 2011 23:24:11 GMT, - * mtime: Mon, 10 Oct 2011 23:24:11 GMT, - * ctime: Mon, 10 Oct 2011 23:24:11 GMT, - * birthtime: Mon, 10 Oct 2011 23:24:11 GMT } - * ``` - * @since v0.1.21 - */ - export class Stats {} - /** - * A representation of a directory entry, which can be a file or a subdirectory - * within the directory, as returned by reading from an `fs.Dir`. The - * directory entry is a combination of the file name and file type pairs. - * - * Additionally, when {@link readdir} or {@link readdirSync} is called with - * the `withFileTypes` option set to `true`, the resulting array is filled with `fs.Dirent` objects, rather than strings or `Buffer` s. - * @since v10.10.0 - */ - export class Dirent { - /** - * Returns `true` if the `fs.Dirent` object describes a regular file. - * @since v10.10.0 - */ - isFile(): boolean; - /** - * Returns `true` if the `fs.Dirent` object describes a file system - * directory. - * @since v10.10.0 - */ - isDirectory(): boolean; - /** - * Returns `true` if the `fs.Dirent` object describes a block device. - * @since v10.10.0 - */ - isBlockDevice(): boolean; - /** - * Returns `true` if the `fs.Dirent` object describes a character device. - * @since v10.10.0 - */ - isCharacterDevice(): boolean; - /** - * Returns `true` if the `fs.Dirent` object describes a symbolic link. - * @since v10.10.0 - */ - isSymbolicLink(): boolean; - /** - * Returns `true` if the `fs.Dirent` object describes a first-in-first-out - * (FIFO) pipe. - * @since v10.10.0 - */ - isFIFO(): boolean; - /** - * Returns `true` if the `fs.Dirent` object describes a socket. - * @since v10.10.0 - */ - isSocket(): boolean; - /** - * The file name that this `fs.Dirent` object refers to. The type of this - * value is determined by the `options.encoding` passed to {@link readdir} or {@link readdirSync}. - * @since v10.10.0 - */ - name: string; - } - /** - * A class representing a directory stream. - * - * Created by {@link opendir}, {@link opendirSync}, or `fsPromises.opendir()`. - * - * ```js - * import { opendir } from 'fs/promises'; - * - * try { - * const dir = await opendir('./'); - * for await (const dirent of dir) - * console.log(dirent.name); - * } catch (err) { - * console.error(err); - * } - * ``` - * - * When using the async iterator, the `fs.Dir` object will be automatically - * closed after the iterator exits. - * @since v12.12.0 - */ - export class Dir implements AsyncIterable { - /** - * The read-only path of this directory as was provided to {@link opendir},{@link opendirSync}, or `fsPromises.opendir()`. - * @since v12.12.0 - */ - readonly path: string; - /** - * Asynchronously iterates over the directory via `readdir(3)` until all entries have been read. - */ - [Symbol.asyncIterator](): AsyncIterableIterator; - /** - * Asynchronously close the directory's underlying resource handle. - * Subsequent reads will result in errors. - * - * A promise is returned that will be resolved after the resource has been - * closed. - * @since v12.12.0 - */ - close(): Promise; - close(cb: NoParamCallback): void; - /** - * Synchronously close the directory's underlying resource handle. - * Subsequent reads will result in errors. - * @since v12.12.0 - */ - closeSync(): void; - /** - * Asynchronously read the next directory entry via [`readdir(3)`](http://man7.org/linux/man-pages/man3/readdir.3.html) as an `fs.Dirent`. - * - * A promise is returned that will be resolved with an `fs.Dirent`, or `null`if there are no more directory entries to read. - * - * Directory entries returned by this function are in no particular order as - * provided by the operating system's underlying directory mechanisms. - * Entries added or removed while iterating over the directory might not be - * included in the iteration results. - * @since v12.12.0 - * @return containing {fs.Dirent|null} - */ - read(): Promise; - read(cb: (err: NodeJS.ErrnoException | null, dirEnt: Dirent | null) => void): void; - /** - * Synchronously read the next directory entry as an `fs.Dirent`. See the - * POSIX [`readdir(3)`](http://man7.org/linux/man-pages/man3/readdir.3.html) documentation for more detail. - * - * If there are no more directory entries to read, `null` will be returned. - * - * Directory entries returned by this function are in no particular order as - * provided by the operating system's underlying directory mechanisms. - * Entries added or removed while iterating over the directory might not be - * included in the iteration results. - * @since v12.12.0 - */ - readSync(): Dirent | null; - } - /** - * Class: fs.StatWatcher - * @since v14.3.0, v12.20.0 - * Extends `EventEmitter` - * A successful call to {@link watchFile} method will return a new fs.StatWatcher object. - */ - export interface StatWatcher extends EventEmitter { - /** - * When called, requests that the Node.js event loop _not_ exit so long as the `fs.StatWatcher` is active. Calling `watcher.ref()` multiple times will have - * no effect. - * - * By default, all `fs.StatWatcher` objects are "ref'ed", making it normally - * unnecessary to call `watcher.ref()` unless `watcher.unref()` had been - * called previously. - * @since v14.3.0, v12.20.0 - */ - ref(): this; - /** - * When called, the active `fs.StatWatcher` object will not require the Node.js - * event loop to remain active. If there is no other activity keeping the - * event loop running, the process may exit before the `fs.StatWatcher` object's - * callback is invoked. Calling `watcher.unref()` multiple times will have - * no effect. - * @since v14.3.0, v12.20.0 - */ - unref(): this; - } - export interface FSWatcher extends EventEmitter { - /** - * Stop watching for changes on the given `fs.FSWatcher`. Once stopped, the `fs.FSWatcher` object is no longer usable. - * @since v0.5.8 - */ - close(): void; - /** - * events.EventEmitter - * 1. change - * 2. error - */ - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: 'change', listener: (eventType: string, filename: string | Buffer) => void): this; - addListener(event: 'error', listener: (error: Error) => void): this; - addListener(event: 'close', listener: () => void): this; - on(event: string, listener: (...args: any[]) => void): this; - on(event: 'change', listener: (eventType: string, filename: string | Buffer) => void): this; - on(event: 'error', listener: (error: Error) => void): this; - on(event: 'close', listener: () => void): this; - once(event: string, listener: (...args: any[]) => void): this; - once(event: 'change', listener: (eventType: string, filename: string | Buffer) => void): this; - once(event: 'error', listener: (error: Error) => void): this; - once(event: 'close', listener: () => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: 'change', listener: (eventType: string, filename: string | Buffer) => void): this; - prependListener(event: 'error', listener: (error: Error) => void): this; - prependListener(event: 'close', listener: () => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: 'change', listener: (eventType: string, filename: string | Buffer) => void): this; - prependOnceListener(event: 'error', listener: (error: Error) => void): this; - prependOnceListener(event: 'close', listener: () => void): this; - } - /** - * Instances of `fs.ReadStream` are created and returned using the {@link createReadStream} function. - * @since v0.1.93 - */ - export class ReadStream extends stream.Readable { - close(callback?: (err?: NodeJS.ErrnoException | null) => void): void; - /** - * The number of bytes that have been read so far. - * @since v6.4.0 - */ - bytesRead: number; - /** - * The path to the file the stream is reading from as specified in the first - * argument to `fs.createReadStream()`. If `path` is passed as a string, then`readStream.path` will be a string. If `path` is passed as a `Buffer`, then`readStream.path` will be a - * `Buffer`. If `fd` is specified, then`readStream.path` will be `undefined`. - * @since v0.1.93 - */ - path: string | Buffer; - /** - * This property is `true` if the underlying file has not been opened yet, - * i.e. before the `'ready'` event is emitted. - * @since v11.2.0, v10.16.0 - */ - pending: boolean; - /** - * events.EventEmitter - * 1. open - * 2. close - * 3. ready - */ - addListener(event: 'close', listener: () => void): this; - addListener(event: 'data', listener: (chunk: Buffer | string) => void): this; - addListener(event: 'end', listener: () => void): this; - addListener(event: 'error', listener: (err: Error) => void): this; - addListener(event: 'open', listener: (fd: number) => void): this; - addListener(event: 'pause', listener: () => void): this; - addListener(event: 'readable', listener: () => void): this; - addListener(event: 'ready', listener: () => void): this; - addListener(event: 'resume', listener: () => void): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - on(event: 'close', listener: () => void): this; - on(event: 'data', listener: (chunk: Buffer | string) => void): this; - on(event: 'end', listener: () => void): this; - on(event: 'error', listener: (err: Error) => void): this; - on(event: 'open', listener: (fd: number) => void): this; - on(event: 'pause', listener: () => void): this; - on(event: 'readable', listener: () => void): this; - on(event: 'ready', listener: () => void): this; - on(event: 'resume', listener: () => void): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once(event: 'close', listener: () => void): this; - once(event: 'data', listener: (chunk: Buffer | string) => void): this; - once(event: 'end', listener: () => void): this; - once(event: 'error', listener: (err: Error) => void): this; - once(event: 'open', listener: (fd: number) => void): this; - once(event: 'pause', listener: () => void): this; - once(event: 'readable', listener: () => void): this; - once(event: 'ready', listener: () => void): this; - once(event: 'resume', listener: () => void): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener(event: 'close', listener: () => void): this; - prependListener(event: 'data', listener: (chunk: Buffer | string) => void): this; - prependListener(event: 'end', listener: () => void): this; - prependListener(event: 'error', listener: (err: Error) => void): this; - prependListener(event: 'open', listener: (fd: number) => void): this; - prependListener(event: 'pause', listener: () => void): this; - prependListener(event: 'readable', listener: () => void): this; - prependListener(event: 'ready', listener: () => void): this; - prependListener(event: 'resume', listener: () => void): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - prependOnceListener(event: 'close', listener: () => void): this; - prependOnceListener(event: 'data', listener: (chunk: Buffer | string) => void): this; - prependOnceListener(event: 'end', listener: () => void): this; - prependOnceListener(event: 'error', listener: (err: Error) => void): this; - prependOnceListener(event: 'open', listener: (fd: number) => void): this; - prependOnceListener(event: 'pause', listener: () => void): this; - prependOnceListener(event: 'readable', listener: () => void): this; - prependOnceListener(event: 'ready', listener: () => void): this; - prependOnceListener(event: 'resume', listener: () => void): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - } - /** - * * Extends `stream.Writable` - * - * Instances of `fs.WriteStream` are created and returned using the {@link createWriteStream} function. - * @since v0.1.93 - */ - export class WriteStream extends stream.Writable { - /** - * Closes `writeStream`. Optionally accepts a - * callback that will be executed once the `writeStream`is closed. - * @since v0.9.4 - */ - close(callback?: (err?: NodeJS.ErrnoException | null) => void): void; - /** - * The number of bytes written so far. Does not include data that is still queued - * for writing. - * @since v0.4.7 - */ - bytesWritten: number; - /** - * The path to the file the stream is writing to as specified in the first - * argument to {@link createWriteStream}. If `path` is passed as a string, then`writeStream.path` will be a string. If `path` is passed as a `Buffer`, then`writeStream.path` will be a - * `Buffer`. - * @since v0.1.93 - */ - path: string | Buffer; - /** - * This property is `true` if the underlying file has not been opened yet, - * i.e. before the `'ready'` event is emitted. - * @since v11.2.0 - */ - pending: boolean; - /** - * events.EventEmitter - * 1. open - * 2. close - * 3. ready - */ - addListener(event: 'close', listener: () => void): this; - addListener(event: 'drain', listener: () => void): this; - addListener(event: 'error', listener: (err: Error) => void): this; - addListener(event: 'finish', listener: () => void): this; - addListener(event: 'open', listener: (fd: number) => void): this; - addListener(event: 'pipe', listener: (src: stream.Readable) => void): this; - addListener(event: 'ready', listener: () => void): this; - addListener(event: 'unpipe', listener: (src: stream.Readable) => void): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - on(event: 'close', listener: () => void): this; - on(event: 'drain', listener: () => void): this; - on(event: 'error', listener: (err: Error) => void): this; - on(event: 'finish', listener: () => void): this; - on(event: 'open', listener: (fd: number) => void): this; - on(event: 'pipe', listener: (src: stream.Readable) => void): this; - on(event: 'ready', listener: () => void): this; - on(event: 'unpipe', listener: (src: stream.Readable) => void): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once(event: 'close', listener: () => void): this; - once(event: 'drain', listener: () => void): this; - once(event: 'error', listener: (err: Error) => void): this; - once(event: 'finish', listener: () => void): this; - once(event: 'open', listener: (fd: number) => void): this; - once(event: 'pipe', listener: (src: stream.Readable) => void): this; - once(event: 'ready', listener: () => void): this; - once(event: 'unpipe', listener: (src: stream.Readable) => void): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener(event: 'close', listener: () => void): this; - prependListener(event: 'drain', listener: () => void): this; - prependListener(event: 'error', listener: (err: Error) => void): this; - prependListener(event: 'finish', listener: () => void): this; - prependListener(event: 'open', listener: (fd: number) => void): this; - prependListener(event: 'pipe', listener: (src: stream.Readable) => void): this; - prependListener(event: 'ready', listener: () => void): this; - prependListener(event: 'unpipe', listener: (src: stream.Readable) => void): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - prependOnceListener(event: 'close', listener: () => void): this; - prependOnceListener(event: 'drain', listener: () => void): this; - prependOnceListener(event: 'error', listener: (err: Error) => void): this; - prependOnceListener(event: 'finish', listener: () => void): this; - prependOnceListener(event: 'open', listener: (fd: number) => void): this; - prependOnceListener(event: 'pipe', listener: (src: stream.Readable) => void): this; - prependOnceListener(event: 'ready', listener: () => void): this; - prependOnceListener(event: 'unpipe', listener: (src: stream.Readable) => void): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - } - /** - * Asynchronously rename file at `oldPath` to the pathname provided - * as `newPath`. In the case that `newPath` already exists, it will - * be overwritten. If there is a directory at `newPath`, an error will - * be raised instead. No arguments other than a possible exception are - * given to the completion callback. - * - * See also: [`rename(2)`](http://man7.org/linux/man-pages/man2/rename.2.html). - * - * ```js - * import { rename } from 'fs'; - * - * rename('oldFile.txt', 'newFile.txt', (err) => { - * if (err) throw err; - * console.log('Rename complete!'); - * }); - * ``` - * @since v0.0.2 - */ - export function rename(oldPath: PathLike, newPath: PathLike, callback: NoParamCallback): void; - export namespace rename { - /** - * Asynchronous rename(2) - Change the name or location of a file or directory. - * @param oldPath A path to a file. If a URL is provided, it must use the `file:` protocol. - * URL support is _experimental_. - * @param newPath A path to a file. If a URL is provided, it must use the `file:` protocol. - * URL support is _experimental_. - */ - function __promisify__(oldPath: PathLike, newPath: PathLike): Promise; - } - /** - * Renames the file from `oldPath` to `newPath`. Returns `undefined`. - * - * See the POSIX [`rename(2)`](http://man7.org/linux/man-pages/man2/rename.2.html) documentation for more details. - * @since v0.1.21 - */ - export function renameSync(oldPath: PathLike, newPath: PathLike): void; - /** - * Truncates the file. No arguments other than a possible exception are - * given to the completion callback. A file descriptor can also be passed as the - * first argument. In this case, `fs.ftruncate()` is called. - * - * ```js - * import { truncate } from 'fs'; - * // Assuming that 'path/file.txt' is a regular file. - * truncate('path/file.txt', (err) => { - * if (err) throw err; - * console.log('path/file.txt was truncated'); - * }); - * ``` - * - * Passing a file descriptor is deprecated and may result in an error being thrown - * in the future. - * - * See the POSIX [`truncate(2)`](http://man7.org/linux/man-pages/man2/truncate.2.html) documentation for more details. - * @since v0.8.6 - * @param [len=0] - */ - export function truncate(path: PathLike, len: number | undefined | null, callback: NoParamCallback): void; - /** - * Asynchronous truncate(2) - Truncate a file to a specified length. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - export function truncate(path: PathLike, callback: NoParamCallback): void; - export namespace truncate { - /** - * Asynchronous truncate(2) - Truncate a file to a specified length. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param len If not specified, defaults to `0`. - */ - function __promisify__(path: PathLike, len?: number | null): Promise; - } - /** - * Truncates the file. Returns `undefined`. A file descriptor can also be - * passed as the first argument. In this case, `fs.ftruncateSync()` is called. - * - * Passing a file descriptor is deprecated and may result in an error being thrown - * in the future. - * @since v0.8.6 - * @param [len=0] - */ - export function truncateSync(path: PathLike, len?: number | null): void; - /** - * Truncates the file descriptor. No arguments other than a possible exception are - * given to the completion callback. - * - * See the POSIX [`ftruncate(2)`](http://man7.org/linux/man-pages/man2/ftruncate.2.html) documentation for more detail. - * - * If the file referred to by the file descriptor was larger than `len` bytes, only - * the first `len` bytes will be retained in the file. - * - * For example, the following program retains only the first four bytes of the - * file: - * - * ```js - * import { open, close, ftruncate } from 'fs'; - * - * function closeFd(fd) { - * close(fd, (err) => { - * if (err) throw err; - * }); - * } - * - * open('temp.txt', 'r+', (err, fd) => { - * if (err) throw err; - * - * try { - * ftruncate(fd, 4, (err) => { - * closeFd(fd); - * if (err) throw err; - * }); - * } catch (err) { - * closeFd(fd); - * if (err) throw err; - * } - * }); - * ``` - * - * If the file previously was shorter than `len` bytes, it is extended, and the - * extended part is filled with null bytes (`'\0'`): - * - * If `len` is negative then `0` will be used. - * @since v0.8.6 - * @param [len=0] - */ - export function ftruncate(fd: number, len: number | undefined | null, callback: NoParamCallback): void; - /** - * Asynchronous ftruncate(2) - Truncate a file to a specified length. - * @param fd A file descriptor. - */ - export function ftruncate(fd: number, callback: NoParamCallback): void; - export namespace ftruncate { - /** - * Asynchronous ftruncate(2) - Truncate a file to a specified length. - * @param fd A file descriptor. - * @param len If not specified, defaults to `0`. - */ - function __promisify__(fd: number, len?: number | null): Promise; - } - /** - * Truncates the file descriptor. Returns `undefined`. - * - * For detailed information, see the documentation of the asynchronous version of - * this API: {@link ftruncate}. - * @since v0.8.6 - * @param [len=0] - */ - export function ftruncateSync(fd: number, len?: number | null): void; - /** - * Asynchronously changes owner and group of a file. No arguments other than a - * possible exception are given to the completion callback. - * - * See the POSIX [`chown(2)`](http://man7.org/linux/man-pages/man2/chown.2.html) documentation for more detail. - * @since v0.1.97 - */ - export function chown(path: PathLike, uid: number, gid: number, callback: NoParamCallback): void; - export namespace chown { - /** - * Asynchronous chown(2) - Change ownership of a file. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - function __promisify__(path: PathLike, uid: number, gid: number): Promise; - } - /** - * Synchronously changes owner and group of a file. Returns `undefined`. - * This is the synchronous version of {@link chown}. - * - * See the POSIX [`chown(2)`](http://man7.org/linux/man-pages/man2/chown.2.html) documentation for more detail. - * @since v0.1.97 - */ - export function chownSync(path: PathLike, uid: number, gid: number): void; - /** - * Sets the owner of the file. No arguments other than a possible exception are - * given to the completion callback. - * - * See the POSIX [`fchown(2)`](http://man7.org/linux/man-pages/man2/fchown.2.html) documentation for more detail. - * @since v0.4.7 - */ - export function fchown(fd: number, uid: number, gid: number, callback: NoParamCallback): void; - export namespace fchown { - /** - * Asynchronous fchown(2) - Change ownership of a file. - * @param fd A file descriptor. - */ - function __promisify__(fd: number, uid: number, gid: number): Promise; - } - /** - * Sets the owner of the file. Returns `undefined`. - * - * See the POSIX [`fchown(2)`](http://man7.org/linux/man-pages/man2/fchown.2.html) documentation for more detail. - * @since v0.4.7 - * @param uid The file's new owner's user id. - * @param gid The file's new group's group id. - */ - export function fchownSync(fd: number, uid: number, gid: number): void; - /** - * Set the owner of the symbolic link. No arguments other than a possible - * exception are given to the completion callback. - * - * See the POSIX [`lchown(2)`](http://man7.org/linux/man-pages/man2/lchown.2.html) documentation for more detail. - */ - export function lchown(path: PathLike, uid: number, gid: number, callback: NoParamCallback): void; - export namespace lchown { - /** - * Asynchronous lchown(2) - Change ownership of a file. Does not dereference symbolic links. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - function __promisify__(path: PathLike, uid: number, gid: number): Promise; - } - /** - * Set the owner for the path. Returns `undefined`. - * - * See the POSIX [`lchown(2)`](http://man7.org/linux/man-pages/man2/lchown.2.html) documentation for more details. - * @param uid The file's new owner's user id. - * @param gid The file's new group's group id. - */ - export function lchownSync(path: PathLike, uid: number, gid: number): void; - /** - * Changes the access and modification times of a file in the same way as {@link utimes}, with the difference that if the path refers to a symbolic - * link, then the link is not dereferenced: instead, the timestamps of the - * symbolic link itself are changed. - * - * No arguments other than a possible exception are given to the completion - * callback. - * @since v14.5.0, v12.19.0 - */ - export function lutimes(path: PathLike, atime: TimeLike, mtime: TimeLike, callback: NoParamCallback): void; - export namespace lutimes { - /** - * Changes the access and modification times of a file in the same way as `fsPromises.utimes()`, - * with the difference that if the path refers to a symbolic link, then the link is not - * dereferenced: instead, the timestamps of the symbolic link itself are changed. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param atime The last access time. If a string is provided, it will be coerced to number. - * @param mtime The last modified time. If a string is provided, it will be coerced to number. - */ - function __promisify__(path: PathLike, atime: TimeLike, mtime: TimeLike): Promise; - } - /** - * Change the file system timestamps of the symbolic link referenced by `path`. - * Returns `undefined`, or throws an exception when parameters are incorrect or - * the operation fails. This is the synchronous version of {@link lutimes}. - * @since v14.5.0, v12.19.0 - */ - export function lutimesSync(path: PathLike, atime: TimeLike, mtime: TimeLike): void; - /** - * Asynchronously changes the permissions of a file. No arguments other than a - * possible exception are given to the completion callback. - * - * See the POSIX [`chmod(2)`](http://man7.org/linux/man-pages/man2/chmod.2.html) documentation for more detail. - * - * ```js - * import { chmod } from 'fs'; - * - * chmod('my_file.txt', 0o775, (err) => { - * if (err) throw err; - * console.log('The permissions for file "my_file.txt" have been changed!'); - * }); - * ``` - * @since v0.1.30 - */ - export function chmod(path: PathLike, mode: Mode, callback: NoParamCallback): void; - export namespace chmod { - /** - * Asynchronous chmod(2) - Change permissions of a file. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param mode A file mode. If a string is passed, it is parsed as an octal integer. - */ - function __promisify__(path: PathLike, mode: Mode): Promise; - } - /** - * For detailed information, see the documentation of the asynchronous version of - * this API: {@link chmod}. - * - * See the POSIX [`chmod(2)`](http://man7.org/linux/man-pages/man2/chmod.2.html) documentation for more detail. - * @since v0.6.7 - */ - export function chmodSync(path: PathLike, mode: Mode): void; - /** - * Sets the permissions on the file. No arguments other than a possible exception - * are given to the completion callback. - * - * See the POSIX [`fchmod(2)`](http://man7.org/linux/man-pages/man2/fchmod.2.html) documentation for more detail. - * @since v0.4.7 - */ - export function fchmod(fd: number, mode: Mode, callback: NoParamCallback): void; - export namespace fchmod { - /** - * Asynchronous fchmod(2) - Change permissions of a file. - * @param fd A file descriptor. - * @param mode A file mode. If a string is passed, it is parsed as an octal integer. - */ - function __promisify__(fd: number, mode: Mode): Promise; - } - /** - * Sets the permissions on the file. Returns `undefined`. - * - * See the POSIX [`fchmod(2)`](http://man7.org/linux/man-pages/man2/fchmod.2.html) documentation for more detail. - * @since v0.4.7 - */ - export function fchmodSync(fd: number, mode: Mode): void; - /** - * Changes the permissions on a symbolic link. No arguments other than a possible - * exception are given to the completion callback. - * - * This method is only implemented on macOS. - * - * See the POSIX [`lchmod(2)`](https://www.freebsd.org/cgi/man.cgi?query=lchmod&sektion=2) documentation for more detail. - * @deprecated Since v0.4.7 - */ - export function lchmod(path: PathLike, mode: Mode, callback: NoParamCallback): void; - /** @deprecated */ - export namespace lchmod { - /** - * Asynchronous lchmod(2) - Change permissions of a file. Does not dereference symbolic links. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param mode A file mode. If a string is passed, it is parsed as an octal integer. - */ - function __promisify__(path: PathLike, mode: Mode): Promise; - } - /** - * Changes the permissions on a symbolic link. Returns `undefined`. - * - * This method is only implemented on macOS. - * - * See the POSIX [`lchmod(2)`](https://www.freebsd.org/cgi/man.cgi?query=lchmod&sektion=2) documentation for more detail. - * @deprecated Since v0.4.7 - */ - export function lchmodSync(path: PathLike, mode: Mode): void; - /** - * Asynchronous [`stat(2)`](http://man7.org/linux/man-pages/man2/stat.2.html). The callback gets two arguments `(err, stats)` where`stats` is an `fs.Stats` object. - * - * In case of an error, the `err.code` will be one of `Common System Errors`. - * - * Using `fs.stat()` to check for the existence of a file before calling`fs.open()`, `fs.readFile()` or `fs.writeFile()` is not recommended. - * Instead, user code should open/read/write the file directly and handle the - * error raised if the file is not available. - * - * To check if a file exists without manipulating it afterwards, {@link access} is recommended. - * - * For example, given the following directory structure: - * - * ```text - * - txtDir - * -- file.txt - * - app.js - * ``` - * - * The next program will check for the stats of the given paths: - * - * ```js - * import { stat } from 'fs'; - * - * const pathsToCheck = ['./txtDir', './txtDir/file.txt']; - * - * for (let i = 0; i < pathsToCheck.length; i++) { - * stat(pathsToCheck[i], (err, stats) => { - * console.log(stats.isDirectory()); - * console.log(stats); - * }); - * } - * ``` - * - * The resulting output will resemble: - * - * ```console - * true - * Stats { - * dev: 16777220, - * mode: 16877, - * nlink: 3, - * uid: 501, - * gid: 20, - * rdev: 0, - * blksize: 4096, - * ino: 14214262, - * size: 96, - * blocks: 0, - * atimeMs: 1561174653071.963, - * mtimeMs: 1561174614583.3518, - * ctimeMs: 1561174626623.5366, - * birthtimeMs: 1561174126937.2893, - * atime: 2019-06-22T03:37:33.072Z, - * mtime: 2019-06-22T03:36:54.583Z, - * ctime: 2019-06-22T03:37:06.624Z, - * birthtime: 2019-06-22T03:28:46.937Z - * } - * false - * Stats { - * dev: 16777220, - * mode: 33188, - * nlink: 1, - * uid: 501, - * gid: 20, - * rdev: 0, - * blksize: 4096, - * ino: 14214074, - * size: 8, - * blocks: 8, - * atimeMs: 1561174616618.8555, - * mtimeMs: 1561174614584, - * ctimeMs: 1561174614583.8145, - * birthtimeMs: 1561174007710.7478, - * atime: 2019-06-22T03:36:56.619Z, - * mtime: 2019-06-22T03:36:54.584Z, - * ctime: 2019-06-22T03:36:54.584Z, - * birthtime: 2019-06-22T03:26:47.711Z - * } - * ``` - * @since v0.0.2 - */ - export function stat(path: PathLike, callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void): void; - export function stat( - path: PathLike, - options: - | (StatOptions & { - bigint?: false | undefined; - }) - | undefined, - callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void - ): void; - export function stat( - path: PathLike, - options: StatOptions & { - bigint: true; - }, - callback: (err: NodeJS.ErrnoException | null, stats: BigIntStats) => void - ): void; - export function stat(path: PathLike, options: StatOptions | undefined, callback: (err: NodeJS.ErrnoException | null, stats: Stats | BigIntStats) => void): void; - export namespace stat { - /** - * Asynchronous stat(2) - Get file status. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - function __promisify__( - path: PathLike, - options?: StatOptions & { - bigint?: false | undefined; - } - ): Promise; - function __promisify__( - path: PathLike, - options: StatOptions & { - bigint: true; - } - ): Promise; - function __promisify__(path: PathLike, options?: StatOptions): Promise; - } - export interface StatSyncFn extends Function { - (path: PathLike, options?: undefined): Stats; - ( - path: PathLike, - options?: StatSyncOptions & { - bigint?: false | undefined; - throwIfNoEntry: false; - } - ): Stats | undefined; - ( - path: PathLike, - options: StatSyncOptions & { - bigint: true; - throwIfNoEntry: false; - } - ): BigIntStats | undefined; - ( - path: PathLike, - options?: StatSyncOptions & { - bigint?: false | undefined; - } - ): Stats; - ( - path: PathLike, - options: StatSyncOptions & { - bigint: true; - } - ): BigIntStats; - ( - path: PathLike, - options: StatSyncOptions & { - bigint: boolean; - throwIfNoEntry?: false | undefined; - } - ): Stats | BigIntStats; - (path: PathLike, options?: StatSyncOptions): Stats | BigIntStats | undefined; - } - /** - * Synchronous stat(2) - Get file status. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - export const statSync: StatSyncFn; - /** - * Invokes the callback with the `fs.Stats` for the file descriptor. - * - * See the POSIX [`fstat(2)`](http://man7.org/linux/man-pages/man2/fstat.2.html) documentation for more detail. - * @since v0.1.95 - */ - export function fstat(fd: number, callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void): void; - export function fstat( - fd: number, - options: - | (StatOptions & { - bigint?: false | undefined; - }) - | undefined, - callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void - ): void; - export function fstat( - fd: number, - options: StatOptions & { - bigint: true; - }, - callback: (err: NodeJS.ErrnoException | null, stats: BigIntStats) => void - ): void; - export function fstat(fd: number, options: StatOptions | undefined, callback: (err: NodeJS.ErrnoException | null, stats: Stats | BigIntStats) => void): void; - export namespace fstat { - /** - * Asynchronous fstat(2) - Get file status. - * @param fd A file descriptor. - */ - function __promisify__( - fd: number, - options?: StatOptions & { - bigint?: false | undefined; - } - ): Promise; - function __promisify__( - fd: number, - options: StatOptions & { - bigint: true; - } - ): Promise; - function __promisify__(fd: number, options?: StatOptions): Promise; - } - /** - * Retrieves the `fs.Stats` for the file descriptor. - * - * See the POSIX [`fstat(2)`](http://man7.org/linux/man-pages/man2/fstat.2.html) documentation for more detail. - * @since v0.1.95 - */ - export function fstatSync( - fd: number, - options?: StatOptions & { - bigint?: false | undefined; - } - ): Stats; - export function fstatSync( - fd: number, - options: StatOptions & { - bigint: true; - } - ): BigIntStats; - export function fstatSync(fd: number, options?: StatOptions): Stats | BigIntStats; - /** - * Retrieves the `fs.Stats` for the symbolic link referred to by the path. - * The callback gets two arguments `(err, stats)` where `stats` is a `fs.Stats` object. `lstat()` is identical to `stat()`, except that if `path` is a symbolic - * link, then the link itself is stat-ed, not the file that it refers to. - * - * See the POSIX [`lstat(2)`](http://man7.org/linux/man-pages/man2/lstat.2.html) documentation for more details. - * @since v0.1.30 - */ - export function lstat(path: PathLike, callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void): void; - export function lstat( - path: PathLike, - options: - | (StatOptions & { - bigint?: false | undefined; - }) - | undefined, - callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void - ): void; - export function lstat( - path: PathLike, - options: StatOptions & { - bigint: true; - }, - callback: (err: NodeJS.ErrnoException | null, stats: BigIntStats) => void - ): void; - export function lstat(path: PathLike, options: StatOptions | undefined, callback: (err: NodeJS.ErrnoException | null, stats: Stats | BigIntStats) => void): void; - export namespace lstat { - /** - * Asynchronous lstat(2) - Get file status. Does not dereference symbolic links. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - function __promisify__( - path: PathLike, - options?: StatOptions & { - bigint?: false | undefined; - } - ): Promise; - function __promisify__( - path: PathLike, - options: StatOptions & { - bigint: true; - } - ): Promise; - function __promisify__(path: PathLike, options?: StatOptions): Promise; - } - /** - * Synchronous lstat(2) - Get file status. Does not dereference symbolic links. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - export const lstatSync: StatSyncFn; - /** - * Creates a new link from the `existingPath` to the `newPath`. See the POSIX [`link(2)`](http://man7.org/linux/man-pages/man2/link.2.html) documentation for more detail. No arguments other than - * a possible - * exception are given to the completion callback. - * @since v0.1.31 - */ - export function link(existingPath: PathLike, newPath: PathLike, callback: NoParamCallback): void; - export namespace link { - /** - * Asynchronous link(2) - Create a new link (also known as a hard link) to an existing file. - * @param existingPath A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param newPath A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - function __promisify__(existingPath: PathLike, newPath: PathLike): Promise; - } - /** - * Creates a new link from the `existingPath` to the `newPath`. See the POSIX [`link(2)`](http://man7.org/linux/man-pages/man2/link.2.html) documentation for more detail. Returns `undefined`. - * @since v0.1.31 - */ - export function linkSync(existingPath: PathLike, newPath: PathLike): void; - /** - * Creates the link called `path` pointing to `target`. No arguments other than a - * possible exception are given to the completion callback. - * - * See the POSIX [`symlink(2)`](http://man7.org/linux/man-pages/man2/symlink.2.html) documentation for more details. - * - * The `type` argument is only available on Windows and ignored on other platforms. - * It can be set to `'dir'`, `'file'`, or `'junction'`. If the `type` argument is - * not set, Node.js will autodetect `target` type and use `'file'` or `'dir'`. If - * the `target` does not exist, `'file'` will be used. Windows junction points - * require the destination path to be absolute. When using `'junction'`, the`target` argument will automatically be normalized to absolute path. - * - * Relative targets are relative to the link’s parent directory. - * - * ```js - * import { symlink } from 'fs'; - * - * symlink('./mew', './mewtwo', callback); - * ``` - * - * The above example creates a symbolic link `mewtwo` which points to `mew` in the - * same directory: - * - * ```bash - * $ tree . - * . - * ├── mew - * └── mewtwo -> ./mew - * ``` - * @since v0.1.31 - */ - export function symlink(target: PathLike, path: PathLike, type: symlink.Type | undefined | null, callback: NoParamCallback): void; - /** - * Asynchronous symlink(2) - Create a new symbolic link to an existing file. - * @param target A path to an existing file. If a URL is provided, it must use the `file:` protocol. - * @param path A path to the new symlink. If a URL is provided, it must use the `file:` protocol. - */ - export function symlink(target: PathLike, path: PathLike, callback: NoParamCallback): void; - export namespace symlink { - /** - * Asynchronous symlink(2) - Create a new symbolic link to an existing file. - * @param target A path to an existing file. If a URL is provided, it must use the `file:` protocol. - * @param path A path to the new symlink. If a URL is provided, it must use the `file:` protocol. - * @param type May be set to `'dir'`, `'file'`, or `'junction'` (default is `'file'`) and is only available on Windows (ignored on other platforms). - * When using `'junction'`, the `target` argument will automatically be normalized to an absolute path. - */ - function __promisify__(target: PathLike, path: PathLike, type?: string | null): Promise; - type Type = 'dir' | 'file' | 'junction'; - } - /** - * Returns `undefined`. - * - * For detailed information, see the documentation of the asynchronous version of - * this API: {@link symlink}. - * @since v0.1.31 - */ - export function symlinkSync(target: PathLike, path: PathLike, type?: symlink.Type | null): void; - /** - * Reads the contents of the symbolic link referred to by `path`. The callback gets - * two arguments `(err, linkString)`. - * - * See the POSIX [`readlink(2)`](http://man7.org/linux/man-pages/man2/readlink.2.html) documentation for more details. - * - * The optional `options` argument can be a string specifying an encoding, or an - * object with an `encoding` property specifying the character encoding to use for - * the link path passed to the callback. If the `encoding` is set to `'buffer'`, - * the link path returned will be passed as a `Buffer` object. - * @since v0.1.31 - */ - export function readlink(path: PathLike, options: EncodingOption, callback: (err: NodeJS.ErrnoException | null, linkString: string) => void): void; - /** - * Asynchronous readlink(2) - read value of a symbolic link. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function readlink(path: PathLike, options: BufferEncodingOption, callback: (err: NodeJS.ErrnoException | null, linkString: Buffer) => void): void; - /** - * Asynchronous readlink(2) - read value of a symbolic link. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function readlink(path: PathLike, options: EncodingOption, callback: (err: NodeJS.ErrnoException | null, linkString: string | Buffer) => void): void; - /** - * Asynchronous readlink(2) - read value of a symbolic link. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - export function readlink(path: PathLike, callback: (err: NodeJS.ErrnoException | null, linkString: string) => void): void; - export namespace readlink { - /** - * Asynchronous readlink(2) - read value of a symbolic link. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function __promisify__(path: PathLike, options?: EncodingOption): Promise; - /** - * Asynchronous readlink(2) - read value of a symbolic link. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function __promisify__(path: PathLike, options: BufferEncodingOption): Promise; - /** - * Asynchronous readlink(2) - read value of a symbolic link. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function __promisify__(path: PathLike, options?: EncodingOption): Promise; - } - /** - * Returns the symbolic link's string value. - * - * See the POSIX [`readlink(2)`](http://man7.org/linux/man-pages/man2/readlink.2.html) documentation for more details. - * - * The optional `options` argument can be a string specifying an encoding, or an - * object with an `encoding` property specifying the character encoding to use for - * the link path returned. If the `encoding` is set to `'buffer'`, - * the link path returned will be passed as a `Buffer` object. - * @since v0.1.31 - */ - export function readlinkSync(path: PathLike, options?: EncodingOption): string; - /** - * Synchronous readlink(2) - read value of a symbolic link. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function readlinkSync(path: PathLike, options: BufferEncodingOption): Buffer; - /** - * Synchronous readlink(2) - read value of a symbolic link. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function readlinkSync(path: PathLike, options?: EncodingOption): string | Buffer; - /** - * Asynchronously computes the canonical pathname by resolving `.`, `..` and - * symbolic links. - * - * A canonical pathname is not necessarily unique. Hard links and bind mounts can - * expose a file system entity through many pathnames. - * - * This function behaves like [`realpath(3)`](http://man7.org/linux/man-pages/man3/realpath.3.html), with some exceptions: - * - * 1. No case conversion is performed on case-insensitive file systems. - * 2. The maximum number of symbolic links is platform-independent and generally - * (much) higher than what the native [`realpath(3)`](http://man7.org/linux/man-pages/man3/realpath.3.html) implementation supports. - * - * The `callback` gets two arguments `(err, resolvedPath)`. May use `process.cwd`to resolve relative paths. - * - * Only paths that can be converted to UTF8 strings are supported. - * - * The optional `options` argument can be a string specifying an encoding, or an - * object with an `encoding` property specifying the character encoding to use for - * the path passed to the callback. If the `encoding` is set to `'buffer'`, - * the path returned will be passed as a `Buffer` object. - * - * If `path` resolves to a socket or a pipe, the function will return a system - * dependent name for that object. - * @since v0.1.31 - */ - export function realpath(path: PathLike, options: EncodingOption, callback: (err: NodeJS.ErrnoException | null, resolvedPath: string) => void): void; - /** - * Asynchronous realpath(3) - return the canonicalized absolute pathname. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function realpath(path: PathLike, options: BufferEncodingOption, callback: (err: NodeJS.ErrnoException | null, resolvedPath: Buffer) => void): void; - /** - * Asynchronous realpath(3) - return the canonicalized absolute pathname. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function realpath(path: PathLike, options: EncodingOption, callback: (err: NodeJS.ErrnoException | null, resolvedPath: string | Buffer) => void): void; - /** - * Asynchronous realpath(3) - return the canonicalized absolute pathname. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - export function realpath(path: PathLike, callback: (err: NodeJS.ErrnoException | null, resolvedPath: string) => void): void; - export namespace realpath { - /** - * Asynchronous realpath(3) - return the canonicalized absolute pathname. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function __promisify__(path: PathLike, options?: EncodingOption): Promise; - /** - * Asynchronous realpath(3) - return the canonicalized absolute pathname. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function __promisify__(path: PathLike, options: BufferEncodingOption): Promise; - /** - * Asynchronous realpath(3) - return the canonicalized absolute pathname. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function __promisify__(path: PathLike, options?: EncodingOption): Promise; - /** - * Asynchronous [`realpath(3)`](http://man7.org/linux/man-pages/man3/realpath.3.html). - * - * The `callback` gets two arguments `(err, resolvedPath)`. - * - * Only paths that can be converted to UTF8 strings are supported. - * - * The optional `options` argument can be a string specifying an encoding, or an - * object with an `encoding` property specifying the character encoding to use for - * the path passed to the callback. If the `encoding` is set to `'buffer'`, - * the path returned will be passed as a `Buffer` object. - * - * On Linux, when Node.js is linked against musl libc, the procfs file system must - * be mounted on `/proc` in order for this function to work. Glibc does not have - * this restriction. - * @since v9.2.0 - */ - function native(path: PathLike, options: EncodingOption, callback: (err: NodeJS.ErrnoException | null, resolvedPath: string) => void): void; - function native(path: PathLike, options: BufferEncodingOption, callback: (err: NodeJS.ErrnoException | null, resolvedPath: Buffer) => void): void; - function native(path: PathLike, options: EncodingOption, callback: (err: NodeJS.ErrnoException | null, resolvedPath: string | Buffer) => void): void; - function native(path: PathLike, callback: (err: NodeJS.ErrnoException | null, resolvedPath: string) => void): void; - } - /** - * Returns the resolved pathname. - * - * For detailed information, see the documentation of the asynchronous version of - * this API: {@link realpath}. - * @since v0.1.31 - */ - export function realpathSync(path: PathLike, options?: EncodingOption): string; - /** - * Synchronous realpath(3) - return the canonicalized absolute pathname. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function realpathSync(path: PathLike, options: BufferEncodingOption): Buffer; - /** - * Synchronous realpath(3) - return the canonicalized absolute pathname. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function realpathSync(path: PathLike, options?: EncodingOption): string | Buffer; - export namespace realpathSync { - function native(path: PathLike, options?: EncodingOption): string; - function native(path: PathLike, options: BufferEncodingOption): Buffer; - function native(path: PathLike, options?: EncodingOption): string | Buffer; - } - /** - * Asynchronously removes a file or symbolic link. No arguments other than a - * possible exception are given to the completion callback. - * - * ```js - * import { unlink } from 'fs'; - * // Assuming that 'path/file.txt' is a regular file. - * unlink('path/file.txt', (err) => { - * if (err) throw err; - * console.log('path/file.txt was deleted'); - * }); - * ``` - * - * `fs.unlink()` will not work on a directory, empty or otherwise. To remove a - * directory, use {@link rmdir}. - * - * See the POSIX [`unlink(2)`](http://man7.org/linux/man-pages/man2/unlink.2.html) documentation for more details. - * @since v0.0.2 - */ - export function unlink(path: PathLike, callback: NoParamCallback): void; - export namespace unlink { - /** - * Asynchronous unlink(2) - delete a name and possibly the file it refers to. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - function __promisify__(path: PathLike): Promise; - } - /** - * Synchronous [`unlink(2)`](http://man7.org/linux/man-pages/man2/unlink.2.html). Returns `undefined`. - * @since v0.1.21 - */ - export function unlinkSync(path: PathLike): void; - export interface RmDirOptions { - /** - * If an `EBUSY`, `EMFILE`, `ENFILE`, `ENOTEMPTY`, or - * `EPERM` error is encountered, Node.js will retry the operation with a linear - * backoff wait of `retryDelay` ms longer on each try. This option represents the - * number of retries. This option is ignored if the `recursive` option is not - * `true`. - * @default 0 - */ - maxRetries?: number | undefined; - /** - * @deprecated since v14.14.0 In future versions of Node.js and will trigger a warning - * `fs.rmdir(path, { recursive: true })` will throw if `path` does not exist or is a file. - * Use `fs.rm(path, { recursive: true, force: true })` instead. - * - * If `true`, perform a recursive directory removal. In - * recursive mode, operations are retried on failure. - * @default false - */ - recursive?: boolean | undefined; - /** - * The amount of time in milliseconds to wait between retries. - * This option is ignored if the `recursive` option is not `true`. - * @default 100 - */ - retryDelay?: number | undefined; - } - /** - * Asynchronous [`rmdir(2)`](http://man7.org/linux/man-pages/man2/rmdir.2.html). No arguments other than a possible exception are given - * to the completion callback. - * - * Using `fs.rmdir()` on a file (not a directory) results in an `ENOENT` error on - * Windows and an `ENOTDIR` error on POSIX. - * - * To get a behavior similar to the `rm -rf` Unix command, use {@link rm} with options `{ recursive: true, force: true }`. - * @since v0.0.2 - */ - export function rmdir(path: PathLike, callback: NoParamCallback): void; - export function rmdir(path: PathLike, options: RmDirOptions, callback: NoParamCallback): void; - export namespace rmdir { - /** - * Asynchronous rmdir(2) - delete a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - function __promisify__(path: PathLike, options?: RmDirOptions): Promise; - } - /** - * Synchronous [`rmdir(2)`](http://man7.org/linux/man-pages/man2/rmdir.2.html). Returns `undefined`. - * - * Using `fs.rmdirSync()` on a file (not a directory) results in an `ENOENT` error - * on Windows and an `ENOTDIR` error on POSIX. - * - * To get a behavior similar to the `rm -rf` Unix command, use {@link rmSync} with options `{ recursive: true, force: true }`. - * @since v0.1.21 - */ - export function rmdirSync(path: PathLike, options?: RmDirOptions): void; - export interface RmOptions { - /** - * When `true`, exceptions will be ignored if `path` does not exist. - * @default false - */ - force?: boolean | undefined; - /** - * If an `EBUSY`, `EMFILE`, `ENFILE`, `ENOTEMPTY`, or - * `EPERM` error is encountered, Node.js will retry the operation with a linear - * backoff wait of `retryDelay` ms longer on each try. This option represents the - * number of retries. This option is ignored if the `recursive` option is not - * `true`. - * @default 0 - */ - maxRetries?: number | undefined; - /** - * If `true`, perform a recursive directory removal. In - * recursive mode, operations are retried on failure. - * @default false - */ - recursive?: boolean | undefined; - /** - * The amount of time in milliseconds to wait between retries. - * This option is ignored if the `recursive` option is not `true`. - * @default 100 - */ - retryDelay?: number | undefined; - } - /** - * Asynchronously removes files and directories (modeled on the standard POSIX `rm`utility). No arguments other than a possible exception are given to the - * completion callback. - * @since v14.14.0 - */ - export function rm(path: PathLike, callback: NoParamCallback): void; - export function rm(path: PathLike, options: RmOptions, callback: NoParamCallback): void; - export namespace rm { - /** - * Asynchronously removes files and directories (modeled on the standard POSIX `rm` utility). - */ - function __promisify__(path: PathLike, options?: RmOptions): Promise; - } - /** - * Synchronously removes files and directories (modeled on the standard POSIX `rm`utility). Returns `undefined`. - * @since v14.14.0 - */ - export function rmSync(path: PathLike, options?: RmOptions): void; - export interface MakeDirectoryOptions { - /** - * Indicates whether parent folders should be created. - * If a folder was created, the path to the first created folder will be returned. - * @default false - */ - recursive?: boolean | undefined; - /** - * A file mode. If a string is passed, it is parsed as an octal integer. If not specified - * @default 0o777 - */ - mode?: Mode | undefined; - } - /** - * Asynchronously creates a directory. - * - * The callback is given a possible exception and, if `recursive` is `true`, the - * first directory path created, `(err[, path])`.`path` can still be `undefined` when `recursive` is `true`, if no directory was - * created. - * - * The optional `options` argument can be an integer specifying `mode` (permission - * and sticky bits), or an object with a `mode` property and a `recursive`property indicating whether parent directories should be created. Calling`fs.mkdir()` when `path` is a directory that - * exists results in an error only - * when `recursive` is false. - * - * ```js - * import { mkdir } from 'fs'; - * - * // Creates /tmp/a/apple, regardless of whether `/tmp` and /tmp/a exist. - * mkdir('/tmp/a/apple', { recursive: true }, (err) => { - * if (err) throw err; - * }); - * ``` - * - * On Windows, using `fs.mkdir()` on the root directory even with recursion will - * result in an error: - * - * ```js - * import { mkdir } from 'fs'; - * - * mkdir('/', { recursive: true }, (err) => { - * // => [Error: EPERM: operation not permitted, mkdir 'C:\'] - * }); - * ``` - * - * See the POSIX [`mkdir(2)`](http://man7.org/linux/man-pages/man2/mkdir.2.html) documentation for more details. - * @since v0.1.8 - */ - export function mkdir( - path: PathLike, - options: MakeDirectoryOptions & { - recursive: true; - }, - callback: (err: NodeJS.ErrnoException | null, path?: string) => void - ): void; - /** - * Asynchronous mkdir(2) - create a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders - * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. - */ - export function mkdir( - path: PathLike, - options: - | Mode - | (MakeDirectoryOptions & { - recursive?: false | undefined; - }) - | null - | undefined, - callback: NoParamCallback - ): void; - /** - * Asynchronous mkdir(2) - create a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders - * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. - */ - export function mkdir(path: PathLike, options: Mode | MakeDirectoryOptions | null | undefined, callback: (err: NodeJS.ErrnoException | null, path?: string) => void): void; - /** - * Asynchronous mkdir(2) - create a directory with a mode of `0o777`. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - export function mkdir(path: PathLike, callback: NoParamCallback): void; - export namespace mkdir { - /** - * Asynchronous mkdir(2) - create a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders - * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. - */ - function __promisify__( - path: PathLike, - options: MakeDirectoryOptions & { - recursive: true; - } - ): Promise; - /** - * Asynchronous mkdir(2) - create a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders - * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. - */ - function __promisify__( - path: PathLike, - options?: - | Mode - | (MakeDirectoryOptions & { - recursive?: false | undefined; - }) - | null - ): Promise; - /** - * Asynchronous mkdir(2) - create a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders - * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. - */ - function __promisify__(path: PathLike, options?: Mode | MakeDirectoryOptions | null): Promise; - } - /** - * Synchronously creates a directory. Returns `undefined`, or if `recursive` is`true`, the first directory path created. - * This is the synchronous version of {@link mkdir}. - * - * See the POSIX [`mkdir(2)`](http://man7.org/linux/man-pages/man2/mkdir.2.html) documentation for more details. - * @since v0.1.21 - */ - export function mkdirSync( - path: PathLike, - options: MakeDirectoryOptions & { - recursive: true; - } - ): string | undefined; - /** - * Synchronous mkdir(2) - create a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders - * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. - */ - export function mkdirSync( - path: PathLike, - options?: - | Mode - | (MakeDirectoryOptions & { - recursive?: false | undefined; - }) - | null - ): void; - /** - * Synchronous mkdir(2) - create a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders - * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. - */ - export function mkdirSync(path: PathLike, options?: Mode | MakeDirectoryOptions | null): string | undefined; - /** - * Creates a unique temporary directory. - * - * Generates six random characters to be appended behind a required`prefix` to create a unique temporary directory. Due to platform - * inconsistencies, avoid trailing `X` characters in `prefix`. Some platforms, - * notably the BSDs, can return more than six random characters, and replace - * trailing `X` characters in `prefix` with random characters. - * - * The created directory path is passed as a string to the callback's second - * parameter. - * - * The optional `options` argument can be a string specifying an encoding, or an - * object with an `encoding` property specifying the character encoding to use. - * - * ```js - * import { mkdtemp } from 'fs'; - * - * mkdtemp(path.join(os.tmpdir(), 'foo-'), (err, directory) => { - * if (err) throw err; - * console.log(directory); - * // Prints: /tmp/foo-itXde2 or C:\Users\...\AppData\Local\Temp\foo-itXde2 - * }); - * ``` - * - * The `fs.mkdtemp()` method will append the six randomly selected characters - * directly to the `prefix` string. For instance, given a directory `/tmp`, if the - * intention is to create a temporary directory _within_`/tmp`, the `prefix`must end with a trailing platform-specific path separator - * (`require('path').sep`). - * - * ```js - * import { tmpdir } from 'os'; - * import { mkdtemp } from 'fs'; - * - * // The parent directory for the new temporary directory - * const tmpDir = tmpdir(); - * - * // This method is *INCORRECT*: - * mkdtemp(tmpDir, (err, directory) => { - * if (err) throw err; - * console.log(directory); - * // Will print something similar to `/tmpabc123`. - * // A new temporary directory is created at the file system root - * // rather than *within* the /tmp directory. - * }); - * - * // This method is *CORRECT*: - * import { sep } from 'path'; - * mkdtemp(`${tmpDir}${sep}`, (err, directory) => { - * if (err) throw err; - * console.log(directory); - * // Will print something similar to `/tmp/abc123`. - * // A new temporary directory is created within - * // the /tmp directory. - * }); - * ``` - * @since v5.10.0 - */ - export function mkdtemp(prefix: string, options: EncodingOption, callback: (err: NodeJS.ErrnoException | null, folder: string) => void): void; - /** - * Asynchronously creates a unique temporary directory. - * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function mkdtemp( - prefix: string, - options: - | 'buffer' - | { - encoding: 'buffer'; - }, - callback: (err: NodeJS.ErrnoException | null, folder: Buffer) => void - ): void; - /** - * Asynchronously creates a unique temporary directory. - * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function mkdtemp(prefix: string, options: EncodingOption, callback: (err: NodeJS.ErrnoException | null, folder: string | Buffer) => void): void; - /** - * Asynchronously creates a unique temporary directory. - * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. - */ - export function mkdtemp(prefix: string, callback: (err: NodeJS.ErrnoException | null, folder: string) => void): void; - export namespace mkdtemp { - /** - * Asynchronously creates a unique temporary directory. - * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function __promisify__(prefix: string, options?: EncodingOption): Promise; - /** - * Asynchronously creates a unique temporary directory. - * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function __promisify__(prefix: string, options: BufferEncodingOption): Promise; - /** - * Asynchronously creates a unique temporary directory. - * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function __promisify__(prefix: string, options?: EncodingOption): Promise; - } - /** - * Returns the created directory path. - * - * For detailed information, see the documentation of the asynchronous version of - * this API: {@link mkdtemp}. - * - * The optional `options` argument can be a string specifying an encoding, or an - * object with an `encoding` property specifying the character encoding to use. - * @since v5.10.0 - */ - export function mkdtempSync(prefix: string, options?: EncodingOption): string; - /** - * Synchronously creates a unique temporary directory. - * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function mkdtempSync(prefix: string, options: BufferEncodingOption): Buffer; - /** - * Synchronously creates a unique temporary directory. - * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function mkdtempSync(prefix: string, options?: EncodingOption): string | Buffer; - /** - * Reads the contents of a directory. The callback gets two arguments `(err, files)`where `files` is an array of the names of the files in the directory excluding`'.'` and `'..'`. - * - * See the POSIX [`readdir(3)`](http://man7.org/linux/man-pages/man3/readdir.3.html) documentation for more details. - * - * The optional `options` argument can be a string specifying an encoding, or an - * object with an `encoding` property specifying the character encoding to use for - * the filenames passed to the callback. If the `encoding` is set to `'buffer'`, - * the filenames returned will be passed as `Buffer` objects. - * - * If `options.withFileTypes` is set to `true`, the `files` array will contain `fs.Dirent` objects. - * @since v0.1.8 - */ - export function readdir( - path: PathLike, - options: - | { - encoding: BufferEncoding | null; - withFileTypes?: false | undefined; - } - | BufferEncoding - | undefined - | null, - callback: (err: NodeJS.ErrnoException | null, files: string[]) => void - ): void; - /** - * Asynchronous readdir(3) - read a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function readdir( - path: PathLike, - options: - | { - encoding: 'buffer'; - withFileTypes?: false | undefined; - } - | 'buffer', - callback: (err: NodeJS.ErrnoException | null, files: Buffer[]) => void - ): void; - /** - * Asynchronous readdir(3) - read a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function readdir( - path: PathLike, - options: - | (ObjectEncodingOptions & { - withFileTypes?: false | undefined; - }) - | BufferEncoding - | undefined - | null, - callback: (err: NodeJS.ErrnoException | null, files: string[] | Buffer[]) => void - ): void; - /** - * Asynchronous readdir(3) - read a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - export function readdir(path: PathLike, callback: (err: NodeJS.ErrnoException | null, files: string[]) => void): void; - /** - * Asynchronous readdir(3) - read a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options If called with `withFileTypes: true` the result data will be an array of Dirent. - */ - export function readdir( - path: PathLike, - options: ObjectEncodingOptions & { - withFileTypes: true; - }, - callback: (err: NodeJS.ErrnoException | null, files: Dirent[]) => void - ): void; - export namespace readdir { - /** - * Asynchronous readdir(3) - read a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function __promisify__( - path: PathLike, - options?: - | { - encoding: BufferEncoding | null; - withFileTypes?: false | undefined; - } - | BufferEncoding - | null - ): Promise; - /** - * Asynchronous readdir(3) - read a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function __promisify__( - path: PathLike, - options: - | 'buffer' - | { - encoding: 'buffer'; - withFileTypes?: false | undefined; - } - ): Promise; - /** - * Asynchronous readdir(3) - read a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function __promisify__( - path: PathLike, - options?: - | (ObjectEncodingOptions & { - withFileTypes?: false | undefined; - }) - | BufferEncoding - | null - ): Promise; - /** - * Asynchronous readdir(3) - read a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options If called with `withFileTypes: true` the result data will be an array of Dirent - */ - function __promisify__( - path: PathLike, - options: ObjectEncodingOptions & { - withFileTypes: true; - } - ): Promise; - } - /** - * Reads the contents of the directory. - * - * See the POSIX [`readdir(3)`](http://man7.org/linux/man-pages/man3/readdir.3.html) documentation for more details. - * - * The optional `options` argument can be a string specifying an encoding, or an - * object with an `encoding` property specifying the character encoding to use for - * the filenames returned. If the `encoding` is set to `'buffer'`, - * the filenames returned will be passed as `Buffer` objects. - * - * If `options.withFileTypes` is set to `true`, the result will contain `fs.Dirent` objects. - * @since v0.1.21 - */ - export function readdirSync( - path: PathLike, - options?: - | { - encoding: BufferEncoding | null; - withFileTypes?: false | undefined; - } - | BufferEncoding - | null - ): string[]; - /** - * Synchronous readdir(3) - read a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function readdirSync( - path: PathLike, - options: - | { - encoding: 'buffer'; - withFileTypes?: false | undefined; - } - | 'buffer' - ): Buffer[]; - /** - * Synchronous readdir(3) - read a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function readdirSync( - path: PathLike, - options?: - | (ObjectEncodingOptions & { - withFileTypes?: false | undefined; - }) - | BufferEncoding - | null - ): string[] | Buffer[]; - /** - * Synchronous readdir(3) - read a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options If called with `withFileTypes: true` the result data will be an array of Dirent. - */ - export function readdirSync( - path: PathLike, - options: ObjectEncodingOptions & { - withFileTypes: true; - } - ): Dirent[]; - /** - * Closes the file descriptor. No arguments other than a possible exception are - * given to the completion callback. - * - * Calling `fs.close()` on any file descriptor (`fd`) that is currently in use - * through any other `fs` operation may lead to undefined behavior. - * - * See the POSIX [`close(2)`](http://man7.org/linux/man-pages/man2/close.2.html) documentation for more detail. - * @since v0.0.2 - */ - export function close(fd: number, callback?: NoParamCallback): void; - export namespace close { - /** - * Asynchronous close(2) - close a file descriptor. - * @param fd A file descriptor. - */ - function __promisify__(fd: number): Promise; - } - /** - * Closes the file descriptor. Returns `undefined`. - * - * Calling `fs.closeSync()` on any file descriptor (`fd`) that is currently in use - * through any other `fs` operation may lead to undefined behavior. - * - * See the POSIX [`close(2)`](http://man7.org/linux/man-pages/man2/close.2.html) documentation for more detail. - * @since v0.1.21 - */ - export function closeSync(fd: number): void; - /** - * Asynchronous file open. See the POSIX [`open(2)`](http://man7.org/linux/man-pages/man2/open.2.html) documentation for more details. - * - * `mode` sets the file mode (permission and sticky bits), but only if the file was - * created. On Windows, only the write permission can be manipulated; see {@link chmod}. - * - * The callback gets two arguments `(err, fd)`. - * - * Some characters (`< > : " / \ | ? *`) are reserved under Windows as documented - * by [Naming Files, Paths, and Namespaces](https://docs.microsoft.com/en-us/windows/desktop/FileIO/naming-a-file). Under NTFS, if the filename contains - * a colon, Node.js will open a file system stream, as described by [this MSDN page](https://docs.microsoft.com/en-us/windows/desktop/FileIO/using-streams). - * - * Functions based on `fs.open()` exhibit this behavior as well:`fs.writeFile()`, `fs.readFile()`, etc. - * @since v0.0.2 - * @param [flags='r'] See `support of file system `flags``. - * @param [mode=0o666] - */ - export function open(path: PathLike, flags: OpenMode | undefined, mode: Mode | undefined | null, callback: (err: NodeJS.ErrnoException | null, fd: number) => void): void; - /** - * Asynchronous open(2) - open and possibly create a file. If the file is created, its mode will be `0o666`. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param [flags='r'] See `support of file system `flags``. - */ - export function open(path: PathLike, flags: OpenMode | undefined, callback: (err: NodeJS.ErrnoException | null, fd: number) => void): void; - /** - * Asynchronous open(2) - open and possibly create a file. If the file is created, its mode will be `0o666`. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - export function open(path: PathLike, callback: (err: NodeJS.ErrnoException | null, fd: number) => void): void; - - export namespace open { - /** - * Asynchronous open(2) - open and possibly create a file. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param mode A file mode. If a string is passed, it is parsed as an octal integer. If not supplied, defaults to `0o666`. - */ - function __promisify__(path: PathLike, flags: OpenMode, mode?: Mode | null): Promise; - } - /** - * Returns an integer representing the file descriptor. - * - * For detailed information, see the documentation of the asynchronous version of - * this API: {@link open}. - * @since v0.1.21 - * @param [flags='r'] - * @param [mode=0o666] - */ - export function openSync(path: PathLike, flags: OpenMode, mode?: Mode | null): number; - /** - * Change the file system timestamps of the object referenced by `path`. - * - * The `atime` and `mtime` arguments follow these rules: - * - * * Values can be either numbers representing Unix epoch time in seconds,`Date`s, or a numeric string like `'123456789.0'`. - * * If the value can not be converted to a number, or is `NaN`, `Infinity` or`-Infinity`, an `Error` will be thrown. - * @since v0.4.2 - */ - export function utimes(path: PathLike, atime: TimeLike, mtime: TimeLike, callback: NoParamCallback): void; - export namespace utimes { - /** - * Asynchronously change file timestamps of the file referenced by the supplied path. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param atime The last access time. If a string is provided, it will be coerced to number. - * @param mtime The last modified time. If a string is provided, it will be coerced to number. - */ - function __promisify__(path: PathLike, atime: TimeLike, mtime: TimeLike): Promise; - } - /** - * Returns `undefined`. - * - * For detailed information, see the documentation of the asynchronous version of - * this API: {@link utimes}. - * @since v0.4.2 - */ - export function utimesSync(path: PathLike, atime: TimeLike, mtime: TimeLike): void; - /** - * Change the file system timestamps of the object referenced by the supplied file - * descriptor. See {@link utimes}. - * @since v0.4.2 - */ - export function futimes(fd: number, atime: TimeLike, mtime: TimeLike, callback: NoParamCallback): void; - export namespace futimes { - /** - * Asynchronously change file timestamps of the file referenced by the supplied file descriptor. - * @param fd A file descriptor. - * @param atime The last access time. If a string is provided, it will be coerced to number. - * @param mtime The last modified time. If a string is provided, it will be coerced to number. - */ - function __promisify__(fd: number, atime: TimeLike, mtime: TimeLike): Promise; - } - /** - * Synchronous version of {@link futimes}. Returns `undefined`. - * @since v0.4.2 - */ - export function futimesSync(fd: number, atime: TimeLike, mtime: TimeLike): void; - /** - * Request that all data for the open file descriptor is flushed to the storage - * device. The specific implementation is operating system and device specific. - * Refer to the POSIX [`fsync(2)`](http://man7.org/linux/man-pages/man2/fsync.2.html) documentation for more detail. No arguments other - * than a possible exception are given to the completion callback. - * @since v0.1.96 - */ - export function fsync(fd: number, callback: NoParamCallback): void; - export namespace fsync { - /** - * Asynchronous fsync(2) - synchronize a file's in-core state with the underlying storage device. - * @param fd A file descriptor. - */ - function __promisify__(fd: number): Promise; - } - /** - * Request that all data for the open file descriptor is flushed to the storage - * device. The specific implementation is operating system and device specific. - * Refer to the POSIX [`fsync(2)`](http://man7.org/linux/man-pages/man2/fsync.2.html) documentation for more detail. Returns `undefined`. - * @since v0.1.96 - */ - export function fsyncSync(fd: number): void; - /** - * Write `buffer` to the file specified by `fd`. - * - * `offset` determines the part of the buffer to be written, and `length` is - * an integer specifying the number of bytes to write. - * - * `position` refers to the offset from the beginning of the file where this data - * should be written. If `typeof position !== 'number'`, the data will be written - * at the current position. See [`pwrite(2)`](http://man7.org/linux/man-pages/man2/pwrite.2.html). - * - * The callback will be given three arguments `(err, bytesWritten, buffer)` where`bytesWritten` specifies how many _bytes_ were written from `buffer`. - * - * If this method is invoked as its `util.promisify()` ed version, it returns - * a promise for an `Object` with `bytesWritten` and `buffer` properties. - * - * It is unsafe to use `fs.write()` multiple times on the same file without waiting - * for the callback. For this scenario, {@link createWriteStream} is - * recommended. - * - * On Linux, positional writes don't work when the file is opened in append mode. - * The kernel ignores the position argument and always appends the data to - * the end of the file. - * @since v0.0.2 - */ - export function write( - fd: number, - buffer: TBuffer, - offset: number | undefined | null, - length: number | undefined | null, - position: number | undefined | null, - callback: (err: NodeJS.ErrnoException | null, written: number, buffer: TBuffer) => void - ): void; - /** - * Asynchronously writes `buffer` to the file referenced by the supplied file descriptor. - * @param fd A file descriptor. - * @param offset The part of the buffer to be written. If not supplied, defaults to `0`. - * @param length The number of bytes to write. If not supplied, defaults to `buffer.length - offset`. - */ - export function write( - fd: number, - buffer: TBuffer, - offset: number | undefined | null, - length: number | undefined | null, - callback: (err: NodeJS.ErrnoException | null, written: number, buffer: TBuffer) => void - ): void; - /** - * Asynchronously writes `buffer` to the file referenced by the supplied file descriptor. - * @param fd A file descriptor. - * @param offset The part of the buffer to be written. If not supplied, defaults to `0`. - */ - export function write( - fd: number, - buffer: TBuffer, - offset: number | undefined | null, - callback: (err: NodeJS.ErrnoException | null, written: number, buffer: TBuffer) => void - ): void; - /** - * Asynchronously writes `buffer` to the file referenced by the supplied file descriptor. - * @param fd A file descriptor. - */ - export function write(fd: number, buffer: TBuffer, callback: (err: NodeJS.ErrnoException | null, written: number, buffer: TBuffer) => void): void; - /** - * Asynchronously writes `string` to the file referenced by the supplied file descriptor. - * @param fd A file descriptor. - * @param string A string to write. - * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. - * @param encoding The expected string encoding. - */ - export function write( - fd: number, - string: string, - position: number | undefined | null, - encoding: BufferEncoding | undefined | null, - callback: (err: NodeJS.ErrnoException | null, written: number, str: string) => void - ): void; - /** - * Asynchronously writes `string` to the file referenced by the supplied file descriptor. - * @param fd A file descriptor. - * @param string A string to write. - * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. - */ - export function write(fd: number, string: string, position: number | undefined | null, callback: (err: NodeJS.ErrnoException | null, written: number, str: string) => void): void; - /** - * Asynchronously writes `string` to the file referenced by the supplied file descriptor. - * @param fd A file descriptor. - * @param string A string to write. - */ - export function write(fd: number, string: string, callback: (err: NodeJS.ErrnoException | null, written: number, str: string) => void): void; - export namespace write { - /** - * Asynchronously writes `buffer` to the file referenced by the supplied file descriptor. - * @param fd A file descriptor. - * @param offset The part of the buffer to be written. If not supplied, defaults to `0`. - * @param length The number of bytes to write. If not supplied, defaults to `buffer.length - offset`. - * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. - */ - function __promisify__( - fd: number, - buffer?: TBuffer, - offset?: number, - length?: number, - position?: number | null - ): Promise<{ - bytesWritten: number; - buffer: TBuffer; - }>; - /** - * Asynchronously writes `string` to the file referenced by the supplied file descriptor. - * @param fd A file descriptor. - * @param string A string to write. - * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. - * @param encoding The expected string encoding. - */ - function __promisify__( - fd: number, - string: string, - position?: number | null, - encoding?: BufferEncoding | null - ): Promise<{ - bytesWritten: number; - buffer: string; - }>; - } - /** - * For detailed information, see the documentation of the asynchronous version of - * this API: {@link write}. - * @since v0.1.21 - * @return The number of bytes written. - */ - export function writeSync(fd: number, buffer: NodeJS.ArrayBufferView, offset?: number | null, length?: number | null, position?: number | null): number; - /** - * Synchronously writes `string` to the file referenced by the supplied file descriptor, returning the number of bytes written. - * @param fd A file descriptor. - * @param string A string to write. - * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. - * @param encoding The expected string encoding. - */ - export function writeSync(fd: number, string: string, position?: number | null, encoding?: BufferEncoding | null): number; - export type ReadPosition = number | bigint; - export interface ReadSyncOptions { - /** - * @default 0 - */ - offset?: number | undefined; - /** - * @default `length of buffer` - */ - length?: number | undefined; - /** - * @default null - */ - position?: ReadPosition | null | undefined; - } - export interface ReadAsyncOptions extends ReadSyncOptions { - buffer?: TBuffer; - } - /** - * Read data from the file specified by `fd`. - * - * The callback is given the three arguments, `(err, bytesRead, buffer)`. - * - * If the file is not modified concurrently, the end-of-file is reached when the - * number of bytes read is zero. - * - * If this method is invoked as its `util.promisify()` ed version, it returns - * a promise for an `Object` with `bytesRead` and `buffer` properties. - * @since v0.0.2 - * @param buffer The buffer that the data will be written to. - * @param offset The position in `buffer` to write the data to. - * @param length The number of bytes to read. - * @param position Specifies where to begin reading from in the file. If `position` is `null` or `-1 `, data will be read from the current file position, and the file position will be updated. If - * `position` is an integer, the file position will be unchanged. - */ - export function read( - fd: number, - buffer: TBuffer, - offset: number, - length: number, - position: ReadPosition | null, - callback: (err: NodeJS.ErrnoException | null, bytesRead: number, buffer: TBuffer) => void - ): void; - /** - * Similar to the above `fs.read` function, this version takes an optional `options` object. - * If not otherwise specified in an `options` object, - * `buffer` defaults to `Buffer.alloc(16384)`, - * `offset` defaults to `0`, - * `length` defaults to `buffer.byteLength`, `- offset` as of Node 17.6.0 - * `position` defaults to `null` - * @since v12.17.0, 13.11.0 - */ - export function read( - fd: number, - options: ReadAsyncOptions, - callback: (err: NodeJS.ErrnoException | null, bytesRead: number, buffer: TBuffer) => void - ): void; - export function read(fd: number, callback: (err: NodeJS.ErrnoException | null, bytesRead: number, buffer: NodeJS.ArrayBufferView) => void): void; - export namespace read { - /** - * @param fd A file descriptor. - * @param buffer The buffer that the data will be written to. - * @param offset The offset in the buffer at which to start writing. - * @param length The number of bytes to read. - * @param position The offset from the beginning of the file from which data should be read. If `null`, data will be read from the current position. - */ - function __promisify__( - fd: number, - buffer: TBuffer, - offset: number, - length: number, - position: number | null - ): Promise<{ - bytesRead: number; - buffer: TBuffer; - }>; - function __promisify__( - fd: number, - options: ReadAsyncOptions - ): Promise<{ - bytesRead: number; - buffer: TBuffer; - }>; - function __promisify__(fd: number): Promise<{ - bytesRead: number; - buffer: NodeJS.ArrayBufferView; - }>; - } - /** - * Returns the number of `bytesRead`. - * - * For detailed information, see the documentation of the asynchronous version of - * this API: {@link read}. - * @since v0.1.21 - */ - export function readSync(fd: number, buffer: NodeJS.ArrayBufferView, offset: number, length: number, position: ReadPosition | null): number; - /** - * Similar to the above `fs.readSync` function, this version takes an optional `options` object. - * If no `options` object is specified, it will default with the above values. - */ - export function readSync(fd: number, buffer: NodeJS.ArrayBufferView, opts?: ReadSyncOptions): number; - /** - * Asynchronously reads the entire contents of a file. - * - * ```js - * import { readFile } from 'fs'; - * - * readFile('/etc/passwd', (err, data) => { - * if (err) throw err; - * console.log(data); - * }); - * ``` - * - * The callback is passed two arguments `(err, data)`, where `data` is the - * contents of the file. - * - * If no encoding is specified, then the raw buffer is returned. - * - * If `options` is a string, then it specifies the encoding: - * - * ```js - * import { readFile } from 'fs'; - * - * readFile('/etc/passwd', 'utf8', callback); - * ``` - * - * When the path is a directory, the behavior of `fs.readFile()` and {@link readFileSync} is platform-specific. On macOS, Linux, and Windows, an - * error will be returned. On FreeBSD, a representation of the directory's contents - * will be returned. - * - * ```js - * import { readFile } from 'fs'; - * - * // macOS, Linux, and Windows - * readFile('', (err, data) => { - * // => [Error: EISDIR: illegal operation on a directory, read ] - * }); - * - * // FreeBSD - * readFile('', (err, data) => { - * // => null, - * }); - * ``` - * - * It is possible to abort an ongoing request using an `AbortSignal`. If a - * request is aborted the callback is called with an `AbortError`: - * - * ```js - * import { readFile } from 'fs'; - * - * const controller = new AbortController(); - * const signal = controller.signal; - * readFile(fileInfo[0].name, { signal }, (err, buf) => { - * // ... - * }); - * // When you want to abort the request - * controller.abort(); - * ``` - * - * The `fs.readFile()` function buffers the entire file. To minimize memory costs, - * when possible prefer streaming via `fs.createReadStream()`. - * - * Aborting an ongoing request does not abort individual operating - * system requests but rather the internal buffering `fs.readFile` performs. - * @since v0.1.29 - * @param path filename or file descriptor - */ - export function readFile( - path: PathOrFileDescriptor, - options: - | ({ - encoding?: null | undefined; - flag?: string | undefined; - } & Abortable) - | undefined - | null, - callback: (err: NodeJS.ErrnoException | null, data: Buffer) => void - ): void; - /** - * Asynchronously reads the entire contents of a file. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * If a file descriptor is provided, the underlying file will _not_ be closed automatically. - * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag. - * If a flag is not provided, it defaults to `'r'`. - */ - export function readFile( - path: PathOrFileDescriptor, - options: - | ({ - encoding: BufferEncoding; - flag?: string | undefined; - } & Abortable) - | BufferEncoding, - callback: (err: NodeJS.ErrnoException | null, data: string) => void - ): void; - /** - * Asynchronously reads the entire contents of a file. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * If a file descriptor is provided, the underlying file will _not_ be closed automatically. - * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag. - * If a flag is not provided, it defaults to `'r'`. - */ - export function readFile( - path: PathOrFileDescriptor, - options: - | (ObjectEncodingOptions & { - flag?: string | undefined; - } & Abortable) - | BufferEncoding - | undefined - | null, - callback: (err: NodeJS.ErrnoException | null, data: string | Buffer) => void - ): void; - /** - * Asynchronously reads the entire contents of a file. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * If a file descriptor is provided, the underlying file will _not_ be closed automatically. - */ - export function readFile(path: PathOrFileDescriptor, callback: (err: NodeJS.ErrnoException | null, data: Buffer) => void): void; - export namespace readFile { - /** - * Asynchronously reads the entire contents of a file. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * If a file descriptor is provided, the underlying file will _not_ be closed automatically. - * @param options An object that may contain an optional flag. - * If a flag is not provided, it defaults to `'r'`. - */ - function __promisify__( - path: PathOrFileDescriptor, - options?: { - encoding?: null | undefined; - flag?: string | undefined; - } | null - ): Promise; - /** - * Asynchronously reads the entire contents of a file. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * URL support is _experimental_. - * If a file descriptor is provided, the underlying file will _not_ be closed automatically. - * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag. - * If a flag is not provided, it defaults to `'r'`. - */ - function __promisify__( - path: PathOrFileDescriptor, - options: - | { - encoding: BufferEncoding; - flag?: string | undefined; - } - | BufferEncoding - ): Promise; - /** - * Asynchronously reads the entire contents of a file. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * URL support is _experimental_. - * If a file descriptor is provided, the underlying file will _not_ be closed automatically. - * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag. - * If a flag is not provided, it defaults to `'r'`. - */ - function __promisify__( - path: PathOrFileDescriptor, - options?: - | (ObjectEncodingOptions & { - flag?: string | undefined; - }) - | BufferEncoding - | null - ): Promise; - } - /** - * Returns the contents of the `path`. - * - * For detailed information, see the documentation of the asynchronous version of - * this API: {@link readFile}. - * - * If the `encoding` option is specified then this function returns a - * string. Otherwise it returns a buffer. - * - * Similar to {@link readFile}, when the path is a directory, the behavior of`fs.readFileSync()` is platform-specific. - * - * ```js - * import { readFileSync } from 'fs'; - * - * // macOS, Linux, and Windows - * readFileSync(''); - * // => [Error: EISDIR: illegal operation on a directory, read ] - * - * // FreeBSD - * readFileSync(''); // => - * ``` - * @since v0.1.8 - * @param path filename or file descriptor - */ - export function readFileSync( - path: PathOrFileDescriptor, - options?: { - encoding?: null | undefined; - flag?: string | undefined; - } | null - ): Buffer; - /** - * Synchronously reads the entire contents of a file. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * If a file descriptor is provided, the underlying file will _not_ be closed automatically. - * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag. - * If a flag is not provided, it defaults to `'r'`. - */ - export function readFileSync( - path: PathOrFileDescriptor, - options: - | { - encoding: BufferEncoding; - flag?: string | undefined; - } - | BufferEncoding - ): string; - /** - * Synchronously reads the entire contents of a file. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * If a file descriptor is provided, the underlying file will _not_ be closed automatically. - * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag. - * If a flag is not provided, it defaults to `'r'`. - */ - export function readFileSync( - path: PathOrFileDescriptor, - options?: - | (ObjectEncodingOptions & { - flag?: string | undefined; - }) - | BufferEncoding - | null - ): string | Buffer; - export type WriteFileOptions = - | (ObjectEncodingOptions & - Abortable & { - mode?: Mode | undefined; - flag?: string | undefined; - }) - | BufferEncoding - | null; - /** - * When `file` is a filename, asynchronously writes data to the file, replacing the - * file if it already exists. `data` can be a string or a buffer. - * - * When `file` is a file descriptor, the behavior is similar to calling`fs.write()` directly (which is recommended). See the notes below on using - * a file descriptor. - * - * The `encoding` option is ignored if `data` is a buffer. - * - * The `mode` option only affects the newly created file. See {@link open} for more details. - * - * ```js - * import { writeFile } from 'fs'; - * import { Buffer } from 'buffer'; - * - * const data = new Uint8Array(Buffer.from('Hello Node.js')); - * writeFile('message.txt', data, (err) => { - * if (err) throw err; - * console.log('The file has been saved!'); - * }); - * ``` - * - * If `options` is a string, then it specifies the encoding: - * - * ```js - * import { writeFile } from 'fs'; - * - * writeFile('message.txt', 'Hello Node.js', 'utf8', callback); - * ``` - * - * It is unsafe to use `fs.writeFile()` multiple times on the same file without - * waiting for the callback. For this scenario, {@link createWriteStream} is - * recommended. - * - * Similarly to `fs.readFile` \- `fs.writeFile` is a convenience method that - * performs multiple `write` calls internally to write the buffer passed to it. - * For performance sensitive code consider using {@link createWriteStream}. - * - * It is possible to use an `AbortSignal` to cancel an `fs.writeFile()`. - * Cancelation is "best effort", and some amount of data is likely still - * to be written. - * - * ```js - * import { writeFile } from 'fs'; - * import { Buffer } from 'buffer'; - * - * const controller = new AbortController(); - * const { signal } = controller; - * const data = new Uint8Array(Buffer.from('Hello Node.js')); - * writeFile('message.txt', data, { signal }, (err) => { - * // When a request is aborted - the callback is called with an AbortError - * }); - * // When the request should be aborted - * controller.abort(); - * ``` - * - * Aborting an ongoing request does not abort individual operating - * system requests but rather the internal buffering `fs.writeFile` performs. - * @since v0.1.29 - * @param file filename or file descriptor - */ - export function writeFile(file: PathOrFileDescriptor, data: string | NodeJS.ArrayBufferView, options: WriteFileOptions, callback: NoParamCallback): void; - /** - * Asynchronously writes data to a file, replacing the file if it already exists. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * If a file descriptor is provided, the underlying file will _not_ be closed automatically. - * @param data The data to write. If something other than a Buffer or Uint8Array is provided, the value is coerced to a string. - */ - export function writeFile(path: PathOrFileDescriptor, data: string | NodeJS.ArrayBufferView, callback: NoParamCallback): void; - export namespace writeFile { - /** - * Asynchronously writes data to a file, replacing the file if it already exists. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * URL support is _experimental_. - * If a file descriptor is provided, the underlying file will _not_ be closed automatically. - * @param data The data to write. If something other than a Buffer or Uint8Array is provided, the value is coerced to a string. - * @param options Either the encoding for the file, or an object optionally specifying the encoding, file mode, and flag. - * If `encoding` is not supplied, the default of `'utf8'` is used. - * If `mode` is not supplied, the default of `0o666` is used. - * If `mode` is a string, it is parsed as an octal integer. - * If `flag` is not supplied, the default of `'w'` is used. - */ - function __promisify__(path: PathOrFileDescriptor, data: string | NodeJS.ArrayBufferView, options?: WriteFileOptions): Promise; - } - /** - * Returns `undefined`. - * - * The `mode` option only affects the newly created file. See {@link open} for more details. - * - * For detailed information, see the documentation of the asynchronous version of - * this API: {@link writeFile}. - * @since v0.1.29 - * @param file filename or file descriptor - */ - export function writeFileSync(file: PathOrFileDescriptor, data: string | NodeJS.ArrayBufferView, options?: WriteFileOptions): void; - /** - * Asynchronously append data to a file, creating the file if it does not yet - * exist. `data` can be a string or a `Buffer`. - * - * The `mode` option only affects the newly created file. See {@link open} for more details. - * - * ```js - * import { appendFile } from 'fs'; - * - * appendFile('message.txt', 'data to append', (err) => { - * if (err) throw err; - * console.log('The "data to append" was appended to file!'); - * }); - * ``` - * - * If `options` is a string, then it specifies the encoding: - * - * ```js - * import { appendFile } from 'fs'; - * - * appendFile('message.txt', 'data to append', 'utf8', callback); - * ``` - * - * The `path` may be specified as a numeric file descriptor that has been opened - * for appending (using `fs.open()` or `fs.openSync()`). The file descriptor will - * not be closed automatically. - * - * ```js - * import { open, close, appendFile } from 'fs'; - * - * function closeFd(fd) { - * close(fd, (err) => { - * if (err) throw err; - * }); - * } - * - * open('message.txt', 'a', (err, fd) => { - * if (err) throw err; - * - * try { - * appendFile(fd, 'data to append', 'utf8', (err) => { - * closeFd(fd); - * if (err) throw err; - * }); - * } catch (err) { - * closeFd(fd); - * throw err; - * } - * }); - * ``` - * @since v0.6.7 - * @param path filename or file descriptor - */ - export function appendFile(path: PathOrFileDescriptor, data: string | Uint8Array, options: WriteFileOptions, callback: NoParamCallback): void; - /** - * Asynchronously append data to a file, creating the file if it does not exist. - * @param file A path to a file. If a URL is provided, it must use the `file:` protocol. - * If a file descriptor is provided, the underlying file will _not_ be closed automatically. - * @param data The data to write. If something other than a Buffer or Uint8Array is provided, the value is coerced to a string. - */ - export function appendFile(file: PathOrFileDescriptor, data: string | Uint8Array, callback: NoParamCallback): void; - export namespace appendFile { - /** - * Asynchronously append data to a file, creating the file if it does not exist. - * @param file A path to a file. If a URL is provided, it must use the `file:` protocol. - * URL support is _experimental_. - * If a file descriptor is provided, the underlying file will _not_ be closed automatically. - * @param data The data to write. If something other than a Buffer or Uint8Array is provided, the value is coerced to a string. - * @param options Either the encoding for the file, or an object optionally specifying the encoding, file mode, and flag. - * If `encoding` is not supplied, the default of `'utf8'` is used. - * If `mode` is not supplied, the default of `0o666` is used. - * If `mode` is a string, it is parsed as an octal integer. - * If `flag` is not supplied, the default of `'a'` is used. - */ - function __promisify__(file: PathOrFileDescriptor, data: string | Uint8Array, options?: WriteFileOptions): Promise; - } - /** - * Synchronously append data to a file, creating the file if it does not yet - * exist. `data` can be a string or a `Buffer`. - * - * The `mode` option only affects the newly created file. See {@link open} for more details. - * - * ```js - * import { appendFileSync } from 'fs'; - * - * try { - * appendFileSync('message.txt', 'data to append'); - * console.log('The "data to append" was appended to file!'); - * } catch (err) { - * // Handle the error - * } - * ``` - * - * If `options` is a string, then it specifies the encoding: - * - * ```js - * import { appendFileSync } from 'fs'; - * - * appendFileSync('message.txt', 'data to append', 'utf8'); - * ``` - * - * The `path` may be specified as a numeric file descriptor that has been opened - * for appending (using `fs.open()` or `fs.openSync()`). The file descriptor will - * not be closed automatically. - * - * ```js - * import { openSync, closeSync, appendFileSync } from 'fs'; - * - * let fd; - * - * try { - * fd = openSync('message.txt', 'a'); - * appendFileSync(fd, 'data to append', 'utf8'); - * } catch (err) { - * // Handle the error - * } finally { - * if (fd !== undefined) - * closeSync(fd); - * } - * ``` - * @since v0.6.7 - * @param path filename or file descriptor - */ - export function appendFileSync(path: PathOrFileDescriptor, data: string | Uint8Array, options?: WriteFileOptions): void; - /** - * Watch for changes on `filename`. The callback `listener` will be called each - * time the file is accessed. - * - * The `options` argument may be omitted. If provided, it should be an object. The`options` object may contain a boolean named `persistent` that indicates - * whether the process should continue to run as long as files are being watched. - * The `options` object may specify an `interval` property indicating how often the - * target should be polled in milliseconds. - * - * The `listener` gets two arguments the current stat object and the previous - * stat object: - * - * ```js - * import { watchFile } from 'fs'; - * - * watchFile('message.text', (curr, prev) => { - * console.log(`the current mtime is: ${curr.mtime}`); - * console.log(`the previous mtime was: ${prev.mtime}`); - * }); - * ``` - * - * These stat objects are instances of `fs.Stat`. If the `bigint` option is `true`, - * the numeric values in these objects are specified as `BigInt`s. - * - * To be notified when the file was modified, not just accessed, it is necessary - * to compare `curr.mtimeMs` and `prev.mtimeMs`. - * - * When an `fs.watchFile` operation results in an `ENOENT` error, it - * will invoke the listener once, with all the fields zeroed (or, for dates, the - * Unix Epoch). If the file is created later on, the listener will be called - * again, with the latest stat objects. This is a change in functionality since - * v0.10. - * - * Using {@link watch} is more efficient than `fs.watchFile` and`fs.unwatchFile`. `fs.watch` should be used instead of `fs.watchFile` and`fs.unwatchFile` when possible. - * - * When a file being watched by `fs.watchFile()` disappears and reappears, - * then the contents of `previous` in the second callback event (the file's - * reappearance) will be the same as the contents of `previous` in the first - * callback event (its disappearance). - * - * This happens when: - * - * * the file is deleted, followed by a restore - * * the file is renamed and then renamed a second time back to its original name - * @since v0.1.31 - */ - export interface WatchFileOptions { - bigint?: boolean | undefined; - persistent?: boolean | undefined; - interval?: number | undefined; - } - /** - * Watch for changes on `filename`. The callback `listener` will be called each - * time the file is accessed. - * - * The `options` argument may be omitted. If provided, it should be an object. The`options` object may contain a boolean named `persistent` that indicates - * whether the process should continue to run as long as files are being watched. - * The `options` object may specify an `interval` property indicating how often the - * target should be polled in milliseconds. - * - * The `listener` gets two arguments the current stat object and the previous - * stat object: - * - * ```js - * import { watchFile } from 'fs'; - * - * watchFile('message.text', (curr, prev) => { - * console.log(`the current mtime is: ${curr.mtime}`); - * console.log(`the previous mtime was: ${prev.mtime}`); - * }); - * ``` - * - * These stat objects are instances of `fs.Stat`. If the `bigint` option is `true`, - * the numeric values in these objects are specified as `BigInt`s. - * - * To be notified when the file was modified, not just accessed, it is necessary - * to compare `curr.mtimeMs` and `prev.mtimeMs`. - * - * When an `fs.watchFile` operation results in an `ENOENT` error, it - * will invoke the listener once, with all the fields zeroed (or, for dates, the - * Unix Epoch). If the file is created later on, the listener will be called - * again, with the latest stat objects. This is a change in functionality since - * v0.10. - * - * Using {@link watch} is more efficient than `fs.watchFile` and`fs.unwatchFile`. `fs.watch` should be used instead of `fs.watchFile` and`fs.unwatchFile` when possible. - * - * When a file being watched by `fs.watchFile()` disappears and reappears, - * then the contents of `previous` in the second callback event (the file's - * reappearance) will be the same as the contents of `previous` in the first - * callback event (its disappearance). - * - * This happens when: - * - * * the file is deleted, followed by a restore - * * the file is renamed and then renamed a second time back to its original name - * @since v0.1.31 - */ - export function watchFile( - filename: PathLike, - options: - | (WatchFileOptions & { - bigint?: false | undefined; - }) - | undefined, - listener: (curr: Stats, prev: Stats) => void - ): StatWatcher; - export function watchFile( - filename: PathLike, - options: - | (WatchFileOptions & { - bigint: true; - }) - | undefined, - listener: (curr: BigIntStats, prev: BigIntStats) => void - ): StatWatcher; - /** - * Watch for changes on `filename`. The callback `listener` will be called each time the file is accessed. - * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol. - */ - export function watchFile(filename: PathLike, listener: (curr: Stats, prev: Stats) => void): StatWatcher; - /** - * Stop watching for changes on `filename`. If `listener` is specified, only that - * particular listener is removed. Otherwise, _all_ listeners are removed, - * effectively stopping watching of `filename`. - * - * Calling `fs.unwatchFile()` with a filename that is not being watched is a - * no-op, not an error. - * - * Using {@link watch} is more efficient than `fs.watchFile()` and`fs.unwatchFile()`. `fs.watch()` should be used instead of `fs.watchFile()`and `fs.unwatchFile()` when possible. - * @since v0.1.31 - * @param listener Optional, a listener previously attached using `fs.watchFile()` - */ - export function unwatchFile(filename: PathLike, listener?: (curr: Stats, prev: Stats) => void): void; - export interface WatchOptions extends Abortable { - encoding?: BufferEncoding | 'buffer' | undefined; - persistent?: boolean | undefined; - recursive?: boolean | undefined; - } - export type WatchEventType = 'rename' | 'change'; - export type WatchListener = (event: WatchEventType, filename: T) => void; - /** - * Watch for changes on `filename`, where `filename` is either a file or a - * directory. - * - * The second argument is optional. If `options` is provided as a string, it - * specifies the `encoding`. Otherwise `options` should be passed as an object. - * - * The listener callback gets two arguments `(eventType, filename)`. `eventType`is either `'rename'` or `'change'`, and `filename` is the name of the file - * which triggered the event. - * - * On most platforms, `'rename'` is emitted whenever a filename appears or - * disappears in the directory. - * - * The listener callback is attached to the `'change'` event fired by `fs.FSWatcher`, but it is not the same thing as the `'change'` value of`eventType`. - * - * If a `signal` is passed, aborting the corresponding AbortController will close - * the returned `fs.FSWatcher`. - * @since v0.5.10 - * @param listener - */ - export function watch( - filename: PathLike, - options: - | (WatchOptions & { - encoding: 'buffer'; - }) - | 'buffer', - listener?: WatchListener - ): FSWatcher; - /** - * Watch for changes on `filename`, where `filename` is either a file or a directory, returning an `FSWatcher`. - * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol. - * @param options Either the encoding for the filename provided to the listener, or an object optionally specifying encoding, persistent, and recursive options. - * If `encoding` is not supplied, the default of `'utf8'` is used. - * If `persistent` is not supplied, the default of `true` is used. - * If `recursive` is not supplied, the default of `false` is used. - */ - export function watch(filename: PathLike, options?: WatchOptions | BufferEncoding | null, listener?: WatchListener): FSWatcher; - /** - * Watch for changes on `filename`, where `filename` is either a file or a directory, returning an `FSWatcher`. - * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol. - * @param options Either the encoding for the filename provided to the listener, or an object optionally specifying encoding, persistent, and recursive options. - * If `encoding` is not supplied, the default of `'utf8'` is used. - * If `persistent` is not supplied, the default of `true` is used. - * If `recursive` is not supplied, the default of `false` is used. - */ - export function watch(filename: PathLike, options: WatchOptions | string, listener?: WatchListener): FSWatcher; - /** - * Watch for changes on `filename`, where `filename` is either a file or a directory, returning an `FSWatcher`. - * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol. - */ - export function watch(filename: PathLike, listener?: WatchListener): FSWatcher; - /** - * Test whether or not the given path exists by checking with the file system. - * Then call the `callback` argument with either true or false: - * - * ```js - * import { exists } from 'fs'; - * - * exists('/etc/passwd', (e) => { - * console.log(e ? 'it exists' : 'no passwd!'); - * }); - * ``` - * - * **The parameters for this callback are not consistent with other Node.js** - * **callbacks.** Normally, the first parameter to a Node.js callback is an `err`parameter, optionally followed by other parameters. The `fs.exists()` callback - * has only one boolean parameter. This is one reason `fs.access()` is recommended - * instead of `fs.exists()`. - * - * Using `fs.exists()` to check for the existence of a file before calling`fs.open()`, `fs.readFile()` or `fs.writeFile()` is not recommended. Doing - * so introduces a race condition, since other processes may change the file's - * state between the two calls. Instead, user code should open/read/write the - * file directly and handle the error raised if the file does not exist. - * - * **write (NOT RECOMMENDED)** - * - * ```js - * import { exists, open, close } from 'fs'; - * - * exists('myfile', (e) => { - * if (e) { - * console.error('myfile already exists'); - * } else { - * open('myfile', 'wx', (err, fd) => { - * if (err) throw err; - * - * try { - * writeMyData(fd); - * } finally { - * close(fd, (err) => { - * if (err) throw err; - * }); - * } - * }); - * } - * }); - * ``` - * - * **write (RECOMMENDED)** - * - * ```js - * import { open, close } from 'fs'; - * open('myfile', 'wx', (err, fd) => { - * if (err) { - * if (err.code === 'EEXIST') { - * console.error('myfile already exists'); - * return; - * } - * - * throw err; - * } - * - * try { - * writeMyData(fd); - * } finally { - * close(fd, (err) => { - * if (err) throw err; - * }); - * } - * }); - * ``` - * - * **read (NOT RECOMMENDED)** - * - * ```js - * import { open, close, exists } from 'fs'; - * - * exists('myfile', (e) => { - * if (e) { - * open('myfile', 'r', (err, fd) => { - * if (err) throw err; - * - * try { - * readMyData(fd); - * } finally { - * close(fd, (err) => { - * if (err) throw err; - * }); - * } - * }); - * } else { - * console.error('myfile does not exist'); - * } - * }); - * ``` - * - * **read (RECOMMENDED)** - * - * ```js - * import { open, close } from 'fs'; - * - * open('myfile', 'r', (err, fd) => { - * if (err) { - * if (err.code === 'ENOENT') { - * console.error('myfile does not exist'); - * return; - * } - * - * throw err; - * } - * - * try { - * readMyData(fd); - * } finally { - * close(fd, (err) => { - * if (err) throw err; - * }); - * } - * }); - * ``` - * - * The "not recommended" examples above check for existence and then use the - * file; the "recommended" examples are better because they use the file directly - * and handle the error, if any. - * - * In general, check for the existence of a file only if the file won’t be - * used directly, for example when its existence is a signal from another - * process. - * @since v0.0.2 - * @deprecated Since v1.0.0 - Use {@link stat} or {@link access} instead. - */ - export function exists(path: PathLike, callback: (exists: boolean) => void): void; - /** @deprecated */ - export namespace exists { - /** - * @param path A path to a file or directory. If a URL is provided, it must use the `file:` protocol. - * URL support is _experimental_. - */ - function __promisify__(path: PathLike): Promise; - } - /** - * Returns `true` if the path exists, `false` otherwise. - * - * For detailed information, see the documentation of the asynchronous version of - * this API: {@link exists}. - * - * `fs.exists()` is deprecated, but `fs.existsSync()` is not. The `callback`parameter to `fs.exists()` accepts parameters that are inconsistent with other - * Node.js callbacks. `fs.existsSync()` does not use a callback. - * - * ```js - * import { existsSync } from 'fs'; - * - * if (existsSync('/etc/passwd')) - * console.log('The path exists.'); - * ``` - * @since v0.1.21 - */ - export function existsSync(path: PathLike): boolean; - export namespace constants { - // File Access Constants - /** Constant for fs.access(). File is visible to the calling process. */ - const F_OK: number; - /** Constant for fs.access(). File can be read by the calling process. */ - const R_OK: number; - /** Constant for fs.access(). File can be written by the calling process. */ - const W_OK: number; - /** Constant for fs.access(). File can be executed by the calling process. */ - const X_OK: number; - // File Copy Constants - /** Constant for fs.copyFile. Flag indicating the destination file should not be overwritten if it already exists. */ - const COPYFILE_EXCL: number; - /** - * Constant for fs.copyFile. copy operation will attempt to create a copy-on-write reflink. - * If the underlying platform does not support copy-on-write, then a fallback copy mechanism is used. - */ - const COPYFILE_FICLONE: number; - /** - * Constant for fs.copyFile. Copy operation will attempt to create a copy-on-write reflink. - * If the underlying platform does not support copy-on-write, then the operation will fail with an error. - */ - const COPYFILE_FICLONE_FORCE: number; - // File Open Constants - /** Constant for fs.open(). Flag indicating to open a file for read-only access. */ - const O_RDONLY: number; - /** Constant for fs.open(). Flag indicating to open a file for write-only access. */ - const O_WRONLY: number; - /** Constant for fs.open(). Flag indicating to open a file for read-write access. */ - const O_RDWR: number; - /** Constant for fs.open(). Flag indicating to create the file if it does not already exist. */ - const O_CREAT: number; - /** Constant for fs.open(). Flag indicating that opening a file should fail if the O_CREAT flag is set and the file already exists. */ - const O_EXCL: number; - /** - * Constant for fs.open(). Flag indicating that if path identifies a terminal device, - * opening the path shall not cause that terminal to become the controlling terminal for the process - * (if the process does not already have one). - */ - const O_NOCTTY: number; - /** Constant for fs.open(). Flag indicating that if the file exists and is a regular file, and the file is opened successfully for write access, its length shall be truncated to zero. */ - const O_TRUNC: number; - /** Constant for fs.open(). Flag indicating that data will be appended to the end of the file. */ - const O_APPEND: number; - /** Constant for fs.open(). Flag indicating that the open should fail if the path is not a directory. */ - const O_DIRECTORY: number; - /** - * constant for fs.open(). - * Flag indicating reading accesses to the file system will no longer result in - * an update to the atime information associated with the file. - * This flag is available on Linux operating systems only. - */ - const O_NOATIME: number; - /** Constant for fs.open(). Flag indicating that the open should fail if the path is a symbolic link. */ - const O_NOFOLLOW: number; - /** Constant for fs.open(). Flag indicating that the file is opened for synchronous I/O. */ - const O_SYNC: number; - /** Constant for fs.open(). Flag indicating that the file is opened for synchronous I/O with write operations waiting for data integrity. */ - const O_DSYNC: number; - /** Constant for fs.open(). Flag indicating to open the symbolic link itself rather than the resource it is pointing to. */ - const O_SYMLINK: number; - /** Constant for fs.open(). When set, an attempt will be made to minimize caching effects of file I/O. */ - const O_DIRECT: number; - /** Constant for fs.open(). Flag indicating to open the file in nonblocking mode when possible. */ - const O_NONBLOCK: number; - // File Type Constants - /** Constant for fs.Stats mode property for determining a file's type. Bit mask used to extract the file type code. */ - const S_IFMT: number; - /** Constant for fs.Stats mode property for determining a file's type. File type constant for a regular file. */ - const S_IFREG: number; - /** Constant for fs.Stats mode property for determining a file's type. File type constant for a directory. */ - const S_IFDIR: number; - /** Constant for fs.Stats mode property for determining a file's type. File type constant for a character-oriented device file. */ - const S_IFCHR: number; - /** Constant for fs.Stats mode property for determining a file's type. File type constant for a block-oriented device file. */ - const S_IFBLK: number; - /** Constant for fs.Stats mode property for determining a file's type. File type constant for a FIFO/pipe. */ - const S_IFIFO: number; - /** Constant for fs.Stats mode property for determining a file's type. File type constant for a symbolic link. */ - const S_IFLNK: number; - /** Constant for fs.Stats mode property for determining a file's type. File type constant for a socket. */ - const S_IFSOCK: number; - // File Mode Constants - /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable, writable and executable by owner. */ - const S_IRWXU: number; - /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable by owner. */ - const S_IRUSR: number; - /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating writable by owner. */ - const S_IWUSR: number; - /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating executable by owner. */ - const S_IXUSR: number; - /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable, writable and executable by group. */ - const S_IRWXG: number; - /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable by group. */ - const S_IRGRP: number; - /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating writable by group. */ - const S_IWGRP: number; - /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating executable by group. */ - const S_IXGRP: number; - /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable, writable and executable by others. */ - const S_IRWXO: number; - /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable by others. */ - const S_IROTH: number; - /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating writable by others. */ - const S_IWOTH: number; - /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating executable by others. */ - const S_IXOTH: number; - /** - * When set, a memory file mapping is used to access the file. This flag - * is available on Windows operating systems only. On other operating systems, - * this flag is ignored. - */ - const UV_FS_O_FILEMAP: number; - } - /** - * Tests a user's permissions for the file or directory specified by `path`. - * The `mode` argument is an optional integer that specifies the accessibility - * checks to be performed. `mode` should be either the value `fs.constants.F_OK`or a mask consisting of the bitwise OR of any of `fs.constants.R_OK`,`fs.constants.W_OK`, and `fs.constants.X_OK` - * (e.g.`fs.constants.W_OK | fs.constants.R_OK`). Check `File access constants` for - * possible values of `mode`. - * - * The final argument, `callback`, is a callback function that is invoked with - * a possible error argument. If any of the accessibility checks fail, the error - * argument will be an `Error` object. The following examples check if`package.json` exists, and if it is readable or writable. - * - * ```js - * import { access, constants } from 'fs'; - * - * const file = 'package.json'; - * - * // Check if the file exists in the current directory. - * access(file, constants.F_OK, (err) => { - * console.log(`${file} ${err ? 'does not exist' : 'exists'}`); - * }); - * - * // Check if the file is readable. - * access(file, constants.R_OK, (err) => { - * console.log(`${file} ${err ? 'is not readable' : 'is readable'}`); - * }); - * - * // Check if the file is writable. - * access(file, constants.W_OK, (err) => { - * console.log(`${file} ${err ? 'is not writable' : 'is writable'}`); - * }); - * - * // Check if the file is readable and writable. - * access(file, constants.R_OK | constants.W_OK, (err) => { - * console.log(`${file} ${err ? 'is not' : 'is'} readable and writable`); - * }); - * ``` - * - * Do not use `fs.access()` to check for the accessibility of a file before calling`fs.open()`, `fs.readFile()` or `fs.writeFile()`. Doing - * so introduces a race condition, since other processes may change the file's - * state between the two calls. Instead, user code should open/read/write the - * file directly and handle the error raised if the file is not accessible. - * - * **write (NOT RECOMMENDED)** - * - * ```js - * import { access, open, close } from 'fs'; - * - * access('myfile', (err) => { - * if (!err) { - * console.error('myfile already exists'); - * return; - * } - * - * open('myfile', 'wx', (err, fd) => { - * if (err) throw err; - * - * try { - * writeMyData(fd); - * } finally { - * close(fd, (err) => { - * if (err) throw err; - * }); - * } - * }); - * }); - * ``` - * - * **write (RECOMMENDED)** - * - * ```js - * import { open, close } from 'fs'; - * - * open('myfile', 'wx', (err, fd) => { - * if (err) { - * if (err.code === 'EEXIST') { - * console.error('myfile already exists'); - * return; - * } - * - * throw err; - * } - * - * try { - * writeMyData(fd); - * } finally { - * close(fd, (err) => { - * if (err) throw err; - * }); - * } - * }); - * ``` - * - * **read (NOT RECOMMENDED)** - * - * ```js - * import { access, open, close } from 'fs'; - * access('myfile', (err) => { - * if (err) { - * if (err.code === 'ENOENT') { - * console.error('myfile does not exist'); - * return; - * } - * - * throw err; - * } - * - * open('myfile', 'r', (err, fd) => { - * if (err) throw err; - * - * try { - * readMyData(fd); - * } finally { - * close(fd, (err) => { - * if (err) throw err; - * }); - * } - * }); - * }); - * ``` - * - * **read (RECOMMENDED)** - * - * ```js - * import { open, close } from 'fs'; - * - * open('myfile', 'r', (err, fd) => { - * if (err) { - * if (err.code === 'ENOENT') { - * console.error('myfile does not exist'); - * return; - * } - * - * throw err; - * } - * - * try { - * readMyData(fd); - * } finally { - * close(fd, (err) => { - * if (err) throw err; - * }); - * } - * }); - * ``` - * - * The "not recommended" examples above check for accessibility and then use the - * file; the "recommended" examples are better because they use the file directly - * and handle the error, if any. - * - * In general, check for the accessibility of a file only if the file will not be - * used directly, for example when its accessibility is a signal from another - * process. - * - * On Windows, access-control policies (ACLs) on a directory may limit access to - * a file or directory. The `fs.access()` function, however, does not check the - * ACL and therefore may report that a path is accessible even if the ACL restricts - * the user from reading or writing to it. - * @since v0.11.15 - * @param [mode=fs.constants.F_OK] - */ - export function access(path: PathLike, mode: number | undefined, callback: NoParamCallback): void; - /** - * Asynchronously tests a user's permissions for the file specified by path. - * @param path A path to a file or directory. If a URL is provided, it must use the `file:` protocol. - */ - export function access(path: PathLike, callback: NoParamCallback): void; - export namespace access { - /** - * Asynchronously tests a user's permissions for the file specified by path. - * @param path A path to a file or directory. If a URL is provided, it must use the `file:` protocol. - * URL support is _experimental_. - */ - function __promisify__(path: PathLike, mode?: number): Promise; - } - /** - * Synchronously tests a user's permissions for the file or directory specified - * by `path`. The `mode` argument is an optional integer that specifies the - * accessibility checks to be performed. `mode` should be either the value`fs.constants.F_OK` or a mask consisting of the bitwise OR of any of`fs.constants.R_OK`, `fs.constants.W_OK`, and - * `fs.constants.X_OK` (e.g.`fs.constants.W_OK | fs.constants.R_OK`). Check `File access constants` for - * possible values of `mode`. - * - * If any of the accessibility checks fail, an `Error` will be thrown. Otherwise, - * the method will return `undefined`. - * - * ```js - * import { accessSync, constants } from 'fs'; - * - * try { - * accessSync('etc/passwd', constants.R_OK | constants.W_OK); - * console.log('can read/write'); - * } catch (err) { - * console.error('no access!'); - * } - * ``` - * @since v0.11.15 - * @param [mode=fs.constants.F_OK] - */ - export function accessSync(path: PathLike, mode?: number): void; - interface StreamOptions { - flags?: string | undefined; - encoding?: BufferEncoding | undefined; - fd?: number | promises.FileHandle | undefined; - mode?: number | undefined; - autoClose?: boolean | undefined; - /** - * @default false - */ - emitClose?: boolean | undefined; - start?: number | undefined; - highWaterMark?: number | undefined; - } - interface ReadStreamOptions extends StreamOptions { - end?: number | undefined; - } - /** - * Unlike the 16 kb default `highWaterMark` for a `stream.Readable`, the stream - * returned by this method has a default `highWaterMark` of 64 kb. - * - * `options` can include `start` and `end` values to read a range of bytes from - * the file instead of the entire file. Both `start` and `end` are inclusive and - * start counting at 0, allowed values are in the - * \[0, [`Number.MAX_SAFE_INTEGER`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER)\] range. If `fd` is specified and `start` is - * omitted or `undefined`, `fs.createReadStream()` reads sequentially from the - * current file position. The `encoding` can be any one of those accepted by `Buffer`. - * - * If `fd` is specified, `ReadStream` will ignore the `path` argument and will use - * the specified file descriptor. This means that no `'open'` event will be - * emitted. `fd` should be blocking; non-blocking `fd`s should be passed to `net.Socket`. - * - * If `fd` points to a character device that only supports blocking reads - * (such as keyboard or sound card), read operations do not finish until data is - * available. This can prevent the process from exiting and the stream from - * closing naturally. - * - * By default, the stream will emit a `'close'` event after it has been - * destroyed. Set the `emitClose` option to `false` to change this behavior. - * - * By providing the `fs` option, it is possible to override the corresponding `fs`implementations for `open`, `read`, and `close`. When providing the `fs` option, - * an override for `read` is required. If no `fd` is provided, an override for`open` is also required. If `autoClose` is `true`, an override for `close` is - * also required. - * - * ```js - * import { createReadStream } from 'fs'; - * - * // Create a stream from some character device. - * const stream = createReadStream('/dev/input/event0'); - * setTimeout(() => { - * stream.close(); // This may not close the stream. - * // Artificially marking end-of-stream, as if the underlying resource had - * // indicated end-of-file by itself, allows the stream to close. - * // This does not cancel pending read operations, and if there is such an - * // operation, the process may still not be able to exit successfully - * // until it finishes. - * stream.push(null); - * stream.read(0); - * }, 100); - * ``` - * - * If `autoClose` is false, then the file descriptor won't be closed, even if - * there's an error. It is the application's responsibility to close it and make - * sure there's no file descriptor leak. If `autoClose` is set to true (default - * behavior), on `'error'` or `'end'` the file descriptor will be closed - * automatically. - * - * `mode` sets the file mode (permission and sticky bits), but only if the - * file was created. - * - * An example to read the last 10 bytes of a file which is 100 bytes long: - * - * ```js - * import { createReadStream } from 'fs'; - * - * createReadStream('sample.txt', { start: 90, end: 99 }); - * ``` - * - * If `options` is a string, then it specifies the encoding. - * @since v0.1.31 - */ - export function createReadStream(path: PathLike, options?: BufferEncoding | ReadStreamOptions): ReadStream; - /** - * `options` may also include a `start` option to allow writing data at some - * position past the beginning of the file, allowed values are in the - * \[0, [`Number.MAX_SAFE_INTEGER`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER)\] range. Modifying a file rather than - * replacing it may require the `flags` option to be set to `r+` rather than the - * default `w`. The `encoding` can be any one of those accepted by `Buffer`. - * - * If `autoClose` is set to true (default behavior) on `'error'` or `'finish'`the file descriptor will be closed automatically. If `autoClose` is false, - * then the file descriptor won't be closed, even if there's an error. - * It is the application's responsibility to close it and make sure there's no - * file descriptor leak. - * - * By default, the stream will emit a `'close'` event after it has been - * destroyed. Set the `emitClose` option to `false` to change this behavior. - * - * By providing the `fs` option it is possible to override the corresponding `fs`implementations for `open`, `write`, `writev` and `close`. Overriding `write()`without `writev()` can reduce - * performance as some optimizations (`_writev()`) - * will be disabled. When providing the `fs` option, overrides for at least one of`write` and `writev` are required. If no `fd` option is supplied, an override - * for `open` is also required. If `autoClose` is `true`, an override for `close`is also required. - * - * Like `fs.ReadStream`, if `fd` is specified, `fs.WriteStream` will ignore the`path` argument and will use the specified file descriptor. This means that no`'open'` event will be - * emitted. `fd` should be blocking; non-blocking `fd`s - * should be passed to `net.Socket`. - * - * If `options` is a string, then it specifies the encoding. - * @since v0.1.31 - */ - export function createWriteStream(path: PathLike, options?: BufferEncoding | StreamOptions): WriteStream; - /** - * Forces all currently queued I/O operations associated with the file to the - * operating system's synchronized I/O completion state. Refer to the POSIX [`fdatasync(2)`](http://man7.org/linux/man-pages/man2/fdatasync.2.html) documentation for details. No arguments other - * than a possible - * exception are given to the completion callback. - * @since v0.1.96 - */ - export function fdatasync(fd: number, callback: NoParamCallback): void; - export namespace fdatasync { - /** - * Asynchronous fdatasync(2) - synchronize a file's in-core state with storage device. - * @param fd A file descriptor. - */ - function __promisify__(fd: number): Promise; - } - /** - * Forces all currently queued I/O operations associated with the file to the - * operating system's synchronized I/O completion state. Refer to the POSIX [`fdatasync(2)`](http://man7.org/linux/man-pages/man2/fdatasync.2.html) documentation for details. Returns `undefined`. - * @since v0.1.96 - */ - export function fdatasyncSync(fd: number): void; - /** - * Asynchronously copies `src` to `dest`. By default, `dest` is overwritten if it - * already exists. No arguments other than a possible exception are given to the - * callback function. Node.js makes no guarantees about the atomicity of the copy - * operation. If an error occurs after the destination file has been opened for - * writing, Node.js will attempt to remove the destination. - * - * `mode` is an optional integer that specifies the behavior - * of the copy operation. It is possible to create a mask consisting of the bitwise - * OR of two or more values (e.g.`fs.constants.COPYFILE_EXCL | fs.constants.COPYFILE_FICLONE`). - * - * * `fs.constants.COPYFILE_EXCL`: The copy operation will fail if `dest` already - * exists. - * * `fs.constants.COPYFILE_FICLONE`: The copy operation will attempt to create a - * copy-on-write reflink. If the platform does not support copy-on-write, then a - * fallback copy mechanism is used. - * * `fs.constants.COPYFILE_FICLONE_FORCE`: The copy operation will attempt to - * create a copy-on-write reflink. If the platform does not support - * copy-on-write, then the operation will fail. - * - * ```js - * import { copyFile, constants } from 'fs'; - * - * function callback(err) { - * if (err) throw err; - * console.log('source.txt was copied to destination.txt'); - * } - * - * // destination.txt will be created or overwritten by default. - * copyFile('source.txt', 'destination.txt', callback); - * - * // By using COPYFILE_EXCL, the operation will fail if destination.txt exists. - * copyFile('source.txt', 'destination.txt', constants.COPYFILE_EXCL, callback); - * ``` - * @since v8.5.0 - * @param src source filename to copy - * @param dest destination filename of the copy operation - * @param [mode=0] modifiers for copy operation. - */ - export function copyFile(src: PathLike, dest: PathLike, callback: NoParamCallback): void; - export function copyFile(src: PathLike, dest: PathLike, mode: number, callback: NoParamCallback): void; - export namespace copyFile { - function __promisify__(src: PathLike, dst: PathLike, mode?: number): Promise; - } - /** - * Synchronously copies `src` to `dest`. By default, `dest` is overwritten if it - * already exists. Returns `undefined`. Node.js makes no guarantees about the - * atomicity of the copy operation. If an error occurs after the destination file - * has been opened for writing, Node.js will attempt to remove the destination. - * - * `mode` is an optional integer that specifies the behavior - * of the copy operation. It is possible to create a mask consisting of the bitwise - * OR of two or more values (e.g.`fs.constants.COPYFILE_EXCL | fs.constants.COPYFILE_FICLONE`). - * - * * `fs.constants.COPYFILE_EXCL`: The copy operation will fail if `dest` already - * exists. - * * `fs.constants.COPYFILE_FICLONE`: The copy operation will attempt to create a - * copy-on-write reflink. If the platform does not support copy-on-write, then a - * fallback copy mechanism is used. - * * `fs.constants.COPYFILE_FICLONE_FORCE`: The copy operation will attempt to - * create a copy-on-write reflink. If the platform does not support - * copy-on-write, then the operation will fail. - * - * ```js - * import { copyFileSync, constants } from 'fs'; - * - * // destination.txt will be created or overwritten by default. - * copyFileSync('source.txt', 'destination.txt'); - * console.log('source.txt was copied to destination.txt'); - * - * // By using COPYFILE_EXCL, the operation will fail if destination.txt exists. - * copyFileSync('source.txt', 'destination.txt', constants.COPYFILE_EXCL); - * ``` - * @since v8.5.0 - * @param src source filename to copy - * @param dest destination filename of the copy operation - * @param [mode=0] modifiers for copy operation. - */ - export function copyFileSync(src: PathLike, dest: PathLike, mode?: number): void; - /** - * Write an array of `ArrayBufferView`s to the file specified by `fd` using`writev()`. - * - * `position` is the offset from the beginning of the file where this data - * should be written. If `typeof position !== 'number'`, the data will be written - * at the current position. - * - * The callback will be given three arguments: `err`, `bytesWritten`, and`buffers`. `bytesWritten` is how many bytes were written from `buffers`. - * - * If this method is `util.promisify()` ed, it returns a promise for an`Object` with `bytesWritten` and `buffers` properties. - * - * It is unsafe to use `fs.writev()` multiple times on the same file without - * waiting for the callback. For this scenario, use {@link createWriteStream}. - * - * On Linux, positional writes don't work when the file is opened in append mode. - * The kernel ignores the position argument and always appends the data to - * the end of the file. - * @since v12.9.0 - */ - export function writev(fd: number, buffers: ReadonlyArray, cb: (err: NodeJS.ErrnoException | null, bytesWritten: number, buffers: NodeJS.ArrayBufferView[]) => void): void; - export function writev( - fd: number, - buffers: ReadonlyArray, - position: number, - cb: (err: NodeJS.ErrnoException | null, bytesWritten: number, buffers: NodeJS.ArrayBufferView[]) => void - ): void; - export interface WriteVResult { - bytesWritten: number; - buffers: NodeJS.ArrayBufferView[]; - } - export namespace writev { - function __promisify__(fd: number, buffers: ReadonlyArray, position?: number): Promise; - } - /** - * For detailed information, see the documentation of the asynchronous version of - * this API: {@link writev}. - * @since v12.9.0 - * @return The number of bytes written. - */ - export function writevSync(fd: number, buffers: ReadonlyArray, position?: number): number; - /** - * Read from a file specified by `fd` and write to an array of `ArrayBufferView`s - * using `readv()`. - * - * `position` is the offset from the beginning of the file from where data - * should be read. If `typeof position !== 'number'`, the data will be read - * from the current position. - * - * The callback will be given three arguments: `err`, `bytesRead`, and`buffers`. `bytesRead` is how many bytes were read from the file. - * - * If this method is invoked as its `util.promisify()` ed version, it returns - * a promise for an `Object` with `bytesRead` and `buffers` properties. - * @since v13.13.0, v12.17.0 - */ - export function readv(fd: number, buffers: ReadonlyArray, cb: (err: NodeJS.ErrnoException | null, bytesRead: number, buffers: NodeJS.ArrayBufferView[]) => void): void; - export function readv( - fd: number, - buffers: ReadonlyArray, - position: number, - cb: (err: NodeJS.ErrnoException | null, bytesRead: number, buffers: NodeJS.ArrayBufferView[]) => void - ): void; - export interface ReadVResult { - bytesRead: number; - buffers: NodeJS.ArrayBufferView[]; - } - export namespace readv { - function __promisify__(fd: number, buffers: ReadonlyArray, position?: number): Promise; - } - /** - * For detailed information, see the documentation of the asynchronous version of - * this API: {@link readv}. - * @since v13.13.0, v12.17.0 - * @return The number of bytes read. - */ - export function readvSync(fd: number, buffers: ReadonlyArray, position?: number): number; - export interface OpenDirOptions { - encoding?: BufferEncoding | undefined; - /** - * Number of directory entries that are buffered - * internally when reading from the directory. Higher values lead to better - * performance but higher memory usage. - * @default 32 - */ - bufferSize?: number | undefined; - } - /** - * Synchronously open a directory. See [`opendir(3)`](http://man7.org/linux/man-pages/man3/opendir.3.html). - * - * Creates an `fs.Dir`, which contains all further functions for reading from - * and cleaning up the directory. - * - * The `encoding` option sets the encoding for the `path` while opening the - * directory and subsequent read operations. - * @since v12.12.0 - */ - export function opendirSync(path: PathLike, options?: OpenDirOptions): Dir; - /** - * Asynchronously open a directory. See the POSIX [`opendir(3)`](http://man7.org/linux/man-pages/man3/opendir.3.html) documentation for - * more details. - * - * Creates an `fs.Dir`, which contains all further functions for reading from - * and cleaning up the directory. - * - * The `encoding` option sets the encoding for the `path` while opening the - * directory and subsequent read operations. - * @since v12.12.0 - */ - export function opendir(path: PathLike, cb: (err: NodeJS.ErrnoException | null, dir: Dir) => void): void; - export function opendir(path: PathLike, options: OpenDirOptions, cb: (err: NodeJS.ErrnoException | null, dir: Dir) => void): void; - export namespace opendir { - function __promisify__(path: PathLike, options?: OpenDirOptions): Promise; - } - export interface BigIntStats extends StatsBase { - atimeNs: bigint; - mtimeNs: bigint; - ctimeNs: bigint; - birthtimeNs: bigint; - } - export interface BigIntOptions { - bigint: true; - } - export interface StatOptions { - bigint?: boolean | undefined; - } - export interface StatSyncOptions extends StatOptions { - throwIfNoEntry?: boolean | undefined; - } - interface CopyOptionsBase { - /** - * Dereference symlinks - * @default false - */ - dereference?: boolean; - /** - * When `force` is `false`, and the destination - * exists, throw an error. - * @default false - */ - errorOnExist?: boolean; - /** - * Overwrite existing file or directory. _The copy - * operation will ignore errors if you set this to false and the destination - * exists. Use the `errorOnExist` option to change this behavior. - * @default true - */ - force?: boolean; - /** - * When `true` timestamps from `src` will - * be preserved. - * @default false - */ - preserveTimestamps?: boolean; - /** - * Copy directories recursively. - * @default false - */ - recursive?: boolean; - /** - * When true, path resolution for symlinks will be skipped - * @default false - */ - verbatimSymlinks?: boolean; - } - export interface CopyOptions extends CopyOptionsBase { - /** - * Function to filter copied files/directories. Return - * `true` to copy the item, `false` to ignore it. - */ - filter?(source: string, destination: string): boolean | Promise; - } - export interface CopySyncOptions extends CopyOptionsBase { - /** - * Function to filter copied files/directories. Return - * `true` to copy the item, `false` to ignore it. - */ - filter?(source: string, destination: string): boolean; - } - /** - * Asynchronously copies the entire directory structure from `src` to `dest`, - * including subdirectories and files. - * - * When copying a directory to another directory, globs are not supported and - * behavior is similar to `cp dir1/ dir2/`. - * @since v16.7.0 - * @experimental - * @param src source path to copy. - * @param dest destination path to copy to. - */ - export function cp(source: string | URL, destination: string | URL, callback: (err: NodeJS.ErrnoException | null) => void): void; - export function cp(source: string | URL, destination: string | URL, opts: CopyOptions, callback: (err: NodeJS.ErrnoException | null) => void): void; - /** - * Synchronously copies the entire directory structure from `src` to `dest`, - * including subdirectories and files. - * - * When copying a directory to another directory, globs are not supported and - * behavior is similar to `cp dir1/ dir2/`. - * @since v16.7.0 - * @experimental - * @param src source path to copy. - * @param dest destination path to copy to. - */ - export function cpSync(source: string | URL, destination: string | URL, opts?: CopySyncOptions): void; -} -declare module 'node:fs' { - export * from 'fs'; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/fs/promises.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/fs/promises.d.ts deleted file mode 100755 index aca2fd51..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/fs/promises.d.ts +++ /dev/null @@ -1,1138 +0,0 @@ -/** - * The `fs/promises` API provides asynchronous file system methods that return - * promises. - * - * The promise APIs use the underlying Node.js threadpool to perform file - * system operations off the event loop thread. These operations are not - * synchronized or threadsafe. Care must be taken when performing multiple - * concurrent modifications on the same file or data corruption may occur. - * @since v10.0.0 - */ -declare module 'fs/promises' { - import { Abortable } from 'node:events'; - import { Stream } from 'node:stream'; - import { ReadableStream } from 'node:stream/web'; - import { - BigIntStats, - BufferEncodingOption, - constants as fsConstants, - CopyOptions, - Dir, - Dirent, - MakeDirectoryOptions, - Mode, - ObjectEncodingOptions, - OpenDirOptions, - OpenMode, - PathLike, - ReadStream, - ReadVResult, - RmDirOptions, - RmOptions, - StatOptions, - Stats, - TimeLike, - WatchEventType, - WatchOptions, - WriteStream, - WriteVResult, - } from 'node:fs'; - import { Interface as ReadlineInterface } from 'node:readline'; - - interface FileChangeInfo { - eventType: WatchEventType; - filename: T; - } - interface FlagAndOpenMode { - mode?: Mode | undefined; - flag?: OpenMode | undefined; - } - interface FileReadResult { - bytesRead: number; - buffer: T; - } - interface FileReadOptions { - /** - * @default `Buffer.alloc(0xffff)` - */ - buffer?: T; - /** - * @default 0 - */ - offset?: number | null; - /** - * @default `buffer.byteLength` - */ - length?: number | null; - position?: number | null; - } - interface CreateReadStreamOptions { - encoding?: BufferEncoding | null | undefined; - autoClose?: boolean | undefined; - emitClose?: boolean | undefined; - start?: number | undefined; - end?: number | undefined; - highWaterMark?: number | undefined; - } - interface CreateWriteStreamOptions { - encoding?: BufferEncoding | null | undefined; - autoClose?: boolean | undefined; - emitClose?: boolean | undefined; - start?: number | undefined; - } - // TODO: Add `EventEmitter` close - interface FileHandle { - /** - * The numeric file descriptor managed by the {FileHandle} object. - * @since v10.0.0 - */ - readonly fd: number; - /** - * Alias of `filehandle.writeFile()`. - * - * When operating on file handles, the mode cannot be changed from what it was set - * to with `fsPromises.open()`. Therefore, this is equivalent to `filehandle.writeFile()`. - * @since v10.0.0 - * @return Fulfills with `undefined` upon success. - */ - appendFile(data: string | Uint8Array, options?: (ObjectEncodingOptions & FlagAndOpenMode) | BufferEncoding | null): Promise; - /** - * Changes the ownership of the file. A wrapper for [`chown(2)`](http://man7.org/linux/man-pages/man2/chown.2.html). - * @since v10.0.0 - * @param uid The file's new owner's user id. - * @param gid The file's new group's group id. - * @return Fulfills with `undefined` upon success. - */ - chown(uid: number, gid: number): Promise; - /** - * Modifies the permissions on the file. See [`chmod(2)`](http://man7.org/linux/man-pages/man2/chmod.2.html). - * @since v10.0.0 - * @param mode the file mode bit mask. - * @return Fulfills with `undefined` upon success. - */ - chmod(mode: Mode): Promise; - /** - * Unlike the 16 kb default `highWaterMark` for a `stream.Readable`, the stream - * returned by this method has a default `highWaterMark` of 64 kb. - * - * `options` can include `start` and `end` values to read a range of bytes from - * the file instead of the entire file. Both `start` and `end` are inclusive and - * start counting at 0, allowed values are in the - * \[0, [`Number.MAX_SAFE_INTEGER`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER)\] range. If `start` is - * omitted or `undefined`, `filehandle.createReadStream()` reads sequentially from - * the current file position. The `encoding` can be any one of those accepted by `Buffer`. - * - * If the `FileHandle` points to a character device that only supports blocking - * reads (such as keyboard or sound card), read operations do not finish until data - * is available. This can prevent the process from exiting and the stream from - * closing naturally. - * - * By default, the stream will emit a `'close'` event after it has been - * destroyed. Set the `emitClose` option to `false` to change this behavior. - * - * ```js - * import { open } from 'fs/promises'; - * - * const fd = await open('/dev/input/event0'); - * // Create a stream from some character device. - * const stream = fd.createReadStream(); - * setTimeout(() => { - * stream.close(); // This may not close the stream. - * // Artificially marking end-of-stream, as if the underlying resource had - * // indicated end-of-file by itself, allows the stream to close. - * // This does not cancel pending read operations, and if there is such an - * // operation, the process may still not be able to exit successfully - * // until it finishes. - * stream.push(null); - * stream.read(0); - * }, 100); - * ``` - * - * If `autoClose` is false, then the file descriptor won't be closed, even if - * there's an error. It is the application's responsibility to close it and make - * sure there's no file descriptor leak. If `autoClose` is set to true (default - * behavior), on `'error'` or `'end'` the file descriptor will be closed - * automatically. - * - * An example to read the last 10 bytes of a file which is 100 bytes long: - * - * ```js - * import { open } from 'fs/promises'; - * - * const fd = await open('sample.txt'); - * fd.createReadStream({ start: 90, end: 99 }); - * ``` - * @since v16.11.0 - */ - createReadStream(options?: CreateReadStreamOptions): ReadStream; - /** - * `options` may also include a `start` option to allow writing data at some - * position past the beginning of the file, allowed values are in the - * \[0, [`Number.MAX_SAFE_INTEGER`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER)\] range. Modifying a file rather than - * replacing it may require the `flags` `open` option to be set to `r+` rather than - * the default `r`. The `encoding` can be any one of those accepted by `Buffer`. - * - * If `autoClose` is set to true (default behavior) on `'error'` or `'finish'`the file descriptor will be closed automatically. If `autoClose` is false, - * then the file descriptor won't be closed, even if there's an error. - * It is the application's responsibility to close it and make sure there's no - * file descriptor leak. - * - * By default, the stream will emit a `'close'` event after it has been - * destroyed. Set the `emitClose` option to `false` to change this behavior. - * @since v16.11.0 - */ - createWriteStream(options?: CreateWriteStreamOptions): WriteStream; - /** - * Forces all currently queued I/O operations associated with the file to the - * operating system's synchronized I/O completion state. Refer to the POSIX [`fdatasync(2)`](http://man7.org/linux/man-pages/man2/fdatasync.2.html) documentation for details. - * - * Unlike `filehandle.sync` this method does not flush modified metadata. - * @since v10.0.0 - * @return Fulfills with `undefined` upon success. - */ - datasync(): Promise; - /** - * Request that all data for the open file descriptor is flushed to the storage - * device. The specific implementation is operating system and device specific. - * Refer to the POSIX [`fsync(2)`](http://man7.org/linux/man-pages/man2/fsync.2.html) documentation for more detail. - * @since v10.0.0 - * @return Fufills with `undefined` upon success. - */ - sync(): Promise; - /** - * Reads data from the file and stores that in the given buffer. - * - * If the file is not modified concurrently, the end-of-file is reached when the - * number of bytes read is zero. - * @since v10.0.0 - * @param buffer A buffer that will be filled with the file data read. - * @param offset The location in the buffer at which to start filling. - * @param length The number of bytes to read. - * @param position The location where to begin reading data from the file. If `null`, data will be read from the current file position, and the position will be updated. If `position` is an - * integer, the current file position will remain unchanged. - * @return Fulfills upon success with an object with two properties: - */ - read(buffer: T, offset?: number | null, length?: number | null, position?: number | null): Promise>; - read(options?: FileReadOptions): Promise>; - /** - * Returns a `ReadableStream` that may be used to read the files data. - * - * An error will be thrown if this method is called more than once or is called after the `FileHandle` is closed - * or closing. - * - * ```js - * import { open } from 'node:fs/promises'; - * - * const file = await open('./some/file/to/read'); - * - * for await (const chunk of file.readableWebStream()) - * console.log(chunk); - * - * await file.close(); - * ``` - * - * While the `ReadableStream` will read the file to completion, it will not close the `FileHandle` automatically. User code must still call the `fileHandle.close()` method. - * - * @since v17.0.0 - * @experimental - */ - readableWebStream(): ReadableStream; - /** - * Asynchronously reads the entire contents of a file. - * - * If `options` is a string, then it specifies the `encoding`. - * - * The `FileHandle` has to support reading. - * - * If one or more `filehandle.read()` calls are made on a file handle and then a`filehandle.readFile()` call is made, the data will be read from the current - * position till the end of the file. It doesn't always read from the beginning - * of the file. - * @since v10.0.0 - * @return Fulfills upon a successful read with the contents of the file. If no encoding is specified (using `options.encoding`), the data is returned as a {Buffer} object. Otherwise, the - * data will be a string. - */ - readFile( - options?: { - encoding?: null | undefined; - flag?: OpenMode | undefined; - } | null - ): Promise; - /** - * Asynchronously reads the entire contents of a file. The underlying file will _not_ be closed automatically. - * The `FileHandle` must have been opened for reading. - * @param options An object that may contain an optional flag. - * If a flag is not provided, it defaults to `'r'`. - */ - readFile( - options: - | { - encoding: BufferEncoding; - flag?: OpenMode | undefined; - } - | BufferEncoding - ): Promise; - /** - * Asynchronously reads the entire contents of a file. The underlying file will _not_ be closed automatically. - * The `FileHandle` must have been opened for reading. - * @param options An object that may contain an optional flag. - * If a flag is not provided, it defaults to `'r'`. - */ - readFile( - options?: - | (ObjectEncodingOptions & { - flag?: OpenMode | undefined; - }) - | BufferEncoding - | null - ): Promise; - /** - * Convenience method to create a `readline` interface and stream over the file. For example: - * - * ```js - * import { open } from 'node:fs/promises'; - * - * const file = await open('./some/file/to/read'); - * - * for await (const line of file.readLines()) { - * console.log(line); - * } - * ``` - * - * @since v18.11.0 - * @param options See `filehandle.createReadStream()` for the options. - */ - readLines(options?: CreateReadStreamOptions): ReadlineInterface; - /** - * @since v10.0.0 - * @return Fulfills with an {fs.Stats} for the file. - */ - stat( - opts?: StatOptions & { - bigint?: false | undefined; - } - ): Promise; - stat( - opts: StatOptions & { - bigint: true; - } - ): Promise; - stat(opts?: StatOptions): Promise; - /** - * Truncates the file. - * - * If the file was larger than `len` bytes, only the first `len` bytes will be - * retained in the file. - * - * The following example retains only the first four bytes of the file: - * - * ```js - * import { open } from 'fs/promises'; - * - * let filehandle = null; - * try { - * filehandle = await open('temp.txt', 'r+'); - * await filehandle.truncate(4); - * } finally { - * await filehandle?.close(); - * } - * ``` - * - * If the file previously was shorter than `len` bytes, it is extended, and the - * extended part is filled with null bytes (`'\0'`): - * - * If `len` is negative then `0` will be used. - * @since v10.0.0 - * @param [len=0] - * @return Fulfills with `undefined` upon success. - */ - truncate(len?: number): Promise; - /** - * Change the file system timestamps of the object referenced by the `FileHandle` then resolves the promise with no arguments upon success. - * @since v10.0.0 - */ - utimes(atime: TimeLike, mtime: TimeLike): Promise; - /** - * Asynchronously writes data to a file, replacing the file if it already exists.`data` can be a string, a buffer, an - * [AsyncIterable](https://tc39.github.io/ecma262/#sec-asynciterable-interface) or - * [Iterable](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#The_iterable_protocol) object. - * The promise is resolved with no arguments upon success. - * - * If `options` is a string, then it specifies the `encoding`. - * - * The `FileHandle` has to support writing. - * - * It is unsafe to use `filehandle.writeFile()` multiple times on the same file - * without waiting for the promise to be resolved (or rejected). - * - * If one or more `filehandle.write()` calls are made on a file handle and then a`filehandle.writeFile()` call is made, the data will be written from the - * current position till the end of the file. It doesn't always write from the - * beginning of the file. - * @since v10.0.0 - */ - writeFile(data: string | Uint8Array, options?: (ObjectEncodingOptions & FlagAndOpenMode & Abortable) | BufferEncoding | null): Promise; - /** - * Write `buffer` to the file. - * - * The promise is resolved with an object containing two properties: - * - * It is unsafe to use `filehandle.write()` multiple times on the same file - * without waiting for the promise to be resolved (or rejected). For this - * scenario, use `filehandle.createWriteStream()`. - * - * On Linux, positional writes do not work when the file is opened in append mode. - * The kernel ignores the position argument and always appends the data to - * the end of the file. - * @since v10.0.0 - * @param [offset=0] The start position from within `buffer` where the data to write begins. - * @param [length=buffer.byteLength - offset] The number of bytes from `buffer` to write. - * @param position The offset from the beginning of the file where the data from `buffer` should be written. If `position` is not a `number`, the data will be written at the current position. - * See the POSIX pwrite(2) documentation for more detail. - */ - write( - buffer: TBuffer, - offset?: number | null, - length?: number | null, - position?: number | null - ): Promise<{ - bytesWritten: number; - buffer: TBuffer; - }>; - write( - data: string, - position?: number | null, - encoding?: BufferEncoding | null - ): Promise<{ - bytesWritten: number; - buffer: string; - }>; - /** - * Write an array of [ArrayBufferView](https://developer.mozilla.org/en-US/docs/Web/API/ArrayBufferView) s to the file. - * - * The promise is resolved with an object containing a two properties: - * - * It is unsafe to call `writev()` multiple times on the same file without waiting - * for the promise to be resolved (or rejected). - * - * On Linux, positional writes don't work when the file is opened in append mode. - * The kernel ignores the position argument and always appends the data to - * the end of the file. - * @since v12.9.0 - * @param position The offset from the beginning of the file where the data from `buffers` should be written. If `position` is not a `number`, the data will be written at the current - * position. - */ - writev(buffers: ReadonlyArray, position?: number): Promise; - /** - * Read from a file and write to an array of [ArrayBufferView](https://developer.mozilla.org/en-US/docs/Web/API/ArrayBufferView) s - * @since v13.13.0, v12.17.0 - * @param position The offset from the beginning of the file where the data should be read from. If `position` is not a `number`, the data will be read from the current position. - * @return Fulfills upon success an object containing two properties: - */ - readv(buffers: ReadonlyArray, position?: number): Promise; - /** - * Closes the file handle after waiting for any pending operation on the handle to - * complete. - * - * ```js - * import { open } from 'fs/promises'; - * - * let filehandle; - * try { - * filehandle = await open('thefile.txt', 'r'); - * } finally { - * await filehandle?.close(); - * } - * ``` - * @since v10.0.0 - * @return Fulfills with `undefined` upon success. - */ - close(): Promise; - } - - const constants: typeof fsConstants; - - /** - * Tests a user's permissions for the file or directory specified by `path`. - * The `mode` argument is an optional integer that specifies the accessibility - * checks to be performed. `mode` should be either the value `fs.constants.F_OK`or a mask consisting of the bitwise OR of any of `fs.constants.R_OK`,`fs.constants.W_OK`, and `fs.constants.X_OK` - * (e.g.`fs.constants.W_OK | fs.constants.R_OK`). Check `File access constants` for - * possible values of `mode`. - * - * If the accessibility check is successful, the promise is resolved with no - * value. If any of the accessibility checks fail, the promise is rejected - * with an [Error](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error) object. The following example checks if the file`/etc/passwd` can be read and - * written by the current process. - * - * ```js - * import { access } from 'fs/promises'; - * import { constants } from 'fs'; - * - * try { - * await access('/etc/passwd', constants.R_OK | constants.W_OK); - * console.log('can access'); - * } catch { - * console.error('cannot access'); - * } - * ``` - * - * Using `fsPromises.access()` to check for the accessibility of a file before - * calling `fsPromises.open()` is not recommended. Doing so introduces a race - * condition, since other processes may change the file's state between the two - * calls. Instead, user code should open/read/write the file directly and handle - * the error raised if the file is not accessible. - * @since v10.0.0 - * @param [mode=fs.constants.F_OK] - * @return Fulfills with `undefined` upon success. - */ - function access(path: PathLike, mode?: number): Promise; - /** - * Asynchronously copies `src` to `dest`. By default, `dest` is overwritten if it - * already exists. - * - * No guarantees are made about the atomicity of the copy operation. If an - * error occurs after the destination file has been opened for writing, an attempt - * will be made to remove the destination. - * - * ```js - * import { constants } from 'fs'; - * import { copyFile } from 'fs/promises'; - * - * try { - * await copyFile('source.txt', 'destination.txt'); - * console.log('source.txt was copied to destination.txt'); - * } catch { - * console.log('The file could not be copied'); - * } - * - * // By using COPYFILE_EXCL, the operation will fail if destination.txt exists. - * try { - * await copyFile('source.txt', 'destination.txt', constants.COPYFILE_EXCL); - * console.log('source.txt was copied to destination.txt'); - * } catch { - * console.log('The file could not be copied'); - * } - * ``` - * @since v10.0.0 - * @param src source filename to copy - * @param dest destination filename of the copy operation - * @param [mode=0] Optional modifiers that specify the behavior of the copy operation. It is possible to create a mask consisting of the bitwise OR of two or more values (e.g. - * `fs.constants.COPYFILE_EXCL | fs.constants.COPYFILE_FICLONE`) - * @return Fulfills with `undefined` upon success. - */ - function copyFile(src: PathLike, dest: PathLike, mode?: number): Promise; - /** - * Opens a `FileHandle`. - * - * Refer to the POSIX [`open(2)`](http://man7.org/linux/man-pages/man2/open.2.html) documentation for more detail. - * - * Some characters (`< > : " / \ | ? *`) are reserved under Windows as documented - * by [Naming Files, Paths, and Namespaces](https://docs.microsoft.com/en-us/windows/desktop/FileIO/naming-a-file). Under NTFS, if the filename contains - * a colon, Node.js will open a file system stream, as described by [this MSDN page](https://docs.microsoft.com/en-us/windows/desktop/FileIO/using-streams). - * @since v10.0.0 - * @param [flags='r'] See `support of file system `flags``. - * @param [mode=0o666] Sets the file mode (permission and sticky bits) if the file is created. - * @return Fulfills with a {FileHandle} object. - */ - function open(path: PathLike, flags?: string | number, mode?: Mode): Promise; - /** - * Renames `oldPath` to `newPath`. - * @since v10.0.0 - * @return Fulfills with `undefined` upon success. - */ - function rename(oldPath: PathLike, newPath: PathLike): Promise; - /** - * Truncates (shortens or extends the length) of the content at `path` to `len`bytes. - * @since v10.0.0 - * @param [len=0] - * @return Fulfills with `undefined` upon success. - */ - function truncate(path: PathLike, len?: number): Promise; - /** - * Removes the directory identified by `path`. - * - * Using `fsPromises.rmdir()` on a file (not a directory) results in the - * promise being rejected with an `ENOENT` error on Windows and an `ENOTDIR`error on POSIX. - * - * To get a behavior similar to the `rm -rf` Unix command, use `fsPromises.rm()` with options `{ recursive: true, force: true }`. - * @since v10.0.0 - * @return Fulfills with `undefined` upon success. - */ - function rmdir(path: PathLike, options?: RmDirOptions): Promise; - /** - * Removes files and directories (modeled on the standard POSIX `rm` utility). - * @since v14.14.0 - * @return Fulfills with `undefined` upon success. - */ - function rm(path: PathLike, options?: RmOptions): Promise; - /** - * Asynchronously creates a directory. - * - * The optional `options` argument can be an integer specifying `mode` (permission - * and sticky bits), or an object with a `mode` property and a `recursive`property indicating whether parent directories should be created. Calling`fsPromises.mkdir()` when `path` is a directory - * that exists results in a - * rejection only when `recursive` is false. - * @since v10.0.0 - * @return Upon success, fulfills with `undefined` if `recursive` is `false`, or the first directory path created if `recursive` is `true`. - */ - function mkdir( - path: PathLike, - options: MakeDirectoryOptions & { - recursive: true; - } - ): Promise; - /** - * Asynchronous mkdir(2) - create a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders - * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. - */ - function mkdir( - path: PathLike, - options?: - | Mode - | (MakeDirectoryOptions & { - recursive?: false | undefined; - }) - | null - ): Promise; - /** - * Asynchronous mkdir(2) - create a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders - * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. - */ - function mkdir(path: PathLike, options?: Mode | MakeDirectoryOptions | null): Promise; - /** - * Reads the contents of a directory. - * - * The optional `options` argument can be a string specifying an encoding, or an - * object with an `encoding` property specifying the character encoding to use for - * the filenames. If the `encoding` is set to `'buffer'`, the filenames returned - * will be passed as `Buffer` objects. - * - * If `options.withFileTypes` is set to `true`, the resolved array will contain `fs.Dirent` objects. - * - * ```js - * import { readdir } from 'fs/promises'; - * - * try { - * const files = await readdir(path); - * for (const file of files) - * console.log(file); - * } catch (err) { - * console.error(err); - * } - * ``` - * @since v10.0.0 - * @return Fulfills with an array of the names of the files in the directory excluding `'.'` and `'..'`. - */ - function readdir( - path: PathLike, - options?: - | (ObjectEncodingOptions & { - withFileTypes?: false | undefined; - }) - | BufferEncoding - | null - ): Promise; - /** - * Asynchronous readdir(3) - read a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function readdir( - path: PathLike, - options: - | { - encoding: 'buffer'; - withFileTypes?: false | undefined; - } - | 'buffer' - ): Promise; - /** - * Asynchronous readdir(3) - read a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function readdir( - path: PathLike, - options?: - | (ObjectEncodingOptions & { - withFileTypes?: false | undefined; - }) - | BufferEncoding - | null - ): Promise; - /** - * Asynchronous readdir(3) - read a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options If called with `withFileTypes: true` the result data will be an array of Dirent. - */ - function readdir( - path: PathLike, - options: ObjectEncodingOptions & { - withFileTypes: true; - } - ): Promise; - /** - * Reads the contents of the symbolic link referred to by `path`. See the POSIX [`readlink(2)`](http://man7.org/linux/man-pages/man2/readlink.2.html) documentation for more detail. The promise is - * resolved with the`linkString` upon success. - * - * The optional `options` argument can be a string specifying an encoding, or an - * object with an `encoding` property specifying the character encoding to use for - * the link path returned. If the `encoding` is set to `'buffer'`, the link path - * returned will be passed as a `Buffer` object. - * @since v10.0.0 - * @return Fulfills with the `linkString` upon success. - */ - function readlink(path: PathLike, options?: ObjectEncodingOptions | BufferEncoding | null): Promise; - /** - * Asynchronous readlink(2) - read value of a symbolic link. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function readlink(path: PathLike, options: BufferEncodingOption): Promise; - /** - * Asynchronous readlink(2) - read value of a symbolic link. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function readlink(path: PathLike, options?: ObjectEncodingOptions | string | null): Promise; - /** - * Creates a symbolic link. - * - * The `type` argument is only used on Windows platforms and can be one of `'dir'`,`'file'`, or `'junction'`. Windows junction points require the destination path - * to be absolute. When using `'junction'`, the `target` argument will - * automatically be normalized to absolute path. - * @since v10.0.0 - * @param [type='file'] - * @return Fulfills with `undefined` upon success. - */ - function symlink(target: PathLike, path: PathLike, type?: string | null): Promise; - /** - * Equivalent to `fsPromises.stat()` unless `path` refers to a symbolic link, - * in which case the link itself is stat-ed, not the file that it refers to. - * Refer to the POSIX [`lstat(2)`](http://man7.org/linux/man-pages/man2/lstat.2.html) document for more detail. - * @since v10.0.0 - * @return Fulfills with the {fs.Stats} object for the given symbolic link `path`. - */ - function lstat( - path: PathLike, - opts?: StatOptions & { - bigint?: false | undefined; - } - ): Promise; - function lstat( - path: PathLike, - opts: StatOptions & { - bigint: true; - } - ): Promise; - function lstat(path: PathLike, opts?: StatOptions): Promise; - /** - * @since v10.0.0 - * @return Fulfills with the {fs.Stats} object for the given `path`. - */ - function stat( - path: PathLike, - opts?: StatOptions & { - bigint?: false | undefined; - } - ): Promise; - function stat( - path: PathLike, - opts: StatOptions & { - bigint: true; - } - ): Promise; - function stat(path: PathLike, opts?: StatOptions): Promise; - /** - * Creates a new link from the `existingPath` to the `newPath`. See the POSIX [`link(2)`](http://man7.org/linux/man-pages/man2/link.2.html) documentation for more detail. - * @since v10.0.0 - * @return Fulfills with `undefined` upon success. - */ - function link(existingPath: PathLike, newPath: PathLike): Promise; - /** - * If `path` refers to a symbolic link, then the link is removed without affecting - * the file or directory to which that link refers. If the `path` refers to a file - * path that is not a symbolic link, the file is deleted. See the POSIX [`unlink(2)`](http://man7.org/linux/man-pages/man2/unlink.2.html) documentation for more detail. - * @since v10.0.0 - * @return Fulfills with `undefined` upon success. - */ - function unlink(path: PathLike): Promise; - /** - * Changes the permissions of a file. - * @since v10.0.0 - * @return Fulfills with `undefined` upon success. - */ - function chmod(path: PathLike, mode: Mode): Promise; - /** - * Changes the permissions on a symbolic link. - * - * This method is only implemented on macOS. - * @deprecated Since v10.0.0 - * @return Fulfills with `undefined` upon success. - */ - function lchmod(path: PathLike, mode: Mode): Promise; - /** - * Changes the ownership on a symbolic link. - * @since v10.0.0 - * @return Fulfills with `undefined` upon success. - */ - function lchown(path: PathLike, uid: number, gid: number): Promise; - /** - * Changes the access and modification times of a file in the same way as `fsPromises.utimes()`, with the difference that if the path refers to a - * symbolic link, then the link is not dereferenced: instead, the timestamps of - * the symbolic link itself are changed. - * @since v14.5.0, v12.19.0 - * @return Fulfills with `undefined` upon success. - */ - function lutimes(path: PathLike, atime: TimeLike, mtime: TimeLike): Promise; - /** - * Changes the ownership of a file. - * @since v10.0.0 - * @return Fulfills with `undefined` upon success. - */ - function chown(path: PathLike, uid: number, gid: number): Promise; - /** - * Change the file system timestamps of the object referenced by `path`. - * - * The `atime` and `mtime` arguments follow these rules: - * - * * Values can be either numbers representing Unix epoch time, `Date`s, or a - * numeric string like `'123456789.0'`. - * * If the value can not be converted to a number, or is `NaN`, `Infinity` or`-Infinity`, an `Error` will be thrown. - * @since v10.0.0 - * @return Fulfills with `undefined` upon success. - */ - function utimes(path: PathLike, atime: TimeLike, mtime: TimeLike): Promise; - /** - * Determines the actual location of `path` using the same semantics as the`fs.realpath.native()` function. - * - * Only paths that can be converted to UTF8 strings are supported. - * - * The optional `options` argument can be a string specifying an encoding, or an - * object with an `encoding` property specifying the character encoding to use for - * the path. If the `encoding` is set to `'buffer'`, the path returned will be - * passed as a `Buffer` object. - * - * On Linux, when Node.js is linked against musl libc, the procfs file system must - * be mounted on `/proc` in order for this function to work. Glibc does not have - * this restriction. - * @since v10.0.0 - * @return Fulfills with the resolved path upon success. - */ - function realpath(path: PathLike, options?: ObjectEncodingOptions | BufferEncoding | null): Promise; - /** - * Asynchronous realpath(3) - return the canonicalized absolute pathname. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function realpath(path: PathLike, options: BufferEncodingOption): Promise; - /** - * Asynchronous realpath(3) - return the canonicalized absolute pathname. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function realpath(path: PathLike, options?: ObjectEncodingOptions | BufferEncoding | null): Promise; - /** - * Creates a unique temporary directory. A unique directory name is generated by - * appending six random characters to the end of the provided `prefix`. Due to - * platform inconsistencies, avoid trailing `X` characters in `prefix`. Some - * platforms, notably the BSDs, can return more than six random characters, and - * replace trailing `X` characters in `prefix` with random characters. - * - * The optional `options` argument can be a string specifying an encoding, or an - * object with an `encoding` property specifying the character encoding to use. - * - * ```js - * import { mkdtemp } from 'fs/promises'; - * - * try { - * await mkdtemp(path.join(os.tmpdir(), 'foo-')); - * } catch (err) { - * console.error(err); - * } - * ``` - * - * The `fsPromises.mkdtemp()` method will append the six randomly selected - * characters directly to the `prefix` string. For instance, given a directory`/tmp`, if the intention is to create a temporary directory _within_`/tmp`, the`prefix` must end with a trailing - * platform-specific path separator - * (`require('path').sep`). - * @since v10.0.0 - * @return Fulfills with a string containing the filesystem path of the newly created temporary directory. - */ - function mkdtemp(prefix: string, options?: ObjectEncodingOptions | BufferEncoding | null): Promise; - /** - * Asynchronously creates a unique temporary directory. - * Generates six random characters to be appended behind a required `prefix` to create a unique temporary directory. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function mkdtemp(prefix: string, options: BufferEncodingOption): Promise; - /** - * Asynchronously creates a unique temporary directory. - * Generates six random characters to be appended behind a required `prefix` to create a unique temporary directory. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function mkdtemp(prefix: string, options?: ObjectEncodingOptions | BufferEncoding | null): Promise; - /** - * Asynchronously writes data to a file, replacing the file if it already exists.`data` can be a string, a buffer, an - * [AsyncIterable](https://tc39.github.io/ecma262/#sec-asynciterable-interface) or - * [Iterable](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#The_iterable_protocol) object. - * - * The `encoding` option is ignored if `data` is a buffer. - * - * If `options` is a string, then it specifies the encoding. - * - * The `mode` option only affects the newly created file. See `fs.open()` for more details. - * - * Any specified `FileHandle` has to support writing. - * - * It is unsafe to use `fsPromises.writeFile()` multiple times on the same file - * without waiting for the promise to be settled. - * - * Similarly to `fsPromises.readFile` \- `fsPromises.writeFile` is a convenience - * method that performs multiple `write` calls internally to write the buffer - * passed to it. For performance sensitive code consider using `fs.createWriteStream()` or `filehandle.createWriteStream()`. - * - * It is possible to use an `AbortSignal` to cancel an `fsPromises.writeFile()`. - * Cancelation is "best effort", and some amount of data is likely still - * to be written. - * - * ```js - * import { writeFile } from 'fs/promises'; - * import { Buffer } from 'buffer'; - * - * try { - * const controller = new AbortController(); - * const { signal } = controller; - * const data = new Uint8Array(Buffer.from('Hello Node.js')); - * const promise = writeFile('message.txt', data, { signal }); - * - * // Abort the request before the promise settles. - * controller.abort(); - * - * await promise; - * } catch (err) { - * // When a request is aborted - err is an AbortError - * console.error(err); - * } - * ``` - * - * Aborting an ongoing request does not abort individual operating - * system requests but rather the internal buffering `fs.writeFile` performs. - * @since v10.0.0 - * @param file filename or `FileHandle` - * @return Fulfills with `undefined` upon success. - */ - function writeFile( - file: PathLike | FileHandle, - data: string | NodeJS.ArrayBufferView | Iterable | AsyncIterable | Stream, - options?: - | (ObjectEncodingOptions & { - mode?: Mode | undefined; - flag?: OpenMode | undefined; - } & Abortable) - | BufferEncoding - | null - ): Promise; - /** - * Asynchronously append data to a file, creating the file if it does not yet - * exist. `data` can be a string or a `Buffer`. - * - * If `options` is a string, then it specifies the `encoding`. - * - * The `mode` option only affects the newly created file. See `fs.open()` for more details. - * - * The `path` may be specified as a `FileHandle` that has been opened - * for appending (using `fsPromises.open()`). - * @since v10.0.0 - * @param path filename or {FileHandle} - * @return Fulfills with `undefined` upon success. - */ - function appendFile(path: PathLike | FileHandle, data: string | Uint8Array, options?: (ObjectEncodingOptions & FlagAndOpenMode) | BufferEncoding | null): Promise; - /** - * Asynchronously reads the entire contents of a file. - * - * If no encoding is specified (using `options.encoding`), the data is returned - * as a `Buffer` object. Otherwise, the data will be a string. - * - * If `options` is a string, then it specifies the encoding. - * - * When the `path` is a directory, the behavior of `fsPromises.readFile()` is - * platform-specific. On macOS, Linux, and Windows, the promise will be rejected - * with an error. On FreeBSD, a representation of the directory's contents will be - * returned. - * - * It is possible to abort an ongoing `readFile` using an `AbortSignal`. If a - * request is aborted the promise returned is rejected with an `AbortError`: - * - * ```js - * import { readFile } from 'fs/promises'; - * - * try { - * const controller = new AbortController(); - * const { signal } = controller; - * const promise = readFile(fileName, { signal }); - * - * // Abort the request before the promise settles. - * controller.abort(); - * - * await promise; - * } catch (err) { - * // When a request is aborted - err is an AbortError - * console.error(err); - * } - * ``` - * - * Aborting an ongoing request does not abort individual operating - * system requests but rather the internal buffering `fs.readFile` performs. - * - * Any specified `FileHandle` has to support reading. - * @since v10.0.0 - * @param path filename or `FileHandle` - * @return Fulfills with the contents of the file. - */ - function readFile( - path: PathLike | FileHandle, - options?: - | ({ - encoding?: null | undefined; - flag?: OpenMode | undefined; - } & Abortable) - | null - ): Promise; - /** - * Asynchronously reads the entire contents of a file. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * If a `FileHandle` is provided, the underlying file will _not_ be closed automatically. - * @param options An object that may contain an optional flag. - * If a flag is not provided, it defaults to `'r'`. - */ - function readFile( - path: PathLike | FileHandle, - options: - | ({ - encoding: BufferEncoding; - flag?: OpenMode | undefined; - } & Abortable) - | BufferEncoding - ): Promise; - /** - * Asynchronously reads the entire contents of a file. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * If a `FileHandle` is provided, the underlying file will _not_ be closed automatically. - * @param options An object that may contain an optional flag. - * If a flag is not provided, it defaults to `'r'`. - */ - function readFile( - path: PathLike | FileHandle, - options?: - | (ObjectEncodingOptions & - Abortable & { - flag?: OpenMode | undefined; - }) - | BufferEncoding - | null - ): Promise; - /** - * Asynchronously open a directory for iterative scanning. See the POSIX [`opendir(3)`](http://man7.org/linux/man-pages/man3/opendir.3.html) documentation for more detail. - * - * Creates an `fs.Dir`, which contains all further functions for reading from - * and cleaning up the directory. - * - * The `encoding` option sets the encoding for the `path` while opening the - * directory and subsequent read operations. - * - * Example using async iteration: - * - * ```js - * import { opendir } from 'fs/promises'; - * - * try { - * const dir = await opendir('./'); - * for await (const dirent of dir) - * console.log(dirent.name); - * } catch (err) { - * console.error(err); - * } - * ``` - * - * When using the async iterator, the `fs.Dir` object will be automatically - * closed after the iterator exits. - * @since v12.12.0 - * @return Fulfills with an {fs.Dir}. - */ - function opendir(path: PathLike, options?: OpenDirOptions): Promise; - /** - * Returns an async iterator that watches for changes on `filename`, where `filename`is either a file or a directory. - * - * ```js - * const { watch } = require('fs/promises'); - * - * const ac = new AbortController(); - * const { signal } = ac; - * setTimeout(() => ac.abort(), 10000); - * - * (async () => { - * try { - * const watcher = watch(__filename, { signal }); - * for await (const event of watcher) - * console.log(event); - * } catch (err) { - * if (err.name === 'AbortError') - * return; - * throw err; - * } - * })(); - * ``` - * - * On most platforms, `'rename'` is emitted whenever a filename appears or - * disappears in the directory. - * - * All the `caveats` for `fs.watch()` also apply to `fsPromises.watch()`. - * @since v15.9.0, v14.18.0 - * @return of objects with the properties: - */ - function watch( - filename: PathLike, - options: - | (WatchOptions & { - encoding: 'buffer'; - }) - | 'buffer' - ): AsyncIterable>; - /** - * Watch for changes on `filename`, where `filename` is either a file or a directory, returning an `FSWatcher`. - * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol. - * @param options Either the encoding for the filename provided to the listener, or an object optionally specifying encoding, persistent, and recursive options. - * If `encoding` is not supplied, the default of `'utf8'` is used. - * If `persistent` is not supplied, the default of `true` is used. - * If `recursive` is not supplied, the default of `false` is used. - */ - function watch(filename: PathLike, options?: WatchOptions | BufferEncoding): AsyncIterable>; - /** - * Watch for changes on `filename`, where `filename` is either a file or a directory, returning an `FSWatcher`. - * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol. - * @param options Either the encoding for the filename provided to the listener, or an object optionally specifying encoding, persistent, and recursive options. - * If `encoding` is not supplied, the default of `'utf8'` is used. - * If `persistent` is not supplied, the default of `true` is used. - * If `recursive` is not supplied, the default of `false` is used. - */ - function watch(filename: PathLike, options: WatchOptions | string): AsyncIterable> | AsyncIterable>; - /** - * Asynchronously copies the entire directory structure from `src` to `dest`, - * including subdirectories and files. - * - * When copying a directory to another directory, globs are not supported and - * behavior is similar to `cp dir1/ dir2/`. - * @since v16.7.0 - * @experimental - * @param src source path to copy. - * @param dest destination path to copy to. - * @return Fulfills with `undefined` upon success. - */ - function cp(source: string | URL, destination: string | URL, opts?: CopyOptions): Promise; -} -declare module 'node:fs/promises' { - export * from 'fs/promises'; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/globals.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/globals.d.ts deleted file mode 100755 index f401d95a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/globals.d.ts +++ /dev/null @@ -1,294 +0,0 @@ -// Declare "static" methods in Error -interface ErrorConstructor { - /** Create .stack property on a target object */ - captureStackTrace(targetObject: object, constructorOpt?: Function): void; - - /** - * Optional override for formatting stack traces - * - * @see https://v8.dev/docs/stack-trace-api#customizing-stack-traces - */ - prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined; - - stackTraceLimit: number; -} - -/*-----------------------------------------------* - * * - * GLOBAL * - * * - ------------------------------------------------*/ - -// For backwards compability -interface NodeRequire extends NodeJS.Require { } -interface RequireResolve extends NodeJS.RequireResolve { } -interface NodeModule extends NodeJS.Module { } - -declare var process: NodeJS.Process; -declare var console: Console; - -declare var __filename: string; -declare var __dirname: string; - -declare var require: NodeRequire; -declare var module: NodeModule; - -// Same as module.exports -declare var exports: any; - -/** - * Only available if `--expose-gc` is passed to the process. - */ -declare var gc: undefined | (() => void); - -//#region borrowed -// from https://github.com/microsoft/TypeScript/blob/38da7c600c83e7b31193a62495239a0fe478cb67/lib/lib.webworker.d.ts#L633 until moved to separate lib -/** A controller object that allows you to abort one or more DOM requests as and when desired. */ -interface AbortController { - /** - * Returns the AbortSignal object associated with this object. - */ - - readonly signal: AbortSignal; - /** - * Invoking this method will set this object's AbortSignal's aborted flag and signal to any observers that the associated activity is to be aborted. - */ - abort(): void; -} - -/** A signal object that allows you to communicate with a DOM request (such as a Fetch) and abort it if required via an AbortController object. */ -interface AbortSignal extends EventTarget { - /** - * Returns true if this AbortSignal's AbortController has signaled to abort, and false otherwise. - */ - readonly aborted: boolean; -} - -declare var AbortController: { - prototype: AbortController; - new(): AbortController; -}; - -declare var AbortSignal: { - prototype: AbortSignal; - new(): AbortSignal; - // TODO: Add abort() static -}; -//#endregion borrowed - -//#region ArrayLike.at() -interface RelativeIndexable { - /** - * Takes an integer value and returns the item at that index, - * allowing for positive and negative integers. - * Negative integers count back from the last item in the array. - */ - at(index: number): T | undefined; -} -interface String extends RelativeIndexable {} -interface Array extends RelativeIndexable {} -interface Int8Array extends RelativeIndexable {} -interface Uint8Array extends RelativeIndexable {} -interface Uint8ClampedArray extends RelativeIndexable {} -interface Int16Array extends RelativeIndexable {} -interface Uint16Array extends RelativeIndexable {} -interface Int32Array extends RelativeIndexable {} -interface Uint32Array extends RelativeIndexable {} -interface Float32Array extends RelativeIndexable {} -interface Float64Array extends RelativeIndexable {} -interface BigInt64Array extends RelativeIndexable {} -interface BigUint64Array extends RelativeIndexable {} -//#endregion ArrayLike.at() end - -/** - * @since v17.0.0 - * - * Creates a deep clone of an object. - */ -declare function structuredClone( - value: T, - transfer?: { transfer: ReadonlyArray }, -): T; - -/*----------------------------------------------* -* * -* GLOBAL INTERFACES * -* * -*-----------------------------------------------*/ -declare namespace NodeJS { - interface CallSite { - /** - * Value of "this" - */ - getThis(): unknown; - - /** - * Type of "this" as a string. - * This is the name of the function stored in the constructor field of - * "this", if available. Otherwise the object's [[Class]] internal - * property. - */ - getTypeName(): string | null; - - /** - * Current function - */ - getFunction(): Function | undefined; - - /** - * Name of the current function, typically its name property. - * If a name property is not available an attempt will be made to try - * to infer a name from the function's context. - */ - getFunctionName(): string | null; - - /** - * Name of the property [of "this" or one of its prototypes] that holds - * the current function - */ - getMethodName(): string | null; - - /** - * Name of the script [if this function was defined in a script] - */ - getFileName(): string | null; - - /** - * Current line number [if this function was defined in a script] - */ - getLineNumber(): number | null; - - /** - * Current column number [if this function was defined in a script] - */ - getColumnNumber(): number | null; - - /** - * A call site object representing the location where eval was called - * [if this function was created using a call to eval] - */ - getEvalOrigin(): string | undefined; - - /** - * Is this a toplevel invocation, that is, is "this" the global object? - */ - isToplevel(): boolean; - - /** - * Does this call take place in code defined by a call to eval? - */ - isEval(): boolean; - - /** - * Is this call in native V8 code? - */ - isNative(): boolean; - - /** - * Is this a constructor call? - */ - isConstructor(): boolean; - } - - interface ErrnoException extends Error { - errno?: number | undefined; - code?: string | undefined; - path?: string | undefined; - syscall?: string | undefined; - } - - interface ReadableStream extends EventEmitter { - readable: boolean; - read(size?: number): string | Buffer; - setEncoding(encoding: BufferEncoding): this; - pause(): this; - resume(): this; - isPaused(): boolean; - pipe(destination: T, options?: { end?: boolean | undefined; }): T; - unpipe(destination?: WritableStream): this; - unshift(chunk: string | Uint8Array, encoding?: BufferEncoding): void; - wrap(oldStream: ReadableStream): this; - [Symbol.asyncIterator](): AsyncIterableIterator; - } - - interface WritableStream extends EventEmitter { - writable: boolean; - write(buffer: Uint8Array | string, cb?: (err?: Error | null) => void): boolean; - write(str: string, encoding?: BufferEncoding, cb?: (err?: Error | null) => void): boolean; - end(cb?: () => void): this; - end(data: string | Uint8Array, cb?: () => void): this; - end(str: string, encoding?: BufferEncoding, cb?: () => void): this; - } - - interface ReadWriteStream extends ReadableStream, WritableStream { } - - interface RefCounted { - ref(): this; - unref(): this; - } - - type TypedArray = - | Uint8Array - | Uint8ClampedArray - | Uint16Array - | Uint32Array - | Int8Array - | Int16Array - | Int32Array - | BigUint64Array - | BigInt64Array - | Float32Array - | Float64Array; - type ArrayBufferView = TypedArray | DataView; - - interface Require { - (id: string): any; - resolve: RequireResolve; - cache: Dict; - /** - * @deprecated - */ - extensions: RequireExtensions; - main: Module | undefined; - } - - interface RequireResolve { - (id: string, options?: { paths?: string[] | undefined; }): string; - paths(request: string): string[] | null; - } - - interface RequireExtensions extends Dict<(m: Module, filename: string) => any> { - '.js': (m: Module, filename: string) => any; - '.json': (m: Module, filename: string) => any; - '.node': (m: Module, filename: string) => any; - } - interface Module { - /** - * `true` if the module is running during the Node.js preload - */ - isPreloading: boolean; - exports: any; - require: Require; - id: string; - filename: string; - loaded: boolean; - /** @deprecated since v14.6.0 Please use `require.main` and `module.children` instead. */ - parent: Module | null | undefined; - children: Module[]; - /** - * @since v11.14.0 - * - * The directory name of the module. This is usually the same as the path.dirname() of the module.id. - */ - path: string; - paths: string[]; - } - - interface Dict { - [key: string]: T | undefined; - } - - interface ReadOnlyDict { - readonly [key: string]: T | undefined; - } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/globals.global.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/globals.global.d.ts deleted file mode 100755 index ef1198c0..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/globals.global.d.ts +++ /dev/null @@ -1 +0,0 @@ -declare var global: typeof globalThis; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/http.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/http.d.ts deleted file mode 100755 index af826c16..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/http.d.ts +++ /dev/null @@ -1,1614 +0,0 @@ -/** - * To use the HTTP server and client one must `require('http')`. - * - * The HTTP interfaces in Node.js are designed to support many features - * of the protocol which have been traditionally difficult to use. - * In particular, large, possibly chunk-encoded, messages. The interface is - * careful to never buffer entire requests or responses, so the - * user is able to stream data. - * - * HTTP message headers are represented by an object like this: - * - * ```js - * { 'content-length': '123', - * 'content-type': 'text/plain', - * 'connection': 'keep-alive', - * 'host': 'example.com', - * 'accept': '*' } - * ``` - * - * Keys are lowercased. Values are not modified. - * - * In order to support the full spectrum of possible HTTP applications, the Node.js - * HTTP API is very low-level. It deals with stream handling and message - * parsing only. It parses a message into headers and body but it does not - * parse the actual headers or the body. - * - * See `message.headers` for details on how duplicate headers are handled. - * - * The raw headers as they were received are retained in the `rawHeaders`property, which is an array of `[key, value, key2, value2, ...]`. For - * example, the previous message header object might have a `rawHeaders`list like the following: - * - * ```js - * [ 'ConTent-Length', '123456', - * 'content-LENGTH', '123', - * 'content-type', 'text/plain', - * 'CONNECTION', 'keep-alive', - * 'Host', 'example.com', - * 'accepT', '*' ] - * ``` - * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/http.js) - */ -declare module 'http' { - import * as stream from 'node:stream'; - import { URL } from 'node:url'; - import { TcpSocketConnectOpts, Socket, Server as NetServer, LookupFunction } from 'node:net'; - // incoming headers will never contain number - interface IncomingHttpHeaders extends NodeJS.Dict { - accept?: string | undefined; - 'accept-language'?: string | undefined; - 'accept-patch'?: string | undefined; - 'accept-ranges'?: string | undefined; - 'access-control-allow-credentials'?: string | undefined; - 'access-control-allow-headers'?: string | undefined; - 'access-control-allow-methods'?: string | undefined; - 'access-control-allow-origin'?: string | undefined; - 'access-control-expose-headers'?: string | undefined; - 'access-control-max-age'?: string | undefined; - 'access-control-request-headers'?: string | undefined; - 'access-control-request-method'?: string | undefined; - age?: string | undefined; - allow?: string | undefined; - 'alt-svc'?: string | undefined; - authorization?: string | undefined; - 'cache-control'?: string | undefined; - connection?: string | undefined; - 'content-disposition'?: string | undefined; - 'content-encoding'?: string | undefined; - 'content-language'?: string | undefined; - 'content-length'?: string | undefined; - 'content-location'?: string | undefined; - 'content-range'?: string | undefined; - 'content-type'?: string | undefined; - cookie?: string | undefined; - date?: string | undefined; - etag?: string | undefined; - expect?: string | undefined; - expires?: string | undefined; - forwarded?: string | undefined; - from?: string | undefined; - host?: string | undefined; - 'if-match'?: string | undefined; - 'if-modified-since'?: string | undefined; - 'if-none-match'?: string | undefined; - 'if-unmodified-since'?: string | undefined; - 'last-modified'?: string | undefined; - location?: string | undefined; - origin?: string | undefined; - pragma?: string | undefined; - 'proxy-authenticate'?: string | undefined; - 'proxy-authorization'?: string | undefined; - 'public-key-pins'?: string | undefined; - range?: string | undefined; - referer?: string | undefined; - 'retry-after'?: string | undefined; - 'sec-websocket-accept'?: string | undefined; - 'sec-websocket-extensions'?: string | undefined; - 'sec-websocket-key'?: string | undefined; - 'sec-websocket-protocol'?: string | undefined; - 'sec-websocket-version'?: string | undefined; - 'set-cookie'?: string[] | undefined; - 'strict-transport-security'?: string | undefined; - tk?: string | undefined; - trailer?: string | undefined; - 'transfer-encoding'?: string | undefined; - upgrade?: string | undefined; - 'user-agent'?: string | undefined; - vary?: string | undefined; - via?: string | undefined; - warning?: string | undefined; - 'www-authenticate'?: string | undefined; - } - // outgoing headers allows numbers (as they are converted internally to strings) - type OutgoingHttpHeader = number | string | string[]; - interface OutgoingHttpHeaders extends NodeJS.Dict {} - interface ClientRequestArgs { - signal?: AbortSignal | undefined; - protocol?: string | null | undefined; - host?: string | null | undefined; - hostname?: string | null | undefined; - family?: number | undefined; - port?: number | string | null | undefined; - defaultPort?: number | string | undefined; - localAddress?: string | undefined; - socketPath?: string | undefined; - /** - * @default 8192 - */ - maxHeaderSize?: number | undefined; - method?: string | undefined; - path?: string | null | undefined; - headers?: OutgoingHttpHeaders | undefined; - auth?: string | null | undefined; - agent?: Agent | boolean | undefined; - _defaultAgent?: Agent | undefined; - timeout?: number | undefined; - setHost?: boolean | undefined; - // https://github.com/nodejs/node/blob/master/lib/_http_client.js#L278 - createConnection?: - | ((options: ClientRequestArgs, oncreate: (err: Error, socket: Socket) => void) => Socket) - | undefined; - lookup?: LookupFunction | undefined; - } - interface ServerOptions< - Request extends typeof IncomingMessage = typeof IncomingMessage, - Response extends typeof ServerResponse = typeof ServerResponse, - > { - IncomingMessage?: Request | undefined; - ServerResponse?: Response | undefined; - /** - * Optionally overrides the value of - * `--max-http-header-size` for requests received by this server, i.e. - * the maximum length of request headers in bytes. - * @default 8192 - */ - maxHeaderSize?: number | undefined; - /** - * Use an insecure HTTP parser that accepts invalid HTTP headers when true. - * Using the insecure parser should be avoided. - * See --insecure-http-parser for more information. - * @default false - */ - insecureHTTPParser?: boolean | undefined; - /** - * If set to `true`, it disables the use of Nagle's algorithm immediately after a new incoming connection is received. - * @default false - * @since v16.5.0 - */ - noDelay?: boolean | undefined; - /** - * If set to `true`, it enables keep-alive functionality on the socket immediately after a new incoming connection is received, - * similarly on what is done in `socket.setKeepAlive([enable][, initialDelay])`. - * @default false - * @since v16.5.0 - */ - keepAlive?: boolean | undefined; - /** - * If set to a positive number, it sets the initial delay before the first keepalive probe is sent on an idle socket. - * @default 0 - * @since v16.5.0 - */ - keepAliveInitialDelay?: number | undefined; - } - type RequestListener< - Request extends typeof IncomingMessage = typeof IncomingMessage, - Response extends typeof ServerResponse = typeof ServerResponse, - > = (req: InstanceType, res: InstanceType & { req: InstanceType }) => void; - /** - * @since v0.1.17 - */ - class Server< - Request extends typeof IncomingMessage = typeof IncomingMessage, - Response extends typeof ServerResponse = typeof ServerResponse, - > extends NetServer { - constructor(requestListener?: RequestListener); - constructor(options: ServerOptions, requestListener?: RequestListener); - /** - * Sets the timeout value for sockets, and emits a `'timeout'` event on - * the Server object, passing the socket as an argument, if a timeout - * occurs. - * - * If there is a `'timeout'` event listener on the Server object, then it - * will be called with the timed-out socket as an argument. - * - * By default, the Server does not timeout sockets. However, if a callback - * is assigned to the Server's `'timeout'` event, timeouts must be handled - * explicitly. - * @since v0.9.12 - * @param [msecs=0 (no timeout)] - */ - setTimeout(msecs?: number, callback?: () => void): this; - setTimeout(callback: () => void): this; - /** - * Limits maximum incoming headers count. If set to 0, no limit will be applied. - * @since v0.7.0 - */ - maxHeadersCount: number | null; - /** - * The maximum number of requests socket can handle - * before closing keep alive connection. - * - * A value of `0` will disable the limit. - * - * When the limit is reached it will set the `Connection` header value to `close`, - * but will not actually close the connection, subsequent requests sent - * after the limit is reached will get `503 Service Unavailable` as a response. - * @since v16.10.0 - */ - maxRequestsPerSocket: number | null; - /** - * The number of milliseconds of inactivity before a socket is presumed - * to have timed out. - * - * A value of `0` will disable the timeout behavior on incoming connections. - * - * The socket timeout logic is set up on connection, so changing this - * value only affects new connections to the server, not any existing connections. - * @since v0.9.12 - */ - timeout: number; - /** - * Limit the amount of time the parser will wait to receive the complete HTTP - * headers. - * - * If the timeout expires, the server responds with status 408 without - * forwarding the request to the request listener and then closes the connection. - * - * It must be set to a non-zero value (e.g. 120 seconds) to protect against - * potential Denial-of-Service attacks in case the server is deployed without a - * reverse proxy in front. - * @since v11.3.0, v10.14.0 - */ - headersTimeout: number; - /** - * The number of milliseconds of inactivity a server needs to wait for additional - * incoming data, after it has finished writing the last response, before a socket - * will be destroyed. If the server receives new data before the keep-alive - * timeout has fired, it will reset the regular inactivity timeout, i.e.,`server.timeout`. - * - * A value of `0` will disable the keep-alive timeout behavior on incoming - * connections. - * A value of `0` makes the http server behave similarly to Node.js versions prior - * to 8.0.0, which did not have a keep-alive timeout. - * - * The socket timeout logic is set up on connection, so changing this value only - * affects new connections to the server, not any existing connections. - * @since v8.0.0 - */ - keepAliveTimeout: number; - /** - * Sets the timeout value in milliseconds for receiving the entire request from - * the client. - * - * If the timeout expires, the server responds with status 408 without - * forwarding the request to the request listener and then closes the connection. - * - * It must be set to a non-zero value (e.g. 120 seconds) to protect against - * potential Denial-of-Service attacks in case the server is deployed without a - * reverse proxy in front. - * @since v14.11.0 - */ - requestTimeout: number; - /** - * Closes all connections connected to this server. - * @since v18.2.0 - */ - closeAllConnections(): void; - /** - * Closes all connections connected to this server which are not sending a request or waiting for a response. - * @since v18.2.0 - */ - closeIdleConnections(): void; - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: 'close', listener: () => void): this; - addListener(event: 'connection', listener: (socket: Socket) => void): this; - addListener(event: 'error', listener: (err: Error) => void): this; - addListener(event: 'listening', listener: () => void): this; - addListener(event: 'checkContinue', listener: RequestListener): this; - addListener(event: 'checkExpectation', listener: RequestListener): this; - addListener(event: 'clientError', listener: (err: Error, socket: stream.Duplex) => void): this; - addListener( - event: 'connect', - listener: (req: InstanceType, socket: stream.Duplex, head: Buffer) => void, - ): this; - addListener(event: 'request', listener: RequestListener): this; - addListener( - event: 'upgrade', - listener: (req: InstanceType, socket: stream.Duplex, head: Buffer) => void, - ): this; - emit(event: string, ...args: any[]): boolean; - emit(event: 'close'): boolean; - emit(event: 'connection', socket: Socket): boolean; - emit(event: 'error', err: Error): boolean; - emit(event: 'listening'): boolean; - emit( - event: 'checkContinue', - req: InstanceType, - res: InstanceType & { req: InstanceType }, - ): boolean; - emit( - event: 'checkExpectation', - req: InstanceType, - res: InstanceType & { req: InstanceType }, - ): boolean; - emit(event: 'clientError', err: Error, socket: stream.Duplex): boolean; - emit(event: 'connect', req: InstanceType, socket: stream.Duplex, head: Buffer): boolean; - emit( - event: 'request', - req: InstanceType, - res: InstanceType & { req: InstanceType }, - ): boolean; - emit(event: 'upgrade', req: InstanceType, socket: stream.Duplex, head: Buffer): boolean; - on(event: string, listener: (...args: any[]) => void): this; - on(event: 'close', listener: () => void): this; - on(event: 'connection', listener: (socket: Socket) => void): this; - on(event: 'error', listener: (err: Error) => void): this; - on(event: 'listening', listener: () => void): this; - on(event: 'checkContinue', listener: RequestListener): this; - on(event: 'checkExpectation', listener: RequestListener): this; - on(event: 'clientError', listener: (err: Error, socket: stream.Duplex) => void): this; - on(event: 'connect', listener: (req: InstanceType, socket: stream.Duplex, head: Buffer) => void): this; - on(event: 'request', listener: RequestListener): this; - on(event: 'upgrade', listener: (req: InstanceType, socket: stream.Duplex, head: Buffer) => void): this; - once(event: string, listener: (...args: any[]) => void): this; - once(event: 'close', listener: () => void): this; - once(event: 'connection', listener: (socket: Socket) => void): this; - once(event: 'error', listener: (err: Error) => void): this; - once(event: 'listening', listener: () => void): this; - once(event: 'checkContinue', listener: RequestListener): this; - once(event: 'checkExpectation', listener: RequestListener): this; - once(event: 'clientError', listener: (err: Error, socket: stream.Duplex) => void): this; - once( - event: 'connect', - listener: (req: InstanceType, socket: stream.Duplex, head: Buffer) => void, - ): this; - once(event: 'request', listener: RequestListener): this; - once( - event: 'upgrade', - listener: (req: InstanceType, socket: stream.Duplex, head: Buffer) => void, - ): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: 'close', listener: () => void): this; - prependListener(event: 'connection', listener: (socket: Socket) => void): this; - prependListener(event: 'error', listener: (err: Error) => void): this; - prependListener(event: 'listening', listener: () => void): this; - prependListener(event: 'checkContinue', listener: RequestListener): this; - prependListener(event: 'checkExpectation', listener: RequestListener): this; - prependListener(event: 'clientError', listener: (err: Error, socket: stream.Duplex) => void): this; - prependListener( - event: 'connect', - listener: (req: InstanceType, socket: stream.Duplex, head: Buffer) => void, - ): this; - prependListener(event: 'request', listener: RequestListener): this; - prependListener( - event: 'upgrade', - listener: (req: InstanceType, socket: stream.Duplex, head: Buffer) => void, - ): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: 'close', listener: () => void): this; - prependOnceListener(event: 'connection', listener: (socket: Socket) => void): this; - prependOnceListener(event: 'error', listener: (err: Error) => void): this; - prependOnceListener(event: 'listening', listener: () => void): this; - prependOnceListener(event: 'checkContinue', listener: RequestListener): this; - prependOnceListener(event: 'checkExpectation', listener: RequestListener): this; - prependOnceListener(event: 'clientError', listener: (err: Error, socket: stream.Duplex) => void): this; - prependOnceListener( - event: 'connect', - listener: (req: InstanceType, socket: stream.Duplex, head: Buffer) => void, - ): this; - prependOnceListener(event: 'request', listener: RequestListener): this; - prependOnceListener( - event: 'upgrade', - listener: (req: InstanceType, socket: stream.Duplex, head: Buffer) => void, - ): this; - } - /** - * This class serves as the parent class of {@link ClientRequest} and {@link ServerResponse}. It is an abstract of outgoing message from - * the perspective of the participants of HTTP transaction. - * @since v0.1.17 - */ - class OutgoingMessage extends stream.Writable { - readonly req: Request; - chunkedEncoding: boolean; - shouldKeepAlive: boolean; - useChunkedEncodingByDefault: boolean; - sendDate: boolean; - /** - * @deprecated Use `writableEnded` instead. - */ - finished: boolean; - /** - * Read-only. `true` if the headers were sent, otherwise `false`. - * @since v0.9.3 - */ - readonly headersSent: boolean; - /** - * Aliases of `outgoingMessage.socket` - * @since v0.3.0 - * @deprecated Since v15.12.0,v14.17.1 - Use `socket` instead. - */ - readonly connection: Socket | null; - /** - * Reference to the underlying socket. Usually, users will not want to access - * this property. - * - * After calling `outgoingMessage.end()`, this property will be nulled. - * @since v0.3.0 - */ - readonly socket: Socket | null; - constructor(); - /** - * Once a socket is associated with the message and is connected,`socket.setTimeout()` will be called with `msecs` as the first parameter. - * @since v0.9.12 - * @param callback Optional function to be called when a timeout occurs. Same as binding to the `timeout` event. - */ - setTimeout(msecs: number, callback?: () => void): this; - /** - * Sets a single header value for the header object. - * @since v0.4.0 - * @param name Header name - * @param value Header value - */ - setHeader(name: string, value: number | string | ReadonlyArray): this; - /** - * Gets the value of HTTP header with the given name. If such a name doesn't - * exist in message, it will be `undefined`. - * @since v0.4.0 - * @param name Name of header - */ - getHeader(name: string): number | string | string[] | undefined; - /** - * Returns a shallow copy of the current outgoing headers. Since a shallow - * copy is used, array values may be mutated without additional calls to - * various header-related HTTP module methods. The keys of the returned - * object are the header names and the values are the respective header - * values. All header names are lowercase. - * - * The object returned by the `outgoingMessage.getHeaders()` method does - * not prototypically inherit from the JavaScript Object. This means that - * typical Object methods such as `obj.toString()`, `obj.hasOwnProperty()`, - * and others are not defined and will not work. - * - * ```js - * outgoingMessage.setHeader('Foo', 'bar'); - * outgoingMessage.setHeader('Set-Cookie', ['foo=bar', 'bar=baz']); - * - * const headers = outgoingMessage.getHeaders(); - * // headers === { foo: 'bar', 'set-cookie': ['foo=bar', 'bar=baz'] } - * ``` - * @since v7.7.0 - */ - getHeaders(): OutgoingHttpHeaders; - /** - * Returns an array of names of headers of the outgoing outgoingMessage. All - * names are lowercase. - * @since v7.7.0 - */ - getHeaderNames(): string[]; - /** - * Returns `true` if the header identified by `name` is currently set in the - * outgoing headers. The header name is case-insensitive. - * - * ```js - * const hasContentType = outgoingMessage.hasHeader('content-type'); - * ``` - * @since v7.7.0 - */ - hasHeader(name: string): boolean; - /** - * Removes a header that is queued for implicit sending. - * - * ```js - * outgoingMessage.removeHeader('Content-Encoding'); - * ``` - * @since v0.4.0 - * @param name Header name - */ - removeHeader(name: string): void; - /** - * Adds HTTP trailers (headers but at the end of the message) to the message. - * - * Trailers are **only** be emitted if the message is chunked encoded. If not, - * the trailer will be silently discarded. - * - * HTTP requires the `Trailer` header to be sent to emit trailers, - * with a list of header fields in its value, e.g. - * - * ```js - * message.writeHead(200, { 'Content-Type': 'text/plain', - * 'Trailer': 'Content-MD5' }); - * message.write(fileData); - * message.addTrailers({ 'Content-MD5': '7895bf4b8828b55ceaf47747b4bca667' }); - * message.end(); - * ``` - * - * Attempting to set a header field name or value that contains invalid characters - * will result in a `TypeError` being thrown. - * @since v0.3.0 - */ - addTrailers(headers: OutgoingHttpHeaders | ReadonlyArray<[string, string]>): void; - /** - * Compulsorily flushes the message headers - * - * For efficiency reason, Node.js normally buffers the message headers - * until `outgoingMessage.end()` is called or the first chunk of message data - * is written. It then tries to pack the headers and data into a single TCP - * packet. - * - * It is usually desired (it saves a TCP round-trip), but not when the first - * data is not sent until possibly much later. `outgoingMessage.flushHeaders()`bypasses the optimization and kickstarts the request. - * @since v1.6.0 - */ - flushHeaders(): void; - } - /** - * This object is created internally by an HTTP server, not by the user. It is - * passed as the second parameter to the `'request'` event. - * @since v0.1.17 - */ - class ServerResponse extends OutgoingMessage { - /** - * When using implicit headers (not calling `response.writeHead()` explicitly), - * this property controls the status code that will be sent to the client when - * the headers get flushed. - * - * ```js - * response.statusCode = 404; - * ``` - * - * After response header was sent to the client, this property indicates the - * status code which was sent out. - * @since v0.4.0 - */ - statusCode: number; - /** - * When using implicit headers (not calling `response.writeHead()` explicitly), - * this property controls the status message that will be sent to the client when - * the headers get flushed. If this is left as `undefined` then the standard - * message for the status code will be used. - * - * ```js - * response.statusMessage = 'Not found'; - * ``` - * - * After response header was sent to the client, this property indicates the - * status message which was sent out. - * @since v0.11.8 - */ - statusMessage: string; - constructor(req: Request); - assignSocket(socket: Socket): void; - detachSocket(socket: Socket): void; - /** - * Sends an HTTP/1.1 100 Continue message to the client, indicating that - * the request body should be sent. See the `'checkContinue'` event on`Server`. - * @since v0.3.0 - */ - writeContinue(callback?: () => void): void; - /** - * Sends an HTTP/1.1 103 Early Hints message to the client with a Link header, - * indicating that the user agent can preload/preconnect the linked resources. - * The `hints` is an object containing the values of headers to be sent with - * early hints message. The optional `callback` argument will be called when - * the response message has been written. - * - * Example: - * - * ```js - * const earlyHintsLink = '; rel=preload; as=style'; - * response.writeEarlyHints({ - * 'link': earlyHintsLink, - * }); - * - * const earlyHintsLinks = [ - * '; rel=preload; as=style', - * '; rel=preload; as=script', - * ]; - * response.writeEarlyHints({ - * 'link': earlyHintsLinks, - * 'x-trace-id': 'id for diagnostics' - * }); - * - * const earlyHintsCallback = () => console.log('early hints message sent'); - * response.writeEarlyHints({ - * 'link': earlyHintsLinks - * }, earlyHintsCallback); - * ``` - * - * @since v18.11.0 - * @param hints An object containing the values of headers - * @param callback Will be called when the response message has been written - */ - writeEarlyHints(hints: Record, callback?: () => void): void; - /** - * Sends a response header to the request. The status code is a 3-digit HTTP - * status code, like `404`. The last argument, `headers`, are the response headers. - * Optionally one can give a human-readable `statusMessage` as the second - * argument. - * - * `headers` may be an `Array` where the keys and values are in the same list. - * It is _not_ a list of tuples. So, the even-numbered offsets are key values, - * and the odd-numbered offsets are the associated values. The array is in the same - * format as `request.rawHeaders`. - * - * Returns a reference to the `ServerResponse`, so that calls can be chained. - * - * ```js - * const body = 'hello world'; - * response - * .writeHead(200, { - * 'Content-Length': Buffer.byteLength(body), - * 'Content-Type': 'text/plain' - * }) - * .end(body); - * ``` - * - * This method must only be called once on a message and it must - * be called before `response.end()` is called. - * - * If `response.write()` or `response.end()` are called before calling - * this, the implicit/mutable headers will be calculated and call this function. - * - * When headers have been set with `response.setHeader()`, they will be merged - * with any headers passed to `response.writeHead()`, with the headers passed - * to `response.writeHead()` given precedence. - * - * If this method is called and `response.setHeader()` has not been called, - * it will directly write the supplied header values onto the network channel - * without caching internally, and the `response.getHeader()` on the header - * will not yield the expected result. If progressive population of headers is - * desired with potential future retrieval and modification, use `response.setHeader()` instead. - * - * ```js - * // Returns content-type = text/plain - * const server = http.createServer((req, res) => { - * res.setHeader('Content-Type', 'text/html'); - * res.setHeader('X-Foo', 'bar'); - * res.writeHead(200, { 'Content-Type': 'text/plain' }); - * res.end('ok'); - * }); - * ``` - * - * `Content-Length` is given in bytes, not characters. Use `Buffer.byteLength()` to determine the length of the body in bytes. Node.js - * does not check whether `Content-Length` and the length of the body which has - * been transmitted are equal or not. - * - * Attempting to set a header field name or value that contains invalid characters - * will result in a `TypeError` being thrown. - * @since v0.1.30 - */ - writeHead( - statusCode: number, - statusMessage?: string, - headers?: OutgoingHttpHeaders | OutgoingHttpHeader[], - ): this; - writeHead(statusCode: number, headers?: OutgoingHttpHeaders | OutgoingHttpHeader[]): this; - /** - * Sends an HTTP/1.1 102 Processing message to the client, indicating that - * the request body should be sent. - * @since v10.0.0 - */ - writeProcessing(): void; - } - interface InformationEvent { - statusCode: number; - statusMessage: string; - httpVersion: string; - httpVersionMajor: number; - httpVersionMinor: number; - headers: IncomingHttpHeaders; - rawHeaders: string[]; - } - /** - * This object is created internally and returned from {@link request}. It - * represents an _in-progress_ request whose header has already been queued. The - * header is still mutable using the `setHeader(name, value)`,`getHeader(name)`, `removeHeader(name)` API. The actual header will - * be sent along with the first data chunk or when calling `request.end()`. - * - * To get the response, add a listener for `'response'` to the request object.`'response'` will be emitted from the request object when the response - * headers have been received. The `'response'` event is executed with one - * argument which is an instance of {@link IncomingMessage}. - * - * During the `'response'` event, one can add listeners to the - * response object; particularly to listen for the `'data'` event. - * - * If no `'response'` handler is added, then the response will be - * entirely discarded. However, if a `'response'` event handler is added, - * then the data from the response object **must** be consumed, either by - * calling `response.read()` whenever there is a `'readable'` event, or - * by adding a `'data'` handler, or by calling the `.resume()` method. - * Until the data is consumed, the `'end'` event will not fire. Also, until - * the data is read it will consume memory that can eventually lead to a - * 'process out of memory' error. - * - * For backward compatibility, `res` will only emit `'error'` if there is an`'error'` listener registered. - * - * Node.js does not check whether Content-Length and the length of the - * body which has been transmitted are equal or not. - * @since v0.1.17 - */ - class ClientRequest extends OutgoingMessage { - /** - * The `request.aborted` property will be `true` if the request has - * been aborted. - * @since v0.11.14 - * @deprecated Since v17.0.0,v16.12.0 - Check `destroyed` instead. - */ - aborted: boolean; - /** - * The request host. - * @since v14.5.0, v12.19.0 - */ - host: string; - /** - * The request protocol. - * @since v14.5.0, v12.19.0 - */ - protocol: string; - /** - * When sending request through a keep-alive enabled agent, the underlying socket - * might be reused. But if server closes connection at unfortunate time, client - * may run into a 'ECONNRESET' error. - * - * ```js - * const http = require('http'); - * - * // Server has a 5 seconds keep-alive timeout by default - * http - * .createServer((req, res) => { - * res.write('hello\n'); - * res.end(); - * }) - * .listen(3000); - * - * setInterval(() => { - * // Adapting a keep-alive agent - * http.get('http://localhost:3000', { agent }, (res) => { - * res.on('data', (data) => { - * // Do nothing - * }); - * }); - * }, 5000); // Sending request on 5s interval so it's easy to hit idle timeout - * ``` - * - * By marking a request whether it reused socket or not, we can do - * automatic error retry base on it. - * - * ```js - * const http = require('http'); - * const agent = new http.Agent({ keepAlive: true }); - * - * function retriableRequest() { - * const req = http - * .get('http://localhost:3000', { agent }, (res) => { - * // ... - * }) - * .on('error', (err) => { - * // Check if retry is needed - * if (req.reusedSocket && err.code === 'ECONNRESET') { - * retriableRequest(); - * } - * }); - * } - * - * retriableRequest(); - * ``` - * @since v13.0.0, v12.16.0 - */ - reusedSocket: boolean; - /** - * Limits maximum response headers count. If set to 0, no limit will be applied. - */ - maxHeadersCount: number; - constructor(url: string | URL | ClientRequestArgs, cb?: (res: IncomingMessage) => void); - /** - * The request method. - * @since v0.1.97 - */ - method: string; - /** - * The request path. - * @since v0.4.0 - */ - path: string; - /** - * Marks the request as aborting. Calling this will cause remaining data - * in the response to be dropped and the socket to be destroyed. - * @since v0.3.8 - * @deprecated Since v14.1.0,v13.14.0 - Use `destroy` instead. - */ - abort(): void; - onSocket(socket: Socket): void; - /** - * Once a socket is assigned to this request and is connected `socket.setTimeout()` will be called. - * @since v0.5.9 - * @param timeout Milliseconds before a request times out. - * @param callback Optional function to be called when a timeout occurs. Same as binding to the `'timeout'` event. - */ - setTimeout(timeout: number, callback?: () => void): this; - /** - * Once a socket is assigned to this request and is connected `socket.setNoDelay()` will be called. - * @since v0.5.9 - */ - setNoDelay(noDelay?: boolean): void; - /** - * Once a socket is assigned to this request and is connected `socket.setKeepAlive()` will be called. - * @since v0.5.9 - */ - setSocketKeepAlive(enable?: boolean, initialDelay?: number): void; - /** - * Returns an array containing the unique names of the current outgoing raw - * headers. Header names are returned with their exact casing being set. - * - * ```js - * request.setHeader('Foo', 'bar'); - * request.setHeader('Set-Cookie', ['foo=bar', 'bar=baz']); - * - * const headerNames = request.getRawHeaderNames(); - * // headerNames === ['Foo', 'Set-Cookie'] - * ``` - * @since v15.13.0, v14.17.0 - */ - getRawHeaderNames(): string[]; - /** - * @deprecated - */ - addListener(event: 'abort', listener: () => void): this; - addListener( - event: 'connect', - listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void, - ): this; - addListener(event: 'continue', listener: () => void): this; - addListener(event: 'information', listener: (info: InformationEvent) => void): this; - addListener(event: 'response', listener: (response: IncomingMessage) => void): this; - addListener(event: 'socket', listener: (socket: Socket) => void): this; - addListener(event: 'timeout', listener: () => void): this; - addListener( - event: 'upgrade', - listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void, - ): this; - addListener(event: 'close', listener: () => void): this; - addListener(event: 'drain', listener: () => void): this; - addListener(event: 'error', listener: (err: Error) => void): this; - addListener(event: 'finish', listener: () => void): this; - addListener(event: 'pipe', listener: (src: stream.Readable) => void): this; - addListener(event: 'unpipe', listener: (src: stream.Readable) => void): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - /** - * @deprecated - */ - on(event: 'abort', listener: () => void): this; - on(event: 'connect', listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this; - on(event: 'continue', listener: () => void): this; - on(event: 'information', listener: (info: InformationEvent) => void): this; - on(event: 'response', listener: (response: IncomingMessage) => void): this; - on(event: 'socket', listener: (socket: Socket) => void): this; - on(event: 'timeout', listener: () => void): this; - on(event: 'upgrade', listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this; - on(event: 'close', listener: () => void): this; - on(event: 'drain', listener: () => void): this; - on(event: 'error', listener: (err: Error) => void): this; - on(event: 'finish', listener: () => void): this; - on(event: 'pipe', listener: (src: stream.Readable) => void): this; - on(event: 'unpipe', listener: (src: stream.Readable) => void): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - /** - * @deprecated - */ - once(event: 'abort', listener: () => void): this; - once(event: 'connect', listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this; - once(event: 'continue', listener: () => void): this; - once(event: 'information', listener: (info: InformationEvent) => void): this; - once(event: 'response', listener: (response: IncomingMessage) => void): this; - once(event: 'socket', listener: (socket: Socket) => void): this; - once(event: 'timeout', listener: () => void): this; - once(event: 'upgrade', listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this; - once(event: 'close', listener: () => void): this; - once(event: 'drain', listener: () => void): this; - once(event: 'error', listener: (err: Error) => void): this; - once(event: 'finish', listener: () => void): this; - once(event: 'pipe', listener: (src: stream.Readable) => void): this; - once(event: 'unpipe', listener: (src: stream.Readable) => void): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - /** - * @deprecated - */ - prependListener(event: 'abort', listener: () => void): this; - prependListener( - event: 'connect', - listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void, - ): this; - prependListener(event: 'continue', listener: () => void): this; - prependListener(event: 'information', listener: (info: InformationEvent) => void): this; - prependListener(event: 'response', listener: (response: IncomingMessage) => void): this; - prependListener(event: 'socket', listener: (socket: Socket) => void): this; - prependListener(event: 'timeout', listener: () => void): this; - prependListener( - event: 'upgrade', - listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void, - ): this; - prependListener(event: 'close', listener: () => void): this; - prependListener(event: 'drain', listener: () => void): this; - prependListener(event: 'error', listener: (err: Error) => void): this; - prependListener(event: 'finish', listener: () => void): this; - prependListener(event: 'pipe', listener: (src: stream.Readable) => void): this; - prependListener(event: 'unpipe', listener: (src: stream.Readable) => void): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - /** - * @deprecated - */ - prependOnceListener(event: 'abort', listener: () => void): this; - prependOnceListener( - event: 'connect', - listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void, - ): this; - prependOnceListener(event: 'continue', listener: () => void): this; - prependOnceListener(event: 'information', listener: (info: InformationEvent) => void): this; - prependOnceListener(event: 'response', listener: (response: IncomingMessage) => void): this; - prependOnceListener(event: 'socket', listener: (socket: Socket) => void): this; - prependOnceListener(event: 'timeout', listener: () => void): this; - prependOnceListener( - event: 'upgrade', - listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void, - ): this; - prependOnceListener(event: 'close', listener: () => void): this; - prependOnceListener(event: 'drain', listener: () => void): this; - prependOnceListener(event: 'error', listener: (err: Error) => void): this; - prependOnceListener(event: 'finish', listener: () => void): this; - prependOnceListener(event: 'pipe', listener: (src: stream.Readable) => void): this; - prependOnceListener(event: 'unpipe', listener: (src: stream.Readable) => void): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - } - /** - * An `IncomingMessage` object is created by {@link Server} or {@link ClientRequest} and passed as the first argument to the `'request'` and `'response'` event respectively. It may be used to - * access response - * status, headers and data. - * - * Different from its `socket` value which is a subclass of `stream.Duplex`, the`IncomingMessage` itself extends `stream.Readable` and is created separately to - * parse and emit the incoming HTTP headers and payload, as the underlying socket - * may be reused multiple times in case of keep-alive. - * @since v0.1.17 - */ - class IncomingMessage extends stream.Readable { - constructor(socket: Socket); - /** - * The `message.aborted` property will be `true` if the request has - * been aborted. - * @since v10.1.0 - * @deprecated Since v17.0.0,v16.12.0 - Check `message.destroyed` from stream.Readable. - */ - aborted: boolean; - /** - * In case of server request, the HTTP version sent by the client. In the case of - * client response, the HTTP version of the connected-to server. - * Probably either `'1.1'` or `'1.0'`. - * - * Also `message.httpVersionMajor` is the first integer and`message.httpVersionMinor` is the second. - * @since v0.1.1 - */ - httpVersion: string; - httpVersionMajor: number; - httpVersionMinor: number; - /** - * The `message.complete` property will be `true` if a complete HTTP message has - * been received and successfully parsed. - * - * This property is particularly useful as a means of determining if a client or - * server fully transmitted a message before a connection was terminated: - * - * ```js - * const req = http.request({ - * host: '127.0.0.1', - * port: 8080, - * method: 'POST' - * }, (res) => { - * res.resume(); - * res.on('end', () => { - * if (!res.complete) - * console.error( - * 'The connection was terminated while the message was still being sent'); - * }); - * }); - * ``` - * @since v0.3.0 - */ - complete: boolean; - /** - * Alias for `message.socket`. - * @since v0.1.90 - * @deprecated Since v16.0.0 - Use `socket`. - */ - connection: Socket; - /** - * The `net.Socket` object associated with the connection. - * - * With HTTPS support, use `request.socket.getPeerCertificate()` to obtain the - * client's authentication details. - * - * This property is guaranteed to be an instance of the `net.Socket` class, - * a subclass of `stream.Duplex`, unless the user specified a socket - * type other than `net.Socket` or internally nulled. - * @since v0.3.0 - */ - socket: Socket; - /** - * The request/response headers object. - * - * Key-value pairs of header names and values. Header names are lower-cased. - * - * ```js - * // Prints something like: - * // - * // { 'user-agent': 'curl/7.22.0', - * // host: '127.0.0.1:8000', - * // accept: '*' } - * console.log(request.getHeaders()); - * ``` - * - * Duplicates in raw headers are handled in the following ways, depending on the - * header name: - * - * * Duplicates of `age`, `authorization`, `content-length`, `content-type`,`etag`, `expires`, `from`, `host`, `if-modified-since`, `if-unmodified-since`,`last-modified`, `location`, - * `max-forwards`, `proxy-authorization`, `referer`,`retry-after`, `server`, or `user-agent` are discarded. - * * `set-cookie` is always an array. Duplicates are added to the array. - * * For duplicate `cookie` headers, the values are joined together with '; '. - * * For all other headers, the values are joined together with ', '. - * @since v0.1.5 - */ - headers: IncomingHttpHeaders; - /** - * The raw request/response headers list exactly as they were received. - * - * The keys and values are in the same list. It is _not_ a - * list of tuples. So, the even-numbered offsets are key values, and the - * odd-numbered offsets are the associated values. - * - * Header names are not lowercased, and duplicates are not merged. - * - * ```js - * // Prints something like: - * // - * // [ 'user-agent', - * // 'this is invalid because there can be only one', - * // 'User-Agent', - * // 'curl/7.22.0', - * // 'Host', - * // '127.0.0.1:8000', - * // 'ACCEPT', - * // '*' ] - * console.log(request.rawHeaders); - * ``` - * @since v0.11.6 - */ - rawHeaders: string[]; - /** - * The request/response trailers object. Only populated at the `'end'` event. - * @since v0.3.0 - */ - trailers: NodeJS.Dict; - /** - * The raw request/response trailer keys and values exactly as they were - * received. Only populated at the `'end'` event. - * @since v0.11.6 - */ - rawTrailers: string[]; - /** - * Calls `message.socket.setTimeout(msecs, callback)`. - * @since v0.5.9 - */ - setTimeout(msecs: number, callback?: () => void): this; - /** - * **Only valid for request obtained from {@link Server}.** - * - * The request method as a string. Read only. Examples: `'GET'`, `'DELETE'`. - * @since v0.1.1 - */ - method?: string | undefined; - /** - * **Only valid for request obtained from {@link Server}.** - * - * Request URL string. This contains only the URL that is present in the actual - * HTTP request. Take the following request: - * - * ```http - * GET /status?name=ryan HTTP/1.1 - * Accept: text/plain - * ``` - * - * To parse the URL into its parts: - * - * ```js - * new URL(request.url, `http://${request.getHeaders().host}`); - * ``` - * - * When `request.url` is `'/status?name=ryan'` and`request.getHeaders().host` is `'localhost:3000'`: - * - * ```console - * $ node - * > new URL(request.url, `http://${request.getHeaders().host}`) - * URL { - * href: 'http://localhost:3000/status?name=ryan', - * origin: 'http://localhost:3000', - * protocol: 'http:', - * username: '', - * password: '', - * host: 'localhost:3000', - * hostname: 'localhost', - * port: '3000', - * pathname: '/status', - * search: '?name=ryan', - * searchParams: URLSearchParams { 'name' => 'ryan' }, - * hash: '' - * } - * ``` - * @since v0.1.90 - */ - url?: string | undefined; - /** - * **Only valid for response obtained from {@link ClientRequest}.** - * - * The 3-digit HTTP response status code. E.G. `404`. - * @since v0.1.1 - */ - statusCode?: number | undefined; - /** - * **Only valid for response obtained from {@link ClientRequest}.** - * - * The HTTP response status message (reason phrase). E.G. `OK` or `Internal Server Error`. - * @since v0.11.10 - */ - statusMessage?: string | undefined; - /** - * Calls `destroy()` on the socket that received the `IncomingMessage`. If `error`is provided, an `'error'` event is emitted on the socket and `error` is passed - * as an argument to any listeners on the event. - * @since v0.3.0 - */ - destroy(error?: Error): this; - } - interface AgentOptions extends Partial { - /** - * Keep sockets around in a pool to be used by other requests in the future. Default = false - */ - keepAlive?: boolean | undefined; - /** - * When using HTTP KeepAlive, how often to send TCP KeepAlive packets over sockets being kept alive. Default = 1000. - * Only relevant if keepAlive is set to true. - */ - keepAliveMsecs?: number | undefined; - /** - * Maximum number of sockets to allow per host. Default for Node 0.10 is 5, default for Node 0.12 is Infinity - */ - maxSockets?: number | undefined; - /** - * Maximum number of sockets allowed for all hosts in total. Each request will use a new socket until the maximum is reached. Default: Infinity. - */ - maxTotalSockets?: number | undefined; - /** - * Maximum number of sockets to leave open in a free state. Only relevant if keepAlive is set to true. Default = 256. - */ - maxFreeSockets?: number | undefined; - /** - * Socket timeout in milliseconds. This will set the timeout after the socket is connected. - */ - timeout?: number | undefined; - /** - * Scheduling strategy to apply when picking the next free socket to use. - * @default `lifo` - */ - scheduling?: 'fifo' | 'lifo' | undefined; - } - /** - * An `Agent` is responsible for managing connection persistence - * and reuse for HTTP clients. It maintains a queue of pending requests - * for a given host and port, reusing a single socket connection for each - * until the queue is empty, at which time the socket is either destroyed - * or put into a pool where it is kept to be used again for requests to the - * same host and port. Whether it is destroyed or pooled depends on the`keepAlive` `option`. - * - * Pooled connections have TCP Keep-Alive enabled for them, but servers may - * still close idle connections, in which case they will be removed from the - * pool and a new connection will be made when a new HTTP request is made for - * that host and port. Servers may also refuse to allow multiple requests - * over the same connection, in which case the connection will have to be - * remade for every request and cannot be pooled. The `Agent` will still make - * the requests to that server, but each one will occur over a new connection. - * - * When a connection is closed by the client or the server, it is removed - * from the pool. Any unused sockets in the pool will be unrefed so as not - * to keep the Node.js process running when there are no outstanding requests. - * (see `socket.unref()`). - * - * It is good practice, to `destroy()` an `Agent` instance when it is no - * longer in use, because unused sockets consume OS resources. - * - * Sockets are removed from an agent when the socket emits either - * a `'close'` event or an `'agentRemove'` event. When intending to keep one - * HTTP request open for a long time without keeping it in the agent, something - * like the following may be done: - * - * ```js - * http.get(options, (res) => { - * // Do stuff - * }).on('socket', (socket) => { - * socket.emit('agentRemove'); - * }); - * ``` - * - * An agent may also be used for an individual request. By providing`{agent: false}` as an option to the `http.get()` or `http.request()`functions, a one-time use `Agent` with default options - * will be used - * for the client connection. - * - * `agent:false`: - * - * ```js - * http.get({ - * hostname: 'localhost', - * port: 80, - * path: '/', - * agent: false // Create a new agent just for this one request - * }, (res) => { - * // Do stuff with response - * }); - * ``` - * @since v0.3.4 - */ - class Agent { - /** - * By default set to 256\. For agents with `keepAlive` enabled, this - * sets the maximum number of sockets that will be left open in the free - * state. - * @since v0.11.7 - */ - maxFreeSockets: number; - /** - * By default set to `Infinity`. Determines how many concurrent sockets the agent - * can have open per origin. Origin is the returned value of `agent.getName()`. - * @since v0.3.6 - */ - maxSockets: number; - /** - * By default set to `Infinity`. Determines how many concurrent sockets the agent - * can have open. Unlike `maxSockets`, this parameter applies across all origins. - * @since v14.5.0, v12.19.0 - */ - maxTotalSockets: number; - /** - * An object which contains arrays of sockets currently awaiting use by - * the agent when `keepAlive` is enabled. Do not modify. - * - * Sockets in the `freeSockets` list will be automatically destroyed and - * removed from the array on `'timeout'`. - * @since v0.11.4 - */ - readonly freeSockets: NodeJS.ReadOnlyDict; - /** - * An object which contains arrays of sockets currently in use by the - * agent. Do not modify. - * @since v0.3.6 - */ - readonly sockets: NodeJS.ReadOnlyDict; - /** - * An object which contains queues of requests that have not yet been assigned to - * sockets. Do not modify. - * @since v0.5.9 - */ - readonly requests: NodeJS.ReadOnlyDict; - constructor(opts?: AgentOptions); - /** - * Destroy any sockets that are currently in use by the agent. - * - * It is usually not necessary to do this. However, if using an - * agent with `keepAlive` enabled, then it is best to explicitly shut down - * the agent when it is no longer needed. Otherwise, - * sockets might stay open for quite a long time before the server - * terminates them. - * @since v0.11.4 - */ - destroy(): void; - } - const METHODS: string[]; - const STATUS_CODES: { - [errorCode: number]: string | undefined; - [errorCode: string]: string | undefined; - }; - /** - * Returns a new instance of {@link Server}. - * - * The `requestListener` is a function which is automatically - * added to the `'request'` event. - * @since v0.1.13 - */ - function createServer< - Request extends typeof IncomingMessage = typeof IncomingMessage, - Response extends typeof ServerResponse = typeof ServerResponse, - >(requestListener?: RequestListener): Server; - function createServer< - Request extends typeof IncomingMessage = typeof IncomingMessage, - Response extends typeof ServerResponse = typeof ServerResponse, - >( - options: ServerOptions, - requestListener?: RequestListener, - ): Server; - // although RequestOptions are passed as ClientRequestArgs to ClientRequest directly, - // create interface RequestOptions would make the naming more clear to developers - interface RequestOptions extends ClientRequestArgs {} - /** - * `options` in `socket.connect()` are also supported. - * - * Node.js maintains several connections per server to make HTTP requests. - * This function allows one to transparently issue requests. - * - * `url` can be a string or a `URL` object. If `url` is a - * string, it is automatically parsed with `new URL()`. If it is a `URL` object, it will be automatically converted to an ordinary `options` object. - * - * If both `url` and `options` are specified, the objects are merged, with the`options` properties taking precedence. - * - * The optional `callback` parameter will be added as a one-time listener for - * the `'response'` event. - * - * `http.request()` returns an instance of the {@link ClientRequest} class. The `ClientRequest` instance is a writable stream. If one needs to - * upload a file with a POST request, then write to the `ClientRequest` object. - * - * ```js - * const http = require('http'); - * - * const postData = JSON.stringify({ - * 'msg': 'Hello World!' - * }); - * - * const options = { - * hostname: 'www.google.com', - * port: 80, - * path: '/upload', - * method: 'POST', - * headers: { - * 'Content-Type': 'application/json', - * 'Content-Length': Buffer.byteLength(postData) - * } - * }; - * - * const req = http.request(options, (res) => { - * console.log(`STATUS: ${res.statusCode}`); - * console.log(`HEADERS: ${JSON.stringify(res.headers)}`); - * res.setEncoding('utf8'); - * res.on('data', (chunk) => { - * console.log(`BODY: ${chunk}`); - * }); - * res.on('end', () => { - * console.log('No more data in response.'); - * }); - * }); - * - * req.on('error', (e) => { - * console.error(`problem with request: ${e.message}`); - * }); - * - * // Write data to request body - * req.write(postData); - * req.end(); - * ``` - * - * In the example `req.end()` was called. With `http.request()` one - * must always call `req.end()` to signify the end of the request - - * even if there is no data being written to the request body. - * - * If any error is encountered during the request (be that with DNS resolution, - * TCP level errors, or actual HTTP parse errors) an `'error'` event is emitted - * on the returned request object. As with all `'error'` events, if no listeners - * are registered the error will be thrown. - * - * There are a few special headers that should be noted. - * - * * Sending a 'Connection: keep-alive' will notify Node.js that the connection to - * the server should be persisted until the next request. - * * Sending a 'Content-Length' header will disable the default chunked encoding. - * * Sending an 'Expect' header will immediately send the request headers. - * Usually, when sending 'Expect: 100-continue', both a timeout and a listener - * for the `'continue'` event should be set. See RFC 2616 Section 8.2.3 for more - * information. - * * Sending an Authorization header will override using the `auth` option - * to compute basic authentication. - * - * Example using a `URL` as `options`: - * - * ```js - * const options = new URL('http://abc:xyz@example.com'); - * - * const req = http.request(options, (res) => { - * // ... - * }); - * ``` - * - * In a successful request, the following events will be emitted in the following - * order: - * - * * `'socket'` - * * `'response'` - * * `'data'` any number of times, on the `res` object - * (`'data'` will not be emitted at all if the response body is empty, for - * instance, in most redirects) - * * `'end'` on the `res` object - * * `'close'` - * - * In the case of a connection error, the following events will be emitted: - * - * * `'socket'` - * * `'error'` - * * `'close'` - * - * In the case of a premature connection close before the response is received, - * the following events will be emitted in the following order: - * - * * `'socket'` - * * `'error'` with an error with message `'Error: socket hang up'` and code`'ECONNRESET'` - * * `'close'` - * - * In the case of a premature connection close after the response is received, - * the following events will be emitted in the following order: - * - * * `'socket'` - * * `'response'` - * * `'data'` any number of times, on the `res` object - * * (connection closed here) - * * `'aborted'` on the `res` object - * * `'error'` on the `res` object with an error with message`'Error: aborted'` and code `'ECONNRESET'`. - * * `'close'` - * * `'close'` on the `res` object - * - * If `req.destroy()` is called before a socket is assigned, the following - * events will be emitted in the following order: - * - * * (`req.destroy()` called here) - * * `'error'` with an error with message `'Error: socket hang up'` and code`'ECONNRESET'` - * * `'close'` - * - * If `req.destroy()` is called before the connection succeeds, the following - * events will be emitted in the following order: - * - * * `'socket'` - * * (`req.destroy()` called here) - * * `'error'` with an error with message `'Error: socket hang up'` and code`'ECONNRESET'` - * * `'close'` - * - * If `req.destroy()` is called after the response is received, the following - * events will be emitted in the following order: - * - * * `'socket'` - * * `'response'` - * * `'data'` any number of times, on the `res` object - * * (`req.destroy()` called here) - * * `'aborted'` on the `res` object - * * `'error'` on the `res` object with an error with message`'Error: aborted'` and code `'ECONNRESET'`. - * * `'close'` - * * `'close'` on the `res` object - * - * If `req.abort()` is called before a socket is assigned, the following - * events will be emitted in the following order: - * - * * (`req.abort()` called here) - * * `'abort'` - * * `'close'` - * - * If `req.abort()` is called before the connection succeeds, the following - * events will be emitted in the following order: - * - * * `'socket'` - * * (`req.abort()` called here) - * * `'abort'` - * * `'error'` with an error with message `'Error: socket hang up'` and code`'ECONNRESET'` - * * `'close'` - * - * If `req.abort()` is called after the response is received, the following - * events will be emitted in the following order: - * - * * `'socket'` - * * `'response'` - * * `'data'` any number of times, on the `res` object - * * (`req.abort()` called here) - * * `'abort'` - * * `'aborted'` on the `res` object - * * `'error'` on the `res` object with an error with message`'Error: aborted'` and code `'ECONNRESET'`. - * * `'close'` - * * `'close'` on the `res` object - * - * Setting the `timeout` option or using the `setTimeout()` function will - * not abort the request or do anything besides add a `'timeout'` event. - * - * Passing an `AbortSignal` and then calling `abort` on the corresponding`AbortController` will behave the same way as calling `.destroy()` on the - * request itself. - * @since v0.3.6 - */ - function request(options: RequestOptions | string | URL, callback?: (res: IncomingMessage) => void): ClientRequest; - function request( - url: string | URL, - options: RequestOptions, - callback?: (res: IncomingMessage) => void, - ): ClientRequest; - /** - * Since most requests are GET requests without bodies, Node.js provides this - * convenience method. The only difference between this method and {@link request} is that it sets the method to GET and calls `req.end()`automatically. The callback must take care to consume the - * response - * data for reasons stated in {@link ClientRequest} section. - * - * The `callback` is invoked with a single argument that is an instance of {@link IncomingMessage}. - * - * JSON fetching example: - * - * ```js - * http.get('http://localhost:8000/', (res) => { - * const { statusCode } = res; - * const contentType = res.headers['content-type']; - * - * let error; - * // Any 2xx status code signals a successful response but - * // here we're only checking for 200. - * if (statusCode !== 200) { - * error = new Error('Request Failed.\n' + - * `Status Code: ${statusCode}`); - * } else if (!/^application\/json/.test(contentType)) { - * error = new Error('Invalid content-type.\n' + - * `Expected application/json but received ${contentType}`); - * } - * if (error) { - * console.error(error.message); - * // Consume response data to free up memory - * res.resume(); - * return; - * } - * - * res.setEncoding('utf8'); - * let rawData = ''; - * res.on('data', (chunk) => { rawData += chunk; }); - * res.on('end', () => { - * try { - * const parsedData = JSON.parse(rawData); - * console.log(parsedData); - * } catch (e) { - * console.error(e.message); - * } - * }); - * }).on('error', (e) => { - * console.error(`Got error: ${e.message}`); - * }); - * - * // Create a local server to receive data from - * const server = http.createServer((req, res) => { - * res.writeHead(200, { 'Content-Type': 'application/json' }); - * res.end(JSON.stringify({ - * data: 'Hello World!' - * })); - * }); - * - * server.listen(8000); - * ``` - * @since v0.3.6 - * @param options Accepts the same `options` as {@link request}, with the `method` always set to `GET`. Properties that are inherited from the prototype are ignored. - */ - function get(options: RequestOptions | string | URL, callback?: (res: IncomingMessage) => void): ClientRequest; - function get(url: string | URL, options: RequestOptions, callback?: (res: IncomingMessage) => void): ClientRequest; - - /** - * Performs the low-level validations on the provided name that are done when `res.setHeader(name, value)` is called. - * Passing illegal value as name will result in a TypeError being thrown, identified by `code: 'ERR_INVALID_HTTP_TOKEN'`. - * @param name Header name - * @since v14.3.0 - */ - function validateHeaderName(name: string): void; - /** - * Performs the low-level validations on the provided value that are done when `res.setHeader(name, value)` is called. - * Passing illegal value as value will result in a TypeError being thrown. - * - Undefined value error is identified by `code: 'ERR_HTTP_INVALID_HEADER_VALUE'`. - * - Invalid value character error is identified by `code: 'ERR_INVALID_CHAR'`. - * @param name Header name - * @param value Header value - * @since v14.3.0 - */ - function validateHeaderValue(name: string, value: string): void; - - /** - * Set the maximum number of idle HTTP parsers. Default: 1000. - * @param count - * @since v18.8.0, v16.18.0 - */ - function setMaxIdleHTTPParsers(count: number): void; - - let globalAgent: Agent; - /** - * Read-only property specifying the maximum allowed size of HTTP headers in bytes. - * Defaults to 16KB. Configurable using the `--max-http-header-size` CLI option. - */ - const maxHeaderSize: number; -} -declare module 'node:http' { - export * from 'http'; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/http2.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/http2.d.ts deleted file mode 100755 index 0e368260..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/http2.d.ts +++ /dev/null @@ -1,2134 +0,0 @@ -/** - * The `http2` module provides an implementation of the [HTTP/2](https://tools.ietf.org/html/rfc7540) protocol. It - * can be accessed using: - * - * ```js - * const http2 = require('http2'); - * ``` - * @since v8.4.0 - * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/http2.js) - */ -declare module 'http2' { - import EventEmitter = require('node:events'); - import * as fs from 'node:fs'; - import * as net from 'node:net'; - import * as stream from 'node:stream'; - import * as tls from 'node:tls'; - import * as url from 'node:url'; - import { IncomingHttpHeaders as Http1IncomingHttpHeaders, OutgoingHttpHeaders, IncomingMessage, ServerResponse } from 'node:http'; - export { OutgoingHttpHeaders } from 'node:http'; - export interface IncomingHttpStatusHeader { - ':status'?: number | undefined; - } - export interface IncomingHttpHeaders extends Http1IncomingHttpHeaders { - ':path'?: string | undefined; - ':method'?: string | undefined; - ':authority'?: string | undefined; - ':scheme'?: string | undefined; - } - // Http2Stream - export interface StreamPriorityOptions { - exclusive?: boolean | undefined; - parent?: number | undefined; - weight?: number | undefined; - silent?: boolean | undefined; - } - export interface StreamState { - localWindowSize?: number | undefined; - state?: number | undefined; - localClose?: number | undefined; - remoteClose?: number | undefined; - sumDependencyWeight?: number | undefined; - weight?: number | undefined; - } - export interface ServerStreamResponseOptions { - endStream?: boolean | undefined; - waitForTrailers?: boolean | undefined; - } - export interface StatOptions { - offset: number; - length: number; - } - export interface ServerStreamFileResponseOptions { - statCheck?(stats: fs.Stats, headers: OutgoingHttpHeaders, statOptions: StatOptions): void | boolean; - waitForTrailers?: boolean | undefined; - offset?: number | undefined; - length?: number | undefined; - } - export interface ServerStreamFileResponseOptionsWithError extends ServerStreamFileResponseOptions { - onError?(err: NodeJS.ErrnoException): void; - } - export interface Http2Stream extends stream.Duplex { - /** - * Set to `true` if the `Http2Stream` instance was aborted abnormally. When set, - * the `'aborted'` event will have been emitted. - * @since v8.4.0 - */ - readonly aborted: boolean; - /** - * This property shows the number of characters currently buffered to be written. - * See `net.Socket.bufferSize` for details. - * @since v11.2.0, v10.16.0 - */ - readonly bufferSize: number; - /** - * Set to `true` if the `Http2Stream` instance has been closed. - * @since v9.4.0 - */ - readonly closed: boolean; - /** - * Set to `true` if the `Http2Stream` instance has been destroyed and is no longer - * usable. - * @since v8.4.0 - */ - readonly destroyed: boolean; - /** - * Set to `true` if the `END_STREAM` flag was set in the request or response - * HEADERS frame received, indicating that no additional data should be received - * and the readable side of the `Http2Stream` will be closed. - * @since v10.11.0 - */ - readonly endAfterHeaders: boolean; - /** - * The numeric stream identifier of this `Http2Stream` instance. Set to `undefined`if the stream identifier has not yet been assigned. - * @since v8.4.0 - */ - readonly id?: number | undefined; - /** - * Set to `true` if the `Http2Stream` instance has not yet been assigned a - * numeric stream identifier. - * @since v9.4.0 - */ - readonly pending: boolean; - /** - * Set to the `RST_STREAM` `error code` reported when the `Http2Stream` is - * destroyed after either receiving an `RST_STREAM` frame from the connected peer, - * calling `http2stream.close()`, or `http2stream.destroy()`. Will be`undefined` if the `Http2Stream` has not been closed. - * @since v8.4.0 - */ - readonly rstCode: number; - /** - * An object containing the outbound headers sent for this `Http2Stream`. - * @since v9.5.0 - */ - readonly sentHeaders: OutgoingHttpHeaders; - /** - * An array of objects containing the outbound informational (additional) headers - * sent for this `Http2Stream`. - * @since v9.5.0 - */ - readonly sentInfoHeaders?: OutgoingHttpHeaders[] | undefined; - /** - * An object containing the outbound trailers sent for this `HttpStream`. - * @since v9.5.0 - */ - readonly sentTrailers?: OutgoingHttpHeaders | undefined; - /** - * A reference to the `Http2Session` instance that owns this `Http2Stream`. The - * value will be `undefined` after the `Http2Stream` instance is destroyed. - * @since v8.4.0 - */ - readonly session: Http2Session; - /** - * Provides miscellaneous information about the current state of the`Http2Stream`. - * - * A current state of this `Http2Stream`. - * @since v8.4.0 - */ - readonly state: StreamState; - /** - * Closes the `Http2Stream` instance by sending an `RST_STREAM` frame to the - * connected HTTP/2 peer. - * @since v8.4.0 - * @param [code=http2.constants.NGHTTP2_NO_ERROR] Unsigned 32-bit integer identifying the error code. - * @param callback An optional function registered to listen for the `'close'` event. - */ - close(code?: number, callback?: () => void): void; - /** - * Updates the priority for this `Http2Stream` instance. - * @since v8.4.0 - */ - priority(options: StreamPriorityOptions): void; - /** - * ```js - * const http2 = require('http2'); - * const client = http2.connect('http://example.org:8000'); - * const { NGHTTP2_CANCEL } = http2.constants; - * const req = client.request({ ':path': '/' }); - * - * // Cancel the stream if there's no activity after 5 seconds - * req.setTimeout(5000, () => req.close(NGHTTP2_CANCEL)); - * ``` - * @since v8.4.0 - */ - setTimeout(msecs: number, callback?: () => void): void; - /** - * Sends a trailing `HEADERS` frame to the connected HTTP/2 peer. This method - * will cause the `Http2Stream` to be immediately closed and must only be - * called after the `'wantTrailers'` event has been emitted. When sending a - * request or sending a response, the `options.waitForTrailers` option must be set - * in order to keep the `Http2Stream` open after the final `DATA` frame so that - * trailers can be sent. - * - * ```js - * const http2 = require('http2'); - * const server = http2.createServer(); - * server.on('stream', (stream) => { - * stream.respond(undefined, { waitForTrailers: true }); - * stream.on('wantTrailers', () => { - * stream.sendTrailers({ xyz: 'abc' }); - * }); - * stream.end('Hello World'); - * }); - * ``` - * - * The HTTP/1 specification forbids trailers from containing HTTP/2 pseudo-header - * fields (e.g. `':method'`, `':path'`, etc). - * @since v10.0.0 - */ - sendTrailers(headers: OutgoingHttpHeaders): void; - addListener(event: 'aborted', listener: () => void): this; - addListener(event: 'close', listener: () => void): this; - addListener(event: 'data', listener: (chunk: Buffer | string) => void): this; - addListener(event: 'drain', listener: () => void): this; - addListener(event: 'end', listener: () => void): this; - addListener(event: 'error', listener: (err: Error) => void): this; - addListener(event: 'finish', listener: () => void): this; - addListener(event: 'frameError', listener: (frameType: number, errorCode: number) => void): this; - addListener(event: 'pipe', listener: (src: stream.Readable) => void): this; - addListener(event: 'unpipe', listener: (src: stream.Readable) => void): this; - addListener(event: 'streamClosed', listener: (code: number) => void): this; - addListener(event: 'timeout', listener: () => void): this; - addListener(event: 'trailers', listener: (trailers: IncomingHttpHeaders, flags: number) => void): this; - addListener(event: 'wantTrailers', listener: () => void): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - emit(event: 'aborted'): boolean; - emit(event: 'close'): boolean; - emit(event: 'data', chunk: Buffer | string): boolean; - emit(event: 'drain'): boolean; - emit(event: 'end'): boolean; - emit(event: 'error', err: Error): boolean; - emit(event: 'finish'): boolean; - emit(event: 'frameError', frameType: number, errorCode: number): boolean; - emit(event: 'pipe', src: stream.Readable): boolean; - emit(event: 'unpipe', src: stream.Readable): boolean; - emit(event: 'streamClosed', code: number): boolean; - emit(event: 'timeout'): boolean; - emit(event: 'trailers', trailers: IncomingHttpHeaders, flags: number): boolean; - emit(event: 'wantTrailers'): boolean; - emit(event: string | symbol, ...args: any[]): boolean; - on(event: 'aborted', listener: () => void): this; - on(event: 'close', listener: () => void): this; - on(event: 'data', listener: (chunk: Buffer | string) => void): this; - on(event: 'drain', listener: () => void): this; - on(event: 'end', listener: () => void): this; - on(event: 'error', listener: (err: Error) => void): this; - on(event: 'finish', listener: () => void): this; - on(event: 'frameError', listener: (frameType: number, errorCode: number) => void): this; - on(event: 'pipe', listener: (src: stream.Readable) => void): this; - on(event: 'unpipe', listener: (src: stream.Readable) => void): this; - on(event: 'streamClosed', listener: (code: number) => void): this; - on(event: 'timeout', listener: () => void): this; - on(event: 'trailers', listener: (trailers: IncomingHttpHeaders, flags: number) => void): this; - on(event: 'wantTrailers', listener: () => void): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once(event: 'aborted', listener: () => void): this; - once(event: 'close', listener: () => void): this; - once(event: 'data', listener: (chunk: Buffer | string) => void): this; - once(event: 'drain', listener: () => void): this; - once(event: 'end', listener: () => void): this; - once(event: 'error', listener: (err: Error) => void): this; - once(event: 'finish', listener: () => void): this; - once(event: 'frameError', listener: (frameType: number, errorCode: number) => void): this; - once(event: 'pipe', listener: (src: stream.Readable) => void): this; - once(event: 'unpipe', listener: (src: stream.Readable) => void): this; - once(event: 'streamClosed', listener: (code: number) => void): this; - once(event: 'timeout', listener: () => void): this; - once(event: 'trailers', listener: (trailers: IncomingHttpHeaders, flags: number) => void): this; - once(event: 'wantTrailers', listener: () => void): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener(event: 'aborted', listener: () => void): this; - prependListener(event: 'close', listener: () => void): this; - prependListener(event: 'data', listener: (chunk: Buffer | string) => void): this; - prependListener(event: 'drain', listener: () => void): this; - prependListener(event: 'end', listener: () => void): this; - prependListener(event: 'error', listener: (err: Error) => void): this; - prependListener(event: 'finish', listener: () => void): this; - prependListener(event: 'frameError', listener: (frameType: number, errorCode: number) => void): this; - prependListener(event: 'pipe', listener: (src: stream.Readable) => void): this; - prependListener(event: 'unpipe', listener: (src: stream.Readable) => void): this; - prependListener(event: 'streamClosed', listener: (code: number) => void): this; - prependListener(event: 'timeout', listener: () => void): this; - prependListener(event: 'trailers', listener: (trailers: IncomingHttpHeaders, flags: number) => void): this; - prependListener(event: 'wantTrailers', listener: () => void): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - prependOnceListener(event: 'aborted', listener: () => void): this; - prependOnceListener(event: 'close', listener: () => void): this; - prependOnceListener(event: 'data', listener: (chunk: Buffer | string) => void): this; - prependOnceListener(event: 'drain', listener: () => void): this; - prependOnceListener(event: 'end', listener: () => void): this; - prependOnceListener(event: 'error', listener: (err: Error) => void): this; - prependOnceListener(event: 'finish', listener: () => void): this; - prependOnceListener(event: 'frameError', listener: (frameType: number, errorCode: number) => void): this; - prependOnceListener(event: 'pipe', listener: (src: stream.Readable) => void): this; - prependOnceListener(event: 'unpipe', listener: (src: stream.Readable) => void): this; - prependOnceListener(event: 'streamClosed', listener: (code: number) => void): this; - prependOnceListener(event: 'timeout', listener: () => void): this; - prependOnceListener(event: 'trailers', listener: (trailers: IncomingHttpHeaders, flags: number) => void): this; - prependOnceListener(event: 'wantTrailers', listener: () => void): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - } - export interface ClientHttp2Stream extends Http2Stream { - addListener(event: 'continue', listener: () => {}): this; - addListener(event: 'headers', listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; - addListener(event: 'push', listener: (headers: IncomingHttpHeaders, flags: number) => void): this; - addListener(event: 'response', listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - emit(event: 'continue'): boolean; - emit(event: 'headers', headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number): boolean; - emit(event: 'push', headers: IncomingHttpHeaders, flags: number): boolean; - emit(event: 'response', headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number): boolean; - emit(event: string | symbol, ...args: any[]): boolean; - on(event: 'continue', listener: () => {}): this; - on(event: 'headers', listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; - on(event: 'push', listener: (headers: IncomingHttpHeaders, flags: number) => void): this; - on(event: 'response', listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once(event: 'continue', listener: () => {}): this; - once(event: 'headers', listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; - once(event: 'push', listener: (headers: IncomingHttpHeaders, flags: number) => void): this; - once(event: 'response', listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener(event: 'continue', listener: () => {}): this; - prependListener(event: 'headers', listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; - prependListener(event: 'push', listener: (headers: IncomingHttpHeaders, flags: number) => void): this; - prependListener(event: 'response', listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - prependOnceListener(event: 'continue', listener: () => {}): this; - prependOnceListener(event: 'headers', listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; - prependOnceListener(event: 'push', listener: (headers: IncomingHttpHeaders, flags: number) => void): this; - prependOnceListener(event: 'response', listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - } - export interface ServerHttp2Stream extends Http2Stream { - /** - * True if headers were sent, false otherwise (read-only). - * @since v8.4.0 - */ - readonly headersSent: boolean; - /** - * Read-only property mapped to the `SETTINGS_ENABLE_PUSH` flag of the remote - * client's most recent `SETTINGS` frame. Will be `true` if the remote peer - * accepts push streams, `false` otherwise. Settings are the same for every`Http2Stream` in the same `Http2Session`. - * @since v8.4.0 - */ - readonly pushAllowed: boolean; - /** - * Sends an additional informational `HEADERS` frame to the connected HTTP/2 peer. - * @since v8.4.0 - */ - additionalHeaders(headers: OutgoingHttpHeaders): void; - /** - * Initiates a push stream. The callback is invoked with the new `Http2Stream`instance created for the push stream passed as the second argument, or an`Error` passed as the first argument. - * - * ```js - * const http2 = require('http2'); - * const server = http2.createServer(); - * server.on('stream', (stream) => { - * stream.respond({ ':status': 200 }); - * stream.pushStream({ ':path': '/' }, (err, pushStream, headers) => { - * if (err) throw err; - * pushStream.respond({ ':status': 200 }); - * pushStream.end('some pushed data'); - * }); - * stream.end('some data'); - * }); - * ``` - * - * Setting the weight of a push stream is not allowed in the `HEADERS` frame. Pass - * a `weight` value to `http2stream.priority` with the `silent` option set to`true` to enable server-side bandwidth balancing between concurrent streams. - * - * Calling `http2stream.pushStream()` from within a pushed stream is not permitted - * and will throw an error. - * @since v8.4.0 - * @param callback Callback that is called once the push stream has been initiated. - */ - pushStream(headers: OutgoingHttpHeaders, callback?: (err: Error | null, pushStream: ServerHttp2Stream, headers: OutgoingHttpHeaders) => void): void; - pushStream(headers: OutgoingHttpHeaders, options?: StreamPriorityOptions, callback?: (err: Error | null, pushStream: ServerHttp2Stream, headers: OutgoingHttpHeaders) => void): void; - /** - * ```js - * const http2 = require('http2'); - * const server = http2.createServer(); - * server.on('stream', (stream) => { - * stream.respond({ ':status': 200 }); - * stream.end('some data'); - * }); - * ``` - * - * When the `options.waitForTrailers` option is set, the `'wantTrailers'` event - * will be emitted immediately after queuing the last chunk of payload data to be - * sent. The `http2stream.sendTrailers()` method can then be used to sent trailing - * header fields to the peer. - * - * When `options.waitForTrailers` is set, the `Http2Stream` will not automatically - * close when the final `DATA` frame is transmitted. User code must call either`http2stream.sendTrailers()` or `http2stream.close()` to close the`Http2Stream`. - * - * ```js - * const http2 = require('http2'); - * const server = http2.createServer(); - * server.on('stream', (stream) => { - * stream.respond({ ':status': 200 }, { waitForTrailers: true }); - * stream.on('wantTrailers', () => { - * stream.sendTrailers({ ABC: 'some value to send' }); - * }); - * stream.end('some data'); - * }); - * ``` - * @since v8.4.0 - */ - respond(headers?: OutgoingHttpHeaders, options?: ServerStreamResponseOptions): void; - /** - * Initiates a response whose data is read from the given file descriptor. No - * validation is performed on the given file descriptor. If an error occurs while - * attempting to read data using the file descriptor, the `Http2Stream` will be - * closed using an `RST_STREAM` frame using the standard `INTERNAL_ERROR` code. - * - * When used, the `Http2Stream` object's `Duplex` interface will be closed - * automatically. - * - * ```js - * const http2 = require('http2'); - * const fs = require('fs'); - * - * const server = http2.createServer(); - * server.on('stream', (stream) => { - * const fd = fs.openSync('/some/file', 'r'); - * - * const stat = fs.fstatSync(fd); - * const headers = { - * 'content-length': stat.size, - * 'last-modified': stat.mtime.toUTCString(), - * 'content-type': 'text/plain; charset=utf-8' - * }; - * stream.respondWithFD(fd, headers); - * stream.on('close', () => fs.closeSync(fd)); - * }); - * ``` - * - * The optional `options.statCheck` function may be specified to give user code - * an opportunity to set additional content headers based on the `fs.Stat` details - * of the given fd. If the `statCheck` function is provided, the`http2stream.respondWithFD()` method will perform an `fs.fstat()` call to - * collect details on the provided file descriptor. - * - * The `offset` and `length` options may be used to limit the response to a - * specific range subset. This can be used, for instance, to support HTTP Range - * requests. - * - * The file descriptor or `FileHandle` is not closed when the stream is closed, - * so it will need to be closed manually once it is no longer needed. - * Using the same file descriptor concurrently for multiple streams - * is not supported and may result in data loss. Re-using a file descriptor - * after a stream has finished is supported. - * - * When the `options.waitForTrailers` option is set, the `'wantTrailers'` event - * will be emitted immediately after queuing the last chunk of payload data to be - * sent. The `http2stream.sendTrailers()` method can then be used to sent trailing - * header fields to the peer. - * - * When `options.waitForTrailers` is set, the `Http2Stream` will not automatically - * close when the final `DATA` frame is transmitted. User code _must_ call either`http2stream.sendTrailers()` or `http2stream.close()` to close the`Http2Stream`. - * - * ```js - * const http2 = require('http2'); - * const fs = require('fs'); - * - * const server = http2.createServer(); - * server.on('stream', (stream) => { - * const fd = fs.openSync('/some/file', 'r'); - * - * const stat = fs.fstatSync(fd); - * const headers = { - * 'content-length': stat.size, - * 'last-modified': stat.mtime.toUTCString(), - * 'content-type': 'text/plain; charset=utf-8' - * }; - * stream.respondWithFD(fd, headers, { waitForTrailers: true }); - * stream.on('wantTrailers', () => { - * stream.sendTrailers({ ABC: 'some value to send' }); - * }); - * - * stream.on('close', () => fs.closeSync(fd)); - * }); - * ``` - * @since v8.4.0 - * @param fd A readable file descriptor. - */ - respondWithFD(fd: number | fs.promises.FileHandle, headers?: OutgoingHttpHeaders, options?: ServerStreamFileResponseOptions): void; - /** - * Sends a regular file as the response. The `path` must specify a regular file - * or an `'error'` event will be emitted on the `Http2Stream` object. - * - * When used, the `Http2Stream` object's `Duplex` interface will be closed - * automatically. - * - * The optional `options.statCheck` function may be specified to give user code - * an opportunity to set additional content headers based on the `fs.Stat` details - * of the given file: - * - * If an error occurs while attempting to read the file data, the `Http2Stream`will be closed using an `RST_STREAM` frame using the standard `INTERNAL_ERROR`code. If the `onError` callback is - * defined, then it will be called. Otherwise - * the stream will be destroyed. - * - * Example using a file path: - * - * ```js - * const http2 = require('http2'); - * const server = http2.createServer(); - * server.on('stream', (stream) => { - * function statCheck(stat, headers) { - * headers['last-modified'] = stat.mtime.toUTCString(); - * } - * - * function onError(err) { - * // stream.respond() can throw if the stream has been destroyed by - * // the other side. - * try { - * if (err.code === 'ENOENT') { - * stream.respond({ ':status': 404 }); - * } else { - * stream.respond({ ':status': 500 }); - * } - * } catch (err) { - * // Perform actual error handling. - * console.log(err); - * } - * stream.end(); - * } - * - * stream.respondWithFile('/some/file', - * { 'content-type': 'text/plain; charset=utf-8' }, - * { statCheck, onError }); - * }); - * ``` - * - * The `options.statCheck` function may also be used to cancel the send operation - * by returning `false`. For instance, a conditional request may check the stat - * results to determine if the file has been modified to return an appropriate`304` response: - * - * ```js - * const http2 = require('http2'); - * const server = http2.createServer(); - * server.on('stream', (stream) => { - * function statCheck(stat, headers) { - * // Check the stat here... - * stream.respond({ ':status': 304 }); - * return false; // Cancel the send operation - * } - * stream.respondWithFile('/some/file', - * { 'content-type': 'text/plain; charset=utf-8' }, - * { statCheck }); - * }); - * ``` - * - * The `content-length` header field will be automatically set. - * - * The `offset` and `length` options may be used to limit the response to a - * specific range subset. This can be used, for instance, to support HTTP Range - * requests. - * - * The `options.onError` function may also be used to handle all the errors - * that could happen before the delivery of the file is initiated. The - * default behavior is to destroy the stream. - * - * When the `options.waitForTrailers` option is set, the `'wantTrailers'` event - * will be emitted immediately after queuing the last chunk of payload data to be - * sent. The `http2stream.sendTrailers()` method can then be used to sent trailing - * header fields to the peer. - * - * When `options.waitForTrailers` is set, the `Http2Stream` will not automatically - * close when the final `DATA` frame is transmitted. User code must call either`http2stream.sendTrailers()` or `http2stream.close()` to close the`Http2Stream`. - * - * ```js - * const http2 = require('http2'); - * const server = http2.createServer(); - * server.on('stream', (stream) => { - * stream.respondWithFile('/some/file', - * { 'content-type': 'text/plain; charset=utf-8' }, - * { waitForTrailers: true }); - * stream.on('wantTrailers', () => { - * stream.sendTrailers({ ABC: 'some value to send' }); - * }); - * }); - * ``` - * @since v8.4.0 - */ - respondWithFile(path: string, headers?: OutgoingHttpHeaders, options?: ServerStreamFileResponseOptionsWithError): void; - } - // Http2Session - export interface Settings { - headerTableSize?: number | undefined; - enablePush?: boolean | undefined; - initialWindowSize?: number | undefined; - maxFrameSize?: number | undefined; - maxConcurrentStreams?: number | undefined; - maxHeaderListSize?: number | undefined; - enableConnectProtocol?: boolean | undefined; - } - export interface ClientSessionRequestOptions { - endStream?: boolean | undefined; - exclusive?: boolean | undefined; - parent?: number | undefined; - weight?: number | undefined; - waitForTrailers?: boolean | undefined; - signal?: AbortSignal | undefined; - } - export interface SessionState { - effectiveLocalWindowSize?: number | undefined; - effectiveRecvDataLength?: number | undefined; - nextStreamID?: number | undefined; - localWindowSize?: number | undefined; - lastProcStreamID?: number | undefined; - remoteWindowSize?: number | undefined; - outboundQueueSize?: number | undefined; - deflateDynamicTableSize?: number | undefined; - inflateDynamicTableSize?: number | undefined; - } - export interface Http2Session extends EventEmitter { - /** - * Value will be `undefined` if the `Http2Session` is not yet connected to a - * socket, `h2c` if the `Http2Session` is not connected to a `TLSSocket`, or - * will return the value of the connected `TLSSocket`'s own `alpnProtocol`property. - * @since v9.4.0 - */ - readonly alpnProtocol?: string | undefined; - /** - * Will be `true` if this `Http2Session` instance has been closed, otherwise`false`. - * @since v9.4.0 - */ - readonly closed: boolean; - /** - * Will be `true` if this `Http2Session` instance is still connecting, will be set - * to `false` before emitting `connect` event and/or calling the `http2.connect`callback. - * @since v10.0.0 - */ - readonly connecting: boolean; - /** - * Will be `true` if this `Http2Session` instance has been destroyed and must no - * longer be used, otherwise `false`. - * @since v8.4.0 - */ - readonly destroyed: boolean; - /** - * Value is `undefined` if the `Http2Session` session socket has not yet been - * connected, `true` if the `Http2Session` is connected with a `TLSSocket`, - * and `false` if the `Http2Session` is connected to any other kind of socket - * or stream. - * @since v9.4.0 - */ - readonly encrypted?: boolean | undefined; - /** - * A prototype-less object describing the current local settings of this`Http2Session`. The local settings are local to _this_`Http2Session` instance. - * @since v8.4.0 - */ - readonly localSettings: Settings; - /** - * If the `Http2Session` is connected to a `TLSSocket`, the `originSet` property - * will return an `Array` of origins for which the `Http2Session` may be - * considered authoritative. - * - * The `originSet` property is only available when using a secure TLS connection. - * @since v9.4.0 - */ - readonly originSet?: string[] | undefined; - /** - * Indicates whether the `Http2Session` is currently waiting for acknowledgment of - * a sent `SETTINGS` frame. Will be `true` after calling the`http2session.settings()` method. Will be `false` once all sent `SETTINGS`frames have been acknowledged. - * @since v8.4.0 - */ - readonly pendingSettingsAck: boolean; - /** - * A prototype-less object describing the current remote settings of this`Http2Session`. The remote settings are set by the _connected_ HTTP/2 peer. - * @since v8.4.0 - */ - readonly remoteSettings: Settings; - /** - * Returns a `Proxy` object that acts as a `net.Socket` (or `tls.TLSSocket`) but - * limits available methods to ones safe to use with HTTP/2. - * - * `destroy`, `emit`, `end`, `pause`, `read`, `resume`, and `write` will throw - * an error with code `ERR_HTTP2_NO_SOCKET_MANIPULATION`. See `Http2Session and Sockets` for more information. - * - * `setTimeout` method will be called on this `Http2Session`. - * - * All other interactions will be routed directly to the socket. - * @since v8.4.0 - */ - readonly socket: net.Socket | tls.TLSSocket; - /** - * Provides miscellaneous information about the current state of the`Http2Session`. - * - * An object describing the current status of this `Http2Session`. - * @since v8.4.0 - */ - readonly state: SessionState; - /** - * The `http2session.type` will be equal to`http2.constants.NGHTTP2_SESSION_SERVER` if this `Http2Session` instance is a - * server, and `http2.constants.NGHTTP2_SESSION_CLIENT` if the instance is a - * client. - * @since v8.4.0 - */ - readonly type: number; - /** - * Gracefully closes the `Http2Session`, allowing any existing streams to - * complete on their own and preventing new `Http2Stream` instances from being - * created. Once closed, `http2session.destroy()`_might_ be called if there - * are no open `Http2Stream` instances. - * - * If specified, the `callback` function is registered as a handler for the`'close'` event. - * @since v9.4.0 - */ - close(callback?: () => void): void; - /** - * Immediately terminates the `Http2Session` and the associated `net.Socket` or`tls.TLSSocket`. - * - * Once destroyed, the `Http2Session` will emit the `'close'` event. If `error`is not undefined, an `'error'` event will be emitted immediately before the`'close'` event. - * - * If there are any remaining open `Http2Streams` associated with the`Http2Session`, those will also be destroyed. - * @since v8.4.0 - * @param error An `Error` object if the `Http2Session` is being destroyed due to an error. - * @param code The HTTP/2 error code to send in the final `GOAWAY` frame. If unspecified, and `error` is not undefined, the default is `INTERNAL_ERROR`, otherwise defaults to `NO_ERROR`. - */ - destroy(error?: Error, code?: number): void; - /** - * Transmits a `GOAWAY` frame to the connected peer _without_ shutting down the`Http2Session`. - * @since v9.4.0 - * @param code An HTTP/2 error code - * @param lastStreamID The numeric ID of the last processed `Http2Stream` - * @param opaqueData A `TypedArray` or `DataView` instance containing additional data to be carried within the `GOAWAY` frame. - */ - goaway(code?: number, lastStreamID?: number, opaqueData?: NodeJS.ArrayBufferView): void; - /** - * Sends a `PING` frame to the connected HTTP/2 peer. A `callback` function must - * be provided. The method will return `true` if the `PING` was sent, `false`otherwise. - * - * The maximum number of outstanding (unacknowledged) pings is determined by the`maxOutstandingPings` configuration option. The default maximum is 10. - * - * If provided, the `payload` must be a `Buffer`, `TypedArray`, or `DataView`containing 8 bytes of data that will be transmitted with the `PING` and - * returned with the ping acknowledgment. - * - * The callback will be invoked with three arguments: an error argument that will - * be `null` if the `PING` was successfully acknowledged, a `duration` argument - * that reports the number of milliseconds elapsed since the ping was sent and the - * acknowledgment was received, and a `Buffer` containing the 8-byte `PING`payload. - * - * ```js - * session.ping(Buffer.from('abcdefgh'), (err, duration, payload) => { - * if (!err) { - * console.log(`Ping acknowledged in ${duration} milliseconds`); - * console.log(`With payload '${payload.toString()}'`); - * } - * }); - * ``` - * - * If the `payload` argument is not specified, the default payload will be the - * 64-bit timestamp (little endian) marking the start of the `PING` duration. - * @since v8.9.3 - * @param payload Optional ping payload. - */ - ping(callback: (err: Error | null, duration: number, payload: Buffer) => void): boolean; - ping(payload: NodeJS.ArrayBufferView, callback: (err: Error | null, duration: number, payload: Buffer) => void): boolean; - /** - * Calls `ref()` on this `Http2Session`instance's underlying `net.Socket`. - * @since v9.4.0 - */ - ref(): void; - /** - * Sets the local endpoint's window size. - * The `windowSize` is the total window size to set, not - * the delta. - * - * ```js - * const http2 = require('http2'); - * - * const server = http2.createServer(); - * const expectedWindowSize = 2 ** 20; - * server.on('connect', (session) => { - * - * // Set local window size to be 2 ** 20 - * session.setLocalWindowSize(expectedWindowSize); - * }); - * ``` - * @since v15.3.0, v14.18.0 - */ - setLocalWindowSize(windowSize: number): void; - /** - * Used to set a callback function that is called when there is no activity on - * the `Http2Session` after `msecs` milliseconds. The given `callback` is - * registered as a listener on the `'timeout'` event. - * @since v8.4.0 - */ - setTimeout(msecs: number, callback?: () => void): void; - /** - * Updates the current local settings for this `Http2Session` and sends a new`SETTINGS` frame to the connected HTTP/2 peer. - * - * Once called, the `http2session.pendingSettingsAck` property will be `true`while the session is waiting for the remote peer to acknowledge the new - * settings. - * - * The new settings will not become effective until the `SETTINGS` acknowledgment - * is received and the `'localSettings'` event is emitted. It is possible to send - * multiple `SETTINGS` frames while acknowledgment is still pending. - * @since v8.4.0 - * @param callback Callback that is called once the session is connected or right away if the session is already connected. - */ - settings(settings: Settings, callback?: (err: Error | null, settings: Settings, duration: number) => void): void; - /** - * Calls `unref()` on this `Http2Session`instance's underlying `net.Socket`. - * @since v9.4.0 - */ - unref(): void; - addListener(event: 'close', listener: () => void): this; - addListener(event: 'error', listener: (err: Error) => void): this; - addListener(event: 'frameError', listener: (frameType: number, errorCode: number, streamID: number) => void): this; - addListener(event: 'goaway', listener: (errorCode: number, lastStreamID: number, opaqueData: Buffer) => void): this; - addListener(event: 'localSettings', listener: (settings: Settings) => void): this; - addListener(event: 'ping', listener: () => void): this; - addListener(event: 'remoteSettings', listener: (settings: Settings) => void): this; - addListener(event: 'timeout', listener: () => void): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - emit(event: 'close'): boolean; - emit(event: 'error', err: Error): boolean; - emit(event: 'frameError', frameType: number, errorCode: number, streamID: number): boolean; - emit(event: 'goaway', errorCode: number, lastStreamID: number, opaqueData: Buffer): boolean; - emit(event: 'localSettings', settings: Settings): boolean; - emit(event: 'ping'): boolean; - emit(event: 'remoteSettings', settings: Settings): boolean; - emit(event: 'timeout'): boolean; - emit(event: string | symbol, ...args: any[]): boolean; - on(event: 'close', listener: () => void): this; - on(event: 'error', listener: (err: Error) => void): this; - on(event: 'frameError', listener: (frameType: number, errorCode: number, streamID: number) => void): this; - on(event: 'goaway', listener: (errorCode: number, lastStreamID: number, opaqueData: Buffer) => void): this; - on(event: 'localSettings', listener: (settings: Settings) => void): this; - on(event: 'ping', listener: () => void): this; - on(event: 'remoteSettings', listener: (settings: Settings) => void): this; - on(event: 'timeout', listener: () => void): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once(event: 'close', listener: () => void): this; - once(event: 'error', listener: (err: Error) => void): this; - once(event: 'frameError', listener: (frameType: number, errorCode: number, streamID: number) => void): this; - once(event: 'goaway', listener: (errorCode: number, lastStreamID: number, opaqueData: Buffer) => void): this; - once(event: 'localSettings', listener: (settings: Settings) => void): this; - once(event: 'ping', listener: () => void): this; - once(event: 'remoteSettings', listener: (settings: Settings) => void): this; - once(event: 'timeout', listener: () => void): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener(event: 'close', listener: () => void): this; - prependListener(event: 'error', listener: (err: Error) => void): this; - prependListener(event: 'frameError', listener: (frameType: number, errorCode: number, streamID: number) => void): this; - prependListener(event: 'goaway', listener: (errorCode: number, lastStreamID: number, opaqueData: Buffer) => void): this; - prependListener(event: 'localSettings', listener: (settings: Settings) => void): this; - prependListener(event: 'ping', listener: () => void): this; - prependListener(event: 'remoteSettings', listener: (settings: Settings) => void): this; - prependListener(event: 'timeout', listener: () => void): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - prependOnceListener(event: 'close', listener: () => void): this; - prependOnceListener(event: 'error', listener: (err: Error) => void): this; - prependOnceListener(event: 'frameError', listener: (frameType: number, errorCode: number, streamID: number) => void): this; - prependOnceListener(event: 'goaway', listener: (errorCode: number, lastStreamID: number, opaqueData: Buffer) => void): this; - prependOnceListener(event: 'localSettings', listener: (settings: Settings) => void): this; - prependOnceListener(event: 'ping', listener: () => void): this; - prependOnceListener(event: 'remoteSettings', listener: (settings: Settings) => void): this; - prependOnceListener(event: 'timeout', listener: () => void): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - } - export interface ClientHttp2Session extends Http2Session { - /** - * For HTTP/2 Client `Http2Session` instances only, the `http2session.request()`creates and returns an `Http2Stream` instance that can be used to send an - * HTTP/2 request to the connected server. - * - * When a `ClientHttp2Session` is first created, the socket may not yet be - * connected. if `clienthttp2session.request()` is called during this time, the - * actual request will be deferred until the socket is ready to go. - * If the `session` is closed before the actual request be executed, an`ERR_HTTP2_GOAWAY_SESSION` is thrown. - * - * This method is only available if `http2session.type` is equal to`http2.constants.NGHTTP2_SESSION_CLIENT`. - * - * ```js - * const http2 = require('http2'); - * const clientSession = http2.connect('https://localhost:1234'); - * const { - * HTTP2_HEADER_PATH, - * HTTP2_HEADER_STATUS - * } = http2.constants; - * - * const req = clientSession.request({ [HTTP2_HEADER_PATH]: '/' }); - * req.on('response', (headers) => { - * console.log(headers[HTTP2_HEADER_STATUS]); - * req.on('data', (chunk) => { // .. }); - * req.on('end', () => { // .. }); - * }); - * ``` - * - * When the `options.waitForTrailers` option is set, the `'wantTrailers'` event - * is emitted immediately after queuing the last chunk of payload data to be sent. - * The `http2stream.sendTrailers()` method can then be called to send trailing - * headers to the peer. - * - * When `options.waitForTrailers` is set, the `Http2Stream` will not automatically - * close when the final `DATA` frame is transmitted. User code must call either`http2stream.sendTrailers()` or `http2stream.close()` to close the`Http2Stream`. - * - * When `options.signal` is set with an `AbortSignal` and then `abort` on the - * corresponding `AbortController` is called, the request will emit an `'error'`event with an `AbortError` error. - * - * The `:method` and `:path` pseudo-headers are not specified within `headers`, - * they respectively default to: - * - * * `:method` \= `'GET'` - * * `:path` \= `/` - * @since v8.4.0 - */ - request(headers?: OutgoingHttpHeaders, options?: ClientSessionRequestOptions): ClientHttp2Stream; - addListener(event: 'altsvc', listener: (alt: string, origin: string, stream: number) => void): this; - addListener(event: 'origin', listener: (origins: string[]) => void): this; - addListener(event: 'connect', listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this; - addListener(event: 'stream', listener: (stream: ClientHttp2Stream, headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - emit(event: 'altsvc', alt: string, origin: string, stream: number): boolean; - emit(event: 'origin', origins: ReadonlyArray): boolean; - emit(event: 'connect', session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket): boolean; - emit(event: 'stream', stream: ClientHttp2Stream, headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number): boolean; - emit(event: string | symbol, ...args: any[]): boolean; - on(event: 'altsvc', listener: (alt: string, origin: string, stream: number) => void): this; - on(event: 'origin', listener: (origins: string[]) => void): this; - on(event: 'connect', listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this; - on(event: 'stream', listener: (stream: ClientHttp2Stream, headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once(event: 'altsvc', listener: (alt: string, origin: string, stream: number) => void): this; - once(event: 'origin', listener: (origins: string[]) => void): this; - once(event: 'connect', listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this; - once(event: 'stream', listener: (stream: ClientHttp2Stream, headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener(event: 'altsvc', listener: (alt: string, origin: string, stream: number) => void): this; - prependListener(event: 'origin', listener: (origins: string[]) => void): this; - prependListener(event: 'connect', listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this; - prependListener(event: 'stream', listener: (stream: ClientHttp2Stream, headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - prependOnceListener(event: 'altsvc', listener: (alt: string, origin: string, stream: number) => void): this; - prependOnceListener(event: 'origin', listener: (origins: string[]) => void): this; - prependOnceListener(event: 'connect', listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this; - prependOnceListener(event: 'stream', listener: (stream: ClientHttp2Stream, headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - } - export interface AlternativeServiceOptions { - origin: number | string | url.URL; - } - export interface ServerHttp2Session extends Http2Session { - readonly server: Http2Server | Http2SecureServer; - /** - * Submits an `ALTSVC` frame (as defined by [RFC 7838](https://tools.ietf.org/html/rfc7838)) to the connected client. - * - * ```js - * const http2 = require('http2'); - * - * const server = http2.createServer(); - * server.on('session', (session) => { - * // Set altsvc for origin https://example.org:80 - * session.altsvc('h2=":8000"', 'https://example.org:80'); - * }); - * - * server.on('stream', (stream) => { - * // Set altsvc for a specific stream - * stream.session.altsvc('h2=":8000"', stream.id); - * }); - * ``` - * - * Sending an `ALTSVC` frame with a specific stream ID indicates that the alternate - * service is associated with the origin of the given `Http2Stream`. - * - * The `alt` and origin string _must_ contain only ASCII bytes and are - * strictly interpreted as a sequence of ASCII bytes. The special value `'clear'`may be passed to clear any previously set alternative service for a given - * domain. - * - * When a string is passed for the `originOrStream` argument, it will be parsed as - * a URL and the origin will be derived. For instance, the origin for the - * HTTP URL `'https://example.org/foo/bar'` is the ASCII string`'https://example.org'`. An error will be thrown if either the given string - * cannot be parsed as a URL or if a valid origin cannot be derived. - * - * A `URL` object, or any object with an `origin` property, may be passed as`originOrStream`, in which case the value of the `origin` property will be - * used. The value of the `origin` property _must_ be a properly serialized - * ASCII origin. - * @since v9.4.0 - * @param alt A description of the alternative service configuration as defined by `RFC 7838`. - * @param originOrStream Either a URL string specifying the origin (or an `Object` with an `origin` property) or the numeric identifier of an active `Http2Stream` as given by the - * `http2stream.id` property. - */ - altsvc(alt: string, originOrStream: number | string | url.URL | AlternativeServiceOptions): void; - /** - * Submits an `ORIGIN` frame (as defined by [RFC 8336](https://tools.ietf.org/html/rfc8336)) to the connected client - * to advertise the set of origins for which the server is capable of providing - * authoritative responses. - * - * ```js - * const http2 = require('http2'); - * const options = getSecureOptionsSomehow(); - * const server = http2.createSecureServer(options); - * server.on('stream', (stream) => { - * stream.respond(); - * stream.end('ok'); - * }); - * server.on('session', (session) => { - * session.origin('https://example.com', 'https://example.org'); - * }); - * ``` - * - * When a string is passed as an `origin`, it will be parsed as a URL and the - * origin will be derived. For instance, the origin for the HTTP URL`'https://example.org/foo/bar'` is the ASCII string`'https://example.org'`. An error will be thrown if either the given - * string - * cannot be parsed as a URL or if a valid origin cannot be derived. - * - * A `URL` object, or any object with an `origin` property, may be passed as - * an `origin`, in which case the value of the `origin` property will be - * used. The value of the `origin` property _must_ be a properly serialized - * ASCII origin. - * - * Alternatively, the `origins` option may be used when creating a new HTTP/2 - * server using the `http2.createSecureServer()` method: - * - * ```js - * const http2 = require('http2'); - * const options = getSecureOptionsSomehow(); - * options.origins = ['https://example.com', 'https://example.org']; - * const server = http2.createSecureServer(options); - * server.on('stream', (stream) => { - * stream.respond(); - * stream.end('ok'); - * }); - * ``` - * @since v10.12.0 - * @param origins One or more URL Strings passed as separate arguments. - */ - origin( - ...origins: Array< - | string - | url.URL - | { - origin: string; - } - > - ): void; - addListener(event: 'connect', listener: (session: ServerHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this; - addListener(event: 'stream', listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - emit(event: 'connect', session: ServerHttp2Session, socket: net.Socket | tls.TLSSocket): boolean; - emit(event: 'stream', stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number): boolean; - emit(event: string | symbol, ...args: any[]): boolean; - on(event: 'connect', listener: (session: ServerHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this; - on(event: 'stream', listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once(event: 'connect', listener: (session: ServerHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this; - once(event: 'stream', listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener(event: 'connect', listener: (session: ServerHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this; - prependListener(event: 'stream', listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - prependOnceListener(event: 'connect', listener: (session: ServerHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this; - prependOnceListener(event: 'stream', listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - } - // Http2Server - export interface SessionOptions { - maxDeflateDynamicTableSize?: number | undefined; - maxSessionMemory?: number | undefined; - maxHeaderListPairs?: number | undefined; - maxOutstandingPings?: number | undefined; - maxSendHeaderBlockLength?: number | undefined; - paddingStrategy?: number | undefined; - peerMaxConcurrentStreams?: number | undefined; - settings?: Settings | undefined; - /** - * Specifies a timeout in milliseconds that - * a server should wait when an [`'unknownProtocol'`][] is emitted. If the - * socket has not been destroyed by that time the server will destroy it. - * @default 100000 - */ - unknownProtocolTimeout?: number | undefined; - selectPadding?(frameLen: number, maxFrameLen: number): number; - createConnection?(authority: url.URL, option: SessionOptions): stream.Duplex; - } - export interface ClientSessionOptions extends SessionOptions { - maxReservedRemoteStreams?: number | undefined; - createConnection?: ((authority: url.URL, option: SessionOptions) => stream.Duplex) | undefined; - protocol?: 'http:' | 'https:' | undefined; - } - export interface ServerSessionOptions extends SessionOptions { - Http1IncomingMessage?: typeof IncomingMessage | undefined; - Http1ServerResponse?: typeof ServerResponse | undefined; - Http2ServerRequest?: typeof Http2ServerRequest | undefined; - Http2ServerResponse?: typeof Http2ServerResponse | undefined; - } - export interface SecureClientSessionOptions extends ClientSessionOptions, tls.ConnectionOptions {} - export interface SecureServerSessionOptions extends ServerSessionOptions, tls.TlsOptions {} - export interface ServerOptions extends ServerSessionOptions {} - export interface SecureServerOptions extends SecureServerSessionOptions { - allowHTTP1?: boolean | undefined; - origins?: string[] | undefined; - } - interface HTTP2ServerCommon { - setTimeout(msec?: number, callback?: () => void): this; - /** - * Throws ERR_HTTP2_INVALID_SETTING_VALUE for invalid settings values. - * Throws ERR_INVALID_ARG_TYPE for invalid settings argument. - */ - updateSettings(settings: Settings): void; - } - export interface Http2Server extends net.Server, HTTP2ServerCommon { - addListener(event: 'checkContinue', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; - addListener(event: 'request', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; - addListener(event: 'session', listener: (session: ServerHttp2Session) => void): this; - addListener(event: 'sessionError', listener: (err: Error) => void): this; - addListener(event: 'stream', listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; - addListener(event: 'timeout', listener: () => void): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - emit(event: 'checkContinue', request: Http2ServerRequest, response: Http2ServerResponse): boolean; - emit(event: 'request', request: Http2ServerRequest, response: Http2ServerResponse): boolean; - emit(event: 'session', session: ServerHttp2Session): boolean; - emit(event: 'sessionError', err: Error): boolean; - emit(event: 'stream', stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number): boolean; - emit(event: 'timeout'): boolean; - emit(event: string | symbol, ...args: any[]): boolean; - on(event: 'checkContinue', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; - on(event: 'request', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; - on(event: 'session', listener: (session: ServerHttp2Session) => void): this; - on(event: 'sessionError', listener: (err: Error) => void): this; - on(event: 'stream', listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; - on(event: 'timeout', listener: () => void): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once(event: 'checkContinue', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; - once(event: 'request', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; - once(event: 'session', listener: (session: ServerHttp2Session) => void): this; - once(event: 'sessionError', listener: (err: Error) => void): this; - once(event: 'stream', listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; - once(event: 'timeout', listener: () => void): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener(event: 'checkContinue', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; - prependListener(event: 'request', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; - prependListener(event: 'session', listener: (session: ServerHttp2Session) => void): this; - prependListener(event: 'sessionError', listener: (err: Error) => void): this; - prependListener(event: 'stream', listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; - prependListener(event: 'timeout', listener: () => void): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - prependOnceListener(event: 'checkContinue', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; - prependOnceListener(event: 'request', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; - prependOnceListener(event: 'session', listener: (session: ServerHttp2Session) => void): this; - prependOnceListener(event: 'sessionError', listener: (err: Error) => void): this; - prependOnceListener(event: 'stream', listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; - prependOnceListener(event: 'timeout', listener: () => void): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - } - export interface Http2SecureServer extends tls.Server, HTTP2ServerCommon { - addListener(event: 'checkContinue', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; - addListener(event: 'request', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; - addListener(event: 'session', listener: (session: ServerHttp2Session) => void): this; - addListener(event: 'sessionError', listener: (err: Error) => void): this; - addListener(event: 'stream', listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; - addListener(event: 'timeout', listener: () => void): this; - addListener(event: 'unknownProtocol', listener: (socket: tls.TLSSocket) => void): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - emit(event: 'checkContinue', request: Http2ServerRequest, response: Http2ServerResponse): boolean; - emit(event: 'request', request: Http2ServerRequest, response: Http2ServerResponse): boolean; - emit(event: 'session', session: ServerHttp2Session): boolean; - emit(event: 'sessionError', err: Error): boolean; - emit(event: 'stream', stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number): boolean; - emit(event: 'timeout'): boolean; - emit(event: 'unknownProtocol', socket: tls.TLSSocket): boolean; - emit(event: string | symbol, ...args: any[]): boolean; - on(event: 'checkContinue', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; - on(event: 'request', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; - on(event: 'session', listener: (session: ServerHttp2Session) => void): this; - on(event: 'sessionError', listener: (err: Error) => void): this; - on(event: 'stream', listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; - on(event: 'timeout', listener: () => void): this; - on(event: 'unknownProtocol', listener: (socket: tls.TLSSocket) => void): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once(event: 'checkContinue', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; - once(event: 'request', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; - once(event: 'session', listener: (session: ServerHttp2Session) => void): this; - once(event: 'sessionError', listener: (err: Error) => void): this; - once(event: 'stream', listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; - once(event: 'timeout', listener: () => void): this; - once(event: 'unknownProtocol', listener: (socket: tls.TLSSocket) => void): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener(event: 'checkContinue', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; - prependListener(event: 'request', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; - prependListener(event: 'session', listener: (session: ServerHttp2Session) => void): this; - prependListener(event: 'sessionError', listener: (err: Error) => void): this; - prependListener(event: 'stream', listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; - prependListener(event: 'timeout', listener: () => void): this; - prependListener(event: 'unknownProtocol', listener: (socket: tls.TLSSocket) => void): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - prependOnceListener(event: 'checkContinue', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; - prependOnceListener(event: 'request', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; - prependOnceListener(event: 'session', listener: (session: ServerHttp2Session) => void): this; - prependOnceListener(event: 'sessionError', listener: (err: Error) => void): this; - prependOnceListener(event: 'stream', listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; - prependOnceListener(event: 'timeout', listener: () => void): this; - prependOnceListener(event: 'unknownProtocol', listener: (socket: tls.TLSSocket) => void): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - } - /** - * A `Http2ServerRequest` object is created by {@link Server} or {@link SecureServer} and passed as the first argument to the `'request'` event. It may be used to access a request status, - * headers, and - * data. - * @since v8.4.0 - */ - export class Http2ServerRequest extends stream.Readable { - constructor(stream: ServerHttp2Stream, headers: IncomingHttpHeaders, options: stream.ReadableOptions, rawHeaders: ReadonlyArray); - /** - * The `request.aborted` property will be `true` if the request has - * been aborted. - * @since v10.1.0 - */ - readonly aborted: boolean; - /** - * The request authority pseudo header field. Because HTTP/2 allows requests - * to set either `:authority` or `host`, this value is derived from`req.headers[':authority']` if present. Otherwise, it is derived from`req.headers['host']`. - * @since v8.4.0 - */ - readonly authority: string; - /** - * See `request.socket`. - * @since v8.4.0 - * @deprecated Since v13.0.0 - Use `socket`. - */ - readonly connection: net.Socket | tls.TLSSocket; - /** - * The `request.complete` property will be `true` if the request has - * been completed, aborted, or destroyed. - * @since v12.10.0 - */ - readonly complete: boolean; - /** - * The request/response headers object. - * - * Key-value pairs of header names and values. Header names are lower-cased. - * - * ```js - * // Prints something like: - * // - * // { 'user-agent': 'curl/7.22.0', - * // host: '127.0.0.1:8000', - * // accept: '*' } - * console.log(request.headers); - * ``` - * - * See `HTTP/2 Headers Object`. - * - * In HTTP/2, the request path, host name, protocol, and method are represented as - * special headers prefixed with the `:` character (e.g. `':path'`). These special - * headers will be included in the `request.headers` object. Care must be taken not - * to inadvertently modify these special headers or errors may occur. For instance, - * removing all headers from the request will cause errors to occur: - * - * ```js - * removeAllHeaders(request.headers); - * assert(request.url); // Fails because the :path header has been removed - * ``` - * @since v8.4.0 - */ - readonly headers: IncomingHttpHeaders; - /** - * In case of server request, the HTTP version sent by the client. In the case of - * client response, the HTTP version of the connected-to server. Returns`'2.0'`. - * - * Also `message.httpVersionMajor` is the first integer and`message.httpVersionMinor` is the second. - * @since v8.4.0 - */ - readonly httpVersion: string; - readonly httpVersionMinor: number; - readonly httpVersionMajor: number; - /** - * The request method as a string. Read-only. Examples: `'GET'`, `'DELETE'`. - * @since v8.4.0 - */ - readonly method: string; - /** - * The raw request/response headers list exactly as they were received. - * - * The keys and values are in the same list. It is _not_ a - * list of tuples. So, the even-numbered offsets are key values, and the - * odd-numbered offsets are the associated values. - * - * Header names are not lowercased, and duplicates are not merged. - * - * ```js - * // Prints something like: - * // - * // [ 'user-agent', - * // 'this is invalid because there can be only one', - * // 'User-Agent', - * // 'curl/7.22.0', - * // 'Host', - * // '127.0.0.1:8000', - * // 'ACCEPT', - * // '*' ] - * console.log(request.rawHeaders); - * ``` - * @since v8.4.0 - */ - readonly rawHeaders: string[]; - /** - * The raw request/response trailer keys and values exactly as they were - * received. Only populated at the `'end'` event. - * @since v8.4.0 - */ - readonly rawTrailers: string[]; - /** - * The request scheme pseudo header field indicating the scheme - * portion of the target URL. - * @since v8.4.0 - */ - readonly scheme: string; - /** - * Returns a `Proxy` object that acts as a `net.Socket` (or `tls.TLSSocket`) but - * applies getters, setters, and methods based on HTTP/2 logic. - * - * `destroyed`, `readable`, and `writable` properties will be retrieved from and - * set on `request.stream`. - * - * `destroy`, `emit`, `end`, `on` and `once` methods will be called on`request.stream`. - * - * `setTimeout` method will be called on `request.stream.session`. - * - * `pause`, `read`, `resume`, and `write` will throw an error with code`ERR_HTTP2_NO_SOCKET_MANIPULATION`. See `Http2Session and Sockets` for - * more information. - * - * All other interactions will be routed directly to the socket. With TLS support, - * use `request.socket.getPeerCertificate()` to obtain the client's - * authentication details. - * @since v8.4.0 - */ - readonly socket: net.Socket | tls.TLSSocket; - /** - * The `Http2Stream` object backing the request. - * @since v8.4.0 - */ - readonly stream: ServerHttp2Stream; - /** - * The request/response trailers object. Only populated at the `'end'` event. - * @since v8.4.0 - */ - readonly trailers: IncomingHttpHeaders; - /** - * Request URL string. This contains only the URL that is present in the actual - * HTTP request. If the request is: - * - * ```http - * GET /status?name=ryan HTTP/1.1 - * Accept: text/plain - * ``` - * - * Then `request.url` will be: - * - * ```js - * '/status?name=ryan' - * ``` - * - * To parse the url into its parts, `new URL()` can be used: - * - * ```console - * $ node - * > new URL('/status?name=ryan', 'http://example.com') - * URL { - * href: 'http://example.com/status?name=ryan', - * origin: 'http://example.com', - * protocol: 'http:', - * username: '', - * password: '', - * host: 'example.com', - * hostname: 'example.com', - * port: '', - * pathname: '/status', - * search: '?name=ryan', - * searchParams: URLSearchParams { 'name' => 'ryan' }, - * hash: '' - * } - * ``` - * @since v8.4.0 - */ - url: string; - /** - * Sets the `Http2Stream`'s timeout value to `msecs`. If a callback is - * provided, then it is added as a listener on the `'timeout'` event on - * the response object. - * - * If no `'timeout'` listener is added to the request, the response, or - * the server, then `Http2Stream` s are destroyed when they time out. If a - * handler is assigned to the request, the response, or the server's `'timeout'`events, timed out sockets must be handled explicitly. - * @since v8.4.0 - */ - setTimeout(msecs: number, callback?: () => void): void; - read(size?: number): Buffer | string | null; - addListener(event: 'aborted', listener: (hadError: boolean, code: number) => void): this; - addListener(event: 'close', listener: () => void): this; - addListener(event: 'data', listener: (chunk: Buffer | string) => void): this; - addListener(event: 'end', listener: () => void): this; - addListener(event: 'readable', listener: () => void): this; - addListener(event: 'error', listener: (err: Error) => void): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - emit(event: 'aborted', hadError: boolean, code: number): boolean; - emit(event: 'close'): boolean; - emit(event: 'data', chunk: Buffer | string): boolean; - emit(event: 'end'): boolean; - emit(event: 'readable'): boolean; - emit(event: 'error', err: Error): boolean; - emit(event: string | symbol, ...args: any[]): boolean; - on(event: 'aborted', listener: (hadError: boolean, code: number) => void): this; - on(event: 'close', listener: () => void): this; - on(event: 'data', listener: (chunk: Buffer | string) => void): this; - on(event: 'end', listener: () => void): this; - on(event: 'readable', listener: () => void): this; - on(event: 'error', listener: (err: Error) => void): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once(event: 'aborted', listener: (hadError: boolean, code: number) => void): this; - once(event: 'close', listener: () => void): this; - once(event: 'data', listener: (chunk: Buffer | string) => void): this; - once(event: 'end', listener: () => void): this; - once(event: 'readable', listener: () => void): this; - once(event: 'error', listener: (err: Error) => void): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener(event: 'aborted', listener: (hadError: boolean, code: number) => void): this; - prependListener(event: 'close', listener: () => void): this; - prependListener(event: 'data', listener: (chunk: Buffer | string) => void): this; - prependListener(event: 'end', listener: () => void): this; - prependListener(event: 'readable', listener: () => void): this; - prependListener(event: 'error', listener: (err: Error) => void): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - prependOnceListener(event: 'aborted', listener: (hadError: boolean, code: number) => void): this; - prependOnceListener(event: 'close', listener: () => void): this; - prependOnceListener(event: 'data', listener: (chunk: Buffer | string) => void): this; - prependOnceListener(event: 'end', listener: () => void): this; - prependOnceListener(event: 'readable', listener: () => void): this; - prependOnceListener(event: 'error', listener: (err: Error) => void): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - } - /** - * This object is created internally by an HTTP server, not by the user. It is - * passed as the second parameter to the `'request'` event. - * @since v8.4.0 - */ - export class Http2ServerResponse extends stream.Writable { - constructor(stream: ServerHttp2Stream); - /** - * See `response.socket`. - * @since v8.4.0 - * @deprecated Since v13.0.0 - Use `socket`. - */ - readonly connection: net.Socket | tls.TLSSocket; - /** - * Boolean value that indicates whether the response has completed. Starts - * as `false`. After `response.end()` executes, the value will be `true`. - * @since v8.4.0 - * @deprecated Since v13.4.0,v12.16.0 - Use `writableEnded`. - */ - readonly finished: boolean; - /** - * True if headers were sent, false otherwise (read-only). - * @since v8.4.0 - */ - readonly headersSent: boolean; - /** - * A reference to the original HTTP2 request object. - * @since v15.7.0 - */ - readonly req: Http2ServerRequest; - /** - * Returns a `Proxy` object that acts as a `net.Socket` (or `tls.TLSSocket`) but - * applies getters, setters, and methods based on HTTP/2 logic. - * - * `destroyed`, `readable`, and `writable` properties will be retrieved from and - * set on `response.stream`. - * - * `destroy`, `emit`, `end`, `on` and `once` methods will be called on`response.stream`. - * - * `setTimeout` method will be called on `response.stream.session`. - * - * `pause`, `read`, `resume`, and `write` will throw an error with code`ERR_HTTP2_NO_SOCKET_MANIPULATION`. See `Http2Session and Sockets` for - * more information. - * - * All other interactions will be routed directly to the socket. - * - * ```js - * const http2 = require('http2'); - * const server = http2.createServer((req, res) => { - * const ip = req.socket.remoteAddress; - * const port = req.socket.remotePort; - * res.end(`Your IP address is ${ip} and your source port is ${port}.`); - * }).listen(3000); - * ``` - * @since v8.4.0 - */ - readonly socket: net.Socket | tls.TLSSocket; - /** - * The `Http2Stream` object backing the response. - * @since v8.4.0 - */ - readonly stream: ServerHttp2Stream; - /** - * When true, the Date header will be automatically generated and sent in - * the response if it is not already present in the headers. Defaults to true. - * - * This should only be disabled for testing; HTTP requires the Date header - * in responses. - * @since v8.4.0 - */ - sendDate: boolean; - /** - * When using implicit headers (not calling `response.writeHead()` explicitly), - * this property controls the status code that will be sent to the client when - * the headers get flushed. - * - * ```js - * response.statusCode = 404; - * ``` - * - * After response header was sent to the client, this property indicates the - * status code which was sent out. - * @since v8.4.0 - */ - statusCode: number; - /** - * Status message is not supported by HTTP/2 (RFC 7540 8.1.2.4). It returns - * an empty string. - * @since v8.4.0 - */ - statusMessage: ''; - /** - * This method adds HTTP trailing headers (a header but at the end of the - * message) to the response. - * - * Attempting to set a header field name or value that contains invalid characters - * will result in a `TypeError` being thrown. - * @since v8.4.0 - */ - addTrailers(trailers: OutgoingHttpHeaders): void; - /** - * This method signals to the server that all of the response headers and body - * have been sent; that server should consider this message complete. - * The method, `response.end()`, MUST be called on each response. - * - * If `data` is specified, it is equivalent to calling `response.write(data, encoding)` followed by `response.end(callback)`. - * - * If `callback` is specified, it will be called when the response stream - * is finished. - * @since v8.4.0 - */ - end(callback?: () => void): this; - end(data: string | Uint8Array, callback?: () => void): this; - end(data: string | Uint8Array, encoding: BufferEncoding, callback?: () => void): this; - /** - * Reads out a header that has already been queued but not sent to the client. - * The name is case-insensitive. - * - * ```js - * const contentType = response.getHeader('content-type'); - * ``` - * @since v8.4.0 - */ - getHeader(name: string): string; - /** - * Returns an array containing the unique names of the current outgoing headers. - * All header names are lowercase. - * - * ```js - * response.setHeader('Foo', 'bar'); - * response.setHeader('Set-Cookie', ['foo=bar', 'bar=baz']); - * - * const headerNames = response.getHeaderNames(); - * // headerNames === ['foo', 'set-cookie'] - * ``` - * @since v8.4.0 - */ - getHeaderNames(): string[]; - /** - * Returns a shallow copy of the current outgoing headers. Since a shallow copy - * is used, array values may be mutated without additional calls to various - * header-related http module methods. The keys of the returned object are the - * header names and the values are the respective header values. All header names - * are lowercase. - * - * The object returned by the `response.getHeaders()` method _does not_prototypically inherit from the JavaScript `Object`. This means that typical`Object` methods such as `obj.toString()`, - * `obj.hasOwnProperty()`, and others - * are not defined and _will not work_. - * - * ```js - * response.setHeader('Foo', 'bar'); - * response.setHeader('Set-Cookie', ['foo=bar', 'bar=baz']); - * - * const headers = response.getHeaders(); - * // headers === { foo: 'bar', 'set-cookie': ['foo=bar', 'bar=baz'] } - * ``` - * @since v8.4.0 - */ - getHeaders(): OutgoingHttpHeaders; - /** - * Returns `true` if the header identified by `name` is currently set in the - * outgoing headers. The header name matching is case-insensitive. - * - * ```js - * const hasContentType = response.hasHeader('content-type'); - * ``` - * @since v8.4.0 - */ - hasHeader(name: string): boolean; - /** - * Removes a header that has been queued for implicit sending. - * - * ```js - * response.removeHeader('Content-Encoding'); - * ``` - * @since v8.4.0 - */ - removeHeader(name: string): void; - /** - * Sets a single header value for implicit headers. If this header already exists - * in the to-be-sent headers, its value will be replaced. Use an array of strings - * here to send multiple headers with the same name. - * - * ```js - * response.setHeader('Content-Type', 'text/html; charset=utf-8'); - * ``` - * - * or - * - * ```js - * response.setHeader('Set-Cookie', ['type=ninja', 'language=javascript']); - * ``` - * - * Attempting to set a header field name or value that contains invalid characters - * will result in a `TypeError` being thrown. - * - * When headers have been set with `response.setHeader()`, they will be merged - * with any headers passed to `response.writeHead()`, with the headers passed - * to `response.writeHead()` given precedence. - * - * ```js - * // Returns content-type = text/plain - * const server = http2.createServer((req, res) => { - * res.setHeader('Content-Type', 'text/html; charset=utf-8'); - * res.setHeader('X-Foo', 'bar'); - * res.writeHead(200, { 'Content-Type': 'text/plain; charset=utf-8' }); - * res.end('ok'); - * }); - * ``` - * @since v8.4.0 - */ - setHeader(name: string, value: number | string | ReadonlyArray): void; - /** - * Sets the `Http2Stream`'s timeout value to `msecs`. If a callback is - * provided, then it is added as a listener on the `'timeout'` event on - * the response object. - * - * If no `'timeout'` listener is added to the request, the response, or - * the server, then `Http2Stream` s are destroyed when they time out. If a - * handler is assigned to the request, the response, or the server's `'timeout'`events, timed out sockets must be handled explicitly. - * @since v8.4.0 - */ - setTimeout(msecs: number, callback?: () => void): void; - /** - * If this method is called and `response.writeHead()` has not been called, - * it will switch to implicit header mode and flush the implicit headers. - * - * This sends a chunk of the response body. This method may - * be called multiple times to provide successive parts of the body. - * - * In the `http` module, the response body is omitted when the - * request is a HEAD request. Similarly, the `204` and `304` responses _must not_ include a message body. - * - * `chunk` can be a string or a buffer. If `chunk` is a string, - * the second parameter specifies how to encode it into a byte stream. - * By default the `encoding` is `'utf8'`. `callback` will be called when this chunk - * of data is flushed. - * - * This is the raw HTTP body and has nothing to do with higher-level multi-part - * body encodings that may be used. - * - * The first time `response.write()` is called, it will send the buffered - * header information and the first chunk of the body to the client. The second - * time `response.write()` is called, Node.js assumes data will be streamed, - * and sends the new data separately. That is, the response is buffered up to the - * first chunk of the body. - * - * Returns `true` if the entire data was flushed successfully to the kernel - * buffer. Returns `false` if all or part of the data was queued in user memory.`'drain'` will be emitted when the buffer is free again. - * @since v8.4.0 - */ - write(chunk: string | Uint8Array, callback?: (err: Error) => void): boolean; - write(chunk: string | Uint8Array, encoding: BufferEncoding, callback?: (err: Error) => void): boolean; - /** - * Sends a status `100 Continue` to the client, indicating that the request body - * should be sent. See the `'checkContinue'` event on `Http2Server` and`Http2SecureServer`. - * @since v8.4.0 - */ - writeContinue(): void; - /** - * Sends a status `103 Early Hints` to the client with a Link header, - * indicating that the user agent can preload/preconnect the linked resources. - * The `hints` is an object containing the values of headers to be sent with - * early hints message. - * - * Example: - * - * ```js - * const earlyHintsLink = '; rel=preload; as=style'; - * response.writeEarlyHints({ - * 'link': earlyHintsLink, - * }); - * - * const earlyHintsLinks = [ - * '; rel=preload; as=style', - * '; rel=preload; as=script', - * ]; - * response.writeEarlyHints({ - * 'link': earlyHintsLinks, - * 'x-trace-id': 'id for diagnostics' - * }); - * ``` - * - * @since v18.11.0 - * @param hints An object containing the values of headers - */ - writeEarlyHints(hints: Record): void; - /** - * Sends a response header to the request. The status code is a 3-digit HTTP - * status code, like `404`. The last argument, `headers`, are the response headers. - * - * Returns a reference to the `Http2ServerResponse`, so that calls can be chained. - * - * For compatibility with `HTTP/1`, a human-readable `statusMessage` may be - * passed as the second argument. However, because the `statusMessage` has no - * meaning within HTTP/2, the argument will have no effect and a process warning - * will be emitted. - * - * ```js - * const body = 'hello world'; - * response.writeHead(200, { - * 'Content-Length': Buffer.byteLength(body), - * 'Content-Type': 'text/plain; charset=utf-8', - * }); - * ``` - * - * `Content-Length` is given in bytes not characters. The`Buffer.byteLength()` API may be used to determine the number of bytes in a - * given encoding. On outbound messages, Node.js does not check if Content-Length - * and the length of the body being transmitted are equal or not. However, when - * receiving messages, Node.js will automatically reject messages when the`Content-Length` does not match the actual payload size. - * - * This method may be called at most one time on a message before `response.end()` is called. - * - * If `response.write()` or `response.end()` are called before calling - * this, the implicit/mutable headers will be calculated and call this function. - * - * When headers have been set with `response.setHeader()`, they will be merged - * with any headers passed to `response.writeHead()`, with the headers passed - * to `response.writeHead()` given precedence. - * - * ```js - * // Returns content-type = text/plain - * const server = http2.createServer((req, res) => { - * res.setHeader('Content-Type', 'text/html; charset=utf-8'); - * res.setHeader('X-Foo', 'bar'); - * res.writeHead(200, { 'Content-Type': 'text/plain; charset=utf-8' }); - * res.end('ok'); - * }); - * ``` - * - * Attempting to set a header field name or value that contains invalid characters - * will result in a `TypeError` being thrown. - * @since v8.4.0 - */ - writeHead(statusCode: number, headers?: OutgoingHttpHeaders): this; - writeHead(statusCode: number, statusMessage: string, headers?: OutgoingHttpHeaders): this; - /** - * Call `http2stream.pushStream()` with the given headers, and wrap the - * given `Http2Stream` on a newly created `Http2ServerResponse` as the callback - * parameter if successful. When `Http2ServerRequest` is closed, the callback is - * called with an error `ERR_HTTP2_INVALID_STREAM`. - * @since v8.4.0 - * @param headers An object describing the headers - * @param callback Called once `http2stream.pushStream()` is finished, or either when the attempt to create the pushed `Http2Stream` has failed or has been rejected, or the state of - * `Http2ServerRequest` is closed prior to calling the `http2stream.pushStream()` method - */ - createPushResponse(headers: OutgoingHttpHeaders, callback: (err: Error | null, res: Http2ServerResponse) => void): void; - addListener(event: 'close', listener: () => void): this; - addListener(event: 'drain', listener: () => void): this; - addListener(event: 'error', listener: (error: Error) => void): this; - addListener(event: 'finish', listener: () => void): this; - addListener(event: 'pipe', listener: (src: stream.Readable) => void): this; - addListener(event: 'unpipe', listener: (src: stream.Readable) => void): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - emit(event: 'close'): boolean; - emit(event: 'drain'): boolean; - emit(event: 'error', error: Error): boolean; - emit(event: 'finish'): boolean; - emit(event: 'pipe', src: stream.Readable): boolean; - emit(event: 'unpipe', src: stream.Readable): boolean; - emit(event: string | symbol, ...args: any[]): boolean; - on(event: 'close', listener: () => void): this; - on(event: 'drain', listener: () => void): this; - on(event: 'error', listener: (error: Error) => void): this; - on(event: 'finish', listener: () => void): this; - on(event: 'pipe', listener: (src: stream.Readable) => void): this; - on(event: 'unpipe', listener: (src: stream.Readable) => void): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once(event: 'close', listener: () => void): this; - once(event: 'drain', listener: () => void): this; - once(event: 'error', listener: (error: Error) => void): this; - once(event: 'finish', listener: () => void): this; - once(event: 'pipe', listener: (src: stream.Readable) => void): this; - once(event: 'unpipe', listener: (src: stream.Readable) => void): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener(event: 'close', listener: () => void): this; - prependListener(event: 'drain', listener: () => void): this; - prependListener(event: 'error', listener: (error: Error) => void): this; - prependListener(event: 'finish', listener: () => void): this; - prependListener(event: 'pipe', listener: (src: stream.Readable) => void): this; - prependListener(event: 'unpipe', listener: (src: stream.Readable) => void): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - prependOnceListener(event: 'close', listener: () => void): this; - prependOnceListener(event: 'drain', listener: () => void): this; - prependOnceListener(event: 'error', listener: (error: Error) => void): this; - prependOnceListener(event: 'finish', listener: () => void): this; - prependOnceListener(event: 'pipe', listener: (src: stream.Readable) => void): this; - prependOnceListener(event: 'unpipe', listener: (src: stream.Readable) => void): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - } - export namespace constants { - const NGHTTP2_SESSION_SERVER: number; - const NGHTTP2_SESSION_CLIENT: number; - const NGHTTP2_STREAM_STATE_IDLE: number; - const NGHTTP2_STREAM_STATE_OPEN: number; - const NGHTTP2_STREAM_STATE_RESERVED_LOCAL: number; - const NGHTTP2_STREAM_STATE_RESERVED_REMOTE: number; - const NGHTTP2_STREAM_STATE_HALF_CLOSED_LOCAL: number; - const NGHTTP2_STREAM_STATE_HALF_CLOSED_REMOTE: number; - const NGHTTP2_STREAM_STATE_CLOSED: number; - const NGHTTP2_NO_ERROR: number; - const NGHTTP2_PROTOCOL_ERROR: number; - const NGHTTP2_INTERNAL_ERROR: number; - const NGHTTP2_FLOW_CONTROL_ERROR: number; - const NGHTTP2_SETTINGS_TIMEOUT: number; - const NGHTTP2_STREAM_CLOSED: number; - const NGHTTP2_FRAME_SIZE_ERROR: number; - const NGHTTP2_REFUSED_STREAM: number; - const NGHTTP2_CANCEL: number; - const NGHTTP2_COMPRESSION_ERROR: number; - const NGHTTP2_CONNECT_ERROR: number; - const NGHTTP2_ENHANCE_YOUR_CALM: number; - const NGHTTP2_INADEQUATE_SECURITY: number; - const NGHTTP2_HTTP_1_1_REQUIRED: number; - const NGHTTP2_ERR_FRAME_SIZE_ERROR: number; - const NGHTTP2_FLAG_NONE: number; - const NGHTTP2_FLAG_END_STREAM: number; - const NGHTTP2_FLAG_END_HEADERS: number; - const NGHTTP2_FLAG_ACK: number; - const NGHTTP2_FLAG_PADDED: number; - const NGHTTP2_FLAG_PRIORITY: number; - const DEFAULT_SETTINGS_HEADER_TABLE_SIZE: number; - const DEFAULT_SETTINGS_ENABLE_PUSH: number; - const DEFAULT_SETTINGS_INITIAL_WINDOW_SIZE: number; - const DEFAULT_SETTINGS_MAX_FRAME_SIZE: number; - const MAX_MAX_FRAME_SIZE: number; - const MIN_MAX_FRAME_SIZE: number; - const MAX_INITIAL_WINDOW_SIZE: number; - const NGHTTP2_DEFAULT_WEIGHT: number; - const NGHTTP2_SETTINGS_HEADER_TABLE_SIZE: number; - const NGHTTP2_SETTINGS_ENABLE_PUSH: number; - const NGHTTP2_SETTINGS_MAX_CONCURRENT_STREAMS: number; - const NGHTTP2_SETTINGS_INITIAL_WINDOW_SIZE: number; - const NGHTTP2_SETTINGS_MAX_FRAME_SIZE: number; - const NGHTTP2_SETTINGS_MAX_HEADER_LIST_SIZE: number; - const PADDING_STRATEGY_NONE: number; - const PADDING_STRATEGY_MAX: number; - const PADDING_STRATEGY_CALLBACK: number; - const HTTP2_HEADER_STATUS: string; - const HTTP2_HEADER_METHOD: string; - const HTTP2_HEADER_AUTHORITY: string; - const HTTP2_HEADER_SCHEME: string; - const HTTP2_HEADER_PATH: string; - const HTTP2_HEADER_ACCEPT_CHARSET: string; - const HTTP2_HEADER_ACCEPT_ENCODING: string; - const HTTP2_HEADER_ACCEPT_LANGUAGE: string; - const HTTP2_HEADER_ACCEPT_RANGES: string; - const HTTP2_HEADER_ACCEPT: string; - const HTTP2_HEADER_ACCESS_CONTROL_ALLOW_ORIGIN: string; - const HTTP2_HEADER_AGE: string; - const HTTP2_HEADER_ALLOW: string; - const HTTP2_HEADER_AUTHORIZATION: string; - const HTTP2_HEADER_CACHE_CONTROL: string; - const HTTP2_HEADER_CONNECTION: string; - const HTTP2_HEADER_CONTENT_DISPOSITION: string; - const HTTP2_HEADER_CONTENT_ENCODING: string; - const HTTP2_HEADER_CONTENT_LANGUAGE: string; - const HTTP2_HEADER_CONTENT_LENGTH: string; - const HTTP2_HEADER_CONTENT_LOCATION: string; - const HTTP2_HEADER_CONTENT_MD5: string; - const HTTP2_HEADER_CONTENT_RANGE: string; - const HTTP2_HEADER_CONTENT_TYPE: string; - const HTTP2_HEADER_COOKIE: string; - const HTTP2_HEADER_DATE: string; - const HTTP2_HEADER_ETAG: string; - const HTTP2_HEADER_EXPECT: string; - const HTTP2_HEADER_EXPIRES: string; - const HTTP2_HEADER_FROM: string; - const HTTP2_HEADER_HOST: string; - const HTTP2_HEADER_IF_MATCH: string; - const HTTP2_HEADER_IF_MODIFIED_SINCE: string; - const HTTP2_HEADER_IF_NONE_MATCH: string; - const HTTP2_HEADER_IF_RANGE: string; - const HTTP2_HEADER_IF_UNMODIFIED_SINCE: string; - const HTTP2_HEADER_LAST_MODIFIED: string; - const HTTP2_HEADER_LINK: string; - const HTTP2_HEADER_LOCATION: string; - const HTTP2_HEADER_MAX_FORWARDS: string; - const HTTP2_HEADER_PREFER: string; - const HTTP2_HEADER_PROXY_AUTHENTICATE: string; - const HTTP2_HEADER_PROXY_AUTHORIZATION: string; - const HTTP2_HEADER_RANGE: string; - const HTTP2_HEADER_REFERER: string; - const HTTP2_HEADER_REFRESH: string; - const HTTP2_HEADER_RETRY_AFTER: string; - const HTTP2_HEADER_SERVER: string; - const HTTP2_HEADER_SET_COOKIE: string; - const HTTP2_HEADER_STRICT_TRANSPORT_SECURITY: string; - const HTTP2_HEADER_TRANSFER_ENCODING: string; - const HTTP2_HEADER_TE: string; - const HTTP2_HEADER_UPGRADE: string; - const HTTP2_HEADER_USER_AGENT: string; - const HTTP2_HEADER_VARY: string; - const HTTP2_HEADER_VIA: string; - const HTTP2_HEADER_WWW_AUTHENTICATE: string; - const HTTP2_HEADER_HTTP2_SETTINGS: string; - const HTTP2_HEADER_KEEP_ALIVE: string; - const HTTP2_HEADER_PROXY_CONNECTION: string; - const HTTP2_METHOD_ACL: string; - const HTTP2_METHOD_BASELINE_CONTROL: string; - const HTTP2_METHOD_BIND: string; - const HTTP2_METHOD_CHECKIN: string; - const HTTP2_METHOD_CHECKOUT: string; - const HTTP2_METHOD_CONNECT: string; - const HTTP2_METHOD_COPY: string; - const HTTP2_METHOD_DELETE: string; - const HTTP2_METHOD_GET: string; - const HTTP2_METHOD_HEAD: string; - const HTTP2_METHOD_LABEL: string; - const HTTP2_METHOD_LINK: string; - const HTTP2_METHOD_LOCK: string; - const HTTP2_METHOD_MERGE: string; - const HTTP2_METHOD_MKACTIVITY: string; - const HTTP2_METHOD_MKCALENDAR: string; - const HTTP2_METHOD_MKCOL: string; - const HTTP2_METHOD_MKREDIRECTREF: string; - const HTTP2_METHOD_MKWORKSPACE: string; - const HTTP2_METHOD_MOVE: string; - const HTTP2_METHOD_OPTIONS: string; - const HTTP2_METHOD_ORDERPATCH: string; - const HTTP2_METHOD_PATCH: string; - const HTTP2_METHOD_POST: string; - const HTTP2_METHOD_PRI: string; - const HTTP2_METHOD_PROPFIND: string; - const HTTP2_METHOD_PROPPATCH: string; - const HTTP2_METHOD_PUT: string; - const HTTP2_METHOD_REBIND: string; - const HTTP2_METHOD_REPORT: string; - const HTTP2_METHOD_SEARCH: string; - const HTTP2_METHOD_TRACE: string; - const HTTP2_METHOD_UNBIND: string; - const HTTP2_METHOD_UNCHECKOUT: string; - const HTTP2_METHOD_UNLINK: string; - const HTTP2_METHOD_UNLOCK: string; - const HTTP2_METHOD_UPDATE: string; - const HTTP2_METHOD_UPDATEREDIRECTREF: string; - const HTTP2_METHOD_VERSION_CONTROL: string; - const HTTP_STATUS_CONTINUE: number; - const HTTP_STATUS_SWITCHING_PROTOCOLS: number; - const HTTP_STATUS_PROCESSING: number; - const HTTP_STATUS_OK: number; - const HTTP_STATUS_CREATED: number; - const HTTP_STATUS_ACCEPTED: number; - const HTTP_STATUS_NON_AUTHORITATIVE_INFORMATION: number; - const HTTP_STATUS_NO_CONTENT: number; - const HTTP_STATUS_RESET_CONTENT: number; - const HTTP_STATUS_PARTIAL_CONTENT: number; - const HTTP_STATUS_MULTI_STATUS: number; - const HTTP_STATUS_ALREADY_REPORTED: number; - const HTTP_STATUS_IM_USED: number; - const HTTP_STATUS_MULTIPLE_CHOICES: number; - const HTTP_STATUS_MOVED_PERMANENTLY: number; - const HTTP_STATUS_FOUND: number; - const HTTP_STATUS_SEE_OTHER: number; - const HTTP_STATUS_NOT_MODIFIED: number; - const HTTP_STATUS_USE_PROXY: number; - const HTTP_STATUS_TEMPORARY_REDIRECT: number; - const HTTP_STATUS_PERMANENT_REDIRECT: number; - const HTTP_STATUS_BAD_REQUEST: number; - const HTTP_STATUS_UNAUTHORIZED: number; - const HTTP_STATUS_PAYMENT_REQUIRED: number; - const HTTP_STATUS_FORBIDDEN: number; - const HTTP_STATUS_NOT_FOUND: number; - const HTTP_STATUS_METHOD_NOT_ALLOWED: number; - const HTTP_STATUS_NOT_ACCEPTABLE: number; - const HTTP_STATUS_PROXY_AUTHENTICATION_REQUIRED: number; - const HTTP_STATUS_REQUEST_TIMEOUT: number; - const HTTP_STATUS_CONFLICT: number; - const HTTP_STATUS_GONE: number; - const HTTP_STATUS_LENGTH_REQUIRED: number; - const HTTP_STATUS_PRECONDITION_FAILED: number; - const HTTP_STATUS_PAYLOAD_TOO_LARGE: number; - const HTTP_STATUS_URI_TOO_LONG: number; - const HTTP_STATUS_UNSUPPORTED_MEDIA_TYPE: number; - const HTTP_STATUS_RANGE_NOT_SATISFIABLE: number; - const HTTP_STATUS_EXPECTATION_FAILED: number; - const HTTP_STATUS_TEAPOT: number; - const HTTP_STATUS_MISDIRECTED_REQUEST: number; - const HTTP_STATUS_UNPROCESSABLE_ENTITY: number; - const HTTP_STATUS_LOCKED: number; - const HTTP_STATUS_FAILED_DEPENDENCY: number; - const HTTP_STATUS_UNORDERED_COLLECTION: number; - const HTTP_STATUS_UPGRADE_REQUIRED: number; - const HTTP_STATUS_PRECONDITION_REQUIRED: number; - const HTTP_STATUS_TOO_MANY_REQUESTS: number; - const HTTP_STATUS_REQUEST_HEADER_FIELDS_TOO_LARGE: number; - const HTTP_STATUS_UNAVAILABLE_FOR_LEGAL_REASONS: number; - const HTTP_STATUS_INTERNAL_SERVER_ERROR: number; - const HTTP_STATUS_NOT_IMPLEMENTED: number; - const HTTP_STATUS_BAD_GATEWAY: number; - const HTTP_STATUS_SERVICE_UNAVAILABLE: number; - const HTTP_STATUS_GATEWAY_TIMEOUT: number; - const HTTP_STATUS_HTTP_VERSION_NOT_SUPPORTED: number; - const HTTP_STATUS_VARIANT_ALSO_NEGOTIATES: number; - const HTTP_STATUS_INSUFFICIENT_STORAGE: number; - const HTTP_STATUS_LOOP_DETECTED: number; - const HTTP_STATUS_BANDWIDTH_LIMIT_EXCEEDED: number; - const HTTP_STATUS_NOT_EXTENDED: number; - const HTTP_STATUS_NETWORK_AUTHENTICATION_REQUIRED: number; - } - /** - * This symbol can be set as a property on the HTTP/2 headers object with - * an array value in order to provide a list of headers considered sensitive. - */ - export const sensitiveHeaders: symbol; - /** - * Returns an object containing the default settings for an `Http2Session`instance. This method returns a new object instance every time it is called - * so instances returned may be safely modified for use. - * @since v8.4.0 - */ - export function getDefaultSettings(): Settings; - /** - * Returns a `Buffer` instance containing serialized representation of the given - * HTTP/2 settings as specified in the [HTTP/2](https://tools.ietf.org/html/rfc7540) specification. This is intended - * for use with the `HTTP2-Settings` header field. - * - * ```js - * const http2 = require('http2'); - * - * const packed = http2.getPackedSettings({ enablePush: false }); - * - * console.log(packed.toString('base64')); - * // Prints: AAIAAAAA - * ``` - * @since v8.4.0 - */ - export function getPackedSettings(settings: Settings): Buffer; - /** - * Returns a `HTTP/2 Settings Object` containing the deserialized settings from - * the given `Buffer` as generated by `http2.getPackedSettings()`. - * @since v8.4.0 - * @param buf The packed settings. - */ - export function getUnpackedSettings(buf: Uint8Array): Settings; - /** - * Returns a `net.Server` instance that creates and manages `Http2Session`instances. - * - * Since there are no browsers known that support [unencrypted HTTP/2](https://http2.github.io/faq/#does-http2-require-encryption), the use of {@link createSecureServer} is necessary when - * communicating - * with browser clients. - * - * ```js - * const http2 = require('http2'); - * - * // Create an unencrypted HTTP/2 server. - * // Since there are no browsers known that support - * // unencrypted HTTP/2, the use of `http2.createSecureServer()` - * // is necessary when communicating with browser clients. - * const server = http2.createServer(); - * - * server.on('stream', (stream, headers) => { - * stream.respond({ - * 'content-type': 'text/html; charset=utf-8', - * ':status': 200 - * }); - * stream.end('

Hello World

'); - * }); - * - * server.listen(80); - * ``` - * @since v8.4.0 - * @param onRequestHandler See `Compatibility API` - */ - export function createServer(onRequestHandler?: (request: Http2ServerRequest, response: Http2ServerResponse) => void): Http2Server; - export function createServer(options: ServerOptions, onRequestHandler?: (request: Http2ServerRequest, response: Http2ServerResponse) => void): Http2Server; - /** - * Returns a `tls.Server` instance that creates and manages `Http2Session`instances. - * - * ```js - * const http2 = require('http2'); - * const fs = require('fs'); - * - * const options = { - * key: fs.readFileSync('server-key.pem'), - * cert: fs.readFileSync('server-cert.pem') - * }; - * - * // Create a secure HTTP/2 server - * const server = http2.createSecureServer(options); - * - * server.on('stream', (stream, headers) => { - * stream.respond({ - * 'content-type': 'text/html; charset=utf-8', - * ':status': 200 - * }); - * stream.end('

Hello World

'); - * }); - * - * server.listen(80); - * ``` - * @since v8.4.0 - * @param onRequestHandler See `Compatibility API` - */ - export function createSecureServer(onRequestHandler?: (request: Http2ServerRequest, response: Http2ServerResponse) => void): Http2SecureServer; - export function createSecureServer(options: SecureServerOptions, onRequestHandler?: (request: Http2ServerRequest, response: Http2ServerResponse) => void): Http2SecureServer; - /** - * Returns a `ClientHttp2Session` instance. - * - * ```js - * const http2 = require('http2'); - * const client = http2.connect('https://localhost:1234'); - * - * // Use the client - * - * client.close(); - * ``` - * @since v8.4.0 - * @param authority The remote HTTP/2 server to connect to. This must be in the form of a minimal, valid URL with the `http://` or `https://` prefix, host name, and IP port (if a non-default port - * is used). Userinfo (user ID and password), path, querystring, and fragment details in the URL will be ignored. - * @param listener Will be registered as a one-time listener of the {@link 'connect'} event. - */ - export function connect(authority: string | url.URL, listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void): ClientHttp2Session; - export function connect( - authority: string | url.URL, - options?: ClientSessionOptions | SecureClientSessionOptions, - listener?: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void - ): ClientHttp2Session; -} -declare module 'node:http2' { - export * from 'http2'; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/https.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/https.d.ts deleted file mode 100755 index aae4a958..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/https.d.ts +++ /dev/null @@ -1,541 +0,0 @@ -/** - * HTTPS is the HTTP protocol over TLS/SSL. In Node.js this is implemented as a - * separate module. - * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/https.js) - */ -declare module 'https' { - import { Duplex } from 'node:stream'; - import * as tls from 'node:tls'; - import * as http from 'node:http'; - import { URL } from 'node:url'; - type ServerOptions< - Request extends typeof http.IncomingMessage = typeof http.IncomingMessage, - Response extends typeof http.ServerResponse = typeof http.ServerResponse, - > = tls.SecureContextOptions & tls.TlsOptions & http.ServerOptions; - type RequestOptions = http.RequestOptions & - tls.SecureContextOptions & { - rejectUnauthorized?: boolean | undefined; // Defaults to true - servername?: string | undefined; // SNI TLS Extension - }; - interface AgentOptions extends http.AgentOptions, tls.ConnectionOptions { - rejectUnauthorized?: boolean | undefined; - maxCachedSessions?: number | undefined; - } - /** - * An `Agent` object for HTTPS similar to `http.Agent`. See {@link request} for more information. - * @since v0.4.5 - */ - class Agent extends http.Agent { - constructor(options?: AgentOptions); - options: AgentOptions; - } - interface Server< - Request extends typeof http.IncomingMessage = typeof http.IncomingMessage, - Response extends typeof http.ServerResponse = typeof http.ServerResponse, - > extends http.Server {} - /** - * See `http.Server` for more information. - * @since v0.3.4 - */ - class Server< - Request extends typeof http.IncomingMessage = typeof http.IncomingMessage, - Response extends typeof http.ServerResponse = typeof http.ServerResponse, - > extends tls.Server { - constructor(requestListener?: http.RequestListener); - constructor( - options: ServerOptions, - requestListener?: http.RequestListener, - ); - /** - * Closes all connections connected to this server. - * @since v18.2.0 - */ - closeAllConnections(): void; - /** - * Closes all connections connected to this server which are not sending a request or waiting for a response. - * @since v18.2.0 - */ - closeIdleConnections(): void; - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: 'keylog', listener: (line: Buffer, tlsSocket: tls.TLSSocket) => void): this; - addListener( - event: 'newSession', - listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void, - ): this; - addListener( - event: 'OCSPRequest', - listener: ( - certificate: Buffer, - issuer: Buffer, - callback: (err: Error | null, resp: Buffer) => void, - ) => void, - ): this; - addListener( - event: 'resumeSession', - listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void, - ): this; - addListener(event: 'secureConnection', listener: (tlsSocket: tls.TLSSocket) => void): this; - addListener(event: 'tlsClientError', listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this; - addListener(event: 'close', listener: () => void): this; - addListener(event: 'connection', listener: (socket: Duplex) => void): this; - addListener(event: 'error', listener: (err: Error) => void): this; - addListener(event: 'listening', listener: () => void): this; - addListener(event: 'checkContinue', listener: http.RequestListener): this; - addListener(event: 'checkExpectation', listener: http.RequestListener): this; - addListener(event: 'clientError', listener: (err: Error, socket: Duplex) => void): this; - addListener( - event: 'connect', - listener: (req: InstanceType, socket: Duplex, head: Buffer) => void, - ): this; - addListener(event: 'request', listener: http.RequestListener): this; - addListener( - event: 'upgrade', - listener: (req: InstanceType, socket: Duplex, head: Buffer) => void, - ): this; - emit(event: string, ...args: any[]): boolean; - emit(event: 'keylog', line: Buffer, tlsSocket: tls.TLSSocket): boolean; - emit( - event: 'newSession', - sessionId: Buffer, - sessionData: Buffer, - callback: (err: Error, resp: Buffer) => void, - ): boolean; - emit( - event: 'OCSPRequest', - certificate: Buffer, - issuer: Buffer, - callback: (err: Error | null, resp: Buffer) => void, - ): boolean; - emit(event: 'resumeSession', sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void): boolean; - emit(event: 'secureConnection', tlsSocket: tls.TLSSocket): boolean; - emit(event: 'tlsClientError', err: Error, tlsSocket: tls.TLSSocket): boolean; - emit(event: 'close'): boolean; - emit(event: 'connection', socket: Duplex): boolean; - emit(event: 'error', err: Error): boolean; - emit(event: 'listening'): boolean; - emit( - event: 'checkContinue', - req: InstanceType, - res: InstanceType & { req: InstanceType }, - ): boolean; - emit( - event: 'checkExpectation', - req: InstanceType, - res: InstanceType & { req: InstanceType }, - ): boolean; - emit(event: 'clientError', err: Error, socket: Duplex): boolean; - emit(event: 'connect', req: InstanceType, socket: Duplex, head: Buffer): boolean; - emit( - event: 'request', - req: InstanceType, - res: InstanceType & { req: InstanceType }, - ): boolean; - emit(event: 'upgrade', req: InstanceType, socket: Duplex, head: Buffer): boolean; - on(event: string, listener: (...args: any[]) => void): this; - on(event: 'keylog', listener: (line: Buffer, tlsSocket: tls.TLSSocket) => void): this; - on( - event: 'newSession', - listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void, - ): this; - on( - event: 'OCSPRequest', - listener: ( - certificate: Buffer, - issuer: Buffer, - callback: (err: Error | null, resp: Buffer) => void, - ) => void, - ): this; - on( - event: 'resumeSession', - listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void, - ): this; - on(event: 'secureConnection', listener: (tlsSocket: tls.TLSSocket) => void): this; - on(event: 'tlsClientError', listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this; - on(event: 'close', listener: () => void): this; - on(event: 'connection', listener: (socket: Duplex) => void): this; - on(event: 'error', listener: (err: Error) => void): this; - on(event: 'listening', listener: () => void): this; - on(event: 'checkContinue', listener: http.RequestListener): this; - on(event: 'checkExpectation', listener: http.RequestListener): this; - on(event: 'clientError', listener: (err: Error, socket: Duplex) => void): this; - on(event: 'connect', listener: (req: InstanceType, socket: Duplex, head: Buffer) => void): this; - on(event: 'request', listener: http.RequestListener): this; - on(event: 'upgrade', listener: (req: InstanceType, socket: Duplex, head: Buffer) => void): this; - once(event: string, listener: (...args: any[]) => void): this; - once(event: 'keylog', listener: (line: Buffer, tlsSocket: tls.TLSSocket) => void): this; - once( - event: 'newSession', - listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void, - ): this; - once( - event: 'OCSPRequest', - listener: ( - certificate: Buffer, - issuer: Buffer, - callback: (err: Error | null, resp: Buffer) => void, - ) => void, - ): this; - once( - event: 'resumeSession', - listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void, - ): this; - once(event: 'secureConnection', listener: (tlsSocket: tls.TLSSocket) => void): this; - once(event: 'tlsClientError', listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this; - once(event: 'close', listener: () => void): this; - once(event: 'connection', listener: (socket: Duplex) => void): this; - once(event: 'error', listener: (err: Error) => void): this; - once(event: 'listening', listener: () => void): this; - once(event: 'checkContinue', listener: http.RequestListener): this; - once(event: 'checkExpectation', listener: http.RequestListener): this; - once(event: 'clientError', listener: (err: Error, socket: Duplex) => void): this; - once(event: 'connect', listener: (req: InstanceType, socket: Duplex, head: Buffer) => void): this; - once(event: 'request', listener: http.RequestListener): this; - once(event: 'upgrade', listener: (req: InstanceType, socket: Duplex, head: Buffer) => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: 'keylog', listener: (line: Buffer, tlsSocket: tls.TLSSocket) => void): this; - prependListener( - event: 'newSession', - listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void, - ): this; - prependListener( - event: 'OCSPRequest', - listener: ( - certificate: Buffer, - issuer: Buffer, - callback: (err: Error | null, resp: Buffer) => void, - ) => void, - ): this; - prependListener( - event: 'resumeSession', - listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void, - ): this; - prependListener(event: 'secureConnection', listener: (tlsSocket: tls.TLSSocket) => void): this; - prependListener(event: 'tlsClientError', listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this; - prependListener(event: 'close', listener: () => void): this; - prependListener(event: 'connection', listener: (socket: Duplex) => void): this; - prependListener(event: 'error', listener: (err: Error) => void): this; - prependListener(event: 'listening', listener: () => void): this; - prependListener(event: 'checkContinue', listener: http.RequestListener): this; - prependListener(event: 'checkExpectation', listener: http.RequestListener): this; - prependListener(event: 'clientError', listener: (err: Error, socket: Duplex) => void): this; - prependListener( - event: 'connect', - listener: (req: InstanceType, socket: Duplex, head: Buffer) => void, - ): this; - prependListener(event: 'request', listener: http.RequestListener): this; - prependListener( - event: 'upgrade', - listener: (req: InstanceType, socket: Duplex, head: Buffer) => void, - ): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: 'keylog', listener: (line: Buffer, tlsSocket: tls.TLSSocket) => void): this; - prependOnceListener( - event: 'newSession', - listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void, - ): this; - prependOnceListener( - event: 'OCSPRequest', - listener: ( - certificate: Buffer, - issuer: Buffer, - callback: (err: Error | null, resp: Buffer) => void, - ) => void, - ): this; - prependOnceListener( - event: 'resumeSession', - listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void, - ): this; - prependOnceListener(event: 'secureConnection', listener: (tlsSocket: tls.TLSSocket) => void): this; - prependOnceListener(event: 'tlsClientError', listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this; - prependOnceListener(event: 'close', listener: () => void): this; - prependOnceListener(event: 'connection', listener: (socket: Duplex) => void): this; - prependOnceListener(event: 'error', listener: (err: Error) => void): this; - prependOnceListener(event: 'listening', listener: () => void): this; - prependOnceListener(event: 'checkContinue', listener: http.RequestListener): this; - prependOnceListener(event: 'checkExpectation', listener: http.RequestListener): this; - prependOnceListener(event: 'clientError', listener: (err: Error, socket: Duplex) => void): this; - prependOnceListener( - event: 'connect', - listener: (req: InstanceType, socket: Duplex, head: Buffer) => void, - ): this; - prependOnceListener(event: 'request', listener: http.RequestListener): this; - prependOnceListener( - event: 'upgrade', - listener: (req: InstanceType, socket: Duplex, head: Buffer) => void, - ): this; - } - /** - * ```js - * // curl -k https://localhost:8000/ - * const https = require('https'); - * const fs = require('fs'); - * - * const options = { - * key: fs.readFileSync('test/fixtures/keys/agent2-key.pem'), - * cert: fs.readFileSync('test/fixtures/keys/agent2-cert.pem') - * }; - * - * https.createServer(options, (req, res) => { - * res.writeHead(200); - * res.end('hello world\n'); - * }).listen(8000); - * ``` - * - * Or - * - * ```js - * const https = require('https'); - * const fs = require('fs'); - * - * const options = { - * pfx: fs.readFileSync('test/fixtures/test_cert.pfx'), - * passphrase: 'sample' - * }; - * - * https.createServer(options, (req, res) => { - * res.writeHead(200); - * res.end('hello world\n'); - * }).listen(8000); - * ``` - * @since v0.3.4 - * @param options Accepts `options` from `createServer`, `createSecureContext` and `createServer`. - * @param requestListener A listener to be added to the `'request'` event. - */ - function createServer< - Request extends typeof http.IncomingMessage = typeof http.IncomingMessage, - Response extends typeof http.ServerResponse = typeof http.ServerResponse, - >(requestListener?: http.RequestListener): Server; - function createServer< - Request extends typeof http.IncomingMessage = typeof http.IncomingMessage, - Response extends typeof http.ServerResponse = typeof http.ServerResponse, - >( - options: ServerOptions, - requestListener?: http.RequestListener, - ): Server; - /** - * Makes a request to a secure web server. - * - * The following additional `options` from `tls.connect()` are also accepted:`ca`, `cert`, `ciphers`, `clientCertEngine`, `crl`, `dhparam`, `ecdhCurve`,`honorCipherOrder`, `key`, `passphrase`, - * `pfx`, `rejectUnauthorized`,`secureOptions`, `secureProtocol`, `servername`, `sessionIdContext`,`highWaterMark`. - * - * `options` can be an object, a string, or a `URL` object. If `options` is a - * string, it is automatically parsed with `new URL()`. If it is a `URL` object, it will be automatically converted to an ordinary `options` object. - * - * `https.request()` returns an instance of the `http.ClientRequest` class. The `ClientRequest` instance is a writable stream. If one needs to - * upload a file with a POST request, then write to the `ClientRequest` object. - * - * ```js - * const https = require('https'); - * - * const options = { - * hostname: 'encrypted.google.com', - * port: 443, - * path: '/', - * method: 'GET' - * }; - * - * const req = https.request(options, (res) => { - * console.log('statusCode:', res.statusCode); - * console.log('headers:', res.headers); - * - * res.on('data', (d) => { - * process.stdout.write(d); - * }); - * }); - * - * req.on('error', (e) => { - * console.error(e); - * }); - * req.end(); - * ``` - * - * Example using options from `tls.connect()`: - * - * ```js - * const options = { - * hostname: 'encrypted.google.com', - * port: 443, - * path: '/', - * method: 'GET', - * key: fs.readFileSync('test/fixtures/keys/agent2-key.pem'), - * cert: fs.readFileSync('test/fixtures/keys/agent2-cert.pem') - * }; - * options.agent = new https.Agent(options); - * - * const req = https.request(options, (res) => { - * // ... - * }); - * ``` - * - * Alternatively, opt out of connection pooling by not using an `Agent`. - * - * ```js - * const options = { - * hostname: 'encrypted.google.com', - * port: 443, - * path: '/', - * method: 'GET', - * key: fs.readFileSync('test/fixtures/keys/agent2-key.pem'), - * cert: fs.readFileSync('test/fixtures/keys/agent2-cert.pem'), - * agent: false - * }; - * - * const req = https.request(options, (res) => { - * // ... - * }); - * ``` - * - * Example using a `URL` as `options`: - * - * ```js - * const options = new URL('https://abc:xyz@example.com'); - * - * const req = https.request(options, (res) => { - * // ... - * }); - * ``` - * - * Example pinning on certificate fingerprint, or the public key (similar to`pin-sha256`): - * - * ```js - * const tls = require('tls'); - * const https = require('https'); - * const crypto = require('crypto'); - * - * function sha256(s) { - * return crypto.createHash('sha256').update(s).digest('base64'); - * } - * const options = { - * hostname: 'github.com', - * port: 443, - * path: '/', - * method: 'GET', - * checkServerIdentity: function(host, cert) { - * // Make sure the certificate is issued to the host we are connected to - * const err = tls.checkServerIdentity(host, cert); - * if (err) { - * return err; - * } - * - * // Pin the public key, similar to HPKP pin-sha25 pinning - * const pubkey256 = 'pL1+qb9HTMRZJmuC/bB/ZI9d302BYrrqiVuRyW+DGrU='; - * if (sha256(cert.pubkey) !== pubkey256) { - * const msg = 'Certificate verification error: ' + - * `The public key of '${cert.subject.CN}' ` + - * 'does not match our pinned fingerprint'; - * return new Error(msg); - * } - * - * // Pin the exact certificate, rather than the pub key - * const cert256 = '25:FE:39:32:D9:63:8C:8A:FC:A1:9A:29:87:' + - * 'D8:3E:4C:1D:98:DB:71:E4:1A:48:03:98:EA:22:6A:BD:8B:93:16'; - * if (cert.fingerprint256 !== cert256) { - * const msg = 'Certificate verification error: ' + - * `The certificate of '${cert.subject.CN}' ` + - * 'does not match our pinned fingerprint'; - * return new Error(msg); - * } - * - * // This loop is informational only. - * // Print the certificate and public key fingerprints of all certs in the - * // chain. Its common to pin the public key of the issuer on the public - * // internet, while pinning the public key of the service in sensitive - * // environments. - * do { - * console.log('Subject Common Name:', cert.subject.CN); - * console.log(' Certificate SHA256 fingerprint:', cert.fingerprint256); - * - * hash = crypto.createHash('sha256'); - * console.log(' Public key ping-sha256:', sha256(cert.pubkey)); - * - * lastprint256 = cert.fingerprint256; - * cert = cert.issuerCertificate; - * } while (cert.fingerprint256 !== lastprint256); - * - * }, - * }; - * - * options.agent = new https.Agent(options); - * const req = https.request(options, (res) => { - * console.log('All OK. Server matched our pinned cert or public key'); - * console.log('statusCode:', res.statusCode); - * // Print the HPKP values - * console.log('headers:', res.headers['public-key-pins']); - * - * res.on('data', (d) => {}); - * }); - * - * req.on('error', (e) => { - * console.error(e.message); - * }); - * req.end(); - * ``` - * - * Outputs for example: - * - * ```text - * Subject Common Name: github.com - * Certificate SHA256 fingerprint: 25:FE:39:32:D9:63:8C:8A:FC:A1:9A:29:87:D8:3E:4C:1D:98:DB:71:E4:1A:48:03:98:EA:22:6A:BD:8B:93:16 - * Public key ping-sha256: pL1+qb9HTMRZJmuC/bB/ZI9d302BYrrqiVuRyW+DGrU= - * Subject Common Name: DigiCert SHA2 Extended Validation Server CA - * Certificate SHA256 fingerprint: 40:3E:06:2A:26:53:05:91:13:28:5B:AF:80:A0:D4:AE:42:2C:84:8C:9F:78:FA:D0:1F:C9:4B:C5:B8:7F:EF:1A - * Public key ping-sha256: RRM1dGqnDFsCJXBTHky16vi1obOlCgFFn/yOhI/y+ho= - * Subject Common Name: DigiCert High Assurance EV Root CA - * Certificate SHA256 fingerprint: 74:31:E5:F4:C3:C1:CE:46:90:77:4F:0B:61:E0:54:40:88:3B:A9:A0:1E:D0:0B:A6:AB:D7:80:6E:D3:B1:18:CF - * Public key ping-sha256: WoiWRyIOVNa9ihaBciRSC7XHjliYS9VwUGOIud4PB18= - * All OK. Server matched our pinned cert or public key - * statusCode: 200 - * headers: max-age=0; pin-sha256="WoiWRyIOVNa9ihaBciRSC7XHjliYS9VwUGOIud4PB18="; pin-sha256="RRM1dGqnDFsCJXBTHky16vi1obOlCgFFn/yOhI/y+ho="; - * pin-sha256="k2v657xBsOVe1PQRwOsHsw3bsGT2VzIqz5K+59sNQws="; pin-sha256="K87oWBWM9UZfyddvDfoxL+8lpNyoUB2ptGtn0fv6G2Q="; pin-sha256="IQBnNBEiFuhj+8x6X8XLgh01V9Ic5/V3IRQLNFFc7v4="; - * pin-sha256="iie1VXtL7HzAMF+/PVPR9xzT80kQxdZeJ+zduCB3uj0="; pin-sha256="LvRiGEjRqfzurezaWuj8Wie2gyHMrW5Q06LspMnox7A="; includeSubDomains - * ``` - * @since v0.3.6 - * @param options Accepts all `options` from `request`, with some differences in default values: - */ - function request( - options: RequestOptions | string | URL, - callback?: (res: http.IncomingMessage) => void, - ): http.ClientRequest; - function request( - url: string | URL, - options: RequestOptions, - callback?: (res: http.IncomingMessage) => void, - ): http.ClientRequest; - /** - * Like `http.get()` but for HTTPS. - * - * `options` can be an object, a string, or a `URL` object. If `options` is a - * string, it is automatically parsed with `new URL()`. If it is a `URL` object, it will be automatically converted to an ordinary `options` object. - * - * ```js - * const https = require('https'); - * - * https.get('https://encrypted.google.com/', (res) => { - * console.log('statusCode:', res.statusCode); - * console.log('headers:', res.headers); - * - * res.on('data', (d) => { - * process.stdout.write(d); - * }); - * - * }).on('error', (e) => { - * console.error(e); - * }); - * ``` - * @since v0.3.6 - * @param options Accepts the same `options` as {@link request}, with the `method` always set to `GET`. - */ - function get( - options: RequestOptions | string | URL, - callback?: (res: http.IncomingMessage) => void, - ): http.ClientRequest; - function get( - url: string | URL, - options: RequestOptions, - callback?: (res: http.IncomingMessage) => void, - ): http.ClientRequest; - let globalAgent: Agent; -} -declare module 'node:https' { - export * from 'https'; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/index.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/index.d.ts deleted file mode 100755 index 7c8b38c6..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/index.d.ts +++ /dev/null @@ -1,88 +0,0 @@ -/** - * License for programmatically and manually incorporated - * documentation aka. `JSDoc` from https://github.com/nodejs/node/tree/master/doc - * - * Copyright Node.js contributors. All rights reserved. - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to - * deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS - * IN THE SOFTWARE. - */ - -// NOTE: These definitions support NodeJS and TypeScript 4.8 and earlier. - -// Reference required types from the default lib: -/// -/// -/// -/// - -// Base definitions for all NodeJS modules that are not specific to any version of TypeScript: -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// - -/// diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/inspector.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/inspector.d.ts deleted file mode 100755 index eba0b55d..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/inspector.d.ts +++ /dev/null @@ -1,2741 +0,0 @@ -// eslint-disable-next-line dt-header -// Type definitions for inspector - -// These definitions are auto-generated. -// Please see https://github.com/DefinitelyTyped/DefinitelyTyped/pull/19330 -// for more information. - -// tslint:disable:max-line-length - -/** - * The `inspector` module provides an API for interacting with the V8 inspector. - * - * It can be accessed using: - * - * ```js - * const inspector = require('inspector'); - * ``` - * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/inspector.js) - */ -declare module 'inspector' { - import EventEmitter = require('node:events'); - interface InspectorNotification { - method: string; - params: T; - } - namespace Schema { - /** - * Description of the protocol domain. - */ - interface Domain { - /** - * Domain name. - */ - name: string; - /** - * Domain version. - */ - version: string; - } - interface GetDomainsReturnType { - /** - * List of supported domains. - */ - domains: Domain[]; - } - } - namespace Runtime { - /** - * Unique script identifier. - */ - type ScriptId = string; - /** - * Unique object identifier. - */ - type RemoteObjectId = string; - /** - * Primitive value which cannot be JSON-stringified. - */ - type UnserializableValue = string; - /** - * Mirror object referencing original JavaScript object. - */ - interface RemoteObject { - /** - * Object type. - */ - type: string; - /** - * Object subtype hint. Specified for object type values only. - */ - subtype?: string | undefined; - /** - * Object class (constructor) name. Specified for object type values only. - */ - className?: string | undefined; - /** - * Remote object value in case of primitive values or JSON values (if it was requested). - */ - value?: any; - /** - * Primitive value which can not be JSON-stringified does not have value, but gets this property. - */ - unserializableValue?: UnserializableValue | undefined; - /** - * String representation of the object. - */ - description?: string | undefined; - /** - * Unique object identifier (for non-primitive values). - */ - objectId?: RemoteObjectId | undefined; - /** - * Preview containing abbreviated property values. Specified for object type values only. - * @experimental - */ - preview?: ObjectPreview | undefined; - /** - * @experimental - */ - customPreview?: CustomPreview | undefined; - } - /** - * @experimental - */ - interface CustomPreview { - header: string; - hasBody: boolean; - formatterObjectId: RemoteObjectId; - bindRemoteObjectFunctionId: RemoteObjectId; - configObjectId?: RemoteObjectId | undefined; - } - /** - * Object containing abbreviated remote object value. - * @experimental - */ - interface ObjectPreview { - /** - * Object type. - */ - type: string; - /** - * Object subtype hint. Specified for object type values only. - */ - subtype?: string | undefined; - /** - * String representation of the object. - */ - description?: string | undefined; - /** - * True iff some of the properties or entries of the original object did not fit. - */ - overflow: boolean; - /** - * List of the properties. - */ - properties: PropertyPreview[]; - /** - * List of the entries. Specified for map and set subtype values only. - */ - entries?: EntryPreview[] | undefined; - } - /** - * @experimental - */ - interface PropertyPreview { - /** - * Property name. - */ - name: string; - /** - * Object type. Accessor means that the property itself is an accessor property. - */ - type: string; - /** - * User-friendly property value string. - */ - value?: string | undefined; - /** - * Nested value preview. - */ - valuePreview?: ObjectPreview | undefined; - /** - * Object subtype hint. Specified for object type values only. - */ - subtype?: string | undefined; - } - /** - * @experimental - */ - interface EntryPreview { - /** - * Preview of the key. Specified for map-like collection entries. - */ - key?: ObjectPreview | undefined; - /** - * Preview of the value. - */ - value: ObjectPreview; - } - /** - * Object property descriptor. - */ - interface PropertyDescriptor { - /** - * Property name or symbol description. - */ - name: string; - /** - * The value associated with the property. - */ - value?: RemoteObject | undefined; - /** - * True if the value associated with the property may be changed (data descriptors only). - */ - writable?: boolean | undefined; - /** - * A function which serves as a getter for the property, or undefined if there is no getter (accessor descriptors only). - */ - get?: RemoteObject | undefined; - /** - * A function which serves as a setter for the property, or undefined if there is no setter (accessor descriptors only). - */ - set?: RemoteObject | undefined; - /** - * True if the type of this property descriptor may be changed and if the property may be deleted from the corresponding object. - */ - configurable: boolean; - /** - * True if this property shows up during enumeration of the properties on the corresponding object. - */ - enumerable: boolean; - /** - * True if the result was thrown during the evaluation. - */ - wasThrown?: boolean | undefined; - /** - * True if the property is owned for the object. - */ - isOwn?: boolean | undefined; - /** - * Property symbol object, if the property is of the symbol type. - */ - symbol?: RemoteObject | undefined; - } - /** - * Object internal property descriptor. This property isn't normally visible in JavaScript code. - */ - interface InternalPropertyDescriptor { - /** - * Conventional property name. - */ - name: string; - /** - * The value associated with the property. - */ - value?: RemoteObject | undefined; - } - /** - * Represents function call argument. Either remote object id objectId, primitive value, unserializable primitive value or neither of (for undefined) them should be specified. - */ - interface CallArgument { - /** - * Primitive value or serializable javascript object. - */ - value?: any; - /** - * Primitive value which can not be JSON-stringified. - */ - unserializableValue?: UnserializableValue | undefined; - /** - * Remote object handle. - */ - objectId?: RemoteObjectId | undefined; - } - /** - * Id of an execution context. - */ - type ExecutionContextId = number; - /** - * Description of an isolated world. - */ - interface ExecutionContextDescription { - /** - * Unique id of the execution context. It can be used to specify in which execution context script evaluation should be performed. - */ - id: ExecutionContextId; - /** - * Execution context origin. - */ - origin: string; - /** - * Human readable name describing given context. - */ - name: string; - /** - * Embedder-specific auxiliary data. - */ - auxData?: {} | undefined; - } - /** - * Detailed information about exception (or error) that was thrown during script compilation or execution. - */ - interface ExceptionDetails { - /** - * Exception id. - */ - exceptionId: number; - /** - * Exception text, which should be used together with exception object when available. - */ - text: string; - /** - * Line number of the exception location (0-based). - */ - lineNumber: number; - /** - * Column number of the exception location (0-based). - */ - columnNumber: number; - /** - * Script ID of the exception location. - */ - scriptId?: ScriptId | undefined; - /** - * URL of the exception location, to be used when the script was not reported. - */ - url?: string | undefined; - /** - * JavaScript stack trace if available. - */ - stackTrace?: StackTrace | undefined; - /** - * Exception object if available. - */ - exception?: RemoteObject | undefined; - /** - * Identifier of the context where exception happened. - */ - executionContextId?: ExecutionContextId | undefined; - } - /** - * Number of milliseconds since epoch. - */ - type Timestamp = number; - /** - * Stack entry for runtime errors and assertions. - */ - interface CallFrame { - /** - * JavaScript function name. - */ - functionName: string; - /** - * JavaScript script id. - */ - scriptId: ScriptId; - /** - * JavaScript script name or url. - */ - url: string; - /** - * JavaScript script line number (0-based). - */ - lineNumber: number; - /** - * JavaScript script column number (0-based). - */ - columnNumber: number; - } - /** - * Call frames for assertions or error messages. - */ - interface StackTrace { - /** - * String label of this stack trace. For async traces this may be a name of the function that initiated the async call. - */ - description?: string | undefined; - /** - * JavaScript function name. - */ - callFrames: CallFrame[]; - /** - * Asynchronous JavaScript stack trace that preceded this stack, if available. - */ - parent?: StackTrace | undefined; - /** - * Asynchronous JavaScript stack trace that preceded this stack, if available. - * @experimental - */ - parentId?: StackTraceId | undefined; - } - /** - * Unique identifier of current debugger. - * @experimental - */ - type UniqueDebuggerId = string; - /** - * If debuggerId is set stack trace comes from another debugger and can be resolved there. This allows to track cross-debugger calls. See Runtime.StackTrace and Debugger.paused for usages. - * @experimental - */ - interface StackTraceId { - id: string; - debuggerId?: UniqueDebuggerId | undefined; - } - interface EvaluateParameterType { - /** - * Expression to evaluate. - */ - expression: string; - /** - * Symbolic group name that can be used to release multiple objects. - */ - objectGroup?: string | undefined; - /** - * Determines whether Command Line API should be available during the evaluation. - */ - includeCommandLineAPI?: boolean | undefined; - /** - * In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides setPauseOnException state. - */ - silent?: boolean | undefined; - /** - * Specifies in which execution context to perform evaluation. If the parameter is omitted the evaluation will be performed in the context of the inspected page. - */ - contextId?: ExecutionContextId | undefined; - /** - * Whether the result is expected to be a JSON object that should be sent by value. - */ - returnByValue?: boolean | undefined; - /** - * Whether preview should be generated for the result. - * @experimental - */ - generatePreview?: boolean | undefined; - /** - * Whether execution should be treated as initiated by user in the UI. - */ - userGesture?: boolean | undefined; - /** - * Whether execution should await for resulting value and return once awaited promise is resolved. - */ - awaitPromise?: boolean | undefined; - } - interface AwaitPromiseParameterType { - /** - * Identifier of the promise. - */ - promiseObjectId: RemoteObjectId; - /** - * Whether the result is expected to be a JSON object that should be sent by value. - */ - returnByValue?: boolean | undefined; - /** - * Whether preview should be generated for the result. - */ - generatePreview?: boolean | undefined; - } - interface CallFunctionOnParameterType { - /** - * Declaration of the function to call. - */ - functionDeclaration: string; - /** - * Identifier of the object to call function on. Either objectId or executionContextId should be specified. - */ - objectId?: RemoteObjectId | undefined; - /** - * Call arguments. All call arguments must belong to the same JavaScript world as the target object. - */ - arguments?: CallArgument[] | undefined; - /** - * In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides setPauseOnException state. - */ - silent?: boolean | undefined; - /** - * Whether the result is expected to be a JSON object which should be sent by value. - */ - returnByValue?: boolean | undefined; - /** - * Whether preview should be generated for the result. - * @experimental - */ - generatePreview?: boolean | undefined; - /** - * Whether execution should be treated as initiated by user in the UI. - */ - userGesture?: boolean | undefined; - /** - * Whether execution should await for resulting value and return once awaited promise is resolved. - */ - awaitPromise?: boolean | undefined; - /** - * Specifies execution context which global object will be used to call function on. Either executionContextId or objectId should be specified. - */ - executionContextId?: ExecutionContextId | undefined; - /** - * Symbolic group name that can be used to release multiple objects. If objectGroup is not specified and objectId is, objectGroup will be inherited from object. - */ - objectGroup?: string | undefined; - } - interface GetPropertiesParameterType { - /** - * Identifier of the object to return properties for. - */ - objectId: RemoteObjectId; - /** - * If true, returns properties belonging only to the element itself, not to its prototype chain. - */ - ownProperties?: boolean | undefined; - /** - * If true, returns accessor properties (with getter/setter) only; internal properties are not returned either. - * @experimental - */ - accessorPropertiesOnly?: boolean | undefined; - /** - * Whether preview should be generated for the results. - * @experimental - */ - generatePreview?: boolean | undefined; - } - interface ReleaseObjectParameterType { - /** - * Identifier of the object to release. - */ - objectId: RemoteObjectId; - } - interface ReleaseObjectGroupParameterType { - /** - * Symbolic object group name. - */ - objectGroup: string; - } - interface SetCustomObjectFormatterEnabledParameterType { - enabled: boolean; - } - interface CompileScriptParameterType { - /** - * Expression to compile. - */ - expression: string; - /** - * Source url to be set for the script. - */ - sourceURL: string; - /** - * Specifies whether the compiled script should be persisted. - */ - persistScript: boolean; - /** - * Specifies in which execution context to perform script run. If the parameter is omitted the evaluation will be performed in the context of the inspected page. - */ - executionContextId?: ExecutionContextId | undefined; - } - interface RunScriptParameterType { - /** - * Id of the script to run. - */ - scriptId: ScriptId; - /** - * Specifies in which execution context to perform script run. If the parameter is omitted the evaluation will be performed in the context of the inspected page. - */ - executionContextId?: ExecutionContextId | undefined; - /** - * Symbolic group name that can be used to release multiple objects. - */ - objectGroup?: string | undefined; - /** - * In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides setPauseOnException state. - */ - silent?: boolean | undefined; - /** - * Determines whether Command Line API should be available during the evaluation. - */ - includeCommandLineAPI?: boolean | undefined; - /** - * Whether the result is expected to be a JSON object which should be sent by value. - */ - returnByValue?: boolean | undefined; - /** - * Whether preview should be generated for the result. - */ - generatePreview?: boolean | undefined; - /** - * Whether execution should await for resulting value and return once awaited promise is resolved. - */ - awaitPromise?: boolean | undefined; - } - interface QueryObjectsParameterType { - /** - * Identifier of the prototype to return objects for. - */ - prototypeObjectId: RemoteObjectId; - } - interface GlobalLexicalScopeNamesParameterType { - /** - * Specifies in which execution context to lookup global scope variables. - */ - executionContextId?: ExecutionContextId | undefined; - } - interface EvaluateReturnType { - /** - * Evaluation result. - */ - result: RemoteObject; - /** - * Exception details. - */ - exceptionDetails?: ExceptionDetails | undefined; - } - interface AwaitPromiseReturnType { - /** - * Promise result. Will contain rejected value if promise was rejected. - */ - result: RemoteObject; - /** - * Exception details if stack strace is available. - */ - exceptionDetails?: ExceptionDetails | undefined; - } - interface CallFunctionOnReturnType { - /** - * Call result. - */ - result: RemoteObject; - /** - * Exception details. - */ - exceptionDetails?: ExceptionDetails | undefined; - } - interface GetPropertiesReturnType { - /** - * Object properties. - */ - result: PropertyDescriptor[]; - /** - * Internal object properties (only of the element itself). - */ - internalProperties?: InternalPropertyDescriptor[] | undefined; - /** - * Exception details. - */ - exceptionDetails?: ExceptionDetails | undefined; - } - interface CompileScriptReturnType { - /** - * Id of the script. - */ - scriptId?: ScriptId | undefined; - /** - * Exception details. - */ - exceptionDetails?: ExceptionDetails | undefined; - } - interface RunScriptReturnType { - /** - * Run result. - */ - result: RemoteObject; - /** - * Exception details. - */ - exceptionDetails?: ExceptionDetails | undefined; - } - interface QueryObjectsReturnType { - /** - * Array with objects. - */ - objects: RemoteObject; - } - interface GlobalLexicalScopeNamesReturnType { - names: string[]; - } - interface ExecutionContextCreatedEventDataType { - /** - * A newly created execution context. - */ - context: ExecutionContextDescription; - } - interface ExecutionContextDestroyedEventDataType { - /** - * Id of the destroyed context - */ - executionContextId: ExecutionContextId; - } - interface ExceptionThrownEventDataType { - /** - * Timestamp of the exception. - */ - timestamp: Timestamp; - exceptionDetails: ExceptionDetails; - } - interface ExceptionRevokedEventDataType { - /** - * Reason describing why exception was revoked. - */ - reason: string; - /** - * The id of revoked exception, as reported in exceptionThrown. - */ - exceptionId: number; - } - interface ConsoleAPICalledEventDataType { - /** - * Type of the call. - */ - type: string; - /** - * Call arguments. - */ - args: RemoteObject[]; - /** - * Identifier of the context where the call was made. - */ - executionContextId: ExecutionContextId; - /** - * Call timestamp. - */ - timestamp: Timestamp; - /** - * Stack trace captured when the call was made. - */ - stackTrace?: StackTrace | undefined; - /** - * Console context descriptor for calls on non-default console context (not console.*): 'anonymous#unique-logger-id' for call on unnamed context, 'name#unique-logger-id' for call on named context. - * @experimental - */ - context?: string | undefined; - } - interface InspectRequestedEventDataType { - object: RemoteObject; - hints: {}; - } - } - namespace Debugger { - /** - * Breakpoint identifier. - */ - type BreakpointId = string; - /** - * Call frame identifier. - */ - type CallFrameId = string; - /** - * Location in the source code. - */ - interface Location { - /** - * Script identifier as reported in the Debugger.scriptParsed. - */ - scriptId: Runtime.ScriptId; - /** - * Line number in the script (0-based). - */ - lineNumber: number; - /** - * Column number in the script (0-based). - */ - columnNumber?: number | undefined; - } - /** - * Location in the source code. - * @experimental - */ - interface ScriptPosition { - lineNumber: number; - columnNumber: number; - } - /** - * JavaScript call frame. Array of call frames form the call stack. - */ - interface CallFrame { - /** - * Call frame identifier. This identifier is only valid while the virtual machine is paused. - */ - callFrameId: CallFrameId; - /** - * Name of the JavaScript function called on this call frame. - */ - functionName: string; - /** - * Location in the source code. - */ - functionLocation?: Location | undefined; - /** - * Location in the source code. - */ - location: Location; - /** - * JavaScript script name or url. - */ - url: string; - /** - * Scope chain for this call frame. - */ - scopeChain: Scope[]; - /** - * this object for this call frame. - */ - this: Runtime.RemoteObject; - /** - * The value being returned, if the function is at return point. - */ - returnValue?: Runtime.RemoteObject | undefined; - } - /** - * Scope description. - */ - interface Scope { - /** - * Scope type. - */ - type: string; - /** - * Object representing the scope. For global and with scopes it represents the actual object; for the rest of the scopes, it is artificial transient object enumerating scope variables as its properties. - */ - object: Runtime.RemoteObject; - name?: string | undefined; - /** - * Location in the source code where scope starts - */ - startLocation?: Location | undefined; - /** - * Location in the source code where scope ends - */ - endLocation?: Location | undefined; - } - /** - * Search match for resource. - */ - interface SearchMatch { - /** - * Line number in resource content. - */ - lineNumber: number; - /** - * Line with match content. - */ - lineContent: string; - } - interface BreakLocation { - /** - * Script identifier as reported in the Debugger.scriptParsed. - */ - scriptId: Runtime.ScriptId; - /** - * Line number in the script (0-based). - */ - lineNumber: number; - /** - * Column number in the script (0-based). - */ - columnNumber?: number | undefined; - type?: string | undefined; - } - interface SetBreakpointsActiveParameterType { - /** - * New value for breakpoints active state. - */ - active: boolean; - } - interface SetSkipAllPausesParameterType { - /** - * New value for skip pauses state. - */ - skip: boolean; - } - interface SetBreakpointByUrlParameterType { - /** - * Line number to set breakpoint at. - */ - lineNumber: number; - /** - * URL of the resources to set breakpoint on. - */ - url?: string | undefined; - /** - * Regex pattern for the URLs of the resources to set breakpoints on. Either url or urlRegex must be specified. - */ - urlRegex?: string | undefined; - /** - * Script hash of the resources to set breakpoint on. - */ - scriptHash?: string | undefined; - /** - * Offset in the line to set breakpoint at. - */ - columnNumber?: number | undefined; - /** - * Expression to use as a breakpoint condition. When specified, debugger will only stop on the breakpoint if this expression evaluates to true. - */ - condition?: string | undefined; - } - interface SetBreakpointParameterType { - /** - * Location to set breakpoint in. - */ - location: Location; - /** - * Expression to use as a breakpoint condition. When specified, debugger will only stop on the breakpoint if this expression evaluates to true. - */ - condition?: string | undefined; - } - interface RemoveBreakpointParameterType { - breakpointId: BreakpointId; - } - interface GetPossibleBreakpointsParameterType { - /** - * Start of range to search possible breakpoint locations in. - */ - start: Location; - /** - * End of range to search possible breakpoint locations in (excluding). When not specified, end of scripts is used as end of range. - */ - end?: Location | undefined; - /** - * Only consider locations which are in the same (non-nested) function as start. - */ - restrictToFunction?: boolean | undefined; - } - interface ContinueToLocationParameterType { - /** - * Location to continue to. - */ - location: Location; - targetCallFrames?: string | undefined; - } - interface PauseOnAsyncCallParameterType { - /** - * Debugger will pause when async call with given stack trace is started. - */ - parentStackTraceId: Runtime.StackTraceId; - } - interface StepIntoParameterType { - /** - * Debugger will issue additional Debugger.paused notification if any async task is scheduled before next pause. - * @experimental - */ - breakOnAsyncCall?: boolean | undefined; - } - interface GetStackTraceParameterType { - stackTraceId: Runtime.StackTraceId; - } - interface SearchInContentParameterType { - /** - * Id of the script to search in. - */ - scriptId: Runtime.ScriptId; - /** - * String to search for. - */ - query: string; - /** - * If true, search is case sensitive. - */ - caseSensitive?: boolean | undefined; - /** - * If true, treats string parameter as regex. - */ - isRegex?: boolean | undefined; - } - interface SetScriptSourceParameterType { - /** - * Id of the script to edit. - */ - scriptId: Runtime.ScriptId; - /** - * New content of the script. - */ - scriptSource: string; - /** - * If true the change will not actually be applied. Dry run may be used to get result description without actually modifying the code. - */ - dryRun?: boolean | undefined; - } - interface RestartFrameParameterType { - /** - * Call frame identifier to evaluate on. - */ - callFrameId: CallFrameId; - } - interface GetScriptSourceParameterType { - /** - * Id of the script to get source for. - */ - scriptId: Runtime.ScriptId; - } - interface SetPauseOnExceptionsParameterType { - /** - * Pause on exceptions mode. - */ - state: string; - } - interface EvaluateOnCallFrameParameterType { - /** - * Call frame identifier to evaluate on. - */ - callFrameId: CallFrameId; - /** - * Expression to evaluate. - */ - expression: string; - /** - * String object group name to put result into (allows rapid releasing resulting object handles using releaseObjectGroup). - */ - objectGroup?: string | undefined; - /** - * Specifies whether command line API should be available to the evaluated expression, defaults to false. - */ - includeCommandLineAPI?: boolean | undefined; - /** - * In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides setPauseOnException state. - */ - silent?: boolean | undefined; - /** - * Whether the result is expected to be a JSON object that should be sent by value. - */ - returnByValue?: boolean | undefined; - /** - * Whether preview should be generated for the result. - * @experimental - */ - generatePreview?: boolean | undefined; - /** - * Whether to throw an exception if side effect cannot be ruled out during evaluation. - */ - throwOnSideEffect?: boolean | undefined; - } - interface SetVariableValueParameterType { - /** - * 0-based number of scope as was listed in scope chain. Only 'local', 'closure' and 'catch' scope types are allowed. Other scopes could be manipulated manually. - */ - scopeNumber: number; - /** - * Variable name. - */ - variableName: string; - /** - * New variable value. - */ - newValue: Runtime.CallArgument; - /** - * Id of callframe that holds variable. - */ - callFrameId: CallFrameId; - } - interface SetReturnValueParameterType { - /** - * New return value. - */ - newValue: Runtime.CallArgument; - } - interface SetAsyncCallStackDepthParameterType { - /** - * Maximum depth of async call stacks. Setting to 0 will effectively disable collecting async call stacks (default). - */ - maxDepth: number; - } - interface SetBlackboxPatternsParameterType { - /** - * Array of regexps that will be used to check script url for blackbox state. - */ - patterns: string[]; - } - interface SetBlackboxedRangesParameterType { - /** - * Id of the script. - */ - scriptId: Runtime.ScriptId; - positions: ScriptPosition[]; - } - interface EnableReturnType { - /** - * Unique identifier of the debugger. - * @experimental - */ - debuggerId: Runtime.UniqueDebuggerId; - } - interface SetBreakpointByUrlReturnType { - /** - * Id of the created breakpoint for further reference. - */ - breakpointId: BreakpointId; - /** - * List of the locations this breakpoint resolved into upon addition. - */ - locations: Location[]; - } - interface SetBreakpointReturnType { - /** - * Id of the created breakpoint for further reference. - */ - breakpointId: BreakpointId; - /** - * Location this breakpoint resolved into. - */ - actualLocation: Location; - } - interface GetPossibleBreakpointsReturnType { - /** - * List of the possible breakpoint locations. - */ - locations: BreakLocation[]; - } - interface GetStackTraceReturnType { - stackTrace: Runtime.StackTrace; - } - interface SearchInContentReturnType { - /** - * List of search matches. - */ - result: SearchMatch[]; - } - interface SetScriptSourceReturnType { - /** - * New stack trace in case editing has happened while VM was stopped. - */ - callFrames?: CallFrame[] | undefined; - /** - * Whether current call stack was modified after applying the changes. - */ - stackChanged?: boolean | undefined; - /** - * Async stack trace, if any. - */ - asyncStackTrace?: Runtime.StackTrace | undefined; - /** - * Async stack trace, if any. - * @experimental - */ - asyncStackTraceId?: Runtime.StackTraceId | undefined; - /** - * Exception details if any. - */ - exceptionDetails?: Runtime.ExceptionDetails | undefined; - } - interface RestartFrameReturnType { - /** - * New stack trace. - */ - callFrames: CallFrame[]; - /** - * Async stack trace, if any. - */ - asyncStackTrace?: Runtime.StackTrace | undefined; - /** - * Async stack trace, if any. - * @experimental - */ - asyncStackTraceId?: Runtime.StackTraceId | undefined; - } - interface GetScriptSourceReturnType { - /** - * Script source. - */ - scriptSource: string; - } - interface EvaluateOnCallFrameReturnType { - /** - * Object wrapper for the evaluation result. - */ - result: Runtime.RemoteObject; - /** - * Exception details. - */ - exceptionDetails?: Runtime.ExceptionDetails | undefined; - } - interface ScriptParsedEventDataType { - /** - * Identifier of the script parsed. - */ - scriptId: Runtime.ScriptId; - /** - * URL or name of the script parsed (if any). - */ - url: string; - /** - * Line offset of the script within the resource with given URL (for script tags). - */ - startLine: number; - /** - * Column offset of the script within the resource with given URL. - */ - startColumn: number; - /** - * Last line of the script. - */ - endLine: number; - /** - * Length of the last line of the script. - */ - endColumn: number; - /** - * Specifies script creation context. - */ - executionContextId: Runtime.ExecutionContextId; - /** - * Content hash of the script. - */ - hash: string; - /** - * Embedder-specific auxiliary data. - */ - executionContextAuxData?: {} | undefined; - /** - * True, if this script is generated as a result of the live edit operation. - * @experimental - */ - isLiveEdit?: boolean | undefined; - /** - * URL of source map associated with script (if any). - */ - sourceMapURL?: string | undefined; - /** - * True, if this script has sourceURL. - */ - hasSourceURL?: boolean | undefined; - /** - * True, if this script is ES6 module. - */ - isModule?: boolean | undefined; - /** - * This script length. - */ - length?: number | undefined; - /** - * JavaScript top stack frame of where the script parsed event was triggered if available. - * @experimental - */ - stackTrace?: Runtime.StackTrace | undefined; - } - interface ScriptFailedToParseEventDataType { - /** - * Identifier of the script parsed. - */ - scriptId: Runtime.ScriptId; - /** - * URL or name of the script parsed (if any). - */ - url: string; - /** - * Line offset of the script within the resource with given URL (for script tags). - */ - startLine: number; - /** - * Column offset of the script within the resource with given URL. - */ - startColumn: number; - /** - * Last line of the script. - */ - endLine: number; - /** - * Length of the last line of the script. - */ - endColumn: number; - /** - * Specifies script creation context. - */ - executionContextId: Runtime.ExecutionContextId; - /** - * Content hash of the script. - */ - hash: string; - /** - * Embedder-specific auxiliary data. - */ - executionContextAuxData?: {} | undefined; - /** - * URL of source map associated with script (if any). - */ - sourceMapURL?: string | undefined; - /** - * True, if this script has sourceURL. - */ - hasSourceURL?: boolean | undefined; - /** - * True, if this script is ES6 module. - */ - isModule?: boolean | undefined; - /** - * This script length. - */ - length?: number | undefined; - /** - * JavaScript top stack frame of where the script parsed event was triggered if available. - * @experimental - */ - stackTrace?: Runtime.StackTrace | undefined; - } - interface BreakpointResolvedEventDataType { - /** - * Breakpoint unique identifier. - */ - breakpointId: BreakpointId; - /** - * Actual breakpoint location. - */ - location: Location; - } - interface PausedEventDataType { - /** - * Call stack the virtual machine stopped on. - */ - callFrames: CallFrame[]; - /** - * Pause reason. - */ - reason: string; - /** - * Object containing break-specific auxiliary properties. - */ - data?: {} | undefined; - /** - * Hit breakpoints IDs - */ - hitBreakpoints?: string[] | undefined; - /** - * Async stack trace, if any. - */ - asyncStackTrace?: Runtime.StackTrace | undefined; - /** - * Async stack trace, if any. - * @experimental - */ - asyncStackTraceId?: Runtime.StackTraceId | undefined; - /** - * Just scheduled async call will have this stack trace as parent stack during async execution. This field is available only after Debugger.stepInto call with breakOnAsynCall flag. - * @experimental - */ - asyncCallStackTraceId?: Runtime.StackTraceId | undefined; - } - } - namespace Console { - /** - * Console message. - */ - interface ConsoleMessage { - /** - * Message source. - */ - source: string; - /** - * Message severity. - */ - level: string; - /** - * Message text. - */ - text: string; - /** - * URL of the message origin. - */ - url?: string | undefined; - /** - * Line number in the resource that generated this message (1-based). - */ - line?: number | undefined; - /** - * Column number in the resource that generated this message (1-based). - */ - column?: number | undefined; - } - interface MessageAddedEventDataType { - /** - * Console message that has been added. - */ - message: ConsoleMessage; - } - } - namespace Profiler { - /** - * Profile node. Holds callsite information, execution statistics and child nodes. - */ - interface ProfileNode { - /** - * Unique id of the node. - */ - id: number; - /** - * Function location. - */ - callFrame: Runtime.CallFrame; - /** - * Number of samples where this node was on top of the call stack. - */ - hitCount?: number | undefined; - /** - * Child node ids. - */ - children?: number[] | undefined; - /** - * The reason of being not optimized. The function may be deoptimized or marked as don't optimize. - */ - deoptReason?: string | undefined; - /** - * An array of source position ticks. - */ - positionTicks?: PositionTickInfo[] | undefined; - } - /** - * Profile. - */ - interface Profile { - /** - * The list of profile nodes. First item is the root node. - */ - nodes: ProfileNode[]; - /** - * Profiling start timestamp in microseconds. - */ - startTime: number; - /** - * Profiling end timestamp in microseconds. - */ - endTime: number; - /** - * Ids of samples top nodes. - */ - samples?: number[] | undefined; - /** - * Time intervals between adjacent samples in microseconds. The first delta is relative to the profile startTime. - */ - timeDeltas?: number[] | undefined; - } - /** - * Specifies a number of samples attributed to a certain source position. - */ - interface PositionTickInfo { - /** - * Source line number (1-based). - */ - line: number; - /** - * Number of samples attributed to the source line. - */ - ticks: number; - } - /** - * Coverage data for a source range. - */ - interface CoverageRange { - /** - * JavaScript script source offset for the range start. - */ - startOffset: number; - /** - * JavaScript script source offset for the range end. - */ - endOffset: number; - /** - * Collected execution count of the source range. - */ - count: number; - } - /** - * Coverage data for a JavaScript function. - */ - interface FunctionCoverage { - /** - * JavaScript function name. - */ - functionName: string; - /** - * Source ranges inside the function with coverage data. - */ - ranges: CoverageRange[]; - /** - * Whether coverage data for this function has block granularity. - */ - isBlockCoverage: boolean; - } - /** - * Coverage data for a JavaScript script. - */ - interface ScriptCoverage { - /** - * JavaScript script id. - */ - scriptId: Runtime.ScriptId; - /** - * JavaScript script name or url. - */ - url: string; - /** - * Functions contained in the script that has coverage data. - */ - functions: FunctionCoverage[]; - } - /** - * Describes a type collected during runtime. - * @experimental - */ - interface TypeObject { - /** - * Name of a type collected with type profiling. - */ - name: string; - } - /** - * Source offset and types for a parameter or return value. - * @experimental - */ - interface TypeProfileEntry { - /** - * Source offset of the parameter or end of function for return values. - */ - offset: number; - /** - * The types for this parameter or return value. - */ - types: TypeObject[]; - } - /** - * Type profile data collected during runtime for a JavaScript script. - * @experimental - */ - interface ScriptTypeProfile { - /** - * JavaScript script id. - */ - scriptId: Runtime.ScriptId; - /** - * JavaScript script name or url. - */ - url: string; - /** - * Type profile entries for parameters and return values of the functions in the script. - */ - entries: TypeProfileEntry[]; - } - interface SetSamplingIntervalParameterType { - /** - * New sampling interval in microseconds. - */ - interval: number; - } - interface StartPreciseCoverageParameterType { - /** - * Collect accurate call counts beyond simple 'covered' or 'not covered'. - */ - callCount?: boolean | undefined; - /** - * Collect block-based coverage. - */ - detailed?: boolean | undefined; - } - interface StopReturnType { - /** - * Recorded profile. - */ - profile: Profile; - } - interface TakePreciseCoverageReturnType { - /** - * Coverage data for the current isolate. - */ - result: ScriptCoverage[]; - } - interface GetBestEffortCoverageReturnType { - /** - * Coverage data for the current isolate. - */ - result: ScriptCoverage[]; - } - interface TakeTypeProfileReturnType { - /** - * Type profile for all scripts since startTypeProfile() was turned on. - */ - result: ScriptTypeProfile[]; - } - interface ConsoleProfileStartedEventDataType { - id: string; - /** - * Location of console.profile(). - */ - location: Debugger.Location; - /** - * Profile title passed as an argument to console.profile(). - */ - title?: string | undefined; - } - interface ConsoleProfileFinishedEventDataType { - id: string; - /** - * Location of console.profileEnd(). - */ - location: Debugger.Location; - profile: Profile; - /** - * Profile title passed as an argument to console.profile(). - */ - title?: string | undefined; - } - } - namespace HeapProfiler { - /** - * Heap snapshot object id. - */ - type HeapSnapshotObjectId = string; - /** - * Sampling Heap Profile node. Holds callsite information, allocation statistics and child nodes. - */ - interface SamplingHeapProfileNode { - /** - * Function location. - */ - callFrame: Runtime.CallFrame; - /** - * Allocations size in bytes for the node excluding children. - */ - selfSize: number; - /** - * Child nodes. - */ - children: SamplingHeapProfileNode[]; - } - /** - * Profile. - */ - interface SamplingHeapProfile { - head: SamplingHeapProfileNode; - } - interface StartTrackingHeapObjectsParameterType { - trackAllocations?: boolean | undefined; - } - interface StopTrackingHeapObjectsParameterType { - /** - * If true 'reportHeapSnapshotProgress' events will be generated while snapshot is being taken when the tracking is stopped. - */ - reportProgress?: boolean | undefined; - } - interface TakeHeapSnapshotParameterType { - /** - * If true 'reportHeapSnapshotProgress' events will be generated while snapshot is being taken. - */ - reportProgress?: boolean | undefined; - } - interface GetObjectByHeapObjectIdParameterType { - objectId: HeapSnapshotObjectId; - /** - * Symbolic group name that can be used to release multiple objects. - */ - objectGroup?: string | undefined; - } - interface AddInspectedHeapObjectParameterType { - /** - * Heap snapshot object id to be accessible by means of $x command line API. - */ - heapObjectId: HeapSnapshotObjectId; - } - interface GetHeapObjectIdParameterType { - /** - * Identifier of the object to get heap object id for. - */ - objectId: Runtime.RemoteObjectId; - } - interface StartSamplingParameterType { - /** - * Average sample interval in bytes. Poisson distribution is used for the intervals. The default value is 32768 bytes. - */ - samplingInterval?: number | undefined; - } - interface GetObjectByHeapObjectIdReturnType { - /** - * Evaluation result. - */ - result: Runtime.RemoteObject; - } - interface GetHeapObjectIdReturnType { - /** - * Id of the heap snapshot object corresponding to the passed remote object id. - */ - heapSnapshotObjectId: HeapSnapshotObjectId; - } - interface StopSamplingReturnType { - /** - * Recorded sampling heap profile. - */ - profile: SamplingHeapProfile; - } - interface GetSamplingProfileReturnType { - /** - * Return the sampling profile being collected. - */ - profile: SamplingHeapProfile; - } - interface AddHeapSnapshotChunkEventDataType { - chunk: string; - } - interface ReportHeapSnapshotProgressEventDataType { - done: number; - total: number; - finished?: boolean | undefined; - } - interface LastSeenObjectIdEventDataType { - lastSeenObjectId: number; - timestamp: number; - } - interface HeapStatsUpdateEventDataType { - /** - * An array of triplets. Each triplet describes a fragment. The first integer is the fragment index, the second integer is a total count of objects for the fragment, the third integer is a total size of the objects for the fragment. - */ - statsUpdate: number[]; - } - } - namespace NodeTracing { - interface TraceConfig { - /** - * Controls how the trace buffer stores data. - */ - recordMode?: string | undefined; - /** - * Included category filters. - */ - includedCategories: string[]; - } - interface StartParameterType { - traceConfig: TraceConfig; - } - interface GetCategoriesReturnType { - /** - * A list of supported tracing categories. - */ - categories: string[]; - } - interface DataCollectedEventDataType { - value: Array<{}>; - } - } - namespace NodeWorker { - type WorkerID = string; - /** - * Unique identifier of attached debugging session. - */ - type SessionID = string; - interface WorkerInfo { - workerId: WorkerID; - type: string; - title: string; - url: string; - } - interface SendMessageToWorkerParameterType { - message: string; - /** - * Identifier of the session. - */ - sessionId: SessionID; - } - interface EnableParameterType { - /** - * Whether to new workers should be paused until the frontend sends `Runtime.runIfWaitingForDebugger` - * message to run them. - */ - waitForDebuggerOnStart: boolean; - } - interface DetachParameterType { - sessionId: SessionID; - } - interface AttachedToWorkerEventDataType { - /** - * Identifier assigned to the session used to send/receive messages. - */ - sessionId: SessionID; - workerInfo: WorkerInfo; - waitingForDebugger: boolean; - } - interface DetachedFromWorkerEventDataType { - /** - * Detached session identifier. - */ - sessionId: SessionID; - } - interface ReceivedMessageFromWorkerEventDataType { - /** - * Identifier of a session which sends a message. - */ - sessionId: SessionID; - message: string; - } - } - namespace NodeRuntime { - interface NotifyWhenWaitingForDisconnectParameterType { - enabled: boolean; - } - } - /** - * The `inspector.Session` is used for dispatching messages to the V8 inspector - * back-end and receiving message responses and notifications. - */ - class Session extends EventEmitter { - /** - * Create a new instance of the inspector.Session class. - * The inspector session needs to be connected through session.connect() before the messages can be dispatched to the inspector backend. - */ - constructor(); - /** - * Connects a session to the inspector back-end. - * @since v8.0.0 - */ - connect(): void; - /** - * Immediately close the session. All pending message callbacks will be called - * with an error. `session.connect()` will need to be called to be able to send - * messages again. Reconnected session will lose all inspector state, such as - * enabled agents or configured breakpoints. - * @since v8.0.0 - */ - disconnect(): void; - /** - * Posts a message to the inspector back-end. `callback` will be notified when - * a response is received. `callback` is a function that accepts two optional - * arguments: error and message-specific result. - * - * ```js - * session.post('Runtime.evaluate', { expression: '2 + 2' }, - * (error, { result }) => console.log(result)); - * // Output: { type: 'number', value: 4, description: '4' } - * ``` - * - * The latest version of the V8 inspector protocol is published on the [Chrome DevTools Protocol Viewer](https://chromedevtools.github.io/devtools-protocol/v8/). - * - * Node.js inspector supports all the Chrome DevTools Protocol domains declared - * by V8\. Chrome DevTools Protocol domain provides an interface for interacting - * with one of the runtime agents used to inspect the application state and listen - * to the run-time events. - * - * ## Example usage - * - * Apart from the debugger, various V8 Profilers are available through the DevTools - * protocol. - * @since v8.0.0 - */ - post(method: string, params?: {}, callback?: (err: Error | null, params?: {}) => void): void; - post(method: string, callback?: (err: Error | null, params?: {}) => void): void; - /** - * Returns supported domains. - */ - post(method: 'Schema.getDomains', callback?: (err: Error | null, params: Schema.GetDomainsReturnType) => void): void; - /** - * Evaluates expression on global object. - */ - post(method: 'Runtime.evaluate', params?: Runtime.EvaluateParameterType, callback?: (err: Error | null, params: Runtime.EvaluateReturnType) => void): void; - post(method: 'Runtime.evaluate', callback?: (err: Error | null, params: Runtime.EvaluateReturnType) => void): void; - /** - * Add handler to promise with given promise object id. - */ - post(method: 'Runtime.awaitPromise', params?: Runtime.AwaitPromiseParameterType, callback?: (err: Error | null, params: Runtime.AwaitPromiseReturnType) => void): void; - post(method: 'Runtime.awaitPromise', callback?: (err: Error | null, params: Runtime.AwaitPromiseReturnType) => void): void; - /** - * Calls function with given declaration on the given object. Object group of the result is inherited from the target object. - */ - post(method: 'Runtime.callFunctionOn', params?: Runtime.CallFunctionOnParameterType, callback?: (err: Error | null, params: Runtime.CallFunctionOnReturnType) => void): void; - post(method: 'Runtime.callFunctionOn', callback?: (err: Error | null, params: Runtime.CallFunctionOnReturnType) => void): void; - /** - * Returns properties of a given object. Object group of the result is inherited from the target object. - */ - post(method: 'Runtime.getProperties', params?: Runtime.GetPropertiesParameterType, callback?: (err: Error | null, params: Runtime.GetPropertiesReturnType) => void): void; - post(method: 'Runtime.getProperties', callback?: (err: Error | null, params: Runtime.GetPropertiesReturnType) => void): void; - /** - * Releases remote object with given id. - */ - post(method: 'Runtime.releaseObject', params?: Runtime.ReleaseObjectParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Runtime.releaseObject', callback?: (err: Error | null) => void): void; - /** - * Releases all remote objects that belong to a given group. - */ - post(method: 'Runtime.releaseObjectGroup', params?: Runtime.ReleaseObjectGroupParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Runtime.releaseObjectGroup', callback?: (err: Error | null) => void): void; - /** - * Tells inspected instance to run if it was waiting for debugger to attach. - */ - post(method: 'Runtime.runIfWaitingForDebugger', callback?: (err: Error | null) => void): void; - /** - * Enables reporting of execution contexts creation by means of executionContextCreated event. When the reporting gets enabled the event will be sent immediately for each existing execution context. - */ - post(method: 'Runtime.enable', callback?: (err: Error | null) => void): void; - /** - * Disables reporting of execution contexts creation. - */ - post(method: 'Runtime.disable', callback?: (err: Error | null) => void): void; - /** - * Discards collected exceptions and console API calls. - */ - post(method: 'Runtime.discardConsoleEntries', callback?: (err: Error | null) => void): void; - /** - * @experimental - */ - post(method: 'Runtime.setCustomObjectFormatterEnabled', params?: Runtime.SetCustomObjectFormatterEnabledParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Runtime.setCustomObjectFormatterEnabled', callback?: (err: Error | null) => void): void; - /** - * Compiles expression. - */ - post(method: 'Runtime.compileScript', params?: Runtime.CompileScriptParameterType, callback?: (err: Error | null, params: Runtime.CompileScriptReturnType) => void): void; - post(method: 'Runtime.compileScript', callback?: (err: Error | null, params: Runtime.CompileScriptReturnType) => void): void; - /** - * Runs script with given id in a given context. - */ - post(method: 'Runtime.runScript', params?: Runtime.RunScriptParameterType, callback?: (err: Error | null, params: Runtime.RunScriptReturnType) => void): void; - post(method: 'Runtime.runScript', callback?: (err: Error | null, params: Runtime.RunScriptReturnType) => void): void; - post(method: 'Runtime.queryObjects', params?: Runtime.QueryObjectsParameterType, callback?: (err: Error | null, params: Runtime.QueryObjectsReturnType) => void): void; - post(method: 'Runtime.queryObjects', callback?: (err: Error | null, params: Runtime.QueryObjectsReturnType) => void): void; - /** - * Returns all let, const and class variables from global scope. - */ - post( - method: 'Runtime.globalLexicalScopeNames', - params?: Runtime.GlobalLexicalScopeNamesParameterType, - callback?: (err: Error | null, params: Runtime.GlobalLexicalScopeNamesReturnType) => void - ): void; - post(method: 'Runtime.globalLexicalScopeNames', callback?: (err: Error | null, params: Runtime.GlobalLexicalScopeNamesReturnType) => void): void; - /** - * Enables debugger for the given page. Clients should not assume that the debugging has been enabled until the result for this command is received. - */ - post(method: 'Debugger.enable', callback?: (err: Error | null, params: Debugger.EnableReturnType) => void): void; - /** - * Disables debugger for given page. - */ - post(method: 'Debugger.disable', callback?: (err: Error | null) => void): void; - /** - * Activates / deactivates all breakpoints on the page. - */ - post(method: 'Debugger.setBreakpointsActive', params?: Debugger.SetBreakpointsActiveParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Debugger.setBreakpointsActive', callback?: (err: Error | null) => void): void; - /** - * Makes page not interrupt on any pauses (breakpoint, exception, dom exception etc). - */ - post(method: 'Debugger.setSkipAllPauses', params?: Debugger.SetSkipAllPausesParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Debugger.setSkipAllPauses', callback?: (err: Error | null) => void): void; - /** - * Sets JavaScript breakpoint at given location specified either by URL or URL regex. Once this command is issued, all existing parsed scripts will have breakpoints resolved and returned in locations property. Further matching script parsing will result in subsequent breakpointResolved events issued. This logical breakpoint will survive page reloads. - */ - post(method: 'Debugger.setBreakpointByUrl', params?: Debugger.SetBreakpointByUrlParameterType, callback?: (err: Error | null, params: Debugger.SetBreakpointByUrlReturnType) => void): void; - post(method: 'Debugger.setBreakpointByUrl', callback?: (err: Error | null, params: Debugger.SetBreakpointByUrlReturnType) => void): void; - /** - * Sets JavaScript breakpoint at a given location. - */ - post(method: 'Debugger.setBreakpoint', params?: Debugger.SetBreakpointParameterType, callback?: (err: Error | null, params: Debugger.SetBreakpointReturnType) => void): void; - post(method: 'Debugger.setBreakpoint', callback?: (err: Error | null, params: Debugger.SetBreakpointReturnType) => void): void; - /** - * Removes JavaScript breakpoint. - */ - post(method: 'Debugger.removeBreakpoint', params?: Debugger.RemoveBreakpointParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Debugger.removeBreakpoint', callback?: (err: Error | null) => void): void; - /** - * Returns possible locations for breakpoint. scriptId in start and end range locations should be the same. - */ - post( - method: 'Debugger.getPossibleBreakpoints', - params?: Debugger.GetPossibleBreakpointsParameterType, - callback?: (err: Error | null, params: Debugger.GetPossibleBreakpointsReturnType) => void - ): void; - post(method: 'Debugger.getPossibleBreakpoints', callback?: (err: Error | null, params: Debugger.GetPossibleBreakpointsReturnType) => void): void; - /** - * Continues execution until specific location is reached. - */ - post(method: 'Debugger.continueToLocation', params?: Debugger.ContinueToLocationParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Debugger.continueToLocation', callback?: (err: Error | null) => void): void; - /** - * @experimental - */ - post(method: 'Debugger.pauseOnAsyncCall', params?: Debugger.PauseOnAsyncCallParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Debugger.pauseOnAsyncCall', callback?: (err: Error | null) => void): void; - /** - * Steps over the statement. - */ - post(method: 'Debugger.stepOver', callback?: (err: Error | null) => void): void; - /** - * Steps into the function call. - */ - post(method: 'Debugger.stepInto', params?: Debugger.StepIntoParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Debugger.stepInto', callback?: (err: Error | null) => void): void; - /** - * Steps out of the function call. - */ - post(method: 'Debugger.stepOut', callback?: (err: Error | null) => void): void; - /** - * Stops on the next JavaScript statement. - */ - post(method: 'Debugger.pause', callback?: (err: Error | null) => void): void; - /** - * This method is deprecated - use Debugger.stepInto with breakOnAsyncCall and Debugger.pauseOnAsyncTask instead. Steps into next scheduled async task if any is scheduled before next pause. Returns success when async task is actually scheduled, returns error if no task were scheduled or another scheduleStepIntoAsync was called. - * @experimental - */ - post(method: 'Debugger.scheduleStepIntoAsync', callback?: (err: Error | null) => void): void; - /** - * Resumes JavaScript execution. - */ - post(method: 'Debugger.resume', callback?: (err: Error | null) => void): void; - /** - * Returns stack trace with given stackTraceId. - * @experimental - */ - post(method: 'Debugger.getStackTrace', params?: Debugger.GetStackTraceParameterType, callback?: (err: Error | null, params: Debugger.GetStackTraceReturnType) => void): void; - post(method: 'Debugger.getStackTrace', callback?: (err: Error | null, params: Debugger.GetStackTraceReturnType) => void): void; - /** - * Searches for given string in script content. - */ - post(method: 'Debugger.searchInContent', params?: Debugger.SearchInContentParameterType, callback?: (err: Error | null, params: Debugger.SearchInContentReturnType) => void): void; - post(method: 'Debugger.searchInContent', callback?: (err: Error | null, params: Debugger.SearchInContentReturnType) => void): void; - /** - * Edits JavaScript source live. - */ - post(method: 'Debugger.setScriptSource', params?: Debugger.SetScriptSourceParameterType, callback?: (err: Error | null, params: Debugger.SetScriptSourceReturnType) => void): void; - post(method: 'Debugger.setScriptSource', callback?: (err: Error | null, params: Debugger.SetScriptSourceReturnType) => void): void; - /** - * Restarts particular call frame from the beginning. - */ - post(method: 'Debugger.restartFrame', params?: Debugger.RestartFrameParameterType, callback?: (err: Error | null, params: Debugger.RestartFrameReturnType) => void): void; - post(method: 'Debugger.restartFrame', callback?: (err: Error | null, params: Debugger.RestartFrameReturnType) => void): void; - /** - * Returns source for the script with given id. - */ - post(method: 'Debugger.getScriptSource', params?: Debugger.GetScriptSourceParameterType, callback?: (err: Error | null, params: Debugger.GetScriptSourceReturnType) => void): void; - post(method: 'Debugger.getScriptSource', callback?: (err: Error | null, params: Debugger.GetScriptSourceReturnType) => void): void; - /** - * Defines pause on exceptions state. Can be set to stop on all exceptions, uncaught exceptions or no exceptions. Initial pause on exceptions state is none. - */ - post(method: 'Debugger.setPauseOnExceptions', params?: Debugger.SetPauseOnExceptionsParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Debugger.setPauseOnExceptions', callback?: (err: Error | null) => void): void; - /** - * Evaluates expression on a given call frame. - */ - post(method: 'Debugger.evaluateOnCallFrame', params?: Debugger.EvaluateOnCallFrameParameterType, callback?: (err: Error | null, params: Debugger.EvaluateOnCallFrameReturnType) => void): void; - post(method: 'Debugger.evaluateOnCallFrame', callback?: (err: Error | null, params: Debugger.EvaluateOnCallFrameReturnType) => void): void; - /** - * Changes value of variable in a callframe. Object-based scopes are not supported and must be mutated manually. - */ - post(method: 'Debugger.setVariableValue', params?: Debugger.SetVariableValueParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Debugger.setVariableValue', callback?: (err: Error | null) => void): void; - /** - * Changes return value in top frame. Available only at return break position. - * @experimental - */ - post(method: 'Debugger.setReturnValue', params?: Debugger.SetReturnValueParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Debugger.setReturnValue', callback?: (err: Error | null) => void): void; - /** - * Enables or disables async call stacks tracking. - */ - post(method: 'Debugger.setAsyncCallStackDepth', params?: Debugger.SetAsyncCallStackDepthParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Debugger.setAsyncCallStackDepth', callback?: (err: Error | null) => void): void; - /** - * Replace previous blackbox patterns with passed ones. Forces backend to skip stepping/pausing in scripts with url matching one of the patterns. VM will try to leave blackboxed script by performing 'step in' several times, finally resorting to 'step out' if unsuccessful. - * @experimental - */ - post(method: 'Debugger.setBlackboxPatterns', params?: Debugger.SetBlackboxPatternsParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Debugger.setBlackboxPatterns', callback?: (err: Error | null) => void): void; - /** - * Makes backend skip steps in the script in blackboxed ranges. VM will try leave blacklisted scripts by performing 'step in' several times, finally resorting to 'step out' if unsuccessful. Positions array contains positions where blackbox state is changed. First interval isn't blackboxed. Array should be sorted. - * @experimental - */ - post(method: 'Debugger.setBlackboxedRanges', params?: Debugger.SetBlackboxedRangesParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Debugger.setBlackboxedRanges', callback?: (err: Error | null) => void): void; - /** - * Enables console domain, sends the messages collected so far to the client by means of the messageAdded notification. - */ - post(method: 'Console.enable', callback?: (err: Error | null) => void): void; - /** - * Disables console domain, prevents further console messages from being reported to the client. - */ - post(method: 'Console.disable', callback?: (err: Error | null) => void): void; - /** - * Does nothing. - */ - post(method: 'Console.clearMessages', callback?: (err: Error | null) => void): void; - post(method: 'Profiler.enable', callback?: (err: Error | null) => void): void; - post(method: 'Profiler.disable', callback?: (err: Error | null) => void): void; - /** - * Changes CPU profiler sampling interval. Must be called before CPU profiles recording started. - */ - post(method: 'Profiler.setSamplingInterval', params?: Profiler.SetSamplingIntervalParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Profiler.setSamplingInterval', callback?: (err: Error | null) => void): void; - post(method: 'Profiler.start', callback?: (err: Error | null) => void): void; - post(method: 'Profiler.stop', callback?: (err: Error | null, params: Profiler.StopReturnType) => void): void; - /** - * Enable precise code coverage. Coverage data for JavaScript executed before enabling precise code coverage may be incomplete. Enabling prevents running optimized code and resets execution counters. - */ - post(method: 'Profiler.startPreciseCoverage', params?: Profiler.StartPreciseCoverageParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Profiler.startPreciseCoverage', callback?: (err: Error | null) => void): void; - /** - * Disable precise code coverage. Disabling releases unnecessary execution count records and allows executing optimized code. - */ - post(method: 'Profiler.stopPreciseCoverage', callback?: (err: Error | null) => void): void; - /** - * Collect coverage data for the current isolate, and resets execution counters. Precise code coverage needs to have started. - */ - post(method: 'Profiler.takePreciseCoverage', callback?: (err: Error | null, params: Profiler.TakePreciseCoverageReturnType) => void): void; - /** - * Collect coverage data for the current isolate. The coverage data may be incomplete due to garbage collection. - */ - post(method: 'Profiler.getBestEffortCoverage', callback?: (err: Error | null, params: Profiler.GetBestEffortCoverageReturnType) => void): void; - /** - * Enable type profile. - * @experimental - */ - post(method: 'Profiler.startTypeProfile', callback?: (err: Error | null) => void): void; - /** - * Disable type profile. Disabling releases type profile data collected so far. - * @experimental - */ - post(method: 'Profiler.stopTypeProfile', callback?: (err: Error | null) => void): void; - /** - * Collect type profile. - * @experimental - */ - post(method: 'Profiler.takeTypeProfile', callback?: (err: Error | null, params: Profiler.TakeTypeProfileReturnType) => void): void; - post(method: 'HeapProfiler.enable', callback?: (err: Error | null) => void): void; - post(method: 'HeapProfiler.disable', callback?: (err: Error | null) => void): void; - post(method: 'HeapProfiler.startTrackingHeapObjects', params?: HeapProfiler.StartTrackingHeapObjectsParameterType, callback?: (err: Error | null) => void): void; - post(method: 'HeapProfiler.startTrackingHeapObjects', callback?: (err: Error | null) => void): void; - post(method: 'HeapProfiler.stopTrackingHeapObjects', params?: HeapProfiler.StopTrackingHeapObjectsParameterType, callback?: (err: Error | null) => void): void; - post(method: 'HeapProfiler.stopTrackingHeapObjects', callback?: (err: Error | null) => void): void; - post(method: 'HeapProfiler.takeHeapSnapshot', params?: HeapProfiler.TakeHeapSnapshotParameterType, callback?: (err: Error | null) => void): void; - post(method: 'HeapProfiler.takeHeapSnapshot', callback?: (err: Error | null) => void): void; - post(method: 'HeapProfiler.collectGarbage', callback?: (err: Error | null) => void): void; - post( - method: 'HeapProfiler.getObjectByHeapObjectId', - params?: HeapProfiler.GetObjectByHeapObjectIdParameterType, - callback?: (err: Error | null, params: HeapProfiler.GetObjectByHeapObjectIdReturnType) => void - ): void; - post(method: 'HeapProfiler.getObjectByHeapObjectId', callback?: (err: Error | null, params: HeapProfiler.GetObjectByHeapObjectIdReturnType) => void): void; - /** - * Enables console to refer to the node with given id via $x (see Command Line API for more details $x functions). - */ - post(method: 'HeapProfiler.addInspectedHeapObject', params?: HeapProfiler.AddInspectedHeapObjectParameterType, callback?: (err: Error | null) => void): void; - post(method: 'HeapProfiler.addInspectedHeapObject', callback?: (err: Error | null) => void): void; - post(method: 'HeapProfiler.getHeapObjectId', params?: HeapProfiler.GetHeapObjectIdParameterType, callback?: (err: Error | null, params: HeapProfiler.GetHeapObjectIdReturnType) => void): void; - post(method: 'HeapProfiler.getHeapObjectId', callback?: (err: Error | null, params: HeapProfiler.GetHeapObjectIdReturnType) => void): void; - post(method: 'HeapProfiler.startSampling', params?: HeapProfiler.StartSamplingParameterType, callback?: (err: Error | null) => void): void; - post(method: 'HeapProfiler.startSampling', callback?: (err: Error | null) => void): void; - post(method: 'HeapProfiler.stopSampling', callback?: (err: Error | null, params: HeapProfiler.StopSamplingReturnType) => void): void; - post(method: 'HeapProfiler.getSamplingProfile', callback?: (err: Error | null, params: HeapProfiler.GetSamplingProfileReturnType) => void): void; - /** - * Gets supported tracing categories. - */ - post(method: 'NodeTracing.getCategories', callback?: (err: Error | null, params: NodeTracing.GetCategoriesReturnType) => void): void; - /** - * Start trace events collection. - */ - post(method: 'NodeTracing.start', params?: NodeTracing.StartParameterType, callback?: (err: Error | null) => void): void; - post(method: 'NodeTracing.start', callback?: (err: Error | null) => void): void; - /** - * Stop trace events collection. Remaining collected events will be sent as a sequence of - * dataCollected events followed by tracingComplete event. - */ - post(method: 'NodeTracing.stop', callback?: (err: Error | null) => void): void; - /** - * Sends protocol message over session with given id. - */ - post(method: 'NodeWorker.sendMessageToWorker', params?: NodeWorker.SendMessageToWorkerParameterType, callback?: (err: Error | null) => void): void; - post(method: 'NodeWorker.sendMessageToWorker', callback?: (err: Error | null) => void): void; - /** - * Instructs the inspector to attach to running workers. Will also attach to new workers - * as they start - */ - post(method: 'NodeWorker.enable', params?: NodeWorker.EnableParameterType, callback?: (err: Error | null) => void): void; - post(method: 'NodeWorker.enable', callback?: (err: Error | null) => void): void; - /** - * Detaches from all running workers and disables attaching to new workers as they are started. - */ - post(method: 'NodeWorker.disable', callback?: (err: Error | null) => void): void; - /** - * Detached from the worker with given sessionId. - */ - post(method: 'NodeWorker.detach', params?: NodeWorker.DetachParameterType, callback?: (err: Error | null) => void): void; - post(method: 'NodeWorker.detach', callback?: (err: Error | null) => void): void; - /** - * Enable the `NodeRuntime.waitingForDisconnect`. - */ - post(method: 'NodeRuntime.notifyWhenWaitingForDisconnect', params?: NodeRuntime.NotifyWhenWaitingForDisconnectParameterType, callback?: (err: Error | null) => void): void; - post(method: 'NodeRuntime.notifyWhenWaitingForDisconnect', callback?: (err: Error | null) => void): void; - // Events - addListener(event: string, listener: (...args: any[]) => void): this; - /** - * Emitted when any notification from the V8 Inspector is received. - */ - addListener(event: 'inspectorNotification', listener: (message: InspectorNotification<{}>) => void): this; - /** - * Issued when new execution context is created. - */ - addListener(event: 'Runtime.executionContextCreated', listener: (message: InspectorNotification) => void): this; - /** - * Issued when execution context is destroyed. - */ - addListener(event: 'Runtime.executionContextDestroyed', listener: (message: InspectorNotification) => void): this; - /** - * Issued when all executionContexts were cleared in browser - */ - addListener(event: 'Runtime.executionContextsCleared', listener: () => void): this; - /** - * Issued when exception was thrown and unhandled. - */ - addListener(event: 'Runtime.exceptionThrown', listener: (message: InspectorNotification) => void): this; - /** - * Issued when unhandled exception was revoked. - */ - addListener(event: 'Runtime.exceptionRevoked', listener: (message: InspectorNotification) => void): this; - /** - * Issued when console API was called. - */ - addListener(event: 'Runtime.consoleAPICalled', listener: (message: InspectorNotification) => void): this; - /** - * Issued when object should be inspected (for example, as a result of inspect() command line API call). - */ - addListener(event: 'Runtime.inspectRequested', listener: (message: InspectorNotification) => void): this; - /** - * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger. - */ - addListener(event: 'Debugger.scriptParsed', listener: (message: InspectorNotification) => void): this; - /** - * Fired when virtual machine fails to parse the script. - */ - addListener(event: 'Debugger.scriptFailedToParse', listener: (message: InspectorNotification) => void): this; - /** - * Fired when breakpoint is resolved to an actual script and location. - */ - addListener(event: 'Debugger.breakpointResolved', listener: (message: InspectorNotification) => void): this; - /** - * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. - */ - addListener(event: 'Debugger.paused', listener: (message: InspectorNotification) => void): this; - /** - * Fired when the virtual machine resumed execution. - */ - addListener(event: 'Debugger.resumed', listener: () => void): this; - /** - * Issued when new console message is added. - */ - addListener(event: 'Console.messageAdded', listener: (message: InspectorNotification) => void): this; - /** - * Sent when new profile recording is started using console.profile() call. - */ - addListener(event: 'Profiler.consoleProfileStarted', listener: (message: InspectorNotification) => void): this; - addListener(event: 'Profiler.consoleProfileFinished', listener: (message: InspectorNotification) => void): this; - addListener(event: 'HeapProfiler.addHeapSnapshotChunk', listener: (message: InspectorNotification) => void): this; - addListener(event: 'HeapProfiler.resetProfiles', listener: () => void): this; - addListener(event: 'HeapProfiler.reportHeapSnapshotProgress', listener: (message: InspectorNotification) => void): this; - /** - * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. - */ - addListener(event: 'HeapProfiler.lastSeenObjectId', listener: (message: InspectorNotification) => void): this; - /** - * If heap objects tracking has been started then backend may send update for one or more fragments - */ - addListener(event: 'HeapProfiler.heapStatsUpdate', listener: (message: InspectorNotification) => void): this; - /** - * Contains an bucket of collected trace events. - */ - addListener(event: 'NodeTracing.dataCollected', listener: (message: InspectorNotification) => void): this; - /** - * Signals that tracing is stopped and there is no trace buffers pending flush, all data were - * delivered via dataCollected events. - */ - addListener(event: 'NodeTracing.tracingComplete', listener: () => void): this; - /** - * Issued when attached to a worker. - */ - addListener(event: 'NodeWorker.attachedToWorker', listener: (message: InspectorNotification) => void): this; - /** - * Issued when detached from the worker. - */ - addListener(event: 'NodeWorker.detachedFromWorker', listener: (message: InspectorNotification) => void): this; - /** - * Notifies about a new protocol message received from the session - * (session ID is provided in attachedToWorker notification). - */ - addListener(event: 'NodeWorker.receivedMessageFromWorker', listener: (message: InspectorNotification) => void): this; - /** - * This event is fired instead of `Runtime.executionContextDestroyed` when - * enabled. - * It is fired when the Node process finished all code execution and is - * waiting for all frontends to disconnect. - */ - addListener(event: 'NodeRuntime.waitingForDisconnect', listener: () => void): this; - emit(event: string | symbol, ...args: any[]): boolean; - emit(event: 'inspectorNotification', message: InspectorNotification<{}>): boolean; - emit(event: 'Runtime.executionContextCreated', message: InspectorNotification): boolean; - emit(event: 'Runtime.executionContextDestroyed', message: InspectorNotification): boolean; - emit(event: 'Runtime.executionContextsCleared'): boolean; - emit(event: 'Runtime.exceptionThrown', message: InspectorNotification): boolean; - emit(event: 'Runtime.exceptionRevoked', message: InspectorNotification): boolean; - emit(event: 'Runtime.consoleAPICalled', message: InspectorNotification): boolean; - emit(event: 'Runtime.inspectRequested', message: InspectorNotification): boolean; - emit(event: 'Debugger.scriptParsed', message: InspectorNotification): boolean; - emit(event: 'Debugger.scriptFailedToParse', message: InspectorNotification): boolean; - emit(event: 'Debugger.breakpointResolved', message: InspectorNotification): boolean; - emit(event: 'Debugger.paused', message: InspectorNotification): boolean; - emit(event: 'Debugger.resumed'): boolean; - emit(event: 'Console.messageAdded', message: InspectorNotification): boolean; - emit(event: 'Profiler.consoleProfileStarted', message: InspectorNotification): boolean; - emit(event: 'Profiler.consoleProfileFinished', message: InspectorNotification): boolean; - emit(event: 'HeapProfiler.addHeapSnapshotChunk', message: InspectorNotification): boolean; - emit(event: 'HeapProfiler.resetProfiles'): boolean; - emit(event: 'HeapProfiler.reportHeapSnapshotProgress', message: InspectorNotification): boolean; - emit(event: 'HeapProfiler.lastSeenObjectId', message: InspectorNotification): boolean; - emit(event: 'HeapProfiler.heapStatsUpdate', message: InspectorNotification): boolean; - emit(event: 'NodeTracing.dataCollected', message: InspectorNotification): boolean; - emit(event: 'NodeTracing.tracingComplete'): boolean; - emit(event: 'NodeWorker.attachedToWorker', message: InspectorNotification): boolean; - emit(event: 'NodeWorker.detachedFromWorker', message: InspectorNotification): boolean; - emit(event: 'NodeWorker.receivedMessageFromWorker', message: InspectorNotification): boolean; - emit(event: 'NodeRuntime.waitingForDisconnect'): boolean; - on(event: string, listener: (...args: any[]) => void): this; - /** - * Emitted when any notification from the V8 Inspector is received. - */ - on(event: 'inspectorNotification', listener: (message: InspectorNotification<{}>) => void): this; - /** - * Issued when new execution context is created. - */ - on(event: 'Runtime.executionContextCreated', listener: (message: InspectorNotification) => void): this; - /** - * Issued when execution context is destroyed. - */ - on(event: 'Runtime.executionContextDestroyed', listener: (message: InspectorNotification) => void): this; - /** - * Issued when all executionContexts were cleared in browser - */ - on(event: 'Runtime.executionContextsCleared', listener: () => void): this; - /** - * Issued when exception was thrown and unhandled. - */ - on(event: 'Runtime.exceptionThrown', listener: (message: InspectorNotification) => void): this; - /** - * Issued when unhandled exception was revoked. - */ - on(event: 'Runtime.exceptionRevoked', listener: (message: InspectorNotification) => void): this; - /** - * Issued when console API was called. - */ - on(event: 'Runtime.consoleAPICalled', listener: (message: InspectorNotification) => void): this; - /** - * Issued when object should be inspected (for example, as a result of inspect() command line API call). - */ - on(event: 'Runtime.inspectRequested', listener: (message: InspectorNotification) => void): this; - /** - * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger. - */ - on(event: 'Debugger.scriptParsed', listener: (message: InspectorNotification) => void): this; - /** - * Fired when virtual machine fails to parse the script. - */ - on(event: 'Debugger.scriptFailedToParse', listener: (message: InspectorNotification) => void): this; - /** - * Fired when breakpoint is resolved to an actual script and location. - */ - on(event: 'Debugger.breakpointResolved', listener: (message: InspectorNotification) => void): this; - /** - * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. - */ - on(event: 'Debugger.paused', listener: (message: InspectorNotification) => void): this; - /** - * Fired when the virtual machine resumed execution. - */ - on(event: 'Debugger.resumed', listener: () => void): this; - /** - * Issued when new console message is added. - */ - on(event: 'Console.messageAdded', listener: (message: InspectorNotification) => void): this; - /** - * Sent when new profile recording is started using console.profile() call. - */ - on(event: 'Profiler.consoleProfileStarted', listener: (message: InspectorNotification) => void): this; - on(event: 'Profiler.consoleProfileFinished', listener: (message: InspectorNotification) => void): this; - on(event: 'HeapProfiler.addHeapSnapshotChunk', listener: (message: InspectorNotification) => void): this; - on(event: 'HeapProfiler.resetProfiles', listener: () => void): this; - on(event: 'HeapProfiler.reportHeapSnapshotProgress', listener: (message: InspectorNotification) => void): this; - /** - * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. - */ - on(event: 'HeapProfiler.lastSeenObjectId', listener: (message: InspectorNotification) => void): this; - /** - * If heap objects tracking has been started then backend may send update for one or more fragments - */ - on(event: 'HeapProfiler.heapStatsUpdate', listener: (message: InspectorNotification) => void): this; - /** - * Contains an bucket of collected trace events. - */ - on(event: 'NodeTracing.dataCollected', listener: (message: InspectorNotification) => void): this; - /** - * Signals that tracing is stopped and there is no trace buffers pending flush, all data were - * delivered via dataCollected events. - */ - on(event: 'NodeTracing.tracingComplete', listener: () => void): this; - /** - * Issued when attached to a worker. - */ - on(event: 'NodeWorker.attachedToWorker', listener: (message: InspectorNotification) => void): this; - /** - * Issued when detached from the worker. - */ - on(event: 'NodeWorker.detachedFromWorker', listener: (message: InspectorNotification) => void): this; - /** - * Notifies about a new protocol message received from the session - * (session ID is provided in attachedToWorker notification). - */ - on(event: 'NodeWorker.receivedMessageFromWorker', listener: (message: InspectorNotification) => void): this; - /** - * This event is fired instead of `Runtime.executionContextDestroyed` when - * enabled. - * It is fired when the Node process finished all code execution and is - * waiting for all frontends to disconnect. - */ - on(event: 'NodeRuntime.waitingForDisconnect', listener: () => void): this; - once(event: string, listener: (...args: any[]) => void): this; - /** - * Emitted when any notification from the V8 Inspector is received. - */ - once(event: 'inspectorNotification', listener: (message: InspectorNotification<{}>) => void): this; - /** - * Issued when new execution context is created. - */ - once(event: 'Runtime.executionContextCreated', listener: (message: InspectorNotification) => void): this; - /** - * Issued when execution context is destroyed. - */ - once(event: 'Runtime.executionContextDestroyed', listener: (message: InspectorNotification) => void): this; - /** - * Issued when all executionContexts were cleared in browser - */ - once(event: 'Runtime.executionContextsCleared', listener: () => void): this; - /** - * Issued when exception was thrown and unhandled. - */ - once(event: 'Runtime.exceptionThrown', listener: (message: InspectorNotification) => void): this; - /** - * Issued when unhandled exception was revoked. - */ - once(event: 'Runtime.exceptionRevoked', listener: (message: InspectorNotification) => void): this; - /** - * Issued when console API was called. - */ - once(event: 'Runtime.consoleAPICalled', listener: (message: InspectorNotification) => void): this; - /** - * Issued when object should be inspected (for example, as a result of inspect() command line API call). - */ - once(event: 'Runtime.inspectRequested', listener: (message: InspectorNotification) => void): this; - /** - * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger. - */ - once(event: 'Debugger.scriptParsed', listener: (message: InspectorNotification) => void): this; - /** - * Fired when virtual machine fails to parse the script. - */ - once(event: 'Debugger.scriptFailedToParse', listener: (message: InspectorNotification) => void): this; - /** - * Fired when breakpoint is resolved to an actual script and location. - */ - once(event: 'Debugger.breakpointResolved', listener: (message: InspectorNotification) => void): this; - /** - * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. - */ - once(event: 'Debugger.paused', listener: (message: InspectorNotification) => void): this; - /** - * Fired when the virtual machine resumed execution. - */ - once(event: 'Debugger.resumed', listener: () => void): this; - /** - * Issued when new console message is added. - */ - once(event: 'Console.messageAdded', listener: (message: InspectorNotification) => void): this; - /** - * Sent when new profile recording is started using console.profile() call. - */ - once(event: 'Profiler.consoleProfileStarted', listener: (message: InspectorNotification) => void): this; - once(event: 'Profiler.consoleProfileFinished', listener: (message: InspectorNotification) => void): this; - once(event: 'HeapProfiler.addHeapSnapshotChunk', listener: (message: InspectorNotification) => void): this; - once(event: 'HeapProfiler.resetProfiles', listener: () => void): this; - once(event: 'HeapProfiler.reportHeapSnapshotProgress', listener: (message: InspectorNotification) => void): this; - /** - * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. - */ - once(event: 'HeapProfiler.lastSeenObjectId', listener: (message: InspectorNotification) => void): this; - /** - * If heap objects tracking has been started then backend may send update for one or more fragments - */ - once(event: 'HeapProfiler.heapStatsUpdate', listener: (message: InspectorNotification) => void): this; - /** - * Contains an bucket of collected trace events. - */ - once(event: 'NodeTracing.dataCollected', listener: (message: InspectorNotification) => void): this; - /** - * Signals that tracing is stopped and there is no trace buffers pending flush, all data were - * delivered via dataCollected events. - */ - once(event: 'NodeTracing.tracingComplete', listener: () => void): this; - /** - * Issued when attached to a worker. - */ - once(event: 'NodeWorker.attachedToWorker', listener: (message: InspectorNotification) => void): this; - /** - * Issued when detached from the worker. - */ - once(event: 'NodeWorker.detachedFromWorker', listener: (message: InspectorNotification) => void): this; - /** - * Notifies about a new protocol message received from the session - * (session ID is provided in attachedToWorker notification). - */ - once(event: 'NodeWorker.receivedMessageFromWorker', listener: (message: InspectorNotification) => void): this; - /** - * This event is fired instead of `Runtime.executionContextDestroyed` when - * enabled. - * It is fired when the Node process finished all code execution and is - * waiting for all frontends to disconnect. - */ - once(event: 'NodeRuntime.waitingForDisconnect', listener: () => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - /** - * Emitted when any notification from the V8 Inspector is received. - */ - prependListener(event: 'inspectorNotification', listener: (message: InspectorNotification<{}>) => void): this; - /** - * Issued when new execution context is created. - */ - prependListener(event: 'Runtime.executionContextCreated', listener: (message: InspectorNotification) => void): this; - /** - * Issued when execution context is destroyed. - */ - prependListener(event: 'Runtime.executionContextDestroyed', listener: (message: InspectorNotification) => void): this; - /** - * Issued when all executionContexts were cleared in browser - */ - prependListener(event: 'Runtime.executionContextsCleared', listener: () => void): this; - /** - * Issued when exception was thrown and unhandled. - */ - prependListener(event: 'Runtime.exceptionThrown', listener: (message: InspectorNotification) => void): this; - /** - * Issued when unhandled exception was revoked. - */ - prependListener(event: 'Runtime.exceptionRevoked', listener: (message: InspectorNotification) => void): this; - /** - * Issued when console API was called. - */ - prependListener(event: 'Runtime.consoleAPICalled', listener: (message: InspectorNotification) => void): this; - /** - * Issued when object should be inspected (for example, as a result of inspect() command line API call). - */ - prependListener(event: 'Runtime.inspectRequested', listener: (message: InspectorNotification) => void): this; - /** - * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger. - */ - prependListener(event: 'Debugger.scriptParsed', listener: (message: InspectorNotification) => void): this; - /** - * Fired when virtual machine fails to parse the script. - */ - prependListener(event: 'Debugger.scriptFailedToParse', listener: (message: InspectorNotification) => void): this; - /** - * Fired when breakpoint is resolved to an actual script and location. - */ - prependListener(event: 'Debugger.breakpointResolved', listener: (message: InspectorNotification) => void): this; - /** - * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. - */ - prependListener(event: 'Debugger.paused', listener: (message: InspectorNotification) => void): this; - /** - * Fired when the virtual machine resumed execution. - */ - prependListener(event: 'Debugger.resumed', listener: () => void): this; - /** - * Issued when new console message is added. - */ - prependListener(event: 'Console.messageAdded', listener: (message: InspectorNotification) => void): this; - /** - * Sent when new profile recording is started using console.profile() call. - */ - prependListener(event: 'Profiler.consoleProfileStarted', listener: (message: InspectorNotification) => void): this; - prependListener(event: 'Profiler.consoleProfileFinished', listener: (message: InspectorNotification) => void): this; - prependListener(event: 'HeapProfiler.addHeapSnapshotChunk', listener: (message: InspectorNotification) => void): this; - prependListener(event: 'HeapProfiler.resetProfiles', listener: () => void): this; - prependListener(event: 'HeapProfiler.reportHeapSnapshotProgress', listener: (message: InspectorNotification) => void): this; - /** - * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. - */ - prependListener(event: 'HeapProfiler.lastSeenObjectId', listener: (message: InspectorNotification) => void): this; - /** - * If heap objects tracking has been started then backend may send update for one or more fragments - */ - prependListener(event: 'HeapProfiler.heapStatsUpdate', listener: (message: InspectorNotification) => void): this; - /** - * Contains an bucket of collected trace events. - */ - prependListener(event: 'NodeTracing.dataCollected', listener: (message: InspectorNotification) => void): this; - /** - * Signals that tracing is stopped and there is no trace buffers pending flush, all data were - * delivered via dataCollected events. - */ - prependListener(event: 'NodeTracing.tracingComplete', listener: () => void): this; - /** - * Issued when attached to a worker. - */ - prependListener(event: 'NodeWorker.attachedToWorker', listener: (message: InspectorNotification) => void): this; - /** - * Issued when detached from the worker. - */ - prependListener(event: 'NodeWorker.detachedFromWorker', listener: (message: InspectorNotification) => void): this; - /** - * Notifies about a new protocol message received from the session - * (session ID is provided in attachedToWorker notification). - */ - prependListener(event: 'NodeWorker.receivedMessageFromWorker', listener: (message: InspectorNotification) => void): this; - /** - * This event is fired instead of `Runtime.executionContextDestroyed` when - * enabled. - * It is fired when the Node process finished all code execution and is - * waiting for all frontends to disconnect. - */ - prependListener(event: 'NodeRuntime.waitingForDisconnect', listener: () => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - /** - * Emitted when any notification from the V8 Inspector is received. - */ - prependOnceListener(event: 'inspectorNotification', listener: (message: InspectorNotification<{}>) => void): this; - /** - * Issued when new execution context is created. - */ - prependOnceListener(event: 'Runtime.executionContextCreated', listener: (message: InspectorNotification) => void): this; - /** - * Issued when execution context is destroyed. - */ - prependOnceListener(event: 'Runtime.executionContextDestroyed', listener: (message: InspectorNotification) => void): this; - /** - * Issued when all executionContexts were cleared in browser - */ - prependOnceListener(event: 'Runtime.executionContextsCleared', listener: () => void): this; - /** - * Issued when exception was thrown and unhandled. - */ - prependOnceListener(event: 'Runtime.exceptionThrown', listener: (message: InspectorNotification) => void): this; - /** - * Issued when unhandled exception was revoked. - */ - prependOnceListener(event: 'Runtime.exceptionRevoked', listener: (message: InspectorNotification) => void): this; - /** - * Issued when console API was called. - */ - prependOnceListener(event: 'Runtime.consoleAPICalled', listener: (message: InspectorNotification) => void): this; - /** - * Issued when object should be inspected (for example, as a result of inspect() command line API call). - */ - prependOnceListener(event: 'Runtime.inspectRequested', listener: (message: InspectorNotification) => void): this; - /** - * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger. - */ - prependOnceListener(event: 'Debugger.scriptParsed', listener: (message: InspectorNotification) => void): this; - /** - * Fired when virtual machine fails to parse the script. - */ - prependOnceListener(event: 'Debugger.scriptFailedToParse', listener: (message: InspectorNotification) => void): this; - /** - * Fired when breakpoint is resolved to an actual script and location. - */ - prependOnceListener(event: 'Debugger.breakpointResolved', listener: (message: InspectorNotification) => void): this; - /** - * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. - */ - prependOnceListener(event: 'Debugger.paused', listener: (message: InspectorNotification) => void): this; - /** - * Fired when the virtual machine resumed execution. - */ - prependOnceListener(event: 'Debugger.resumed', listener: () => void): this; - /** - * Issued when new console message is added. - */ - prependOnceListener(event: 'Console.messageAdded', listener: (message: InspectorNotification) => void): this; - /** - * Sent when new profile recording is started using console.profile() call. - */ - prependOnceListener(event: 'Profiler.consoleProfileStarted', listener: (message: InspectorNotification) => void): this; - prependOnceListener(event: 'Profiler.consoleProfileFinished', listener: (message: InspectorNotification) => void): this; - prependOnceListener(event: 'HeapProfiler.addHeapSnapshotChunk', listener: (message: InspectorNotification) => void): this; - prependOnceListener(event: 'HeapProfiler.resetProfiles', listener: () => void): this; - prependOnceListener(event: 'HeapProfiler.reportHeapSnapshotProgress', listener: (message: InspectorNotification) => void): this; - /** - * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. - */ - prependOnceListener(event: 'HeapProfiler.lastSeenObjectId', listener: (message: InspectorNotification) => void): this; - /** - * If heap objects tracking has been started then backend may send update for one or more fragments - */ - prependOnceListener(event: 'HeapProfiler.heapStatsUpdate', listener: (message: InspectorNotification) => void): this; - /** - * Contains an bucket of collected trace events. - */ - prependOnceListener(event: 'NodeTracing.dataCollected', listener: (message: InspectorNotification) => void): this; - /** - * Signals that tracing is stopped and there is no trace buffers pending flush, all data were - * delivered via dataCollected events. - */ - prependOnceListener(event: 'NodeTracing.tracingComplete', listener: () => void): this; - /** - * Issued when attached to a worker. - */ - prependOnceListener(event: 'NodeWorker.attachedToWorker', listener: (message: InspectorNotification) => void): this; - /** - * Issued when detached from the worker. - */ - prependOnceListener(event: 'NodeWorker.detachedFromWorker', listener: (message: InspectorNotification) => void): this; - /** - * Notifies about a new protocol message received from the session - * (session ID is provided in attachedToWorker notification). - */ - prependOnceListener(event: 'NodeWorker.receivedMessageFromWorker', listener: (message: InspectorNotification) => void): this; - /** - * This event is fired instead of `Runtime.executionContextDestroyed` when - * enabled. - * It is fired when the Node process finished all code execution and is - * waiting for all frontends to disconnect. - */ - prependOnceListener(event: 'NodeRuntime.waitingForDisconnect', listener: () => void): this; - } - /** - * Activate inspector on host and port. Equivalent to`node --inspect=[[host:]port]`, but can be done programmatically after node has - * started. - * - * If wait is `true`, will block until a client has connected to the inspect port - * and flow control has been passed to the debugger client. - * - * See the `security warning` regarding the `host`parameter usage. - * @param [port='what was specified on the CLI'] Port to listen on for inspector connections. Optional. - * @param [host='what was specified on the CLI'] Host to listen on for inspector connections. Optional. - * @param [wait=false] Block until a client has connected. Optional. - */ - function open(port?: number, host?: string, wait?: boolean): void; - /** - * Deactivate the inspector. Blocks until there are no active connections. - */ - function close(): void; - /** - * Return the URL of the active inspector, or `undefined` if there is none. - * - * ```console - * $ node --inspect -p 'inspector.url()' - * Debugger listening on ws://127.0.0.1:9229/166e272e-7a30-4d09-97ce-f1c012b43c34 - * For help, see: https://nodejs.org/en/docs/inspector - * ws://127.0.0.1:9229/166e272e-7a30-4d09-97ce-f1c012b43c34 - * - * $ node --inspect=localhost:3000 -p 'inspector.url()' - * Debugger listening on ws://localhost:3000/51cf8d0e-3c36-4c59-8efd-54519839e56a - * For help, see: https://nodejs.org/en/docs/inspector - * ws://localhost:3000/51cf8d0e-3c36-4c59-8efd-54519839e56a - * - * $ node -p 'inspector.url()' - * undefined - * ``` - */ - function url(): string | undefined; - /** - * Blocks until a client (existing or connected later) has sent`Runtime.runIfWaitingForDebugger` command. - * - * An exception will be thrown if there is no active inspector. - * @since v12.7.0 - */ - function waitForDebugger(): void; -} -/** - * The inspector module provides an API for interacting with the V8 inspector. - */ -declare module 'node:inspector' { - import inspector = require('inspector'); - export = inspector; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/module.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/module.d.ts deleted file mode 100755 index d83aec94..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/module.d.ts +++ /dev/null @@ -1,114 +0,0 @@ -/** - * @since v0.3.7 - */ -declare module 'module' { - import { URL } from 'node:url'; - namespace Module { - /** - * The `module.syncBuiltinESMExports()` method updates all the live bindings for - * builtin `ES Modules` to match the properties of the `CommonJS` exports. It - * does not add or remove exported names from the `ES Modules`. - * - * ```js - * const fs = require('fs'); - * const assert = require('assert'); - * const { syncBuiltinESMExports } = require('module'); - * - * fs.readFile = newAPI; - * - * delete fs.readFileSync; - * - * function newAPI() { - * // ... - * } - * - * fs.newAPI = newAPI; - * - * syncBuiltinESMExports(); - * - * import('fs').then((esmFS) => { - * // It syncs the existing readFile property with the new value - * assert.strictEqual(esmFS.readFile, newAPI); - * // readFileSync has been deleted from the required fs - * assert.strictEqual('readFileSync' in fs, false); - * // syncBuiltinESMExports() does not remove readFileSync from esmFS - * assert.strictEqual('readFileSync' in esmFS, true); - * // syncBuiltinESMExports() does not add names - * assert.strictEqual(esmFS.newAPI, undefined); - * }); - * ``` - * @since v12.12.0 - */ - function syncBuiltinESMExports(): void; - /** - * `path` is the resolved path for the file for which a corresponding source map - * should be fetched. - * @since v13.7.0, v12.17.0 - */ - function findSourceMap(path: string, error?: Error): SourceMap; - interface SourceMapPayload { - file: string; - version: number; - sources: string[]; - sourcesContent: string[]; - names: string[]; - mappings: string; - sourceRoot: string; - } - interface SourceMapping { - generatedLine: number; - generatedColumn: number; - originalSource: string; - originalLine: number; - originalColumn: number; - } - /** - * @since v13.7.0, v12.17.0 - */ - class SourceMap { - /** - * Getter for the payload used to construct the `SourceMap` instance. - */ - readonly payload: SourceMapPayload; - constructor(payload: SourceMapPayload); - /** - * Given a line number and column number in the generated source file, returns - * an object representing the position in the original file. The object returned - * consists of the following keys: - */ - findEntry(line: number, column: number): SourceMapping; - } - } - interface Module extends NodeModule {} - class Module { - static runMain(): void; - static wrap(code: string): string; - static createRequire(path: string | URL): NodeRequire; - static builtinModules: string[]; - static Module: typeof Module; - constructor(id: string, parent?: Module); - } - global { - interface ImportMeta { - url: string; - /** - * @experimental - * This feature is only available with the `--experimental-import-meta-resolve` - * command flag enabled. - * - * Provides a module-relative resolution function scoped to each module, returning - * the URL string. - * - * @param specified The module specifier to resolve relative to `parent`. - * @param parent The absolute parent module URL to resolve from. If none - * is specified, the value of `import.meta.url` is used as the default. - */ - resolve?(specified: string, parent?: string | URL): Promise; - } - } - export = Module; -} -declare module 'node:module' { - import module = require('module'); - export = module; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/net.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/net.d.ts deleted file mode 100755 index 72cebc82..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/net.d.ts +++ /dev/null @@ -1,869 +0,0 @@ -/** - * > Stability: 2 - Stable - * - * The `net` module provides an asynchronous network API for creating stream-based - * TCP or `IPC` servers ({@link createServer}) and clients - * ({@link createConnection}). - * - * It can be accessed using: - * - * ```js - * const net = require('net'); - * ``` - * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/net.js) - */ -declare module 'net' { - import * as stream from 'node:stream'; - import { Abortable, EventEmitter } from 'node:events'; - import * as dns from 'node:dns'; - type LookupFunction = (hostname: string, options: dns.LookupOneOptions, callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void) => void; - interface AddressInfo { - address: string; - family: string; - port: number; - } - interface SocketConstructorOpts { - fd?: number | undefined; - allowHalfOpen?: boolean | undefined; - readable?: boolean | undefined; - writable?: boolean | undefined; - signal?: AbortSignal; - } - interface OnReadOpts { - buffer: Uint8Array | (() => Uint8Array); - /** - * This function is called for every chunk of incoming data. - * Two arguments are passed to it: the number of bytes written to buffer and a reference to buffer. - * Return false from this function to implicitly pause() the socket. - */ - callback(bytesWritten: number, buf: Uint8Array): boolean; - } - interface ConnectOpts { - /** - * If specified, incoming data is stored in a single buffer and passed to the supplied callback when data arrives on the socket. - * Note: this will cause the streaming functionality to not provide any data, however events like 'error', 'end', and 'close' will - * still be emitted as normal and methods like pause() and resume() will also behave as expected. - */ - onread?: OnReadOpts | undefined; - } - interface TcpSocketConnectOpts extends ConnectOpts { - port: number; - host?: string | undefined; - localAddress?: string | undefined; - localPort?: number | undefined; - hints?: number | undefined; - family?: number | undefined; - lookup?: LookupFunction | undefined; - noDelay?: boolean | undefined; - keepAlive?: boolean | undefined; - keepAliveInitialDelay?: number | undefined; - } - interface IpcSocketConnectOpts extends ConnectOpts { - path: string; - } - type SocketConnectOpts = TcpSocketConnectOpts | IpcSocketConnectOpts; - type SocketReadyState = 'opening' | 'open' | 'readOnly' | 'writeOnly' | 'closed'; - /** - * This class is an abstraction of a TCP socket or a streaming `IPC` endpoint - * (uses named pipes on Windows, and Unix domain sockets otherwise). It is also - * an `EventEmitter`. - * - * A `net.Socket` can be created by the user and used directly to interact with - * a server. For example, it is returned by {@link createConnection}, - * so the user can use it to talk to the server. - * - * It can also be created by Node.js and passed to the user when a connection - * is received. For example, it is passed to the listeners of a `'connection'` event emitted on a {@link Server}, so the user can use - * it to interact with the client. - * @since v0.3.4 - */ - class Socket extends stream.Duplex { - constructor(options?: SocketConstructorOpts); - /** - * Sends data on the socket. The second parameter specifies the encoding in the - * case of a string. It defaults to UTF8 encoding. - * - * Returns `true` if the entire data was flushed successfully to the kernel - * buffer. Returns `false` if all or part of the data was queued in user memory.`'drain'` will be emitted when the buffer is again free. - * - * The optional `callback` parameter will be executed when the data is finally - * written out, which may not be immediately. - * - * See `Writable` stream `write()` method for more - * information. - * @since v0.1.90 - * @param [encoding='utf8'] Only used when data is `string`. - */ - write(buffer: Uint8Array | string, cb?: (err?: Error) => void): boolean; - write(str: Uint8Array | string, encoding?: BufferEncoding, cb?: (err?: Error) => void): boolean; - /** - * Initiate a connection on a given socket. - * - * Possible signatures: - * - * * `socket.connect(options[, connectListener])` - * * `socket.connect(path[, connectListener])` for `IPC` connections. - * * `socket.connect(port[, host][, connectListener])` for TCP connections. - * * Returns: `net.Socket` The socket itself. - * - * This function is asynchronous. When the connection is established, the `'connect'` event will be emitted. If there is a problem connecting, - * instead of a `'connect'` event, an `'error'` event will be emitted with - * the error passed to the `'error'` listener. - * The last parameter `connectListener`, if supplied, will be added as a listener - * for the `'connect'` event **once**. - * - * This function should only be used for reconnecting a socket after`'close'` has been emitted or otherwise it may lead to undefined - * behavior. - */ - connect(options: SocketConnectOpts, connectionListener?: () => void): this; - connect(port: number, host: string, connectionListener?: () => void): this; - connect(port: number, connectionListener?: () => void): this; - connect(path: string, connectionListener?: () => void): this; - /** - * Set the encoding for the socket as a `Readable Stream`. See `readable.setEncoding()` for more information. - * @since v0.1.90 - * @return The socket itself. - */ - setEncoding(encoding?: BufferEncoding): this; - /** - * Pauses the reading of data. That is, `'data'` events will not be emitted. - * Useful to throttle back an upload. - * @return The socket itself. - */ - pause(): this; - /** - * Close the TCP connection by sending an RST packet and destroy the stream. - * If this TCP socket is in connecting status, it will send an RST packet - * and destroy this TCP socket once it is connected. Otherwise, it will call - * `socket.destroy` with an `ERR_SOCKET_CLOSED` Error. If this is not a TCP socket - * (for example, a pipe), calling this method will immediately throw - * an `ERR_INVALID_HANDLE_TYPE` Error. - * @since v18.3.0 - * @return The socket itself. - */ - resetAndDestroy(): this; - /** - * Resumes reading after a call to `socket.pause()`. - * @return The socket itself. - */ - resume(): this; - /** - * Sets the socket to timeout after `timeout` milliseconds of inactivity on - * the socket. By default `net.Socket` do not have a timeout. - * - * When an idle timeout is triggered the socket will receive a `'timeout'` event but the connection will not be severed. The user must manually call `socket.end()` or `socket.destroy()` to - * end the connection. - * - * ```js - * socket.setTimeout(3000); - * socket.on('timeout', () => { - * console.log('socket timeout'); - * socket.end(); - * }); - * ``` - * - * If `timeout` is 0, then the existing idle timeout is disabled. - * - * The optional `callback` parameter will be added as a one-time listener for the `'timeout'` event. - * @since v0.1.90 - * @return The socket itself. - */ - setTimeout(timeout: number, callback?: () => void): this; - /** - * Enable/disable the use of Nagle's algorithm. - * - * When a TCP connection is created, it will have Nagle's algorithm enabled. - * - * Nagle's algorithm delays data before it is sent via the network. It attempts - * to optimize throughput at the expense of latency. - * - * Passing `true` for `noDelay` or not passing an argument will disable Nagle's - * algorithm for the socket. Passing `false` for `noDelay` will enable Nagle's - * algorithm. - * @since v0.1.90 - * @param [noDelay=true] - * @return The socket itself. - */ - setNoDelay(noDelay?: boolean): this; - /** - * Enable/disable keep-alive functionality, and optionally set the initial - * delay before the first keepalive probe is sent on an idle socket. - * - * Set `initialDelay` (in milliseconds) to set the delay between the last - * data packet received and the first keepalive probe. Setting `0` for`initialDelay` will leave the value unchanged from the default - * (or previous) setting. - * - * Enabling the keep-alive functionality will set the following socket options: - * - * * `SO_KEEPALIVE=1` - * * `TCP_KEEPIDLE=initialDelay` - * * `TCP_KEEPCNT=10` - * * `TCP_KEEPINTVL=1` - * @since v0.1.92 - * @param [enable=false] - * @param [initialDelay=0] - * @return The socket itself. - */ - setKeepAlive(enable?: boolean, initialDelay?: number): this; - /** - * Returns the bound `address`, the address `family` name and `port` of the - * socket as reported by the operating system:`{ port: 12346, family: 'IPv4', address: '127.0.0.1' }` - * @since v0.1.90 - */ - address(): AddressInfo | {}; - /** - * Calling `unref()` on a socket will allow the program to exit if this is the only - * active socket in the event system. If the socket is already `unref`ed calling`unref()` again will have no effect. - * @since v0.9.1 - * @return The socket itself. - */ - unref(): this; - /** - * Opposite of `unref()`, calling `ref()` on a previously `unref`ed socket will _not_ let the program exit if it's the only socket left (the default behavior). - * If the socket is `ref`ed calling `ref` again will have no effect. - * @since v0.9.1 - * @return The socket itself. - */ - ref(): this; - /** - * This property shows the number of characters buffered for writing. The buffer - * may contain strings whose length after encoding is not yet known. So this number - * is only an approximation of the number of bytes in the buffer. - * - * `net.Socket` has the property that `socket.write()` always works. This is to - * help users get up and running quickly. The computer cannot always keep up - * with the amount of data that is written to a socket. The network connection - * simply might be too slow. Node.js will internally queue up the data written to a - * socket and send it out over the wire when it is possible. - * - * The consequence of this internal buffering is that memory may grow. - * Users who experience large or growing `bufferSize` should attempt to - * "throttle" the data flows in their program with `socket.pause()` and `socket.resume()`. - * @since v0.3.8 - * @deprecated Since v14.6.0 - Use `writableLength` instead. - */ - readonly bufferSize: number; - /** - * The amount of received bytes. - * @since v0.5.3 - */ - readonly bytesRead: number; - /** - * The amount of bytes sent. - * @since v0.5.3 - */ - readonly bytesWritten: number; - /** - * If `true`,`socket.connect(options[, connectListener])` was - * called and has not yet finished. It will stay `true` until the socket becomes - * connected, then it is set to `false` and the `'connect'` event is emitted. Note - * that the `socket.connect(options[, connectListener])` callback is a listener for the `'connect'` event. - * @since v6.1.0 - */ - readonly connecting: boolean; - /** - * See `writable.destroyed` for further details. - */ - readonly destroyed: boolean; - /** - * The string representation of the local IP address the remote client is - * connecting on. For example, in a server listening on `'0.0.0.0'`, if a client - * connects on `'192.168.1.1'`, the value of `socket.localAddress` would be`'192.168.1.1'`. - * @since v0.9.6 - */ - readonly localAddress?: string; - /** - * The numeric representation of the local port. For example, `80` or `21`. - * @since v0.9.6 - */ - readonly localPort?: number; - /** - * The string representation of the local IP family. `'IPv4'` or `'IPv6'`. - * @since v18.8.0 - */ - readonly localFamily?: string; - /** - * This property represents the state of the connection as a string. - * @see {https://nodejs.org/api/net.html#socketreadystate} - * @since v0.5.0 - */ - readonly readyState: SocketReadyState; - /** - * The string representation of the remote IP address. For example,`'74.125.127.100'` or `'2001:4860:a005::68'`. Value may be `undefined` if - * the socket is destroyed (for example, if the client disconnected). - * @since v0.5.10 - */ - readonly remoteAddress?: string | undefined; - /** - * The string representation of the remote IP family. `'IPv4'` or `'IPv6'`. - * @since v0.11.14 - */ - readonly remoteFamily?: string | undefined; - /** - * The numeric representation of the remote port. For example, `80` or `21`. - * @since v0.5.10 - */ - readonly remotePort?: number | undefined; - /** - * The socket timeout in milliseconds as set by socket.setTimeout(). It is undefined if a timeout has not been set. - * @since v10.7.0 - */ - readonly timeout?: number | undefined; - /** - * Half-closes the socket. i.e., it sends a FIN packet. It is possible the - * server will still send some data. - * - * See `writable.end()` for further details. - * @since v0.1.90 - * @param [encoding='utf8'] Only used when data is `string`. - * @param callback Optional callback for when the socket is finished. - * @return The socket itself. - */ - end(callback?: () => void): this; - end(buffer: Uint8Array | string, callback?: () => void): this; - end(str: Uint8Array | string, encoding?: BufferEncoding, callback?: () => void): this; - /** - * events.EventEmitter - * 1. close - * 2. connect - * 3. data - * 4. drain - * 5. end - * 6. error - * 7. lookup - * 8. ready - * 9. timeout - */ - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: 'close', listener: (hadError: boolean) => void): this; - addListener(event: 'connect', listener: () => void): this; - addListener(event: 'data', listener: (data: Buffer) => void): this; - addListener(event: 'drain', listener: () => void): this; - addListener(event: 'end', listener: () => void): this; - addListener(event: 'error', listener: (err: Error) => void): this; - addListener(event: 'lookup', listener: (err: Error, address: string, family: string | number, host: string) => void): this; - addListener(event: 'ready', listener: () => void): this; - addListener(event: 'timeout', listener: () => void): this; - emit(event: string | symbol, ...args: any[]): boolean; - emit(event: 'close', hadError: boolean): boolean; - emit(event: 'connect'): boolean; - emit(event: 'data', data: Buffer): boolean; - emit(event: 'drain'): boolean; - emit(event: 'end'): boolean; - emit(event: 'error', err: Error): boolean; - emit(event: 'lookup', err: Error, address: string, family: string | number, host: string): boolean; - emit(event: 'ready'): boolean; - emit(event: 'timeout'): boolean; - on(event: string, listener: (...args: any[]) => void): this; - on(event: 'close', listener: (hadError: boolean) => void): this; - on(event: 'connect', listener: () => void): this; - on(event: 'data', listener: (data: Buffer) => void): this; - on(event: 'drain', listener: () => void): this; - on(event: 'end', listener: () => void): this; - on(event: 'error', listener: (err: Error) => void): this; - on(event: 'lookup', listener: (err: Error, address: string, family: string | number, host: string) => void): this; - on(event: 'ready', listener: () => void): this; - on(event: 'timeout', listener: () => void): this; - once(event: string, listener: (...args: any[]) => void): this; - once(event: 'close', listener: (hadError: boolean) => void): this; - once(event: 'connect', listener: () => void): this; - once(event: 'data', listener: (data: Buffer) => void): this; - once(event: 'drain', listener: () => void): this; - once(event: 'end', listener: () => void): this; - once(event: 'error', listener: (err: Error) => void): this; - once(event: 'lookup', listener: (err: Error, address: string, family: string | number, host: string) => void): this; - once(event: 'ready', listener: () => void): this; - once(event: 'timeout', listener: () => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: 'close', listener: (hadError: boolean) => void): this; - prependListener(event: 'connect', listener: () => void): this; - prependListener(event: 'data', listener: (data: Buffer) => void): this; - prependListener(event: 'drain', listener: () => void): this; - prependListener(event: 'end', listener: () => void): this; - prependListener(event: 'error', listener: (err: Error) => void): this; - prependListener(event: 'lookup', listener: (err: Error, address: string, family: string | number, host: string) => void): this; - prependListener(event: 'ready', listener: () => void): this; - prependListener(event: 'timeout', listener: () => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: 'close', listener: (hadError: boolean) => void): this; - prependOnceListener(event: 'connect', listener: () => void): this; - prependOnceListener(event: 'data', listener: (data: Buffer) => void): this; - prependOnceListener(event: 'drain', listener: () => void): this; - prependOnceListener(event: 'end', listener: () => void): this; - prependOnceListener(event: 'error', listener: (err: Error) => void): this; - prependOnceListener(event: 'lookup', listener: (err: Error, address: string, family: string | number, host: string) => void): this; - prependOnceListener(event: 'ready', listener: () => void): this; - prependOnceListener(event: 'timeout', listener: () => void): this; - } - interface ListenOptions extends Abortable { - port?: number | undefined; - host?: string | undefined; - backlog?: number | undefined; - path?: string | undefined; - exclusive?: boolean | undefined; - readableAll?: boolean | undefined; - writableAll?: boolean | undefined; - /** - * @default false - */ - ipv6Only?: boolean | undefined; - } - interface ServerOpts { - /** - * Indicates whether half-opened TCP connections are allowed. - * @default false - */ - allowHalfOpen?: boolean | undefined; - /** - * Indicates whether the socket should be paused on incoming connections. - * @default false - */ - pauseOnConnect?: boolean | undefined; - /** - * If set to `true`, it disables the use of Nagle's algorithm immediately after a new incoming connection is received. - * @default false - * @since v16.5.0 - */ - noDelay?: boolean | undefined; - /** - * If set to `true`, it enables keep-alive functionality on the socket immediately after a new incoming connection is received, - * similarly on what is done in `socket.setKeepAlive([enable][, initialDelay])`. - * @default false - * @since v16.5.0 - */ - keepAlive?: boolean | undefined; - /** - * If set to a positive number, it sets the initial delay before the first keepalive probe is sent on an idle socket. - * @default 0 - * @since v16.5.0 - */ - keepAliveInitialDelay?: number | undefined; - } - interface DropArgument { - localAddress?: string; - localPort?: number; - localFamily?: string; - remoteAddress?: string; - remotePort?: number; - remoteFamily?: string; - } - /** - * This class is used to create a TCP or `IPC` server. - * @since v0.1.90 - */ - class Server extends EventEmitter { - constructor(connectionListener?: (socket: Socket) => void); - constructor(options?: ServerOpts, connectionListener?: (socket: Socket) => void); - /** - * Start a server listening for connections. A `net.Server` can be a TCP or - * an `IPC` server depending on what it listens to. - * - * Possible signatures: - * - * * `server.listen(handle[, backlog][, callback])` - * * `server.listen(options[, callback])` - * * `server.listen(path[, backlog][, callback])` for `IPC` servers - * * `server.listen([port[, host[, backlog]]][, callback])` for TCP servers - * - * This function is asynchronous. When the server starts listening, the `'listening'` event will be emitted. The last parameter `callback`will be added as a listener for the `'listening'` - * event. - * - * All `listen()` methods can take a `backlog` parameter to specify the maximum - * length of the queue of pending connections. The actual length will be determined - * by the OS through sysctl settings such as `tcp_max_syn_backlog` and `somaxconn`on Linux. The default value of this parameter is 511 (not 512). - * - * All {@link Socket} are set to `SO_REUSEADDR` (see [`socket(7)`](https://man7.org/linux/man-pages/man7/socket.7.html) for - * details). - * - * The `server.listen()` method can be called again if and only if there was an - * error during the first `server.listen()` call or `server.close()` has been - * called. Otherwise, an `ERR_SERVER_ALREADY_LISTEN` error will be thrown. - * - * One of the most common errors raised when listening is `EADDRINUSE`. - * This happens when another server is already listening on the requested`port`/`path`/`handle`. One way to handle this would be to retry - * after a certain amount of time: - * - * ```js - * server.on('error', (e) => { - * if (e.code === 'EADDRINUSE') { - * console.log('Address in use, retrying...'); - * setTimeout(() => { - * server.close(); - * server.listen(PORT, HOST); - * }, 1000); - * } - * }); - * ``` - */ - listen(port?: number, hostname?: string, backlog?: number, listeningListener?: () => void): this; - listen(port?: number, hostname?: string, listeningListener?: () => void): this; - listen(port?: number, backlog?: number, listeningListener?: () => void): this; - listen(port?: number, listeningListener?: () => void): this; - listen(path: string, backlog?: number, listeningListener?: () => void): this; - listen(path: string, listeningListener?: () => void): this; - listen(options: ListenOptions, listeningListener?: () => void): this; - listen(handle: any, backlog?: number, listeningListener?: () => void): this; - listen(handle: any, listeningListener?: () => void): this; - /** - * Stops the server from accepting new connections and keeps existing - * connections. This function is asynchronous, the server is finally closed - * when all connections are ended and the server emits a `'close'` event. - * The optional `callback` will be called once the `'close'` event occurs. Unlike - * that event, it will be called with an `Error` as its only argument if the server - * was not open when it was closed. - * @since v0.1.90 - * @param callback Called when the server is closed. - */ - close(callback?: (err?: Error) => void): this; - /** - * Returns the bound `address`, the address `family` name, and `port` of the server - * as reported by the operating system if listening on an IP socket - * (useful to find which port was assigned when getting an OS-assigned address):`{ port: 12346, family: 'IPv4', address: '127.0.0.1' }`. - * - * For a server listening on a pipe or Unix domain socket, the name is returned - * as a string. - * - * ```js - * const server = net.createServer((socket) => { - * socket.end('goodbye\n'); - * }).on('error', (err) => { - * // Handle errors here. - * throw err; - * }); - * - * // Grab an arbitrary unused port. - * server.listen(() => { - * console.log('opened server on', server.address()); - * }); - * ``` - * - * `server.address()` returns `null` before the `'listening'` event has been - * emitted or after calling `server.close()`. - * @since v0.1.90 - */ - address(): AddressInfo | string | null; - /** - * Asynchronously get the number of concurrent connections on the server. Works - * when sockets were sent to forks. - * - * Callback should take two arguments `err` and `count`. - * @since v0.9.7 - */ - getConnections(cb: (error: Error | null, count: number) => void): void; - /** - * Opposite of `unref()`, calling `ref()` on a previously `unref`ed server will _not_ let the program exit if it's the only server left (the default behavior). - * If the server is `ref`ed calling `ref()` again will have no effect. - * @since v0.9.1 - */ - ref(): this; - /** - * Calling `unref()` on a server will allow the program to exit if this is the only - * active server in the event system. If the server is already `unref`ed calling`unref()` again will have no effect. - * @since v0.9.1 - */ - unref(): this; - /** - * Set this property to reject connections when the server's connection count gets - * high. - * - * It is not recommended to use this option once a socket has been sent to a child - * with `child_process.fork()`. - * @since v0.2.0 - */ - maxConnections: number; - connections: number; - /** - * Indicates whether or not the server is listening for connections. - * @since v5.7.0 - */ - listening: boolean; - /** - * events.EventEmitter - * 1. close - * 2. connection - * 3. error - * 4. listening - * 5. drop - */ - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: 'close', listener: () => void): this; - addListener(event: 'connection', listener: (socket: Socket) => void): this; - addListener(event: 'error', listener: (err: Error) => void): this; - addListener(event: 'listening', listener: () => void): this; - addListener(event: 'drop', listener: (data?: DropArgument) => void): this; - emit(event: string | symbol, ...args: any[]): boolean; - emit(event: 'close'): boolean; - emit(event: 'connection', socket: Socket): boolean; - emit(event: 'error', err: Error): boolean; - emit(event: 'listening'): boolean; - emit(event: 'drop', data?: DropArgument): boolean; - on(event: string, listener: (...args: any[]) => void): this; - on(event: 'close', listener: () => void): this; - on(event: 'connection', listener: (socket: Socket) => void): this; - on(event: 'error', listener: (err: Error) => void): this; - on(event: 'listening', listener: () => void): this; - on(event: 'drop', listener: (data?: DropArgument) => void): this; - once(event: string, listener: (...args: any[]) => void): this; - once(event: 'close', listener: () => void): this; - once(event: 'connection', listener: (socket: Socket) => void): this; - once(event: 'error', listener: (err: Error) => void): this; - once(event: 'listening', listener: () => void): this; - once(event: 'drop', listener: (data?: DropArgument) => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: 'close', listener: () => void): this; - prependListener(event: 'connection', listener: (socket: Socket) => void): this; - prependListener(event: 'error', listener: (err: Error) => void): this; - prependListener(event: 'listening', listener: () => void): this; - prependListener(event: 'drop', listener: (data?: DropArgument) => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: 'close', listener: () => void): this; - prependOnceListener(event: 'connection', listener: (socket: Socket) => void): this; - prependOnceListener(event: 'error', listener: (err: Error) => void): this; - prependOnceListener(event: 'listening', listener: () => void): this; - prependOnceListener(event: 'drop', listener: (data?: DropArgument) => void): this; - } - type IPVersion = 'ipv4' | 'ipv6'; - /** - * The `BlockList` object can be used with some network APIs to specify rules for - * disabling inbound or outbound access to specific IP addresses, IP ranges, or - * IP subnets. - * @since v15.0.0, v14.18.0 - */ - class BlockList { - /** - * Adds a rule to block the given IP address. - * @since v15.0.0, v14.18.0 - * @param address An IPv4 or IPv6 address. - * @param [type='ipv4'] Either `'ipv4'` or `'ipv6'`. - */ - addAddress(address: string, type?: IPVersion): void; - addAddress(address: SocketAddress): void; - /** - * Adds a rule to block a range of IP addresses from `start` (inclusive) to`end` (inclusive). - * @since v15.0.0, v14.18.0 - * @param start The starting IPv4 or IPv6 address in the range. - * @param end The ending IPv4 or IPv6 address in the range. - * @param [type='ipv4'] Either `'ipv4'` or `'ipv6'`. - */ - addRange(start: string, end: string, type?: IPVersion): void; - addRange(start: SocketAddress, end: SocketAddress): void; - /** - * Adds a rule to block a range of IP addresses specified as a subnet mask. - * @since v15.0.0, v14.18.0 - * @param net The network IPv4 or IPv6 address. - * @param prefix The number of CIDR prefix bits. For IPv4, this must be a value between `0` and `32`. For IPv6, this must be between `0` and `128`. - * @param [type='ipv4'] Either `'ipv4'` or `'ipv6'`. - */ - addSubnet(net: SocketAddress, prefix: number): void; - addSubnet(net: string, prefix: number, type?: IPVersion): void; - /** - * Returns `true` if the given IP address matches any of the rules added to the`BlockList`. - * - * ```js - * const blockList = new net.BlockList(); - * blockList.addAddress('123.123.123.123'); - * blockList.addRange('10.0.0.1', '10.0.0.10'); - * blockList.addSubnet('8592:757c:efae:4e45::', 64, 'ipv6'); - * - * console.log(blockList.check('123.123.123.123')); // Prints: true - * console.log(blockList.check('10.0.0.3')); // Prints: true - * console.log(blockList.check('222.111.111.222')); // Prints: false - * - * // IPv6 notation for IPv4 addresses works: - * console.log(blockList.check('::ffff:7b7b:7b7b', 'ipv6')); // Prints: true - * console.log(blockList.check('::ffff:123.123.123.123', 'ipv6')); // Prints: true - * ``` - * @since v15.0.0, v14.18.0 - * @param address The IP address to check - * @param [type='ipv4'] Either `'ipv4'` or `'ipv6'`. - */ - check(address: SocketAddress): boolean; - check(address: string, type?: IPVersion): boolean; - } - interface TcpNetConnectOpts extends TcpSocketConnectOpts, SocketConstructorOpts { - timeout?: number | undefined; - } - interface IpcNetConnectOpts extends IpcSocketConnectOpts, SocketConstructorOpts { - timeout?: number | undefined; - } - type NetConnectOpts = TcpNetConnectOpts | IpcNetConnectOpts; - /** - * Creates a new TCP or `IPC` server. - * - * If `allowHalfOpen` is set to `true`, when the other end of the socket - * signals the end of transmission, the server will only send back the end of - * transmission when `socket.end()` is explicitly called. For example, in the - * context of TCP, when a FIN packed is received, a FIN packed is sent - * back only when `socket.end()` is explicitly called. Until then the - * connection is half-closed (non-readable but still writable). See `'end'` event and [RFC 1122](https://tools.ietf.org/html/rfc1122) (section 4.2.2.13) for more information. - * - * If `pauseOnConnect` is set to `true`, then the socket associated with each - * incoming connection will be paused, and no data will be read from its handle. - * This allows connections to be passed between processes without any data being - * read by the original process. To begin reading data from a paused socket, call `socket.resume()`. - * - * The server can be a TCP server or an `IPC` server, depending on what it `listen()` to. - * - * Here is an example of a TCP echo server which listens for connections - * on port 8124: - * - * ```js - * const net = require('net'); - * const server = net.createServer((c) => { - * // 'connection' listener. - * console.log('client connected'); - * c.on('end', () => { - * console.log('client disconnected'); - * }); - * c.write('hello\r\n'); - * c.pipe(c); - * }); - * server.on('error', (err) => { - * throw err; - * }); - * server.listen(8124, () => { - * console.log('server bound'); - * }); - * ``` - * - * Test this by using `telnet`: - * - * ```console - * $ telnet localhost 8124 - * ``` - * - * To listen on the socket `/tmp/echo.sock`: - * - * ```js - * server.listen('/tmp/echo.sock', () => { - * console.log('server bound'); - * }); - * ``` - * - * Use `nc` to connect to a Unix domain socket server: - * - * ```console - * $ nc -U /tmp/echo.sock - * ``` - * @since v0.5.0 - * @param connectionListener Automatically set as a listener for the {@link 'connection'} event. - */ - function createServer(connectionListener?: (socket: Socket) => void): Server; - function createServer(options?: ServerOpts, connectionListener?: (socket: Socket) => void): Server; - /** - * Aliases to {@link createConnection}. - * - * Possible signatures: - * - * * {@link connect} - * * {@link connect} for `IPC` connections. - * * {@link connect} for TCP connections. - */ - function connect(options: NetConnectOpts, connectionListener?: () => void): Socket; - function connect(port: number, host?: string, connectionListener?: () => void): Socket; - function connect(path: string, connectionListener?: () => void): Socket; - /** - * A factory function, which creates a new {@link Socket}, - * immediately initiates connection with `socket.connect()`, - * then returns the `net.Socket` that starts the connection. - * - * When the connection is established, a `'connect'` event will be emitted - * on the returned socket. The last parameter `connectListener`, if supplied, - * will be added as a listener for the `'connect'` event **once**. - * - * Possible signatures: - * - * * {@link createConnection} - * * {@link createConnection} for `IPC` connections. - * * {@link createConnection} for TCP connections. - * - * The {@link connect} function is an alias to this function. - */ - function createConnection(options: NetConnectOpts, connectionListener?: () => void): Socket; - function createConnection(port: number, host?: string, connectionListener?: () => void): Socket; - function createConnection(path: string, connectionListener?: () => void): Socket; - /** - * Returns `6` if `input` is an IPv6 address. Returns `4` if `input` is an IPv4 - * address in [dot-decimal notation](https://en.wikipedia.org/wiki/Dot-decimal_notation) with no leading zeroes. Otherwise, returns`0`. - * - * ```js - * net.isIP('::1'); // returns 6 - * net.isIP('127.0.0.1'); // returns 4 - * net.isIP('127.000.000.001'); // returns 0 - * net.isIP('127.0.0.1/24'); // returns 0 - * net.isIP('fhqwhgads'); // returns 0 - * ``` - * @since v0.3.0 - */ - function isIP(input: string): number; - /** - * Returns `true` if `input` is an IPv4 address in [dot-decimal notation](https://en.wikipedia.org/wiki/Dot-decimal_notation) with no - * leading zeroes. Otherwise, returns `false`. - * - * ```js - * net.isIPv4('127.0.0.1'); // returns true - * net.isIPv4('127.000.000.001'); // returns false - * net.isIPv4('127.0.0.1/24'); // returns false - * net.isIPv4('fhqwhgads'); // returns false - * ``` - * @since v0.3.0 - */ - function isIPv4(input: string): boolean; - /** - * Returns `true` if `input` is an IPv6 address. Otherwise, returns `false`. - * - * ```js - * net.isIPv6('::1'); // returns true - * net.isIPv6('fhqwhgads'); // returns false - * ``` - * @since v0.3.0 - */ - function isIPv6(input: string): boolean; - interface SocketAddressInitOptions { - /** - * The network address as either an IPv4 or IPv6 string. - * @default 127.0.0.1 - */ - address?: string | undefined; - /** - * @default `'ipv4'` - */ - family?: IPVersion | undefined; - /** - * An IPv6 flow-label used only if `family` is `'ipv6'`. - * @default 0 - */ - flowlabel?: number | undefined; - /** - * An IP port. - * @default 0 - */ - port?: number | undefined; - } - /** - * @since v15.14.0, v14.18.0 - */ - class SocketAddress { - constructor(options: SocketAddressInitOptions); - /** - * @since v15.14.0, v14.18.0 - */ - readonly address: string; - /** - * Either \`'ipv4'\` or \`'ipv6'\`. - * @since v15.14.0, v14.18.0 - */ - readonly family: IPVersion; - /** - * @since v15.14.0, v14.18.0 - */ - readonly port: number; - /** - * @since v15.14.0, v14.18.0 - */ - readonly flowlabel: number; - } -} -declare module 'node:net' { - export * from 'net'; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/os.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/os.d.ts deleted file mode 100755 index 3c555992..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/os.d.ts +++ /dev/null @@ -1,466 +0,0 @@ -/** - * The `os` module provides operating system-related utility methods and - * properties. It can be accessed using: - * - * ```js - * const os = require('os'); - * ``` - * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/os.js) - */ -declare module 'os' { - interface CpuInfo { - model: string; - speed: number; - times: { - user: number; - nice: number; - sys: number; - idle: number; - irq: number; - }; - } - interface NetworkInterfaceBase { - address: string; - netmask: string; - mac: string; - internal: boolean; - cidr: string | null; - } - interface NetworkInterfaceInfoIPv4 extends NetworkInterfaceBase { - family: 'IPv4'; - scopeid?: undefined; - } - interface NetworkInterfaceInfoIPv6 extends NetworkInterfaceBase { - family: 'IPv6'; - scopeid: number; - } - interface UserInfo { - username: T; - uid: number; - gid: number; - shell: T; - homedir: T; - } - type NetworkInterfaceInfo = NetworkInterfaceInfoIPv4 | NetworkInterfaceInfoIPv6; - /** - * Returns the host name of the operating system as a string. - * @since v0.3.3 - */ - function hostname(): string; - /** - * Returns an array containing the 1, 5, and 15 minute load averages. - * - * The load average is a measure of system activity calculated by the operating - * system and expressed as a fractional number. - * - * The load average is a Unix-specific concept. On Windows, the return value is - * always `[0, 0, 0]`. - * @since v0.3.3 - */ - function loadavg(): number[]; - /** - * Returns the system uptime in number of seconds. - * @since v0.3.3 - */ - function uptime(): number; - /** - * Returns the amount of free system memory in bytes as an integer. - * @since v0.3.3 - */ - function freemem(): number; - /** - * Returns the total amount of system memory in bytes as an integer. - * @since v0.3.3 - */ - function totalmem(): number; - /** - * Returns an array of objects containing information about each logical CPU core. - * - * The properties included on each object include: - * - * ```js - * [ - * { - * model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz', - * speed: 2926, - * times: { - * user: 252020, - * nice: 0, - * sys: 30340, - * idle: 1070356870, - * irq: 0 - * } - * }, - * { - * model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz', - * speed: 2926, - * times: { - * user: 306960, - * nice: 0, - * sys: 26980, - * idle: 1071569080, - * irq: 0 - * } - * }, - * { - * model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz', - * speed: 2926, - * times: { - * user: 248450, - * nice: 0, - * sys: 21750, - * idle: 1070919370, - * irq: 0 - * } - * }, - * { - * model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz', - * speed: 2926, - * times: { - * user: 256880, - * nice: 0, - * sys: 19430, - * idle: 1070905480, - * irq: 20 - * } - * }, - * ] - * ``` - * - * `nice` values are POSIX-only. On Windows, the `nice` values of all processors - * are always 0. - * @since v0.3.3 - */ - function cpus(): CpuInfo[]; - /** - * Returns the operating system name as returned by [`uname(3)`](https://linux.die.net/man/3/uname). For example, it - * returns `'Linux'` on Linux, `'Darwin'` on macOS, and `'Windows_NT'` on Windows. - * - * See [https://en.wikipedia.org/wiki/Uname#Examples](https://en.wikipedia.org/wiki/Uname#Examples) for additional information - * about the output of running [`uname(3)`](https://linux.die.net/man/3/uname) on various operating systems. - * @since v0.3.3 - */ - function type(): string; - /** - * Returns the operating system as a string. - * - * On POSIX systems, the operating system release is determined by calling [`uname(3)`](https://linux.die.net/man/3/uname). On Windows, `GetVersionExW()` is used. See - * [https://en.wikipedia.org/wiki/Uname#Examples](https://en.wikipedia.org/wiki/Uname#Examples) for more information. - * @since v0.3.3 - */ - function release(): string; - /** - * Returns an object containing network interfaces that have been assigned a - * network address. - * - * Each key on the returned object identifies a network interface. The associated - * value is an array of objects that each describe an assigned network address. - * - * The properties available on the assigned network address object include: - * - * ```js - * { - * lo: [ - * { - * address: '127.0.0.1', - * netmask: '255.0.0.0', - * family: 'IPv4', - * mac: '00:00:00:00:00:00', - * internal: true, - * cidr: '127.0.0.1/8' - * }, - * { - * address: '::1', - * netmask: 'ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff', - * family: 'IPv6', - * mac: '00:00:00:00:00:00', - * scopeid: 0, - * internal: true, - * cidr: '::1/128' - * } - * ], - * eth0: [ - * { - * address: '192.168.1.108', - * netmask: '255.255.255.0', - * family: 'IPv4', - * mac: '01:02:03:0a:0b:0c', - * internal: false, - * cidr: '192.168.1.108/24' - * }, - * { - * address: 'fe80::a00:27ff:fe4e:66a1', - * netmask: 'ffff:ffff:ffff:ffff::', - * family: 'IPv6', - * mac: '01:02:03:0a:0b:0c', - * scopeid: 1, - * internal: false, - * cidr: 'fe80::a00:27ff:fe4e:66a1/64' - * } - * ] - * } - * ``` - * @since v0.6.0 - */ - function networkInterfaces(): NodeJS.Dict; - /** - * Returns the string path of the current user's home directory. - * - * On POSIX, it uses the `$HOME` environment variable if defined. Otherwise it - * uses the [effective UID](https://en.wikipedia.org/wiki/User_identifier#Effective_user_ID) to look up the user's home directory. - * - * On Windows, it uses the `USERPROFILE` environment variable if defined. - * Otherwise it uses the path to the profile directory of the current user. - * @since v2.3.0 - */ - function homedir(): string; - /** - * Returns information about the currently effective user. On POSIX platforms, - * this is typically a subset of the password file. The returned object includes - * the `username`, `uid`, `gid`, `shell`, and `homedir`. On Windows, the `uid` and`gid` fields are `-1`, and `shell` is `null`. - * - * The value of `homedir` returned by `os.userInfo()` is provided by the operating - * system. This differs from the result of `os.homedir()`, which queries - * environment variables for the home directory before falling back to the - * operating system response. - * - * Throws a `SystemError` if a user has no `username` or `homedir`. - * @since v6.0.0 - */ - function userInfo(options: { encoding: 'buffer' }): UserInfo; - function userInfo(options?: { encoding: BufferEncoding }): UserInfo; - type SignalConstants = { - [key in NodeJS.Signals]: number; - }; - namespace constants { - const UV_UDP_REUSEADDR: number; - namespace signals {} - const signals: SignalConstants; - namespace errno { - const E2BIG: number; - const EACCES: number; - const EADDRINUSE: number; - const EADDRNOTAVAIL: number; - const EAFNOSUPPORT: number; - const EAGAIN: number; - const EALREADY: number; - const EBADF: number; - const EBADMSG: number; - const EBUSY: number; - const ECANCELED: number; - const ECHILD: number; - const ECONNABORTED: number; - const ECONNREFUSED: number; - const ECONNRESET: number; - const EDEADLK: number; - const EDESTADDRREQ: number; - const EDOM: number; - const EDQUOT: number; - const EEXIST: number; - const EFAULT: number; - const EFBIG: number; - const EHOSTUNREACH: number; - const EIDRM: number; - const EILSEQ: number; - const EINPROGRESS: number; - const EINTR: number; - const EINVAL: number; - const EIO: number; - const EISCONN: number; - const EISDIR: number; - const ELOOP: number; - const EMFILE: number; - const EMLINK: number; - const EMSGSIZE: number; - const EMULTIHOP: number; - const ENAMETOOLONG: number; - const ENETDOWN: number; - const ENETRESET: number; - const ENETUNREACH: number; - const ENFILE: number; - const ENOBUFS: number; - const ENODATA: number; - const ENODEV: number; - const ENOENT: number; - const ENOEXEC: number; - const ENOLCK: number; - const ENOLINK: number; - const ENOMEM: number; - const ENOMSG: number; - const ENOPROTOOPT: number; - const ENOSPC: number; - const ENOSR: number; - const ENOSTR: number; - const ENOSYS: number; - const ENOTCONN: number; - const ENOTDIR: number; - const ENOTEMPTY: number; - const ENOTSOCK: number; - const ENOTSUP: number; - const ENOTTY: number; - const ENXIO: number; - const EOPNOTSUPP: number; - const EOVERFLOW: number; - const EPERM: number; - const EPIPE: number; - const EPROTO: number; - const EPROTONOSUPPORT: number; - const EPROTOTYPE: number; - const ERANGE: number; - const EROFS: number; - const ESPIPE: number; - const ESRCH: number; - const ESTALE: number; - const ETIME: number; - const ETIMEDOUT: number; - const ETXTBSY: number; - const EWOULDBLOCK: number; - const EXDEV: number; - const WSAEINTR: number; - const WSAEBADF: number; - const WSAEACCES: number; - const WSAEFAULT: number; - const WSAEINVAL: number; - const WSAEMFILE: number; - const WSAEWOULDBLOCK: number; - const WSAEINPROGRESS: number; - const WSAEALREADY: number; - const WSAENOTSOCK: number; - const WSAEDESTADDRREQ: number; - const WSAEMSGSIZE: number; - const WSAEPROTOTYPE: number; - const WSAENOPROTOOPT: number; - const WSAEPROTONOSUPPORT: number; - const WSAESOCKTNOSUPPORT: number; - const WSAEOPNOTSUPP: number; - const WSAEPFNOSUPPORT: number; - const WSAEAFNOSUPPORT: number; - const WSAEADDRINUSE: number; - const WSAEADDRNOTAVAIL: number; - const WSAENETDOWN: number; - const WSAENETUNREACH: number; - const WSAENETRESET: number; - const WSAECONNABORTED: number; - const WSAECONNRESET: number; - const WSAENOBUFS: number; - const WSAEISCONN: number; - const WSAENOTCONN: number; - const WSAESHUTDOWN: number; - const WSAETOOMANYREFS: number; - const WSAETIMEDOUT: number; - const WSAECONNREFUSED: number; - const WSAELOOP: number; - const WSAENAMETOOLONG: number; - const WSAEHOSTDOWN: number; - const WSAEHOSTUNREACH: number; - const WSAENOTEMPTY: number; - const WSAEPROCLIM: number; - const WSAEUSERS: number; - const WSAEDQUOT: number; - const WSAESTALE: number; - const WSAEREMOTE: number; - const WSASYSNOTREADY: number; - const WSAVERNOTSUPPORTED: number; - const WSANOTINITIALISED: number; - const WSAEDISCON: number; - const WSAENOMORE: number; - const WSAECANCELLED: number; - const WSAEINVALIDPROCTABLE: number; - const WSAEINVALIDPROVIDER: number; - const WSAEPROVIDERFAILEDINIT: number; - const WSASYSCALLFAILURE: number; - const WSASERVICE_NOT_FOUND: number; - const WSATYPE_NOT_FOUND: number; - const WSA_E_NO_MORE: number; - const WSA_E_CANCELLED: number; - const WSAEREFUSED: number; - } - namespace priority { - const PRIORITY_LOW: number; - const PRIORITY_BELOW_NORMAL: number; - const PRIORITY_NORMAL: number; - const PRIORITY_ABOVE_NORMAL: number; - const PRIORITY_HIGH: number; - const PRIORITY_HIGHEST: number; - } - } - const devNull: string; - const EOL: string; - /** - * Returns the operating system CPU architecture for which the Node.js binary was - * compiled. Possible values are `'arm'`, `'arm64'`, `'ia32'`, `'mips'`,`'mipsel'`, `'ppc'`, `'ppc64'`, `'s390'`, `'s390x'`, and `'x64'`. - * - * The return value is equivalent to `process.arch`. - * @since v0.5.0 - */ - function arch(): string; - /** - * Returns a string identifying the kernel version. - * - * On POSIX systems, the operating system release is determined by calling [`uname(3)`](https://linux.die.net/man/3/uname). On Windows, `RtlGetVersion()` is used, and if it is not - * available, `GetVersionExW()` will be used. See [https://en.wikipedia.org/wiki/Uname#Examples](https://en.wikipedia.org/wiki/Uname#Examples) for more information. - * @since v13.11.0, v12.17.0 - */ - function version(): string; - /** - * Returns a string identifying the operating system platform for which - * the Node.js binary was compiled. The value is set at compile time. - * Possible values are `'aix'`, `'darwin'`, `'freebsd'`,`'linux'`,`'openbsd'`, `'sunos'`, and `'win32'`. - * - * The return value is equivalent to `process.platform`. - * - * The value `'android'` may also be returned if Node.js is built on the Android - * operating system. [Android support is experimental](https://github.com/nodejs/node/blob/HEAD/BUILDING.md#androidandroid-based-devices-eg-firefox-os). - * @since v0.5.0 - */ - function platform(): NodeJS.Platform; - /** - * Returns the machine type as a string, such as arm, aarch64, mips, mips64, ppc64, ppc64le, s390, s390x, i386, i686, x86_64. - * - * On POSIX systems, the machine type is determined by calling [`uname(3)`](https://linux.die.net/man/3/uname). - * On Windows, `RtlGetVersion()` is used, and if it is not available, `GetVersionExW()` will be used. - * See [https://en.wikipedia.org/wiki/Uname#Examples](https://en.wikipedia.org/wiki/Uname#Examples) for more information. - * @since v18.9.0 - */ - function machine(): string; - /** - * Returns the operating system's default directory for temporary files as a - * string. - * @since v0.9.9 - */ - function tmpdir(): string; - /** - * Returns a string identifying the endianness of the CPU for which the Node.js - * binary was compiled. - * - * Possible values are `'BE'` for big endian and `'LE'` for little endian. - * @since v0.9.4 - */ - function endianness(): 'BE' | 'LE'; - /** - * Returns the scheduling priority for the process specified by `pid`. If `pid` is - * not provided or is `0`, the priority of the current process is returned. - * @since v10.10.0 - * @param [pid=0] The process ID to retrieve scheduling priority for. - */ - function getPriority(pid?: number): number; - /** - * Attempts to set the scheduling priority for the process specified by `pid`. If`pid` is not provided or is `0`, the process ID of the current process is used. - * - * The `priority` input must be an integer between `-20` (high priority) and `19`(low priority). Due to differences between Unix priority levels and Windows - * priority classes, `priority` is mapped to one of six priority constants in`os.constants.priority`. When retrieving a process priority level, this range - * mapping may cause the return value to be slightly different on Windows. To avoid - * confusion, set `priority` to one of the priority constants. - * - * On Windows, setting priority to `PRIORITY_HIGHEST` requires elevated user - * privileges. Otherwise the set priority will be silently reduced to`PRIORITY_HIGH`. - * @since v10.10.0 - * @param [pid=0] The process ID to set scheduling priority for. - * @param priority The scheduling priority to assign to the process. - */ - function setPriority(priority: number): void; - function setPriority(pid: number, priority: number): void; -} -declare module 'node:os' { - export * from 'os'; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/path.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/path.d.ts deleted file mode 100755 index 1d33f792..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/path.d.ts +++ /dev/null @@ -1,191 +0,0 @@ -declare module 'path/posix' { - import path = require('path'); - export = path; -} -declare module 'path/win32' { - import path = require('path'); - export = path; -} -/** - * The `path` module provides utilities for working with file and directory paths. - * It can be accessed using: - * - * ```js - * const path = require('path'); - * ``` - * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/path.js) - */ -declare module 'path' { - namespace path { - /** - * A parsed path object generated by path.parse() or consumed by path.format(). - */ - interface ParsedPath { - /** - * The root of the path such as '/' or 'c:\' - */ - root: string; - /** - * The full directory path such as '/home/user/dir' or 'c:\path\dir' - */ - dir: string; - /** - * The file name including extension (if any) such as 'index.html' - */ - base: string; - /** - * The file extension (if any) such as '.html' - */ - ext: string; - /** - * The file name without extension (if any) such as 'index' - */ - name: string; - } - interface FormatInputPathObject { - /** - * The root of the path such as '/' or 'c:\' - */ - root?: string | undefined; - /** - * The full directory path such as '/home/user/dir' or 'c:\path\dir' - */ - dir?: string | undefined; - /** - * The file name including extension (if any) such as 'index.html' - */ - base?: string | undefined; - /** - * The file extension (if any) such as '.html' - */ - ext?: string | undefined; - /** - * The file name without extension (if any) such as 'index' - */ - name?: string | undefined; - } - interface PlatformPath { - /** - * Normalize a string path, reducing '..' and '.' parts. - * When multiple slashes are found, they're replaced by a single one; when the path contains a trailing slash, it is preserved. On Windows backslashes are used. - * - * @param path string path to normalize. - * @throws {TypeError} if `path` is not a string. - */ - normalize(path: string): string; - /** - * Join all arguments together and normalize the resulting path. - * - * @param paths paths to join. - * @throws {TypeError} if any of the path segments is not a string. - */ - join(...paths: string[]): string; - /** - * The right-most parameter is considered {to}. Other parameters are considered an array of {from}. - * - * Starting from leftmost {from} parameter, resolves {to} to an absolute path. - * - * If {to} isn't already absolute, {from} arguments are prepended in right to left order, - * until an absolute path is found. If after using all {from} paths still no absolute path is found, - * the current working directory is used as well. The resulting path is normalized, - * and trailing slashes are removed unless the path gets resolved to the root directory. - * - * @param paths A sequence of paths or path segments. - * @throws {TypeError} if any of the arguments is not a string. - */ - resolve(...paths: string[]): string; - /** - * Determines whether {path} is an absolute path. An absolute path will always resolve to the same location, regardless of the working directory. - * - * If the given {path} is a zero-length string, `false` will be returned. - * - * @param path path to test. - * @throws {TypeError} if `path` is not a string. - */ - isAbsolute(path: string): boolean; - /** - * Solve the relative path from {from} to {to} based on the current working directory. - * At times we have two absolute paths, and we need to derive the relative path from one to the other. This is actually the reverse transform of path.resolve. - * - * @throws {TypeError} if either `from` or `to` is not a string. - */ - relative(from: string, to: string): string; - /** - * Return the directory name of a path. Similar to the Unix dirname command. - * - * @param path the path to evaluate. - * @throws {TypeError} if `path` is not a string. - */ - dirname(path: string): string; - /** - * Return the last portion of a path. Similar to the Unix basename command. - * Often used to extract the file name from a fully qualified path. - * - * @param path the path to evaluate. - * @param suffix optionally, an extension to remove from the result. - * @throws {TypeError} if `path` is not a string or if `ext` is given and is not a string. - */ - basename(path: string, suffix?: string): string; - /** - * Return the extension of the path, from the last '.' to end of string in the last portion of the path. - * If there is no '.' in the last portion of the path or the first character of it is '.', then it returns an empty string. - * - * @param path the path to evaluate. - * @throws {TypeError} if `path` is not a string. - */ - extname(path: string): string; - /** - * The platform-specific file separator. '\\' or '/'. - */ - readonly sep: '\\' | '/'; - /** - * The platform-specific file delimiter. ';' or ':'. - */ - readonly delimiter: ';' | ':'; - /** - * Returns an object from a path string - the opposite of format(). - * - * @param path path to evaluate. - * @throws {TypeError} if `path` is not a string. - */ - parse(path: string): ParsedPath; - /** - * Returns a path string from an object - the opposite of parse(). - * - * @param pathObject path to evaluate. - */ - format(pathObject: FormatInputPathObject): string; - /** - * On Windows systems only, returns an equivalent namespace-prefixed path for the given path. - * If path is not a string, path will be returned without modifications. - * This method is meaningful only on Windows system. - * On POSIX systems, the method is non-operational and always returns path without modifications. - */ - toNamespacedPath(path: string): string; - /** - * Posix specific pathing. - * Same as parent object on posix. - */ - readonly posix: PlatformPath; - /** - * Windows specific pathing. - * Same as parent object on windows - */ - readonly win32: PlatformPath; - } - } - const path: path.PlatformPath; - export = path; -} -declare module 'node:path' { - import path = require('path'); - export = path; -} -declare module 'node:path/posix' { - import path = require('path/posix'); - export = path; -} -declare module 'node:path/win32' { - import path = require('path/win32'); - export = path; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/perf_hooks.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/perf_hooks.d.ts deleted file mode 100755 index 5c0b228e..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/perf_hooks.d.ts +++ /dev/null @@ -1,625 +0,0 @@ -/** - * This module provides an implementation of a subset of the W3C [Web Performance APIs](https://w3c.github.io/perf-timing-primer/) as well as additional APIs for - * Node.js-specific performance measurements. - * - * Node.js supports the following [Web Performance APIs](https://w3c.github.io/perf-timing-primer/): - * - * * [High Resolution Time](https://www.w3.org/TR/hr-time-2) - * * [Performance Timeline](https://w3c.github.io/performance-timeline/) - * * [User Timing](https://www.w3.org/TR/user-timing/) - * - * ```js - * const { PerformanceObserver, performance } = require('perf_hooks'); - * - * const obs = new PerformanceObserver((items) => { - * console.log(items.getEntries()[0].duration); - * performance.clearMarks(); - * }); - * obs.observe({ type: 'measure' }); - * performance.measure('Start to Now'); - * - * performance.mark('A'); - * doSomeLongRunningProcess(() => { - * performance.measure('A to Now', 'A'); - * - * performance.mark('B'); - * performance.measure('A to B', 'A', 'B'); - * }); - * ``` - * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/perf_hooks.js) - */ -declare module 'perf_hooks' { - import { AsyncResource } from 'node:async_hooks'; - type EntryType = 'node' | 'mark' | 'measure' | 'gc' | 'function' | 'http2' | 'http'; - interface NodeGCPerformanceDetail { - /** - * When `performanceEntry.entryType` is equal to 'gc', `the performance.kind` property identifies - * the type of garbage collection operation that occurred. - * See perf_hooks.constants for valid values. - */ - readonly kind?: number | undefined; - /** - * When `performanceEntry.entryType` is equal to 'gc', the `performance.flags` - * property contains additional information about garbage collection operation. - * See perf_hooks.constants for valid values. - */ - readonly flags?: number | undefined; - } - /** - * @since v8.5.0 - */ - class PerformanceEntry { - protected constructor(); - /** - * The total number of milliseconds elapsed for this entry. This value will not - * be meaningful for all Performance Entry types. - * @since v8.5.0 - */ - readonly duration: number; - /** - * The name of the performance entry. - * @since v8.5.0 - */ - readonly name: string; - /** - * The high resolution millisecond timestamp marking the starting time of the - * Performance Entry. - * @since v8.5.0 - */ - readonly startTime: number; - /** - * The type of the performance entry. It may be one of: - * - * * `'node'` (Node.js only) - * * `'mark'` (available on the Web) - * * `'measure'` (available on the Web) - * * `'gc'` (Node.js only) - * * `'function'` (Node.js only) - * * `'http2'` (Node.js only) - * * `'http'` (Node.js only) - * @since v8.5.0 - */ - readonly entryType: EntryType; - /** - * Additional detail specific to the `entryType`. - * @since v16.0.0 - */ - readonly detail?: NodeGCPerformanceDetail | unknown | undefined; // TODO: Narrow this based on entry type. - toJSON(): any; - } - class PerformanceMark extends PerformanceEntry { - readonly duration: 0; - readonly entryType: 'mark'; - } - class PerformanceMeasure extends PerformanceEntry { - readonly entryType: 'measure'; - } - /** - * _This property is an extension by Node.js. It is not available in Web browsers._ - * - * Provides timing details for Node.js itself. The constructor of this class - * is not exposed to users. - * @since v8.5.0 - */ - class PerformanceNodeTiming extends PerformanceEntry { - /** - * The high resolution millisecond timestamp at which the Node.js process - * completed bootstrapping. If bootstrapping has not yet finished, the property - * has the value of -1. - * @since v8.5.0 - */ - readonly bootstrapComplete: number; - /** - * The high resolution millisecond timestamp at which the Node.js environment was - * initialized. - * @since v8.5.0 - */ - readonly environment: number; - /** - * The high resolution millisecond timestamp of the amount of time the event loop - * has been idle within the event loop's event provider (e.g. `epoll_wait`). This - * does not take CPU usage into consideration. If the event loop has not yet - * started (e.g., in the first tick of the main script), the property has the - * value of 0. - * @since v14.10.0, v12.19.0 - */ - readonly idleTime: number; - /** - * The high resolution millisecond timestamp at which the Node.js event loop - * exited. If the event loop has not yet exited, the property has the value of -1\. - * It can only have a value of not -1 in a handler of the `'exit'` event. - * @since v8.5.0 - */ - readonly loopExit: number; - /** - * The high resolution millisecond timestamp at which the Node.js event loop - * started. If the event loop has not yet started (e.g., in the first tick of the - * main script), the property has the value of -1. - * @since v8.5.0 - */ - readonly loopStart: number; - /** - * The high resolution millisecond timestamp at which the V8 platform was - * initialized. - * @since v8.5.0 - */ - readonly v8Start: number; - } - interface EventLoopUtilization { - idle: number; - active: number; - utilization: number; - } - /** - * @param util1 The result of a previous call to eventLoopUtilization() - * @param util2 The result of a previous call to eventLoopUtilization() prior to util1 - */ - type EventLoopUtilityFunction = (util1?: EventLoopUtilization, util2?: EventLoopUtilization) => EventLoopUtilization; - interface MarkOptions { - /** - * Additional optional detail to include with the mark. - */ - detail?: unknown | undefined; - /** - * An optional timestamp to be used as the mark time. - * @default `performance.now()`. - */ - startTime?: number | undefined; - } - interface MeasureOptions { - /** - * Additional optional detail to include with the mark. - */ - detail?: unknown | undefined; - /** - * Duration between start and end times. - */ - duration?: number | undefined; - /** - * Timestamp to be used as the end time, or a string identifying a previously recorded mark. - */ - end?: number | string | undefined; - /** - * Timestamp to be used as the start time, or a string identifying a previously recorded mark. - */ - start?: number | string | undefined; - } - interface TimerifyOptions { - /** - * A histogram object created using - * `perf_hooks.createHistogram()` that will record runtime durations in - * nanoseconds. - */ - histogram?: RecordableHistogram | undefined; - } - interface Performance { - /** - * If name is not provided, removes all PerformanceMark objects from the Performance Timeline. - * If name is provided, removes only the named mark. - * @param name - */ - clearMarks(name?: string): void; - /** - * If name is not provided, removes all PerformanceMeasure objects from the Performance Timeline. - * If name is provided, removes only the named measure. - * @param name - * @since v16.7.0 - */ - clearMeasures(name?: string): void; - /** - * Returns a list of `PerformanceEntry` objects in chronological order with respect to `performanceEntry.startTime`. - * If you are only interested in performance entries of certain types or that have certain names, see - * `performance.getEntriesByType()` and `performance.getEntriesByName()`. - * @since v16.7.0 - */ - getEntries(): PerformanceEntry[]; - /** - * Returns a list of `PerformanceEntry` objects in chronological order with respect to `performanceEntry.startTime` - * whose `performanceEntry.name` is equal to `name`, and optionally, whose `performanceEntry.entryType` is equal to `type`. - * @param name - * @param type - * @since v16.7.0 - */ - getEntriesByName(name: string, type?: EntryType): PerformanceEntry[]; - /** - * Returns a list of `PerformanceEntry` objects in chronological order with respect to `performanceEntry.startTime` - * whose `performanceEntry.entryType` is equal to `type`. - * @param type - * @since v16.7.0 - */ - getEntriesByType(type: EntryType): PerformanceEntry[]; - /** - * Creates a new PerformanceMark entry in the Performance Timeline. - * A PerformanceMark is a subclass of PerformanceEntry whose performanceEntry.entryType is always 'mark', - * and whose performanceEntry.duration is always 0. - * Performance marks are used to mark specific significant moments in the Performance Timeline. - * @param name - * @return The PerformanceMark entry that was created - */ - mark(name?: string, options?: MarkOptions): PerformanceMark; - /** - * Creates a new PerformanceMeasure entry in the Performance Timeline. - * A PerformanceMeasure is a subclass of PerformanceEntry whose performanceEntry.entryType is always 'measure', - * and whose performanceEntry.duration measures the number of milliseconds elapsed since startMark and endMark. - * - * The startMark argument may identify any existing PerformanceMark in the the Performance Timeline, or may identify - * any of the timestamp properties provided by the PerformanceNodeTiming class. If the named startMark does not exist, - * then startMark is set to timeOrigin by default. - * - * The endMark argument must identify any existing PerformanceMark in the the Performance Timeline or any of the timestamp - * properties provided by the PerformanceNodeTiming class. If the named endMark does not exist, an error will be thrown. - * @param name - * @param startMark - * @param endMark - * @return The PerformanceMeasure entry that was created - */ - measure(name: string, startMark?: string, endMark?: string): PerformanceMeasure; - measure(name: string, options: MeasureOptions): PerformanceMeasure; - /** - * An instance of the PerformanceNodeTiming class that provides performance metrics for specific Node.js operational milestones. - */ - readonly nodeTiming: PerformanceNodeTiming; - /** - * @return the current high resolution millisecond timestamp - */ - now(): number; - /** - * The timeOrigin specifies the high resolution millisecond timestamp from which all performance metric durations are measured. - */ - readonly timeOrigin: number; - /** - * Wraps a function within a new function that measures the running time of the wrapped function. - * A PerformanceObserver must be subscribed to the 'function' event type in order for the timing details to be accessed. - * @param fn - */ - timerify any>(fn: T, options?: TimerifyOptions): T; - /** - * eventLoopUtilization is similar to CPU utilization except that it is calculated using high precision wall-clock time. - * It represents the percentage of time the event loop has spent outside the event loop's event provider (e.g. epoll_wait). - * No other CPU idle time is taken into consideration. - */ - eventLoopUtilization: EventLoopUtilityFunction; - } - interface PerformanceObserverEntryList { - /** - * Returns a list of `PerformanceEntry` objects in chronological order - * with respect to `performanceEntry.startTime`. - * - * ```js - * const { - * performance, - * PerformanceObserver - * } = require('perf_hooks'); - * - * const obs = new PerformanceObserver((perfObserverList, observer) => { - * console.log(perfObserverList.getEntries()); - * - * * [ - * * PerformanceEntry { - * * name: 'test', - * * entryType: 'mark', - * * startTime: 81.465639, - * * duration: 0 - * * }, - * * PerformanceEntry { - * * name: 'meow', - * * entryType: 'mark', - * * startTime: 81.860064, - * * duration: 0 - * * } - * * ] - * - * - * performance.clearMarks(); - * performance.clearMeasures(); - * observer.disconnect(); - * }); - * obs.observe({ type: 'mark' }); - * - * performance.mark('test'); - * performance.mark('meow'); - * ``` - * @since v8.5.0 - */ - getEntries(): PerformanceEntry[]; - /** - * Returns a list of `PerformanceEntry` objects in chronological order - * with respect to `performanceEntry.startTime` whose `performanceEntry.name` is - * equal to `name`, and optionally, whose `performanceEntry.entryType` is equal to`type`. - * - * ```js - * const { - * performance, - * PerformanceObserver - * } = require('perf_hooks'); - * - * const obs = new PerformanceObserver((perfObserverList, observer) => { - * console.log(perfObserverList.getEntriesByName('meow')); - * - * * [ - * * PerformanceEntry { - * * name: 'meow', - * * entryType: 'mark', - * * startTime: 98.545991, - * * duration: 0 - * * } - * * ] - * - * console.log(perfObserverList.getEntriesByName('nope')); // [] - * - * console.log(perfObserverList.getEntriesByName('test', 'mark')); - * - * * [ - * * PerformanceEntry { - * * name: 'test', - * * entryType: 'mark', - * * startTime: 63.518931, - * * duration: 0 - * * } - * * ] - * - * console.log(perfObserverList.getEntriesByName('test', 'measure')); // [] - * - * performance.clearMarks(); - * performance.clearMeasures(); - * observer.disconnect(); - * }); - * obs.observe({ entryTypes: ['mark', 'measure'] }); - * - * performance.mark('test'); - * performance.mark('meow'); - * ``` - * @since v8.5.0 - */ - getEntriesByName(name: string, type?: EntryType): PerformanceEntry[]; - /** - * Returns a list of `PerformanceEntry` objects in chronological order - * with respect to `performanceEntry.startTime` whose `performanceEntry.entryType`is equal to `type`. - * - * ```js - * const { - * performance, - * PerformanceObserver - * } = require('perf_hooks'); - * - * const obs = new PerformanceObserver((perfObserverList, observer) => { - * console.log(perfObserverList.getEntriesByType('mark')); - * - * * [ - * * PerformanceEntry { - * * name: 'test', - * * entryType: 'mark', - * * startTime: 55.897834, - * * duration: 0 - * * }, - * * PerformanceEntry { - * * name: 'meow', - * * entryType: 'mark', - * * startTime: 56.350146, - * * duration: 0 - * * } - * * ] - * - * performance.clearMarks(); - * performance.clearMeasures(); - * observer.disconnect(); - * }); - * obs.observe({ type: 'mark' }); - * - * performance.mark('test'); - * performance.mark('meow'); - * ``` - * @since v8.5.0 - */ - getEntriesByType(type: EntryType): PerformanceEntry[]; - } - type PerformanceObserverCallback = (list: PerformanceObserverEntryList, observer: PerformanceObserver) => void; - class PerformanceObserver extends AsyncResource { - constructor(callback: PerformanceObserverCallback); - /** - * Disconnects the `PerformanceObserver` instance from all notifications. - * @since v8.5.0 - */ - disconnect(): void; - /** - * Subscribes the `PerformanceObserver` instance to notifications of new `PerformanceEntry` instances identified either by `options.entryTypes`or `options.type`: - * - * ```js - * const { - * performance, - * PerformanceObserver - * } = require('perf_hooks'); - * - * const obs = new PerformanceObserver((list, observer) => { - * // Called once asynchronously. `list` contains three items. - * }); - * obs.observe({ type: 'mark' }); - * - * for (let n = 0; n < 3; n++) - * performance.mark(`test${n}`); - * ``` - * @since v8.5.0 - */ - observe( - options: - | { - entryTypes: ReadonlyArray; - buffered?: boolean | undefined; - } - | { - type: EntryType; - buffered?: boolean | undefined; - } - ): void; - } - namespace constants { - const NODE_PERFORMANCE_GC_MAJOR: number; - const NODE_PERFORMANCE_GC_MINOR: number; - const NODE_PERFORMANCE_GC_INCREMENTAL: number; - const NODE_PERFORMANCE_GC_WEAKCB: number; - const NODE_PERFORMANCE_GC_FLAGS_NO: number; - const NODE_PERFORMANCE_GC_FLAGS_CONSTRUCT_RETAINED: number; - const NODE_PERFORMANCE_GC_FLAGS_FORCED: number; - const NODE_PERFORMANCE_GC_FLAGS_SYNCHRONOUS_PHANTOM_PROCESSING: number; - const NODE_PERFORMANCE_GC_FLAGS_ALL_AVAILABLE_GARBAGE: number; - const NODE_PERFORMANCE_GC_FLAGS_ALL_EXTERNAL_MEMORY: number; - const NODE_PERFORMANCE_GC_FLAGS_SCHEDULE_IDLE: number; - } - const performance: Performance; - interface EventLoopMonitorOptions { - /** - * The sampling rate in milliseconds. - * Must be greater than zero. - * @default 10 - */ - resolution?: number | undefined; - } - interface Histogram { - /** - * Returns a `Map` object detailing the accumulated percentile distribution. - * @since v11.10.0 - */ - readonly percentiles: Map; - /** - * The number of times the event loop delay exceeded the maximum 1 hour event - * loop delay threshold. - * @since v11.10.0 - */ - readonly exceeds: number; - /** - * The minimum recorded event loop delay. - * @since v11.10.0 - */ - readonly min: number; - /** - * The maximum recorded event loop delay. - * @since v11.10.0 - */ - readonly max: number; - /** - * The mean of the recorded event loop delays. - * @since v11.10.0 - */ - readonly mean: number; - /** - * The standard deviation of the recorded event loop delays. - * @since v11.10.0 - */ - readonly stddev: number; - /** - * Resets the collected histogram data. - * @since v11.10.0 - */ - reset(): void; - /** - * Returns the value at the given percentile. - * @since v11.10.0 - * @param percentile A percentile value in the range (0, 100]. - */ - percentile(percentile: number): number; - } - interface IntervalHistogram extends Histogram { - /** - * Enables the update interval timer. Returns `true` if the timer was - * started, `false` if it was already started. - * @since v11.10.0 - */ - enable(): boolean; - /** - * Disables the update interval timer. Returns `true` if the timer was - * stopped, `false` if it was already stopped. - * @since v11.10.0 - */ - disable(): boolean; - } - interface RecordableHistogram extends Histogram { - /** - * @since v15.9.0, v14.18.0 - * @param val The amount to record in the histogram. - */ - record(val: number | bigint): void; - /** - * Calculates the amount of time (in nanoseconds) that has passed since the - * previous call to `recordDelta()` and records that amount in the histogram. - * - * ## Examples - * @since v15.9.0, v14.18.0 - */ - recordDelta(): void; - /** - * Adds the values from other to this histogram. - * @since v17.4.0, v16.14.0 - * @param other Recordable Histogram to combine with - */ - add(other: RecordableHistogram): void; - } - /** - * _This property is an extension by Node.js. It is not available in Web browsers._ - * - * Creates an `IntervalHistogram` object that samples and reports the event loop - * delay over time. The delays will be reported in nanoseconds. - * - * Using a timer to detect approximate event loop delay works because the - * execution of timers is tied specifically to the lifecycle of the libuv - * event loop. That is, a delay in the loop will cause a delay in the execution - * of the timer, and those delays are specifically what this API is intended to - * detect. - * - * ```js - * const { monitorEventLoopDelay } = require('perf_hooks'); - * const h = monitorEventLoopDelay({ resolution: 20 }); - * h.enable(); - * // Do something. - * h.disable(); - * console.log(h.min); - * console.log(h.max); - * console.log(h.mean); - * console.log(h.stddev); - * console.log(h.percentiles); - * console.log(h.percentile(50)); - * console.log(h.percentile(99)); - * ``` - * @since v11.10.0 - */ - function monitorEventLoopDelay(options?: EventLoopMonitorOptions): IntervalHistogram; - interface CreateHistogramOptions { - /** - * The minimum recordable value. Must be an integer value greater than 0. - * @default 1 - */ - min?: number | bigint | undefined; - /** - * The maximum recordable value. Must be an integer value greater than min. - * @default Number.MAX_SAFE_INTEGER - */ - max?: number | bigint | undefined; - /** - * The number of accuracy digits. Must be a number between 1 and 5. - * @default 3 - */ - figures?: number | undefined; - } - /** - * Returns a `RecordableHistogram`. - * @since v15.9.0, v14.18.0 - */ - function createHistogram(options?: CreateHistogramOptions): RecordableHistogram; - - import { performance as _performance } from 'perf_hooks'; - global { - /** - * `performance` is a global reference for `require('perf_hooks').performance` - * https://nodejs.org/api/globals.html#performance - * @since v16.0.0 - */ - var performance: typeof globalThis extends { - onmessage: any; - performance: infer T; - } - ? T - : typeof _performance; - } -} -declare module 'node:perf_hooks' { - export * from 'perf_hooks'; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/process.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/process.d.ts deleted file mode 100755 index 12148f91..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/process.d.ts +++ /dev/null @@ -1,1482 +0,0 @@ -declare module 'process' { - import * as tty from 'node:tty'; - import { Worker } from 'node:worker_threads'; - global { - var process: NodeJS.Process; - namespace NodeJS { - // this namespace merge is here because these are specifically used - // as the type for process.stdin, process.stdout, and process.stderr. - // they can't live in tty.d.ts because we need to disambiguate the imported name. - interface ReadStream extends tty.ReadStream {} - interface WriteStream extends tty.WriteStream {} - interface MemoryUsageFn { - /** - * The `process.memoryUsage()` method iterate over each page to gather informations about memory - * usage which can be slow depending on the program memory allocations. - */ - (): MemoryUsage; - /** - * method returns an integer representing the Resident Set Size (RSS) in bytes. - */ - rss(): number; - } - interface MemoryUsage { - rss: number; - heapTotal: number; - heapUsed: number; - external: number; - arrayBuffers: number; - } - interface CpuUsage { - user: number; - system: number; - } - interface ProcessRelease { - name: string; - sourceUrl?: string | undefined; - headersUrl?: string | undefined; - libUrl?: string | undefined; - lts?: string | undefined; - } - interface ProcessVersions extends Dict { - http_parser: string; - node: string; - v8: string; - ares: string; - uv: string; - zlib: string; - modules: string; - openssl: string; - } - type Platform = 'aix' | 'android' | 'darwin' | 'freebsd' | 'haiku' | 'linux' | 'openbsd' | 'sunos' | 'win32' | 'cygwin' | 'netbsd'; - type Architecture = 'arm' | 'arm64' | 'ia32' | 'mips' | 'mipsel' | 'ppc' | 'ppc64' | 's390' | 's390x' | 'x64'; - type Signals = - | 'SIGABRT' - | 'SIGALRM' - | 'SIGBUS' - | 'SIGCHLD' - | 'SIGCONT' - | 'SIGFPE' - | 'SIGHUP' - | 'SIGILL' - | 'SIGINT' - | 'SIGIO' - | 'SIGIOT' - | 'SIGKILL' - | 'SIGPIPE' - | 'SIGPOLL' - | 'SIGPROF' - | 'SIGPWR' - | 'SIGQUIT' - | 'SIGSEGV' - | 'SIGSTKFLT' - | 'SIGSTOP' - | 'SIGSYS' - | 'SIGTERM' - | 'SIGTRAP' - | 'SIGTSTP' - | 'SIGTTIN' - | 'SIGTTOU' - | 'SIGUNUSED' - | 'SIGURG' - | 'SIGUSR1' - | 'SIGUSR2' - | 'SIGVTALRM' - | 'SIGWINCH' - | 'SIGXCPU' - | 'SIGXFSZ' - | 'SIGBREAK' - | 'SIGLOST' - | 'SIGINFO'; - type UncaughtExceptionOrigin = 'uncaughtException' | 'unhandledRejection'; - type MultipleResolveType = 'resolve' | 'reject'; - type BeforeExitListener = (code: number) => void; - type DisconnectListener = () => void; - type ExitListener = (code: number) => void; - type RejectionHandledListener = (promise: Promise) => void; - type UncaughtExceptionListener = (error: Error, origin: UncaughtExceptionOrigin) => void; - /** - * Most of the time the unhandledRejection will be an Error, but this should not be relied upon - * as *anything* can be thrown/rejected, it is therefore unsafe to assume that the value is an Error. - */ - type UnhandledRejectionListener = (reason: unknown, promise: Promise) => void; - type WarningListener = (warning: Error) => void; - type MessageListener = (message: unknown, sendHandle: unknown) => void; - type SignalsListener = (signal: Signals) => void; - type MultipleResolveListener = (type: MultipleResolveType, promise: Promise, value: unknown) => void; - type WorkerListener = (worker: Worker) => void; - interface Socket extends ReadWriteStream { - isTTY?: true | undefined; - } - // Alias for compatibility - interface ProcessEnv extends Dict { - /** - * Can be used to change the default timezone at runtime - */ - TZ?: string; - } - interface HRTime { - (time?: [number, number]): [number, number]; - bigint(): bigint; - } - interface ProcessReport { - /** - * Directory where the report is written. - * working directory of the Node.js process. - * @default '' indicating that reports are written to the current - */ - directory: string; - /** - * Filename where the report is written. - * The default value is the empty string. - * @default '' the output filename will be comprised of a timestamp, - * PID, and sequence number. - */ - filename: string; - /** - * Returns a JSON-formatted diagnostic report for the running process. - * The report's JavaScript stack trace is taken from err, if present. - */ - getReport(err?: Error): string; - /** - * If true, a diagnostic report is generated on fatal errors, - * such as out of memory errors or failed C++ assertions. - * @default false - */ - reportOnFatalError: boolean; - /** - * If true, a diagnostic report is generated when the process - * receives the signal specified by process.report.signal. - * @default false - */ - reportOnSignal: boolean; - /** - * If true, a diagnostic report is generated on uncaught exception. - * @default false - */ - reportOnUncaughtException: boolean; - /** - * The signal used to trigger the creation of a diagnostic report. - * @default 'SIGUSR2' - */ - signal: Signals; - /** - * Writes a diagnostic report to a file. If filename is not provided, the default filename - * includes the date, time, PID, and a sequence number. - * The report's JavaScript stack trace is taken from err, if present. - * - * @param fileName Name of the file where the report is written. - * This should be a relative path, that will be appended to the directory specified in - * `process.report.directory`, or the current working directory of the Node.js process, - * if unspecified. - * @param error A custom error used for reporting the JavaScript stack. - * @return Filename of the generated report. - */ - writeReport(fileName?: string): string; - writeReport(error?: Error): string; - writeReport(fileName?: string, err?: Error): string; - } - interface ResourceUsage { - fsRead: number; - fsWrite: number; - involuntaryContextSwitches: number; - ipcReceived: number; - ipcSent: number; - majorPageFault: number; - maxRSS: number; - minorPageFault: number; - sharedMemorySize: number; - signalsCount: number; - swappedOut: number; - systemCPUTime: number; - unsharedDataSize: number; - unsharedStackSize: number; - userCPUTime: number; - voluntaryContextSwitches: number; - } - interface EmitWarningOptions { - /** - * When `warning` is a `string`, `type` is the name to use for the _type_ of warning being emitted. - * - * @default 'Warning' - */ - type?: string | undefined; - /** - * A unique identifier for the warning instance being emitted. - */ - code?: string | undefined; - /** - * When `warning` is a `string`, `ctor` is an optional function used to limit the generated stack trace. - * - * @default process.emitWarning - */ - ctor?: Function | undefined; - /** - * Additional text to include with the error. - */ - detail?: string | undefined; - } - interface ProcessConfig { - readonly target_defaults: { - readonly cflags: any[]; - readonly default_configuration: string; - readonly defines: string[]; - readonly include_dirs: string[]; - readonly libraries: string[]; - }; - readonly variables: { - readonly clang: number; - readonly host_arch: string; - readonly node_install_npm: boolean; - readonly node_install_waf: boolean; - readonly node_prefix: string; - readonly node_shared_openssl: boolean; - readonly node_shared_v8: boolean; - readonly node_shared_zlib: boolean; - readonly node_use_dtrace: boolean; - readonly node_use_etw: boolean; - readonly node_use_openssl: boolean; - readonly target_arch: string; - readonly v8_no_strict_aliasing: number; - readonly v8_use_snapshot: boolean; - readonly visibility: string; - }; - } - interface Process extends EventEmitter { - /** - * The `process.stdout` property returns a stream connected to`stdout` (fd `1`). It is a `net.Socket` (which is a `Duplex` stream) unless fd `1` refers to a file, in which case it is - * a `Writable` stream. - * - * For example, to copy `process.stdin` to `process.stdout`: - * - * ```js - * import { stdin, stdout } from 'process'; - * - * stdin.pipe(stdout); - * ``` - * - * `process.stdout` differs from other Node.js streams in important ways. See `note on process I/O` for more information. - */ - stdout: WriteStream & { - fd: 1; - }; - /** - * The `process.stderr` property returns a stream connected to`stderr` (fd `2`). It is a `net.Socket` (which is a `Duplex` stream) unless fd `2` refers to a file, in which case it is - * a `Writable` stream. - * - * `process.stderr` differs from other Node.js streams in important ways. See `note on process I/O` for more information. - */ - stderr: WriteStream & { - fd: 2; - }; - /** - * The `process.stdin` property returns a stream connected to`stdin` (fd `0`). It is a `net.Socket` (which is a `Duplex` stream) unless fd `0` refers to a file, in which case it is - * a `Readable` stream. - * - * For details of how to read from `stdin` see `readable.read()`. - * - * As a `Duplex` stream, `process.stdin` can also be used in "old" mode that - * is compatible with scripts written for Node.js prior to v0.10\. - * For more information see `Stream compatibility`. - * - * In "old" streams mode the `stdin` stream is paused by default, so one - * must call `process.stdin.resume()` to read from it. Note also that calling`process.stdin.resume()` itself would switch stream to "old" mode. - */ - stdin: ReadStream & { - fd: 0; - }; - openStdin(): Socket; - /** - * The `process.argv` property returns an array containing the command-line - * arguments passed when the Node.js process was launched. The first element will - * be {@link execPath}. See `process.argv0` if access to the original value - * of `argv[0]` is needed. The second element will be the path to the JavaScript - * file being executed. The remaining elements will be any additional command-line - * arguments. - * - * For example, assuming the following script for `process-args.js`: - * - * ```js - * import { argv } from 'process'; - * - * // print process.argv - * argv.forEach((val, index) => { - * console.log(`${index}: ${val}`); - * }); - * ``` - * - * Launching the Node.js process as: - * - * ```console - * $ node process-args.js one two=three four - * ``` - * - * Would generate the output: - * - * ```text - * 0: /usr/local/bin/node - * 1: /Users/mjr/work/node/process-args.js - * 2: one - * 3: two=three - * 4: four - * ``` - * @since v0.1.27 - */ - argv: string[]; - /** - * The `process.argv0` property stores a read-only copy of the original value of`argv[0]` passed when Node.js starts. - * - * ```console - * $ bash -c 'exec -a customArgv0 ./node' - * > process.argv[0] - * '/Volumes/code/external/node/out/Release/node' - * > process.argv0 - * 'customArgv0' - * ``` - * @since v6.4.0 - */ - argv0: string; - /** - * The `process.execArgv` property returns the set of Node.js-specific command-line - * options passed when the Node.js process was launched. These options do not - * appear in the array returned by the {@link argv} property, and do not - * include the Node.js executable, the name of the script, or any options following - * the script name. These options are useful in order to spawn child processes with - * the same execution environment as the parent. - * - * ```console - * $ node --harmony script.js --version - * ``` - * - * Results in `process.execArgv`: - * - * ```js - * ['--harmony'] - * ``` - * - * And `process.argv`: - * - * ```js - * ['/usr/local/bin/node', 'script.js', '--version'] - * ``` - * - * Refer to `Worker constructor` for the detailed behavior of worker - * threads with this property. - * @since v0.7.7 - */ - execArgv: string[]; - /** - * The `process.execPath` property returns the absolute pathname of the executable - * that started the Node.js process. Symbolic links, if any, are resolved. - * - * ```js - * '/usr/local/bin/node' - * ``` - * @since v0.1.100 - */ - execPath: string; - /** - * The `process.abort()` method causes the Node.js process to exit immediately and - * generate a core file. - * - * This feature is not available in `Worker` threads. - * @since v0.7.0 - */ - abort(): never; - /** - * The `process.chdir()` method changes the current working directory of the - * Node.js process or throws an exception if doing so fails (for instance, if - * the specified `directory` does not exist). - * - * ```js - * import { chdir, cwd } from 'process'; - * - * console.log(`Starting directory: ${cwd()}`); - * try { - * chdir('/tmp'); - * console.log(`New directory: ${cwd()}`); - * } catch (err) { - * console.error(`chdir: ${err}`); - * } - * ``` - * - * This feature is not available in `Worker` threads. - * @since v0.1.17 - */ - chdir(directory: string): void; - /** - * The `process.cwd()` method returns the current working directory of the Node.js - * process. - * - * ```js - * import { cwd } from 'process'; - * - * console.log(`Current directory: ${cwd()}`); - * ``` - * @since v0.1.8 - */ - cwd(): string; - /** - * The port used by the Node.js debugger when enabled. - * - * ```js - * import process from 'process'; - * - * process.debugPort = 5858; - * ``` - * @since v0.7.2 - */ - debugPort: number; - /** - * The `process.emitWarning()` method can be used to emit custom or application - * specific process warnings. These can be listened for by adding a handler to the `'warning'` event. - * - * ```js - * import { emitWarning } from 'process'; - * - * // Emit a warning with a code and additional detail. - * emitWarning('Something happened!', { - * code: 'MY_WARNING', - * detail: 'This is some additional information' - * }); - * // Emits: - * // (node:56338) [MY_WARNING] Warning: Something happened! - * // This is some additional information - * ``` - * - * In this example, an `Error` object is generated internally by`process.emitWarning()` and passed through to the `'warning'` handler. - * - * ```js - * import process from 'process'; - * - * process.on('warning', (warning) => { - * console.warn(warning.name); // 'Warning' - * console.warn(warning.message); // 'Something happened!' - * console.warn(warning.code); // 'MY_WARNING' - * console.warn(warning.stack); // Stack trace - * console.warn(warning.detail); // 'This is some additional information' - * }); - * ``` - * - * If `warning` is passed as an `Error` object, the `options` argument is ignored. - * @since v8.0.0 - * @param warning The warning to emit. - */ - emitWarning(warning: string | Error, ctor?: Function): void; - emitWarning(warning: string | Error, type?: string, ctor?: Function): void; - emitWarning(warning: string | Error, type?: string, code?: string, ctor?: Function): void; - emitWarning(warning: string | Error, options?: EmitWarningOptions): void; - /** - * The `process.env` property returns an object containing the user environment. - * See [`environ(7)`](http://man7.org/linux/man-pages/man7/environ.7.html). - * - * An example of this object looks like: - * - * ```js - * { - * TERM: 'xterm-256color', - * SHELL: '/usr/local/bin/bash', - * USER: 'maciej', - * PATH: '~/.bin/:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin', - * PWD: '/Users/maciej', - * EDITOR: 'vim', - * SHLVL: '1', - * HOME: '/Users/maciej', - * LOGNAME: 'maciej', - * _: '/usr/local/bin/node' - * } - * ``` - * - * It is possible to modify this object, but such modifications will not be - * reflected outside the Node.js process, or (unless explicitly requested) - * to other `Worker` threads. - * In other words, the following example would not work: - * - * ```console - * $ node -e 'process.env.foo = "bar"' && echo $foo - * ``` - * - * While the following will: - * - * ```js - * import { env } from 'process'; - * - * env.foo = 'bar'; - * console.log(env.foo); - * ``` - * - * Assigning a property on `process.env` will implicitly convert the value - * to a string. **This behavior is deprecated.** Future versions of Node.js may - * throw an error when the value is not a string, number, or boolean. - * - * ```js - * import { env } from 'process'; - * - * env.test = null; - * console.log(env.test); - * // => 'null' - * env.test = undefined; - * console.log(env.test); - * // => 'undefined' - * ``` - * - * Use `delete` to delete a property from `process.env`. - * - * ```js - * import { env } from 'process'; - * - * env.TEST = 1; - * delete env.TEST; - * console.log(env.TEST); - * // => undefined - * ``` - * - * On Windows operating systems, environment variables are case-insensitive. - * - * ```js - * import { env } from 'process'; - * - * env.TEST = 1; - * console.log(env.test); - * // => 1 - * ``` - * - * Unless explicitly specified when creating a `Worker` instance, - * each `Worker` thread has its own copy of `process.env`, based on its - * parent thread’s `process.env`, or whatever was specified as the `env` option - * to the `Worker` constructor. Changes to `process.env` will not be visible - * across `Worker` threads, and only the main thread can make changes that - * are visible to the operating system or to native add-ons. - * @since v0.1.27 - */ - env: ProcessEnv; - /** - * The `process.exit()` method instructs Node.js to terminate the process - * synchronously with an exit status of `code`. If `code` is omitted, exit uses - * either the 'success' code `0` or the value of `process.exitCode` if it has been - * set. Node.js will not terminate until all the `'exit'` event listeners are - * called. - * - * To exit with a 'failure' code: - * - * ```js - * import { exit } from 'process'; - * - * exit(1); - * ``` - * - * The shell that executed Node.js should see the exit code as `1`. - * - * Calling `process.exit()` will force the process to exit as quickly as possible - * even if there are still asynchronous operations pending that have not yet - * completed fully, including I/O operations to `process.stdout` and`process.stderr`. - * - * In most situations, it is not actually necessary to call `process.exit()`explicitly. The Node.js process will exit on its own _if there is no additional_ - * _work pending_ in the event loop. The `process.exitCode` property can be set to - * tell the process which exit code to use when the process exits gracefully. - * - * For instance, the following example illustrates a _misuse_ of the`process.exit()` method that could lead to data printed to stdout being - * truncated and lost: - * - * ```js - * import { exit } from 'process'; - * - * // This is an example of what *not* to do: - * if (someConditionNotMet()) { - * printUsageToStdout(); - * exit(1); - * } - * ``` - * - * The reason this is problematic is because writes to `process.stdout` in Node.js - * are sometimes _asynchronous_ and may occur over multiple ticks of the Node.js - * event loop. Calling `process.exit()`, however, forces the process to exit _before_ those additional writes to `stdout` can be performed. - * - * Rather than calling `process.exit()` directly, the code _should_ set the`process.exitCode` and allow the process to exit naturally by avoiding - * scheduling any additional work for the event loop: - * - * ```js - * import process from 'process'; - * - * // How to properly set the exit code while letting - * // the process exit gracefully. - * if (someConditionNotMet()) { - * printUsageToStdout(); - * process.exitCode = 1; - * } - * ``` - * - * If it is necessary to terminate the Node.js process due to an error condition, - * throwing an _uncaught_ error and allowing the process to terminate accordingly - * is safer than calling `process.exit()`. - * - * In `Worker` threads, this function stops the current thread rather - * than the current process. - * @since v0.1.13 - * @param [code=0] The exit code. - */ - exit(code?: number): never; - /** - * A number which will be the process exit code, when the process either - * exits gracefully, or is exited via {@link exit} without specifying - * a code. - * - * Specifying a code to {@link exit} will override any - * previous setting of `process.exitCode`. - * @since v0.11.8 - */ - exitCode?: number | undefined; - /** - * The `process.getgid()` method returns the numerical group identity of the - * process. (See [`getgid(2)`](http://man7.org/linux/man-pages/man2/getgid.2.html).) - * - * ```js - * import process from 'process'; - * - * if (process.getgid) { - * console.log(`Current gid: ${process.getgid()}`); - * } - * ``` - * - * This function is only available on POSIX platforms (i.e. not Windows or - * Android). - * @since v0.1.31 - */ - getgid?: () => number; - /** - * The `process.setgid()` method sets the group identity of the process. (See [`setgid(2)`](http://man7.org/linux/man-pages/man2/setgid.2.html).) The `id` can be passed as either a - * numeric ID or a group name - * string. If a group name is specified, this method blocks while resolving the - * associated numeric ID. - * - * ```js - * import process from 'process'; - * - * if (process.getgid && process.setgid) { - * console.log(`Current gid: ${process.getgid()}`); - * try { - * process.setgid(501); - * console.log(`New gid: ${process.getgid()}`); - * } catch (err) { - * console.log(`Failed to set gid: ${err}`); - * } - * } - * ``` - * - * This function is only available on POSIX platforms (i.e. not Windows or - * Android). - * This feature is not available in `Worker` threads. - * @since v0.1.31 - * @param id The group name or ID - */ - setgid?: (id: number | string) => void; - /** - * The `process.getuid()` method returns the numeric user identity of the process. - * (See [`getuid(2)`](http://man7.org/linux/man-pages/man2/getuid.2.html).) - * - * ```js - * import process from 'process'; - * - * if (process.getuid) { - * console.log(`Current uid: ${process.getuid()}`); - * } - * ``` - * - * This function is only available on POSIX platforms (i.e. not Windows or - * Android). - * @since v0.1.28 - */ - getuid?: () => number; - /** - * The `process.setuid(id)` method sets the user identity of the process. (See [`setuid(2)`](http://man7.org/linux/man-pages/man2/setuid.2.html).) The `id` can be passed as either a - * numeric ID or a username string. - * If a username is specified, the method blocks while resolving the associated - * numeric ID. - * - * ```js - * import process from 'process'; - * - * if (process.getuid && process.setuid) { - * console.log(`Current uid: ${process.getuid()}`); - * try { - * process.setuid(501); - * console.log(`New uid: ${process.getuid()}`); - * } catch (err) { - * console.log(`Failed to set uid: ${err}`); - * } - * } - * ``` - * - * This function is only available on POSIX platforms (i.e. not Windows or - * Android). - * This feature is not available in `Worker` threads. - * @since v0.1.28 - */ - setuid?: (id: number | string) => void; - /** - * The `process.geteuid()` method returns the numerical effective user identity of - * the process. (See [`geteuid(2)`](http://man7.org/linux/man-pages/man2/geteuid.2.html).) - * - * ```js - * import process from 'process'; - * - * if (process.geteuid) { - * console.log(`Current uid: ${process.geteuid()}`); - * } - * ``` - * - * This function is only available on POSIX platforms (i.e. not Windows or - * Android). - * @since v2.0.0 - */ - geteuid?: () => number; - /** - * The `process.seteuid()` method sets the effective user identity of the process. - * (See [`seteuid(2)`](http://man7.org/linux/man-pages/man2/seteuid.2.html).) The `id` can be passed as either a numeric ID or a username - * string. If a username is specified, the method blocks while resolving the - * associated numeric ID. - * - * ```js - * import process from 'process'; - * - * if (process.geteuid && process.seteuid) { - * console.log(`Current uid: ${process.geteuid()}`); - * try { - * process.seteuid(501); - * console.log(`New uid: ${process.geteuid()}`); - * } catch (err) { - * console.log(`Failed to set uid: ${err}`); - * } - * } - * ``` - * - * This function is only available on POSIX platforms (i.e. not Windows or - * Android). - * This feature is not available in `Worker` threads. - * @since v2.0.0 - * @param id A user name or ID - */ - seteuid?: (id: number | string) => void; - /** - * The `process.getegid()` method returns the numerical effective group identity - * of the Node.js process. (See [`getegid(2)`](http://man7.org/linux/man-pages/man2/getegid.2.html).) - * - * ```js - * import process from 'process'; - * - * if (process.getegid) { - * console.log(`Current gid: ${process.getegid()}`); - * } - * ``` - * - * This function is only available on POSIX platforms (i.e. not Windows or - * Android). - * @since v2.0.0 - */ - getegid?: () => number; - /** - * The `process.setegid()` method sets the effective group identity of the process. - * (See [`setegid(2)`](http://man7.org/linux/man-pages/man2/setegid.2.html).) The `id` can be passed as either a numeric ID or a group - * name string. If a group name is specified, this method blocks while resolving - * the associated a numeric ID. - * - * ```js - * import process from 'process'; - * - * if (process.getegid && process.setegid) { - * console.log(`Current gid: ${process.getegid()}`); - * try { - * process.setegid(501); - * console.log(`New gid: ${process.getegid()}`); - * } catch (err) { - * console.log(`Failed to set gid: ${err}`); - * } - * } - * ``` - * - * This function is only available on POSIX platforms (i.e. not Windows or - * Android). - * This feature is not available in `Worker` threads. - * @since v2.0.0 - * @param id A group name or ID - */ - setegid?: (id: number | string) => void; - /** - * The `process.getgroups()` method returns an array with the supplementary group - * IDs. POSIX leaves it unspecified if the effective group ID is included but - * Node.js ensures it always is. - * - * ```js - * import process from 'process'; - * - * if (process.getgroups) { - * console.log(process.getgroups()); // [ 16, 21, 297 ] - * } - * ``` - * - * This function is only available on POSIX platforms (i.e. not Windows or - * Android). - * @since v0.9.4 - */ - getgroups?: () => number[]; - /** - * The `process.setgroups()` method sets the supplementary group IDs for the - * Node.js process. This is a privileged operation that requires the Node.js - * process to have `root` or the `CAP_SETGID` capability. - * - * The `groups` array can contain numeric group IDs, group names, or both. - * - * ```js - * import process from 'process'; - * - * if (process.getgroups && process.setgroups) { - * try { - * process.setgroups([501]); - * console.log(process.getgroups()); // new groups - * } catch (err) { - * console.log(`Failed to set groups: ${err}`); - * } - * } - * ``` - * - * This function is only available on POSIX platforms (i.e. not Windows or - * Android). - * This feature is not available in `Worker` threads. - * @since v0.9.4 - */ - setgroups?: (groups: ReadonlyArray) => void; - /** - * The `process.setUncaughtExceptionCaptureCallback()` function sets a function - * that will be invoked when an uncaught exception occurs, which will receive the - * exception value itself as its first argument. - * - * If such a function is set, the `'uncaughtException'` event will - * not be emitted. If `--abort-on-uncaught-exception` was passed from the - * command line or set through `v8.setFlagsFromString()`, the process will - * not abort. Actions configured to take place on exceptions such as report - * generations will be affected too - * - * To unset the capture function,`process.setUncaughtExceptionCaptureCallback(null)` may be used. Calling this - * method with a non-`null` argument while another capture function is set will - * throw an error. - * - * Using this function is mutually exclusive with using the deprecated `domain` built-in module. - * @since v9.3.0 - */ - setUncaughtExceptionCaptureCallback(cb: ((err: Error) => void) | null): void; - /** - * Indicates whether a callback has been set using {@link setUncaughtExceptionCaptureCallback}. - * @since v9.3.0 - */ - hasUncaughtExceptionCaptureCallback(): boolean; - /** - * The `process.version` property contains the Node.js version string. - * - * ```js - * import { version } from 'process'; - * - * console.log(`Version: ${version}`); - * // Version: v14.8.0 - * ``` - * - * To get the version string without the prepended _v_, use`process.versions.node`. - * @since v0.1.3 - */ - readonly version: string; - /** - * The `process.versions` property returns an object listing the version strings of - * Node.js and its dependencies. `process.versions.modules` indicates the current - * ABI version, which is increased whenever a C++ API changes. Node.js will refuse - * to load modules that were compiled against a different module ABI version. - * - * ```js - * import { versions } from 'process'; - * - * console.log(versions); - * ``` - * - * Will generate an object similar to: - * - * ```console - * { node: '11.13.0', - * v8: '7.0.276.38-node.18', - * uv: '1.27.0', - * zlib: '1.2.11', - * brotli: '1.0.7', - * ares: '1.15.0', - * modules: '67', - * nghttp2: '1.34.0', - * napi: '4', - * llhttp: '1.1.1', - * openssl: '1.1.1b', - * cldr: '34.0', - * icu: '63.1', - * tz: '2018e', - * unicode: '11.0' } - * ``` - * @since v0.2.0 - */ - readonly versions: ProcessVersions; - /** - * The `process.config` property returns an `Object` containing the JavaScript - * representation of the configure options used to compile the current Node.js - * executable. This is the same as the `config.gypi` file that was produced when - * running the `./configure` script. - * - * An example of the possible output looks like: - * - * ```js - * { - * target_defaults: - * { cflags: [], - * default_configuration: 'Release', - * defines: [], - * include_dirs: [], - * libraries: [] }, - * variables: - * { - * host_arch: 'x64', - * napi_build_version: 5, - * node_install_npm: 'true', - * node_prefix: '', - * node_shared_cares: 'false', - * node_shared_http_parser: 'false', - * node_shared_libuv: 'false', - * node_shared_zlib: 'false', - * node_use_dtrace: 'false', - * node_use_openssl: 'true', - * node_shared_openssl: 'false', - * strict_aliasing: 'true', - * target_arch: 'x64', - * v8_use_snapshot: 1 - * } - * } - * ``` - * - * The `process.config` property is **not** read-only and there are existing - * modules in the ecosystem that are known to extend, modify, or entirely replace - * the value of `process.config`. - * - * Modifying the `process.config` property, or any child-property of the`process.config` object has been deprecated. The `process.config` will be made - * read-only in a future release. - * @since v0.7.7 - */ - readonly config: ProcessConfig; - /** - * The `process.kill()` method sends the `signal` to the process identified by`pid`. - * - * Signal names are strings such as `'SIGINT'` or `'SIGHUP'`. See `Signal Events` and [`kill(2)`](http://man7.org/linux/man-pages/man2/kill.2.html) for more information. - * - * This method will throw an error if the target `pid` does not exist. As a special - * case, a signal of `0` can be used to test for the existence of a process. - * Windows platforms will throw an error if the `pid` is used to kill a process - * group. - * - * Even though the name of this function is `process.kill()`, it is really just a - * signal sender, like the `kill` system call. The signal sent may do something - * other than kill the target process. - * - * ```js - * import process, { kill } from 'process'; - * - * process.on('SIGHUP', () => { - * console.log('Got SIGHUP signal.'); - * }); - * - * setTimeout(() => { - * console.log('Exiting.'); - * process.exit(0); - * }, 100); - * - * kill(process.pid, 'SIGHUP'); - * ``` - * - * When `SIGUSR1` is received by a Node.js process, Node.js will start the - * debugger. See `Signal Events`. - * @since v0.0.6 - * @param pid A process ID - * @param [signal='SIGTERM'] The signal to send, either as a string or number. - */ - kill(pid: number, signal?: string | number): true; - /** - * The `process.pid` property returns the PID of the process. - * - * ```js - * import { pid } from 'process'; - * - * console.log(`This process is pid ${pid}`); - * ``` - * @since v0.1.15 - */ - readonly pid: number; - /** - * The `process.ppid` property returns the PID of the parent of the - * current process. - * - * ```js - * import { ppid } from 'process'; - * - * console.log(`The parent process is pid ${ppid}`); - * ``` - * @since v9.2.0, v8.10.0, v6.13.0 - */ - readonly ppid: number; - /** - * The `process.title` property returns the current process title (i.e. returns - * the current value of `ps`). Assigning a new value to `process.title` modifies - * the current value of `ps`. - * - * When a new value is assigned, different platforms will impose different maximum - * length restrictions on the title. Usually such restrictions are quite limited. - * For instance, on Linux and macOS, `process.title` is limited to the size of the - * binary name plus the length of the command-line arguments because setting the`process.title` overwrites the `argv` memory of the process. Node.js v0.8 - * allowed for longer process title strings by also overwriting the `environ`memory but that was potentially insecure and confusing in some (rather obscure) - * cases. - * - * Assigning a value to `process.title` might not result in an accurate label - * within process manager applications such as macOS Activity Monitor or Windows - * Services Manager. - * @since v0.1.104 - */ - title: string; - /** - * The operating system CPU architecture for which the Node.js binary was compiled. - * Possible values are: `'arm'`, `'arm64'`, `'ia32'`, `'mips'`,`'mipsel'`, `'ppc'`,`'ppc64'`, `'s390'`, `'s390x'`, and `'x64'`. - * - * ```js - * import { arch } from 'process'; - * - * console.log(`This processor architecture is ${arch}`); - * ``` - * @since v0.5.0 - */ - readonly arch: Architecture; - /** - * The `process.platform` property returns a string identifying the operating - * system platform for which the Node.js binary was compiled. - * - * Currently possible values are: - * - * * `'aix'` - * * `'darwin'` - * * `'freebsd'` - * * `'linux'` - * * `'openbsd'` - * * `'sunos'` - * * `'win32'` - * - * ```js - * import { platform } from 'process'; - * - * console.log(`This platform is ${platform}`); - * ``` - * - * The value `'android'` may also be returned if the Node.js is built on the - * Android operating system. However, Android support in Node.js [is experimental](https://github.com/nodejs/node/blob/HEAD/BUILDING.md#androidandroid-based-devices-eg-firefox-os). - * @since v0.1.16 - */ - readonly platform: Platform; - /** - * The `process.mainModule` property provides an alternative way of retrieving `require.main`. The difference is that if the main module changes at - * runtime, `require.main` may still refer to the original main module in - * modules that were required before the change occurred. Generally, it's - * safe to assume that the two refer to the same module. - * - * As with `require.main`, `process.mainModule` will be `undefined` if there - * is no entry script. - * @since v0.1.17 - * @deprecated Since v14.0.0 - Use `main` instead. - */ - mainModule?: Module | undefined; - memoryUsage: MemoryUsageFn; - /** - * The `process.cpuUsage()` method returns the user and system CPU time usage of - * the current process, in an object with properties `user` and `system`, whose - * values are microsecond values (millionth of a second). These values measure time - * spent in user and system code respectively, and may end up being greater than - * actual elapsed time if multiple CPU cores are performing work for this process. - * - * The result of a previous call to `process.cpuUsage()` can be passed as the - * argument to the function, to get a diff reading. - * - * ```js - * import { cpuUsage } from 'process'; - * - * const startUsage = cpuUsage(); - * // { user: 38579, system: 6986 } - * - * // spin the CPU for 500 milliseconds - * const now = Date.now(); - * while (Date.now() - now < 500); - * - * console.log(cpuUsage(startUsage)); - * // { user: 514883, system: 11226 } - * ``` - * @since v6.1.0 - * @param previousValue A previous return value from calling `process.cpuUsage()` - */ - cpuUsage(previousValue?: CpuUsage): CpuUsage; - /** - * `process.nextTick()` adds `callback` to the "next tick queue". This queue is - * fully drained after the current operation on the JavaScript stack runs to - * completion and before the event loop is allowed to continue. It's possible to - * create an infinite loop if one were to recursively call `process.nextTick()`. - * See the [Event Loop](https://nodejs.org/en/docs/guides/event-loop-timers-and-nexttick/#process-nexttick) guide for more background. - * - * ```js - * import { nextTick } from 'process'; - * - * console.log('start'); - * nextTick(() => { - * console.log('nextTick callback'); - * }); - * console.log('scheduled'); - * // Output: - * // start - * // scheduled - * // nextTick callback - * ``` - * - * This is important when developing APIs in order to give users the opportunity - * to assign event handlers _after_ an object has been constructed but before any - * I/O has occurred: - * - * ```js - * import { nextTick } from 'process'; - * - * function MyThing(options) { - * this.setupOptions(options); - * - * nextTick(() => { - * this.startDoingStuff(); - * }); - * } - * - * const thing = new MyThing(); - * thing.getReadyForStuff(); - * - * // thing.startDoingStuff() gets called now, not before. - * ``` - * - * It is very important for APIs to be either 100% synchronous or 100% - * asynchronous. Consider this example: - * - * ```js - * // WARNING! DO NOT USE! BAD UNSAFE HAZARD! - * function maybeSync(arg, cb) { - * if (arg) { - * cb(); - * return; - * } - * - * fs.stat('file', cb); - * } - * ``` - * - * This API is hazardous because in the following case: - * - * ```js - * const maybeTrue = Math.random() > 0.5; - * - * maybeSync(maybeTrue, () => { - * foo(); - * }); - * - * bar(); - * ``` - * - * It is not clear whether `foo()` or `bar()` will be called first. - * - * The following approach is much better: - * - * ```js - * import { nextTick } from 'process'; - * - * function definitelyAsync(arg, cb) { - * if (arg) { - * nextTick(cb); - * return; - * } - * - * fs.stat('file', cb); - * } - * ``` - * @since v0.1.26 - * @param args Additional arguments to pass when invoking the `callback` - */ - nextTick(callback: Function, ...args: any[]): void; - /** - * The `process.release` property returns an `Object` containing metadata related - * to the current release, including URLs for the source tarball and headers-only - * tarball. - * - * `process.release` contains the following properties: - * - * ```js - * { - * name: 'node', - * lts: 'Erbium', - * sourceUrl: 'https://nodejs.org/download/release/v12.18.1/node-v12.18.1.tar.gz', - * headersUrl: 'https://nodejs.org/download/release/v12.18.1/node-v12.18.1-headers.tar.gz', - * libUrl: 'https://nodejs.org/download/release/v12.18.1/win-x64/node.lib' - * } - * ``` - * - * In custom builds from non-release versions of the source tree, only the`name` property may be present. The additional properties should not be - * relied upon to exist. - * @since v3.0.0 - */ - readonly release: ProcessRelease; - features: { - inspector: boolean; - debug: boolean; - uv: boolean; - ipv6: boolean; - tls_alpn: boolean; - tls_sni: boolean; - tls_ocsp: boolean; - tls: boolean; - }; - /** - * `process.umask()` returns the Node.js process's file mode creation mask. Child - * processes inherit the mask from the parent process. - * @since v0.1.19 - * @deprecated Calling `process.umask()` with no argument causes the process-wide umask to be written twice. This introduces a race condition between threads, and is a potential * - * security vulnerability. There is no safe, cross-platform alternative API. - */ - umask(): number; - /** - * Can only be set if not in worker thread. - */ - umask(mask: string | number): number; - /** - * The `process.uptime()` method returns the number of seconds the current Node.js - * process has been running. - * - * The return value includes fractions of a second. Use `Math.floor()` to get whole - * seconds. - * @since v0.5.0 - */ - uptime(): number; - hrtime: HRTime; - /** - * If Node.js is spawned with an IPC channel, the `process.send()` method can be - * used to send messages to the parent process. Messages will be received as a `'message'` event on the parent's `ChildProcess` object. - * - * If Node.js was not spawned with an IPC channel, `process.send` will be`undefined`. - * - * The message goes through serialization and parsing. The resulting message might - * not be the same as what is originally sent. - * @since v0.5.9 - * @param options used to parameterize the sending of certain types of handles.`options` supports the following properties: - */ - send?( - message: any, - sendHandle?: any, - options?: { - swallowErrors?: boolean | undefined; - }, - callback?: (error: Error | null) => void - ): boolean; - /** - * If the Node.js process is spawned with an IPC channel (see the `Child Process` and `Cluster` documentation), the `process.disconnect()` method will close the - * IPC channel to the parent process, allowing the child process to exit gracefully - * once there are no other connections keeping it alive. - * - * The effect of calling `process.disconnect()` is the same as calling `ChildProcess.disconnect()` from the parent process. - * - * If the Node.js process was not spawned with an IPC channel,`process.disconnect()` will be `undefined`. - * @since v0.7.2 - */ - disconnect(): void; - /** - * If the Node.js process is spawned with an IPC channel (see the `Child Process` and `Cluster` documentation), the `process.connected` property will return`true` so long as the IPC - * channel is connected and will return `false` after`process.disconnect()` is called. - * - * Once `process.connected` is `false`, it is no longer possible to send messages - * over the IPC channel using `process.send()`. - * @since v0.7.2 - */ - connected: boolean; - /** - * The `process.allowedNodeEnvironmentFlags` property is a special, - * read-only `Set` of flags allowable within the `NODE_OPTIONS` environment variable. - * - * `process.allowedNodeEnvironmentFlags` extends `Set`, but overrides`Set.prototype.has` to recognize several different possible flag - * representations. `process.allowedNodeEnvironmentFlags.has()` will - * return `true` in the following cases: - * - * * Flags may omit leading single (`-`) or double (`--`) dashes; e.g.,`inspect-brk` for `--inspect-brk`, or `r` for `-r`. - * * Flags passed through to V8 (as listed in `--v8-options`) may replace - * one or more _non-leading_ dashes for an underscore, or vice-versa; - * e.g., `--perf_basic_prof`, `--perf-basic-prof`, `--perf_basic-prof`, - * etc. - * * Flags may contain one or more equals (`=`) characters; all - * characters after and including the first equals will be ignored; - * e.g., `--stack-trace-limit=100`. - * * Flags _must_ be allowable within `NODE_OPTIONS`. - * - * When iterating over `process.allowedNodeEnvironmentFlags`, flags will - * appear only _once_; each will begin with one or more dashes. Flags - * passed through to V8 will contain underscores instead of non-leading - * dashes: - * - * ```js - * import { allowedNodeEnvironmentFlags } from 'process'; - * - * allowedNodeEnvironmentFlags.forEach((flag) => { - * // -r - * // --inspect-brk - * // --abort_on_uncaught_exception - * // ... - * }); - * ``` - * - * The methods `add()`, `clear()`, and `delete()` of`process.allowedNodeEnvironmentFlags` do nothing, and will fail - * silently. - * - * If Node.js was compiled _without_ `NODE_OPTIONS` support (shown in {@link config}), `process.allowedNodeEnvironmentFlags` will - * contain what _would have_ been allowable. - * @since v10.10.0 - */ - allowedNodeEnvironmentFlags: ReadonlySet; - /** - * `process.report` is an object whose methods are used to generate diagnostic - * reports for the current process. Additional documentation is available in the `report documentation`. - * @since v11.8.0 - */ - report?: ProcessReport | undefined; - /** - * ```js - * import { resourceUsage } from 'process'; - * - * console.log(resourceUsage()); - * /* - * Will output: - * { - * userCPUTime: 82872, - * systemCPUTime: 4143, - * maxRSS: 33164, - * sharedMemorySize: 0, - * unsharedDataSize: 0, - * unsharedStackSize: 0, - * minorPageFault: 2469, - * majorPageFault: 0, - * swappedOut: 0, - * fsRead: 0, - * fsWrite: 8, - * ipcSent: 0, - * ipcReceived: 0, - * signalsCount: 0, - * voluntaryContextSwitches: 79, - * involuntaryContextSwitches: 1 - * } - * - * ``` - * @since v12.6.0 - * @return the resource usage for the current process. All of these values come from the `uv_getrusage` call which returns a [`uv_rusage_t` struct][uv_rusage_t]. - */ - resourceUsage(): ResourceUsage; - /** - * The `process.traceDeprecation` property indicates whether the`--trace-deprecation` flag is set on the current Node.js process. See the - * documentation for the `'warning' event` and the `emitWarning() method` for more information about this - * flag's behavior. - * @since v0.8.0 - */ - traceDeprecation: boolean; - /* EventEmitter */ - addListener(event: 'beforeExit', listener: BeforeExitListener): this; - addListener(event: 'disconnect', listener: DisconnectListener): this; - addListener(event: 'exit', listener: ExitListener): this; - addListener(event: 'rejectionHandled', listener: RejectionHandledListener): this; - addListener(event: 'uncaughtException', listener: UncaughtExceptionListener): this; - addListener(event: 'uncaughtExceptionMonitor', listener: UncaughtExceptionListener): this; - addListener(event: 'unhandledRejection', listener: UnhandledRejectionListener): this; - addListener(event: 'warning', listener: WarningListener): this; - addListener(event: 'message', listener: MessageListener): this; - addListener(event: Signals, listener: SignalsListener): this; - addListener(event: 'multipleResolves', listener: MultipleResolveListener): this; - addListener(event: 'worker', listener: WorkerListener): this; - emit(event: 'beforeExit', code: number): boolean; - emit(event: 'disconnect'): boolean; - emit(event: 'exit', code: number): boolean; - emit(event: 'rejectionHandled', promise: Promise): boolean; - emit(event: 'uncaughtException', error: Error): boolean; - emit(event: 'uncaughtExceptionMonitor', error: Error): boolean; - emit(event: 'unhandledRejection', reason: unknown, promise: Promise): boolean; - emit(event: 'warning', warning: Error): boolean; - emit(event: 'message', message: unknown, sendHandle: unknown): this; - emit(event: Signals, signal?: Signals): boolean; - emit(event: 'multipleResolves', type: MultipleResolveType, promise: Promise, value: unknown): this; - emit(event: 'worker', listener: WorkerListener): this; - on(event: 'beforeExit', listener: BeforeExitListener): this; - on(event: 'disconnect', listener: DisconnectListener): this; - on(event: 'exit', listener: ExitListener): this; - on(event: 'rejectionHandled', listener: RejectionHandledListener): this; - on(event: 'uncaughtException', listener: UncaughtExceptionListener): this; - on(event: 'uncaughtExceptionMonitor', listener: UncaughtExceptionListener): this; - on(event: 'unhandledRejection', listener: UnhandledRejectionListener): this; - on(event: 'warning', listener: WarningListener): this; - on(event: 'message', listener: MessageListener): this; - on(event: Signals, listener: SignalsListener): this; - on(event: 'multipleResolves', listener: MultipleResolveListener): this; - on(event: 'worker', listener: WorkerListener): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once(event: 'beforeExit', listener: BeforeExitListener): this; - once(event: 'disconnect', listener: DisconnectListener): this; - once(event: 'exit', listener: ExitListener): this; - once(event: 'rejectionHandled', listener: RejectionHandledListener): this; - once(event: 'uncaughtException', listener: UncaughtExceptionListener): this; - once(event: 'uncaughtExceptionMonitor', listener: UncaughtExceptionListener): this; - once(event: 'unhandledRejection', listener: UnhandledRejectionListener): this; - once(event: 'warning', listener: WarningListener): this; - once(event: 'message', listener: MessageListener): this; - once(event: Signals, listener: SignalsListener): this; - once(event: 'multipleResolves', listener: MultipleResolveListener): this; - once(event: 'worker', listener: WorkerListener): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener(event: 'beforeExit', listener: BeforeExitListener): this; - prependListener(event: 'disconnect', listener: DisconnectListener): this; - prependListener(event: 'exit', listener: ExitListener): this; - prependListener(event: 'rejectionHandled', listener: RejectionHandledListener): this; - prependListener(event: 'uncaughtException', listener: UncaughtExceptionListener): this; - prependListener(event: 'uncaughtExceptionMonitor', listener: UncaughtExceptionListener): this; - prependListener(event: 'unhandledRejection', listener: UnhandledRejectionListener): this; - prependListener(event: 'warning', listener: WarningListener): this; - prependListener(event: 'message', listener: MessageListener): this; - prependListener(event: Signals, listener: SignalsListener): this; - prependListener(event: 'multipleResolves', listener: MultipleResolveListener): this; - prependListener(event: 'worker', listener: WorkerListener): this; - prependOnceListener(event: 'beforeExit', listener: BeforeExitListener): this; - prependOnceListener(event: 'disconnect', listener: DisconnectListener): this; - prependOnceListener(event: 'exit', listener: ExitListener): this; - prependOnceListener(event: 'rejectionHandled', listener: RejectionHandledListener): this; - prependOnceListener(event: 'uncaughtException', listener: UncaughtExceptionListener): this; - prependOnceListener(event: 'uncaughtExceptionMonitor', listener: UncaughtExceptionListener): this; - prependOnceListener(event: 'unhandledRejection', listener: UnhandledRejectionListener): this; - prependOnceListener(event: 'warning', listener: WarningListener): this; - prependOnceListener(event: 'message', listener: MessageListener): this; - prependOnceListener(event: Signals, listener: SignalsListener): this; - prependOnceListener(event: 'multipleResolves', listener: MultipleResolveListener): this; - prependOnceListener(event: 'worker', listener: WorkerListener): this; - listeners(event: 'beforeExit'): BeforeExitListener[]; - listeners(event: 'disconnect'): DisconnectListener[]; - listeners(event: 'exit'): ExitListener[]; - listeners(event: 'rejectionHandled'): RejectionHandledListener[]; - listeners(event: 'uncaughtException'): UncaughtExceptionListener[]; - listeners(event: 'uncaughtExceptionMonitor'): UncaughtExceptionListener[]; - listeners(event: 'unhandledRejection'): UnhandledRejectionListener[]; - listeners(event: 'warning'): WarningListener[]; - listeners(event: 'message'): MessageListener[]; - listeners(event: Signals): SignalsListener[]; - listeners(event: 'multipleResolves'): MultipleResolveListener[]; - listeners(event: 'worker'): WorkerListener[]; - } - } - } - export = process; -} -declare module 'node:process' { - import process = require('process'); - export = process; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/punycode.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/punycode.d.ts deleted file mode 100755 index 87ebbb90..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/punycode.d.ts +++ /dev/null @@ -1,117 +0,0 @@ -/** - * **The version of the punycode module bundled in Node.js is being deprecated.**In a future major version of Node.js this module will be removed. Users - * currently depending on the `punycode` module should switch to using the - * userland-provided [Punycode.js](https://github.com/bestiejs/punycode.js) module instead. For punycode-based URL - * encoding, see `url.domainToASCII` or, more generally, the `WHATWG URL API`. - * - * The `punycode` module is a bundled version of the [Punycode.js](https://github.com/bestiejs/punycode.js) module. It - * can be accessed using: - * - * ```js - * const punycode = require('punycode'); - * ``` - * - * [Punycode](https://tools.ietf.org/html/rfc3492) is a character encoding scheme defined by RFC 3492 that is - * primarily intended for use in Internationalized Domain Names. Because host - * names in URLs are limited to ASCII characters only, Domain Names that contain - * non-ASCII characters must be converted into ASCII using the Punycode scheme. - * For instance, the Japanese character that translates into the English word,`'example'` is `'例'`. The Internationalized Domain Name, `'例.com'` (equivalent - * to `'example.com'`) is represented by Punycode as the ASCII string`'xn--fsq.com'`. - * - * The `punycode` module provides a simple implementation of the Punycode standard. - * - * The `punycode` module is a third-party dependency used by Node.js and - * made available to developers as a convenience. Fixes or other modifications to - * the module must be directed to the [Punycode.js](https://github.com/bestiejs/punycode.js) project. - * @deprecated Since v7.0.0 - Deprecated - * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/punycode.js) - */ -declare module 'punycode' { - /** - * The `punycode.decode()` method converts a [Punycode](https://tools.ietf.org/html/rfc3492) string of ASCII-only - * characters to the equivalent string of Unicode codepoints. - * - * ```js - * punycode.decode('maana-pta'); // 'mañana' - * punycode.decode('--dqo34k'); // '☃-⌘' - * ``` - * @since v0.5.1 - */ - function decode(string: string): string; - /** - * The `punycode.encode()` method converts a string of Unicode codepoints to a [Punycode](https://tools.ietf.org/html/rfc3492) string of ASCII-only characters. - * - * ```js - * punycode.encode('mañana'); // 'maana-pta' - * punycode.encode('☃-⌘'); // '--dqo34k' - * ``` - * @since v0.5.1 - */ - function encode(string: string): string; - /** - * The `punycode.toUnicode()` method converts a string representing a domain name - * containing [Punycode](https://tools.ietf.org/html/rfc3492) encoded characters into Unicode. Only the [Punycode](https://tools.ietf.org/html/rfc3492) encoded parts of the domain name are be - * converted. - * - * ```js - * // decode domain names - * punycode.toUnicode('xn--maana-pta.com'); // 'mañana.com' - * punycode.toUnicode('xn----dqo34k.com'); // '☃-⌘.com' - * punycode.toUnicode('example.com'); // 'example.com' - * ``` - * @since v0.6.1 - */ - function toUnicode(domain: string): string; - /** - * The `punycode.toASCII()` method converts a Unicode string representing an - * Internationalized Domain Name to [Punycode](https://tools.ietf.org/html/rfc3492). Only the non-ASCII parts of the - * domain name will be converted. Calling `punycode.toASCII()` on a string that - * already only contains ASCII characters will have no effect. - * - * ```js - * // encode domain names - * punycode.toASCII('mañana.com'); // 'xn--maana-pta.com' - * punycode.toASCII('☃-⌘.com'); // 'xn----dqo34k.com' - * punycode.toASCII('example.com'); // 'example.com' - * ``` - * @since v0.6.1 - */ - function toASCII(domain: string): string; - /** - * @deprecated since v7.0.0 - * The version of the punycode module bundled in Node.js is being deprecated. - * In a future major version of Node.js this module will be removed. - * Users currently depending on the punycode module should switch to using - * the userland-provided Punycode.js module instead. - */ - const ucs2: ucs2; - interface ucs2 { - /** - * @deprecated since v7.0.0 - * The version of the punycode module bundled in Node.js is being deprecated. - * In a future major version of Node.js this module will be removed. - * Users currently depending on the punycode module should switch to using - * the userland-provided Punycode.js module instead. - */ - decode(string: string): number[]; - /** - * @deprecated since v7.0.0 - * The version of the punycode module bundled in Node.js is being deprecated. - * In a future major version of Node.js this module will be removed. - * Users currently depending on the punycode module should switch to using - * the userland-provided Punycode.js module instead. - */ - encode(codePoints: ReadonlyArray): string; - } - /** - * @deprecated since v7.0.0 - * The version of the punycode module bundled in Node.js is being deprecated. - * In a future major version of Node.js this module will be removed. - * Users currently depending on the punycode module should switch to using - * the userland-provided Punycode.js module instead. - */ - const version: string; -} -declare module 'node:punycode' { - export * from 'punycode'; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/querystring.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/querystring.d.ts deleted file mode 100755 index e1185478..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/querystring.d.ts +++ /dev/null @@ -1,131 +0,0 @@ -/** - * The `querystring` module provides utilities for parsing and formatting URL - * query strings. It can be accessed using: - * - * ```js - * const querystring = require('querystring'); - * ``` - * - * `querystring` is more performant than `URLSearchParams` but is not a - * standardized API. Use `URLSearchParams` when performance is not critical - * or when compatibility with browser code is desirable. - * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/querystring.js) - */ -declare module 'querystring' { - interface StringifyOptions { - encodeURIComponent?: ((str: string) => string) | undefined; - } - interface ParseOptions { - maxKeys?: number | undefined; - decodeURIComponent?: ((str: string) => string) | undefined; - } - interface ParsedUrlQuery extends NodeJS.Dict {} - interface ParsedUrlQueryInput extends NodeJS.Dict | ReadonlyArray | ReadonlyArray | null> {} - /** - * The `querystring.stringify()` method produces a URL query string from a - * given `obj` by iterating through the object's "own properties". - * - * It serializes the following types of values passed in `obj`:[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type) | - * [number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type) | - * [bigint](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt) | - * [boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type) | - * [string\[\]](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type) | - * [number\[\]](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type) | - * [bigint\[\]](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt) | - * [boolean\[\]](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type) The numeric values must be finite. Any other input values will be coerced to - * empty strings. - * - * ```js - * querystring.stringify({ foo: 'bar', baz: ['qux', 'quux'], corge: '' }); - * // Returns 'foo=bar&baz=qux&baz=quux&corge=' - * - * querystring.stringify({ foo: 'bar', baz: 'qux' }, ';', ':'); - * // Returns 'foo:bar;baz:qux' - * ``` - * - * By default, characters requiring percent-encoding within the query string will - * be encoded as UTF-8\. If an alternative encoding is required, then an alternative`encodeURIComponent` option will need to be specified: - * - * ```js - * // Assuming gbkEncodeURIComponent function already exists, - * - * querystring.stringify({ w: '中文', foo: 'bar' }, null, null, - * { encodeURIComponent: gbkEncodeURIComponent }); - * ``` - * @since v0.1.25 - * @param obj The object to serialize into a URL query string - * @param [sep='&'] The substring used to delimit key and value pairs in the query string. - * @param [eq='='] . The substring used to delimit keys and values in the query string. - */ - function stringify(obj?: ParsedUrlQueryInput, sep?: string, eq?: string, options?: StringifyOptions): string; - /** - * The `querystring.parse()` method parses a URL query string (`str`) into a - * collection of key and value pairs. - * - * For example, the query string `'foo=bar&abc=xyz&abc=123'` is parsed into: - * - * ```js - * { - * foo: 'bar', - * abc: ['xyz', '123'] - * } - * ``` - * - * The object returned by the `querystring.parse()` method _does not_prototypically inherit from the JavaScript `Object`. This means that typical`Object` methods such as `obj.toString()`, - * `obj.hasOwnProperty()`, and others - * are not defined and _will not work_. - * - * By default, percent-encoded characters within the query string will be assumed - * to use UTF-8 encoding. If an alternative character encoding is used, then an - * alternative `decodeURIComponent` option will need to be specified: - * - * ```js - * // Assuming gbkDecodeURIComponent function already exists... - * - * querystring.parse('w=%D6%D0%CE%C4&foo=bar', null, null, - * { decodeURIComponent: gbkDecodeURIComponent }); - * ``` - * @since v0.1.25 - * @param str The URL query string to parse - * @param [sep='&'] The substring used to delimit key and value pairs in the query string. - * @param [eq='='] . The substring used to delimit keys and values in the query string. - */ - function parse(str: string, sep?: string, eq?: string, options?: ParseOptions): ParsedUrlQuery; - /** - * The querystring.encode() function is an alias for querystring.stringify(). - */ - const encode: typeof stringify; - /** - * The querystring.decode() function is an alias for querystring.parse(). - */ - const decode: typeof parse; - /** - * The `querystring.escape()` method performs URL percent-encoding on the given`str` in a manner that is optimized for the specific requirements of URL - * query strings. - * - * The `querystring.escape()` method is used by `querystring.stringify()` and is - * generally not expected to be used directly. It is exported primarily to allow - * application code to provide a replacement percent-encoding implementation if - * necessary by assigning `querystring.escape` to an alternative function. - * @since v0.1.25 - */ - function escape(str: string): string; - /** - * The `querystring.unescape()` method performs decoding of URL percent-encoded - * characters on the given `str`. - * - * The `querystring.unescape()` method is used by `querystring.parse()` and is - * generally not expected to be used directly. It is exported primarily to allow - * application code to provide a replacement decoding implementation if - * necessary by assigning `querystring.unescape` to an alternative function. - * - * By default, the `querystring.unescape()` method will attempt to use the - * JavaScript built-in `decodeURIComponent()` method to decode. If that fails, - * a safer equivalent that does not throw on malformed URLs will be used. - * @since v0.1.25 - */ - function unescape(str: string): string; -} -declare module 'node:querystring' { - export * from 'querystring'; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/readline.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/readline.d.ts deleted file mode 100755 index 6ab64acb..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/readline.d.ts +++ /dev/null @@ -1,653 +0,0 @@ -/** - * The `readline` module provides an interface for reading data from a `Readable` stream (such as `process.stdin`) one line at a time. - * - * To use the promise-based APIs: - * - * ```js - * import * as readline from 'node:readline/promises'; - * ``` - * - * To use the callback and sync APIs: - * - * ```js - * import * as readline from 'node:readline'; - * ``` - * - * The following simple example illustrates the basic use of the `readline` module. - * - * ```js - * import * as readline from 'node:readline/promises'; - * import { stdin as input, stdout as output } from 'node:process'; - * - * const rl = readline.createInterface({ input, output }); - * - * const answer = await rl.question('What do you think of Node.js? '); - * - * console.log(`Thank you for your valuable feedback: ${answer}`); - * - * rl.close(); - * ``` - * - * Once this code is invoked, the Node.js application will not terminate until the`readline.Interface` is closed because the interface waits for data to be - * received on the `input` stream. - * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/readline.js) - */ -declare module 'readline' { - import { Abortable, EventEmitter } from 'node:events'; - import * as promises from 'node:readline/promises'; - - export { promises }; - export interface Key { - sequence?: string | undefined; - name?: string | undefined; - ctrl?: boolean | undefined; - meta?: boolean | undefined; - shift?: boolean | undefined; - } - /** - * Instances of the `readline.Interface` class are constructed using the`readline.createInterface()` method. Every instance is associated with a - * single `input` `Readable` stream and a single `output` `Writable` stream. - * The `output` stream is used to print prompts for user input that arrives on, - * and is read from, the `input` stream. - * @since v0.1.104 - */ - export class Interface extends EventEmitter { - readonly terminal: boolean; - /** - * The current input data being processed by node. - * - * This can be used when collecting input from a TTY stream to retrieve the - * current value that has been processed thus far, prior to the `line` event - * being emitted. Once the `line` event has been emitted, this property will - * be an empty string. - * - * Be aware that modifying the value during the instance runtime may have - * unintended consequences if `rl.cursor` is not also controlled. - * - * **If not using a TTY stream for input, use the `'line'` event.** - * - * One possible use case would be as follows: - * - * ```js - * const values = ['lorem ipsum', 'dolor sit amet']; - * const rl = readline.createInterface(process.stdin); - * const showResults = debounce(() => { - * console.log( - * '\n', - * values.filter((val) => val.startsWith(rl.line)).join(' ') - * ); - * }, 300); - * process.stdin.on('keypress', (c, k) => { - * showResults(); - * }); - * ``` - * @since v0.1.98 - */ - readonly line: string; - /** - * The cursor position relative to `rl.line`. - * - * This will track where the current cursor lands in the input string, when - * reading input from a TTY stream. The position of cursor determines the - * portion of the input string that will be modified as input is processed, - * as well as the column where the terminal caret will be rendered. - * @since v0.1.98 - */ - readonly cursor: number; - /** - * NOTE: According to the documentation: - * - * > Instances of the `readline.Interface` class are constructed using the - * > `readline.createInterface()` method. - * - * @see https://nodejs.org/dist/latest-v10.x/docs/api/readline.html#readline_class_interface - */ - protected constructor(input: NodeJS.ReadableStream, output?: NodeJS.WritableStream, completer?: Completer | AsyncCompleter, terminal?: boolean); - /** - * NOTE: According to the documentation: - * - * > Instances of the `readline.Interface` class are constructed using the - * > `readline.createInterface()` method. - * - * @see https://nodejs.org/dist/latest-v10.x/docs/api/readline.html#readline_class_interface - */ - protected constructor(options: ReadLineOptions); - /** - * The `rl.getPrompt()` method returns the current prompt used by `rl.prompt()`. - * @since v15.3.0 - * @return the current prompt string - */ - getPrompt(): string; - /** - * The `rl.setPrompt()` method sets the prompt that will be written to `output`whenever `rl.prompt()` is called. - * @since v0.1.98 - */ - setPrompt(prompt: string): void; - /** - * The `rl.prompt()` method writes the `readline.Interface` instances configured`prompt` to a new line in `output` in order to provide a user with a new - * location at which to provide input. - * - * When called, `rl.prompt()` will resume the `input` stream if it has been - * paused. - * - * If the `readline.Interface` was created with `output` set to `null` or`undefined` the prompt is not written. - * @since v0.1.98 - * @param preserveCursor If `true`, prevents the cursor placement from being reset to `0`. - */ - prompt(preserveCursor?: boolean): void; - /** - * The `rl.question()` method displays the `query` by writing it to the `output`, - * waits for user input to be provided on `input`, then invokes the `callback`function passing the provided input as the first argument. - * - * When called, `rl.question()` will resume the `input` stream if it has been - * paused. - * - * If the `readline.Interface` was created with `output` set to `null` or`undefined` the `query` is not written. - * - * The `callback` function passed to `rl.question()` does not follow the typical - * pattern of accepting an `Error` object or `null` as the first argument. - * The `callback` is called with the provided answer as the only argument. - * - * Example usage: - * - * ```js - * rl.question('What is your favorite food? ', (answer) => { - * console.log(`Oh, so your favorite food is ${answer}`); - * }); - * ``` - * - * Using an `AbortController` to cancel a question. - * - * ```js - * const ac = new AbortController(); - * const signal = ac.signal; - * - * rl.question('What is your favorite food? ', { signal }, (answer) => { - * console.log(`Oh, so your favorite food is ${answer}`); - * }); - * - * signal.addEventListener('abort', () => { - * console.log('The food question timed out'); - * }, { once: true }); - * - * setTimeout(() => ac.abort(), 10000); - * ``` - * - * If this method is invoked as it's util.promisify()ed version, it returns a - * Promise that fulfills with the answer. If the question is canceled using - * an `AbortController` it will reject with an `AbortError`. - * - * ```js - * const util = require('util'); - * const question = util.promisify(rl.question).bind(rl); - * - * async function questionExample() { - * try { - * const answer = await question('What is you favorite food? '); - * console.log(`Oh, so your favorite food is ${answer}`); - * } catch (err) { - * console.error('Question rejected', err); - * } - * } - * questionExample(); - * ``` - * @since v0.3.3 - * @param query A statement or query to write to `output`, prepended to the prompt. - * @param callback A callback function that is invoked with the user's input in response to the `query`. - */ - question(query: string, callback: (answer: string) => void): void; - question(query: string, options: Abortable, callback: (answer: string) => void): void; - /** - * The `rl.pause()` method pauses the `input` stream, allowing it to be resumed - * later if necessary. - * - * Calling `rl.pause()` does not immediately pause other events (including`'line'`) from being emitted by the `readline.Interface` instance. - * @since v0.3.4 - */ - pause(): this; - /** - * The `rl.resume()` method resumes the `input` stream if it has been paused. - * @since v0.3.4 - */ - resume(): this; - /** - * The `rl.close()` method closes the `readline.Interface` instance and - * relinquishes control over the `input` and `output` streams. When called, - * the `'close'` event will be emitted. - * - * Calling `rl.close()` does not immediately stop other events (including `'line'`) - * from being emitted by the `readline.Interface` instance. - * @since v0.1.98 - */ - close(): void; - /** - * The `rl.write()` method will write either `data` or a key sequence identified - * by `key` to the `output`. The `key` argument is supported only if `output` is - * a `TTY` text terminal. See `TTY keybindings` for a list of key - * combinations. - * - * If `key` is specified, `data` is ignored. - * - * When called, `rl.write()` will resume the `input` stream if it has been - * paused. - * - * If the `readline.Interface` was created with `output` set to `null` or`undefined` the `data` and `key` are not written. - * - * ```js - * rl.write('Delete this!'); - * // Simulate Ctrl+U to delete the line written previously - * rl.write(null, { ctrl: true, name: 'u' }); - * ``` - * - * The `rl.write()` method will write the data to the `readline` `Interface`'s`input`_as if it were provided by the user_. - * @since v0.1.98 - */ - write(data: string | Buffer, key?: Key): void; - write(data: undefined | null | string | Buffer, key: Key): void; - /** - * Returns the real position of the cursor in relation to the input - * prompt + string. Long input (wrapping) strings, as well as multiple - * line prompts are included in the calculations. - * @since v13.5.0, v12.16.0 - */ - getCursorPos(): CursorPos; - /** - * events.EventEmitter - * 1. close - * 2. line - * 3. pause - * 4. resume - * 5. SIGCONT - * 6. SIGINT - * 7. SIGTSTP - * 8. history - */ - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: 'close', listener: () => void): this; - addListener(event: 'line', listener: (input: string) => void): this; - addListener(event: 'pause', listener: () => void): this; - addListener(event: 'resume', listener: () => void): this; - addListener(event: 'SIGCONT', listener: () => void): this; - addListener(event: 'SIGINT', listener: () => void): this; - addListener(event: 'SIGTSTP', listener: () => void): this; - addListener(event: 'history', listener: (history: string[]) => void): this; - emit(event: string | symbol, ...args: any[]): boolean; - emit(event: 'close'): boolean; - emit(event: 'line', input: string): boolean; - emit(event: 'pause'): boolean; - emit(event: 'resume'): boolean; - emit(event: 'SIGCONT'): boolean; - emit(event: 'SIGINT'): boolean; - emit(event: 'SIGTSTP'): boolean; - emit(event: 'history', history: string[]): boolean; - on(event: string, listener: (...args: any[]) => void): this; - on(event: 'close', listener: () => void): this; - on(event: 'line', listener: (input: string) => void): this; - on(event: 'pause', listener: () => void): this; - on(event: 'resume', listener: () => void): this; - on(event: 'SIGCONT', listener: () => void): this; - on(event: 'SIGINT', listener: () => void): this; - on(event: 'SIGTSTP', listener: () => void): this; - on(event: 'history', listener: (history: string[]) => void): this; - once(event: string, listener: (...args: any[]) => void): this; - once(event: 'close', listener: () => void): this; - once(event: 'line', listener: (input: string) => void): this; - once(event: 'pause', listener: () => void): this; - once(event: 'resume', listener: () => void): this; - once(event: 'SIGCONT', listener: () => void): this; - once(event: 'SIGINT', listener: () => void): this; - once(event: 'SIGTSTP', listener: () => void): this; - once(event: 'history', listener: (history: string[]) => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: 'close', listener: () => void): this; - prependListener(event: 'line', listener: (input: string) => void): this; - prependListener(event: 'pause', listener: () => void): this; - prependListener(event: 'resume', listener: () => void): this; - prependListener(event: 'SIGCONT', listener: () => void): this; - prependListener(event: 'SIGINT', listener: () => void): this; - prependListener(event: 'SIGTSTP', listener: () => void): this; - prependListener(event: 'history', listener: (history: string[]) => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: 'close', listener: () => void): this; - prependOnceListener(event: 'line', listener: (input: string) => void): this; - prependOnceListener(event: 'pause', listener: () => void): this; - prependOnceListener(event: 'resume', listener: () => void): this; - prependOnceListener(event: 'SIGCONT', listener: () => void): this; - prependOnceListener(event: 'SIGINT', listener: () => void): this; - prependOnceListener(event: 'SIGTSTP', listener: () => void): this; - prependOnceListener(event: 'history', listener: (history: string[]) => void): this; - [Symbol.asyncIterator](): AsyncIterableIterator; - } - export type ReadLine = Interface; // type forwarded for backwards compatibility - export type Completer = (line: string) => CompleterResult; - export type AsyncCompleter = (line: string, callback: (err?: null | Error, result?: CompleterResult) => void) => void; - export type CompleterResult = [string[], string]; - export interface ReadLineOptions { - input: NodeJS.ReadableStream; - output?: NodeJS.WritableStream | undefined; - completer?: Completer | AsyncCompleter | undefined; - terminal?: boolean | undefined; - /** - * Initial list of history lines. This option makes sense - * only if `terminal` is set to `true` by the user or by an internal `output` - * check, otherwise the history caching mechanism is not initialized at all. - * @default [] - */ - history?: string[] | undefined; - historySize?: number | undefined; - prompt?: string | undefined; - crlfDelay?: number | undefined; - /** - * If `true`, when a new input line added - * to the history list duplicates an older one, this removes the older line - * from the list. - * @default false - */ - removeHistoryDuplicates?: boolean | undefined; - escapeCodeTimeout?: number | undefined; - tabSize?: number | undefined; - } - /** - * The `readline.createInterface()` method creates a new `readline.Interface`instance. - * - * ```js - * const readline = require('readline'); - * const rl = readline.createInterface({ - * input: process.stdin, - * output: process.stdout - * }); - * ``` - * - * Once the `readline.Interface` instance is created, the most common case is to - * listen for the `'line'` event: - * - * ```js - * rl.on('line', (line) => { - * console.log(`Received: ${line}`); - * }); - * ``` - * - * If `terminal` is `true` for this instance then the `output` stream will get - * the best compatibility if it defines an `output.columns` property and emits - * a `'resize'` event on the `output` if or when the columns ever change - * (`process.stdout` does this automatically when it is a TTY). - * - * When creating a `readline.Interface` using `stdin` as input, the program - * will not terminate until it receives `EOF` (Ctrl+D on - * Linux/macOS, Ctrl+Z followed by Return on - * Windows). - * If you want your application to exit without waiting for user input, you can `unref()` the standard input stream: - * - * ```js - * process.stdin.unref(); - * ``` - * @since v0.1.98 - */ - export function createInterface(input: NodeJS.ReadableStream, output?: NodeJS.WritableStream, completer?: Completer | AsyncCompleter, terminal?: boolean): Interface; - export function createInterface(options: ReadLineOptions): Interface; - /** - * The `readline.emitKeypressEvents()` method causes the given `Readable` stream to begin emitting `'keypress'` events corresponding to received input. - * - * Optionally, `interface` specifies a `readline.Interface` instance for which - * autocompletion is disabled when copy-pasted input is detected. - * - * If the `stream` is a `TTY`, then it must be in raw mode. - * - * This is automatically called by any readline instance on its `input` if the`input` is a terminal. Closing the `readline` instance does not stop - * the `input` from emitting `'keypress'` events. - * - * ```js - * readline.emitKeypressEvents(process.stdin); - * if (process.stdin.isTTY) - * process.stdin.setRawMode(true); - * ``` - * - * ## Example: Tiny CLI - * - * The following example illustrates the use of `readline.Interface` class to - * implement a small command-line interface: - * - * ```js - * const readline = require('readline'); - * const rl = readline.createInterface({ - * input: process.stdin, - * output: process.stdout, - * prompt: 'OHAI> ' - * }); - * - * rl.prompt(); - * - * rl.on('line', (line) => { - * switch (line.trim()) { - * case 'hello': - * console.log('world!'); - * break; - * default: - * console.log(`Say what? I might have heard '${line.trim()}'`); - * break; - * } - * rl.prompt(); - * }).on('close', () => { - * console.log('Have a great day!'); - * process.exit(0); - * }); - * ``` - * - * ## Example: Read file stream line-by-Line - * - * A common use case for `readline` is to consume an input file one line at a - * time. The easiest way to do so is leveraging the `fs.ReadStream` API as - * well as a `for await...of` loop: - * - * ```js - * const fs = require('fs'); - * const readline = require('readline'); - * - * async function processLineByLine() { - * const fileStream = fs.createReadStream('input.txt'); - * - * const rl = readline.createInterface({ - * input: fileStream, - * crlfDelay: Infinity - * }); - * // Note: we use the crlfDelay option to recognize all instances of CR LF - * // ('\r\n') in input.txt as a single line break. - * - * for await (const line of rl) { - * // Each line in input.txt will be successively available here as `line`. - * console.log(`Line from file: ${line}`); - * } - * } - * - * processLineByLine(); - * ``` - * - * Alternatively, one could use the `'line'` event: - * - * ```js - * const fs = require('fs'); - * const readline = require('readline'); - * - * const rl = readline.createInterface({ - * input: fs.createReadStream('sample.txt'), - * crlfDelay: Infinity - * }); - * - * rl.on('line', (line) => { - * console.log(`Line from file: ${line}`); - * }); - * ``` - * - * Currently, `for await...of` loop can be a bit slower. If `async` / `await`flow and speed are both essential, a mixed approach can be applied: - * - * ```js - * const { once } = require('events'); - * const { createReadStream } = require('fs'); - * const { createInterface } = require('readline'); - * - * (async function processLineByLine() { - * try { - * const rl = createInterface({ - * input: createReadStream('big-file.txt'), - * crlfDelay: Infinity - * }); - * - * rl.on('line', (line) => { - * // Process the line. - * }); - * - * await once(rl, 'close'); - * - * console.log('File processed.'); - * } catch (err) { - * console.error(err); - * } - * })(); - * ``` - * @since v0.7.7 - */ - export function emitKeypressEvents(stream: NodeJS.ReadableStream, readlineInterface?: Interface): void; - export type Direction = -1 | 0 | 1; - export interface CursorPos { - rows: number; - cols: number; - } - /** - * The `readline.clearLine()` method clears current line of given `TTY` stream - * in a specified direction identified by `dir`. - * @since v0.7.7 - * @param callback Invoked once the operation completes. - * @return `false` if `stream` wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`. - */ - export function clearLine(stream: NodeJS.WritableStream, dir: Direction, callback?: () => void): boolean; - /** - * The `readline.clearScreenDown()` method clears the given `TTY` stream from - * the current position of the cursor down. - * @since v0.7.7 - * @param callback Invoked once the operation completes. - * @return `false` if `stream` wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`. - */ - export function clearScreenDown(stream: NodeJS.WritableStream, callback?: () => void): boolean; - /** - * The `readline.cursorTo()` method moves cursor to the specified position in a - * given `TTY` `stream`. - * @since v0.7.7 - * @param callback Invoked once the operation completes. - * @return `false` if `stream` wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`. - */ - export function cursorTo(stream: NodeJS.WritableStream, x: number, y?: number, callback?: () => void): boolean; - /** - * The `readline.moveCursor()` method moves the cursor _relative_ to its current - * position in a given `TTY` `stream`. - * - * ## Example: Tiny CLI - * - * The following example illustrates the use of `readline.Interface` class to - * implement a small command-line interface: - * - * ```js - * const readline = require('readline'); - * const rl = readline.createInterface({ - * input: process.stdin, - * output: process.stdout, - * prompt: 'OHAI> ' - * }); - * - * rl.prompt(); - * - * rl.on('line', (line) => { - * switch (line.trim()) { - * case 'hello': - * console.log('world!'); - * break; - * default: - * console.log(`Say what? I might have heard '${line.trim()}'`); - * break; - * } - * rl.prompt(); - * }).on('close', () => { - * console.log('Have a great day!'); - * process.exit(0); - * }); - * ``` - * - * ## Example: Read file stream line-by-Line - * - * A common use case for `readline` is to consume an input file one line at a - * time. The easiest way to do so is leveraging the `fs.ReadStream` API as - * well as a `for await...of` loop: - * - * ```js - * const fs = require('fs'); - * const readline = require('readline'); - * - * async function processLineByLine() { - * const fileStream = fs.createReadStream('input.txt'); - * - * const rl = readline.createInterface({ - * input: fileStream, - * crlfDelay: Infinity - * }); - * // Note: we use the crlfDelay option to recognize all instances of CR LF - * // ('\r\n') in input.txt as a single line break. - * - * for await (const line of rl) { - * // Each line in input.txt will be successively available here as `line`. - * console.log(`Line from file: ${line}`); - * } - * } - * - * processLineByLine(); - * ``` - * - * Alternatively, one could use the `'line'` event: - * - * ```js - * const fs = require('fs'); - * const readline = require('readline'); - * - * const rl = readline.createInterface({ - * input: fs.createReadStream('sample.txt'), - * crlfDelay: Infinity - * }); - * - * rl.on('line', (line) => { - * console.log(`Line from file: ${line}`); - * }); - * ``` - * - * Currently, `for await...of` loop can be a bit slower. If `async` / `await`flow and speed are both essential, a mixed approach can be applied: - * - * ```js - * const { once } = require('events'); - * const { createReadStream } = require('fs'); - * const { createInterface } = require('readline'); - * - * (async function processLineByLine() { - * try { - * const rl = createInterface({ - * input: createReadStream('big-file.txt'), - * crlfDelay: Infinity - * }); - * - * rl.on('line', (line) => { - * // Process the line. - * }); - * - * await once(rl, 'close'); - * - * console.log('File processed.'); - * } catch (err) { - * console.error(err); - * } - * })(); - * ``` - * @since v0.7.7 - * @param callback Invoked once the operation completes. - * @return `false` if `stream` wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`. - */ - export function moveCursor(stream: NodeJS.WritableStream, dx: number, dy: number, callback?: () => void): boolean; -} -declare module 'node:readline' { - export * from 'readline'; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/readline/promises.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/readline/promises.d.ts deleted file mode 100755 index 8f9f06f0..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/readline/promises.d.ts +++ /dev/null @@ -1,143 +0,0 @@ -/** - * The `readline/promise` module provides an API for reading lines of input from a Readable stream one line at a time. - * - * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/readline/promises.js) - * @since v17.0.0 - */ -declare module 'readline/promises' { - import { Interface as _Interface, ReadLineOptions, Completer, AsyncCompleter, Direction } from 'node:readline'; - import { Abortable } from 'node:events'; - - class Interface extends _Interface { - /** - * The rl.question() method displays the query by writing it to the output, waits for user input to be provided on input, - * then invokes the callback function passing the provided input as the first argument. - * - * When called, rl.question() will resume the input stream if it has been paused. - * - * If the readlinePromises.Interface was created with output set to null or undefined the query is not written. - * - * If the question is called after rl.close(), it returns a rejected promise. - * - * Example usage: - * - * ```js - * const answer = await rl.question('What is your favorite food? '); - * console.log(`Oh, so your favorite food is ${answer}`); - * ``` - * - * Using an AbortSignal to cancel a question. - * - * ```js - * const signal = AbortSignal.timeout(10_000); - * - * signal.addEventListener('abort', () => { - * console.log('The food question timed out'); - * }, { once: true }); - * - * const answer = await rl.question('What is your favorite food? ', { signal }); - * console.log(`Oh, so your favorite food is ${answer}`); - * ``` - * - * @since v17.0.0 - * @param query A statement or query to write to output, prepended to the prompt. - */ - question(query: string): Promise; - question(query: string, options: Abortable): Promise; - } - - class Readline { - /** - * @param stream A TTY stream. - */ - constructor(stream: NodeJS.WritableStream, options?: { autoCommit?: boolean }); - /** - * The `rl.clearLine()` method adds to the internal list of pending action an action that clears current line of the associated `stream` in a specified direction identified by `dir`. - * Call `rl.commit()` to see the effect of this method, unless `autoCommit: true` was passed to the constructor. - */ - clearLine(dir: Direction): this; - /** - * The `rl.clearScreenDown()` method adds to the internal list of pending action an action that clears the associated `stream` from the current position of the cursor down. - * Call `rl.commit()` to see the effect of this method, unless `autoCommit: true` was passed to the constructor. - */ - clearScreenDown(): this; - /** - * The `rl.commit()` method sends all the pending actions to the associated `stream` and clears the internal list of pending actions. - */ - commit(): Promise; - /** - * The `rl.cursorTo()` method adds to the internal list of pending action an action that moves cursor to the specified position in the associated `stream`. - * Call `rl.commit()` to see the effect of this method, unless `autoCommit: true` was passed to the constructor. - */ - cursorTo(x: number, y?: number): this; - /** - * The `rl.moveCursor()` method adds to the internal list of pending action an action that moves the cursor relative to its current position in the associated `stream`. - * Call `rl.commit()` to see the effect of this method, unless autoCommit: true was passed to the constructor. - */ - moveCursor(dx: number, dy: number): this; - /** - * The `rl.rollback()` method clears the internal list of pending actions without sending it to the associated `stream`. - */ - rollback(): this; - } - - /** - * The `readlinePromises.createInterface()` method creates a new `readlinePromises.Interface` instance. - * - * ```js - * const readlinePromises = require('node:readline/promises'); - * const rl = readlinePromises.createInterface({ - * input: process.stdin, - * output: process.stdout - * }); - * ``` - * - * Once the `readlinePromises.Interface` instance is created, the most common case is to listen for the `'line'` event: - * - * ```js - * rl.on('line', (line) => { - * console.log(`Received: ${line}`); - * }); - * ``` - * - * If `terminal` is `true` for this instance then the `output` stream will get the best compatibility if it defines an `output.columns` property, - * and emits a `'resize'` event on the `output`, if or when the columns ever change (`process.stdout` does this automatically when it is a TTY). - * - * ## Use of the `completer` function - * - * The `completer` function takes the current line entered by the user as an argument, and returns an `Array` with 2 entries: - * - * - An Array with matching entries for the completion. - * - The substring that was used for the matching. - * - * For instance: `[[substr1, substr2, ...], originalsubstring]`. - * - * ```js - * function completer(line) { - * const completions = '.help .error .exit .quit .q'.split(' '); - * const hits = completions.filter((c) => c.startsWith(line)); - * // Show all completions if none found - * return [hits.length ? hits : completions, line]; - * } - * ``` - * - * The `completer` function can also returns a `Promise`, or be asynchronous: - * - * ```js - * async function completer(linePartial) { - * await someAsyncWork(); - * return [['123'], linePartial]; - * } - * ``` - */ - function createInterface( - input: NodeJS.ReadableStream, - output?: NodeJS.WritableStream, - completer?: Completer | AsyncCompleter, - terminal?: boolean, - ): Interface; - function createInterface(options: ReadLineOptions): Interface; -} -declare module 'node:readline/promises' { - export * from 'readline/promises'; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/repl.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/repl.d.ts deleted file mode 100755 index be42ccc4..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/repl.d.ts +++ /dev/null @@ -1,424 +0,0 @@ -/** - * The `repl` module provides a Read-Eval-Print-Loop (REPL) implementation that - * is available both as a standalone program or includible in other applications. - * It can be accessed using: - * - * ```js - * const repl = require('repl'); - * ``` - * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/repl.js) - */ -declare module 'repl' { - import { Interface, Completer, AsyncCompleter } from 'node:readline'; - import { Context } from 'node:vm'; - import { InspectOptions } from 'node:util'; - interface ReplOptions { - /** - * The input prompt to display. - * @default "> " - */ - prompt?: string | undefined; - /** - * The `Readable` stream from which REPL input will be read. - * @default process.stdin - */ - input?: NodeJS.ReadableStream | undefined; - /** - * The `Writable` stream to which REPL output will be written. - * @default process.stdout - */ - output?: NodeJS.WritableStream | undefined; - /** - * If `true`, specifies that the output should be treated as a TTY terminal, and have - * ANSI/VT100 escape codes written to it. - * Default: checking the value of the `isTTY` property on the output stream upon - * instantiation. - */ - terminal?: boolean | undefined; - /** - * The function to be used when evaluating each given line of input. - * Default: an async wrapper for the JavaScript `eval()` function. An `eval` function can - * error with `repl.Recoverable` to indicate the input was incomplete and prompt for - * additional lines. - * - * @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_default_evaluation - * @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_custom_evaluation_functions - */ - eval?: REPLEval | undefined; - /** - * Defines if the repl prints output previews or not. - * @default `true` Always `false` in case `terminal` is falsy. - */ - preview?: boolean | undefined; - /** - * If `true`, specifies that the default `writer` function should include ANSI color - * styling to REPL output. If a custom `writer` function is provided then this has no - * effect. - * Default: the REPL instance's `terminal` value. - */ - useColors?: boolean | undefined; - /** - * If `true`, specifies that the default evaluation function will use the JavaScript - * `global` as the context as opposed to creating a new separate context for the REPL - * instance. The node CLI REPL sets this value to `true`. - * Default: `false`. - */ - useGlobal?: boolean | undefined; - /** - * If `true`, specifies that the default writer will not output the return value of a - * command if it evaluates to `undefined`. - * Default: `false`. - */ - ignoreUndefined?: boolean | undefined; - /** - * The function to invoke to format the output of each command before writing to `output`. - * Default: a wrapper for `util.inspect`. - * - * @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_customizing_repl_output - */ - writer?: REPLWriter | undefined; - /** - * An optional function used for custom Tab auto completion. - * - * @see https://nodejs.org/dist/latest-v11.x/docs/api/readline.html#readline_use_of_the_completer_function - */ - completer?: Completer | AsyncCompleter | undefined; - /** - * A flag that specifies whether the default evaluator executes all JavaScript commands in - * strict mode or default (sloppy) mode. - * Accepted values are: - * - `repl.REPL_MODE_SLOPPY` - evaluates expressions in sloppy mode. - * - `repl.REPL_MODE_STRICT` - evaluates expressions in strict mode. This is equivalent to - * prefacing every repl statement with `'use strict'`. - */ - replMode?: typeof REPL_MODE_SLOPPY | typeof REPL_MODE_STRICT | undefined; - /** - * Stop evaluating the current piece of code when `SIGINT` is received, i.e. `Ctrl+C` is - * pressed. This cannot be used together with a custom `eval` function. - * Default: `false`. - */ - breakEvalOnSigint?: boolean | undefined; - } - type REPLEval = (this: REPLServer, evalCmd: string, context: Context, file: string, cb: (err: Error | null, result: any) => void) => void; - type REPLWriter = (this: REPLServer, obj: any) => string; - /** - * This is the default "writer" value, if none is passed in the REPL options, - * and it can be overridden by custom print functions. - */ - const writer: REPLWriter & { - options: InspectOptions; - }; - type REPLCommandAction = (this: REPLServer, text: string) => void; - interface REPLCommand { - /** - * Help text to be displayed when `.help` is entered. - */ - help?: string | undefined; - /** - * The function to execute, optionally accepting a single string argument. - */ - action: REPLCommandAction; - } - /** - * Instances of `repl.REPLServer` are created using the {@link start} method - * or directly using the JavaScript `new` keyword. - * - * ```js - * const repl = require('repl'); - * - * const options = { useColors: true }; - * - * const firstInstance = repl.start(options); - * const secondInstance = new repl.REPLServer(options); - * ``` - * @since v0.1.91 - */ - class REPLServer extends Interface { - /** - * The `vm.Context` provided to the `eval` function to be used for JavaScript - * evaluation. - */ - readonly context: Context; - /** - * @deprecated since v14.3.0 - Use `input` instead. - */ - readonly inputStream: NodeJS.ReadableStream; - /** - * @deprecated since v14.3.0 - Use `output` instead. - */ - readonly outputStream: NodeJS.WritableStream; - /** - * The `Readable` stream from which REPL input will be read. - */ - readonly input: NodeJS.ReadableStream; - /** - * The `Writable` stream to which REPL output will be written. - */ - readonly output: NodeJS.WritableStream; - /** - * The commands registered via `replServer.defineCommand()`. - */ - readonly commands: NodeJS.ReadOnlyDict; - /** - * A value indicating whether the REPL is currently in "editor mode". - * - * @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_commands_and_special_keys - */ - readonly editorMode: boolean; - /** - * A value indicating whether the `_` variable has been assigned. - * - * @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_assignment_of_the_underscore_variable - */ - readonly underscoreAssigned: boolean; - /** - * The last evaluation result from the REPL (assigned to the `_` variable inside of the REPL). - * - * @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_assignment_of_the_underscore_variable - */ - readonly last: any; - /** - * A value indicating whether the `_error` variable has been assigned. - * - * @since v9.8.0 - * @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_assignment_of_the_underscore_variable - */ - readonly underscoreErrAssigned: boolean; - /** - * The last error raised inside the REPL (assigned to the `_error` variable inside of the REPL). - * - * @since v9.8.0 - * @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_assignment_of_the_underscore_variable - */ - readonly lastError: any; - /** - * Specified in the REPL options, this is the function to be used when evaluating each - * given line of input. If not specified in the REPL options, this is an async wrapper - * for the JavaScript `eval()` function. - */ - readonly eval: REPLEval; - /** - * Specified in the REPL options, this is a value indicating whether the default - * `writer` function should include ANSI color styling to REPL output. - */ - readonly useColors: boolean; - /** - * Specified in the REPL options, this is a value indicating whether the default `eval` - * function will use the JavaScript `global` as the context as opposed to creating a new - * separate context for the REPL instance. - */ - readonly useGlobal: boolean; - /** - * Specified in the REPL options, this is a value indicating whether the default `writer` - * function should output the result of a command if it evaluates to `undefined`. - */ - readonly ignoreUndefined: boolean; - /** - * Specified in the REPL options, this is the function to invoke to format the output of - * each command before writing to `outputStream`. If not specified in the REPL options, - * this will be a wrapper for `util.inspect`. - */ - readonly writer: REPLWriter; - /** - * Specified in the REPL options, this is the function to use for custom Tab auto-completion. - */ - readonly completer: Completer | AsyncCompleter; - /** - * Specified in the REPL options, this is a flag that specifies whether the default `eval` - * function should execute all JavaScript commands in strict mode or default (sloppy) mode. - * Possible values are: - * - `repl.REPL_MODE_SLOPPY` - evaluates expressions in sloppy mode. - * - `repl.REPL_MODE_STRICT` - evaluates expressions in strict mode. This is equivalent to - * prefacing every repl statement with `'use strict'`. - */ - readonly replMode: typeof REPL_MODE_SLOPPY | typeof REPL_MODE_STRICT; - /** - * NOTE: According to the documentation: - * - * > Instances of `repl.REPLServer` are created using the `repl.start()` method and - * > _should not_ be created directly using the JavaScript `new` keyword. - * - * `REPLServer` cannot be subclassed due to implementation specifics in NodeJS. - * - * @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_class_replserver - */ - private constructor(); - /** - * The `replServer.defineCommand()` method is used to add new `.`\-prefixed commands - * to the REPL instance. Such commands are invoked by typing a `.` followed by the`keyword`. The `cmd` is either a `Function` or an `Object` with the following - * properties: - * - * The following example shows two new commands added to the REPL instance: - * - * ```js - * const repl = require('repl'); - * - * const replServer = repl.start({ prompt: '> ' }); - * replServer.defineCommand('sayhello', { - * help: 'Say hello', - * action(name) { - * this.clearBufferedCommand(); - * console.log(`Hello, ${name}!`); - * this.displayPrompt(); - * } - * }); - * replServer.defineCommand('saybye', function saybye() { - * console.log('Goodbye!'); - * this.close(); - * }); - * ``` - * - * The new commands can then be used from within the REPL instance: - * - * ```console - * > .sayhello Node.js User - * Hello, Node.js User! - * > .saybye - * Goodbye! - * ``` - * @since v0.3.0 - * @param keyword The command keyword (_without_ a leading `.` character). - * @param cmd The function to invoke when the command is processed. - */ - defineCommand(keyword: string, cmd: REPLCommandAction | REPLCommand): void; - /** - * The `replServer.displayPrompt()` method readies the REPL instance for input - * from the user, printing the configured `prompt` to a new line in the `output`and resuming the `input` to accept new input. - * - * When multi-line input is being entered, an ellipsis is printed rather than the - * 'prompt'. - * - * When `preserveCursor` is `true`, the cursor placement will not be reset to `0`. - * - * The `replServer.displayPrompt` method is primarily intended to be called from - * within the action function for commands registered using the`replServer.defineCommand()` method. - * @since v0.1.91 - */ - displayPrompt(preserveCursor?: boolean): void; - /** - * The `replServer.clearBufferedCommand()` method clears any command that has been - * buffered but not yet executed. This method is primarily intended to be - * called from within the action function for commands registered using the`replServer.defineCommand()` method. - * @since v9.0.0 - */ - clearBufferedCommand(): void; - /** - * Initializes a history log file for the REPL instance. When executing the - * Node.js binary and using the command-line REPL, a history file is initialized - * by default. However, this is not the case when creating a REPL - * programmatically. Use this method to initialize a history log file when working - * with REPL instances programmatically. - * @since v11.10.0 - * @param historyPath the path to the history file - * @param callback called when history writes are ready or upon error - */ - setupHistory(path: string, callback: (err: Error | null, repl: this) => void): void; - /** - * events.EventEmitter - * 1. close - inherited from `readline.Interface` - * 2. line - inherited from `readline.Interface` - * 3. pause - inherited from `readline.Interface` - * 4. resume - inherited from `readline.Interface` - * 5. SIGCONT - inherited from `readline.Interface` - * 6. SIGINT - inherited from `readline.Interface` - * 7. SIGTSTP - inherited from `readline.Interface` - * 8. exit - * 9. reset - */ - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: 'close', listener: () => void): this; - addListener(event: 'line', listener: (input: string) => void): this; - addListener(event: 'pause', listener: () => void): this; - addListener(event: 'resume', listener: () => void): this; - addListener(event: 'SIGCONT', listener: () => void): this; - addListener(event: 'SIGINT', listener: () => void): this; - addListener(event: 'SIGTSTP', listener: () => void): this; - addListener(event: 'exit', listener: () => void): this; - addListener(event: 'reset', listener: (context: Context) => void): this; - emit(event: string | symbol, ...args: any[]): boolean; - emit(event: 'close'): boolean; - emit(event: 'line', input: string): boolean; - emit(event: 'pause'): boolean; - emit(event: 'resume'): boolean; - emit(event: 'SIGCONT'): boolean; - emit(event: 'SIGINT'): boolean; - emit(event: 'SIGTSTP'): boolean; - emit(event: 'exit'): boolean; - emit(event: 'reset', context: Context): boolean; - on(event: string, listener: (...args: any[]) => void): this; - on(event: 'close', listener: () => void): this; - on(event: 'line', listener: (input: string) => void): this; - on(event: 'pause', listener: () => void): this; - on(event: 'resume', listener: () => void): this; - on(event: 'SIGCONT', listener: () => void): this; - on(event: 'SIGINT', listener: () => void): this; - on(event: 'SIGTSTP', listener: () => void): this; - on(event: 'exit', listener: () => void): this; - on(event: 'reset', listener: (context: Context) => void): this; - once(event: string, listener: (...args: any[]) => void): this; - once(event: 'close', listener: () => void): this; - once(event: 'line', listener: (input: string) => void): this; - once(event: 'pause', listener: () => void): this; - once(event: 'resume', listener: () => void): this; - once(event: 'SIGCONT', listener: () => void): this; - once(event: 'SIGINT', listener: () => void): this; - once(event: 'SIGTSTP', listener: () => void): this; - once(event: 'exit', listener: () => void): this; - once(event: 'reset', listener: (context: Context) => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: 'close', listener: () => void): this; - prependListener(event: 'line', listener: (input: string) => void): this; - prependListener(event: 'pause', listener: () => void): this; - prependListener(event: 'resume', listener: () => void): this; - prependListener(event: 'SIGCONT', listener: () => void): this; - prependListener(event: 'SIGINT', listener: () => void): this; - prependListener(event: 'SIGTSTP', listener: () => void): this; - prependListener(event: 'exit', listener: () => void): this; - prependListener(event: 'reset', listener: (context: Context) => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: 'close', listener: () => void): this; - prependOnceListener(event: 'line', listener: (input: string) => void): this; - prependOnceListener(event: 'pause', listener: () => void): this; - prependOnceListener(event: 'resume', listener: () => void): this; - prependOnceListener(event: 'SIGCONT', listener: () => void): this; - prependOnceListener(event: 'SIGINT', listener: () => void): this; - prependOnceListener(event: 'SIGTSTP', listener: () => void): this; - prependOnceListener(event: 'exit', listener: () => void): this; - prependOnceListener(event: 'reset', listener: (context: Context) => void): this; - } - /** - * A flag passed in the REPL options. Evaluates expressions in sloppy mode. - */ - const REPL_MODE_SLOPPY: unique symbol; - /** - * A flag passed in the REPL options. Evaluates expressions in strict mode. - * This is equivalent to prefacing every repl statement with `'use strict'`. - */ - const REPL_MODE_STRICT: unique symbol; - /** - * The `repl.start()` method creates and starts a {@link REPLServer} instance. - * - * If `options` is a string, then it specifies the input prompt: - * - * ```js - * const repl = require('repl'); - * - * // a Unix style prompt - * repl.start('$ '); - * ``` - * @since v0.1.91 - */ - function start(options?: string | ReplOptions): REPLServer; - /** - * Indicates a recoverable error that a `REPLServer` can use to support multi-line input. - * - * @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_recoverable_errors - */ - class Recoverable extends SyntaxError { - err: Error; - constructor(err: Error); - } -} -declare module 'node:repl' { - export * from 'repl'; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/stream.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/stream.d.ts deleted file mode 100755 index a0df689e..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/stream.d.ts +++ /dev/null @@ -1,1340 +0,0 @@ -/** - * A stream is an abstract interface for working with streaming data in Node.js. - * The `stream` module provides an API for implementing the stream interface. - * - * There are many stream objects provided by Node.js. For instance, a `request to an HTTP server` and `process.stdout` are both stream instances. - * - * Streams can be readable, writable, or both. All streams are instances of `EventEmitter`. - * - * To access the `stream` module: - * - * ```js - * const stream = require('stream'); - * ``` - * - * The `stream` module is useful for creating new types of stream instances. It is - * usually not necessary to use the `stream` module to consume streams. - * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/stream.js) - */ -declare module 'stream' { - import { EventEmitter, Abortable } from 'node:events'; - import { Blob as NodeBlob } from "node:buffer"; - import * as streamPromises from 'node:stream/promises'; - import * as streamConsumers from 'node:stream/consumers'; - import * as streamWeb from 'node:stream/web'; - class internal extends EventEmitter { - pipe( - destination: T, - options?: { - end?: boolean | undefined; - } - ): T; - } - namespace internal { - class Stream extends internal { - constructor(opts?: ReadableOptions); - } - interface StreamOptions extends Abortable { - emitClose?: boolean | undefined; - highWaterMark?: number | undefined; - objectMode?: boolean | undefined; - construct?(this: T, callback: (error?: Error | null) => void): void; - destroy?(this: T, error: Error | null, callback: (error: Error | null) => void): void; - autoDestroy?: boolean | undefined; - } - interface ReadableOptions extends StreamOptions { - encoding?: BufferEncoding | undefined; - read?(this: Readable, size: number): void; - } - /** - * @since v0.9.4 - */ - class Readable extends Stream implements NodeJS.ReadableStream { - /** - * A utility method for creating Readable Streams out of iterators. - */ - static from(iterable: Iterable | AsyncIterable, options?: ReadableOptions): Readable; - /** - * A utility method for creating a `Readable` from a web `ReadableStream`. - * @since v17.0.0 - * @experimental - */ - static fromWeb(readableStream: streamWeb.ReadableStream, options?: Pick): Readable; - /** - * Returns whether the stream has been read from or cancelled. - * @since v16.8.0 - */ - static isDisturbed(stream: Readable | NodeJS.ReadableStream): boolean; - /** - * A utility method for creating a web `ReadableStream` from a `Readable`. - * @since v17.0.0 - * @experimental - */ - static toWeb(streamReadable: Readable): streamWeb.ReadableStream; - /** - * Returns whether the stream was destroyed or errored before emitting `'end'`. - * @since v16.8.0 - * @experimental - */ - readonly readableAborted: boolean; - /** - * Is `true` if it is safe to call `readable.read()`, which means - * the stream has not been destroyed or emitted `'error'` or `'end'`. - * @since v11.4.0 - */ - readable: boolean; - /** - * Returns whether `'data'` has been emitted. - * @since v16.7.0, v14.18.0 - * @experimental - */ - readonly readableDidRead: boolean; - /** - * Getter for the property `encoding` of a given `Readable` stream. The `encoding`property can be set using the `readable.setEncoding()` method. - * @since v12.7.0 - */ - readonly readableEncoding: BufferEncoding | null; - /** - * Becomes `true` when `'end'` event is emitted. - * @since v12.9.0 - */ - readonly readableEnded: boolean; - /** - * This property reflects the current state of a `Readable` stream as described - * in the `Three states` section. - * @since v9.4.0 - */ - readonly readableFlowing: boolean | null; - /** - * Returns the value of `highWaterMark` passed when creating this `Readable`. - * @since v9.3.0 - */ - readonly readableHighWaterMark: number; - /** - * This property contains the number of bytes (or objects) in the queue - * ready to be read. The value provides introspection data regarding - * the status of the `highWaterMark`. - * @since v9.4.0 - */ - readonly readableLength: number; - /** - * Getter for the property `objectMode` of a given `Readable` stream. - * @since v12.3.0 - */ - readonly readableObjectMode: boolean; - /** - * Is `true` after `readable.destroy()` has been called. - * @since v18.0.0 - */ - destroyed: boolean; - /** - * Is true after 'close' has been emitted. - * @since v8.0.0 - */ - readonly closed: boolean; - /** - * Returns error if the stream has been destroyed with an error. - * @since v18.0.0 - */ - readonly errored: Error | null; - constructor(opts?: ReadableOptions); - _construct?(callback: (error?: Error | null) => void): void; - _read(size: number): void; - /** - * The `readable.read()` method reads data out of the internal buffer and - * returns it. If no data is available to be read, `null` is returned. By default, - * the data is returned as a `Buffer` object unless an encoding has been - * specified using the `readable.setEncoding()` method or the stream is operating - * in object mode. - * - * The optional `size` argument specifies a specific number of bytes to read. If`size` bytes are not available to be read, `null` will be returned _unless_the stream has ended, in which - * case all of the data remaining in the internal - * buffer will be returned. - * - * If the `size` argument is not specified, all of the data contained in the - * internal buffer will be returned. - * - * The `size` argument must be less than or equal to 1 GiB. - * - * The `readable.read()` method should only be called on `Readable` streams - * operating in paused mode. In flowing mode, `readable.read()` is called - * automatically until the internal buffer is fully drained. - * - * ```js - * const readable = getReadableStreamSomehow(); - * - * // 'readable' may be triggered multiple times as data is buffered in - * readable.on('readable', () => { - * let chunk; - * console.log('Stream is readable (new data received in buffer)'); - * // Use a loop to make sure we read all currently available data - * while (null !== (chunk = readable.read())) { - * console.log(`Read ${chunk.length} bytes of data...`); - * } - * }); - * - * // 'end' will be triggered once when there is no more data available - * readable.on('end', () => { - * console.log('Reached end of stream.'); - * }); - * ``` - * - * Each call to `readable.read()` returns a chunk of data, or `null`. The chunks - * are not concatenated. A `while` loop is necessary to consume all data - * currently in the buffer. When reading a large file `.read()` may return `null`, - * having consumed all buffered content so far, but there is still more data to - * come not yet buffered. In this case a new `'readable'` event will be emitted - * when there is more data in the buffer. Finally the `'end'` event will be - * emitted when there is no more data to come. - * - * Therefore to read a file's whole contents from a `readable`, it is necessary - * to collect chunks across multiple `'readable'` events: - * - * ```js - * const chunks = []; - * - * readable.on('readable', () => { - * let chunk; - * while (null !== (chunk = readable.read())) { - * chunks.push(chunk); - * } - * }); - * - * readable.on('end', () => { - * const content = chunks.join(''); - * }); - * ``` - * - * A `Readable` stream in object mode will always return a single item from - * a call to `readable.read(size)`, regardless of the value of the`size` argument. - * - * If the `readable.read()` method returns a chunk of data, a `'data'` event will - * also be emitted. - * - * Calling {@link read} after the `'end'` event has - * been emitted will return `null`. No runtime error will be raised. - * @since v0.9.4 - * @param size Optional argument to specify how much data to read. - */ - read(size?: number): any; - /** - * The `readable.setEncoding()` method sets the character encoding for - * data read from the `Readable` stream. - * - * By default, no encoding is assigned and stream data will be returned as`Buffer` objects. Setting an encoding causes the stream data - * to be returned as strings of the specified encoding rather than as `Buffer`objects. For instance, calling `readable.setEncoding('utf8')` will cause the - * output data to be interpreted as UTF-8 data, and passed as strings. Calling`readable.setEncoding('hex')` will cause the data to be encoded in hexadecimal - * string format. - * - * The `Readable` stream will properly handle multi-byte characters delivered - * through the stream that would otherwise become improperly decoded if simply - * pulled from the stream as `Buffer` objects. - * - * ```js - * const readable = getReadableStreamSomehow(); - * readable.setEncoding('utf8'); - * readable.on('data', (chunk) => { - * assert.equal(typeof chunk, 'string'); - * console.log('Got %d characters of string data:', chunk.length); - * }); - * ``` - * @since v0.9.4 - * @param encoding The encoding to use. - */ - setEncoding(encoding: BufferEncoding): this; - /** - * The `readable.pause()` method will cause a stream in flowing mode to stop - * emitting `'data'` events, switching out of flowing mode. Any data that - * becomes available will remain in the internal buffer. - * - * ```js - * const readable = getReadableStreamSomehow(); - * readable.on('data', (chunk) => { - * console.log(`Received ${chunk.length} bytes of data.`); - * readable.pause(); - * console.log('There will be no additional data for 1 second.'); - * setTimeout(() => { - * console.log('Now data will start flowing again.'); - * readable.resume(); - * }, 1000); - * }); - * ``` - * - * The `readable.pause()` method has no effect if there is a `'readable'`event listener. - * @since v0.9.4 - */ - pause(): this; - /** - * The `readable.resume()` method causes an explicitly paused `Readable` stream to - * resume emitting `'data'` events, switching the stream into flowing mode. - * - * The `readable.resume()` method can be used to fully consume the data from a - * stream without actually processing any of that data: - * - * ```js - * getReadableStreamSomehow() - * .resume() - * .on('end', () => { - * console.log('Reached the end, but did not read anything.'); - * }); - * ``` - * - * The `readable.resume()` method has no effect if there is a `'readable'`event listener. - * @since v0.9.4 - */ - resume(): this; - /** - * The `readable.isPaused()` method returns the current operating state of the`Readable`. This is used primarily by the mechanism that underlies the`readable.pipe()` method. In most - * typical cases, there will be no reason to - * use this method directly. - * - * ```js - * const readable = new stream.Readable(); - * - * readable.isPaused(); // === false - * readable.pause(); - * readable.isPaused(); // === true - * readable.resume(); - * readable.isPaused(); // === false - * ``` - * @since v0.11.14 - */ - isPaused(): boolean; - /** - * The `readable.unpipe()` method detaches a `Writable` stream previously attached - * using the {@link pipe} method. - * - * If the `destination` is not specified, then _all_ pipes are detached. - * - * If the `destination` is specified, but no pipe is set up for it, then - * the method does nothing. - * - * ```js - * const fs = require('fs'); - * const readable = getReadableStreamSomehow(); - * const writable = fs.createWriteStream('file.txt'); - * // All the data from readable goes into 'file.txt', - * // but only for the first second. - * readable.pipe(writable); - * setTimeout(() => { - * console.log('Stop writing to file.txt.'); - * readable.unpipe(writable); - * console.log('Manually close the file stream.'); - * writable.end(); - * }, 1000); - * ``` - * @since v0.9.4 - * @param destination Optional specific stream to unpipe - */ - unpipe(destination?: NodeJS.WritableStream): this; - /** - * Passing `chunk` as `null` signals the end of the stream (EOF) and behaves the - * same as `readable.push(null)`, after which no more data can be written. The EOF - * signal is put at the end of the buffer and any buffered data will still be - * flushed. - * - * The `readable.unshift()` method pushes a chunk of data back into the internal - * buffer. This is useful in certain situations where a stream is being consumed by - * code that needs to "un-consume" some amount of data that it has optimistically - * pulled out of the source, so that the data can be passed on to some other party. - * - * The `stream.unshift(chunk)` method cannot be called after the `'end'` event - * has been emitted or a runtime error will be thrown. - * - * Developers using `stream.unshift()` often should consider switching to - * use of a `Transform` stream instead. See the `API for stream implementers` section for more information. - * - * ```js - * // Pull off a header delimited by \n\n. - * // Use unshift() if we get too much. - * // Call the callback with (error, header, stream). - * const { StringDecoder } = require('string_decoder'); - * function parseHeader(stream, callback) { - * stream.on('error', callback); - * stream.on('readable', onReadable); - * const decoder = new StringDecoder('utf8'); - * let header = ''; - * function onReadable() { - * let chunk; - * while (null !== (chunk = stream.read())) { - * const str = decoder.write(chunk); - * if (str.includes('\n\n')) { - * // Found the header boundary. - * const split = str.split(/\n\n/); - * header += split.shift(); - * const remaining = split.join('\n\n'); - * const buf = Buffer.from(remaining, 'utf8'); - * stream.removeListener('error', callback); - * // Remove the 'readable' listener before unshifting. - * stream.removeListener('readable', onReadable); - * if (buf.length) - * stream.unshift(buf); - * // Now the body of the message can be read from the stream. - * callback(null, header, stream); - * return; - * } - * // Still reading the header. - * header += str; - * } - * } - * } - * ``` - * - * Unlike {@link push}, `stream.unshift(chunk)` will not - * end the reading process by resetting the internal reading state of the stream. - * This can cause unexpected results if `readable.unshift()` is called during a - * read (i.e. from within a {@link _read} implementation on a - * custom stream). Following the call to `readable.unshift()` with an immediate {@link push} will reset the reading state appropriately, - * however it is best to simply avoid calling `readable.unshift()` while in the - * process of performing a read. - * @since v0.9.11 - * @param chunk Chunk of data to unshift onto the read queue. For streams not operating in object mode, `chunk` must be a string, `Buffer`, `Uint8Array` or `null`. For object mode - * streams, `chunk` may be any JavaScript value. - * @param encoding Encoding of string chunks. Must be a valid `Buffer` encoding, such as `'utf8'` or `'ascii'`. - */ - unshift(chunk: any, encoding?: BufferEncoding): void; - /** - * Prior to Node.js 0.10, streams did not implement the entire `stream` module API - * as it is currently defined. (See `Compatibility` for more information.) - * - * When using an older Node.js library that emits `'data'` events and has a {@link pause} method that is advisory only, the`readable.wrap()` method can be used to create a `Readable` - * stream that uses - * the old stream as its data source. - * - * It will rarely be necessary to use `readable.wrap()` but the method has been - * provided as a convenience for interacting with older Node.js applications and - * libraries. - * - * ```js - * const { OldReader } = require('./old-api-module.js'); - * const { Readable } = require('stream'); - * const oreader = new OldReader(); - * const myReader = new Readable().wrap(oreader); - * - * myReader.on('readable', () => { - * myReader.read(); // etc. - * }); - * ``` - * @since v0.9.4 - * @param stream An "old style" readable stream - */ - wrap(stream: NodeJS.ReadableStream): this; - push(chunk: any, encoding?: BufferEncoding): boolean; - _destroy(error: Error | null, callback: (error?: Error | null) => void): void; - /** - * Destroy the stream. Optionally emit an `'error'` event, and emit a `'close'`event (unless `emitClose` is set to `false`). After this call, the readable - * stream will release any internal resources and subsequent calls to `push()`will be ignored. - * - * Once `destroy()` has been called any further calls will be a no-op and no - * further errors except from `_destroy()` may be emitted as `'error'`. - * - * Implementors should not override this method, but instead implement `readable._destroy()`. - * @since v8.0.0 - * @param error Error which will be passed as payload in `'error'` event - */ - destroy(error?: Error): this; - /** - * Event emitter - * The defined events on documents including: - * 1. close - * 2. data - * 3. end - * 4. error - * 5. pause - * 6. readable - * 7. resume - */ - addListener(event: 'close', listener: () => void): this; - addListener(event: 'data', listener: (chunk: any) => void): this; - addListener(event: 'end', listener: () => void): this; - addListener(event: 'error', listener: (err: Error) => void): this; - addListener(event: 'pause', listener: () => void): this; - addListener(event: 'readable', listener: () => void): this; - addListener(event: 'resume', listener: () => void): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - emit(event: 'close'): boolean; - emit(event: 'data', chunk: any): boolean; - emit(event: 'end'): boolean; - emit(event: 'error', err: Error): boolean; - emit(event: 'pause'): boolean; - emit(event: 'readable'): boolean; - emit(event: 'resume'): boolean; - emit(event: string | symbol, ...args: any[]): boolean; - on(event: 'close', listener: () => void): this; - on(event: 'data', listener: (chunk: any) => void): this; - on(event: 'end', listener: () => void): this; - on(event: 'error', listener: (err: Error) => void): this; - on(event: 'pause', listener: () => void): this; - on(event: 'readable', listener: () => void): this; - on(event: 'resume', listener: () => void): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once(event: 'close', listener: () => void): this; - once(event: 'data', listener: (chunk: any) => void): this; - once(event: 'end', listener: () => void): this; - once(event: 'error', listener: (err: Error) => void): this; - once(event: 'pause', listener: () => void): this; - once(event: 'readable', listener: () => void): this; - once(event: 'resume', listener: () => void): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener(event: 'close', listener: () => void): this; - prependListener(event: 'data', listener: (chunk: any) => void): this; - prependListener(event: 'end', listener: () => void): this; - prependListener(event: 'error', listener: (err: Error) => void): this; - prependListener(event: 'pause', listener: () => void): this; - prependListener(event: 'readable', listener: () => void): this; - prependListener(event: 'resume', listener: () => void): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - prependOnceListener(event: 'close', listener: () => void): this; - prependOnceListener(event: 'data', listener: (chunk: any) => void): this; - prependOnceListener(event: 'end', listener: () => void): this; - prependOnceListener(event: 'error', listener: (err: Error) => void): this; - prependOnceListener(event: 'pause', listener: () => void): this; - prependOnceListener(event: 'readable', listener: () => void): this; - prependOnceListener(event: 'resume', listener: () => void): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - removeListener(event: 'close', listener: () => void): this; - removeListener(event: 'data', listener: (chunk: any) => void): this; - removeListener(event: 'end', listener: () => void): this; - removeListener(event: 'error', listener: (err: Error) => void): this; - removeListener(event: 'pause', listener: () => void): this; - removeListener(event: 'readable', listener: () => void): this; - removeListener(event: 'resume', listener: () => void): this; - removeListener(event: string | symbol, listener: (...args: any[]) => void): this; - [Symbol.asyncIterator](): AsyncIterableIterator; - } - interface WritableOptions extends StreamOptions { - decodeStrings?: boolean | undefined; - defaultEncoding?: BufferEncoding | undefined; - write?(this: Writable, chunk: any, encoding: BufferEncoding, callback: (error?: Error | null) => void): void; - writev?( - this: Writable, - chunks: Array<{ - chunk: any; - encoding: BufferEncoding; - }>, - callback: (error?: Error | null) => void - ): void; - final?(this: Writable, callback: (error?: Error | null) => void): void; - } - /** - * @since v0.9.4 - */ - class Writable extends Stream implements NodeJS.WritableStream { - /** - * A utility method for creating a `Writable` from a web `WritableStream`. - * @since v17.0.0 - * @experimental - */ - static fromWeb(writableStream: streamWeb.WritableStream, options?: Pick): Writable; - /** - * A utility method for creating a web `WritableStream` from a `Writable`. - * @since v17.0.0 - * @experimental - */ - static toWeb(streamWritable: Writable): streamWeb.WritableStream; - /** - * Is `true` if it is safe to call `writable.write()`, which means - * the stream has not been destroyed, errored or ended. - * @since v11.4.0 - */ - readonly writable: boolean; - /** - * Is `true` after `writable.end()` has been called. This property - * does not indicate whether the data has been flushed, for this use `writable.writableFinished` instead. - * @since v12.9.0 - */ - readonly writableEnded: boolean; - /** - * Is set to `true` immediately before the `'finish'` event is emitted. - * @since v12.6.0 - */ - readonly writableFinished: boolean; - /** - * Return the value of `highWaterMark` passed when creating this `Writable`. - * @since v9.3.0 - */ - readonly writableHighWaterMark: number; - /** - * This property contains the number of bytes (or objects) in the queue - * ready to be written. The value provides introspection data regarding - * the status of the `highWaterMark`. - * @since v9.4.0 - */ - readonly writableLength: number; - /** - * Getter for the property `objectMode` of a given `Writable` stream. - * @since v12.3.0 - */ - readonly writableObjectMode: boolean; - /** - * Number of times `writable.uncork()` needs to be - * called in order to fully uncork the stream. - * @since v13.2.0, v12.16.0 - */ - readonly writableCorked: number; - /** - * Is `true` after `writable.destroy()` has been called. - * @since v8.0.0 - */ - destroyed: boolean; - /** - * Is true after 'close' has been emitted. - * @since v8.0.0 - */ - readonly closed: boolean; - /** - * Returns error if the stream has been destroyed with an error. - * @since v18.0.0 - */ - readonly errored: Error | null; - /** - * Is `true` if the stream's buffer has been full and stream will emit 'drain'. - * @since v15.2.0, v14.17.0 - */ - readonly writableNeedDrain: boolean; - constructor(opts?: WritableOptions); - _write(chunk: any, encoding: BufferEncoding, callback: (error?: Error | null) => void): void; - _writev?( - chunks: Array<{ - chunk: any; - encoding: BufferEncoding; - }>, - callback: (error?: Error | null) => void - ): void; - _construct?(callback: (error?: Error | null) => void): void; - _destroy(error: Error | null, callback: (error?: Error | null) => void): void; - _final(callback: (error?: Error | null) => void): void; - /** - * The `writable.write()` method writes some data to the stream, and calls the - * supplied `callback` once the data has been fully handled. If an error - * occurs, the `callback` will be called with the error as its - * first argument. The `callback` is called asynchronously and before `'error'` is - * emitted. - * - * The return value is `true` if the internal buffer is less than the`highWaterMark` configured when the stream was created after admitting `chunk`. - * If `false` is returned, further attempts to write data to the stream should - * stop until the `'drain'` event is emitted. - * - * While a stream is not draining, calls to `write()` will buffer `chunk`, and - * return false. Once all currently buffered chunks are drained (accepted for - * delivery by the operating system), the `'drain'` event will be emitted. - * Once `write()` returns false, do not write more chunks - * until the `'drain'` event is emitted. While calling `write()` on a stream that - * is not draining is allowed, Node.js will buffer all written chunks until - * maximum memory usage occurs, at which point it will abort unconditionally. - * Even before it aborts, high memory usage will cause poor garbage collector - * performance and high RSS (which is not typically released back to the system, - * even after the memory is no longer required). Since TCP sockets may never - * drain if the remote peer does not read the data, writing a socket that is - * not draining may lead to a remotely exploitable vulnerability. - * - * Writing data while the stream is not draining is particularly - * problematic for a `Transform`, because the `Transform` streams are paused - * by default until they are piped or a `'data'` or `'readable'` event handler - * is added. - * - * If the data to be written can be generated or fetched on demand, it is - * recommended to encapsulate the logic into a `Readable` and use {@link pipe}. However, if calling `write()` is preferred, it is - * possible to respect backpressure and avoid memory issues using the `'drain'` event: - * - * ```js - * function write(data, cb) { - * if (!stream.write(data)) { - * stream.once('drain', cb); - * } else { - * process.nextTick(cb); - * } - * } - * - * // Wait for cb to be called before doing any other write. - * write('hello', () => { - * console.log('Write completed, do more writes now.'); - * }); - * ``` - * - * A `Writable` stream in object mode will always ignore the `encoding` argument. - * @since v0.9.4 - * @param chunk Optional data to write. For streams not operating in object mode, `chunk` must be a string, `Buffer` or `Uint8Array`. For object mode streams, `chunk` may be any - * JavaScript value other than `null`. - * @param [encoding='utf8'] The encoding, if `chunk` is a string. - * @param callback Callback for when this chunk of data is flushed. - * @return `false` if the stream wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`. - */ - write(chunk: any, callback?: (error: Error | null | undefined) => void): boolean; - write(chunk: any, encoding: BufferEncoding, callback?: (error: Error | null | undefined) => void): boolean; - /** - * The `writable.setDefaultEncoding()` method sets the default `encoding` for a `Writable` stream. - * @since v0.11.15 - * @param encoding The new default encoding - */ - setDefaultEncoding(encoding: BufferEncoding): this; - /** - * Calling the `writable.end()` method signals that no more data will be written - * to the `Writable`. The optional `chunk` and `encoding` arguments allow one - * final additional chunk of data to be written immediately before closing the - * stream. - * - * Calling the {@link write} method after calling {@link end} will raise an error. - * - * ```js - * // Write 'hello, ' and then end with 'world!'. - * const fs = require('fs'); - * const file = fs.createWriteStream('example.txt'); - * file.write('hello, '); - * file.end('world!'); - * // Writing more now is not allowed! - * ``` - * @since v0.9.4 - * @param chunk Optional data to write. For streams not operating in object mode, `chunk` must be a string, `Buffer` or `Uint8Array`. For object mode streams, `chunk` may be any - * JavaScript value other than `null`. - * @param encoding The encoding if `chunk` is a string - * @param callback Callback for when the stream is finished. - */ - end(cb?: () => void): this; - end(chunk: any, cb?: () => void): this; - end(chunk: any, encoding: BufferEncoding, cb?: () => void): this; - /** - * The `writable.cork()` method forces all written data to be buffered in memory. - * The buffered data will be flushed when either the {@link uncork} or {@link end} methods are called. - * - * The primary intent of `writable.cork()` is to accommodate a situation in which - * several small chunks are written to the stream in rapid succession. Instead of - * immediately forwarding them to the underlying destination, `writable.cork()`buffers all the chunks until `writable.uncork()` is called, which will pass them - * all to `writable._writev()`, if present. This prevents a head-of-line blocking - * situation where data is being buffered while waiting for the first small chunk - * to be processed. However, use of `writable.cork()` without implementing`writable._writev()` may have an adverse effect on throughput. - * - * See also: `writable.uncork()`, `writable._writev()`. - * @since v0.11.2 - */ - cork(): void; - /** - * The `writable.uncork()` method flushes all data buffered since {@link cork} was called. - * - * When using `writable.cork()` and `writable.uncork()` to manage the buffering - * of writes to a stream, defer calls to `writable.uncork()` using`process.nextTick()`. Doing so allows batching of all`writable.write()` calls that occur within a given Node.js event - * loop phase. - * - * ```js - * stream.cork(); - * stream.write('some '); - * stream.write('data '); - * process.nextTick(() => stream.uncork()); - * ``` - * - * If the `writable.cork()` method is called multiple times on a stream, the - * same number of calls to `writable.uncork()` must be called to flush the buffered - * data. - * - * ```js - * stream.cork(); - * stream.write('some '); - * stream.cork(); - * stream.write('data '); - * process.nextTick(() => { - * stream.uncork(); - * // The data will not be flushed until uncork() is called a second time. - * stream.uncork(); - * }); - * ``` - * - * See also: `writable.cork()`. - * @since v0.11.2 - */ - uncork(): void; - /** - * Destroy the stream. Optionally emit an `'error'` event, and emit a `'close'`event (unless `emitClose` is set to `false`). After this call, the writable - * stream has ended and subsequent calls to `write()` or `end()` will result in - * an `ERR_STREAM_DESTROYED` error. - * This is a destructive and immediate way to destroy a stream. Previous calls to`write()` may not have drained, and may trigger an `ERR_STREAM_DESTROYED` error. - * Use `end()` instead of destroy if data should flush before close, or wait for - * the `'drain'` event before destroying the stream. - * - * Once `destroy()` has been called any further calls will be a no-op and no - * further errors except from `_destroy()` may be emitted as `'error'`. - * - * Implementors should not override this method, - * but instead implement `writable._destroy()`. - * @since v8.0.0 - * @param error Optional, an error to emit with `'error'` event. - */ - destroy(error?: Error): this; - /** - * Event emitter - * The defined events on documents including: - * 1. close - * 2. drain - * 3. error - * 4. finish - * 5. pipe - * 6. unpipe - */ - addListener(event: 'close', listener: () => void): this; - addListener(event: 'drain', listener: () => void): this; - addListener(event: 'error', listener: (err: Error) => void): this; - addListener(event: 'finish', listener: () => void): this; - addListener(event: 'pipe', listener: (src: Readable) => void): this; - addListener(event: 'unpipe', listener: (src: Readable) => void): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - emit(event: 'close'): boolean; - emit(event: 'drain'): boolean; - emit(event: 'error', err: Error): boolean; - emit(event: 'finish'): boolean; - emit(event: 'pipe', src: Readable): boolean; - emit(event: 'unpipe', src: Readable): boolean; - emit(event: string | symbol, ...args: any[]): boolean; - on(event: 'close', listener: () => void): this; - on(event: 'drain', listener: () => void): this; - on(event: 'error', listener: (err: Error) => void): this; - on(event: 'finish', listener: () => void): this; - on(event: 'pipe', listener: (src: Readable) => void): this; - on(event: 'unpipe', listener: (src: Readable) => void): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once(event: 'close', listener: () => void): this; - once(event: 'drain', listener: () => void): this; - once(event: 'error', listener: (err: Error) => void): this; - once(event: 'finish', listener: () => void): this; - once(event: 'pipe', listener: (src: Readable) => void): this; - once(event: 'unpipe', listener: (src: Readable) => void): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener(event: 'close', listener: () => void): this; - prependListener(event: 'drain', listener: () => void): this; - prependListener(event: 'error', listener: (err: Error) => void): this; - prependListener(event: 'finish', listener: () => void): this; - prependListener(event: 'pipe', listener: (src: Readable) => void): this; - prependListener(event: 'unpipe', listener: (src: Readable) => void): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - prependOnceListener(event: 'close', listener: () => void): this; - prependOnceListener(event: 'drain', listener: () => void): this; - prependOnceListener(event: 'error', listener: (err: Error) => void): this; - prependOnceListener(event: 'finish', listener: () => void): this; - prependOnceListener(event: 'pipe', listener: (src: Readable) => void): this; - prependOnceListener(event: 'unpipe', listener: (src: Readable) => void): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - removeListener(event: 'close', listener: () => void): this; - removeListener(event: 'drain', listener: () => void): this; - removeListener(event: 'error', listener: (err: Error) => void): this; - removeListener(event: 'finish', listener: () => void): this; - removeListener(event: 'pipe', listener: (src: Readable) => void): this; - removeListener(event: 'unpipe', listener: (src: Readable) => void): this; - removeListener(event: string | symbol, listener: (...args: any[]) => void): this; - } - interface DuplexOptions extends ReadableOptions, WritableOptions { - allowHalfOpen?: boolean | undefined; - readableObjectMode?: boolean | undefined; - writableObjectMode?: boolean | undefined; - readableHighWaterMark?: number | undefined; - writableHighWaterMark?: number | undefined; - writableCorked?: number | undefined; - construct?(this: Duplex, callback: (error?: Error | null) => void): void; - read?(this: Duplex, size: number): void; - write?(this: Duplex, chunk: any, encoding: BufferEncoding, callback: (error?: Error | null) => void): void; - writev?( - this: Duplex, - chunks: Array<{ - chunk: any; - encoding: BufferEncoding; - }>, - callback: (error?: Error | null) => void - ): void; - final?(this: Duplex, callback: (error?: Error | null) => void): void; - destroy?(this: Duplex, error: Error | null, callback: (error: Error | null) => void): void; - } - /** - * Duplex streams are streams that implement both the `Readable` and `Writable` interfaces. - * - * Examples of `Duplex` streams include: - * - * * `TCP sockets` - * * `zlib streams` - * * `crypto streams` - * @since v0.9.4 - */ - class Duplex extends Readable implements Writable { - readonly writable: boolean; - readonly writableEnded: boolean; - readonly writableFinished: boolean; - readonly writableHighWaterMark: number; - readonly writableLength: number; - readonly writableObjectMode: boolean; - readonly writableCorked: number; - readonly writableNeedDrain: boolean; - readonly closed: boolean; - readonly errored: Error | null; - /** - * If `false` then the stream will automatically end the writable side when the - * readable side ends. Set initially by the `allowHalfOpen` constructor option, - * which defaults to `false`. - * - * This can be changed manually to change the half-open behavior of an existing`Duplex` stream instance, but must be changed before the `'end'` event is - * emitted. - * @since v0.9.4 - */ - allowHalfOpen: boolean; - constructor(opts?: DuplexOptions); - /** - * A utility method for creating duplex streams. - * - * - `Stream` converts writable stream into writable `Duplex` and readable stream - * to `Duplex`. - * - `Blob` converts into readable `Duplex`. - * - `string` converts into readable `Duplex`. - * - `ArrayBuffer` converts into readable `Duplex`. - * - `AsyncIterable` converts into a readable `Duplex`. Cannot yield `null`. - * - `AsyncGeneratorFunction` converts into a readable/writable transform - * `Duplex`. Must take a source `AsyncIterable` as first parameter. Cannot yield - * `null`. - * - `AsyncFunction` converts into a writable `Duplex`. Must return - * either `null` or `undefined` - * - `Object ({ writable, readable })` converts `readable` and - * `writable` into `Stream` and then combines them into `Duplex` where the - * `Duplex` will write to the `writable` and read from the `readable`. - * - `Promise` converts into readable `Duplex`. Value `null` is ignored. - * - * @since v16.8.0 - */ - static from(src: Stream | NodeBlob | ArrayBuffer | string | Iterable | AsyncIterable | AsyncGeneratorFunction | Promise | Object): Duplex; - _write(chunk: any, encoding: BufferEncoding, callback: (error?: Error | null) => void): void; - _writev?( - chunks: Array<{ - chunk: any; - encoding: BufferEncoding; - }>, - callback: (error?: Error | null) => void - ): void; - _destroy(error: Error | null, callback: (error: Error | null) => void): void; - _final(callback: (error?: Error | null) => void): void; - write(chunk: any, encoding?: BufferEncoding, cb?: (error: Error | null | undefined) => void): boolean; - write(chunk: any, cb?: (error: Error | null | undefined) => void): boolean; - setDefaultEncoding(encoding: BufferEncoding): this; - end(cb?: () => void): this; - end(chunk: any, cb?: () => void): this; - end(chunk: any, encoding?: BufferEncoding, cb?: () => void): this; - cork(): void; - uncork(): void; - } - type TransformCallback = (error?: Error | null, data?: any) => void; - interface TransformOptions extends DuplexOptions { - construct?(this: Transform, callback: (error?: Error | null) => void): void; - read?(this: Transform, size: number): void; - write?(this: Transform, chunk: any, encoding: BufferEncoding, callback: (error?: Error | null) => void): void; - writev?( - this: Transform, - chunks: Array<{ - chunk: any; - encoding: BufferEncoding; - }>, - callback: (error?: Error | null) => void - ): void; - final?(this: Transform, callback: (error?: Error | null) => void): void; - destroy?(this: Transform, error: Error | null, callback: (error: Error | null) => void): void; - transform?(this: Transform, chunk: any, encoding: BufferEncoding, callback: TransformCallback): void; - flush?(this: Transform, callback: TransformCallback): void; - } - /** - * Transform streams are `Duplex` streams where the output is in some way - * related to the input. Like all `Duplex` streams, `Transform` streams - * implement both the `Readable` and `Writable` interfaces. - * - * Examples of `Transform` streams include: - * - * * `zlib streams` - * * `crypto streams` - * @since v0.9.4 - */ - class Transform extends Duplex { - constructor(opts?: TransformOptions); - _transform(chunk: any, encoding: BufferEncoding, callback: TransformCallback): void; - _flush(callback: TransformCallback): void; - } - /** - * The `stream.PassThrough` class is a trivial implementation of a `Transform` stream that simply passes the input bytes across to the output. Its purpose is - * primarily for examples and testing, but there are some use cases where`stream.PassThrough` is useful as a building block for novel sorts of streams. - */ - class PassThrough extends Transform {} - /** - * Attaches an AbortSignal to a readable or writeable stream. This lets code - * control stream destruction using an `AbortController`. - * - * Calling `abort` on the `AbortController` corresponding to the passed`AbortSignal` will behave the same way as calling `.destroy(new AbortError())`on the stream. - * - * ```js - * const fs = require('fs'); - * - * const controller = new AbortController(); - * const read = addAbortSignal( - * controller.signal, - * fs.createReadStream(('object.json')) - * ); - * // Later, abort the operation closing the stream - * controller.abort(); - * ``` - * - * Or using an `AbortSignal` with a readable stream as an async iterable: - * - * ```js - * const controller = new AbortController(); - * setTimeout(() => controller.abort(), 10_000); // set a timeout - * const stream = addAbortSignal( - * controller.signal, - * fs.createReadStream(('object.json')) - * ); - * (async () => { - * try { - * for await (const chunk of stream) { - * await process(chunk); - * } - * } catch (e) { - * if (e.name === 'AbortError') { - * // The operation was cancelled - * } else { - * throw e; - * } - * } - * })(); - * ``` - * @since v15.4.0 - * @param signal A signal representing possible cancellation - * @param stream a stream to attach a signal to - */ - function addAbortSignal(signal: AbortSignal, stream: T): T; - interface FinishedOptions extends Abortable { - error?: boolean | undefined; - readable?: boolean | undefined; - writable?: boolean | undefined; - } - /** - * A function to get notified when a stream is no longer readable, writable - * or has experienced an error or a premature close event. - * - * ```js - * const { finished } = require('stream'); - * - * const rs = fs.createReadStream('archive.tar'); - * - * finished(rs, (err) => { - * if (err) { - * console.error('Stream failed.', err); - * } else { - * console.log('Stream is done reading.'); - * } - * }); - * - * rs.resume(); // Drain the stream. - * ``` - * - * Especially useful in error handling scenarios where a stream is destroyed - * prematurely (like an aborted HTTP request), and will not emit `'end'`or `'finish'`. - * - * The `finished` API provides promise version: - * - * ```js - * const { finished } = require('stream/promises'); - * - * const rs = fs.createReadStream('archive.tar'); - * - * async function run() { - * await finished(rs); - * console.log('Stream is done reading.'); - * } - * - * run().catch(console.error); - * rs.resume(); // Drain the stream. - * ``` - * - * `stream.finished()` leaves dangling event listeners (in particular`'error'`, `'end'`, `'finish'` and `'close'`) after `callback` has been - * invoked. The reason for this is so that unexpected `'error'` events (due to - * incorrect stream implementations) do not cause unexpected crashes. - * If this is unwanted behavior then the returned cleanup function needs to be - * invoked in the callback: - * - * ```js - * const cleanup = finished(rs, (err) => { - * cleanup(); - * // ... - * }); - * ``` - * @since v10.0.0 - * @param stream A readable and/or writable stream. - * @param callback A callback function that takes an optional error argument. - * @return A cleanup function which removes all registered listeners. - */ - function finished(stream: NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream, options: FinishedOptions, callback: (err?: NodeJS.ErrnoException | null) => void): () => void; - function finished(stream: NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream, callback: (err?: NodeJS.ErrnoException | null) => void): () => void; - namespace finished { - function __promisify__(stream: NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream, options?: FinishedOptions): Promise; - } - type PipelineSourceFunction = () => Iterable | AsyncIterable; - type PipelineSource = Iterable | AsyncIterable | NodeJS.ReadableStream | PipelineSourceFunction; - type PipelineTransform, U> = - | NodeJS.ReadWriteStream - | ((source: S extends (...args: any[]) => Iterable | AsyncIterable ? AsyncIterable : S) => AsyncIterable); - type PipelineTransformSource = PipelineSource | PipelineTransform; - type PipelineDestinationIterableFunction = (source: AsyncIterable) => AsyncIterable; - type PipelineDestinationPromiseFunction = (source: AsyncIterable) => Promise

; - type PipelineDestination, P> = S extends PipelineTransformSource - ? NodeJS.WritableStream | PipelineDestinationIterableFunction | PipelineDestinationPromiseFunction - : never; - type PipelineCallback> = S extends PipelineDestinationPromiseFunction - ? (err: NodeJS.ErrnoException | null, value: P) => void - : (err: NodeJS.ErrnoException | null) => void; - type PipelinePromise> = S extends PipelineDestinationPromiseFunction ? Promise

: Promise; - interface PipelineOptions { - signal: AbortSignal; - } - /** - * A module method to pipe between streams and generators forwarding errors and - * properly cleaning up and provide a callback when the pipeline is complete. - * - * ```js - * const { pipeline } = require('stream'); - * const fs = require('fs'); - * const zlib = require('zlib'); - * - * // Use the pipeline API to easily pipe a series of streams - * // together and get notified when the pipeline is fully done. - * - * // A pipeline to gzip a potentially huge tar file efficiently: - * - * pipeline( - * fs.createReadStream('archive.tar'), - * zlib.createGzip(), - * fs.createWriteStream('archive.tar.gz'), - * (err) => { - * if (err) { - * console.error('Pipeline failed.', err); - * } else { - * console.log('Pipeline succeeded.'); - * } - * } - * ); - * ``` - * - * The `pipeline` API provides a promise version, which can also - * receive an options argument as the last parameter with a`signal` `AbortSignal` property. When the signal is aborted,`destroy` will be called on the underlying pipeline, with - * an`AbortError`. - * - * ```js - * const { pipeline } = require('stream/promises'); - * - * async function run() { - * await pipeline( - * fs.createReadStream('archive.tar'), - * zlib.createGzip(), - * fs.createWriteStream('archive.tar.gz') - * ); - * console.log('Pipeline succeeded.'); - * } - * - * run().catch(console.error); - * ``` - * - * To use an `AbortSignal`, pass it inside an options object, - * as the last argument: - * - * ```js - * const { pipeline } = require('stream/promises'); - * - * async function run() { - * const ac = new AbortController(); - * const signal = ac.signal; - * - * setTimeout(() => ac.abort(), 1); - * await pipeline( - * fs.createReadStream('archive.tar'), - * zlib.createGzip(), - * fs.createWriteStream('archive.tar.gz'), - * { signal }, - * ); - * } - * - * run().catch(console.error); // AbortError - * ``` - * - * The `pipeline` API also supports async generators: - * - * ```js - * const { pipeline } = require('stream/promises'); - * const fs = require('fs'); - * - * async function run() { - * await pipeline( - * fs.createReadStream('lowercase.txt'), - * async function* (source, { signal }) { - * source.setEncoding('utf8'); // Work with strings rather than `Buffer`s. - * for await (const chunk of source) { - * yield await processChunk(chunk, { signal }); - * } - * }, - * fs.createWriteStream('uppercase.txt') - * ); - * console.log('Pipeline succeeded.'); - * } - * - * run().catch(console.error); - * ``` - * - * Remember to handle the `signal` argument passed into the async generator. - * Especially in the case where the async generator is the source for the - * pipeline (i.e. first argument) or the pipeline will never complete. - * - * ```js - * const { pipeline } = require('stream/promises'); - * const fs = require('fs'); - * - * async function run() { - * await pipeline( - * async function* ({ signal }) { - * await someLongRunningfn({ signal }); - * yield 'asd'; - * }, - * fs.createWriteStream('uppercase.txt') - * ); - * console.log('Pipeline succeeded.'); - * } - * - * run().catch(console.error); - * ``` - * - * `stream.pipeline()` will call `stream.destroy(err)` on all streams except: - * - * * `Readable` streams which have emitted `'end'` or `'close'`. - * * `Writable` streams which have emitted `'finish'` or `'close'`. - * - * `stream.pipeline()` leaves dangling event listeners on the streams - * after the `callback` has been invoked. In the case of reuse of streams after - * failure, this can cause event listener leaks and swallowed errors. If the last - * stream is readable, dangling event listeners will be removed so that the last - * stream can be consumed later. - * - * `stream.pipeline()` closes all the streams when an error is raised. - * The `IncomingRequest` usage with `pipeline` could lead to an unexpected behavior - * once it would destroy the socket without sending the expected response. - * See the example below: - * - * ```js - * const fs = require('fs'); - * const http = require('http'); - * const { pipeline } = require('stream'); - * - * const server = http.createServer((req, res) => { - * const fileStream = fs.createReadStream('./fileNotExist.txt'); - * pipeline(fileStream, res, (err) => { - * if (err) { - * console.log(err); // No such file - * // this message can't be sent once `pipeline` already destroyed the socket - * return res.end('error!!!'); - * } - * }); - * }); - * ``` - * @since v10.0.0 - * @param callback Called when the pipeline is fully done. - */ - function pipeline, B extends PipelineDestination>( - source: A, - destination: B, - callback?: PipelineCallback - ): B extends NodeJS.WritableStream ? B : NodeJS.WritableStream; - function pipeline, T1 extends PipelineTransform, B extends PipelineDestination>( - source: A, - transform1: T1, - destination: B, - callback?: PipelineCallback - ): B extends NodeJS.WritableStream ? B : NodeJS.WritableStream; - function pipeline, T1 extends PipelineTransform, T2 extends PipelineTransform, B extends PipelineDestination>( - source: A, - transform1: T1, - transform2: T2, - destination: B, - callback?: PipelineCallback - ): B extends NodeJS.WritableStream ? B : NodeJS.WritableStream; - function pipeline< - A extends PipelineSource, - T1 extends PipelineTransform, - T2 extends PipelineTransform, - T3 extends PipelineTransform, - B extends PipelineDestination - >(source: A, transform1: T1, transform2: T2, transform3: T3, destination: B, callback?: PipelineCallback): B extends NodeJS.WritableStream ? B : NodeJS.WritableStream; - function pipeline< - A extends PipelineSource, - T1 extends PipelineTransform, - T2 extends PipelineTransform, - T3 extends PipelineTransform, - T4 extends PipelineTransform, - B extends PipelineDestination - >(source: A, transform1: T1, transform2: T2, transform3: T3, transform4: T4, destination: B, callback?: PipelineCallback): B extends NodeJS.WritableStream ? B : NodeJS.WritableStream; - function pipeline( - streams: ReadonlyArray, - callback?: (err: NodeJS.ErrnoException | null) => void - ): NodeJS.WritableStream; - function pipeline( - stream1: NodeJS.ReadableStream, - stream2: NodeJS.ReadWriteStream | NodeJS.WritableStream, - ...streams: Array void)> - ): NodeJS.WritableStream; - namespace pipeline { - function __promisify__, B extends PipelineDestination>(source: A, destination: B, options?: PipelineOptions): PipelinePromise; - function __promisify__, T1 extends PipelineTransform, B extends PipelineDestination>( - source: A, - transform1: T1, - destination: B, - options?: PipelineOptions - ): PipelinePromise; - function __promisify__, T1 extends PipelineTransform, T2 extends PipelineTransform, B extends PipelineDestination>( - source: A, - transform1: T1, - transform2: T2, - destination: B, - options?: PipelineOptions - ): PipelinePromise; - function __promisify__< - A extends PipelineSource, - T1 extends PipelineTransform, - T2 extends PipelineTransform, - T3 extends PipelineTransform, - B extends PipelineDestination - >(source: A, transform1: T1, transform2: T2, transform3: T3, destination: B, options?: PipelineOptions): PipelinePromise; - function __promisify__< - A extends PipelineSource, - T1 extends PipelineTransform, - T2 extends PipelineTransform, - T3 extends PipelineTransform, - T4 extends PipelineTransform, - B extends PipelineDestination - >(source: A, transform1: T1, transform2: T2, transform3: T3, transform4: T4, destination: B, options?: PipelineOptions): PipelinePromise; - function __promisify__(streams: ReadonlyArray, options?: PipelineOptions): Promise; - function __promisify__( - stream1: NodeJS.ReadableStream, - stream2: NodeJS.ReadWriteStream | NodeJS.WritableStream, - ...streams: Array - ): Promise; - } - interface Pipe { - close(): void; - hasRef(): boolean; - ref(): void; - unref(): void; - } - - /** - * Returns whether the stream has encountered an error. - * @since v17.3.0 - */ - function isErrored(stream: Readable | Writable | NodeJS.ReadableStream | NodeJS.WritableStream): boolean; - - /** - * Returns whether the stream is readable. - * @since v17.4.0 - */ - function isReadable(stream: Readable | NodeJS.ReadableStream): boolean; - - const promises: typeof streamPromises; - const consumers: typeof streamConsumers; - } - export = internal; -} -declare module 'node:stream' { - import stream = require('stream'); - export = stream; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/stream/consumers.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/stream/consumers.d.ts deleted file mode 100755 index 1ebf12e1..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/stream/consumers.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -declare module 'stream/consumers' { - import { Blob as NodeBlob } from "node:buffer"; - import { Readable } from 'node:stream'; - function buffer(stream: NodeJS.ReadableStream | Readable | AsyncIterator): Promise; - function text(stream: NodeJS.ReadableStream | Readable | AsyncIterator): Promise; - function arrayBuffer(stream: NodeJS.ReadableStream | Readable | AsyncIterator): Promise; - function blob(stream: NodeJS.ReadableStream | Readable | AsyncIterator): Promise; - function json(stream: NodeJS.ReadableStream | Readable | AsyncIterator): Promise; -} -declare module 'node:stream/consumers' { - export * from 'stream/consumers'; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/stream/promises.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/stream/promises.d.ts deleted file mode 100755 index b427073d..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/stream/promises.d.ts +++ /dev/null @@ -1,42 +0,0 @@ -declare module 'stream/promises' { - import { FinishedOptions, PipelineSource, PipelineTransform, PipelineDestination, PipelinePromise, PipelineOptions } from 'node:stream'; - function finished(stream: NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream, options?: FinishedOptions): Promise; - function pipeline, B extends PipelineDestination>(source: A, destination: B, options?: PipelineOptions): PipelinePromise; - function pipeline, T1 extends PipelineTransform, B extends PipelineDestination>( - source: A, - transform1: T1, - destination: B, - options?: PipelineOptions - ): PipelinePromise; - function pipeline, T1 extends PipelineTransform, T2 extends PipelineTransform, B extends PipelineDestination>( - source: A, - transform1: T1, - transform2: T2, - destination: B, - options?: PipelineOptions - ): PipelinePromise; - function pipeline< - A extends PipelineSource, - T1 extends PipelineTransform, - T2 extends PipelineTransform, - T3 extends PipelineTransform, - B extends PipelineDestination - >(source: A, transform1: T1, transform2: T2, transform3: T3, destination: B, options?: PipelineOptions): PipelinePromise; - function pipeline< - A extends PipelineSource, - T1 extends PipelineTransform, - T2 extends PipelineTransform, - T3 extends PipelineTransform, - T4 extends PipelineTransform, - B extends PipelineDestination - >(source: A, transform1: T1, transform2: T2, transform3: T3, transform4: T4, destination: B, options?: PipelineOptions): PipelinePromise; - function pipeline(streams: ReadonlyArray, options?: PipelineOptions): Promise; - function pipeline( - stream1: NodeJS.ReadableStream, - stream2: NodeJS.ReadWriteStream | NodeJS.WritableStream, - ...streams: Array - ): Promise; -} -declare module 'node:stream/promises' { - export * from 'stream/promises'; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/stream/web.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/stream/web.d.ts deleted file mode 100755 index f9ef0570..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/stream/web.d.ts +++ /dev/null @@ -1,330 +0,0 @@ -declare module 'stream/web' { - // stub module, pending copy&paste from .d.ts or manual impl - // copy from lib.dom.d.ts - interface ReadableWritablePair { - readable: ReadableStream; - /** - * Provides a convenient, chainable way of piping this readable stream - * through a transform stream (or any other { writable, readable } - * pair). It simply pipes the stream into the writable side of the - * supplied pair, and returns the readable side for further use. - * - * Piping a stream will lock it for the duration of the pipe, preventing - * any other consumer from acquiring a reader. - */ - writable: WritableStream; - } - interface StreamPipeOptions { - preventAbort?: boolean; - preventCancel?: boolean; - /** - * Pipes this readable stream to a given writable stream destination. - * The way in which the piping process behaves under various error - * conditions can be customized with a number of passed options. It - * returns a promise that fulfills when the piping process completes - * successfully, or rejects if any errors were encountered. - * - * Piping a stream will lock it for the duration of the pipe, preventing - * any other consumer from acquiring a reader. - * - * Errors and closures of the source and destination streams propagate - * as follows: - * - * An error in this source readable stream will abort destination, - * unless preventAbort is truthy. The returned promise will be rejected - * with the source's error, or with any error that occurs during - * aborting the destination. - * - * An error in destination will cancel this source readable stream, - * unless preventCancel is truthy. The returned promise will be rejected - * with the destination's error, or with any error that occurs during - * canceling the source. - * - * When this source readable stream closes, destination will be closed, - * unless preventClose is truthy. The returned promise will be fulfilled - * once this process completes, unless an error is encountered while - * closing the destination, in which case it will be rejected with that - * error. - * - * If destination starts out closed or closing, this source readable - * stream will be canceled, unless preventCancel is true. The returned - * promise will be rejected with an error indicating piping to a closed - * stream failed, or with any error that occurs during canceling the - * source. - * - * The signal option can be set to an AbortSignal to allow aborting an - * ongoing pipe operation via the corresponding AbortController. In this - * case, this source readable stream will be canceled, and destination - * aborted, unless the respective options preventCancel or preventAbort - * are set. - */ - preventClose?: boolean; - signal?: AbortSignal; - } - interface ReadableStreamGenericReader { - readonly closed: Promise; - cancel(reason?: any): Promise; - } - interface ReadableStreamDefaultReadValueResult { - done: false; - value: T; - } - interface ReadableStreamDefaultReadDoneResult { - done: true; - value?: undefined; - } - type ReadableStreamController = ReadableStreamDefaultController; - type ReadableStreamDefaultReadResult = ReadableStreamDefaultReadValueResult | ReadableStreamDefaultReadDoneResult; - interface ReadableByteStreamControllerCallback { - (controller: ReadableByteStreamController): void | PromiseLike; - } - interface UnderlyingSinkAbortCallback { - (reason?: any): void | PromiseLike; - } - interface UnderlyingSinkCloseCallback { - (): void | PromiseLike; - } - interface UnderlyingSinkStartCallback { - (controller: WritableStreamDefaultController): any; - } - interface UnderlyingSinkWriteCallback { - (chunk: W, controller: WritableStreamDefaultController): void | PromiseLike; - } - interface UnderlyingSourceCancelCallback { - (reason?: any): void | PromiseLike; - } - interface UnderlyingSourcePullCallback { - (controller: ReadableStreamController): void | PromiseLike; - } - interface UnderlyingSourceStartCallback { - (controller: ReadableStreamController): any; - } - interface TransformerFlushCallback { - (controller: TransformStreamDefaultController): void | PromiseLike; - } - interface TransformerStartCallback { - (controller: TransformStreamDefaultController): any; - } - interface TransformerTransformCallback { - (chunk: I, controller: TransformStreamDefaultController): void | PromiseLike; - } - interface UnderlyingByteSource { - autoAllocateChunkSize?: number; - cancel?: ReadableStreamErrorCallback; - pull?: ReadableByteStreamControllerCallback; - start?: ReadableByteStreamControllerCallback; - type: 'bytes'; - } - interface UnderlyingSource { - cancel?: UnderlyingSourceCancelCallback; - pull?: UnderlyingSourcePullCallback; - start?: UnderlyingSourceStartCallback; - type?: undefined; - } - interface UnderlyingSink { - abort?: UnderlyingSinkAbortCallback; - close?: UnderlyingSinkCloseCallback; - start?: UnderlyingSinkStartCallback; - type?: undefined; - write?: UnderlyingSinkWriteCallback; - } - interface ReadableStreamErrorCallback { - (reason: any): void | PromiseLike; - } - /** This Streams API interface represents a readable stream of byte data. */ - interface ReadableStream { - readonly locked: boolean; - cancel(reason?: any): Promise; - getReader(): ReadableStreamDefaultReader; - pipeThrough(transform: ReadableWritablePair, options?: StreamPipeOptions): ReadableStream; - pipeTo(destination: WritableStream, options?: StreamPipeOptions): Promise; - tee(): [ReadableStream, ReadableStream]; - values(options?: { preventCancel?: boolean }): AsyncIterableIterator; - [Symbol.asyncIterator](): AsyncIterableIterator; - } - const ReadableStream: { - prototype: ReadableStream; - new (underlyingSource: UnderlyingByteSource, strategy?: QueuingStrategy): ReadableStream; - new (underlyingSource?: UnderlyingSource, strategy?: QueuingStrategy): ReadableStream; - }; - interface ReadableStreamDefaultReader extends ReadableStreamGenericReader { - read(): Promise>; - releaseLock(): void; - } - const ReadableStreamDefaultReader: { - prototype: ReadableStreamDefaultReader; - new (stream: ReadableStream): ReadableStreamDefaultReader; - }; - const ReadableStreamBYOBReader: any; - const ReadableStreamBYOBRequest: any; - interface ReadableByteStreamController { - readonly byobRequest: undefined; - readonly desiredSize: number | null; - close(): void; - enqueue(chunk: ArrayBufferView): void; - error(error?: any): void; - } - const ReadableByteStreamController: { - prototype: ReadableByteStreamController; - new (): ReadableByteStreamController; - }; - interface ReadableStreamDefaultController { - readonly desiredSize: number | null; - close(): void; - enqueue(chunk?: R): void; - error(e?: any): void; - } - const ReadableStreamDefaultController: { - prototype: ReadableStreamDefaultController; - new (): ReadableStreamDefaultController; - }; - interface Transformer { - flush?: TransformerFlushCallback; - readableType?: undefined; - start?: TransformerStartCallback; - transform?: TransformerTransformCallback; - writableType?: undefined; - } - interface TransformStream { - readonly readable: ReadableStream; - readonly writable: WritableStream; - } - const TransformStream: { - prototype: TransformStream; - new (transformer?: Transformer, writableStrategy?: QueuingStrategy, readableStrategy?: QueuingStrategy): TransformStream; - }; - interface TransformStreamDefaultController { - readonly desiredSize: number | null; - enqueue(chunk?: O): void; - error(reason?: any): void; - terminate(): void; - } - const TransformStreamDefaultController: { - prototype: TransformStreamDefaultController; - new (): TransformStreamDefaultController; - }; - /** - * This Streams API interface provides a standard abstraction for writing - * streaming data to a destination, known as a sink. This object comes with - * built-in back pressure and queuing. - */ - interface WritableStream { - readonly locked: boolean; - abort(reason?: any): Promise; - close(): Promise; - getWriter(): WritableStreamDefaultWriter; - } - const WritableStream: { - prototype: WritableStream; - new (underlyingSink?: UnderlyingSink, strategy?: QueuingStrategy): WritableStream; - }; - /** - * This Streams API interface is the object returned by - * WritableStream.getWriter() and once created locks the < writer to the - * WritableStream ensuring that no other streams can write to the underlying - * sink. - */ - interface WritableStreamDefaultWriter { - readonly closed: Promise; - readonly desiredSize: number | null; - readonly ready: Promise; - abort(reason?: any): Promise; - close(): Promise; - releaseLock(): void; - write(chunk?: W): Promise; - } - const WritableStreamDefaultWriter: { - prototype: WritableStreamDefaultWriter; - new (stream: WritableStream): WritableStreamDefaultWriter; - }; - /** - * This Streams API interface represents a controller allowing control of a - * WritableStream's state. When constructing a WritableStream, the - * underlying sink is given a corresponding WritableStreamDefaultController - * instance to manipulate. - */ - interface WritableStreamDefaultController { - error(e?: any): void; - } - const WritableStreamDefaultController: { - prototype: WritableStreamDefaultController; - new (): WritableStreamDefaultController; - }; - interface QueuingStrategy { - highWaterMark?: number; - size?: QueuingStrategySize; - } - interface QueuingStrategySize { - (chunk?: T): number; - } - interface QueuingStrategyInit { - /** - * Creates a new ByteLengthQueuingStrategy with the provided high water - * mark. - * - * Note that the provided high water mark will not be validated ahead of - * time. Instead, if it is negative, NaN, or not a number, the resulting - * ByteLengthQueuingStrategy will cause the corresponding stream - * constructor to throw. - */ - highWaterMark: number; - } - /** - * This Streams API interface provides a built-in byte length queuing - * strategy that can be used when constructing streams. - */ - interface ByteLengthQueuingStrategy extends QueuingStrategy { - readonly highWaterMark: number; - readonly size: QueuingStrategySize; - } - const ByteLengthQueuingStrategy: { - prototype: ByteLengthQueuingStrategy; - new (init: QueuingStrategyInit): ByteLengthQueuingStrategy; - }; - /** - * This Streams API interface provides a built-in byte length queuing - * strategy that can be used when constructing streams. - */ - interface CountQueuingStrategy extends QueuingStrategy { - readonly highWaterMark: number; - readonly size: QueuingStrategySize; - } - const CountQueuingStrategy: { - prototype: CountQueuingStrategy; - new (init: QueuingStrategyInit): CountQueuingStrategy; - }; - interface TextEncoderStream { - /** Returns "utf-8". */ - readonly encoding: 'utf-8'; - readonly readable: ReadableStream; - readonly writable: WritableStream; - readonly [Symbol.toStringTag]: string; - } - const TextEncoderStream: { - prototype: TextEncoderStream; - new (): TextEncoderStream; - }; - interface TextDecoderOptions { - fatal?: boolean; - ignoreBOM?: boolean; - } - type BufferSource = ArrayBufferView | ArrayBuffer; - interface TextDecoderStream { - /** Returns encoding's name, lower cased. */ - readonly encoding: string; - /** Returns `true` if error mode is "fatal", and `false` otherwise. */ - readonly fatal: boolean; - /** Returns `true` if ignore BOM flag is set, and `false` otherwise. */ - readonly ignoreBOM: boolean; - readonly readable: ReadableStream; - readonly writable: WritableStream; - readonly [Symbol.toStringTag]: string; - } - const TextDecoderStream: { - prototype: TextDecoderStream; - new (label?: string, options?: TextDecoderOptions): TextDecoderStream; - }; -} -declare module 'node:stream/web' { - export * from 'stream/web'; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/string_decoder.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/string_decoder.d.ts deleted file mode 100755 index a5858041..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/string_decoder.d.ts +++ /dev/null @@ -1,67 +0,0 @@ -/** - * The `string_decoder` module provides an API for decoding `Buffer` objects into - * strings in a manner that preserves encoded multi-byte UTF-8 and UTF-16 - * characters. It can be accessed using: - * - * ```js - * const { StringDecoder } = require('string_decoder'); - * ``` - * - * The following example shows the basic use of the `StringDecoder` class. - * - * ```js - * const { StringDecoder } = require('string_decoder'); - * const decoder = new StringDecoder('utf8'); - * - * const cent = Buffer.from([0xC2, 0xA2]); - * console.log(decoder.write(cent)); - * - * const euro = Buffer.from([0xE2, 0x82, 0xAC]); - * console.log(decoder.write(euro)); - * ``` - * - * When a `Buffer` instance is written to the `StringDecoder` instance, an - * internal buffer is used to ensure that the decoded string does not contain - * any incomplete multibyte characters. These are held in the buffer until the - * next call to `stringDecoder.write()` or until `stringDecoder.end()` is called. - * - * In the following example, the three UTF-8 encoded bytes of the European Euro - * symbol (`€`) are written over three separate operations: - * - * ```js - * const { StringDecoder } = require('string_decoder'); - * const decoder = new StringDecoder('utf8'); - * - * decoder.write(Buffer.from([0xE2])); - * decoder.write(Buffer.from([0x82])); - * console.log(decoder.end(Buffer.from([0xAC]))); - * ``` - * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/string_decoder.js) - */ -declare module 'string_decoder' { - class StringDecoder { - constructor(encoding?: BufferEncoding); - /** - * Returns a decoded string, ensuring that any incomplete multibyte characters at - * the end of the `Buffer`, or `TypedArray`, or `DataView` are omitted from the - * returned string and stored in an internal buffer for the next call to`stringDecoder.write()` or `stringDecoder.end()`. - * @since v0.1.99 - * @param buffer A `Buffer`, or `TypedArray`, or `DataView` containing the bytes to decode. - */ - write(buffer: Buffer): string; - /** - * Returns any remaining input stored in the internal buffer as a string. Bytes - * representing incomplete UTF-8 and UTF-16 characters will be replaced with - * substitution characters appropriate for the character encoding. - * - * If the `buffer` argument is provided, one final call to `stringDecoder.write()`is performed before returning the remaining input. - * After `end()` is called, the `stringDecoder` object can be reused for new input. - * @since v0.9.3 - * @param buffer A `Buffer`, or `TypedArray`, or `DataView` containing the bytes to decode. - */ - end(buffer?: Buffer): string; - } -} -declare module 'node:string_decoder' { - export * from 'string_decoder'; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/test.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/test.d.ts deleted file mode 100755 index 29dd0eea..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/test.d.ts +++ /dev/null @@ -1,374 +0,0 @@ -/** - * The `node:test` module provides a standalone testing module. - * @see [source](https://github.com/nodejs/node/blob/v18.8.0/lib/test.js) - */ -declare module 'node:test' { - /** - * Programmatically start the test runner. - * @since v18.9.0 - * @param options Configuration options for running tests. - * @returns A {@link TapStream} that emits events about the test execution. - */ - function run(options?: RunOptions): TapStream; - - /** - * The `test()` function is the value imported from the test module. Each invocation of this - * function results in the creation of a test point in the TAP output. - * - * The {@link TestContext} object passed to the fn argument can be used to perform actions - * related to the current test. Examples include skipping the test, adding additional TAP - * diagnostic information, or creating subtests. - * - * `test()` returns a {@link Promise} that resolves once the test completes. The return value - * can usually be discarded for top level tests. However, the return value from subtests should - * be used to prevent the parent test from finishing first and cancelling the subtest as shown - * in the following example. - * - * ```js - * test('top level test', async (t) => { - * // The setTimeout() in the following subtest would cause it to outlive its - * // parent test if 'await' is removed on the next line. Once the parent test - * // completes, it will cancel any outstanding subtests. - * await t.test('longer running subtest', async (t) => { - * return new Promise((resolve, reject) => { - * setTimeout(resolve, 1000); - * }); - * }); - * }); - * ``` - * @since v18.0.0 - * @param name The name of the test, which is displayed when reporting test results. - * Default: The `name` property of fn, or `''` if `fn` does not have a name. - * @param options Configuration options for the test - * @param fn The function under test. The first argument to this function is a - * {@link TestContext} object. If the test uses callbacks, the callback function is - * passed as the second argument. Default: A no-op function. - * @returns A {@link Promise} resolved with `undefined` once the test completes. - */ - function test(name?: string, fn?: TestFn): Promise; - function test(name?: string, options?: TestOptions, fn?: TestFn): Promise; - function test(options?: TestOptions, fn?: TestFn): Promise; - function test(fn?: TestFn): Promise; - - /** - * @since v18.6.0 - * @param name The name of the suite, which is displayed when reporting suite results. - * Default: The `name` property of fn, or `''` if `fn` does not have a name. - * @param options Configuration options for the suite - * @param fn The function under suite. Default: A no-op function. - */ - function describe(name?: string, options?: TestOptions, fn?: SuiteFn): void; - function describe(name?: string, fn?: SuiteFn): void; - function describe(options?: TestOptions, fn?: SuiteFn): void; - function describe(fn?: SuiteFn): void; - - /** - * @since v18.6.0 - * @param name The name of the test, which is displayed when reporting test results. - * Default: The `name` property of fn, or `''` if `fn` does not have a name. - * @param options Configuration options for the test - * @param fn The function under test. If the test uses callbacks, the callback function is - * passed as the second argument. Default: A no-op function. - */ - function it(name?: string, options?: TestOptions, fn?: ItFn): void; - function it(name?: string, fn?: ItFn): void; - function it(options?: TestOptions, fn?: ItFn): void; - function it(fn?: ItFn): void; - - /** - * The type of a function under test. The first argument to this function is a - * {@link TestContext} object. If the test uses callbacks, the callback function is passed as - * the second argument. - */ - type TestFn = (t: TestContext, done: (result?: any) => void) => any; - - /** - * The type of a function under Suite. - * If the test uses callbacks, the callback function is passed as an argument - */ - type SuiteFn = (done: (result?: any) => void) => void; - - /** - * The type of a function under test. - * If the test uses callbacks, the callback function is passed as an argument - */ - type ItFn = (done: (result?: any) => void) => any; - - interface RunOptions { - /** - * @default false - */ - concurrency?: number | boolean; - - /** - * An array containing the list of files to run. If unspecified, the test runner execution model will be used. - */ - files?: readonly string[]; - - /** - * Allows aborting an in-progress test. - * @default undefined - */ - signal?: AbortSignal; - - /** - * A number of milliseconds the test will fail after. If unspecified, subtests inherit this - * value from their parent. - * @default Infinity - */ - timeout?: number; - } - - /** - * A successful call of the run() method will return a new TapStream object, streaming a TAP output. - * TapStream will emit events in the order of the tests' definitions. - * @since v18.9.0 - */ - interface TapStream extends NodeJS.ReadableStream { - addListener(event: 'test:diagnostic', listener: (message: string) => void): this; - addListener(event: 'test:fail', listener: (data: TestFail) => void): this; - addListener(event: 'test:pass', listener: (data: TestPass) => void): this; - addListener(event: string, listener: (...args: any[]) => void): this; - emit(event: 'test:diagnostic', message: string): boolean; - emit(event: 'test:fail', data: TestFail): boolean; - emit(event: 'test:pass', data: TestPass): boolean; - emit(event: string | symbol, ...args: any[]): boolean; - on(event: 'test:diagnostic', listener: (message: string) => void): this; - on(event: 'test:fail', listener: (data: TestFail) => void): this; - on(event: 'test:pass', listener: (data: TestPass) => void): this; - on(event: string, listener: (...args: any[]) => void): this; - once(event: 'test:diagnostic', listener: (message: string) => void): this; - once(event: 'test:fail', listener: (data: TestFail) => void): this; - once(event: 'test:pass', listener: (data: TestPass) => void): this; - once(event: string, listener: (...args: any[]) => void): this; - prependListener(event: 'test:diagnostic', listener: (message: string) => void): this; - prependListener(event: 'test:fail', listener: (data: TestFail) => void): this; - prependListener(event: 'test:pass', listener: (data: TestPass) => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: 'test:diagnostic', listener: (message: string) => void): this; - prependOnceListener(event: 'test:fail', listener: (data: TestFail) => void): this; - prependOnceListener(event: 'test:pass', listener: (data: TestPass) => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - } - - interface TestFail { - /** - * The test duration. - */ - duration: number; - - /** - * The failure casing test to fail. - */ - error: Error; - - /** - * The test name. - */ - name: string; - - /** - * The ordinal number of the test. - */ - testNumber: number; - - /** - * Present if `context.todo` is called. - */ - todo?: string; - - /** - * Present if `context.skip` is called. - */ - skip?: string; - } - - interface TestPass { - /** - * The test duration. - */ - duration: number; - - /** - * The test name. - */ - name: string; - - /** - * The ordinal number of the test. - */ - testNumber: number; - - /** - * Present if `context.todo` is called. - */ - todo?: string; - - /** - * Present if `context.skip` is called. - */ - skip?: string; - } - - /** - * An instance of `TestContext` is passed to each test function in order to interact with the - * test runner. However, the `TestContext` constructor is not exposed as part of the API. - * @since v18.0.0 - */ - interface TestContext { - /** - * This function is used to write TAP diagnostics to the output. Any diagnostic information is - * included at the end of the test's results. This function does not return a value. - * @param message Message to be displayed as a TAP diagnostic. - * @since v18.0.0 - */ - diagnostic(message: string): void; - - /** - * If `shouldRunOnlyTests` is truthy, the test context will only run tests that have the `only` - * option set. Otherwise, all tests are run. If Node.js was not started with the `--test-only` - * command-line option, this function is a no-op. - * @param shouldRunOnlyTests Whether or not to run `only` tests. - * @since v18.0.0 - */ - runOnly(shouldRunOnlyTests: boolean): void; - - /** - * This function causes the test's output to indicate the test as skipped. If `message` is - * provided, it is included in the TAP output. Calling `skip()` does not terminate execution of - * the test function. This function does not return a value. - * @param message Optional skip message to be displayed in TAP output. - * @since v18.0.0 - */ - skip(message?: string): void; - - /** - * This function adds a `TODO` directive to the test's output. If `message` is provided, it is - * included in the TAP output. Calling `todo()` does not terminate execution of the test - * function. This function does not return a value. - * @param message Optional `TODO` message to be displayed in TAP output. - * @since v18.0.0 - */ - todo(message?: string): void; - - /** - * This function is used to create subtests under the current test. This function behaves in - * the same fashion as the top level {@link test} function. - * @since v18.0.0 - * @param name The name of the test, which is displayed when reporting test results. - * Default: The `name` property of fn, or `''` if `fn` does not have a name. - * @param options Configuration options for the test - * @param fn The function under test. This first argument to this function is a - * {@link TestContext} object. If the test uses callbacks, the callback function is - * passed as the second argument. Default: A no-op function. - * @returns A {@link Promise} resolved with `undefined` once the test completes. - */ - test: typeof test; - } - - interface TestOptions { - /** - * The number of tests that can be run at the same time. If unspecified, subtests inherit this - * value from their parent. - * @default 1 - */ - concurrency?: number; - - /** - * If truthy, and the test context is configured to run `only` tests, then this test will be - * run. Otherwise, the test is skipped. - * @default false - */ - only?: boolean; - - /** - * Allows aborting an in-progress test. - * @since v18.8.0 - */ - signal?: AbortSignal; - - /** - * If truthy, the test is skipped. If a string is provided, that string is displayed in the - * test results as the reason for skipping the test. - * @default false - */ - skip?: boolean | string; - - /** - * A number of milliseconds the test will fail after. If unspecified, subtests inherit this - * value from their parent. - * @default Infinity - * @since v18.7.0 - */ - timeout?: number; - - /** - * If truthy, the test marked as `TODO`. If a string is provided, that string is displayed in - * the test results as the reason why the test is `TODO`. - * @default false - */ - todo?: boolean | string; - } - - /** - * This function is used to create a hook running before running a suite. - * @param fn The hook function. If the hook uses callbacks, the callback function is passed as - * the second argument. Default: A no-op function. - * @param options Configuration options for the hook. - * @since v18.8.0 - */ - function before(fn?: HookFn, options?: HookOptions): void; - - /** - * This function is used to create a hook running after running a suite. - * @param fn The hook function. If the hook uses callbacks, the callback function is passed as - * the second argument. Default: A no-op function. - * @param options Configuration options for the hook. - * @since v18.8.0 - */ - function after(fn?: HookFn, options?: HookOptions): void; - - /** - * This function is used to create a hook running before each subtest of the current suite. - * @param fn The hook function. If the hook uses callbacks, the callback function is passed as - * the second argument. Default: A no-op function. - * @param options Configuration options for the hook. - * @since v18.8.0 - */ - function beforeEach(fn?: HookFn, options?: HookOptions): void; - - /** - * This function is used to create a hook running after each subtest of the current test. - * @param fn The hook function. If the hook uses callbacks, the callback function is passed as - * the second argument. Default: A no-op function. - * @param options Configuration options for the hook. - * @since v18.8.0 - */ - function afterEach(fn?: HookFn, options?: HookOptions): void; - - /** - * The hook function. If the hook uses callbacks, the callback function is passed as the - * second argument. - */ - type HookFn = (done: (result?: any) => void) => any; - - /** - * Configuration options for hooks. - * @since v18.8.0 - */ - interface HookOptions { - /** - * Allows aborting an in-progress hook. - */ - signal?: AbortSignal; - - /** - * A number of milliseconds the hook will fail after. If unspecified, subtests inherit this - * value from their parent. - * @default Infinity - */ - timeout?: number; - } - - export { test as default, run, test, describe, it, before, after, beforeEach, afterEach }; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/timers.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/timers.d.ts deleted file mode 100755 index b26f3ced..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/timers.d.ts +++ /dev/null @@ -1,94 +0,0 @@ -/** - * The `timer` module exposes a global API for scheduling functions to - * be called at some future period of time. Because the timer functions are - * globals, there is no need to call `require('timers')` to use the API. - * - * The timer functions within Node.js implement a similar API as the timers API - * provided by Web Browsers but use a different internal implementation that is - * built around the Node.js [Event Loop](https://nodejs.org/en/docs/guides/event-loop-timers-and-nexttick/#setimmediate-vs-settimeout). - * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/timers.js) - */ -declare module 'timers' { - import { Abortable } from 'node:events'; - import { setTimeout as setTimeoutPromise, setImmediate as setImmediatePromise, setInterval as setIntervalPromise } from 'node:timers/promises'; - interface TimerOptions extends Abortable { - /** - * Set to `false` to indicate that the scheduled `Timeout` - * should not require the Node.js event loop to remain active. - * @default true - */ - ref?: boolean | undefined; - } - let setTimeout: typeof global.setTimeout; - let clearTimeout: typeof global.clearTimeout; - let setInterval: typeof global.setInterval; - let clearInterval: typeof global.clearInterval; - let setImmediate: typeof global.setImmediate; - let clearImmediate: typeof global.clearImmediate; - global { - namespace NodeJS { - // compatibility with older typings - interface Timer extends RefCounted { - hasRef(): boolean; - refresh(): this; - [Symbol.toPrimitive](): number; - } - interface Immediate extends RefCounted { - /** - * If true, the `Immediate` object will keep the Node.js event loop active. - * @since v11.0.0 - */ - hasRef(): boolean; - _onImmediate: Function; // to distinguish it from the Timeout class - } - interface Timeout extends Timer { - /** - * If true, the `Timeout` object will keep the Node.js event loop active. - * @since v11.0.0 - */ - hasRef(): boolean; - /** - * Sets the timer's start time to the current time, and reschedules the timer to - * call its callback at the previously specified duration adjusted to the current - * time. This is useful for refreshing a timer without allocating a new - * JavaScript object. - * - * Using this on a timer that has already called its callback will reactivate the - * timer. - * @since v10.2.0 - * @return a reference to `timeout` - */ - refresh(): this; - [Symbol.toPrimitive](): number; - } - } - function setTimeout(callback: (...args: TArgs) => void, ms?: number, ...args: TArgs): NodeJS.Timeout; - // util.promisify no rest args compability - // tslint:disable-next-line void-return - function setTimeout(callback: (args: void) => void, ms?: number): NodeJS.Timeout; - namespace setTimeout { - const __promisify__: typeof setTimeoutPromise; - } - function clearTimeout(timeoutId: NodeJS.Timeout | string | number | undefined): void; - function setInterval(callback: (...args: TArgs) => void, ms?: number, ...args: TArgs): NodeJS.Timer; - // util.promisify no rest args compability - // tslint:disable-next-line void-return - function setInterval(callback: (args: void) => void, ms?: number): NodeJS.Timer; - namespace setInterval { - const __promisify__: typeof setIntervalPromise; - } - function clearInterval(intervalId: NodeJS.Timeout | string | number | undefined): void; - function setImmediate(callback: (...args: TArgs) => void, ...args: TArgs): NodeJS.Immediate; - // util.promisify no rest args compability - // tslint:disable-next-line void-return - function setImmediate(callback: (args: void) => void): NodeJS.Immediate; - namespace setImmediate { - const __promisify__: typeof setImmediatePromise; - } - function clearImmediate(immediateId: NodeJS.Immediate | undefined): void; - function queueMicrotask(callback: () => void): void; - } -} -declare module 'node:timers' { - export * from 'timers'; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/timers/promises.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/timers/promises.d.ts deleted file mode 100755 index fd778880..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/timers/promises.d.ts +++ /dev/null @@ -1,68 +0,0 @@ -/** - * The `timers/promises` API provides an alternative set of timer functions - * that return `Promise` objects. The API is accessible via`require('timers/promises')`. - * - * ```js - * import { - * setTimeout, - * setImmediate, - * setInterval, - * } from 'timers/promises'; - * ``` - * @since v15.0.0 - */ -declare module 'timers/promises' { - import { TimerOptions } from 'node:timers'; - /** - * ```js - * import { - * setTimeout, - * } from 'timers/promises'; - * - * const res = await setTimeout(100, 'result'); - * - * console.log(res); // Prints 'result' - * ``` - * @since v15.0.0 - * @param [delay=1] The number of milliseconds to wait before fulfilling the promise. - * @param value A value with which the promise is fulfilled. - */ - function setTimeout(delay?: number, value?: T, options?: TimerOptions): Promise; - /** - * ```js - * import { - * setImmediate, - * } from 'timers/promises'; - * - * const res = await setImmediate('result'); - * - * console.log(res); // Prints 'result' - * ``` - * @since v15.0.0 - * @param value A value with which the promise is fulfilled. - */ - function setImmediate(value?: T, options?: TimerOptions): Promise; - /** - * Returns an async iterator that generates values in an interval of `delay` ms. - * - * ```js - * import { - * setInterval, - * } from 'timers/promises'; - * - * const interval = 100; - * for await (const startTime of setInterval(interval, Date.now())) { - * const now = Date.now(); - * console.log(now); - * if ((now - startTime) > 1000) - * break; - * } - * console.log(Date.now()); - * ``` - * @since v15.9.0 - */ - function setInterval(delay?: number, value?: T, options?: TimerOptions): AsyncIterable; -} -declare module 'node:timers/promises' { - export * from 'timers/promises'; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/tls.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/tls.d.ts deleted file mode 100755 index 2cbc7165..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/tls.d.ts +++ /dev/null @@ -1,1028 +0,0 @@ -/** - * The `tls` module provides an implementation of the Transport Layer Security - * (TLS) and Secure Socket Layer (SSL) protocols that is built on top of OpenSSL. - * The module can be accessed using: - * - * ```js - * const tls = require('tls'); - * ``` - * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/tls.js) - */ -declare module 'tls' { - import { X509Certificate } from 'node:crypto'; - import * as net from 'node:net'; - import * as stream from 'stream'; - const CLIENT_RENEG_LIMIT: number; - const CLIENT_RENEG_WINDOW: number; - interface Certificate { - /** - * Country code. - */ - C: string; - /** - * Street. - */ - ST: string; - /** - * Locality. - */ - L: string; - /** - * Organization. - */ - O: string; - /** - * Organizational unit. - */ - OU: string; - /** - * Common name. - */ - CN: string; - } - interface PeerCertificate { - subject: Certificate; - issuer: Certificate; - subjectaltname: string; - infoAccess: NodeJS.Dict; - modulus: string; - exponent: string; - valid_from: string; - valid_to: string; - fingerprint: string; - fingerprint256: string; - ext_key_usage: string[]; - serialNumber: string; - raw: Buffer; - } - interface DetailedPeerCertificate extends PeerCertificate { - issuerCertificate: DetailedPeerCertificate; - } - interface CipherNameAndProtocol { - /** - * The cipher name. - */ - name: string; - /** - * SSL/TLS protocol version. - */ - version: string; - /** - * IETF name for the cipher suite. - */ - standardName: string; - } - interface EphemeralKeyInfo { - /** - * The supported types are 'DH' and 'ECDH'. - */ - type: string; - /** - * The name property is available only when type is 'ECDH'. - */ - name?: string | undefined; - /** - * The size of parameter of an ephemeral key exchange. - */ - size: number; - } - interface KeyObject { - /** - * Private keys in PEM format. - */ - pem: string | Buffer; - /** - * Optional passphrase. - */ - passphrase?: string | undefined; - } - interface PxfObject { - /** - * PFX or PKCS12 encoded private key and certificate chain. - */ - buf: string | Buffer; - /** - * Optional passphrase. - */ - passphrase?: string | undefined; - } - interface TLSSocketOptions extends SecureContextOptions, CommonConnectionOptions { - /** - * If true the TLS socket will be instantiated in server-mode. - * Defaults to false. - */ - isServer?: boolean | undefined; - /** - * An optional net.Server instance. - */ - server?: net.Server | undefined; - /** - * An optional Buffer instance containing a TLS session. - */ - session?: Buffer | undefined; - /** - * If true, specifies that the OCSP status request extension will be - * added to the client hello and an 'OCSPResponse' event will be - * emitted on the socket before establishing a secure communication - */ - requestOCSP?: boolean | undefined; - } - /** - * Performs transparent encryption of written data and all required TLS - * negotiation. - * - * Instances of `tls.TLSSocket` implement the duplex `Stream` interface. - * - * Methods that return TLS connection metadata (e.g.{@link TLSSocket.getPeerCertificate} will only return data while the - * connection is open. - * @since v0.11.4 - */ - class TLSSocket extends net.Socket { - /** - * Construct a new tls.TLSSocket object from an existing TCP socket. - */ - constructor(socket: net.Socket, options?: TLSSocketOptions); - /** - * This property is `true` if the peer certificate was signed by one of the CAs - * specified when creating the `tls.TLSSocket` instance, otherwise `false`. - * @since v0.11.4 - */ - authorized: boolean; - /** - * Returns the reason why the peer's certificate was not been verified. This - * property is set only when `tlsSocket.authorized === false`. - * @since v0.11.4 - */ - authorizationError: Error; - /** - * Always returns `true`. This may be used to distinguish TLS sockets from regular`net.Socket` instances. - * @since v0.11.4 - */ - encrypted: true; - /** - * String containing the selected ALPN protocol. - * Before a handshake has completed, this value is always null. - * When a handshake is completed but not ALPN protocol was selected, tlsSocket.alpnProtocol equals false. - */ - alpnProtocol: string | false | null; - /** - * Returns an object representing the local certificate. The returned object has - * some properties corresponding to the fields of the certificate. - * - * See {@link TLSSocket.getPeerCertificate} for an example of the certificate - * structure. - * - * If there is no local certificate, an empty object will be returned. If the - * socket has been destroyed, `null` will be returned. - * @since v11.2.0 - */ - getCertificate(): PeerCertificate | object | null; - /** - * Returns an object containing information on the negotiated cipher suite. - * - * For example: - * - * ```json - * { - * "name": "AES128-SHA256", - * "standardName": "TLS_RSA_WITH_AES_128_CBC_SHA256", - * "version": "TLSv1.2" - * } - * ``` - * - * See [SSL\_CIPHER\_get\_name](https://www.openssl.org/docs/man1.1.1/man3/SSL_CIPHER_get_name.html) for more information. - * @since v0.11.4 - */ - getCipher(): CipherNameAndProtocol; - /** - * Returns an object representing the type, name, and size of parameter of - * an ephemeral key exchange in `perfect forward secrecy` on a client - * connection. It returns an empty object when the key exchange is not - * ephemeral. As this is only supported on a client socket; `null` is returned - * if called on a server socket. The supported types are `'DH'` and `'ECDH'`. The`name` property is available only when type is `'ECDH'`. - * - * For example: `{ type: 'ECDH', name: 'prime256v1', size: 256 }`. - * @since v5.0.0 - */ - getEphemeralKeyInfo(): EphemeralKeyInfo | object | null; - /** - * As the `Finished` messages are message digests of the complete handshake - * (with a total of 192 bits for TLS 1.0 and more for SSL 3.0), they can - * be used for external authentication procedures when the authentication - * provided by SSL/TLS is not desired or is not enough. - * - * Corresponds to the `SSL_get_finished` routine in OpenSSL and may be used - * to implement the `tls-unique` channel binding from [RFC 5929](https://tools.ietf.org/html/rfc5929). - * @since v9.9.0 - * @return The latest `Finished` message that has been sent to the socket as part of a SSL/TLS handshake, or `undefined` if no `Finished` message has been sent yet. - */ - getFinished(): Buffer | undefined; - /** - * Returns an object representing the peer's certificate. If the peer does not - * provide a certificate, an empty object will be returned. If the socket has been - * destroyed, `null` will be returned. - * - * If the full certificate chain was requested, each certificate will include an`issuerCertificate` property containing an object representing its issuer's - * certificate. - * @since v0.11.4 - * @param detailed Include the full certificate chain if `true`, otherwise include just the peer's certificate. - * @return A certificate object. - */ - getPeerCertificate(detailed: true): DetailedPeerCertificate; - getPeerCertificate(detailed?: false): PeerCertificate; - getPeerCertificate(detailed?: boolean): PeerCertificate | DetailedPeerCertificate; - /** - * As the `Finished` messages are message digests of the complete handshake - * (with a total of 192 bits for TLS 1.0 and more for SSL 3.0), they can - * be used for external authentication procedures when the authentication - * provided by SSL/TLS is not desired or is not enough. - * - * Corresponds to the `SSL_get_peer_finished` routine in OpenSSL and may be used - * to implement the `tls-unique` channel binding from [RFC 5929](https://tools.ietf.org/html/rfc5929). - * @since v9.9.0 - * @return The latest `Finished` message that is expected or has actually been received from the socket as part of a SSL/TLS handshake, or `undefined` if there is no `Finished` message so - * far. - */ - getPeerFinished(): Buffer | undefined; - /** - * Returns a string containing the negotiated SSL/TLS protocol version of the - * current connection. The value `'unknown'` will be returned for connected - * sockets that have not completed the handshaking process. The value `null` will - * be returned for server sockets or disconnected client sockets. - * - * Protocol versions are: - * - * * `'SSLv3'` - * * `'TLSv1'` - * * `'TLSv1.1'` - * * `'TLSv1.2'` - * * `'TLSv1.3'` - * - * See the OpenSSL [`SSL_get_version`](https://www.openssl.org/docs/man1.1.1/man3/SSL_get_version.html) documentation for more information. - * @since v5.7.0 - */ - getProtocol(): string | null; - /** - * Returns the TLS session data or `undefined` if no session was - * negotiated. On the client, the data can be provided to the `session` option of {@link connect} to resume the connection. On the server, it may be useful - * for debugging. - * - * See `Session Resumption` for more information. - * - * Note: `getSession()` works only for TLSv1.2 and below. For TLSv1.3, applications - * must use the `'session'` event (it also works for TLSv1.2 and below). - * @since v0.11.4 - */ - getSession(): Buffer | undefined; - /** - * See [SSL\_get\_shared\_sigalgs](https://www.openssl.org/docs/man1.1.1/man3/SSL_get_shared_sigalgs.html) for more information. - * @since v12.11.0 - * @return List of signature algorithms shared between the server and the client in the order of decreasing preference. - */ - getSharedSigalgs(): string[]; - /** - * For a client, returns the TLS session ticket if one is available, or`undefined`. For a server, always returns `undefined`. - * - * It may be useful for debugging. - * - * See `Session Resumption` for more information. - * @since v0.11.4 - */ - getTLSTicket(): Buffer | undefined; - /** - * See `Session Resumption` for more information. - * @since v0.5.6 - * @return `true` if the session was reused, `false` otherwise. - */ - isSessionReused(): boolean; - /** - * The `tlsSocket.renegotiate()` method initiates a TLS renegotiation process. - * Upon completion, the `callback` function will be passed a single argument - * that is either an `Error` (if the request failed) or `null`. - * - * This method can be used to request a peer's certificate after the secure - * connection has been established. - * - * When running as the server, the socket will be destroyed with an error after`handshakeTimeout` timeout. - * - * For TLSv1.3, renegotiation cannot be initiated, it is not supported by the - * protocol. - * @since v0.11.8 - * @param callback If `renegotiate()` returned `true`, callback is attached once to the `'secure'` event. If `renegotiate()` returned `false`, `callback` will be called in the next tick with - * an error, unless the `tlsSocket` has been destroyed, in which case `callback` will not be called at all. - * @return `true` if renegotiation was initiated, `false` otherwise. - */ - renegotiate( - options: { - rejectUnauthorized?: boolean | undefined; - requestCert?: boolean | undefined; - }, - callback: (err: Error | null) => void - ): undefined | boolean; - /** - * The `tlsSocket.setMaxSendFragment()` method sets the maximum TLS fragment size. - * Returns `true` if setting the limit succeeded; `false` otherwise. - * - * Smaller fragment sizes decrease the buffering latency on the client: larger - * fragments are buffered by the TLS layer until the entire fragment is received - * and its integrity is verified; large fragments can span multiple roundtrips - * and their processing can be delayed due to packet loss or reordering. However, - * smaller fragments add extra TLS framing bytes and CPU overhead, which may - * decrease overall server throughput. - * @since v0.11.11 - * @param [size=16384] The maximum TLS fragment size. The maximum value is `16384`. - */ - setMaxSendFragment(size: number): boolean; - /** - * Disables TLS renegotiation for this `TLSSocket` instance. Once called, attempts - * to renegotiate will trigger an `'error'` event on the `TLSSocket`. - * @since v8.4.0 - */ - disableRenegotiation(): void; - /** - * When enabled, TLS packet trace information is written to `stderr`. This can be - * used to debug TLS connection problems. - * - * The format of the output is identical to the output of`openssl s_client -trace` or `openssl s_server -trace`. While it is produced by - * OpenSSL's `SSL_trace()` function, the format is undocumented, can change - * without notice, and should not be relied on. - * @since v12.2.0 - */ - enableTrace(): void; - /** - * Returns the peer certificate as an `X509Certificate` object. - * - * If there is no peer certificate, or the socket has been destroyed,`undefined` will be returned. - * @since v15.9.0 - */ - getPeerX509Certificate(): X509Certificate | undefined; - /** - * Returns the local certificate as an `X509Certificate` object. - * - * If there is no local certificate, or the socket has been destroyed,`undefined` will be returned. - * @since v15.9.0 - */ - getX509Certificate(): X509Certificate | undefined; - /** - * Keying material is used for validations to prevent different kind of attacks in - * network protocols, for example in the specifications of IEEE 802.1X. - * - * Example - * - * ```js - * const keyingMaterial = tlsSocket.exportKeyingMaterial( - * 128, - * 'client finished'); - * - * /* - * Example return value of keyingMaterial: - * - * - * ``` - * - * See the OpenSSL [`SSL_export_keying_material`](https://www.openssl.org/docs/man1.1.1/man3/SSL_export_keying_material.html) documentation for more - * information. - * @since v13.10.0, v12.17.0 - * @param length number of bytes to retrieve from keying material - * @param label an application specific label, typically this will be a value from the [IANA Exporter Label - * Registry](https://www.iana.org/assignments/tls-parameters/tls-parameters.xhtml#exporter-labels). - * @param context Optionally provide a context. - * @return requested bytes of the keying material - */ - exportKeyingMaterial(length: number, label: string, context: Buffer): Buffer; - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: 'OCSPResponse', listener: (response: Buffer) => void): this; - addListener(event: 'secureConnect', listener: () => void): this; - addListener(event: 'session', listener: (session: Buffer) => void): this; - addListener(event: 'keylog', listener: (line: Buffer) => void): this; - emit(event: string | symbol, ...args: any[]): boolean; - emit(event: 'OCSPResponse', response: Buffer): boolean; - emit(event: 'secureConnect'): boolean; - emit(event: 'session', session: Buffer): boolean; - emit(event: 'keylog', line: Buffer): boolean; - on(event: string, listener: (...args: any[]) => void): this; - on(event: 'OCSPResponse', listener: (response: Buffer) => void): this; - on(event: 'secureConnect', listener: () => void): this; - on(event: 'session', listener: (session: Buffer) => void): this; - on(event: 'keylog', listener: (line: Buffer) => void): this; - once(event: string, listener: (...args: any[]) => void): this; - once(event: 'OCSPResponse', listener: (response: Buffer) => void): this; - once(event: 'secureConnect', listener: () => void): this; - once(event: 'session', listener: (session: Buffer) => void): this; - once(event: 'keylog', listener: (line: Buffer) => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: 'OCSPResponse', listener: (response: Buffer) => void): this; - prependListener(event: 'secureConnect', listener: () => void): this; - prependListener(event: 'session', listener: (session: Buffer) => void): this; - prependListener(event: 'keylog', listener: (line: Buffer) => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: 'OCSPResponse', listener: (response: Buffer) => void): this; - prependOnceListener(event: 'secureConnect', listener: () => void): this; - prependOnceListener(event: 'session', listener: (session: Buffer) => void): this; - prependOnceListener(event: 'keylog', listener: (line: Buffer) => void): this; - } - interface CommonConnectionOptions { - /** - * An optional TLS context object from tls.createSecureContext() - */ - secureContext?: SecureContext | undefined; - /** - * When enabled, TLS packet trace information is written to `stderr`. This can be - * used to debug TLS connection problems. - * @default false - */ - enableTrace?: boolean | undefined; - /** - * If true the server will request a certificate from clients that - * connect and attempt to verify that certificate. Defaults to - * false. - */ - requestCert?: boolean | undefined; - /** - * An array of strings or a Buffer naming possible ALPN protocols. - * (Protocols should be ordered by their priority.) - */ - ALPNProtocols?: string[] | Uint8Array[] | Uint8Array | undefined; - /** - * SNICallback(servername, cb) A function that will be - * called if the client supports SNI TLS extension. Two arguments - * will be passed when called: servername and cb. SNICallback should - * invoke cb(null, ctx), where ctx is a SecureContext instance. - * (tls.createSecureContext(...) can be used to get a proper - * SecureContext.) If SNICallback wasn't provided the default callback - * with high-level API will be used (see below). - */ - SNICallback?: ((servername: string, cb: (err: Error | null, ctx?: SecureContext) => void) => void) | undefined; - /** - * If true the server will reject any connection which is not - * authorized with the list of supplied CAs. This option only has an - * effect if requestCert is true. - * @default true - */ - rejectUnauthorized?: boolean | undefined; - } - interface TlsOptions extends SecureContextOptions, CommonConnectionOptions, net.ServerOpts { - /** - * Abort the connection if the SSL/TLS handshake does not finish in the - * specified number of milliseconds. A 'tlsClientError' is emitted on - * the tls.Server object whenever a handshake times out. Default: - * 120000 (120 seconds). - */ - handshakeTimeout?: number | undefined; - /** - * The number of seconds after which a TLS session created by the - * server will no longer be resumable. See Session Resumption for more - * information. Default: 300. - */ - sessionTimeout?: number | undefined; - /** - * 48-bytes of cryptographically strong pseudo-random data. - */ - ticketKeys?: Buffer | undefined; - /** - * - * @param socket - * @param identity identity parameter sent from the client. - * @return pre-shared key that must either be - * a buffer or `null` to stop the negotiation process. Returned PSK must be - * compatible with the selected cipher's digest. - * - * When negotiating TLS-PSK (pre-shared keys), this function is called - * with the identity provided by the client. - * If the return value is `null` the negotiation process will stop and an - * "unknown_psk_identity" alert message will be sent to the other party. - * If the server wishes to hide the fact that the PSK identity was not known, - * the callback must provide some random data as `psk` to make the connection - * fail with "decrypt_error" before negotiation is finished. - * PSK ciphers are disabled by default, and using TLS-PSK thus - * requires explicitly specifying a cipher suite with the `ciphers` option. - * More information can be found in the RFC 4279. - */ - pskCallback?(socket: TLSSocket, identity: string): DataView | NodeJS.TypedArray | null; - /** - * hint to send to a client to help - * with selecting the identity during TLS-PSK negotiation. Will be ignored - * in TLS 1.3. Upon failing to set pskIdentityHint `tlsClientError` will be - * emitted with `ERR_TLS_PSK_SET_IDENTIY_HINT_FAILED` code. - */ - pskIdentityHint?: string | undefined; - } - interface PSKCallbackNegotation { - psk: DataView | NodeJS.TypedArray; - identity: string; - } - interface ConnectionOptions extends SecureContextOptions, CommonConnectionOptions { - host?: string | undefined; - port?: number | undefined; - path?: string | undefined; // Creates unix socket connection to path. If this option is specified, `host` and `port` are ignored. - socket?: stream.Duplex | undefined; // Establish secure connection on a given socket rather than creating a new socket - checkServerIdentity?: typeof checkServerIdentity | undefined; - servername?: string | undefined; // SNI TLS Extension - session?: Buffer | undefined; - minDHSize?: number | undefined; - lookup?: net.LookupFunction | undefined; - timeout?: number | undefined; - /** - * When negotiating TLS-PSK (pre-shared keys), this function is called - * with optional identity `hint` provided by the server or `null` - * in case of TLS 1.3 where `hint` was removed. - * It will be necessary to provide a custom `tls.checkServerIdentity()` - * for the connection as the default one will try to check hostname/IP - * of the server against the certificate but that's not applicable for PSK - * because there won't be a certificate present. - * More information can be found in the RFC 4279. - * - * @param hint message sent from the server to help client - * decide which identity to use during negotiation. - * Always `null` if TLS 1.3 is used. - * @returns Return `null` to stop the negotiation process. `psk` must be - * compatible with the selected cipher's digest. - * `identity` must use UTF-8 encoding. - */ - pskCallback?(hint: string | null): PSKCallbackNegotation | null; - } - /** - * Accepts encrypted connections using TLS or SSL. - * @since v0.3.2 - */ - class Server extends net.Server { - constructor(secureConnectionListener?: (socket: TLSSocket) => void); - constructor(options: TlsOptions, secureConnectionListener?: (socket: TLSSocket) => void); - /** - * The `server.addContext()` method adds a secure context that will be used if - * the client request's SNI name matches the supplied `hostname` (or wildcard). - * - * When there are multiple matching contexts, the most recently added one is - * used. - * @since v0.5.3 - * @param hostname A SNI host name or wildcard (e.g. `'*'`) - * @param context An object containing any of the possible properties from the {@link createSecureContext} `options` arguments (e.g. `key`, `cert`, `ca`, etc). - */ - addContext(hostname: string, context: SecureContextOptions): void; - /** - * Returns the session ticket keys. - * - * See `Session Resumption` for more information. - * @since v3.0.0 - * @return A 48-byte buffer containing the session ticket keys. - */ - getTicketKeys(): Buffer; - /** - * The `server.setSecureContext()` method replaces the secure context of an - * existing server. Existing connections to the server are not interrupted. - * @since v11.0.0 - * @param options An object containing any of the possible properties from the {@link createSecureContext} `options` arguments (e.g. `key`, `cert`, `ca`, etc). - */ - setSecureContext(options: SecureContextOptions): void; - /** - * Sets the session ticket keys. - * - * Changes to the ticket keys are effective only for future server connections. - * Existing or currently pending server connections will use the previous keys. - * - * See `Session Resumption` for more information. - * @since v3.0.0 - * @param keys A 48-byte buffer containing the session ticket keys. - */ - setTicketKeys(keys: Buffer): void; - /** - * events.EventEmitter - * 1. tlsClientError - * 2. newSession - * 3. OCSPRequest - * 4. resumeSession - * 5. secureConnection - * 6. keylog - */ - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: 'tlsClientError', listener: (err: Error, tlsSocket: TLSSocket) => void): this; - addListener(event: 'newSession', listener: (sessionId: Buffer, sessionData: Buffer, callback: () => void) => void): this; - addListener(event: 'OCSPRequest', listener: (certificate: Buffer, issuer: Buffer, callback: (err: Error | null, resp: Buffer) => void) => void): this; - addListener(event: 'resumeSession', listener: (sessionId: Buffer, callback: (err: Error | null, sessionData: Buffer | null) => void) => void): this; - addListener(event: 'secureConnection', listener: (tlsSocket: TLSSocket) => void): this; - addListener(event: 'keylog', listener: (line: Buffer, tlsSocket: TLSSocket) => void): this; - emit(event: string | symbol, ...args: any[]): boolean; - emit(event: 'tlsClientError', err: Error, tlsSocket: TLSSocket): boolean; - emit(event: 'newSession', sessionId: Buffer, sessionData: Buffer, callback: () => void): boolean; - emit(event: 'OCSPRequest', certificate: Buffer, issuer: Buffer, callback: (err: Error | null, resp: Buffer) => void): boolean; - emit(event: 'resumeSession', sessionId: Buffer, callback: (err: Error | null, sessionData: Buffer | null) => void): boolean; - emit(event: 'secureConnection', tlsSocket: TLSSocket): boolean; - emit(event: 'keylog', line: Buffer, tlsSocket: TLSSocket): boolean; - on(event: string, listener: (...args: any[]) => void): this; - on(event: 'tlsClientError', listener: (err: Error, tlsSocket: TLSSocket) => void): this; - on(event: 'newSession', listener: (sessionId: Buffer, sessionData: Buffer, callback: () => void) => void): this; - on(event: 'OCSPRequest', listener: (certificate: Buffer, issuer: Buffer, callback: (err: Error | null, resp: Buffer) => void) => void): this; - on(event: 'resumeSession', listener: (sessionId: Buffer, callback: (err: Error | null, sessionData: Buffer | null) => void) => void): this; - on(event: 'secureConnection', listener: (tlsSocket: TLSSocket) => void): this; - on(event: 'keylog', listener: (line: Buffer, tlsSocket: TLSSocket) => void): this; - once(event: string, listener: (...args: any[]) => void): this; - once(event: 'tlsClientError', listener: (err: Error, tlsSocket: TLSSocket) => void): this; - once(event: 'newSession', listener: (sessionId: Buffer, sessionData: Buffer, callback: () => void) => void): this; - once(event: 'OCSPRequest', listener: (certificate: Buffer, issuer: Buffer, callback: (err: Error | null, resp: Buffer) => void) => void): this; - once(event: 'resumeSession', listener: (sessionId: Buffer, callback: (err: Error | null, sessionData: Buffer | null) => void) => void): this; - once(event: 'secureConnection', listener: (tlsSocket: TLSSocket) => void): this; - once(event: 'keylog', listener: (line: Buffer, tlsSocket: TLSSocket) => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: 'tlsClientError', listener: (err: Error, tlsSocket: TLSSocket) => void): this; - prependListener(event: 'newSession', listener: (sessionId: Buffer, sessionData: Buffer, callback: () => void) => void): this; - prependListener(event: 'OCSPRequest', listener: (certificate: Buffer, issuer: Buffer, callback: (err: Error | null, resp: Buffer) => void) => void): this; - prependListener(event: 'resumeSession', listener: (sessionId: Buffer, callback: (err: Error | null, sessionData: Buffer | null) => void) => void): this; - prependListener(event: 'secureConnection', listener: (tlsSocket: TLSSocket) => void): this; - prependListener(event: 'keylog', listener: (line: Buffer, tlsSocket: TLSSocket) => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: 'tlsClientError', listener: (err: Error, tlsSocket: TLSSocket) => void): this; - prependOnceListener(event: 'newSession', listener: (sessionId: Buffer, sessionData: Buffer, callback: () => void) => void): this; - prependOnceListener(event: 'OCSPRequest', listener: (certificate: Buffer, issuer: Buffer, callback: (err: Error | null, resp: Buffer) => void) => void): this; - prependOnceListener(event: 'resumeSession', listener: (sessionId: Buffer, callback: (err: Error | null, sessionData: Buffer | null) => void) => void): this; - prependOnceListener(event: 'secureConnection', listener: (tlsSocket: TLSSocket) => void): this; - prependOnceListener(event: 'keylog', listener: (line: Buffer, tlsSocket: TLSSocket) => void): this; - } - /** - * @deprecated since v0.11.3 Use `tls.TLSSocket` instead. - */ - interface SecurePair { - encrypted: TLSSocket; - cleartext: TLSSocket; - } - type SecureVersion = 'TLSv1.3' | 'TLSv1.2' | 'TLSv1.1' | 'TLSv1'; - interface SecureContextOptions { - /** - * Optionally override the trusted CA certificates. Default is to trust - * the well-known CAs curated by Mozilla. Mozilla's CAs are completely - * replaced when CAs are explicitly specified using this option. - */ - ca?: string | Buffer | Array | undefined; - /** - * Cert chains in PEM format. One cert chain should be provided per - * private key. Each cert chain should consist of the PEM formatted - * certificate for a provided private key, followed by the PEM - * formatted intermediate certificates (if any), in order, and not - * including the root CA (the root CA must be pre-known to the peer, - * see ca). When providing multiple cert chains, they do not have to - * be in the same order as their private keys in key. If the - * intermediate certificates are not provided, the peer will not be - * able to validate the certificate, and the handshake will fail. - */ - cert?: string | Buffer | Array | undefined; - /** - * Colon-separated list of supported signature algorithms. The list - * can contain digest algorithms (SHA256, MD5 etc.), public key - * algorithms (RSA-PSS, ECDSA etc.), combination of both (e.g - * 'RSA+SHA384') or TLS v1.3 scheme names (e.g. rsa_pss_pss_sha512). - */ - sigalgs?: string | undefined; - /** - * Cipher suite specification, replacing the default. For more - * information, see modifying the default cipher suite. Permitted - * ciphers can be obtained via tls.getCiphers(). Cipher names must be - * uppercased in order for OpenSSL to accept them. - */ - ciphers?: string | undefined; - /** - * Name of an OpenSSL engine which can provide the client certificate. - */ - clientCertEngine?: string | undefined; - /** - * PEM formatted CRLs (Certificate Revocation Lists). - */ - crl?: string | Buffer | Array | undefined; - /** - * Diffie Hellman parameters, required for Perfect Forward Secrecy. Use - * openssl dhparam to create the parameters. The key length must be - * greater than or equal to 1024 bits or else an error will be thrown. - * Although 1024 bits is permissible, use 2048 bits or larger for - * stronger security. If omitted or invalid, the parameters are - * silently discarded and DHE ciphers will not be available. - */ - dhparam?: string | Buffer | undefined; - /** - * A string describing a named curve or a colon separated list of curve - * NIDs or names, for example P-521:P-384:P-256, to use for ECDH key - * agreement. Set to auto to select the curve automatically. Use - * crypto.getCurves() to obtain a list of available curve names. On - * recent releases, openssl ecparam -list_curves will also display the - * name and description of each available elliptic curve. Default: - * tls.DEFAULT_ECDH_CURVE. - */ - ecdhCurve?: string | undefined; - /** - * Attempt to use the server's cipher suite preferences instead of the - * client's. When true, causes SSL_OP_CIPHER_SERVER_PREFERENCE to be - * set in secureOptions - */ - honorCipherOrder?: boolean | undefined; - /** - * Private keys in PEM format. PEM allows the option of private keys - * being encrypted. Encrypted keys will be decrypted with - * options.passphrase. Multiple keys using different algorithms can be - * provided either as an array of unencrypted key strings or buffers, - * or an array of objects in the form {pem: [, - * passphrase: ]}. The object form can only occur in an array. - * object.passphrase is optional. Encrypted keys will be decrypted with - * object.passphrase if provided, or options.passphrase if it is not. - */ - key?: string | Buffer | Array | undefined; - /** - * Name of an OpenSSL engine to get private key from. Should be used - * together with privateKeyIdentifier. - */ - privateKeyEngine?: string | undefined; - /** - * Identifier of a private key managed by an OpenSSL engine. Should be - * used together with privateKeyEngine. Should not be set together with - * key, because both options define a private key in different ways. - */ - privateKeyIdentifier?: string | undefined; - /** - * Optionally set the maximum TLS version to allow. One - * of `'TLSv1.3'`, `'TLSv1.2'`, `'TLSv1.1'`, or `'TLSv1'`. Cannot be specified along with the - * `secureProtocol` option, use one or the other. - * **Default:** `'TLSv1.3'`, unless changed using CLI options. Using - * `--tls-max-v1.2` sets the default to `'TLSv1.2'`. Using `--tls-max-v1.3` sets the default to - * `'TLSv1.3'`. If multiple of the options are provided, the highest maximum is used. - */ - maxVersion?: SecureVersion | undefined; - /** - * Optionally set the minimum TLS version to allow. One - * of `'TLSv1.3'`, `'TLSv1.2'`, `'TLSv1.1'`, or `'TLSv1'`. Cannot be specified along with the - * `secureProtocol` option, use one or the other. It is not recommended to use - * less than TLSv1.2, but it may be required for interoperability. - * **Default:** `'TLSv1.2'`, unless changed using CLI options. Using - * `--tls-v1.0` sets the default to `'TLSv1'`. Using `--tls-v1.1` sets the default to - * `'TLSv1.1'`. Using `--tls-min-v1.3` sets the default to - * 'TLSv1.3'. If multiple of the options are provided, the lowest minimum is used. - */ - minVersion?: SecureVersion | undefined; - /** - * Shared passphrase used for a single private key and/or a PFX. - */ - passphrase?: string | undefined; - /** - * PFX or PKCS12 encoded private key and certificate chain. pfx is an - * alternative to providing key and cert individually. PFX is usually - * encrypted, if it is, passphrase will be used to decrypt it. Multiple - * PFX can be provided either as an array of unencrypted PFX buffers, - * or an array of objects in the form {buf: [, - * passphrase: ]}. The object form can only occur in an array. - * object.passphrase is optional. Encrypted PFX will be decrypted with - * object.passphrase if provided, or options.passphrase if it is not. - */ - pfx?: string | Buffer | Array | undefined; - /** - * Optionally affect the OpenSSL protocol behavior, which is not - * usually necessary. This should be used carefully if at all! Value is - * a numeric bitmask of the SSL_OP_* options from OpenSSL Options - */ - secureOptions?: number | undefined; // Value is a numeric bitmask of the `SSL_OP_*` options - /** - * Legacy mechanism to select the TLS protocol version to use, it does - * not support independent control of the minimum and maximum version, - * and does not support limiting the protocol to TLSv1.3. Use - * minVersion and maxVersion instead. The possible values are listed as - * SSL_METHODS, use the function names as strings. For example, use - * 'TLSv1_1_method' to force TLS version 1.1, or 'TLS_method' to allow - * any TLS protocol version up to TLSv1.3. It is not recommended to use - * TLS versions less than 1.2, but it may be required for - * interoperability. Default: none, see minVersion. - */ - secureProtocol?: string | undefined; - /** - * Opaque identifier used by servers to ensure session state is not - * shared between applications. Unused by clients. - */ - sessionIdContext?: string | undefined; - /** - * 48-bytes of cryptographically strong pseudo-random data. - * See Session Resumption for more information. - */ - ticketKeys?: Buffer | undefined; - /** - * The number of seconds after which a TLS session created by the - * server will no longer be resumable. See Session Resumption for more - * information. Default: 300. - */ - sessionTimeout?: number | undefined; - } - interface SecureContext { - context: any; - } - /** - * Verifies the certificate `cert` is issued to `hostname`. - * - * Returns [Error](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error) object, populating it with `reason`, `host`, and `cert` on - * failure. On success, returns [undefined](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Undefined_type). - * - * This function is intended to be used in combination with the`checkServerIdentity` option that can be passed to {@link connect} and as - * such operates on a `certificate object`. For other purposes, consider using `x509.checkHost()` instead. - * - * This function can be overwritten by providing an alternative function as the`options.checkServerIdentity` option that is passed to `tls.connect()`. The - * overwriting function can call `tls.checkServerIdentity()` of course, to augment - * the checks done with additional verification. - * - * This function is only called if the certificate passed all other checks, such as - * being issued by trusted CA (`options.ca`). - * - * Earlier versions of Node.js incorrectly accepted certificates for a given`hostname` if a matching `uniformResourceIdentifier` subject alternative name - * was present (see [CVE-2021-44531](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-44531)). Applications that wish to accept`uniformResourceIdentifier` subject alternative names can use - * a custom`options.checkServerIdentity` function that implements the desired behavior. - * @since v0.8.4 - * @param hostname The host name or IP address to verify the certificate against. - * @param cert A `certificate object` representing the peer's certificate. - */ - function checkServerIdentity(hostname: string, cert: PeerCertificate): Error | undefined; - /** - * Creates a new {@link Server}. The `secureConnectionListener`, if provided, is - * automatically set as a listener for the `'secureConnection'` event. - * - * The `ticketKeys` options is automatically shared between `cluster` module - * workers. - * - * The following illustrates a simple echo server: - * - * ```js - * const tls = require('tls'); - * const fs = require('fs'); - * - * const options = { - * key: fs.readFileSync('server-key.pem'), - * cert: fs.readFileSync('server-cert.pem'), - * - * // This is necessary only if using client certificate authentication. - * requestCert: true, - * - * // This is necessary only if the client uses a self-signed certificate. - * ca: [ fs.readFileSync('client-cert.pem') ] - * }; - * - * const server = tls.createServer(options, (socket) => { - * console.log('server connected', - * socket.authorized ? 'authorized' : 'unauthorized'); - * socket.write('welcome!\n'); - * socket.setEncoding('utf8'); - * socket.pipe(socket); - * }); - * server.listen(8000, () => { - * console.log('server bound'); - * }); - * ``` - * - * The server can be tested by connecting to it using the example client from {@link connect}. - * @since v0.3.2 - */ - function createServer(secureConnectionListener?: (socket: TLSSocket) => void): Server; - function createServer(options: TlsOptions, secureConnectionListener?: (socket: TLSSocket) => void): Server; - /** - * The `callback` function, if specified, will be added as a listener for the `'secureConnect'` event. - * - * `tls.connect()` returns a {@link TLSSocket} object. - * - * Unlike the `https` API, `tls.connect()` does not enable the - * SNI (Server Name Indication) extension by default, which may cause some - * servers to return an incorrect certificate or reject the connection - * altogether. To enable SNI, set the `servername` option in addition - * to `host`. - * - * The following illustrates a client for the echo server example from {@link createServer}: - * - * ```js - * // Assumes an echo server that is listening on port 8000. - * const tls = require('tls'); - * const fs = require('fs'); - * - * const options = { - * // Necessary only if the server requires client certificate authentication. - * key: fs.readFileSync('client-key.pem'), - * cert: fs.readFileSync('client-cert.pem'), - * - * // Necessary only if the server uses a self-signed certificate. - * ca: [ fs.readFileSync('server-cert.pem') ], - * - * // Necessary only if the server's cert isn't for "localhost". - * checkServerIdentity: () => { return null; }, - * }; - * - * const socket = tls.connect(8000, options, () => { - * console.log('client connected', - * socket.authorized ? 'authorized' : 'unauthorized'); - * process.stdin.pipe(socket); - * process.stdin.resume(); - * }); - * socket.setEncoding('utf8'); - * socket.on('data', (data) => { - * console.log(data); - * }); - * socket.on('end', () => { - * console.log('server ends connection'); - * }); - * ``` - * @since v0.11.3 - */ - function connect(options: ConnectionOptions, secureConnectListener?: () => void): TLSSocket; - function connect(port: number, host?: string, options?: ConnectionOptions, secureConnectListener?: () => void): TLSSocket; - function connect(port: number, options?: ConnectionOptions, secureConnectListener?: () => void): TLSSocket; - /** - * Creates a new secure pair object with two streams, one of which reads and writes - * the encrypted data and the other of which reads and writes the cleartext data. - * Generally, the encrypted stream is piped to/from an incoming encrypted data - * stream and the cleartext one is used as a replacement for the initial encrypted - * stream. - * - * `tls.createSecurePair()` returns a `tls.SecurePair` object with `cleartext` and`encrypted` stream properties. - * - * Using `cleartext` has the same API as {@link TLSSocket}. - * - * The `tls.createSecurePair()` method is now deprecated in favor of`tls.TLSSocket()`. For example, the code: - * - * ```js - * pair = tls.createSecurePair(// ... ); - * pair.encrypted.pipe(socket); - * socket.pipe(pair.encrypted); - * ``` - * - * can be replaced by: - * - * ```js - * secureSocket = tls.TLSSocket(socket, options); - * ``` - * - * where `secureSocket` has the same API as `pair.cleartext`. - * @since v0.3.2 - * @deprecated Since v0.11.3 - Use {@link TLSSocket} instead. - * @param context A secure context object as returned by `tls.createSecureContext()` - * @param isServer `true` to specify that this TLS connection should be opened as a server. - * @param requestCert `true` to specify whether a server should request a certificate from a connecting client. Only applies when `isServer` is `true`. - * @param rejectUnauthorized If not `false` a server automatically reject clients with invalid certificates. Only applies when `isServer` is `true`. - */ - function createSecurePair(context?: SecureContext, isServer?: boolean, requestCert?: boolean, rejectUnauthorized?: boolean): SecurePair; - /** - * {@link createServer} sets the default value of the `honorCipherOrder` option - * to `true`, other APIs that create secure contexts leave it unset. - * - * {@link createServer} uses a 128 bit truncated SHA1 hash value generated - * from `process.argv` as the default value of the `sessionIdContext` option, other - * APIs that create secure contexts have no default value. - * - * The `tls.createSecureContext()` method creates a `SecureContext` object. It is - * usable as an argument to several `tls` APIs, such as {@link createServer} and `server.addContext()`, but has no public methods. - * - * A key is _required_ for ciphers that use certificates. Either `key` or`pfx` can be used to provide it. - * - * If the `ca` option is not given, then Node.js will default to using [Mozilla's publicly trusted list of - * CAs](https://hg.mozilla.org/mozilla-central/raw-file/tip/security/nss/lib/ckfw/builtins/certdata.txt). - * @since v0.11.13 - */ - function createSecureContext(options?: SecureContextOptions): SecureContext; - /** - * Returns an array with the names of the supported TLS ciphers. The names are - * lower-case for historical reasons, but must be uppercased to be used in - * the `ciphers` option of {@link createSecureContext}. - * - * Not all supported ciphers are enabled by default. See `Modifying the default TLS cipher suite`. - * - * Cipher names that start with `'tls_'` are for TLSv1.3, all the others are for - * TLSv1.2 and below. - * - * ```js - * console.log(tls.getCiphers()); // ['aes128-gcm-sha256', 'aes128-sha', ...] - * ``` - * @since v0.10.2 - */ - function getCiphers(): string[]; - /** - * The default curve name to use for ECDH key agreement in a tls server. - * The default value is 'auto'. See tls.createSecureContext() for further - * information. - */ - let DEFAULT_ECDH_CURVE: string; - /** - * The default value of the maxVersion option of - * tls.createSecureContext(). It can be assigned any of the supported TLS - * protocol versions, 'TLSv1.3', 'TLSv1.2', 'TLSv1.1', or 'TLSv1'. Default: - * 'TLSv1.3', unless changed using CLI options. Using --tls-max-v1.2 sets - * the default to 'TLSv1.2'. Using --tls-max-v1.3 sets the default to - * 'TLSv1.3'. If multiple of the options are provided, the highest maximum - * is used. - */ - let DEFAULT_MAX_VERSION: SecureVersion; - /** - * The default value of the minVersion option of tls.createSecureContext(). - * It can be assigned any of the supported TLS protocol versions, - * 'TLSv1.3', 'TLSv1.2', 'TLSv1.1', or 'TLSv1'. Default: 'TLSv1.2', unless - * changed using CLI options. Using --tls-min-v1.0 sets the default to - * 'TLSv1'. Using --tls-min-v1.1 sets the default to 'TLSv1.1'. Using - * --tls-min-v1.3 sets the default to 'TLSv1.3'. If multiple of the options - * are provided, the lowest minimum is used. - */ - let DEFAULT_MIN_VERSION: SecureVersion; - /** - * An immutable array of strings representing the root certificates (in PEM - * format) used for verifying peer certificates. This is the default value - * of the ca option to tls.createSecureContext(). - */ - const rootCertificates: ReadonlyArray; -} -declare module 'node:tls' { - export * from 'tls'; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/trace_events.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/trace_events.d.ts deleted file mode 100755 index d47aa931..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/trace_events.d.ts +++ /dev/null @@ -1,171 +0,0 @@ -/** - * The `trace_events` module provides a mechanism to centralize tracing information - * generated by V8, Node.js core, and userspace code. - * - * Tracing can be enabled with the `--trace-event-categories` command-line flag - * or by using the `trace_events` module. The `--trace-event-categories` flag - * accepts a list of comma-separated category names. - * - * The available categories are: - * - * * `node`: An empty placeholder. - * * `node.async_hooks`: Enables capture of detailed `async_hooks` trace data. - * The `async_hooks` events have a unique `asyncId` and a special `triggerId` `triggerAsyncId` property. - * * `node.bootstrap`: Enables capture of Node.js bootstrap milestones. - * * `node.console`: Enables capture of `console.time()` and `console.count()`output. - * * `node.dns.native`: Enables capture of trace data for DNS queries. - * * `node.environment`: Enables capture of Node.js Environment milestones. - * * `node.fs.sync`: Enables capture of trace data for file system sync methods. - * * `node.perf`: Enables capture of `Performance API` measurements. - * * `node.perf.usertiming`: Enables capture of only Performance API User Timing - * measures and marks. - * * `node.perf.timerify`: Enables capture of only Performance API timerify - * measurements. - * * `node.promises.rejections`: Enables capture of trace data tracking the number - * of unhandled Promise rejections and handled-after-rejections. - * * `node.vm.script`: Enables capture of trace data for the `vm` module's`runInNewContext()`, `runInContext()`, and `runInThisContext()` methods. - * * `v8`: The `V8` events are GC, compiling, and execution related. - * - * By default the `node`, `node.async_hooks`, and `v8` categories are enabled. - * - * ```bash - * node --trace-event-categories v8,node,node.async_hooks server.js - * ``` - * - * Prior versions of Node.js required the use of the `--trace-events-enabled`flag to enable trace events. This requirement has been removed. However, the`--trace-events-enabled` flag _may_ still be - * used and will enable the`node`, `node.async_hooks`, and `v8` trace event categories by default. - * - * ```bash - * node --trace-events-enabled - * - * # is equivalent to - * - * node --trace-event-categories v8,node,node.async_hooks - * ``` - * - * Alternatively, trace events may be enabled using the `trace_events` module: - * - * ```js - * const trace_events = require('trace_events'); - * const tracing = trace_events.createTracing({ categories: ['node.perf'] }); - * tracing.enable(); // Enable trace event capture for the 'node.perf' category - * - * // do work - * - * tracing.disable(); // Disable trace event capture for the 'node.perf' category - * ``` - * - * Running Node.js with tracing enabled will produce log files that can be opened - * in the [`chrome://tracing`](https://www.chromium.org/developers/how-tos/trace-event-profiling-tool) tab of Chrome. - * - * The logging file is by default called `node_trace.${rotation}.log`, where`${rotation}` is an incrementing log-rotation id. The filepath pattern can - * be specified with `--trace-event-file-pattern` that accepts a template - * string that supports `${rotation}` and `${pid}`: - * - * ```bash - * node --trace-event-categories v8 --trace-event-file-pattern '${pid}-${rotation}.log' server.js - * ``` - * - * To guarantee that the log file is properly generated after signal events like`SIGINT`, `SIGTERM`, or `SIGBREAK`, make sure to have the appropriate handlers - * in your code, such as: - * - * ```js - * process.on('SIGINT', function onSigint() { - * console.info('Received SIGINT.'); - * process.exit(130); // Or applicable exit code depending on OS and signal - * }); - * ``` - * - * The tracing system uses the same time source - * as the one used by `process.hrtime()`. - * However the trace-event timestamps are expressed in microseconds, - * unlike `process.hrtime()` which returns nanoseconds. - * - * The features from this module are not available in `Worker` threads. - * @experimental - * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/trace_events.js) - */ -declare module 'trace_events' { - /** - * The `Tracing` object is used to enable or disable tracing for sets of - * categories. Instances are created using the - * `trace_events.createTracing()` method. - * - * When created, the `Tracing` object is disabled. Calling the - * `tracing.enable()` method adds the categories to the set of enabled trace - * event categories. Calling `tracing.disable()` will remove the categories - * from the set of enabled trace event categories. - */ - interface Tracing { - /** - * A comma-separated list of the trace event categories covered by this - * `Tracing` object. - */ - readonly categories: string; - /** - * Disables this `Tracing` object. - * - * Only trace event categories _not_ covered by other enabled `Tracing` - * objects and _not_ specified by the `--trace-event-categories` flag - * will be disabled. - */ - disable(): void; - /** - * Enables this `Tracing` object for the set of categories covered by - * the `Tracing` object. - */ - enable(): void; - /** - * `true` only if the `Tracing` object has been enabled. - */ - readonly enabled: boolean; - } - interface CreateTracingOptions { - /** - * An array of trace category names. Values included in the array are - * coerced to a string when possible. An error will be thrown if the - * value cannot be coerced. - */ - categories: string[]; - } - /** - * Creates and returns a `Tracing` object for the given set of `categories`. - * - * ```js - * const trace_events = require('trace_events'); - * const categories = ['node.perf', 'node.async_hooks']; - * const tracing = trace_events.createTracing({ categories }); - * tracing.enable(); - * // do stuff - * tracing.disable(); - * ``` - * @since v10.0.0 - * @return . - */ - function createTracing(options: CreateTracingOptions): Tracing; - /** - * Returns a comma-separated list of all currently-enabled trace event - * categories. The current set of enabled trace event categories is determined - * by the _union_ of all currently-enabled `Tracing` objects and any categories - * enabled using the `--trace-event-categories` flag. - * - * Given the file `test.js` below, the command`node --trace-event-categories node.perf test.js` will print`'node.async_hooks,node.perf'` to the console. - * - * ```js - * const trace_events = require('trace_events'); - * const t1 = trace_events.createTracing({ categories: ['node.async_hooks'] }); - * const t2 = trace_events.createTracing({ categories: ['node.perf'] }); - * const t3 = trace_events.createTracing({ categories: ['v8'] }); - * - * t1.enable(); - * t2.enable(); - * - * console.log(trace_events.getEnabledCategories()); - * ``` - * @since v10.0.0 - */ - function getEnabledCategories(): string | undefined; -} -declare module 'node:trace_events' { - export * from 'trace_events'; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/tty.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/tty.d.ts deleted file mode 100755 index 6473f8db..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/tty.d.ts +++ /dev/null @@ -1,206 +0,0 @@ -/** - * The `tty` module provides the `tty.ReadStream` and `tty.WriteStream` classes. - * In most cases, it will not be necessary or possible to use this module directly. - * However, it can be accessed using: - * - * ```js - * const tty = require('tty'); - * ``` - * - * When Node.js detects that it is being run with a text terminal ("TTY") - * attached, `process.stdin` will, by default, be initialized as an instance of`tty.ReadStream` and both `process.stdout` and `process.stderr` will, by - * default, be instances of `tty.WriteStream`. The preferred method of determining - * whether Node.js is being run within a TTY context is to check that the value of - * the `process.stdout.isTTY` property is `true`: - * - * ```console - * $ node -p -e "Boolean(process.stdout.isTTY)" - * true - * $ node -p -e "Boolean(process.stdout.isTTY)" | cat - * false - * ``` - * - * In most cases, there should be little to no reason for an application to - * manually create instances of the `tty.ReadStream` and `tty.WriteStream`classes. - * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/tty.js) - */ -declare module 'tty' { - import * as net from 'node:net'; - /** - * The `tty.isatty()` method returns `true` if the given `fd` is associated with - * a TTY and `false` if it is not, including whenever `fd` is not a non-negative - * integer. - * @since v0.5.8 - * @param fd A numeric file descriptor - */ - function isatty(fd: number): boolean; - /** - * Represents the readable side of a TTY. In normal circumstances `process.stdin` will be the only `tty.ReadStream` instance in a Node.js - * process and there should be no reason to create additional instances. - * @since v0.5.8 - */ - class ReadStream extends net.Socket { - constructor(fd: number, options?: net.SocketConstructorOpts); - /** - * A `boolean` that is `true` if the TTY is currently configured to operate as a - * raw device. Defaults to `false`. - * @since v0.7.7 - */ - isRaw: boolean; - /** - * Allows configuration of `tty.ReadStream` so that it operates as a raw device. - * - * When in raw mode, input is always available character-by-character, not - * including modifiers. Additionally, all special processing of characters by the - * terminal is disabled, including echoing input - * characters. Ctrl+C will no longer cause a `SIGINT` when - * in this mode. - * @since v0.7.7 - * @param mode If `true`, configures the `tty.ReadStream` to operate as a raw device. If `false`, configures the `tty.ReadStream` to operate in its default mode. The `readStream.isRaw` - * property will be set to the resulting mode. - * @return The read stream instance. - */ - setRawMode(mode: boolean): this; - /** - * A `boolean` that is always `true` for `tty.ReadStream` instances. - * @since v0.5.8 - */ - isTTY: boolean; - } - /** - * -1 - to the left from cursor - * 0 - the entire line - * 1 - to the right from cursor - */ - type Direction = -1 | 0 | 1; - /** - * Represents the writable side of a TTY. In normal circumstances,`process.stdout` and `process.stderr` will be the only`tty.WriteStream` instances created for a Node.js process and there - * should be no reason to create additional instances. - * @since v0.5.8 - */ - class WriteStream extends net.Socket { - constructor(fd: number); - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: 'resize', listener: () => void): this; - emit(event: string | symbol, ...args: any[]): boolean; - emit(event: 'resize'): boolean; - on(event: string, listener: (...args: any[]) => void): this; - on(event: 'resize', listener: () => void): this; - once(event: string, listener: (...args: any[]) => void): this; - once(event: 'resize', listener: () => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: 'resize', listener: () => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: 'resize', listener: () => void): this; - /** - * `writeStream.clearLine()` clears the current line of this `WriteStream` in a - * direction identified by `dir`. - * @since v0.7.7 - * @param callback Invoked once the operation completes. - * @return `false` if the stream wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`. - */ - clearLine(dir: Direction, callback?: () => void): boolean; - /** - * `writeStream.clearScreenDown()` clears this `WriteStream` from the current - * cursor down. - * @since v0.7.7 - * @param callback Invoked once the operation completes. - * @return `false` if the stream wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`. - */ - clearScreenDown(callback?: () => void): boolean; - /** - * `writeStream.cursorTo()` moves this `WriteStream`'s cursor to the specified - * position. - * @since v0.7.7 - * @param callback Invoked once the operation completes. - * @return `false` if the stream wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`. - */ - cursorTo(x: number, y?: number, callback?: () => void): boolean; - cursorTo(x: number, callback: () => void): boolean; - /** - * `writeStream.moveCursor()` moves this `WriteStream`'s cursor _relative_ to its - * current position. - * @since v0.7.7 - * @param callback Invoked once the operation completes. - * @return `false` if the stream wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`. - */ - moveCursor(dx: number, dy: number, callback?: () => void): boolean; - /** - * Returns: - * - * * `1` for 2, - * * `4` for 16, - * * `8` for 256, - * * `24` for 16,777,216 colors supported. - * - * Use this to determine what colors the terminal supports. Due to the nature of - * colors in terminals it is possible to either have false positives or false - * negatives. It depends on process information and the environment variables that - * may lie about what terminal is used. - * It is possible to pass in an `env` object to simulate the usage of a specific - * terminal. This can be useful to check how specific environment settings behave. - * - * To enforce a specific color support, use one of the below environment settings. - * - * * 2 colors: `FORCE_COLOR = 0` (Disables colors) - * * 16 colors: `FORCE_COLOR = 1` - * * 256 colors: `FORCE_COLOR = 2` - * * 16,777,216 colors: `FORCE_COLOR = 3` - * - * Disabling color support is also possible by using the `NO_COLOR` and`NODE_DISABLE_COLORS` environment variables. - * @since v9.9.0 - * @param [env=process.env] An object containing the environment variables to check. This enables simulating the usage of a specific terminal. - */ - getColorDepth(env?: object): number; - /** - * Returns `true` if the `writeStream` supports at least as many colors as provided - * in `count`. Minimum support is 2 (black and white). - * - * This has the same false positives and negatives as described in `writeStream.getColorDepth()`. - * - * ```js - * process.stdout.hasColors(); - * // Returns true or false depending on if `stdout` supports at least 16 colors. - * process.stdout.hasColors(256); - * // Returns true or false depending on if `stdout` supports at least 256 colors. - * process.stdout.hasColors({ TMUX: '1' }); - * // Returns true. - * process.stdout.hasColors(2 ** 24, { TMUX: '1' }); - * // Returns false (the environment setting pretends to support 2 ** 8 colors). - * ``` - * @since v11.13.0, v10.16.0 - * @param [count=16] The number of colors that are requested (minimum 2). - * @param [env=process.env] An object containing the environment variables to check. This enables simulating the usage of a specific terminal. - */ - hasColors(count?: number): boolean; - hasColors(env?: object): boolean; - hasColors(count: number, env?: object): boolean; - /** - * `writeStream.getWindowSize()` returns the size of the TTY - * corresponding to this `WriteStream`. The array is of the type`[numColumns, numRows]` where `numColumns` and `numRows` represent the number - * of columns and rows in the corresponding TTY. - * @since v0.7.7 - */ - getWindowSize(): [number, number]; - /** - * A `number` specifying the number of columns the TTY currently has. This property - * is updated whenever the `'resize'` event is emitted. - * @since v0.7.7 - */ - columns: number; - /** - * A `number` specifying the number of rows the TTY currently has. This property - * is updated whenever the `'resize'` event is emitted. - * @since v0.7.7 - */ - rows: number; - /** - * A `boolean` that is always `true`. - * @since v0.5.8 - */ - isTTY: boolean; - } -} -declare module 'node:tty' { - export * from 'tty'; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/url.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/url.d.ts deleted file mode 100755 index e172acbf..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/url.d.ts +++ /dev/null @@ -1,897 +0,0 @@ -/** - * The `url` module provides utilities for URL resolution and parsing. It can be - * accessed using: - * - * ```js - * import url from 'url'; - * ``` - * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/url.js) - */ -declare module 'url' { - import { Blob as NodeBlob } from 'node:buffer'; - import { ClientRequestArgs } from 'node:http'; - import { ParsedUrlQuery, ParsedUrlQueryInput } from 'node:querystring'; - // Input to `url.format` - interface UrlObject { - auth?: string | null | undefined; - hash?: string | null | undefined; - host?: string | null | undefined; - hostname?: string | null | undefined; - href?: string | null | undefined; - pathname?: string | null | undefined; - protocol?: string | null | undefined; - search?: string | null | undefined; - slashes?: boolean | null | undefined; - port?: string | number | null | undefined; - query?: string | null | ParsedUrlQueryInput | undefined; - } - // Output of `url.parse` - interface Url { - auth: string | null; - hash: string | null; - host: string | null; - hostname: string | null; - href: string; - path: string | null; - pathname: string | null; - protocol: string | null; - search: string | null; - slashes: boolean | null; - port: string | null; - query: string | null | ParsedUrlQuery; - } - interface UrlWithParsedQuery extends Url { - query: ParsedUrlQuery; - } - interface UrlWithStringQuery extends Url { - query: string | null; - } - /** - * The `url.parse()` method takes a URL string, parses it, and returns a URL - * object. - * - * A `TypeError` is thrown if `urlString` is not a string. - * - * A `URIError` is thrown if the `auth` property is present but cannot be decoded. - * - * Use of the legacy `url.parse()` method is discouraged. Users should - * use the WHATWG `URL` API. Because the `url.parse()` method uses a - * lenient, non-standard algorithm for parsing URL strings, security - * issues can be introduced. Specifically, issues with [host name spoofing](https://hackerone.com/reports/678487) and - * incorrect handling of usernames and passwords have been identified. - * - * Deprecation of this API has been shelved for now primarily due to the the - * inability of the [WHATWG API to parse relative URLs](https://github.com/nodejs/node/issues/12682#issuecomment-1154492373). - * [Discussions are ongoing](https://github.com/whatwg/url/issues/531) for the best way to resolve this. - * - * @since v0.1.25 - * @param urlString The URL string to parse. - * @param [parseQueryString=false] If `true`, the `query` property will always be set to an object returned by the {@link querystring} module's `parse()` method. If `false`, the `query` property - * on the returned URL object will be an unparsed, undecoded string. - * @param [slashesDenoteHost=false] If `true`, the first token after the literal string `//` and preceding the next `/` will be interpreted as the `host`. For instance, given `//foo/bar`, the - * result would be `{host: 'foo', pathname: '/bar'}` rather than `{pathname: '//foo/bar'}`. - */ - function parse(urlString: string): UrlWithStringQuery; - function parse(urlString: string, parseQueryString: false | undefined, slashesDenoteHost?: boolean): UrlWithStringQuery; - function parse(urlString: string, parseQueryString: true, slashesDenoteHost?: boolean): UrlWithParsedQuery; - function parse(urlString: string, parseQueryString: boolean, slashesDenoteHost?: boolean): Url; - /** - * The `url.format()` method returns a formatted URL string derived from`urlObject`. - * - * ```js - * const url = require('url'); - * url.format({ - * protocol: 'https', - * hostname: 'example.com', - * pathname: '/some/path', - * query: { - * page: 1, - * format: 'json' - * } - * }); - * - * // => 'https://example.com/some/path?page=1&format=json' - * ``` - * - * If `urlObject` is not an object or a string, `url.format()` will throw a `TypeError`. - * - * The formatting process operates as follows: - * - * * A new empty string `result` is created. - * * If `urlObject.protocol` is a string, it is appended as-is to `result`. - * * Otherwise, if `urlObject.protocol` is not `undefined` and is not a string, an `Error` is thrown. - * * For all string values of `urlObject.protocol` that _do not end_ with an ASCII - * colon (`:`) character, the literal string `:` will be appended to `result`. - * * If either of the following conditions is true, then the literal string `//`will be appended to `result`: - * * `urlObject.slashes` property is true; - * * `urlObject.protocol` begins with `http`, `https`, `ftp`, `gopher`, or`file`; - * * If the value of the `urlObject.auth` property is truthy, and either`urlObject.host` or `urlObject.hostname` are not `undefined`, the value of`urlObject.auth` will be coerced into a string - * and appended to `result`followed by the literal string `@`. - * * If the `urlObject.host` property is `undefined` then: - * * If the `urlObject.hostname` is a string, it is appended to `result`. - * * Otherwise, if `urlObject.hostname` is not `undefined` and is not a string, - * an `Error` is thrown. - * * If the `urlObject.port` property value is truthy, and `urlObject.hostname`is not `undefined`: - * * The literal string `:` is appended to `result`, and - * * The value of `urlObject.port` is coerced to a string and appended to`result`. - * * Otherwise, if the `urlObject.host` property value is truthy, the value of`urlObject.host` is coerced to a string and appended to `result`. - * * If the `urlObject.pathname` property is a string that is not an empty string: - * * If the `urlObject.pathname`_does not start_ with an ASCII forward slash - * (`/`), then the literal string `'/'` is appended to `result`. - * * The value of `urlObject.pathname` is appended to `result`. - * * Otherwise, if `urlObject.pathname` is not `undefined` and is not a string, an `Error` is thrown. - * * If the `urlObject.search` property is `undefined` and if the `urlObject.query`property is an `Object`, the literal string `?` is appended to `result`followed by the output of calling the - * `querystring` module's `stringify()`method passing the value of `urlObject.query`. - * * Otherwise, if `urlObject.search` is a string: - * * If the value of `urlObject.search`_does not start_ with the ASCII question - * mark (`?`) character, the literal string `?` is appended to `result`. - * * The value of `urlObject.search` is appended to `result`. - * * Otherwise, if `urlObject.search` is not `undefined` and is not a string, an `Error` is thrown. - * * If the `urlObject.hash` property is a string: - * * If the value of `urlObject.hash`_does not start_ with the ASCII hash (`#`) - * character, the literal string `#` is appended to `result`. - * * The value of `urlObject.hash` is appended to `result`. - * * Otherwise, if the `urlObject.hash` property is not `undefined` and is not a - * string, an `Error` is thrown. - * * `result` is returned. - * @since v0.1.25 - * @deprecated Legacy: Use the WHATWG URL API instead. - * @param urlObject A URL object (as returned by `url.parse()` or constructed otherwise). If a string, it is converted to an object by passing it to `url.parse()`. - */ - function format(urlObject: URL, options?: URLFormatOptions): string; - /** - * The `url.format()` method returns a formatted URL string derived from`urlObject`. - * - * ```js - * const url = require('url'); - * url.format({ - * protocol: 'https', - * hostname: 'example.com', - * pathname: '/some/path', - * query: { - * page: 1, - * format: 'json' - * } - * }); - * - * // => 'https://example.com/some/path?page=1&format=json' - * ``` - * - * If `urlObject` is not an object or a string, `url.format()` will throw a `TypeError`. - * - * The formatting process operates as follows: - * - * * A new empty string `result` is created. - * * If `urlObject.protocol` is a string, it is appended as-is to `result`. - * * Otherwise, if `urlObject.protocol` is not `undefined` and is not a string, an `Error` is thrown. - * * For all string values of `urlObject.protocol` that _do not end_ with an ASCII - * colon (`:`) character, the literal string `:` will be appended to `result`. - * * If either of the following conditions is true, then the literal string `//`will be appended to `result`: - * * `urlObject.slashes` property is true; - * * `urlObject.protocol` begins with `http`, `https`, `ftp`, `gopher`, or`file`; - * * If the value of the `urlObject.auth` property is truthy, and either`urlObject.host` or `urlObject.hostname` are not `undefined`, the value of`urlObject.auth` will be coerced into a string - * and appended to `result`followed by the literal string `@`. - * * If the `urlObject.host` property is `undefined` then: - * * If the `urlObject.hostname` is a string, it is appended to `result`. - * * Otherwise, if `urlObject.hostname` is not `undefined` and is not a string, - * an `Error` is thrown. - * * If the `urlObject.port` property value is truthy, and `urlObject.hostname`is not `undefined`: - * * The literal string `:` is appended to `result`, and - * * The value of `urlObject.port` is coerced to a string and appended to`result`. - * * Otherwise, if the `urlObject.host` property value is truthy, the value of`urlObject.host` is coerced to a string and appended to `result`. - * * If the `urlObject.pathname` property is a string that is not an empty string: - * * If the `urlObject.pathname`_does not start_ with an ASCII forward slash - * (`/`), then the literal string `'/'` is appended to `result`. - * * The value of `urlObject.pathname` is appended to `result`. - * * Otherwise, if `urlObject.pathname` is not `undefined` and is not a string, an `Error` is thrown. - * * If the `urlObject.search` property is `undefined` and if the `urlObject.query`property is an `Object`, the literal string `?` is appended to `result`followed by the output of calling the - * `querystring` module's `stringify()`method passing the value of `urlObject.query`. - * * Otherwise, if `urlObject.search` is a string: - * * If the value of `urlObject.search`_does not start_ with the ASCII question - * mark (`?`) character, the literal string `?` is appended to `result`. - * * The value of `urlObject.search` is appended to `result`. - * * Otherwise, if `urlObject.search` is not `undefined` and is not a string, an `Error` is thrown. - * * If the `urlObject.hash` property is a string: - * * If the value of `urlObject.hash`_does not start_ with the ASCII hash (`#`) - * character, the literal string `#` is appended to `result`. - * * The value of `urlObject.hash` is appended to `result`. - * * Otherwise, if the `urlObject.hash` property is not `undefined` and is not a - * string, an `Error` is thrown. - * * `result` is returned. - * @since v0.1.25 - * @deprecated Legacy: Use the WHATWG URL API instead. - * @param urlObject A URL object (as returned by `url.parse()` or constructed otherwise). If a string, it is converted to an object by passing it to `url.parse()`. - */ - function format(urlObject: UrlObject | string): string; - /** - * The `url.resolve()` method resolves a target URL relative to a base URL in a - * manner similar to that of a web browser resolving an anchor tag. - * - * ```js - * const url = require('url'); - * url.resolve('/one/two/three', 'four'); // '/one/two/four' - * url.resolve('http://example.com/', '/one'); // 'http://example.com/one' - * url.resolve('http://example.com/one', '/two'); // 'http://example.com/two' - * ``` - * - * To achieve the same result using the WHATWG URL API: - * - * ```js - * function resolve(from, to) { - * const resolvedUrl = new URL(to, new URL(from, 'resolve://')); - * if (resolvedUrl.protocol === 'resolve:') { - * // `from` is a relative URL. - * const { pathname, search, hash } = resolvedUrl; - * return pathname + search + hash; - * } - * return resolvedUrl.toString(); - * } - * - * resolve('/one/two/three', 'four'); // '/one/two/four' - * resolve('http://example.com/', '/one'); // 'http://example.com/one' - * resolve('http://example.com/one', '/two'); // 'http://example.com/two' - * ``` - * @since v0.1.25 - * @deprecated Legacy: Use the WHATWG URL API instead. - * @param from The base URL to use if `to` is a relative URL. - * @param to The target URL to resolve. - */ - function resolve(from: string, to: string): string; - /** - * Returns the [Punycode](https://tools.ietf.org/html/rfc5891#section-4.4) ASCII serialization of the `domain`. If `domain` is an - * invalid domain, the empty string is returned. - * - * It performs the inverse operation to {@link domainToUnicode}. - * - * This feature is only available if the `node` executable was compiled with `ICU` enabled. If not, the domain names are passed through unchanged. - * - * ```js - * import url from 'url'; - * - * console.log(url.domainToASCII('español.com')); - * // Prints xn--espaol-zwa.com - * console.log(url.domainToASCII('中文.com')); - * // Prints xn--fiq228c.com - * console.log(url.domainToASCII('xn--iñvalid.com')); - * // Prints an empty string - * ``` - * @since v7.4.0, v6.13.0 - */ - function domainToASCII(domain: string): string; - /** - * Returns the Unicode serialization of the `domain`. If `domain` is an invalid - * domain, the empty string is returned. - * - * It performs the inverse operation to {@link domainToASCII}. - * - * This feature is only available if the `node` executable was compiled with `ICU` enabled. If not, the domain names are passed through unchanged. - * - * ```js - * import url from 'url'; - * - * console.log(url.domainToUnicode('xn--espaol-zwa.com')); - * // Prints español.com - * console.log(url.domainToUnicode('xn--fiq228c.com')); - * // Prints 中文.com - * console.log(url.domainToUnicode('xn--iñvalid.com')); - * // Prints an empty string - * ``` - * @since v7.4.0, v6.13.0 - */ - function domainToUnicode(domain: string): string; - /** - * This function ensures the correct decodings of percent-encoded characters as - * well as ensuring a cross-platform valid absolute path string. - * - * ```js - * import { fileURLToPath } from 'url'; - * - * const __filename = fileURLToPath(import.meta.url); - * - * new URL('file:///C:/path/').pathname; // Incorrect: /C:/path/ - * fileURLToPath('file:///C:/path/'); // Correct: C:\path\ (Windows) - * - * new URL('file://nas/foo.txt').pathname; // Incorrect: /foo.txt - * fileURLToPath('file://nas/foo.txt'); // Correct: \\nas\foo.txt (Windows) - * - * new URL('file:///你好.txt').pathname; // Incorrect: /%E4%BD%A0%E5%A5%BD.txt - * fileURLToPath('file:///你好.txt'); // Correct: /你好.txt (POSIX) - * - * new URL('file:///hello world').pathname; // Incorrect: /hello%20world - * fileURLToPath('file:///hello world'); // Correct: /hello world (POSIX) - * ``` - * @since v10.12.0 - * @param url The file URL string or URL object to convert to a path. - * @return The fully-resolved platform-specific Node.js file path. - */ - function fileURLToPath(url: string | URL): string; - /** - * This function ensures that `path` is resolved absolutely, and that the URL - * control characters are correctly encoded when converting into a File URL. - * - * ```js - * import { pathToFileURL } from 'url'; - * - * new URL('/foo#1', 'file:'); // Incorrect: file:///foo#1 - * pathToFileURL('/foo#1'); // Correct: file:///foo%231 (POSIX) - * - * new URL('/some/path%.c', 'file:'); // Incorrect: file:///some/path%.c - * pathToFileURL('/some/path%.c'); // Correct: file:///some/path%25.c (POSIX) - * ``` - * @since v10.12.0 - * @param path The path to convert to a File URL. - * @return The file URL object. - */ - function pathToFileURL(path: string): URL; - /** - * This utility function converts a URL object into an ordinary options object as - * expected by the `http.request()` and `https.request()` APIs. - * - * ```js - * import { urlToHttpOptions } from 'url'; - * const myURL = new URL('https://a:b@測試?abc#foo'); - * - * console.log(urlToHttpOptions(myURL)); - * /* - * { - * protocol: 'https:', - * hostname: 'xn--g6w251d', - * hash: '#foo', - * search: '?abc', - * pathname: '/', - * path: '/?abc', - * href: 'https://a:b@xn--g6w251d/?abc#foo', - * auth: 'a:b' - * } - * - * ``` - * @since v15.7.0, v14.18.0 - * @param url The `WHATWG URL` object to convert to an options object. - * @return Options object - */ - function urlToHttpOptions(url: URL): ClientRequestArgs; - interface URLFormatOptions { - auth?: boolean | undefined; - fragment?: boolean | undefined; - search?: boolean | undefined; - unicode?: boolean | undefined; - } - /** - * Browser-compatible `URL` class, implemented by following the WHATWG URL - * Standard. [Examples of parsed URLs](https://url.spec.whatwg.org/#example-url-parsing) may be found in the Standard itself. - * The `URL` class is also available on the global object. - * - * In accordance with browser conventions, all properties of `URL` objects - * are implemented as getters and setters on the class prototype, rather than as - * data properties on the object itself. Thus, unlike `legacy urlObject` s, - * using the `delete` keyword on any properties of `URL` objects (e.g. `delete myURL.protocol`, `delete myURL.pathname`, etc) has no effect but will still - * return `true`. - * @since v7.0.0, v6.13.0 - */ - class URL { - /** - * Creates a `'blob:nodedata:...'` URL string that represents the given `Blob` object and can be used to retrieve the `Blob` later. - * - * ```js - * const { - * Blob, - * resolveObjectURL, - * } = require('buffer'); - * - * const blob = new Blob(['hello']); - * const id = URL.createObjectURL(blob); - * - * // later... - * - * const otherBlob = resolveObjectURL(id); - * console.log(otherBlob.size); - * ``` - * - * The data stored by the registered `Blob` will be retained in memory until`URL.revokeObjectURL()` is called to remove it. - * - * `Blob` objects are registered within the current thread. If using Worker - * Threads, `Blob` objects registered within one Worker will not be available - * to other workers or the main thread. - * @since v16.7.0 - * @experimental - */ - static createObjectURL(blob: NodeBlob): string; - /** - * Removes the stored `Blob` identified by the given ID. Attempting to revoke a - * ID that isn’t registered will silently fail. - * @since v16.7.0 - * @experimental - * @param id A `'blob:nodedata:...` URL string returned by a prior call to `URL.createObjectURL()`. - */ - static revokeObjectURL(objectUrl: string): void; - constructor(input: string, base?: string | URL); - /** - * Gets and sets the fragment portion of the URL. - * - * ```js - * const myURL = new URL('https://example.org/foo#bar'); - * console.log(myURL.hash); - * // Prints #bar - * - * myURL.hash = 'baz'; - * console.log(myURL.href); - * // Prints https://example.org/foo#baz - * ``` - * - * Invalid URL characters included in the value assigned to the `hash` property - * are `percent-encoded`. The selection of which characters to - * percent-encode may vary somewhat from what the {@link parse} and {@link format} methods would produce. - */ - hash: string; - /** - * Gets and sets the host portion of the URL. - * - * ```js - * const myURL = new URL('https://example.org:81/foo'); - * console.log(myURL.host); - * // Prints example.org:81 - * - * myURL.host = 'example.com:82'; - * console.log(myURL.href); - * // Prints https://example.com:82/foo - * ``` - * - * Invalid host values assigned to the `host` property are ignored. - */ - host: string; - /** - * Gets and sets the host name portion of the URL. The key difference between`url.host` and `url.hostname` is that `url.hostname` does _not_ include the - * port. - * - * ```js - * const myURL = new URL('https://example.org:81/foo'); - * console.log(myURL.hostname); - * // Prints example.org - * - * // Setting the hostname does not change the port - * myURL.hostname = 'example.com:82'; - * console.log(myURL.href); - * // Prints https://example.com:81/foo - * - * // Use myURL.host to change the hostname and port - * myURL.host = 'example.org:82'; - * console.log(myURL.href); - * // Prints https://example.org:82/foo - * ``` - * - * Invalid host name values assigned to the `hostname` property are ignored. - */ - hostname: string; - /** - * Gets and sets the serialized URL. - * - * ```js - * const myURL = new URL('https://example.org/foo'); - * console.log(myURL.href); - * // Prints https://example.org/foo - * - * myURL.href = 'https://example.com/bar'; - * console.log(myURL.href); - * // Prints https://example.com/bar - * ``` - * - * Getting the value of the `href` property is equivalent to calling {@link toString}. - * - * Setting the value of this property to a new value is equivalent to creating a - * new `URL` object using `new URL(value)`. Each of the `URL`object's properties will be modified. - * - * If the value assigned to the `href` property is not a valid URL, a `TypeError`will be thrown. - */ - href: string; - /** - * Gets the read-only serialization of the URL's origin. - * - * ```js - * const myURL = new URL('https://example.org/foo/bar?baz'); - * console.log(myURL.origin); - * // Prints https://example.org - * ``` - * - * ```js - * const idnURL = new URL('https://測試'); - * console.log(idnURL.origin); - * // Prints https://xn--g6w251d - * - * console.log(idnURL.hostname); - * // Prints xn--g6w251d - * ``` - */ - readonly origin: string; - /** - * Gets and sets the password portion of the URL. - * - * ```js - * const myURL = new URL('https://abc:xyz@example.com'); - * console.log(myURL.password); - * // Prints xyz - * - * myURL.password = '123'; - * console.log(myURL.href); - * // Prints https://abc:123@example.com - * ``` - * - * Invalid URL characters included in the value assigned to the `password` property - * are `percent-encoded`. The selection of which characters to - * percent-encode may vary somewhat from what the {@link parse} and {@link format} methods would produce. - */ - password: string; - /** - * Gets and sets the path portion of the URL. - * - * ```js - * const myURL = new URL('https://example.org/abc/xyz?123'); - * console.log(myURL.pathname); - * // Prints /abc/xyz - * - * myURL.pathname = '/abcdef'; - * console.log(myURL.href); - * // Prints https://example.org/abcdef?123 - * ``` - * - * Invalid URL characters included in the value assigned to the `pathname`property are `percent-encoded`. The selection of which characters - * to percent-encode may vary somewhat from what the {@link parse} and {@link format} methods would produce. - */ - pathname: string; - /** - * Gets and sets the port portion of the URL. - * - * The port value may be a number or a string containing a number in the range`0` to `65535` (inclusive). Setting the value to the default port of the`URL` objects given `protocol` will - * result in the `port` value becoming - * the empty string (`''`). - * - * The port value can be an empty string in which case the port depends on - * the protocol/scheme: - * - * - * - * Upon assigning a value to the port, the value will first be converted to a - * string using `.toString()`. - * - * If that string is invalid but it begins with a number, the leading number is - * assigned to `port`. - * If the number lies outside the range denoted above, it is ignored. - * - * ```js - * const myURL = new URL('https://example.org:8888'); - * console.log(myURL.port); - * // Prints 8888 - * - * // Default ports are automatically transformed to the empty string - * // (HTTPS protocol's default port is 443) - * myURL.port = '443'; - * console.log(myURL.port); - * // Prints the empty string - * console.log(myURL.href); - * // Prints https://example.org/ - * - * myURL.port = 1234; - * console.log(myURL.port); - * // Prints 1234 - * console.log(myURL.href); - * // Prints https://example.org:1234/ - * - * // Completely invalid port strings are ignored - * myURL.port = 'abcd'; - * console.log(myURL.port); - * // Prints 1234 - * - * // Leading numbers are treated as a port number - * myURL.port = '5678abcd'; - * console.log(myURL.port); - * // Prints 5678 - * - * // Non-integers are truncated - * myURL.port = 1234.5678; - * console.log(myURL.port); - * // Prints 1234 - * - * // Out-of-range numbers which are not represented in scientific notation - * // will be ignored. - * myURL.port = 1e10; // 10000000000, will be range-checked as described below - * console.log(myURL.port); - * // Prints 1234 - * ``` - * - * Numbers which contain a decimal point, - * such as floating-point numbers or numbers in scientific notation, - * are not an exception to this rule. - * Leading numbers up to the decimal point will be set as the URL's port, - * assuming they are valid: - * - * ```js - * myURL.port = 4.567e21; - * console.log(myURL.port); - * // Prints 4 (because it is the leading number in the string '4.567e21') - * ``` - */ - port: string; - /** - * Gets and sets the protocol portion of the URL. - * - * ```js - * const myURL = new URL('https://example.org'); - * console.log(myURL.protocol); - * // Prints https: - * - * myURL.protocol = 'ftp'; - * console.log(myURL.href); - * // Prints ftp://example.org/ - * ``` - * - * Invalid URL protocol values assigned to the `protocol` property are ignored. - */ - protocol: string; - /** - * Gets and sets the serialized query portion of the URL. - * - * ```js - * const myURL = new URL('https://example.org/abc?123'); - * console.log(myURL.search); - * // Prints ?123 - * - * myURL.search = 'abc=xyz'; - * console.log(myURL.href); - * // Prints https://example.org/abc?abc=xyz - * ``` - * - * Any invalid URL characters appearing in the value assigned the `search`property will be `percent-encoded`. The selection of which - * characters to percent-encode may vary somewhat from what the {@link parse} and {@link format} methods would produce. - */ - search: string; - /** - * Gets the `URLSearchParams` object representing the query parameters of the - * URL. This property is read-only but the `URLSearchParams` object it provides - * can be used to mutate the URL instance; to replace the entirety of query - * parameters of the URL, use the {@link search} setter. See `URLSearchParams` documentation for details. - * - * Use care when using `.searchParams` to modify the `URL` because, - * per the WHATWG specification, the `URLSearchParams` object uses - * different rules to determine which characters to percent-encode. For - * instance, the `URL` object will not percent encode the ASCII tilde (`~`) - * character, while `URLSearchParams` will always encode it: - * - * ```js - * const myUrl = new URL('https://example.org/abc?foo=~bar'); - * - * console.log(myUrl.search); // prints ?foo=~bar - * - * // Modify the URL via searchParams... - * myUrl.searchParams.sort(); - * - * console.log(myUrl.search); // prints ?foo=%7Ebar - * ``` - */ - readonly searchParams: URLSearchParams; - /** - * Gets and sets the username portion of the URL. - * - * ```js - * const myURL = new URL('https://abc:xyz@example.com'); - * console.log(myURL.username); - * // Prints abc - * - * myURL.username = '123'; - * console.log(myURL.href); - * // Prints https://123:xyz@example.com/ - * ``` - * - * Any invalid URL characters appearing in the value assigned the `username`property will be `percent-encoded`. The selection of which - * characters to percent-encode may vary somewhat from what the {@link parse} and {@link format} methods would produce. - */ - username: string; - /** - * The `toString()` method on the `URL` object returns the serialized URL. The - * value returned is equivalent to that of {@link href} and {@link toJSON}. - */ - toString(): string; - /** - * The `toJSON()` method on the `URL` object returns the serialized URL. The - * value returned is equivalent to that of {@link href} and {@link toString}. - * - * This method is automatically called when an `URL` object is serialized - * with [`JSON.stringify()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify). - * - * ```js - * const myURLs = [ - * new URL('https://www.example.com'), - * new URL('https://test.example.org'), - * ]; - * console.log(JSON.stringify(myURLs)); - * // Prints ["https://www.example.com/","https://test.example.org/"] - * ``` - */ - toJSON(): string; - } - /** - * The `URLSearchParams` API provides read and write access to the query of a`URL`. The `URLSearchParams` class can also be used standalone with one of the - * four following constructors. - * The `URLSearchParams` class is also available on the global object. - * - * The WHATWG `URLSearchParams` interface and the `querystring` module have - * similar purpose, but the purpose of the `querystring` module is more - * general, as it allows the customization of delimiter characters (`&` and `=`). - * On the other hand, this API is designed purely for URL query strings. - * - * ```js - * const myURL = new URL('https://example.org/?abc=123'); - * console.log(myURL.searchParams.get('abc')); - * // Prints 123 - * - * myURL.searchParams.append('abc', 'xyz'); - * console.log(myURL.href); - * // Prints https://example.org/?abc=123&abc=xyz - * - * myURL.searchParams.delete('abc'); - * myURL.searchParams.set('a', 'b'); - * console.log(myURL.href); - * // Prints https://example.org/?a=b - * - * const newSearchParams = new URLSearchParams(myURL.searchParams); - * // The above is equivalent to - * // const newSearchParams = new URLSearchParams(myURL.search); - * - * newSearchParams.append('a', 'c'); - * console.log(myURL.href); - * // Prints https://example.org/?a=b - * console.log(newSearchParams.toString()); - * // Prints a=b&a=c - * - * // newSearchParams.toString() is implicitly called - * myURL.search = newSearchParams; - * console.log(myURL.href); - * // Prints https://example.org/?a=b&a=c - * newSearchParams.delete('a'); - * console.log(myURL.href); - * // Prints https://example.org/?a=b&a=c - * ``` - * @since v7.5.0, v6.13.0 - */ - class URLSearchParams implements Iterable<[string, string]> { - constructor(init?: URLSearchParams | string | Record> | Iterable<[string, string]> | ReadonlyArray<[string, string]>); - /** - * Append a new name-value pair to the query string. - */ - append(name: string, value: string): void; - /** - * Remove all name-value pairs whose name is `name`. - */ - delete(name: string): void; - /** - * Returns an ES6 `Iterator` over each of the name-value pairs in the query. - * Each item of the iterator is a JavaScript `Array`. The first item of the `Array`is the `name`, the second item of the `Array` is the `value`. - * - * Alias for `urlSearchParams[@@iterator]()`. - */ - entries(): IterableIterator<[string, string]>; - /** - * Iterates over each name-value pair in the query and invokes the given function. - * - * ```js - * const myURL = new URL('https://example.org/?a=b&c=d'); - * myURL.searchParams.forEach((value, name, searchParams) => { - * console.log(name, value, myURL.searchParams === searchParams); - * }); - * // Prints: - * // a b true - * // c d true - * ``` - * @param fn Invoked for each name-value pair in the query - * @param thisArg To be used as `this` value for when `fn` is called - */ - forEach(callback: (this: TThis, value: string, name: string, searchParams: URLSearchParams) => void, thisArg?: TThis): void; - /** - * Returns the value of the first name-value pair whose name is `name`. If there - * are no such pairs, `null` is returned. - * @return or `null` if there is no name-value pair with the given `name`. - */ - get(name: string): string | null; - /** - * Returns the values of all name-value pairs whose name is `name`. If there are - * no such pairs, an empty array is returned. - */ - getAll(name: string): string[]; - /** - * Returns `true` if there is at least one name-value pair whose name is `name`. - */ - has(name: string): boolean; - /** - * Returns an ES6 `Iterator` over the names of each name-value pair. - * - * ```js - * const params = new URLSearchParams('foo=bar&foo=baz'); - * for (const name of params.keys()) { - * console.log(name); - * } - * // Prints: - * // foo - * // foo - * ``` - */ - keys(): IterableIterator; - /** - * Sets the value in the `URLSearchParams` object associated with `name` to`value`. If there are any pre-existing name-value pairs whose names are `name`, - * set the first such pair's value to `value` and remove all others. If not, - * append the name-value pair to the query string. - * - * ```js - * const params = new URLSearchParams(); - * params.append('foo', 'bar'); - * params.append('foo', 'baz'); - * params.append('abc', 'def'); - * console.log(params.toString()); - * // Prints foo=bar&foo=baz&abc=def - * - * params.set('foo', 'def'); - * params.set('xyz', 'opq'); - * console.log(params.toString()); - * // Prints foo=def&abc=def&xyz=opq - * ``` - */ - set(name: string, value: string): void; - /** - * Sort all existing name-value pairs in-place by their names. Sorting is done - * with a [stable sorting algorithm](https://en.wikipedia.org/wiki/Sorting_algorithm#Stability), so relative order between name-value pairs - * with the same name is preserved. - * - * This method can be used, in particular, to increase cache hits. - * - * ```js - * const params = new URLSearchParams('query[]=abc&type=search&query[]=123'); - * params.sort(); - * console.log(params.toString()); - * // Prints query%5B%5D=abc&query%5B%5D=123&type=search - * ``` - * @since v7.7.0, v6.13.0 - */ - sort(): void; - /** - * Returns the search parameters serialized as a string, with characters - * percent-encoded where necessary. - */ - toString(): string; - /** - * Returns an ES6 `Iterator` over the values of each name-value pair. - */ - values(): IterableIterator; - [Symbol.iterator](): IterableIterator<[string, string]>; - } - import { URL as _URL, URLSearchParams as _URLSearchParams } from 'url'; - global { - interface URLSearchParams extends _URLSearchParams {} - interface URL extends _URL {} - interface Global { - URL: typeof _URL; - URLSearchParams: typeof _URLSearchParams; - } - /** - * `URL` class is a global reference for `require('url').URL` - * https://nodejs.org/api/url.html#the-whatwg-url-api - * @since v10.0.0 - */ - var URL: typeof globalThis extends { - onmessage: any; - URL: infer T; - } - ? T - : typeof _URL; - /** - * `URLSearchParams` class is a global reference for `require('url').URLSearchParams` - * https://nodejs.org/api/url.html#class-urlsearchparams - * @since v10.0.0 - */ - var URLSearchParams: typeof globalThis extends { - onmessage: any; - URLSearchParams: infer T; - } - ? T - : typeof _URLSearchParams; - } -} -declare module 'node:url' { - export * from 'url'; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/util.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/util.d.ts deleted file mode 100755 index 6976c2b7..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/util.d.ts +++ /dev/null @@ -1,1850 +0,0 @@ -/** - * The `util` module supports the needs of Node.js internal APIs. Many of the - * utilities are useful for application and module developers as well. To access - * it: - * - * ```js - * const util = require('util'); - * ``` - * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/util.js) - */ -declare module 'util' { - import * as types from 'node:util/types'; - export interface InspectOptions { - /** - * If set to `true`, getters are going to be - * inspected as well. If set to `'get'` only getters without setter are going - * to be inspected. If set to `'set'` only getters having a corresponding - * setter are going to be inspected. This might cause side effects depending on - * the getter function. - * @default `false` - */ - getters?: 'get' | 'set' | boolean | undefined; - showHidden?: boolean | undefined; - /** - * @default 2 - */ - depth?: number | null | undefined; - colors?: boolean | undefined; - customInspect?: boolean | undefined; - showProxy?: boolean | undefined; - maxArrayLength?: number | null | undefined; - /** - * Specifies the maximum number of characters to - * include when formatting. Set to `null` or `Infinity` to show all elements. - * Set to `0` or negative to show no characters. - * @default 10000 - */ - maxStringLength?: number | null | undefined; - breakLength?: number | undefined; - /** - * Setting this to `false` causes each object key - * to be displayed on a new line. It will also add new lines to text that is - * longer than `breakLength`. If set to a number, the most `n` inner elements - * are united on a single line as long as all properties fit into - * `breakLength`. Short array elements are also grouped together. Note that no - * text will be reduced below 16 characters, no matter the `breakLength` size. - * For more information, see the example below. - * @default `true` - */ - compact?: boolean | number | undefined; - sorted?: boolean | ((a: string, b: string) => number) | undefined; - } - export type Style = 'special' | 'number' | 'bigint' | 'boolean' | 'undefined' | 'null' | 'string' | 'symbol' | 'date' | 'regexp' | 'module'; - export type CustomInspectFunction = (depth: number, options: InspectOptionsStylized) => string; - export interface InspectOptionsStylized extends InspectOptions { - stylize(text: string, styleType: Style): string; - } - /** - * The `util.format()` method returns a formatted string using the first argument - * as a `printf`\-like format string which can contain zero or more format - * specifiers. Each specifier is replaced with the converted value from the - * corresponding argument. Supported specifiers are: - * - * If a specifier does not have a corresponding argument, it is not replaced: - * - * ```js - * util.format('%s:%s', 'foo'); - * // Returns: 'foo:%s' - * ``` - * - * Values that are not part of the format string are formatted using`util.inspect()` if their type is not `string`. - * - * If there are more arguments passed to the `util.format()` method than the - * number of specifiers, the extra arguments are concatenated to the returned - * string, separated by spaces: - * - * ```js - * util.format('%s:%s', 'foo', 'bar', 'baz'); - * // Returns: 'foo:bar baz' - * ``` - * - * If the first argument does not contain a valid format specifier, `util.format()`returns a string that is the concatenation of all arguments separated by spaces: - * - * ```js - * util.format(1, 2, 3); - * // Returns: '1 2 3' - * ``` - * - * If only one argument is passed to `util.format()`, it is returned as it is - * without any formatting: - * - * ```js - * util.format('%% %s'); - * // Returns: '%% %s' - * ``` - * - * `util.format()` is a synchronous method that is intended as a debugging tool. - * Some input values can have a significant performance overhead that can block the - * event loop. Use this function with care and never in a hot code path. - * @since v0.5.3 - * @param format A `printf`-like format string. - */ - export function format(format?: any, ...param: any[]): string; - /** - * This function is identical to {@link format}, except in that it takes - * an `inspectOptions` argument which specifies options that are passed along to {@link inspect}. - * - * ```js - * util.formatWithOptions({ colors: true }, 'See object %O', { foo: 42 }); - * // Returns 'See object { foo: 42 }', where `42` is colored as a number - * // when printed to a terminal. - * ``` - * @since v10.0.0 - */ - export function formatWithOptions(inspectOptions: InspectOptions, format?: any, ...param: any[]): string; - /** - * Returns the string name for a numeric error code that comes from a Node.js API. - * The mapping between error codes and error names is platform-dependent. - * See `Common System Errors` for the names of common errors. - * - * ```js - * fs.access('file/that/does/not/exist', (err) => { - * const name = util.getSystemErrorName(err.errno); - * console.error(name); // ENOENT - * }); - * ``` - * @since v9.7.0 - */ - export function getSystemErrorName(err: number): string; - /** - * Returns a Map of all system error codes available from the Node.js API. - * The mapping between error codes and error names is platform-dependent. - * See `Common System Errors` for the names of common errors. - * - * ```js - * fs.access('file/that/does/not/exist', (err) => { - * const errorMap = util.getSystemErrorMap(); - * const name = errorMap.get(err.errno); - * console.error(name); // ENOENT - * }); - * ``` - * @since v16.0.0, v14.17.0 - */ - export function getSystemErrorMap(): Map; - /** - * The `util.log()` method prints the given `string` to `stdout` with an included - * timestamp. - * - * ```js - * const util = require('util'); - * - * util.log('Timestamped message.'); - * ``` - * @since v0.3.0 - * @deprecated Since v6.0.0 - Use a third party module instead. - */ - export function log(string: string): void; - /** - * Returns the `string` after replacing any surrogate code points - * (or equivalently, any unpaired surrogate code units) with the - * Unicode "replacement character" U+FFFD. - * @since v16.8.0, v14.18.0 - */ - export function toUSVString(string: string): string; - /** - * Creates and returns an `AbortController` instance whose `AbortSignal` is marked - * as transferable and can be used with `structuredClone()` or `postMessage()`. - * @since v18.11.0 - * @returns A transferable AbortController - */ - export function transferableAbortController(): AbortController; - /** - * Marks the given {AbortSignal} as transferable so that it can be used with - * `structuredClone()` and `postMessage()`. - * - * ```js - * const signal = transferableAbortSignal(AbortSignal.timeout(100)); - * const channel = new MessageChannel(); - * channel.port2.postMessage(signal, [signal]); - * ``` - * @since v18.11.0 - * @param signal The AbortSignal - * @returns The same AbortSignal - */ - export function transferableAbortSignal(signal: AbortSignal): AbortSignal; - /** - * The `util.inspect()` method returns a string representation of `object` that is - * intended for debugging. The output of `util.inspect` may change at any time - * and should not be depended upon programmatically. Additional `options` may be - * passed that alter the result.`util.inspect()` will use the constructor's name and/or `@@toStringTag` to make - * an identifiable tag for an inspected value. - * - * ```js - * class Foo { - * get [Symbol.toStringTag]() { - * return 'bar'; - * } - * } - * - * class Bar {} - * - * const baz = Object.create(null, { [Symbol.toStringTag]: { value: 'foo' } }); - * - * util.inspect(new Foo()); // 'Foo [bar] {}' - * util.inspect(new Bar()); // 'Bar {}' - * util.inspect(baz); // '[foo] {}' - * ``` - * - * Circular references point to their anchor by using a reference index: - * - * ```js - * const { inspect } = require('util'); - * - * const obj = {}; - * obj.a = [obj]; - * obj.b = {}; - * obj.b.inner = obj.b; - * obj.b.obj = obj; - * - * console.log(inspect(obj)); - * // { - * // a: [ [Circular *1] ], - * // b: { inner: [Circular *2], obj: [Circular *1] } - * // } - * ``` - * - * The following example inspects all properties of the `util` object: - * - * ```js - * const util = require('util'); - * - * console.log(util.inspect(util, { showHidden: true, depth: null })); - * ``` - * - * The following example highlights the effect of the `compact` option: - * - * ```js - * const util = require('util'); - * - * const o = { - * a: [1, 2, [[ - * 'Lorem ipsum dolor sit amet,\nconsectetur adipiscing elit, sed do ' + - * 'eiusmod \ntempor incididunt ut labore et dolore magna aliqua.', - * 'test', - * 'foo']], 4], - * b: new Map([['za', 1], ['zb', 'test']]) - * }; - * console.log(util.inspect(o, { compact: true, depth: 5, breakLength: 80 })); - * - * // { a: - * // [ 1, - * // 2, - * // [ [ 'Lorem ipsum dolor sit amet,\nconsectetur [...]', // A long line - * // 'test', - * // 'foo' ] ], - * // 4 ], - * // b: Map(2) { 'za' => 1, 'zb' => 'test' } } - * - * // Setting `compact` to false or an integer creates more reader friendly output. - * console.log(util.inspect(o, { compact: false, depth: 5, breakLength: 80 })); - * - * // { - * // a: [ - * // 1, - * // 2, - * // [ - * // [ - * // 'Lorem ipsum dolor sit amet,\n' + - * // 'consectetur adipiscing elit, sed do eiusmod \n' + - * // 'tempor incididunt ut labore et dolore magna aliqua.', - * // 'test', - * // 'foo' - * // ] - * // ], - * // 4 - * // ], - * // b: Map(2) { - * // 'za' => 1, - * // 'zb' => 'test' - * // } - * // } - * - * // Setting `breakLength` to e.g. 150 will print the "Lorem ipsum" text in a - * // single line. - * ``` - * - * The `showHidden` option allows [`WeakMap`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap) and - * [`WeakSet`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakSet) entries to be - * inspected. If there are more entries than `maxArrayLength`, there is no - * guarantee which entries are displayed. That means retrieving the same [`WeakSet`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakSet) entries twice may - * result in different output. Furthermore, entries - * with no remaining strong references may be garbage collected at any time. - * - * ```js - * const { inspect } = require('util'); - * - * const obj = { a: 1 }; - * const obj2 = { b: 2 }; - * const weakSet = new WeakSet([obj, obj2]); - * - * console.log(inspect(weakSet, { showHidden: true })); - * // WeakSet { { a: 1 }, { b: 2 } } - * ``` - * - * The `sorted` option ensures that an object's property insertion order does not - * impact the result of `util.inspect()`. - * - * ```js - * const { inspect } = require('util'); - * const assert = require('assert'); - * - * const o1 = { - * b: [2, 3, 1], - * a: '`a` comes before `b`', - * c: new Set([2, 3, 1]) - * }; - * console.log(inspect(o1, { sorted: true })); - * // { a: '`a` comes before `b`', b: [ 2, 3, 1 ], c: Set(3) { 1, 2, 3 } } - * console.log(inspect(o1, { sorted: (a, b) => b.localeCompare(a) })); - * // { c: Set(3) { 3, 2, 1 }, b: [ 2, 3, 1 ], a: '`a` comes before `b`' } - * - * const o2 = { - * c: new Set([2, 1, 3]), - * a: '`a` comes before `b`', - * b: [2, 3, 1] - * }; - * assert.strict.equal( - * inspect(o1, { sorted: true }), - * inspect(o2, { sorted: true }) - * ); - * ``` - * - * The `numericSeparator` option adds an underscore every three digits to all - * numbers. - * - * ```js - * const { inspect } = require('util'); - * - * const thousand = 1_000; - * const million = 1_000_000; - * const bigNumber = 123_456_789n; - * const bigDecimal = 1_234.123_45; - * - * console.log(thousand, million, bigNumber, bigDecimal); - * // 1_000 1_000_000 123_456_789n 1_234.123_45 - * ``` - * - * `util.inspect()` is a synchronous method intended for debugging. Its maximum - * output length is approximately 128 MB. Inputs that result in longer output will - * be truncated. - * @since v0.3.0 - * @param object Any JavaScript primitive or `Object`. - * @return The representation of `object`. - */ - export function inspect(object: any, showHidden?: boolean, depth?: number | null, color?: boolean): string; - export function inspect(object: any, options?: InspectOptions): string; - export namespace inspect { - let colors: NodeJS.Dict<[number, number]>; - let styles: { - [K in Style]: string; - }; - let defaultOptions: InspectOptions; - /** - * Allows changing inspect settings from the repl. - */ - let replDefaults: InspectOptions; - /** - * That can be used to declare custom inspect functions. - */ - const custom: unique symbol; - } - /** - * Alias for [`Array.isArray()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/isArray). - * - * Returns `true` if the given `object` is an `Array`. Otherwise, returns `false`. - * - * ```js - * const util = require('util'); - * - * util.isArray([]); - * // Returns: true - * util.isArray(new Array()); - * // Returns: true - * util.isArray({}); - * // Returns: false - * ``` - * @since v0.6.0 - * @deprecated Since v4.0.0 - Use `isArray` instead. - */ - export function isArray(object: unknown): object is unknown[]; - /** - * Returns `true` if the given `object` is a `RegExp`. Otherwise, returns `false`. - * - * ```js - * const util = require('util'); - * - * util.isRegExp(/some regexp/); - * // Returns: true - * util.isRegExp(new RegExp('another regexp')); - * // Returns: true - * util.isRegExp({}); - * // Returns: false - * ``` - * @since v0.6.0 - * @deprecated Since v4.0.0 - Deprecated - */ - export function isRegExp(object: unknown): object is RegExp; - /** - * Returns `true` if the given `object` is a `Date`. Otherwise, returns `false`. - * - * ```js - * const util = require('util'); - * - * util.isDate(new Date()); - * // Returns: true - * util.isDate(Date()); - * // false (without 'new' returns a String) - * util.isDate({}); - * // Returns: false - * ``` - * @since v0.6.0 - * @deprecated Since v4.0.0 - Use {@link types.isDate} instead. - */ - export function isDate(object: unknown): object is Date; - /** - * Returns `true` if the given `object` is an `Error`. Otherwise, returns`false`. - * - * ```js - * const util = require('util'); - * - * util.isError(new Error()); - * // Returns: true - * util.isError(new TypeError()); - * // Returns: true - * util.isError({ name: 'Error', message: 'an error occurred' }); - * // Returns: false - * ``` - * - * This method relies on `Object.prototype.toString()` behavior. It is - * possible to obtain an incorrect result when the `object` argument manipulates`@@toStringTag`. - * - * ```js - * const util = require('util'); - * const obj = { name: 'Error', message: 'an error occurred' }; - * - * util.isError(obj); - * // Returns: false - * obj[Symbol.toStringTag] = 'Error'; - * util.isError(obj); - * // Returns: true - * ``` - * @since v0.6.0 - * @deprecated Since v4.0.0 - Use {@link types.isNativeError} instead. - */ - export function isError(object: unknown): object is Error; - /** - * Usage of `util.inherits()` is discouraged. Please use the ES6 `class` and`extends` keywords to get language level inheritance support. Also note - * that the two styles are [semantically incompatible](https://github.com/nodejs/node/issues/4179). - * - * Inherit the prototype methods from one [constructor](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/constructor) into another. The - * prototype of `constructor` will be set to a new object created from`superConstructor`. - * - * This mainly adds some input validation on top of`Object.setPrototypeOf(constructor.prototype, superConstructor.prototype)`. - * As an additional convenience, `superConstructor` will be accessible - * through the `constructor.super_` property. - * - * ```js - * const util = require('util'); - * const EventEmitter = require('events'); - * - * function MyStream() { - * EventEmitter.call(this); - * } - * - * util.inherits(MyStream, EventEmitter); - * - * MyStream.prototype.write = function(data) { - * this.emit('data', data); - * }; - * - * const stream = new MyStream(); - * - * console.log(stream instanceof EventEmitter); // true - * console.log(MyStream.super_ === EventEmitter); // true - * - * stream.on('data', (data) => { - * console.log(`Received data: "${data}"`); - * }); - * stream.write('It works!'); // Received data: "It works!" - * ``` - * - * ES6 example using `class` and `extends`: - * - * ```js - * const EventEmitter = require('events'); - * - * class MyStream extends EventEmitter { - * write(data) { - * this.emit('data', data); - * } - * } - * - * const stream = new MyStream(); - * - * stream.on('data', (data) => { - * console.log(`Received data: "${data}"`); - * }); - * stream.write('With ES6'); - * ``` - * @since v0.3.0 - * @deprecated Legacy: Use ES2015 class syntax and `extends` keyword instead. - */ - export function inherits(constructor: unknown, superConstructor: unknown): void; - export type DebugLoggerFunction = (msg: string, ...param: unknown[]) => void; - export interface DebugLogger extends DebugLoggerFunction { - enabled: boolean; - } - /** - * The `util.debuglog()` method is used to create a function that conditionally - * writes debug messages to `stderr` based on the existence of the `NODE_DEBUG`environment variable. If the `section` name appears within the value of that - * environment variable, then the returned function operates similar to `console.error()`. If not, then the returned function is a no-op. - * - * ```js - * const util = require('util'); - * const debuglog = util.debuglog('foo'); - * - * debuglog('hello from foo [%d]', 123); - * ``` - * - * If this program is run with `NODE_DEBUG=foo` in the environment, then - * it will output something like: - * - * ```console - * FOO 3245: hello from foo [123] - * ``` - * - * where `3245` is the process id. If it is not run with that - * environment variable set, then it will not print anything. - * - * The `section` supports wildcard also: - * - * ```js - * const util = require('util'); - * const debuglog = util.debuglog('foo-bar'); - * - * debuglog('hi there, it\'s foo-bar [%d]', 2333); - * ``` - * - * if it is run with `NODE_DEBUG=foo*` in the environment, then it will output - * something like: - * - * ```console - * FOO-BAR 3257: hi there, it's foo-bar [2333] - * ``` - * - * Multiple comma-separated `section` names may be specified in the `NODE_DEBUG`environment variable: `NODE_DEBUG=fs,net,tls`. - * - * The optional `callback` argument can be used to replace the logging function - * with a different function that doesn't have any initialization or - * unnecessary wrapping. - * - * ```js - * const util = require('util'); - * let debuglog = util.debuglog('internals', (debug) => { - * // Replace with a logging function that optimizes out - * // testing if the section is enabled - * debuglog = debug; - * }); - * ``` - * @since v0.11.3 - * @param section A string identifying the portion of the application for which the `debuglog` function is being created. - * @param callback A callback invoked the first time the logging function is called with a function argument that is a more optimized logging function. - * @return The logging function - */ - export function debuglog(section: string, callback?: (fn: DebugLoggerFunction) => void): DebugLogger; - export const debug: typeof debuglog; - /** - * Returns `true` if the given `object` is a `Boolean`. Otherwise, returns `false`. - * - * ```js - * const util = require('util'); - * - * util.isBoolean(1); - * // Returns: false - * util.isBoolean(0); - * // Returns: false - * util.isBoolean(false); - * // Returns: true - * ``` - * @since v0.11.5 - * @deprecated Since v4.0.0 - Use `typeof value === 'boolean'` instead. - */ - export function isBoolean(object: unknown): object is boolean; - /** - * Returns `true` if the given `object` is a `Buffer`. Otherwise, returns `false`. - * - * ```js - * const util = require('util'); - * - * util.isBuffer({ length: 0 }); - * // Returns: false - * util.isBuffer([]); - * // Returns: false - * util.isBuffer(Buffer.from('hello world')); - * // Returns: true - * ``` - * @since v0.11.5 - * @deprecated Since v4.0.0 - Use `isBuffer` instead. - */ - export function isBuffer(object: unknown): object is Buffer; - /** - * Returns `true` if the given `object` is a `Function`. Otherwise, returns`false`. - * - * ```js - * const util = require('util'); - * - * function Foo() {} - * const Bar = () => {}; - * - * util.isFunction({}); - * // Returns: false - * util.isFunction(Foo); - * // Returns: true - * util.isFunction(Bar); - * // Returns: true - * ``` - * @since v0.11.5 - * @deprecated Since v4.0.0 - Use `typeof value === 'function'` instead. - */ - export function isFunction(object: unknown): boolean; - /** - * Returns `true` if the given `object` is strictly `null`. Otherwise, returns`false`. - * - * ```js - * const util = require('util'); - * - * util.isNull(0); - * // Returns: false - * util.isNull(undefined); - * // Returns: false - * util.isNull(null); - * // Returns: true - * ``` - * @since v0.11.5 - * @deprecated Since v4.0.0 - Use `value === null` instead. - */ - export function isNull(object: unknown): object is null; - /** - * Returns `true` if the given `object` is `null` or `undefined`. Otherwise, - * returns `false`. - * - * ```js - * const util = require('util'); - * - * util.isNullOrUndefined(0); - * // Returns: false - * util.isNullOrUndefined(undefined); - * // Returns: true - * util.isNullOrUndefined(null); - * // Returns: true - * ``` - * @since v0.11.5 - * @deprecated Since v4.0.0 - Use `value === undefined || value === null` instead. - */ - export function isNullOrUndefined(object: unknown): object is null | undefined; - /** - * Returns `true` if the given `object` is a `Number`. Otherwise, returns `false`. - * - * ```js - * const util = require('util'); - * - * util.isNumber(false); - * // Returns: false - * util.isNumber(Infinity); - * // Returns: true - * util.isNumber(0); - * // Returns: true - * util.isNumber(NaN); - * // Returns: true - * ``` - * @since v0.11.5 - * @deprecated Since v4.0.0 - Use `typeof value === 'number'` instead. - */ - export function isNumber(object: unknown): object is number; - /** - * Returns `true` if the given `object` is strictly an `Object`**and** not a`Function` (even though functions are objects in JavaScript). - * Otherwise, returns `false`. - * - * ```js - * const util = require('util'); - * - * util.isObject(5); - * // Returns: false - * util.isObject(null); - * // Returns: false - * util.isObject({}); - * // Returns: true - * util.isObject(() => {}); - * // Returns: false - * ``` - * @since v0.11.5 - * @deprecated Since v4.0.0 - Deprecated: Use `value !== null && typeof value === 'object'` instead. - */ - export function isObject(object: unknown): boolean; - /** - * Returns `true` if the given `object` is a primitive type. Otherwise, returns`false`. - * - * ```js - * const util = require('util'); - * - * util.isPrimitive(5); - * // Returns: true - * util.isPrimitive('foo'); - * // Returns: true - * util.isPrimitive(false); - * // Returns: true - * util.isPrimitive(null); - * // Returns: true - * util.isPrimitive(undefined); - * // Returns: true - * util.isPrimitive({}); - * // Returns: false - * util.isPrimitive(() => {}); - * // Returns: false - * util.isPrimitive(/^$/); - * // Returns: false - * util.isPrimitive(new Date()); - * // Returns: false - * ``` - * @since v0.11.5 - * @deprecated Since v4.0.0 - Use `(typeof value !== 'object' && typeof value !== 'function') || value === null` instead. - */ - export function isPrimitive(object: unknown): boolean; - /** - * Returns `true` if the given `object` is a `string`. Otherwise, returns `false`. - * - * ```js - * const util = require('util'); - * - * util.isString(''); - * // Returns: true - * util.isString('foo'); - * // Returns: true - * util.isString(String('foo')); - * // Returns: true - * util.isString(5); - * // Returns: false - * ``` - * @since v0.11.5 - * @deprecated Since v4.0.0 - Use `typeof value === 'string'` instead. - */ - export function isString(object: unknown): object is string; - /** - * Returns `true` if the given `object` is a `Symbol`. Otherwise, returns `false`. - * - * ```js - * const util = require('util'); - * - * util.isSymbol(5); - * // Returns: false - * util.isSymbol('foo'); - * // Returns: false - * util.isSymbol(Symbol('foo')); - * // Returns: true - * ``` - * @since v0.11.5 - * @deprecated Since v4.0.0 - Use `typeof value === 'symbol'` instead. - */ - export function isSymbol(object: unknown): object is symbol; - /** - * Returns `true` if the given `object` is `undefined`. Otherwise, returns `false`. - * - * ```js - * const util = require('util'); - * - * const foo = undefined; - * util.isUndefined(5); - * // Returns: false - * util.isUndefined(foo); - * // Returns: true - * util.isUndefined(null); - * // Returns: false - * ``` - * @since v0.11.5 - * @deprecated Since v4.0.0 - Use `value === undefined` instead. - */ - export function isUndefined(object: unknown): object is undefined; - /** - * The `util.deprecate()` method wraps `fn` (which may be a function or class) in - * such a way that it is marked as deprecated. - * - * ```js - * const util = require('util'); - * - * exports.obsoleteFunction = util.deprecate(() => { - * // Do something here. - * }, 'obsoleteFunction() is deprecated. Use newShinyFunction() instead.'); - * ``` - * - * When called, `util.deprecate()` will return a function that will emit a`DeprecationWarning` using the `'warning'` event. The warning will - * be emitted and printed to `stderr` the first time the returned function is - * called. After the warning is emitted, the wrapped function is called without - * emitting a warning. - * - * If the same optional `code` is supplied in multiple calls to `util.deprecate()`, - * the warning will be emitted only once for that `code`. - * - * ```js - * const util = require('util'); - * - * const fn1 = util.deprecate(someFunction, someMessage, 'DEP0001'); - * const fn2 = util.deprecate(someOtherFunction, someOtherMessage, 'DEP0001'); - * fn1(); // Emits a deprecation warning with code DEP0001 - * fn2(); // Does not emit a deprecation warning because it has the same code - * ``` - * - * If either the `--no-deprecation` or `--no-warnings` command-line flags are - * used, or if the `process.noDeprecation` property is set to `true`_prior_ to - * the first deprecation warning, the `util.deprecate()` method does nothing. - * - * If the `--trace-deprecation` or `--trace-warnings` command-line flags are set, - * or the `process.traceDeprecation` property is set to `true`, a warning and a - * stack trace are printed to `stderr` the first time the deprecated function is - * called. - * - * If the `--throw-deprecation` command-line flag is set, or the`process.throwDeprecation` property is set to `true`, then an exception will be - * thrown when the deprecated function is called. - * - * The `--throw-deprecation` command-line flag and `process.throwDeprecation`property take precedence over `--trace-deprecation` and`process.traceDeprecation`. - * @since v0.8.0 - * @param fn The function that is being deprecated. - * @param msg A warning message to display when the deprecated function is invoked. - * @param code A deprecation code. See the `list of deprecated APIs` for a list of codes. - * @return The deprecated function wrapped to emit a warning. - */ - export function deprecate(fn: T, msg: string, code?: string): T; - /** - * Returns `true` if there is deep strict equality between `val1` and `val2`. - * Otherwise, returns `false`. - * - * See `assert.deepStrictEqual()` for more information about deep strict - * equality. - * @since v9.0.0 - */ - export function isDeepStrictEqual(val1: unknown, val2: unknown): boolean; - /** - * Returns `str` with any ANSI escape codes removed. - * - * ```js - * console.log(util.stripVTControlCharacters('\u001B[4mvalue\u001B[0m')); - * // Prints "value" - * ``` - * @since v16.11.0 - */ - export function stripVTControlCharacters(str: string): string; - /** - * Takes an `async` function (or a function that returns a `Promise`) and returns a - * function following the error-first callback style, i.e. taking - * an `(err, value) => ...` callback as the last argument. In the callback, the - * first argument will be the rejection reason (or `null` if the `Promise`resolved), and the second argument will be the resolved value. - * - * ```js - * const util = require('util'); - * - * async function fn() { - * return 'hello world'; - * } - * const callbackFunction = util.callbackify(fn); - * - * callbackFunction((err, ret) => { - * if (err) throw err; - * console.log(ret); - * }); - * ``` - * - * Will print: - * - * ```text - * hello world - * ``` - * - * The callback is executed asynchronously, and will have a limited stack trace. - * If the callback throws, the process will emit an `'uncaughtException'` event, and if not handled will exit. - * - * Since `null` has a special meaning as the first argument to a callback, if a - * wrapped function rejects a `Promise` with a falsy value as a reason, the value - * is wrapped in an `Error` with the original value stored in a field named`reason`. - * - * ```js - * function fn() { - * return Promise.reject(null); - * } - * const callbackFunction = util.callbackify(fn); - * - * callbackFunction((err, ret) => { - * // When the Promise was rejected with `null` it is wrapped with an Error and - * // the original value is stored in `reason`. - * err && Object.hasOwn(err, 'reason') && err.reason === null; // true - * }); - * ``` - * @since v8.2.0 - * @param original An `async` function - * @return a callback style function - */ - export function callbackify(fn: () => Promise): (callback: (err: NodeJS.ErrnoException) => void) => void; - export function callbackify(fn: () => Promise): (callback: (err: NodeJS.ErrnoException, result: TResult) => void) => void; - export function callbackify(fn: (arg1: T1) => Promise): (arg1: T1, callback: (err: NodeJS.ErrnoException) => void) => void; - export function callbackify(fn: (arg1: T1) => Promise): (arg1: T1, callback: (err: NodeJS.ErrnoException, result: TResult) => void) => void; - export function callbackify(fn: (arg1: T1, arg2: T2) => Promise): (arg1: T1, arg2: T2, callback: (err: NodeJS.ErrnoException) => void) => void; - export function callbackify(fn: (arg1: T1, arg2: T2) => Promise): (arg1: T1, arg2: T2, callback: (err: NodeJS.ErrnoException | null, result: TResult) => void) => void; - export function callbackify(fn: (arg1: T1, arg2: T2, arg3: T3) => Promise): (arg1: T1, arg2: T2, arg3: T3, callback: (err: NodeJS.ErrnoException) => void) => void; - export function callbackify( - fn: (arg1: T1, arg2: T2, arg3: T3) => Promise - ): (arg1: T1, arg2: T2, arg3: T3, callback: (err: NodeJS.ErrnoException | null, result: TResult) => void) => void; - export function callbackify( - fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise - ): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, callback: (err: NodeJS.ErrnoException) => void) => void; - export function callbackify( - fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise - ): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, callback: (err: NodeJS.ErrnoException | null, result: TResult) => void) => void; - export function callbackify( - fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise - ): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, callback: (err: NodeJS.ErrnoException) => void) => void; - export function callbackify( - fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise - ): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, callback: (err: NodeJS.ErrnoException | null, result: TResult) => void) => void; - export function callbackify( - fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6) => Promise - ): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6, callback: (err: NodeJS.ErrnoException) => void) => void; - export function callbackify( - fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6) => Promise - ): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6, callback: (err: NodeJS.ErrnoException | null, result: TResult) => void) => void; - export interface CustomPromisifyLegacy extends Function { - __promisify__: TCustom; - } - export interface CustomPromisifySymbol extends Function { - [promisify.custom]: TCustom; - } - export type CustomPromisify = CustomPromisifySymbol | CustomPromisifyLegacy; - /** - * Takes a function following the common error-first callback style, i.e. taking - * an `(err, value) => ...` callback as the last argument, and returns a version - * that returns promises. - * - * ```js - * const util = require('util'); - * const fs = require('fs'); - * - * const stat = util.promisify(fs.stat); - * stat('.').then((stats) => { - * // Do something with `stats` - * }).catch((error) => { - * // Handle the error. - * }); - * ``` - * - * Or, equivalently using `async function`s: - * - * ```js - * const util = require('util'); - * const fs = require('fs'); - * - * const stat = util.promisify(fs.stat); - * - * async function callStat() { - * const stats = await stat('.'); - * console.log(`This directory is owned by ${stats.uid}`); - * } - * ``` - * - * If there is an `original[util.promisify.custom]` property present, `promisify`will return its value, see `Custom promisified functions`. - * - * `promisify()` assumes that `original` is a function taking a callback as its - * final argument in all cases. If `original` is not a function, `promisify()`will throw an error. If `original` is a function but its last argument is not - * an error-first callback, it will still be passed an error-first - * callback as its last argument. - * - * Using `promisify()` on class methods or other methods that use `this` may not - * work as expected unless handled specially: - * - * ```js - * const util = require('util'); - * - * class Foo { - * constructor() { - * this.a = 42; - * } - * - * bar(callback) { - * callback(null, this.a); - * } - * } - * - * const foo = new Foo(); - * - * const naiveBar = util.promisify(foo.bar); - * // TypeError: Cannot read property 'a' of undefined - * // naiveBar().then(a => console.log(a)); - * - * naiveBar.call(foo).then((a) => console.log(a)); // '42' - * - * const bindBar = naiveBar.bind(foo); - * bindBar().then((a) => console.log(a)); // '42' - * ``` - * @since v8.0.0 - */ - export function promisify(fn: CustomPromisify): TCustom; - export function promisify(fn: (callback: (err: any, result: TResult) => void) => void): () => Promise; - export function promisify(fn: (callback: (err?: any) => void) => void): () => Promise; - export function promisify(fn: (arg1: T1, callback: (err: any, result: TResult) => void) => void): (arg1: T1) => Promise; - export function promisify(fn: (arg1: T1, callback: (err?: any) => void) => void): (arg1: T1) => Promise; - export function promisify(fn: (arg1: T1, arg2: T2, callback: (err: any, result: TResult) => void) => void): (arg1: T1, arg2: T2) => Promise; - export function promisify(fn: (arg1: T1, arg2: T2, callback: (err?: any) => void) => void): (arg1: T1, arg2: T2) => Promise; - export function promisify(fn: (arg1: T1, arg2: T2, arg3: T3, callback: (err: any, result: TResult) => void) => void): (arg1: T1, arg2: T2, arg3: T3) => Promise; - export function promisify(fn: (arg1: T1, arg2: T2, arg3: T3, callback: (err?: any) => void) => void): (arg1: T1, arg2: T2, arg3: T3) => Promise; - export function promisify( - fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, callback: (err: any, result: TResult) => void) => void - ): (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise; - export function promisify(fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, callback: (err?: any) => void) => void): (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise; - export function promisify( - fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, callback: (err: any, result: TResult) => void) => void - ): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise; - export function promisify( - fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, callback: (err?: any) => void) => void - ): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise; - export function promisify(fn: Function): Function; - export namespace promisify { - /** - * That can be used to declare custom promisified variants of functions. - */ - const custom: unique symbol; - } - /** - * An implementation of the [WHATWG Encoding Standard](https://encoding.spec.whatwg.org/) `TextDecoder` API. - * - * ```js - * const decoder = new TextDecoder(); - * const u8arr = new Uint8Array([72, 101, 108, 108, 111]); - * console.log(decoder.decode(u8arr)); // Hello - * ``` - * @since v8.3.0 - */ - export class TextDecoder { - /** - * The encoding supported by the `TextDecoder` instance. - */ - readonly encoding: string; - /** - * The value will be `true` if decoding errors result in a `TypeError` being - * thrown. - */ - readonly fatal: boolean; - /** - * The value will be `true` if the decoding result will include the byte order - * mark. - */ - readonly ignoreBOM: boolean; - constructor( - encoding?: string, - options?: { - fatal?: boolean | undefined; - ignoreBOM?: boolean | undefined; - } - ); - /** - * Decodes the `input` and returns a string. If `options.stream` is `true`, any - * incomplete byte sequences occurring at the end of the `input` are buffered - * internally and emitted after the next call to `textDecoder.decode()`. - * - * If `textDecoder.fatal` is `true`, decoding errors that occur will result in a`TypeError` being thrown. - * @param input An `ArrayBuffer`, `DataView` or `TypedArray` instance containing the encoded data. - */ - decode( - input?: NodeJS.ArrayBufferView | ArrayBuffer | null, - options?: { - stream?: boolean | undefined; - } - ): string; - } - export interface EncodeIntoResult { - /** - * The read Unicode code units of input. - */ - read: number; - /** - * The written UTF-8 bytes of output. - */ - written: number; - } - export { types }; - - //// TextEncoder/Decoder - /** - * An implementation of the [WHATWG Encoding Standard](https://encoding.spec.whatwg.org/) `TextEncoder` API. All - * instances of `TextEncoder` only support UTF-8 encoding. - * - * ```js - * const encoder = new TextEncoder(); - * const uint8array = encoder.encode('this is some data'); - * ``` - * - * The `TextEncoder` class is also available on the global object. - * @since v8.3.0 - */ - export class TextEncoder { - /** - * The encoding supported by the `TextEncoder` instance. Always set to `'utf-8'`. - */ - readonly encoding: string; - /** - * UTF-8 encodes the `input` string and returns a `Uint8Array` containing the - * encoded bytes. - * @param [input='an empty string'] The text to encode. - */ - encode(input?: string): Uint8Array; - /** - * UTF-8 encodes the `src` string to the `dest` Uint8Array and returns an object - * containing the read Unicode code units and written UTF-8 bytes. - * - * ```js - * const encoder = new TextEncoder(); - * const src = 'this is some data'; - * const dest = new Uint8Array(10); - * const { read, written } = encoder.encodeInto(src, dest); - * ``` - * @param src The text to encode. - * @param dest The array to hold the encode result. - */ - encodeInto(src: string, dest: Uint8Array): EncodeIntoResult; - } - - import { TextDecoder as _TextDecoder, TextEncoder as _TextEncoder } from 'util'; - global { - /** - * `TextDecoder` class is a global reference for `require('util').TextDecoder` - * https://nodejs.org/api/globals.html#textdecoder - * @since v11.0.0 - */ - var TextDecoder: typeof globalThis extends { - onmessage: any; - TextDecoder: infer TextDecoder; - } - ? TextDecoder - : typeof _TextDecoder; - - /** - * `TextEncoder` class is a global reference for `require('util').TextEncoder` - * https://nodejs.org/api/globals.html#textencoder - * @since v11.0.0 - */ - var TextEncoder: typeof globalThis extends { - onmessage: any; - TextEncoder: infer TextEncoder; - } - ? TextEncoder - : typeof _TextEncoder; - } - - //// parseArgs - /** - * Provides a high-level API for command-line argument parsing. Takes a - * specification for the expected arguments and returns a structured object - * with the parsed values and positionals. - * - * `config` provides arguments for parsing and configures the parser. It - * supports the following properties: - * - * - `args` The array of argument strings. **Default:** `process.argv` with - * `execPath` and `filename` removed. - * - `options` Arguments known to the parser. Keys of `options` are the long - * names of options and values are objects accepting the following properties: - * - * - `type` Type of argument, which must be either `boolean` (for options - * which do not take values) or `string` (for options which do). - * - `multiple` Whether this option can be provided multiple - * times. If `true`, all values will be collected in an array. If - * `false`, values for the option are last-wins. **Default:** `false`. - * - `short` A single character alias for the option. - * - `default` The default option value when it is not set by args. It - * must be of the same type as the `type` property. When `multiple` - * is `true`, it must be an array. - * - * - `strict`: Whether an error should be thrown when unknown arguments - * are encountered, or when arguments are passed that do not match the - * `type` configured in `options`. **Default:** `true`. - * - `allowPositionals`: Whether this command accepts positional arguments. - * **Default:** `false` if `strict` is `true`, otherwise `true`. - * - `tokens`: Whether tokens {boolean} Return the parsed tokens. This is useful - * for extending the built-in behavior, from adding additional checks through - * to reprocessing the tokens in different ways. - * **Default:** `false`. - * - * @returns The parsed command line arguments: - * - * - `values` A mapping of parsed option names with their string - * or boolean values. - * - `positionals` Positional arguments. - * - `tokens` Detailed parse information (only if `tokens` was specified). - * - */ - export function parseArgs(config: T): ParsedResults; - - interface ParseArgsOptionConfig { - type: 'string' | 'boolean'; - short?: string; - multiple?: boolean; - /** - * @since v18.11.0 - */ - default?: string | boolean | string[] | boolean[]; - } - - interface ParseArgsOptionsConfig { - [longOption: string]: ParseArgsOptionConfig; - } - - export interface ParseArgsConfig { - strict?: boolean; - allowPositionals?: boolean; - tokens?: boolean; - options?: ParseArgsOptionsConfig; - args?: string[]; - } - - /* - IfDefaultsTrue and IfDefaultsFalse are helpers to handle default values for missing boolean properties. - TypeScript does not have exact types for objects: https://github.com/microsoft/TypeScript/issues/12936 - This means it is impossible to distinguish between "field X is definitely not present" and "field X may or may not be present". - But we expect users to generally provide their config inline or `as const`, which means TS will always know whether a given field is present. - So this helper treats "not definitely present" (i.e., not `extends boolean`) as being "definitely not present", i.e. it should have its default value. - This is technically incorrect but is a much nicer UX for the common case. - The IfDefaultsTrue version is for things which default to true; the IfDefaultsFalse version is for things which default to false. - */ - type IfDefaultsTrue = T extends true - ? IfTrue - : T extends false - ? IfFalse - : IfTrue; - - // we put the `extends false` condition first here because `undefined` compares like `any` when `strictNullChecks: false` - type IfDefaultsFalse = T extends false - ? IfFalse - : T extends true - ? IfTrue - : IfFalse; - - type ExtractOptionValue = IfDefaultsTrue< - T['strict'], - O['type'] extends 'string' ? string : O['type'] extends 'boolean' ? boolean : string | boolean, - string | boolean - >; - - type ParsedValues = - & IfDefaultsTrue - & (T['options'] extends ParseArgsOptionsConfig - ? { - -readonly [LongOption in keyof T['options']]: IfDefaultsFalse< - T['options'][LongOption]['multiple'], - undefined | Array>, - undefined | ExtractOptionValue - >; - } - : {}); - - type ParsedPositionals = IfDefaultsTrue< - T['strict'], - IfDefaultsFalse, - IfDefaultsTrue - >; - - type PreciseTokenForOptions< - K extends string, - O extends ParseArgsOptionConfig, - > = O['type'] extends 'string' - ? { - kind: 'option'; - index: number; - name: K; - rawName: string; - value: string; - inlineValue: boolean; - } - : O['type'] extends 'boolean' - ? { - kind: 'option'; - index: number; - name: K; - rawName: string; - value: undefined; - inlineValue: undefined; - } - : OptionToken & { name: K }; - - type TokenForOptions< - T extends ParseArgsConfig, - K extends keyof T['options'] = keyof T['options'], - > = K extends unknown - ? T['options'] extends ParseArgsOptionsConfig - ? PreciseTokenForOptions - : OptionToken - : never; - - type ParsedOptionToken = IfDefaultsTrue, OptionToken>; - - type ParsedPositionalToken = IfDefaultsTrue< - T['strict'], - IfDefaultsFalse, - IfDefaultsTrue - >; - - type ParsedTokens = Array< - ParsedOptionToken | ParsedPositionalToken | { kind: 'option-terminator'; index: number } - >; - - type PreciseParsedResults = IfDefaultsFalse< - T['tokens'], - { - values: ParsedValues; - positionals: ParsedPositionals; - tokens: ParsedTokens; - }, - { - values: ParsedValues; - positionals: ParsedPositionals; - } - >; - - type OptionToken = - | { kind: 'option'; index: number; name: string; rawName: string; value: string; inlineValue: boolean } - | { - kind: 'option'; - index: number; - name: string; - rawName: string; - value: undefined; - inlineValue: undefined; - }; - - type Token = - | OptionToken - | { kind: 'positional'; index: number; value: string } - | { kind: 'option-terminator'; index: number }; - - // If ParseArgsConfig extends T, then the user passed config constructed elsewhere. - // So we can't rely on the `"not definitely present" implies "definitely not present"` assumption mentioned above. - type ParsedResults = ParseArgsConfig extends T - ? { - values: { [longOption: string]: undefined | string | boolean | Array }; - positionals: string[]; - tokens?: Token[]; - } - : PreciseParsedResults; -} -declare module 'util/types' { - export * from 'util/types'; -} -declare module 'util/types' { - import { KeyObject, webcrypto } from 'node:crypto'; - /** - * Returns `true` if the value is a built-in [`ArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer) or - * [`SharedArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer) instance. - * - * See also `util.types.isArrayBuffer()` and `util.types.isSharedArrayBuffer()`. - * - * ```js - * util.types.isAnyArrayBuffer(new ArrayBuffer()); // Returns true - * util.types.isAnyArrayBuffer(new SharedArrayBuffer()); // Returns true - * ``` - * @since v10.0.0 - */ - function isAnyArrayBuffer(object: unknown): object is ArrayBufferLike; - /** - * Returns `true` if the value is an `arguments` object. - * - * ```js - * function foo() { - * util.types.isArgumentsObject(arguments); // Returns true - * } - * ``` - * @since v10.0.0 - */ - function isArgumentsObject(object: unknown): object is IArguments; - /** - * Returns `true` if the value is a built-in [`ArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer) instance. - * This does _not_ include [`SharedArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer) instances. Usually, it is - * desirable to test for both; See `util.types.isAnyArrayBuffer()` for that. - * - * ```js - * util.types.isArrayBuffer(new ArrayBuffer()); // Returns true - * util.types.isArrayBuffer(new SharedArrayBuffer()); // Returns false - * ``` - * @since v10.0.0 - */ - function isArrayBuffer(object: unknown): object is ArrayBuffer; - /** - * Returns `true` if the value is an instance of one of the [`ArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer) views, such as typed - * array objects or [`DataView`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView). Equivalent to - * [`ArrayBuffer.isView()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer/isView). - * - * ```js - * util.types.isArrayBufferView(new Int8Array()); // true - * util.types.isArrayBufferView(Buffer.from('hello world')); // true - * util.types.isArrayBufferView(new DataView(new ArrayBuffer(16))); // true - * util.types.isArrayBufferView(new ArrayBuffer()); // false - * ``` - * @since v10.0.0 - */ - function isArrayBufferView(object: unknown): object is NodeJS.ArrayBufferView; - /** - * Returns `true` if the value is an [async function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function). - * This only reports back what the JavaScript engine is seeing; - * in particular, the return value may not match the original source code if - * a transpilation tool was used. - * - * ```js - * util.types.isAsyncFunction(function foo() {}); // Returns false - * util.types.isAsyncFunction(async function foo() {}); // Returns true - * ``` - * @since v10.0.0 - */ - function isAsyncFunction(object: unknown): boolean; - /** - * Returns `true` if the value is a `BigInt64Array` instance. - * - * ```js - * util.types.isBigInt64Array(new BigInt64Array()); // Returns true - * util.types.isBigInt64Array(new BigUint64Array()); // Returns false - * ``` - * @since v10.0.0 - */ - function isBigInt64Array(value: unknown): value is BigInt64Array; - /** - * Returns `true` if the value is a `BigUint64Array` instance. - * - * ```js - * util.types.isBigUint64Array(new BigInt64Array()); // Returns false - * util.types.isBigUint64Array(new BigUint64Array()); // Returns true - * ``` - * @since v10.0.0 - */ - function isBigUint64Array(value: unknown): value is BigUint64Array; - /** - * Returns `true` if the value is a boolean object, e.g. created - * by `new Boolean()`. - * - * ```js - * util.types.isBooleanObject(false); // Returns false - * util.types.isBooleanObject(true); // Returns false - * util.types.isBooleanObject(new Boolean(false)); // Returns true - * util.types.isBooleanObject(new Boolean(true)); // Returns true - * util.types.isBooleanObject(Boolean(false)); // Returns false - * util.types.isBooleanObject(Boolean(true)); // Returns false - * ``` - * @since v10.0.0 - */ - function isBooleanObject(object: unknown): object is Boolean; - /** - * Returns `true` if the value is any boxed primitive object, e.g. created - * by `new Boolean()`, `new String()` or `Object(Symbol())`. - * - * For example: - * - * ```js - * util.types.isBoxedPrimitive(false); // Returns false - * util.types.isBoxedPrimitive(new Boolean(false)); // Returns true - * util.types.isBoxedPrimitive(Symbol('foo')); // Returns false - * util.types.isBoxedPrimitive(Object(Symbol('foo'))); // Returns true - * util.types.isBoxedPrimitive(Object(BigInt(5))); // Returns true - * ``` - * @since v10.11.0 - */ - function isBoxedPrimitive(object: unknown): object is String | Number | BigInt | Boolean | Symbol; - /** - * Returns `true` if the value is a built-in [`DataView`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView) instance. - * - * ```js - * const ab = new ArrayBuffer(20); - * util.types.isDataView(new DataView(ab)); // Returns true - * util.types.isDataView(new Float64Array()); // Returns false - * ``` - * - * See also [`ArrayBuffer.isView()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer/isView). - * @since v10.0.0 - */ - function isDataView(object: unknown): object is DataView; - /** - * Returns `true` if the value is a built-in [`Date`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) instance. - * - * ```js - * util.types.isDate(new Date()); // Returns true - * ``` - * @since v10.0.0 - */ - function isDate(object: unknown): object is Date; - /** - * Returns `true` if the value is a native `External` value. - * - * A native `External` value is a special type of object that contains a - * raw C++ pointer (`void*`) for access from native code, and has no other - * properties. Such objects are created either by Node.js internals or native - * addons. In JavaScript, they are [frozen](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/freeze) objects with a`null` prototype. - * - * ```c - * #include - * #include - * napi_value result; - * static napi_value MyNapi(napi_env env, napi_callback_info info) { - * int* raw = (int*) malloc(1024); - * napi_status status = napi_create_external(env, (void*) raw, NULL, NULL, &result); - * if (status != napi_ok) { - * napi_throw_error(env, NULL, "napi_create_external failed"); - * return NULL; - * } - * return result; - * } - * ... - * DECLARE_NAPI_PROPERTY("myNapi", MyNapi) - * ... - * ``` - * - * ```js - * const native = require('napi_addon.node'); - * const data = native.myNapi(); - * util.types.isExternal(data); // returns true - * util.types.isExternal(0); // returns false - * util.types.isExternal(new String('foo')); // returns false - * ``` - * - * For further information on `napi_create_external`, refer to `napi_create_external()`. - * @since v10.0.0 - */ - function isExternal(object: unknown): boolean; - /** - * Returns `true` if the value is a built-in [`Float32Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array) instance. - * - * ```js - * util.types.isFloat32Array(new ArrayBuffer()); // Returns false - * util.types.isFloat32Array(new Float32Array()); // Returns true - * util.types.isFloat32Array(new Float64Array()); // Returns false - * ``` - * @since v10.0.0 - */ - function isFloat32Array(object: unknown): object is Float32Array; - /** - * Returns `true` if the value is a built-in [`Float64Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float64Array) instance. - * - * ```js - * util.types.isFloat64Array(new ArrayBuffer()); // Returns false - * util.types.isFloat64Array(new Uint8Array()); // Returns false - * util.types.isFloat64Array(new Float64Array()); // Returns true - * ``` - * @since v10.0.0 - */ - function isFloat64Array(object: unknown): object is Float64Array; - /** - * Returns `true` if the value is a generator function. - * This only reports back what the JavaScript engine is seeing; - * in particular, the return value may not match the original source code if - * a transpilation tool was used. - * - * ```js - * util.types.isGeneratorFunction(function foo() {}); // Returns false - * util.types.isGeneratorFunction(function* foo() {}); // Returns true - * ``` - * @since v10.0.0 - */ - function isGeneratorFunction(object: unknown): object is GeneratorFunction; - /** - * Returns `true` if the value is a generator object as returned from a - * built-in generator function. - * This only reports back what the JavaScript engine is seeing; - * in particular, the return value may not match the original source code if - * a transpilation tool was used. - * - * ```js - * function* foo() {} - * const generator = foo(); - * util.types.isGeneratorObject(generator); // Returns true - * ``` - * @since v10.0.0 - */ - function isGeneratorObject(object: unknown): object is Generator; - /** - * Returns `true` if the value is a built-in [`Int8Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int8Array) instance. - * - * ```js - * util.types.isInt8Array(new ArrayBuffer()); // Returns false - * util.types.isInt8Array(new Int8Array()); // Returns true - * util.types.isInt8Array(new Float64Array()); // Returns false - * ``` - * @since v10.0.0 - */ - function isInt8Array(object: unknown): object is Int8Array; - /** - * Returns `true` if the value is a built-in [`Int16Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int16Array) instance. - * - * ```js - * util.types.isInt16Array(new ArrayBuffer()); // Returns false - * util.types.isInt16Array(new Int16Array()); // Returns true - * util.types.isInt16Array(new Float64Array()); // Returns false - * ``` - * @since v10.0.0 - */ - function isInt16Array(object: unknown): object is Int16Array; - /** - * Returns `true` if the value is a built-in [`Int32Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int32Array) instance. - * - * ```js - * util.types.isInt32Array(new ArrayBuffer()); // Returns false - * util.types.isInt32Array(new Int32Array()); // Returns true - * util.types.isInt32Array(new Float64Array()); // Returns false - * ``` - * @since v10.0.0 - */ - function isInt32Array(object: unknown): object is Int32Array; - /** - * Returns `true` if the value is a built-in [`Map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map) instance. - * - * ```js - * util.types.isMap(new Map()); // Returns true - * ``` - * @since v10.0.0 - */ - function isMap(object: T | {}): object is T extends ReadonlyMap ? (unknown extends T ? never : ReadonlyMap) : Map; - /** - * Returns `true` if the value is an iterator returned for a built-in [`Map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map) instance. - * - * ```js - * const map = new Map(); - * util.types.isMapIterator(map.keys()); // Returns true - * util.types.isMapIterator(map.values()); // Returns true - * util.types.isMapIterator(map.entries()); // Returns true - * util.types.isMapIterator(map[Symbol.iterator]()); // Returns true - * ``` - * @since v10.0.0 - */ - function isMapIterator(object: unknown): boolean; - /** - * Returns `true` if the value is an instance of a [Module Namespace Object](https://tc39.github.io/ecma262/#sec-module-namespace-exotic-objects). - * - * ```js - * import * as ns from './a.js'; - * - * util.types.isModuleNamespaceObject(ns); // Returns true - * ``` - * @since v10.0.0 - */ - function isModuleNamespaceObject(value: unknown): boolean; - /** - * Returns `true` if the value is an instance of a built-in `Error` type. - * - * ```js - * util.types.isNativeError(new Error()); // Returns true - * util.types.isNativeError(new TypeError()); // Returns true - * util.types.isNativeError(new RangeError()); // Returns true - * ``` - * @since v10.0.0 - */ - function isNativeError(object: unknown): object is Error; - /** - * Returns `true` if the value is a number object, e.g. created - * by `new Number()`. - * - * ```js - * util.types.isNumberObject(0); // Returns false - * util.types.isNumberObject(new Number(0)); // Returns true - * ``` - * @since v10.0.0 - */ - function isNumberObject(object: unknown): object is Number; - /** - * Returns `true` if the value is a built-in [`Promise`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise). - * - * ```js - * util.types.isPromise(Promise.resolve(42)); // Returns true - * ``` - * @since v10.0.0 - */ - function isPromise(object: unknown): object is Promise; - /** - * Returns `true` if the value is a [`Proxy`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy) instance. - * - * ```js - * const target = {}; - * const proxy = new Proxy(target, {}); - * util.types.isProxy(target); // Returns false - * util.types.isProxy(proxy); // Returns true - * ``` - * @since v10.0.0 - */ - function isProxy(object: unknown): boolean; - /** - * Returns `true` if the value is a regular expression object. - * - * ```js - * util.types.isRegExp(/abc/); // Returns true - * util.types.isRegExp(new RegExp('abc')); // Returns true - * ``` - * @since v10.0.0 - */ - function isRegExp(object: unknown): object is RegExp; - /** - * Returns `true` if the value is a built-in [`Set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set) instance. - * - * ```js - * util.types.isSet(new Set()); // Returns true - * ``` - * @since v10.0.0 - */ - function isSet(object: T | {}): object is T extends ReadonlySet ? (unknown extends T ? never : ReadonlySet) : Set; - /** - * Returns `true` if the value is an iterator returned for a built-in [`Set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set) instance. - * - * ```js - * const set = new Set(); - * util.types.isSetIterator(set.keys()); // Returns true - * util.types.isSetIterator(set.values()); // Returns true - * util.types.isSetIterator(set.entries()); // Returns true - * util.types.isSetIterator(set[Symbol.iterator]()); // Returns true - * ``` - * @since v10.0.0 - */ - function isSetIterator(object: unknown): boolean; - /** - * Returns `true` if the value is a built-in [`SharedArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer) instance. - * This does _not_ include [`ArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer) instances. Usually, it is - * desirable to test for both; See `util.types.isAnyArrayBuffer()` for that. - * - * ```js - * util.types.isSharedArrayBuffer(new ArrayBuffer()); // Returns false - * util.types.isSharedArrayBuffer(new SharedArrayBuffer()); // Returns true - * ``` - * @since v10.0.0 - */ - function isSharedArrayBuffer(object: unknown): object is SharedArrayBuffer; - /** - * Returns `true` if the value is a string object, e.g. created - * by `new String()`. - * - * ```js - * util.types.isStringObject('foo'); // Returns false - * util.types.isStringObject(new String('foo')); // Returns true - * ``` - * @since v10.0.0 - */ - function isStringObject(object: unknown): object is String; - /** - * Returns `true` if the value is a symbol object, created - * by calling `Object()` on a `Symbol` primitive. - * - * ```js - * const symbol = Symbol('foo'); - * util.types.isSymbolObject(symbol); // Returns false - * util.types.isSymbolObject(Object(symbol)); // Returns true - * ``` - * @since v10.0.0 - */ - function isSymbolObject(object: unknown): object is Symbol; - /** - * Returns `true` if the value is a built-in [`TypedArray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray) instance. - * - * ```js - * util.types.isTypedArray(new ArrayBuffer()); // Returns false - * util.types.isTypedArray(new Uint8Array()); // Returns true - * util.types.isTypedArray(new Float64Array()); // Returns true - * ``` - * - * See also [`ArrayBuffer.isView()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer/isView). - * @since v10.0.0 - */ - function isTypedArray(object: unknown): object is NodeJS.TypedArray; - /** - * Returns `true` if the value is a built-in [`Uint8Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array) instance. - * - * ```js - * util.types.isUint8Array(new ArrayBuffer()); // Returns false - * util.types.isUint8Array(new Uint8Array()); // Returns true - * util.types.isUint8Array(new Float64Array()); // Returns false - * ``` - * @since v10.0.0 - */ - function isUint8Array(object: unknown): object is Uint8Array; - /** - * Returns `true` if the value is a built-in [`Uint8ClampedArray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8ClampedArray) instance. - * - * ```js - * util.types.isUint8ClampedArray(new ArrayBuffer()); // Returns false - * util.types.isUint8ClampedArray(new Uint8ClampedArray()); // Returns true - * util.types.isUint8ClampedArray(new Float64Array()); // Returns false - * ``` - * @since v10.0.0 - */ - function isUint8ClampedArray(object: unknown): object is Uint8ClampedArray; - /** - * Returns `true` if the value is a built-in [`Uint16Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint16Array) instance. - * - * ```js - * util.types.isUint16Array(new ArrayBuffer()); // Returns false - * util.types.isUint16Array(new Uint16Array()); // Returns true - * util.types.isUint16Array(new Float64Array()); // Returns false - * ``` - * @since v10.0.0 - */ - function isUint16Array(object: unknown): object is Uint16Array; - /** - * Returns `true` if the value is a built-in [`Uint32Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint32Array) instance. - * - * ```js - * util.types.isUint32Array(new ArrayBuffer()); // Returns false - * util.types.isUint32Array(new Uint32Array()); // Returns true - * util.types.isUint32Array(new Float64Array()); // Returns false - * ``` - * @since v10.0.0 - */ - function isUint32Array(object: unknown): object is Uint32Array; - /** - * Returns `true` if the value is a built-in [`WeakMap`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap) instance. - * - * ```js - * util.types.isWeakMap(new WeakMap()); // Returns true - * ``` - * @since v10.0.0 - */ - function isWeakMap(object: unknown): object is WeakMap; - /** - * Returns `true` if the value is a built-in [`WeakSet`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakSet) instance. - * - * ```js - * util.types.isWeakSet(new WeakSet()); // Returns true - * ``` - * @since v10.0.0 - */ - function isWeakSet(object: unknown): object is WeakSet; - /** - * Returns `true` if `value` is a `KeyObject`, `false` otherwise. - * @since v16.2.0 - */ - function isKeyObject(object: unknown): object is KeyObject; - /** - * Returns `true` if `value` is a `CryptoKey`, `false` otherwise. - * @since v16.2.0 - */ - function isCryptoKey(object: unknown): object is webcrypto.CryptoKey; -} -declare module 'node:util' { - export * from 'util'; -} -declare module 'node:util/types' { - export * from 'util/types'; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/v8.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/v8.d.ts deleted file mode 100755 index 6685dc25..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/v8.d.ts +++ /dev/null @@ -1,396 +0,0 @@ -/** - * The `v8` module exposes APIs that are specific to the version of [V8](https://developers.google.com/v8/) built into the Node.js binary. It can be accessed using: - * - * ```js - * const v8 = require('v8'); - * ``` - * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/v8.js) - */ -declare module 'v8' { - import { Readable } from 'node:stream'; - interface HeapSpaceInfo { - space_name: string; - space_size: number; - space_used_size: number; - space_available_size: number; - physical_space_size: number; - } - // ** Signifies if the --zap_code_space option is enabled or not. 1 == enabled, 0 == disabled. */ - type DoesZapCodeSpaceFlag = 0 | 1; - interface HeapInfo { - total_heap_size: number; - total_heap_size_executable: number; - total_physical_size: number; - total_available_size: number; - used_heap_size: number; - heap_size_limit: number; - malloced_memory: number; - peak_malloced_memory: number; - does_zap_garbage: DoesZapCodeSpaceFlag; - number_of_native_contexts: number; - number_of_detached_contexts: number; - } - interface HeapCodeStatistics { - code_and_metadata_size: number; - bytecode_and_metadata_size: number; - external_script_source_size: number; - } - /** - * Returns an integer representing a version tag derived from the V8 version, - * command-line flags, and detected CPU features. This is useful for determining - * whether a `vm.Script` `cachedData` buffer is compatible with this instance - * of V8. - * - * ```js - * console.log(v8.cachedDataVersionTag()); // 3947234607 - * // The value returned by v8.cachedDataVersionTag() is derived from the V8 - * // version, command-line flags, and detected CPU features. Test that the value - * // does indeed update when flags are toggled. - * v8.setFlagsFromString('--allow_natives_syntax'); - * console.log(v8.cachedDataVersionTag()); // 183726201 - * ``` - * @since v8.0.0 - */ - function cachedDataVersionTag(): number; - /** - * Returns an object with the following properties: - * - * `does_zap_garbage` is a 0/1 boolean, which signifies whether the`--zap_code_space` option is enabled or not. This makes V8 overwrite heap - * garbage with a bit pattern. The RSS footprint (resident set size) gets bigger - * because it continuously touches all heap pages and that makes them less likely - * to get swapped out by the operating system. - * - * `number_of_native_contexts` The value of native\_context is the number of the - * top-level contexts currently active. Increase of this number over time indicates - * a memory leak. - * - * `number_of_detached_contexts` The value of detached\_context is the number - * of contexts that were detached and not yet garbage collected. This number - * being non-zero indicates a potential memory leak. - * - * ```js - * { - * total_heap_size: 7326976, - * total_heap_size_executable: 4194304, - * total_physical_size: 7326976, - * total_available_size: 1152656, - * used_heap_size: 3476208, - * heap_size_limit: 1535115264, - * malloced_memory: 16384, - * peak_malloced_memory: 1127496, - * does_zap_garbage: 0, - * number_of_native_contexts: 1, - * number_of_detached_contexts: 0 - * } - * ``` - * @since v1.0.0 - */ - function getHeapStatistics(): HeapInfo; - /** - * Returns statistics about the V8 heap spaces, i.e. the segments which make up - * the V8 heap. Neither the ordering of heap spaces, nor the availability of a - * heap space can be guaranteed as the statistics are provided via the - * V8[`GetHeapSpaceStatistics`](https://v8docs.nodesource.com/node-13.2/d5/dda/classv8_1_1_isolate.html#ac673576f24fdc7a33378f8f57e1d13a4) function and may change from one V8 version to the - * next. - * - * The value returned is an array of objects containing the following properties: - * - * ```json - * [ - * { - * "space_name": "new_space", - * "space_size": 2063872, - * "space_used_size": 951112, - * "space_available_size": 80824, - * "physical_space_size": 2063872 - * }, - * { - * "space_name": "old_space", - * "space_size": 3090560, - * "space_used_size": 2493792, - * "space_available_size": 0, - * "physical_space_size": 3090560 - * }, - * { - * "space_name": "code_space", - * "space_size": 1260160, - * "space_used_size": 644256, - * "space_available_size": 960, - * "physical_space_size": 1260160 - * }, - * { - * "space_name": "map_space", - * "space_size": 1094160, - * "space_used_size": 201608, - * "space_available_size": 0, - * "physical_space_size": 1094160 - * }, - * { - * "space_name": "large_object_space", - * "space_size": 0, - * "space_used_size": 0, - * "space_available_size": 1490980608, - * "physical_space_size": 0 - * } - * ] - * ``` - * @since v6.0.0 - */ - function getHeapSpaceStatistics(): HeapSpaceInfo[]; - /** - * The `v8.setFlagsFromString()` method can be used to programmatically set - * V8 command-line flags. This method should be used with care. Changing settings - * after the VM has started may result in unpredictable behavior, including - * crashes and data loss; or it may simply do nothing. - * - * The V8 options available for a version of Node.js may be determined by running`node --v8-options`. - * - * Usage: - * - * ```js - * // Print GC events to stdout for one minute. - * const v8 = require('v8'); - * v8.setFlagsFromString('--trace_gc'); - * setTimeout(() => { v8.setFlagsFromString('--notrace_gc'); }, 60e3); - * ``` - * @since v1.0.0 - */ - function setFlagsFromString(flags: string): void; - /** - * Generates a snapshot of the current V8 heap and returns a Readable - * Stream that may be used to read the JSON serialized representation. - * This JSON stream format is intended to be used with tools such as - * Chrome DevTools. The JSON schema is undocumented and specific to the - * V8 engine. Therefore, the schema may change from one version of V8 to the next. - * - * Creating a heap snapshot requires memory about twice the size of the heap at - * the time the snapshot is created. This results in the risk of OOM killers - * terminating the process. - * - * Generating a snapshot is a synchronous operation which blocks the event loop - * for a duration depending on the heap size. - * - * ```js - * // Print heap snapshot to the console - * const v8 = require('v8'); - * const stream = v8.getHeapSnapshot(); - * stream.pipe(process.stdout); - * ``` - * @since v11.13.0 - * @return A Readable Stream containing the V8 heap snapshot - */ - function getHeapSnapshot(): Readable; - /** - * Generates a snapshot of the current V8 heap and writes it to a JSON - * file. This file is intended to be used with tools such as Chrome - * DevTools. The JSON schema is undocumented and specific to the V8 - * engine, and may change from one version of V8 to the next. - * - * A heap snapshot is specific to a single V8 isolate. When using `worker threads`, a heap snapshot generated from the main thread will - * not contain any information about the workers, and vice versa. - * - * Creating a heap snapshot requires memory about twice the size of the heap at - * the time the snapshot is created. This results in the risk of OOM killers - * terminating the process. - * - * Generating a snapshot is a synchronous operation which blocks the event loop - * for a duration depending on the heap size. - * - * ```js - * const { writeHeapSnapshot } = require('v8'); - * const { - * Worker, - * isMainThread, - * parentPort - * } = require('worker_threads'); - * - * if (isMainThread) { - * const worker = new Worker(__filename); - * - * worker.once('message', (filename) => { - * console.log(`worker heapdump: ${filename}`); - * // Now get a heapdump for the main thread. - * console.log(`main thread heapdump: ${writeHeapSnapshot()}`); - * }); - * - * // Tell the worker to create a heapdump. - * worker.postMessage('heapdump'); - * } else { - * parentPort.once('message', (message) => { - * if (message === 'heapdump') { - * // Generate a heapdump for the worker - * // and return the filename to the parent. - * parentPort.postMessage(writeHeapSnapshot()); - * } - * }); - * } - * ``` - * @since v11.13.0 - * @param filename The file path where the V8 heap snapshot is to be saved. If not specified, a file name with the pattern `'Heap-${yyyymmdd}-${hhmmss}-${pid}-${thread_id}.heapsnapshot'` will be - * generated, where `{pid}` will be the PID of the Node.js process, `{thread_id}` will be `0` when `writeHeapSnapshot()` is called from the main Node.js thread or the id of a - * worker thread. - * @return The filename where the snapshot was saved. - */ - function writeHeapSnapshot(filename?: string): string; - /** - * Returns an object with the following properties: - * - * ```js - * { - * code_and_metadata_size: 212208, - * bytecode_and_metadata_size: 161368, - * external_script_source_size: 1410794 - * } - * ``` - * @since v12.8.0 - */ - function getHeapCodeStatistics(): HeapCodeStatistics; - /** - * @since v8.0.0 - */ - class Serializer { - /** - * Writes out a header, which includes the serialization format version. - */ - writeHeader(): void; - /** - * Serializes a JavaScript value and adds the serialized representation to the - * internal buffer. - * - * This throws an error if `value` cannot be serialized. - */ - writeValue(val: any): boolean; - /** - * Returns the stored internal buffer. This serializer should not be used once - * the buffer is released. Calling this method results in undefined behavior - * if a previous write has failed. - */ - releaseBuffer(): Buffer; - /** - * Marks an `ArrayBuffer` as having its contents transferred out of band. - * Pass the corresponding `ArrayBuffer` in the deserializing context to `deserializer.transferArrayBuffer()`. - * @param id A 32-bit unsigned integer. - * @param arrayBuffer An `ArrayBuffer` instance. - */ - transferArrayBuffer(id: number, arrayBuffer: ArrayBuffer): void; - /** - * Write a raw 32-bit unsigned integer. - * For use inside of a custom `serializer._writeHostObject()`. - */ - writeUint32(value: number): void; - /** - * Write a raw 64-bit unsigned integer, split into high and low 32-bit parts. - * For use inside of a custom `serializer._writeHostObject()`. - */ - writeUint64(hi: number, lo: number): void; - /** - * Write a JS `number` value. - * For use inside of a custom `serializer._writeHostObject()`. - */ - writeDouble(value: number): void; - /** - * Write raw bytes into the serializer’s internal buffer. The deserializer - * will require a way to compute the length of the buffer. - * For use inside of a custom `serializer._writeHostObject()`. - */ - writeRawBytes(buffer: NodeJS.TypedArray): void; - } - /** - * A subclass of `Serializer` that serializes `TypedArray`(in particular `Buffer`) and `DataView` objects as host objects, and only - * stores the part of their underlying `ArrayBuffer`s that they are referring to. - * @since v8.0.0 - */ - class DefaultSerializer extends Serializer {} - /** - * @since v8.0.0 - */ - class Deserializer { - constructor(data: NodeJS.TypedArray); - /** - * Reads and validates a header (including the format version). - * May, for example, reject an invalid or unsupported wire format. In that case, - * an `Error` is thrown. - */ - readHeader(): boolean; - /** - * Deserializes a JavaScript value from the buffer and returns it. - */ - readValue(): any; - /** - * Marks an `ArrayBuffer` as having its contents transferred out of band. - * Pass the corresponding `ArrayBuffer` in the serializing context to `serializer.transferArrayBuffer()` (or return the `id` from `serializer._getSharedArrayBufferId()` in the case of - * `SharedArrayBuffer`s). - * @param id A 32-bit unsigned integer. - * @param arrayBuffer An `ArrayBuffer` instance. - */ - transferArrayBuffer(id: number, arrayBuffer: ArrayBuffer): void; - /** - * Reads the underlying wire format version. Likely mostly to be useful to - * legacy code reading old wire format versions. May not be called before`.readHeader()`. - */ - getWireFormatVersion(): number; - /** - * Read a raw 32-bit unsigned integer and return it. - * For use inside of a custom `deserializer._readHostObject()`. - */ - readUint32(): number; - /** - * Read a raw 64-bit unsigned integer and return it as an array `[hi, lo]`with two 32-bit unsigned integer entries. - * For use inside of a custom `deserializer._readHostObject()`. - */ - readUint64(): [number, number]; - /** - * Read a JS `number` value. - * For use inside of a custom `deserializer._readHostObject()`. - */ - readDouble(): number; - /** - * Read raw bytes from the deserializer’s internal buffer. The `length` parameter - * must correspond to the length of the buffer that was passed to `serializer.writeRawBytes()`. - * For use inside of a custom `deserializer._readHostObject()`. - */ - readRawBytes(length: number): Buffer; - } - /** - * A subclass of `Deserializer` corresponding to the format written by `DefaultSerializer`. - * @since v8.0.0 - */ - class DefaultDeserializer extends Deserializer {} - /** - * Uses a `DefaultSerializer` to serialize `value` into a buffer. - * - * `ERR_BUFFER_TOO_LARGE` will be thrown when trying to - * serialize a huge object which requires buffer - * larger than `buffer.constants.MAX_LENGTH`. - * @since v8.0.0 - */ - function serialize(value: any): Buffer; - /** - * Uses a `DefaultDeserializer` with default options to read a JS value - * from a buffer. - * @since v8.0.0 - * @param buffer A buffer returned by {@link serialize}. - */ - function deserialize(buffer: NodeJS.TypedArray): any; - /** - * The `v8.takeCoverage()` method allows the user to write the coverage started by `NODE_V8_COVERAGE` to disk on demand. This method can be invoked multiple - * times during the lifetime of the process. Each time the execution counter will - * be reset and a new coverage report will be written to the directory specified - * by `NODE_V8_COVERAGE`. - * - * When the process is about to exit, one last coverage will still be written to - * disk unless {@link stopCoverage} is invoked before the process exits. - * @since v15.1.0, v14.18.0, v12.22.0 - */ - function takeCoverage(): void; - /** - * The `v8.stopCoverage()` method allows the user to stop the coverage collection - * started by `NODE_V8_COVERAGE`, so that V8 can release the execution count - * records and optimize code. This can be used in conjunction with {@link takeCoverage} if the user wants to collect the coverage on demand. - * @since v15.1.0, v14.18.0, v12.22.0 - */ - function stopCoverage(): void; -} -declare module 'node:v8' { - export * from 'v8'; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/vm.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/vm.d.ts deleted file mode 100755 index c96513a5..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/@types/node/ts4.8/vm.d.ts +++ /dev/null @@ -1,509 +0,0 @@ -/** - * The `vm` module enables compiling and running code within V8 Virtual - * Machine contexts. - * - * **The `vm` module is not a security** - * **mechanism. Do not use it to run untrusted code.** - * - * JavaScript code can be compiled and run immediately or - * compiled, saved, and run later. - * - * A common use case is to run the code in a different V8 Context. This means - * invoked code has a different global object than the invoking code. - * - * One can provide the context by `contextifying` an - * object. The invoked code treats any property in the context like a - * global variable. Any changes to global variables caused by the invoked - * code are reflected in the context object. - * - * ```js - * const vm = require('vm'); - * - * const x = 1; - * - * const context = { x: 2 }; - * vm.createContext(context); // Contextify the object. - * - * const code = 'x += 40; var y = 17;'; - * // `x` and `y` are global variables in the context. - * // Initially, x has the value 2 because that is the value of context.x. - * vm.runInContext(code, context); - * - * console.log(context.x); // 42 - * console.log(context.y); // 17 - * - * console.log(x); // 1; y is not defined. - * ``` - * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/vm.js) - */ -declare module 'vm' { - interface Context extends NodeJS.Dict {} - interface BaseOptions { - /** - * Specifies the filename used in stack traces produced by this script. - * Default: `''`. - */ - filename?: string | undefined; - /** - * Specifies the line number offset that is displayed in stack traces produced by this script. - * Default: `0`. - */ - lineOffset?: number | undefined; - /** - * Specifies the column number offset that is displayed in stack traces produced by this script. - * @default 0 - */ - columnOffset?: number | undefined; - } - interface ScriptOptions extends BaseOptions { - displayErrors?: boolean | undefined; - timeout?: number | undefined; - cachedData?: Buffer | undefined; - /** @deprecated in favor of `script.createCachedData()` */ - produceCachedData?: boolean | undefined; - } - interface RunningScriptOptions extends BaseOptions { - /** - * When `true`, if an `Error` occurs while compiling the `code`, the line of code causing the error is attached to the stack trace. - * Default: `true`. - */ - displayErrors?: boolean | undefined; - /** - * Specifies the number of milliseconds to execute code before terminating execution. - * If execution is terminated, an `Error` will be thrown. This value must be a strictly positive integer. - */ - timeout?: number | undefined; - /** - * If `true`, the execution will be terminated when `SIGINT` (Ctrl+C) is received. - * Existing handlers for the event that have been attached via `process.on('SIGINT')` will be disabled during script execution, but will continue to work after that. - * If execution is terminated, an `Error` will be thrown. - * Default: `false`. - */ - breakOnSigint?: boolean | undefined; - /** - * If set to `afterEvaluate`, microtasks will be run immediately after the script has run. - */ - microtaskMode?: 'afterEvaluate' | undefined; - } - interface CompileFunctionOptions extends BaseOptions { - /** - * Provides an optional data with V8's code cache data for the supplied source. - */ - cachedData?: Buffer | undefined; - /** - * Specifies whether to produce new cache data. - * Default: `false`, - */ - produceCachedData?: boolean | undefined; - /** - * The sandbox/context in which the said function should be compiled in. - */ - parsingContext?: Context | undefined; - /** - * An array containing a collection of context extensions (objects wrapping the current scope) to be applied while compiling - */ - contextExtensions?: Object[] | undefined; - } - interface CreateContextOptions { - /** - * Human-readable name of the newly created context. - * @default 'VM Context i' Where i is an ascending numerical index of the created context. - */ - name?: string | undefined; - /** - * Corresponds to the newly created context for display purposes. - * The origin should be formatted like a `URL`, but with only the scheme, host, and port (if necessary), - * like the value of the `url.origin` property of a URL object. - * Most notably, this string should omit the trailing slash, as that denotes a path. - * @default '' - */ - origin?: string | undefined; - codeGeneration?: - | { - /** - * If set to false any calls to eval or function constructors (Function, GeneratorFunction, etc) - * will throw an EvalError. - * @default true - */ - strings?: boolean | undefined; - /** - * If set to false any attempt to compile a WebAssembly module will throw a WebAssembly.CompileError. - * @default true - */ - wasm?: boolean | undefined; - } - | undefined; - /** - * If set to `afterEvaluate`, microtasks will be run immediately after the script has run. - */ - microtaskMode?: 'afterEvaluate' | undefined; - } - type MeasureMemoryMode = 'summary' | 'detailed'; - interface MeasureMemoryOptions { - /** - * @default 'summary' - */ - mode?: MeasureMemoryMode | undefined; - context?: Context | undefined; - } - interface MemoryMeasurement { - total: { - jsMemoryEstimate: number; - jsMemoryRange: [number, number]; - }; - } - /** - * Instances of the `vm.Script` class contain precompiled scripts that can be - * executed in specific contexts. - * @since v0.3.1 - */ - class Script { - constructor(code: string, options?: ScriptOptions); - /** - * Runs the compiled code contained by the `vm.Script` object within the given`contextifiedObject` and returns the result. Running code does not have access - * to local scope. - * - * The following example compiles code that increments a global variable, sets - * the value of another global variable, then execute the code multiple times. - * The globals are contained in the `context` object. - * - * ```js - * const vm = require('vm'); - * - * const context = { - * animal: 'cat', - * count: 2 - * }; - * - * const script = new vm.Script('count += 1; name = "kitty";'); - * - * vm.createContext(context); - * for (let i = 0; i < 10; ++i) { - * script.runInContext(context); - * } - * - * console.log(context); - * // Prints: { animal: 'cat', count: 12, name: 'kitty' } - * ``` - * - * Using the `timeout` or `breakOnSigint` options will result in new event loops - * and corresponding threads being started, which have a non-zero performance - * overhead. - * @since v0.3.1 - * @param contextifiedObject A `contextified` object as returned by the `vm.createContext()` method. - * @return the result of the very last statement executed in the script. - */ - runInContext(contextifiedObject: Context, options?: RunningScriptOptions): any; - /** - * First contextifies the given `contextObject`, runs the compiled code contained - * by the `vm.Script` object within the created context, and returns the result. - * Running code does not have access to local scope. - * - * The following example compiles code that sets a global variable, then executes - * the code multiple times in different contexts. The globals are set on and - * contained within each individual `context`. - * - * ```js - * const vm = require('vm'); - * - * const script = new vm.Script('globalVar = "set"'); - * - * const contexts = [{}, {}, {}]; - * contexts.forEach((context) => { - * script.runInNewContext(context); - * }); - * - * console.log(contexts); - * // Prints: [{ globalVar: 'set' }, { globalVar: 'set' }, { globalVar: 'set' }] - * ``` - * @since v0.3.1 - * @param contextObject An object that will be `contextified`. If `undefined`, a new object will be created. - * @return the result of the very last statement executed in the script. - */ - runInNewContext(contextObject?: Context, options?: RunningScriptOptions): any; - /** - * Runs the compiled code contained by the `vm.Script` within the context of the - * current `global` object. Running code does not have access to local scope, but _does_ have access to the current `global` object. - * - * The following example compiles code that increments a `global` variable then - * executes that code multiple times: - * - * ```js - * const vm = require('vm'); - * - * global.globalVar = 0; - * - * const script = new vm.Script('globalVar += 1', { filename: 'myfile.vm' }); - * - * for (let i = 0; i < 1000; ++i) { - * script.runInThisContext(); - * } - * - * console.log(globalVar); - * - * // 1000 - * ``` - * @since v0.3.1 - * @return the result of the very last statement executed in the script. - */ - runInThisContext(options?: RunningScriptOptions): any; - /** - * Creates a code cache that can be used with the `Script` constructor's`cachedData` option. Returns a `Buffer`. This method may be called at any - * time and any number of times. - * - * ```js - * const script = new vm.Script(` - * function add(a, b) { - * return a + b; - * } - * - * const x = add(1, 2); - * `); - * - * const cacheWithoutX = script.createCachedData(); - * - * script.runInThisContext(); - * - * const cacheWithX = script.createCachedData(); - * ``` - * @since v10.6.0 - */ - createCachedData(): Buffer; - /** @deprecated in favor of `script.createCachedData()` */ - cachedDataProduced?: boolean | undefined; - cachedDataRejected?: boolean | undefined; - cachedData?: Buffer | undefined; - } - /** - * If given a `contextObject`, the `vm.createContext()` method will `prepare - * that object` so that it can be used in calls to {@link runInContext} or `script.runInContext()`. Inside such scripts, - * the `contextObject` will be the global object, retaining all of its existing - * properties but also having the built-in objects and functions any standard [global object](https://es5.github.io/#x15.1) has. Outside of scripts run by the vm module, global variables - * will remain unchanged. - * - * ```js - * const vm = require('vm'); - * - * global.globalVar = 3; - * - * const context = { globalVar: 1 }; - * vm.createContext(context); - * - * vm.runInContext('globalVar *= 2;', context); - * - * console.log(context); - * // Prints: { globalVar: 2 } - * - * console.log(global.globalVar); - * // Prints: 3 - * ``` - * - * If `contextObject` is omitted (or passed explicitly as `undefined`), a new, - * empty `contextified` object will be returned. - * - * The `vm.createContext()` method is primarily useful for creating a single - * context that can be used to run multiple scripts. For instance, if emulating a - * web browser, the method can be used to create a single context representing a - * window's global object, then run all ` - -escodegen.browser.js can be found in tagged revisions on GitHub. - -Or in a Node.js application via npm: - - npm install escodegen - -### Usage - -A simple example: the program - - escodegen.generate({ - type: 'BinaryExpression', - operator: '+', - left: { type: 'Literal', value: 40 }, - right: { type: 'Literal', value: 2 } - }); - -produces the string `'40 + 2'`. - -See the [API page](https://github.com/estools/escodegen/wiki/API) for -options. To run the tests, execute `npm test` in the root directory. - -### Building browser bundle / minified browser bundle - -At first, execute `npm install` to install the all dev dependencies. -After that, - - npm run-script build - -will generate `escodegen.browser.js`, which can be used in browser environments. - -And, - - npm run-script build-min - -will generate the minified file `escodegen.browser.min.js`. - -### License - -#### Escodegen - -Copyright (C) 2012 [Yusuke Suzuki](http://github.com/Constellation) - (twitter: [@Constellation](http://twitter.com/Constellation)) and other contributors. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/escodegen/bin/escodegen.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/escodegen/bin/escodegen.js deleted file mode 100755 index a7c38aa1..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/escodegen/bin/escodegen.js +++ /dev/null @@ -1,77 +0,0 @@ -#!/usr/bin/env node -/* - Copyright (C) 2012 Yusuke Suzuki - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -/*jslint sloppy:true node:true */ - -var fs = require('fs'), - path = require('path'), - root = path.join(path.dirname(fs.realpathSync(__filename)), '..'), - esprima = require('esprima'), - escodegen = require(root), - optionator = require('optionator')({ - prepend: 'Usage: escodegen [options] file...', - options: [ - { - option: 'config', - alias: 'c', - type: 'String', - description: 'configuration json for escodegen' - } - ] - }), - args = optionator.parse(process.argv), - files = args._, - options, - esprimaOptions = { - raw: true, - tokens: true, - range: true, - comment: true - }; - -if (files.length === 0) { - console.log(optionator.generateHelp()); - process.exit(1); -} - -if (args.config) { - try { - options = JSON.parse(fs.readFileSync(args.config, 'utf-8')); - } catch (err) { - console.error('Error parsing config: ', err); - } -} - -files.forEach(function (filename) { - var content = fs.readFileSync(filename, 'utf-8'), - syntax = esprima.parse(content, esprimaOptions); - - if (options.comment) { - escodegen.attachComments(syntax, syntax.comments, syntax.tokens); - } - - console.log(escodegen.generate(syntax, options)); -}); -/* vim: set sw=4 ts=4 et tw=80 : */ diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/escodegen/bin/esgenerate.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/escodegen/bin/esgenerate.js deleted file mode 100755 index 449abcc8..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/escodegen/bin/esgenerate.js +++ /dev/null @@ -1,64 +0,0 @@ -#!/usr/bin/env node -/* - Copyright (C) 2012 Yusuke Suzuki - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -/*jslint sloppy:true node:true */ - -var fs = require('fs'), - path = require('path'), - root = path.join(path.dirname(fs.realpathSync(__filename)), '..'), - escodegen = require(root), - optionator = require('optionator')({ - prepend: 'Usage: esgenerate [options] file.json ...', - options: [ - { - option: 'config', - alias: 'c', - type: 'String', - description: 'configuration json for escodegen' - } - ] - }), - args = optionator.parse(process.argv), - files = args._, - options; - -if (files.length === 0) { - console.log(optionator.generateHelp()); - process.exit(1); -} - -if (args.config) { - try { - options = JSON.parse(fs.readFileSync(args.config, 'utf-8')) - } catch (err) { - console.error('Error parsing config: ', err); - } -} - -files.forEach(function (filename) { - var content = fs.readFileSync(filename, 'utf-8'); - console.log(escodegen.generate(JSON.parse(content), options)); -}); -/* vim: set sw=4 ts=4 et tw=80 : */ diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/escodegen/escodegen.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/escodegen/escodegen.js deleted file mode 100644 index 4c055b88..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/escodegen/escodegen.js +++ /dev/null @@ -1,2626 +0,0 @@ -/* - Copyright (C) 2012-2014 Yusuke Suzuki - Copyright (C) 2015 Ingvar Stepanyan - Copyright (C) 2014 Ivan Nikulin - Copyright (C) 2012-2013 Michael Ficarra - Copyright (C) 2012-2013 Mathias Bynens - Copyright (C) 2013 Irakli Gozalishvili - Copyright (C) 2012 Robert Gust-Bardon - Copyright (C) 2012 John Freeman - Copyright (C) 2011-2012 Ariya Hidayat - Copyright (C) 2012 Joost-Wim Boekesteijn - Copyright (C) 2012 Kris Kowal - Copyright (C) 2012 Arpad Borsos - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -/*global exports:true, require:true, global:true*/ -(function () { - 'use strict'; - - var Syntax, - Precedence, - BinaryPrecedence, - SourceNode, - estraverse, - esutils, - base, - indent, - json, - renumber, - hexadecimal, - quotes, - escapeless, - newline, - space, - parentheses, - semicolons, - safeConcatenation, - directive, - extra, - parse, - sourceMap, - sourceCode, - preserveBlankLines, - FORMAT_MINIFY, - FORMAT_DEFAULTS; - - estraverse = require('estraverse'); - esutils = require('esutils'); - - Syntax = estraverse.Syntax; - - // Generation is done by generateExpression. - function isExpression(node) { - return CodeGenerator.Expression.hasOwnProperty(node.type); - } - - // Generation is done by generateStatement. - function isStatement(node) { - return CodeGenerator.Statement.hasOwnProperty(node.type); - } - - Precedence = { - Sequence: 0, - Yield: 1, - Assignment: 1, - Conditional: 2, - ArrowFunction: 2, - LogicalOR: 3, - LogicalAND: 4, - BitwiseOR: 5, - BitwiseXOR: 6, - BitwiseAND: 7, - Equality: 8, - Relational: 9, - BitwiseSHIFT: 10, - Additive: 11, - Multiplicative: 12, - Exponentiation: 13, - Await: 14, - Unary: 14, - Postfix: 15, - Call: 16, - New: 17, - TaggedTemplate: 18, - Member: 19, - Primary: 20 - }; - - BinaryPrecedence = { - '||': Precedence.LogicalOR, - '&&': Precedence.LogicalAND, - '|': Precedence.BitwiseOR, - '^': Precedence.BitwiseXOR, - '&': Precedence.BitwiseAND, - '==': Precedence.Equality, - '!=': Precedence.Equality, - '===': Precedence.Equality, - '!==': Precedence.Equality, - 'is': Precedence.Equality, - 'isnt': Precedence.Equality, - '<': Precedence.Relational, - '>': Precedence.Relational, - '<=': Precedence.Relational, - '>=': Precedence.Relational, - 'in': Precedence.Relational, - 'instanceof': Precedence.Relational, - '<<': Precedence.BitwiseSHIFT, - '>>': Precedence.BitwiseSHIFT, - '>>>': Precedence.BitwiseSHIFT, - '+': Precedence.Additive, - '-': Precedence.Additive, - '*': Precedence.Multiplicative, - '%': Precedence.Multiplicative, - '/': Precedence.Multiplicative, - '**': Precedence.Exponentiation - }; - - //Flags - var F_ALLOW_IN = 1, - F_ALLOW_CALL = 1 << 1, - F_ALLOW_UNPARATH_NEW = 1 << 2, - F_FUNC_BODY = 1 << 3, - F_DIRECTIVE_CTX = 1 << 4, - F_SEMICOLON_OPT = 1 << 5; - - //Expression flag sets - //NOTE: Flag order: - // F_ALLOW_IN - // F_ALLOW_CALL - // F_ALLOW_UNPARATH_NEW - var E_FTT = F_ALLOW_CALL | F_ALLOW_UNPARATH_NEW, - E_TTF = F_ALLOW_IN | F_ALLOW_CALL, - E_TTT = F_ALLOW_IN | F_ALLOW_CALL | F_ALLOW_UNPARATH_NEW, - E_TFF = F_ALLOW_IN, - E_FFT = F_ALLOW_UNPARATH_NEW, - E_TFT = F_ALLOW_IN | F_ALLOW_UNPARATH_NEW; - - //Statement flag sets - //NOTE: Flag order: - // F_ALLOW_IN - // F_FUNC_BODY - // F_DIRECTIVE_CTX - // F_SEMICOLON_OPT - var S_TFFF = F_ALLOW_IN, - S_TFFT = F_ALLOW_IN | F_SEMICOLON_OPT, - S_FFFF = 0x00, - S_TFTF = F_ALLOW_IN | F_DIRECTIVE_CTX, - S_TTFF = F_ALLOW_IN | F_FUNC_BODY; - - function getDefaultOptions() { - // default options - return { - indent: null, - base: null, - parse: null, - comment: false, - format: { - indent: { - style: ' ', - base: 0, - adjustMultilineComment: false - }, - newline: '\n', - space: ' ', - json: false, - renumber: false, - hexadecimal: false, - quotes: 'single', - escapeless: false, - compact: false, - parentheses: true, - semicolons: true, - safeConcatenation: false, - preserveBlankLines: false - }, - moz: { - comprehensionExpressionStartsWithAssignment: false, - starlessGenerator: false - }, - sourceMap: null, - sourceMapRoot: null, - sourceMapWithCode: false, - directive: false, - raw: true, - verbatim: null, - sourceCode: null - }; - } - - function stringRepeat(str, num) { - var result = ''; - - for (num |= 0; num > 0; num >>>= 1, str += str) { - if (num & 1) { - result += str; - } - } - - return result; - } - - function hasLineTerminator(str) { - return (/[\r\n]/g).test(str); - } - - function endsWithLineTerminator(str) { - var len = str.length; - return len && esutils.code.isLineTerminator(str.charCodeAt(len - 1)); - } - - function merge(target, override) { - var key; - for (key in override) { - if (override.hasOwnProperty(key)) { - target[key] = override[key]; - } - } - return target; - } - - function updateDeeply(target, override) { - var key, val; - - function isHashObject(target) { - return typeof target === 'object' && target instanceof Object && !(target instanceof RegExp); - } - - for (key in override) { - if (override.hasOwnProperty(key)) { - val = override[key]; - if (isHashObject(val)) { - if (isHashObject(target[key])) { - updateDeeply(target[key], val); - } else { - target[key] = updateDeeply({}, val); - } - } else { - target[key] = val; - } - } - } - return target; - } - - function generateNumber(value) { - var result, point, temp, exponent, pos; - - if (value !== value) { - throw new Error('Numeric literal whose value is NaN'); - } - if (value < 0 || (value === 0 && 1 / value < 0)) { - throw new Error('Numeric literal whose value is negative'); - } - - if (value === 1 / 0) { - return json ? 'null' : renumber ? '1e400' : '1e+400'; - } - - result = '' + value; - if (!renumber || result.length < 3) { - return result; - } - - point = result.indexOf('.'); - if (!json && result.charCodeAt(0) === 0x30 /* 0 */ && point === 1) { - point = 0; - result = result.slice(1); - } - temp = result; - result = result.replace('e+', 'e'); - exponent = 0; - if ((pos = temp.indexOf('e')) > 0) { - exponent = +temp.slice(pos + 1); - temp = temp.slice(0, pos); - } - if (point >= 0) { - exponent -= temp.length - point - 1; - temp = +(temp.slice(0, point) + temp.slice(point + 1)) + ''; - } - pos = 0; - while (temp.charCodeAt(temp.length + pos - 1) === 0x30 /* 0 */) { - --pos; - } - if (pos !== 0) { - exponent -= pos; - temp = temp.slice(0, pos); - } - if (exponent !== 0) { - temp += 'e' + exponent; - } - if ((temp.length < result.length || - (hexadecimal && value > 1e12 && Math.floor(value) === value && (temp = '0x' + value.toString(16)).length < result.length)) && - +temp === value) { - result = temp; - } - - return result; - } - - // Generate valid RegExp expression. - // This function is based on https://github.com/Constellation/iv Engine - - function escapeRegExpCharacter(ch, previousIsBackslash) { - // not handling '\' and handling \u2028 or \u2029 to unicode escape sequence - if ((ch & ~1) === 0x2028) { - return (previousIsBackslash ? 'u' : '\\u') + ((ch === 0x2028) ? '2028' : '2029'); - } else if (ch === 10 || ch === 13) { // \n, \r - return (previousIsBackslash ? '' : '\\') + ((ch === 10) ? 'n' : 'r'); - } - return String.fromCharCode(ch); - } - - function generateRegExp(reg) { - var match, result, flags, i, iz, ch, characterInBrack, previousIsBackslash; - - result = reg.toString(); - - if (reg.source) { - // extract flag from toString result - match = result.match(/\/([^/]*)$/); - if (!match) { - return result; - } - - flags = match[1]; - result = ''; - - characterInBrack = false; - previousIsBackslash = false; - for (i = 0, iz = reg.source.length; i < iz; ++i) { - ch = reg.source.charCodeAt(i); - - if (!previousIsBackslash) { - if (characterInBrack) { - if (ch === 93) { // ] - characterInBrack = false; - } - } else { - if (ch === 47) { // / - result += '\\'; - } else if (ch === 91) { // [ - characterInBrack = true; - } - } - result += escapeRegExpCharacter(ch, previousIsBackslash); - previousIsBackslash = ch === 92; // \ - } else { - // if new RegExp("\\\n') is provided, create /\n/ - result += escapeRegExpCharacter(ch, previousIsBackslash); - // prevent like /\\[/]/ - previousIsBackslash = false; - } - } - - return '/' + result + '/' + flags; - } - - return result; - } - - function escapeAllowedCharacter(code, next) { - var hex; - - if (code === 0x08 /* \b */) { - return '\\b'; - } - - if (code === 0x0C /* \f */) { - return '\\f'; - } - - if (code === 0x09 /* \t */) { - return '\\t'; - } - - hex = code.toString(16).toUpperCase(); - if (json || code > 0xFF) { - return '\\u' + '0000'.slice(hex.length) + hex; - } else if (code === 0x0000 && !esutils.code.isDecimalDigit(next)) { - return '\\0'; - } else if (code === 0x000B /* \v */) { // '\v' - return '\\x0B'; - } else { - return '\\x' + '00'.slice(hex.length) + hex; - } - } - - function escapeDisallowedCharacter(code) { - if (code === 0x5C /* \ */) { - return '\\\\'; - } - - if (code === 0x0A /* \n */) { - return '\\n'; - } - - if (code === 0x0D /* \r */) { - return '\\r'; - } - - if (code === 0x2028) { - return '\\u2028'; - } - - if (code === 0x2029) { - return '\\u2029'; - } - - throw new Error('Incorrectly classified character'); - } - - function escapeDirective(str) { - var i, iz, code, quote; - - quote = quotes === 'double' ? '"' : '\''; - for (i = 0, iz = str.length; i < iz; ++i) { - code = str.charCodeAt(i); - if (code === 0x27 /* ' */) { - quote = '"'; - break; - } else if (code === 0x22 /* " */) { - quote = '\''; - break; - } else if (code === 0x5C /* \ */) { - ++i; - } - } - - return quote + str + quote; - } - - function escapeString(str) { - var result = '', i, len, code, singleQuotes = 0, doubleQuotes = 0, single, quote; - - for (i = 0, len = str.length; i < len; ++i) { - code = str.charCodeAt(i); - if (code === 0x27 /* ' */) { - ++singleQuotes; - } else if (code === 0x22 /* " */) { - ++doubleQuotes; - } else if (code === 0x2F /* / */ && json) { - result += '\\'; - } else if (esutils.code.isLineTerminator(code) || code === 0x5C /* \ */) { - result += escapeDisallowedCharacter(code); - continue; - } else if (!esutils.code.isIdentifierPartES5(code) && (json && code < 0x20 /* SP */ || !json && !escapeless && (code < 0x20 /* SP */ || code > 0x7E /* ~ */))) { - result += escapeAllowedCharacter(code, str.charCodeAt(i + 1)); - continue; - } - result += String.fromCharCode(code); - } - - single = !(quotes === 'double' || (quotes === 'auto' && doubleQuotes < singleQuotes)); - quote = single ? '\'' : '"'; - - if (!(single ? singleQuotes : doubleQuotes)) { - return quote + result + quote; - } - - str = result; - result = quote; - - for (i = 0, len = str.length; i < len; ++i) { - code = str.charCodeAt(i); - if ((code === 0x27 /* ' */ && single) || (code === 0x22 /* " */ && !single)) { - result += '\\'; - } - result += String.fromCharCode(code); - } - - return result + quote; - } - - /** - * flatten an array to a string, where the array can contain - * either strings or nested arrays - */ - function flattenToString(arr) { - var i, iz, elem, result = ''; - for (i = 0, iz = arr.length; i < iz; ++i) { - elem = arr[i]; - result += Array.isArray(elem) ? flattenToString(elem) : elem; - } - return result; - } - - /** - * convert generated to a SourceNode when source maps are enabled. - */ - function toSourceNodeWhenNeeded(generated, node) { - if (!sourceMap) { - // with no source maps, generated is either an - // array or a string. if an array, flatten it. - // if a string, just return it - if (Array.isArray(generated)) { - return flattenToString(generated); - } else { - return generated; - } - } - if (node == null) { - if (generated instanceof SourceNode) { - return generated; - } else { - node = {}; - } - } - if (node.loc == null) { - return new SourceNode(null, null, sourceMap, generated, node.name || null); - } - return new SourceNode(node.loc.start.line, node.loc.start.column, (sourceMap === true ? node.loc.source || null : sourceMap), generated, node.name || null); - } - - function noEmptySpace() { - return (space) ? space : ' '; - } - - function join(left, right) { - var leftSource, - rightSource, - leftCharCode, - rightCharCode; - - leftSource = toSourceNodeWhenNeeded(left).toString(); - if (leftSource.length === 0) { - return [right]; - } - - rightSource = toSourceNodeWhenNeeded(right).toString(); - if (rightSource.length === 0) { - return [left]; - } - - leftCharCode = leftSource.charCodeAt(leftSource.length - 1); - rightCharCode = rightSource.charCodeAt(0); - - if ((leftCharCode === 0x2B /* + */ || leftCharCode === 0x2D /* - */) && leftCharCode === rightCharCode || - esutils.code.isIdentifierPartES5(leftCharCode) && esutils.code.isIdentifierPartES5(rightCharCode) || - leftCharCode === 0x2F /* / */ && rightCharCode === 0x69 /* i */) { // infix word operators all start with `i` - return [left, noEmptySpace(), right]; - } else if (esutils.code.isWhiteSpace(leftCharCode) || esutils.code.isLineTerminator(leftCharCode) || - esutils.code.isWhiteSpace(rightCharCode) || esutils.code.isLineTerminator(rightCharCode)) { - return [left, right]; - } - return [left, space, right]; - } - - function addIndent(stmt) { - return [base, stmt]; - } - - function withIndent(fn) { - var previousBase; - previousBase = base; - base += indent; - fn(base); - base = previousBase; - } - - function calculateSpaces(str) { - var i; - for (i = str.length - 1; i >= 0; --i) { - if (esutils.code.isLineTerminator(str.charCodeAt(i))) { - break; - } - } - return (str.length - 1) - i; - } - - function adjustMultilineComment(value, specialBase) { - var array, i, len, line, j, spaces, previousBase, sn; - - array = value.split(/\r\n|[\r\n]/); - spaces = Number.MAX_VALUE; - - // first line doesn't have indentation - for (i = 1, len = array.length; i < len; ++i) { - line = array[i]; - j = 0; - while (j < line.length && esutils.code.isWhiteSpace(line.charCodeAt(j))) { - ++j; - } - if (spaces > j) { - spaces = j; - } - } - - if (typeof specialBase !== 'undefined') { - // pattern like - // { - // var t = 20; /* - // * this is comment - // */ - // } - previousBase = base; - if (array[1][spaces] === '*') { - specialBase += ' '; - } - base = specialBase; - } else { - if (spaces & 1) { - // /* - // * - // */ - // If spaces are odd number, above pattern is considered. - // We waste 1 space. - --spaces; - } - previousBase = base; - } - - for (i = 1, len = array.length; i < len; ++i) { - sn = toSourceNodeWhenNeeded(addIndent(array[i].slice(spaces))); - array[i] = sourceMap ? sn.join('') : sn; - } - - base = previousBase; - - return array.join('\n'); - } - - function generateComment(comment, specialBase) { - if (comment.type === 'Line') { - if (endsWithLineTerminator(comment.value)) { - return '//' + comment.value; - } else { - // Always use LineTerminator - var result = '//' + comment.value; - if (!preserveBlankLines) { - result += '\n'; - } - return result; - } - } - if (extra.format.indent.adjustMultilineComment && /[\n\r]/.test(comment.value)) { - return adjustMultilineComment('/*' + comment.value + '*/', specialBase); - } - return '/*' + comment.value + '*/'; - } - - function addComments(stmt, result) { - var i, len, comment, save, tailingToStatement, specialBase, fragment, - extRange, range, prevRange, prefix, infix, suffix, count; - - if (stmt.leadingComments && stmt.leadingComments.length > 0) { - save = result; - - if (preserveBlankLines) { - comment = stmt.leadingComments[0]; - result = []; - - extRange = comment.extendedRange; - range = comment.range; - - prefix = sourceCode.substring(extRange[0], range[0]); - count = (prefix.match(/\n/g) || []).length; - if (count > 0) { - result.push(stringRepeat('\n', count)); - result.push(addIndent(generateComment(comment))); - } else { - result.push(prefix); - result.push(generateComment(comment)); - } - - prevRange = range; - - for (i = 1, len = stmt.leadingComments.length; i < len; i++) { - comment = stmt.leadingComments[i]; - range = comment.range; - - infix = sourceCode.substring(prevRange[1], range[0]); - count = (infix.match(/\n/g) || []).length; - result.push(stringRepeat('\n', count)); - result.push(addIndent(generateComment(comment))); - - prevRange = range; - } - - suffix = sourceCode.substring(range[1], extRange[1]); - count = (suffix.match(/\n/g) || []).length; - result.push(stringRepeat('\n', count)); - } else { - comment = stmt.leadingComments[0]; - result = []; - if (safeConcatenation && stmt.type === Syntax.Program && stmt.body.length === 0) { - result.push('\n'); - } - result.push(generateComment(comment)); - if (!endsWithLineTerminator(toSourceNodeWhenNeeded(result).toString())) { - result.push('\n'); - } - - for (i = 1, len = stmt.leadingComments.length; i < len; ++i) { - comment = stmt.leadingComments[i]; - fragment = [generateComment(comment)]; - if (!endsWithLineTerminator(toSourceNodeWhenNeeded(fragment).toString())) { - fragment.push('\n'); - } - result.push(addIndent(fragment)); - } - } - - result.push(addIndent(save)); - } - - if (stmt.trailingComments) { - - if (preserveBlankLines) { - comment = stmt.trailingComments[0]; - extRange = comment.extendedRange; - range = comment.range; - - prefix = sourceCode.substring(extRange[0], range[0]); - count = (prefix.match(/\n/g) || []).length; - - if (count > 0) { - result.push(stringRepeat('\n', count)); - result.push(addIndent(generateComment(comment))); - } else { - result.push(prefix); - result.push(generateComment(comment)); - } - } else { - tailingToStatement = !endsWithLineTerminator(toSourceNodeWhenNeeded(result).toString()); - specialBase = stringRepeat(' ', calculateSpaces(toSourceNodeWhenNeeded([base, result, indent]).toString())); - for (i = 0, len = stmt.trailingComments.length; i < len; ++i) { - comment = stmt.trailingComments[i]; - if (tailingToStatement) { - // We assume target like following script - // - // var t = 20; /** - // * This is comment of t - // */ - if (i === 0) { - // first case - result = [result, indent]; - } else { - result = [result, specialBase]; - } - result.push(generateComment(comment, specialBase)); - } else { - result = [result, addIndent(generateComment(comment))]; - } - if (i !== len - 1 && !endsWithLineTerminator(toSourceNodeWhenNeeded(result).toString())) { - result = [result, '\n']; - } - } - } - } - - return result; - } - - function generateBlankLines(start, end, result) { - var j, newlineCount = 0; - - for (j = start; j < end; j++) { - if (sourceCode[j] === '\n') { - newlineCount++; - } - } - - for (j = 1; j < newlineCount; j++) { - result.push(newline); - } - } - - function parenthesize(text, current, should) { - if (current < should) { - return ['(', text, ')']; - } - return text; - } - - function generateVerbatimString(string) { - var i, iz, result; - result = string.split(/\r\n|\n/); - for (i = 1, iz = result.length; i < iz; i++) { - result[i] = newline + base + result[i]; - } - return result; - } - - function generateVerbatim(expr, precedence) { - var verbatim, result, prec; - verbatim = expr[extra.verbatim]; - - if (typeof verbatim === 'string') { - result = parenthesize(generateVerbatimString(verbatim), Precedence.Sequence, precedence); - } else { - // verbatim is object - result = generateVerbatimString(verbatim.content); - prec = (verbatim.precedence != null) ? verbatim.precedence : Precedence.Sequence; - result = parenthesize(result, prec, precedence); - } - - return toSourceNodeWhenNeeded(result, expr); - } - - function CodeGenerator() { - } - - // Helpers. - - CodeGenerator.prototype.maybeBlock = function(stmt, flags) { - var result, noLeadingComment, that = this; - - noLeadingComment = !extra.comment || !stmt.leadingComments; - - if (stmt.type === Syntax.BlockStatement && noLeadingComment) { - return [space, this.generateStatement(stmt, flags)]; - } - - if (stmt.type === Syntax.EmptyStatement && noLeadingComment) { - return ';'; - } - - withIndent(function () { - result = [ - newline, - addIndent(that.generateStatement(stmt, flags)) - ]; - }); - - return result; - }; - - CodeGenerator.prototype.maybeBlockSuffix = function (stmt, result) { - var ends = endsWithLineTerminator(toSourceNodeWhenNeeded(result).toString()); - if (stmt.type === Syntax.BlockStatement && (!extra.comment || !stmt.leadingComments) && !ends) { - return [result, space]; - } - if (ends) { - return [result, base]; - } - return [result, newline, base]; - }; - - function generateIdentifier(node) { - return toSourceNodeWhenNeeded(node.name, node); - } - - function generateAsyncPrefix(node, spaceRequired) { - return node.async ? 'async' + (spaceRequired ? noEmptySpace() : space) : ''; - } - - function generateStarSuffix(node) { - var isGenerator = node.generator && !extra.moz.starlessGenerator; - return isGenerator ? '*' + space : ''; - } - - function generateMethodPrefix(prop) { - var func = prop.value, prefix = ''; - if (func.async) { - prefix += generateAsyncPrefix(func, !prop.computed); - } - if (func.generator) { - // avoid space before method name - prefix += generateStarSuffix(func) ? '*' : ''; - } - return prefix; - } - - CodeGenerator.prototype.generatePattern = function (node, precedence, flags) { - if (node.type === Syntax.Identifier) { - return generateIdentifier(node); - } - return this.generateExpression(node, precedence, flags); - }; - - CodeGenerator.prototype.generateFunctionParams = function (node) { - var i, iz, result, hasDefault; - - hasDefault = false; - - if (node.type === Syntax.ArrowFunctionExpression && - !node.rest && (!node.defaults || node.defaults.length === 0) && - node.params.length === 1 && node.params[0].type === Syntax.Identifier) { - // arg => { } case - result = [generateAsyncPrefix(node, true), generateIdentifier(node.params[0])]; - } else { - result = node.type === Syntax.ArrowFunctionExpression ? [generateAsyncPrefix(node, false)] : []; - result.push('('); - if (node.defaults) { - hasDefault = true; - } - for (i = 0, iz = node.params.length; i < iz; ++i) { - if (hasDefault && node.defaults[i]) { - // Handle default values. - result.push(this.generateAssignment(node.params[i], node.defaults[i], '=', Precedence.Assignment, E_TTT)); - } else { - result.push(this.generatePattern(node.params[i], Precedence.Assignment, E_TTT)); - } - if (i + 1 < iz) { - result.push(',' + space); - } - } - - if (node.rest) { - if (node.params.length) { - result.push(',' + space); - } - result.push('...'); - result.push(generateIdentifier(node.rest)); - } - - result.push(')'); - } - - return result; - }; - - CodeGenerator.prototype.generateFunctionBody = function (node) { - var result, expr; - - result = this.generateFunctionParams(node); - - if (node.type === Syntax.ArrowFunctionExpression) { - result.push(space); - result.push('=>'); - } - - if (node.expression) { - result.push(space); - expr = this.generateExpression(node.body, Precedence.Assignment, E_TTT); - if (expr.toString().charAt(0) === '{') { - expr = ['(', expr, ')']; - } - result.push(expr); - } else { - result.push(this.maybeBlock(node.body, S_TTFF)); - } - - return result; - }; - - CodeGenerator.prototype.generateIterationForStatement = function (operator, stmt, flags) { - var result = ['for' + (stmt.await ? noEmptySpace() + 'await' : '') + space + '('], that = this; - withIndent(function () { - if (stmt.left.type === Syntax.VariableDeclaration) { - withIndent(function () { - result.push(stmt.left.kind + noEmptySpace()); - result.push(that.generateStatement(stmt.left.declarations[0], S_FFFF)); - }); - } else { - result.push(that.generateExpression(stmt.left, Precedence.Call, E_TTT)); - } - - result = join(result, operator); - result = [join( - result, - that.generateExpression(stmt.right, Precedence.Assignment, E_TTT) - ), ')']; - }); - result.push(this.maybeBlock(stmt.body, flags)); - return result; - }; - - CodeGenerator.prototype.generatePropertyKey = function (expr, computed) { - var result = []; - - if (computed) { - result.push('['); - } - - result.push(this.generateExpression(expr, Precedence.Assignment, E_TTT)); - - if (computed) { - result.push(']'); - } - - return result; - }; - - CodeGenerator.prototype.generateAssignment = function (left, right, operator, precedence, flags) { - if (Precedence.Assignment < precedence) { - flags |= F_ALLOW_IN; - } - - return parenthesize( - [ - this.generateExpression(left, Precedence.Call, flags), - space + operator + space, - this.generateExpression(right, Precedence.Assignment, flags) - ], - Precedence.Assignment, - precedence - ); - }; - - CodeGenerator.prototype.semicolon = function (flags) { - if (!semicolons && flags & F_SEMICOLON_OPT) { - return ''; - } - return ';'; - }; - - // Statements. - - CodeGenerator.Statement = { - - BlockStatement: function (stmt, flags) { - var range, content, result = ['{', newline], that = this; - - withIndent(function () { - // handle functions without any code - if (stmt.body.length === 0 && preserveBlankLines) { - range = stmt.range; - if (range[1] - range[0] > 2) { - content = sourceCode.substring(range[0] + 1, range[1] - 1); - if (content[0] === '\n') { - result = ['{']; - } - result.push(content); - } - } - - var i, iz, fragment, bodyFlags; - bodyFlags = S_TFFF; - if (flags & F_FUNC_BODY) { - bodyFlags |= F_DIRECTIVE_CTX; - } - - for (i = 0, iz = stmt.body.length; i < iz; ++i) { - if (preserveBlankLines) { - // handle spaces before the first line - if (i === 0) { - if (stmt.body[0].leadingComments) { - range = stmt.body[0].leadingComments[0].extendedRange; - content = sourceCode.substring(range[0], range[1]); - if (content[0] === '\n') { - result = ['{']; - } - } - if (!stmt.body[0].leadingComments) { - generateBlankLines(stmt.range[0], stmt.body[0].range[0], result); - } - } - - // handle spaces between lines - if (i > 0) { - if (!stmt.body[i - 1].trailingComments && !stmt.body[i].leadingComments) { - generateBlankLines(stmt.body[i - 1].range[1], stmt.body[i].range[0], result); - } - } - } - - if (i === iz - 1) { - bodyFlags |= F_SEMICOLON_OPT; - } - - if (stmt.body[i].leadingComments && preserveBlankLines) { - fragment = that.generateStatement(stmt.body[i], bodyFlags); - } else { - fragment = addIndent(that.generateStatement(stmt.body[i], bodyFlags)); - } - - result.push(fragment); - if (!endsWithLineTerminator(toSourceNodeWhenNeeded(fragment).toString())) { - if (preserveBlankLines && i < iz - 1) { - // don't add a new line if there are leading coments - // in the next statement - if (!stmt.body[i + 1].leadingComments) { - result.push(newline); - } - } else { - result.push(newline); - } - } - - if (preserveBlankLines) { - // handle spaces after the last line - if (i === iz - 1) { - if (!stmt.body[i].trailingComments) { - generateBlankLines(stmt.body[i].range[1], stmt.range[1], result); - } - } - } - } - }); - - result.push(addIndent('}')); - return result; - }, - - BreakStatement: function (stmt, flags) { - if (stmt.label) { - return 'break ' + stmt.label.name + this.semicolon(flags); - } - return 'break' + this.semicolon(flags); - }, - - ContinueStatement: function (stmt, flags) { - if (stmt.label) { - return 'continue ' + stmt.label.name + this.semicolon(flags); - } - return 'continue' + this.semicolon(flags); - }, - - ClassBody: function (stmt, flags) { - var result = [ '{', newline], that = this; - - withIndent(function (indent) { - var i, iz; - - for (i = 0, iz = stmt.body.length; i < iz; ++i) { - result.push(indent); - result.push(that.generateExpression(stmt.body[i], Precedence.Sequence, E_TTT)); - if (i + 1 < iz) { - result.push(newline); - } - } - }); - - if (!endsWithLineTerminator(toSourceNodeWhenNeeded(result).toString())) { - result.push(newline); - } - result.push(base); - result.push('}'); - return result; - }, - - ClassDeclaration: function (stmt, flags) { - var result, fragment; - result = ['class']; - if (stmt.id) { - result = join(result, this.generateExpression(stmt.id, Precedence.Sequence, E_TTT)); - } - if (stmt.superClass) { - fragment = join('extends', this.generateExpression(stmt.superClass, Precedence.Unary, E_TTT)); - result = join(result, fragment); - } - result.push(space); - result.push(this.generateStatement(stmt.body, S_TFFT)); - return result; - }, - - DirectiveStatement: function (stmt, flags) { - if (extra.raw && stmt.raw) { - return stmt.raw + this.semicolon(flags); - } - return escapeDirective(stmt.directive) + this.semicolon(flags); - }, - - DoWhileStatement: function (stmt, flags) { - // Because `do 42 while (cond)` is Syntax Error. We need semicolon. - var result = join('do', this.maybeBlock(stmt.body, S_TFFF)); - result = this.maybeBlockSuffix(stmt.body, result); - return join(result, [ - 'while' + space + '(', - this.generateExpression(stmt.test, Precedence.Sequence, E_TTT), - ')' + this.semicolon(flags) - ]); - }, - - CatchClause: function (stmt, flags) { - var result, that = this; - withIndent(function () { - var guard; - - if (stmt.param) { - result = [ - 'catch' + space + '(', - that.generateExpression(stmt.param, Precedence.Sequence, E_TTT), - ')' - ]; - - if (stmt.guard) { - guard = that.generateExpression(stmt.guard, Precedence.Sequence, E_TTT); - result.splice(2, 0, ' if ', guard); - } - } else { - result = ['catch']; - } - }); - result.push(this.maybeBlock(stmt.body, S_TFFF)); - return result; - }, - - DebuggerStatement: function (stmt, flags) { - return 'debugger' + this.semicolon(flags); - }, - - EmptyStatement: function (stmt, flags) { - return ';'; - }, - - ExportDefaultDeclaration: function (stmt, flags) { - var result = [ 'export' ], bodyFlags; - - bodyFlags = (flags & F_SEMICOLON_OPT) ? S_TFFT : S_TFFF; - - // export default HoistableDeclaration[Default] - // export default AssignmentExpression[In] ; - result = join(result, 'default'); - if (isStatement(stmt.declaration)) { - result = join(result, this.generateStatement(stmt.declaration, bodyFlags)); - } else { - result = join(result, this.generateExpression(stmt.declaration, Precedence.Assignment, E_TTT) + this.semicolon(flags)); - } - return result; - }, - - ExportNamedDeclaration: function (stmt, flags) { - var result = [ 'export' ], bodyFlags, that = this; - - bodyFlags = (flags & F_SEMICOLON_OPT) ? S_TFFT : S_TFFF; - - // export VariableStatement - // export Declaration[Default] - if (stmt.declaration) { - return join(result, this.generateStatement(stmt.declaration, bodyFlags)); - } - - // export ExportClause[NoReference] FromClause ; - // export ExportClause ; - if (stmt.specifiers) { - if (stmt.specifiers.length === 0) { - result = join(result, '{' + space + '}'); - } else if (stmt.specifiers[0].type === Syntax.ExportBatchSpecifier) { - result = join(result, this.generateExpression(stmt.specifiers[0], Precedence.Sequence, E_TTT)); - } else { - result = join(result, '{'); - withIndent(function (indent) { - var i, iz; - result.push(newline); - for (i = 0, iz = stmt.specifiers.length; i < iz; ++i) { - result.push(indent); - result.push(that.generateExpression(stmt.specifiers[i], Precedence.Sequence, E_TTT)); - if (i + 1 < iz) { - result.push(',' + newline); - } - } - }); - if (!endsWithLineTerminator(toSourceNodeWhenNeeded(result).toString())) { - result.push(newline); - } - result.push(base + '}'); - } - - if (stmt.source) { - result = join(result, [ - 'from' + space, - // ModuleSpecifier - this.generateExpression(stmt.source, Precedence.Sequence, E_TTT), - this.semicolon(flags) - ]); - } else { - result.push(this.semicolon(flags)); - } - } - return result; - }, - - ExportAllDeclaration: function (stmt, flags) { - // export * FromClause ; - return [ - 'export' + space, - '*' + space, - 'from' + space, - // ModuleSpecifier - this.generateExpression(stmt.source, Precedence.Sequence, E_TTT), - this.semicolon(flags) - ]; - }, - - ExpressionStatement: function (stmt, flags) { - var result, fragment; - - function isClassPrefixed(fragment) { - var code; - if (fragment.slice(0, 5) !== 'class') { - return false; - } - code = fragment.charCodeAt(5); - return code === 0x7B /* '{' */ || esutils.code.isWhiteSpace(code) || esutils.code.isLineTerminator(code); - } - - function isFunctionPrefixed(fragment) { - var code; - if (fragment.slice(0, 8) !== 'function') { - return false; - } - code = fragment.charCodeAt(8); - return code === 0x28 /* '(' */ || esutils.code.isWhiteSpace(code) || code === 0x2A /* '*' */ || esutils.code.isLineTerminator(code); - } - - function isAsyncPrefixed(fragment) { - var code, i, iz; - if (fragment.slice(0, 5) !== 'async') { - return false; - } - if (!esutils.code.isWhiteSpace(fragment.charCodeAt(5))) { - return false; - } - for (i = 6, iz = fragment.length; i < iz; ++i) { - if (!esutils.code.isWhiteSpace(fragment.charCodeAt(i))) { - break; - } - } - if (i === iz) { - return false; - } - if (fragment.slice(i, i + 8) !== 'function') { - return false; - } - code = fragment.charCodeAt(i + 8); - return code === 0x28 /* '(' */ || esutils.code.isWhiteSpace(code) || code === 0x2A /* '*' */ || esutils.code.isLineTerminator(code); - } - - result = [this.generateExpression(stmt.expression, Precedence.Sequence, E_TTT)]; - // 12.4 '{', 'function', 'class' is not allowed in this position. - // wrap expression with parentheses - fragment = toSourceNodeWhenNeeded(result).toString(); - if (fragment.charCodeAt(0) === 0x7B /* '{' */ || // ObjectExpression - isClassPrefixed(fragment) || - isFunctionPrefixed(fragment) || - isAsyncPrefixed(fragment) || - (directive && (flags & F_DIRECTIVE_CTX) && stmt.expression.type === Syntax.Literal && typeof stmt.expression.value === 'string')) { - result = ['(', result, ')' + this.semicolon(flags)]; - } else { - result.push(this.semicolon(flags)); - } - return result; - }, - - ImportDeclaration: function (stmt, flags) { - // ES6: 15.2.1 valid import declarations: - // - import ImportClause FromClause ; - // - import ModuleSpecifier ; - var result, cursor, that = this; - - // If no ImportClause is present, - // this should be `import ModuleSpecifier` so skip `from` - // ModuleSpecifier is StringLiteral. - if (stmt.specifiers.length === 0) { - // import ModuleSpecifier ; - return [ - 'import', - space, - // ModuleSpecifier - this.generateExpression(stmt.source, Precedence.Sequence, E_TTT), - this.semicolon(flags) - ]; - } - - // import ImportClause FromClause ; - result = [ - 'import' - ]; - cursor = 0; - - // ImportedBinding - if (stmt.specifiers[cursor].type === Syntax.ImportDefaultSpecifier) { - result = join(result, [ - this.generateExpression(stmt.specifiers[cursor], Precedence.Sequence, E_TTT) - ]); - ++cursor; - } - - if (stmt.specifiers[cursor]) { - if (cursor !== 0) { - result.push(','); - } - - if (stmt.specifiers[cursor].type === Syntax.ImportNamespaceSpecifier) { - // NameSpaceImport - result = join(result, [ - space, - this.generateExpression(stmt.specifiers[cursor], Precedence.Sequence, E_TTT) - ]); - } else { - // NamedImports - result.push(space + '{'); - - if ((stmt.specifiers.length - cursor) === 1) { - // import { ... } from "..."; - result.push(space); - result.push(this.generateExpression(stmt.specifiers[cursor], Precedence.Sequence, E_TTT)); - result.push(space + '}' + space); - } else { - // import { - // ..., - // ..., - // } from "..."; - withIndent(function (indent) { - var i, iz; - result.push(newline); - for (i = cursor, iz = stmt.specifiers.length; i < iz; ++i) { - result.push(indent); - result.push(that.generateExpression(stmt.specifiers[i], Precedence.Sequence, E_TTT)); - if (i + 1 < iz) { - result.push(',' + newline); - } - } - }); - if (!endsWithLineTerminator(toSourceNodeWhenNeeded(result).toString())) { - result.push(newline); - } - result.push(base + '}' + space); - } - } - } - - result = join(result, [ - 'from' + space, - // ModuleSpecifier - this.generateExpression(stmt.source, Precedence.Sequence, E_TTT), - this.semicolon(flags) - ]); - return result; - }, - - VariableDeclarator: function (stmt, flags) { - var itemFlags = (flags & F_ALLOW_IN) ? E_TTT : E_FTT; - if (stmt.init) { - return [ - this.generateExpression(stmt.id, Precedence.Assignment, itemFlags), - space, - '=', - space, - this.generateExpression(stmt.init, Precedence.Assignment, itemFlags) - ]; - } - return this.generatePattern(stmt.id, Precedence.Assignment, itemFlags); - }, - - VariableDeclaration: function (stmt, flags) { - // VariableDeclarator is typed as Statement, - // but joined with comma (not LineTerminator). - // So if comment is attached to target node, we should specialize. - var result, i, iz, node, bodyFlags, that = this; - - result = [ stmt.kind ]; - - bodyFlags = (flags & F_ALLOW_IN) ? S_TFFF : S_FFFF; - - function block() { - node = stmt.declarations[0]; - if (extra.comment && node.leadingComments) { - result.push('\n'); - result.push(addIndent(that.generateStatement(node, bodyFlags))); - } else { - result.push(noEmptySpace()); - result.push(that.generateStatement(node, bodyFlags)); - } - - for (i = 1, iz = stmt.declarations.length; i < iz; ++i) { - node = stmt.declarations[i]; - if (extra.comment && node.leadingComments) { - result.push(',' + newline); - result.push(addIndent(that.generateStatement(node, bodyFlags))); - } else { - result.push(',' + space); - result.push(that.generateStatement(node, bodyFlags)); - } - } - } - - if (stmt.declarations.length > 1) { - withIndent(block); - } else { - block(); - } - - result.push(this.semicolon(flags)); - - return result; - }, - - ThrowStatement: function (stmt, flags) { - return [join( - 'throw', - this.generateExpression(stmt.argument, Precedence.Sequence, E_TTT) - ), this.semicolon(flags)]; - }, - - TryStatement: function (stmt, flags) { - var result, i, iz, guardedHandlers; - - result = ['try', this.maybeBlock(stmt.block, S_TFFF)]; - result = this.maybeBlockSuffix(stmt.block, result); - - if (stmt.handlers) { - // old interface - for (i = 0, iz = stmt.handlers.length; i < iz; ++i) { - result = join(result, this.generateStatement(stmt.handlers[i], S_TFFF)); - if (stmt.finalizer || i + 1 !== iz) { - result = this.maybeBlockSuffix(stmt.handlers[i].body, result); - } - } - } else { - guardedHandlers = stmt.guardedHandlers || []; - - for (i = 0, iz = guardedHandlers.length; i < iz; ++i) { - result = join(result, this.generateStatement(guardedHandlers[i], S_TFFF)); - if (stmt.finalizer || i + 1 !== iz) { - result = this.maybeBlockSuffix(guardedHandlers[i].body, result); - } - } - - // new interface - if (stmt.handler) { - if (Array.isArray(stmt.handler)) { - for (i = 0, iz = stmt.handler.length; i < iz; ++i) { - result = join(result, this.generateStatement(stmt.handler[i], S_TFFF)); - if (stmt.finalizer || i + 1 !== iz) { - result = this.maybeBlockSuffix(stmt.handler[i].body, result); - } - } - } else { - result = join(result, this.generateStatement(stmt.handler, S_TFFF)); - if (stmt.finalizer) { - result = this.maybeBlockSuffix(stmt.handler.body, result); - } - } - } - } - if (stmt.finalizer) { - result = join(result, ['finally', this.maybeBlock(stmt.finalizer, S_TFFF)]); - } - return result; - }, - - SwitchStatement: function (stmt, flags) { - var result, fragment, i, iz, bodyFlags, that = this; - withIndent(function () { - result = [ - 'switch' + space + '(', - that.generateExpression(stmt.discriminant, Precedence.Sequence, E_TTT), - ')' + space + '{' + newline - ]; - }); - if (stmt.cases) { - bodyFlags = S_TFFF; - for (i = 0, iz = stmt.cases.length; i < iz; ++i) { - if (i === iz - 1) { - bodyFlags |= F_SEMICOLON_OPT; - } - fragment = addIndent(this.generateStatement(stmt.cases[i], bodyFlags)); - result.push(fragment); - if (!endsWithLineTerminator(toSourceNodeWhenNeeded(fragment).toString())) { - result.push(newline); - } - } - } - result.push(addIndent('}')); - return result; - }, - - SwitchCase: function (stmt, flags) { - var result, fragment, i, iz, bodyFlags, that = this; - withIndent(function () { - if (stmt.test) { - result = [ - join('case', that.generateExpression(stmt.test, Precedence.Sequence, E_TTT)), - ':' - ]; - } else { - result = ['default:']; - } - - i = 0; - iz = stmt.consequent.length; - if (iz && stmt.consequent[0].type === Syntax.BlockStatement) { - fragment = that.maybeBlock(stmt.consequent[0], S_TFFF); - result.push(fragment); - i = 1; - } - - if (i !== iz && !endsWithLineTerminator(toSourceNodeWhenNeeded(result).toString())) { - result.push(newline); - } - - bodyFlags = S_TFFF; - for (; i < iz; ++i) { - if (i === iz - 1 && flags & F_SEMICOLON_OPT) { - bodyFlags |= F_SEMICOLON_OPT; - } - fragment = addIndent(that.generateStatement(stmt.consequent[i], bodyFlags)); - result.push(fragment); - if (i + 1 !== iz && !endsWithLineTerminator(toSourceNodeWhenNeeded(fragment).toString())) { - result.push(newline); - } - } - }); - return result; - }, - - IfStatement: function (stmt, flags) { - var result, bodyFlags, semicolonOptional, that = this; - withIndent(function () { - result = [ - 'if' + space + '(', - that.generateExpression(stmt.test, Precedence.Sequence, E_TTT), - ')' - ]; - }); - semicolonOptional = flags & F_SEMICOLON_OPT; - bodyFlags = S_TFFF; - if (semicolonOptional) { - bodyFlags |= F_SEMICOLON_OPT; - } - if (stmt.alternate) { - result.push(this.maybeBlock(stmt.consequent, S_TFFF)); - result = this.maybeBlockSuffix(stmt.consequent, result); - if (stmt.alternate.type === Syntax.IfStatement) { - result = join(result, ['else ', this.generateStatement(stmt.alternate, bodyFlags)]); - } else { - result = join(result, join('else', this.maybeBlock(stmt.alternate, bodyFlags))); - } - } else { - result.push(this.maybeBlock(stmt.consequent, bodyFlags)); - } - return result; - }, - - ForStatement: function (stmt, flags) { - var result, that = this; - withIndent(function () { - result = ['for' + space + '(']; - if (stmt.init) { - if (stmt.init.type === Syntax.VariableDeclaration) { - result.push(that.generateStatement(stmt.init, S_FFFF)); - } else { - // F_ALLOW_IN becomes false. - result.push(that.generateExpression(stmt.init, Precedence.Sequence, E_FTT)); - result.push(';'); - } - } else { - result.push(';'); - } - - if (stmt.test) { - result.push(space); - result.push(that.generateExpression(stmt.test, Precedence.Sequence, E_TTT)); - result.push(';'); - } else { - result.push(';'); - } - - if (stmt.update) { - result.push(space); - result.push(that.generateExpression(stmt.update, Precedence.Sequence, E_TTT)); - result.push(')'); - } else { - result.push(')'); - } - }); - - result.push(this.maybeBlock(stmt.body, flags & F_SEMICOLON_OPT ? S_TFFT : S_TFFF)); - return result; - }, - - ForInStatement: function (stmt, flags) { - return this.generateIterationForStatement('in', stmt, flags & F_SEMICOLON_OPT ? S_TFFT : S_TFFF); - }, - - ForOfStatement: function (stmt, flags) { - return this.generateIterationForStatement('of', stmt, flags & F_SEMICOLON_OPT ? S_TFFT : S_TFFF); - }, - - LabeledStatement: function (stmt, flags) { - return [stmt.label.name + ':', this.maybeBlock(stmt.body, flags & F_SEMICOLON_OPT ? S_TFFT : S_TFFF)]; - }, - - Program: function (stmt, flags) { - var result, fragment, i, iz, bodyFlags; - iz = stmt.body.length; - result = [safeConcatenation && iz > 0 ? '\n' : '']; - bodyFlags = S_TFTF; - for (i = 0; i < iz; ++i) { - if (!safeConcatenation && i === iz - 1) { - bodyFlags |= F_SEMICOLON_OPT; - } - - if (preserveBlankLines) { - // handle spaces before the first line - if (i === 0) { - if (!stmt.body[0].leadingComments) { - generateBlankLines(stmt.range[0], stmt.body[i].range[0], result); - } - } - - // handle spaces between lines - if (i > 0) { - if (!stmt.body[i - 1].trailingComments && !stmt.body[i].leadingComments) { - generateBlankLines(stmt.body[i - 1].range[1], stmt.body[i].range[0], result); - } - } - } - - fragment = addIndent(this.generateStatement(stmt.body[i], bodyFlags)); - result.push(fragment); - if (i + 1 < iz && !endsWithLineTerminator(toSourceNodeWhenNeeded(fragment).toString())) { - if (preserveBlankLines) { - if (!stmt.body[i + 1].leadingComments) { - result.push(newline); - } - } else { - result.push(newline); - } - } - - if (preserveBlankLines) { - // handle spaces after the last line - if (i === iz - 1) { - if (!stmt.body[i].trailingComments) { - generateBlankLines(stmt.body[i].range[1], stmt.range[1], result); - } - } - } - } - return result; - }, - - FunctionDeclaration: function (stmt, flags) { - return [ - generateAsyncPrefix(stmt, true), - 'function', - generateStarSuffix(stmt) || noEmptySpace(), - stmt.id ? generateIdentifier(stmt.id) : '', - this.generateFunctionBody(stmt) - ]; - }, - - ReturnStatement: function (stmt, flags) { - if (stmt.argument) { - return [join( - 'return', - this.generateExpression(stmt.argument, Precedence.Sequence, E_TTT) - ), this.semicolon(flags)]; - } - return ['return' + this.semicolon(flags)]; - }, - - WhileStatement: function (stmt, flags) { - var result, that = this; - withIndent(function () { - result = [ - 'while' + space + '(', - that.generateExpression(stmt.test, Precedence.Sequence, E_TTT), - ')' - ]; - }); - result.push(this.maybeBlock(stmt.body, flags & F_SEMICOLON_OPT ? S_TFFT : S_TFFF)); - return result; - }, - - WithStatement: function (stmt, flags) { - var result, that = this; - withIndent(function () { - result = [ - 'with' + space + '(', - that.generateExpression(stmt.object, Precedence.Sequence, E_TTT), - ')' - ]; - }); - result.push(this.maybeBlock(stmt.body, flags & F_SEMICOLON_OPT ? S_TFFT : S_TFFF)); - return result; - } - - }; - - merge(CodeGenerator.prototype, CodeGenerator.Statement); - - // Expressions. - - CodeGenerator.Expression = { - - SequenceExpression: function (expr, precedence, flags) { - var result, i, iz; - if (Precedence.Sequence < precedence) { - flags |= F_ALLOW_IN; - } - result = []; - for (i = 0, iz = expr.expressions.length; i < iz; ++i) { - result.push(this.generateExpression(expr.expressions[i], Precedence.Assignment, flags)); - if (i + 1 < iz) { - result.push(',' + space); - } - } - return parenthesize(result, Precedence.Sequence, precedence); - }, - - AssignmentExpression: function (expr, precedence, flags) { - return this.generateAssignment(expr.left, expr.right, expr.operator, precedence, flags); - }, - - ArrowFunctionExpression: function (expr, precedence, flags) { - return parenthesize(this.generateFunctionBody(expr), Precedence.ArrowFunction, precedence); - }, - - ConditionalExpression: function (expr, precedence, flags) { - if (Precedence.Conditional < precedence) { - flags |= F_ALLOW_IN; - } - return parenthesize( - [ - this.generateExpression(expr.test, Precedence.LogicalOR, flags), - space + '?' + space, - this.generateExpression(expr.consequent, Precedence.Assignment, flags), - space + ':' + space, - this.generateExpression(expr.alternate, Precedence.Assignment, flags) - ], - Precedence.Conditional, - precedence - ); - }, - - LogicalExpression: function (expr, precedence, flags) { - return this.BinaryExpression(expr, precedence, flags); - }, - - BinaryExpression: function (expr, precedence, flags) { - var result, leftPrecedence, rightPrecedence, currentPrecedence, fragment, leftSource; - currentPrecedence = BinaryPrecedence[expr.operator]; - leftPrecedence = expr.operator === '**' ? Precedence.Postfix : currentPrecedence; - rightPrecedence = expr.operator === '**' ? currentPrecedence : currentPrecedence + 1; - - if (currentPrecedence < precedence) { - flags |= F_ALLOW_IN; - } - - fragment = this.generateExpression(expr.left, leftPrecedence, flags); - - leftSource = fragment.toString(); - - if (leftSource.charCodeAt(leftSource.length - 1) === 0x2F /* / */ && esutils.code.isIdentifierPartES5(expr.operator.charCodeAt(0))) { - result = [fragment, noEmptySpace(), expr.operator]; - } else { - result = join(fragment, expr.operator); - } - - fragment = this.generateExpression(expr.right, rightPrecedence, flags); - - if (expr.operator === '/' && fragment.toString().charAt(0) === '/' || - expr.operator.slice(-1) === '<' && fragment.toString().slice(0, 3) === '!--') { - // If '/' concats with '/' or `<` concats with `!--`, it is interpreted as comment start - result.push(noEmptySpace()); - result.push(fragment); - } else { - result = join(result, fragment); - } - - if (expr.operator === 'in' && !(flags & F_ALLOW_IN)) { - return ['(', result, ')']; - } - return parenthesize(result, currentPrecedence, precedence); - }, - - CallExpression: function (expr, precedence, flags) { - var result, i, iz; - // F_ALLOW_UNPARATH_NEW becomes false. - result = [this.generateExpression(expr.callee, Precedence.Call, E_TTF)]; - result.push('('); - for (i = 0, iz = expr['arguments'].length; i < iz; ++i) { - result.push(this.generateExpression(expr['arguments'][i], Precedence.Assignment, E_TTT)); - if (i + 1 < iz) { - result.push(',' + space); - } - } - result.push(')'); - - if (!(flags & F_ALLOW_CALL)) { - return ['(', result, ')']; - } - return parenthesize(result, Precedence.Call, precedence); - }, - - NewExpression: function (expr, precedence, flags) { - var result, length, i, iz, itemFlags; - length = expr['arguments'].length; - - // F_ALLOW_CALL becomes false. - // F_ALLOW_UNPARATH_NEW may become false. - itemFlags = (flags & F_ALLOW_UNPARATH_NEW && !parentheses && length === 0) ? E_TFT : E_TFF; - - result = join( - 'new', - this.generateExpression(expr.callee, Precedence.New, itemFlags) - ); - - if (!(flags & F_ALLOW_UNPARATH_NEW) || parentheses || length > 0) { - result.push('('); - for (i = 0, iz = length; i < iz; ++i) { - result.push(this.generateExpression(expr['arguments'][i], Precedence.Assignment, E_TTT)); - if (i + 1 < iz) { - result.push(',' + space); - } - } - result.push(')'); - } - - return parenthesize(result, Precedence.New, precedence); - }, - - MemberExpression: function (expr, precedence, flags) { - var result, fragment; - - // F_ALLOW_UNPARATH_NEW becomes false. - result = [this.generateExpression(expr.object, Precedence.Call, (flags & F_ALLOW_CALL) ? E_TTF : E_TFF)]; - - if (expr.computed) { - result.push('['); - result.push(this.generateExpression(expr.property, Precedence.Sequence, flags & F_ALLOW_CALL ? E_TTT : E_TFT)); - result.push(']'); - } else { - if (expr.object.type === Syntax.Literal && typeof expr.object.value === 'number') { - fragment = toSourceNodeWhenNeeded(result).toString(); - // When the following conditions are all true, - // 1. No floating point - // 2. Don't have exponents - // 3. The last character is a decimal digit - // 4. Not hexadecimal OR octal number literal - // we should add a floating point. - if ( - fragment.indexOf('.') < 0 && - !/[eExX]/.test(fragment) && - esutils.code.isDecimalDigit(fragment.charCodeAt(fragment.length - 1)) && - !(fragment.length >= 2 && fragment.charCodeAt(0) === 48) // '0' - ) { - result.push(' '); - } - } - result.push('.'); - result.push(generateIdentifier(expr.property)); - } - - return parenthesize(result, Precedence.Member, precedence); - }, - - MetaProperty: function (expr, precedence, flags) { - var result; - result = []; - result.push(typeof expr.meta === "string" ? expr.meta : generateIdentifier(expr.meta)); - result.push('.'); - result.push(typeof expr.property === "string" ? expr.property : generateIdentifier(expr.property)); - return parenthesize(result, Precedence.Member, precedence); - }, - - UnaryExpression: function (expr, precedence, flags) { - var result, fragment, rightCharCode, leftSource, leftCharCode; - fragment = this.generateExpression(expr.argument, Precedence.Unary, E_TTT); - - if (space === '') { - result = join(expr.operator, fragment); - } else { - result = [expr.operator]; - if (expr.operator.length > 2) { - // delete, void, typeof - // get `typeof []`, not `typeof[]` - result = join(result, fragment); - } else { - // Prevent inserting spaces between operator and argument if it is unnecessary - // like, `!cond` - leftSource = toSourceNodeWhenNeeded(result).toString(); - leftCharCode = leftSource.charCodeAt(leftSource.length - 1); - rightCharCode = fragment.toString().charCodeAt(0); - - if (((leftCharCode === 0x2B /* + */ || leftCharCode === 0x2D /* - */) && leftCharCode === rightCharCode) || - (esutils.code.isIdentifierPartES5(leftCharCode) && esutils.code.isIdentifierPartES5(rightCharCode))) { - result.push(noEmptySpace()); - result.push(fragment); - } else { - result.push(fragment); - } - } - } - return parenthesize(result, Precedence.Unary, precedence); - }, - - YieldExpression: function (expr, precedence, flags) { - var result; - if (expr.delegate) { - result = 'yield*'; - } else { - result = 'yield'; - } - if (expr.argument) { - result = join( - result, - this.generateExpression(expr.argument, Precedence.Yield, E_TTT) - ); - } - return parenthesize(result, Precedence.Yield, precedence); - }, - - AwaitExpression: function (expr, precedence, flags) { - var result = join( - expr.all ? 'await*' : 'await', - this.generateExpression(expr.argument, Precedence.Await, E_TTT) - ); - return parenthesize(result, Precedence.Await, precedence); - }, - - UpdateExpression: function (expr, precedence, flags) { - if (expr.prefix) { - return parenthesize( - [ - expr.operator, - this.generateExpression(expr.argument, Precedence.Unary, E_TTT) - ], - Precedence.Unary, - precedence - ); - } - return parenthesize( - [ - this.generateExpression(expr.argument, Precedence.Postfix, E_TTT), - expr.operator - ], - Precedence.Postfix, - precedence - ); - }, - - FunctionExpression: function (expr, precedence, flags) { - var result = [ - generateAsyncPrefix(expr, true), - 'function' - ]; - if (expr.id) { - result.push(generateStarSuffix(expr) || noEmptySpace()); - result.push(generateIdentifier(expr.id)); - } else { - result.push(generateStarSuffix(expr) || space); - } - result.push(this.generateFunctionBody(expr)); - return result; - }, - - ArrayPattern: function (expr, precedence, flags) { - return this.ArrayExpression(expr, precedence, flags, true); - }, - - ArrayExpression: function (expr, precedence, flags, isPattern) { - var result, multiline, that = this; - if (!expr.elements.length) { - return '[]'; - } - multiline = isPattern ? false : expr.elements.length > 1; - result = ['[', multiline ? newline : '']; - withIndent(function (indent) { - var i, iz; - for (i = 0, iz = expr.elements.length; i < iz; ++i) { - if (!expr.elements[i]) { - if (multiline) { - result.push(indent); - } - if (i + 1 === iz) { - result.push(','); - } - } else { - result.push(multiline ? indent : ''); - result.push(that.generateExpression(expr.elements[i], Precedence.Assignment, E_TTT)); - } - if (i + 1 < iz) { - result.push(',' + (multiline ? newline : space)); - } - } - }); - if (multiline && !endsWithLineTerminator(toSourceNodeWhenNeeded(result).toString())) { - result.push(newline); - } - result.push(multiline ? base : ''); - result.push(']'); - return result; - }, - - RestElement: function(expr, precedence, flags) { - return '...' + this.generatePattern(expr.argument); - }, - - ClassExpression: function (expr, precedence, flags) { - var result, fragment; - result = ['class']; - if (expr.id) { - result = join(result, this.generateExpression(expr.id, Precedence.Sequence, E_TTT)); - } - if (expr.superClass) { - fragment = join('extends', this.generateExpression(expr.superClass, Precedence.Unary, E_TTT)); - result = join(result, fragment); - } - result.push(space); - result.push(this.generateStatement(expr.body, S_TFFT)); - return result; - }, - - MethodDefinition: function (expr, precedence, flags) { - var result, fragment; - if (expr['static']) { - result = ['static' + space]; - } else { - result = []; - } - if (expr.kind === 'get' || expr.kind === 'set') { - fragment = [ - join(expr.kind, this.generatePropertyKey(expr.key, expr.computed)), - this.generateFunctionBody(expr.value) - ]; - } else { - fragment = [ - generateMethodPrefix(expr), - this.generatePropertyKey(expr.key, expr.computed), - this.generateFunctionBody(expr.value) - ]; - } - return join(result, fragment); - }, - - Property: function (expr, precedence, flags) { - if (expr.kind === 'get' || expr.kind === 'set') { - return [ - expr.kind, noEmptySpace(), - this.generatePropertyKey(expr.key, expr.computed), - this.generateFunctionBody(expr.value) - ]; - } - - if (expr.shorthand) { - if (expr.value.type === "AssignmentPattern") { - return this.AssignmentPattern(expr.value, Precedence.Sequence, E_TTT); - } - return this.generatePropertyKey(expr.key, expr.computed); - } - - if (expr.method) { - return [ - generateMethodPrefix(expr), - this.generatePropertyKey(expr.key, expr.computed), - this.generateFunctionBody(expr.value) - ]; - } - - return [ - this.generatePropertyKey(expr.key, expr.computed), - ':' + space, - this.generateExpression(expr.value, Precedence.Assignment, E_TTT) - ]; - }, - - ObjectExpression: function (expr, precedence, flags) { - var multiline, result, fragment, that = this; - - if (!expr.properties.length) { - return '{}'; - } - multiline = expr.properties.length > 1; - - withIndent(function () { - fragment = that.generateExpression(expr.properties[0], Precedence.Sequence, E_TTT); - }); - - if (!multiline) { - // issues 4 - // Do not transform from - // dejavu.Class.declare({ - // method2: function () {} - // }); - // to - // dejavu.Class.declare({method2: function () { - // }}); - if (!hasLineTerminator(toSourceNodeWhenNeeded(fragment).toString())) { - return [ '{', space, fragment, space, '}' ]; - } - } - - withIndent(function (indent) { - var i, iz; - result = [ '{', newline, indent, fragment ]; - - if (multiline) { - result.push(',' + newline); - for (i = 1, iz = expr.properties.length; i < iz; ++i) { - result.push(indent); - result.push(that.generateExpression(expr.properties[i], Precedence.Sequence, E_TTT)); - if (i + 1 < iz) { - result.push(',' + newline); - } - } - } - }); - - if (!endsWithLineTerminator(toSourceNodeWhenNeeded(result).toString())) { - result.push(newline); - } - result.push(base); - result.push('}'); - return result; - }, - - AssignmentPattern: function(expr, precedence, flags) { - return this.generateAssignment(expr.left, expr.right, '=', precedence, flags); - }, - - ObjectPattern: function (expr, precedence, flags) { - var result, i, iz, multiline, property, that = this; - if (!expr.properties.length) { - return '{}'; - } - - multiline = false; - if (expr.properties.length === 1) { - property = expr.properties[0]; - if ( - property.type === Syntax.Property - && property.value.type !== Syntax.Identifier - ) { - multiline = true; - } - } else { - for (i = 0, iz = expr.properties.length; i < iz; ++i) { - property = expr.properties[i]; - if ( - property.type === Syntax.Property - && !property.shorthand - ) { - multiline = true; - break; - } - } - } - result = ['{', multiline ? newline : '' ]; - - withIndent(function (indent) { - var i, iz; - for (i = 0, iz = expr.properties.length; i < iz; ++i) { - result.push(multiline ? indent : ''); - result.push(that.generateExpression(expr.properties[i], Precedence.Sequence, E_TTT)); - if (i + 1 < iz) { - result.push(',' + (multiline ? newline : space)); - } - } - }); - - if (multiline && !endsWithLineTerminator(toSourceNodeWhenNeeded(result).toString())) { - result.push(newline); - } - result.push(multiline ? base : ''); - result.push('}'); - return result; - }, - - ThisExpression: function (expr, precedence, flags) { - return 'this'; - }, - - Super: function (expr, precedence, flags) { - return 'super'; - }, - - Identifier: function (expr, precedence, flags) { - return generateIdentifier(expr); - }, - - ImportDefaultSpecifier: function (expr, precedence, flags) { - return generateIdentifier(expr.id || expr.local); - }, - - ImportNamespaceSpecifier: function (expr, precedence, flags) { - var result = ['*']; - var id = expr.id || expr.local; - if (id) { - result.push(space + 'as' + noEmptySpace() + generateIdentifier(id)); - } - return result; - }, - - ImportSpecifier: function (expr, precedence, flags) { - var imported = expr.imported; - var result = [ imported.name ]; - var local = expr.local; - if (local && local.name !== imported.name) { - result.push(noEmptySpace() + 'as' + noEmptySpace() + generateIdentifier(local)); - } - return result; - }, - - ExportSpecifier: function (expr, precedence, flags) { - var local = expr.local; - var result = [ local.name ]; - var exported = expr.exported; - if (exported && exported.name !== local.name) { - result.push(noEmptySpace() + 'as' + noEmptySpace() + generateIdentifier(exported)); - } - return result; - }, - - Literal: function (expr, precedence, flags) { - var raw; - if (expr.hasOwnProperty('raw') && parse && extra.raw) { - try { - raw = parse(expr.raw).body[0].expression; - if (raw.type === Syntax.Literal) { - if (raw.value === expr.value) { - return expr.raw; - } - } - } catch (e) { - // not use raw property - } - } - - if (expr.regex) { - return '/' + expr.regex.pattern + '/' + expr.regex.flags; - } - - if (expr.value === null) { - return 'null'; - } - - if (typeof expr.value === 'string') { - return escapeString(expr.value); - } - - if (typeof expr.value === 'number') { - return generateNumber(expr.value); - } - - if (typeof expr.value === 'boolean') { - return expr.value ? 'true' : 'false'; - } - - return generateRegExp(expr.value); - }, - - GeneratorExpression: function (expr, precedence, flags) { - return this.ComprehensionExpression(expr, precedence, flags); - }, - - ComprehensionExpression: function (expr, precedence, flags) { - // GeneratorExpression should be parenthesized with (...), ComprehensionExpression with [...] - // Due to https://bugzilla.mozilla.org/show_bug.cgi?id=883468 position of expr.body can differ in Spidermonkey and ES6 - - var result, i, iz, fragment, that = this; - result = (expr.type === Syntax.GeneratorExpression) ? ['('] : ['[']; - - if (extra.moz.comprehensionExpressionStartsWithAssignment) { - fragment = this.generateExpression(expr.body, Precedence.Assignment, E_TTT); - result.push(fragment); - } - - if (expr.blocks) { - withIndent(function () { - for (i = 0, iz = expr.blocks.length; i < iz; ++i) { - fragment = that.generateExpression(expr.blocks[i], Precedence.Sequence, E_TTT); - if (i > 0 || extra.moz.comprehensionExpressionStartsWithAssignment) { - result = join(result, fragment); - } else { - result.push(fragment); - } - } - }); - } - - if (expr.filter) { - result = join(result, 'if' + space); - fragment = this.generateExpression(expr.filter, Precedence.Sequence, E_TTT); - result = join(result, [ '(', fragment, ')' ]); - } - - if (!extra.moz.comprehensionExpressionStartsWithAssignment) { - fragment = this.generateExpression(expr.body, Precedence.Assignment, E_TTT); - - result = join(result, fragment); - } - - result.push((expr.type === Syntax.GeneratorExpression) ? ')' : ']'); - return result; - }, - - ComprehensionBlock: function (expr, precedence, flags) { - var fragment; - if (expr.left.type === Syntax.VariableDeclaration) { - fragment = [ - expr.left.kind, noEmptySpace(), - this.generateStatement(expr.left.declarations[0], S_FFFF) - ]; - } else { - fragment = this.generateExpression(expr.left, Precedence.Call, E_TTT); - } - - fragment = join(fragment, expr.of ? 'of' : 'in'); - fragment = join(fragment, this.generateExpression(expr.right, Precedence.Sequence, E_TTT)); - - return [ 'for' + space + '(', fragment, ')' ]; - }, - - SpreadElement: function (expr, precedence, flags) { - return [ - '...', - this.generateExpression(expr.argument, Precedence.Assignment, E_TTT) - ]; - }, - - TaggedTemplateExpression: function (expr, precedence, flags) { - var itemFlags = E_TTF; - if (!(flags & F_ALLOW_CALL)) { - itemFlags = E_TFF; - } - var result = [ - this.generateExpression(expr.tag, Precedence.Call, itemFlags), - this.generateExpression(expr.quasi, Precedence.Primary, E_FFT) - ]; - return parenthesize(result, Precedence.TaggedTemplate, precedence); - }, - - TemplateElement: function (expr, precedence, flags) { - // Don't use "cooked". Since tagged template can use raw template - // representation. So if we do so, it breaks the script semantics. - return expr.value.raw; - }, - - TemplateLiteral: function (expr, precedence, flags) { - var result, i, iz; - result = [ '`' ]; - for (i = 0, iz = expr.quasis.length; i < iz; ++i) { - result.push(this.generateExpression(expr.quasis[i], Precedence.Primary, E_TTT)); - if (i + 1 < iz) { - result.push('${' + space); - result.push(this.generateExpression(expr.expressions[i], Precedence.Sequence, E_TTT)); - result.push(space + '}'); - } - } - result.push('`'); - return result; - }, - - ModuleSpecifier: function (expr, precedence, flags) { - return this.Literal(expr, precedence, flags); - }, - - ImportExpression: function(expr, precedence, flag) { - return parenthesize([ - 'import(', - this.generateExpression(expr.source, Precedence.Assignment, E_TTT), - ')' - ], Precedence.Call, precedence); - }, - - }; - - merge(CodeGenerator.prototype, CodeGenerator.Expression); - - CodeGenerator.prototype.generateExpression = function (expr, precedence, flags) { - var result, type; - - type = expr.type || Syntax.Property; - - if (extra.verbatim && expr.hasOwnProperty(extra.verbatim)) { - return generateVerbatim(expr, precedence); - } - - result = this[type](expr, precedence, flags); - - - if (extra.comment) { - result = addComments(expr, result); - } - return toSourceNodeWhenNeeded(result, expr); - }; - - CodeGenerator.prototype.generateStatement = function (stmt, flags) { - var result, - fragment; - - result = this[stmt.type](stmt, flags); - - // Attach comments - - if (extra.comment) { - result = addComments(stmt, result); - } - - fragment = toSourceNodeWhenNeeded(result).toString(); - if (stmt.type === Syntax.Program && !safeConcatenation && newline === '' && fragment.charAt(fragment.length - 1) === '\n') { - result = sourceMap ? toSourceNodeWhenNeeded(result).replaceRight(/\s+$/, '') : fragment.replace(/\s+$/, ''); - } - - return toSourceNodeWhenNeeded(result, stmt); - }; - - function generateInternal(node) { - var codegen; - - codegen = new CodeGenerator(); - if (isStatement(node)) { - return codegen.generateStatement(node, S_TFFF); - } - - if (isExpression(node)) { - return codegen.generateExpression(node, Precedence.Sequence, E_TTT); - } - - throw new Error('Unknown node type: ' + node.type); - } - - function generate(node, options) { - var defaultOptions = getDefaultOptions(), result, pair; - - if (options != null) { - // Obsolete options - // - // `options.indent` - // `options.base` - // - // Instead of them, we can use `option.format.indent`. - if (typeof options.indent === 'string') { - defaultOptions.format.indent.style = options.indent; - } - if (typeof options.base === 'number') { - defaultOptions.format.indent.base = options.base; - } - options = updateDeeply(defaultOptions, options); - indent = options.format.indent.style; - if (typeof options.base === 'string') { - base = options.base; - } else { - base = stringRepeat(indent, options.format.indent.base); - } - } else { - options = defaultOptions; - indent = options.format.indent.style; - base = stringRepeat(indent, options.format.indent.base); - } - json = options.format.json; - renumber = options.format.renumber; - hexadecimal = json ? false : options.format.hexadecimal; - quotes = json ? 'double' : options.format.quotes; - escapeless = options.format.escapeless; - newline = options.format.newline; - space = options.format.space; - if (options.format.compact) { - newline = space = indent = base = ''; - } - parentheses = options.format.parentheses; - semicolons = options.format.semicolons; - safeConcatenation = options.format.safeConcatenation; - directive = options.directive; - parse = json ? null : options.parse; - sourceMap = options.sourceMap; - sourceCode = options.sourceCode; - preserveBlankLines = options.format.preserveBlankLines && sourceCode !== null; - extra = options; - - if (sourceMap) { - if (!exports.browser) { - // We assume environment is node.js - // And prevent from including source-map by browserify - SourceNode = require('source-map').SourceNode; - } else { - SourceNode = global.sourceMap.SourceNode; - } - } - - result = generateInternal(node); - - if (!sourceMap) { - pair = {code: result.toString(), map: null}; - return options.sourceMapWithCode ? pair : pair.code; - } - - - pair = result.toStringWithSourceMap({ - file: options.file, - sourceRoot: options.sourceMapRoot - }); - - if (options.sourceContent) { - pair.map.setSourceContent(options.sourceMap, - options.sourceContent); - } - - if (options.sourceMapWithCode) { - return pair; - } - - return pair.map.toString(); - } - - FORMAT_MINIFY = { - indent: { - style: '', - base: 0 - }, - renumber: true, - hexadecimal: true, - quotes: 'auto', - escapeless: true, - compact: true, - parentheses: false, - semicolons: false - }; - - FORMAT_DEFAULTS = getDefaultOptions().format; - - exports.version = require('./package.json').version; - exports.generate = generate; - exports.attachComments = estraverse.attachComments; - exports.Precedence = updateDeeply({}, Precedence); - exports.browser = false; - exports.FORMAT_MINIFY = FORMAT_MINIFY; - exports.FORMAT_DEFAULTS = FORMAT_DEFAULTS; -}()); -/* vim: set sw=4 ts=4 et tw=80 : */ diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/escodegen/node_modules/estraverse/.jshintrc b/packages/wyatt_notification_bloc/example/scripts/node_modules/escodegen/node_modules/estraverse/.jshintrc deleted file mode 100644 index f642dae7..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/escodegen/node_modules/estraverse/.jshintrc +++ /dev/null @@ -1,16 +0,0 @@ -{ - "curly": true, - "eqeqeq": true, - "immed": true, - "eqnull": true, - "latedef": true, - "noarg": true, - "noempty": true, - "quotmark": "single", - "undef": true, - "unused": true, - "strict": true, - "trailing": true, - - "node": true -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/escodegen/node_modules/estraverse/LICENSE.BSD b/packages/wyatt_notification_bloc/example/scripts/node_modules/escodegen/node_modules/estraverse/LICENSE.BSD deleted file mode 100644 index 3e580c35..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/escodegen/node_modules/estraverse/LICENSE.BSD +++ /dev/null @@ -1,19 +0,0 @@ -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/escodegen/node_modules/estraverse/README.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/escodegen/node_modules/estraverse/README.md deleted file mode 100644 index ccd3377f..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/escodegen/node_modules/estraverse/README.md +++ /dev/null @@ -1,153 +0,0 @@ -### Estraverse [![Build Status](https://secure.travis-ci.org/estools/estraverse.svg)](http://travis-ci.org/estools/estraverse) - -Estraverse ([estraverse](http://github.com/estools/estraverse)) is -[ECMAScript](http://www.ecma-international.org/publications/standards/Ecma-262.htm) -traversal functions from [esmangle project](http://github.com/estools/esmangle). - -### Documentation - -You can find usage docs at [wiki page](https://github.com/estools/estraverse/wiki/Usage). - -### Example Usage - -The following code will output all variables declared at the root of a file. - -```javascript -estraverse.traverse(ast, { - enter: function (node, parent) { - if (node.type == 'FunctionExpression' || node.type == 'FunctionDeclaration') - return estraverse.VisitorOption.Skip; - }, - leave: function (node, parent) { - if (node.type == 'VariableDeclarator') - console.log(node.id.name); - } -}); -``` - -We can use `this.skip`, `this.remove` and `this.break` functions instead of using Skip, Remove and Break. - -```javascript -estraverse.traverse(ast, { - enter: function (node) { - this.break(); - } -}); -``` - -And estraverse provides `estraverse.replace` function. When returning node from `enter`/`leave`, current node is replaced with it. - -```javascript -result = estraverse.replace(tree, { - enter: function (node) { - // Replace it with replaced. - if (node.type === 'Literal') - return replaced; - } -}); -``` - -By passing `visitor.keys` mapping, we can extend estraverse traversing functionality. - -```javascript -// This tree contains a user-defined `TestExpression` node. -var tree = { - type: 'TestExpression', - - // This 'argument' is the property containing the other **node**. - argument: { - type: 'Literal', - value: 20 - }, - - // This 'extended' is the property not containing the other **node**. - extended: true -}; -estraverse.traverse(tree, { - enter: function (node) { }, - - // Extending the existing traversing rules. - keys: { - // TargetNodeName: [ 'keys', 'containing', 'the', 'other', '**node**' ] - TestExpression: ['argument'] - } -}); -``` - -By passing `visitor.fallback` option, we can control the behavior when encountering unknown nodes. - -```javascript -// This tree contains a user-defined `TestExpression` node. -var tree = { - type: 'TestExpression', - - // This 'argument' is the property containing the other **node**. - argument: { - type: 'Literal', - value: 20 - }, - - // This 'extended' is the property not containing the other **node**. - extended: true -}; -estraverse.traverse(tree, { - enter: function (node) { }, - - // Iterating the child **nodes** of unknown nodes. - fallback: 'iteration' -}); -``` - -When `visitor.fallback` is a function, we can determine which keys to visit on each node. - -```javascript -// This tree contains a user-defined `TestExpression` node. -var tree = { - type: 'TestExpression', - - // This 'argument' is the property containing the other **node**. - argument: { - type: 'Literal', - value: 20 - }, - - // This 'extended' is the property not containing the other **node**. - extended: true -}; -estraverse.traverse(tree, { - enter: function (node) { }, - - // Skip the `argument` property of each node - fallback: function(node) { - return Object.keys(node).filter(function(key) { - return key !== 'argument'; - }); - } -}); -``` - -### License - -Copyright (C) 2012-2016 [Yusuke Suzuki](http://github.com/Constellation) - (twitter: [@Constellation](http://twitter.com/Constellation)) and other contributors. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/escodegen/node_modules/estraverse/estraverse.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/escodegen/node_modules/estraverse/estraverse.js deleted file mode 100644 index b106d386..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/escodegen/node_modules/estraverse/estraverse.js +++ /dev/null @@ -1,782 +0,0 @@ -/* - Copyright (C) 2012-2013 Yusuke Suzuki - Copyright (C) 2012 Ariya Hidayat - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -/*jslint vars:false, bitwise:true*/ -/*jshint indent:4*/ -/*global exports:true*/ -(function clone(exports) { - 'use strict'; - - var Syntax, - VisitorOption, - VisitorKeys, - BREAK, - SKIP, - REMOVE; - - function deepCopy(obj) { - var ret = {}, key, val; - for (key in obj) { - if (obj.hasOwnProperty(key)) { - val = obj[key]; - if (typeof val === 'object' && val !== null) { - ret[key] = deepCopy(val); - } else { - ret[key] = val; - } - } - } - return ret; - } - - // based on LLVM libc++ upper_bound / lower_bound - // MIT License - - function upperBound(array, func) { - var diff, len, i, current; - - len = array.length; - i = 0; - - while (len) { - diff = len >>> 1; - current = i + diff; - if (func(array[current])) { - len = diff; - } else { - i = current + 1; - len -= diff + 1; - } - } - return i; - } - - Syntax = { - AssignmentExpression: 'AssignmentExpression', - AssignmentPattern: 'AssignmentPattern', - ArrayExpression: 'ArrayExpression', - ArrayPattern: 'ArrayPattern', - ArrowFunctionExpression: 'ArrowFunctionExpression', - AwaitExpression: 'AwaitExpression', // CAUTION: It's deferred to ES7. - BlockStatement: 'BlockStatement', - BinaryExpression: 'BinaryExpression', - BreakStatement: 'BreakStatement', - CallExpression: 'CallExpression', - CatchClause: 'CatchClause', - ClassBody: 'ClassBody', - ClassDeclaration: 'ClassDeclaration', - ClassExpression: 'ClassExpression', - ComprehensionBlock: 'ComprehensionBlock', // CAUTION: It's deferred to ES7. - ComprehensionExpression: 'ComprehensionExpression', // CAUTION: It's deferred to ES7. - ConditionalExpression: 'ConditionalExpression', - ContinueStatement: 'ContinueStatement', - DebuggerStatement: 'DebuggerStatement', - DirectiveStatement: 'DirectiveStatement', - DoWhileStatement: 'DoWhileStatement', - EmptyStatement: 'EmptyStatement', - ExportAllDeclaration: 'ExportAllDeclaration', - ExportDefaultDeclaration: 'ExportDefaultDeclaration', - ExportNamedDeclaration: 'ExportNamedDeclaration', - ExportSpecifier: 'ExportSpecifier', - ExpressionStatement: 'ExpressionStatement', - ForStatement: 'ForStatement', - ForInStatement: 'ForInStatement', - ForOfStatement: 'ForOfStatement', - FunctionDeclaration: 'FunctionDeclaration', - FunctionExpression: 'FunctionExpression', - GeneratorExpression: 'GeneratorExpression', // CAUTION: It's deferred to ES7. - Identifier: 'Identifier', - IfStatement: 'IfStatement', - ImportExpression: 'ImportExpression', - ImportDeclaration: 'ImportDeclaration', - ImportDefaultSpecifier: 'ImportDefaultSpecifier', - ImportNamespaceSpecifier: 'ImportNamespaceSpecifier', - ImportSpecifier: 'ImportSpecifier', - Literal: 'Literal', - LabeledStatement: 'LabeledStatement', - LogicalExpression: 'LogicalExpression', - MemberExpression: 'MemberExpression', - MetaProperty: 'MetaProperty', - MethodDefinition: 'MethodDefinition', - ModuleSpecifier: 'ModuleSpecifier', - NewExpression: 'NewExpression', - ObjectExpression: 'ObjectExpression', - ObjectPattern: 'ObjectPattern', - Program: 'Program', - Property: 'Property', - RestElement: 'RestElement', - ReturnStatement: 'ReturnStatement', - SequenceExpression: 'SequenceExpression', - SpreadElement: 'SpreadElement', - Super: 'Super', - SwitchStatement: 'SwitchStatement', - SwitchCase: 'SwitchCase', - TaggedTemplateExpression: 'TaggedTemplateExpression', - TemplateElement: 'TemplateElement', - TemplateLiteral: 'TemplateLiteral', - ThisExpression: 'ThisExpression', - ThrowStatement: 'ThrowStatement', - TryStatement: 'TryStatement', - UnaryExpression: 'UnaryExpression', - UpdateExpression: 'UpdateExpression', - VariableDeclaration: 'VariableDeclaration', - VariableDeclarator: 'VariableDeclarator', - WhileStatement: 'WhileStatement', - WithStatement: 'WithStatement', - YieldExpression: 'YieldExpression' - }; - - VisitorKeys = { - AssignmentExpression: ['left', 'right'], - AssignmentPattern: ['left', 'right'], - ArrayExpression: ['elements'], - ArrayPattern: ['elements'], - ArrowFunctionExpression: ['params', 'body'], - AwaitExpression: ['argument'], // CAUTION: It's deferred to ES7. - BlockStatement: ['body'], - BinaryExpression: ['left', 'right'], - BreakStatement: ['label'], - CallExpression: ['callee', 'arguments'], - CatchClause: ['param', 'body'], - ClassBody: ['body'], - ClassDeclaration: ['id', 'superClass', 'body'], - ClassExpression: ['id', 'superClass', 'body'], - ComprehensionBlock: ['left', 'right'], // CAUTION: It's deferred to ES7. - ComprehensionExpression: ['blocks', 'filter', 'body'], // CAUTION: It's deferred to ES7. - ConditionalExpression: ['test', 'consequent', 'alternate'], - ContinueStatement: ['label'], - DebuggerStatement: [], - DirectiveStatement: [], - DoWhileStatement: ['body', 'test'], - EmptyStatement: [], - ExportAllDeclaration: ['source'], - ExportDefaultDeclaration: ['declaration'], - ExportNamedDeclaration: ['declaration', 'specifiers', 'source'], - ExportSpecifier: ['exported', 'local'], - ExpressionStatement: ['expression'], - ForStatement: ['init', 'test', 'update', 'body'], - ForInStatement: ['left', 'right', 'body'], - ForOfStatement: ['left', 'right', 'body'], - FunctionDeclaration: ['id', 'params', 'body'], - FunctionExpression: ['id', 'params', 'body'], - GeneratorExpression: ['blocks', 'filter', 'body'], // CAUTION: It's deferred to ES7. - Identifier: [], - IfStatement: ['test', 'consequent', 'alternate'], - ImportExpression: ['source'], - ImportDeclaration: ['specifiers', 'source'], - ImportDefaultSpecifier: ['local'], - ImportNamespaceSpecifier: ['local'], - ImportSpecifier: ['imported', 'local'], - Literal: [], - LabeledStatement: ['label', 'body'], - LogicalExpression: ['left', 'right'], - MemberExpression: ['object', 'property'], - MetaProperty: ['meta', 'property'], - MethodDefinition: ['key', 'value'], - ModuleSpecifier: [], - NewExpression: ['callee', 'arguments'], - ObjectExpression: ['properties'], - ObjectPattern: ['properties'], - Program: ['body'], - Property: ['key', 'value'], - RestElement: [ 'argument' ], - ReturnStatement: ['argument'], - SequenceExpression: ['expressions'], - SpreadElement: ['argument'], - Super: [], - SwitchStatement: ['discriminant', 'cases'], - SwitchCase: ['test', 'consequent'], - TaggedTemplateExpression: ['tag', 'quasi'], - TemplateElement: [], - TemplateLiteral: ['quasis', 'expressions'], - ThisExpression: [], - ThrowStatement: ['argument'], - TryStatement: ['block', 'handler', 'finalizer'], - UnaryExpression: ['argument'], - UpdateExpression: ['argument'], - VariableDeclaration: ['declarations'], - VariableDeclarator: ['id', 'init'], - WhileStatement: ['test', 'body'], - WithStatement: ['object', 'body'], - YieldExpression: ['argument'] - }; - - // unique id - BREAK = {}; - SKIP = {}; - REMOVE = {}; - - VisitorOption = { - Break: BREAK, - Skip: SKIP, - Remove: REMOVE - }; - - function Reference(parent, key) { - this.parent = parent; - this.key = key; - } - - Reference.prototype.replace = function replace(node) { - this.parent[this.key] = node; - }; - - Reference.prototype.remove = function remove() { - if (Array.isArray(this.parent)) { - this.parent.splice(this.key, 1); - return true; - } else { - this.replace(null); - return false; - } - }; - - function Element(node, path, wrap, ref) { - this.node = node; - this.path = path; - this.wrap = wrap; - this.ref = ref; - } - - function Controller() { } - - // API: - // return property path array from root to current node - Controller.prototype.path = function path() { - var i, iz, j, jz, result, element; - - function addToPath(result, path) { - if (Array.isArray(path)) { - for (j = 0, jz = path.length; j < jz; ++j) { - result.push(path[j]); - } - } else { - result.push(path); - } - } - - // root node - if (!this.__current.path) { - return null; - } - - // first node is sentinel, second node is root element - result = []; - for (i = 2, iz = this.__leavelist.length; i < iz; ++i) { - element = this.__leavelist[i]; - addToPath(result, element.path); - } - addToPath(result, this.__current.path); - return result; - }; - - // API: - // return type of current node - Controller.prototype.type = function () { - var node = this.current(); - return node.type || this.__current.wrap; - }; - - // API: - // return array of parent elements - Controller.prototype.parents = function parents() { - var i, iz, result; - - // first node is sentinel - result = []; - for (i = 1, iz = this.__leavelist.length; i < iz; ++i) { - result.push(this.__leavelist[i].node); - } - - return result; - }; - - // API: - // return current node - Controller.prototype.current = function current() { - return this.__current.node; - }; - - Controller.prototype.__execute = function __execute(callback, element) { - var previous, result; - - result = undefined; - - previous = this.__current; - this.__current = element; - this.__state = null; - if (callback) { - result = callback.call(this, element.node, this.__leavelist[this.__leavelist.length - 1].node); - } - this.__current = previous; - - return result; - }; - - // API: - // notify control skip / break - Controller.prototype.notify = function notify(flag) { - this.__state = flag; - }; - - // API: - // skip child nodes of current node - Controller.prototype.skip = function () { - this.notify(SKIP); - }; - - // API: - // break traversals - Controller.prototype['break'] = function () { - this.notify(BREAK); - }; - - // API: - // remove node - Controller.prototype.remove = function () { - this.notify(REMOVE); - }; - - Controller.prototype.__initialize = function(root, visitor) { - this.visitor = visitor; - this.root = root; - this.__worklist = []; - this.__leavelist = []; - this.__current = null; - this.__state = null; - this.__fallback = null; - if (visitor.fallback === 'iteration') { - this.__fallback = Object.keys; - } else if (typeof visitor.fallback === 'function') { - this.__fallback = visitor.fallback; - } - - this.__keys = VisitorKeys; - if (visitor.keys) { - this.__keys = Object.assign(Object.create(this.__keys), visitor.keys); - } - }; - - function isNode(node) { - if (node == null) { - return false; - } - return typeof node === 'object' && typeof node.type === 'string'; - } - - function isProperty(nodeType, key) { - return (nodeType === Syntax.ObjectExpression || nodeType === Syntax.ObjectPattern) && 'properties' === key; - } - - Controller.prototype.traverse = function traverse(root, visitor) { - var worklist, - leavelist, - element, - node, - nodeType, - ret, - key, - current, - current2, - candidates, - candidate, - sentinel; - - this.__initialize(root, visitor); - - sentinel = {}; - - // reference - worklist = this.__worklist; - leavelist = this.__leavelist; - - // initialize - worklist.push(new Element(root, null, null, null)); - leavelist.push(new Element(null, null, null, null)); - - while (worklist.length) { - element = worklist.pop(); - - if (element === sentinel) { - element = leavelist.pop(); - - ret = this.__execute(visitor.leave, element); - - if (this.__state === BREAK || ret === BREAK) { - return; - } - continue; - } - - if (element.node) { - - ret = this.__execute(visitor.enter, element); - - if (this.__state === BREAK || ret === BREAK) { - return; - } - - worklist.push(sentinel); - leavelist.push(element); - - if (this.__state === SKIP || ret === SKIP) { - continue; - } - - node = element.node; - nodeType = node.type || element.wrap; - candidates = this.__keys[nodeType]; - if (!candidates) { - if (this.__fallback) { - candidates = this.__fallback(node); - } else { - throw new Error('Unknown node type ' + nodeType + '.'); - } - } - - current = candidates.length; - while ((current -= 1) >= 0) { - key = candidates[current]; - candidate = node[key]; - if (!candidate) { - continue; - } - - if (Array.isArray(candidate)) { - current2 = candidate.length; - while ((current2 -= 1) >= 0) { - if (!candidate[current2]) { - continue; - } - if (isProperty(nodeType, candidates[current])) { - element = new Element(candidate[current2], [key, current2], 'Property', null); - } else if (isNode(candidate[current2])) { - element = new Element(candidate[current2], [key, current2], null, null); - } else { - continue; - } - worklist.push(element); - } - } else if (isNode(candidate)) { - worklist.push(new Element(candidate, key, null, null)); - } - } - } - } - }; - - Controller.prototype.replace = function replace(root, visitor) { - var worklist, - leavelist, - node, - nodeType, - target, - element, - current, - current2, - candidates, - candidate, - sentinel, - outer, - key; - - function removeElem(element) { - var i, - key, - nextElem, - parent; - - if (element.ref.remove()) { - // When the reference is an element of an array. - key = element.ref.key; - parent = element.ref.parent; - - // If removed from array, then decrease following items' keys. - i = worklist.length; - while (i--) { - nextElem = worklist[i]; - if (nextElem.ref && nextElem.ref.parent === parent) { - if (nextElem.ref.key < key) { - break; - } - --nextElem.ref.key; - } - } - } - } - - this.__initialize(root, visitor); - - sentinel = {}; - - // reference - worklist = this.__worklist; - leavelist = this.__leavelist; - - // initialize - outer = { - root: root - }; - element = new Element(root, null, null, new Reference(outer, 'root')); - worklist.push(element); - leavelist.push(element); - - while (worklist.length) { - element = worklist.pop(); - - if (element === sentinel) { - element = leavelist.pop(); - - target = this.__execute(visitor.leave, element); - - // node may be replaced with null, - // so distinguish between undefined and null in this place - if (target !== undefined && target !== BREAK && target !== SKIP && target !== REMOVE) { - // replace - element.ref.replace(target); - } - - if (this.__state === REMOVE || target === REMOVE) { - removeElem(element); - } - - if (this.__state === BREAK || target === BREAK) { - return outer.root; - } - continue; - } - - target = this.__execute(visitor.enter, element); - - // node may be replaced with null, - // so distinguish between undefined and null in this place - if (target !== undefined && target !== BREAK && target !== SKIP && target !== REMOVE) { - // replace - element.ref.replace(target); - element.node = target; - } - - if (this.__state === REMOVE || target === REMOVE) { - removeElem(element); - element.node = null; - } - - if (this.__state === BREAK || target === BREAK) { - return outer.root; - } - - // node may be null - node = element.node; - if (!node) { - continue; - } - - worklist.push(sentinel); - leavelist.push(element); - - if (this.__state === SKIP || target === SKIP) { - continue; - } - - nodeType = node.type || element.wrap; - candidates = this.__keys[nodeType]; - if (!candidates) { - if (this.__fallback) { - candidates = this.__fallback(node); - } else { - throw new Error('Unknown node type ' + nodeType + '.'); - } - } - - current = candidates.length; - while ((current -= 1) >= 0) { - key = candidates[current]; - candidate = node[key]; - if (!candidate) { - continue; - } - - if (Array.isArray(candidate)) { - current2 = candidate.length; - while ((current2 -= 1) >= 0) { - if (!candidate[current2]) { - continue; - } - if (isProperty(nodeType, candidates[current])) { - element = new Element(candidate[current2], [key, current2], 'Property', new Reference(candidate, current2)); - } else if (isNode(candidate[current2])) { - element = new Element(candidate[current2], [key, current2], null, new Reference(candidate, current2)); - } else { - continue; - } - worklist.push(element); - } - } else if (isNode(candidate)) { - worklist.push(new Element(candidate, key, null, new Reference(node, key))); - } - } - } - - return outer.root; - }; - - function traverse(root, visitor) { - var controller = new Controller(); - return controller.traverse(root, visitor); - } - - function replace(root, visitor) { - var controller = new Controller(); - return controller.replace(root, visitor); - } - - function extendCommentRange(comment, tokens) { - var target; - - target = upperBound(tokens, function search(token) { - return token.range[0] > comment.range[0]; - }); - - comment.extendedRange = [comment.range[0], comment.range[1]]; - - if (target !== tokens.length) { - comment.extendedRange[1] = tokens[target].range[0]; - } - - target -= 1; - if (target >= 0) { - comment.extendedRange[0] = tokens[target].range[1]; - } - - return comment; - } - - function attachComments(tree, providedComments, tokens) { - // At first, we should calculate extended comment ranges. - var comments = [], comment, len, i, cursor; - - if (!tree.range) { - throw new Error('attachComments needs range information'); - } - - // tokens array is empty, we attach comments to tree as 'leadingComments' - if (!tokens.length) { - if (providedComments.length) { - for (i = 0, len = providedComments.length; i < len; i += 1) { - comment = deepCopy(providedComments[i]); - comment.extendedRange = [0, tree.range[0]]; - comments.push(comment); - } - tree.leadingComments = comments; - } - return tree; - } - - for (i = 0, len = providedComments.length; i < len; i += 1) { - comments.push(extendCommentRange(deepCopy(providedComments[i]), tokens)); - } - - // This is based on John Freeman's implementation. - cursor = 0; - traverse(tree, { - enter: function (node) { - var comment; - - while (cursor < comments.length) { - comment = comments[cursor]; - if (comment.extendedRange[1] > node.range[0]) { - break; - } - - if (comment.extendedRange[1] === node.range[0]) { - if (!node.leadingComments) { - node.leadingComments = []; - } - node.leadingComments.push(comment); - comments.splice(cursor, 1); - } else { - cursor += 1; - } - } - - // already out of owned node - if (cursor === comments.length) { - return VisitorOption.Break; - } - - if (comments[cursor].extendedRange[0] > node.range[1]) { - return VisitorOption.Skip; - } - } - }); - - cursor = 0; - traverse(tree, { - leave: function (node) { - var comment; - - while (cursor < comments.length) { - comment = comments[cursor]; - if (node.range[1] < comment.extendedRange[0]) { - break; - } - - if (node.range[1] === comment.extendedRange[0]) { - if (!node.trailingComments) { - node.trailingComments = []; - } - node.trailingComments.push(comment); - comments.splice(cursor, 1); - } else { - cursor += 1; - } - } - - // already out of owned node - if (cursor === comments.length) { - return VisitorOption.Break; - } - - if (comments[cursor].extendedRange[0] > node.range[1]) { - return VisitorOption.Skip; - } - } - }); - - return tree; - } - - exports.version = require('./package.json').version; - exports.Syntax = Syntax; - exports.traverse = traverse; - exports.replace = replace; - exports.attachComments = attachComments; - exports.VisitorKeys = VisitorKeys; - exports.VisitorOption = VisitorOption; - exports.Controller = Controller; - exports.cloneEnvironment = function () { return clone({}); }; - - return exports; -}(exports)); -/* vim: set sw=4 ts=4 et tw=80 : */ diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/escodegen/node_modules/estraverse/gulpfile.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/escodegen/node_modules/estraverse/gulpfile.js deleted file mode 100644 index 8772bbcc..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/escodegen/node_modules/estraverse/gulpfile.js +++ /dev/null @@ -1,70 +0,0 @@ -/* - Copyright (C) 2014 Yusuke Suzuki - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS' - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -'use strict'; - -var gulp = require('gulp'), - git = require('gulp-git'), - bump = require('gulp-bump'), - filter = require('gulp-filter'), - tagVersion = require('gulp-tag-version'); - -var TEST = [ 'test/*.js' ]; -var POWERED = [ 'powered-test/*.js' ]; -var SOURCE = [ 'src/**/*.js' ]; - -/** - * Bumping version number and tagging the repository with it. - * Please read http://semver.org/ - * - * You can use the commands - * - * gulp patch # makes v0.1.0 -> v0.1.1 - * gulp feature # makes v0.1.1 -> v0.2.0 - * gulp release # makes v0.2.1 -> v1.0.0 - * - * To bump the version numbers accordingly after you did a patch, - * introduced a feature or made a backwards-incompatible release. - */ - -function inc(importance) { - // get all the files to bump version in - return gulp.src(['./package.json']) - // bump the version number in those files - .pipe(bump({type: importance})) - // save it back to filesystem - .pipe(gulp.dest('./')) - // commit the changed version number - .pipe(git.commit('Bumps package version')) - // read only one file to get the version number - .pipe(filter('package.json')) - // **tag it in the repository** - .pipe(tagVersion({ - prefix: '' - })); -} - -gulp.task('patch', [ ], function () { return inc('patch'); }) -gulp.task('minor', [ ], function () { return inc('minor'); }) -gulp.task('major', [ ], function () { return inc('major'); }) diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/escodegen/node_modules/estraverse/package.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/escodegen/node_modules/estraverse/package.json deleted file mode 100644 index 11382386..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/escodegen/node_modules/estraverse/package.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "name": "estraverse", - "description": "ECMAScript JS AST traversal functions", - "homepage": "https://github.com/estools/estraverse", - "main": "estraverse.js", - "version": "4.3.0", - "engines": { - "node": ">=4.0" - }, - "maintainers": [ - { - "name": "Yusuke Suzuki", - "email": "utatane.tea@gmail.com", - "web": "http://github.com/Constellation" - } - ], - "repository": { - "type": "git", - "url": "http://github.com/estools/estraverse.git" - }, - "devDependencies": { - "babel-preset-env": "^1.6.1", - "babel-register": "^6.3.13", - "chai": "^2.1.1", - "espree": "^1.11.0", - "gulp": "^3.8.10", - "gulp-bump": "^0.2.2", - "gulp-filter": "^2.0.0", - "gulp-git": "^1.0.1", - "gulp-tag-version": "^1.3.0", - "jshint": "^2.5.6", - "mocha": "^2.1.0" - }, - "license": "BSD-2-Clause", - "scripts": { - "test": "npm run-script lint && npm run-script unit-test", - "lint": "jshint estraverse.js", - "unit-test": "mocha --compilers js:babel-register" - } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/escodegen/package.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/escodegen/package.json deleted file mode 100644 index 51ee0d86..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/escodegen/package.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "name": "escodegen", - "description": "ECMAScript code generator", - "homepage": "http://github.com/estools/escodegen", - "main": "escodegen.js", - "bin": { - "esgenerate": "./bin/esgenerate.js", - "escodegen": "./bin/escodegen.js" - }, - "files": [ - "LICENSE.BSD", - "README.md", - "bin", - "escodegen.js", - "package.json" - ], - "version": "1.14.3", - "engines": { - "node": ">=4.0" - }, - "maintainers": [ - { - "name": "Yusuke Suzuki", - "email": "utatane.tea@gmail.com", - "web": "http://github.com/Constellation" - } - ], - "repository": { - "type": "git", - "url": "http://github.com/estools/escodegen.git" - }, - "dependencies": { - "estraverse": "^4.2.0", - "esutils": "^2.0.2", - "esprima": "^4.0.1", - "optionator": "^0.8.1" - }, - "optionalDependencies": { - "source-map": "~0.6.1" - }, - "devDependencies": { - "acorn": "^7.1.0", - "bluebird": "^3.4.7", - "bower-registry-client": "^1.0.0", - "chai": "^3.5.0", - "commonjs-everywhere": "^0.9.7", - "gulp": "^3.8.10", - "gulp-eslint": "^3.0.1", - "gulp-mocha": "^3.0.1", - "semver": "^5.1.0" - }, - "license": "BSD-2-Clause", - "scripts": { - "test": "gulp travis", - "unit-test": "gulp test", - "lint": "gulp lint", - "release": "node tools/release.js", - "build-min": "./node_modules/.bin/cjsify -ma path: tools/entry-point.js > escodegen.browser.min.js", - "build": "./node_modules/.bin/cjsify -a path: tools/entry-point.js > escodegen.browser.js" - } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/eslint-visitor-keys/LICENSE b/packages/wyatt_notification_bloc/example/scripts/node_modules/eslint-visitor-keys/LICENSE deleted file mode 100644 index 17a25538..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/eslint-visitor-keys/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "{}" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright contributors - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/eslint-visitor-keys/README.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/eslint-visitor-keys/README.md deleted file mode 100644 index 8eda5c7c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/eslint-visitor-keys/README.md +++ /dev/null @@ -1,107 +0,0 @@ -# eslint-visitor-keys - -[![npm version](https://img.shields.io/npm/v/eslint-visitor-keys.svg)](https://www.npmjs.com/package/eslint-visitor-keys) -[![Downloads/month](https://img.shields.io/npm/dm/eslint-visitor-keys.svg)](http://www.npmtrends.com/eslint-visitor-keys) -[![Build Status](https://travis-ci.org/eslint/eslint-visitor-keys.svg?branch=master)](https://travis-ci.org/eslint/eslint-visitor-keys) -[![Dependency Status](https://david-dm.org/eslint/eslint-visitor-keys.svg)](https://david-dm.org/eslint/eslint-visitor-keys) - -Constants and utilities about visitor keys to traverse AST. - -## 💿 Installation - -Use [npm] to install. - -```bash -$ npm install eslint-visitor-keys -``` - -### Requirements - -- [Node.js] `^12.22.0`, `^14.17.0`, or `>=16.0.0` - - -## 📖 Usage - -To use in an ESM file: - -```js -import * as evk from "eslint-visitor-keys" -``` - -To use in a CommonJS file: - -```js -const evk = require("eslint-visitor-keys") -``` - -### evk.KEYS - -> type: `{ [type: string]: string[] | undefined }` - -Visitor keys. This keys are frozen. - -This is an object. Keys are the type of [ESTree] nodes. Their values are an array of property names which have child nodes. - -For example: - -``` -console.log(evk.KEYS.AssignmentExpression) // → ["left", "right"] -``` - -### evk.getKeys(node) - -> type: `(node: object) => string[]` - -Get the visitor keys of a given AST node. - -This is similar to `Object.keys(node)` of ES Standard, but some keys are excluded: `parent`, `leadingComments`, `trailingComments`, and names which start with `_`. - -This will be used to traverse unknown nodes. - -For example: - -```js -const node = { - type: "AssignmentExpression", - left: { type: "Identifier", name: "foo" }, - right: { type: "Literal", value: 0 } -} -console.log(evk.getKeys(node)) // → ["type", "left", "right"] -``` - -### evk.unionWith(additionalKeys) - -> type: `(additionalKeys: object) => { [type: string]: string[] | undefined }` - -Make the union set with `evk.KEYS` and the given keys. - -- The order of keys is, `additionalKeys` is at first, then `evk.KEYS` is concatenated after that. -- It removes duplicated keys as keeping the first one. - -For example: - -```js -console.log(evk.unionWith({ - MethodDefinition: ["decorators"] -})) // → { ..., MethodDefinition: ["decorators", "key", "value"], ... } -``` - -## 📰 Change log - -See [GitHub releases](https://github.com/eslint/eslint-visitor-keys/releases). - -## 🍻 Contributing - -Welcome. See [ESLint contribution guidelines](https://eslint.org/docs/developer-guide/contributing/). - -### Development commands - -- `npm test` runs tests and measures code coverage. -- `npm run lint` checks source codes with ESLint. -- `npm run coverage` opens the code coverage report of the previous test with your default browser. -- `npm run release` publishes this package to [npm] registory. - - -[npm]: https://www.npmjs.com/ -[Node.js]: https://nodejs.org/ -[ESTree]: https://github.com/estree/estree diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/eslint-visitor-keys/dist/eslint-visitor-keys.cjs b/packages/wyatt_notification_bloc/example/scripts/node_modules/eslint-visitor-keys/dist/eslint-visitor-keys.cjs deleted file mode 100644 index 9d47fd75..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/eslint-visitor-keys/dist/eslint-visitor-keys.cjs +++ /dev/null @@ -1,382 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, '__esModule', { value: true }); - -/** - * @typedef {import('./index.js').VisitorKeys} VisitorKeys - */ - -/** - * @type {VisitorKeys} - */ -const KEYS = { - AssignmentExpression: [ - "left", - "right" - ], - AssignmentPattern: [ - "left", - "right" - ], - ArrayExpression: [ - "elements" - ], - ArrayPattern: [ - "elements" - ], - ArrowFunctionExpression: [ - "params", - "body" - ], - AwaitExpression: [ - "argument" - ], - BlockStatement: [ - "body" - ], - BinaryExpression: [ - "left", - "right" - ], - BreakStatement: [ - "label" - ], - CallExpression: [ - "callee", - "arguments" - ], - CatchClause: [ - "param", - "body" - ], - ChainExpression: [ - "expression" - ], - ClassBody: [ - "body" - ], - ClassDeclaration: [ - "id", - "superClass", - "body" - ], - ClassExpression: [ - "id", - "superClass", - "body" - ], - ConditionalExpression: [ - "test", - "consequent", - "alternate" - ], - ContinueStatement: [ - "label" - ], - DebuggerStatement: [], - DoWhileStatement: [ - "body", - "test" - ], - EmptyStatement: [], - ExportAllDeclaration: [ - "exported", - "source" - ], - ExportDefaultDeclaration: [ - "declaration" - ], - ExportNamedDeclaration: [ - "declaration", - "specifiers", - "source" - ], - ExportSpecifier: [ - "exported", - "local" - ], - ExpressionStatement: [ - "expression" - ], - ExperimentalRestProperty: [ - "argument" - ], - ExperimentalSpreadProperty: [ - "argument" - ], - ForStatement: [ - "init", - "test", - "update", - "body" - ], - ForInStatement: [ - "left", - "right", - "body" - ], - ForOfStatement: [ - "left", - "right", - "body" - ], - FunctionDeclaration: [ - "id", - "params", - "body" - ], - FunctionExpression: [ - "id", - "params", - "body" - ], - Identifier: [], - IfStatement: [ - "test", - "consequent", - "alternate" - ], - ImportDeclaration: [ - "specifiers", - "source" - ], - ImportDefaultSpecifier: [ - "local" - ], - ImportExpression: [ - "source" - ], - ImportNamespaceSpecifier: [ - "local" - ], - ImportSpecifier: [ - "imported", - "local" - ], - JSXAttribute: [ - "name", - "value" - ], - JSXClosingElement: [ - "name" - ], - JSXElement: [ - "openingElement", - "children", - "closingElement" - ], - JSXEmptyExpression: [], - JSXExpressionContainer: [ - "expression" - ], - JSXIdentifier: [], - JSXMemberExpression: [ - "object", - "property" - ], - JSXNamespacedName: [ - "namespace", - "name" - ], - JSXOpeningElement: [ - "name", - "attributes" - ], - JSXSpreadAttribute: [ - "argument" - ], - JSXText: [], - JSXFragment: [ - "openingFragment", - "children", - "closingFragment" - ], - JSXClosingFragment: [], - JSXOpeningFragment: [], - Literal: [], - LabeledStatement: [ - "label", - "body" - ], - LogicalExpression: [ - "left", - "right" - ], - MemberExpression: [ - "object", - "property" - ], - MetaProperty: [ - "meta", - "property" - ], - MethodDefinition: [ - "key", - "value" - ], - NewExpression: [ - "callee", - "arguments" - ], - ObjectExpression: [ - "properties" - ], - ObjectPattern: [ - "properties" - ], - PrivateIdentifier: [], - Program: [ - "body" - ], - Property: [ - "key", - "value" - ], - PropertyDefinition: [ - "key", - "value" - ], - RestElement: [ - "argument" - ], - ReturnStatement: [ - "argument" - ], - SequenceExpression: [ - "expressions" - ], - SpreadElement: [ - "argument" - ], - StaticBlock: [ - "body" - ], - Super: [], - SwitchStatement: [ - "discriminant", - "cases" - ], - SwitchCase: [ - "test", - "consequent" - ], - TaggedTemplateExpression: [ - "tag", - "quasi" - ], - TemplateElement: [], - TemplateLiteral: [ - "quasis", - "expressions" - ], - ThisExpression: [], - ThrowStatement: [ - "argument" - ], - TryStatement: [ - "block", - "handler", - "finalizer" - ], - UnaryExpression: [ - "argument" - ], - UpdateExpression: [ - "argument" - ], - VariableDeclaration: [ - "declarations" - ], - VariableDeclarator: [ - "id", - "init" - ], - WhileStatement: [ - "test", - "body" - ], - WithStatement: [ - "object", - "body" - ], - YieldExpression: [ - "argument" - ] -}; - -// Types. -const NODE_TYPES = Object.keys(KEYS); - -// Freeze the keys. -for (const type of NODE_TYPES) { - Object.freeze(KEYS[type]); -} -Object.freeze(KEYS); - -/** - * @author Toru Nagashima - * See LICENSE file in root directory for full license. - */ - -/** - * @typedef {{ readonly [type: string]: ReadonlyArray }} VisitorKeys - */ - -// List to ignore keys. -const KEY_BLACKLIST = new Set([ - "parent", - "leadingComments", - "trailingComments" -]); - -/** - * Check whether a given key should be used or not. - * @param {string} key The key to check. - * @returns {boolean} `true` if the key should be used. - */ -function filterKey(key) { - return !KEY_BLACKLIST.has(key) && key[0] !== "_"; -} - -/** - * Get visitor keys of a given node. - * @param {object} node The AST node to get keys. - * @returns {readonly string[]} Visitor keys of the node. - */ -function getKeys(node) { - return Object.keys(node).filter(filterKey); -} - -// Disable valid-jsdoc rule because it reports syntax error on the type of @returns. -// eslint-disable-next-line valid-jsdoc -/** - * Make the union set with `KEYS` and given keys. - * @param {VisitorKeys} additionalKeys The additional keys. - * @returns {VisitorKeys} The union set. - */ -function unionWith(additionalKeys) { - const retv = /** @type {{ - [type: string]: ReadonlyArray - }} */ (Object.assign({}, KEYS)); - - for (const type of Object.keys(additionalKeys)) { - if (Object.prototype.hasOwnProperty.call(retv, type)) { - const keys = new Set(additionalKeys[type]); - - for (const key of retv[type]) { - keys.add(key); - } - - retv[type] = Object.freeze(Array.from(keys)); - } else { - retv[type] = Object.freeze(Array.from(additionalKeys[type])); - } - } - - return Object.freeze(retv); -} - -exports.KEYS = KEYS; -exports.getKeys = getKeys; -exports.unionWith = unionWith; -//# sourceMappingURL=eslint-visitor-keys.cjs.map diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/eslint-visitor-keys/dist/index.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/eslint-visitor-keys/dist/index.d.ts deleted file mode 100644 index d866198f..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/eslint-visitor-keys/dist/index.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -/** - * Get visitor keys of a given node. - * @param {object} node The AST node to get keys. - * @returns {readonly string[]} Visitor keys of the node. - */ -export function getKeys(node: object): readonly string[]; -/** - * Make the union set with `KEYS` and given keys. - * @param {VisitorKeys} additionalKeys The additional keys. - * @returns {VisitorKeys} The union set. - */ -export function unionWith(additionalKeys: VisitorKeys): VisitorKeys; -export { KEYS }; -export type VisitorKeys = { - readonly [type: string]: readonly string[]; -}; -import KEYS from "./visitor-keys.js"; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/eslint-visitor-keys/dist/visitor-keys.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/eslint-visitor-keys/dist/visitor-keys.d.ts deleted file mode 100644 index 19192383..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/eslint-visitor-keys/dist/visitor-keys.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -export default KEYS; -export type VisitorKeys = import('./index.js').VisitorKeys; -/** - * @typedef {import('./index.js').VisitorKeys} VisitorKeys - */ -/** - * @type {VisitorKeys} - */ -declare const KEYS: VisitorKeys; -//# sourceMappingURL=visitor-keys.d.ts.map \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/eslint-visitor-keys/lib/index.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/eslint-visitor-keys/lib/index.js deleted file mode 100644 index 83ebb1f8..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/eslint-visitor-keys/lib/index.js +++ /dev/null @@ -1,65 +0,0 @@ -/** - * @author Toru Nagashima - * See LICENSE file in root directory for full license. - */ -import KEYS from "./visitor-keys.js"; - -/** - * @typedef {{ readonly [type: string]: ReadonlyArray }} VisitorKeys - */ - -// List to ignore keys. -const KEY_BLACKLIST = new Set([ - "parent", - "leadingComments", - "trailingComments" -]); - -/** - * Check whether a given key should be used or not. - * @param {string} key The key to check. - * @returns {boolean} `true` if the key should be used. - */ -function filterKey(key) { - return !KEY_BLACKLIST.has(key) && key[0] !== "_"; -} - -/** - * Get visitor keys of a given node. - * @param {object} node The AST node to get keys. - * @returns {readonly string[]} Visitor keys of the node. - */ -export function getKeys(node) { - return Object.keys(node).filter(filterKey); -} - -// Disable valid-jsdoc rule because it reports syntax error on the type of @returns. -// eslint-disable-next-line valid-jsdoc -/** - * Make the union set with `KEYS` and given keys. - * @param {VisitorKeys} additionalKeys The additional keys. - * @returns {VisitorKeys} The union set. - */ -export function unionWith(additionalKeys) { - const retv = /** @type {{ - [type: string]: ReadonlyArray - }} */ (Object.assign({}, KEYS)); - - for (const type of Object.keys(additionalKeys)) { - if (Object.prototype.hasOwnProperty.call(retv, type)) { - const keys = new Set(additionalKeys[type]); - - for (const key of retv[type]) { - keys.add(key); - } - - retv[type] = Object.freeze(Array.from(keys)); - } else { - retv[type] = Object.freeze(Array.from(additionalKeys[type])); - } - } - - return Object.freeze(retv); -} - -export { KEYS }; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/eslint-visitor-keys/lib/visitor-keys.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/eslint-visitor-keys/lib/visitor-keys.js deleted file mode 100644 index d456d648..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/eslint-visitor-keys/lib/visitor-keys.js +++ /dev/null @@ -1,312 +0,0 @@ -/** - * @typedef {import('./index.js').VisitorKeys} VisitorKeys - */ - -/** - * @type {VisitorKeys} - */ -const KEYS = { - AssignmentExpression: [ - "left", - "right" - ], - AssignmentPattern: [ - "left", - "right" - ], - ArrayExpression: [ - "elements" - ], - ArrayPattern: [ - "elements" - ], - ArrowFunctionExpression: [ - "params", - "body" - ], - AwaitExpression: [ - "argument" - ], - BlockStatement: [ - "body" - ], - BinaryExpression: [ - "left", - "right" - ], - BreakStatement: [ - "label" - ], - CallExpression: [ - "callee", - "arguments" - ], - CatchClause: [ - "param", - "body" - ], - ChainExpression: [ - "expression" - ], - ClassBody: [ - "body" - ], - ClassDeclaration: [ - "id", - "superClass", - "body" - ], - ClassExpression: [ - "id", - "superClass", - "body" - ], - ConditionalExpression: [ - "test", - "consequent", - "alternate" - ], - ContinueStatement: [ - "label" - ], - DebuggerStatement: [], - DoWhileStatement: [ - "body", - "test" - ], - EmptyStatement: [], - ExportAllDeclaration: [ - "exported", - "source" - ], - ExportDefaultDeclaration: [ - "declaration" - ], - ExportNamedDeclaration: [ - "declaration", - "specifiers", - "source" - ], - ExportSpecifier: [ - "exported", - "local" - ], - ExpressionStatement: [ - "expression" - ], - ExperimentalRestProperty: [ - "argument" - ], - ExperimentalSpreadProperty: [ - "argument" - ], - ForStatement: [ - "init", - "test", - "update", - "body" - ], - ForInStatement: [ - "left", - "right", - "body" - ], - ForOfStatement: [ - "left", - "right", - "body" - ], - FunctionDeclaration: [ - "id", - "params", - "body" - ], - FunctionExpression: [ - "id", - "params", - "body" - ], - Identifier: [], - IfStatement: [ - "test", - "consequent", - "alternate" - ], - ImportDeclaration: [ - "specifiers", - "source" - ], - ImportDefaultSpecifier: [ - "local" - ], - ImportExpression: [ - "source" - ], - ImportNamespaceSpecifier: [ - "local" - ], - ImportSpecifier: [ - "imported", - "local" - ], - JSXAttribute: [ - "name", - "value" - ], - JSXClosingElement: [ - "name" - ], - JSXElement: [ - "openingElement", - "children", - "closingElement" - ], - JSXEmptyExpression: [], - JSXExpressionContainer: [ - "expression" - ], - JSXIdentifier: [], - JSXMemberExpression: [ - "object", - "property" - ], - JSXNamespacedName: [ - "namespace", - "name" - ], - JSXOpeningElement: [ - "name", - "attributes" - ], - JSXSpreadAttribute: [ - "argument" - ], - JSXText: [], - JSXFragment: [ - "openingFragment", - "children", - "closingFragment" - ], - JSXClosingFragment: [], - JSXOpeningFragment: [], - Literal: [], - LabeledStatement: [ - "label", - "body" - ], - LogicalExpression: [ - "left", - "right" - ], - MemberExpression: [ - "object", - "property" - ], - MetaProperty: [ - "meta", - "property" - ], - MethodDefinition: [ - "key", - "value" - ], - NewExpression: [ - "callee", - "arguments" - ], - ObjectExpression: [ - "properties" - ], - ObjectPattern: [ - "properties" - ], - PrivateIdentifier: [], - Program: [ - "body" - ], - Property: [ - "key", - "value" - ], - PropertyDefinition: [ - "key", - "value" - ], - RestElement: [ - "argument" - ], - ReturnStatement: [ - "argument" - ], - SequenceExpression: [ - "expressions" - ], - SpreadElement: [ - "argument" - ], - StaticBlock: [ - "body" - ], - Super: [], - SwitchStatement: [ - "discriminant", - "cases" - ], - SwitchCase: [ - "test", - "consequent" - ], - TaggedTemplateExpression: [ - "tag", - "quasi" - ], - TemplateElement: [], - TemplateLiteral: [ - "quasis", - "expressions" - ], - ThisExpression: [], - ThrowStatement: [ - "argument" - ], - TryStatement: [ - "block", - "handler", - "finalizer" - ], - UnaryExpression: [ - "argument" - ], - UpdateExpression: [ - "argument" - ], - VariableDeclaration: [ - "declarations" - ], - VariableDeclarator: [ - "id", - "init" - ], - WhileStatement: [ - "test", - "body" - ], - WithStatement: [ - "object", - "body" - ], - YieldExpression: [ - "argument" - ] -}; - -// Types. -const NODE_TYPES = Object.keys(KEYS); - -// Freeze the keys. -for (const type of NODE_TYPES) { - Object.freeze(KEYS[type]); -} -Object.freeze(KEYS); - -export default KEYS; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/eslint-visitor-keys/package.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/eslint-visitor-keys/package.json deleted file mode 100644 index 5368ad5a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/eslint-visitor-keys/package.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "name": "eslint-visitor-keys", - "version": "3.3.0", - "description": "Constants and utilities about visitor keys to traverse AST.", - "type": "module", - "main": "dist/eslint-visitor-keys.cjs", - "types": "./dist/index.d.ts", - "exports": { - ".": [ - { - "import": "./lib/index.js", - "require": "./dist/eslint-visitor-keys.cjs" - }, - "./dist/eslint-visitor-keys.cjs" - ], - "./package.json": "./package.json" - }, - "files": [ - "dist/index.d.ts", - "dist/visitor-keys.d.ts", - "dist/eslint-visitor-keys.cjs", - "lib" - ], - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "devDependencies": { - "c8": "^7.7.3", - "eslint": "^7.29.0", - "eslint-config-eslint": "^7.0.0", - "eslint-plugin-jsdoc": "^35.4.0", - "eslint-plugin-node": "^11.1.0", - "eslint-release": "^3.2.0", - "mocha": "^9.0.1", - "opener": "^1.5.2", - "rollup": "^2.52.1", - "tsd": "^0.19.1", - "typescript": "^4.5.5" - }, - "scripts": { - "prepare": "npm run build", - "build": "rollup -c && npm run tsc", - "lint": "eslint .", - "tsc": "tsc", - "tsd": "tsd", - "test": "mocha tests/lib/**/*.cjs && c8 mocha tests/lib/**/*.js && npm run tsd", - "coverage": "c8 report --reporter lcov && opener coverage/lcov-report/index.html", - "generate-release": "eslint-generate-release", - "generate-alpharelease": "eslint-generate-prerelease alpha", - "generate-betarelease": "eslint-generate-prerelease beta", - "generate-rcrelease": "eslint-generate-prerelease rc", - "publish-release": "eslint-publish-release" - }, - "repository": "eslint/eslint-visitor-keys", - "keywords": [], - "author": "Toru Nagashima (https://github.com/mysticatea)", - "license": "Apache-2.0", - "bugs": { - "url": "https://github.com/eslint/eslint-visitor-keys/issues" - }, - "homepage": "https://github.com/eslint/eslint-visitor-keys#readme" -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/espree/LICENSE b/packages/wyatt_notification_bloc/example/scripts/node_modules/espree/LICENSE deleted file mode 100644 index b18469ff..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/espree/LICENSE +++ /dev/null @@ -1,25 +0,0 @@ -BSD 2-Clause License - -Copyright (c) Open JS Foundation -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/espree/README.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/espree/README.md deleted file mode 100644 index 8a38f247..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/espree/README.md +++ /dev/null @@ -1,244 +0,0 @@ -[![npm version](https://img.shields.io/npm/v/espree.svg)](https://www.npmjs.com/package/espree) -[![npm downloads](https://img.shields.io/npm/dm/espree.svg)](https://www.npmjs.com/package/espree) -[![Build Status](https://github.com/eslint/espree/workflows/CI/badge.svg)](https://github.com/eslint/espree/actions) -[![Bountysource](https://www.bountysource.com/badge/tracker?tracker_id=9348450)](https://www.bountysource.com/trackers/9348450-eslint?utm_source=9348450&utm_medium=shield&utm_campaign=TRACKER_BADGE) - -# Espree - -Espree started out as a fork of [Esprima](http://esprima.org) v1.2.2, the last stable published released of Esprima before work on ECMAScript 6 began. Espree is now built on top of [Acorn](https://github.com/ternjs/acorn), which has a modular architecture that allows extension of core functionality. The goal of Espree is to produce output that is similar to Esprima with a similar API so that it can be used in place of Esprima. - -## Usage - -Install: - -``` -npm i espree -``` - -To use in an ESM file: - -```js -import * as espree from "espree"; - -const ast = espree.parse(code); -``` - -To use in a Common JS file: - -```js -const espree = require("espree"); - -const ast = espree.parse(code); -``` - -## API - -### `parse()` - -`parse` parses the given code and returns a abstract syntax tree (AST). It takes two parameters. - -- `code` [string]() - the code which needs to be parsed. -- `options (Optional)` [Object]() - read more about this [here](#options). - -```js -import * as espree from "espree"; - -const ast = espree.parse(code); -``` - -**Example :** - -```js -const ast = espree.parse('let foo = "bar"', { ecmaVersion: 6 }); -console.log(ast); -``` - -
Output -

- -``` -Node { - type: 'Program', - start: 0, - end: 15, - body: [ - Node { - type: 'VariableDeclaration', - start: 0, - end: 15, - declarations: [Array], - kind: 'let' - } - ], - sourceType: 'script' -} -``` - -

-
- -### `tokenize()` - -`tokenize` returns the tokens of a given code. It takes two parameters. - -- `code` [string]() - the code which needs to be parsed. -- `options (Optional)` [Object]() - read more about this [here](#options). - -Even if `options` is empty or undefined or `options.tokens` is `false`, it assigns it to `true` in order to get the `tokens` array - -**Example :** - -```js -import * as espree from "espree"; - -const tokens = espree.tokenize('let foo = "bar"', { ecmaVersion: 6 }); -console.log(tokens); -``` - -
Output -

- -``` -Token { type: 'Keyword', value: 'let', start: 0, end: 3 }, -Token { type: 'Identifier', value: 'foo', start: 4, end: 7 }, -Token { type: 'Punctuator', value: '=', start: 8, end: 9 }, -Token { type: 'String', value: '"bar"', start: 10, end: 15 } -``` - -

-
- -### `version` - -Returns the current `espree` version - -### `VisitorKeys` - -Returns all visitor keys for traversing the AST from [eslint-visitor-keys](https://github.com/eslint/eslint-visitor-keys) - -### `latestEcmaVersion` - -Returns the latest ECMAScript supported by `espree` - -### `supportedEcmaVersions` - -Returns an array of all supported ECMAScript versions - -## Options - -```js -const options = { - // attach range information to each node - range: false, - - // attach line/column location information to each node - loc: false, - - // create a top-level comments array containing all comments - comment: false, - - // create a top-level tokens array containing all tokens - tokens: false, - - // Set to 3, 5 (the default), 6, 7, 8, 9, 10, 11, 12, 13 or 14 to specify the version of ECMAScript syntax you want to use. - // You can also set to 2015 (same as 6), 2016 (same as 7), 2017 (same as 8), 2018 (same as 9), 2019 (same as 10), 2020 (same as 11), 2021 (same as 12), 2022 (same as 13) or 2023 (same as 14) to use the year-based naming. - // You can also set "latest" to use the most recently supported version. - ecmaVersion: 3, - - allowReserved: true, // only allowed when ecmaVersion is 3 - - // specify which type of script you're parsing ("script", "module", or "commonjs") - sourceType: "script", - - // specify additional language features - ecmaFeatures: { - - // enable JSX parsing - jsx: false, - - // enable return in global scope (set to true automatically when sourceType is "commonjs") - globalReturn: false, - - // enable implied strict mode (if ecmaVersion >= 5) - impliedStrict: false - } -} -``` - -## Esprima Compatibility Going Forward - -The primary goal is to produce the exact same AST structure and tokens as Esprima, and that takes precedence over anything else. (The AST structure being the [ESTree](https://github.com/estree/estree) API with JSX extensions.) Separate from that, Espree may deviate from what Esprima outputs in terms of where and how comments are attached, as well as what additional information is available on AST nodes. That is to say, Espree may add more things to the AST nodes than Esprima does but the overall AST structure produced will be the same. - -Espree may also deviate from Esprima in the interface it exposes. - -## Contributing - -Issues and pull requests will be triaged and responded to as quickly as possible. We operate under the [ESLint Contributor Guidelines](http://eslint.org/docs/developer-guide/contributing), so please be sure to read them before contributing. If you're not sure where to dig in, check out the [issues](https://github.com/eslint/espree/issues). - -Espree is licensed under a permissive BSD 2-clause license. - -## Security Policy - -We work hard to ensure that Espree is safe for everyone and that security issues are addressed quickly and responsibly. Read the full [security policy](https://github.com/eslint/.github/blob/master/SECURITY.md). - -## Build Commands - -* `npm test` - run all linting and tests -* `npm run lint` - run all linting - -## Differences from Espree 2.x - -* The `tokenize()` method does not use `ecmaFeatures`. Any string will be tokenized completely based on ECMAScript 6 semantics. -* Trailing whitespace no longer is counted as part of a node. -* `let` and `const` declarations are no longer parsed by default. You must opt-in by using an `ecmaVersion` newer than `5` or setting `sourceType` to `module`. -* The `esparse` and `esvalidate` binary scripts have been removed. -* There is no `tolerant` option. We will investigate adding this back in the future. - -## Known Incompatibilities - -In an effort to help those wanting to transition from other parsers to Espree, the following is a list of noteworthy incompatibilities with other parsers. These are known differences that we do not intend to change. - -### Esprima 1.2.2 - -* Esprima counts trailing whitespace as part of each AST node while Espree does not. In Espree, the end of a node is where the last token occurs. -* Espree does not parse `let` and `const` declarations by default. -* Error messages returned for parsing errors are different. -* There are two addition properties on every node and token: `start` and `end`. These represent the same data as `range` and are used internally by Acorn. - -### Esprima 2.x - -* Esprima 2.x uses a different comment attachment algorithm that results in some comments being added in different places than Espree. The algorithm Espree uses is the same one used in Esprima 1.2.2. - -## Frequently Asked Questions - -### Why another parser - -[ESLint](http://eslint.org) had been relying on Esprima as its parser from the beginning. While that was fine when the JavaScript language was evolving slowly, the pace of development increased dramatically and Esprima had fallen behind. ESLint, like many other tools reliant on Esprima, has been stuck in using new JavaScript language features until Esprima updates, and that caused our users frustration. - -We decided the only way for us to move forward was to create our own parser, bringing us inline with JSHint and JSLint, and allowing us to keep implementing new features as we need them. We chose to fork Esprima instead of starting from scratch in order to move as quickly as possible with a compatible API. - -With Espree 2.0.0, we are no longer a fork of Esprima but rather a translation layer between Acorn and Esprima syntax. This allows us to put work back into a community-supported parser (Acorn) that is continuing to grow and evolve while maintaining an Esprima-compatible parser for those utilities still built on Esprima. - -### Have you tried working with Esprima? - -Yes. Since the start of ESLint, we've regularly filed bugs and feature requests with Esprima and will continue to do so. However, there are some different philosophies around how the projects work that need to be worked through. The initial goal was to have Espree track Esprima and eventually merge the two back together, but we ultimately decided that building on top of Acorn was a better choice due to Acorn's plugin support. - -### Why don't you just use Acorn? - -Acorn is a great JavaScript parser that produces an AST that is compatible with Esprima. Unfortunately, ESLint relies on more than just the AST to do its job. It relies on Esprima's tokens and comment attachment features to get a complete picture of the source code. We investigated switching to Acorn, but the inconsistencies between Esprima and Acorn created too much work for a project like ESLint. - -We are building on top of Acorn, however, so that we can contribute back and help make Acorn even better. - -### What ECMAScript features do you support? - -Espree supports all ECMAScript 2022 features and partially supports ECMAScript 2023 features. - -Because ECMAScript 2023 is still under development, we are implementing features as they are finalized. Currently, Espree supports: - -* [Hashbang grammar](https://github.com/tc39/proposal-hashbang) - -See [finished-proposals.md](https://github.com/tc39/proposals/blob/master/finished-proposals.md) to know what features are finalized. - -### How do you determine which experimental features to support? - -In general, we do not support experimental JavaScript features. We may make exceptions from time to time depending on the maturity of the features. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/espree/dist/espree.cjs b/packages/wyatt_notification_bloc/example/scripts/node_modules/espree/dist/espree.cjs deleted file mode 100644 index 352d595e..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/espree/dist/espree.cjs +++ /dev/null @@ -1,938 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, '__esModule', { value: true }); - -var acorn = require('acorn'); -var jsx = require('acorn-jsx'); -var visitorKeys = require('eslint-visitor-keys'); - -function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } - -function _interopNamespace(e) { - if (e && e.__esModule) return e; - var n = Object.create(null); - if (e) { - Object.keys(e).forEach(function (k) { - if (k !== 'default') { - var d = Object.getOwnPropertyDescriptor(e, k); - Object.defineProperty(n, k, d.get ? d : { - enumerable: true, - get: function () { return e[k]; } - }); - } - }); - } - n["default"] = e; - return Object.freeze(n); -} - -var acorn__namespace = /*#__PURE__*/_interopNamespace(acorn); -var jsx__default = /*#__PURE__*/_interopDefaultLegacy(jsx); -var visitorKeys__namespace = /*#__PURE__*/_interopNamespace(visitorKeys); - -/** - * @fileoverview Translates tokens between Acorn format and Esprima format. - * @author Nicholas C. Zakas - */ -/* eslint no-underscore-dangle: 0 */ - -//------------------------------------------------------------------------------ -// Requirements -//------------------------------------------------------------------------------ - -// none! - -//------------------------------------------------------------------------------ -// Private -//------------------------------------------------------------------------------ - - -// Esprima Token Types -const Token = { - Boolean: "Boolean", - EOF: "", - Identifier: "Identifier", - PrivateIdentifier: "PrivateIdentifier", - Keyword: "Keyword", - Null: "Null", - Numeric: "Numeric", - Punctuator: "Punctuator", - String: "String", - RegularExpression: "RegularExpression", - Template: "Template", - JSXIdentifier: "JSXIdentifier", - JSXText: "JSXText" -}; - -/** - * Converts part of a template into an Esprima token. - * @param {AcornToken[]} tokens The Acorn tokens representing the template. - * @param {string} code The source code. - * @returns {EsprimaToken} The Esprima equivalent of the template token. - * @private - */ -function convertTemplatePart(tokens, code) { - const firstToken = tokens[0], - lastTemplateToken = tokens[tokens.length - 1]; - - const token = { - type: Token.Template, - value: code.slice(firstToken.start, lastTemplateToken.end) - }; - - if (firstToken.loc) { - token.loc = { - start: firstToken.loc.start, - end: lastTemplateToken.loc.end - }; - } - - if (firstToken.range) { - token.start = firstToken.range[0]; - token.end = lastTemplateToken.range[1]; - token.range = [token.start, token.end]; - } - - return token; -} - -/** - * Contains logic to translate Acorn tokens into Esprima tokens. - * @param {Object} acornTokTypes The Acorn token types. - * @param {string} code The source code Acorn is parsing. This is necessary - * to correct the "value" property of some tokens. - * @constructor - */ -function TokenTranslator(acornTokTypes, code) { - - // token types - this._acornTokTypes = acornTokTypes; - - // token buffer for templates - this._tokens = []; - - // track the last curly brace - this._curlyBrace = null; - - // the source code - this._code = code; - -} - -TokenTranslator.prototype = { - constructor: TokenTranslator, - - /** - * Translates a single Esprima token to a single Acorn token. This may be - * inaccurate due to how templates are handled differently in Esprima and - * Acorn, but should be accurate for all other tokens. - * @param {AcornToken} token The Acorn token to translate. - * @param {Object} extra Espree extra object. - * @returns {EsprimaToken} The Esprima version of the token. - */ - translate(token, extra) { - - const type = token.type, - tt = this._acornTokTypes; - - if (type === tt.name) { - token.type = Token.Identifier; - - // TODO: See if this is an Acorn bug - if (token.value === "static") { - token.type = Token.Keyword; - } - - if (extra.ecmaVersion > 5 && (token.value === "yield" || token.value === "let")) { - token.type = Token.Keyword; - } - - } else if (type === tt.privateId) { - token.type = Token.PrivateIdentifier; - - } else if (type === tt.semi || type === tt.comma || - type === tt.parenL || type === tt.parenR || - type === tt.braceL || type === tt.braceR || - type === tt.dot || type === tt.bracketL || - type === tt.colon || type === tt.question || - type === tt.bracketR || type === tt.ellipsis || - type === tt.arrow || type === tt.jsxTagStart || - type === tt.incDec || type === tt.starstar || - type === tt.jsxTagEnd || type === tt.prefix || - type === tt.questionDot || - (type.binop && !type.keyword) || - type.isAssign) { - - token.type = Token.Punctuator; - token.value = this._code.slice(token.start, token.end); - } else if (type === tt.jsxName) { - token.type = Token.JSXIdentifier; - } else if (type.label === "jsxText" || type === tt.jsxAttrValueToken) { - token.type = Token.JSXText; - } else if (type.keyword) { - if (type.keyword === "true" || type.keyword === "false") { - token.type = Token.Boolean; - } else if (type.keyword === "null") { - token.type = Token.Null; - } else { - token.type = Token.Keyword; - } - } else if (type === tt.num) { - token.type = Token.Numeric; - token.value = this._code.slice(token.start, token.end); - } else if (type === tt.string) { - - if (extra.jsxAttrValueToken) { - extra.jsxAttrValueToken = false; - token.type = Token.JSXText; - } else { - token.type = Token.String; - } - - token.value = this._code.slice(token.start, token.end); - } else if (type === tt.regexp) { - token.type = Token.RegularExpression; - const value = token.value; - - token.regex = { - flags: value.flags, - pattern: value.pattern - }; - token.value = `/${value.pattern}/${value.flags}`; - } - - return token; - }, - - /** - * Function to call during Acorn's onToken handler. - * @param {AcornToken} token The Acorn token. - * @param {Object} extra The Espree extra object. - * @returns {void} - */ - onToken(token, extra) { - - const that = this, - tt = this._acornTokTypes, - tokens = extra.tokens, - templateTokens = this._tokens; - - /** - * Flushes the buffered template tokens and resets the template - * tracking. - * @returns {void} - * @private - */ - function translateTemplateTokens() { - tokens.push(convertTemplatePart(that._tokens, that._code)); - that._tokens = []; - } - - if (token.type === tt.eof) { - - // might be one last curlyBrace - if (this._curlyBrace) { - tokens.push(this.translate(this._curlyBrace, extra)); - } - - return; - } - - if (token.type === tt.backQuote) { - - // if there's already a curly, it's not part of the template - if (this._curlyBrace) { - tokens.push(this.translate(this._curlyBrace, extra)); - this._curlyBrace = null; - } - - templateTokens.push(token); - - // it's the end - if (templateTokens.length > 1) { - translateTemplateTokens(); - } - - return; - } - if (token.type === tt.dollarBraceL) { - templateTokens.push(token); - translateTemplateTokens(); - return; - } - if (token.type === tt.braceR) { - - // if there's already a curly, it's not part of the template - if (this._curlyBrace) { - tokens.push(this.translate(this._curlyBrace, extra)); - } - - // store new curly for later - this._curlyBrace = token; - return; - } - if (token.type === tt.template || token.type === tt.invalidTemplate) { - if (this._curlyBrace) { - templateTokens.push(this._curlyBrace); - this._curlyBrace = null; - } - - templateTokens.push(token); - return; - } - - if (this._curlyBrace) { - tokens.push(this.translate(this._curlyBrace, extra)); - this._curlyBrace = null; - } - - tokens.push(this.translate(token, extra)); - } -}; - -/** - * @fileoverview A collection of methods for processing Espree's options. - * @author Kai Cataldo - */ - -//------------------------------------------------------------------------------ -// Helpers -//------------------------------------------------------------------------------ - -const SUPPORTED_VERSIONS = [ - 3, - 5, - 6, // 2015 - 7, // 2016 - 8, // 2017 - 9, // 2018 - 10, // 2019 - 11, // 2020 - 12, // 2021 - 13, // 2022 - 14 // 2023 -]; - -/** - * Get the latest ECMAScript version supported by Espree. - * @returns {number} The latest ECMAScript version. - */ -function getLatestEcmaVersion() { - return SUPPORTED_VERSIONS[SUPPORTED_VERSIONS.length - 1]; -} - -/** - * Get the list of ECMAScript versions supported by Espree. - * @returns {number[]} An array containing the supported ECMAScript versions. - */ -function getSupportedEcmaVersions() { - return [...SUPPORTED_VERSIONS]; -} - -/** - * Normalize ECMAScript version from the initial config - * @param {(number|"latest")} ecmaVersion ECMAScript version from the initial config - * @throws {Error} throws an error if the ecmaVersion is invalid. - * @returns {number} normalized ECMAScript version - */ -function normalizeEcmaVersion(ecmaVersion = 5) { - - let version = ecmaVersion === "latest" ? getLatestEcmaVersion() : ecmaVersion; - - if (typeof version !== "number") { - throw new Error(`ecmaVersion must be a number or "latest". Received value of type ${typeof ecmaVersion} instead.`); - } - - // Calculate ECMAScript edition number from official year version starting with - // ES2015, which corresponds with ES6 (or a difference of 2009). - if (version >= 2015) { - version -= 2009; - } - - if (!SUPPORTED_VERSIONS.includes(version)) { - throw new Error("Invalid ecmaVersion."); - } - - return version; -} - -/** - * Normalize sourceType from the initial config - * @param {string} sourceType to normalize - * @throws {Error} throw an error if sourceType is invalid - * @returns {string} normalized sourceType - */ -function normalizeSourceType(sourceType = "script") { - if (sourceType === "script" || sourceType === "module") { - return sourceType; - } - - if (sourceType === "commonjs") { - return "script"; - } - - throw new Error("Invalid sourceType."); -} - -/** - * Normalize parserOptions - * @param {Object} options the parser options to normalize - * @throws {Error} throw an error if found invalid option. - * @returns {Object} normalized options - */ -function normalizeOptions(options) { - const ecmaVersion = normalizeEcmaVersion(options.ecmaVersion); - const sourceType = normalizeSourceType(options.sourceType); - const ranges = options.range === true; - const locations = options.loc === true; - - if (ecmaVersion !== 3 && options.allowReserved) { - - // a value of `false` is intentionally allowed here, so a shared config can overwrite it when needed - throw new Error("`allowReserved` is only supported when ecmaVersion is 3"); - } - if (typeof options.allowReserved !== "undefined" && typeof options.allowReserved !== "boolean") { - throw new Error("`allowReserved`, when present, must be `true` or `false`"); - } - const allowReserved = ecmaVersion === 3 ? (options.allowReserved || "never") : false; - const ecmaFeatures = options.ecmaFeatures || {}; - const allowReturnOutsideFunction = options.sourceType === "commonjs" || - Boolean(ecmaFeatures.globalReturn); - - if (sourceType === "module" && ecmaVersion < 6) { - throw new Error("sourceType 'module' is not supported when ecmaVersion < 2015. Consider adding `{ ecmaVersion: 2015 }` to the parser options."); - } - - return Object.assign({}, options, { - ecmaVersion, - sourceType, - ranges, - locations, - allowReserved, - allowReturnOutsideFunction - }); -} - -/* eslint-disable no-param-reassign*/ - - -const STATE = Symbol("espree's internal state"); -const ESPRIMA_FINISH_NODE = Symbol("espree's esprimaFinishNode"); - - -/** - * Converts an Acorn comment to a Esprima comment. - * @param {boolean} block True if it's a block comment, false if not. - * @param {string} text The text of the comment. - * @param {int} start The index at which the comment starts. - * @param {int} end The index at which the comment ends. - * @param {Location} startLoc The location at which the comment starts. - * @param {Location} endLoc The location at which the comment ends. - * @param {string} code The source code being parsed. - * @returns {Object} The comment object. - * @private - */ -function convertAcornCommentToEsprimaComment(block, text, start, end, startLoc, endLoc, code) { - let type; - - if (block) { - type = "Block"; - } else if (code.slice(start, start + 2) === "#!") { - type = "Hashbang"; - } else { - type = "Line"; - } - - const comment = { - type, - value: text - }; - - if (typeof start === "number") { - comment.start = start; - comment.end = end; - comment.range = [start, end]; - } - - if (typeof startLoc === "object") { - comment.loc = { - start: startLoc, - end: endLoc - }; - } - - return comment; -} - -var espree = () => Parser => { - const tokTypes = Object.assign({}, Parser.acorn.tokTypes); - - if (Parser.acornJsx) { - Object.assign(tokTypes, Parser.acornJsx.tokTypes); - } - - return class Espree extends Parser { - constructor(opts, code) { - if (typeof opts !== "object" || opts === null) { - opts = {}; - } - if (typeof code !== "string" && !(code instanceof String)) { - code = String(code); - } - - // save original source type in case of commonjs - const originalSourceType = opts.sourceType; - const options = normalizeOptions(opts); - const ecmaFeatures = options.ecmaFeatures || {}; - const tokenTranslator = - options.tokens === true - ? new TokenTranslator(tokTypes, code) - : null; - - /* - * Data that is unique to Espree and is not represented internally - * in Acorn. - * - * For ES2023 hashbangs, Espree will call `onComment()` during the - * constructor, so we must define state before having access to - * `this`. - */ - const state = { - originalSourceType: originalSourceType || options.sourceType, - tokens: tokenTranslator ? [] : null, - comments: options.comment === true ? [] : null, - impliedStrict: ecmaFeatures.impliedStrict === true && options.ecmaVersion >= 5, - ecmaVersion: options.ecmaVersion, - jsxAttrValueToken: false, - lastToken: null, - templateElements: [] - }; - - // Initialize acorn parser. - super({ - - // do not use spread, because we don't want to pass any unknown options to acorn - ecmaVersion: options.ecmaVersion, - sourceType: options.sourceType, - ranges: options.ranges, - locations: options.locations, - allowReserved: options.allowReserved, - - // Truthy value is true for backward compatibility. - allowReturnOutsideFunction: options.allowReturnOutsideFunction, - - // Collect tokens - onToken: token => { - if (tokenTranslator) { - - // Use `tokens`, `ecmaVersion`, and `jsxAttrValueToken` in the state. - tokenTranslator.onToken(token, state); - } - if (token.type !== tokTypes.eof) { - state.lastToken = token; - } - }, - - // Collect comments - onComment: (block, text, start, end, startLoc, endLoc) => { - if (state.comments) { - const comment = convertAcornCommentToEsprimaComment(block, text, start, end, startLoc, endLoc, code); - - state.comments.push(comment); - } - } - }, code); - - /* - * We put all of this data into a symbol property as a way to avoid - * potential naming conflicts with future versions of Acorn. - */ - this[STATE] = state; - } - - tokenize() { - do { - this.next(); - } while (this.type !== tokTypes.eof); - - // Consume the final eof token - this.next(); - - const extra = this[STATE]; - const tokens = extra.tokens; - - if (extra.comments) { - tokens.comments = extra.comments; - } - - return tokens; - } - - finishNode(...args) { - const result = super.finishNode(...args); - - return this[ESPRIMA_FINISH_NODE](result); - } - - finishNodeAt(...args) { - const result = super.finishNodeAt(...args); - - return this[ESPRIMA_FINISH_NODE](result); - } - - parse() { - const extra = this[STATE]; - const program = super.parse(); - - program.sourceType = extra.originalSourceType; - - if (extra.comments) { - program.comments = extra.comments; - } - if (extra.tokens) { - program.tokens = extra.tokens; - } - - /* - * Adjust opening and closing position of program to match Esprima. - * Acorn always starts programs at range 0 whereas Esprima starts at the - * first AST node's start (the only real difference is when there's leading - * whitespace or leading comments). Acorn also counts trailing whitespace - * as part of the program whereas Esprima only counts up to the last token. - */ - if (program.body.length) { - const [firstNode] = program.body; - - if (program.range) { - program.range[0] = firstNode.range[0]; - } - if (program.loc) { - program.loc.start = firstNode.loc.start; - } - program.start = firstNode.start; - } - if (extra.lastToken) { - if (program.range) { - program.range[1] = extra.lastToken.range[1]; - } - if (program.loc) { - program.loc.end = extra.lastToken.loc.end; - } - program.end = extra.lastToken.end; - } - - - /* - * https://github.com/eslint/espree/issues/349 - * Ensure that template elements have correct range information. - * This is one location where Acorn produces a different value - * for its start and end properties vs. the values present in the - * range property. In order to avoid confusion, we set the start - * and end properties to the values that are present in range. - * This is done here, instead of in finishNode(), because Acorn - * uses the values of start and end internally while parsing, making - * it dangerous to change those values while parsing is ongoing. - * By waiting until the end of parsing, we can safely change these - * values without affect any other part of the process. - */ - this[STATE].templateElements.forEach(templateElement => { - const startOffset = -1; - const endOffset = templateElement.tail ? 1 : 2; - - templateElement.start += startOffset; - templateElement.end += endOffset; - - if (templateElement.range) { - templateElement.range[0] += startOffset; - templateElement.range[1] += endOffset; - } - - if (templateElement.loc) { - templateElement.loc.start.column += startOffset; - templateElement.loc.end.column += endOffset; - } - }); - - return program; - } - - parseTopLevel(node) { - if (this[STATE].impliedStrict) { - this.strict = true; - } - return super.parseTopLevel(node); - } - - /** - * Overwrites the default raise method to throw Esprima-style errors. - * @param {int} pos The position of the error. - * @param {string} message The error message. - * @throws {SyntaxError} A syntax error. - * @returns {void} - */ - raise(pos, message) { - const loc = Parser.acorn.getLineInfo(this.input, pos); - const err = new SyntaxError(message); - - err.index = pos; - err.lineNumber = loc.line; - err.column = loc.column + 1; // acorn uses 0-based columns - throw err; - } - - /** - * Overwrites the default raise method to throw Esprima-style errors. - * @param {int} pos The position of the error. - * @param {string} message The error message. - * @throws {SyntaxError} A syntax error. - * @returns {void} - */ - raiseRecoverable(pos, message) { - this.raise(pos, message); - } - - /** - * Overwrites the default unexpected method to throw Esprima-style errors. - * @param {int} pos The position of the error. - * @throws {SyntaxError} A syntax error. - * @returns {void} - */ - unexpected(pos) { - let message = "Unexpected token"; - - if (pos !== null && pos !== void 0) { - this.pos = pos; - - if (this.options.locations) { - while (this.pos < this.lineStart) { - this.lineStart = this.input.lastIndexOf("\n", this.lineStart - 2) + 1; - --this.curLine; - } - } - - this.nextToken(); - } - - if (this.end > this.start) { - message += ` ${this.input.slice(this.start, this.end)}`; - } - - this.raise(this.start, message); - } - - /* - * Esprima-FB represents JSX strings as tokens called "JSXText", but Acorn-JSX - * uses regular tt.string without any distinction between this and regular JS - * strings. As such, we intercept an attempt to read a JSX string and set a flag - * on extra so that when tokens are converted, the next token will be switched - * to JSXText via onToken. - */ - jsx_readString(quote) { // eslint-disable-line camelcase - const result = super.jsx_readString(quote); - - if (this.type === tokTypes.string) { - this[STATE].jsxAttrValueToken = true; - } - return result; - } - - /** - * Performs last-minute Esprima-specific compatibility checks and fixes. - * @param {ASTNode} result The node to check. - * @returns {ASTNode} The finished node. - */ - [ESPRIMA_FINISH_NODE](result) { - - // Acorn doesn't count the opening and closing backticks as part of templates - // so we have to adjust ranges/locations appropriately. - if (result.type === "TemplateElement") { - - // save template element references to fix start/end later - this[STATE].templateElements.push(result); - } - - if (result.type.includes("Function") && !result.generator) { - result.generator = false; - } - - return result; - } - }; -}; - -const version$1 = "9.4.1"; - -/** - * @fileoverview Main Espree file that converts Acorn into Esprima output. - * - * This file contains code from the following MIT-licensed projects: - * 1. Acorn - * 2. Babylon - * 3. Babel-ESLint - * - * This file also contains code from Esprima, which is BSD licensed. - * - * Acorn is Copyright 2012-2015 Acorn Contributors (https://github.com/marijnh/acorn/blob/master/AUTHORS) - * Babylon is Copyright 2014-2015 various contributors (https://github.com/babel/babel/blob/master/packages/babylon/AUTHORS) - * Babel-ESLint is Copyright 2014-2015 Sebastian McKenzie - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Esprima is Copyright (c) jQuery Foundation, Inc. and Contributors, All Rights Reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - - -// To initialize lazily. -const parsers = { - _regular: null, - _jsx: null, - - get regular() { - if (this._regular === null) { - this._regular = acorn__namespace.Parser.extend(espree()); - } - return this._regular; - }, - - get jsx() { - if (this._jsx === null) { - this._jsx = acorn__namespace.Parser.extend(jsx__default["default"](), espree()); - } - return this._jsx; - }, - - get(options) { - const useJsx = Boolean( - options && - options.ecmaFeatures && - options.ecmaFeatures.jsx - ); - - return useJsx ? this.jsx : this.regular; - } -}; - -//------------------------------------------------------------------------------ -// Tokenizer -//------------------------------------------------------------------------------ - -/** - * Tokenizes the given code. - * @param {string} code The code to tokenize. - * @param {Object} options Options defining how to tokenize. - * @returns {Token[]} An array of tokens. - * @throws {SyntaxError} If the input code is invalid. - * @private - */ -function tokenize(code, options) { - const Parser = parsers.get(options); - - // Ensure to collect tokens. - if (!options || options.tokens !== true) { - options = Object.assign({}, options, { tokens: true }); // eslint-disable-line no-param-reassign - } - - return new Parser(options, code).tokenize(); -} - -//------------------------------------------------------------------------------ -// Parser -//------------------------------------------------------------------------------ - -/** - * Parses the given code. - * @param {string} code The code to tokenize. - * @param {Object} options Options defining how to tokenize. - * @returns {ASTNode} The "Program" AST node. - * @throws {SyntaxError} If the input code is invalid. - */ -function parse(code, options) { - const Parser = parsers.get(options); - - return new Parser(options, code).parse(); -} - -//------------------------------------------------------------------------------ -// Public -//------------------------------------------------------------------------------ - -const version = version$1; - -/* istanbul ignore next */ -const VisitorKeys = (function() { - return visitorKeys__namespace.KEYS; -}()); - -// Derive node types from VisitorKeys -/* istanbul ignore next */ -const Syntax = (function() { - let name, - types = {}; - - if (typeof Object.create === "function") { - types = Object.create(null); - } - - for (name in VisitorKeys) { - if (Object.hasOwnProperty.call(VisitorKeys, name)) { - types[name] = name; - } - } - - if (typeof Object.freeze === "function") { - Object.freeze(types); - } - - return types; -}()); - -const latestEcmaVersion = getLatestEcmaVersion(); - -const supportedEcmaVersions = getSupportedEcmaVersions(); - -exports.Syntax = Syntax; -exports.VisitorKeys = VisitorKeys; -exports.latestEcmaVersion = latestEcmaVersion; -exports.parse = parse; -exports.supportedEcmaVersions = supportedEcmaVersions; -exports.tokenize = tokenize; -exports.version = version; -//# sourceMappingURL=espree.cjs.map diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/espree/espree.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/espree/espree.js deleted file mode 100644 index 71e3d47d..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/espree/espree.js +++ /dev/null @@ -1,173 +0,0 @@ -/** - * @fileoverview Main Espree file that converts Acorn into Esprima output. - * - * This file contains code from the following MIT-licensed projects: - * 1. Acorn - * 2. Babylon - * 3. Babel-ESLint - * - * This file also contains code from Esprima, which is BSD licensed. - * - * Acorn is Copyright 2012-2015 Acorn Contributors (https://github.com/marijnh/acorn/blob/master/AUTHORS) - * Babylon is Copyright 2014-2015 various contributors (https://github.com/babel/babel/blob/master/packages/babylon/AUTHORS) - * Babel-ESLint is Copyright 2014-2015 Sebastian McKenzie - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Esprima is Copyright (c) jQuery Foundation, Inc. and Contributors, All Rights Reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -/* eslint no-undefined:0, no-use-before-define: 0 */ - -import * as acorn from "acorn"; -import jsx from "acorn-jsx"; -import espree from "./lib/espree.js"; -import espreeVersion from "./lib/version.js"; -import * as visitorKeys from "eslint-visitor-keys"; -import { getLatestEcmaVersion, getSupportedEcmaVersions } from "./lib/options.js"; - - -// To initialize lazily. -const parsers = { - _regular: null, - _jsx: null, - - get regular() { - if (this._regular === null) { - this._regular = acorn.Parser.extend(espree()); - } - return this._regular; - }, - - get jsx() { - if (this._jsx === null) { - this._jsx = acorn.Parser.extend(jsx(), espree()); - } - return this._jsx; - }, - - get(options) { - const useJsx = Boolean( - options && - options.ecmaFeatures && - options.ecmaFeatures.jsx - ); - - return useJsx ? this.jsx : this.regular; - } -}; - -//------------------------------------------------------------------------------ -// Tokenizer -//------------------------------------------------------------------------------ - -/** - * Tokenizes the given code. - * @param {string} code The code to tokenize. - * @param {Object} options Options defining how to tokenize. - * @returns {Token[]} An array of tokens. - * @throws {SyntaxError} If the input code is invalid. - * @private - */ -export function tokenize(code, options) { - const Parser = parsers.get(options); - - // Ensure to collect tokens. - if (!options || options.tokens !== true) { - options = Object.assign({}, options, { tokens: true }); // eslint-disable-line no-param-reassign - } - - return new Parser(options, code).tokenize(); -} - -//------------------------------------------------------------------------------ -// Parser -//------------------------------------------------------------------------------ - -/** - * Parses the given code. - * @param {string} code The code to tokenize. - * @param {Object} options Options defining how to tokenize. - * @returns {ASTNode} The "Program" AST node. - * @throws {SyntaxError} If the input code is invalid. - */ -export function parse(code, options) { - const Parser = parsers.get(options); - - return new Parser(options, code).parse(); -} - -//------------------------------------------------------------------------------ -// Public -//------------------------------------------------------------------------------ - -export const version = espreeVersion; - -/* istanbul ignore next */ -export const VisitorKeys = (function() { - return visitorKeys.KEYS; -}()); - -// Derive node types from VisitorKeys -/* istanbul ignore next */ -export const Syntax = (function() { - let name, - types = {}; - - if (typeof Object.create === "function") { - types = Object.create(null); - } - - for (name in VisitorKeys) { - if (Object.hasOwnProperty.call(VisitorKeys, name)) { - types[name] = name; - } - } - - if (typeof Object.freeze === "function") { - Object.freeze(types); - } - - return types; -}()); - -export const latestEcmaVersion = getLatestEcmaVersion(); - -export const supportedEcmaVersions = getSupportedEcmaVersions(); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/espree/lib/espree.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/espree/lib/espree.js deleted file mode 100644 index 262dd276..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/espree/lib/espree.js +++ /dev/null @@ -1,348 +0,0 @@ -/* eslint-disable no-param-reassign*/ -import TokenTranslator from "./token-translator.js"; -import { normalizeOptions } from "./options.js"; - - -const STATE = Symbol("espree's internal state"); -const ESPRIMA_FINISH_NODE = Symbol("espree's esprimaFinishNode"); - - -/** - * Converts an Acorn comment to a Esprima comment. - * @param {boolean} block True if it's a block comment, false if not. - * @param {string} text The text of the comment. - * @param {int} start The index at which the comment starts. - * @param {int} end The index at which the comment ends. - * @param {Location} startLoc The location at which the comment starts. - * @param {Location} endLoc The location at which the comment ends. - * @param {string} code The source code being parsed. - * @returns {Object} The comment object. - * @private - */ -function convertAcornCommentToEsprimaComment(block, text, start, end, startLoc, endLoc, code) { - let type; - - if (block) { - type = "Block"; - } else if (code.slice(start, start + 2) === "#!") { - type = "Hashbang"; - } else { - type = "Line"; - } - - const comment = { - type, - value: text - }; - - if (typeof start === "number") { - comment.start = start; - comment.end = end; - comment.range = [start, end]; - } - - if (typeof startLoc === "object") { - comment.loc = { - start: startLoc, - end: endLoc - }; - } - - return comment; -} - -export default () => Parser => { - const tokTypes = Object.assign({}, Parser.acorn.tokTypes); - - if (Parser.acornJsx) { - Object.assign(tokTypes, Parser.acornJsx.tokTypes); - } - - return class Espree extends Parser { - constructor(opts, code) { - if (typeof opts !== "object" || opts === null) { - opts = {}; - } - if (typeof code !== "string" && !(code instanceof String)) { - code = String(code); - } - - // save original source type in case of commonjs - const originalSourceType = opts.sourceType; - const options = normalizeOptions(opts); - const ecmaFeatures = options.ecmaFeatures || {}; - const tokenTranslator = - options.tokens === true - ? new TokenTranslator(tokTypes, code) - : null; - - /* - * Data that is unique to Espree and is not represented internally - * in Acorn. - * - * For ES2023 hashbangs, Espree will call `onComment()` during the - * constructor, so we must define state before having access to - * `this`. - */ - const state = { - originalSourceType: originalSourceType || options.sourceType, - tokens: tokenTranslator ? [] : null, - comments: options.comment === true ? [] : null, - impliedStrict: ecmaFeatures.impliedStrict === true && options.ecmaVersion >= 5, - ecmaVersion: options.ecmaVersion, - jsxAttrValueToken: false, - lastToken: null, - templateElements: [] - }; - - // Initialize acorn parser. - super({ - - // do not use spread, because we don't want to pass any unknown options to acorn - ecmaVersion: options.ecmaVersion, - sourceType: options.sourceType, - ranges: options.ranges, - locations: options.locations, - allowReserved: options.allowReserved, - - // Truthy value is true for backward compatibility. - allowReturnOutsideFunction: options.allowReturnOutsideFunction, - - // Collect tokens - onToken: token => { - if (tokenTranslator) { - - // Use `tokens`, `ecmaVersion`, and `jsxAttrValueToken` in the state. - tokenTranslator.onToken(token, state); - } - if (token.type !== tokTypes.eof) { - state.lastToken = token; - } - }, - - // Collect comments - onComment: (block, text, start, end, startLoc, endLoc) => { - if (state.comments) { - const comment = convertAcornCommentToEsprimaComment(block, text, start, end, startLoc, endLoc, code); - - state.comments.push(comment); - } - } - }, code); - - /* - * We put all of this data into a symbol property as a way to avoid - * potential naming conflicts with future versions of Acorn. - */ - this[STATE] = state; - } - - tokenize() { - do { - this.next(); - } while (this.type !== tokTypes.eof); - - // Consume the final eof token - this.next(); - - const extra = this[STATE]; - const tokens = extra.tokens; - - if (extra.comments) { - tokens.comments = extra.comments; - } - - return tokens; - } - - finishNode(...args) { - const result = super.finishNode(...args); - - return this[ESPRIMA_FINISH_NODE](result); - } - - finishNodeAt(...args) { - const result = super.finishNodeAt(...args); - - return this[ESPRIMA_FINISH_NODE](result); - } - - parse() { - const extra = this[STATE]; - const program = super.parse(); - - program.sourceType = extra.originalSourceType; - - if (extra.comments) { - program.comments = extra.comments; - } - if (extra.tokens) { - program.tokens = extra.tokens; - } - - /* - * Adjust opening and closing position of program to match Esprima. - * Acorn always starts programs at range 0 whereas Esprima starts at the - * first AST node's start (the only real difference is when there's leading - * whitespace or leading comments). Acorn also counts trailing whitespace - * as part of the program whereas Esprima only counts up to the last token. - */ - if (program.body.length) { - const [firstNode] = program.body; - - if (program.range) { - program.range[0] = firstNode.range[0]; - } - if (program.loc) { - program.loc.start = firstNode.loc.start; - } - program.start = firstNode.start; - } - if (extra.lastToken) { - if (program.range) { - program.range[1] = extra.lastToken.range[1]; - } - if (program.loc) { - program.loc.end = extra.lastToken.loc.end; - } - program.end = extra.lastToken.end; - } - - - /* - * https://github.com/eslint/espree/issues/349 - * Ensure that template elements have correct range information. - * This is one location where Acorn produces a different value - * for its start and end properties vs. the values present in the - * range property. In order to avoid confusion, we set the start - * and end properties to the values that are present in range. - * This is done here, instead of in finishNode(), because Acorn - * uses the values of start and end internally while parsing, making - * it dangerous to change those values while parsing is ongoing. - * By waiting until the end of parsing, we can safely change these - * values without affect any other part of the process. - */ - this[STATE].templateElements.forEach(templateElement => { - const startOffset = -1; - const endOffset = templateElement.tail ? 1 : 2; - - templateElement.start += startOffset; - templateElement.end += endOffset; - - if (templateElement.range) { - templateElement.range[0] += startOffset; - templateElement.range[1] += endOffset; - } - - if (templateElement.loc) { - templateElement.loc.start.column += startOffset; - templateElement.loc.end.column += endOffset; - } - }); - - return program; - } - - parseTopLevel(node) { - if (this[STATE].impliedStrict) { - this.strict = true; - } - return super.parseTopLevel(node); - } - - /** - * Overwrites the default raise method to throw Esprima-style errors. - * @param {int} pos The position of the error. - * @param {string} message The error message. - * @throws {SyntaxError} A syntax error. - * @returns {void} - */ - raise(pos, message) { - const loc = Parser.acorn.getLineInfo(this.input, pos); - const err = new SyntaxError(message); - - err.index = pos; - err.lineNumber = loc.line; - err.column = loc.column + 1; // acorn uses 0-based columns - throw err; - } - - /** - * Overwrites the default raise method to throw Esprima-style errors. - * @param {int} pos The position of the error. - * @param {string} message The error message. - * @throws {SyntaxError} A syntax error. - * @returns {void} - */ - raiseRecoverable(pos, message) { - this.raise(pos, message); - } - - /** - * Overwrites the default unexpected method to throw Esprima-style errors. - * @param {int} pos The position of the error. - * @throws {SyntaxError} A syntax error. - * @returns {void} - */ - unexpected(pos) { - let message = "Unexpected token"; - - if (pos !== null && pos !== void 0) { - this.pos = pos; - - if (this.options.locations) { - while (this.pos < this.lineStart) { - this.lineStart = this.input.lastIndexOf("\n", this.lineStart - 2) + 1; - --this.curLine; - } - } - - this.nextToken(); - } - - if (this.end > this.start) { - message += ` ${this.input.slice(this.start, this.end)}`; - } - - this.raise(this.start, message); - } - - /* - * Esprima-FB represents JSX strings as tokens called "JSXText", but Acorn-JSX - * uses regular tt.string without any distinction between this and regular JS - * strings. As such, we intercept an attempt to read a JSX string and set a flag - * on extra so that when tokens are converted, the next token will be switched - * to JSXText via onToken. - */ - jsx_readString(quote) { // eslint-disable-line camelcase - const result = super.jsx_readString(quote); - - if (this.type === tokTypes.string) { - this[STATE].jsxAttrValueToken = true; - } - return result; - } - - /** - * Performs last-minute Esprima-specific compatibility checks and fixes. - * @param {ASTNode} result The node to check. - * @returns {ASTNode} The finished node. - */ - [ESPRIMA_FINISH_NODE](result) { - - // Acorn doesn't count the opening and closing backticks as part of templates - // so we have to adjust ranges/locations appropriately. - if (result.type === "TemplateElement") { - - // save template element references to fix start/end later - this[STATE].templateElements.push(result); - } - - if (result.type.includes("Function") && !result.generator) { - result.generator = false; - } - - return result; - } - }; -}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/espree/lib/features.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/espree/lib/features.js deleted file mode 100644 index 31467d28..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/espree/lib/features.js +++ /dev/null @@ -1,27 +0,0 @@ -/** - * @fileoverview The list of feature flags supported by the parser and their default - * settings. - * @author Nicholas C. Zakas - */ - -//------------------------------------------------------------------------------ -// Requirements -//------------------------------------------------------------------------------ - -// None! - -//------------------------------------------------------------------------------ -// Public -//------------------------------------------------------------------------------ - -export default { - - // React JSX parsing - jsx: false, - - // allow return statement in global scope - globalReturn: false, - - // allow implied strict mode - impliedStrict: false -}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/espree/lib/options.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/espree/lib/options.js deleted file mode 100644 index d2848072..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/espree/lib/options.js +++ /dev/null @@ -1,122 +0,0 @@ -/** - * @fileoverview A collection of methods for processing Espree's options. - * @author Kai Cataldo - */ - -//------------------------------------------------------------------------------ -// Helpers -//------------------------------------------------------------------------------ - -const SUPPORTED_VERSIONS = [ - 3, - 5, - 6, // 2015 - 7, // 2016 - 8, // 2017 - 9, // 2018 - 10, // 2019 - 11, // 2020 - 12, // 2021 - 13, // 2022 - 14 // 2023 -]; - -/** - * Get the latest ECMAScript version supported by Espree. - * @returns {number} The latest ECMAScript version. - */ -export function getLatestEcmaVersion() { - return SUPPORTED_VERSIONS[SUPPORTED_VERSIONS.length - 1]; -} - -/** - * Get the list of ECMAScript versions supported by Espree. - * @returns {number[]} An array containing the supported ECMAScript versions. - */ -export function getSupportedEcmaVersions() { - return [...SUPPORTED_VERSIONS]; -} - -/** - * Normalize ECMAScript version from the initial config - * @param {(number|"latest")} ecmaVersion ECMAScript version from the initial config - * @throws {Error} throws an error if the ecmaVersion is invalid. - * @returns {number} normalized ECMAScript version - */ -function normalizeEcmaVersion(ecmaVersion = 5) { - - let version = ecmaVersion === "latest" ? getLatestEcmaVersion() : ecmaVersion; - - if (typeof version !== "number") { - throw new Error(`ecmaVersion must be a number or "latest". Received value of type ${typeof ecmaVersion} instead.`); - } - - // Calculate ECMAScript edition number from official year version starting with - // ES2015, which corresponds with ES6 (or a difference of 2009). - if (version >= 2015) { - version -= 2009; - } - - if (!SUPPORTED_VERSIONS.includes(version)) { - throw new Error("Invalid ecmaVersion."); - } - - return version; -} - -/** - * Normalize sourceType from the initial config - * @param {string} sourceType to normalize - * @throws {Error} throw an error if sourceType is invalid - * @returns {string} normalized sourceType - */ -function normalizeSourceType(sourceType = "script") { - if (sourceType === "script" || sourceType === "module") { - return sourceType; - } - - if (sourceType === "commonjs") { - return "script"; - } - - throw new Error("Invalid sourceType."); -} - -/** - * Normalize parserOptions - * @param {Object} options the parser options to normalize - * @throws {Error} throw an error if found invalid option. - * @returns {Object} normalized options - */ -export function normalizeOptions(options) { - const ecmaVersion = normalizeEcmaVersion(options.ecmaVersion); - const sourceType = normalizeSourceType(options.sourceType); - const ranges = options.range === true; - const locations = options.loc === true; - - if (ecmaVersion !== 3 && options.allowReserved) { - - // a value of `false` is intentionally allowed here, so a shared config can overwrite it when needed - throw new Error("`allowReserved` is only supported when ecmaVersion is 3"); - } - if (typeof options.allowReserved !== "undefined" && typeof options.allowReserved !== "boolean") { - throw new Error("`allowReserved`, when present, must be `true` or `false`"); - } - const allowReserved = ecmaVersion === 3 ? (options.allowReserved || "never") : false; - const ecmaFeatures = options.ecmaFeatures || {}; - const allowReturnOutsideFunction = options.sourceType === "commonjs" || - Boolean(ecmaFeatures.globalReturn); - - if (sourceType === "module" && ecmaVersion < 6) { - throw new Error("sourceType 'module' is not supported when ecmaVersion < 2015. Consider adding `{ ecmaVersion: 2015 }` to the parser options."); - } - - return Object.assign({}, options, { - ecmaVersion, - sourceType, - ranges, - locations, - allowReserved, - allowReturnOutsideFunction - }); -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/espree/lib/token-translator.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/espree/lib/token-translator.js deleted file mode 100644 index 9aa5e22e..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/espree/lib/token-translator.js +++ /dev/null @@ -1,265 +0,0 @@ -/** - * @fileoverview Translates tokens between Acorn format and Esprima format. - * @author Nicholas C. Zakas - */ -/* eslint no-underscore-dangle: 0 */ - -//------------------------------------------------------------------------------ -// Requirements -//------------------------------------------------------------------------------ - -// none! - -//------------------------------------------------------------------------------ -// Private -//------------------------------------------------------------------------------ - - -// Esprima Token Types -const Token = { - Boolean: "Boolean", - EOF: "", - Identifier: "Identifier", - PrivateIdentifier: "PrivateIdentifier", - Keyword: "Keyword", - Null: "Null", - Numeric: "Numeric", - Punctuator: "Punctuator", - String: "String", - RegularExpression: "RegularExpression", - Template: "Template", - JSXIdentifier: "JSXIdentifier", - JSXText: "JSXText" -}; - -/** - * Converts part of a template into an Esprima token. - * @param {AcornToken[]} tokens The Acorn tokens representing the template. - * @param {string} code The source code. - * @returns {EsprimaToken} The Esprima equivalent of the template token. - * @private - */ -function convertTemplatePart(tokens, code) { - const firstToken = tokens[0], - lastTemplateToken = tokens[tokens.length - 1]; - - const token = { - type: Token.Template, - value: code.slice(firstToken.start, lastTemplateToken.end) - }; - - if (firstToken.loc) { - token.loc = { - start: firstToken.loc.start, - end: lastTemplateToken.loc.end - }; - } - - if (firstToken.range) { - token.start = firstToken.range[0]; - token.end = lastTemplateToken.range[1]; - token.range = [token.start, token.end]; - } - - return token; -} - -/** - * Contains logic to translate Acorn tokens into Esprima tokens. - * @param {Object} acornTokTypes The Acorn token types. - * @param {string} code The source code Acorn is parsing. This is necessary - * to correct the "value" property of some tokens. - * @constructor - */ -function TokenTranslator(acornTokTypes, code) { - - // token types - this._acornTokTypes = acornTokTypes; - - // token buffer for templates - this._tokens = []; - - // track the last curly brace - this._curlyBrace = null; - - // the source code - this._code = code; - -} - -TokenTranslator.prototype = { - constructor: TokenTranslator, - - /** - * Translates a single Esprima token to a single Acorn token. This may be - * inaccurate due to how templates are handled differently in Esprima and - * Acorn, but should be accurate for all other tokens. - * @param {AcornToken} token The Acorn token to translate. - * @param {Object} extra Espree extra object. - * @returns {EsprimaToken} The Esprima version of the token. - */ - translate(token, extra) { - - const type = token.type, - tt = this._acornTokTypes; - - if (type === tt.name) { - token.type = Token.Identifier; - - // TODO: See if this is an Acorn bug - if (token.value === "static") { - token.type = Token.Keyword; - } - - if (extra.ecmaVersion > 5 && (token.value === "yield" || token.value === "let")) { - token.type = Token.Keyword; - } - - } else if (type === tt.privateId) { - token.type = Token.PrivateIdentifier; - - } else if (type === tt.semi || type === tt.comma || - type === tt.parenL || type === tt.parenR || - type === tt.braceL || type === tt.braceR || - type === tt.dot || type === tt.bracketL || - type === tt.colon || type === tt.question || - type === tt.bracketR || type === tt.ellipsis || - type === tt.arrow || type === tt.jsxTagStart || - type === tt.incDec || type === tt.starstar || - type === tt.jsxTagEnd || type === tt.prefix || - type === tt.questionDot || - (type.binop && !type.keyword) || - type.isAssign) { - - token.type = Token.Punctuator; - token.value = this._code.slice(token.start, token.end); - } else if (type === tt.jsxName) { - token.type = Token.JSXIdentifier; - } else if (type.label === "jsxText" || type === tt.jsxAttrValueToken) { - token.type = Token.JSXText; - } else if (type.keyword) { - if (type.keyword === "true" || type.keyword === "false") { - token.type = Token.Boolean; - } else if (type.keyword === "null") { - token.type = Token.Null; - } else { - token.type = Token.Keyword; - } - } else if (type === tt.num) { - token.type = Token.Numeric; - token.value = this._code.slice(token.start, token.end); - } else if (type === tt.string) { - - if (extra.jsxAttrValueToken) { - extra.jsxAttrValueToken = false; - token.type = Token.JSXText; - } else { - token.type = Token.String; - } - - token.value = this._code.slice(token.start, token.end); - } else if (type === tt.regexp) { - token.type = Token.RegularExpression; - const value = token.value; - - token.regex = { - flags: value.flags, - pattern: value.pattern - }; - token.value = `/${value.pattern}/${value.flags}`; - } - - return token; - }, - - /** - * Function to call during Acorn's onToken handler. - * @param {AcornToken} token The Acorn token. - * @param {Object} extra The Espree extra object. - * @returns {void} - */ - onToken(token, extra) { - - const that = this, - tt = this._acornTokTypes, - tokens = extra.tokens, - templateTokens = this._tokens; - - /** - * Flushes the buffered template tokens and resets the template - * tracking. - * @returns {void} - * @private - */ - function translateTemplateTokens() { - tokens.push(convertTemplatePart(that._tokens, that._code)); - that._tokens = []; - } - - if (token.type === tt.eof) { - - // might be one last curlyBrace - if (this._curlyBrace) { - tokens.push(this.translate(this._curlyBrace, extra)); - } - - return; - } - - if (token.type === tt.backQuote) { - - // if there's already a curly, it's not part of the template - if (this._curlyBrace) { - tokens.push(this.translate(this._curlyBrace, extra)); - this._curlyBrace = null; - } - - templateTokens.push(token); - - // it's the end - if (templateTokens.length > 1) { - translateTemplateTokens(); - } - - return; - } - if (token.type === tt.dollarBraceL) { - templateTokens.push(token); - translateTemplateTokens(); - return; - } - if (token.type === tt.braceR) { - - // if there's already a curly, it's not part of the template - if (this._curlyBrace) { - tokens.push(this.translate(this._curlyBrace, extra)); - } - - // store new curly for later - this._curlyBrace = token; - return; - } - if (token.type === tt.template || token.type === tt.invalidTemplate) { - if (this._curlyBrace) { - templateTokens.push(this._curlyBrace); - this._curlyBrace = null; - } - - templateTokens.push(token); - return; - } - - if (this._curlyBrace) { - tokens.push(this.translate(this._curlyBrace, extra)); - this._curlyBrace = null; - } - - tokens.push(this.translate(token, extra)); - } -}; - -//------------------------------------------------------------------------------ -// Public -//------------------------------------------------------------------------------ - -export default TokenTranslator; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/espree/lib/version.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/espree/lib/version.js deleted file mode 100644 index 2175f85a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/espree/lib/version.js +++ /dev/null @@ -1,3 +0,0 @@ -const version = "9.4.1"; - -export default version; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/espree/package.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/espree/package.json deleted file mode 100644 index 8f2b06c1..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/espree/package.json +++ /dev/null @@ -1,82 +0,0 @@ -{ - "name": "espree", - "description": "An Esprima-compatible JavaScript parser built on Acorn", - "author": "Nicholas C. Zakas ", - "homepage": "https://github.com/eslint/espree", - "main": "dist/espree.cjs", - "type": "module", - "exports": { - ".": [ - { - "import": "./espree.js", - "require": "./dist/espree.cjs", - "default": "./dist/espree.cjs" - }, - "./dist/espree.cjs" - ], - "./package.json": "./package.json" - }, - "version": "9.4.1", - "files": [ - "lib", - "dist/espree.cjs", - "espree.js" - ], - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "repository": "eslint/espree", - "bugs": { - "url": "https://github.com/eslint/espree/issues" - }, - "funding": "https://opencollective.com/eslint", - "license": "BSD-2-Clause", - "dependencies": { - "acorn": "^8.8.0", - "acorn-jsx": "^5.3.2", - "eslint-visitor-keys": "^3.3.0" - }, - "devDependencies": { - "@rollup/plugin-commonjs": "^17.1.0", - "@rollup/plugin-json": "^4.1.0", - "@rollup/plugin-node-resolve": "^11.2.0", - "c8": "^7.11.0", - "chai": "^4.3.6", - "eslint": "^8.13.0", - "eslint-config-eslint": "^7.0.0", - "eslint-plugin-jsdoc": "^39.2.4", - "eslint-plugin-node": "^11.1.0", - "eslint-release": "^3.2.0", - "esprima-fb": "^8001.2001.0-dev-harmony-fb", - "mocha": "^9.2.2", - "npm-run-all": "^4.1.5", - "rollup": "^2.41.2", - "shelljs": "^0.3.0" - }, - "keywords": [ - "ast", - "ecmascript", - "javascript", - "parser", - "syntax", - "acorn" - ], - "scripts": { - "unit": "npm-run-all -s unit:*", - "unit:esm": "c8 mocha --color --reporter progress --timeout 30000 'tests/lib/**/*.js'", - "unit:cjs": "mocha --color --reporter progress --timeout 30000 tests/lib/commonjs.cjs", - "test": "npm-run-all -p unit lint", - "lint": "eslint .", - "fixlint": "npm run lint -- --fix", - "build": "rollup -c rollup.config.js", - "update-version": "node tools/update-version.js", - "pretest": "npm run build", - "prepublishOnly": "npm run update-version && npm run build", - "sync-docs": "node sync-docs.js", - "generate-release": "eslint-generate-release", - "generate-alpharelease": "eslint-generate-prerelease alpha", - "generate-betarelease": "eslint-generate-prerelease beta", - "generate-rcrelease": "eslint-generate-prerelease rc", - "publish-release": "eslint-publish-release" - } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/esprima/ChangeLog b/packages/wyatt_notification_bloc/example/scripts/node_modules/esprima/ChangeLog deleted file mode 100644 index fafe1c98..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/esprima/ChangeLog +++ /dev/null @@ -1,235 +0,0 @@ -2018-06-17: Version 4.0.1 - - * Fix parsing async get/set in a class (issue 1861, 1875) - * Account for different return statement argument (issue 1829, 1897, 1928) - * Correct the handling of HTML comment when parsing a module (issue 1841) - * Fix incorrect parse async with proto-identifier-shorthand (issue 1847) - * Fix negative column in binary expression (issue 1844) - * Fix incorrect YieldExpression in object methods (issue 1834) - * Various documentation fixes - -2017-06-10: Version 4.0.0 - - * Support ES2017 async function and await expression (issue 1079) - * Support ES2017 trailing commas in function parameters (issue 1550) - * Explicitly distinguish parsing a module vs a script (issue 1576) - * Fix JSX non-empty container (issue 1786) - * Allow JSX element in a yield expression (issue 1765) - * Allow `in` expression in a concise body with a function body (issue 1793) - * Setter function argument must not be a rest parameter (issue 1693) - * Limit strict mode directive to functions with a simple parameter list (issue 1677) - * Prohibit any escape sequence in a reserved word (issue 1612) - * Only permit hex digits in hex escape sequence (issue 1619) - * Prohibit labelled class/generator/function declaration (issue 1484) - * Limit function declaration as if statement clause only in non-strict mode (issue 1657) - * Tolerate missing ) in a with and do-while statement (issue 1481) - -2016-12-22: Version 3.1.3 - - * Support binding patterns as rest element (issue 1681) - * Account for different possible arguments of a yield expression (issue 1469) - -2016-11-24: Version 3.1.2 - - * Ensure that import specifier is more restrictive (issue 1615) - * Fix duplicated JSX tokens (issue 1613) - * Scan template literal in a JSX expression container (issue 1622) - * Improve XHTML entity scanning in JSX (issue 1629) - -2016-10-31: Version 3.1.1 - - * Fix assignment expression problem in an export declaration (issue 1596) - * Fix incorrect tokenization of hex digits (issue 1605) - -2016-10-09: Version 3.1.0 - - * Do not implicitly collect comments when comment attachment is specified (issue 1553) - * Fix incorrect handling of duplicated proto shorthand fields (issue 1485) - * Prohibit initialization in some variants of for statements (issue 1309, 1561) - * Fix incorrect parsing of export specifier (issue 1578) - * Fix ESTree compatibility for assignment pattern (issue 1575) - -2016-09-03: Version 3.0.0 - - * Support ES2016 exponentiation expression (issue 1490) - * Support JSX syntax (issue 1467) - * Use the latest Unicode 8.0 (issue 1475) - * Add the support for syntax node delegate (issue 1435) - * Fix ESTree compatibility on meta property (issue 1338) - * Fix ESTree compatibility on default parameter value (issue 1081) - * Fix ESTree compatibility on try handler (issue 1030) - -2016-08-23: Version 2.7.3 - - * Fix tokenizer confusion with a comment (issue 1493, 1516) - -2016-02-02: Version 2.7.2 - - * Fix out-of-bound error location in an invalid string literal (issue 1457) - * Fix shorthand object destructuring defaults in variable declarations (issue 1459) - -2015-12-10: Version 2.7.1 - - * Do not allow trailing comma in a variable declaration (issue 1360) - * Fix assignment to `let` in non-strict mode (issue 1376) - * Fix missing delegate property in YieldExpression (issue 1407) - -2015-10-22: Version 2.7.0 - - * Fix the handling of semicolon in a break statement (issue 1044) - * Run the test suite with major web browsers (issue 1259, 1317) - * Allow `let` as an identifier in non-strict mode (issue 1289) - * Attach orphaned comments as `innerComments` (issue 1328) - * Add the support for token delegator (issue 1332) - -2015-09-01: Version 2.6.0 - - * Properly allow or prohibit `let` in a binding identifier/pattern (issue 1048, 1098) - * Add sourceType field for Program node (issue 1159) - * Ensure that strict mode reserved word binding throw an error (issue 1171) - * Run the test suite with Node.js and IE 11 on Windows (issue 1294) - * Allow binding pattern with no initializer in a for statement (issue 1301) - -2015-07-31: Version 2.5.0 - - * Run the test suite in a browser environment (issue 1004) - * Ensure a comma between imported default binding and named imports (issue 1046) - * Distinguish `yield` as a keyword vs an identifier (issue 1186) - * Support ES6 meta property `new.target` (issue 1203) - * Fix the syntax node for yield with expression (issue 1223) - * Fix the check of duplicated proto in property names (issue 1225) - * Fix ES6 Unicode escape in identifier name (issue 1229) - * Support ES6 IdentifierStart and IdentifierPart (issue 1232) - * Treat await as a reserved word when parsing as a module (issue 1234) - * Recognize identifier characters from Unicode SMP (issue 1244) - * Ensure that export and import can be followed by a comma (issue 1250) - * Fix yield operator precedence (issue 1262) - -2015-07-01: Version 2.4.1 - - * Fix some cases of comment attachment (issue 1071, 1175) - * Fix the handling of destructuring in function arguments (issue 1193) - * Fix invalid ranges in assignment expression (issue 1201) - -2015-06-26: Version 2.4.0 - - * Support ES6 for-of iteration (issue 1047) - * Support ES6 spread arguments (issue 1169) - * Minimize npm payload (issue 1191) - -2015-06-16: Version 2.3.0 - - * Support ES6 generator (issue 1033) - * Improve parsing of regular expressions with `u` flag (issue 1179) - -2015-04-17: Version 2.2.0 - - * Support ES6 import and export declarations (issue 1000) - * Fix line terminator before arrow not recognized as error (issue 1009) - * Support ES6 destructuring (issue 1045) - * Support ES6 template literal (issue 1074) - * Fix the handling of invalid/incomplete string escape sequences (issue 1106) - * Fix ES3 static member access restriction (issue 1120) - * Support for `super` in ES6 class (issue 1147) - -2015-03-09: Version 2.1.0 - - * Support ES6 class (issue 1001) - * Support ES6 rest parameter (issue 1011) - * Expand the location of property getter, setter, and methods (issue 1029) - * Enable TryStatement transition to a single handler (issue 1031) - * Support ES6 computed property name (issue 1037) - * Tolerate unclosed block comment (issue 1041) - * Support ES6 lexical declaration (issue 1065) - -2015-02-06: Version 2.0.0 - - * Support ES6 arrow function (issue 517) - * Support ES6 Unicode code point escape (issue 521) - * Improve the speed and accuracy of comment attachment (issue 522) - * Support ES6 default parameter (issue 519) - * Support ES6 regular expression flags (issue 557) - * Fix scanning of implicit octal literals (issue 565) - * Fix the handling of automatic semicolon insertion (issue 574) - * Support ES6 method definition (issue 620) - * Support ES6 octal integer literal (issue 621) - * Support ES6 binary integer literal (issue 622) - * Support ES6 object literal property value shorthand (issue 624) - -2015-03-03: Version 1.2.5 - - * Fix scanning of implicit octal literals (issue 565) - -2015-02-05: Version 1.2.4 - - * Fix parsing of LeftHandSideExpression in ForInStatement (issue 560) - * Fix the handling of automatic semicolon insertion (issue 574) - -2015-01-18: Version 1.2.3 - - * Fix division by this (issue 616) - -2014-05-18: Version 1.2.2 - - * Fix duplicated tokens when collecting comments (issue 537) - -2014-05-04: Version 1.2.1 - - * Ensure that Program node may still have leading comments (issue 536) - -2014-04-29: Version 1.2.0 - - * Fix semicolon handling for expression statement (issue 462, 533) - * Disallow escaped characters in regular expression flags (issue 503) - * Performance improvement for location tracking (issue 520) - * Improve the speed of comment attachment (issue 522) - -2014-03-26: Version 1.1.1 - - * Fix token handling of forward slash after an array literal (issue 512) - -2014-03-23: Version 1.1.0 - - * Optionally attach comments to the owning syntax nodes (issue 197) - * Simplify binary parsing with stack-based shift reduce (issue 352) - * Always include the raw source of literals (issue 376) - * Add optional input source information (issue 386) - * Tokenizer API for pure lexical scanning (issue 398) - * Improve the web site and its online demos (issue 337, 400, 404) - * Performance improvement for location tracking (issue 417, 424) - * Support HTML comment syntax (issue 451) - * Drop support for legacy browsers (issue 474) - -2013-08-27: Version 1.0.4 - - * Minimize the payload for packages (issue 362) - * Fix missing cases on an empty switch statement (issue 436) - * Support escaped ] in regexp literal character classes (issue 442) - * Tolerate invalid left-hand side expression (issue 130) - -2013-05-17: Version 1.0.3 - - * Variable declaration needs at least one declarator (issue 391) - * Fix benchmark's variance unit conversion (issue 397) - * IE < 9: \v should be treated as vertical tab (issue 405) - * Unary expressions should always have prefix: true (issue 418) - * Catch clause should only accept an identifier (issue 423) - * Tolerate setters without parameter (issue 426) - -2012-11-02: Version 1.0.2 - - Improvement: - - * Fix esvalidate JUnit output upon a syntax error (issue 374) - -2012-10-28: Version 1.0.1 - - Improvements: - - * esvalidate understands shebang in a Unix shell script (issue 361) - * esvalidate treats fatal parsing failure as an error (issue 361) - * Reduce Node.js package via .npmignore (issue 362) - -2012-10-22: Version 1.0.0 - - Initial release. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/esprima/LICENSE.BSD b/packages/wyatt_notification_bloc/example/scripts/node_modules/esprima/LICENSE.BSD deleted file mode 100644 index 7a55160f..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/esprima/LICENSE.BSD +++ /dev/null @@ -1,21 +0,0 @@ -Copyright JS Foundation and other contributors, https://js.foundation/ - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/esprima/README.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/esprima/README.md deleted file mode 100644 index 8fb25e6c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/esprima/README.md +++ /dev/null @@ -1,46 +0,0 @@ -[![NPM version](https://img.shields.io/npm/v/esprima.svg)](https://www.npmjs.com/package/esprima) -[![npm download](https://img.shields.io/npm/dm/esprima.svg)](https://www.npmjs.com/package/esprima) -[![Build Status](https://img.shields.io/travis/jquery/esprima/master.svg)](https://travis-ci.org/jquery/esprima) -[![Coverage Status](https://img.shields.io/codecov/c/github/jquery/esprima/master.svg)](https://codecov.io/github/jquery/esprima) - -**Esprima** ([esprima.org](http://esprima.org), BSD license) is a high performance, -standard-compliant [ECMAScript](http://www.ecma-international.org/publications/standards/Ecma-262.htm) -parser written in ECMAScript (also popularly known as -[JavaScript](https://en.wikipedia.org/wiki/JavaScript)). -Esprima is created and maintained by [Ariya Hidayat](https://twitter.com/ariyahidayat), -with the help of [many contributors](https://github.com/jquery/esprima/contributors). - -### Features - -- Full support for ECMAScript 2017 ([ECMA-262 8th Edition](http://www.ecma-international.org/publications/standards/Ecma-262.htm)) -- Sensible [syntax tree format](https://github.com/estree/estree/blob/master/es5.md) as standardized by [ESTree project](https://github.com/estree/estree) -- Experimental support for [JSX](https://facebook.github.io/jsx/), a syntax extension for [React](https://facebook.github.io/react/) -- Optional tracking of syntax node location (index-based and line-column) -- [Heavily tested](http://esprima.org/test/ci.html) (~1500 [unit tests](https://github.com/jquery/esprima/tree/master/test/fixtures) with [full code coverage](https://codecov.io/github/jquery/esprima)) - -### API - -Esprima can be used to perform [lexical analysis](https://en.wikipedia.org/wiki/Lexical_analysis) (tokenization) or [syntactic analysis](https://en.wikipedia.org/wiki/Parsing) (parsing) of a JavaScript program. - -A simple example on Node.js REPL: - -```javascript -> var esprima = require('esprima'); -> var program = 'const answer = 42'; - -> esprima.tokenize(program); -[ { type: 'Keyword', value: 'const' }, - { type: 'Identifier', value: 'answer' }, - { type: 'Punctuator', value: '=' }, - { type: 'Numeric', value: '42' } ] - -> esprima.parseScript(program); -{ type: 'Program', - body: - [ { type: 'VariableDeclaration', - declarations: [Object], - kind: 'const' } ], - sourceType: 'script' } -``` - -For more information, please read the [complete documentation](http://esprima.org/doc). \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/esprima/bin/esparse.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/esprima/bin/esparse.js deleted file mode 100755 index 45d05fbb..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/esprima/bin/esparse.js +++ /dev/null @@ -1,139 +0,0 @@ -#!/usr/bin/env node -/* - Copyright JS Foundation and other contributors, https://js.foundation/ - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -/*jslint sloppy:true node:true rhino:true */ - -var fs, esprima, fname, forceFile, content, options, syntax; - -if (typeof require === 'function') { - fs = require('fs'); - try { - esprima = require('esprima'); - } catch (e) { - esprima = require('../'); - } -} else if (typeof load === 'function') { - try { - load('esprima.js'); - } catch (e) { - load('../esprima.js'); - } -} - -// Shims to Node.js objects when running under Rhino. -if (typeof console === 'undefined' && typeof process === 'undefined') { - console = { log: print }; - fs = { readFileSync: readFile }; - process = { argv: arguments, exit: quit }; - process.argv.unshift('esparse.js'); - process.argv.unshift('rhino'); -} - -function showUsage() { - console.log('Usage:'); - console.log(' esparse [options] [file.js]'); - console.log(); - console.log('Available options:'); - console.log(); - console.log(' --comment Gather all line and block comments in an array'); - console.log(' --loc Include line-column location info for each syntax node'); - console.log(' --range Include index-based range for each syntax node'); - console.log(' --raw Display the raw value of literals'); - console.log(' --tokens List all tokens in an array'); - console.log(' --tolerant Tolerate errors on a best-effort basis (experimental)'); - console.log(' -v, --version Shows program version'); - console.log(); - process.exit(1); -} - -options = {}; - -process.argv.splice(2).forEach(function (entry) { - - if (forceFile || entry === '-' || entry.slice(0, 1) !== '-') { - if (typeof fname === 'string') { - console.log('Error: more than one input file.'); - process.exit(1); - } else { - fname = entry; - } - } else if (entry === '-h' || entry === '--help') { - showUsage(); - } else if (entry === '-v' || entry === '--version') { - console.log('ECMAScript Parser (using Esprima version', esprima.version, ')'); - console.log(); - process.exit(0); - } else if (entry === '--comment') { - options.comment = true; - } else if (entry === '--loc') { - options.loc = true; - } else if (entry === '--range') { - options.range = true; - } else if (entry === '--raw') { - options.raw = true; - } else if (entry === '--tokens') { - options.tokens = true; - } else if (entry === '--tolerant') { - options.tolerant = true; - } else if (entry === '--') { - forceFile = true; - } else { - console.log('Error: unknown option ' + entry + '.'); - process.exit(1); - } -}); - -// Special handling for regular expression literal since we need to -// convert it to a string literal, otherwise it will be decoded -// as object "{}" and the regular expression would be lost. -function adjustRegexLiteral(key, value) { - if (key === 'value' && value instanceof RegExp) { - value = value.toString(); - } - return value; -} - -function run(content) { - syntax = esprima.parse(content, options); - console.log(JSON.stringify(syntax, adjustRegexLiteral, 4)); -} - -try { - if (fname && (fname !== '-' || forceFile)) { - run(fs.readFileSync(fname, 'utf-8')); - } else { - var content = ''; - process.stdin.resume(); - process.stdin.on('data', function(chunk) { - content += chunk; - }); - process.stdin.on('end', function() { - run(content); - }); - } -} catch (e) { - console.log('Error: ' + e.message); - process.exit(1); -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/esprima/bin/esvalidate.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/esprima/bin/esvalidate.js deleted file mode 100755 index d49a7e40..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/esprima/bin/esvalidate.js +++ /dev/null @@ -1,236 +0,0 @@ -#!/usr/bin/env node -/* - Copyright JS Foundation and other contributors, https://js.foundation/ - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -/*jslint sloppy:true plusplus:true node:true rhino:true */ -/*global phantom:true */ - -var fs, system, esprima, options, fnames, forceFile, count; - -if (typeof esprima === 'undefined') { - // PhantomJS can only require() relative files - if (typeof phantom === 'object') { - fs = require('fs'); - system = require('system'); - esprima = require('./esprima'); - } else if (typeof require === 'function') { - fs = require('fs'); - try { - esprima = require('esprima'); - } catch (e) { - esprima = require('../'); - } - } else if (typeof load === 'function') { - try { - load('esprima.js'); - } catch (e) { - load('../esprima.js'); - } - } -} - -// Shims to Node.js objects when running under PhantomJS 1.7+. -if (typeof phantom === 'object') { - fs.readFileSync = fs.read; - process = { - argv: [].slice.call(system.args), - exit: phantom.exit, - on: function (evt, callback) { - callback(); - } - }; - process.argv.unshift('phantomjs'); -} - -// Shims to Node.js objects when running under Rhino. -if (typeof console === 'undefined' && typeof process === 'undefined') { - console = { log: print }; - fs = { readFileSync: readFile }; - process = { - argv: arguments, - exit: quit, - on: function (evt, callback) { - callback(); - } - }; - process.argv.unshift('esvalidate.js'); - process.argv.unshift('rhino'); -} - -function showUsage() { - console.log('Usage:'); - console.log(' esvalidate [options] [file.js...]'); - console.log(); - console.log('Available options:'); - console.log(); - console.log(' --format=type Set the report format, plain (default) or junit'); - console.log(' -v, --version Print program version'); - console.log(); - process.exit(1); -} - -options = { - format: 'plain' -}; - -fnames = []; - -process.argv.splice(2).forEach(function (entry) { - - if (forceFile || entry === '-' || entry.slice(0, 1) !== '-') { - fnames.push(entry); - } else if (entry === '-h' || entry === '--help') { - showUsage(); - } else if (entry === '-v' || entry === '--version') { - console.log('ECMAScript Validator (using Esprima version', esprima.version, ')'); - console.log(); - process.exit(0); - } else if (entry.slice(0, 9) === '--format=') { - options.format = entry.slice(9); - if (options.format !== 'plain' && options.format !== 'junit') { - console.log('Error: unknown report format ' + options.format + '.'); - process.exit(1); - } - } else if (entry === '--') { - forceFile = true; - } else { - console.log('Error: unknown option ' + entry + '.'); - process.exit(1); - } -}); - -if (fnames.length === 0) { - fnames.push(''); -} - -if (options.format === 'junit') { - console.log(''); - console.log(''); -} - -count = 0; - -function run(fname, content) { - var timestamp, syntax, name; - try { - if (typeof content !== 'string') { - throw content; - } - - if (content[0] === '#' && content[1] === '!') { - content = '//' + content.substr(2, content.length); - } - - timestamp = Date.now(); - syntax = esprima.parse(content, { tolerant: true }); - - if (options.format === 'junit') { - - name = fname; - if (name.lastIndexOf('/') >= 0) { - name = name.slice(name.lastIndexOf('/') + 1); - } - - console.log(''); - - syntax.errors.forEach(function (error) { - var msg = error.message; - msg = msg.replace(/^Line\ [0-9]*\:\ /, ''); - console.log(' '); - console.log(' ' + - error.message + '(' + name + ':' + error.lineNumber + ')' + - ''); - console.log(' '); - }); - - console.log(''); - - } else if (options.format === 'plain') { - - syntax.errors.forEach(function (error) { - var msg = error.message; - msg = msg.replace(/^Line\ [0-9]*\:\ /, ''); - msg = fname + ':' + error.lineNumber + ': ' + msg; - console.log(msg); - ++count; - }); - - } - } catch (e) { - ++count; - if (options.format === 'junit') { - console.log(''); - console.log(' '); - console.log(' ' + - e.message + '(' + fname + ((e.lineNumber) ? ':' + e.lineNumber : '') + - ')'); - console.log(' '); - console.log(''); - } else { - console.log(fname + ':' + e.lineNumber + ': ' + e.message.replace(/^Line\ [0-9]*\:\ /, '')); - } - } -} - -fnames.forEach(function (fname) { - var content = ''; - try { - if (fname && (fname !== '-' || forceFile)) { - content = fs.readFileSync(fname, 'utf-8'); - } else { - fname = ''; - process.stdin.resume(); - process.stdin.on('data', function(chunk) { - content += chunk; - }); - process.stdin.on('end', function() { - run(fname, content); - }); - return; - } - } catch (e) { - content = e; - } - run(fname, content); -}); - -process.on('exit', function () { - if (options.format === 'junit') { - console.log(''); - } - - if (count > 0) { - process.exit(1); - } - - if (count === 0 && typeof phantom === 'object') { - process.exit(0); - } -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/esprima/dist/esprima.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/esprima/dist/esprima.js deleted file mode 100644 index 2af3eee1..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/esprima/dist/esprima.js +++ /dev/null @@ -1,6709 +0,0 @@ -(function webpackUniversalModuleDefinition(root, factory) { -/* istanbul ignore next */ - if(typeof exports === 'object' && typeof module === 'object') - module.exports = factory(); - else if(typeof define === 'function' && define.amd) - define([], factory); -/* istanbul ignore next */ - else if(typeof exports === 'object') - exports["esprima"] = factory(); - else - root["esprima"] = factory(); -})(this, function() { -return /******/ (function(modules) { // webpackBootstrap -/******/ // The module cache -/******/ var installedModules = {}; - -/******/ // The require function -/******/ function __webpack_require__(moduleId) { - -/******/ // Check if module is in cache -/* istanbul ignore if */ -/******/ if(installedModules[moduleId]) -/******/ return installedModules[moduleId].exports; - -/******/ // Create a new module (and put it into the cache) -/******/ var module = installedModules[moduleId] = { -/******/ exports: {}, -/******/ id: moduleId, -/******/ loaded: false -/******/ }; - -/******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); - -/******/ // Flag the module as loaded -/******/ module.loaded = true; - -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } - - -/******/ // expose the modules object (__webpack_modules__) -/******/ __webpack_require__.m = modules; - -/******/ // expose the module cache -/******/ __webpack_require__.c = installedModules; - -/******/ // __webpack_public_path__ -/******/ __webpack_require__.p = ""; - -/******/ // Load entry module and return exports -/******/ return __webpack_require__(0); -/******/ }) -/************************************************************************/ -/******/ ([ -/* 0 */ -/***/ function(module, exports, __webpack_require__) { - - "use strict"; - /* - Copyright JS Foundation and other contributors, https://js.foundation/ - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - Object.defineProperty(exports, "__esModule", { value: true }); - var comment_handler_1 = __webpack_require__(1); - var jsx_parser_1 = __webpack_require__(3); - var parser_1 = __webpack_require__(8); - var tokenizer_1 = __webpack_require__(15); - function parse(code, options, delegate) { - var commentHandler = null; - var proxyDelegate = function (node, metadata) { - if (delegate) { - delegate(node, metadata); - } - if (commentHandler) { - commentHandler.visit(node, metadata); - } - }; - var parserDelegate = (typeof delegate === 'function') ? proxyDelegate : null; - var collectComment = false; - if (options) { - collectComment = (typeof options.comment === 'boolean' && options.comment); - var attachComment = (typeof options.attachComment === 'boolean' && options.attachComment); - if (collectComment || attachComment) { - commentHandler = new comment_handler_1.CommentHandler(); - commentHandler.attach = attachComment; - options.comment = true; - parserDelegate = proxyDelegate; - } - } - var isModule = false; - if (options && typeof options.sourceType === 'string') { - isModule = (options.sourceType === 'module'); - } - var parser; - if (options && typeof options.jsx === 'boolean' && options.jsx) { - parser = new jsx_parser_1.JSXParser(code, options, parserDelegate); - } - else { - parser = new parser_1.Parser(code, options, parserDelegate); - } - var program = isModule ? parser.parseModule() : parser.parseScript(); - var ast = program; - if (collectComment && commentHandler) { - ast.comments = commentHandler.comments; - } - if (parser.config.tokens) { - ast.tokens = parser.tokens; - } - if (parser.config.tolerant) { - ast.errors = parser.errorHandler.errors; - } - return ast; - } - exports.parse = parse; - function parseModule(code, options, delegate) { - var parsingOptions = options || {}; - parsingOptions.sourceType = 'module'; - return parse(code, parsingOptions, delegate); - } - exports.parseModule = parseModule; - function parseScript(code, options, delegate) { - var parsingOptions = options || {}; - parsingOptions.sourceType = 'script'; - return parse(code, parsingOptions, delegate); - } - exports.parseScript = parseScript; - function tokenize(code, options, delegate) { - var tokenizer = new tokenizer_1.Tokenizer(code, options); - var tokens; - tokens = []; - try { - while (true) { - var token = tokenizer.getNextToken(); - if (!token) { - break; - } - if (delegate) { - token = delegate(token); - } - tokens.push(token); - } - } - catch (e) { - tokenizer.errorHandler.tolerate(e); - } - if (tokenizer.errorHandler.tolerant) { - tokens.errors = tokenizer.errors(); - } - return tokens; - } - exports.tokenize = tokenize; - var syntax_1 = __webpack_require__(2); - exports.Syntax = syntax_1.Syntax; - // Sync with *.json manifests. - exports.version = '4.0.1'; - - -/***/ }, -/* 1 */ -/***/ function(module, exports, __webpack_require__) { - - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var syntax_1 = __webpack_require__(2); - var CommentHandler = (function () { - function CommentHandler() { - this.attach = false; - this.comments = []; - this.stack = []; - this.leading = []; - this.trailing = []; - } - CommentHandler.prototype.insertInnerComments = function (node, metadata) { - // innnerComments for properties empty block - // `function a() {/** comments **\/}` - if (node.type === syntax_1.Syntax.BlockStatement && node.body.length === 0) { - var innerComments = []; - for (var i = this.leading.length - 1; i >= 0; --i) { - var entry = this.leading[i]; - if (metadata.end.offset >= entry.start) { - innerComments.unshift(entry.comment); - this.leading.splice(i, 1); - this.trailing.splice(i, 1); - } - } - if (innerComments.length) { - node.innerComments = innerComments; - } - } - }; - CommentHandler.prototype.findTrailingComments = function (metadata) { - var trailingComments = []; - if (this.trailing.length > 0) { - for (var i = this.trailing.length - 1; i >= 0; --i) { - var entry_1 = this.trailing[i]; - if (entry_1.start >= metadata.end.offset) { - trailingComments.unshift(entry_1.comment); - } - } - this.trailing.length = 0; - return trailingComments; - } - var entry = this.stack[this.stack.length - 1]; - if (entry && entry.node.trailingComments) { - var firstComment = entry.node.trailingComments[0]; - if (firstComment && firstComment.range[0] >= metadata.end.offset) { - trailingComments = entry.node.trailingComments; - delete entry.node.trailingComments; - } - } - return trailingComments; - }; - CommentHandler.prototype.findLeadingComments = function (metadata) { - var leadingComments = []; - var target; - while (this.stack.length > 0) { - var entry = this.stack[this.stack.length - 1]; - if (entry && entry.start >= metadata.start.offset) { - target = entry.node; - this.stack.pop(); - } - else { - break; - } - } - if (target) { - var count = target.leadingComments ? target.leadingComments.length : 0; - for (var i = count - 1; i >= 0; --i) { - var comment = target.leadingComments[i]; - if (comment.range[1] <= metadata.start.offset) { - leadingComments.unshift(comment); - target.leadingComments.splice(i, 1); - } - } - if (target.leadingComments && target.leadingComments.length === 0) { - delete target.leadingComments; - } - return leadingComments; - } - for (var i = this.leading.length - 1; i >= 0; --i) { - var entry = this.leading[i]; - if (entry.start <= metadata.start.offset) { - leadingComments.unshift(entry.comment); - this.leading.splice(i, 1); - } - } - return leadingComments; - }; - CommentHandler.prototype.visitNode = function (node, metadata) { - if (node.type === syntax_1.Syntax.Program && node.body.length > 0) { - return; - } - this.insertInnerComments(node, metadata); - var trailingComments = this.findTrailingComments(metadata); - var leadingComments = this.findLeadingComments(metadata); - if (leadingComments.length > 0) { - node.leadingComments = leadingComments; - } - if (trailingComments.length > 0) { - node.trailingComments = trailingComments; - } - this.stack.push({ - node: node, - start: metadata.start.offset - }); - }; - CommentHandler.prototype.visitComment = function (node, metadata) { - var type = (node.type[0] === 'L') ? 'Line' : 'Block'; - var comment = { - type: type, - value: node.value - }; - if (node.range) { - comment.range = node.range; - } - if (node.loc) { - comment.loc = node.loc; - } - this.comments.push(comment); - if (this.attach) { - var entry = { - comment: { - type: type, - value: node.value, - range: [metadata.start.offset, metadata.end.offset] - }, - start: metadata.start.offset - }; - if (node.loc) { - entry.comment.loc = node.loc; - } - node.type = type; - this.leading.push(entry); - this.trailing.push(entry); - } - }; - CommentHandler.prototype.visit = function (node, metadata) { - if (node.type === 'LineComment') { - this.visitComment(node, metadata); - } - else if (node.type === 'BlockComment') { - this.visitComment(node, metadata); - } - else if (this.attach) { - this.visitNode(node, metadata); - } - }; - return CommentHandler; - }()); - exports.CommentHandler = CommentHandler; - - -/***/ }, -/* 2 */ -/***/ function(module, exports) { - - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.Syntax = { - AssignmentExpression: 'AssignmentExpression', - AssignmentPattern: 'AssignmentPattern', - ArrayExpression: 'ArrayExpression', - ArrayPattern: 'ArrayPattern', - ArrowFunctionExpression: 'ArrowFunctionExpression', - AwaitExpression: 'AwaitExpression', - BlockStatement: 'BlockStatement', - BinaryExpression: 'BinaryExpression', - BreakStatement: 'BreakStatement', - CallExpression: 'CallExpression', - CatchClause: 'CatchClause', - ClassBody: 'ClassBody', - ClassDeclaration: 'ClassDeclaration', - ClassExpression: 'ClassExpression', - ConditionalExpression: 'ConditionalExpression', - ContinueStatement: 'ContinueStatement', - DoWhileStatement: 'DoWhileStatement', - DebuggerStatement: 'DebuggerStatement', - EmptyStatement: 'EmptyStatement', - ExportAllDeclaration: 'ExportAllDeclaration', - ExportDefaultDeclaration: 'ExportDefaultDeclaration', - ExportNamedDeclaration: 'ExportNamedDeclaration', - ExportSpecifier: 'ExportSpecifier', - ExpressionStatement: 'ExpressionStatement', - ForStatement: 'ForStatement', - ForOfStatement: 'ForOfStatement', - ForInStatement: 'ForInStatement', - FunctionDeclaration: 'FunctionDeclaration', - FunctionExpression: 'FunctionExpression', - Identifier: 'Identifier', - IfStatement: 'IfStatement', - ImportDeclaration: 'ImportDeclaration', - ImportDefaultSpecifier: 'ImportDefaultSpecifier', - ImportNamespaceSpecifier: 'ImportNamespaceSpecifier', - ImportSpecifier: 'ImportSpecifier', - Literal: 'Literal', - LabeledStatement: 'LabeledStatement', - LogicalExpression: 'LogicalExpression', - MemberExpression: 'MemberExpression', - MetaProperty: 'MetaProperty', - MethodDefinition: 'MethodDefinition', - NewExpression: 'NewExpression', - ObjectExpression: 'ObjectExpression', - ObjectPattern: 'ObjectPattern', - Program: 'Program', - Property: 'Property', - RestElement: 'RestElement', - ReturnStatement: 'ReturnStatement', - SequenceExpression: 'SequenceExpression', - SpreadElement: 'SpreadElement', - Super: 'Super', - SwitchCase: 'SwitchCase', - SwitchStatement: 'SwitchStatement', - TaggedTemplateExpression: 'TaggedTemplateExpression', - TemplateElement: 'TemplateElement', - TemplateLiteral: 'TemplateLiteral', - ThisExpression: 'ThisExpression', - ThrowStatement: 'ThrowStatement', - TryStatement: 'TryStatement', - UnaryExpression: 'UnaryExpression', - UpdateExpression: 'UpdateExpression', - VariableDeclaration: 'VariableDeclaration', - VariableDeclarator: 'VariableDeclarator', - WhileStatement: 'WhileStatement', - WithStatement: 'WithStatement', - YieldExpression: 'YieldExpression' - }; - - -/***/ }, -/* 3 */ -/***/ function(module, exports, __webpack_require__) { - - "use strict"; -/* istanbul ignore next */ - var __extends = (this && this.__extends) || (function () { - var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; - return function (d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - })(); - Object.defineProperty(exports, "__esModule", { value: true }); - var character_1 = __webpack_require__(4); - var JSXNode = __webpack_require__(5); - var jsx_syntax_1 = __webpack_require__(6); - var Node = __webpack_require__(7); - var parser_1 = __webpack_require__(8); - var token_1 = __webpack_require__(13); - var xhtml_entities_1 = __webpack_require__(14); - token_1.TokenName[100 /* Identifier */] = 'JSXIdentifier'; - token_1.TokenName[101 /* Text */] = 'JSXText'; - // Fully qualified element name, e.g. returns "svg:path" - function getQualifiedElementName(elementName) { - var qualifiedName; - switch (elementName.type) { - case jsx_syntax_1.JSXSyntax.JSXIdentifier: - var id = elementName; - qualifiedName = id.name; - break; - case jsx_syntax_1.JSXSyntax.JSXNamespacedName: - var ns = elementName; - qualifiedName = getQualifiedElementName(ns.namespace) + ':' + - getQualifiedElementName(ns.name); - break; - case jsx_syntax_1.JSXSyntax.JSXMemberExpression: - var expr = elementName; - qualifiedName = getQualifiedElementName(expr.object) + '.' + - getQualifiedElementName(expr.property); - break; - /* istanbul ignore next */ - default: - break; - } - return qualifiedName; - } - var JSXParser = (function (_super) { - __extends(JSXParser, _super); - function JSXParser(code, options, delegate) { - return _super.call(this, code, options, delegate) || this; - } - JSXParser.prototype.parsePrimaryExpression = function () { - return this.match('<') ? this.parseJSXRoot() : _super.prototype.parsePrimaryExpression.call(this); - }; - JSXParser.prototype.startJSX = function () { - // Unwind the scanner before the lookahead token. - this.scanner.index = this.startMarker.index; - this.scanner.lineNumber = this.startMarker.line; - this.scanner.lineStart = this.startMarker.index - this.startMarker.column; - }; - JSXParser.prototype.finishJSX = function () { - // Prime the next lookahead. - this.nextToken(); - }; - JSXParser.prototype.reenterJSX = function () { - this.startJSX(); - this.expectJSX('}'); - // Pop the closing '}' added from the lookahead. - if (this.config.tokens) { - this.tokens.pop(); - } - }; - JSXParser.prototype.createJSXNode = function () { - this.collectComments(); - return { - index: this.scanner.index, - line: this.scanner.lineNumber, - column: this.scanner.index - this.scanner.lineStart - }; - }; - JSXParser.prototype.createJSXChildNode = function () { - return { - index: this.scanner.index, - line: this.scanner.lineNumber, - column: this.scanner.index - this.scanner.lineStart - }; - }; - JSXParser.prototype.scanXHTMLEntity = function (quote) { - var result = '&'; - var valid = true; - var terminated = false; - var numeric = false; - var hex = false; - while (!this.scanner.eof() && valid && !terminated) { - var ch = this.scanner.source[this.scanner.index]; - if (ch === quote) { - break; - } - terminated = (ch === ';'); - result += ch; - ++this.scanner.index; - if (!terminated) { - switch (result.length) { - case 2: - // e.g. '{' - numeric = (ch === '#'); - break; - case 3: - if (numeric) { - // e.g. 'A' - hex = (ch === 'x'); - valid = hex || character_1.Character.isDecimalDigit(ch.charCodeAt(0)); - numeric = numeric && !hex; - } - break; - default: - valid = valid && !(numeric && !character_1.Character.isDecimalDigit(ch.charCodeAt(0))); - valid = valid && !(hex && !character_1.Character.isHexDigit(ch.charCodeAt(0))); - break; - } - } - } - if (valid && terminated && result.length > 2) { - // e.g. 'A' becomes just '#x41' - var str = result.substr(1, result.length - 2); - if (numeric && str.length > 1) { - result = String.fromCharCode(parseInt(str.substr(1), 10)); - } - else if (hex && str.length > 2) { - result = String.fromCharCode(parseInt('0' + str.substr(1), 16)); - } - else if (!numeric && !hex && xhtml_entities_1.XHTMLEntities[str]) { - result = xhtml_entities_1.XHTMLEntities[str]; - } - } - return result; - }; - // Scan the next JSX token. This replaces Scanner#lex when in JSX mode. - JSXParser.prototype.lexJSX = function () { - var cp = this.scanner.source.charCodeAt(this.scanner.index); - // < > / : = { } - if (cp === 60 || cp === 62 || cp === 47 || cp === 58 || cp === 61 || cp === 123 || cp === 125) { - var value = this.scanner.source[this.scanner.index++]; - return { - type: 7 /* Punctuator */, - value: value, - lineNumber: this.scanner.lineNumber, - lineStart: this.scanner.lineStart, - start: this.scanner.index - 1, - end: this.scanner.index - }; - } - // " ' - if (cp === 34 || cp === 39) { - var start = this.scanner.index; - var quote = this.scanner.source[this.scanner.index++]; - var str = ''; - while (!this.scanner.eof()) { - var ch = this.scanner.source[this.scanner.index++]; - if (ch === quote) { - break; - } - else if (ch === '&') { - str += this.scanXHTMLEntity(quote); - } - else { - str += ch; - } - } - return { - type: 8 /* StringLiteral */, - value: str, - lineNumber: this.scanner.lineNumber, - lineStart: this.scanner.lineStart, - start: start, - end: this.scanner.index - }; - } - // ... or . - if (cp === 46) { - var n1 = this.scanner.source.charCodeAt(this.scanner.index + 1); - var n2 = this.scanner.source.charCodeAt(this.scanner.index + 2); - var value = (n1 === 46 && n2 === 46) ? '...' : '.'; - var start = this.scanner.index; - this.scanner.index += value.length; - return { - type: 7 /* Punctuator */, - value: value, - lineNumber: this.scanner.lineNumber, - lineStart: this.scanner.lineStart, - start: start, - end: this.scanner.index - }; - } - // ` - if (cp === 96) { - // Only placeholder, since it will be rescanned as a real assignment expression. - return { - type: 10 /* Template */, - value: '', - lineNumber: this.scanner.lineNumber, - lineStart: this.scanner.lineStart, - start: this.scanner.index, - end: this.scanner.index - }; - } - // Identifer can not contain backslash (char code 92). - if (character_1.Character.isIdentifierStart(cp) && (cp !== 92)) { - var start = this.scanner.index; - ++this.scanner.index; - while (!this.scanner.eof()) { - var ch = this.scanner.source.charCodeAt(this.scanner.index); - if (character_1.Character.isIdentifierPart(ch) && (ch !== 92)) { - ++this.scanner.index; - } - else if (ch === 45) { - // Hyphen (char code 45) can be part of an identifier. - ++this.scanner.index; - } - else { - break; - } - } - var id = this.scanner.source.slice(start, this.scanner.index); - return { - type: 100 /* Identifier */, - value: id, - lineNumber: this.scanner.lineNumber, - lineStart: this.scanner.lineStart, - start: start, - end: this.scanner.index - }; - } - return this.scanner.lex(); - }; - JSXParser.prototype.nextJSXToken = function () { - this.collectComments(); - this.startMarker.index = this.scanner.index; - this.startMarker.line = this.scanner.lineNumber; - this.startMarker.column = this.scanner.index - this.scanner.lineStart; - var token = this.lexJSX(); - this.lastMarker.index = this.scanner.index; - this.lastMarker.line = this.scanner.lineNumber; - this.lastMarker.column = this.scanner.index - this.scanner.lineStart; - if (this.config.tokens) { - this.tokens.push(this.convertToken(token)); - } - return token; - }; - JSXParser.prototype.nextJSXText = function () { - this.startMarker.index = this.scanner.index; - this.startMarker.line = this.scanner.lineNumber; - this.startMarker.column = this.scanner.index - this.scanner.lineStart; - var start = this.scanner.index; - var text = ''; - while (!this.scanner.eof()) { - var ch = this.scanner.source[this.scanner.index]; - if (ch === '{' || ch === '<') { - break; - } - ++this.scanner.index; - text += ch; - if (character_1.Character.isLineTerminator(ch.charCodeAt(0))) { - ++this.scanner.lineNumber; - if (ch === '\r' && this.scanner.source[this.scanner.index] === '\n') { - ++this.scanner.index; - } - this.scanner.lineStart = this.scanner.index; - } - } - this.lastMarker.index = this.scanner.index; - this.lastMarker.line = this.scanner.lineNumber; - this.lastMarker.column = this.scanner.index - this.scanner.lineStart; - var token = { - type: 101 /* Text */, - value: text, - lineNumber: this.scanner.lineNumber, - lineStart: this.scanner.lineStart, - start: start, - end: this.scanner.index - }; - if ((text.length > 0) && this.config.tokens) { - this.tokens.push(this.convertToken(token)); - } - return token; - }; - JSXParser.prototype.peekJSXToken = function () { - var state = this.scanner.saveState(); - this.scanner.scanComments(); - var next = this.lexJSX(); - this.scanner.restoreState(state); - return next; - }; - // Expect the next JSX token to match the specified punctuator. - // If not, an exception will be thrown. - JSXParser.prototype.expectJSX = function (value) { - var token = this.nextJSXToken(); - if (token.type !== 7 /* Punctuator */ || token.value !== value) { - this.throwUnexpectedToken(token); - } - }; - // Return true if the next JSX token matches the specified punctuator. - JSXParser.prototype.matchJSX = function (value) { - var next = this.peekJSXToken(); - return next.type === 7 /* Punctuator */ && next.value === value; - }; - JSXParser.prototype.parseJSXIdentifier = function () { - var node = this.createJSXNode(); - var token = this.nextJSXToken(); - if (token.type !== 100 /* Identifier */) { - this.throwUnexpectedToken(token); - } - return this.finalize(node, new JSXNode.JSXIdentifier(token.value)); - }; - JSXParser.prototype.parseJSXElementName = function () { - var node = this.createJSXNode(); - var elementName = this.parseJSXIdentifier(); - if (this.matchJSX(':')) { - var namespace = elementName; - this.expectJSX(':'); - var name_1 = this.parseJSXIdentifier(); - elementName = this.finalize(node, new JSXNode.JSXNamespacedName(namespace, name_1)); - } - else if (this.matchJSX('.')) { - while (this.matchJSX('.')) { - var object = elementName; - this.expectJSX('.'); - var property = this.parseJSXIdentifier(); - elementName = this.finalize(node, new JSXNode.JSXMemberExpression(object, property)); - } - } - return elementName; - }; - JSXParser.prototype.parseJSXAttributeName = function () { - var node = this.createJSXNode(); - var attributeName; - var identifier = this.parseJSXIdentifier(); - if (this.matchJSX(':')) { - var namespace = identifier; - this.expectJSX(':'); - var name_2 = this.parseJSXIdentifier(); - attributeName = this.finalize(node, new JSXNode.JSXNamespacedName(namespace, name_2)); - } - else { - attributeName = identifier; - } - return attributeName; - }; - JSXParser.prototype.parseJSXStringLiteralAttribute = function () { - var node = this.createJSXNode(); - var token = this.nextJSXToken(); - if (token.type !== 8 /* StringLiteral */) { - this.throwUnexpectedToken(token); - } - var raw = this.getTokenRaw(token); - return this.finalize(node, new Node.Literal(token.value, raw)); - }; - JSXParser.prototype.parseJSXExpressionAttribute = function () { - var node = this.createJSXNode(); - this.expectJSX('{'); - this.finishJSX(); - if (this.match('}')) { - this.tolerateError('JSX attributes must only be assigned a non-empty expression'); - } - var expression = this.parseAssignmentExpression(); - this.reenterJSX(); - return this.finalize(node, new JSXNode.JSXExpressionContainer(expression)); - }; - JSXParser.prototype.parseJSXAttributeValue = function () { - return this.matchJSX('{') ? this.parseJSXExpressionAttribute() : - this.matchJSX('<') ? this.parseJSXElement() : this.parseJSXStringLiteralAttribute(); - }; - JSXParser.prototype.parseJSXNameValueAttribute = function () { - var node = this.createJSXNode(); - var name = this.parseJSXAttributeName(); - var value = null; - if (this.matchJSX('=')) { - this.expectJSX('='); - value = this.parseJSXAttributeValue(); - } - return this.finalize(node, new JSXNode.JSXAttribute(name, value)); - }; - JSXParser.prototype.parseJSXSpreadAttribute = function () { - var node = this.createJSXNode(); - this.expectJSX('{'); - this.expectJSX('...'); - this.finishJSX(); - var argument = this.parseAssignmentExpression(); - this.reenterJSX(); - return this.finalize(node, new JSXNode.JSXSpreadAttribute(argument)); - }; - JSXParser.prototype.parseJSXAttributes = function () { - var attributes = []; - while (!this.matchJSX('/') && !this.matchJSX('>')) { - var attribute = this.matchJSX('{') ? this.parseJSXSpreadAttribute() : - this.parseJSXNameValueAttribute(); - attributes.push(attribute); - } - return attributes; - }; - JSXParser.prototype.parseJSXOpeningElement = function () { - var node = this.createJSXNode(); - this.expectJSX('<'); - var name = this.parseJSXElementName(); - var attributes = this.parseJSXAttributes(); - var selfClosing = this.matchJSX('/'); - if (selfClosing) { - this.expectJSX('/'); - } - this.expectJSX('>'); - return this.finalize(node, new JSXNode.JSXOpeningElement(name, selfClosing, attributes)); - }; - JSXParser.prototype.parseJSXBoundaryElement = function () { - var node = this.createJSXNode(); - this.expectJSX('<'); - if (this.matchJSX('/')) { - this.expectJSX('/'); - var name_3 = this.parseJSXElementName(); - this.expectJSX('>'); - return this.finalize(node, new JSXNode.JSXClosingElement(name_3)); - } - var name = this.parseJSXElementName(); - var attributes = this.parseJSXAttributes(); - var selfClosing = this.matchJSX('/'); - if (selfClosing) { - this.expectJSX('/'); - } - this.expectJSX('>'); - return this.finalize(node, new JSXNode.JSXOpeningElement(name, selfClosing, attributes)); - }; - JSXParser.prototype.parseJSXEmptyExpression = function () { - var node = this.createJSXChildNode(); - this.collectComments(); - this.lastMarker.index = this.scanner.index; - this.lastMarker.line = this.scanner.lineNumber; - this.lastMarker.column = this.scanner.index - this.scanner.lineStart; - return this.finalize(node, new JSXNode.JSXEmptyExpression()); - }; - JSXParser.prototype.parseJSXExpressionContainer = function () { - var node = this.createJSXNode(); - this.expectJSX('{'); - var expression; - if (this.matchJSX('}')) { - expression = this.parseJSXEmptyExpression(); - this.expectJSX('}'); - } - else { - this.finishJSX(); - expression = this.parseAssignmentExpression(); - this.reenterJSX(); - } - return this.finalize(node, new JSXNode.JSXExpressionContainer(expression)); - }; - JSXParser.prototype.parseJSXChildren = function () { - var children = []; - while (!this.scanner.eof()) { - var node = this.createJSXChildNode(); - var token = this.nextJSXText(); - if (token.start < token.end) { - var raw = this.getTokenRaw(token); - var child = this.finalize(node, new JSXNode.JSXText(token.value, raw)); - children.push(child); - } - if (this.scanner.source[this.scanner.index] === '{') { - var container = this.parseJSXExpressionContainer(); - children.push(container); - } - else { - break; - } - } - return children; - }; - JSXParser.prototype.parseComplexJSXElement = function (el) { - var stack = []; - while (!this.scanner.eof()) { - el.children = el.children.concat(this.parseJSXChildren()); - var node = this.createJSXChildNode(); - var element = this.parseJSXBoundaryElement(); - if (element.type === jsx_syntax_1.JSXSyntax.JSXOpeningElement) { - var opening = element; - if (opening.selfClosing) { - var child = this.finalize(node, new JSXNode.JSXElement(opening, [], null)); - el.children.push(child); - } - else { - stack.push(el); - el = { node: node, opening: opening, closing: null, children: [] }; - } - } - if (element.type === jsx_syntax_1.JSXSyntax.JSXClosingElement) { - el.closing = element; - var open_1 = getQualifiedElementName(el.opening.name); - var close_1 = getQualifiedElementName(el.closing.name); - if (open_1 !== close_1) { - this.tolerateError('Expected corresponding JSX closing tag for %0', open_1); - } - if (stack.length > 0) { - var child = this.finalize(el.node, new JSXNode.JSXElement(el.opening, el.children, el.closing)); - el = stack[stack.length - 1]; - el.children.push(child); - stack.pop(); - } - else { - break; - } - } - } - return el; - }; - JSXParser.prototype.parseJSXElement = function () { - var node = this.createJSXNode(); - var opening = this.parseJSXOpeningElement(); - var children = []; - var closing = null; - if (!opening.selfClosing) { - var el = this.parseComplexJSXElement({ node: node, opening: opening, closing: closing, children: children }); - children = el.children; - closing = el.closing; - } - return this.finalize(node, new JSXNode.JSXElement(opening, children, closing)); - }; - JSXParser.prototype.parseJSXRoot = function () { - // Pop the opening '<' added from the lookahead. - if (this.config.tokens) { - this.tokens.pop(); - } - this.startJSX(); - var element = this.parseJSXElement(); - this.finishJSX(); - return element; - }; - JSXParser.prototype.isStartOfExpression = function () { - return _super.prototype.isStartOfExpression.call(this) || this.match('<'); - }; - return JSXParser; - }(parser_1.Parser)); - exports.JSXParser = JSXParser; - - -/***/ }, -/* 4 */ -/***/ function(module, exports) { - - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - // See also tools/generate-unicode-regex.js. - var Regex = { - // Unicode v8.0.0 NonAsciiIdentifierStart: - NonAsciiIdentifierStart: /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]/, - // Unicode v8.0.0 NonAsciiIdentifierPart: - NonAsciiIdentifierPart: /[\xAA\xB5\xB7\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B4\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1369-\u1371\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFC-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C4\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/ - }; - exports.Character = { - /* tslint:disable:no-bitwise */ - fromCodePoint: function (cp) { - return (cp < 0x10000) ? String.fromCharCode(cp) : - String.fromCharCode(0xD800 + ((cp - 0x10000) >> 10)) + - String.fromCharCode(0xDC00 + ((cp - 0x10000) & 1023)); - }, - // https://tc39.github.io/ecma262/#sec-white-space - isWhiteSpace: function (cp) { - return (cp === 0x20) || (cp === 0x09) || (cp === 0x0B) || (cp === 0x0C) || (cp === 0xA0) || - (cp >= 0x1680 && [0x1680, 0x2000, 0x2001, 0x2002, 0x2003, 0x2004, 0x2005, 0x2006, 0x2007, 0x2008, 0x2009, 0x200A, 0x202F, 0x205F, 0x3000, 0xFEFF].indexOf(cp) >= 0); - }, - // https://tc39.github.io/ecma262/#sec-line-terminators - isLineTerminator: function (cp) { - return (cp === 0x0A) || (cp === 0x0D) || (cp === 0x2028) || (cp === 0x2029); - }, - // https://tc39.github.io/ecma262/#sec-names-and-keywords - isIdentifierStart: function (cp) { - return (cp === 0x24) || (cp === 0x5F) || - (cp >= 0x41 && cp <= 0x5A) || - (cp >= 0x61 && cp <= 0x7A) || - (cp === 0x5C) || - ((cp >= 0x80) && Regex.NonAsciiIdentifierStart.test(exports.Character.fromCodePoint(cp))); - }, - isIdentifierPart: function (cp) { - return (cp === 0x24) || (cp === 0x5F) || - (cp >= 0x41 && cp <= 0x5A) || - (cp >= 0x61 && cp <= 0x7A) || - (cp >= 0x30 && cp <= 0x39) || - (cp === 0x5C) || - ((cp >= 0x80) && Regex.NonAsciiIdentifierPart.test(exports.Character.fromCodePoint(cp))); - }, - // https://tc39.github.io/ecma262/#sec-literals-numeric-literals - isDecimalDigit: function (cp) { - return (cp >= 0x30 && cp <= 0x39); // 0..9 - }, - isHexDigit: function (cp) { - return (cp >= 0x30 && cp <= 0x39) || - (cp >= 0x41 && cp <= 0x46) || - (cp >= 0x61 && cp <= 0x66); // a..f - }, - isOctalDigit: function (cp) { - return (cp >= 0x30 && cp <= 0x37); // 0..7 - } - }; - - -/***/ }, -/* 5 */ -/***/ function(module, exports, __webpack_require__) { - - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var jsx_syntax_1 = __webpack_require__(6); - /* tslint:disable:max-classes-per-file */ - var JSXClosingElement = (function () { - function JSXClosingElement(name) { - this.type = jsx_syntax_1.JSXSyntax.JSXClosingElement; - this.name = name; - } - return JSXClosingElement; - }()); - exports.JSXClosingElement = JSXClosingElement; - var JSXElement = (function () { - function JSXElement(openingElement, children, closingElement) { - this.type = jsx_syntax_1.JSXSyntax.JSXElement; - this.openingElement = openingElement; - this.children = children; - this.closingElement = closingElement; - } - return JSXElement; - }()); - exports.JSXElement = JSXElement; - var JSXEmptyExpression = (function () { - function JSXEmptyExpression() { - this.type = jsx_syntax_1.JSXSyntax.JSXEmptyExpression; - } - return JSXEmptyExpression; - }()); - exports.JSXEmptyExpression = JSXEmptyExpression; - var JSXExpressionContainer = (function () { - function JSXExpressionContainer(expression) { - this.type = jsx_syntax_1.JSXSyntax.JSXExpressionContainer; - this.expression = expression; - } - return JSXExpressionContainer; - }()); - exports.JSXExpressionContainer = JSXExpressionContainer; - var JSXIdentifier = (function () { - function JSXIdentifier(name) { - this.type = jsx_syntax_1.JSXSyntax.JSXIdentifier; - this.name = name; - } - return JSXIdentifier; - }()); - exports.JSXIdentifier = JSXIdentifier; - var JSXMemberExpression = (function () { - function JSXMemberExpression(object, property) { - this.type = jsx_syntax_1.JSXSyntax.JSXMemberExpression; - this.object = object; - this.property = property; - } - return JSXMemberExpression; - }()); - exports.JSXMemberExpression = JSXMemberExpression; - var JSXAttribute = (function () { - function JSXAttribute(name, value) { - this.type = jsx_syntax_1.JSXSyntax.JSXAttribute; - this.name = name; - this.value = value; - } - return JSXAttribute; - }()); - exports.JSXAttribute = JSXAttribute; - var JSXNamespacedName = (function () { - function JSXNamespacedName(namespace, name) { - this.type = jsx_syntax_1.JSXSyntax.JSXNamespacedName; - this.namespace = namespace; - this.name = name; - } - return JSXNamespacedName; - }()); - exports.JSXNamespacedName = JSXNamespacedName; - var JSXOpeningElement = (function () { - function JSXOpeningElement(name, selfClosing, attributes) { - this.type = jsx_syntax_1.JSXSyntax.JSXOpeningElement; - this.name = name; - this.selfClosing = selfClosing; - this.attributes = attributes; - } - return JSXOpeningElement; - }()); - exports.JSXOpeningElement = JSXOpeningElement; - var JSXSpreadAttribute = (function () { - function JSXSpreadAttribute(argument) { - this.type = jsx_syntax_1.JSXSyntax.JSXSpreadAttribute; - this.argument = argument; - } - return JSXSpreadAttribute; - }()); - exports.JSXSpreadAttribute = JSXSpreadAttribute; - var JSXText = (function () { - function JSXText(value, raw) { - this.type = jsx_syntax_1.JSXSyntax.JSXText; - this.value = value; - this.raw = raw; - } - return JSXText; - }()); - exports.JSXText = JSXText; - - -/***/ }, -/* 6 */ -/***/ function(module, exports) { - - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.JSXSyntax = { - JSXAttribute: 'JSXAttribute', - JSXClosingElement: 'JSXClosingElement', - JSXElement: 'JSXElement', - JSXEmptyExpression: 'JSXEmptyExpression', - JSXExpressionContainer: 'JSXExpressionContainer', - JSXIdentifier: 'JSXIdentifier', - JSXMemberExpression: 'JSXMemberExpression', - JSXNamespacedName: 'JSXNamespacedName', - JSXOpeningElement: 'JSXOpeningElement', - JSXSpreadAttribute: 'JSXSpreadAttribute', - JSXText: 'JSXText' - }; - - -/***/ }, -/* 7 */ -/***/ function(module, exports, __webpack_require__) { - - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var syntax_1 = __webpack_require__(2); - /* tslint:disable:max-classes-per-file */ - var ArrayExpression = (function () { - function ArrayExpression(elements) { - this.type = syntax_1.Syntax.ArrayExpression; - this.elements = elements; - } - return ArrayExpression; - }()); - exports.ArrayExpression = ArrayExpression; - var ArrayPattern = (function () { - function ArrayPattern(elements) { - this.type = syntax_1.Syntax.ArrayPattern; - this.elements = elements; - } - return ArrayPattern; - }()); - exports.ArrayPattern = ArrayPattern; - var ArrowFunctionExpression = (function () { - function ArrowFunctionExpression(params, body, expression) { - this.type = syntax_1.Syntax.ArrowFunctionExpression; - this.id = null; - this.params = params; - this.body = body; - this.generator = false; - this.expression = expression; - this.async = false; - } - return ArrowFunctionExpression; - }()); - exports.ArrowFunctionExpression = ArrowFunctionExpression; - var AssignmentExpression = (function () { - function AssignmentExpression(operator, left, right) { - this.type = syntax_1.Syntax.AssignmentExpression; - this.operator = operator; - this.left = left; - this.right = right; - } - return AssignmentExpression; - }()); - exports.AssignmentExpression = AssignmentExpression; - var AssignmentPattern = (function () { - function AssignmentPattern(left, right) { - this.type = syntax_1.Syntax.AssignmentPattern; - this.left = left; - this.right = right; - } - return AssignmentPattern; - }()); - exports.AssignmentPattern = AssignmentPattern; - var AsyncArrowFunctionExpression = (function () { - function AsyncArrowFunctionExpression(params, body, expression) { - this.type = syntax_1.Syntax.ArrowFunctionExpression; - this.id = null; - this.params = params; - this.body = body; - this.generator = false; - this.expression = expression; - this.async = true; - } - return AsyncArrowFunctionExpression; - }()); - exports.AsyncArrowFunctionExpression = AsyncArrowFunctionExpression; - var AsyncFunctionDeclaration = (function () { - function AsyncFunctionDeclaration(id, params, body) { - this.type = syntax_1.Syntax.FunctionDeclaration; - this.id = id; - this.params = params; - this.body = body; - this.generator = false; - this.expression = false; - this.async = true; - } - return AsyncFunctionDeclaration; - }()); - exports.AsyncFunctionDeclaration = AsyncFunctionDeclaration; - var AsyncFunctionExpression = (function () { - function AsyncFunctionExpression(id, params, body) { - this.type = syntax_1.Syntax.FunctionExpression; - this.id = id; - this.params = params; - this.body = body; - this.generator = false; - this.expression = false; - this.async = true; - } - return AsyncFunctionExpression; - }()); - exports.AsyncFunctionExpression = AsyncFunctionExpression; - var AwaitExpression = (function () { - function AwaitExpression(argument) { - this.type = syntax_1.Syntax.AwaitExpression; - this.argument = argument; - } - return AwaitExpression; - }()); - exports.AwaitExpression = AwaitExpression; - var BinaryExpression = (function () { - function BinaryExpression(operator, left, right) { - var logical = (operator === '||' || operator === '&&'); - this.type = logical ? syntax_1.Syntax.LogicalExpression : syntax_1.Syntax.BinaryExpression; - this.operator = operator; - this.left = left; - this.right = right; - } - return BinaryExpression; - }()); - exports.BinaryExpression = BinaryExpression; - var BlockStatement = (function () { - function BlockStatement(body) { - this.type = syntax_1.Syntax.BlockStatement; - this.body = body; - } - return BlockStatement; - }()); - exports.BlockStatement = BlockStatement; - var BreakStatement = (function () { - function BreakStatement(label) { - this.type = syntax_1.Syntax.BreakStatement; - this.label = label; - } - return BreakStatement; - }()); - exports.BreakStatement = BreakStatement; - var CallExpression = (function () { - function CallExpression(callee, args) { - this.type = syntax_1.Syntax.CallExpression; - this.callee = callee; - this.arguments = args; - } - return CallExpression; - }()); - exports.CallExpression = CallExpression; - var CatchClause = (function () { - function CatchClause(param, body) { - this.type = syntax_1.Syntax.CatchClause; - this.param = param; - this.body = body; - } - return CatchClause; - }()); - exports.CatchClause = CatchClause; - var ClassBody = (function () { - function ClassBody(body) { - this.type = syntax_1.Syntax.ClassBody; - this.body = body; - } - return ClassBody; - }()); - exports.ClassBody = ClassBody; - var ClassDeclaration = (function () { - function ClassDeclaration(id, superClass, body) { - this.type = syntax_1.Syntax.ClassDeclaration; - this.id = id; - this.superClass = superClass; - this.body = body; - } - return ClassDeclaration; - }()); - exports.ClassDeclaration = ClassDeclaration; - var ClassExpression = (function () { - function ClassExpression(id, superClass, body) { - this.type = syntax_1.Syntax.ClassExpression; - this.id = id; - this.superClass = superClass; - this.body = body; - } - return ClassExpression; - }()); - exports.ClassExpression = ClassExpression; - var ComputedMemberExpression = (function () { - function ComputedMemberExpression(object, property) { - this.type = syntax_1.Syntax.MemberExpression; - this.computed = true; - this.object = object; - this.property = property; - } - return ComputedMemberExpression; - }()); - exports.ComputedMemberExpression = ComputedMemberExpression; - var ConditionalExpression = (function () { - function ConditionalExpression(test, consequent, alternate) { - this.type = syntax_1.Syntax.ConditionalExpression; - this.test = test; - this.consequent = consequent; - this.alternate = alternate; - } - return ConditionalExpression; - }()); - exports.ConditionalExpression = ConditionalExpression; - var ContinueStatement = (function () { - function ContinueStatement(label) { - this.type = syntax_1.Syntax.ContinueStatement; - this.label = label; - } - return ContinueStatement; - }()); - exports.ContinueStatement = ContinueStatement; - var DebuggerStatement = (function () { - function DebuggerStatement() { - this.type = syntax_1.Syntax.DebuggerStatement; - } - return DebuggerStatement; - }()); - exports.DebuggerStatement = DebuggerStatement; - var Directive = (function () { - function Directive(expression, directive) { - this.type = syntax_1.Syntax.ExpressionStatement; - this.expression = expression; - this.directive = directive; - } - return Directive; - }()); - exports.Directive = Directive; - var DoWhileStatement = (function () { - function DoWhileStatement(body, test) { - this.type = syntax_1.Syntax.DoWhileStatement; - this.body = body; - this.test = test; - } - return DoWhileStatement; - }()); - exports.DoWhileStatement = DoWhileStatement; - var EmptyStatement = (function () { - function EmptyStatement() { - this.type = syntax_1.Syntax.EmptyStatement; - } - return EmptyStatement; - }()); - exports.EmptyStatement = EmptyStatement; - var ExportAllDeclaration = (function () { - function ExportAllDeclaration(source) { - this.type = syntax_1.Syntax.ExportAllDeclaration; - this.source = source; - } - return ExportAllDeclaration; - }()); - exports.ExportAllDeclaration = ExportAllDeclaration; - var ExportDefaultDeclaration = (function () { - function ExportDefaultDeclaration(declaration) { - this.type = syntax_1.Syntax.ExportDefaultDeclaration; - this.declaration = declaration; - } - return ExportDefaultDeclaration; - }()); - exports.ExportDefaultDeclaration = ExportDefaultDeclaration; - var ExportNamedDeclaration = (function () { - function ExportNamedDeclaration(declaration, specifiers, source) { - this.type = syntax_1.Syntax.ExportNamedDeclaration; - this.declaration = declaration; - this.specifiers = specifiers; - this.source = source; - } - return ExportNamedDeclaration; - }()); - exports.ExportNamedDeclaration = ExportNamedDeclaration; - var ExportSpecifier = (function () { - function ExportSpecifier(local, exported) { - this.type = syntax_1.Syntax.ExportSpecifier; - this.exported = exported; - this.local = local; - } - return ExportSpecifier; - }()); - exports.ExportSpecifier = ExportSpecifier; - var ExpressionStatement = (function () { - function ExpressionStatement(expression) { - this.type = syntax_1.Syntax.ExpressionStatement; - this.expression = expression; - } - return ExpressionStatement; - }()); - exports.ExpressionStatement = ExpressionStatement; - var ForInStatement = (function () { - function ForInStatement(left, right, body) { - this.type = syntax_1.Syntax.ForInStatement; - this.left = left; - this.right = right; - this.body = body; - this.each = false; - } - return ForInStatement; - }()); - exports.ForInStatement = ForInStatement; - var ForOfStatement = (function () { - function ForOfStatement(left, right, body) { - this.type = syntax_1.Syntax.ForOfStatement; - this.left = left; - this.right = right; - this.body = body; - } - return ForOfStatement; - }()); - exports.ForOfStatement = ForOfStatement; - var ForStatement = (function () { - function ForStatement(init, test, update, body) { - this.type = syntax_1.Syntax.ForStatement; - this.init = init; - this.test = test; - this.update = update; - this.body = body; - } - return ForStatement; - }()); - exports.ForStatement = ForStatement; - var FunctionDeclaration = (function () { - function FunctionDeclaration(id, params, body, generator) { - this.type = syntax_1.Syntax.FunctionDeclaration; - this.id = id; - this.params = params; - this.body = body; - this.generator = generator; - this.expression = false; - this.async = false; - } - return FunctionDeclaration; - }()); - exports.FunctionDeclaration = FunctionDeclaration; - var FunctionExpression = (function () { - function FunctionExpression(id, params, body, generator) { - this.type = syntax_1.Syntax.FunctionExpression; - this.id = id; - this.params = params; - this.body = body; - this.generator = generator; - this.expression = false; - this.async = false; - } - return FunctionExpression; - }()); - exports.FunctionExpression = FunctionExpression; - var Identifier = (function () { - function Identifier(name) { - this.type = syntax_1.Syntax.Identifier; - this.name = name; - } - return Identifier; - }()); - exports.Identifier = Identifier; - var IfStatement = (function () { - function IfStatement(test, consequent, alternate) { - this.type = syntax_1.Syntax.IfStatement; - this.test = test; - this.consequent = consequent; - this.alternate = alternate; - } - return IfStatement; - }()); - exports.IfStatement = IfStatement; - var ImportDeclaration = (function () { - function ImportDeclaration(specifiers, source) { - this.type = syntax_1.Syntax.ImportDeclaration; - this.specifiers = specifiers; - this.source = source; - } - return ImportDeclaration; - }()); - exports.ImportDeclaration = ImportDeclaration; - var ImportDefaultSpecifier = (function () { - function ImportDefaultSpecifier(local) { - this.type = syntax_1.Syntax.ImportDefaultSpecifier; - this.local = local; - } - return ImportDefaultSpecifier; - }()); - exports.ImportDefaultSpecifier = ImportDefaultSpecifier; - var ImportNamespaceSpecifier = (function () { - function ImportNamespaceSpecifier(local) { - this.type = syntax_1.Syntax.ImportNamespaceSpecifier; - this.local = local; - } - return ImportNamespaceSpecifier; - }()); - exports.ImportNamespaceSpecifier = ImportNamespaceSpecifier; - var ImportSpecifier = (function () { - function ImportSpecifier(local, imported) { - this.type = syntax_1.Syntax.ImportSpecifier; - this.local = local; - this.imported = imported; - } - return ImportSpecifier; - }()); - exports.ImportSpecifier = ImportSpecifier; - var LabeledStatement = (function () { - function LabeledStatement(label, body) { - this.type = syntax_1.Syntax.LabeledStatement; - this.label = label; - this.body = body; - } - return LabeledStatement; - }()); - exports.LabeledStatement = LabeledStatement; - var Literal = (function () { - function Literal(value, raw) { - this.type = syntax_1.Syntax.Literal; - this.value = value; - this.raw = raw; - } - return Literal; - }()); - exports.Literal = Literal; - var MetaProperty = (function () { - function MetaProperty(meta, property) { - this.type = syntax_1.Syntax.MetaProperty; - this.meta = meta; - this.property = property; - } - return MetaProperty; - }()); - exports.MetaProperty = MetaProperty; - var MethodDefinition = (function () { - function MethodDefinition(key, computed, value, kind, isStatic) { - this.type = syntax_1.Syntax.MethodDefinition; - this.key = key; - this.computed = computed; - this.value = value; - this.kind = kind; - this.static = isStatic; - } - return MethodDefinition; - }()); - exports.MethodDefinition = MethodDefinition; - var Module = (function () { - function Module(body) { - this.type = syntax_1.Syntax.Program; - this.body = body; - this.sourceType = 'module'; - } - return Module; - }()); - exports.Module = Module; - var NewExpression = (function () { - function NewExpression(callee, args) { - this.type = syntax_1.Syntax.NewExpression; - this.callee = callee; - this.arguments = args; - } - return NewExpression; - }()); - exports.NewExpression = NewExpression; - var ObjectExpression = (function () { - function ObjectExpression(properties) { - this.type = syntax_1.Syntax.ObjectExpression; - this.properties = properties; - } - return ObjectExpression; - }()); - exports.ObjectExpression = ObjectExpression; - var ObjectPattern = (function () { - function ObjectPattern(properties) { - this.type = syntax_1.Syntax.ObjectPattern; - this.properties = properties; - } - return ObjectPattern; - }()); - exports.ObjectPattern = ObjectPattern; - var Property = (function () { - function Property(kind, key, computed, value, method, shorthand) { - this.type = syntax_1.Syntax.Property; - this.key = key; - this.computed = computed; - this.value = value; - this.kind = kind; - this.method = method; - this.shorthand = shorthand; - } - return Property; - }()); - exports.Property = Property; - var RegexLiteral = (function () { - function RegexLiteral(value, raw, pattern, flags) { - this.type = syntax_1.Syntax.Literal; - this.value = value; - this.raw = raw; - this.regex = { pattern: pattern, flags: flags }; - } - return RegexLiteral; - }()); - exports.RegexLiteral = RegexLiteral; - var RestElement = (function () { - function RestElement(argument) { - this.type = syntax_1.Syntax.RestElement; - this.argument = argument; - } - return RestElement; - }()); - exports.RestElement = RestElement; - var ReturnStatement = (function () { - function ReturnStatement(argument) { - this.type = syntax_1.Syntax.ReturnStatement; - this.argument = argument; - } - return ReturnStatement; - }()); - exports.ReturnStatement = ReturnStatement; - var Script = (function () { - function Script(body) { - this.type = syntax_1.Syntax.Program; - this.body = body; - this.sourceType = 'script'; - } - return Script; - }()); - exports.Script = Script; - var SequenceExpression = (function () { - function SequenceExpression(expressions) { - this.type = syntax_1.Syntax.SequenceExpression; - this.expressions = expressions; - } - return SequenceExpression; - }()); - exports.SequenceExpression = SequenceExpression; - var SpreadElement = (function () { - function SpreadElement(argument) { - this.type = syntax_1.Syntax.SpreadElement; - this.argument = argument; - } - return SpreadElement; - }()); - exports.SpreadElement = SpreadElement; - var StaticMemberExpression = (function () { - function StaticMemberExpression(object, property) { - this.type = syntax_1.Syntax.MemberExpression; - this.computed = false; - this.object = object; - this.property = property; - } - return StaticMemberExpression; - }()); - exports.StaticMemberExpression = StaticMemberExpression; - var Super = (function () { - function Super() { - this.type = syntax_1.Syntax.Super; - } - return Super; - }()); - exports.Super = Super; - var SwitchCase = (function () { - function SwitchCase(test, consequent) { - this.type = syntax_1.Syntax.SwitchCase; - this.test = test; - this.consequent = consequent; - } - return SwitchCase; - }()); - exports.SwitchCase = SwitchCase; - var SwitchStatement = (function () { - function SwitchStatement(discriminant, cases) { - this.type = syntax_1.Syntax.SwitchStatement; - this.discriminant = discriminant; - this.cases = cases; - } - return SwitchStatement; - }()); - exports.SwitchStatement = SwitchStatement; - var TaggedTemplateExpression = (function () { - function TaggedTemplateExpression(tag, quasi) { - this.type = syntax_1.Syntax.TaggedTemplateExpression; - this.tag = tag; - this.quasi = quasi; - } - return TaggedTemplateExpression; - }()); - exports.TaggedTemplateExpression = TaggedTemplateExpression; - var TemplateElement = (function () { - function TemplateElement(value, tail) { - this.type = syntax_1.Syntax.TemplateElement; - this.value = value; - this.tail = tail; - } - return TemplateElement; - }()); - exports.TemplateElement = TemplateElement; - var TemplateLiteral = (function () { - function TemplateLiteral(quasis, expressions) { - this.type = syntax_1.Syntax.TemplateLiteral; - this.quasis = quasis; - this.expressions = expressions; - } - return TemplateLiteral; - }()); - exports.TemplateLiteral = TemplateLiteral; - var ThisExpression = (function () { - function ThisExpression() { - this.type = syntax_1.Syntax.ThisExpression; - } - return ThisExpression; - }()); - exports.ThisExpression = ThisExpression; - var ThrowStatement = (function () { - function ThrowStatement(argument) { - this.type = syntax_1.Syntax.ThrowStatement; - this.argument = argument; - } - return ThrowStatement; - }()); - exports.ThrowStatement = ThrowStatement; - var TryStatement = (function () { - function TryStatement(block, handler, finalizer) { - this.type = syntax_1.Syntax.TryStatement; - this.block = block; - this.handler = handler; - this.finalizer = finalizer; - } - return TryStatement; - }()); - exports.TryStatement = TryStatement; - var UnaryExpression = (function () { - function UnaryExpression(operator, argument) { - this.type = syntax_1.Syntax.UnaryExpression; - this.operator = operator; - this.argument = argument; - this.prefix = true; - } - return UnaryExpression; - }()); - exports.UnaryExpression = UnaryExpression; - var UpdateExpression = (function () { - function UpdateExpression(operator, argument, prefix) { - this.type = syntax_1.Syntax.UpdateExpression; - this.operator = operator; - this.argument = argument; - this.prefix = prefix; - } - return UpdateExpression; - }()); - exports.UpdateExpression = UpdateExpression; - var VariableDeclaration = (function () { - function VariableDeclaration(declarations, kind) { - this.type = syntax_1.Syntax.VariableDeclaration; - this.declarations = declarations; - this.kind = kind; - } - return VariableDeclaration; - }()); - exports.VariableDeclaration = VariableDeclaration; - var VariableDeclarator = (function () { - function VariableDeclarator(id, init) { - this.type = syntax_1.Syntax.VariableDeclarator; - this.id = id; - this.init = init; - } - return VariableDeclarator; - }()); - exports.VariableDeclarator = VariableDeclarator; - var WhileStatement = (function () { - function WhileStatement(test, body) { - this.type = syntax_1.Syntax.WhileStatement; - this.test = test; - this.body = body; - } - return WhileStatement; - }()); - exports.WhileStatement = WhileStatement; - var WithStatement = (function () { - function WithStatement(object, body) { - this.type = syntax_1.Syntax.WithStatement; - this.object = object; - this.body = body; - } - return WithStatement; - }()); - exports.WithStatement = WithStatement; - var YieldExpression = (function () { - function YieldExpression(argument, delegate) { - this.type = syntax_1.Syntax.YieldExpression; - this.argument = argument; - this.delegate = delegate; - } - return YieldExpression; - }()); - exports.YieldExpression = YieldExpression; - - -/***/ }, -/* 8 */ -/***/ function(module, exports, __webpack_require__) { - - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var assert_1 = __webpack_require__(9); - var error_handler_1 = __webpack_require__(10); - var messages_1 = __webpack_require__(11); - var Node = __webpack_require__(7); - var scanner_1 = __webpack_require__(12); - var syntax_1 = __webpack_require__(2); - var token_1 = __webpack_require__(13); - var ArrowParameterPlaceHolder = 'ArrowParameterPlaceHolder'; - var Parser = (function () { - function Parser(code, options, delegate) { - if (options === void 0) { options = {}; } - this.config = { - range: (typeof options.range === 'boolean') && options.range, - loc: (typeof options.loc === 'boolean') && options.loc, - source: null, - tokens: (typeof options.tokens === 'boolean') && options.tokens, - comment: (typeof options.comment === 'boolean') && options.comment, - tolerant: (typeof options.tolerant === 'boolean') && options.tolerant - }; - if (this.config.loc && options.source && options.source !== null) { - this.config.source = String(options.source); - } - this.delegate = delegate; - this.errorHandler = new error_handler_1.ErrorHandler(); - this.errorHandler.tolerant = this.config.tolerant; - this.scanner = new scanner_1.Scanner(code, this.errorHandler); - this.scanner.trackComment = this.config.comment; - this.operatorPrecedence = { - ')': 0, - ';': 0, - ',': 0, - '=': 0, - ']': 0, - '||': 1, - '&&': 2, - '|': 3, - '^': 4, - '&': 5, - '==': 6, - '!=': 6, - '===': 6, - '!==': 6, - '<': 7, - '>': 7, - '<=': 7, - '>=': 7, - '<<': 8, - '>>': 8, - '>>>': 8, - '+': 9, - '-': 9, - '*': 11, - '/': 11, - '%': 11 - }; - this.lookahead = { - type: 2 /* EOF */, - value: '', - lineNumber: this.scanner.lineNumber, - lineStart: 0, - start: 0, - end: 0 - }; - this.hasLineTerminator = false; - this.context = { - isModule: false, - await: false, - allowIn: true, - allowStrictDirective: true, - allowYield: true, - firstCoverInitializedNameError: null, - isAssignmentTarget: false, - isBindingElement: false, - inFunctionBody: false, - inIteration: false, - inSwitch: false, - labelSet: {}, - strict: false - }; - this.tokens = []; - this.startMarker = { - index: 0, - line: this.scanner.lineNumber, - column: 0 - }; - this.lastMarker = { - index: 0, - line: this.scanner.lineNumber, - column: 0 - }; - this.nextToken(); - this.lastMarker = { - index: this.scanner.index, - line: this.scanner.lineNumber, - column: this.scanner.index - this.scanner.lineStart - }; - } - Parser.prototype.throwError = function (messageFormat) { - var values = []; - for (var _i = 1; _i < arguments.length; _i++) { - values[_i - 1] = arguments[_i]; - } - var args = Array.prototype.slice.call(arguments, 1); - var msg = messageFormat.replace(/%(\d)/g, function (whole, idx) { - assert_1.assert(idx < args.length, 'Message reference must be in range'); - return args[idx]; - }); - var index = this.lastMarker.index; - var line = this.lastMarker.line; - var column = this.lastMarker.column + 1; - throw this.errorHandler.createError(index, line, column, msg); - }; - Parser.prototype.tolerateError = function (messageFormat) { - var values = []; - for (var _i = 1; _i < arguments.length; _i++) { - values[_i - 1] = arguments[_i]; - } - var args = Array.prototype.slice.call(arguments, 1); - var msg = messageFormat.replace(/%(\d)/g, function (whole, idx) { - assert_1.assert(idx < args.length, 'Message reference must be in range'); - return args[idx]; - }); - var index = this.lastMarker.index; - var line = this.scanner.lineNumber; - var column = this.lastMarker.column + 1; - this.errorHandler.tolerateError(index, line, column, msg); - }; - // Throw an exception because of the token. - Parser.prototype.unexpectedTokenError = function (token, message) { - var msg = message || messages_1.Messages.UnexpectedToken; - var value; - if (token) { - if (!message) { - msg = (token.type === 2 /* EOF */) ? messages_1.Messages.UnexpectedEOS : - (token.type === 3 /* Identifier */) ? messages_1.Messages.UnexpectedIdentifier : - (token.type === 6 /* NumericLiteral */) ? messages_1.Messages.UnexpectedNumber : - (token.type === 8 /* StringLiteral */) ? messages_1.Messages.UnexpectedString : - (token.type === 10 /* Template */) ? messages_1.Messages.UnexpectedTemplate : - messages_1.Messages.UnexpectedToken; - if (token.type === 4 /* Keyword */) { - if (this.scanner.isFutureReservedWord(token.value)) { - msg = messages_1.Messages.UnexpectedReserved; - } - else if (this.context.strict && this.scanner.isStrictModeReservedWord(token.value)) { - msg = messages_1.Messages.StrictReservedWord; - } - } - } - value = token.value; - } - else { - value = 'ILLEGAL'; - } - msg = msg.replace('%0', value); - if (token && typeof token.lineNumber === 'number') { - var index = token.start; - var line = token.lineNumber; - var lastMarkerLineStart = this.lastMarker.index - this.lastMarker.column; - var column = token.start - lastMarkerLineStart + 1; - return this.errorHandler.createError(index, line, column, msg); - } - else { - var index = this.lastMarker.index; - var line = this.lastMarker.line; - var column = this.lastMarker.column + 1; - return this.errorHandler.createError(index, line, column, msg); - } - }; - Parser.prototype.throwUnexpectedToken = function (token, message) { - throw this.unexpectedTokenError(token, message); - }; - Parser.prototype.tolerateUnexpectedToken = function (token, message) { - this.errorHandler.tolerate(this.unexpectedTokenError(token, message)); - }; - Parser.prototype.collectComments = function () { - if (!this.config.comment) { - this.scanner.scanComments(); - } - else { - var comments = this.scanner.scanComments(); - if (comments.length > 0 && this.delegate) { - for (var i = 0; i < comments.length; ++i) { - var e = comments[i]; - var node = void 0; - node = { - type: e.multiLine ? 'BlockComment' : 'LineComment', - value: this.scanner.source.slice(e.slice[0], e.slice[1]) - }; - if (this.config.range) { - node.range = e.range; - } - if (this.config.loc) { - node.loc = e.loc; - } - var metadata = { - start: { - line: e.loc.start.line, - column: e.loc.start.column, - offset: e.range[0] - }, - end: { - line: e.loc.end.line, - column: e.loc.end.column, - offset: e.range[1] - } - }; - this.delegate(node, metadata); - } - } - } - }; - // From internal representation to an external structure - Parser.prototype.getTokenRaw = function (token) { - return this.scanner.source.slice(token.start, token.end); - }; - Parser.prototype.convertToken = function (token) { - var t = { - type: token_1.TokenName[token.type], - value: this.getTokenRaw(token) - }; - if (this.config.range) { - t.range = [token.start, token.end]; - } - if (this.config.loc) { - t.loc = { - start: { - line: this.startMarker.line, - column: this.startMarker.column - }, - end: { - line: this.scanner.lineNumber, - column: this.scanner.index - this.scanner.lineStart - } - }; - } - if (token.type === 9 /* RegularExpression */) { - var pattern = token.pattern; - var flags = token.flags; - t.regex = { pattern: pattern, flags: flags }; - } - return t; - }; - Parser.prototype.nextToken = function () { - var token = this.lookahead; - this.lastMarker.index = this.scanner.index; - this.lastMarker.line = this.scanner.lineNumber; - this.lastMarker.column = this.scanner.index - this.scanner.lineStart; - this.collectComments(); - if (this.scanner.index !== this.startMarker.index) { - this.startMarker.index = this.scanner.index; - this.startMarker.line = this.scanner.lineNumber; - this.startMarker.column = this.scanner.index - this.scanner.lineStart; - } - var next = this.scanner.lex(); - this.hasLineTerminator = (token.lineNumber !== next.lineNumber); - if (next && this.context.strict && next.type === 3 /* Identifier */) { - if (this.scanner.isStrictModeReservedWord(next.value)) { - next.type = 4 /* Keyword */; - } - } - this.lookahead = next; - if (this.config.tokens && next.type !== 2 /* EOF */) { - this.tokens.push(this.convertToken(next)); - } - return token; - }; - Parser.prototype.nextRegexToken = function () { - this.collectComments(); - var token = this.scanner.scanRegExp(); - if (this.config.tokens) { - // Pop the previous token, '/' or '/=' - // This is added from the lookahead token. - this.tokens.pop(); - this.tokens.push(this.convertToken(token)); - } - // Prime the next lookahead. - this.lookahead = token; - this.nextToken(); - return token; - }; - Parser.prototype.createNode = function () { - return { - index: this.startMarker.index, - line: this.startMarker.line, - column: this.startMarker.column - }; - }; - Parser.prototype.startNode = function (token, lastLineStart) { - if (lastLineStart === void 0) { lastLineStart = 0; } - var column = token.start - token.lineStart; - var line = token.lineNumber; - if (column < 0) { - column += lastLineStart; - line--; - } - return { - index: token.start, - line: line, - column: column - }; - }; - Parser.prototype.finalize = function (marker, node) { - if (this.config.range) { - node.range = [marker.index, this.lastMarker.index]; - } - if (this.config.loc) { - node.loc = { - start: { - line: marker.line, - column: marker.column, - }, - end: { - line: this.lastMarker.line, - column: this.lastMarker.column - } - }; - if (this.config.source) { - node.loc.source = this.config.source; - } - } - if (this.delegate) { - var metadata = { - start: { - line: marker.line, - column: marker.column, - offset: marker.index - }, - end: { - line: this.lastMarker.line, - column: this.lastMarker.column, - offset: this.lastMarker.index - } - }; - this.delegate(node, metadata); - } - return node; - }; - // Expect the next token to match the specified punctuator. - // If not, an exception will be thrown. - Parser.prototype.expect = function (value) { - var token = this.nextToken(); - if (token.type !== 7 /* Punctuator */ || token.value !== value) { - this.throwUnexpectedToken(token); - } - }; - // Quietly expect a comma when in tolerant mode, otherwise delegates to expect(). - Parser.prototype.expectCommaSeparator = function () { - if (this.config.tolerant) { - var token = this.lookahead; - if (token.type === 7 /* Punctuator */ && token.value === ',') { - this.nextToken(); - } - else if (token.type === 7 /* Punctuator */ && token.value === ';') { - this.nextToken(); - this.tolerateUnexpectedToken(token); - } - else { - this.tolerateUnexpectedToken(token, messages_1.Messages.UnexpectedToken); - } - } - else { - this.expect(','); - } - }; - // Expect the next token to match the specified keyword. - // If not, an exception will be thrown. - Parser.prototype.expectKeyword = function (keyword) { - var token = this.nextToken(); - if (token.type !== 4 /* Keyword */ || token.value !== keyword) { - this.throwUnexpectedToken(token); - } - }; - // Return true if the next token matches the specified punctuator. - Parser.prototype.match = function (value) { - return this.lookahead.type === 7 /* Punctuator */ && this.lookahead.value === value; - }; - // Return true if the next token matches the specified keyword - Parser.prototype.matchKeyword = function (keyword) { - return this.lookahead.type === 4 /* Keyword */ && this.lookahead.value === keyword; - }; - // Return true if the next token matches the specified contextual keyword - // (where an identifier is sometimes a keyword depending on the context) - Parser.prototype.matchContextualKeyword = function (keyword) { - return this.lookahead.type === 3 /* Identifier */ && this.lookahead.value === keyword; - }; - // Return true if the next token is an assignment operator - Parser.prototype.matchAssign = function () { - if (this.lookahead.type !== 7 /* Punctuator */) { - return false; - } - var op = this.lookahead.value; - return op === '=' || - op === '*=' || - op === '**=' || - op === '/=' || - op === '%=' || - op === '+=' || - op === '-=' || - op === '<<=' || - op === '>>=' || - op === '>>>=' || - op === '&=' || - op === '^=' || - op === '|='; - }; - // Cover grammar support. - // - // When an assignment expression position starts with an left parenthesis, the determination of the type - // of the syntax is to be deferred arbitrarily long until the end of the parentheses pair (plus a lookahead) - // or the first comma. This situation also defers the determination of all the expressions nested in the pair. - // - // There are three productions that can be parsed in a parentheses pair that needs to be determined - // after the outermost pair is closed. They are: - // - // 1. AssignmentExpression - // 2. BindingElements - // 3. AssignmentTargets - // - // In order to avoid exponential backtracking, we use two flags to denote if the production can be - // binding element or assignment target. - // - // The three productions have the relationship: - // - // BindingElements ⊆ AssignmentTargets ⊆ AssignmentExpression - // - // with a single exception that CoverInitializedName when used directly in an Expression, generates - // an early error. Therefore, we need the third state, firstCoverInitializedNameError, to track the - // first usage of CoverInitializedName and report it when we reached the end of the parentheses pair. - // - // isolateCoverGrammar function runs the given parser function with a new cover grammar context, and it does not - // effect the current flags. This means the production the parser parses is only used as an expression. Therefore - // the CoverInitializedName check is conducted. - // - // inheritCoverGrammar function runs the given parse function with a new cover grammar context, and it propagates - // the flags outside of the parser. This means the production the parser parses is used as a part of a potential - // pattern. The CoverInitializedName check is deferred. - Parser.prototype.isolateCoverGrammar = function (parseFunction) { - var previousIsBindingElement = this.context.isBindingElement; - var previousIsAssignmentTarget = this.context.isAssignmentTarget; - var previousFirstCoverInitializedNameError = this.context.firstCoverInitializedNameError; - this.context.isBindingElement = true; - this.context.isAssignmentTarget = true; - this.context.firstCoverInitializedNameError = null; - var result = parseFunction.call(this); - if (this.context.firstCoverInitializedNameError !== null) { - this.throwUnexpectedToken(this.context.firstCoverInitializedNameError); - } - this.context.isBindingElement = previousIsBindingElement; - this.context.isAssignmentTarget = previousIsAssignmentTarget; - this.context.firstCoverInitializedNameError = previousFirstCoverInitializedNameError; - return result; - }; - Parser.prototype.inheritCoverGrammar = function (parseFunction) { - var previousIsBindingElement = this.context.isBindingElement; - var previousIsAssignmentTarget = this.context.isAssignmentTarget; - var previousFirstCoverInitializedNameError = this.context.firstCoverInitializedNameError; - this.context.isBindingElement = true; - this.context.isAssignmentTarget = true; - this.context.firstCoverInitializedNameError = null; - var result = parseFunction.call(this); - this.context.isBindingElement = this.context.isBindingElement && previousIsBindingElement; - this.context.isAssignmentTarget = this.context.isAssignmentTarget && previousIsAssignmentTarget; - this.context.firstCoverInitializedNameError = previousFirstCoverInitializedNameError || this.context.firstCoverInitializedNameError; - return result; - }; - Parser.prototype.consumeSemicolon = function () { - if (this.match(';')) { - this.nextToken(); - } - else if (!this.hasLineTerminator) { - if (this.lookahead.type !== 2 /* EOF */ && !this.match('}')) { - this.throwUnexpectedToken(this.lookahead); - } - this.lastMarker.index = this.startMarker.index; - this.lastMarker.line = this.startMarker.line; - this.lastMarker.column = this.startMarker.column; - } - }; - // https://tc39.github.io/ecma262/#sec-primary-expression - Parser.prototype.parsePrimaryExpression = function () { - var node = this.createNode(); - var expr; - var token, raw; - switch (this.lookahead.type) { - case 3 /* Identifier */: - if ((this.context.isModule || this.context.await) && this.lookahead.value === 'await') { - this.tolerateUnexpectedToken(this.lookahead); - } - expr = this.matchAsyncFunction() ? this.parseFunctionExpression() : this.finalize(node, new Node.Identifier(this.nextToken().value)); - break; - case 6 /* NumericLiteral */: - case 8 /* StringLiteral */: - if (this.context.strict && this.lookahead.octal) { - this.tolerateUnexpectedToken(this.lookahead, messages_1.Messages.StrictOctalLiteral); - } - this.context.isAssignmentTarget = false; - this.context.isBindingElement = false; - token = this.nextToken(); - raw = this.getTokenRaw(token); - expr = this.finalize(node, new Node.Literal(token.value, raw)); - break; - case 1 /* BooleanLiteral */: - this.context.isAssignmentTarget = false; - this.context.isBindingElement = false; - token = this.nextToken(); - raw = this.getTokenRaw(token); - expr = this.finalize(node, new Node.Literal(token.value === 'true', raw)); - break; - case 5 /* NullLiteral */: - this.context.isAssignmentTarget = false; - this.context.isBindingElement = false; - token = this.nextToken(); - raw = this.getTokenRaw(token); - expr = this.finalize(node, new Node.Literal(null, raw)); - break; - case 10 /* Template */: - expr = this.parseTemplateLiteral(); - break; - case 7 /* Punctuator */: - switch (this.lookahead.value) { - case '(': - this.context.isBindingElement = false; - expr = this.inheritCoverGrammar(this.parseGroupExpression); - break; - case '[': - expr = this.inheritCoverGrammar(this.parseArrayInitializer); - break; - case '{': - expr = this.inheritCoverGrammar(this.parseObjectInitializer); - break; - case '/': - case '/=': - this.context.isAssignmentTarget = false; - this.context.isBindingElement = false; - this.scanner.index = this.startMarker.index; - token = this.nextRegexToken(); - raw = this.getTokenRaw(token); - expr = this.finalize(node, new Node.RegexLiteral(token.regex, raw, token.pattern, token.flags)); - break; - default: - expr = this.throwUnexpectedToken(this.nextToken()); - } - break; - case 4 /* Keyword */: - if (!this.context.strict && this.context.allowYield && this.matchKeyword('yield')) { - expr = this.parseIdentifierName(); - } - else if (!this.context.strict && this.matchKeyword('let')) { - expr = this.finalize(node, new Node.Identifier(this.nextToken().value)); - } - else { - this.context.isAssignmentTarget = false; - this.context.isBindingElement = false; - if (this.matchKeyword('function')) { - expr = this.parseFunctionExpression(); - } - else if (this.matchKeyword('this')) { - this.nextToken(); - expr = this.finalize(node, new Node.ThisExpression()); - } - else if (this.matchKeyword('class')) { - expr = this.parseClassExpression(); - } - else { - expr = this.throwUnexpectedToken(this.nextToken()); - } - } - break; - default: - expr = this.throwUnexpectedToken(this.nextToken()); - } - return expr; - }; - // https://tc39.github.io/ecma262/#sec-array-initializer - Parser.prototype.parseSpreadElement = function () { - var node = this.createNode(); - this.expect('...'); - var arg = this.inheritCoverGrammar(this.parseAssignmentExpression); - return this.finalize(node, new Node.SpreadElement(arg)); - }; - Parser.prototype.parseArrayInitializer = function () { - var node = this.createNode(); - var elements = []; - this.expect('['); - while (!this.match(']')) { - if (this.match(',')) { - this.nextToken(); - elements.push(null); - } - else if (this.match('...')) { - var element = this.parseSpreadElement(); - if (!this.match(']')) { - this.context.isAssignmentTarget = false; - this.context.isBindingElement = false; - this.expect(','); - } - elements.push(element); - } - else { - elements.push(this.inheritCoverGrammar(this.parseAssignmentExpression)); - if (!this.match(']')) { - this.expect(','); - } - } - } - this.expect(']'); - return this.finalize(node, new Node.ArrayExpression(elements)); - }; - // https://tc39.github.io/ecma262/#sec-object-initializer - Parser.prototype.parsePropertyMethod = function (params) { - this.context.isAssignmentTarget = false; - this.context.isBindingElement = false; - var previousStrict = this.context.strict; - var previousAllowStrictDirective = this.context.allowStrictDirective; - this.context.allowStrictDirective = params.simple; - var body = this.isolateCoverGrammar(this.parseFunctionSourceElements); - if (this.context.strict && params.firstRestricted) { - this.tolerateUnexpectedToken(params.firstRestricted, params.message); - } - if (this.context.strict && params.stricted) { - this.tolerateUnexpectedToken(params.stricted, params.message); - } - this.context.strict = previousStrict; - this.context.allowStrictDirective = previousAllowStrictDirective; - return body; - }; - Parser.prototype.parsePropertyMethodFunction = function () { - var isGenerator = false; - var node = this.createNode(); - var previousAllowYield = this.context.allowYield; - this.context.allowYield = true; - var params = this.parseFormalParameters(); - var method = this.parsePropertyMethod(params); - this.context.allowYield = previousAllowYield; - return this.finalize(node, new Node.FunctionExpression(null, params.params, method, isGenerator)); - }; - Parser.prototype.parsePropertyMethodAsyncFunction = function () { - var node = this.createNode(); - var previousAllowYield = this.context.allowYield; - var previousAwait = this.context.await; - this.context.allowYield = false; - this.context.await = true; - var params = this.parseFormalParameters(); - var method = this.parsePropertyMethod(params); - this.context.allowYield = previousAllowYield; - this.context.await = previousAwait; - return this.finalize(node, new Node.AsyncFunctionExpression(null, params.params, method)); - }; - Parser.prototype.parseObjectPropertyKey = function () { - var node = this.createNode(); - var token = this.nextToken(); - var key; - switch (token.type) { - case 8 /* StringLiteral */: - case 6 /* NumericLiteral */: - if (this.context.strict && token.octal) { - this.tolerateUnexpectedToken(token, messages_1.Messages.StrictOctalLiteral); - } - var raw = this.getTokenRaw(token); - key = this.finalize(node, new Node.Literal(token.value, raw)); - break; - case 3 /* Identifier */: - case 1 /* BooleanLiteral */: - case 5 /* NullLiteral */: - case 4 /* Keyword */: - key = this.finalize(node, new Node.Identifier(token.value)); - break; - case 7 /* Punctuator */: - if (token.value === '[') { - key = this.isolateCoverGrammar(this.parseAssignmentExpression); - this.expect(']'); - } - else { - key = this.throwUnexpectedToken(token); - } - break; - default: - key = this.throwUnexpectedToken(token); - } - return key; - }; - Parser.prototype.isPropertyKey = function (key, value) { - return (key.type === syntax_1.Syntax.Identifier && key.name === value) || - (key.type === syntax_1.Syntax.Literal && key.value === value); - }; - Parser.prototype.parseObjectProperty = function (hasProto) { - var node = this.createNode(); - var token = this.lookahead; - var kind; - var key = null; - var value = null; - var computed = false; - var method = false; - var shorthand = false; - var isAsync = false; - if (token.type === 3 /* Identifier */) { - var id = token.value; - this.nextToken(); - computed = this.match('['); - isAsync = !this.hasLineTerminator && (id === 'async') && - !this.match(':') && !this.match('(') && !this.match('*') && !this.match(','); - key = isAsync ? this.parseObjectPropertyKey() : this.finalize(node, new Node.Identifier(id)); - } - else if (this.match('*')) { - this.nextToken(); - } - else { - computed = this.match('['); - key = this.parseObjectPropertyKey(); - } - var lookaheadPropertyKey = this.qualifiedPropertyName(this.lookahead); - if (token.type === 3 /* Identifier */ && !isAsync && token.value === 'get' && lookaheadPropertyKey) { - kind = 'get'; - computed = this.match('['); - key = this.parseObjectPropertyKey(); - this.context.allowYield = false; - value = this.parseGetterMethod(); - } - else if (token.type === 3 /* Identifier */ && !isAsync && token.value === 'set' && lookaheadPropertyKey) { - kind = 'set'; - computed = this.match('['); - key = this.parseObjectPropertyKey(); - value = this.parseSetterMethod(); - } - else if (token.type === 7 /* Punctuator */ && token.value === '*' && lookaheadPropertyKey) { - kind = 'init'; - computed = this.match('['); - key = this.parseObjectPropertyKey(); - value = this.parseGeneratorMethod(); - method = true; - } - else { - if (!key) { - this.throwUnexpectedToken(this.lookahead); - } - kind = 'init'; - if (this.match(':') && !isAsync) { - if (!computed && this.isPropertyKey(key, '__proto__')) { - if (hasProto.value) { - this.tolerateError(messages_1.Messages.DuplicateProtoProperty); - } - hasProto.value = true; - } - this.nextToken(); - value = this.inheritCoverGrammar(this.parseAssignmentExpression); - } - else if (this.match('(')) { - value = isAsync ? this.parsePropertyMethodAsyncFunction() : this.parsePropertyMethodFunction(); - method = true; - } - else if (token.type === 3 /* Identifier */) { - var id = this.finalize(node, new Node.Identifier(token.value)); - if (this.match('=')) { - this.context.firstCoverInitializedNameError = this.lookahead; - this.nextToken(); - shorthand = true; - var init = this.isolateCoverGrammar(this.parseAssignmentExpression); - value = this.finalize(node, new Node.AssignmentPattern(id, init)); - } - else { - shorthand = true; - value = id; - } - } - else { - this.throwUnexpectedToken(this.nextToken()); - } - } - return this.finalize(node, new Node.Property(kind, key, computed, value, method, shorthand)); - }; - Parser.prototype.parseObjectInitializer = function () { - var node = this.createNode(); - this.expect('{'); - var properties = []; - var hasProto = { value: false }; - while (!this.match('}')) { - properties.push(this.parseObjectProperty(hasProto)); - if (!this.match('}')) { - this.expectCommaSeparator(); - } - } - this.expect('}'); - return this.finalize(node, new Node.ObjectExpression(properties)); - }; - // https://tc39.github.io/ecma262/#sec-template-literals - Parser.prototype.parseTemplateHead = function () { - assert_1.assert(this.lookahead.head, 'Template literal must start with a template head'); - var node = this.createNode(); - var token = this.nextToken(); - var raw = token.value; - var cooked = token.cooked; - return this.finalize(node, new Node.TemplateElement({ raw: raw, cooked: cooked }, token.tail)); - }; - Parser.prototype.parseTemplateElement = function () { - if (this.lookahead.type !== 10 /* Template */) { - this.throwUnexpectedToken(); - } - var node = this.createNode(); - var token = this.nextToken(); - var raw = token.value; - var cooked = token.cooked; - return this.finalize(node, new Node.TemplateElement({ raw: raw, cooked: cooked }, token.tail)); - }; - Parser.prototype.parseTemplateLiteral = function () { - var node = this.createNode(); - var expressions = []; - var quasis = []; - var quasi = this.parseTemplateHead(); - quasis.push(quasi); - while (!quasi.tail) { - expressions.push(this.parseExpression()); - quasi = this.parseTemplateElement(); - quasis.push(quasi); - } - return this.finalize(node, new Node.TemplateLiteral(quasis, expressions)); - }; - // https://tc39.github.io/ecma262/#sec-grouping-operator - Parser.prototype.reinterpretExpressionAsPattern = function (expr) { - switch (expr.type) { - case syntax_1.Syntax.Identifier: - case syntax_1.Syntax.MemberExpression: - case syntax_1.Syntax.RestElement: - case syntax_1.Syntax.AssignmentPattern: - break; - case syntax_1.Syntax.SpreadElement: - expr.type = syntax_1.Syntax.RestElement; - this.reinterpretExpressionAsPattern(expr.argument); - break; - case syntax_1.Syntax.ArrayExpression: - expr.type = syntax_1.Syntax.ArrayPattern; - for (var i = 0; i < expr.elements.length; i++) { - if (expr.elements[i] !== null) { - this.reinterpretExpressionAsPattern(expr.elements[i]); - } - } - break; - case syntax_1.Syntax.ObjectExpression: - expr.type = syntax_1.Syntax.ObjectPattern; - for (var i = 0; i < expr.properties.length; i++) { - this.reinterpretExpressionAsPattern(expr.properties[i].value); - } - break; - case syntax_1.Syntax.AssignmentExpression: - expr.type = syntax_1.Syntax.AssignmentPattern; - delete expr.operator; - this.reinterpretExpressionAsPattern(expr.left); - break; - default: - // Allow other node type for tolerant parsing. - break; - } - }; - Parser.prototype.parseGroupExpression = function () { - var expr; - this.expect('('); - if (this.match(')')) { - this.nextToken(); - if (!this.match('=>')) { - this.expect('=>'); - } - expr = { - type: ArrowParameterPlaceHolder, - params: [], - async: false - }; - } - else { - var startToken = this.lookahead; - var params = []; - if (this.match('...')) { - expr = this.parseRestElement(params); - this.expect(')'); - if (!this.match('=>')) { - this.expect('=>'); - } - expr = { - type: ArrowParameterPlaceHolder, - params: [expr], - async: false - }; - } - else { - var arrow = false; - this.context.isBindingElement = true; - expr = this.inheritCoverGrammar(this.parseAssignmentExpression); - if (this.match(',')) { - var expressions = []; - this.context.isAssignmentTarget = false; - expressions.push(expr); - while (this.lookahead.type !== 2 /* EOF */) { - if (!this.match(',')) { - break; - } - this.nextToken(); - if (this.match(')')) { - this.nextToken(); - for (var i = 0; i < expressions.length; i++) { - this.reinterpretExpressionAsPattern(expressions[i]); - } - arrow = true; - expr = { - type: ArrowParameterPlaceHolder, - params: expressions, - async: false - }; - } - else if (this.match('...')) { - if (!this.context.isBindingElement) { - this.throwUnexpectedToken(this.lookahead); - } - expressions.push(this.parseRestElement(params)); - this.expect(')'); - if (!this.match('=>')) { - this.expect('=>'); - } - this.context.isBindingElement = false; - for (var i = 0; i < expressions.length; i++) { - this.reinterpretExpressionAsPattern(expressions[i]); - } - arrow = true; - expr = { - type: ArrowParameterPlaceHolder, - params: expressions, - async: false - }; - } - else { - expressions.push(this.inheritCoverGrammar(this.parseAssignmentExpression)); - } - if (arrow) { - break; - } - } - if (!arrow) { - expr = this.finalize(this.startNode(startToken), new Node.SequenceExpression(expressions)); - } - } - if (!arrow) { - this.expect(')'); - if (this.match('=>')) { - if (expr.type === syntax_1.Syntax.Identifier && expr.name === 'yield') { - arrow = true; - expr = { - type: ArrowParameterPlaceHolder, - params: [expr], - async: false - }; - } - if (!arrow) { - if (!this.context.isBindingElement) { - this.throwUnexpectedToken(this.lookahead); - } - if (expr.type === syntax_1.Syntax.SequenceExpression) { - for (var i = 0; i < expr.expressions.length; i++) { - this.reinterpretExpressionAsPattern(expr.expressions[i]); - } - } - else { - this.reinterpretExpressionAsPattern(expr); - } - var parameters = (expr.type === syntax_1.Syntax.SequenceExpression ? expr.expressions : [expr]); - expr = { - type: ArrowParameterPlaceHolder, - params: parameters, - async: false - }; - } - } - this.context.isBindingElement = false; - } - } - } - return expr; - }; - // https://tc39.github.io/ecma262/#sec-left-hand-side-expressions - Parser.prototype.parseArguments = function () { - this.expect('('); - var args = []; - if (!this.match(')')) { - while (true) { - var expr = this.match('...') ? this.parseSpreadElement() : - this.isolateCoverGrammar(this.parseAssignmentExpression); - args.push(expr); - if (this.match(')')) { - break; - } - this.expectCommaSeparator(); - if (this.match(')')) { - break; - } - } - } - this.expect(')'); - return args; - }; - Parser.prototype.isIdentifierName = function (token) { - return token.type === 3 /* Identifier */ || - token.type === 4 /* Keyword */ || - token.type === 1 /* BooleanLiteral */ || - token.type === 5 /* NullLiteral */; - }; - Parser.prototype.parseIdentifierName = function () { - var node = this.createNode(); - var token = this.nextToken(); - if (!this.isIdentifierName(token)) { - this.throwUnexpectedToken(token); - } - return this.finalize(node, new Node.Identifier(token.value)); - }; - Parser.prototype.parseNewExpression = function () { - var node = this.createNode(); - var id = this.parseIdentifierName(); - assert_1.assert(id.name === 'new', 'New expression must start with `new`'); - var expr; - if (this.match('.')) { - this.nextToken(); - if (this.lookahead.type === 3 /* Identifier */ && this.context.inFunctionBody && this.lookahead.value === 'target') { - var property = this.parseIdentifierName(); - expr = new Node.MetaProperty(id, property); - } - else { - this.throwUnexpectedToken(this.lookahead); - } - } - else { - var callee = this.isolateCoverGrammar(this.parseLeftHandSideExpression); - var args = this.match('(') ? this.parseArguments() : []; - expr = new Node.NewExpression(callee, args); - this.context.isAssignmentTarget = false; - this.context.isBindingElement = false; - } - return this.finalize(node, expr); - }; - Parser.prototype.parseAsyncArgument = function () { - var arg = this.parseAssignmentExpression(); - this.context.firstCoverInitializedNameError = null; - return arg; - }; - Parser.prototype.parseAsyncArguments = function () { - this.expect('('); - var args = []; - if (!this.match(')')) { - while (true) { - var expr = this.match('...') ? this.parseSpreadElement() : - this.isolateCoverGrammar(this.parseAsyncArgument); - args.push(expr); - if (this.match(')')) { - break; - } - this.expectCommaSeparator(); - if (this.match(')')) { - break; - } - } - } - this.expect(')'); - return args; - }; - Parser.prototype.parseLeftHandSideExpressionAllowCall = function () { - var startToken = this.lookahead; - var maybeAsync = this.matchContextualKeyword('async'); - var previousAllowIn = this.context.allowIn; - this.context.allowIn = true; - var expr; - if (this.matchKeyword('super') && this.context.inFunctionBody) { - expr = this.createNode(); - this.nextToken(); - expr = this.finalize(expr, new Node.Super()); - if (!this.match('(') && !this.match('.') && !this.match('[')) { - this.throwUnexpectedToken(this.lookahead); - } - } - else { - expr = this.inheritCoverGrammar(this.matchKeyword('new') ? this.parseNewExpression : this.parsePrimaryExpression); - } - while (true) { - if (this.match('.')) { - this.context.isBindingElement = false; - this.context.isAssignmentTarget = true; - this.expect('.'); - var property = this.parseIdentifierName(); - expr = this.finalize(this.startNode(startToken), new Node.StaticMemberExpression(expr, property)); - } - else if (this.match('(')) { - var asyncArrow = maybeAsync && (startToken.lineNumber === this.lookahead.lineNumber); - this.context.isBindingElement = false; - this.context.isAssignmentTarget = false; - var args = asyncArrow ? this.parseAsyncArguments() : this.parseArguments(); - expr = this.finalize(this.startNode(startToken), new Node.CallExpression(expr, args)); - if (asyncArrow && this.match('=>')) { - for (var i = 0; i < args.length; ++i) { - this.reinterpretExpressionAsPattern(args[i]); - } - expr = { - type: ArrowParameterPlaceHolder, - params: args, - async: true - }; - } - } - else if (this.match('[')) { - this.context.isBindingElement = false; - this.context.isAssignmentTarget = true; - this.expect('['); - var property = this.isolateCoverGrammar(this.parseExpression); - this.expect(']'); - expr = this.finalize(this.startNode(startToken), new Node.ComputedMemberExpression(expr, property)); - } - else if (this.lookahead.type === 10 /* Template */ && this.lookahead.head) { - var quasi = this.parseTemplateLiteral(); - expr = this.finalize(this.startNode(startToken), new Node.TaggedTemplateExpression(expr, quasi)); - } - else { - break; - } - } - this.context.allowIn = previousAllowIn; - return expr; - }; - Parser.prototype.parseSuper = function () { - var node = this.createNode(); - this.expectKeyword('super'); - if (!this.match('[') && !this.match('.')) { - this.throwUnexpectedToken(this.lookahead); - } - return this.finalize(node, new Node.Super()); - }; - Parser.prototype.parseLeftHandSideExpression = function () { - assert_1.assert(this.context.allowIn, 'callee of new expression always allow in keyword.'); - var node = this.startNode(this.lookahead); - var expr = (this.matchKeyword('super') && this.context.inFunctionBody) ? this.parseSuper() : - this.inheritCoverGrammar(this.matchKeyword('new') ? this.parseNewExpression : this.parsePrimaryExpression); - while (true) { - if (this.match('[')) { - this.context.isBindingElement = false; - this.context.isAssignmentTarget = true; - this.expect('['); - var property = this.isolateCoverGrammar(this.parseExpression); - this.expect(']'); - expr = this.finalize(node, new Node.ComputedMemberExpression(expr, property)); - } - else if (this.match('.')) { - this.context.isBindingElement = false; - this.context.isAssignmentTarget = true; - this.expect('.'); - var property = this.parseIdentifierName(); - expr = this.finalize(node, new Node.StaticMemberExpression(expr, property)); - } - else if (this.lookahead.type === 10 /* Template */ && this.lookahead.head) { - var quasi = this.parseTemplateLiteral(); - expr = this.finalize(node, new Node.TaggedTemplateExpression(expr, quasi)); - } - else { - break; - } - } - return expr; - }; - // https://tc39.github.io/ecma262/#sec-update-expressions - Parser.prototype.parseUpdateExpression = function () { - var expr; - var startToken = this.lookahead; - if (this.match('++') || this.match('--')) { - var node = this.startNode(startToken); - var token = this.nextToken(); - expr = this.inheritCoverGrammar(this.parseUnaryExpression); - if (this.context.strict && expr.type === syntax_1.Syntax.Identifier && this.scanner.isRestrictedWord(expr.name)) { - this.tolerateError(messages_1.Messages.StrictLHSPrefix); - } - if (!this.context.isAssignmentTarget) { - this.tolerateError(messages_1.Messages.InvalidLHSInAssignment); - } - var prefix = true; - expr = this.finalize(node, new Node.UpdateExpression(token.value, expr, prefix)); - this.context.isAssignmentTarget = false; - this.context.isBindingElement = false; - } - else { - expr = this.inheritCoverGrammar(this.parseLeftHandSideExpressionAllowCall); - if (!this.hasLineTerminator && this.lookahead.type === 7 /* Punctuator */) { - if (this.match('++') || this.match('--')) { - if (this.context.strict && expr.type === syntax_1.Syntax.Identifier && this.scanner.isRestrictedWord(expr.name)) { - this.tolerateError(messages_1.Messages.StrictLHSPostfix); - } - if (!this.context.isAssignmentTarget) { - this.tolerateError(messages_1.Messages.InvalidLHSInAssignment); - } - this.context.isAssignmentTarget = false; - this.context.isBindingElement = false; - var operator = this.nextToken().value; - var prefix = false; - expr = this.finalize(this.startNode(startToken), new Node.UpdateExpression(operator, expr, prefix)); - } - } - } - return expr; - }; - // https://tc39.github.io/ecma262/#sec-unary-operators - Parser.prototype.parseAwaitExpression = function () { - var node = this.createNode(); - this.nextToken(); - var argument = this.parseUnaryExpression(); - return this.finalize(node, new Node.AwaitExpression(argument)); - }; - Parser.prototype.parseUnaryExpression = function () { - var expr; - if (this.match('+') || this.match('-') || this.match('~') || this.match('!') || - this.matchKeyword('delete') || this.matchKeyword('void') || this.matchKeyword('typeof')) { - var node = this.startNode(this.lookahead); - var token = this.nextToken(); - expr = this.inheritCoverGrammar(this.parseUnaryExpression); - expr = this.finalize(node, new Node.UnaryExpression(token.value, expr)); - if (this.context.strict && expr.operator === 'delete' && expr.argument.type === syntax_1.Syntax.Identifier) { - this.tolerateError(messages_1.Messages.StrictDelete); - } - this.context.isAssignmentTarget = false; - this.context.isBindingElement = false; - } - else if (this.context.await && this.matchContextualKeyword('await')) { - expr = this.parseAwaitExpression(); - } - else { - expr = this.parseUpdateExpression(); - } - return expr; - }; - Parser.prototype.parseExponentiationExpression = function () { - var startToken = this.lookahead; - var expr = this.inheritCoverGrammar(this.parseUnaryExpression); - if (expr.type !== syntax_1.Syntax.UnaryExpression && this.match('**')) { - this.nextToken(); - this.context.isAssignmentTarget = false; - this.context.isBindingElement = false; - var left = expr; - var right = this.isolateCoverGrammar(this.parseExponentiationExpression); - expr = this.finalize(this.startNode(startToken), new Node.BinaryExpression('**', left, right)); - } - return expr; - }; - // https://tc39.github.io/ecma262/#sec-exp-operator - // https://tc39.github.io/ecma262/#sec-multiplicative-operators - // https://tc39.github.io/ecma262/#sec-additive-operators - // https://tc39.github.io/ecma262/#sec-bitwise-shift-operators - // https://tc39.github.io/ecma262/#sec-relational-operators - // https://tc39.github.io/ecma262/#sec-equality-operators - // https://tc39.github.io/ecma262/#sec-binary-bitwise-operators - // https://tc39.github.io/ecma262/#sec-binary-logical-operators - Parser.prototype.binaryPrecedence = function (token) { - var op = token.value; - var precedence; - if (token.type === 7 /* Punctuator */) { - precedence = this.operatorPrecedence[op] || 0; - } - else if (token.type === 4 /* Keyword */) { - precedence = (op === 'instanceof' || (this.context.allowIn && op === 'in')) ? 7 : 0; - } - else { - precedence = 0; - } - return precedence; - }; - Parser.prototype.parseBinaryExpression = function () { - var startToken = this.lookahead; - var expr = this.inheritCoverGrammar(this.parseExponentiationExpression); - var token = this.lookahead; - var prec = this.binaryPrecedence(token); - if (prec > 0) { - this.nextToken(); - this.context.isAssignmentTarget = false; - this.context.isBindingElement = false; - var markers = [startToken, this.lookahead]; - var left = expr; - var right = this.isolateCoverGrammar(this.parseExponentiationExpression); - var stack = [left, token.value, right]; - var precedences = [prec]; - while (true) { - prec = this.binaryPrecedence(this.lookahead); - if (prec <= 0) { - break; - } - // Reduce: make a binary expression from the three topmost entries. - while ((stack.length > 2) && (prec <= precedences[precedences.length - 1])) { - right = stack.pop(); - var operator = stack.pop(); - precedences.pop(); - left = stack.pop(); - markers.pop(); - var node = this.startNode(markers[markers.length - 1]); - stack.push(this.finalize(node, new Node.BinaryExpression(operator, left, right))); - } - // Shift. - stack.push(this.nextToken().value); - precedences.push(prec); - markers.push(this.lookahead); - stack.push(this.isolateCoverGrammar(this.parseExponentiationExpression)); - } - // Final reduce to clean-up the stack. - var i = stack.length - 1; - expr = stack[i]; - var lastMarker = markers.pop(); - while (i > 1) { - var marker = markers.pop(); - var lastLineStart = lastMarker && lastMarker.lineStart; - var node = this.startNode(marker, lastLineStart); - var operator = stack[i - 1]; - expr = this.finalize(node, new Node.BinaryExpression(operator, stack[i - 2], expr)); - i -= 2; - lastMarker = marker; - } - } - return expr; - }; - // https://tc39.github.io/ecma262/#sec-conditional-operator - Parser.prototype.parseConditionalExpression = function () { - var startToken = this.lookahead; - var expr = this.inheritCoverGrammar(this.parseBinaryExpression); - if (this.match('?')) { - this.nextToken(); - var previousAllowIn = this.context.allowIn; - this.context.allowIn = true; - var consequent = this.isolateCoverGrammar(this.parseAssignmentExpression); - this.context.allowIn = previousAllowIn; - this.expect(':'); - var alternate = this.isolateCoverGrammar(this.parseAssignmentExpression); - expr = this.finalize(this.startNode(startToken), new Node.ConditionalExpression(expr, consequent, alternate)); - this.context.isAssignmentTarget = false; - this.context.isBindingElement = false; - } - return expr; - }; - // https://tc39.github.io/ecma262/#sec-assignment-operators - Parser.prototype.checkPatternParam = function (options, param) { - switch (param.type) { - case syntax_1.Syntax.Identifier: - this.validateParam(options, param, param.name); - break; - case syntax_1.Syntax.RestElement: - this.checkPatternParam(options, param.argument); - break; - case syntax_1.Syntax.AssignmentPattern: - this.checkPatternParam(options, param.left); - break; - case syntax_1.Syntax.ArrayPattern: - for (var i = 0; i < param.elements.length; i++) { - if (param.elements[i] !== null) { - this.checkPatternParam(options, param.elements[i]); - } - } - break; - case syntax_1.Syntax.ObjectPattern: - for (var i = 0; i < param.properties.length; i++) { - this.checkPatternParam(options, param.properties[i].value); - } - break; - default: - break; - } - options.simple = options.simple && (param instanceof Node.Identifier); - }; - Parser.prototype.reinterpretAsCoverFormalsList = function (expr) { - var params = [expr]; - var options; - var asyncArrow = false; - switch (expr.type) { - case syntax_1.Syntax.Identifier: - break; - case ArrowParameterPlaceHolder: - params = expr.params; - asyncArrow = expr.async; - break; - default: - return null; - } - options = { - simple: true, - paramSet: {} - }; - for (var i = 0; i < params.length; ++i) { - var param = params[i]; - if (param.type === syntax_1.Syntax.AssignmentPattern) { - if (param.right.type === syntax_1.Syntax.YieldExpression) { - if (param.right.argument) { - this.throwUnexpectedToken(this.lookahead); - } - param.right.type = syntax_1.Syntax.Identifier; - param.right.name = 'yield'; - delete param.right.argument; - delete param.right.delegate; - } - } - else if (asyncArrow && param.type === syntax_1.Syntax.Identifier && param.name === 'await') { - this.throwUnexpectedToken(this.lookahead); - } - this.checkPatternParam(options, param); - params[i] = param; - } - if (this.context.strict || !this.context.allowYield) { - for (var i = 0; i < params.length; ++i) { - var param = params[i]; - if (param.type === syntax_1.Syntax.YieldExpression) { - this.throwUnexpectedToken(this.lookahead); - } - } - } - if (options.message === messages_1.Messages.StrictParamDupe) { - var token = this.context.strict ? options.stricted : options.firstRestricted; - this.throwUnexpectedToken(token, options.message); - } - return { - simple: options.simple, - params: params, - stricted: options.stricted, - firstRestricted: options.firstRestricted, - message: options.message - }; - }; - Parser.prototype.parseAssignmentExpression = function () { - var expr; - if (!this.context.allowYield && this.matchKeyword('yield')) { - expr = this.parseYieldExpression(); - } - else { - var startToken = this.lookahead; - var token = startToken; - expr = this.parseConditionalExpression(); - if (token.type === 3 /* Identifier */ && (token.lineNumber === this.lookahead.lineNumber) && token.value === 'async') { - if (this.lookahead.type === 3 /* Identifier */ || this.matchKeyword('yield')) { - var arg = this.parsePrimaryExpression(); - this.reinterpretExpressionAsPattern(arg); - expr = { - type: ArrowParameterPlaceHolder, - params: [arg], - async: true - }; - } - } - if (expr.type === ArrowParameterPlaceHolder || this.match('=>')) { - // https://tc39.github.io/ecma262/#sec-arrow-function-definitions - this.context.isAssignmentTarget = false; - this.context.isBindingElement = false; - var isAsync = expr.async; - var list = this.reinterpretAsCoverFormalsList(expr); - if (list) { - if (this.hasLineTerminator) { - this.tolerateUnexpectedToken(this.lookahead); - } - this.context.firstCoverInitializedNameError = null; - var previousStrict = this.context.strict; - var previousAllowStrictDirective = this.context.allowStrictDirective; - this.context.allowStrictDirective = list.simple; - var previousAllowYield = this.context.allowYield; - var previousAwait = this.context.await; - this.context.allowYield = true; - this.context.await = isAsync; - var node = this.startNode(startToken); - this.expect('=>'); - var body = void 0; - if (this.match('{')) { - var previousAllowIn = this.context.allowIn; - this.context.allowIn = true; - body = this.parseFunctionSourceElements(); - this.context.allowIn = previousAllowIn; - } - else { - body = this.isolateCoverGrammar(this.parseAssignmentExpression); - } - var expression = body.type !== syntax_1.Syntax.BlockStatement; - if (this.context.strict && list.firstRestricted) { - this.throwUnexpectedToken(list.firstRestricted, list.message); - } - if (this.context.strict && list.stricted) { - this.tolerateUnexpectedToken(list.stricted, list.message); - } - expr = isAsync ? this.finalize(node, new Node.AsyncArrowFunctionExpression(list.params, body, expression)) : - this.finalize(node, new Node.ArrowFunctionExpression(list.params, body, expression)); - this.context.strict = previousStrict; - this.context.allowStrictDirective = previousAllowStrictDirective; - this.context.allowYield = previousAllowYield; - this.context.await = previousAwait; - } - } - else { - if (this.matchAssign()) { - if (!this.context.isAssignmentTarget) { - this.tolerateError(messages_1.Messages.InvalidLHSInAssignment); - } - if (this.context.strict && expr.type === syntax_1.Syntax.Identifier) { - var id = expr; - if (this.scanner.isRestrictedWord(id.name)) { - this.tolerateUnexpectedToken(token, messages_1.Messages.StrictLHSAssignment); - } - if (this.scanner.isStrictModeReservedWord(id.name)) { - this.tolerateUnexpectedToken(token, messages_1.Messages.StrictReservedWord); - } - } - if (!this.match('=')) { - this.context.isAssignmentTarget = false; - this.context.isBindingElement = false; - } - else { - this.reinterpretExpressionAsPattern(expr); - } - token = this.nextToken(); - var operator = token.value; - var right = this.isolateCoverGrammar(this.parseAssignmentExpression); - expr = this.finalize(this.startNode(startToken), new Node.AssignmentExpression(operator, expr, right)); - this.context.firstCoverInitializedNameError = null; - } - } - } - return expr; - }; - // https://tc39.github.io/ecma262/#sec-comma-operator - Parser.prototype.parseExpression = function () { - var startToken = this.lookahead; - var expr = this.isolateCoverGrammar(this.parseAssignmentExpression); - if (this.match(',')) { - var expressions = []; - expressions.push(expr); - while (this.lookahead.type !== 2 /* EOF */) { - if (!this.match(',')) { - break; - } - this.nextToken(); - expressions.push(this.isolateCoverGrammar(this.parseAssignmentExpression)); - } - expr = this.finalize(this.startNode(startToken), new Node.SequenceExpression(expressions)); - } - return expr; - }; - // https://tc39.github.io/ecma262/#sec-block - Parser.prototype.parseStatementListItem = function () { - var statement; - this.context.isAssignmentTarget = true; - this.context.isBindingElement = true; - if (this.lookahead.type === 4 /* Keyword */) { - switch (this.lookahead.value) { - case 'export': - if (!this.context.isModule) { - this.tolerateUnexpectedToken(this.lookahead, messages_1.Messages.IllegalExportDeclaration); - } - statement = this.parseExportDeclaration(); - break; - case 'import': - if (!this.context.isModule) { - this.tolerateUnexpectedToken(this.lookahead, messages_1.Messages.IllegalImportDeclaration); - } - statement = this.parseImportDeclaration(); - break; - case 'const': - statement = this.parseLexicalDeclaration({ inFor: false }); - break; - case 'function': - statement = this.parseFunctionDeclaration(); - break; - case 'class': - statement = this.parseClassDeclaration(); - break; - case 'let': - statement = this.isLexicalDeclaration() ? this.parseLexicalDeclaration({ inFor: false }) : this.parseStatement(); - break; - default: - statement = this.parseStatement(); - break; - } - } - else { - statement = this.parseStatement(); - } - return statement; - }; - Parser.prototype.parseBlock = function () { - var node = this.createNode(); - this.expect('{'); - var block = []; - while (true) { - if (this.match('}')) { - break; - } - block.push(this.parseStatementListItem()); - } - this.expect('}'); - return this.finalize(node, new Node.BlockStatement(block)); - }; - // https://tc39.github.io/ecma262/#sec-let-and-const-declarations - Parser.prototype.parseLexicalBinding = function (kind, options) { - var node = this.createNode(); - var params = []; - var id = this.parsePattern(params, kind); - if (this.context.strict && id.type === syntax_1.Syntax.Identifier) { - if (this.scanner.isRestrictedWord(id.name)) { - this.tolerateError(messages_1.Messages.StrictVarName); - } - } - var init = null; - if (kind === 'const') { - if (!this.matchKeyword('in') && !this.matchContextualKeyword('of')) { - if (this.match('=')) { - this.nextToken(); - init = this.isolateCoverGrammar(this.parseAssignmentExpression); - } - else { - this.throwError(messages_1.Messages.DeclarationMissingInitializer, 'const'); - } - } - } - else if ((!options.inFor && id.type !== syntax_1.Syntax.Identifier) || this.match('=')) { - this.expect('='); - init = this.isolateCoverGrammar(this.parseAssignmentExpression); - } - return this.finalize(node, new Node.VariableDeclarator(id, init)); - }; - Parser.prototype.parseBindingList = function (kind, options) { - var list = [this.parseLexicalBinding(kind, options)]; - while (this.match(',')) { - this.nextToken(); - list.push(this.parseLexicalBinding(kind, options)); - } - return list; - }; - Parser.prototype.isLexicalDeclaration = function () { - var state = this.scanner.saveState(); - this.scanner.scanComments(); - var next = this.scanner.lex(); - this.scanner.restoreState(state); - return (next.type === 3 /* Identifier */) || - (next.type === 7 /* Punctuator */ && next.value === '[') || - (next.type === 7 /* Punctuator */ && next.value === '{') || - (next.type === 4 /* Keyword */ && next.value === 'let') || - (next.type === 4 /* Keyword */ && next.value === 'yield'); - }; - Parser.prototype.parseLexicalDeclaration = function (options) { - var node = this.createNode(); - var kind = this.nextToken().value; - assert_1.assert(kind === 'let' || kind === 'const', 'Lexical declaration must be either let or const'); - var declarations = this.parseBindingList(kind, options); - this.consumeSemicolon(); - return this.finalize(node, new Node.VariableDeclaration(declarations, kind)); - }; - // https://tc39.github.io/ecma262/#sec-destructuring-binding-patterns - Parser.prototype.parseBindingRestElement = function (params, kind) { - var node = this.createNode(); - this.expect('...'); - var arg = this.parsePattern(params, kind); - return this.finalize(node, new Node.RestElement(arg)); - }; - Parser.prototype.parseArrayPattern = function (params, kind) { - var node = this.createNode(); - this.expect('['); - var elements = []; - while (!this.match(']')) { - if (this.match(',')) { - this.nextToken(); - elements.push(null); - } - else { - if (this.match('...')) { - elements.push(this.parseBindingRestElement(params, kind)); - break; - } - else { - elements.push(this.parsePatternWithDefault(params, kind)); - } - if (!this.match(']')) { - this.expect(','); - } - } - } - this.expect(']'); - return this.finalize(node, new Node.ArrayPattern(elements)); - }; - Parser.prototype.parsePropertyPattern = function (params, kind) { - var node = this.createNode(); - var computed = false; - var shorthand = false; - var method = false; - var key; - var value; - if (this.lookahead.type === 3 /* Identifier */) { - var keyToken = this.lookahead; - key = this.parseVariableIdentifier(); - var init = this.finalize(node, new Node.Identifier(keyToken.value)); - if (this.match('=')) { - params.push(keyToken); - shorthand = true; - this.nextToken(); - var expr = this.parseAssignmentExpression(); - value = this.finalize(this.startNode(keyToken), new Node.AssignmentPattern(init, expr)); - } - else if (!this.match(':')) { - params.push(keyToken); - shorthand = true; - value = init; - } - else { - this.expect(':'); - value = this.parsePatternWithDefault(params, kind); - } - } - else { - computed = this.match('['); - key = this.parseObjectPropertyKey(); - this.expect(':'); - value = this.parsePatternWithDefault(params, kind); - } - return this.finalize(node, new Node.Property('init', key, computed, value, method, shorthand)); - }; - Parser.prototype.parseObjectPattern = function (params, kind) { - var node = this.createNode(); - var properties = []; - this.expect('{'); - while (!this.match('}')) { - properties.push(this.parsePropertyPattern(params, kind)); - if (!this.match('}')) { - this.expect(','); - } - } - this.expect('}'); - return this.finalize(node, new Node.ObjectPattern(properties)); - }; - Parser.prototype.parsePattern = function (params, kind) { - var pattern; - if (this.match('[')) { - pattern = this.parseArrayPattern(params, kind); - } - else if (this.match('{')) { - pattern = this.parseObjectPattern(params, kind); - } - else { - if (this.matchKeyword('let') && (kind === 'const' || kind === 'let')) { - this.tolerateUnexpectedToken(this.lookahead, messages_1.Messages.LetInLexicalBinding); - } - params.push(this.lookahead); - pattern = this.parseVariableIdentifier(kind); - } - return pattern; - }; - Parser.prototype.parsePatternWithDefault = function (params, kind) { - var startToken = this.lookahead; - var pattern = this.parsePattern(params, kind); - if (this.match('=')) { - this.nextToken(); - var previousAllowYield = this.context.allowYield; - this.context.allowYield = true; - var right = this.isolateCoverGrammar(this.parseAssignmentExpression); - this.context.allowYield = previousAllowYield; - pattern = this.finalize(this.startNode(startToken), new Node.AssignmentPattern(pattern, right)); - } - return pattern; - }; - // https://tc39.github.io/ecma262/#sec-variable-statement - Parser.prototype.parseVariableIdentifier = function (kind) { - var node = this.createNode(); - var token = this.nextToken(); - if (token.type === 4 /* Keyword */ && token.value === 'yield') { - if (this.context.strict) { - this.tolerateUnexpectedToken(token, messages_1.Messages.StrictReservedWord); - } - else if (!this.context.allowYield) { - this.throwUnexpectedToken(token); - } - } - else if (token.type !== 3 /* Identifier */) { - if (this.context.strict && token.type === 4 /* Keyword */ && this.scanner.isStrictModeReservedWord(token.value)) { - this.tolerateUnexpectedToken(token, messages_1.Messages.StrictReservedWord); - } - else { - if (this.context.strict || token.value !== 'let' || kind !== 'var') { - this.throwUnexpectedToken(token); - } - } - } - else if ((this.context.isModule || this.context.await) && token.type === 3 /* Identifier */ && token.value === 'await') { - this.tolerateUnexpectedToken(token); - } - return this.finalize(node, new Node.Identifier(token.value)); - }; - Parser.prototype.parseVariableDeclaration = function (options) { - var node = this.createNode(); - var params = []; - var id = this.parsePattern(params, 'var'); - if (this.context.strict && id.type === syntax_1.Syntax.Identifier) { - if (this.scanner.isRestrictedWord(id.name)) { - this.tolerateError(messages_1.Messages.StrictVarName); - } - } - var init = null; - if (this.match('=')) { - this.nextToken(); - init = this.isolateCoverGrammar(this.parseAssignmentExpression); - } - else if (id.type !== syntax_1.Syntax.Identifier && !options.inFor) { - this.expect('='); - } - return this.finalize(node, new Node.VariableDeclarator(id, init)); - }; - Parser.prototype.parseVariableDeclarationList = function (options) { - var opt = { inFor: options.inFor }; - var list = []; - list.push(this.parseVariableDeclaration(opt)); - while (this.match(',')) { - this.nextToken(); - list.push(this.parseVariableDeclaration(opt)); - } - return list; - }; - Parser.prototype.parseVariableStatement = function () { - var node = this.createNode(); - this.expectKeyword('var'); - var declarations = this.parseVariableDeclarationList({ inFor: false }); - this.consumeSemicolon(); - return this.finalize(node, new Node.VariableDeclaration(declarations, 'var')); - }; - // https://tc39.github.io/ecma262/#sec-empty-statement - Parser.prototype.parseEmptyStatement = function () { - var node = this.createNode(); - this.expect(';'); - return this.finalize(node, new Node.EmptyStatement()); - }; - // https://tc39.github.io/ecma262/#sec-expression-statement - Parser.prototype.parseExpressionStatement = function () { - var node = this.createNode(); - var expr = this.parseExpression(); - this.consumeSemicolon(); - return this.finalize(node, new Node.ExpressionStatement(expr)); - }; - // https://tc39.github.io/ecma262/#sec-if-statement - Parser.prototype.parseIfClause = function () { - if (this.context.strict && this.matchKeyword('function')) { - this.tolerateError(messages_1.Messages.StrictFunction); - } - return this.parseStatement(); - }; - Parser.prototype.parseIfStatement = function () { - var node = this.createNode(); - var consequent; - var alternate = null; - this.expectKeyword('if'); - this.expect('('); - var test = this.parseExpression(); - if (!this.match(')') && this.config.tolerant) { - this.tolerateUnexpectedToken(this.nextToken()); - consequent = this.finalize(this.createNode(), new Node.EmptyStatement()); - } - else { - this.expect(')'); - consequent = this.parseIfClause(); - if (this.matchKeyword('else')) { - this.nextToken(); - alternate = this.parseIfClause(); - } - } - return this.finalize(node, new Node.IfStatement(test, consequent, alternate)); - }; - // https://tc39.github.io/ecma262/#sec-do-while-statement - Parser.prototype.parseDoWhileStatement = function () { - var node = this.createNode(); - this.expectKeyword('do'); - var previousInIteration = this.context.inIteration; - this.context.inIteration = true; - var body = this.parseStatement(); - this.context.inIteration = previousInIteration; - this.expectKeyword('while'); - this.expect('('); - var test = this.parseExpression(); - if (!this.match(')') && this.config.tolerant) { - this.tolerateUnexpectedToken(this.nextToken()); - } - else { - this.expect(')'); - if (this.match(';')) { - this.nextToken(); - } - } - return this.finalize(node, new Node.DoWhileStatement(body, test)); - }; - // https://tc39.github.io/ecma262/#sec-while-statement - Parser.prototype.parseWhileStatement = function () { - var node = this.createNode(); - var body; - this.expectKeyword('while'); - this.expect('('); - var test = this.parseExpression(); - if (!this.match(')') && this.config.tolerant) { - this.tolerateUnexpectedToken(this.nextToken()); - body = this.finalize(this.createNode(), new Node.EmptyStatement()); - } - else { - this.expect(')'); - var previousInIteration = this.context.inIteration; - this.context.inIteration = true; - body = this.parseStatement(); - this.context.inIteration = previousInIteration; - } - return this.finalize(node, new Node.WhileStatement(test, body)); - }; - // https://tc39.github.io/ecma262/#sec-for-statement - // https://tc39.github.io/ecma262/#sec-for-in-and-for-of-statements - Parser.prototype.parseForStatement = function () { - var init = null; - var test = null; - var update = null; - var forIn = true; - var left, right; - var node = this.createNode(); - this.expectKeyword('for'); - this.expect('('); - if (this.match(';')) { - this.nextToken(); - } - else { - if (this.matchKeyword('var')) { - init = this.createNode(); - this.nextToken(); - var previousAllowIn = this.context.allowIn; - this.context.allowIn = false; - var declarations = this.parseVariableDeclarationList({ inFor: true }); - this.context.allowIn = previousAllowIn; - if (declarations.length === 1 && this.matchKeyword('in')) { - var decl = declarations[0]; - if (decl.init && (decl.id.type === syntax_1.Syntax.ArrayPattern || decl.id.type === syntax_1.Syntax.ObjectPattern || this.context.strict)) { - this.tolerateError(messages_1.Messages.ForInOfLoopInitializer, 'for-in'); - } - init = this.finalize(init, new Node.VariableDeclaration(declarations, 'var')); - this.nextToken(); - left = init; - right = this.parseExpression(); - init = null; - } - else if (declarations.length === 1 && declarations[0].init === null && this.matchContextualKeyword('of')) { - init = this.finalize(init, new Node.VariableDeclaration(declarations, 'var')); - this.nextToken(); - left = init; - right = this.parseAssignmentExpression(); - init = null; - forIn = false; - } - else { - init = this.finalize(init, new Node.VariableDeclaration(declarations, 'var')); - this.expect(';'); - } - } - else if (this.matchKeyword('const') || this.matchKeyword('let')) { - init = this.createNode(); - var kind = this.nextToken().value; - if (!this.context.strict && this.lookahead.value === 'in') { - init = this.finalize(init, new Node.Identifier(kind)); - this.nextToken(); - left = init; - right = this.parseExpression(); - init = null; - } - else { - var previousAllowIn = this.context.allowIn; - this.context.allowIn = false; - var declarations = this.parseBindingList(kind, { inFor: true }); - this.context.allowIn = previousAllowIn; - if (declarations.length === 1 && declarations[0].init === null && this.matchKeyword('in')) { - init = this.finalize(init, new Node.VariableDeclaration(declarations, kind)); - this.nextToken(); - left = init; - right = this.parseExpression(); - init = null; - } - else if (declarations.length === 1 && declarations[0].init === null && this.matchContextualKeyword('of')) { - init = this.finalize(init, new Node.VariableDeclaration(declarations, kind)); - this.nextToken(); - left = init; - right = this.parseAssignmentExpression(); - init = null; - forIn = false; - } - else { - this.consumeSemicolon(); - init = this.finalize(init, new Node.VariableDeclaration(declarations, kind)); - } - } - } - else { - var initStartToken = this.lookahead; - var previousAllowIn = this.context.allowIn; - this.context.allowIn = false; - init = this.inheritCoverGrammar(this.parseAssignmentExpression); - this.context.allowIn = previousAllowIn; - if (this.matchKeyword('in')) { - if (!this.context.isAssignmentTarget || init.type === syntax_1.Syntax.AssignmentExpression) { - this.tolerateError(messages_1.Messages.InvalidLHSInForIn); - } - this.nextToken(); - this.reinterpretExpressionAsPattern(init); - left = init; - right = this.parseExpression(); - init = null; - } - else if (this.matchContextualKeyword('of')) { - if (!this.context.isAssignmentTarget || init.type === syntax_1.Syntax.AssignmentExpression) { - this.tolerateError(messages_1.Messages.InvalidLHSInForLoop); - } - this.nextToken(); - this.reinterpretExpressionAsPattern(init); - left = init; - right = this.parseAssignmentExpression(); - init = null; - forIn = false; - } - else { - if (this.match(',')) { - var initSeq = [init]; - while (this.match(',')) { - this.nextToken(); - initSeq.push(this.isolateCoverGrammar(this.parseAssignmentExpression)); - } - init = this.finalize(this.startNode(initStartToken), new Node.SequenceExpression(initSeq)); - } - this.expect(';'); - } - } - } - if (typeof left === 'undefined') { - if (!this.match(';')) { - test = this.parseExpression(); - } - this.expect(';'); - if (!this.match(')')) { - update = this.parseExpression(); - } - } - var body; - if (!this.match(')') && this.config.tolerant) { - this.tolerateUnexpectedToken(this.nextToken()); - body = this.finalize(this.createNode(), new Node.EmptyStatement()); - } - else { - this.expect(')'); - var previousInIteration = this.context.inIteration; - this.context.inIteration = true; - body = this.isolateCoverGrammar(this.parseStatement); - this.context.inIteration = previousInIteration; - } - return (typeof left === 'undefined') ? - this.finalize(node, new Node.ForStatement(init, test, update, body)) : - forIn ? this.finalize(node, new Node.ForInStatement(left, right, body)) : - this.finalize(node, new Node.ForOfStatement(left, right, body)); - }; - // https://tc39.github.io/ecma262/#sec-continue-statement - Parser.prototype.parseContinueStatement = function () { - var node = this.createNode(); - this.expectKeyword('continue'); - var label = null; - if (this.lookahead.type === 3 /* Identifier */ && !this.hasLineTerminator) { - var id = this.parseVariableIdentifier(); - label = id; - var key = '$' + id.name; - if (!Object.prototype.hasOwnProperty.call(this.context.labelSet, key)) { - this.throwError(messages_1.Messages.UnknownLabel, id.name); - } - } - this.consumeSemicolon(); - if (label === null && !this.context.inIteration) { - this.throwError(messages_1.Messages.IllegalContinue); - } - return this.finalize(node, new Node.ContinueStatement(label)); - }; - // https://tc39.github.io/ecma262/#sec-break-statement - Parser.prototype.parseBreakStatement = function () { - var node = this.createNode(); - this.expectKeyword('break'); - var label = null; - if (this.lookahead.type === 3 /* Identifier */ && !this.hasLineTerminator) { - var id = this.parseVariableIdentifier(); - var key = '$' + id.name; - if (!Object.prototype.hasOwnProperty.call(this.context.labelSet, key)) { - this.throwError(messages_1.Messages.UnknownLabel, id.name); - } - label = id; - } - this.consumeSemicolon(); - if (label === null && !this.context.inIteration && !this.context.inSwitch) { - this.throwError(messages_1.Messages.IllegalBreak); - } - return this.finalize(node, new Node.BreakStatement(label)); - }; - // https://tc39.github.io/ecma262/#sec-return-statement - Parser.prototype.parseReturnStatement = function () { - if (!this.context.inFunctionBody) { - this.tolerateError(messages_1.Messages.IllegalReturn); - } - var node = this.createNode(); - this.expectKeyword('return'); - var hasArgument = (!this.match(';') && !this.match('}') && - !this.hasLineTerminator && this.lookahead.type !== 2 /* EOF */) || - this.lookahead.type === 8 /* StringLiteral */ || - this.lookahead.type === 10 /* Template */; - var argument = hasArgument ? this.parseExpression() : null; - this.consumeSemicolon(); - return this.finalize(node, new Node.ReturnStatement(argument)); - }; - // https://tc39.github.io/ecma262/#sec-with-statement - Parser.prototype.parseWithStatement = function () { - if (this.context.strict) { - this.tolerateError(messages_1.Messages.StrictModeWith); - } - var node = this.createNode(); - var body; - this.expectKeyword('with'); - this.expect('('); - var object = this.parseExpression(); - if (!this.match(')') && this.config.tolerant) { - this.tolerateUnexpectedToken(this.nextToken()); - body = this.finalize(this.createNode(), new Node.EmptyStatement()); - } - else { - this.expect(')'); - body = this.parseStatement(); - } - return this.finalize(node, new Node.WithStatement(object, body)); - }; - // https://tc39.github.io/ecma262/#sec-switch-statement - Parser.prototype.parseSwitchCase = function () { - var node = this.createNode(); - var test; - if (this.matchKeyword('default')) { - this.nextToken(); - test = null; - } - else { - this.expectKeyword('case'); - test = this.parseExpression(); - } - this.expect(':'); - var consequent = []; - while (true) { - if (this.match('}') || this.matchKeyword('default') || this.matchKeyword('case')) { - break; - } - consequent.push(this.parseStatementListItem()); - } - return this.finalize(node, new Node.SwitchCase(test, consequent)); - }; - Parser.prototype.parseSwitchStatement = function () { - var node = this.createNode(); - this.expectKeyword('switch'); - this.expect('('); - var discriminant = this.parseExpression(); - this.expect(')'); - var previousInSwitch = this.context.inSwitch; - this.context.inSwitch = true; - var cases = []; - var defaultFound = false; - this.expect('{'); - while (true) { - if (this.match('}')) { - break; - } - var clause = this.parseSwitchCase(); - if (clause.test === null) { - if (defaultFound) { - this.throwError(messages_1.Messages.MultipleDefaultsInSwitch); - } - defaultFound = true; - } - cases.push(clause); - } - this.expect('}'); - this.context.inSwitch = previousInSwitch; - return this.finalize(node, new Node.SwitchStatement(discriminant, cases)); - }; - // https://tc39.github.io/ecma262/#sec-labelled-statements - Parser.prototype.parseLabelledStatement = function () { - var node = this.createNode(); - var expr = this.parseExpression(); - var statement; - if ((expr.type === syntax_1.Syntax.Identifier) && this.match(':')) { - this.nextToken(); - var id = expr; - var key = '$' + id.name; - if (Object.prototype.hasOwnProperty.call(this.context.labelSet, key)) { - this.throwError(messages_1.Messages.Redeclaration, 'Label', id.name); - } - this.context.labelSet[key] = true; - var body = void 0; - if (this.matchKeyword('class')) { - this.tolerateUnexpectedToken(this.lookahead); - body = this.parseClassDeclaration(); - } - else if (this.matchKeyword('function')) { - var token = this.lookahead; - var declaration = this.parseFunctionDeclaration(); - if (this.context.strict) { - this.tolerateUnexpectedToken(token, messages_1.Messages.StrictFunction); - } - else if (declaration.generator) { - this.tolerateUnexpectedToken(token, messages_1.Messages.GeneratorInLegacyContext); - } - body = declaration; - } - else { - body = this.parseStatement(); - } - delete this.context.labelSet[key]; - statement = new Node.LabeledStatement(id, body); - } - else { - this.consumeSemicolon(); - statement = new Node.ExpressionStatement(expr); - } - return this.finalize(node, statement); - }; - // https://tc39.github.io/ecma262/#sec-throw-statement - Parser.prototype.parseThrowStatement = function () { - var node = this.createNode(); - this.expectKeyword('throw'); - if (this.hasLineTerminator) { - this.throwError(messages_1.Messages.NewlineAfterThrow); - } - var argument = this.parseExpression(); - this.consumeSemicolon(); - return this.finalize(node, new Node.ThrowStatement(argument)); - }; - // https://tc39.github.io/ecma262/#sec-try-statement - Parser.prototype.parseCatchClause = function () { - var node = this.createNode(); - this.expectKeyword('catch'); - this.expect('('); - if (this.match(')')) { - this.throwUnexpectedToken(this.lookahead); - } - var params = []; - var param = this.parsePattern(params); - var paramMap = {}; - for (var i = 0; i < params.length; i++) { - var key = '$' + params[i].value; - if (Object.prototype.hasOwnProperty.call(paramMap, key)) { - this.tolerateError(messages_1.Messages.DuplicateBinding, params[i].value); - } - paramMap[key] = true; - } - if (this.context.strict && param.type === syntax_1.Syntax.Identifier) { - if (this.scanner.isRestrictedWord(param.name)) { - this.tolerateError(messages_1.Messages.StrictCatchVariable); - } - } - this.expect(')'); - var body = this.parseBlock(); - return this.finalize(node, new Node.CatchClause(param, body)); - }; - Parser.prototype.parseFinallyClause = function () { - this.expectKeyword('finally'); - return this.parseBlock(); - }; - Parser.prototype.parseTryStatement = function () { - var node = this.createNode(); - this.expectKeyword('try'); - var block = this.parseBlock(); - var handler = this.matchKeyword('catch') ? this.parseCatchClause() : null; - var finalizer = this.matchKeyword('finally') ? this.parseFinallyClause() : null; - if (!handler && !finalizer) { - this.throwError(messages_1.Messages.NoCatchOrFinally); - } - return this.finalize(node, new Node.TryStatement(block, handler, finalizer)); - }; - // https://tc39.github.io/ecma262/#sec-debugger-statement - Parser.prototype.parseDebuggerStatement = function () { - var node = this.createNode(); - this.expectKeyword('debugger'); - this.consumeSemicolon(); - return this.finalize(node, new Node.DebuggerStatement()); - }; - // https://tc39.github.io/ecma262/#sec-ecmascript-language-statements-and-declarations - Parser.prototype.parseStatement = function () { - var statement; - switch (this.lookahead.type) { - case 1 /* BooleanLiteral */: - case 5 /* NullLiteral */: - case 6 /* NumericLiteral */: - case 8 /* StringLiteral */: - case 10 /* Template */: - case 9 /* RegularExpression */: - statement = this.parseExpressionStatement(); - break; - case 7 /* Punctuator */: - var value = this.lookahead.value; - if (value === '{') { - statement = this.parseBlock(); - } - else if (value === '(') { - statement = this.parseExpressionStatement(); - } - else if (value === ';') { - statement = this.parseEmptyStatement(); - } - else { - statement = this.parseExpressionStatement(); - } - break; - case 3 /* Identifier */: - statement = this.matchAsyncFunction() ? this.parseFunctionDeclaration() : this.parseLabelledStatement(); - break; - case 4 /* Keyword */: - switch (this.lookahead.value) { - case 'break': - statement = this.parseBreakStatement(); - break; - case 'continue': - statement = this.parseContinueStatement(); - break; - case 'debugger': - statement = this.parseDebuggerStatement(); - break; - case 'do': - statement = this.parseDoWhileStatement(); - break; - case 'for': - statement = this.parseForStatement(); - break; - case 'function': - statement = this.parseFunctionDeclaration(); - break; - case 'if': - statement = this.parseIfStatement(); - break; - case 'return': - statement = this.parseReturnStatement(); - break; - case 'switch': - statement = this.parseSwitchStatement(); - break; - case 'throw': - statement = this.parseThrowStatement(); - break; - case 'try': - statement = this.parseTryStatement(); - break; - case 'var': - statement = this.parseVariableStatement(); - break; - case 'while': - statement = this.parseWhileStatement(); - break; - case 'with': - statement = this.parseWithStatement(); - break; - default: - statement = this.parseExpressionStatement(); - break; - } - break; - default: - statement = this.throwUnexpectedToken(this.lookahead); - } - return statement; - }; - // https://tc39.github.io/ecma262/#sec-function-definitions - Parser.prototype.parseFunctionSourceElements = function () { - var node = this.createNode(); - this.expect('{'); - var body = this.parseDirectivePrologues(); - var previousLabelSet = this.context.labelSet; - var previousInIteration = this.context.inIteration; - var previousInSwitch = this.context.inSwitch; - var previousInFunctionBody = this.context.inFunctionBody; - this.context.labelSet = {}; - this.context.inIteration = false; - this.context.inSwitch = false; - this.context.inFunctionBody = true; - while (this.lookahead.type !== 2 /* EOF */) { - if (this.match('}')) { - break; - } - body.push(this.parseStatementListItem()); - } - this.expect('}'); - this.context.labelSet = previousLabelSet; - this.context.inIteration = previousInIteration; - this.context.inSwitch = previousInSwitch; - this.context.inFunctionBody = previousInFunctionBody; - return this.finalize(node, new Node.BlockStatement(body)); - }; - Parser.prototype.validateParam = function (options, param, name) { - var key = '$' + name; - if (this.context.strict) { - if (this.scanner.isRestrictedWord(name)) { - options.stricted = param; - options.message = messages_1.Messages.StrictParamName; - } - if (Object.prototype.hasOwnProperty.call(options.paramSet, key)) { - options.stricted = param; - options.message = messages_1.Messages.StrictParamDupe; - } - } - else if (!options.firstRestricted) { - if (this.scanner.isRestrictedWord(name)) { - options.firstRestricted = param; - options.message = messages_1.Messages.StrictParamName; - } - else if (this.scanner.isStrictModeReservedWord(name)) { - options.firstRestricted = param; - options.message = messages_1.Messages.StrictReservedWord; - } - else if (Object.prototype.hasOwnProperty.call(options.paramSet, key)) { - options.stricted = param; - options.message = messages_1.Messages.StrictParamDupe; - } - } - /* istanbul ignore next */ - if (typeof Object.defineProperty === 'function') { - Object.defineProperty(options.paramSet, key, { value: true, enumerable: true, writable: true, configurable: true }); - } - else { - options.paramSet[key] = true; - } - }; - Parser.prototype.parseRestElement = function (params) { - var node = this.createNode(); - this.expect('...'); - var arg = this.parsePattern(params); - if (this.match('=')) { - this.throwError(messages_1.Messages.DefaultRestParameter); - } - if (!this.match(')')) { - this.throwError(messages_1.Messages.ParameterAfterRestParameter); - } - return this.finalize(node, new Node.RestElement(arg)); - }; - Parser.prototype.parseFormalParameter = function (options) { - var params = []; - var param = this.match('...') ? this.parseRestElement(params) : this.parsePatternWithDefault(params); - for (var i = 0; i < params.length; i++) { - this.validateParam(options, params[i], params[i].value); - } - options.simple = options.simple && (param instanceof Node.Identifier); - options.params.push(param); - }; - Parser.prototype.parseFormalParameters = function (firstRestricted) { - var options; - options = { - simple: true, - params: [], - firstRestricted: firstRestricted - }; - this.expect('('); - if (!this.match(')')) { - options.paramSet = {}; - while (this.lookahead.type !== 2 /* EOF */) { - this.parseFormalParameter(options); - if (this.match(')')) { - break; - } - this.expect(','); - if (this.match(')')) { - break; - } - } - } - this.expect(')'); - return { - simple: options.simple, - params: options.params, - stricted: options.stricted, - firstRestricted: options.firstRestricted, - message: options.message - }; - }; - Parser.prototype.matchAsyncFunction = function () { - var match = this.matchContextualKeyword('async'); - if (match) { - var state = this.scanner.saveState(); - this.scanner.scanComments(); - var next = this.scanner.lex(); - this.scanner.restoreState(state); - match = (state.lineNumber === next.lineNumber) && (next.type === 4 /* Keyword */) && (next.value === 'function'); - } - return match; - }; - Parser.prototype.parseFunctionDeclaration = function (identifierIsOptional) { - var node = this.createNode(); - var isAsync = this.matchContextualKeyword('async'); - if (isAsync) { - this.nextToken(); - } - this.expectKeyword('function'); - var isGenerator = isAsync ? false : this.match('*'); - if (isGenerator) { - this.nextToken(); - } - var message; - var id = null; - var firstRestricted = null; - if (!identifierIsOptional || !this.match('(')) { - var token = this.lookahead; - id = this.parseVariableIdentifier(); - if (this.context.strict) { - if (this.scanner.isRestrictedWord(token.value)) { - this.tolerateUnexpectedToken(token, messages_1.Messages.StrictFunctionName); - } - } - else { - if (this.scanner.isRestrictedWord(token.value)) { - firstRestricted = token; - message = messages_1.Messages.StrictFunctionName; - } - else if (this.scanner.isStrictModeReservedWord(token.value)) { - firstRestricted = token; - message = messages_1.Messages.StrictReservedWord; - } - } - } - var previousAllowAwait = this.context.await; - var previousAllowYield = this.context.allowYield; - this.context.await = isAsync; - this.context.allowYield = !isGenerator; - var formalParameters = this.parseFormalParameters(firstRestricted); - var params = formalParameters.params; - var stricted = formalParameters.stricted; - firstRestricted = formalParameters.firstRestricted; - if (formalParameters.message) { - message = formalParameters.message; - } - var previousStrict = this.context.strict; - var previousAllowStrictDirective = this.context.allowStrictDirective; - this.context.allowStrictDirective = formalParameters.simple; - var body = this.parseFunctionSourceElements(); - if (this.context.strict && firstRestricted) { - this.throwUnexpectedToken(firstRestricted, message); - } - if (this.context.strict && stricted) { - this.tolerateUnexpectedToken(stricted, message); - } - this.context.strict = previousStrict; - this.context.allowStrictDirective = previousAllowStrictDirective; - this.context.await = previousAllowAwait; - this.context.allowYield = previousAllowYield; - return isAsync ? this.finalize(node, new Node.AsyncFunctionDeclaration(id, params, body)) : - this.finalize(node, new Node.FunctionDeclaration(id, params, body, isGenerator)); - }; - Parser.prototype.parseFunctionExpression = function () { - var node = this.createNode(); - var isAsync = this.matchContextualKeyword('async'); - if (isAsync) { - this.nextToken(); - } - this.expectKeyword('function'); - var isGenerator = isAsync ? false : this.match('*'); - if (isGenerator) { - this.nextToken(); - } - var message; - var id = null; - var firstRestricted; - var previousAllowAwait = this.context.await; - var previousAllowYield = this.context.allowYield; - this.context.await = isAsync; - this.context.allowYield = !isGenerator; - if (!this.match('(')) { - var token = this.lookahead; - id = (!this.context.strict && !isGenerator && this.matchKeyword('yield')) ? this.parseIdentifierName() : this.parseVariableIdentifier(); - if (this.context.strict) { - if (this.scanner.isRestrictedWord(token.value)) { - this.tolerateUnexpectedToken(token, messages_1.Messages.StrictFunctionName); - } - } - else { - if (this.scanner.isRestrictedWord(token.value)) { - firstRestricted = token; - message = messages_1.Messages.StrictFunctionName; - } - else if (this.scanner.isStrictModeReservedWord(token.value)) { - firstRestricted = token; - message = messages_1.Messages.StrictReservedWord; - } - } - } - var formalParameters = this.parseFormalParameters(firstRestricted); - var params = formalParameters.params; - var stricted = formalParameters.stricted; - firstRestricted = formalParameters.firstRestricted; - if (formalParameters.message) { - message = formalParameters.message; - } - var previousStrict = this.context.strict; - var previousAllowStrictDirective = this.context.allowStrictDirective; - this.context.allowStrictDirective = formalParameters.simple; - var body = this.parseFunctionSourceElements(); - if (this.context.strict && firstRestricted) { - this.throwUnexpectedToken(firstRestricted, message); - } - if (this.context.strict && stricted) { - this.tolerateUnexpectedToken(stricted, message); - } - this.context.strict = previousStrict; - this.context.allowStrictDirective = previousAllowStrictDirective; - this.context.await = previousAllowAwait; - this.context.allowYield = previousAllowYield; - return isAsync ? this.finalize(node, new Node.AsyncFunctionExpression(id, params, body)) : - this.finalize(node, new Node.FunctionExpression(id, params, body, isGenerator)); - }; - // https://tc39.github.io/ecma262/#sec-directive-prologues-and-the-use-strict-directive - Parser.prototype.parseDirective = function () { - var token = this.lookahead; - var node = this.createNode(); - var expr = this.parseExpression(); - var directive = (expr.type === syntax_1.Syntax.Literal) ? this.getTokenRaw(token).slice(1, -1) : null; - this.consumeSemicolon(); - return this.finalize(node, directive ? new Node.Directive(expr, directive) : new Node.ExpressionStatement(expr)); - }; - Parser.prototype.parseDirectivePrologues = function () { - var firstRestricted = null; - var body = []; - while (true) { - var token = this.lookahead; - if (token.type !== 8 /* StringLiteral */) { - break; - } - var statement = this.parseDirective(); - body.push(statement); - var directive = statement.directive; - if (typeof directive !== 'string') { - break; - } - if (directive === 'use strict') { - this.context.strict = true; - if (firstRestricted) { - this.tolerateUnexpectedToken(firstRestricted, messages_1.Messages.StrictOctalLiteral); - } - if (!this.context.allowStrictDirective) { - this.tolerateUnexpectedToken(token, messages_1.Messages.IllegalLanguageModeDirective); - } - } - else { - if (!firstRestricted && token.octal) { - firstRestricted = token; - } - } - } - return body; - }; - // https://tc39.github.io/ecma262/#sec-method-definitions - Parser.prototype.qualifiedPropertyName = function (token) { - switch (token.type) { - case 3 /* Identifier */: - case 8 /* StringLiteral */: - case 1 /* BooleanLiteral */: - case 5 /* NullLiteral */: - case 6 /* NumericLiteral */: - case 4 /* Keyword */: - return true; - case 7 /* Punctuator */: - return token.value === '['; - default: - break; - } - return false; - }; - Parser.prototype.parseGetterMethod = function () { - var node = this.createNode(); - var isGenerator = false; - var previousAllowYield = this.context.allowYield; - this.context.allowYield = !isGenerator; - var formalParameters = this.parseFormalParameters(); - if (formalParameters.params.length > 0) { - this.tolerateError(messages_1.Messages.BadGetterArity); - } - var method = this.parsePropertyMethod(formalParameters); - this.context.allowYield = previousAllowYield; - return this.finalize(node, new Node.FunctionExpression(null, formalParameters.params, method, isGenerator)); - }; - Parser.prototype.parseSetterMethod = function () { - var node = this.createNode(); - var isGenerator = false; - var previousAllowYield = this.context.allowYield; - this.context.allowYield = !isGenerator; - var formalParameters = this.parseFormalParameters(); - if (formalParameters.params.length !== 1) { - this.tolerateError(messages_1.Messages.BadSetterArity); - } - else if (formalParameters.params[0] instanceof Node.RestElement) { - this.tolerateError(messages_1.Messages.BadSetterRestParameter); - } - var method = this.parsePropertyMethod(formalParameters); - this.context.allowYield = previousAllowYield; - return this.finalize(node, new Node.FunctionExpression(null, formalParameters.params, method, isGenerator)); - }; - Parser.prototype.parseGeneratorMethod = function () { - var node = this.createNode(); - var isGenerator = true; - var previousAllowYield = this.context.allowYield; - this.context.allowYield = true; - var params = this.parseFormalParameters(); - this.context.allowYield = false; - var method = this.parsePropertyMethod(params); - this.context.allowYield = previousAllowYield; - return this.finalize(node, new Node.FunctionExpression(null, params.params, method, isGenerator)); - }; - // https://tc39.github.io/ecma262/#sec-generator-function-definitions - Parser.prototype.isStartOfExpression = function () { - var start = true; - var value = this.lookahead.value; - switch (this.lookahead.type) { - case 7 /* Punctuator */: - start = (value === '[') || (value === '(') || (value === '{') || - (value === '+') || (value === '-') || - (value === '!') || (value === '~') || - (value === '++') || (value === '--') || - (value === '/') || (value === '/='); // regular expression literal - break; - case 4 /* Keyword */: - start = (value === 'class') || (value === 'delete') || - (value === 'function') || (value === 'let') || (value === 'new') || - (value === 'super') || (value === 'this') || (value === 'typeof') || - (value === 'void') || (value === 'yield'); - break; - default: - break; - } - return start; - }; - Parser.prototype.parseYieldExpression = function () { - var node = this.createNode(); - this.expectKeyword('yield'); - var argument = null; - var delegate = false; - if (!this.hasLineTerminator) { - var previousAllowYield = this.context.allowYield; - this.context.allowYield = false; - delegate = this.match('*'); - if (delegate) { - this.nextToken(); - argument = this.parseAssignmentExpression(); - } - else if (this.isStartOfExpression()) { - argument = this.parseAssignmentExpression(); - } - this.context.allowYield = previousAllowYield; - } - return this.finalize(node, new Node.YieldExpression(argument, delegate)); - }; - // https://tc39.github.io/ecma262/#sec-class-definitions - Parser.prototype.parseClassElement = function (hasConstructor) { - var token = this.lookahead; - var node = this.createNode(); - var kind = ''; - var key = null; - var value = null; - var computed = false; - var method = false; - var isStatic = false; - var isAsync = false; - if (this.match('*')) { - this.nextToken(); - } - else { - computed = this.match('['); - key = this.parseObjectPropertyKey(); - var id = key; - if (id.name === 'static' && (this.qualifiedPropertyName(this.lookahead) || this.match('*'))) { - token = this.lookahead; - isStatic = true; - computed = this.match('['); - if (this.match('*')) { - this.nextToken(); - } - else { - key = this.parseObjectPropertyKey(); - } - } - if ((token.type === 3 /* Identifier */) && !this.hasLineTerminator && (token.value === 'async')) { - var punctuator = this.lookahead.value; - if (punctuator !== ':' && punctuator !== '(' && punctuator !== '*') { - isAsync = true; - token = this.lookahead; - key = this.parseObjectPropertyKey(); - if (token.type === 3 /* Identifier */ && token.value === 'constructor') { - this.tolerateUnexpectedToken(token, messages_1.Messages.ConstructorIsAsync); - } - } - } - } - var lookaheadPropertyKey = this.qualifiedPropertyName(this.lookahead); - if (token.type === 3 /* Identifier */) { - if (token.value === 'get' && lookaheadPropertyKey) { - kind = 'get'; - computed = this.match('['); - key = this.parseObjectPropertyKey(); - this.context.allowYield = false; - value = this.parseGetterMethod(); - } - else if (token.value === 'set' && lookaheadPropertyKey) { - kind = 'set'; - computed = this.match('['); - key = this.parseObjectPropertyKey(); - value = this.parseSetterMethod(); - } - } - else if (token.type === 7 /* Punctuator */ && token.value === '*' && lookaheadPropertyKey) { - kind = 'init'; - computed = this.match('['); - key = this.parseObjectPropertyKey(); - value = this.parseGeneratorMethod(); - method = true; - } - if (!kind && key && this.match('(')) { - kind = 'init'; - value = isAsync ? this.parsePropertyMethodAsyncFunction() : this.parsePropertyMethodFunction(); - method = true; - } - if (!kind) { - this.throwUnexpectedToken(this.lookahead); - } - if (kind === 'init') { - kind = 'method'; - } - if (!computed) { - if (isStatic && this.isPropertyKey(key, 'prototype')) { - this.throwUnexpectedToken(token, messages_1.Messages.StaticPrototype); - } - if (!isStatic && this.isPropertyKey(key, 'constructor')) { - if (kind !== 'method' || !method || (value && value.generator)) { - this.throwUnexpectedToken(token, messages_1.Messages.ConstructorSpecialMethod); - } - if (hasConstructor.value) { - this.throwUnexpectedToken(token, messages_1.Messages.DuplicateConstructor); - } - else { - hasConstructor.value = true; - } - kind = 'constructor'; - } - } - return this.finalize(node, new Node.MethodDefinition(key, computed, value, kind, isStatic)); - }; - Parser.prototype.parseClassElementList = function () { - var body = []; - var hasConstructor = { value: false }; - this.expect('{'); - while (!this.match('}')) { - if (this.match(';')) { - this.nextToken(); - } - else { - body.push(this.parseClassElement(hasConstructor)); - } - } - this.expect('}'); - return body; - }; - Parser.prototype.parseClassBody = function () { - var node = this.createNode(); - var elementList = this.parseClassElementList(); - return this.finalize(node, new Node.ClassBody(elementList)); - }; - Parser.prototype.parseClassDeclaration = function (identifierIsOptional) { - var node = this.createNode(); - var previousStrict = this.context.strict; - this.context.strict = true; - this.expectKeyword('class'); - var id = (identifierIsOptional && (this.lookahead.type !== 3 /* Identifier */)) ? null : this.parseVariableIdentifier(); - var superClass = null; - if (this.matchKeyword('extends')) { - this.nextToken(); - superClass = this.isolateCoverGrammar(this.parseLeftHandSideExpressionAllowCall); - } - var classBody = this.parseClassBody(); - this.context.strict = previousStrict; - return this.finalize(node, new Node.ClassDeclaration(id, superClass, classBody)); - }; - Parser.prototype.parseClassExpression = function () { - var node = this.createNode(); - var previousStrict = this.context.strict; - this.context.strict = true; - this.expectKeyword('class'); - var id = (this.lookahead.type === 3 /* Identifier */) ? this.parseVariableIdentifier() : null; - var superClass = null; - if (this.matchKeyword('extends')) { - this.nextToken(); - superClass = this.isolateCoverGrammar(this.parseLeftHandSideExpressionAllowCall); - } - var classBody = this.parseClassBody(); - this.context.strict = previousStrict; - return this.finalize(node, new Node.ClassExpression(id, superClass, classBody)); - }; - // https://tc39.github.io/ecma262/#sec-scripts - // https://tc39.github.io/ecma262/#sec-modules - Parser.prototype.parseModule = function () { - this.context.strict = true; - this.context.isModule = true; - this.scanner.isModule = true; - var node = this.createNode(); - var body = this.parseDirectivePrologues(); - while (this.lookahead.type !== 2 /* EOF */) { - body.push(this.parseStatementListItem()); - } - return this.finalize(node, new Node.Module(body)); - }; - Parser.prototype.parseScript = function () { - var node = this.createNode(); - var body = this.parseDirectivePrologues(); - while (this.lookahead.type !== 2 /* EOF */) { - body.push(this.parseStatementListItem()); - } - return this.finalize(node, new Node.Script(body)); - }; - // https://tc39.github.io/ecma262/#sec-imports - Parser.prototype.parseModuleSpecifier = function () { - var node = this.createNode(); - if (this.lookahead.type !== 8 /* StringLiteral */) { - this.throwError(messages_1.Messages.InvalidModuleSpecifier); - } - var token = this.nextToken(); - var raw = this.getTokenRaw(token); - return this.finalize(node, new Node.Literal(token.value, raw)); - }; - // import {} ...; - Parser.prototype.parseImportSpecifier = function () { - var node = this.createNode(); - var imported; - var local; - if (this.lookahead.type === 3 /* Identifier */) { - imported = this.parseVariableIdentifier(); - local = imported; - if (this.matchContextualKeyword('as')) { - this.nextToken(); - local = this.parseVariableIdentifier(); - } - } - else { - imported = this.parseIdentifierName(); - local = imported; - if (this.matchContextualKeyword('as')) { - this.nextToken(); - local = this.parseVariableIdentifier(); - } - else { - this.throwUnexpectedToken(this.nextToken()); - } - } - return this.finalize(node, new Node.ImportSpecifier(local, imported)); - }; - // {foo, bar as bas} - Parser.prototype.parseNamedImports = function () { - this.expect('{'); - var specifiers = []; - while (!this.match('}')) { - specifiers.push(this.parseImportSpecifier()); - if (!this.match('}')) { - this.expect(','); - } - } - this.expect('}'); - return specifiers; - }; - // import ...; - Parser.prototype.parseImportDefaultSpecifier = function () { - var node = this.createNode(); - var local = this.parseIdentifierName(); - return this.finalize(node, new Node.ImportDefaultSpecifier(local)); - }; - // import <* as foo> ...; - Parser.prototype.parseImportNamespaceSpecifier = function () { - var node = this.createNode(); - this.expect('*'); - if (!this.matchContextualKeyword('as')) { - this.throwError(messages_1.Messages.NoAsAfterImportNamespace); - } - this.nextToken(); - var local = this.parseIdentifierName(); - return this.finalize(node, new Node.ImportNamespaceSpecifier(local)); - }; - Parser.prototype.parseImportDeclaration = function () { - if (this.context.inFunctionBody) { - this.throwError(messages_1.Messages.IllegalImportDeclaration); - } - var node = this.createNode(); - this.expectKeyword('import'); - var src; - var specifiers = []; - if (this.lookahead.type === 8 /* StringLiteral */) { - // import 'foo'; - src = this.parseModuleSpecifier(); - } - else { - if (this.match('{')) { - // import {bar} - specifiers = specifiers.concat(this.parseNamedImports()); - } - else if (this.match('*')) { - // import * as foo - specifiers.push(this.parseImportNamespaceSpecifier()); - } - else if (this.isIdentifierName(this.lookahead) && !this.matchKeyword('default')) { - // import foo - specifiers.push(this.parseImportDefaultSpecifier()); - if (this.match(',')) { - this.nextToken(); - if (this.match('*')) { - // import foo, * as foo - specifiers.push(this.parseImportNamespaceSpecifier()); - } - else if (this.match('{')) { - // import foo, {bar} - specifiers = specifiers.concat(this.parseNamedImports()); - } - else { - this.throwUnexpectedToken(this.lookahead); - } - } - } - else { - this.throwUnexpectedToken(this.nextToken()); - } - if (!this.matchContextualKeyword('from')) { - var message = this.lookahead.value ? messages_1.Messages.UnexpectedToken : messages_1.Messages.MissingFromClause; - this.throwError(message, this.lookahead.value); - } - this.nextToken(); - src = this.parseModuleSpecifier(); - } - this.consumeSemicolon(); - return this.finalize(node, new Node.ImportDeclaration(specifiers, src)); - }; - // https://tc39.github.io/ecma262/#sec-exports - Parser.prototype.parseExportSpecifier = function () { - var node = this.createNode(); - var local = this.parseIdentifierName(); - var exported = local; - if (this.matchContextualKeyword('as')) { - this.nextToken(); - exported = this.parseIdentifierName(); - } - return this.finalize(node, new Node.ExportSpecifier(local, exported)); - }; - Parser.prototype.parseExportDeclaration = function () { - if (this.context.inFunctionBody) { - this.throwError(messages_1.Messages.IllegalExportDeclaration); - } - var node = this.createNode(); - this.expectKeyword('export'); - var exportDeclaration; - if (this.matchKeyword('default')) { - // export default ... - this.nextToken(); - if (this.matchKeyword('function')) { - // export default function foo () {} - // export default function () {} - var declaration = this.parseFunctionDeclaration(true); - exportDeclaration = this.finalize(node, new Node.ExportDefaultDeclaration(declaration)); - } - else if (this.matchKeyword('class')) { - // export default class foo {} - var declaration = this.parseClassDeclaration(true); - exportDeclaration = this.finalize(node, new Node.ExportDefaultDeclaration(declaration)); - } - else if (this.matchContextualKeyword('async')) { - // export default async function f () {} - // export default async function () {} - // export default async x => x - var declaration = this.matchAsyncFunction() ? this.parseFunctionDeclaration(true) : this.parseAssignmentExpression(); - exportDeclaration = this.finalize(node, new Node.ExportDefaultDeclaration(declaration)); - } - else { - if (this.matchContextualKeyword('from')) { - this.throwError(messages_1.Messages.UnexpectedToken, this.lookahead.value); - } - // export default {}; - // export default []; - // export default (1 + 2); - var declaration = this.match('{') ? this.parseObjectInitializer() : - this.match('[') ? this.parseArrayInitializer() : this.parseAssignmentExpression(); - this.consumeSemicolon(); - exportDeclaration = this.finalize(node, new Node.ExportDefaultDeclaration(declaration)); - } - } - else if (this.match('*')) { - // export * from 'foo'; - this.nextToken(); - if (!this.matchContextualKeyword('from')) { - var message = this.lookahead.value ? messages_1.Messages.UnexpectedToken : messages_1.Messages.MissingFromClause; - this.throwError(message, this.lookahead.value); - } - this.nextToken(); - var src = this.parseModuleSpecifier(); - this.consumeSemicolon(); - exportDeclaration = this.finalize(node, new Node.ExportAllDeclaration(src)); - } - else if (this.lookahead.type === 4 /* Keyword */) { - // export var f = 1; - var declaration = void 0; - switch (this.lookahead.value) { - case 'let': - case 'const': - declaration = this.parseLexicalDeclaration({ inFor: false }); - break; - case 'var': - case 'class': - case 'function': - declaration = this.parseStatementListItem(); - break; - default: - this.throwUnexpectedToken(this.lookahead); - } - exportDeclaration = this.finalize(node, new Node.ExportNamedDeclaration(declaration, [], null)); - } - else if (this.matchAsyncFunction()) { - var declaration = this.parseFunctionDeclaration(); - exportDeclaration = this.finalize(node, new Node.ExportNamedDeclaration(declaration, [], null)); - } - else { - var specifiers = []; - var source = null; - var isExportFromIdentifier = false; - this.expect('{'); - while (!this.match('}')) { - isExportFromIdentifier = isExportFromIdentifier || this.matchKeyword('default'); - specifiers.push(this.parseExportSpecifier()); - if (!this.match('}')) { - this.expect(','); - } - } - this.expect('}'); - if (this.matchContextualKeyword('from')) { - // export {default} from 'foo'; - // export {foo} from 'foo'; - this.nextToken(); - source = this.parseModuleSpecifier(); - this.consumeSemicolon(); - } - else if (isExportFromIdentifier) { - // export {default}; // missing fromClause - var message = this.lookahead.value ? messages_1.Messages.UnexpectedToken : messages_1.Messages.MissingFromClause; - this.throwError(message, this.lookahead.value); - } - else { - // export {foo}; - this.consumeSemicolon(); - } - exportDeclaration = this.finalize(node, new Node.ExportNamedDeclaration(null, specifiers, source)); - } - return exportDeclaration; - }; - return Parser; - }()); - exports.Parser = Parser; - - -/***/ }, -/* 9 */ -/***/ function(module, exports) { - - "use strict"; - // Ensure the condition is true, otherwise throw an error. - // This is only to have a better contract semantic, i.e. another safety net - // to catch a logic error. The condition shall be fulfilled in normal case. - // Do NOT use this to enforce a certain condition on any user input. - Object.defineProperty(exports, "__esModule", { value: true }); - function assert(condition, message) { - /* istanbul ignore if */ - if (!condition) { - throw new Error('ASSERT: ' + message); - } - } - exports.assert = assert; - - -/***/ }, -/* 10 */ -/***/ function(module, exports) { - - "use strict"; - /* tslint:disable:max-classes-per-file */ - Object.defineProperty(exports, "__esModule", { value: true }); - var ErrorHandler = (function () { - function ErrorHandler() { - this.errors = []; - this.tolerant = false; - } - ErrorHandler.prototype.recordError = function (error) { - this.errors.push(error); - }; - ErrorHandler.prototype.tolerate = function (error) { - if (this.tolerant) { - this.recordError(error); - } - else { - throw error; - } - }; - ErrorHandler.prototype.constructError = function (msg, column) { - var error = new Error(msg); - try { - throw error; - } - catch (base) { - /* istanbul ignore else */ - if (Object.create && Object.defineProperty) { - error = Object.create(base); - Object.defineProperty(error, 'column', { value: column }); - } - } - /* istanbul ignore next */ - return error; - }; - ErrorHandler.prototype.createError = function (index, line, col, description) { - var msg = 'Line ' + line + ': ' + description; - var error = this.constructError(msg, col); - error.index = index; - error.lineNumber = line; - error.description = description; - return error; - }; - ErrorHandler.prototype.throwError = function (index, line, col, description) { - throw this.createError(index, line, col, description); - }; - ErrorHandler.prototype.tolerateError = function (index, line, col, description) { - var error = this.createError(index, line, col, description); - if (this.tolerant) { - this.recordError(error); - } - else { - throw error; - } - }; - return ErrorHandler; - }()); - exports.ErrorHandler = ErrorHandler; - - -/***/ }, -/* 11 */ -/***/ function(module, exports) { - - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - // Error messages should be identical to V8. - exports.Messages = { - BadGetterArity: 'Getter must not have any formal parameters', - BadSetterArity: 'Setter must have exactly one formal parameter', - BadSetterRestParameter: 'Setter function argument must not be a rest parameter', - ConstructorIsAsync: 'Class constructor may not be an async method', - ConstructorSpecialMethod: 'Class constructor may not be an accessor', - DeclarationMissingInitializer: 'Missing initializer in %0 declaration', - DefaultRestParameter: 'Unexpected token =', - DuplicateBinding: 'Duplicate binding %0', - DuplicateConstructor: 'A class may only have one constructor', - DuplicateProtoProperty: 'Duplicate __proto__ fields are not allowed in object literals', - ForInOfLoopInitializer: '%0 loop variable declaration may not have an initializer', - GeneratorInLegacyContext: 'Generator declarations are not allowed in legacy contexts', - IllegalBreak: 'Illegal break statement', - IllegalContinue: 'Illegal continue statement', - IllegalExportDeclaration: 'Unexpected token', - IllegalImportDeclaration: 'Unexpected token', - IllegalLanguageModeDirective: 'Illegal \'use strict\' directive in function with non-simple parameter list', - IllegalReturn: 'Illegal return statement', - InvalidEscapedReservedWord: 'Keyword must not contain escaped characters', - InvalidHexEscapeSequence: 'Invalid hexadecimal escape sequence', - InvalidLHSInAssignment: 'Invalid left-hand side in assignment', - InvalidLHSInForIn: 'Invalid left-hand side in for-in', - InvalidLHSInForLoop: 'Invalid left-hand side in for-loop', - InvalidModuleSpecifier: 'Unexpected token', - InvalidRegExp: 'Invalid regular expression', - LetInLexicalBinding: 'let is disallowed as a lexically bound name', - MissingFromClause: 'Unexpected token', - MultipleDefaultsInSwitch: 'More than one default clause in switch statement', - NewlineAfterThrow: 'Illegal newline after throw', - NoAsAfterImportNamespace: 'Unexpected token', - NoCatchOrFinally: 'Missing catch or finally after try', - ParameterAfterRestParameter: 'Rest parameter must be last formal parameter', - Redeclaration: '%0 \'%1\' has already been declared', - StaticPrototype: 'Classes may not have static property named prototype', - StrictCatchVariable: 'Catch variable may not be eval or arguments in strict mode', - StrictDelete: 'Delete of an unqualified identifier in strict mode.', - StrictFunction: 'In strict mode code, functions can only be declared at top level or inside a block', - StrictFunctionName: 'Function name may not be eval or arguments in strict mode', - StrictLHSAssignment: 'Assignment to eval or arguments is not allowed in strict mode', - StrictLHSPostfix: 'Postfix increment/decrement may not have eval or arguments operand in strict mode', - StrictLHSPrefix: 'Prefix increment/decrement may not have eval or arguments operand in strict mode', - StrictModeWith: 'Strict mode code may not include a with statement', - StrictOctalLiteral: 'Octal literals are not allowed in strict mode.', - StrictParamDupe: 'Strict mode function may not have duplicate parameter names', - StrictParamName: 'Parameter name eval or arguments is not allowed in strict mode', - StrictReservedWord: 'Use of future reserved word in strict mode', - StrictVarName: 'Variable name may not be eval or arguments in strict mode', - TemplateOctalLiteral: 'Octal literals are not allowed in template strings.', - UnexpectedEOS: 'Unexpected end of input', - UnexpectedIdentifier: 'Unexpected identifier', - UnexpectedNumber: 'Unexpected number', - UnexpectedReserved: 'Unexpected reserved word', - UnexpectedString: 'Unexpected string', - UnexpectedTemplate: 'Unexpected quasi %0', - UnexpectedToken: 'Unexpected token %0', - UnexpectedTokenIllegal: 'Unexpected token ILLEGAL', - UnknownLabel: 'Undefined label \'%0\'', - UnterminatedRegExp: 'Invalid regular expression: missing /' - }; - - -/***/ }, -/* 12 */ -/***/ function(module, exports, __webpack_require__) { - - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var assert_1 = __webpack_require__(9); - var character_1 = __webpack_require__(4); - var messages_1 = __webpack_require__(11); - function hexValue(ch) { - return '0123456789abcdef'.indexOf(ch.toLowerCase()); - } - function octalValue(ch) { - return '01234567'.indexOf(ch); - } - var Scanner = (function () { - function Scanner(code, handler) { - this.source = code; - this.errorHandler = handler; - this.trackComment = false; - this.isModule = false; - this.length = code.length; - this.index = 0; - this.lineNumber = (code.length > 0) ? 1 : 0; - this.lineStart = 0; - this.curlyStack = []; - } - Scanner.prototype.saveState = function () { - return { - index: this.index, - lineNumber: this.lineNumber, - lineStart: this.lineStart - }; - }; - Scanner.prototype.restoreState = function (state) { - this.index = state.index; - this.lineNumber = state.lineNumber; - this.lineStart = state.lineStart; - }; - Scanner.prototype.eof = function () { - return this.index >= this.length; - }; - Scanner.prototype.throwUnexpectedToken = function (message) { - if (message === void 0) { message = messages_1.Messages.UnexpectedTokenIllegal; } - return this.errorHandler.throwError(this.index, this.lineNumber, this.index - this.lineStart + 1, message); - }; - Scanner.prototype.tolerateUnexpectedToken = function (message) { - if (message === void 0) { message = messages_1.Messages.UnexpectedTokenIllegal; } - this.errorHandler.tolerateError(this.index, this.lineNumber, this.index - this.lineStart + 1, message); - }; - // https://tc39.github.io/ecma262/#sec-comments - Scanner.prototype.skipSingleLineComment = function (offset) { - var comments = []; - var start, loc; - if (this.trackComment) { - comments = []; - start = this.index - offset; - loc = { - start: { - line: this.lineNumber, - column: this.index - this.lineStart - offset - }, - end: {} - }; - } - while (!this.eof()) { - var ch = this.source.charCodeAt(this.index); - ++this.index; - if (character_1.Character.isLineTerminator(ch)) { - if (this.trackComment) { - loc.end = { - line: this.lineNumber, - column: this.index - this.lineStart - 1 - }; - var entry = { - multiLine: false, - slice: [start + offset, this.index - 1], - range: [start, this.index - 1], - loc: loc - }; - comments.push(entry); - } - if (ch === 13 && this.source.charCodeAt(this.index) === 10) { - ++this.index; - } - ++this.lineNumber; - this.lineStart = this.index; - return comments; - } - } - if (this.trackComment) { - loc.end = { - line: this.lineNumber, - column: this.index - this.lineStart - }; - var entry = { - multiLine: false, - slice: [start + offset, this.index], - range: [start, this.index], - loc: loc - }; - comments.push(entry); - } - return comments; - }; - Scanner.prototype.skipMultiLineComment = function () { - var comments = []; - var start, loc; - if (this.trackComment) { - comments = []; - start = this.index - 2; - loc = { - start: { - line: this.lineNumber, - column: this.index - this.lineStart - 2 - }, - end: {} - }; - } - while (!this.eof()) { - var ch = this.source.charCodeAt(this.index); - if (character_1.Character.isLineTerminator(ch)) { - if (ch === 0x0D && this.source.charCodeAt(this.index + 1) === 0x0A) { - ++this.index; - } - ++this.lineNumber; - ++this.index; - this.lineStart = this.index; - } - else if (ch === 0x2A) { - // Block comment ends with '*/'. - if (this.source.charCodeAt(this.index + 1) === 0x2F) { - this.index += 2; - if (this.trackComment) { - loc.end = { - line: this.lineNumber, - column: this.index - this.lineStart - }; - var entry = { - multiLine: true, - slice: [start + 2, this.index - 2], - range: [start, this.index], - loc: loc - }; - comments.push(entry); - } - return comments; - } - ++this.index; - } - else { - ++this.index; - } - } - // Ran off the end of the file - the whole thing is a comment - if (this.trackComment) { - loc.end = { - line: this.lineNumber, - column: this.index - this.lineStart - }; - var entry = { - multiLine: true, - slice: [start + 2, this.index], - range: [start, this.index], - loc: loc - }; - comments.push(entry); - } - this.tolerateUnexpectedToken(); - return comments; - }; - Scanner.prototype.scanComments = function () { - var comments; - if (this.trackComment) { - comments = []; - } - var start = (this.index === 0); - while (!this.eof()) { - var ch = this.source.charCodeAt(this.index); - if (character_1.Character.isWhiteSpace(ch)) { - ++this.index; - } - else if (character_1.Character.isLineTerminator(ch)) { - ++this.index; - if (ch === 0x0D && this.source.charCodeAt(this.index) === 0x0A) { - ++this.index; - } - ++this.lineNumber; - this.lineStart = this.index; - start = true; - } - else if (ch === 0x2F) { - ch = this.source.charCodeAt(this.index + 1); - if (ch === 0x2F) { - this.index += 2; - var comment = this.skipSingleLineComment(2); - if (this.trackComment) { - comments = comments.concat(comment); - } - start = true; - } - else if (ch === 0x2A) { - this.index += 2; - var comment = this.skipMultiLineComment(); - if (this.trackComment) { - comments = comments.concat(comment); - } - } - else { - break; - } - } - else if (start && ch === 0x2D) { - // U+003E is '>' - if ((this.source.charCodeAt(this.index + 1) === 0x2D) && (this.source.charCodeAt(this.index + 2) === 0x3E)) { - // '-->' is a single-line comment - this.index += 3; - var comment = this.skipSingleLineComment(3); - if (this.trackComment) { - comments = comments.concat(comment); - } - } - else { - break; - } - } - else if (ch === 0x3C && !this.isModule) { - if (this.source.slice(this.index + 1, this.index + 4) === '!--') { - this.index += 4; // ` - - - - - - -
- -

- - -
- - - -
- -
- Documentation generated by JSDoc on -
- - - - - diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/templates/default/tmpl/mainpage.tmpl b/packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/templates/default/tmpl/mainpage.tmpl deleted file mode 100644 index 64e9e594..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/templates/default/tmpl/mainpage.tmpl +++ /dev/null @@ -1,14 +0,0 @@ - - - -

- - - -
-
-
- diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/templates/default/tmpl/members.tmpl b/packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/templates/default/tmpl/members.tmpl deleted file mode 100644 index 154c17b6..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/templates/default/tmpl/members.tmpl +++ /dev/null @@ -1,38 +0,0 @@ - -

- - -

- - - -
- -
- - - -
Type:
-
    -
  • - -
  • -
- - - - - -
Fires:
-
    -
  • -
- - - -
Example 1? 's':'' ?>
- - diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/templates/default/tmpl/method.tmpl b/packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/templates/default/tmpl/method.tmpl deleted file mode 100644 index 0125fe29..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/templates/default/tmpl/method.tmpl +++ /dev/null @@ -1,131 +0,0 @@ - - - -

Constructor

- - - -

- - - -

- - - - -
- -
- - - -
Extends:
- - - - -
Type:
-
    -
  • - -
  • -
- - - -
This:
-
- - - -
Parameters:
- - - - - - -
Requires:
-
    -
  • -
- - - -
Fires:
-
    -
  • -
- - - -
Listens to Events:
-
    -
  • -
- - - -
Listeners of This Event:
-
    -
  • -
- - - -
Modifies:
- 1) { ?>
    -
  • -
- - - - -
Throws:
- 1) { ?>
    -
  • -
- - - - -
Returns:
- 1) { ?>
    -
  • -
- - - - -
Yields:
- 1) { ?>
    -
  • -
- - - - -
Example 1? 's':'' ?>
- - diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/templates/default/tmpl/modifies.tmpl b/packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/templates/default/tmpl/modifies.tmpl deleted file mode 100644 index 16ccbf8d..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/templates/default/tmpl/modifies.tmpl +++ /dev/null @@ -1,14 +0,0 @@ - - - -
-
- Type -
-
- -
-
- diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/templates/default/tmpl/params.tmpl b/packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/templates/default/tmpl/params.tmpl deleted file mode 100644 index 1fb4049c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/templates/default/tmpl/params.tmpl +++ /dev/null @@ -1,131 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeAttributesDefaultDescription
- - - - - - <optional>
- - - - <nullable>
- - - - <repeatable>
- -
- - - - -
Properties
- -
diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/templates/default/tmpl/properties.tmpl b/packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/templates/default/tmpl/properties.tmpl deleted file mode 100644 index 40e09097..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/templates/default/tmpl/properties.tmpl +++ /dev/null @@ -1,108 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeAttributesDefaultDescription
- - - - - - <optional>
- - - - <nullable>
- -
- - - - -
Properties
-
diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/templates/default/tmpl/returns.tmpl b/packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/templates/default/tmpl/returns.tmpl deleted file mode 100644 index d0704592..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/templates/default/tmpl/returns.tmpl +++ /dev/null @@ -1,19 +0,0 @@ - -
- -
- - - -
-
- Type -
-
- -
-
- \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/templates/default/tmpl/source.tmpl b/packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/templates/default/tmpl/source.tmpl deleted file mode 100644 index e559b5d1..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/templates/default/tmpl/source.tmpl +++ /dev/null @@ -1,8 +0,0 @@ - -
-
-
-
-
\ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/templates/default/tmpl/tutorial.tmpl b/packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/templates/default/tmpl/tutorial.tmpl deleted file mode 100644 index 88a0ad52..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/templates/default/tmpl/tutorial.tmpl +++ /dev/null @@ -1,19 +0,0 @@ -
- -
- 0) { ?> -
    -
  • -
- - -

-
- -
- -
- -
diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/templates/default/tmpl/type.tmpl b/packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/templates/default/tmpl/type.tmpl deleted file mode 100644 index ec2c6c0d..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/templates/default/tmpl/type.tmpl +++ /dev/null @@ -1,7 +0,0 @@ - - -| - \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/templates/haruki/README.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/templates/haruki/README.md deleted file mode 100644 index ee6d36f1..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/templates/haruki/README.md +++ /dev/null @@ -1,39 +0,0 @@ -OVERVIEW -======== - -JSDoc 3 Haruki is an experimental template optimised for use with publishing processes that consume either JSON or XML. Whereas the default JSDoc template outputs an HTML representation of your API, Haruki will output a JSON, or optionally an XML, representation. - -Currently Haruki only supports a subset of the tags supported by the default template. Those are: - - * @name - * @desc - * @type - * @namespace - * @method (or @function) - * @member (or @var) - * @class - * @mixin - * @event - * @param - * @returns - * @throws - * @example - * @access (like @private or @public) - -This limited support set is intentional, as it is meant to be a usable set that could be shared with either JavaScript or PHP documentation -- another experimental tool, named "Vonnegut", can produce Haruki compatible JSON from PHPDoc tags. - -Note: `@link`s will appear in the output untransformed, there is no way to know at this stage what the file layout of your output will eventually be. It is assumed that whatever process emits the final output file/s will transform `@link` tags at that point. - -USAGE -===== - - ./jsdoc myscript.js -t templates/haruki -d console -q format=xml - -The results of this command will appear in `stdout` and can be piped into other tools for further processing. - -MORE -===== - -If you are interested in Haruki, you are encouraged to discuss your questions or ideas on the JSDoc-Users mailing list and fork/contribute to this project. - -For more information contact Michael Mathews at . \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/templates/haruki/publish.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/templates/haruki/publish.js deleted file mode 100644 index 47aa6061..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/templates/haruki/publish.js +++ /dev/null @@ -1,224 +0,0 @@ -/* eslint-disable indent, no-nested-ternary, space-infix-ops */ -/** - @overview Builds a tree-like JSON string from the doclet data. - @version 0.0.3 - @example - ./jsdoc scratch/jsdoc_test.js -t templates/haruki -d console -q format=xml -*/ -const xml = require('js2xmlparser'); - -const hasOwnProp = Object.prototype.hasOwnProperty; - -function graft(parentNode, childNodes, parentLongname) { - childNodes - .filter(({memberof}) => memberof === parentLongname) - .forEach(element => { - let i; - let len; - let thisClass; - let thisEvent; - let thisFunction; - let thisMixin; - let thisNamespace; - - if (element.kind === 'namespace') { - if (!parentNode.namespaces) { - parentNode.namespaces = []; - } - - thisNamespace = { - 'name': element.name, - 'description': element.description || '', - 'access': element.access || '', - 'virtual': Boolean(element.virtual) - }; - - parentNode.namespaces.push(thisNamespace); - - graft(thisNamespace, childNodes, element.longname); - } - else if (element.kind === 'mixin') { - if (!parentNode.mixins) { - parentNode.mixins = []; - } - - thisMixin = { - 'name': element.name, - 'description': element.description || '', - 'access': element.access || '', - 'virtual': Boolean(element.virtual) - }; - - parentNode.mixins.push(thisMixin); - - graft(thisMixin, childNodes, element.longname); - } - else if (element.kind === 'function') { - if (!parentNode.functions) { - parentNode.functions = []; - } - - thisFunction = { - 'name': element.name, - 'access': element.access || '', - 'virtual': Boolean(element.virtual), - 'description': element.description || '', - 'parameters': [], - 'examples': [] - }; - - parentNode.functions.push(thisFunction); - - if (element.returns) { - thisFunction.returns = { - 'type': element.returns[0].type? (element.returns[0].type.names.length === 1? element.returns[0].type.names[0] : element.returns[0].type.names) : '', - 'description': element.returns[0].description || '' - }; - } - - if (element.examples) { - for (i = 0, len = element.examples.length; i < len; i++) { - thisFunction.examples.push(element.examples[i]); - } - } - - if (element.params) { - for (i = 0, len = element.params.length; i < len; i++) { - thisFunction.parameters.push({ - 'name': element.params[i].name, - 'type': element.params[i].type? (element.params[i].type.names.length === 1? element.params[i].type.names[0] : element.params[i].type.names) : '', - 'description': element.params[i].description || '', - 'default': hasOwnProp.call(element.params[i], 'defaultvalue') ? element.params[i].defaultvalue : '', - 'optional': typeof element.params[i].optional === 'boolean'? element.params[i].optional : '', - 'nullable': typeof element.params[i].nullable === 'boolean'? element.params[i].nullable : '' - }); - } - } - } - else if (element.kind === 'member') { - if (!parentNode.properties) { - parentNode.properties = []; - } - parentNode.properties.push({ - 'name': element.name, - 'access': element.access || '', - 'virtual': Boolean(element.virtual), - 'description': element.description || '', - 'type': element.type? (element.type.length === 1? element.type[0] : element.type) : '' - }); - } - - else if (element.kind === 'event') { - if (!parentNode.events) { - parentNode.events = []; - } - - thisEvent = { - 'name': element.name, - 'access': element.access || '', - 'virtual': Boolean(element.virtual), - 'description': element.description || '', - 'parameters': [], - 'examples': [] - }; - - parentNode.events.push(thisEvent); - - if (element.returns) { - thisEvent.returns = { - 'type': element.returns.type ? (element.returns.type.names.length === 1 ? element.returns.type.names[0] : element.returns.type.names) : '', - 'description': element.returns.description || '' - }; - } - - if (element.examples) { - for (i = 0, len = element.examples.length; i < len; i++) { - thisEvent.examples.push(element.examples[i]); - } - } - - if (element.params) { - for (i = 0, len = element.params.length; i < len; i++) { - thisEvent.parameters.push({ - 'name': element.params[i].name, - 'type': element.params[i].type? (element.params[i].type.names.length === 1? element.params[i].type.names[0] : element.params[i].type.names) : '', - 'description': element.params[i].description || '', - 'default': hasOwnProp.call(element.params[i], 'defaultvalue') ? element.params[i].defaultvalue : '', - 'optional': typeof element.params[i].optional === 'boolean'? element.params[i].optional : '', - 'nullable': typeof element.params[i].nullable === 'boolean'? element.params[i].nullable : '' - }); - } - } - } - else if (element.kind === 'class') { - if (!parentNode.classes) { - parentNode.classes = []; - } - - thisClass = { - 'name': element.name, - 'description': element.classdesc || '', - 'extends': element.augments || [], - 'access': element.access || '', - 'virtual': Boolean(element.virtual), - 'fires': element.fires || '', - 'constructor': { - 'name': element.name, - 'description': element.description || '', - 'parameters': [ - ], - 'examples': [] - } - }; - - parentNode.classes.push(thisClass); - - if (element.examples) { - for (i = 0, len = element.examples.length; i < len; i++) { - thisClass.constructor.examples.push(element.examples[i]); - } - } - - if (element.params) { - for (i = 0, len = element.params.length; i < len; i++) { - thisClass.constructor.parameters.push({ - 'name': element.params[i].name, - 'type': element.params[i].type? (element.params[i].type.names.length === 1? element.params[i].type.names[0] : element.params[i].type.names) : '', - 'description': element.params[i].description || '', - 'default': hasOwnProp.call(element.params[i], 'defaultvalue') ? element.params[i].defaultvalue : '', - 'optional': typeof element.params[i].optional === 'boolean'? element.params[i].optional : '', - 'nullable': typeof element.params[i].nullable === 'boolean'? element.params[i].nullable : '' - }); - } - } - - graft(thisClass, childNodes, element.longname); - } - }); -} - -/** - @param {TAFFY} data - @param {object} opts - */ -exports.publish = (data, {destination, query}) => { - let docs; - const root = {}; - - data({undocumented: true}).remove(); - docs = data().get(); // <-- an array of Doclet objects - - graft(root, docs); - - if (destination === 'console') { - if (query && query.format === 'xml') { - console.log( xml.parse('jsdoc', root) ); - } - else { - console.log( require('jsdoc/util/dumper').dump(root) ); - } - } - else { - console.log('This template only supports output to the console. Use the option "-d console" when you run JSDoc.'); - } -}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/templates/silent/README.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/templates/silent/README.md deleted file mode 100644 index d33e0fdf..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/templates/silent/README.md +++ /dev/null @@ -1,11 +0,0 @@ -OVERVIEW -======== - -The `silent` template outputs nothing at all. Why would that be useful? Primarily for running JSDoc as a linter to check for syntax errors and unrecognized tags in documentation comments, although it may also be useful for testing or benchmarking purposes. - -USAGE -===== - - ./jsdoc myscript.js -t templates/silent -a all --pedantic - -This command exits with a non-zero exit code if any errors are encountered. It writes nothing to disk and the only output it produces is any error messages written to `stderr`. This command can also be used to warn about tags which are unknown to JSDoc by setting `"allowUnknownTags": false` in a configuration file. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/templates/silent/publish.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/templates/silent/publish.js deleted file mode 100644 index 7de0a06f..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/jsdoc/templates/silent/publish.js +++ /dev/null @@ -1,7 +0,0 @@ -/* eslint-disable no-empty-function, no-unused-vars */ -/** - @param {TAFFY} taffyData See . - @param {object} opts - @param {Tutorial} tutorials - */ -exports.publish = (taffyData, opts, tutorials) => {}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/json-bigint/LICENSE b/packages/wyatt_notification_bloc/example/scripts/node_modules/json-bigint/LICENSE deleted file mode 100644 index 9ab4d83b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/json-bigint/LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2013 Andrey Sidorov - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/json-bigint/README.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/json-bigint/README.md deleted file mode 100644 index e7335c73..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/json-bigint/README.md +++ /dev/null @@ -1,240 +0,0 @@ -# json-bigint - -[![Build Status](https://secure.travis-ci.org/sidorares/json-bigint.png)](http://travis-ci.org/sidorares/json-bigint) -[![NPM](https://nodei.co/npm/json-bigint.png?downloads=true&stars=true)](https://nodei.co/npm/json-bigint/) - -JSON.parse/stringify with bigints support. Based on Douglas Crockford [JSON.js](https://github.com/douglascrockford/JSON-js) package and [bignumber.js](https://github.com/MikeMcl/bignumber.js) library. - -Native `Bigint` was added to JS recently, so we added an option to leverage it instead of `bignumber.js`. However, the parsing with native `BigInt` is kept an option for backward compability. - -While most JSON parsers assume numeric values have same precision restrictions as IEEE 754 double, JSON specification _does not_ say anything about number precision. Any floating point number in decimal (optionally scientific) notation is valid JSON value. It's a good idea to serialize values which might fall out of IEEE 754 integer precision as strings in your JSON api, but `{ "value" : 9223372036854775807}`, for example, is still a valid RFC4627 JSON string, and in most JS runtimes the result of `JSON.parse` is this object: `{ value: 9223372036854776000 }` - -========== - -example: - -```js -var JSONbig = require('json-bigint'); - -var json = '{ "value" : 9223372036854775807, "v2": 123 }'; -console.log('Input:', json); -console.log(''); - -console.log('node.js built-in JSON:'); -var r = JSON.parse(json); -console.log('JSON.parse(input).value : ', r.value.toString()); -console.log('JSON.stringify(JSON.parse(input)):', JSON.stringify(r)); - -console.log('\n\nbig number JSON:'); -var r1 = JSONbig.parse(json); -console.log('JSONbig.parse(input).value : ', r1.value.toString()); -console.log('JSONbig.stringify(JSONbig.parse(input)):', JSONbig.stringify(r1)); -``` - -Output: - -``` -Input: { "value" : 9223372036854775807, "v2": 123 } - -node.js built-in JSON: -JSON.parse(input).value : 9223372036854776000 -JSON.stringify(JSON.parse(input)): {"value":9223372036854776000,"v2":123} - - -big number JSON: -JSONbig.parse(input).value : 9223372036854775807 -JSONbig.stringify(JSONbig.parse(input)): {"value":9223372036854775807,"v2":123} -``` - -### Options - -The behaviour of the parser is somewhat configurable through 'options' - -#### options.strict, boolean, default false - -Specifies the parsing should be "strict" towards reporting duplicate-keys in the parsed string. -The default follows what is allowed in standard json and resembles the behavior of JSON.parse, but overwrites any previous values with the last one assigned to the duplicate-key. - -Setting options.strict = true will fail-fast on such duplicate-key occurances and thus warn you upfront of possible lost information. - -example: - -```js -var JSONbig = require('json-bigint'); -var JSONstrict = require('json-bigint')({ strict: true }); - -var dupkeys = '{ "dupkey": "value 1", "dupkey": "value 2"}'; -console.log('\n\nDuplicate Key test with both lenient and strict JSON parsing'); -console.log('Input:', dupkeys); -var works = JSONbig.parse(dupkeys); -console.log('JSON.parse(dupkeys).dupkey: %s', works.dupkey); -var fails = 'will stay like this'; -try { - fails = JSONstrict.parse(dupkeys); - console.log('ERROR!! Should never get here'); -} catch (e) { - console.log( - 'Succesfully catched expected exception on duplicate keys: %j', - e - ); -} -``` - -Output - -``` -Duplicate Key test with big number JSON -Input: { "dupkey": "value 1", "dupkey": "value 2"} -JSON.parse(dupkeys).dupkey: value 2 -Succesfully catched expected exception on duplicate keys: {"name":"SyntaxError","message":"Duplicate key \"dupkey\"","at":33,"text":"{ \"dupkey\": \"value 1\", \"dupkey\": \"value 2\"}"} - -``` - -#### options.storeAsString, boolean, default false - -Specifies if BigInts should be stored in the object as a string, rather than the default BigNumber. - -Note that this is a dangerous behavior as it breaks the default functionality of being able to convert back-and-forth without data type changes (as this will convert all BigInts to be-and-stay strings). - -example: - -```js -var JSONbig = require('json-bigint'); -var JSONbigString = require('json-bigint')({ storeAsString: true }); -var key = '{ "key": 1234567890123456789 }'; -console.log('\n\nStoring the BigInt as a string, instead of a BigNumber'); -console.log('Input:', key); -var withInt = JSONbig.parse(key); -var withString = JSONbigString.parse(key); -console.log( - 'Default type: %s, With option type: %s', - typeof withInt.key, - typeof withString.key -); -``` - -Output - -``` -Storing the BigInt as a string, instead of a BigNumber -Input: { "key": 1234567890123456789 } -Default type: object, With option type: string - -``` - -#### options.useNativeBigInt, boolean, default false - -Specifies if parser uses native BigInt instead of bignumber.js - -example: - -```js -var JSONbig = require('json-bigint'); -var JSONbigNative = require('json-bigint')({ useNativeBigInt: true }); -var key = '{ "key": 993143214321423154315154321 }'; -console.log(`\n\nStoring the Number as native BigInt, instead of a BigNumber`); -console.log('Input:', key); -var normal = JSONbig.parse(key); -var nativeBigInt = JSONbigNative.parse(key); -console.log( - 'Default type: %s, With option type: %s', - typeof normal.key, - typeof nativeBigInt.key -); -``` - -Output - -``` -Storing the Number as native BigInt, instead of a BigNumber -Input: { "key": 993143214321423154315154321 } -Default type: object, With option type: bigint - -``` - -#### options.alwaysParseAsBig, boolean, default false - -Specifies if all numbers should be stored as BigNumber. - -Note that this is a dangerous behavior as it breaks the default functionality of being able to convert back-and-forth without data type changes (as this will convert all Number to be-and-stay BigNumber) - -example: - -```js -var JSONbig = require('json-bigint'); -var JSONbigAlways = require('json-bigint')({ alwaysParseAsBig: true }); -var key = '{ "key": 123 }'; // there is no need for BigNumber by default, but we're forcing it -console.log(`\n\nStoring the Number as a BigNumber, instead of a Number`); -console.log('Input:', key); -var normal = JSONbig.parse(key); -var always = JSONbigAlways.parse(key); -console.log( - 'Default type: %s, With option type: %s', - typeof normal.key, - typeof always.key -); -``` - -Output - -``` -Storing the Number as a BigNumber, instead of a Number -Input: { "key": 123 } -Default type: number, With option type: object - -``` - -If you want to force all numbers to be parsed as native `BigInt` -(you probably do! Otherwise any calulations become a real headache): - -```js -var JSONbig = require('json-bigint')({ - alwaysParseAsBig: true, - useNativeBigInt: true, -}); -``` - -#### options.protoAction, boolean, default: "error". Possible values: "error", "ignore", "preserve" - -#### options.constructorAction, boolean, default: "error". Possible values: "error", "ignore", "preserve" - -Controls how `__proto__` and `constructor` properties are treated. If set to "error" they are not allowed and -parse() call will throw an error. If set to "ignore" the prroperty and it;s value is skipped from parsing and object building. -If set to "preserve" the `__proto__` property is set. One should be extra careful and make sure any other library consuming generated data -is not vulnerable to prototype poisoning attacks. - -example: - -```js -var JSONbigAlways = require('json-bigint')({ protoAction: 'ignore' }); -const user = JSONbig.parse('{ "__proto__": { "admin": true }, "id": 12345 }'); -// => result is { id: 12345 } -``` - -### Links: - -- [RFC4627: The application/json Media Type for JavaScript Object Notation (JSON)](http://www.ietf.org/rfc/rfc4627.txt) -- [Re: \[Json\] Limitations on number size?](http://www.ietf.org/mail-archive/web/json/current/msg00297.html) -- [Is there any proper way to parse JSON with large numbers? (long, bigint, int64)](http://stackoverflow.com/questions/18755125/node-js-is-there-any-proper-way-to-parse-json-with-large-numbers-long-bigint) -- [What is JavaScript's Max Int? What's the highest Integer value a Number can go to without losing precision?](http://stackoverflow.com/questions/307179/what-is-javascripts-max-int-whats-the-highest-integer-value-a-number-can-go-t) -- [Large numbers erroneously rounded in Javascript](http://stackoverflow.com/questions/1379934/large-numbers-erroneously-rounded-in-javascript) - -### Note on native BigInt support - -#### Stringifying - -Full support out-of-the-box, stringifies BigInts as pure numbers (no quotes, no `n`) - -#### Limitations - -- Roundtrip operations - -`s === JSONbig.stringify(JSONbig.parse(s))` but - -`o !== JSONbig.parse(JSONbig.stringify(o))` - -when `o` has a value with something like `123n`. - -`JSONbig` stringify `123n` as `123`, which becomes `number` (aka `123` not `123n`) by default when being reparsed. - -There is currently no consistent way to deal with this issue, so we decided to leave it, handling this specific case is then up to users. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/json-bigint/index.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/json-bigint/index.js deleted file mode 100644 index 4757600b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/json-bigint/index.js +++ /dev/null @@ -1,12 +0,0 @@ -var json_stringify = require('./lib/stringify.js').stringify; -var json_parse = require('./lib/parse.js'); - -module.exports = function(options) { - return { - parse: json_parse(options), - stringify: json_stringify - } -}; -//create the default method members with no options applied for backwards compatibility -module.exports.parse = json_parse(); -module.exports.stringify = json_stringify; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/json-bigint/lib/parse.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/json-bigint/lib/parse.js deleted file mode 100644 index bb4e5ebf..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/json-bigint/lib/parse.js +++ /dev/null @@ -1,443 +0,0 @@ -var BigNumber = null; - -// regexpxs extracted from -// (c) BSD-3-Clause -// https://github.com/fastify/secure-json-parse/graphs/contributors and https://github.com/hapijs/bourne/graphs/contributors - -const suspectProtoRx = /(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])/; -const suspectConstructorRx = /(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)/; - -/* - json_parse.js - 2012-06-20 - - Public Domain. - - NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK. - - This file creates a json_parse function. - During create you can (optionally) specify some behavioural switches - - require('json-bigint')(options) - - The optional options parameter holds switches that drive certain - aspects of the parsing process: - * options.strict = true will warn about duplicate-key usage in the json. - The default (strict = false) will silently ignore those and overwrite - values for keys that are in duplicate use. - - The resulting function follows this signature: - json_parse(text, reviver) - This method parses a JSON text to produce an object or array. - It can throw a SyntaxError exception. - - The optional reviver parameter is a function that can filter and - transform the results. It receives each of the keys and values, - and its return value is used instead of the original value. - If it returns what it received, then the structure is not modified. - If it returns undefined then the member is deleted. - - Example: - - // Parse the text. Values that look like ISO date strings will - // be converted to Date objects. - - myData = json_parse(text, function (key, value) { - var a; - if (typeof value === 'string') { - a = -/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}(?:\.\d*)?)Z$/.exec(value); - if (a) { - return new Date(Date.UTC(+a[1], +a[2] - 1, +a[3], +a[4], - +a[5], +a[6])); - } - } - return value; - }); - - This is a reference implementation. You are free to copy, modify, or - redistribute. - - This code should be minified before deployment. - See http://javascript.crockford.com/jsmin.html - - USE YOUR OWN COPY. IT IS EXTREMELY UNWISE TO LOAD CODE FROM SERVERS YOU DO - NOT CONTROL. -*/ - -/*members "", "\"", "\/", "\\", at, b, call, charAt, f, fromCharCode, - hasOwnProperty, message, n, name, prototype, push, r, t, text -*/ - -var json_parse = function (options) { - 'use strict'; - - // This is a function that can parse a JSON text, producing a JavaScript - // data structure. It is a simple, recursive descent parser. It does not use - // eval or regular expressions, so it can be used as a model for implementing - // a JSON parser in other languages. - - // We are defining the function inside of another function to avoid creating - // global variables. - - // Default options one can override by passing options to the parse() - var _options = { - strict: false, // not being strict means do not generate syntax errors for "duplicate key" - storeAsString: false, // toggles whether the values should be stored as BigNumber (default) or a string - alwaysParseAsBig: false, // toggles whether all numbers should be Big - useNativeBigInt: false, // toggles whether to use native BigInt instead of bignumber.js - protoAction: 'error', - constructorAction: 'error', - }; - - // If there are options, then use them to override the default _options - if (options !== undefined && options !== null) { - if (options.strict === true) { - _options.strict = true; - } - if (options.storeAsString === true) { - _options.storeAsString = true; - } - _options.alwaysParseAsBig = - options.alwaysParseAsBig === true ? options.alwaysParseAsBig : false; - _options.useNativeBigInt = - options.useNativeBigInt === true ? options.useNativeBigInt : false; - - if (typeof options.constructorAction !== 'undefined') { - if ( - options.constructorAction === 'error' || - options.constructorAction === 'ignore' || - options.constructorAction === 'preserve' - ) { - _options.constructorAction = options.constructorAction; - } else { - throw new Error( - `Incorrect value for constructorAction option, must be "error", "ignore" or undefined but passed ${options.constructorAction}` - ); - } - } - - if (typeof options.protoAction !== 'undefined') { - if ( - options.protoAction === 'error' || - options.protoAction === 'ignore' || - options.protoAction === 'preserve' - ) { - _options.protoAction = options.protoAction; - } else { - throw new Error( - `Incorrect value for protoAction option, must be "error", "ignore" or undefined but passed ${options.protoAction}` - ); - } - } - } - - var at, // The index of the current character - ch, // The current character - escapee = { - '"': '"', - '\\': '\\', - '/': '/', - b: '\b', - f: '\f', - n: '\n', - r: '\r', - t: '\t', - }, - text, - error = function (m) { - // Call error when something is wrong. - - throw { - name: 'SyntaxError', - message: m, - at: at, - text: text, - }; - }, - next = function (c) { - // If a c parameter is provided, verify that it matches the current character. - - if (c && c !== ch) { - error("Expected '" + c + "' instead of '" + ch + "'"); - } - - // Get the next character. When there are no more characters, - // return the empty string. - - ch = text.charAt(at); - at += 1; - return ch; - }, - number = function () { - // Parse a number value. - - var number, - string = ''; - - if (ch === '-') { - string = '-'; - next('-'); - } - while (ch >= '0' && ch <= '9') { - string += ch; - next(); - } - if (ch === '.') { - string += '.'; - while (next() && ch >= '0' && ch <= '9') { - string += ch; - } - } - if (ch === 'e' || ch === 'E') { - string += ch; - next(); - if (ch === '-' || ch === '+') { - string += ch; - next(); - } - while (ch >= '0' && ch <= '9') { - string += ch; - next(); - } - } - number = +string; - if (!isFinite(number)) { - error('Bad number'); - } else { - if (BigNumber == null) BigNumber = require('bignumber.js'); - //if (number > 9007199254740992 || number < -9007199254740992) - // Bignumber has stricter check: everything with length > 15 digits disallowed - if (string.length > 15) - return _options.storeAsString - ? string - : _options.useNativeBigInt - ? BigInt(string) - : new BigNumber(string); - else - return !_options.alwaysParseAsBig - ? number - : _options.useNativeBigInt - ? BigInt(number) - : new BigNumber(number); - } - }, - string = function () { - // Parse a string value. - - var hex, - i, - string = '', - uffff; - - // When parsing for string values, we must look for " and \ characters. - - if (ch === '"') { - var startAt = at; - while (next()) { - if (ch === '"') { - if (at - 1 > startAt) string += text.substring(startAt, at - 1); - next(); - return string; - } - if (ch === '\\') { - if (at - 1 > startAt) string += text.substring(startAt, at - 1); - next(); - if (ch === 'u') { - uffff = 0; - for (i = 0; i < 4; i += 1) { - hex = parseInt(next(), 16); - if (!isFinite(hex)) { - break; - } - uffff = uffff * 16 + hex; - } - string += String.fromCharCode(uffff); - } else if (typeof escapee[ch] === 'string') { - string += escapee[ch]; - } else { - break; - } - startAt = at; - } - } - } - error('Bad string'); - }, - white = function () { - // Skip whitespace. - - while (ch && ch <= ' ') { - next(); - } - }, - word = function () { - // true, false, or null. - - switch (ch) { - case 't': - next('t'); - next('r'); - next('u'); - next('e'); - return true; - case 'f': - next('f'); - next('a'); - next('l'); - next('s'); - next('e'); - return false; - case 'n': - next('n'); - next('u'); - next('l'); - next('l'); - return null; - } - error("Unexpected '" + ch + "'"); - }, - value, // Place holder for the value function. - array = function () { - // Parse an array value. - - var array = []; - - if (ch === '[') { - next('['); - white(); - if (ch === ']') { - next(']'); - return array; // empty array - } - while (ch) { - array.push(value()); - white(); - if (ch === ']') { - next(']'); - return array; - } - next(','); - white(); - } - } - error('Bad array'); - }, - object = function () { - // Parse an object value. - - var key, - object = Object.create(null); - - if (ch === '{') { - next('{'); - white(); - if (ch === '}') { - next('}'); - return object; // empty object - } - while (ch) { - key = string(); - white(); - next(':'); - if ( - _options.strict === true && - Object.hasOwnProperty.call(object, key) - ) { - error('Duplicate key "' + key + '"'); - } - - if (suspectProtoRx.test(key) === true) { - if (_options.protoAction === 'error') { - error('Object contains forbidden prototype property'); - } else if (_options.protoAction === 'ignore') { - value(); - } else { - object[key] = value(); - } - } else if (suspectConstructorRx.test(key) === true) { - if (_options.constructorAction === 'error') { - error('Object contains forbidden constructor property'); - } else if (_options.constructorAction === 'ignore') { - value(); - } else { - object[key] = value(); - } - } else { - object[key] = value(); - } - - white(); - if (ch === '}') { - next('}'); - return object; - } - next(','); - white(); - } - } - error('Bad object'); - }; - - value = function () { - // Parse a JSON value. It could be an object, an array, a string, a number, - // or a word. - - white(); - switch (ch) { - case '{': - return object(); - case '[': - return array(); - case '"': - return string(); - case '-': - return number(); - default: - return ch >= '0' && ch <= '9' ? number() : word(); - } - }; - - // Return the json_parse function. It will have access to all of the above - // functions and variables. - - return function (source, reviver) { - var result; - - text = source + ''; - at = 0; - ch = ' '; - result = value(); - white(); - if (ch) { - error('Syntax error'); - } - - // If there is a reviver function, we recursively walk the new structure, - // passing each name/value pair to the reviver function for possible - // transformation, starting with a temporary root object that holds the result - // in an empty key. If there is not a reviver function, we simply return the - // result. - - return typeof reviver === 'function' - ? (function walk(holder, key) { - var k, - v, - value = holder[key]; - if (value && typeof value === 'object') { - Object.keys(value).forEach(function (k) { - v = walk(value, k); - if (v !== undefined) { - value[k] = v; - } else { - delete value[k]; - } - }); - } - return reviver.call(holder, key, value); - })({ '': result }, '') - : result; - }; -}; - -module.exports = json_parse; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/json-bigint/lib/stringify.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/json-bigint/lib/stringify.js deleted file mode 100644 index 3bd52699..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/json-bigint/lib/stringify.js +++ /dev/null @@ -1,384 +0,0 @@ -var BigNumber = require('bignumber.js'); - -/* - json2.js - 2013-05-26 - - Public Domain. - - NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK. - - See http://www.JSON.org/js.html - - - This code should be minified before deployment. - See http://javascript.crockford.com/jsmin.html - - USE YOUR OWN COPY. IT IS EXTREMELY UNWISE TO LOAD CODE FROM SERVERS YOU DO - NOT CONTROL. - - - This file creates a global JSON object containing two methods: stringify - and parse. - - JSON.stringify(value, replacer, space) - value any JavaScript value, usually an object or array. - - replacer an optional parameter that determines how object - values are stringified for objects. It can be a - function or an array of strings. - - space an optional parameter that specifies the indentation - of nested structures. If it is omitted, the text will - be packed without extra whitespace. If it is a number, - it will specify the number of spaces to indent at each - level. If it is a string (such as '\t' or ' '), - it contains the characters used to indent at each level. - - This method produces a JSON text from a JavaScript value. - - When an object value is found, if the object contains a toJSON - method, its toJSON method will be called and the result will be - stringified. A toJSON method does not serialize: it returns the - value represented by the name/value pair that should be serialized, - or undefined if nothing should be serialized. The toJSON method - will be passed the key associated with the value, and this will be - bound to the value - - For example, this would serialize Dates as ISO strings. - - Date.prototype.toJSON = function (key) { - function f(n) { - // Format integers to have at least two digits. - return n < 10 ? '0' + n : n; - } - - return this.getUTCFullYear() + '-' + - f(this.getUTCMonth() + 1) + '-' + - f(this.getUTCDate()) + 'T' + - f(this.getUTCHours()) + ':' + - f(this.getUTCMinutes()) + ':' + - f(this.getUTCSeconds()) + 'Z'; - }; - - You can provide an optional replacer method. It will be passed the - key and value of each member, with this bound to the containing - object. The value that is returned from your method will be - serialized. If your method returns undefined, then the member will - be excluded from the serialization. - - If the replacer parameter is an array of strings, then it will be - used to select the members to be serialized. It filters the results - such that only members with keys listed in the replacer array are - stringified. - - Values that do not have JSON representations, such as undefined or - functions, will not be serialized. Such values in objects will be - dropped; in arrays they will be replaced with null. You can use - a replacer function to replace those with JSON values. - JSON.stringify(undefined) returns undefined. - - The optional space parameter produces a stringification of the - value that is filled with line breaks and indentation to make it - easier to read. - - If the space parameter is a non-empty string, then that string will - be used for indentation. If the space parameter is a number, then - the indentation will be that many spaces. - - Example: - - text = JSON.stringify(['e', {pluribus: 'unum'}]); - // text is '["e",{"pluribus":"unum"}]' - - - text = JSON.stringify(['e', {pluribus: 'unum'}], null, '\t'); - // text is '[\n\t"e",\n\t{\n\t\t"pluribus": "unum"\n\t}\n]' - - text = JSON.stringify([new Date()], function (key, value) { - return this[key] instanceof Date ? - 'Date(' + this[key] + ')' : value; - }); - // text is '["Date(---current time---)"]' - - - JSON.parse(text, reviver) - This method parses a JSON text to produce an object or array. - It can throw a SyntaxError exception. - - The optional reviver parameter is a function that can filter and - transform the results. It receives each of the keys and values, - and its return value is used instead of the original value. - If it returns what it received, then the structure is not modified. - If it returns undefined then the member is deleted. - - Example: - - // Parse the text. Values that look like ISO date strings will - // be converted to Date objects. - - myData = JSON.parse(text, function (key, value) { - var a; - if (typeof value === 'string') { - a = -/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}(?:\.\d*)?)Z$/.exec(value); - if (a) { - return new Date(Date.UTC(+a[1], +a[2] - 1, +a[3], +a[4], - +a[5], +a[6])); - } - } - return value; - }); - - myData = JSON.parse('["Date(09/09/2001)"]', function (key, value) { - var d; - if (typeof value === 'string' && - value.slice(0, 5) === 'Date(' && - value.slice(-1) === ')') { - d = new Date(value.slice(5, -1)); - if (d) { - return d; - } - } - return value; - }); - - - This is a reference implementation. You are free to copy, modify, or - redistribute. -*/ - -/*jslint evil: true, regexp: true */ - -/*members "", "\b", "\t", "\n", "\f", "\r", "\"", JSON, "\\", apply, - call, charCodeAt, getUTCDate, getUTCFullYear, getUTCHours, - getUTCMinutes, getUTCMonth, getUTCSeconds, hasOwnProperty, join, - lastIndex, length, parse, prototype, push, replace, slice, stringify, - test, toJSON, toString, valueOf -*/ - - -// Create a JSON object only if one does not already exist. We create the -// methods in a closure to avoid creating global variables. - -var JSON = module.exports; - -(function () { - 'use strict'; - - function f(n) { - // Format integers to have at least two digits. - return n < 10 ? '0' + n : n; - } - - var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, - escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, - gap, - indent, - meta = { // table of character substitutions - '\b': '\\b', - '\t': '\\t', - '\n': '\\n', - '\f': '\\f', - '\r': '\\r', - '"' : '\\"', - '\\': '\\\\' - }, - rep; - - - function quote(string) { - -// If the string contains no control characters, no quote characters, and no -// backslash characters, then we can safely slap some quotes around it. -// Otherwise we must also replace the offending characters with safe escape -// sequences. - - escapable.lastIndex = 0; - return escapable.test(string) ? '"' + string.replace(escapable, function (a) { - var c = meta[a]; - return typeof c === 'string' - ? c - : '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4); - }) + '"' : '"' + string + '"'; - } - - - function str(key, holder) { - -// Produce a string from holder[key]. - - var i, // The loop counter. - k, // The member key. - v, // The member value. - length, - mind = gap, - partial, - value = holder[key], - isBigNumber = value != null && (value instanceof BigNumber || BigNumber.isBigNumber(value)); - -// If the value has a toJSON method, call it to obtain a replacement value. - - if (value && typeof value === 'object' && - typeof value.toJSON === 'function') { - value = value.toJSON(key); - } - -// If we were called with a replacer function, then call the replacer to -// obtain a replacement value. - - if (typeof rep === 'function') { - value = rep.call(holder, key, value); - } - -// What happens next depends on the value's type. - - switch (typeof value) { - case 'string': - if (isBigNumber) { - return value; - } else { - return quote(value); - } - - case 'number': - -// JSON numbers must be finite. Encode non-finite numbers as null. - - return isFinite(value) ? String(value) : 'null'; - - case 'boolean': - case 'null': - case 'bigint': - -// If the value is a boolean or null, convert it to a string. Note: -// typeof null does not produce 'null'. The case is included here in -// the remote chance that this gets fixed someday. - - return String(value); - -// If the type is 'object', we might be dealing with an object or an array or -// null. - - case 'object': - -// Due to a specification blunder in ECMAScript, typeof null is 'object', -// so watch out for that case. - - if (!value) { - return 'null'; - } - -// Make an array to hold the partial results of stringifying this object value. - - gap += indent; - partial = []; - -// Is the value an array? - - if (Object.prototype.toString.apply(value) === '[object Array]') { - -// The value is an array. Stringify every element. Use null as a placeholder -// for non-JSON values. - - length = value.length; - for (i = 0; i < length; i += 1) { - partial[i] = str(i, value) || 'null'; - } - -// Join all of the elements together, separated with commas, and wrap them in -// brackets. - - v = partial.length === 0 - ? '[]' - : gap - ? '[\n' + gap + partial.join(',\n' + gap) + '\n' + mind + ']' - : '[' + partial.join(',') + ']'; - gap = mind; - return v; - } - -// If the replacer is an array, use it to select the members to be stringified. - - if (rep && typeof rep === 'object') { - length = rep.length; - for (i = 0; i < length; i += 1) { - if (typeof rep[i] === 'string') { - k = rep[i]; - v = str(k, value); - if (v) { - partial.push(quote(k) + (gap ? ': ' : ':') + v); - } - } - } - } else { - -// Otherwise, iterate through all of the keys in the object. - - Object.keys(value).forEach(function(k) { - var v = str(k, value); - if (v) { - partial.push(quote(k) + (gap ? ': ' : ':') + v); - } - }); - } - -// Join all of the member texts together, separated with commas, -// and wrap them in braces. - - v = partial.length === 0 - ? '{}' - : gap - ? '{\n' + gap + partial.join(',\n' + gap) + '\n' + mind + '}' - : '{' + partial.join(',') + '}'; - gap = mind; - return v; - } - } - -// If the JSON object does not yet have a stringify method, give it one. - - if (typeof JSON.stringify !== 'function') { - JSON.stringify = function (value, replacer, space) { - -// The stringify method takes a value and an optional replacer, and an optional -// space parameter, and returns a JSON text. The replacer can be a function -// that can replace values, or an array of strings that will select the keys. -// A default replacer method can be provided. Use of the space parameter can -// produce text that is more easily readable. - - var i; - gap = ''; - indent = ''; - -// If the space parameter is a number, make an indent string containing that -// many spaces. - - if (typeof space === 'number') { - for (i = 0; i < space; i += 1) { - indent += ' '; - } - -// If the space parameter is a string, it will be used as the indent string. - - } else if (typeof space === 'string') { - indent = space; - } - -// If there is a replacer, it must be a function or an array. -// Otherwise, throw an error. - - rep = replacer; - if (replacer && typeof replacer !== 'function' && - (typeof replacer !== 'object' || - typeof replacer.length !== 'number')) { - throw new Error('JSON.stringify'); - } - -// Make a fake root object containing our value under the key of ''. -// Return the result of stringifying the value. - - return str('', {'': value}); - }; - } -}()); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/json-bigint/package.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/json-bigint/package.json deleted file mode 100644 index 9309f6b2..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/json-bigint/package.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "name": "json-bigint", - "version": "1.0.0", - "description": "JSON.parse with bigints support", - "main": "index.js", - "files": [ - "index.js", - "lib/parse.js", - "lib/stringify.js" - ], - "scripts": { - "test": "./node_modules/mocha/bin/mocha -R spec --check-leaks test/*-test.js" - }, - "repository": { - "type": "git", - "url": "git@github.com:sidorares/json-bigint.git" - }, - "keywords": [ - "JSON", - "bigint", - "bignumber", - "parse", - "json" - ], - "author": "Andrey Sidorov ", - "license": "MIT", - "dependencies": { - "bignumber.js": "^9.0.0" - }, - "devDependencies": { - "chai": "4.2.0", - "mocha": "8.0.1" - } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/jsonwebtoken/CHANGELOG.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/jsonwebtoken/CHANGELOG.md deleted file mode 100644 index 54364a2f..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/jsonwebtoken/CHANGELOG.md +++ /dev/null @@ -1,476 +0,0 @@ -# Change Log - - -All notable changes to this project will be documented in this file starting from version **v4.0.0**. -This project adheres to [Semantic Versioning](http://semver.org/). - -## 8.5.1 - 2019-03-18 - -### Bug fix - - - fix: ensure correct PS signing and verification (#585) ([e5874ae428ffc0465e6bd4e660f89f78b56a74a6](https://github.com/auth0/node-jsonwebtoken/commit/e5874ae428ffc0465e6bd4e660f89f78b56a74a6)), closes [#585](https://github.com/auth0/node-jsonwebtoken/issues/585) - -### Docs - - - README: fix markdown for algorithms table ([84e03ef70f9c44a3aef95a1dc122c8238854f683](https://github.com/auth0/node-jsonwebtoken/commit/84e03ef70f9c44a3aef95a1dc122c8238854f683)) - -## 8.5.0 - 2019-02-20 - -### New Functionality - - - feat: add PS JWA support for applicable node versions (#573) ([eefb9d9c6eec54718fa6e41306bda84788df7bec](https://github.com/auth0/node-jsonwebtoken/commit/eefb9d9c6eec54718fa6e41306bda84788df7bec)), closes [#573](https://github.com/auth0/node-jsonwebtoken/issues/573) - - Add complete option in jwt.verify (#522) ([8737789dd330cf9e7870f4df97fd52479adbac22](https://github.com/auth0/node-jsonwebtoken/commit/8737789dd330cf9e7870f4df97fd52479adbac22)), closes [#522](https://github.com/auth0/node-jsonwebtoken/issues/522) - - ### Test Improvements - - - Add tests for private claims in the payload (#555) ([5147852896755dc1291825e2e40556f964411fb2](https://github.com/auth0/node-jsonwebtoken/commit/5147852896755dc1291825e2e40556f964411fb2)), closes [#555](https://github.com/auth0/node-jsonwebtoken/issues/555) - - Force use_strict during testing (#577) ([7b60c127ceade36c33ff33be066e435802001c94](https://github.com/auth0/node-jsonwebtoken/commit/7b60c127ceade36c33ff33be066e435802001c94)), closes [#577](https://github.com/auth0/node-jsonwebtoken/issues/577) - - Refactor tests related to jti and jwtid (#544) ([7eebbc75ab89e01af5dacf2aae90fe05a13a1454](https://github.com/auth0/node-jsonwebtoken/commit/7eebbc75ab89e01af5dacf2aae90fe05a13a1454)), closes [#544](https://github.com/auth0/node-jsonwebtoken/issues/544) - - ci: remove nsp from tests (#569) ([da8f55c3c7b4dd0bfc07a2df228500fdd050242a](https://github.com/auth0/node-jsonwebtoken/commit/da8f55c3c7b4dd0bfc07a2df228500fdd050242a)), closes [#569](https://github.com/auth0/node-jsonwebtoken/issues/569) - -### Docs - -- Fix 'cert' token which isn't a cert (#554) ([0c24fe68cd2866cea6322016bf993cd897fefc98](https://github.com/auth0/node-jsonwebtoken/commit/0c24fe68cd2866cea6322016bf993cd897fefc98)), closes [#554](https://github.com/auth0/node-jsonwebtoken/issues/554) - - -## 8.4.0 - 2018-11-14 - -### New Functionality - - - Add verify option for nonce validation (#540) ([e7938f06fdf2ed3aa88745b72b8ae4ee66c2d0d0](https://github.com/auth0/node-jsonwebtoken/commit/e7938f06fdf2ed3aa88745b72b8ae4ee66c2d0d0)), closes [#540](https://github.com/auth0/node-jsonwebtoken/issues/540) - -### Bug Fixes - - - Updating Node version in Engines spec in package.json (#528) ([cfd1079305170a897dee6a5f55039783e6ee2711](https://github.com/auth0/node-jsonwebtoken/commit/cfd1079305170a897dee6a5f55039783e6ee2711)), closes [#528](https://github.com/auth0/node-jsonwebtoken/issues/528) [#509](https://github.com/auth0/node-jsonwebtoken/issues/509) - - Fixed error message when empty string passed as expiresIn or notBefore option (#531) ([7f9604ac98d4d0ff8d873c3d2b2ea64bd285cb76](https://github.com/auth0/node-jsonwebtoken/commit/7f9604ac98d4d0ff8d873c3d2b2ea64bd285cb76)), closes [#531](https://github.com/auth0/node-jsonwebtoken/issues/531) - -### Docs - - - Update README.md (#527) ([b76f2a80f5229ee5cde321dd2ff14aa5df16d283](https://github.com/auth0/node-jsonwebtoken/commit/b76f2a80f5229ee5cde321dd2ff14aa5df16d283)), closes [#527](https://github.com/auth0/node-jsonwebtoken/issues/527) - - Update README.md (#538) ([1956c4006472fd285b8a85074257cbdbe9131cbf](https://github.com/auth0/node-jsonwebtoken/commit/1956c4006472fd285b8a85074257cbdbe9131cbf)), closes [#538](https://github.com/auth0/node-jsonwebtoken/issues/538) - - Edited the README.md to make certain parts of the document for the api easier to read, emphasizing the examples. (#548) ([dc89a641293d42f72ecfc623ce2eabc33954cb9d](https://github.com/auth0/node-jsonwebtoken/commit/dc89a641293d42f72ecfc623ce2eabc33954cb9d)), closes [#548](https://github.com/auth0/node-jsonwebtoken/issues/548) - - Document NotBeforeError (#529) ([29cd654b956529e939ae8f8c30b9da7063aad501](https://github.com/auth0/node-jsonwebtoken/commit/29cd654b956529e939ae8f8c30b9da7063aad501)), closes [#529](https://github.com/auth0/node-jsonwebtoken/issues/529) - -### Test Improvements - - - Use lolex for faking date in tests (#491) ([677ead6d64482f2067b11437dda07309abe73cfa](https://github.com/auth0/node-jsonwebtoken/commit/677ead6d64482f2067b11437dda07309abe73cfa)), closes [#491](https://github.com/auth0/node-jsonwebtoken/issues/491) - - Update dependencies used for running tests (#518) ([5498bdc4865ffb2ba2fd44d889fad7e83873bb33](https://github.com/auth0/node-jsonwebtoken/commit/5498bdc4865ffb2ba2fd44d889fad7e83873bb33)), closes [#518](https://github.com/auth0/node-jsonwebtoken/issues/518) - - Minor test refactoring for recently added tests (#504) ([e2860a9d2a412627d79741a95bc7159971b923b9](https://github.com/auth0/node-jsonwebtoken/commit/e2860a9d2a412627d79741a95bc7159971b923b9)), closes [#504](https://github.com/auth0/node-jsonwebtoken/issues/504) - - Create and implement async/sync test helpers (#523) ([683d8a9b31ad6327948f84268bd2c8e4350779d1](https://github.com/auth0/node-jsonwebtoken/commit/683d8a9b31ad6327948f84268bd2c8e4350779d1)), closes [#523](https://github.com/auth0/node-jsonwebtoken/issues/523) - - Refactor tests related to audience and aud (#503) ([53d405e0223cce7c83cb51ecf290ca6bec1e9679](https://github.com/auth0/node-jsonwebtoken/commit/53d405e0223cce7c83cb51ecf290ca6bec1e9679)), closes [#503](https://github.com/auth0/node-jsonwebtoken/issues/503) - - Refactor tests related to expiresIn and exp (#501) ([72f0d9e5b11a99082250665d1200c58182903fa6](https://github.com/auth0/node-jsonwebtoken/commit/72f0d9e5b11a99082250665d1200c58182903fa6)), closes [#501](https://github.com/auth0/node-jsonwebtoken/issues/501) - - Refactor tests related to iat and maxAge (#507) ([877bd57ab2aca9b7d230805b21f921baed3da169](https://github.com/auth0/node-jsonwebtoken/commit/877bd57ab2aca9b7d230805b21f921baed3da169)), closes [#507](https://github.com/auth0/node-jsonwebtoken/issues/507) - - Refactor tests related to iss and issuer (#543) ([0906a3fa80f52f959ac1b6343d3024ce5c7e9dea](https://github.com/auth0/node-jsonwebtoken/commit/0906a3fa80f52f959ac1b6343d3024ce5c7e9dea)), closes [#543](https://github.com/auth0/node-jsonwebtoken/issues/543) - - Refactor tests related to kid and keyid (#545) ([88645427a0adb420bd3e149199a2a6bf1e17277e](https://github.com/auth0/node-jsonwebtoken/commit/88645427a0adb420bd3e149199a2a6bf1e17277e)), closes [#545](https://github.com/auth0/node-jsonwebtoken/issues/545) - - Refactor tests related to notBefore and nbf (#497) ([39adf87a6faef3df984140f88e6724ddd709fd89](https://github.com/auth0/node-jsonwebtoken/commit/39adf87a6faef3df984140f88e6724ddd709fd89)), closes [#497](https://github.com/auth0/node-jsonwebtoken/issues/497) - - Refactor tests related to subject and sub (#505) ([5a7fa23c0b4ac6c25304dab8767ef840b43a0eca](https://github.com/auth0/node-jsonwebtoken/commit/5a7fa23c0b4ac6c25304dab8767ef840b43a0eca)), closes [#505](https://github.com/auth0/node-jsonwebtoken/issues/505) - - Implement async/sync tests for exp claim (#536) ([9ae3f207ac64b7450ea0a3434418f5ca58d8125e](https://github.com/auth0/node-jsonwebtoken/commit/9ae3f207ac64b7450ea0a3434418f5ca58d8125e)), closes [#536](https://github.com/auth0/node-jsonwebtoken/issues/536) - - Implement async/sync tests for nbf claim (#537) ([88bc965061ed65299a395f42a100fb8f8c3c683e](https://github.com/auth0/node-jsonwebtoken/commit/88bc965061ed65299a395f42a100fb8f8c3c683e)), closes [#537](https://github.com/auth0/node-jsonwebtoken/issues/537) - - Implement async/sync tests for sub claim (#534) ([342b07bb105a35739eb91265ba5b9dd33c300fc6](https://github.com/auth0/node-jsonwebtoken/commit/342b07bb105a35739eb91265ba5b9dd33c300fc6)), closes [#534](https://github.com/auth0/node-jsonwebtoken/issues/534) - - Implement async/sync tests for the aud claim (#535) ([1c8ff5a68e6da73af2809c9d87faaf78602c99bb](https://github.com/auth0/node-jsonwebtoken/commit/1c8ff5a68e6da73af2809c9d87faaf78602c99bb)), closes [#535](https://github.com/auth0/node-jsonwebtoken/issues/535) - -### CI - - - Added Istanbul to check test-coverage (#468) ([9676a8306428a045e34c3987bd0680fb952b44e3](https://github.com/auth0/node-jsonwebtoken/commit/9676a8306428a045e34c3987bd0680fb952b44e3)), closes [#468](https://github.com/auth0/node-jsonwebtoken/issues/468) - - Complete ESLint conversion and cleanup (#490) ([cb1d2e1e40547f7ecf29fa6635041df6cbba7f40](https://github.com/auth0/node-jsonwebtoken/commit/cb1d2e1e40547f7ecf29fa6635041df6cbba7f40)), closes [#490](https://github.com/auth0/node-jsonwebtoken/issues/490) - - Make code-coverage mandatory when running tests (#495) ([fb0084a78535bfea8d0087c0870e7e3614a2cbe5](https://github.com/auth0/node-jsonwebtoken/commit/fb0084a78535bfea8d0087c0870e7e3614a2cbe5)), closes [#495](https://github.com/auth0/node-jsonwebtoken/issues/495) - - -## 8.3.0 - 2018-06-11 - - - docs: add some clarifications (#473) ([cd33cc81f06068b9df6c224d300dc6f70d8904ab](https://github.com/auth0/node-jsonwebtoken/commit/cd33cc81f06068b9df6c224d300dc6f70d8904ab)), closes [#473](https://github.com/auth0/node-jsonwebtoken/issues/473) - - ci: fix ci execution, remove not needed script (#472) ([c8ff7b2c3ffcd954a64a0273c20a7d1b22339aa5](https://github.com/auth0/node-jsonwebtoken/commit/c8ff7b2c3ffcd954a64a0273c20a7d1b22339aa5)), closes [#472](https://github.com/auth0/node-jsonwebtoken/issues/472) - - new feature: Secret callback revisited (#480) ([d01cc7bcbdeb606d997a580f967b3169fcc622ba](https://github.com/auth0/node-jsonwebtoken/commit/d01cc7bcbdeb606d997a580f967b3169fcc622ba)), closes [#480](https://github.com/auth0/node-jsonwebtoken/issues/480) - - docs:Update README.md (#461) ([f0e0954505f274da95a8d9603598e455b4d2c894](https://github.com/auth0/node-jsonwebtoken/commit/f0e0954505f274da95a8d9603598e455b4d2c894)), closes [#461](https://github.com/auth0/node-jsonwebtoken/issues/461) - - -## 8.2.2 - 2018-05-30 - - - security: deps: jws@3.1.5 (#477) ([ebde9b7cc75cb7ab5176de7ebc4a1d6a8f05bd51](https://github.com/auth0/node-jsonwebtoken/commit/ebde9b7cc75cb7ab5176de7ebc4a1d6a8f05bd51)), closes [#465](https://github.com/auth0/node-jsonwebtoken/issues/465) - - docs: add some clarifications (#473) ([cd33cc81f06068b9df6c224d300dc6f70d8904ab](https://github.com/auth0/node-jsonwebtoken/commit/cd33cc81f06068b9df6c224d300dc6f70d8904ab)), closes [#473](https://github.com/auth0/node-jsonwebtoken/issues/473) - - ci: fix ci execution, remove not needed script (#472) ([c8ff7b2c3ffcd954a64a0273c20a7d1b22339aa5](https://github.com/auth0/node-jsonwebtoken/commit/c8ff7b2c3ffcd954a64a0273c20a7d1b22339aa5)), closes [#472](https://github.com/auth0/node-jsonwebtoken/issues/472) - - docs: Update README.md (#461) ([f0e0954505f274da95a8d9603598e455b4d2c894](https://github.com/auth0/node-jsonwebtoken/commit/f0e0954505f274da95a8d9603598e455b4d2c894)), closes [#461](https://github.com/auth0/node-jsonwebtoken/issues/461) - - -## 8.2.1 - 2018-04-05 - - - bug fix: Check payload is not null when decoded. (#444) ([1232ae9352ce5fd1ca6c593291ce6ad0834a1ff5](https://github.com/auth0/node-jsonwebtoken/commit/1232ae9352ce5fd1ca6c593291ce6ad0834a1ff5)) - - docs: Clarify that buffer/string payloads must be JSON (#442) ([e8ac1be7565a3fd986d40cb5e31a9f6c4d9aed1b](https://github.com/auth0/node-jsonwebtoken/commit/e8ac1be7565a3fd986d40cb5e31a9f6c4d9aed1b)) - - -## 8.2.0 - 2018-03-02 - - - Add a new mutatePayload option (#446) ([d6d7c5e5103f05a92d3633ac190d3025a0455be0](https://github.com/auth0/node-jsonwebtoken/commit/d6d7c5e5103f05a92d3633ac190d3025a0455be0)) - - -## 8.1.1 - 2018-01-22 - - - ci: add newer node versions to build matrix (#428) ([83f3eee44e122da06f812d7da4ace1fa26c24d9d](https://github.com/auth0/node-jsonwebtoken/commit/83f3eee44e122da06f812d7da4ace1fa26c24d9d)) - - deps: Bump ms version to add support for negative numbers (#438) ([25e0e624545eaef76f3c324a134bf103bc394724](https://github.com/auth0/node-jsonwebtoken/commit/25e0e624545eaef76f3c324a134bf103bc394724)) - - docs: Minor typo (#424) ([dddcb73ac05de11b81feeb629f6cf78dd03d2047](https://github.com/auth0/node-jsonwebtoken/commit/dddcb73ac05de11b81feeb629f6cf78dd03d2047)) - - bug fix: Not Before (nbf) calculated based on iat/timestamp (#437) ([2764a64908d97c043d62eba0bf6c600674f9a6d6](https://github.com/auth0/node-jsonwebtoken/commit/2764a64908d97c043d62eba0bf6c600674f9a6d6)), closes [#435](https://github.com/auth0/node-jsonwebtoken/issues/435) - - -## 8.1.0 - 2017-10-09 - - - #402: Don't fail if captureStackTrace is not a function (#410) ([77ee965d9081faaf21650f266399f203f69533c5](https://github.com/auth0/node-jsonwebtoken/commit/77ee965d9081faaf21650f266399f203f69533c5)) - - #403: Clarify error wording for "Expected object" error. (#409) ([bb27eb346f0ff675a320b2de16b391a7cfeadc58](https://github.com/auth0/node-jsonwebtoken/commit/bb27eb346f0ff675a320b2de16b391a7cfeadc58)) - - Enhance audience check to verify against regular expressions (#398) ([81501a17da230af7b74a3f7535ab5cd3a19c8315](https://github.com/auth0/node-jsonwebtoken/commit/81501a17da230af7b74a3f7535ab5cd3a19c8315)) - - -## 8.0.1 - 2017-09-12 - - - Remove `lodash.isarray` dependency (#394) ([7508e8957cb1c778f72fa9a363a7b135b3c9c36d](https://github.com/auth0/node-jsonwebtoken/commit/7508e8957cb1c778f72fa9a363a7b135b3c9c36d)) - -## 8.0.0 - 2017-09-06 - - **Breaking changes: See [Migration notes from v7](https://github.com/auth0/node-jsonwebtoken/wiki/Migration-Notes:-v7-to-v8)** - - - docs: readme, migration notes ([12cd8f7f47224f904f6b8f39d1dee73775de4f6f](https://github.com/auth0/node-jsonwebtoken/commit/12cd8f7f47224f904f6b8f39d1dee73775de4f6f)) - - verify: remove process.nextTick (#302) ([3305cf04e3f674b9fb7e27c9b14ddd159650ff82](https://github.com/auth0/node-jsonwebtoken/commit/3305cf04e3f674b9fb7e27c9b14ddd159650ff82)) - - Reduce size of NPM package (#347) ([0be5409ac6592eeaae373dce91ec992fa101bd8a](https://github.com/auth0/node-jsonwebtoken/commit/0be5409ac6592eeaae373dce91ec992fa101bd8a)) - - Remove joi to shrink module size (#348) ([2e7e68dbd59e845cdd940afae0a296f48438445f](https://github.com/auth0/node-jsonwebtoken/commit/2e7e68dbd59e845cdd940afae0a296f48438445f)) - - maxAge: Add validation to timespan result ([66a4f8b996c8357727ce62a84605a005b2f5eb18](https://github.com/auth0/node-jsonwebtoken/commit/66a4f8b996c8357727ce62a84605a005b2f5eb18)) - -## 7.4.3 - 2017-08-17 - - - Fix breaking change on 7.4.2 for empty secret + "none" algorithm (sync code style) ([PR 386](https://github.com/auth0/node-jsonwebtoken/pull/386)) - -## 7.4.2 - 2017-08-04 - - - bugfix: sign: add check to be sure secret has a value ([c584d1cbc34b788977b36f17cd57ab2212f1230e](https://github.com/auth0/node-jsonwebtoken/commit/c584d1cbc34b788977b36f17cd57ab2212f1230e)) - - docs: about refreshing tokens ([016fc10b847bfbb76b82171cb530f32d7da2001b](https://github.com/auth0/node-jsonwebtoken/commit/016fc10b847bfbb76b82171cb530f32d7da2001b)) - - docs: verifying with base64 encoded secrets ([c25e9906801f89605080cc71b3ee23a5e45a5811](https://github.com/auth0/node-jsonwebtoken/commit/c25e9906801f89605080cc71b3ee23a5e45a5811)) - - tests: Add tests for ES256 ([89900ea00735f76b04f437c9f542285b420fa9cb](https://github.com/auth0/node-jsonwebtoken/commit/89900ea00735f76b04f437c9f542285b420fa9cb)) - - docs: document keyid as option (#361) ([00086c2c006d7fc1a47bae02fa87d194d79aa558](https://github.com/auth0/node-jsonwebtoken/commit/00086c2c006d7fc1a47bae02fa87d194d79aa558)) - - docs: readme: Using private key with passpharase (#353) ([27a7f1d4f35b662426ff0270526d48658da4c8b7](https://github.com/auth0/node-jsonwebtoken/commit/27a7f1d4f35b662426ff0270526d48658da4c8b7)) - -## 7.4.1 - 2017-05-17 - - - bump ms to v2 due a ReDoS vulnerability (#352) ([adcfd6ae4088c838769d169f8cd9154265aa13e0](https://github.com/auth0/node-jsonwebtoken/commit/adcfd6ae4088c838769d169f8cd9154265aa13e0)) - -## 7.4.0 - 2017-04-24 - - - Add docs about numeric date fields ([659f73119900a4d837650d9b3f5af4e64a2f843b](https://github.com/auth0/node-jsonwebtoken/commit/659f73119900a4d837650d9b3f5af4e64a2f843b)) - - Make Options object optional for callback-ish sign ([e202c4fd00c35a24e9ab606eab89186ade13d0cc](https://github.com/auth0/node-jsonwebtoken/commit/e202c4fd00c35a24e9ab606eab89186ade13d0cc)) - -## 7.3.0 - 2017-02-13 - - - Add more information to `maxAge` option in README ([1b0592e99cc8def293eed177e2575fa7f1cf7aa5](https://github.com/auth0/node-jsonwebtoken/commit/1b0592e99cc8def293eed177e2575fa7f1cf7aa5)) - - Add `clockTimestamp` option to `verify()` you can set the current time in seconds with it (#274) ([8fdc1504f4325e7003894ffea078da9cba5208d9](https://github.com/auth0/node-jsonwebtoken/commit/8fdc1504f4325e7003894ffea078da9cba5208d9)) - - Fix handling non string tokens on `verify()` input (#305) ([1b6ec8d466504f58c5a6e2dae3360c828bad92fb](https://github.com/auth0/node-jsonwebtoken/commit/1b6ec8d466504f58c5a6e2dae3360c828bad92fb)), closes [#305](https://github.com/auth0/node-jsonwebtoken/issues/305) - - Fixed a simple typo in docs (#287) ([a54240384e24e18c00e75884295306db311d0cb7](https://github.com/auth0/node-jsonwebtoken/commit/a54240384e24e18c00e75884295306db311d0cb7)), closes [#287](https://github.com/auth0/node-jsonwebtoken/issues/287) - - Raise jws.decode error to avoid confusion with "invalid token" error (#294) ([7f68fe06c88d5c5653785bd66bc68c5b20e1bd8e](https://github.com/auth0/node-jsonwebtoken/commit/7f68fe06c88d5c5653785bd66bc68c5b20e1bd8e)) - - rauchg/ms.js changed to zeit/ms (#303) ([35d84152a6b716d757cb5b1dd3c79fe3a1bc0628](https://github.com/auth0/node-jsonwebtoken/commit/35d84152a6b716d757cb5b1dd3c79fe3a1bc0628)) - -## 7.2.1 - 2016-12-07 - - - add nsp check to find vulnerabilities on npm test ([4219c34b5346811c07f520f10516cc495bcc70dd](https://github.com/auth0/node-jsonwebtoken/commit/4219c34b5346811c07f520f10516cc495bcc70dd)) - - revert to joi@^6 to keep ES5 compatibility ([51d4796c07344bf817687f7ccfeef78f00bf5b4f](https://github.com/auth0/node-jsonwebtoken/commit/51d4796c07344bf817687f7ccfeef78f00bf5b4f)) - -## 7.2.0 - 2016-12-06 - - - improve the documentation for expiration ([771e0b5f9bed90771fb79140eb38e51a3ecac8f0](https://github.com/auth0/node-jsonwebtoken/commit/771e0b5f9bed90771fb79140eb38e51a3ecac8f0)) - - Restructured a sentence ([ccc7610187a862f7a50177eadc9152eef26cd065](https://github.com/auth0/node-jsonwebtoken/commit/ccc7610187a862f7a50177eadc9152eef26cd065)) - - Allow `keyid` on `sign`. ([b412be91b89acb3a742bb609d3b54e47e1dfc441](https://github.com/auth0/node-jsonwebtoken/commit/b412be91b89acb3a742bb609d3b54e47e1dfc441)) - - upgrade joi ([715e3d928023d414d45c6dc3f096a7c8448139ae](https://github.com/auth0/node-jsonwebtoken/commit/715e3d928023d414d45c6dc3f096a7c8448139ae)) - - upgrade to latest nodes and Travis infrastructure ([3febcc1dd23ecdec1abbf89313959941d15eb47a](https://github.com/auth0/node-jsonwebtoken/commit/3febcc1dd23ecdec1abbf89313959941d15eb47a)) - - -## 7.1.10 - 2016-12-06 - - - Bump node-jws version number ([07813dd7194630c9f452684279178af76464a759](https://github.com/auth0/node-jsonwebtoken/commit/07813dd7194630c9f452684279178af76464a759)) - - improve the documentation for expiration ([771e0b5f9bed90771fb79140eb38e51a3ecac8f0](https://github.com/auth0/node-jsonwebtoken/commit/771e0b5f9bed90771fb79140eb38e51a3ecac8f0)) - -## 7.1.9 - 2016-08-11 - - - Revert "Merge branch 'venatir-master'" ([d06359ef3b4e619680e043ee7c16adda16598f52](https://github.com/auth0/node-jsonwebtoken/commit/d06359ef3b4e619680e043ee7c16adda16598f52)) - - - -## 7.1.8 - 2016-08-10 - - - Fixed tests, however typ: 'JWT' should not be in the options at all, so please review other tests ([01903bcdc61b4ed429acbbd1fe0ffe0db364473b](https://github.com/auth0/node-jsonwebtoken/commit/01903bcdc61b4ed429acbbd1fe0ffe0db364473b)) - - Removing unnecessary extra decoding. jwtString is already verified as valid and signature checked ([55d5834f7b637011e1d8b927ff78a92a5fd521cf](https://github.com/auth0/node-jsonwebtoken/commit/55d5834f7b637011e1d8b927ff78a92a5fd521cf)) - - update changelog ([5117aacd0118a10331889a64e61d8186112d8a23](https://github.com/auth0/node-jsonwebtoken/commit/5117aacd0118a10331889a64e61d8186112d8a23)) - - -## 7.1.7 - 2016-07-29 - - - Use lodash.once instead of unlicensed/unmaintained cb ([3ac95ad93ef3068a64e03d8d14deff231b1ed529](https://github.com/auth0/node-jsonwebtoken/commit/3ac95ad93ef3068a64e03d8d14deff231b1ed529)) - -## 7.1.6 - 2016-07-15 - - - fix issue with buffer payload. closes #216 ([6b50ff324b4dfd2cb0e49b666f14a6672d015b22](https://github.com/auth0/node-jsonwebtoken/commit/6b50ff324b4dfd2cb0e49b666f14a6672d015b22)), closes [#216](https://github.com/auth0/node-jsonwebtoken/issues/216) - - -## 7.1.5 - 2016-07-15 - - - update jws in package.json ([b6260951eefc68aae5f4ede359210761f901ff7a](https://github.com/auth0/node-jsonwebtoken/commit/b6260951eefc68aae5f4ede359210761f901ff7a)) - - -## 7.1.4 - 2016-07-14 - - - add redundant test ([bece8816096f324511c3efcb8db0e64b75d757a1](https://github.com/auth0/node-jsonwebtoken/commit/bece8816096f324511c3efcb8db0e64b75d757a1)) - - fix an issue of double callback on error ([758ca5eeca2f1b06c32c9fce70642bf488b2e52b](https://github.com/auth0/node-jsonwebtoken/commit/758ca5eeca2f1b06c32c9fce70642bf488b2e52b)) - -## 7.1.2 - 2016-07-12 - - - do not stringify the payload when signing async - closes #224 ([084f537d3dfbcef2bea411cc0a1515899cc8aa21](https://github.com/auth0/node-jsonwebtoken/commit/084f537d3dfbcef2bea411cc0a1515899cc8aa21)), closes [#224](https://github.com/auth0/node-jsonwebtoken/issues/224) - -## 7.1.1 - 2016-07-12 - - - do not mutate options in jwt.verify, closes #227 ([63263a28a268624dab0927b9ad86fffa44a10f84](https://github.com/auth0/node-jsonwebtoken/commit/63263a28a268624dab0927b9ad86fffa44a10f84)), closes [#227](https://github.com/auth0/node-jsonwebtoken/issues/227) - - refactor into multiple files ([e11d505207fa33501298300c9accbfb809d8748d](https://github.com/auth0/node-jsonwebtoken/commit/e11d505207fa33501298300c9accbfb809d8748d)) - -## 7.1.0 - 2016-07-12 - - - Exp calculated based on iat. fix #217 ([757a16e0e35ad19f9e456820f55d5d9f3fc76aee](https://github.com/auth0/node-jsonwebtoken/commit/757a16e0e35ad19f9e456820f55d5d9f3fc76aee)), closes [#217](https://github.com/auth0/node-jsonwebtoken/issues/217) - -## 7.0.0 - 2016-05-19 - - - change jwt.sign to return errors on callback instead of throwing errors ([1e46c5a42aa3dab8478efa4081d8f8f5c5485d56](https://github.com/auth0/node-jsonwebtoken/commit/1e46c5a42aa3dab8478efa4081d8f8f5c5485d56)) - -## 6.2.0 - 2016-04-29 - - - add support for `options.clockTolerance` to `jwt.verify` ([65ddea934f226bf06bc9d6a55be9587515cfc38d](https://github.com/auth0/node-jsonwebtoken/commit/65ddea934f226bf06bc9d6a55be9587515cfc38d)) - -## 6.1.2 - 2016-04-29 - - - fix sign method for node.js 0.12. closes #193 ([9c38374142d3929be3c9314b5e9bc5d963c5955f](https://github.com/auth0/node-jsonwebtoken/commit/9c38374142d3929be3c9314b5e9bc5d963c5955f)), closes [#193](https://github.com/auth0/node-jsonwebtoken/issues/193) - - improve async test ([7b0981380ddc40a5f1208df520631785b5ffb85a](https://github.com/auth0/node-jsonwebtoken/commit/7b0981380ddc40a5f1208df520631785b5ffb85a)) - -## 6.1.0 - 2016-04-27 - - - verify unsigned tokens ([ec880791c10ed5ef7c8df7bf28ebb95c810479ed](https://github.com/auth0/node-jsonwebtoken/commit/ec880791c10ed5ef7c8df7bf28ebb95c810479ed)) - -## 6.0.1 - 2016-04-27 - -This was an immediate change after publishing 6.0.0. - - - throw error on invalid options when the payload is not an object ([304f1b33075f79ed66f784e27dc4f5307aa39e27](https://github.com/auth0/node-jsonwebtoken/commit/304f1b33075f79ed66f784e27dc4f5307aa39e27)) - -## 6.0.0 - 2016-04-27 - - - Change .sign to standard async callback ([50873c7d45d2733244d5da8afef3d1872e657a60](https://github.com/auth0/node-jsonwebtoken/commit/50873c7d45d2733244d5da8afef3d1872e657a60)) - - Improved the options for the `sign` method ([53c3987b3cc34e95eb396b26fc9b051276e2f6f9](https://github.com/auth0/node-jsonwebtoken/commit/53c3987b3cc34e95eb396b26fc9b051276e2f6f9)) - - - throw error on invalid options like `expiresIn` when the payload is not an object ([304f1b33075f79ed66f784e27dc4f5307aa39e27](https://github.com/auth0/node-jsonwebtoken/commit/304f1b33075f79ed66f784e27dc4f5307aa39e27)) - - `expiresInMinutes` and `expiresInSeconds` are deprecated and no longer supported. - - `notBeforeInMinutes` and `notBeforeInSeconds` are deprecated and no longer supported. - - `options` are strongly validated. - - `options.expiresIn`, `options.notBefore`, `options.audience`, `options.issuer`, `options.subject` and `options.jwtid` are mutually exclusive with `payload.exp`, `payload.nbf`, `payload.aud`, `payload.iss` - - `options.algorithm` is properly validated. - - `options.headers` is renamed to `options.header`. - - - update CHANGELOG to reflect most of the changes. closes #136 ([b87a1a8d2e2533fbfab518765a54f00077918eb7](https://github.com/auth0/node-jsonwebtoken/commit/b87a1a8d2e2533fbfab518765a54f00077918eb7)), closes [#136](https://github.com/auth0/node-jsonwebtoken/issues/136) - - update readme ([53a88ecf4494e30e1d62a1cf3cc354650349f486](https://github.com/auth0/node-jsonwebtoken/commit/53a88ecf4494e30e1d62a1cf3cc354650349f486)) - -## 5.7.0 - 2016-02-16 - - - - add support for validating multiples issuers. closes #163 ([39d9309ae05648dbd72e5fd1993df064ad0e8fa5](https://github.com/auth0/node-jsonwebtoken/commit/39d9309ae05648dbd72e5fd1993df064ad0e8fa5)), closes [#163](https://github.com/auth0/node-jsonwebtoken/issues/163) - - -## 5.6.1 - 2016-02-16 - - - - 5.6.1 ([06d8209d499dbc9a8dd978ab6cbb9c6818fde203](https://github.com/auth0/node-jsonwebtoken/commit/06d8209d499dbc9a8dd978ab6cbb9c6818fde203)) - - fix wrong error when setting expiration on non-object payload. closes #153 ([7f7d76edfd918d6afc7c7cead888caa42ccaceb4](https://github.com/auth0/node-jsonwebtoken/commit/7f7d76edfd918d6afc7c7cead888caa42ccaceb4)), closes [#153](https://github.com/auth0/node-jsonwebtoken/issues/153) - - - -## 5.6.0 - 2016-02-16 - - - - added missing validations of sub and jti ([a1affe960d0fc52e9042bcbdedb65734f8855580](https://github.com/auth0/node-jsonwebtoken/commit/a1affe960d0fc52e9042bcbdedb65734f8855580)) - - Fix tests in jwt.rs.tests.js which causes 4 to fail ([8aedf2b1f575b0d9575c1fc9f2ac7bc868f75ff1](https://github.com/auth0/node-jsonwebtoken/commit/8aedf2b1f575b0d9575c1fc9f2ac7bc868f75ff1)) - - Update README.md ([349b7cd00229789b138928ca060d3ef015aedaf9](https://github.com/auth0/node-jsonwebtoken/commit/349b7cd00229789b138928ca060d3ef015aedaf9)) - - - -## 5.5.4 - 2016-01-04 - - - - minor ([46552e7c45025c76e3f647680d7539a66bfac612](https://github.com/auth0/node-jsonwebtoken/commit/46552e7c45025c76e3f647680d7539a66bfac612)) - - - -## 5.5.3 - 2016-01-04 - - - - add a console.warn on invalid options for string payloads ([71200f14deba0533d3261266348338fac2d14661](https://github.com/auth0/node-jsonwebtoken/commit/71200f14deba0533d3261266348338fac2d14661)) - - minor ([65b1f580382dc58dd3da6f47a52713776fd7cdf2](https://github.com/auth0/node-jsonwebtoken/commit/65b1f580382dc58dd3da6f47a52713776fd7cdf2)) - - - -## 5.5.2 - 2016-01-04 - - - - fix signing method with sealed objects, do not modify the params object. closes #147 ([be9c09af83b09c9e72da8b2c6166fa51d92aeab6](https://github.com/auth0/node-jsonwebtoken/commit/be9c09af83b09c9e72da8b2c6166fa51d92aeab6)), closes [#147](https://github.com/auth0/node-jsonwebtoken/issues/147) - - - -## 5.5.1 - 2016-01-04 - - - - fix nbf verification. fix #152 ([786d37b299c67771b5e71a2ca476666ab0f97d98](https://github.com/auth0/node-jsonwebtoken/commit/786d37b299c67771b5e71a2ca476666ab0f97d98)), closes [#152](https://github.com/auth0/node-jsonwebtoken/issues/152) - - - -## 5.5.0 - 2015-12-28 - - - - improvements to nbf and jti claims ([46372e928f6d2e7398f9b88022ca617d2a3b0699](https://github.com/auth0/node-jsonwebtoken/commit/46372e928f6d2e7398f9b88022ca617d2a3b0699)) - - Remove duplicate payload line (fix bug in IE strict mode) ([8163d698e0c5ad8c44817a5dcd42a15d7e9c6bc8](https://github.com/auth0/node-jsonwebtoken/commit/8163d698e0c5ad8c44817a5dcd42a15d7e9c6bc8)) - - Remove duplicate require('ms') line ([7c00bcbcbf8f7503a1070b394a165eccd41de66f](https://github.com/auth0/node-jsonwebtoken/commit/7c00bcbcbf8f7503a1070b394a165eccd41de66f)) - - Update README to reflect addition of async sign ([d661d4b6f68eb417834c99b36769444723041ccf](https://github.com/auth0/node-jsonwebtoken/commit/d661d4b6f68eb417834c99b36769444723041ccf)) - - - -## 5.4.0 - 2015-10-02 - - - - deprecate expireInMinutes and expireInSeconds - in favor of expiresIn ([39ecc6f8f310f8462e082f1d53de0b4222b29b6f](https://github.com/auth0/node-jsonwebtoken/commit/39ecc6f8f310f8462e082f1d53de0b4222b29b6f)) - - -## 5.3.0 - 2015-10-02 - - - - 5.3.0 ([5d559ced3fbf10c1adae2e5792deda06ea89bcd3](https://github.com/auth0/node-jsonwebtoken/commit/5d559ced3fbf10c1adae2e5792deda06ea89bcd3)) - - minor ([6e81ff87a3799b0e56db09cbae42a97e784716c4](https://github.com/auth0/node-jsonwebtoken/commit/6e81ff87a3799b0e56db09cbae42a97e784716c4)) - - - -## 5.1.0 - 2015-10-02 - - - - added async signing ([9414fbcb15a1f9cf4fe147d070e9424c547dabba](https://github.com/auth0/node-jsonwebtoken/commit/9414fbcb15a1f9cf4fe147d070e9424c547dabba)) - - Update README.md ([40b2aaaa843442dfb8ee7b574f0a788177e7c904](https://github.com/auth0/node-jsonwebtoken/commit/40b2aaaa843442dfb8ee7b574f0a788177e7c904)) - - - -## 5.0.5 - 2015-08-19 - - - - add ms dep to package.json ([f13b3fb7f29dff787e7c91ebe2eb5adeeb05f251](https://github.com/auth0/node-jsonwebtoken/commit/f13b3fb7f29dff787e7c91ebe2eb5adeeb05f251)) - - add note to explain, related to #96 #101 #6 ([dd8969e0e6ed0bcb9cae905d2b1a96476bd85da3](https://github.com/auth0/node-jsonwebtoken/commit/dd8969e0e6ed0bcb9cae905d2b1a96476bd85da3)) - - add tests for options.headers ([7787dd74e705787c39a871ca29c75a2e0a3948ac](https://github.com/auth0/node-jsonwebtoken/commit/7787dd74e705787c39a871ca29c75a2e0a3948ac)) - - add tests for verify expires ([d7c5793d98c300603440ab460c11665f661ad3a0](https://github.com/auth0/node-jsonwebtoken/commit/d7c5793d98c300603440ab460c11665f661ad3a0)) - - add verify option maxAge (with tests) ([49d54e54f7e70b1c53a2e4ee67e116c907d75319](https://github.com/auth0/node-jsonwebtoken/commit/49d54e54f7e70b1c53a2e4ee67e116c907d75319)) - - fix spelling error in error message ([8078b11b224fa05ac9003ca5aa2c85e9f0128cfb](https://github.com/auth0/node-jsonwebtoken/commit/8078b11b224fa05ac9003ca5aa2c85e9f0128cfb)) - - Fix typo options.header is not a documented option + ([5feaa5b962ccbddeff054817a410f7b0c1e6ce7f](https://github.com/auth0/node-jsonwebtoken/commit/5feaa5b962ccbddeff054817a410f7b0c1e6ce7f)) - - update JWT spec link. closes #112 ([f5fa50f797456a12240589161835c7ea30807195](https://github.com/auth0/node-jsonwebtoken/commit/f5fa50f797456a12240589161835c7ea30807195)), closes [#112](https://github.com/auth0/node-jsonwebtoken/issues/112) - - -## 5.0.3 - 2015-07-15 - - - Added nbf support ([f26ba4e2fa197a20497632b63ffcd13ae93aacc4](https://github.com/auth0/node-jsonwebtoken/commit/f26ba4e2fa197a20497632b63ffcd13ae93aacc4)) - - Added support for subject and jwt id ([ab76ec5bc554e2d1e25376ddb7cea711d86af651](https://github.com/auth0/node-jsonwebtoken/commit/ab76ec5bc554e2d1e25376ddb7cea711d86af651)) - - Fix `this` referring to the global object instead of `module.exports` in `verify()` ([93f554312e37129027fcf4916f48cb8d1b53588c](https://github.com/auth0/node-jsonwebtoken/commit/93f554312e37129027fcf4916f48cb8d1b53588c)) - - Fix typo, line 139 README, complete option for .decode. ([59c110aeb8c7c1847ef2ffd77702d13627c89e10](https://github.com/auth0/node-jsonwebtoken/commit/59c110aeb8c7c1847ef2ffd77702d13627c89e10)) - - minor ([61ff1172272b582902313e958058ff22413494af](https://github.com/auth0/node-jsonwebtoken/commit/61ff1172272b582902313e958058ff22413494af)) - - - -## 5.0.2 - 2015-06-15 - - - - fix typo in docs . closes #86 ([3d3413221f36acef4dfd1cbed87f1f3565cd6f84](https://github.com/auth0/node-jsonwebtoken/commit/3d3413221f36acef4dfd1cbed87f1f3565cd6f84)), closes [#86](https://github.com/auth0/node-jsonwebtoken/issues/86) - - - -## 5.0.1 - 2015-05-15 - - - - Add option to return header and payload when decoding. ([7254e011b59f892d1947e6c11819281adac7069d](https://github.com/auth0/node-jsonwebtoken/commit/7254e011b59f892d1947e6c11819281adac7069d)) - - Avoid uncaught "SyntaxError: Unexpected token ͧ" error. ([0dc59cd6ee15d83a606acffa7909ee76176ae186](https://github.com/auth0/node-jsonwebtoken/commit/0dc59cd6ee15d83a606acffa7909ee76176ae186)) - - Document complete option in README. ([ec32b20241a74d9681ea26e1a7024b4642468c00](https://github.com/auth0/node-jsonwebtoken/commit/ec32b20241a74d9681ea26e1a7024b4642468c00)) - - Fix example in README, silence verbose logging. ([ba3174d10033c41e9c211a38f1cc67f74fbd7f69](https://github.com/auth0/node-jsonwebtoken/commit/ba3174d10033c41e9c211a38f1cc67f74fbd7f69)) - - Fix link to auth0.com in README ([1b3c5ff72c9bc25e9271646e679f3080f2a042a0](https://github.com/auth0/node-jsonwebtoken/commit/1b3c5ff72c9bc25e9271646e679f3080f2a042a0)) - - Immediate return if not decoded. ([851bda2b10168f3269c3da6e74d310742f31a193](https://github.com/auth0/node-jsonwebtoken/commit/851bda2b10168f3269c3da6e74d310742f31a193)) - - Prevent throw on undefined/null secret ([0fdf78d4dbf609455f3277d6169a987aef0384d4](https://github.com/auth0/node-jsonwebtoken/commit/0fdf78d4dbf609455f3277d6169a987aef0384d4)) - - Removed path from test ([d6240e24186732d368bffe21143becf44c38f0d6](https://github.com/auth0/node-jsonwebtoken/commit/d6240e24186732d368bffe21143becf44c38f0d6)) - - Simplified checking for missing key ([f1cffd033bffc44f20558eda4a797c3fa2f4ee05](https://github.com/auth0/node-jsonwebtoken/commit/f1cffd033bffc44f20558eda4a797c3fa2f4ee05)) - - Typo ([ffe68dbe0219bab535c1018448eb4c0b22f1f902](https://github.com/auth0/node-jsonwebtoken/commit/ffe68dbe0219bab535c1018448eb4c0b22f1f902)) - - Update CHANGELOG.md ([927cce0dad1bc9aad75aeef53e276cf4cfc0d776](https://github.com/auth0/node-jsonwebtoken/commit/927cce0dad1bc9aad75aeef53e276cf4cfc0d776)) - - Update CHANGELOG.md ([6879e0fdde222995c70a3a69a4af94993d9c667e](https://github.com/auth0/node-jsonwebtoken/commit/6879e0fdde222995c70a3a69a4af94993d9c667e)) - - Update CHANGELOG.md ([c5596c10e8705727fa13e0394184a606083078bc](https://github.com/auth0/node-jsonwebtoken/commit/c5596c10e8705727fa13e0394184a606083078bc)) - - Update CHANGELOG.md ([07541f0315f26d179e1cde92732b6124d6869b6f](https://github.com/auth0/node-jsonwebtoken/commit/07541f0315f26d179e1cde92732b6124d6869b6f)) - - Update CHANGELOG.md ([e6465d48ddd1dc2c3297229b28c78fd5490a2ba9](https://github.com/auth0/node-jsonwebtoken/commit/e6465d48ddd1dc2c3297229b28c78fd5490a2ba9)) - -## [5.0.0] - 2015-04-11 - -### Changed - - - [sign] Only set defautl `iat` if the user does not specify that argument. - - https://github.com/auth0/node-jsonwebtoken/commit/e900282a8d2dff1d4dec815f7e6aa7782e867d91 - https://github.com/auth0/node-jsonwebtoken/commit/35036b188b4ee6b42df553bbb93bc8a6b19eae9d - https://github.com/auth0/node-jsonwebtoken/commit/954bd7a312934f03036b6bb6f00edd41f29e54d9 - https://github.com/auth0/node-jsonwebtoken/commit/24a370080e0b75f11d4717cd2b11b2949d95fc2e - https://github.com/auth0/node-jsonwebtoken/commit/a77df6d49d4ec688dfd0a1cc723586bffe753516 - -### Security - - - [verify] Update to jws@^3.0.0 and renaming `header.alg` mismatch exception to `invalid algorithm` and adding more mismatch tests. - - As `jws@3.0.0` changed the verify method signature to be `jws.verify(signature, algorithm, secretOrKey)`, the token header must be decoded first in order to make sure that the `alg` field matches one of the allowed `options.algorithms`. After that, the now validated `header.alg` is passed to `jws.verify` - - As the order of steps has changed, the error that was thrown when the JWT was invalid is no longer the `jws` one: - ``` - { [Error: Invalid token: no header in signature 'a.b.c'] code: 'MISSING_HEADER', signature: 'a.b.c' } - ``` - - That old error (removed from jws) has been replaced by a `JsonWebTokenError` with message `invalid token`. - - > Important: versions >= 4.2.2 this library are safe to use but we decided to deprecate everything `< 5.0.0` to prevent security warnings from library `node-jws` when doing `npm install`. - - https://github.com/auth0/node-jsonwebtoken/commit/634b8ed0ff5267dc25da5c808634208af109824e - https://github.com/auth0/node-jsonwebtoken/commit/9f24ffd5791febb449d4d03ff58d7807da9b9b7e - https://github.com/auth0/node-jsonwebtoken/commit/19e6cc6a1f2fd90356f89b074223b9665f2aa8a2 - https://github.com/auth0/node-jsonwebtoken/commit/1e4623420159c6410616f02a44ed240f176287a9 - https://github.com/auth0/node-jsonwebtoken/commit/954bd7a312934f03036b6bb6f00edd41f29e54d9 - https://github.com/auth0/node-jsonwebtoken/commit/24a370080e0b75f11d4717cd2b11b2949d95fc2e - https://github.com/auth0/node-jsonwebtoken/commit/a77df6d49d4ec688dfd0a1cc723586bffe753516 - -## [4.2.2] - 2015-03-26 -### Fixed - - - [asymmetric-keys] Fix verify for RSAPublicKey formated keys (`jfromaniello - awlayton`) - https://github.com/auth0/node-jsonwebtoken/commit/402794663b9521bf602fcc6f2e811e7d3912f9dc - https://github.com/auth0/node-jsonwebtoken/commit/8df6aabbc7e1114c8fb3917931078254eb52c222 - -## [4.2.1] - 2015-03-17 -### Fixed - - - [asymmetric-keys] Fixed issue when public key starts with BEING PUBLIC KEY (https://github.com/auth0/node-jsonwebtoken/issues/70) (`jfromaniello`) - https://github.com/auth0/node-jsonwebtoken/commit/7017e74db9b194448ff488b3e16468ada60c4ee5 - -## [4.2.0] - 2015-03-16 -### Security - - - [asymmetric-keys] Making sure a token signed with an asymmetric key will be verified using a asymmetric key. - When the verification part was expecting a token digitally signed with an asymmetric key (RS/ES family) of algorithms an attacker could send a token signed with a symmetric algorithm (HS* family). - - The issue was caused because the same signature was used to verify both type of tokens (`verify` method parameter: `secretOrPublicKey`). - - This change adds a new parameter to the verify called `algorithms`. This can be used to specify a list of supported algorithms, but the default value depends on the secret used: if the secretOrPublicKey contains the string `BEGIN CERTIFICATE` the default is `[ 'RS256','RS384','RS512','ES256','ES384','ES512' ]` otherwise is `[ 'HS256','HS384','HS512' ]`. (`jfromaniello`) - https://github.com/auth0/node-jsonwebtoken/commit/c2bf7b2cd7e8daf66298c2d168a008690bc4bdd3 - https://github.com/auth0/node-jsonwebtoken/commit/1bb584bc382295eeb7ee8c4452a673a77a68b687 - -## [4.1.0] - 2015-03-10 -### Changed -- Assume the payload is JSON even when there is no `typ` property. [5290db1](https://github.com/auth0/node-jsonwebtoken/commit/5290db1bd74f74cd38c90b19e2355ef223a4d931) - -## [4.0.0] - 2015-03-06 -### Changed -- The default encoding is now utf8 instead of binary. [92d33bd](https://github.com/auth0/node-jsonwebtoken/commit/92d33bd99a3416e9e5a8897d9ad8ff7d70a00bfd) -- Add `encoding` as a new option to `sign`. [1fc385e](https://github.com/auth0/node-jsonwebtoken/commit/1fc385ee10bd0018cd1441552dce6c2e5a16375f) -- Add `ignoreExpiration` to `verify`. [8d4da27](https://github.com/auth0/node-jsonwebtoken/commit/8d4da279e1b351ac71ace276285c9255186d549f) -- Add `expiresInSeconds` to `sign`. [dd156cc](https://github.com/auth0/node-jsonwebtoken/commit/dd156cc30f17028744e60aec0502897e34609329) - -### Fixed -- Fix wrong error message when the audience doesn't match. [44e3c8d](https://github.com/auth0/node-jsonwebtoken/commit/44e3c8d757e6b4e2a57a69a035f26b4abec3e327) -- Fix wrong error message when the issuer doesn't match. [44e3c8d](https://github.com/auth0/node-jsonwebtoken/commit/44e3c8d757e6b4e2a57a69a035f26b4abec3e327) -- Fix wrong `iat` and `exp` values when signing with `noTimestamp`. [331b7bc](https://github.com/auth0/node-jsonwebtoken/commit/331b7bc9cc335561f8806f2c4558e105cb53e0a6) diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/jsonwebtoken/LICENSE b/packages/wyatt_notification_bloc/example/scripts/node_modules/jsonwebtoken/LICENSE deleted file mode 100644 index bcd1854c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/jsonwebtoken/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015 Auth0, Inc. (http://auth0.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/jsonwebtoken/README.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/jsonwebtoken/README.md deleted file mode 100644 index f966435e..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/jsonwebtoken/README.md +++ /dev/null @@ -1,375 +0,0 @@ -# jsonwebtoken - -| **Build** | **Dependency** | -|-----------|---------------| -| [![Build Status](https://secure.travis-ci.org/auth0/node-jsonwebtoken.svg?branch=master)](http://travis-ci.org/auth0/node-jsonwebtoken) | [![Dependency Status](https://david-dm.org/auth0/node-jsonwebtoken.svg)](https://david-dm.org/auth0/node-jsonwebtoken) | - - -An implementation of [JSON Web Tokens](https://tools.ietf.org/html/rfc7519). - -This was developed against `draft-ietf-oauth-json-web-token-08`. It makes use of [node-jws](https://github.com/brianloveswords/node-jws) - -# Install - -```bash -$ npm install jsonwebtoken -``` - -# Migration notes - -* [From v7 to v8](https://github.com/auth0/node-jsonwebtoken/wiki/Migration-Notes:-v7-to-v8) - -# Usage - -### jwt.sign(payload, secretOrPrivateKey, [options, callback]) - -(Asynchronous) If a callback is supplied, the callback is called with the `err` or the JWT. - -(Synchronous) Returns the JsonWebToken as string - -`payload` could be an object literal, buffer or string representing valid JSON. -> **Please _note_ that** `exp` or any other claim is only set if the payload is an object literal. Buffer or string payloads are not checked for JSON validity. - -> If `payload` is not a buffer or a string, it will be coerced into a string using `JSON.stringify`. - -`secretOrPrivateKey` is a string, buffer, or object containing either the secret for HMAC algorithms or the PEM -encoded private key for RSA and ECDSA. In case of a private key with passphrase an object `{ key, passphrase }` can be used (based on [crypto documentation](https://nodejs.org/api/crypto.html#crypto_sign_sign_private_key_output_format)), in this case be sure you pass the `algorithm` option. - -`options`: - -* `algorithm` (default: `HS256`) -* `expiresIn`: expressed in seconds or a string describing a time span [zeit/ms](https://github.com/zeit/ms). - > Eg: `60`, `"2 days"`, `"10h"`, `"7d"`. A numeric value is interpreted as a seconds count. If you use a string be sure you provide the time units (days, hours, etc), otherwise milliseconds unit is used by default (`"120"` is equal to `"120ms"`). -* `notBefore`: expressed in seconds or a string describing a time span [zeit/ms](https://github.com/zeit/ms). - > Eg: `60`, `"2 days"`, `"10h"`, `"7d"`. A numeric value is interpreted as a seconds count. If you use a string be sure you provide the time units (days, hours, etc), otherwise milliseconds unit is used by default (`"120"` is equal to `"120ms"`). -* `audience` -* `issuer` -* `jwtid` -* `subject` -* `noTimestamp` -* `header` -* `keyid` -* `mutatePayload`: if true, the sign function will modify the payload object directly. This is useful if you need a raw reference to the payload after claims have been applied to it but before it has been encoded into a token. - - - -> There are no default values for `expiresIn`, `notBefore`, `audience`, `subject`, `issuer`. These claims can also be provided in the payload directly with `exp`, `nbf`, `aud`, `sub` and `iss` respectively, but you **_can't_** include in both places. - -Remember that `exp`, `nbf` and `iat` are **NumericDate**, see related [Token Expiration (exp claim)](#token-expiration-exp-claim) - - -The header can be customized via the `options.header` object. - -Generated jwts will include an `iat` (issued at) claim by default unless `noTimestamp` is specified. If `iat` is inserted in the payload, it will be used instead of the real timestamp for calculating other things like `exp` given a timespan in `options.expiresIn`. - -Synchronous Sign with default (HMAC SHA256) - -```js -var jwt = require('jsonwebtoken'); -var token = jwt.sign({ foo: 'bar' }, 'shhhhh'); -``` - -Synchronous Sign with RSA SHA256 -```js -// sign with RSA SHA256 -var privateKey = fs.readFileSync('private.key'); -var token = jwt.sign({ foo: 'bar' }, privateKey, { algorithm: 'RS256'}); -``` - -Sign asynchronously -```js -jwt.sign({ foo: 'bar' }, privateKey, { algorithm: 'RS256' }, function(err, token) { - console.log(token); -}); -``` - -Backdate a jwt 30 seconds -```js -var older_token = jwt.sign({ foo: 'bar', iat: Math.floor(Date.now() / 1000) - 30 }, 'shhhhh'); -``` - -#### Token Expiration (exp claim) - -The standard for JWT defines an `exp` claim for expiration. The expiration is represented as a **NumericDate**: - -> A JSON numeric value representing the number of seconds from 1970-01-01T00:00:00Z UTC until the specified UTC date/time, ignoring leap seconds. This is equivalent to the IEEE Std 1003.1, 2013 Edition [POSIX.1] definition "Seconds Since the Epoch", in which each day is accounted for by exactly 86400 seconds, other than that non-integer values can be represented. See RFC 3339 [RFC3339] for details regarding date/times in general and UTC in particular. - -This means that the `exp` field should contain the number of seconds since the epoch. - -Signing a token with 1 hour of expiration: - -```javascript -jwt.sign({ - exp: Math.floor(Date.now() / 1000) + (60 * 60), - data: 'foobar' -}, 'secret'); -``` - -Another way to generate a token like this with this library is: - -```javascript -jwt.sign({ - data: 'foobar' -}, 'secret', { expiresIn: 60 * 60 }); - -//or even better: - -jwt.sign({ - data: 'foobar' -}, 'secret', { expiresIn: '1h' }); -``` - -### jwt.verify(token, secretOrPublicKey, [options, callback]) - -(Asynchronous) If a callback is supplied, function acts asynchronously. The callback is called with the decoded payload if the signature is valid and optional expiration, audience, or issuer are valid. If not, it will be called with the error. - -(Synchronous) If a callback is not supplied, function acts synchronously. Returns the payload decoded if the signature is valid and optional expiration, audience, or issuer are valid. If not, it will throw the error. - -`token` is the JsonWebToken string - -`secretOrPublicKey` is a string or buffer containing either the secret for HMAC algorithms, or the PEM -encoded public key for RSA and ECDSA. -If `jwt.verify` is called asynchronous, `secretOrPublicKey` can be a function that should fetch the secret or public key. See below for a detailed example - -As mentioned in [this comment](https://github.com/auth0/node-jsonwebtoken/issues/208#issuecomment-231861138), there are other libraries that expect base64 encoded secrets (random bytes encoded using base64), if that is your case you can pass `Buffer.from(secret, 'base64')`, by doing this the secret will be decoded using base64 and the token verification will use the original random bytes. - -`options` - -* `algorithms`: List of strings with the names of the allowed algorithms. For instance, `["HS256", "HS384"]`. -* `audience`: if you want to check audience (`aud`), provide a value here. The audience can be checked against a string, a regular expression or a list of strings and/or regular expressions. - > Eg: `"urn:foo"`, `/urn:f[o]{2}/`, `[/urn:f[o]{2}/, "urn:bar"]` -* `complete`: return an object with the decoded `{ payload, header, signature }` instead of only the usual content of the payload. -* `issuer` (optional): string or array of strings of valid values for the `iss` field. -* `ignoreExpiration`: if `true` do not validate the expiration of the token. -* `ignoreNotBefore`... -* `subject`: if you want to check subject (`sub`), provide a value here -* `clockTolerance`: number of seconds to tolerate when checking the `nbf` and `exp` claims, to deal with small clock differences among different servers -* `maxAge`: the maximum allowed age for tokens to still be valid. It is expressed in seconds or a string describing a time span [zeit/ms](https://github.com/zeit/ms). - > Eg: `1000`, `"2 days"`, `"10h"`, `"7d"`. A numeric value is interpreted as a seconds count. If you use a string be sure you provide the time units (days, hours, etc), otherwise milliseconds unit is used by default (`"120"` is equal to `"120ms"`). -* `clockTimestamp`: the time in seconds that should be used as the current time for all necessary comparisons. -* `nonce`: if you want to check `nonce` claim, provide a string value here. It is used on Open ID for the ID Tokens. ([Open ID implementation notes](https://openid.net/specs/openid-connect-core-1_0.html#NonceNotes)) - - -```js -// verify a token symmetric - synchronous -var decoded = jwt.verify(token, 'shhhhh'); -console.log(decoded.foo) // bar - -// verify a token symmetric -jwt.verify(token, 'shhhhh', function(err, decoded) { - console.log(decoded.foo) // bar -}); - -// invalid token - synchronous -try { - var decoded = jwt.verify(token, 'wrong-secret'); -} catch(err) { - // err -} - -// invalid token -jwt.verify(token, 'wrong-secret', function(err, decoded) { - // err - // decoded undefined -}); - -// verify a token asymmetric -var cert = fs.readFileSync('public.pem'); // get public key -jwt.verify(token, cert, function(err, decoded) { - console.log(decoded.foo) // bar -}); - -// verify audience -var cert = fs.readFileSync('public.pem'); // get public key -jwt.verify(token, cert, { audience: 'urn:foo' }, function(err, decoded) { - // if audience mismatch, err == invalid audience -}); - -// verify issuer -var cert = fs.readFileSync('public.pem'); // get public key -jwt.verify(token, cert, { audience: 'urn:foo', issuer: 'urn:issuer' }, function(err, decoded) { - // if issuer mismatch, err == invalid issuer -}); - -// verify jwt id -var cert = fs.readFileSync('public.pem'); // get public key -jwt.verify(token, cert, { audience: 'urn:foo', issuer: 'urn:issuer', jwtid: 'jwtid' }, function(err, decoded) { - // if jwt id mismatch, err == invalid jwt id -}); - -// verify subject -var cert = fs.readFileSync('public.pem'); // get public key -jwt.verify(token, cert, { audience: 'urn:foo', issuer: 'urn:issuer', jwtid: 'jwtid', subject: 'subject' }, function(err, decoded) { - // if subject mismatch, err == invalid subject -}); - -// alg mismatch -var cert = fs.readFileSync('public.pem'); // get public key -jwt.verify(token, cert, { algorithms: ['RS256'] }, function (err, payload) { - // if token alg != RS256, err == invalid signature -}); - -// Verify using getKey callback -// Example uses https://github.com/auth0/node-jwks-rsa as a way to fetch the keys. -var jwksClient = require('jwks-rsa'); -var client = jwksClient({ - jwksUri: 'https://sandrino.auth0.com/.well-known/jwks.json' -}); -function getKey(header, callback){ - client.getSigningKey(header.kid, function(err, key) { - var signingKey = key.publicKey || key.rsaPublicKey; - callback(null, signingKey); - }); -} - -jwt.verify(token, getKey, options, function(err, decoded) { - console.log(decoded.foo) // bar -}); - -``` - -### jwt.decode(token [, options]) - -(Synchronous) Returns the decoded payload without verifying if the signature is valid. - -> __Warning:__ This will __not__ verify whether the signature is valid. You should __not__ use this for untrusted messages. You most likely want to use `jwt.verify` instead. - -`token` is the JsonWebToken string - -`options`: - -* `json`: force JSON.parse on the payload even if the header doesn't contain `"typ":"JWT"`. -* `complete`: return an object with the decoded payload and header. - -Example - -```js -// get the decoded payload ignoring signature, no secretOrPrivateKey needed -var decoded = jwt.decode(token); - -// get the decoded payload and header -var decoded = jwt.decode(token, {complete: true}); -console.log(decoded.header); -console.log(decoded.payload) -``` - -## Errors & Codes -Possible thrown errors during verification. -Error is the first argument of the verification callback. - -### TokenExpiredError - -Thrown error if the token is expired. - -Error object: - -* name: 'TokenExpiredError' -* message: 'jwt expired' -* expiredAt: [ExpDate] - -```js -jwt.verify(token, 'shhhhh', function(err, decoded) { - if (err) { - /* - err = { - name: 'TokenExpiredError', - message: 'jwt expired', - expiredAt: 1408621000 - } - */ - } -}); -``` - -### JsonWebTokenError -Error object: - -* name: 'JsonWebTokenError' -* message: - * 'jwt malformed' - * 'jwt signature is required' - * 'invalid signature' - * 'jwt audience invalid. expected: [OPTIONS AUDIENCE]' - * 'jwt issuer invalid. expected: [OPTIONS ISSUER]' - * 'jwt id invalid. expected: [OPTIONS JWT ID]' - * 'jwt subject invalid. expected: [OPTIONS SUBJECT]' - -```js -jwt.verify(token, 'shhhhh', function(err, decoded) { - if (err) { - /* - err = { - name: 'JsonWebTokenError', - message: 'jwt malformed' - } - */ - } -}); -``` - -### NotBeforeError -Thrown if current time is before the nbf claim. - -Error object: - -* name: 'NotBeforeError' -* message: 'jwt not active' -* date: 2018-10-04T16:10:44.000Z - -```js -jwt.verify(token, 'shhhhh', function(err, decoded) { - if (err) { - /* - err = { - name: 'NotBeforeError', - message: 'jwt not active', - date: 2018-10-04T16:10:44.000Z - } - */ - } -}); -``` - - -## Algorithms supported - -Array of supported algorithms. The following algorithms are currently supported. - -alg Parameter Value | Digital Signature or MAC Algorithm -----------------|---------------------------- -HS256 | HMAC using SHA-256 hash algorithm -HS384 | HMAC using SHA-384 hash algorithm -HS512 | HMAC using SHA-512 hash algorithm -RS256 | RSASSA-PKCS1-v1_5 using SHA-256 hash algorithm -RS384 | RSASSA-PKCS1-v1_5 using SHA-384 hash algorithm -RS512 | RSASSA-PKCS1-v1_5 using SHA-512 hash algorithm -PS256 | RSASSA-PSS using SHA-256 hash algorithm (only node ^6.12.0 OR >=8.0.0) -PS384 | RSASSA-PSS using SHA-384 hash algorithm (only node ^6.12.0 OR >=8.0.0) -PS512 | RSASSA-PSS using SHA-512 hash algorithm (only node ^6.12.0 OR >=8.0.0) -ES256 | ECDSA using P-256 curve and SHA-256 hash algorithm -ES384 | ECDSA using P-384 curve and SHA-384 hash algorithm -ES512 | ECDSA using P-521 curve and SHA-512 hash algorithm -none | No digital signature or MAC value included - -## Refreshing JWTs - -First of all, we recommend you to think carefully if auto-refreshing a JWT will not introduce any vulnerability in your system. - -We are not comfortable including this as part of the library, however, you can take a look at [this example](https://gist.github.com/ziluvatar/a3feb505c4c0ec37059054537b38fc48) to show how this could be accomplished. -Apart from that example there are [an issue](https://github.com/auth0/node-jsonwebtoken/issues/122) and [a pull request](https://github.com/auth0/node-jsonwebtoken/pull/172) to get more knowledge about this topic. - -# TODO - -* X.509 certificate chain is not checked - -## Issue Reporting - -If you have found a bug or if you have a feature request, please report them at this repository issues section. Please do not report security vulnerabilities on the public GitHub issue tracker. The [Responsible Disclosure Program](https://auth0.com/whitehat) details the procedure for disclosing security issues. - -## Author - -[Auth0](https://auth0.com) - -## License - -This project is licensed under the MIT license. See the [LICENSE](LICENSE) file for more info. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/jsonwebtoken/decode.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/jsonwebtoken/decode.js deleted file mode 100644 index 8fe1adcd..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/jsonwebtoken/decode.js +++ /dev/null @@ -1,30 +0,0 @@ -var jws = require('jws'); - -module.exports = function (jwt, options) { - options = options || {}; - var decoded = jws.decode(jwt, options); - if (!decoded) { return null; } - var payload = decoded.payload; - - //try parse the payload - if(typeof payload === 'string') { - try { - var obj = JSON.parse(payload); - if(obj !== null && typeof obj === 'object') { - payload = obj; - } - } catch (e) { } - } - - //return header if `complete` option is enabled. header includes claims - //such as `kid` and `alg` used to select the key within a JWKS needed to - //verify the signature - if (options.complete === true) { - return { - header: decoded.header, - payload: payload, - signature: decoded.signature - }; - } - return payload; -}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/jsonwebtoken/index.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/jsonwebtoken/index.js deleted file mode 100644 index 161eb2dd..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/jsonwebtoken/index.js +++ /dev/null @@ -1,8 +0,0 @@ -module.exports = { - decode: require('./decode'), - verify: require('./verify'), - sign: require('./sign'), - JsonWebTokenError: require('./lib/JsonWebTokenError'), - NotBeforeError: require('./lib/NotBeforeError'), - TokenExpiredError: require('./lib/TokenExpiredError'), -}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/jsonwebtoken/lib/JsonWebTokenError.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/jsonwebtoken/lib/JsonWebTokenError.js deleted file mode 100644 index e068222a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/jsonwebtoken/lib/JsonWebTokenError.js +++ /dev/null @@ -1,14 +0,0 @@ -var JsonWebTokenError = function (message, error) { - Error.call(this, message); - if(Error.captureStackTrace) { - Error.captureStackTrace(this, this.constructor); - } - this.name = 'JsonWebTokenError'; - this.message = message; - if (error) this.inner = error; -}; - -JsonWebTokenError.prototype = Object.create(Error.prototype); -JsonWebTokenError.prototype.constructor = JsonWebTokenError; - -module.exports = JsonWebTokenError; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/jsonwebtoken/lib/NotBeforeError.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/jsonwebtoken/lib/NotBeforeError.js deleted file mode 100644 index 7b30084f..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/jsonwebtoken/lib/NotBeforeError.js +++ /dev/null @@ -1,13 +0,0 @@ -var JsonWebTokenError = require('./JsonWebTokenError'); - -var NotBeforeError = function (message, date) { - JsonWebTokenError.call(this, message); - this.name = 'NotBeforeError'; - this.date = date; -}; - -NotBeforeError.prototype = Object.create(JsonWebTokenError.prototype); - -NotBeforeError.prototype.constructor = NotBeforeError; - -module.exports = NotBeforeError; \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/jsonwebtoken/lib/TokenExpiredError.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/jsonwebtoken/lib/TokenExpiredError.js deleted file mode 100644 index abb704f2..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/jsonwebtoken/lib/TokenExpiredError.js +++ /dev/null @@ -1,13 +0,0 @@ -var JsonWebTokenError = require('./JsonWebTokenError'); - -var TokenExpiredError = function (message, expiredAt) { - JsonWebTokenError.call(this, message); - this.name = 'TokenExpiredError'; - this.expiredAt = expiredAt; -}; - -TokenExpiredError.prototype = Object.create(JsonWebTokenError.prototype); - -TokenExpiredError.prototype.constructor = TokenExpiredError; - -module.exports = TokenExpiredError; \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/jsonwebtoken/lib/psSupported.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/jsonwebtoken/lib/psSupported.js deleted file mode 100644 index 8c04144a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/jsonwebtoken/lib/psSupported.js +++ /dev/null @@ -1,3 +0,0 @@ -var semver = require('semver'); - -module.exports = semver.satisfies(process.version, '^6.12.0 || >=8.0.0'); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/jsonwebtoken/lib/timespan.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/jsonwebtoken/lib/timespan.js deleted file mode 100644 index e5098690..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/jsonwebtoken/lib/timespan.js +++ /dev/null @@ -1,18 +0,0 @@ -var ms = require('ms'); - -module.exports = function (time, iat) { - var timestamp = iat || Math.floor(Date.now() / 1000); - - if (typeof time === 'string') { - var milliseconds = ms(time); - if (typeof milliseconds === 'undefined') { - return; - } - return Math.floor(timestamp + milliseconds / 1000); - } else if (typeof time === 'number') { - return timestamp + time; - } else { - return; - } - -}; \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/jsonwebtoken/node_modules/jwa/LICENSE b/packages/wyatt_notification_bloc/example/scripts/node_modules/jsonwebtoken/node_modules/jwa/LICENSE deleted file mode 100644 index caeb8495..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/jsonwebtoken/node_modules/jwa/LICENSE +++ /dev/null @@ -1,17 +0,0 @@ -Copyright (c) 2013 Brian J. Brennan - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to use, -copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the -Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/jsonwebtoken/node_modules/jwa/README.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/jsonwebtoken/node_modules/jwa/README.md deleted file mode 100644 index fb433e23..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/jsonwebtoken/node_modules/jwa/README.md +++ /dev/null @@ -1,150 +0,0 @@ -# node-jwa [![Build Status](https://travis-ci.org/brianloveswords/node-jwa.svg?branch=master)](https://travis-ci.org/brianloveswords/node-jwa) - -A -[JSON Web Algorithms](http://tools.ietf.org/id/draft-ietf-jose-json-web-algorithms-08.html) -implementation focusing (exclusively, at this point) on the algorithms necessary for -[JSON Web Signatures](http://self-issued.info/docs/draft-ietf-jose-json-web-signature.html). - -This library supports all of the required, recommended and optional cryptographic algorithms for JWS: - -alg Parameter Value | Digital Signature or MAC Algorithm -----------------|---------------------------- -HS256 | HMAC using SHA-256 hash algorithm -HS384 | HMAC using SHA-384 hash algorithm -HS512 | HMAC using SHA-512 hash algorithm -RS256 | RSASSA using SHA-256 hash algorithm -RS384 | RSASSA using SHA-384 hash algorithm -RS512 | RSASSA using SHA-512 hash algorithm -PS256 | RSASSA-PSS using SHA-256 hash algorithm -PS384 | RSASSA-PSS using SHA-384 hash algorithm -PS512 | RSASSA-PSS using SHA-512 hash algorithm -ES256 | ECDSA using P-256 curve and SHA-256 hash algorithm -ES384 | ECDSA using P-384 curve and SHA-384 hash algorithm -ES512 | ECDSA using P-521 curve and SHA-512 hash algorithm -none | No digital signature or MAC value included - -Please note that PS* only works on Node 6.12+ (excluding 7.x). - -# Requirements - -In order to run the tests, a recent version of OpenSSL is -required. **The version that comes with OS X (OpenSSL 0.9.8r 8 Feb -2011) is not recent enough**, as it does not fully support ECDSA -keys. You'll need to use a version > 1.0.0; I tested with OpenSSL 1.0.1c 10 May 2012. - -# Testing - -To run the tests, do - -```bash -$ npm test -``` - -This will generate a bunch of keypairs to use in testing. If you want to -generate new keypairs, do `make clean` before running `npm test` again. - -## Methodology - -I spawn `openssl dgst -sign` to test OpenSSL sign → JS verify and -`openssl dgst -verify` to test JS sign → OpenSSL verify for each of the -RSA and ECDSA algorithms. - -# Usage - -## jwa(algorithm) - -Creates a new `jwa` object with `sign` and `verify` methods for the -algorithm. Valid values for algorithm can be found in the table above -(`'HS256'`, `'HS384'`, etc) and are case-insensitive. Passing an invalid -algorithm value will throw a `TypeError`. - - -## jwa#sign(input, secretOrPrivateKey) - -Sign some input with either a secret for HMAC algorithms, or a private -key for RSA and ECDSA algorithms. - -If input is not already a string or buffer, `JSON.stringify` will be -called on it to attempt to coerce it. - -For the HMAC algorithm, `secretOrPrivateKey` should be a string or a -buffer. For ECDSA and RSA, the value should be a string representing a -PEM encoded **private** key. - -Output [base64url](http://en.wikipedia.org/wiki/Base64#URL_applications) -formatted. This is for convenience as JWS expects the signature in this -format. If your application needs the output in a different format, -[please open an issue](https://github.com/brianloveswords/node-jwa/issues). In -the meantime, you can use -[brianloveswords/base64url](https://github.com/brianloveswords/base64url) -to decode the signature. - -As of nodejs *v0.11.8*, SPKAC support was introduce. If your nodeJs -version satisfies, then you can pass an object `{ key: '..', passphrase: '...' }` - - -## jwa#verify(input, signature, secretOrPublicKey) - -Verify a signature. Returns `true` or `false`. - -`signature` should be a base64url encoded string. - -For the HMAC algorithm, `secretOrPublicKey` should be a string or a -buffer. For ECDSA and RSA, the value should be a string represented a -PEM encoded **public** key. - - -# Example - -HMAC -```js -const jwa = require('jwa'); - -const hmac = jwa('HS256'); -const input = 'super important stuff'; -const secret = 'shhhhhh'; - -const signature = hmac.sign(input, secret); -hmac.verify(input, signature, secret) // === true -hmac.verify(input, signature, 'trickery!') // === false -``` - -With keys -```js -const fs = require('fs'); -const jwa = require('jwa'); -const privateKey = fs.readFileSync(__dirname + '/ecdsa-p521-private.pem'); -const publicKey = fs.readFileSync(__dirname + '/ecdsa-p521-public.pem'); - -const ecdsa = jwa('ES512'); -const input = 'very important stuff'; - -const signature = ecdsa.sign(input, privateKey); -ecdsa.verify(input, signature, publicKey) // === true -``` -## License - -MIT - -``` -Copyright (c) 2013 Brian J. Brennan - -Permission is hereby granted, free of charge, to any person obtaining a -copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -``` diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/jsonwebtoken/node_modules/jwa/index.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/jsonwebtoken/node_modules/jwa/index.js deleted file mode 100644 index e71e6d19..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/jsonwebtoken/node_modules/jwa/index.js +++ /dev/null @@ -1,252 +0,0 @@ -var bufferEqual = require('buffer-equal-constant-time'); -var Buffer = require('safe-buffer').Buffer; -var crypto = require('crypto'); -var formatEcdsa = require('ecdsa-sig-formatter'); -var util = require('util'); - -var MSG_INVALID_ALGORITHM = '"%s" is not a valid algorithm.\n Supported algorithms are:\n "HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "PS256", "PS384", "PS512", "ES256", "ES384", "ES512" and "none".' -var MSG_INVALID_SECRET = 'secret must be a string or buffer'; -var MSG_INVALID_VERIFIER_KEY = 'key must be a string or a buffer'; -var MSG_INVALID_SIGNER_KEY = 'key must be a string, a buffer or an object'; - -var supportsKeyObjects = typeof crypto.createPublicKey === 'function'; -if (supportsKeyObjects) { - MSG_INVALID_VERIFIER_KEY += ' or a KeyObject'; - MSG_INVALID_SECRET += 'or a KeyObject'; -} - -function checkIsPublicKey(key) { - if (Buffer.isBuffer(key)) { - return; - } - - if (typeof key === 'string') { - return; - } - - if (!supportsKeyObjects) { - throw typeError(MSG_INVALID_VERIFIER_KEY); - } - - if (typeof key !== 'object') { - throw typeError(MSG_INVALID_VERIFIER_KEY); - } - - if (typeof key.type !== 'string') { - throw typeError(MSG_INVALID_VERIFIER_KEY); - } - - if (typeof key.asymmetricKeyType !== 'string') { - throw typeError(MSG_INVALID_VERIFIER_KEY); - } - - if (typeof key.export !== 'function') { - throw typeError(MSG_INVALID_VERIFIER_KEY); - } -}; - -function checkIsPrivateKey(key) { - if (Buffer.isBuffer(key)) { - return; - } - - if (typeof key === 'string') { - return; - } - - if (typeof key === 'object') { - return; - } - - throw typeError(MSG_INVALID_SIGNER_KEY); -}; - -function checkIsSecretKey(key) { - if (Buffer.isBuffer(key)) { - return; - } - - if (typeof key === 'string') { - return key; - } - - if (!supportsKeyObjects) { - throw typeError(MSG_INVALID_SECRET); - } - - if (typeof key !== 'object') { - throw typeError(MSG_INVALID_SECRET); - } - - if (key.type !== 'secret') { - throw typeError(MSG_INVALID_SECRET); - } - - if (typeof key.export !== 'function') { - throw typeError(MSG_INVALID_SECRET); - } -} - -function fromBase64(base64) { - return base64 - .replace(/=/g, '') - .replace(/\+/g, '-') - .replace(/\//g, '_'); -} - -function toBase64(base64url) { - base64url = base64url.toString(); - - var padding = 4 - base64url.length % 4; - if (padding !== 4) { - for (var i = 0; i < padding; ++i) { - base64url += '='; - } - } - - return base64url - .replace(/\-/g, '+') - .replace(/_/g, '/'); -} - -function typeError(template) { - var args = [].slice.call(arguments, 1); - var errMsg = util.format.bind(util, template).apply(null, args); - return new TypeError(errMsg); -} - -function bufferOrString(obj) { - return Buffer.isBuffer(obj) || typeof obj === 'string'; -} - -function normalizeInput(thing) { - if (!bufferOrString(thing)) - thing = JSON.stringify(thing); - return thing; -} - -function createHmacSigner(bits) { - return function sign(thing, secret) { - checkIsSecretKey(secret); - thing = normalizeInput(thing); - var hmac = crypto.createHmac('sha' + bits, secret); - var sig = (hmac.update(thing), hmac.digest('base64')) - return fromBase64(sig); - } -} - -function createHmacVerifier(bits) { - return function verify(thing, signature, secret) { - var computedSig = createHmacSigner(bits)(thing, secret); - return bufferEqual(Buffer.from(signature), Buffer.from(computedSig)); - } -} - -function createKeySigner(bits) { - return function sign(thing, privateKey) { - checkIsPrivateKey(privateKey); - thing = normalizeInput(thing); - // Even though we are specifying "RSA" here, this works with ECDSA - // keys as well. - var signer = crypto.createSign('RSA-SHA' + bits); - var sig = (signer.update(thing), signer.sign(privateKey, 'base64')); - return fromBase64(sig); - } -} - -function createKeyVerifier(bits) { - return function verify(thing, signature, publicKey) { - checkIsPublicKey(publicKey); - thing = normalizeInput(thing); - signature = toBase64(signature); - var verifier = crypto.createVerify('RSA-SHA' + bits); - verifier.update(thing); - return verifier.verify(publicKey, signature, 'base64'); - } -} - -function createPSSKeySigner(bits) { - return function sign(thing, privateKey) { - checkIsPrivateKey(privateKey); - thing = normalizeInput(thing); - var signer = crypto.createSign('RSA-SHA' + bits); - var sig = (signer.update(thing), signer.sign({ - key: privateKey, - padding: crypto.constants.RSA_PKCS1_PSS_PADDING, - saltLength: crypto.constants.RSA_PSS_SALTLEN_DIGEST - }, 'base64')); - return fromBase64(sig); - } -} - -function createPSSKeyVerifier(bits) { - return function verify(thing, signature, publicKey) { - checkIsPublicKey(publicKey); - thing = normalizeInput(thing); - signature = toBase64(signature); - var verifier = crypto.createVerify('RSA-SHA' + bits); - verifier.update(thing); - return verifier.verify({ - key: publicKey, - padding: crypto.constants.RSA_PKCS1_PSS_PADDING, - saltLength: crypto.constants.RSA_PSS_SALTLEN_DIGEST - }, signature, 'base64'); - } -} - -function createECDSASigner(bits) { - var inner = createKeySigner(bits); - return function sign() { - var signature = inner.apply(null, arguments); - signature = formatEcdsa.derToJose(signature, 'ES' + bits); - return signature; - }; -} - -function createECDSAVerifer(bits) { - var inner = createKeyVerifier(bits); - return function verify(thing, signature, publicKey) { - signature = formatEcdsa.joseToDer(signature, 'ES' + bits).toString('base64'); - var result = inner(thing, signature, publicKey); - return result; - }; -} - -function createNoneSigner() { - return function sign() { - return ''; - } -} - -function createNoneVerifier() { - return function verify(thing, signature) { - return signature === ''; - } -} - -module.exports = function jwa(algorithm) { - var signerFactories = { - hs: createHmacSigner, - rs: createKeySigner, - ps: createPSSKeySigner, - es: createECDSASigner, - none: createNoneSigner, - } - var verifierFactories = { - hs: createHmacVerifier, - rs: createKeyVerifier, - ps: createPSSKeyVerifier, - es: createECDSAVerifer, - none: createNoneVerifier, - } - var match = algorithm.match(/^(RS|PS|ES|HS)(256|384|512)$|^(none)$/i); - if (!match) - throw typeError(MSG_INVALID_ALGORITHM, algorithm); - var algo = (match[1] || match[3]).toLowerCase(); - var bits = match[2]; - - return { - sign: signerFactories[algo](bits), - verify: verifierFactories[algo](bits), - } -}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/jsonwebtoken/node_modules/jwa/package.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/jsonwebtoken/node_modules/jwa/package.json deleted file mode 100644 index 0777d533..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/jsonwebtoken/node_modules/jwa/package.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "name": "jwa", - "version": "1.4.1", - "description": "JWA implementation (supports all JWS algorithms)", - "main": "index.js", - "directories": { - "test": "test" - }, - "dependencies": { - "buffer-equal-constant-time": "1.0.1", - "ecdsa-sig-formatter": "1.0.11", - "safe-buffer": "^5.0.1" - }, - "devDependencies": { - "base64url": "^2.0.0", - "jwk-to-pem": "^2.0.1", - "semver": "4.3.6", - "tap": "6.2.0" - }, - "scripts": { - "test": "make test" - }, - "repository": { - "type": "git", - "url": "git://github.com/brianloveswords/node-jwa.git" - }, - "keywords": [ - "jwa", - "jws", - "jwt", - "rsa", - "ecdsa", - "hmac" - ], - "author": "Brian J. Brennan ", - "license": "MIT" -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/jsonwebtoken/node_modules/jws/CHANGELOG.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/jsonwebtoken/node_modules/jws/CHANGELOG.md deleted file mode 100644 index af8fc287..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/jsonwebtoken/node_modules/jws/CHANGELOG.md +++ /dev/null @@ -1,34 +0,0 @@ -# Change Log -All notable changes to this project will be documented in this file. - -## [3.0.0] -### Changed -- **BREAKING**: `jwt.verify` now requires an `algorithm` parameter, and - `jws.createVerify` requires an `algorithm` option. The `"alg"` field - signature headers is ignored. This mitigates a critical security flaw - in the library which would allow an attacker to generate signatures with - arbitrary contents that would be accepted by `jwt.verify`. See - https://auth0.com/blog/2015/03/31/critical-vulnerabilities-in-json-web-token-libraries/ - for details. - -## [2.0.0] - 2015-01-30 -### Changed -- **BREAKING**: Default payload encoding changed from `binary` to - `utf8`. `utf8` is a is a more sensible default than `binary` because - many payloads, as far as I can tell, will contain user-facing - strings that could be in any language. ([6b6de48]) - -- Code reorganization, thanks [@fearphage]! ([7880050]) - -### Added -- Option in all relevant methods for `encoding`. For those few users - that might be depending on a `binary` encoding of the messages, this - is for them. ([6b6de48]) - -[unreleased]: https://github.com/brianloveswords/node-jws/compare/v2.0.0...HEAD -[2.0.0]: https://github.com/brianloveswords/node-jws/compare/v1.0.1...v2.0.0 - -[7880050]: https://github.com/brianloveswords/node-jws/commit/7880050 -[6b6de48]: https://github.com/brianloveswords/node-jws/commit/6b6de48 - -[@fearphage]: https://github.com/fearphage diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/jsonwebtoken/node_modules/jws/LICENSE b/packages/wyatt_notification_bloc/example/scripts/node_modules/jsonwebtoken/node_modules/jws/LICENSE deleted file mode 100644 index caeb8495..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/jsonwebtoken/node_modules/jws/LICENSE +++ /dev/null @@ -1,17 +0,0 @@ -Copyright (c) 2013 Brian J. Brennan - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to use, -copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the -Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/jsonwebtoken/node_modules/jws/index.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/jsonwebtoken/node_modules/jws/index.js deleted file mode 100644 index 8c8da930..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/jsonwebtoken/node_modules/jws/index.js +++ /dev/null @@ -1,22 +0,0 @@ -/*global exports*/ -var SignStream = require('./lib/sign-stream'); -var VerifyStream = require('./lib/verify-stream'); - -var ALGORITHMS = [ - 'HS256', 'HS384', 'HS512', - 'RS256', 'RS384', 'RS512', - 'PS256', 'PS384', 'PS512', - 'ES256', 'ES384', 'ES512' -]; - -exports.ALGORITHMS = ALGORITHMS; -exports.sign = SignStream.sign; -exports.verify = VerifyStream.verify; -exports.decode = VerifyStream.decode; -exports.isValid = VerifyStream.isValid; -exports.createSign = function createSign(opts) { - return new SignStream(opts); -}; -exports.createVerify = function createVerify(opts) { - return new VerifyStream(opts); -}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/jsonwebtoken/node_modules/jws/lib/data-stream.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/jsonwebtoken/node_modules/jws/lib/data-stream.js deleted file mode 100644 index 3535d31d..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/jsonwebtoken/node_modules/jws/lib/data-stream.js +++ /dev/null @@ -1,55 +0,0 @@ -/*global module, process*/ -var Buffer = require('safe-buffer').Buffer; -var Stream = require('stream'); -var util = require('util'); - -function DataStream(data) { - this.buffer = null; - this.writable = true; - this.readable = true; - - // No input - if (!data) { - this.buffer = Buffer.alloc(0); - return this; - } - - // Stream - if (typeof data.pipe === 'function') { - this.buffer = Buffer.alloc(0); - data.pipe(this); - return this; - } - - // Buffer or String - // or Object (assumedly a passworded key) - if (data.length || typeof data === 'object') { - this.buffer = data; - this.writable = false; - process.nextTick(function () { - this.emit('end', data); - this.readable = false; - this.emit('close'); - }.bind(this)); - return this; - } - - throw new TypeError('Unexpected data type ('+ typeof data + ')'); -} -util.inherits(DataStream, Stream); - -DataStream.prototype.write = function write(data) { - this.buffer = Buffer.concat([this.buffer, Buffer.from(data)]); - this.emit('data', data); -}; - -DataStream.prototype.end = function end(data) { - if (data) - this.write(data); - this.emit('end', data); - this.emit('close'); - this.writable = false; - this.readable = false; -}; - -module.exports = DataStream; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/jsonwebtoken/node_modules/jws/lib/sign-stream.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/jsonwebtoken/node_modules/jws/lib/sign-stream.js deleted file mode 100644 index 6a7ee42f..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/jsonwebtoken/node_modules/jws/lib/sign-stream.js +++ /dev/null @@ -1,78 +0,0 @@ -/*global module*/ -var Buffer = require('safe-buffer').Buffer; -var DataStream = require('./data-stream'); -var jwa = require('jwa'); -var Stream = require('stream'); -var toString = require('./tostring'); -var util = require('util'); - -function base64url(string, encoding) { - return Buffer - .from(string, encoding) - .toString('base64') - .replace(/=/g, '') - .replace(/\+/g, '-') - .replace(/\//g, '_'); -} - -function jwsSecuredInput(header, payload, encoding) { - encoding = encoding || 'utf8'; - var encodedHeader = base64url(toString(header), 'binary'); - var encodedPayload = base64url(toString(payload), encoding); - return util.format('%s.%s', encodedHeader, encodedPayload); -} - -function jwsSign(opts) { - var header = opts.header; - var payload = opts.payload; - var secretOrKey = opts.secret || opts.privateKey; - var encoding = opts.encoding; - var algo = jwa(header.alg); - var securedInput = jwsSecuredInput(header, payload, encoding); - var signature = algo.sign(securedInput, secretOrKey); - return util.format('%s.%s', securedInput, signature); -} - -function SignStream(opts) { - var secret = opts.secret||opts.privateKey||opts.key; - var secretStream = new DataStream(secret); - this.readable = true; - this.header = opts.header; - this.encoding = opts.encoding; - this.secret = this.privateKey = this.key = secretStream; - this.payload = new DataStream(opts.payload); - this.secret.once('close', function () { - if (!this.payload.writable && this.readable) - this.sign(); - }.bind(this)); - - this.payload.once('close', function () { - if (!this.secret.writable && this.readable) - this.sign(); - }.bind(this)); -} -util.inherits(SignStream, Stream); - -SignStream.prototype.sign = function sign() { - try { - var signature = jwsSign({ - header: this.header, - payload: this.payload.buffer, - secret: this.secret.buffer, - encoding: this.encoding - }); - this.emit('done', signature); - this.emit('data', signature); - this.emit('end'); - this.readable = false; - return signature; - } catch (e) { - this.readable = false; - this.emit('error', e); - this.emit('close'); - } -}; - -SignStream.sign = jwsSign; - -module.exports = SignStream; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/jsonwebtoken/node_modules/jws/lib/tostring.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/jsonwebtoken/node_modules/jws/lib/tostring.js deleted file mode 100644 index f5a49a36..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/jsonwebtoken/node_modules/jws/lib/tostring.js +++ /dev/null @@ -1,10 +0,0 @@ -/*global module*/ -var Buffer = require('buffer').Buffer; - -module.exports = function toString(obj) { - if (typeof obj === 'string') - return obj; - if (typeof obj === 'number' || Buffer.isBuffer(obj)) - return obj.toString(); - return JSON.stringify(obj); -}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/jsonwebtoken/node_modules/jws/lib/verify-stream.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/jsonwebtoken/node_modules/jws/lib/verify-stream.js deleted file mode 100644 index 39f7c73e..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/jsonwebtoken/node_modules/jws/lib/verify-stream.js +++ /dev/null @@ -1,120 +0,0 @@ -/*global module*/ -var Buffer = require('safe-buffer').Buffer; -var DataStream = require('./data-stream'); -var jwa = require('jwa'); -var Stream = require('stream'); -var toString = require('./tostring'); -var util = require('util'); -var JWS_REGEX = /^[a-zA-Z0-9\-_]+?\.[a-zA-Z0-9\-_]+?\.([a-zA-Z0-9\-_]+)?$/; - -function isObject(thing) { - return Object.prototype.toString.call(thing) === '[object Object]'; -} - -function safeJsonParse(thing) { - if (isObject(thing)) - return thing; - try { return JSON.parse(thing); } - catch (e) { return undefined; } -} - -function headerFromJWS(jwsSig) { - var encodedHeader = jwsSig.split('.', 1)[0]; - return safeJsonParse(Buffer.from(encodedHeader, 'base64').toString('binary')); -} - -function securedInputFromJWS(jwsSig) { - return jwsSig.split('.', 2).join('.'); -} - -function signatureFromJWS(jwsSig) { - return jwsSig.split('.')[2]; -} - -function payloadFromJWS(jwsSig, encoding) { - encoding = encoding || 'utf8'; - var payload = jwsSig.split('.')[1]; - return Buffer.from(payload, 'base64').toString(encoding); -} - -function isValidJws(string) { - return JWS_REGEX.test(string) && !!headerFromJWS(string); -} - -function jwsVerify(jwsSig, algorithm, secretOrKey) { - if (!algorithm) { - var err = new Error("Missing algorithm parameter for jws.verify"); - err.code = "MISSING_ALGORITHM"; - throw err; - } - jwsSig = toString(jwsSig); - var signature = signatureFromJWS(jwsSig); - var securedInput = securedInputFromJWS(jwsSig); - var algo = jwa(algorithm); - return algo.verify(securedInput, signature, secretOrKey); -} - -function jwsDecode(jwsSig, opts) { - opts = opts || {}; - jwsSig = toString(jwsSig); - - if (!isValidJws(jwsSig)) - return null; - - var header = headerFromJWS(jwsSig); - - if (!header) - return null; - - var payload = payloadFromJWS(jwsSig); - if (header.typ === 'JWT' || opts.json) - payload = JSON.parse(payload, opts.encoding); - - return { - header: header, - payload: payload, - signature: signatureFromJWS(jwsSig) - }; -} - -function VerifyStream(opts) { - opts = opts || {}; - var secretOrKey = opts.secret||opts.publicKey||opts.key; - var secretStream = new DataStream(secretOrKey); - this.readable = true; - this.algorithm = opts.algorithm; - this.encoding = opts.encoding; - this.secret = this.publicKey = this.key = secretStream; - this.signature = new DataStream(opts.signature); - this.secret.once('close', function () { - if (!this.signature.writable && this.readable) - this.verify(); - }.bind(this)); - - this.signature.once('close', function () { - if (!this.secret.writable && this.readable) - this.verify(); - }.bind(this)); -} -util.inherits(VerifyStream, Stream); -VerifyStream.prototype.verify = function verify() { - try { - var valid = jwsVerify(this.signature.buffer, this.algorithm, this.key.buffer); - var obj = jwsDecode(this.signature.buffer, this.encoding); - this.emit('done', valid, obj); - this.emit('data', valid); - this.emit('end'); - this.readable = false; - return valid; - } catch (e) { - this.readable = false; - this.emit('error', e); - this.emit('close'); - } -}; - -VerifyStream.decode = jwsDecode; -VerifyStream.isValid = isValidJws; -VerifyStream.verify = jwsVerify; - -module.exports = VerifyStream; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/jsonwebtoken/node_modules/jws/package.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/jsonwebtoken/node_modules/jws/package.json deleted file mode 100644 index 3fb28375..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/jsonwebtoken/node_modules/jws/package.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "name": "jws", - "version": "3.2.2", - "description": "Implementation of JSON Web Signatures", - "main": "index.js", - "directories": { - "test": "test" - }, - "scripts": { - "test": "make test" - }, - "repository": { - "type": "git", - "url": "git://github.com/brianloveswords/node-jws.git" - }, - "keywords": [ - "jws", - "json", - "web", - "signatures" - ], - "author": "Brian J Brennan", - "license": "MIT", - "readmeFilename": "readme.md", - "gitHead": "c0f6b27bcea5a2ad2e304d91c2e842e4076a6b03", - "dependencies": { - "jwa": "^1.4.1", - "safe-buffer": "^5.0.1" - }, - "devDependencies": { - "semver": "^5.1.0", - "tape": "~2.14.0" - } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/jsonwebtoken/node_modules/jws/readme.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/jsonwebtoken/node_modules/jws/readme.md deleted file mode 100644 index 1910c9a8..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/jsonwebtoken/node_modules/jws/readme.md +++ /dev/null @@ -1,255 +0,0 @@ -# node-jws [![Build Status](https://secure.travis-ci.org/brianloveswords/node-jws.png)](http://travis-ci.org/brianloveswords/node-jws) - -An implementation of [JSON Web Signatures](http://self-issued.info/docs/draft-ietf-jose-json-web-signature.html). - -This was developed against `draft-ietf-jose-json-web-signature-08` and -implements the entire spec **except** X.509 Certificate Chain -signing/verifying (patches welcome). - -There are both synchronous (`jws.sign`, `jws.verify`) and streaming -(`jws.createSign`, `jws.createVerify`) APIs. - -# Install - -```bash -$ npm install jws -``` - -# Usage - -## jws.ALGORITHMS - -Array of supported algorithms. The following algorithms are currently supported. - -alg Parameter Value | Digital Signature or MAC Algorithm -----------------|---------------------------- -HS256 | HMAC using SHA-256 hash algorithm -HS384 | HMAC using SHA-384 hash algorithm -HS512 | HMAC using SHA-512 hash algorithm -RS256 | RSASSA using SHA-256 hash algorithm -RS384 | RSASSA using SHA-384 hash algorithm -RS512 | RSASSA using SHA-512 hash algorithm -PS256 | RSASSA-PSS using SHA-256 hash algorithm -PS384 | RSASSA-PSS using SHA-384 hash algorithm -PS512 | RSASSA-PSS using SHA-512 hash algorithm -ES256 | ECDSA using P-256 curve and SHA-256 hash algorithm -ES384 | ECDSA using P-384 curve and SHA-384 hash algorithm -ES512 | ECDSA using P-521 curve and SHA-512 hash algorithm -none | No digital signature or MAC value included - -## jws.sign(options) - -(Synchronous) Return a JSON Web Signature for a header and a payload. - -Options: - -* `header` -* `payload` -* `secret` or `privateKey` -* `encoding` (Optional, defaults to 'utf8') - -`header` must be an object with an `alg` property. `header.alg` must be -one a value found in `jws.ALGORITHMS`. See above for a table of -supported algorithms. - -If `payload` is not a buffer or a string, it will be coerced into a string -using `JSON.stringify`. - -Example - -```js -const signature = jws.sign({ - header: { alg: 'HS256' }, - payload: 'h. jon benjamin', - secret: 'has a van', -}); -``` - -## jws.verify(signature, algorithm, secretOrKey) - -(Synchronous) Returns `true` or `false` for whether a signature matches a -secret or key. - -`signature` is a JWS Signature. `header.alg` must be a value found in `jws.ALGORITHMS`. -See above for a table of supported algorithms. `secretOrKey` is a string or -buffer containing either the secret for HMAC algorithms, or the PEM -encoded public key for RSA and ECDSA. - -Note that the `"alg"` value from the signature header is ignored. - - -## jws.decode(signature) - -(Synchronous) Returns the decoded header, decoded payload, and signature -parts of the JWS Signature. - -Returns an object with three properties, e.g. -```js -{ header: { alg: 'HS256' }, - payload: 'h. jon benjamin', - signature: 'YOWPewyGHKu4Y_0M_vtlEnNlqmFOclqp4Hy6hVHfFT4' -} -``` - -## jws.createSign(options) - -Returns a new SignStream object. - -Options: - -* `header` (required) -* `payload` -* `key` || `privateKey` || `secret` -* `encoding` (Optional, defaults to 'utf8') - -Other than `header`, all options expect a string or a buffer when the -value is known ahead of time, or a stream for convenience. -`key`/`privateKey`/`secret` may also be an object when using an encrypted -private key, see the [crypto documentation][encrypted-key-docs]. - -Example: - -```js - -// This... -jws.createSign({ - header: { alg: 'RS256' }, - privateKey: privateKeyStream, - payload: payloadStream, -}).on('done', function(signature) { - // ... -}); - -// is equivalent to this: -const signer = jws.createSign({ - header: { alg: 'RS256' }, -}); -privateKeyStream.pipe(signer.privateKey); -payloadStream.pipe(signer.payload); -signer.on('done', function(signature) { - // ... -}); -``` - -## jws.createVerify(options) - -Returns a new VerifyStream object. - -Options: - -* `signature` -* `algorithm` -* `key` || `publicKey` || `secret` -* `encoding` (Optional, defaults to 'utf8') - -All options expect a string or a buffer when the value is known ahead of -time, or a stream for convenience. - -Example: - -```js - -// This... -jws.createVerify({ - publicKey: pubKeyStream, - signature: sigStream, -}).on('done', function(verified, obj) { - // ... -}); - -// is equivilant to this: -const verifier = jws.createVerify(); -pubKeyStream.pipe(verifier.publicKey); -sigStream.pipe(verifier.signature); -verifier.on('done', function(verified, obj) { - // ... -}); -``` - -## Class: SignStream - -A `Readable Stream` that emits a single data event (the calculated -signature) when done. - -### Event: 'done' -`function (signature) { }` - -### signer.payload - -A `Writable Stream` that expects the JWS payload. Do *not* use if you -passed a `payload` option to the constructor. - -Example: - -```js -payloadStream.pipe(signer.payload); -``` - -### signer.secret
signer.key
signer.privateKey - -A `Writable Stream`. Expects the JWS secret for HMAC, or the privateKey -for ECDSA and RSA. Do *not* use if you passed a `secret` or `key` option -to the constructor. - -Example: - -```js -privateKeyStream.pipe(signer.privateKey); -``` - -## Class: VerifyStream - -This is a `Readable Stream` that emits a single data event, the result -of whether or not that signature was valid. - -### Event: 'done' -`function (valid, obj) { }` - -`valid` is a boolean for whether or not the signature is valid. - -### verifier.signature - -A `Writable Stream` that expects a JWS Signature. Do *not* use if you -passed a `signature` option to the constructor. - -### verifier.secret
verifier.key
verifier.publicKey - -A `Writable Stream` that expects a public key or secret. Do *not* use if you -passed a `key` or `secret` option to the constructor. - -# TODO - -* It feels like there should be some convenience options/APIs for - defining the algorithm rather than having to define a header object - with `{ alg: 'ES512' }` or whatever every time. - -* X.509 support, ugh - -# License - -MIT - -``` -Copyright (c) 2013-2015 Brian J. Brennan - -Permission is hereby granted, free of charge, to any person obtaining a -copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -``` - -[encrypted-key-docs]: https://nodejs.org/api/crypto.html#crypto_sign_sign_private_key_output_format diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/jsonwebtoken/package.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/jsonwebtoken/package.json deleted file mode 100644 index 81d63da8..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/jsonwebtoken/package.json +++ /dev/null @@ -1,71 +0,0 @@ -{ - "name": "jsonwebtoken", - "version": "8.5.1", - "description": "JSON Web Token implementation (symmetric and asymmetric)", - "main": "index.js", - "nyc": { - "check-coverage": true, - "lines": 95, - "statements": 95, - "functions": 100, - "branches": 95, - "exclude": [ - "./test/**" - ], - "reporter": [ - "json", - "lcov", - "text-summary" - ] - }, - "scripts": { - "lint": "eslint .", - "coverage": "nyc mocha --use_strict", - "test": "npm run lint && npm run coverage && cost-of-modules" - }, - "repository": { - "type": "git", - "url": "https://github.com/auth0/node-jsonwebtoken" - }, - "keywords": [ - "jwt" - ], - "author": "auth0", - "license": "MIT", - "bugs": { - "url": "https://github.com/auth0/node-jsonwebtoken/issues" - }, - "dependencies": { - "jws": "^3.2.2", - "lodash.includes": "^4.3.0", - "lodash.isboolean": "^3.0.3", - "lodash.isinteger": "^4.0.4", - "lodash.isnumber": "^3.0.3", - "lodash.isplainobject": "^4.0.6", - "lodash.isstring": "^4.0.1", - "lodash.once": "^4.0.0", - "ms": "^2.1.1", - "semver": "^5.6.0" - }, - "devDependencies": { - "atob": "^2.1.2", - "chai": "^4.1.2", - "conventional-changelog": "~1.1.0", - "cost-of-modules": "^1.0.1", - "eslint": "^4.19.1", - "mocha": "^5.2.0", - "nsp": "^2.6.2", - "nyc": "^11.9.0", - "sinon": "^6.0.0" - }, - "engines": { - "npm": ">=1.4.28", - "node": ">=4" - }, - "files": [ - "lib", - "decode.js", - "sign.js", - "verify.js" - ] -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/jsonwebtoken/sign.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/jsonwebtoken/sign.js deleted file mode 100644 index f649ce4f..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/jsonwebtoken/sign.js +++ /dev/null @@ -1,206 +0,0 @@ -var timespan = require('./lib/timespan'); -var PS_SUPPORTED = require('./lib/psSupported'); -var jws = require('jws'); -var includes = require('lodash.includes'); -var isBoolean = require('lodash.isboolean'); -var isInteger = require('lodash.isinteger'); -var isNumber = require('lodash.isnumber'); -var isPlainObject = require('lodash.isplainobject'); -var isString = require('lodash.isstring'); -var once = require('lodash.once'); - -var SUPPORTED_ALGS = ['RS256', 'RS384', 'RS512', 'ES256', 'ES384', 'ES512', 'HS256', 'HS384', 'HS512', 'none'] -if (PS_SUPPORTED) { - SUPPORTED_ALGS.splice(3, 0, 'PS256', 'PS384', 'PS512'); -} - -var sign_options_schema = { - expiresIn: { isValid: function(value) { return isInteger(value) || (isString(value) && value); }, message: '"expiresIn" should be a number of seconds or string representing a timespan' }, - notBefore: { isValid: function(value) { return isInteger(value) || (isString(value) && value); }, message: '"notBefore" should be a number of seconds or string representing a timespan' }, - audience: { isValid: function(value) { return isString(value) || Array.isArray(value); }, message: '"audience" must be a string or array' }, - algorithm: { isValid: includes.bind(null, SUPPORTED_ALGS), message: '"algorithm" must be a valid string enum value' }, - header: { isValid: isPlainObject, message: '"header" must be an object' }, - encoding: { isValid: isString, message: '"encoding" must be a string' }, - issuer: { isValid: isString, message: '"issuer" must be a string' }, - subject: { isValid: isString, message: '"subject" must be a string' }, - jwtid: { isValid: isString, message: '"jwtid" must be a string' }, - noTimestamp: { isValid: isBoolean, message: '"noTimestamp" must be a boolean' }, - keyid: { isValid: isString, message: '"keyid" must be a string' }, - mutatePayload: { isValid: isBoolean, message: '"mutatePayload" must be a boolean' } -}; - -var registered_claims_schema = { - iat: { isValid: isNumber, message: '"iat" should be a number of seconds' }, - exp: { isValid: isNumber, message: '"exp" should be a number of seconds' }, - nbf: { isValid: isNumber, message: '"nbf" should be a number of seconds' } -}; - -function validate(schema, allowUnknown, object, parameterName) { - if (!isPlainObject(object)) { - throw new Error('Expected "' + parameterName + '" to be a plain object.'); - } - Object.keys(object) - .forEach(function(key) { - var validator = schema[key]; - if (!validator) { - if (!allowUnknown) { - throw new Error('"' + key + '" is not allowed in "' + parameterName + '"'); - } - return; - } - if (!validator.isValid(object[key])) { - throw new Error(validator.message); - } - }); -} - -function validateOptions(options) { - return validate(sign_options_schema, false, options, 'options'); -} - -function validatePayload(payload) { - return validate(registered_claims_schema, true, payload, 'payload'); -} - -var options_to_payload = { - 'audience': 'aud', - 'issuer': 'iss', - 'subject': 'sub', - 'jwtid': 'jti' -}; - -var options_for_objects = [ - 'expiresIn', - 'notBefore', - 'noTimestamp', - 'audience', - 'issuer', - 'subject', - 'jwtid', -]; - -module.exports = function (payload, secretOrPrivateKey, options, callback) { - if (typeof options === 'function') { - callback = options; - options = {}; - } else { - options = options || {}; - } - - var isObjectPayload = typeof payload === 'object' && - !Buffer.isBuffer(payload); - - var header = Object.assign({ - alg: options.algorithm || 'HS256', - typ: isObjectPayload ? 'JWT' : undefined, - kid: options.keyid - }, options.header); - - function failure(err) { - if (callback) { - return callback(err); - } - throw err; - } - - if (!secretOrPrivateKey && options.algorithm !== 'none') { - return failure(new Error('secretOrPrivateKey must have a value')); - } - - if (typeof payload === 'undefined') { - return failure(new Error('payload is required')); - } else if (isObjectPayload) { - try { - validatePayload(payload); - } - catch (error) { - return failure(error); - } - if (!options.mutatePayload) { - payload = Object.assign({},payload); - } - } else { - var invalid_options = options_for_objects.filter(function (opt) { - return typeof options[opt] !== 'undefined'; - }); - - if (invalid_options.length > 0) { - return failure(new Error('invalid ' + invalid_options.join(',') + ' option for ' + (typeof payload ) + ' payload')); - } - } - - if (typeof payload.exp !== 'undefined' && typeof options.expiresIn !== 'undefined') { - return failure(new Error('Bad "options.expiresIn" option the payload already has an "exp" property.')); - } - - if (typeof payload.nbf !== 'undefined' && typeof options.notBefore !== 'undefined') { - return failure(new Error('Bad "options.notBefore" option the payload already has an "nbf" property.')); - } - - try { - validateOptions(options); - } - catch (error) { - return failure(error); - } - - var timestamp = payload.iat || Math.floor(Date.now() / 1000); - - if (options.noTimestamp) { - delete payload.iat; - } else if (isObjectPayload) { - payload.iat = timestamp; - } - - if (typeof options.notBefore !== 'undefined') { - try { - payload.nbf = timespan(options.notBefore, timestamp); - } - catch (err) { - return failure(err); - } - if (typeof payload.nbf === 'undefined') { - return failure(new Error('"notBefore" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60')); - } - } - - if (typeof options.expiresIn !== 'undefined' && typeof payload === 'object') { - try { - payload.exp = timespan(options.expiresIn, timestamp); - } - catch (err) { - return failure(err); - } - if (typeof payload.exp === 'undefined') { - return failure(new Error('"expiresIn" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60')); - } - } - - Object.keys(options_to_payload).forEach(function (key) { - var claim = options_to_payload[key]; - if (typeof options[key] !== 'undefined') { - if (typeof payload[claim] !== 'undefined') { - return failure(new Error('Bad "options.' + key + '" option. The payload already has an "' + claim + '" property.')); - } - payload[claim] = options[key]; - } - }); - - var encoding = options.encoding || 'utf8'; - - if (typeof callback === 'function') { - callback = callback && once(callback); - - jws.createSign({ - header: header, - privateKey: secretOrPrivateKey, - payload: payload, - encoding: encoding - }).once('error', callback) - .once('done', function (signature) { - callback(null, signature); - }); - } else { - return jws.sign({header: header, payload: payload, secret: secretOrPrivateKey, encoding: encoding}); - } -}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/jsonwebtoken/verify.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/jsonwebtoken/verify.js deleted file mode 100644 index 1df99f8d..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/jsonwebtoken/verify.js +++ /dev/null @@ -1,225 +0,0 @@ -var JsonWebTokenError = require('./lib/JsonWebTokenError'); -var NotBeforeError = require('./lib/NotBeforeError'); -var TokenExpiredError = require('./lib/TokenExpiredError'); -var decode = require('./decode'); -var timespan = require('./lib/timespan'); -var PS_SUPPORTED = require('./lib/psSupported'); -var jws = require('jws'); - -var PUB_KEY_ALGS = ['RS256', 'RS384', 'RS512', 'ES256', 'ES384', 'ES512']; -var RSA_KEY_ALGS = ['RS256', 'RS384', 'RS512']; -var HS_ALGS = ['HS256', 'HS384', 'HS512']; - -if (PS_SUPPORTED) { - PUB_KEY_ALGS.splice(3, 0, 'PS256', 'PS384', 'PS512'); - RSA_KEY_ALGS.splice(3, 0, 'PS256', 'PS384', 'PS512'); -} - -module.exports = function (jwtString, secretOrPublicKey, options, callback) { - if ((typeof options === 'function') && !callback) { - callback = options; - options = {}; - } - - if (!options) { - options = {}; - } - - //clone this object since we are going to mutate it. - options = Object.assign({}, options); - - var done; - - if (callback) { - done = callback; - } else { - done = function(err, data) { - if (err) throw err; - return data; - }; - } - - if (options.clockTimestamp && typeof options.clockTimestamp !== 'number') { - return done(new JsonWebTokenError('clockTimestamp must be a number')); - } - - if (options.nonce !== undefined && (typeof options.nonce !== 'string' || options.nonce.trim() === '')) { - return done(new JsonWebTokenError('nonce must be a non-empty string')); - } - - var clockTimestamp = options.clockTimestamp || Math.floor(Date.now() / 1000); - - if (!jwtString){ - return done(new JsonWebTokenError('jwt must be provided')); - } - - if (typeof jwtString !== 'string') { - return done(new JsonWebTokenError('jwt must be a string')); - } - - var parts = jwtString.split('.'); - - if (parts.length !== 3){ - return done(new JsonWebTokenError('jwt malformed')); - } - - var decodedToken; - - try { - decodedToken = decode(jwtString, { complete: true }); - } catch(err) { - return done(err); - } - - if (!decodedToken) { - return done(new JsonWebTokenError('invalid token')); - } - - var header = decodedToken.header; - var getSecret; - - if(typeof secretOrPublicKey === 'function') { - if(!callback) { - return done(new JsonWebTokenError('verify must be called asynchronous if secret or public key is provided as a callback')); - } - - getSecret = secretOrPublicKey; - } - else { - getSecret = function(header, secretCallback) { - return secretCallback(null, secretOrPublicKey); - }; - } - - return getSecret(header, function(err, secretOrPublicKey) { - if(err) { - return done(new JsonWebTokenError('error in secret or public key callback: ' + err.message)); - } - - var hasSignature = parts[2].trim() !== ''; - - if (!hasSignature && secretOrPublicKey){ - return done(new JsonWebTokenError('jwt signature is required')); - } - - if (hasSignature && !secretOrPublicKey) { - return done(new JsonWebTokenError('secret or public key must be provided')); - } - - if (!hasSignature && !options.algorithms) { - options.algorithms = ['none']; - } - - if (!options.algorithms) { - options.algorithms = ~secretOrPublicKey.toString().indexOf('BEGIN CERTIFICATE') || - ~secretOrPublicKey.toString().indexOf('BEGIN PUBLIC KEY') ? PUB_KEY_ALGS : - ~secretOrPublicKey.toString().indexOf('BEGIN RSA PUBLIC KEY') ? RSA_KEY_ALGS : HS_ALGS; - - } - - if (!~options.algorithms.indexOf(decodedToken.header.alg)) { - return done(new JsonWebTokenError('invalid algorithm')); - } - - var valid; - - try { - valid = jws.verify(jwtString, decodedToken.header.alg, secretOrPublicKey); - } catch (e) { - return done(e); - } - - if (!valid) { - return done(new JsonWebTokenError('invalid signature')); - } - - var payload = decodedToken.payload; - - if (typeof payload.nbf !== 'undefined' && !options.ignoreNotBefore) { - if (typeof payload.nbf !== 'number') { - return done(new JsonWebTokenError('invalid nbf value')); - } - if (payload.nbf > clockTimestamp + (options.clockTolerance || 0)) { - return done(new NotBeforeError('jwt not active', new Date(payload.nbf * 1000))); - } - } - - if (typeof payload.exp !== 'undefined' && !options.ignoreExpiration) { - if (typeof payload.exp !== 'number') { - return done(new JsonWebTokenError('invalid exp value')); - } - if (clockTimestamp >= payload.exp + (options.clockTolerance || 0)) { - return done(new TokenExpiredError('jwt expired', new Date(payload.exp * 1000))); - } - } - - if (options.audience) { - var audiences = Array.isArray(options.audience) ? options.audience : [options.audience]; - var target = Array.isArray(payload.aud) ? payload.aud : [payload.aud]; - - var match = target.some(function (targetAudience) { - return audiences.some(function (audience) { - return audience instanceof RegExp ? audience.test(targetAudience) : audience === targetAudience; - }); - }); - - if (!match) { - return done(new JsonWebTokenError('jwt audience invalid. expected: ' + audiences.join(' or '))); - } - } - - if (options.issuer) { - var invalid_issuer = - (typeof options.issuer === 'string' && payload.iss !== options.issuer) || - (Array.isArray(options.issuer) && options.issuer.indexOf(payload.iss) === -1); - - if (invalid_issuer) { - return done(new JsonWebTokenError('jwt issuer invalid. expected: ' + options.issuer)); - } - } - - if (options.subject) { - if (payload.sub !== options.subject) { - return done(new JsonWebTokenError('jwt subject invalid. expected: ' + options.subject)); - } - } - - if (options.jwtid) { - if (payload.jti !== options.jwtid) { - return done(new JsonWebTokenError('jwt jwtid invalid. expected: ' + options.jwtid)); - } - } - - if (options.nonce) { - if (payload.nonce !== options.nonce) { - return done(new JsonWebTokenError('jwt nonce invalid. expected: ' + options.nonce)); - } - } - - if (options.maxAge) { - if (typeof payload.iat !== 'number') { - return done(new JsonWebTokenError('iat required when maxAge is specified')); - } - - var maxAgeTimestamp = timespan(options.maxAge, payload.iat); - if (typeof maxAgeTimestamp === 'undefined') { - return done(new JsonWebTokenError('"maxAge" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60')); - } - if (clockTimestamp >= maxAgeTimestamp + (options.clockTolerance || 0)) { - return done(new TokenExpiredError('maxAge exceeded', new Date(maxAgeTimestamp * 1000))); - } - } - - if (options.complete === true) { - var signature = decodedToken.signature; - - return done(null, { - header: header, - payload: payload, - signature: signature - }); - } - - return done(null, payload); - }); -}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/jwa/LICENSE b/packages/wyatt_notification_bloc/example/scripts/node_modules/jwa/LICENSE deleted file mode 100644 index caeb8495..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/jwa/LICENSE +++ /dev/null @@ -1,17 +0,0 @@ -Copyright (c) 2013 Brian J. Brennan - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to use, -copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the -Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/jwa/README.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/jwa/README.md deleted file mode 100644 index 09e96485..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/jwa/README.md +++ /dev/null @@ -1,150 +0,0 @@ -# node-jwa [![Build Status](https://travis-ci.org/brianloveswords/node-jwa.svg?branch=master)](https://travis-ci.org/brianloveswords/node-jwa) - -A -[JSON Web Algorithms](http://tools.ietf.org/id/draft-ietf-jose-json-web-algorithms-08.html) -implementation focusing (exclusively, at this point) on the algorithms necessary for -[JSON Web Signatures](http://self-issued.info/docs/draft-ietf-jose-json-web-signature.html). - -This library supports all of the required, recommended and optional cryptographic algorithms for JWS: - -alg Parameter Value | Digital Signature or MAC Algorithm -----------------|---------------------------- -HS256 | HMAC using SHA-256 hash algorithm -HS384 | HMAC using SHA-384 hash algorithm -HS512 | HMAC using SHA-512 hash algorithm -RS256 | RSASSA using SHA-256 hash algorithm -RS384 | RSASSA using SHA-384 hash algorithm -RS512 | RSASSA using SHA-512 hash algorithm -PS256 | RSASSA-PSS using SHA-256 hash algorithm -PS384 | RSASSA-PSS using SHA-384 hash algorithm -PS512 | RSASSA-PSS using SHA-512 hash algorithm -ES256 | ECDSA using P-256 curve and SHA-256 hash algorithm -ES384 | ECDSA using P-384 curve and SHA-384 hash algorithm -ES512 | ECDSA using P-521 curve and SHA-512 hash algorithm -none | No digital signature or MAC value included - -Please note that PS* only works on Node 6.12+ (excluding 7.x). - -# Requirements - -In order to run the tests, a recent version of OpenSSL is -required. **The version that comes with OS X (OpenSSL 0.9.8r 8 Feb -2011) is not recent enough**, as it does not fully support ECDSA -keys. You'll need to use a version > 1.0.0; I tested with OpenSSL 1.0.1c 10 May 2012. - -# Testing - -To run the tests, do - -```bash -$ npm test -``` - -This will generate a bunch of keypairs to use in testing. If you want to -generate new keypairs, do `make clean` before running `npm test` again. - -## Methodology - -I spawn `openssl dgst -sign` to test OpenSSL sign → JS verify and -`openssl dgst -verify` to test JS sign → OpenSSL verify for each of the -RSA and ECDSA algorithms. - -# Usage - -## jwa(algorithm) - -Creates a new `jwa` object with `sign` and `verify` methods for the -algorithm. Valid values for algorithm can be found in the table above -(`'HS256'`, `'HS384'`, etc) and are case-sensitive. Passing an invalid -algorithm value will throw a `TypeError`. - - -## jwa#sign(input, secretOrPrivateKey) - -Sign some input with either a secret for HMAC algorithms, or a private -key for RSA and ECDSA algorithms. - -If input is not already a string or buffer, `JSON.stringify` will be -called on it to attempt to coerce it. - -For the HMAC algorithm, `secretOrPrivateKey` should be a string or a -buffer. For ECDSA and RSA, the value should be a string representing a -PEM encoded **private** key. - -Output [base64url](http://en.wikipedia.org/wiki/Base64#URL_applications) -formatted. This is for convenience as JWS expects the signature in this -format. If your application needs the output in a different format, -[please open an issue](https://github.com/brianloveswords/node-jwa/issues). In -the meantime, you can use -[brianloveswords/base64url](https://github.com/brianloveswords/base64url) -to decode the signature. - -As of nodejs *v0.11.8*, SPKAC support was introduce. If your nodeJs -version satisfies, then you can pass an object `{ key: '..', passphrase: '...' }` - - -## jwa#verify(input, signature, secretOrPublicKey) - -Verify a signature. Returns `true` or `false`. - -`signature` should be a base64url encoded string. - -For the HMAC algorithm, `secretOrPublicKey` should be a string or a -buffer. For ECDSA and RSA, the value should be a string represented a -PEM encoded **public** key. - - -# Example - -HMAC -```js -const jwa = require('jwa'); - -const hmac = jwa('HS256'); -const input = 'super important stuff'; -const secret = 'shhhhhh'; - -const signature = hmac.sign(input, secret); -hmac.verify(input, signature, secret) // === true -hmac.verify(input, signature, 'trickery!') // === false -``` - -With keys -```js -const fs = require('fs'); -const jwa = require('jwa'); -const privateKey = fs.readFileSync(__dirname + '/ecdsa-p521-private.pem'); -const publicKey = fs.readFileSync(__dirname + '/ecdsa-p521-public.pem'); - -const ecdsa = jwa('ES512'); -const input = 'very important stuff'; - -const signature = ecdsa.sign(input, privateKey); -ecdsa.verify(input, signature, publicKey) // === true -``` -## License - -MIT - -``` -Copyright (c) 2013 Brian J. Brennan - -Permission is hereby granted, free of charge, to any person obtaining a -copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -``` diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/jwa/index.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/jwa/index.js deleted file mode 100644 index d2061efc..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/jwa/index.js +++ /dev/null @@ -1,252 +0,0 @@ -var bufferEqual = require('buffer-equal-constant-time'); -var Buffer = require('safe-buffer').Buffer; -var crypto = require('crypto'); -var formatEcdsa = require('ecdsa-sig-formatter'); -var util = require('util'); - -var MSG_INVALID_ALGORITHM = '"%s" is not a valid algorithm.\n Supported algorithms are:\n "HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "PS256", "PS384", "PS512", "ES256", "ES384", "ES512" and "none".' -var MSG_INVALID_SECRET = 'secret must be a string or buffer'; -var MSG_INVALID_VERIFIER_KEY = 'key must be a string or a buffer'; -var MSG_INVALID_SIGNER_KEY = 'key must be a string, a buffer or an object'; - -var supportsKeyObjects = typeof crypto.createPublicKey === 'function'; -if (supportsKeyObjects) { - MSG_INVALID_VERIFIER_KEY += ' or a KeyObject'; - MSG_INVALID_SECRET += 'or a KeyObject'; -} - -function checkIsPublicKey(key) { - if (Buffer.isBuffer(key)) { - return; - } - - if (typeof key === 'string') { - return; - } - - if (!supportsKeyObjects) { - throw typeError(MSG_INVALID_VERIFIER_KEY); - } - - if (typeof key !== 'object') { - throw typeError(MSG_INVALID_VERIFIER_KEY); - } - - if (typeof key.type !== 'string') { - throw typeError(MSG_INVALID_VERIFIER_KEY); - } - - if (typeof key.asymmetricKeyType !== 'string') { - throw typeError(MSG_INVALID_VERIFIER_KEY); - } - - if (typeof key.export !== 'function') { - throw typeError(MSG_INVALID_VERIFIER_KEY); - } -}; - -function checkIsPrivateKey(key) { - if (Buffer.isBuffer(key)) { - return; - } - - if (typeof key === 'string') { - return; - } - - if (typeof key === 'object') { - return; - } - - throw typeError(MSG_INVALID_SIGNER_KEY); -}; - -function checkIsSecretKey(key) { - if (Buffer.isBuffer(key)) { - return; - } - - if (typeof key === 'string') { - return key; - } - - if (!supportsKeyObjects) { - throw typeError(MSG_INVALID_SECRET); - } - - if (typeof key !== 'object') { - throw typeError(MSG_INVALID_SECRET); - } - - if (key.type !== 'secret') { - throw typeError(MSG_INVALID_SECRET); - } - - if (typeof key.export !== 'function') { - throw typeError(MSG_INVALID_SECRET); - } -} - -function fromBase64(base64) { - return base64 - .replace(/=/g, '') - .replace(/\+/g, '-') - .replace(/\//g, '_'); -} - -function toBase64(base64url) { - base64url = base64url.toString(); - - var padding = 4 - base64url.length % 4; - if (padding !== 4) { - for (var i = 0; i < padding; ++i) { - base64url += '='; - } - } - - return base64url - .replace(/\-/g, '+') - .replace(/_/g, '/'); -} - -function typeError(template) { - var args = [].slice.call(arguments, 1); - var errMsg = util.format.bind(util, template).apply(null, args); - return new TypeError(errMsg); -} - -function bufferOrString(obj) { - return Buffer.isBuffer(obj) || typeof obj === 'string'; -} - -function normalizeInput(thing) { - if (!bufferOrString(thing)) - thing = JSON.stringify(thing); - return thing; -} - -function createHmacSigner(bits) { - return function sign(thing, secret) { - checkIsSecretKey(secret); - thing = normalizeInput(thing); - var hmac = crypto.createHmac('sha' + bits, secret); - var sig = (hmac.update(thing), hmac.digest('base64')) - return fromBase64(sig); - } -} - -function createHmacVerifier(bits) { - return function verify(thing, signature, secret) { - var computedSig = createHmacSigner(bits)(thing, secret); - return bufferEqual(Buffer.from(signature), Buffer.from(computedSig)); - } -} - -function createKeySigner(bits) { - return function sign(thing, privateKey) { - checkIsPrivateKey(privateKey); - thing = normalizeInput(thing); - // Even though we are specifying "RSA" here, this works with ECDSA - // keys as well. - var signer = crypto.createSign('RSA-SHA' + bits); - var sig = (signer.update(thing), signer.sign(privateKey, 'base64')); - return fromBase64(sig); - } -} - -function createKeyVerifier(bits) { - return function verify(thing, signature, publicKey) { - checkIsPublicKey(publicKey); - thing = normalizeInput(thing); - signature = toBase64(signature); - var verifier = crypto.createVerify('RSA-SHA' + bits); - verifier.update(thing); - return verifier.verify(publicKey, signature, 'base64'); - } -} - -function createPSSKeySigner(bits) { - return function sign(thing, privateKey) { - checkIsPrivateKey(privateKey); - thing = normalizeInput(thing); - var signer = crypto.createSign('RSA-SHA' + bits); - var sig = (signer.update(thing), signer.sign({ - key: privateKey, - padding: crypto.constants.RSA_PKCS1_PSS_PADDING, - saltLength: crypto.constants.RSA_PSS_SALTLEN_DIGEST - }, 'base64')); - return fromBase64(sig); - } -} - -function createPSSKeyVerifier(bits) { - return function verify(thing, signature, publicKey) { - checkIsPublicKey(publicKey); - thing = normalizeInput(thing); - signature = toBase64(signature); - var verifier = crypto.createVerify('RSA-SHA' + bits); - verifier.update(thing); - return verifier.verify({ - key: publicKey, - padding: crypto.constants.RSA_PKCS1_PSS_PADDING, - saltLength: crypto.constants.RSA_PSS_SALTLEN_DIGEST - }, signature, 'base64'); - } -} - -function createECDSASigner(bits) { - var inner = createKeySigner(bits); - return function sign() { - var signature = inner.apply(null, arguments); - signature = formatEcdsa.derToJose(signature, 'ES' + bits); - return signature; - }; -} - -function createECDSAVerifer(bits) { - var inner = createKeyVerifier(bits); - return function verify(thing, signature, publicKey) { - signature = formatEcdsa.joseToDer(signature, 'ES' + bits).toString('base64'); - var result = inner(thing, signature, publicKey); - return result; - }; -} - -function createNoneSigner() { - return function sign() { - return ''; - } -} - -function createNoneVerifier() { - return function verify(thing, signature) { - return signature === ''; - } -} - -module.exports = function jwa(algorithm) { - var signerFactories = { - hs: createHmacSigner, - rs: createKeySigner, - ps: createPSSKeySigner, - es: createECDSASigner, - none: createNoneSigner, - } - var verifierFactories = { - hs: createHmacVerifier, - rs: createKeyVerifier, - ps: createPSSKeyVerifier, - es: createECDSAVerifer, - none: createNoneVerifier, - } - var match = algorithm.match(/^(RS|PS|ES|HS)(256|384|512)$|^(none)$/); - if (!match) - throw typeError(MSG_INVALID_ALGORITHM, algorithm); - var algo = (match[1] || match[3]).toLowerCase(); - var bits = match[2]; - - return { - sign: signerFactories[algo](bits), - verify: verifierFactories[algo](bits), - } -}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/jwa/package.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/jwa/package.json deleted file mode 100644 index 7b3d5e56..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/jwa/package.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "name": "jwa", - "version": "2.0.0", - "description": "JWA implementation (supports all JWS algorithms)", - "main": "index.js", - "directories": { - "test": "test" - }, - "dependencies": { - "buffer-equal-constant-time": "1.0.1", - "ecdsa-sig-formatter": "1.0.11", - "safe-buffer": "^5.0.1" - }, - "devDependencies": { - "base64url": "^2.0.0", - "jwk-to-pem": "^2.0.1", - "semver": "4.3.6", - "tap": "6.2.0" - }, - "scripts": { - "test": "make test" - }, - "repository": { - "type": "git", - "url": "git://github.com/brianloveswords/node-jwa.git" - }, - "keywords": [ - "jwa", - "jws", - "jwt", - "rsa", - "ecdsa", - "hmac" - ], - "author": "Brian J. Brennan ", - "license": "MIT" -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/jwks-rsa/LICENSE b/packages/wyatt_notification_bloc/example/scripts/node_modules/jwks-rsa/LICENSE deleted file mode 100644 index 006c80b5..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/jwks-rsa/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2016 Sandrino Di Mattia - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/jwks-rsa/README.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/jwks-rsa/README.md deleted file mode 100644 index dd1a151a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/jwks-rsa/README.md +++ /dev/null @@ -1,171 +0,0 @@ -# jwks-rsa - -[![CircleCI][circle-image]][circle-url] -[![codecov][codecov-image]][codecov-url] -[![NPM version][npm-image]][npm-url] -[![License][license-image]][license-url] -[![Downloads][downloads-image]][downloads-url] -[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fauth0%2Fnode-jwks-rsa.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2Fauth0%2Fnode-jwks-rsa?ref=badge_shield) - -A library to retrieve signing keys from a JWKS (JSON Web Key Set) endpoint. - -> npm install --save jwks-rsa - -Supports all currently registered JWK types and JWS Algorithms, see [panva/jose#262](https://github.com/panva/jose/issues/262) for more information. - -## Usage - -You'll provide the client with the JWKS endpoint which exposes your signing keys. Using the `getSigningKey` you can then get the signing key that matches a specific `kid`. - -```js -const jwksClient = require('jwks-rsa'); - -const client = jwksClient({ - jwksUri: 'https://sandrino.auth0.com/.well-known/jwks.json', - requestHeaders: {}, // Optional - timeout: 30000 // Defaults to 30s -}); - -const kid = 'RkI5MjI5OUY5ODc1N0Q4QzM0OUYzNkVGMTJDOUEzQkFCOTU3NjE2Rg'; -const key = await client.getSigningKey(kid); -const signingKey = key.getPublicKey(); -``` - -### Integrations - - - [express/express-jwt](examples/express-demo) - - [express/passport-jwt](examples/passport-demo) - - [hapi/hapi-auth-jwt2](examples/hapi-demo) - - [koa/koa-jwt](examples/koa-demo) - -### API - -#### JwksClient Options - -- `jwksUri`: a string that represents the JWKS URI -- `timeout = 30000`: (_optional_) an integer in miliseconds that controls the request timeout -- `cache = true`: (_optional_) enables a LRU Cache [(details)](#caching) -- `rateLimit`: (_optional_) the default fetcher function [(details)](#rate-limiting) -- `fetcher`: (_optional_) a Promise returning function to fetch data from the JWKS URI -- `requestHeaders`: (_optional_) an object of headers to pass to the request -- `requestAgent`: (_optional_) a Node `http.Agent` to be passed to the http(s) request -- `getKeysInterceptor`: (_optional_) a promise returning function hook [(details)](#loading-keys-from-local-file-environment-variable-or-other-externals) -- `cacheMaxAge`: (_optional_) the duration for which to store a cached JWKS in ms (default 600,000 or 10 minutes) -- `jwksRequestsPerMinute`: (_optional_) max number of requests allowed to the JWKS URI per minute (defaults to 10) - -### Caching - -By default, signing key verification results are cached in order to prevent excessive HTTP requests to the JWKS endpoint. If a signing key matching the `kid` is found, this will be cached and the next time this `kid` is requested the signing key will be served from the cache. The caching behavior can be configured as seen below: - -```js -const jwksClient = require('jwks-rsa'); - -const client = jwksClient({ - cache: true, // Default Value - cacheMaxEntries: 5, // Default value - cacheMaxAge: 600000, // Defaults to 10m - jwksUri: 'https://sandrino.auth0.com/.well-known/jwks.json' -}); - -const kid = 'RkI5MjI5OUY5ODc1N0Q4QzM0OUYzNkVGMTJDOUEzQkFCOTU3NjE2Rg'; -const key = await client.getSigningKey(kid); -const signingKey = key.getPublicKey(); -``` - -### Rate Limiting - -Even if caching is enabled the library will call the JWKS endpoint if the `kid` is not available in the cache, because a key rotation could have taken place. To prevent attackers to send many random `kid`s you can also configure rate limiting. This will allow you to limit the number of calls that are made to the JWKS endpoint per minute (because it would be highly unlikely that signing keys are rotated multiple times per minute). - -```js -const jwksClient = require('jwks-rsa'); - -const client = jwksClient({ - rateLimit: true, - jwksRequestsPerMinute: 10, // Default value - jwksUri: 'https://sandrino.auth0.com/.well-known/jwks.json' -}); - -const kid = 'RkI5MjI5OUY5ODc1N0Q4QzM0OUYzNkVGMTJDOUEzQkFCOTU3NjE2Rg'; -const key = await client.getSigningKey(kid); -const signingKey = key.getPublicKey(); -``` - -### Using Request Agent for TLS/SSL Configuration - -The `requestAgent` property can be used to configure SSL/TLS options. An -example use case is providing a trusted private (i.e. enterprise/corporate) root -certificate authority to establish TLS communication with the `jwks_uri`. - -```js -const jwksClient = require("jwks-rsa"); -const https = require('https'); -const client = jwksClient({ - jwksUri: 'https://my-enterprise-id-provider/.well-known/jwks.json', - requestHeaders: {}, // Optional - requestAgent: new https.Agent({ - ca: fs.readFileSync(caFile) - }) -}); -``` - -### Proxy configuration - -You can configure a proxy with using a [custom http(s) agent](https://github.com/TooTallNate/node-https-proxy-agent) in the `requestAgent` option. - -### Loading keys from local file, environment variable, or other externals - -The `getKeysInterceptor` property can be used to fetch keys before sending a request to the `jwksUri` endpoint. This can be helpful when wanting to load keys from a file, env variable, or an external cache. If a KID cannot be found in the keys returned from the interceptor, it will fallback to the `jwksUri` endpoint. This property will continue to work with the provided LRU cache, if the cache is enabled. - -```js - const client = new JwksClient({ - jwksUri: 'https://my-enterprise-id-provider/.well-known/jwks.json', - getKeysInterceptor: () => { - const file = fs.readFileSync(jwksFile); - return file.keys; - } - }); -``` - -## Running Tests - -``` -npm run test -``` - -## Showing Trace Logs - -To show trace logs you can set the following environment variable: - -``` -DEBUG=jwks -``` - -Output: - -``` -jwks Retrieving keys from http://my-authz-server/.well-known/jwks.json +5ms -jwks Keys: +8ms [ { alg: 'RS256', - kty: 'RSA', - use: 'sig', - x5c: [ 'pk1' ], - kid: 'ABC' }, -{ alg: 'RS256', kty: 'RSA', use: 'sig', x5c: [], kid: '123' } ] -``` - -## License - -This project is licensed under the MIT license. See the [LICENSE](LICENSE) file for more info. - -[circle-image]: https://img.shields.io/circleci/build/github/auth0/node-jwks-rsa/master?style=flat-square -[circle-url]: https://circleci.com/gh/auth0/node-jwks-rsa/tree/master -[codecov-image]: https://img.shields.io/codecov/c/github/auth0/node-jwks-rsa?style=flat-square -[codecov-url]: https://codecov.io/gh/auth0/node-jwks-rsa -[npm-image]: https://img.shields.io/npm/v/jwks-rsa.svg?style=flat-square -[npm-url]: https://npmjs.org/package/jwks-rsa -[license-image]: http://img.shields.io/npm/l/jwks-rsa.svg?style=flat-square -[license-url]: #license -[downloads-image]: http://img.shields.io/npm/dm/jwks-rsa.svg?style=flat-square -[downloads-url]: https://npmjs.org/package/jwks-rsa - - -[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fauth0%2Fnode-jwks-rsa.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2Fauth0%2Fnode-jwks-rsa?ref=badge_large) diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/jwks-rsa/index.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/jwks-rsa/index.d.ts deleted file mode 100644 index 652f98b8..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/jwks-rsa/index.d.ts +++ /dev/null @@ -1,130 +0,0 @@ -import { Agent as HttpAgent } from 'http'; -import { Agent as HttpsAgent } from 'https'; -import type {Jwt, Secret} from 'jsonwebtoken' -import Express = require('express') - -declare function JwksRsa(options: JwksRsa.Options): JwksRsa.JwksClient; - -declare namespace JwksRsa { - class JwksClient { - constructor(options: Options); - - getKeys(): Promise; - getSigningKeys(): Promise; - getSigningKey(kid?: string | null | undefined): Promise; - getSigningKey(kid: string | null | undefined, cb: (err: Error | null, key?: SigningKey) => void): void; - } - - interface Headers { - [key: string]: string; - } - - interface Options { - jwksUri: string; - rateLimit?: boolean; - cache?: boolean; - cacheMaxEntries?: number; - cacheMaxAge?: number; - jwksRequestsPerMinute?: number; - proxy?: string; - requestHeaders?: Headers; - timeout?: number; - requestAgent?: HttpAgent | HttpsAgent; - fetcher?(jwksUri: string): Promise<{ keys: any }>; - getKeysInterceptor?(): Promise; - } - - interface JSONWebKey { - kid: string, - alg: string, - [key: string]: any - } - - interface CertSigningKey { - kid: string; - alg: string; - getPublicKey(): string; - publicKey: string; - } - - interface RsaSigningKey { - kid: string; - alg: string; - getPublicKey(): string; - rsaPublicKey: string; - } - - type SigningKey = CertSigningKey | RsaSigningKey; - - /** - * Types are duplicated from express-jwt@6/7 - * due to numerous breaking changes in the lib's types - * whilst this lib supportd both <=6 & >=7 implementations - * - * express-jwt's installed version (or its @types) - * will be the types used at transpilation time - */ - - /** Types from express-jwt@<=6 */ - type secretType = string|Buffer; - type SecretCallbackLong = (req: Express.Request, header: any, payload: any, done: (err: any, secret?: secretType) => void) => void; - type SecretCallback = (req: Express.Request, payload: any, done: (err: any, secret?: secretType) => void) => void; - - /** Types from express-jwt@>=7 */ - type GetVerificationKey = (req: Express.Request, token: Jwt | undefined) => Secret | undefined | Promise; - - function expressJwtSecret(options: ExpressJwtOptions): SecretCallbackLong|GetVerificationKey; - - function passportJwtSecret(options: ExpressJwtOptions): SecretCallback; - - interface ExpressJwtOptions extends Options { - handleSigningKeyError?: (err: Error | null, cb: (err: Error | null) => void) => void; - } - - function hapiJwt2Key(options: HapiJwtOptions): (decodedToken: DecodedToken, cb: HapiCallback) => void; - - interface HapiJwtOptions extends Options { - handleSigningKeyError?: (err: Error | null, cb: HapiCallback) => void; - } - - type HapiCallback = (err: Error | null, publicKey: string, signingKey: SigningKey) => void; - - interface DecodedToken { - header: TokenHeader; - } - - interface TokenHeader { - alg: string; - kid: string; - } - - function hapiJwt2KeyAsync(options: HapiJwtOptions): (decodedToken: DecodedToken) => Promise<{ key: string }>; - - function koaJwtSecret(options: KoaJwtOptions): (header: TokenHeader) => Promise; - - interface KoaJwtOptions extends Options { - handleSigningKeyError?(err: Error | null): Promise; - } - - class ArgumentError extends Error { - name: 'ArgumentError'; - constructor(message: string); - } - - class JwksError extends Error { - name: 'JwksError'; - constructor(message: string); - } - - class JwksRateLimitError extends Error { - name: 'JwksRateLimitError'; - constructor(message: string); - } - - class SigningKeyNotFoundError extends Error { - name: 'SigningKeyNotFoundError'; - constructor(message: string); - } -} - -export = JwksRsa; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/jwks-rsa/package.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/jwks-rsa/package.json deleted file mode 100644 index 4169c2dc..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/jwks-rsa/package.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "name": "jwks-rsa", - "version": "2.1.5", - "description": "Library to retrieve RSA public keys from a JWKS endpoint", - "main": "src/index.js", - "files": [ - "src", - "index.d.ts" - ], - "types": "index.d.ts", - "engines": { - "node": ">=10 < 13 || >=14" - }, - "dependencies": { - "@types/express": "^4.17.14", - "@types/jsonwebtoken": "^8.5.9", - "debug": "^4.3.4", - "jose": "^2.0.6", - "limiter": "^1.1.5", - "lru-memoizer": "^2.1.4" - }, - "devDependencies": { - "@types/chai": "^4.2.11", - "@types/express-jwt": "^6.0.4", - "@types/mocha": "^5.2.7", - "@types/nock": "^11.0.0", - "@types/node": "^14.14.12", - "chai": "^3.5.0", - "chai-as-promised": "^7.1.1", - "eslint": "^5.16.0", - "express": "^4.17.1", - "express-jwt": "^6.0.0", - "express-jwt-v7": "npm:express-jwt@^7.5.0", - "jsonwebtoken": "^8.5.1", - "koa": "^2.12.1", - "koa-jwt": "^3.6.0", - "mocha": "^6.2.3", - "nock": "^13.0.0", - "nyc": "^15.1.0", - "passport": "^0.6.0", - "passport-jwt": "^4.0.0", - "rimraf": "^2.7.1", - "supertest": "^3.4.2", - "ts-node": "^8.10.2", - "typescript": "^3.9.5" - }, - "scripts": { - "clean:ts": "rimraf ts-output/", - "lint": "eslint ./src ./tests", - "test:ts": "npm run clean:ts && tsc && NODE_ENV=test mocha --exit --timeout 5000 $(find ./ts-output -name *.tests.js)", - "test:js": "NODE_ENV=test mocha --exit --timeout 5000 $(find ./tests -name *.tests.js)", - "test": "npm run test:js && npm run test:ts", - "test:ci": "nyc --reporter=lcov npm test", - "test-watch": "NODE_ENV=test mocha --exit --timeout 5000 $(find ./tests -name *.tests.js) --watch", - "release": "git tag $npm_package_version && git push && git push --tags && npm publish" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/auth0/node-jwks-rsa.git" - }, - "keywords": [ - "jwks", - "rsa", - "jwt" - ], - "author": "Auth0", - "license": "MIT", - "bugs": { - "url": "https://github.com/auth0/node-jwks-rsa/issues" - }, - "homepage": "https://github.com/auth0/node-jwks-rsa#readme" -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/jwks-rsa/src/JwksClient.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/jwks-rsa/src/JwksClient.js deleted file mode 100644 index eef29fc0..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/jwks-rsa/src/JwksClient.js +++ /dev/null @@ -1,91 +0,0 @@ -const logger = require('debug')('jwks'); -const { retrieveSigningKeys } = require('./utils') ; -const { request, cacheSigningKey, rateLimitSigningKey, getKeysInterceptor, callbackSupport } = require('./wrappers'); -const JwksError = require('./errors/JwksError'); -const SigningKeyNotFoundError = require('./errors/SigningKeyNotFoundError'); - -class JwksClient { - constructor(options) { - this.options = { - rateLimit: false, - cache: true, - timeout: 30000, - ...options - }; - - // Initialize wrappers. - if (this.options.getKeysInterceptor) { - this.getSigningKey = getKeysInterceptor(this, options); - } - - if (this.options.rateLimit) { - this.getSigningKey = rateLimitSigningKey(this, options); - } - if (this.options.cache) { - this.getSigningKey = cacheSigningKey(this, options); - } - - this.getSigningKey = callbackSupport(this, options); - } - - async getKeys() { - logger(`Fetching keys from '${this.options.jwksUri}'`); - - try { - const res = await request({ - uri: this.options.jwksUri, - headers: this.options.requestHeaders, - agent: this.options.requestAgent, - timeout: this.options.timeout, - fetcher: this.options.fetcher - }); - - logger('Keys:', res.keys); - return res.keys; - } catch (err) { - const { errorMsg } = err; - logger('Failure:', errorMsg || err); - throw (errorMsg ? new JwksError(errorMsg) : err); - } - } - - async getSigningKeys() { - const keys = await this.getKeys(); - - if (!keys || !keys.length) { - throw new JwksError('The JWKS endpoint did not contain any keys'); - } - - const signingKeys = retrieveSigningKeys(keys); - - if (!signingKeys.length) { - throw new JwksError('The JWKS endpoint did not contain any signing keys'); - } - - logger('Signing Keys:', signingKeys); - return signingKeys; - } - - async getSigningKey (kid) { - logger(`Fetching signing key for '${kid}'`); - const keys = await this.getSigningKeys(); - - const kidDefined = kid !== undefined && kid !== null; - if (!kidDefined && keys.length > 1) { - logger('No KID specified and JWKS endpoint returned more than 1 key'); - throw new SigningKeyNotFoundError('No KID specified and JWKS endpoint returned more than 1 key'); - } - - const key = keys.find(k => !kidDefined || k.kid === kid); - if (key) { - return key; - } else { - logger(`Unable to find a signing key that matches '${kid}'`); - throw new SigningKeyNotFoundError(`Unable to find a signing key that matches '${kid}'`); - } - } -} - -module.exports = { - JwksClient -}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/jwks-rsa/src/errors/ArgumentError.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/jwks-rsa/src/errors/ArgumentError.js deleted file mode 100644 index d9bcd75a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/jwks-rsa/src/errors/ArgumentError.js +++ /dev/null @@ -1,10 +0,0 @@ -function ArgumentError(message) { - Error.call(this, message); - Error.captureStackTrace(this, this.constructor); - this.name = 'ArgumentError'; - this.message = message; -} - -ArgumentError.prototype = Object.create(Error.prototype); -ArgumentError.prototype.constructor = ArgumentError; -module.exports = ArgumentError; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/jwks-rsa/src/errors/JwksError.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/jwks-rsa/src/errors/JwksError.js deleted file mode 100644 index 26fb9a82..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/jwks-rsa/src/errors/JwksError.js +++ /dev/null @@ -1,10 +0,0 @@ -function JwksError(message) { - Error.call(this, message); - Error.captureStackTrace(this, this.constructor); - this.name = 'JwksError'; - this.message = message; -} - -JwksError.prototype = Object.create(Error.prototype); -JwksError.prototype.constructor = JwksError; -module.exports = JwksError; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/jwks-rsa/src/errors/JwksRateLimitError.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/jwks-rsa/src/errors/JwksRateLimitError.js deleted file mode 100644 index 4d0cad39..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/jwks-rsa/src/errors/JwksRateLimitError.js +++ /dev/null @@ -1,10 +0,0 @@ -function JwksRateLimitError(message) { - Error.call(this, message); - Error.captureStackTrace(this, this.constructor); - this.name = 'JwksRateLimitError'; - this.message = message; -} - -JwksRateLimitError.prototype = Object.create(Error.prototype); -JwksRateLimitError.prototype.constructor = JwksRateLimitError; -module.exports = JwksRateLimitError; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/jwks-rsa/src/errors/SigningKeyNotFoundError.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/jwks-rsa/src/errors/SigningKeyNotFoundError.js deleted file mode 100644 index 9b8bdcdd..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/jwks-rsa/src/errors/SigningKeyNotFoundError.js +++ /dev/null @@ -1,10 +0,0 @@ -function SigningKeyNotFoundError(message) { - Error.call(this, message); - Error.captureStackTrace(this, this.constructor); - this.name = 'SigningKeyNotFoundError'; - this.message = message; -} - -SigningKeyNotFoundError.prototype = Object.create(Error.prototype); -SigningKeyNotFoundError.prototype.constructor = SigningKeyNotFoundError; -module.exports = SigningKeyNotFoundError; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/jwks-rsa/src/errors/index.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/jwks-rsa/src/errors/index.js deleted file mode 100644 index 8fc3d9aa..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/jwks-rsa/src/errors/index.js +++ /dev/null @@ -1,6 +0,0 @@ -module.exports = { - ArgumentError: require('./ArgumentError'), - JwksError: require('./JwksError'), - JwksRateLimitError: require('./JwksRateLimitError'), - SigningKeyNotFoundError: require('./SigningKeyNotFoundError') -}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/jwks-rsa/src/index.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/jwks-rsa/src/index.js deleted file mode 100644 index 74fb91b8..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/jwks-rsa/src/index.js +++ /dev/null @@ -1,22 +0,0 @@ -const { JwksClient } = require('./JwksClient'); -const errors = require('./errors'); -const { hapiJwt2Key, hapiJwt2KeyAsync } = require('./integrations/hapi'); -const { expressJwtSecret } = require('./integrations/express'); -const { koaJwtSecret } = require('./integrations/koa'); -const { passportJwtSecret } = require('./integrations/passport'); - -module.exports = (options) => { - return new JwksClient(options); -}; -module.exports.JwksClient = JwksClient; - -module.exports.ArgumentError = errors.ArgumentError; -module.exports.JwksError = errors.JwksError; -module.exports.JwksRateLimitError = errors.JwksRateLimitError; -module.exports.SigningKeyNotFoundError = errors.SigningKeyNotFoundError; - -module.exports.expressJwtSecret = expressJwtSecret; -module.exports.hapiJwt2Key = hapiJwt2Key; -module.exports.hapiJwt2KeyAsync = hapiJwt2KeyAsync; -module.exports.koaJwtSecret = koaJwtSecret; -module.exports.passportJwtSecret = passportJwtSecret; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/jwks-rsa/src/integrations/config.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/jwks-rsa/src/integrations/config.js deleted file mode 100644 index 498a5820..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/jwks-rsa/src/integrations/config.js +++ /dev/null @@ -1,15 +0,0 @@ -const allowedSignatureAlg = [ - 'RS256', - 'RS384', - 'RS512', - 'PS256', - 'PS384', - 'PS512', - 'ES256', - 'ES256K', - 'ES384', - 'ES512', - 'EdDSA' -]; - -module.exports = allowedSignatureAlg; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/jwks-rsa/src/integrations/express.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/jwks-rsa/src/integrations/express.js deleted file mode 100644 index ecacf659..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/jwks-rsa/src/integrations/express.js +++ /dev/null @@ -1,60 +0,0 @@ -const { ArgumentError } = require('../errors'); -const { JwksClient } = require('../JwksClient'); -const supportedAlg = require('./config'); - -const handleSigningKeyError = (err, cb) => { - // If we didn't find a match, can't provide a key. - if (err && err.name === 'SigningKeyNotFoundError') { - return cb(null); - } - - // If an error occured like rate limiting or HTTP issue, we'll bubble up the error. - if (err) { - return cb(err); - } -}; - -module.exports.expressJwtSecret = function (options) { - if (options === null || options === undefined) { - throw new ArgumentError('An options object must be provided when initializing expressJwtSecret'); - } - - const client = new JwksClient(options); - const onError = options.handleSigningKeyError || handleSigningKeyError; - - const expressJwt7Provider = async (req, token) => { - if (!token) { return; } - const header = token.header; - if (!header || !supportedAlg.includes(header.alg)) { - return; - } - try { - const key = await client.getSigningKey(header.kid); - return key.publicKey || key.rsaPublicKey; - } catch (err) { - return new Promise((resolve, reject) => { - onError(err, (newError) => { - if (!newError) { return resolve(); } - reject(newError); - }); - }); - } - }; - - return function secretProvider(req, header, payload, cb) { - //This function has 4 parameters to make it work with express-jwt@6 - //but it also supports express-jwt@7 which only has 2. - if (arguments.length === 4) { - expressJwt7Provider(req, { header }) - .then(key => { - setImmediate(cb, null, key); - }).catch(err => { - setImmediate(cb, err); - }); - - return; - } - - return expressJwt7Provider(req, arguments[1]); - }; -}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/jwks-rsa/src/integrations/hapi.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/jwks-rsa/src/integrations/hapi.js deleted file mode 100644 index cf539729..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/jwks-rsa/src/integrations/hapi.js +++ /dev/null @@ -1,59 +0,0 @@ -const { ArgumentError } = require('../errors'); -const { JwksClient } = require('../JwksClient'); -const supportedAlg = require('./config'); - -const handleSigningKeyError = (err, cb) => { - // If we didn't find a match, can't provide a key. - if (err && err.name === 'SigningKeyNotFoundError') { - return cb(err, null, null); - } - - // If an error occured like rate limiting or HTTP issue, we'll bubble up the error. - if (err) { - return cb(err, null, null); - } -}; - -/** - * Call hapiJwt2Key as a Promise - * @param {object} options - * @returns {Promise} - */ -module.exports.hapiJwt2KeyAsync = (options) => { - const secretProvider = module.exports.hapiJwt2Key(options); - return function(decoded) { - return new Promise((resolve, reject) => { - const cb = (err, key) => { - (!key || err) ? reject(err) : resolve({ key }); - }; - secretProvider(decoded, cb); - }); - }; -}; - -module.exports.hapiJwt2Key = function (options) { - if (options === null || options === undefined) { - throw new ArgumentError('An options object must be provided when initializing hapiJwt2Key'); - } - - const client = new JwksClient(options); - const onError = options.handleSigningKeyError || handleSigningKeyError; - - return function secretProvider(decoded, cb) { - // We cannot find a signing certificate if there is no header (no kid). - if (!decoded || !decoded.header) { - return cb(new Error('Cannot find a signing certificate if there is no header'), null, null); - } - - if (!supportedAlg.includes(decoded.header.alg)) { - return cb(new Error('Unsupported algorithm ' + decoded.header.alg + ' supplied.'), null, null); - } - - client.getSigningKey(decoded.header.kid) - .then(key => { - return cb(null, key.publicKey || key.rsaPublicKey, key); - }).catch(err => { - return onError(err, (newError) => cb(newError, null, null)); - }); - }; -}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/jwks-rsa/src/integrations/koa.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/jwks-rsa/src/integrations/koa.js deleted file mode 100644 index 9185bfcf..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/jwks-rsa/src/integrations/koa.js +++ /dev/null @@ -1,30 +0,0 @@ -const { ArgumentError } = require('../errors'); -const { JwksClient } = require('../JwksClient'); -const supportedAlg = require('./config'); - -module.exports.koaJwtSecret = function (options = {}) { - if (!options.jwksUri) { - throw new ArgumentError('No JWKS provided. Please provide a jwksUri'); - } - - const client = new JwksClient(options); - - return function secretProvider({ alg, kid } = {}) { - return new Promise((resolve, reject) => { - if (!supportedAlg.includes(alg)) { - return reject(new Error('Missing / invalid token algorithm')); - } - - client.getSigningKey(kid) - .then(key => { - resolve(key.publicKey || key.rsaPublicKey); - }).catch(err => { - if (options.handleSigningKeyError) { - return options.handleSigningKeyError(err).then(reject); - } - - return reject(err); - }); - }); - }; -}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/jwks-rsa/src/integrations/passport.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/jwks-rsa/src/integrations/passport.js deleted file mode 100644 index a3981e1e..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/jwks-rsa/src/integrations/passport.js +++ /dev/null @@ -1,49 +0,0 @@ -const JWT = require('jose').JWT; -const { ArgumentError } = require('../errors'); -const { JwksClient } = require('../JwksClient'); -const supportedAlg = require('./config'); - -const handleSigningKeyError = (err, cb) => { - // If we didn't find a match, can't provide a key. - if (err && err.name === 'SigningKeyNotFoundError') { - return cb(null); - } - - // If an error occured like rate limiting or HTTP issue, we'll bubble up the error. - if (err) { - return cb(err); - } -}; - -module.exports.passportJwtSecret = function (options) { - if (options === null || options === undefined) { - throw new ArgumentError('An options object must be provided when initializing passportJwtSecret'); - } - - if (!options.jwksUri) { - throw new ArgumentError('No JWKS provided. Please provide a jwksUri'); - } - - const client = new JwksClient(options); - const onError = options.handleSigningKeyError || handleSigningKeyError; - - return function secretProvider(req, rawJwtToken, cb) { - let decoded; - try { - decoded = JWT.decode(rawJwtToken, { complete: true }); - } catch (err) { - decoded = null; - } - - if (!decoded || !supportedAlg.includes(decoded.header.alg)) { - return cb(null, null); - } - - client.getSigningKey(decoded.header.kid) - .then(key => { - cb(null, key.publicKey || key.rsaPublicKey); - }).catch(err => { - onError(err, (newError) => cb(newError, null)); - }); - }; -}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/jwks-rsa/src/utils.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/jwks-rsa/src/utils.js deleted file mode 100644 index 6b06404e..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/jwks-rsa/src/utils.js +++ /dev/null @@ -1,19 +0,0 @@ -const jose = require('jose'); - -function retrieveSigningKeys(keys) { - const keystore = jose.JWKS.asKeyStore({ keys }, { ignoreErrors: true }); - - return keystore.all({ use: 'sig' }).map((key) => { - return { - kid: key.kid, - alg: key.alg, - get publicKey() { return key.toPEM(false); }, - get rsaPublicKey() { return key.toPEM(false); }, - getPublicKey() { return key.toPEM(false); } - }; - }); -} - -module.exports = { - retrieveSigningKeys -}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/jwks-rsa/src/wrappers/cache.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/jwks-rsa/src/wrappers/cache.js deleted file mode 100644 index 37387ff7..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/jwks-rsa/src/wrappers/cache.js +++ /dev/null @@ -1,15 +0,0 @@ -const logger = require('debug')('jwks'); -const memoizer = require('lru-memoizer'); -const { promisify, callbackify } = require('util'); - -function cacheWrapper(client, { cacheMaxEntries = 5, cacheMaxAge = 600000 }) { - logger(`Configured caching of signing keys. Max: ${cacheMaxEntries} / Age: ${cacheMaxAge}`); - return promisify(memoizer({ - hash: (kid) => kid, - load: callbackify(client.getSigningKey.bind(client)), - maxAge: cacheMaxAge, - max: cacheMaxEntries - })); -} - -module.exports.default = cacheWrapper; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/jwks-rsa/src/wrappers/callbackSupport.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/jwks-rsa/src/wrappers/callbackSupport.js deleted file mode 100644 index 3748476a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/jwks-rsa/src/wrappers/callbackSupport.js +++ /dev/null @@ -1,16 +0,0 @@ -const { callbackify } = require('util'); - -const callbackSupport = (client) => { - const getSigningKey = client.getSigningKey.bind(client); - - return (kid, cb) => { - if (cb) { - const callbackFunc = callbackify(getSigningKey); - return callbackFunc(kid, cb); - } - - return getSigningKey(kid); - }; -}; - -module.exports.default = callbackSupport; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/jwks-rsa/src/wrappers/index.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/jwks-rsa/src/wrappers/index.js deleted file mode 100644 index 8b9d1189..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/jwks-rsa/src/wrappers/index.js +++ /dev/null @@ -1,7 +0,0 @@ -module.exports = { - request: require('./request').default, - cacheSigningKey: require('./cache').default, - rateLimitSigningKey: require('./rateLimit').default, - getKeysInterceptor: require('./interceptor').default, - callbackSupport: require('./callbackSupport').default -}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/jwks-rsa/src/wrappers/interceptor.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/jwks-rsa/src/wrappers/interceptor.js deleted file mode 100644 index 5f0eb1d6..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/jwks-rsa/src/wrappers/interceptor.js +++ /dev/null @@ -1,30 +0,0 @@ -const retrieveSigningKeys = require('../utils').retrieveSigningKeys; - -/** - * Uses getKeysInterceptor to allow users to retrieve keys from a file, - * external cache, or provided object before falling back to the jwksUri endpoint - */ -function getKeysInterceptor(client, { getKeysInterceptor }) { - const getSigningKey = client.getSigningKey.bind(client); - - return async (kid) => { - const keys = await getKeysInterceptor(); - - let signingKeys; - if (keys && keys.length) { - signingKeys = retrieveSigningKeys(keys); - } - - if (signingKeys && signingKeys.length) { - const key = signingKeys.find(k => !kid || k.kid === kid); - - if (key) { - return key; - } - } - - return getSigningKey(kid); - }; -} - -module.exports.default = getKeysInterceptor; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/jwks-rsa/src/wrappers/rateLimit.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/jwks-rsa/src/wrappers/rateLimit.js deleted file mode 100644 index b1837c4e..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/jwks-rsa/src/wrappers/rateLimit.js +++ /dev/null @@ -1,34 +0,0 @@ -const logger = require('debug')('jwks'); -const { RateLimiter } = require('limiter'); - -const JwksRateLimitError = require('../errors/JwksRateLimitError'); - -function rateLimitWrapper(client, { jwksRequestsPerMinute = 10 }) { - const getSigningKey = client.getSigningKey.bind(client); - - const limiter = new RateLimiter(jwksRequestsPerMinute, 'minute', true); - logger(`Configured rate limiting to JWKS endpoint at ${jwksRequestsPerMinute}/minute`); - - return async (kid) => await new Promise((resolve, reject) => { - limiter.removeTokens(1, async (err, remaining) => { - if (err) { - reject(err); - } - - logger('Requests to the JWKS endpoint available for the next minute:', remaining); - if (remaining < 0) { - logger('Too many requests to the JWKS endpoint'); - reject(new JwksRateLimitError('Too many requests to the JWKS endpoint')); - } else { - try { - const key = await getSigningKey(kid); - resolve(key); - } catch (error) { - reject(error); - } - } - }); - }); -} - -module.exports.default = rateLimitWrapper; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/jwks-rsa/src/wrappers/request.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/jwks-rsa/src/wrappers/request.js deleted file mode 100644 index b453c2be..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/jwks-rsa/src/wrappers/request.js +++ /dev/null @@ -1,52 +0,0 @@ -const http = require('http'); -const https = require('https'); -const urlUtil = require('url'); - -module.exports.default = (options) => { - if (options.fetcher) { - return options.fetcher(options.uri); - } - - return new Promise((resolve, reject) => { - const { - hostname, - path, - port, - protocol - } = urlUtil.parse(options.uri); - - const requestOptions = { - hostname, - path, - port, - method: 'GET', - ...(options.headers && { headers: { ...options.headers } }), - ...(options.timeout && { timeout: options.timeout }), - ...(options.agent && { agent: options.agent }) - }; - - const httpRequestLib = protocol === 'https:' ? https : http; - const httpRequest = httpRequestLib.request(requestOptions, (res) => { - let rawData = ''; - res.setEncoding('utf8'); - res.on('data', (chunk) => { rawData += chunk; }); - res.on('end', () => { - if (res.statusCode < 200 || res.statusCode >= 300) { - const errorMsg = res.body && (res.body.message || res.body) || res.statusMessage || `Http Error ${res.statusCode}`; - reject({ errorMsg }); - } else { - try { - resolve(rawData && JSON.parse(rawData)); - } catch (error) { - reject(error); - } - } - }); - }); - - httpRequest - .on('timeout', () => httpRequest.destroy()) - .on('error', (e) => reject(e)) - .end(); - }); -}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/jws/CHANGELOG.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/jws/CHANGELOG.md deleted file mode 100644 index af8fc287..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/jws/CHANGELOG.md +++ /dev/null @@ -1,34 +0,0 @@ -# Change Log -All notable changes to this project will be documented in this file. - -## [3.0.0] -### Changed -- **BREAKING**: `jwt.verify` now requires an `algorithm` parameter, and - `jws.createVerify` requires an `algorithm` option. The `"alg"` field - signature headers is ignored. This mitigates a critical security flaw - in the library which would allow an attacker to generate signatures with - arbitrary contents that would be accepted by `jwt.verify`. See - https://auth0.com/blog/2015/03/31/critical-vulnerabilities-in-json-web-token-libraries/ - for details. - -## [2.0.0] - 2015-01-30 -### Changed -- **BREAKING**: Default payload encoding changed from `binary` to - `utf8`. `utf8` is a is a more sensible default than `binary` because - many payloads, as far as I can tell, will contain user-facing - strings that could be in any language. ([6b6de48]) - -- Code reorganization, thanks [@fearphage]! ([7880050]) - -### Added -- Option in all relevant methods for `encoding`. For those few users - that might be depending on a `binary` encoding of the messages, this - is for them. ([6b6de48]) - -[unreleased]: https://github.com/brianloveswords/node-jws/compare/v2.0.0...HEAD -[2.0.0]: https://github.com/brianloveswords/node-jws/compare/v1.0.1...v2.0.0 - -[7880050]: https://github.com/brianloveswords/node-jws/commit/7880050 -[6b6de48]: https://github.com/brianloveswords/node-jws/commit/6b6de48 - -[@fearphage]: https://github.com/fearphage diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/jws/LICENSE b/packages/wyatt_notification_bloc/example/scripts/node_modules/jws/LICENSE deleted file mode 100644 index caeb8495..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/jws/LICENSE +++ /dev/null @@ -1,17 +0,0 @@ -Copyright (c) 2013 Brian J. Brennan - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to use, -copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the -Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/jws/index.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/jws/index.js deleted file mode 100644 index 8c8da930..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/jws/index.js +++ /dev/null @@ -1,22 +0,0 @@ -/*global exports*/ -var SignStream = require('./lib/sign-stream'); -var VerifyStream = require('./lib/verify-stream'); - -var ALGORITHMS = [ - 'HS256', 'HS384', 'HS512', - 'RS256', 'RS384', 'RS512', - 'PS256', 'PS384', 'PS512', - 'ES256', 'ES384', 'ES512' -]; - -exports.ALGORITHMS = ALGORITHMS; -exports.sign = SignStream.sign; -exports.verify = VerifyStream.verify; -exports.decode = VerifyStream.decode; -exports.isValid = VerifyStream.isValid; -exports.createSign = function createSign(opts) { - return new SignStream(opts); -}; -exports.createVerify = function createVerify(opts) { - return new VerifyStream(opts); -}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/jws/lib/data-stream.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/jws/lib/data-stream.js deleted file mode 100644 index 3535d31d..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/jws/lib/data-stream.js +++ /dev/null @@ -1,55 +0,0 @@ -/*global module, process*/ -var Buffer = require('safe-buffer').Buffer; -var Stream = require('stream'); -var util = require('util'); - -function DataStream(data) { - this.buffer = null; - this.writable = true; - this.readable = true; - - // No input - if (!data) { - this.buffer = Buffer.alloc(0); - return this; - } - - // Stream - if (typeof data.pipe === 'function') { - this.buffer = Buffer.alloc(0); - data.pipe(this); - return this; - } - - // Buffer or String - // or Object (assumedly a passworded key) - if (data.length || typeof data === 'object') { - this.buffer = data; - this.writable = false; - process.nextTick(function () { - this.emit('end', data); - this.readable = false; - this.emit('close'); - }.bind(this)); - return this; - } - - throw new TypeError('Unexpected data type ('+ typeof data + ')'); -} -util.inherits(DataStream, Stream); - -DataStream.prototype.write = function write(data) { - this.buffer = Buffer.concat([this.buffer, Buffer.from(data)]); - this.emit('data', data); -}; - -DataStream.prototype.end = function end(data) { - if (data) - this.write(data); - this.emit('end', data); - this.emit('close'); - this.writable = false; - this.readable = false; -}; - -module.exports = DataStream; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/jws/lib/sign-stream.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/jws/lib/sign-stream.js deleted file mode 100644 index 6a7ee42f..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/jws/lib/sign-stream.js +++ /dev/null @@ -1,78 +0,0 @@ -/*global module*/ -var Buffer = require('safe-buffer').Buffer; -var DataStream = require('./data-stream'); -var jwa = require('jwa'); -var Stream = require('stream'); -var toString = require('./tostring'); -var util = require('util'); - -function base64url(string, encoding) { - return Buffer - .from(string, encoding) - .toString('base64') - .replace(/=/g, '') - .replace(/\+/g, '-') - .replace(/\//g, '_'); -} - -function jwsSecuredInput(header, payload, encoding) { - encoding = encoding || 'utf8'; - var encodedHeader = base64url(toString(header), 'binary'); - var encodedPayload = base64url(toString(payload), encoding); - return util.format('%s.%s', encodedHeader, encodedPayload); -} - -function jwsSign(opts) { - var header = opts.header; - var payload = opts.payload; - var secretOrKey = opts.secret || opts.privateKey; - var encoding = opts.encoding; - var algo = jwa(header.alg); - var securedInput = jwsSecuredInput(header, payload, encoding); - var signature = algo.sign(securedInput, secretOrKey); - return util.format('%s.%s', securedInput, signature); -} - -function SignStream(opts) { - var secret = opts.secret||opts.privateKey||opts.key; - var secretStream = new DataStream(secret); - this.readable = true; - this.header = opts.header; - this.encoding = opts.encoding; - this.secret = this.privateKey = this.key = secretStream; - this.payload = new DataStream(opts.payload); - this.secret.once('close', function () { - if (!this.payload.writable && this.readable) - this.sign(); - }.bind(this)); - - this.payload.once('close', function () { - if (!this.secret.writable && this.readable) - this.sign(); - }.bind(this)); -} -util.inherits(SignStream, Stream); - -SignStream.prototype.sign = function sign() { - try { - var signature = jwsSign({ - header: this.header, - payload: this.payload.buffer, - secret: this.secret.buffer, - encoding: this.encoding - }); - this.emit('done', signature); - this.emit('data', signature); - this.emit('end'); - this.readable = false; - return signature; - } catch (e) { - this.readable = false; - this.emit('error', e); - this.emit('close'); - } -}; - -SignStream.sign = jwsSign; - -module.exports = SignStream; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/jws/lib/tostring.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/jws/lib/tostring.js deleted file mode 100644 index f5a49a36..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/jws/lib/tostring.js +++ /dev/null @@ -1,10 +0,0 @@ -/*global module*/ -var Buffer = require('buffer').Buffer; - -module.exports = function toString(obj) { - if (typeof obj === 'string') - return obj; - if (typeof obj === 'number' || Buffer.isBuffer(obj)) - return obj.toString(); - return JSON.stringify(obj); -}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/jws/lib/verify-stream.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/jws/lib/verify-stream.js deleted file mode 100644 index 39f7c73e..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/jws/lib/verify-stream.js +++ /dev/null @@ -1,120 +0,0 @@ -/*global module*/ -var Buffer = require('safe-buffer').Buffer; -var DataStream = require('./data-stream'); -var jwa = require('jwa'); -var Stream = require('stream'); -var toString = require('./tostring'); -var util = require('util'); -var JWS_REGEX = /^[a-zA-Z0-9\-_]+?\.[a-zA-Z0-9\-_]+?\.([a-zA-Z0-9\-_]+)?$/; - -function isObject(thing) { - return Object.prototype.toString.call(thing) === '[object Object]'; -} - -function safeJsonParse(thing) { - if (isObject(thing)) - return thing; - try { return JSON.parse(thing); } - catch (e) { return undefined; } -} - -function headerFromJWS(jwsSig) { - var encodedHeader = jwsSig.split('.', 1)[0]; - return safeJsonParse(Buffer.from(encodedHeader, 'base64').toString('binary')); -} - -function securedInputFromJWS(jwsSig) { - return jwsSig.split('.', 2).join('.'); -} - -function signatureFromJWS(jwsSig) { - return jwsSig.split('.')[2]; -} - -function payloadFromJWS(jwsSig, encoding) { - encoding = encoding || 'utf8'; - var payload = jwsSig.split('.')[1]; - return Buffer.from(payload, 'base64').toString(encoding); -} - -function isValidJws(string) { - return JWS_REGEX.test(string) && !!headerFromJWS(string); -} - -function jwsVerify(jwsSig, algorithm, secretOrKey) { - if (!algorithm) { - var err = new Error("Missing algorithm parameter for jws.verify"); - err.code = "MISSING_ALGORITHM"; - throw err; - } - jwsSig = toString(jwsSig); - var signature = signatureFromJWS(jwsSig); - var securedInput = securedInputFromJWS(jwsSig); - var algo = jwa(algorithm); - return algo.verify(securedInput, signature, secretOrKey); -} - -function jwsDecode(jwsSig, opts) { - opts = opts || {}; - jwsSig = toString(jwsSig); - - if (!isValidJws(jwsSig)) - return null; - - var header = headerFromJWS(jwsSig); - - if (!header) - return null; - - var payload = payloadFromJWS(jwsSig); - if (header.typ === 'JWT' || opts.json) - payload = JSON.parse(payload, opts.encoding); - - return { - header: header, - payload: payload, - signature: signatureFromJWS(jwsSig) - }; -} - -function VerifyStream(opts) { - opts = opts || {}; - var secretOrKey = opts.secret||opts.publicKey||opts.key; - var secretStream = new DataStream(secretOrKey); - this.readable = true; - this.algorithm = opts.algorithm; - this.encoding = opts.encoding; - this.secret = this.publicKey = this.key = secretStream; - this.signature = new DataStream(opts.signature); - this.secret.once('close', function () { - if (!this.signature.writable && this.readable) - this.verify(); - }.bind(this)); - - this.signature.once('close', function () { - if (!this.secret.writable && this.readable) - this.verify(); - }.bind(this)); -} -util.inherits(VerifyStream, Stream); -VerifyStream.prototype.verify = function verify() { - try { - var valid = jwsVerify(this.signature.buffer, this.algorithm, this.key.buffer); - var obj = jwsDecode(this.signature.buffer, this.encoding); - this.emit('done', valid, obj); - this.emit('data', valid); - this.emit('end'); - this.readable = false; - return valid; - } catch (e) { - this.readable = false; - this.emit('error', e); - this.emit('close'); - } -}; - -VerifyStream.decode = jwsDecode; -VerifyStream.isValid = isValidJws; -VerifyStream.verify = jwsVerify; - -module.exports = VerifyStream; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/jws/package.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/jws/package.json deleted file mode 100644 index 87d4fcc7..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/jws/package.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "name": "jws", - "version": "4.0.0", - "description": "Implementation of JSON Web Signatures", - "main": "index.js", - "directories": { - "test": "test" - }, - "scripts": { - "test": "make test" - }, - "repository": { - "type": "git", - "url": "git://github.com/brianloveswords/node-jws.git" - }, - "keywords": [ - "jws", - "json", - "web", - "signatures" - ], - "author": "Brian J Brennan", - "license": "MIT", - "readmeFilename": "readme.md", - "gitHead": "c0f6b27bcea5a2ad2e304d91c2e842e4076a6b03", - "dependencies": { - "jwa": "^2.0.0", - "safe-buffer": "^5.0.1" - }, - "devDependencies": { - "semver": "^5.1.0", - "tape": "~2.14.0" - } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/jws/readme.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/jws/readme.md deleted file mode 100644 index 2f32dca9..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/jws/readme.md +++ /dev/null @@ -1,255 +0,0 @@ -# node-jws [![Build Status](https://secure.travis-ci.org/brianloveswords/node-jws.svg)](http://travis-ci.org/brianloveswords/node-jws) - -An implementation of [JSON Web Signatures](http://self-issued.info/docs/draft-ietf-jose-json-web-signature.html). - -This was developed against `draft-ietf-jose-json-web-signature-08` and -implements the entire spec **except** X.509 Certificate Chain -signing/verifying (patches welcome). - -There are both synchronous (`jws.sign`, `jws.verify`) and streaming -(`jws.createSign`, `jws.createVerify`) APIs. - -# Install - -```bash -$ npm install jws -``` - -# Usage - -## jws.ALGORITHMS - -Array of supported algorithms. The following algorithms are currently supported. - -alg Parameter Value | Digital Signature or MAC Algorithm -----------------|---------------------------- -HS256 | HMAC using SHA-256 hash algorithm -HS384 | HMAC using SHA-384 hash algorithm -HS512 | HMAC using SHA-512 hash algorithm -RS256 | RSASSA using SHA-256 hash algorithm -RS384 | RSASSA using SHA-384 hash algorithm -RS512 | RSASSA using SHA-512 hash algorithm -PS256 | RSASSA-PSS using SHA-256 hash algorithm -PS384 | RSASSA-PSS using SHA-384 hash algorithm -PS512 | RSASSA-PSS using SHA-512 hash algorithm -ES256 | ECDSA using P-256 curve and SHA-256 hash algorithm -ES384 | ECDSA using P-384 curve and SHA-384 hash algorithm -ES512 | ECDSA using P-521 curve and SHA-512 hash algorithm -none | No digital signature or MAC value included - -## jws.sign(options) - -(Synchronous) Return a JSON Web Signature for a header and a payload. - -Options: - -* `header` -* `payload` -* `secret` or `privateKey` -* `encoding` (Optional, defaults to 'utf8') - -`header` must be an object with an `alg` property. `header.alg` must be -one a value found in `jws.ALGORITHMS`. See above for a table of -supported algorithms. - -If `payload` is not a buffer or a string, it will be coerced into a string -using `JSON.stringify`. - -Example - -```js -const signature = jws.sign({ - header: { alg: 'HS256' }, - payload: 'h. jon benjamin', - secret: 'has a van', -}); -``` - -## jws.verify(signature, algorithm, secretOrKey) - -(Synchronous) Returns `true` or `false` for whether a signature matches a -secret or key. - -`signature` is a JWS Signature. `header.alg` must be a value found in `jws.ALGORITHMS`. -See above for a table of supported algorithms. `secretOrKey` is a string or -buffer containing either the secret for HMAC algorithms, or the PEM -encoded public key for RSA and ECDSA. - -Note that the `"alg"` value from the signature header is ignored. - - -## jws.decode(signature) - -(Synchronous) Returns the decoded header, decoded payload, and signature -parts of the JWS Signature. - -Returns an object with three properties, e.g. -```js -{ header: { alg: 'HS256' }, - payload: 'h. jon benjamin', - signature: 'YOWPewyGHKu4Y_0M_vtlEnNlqmFOclqp4Hy6hVHfFT4' -} -``` - -## jws.createSign(options) - -Returns a new SignStream object. - -Options: - -* `header` (required) -* `payload` -* `key` || `privateKey` || `secret` -* `encoding` (Optional, defaults to 'utf8') - -Other than `header`, all options expect a string or a buffer when the -value is known ahead of time, or a stream for convenience. -`key`/`privateKey`/`secret` may also be an object when using an encrypted -private key, see the [crypto documentation][encrypted-key-docs]. - -Example: - -```js - -// This... -jws.createSign({ - header: { alg: 'RS256' }, - privateKey: privateKeyStream, - payload: payloadStream, -}).on('done', function(signature) { - // ... -}); - -// is equivalent to this: -const signer = jws.createSign({ - header: { alg: 'RS256' }, -}); -privateKeyStream.pipe(signer.privateKey); -payloadStream.pipe(signer.payload); -signer.on('done', function(signature) { - // ... -}); -``` - -## jws.createVerify(options) - -Returns a new VerifyStream object. - -Options: - -* `signature` -* `algorithm` -* `key` || `publicKey` || `secret` -* `encoding` (Optional, defaults to 'utf8') - -All options expect a string or a buffer when the value is known ahead of -time, or a stream for convenience. - -Example: - -```js - -// This... -jws.createVerify({ - publicKey: pubKeyStream, - signature: sigStream, -}).on('done', function(verified, obj) { - // ... -}); - -// is equivilant to this: -const verifier = jws.createVerify(); -pubKeyStream.pipe(verifier.publicKey); -sigStream.pipe(verifier.signature); -verifier.on('done', function(verified, obj) { - // ... -}); -``` - -## Class: SignStream - -A `Readable Stream` that emits a single data event (the calculated -signature) when done. - -### Event: 'done' -`function (signature) { }` - -### signer.payload - -A `Writable Stream` that expects the JWS payload. Do *not* use if you -passed a `payload` option to the constructor. - -Example: - -```js -payloadStream.pipe(signer.payload); -``` - -### signer.secret
signer.key
signer.privateKey - -A `Writable Stream`. Expects the JWS secret for HMAC, or the privateKey -for ECDSA and RSA. Do *not* use if you passed a `secret` or `key` option -to the constructor. - -Example: - -```js -privateKeyStream.pipe(signer.privateKey); -``` - -## Class: VerifyStream - -This is a `Readable Stream` that emits a single data event, the result -of whether or not that signature was valid. - -### Event: 'done' -`function (valid, obj) { }` - -`valid` is a boolean for whether or not the signature is valid. - -### verifier.signature - -A `Writable Stream` that expects a JWS Signature. Do *not* use if you -passed a `signature` option to the constructor. - -### verifier.secret
verifier.key
verifier.publicKey - -A `Writable Stream` that expects a public key or secret. Do *not* use if you -passed a `key` or `secret` option to the constructor. - -# TODO - -* It feels like there should be some convenience options/APIs for - defining the algorithm rather than having to define a header object - with `{ alg: 'ES512' }` or whatever every time. - -* X.509 support, ugh - -# License - -MIT - -``` -Copyright (c) 2013-2015 Brian J. Brennan - -Permission is hereby granted, free of charge, to any person obtaining a -copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -``` - -[encrypted-key-docs]: https://nodejs.org/api/crypto.html#crypto_sign_sign_private_key_output_format diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/klaw/CHANGELOG.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/klaw/CHANGELOG.md deleted file mode 100644 index 941001b1..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/klaw/CHANGELOG.md +++ /dev/null @@ -1,68 +0,0 @@ -3.0.0 / 2018-08-01 ------------------- - -- **BREAKING:** Follow symlinks by default (use the new `preserveSymlinks` option to get the old behavior) [#29](https://github.com/jprichardson/node-klaw/pull/29) -- **BREAKING:** Drop Node v4 support - -2.1.1 / 2017-11-18 ------------------- - -- Performance optimization [#27](https://github.com/jprichardson/node-klaw/pull/27) - -2.1.0 / 2017-08-10 ------------------- - -### Added - -- Added `depthLimit` option to limit how deep to recurse into folders. [#25](https://github.com/jprichardson/node-klaw/pull/25) - -2.0.0 / 2017-06-23 ------------------- - -### Changed - -- `graceful-fs` is now a regular dependency, and is always loaded. This should speed up `require` time -- Dropped support for Node 0.10 & 0.12 and io.js - -1.3.1 / 2016-10-25 ------------------- -### Added -- `graceful-fs` added as an `optionalDependencies`. Thanks [ryanzim]! - -1.3.0 / 2016-06-09 ------------------- -### Added -- `filter` option to pre-filter and not walk directories. - -1.2.0 / 2016-04-16 ------------------- -- added support for custom `fs` implementation. Useful for https://github.com/tschaub/mock-fs - -1.1.3 / 2015-12-23 ------------------- -- bugfix: if `readdir` error, got hung up. See: https://github.com/jprichardson/node-klaw/issues/1 - -1.1.2 / 2015-11-12 ------------------- -- assert that param `dir` is a `string` - -1.1.1 / 2015-10-25 ------------------- -- bug fix, options not being passed - -1.1.0 / 2015-10-25 ------------------- -- added `queueMethod` and `pathSorter` to `options` to affect searching strategy. - -1.0.0 / 2015-10-25 ------------------- -- removed unused `filter` param -- bugfix: always set `streamOptions` to `objectMode` -- simplified, converted from push mode (streams 1) to proper pull mode (streams 3) - -0.1.0 / 2015-10-25 ------------------- -- initial release - - -[ryanzim]: https://github.com/ryanzim diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/klaw/LICENSE b/packages/wyatt_notification_bloc/example/scripts/node_modules/klaw/LICENSE deleted file mode 100644 index ddb217c9..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/klaw/LICENSE +++ /dev/null @@ -1,15 +0,0 @@ -(The MIT License) - -Copyright (c) 2015-2016 JP Richardson - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files -(the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, - merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE -WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS -OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, - ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/klaw/README.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/klaw/README.md deleted file mode 100644 index 2ffe81e3..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/klaw/README.md +++ /dev/null @@ -1,253 +0,0 @@ -Node.js - klaw -============== - -JavaScript Standard Style - -A Node.js file system walker extracted from [fs-extra](https://github.com/jprichardson/node-fs-extra). - -[![npm Package](https://img.shields.io/npm/v/klaw.svg?style=flat-square)](https://www.npmjs.org/package/klaw) -[![build status](https://api.travis-ci.org/jprichardson/node-klaw.svg)](http://travis-ci.org/jprichardson/node-klaw) -[![windows build status](https://ci.appveyor.com/api/projects/status/github/jprichardson/node-klaw?branch=master&svg=true)](https://ci.appveyor.com/project/jprichardson/node-klaw/branch/master) - -Install -------- - - npm i --save klaw - -If you're using Typescript, we've got [types](https://github.com/DefinitelyTyped/DefinitelyTyped/pull/11492/files): - - npm i --save-dev @types/klaw - - -Name ----- - -`klaw` is `walk` backwards :p - - -Sync ----- - -If you need the same functionality but synchronous, you can use [klaw-sync](https://github.com/manidlou/node-klaw-sync). - - -Usage ------ - -### klaw(directory, [options]) - -Returns a [Readable stream](https://nodejs.org/api/stream.html#stream_class_stream_readable) that iterates -through every file and directory starting with `dir` as the root. Every `read()` or `data` event -returns an object with two properties: `path` and `stats`. `path` is the full path of the file and -`stats` is an instance of [fs.Stats](https://nodejs.org/api/fs.html#fs_class_fs_stats). - -- `directory`: The directory to recursively walk. Type `string`. -- `options`: [Readable stream options](https://nodejs.org/api/stream.html#stream_new_stream_readable_options) and -the following: - - `queueMethod` (`string`, default: `'shift'`): Either `'shift'` or `'pop'`. On `readdir()` array, call either `shift()` or `pop()`. - - `pathSorter` (`function`, default: `undefined`): Sorting [function for Arrays](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort). - - `fs` (`object`, default: [`graceful-fs`](https://github.com/isaacs/node-graceful-fs)): Use this to hook into the `fs` methods or to use [`mock-fs`](https://github.com/tschaub/mock-fs) - - `filter` (`function`, default: `undefined`): Filtering [function for Arrays](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter) - - `depthLimit` (`number`, default: `undefined`): The number of times to recurse before stopping. -1 for unlimited. - - `preserveSymlinks` (`boolean`, default: `false`): Whether symlinks should be followed or treated as items themselves. If true, symlinks will be returned as items in their own right. If false, the linked item will be returned and potentially recursed into, in its stead. - -**Streams 1 (push) example:** - -```js -const klaw = require('klaw') - -const items = [] // files, directories, symlinks, etc -klaw('/some/dir') - .on('data', item => items.push(item.path)) - .on('end', () => console.dir(items)) // => [ ... array of files] -``` - -**Streams 2 & 3 (pull) example:** - -```js -const klaw = require('klaw') - -const items = [] // files, directories, symlinks, etc -klaw('/some/dir') - .on('readable', function () { - let item - while ((item = this.read())) { - items.push(item.path) - } - }) - .on('end', () => console.dir(items)) // => [ ... array of files] -``` - -### Error Handling - -Listen for the `error` event. - -Example: - -```js -const klaw = require('klaw') - -klaw('/some/dir') - .on('readable', function () { - let item - while ((item = this.read())) { - // do something with the file - } - }) - .on('error', (err, item) => { - console.log(err.message) - console.log(item.path) // the file the error occurred on - }) - .on('end', () => console.dir(items)) // => [ ... array of files] -``` - - -### Aggregation / Filtering / Executing Actions (Through Streams) - -On many occasions you may want to filter files based upon size, extension, etc. -Or you may want to aggregate stats on certain file types. Or maybe you want to -perform an action on certain file types. - -You should use the module [`through2`](https://www.npmjs.com/package/through2) to easily -accomplish this. - -Install `through2`: - - npm i --save through2 - - -**Example (skipping directories):** - -```js -const klaw = require('klaw') -const through2 = require('through2') - -const excludeDirFilter = through2.obj(function (item, enc, next) { - if (!item.stats.isDirectory()) this.push(item) - next() -}) - -const items = [] // files, directories, symlinks, etc -klaw('/some/dir') - .pipe(excludeDirFilter) - .on('data', item => items.push(item.path)) - .on('end', () => console.dir(items)) // => [ ... array of files without directories] -``` - -**Example (ignore hidden directories):** - -```js -const klaw = require('klaw') -const path = require('path') - -const filterFunc = item => { - const basename = path.basename(item) - return basename === '.' || basename[0] !== '.' -} - -klaw('/some/dir', { filter: filterFunc }) - .on('data', item => { - // only items of none hidden folders will reach here - }) -``` - -**Example (totaling size of PNG files):** - -```js -const klaw = require('klaw') -const path = require('path') -const through2 = require('through2') - -let totalPngsInBytes = 0 -const aggregatePngSize = through2.obj(function (item, enc, next) { - if (path.extname(item.path) === '.png') { - totalPngsInBytes += item.stats.size - } - this.push(item) - next() -}) - -klaw('/some/dir') - .pipe(aggregatePngSize) - .on('data', item => items.push(item.path)) - .on('end', () => console.dir(totalPngsInBytes)) // => total of all pngs (bytes) -``` - - -**Example (deleting all .tmp files):** - -```js -const fs = require('fs') -const klaw = require('klaw') -const through2 = require('through2') - -const deleteAction = through2.obj(function (item, enc, next) { - this.push(item) - - if (path.extname(item.path) === '.tmp') { - item.deleted = true - fs.unlink(item.path, next) - } else { - item.deleted = false - next() - } -}) - -const deletedFiles = [] -klaw('/some/dir') - .pipe(deleteAction) - .on('data', item => { - if (!item.deleted) return - deletedFiles.push(item.path) - }) - .on('end', () => console.dir(deletedFiles)) // => all deleted files -``` - -You can even chain a bunch of these filters and aggregators together. By using -multiple pipes. - -**Example (using multiple filters / aggregators):** - -```js -klaw('/some/dir') - .pipe(filterCertainFiles) - .pipe(deleteSomeOtherFiles) - .on('end', () => console.log('all done!')) -``` - -**Example passing (piping) through errors:** - -Node.js does not `pipe()` errors. This means that the error on one stream, like -`klaw` will not pipe through to the next. If you want to do this, do the following: - -```js -const klaw = require('klaw') -const through2 = require('through2') - -const excludeDirFilter = through2.obj(function (item, enc, next) { - if (!item.stats.isDirectory()) this.push(item) - next() -}) - -const items = [] // files, directories, symlinks, etc -klaw('/some/dir') - .on('error', err => excludeDirFilter.emit('error', err)) // forward the error on - .pipe(excludeDirFilter) - .on('data', item => items.push(item.path)) - .on('end', () => console.dir(items)) // => [ ... array of files without directories] -``` - - -### Searching Strategy - -Pass in options for `queueMethod`, `pathSorter`, and `depthLimit` to affect how the file system -is recursively iterated. See the code for more details, it's less than 50 lines :) - - - -License -------- - -MIT - -Copyright (c) 2015 [JP Richardson](https://github.com/jprichardson) diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/klaw/package.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/klaw/package.json deleted file mode 100644 index 9172e3d8..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/klaw/package.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "name": "klaw", - "version": "3.0.0", - "description": "File system walker with Readable stream interface.", - "main": "./src/index.js", - "scripts": { - "lint": "standard && standard-markdown", - "test": "npm run lint && npm run unit", - "unit": "tape tests/**/*.js | tap-spec" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/jprichardson/node-klaw.git" - }, - "keywords": [ - "walk", - "walker", - "fs", - "fs-extra", - "readable", - "streams" - ], - "author": "JP Richardson", - "license": "MIT", - "bugs": { - "url": "https://github.com/jprichardson/node-klaw/issues" - }, - "homepage": "https://github.com/jprichardson/node-klaw#readme", - "dependencies": { - "graceful-fs": "^4.1.9" - }, - "devDependencies": { - "mkdirp": "^0.5.1", - "rimraf": "^2.4.3", - "standard": "^11.0.1", - "standard-markdown": "^4.0.1", - "tap-spec": "^5.0.0", - "tape": "^4.2.2" - } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/klaw/src/index.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/klaw/src/index.js deleted file mode 100644 index 79530007..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/klaw/src/index.js +++ /dev/null @@ -1,64 +0,0 @@ -var assert = require('assert') -var path = require('path') -var Readable = require('stream').Readable -var util = require('util') - -function Walker (dir, options) { - assert.strictEqual(typeof dir, 'string', '`dir` parameter should be of type string. Got type: ' + typeof dir) - var defaultStreamOptions = { objectMode: true } - var defaultOpts = { - queueMethod: 'shift', - pathSorter: undefined, - filter: undefined, - depthLimit: undefined, - preserveSymlinks: false - } - options = Object.assign(defaultOpts, options, defaultStreamOptions) - - Readable.call(this, options) - this.root = path.resolve(dir) - this.paths = [this.root] - this.options = options - if (options.depthLimit > -1) this.rootDepth = this.root.split(path.sep).length + 1 - this.fs = options.fs || require('graceful-fs') -} -util.inherits(Walker, Readable) - -Walker.prototype._read = function () { - if (this.paths.length === 0) return this.push(null) - var self = this - var pathItem = this.paths[this.options.queueMethod]() - - var statFunction = this.options.preserveSymlinks ? self.fs.lstat : self.fs.stat - - statFunction(pathItem, function (err, stats) { - var item = { path: pathItem, stats: stats } - if (err) return self.emit('error', err, item) - - if (!stats.isDirectory() || (self.rootDepth && - pathItem.split(path.sep).length - self.rootDepth >= self.options.depthLimit)) { - return self.push(item) - } - - self.fs.readdir(pathItem, function (err, pathItems) { - if (err) { - self.push(item) - return self.emit('error', err, item) - } - - pathItems = pathItems.map(function (part) { return path.join(pathItem, part) }) - if (self.options.filter) pathItems = pathItems.filter(self.options.filter) - if (self.options.pathSorter) pathItems.sort(self.options.pathSorter) - // faster way to do do incremental batch array pushes - self.paths.push.apply(self.paths, pathItems) - - self.push(item) - }) - }) -} - -function walk (root, options) { - return new Walker(root, options) -} - -module.exports = walk diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/levn/LICENSE b/packages/wyatt_notification_bloc/example/scripts/node_modules/levn/LICENSE deleted file mode 100644 index 525b1185..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/levn/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -Copyright (c) George Zahariev - -Permission is hereby granted, free of charge, to any person -obtaining a copy of this software and associated documentation -files (the "Software"), to deal in the Software without -restriction, including without limitation the rights to use, -copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following -conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/levn/README.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/levn/README.md deleted file mode 100644 index bb9ffea0..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/levn/README.md +++ /dev/null @@ -1,196 +0,0 @@ -# levn [![Build Status](https://travis-ci.org/gkz/levn.png)](https://travis-ci.org/gkz/levn) -__Light ECMAScript (JavaScript) Value Notation__ -Levn is a library which allows you to parse a string into a JavaScript value based on an expected type. It is meant for short amounts of human entered data (eg. config files, command line arguments). - -Levn aims to concisely describe JavaScript values in text, and allow for the extraction and validation of those values. Levn uses [type-check](https://github.com/gkz/type-check) for its type format, and to validate the results. MIT license. Version 0.3.0. - -__How is this different than JSON?__ levn is meant to be written by humans only, is (due to the previous point) much more concise, can be validated against supplied types, has regex and date literals, and can easily be extended with custom types. On the other hand, it is probably slower and thus less efficient at transporting large amounts of data, which is fine since this is not its purpose. - - npm install levn - -For updates on levn, [follow me on twitter](https://twitter.com/gkzahariev). - - -## Quick Examples - -```js -var parse = require('levn').parse; -parse('Number', '2'); // 2 -parse('String', '2'); // '2' -parse('String', 'levn'); // 'levn' -parse('String', 'a b'); // 'a b' -parse('Boolean', 'true'); // true - -parse('Date', '#2011-11-11#'); // (Date object) -parse('Date', '2011-11-11'); // (Date object) -parse('RegExp', '/[a-z]/gi'); // /[a-z]/gi -parse('RegExp', 're'); // /re/ -parse('Int', '2'); // 2 - -parse('Number | String', 'str'); // 'str' -parse('Number | String', '2'); // 2 - -parse('[Number]', '[1,2,3]'); // [1,2,3] -parse('(String, Boolean)', '(hi, false)'); // ['hi', false] -parse('{a: String, b: Number}', '{a: str, b: 2}'); // {a: 'str', b: 2} - -// at the top level, you can ommit surrounding delimiters -parse('[Number]', '1,2,3'); // [1,2,3] -parse('(String, Boolean)', 'hi, false'); // ['hi', false] -parse('{a: String, b: Number}', 'a: str, b: 2'); // {a: 'str', b: 2} - -// wildcard - auto choose type -parse('*', '[hi,(null,[42]),{k: true}]'); // ['hi', [null, [42]], {k: true}] -``` -## Usage - -`require('levn');` returns an object that exposes three properties. `VERSION` is the current version of the library as a string. `parse` and `parsedTypeParse` are functions. - -```js -// parse(type, input, options); -parse('[Number]', '1,2,3'); // [1, 2, 3] - -// parsedTypeParse(parsedType, input, options); -var parsedType = require('type-check').parseType('[Number]'); -parsedTypeParse(parsedType, '1,2,3'); // [1, 2, 3] -``` - -### parse(type, input, options) - -`parse` casts the string `input` into a JavaScript value according to the specified `type` in the [type format](https://github.com/gkz/type-check#type-format) (and taking account the optional `options`) and returns the resulting JavaScript value. - -##### arguments -* type - `String` - the type written in the [type format](https://github.com/gkz/type-check#type-format) which to check against -* input - `String` - the value written in the [levn format](#levn-format) -* options - `Maybe Object` - an optional parameter specifying additional [options](#options) - -##### returns -`*` - the resulting JavaScript value - -##### example -```js -parse('[Number]', '1,2,3'); // [1, 2, 3] -``` - -### parsedTypeParse(parsedType, input, options) - -`parsedTypeParse` casts the string `input` into a JavaScript value according to the specified `type` which has already been parsed (and taking account the optional `options`) and returns the resulting JavaScript value. You can parse a type using the [type-check](https://github.com/gkz/type-check) library's `parseType` function. - -##### arguments -* type - `Object` - the type in the parsed type format which to check against -* input - `String` - the value written in the [levn format](#levn-format) -* options - `Maybe Object` - an optional parameter specifying additional [options](#options) - -##### returns -`*` - the resulting JavaScript value - -##### example -```js -var parsedType = require('type-check').parseType('[Number]'); -parsedTypeParse(parsedType, '1,2,3'); // [1, 2, 3] -``` - -## Levn Format - -Levn can use the type information you provide to choose the appropriate value to produce from the input. For the same input, it will choose a different output value depending on the type provided. For example, `parse('Number', '2')` will produce the number `2`, but `parse('String', '2')` will produce the string `"2"`. - -If you do not provide type information, and simply use `*`, levn will parse the input according the unambiguous "explicit" mode, which we will now detail - you can also set the `explicit` option to true manually in the [options](#options). - -* `"string"`, `'string'` are parsed as a String, eg. `"a msg"` is `"a msg"` -* `#date#` is parsed as a Date, eg. `#2011-11-11#` is `new Date('2011-11-11')` -* `/regexp/flags` is parsed as a RegExp, eg. `/re/gi` is `/re/gi` -* `undefined`, `null`, `NaN`, `true`, and `false` are all their JavaScript equivalents -* `[element1, element2, etc]` is an Array, and the casting procedure is recursively applied to each element. Eg. `[1,2,3]` is `[1,2,3]`. -* `(element1, element2, etc)` is an tuple, and the casting procedure is recursively applied to each element. Eg. `(1, a)` is `(1, a)` (is `[1, 'a']`). -* `{key1: val1, key2: val2, ...}` is an Object, and the casting procedure is recursively applied to each property. Eg. `{a: 1, b: 2}` is `{a: 1, b: 2}`. -* Any test which does not fall under the above, and which does not contain special characters (`[``]``(``)``{``}``:``,`) is a string, eg. `$12- blah` is `"$12- blah"`. - -If you do provide type information, you can make your input more concise as the program already has some information about what it expects. Please see the [type format](https://github.com/gkz/type-check#type-format) section of [type-check](https://github.com/gkz/type-check) for more information about how to specify types. There are some rules about what levn can do with the information: - -* If a String is expected, and only a String, all characters of the input (including any special ones) will become part of the output. Eg. `[({})]` is `"[({})]"`, and `"hi"` is `'"hi"'`. -* If a Date is expected, the surrounding `#` can be omitted from date literals. Eg. `2011-11-11` is `new Date('2011-11-11')`. -* If a RegExp is expected, no flags need to be specified, and the regex is not using any of the special characters,the opening and closing `/` can be omitted - this will have the affect of setting the source of the regex to the input. Eg. `regex` is `/regex/`. -* If an Array is expected, and it is the root node (at the top level), the opening `[` and closing `]` can be omitted. Eg. `1,2,3` is `[1,2,3]`. -* If a tuple is expected, and it is the root node (at the top level), the opening `(` and closing `)` can be omitted. Eg. `1, a` is `(1, a)` (is `[1, 'a']`). -* If an Object is expected, and it is the root node (at the top level), the opening `{` and closing `}` can be omitted. Eg `a: 1, b: 2` is `{a: 1, b: 2}`. - -If you list multiple types (eg. `Number | String`), it will first attempt to cast to the first type and then validate - if the validation fails it will move on to the next type and so forth, left to right. You must be careful as some types will succeed with any input, such as String. Thus put String at the end of your list. In non-explicit mode, Date and RegExp will succeed with a large variety of input - also be careful with these and list them near the end if not last in your list. - -Whitespace between special characters and elements is inconsequential. - -## Options - -Options is an object. It is an optional parameter to the `parse` and `parsedTypeParse` functions. - -### Explicit - -A `Boolean`. By default it is `false`. - -__Example:__ - -```js -parse('RegExp', 're', {explicit: false}); // /re/ -parse('RegExp', 're', {explicit: true}); // Error: ... does not type check... -parse('RegExp | String', 're', {explicit: true}); // 're' -``` - -`explicit` sets whether to be in explicit mode or not. Using `*` automatically activates explicit mode. For more information, read the [levn format](#levn-format) section. - -### customTypes - -An `Object`. Empty `{}` by default. - -__Example:__ - -```js -var options = { - customTypes: { - Even: { - typeOf: 'Number', - validate: function (x) { - return x % 2 === 0; - }, - cast: function (x) { - return {type: 'Just', value: parseInt(x)}; - } - } - } -} -parse('Even', '2', options); // 2 -parse('Even', '3', options); // Error: Value: "3" does not type check... -``` - -__Another Example:__ -```js -function Person(name, age){ - this.name = name; - this.age = age; -} -var options = { - customTypes: { - Person: { - typeOf: 'Object', - validate: function (x) { - x instanceof Person; - }, - cast: function (value, options, typesCast) { - var name, age; - if ({}.toString.call(value).slice(8, -1) !== 'Object') { - return {type: 'Nothing'}; - } - name = typesCast(value.name, [{type: 'String'}], options); - age = typesCast(value.age, [{type: 'Numger'}], options); - return {type: 'Just', value: new Person(name, age)}; - } - } -} -parse('Person', '{name: Laura, age: 25}', options); // Person {name: 'Laura', age: 25} -``` - -`customTypes` is an object whose keys are the name of the types, and whose values are an object with three properties, `typeOf`, `validate`, and `cast`. For more information about `typeOf` and `validate`, please see the [custom types](https://github.com/gkz/type-check#custom-types) section of type-check. - -`cast` is a function which receives three arguments, the value under question, options, and the typesCast function. In `cast`, attempt to cast the value into the specified type. If you are successful, return an object in the format `{type: 'Just', value: CAST-VALUE}`, if you know it won't work, return `{type: 'Nothing'}`. You can use the `typesCast` function to cast any child values. Remember to pass `options` to it. In your function you can also check for `options.explicit` and act accordingly. - -## Technical About - -`levn` is written in [LiveScript](http://livescript.net/) - a language that compiles to JavaScript. It uses [type-check](https://github.com/gkz/type-check) to both parse types and validate values. It also uses the [prelude.ls](http://preludels.com/) library. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/levn/lib/cast.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/levn/lib/cast.js deleted file mode 100644 index 411e29d4..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/levn/lib/cast.js +++ /dev/null @@ -1,298 +0,0 @@ -// Generated by LiveScript 1.4.0 -(function(){ - var parsedTypeCheck, types, toString$ = {}.toString; - parsedTypeCheck = require('type-check').parsedTypeCheck; - types = { - '*': function(value, options){ - switch (toString$.call(value).slice(8, -1)) { - case 'Array': - return typeCast(value, { - type: 'Array' - }, options); - case 'Object': - return typeCast(value, { - type: 'Object' - }, options); - default: - return { - type: 'Just', - value: typesCast(value, [ - { - type: 'Undefined' - }, { - type: 'Null' - }, { - type: 'NaN' - }, { - type: 'Boolean' - }, { - type: 'Number' - }, { - type: 'Date' - }, { - type: 'RegExp' - }, { - type: 'Array' - }, { - type: 'Object' - }, { - type: 'String' - } - ], (options.explicit = true, options)) - }; - } - }, - Undefined: function(it){ - if (it === 'undefined' || it === void 8) { - return { - type: 'Just', - value: void 8 - }; - } else { - return { - type: 'Nothing' - }; - } - }, - Null: function(it){ - if (it === 'null') { - return { - type: 'Just', - value: null - }; - } else { - return { - type: 'Nothing' - }; - } - }, - NaN: function(it){ - if (it === 'NaN') { - return { - type: 'Just', - value: NaN - }; - } else { - return { - type: 'Nothing' - }; - } - }, - Boolean: function(it){ - if (it === 'true') { - return { - type: 'Just', - value: true - }; - } else if (it === 'false') { - return { - type: 'Just', - value: false - }; - } else { - return { - type: 'Nothing' - }; - } - }, - Number: function(it){ - return { - type: 'Just', - value: +it - }; - }, - Int: function(it){ - return { - type: 'Just', - value: +it - }; - }, - Float: function(it){ - return { - type: 'Just', - value: +it - }; - }, - Date: function(value, options){ - var that; - if (that = /^\#([\s\S]*)\#$/.exec(value)) { - return { - type: 'Just', - value: new Date(+that[1] || that[1]) - }; - } else if (options.explicit) { - return { - type: 'Nothing' - }; - } else { - return { - type: 'Just', - value: new Date(+value || value) - }; - } - }, - RegExp: function(value, options){ - var that; - if (that = /^\/([\s\S]*)\/([gimy]*)$/.exec(value)) { - return { - type: 'Just', - value: new RegExp(that[1], that[2]) - }; - } else if (options.explicit) { - return { - type: 'Nothing' - }; - } else { - return { - type: 'Just', - value: new RegExp(value) - }; - } - }, - Array: function(value, options){ - return castArray(value, { - of: [{ - type: '*' - }] - }, options); - }, - Object: function(value, options){ - return castFields(value, { - of: {} - }, options); - }, - String: function(it){ - var that; - if (toString$.call(it).slice(8, -1) !== 'String') { - return { - type: 'Nothing' - }; - } - if (that = it.match(/^'([\s\S]*)'$/)) { - return { - type: 'Just', - value: that[1].replace(/\\'/g, "'") - }; - } else if (that = it.match(/^"([\s\S]*)"$/)) { - return { - type: 'Just', - value: that[1].replace(/\\"/g, '"') - }; - } else { - return { - type: 'Just', - value: it - }; - } - } - }; - function castArray(node, type, options){ - var typeOf, element; - if (toString$.call(node).slice(8, -1) !== 'Array') { - return { - type: 'Nothing' - }; - } - typeOf = type.of; - return { - type: 'Just', - value: (function(){ - var i$, ref$, len$, results$ = []; - for (i$ = 0, len$ = (ref$ = node).length; i$ < len$; ++i$) { - element = ref$[i$]; - results$.push(typesCast(element, typeOf, options)); - } - return results$; - }()) - }; - } - function castTuple(node, type, options){ - var result, i, i$, ref$, len$, types, cast; - if (toString$.call(node).slice(8, -1) !== 'Array') { - return { - type: 'Nothing' - }; - } - result = []; - i = 0; - for (i$ = 0, len$ = (ref$ = type.of).length; i$ < len$; ++i$) { - types = ref$[i$]; - cast = typesCast(node[i], types, options); - if (toString$.call(cast).slice(8, -1) !== 'Undefined') { - result.push(cast); - } - i++; - } - if (node.length <= i) { - return { - type: 'Just', - value: result - }; - } else { - return { - type: 'Nothing' - }; - } - } - function castFields(node, type, options){ - var typeOf, key, value; - if (toString$.call(node).slice(8, -1) !== 'Object') { - return { - type: 'Nothing' - }; - } - typeOf = type.of; - return { - type: 'Just', - value: (function(){ - var ref$, resultObj$ = {}; - for (key in ref$ = node) { - value = ref$[key]; - resultObj$[typesCast(key, [{ - type: 'String' - }], options)] = typesCast(value, typeOf[key] || [{ - type: '*' - }], options); - } - return resultObj$; - }()) - }; - } - function typeCast(node, typeObj, options){ - var type, structure, castFunc, ref$; - type = typeObj.type, structure = typeObj.structure; - if (type) { - castFunc = ((ref$ = options.customTypes[type]) != null ? ref$.cast : void 8) || types[type]; - if (!castFunc) { - throw new Error("Type not defined: " + type + "."); - } - return castFunc(node, options, typesCast); - } else { - switch (structure) { - case 'array': - return castArray(node, typeObj, options); - case 'tuple': - return castTuple(node, typeObj, options); - case 'fields': - return castFields(node, typeObj, options); - } - } - } - function typesCast(node, types, options){ - var i$, len$, type, ref$, valueType, value; - for (i$ = 0, len$ = types.length; i$ < len$; ++i$) { - type = types[i$]; - ref$ = typeCast(node, type, options), valueType = ref$.type, value = ref$.value; - if (valueType === 'Nothing') { - continue; - } - if (parsedTypeCheck([type], value, { - customTypes: options.customTypes - })) { - return value; - } - } - throw new Error("Value " + JSON.stringify(node) + " does not type check against " + JSON.stringify(types) + "."); - } - module.exports = typesCast; -}).call(this); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/levn/lib/coerce.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/levn/lib/coerce.js deleted file mode 100644 index 027b6da0..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/levn/lib/coerce.js +++ /dev/null @@ -1,285 +0,0 @@ -// Generated by LiveScript 1.2.0 -(function(){ - var parsedTypeCheck, types, toString$ = {}.toString; - parsedTypeCheck = require('type-check').parsedTypeCheck; - types = { - '*': function(it){ - switch (toString$.call(it).slice(8, -1)) { - case 'Array': - return coerceType(it, { - type: 'Array' - }); - case 'Object': - return coerceType(it, { - type: 'Object' - }); - default: - return { - type: 'Just', - value: coerceTypes(it, [ - { - type: 'Undefined' - }, { - type: 'Null' - }, { - type: 'NaN' - }, { - type: 'Boolean' - }, { - type: 'Number' - }, { - type: 'Date' - }, { - type: 'RegExp' - }, { - type: 'Array' - }, { - type: 'Object' - }, { - type: 'String' - } - ], { - explicit: true - }) - }; - } - }, - Undefined: function(it){ - if (it === 'undefined' || it === void 8) { - return { - type: 'Just', - value: void 8 - }; - } else { - return { - type: 'Nothing' - }; - } - }, - Null: function(it){ - if (it === 'null') { - return { - type: 'Just', - value: null - }; - } else { - return { - type: 'Nothing' - }; - } - }, - NaN: function(it){ - if (it === 'NaN') { - return { - type: 'Just', - value: NaN - }; - } else { - return { - type: 'Nothing' - }; - } - }, - Boolean: function(it){ - if (it === 'true') { - return { - type: 'Just', - value: true - }; - } else if (it === 'false') { - return { - type: 'Just', - value: false - }; - } else { - return { - type: 'Nothing' - }; - } - }, - Number: function(it){ - return { - type: 'Just', - value: +it - }; - }, - Int: function(it){ - return { - type: 'Just', - value: parseInt(it) - }; - }, - Float: function(it){ - return { - type: 'Just', - value: parseFloat(it) - }; - }, - Date: function(value, options){ - var that; - if (that = /^\#(.*)\#$/.exec(value)) { - return { - type: 'Just', - value: new Date(+that[1] || that[1]) - }; - } else if (options.explicit) { - return { - type: 'Nothing' - }; - } else { - return { - type: 'Just', - value: new Date(+value || value) - }; - } - }, - RegExp: function(value, options){ - var that; - if (that = /^\/(.*)\/([gimy]*)$/.exec(value)) { - return { - type: 'Just', - value: new RegExp(that[1], that[2]) - }; - } else if (options.explicit) { - return { - type: 'Nothing' - }; - } else { - return { - type: 'Just', - value: new RegExp(value) - }; - } - }, - Array: function(it){ - return coerceArray(it, { - of: [{ - type: '*' - }] - }); - }, - Object: function(it){ - return coerceFields(it, { - of: {} - }); - }, - String: function(it){ - var that; - if (toString$.call(it).slice(8, -1) !== 'String') { - return { - type: 'Nothing' - }; - } - if (that = it.match(/^'(.*)'$/)) { - return { - type: 'Just', - value: that[1] - }; - } else if (that = it.match(/^"(.*)"$/)) { - return { - type: 'Just', - value: that[1] - }; - } else { - return { - type: 'Just', - value: it - }; - } - } - }; - function coerceArray(node, type){ - var typeOf, element; - if (toString$.call(node).slice(8, -1) !== 'Array') { - return { - type: 'Nothing' - }; - } - typeOf = type.of; - return { - type: 'Just', - value: (function(){ - var i$, ref$, len$, results$ = []; - for (i$ = 0, len$ = (ref$ = node).length; i$ < len$; ++i$) { - element = ref$[i$]; - results$.push(coerceTypes(element, typeOf)); - } - return results$; - }()) - }; - } - function coerceTuple(node, type){ - var result, i$, ref$, len$, i, types, that; - if (toString$.call(node).slice(8, -1) !== 'Array') { - return { - type: 'Nothing' - }; - } - result = []; - for (i$ = 0, len$ = (ref$ = type.of).length; i$ < len$; ++i$) { - i = i$; - types = ref$[i$]; - if (that = coerceTypes(node[i], types)) { - result.push(that); - } - } - return { - type: 'Just', - value: result - }; - } - function coerceFields(node, type){ - var typeOf, key, value; - if (toString$.call(node).slice(8, -1) !== 'Object') { - return { - type: 'Nothing' - }; - } - typeOf = type.of; - return { - type: 'Just', - value: (function(){ - var ref$, results$ = {}; - for (key in ref$ = node) { - value = ref$[key]; - results$[key] = coerceTypes(value, typeOf[key] || [{ - type: '*' - }]); - } - return results$; - }()) - }; - } - function coerceType(node, typeObj, options){ - var type, structure, coerceFunc; - type = typeObj.type, structure = typeObj.structure; - if (type) { - coerceFunc = types[type]; - return coerceFunc(node, options); - } else { - switch (structure) { - case 'array': - return coerceArray(node, typeObj); - case 'tuple': - return coerceTuple(node, typeObj); - case 'fields': - return coerceFields(node, typeObj); - } - } - } - function coerceTypes(node, types, options){ - var i$, len$, type, ref$, valueType, value; - for (i$ = 0, len$ = types.length; i$ < len$; ++i$) { - type = types[i$]; - ref$ = coerceType(node, type, options), valueType = ref$.type, value = ref$.value; - if (valueType === 'Nothing') { - continue; - } - if (parsedTypeCheck([type], value)) { - return value; - } - } - throw new Error("Value " + JSON.stringify(node) + " does not type check against " + JSON.stringify(types) + "."); - } - module.exports = coerceTypes; -}).call(this); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/levn/lib/index.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/levn/lib/index.js deleted file mode 100644 index 4adae30c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/levn/lib/index.js +++ /dev/null @@ -1,22 +0,0 @@ -// Generated by LiveScript 1.4.0 -(function(){ - var parseString, cast, parseType, VERSION, parsedTypeParse, parse; - parseString = require('./parse-string'); - cast = require('./cast'); - parseType = require('type-check').parseType; - VERSION = '0.3.0'; - parsedTypeParse = function(parsedType, string, options){ - options == null && (options = {}); - options.explicit == null && (options.explicit = false); - options.customTypes == null && (options.customTypes = {}); - return cast(parseString(parsedType, string, options), parsedType, options); - }; - parse = function(type, string, options){ - return parsedTypeParse(parseType(type), string, options); - }; - module.exports = { - VERSION: VERSION, - parse: parse, - parsedTypeParse: parsedTypeParse - }; -}).call(this); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/levn/lib/parse-string.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/levn/lib/parse-string.js deleted file mode 100644 index d573975f..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/levn/lib/parse-string.js +++ /dev/null @@ -1,113 +0,0 @@ -// Generated by LiveScript 1.4.0 -(function(){ - var reject, special, tokenRegex; - reject = require('prelude-ls').reject; - function consumeOp(tokens, op){ - if (tokens[0] === op) { - return tokens.shift(); - } else { - throw new Error("Expected '" + op + "', but got '" + tokens[0] + "' instead in " + JSON.stringify(tokens) + "."); - } - } - function maybeConsumeOp(tokens, op){ - if (tokens[0] === op) { - return tokens.shift(); - } - } - function consumeList(tokens, arg$, hasDelimiters){ - var open, close, result, untilTest; - open = arg$[0], close = arg$[1]; - if (hasDelimiters) { - consumeOp(tokens, open); - } - result = []; - untilTest = "," + (hasDelimiters ? close : ''); - while (tokens.length && (hasDelimiters && tokens[0] !== close)) { - result.push(consumeElement(tokens, untilTest)); - maybeConsumeOp(tokens, ','); - } - if (hasDelimiters) { - consumeOp(tokens, close); - } - return result; - } - function consumeArray(tokens, hasDelimiters){ - return consumeList(tokens, ['[', ']'], hasDelimiters); - } - function consumeTuple(tokens, hasDelimiters){ - return consumeList(tokens, ['(', ')'], hasDelimiters); - } - function consumeFields(tokens, hasDelimiters){ - var result, untilTest, key; - if (hasDelimiters) { - consumeOp(tokens, '{'); - } - result = {}; - untilTest = "," + (hasDelimiters ? '}' : ''); - while (tokens.length && (!hasDelimiters || tokens[0] !== '}')) { - key = consumeValue(tokens, ':'); - consumeOp(tokens, ':'); - result[key] = consumeElement(tokens, untilTest); - maybeConsumeOp(tokens, ','); - } - if (hasDelimiters) { - consumeOp(tokens, '}'); - } - return result; - } - function consumeValue(tokens, untilTest){ - var out; - untilTest == null && (untilTest = ''); - out = ''; - while (tokens.length && -1 === untilTest.indexOf(tokens[0])) { - out += tokens.shift(); - } - return out; - } - function consumeElement(tokens, untilTest){ - switch (tokens[0]) { - case '[': - return consumeArray(tokens, true); - case '(': - return consumeTuple(tokens, true); - case '{': - return consumeFields(tokens, true); - default: - return consumeValue(tokens, untilTest); - } - } - function consumeTopLevel(tokens, types, options){ - var ref$, type, structure, origTokens, result, finalResult, x$, y$; - ref$ = types[0], type = ref$.type, structure = ref$.structure; - origTokens = tokens.concat(); - if (!options.explicit && types.length === 1 && ((!type && structure) || (type === 'Array' || type === 'Object'))) { - result = structure === 'array' || type === 'Array' - ? consumeArray(tokens, tokens[0] === '[') - : structure === 'tuple' - ? consumeTuple(tokens, tokens[0] === '(') - : consumeFields(tokens, tokens[0] === '{'); - finalResult = tokens.length ? consumeElement(structure === 'array' || type === 'Array' - ? (x$ = origTokens, x$.unshift('['), x$.push(']'), x$) - : (y$ = origTokens, y$.unshift('('), y$.push(')'), y$)) : result; - } else { - finalResult = consumeElement(tokens); - } - return finalResult; - } - special = /\[\]\(\)}{:,/.source; - tokenRegex = RegExp('("(?:\\\\"|[^"])*")|(\'(?:\\\\\'|[^\'])*\')|(/(?:\\\\/|[^/])*/[a-zA-Z]*)|(#.*#)|([' + special + '])|([^\\s' + special + '](?:\\s*[^\\s' + special + ']+)*)|\\s*'); - module.exports = function(types, string, options){ - var tokens, node; - options == null && (options = {}); - if (!options.explicit && types.length === 1 && types[0].type === 'String') { - return "'" + string.replace(/\\'/g, "\\\\'") + "'"; - } - tokens = reject(not$, string.split(tokenRegex)); - node = consumeTopLevel(tokens, types, options); - if (!node) { - throw new Error("Error parsing '" + string + "'."); - } - return node; - }; - function not$(x){ return !x; } -}).call(this); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/levn/lib/parse.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/levn/lib/parse.js deleted file mode 100644 index 2beff0f4..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/levn/lib/parse.js +++ /dev/null @@ -1,102 +0,0 @@ -// Generated by LiveScript 1.2.0 -(function(){ - var reject, special, tokenRegex; - reject = require('prelude-ls').reject; - function consumeOp(tokens, op){ - if (tokens[0] === op) { - return tokens.shift(); - } else { - throw new Error("Expected '" + op + "', but got '" + tokens[0] + "' instead in " + JSON.stringify(tokens) + "."); - } - } - function maybeConsumeOp(tokens, op){ - if (tokens[0] === op) { - return tokens.shift(); - } - } - function consumeList(tokens, delimiters, hasDelimiters){ - var result; - if (hasDelimiters) { - consumeOp(tokens, delimiters[0]); - } - result = []; - while (tokens.length && tokens[0] !== delimiters[1]) { - result.push(consumeElement(tokens)); - maybeConsumeOp(tokens, ','); - } - if (hasDelimiters) { - consumeOp(tokens, delimiters[1]); - } - return result; - } - function consumeArray(tokens, hasDelimiters){ - return consumeList(tokens, ['[', ']'], hasDelimiters); - } - function consumeTuple(tokens, hasDelimiters){ - return consumeList(tokens, ['(', ')'], hasDelimiters); - } - function consumeFields(tokens, hasDelimiters){ - var result, key; - if (hasDelimiters) { - consumeOp(tokens, '{'); - } - result = {}; - while (tokens.length && (!hasDelimiters || tokens[0] !== '}')) { - key = tokens.shift(); - consumeOp(tokens, ':'); - result[key] = consumeElement(tokens); - maybeConsumeOp(tokens, ','); - } - if (hasDelimiters) { - consumeOp(tokens, '}'); - } - return result; - } - function consumeElement(tokens){ - switch (tokens[0]) { - case '[': - return consumeArray(tokens, true); - case '(': - return consumeTuple(tokens, true); - case '{': - return consumeFields(tokens, true); - default: - return tokens.shift(); - } - } - function consumeTopLevel(tokens, types){ - var ref$, type, structure, origTokens, result, finalResult, x$, y$; - ref$ = types[0], type = ref$.type, structure = ref$.structure; - origTokens = tokens.concat(); - if (types.length === 1 && (structure || (type === 'Array' || type === 'Object'))) { - result = structure === 'array' || type === 'Array' - ? consumeArray(tokens, tokens[0] === '[') - : structure === 'tuple' - ? consumeTuple(tokens, tokens[0] === '(') - : consumeFields(tokens, tokens[0] === '{'); - finalResult = tokens.length ? consumeElement(structure === 'array' || type === 'Array' - ? (x$ = origTokens, x$.unshift('['), x$.push(']'), x$) - : (y$ = origTokens, y$.unshift('('), y$.push(')'), y$)) : result; - } else { - finalResult = consumeElement(tokens); - } - if (tokens.length && origTokens.length) { - throw new Error("Unable to parse " + JSON.stringify(origTokens) + " of type " + JSON.stringify(types) + "."); - } else { - return finalResult; - } - } - special = /\[\]\(\)}{:,/.source; - tokenRegex = RegExp('("(?:[^"]|\\\\")*")|(\'(?:[^\']|\\\\\')*\')|(#.*#)|(/(?:\\\\/|[^/])*/[gimy]*)|([' + special + '])|([^\\s' + special + ']+)|\\s*'); - module.exports = function(string, types){ - var tokens, node; - tokens = reject(function(it){ - return !it || /^\s+$/.test(it); - }, string.split(tokenRegex)); - node = consumeTopLevel(tokens, types); - if (!node) { - throw new Error("Error parsing '" + string + "'."); - } - return node; - }; -}).call(this); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/levn/package.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/levn/package.json deleted file mode 100644 index 56dfbc42..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/levn/package.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "name": "levn", - "version": "0.3.0", - "author": "George Zahariev ", - "description": "Light ECMAScript (JavaScript) Value Notation - human written, concise, typed, flexible", - "homepage": "https://github.com/gkz/levn", - "keywords": [ - "levn", - "light", - "ecmascript", - "value", - "notation", - "json", - "typed", - "human", - "concise", - "typed", - "flexible" - ], - "files": [ - "lib", - "README.md", - "LICENSE" - ], - "main": "./lib/", - "bugs": "https://github.com/gkz/levn/issues", - "license": "MIT", - "engines": { - "node": ">= 0.8.0" - }, - "repository": { - "type": "git", - "url": "git://github.com/gkz/levn.git" - }, - "scripts": { - "test": "make test" - }, - "dependencies": { - "prelude-ls": "~1.1.2", - "type-check": "~0.3.2" - }, - "devDependencies": { - "livescript": "~1.4.0", - "mocha": "~2.3.4", - "istanbul": "~0.4.1" - } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/limiter/.travis.yml b/packages/wyatt_notification_bloc/example/scripts/node_modules/limiter/.travis.yml deleted file mode 100644 index 247b0f0f..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/limiter/.travis.yml +++ /dev/null @@ -1,9 +0,0 @@ -language: node_js - -node_js: - - "0.12" - - "0.10" - -notifications: - email: - - "jhurliman@jhurliman.org" diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/limiter/LICENSE.txt b/packages/wyatt_notification_bloc/example/scripts/node_modules/limiter/LICENSE.txt deleted file mode 100644 index 13de086a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/limiter/LICENSE.txt +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (C) 2011 by John Hurliman - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/limiter/README.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/limiter/README.md deleted file mode 100644 index 4280e9f6..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/limiter/README.md +++ /dev/null @@ -1,140 +0,0 @@ -# limiter # - -[![Build Status](https://travis-ci.org/jhurliman/node-rate-limiter.png)](https://travis-ci.org/jhurliman/node-rate-limiter) -[![NPM Downloads](https://img.shields.io/npm/dm/limiter.svg?style=flat)](https://www.npmjs.com/package/limiter) - -Provides a generic rate limiter for node.js. Useful for API clients, web -crawling, or other tasks that need to be throttled. Two classes are exposed, -RateLimiter and TokenBucket. TokenBucket provides a lower level interface to -rate limiting with a configurable burst rate and drip rate. RateLimiter sits -on top of the token bucket and adds a restriction on the maximum number of -tokens that can be removed each interval to comply with common API -restrictions like "150 requests per hour maximum". - -## Installation ## - -Use NPM to install: - - npm install limiter - -## Usage ## - -A simple example allowing 150 requests per hour: - -```javascript -var RateLimiter = require('limiter').RateLimiter; -// Allow 150 requests per hour (the Twitter search limit). Also understands -// 'second', 'minute', 'day', or a number of milliseconds -var limiter = new RateLimiter(150, 'hour'); - -// Throttle requests -limiter.removeTokens(1, function(err, remainingRequests) { - // err will only be set if we request more than the maximum number of - // requests we set in the constructor - - // remainingRequests tells us how many additional requests could be sent - // right this moment - - callMyRequestSendingFunction(...); -}); -``` - -Another example allowing one message to be sent every 250ms: - -```javascript -var RateLimiter = require('limiter').RateLimiter; -var limiter = new RateLimiter(1, 250); - -limiter.removeTokens(1, function() { - callMyMessageSendingFunction(...); -}); -``` - -The default behaviour is to wait for the duration of the rate limiting -that’s currently in effect before the callback is fired, but if you -pass in ```true``` as the third parameter, the callback will be fired -immediately with remainingRequests set to -1: - -```javascript -var RateLimiter = require('limiter').RateLimiter; -var limiter = new RateLimiter(150, 'hour', true); // fire CB immediately - -// Immediately send 429 header to client when rate limiting is in effect -limiter.removeTokens(1, function(err, remainingRequests) { - if (remainingRequests < 1) { - response.writeHead(429, {'Content-Type': 'text/plain;charset=UTF-8'}); - response.end('429 Too Many Requests - your IP is being rate limited'); - } else { - callMyMessageSendingFunction(...); - } -}); -``` - -A synchronous method, tryRemoveTokens(), is available in both RateLimiter and TokenBucket. This will return immediately with a boolean value indicating if the token removal was successful. -```javascript -var RateLimiter = require('limiter').RateLimiter; -var limiter = new RateLimiter(10, 'second'); - -if (limiter.tryRemoveTokens(5)) - console.log('Tokens removed'); -else - console.log('No tokens removed'); -``` - -To get the number of remaining tokens **outside** the `removeTokens`-callback -simply use the `getTokensRemaining`-method. -```javascript -var RateLimiter = require('limiter').RateLimiter; -var limiter = new RateLimiter(1, 250); - -// returns 1 since we did not remove a token and our number of tokens per interval is 1 -limiter.getTokensRemaining(); -``` - -Using the token bucket directly to throttle at the byte level: - -```javascript -var BURST_RATE = 1024 * 1024 * 150; // 150KB/sec burst rate -var FILL_RATE = 1024 * 1024 * 50; // 50KB/sec sustained rate -var TokenBucket = require('limiter').TokenBucket; -// We could also pass a parent token bucket in as the last parameter to -// create a hierarchical token bucket -var bucket = new TokenBucket(BURST_RATE, FILL_RATE, 'second', null); - -bucket.removeTokens(myData.byteLength, function() { - sendMyData(myData); -}); -``` - -## Additional Notes ## - -Both the token bucket and rate limiter should be used with a message queue or -some way of preventing multiple simultaneous calls to removeTokens(). -Otherwise, earlier messages may get held up for long periods of time if more -recent messages are continually draining the token bucket. This can lead to -out of order messages or the appearance of "lost" messages under heavy load. - -## License ## - -(The MIT License) - -Copyright (c) 2013 John Hurliman. <jhurliman@jhurliman.org> - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -'Software'), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/limiter/bower.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/limiter/bower.json deleted file mode 100644 index 3e464a26..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/limiter/bower.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "name": "limiter", - "main": "index.js", - "version": "1.0.5", - "homepage": "https://github.com/jhurliman/node-rate-limiter", - "authors": [ - "John Hurliman " - ], - "description": "A generic rate limiter for node.js. Useful for API clients, web crawling, or other tasks that need to be throttled", - "moduleType": [ - "node" - ], - "keywords": [ - "rate", - "limiting", - "throttling" - ], - "license": "MIT", - "ignore": [ - "package.json" - ] -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/limiter/index.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/limiter/index.d.ts deleted file mode 100644 index 7c809df5..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/limiter/index.d.ts +++ /dev/null @@ -1,22 +0,0 @@ -export type TokenBucketError = string -export type Fail = (error: T) => void -export type Success = (error: null, data: T) => void -export type RemoveTokensCallback = Fail | Success - -type Interval = number | 'second' | 'sec' | 'minute' | 'min' | 'hour' | 'hr' | 'day' - -export declare class TokenBucket { - constructor(bucketSize: number, tokensPerInterval: number, interval: Interval, parentBucket?: TokenBucket) - - removeTokens(count: number, callback: RemoveTokensCallback): void - tryRemoveTokens(count: number): boolean - drip(): boolean -} - -export declare class RateLimiter { - constructor(tokensPerInterval: number, interval: Interval, fireImmediately?: boolean) - - removeTokens(count: number, callback: RemoveTokensCallback): void - tryRemoveTokens(count: number): boolean - getTokensRemaining(): number -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/limiter/index.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/limiter/index.js deleted file mode 100644 index 54aea2b3..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/limiter/index.js +++ /dev/null @@ -1,3 +0,0 @@ - -exports.RateLimiter = require('./lib/rateLimiter'); -exports.TokenBucket = require('./lib/tokenBucket'); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/limiter/lib/clock.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/limiter/lib/clock.js deleted file mode 100644 index 30095451..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/limiter/lib/clock.js +++ /dev/null @@ -1,13 +0,0 @@ -var getMilliseconds = function() { - if (typeof process !== 'undefined' && process.hrtime) { - var hrtime = process.hrtime(); - var seconds = hrtime[0]; - var nanoseconds = hrtime[1]; - - return seconds * 1e3 + Math.floor(nanoseconds / 1e6); - } - - return new Date().getTime(); -} - -module.exports = getMilliseconds; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/limiter/lib/rateLimiter.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/limiter/lib/rateLimiter.js deleted file mode 100644 index 65c5ed51..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/limiter/lib/rateLimiter.js +++ /dev/null @@ -1,137 +0,0 @@ -var TokenBucket = require('./tokenBucket'); -var getMilliseconds = require('./clock'); - -/** - * A generic rate limiter. Underneath the hood, this uses a token bucket plus - * an additional check to limit how many tokens we can remove each interval. - * @author John Hurliman - * - * @param {Number} tokensPerInterval Maximum number of tokens that can be - * removed at any given moment and over the course of one interval. - * @param {String|Number} interval The interval length in milliseconds, or as - * one of the following strings: 'second', 'minute', 'hour', day'. - * @param {Boolean} fireImmediately Optional. Whether or not the callback - * will fire immediately when rate limiting is in effect (default is false). - */ -var RateLimiter = function(tokensPerInterval, interval, fireImmediately) { - this.tokenBucket = new TokenBucket(tokensPerInterval, tokensPerInterval, - interval, null); - - // Fill the token bucket to start - this.tokenBucket.content = tokensPerInterval; - - this.curIntervalStart = getMilliseconds(); - this.tokensThisInterval = 0; - this.fireImmediately = fireImmediately; -}; - -RateLimiter.prototype = { - tokenBucket: null, - curIntervalStart: 0, - tokensThisInterval: 0, - fireImmediately: false, - - /** - * Remove the requested number of tokens and fire the given callback. If the - * rate limiter contains enough tokens and we haven't spent too many tokens - * in this interval already, this will happen immediately. Otherwise, the - * removal and callback will happen when enough tokens become available. - * @param {Number} count The number of tokens to remove. - * @param {Function} callback(err, remainingTokens) - * @returns {Boolean} True if the callback was fired immediately, otherwise - * false. - */ - removeTokens: function(count, callback) { - // Make sure the request isn't for more than we can handle - if (count > this.tokenBucket.bucketSize) { - process.nextTick(callback.bind(null, 'Requested tokens ' + count + - ' exceeds maximum tokens per interval ' + this.tokenBucket.bucketSize, - null)); - return false; - } - - var self = this; - var now = getMilliseconds(); - - // Advance the current interval and reset the current interval token count - // if needed - if (now < this.curIntervalStart - || now - this.curIntervalStart >= this.tokenBucket.interval) { - this.curIntervalStart = now; - this.tokensThisInterval = 0; - } - - // If we don't have enough tokens left in this interval, wait until the - // next interval - if (count > this.tokenBucket.tokensPerInterval - this.tokensThisInterval) { - if (this.fireImmediately) { - process.nextTick(callback.bind(null, null, -1)); - } else { - var waitInterval = Math.ceil( - this.curIntervalStart + this.tokenBucket.interval - now); - - setTimeout(function() { - self.tokenBucket.removeTokens(count, afterTokensRemoved); - }, waitInterval); - } - return false; - } - - // Remove the requested number of tokens from the token bucket - return this.tokenBucket.removeTokens(count, afterTokensRemoved); - - function afterTokensRemoved(err, tokensRemaining) { - if (err) return callback(err, null); - - self.tokensThisInterval += count; - callback(null, tokensRemaining); - } - }, - - /** - * Attempt to remove the requested number of tokens and return immediately. - * If the bucket (and any parent buckets) contains enough tokens and we - * haven't spent too many tokens in this interval already, this will return - * true. Otherwise, false is returned. - * @param {Number} count The number of tokens to remove. - * @param {Boolean} True if the tokens were successfully removed, otherwise - * false. - */ - tryRemoveTokens: function(count) { - // Make sure the request isn't for more than we can handle - if (count > this.tokenBucket.bucketSize) - return false; - - var now = getMilliseconds(); - - // Advance the current interval and reset the current interval token count - // if needed - if (now < this.curIntervalStart - || now - this.curIntervalStart >= this.tokenBucket.interval) { - this.curIntervalStart = now; - this.tokensThisInterval = 0; - } - - // If we don't have enough tokens left in this interval, return false - if (count > this.tokenBucket.tokensPerInterval - this.tokensThisInterval) - return false; - - // Try to remove the requested number of tokens from the token bucket - var removed = this.tokenBucket.tryRemoveTokens(count); - if (removed) { - this.tokensThisInterval += count; - } - return removed; - }, - - /** - * Returns the number of tokens remaining in the TokenBucket. - * @returns {Number} The number of tokens remaining. - */ - getTokensRemaining: function () { - this.tokenBucket.drip(); - return this.tokenBucket.content; - } -}; - -module.exports = RateLimiter; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/limiter/lib/tokenBucket.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/limiter/lib/tokenBucket.js deleted file mode 100644 index 2b9343f1..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/limiter/lib/tokenBucket.js +++ /dev/null @@ -1,167 +0,0 @@ - -/** - * A hierarchical token bucket for rate limiting. See - * http://en.wikipedia.org/wiki/Token_bucket for more information. - * @author John Hurliman - * - * @param {Number} bucketSize Maximum number of tokens to hold in the bucket. - * Also known as the burst rate. - * @param {Number} tokensPerInterval Number of tokens to drip into the bucket - * over the course of one interval. - * @param {String|Number} interval The interval length in milliseconds, or as - * one of the following strings: 'second', 'minute', 'hour', day'. - * @param {TokenBucket} parentBucket Optional. A token bucket that will act as - * the parent of this bucket. - */ -var TokenBucket = function(bucketSize, tokensPerInterval, interval, parentBucket) { - this.bucketSize = bucketSize; - this.tokensPerInterval = tokensPerInterval; - - if (typeof interval === 'string') { - switch (interval) { - case 'sec': case 'second': - this.interval = 1000; break; - case 'min': case 'minute': - this.interval = 1000 * 60; break; - case 'hr': case 'hour': - this.interval = 1000 * 60 * 60; break; - case 'day': - this.interval = 1000 * 60 * 60 * 24; break; - default: - throw new Error('Invaid interval ' + interval); - } - } else { - this.interval = interval; - } - - this.parentBucket = parentBucket; - this.content = 0; - this.lastDrip = +new Date(); -}; - -TokenBucket.prototype = { - bucketSize: 1, - tokensPerInterval: 1, - interval: 1000, - parentBucket: null, - content: 0, - lastDrip: 0, - - /** - * Remove the requested number of tokens and fire the given callback. If the - * bucket (and any parent buckets) contains enough tokens this will happen - * immediately. Otherwise, the removal and callback will happen when enough - * tokens become available. - * @param {Number} count The number of tokens to remove. - * @param {Function} callback(err, remainingTokens) - * @returns {Boolean} True if the callback was fired immediately, otherwise - * false. - */ - removeTokens: function(count, callback) { - var self = this; - - // Is this an infinite size bucket? - if (!this.bucketSize) { - process.nextTick(callback.bind(null, null, count, Number.POSITIVE_INFINITY)); - return true; - } - - // Make sure the bucket can hold the requested number of tokens - if (count > this.bucketSize) { - process.nextTick(callback.bind(null, 'Requested tokens ' + count + ' exceeds bucket size ' + - this.bucketSize, null)); - return false; - } - - // Drip new tokens into this bucket - this.drip(); - - // If we don't have enough tokens in this bucket, come back later - if (count > this.content) - return comeBackLater(); - - if (this.parentBucket) { - // Remove the requested from the parent bucket first - return this.parentBucket.removeTokens(count, function(err, remainingTokens) { - if (err) return callback(err, null); - - // Check that we still have enough tokens in this bucket - if (count > self.content) - return comeBackLater(); - - // Tokens were removed from the parent bucket, now remove them from - // this bucket and fire the callback. Note that we look at the current - // bucket and parent bucket's remaining tokens and return the smaller - // of the two values - self.content -= count; - callback(null, Math.min(remainingTokens, self.content)); - }); - } else { - // Remove the requested tokens from this bucket and fire the callback - this.content -= count; - process.nextTick(callback.bind(null, null, this.content)); - return true; - } - - function comeBackLater() { - // How long do we need to wait to make up the difference in tokens? - var waitInterval = Math.ceil( - (count - self.content) * (self.interval / self.tokensPerInterval)); - setTimeout(function() { self.removeTokens(count, callback); }, waitInterval); - return false; - } - }, - - /** - * Attempt to remove the requested number of tokens and return immediately. - * If the bucket (and any parent buckets) contains enough tokens this will - * return true, otherwise false is returned. - * @param {Number} count The number of tokens to remove. - * @param {Boolean} True if the tokens were successfully removed, otherwise - * false. - */ - tryRemoveTokens: function(count) { - // Is this an infinite size bucket? - if (!this.bucketSize) - return true; - - // Make sure the bucket can hold the requested number of tokens - if (count > this.bucketSize) - return false; - - // Drip new tokens into this bucket - this.drip(); - - // If we don't have enough tokens in this bucket, return false - if (count > this.content) - return false; - - // Try to remove the requested tokens from the parent bucket - if (this.parentBucket && !this.parentBucket.tryRemoveTokens(count)) - return false; - - // Remove the requested tokens from this bucket and return - this.content -= count; - return true; - }, - - /** - * Add any new tokens to the bucket since the last drip. - * @returns {Boolean} True if new tokens were added, otherwise false. - */ - drip: function() { - if (!this.tokensPerInterval) { - this.content = this.bucketSize; - return; - } - - var now = +new Date(); - var deltaMS = Math.max(now - this.lastDrip, 0); - this.lastDrip = now; - - var dripAmount = deltaMS * (this.tokensPerInterval / this.interval); - this.content = Math.min(this.content + dripAmount, this.bucketSize); - } -}; - -module.exports = TokenBucket; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/limiter/package.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/limiter/package.json deleted file mode 100644 index 894422a6..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/limiter/package.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "name": "limiter", - "description": "A generic rate limiter for node.js. Useful for API clients, web crawling, or other tasks that need to be throttled", - "version": "1.1.5", - "author": "John Hurliman ", - "scripts": { - "test": "vows --spec" - }, - "dependencies": { - }, - "devDependencies": { - "assert": "1.3.0", - "vows": "0.8.1" - }, - "keywords": ["rate", "limiting", "throttling"], - "repository": "git://github.com/jhurliman/node-rate-limiter", - "bugs": { "url": "http://github.com/jhurliman/node-rate-limiter/issues" }, - "directories": { "lib": "./lib/" }, - "main": "./index.js", - "types": "./index.d.ts", - "licenses": [{ - "type": "MIT", - "url": "http://github.com/jhurliman/node-rate-limiter/raw/master/LICENSE.txt" - }] -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/limiter/test/ratelimiter-test.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/limiter/test/ratelimiter-test.js deleted file mode 100644 index 16912184..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/limiter/test/ratelimiter-test.js +++ /dev/null @@ -1,20 +0,0 @@ -var vows = require('vows'); -var assert = require('assert'); -var RateLimiter = require('../lib/rateLimiter'); - -vows.describe('RateLimiter').addBatch({ - 'interval validation': { - 'invalid interval': function() { - assert.throws(function() { new RateLimiter(1, 'junk'); }, /interval/); - }, - 'valid intervals': function() { - assert.doesNotThrow(function() { new RateLimiter(1, 'sec'); }); - assert.doesNotThrow(function() { new RateLimiter(1, 'second'); }); - assert.doesNotThrow(function() { new RateLimiter(1, 'min'); }); - assert.doesNotThrow(function() { new RateLimiter(1, 'minute'); }); - assert.doesNotThrow(function() { new RateLimiter(1, 'hr'); }); - assert.doesNotThrow(function() { new RateLimiter(1, 'hour'); }); - assert.doesNotThrow(function() { new RateLimiter(1, 'day'); }); - } - } -}).export(module); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/limiter/test/tokenbucket-test.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/limiter/test/tokenbucket-test.js deleted file mode 100644 index a058285f..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/limiter/test/tokenbucket-test.js +++ /dev/null @@ -1,67 +0,0 @@ -var vows = require('vows'); -var assert = require('assert'); - -var TIMING_EPSILON = 10; - -var TokenBucket = require('../lib/tokenBucket'); - -vows.describe('TokenBucket').addBatch({ - 'capacity 10, 1 per 100ms': { - topic: new TokenBucket(10, 1, 100), - - 'is initialized empty': function(bucket) { - assert.equal(bucket.bucketSize, 10); - assert.equal(bucket.tokensPerInterval, 1); - assert.equal(bucket.content, 0); - }, - 'removing 10 tokens': { - topic: function(bucket) { - this.gStart = +new Date(); - bucket.removeTokens(10, this.callback); - }, - 'takes 1 second': function(remainingTokens) { - var duration = +new Date() - this.gStart; - var diff = Math.abs(1000 - duration); - assert.ok(diff < TIMING_EPSILON, diff+''); - assert.equal(remainingTokens, 0); - }, - 'and removing another 10 tokens': { - topic: function(_, bucket) { - this.gStart = +new Date(); - assert.equal(bucket.content, 0); - bucket.removeTokens(10, this.callback); - }, - 'takes 1 second': function() { - var duration = +new Date() - this.gStart; - var diff = Math.abs(1000 - duration); - assert.ok(diff < TIMING_EPSILON, diff+''); - } - }, - 'and waiting 2 seconds': { - topic: function(_, bucket) { - var self = this; - setTimeout(function() { - self.gStart = +new Date(); - bucket.removeTokens(10, self.callback); - }, 2000); - }, - 'gives us only 10 tokens': function(remainingTokens) { - var duration = +new Date() - this.gStart; - assert.ok(duration < TIMING_EPSILON, duration+''); - assert.equal(remainingTokens, 0); - }, - 'and removing 1 token': { - topic: function(_, _, bucket) { - this.gStart = +new Date(); - bucket.removeTokens(1, this.callback); - }, - 'takes 100ms': function() { - var duration = +new Date() - this.gStart; - var diff = Math.abs(100 - duration); - assert.ok(diff < TIMING_EPSILON, diff+''); - } - } - } - } - }, -}).export(module); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/linkify-it/CHANGELOG.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/linkify-it/CHANGELOG.md deleted file mode 100644 index 6fa47da0..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/linkify-it/CHANGELOG.md +++ /dev/null @@ -1,182 +0,0 @@ -3.0.3 / 2021-10-01 ------------------- - -- Fixed #98. Don't count `;` at the end of link (when followed with space). - - -3.0.2 / 2020-05-20 ------------------- - -- Proper fix for #54. Allow multiple `!` in links (but not at the end). - - -3.0.1 / 2020-05-19 ------------------- - -- Reverted #54 fix (allowed multiple `!` in links), and added collision - sample. - - -3.0.0 / 2020-05-19 ------------------- - -- Allow unlimited `.` inside link params, #81. This should not be breaking, but - bumped version for sure. -- Allow `..&` in params, #87. -- Allow multiple `!` in links, #54. -- Deps bump. -- Rewrite build scripts. - - -2.2.0 / 2019-07-12 ------------------- - -- Improved quoted email detect (disable `"` at email start), #72. -- Fix some google links (allow more consecutive `.`), #66. - - -2.1.0 / 2018-11-27 ------------------- - -- Allow `--` (and more dashes) in domain names, #63. - - -2.0.3 / 2016-12-09 ------------------- - -- Process `|` (asian vertical pipe 0xFF5C) as valid text separator. - - -2.0.2 / 2016-10-15 ------------------- - -- Allow dashes in local domains, #43. - - -2.0.1 / 2016-09-28 ------------------- - -- Restrict user:pass@... content - prohibit "()[]" chars in auth, #41. - - -2.0.0 / 2016-06-22 ------------------- - -- `---` no longer terminates link. Use option `{ '---': true }` to return old - behaviour. -- `.onCompile()` hook to modify base regexp constants. -- Allow `foo'-bar` in path - - -1.2.4 / 2016-06-03 ------------------- - -- Consider `<` & `>` as invalid in links. -- Support links in lt/gt braces: ``, ``. - - -1.2.3 / 2016-05-31 ------------------- - -- Allow digits in local domains, #36. -- Restrict user/pass (prohibit [@/] chars) to avoid wrong domain fetch. -- More restrictions for protocol-transparent links. Don't allow single-level - (local) domains, except '//localhost', #19. - - -1.2.2 / 2016-05-30 ------------------- - -- Security fix: due problem in `Any` class regexp from old `unicode-7.0.0` - package (used in `uc-micro`), hang happend with astral char patterns like - `😡😡😡😡😡😡😡😡😡😡😡😡😡😡😡😡😡😡😡😡😡😡😡😡😡😡😡😡😡😡😡😡😡😡😡 .com` if fuzzy - options used. New installs will use fixed `uc-micro` automatically. - Old installs need to be updated. #36. -- Unicode rules updated to 8.+ version. - - -1.2.1 / 2016-04-29 ------------------- - -- Fix detect email after opening parenthesis: `(my@email.com)`, #32. - - -1.2.0 / 2015-06-29 ------------------- - -- Allow dash at the end of url, thanks to @Mumakil. - - -1.1.1 / 2015-06-09 ------------------- - -- Allow ".." in link paths. - - -1.1.0 / 2015-04-21 ------------------- - -- Added options to control fuzzy links recognition (`fuzzyLink: true`, - `fuzzyEmail: true`, `fuzzyIP: false`). -- Disabled IP-links without schema prefix by default. - - -1.0.1 / 2015-04-19 ------------------- - -- More strict default 2-characters tlds handle in fuzzy links, to avoid - false positives for `node.js`, `io.js` and so on. - - -1.0.0 / 2015-03-25 ------------------- - -- Version bump to 1.0.0 for semver. -- Removed `Cf` class from whitespace & punctuation sets (#10). -- API change. Exported regex names renamed to reflect changes. Update your - custom rules if needed: - - `src_ZPCcCf` -> `src_ZPCc` - - `src_ZCcCf` -> `src_ZCc` - - -0.1.5 / 2015-03-13 ------------------- - -- Fixed special chars handling (line breaks). -- Fixed demo permalink encode/decode. - - -0.1.4 / 2015-03-12 ------------------- - -- Allow `..` and `...` inside of link paths (#9). Useful for github links with - commit ranges. -- Added `.pretest()` method for speed optimizations. -- Autogenerate demo sample from fixtures. - - -0.1.3 / 2015-03-11 ------------------- - -- Maintenance release. Deps update. - - -0.1.2 / 2015-02-26 ------------------- - -- Fixed blockquoted links (some symbols exclusions), thanks to @MayhemYDG. -- Fixed demo permalinks, thanks to @MayhemYDG. - - -0.1.1 / 2015-02-22 ------------------- - -- Moved unicode data to external package. -- Demo permalink improvements. -- Docs update. - - -0.1.0 / 2015-02-12 ------------------- - -- First release. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/linkify-it/LICENSE b/packages/wyatt_notification_bloc/example/scripts/node_modules/linkify-it/LICENSE deleted file mode 100644 index 67596f5f..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/linkify-it/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -Copyright (c) 2015 Vitaly Puzrin. - -Permission is hereby granted, free of charge, to any person -obtaining a copy of this software and associated documentation -files (the "Software"), to deal in the Software without -restriction, including without limitation the rights to use, -copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following -conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/linkify-it/README.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/linkify-it/README.md deleted file mode 100644 index 76eed7e5..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/linkify-it/README.md +++ /dev/null @@ -1,188 +0,0 @@ -linkify-it -========== - -[![Build Status](https://img.shields.io/travis/markdown-it/linkify-it/master.svg?style=flat)](https://travis-ci.org/markdown-it/linkify-it) -[![NPM version](https://img.shields.io/npm/v/linkify-it.svg?style=flat)](https://www.npmjs.org/package/linkify-it) -[![Coverage Status](https://img.shields.io/coveralls/markdown-it/linkify-it/master.svg?style=flat)](https://coveralls.io/r/markdown-it/linkify-it?branch=master) -[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/markdown-it/linkify-it) - -> Links recognition library with FULL unicode support. -> Focused on high quality link patterns detection in plain text. - -__[Demo](http://markdown-it.github.io/linkify-it/)__ - -Why it's awesome: - -- Full unicode support, _with astral characters_! -- International domains support. -- Allows rules extension & custom normalizers. - - -Install -------- - -```bash -npm install linkify-it --save -``` - -Browserification is also supported. - - -Usage examples --------------- - -##### Example 1 - -```js -var linkify = require('linkify-it')(); - -// Reload full tlds list & add unofficial `.onion` domain. -linkify - .tlds(require('tlds')) // Reload with full tlds list - .tlds('onion', true) // Add unofficial `.onion` domain - .add('git:', 'http:') // Add `git:` protocol as "alias" - .add('ftp:', null) // Disable `ftp:` protocol - .set({ fuzzyIP: true }); // Enable IPs in fuzzy links (without schema) - -console.log(linkify.test('Site github.com!')); // true - -console.log(linkify.match('Site github.com!')); // [ { - // schema: "", - // index: 5, - // lastIndex: 15, - // raw: "github.com", - // text: "github.com", - // url: "http://github.com", - // } ] -``` - -##### Example 2. Add twitter mentions handler - -```js -linkify.add('@', { - validate: function (text, pos, self) { - var tail = text.slice(pos); - - if (!self.re.twitter) { - self.re.twitter = new RegExp( - '^([a-zA-Z0-9_]){1,15}(?!_)(?=$|' + self.re.src_ZPCc + ')' - ); - } - if (self.re.twitter.test(tail)) { - // Linkifier allows punctuation chars before prefix, - // but we additionally disable `@` ("@@mention" is invalid) - if (pos >= 2 && tail[pos - 2] === '@') { - return false; - } - return tail.match(self.re.twitter)[0].length; - } - return 0; - }, - normalize: function (match) { - match.url = 'https://twitter.com/' + match.url.replace(/^@/, ''); - } -}); -``` - - -API ---- - -__[API documentation](http://markdown-it.github.io/linkify-it/doc)__ - -### new LinkifyIt(schemas, options) - -Creates new linkifier instance with optional additional schemas. -Can be called without `new` keyword for convenience. - -By default understands: - -- `http(s)://...` , `ftp://...`, `mailto:...` & `//...` links -- "fuzzy" links and emails (google.com, foo@bar.com). - -`schemas` is an object, where each key/value describes protocol/rule: - -- __key__ - link prefix (usually, protocol name with `:` at the end, `skype:` - for example). `linkify-it` makes sure that prefix is not preceded with - alphanumeric char. -- __value__ - rule to check tail after link prefix - - _String_ - just alias to existing rule - - _Object_ - - _validate_ - either a `RegExp` (start with `^`, and don't include the - link prefix itself), or a validator function which, given arguments - _text_, _pos_, and _self_, returns the length of a match in _text_ - starting at index _pos_. _pos_ is the index right after the link prefix. - _self_ can be used to access the linkify object to cache data. - - _normalize_ - optional function to normalize text & url of matched result - (for example, for twitter mentions). - -`options`: - -- __fuzzyLink__ - recognize URL-s without `http(s)://` head. Default `true`. -- __fuzzyIP__ - allow IPs in fuzzy links above. Can conflict with some texts - like version numbers. Default `false`. -- __fuzzyEmail__ - recognize emails without `mailto:` prefix. Default `true`. -- __---__ - set `true` to terminate link with `---` (if it's considered as long dash). - - -### .test(text) - -Searches linkifiable pattern and returns `true` on success or `false` on fail. - - -### .pretest(text) - -Quick check if link MAY BE can exist. Can be used to optimize more expensive -`.test()` calls. Return `false` if link can not be found, `true` - if `.test()` -call needed to know exactly. - - -### .testSchemaAt(text, name, offset) - -Similar to `.test()` but checks only specific protocol tail exactly at given -position. Returns length of found pattern (0 on fail). - - -### .match(text) - -Returns `Array` of found link matches or null if nothing found. - -Each match has: - -- __schema__ - link schema, can be empty for fuzzy links, or `//` for - protocol-neutral links. -- __index__ - offset of matched text -- __lastIndex__ - index of next char after mathch end -- __raw__ - matched text -- __text__ - normalized text -- __url__ - link, generated from matched text - - -### .tlds(list[, keepOld]) - -Load (or merge) new tlds list. Those are needed for fuzzy links (without schema) -to avoid false positives. By default: - -- 2-letter root zones are ok. -- biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф are ok. -- encoded (`xn--...`) root zones are ok. - -If that's not enough, you can reload defaults with more detailed zones list. - -### .add(key, value) - -Add a new schema to the schemas object. As described in the constructor -definition, `key` is a link prefix (`skype:`, for example), and `value` -is a String to alias to another schema, or an Object with `validate` and -optionally `normalize` definitions. To disable an existing rule, use -`.add(key, null)`. - - -### .set(options) - -Override default options. Missed properties will not be changed. - - -## License - -[MIT](https://github.com/markdown-it/linkify-it/blob/master/LICENSE) diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/linkify-it/index.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/linkify-it/index.js deleted file mode 100644 index 5c0d5722..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/linkify-it/index.js +++ /dev/null @@ -1,636 +0,0 @@ -'use strict'; - - -//////////////////////////////////////////////////////////////////////////////// -// Helpers - -// Merge objects -// -function assign(obj /*from1, from2, from3, ...*/) { - var sources = Array.prototype.slice.call(arguments, 1); - - sources.forEach(function (source) { - if (!source) { return; } - - Object.keys(source).forEach(function (key) { - obj[key] = source[key]; - }); - }); - - return obj; -} - -function _class(obj) { return Object.prototype.toString.call(obj); } -function isString(obj) { return _class(obj) === '[object String]'; } -function isObject(obj) { return _class(obj) === '[object Object]'; } -function isRegExp(obj) { return _class(obj) === '[object RegExp]'; } -function isFunction(obj) { return _class(obj) === '[object Function]'; } - - -function escapeRE(str) { return str.replace(/[.?*+^$[\]\\(){}|-]/g, '\\$&'); } - -//////////////////////////////////////////////////////////////////////////////// - - -var defaultOptions = { - fuzzyLink: true, - fuzzyEmail: true, - fuzzyIP: false -}; - - -function isOptionsObj(obj) { - return Object.keys(obj || {}).reduce(function (acc, k) { - return acc || defaultOptions.hasOwnProperty(k); - }, false); -} - - -var defaultSchemas = { - 'http:': { - validate: function (text, pos, self) { - var tail = text.slice(pos); - - if (!self.re.http) { - // compile lazily, because "host"-containing variables can change on tlds update. - self.re.http = new RegExp( - '^\\/\\/' + self.re.src_auth + self.re.src_host_port_strict + self.re.src_path, 'i' - ); - } - if (self.re.http.test(tail)) { - return tail.match(self.re.http)[0].length; - } - return 0; - } - }, - 'https:': 'http:', - 'ftp:': 'http:', - '//': { - validate: function (text, pos, self) { - var tail = text.slice(pos); - - if (!self.re.no_http) { - // compile lazily, because "host"-containing variables can change on tlds update. - self.re.no_http = new RegExp( - '^' + - self.re.src_auth + - // Don't allow single-level domains, because of false positives like '//test' - // with code comments - '(?:localhost|(?:(?:' + self.re.src_domain + ')\\.)+' + self.re.src_domain_root + ')' + - self.re.src_port + - self.re.src_host_terminator + - self.re.src_path, - - 'i' - ); - } - - if (self.re.no_http.test(tail)) { - // should not be `://` & `///`, that protects from errors in protocol name - if (pos >= 3 && text[pos - 3] === ':') { return 0; } - if (pos >= 3 && text[pos - 3] === '/') { return 0; } - return tail.match(self.re.no_http)[0].length; - } - return 0; - } - }, - 'mailto:': { - validate: function (text, pos, self) { - var tail = text.slice(pos); - - if (!self.re.mailto) { - self.re.mailto = new RegExp( - '^' + self.re.src_email_name + '@' + self.re.src_host_strict, 'i' - ); - } - if (self.re.mailto.test(tail)) { - return tail.match(self.re.mailto)[0].length; - } - return 0; - } - } -}; - -/*eslint-disable max-len*/ - -// RE pattern for 2-character tlds (autogenerated by ./support/tlds_2char_gen.js) -var tlds_2ch_src_re = 'a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]'; - -// DON'T try to make PRs with changes. Extend TLDs with LinkifyIt.tlds() instead -var tlds_default = 'biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф'.split('|'); - -/*eslint-enable max-len*/ - -//////////////////////////////////////////////////////////////////////////////// - -function resetScanCache(self) { - self.__index__ = -1; - self.__text_cache__ = ''; -} - -function createValidator(re) { - return function (text, pos) { - var tail = text.slice(pos); - - if (re.test(tail)) { - return tail.match(re)[0].length; - } - return 0; - }; -} - -function createNormalizer() { - return function (match, self) { - self.normalize(match); - }; -} - -// Schemas compiler. Build regexps. -// -function compile(self) { - - // Load & clone RE patterns. - var re = self.re = require('./lib/re')(self.__opts__); - - // Define dynamic patterns - var tlds = self.__tlds__.slice(); - - self.onCompile(); - - if (!self.__tlds_replaced__) { - tlds.push(tlds_2ch_src_re); - } - tlds.push(re.src_xn); - - re.src_tlds = tlds.join('|'); - - function untpl(tpl) { return tpl.replace('%TLDS%', re.src_tlds); } - - re.email_fuzzy = RegExp(untpl(re.tpl_email_fuzzy), 'i'); - re.link_fuzzy = RegExp(untpl(re.tpl_link_fuzzy), 'i'); - re.link_no_ip_fuzzy = RegExp(untpl(re.tpl_link_no_ip_fuzzy), 'i'); - re.host_fuzzy_test = RegExp(untpl(re.tpl_host_fuzzy_test), 'i'); - - // - // Compile each schema - // - - var aliases = []; - - self.__compiled__ = {}; // Reset compiled data - - function schemaError(name, val) { - throw new Error('(LinkifyIt) Invalid schema "' + name + '": ' + val); - } - - Object.keys(self.__schemas__).forEach(function (name) { - var val = self.__schemas__[name]; - - // skip disabled methods - if (val === null) { return; } - - var compiled = { validate: null, link: null }; - - self.__compiled__[name] = compiled; - - if (isObject(val)) { - if (isRegExp(val.validate)) { - compiled.validate = createValidator(val.validate); - } else if (isFunction(val.validate)) { - compiled.validate = val.validate; - } else { - schemaError(name, val); - } - - if (isFunction(val.normalize)) { - compiled.normalize = val.normalize; - } else if (!val.normalize) { - compiled.normalize = createNormalizer(); - } else { - schemaError(name, val); - } - - return; - } - - if (isString(val)) { - aliases.push(name); - return; - } - - schemaError(name, val); - }); - - // - // Compile postponed aliases - // - - aliases.forEach(function (alias) { - if (!self.__compiled__[self.__schemas__[alias]]) { - // Silently fail on missed schemas to avoid errons on disable. - // schemaError(alias, self.__schemas__[alias]); - return; - } - - self.__compiled__[alias].validate = - self.__compiled__[self.__schemas__[alias]].validate; - self.__compiled__[alias].normalize = - self.__compiled__[self.__schemas__[alias]].normalize; - }); - - // - // Fake record for guessed links - // - self.__compiled__[''] = { validate: null, normalize: createNormalizer() }; - - // - // Build schema condition - // - var slist = Object.keys(self.__compiled__) - .filter(function (name) { - // Filter disabled & fake schemas - return name.length > 0 && self.__compiled__[name]; - }) - .map(escapeRE) - .join('|'); - // (?!_) cause 1.5x slowdown - self.re.schema_test = RegExp('(^|(?!_)(?:[><\uff5c]|' + re.src_ZPCc + '))(' + slist + ')', 'i'); - self.re.schema_search = RegExp('(^|(?!_)(?:[><\uff5c]|' + re.src_ZPCc + '))(' + slist + ')', 'ig'); - - self.re.pretest = RegExp( - '(' + self.re.schema_test.source + ')|(' + self.re.host_fuzzy_test.source + ')|@', - 'i' - ); - - // - // Cleanup - // - - resetScanCache(self); -} - -/** - * class Match - * - * Match result. Single element of array, returned by [[LinkifyIt#match]] - **/ -function Match(self, shift) { - var start = self.__index__, - end = self.__last_index__, - text = self.__text_cache__.slice(start, end); - - /** - * Match#schema -> String - * - * Prefix (protocol) for matched string. - **/ - this.schema = self.__schema__.toLowerCase(); - /** - * Match#index -> Number - * - * First position of matched string. - **/ - this.index = start + shift; - /** - * Match#lastIndex -> Number - * - * Next position after matched string. - **/ - this.lastIndex = end + shift; - /** - * Match#raw -> String - * - * Matched string. - **/ - this.raw = text; - /** - * Match#text -> String - * - * Notmalized text of matched string. - **/ - this.text = text; - /** - * Match#url -> String - * - * Normalized url of matched string. - **/ - this.url = text; -} - -function createMatch(self, shift) { - var match = new Match(self, shift); - - self.__compiled__[match.schema].normalize(match, self); - - return match; -} - - -/** - * class LinkifyIt - **/ - -/** - * new LinkifyIt(schemas, options) - * - schemas (Object): Optional. Additional schemas to validate (prefix/validator) - * - options (Object): { fuzzyLink|fuzzyEmail|fuzzyIP: true|false } - * - * Creates new linkifier instance with optional additional schemas. - * Can be called without `new` keyword for convenience. - * - * By default understands: - * - * - `http(s)://...` , `ftp://...`, `mailto:...` & `//...` links - * - "fuzzy" links and emails (example.com, foo@bar.com). - * - * `schemas` is an object, where each key/value describes protocol/rule: - * - * - __key__ - link prefix (usually, protocol name with `:` at the end, `skype:` - * for example). `linkify-it` makes shure that prefix is not preceeded with - * alphanumeric char and symbols. Only whitespaces and punctuation allowed. - * - __value__ - rule to check tail after link prefix - * - _String_ - just alias to existing rule - * - _Object_ - * - _validate_ - validator function (should return matched length on success), - * or `RegExp`. - * - _normalize_ - optional function to normalize text & url of matched result - * (for example, for @twitter mentions). - * - * `options`: - * - * - __fuzzyLink__ - recognige URL-s without `http(s):` prefix. Default `true`. - * - __fuzzyIP__ - allow IPs in fuzzy links above. Can conflict with some texts - * like version numbers. Default `false`. - * - __fuzzyEmail__ - recognize emails without `mailto:` prefix. - * - **/ -function LinkifyIt(schemas, options) { - if (!(this instanceof LinkifyIt)) { - return new LinkifyIt(schemas, options); - } - - if (!options) { - if (isOptionsObj(schemas)) { - options = schemas; - schemas = {}; - } - } - - this.__opts__ = assign({}, defaultOptions, options); - - // Cache last tested result. Used to skip repeating steps on next `match` call. - this.__index__ = -1; - this.__last_index__ = -1; // Next scan position - this.__schema__ = ''; - this.__text_cache__ = ''; - - this.__schemas__ = assign({}, defaultSchemas, schemas); - this.__compiled__ = {}; - - this.__tlds__ = tlds_default; - this.__tlds_replaced__ = false; - - this.re = {}; - - compile(this); -} - - -/** chainable - * LinkifyIt#add(schema, definition) - * - schema (String): rule name (fixed pattern prefix) - * - definition (String|RegExp|Object): schema definition - * - * Add new rule definition. See constructor description for details. - **/ -LinkifyIt.prototype.add = function add(schema, definition) { - this.__schemas__[schema] = definition; - compile(this); - return this; -}; - - -/** chainable - * LinkifyIt#set(options) - * - options (Object): { fuzzyLink|fuzzyEmail|fuzzyIP: true|false } - * - * Set recognition options for links without schema. - **/ -LinkifyIt.prototype.set = function set(options) { - this.__opts__ = assign(this.__opts__, options); - return this; -}; - - -/** - * LinkifyIt#test(text) -> Boolean - * - * Searches linkifiable pattern and returns `true` on success or `false` on fail. - **/ -LinkifyIt.prototype.test = function test(text) { - // Reset scan cache - this.__text_cache__ = text; - this.__index__ = -1; - - if (!text.length) { return false; } - - var m, ml, me, len, shift, next, re, tld_pos, at_pos; - - // try to scan for link with schema - that's the most simple rule - if (this.re.schema_test.test(text)) { - re = this.re.schema_search; - re.lastIndex = 0; - while ((m = re.exec(text)) !== null) { - len = this.testSchemaAt(text, m[2], re.lastIndex); - if (len) { - this.__schema__ = m[2]; - this.__index__ = m.index + m[1].length; - this.__last_index__ = m.index + m[0].length + len; - break; - } - } - } - - if (this.__opts__.fuzzyLink && this.__compiled__['http:']) { - // guess schemaless links - tld_pos = text.search(this.re.host_fuzzy_test); - if (tld_pos >= 0) { - // if tld is located after found link - no need to check fuzzy pattern - if (this.__index__ < 0 || tld_pos < this.__index__) { - if ((ml = text.match(this.__opts__.fuzzyIP ? this.re.link_fuzzy : this.re.link_no_ip_fuzzy)) !== null) { - - shift = ml.index + ml[1].length; - - if (this.__index__ < 0 || shift < this.__index__) { - this.__schema__ = ''; - this.__index__ = shift; - this.__last_index__ = ml.index + ml[0].length; - } - } - } - } - } - - if (this.__opts__.fuzzyEmail && this.__compiled__['mailto:']) { - // guess schemaless emails - at_pos = text.indexOf('@'); - if (at_pos >= 0) { - // We can't skip this check, because this cases are possible: - // 192.168.1.1@gmail.com, my.in@example.com - if ((me = text.match(this.re.email_fuzzy)) !== null) { - - shift = me.index + me[1].length; - next = me.index + me[0].length; - - if (this.__index__ < 0 || shift < this.__index__ || - (shift === this.__index__ && next > this.__last_index__)) { - this.__schema__ = 'mailto:'; - this.__index__ = shift; - this.__last_index__ = next; - } - } - } - } - - return this.__index__ >= 0; -}; - - -/** - * LinkifyIt#pretest(text) -> Boolean - * - * Very quick check, that can give false positives. Returns true if link MAY BE - * can exists. Can be used for speed optimization, when you need to check that - * link NOT exists. - **/ -LinkifyIt.prototype.pretest = function pretest(text) { - return this.re.pretest.test(text); -}; - - -/** - * LinkifyIt#testSchemaAt(text, name, position) -> Number - * - text (String): text to scan - * - name (String): rule (schema) name - * - position (Number): text offset to check from - * - * Similar to [[LinkifyIt#test]] but checks only specific protocol tail exactly - * at given position. Returns length of found pattern (0 on fail). - **/ -LinkifyIt.prototype.testSchemaAt = function testSchemaAt(text, schema, pos) { - // If not supported schema check requested - terminate - if (!this.__compiled__[schema.toLowerCase()]) { - return 0; - } - return this.__compiled__[schema.toLowerCase()].validate(text, pos, this); -}; - - -/** - * LinkifyIt#match(text) -> Array|null - * - * Returns array of found link descriptions or `null` on fail. We strongly - * recommend to use [[LinkifyIt#test]] first, for best speed. - * - * ##### Result match description - * - * - __schema__ - link schema, can be empty for fuzzy links, or `//` for - * protocol-neutral links. - * - __index__ - offset of matched text - * - __lastIndex__ - index of next char after mathch end - * - __raw__ - matched text - * - __text__ - normalized text - * - __url__ - link, generated from matched text - **/ -LinkifyIt.prototype.match = function match(text) { - var shift = 0, result = []; - - // Try to take previous element from cache, if .test() called before - if (this.__index__ >= 0 && this.__text_cache__ === text) { - result.push(createMatch(this, shift)); - shift = this.__last_index__; - } - - // Cut head if cache was used - var tail = shift ? text.slice(shift) : text; - - // Scan string until end reached - while (this.test(tail)) { - result.push(createMatch(this, shift)); - - tail = tail.slice(this.__last_index__); - shift += this.__last_index__; - } - - if (result.length) { - return result; - } - - return null; -}; - - -/** chainable - * LinkifyIt#tlds(list [, keepOld]) -> this - * - list (Array): list of tlds - * - keepOld (Boolean): merge with current list if `true` (`false` by default) - * - * Load (or merge) new tlds list. Those are user for fuzzy links (without prefix) - * to avoid false positives. By default this algorythm used: - * - * - hostname with any 2-letter root zones are ok. - * - biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф - * are ok. - * - encoded (`xn--...`) root zones are ok. - * - * If list is replaced, then exact match for 2-chars root zones will be checked. - **/ -LinkifyIt.prototype.tlds = function tlds(list, keepOld) { - list = Array.isArray(list) ? list : [ list ]; - - if (!keepOld) { - this.__tlds__ = list.slice(); - this.__tlds_replaced__ = true; - compile(this); - return this; - } - - this.__tlds__ = this.__tlds__.concat(list) - .sort() - .filter(function (el, idx, arr) { - return el !== arr[idx - 1]; - }) - .reverse(); - - compile(this); - return this; -}; - -/** - * LinkifyIt#normalize(match) - * - * Default normalizer (if schema does not define it's own). - **/ -LinkifyIt.prototype.normalize = function normalize(match) { - - // Do minimal possible changes by default. Need to collect feedback prior - // to move forward https://github.com/markdown-it/linkify-it/issues/1 - - if (!match.schema) { match.url = 'http://' + match.url; } - - if (match.schema === 'mailto:' && !/^mailto:/i.test(match.url)) { - match.url = 'mailto:' + match.url; - } -}; - - -/** - * LinkifyIt#onCompile() - * - * Override to modify basic RegExp-s. - **/ -LinkifyIt.prototype.onCompile = function onCompile() { -}; - - -module.exports = LinkifyIt; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/linkify-it/lib/re.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/linkify-it/lib/re.js deleted file mode 100644 index 5f34a721..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/linkify-it/lib/re.js +++ /dev/null @@ -1,181 +0,0 @@ -'use strict'; - - -module.exports = function (opts) { - var re = {}; - - // Use direct extract instead of `regenerate` to reduse browserified size - re.src_Any = require('uc.micro/properties/Any/regex').source; - re.src_Cc = require('uc.micro/categories/Cc/regex').source; - re.src_Z = require('uc.micro/categories/Z/regex').source; - re.src_P = require('uc.micro/categories/P/regex').source; - - // \p{\Z\P\Cc\CF} (white spaces + control + format + punctuation) - re.src_ZPCc = [ re.src_Z, re.src_P, re.src_Cc ].join('|'); - - // \p{\Z\Cc} (white spaces + control) - re.src_ZCc = [ re.src_Z, re.src_Cc ].join('|'); - - // Experimental. List of chars, completely prohibited in links - // because can separate it from other part of text - var text_separators = '[><\uff5c]'; - - // All possible word characters (everything without punctuation, spaces & controls) - // Defined via punctuation & spaces to save space - // Should be something like \p{\L\N\S\M} (\w but without `_`) - re.src_pseudo_letter = '(?:(?!' + text_separators + '|' + re.src_ZPCc + ')' + re.src_Any + ')'; - // The same as abothe but without [0-9] - // var src_pseudo_letter_non_d = '(?:(?![0-9]|' + src_ZPCc + ')' + src_Any + ')'; - - //////////////////////////////////////////////////////////////////////////////// - - re.src_ip4 = - - '(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)'; - - // Prohibit any of "@/[]()" in user/pass to avoid wrong domain fetch. - re.src_auth = '(?:(?:(?!' + re.src_ZCc + '|[@/\\[\\]()]).)+@)?'; - - re.src_port = - - '(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?'; - - re.src_host_terminator = - - '(?=$|' + text_separators + '|' + re.src_ZPCc + ')(?!-|_|:\\d|\\.-|\\.(?!$|' + re.src_ZPCc + '))'; - - re.src_path = - - '(?:' + - '[/?#]' + - '(?:' + - '(?!' + re.src_ZCc + '|' + text_separators + '|[()[\\]{}.,"\'?!\\-;]).|' + - '\\[(?:(?!' + re.src_ZCc + '|\\]).)*\\]|' + - '\\((?:(?!' + re.src_ZCc + '|[)]).)*\\)|' + - '\\{(?:(?!' + re.src_ZCc + '|[}]).)*\\}|' + - '\\"(?:(?!' + re.src_ZCc + '|["]).)+\\"|' + - "\\'(?:(?!" + re.src_ZCc + "|[']).)+\\'|" + - "\\'(?=" + re.src_pseudo_letter + '|[-]).|' + // allow `I'm_king` if no pair found - '\\.{2,}[a-zA-Z0-9%/&]|' + // google has many dots in "google search" links (#66, #81). - // github has ... in commit range links, - // Restrict to - // - english - // - percent-encoded - // - parts of file path - // - params separator - // until more examples found. - '\\.(?!' + re.src_ZCc + '|[.]).|' + - (opts && opts['---'] ? - '\\-(?!--(?:[^-]|$))(?:-*)|' // `---` => long dash, terminate - : - '\\-+|' - ) + - ',(?!' + re.src_ZCc + ').|' + // allow `,,,` in paths - ';(?!' + re.src_ZCc + ').|' + // allow `;` if not followed by space-like char - '\\!+(?!' + re.src_ZCc + '|[!]).|' + // allow `!!!` in paths, but not at the end - '\\?(?!' + re.src_ZCc + '|[?]).' + - ')+' + - '|\\/' + - ')?'; - - // Allow anything in markdown spec, forbid quote (") at the first position - // because emails enclosed in quotes are far more common - re.src_email_name = - - '[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]*'; - - re.src_xn = - - 'xn--[a-z0-9\\-]{1,59}'; - - // More to read about domain names - // http://serverfault.com/questions/638260/ - - re.src_domain_root = - - // Allow letters & digits (http://test1) - '(?:' + - re.src_xn + - '|' + - re.src_pseudo_letter + '{1,63}' + - ')'; - - re.src_domain = - - '(?:' + - re.src_xn + - '|' + - '(?:' + re.src_pseudo_letter + ')' + - '|' + - '(?:' + re.src_pseudo_letter + '(?:-|' + re.src_pseudo_letter + '){0,61}' + re.src_pseudo_letter + ')' + - ')'; - - re.src_host = - - '(?:' + - // Don't need IP check, because digits are already allowed in normal domain names - // src_ip4 + - // '|' + - '(?:(?:(?:' + re.src_domain + ')\\.)*' + re.src_domain/*_root*/ + ')' + - ')'; - - re.tpl_host_fuzzy = - - '(?:' + - re.src_ip4 + - '|' + - '(?:(?:(?:' + re.src_domain + ')\\.)+(?:%TLDS%))' + - ')'; - - re.tpl_host_no_ip_fuzzy = - - '(?:(?:(?:' + re.src_domain + ')\\.)+(?:%TLDS%))'; - - re.src_host_strict = - - re.src_host + re.src_host_terminator; - - re.tpl_host_fuzzy_strict = - - re.tpl_host_fuzzy + re.src_host_terminator; - - re.src_host_port_strict = - - re.src_host + re.src_port + re.src_host_terminator; - - re.tpl_host_port_fuzzy_strict = - - re.tpl_host_fuzzy + re.src_port + re.src_host_terminator; - - re.tpl_host_port_no_ip_fuzzy_strict = - - re.tpl_host_no_ip_fuzzy + re.src_port + re.src_host_terminator; - - - //////////////////////////////////////////////////////////////////////////////// - // Main rules - - // Rude test fuzzy links by host, for quick deny - re.tpl_host_fuzzy_test = - - 'localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:' + re.src_ZPCc + '|>|$))'; - - re.tpl_email_fuzzy = - - '(^|' + text_separators + '|"|\\(|' + re.src_ZCc + ')' + - '(' + re.src_email_name + '@' + re.tpl_host_fuzzy_strict + ')'; - - re.tpl_link_fuzzy = - // Fuzzy link can't be prepended with .:/\- and non punctuation. - // but can start with > (markdown blockquote) - '(^|(?![.:/\\-_@])(?:[$+<=>^`|\uff5c]|' + re.src_ZPCc + '))' + - '((?![$+<=>^`|\uff5c])' + re.tpl_host_port_fuzzy_strict + re.src_path + ')'; - - re.tpl_link_no_ip_fuzzy = - // Fuzzy link can't be prepended with .:/\- and non punctuation. - // but can start with > (markdown blockquote) - '(^|(?![.:/\\-_@])(?:[$+<=>^`|\uff5c]|' + re.src_ZPCc + '))' + - '((?![$+<=>^`|\uff5c])' + re.tpl_host_port_no_ip_fuzzy_strict + re.src_path + ')'; - - return re; -}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/linkify-it/package.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/linkify-it/package.json deleted file mode 100644 index b6c36d2b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/linkify-it/package.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "name": "linkify-it", - "version": "3.0.3", - "description": "Links recognition library with FULL unicode support", - "keywords": [ - "linkify", - "linkifier", - "autolink", - "autolinker" - ], - "repository": "markdown-it/linkify-it", - "files": [ - "index.js", - "lib/" - ], - "license": "MIT", - "scripts": { - "lint": "eslint .", - "test": "npm run lint && nyc mocha", - "coverage": "npm run test && nyc report --reporter html", - "report-coveralls": "nyc report --reporter=text-lcov | coveralls", - "demo": "npm run lint && node support/build_demo.js", - "doc": "node support/build_doc.js", - "gh-pages": "npm run demo && npm run doc && shx cp -R doc/ demo/ && gh-pages -d demo -f", - "prepublishOnly": "npm run gh-pages" - }, - "dependencies": { - "uc.micro": "^1.0.1" - }, - "devDependencies": { - "ansi": "^0.3.0", - "autoprefixer-stylus": "^0.14.0", - "benchmark": "^2.1.0", - "browserify": "^16.2.3", - "coveralls": "^3.0.2", - "eslint": "^7.0.0", - "gh-pages": "^2.2.0", - "mdurl": "^1.0.0", - "mocha": "^7.1.2", - "ndoc": "^5.0.1", - "nyc": "^15.0.1", - "pug-cli": "^1.0.0-alpha6", - "shelljs": "^0.8.4", - "shx": "^0.3.2", - "stylus": "~0.54.5", - "tlds": "^1.166.0" - } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash.camelcase/LICENSE b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash.camelcase/LICENSE deleted file mode 100644 index e0c69d56..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash.camelcase/LICENSE +++ /dev/null @@ -1,47 +0,0 @@ -Copyright jQuery Foundation and other contributors - -Based on Underscore.js, copyright Jeremy Ashkenas, -DocumentCloud and Investigative Reporters & Editors - -This software consists of voluntary contributions made by many -individuals. For exact contribution history, see the revision history -available at https://github.com/lodash/lodash - -The following license applies to all parts of this software except as -documented below: - -==== - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -==== - -Copyright and related rights for sample code are waived via CC0. Sample -code is defined as all source code displayed within the prose of the -documentation. - -CC0: http://creativecommons.org/publicdomain/zero/1.0/ - -==== - -Files located in the node_modules and vendor directories are externally -maintained libraries used by this software which have their own -licenses; we recommend you read them, as their terms may differ from the -terms above. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash.camelcase/README.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash.camelcase/README.md deleted file mode 100644 index 333d437c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash.camelcase/README.md +++ /dev/null @@ -1,18 +0,0 @@ -# lodash.camelcase v4.3.0 - -The [lodash](https://lodash.com/) method `_.camelCase` exported as a [Node.js](https://nodejs.org/) module. - -## Installation - -Using npm: -```bash -$ {sudo -H} npm i -g npm -$ npm i --save lodash.camelcase -``` - -In Node.js: -```js -var camelCase = require('lodash.camelcase'); -``` - -See the [documentation](https://lodash.com/docs#camelCase) or [package source](https://github.com/lodash/lodash/blob/4.3.0-npm-packages/lodash.camelcase) for more details. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash.camelcase/index.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash.camelcase/index.js deleted file mode 100644 index b6d8b3cf..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash.camelcase/index.js +++ /dev/null @@ -1,599 +0,0 @@ -/** - * lodash (Custom Build) - * Build: `lodash modularize exports="npm" -o ./` - * Copyright jQuery Foundation and other contributors - * Released under MIT license - * Based on Underscore.js 1.8.3 - * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - */ - -/** Used as references for various `Number` constants. */ -var INFINITY = 1 / 0; - -/** `Object#toString` result references. */ -var symbolTag = '[object Symbol]'; - -/** Used to match words composed of alphanumeric characters. */ -var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g; - -/** Used to match Latin Unicode letters (excluding mathematical operators). */ -var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g; - -/** Used to compose unicode character classes. */ -var rsAstralRange = '\\ud800-\\udfff', - rsComboMarksRange = '\\u0300-\\u036f\\ufe20-\\ufe23', - rsComboSymbolsRange = '\\u20d0-\\u20f0', - rsDingbatRange = '\\u2700-\\u27bf', - rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff', - rsMathOpRange = '\\xac\\xb1\\xd7\\xf7', - rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf', - rsPunctuationRange = '\\u2000-\\u206f', - rsSpaceRange = ' \\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', - rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde', - rsVarRange = '\\ufe0e\\ufe0f', - rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange; - -/** Used to compose unicode capture groups. */ -var rsApos = "['\u2019]", - rsAstral = '[' + rsAstralRange + ']', - rsBreak = '[' + rsBreakRange + ']', - rsCombo = '[' + rsComboMarksRange + rsComboSymbolsRange + ']', - rsDigits = '\\d+', - rsDingbat = '[' + rsDingbatRange + ']', - rsLower = '[' + rsLowerRange + ']', - rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']', - rsFitz = '\\ud83c[\\udffb-\\udfff]', - rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')', - rsNonAstral = '[^' + rsAstralRange + ']', - rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}', - rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]', - rsUpper = '[' + rsUpperRange + ']', - rsZWJ = '\\u200d'; - -/** Used to compose unicode regexes. */ -var rsLowerMisc = '(?:' + rsLower + '|' + rsMisc + ')', - rsUpperMisc = '(?:' + rsUpper + '|' + rsMisc + ')', - rsOptLowerContr = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?', - rsOptUpperContr = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?', - reOptMod = rsModifier + '?', - rsOptVar = '[' + rsVarRange + ']?', - rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*', - rsSeq = rsOptVar + reOptMod + rsOptJoin, - rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq, - rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')'; - -/** Used to match apostrophes. */ -var reApos = RegExp(rsApos, 'g'); - -/** - * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and - * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols). - */ -var reComboMark = RegExp(rsCombo, 'g'); - -/** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */ -var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g'); - -/** Used to match complex or compound words. */ -var reUnicodeWord = RegExp([ - rsUpper + '?' + rsLower + '+' + rsOptLowerContr + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')', - rsUpperMisc + '+' + rsOptUpperContr + '(?=' + [rsBreak, rsUpper + rsLowerMisc, '$'].join('|') + ')', - rsUpper + '?' + rsLowerMisc + '+' + rsOptLowerContr, - rsUpper + '+' + rsOptUpperContr, - rsDigits, - rsEmoji -].join('|'), 'g'); - -/** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */ -var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboMarksRange + rsComboSymbolsRange + rsVarRange + ']'); - -/** Used to detect strings that need a more robust regexp to match words. */ -var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/; - -/** Used to map Latin Unicode letters to basic Latin letters. */ -var deburredLetters = { - // Latin-1 Supplement block. - '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A', - '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a', - '\xc7': 'C', '\xe7': 'c', - '\xd0': 'D', '\xf0': 'd', - '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E', - '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e', - '\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I', - '\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i', - '\xd1': 'N', '\xf1': 'n', - '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O', - '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o', - '\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U', - '\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u', - '\xdd': 'Y', '\xfd': 'y', '\xff': 'y', - '\xc6': 'Ae', '\xe6': 'ae', - '\xde': 'Th', '\xfe': 'th', - '\xdf': 'ss', - // Latin Extended-A block. - '\u0100': 'A', '\u0102': 'A', '\u0104': 'A', - '\u0101': 'a', '\u0103': 'a', '\u0105': 'a', - '\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C', - '\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c', - '\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd', - '\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E', - '\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e', - '\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G', - '\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g', - '\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h', - '\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I', - '\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i', - '\u0134': 'J', '\u0135': 'j', - '\u0136': 'K', '\u0137': 'k', '\u0138': 'k', - '\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L', - '\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l', - '\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N', - '\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n', - '\u014c': 'O', '\u014e': 'O', '\u0150': 'O', - '\u014d': 'o', '\u014f': 'o', '\u0151': 'o', - '\u0154': 'R', '\u0156': 'R', '\u0158': 'R', - '\u0155': 'r', '\u0157': 'r', '\u0159': 'r', - '\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S', - '\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's', - '\u0162': 'T', '\u0164': 'T', '\u0166': 'T', - '\u0163': 't', '\u0165': 't', '\u0167': 't', - '\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U', - '\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u', - '\u0174': 'W', '\u0175': 'w', - '\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y', - '\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z', - '\u017a': 'z', '\u017c': 'z', '\u017e': 'z', - '\u0132': 'IJ', '\u0133': 'ij', - '\u0152': 'Oe', '\u0153': 'oe', - '\u0149': "'n", '\u017f': 'ss' -}; - -/** Detect free variable `global` from Node.js. */ -var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; - -/** Detect free variable `self`. */ -var freeSelf = typeof self == 'object' && self && self.Object === Object && self; - -/** Used as a reference to the global object. */ -var root = freeGlobal || freeSelf || Function('return this')(); - -/** - * A specialized version of `_.reduce` for arrays without support for - * iteratee shorthands. - * - * @private - * @param {Array} [array] The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @param {*} [accumulator] The initial value. - * @param {boolean} [initAccum] Specify using the first element of `array` as - * the initial value. - * @returns {*} Returns the accumulated value. - */ -function arrayReduce(array, iteratee, accumulator, initAccum) { - var index = -1, - length = array ? array.length : 0; - - if (initAccum && length) { - accumulator = array[++index]; - } - while (++index < length) { - accumulator = iteratee(accumulator, array[index], index, array); - } - return accumulator; -} - -/** - * Converts an ASCII `string` to an array. - * - * @private - * @param {string} string The string to convert. - * @returns {Array} Returns the converted array. - */ -function asciiToArray(string) { - return string.split(''); -} - -/** - * Splits an ASCII `string` into an array of its words. - * - * @private - * @param {string} The string to inspect. - * @returns {Array} Returns the words of `string`. - */ -function asciiWords(string) { - return string.match(reAsciiWord) || []; -} - -/** - * The base implementation of `_.propertyOf` without support for deep paths. - * - * @private - * @param {Object} object The object to query. - * @returns {Function} Returns the new accessor function. - */ -function basePropertyOf(object) { - return function(key) { - return object == null ? undefined : object[key]; - }; -} - -/** - * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A - * letters to basic Latin letters. - * - * @private - * @param {string} letter The matched letter to deburr. - * @returns {string} Returns the deburred letter. - */ -var deburrLetter = basePropertyOf(deburredLetters); - -/** - * Checks if `string` contains Unicode symbols. - * - * @private - * @param {string} string The string to inspect. - * @returns {boolean} Returns `true` if a symbol is found, else `false`. - */ -function hasUnicode(string) { - return reHasUnicode.test(string); -} - -/** - * Checks if `string` contains a word composed of Unicode symbols. - * - * @private - * @param {string} string The string to inspect. - * @returns {boolean} Returns `true` if a word is found, else `false`. - */ -function hasUnicodeWord(string) { - return reHasUnicodeWord.test(string); -} - -/** - * Converts `string` to an array. - * - * @private - * @param {string} string The string to convert. - * @returns {Array} Returns the converted array. - */ -function stringToArray(string) { - return hasUnicode(string) - ? unicodeToArray(string) - : asciiToArray(string); -} - -/** - * Converts a Unicode `string` to an array. - * - * @private - * @param {string} string The string to convert. - * @returns {Array} Returns the converted array. - */ -function unicodeToArray(string) { - return string.match(reUnicode) || []; -} - -/** - * Splits a Unicode `string` into an array of its words. - * - * @private - * @param {string} The string to inspect. - * @returns {Array} Returns the words of `string`. - */ -function unicodeWords(string) { - return string.match(reUnicodeWord) || []; -} - -/** Used for built-in method references. */ -var objectProto = Object.prototype; - -/** - * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) - * of values. - */ -var objectToString = objectProto.toString; - -/** Built-in value references. */ -var Symbol = root.Symbol; - -/** Used to convert symbols to primitives and strings. */ -var symbolProto = Symbol ? Symbol.prototype : undefined, - symbolToString = symbolProto ? symbolProto.toString : undefined; - -/** - * The base implementation of `_.slice` without an iteratee call guard. - * - * @private - * @param {Array} array The array to slice. - * @param {number} [start=0] The start position. - * @param {number} [end=array.length] The end position. - * @returns {Array} Returns the slice of `array`. - */ -function baseSlice(array, start, end) { - var index = -1, - length = array.length; - - if (start < 0) { - start = -start > length ? 0 : (length + start); - } - end = end > length ? length : end; - if (end < 0) { - end += length; - } - length = start > end ? 0 : ((end - start) >>> 0); - start >>>= 0; - - var result = Array(length); - while (++index < length) { - result[index] = array[index + start]; - } - return result; -} - -/** - * The base implementation of `_.toString` which doesn't convert nullish - * values to empty strings. - * - * @private - * @param {*} value The value to process. - * @returns {string} Returns the string. - */ -function baseToString(value) { - // Exit early for strings to avoid a performance hit in some environments. - if (typeof value == 'string') { - return value; - } - if (isSymbol(value)) { - return symbolToString ? symbolToString.call(value) : ''; - } - var result = (value + ''); - return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; -} - -/** - * Casts `array` to a slice if it's needed. - * - * @private - * @param {Array} array The array to inspect. - * @param {number} start The start position. - * @param {number} [end=array.length] The end position. - * @returns {Array} Returns the cast slice. - */ -function castSlice(array, start, end) { - var length = array.length; - end = end === undefined ? length : end; - return (!start && end >= length) ? array : baseSlice(array, start, end); -} - -/** - * Creates a function like `_.lowerFirst`. - * - * @private - * @param {string} methodName The name of the `String` case method to use. - * @returns {Function} Returns the new case function. - */ -function createCaseFirst(methodName) { - return function(string) { - string = toString(string); - - var strSymbols = hasUnicode(string) - ? stringToArray(string) - : undefined; - - var chr = strSymbols - ? strSymbols[0] - : string.charAt(0); - - var trailing = strSymbols - ? castSlice(strSymbols, 1).join('') - : string.slice(1); - - return chr[methodName]() + trailing; - }; -} - -/** - * Creates a function like `_.camelCase`. - * - * @private - * @param {Function} callback The function to combine each word. - * @returns {Function} Returns the new compounder function. - */ -function createCompounder(callback) { - return function(string) { - return arrayReduce(words(deburr(string).replace(reApos, '')), callback, ''); - }; -} - -/** - * Checks if `value` is object-like. A value is object-like if it's not `null` - * and has a `typeof` result of "object". - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is object-like, else `false`. - * @example - * - * _.isObjectLike({}); - * // => true - * - * _.isObjectLike([1, 2, 3]); - * // => true - * - * _.isObjectLike(_.noop); - * // => false - * - * _.isObjectLike(null); - * // => false - */ -function isObjectLike(value) { - return !!value && typeof value == 'object'; -} - -/** - * Checks if `value` is classified as a `Symbol` primitive or object. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. - * @example - * - * _.isSymbol(Symbol.iterator); - * // => true - * - * _.isSymbol('abc'); - * // => false - */ -function isSymbol(value) { - return typeof value == 'symbol' || - (isObjectLike(value) && objectToString.call(value) == symbolTag); -} - -/** - * Converts `value` to a string. An empty string is returned for `null` - * and `undefined` values. The sign of `-0` is preserved. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to process. - * @returns {string} Returns the string. - * @example - * - * _.toString(null); - * // => '' - * - * _.toString(-0); - * // => '-0' - * - * _.toString([1, 2, 3]); - * // => '1,2,3' - */ -function toString(value) { - return value == null ? '' : baseToString(value); -} - -/** - * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase). - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category String - * @param {string} [string=''] The string to convert. - * @returns {string} Returns the camel cased string. - * @example - * - * _.camelCase('Foo Bar'); - * // => 'fooBar' - * - * _.camelCase('--foo-bar--'); - * // => 'fooBar' - * - * _.camelCase('__FOO_BAR__'); - * // => 'fooBar' - */ -var camelCase = createCompounder(function(result, word, index) { - word = word.toLowerCase(); - return result + (index ? capitalize(word) : word); -}); - -/** - * Converts the first character of `string` to upper case and the remaining - * to lower case. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category String - * @param {string} [string=''] The string to capitalize. - * @returns {string} Returns the capitalized string. - * @example - * - * _.capitalize('FRED'); - * // => 'Fred' - */ -function capitalize(string) { - return upperFirst(toString(string).toLowerCase()); -} - -/** - * Deburrs `string` by converting - * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table) - * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A) - * letters to basic Latin letters and removing - * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks). - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category String - * @param {string} [string=''] The string to deburr. - * @returns {string} Returns the deburred string. - * @example - * - * _.deburr('déjà vu'); - * // => 'deja vu' - */ -function deburr(string) { - string = toString(string); - return string && string.replace(reLatin, deburrLetter).replace(reComboMark, ''); -} - -/** - * Converts the first character of `string` to upper case. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category String - * @param {string} [string=''] The string to convert. - * @returns {string} Returns the converted string. - * @example - * - * _.upperFirst('fred'); - * // => 'Fred' - * - * _.upperFirst('FRED'); - * // => 'FRED' - */ -var upperFirst = createCaseFirst('toUpperCase'); - -/** - * Splits `string` into an array of its words. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category String - * @param {string} [string=''] The string to inspect. - * @param {RegExp|string} [pattern] The pattern to match words. - * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. - * @returns {Array} Returns the words of `string`. - * @example - * - * _.words('fred, barney, & pebbles'); - * // => ['fred', 'barney', 'pebbles'] - * - * _.words('fred, barney, & pebbles', /[^, ]+/g); - * // => ['fred', 'barney', '&', 'pebbles'] - */ -function words(string, pattern, guard) { - string = toString(string); - pattern = guard ? undefined : pattern; - - if (pattern === undefined) { - return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string); - } - return string.match(pattern) || []; -} - -module.exports = camelCase; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash.camelcase/package.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash.camelcase/package.json deleted file mode 100644 index aca63e0b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash.camelcase/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "name": "lodash.camelcase", - "version": "4.3.0", - "description": "The lodash method `_.camelCase` exported as a module.", - "homepage": "https://lodash.com/", - "icon": "https://lodash.com/icon.svg", - "license": "MIT", - "keywords": "lodash-modularized, camelcase", - "author": "John-David Dalton (http://allyoucanleet.com/)", - "contributors": [ - "John-David Dalton (http://allyoucanleet.com/)", - "Blaine Bublitz (https://github.com/phated)", - "Mathias Bynens (https://mathiasbynens.be/)" - ], - "repository": "lodash/lodash", - "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash.clonedeep/LICENSE b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash.clonedeep/LICENSE deleted file mode 100644 index e0c69d56..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash.clonedeep/LICENSE +++ /dev/null @@ -1,47 +0,0 @@ -Copyright jQuery Foundation and other contributors - -Based on Underscore.js, copyright Jeremy Ashkenas, -DocumentCloud and Investigative Reporters & Editors - -This software consists of voluntary contributions made by many -individuals. For exact contribution history, see the revision history -available at https://github.com/lodash/lodash - -The following license applies to all parts of this software except as -documented below: - -==== - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -==== - -Copyright and related rights for sample code are waived via CC0. Sample -code is defined as all source code displayed within the prose of the -documentation. - -CC0: http://creativecommons.org/publicdomain/zero/1.0/ - -==== - -Files located in the node_modules and vendor directories are externally -maintained libraries used by this software which have their own -licenses; we recommend you read them, as their terms may differ from the -terms above. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash.clonedeep/README.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash.clonedeep/README.md deleted file mode 100644 index fee48e47..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash.clonedeep/README.md +++ /dev/null @@ -1,18 +0,0 @@ -# lodash.clonedeep v4.5.0 - -The [lodash](https://lodash.com/) method `_.cloneDeep` exported as a [Node.js](https://nodejs.org/) module. - -## Installation - -Using npm: -```bash -$ {sudo -H} npm i -g npm -$ npm i --save lodash.clonedeep -``` - -In Node.js: -```js -var cloneDeep = require('lodash.clonedeep'); -``` - -See the [documentation](https://lodash.com/docs#cloneDeep) or [package source](https://github.com/lodash/lodash/blob/4.5.0-npm-packages/lodash.clonedeep) for more details. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash.clonedeep/index.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash.clonedeep/index.js deleted file mode 100644 index 1b0e5029..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash.clonedeep/index.js +++ /dev/null @@ -1,1748 +0,0 @@ -/** - * lodash (Custom Build) - * Build: `lodash modularize exports="npm" -o ./` - * Copyright jQuery Foundation and other contributors - * Released under MIT license - * Based on Underscore.js 1.8.3 - * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - */ - -/** Used as the size to enable large array optimizations. */ -var LARGE_ARRAY_SIZE = 200; - -/** Used to stand-in for `undefined` hash values. */ -var HASH_UNDEFINED = '__lodash_hash_undefined__'; - -/** Used as references for various `Number` constants. */ -var MAX_SAFE_INTEGER = 9007199254740991; - -/** `Object#toString` result references. */ -var argsTag = '[object Arguments]', - arrayTag = '[object Array]', - boolTag = '[object Boolean]', - dateTag = '[object Date]', - errorTag = '[object Error]', - funcTag = '[object Function]', - genTag = '[object GeneratorFunction]', - mapTag = '[object Map]', - numberTag = '[object Number]', - objectTag = '[object Object]', - promiseTag = '[object Promise]', - regexpTag = '[object RegExp]', - setTag = '[object Set]', - stringTag = '[object String]', - symbolTag = '[object Symbol]', - weakMapTag = '[object WeakMap]'; - -var arrayBufferTag = '[object ArrayBuffer]', - dataViewTag = '[object DataView]', - float32Tag = '[object Float32Array]', - float64Tag = '[object Float64Array]', - int8Tag = '[object Int8Array]', - int16Tag = '[object Int16Array]', - int32Tag = '[object Int32Array]', - uint8Tag = '[object Uint8Array]', - uint8ClampedTag = '[object Uint8ClampedArray]', - uint16Tag = '[object Uint16Array]', - uint32Tag = '[object Uint32Array]'; - -/** - * Used to match `RegExp` - * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). - */ -var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; - -/** Used to match `RegExp` flags from their coerced string values. */ -var reFlags = /\w*$/; - -/** Used to detect host constructors (Safari). */ -var reIsHostCtor = /^\[object .+?Constructor\]$/; - -/** Used to detect unsigned integer values. */ -var reIsUint = /^(?:0|[1-9]\d*)$/; - -/** Used to identify `toStringTag` values supported by `_.clone`. */ -var cloneableTags = {}; -cloneableTags[argsTag] = cloneableTags[arrayTag] = -cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] = -cloneableTags[boolTag] = cloneableTags[dateTag] = -cloneableTags[float32Tag] = cloneableTags[float64Tag] = -cloneableTags[int8Tag] = cloneableTags[int16Tag] = -cloneableTags[int32Tag] = cloneableTags[mapTag] = -cloneableTags[numberTag] = cloneableTags[objectTag] = -cloneableTags[regexpTag] = cloneableTags[setTag] = -cloneableTags[stringTag] = cloneableTags[symbolTag] = -cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = -cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true; -cloneableTags[errorTag] = cloneableTags[funcTag] = -cloneableTags[weakMapTag] = false; - -/** Detect free variable `global` from Node.js. */ -var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; - -/** Detect free variable `self`. */ -var freeSelf = typeof self == 'object' && self && self.Object === Object && self; - -/** Used as a reference to the global object. */ -var root = freeGlobal || freeSelf || Function('return this')(); - -/** Detect free variable `exports`. */ -var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports; - -/** Detect free variable `module`. */ -var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module; - -/** Detect the popular CommonJS extension `module.exports`. */ -var moduleExports = freeModule && freeModule.exports === freeExports; - -/** - * Adds the key-value `pair` to `map`. - * - * @private - * @param {Object} map The map to modify. - * @param {Array} pair The key-value pair to add. - * @returns {Object} Returns `map`. - */ -function addMapEntry(map, pair) { - // Don't return `map.set` because it's not chainable in IE 11. - map.set(pair[0], pair[1]); - return map; -} - -/** - * Adds `value` to `set`. - * - * @private - * @param {Object} set The set to modify. - * @param {*} value The value to add. - * @returns {Object} Returns `set`. - */ -function addSetEntry(set, value) { - // Don't return `set.add` because it's not chainable in IE 11. - set.add(value); - return set; -} - -/** - * A specialized version of `_.forEach` for arrays without support for - * iteratee shorthands. - * - * @private - * @param {Array} [array] The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns `array`. - */ -function arrayEach(array, iteratee) { - var index = -1, - length = array ? array.length : 0; - - while (++index < length) { - if (iteratee(array[index], index, array) === false) { - break; - } - } - return array; -} - -/** - * Appends the elements of `values` to `array`. - * - * @private - * @param {Array} array The array to modify. - * @param {Array} values The values to append. - * @returns {Array} Returns `array`. - */ -function arrayPush(array, values) { - var index = -1, - length = values.length, - offset = array.length; - - while (++index < length) { - array[offset + index] = values[index]; - } - return array; -} - -/** - * A specialized version of `_.reduce` for arrays without support for - * iteratee shorthands. - * - * @private - * @param {Array} [array] The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @param {*} [accumulator] The initial value. - * @param {boolean} [initAccum] Specify using the first element of `array` as - * the initial value. - * @returns {*} Returns the accumulated value. - */ -function arrayReduce(array, iteratee, accumulator, initAccum) { - var index = -1, - length = array ? array.length : 0; - - if (initAccum && length) { - accumulator = array[++index]; - } - while (++index < length) { - accumulator = iteratee(accumulator, array[index], index, array); - } - return accumulator; -} - -/** - * The base implementation of `_.times` without support for iteratee shorthands - * or max array length checks. - * - * @private - * @param {number} n The number of times to invoke `iteratee`. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns the array of results. - */ -function baseTimes(n, iteratee) { - var index = -1, - result = Array(n); - - while (++index < n) { - result[index] = iteratee(index); - } - return result; -} - -/** - * Gets the value at `key` of `object`. - * - * @private - * @param {Object} [object] The object to query. - * @param {string} key The key of the property to get. - * @returns {*} Returns the property value. - */ -function getValue(object, key) { - return object == null ? undefined : object[key]; -} - -/** - * Checks if `value` is a host object in IE < 9. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a host object, else `false`. - */ -function isHostObject(value) { - // Many host objects are `Object` objects that can coerce to strings - // despite having improperly defined `toString` methods. - var result = false; - if (value != null && typeof value.toString != 'function') { - try { - result = !!(value + ''); - } catch (e) {} - } - return result; -} - -/** - * Converts `map` to its key-value pairs. - * - * @private - * @param {Object} map The map to convert. - * @returns {Array} Returns the key-value pairs. - */ -function mapToArray(map) { - var index = -1, - result = Array(map.size); - - map.forEach(function(value, key) { - result[++index] = [key, value]; - }); - return result; -} - -/** - * Creates a unary function that invokes `func` with its argument transformed. - * - * @private - * @param {Function} func The function to wrap. - * @param {Function} transform The argument transform. - * @returns {Function} Returns the new function. - */ -function overArg(func, transform) { - return function(arg) { - return func(transform(arg)); - }; -} - -/** - * Converts `set` to an array of its values. - * - * @private - * @param {Object} set The set to convert. - * @returns {Array} Returns the values. - */ -function setToArray(set) { - var index = -1, - result = Array(set.size); - - set.forEach(function(value) { - result[++index] = value; - }); - return result; -} - -/** Used for built-in method references. */ -var arrayProto = Array.prototype, - funcProto = Function.prototype, - objectProto = Object.prototype; - -/** Used to detect overreaching core-js shims. */ -var coreJsData = root['__core-js_shared__']; - -/** Used to detect methods masquerading as native. */ -var maskSrcKey = (function() { - var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); - return uid ? ('Symbol(src)_1.' + uid) : ''; -}()); - -/** Used to resolve the decompiled source of functions. */ -var funcToString = funcProto.toString; - -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; - -/** - * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) - * of values. - */ -var objectToString = objectProto.toString; - -/** Used to detect if a method is native. */ -var reIsNative = RegExp('^' + - funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') - .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' -); - -/** Built-in value references. */ -var Buffer = moduleExports ? root.Buffer : undefined, - Symbol = root.Symbol, - Uint8Array = root.Uint8Array, - getPrototype = overArg(Object.getPrototypeOf, Object), - objectCreate = Object.create, - propertyIsEnumerable = objectProto.propertyIsEnumerable, - splice = arrayProto.splice; - -/* Built-in method references for those with the same name as other `lodash` methods. */ -var nativeGetSymbols = Object.getOwnPropertySymbols, - nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined, - nativeKeys = overArg(Object.keys, Object); - -/* Built-in method references that are verified to be native. */ -var DataView = getNative(root, 'DataView'), - Map = getNative(root, 'Map'), - Promise = getNative(root, 'Promise'), - Set = getNative(root, 'Set'), - WeakMap = getNative(root, 'WeakMap'), - nativeCreate = getNative(Object, 'create'); - -/** Used to detect maps, sets, and weakmaps. */ -var dataViewCtorString = toSource(DataView), - mapCtorString = toSource(Map), - promiseCtorString = toSource(Promise), - setCtorString = toSource(Set), - weakMapCtorString = toSource(WeakMap); - -/** Used to convert symbols to primitives and strings. */ -var symbolProto = Symbol ? Symbol.prototype : undefined, - symbolValueOf = symbolProto ? symbolProto.valueOf : undefined; - -/** - * Creates a hash object. - * - * @private - * @constructor - * @param {Array} [entries] The key-value pairs to cache. - */ -function Hash(entries) { - var index = -1, - length = entries ? entries.length : 0; - - this.clear(); - while (++index < length) { - var entry = entries[index]; - this.set(entry[0], entry[1]); - } -} - -/** - * Removes all key-value entries from the hash. - * - * @private - * @name clear - * @memberOf Hash - */ -function hashClear() { - this.__data__ = nativeCreate ? nativeCreate(null) : {}; -} - -/** - * Removes `key` and its value from the hash. - * - * @private - * @name delete - * @memberOf Hash - * @param {Object} hash The hash to modify. - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */ -function hashDelete(key) { - return this.has(key) && delete this.__data__[key]; -} - -/** - * Gets the hash value for `key`. - * - * @private - * @name get - * @memberOf Hash - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ -function hashGet(key) { - var data = this.__data__; - if (nativeCreate) { - var result = data[key]; - return result === HASH_UNDEFINED ? undefined : result; - } - return hasOwnProperty.call(data, key) ? data[key] : undefined; -} - -/** - * Checks if a hash value for `key` exists. - * - * @private - * @name has - * @memberOf Hash - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ -function hashHas(key) { - var data = this.__data__; - return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key); -} - -/** - * Sets the hash `key` to `value`. - * - * @private - * @name set - * @memberOf Hash - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - * @returns {Object} Returns the hash instance. - */ -function hashSet(key, value) { - var data = this.__data__; - data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; - return this; -} - -// Add methods to `Hash`. -Hash.prototype.clear = hashClear; -Hash.prototype['delete'] = hashDelete; -Hash.prototype.get = hashGet; -Hash.prototype.has = hashHas; -Hash.prototype.set = hashSet; - -/** - * Creates an list cache object. - * - * @private - * @constructor - * @param {Array} [entries] The key-value pairs to cache. - */ -function ListCache(entries) { - var index = -1, - length = entries ? entries.length : 0; - - this.clear(); - while (++index < length) { - var entry = entries[index]; - this.set(entry[0], entry[1]); - } -} - -/** - * Removes all key-value entries from the list cache. - * - * @private - * @name clear - * @memberOf ListCache - */ -function listCacheClear() { - this.__data__ = []; -} - -/** - * Removes `key` and its value from the list cache. - * - * @private - * @name delete - * @memberOf ListCache - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */ -function listCacheDelete(key) { - var data = this.__data__, - index = assocIndexOf(data, key); - - if (index < 0) { - return false; - } - var lastIndex = data.length - 1; - if (index == lastIndex) { - data.pop(); - } else { - splice.call(data, index, 1); - } - return true; -} - -/** - * Gets the list cache value for `key`. - * - * @private - * @name get - * @memberOf ListCache - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ -function listCacheGet(key) { - var data = this.__data__, - index = assocIndexOf(data, key); - - return index < 0 ? undefined : data[index][1]; -} - -/** - * Checks if a list cache value for `key` exists. - * - * @private - * @name has - * @memberOf ListCache - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ -function listCacheHas(key) { - return assocIndexOf(this.__data__, key) > -1; -} - -/** - * Sets the list cache `key` to `value`. - * - * @private - * @name set - * @memberOf ListCache - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - * @returns {Object} Returns the list cache instance. - */ -function listCacheSet(key, value) { - var data = this.__data__, - index = assocIndexOf(data, key); - - if (index < 0) { - data.push([key, value]); - } else { - data[index][1] = value; - } - return this; -} - -// Add methods to `ListCache`. -ListCache.prototype.clear = listCacheClear; -ListCache.prototype['delete'] = listCacheDelete; -ListCache.prototype.get = listCacheGet; -ListCache.prototype.has = listCacheHas; -ListCache.prototype.set = listCacheSet; - -/** - * Creates a map cache object to store key-value pairs. - * - * @private - * @constructor - * @param {Array} [entries] The key-value pairs to cache. - */ -function MapCache(entries) { - var index = -1, - length = entries ? entries.length : 0; - - this.clear(); - while (++index < length) { - var entry = entries[index]; - this.set(entry[0], entry[1]); - } -} - -/** - * Removes all key-value entries from the map. - * - * @private - * @name clear - * @memberOf MapCache - */ -function mapCacheClear() { - this.__data__ = { - 'hash': new Hash, - 'map': new (Map || ListCache), - 'string': new Hash - }; -} - -/** - * Removes `key` and its value from the map. - * - * @private - * @name delete - * @memberOf MapCache - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */ -function mapCacheDelete(key) { - return getMapData(this, key)['delete'](key); -} - -/** - * Gets the map value for `key`. - * - * @private - * @name get - * @memberOf MapCache - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ -function mapCacheGet(key) { - return getMapData(this, key).get(key); -} - -/** - * Checks if a map value for `key` exists. - * - * @private - * @name has - * @memberOf MapCache - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ -function mapCacheHas(key) { - return getMapData(this, key).has(key); -} - -/** - * Sets the map `key` to `value`. - * - * @private - * @name set - * @memberOf MapCache - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - * @returns {Object} Returns the map cache instance. - */ -function mapCacheSet(key, value) { - getMapData(this, key).set(key, value); - return this; -} - -// Add methods to `MapCache`. -MapCache.prototype.clear = mapCacheClear; -MapCache.prototype['delete'] = mapCacheDelete; -MapCache.prototype.get = mapCacheGet; -MapCache.prototype.has = mapCacheHas; -MapCache.prototype.set = mapCacheSet; - -/** - * Creates a stack cache object to store key-value pairs. - * - * @private - * @constructor - * @param {Array} [entries] The key-value pairs to cache. - */ -function Stack(entries) { - this.__data__ = new ListCache(entries); -} - -/** - * Removes all key-value entries from the stack. - * - * @private - * @name clear - * @memberOf Stack - */ -function stackClear() { - this.__data__ = new ListCache; -} - -/** - * Removes `key` and its value from the stack. - * - * @private - * @name delete - * @memberOf Stack - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */ -function stackDelete(key) { - return this.__data__['delete'](key); -} - -/** - * Gets the stack value for `key`. - * - * @private - * @name get - * @memberOf Stack - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ -function stackGet(key) { - return this.__data__.get(key); -} - -/** - * Checks if a stack value for `key` exists. - * - * @private - * @name has - * @memberOf Stack - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ -function stackHas(key) { - return this.__data__.has(key); -} - -/** - * Sets the stack `key` to `value`. - * - * @private - * @name set - * @memberOf Stack - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - * @returns {Object} Returns the stack cache instance. - */ -function stackSet(key, value) { - var cache = this.__data__; - if (cache instanceof ListCache) { - var pairs = cache.__data__; - if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) { - pairs.push([key, value]); - return this; - } - cache = this.__data__ = new MapCache(pairs); - } - cache.set(key, value); - return this; -} - -// Add methods to `Stack`. -Stack.prototype.clear = stackClear; -Stack.prototype['delete'] = stackDelete; -Stack.prototype.get = stackGet; -Stack.prototype.has = stackHas; -Stack.prototype.set = stackSet; - -/** - * Creates an array of the enumerable property names of the array-like `value`. - * - * @private - * @param {*} value The value to query. - * @param {boolean} inherited Specify returning inherited property names. - * @returns {Array} Returns the array of property names. - */ -function arrayLikeKeys(value, inherited) { - // Safari 8.1 makes `arguments.callee` enumerable in strict mode. - // Safari 9 makes `arguments.length` enumerable in strict mode. - var result = (isArray(value) || isArguments(value)) - ? baseTimes(value.length, String) - : []; - - var length = result.length, - skipIndexes = !!length; - - for (var key in value) { - if ((inherited || hasOwnProperty.call(value, key)) && - !(skipIndexes && (key == 'length' || isIndex(key, length)))) { - result.push(key); - } - } - return result; -} - -/** - * Assigns `value` to `key` of `object` if the existing value is not equivalent - * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) - * for equality comparisons. - * - * @private - * @param {Object} object The object to modify. - * @param {string} key The key of the property to assign. - * @param {*} value The value to assign. - */ -function assignValue(object, key, value) { - var objValue = object[key]; - if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || - (value === undefined && !(key in object))) { - object[key] = value; - } -} - -/** - * Gets the index at which the `key` is found in `array` of key-value pairs. - * - * @private - * @param {Array} array The array to inspect. - * @param {*} key The key to search for. - * @returns {number} Returns the index of the matched value, else `-1`. - */ -function assocIndexOf(array, key) { - var length = array.length; - while (length--) { - if (eq(array[length][0], key)) { - return length; - } - } - return -1; -} - -/** - * The base implementation of `_.assign` without support for multiple sources - * or `customizer` functions. - * - * @private - * @param {Object} object The destination object. - * @param {Object} source The source object. - * @returns {Object} Returns `object`. - */ -function baseAssign(object, source) { - return object && copyObject(source, keys(source), object); -} - -/** - * The base implementation of `_.clone` and `_.cloneDeep` which tracks - * traversed objects. - * - * @private - * @param {*} value The value to clone. - * @param {boolean} [isDeep] Specify a deep clone. - * @param {boolean} [isFull] Specify a clone including symbols. - * @param {Function} [customizer] The function to customize cloning. - * @param {string} [key] The key of `value`. - * @param {Object} [object] The parent object of `value`. - * @param {Object} [stack] Tracks traversed objects and their clone counterparts. - * @returns {*} Returns the cloned value. - */ -function baseClone(value, isDeep, isFull, customizer, key, object, stack) { - var result; - if (customizer) { - result = object ? customizer(value, key, object, stack) : customizer(value); - } - if (result !== undefined) { - return result; - } - if (!isObject(value)) { - return value; - } - var isArr = isArray(value); - if (isArr) { - result = initCloneArray(value); - if (!isDeep) { - return copyArray(value, result); - } - } else { - var tag = getTag(value), - isFunc = tag == funcTag || tag == genTag; - - if (isBuffer(value)) { - return cloneBuffer(value, isDeep); - } - if (tag == objectTag || tag == argsTag || (isFunc && !object)) { - if (isHostObject(value)) { - return object ? value : {}; - } - result = initCloneObject(isFunc ? {} : value); - if (!isDeep) { - return copySymbols(value, baseAssign(result, value)); - } - } else { - if (!cloneableTags[tag]) { - return object ? value : {}; - } - result = initCloneByTag(value, tag, baseClone, isDeep); - } - } - // Check for circular references and return its corresponding clone. - stack || (stack = new Stack); - var stacked = stack.get(value); - if (stacked) { - return stacked; - } - stack.set(value, result); - - if (!isArr) { - var props = isFull ? getAllKeys(value) : keys(value); - } - arrayEach(props || value, function(subValue, key) { - if (props) { - key = subValue; - subValue = value[key]; - } - // Recursively populate clone (susceptible to call stack limits). - assignValue(result, key, baseClone(subValue, isDeep, isFull, customizer, key, value, stack)); - }); - return result; -} - -/** - * The base implementation of `_.create` without support for assigning - * properties to the created object. - * - * @private - * @param {Object} prototype The object to inherit from. - * @returns {Object} Returns the new object. - */ -function baseCreate(proto) { - return isObject(proto) ? objectCreate(proto) : {}; -} - -/** - * The base implementation of `getAllKeys` and `getAllKeysIn` which uses - * `keysFunc` and `symbolsFunc` to get the enumerable property names and - * symbols of `object`. - * - * @private - * @param {Object} object The object to query. - * @param {Function} keysFunc The function to get the keys of `object`. - * @param {Function} symbolsFunc The function to get the symbols of `object`. - * @returns {Array} Returns the array of property names and symbols. - */ -function baseGetAllKeys(object, keysFunc, symbolsFunc) { - var result = keysFunc(object); - return isArray(object) ? result : arrayPush(result, symbolsFunc(object)); -} - -/** - * The base implementation of `getTag`. - * - * @private - * @param {*} value The value to query. - * @returns {string} Returns the `toStringTag`. - */ -function baseGetTag(value) { - return objectToString.call(value); -} - -/** - * The base implementation of `_.isNative` without bad shim checks. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a native function, - * else `false`. - */ -function baseIsNative(value) { - if (!isObject(value) || isMasked(value)) { - return false; - } - var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor; - return pattern.test(toSource(value)); -} - -/** - * The base implementation of `_.keys` which doesn't treat sparse arrays as dense. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. - */ -function baseKeys(object) { - if (!isPrototype(object)) { - return nativeKeys(object); - } - var result = []; - for (var key in Object(object)) { - if (hasOwnProperty.call(object, key) && key != 'constructor') { - result.push(key); - } - } - return result; -} - -/** - * Creates a clone of `buffer`. - * - * @private - * @param {Buffer} buffer The buffer to clone. - * @param {boolean} [isDeep] Specify a deep clone. - * @returns {Buffer} Returns the cloned buffer. - */ -function cloneBuffer(buffer, isDeep) { - if (isDeep) { - return buffer.slice(); - } - var result = new buffer.constructor(buffer.length); - buffer.copy(result); - return result; -} - -/** - * Creates a clone of `arrayBuffer`. - * - * @private - * @param {ArrayBuffer} arrayBuffer The array buffer to clone. - * @returns {ArrayBuffer} Returns the cloned array buffer. - */ -function cloneArrayBuffer(arrayBuffer) { - var result = new arrayBuffer.constructor(arrayBuffer.byteLength); - new Uint8Array(result).set(new Uint8Array(arrayBuffer)); - return result; -} - -/** - * Creates a clone of `dataView`. - * - * @private - * @param {Object} dataView The data view to clone. - * @param {boolean} [isDeep] Specify a deep clone. - * @returns {Object} Returns the cloned data view. - */ -function cloneDataView(dataView, isDeep) { - var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer; - return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength); -} - -/** - * Creates a clone of `map`. - * - * @private - * @param {Object} map The map to clone. - * @param {Function} cloneFunc The function to clone values. - * @param {boolean} [isDeep] Specify a deep clone. - * @returns {Object} Returns the cloned map. - */ -function cloneMap(map, isDeep, cloneFunc) { - var array = isDeep ? cloneFunc(mapToArray(map), true) : mapToArray(map); - return arrayReduce(array, addMapEntry, new map.constructor); -} - -/** - * Creates a clone of `regexp`. - * - * @private - * @param {Object} regexp The regexp to clone. - * @returns {Object} Returns the cloned regexp. - */ -function cloneRegExp(regexp) { - var result = new regexp.constructor(regexp.source, reFlags.exec(regexp)); - result.lastIndex = regexp.lastIndex; - return result; -} - -/** - * Creates a clone of `set`. - * - * @private - * @param {Object} set The set to clone. - * @param {Function} cloneFunc The function to clone values. - * @param {boolean} [isDeep] Specify a deep clone. - * @returns {Object} Returns the cloned set. - */ -function cloneSet(set, isDeep, cloneFunc) { - var array = isDeep ? cloneFunc(setToArray(set), true) : setToArray(set); - return arrayReduce(array, addSetEntry, new set.constructor); -} - -/** - * Creates a clone of the `symbol` object. - * - * @private - * @param {Object} symbol The symbol object to clone. - * @returns {Object} Returns the cloned symbol object. - */ -function cloneSymbol(symbol) { - return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {}; -} - -/** - * Creates a clone of `typedArray`. - * - * @private - * @param {Object} typedArray The typed array to clone. - * @param {boolean} [isDeep] Specify a deep clone. - * @returns {Object} Returns the cloned typed array. - */ -function cloneTypedArray(typedArray, isDeep) { - var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer; - return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length); -} - -/** - * Copies the values of `source` to `array`. - * - * @private - * @param {Array} source The array to copy values from. - * @param {Array} [array=[]] The array to copy values to. - * @returns {Array} Returns `array`. - */ -function copyArray(source, array) { - var index = -1, - length = source.length; - - array || (array = Array(length)); - while (++index < length) { - array[index] = source[index]; - } - return array; -} - -/** - * Copies properties of `source` to `object`. - * - * @private - * @param {Object} source The object to copy properties from. - * @param {Array} props The property identifiers to copy. - * @param {Object} [object={}] The object to copy properties to. - * @param {Function} [customizer] The function to customize copied values. - * @returns {Object} Returns `object`. - */ -function copyObject(source, props, object, customizer) { - object || (object = {}); - - var index = -1, - length = props.length; - - while (++index < length) { - var key = props[index]; - - var newValue = customizer - ? customizer(object[key], source[key], key, object, source) - : undefined; - - assignValue(object, key, newValue === undefined ? source[key] : newValue); - } - return object; -} - -/** - * Copies own symbol properties of `source` to `object`. - * - * @private - * @param {Object} source The object to copy symbols from. - * @param {Object} [object={}] The object to copy symbols to. - * @returns {Object} Returns `object`. - */ -function copySymbols(source, object) { - return copyObject(source, getSymbols(source), object); -} - -/** - * Creates an array of own enumerable property names and symbols of `object`. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names and symbols. - */ -function getAllKeys(object) { - return baseGetAllKeys(object, keys, getSymbols); -} - -/** - * Gets the data for `map`. - * - * @private - * @param {Object} map The map to query. - * @param {string} key The reference key. - * @returns {*} Returns the map data. - */ -function getMapData(map, key) { - var data = map.__data__; - return isKeyable(key) - ? data[typeof key == 'string' ? 'string' : 'hash'] - : data.map; -} - -/** - * Gets the native function at `key` of `object`. - * - * @private - * @param {Object} object The object to query. - * @param {string} key The key of the method to get. - * @returns {*} Returns the function if it's native, else `undefined`. - */ -function getNative(object, key) { - var value = getValue(object, key); - return baseIsNative(value) ? value : undefined; -} - -/** - * Creates an array of the own enumerable symbol properties of `object`. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of symbols. - */ -var getSymbols = nativeGetSymbols ? overArg(nativeGetSymbols, Object) : stubArray; - -/** - * Gets the `toStringTag` of `value`. - * - * @private - * @param {*} value The value to query. - * @returns {string} Returns the `toStringTag`. - */ -var getTag = baseGetTag; - -// Fallback for data views, maps, sets, and weak maps in IE 11, -// for data views in Edge < 14, and promises in Node.js. -if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) || - (Map && getTag(new Map) != mapTag) || - (Promise && getTag(Promise.resolve()) != promiseTag) || - (Set && getTag(new Set) != setTag) || - (WeakMap && getTag(new WeakMap) != weakMapTag)) { - getTag = function(value) { - var result = objectToString.call(value), - Ctor = result == objectTag ? value.constructor : undefined, - ctorString = Ctor ? toSource(Ctor) : undefined; - - if (ctorString) { - switch (ctorString) { - case dataViewCtorString: return dataViewTag; - case mapCtorString: return mapTag; - case promiseCtorString: return promiseTag; - case setCtorString: return setTag; - case weakMapCtorString: return weakMapTag; - } - } - return result; - }; -} - -/** - * Initializes an array clone. - * - * @private - * @param {Array} array The array to clone. - * @returns {Array} Returns the initialized clone. - */ -function initCloneArray(array) { - var length = array.length, - result = array.constructor(length); - - // Add properties assigned by `RegExp#exec`. - if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) { - result.index = array.index; - result.input = array.input; - } - return result; -} - -/** - * Initializes an object clone. - * - * @private - * @param {Object} object The object to clone. - * @returns {Object} Returns the initialized clone. - */ -function initCloneObject(object) { - return (typeof object.constructor == 'function' && !isPrototype(object)) - ? baseCreate(getPrototype(object)) - : {}; -} - -/** - * Initializes an object clone based on its `toStringTag`. - * - * **Note:** This function only supports cloning values with tags of - * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. - * - * @private - * @param {Object} object The object to clone. - * @param {string} tag The `toStringTag` of the object to clone. - * @param {Function} cloneFunc The function to clone values. - * @param {boolean} [isDeep] Specify a deep clone. - * @returns {Object} Returns the initialized clone. - */ -function initCloneByTag(object, tag, cloneFunc, isDeep) { - var Ctor = object.constructor; - switch (tag) { - case arrayBufferTag: - return cloneArrayBuffer(object); - - case boolTag: - case dateTag: - return new Ctor(+object); - - case dataViewTag: - return cloneDataView(object, isDeep); - - case float32Tag: case float64Tag: - case int8Tag: case int16Tag: case int32Tag: - case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag: - return cloneTypedArray(object, isDeep); - - case mapTag: - return cloneMap(object, isDeep, cloneFunc); - - case numberTag: - case stringTag: - return new Ctor(object); - - case regexpTag: - return cloneRegExp(object); - - case setTag: - return cloneSet(object, isDeep, cloneFunc); - - case symbolTag: - return cloneSymbol(object); - } -} - -/** - * Checks if `value` is a valid array-like index. - * - * @private - * @param {*} value The value to check. - * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. - * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. - */ -function isIndex(value, length) { - length = length == null ? MAX_SAFE_INTEGER : length; - return !!length && - (typeof value == 'number' || reIsUint.test(value)) && - (value > -1 && value % 1 == 0 && value < length); -} - -/** - * Checks if `value` is suitable for use as unique object key. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is suitable, else `false`. - */ -function isKeyable(value) { - var type = typeof value; - return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') - ? (value !== '__proto__') - : (value === null); -} - -/** - * Checks if `func` has its source masked. - * - * @private - * @param {Function} func The function to check. - * @returns {boolean} Returns `true` if `func` is masked, else `false`. - */ -function isMasked(func) { - return !!maskSrcKey && (maskSrcKey in func); -} - -/** - * Checks if `value` is likely a prototype object. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a prototype, else `false`. - */ -function isPrototype(value) { - var Ctor = value && value.constructor, - proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto; - - return value === proto; -} - -/** - * Converts `func` to its source code. - * - * @private - * @param {Function} func The function to process. - * @returns {string} Returns the source code. - */ -function toSource(func) { - if (func != null) { - try { - return funcToString.call(func); - } catch (e) {} - try { - return (func + ''); - } catch (e) {} - } - return ''; -} - -/** - * This method is like `_.clone` except that it recursively clones `value`. - * - * @static - * @memberOf _ - * @since 1.0.0 - * @category Lang - * @param {*} value The value to recursively clone. - * @returns {*} Returns the deep cloned value. - * @see _.clone - * @example - * - * var objects = [{ 'a': 1 }, { 'b': 2 }]; - * - * var deep = _.cloneDeep(objects); - * console.log(deep[0] === objects[0]); - * // => false - */ -function cloneDeep(value) { - return baseClone(value, true, true); -} - -/** - * Performs a - * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) - * comparison between two values to determine if they are equivalent. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if the values are equivalent, else `false`. - * @example - * - * var object = { 'a': 1 }; - * var other = { 'a': 1 }; - * - * _.eq(object, object); - * // => true - * - * _.eq(object, other); - * // => false - * - * _.eq('a', 'a'); - * // => true - * - * _.eq('a', Object('a')); - * // => false - * - * _.eq(NaN, NaN); - * // => true - */ -function eq(value, other) { - return value === other || (value !== value && other !== other); -} - -/** - * Checks if `value` is likely an `arguments` object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an `arguments` object, - * else `false`. - * @example - * - * _.isArguments(function() { return arguments; }()); - * // => true - * - * _.isArguments([1, 2, 3]); - * // => false - */ -function isArguments(value) { - // Safari 8.1 makes `arguments.callee` enumerable in strict mode. - return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') && - (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag); -} - -/** - * Checks if `value` is classified as an `Array` object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an array, else `false`. - * @example - * - * _.isArray([1, 2, 3]); - * // => true - * - * _.isArray(document.body.children); - * // => false - * - * _.isArray('abc'); - * // => false - * - * _.isArray(_.noop); - * // => false - */ -var isArray = Array.isArray; - -/** - * Checks if `value` is array-like. A value is considered array-like if it's - * not a function and has a `value.length` that's an integer greater than or - * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is array-like, else `false`. - * @example - * - * _.isArrayLike([1, 2, 3]); - * // => true - * - * _.isArrayLike(document.body.children); - * // => true - * - * _.isArrayLike('abc'); - * // => true - * - * _.isArrayLike(_.noop); - * // => false - */ -function isArrayLike(value) { - return value != null && isLength(value.length) && !isFunction(value); -} - -/** - * This method is like `_.isArrayLike` except that it also checks if `value` - * is an object. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an array-like object, - * else `false`. - * @example - * - * _.isArrayLikeObject([1, 2, 3]); - * // => true - * - * _.isArrayLikeObject(document.body.children); - * // => true - * - * _.isArrayLikeObject('abc'); - * // => false - * - * _.isArrayLikeObject(_.noop); - * // => false - */ -function isArrayLikeObject(value) { - return isObjectLike(value) && isArrayLike(value); -} - -/** - * Checks if `value` is a buffer. - * - * @static - * @memberOf _ - * @since 4.3.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a buffer, else `false`. - * @example - * - * _.isBuffer(new Buffer(2)); - * // => true - * - * _.isBuffer(new Uint8Array(2)); - * // => false - */ -var isBuffer = nativeIsBuffer || stubFalse; - -/** - * Checks if `value` is classified as a `Function` object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a function, else `false`. - * @example - * - * _.isFunction(_); - * // => true - * - * _.isFunction(/abc/); - * // => false - */ -function isFunction(value) { - // The use of `Object#toString` avoids issues with the `typeof` operator - // in Safari 8-9 which returns 'object' for typed array and other constructors. - var tag = isObject(value) ? objectToString.call(value) : ''; - return tag == funcTag || tag == genTag; -} - -/** - * Checks if `value` is a valid array-like length. - * - * **Note:** This method is loosely based on - * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. - * @example - * - * _.isLength(3); - * // => true - * - * _.isLength(Number.MIN_VALUE); - * // => false - * - * _.isLength(Infinity); - * // => false - * - * _.isLength('3'); - * // => false - */ -function isLength(value) { - return typeof value == 'number' && - value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; -} - -/** - * Checks if `value` is the - * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) - * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an object, else `false`. - * @example - * - * _.isObject({}); - * // => true - * - * _.isObject([1, 2, 3]); - * // => true - * - * _.isObject(_.noop); - * // => true - * - * _.isObject(null); - * // => false - */ -function isObject(value) { - var type = typeof value; - return !!value && (type == 'object' || type == 'function'); -} - -/** - * Checks if `value` is object-like. A value is object-like if it's not `null` - * and has a `typeof` result of "object". - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is object-like, else `false`. - * @example - * - * _.isObjectLike({}); - * // => true - * - * _.isObjectLike([1, 2, 3]); - * // => true - * - * _.isObjectLike(_.noop); - * // => false - * - * _.isObjectLike(null); - * // => false - */ -function isObjectLike(value) { - return !!value && typeof value == 'object'; -} - -/** - * Creates an array of the own enumerable property names of `object`. - * - * **Note:** Non-object values are coerced to objects. See the - * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) - * for more details. - * - * @static - * @since 0.1.0 - * @memberOf _ - * @category Object - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.keys(new Foo); - * // => ['a', 'b'] (iteration order is not guaranteed) - * - * _.keys('hi'); - * // => ['0', '1'] - */ -function keys(object) { - return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object); -} - -/** - * This method returns a new empty array. - * - * @static - * @memberOf _ - * @since 4.13.0 - * @category Util - * @returns {Array} Returns the new empty array. - * @example - * - * var arrays = _.times(2, _.stubArray); - * - * console.log(arrays); - * // => [[], []] - * - * console.log(arrays[0] === arrays[1]); - * // => false - */ -function stubArray() { - return []; -} - -/** - * This method returns `false`. - * - * @static - * @memberOf _ - * @since 4.13.0 - * @category Util - * @returns {boolean} Returns `false`. - * @example - * - * _.times(2, _.stubFalse); - * // => [false, false] - */ -function stubFalse() { - return false; -} - -module.exports = cloneDeep; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash.clonedeep/package.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash.clonedeep/package.json deleted file mode 100644 index fb1d626d..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash.clonedeep/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "name": "lodash.clonedeep", - "version": "4.5.0", - "description": "The lodash method `_.cloneDeep` exported as a module.", - "homepage": "https://lodash.com/", - "icon": "https://lodash.com/icon.svg", - "license": "MIT", - "keywords": "lodash-modularized, clonedeep", - "author": "John-David Dalton (http://allyoucanleet.com/)", - "contributors": [ - "John-David Dalton (http://allyoucanleet.com/)", - "Blaine Bublitz (https://github.com/phated)", - "Mathias Bynens (https://mathiasbynens.be/)" - ], - "repository": "lodash/lodash", - "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash.includes/LICENSE b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash.includes/LICENSE deleted file mode 100644 index e0c69d56..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash.includes/LICENSE +++ /dev/null @@ -1,47 +0,0 @@ -Copyright jQuery Foundation and other contributors - -Based on Underscore.js, copyright Jeremy Ashkenas, -DocumentCloud and Investigative Reporters & Editors - -This software consists of voluntary contributions made by many -individuals. For exact contribution history, see the revision history -available at https://github.com/lodash/lodash - -The following license applies to all parts of this software except as -documented below: - -==== - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -==== - -Copyright and related rights for sample code are waived via CC0. Sample -code is defined as all source code displayed within the prose of the -documentation. - -CC0: http://creativecommons.org/publicdomain/zero/1.0/ - -==== - -Files located in the node_modules and vendor directories are externally -maintained libraries used by this software which have their own -licenses; we recommend you read them, as their terms may differ from the -terms above. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash.includes/README.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash.includes/README.md deleted file mode 100644 index 26e93775..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash.includes/README.md +++ /dev/null @@ -1,18 +0,0 @@ -# lodash.includes v4.3.0 - -The [lodash](https://lodash.com/) method `_.includes` exported as a [Node.js](https://nodejs.org/) module. - -## Installation - -Using npm: -```bash -$ {sudo -H} npm i -g npm -$ npm i --save lodash.includes -``` - -In Node.js: -```js -var includes = require('lodash.includes'); -``` - -See the [documentation](https://lodash.com/docs#includes) or [package source](https://github.com/lodash/lodash/blob/4.3.0-npm-packages/lodash.includes) for more details. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash.includes/index.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash.includes/index.js deleted file mode 100644 index e88d5338..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash.includes/index.js +++ /dev/null @@ -1,745 +0,0 @@ -/** - * lodash (Custom Build) - * Build: `lodash modularize exports="npm" -o ./` - * Copyright jQuery Foundation and other contributors - * Released under MIT license - * Based on Underscore.js 1.8.3 - * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - */ - -/** Used as references for various `Number` constants. */ -var INFINITY = 1 / 0, - MAX_SAFE_INTEGER = 9007199254740991, - MAX_INTEGER = 1.7976931348623157e+308, - NAN = 0 / 0; - -/** `Object#toString` result references. */ -var argsTag = '[object Arguments]', - funcTag = '[object Function]', - genTag = '[object GeneratorFunction]', - stringTag = '[object String]', - symbolTag = '[object Symbol]'; - -/** Used to match leading and trailing whitespace. */ -var reTrim = /^\s+|\s+$/g; - -/** Used to detect bad signed hexadecimal string values. */ -var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; - -/** Used to detect binary string values. */ -var reIsBinary = /^0b[01]+$/i; - -/** Used to detect octal string values. */ -var reIsOctal = /^0o[0-7]+$/i; - -/** Used to detect unsigned integer values. */ -var reIsUint = /^(?:0|[1-9]\d*)$/; - -/** Built-in method references without a dependency on `root`. */ -var freeParseInt = parseInt; - -/** - * A specialized version of `_.map` for arrays without support for iteratee - * shorthands. - * - * @private - * @param {Array} [array] The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns the new mapped array. - */ -function arrayMap(array, iteratee) { - var index = -1, - length = array ? array.length : 0, - result = Array(length); - - while (++index < length) { - result[index] = iteratee(array[index], index, array); - } - return result; -} - -/** - * The base implementation of `_.findIndex` and `_.findLastIndex` without - * support for iteratee shorthands. - * - * @private - * @param {Array} array The array to inspect. - * @param {Function} predicate The function invoked per iteration. - * @param {number} fromIndex The index to search from. - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {number} Returns the index of the matched value, else `-1`. - */ -function baseFindIndex(array, predicate, fromIndex, fromRight) { - var length = array.length, - index = fromIndex + (fromRight ? 1 : -1); - - while ((fromRight ? index-- : ++index < length)) { - if (predicate(array[index], index, array)) { - return index; - } - } - return -1; -} - -/** - * The base implementation of `_.indexOf` without `fromIndex` bounds checks. - * - * @private - * @param {Array} array The array to inspect. - * @param {*} value The value to search for. - * @param {number} fromIndex The index to search from. - * @returns {number} Returns the index of the matched value, else `-1`. - */ -function baseIndexOf(array, value, fromIndex) { - if (value !== value) { - return baseFindIndex(array, baseIsNaN, fromIndex); - } - var index = fromIndex - 1, - length = array.length; - - while (++index < length) { - if (array[index] === value) { - return index; - } - } - return -1; -} - -/** - * The base implementation of `_.isNaN` without support for number objects. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. - */ -function baseIsNaN(value) { - return value !== value; -} - -/** - * The base implementation of `_.times` without support for iteratee shorthands - * or max array length checks. - * - * @private - * @param {number} n The number of times to invoke `iteratee`. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns the array of results. - */ -function baseTimes(n, iteratee) { - var index = -1, - result = Array(n); - - while (++index < n) { - result[index] = iteratee(index); - } - return result; -} - -/** - * The base implementation of `_.values` and `_.valuesIn` which creates an - * array of `object` property values corresponding to the property names - * of `props`. - * - * @private - * @param {Object} object The object to query. - * @param {Array} props The property names to get values for. - * @returns {Object} Returns the array of property values. - */ -function baseValues(object, props) { - return arrayMap(props, function(key) { - return object[key]; - }); -} - -/** - * Creates a unary function that invokes `func` with its argument transformed. - * - * @private - * @param {Function} func The function to wrap. - * @param {Function} transform The argument transform. - * @returns {Function} Returns the new function. - */ -function overArg(func, transform) { - return function(arg) { - return func(transform(arg)); - }; -} - -/** Used for built-in method references. */ -var objectProto = Object.prototype; - -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; - -/** - * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) - * of values. - */ -var objectToString = objectProto.toString; - -/** Built-in value references. */ -var propertyIsEnumerable = objectProto.propertyIsEnumerable; - -/* Built-in method references for those with the same name as other `lodash` methods. */ -var nativeKeys = overArg(Object.keys, Object), - nativeMax = Math.max; - -/** - * Creates an array of the enumerable property names of the array-like `value`. - * - * @private - * @param {*} value The value to query. - * @param {boolean} inherited Specify returning inherited property names. - * @returns {Array} Returns the array of property names. - */ -function arrayLikeKeys(value, inherited) { - // Safari 8.1 makes `arguments.callee` enumerable in strict mode. - // Safari 9 makes `arguments.length` enumerable in strict mode. - var result = (isArray(value) || isArguments(value)) - ? baseTimes(value.length, String) - : []; - - var length = result.length, - skipIndexes = !!length; - - for (var key in value) { - if ((inherited || hasOwnProperty.call(value, key)) && - !(skipIndexes && (key == 'length' || isIndex(key, length)))) { - result.push(key); - } - } - return result; -} - -/** - * The base implementation of `_.keys` which doesn't treat sparse arrays as dense. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. - */ -function baseKeys(object) { - if (!isPrototype(object)) { - return nativeKeys(object); - } - var result = []; - for (var key in Object(object)) { - if (hasOwnProperty.call(object, key) && key != 'constructor') { - result.push(key); - } - } - return result; -} - -/** - * Checks if `value` is a valid array-like index. - * - * @private - * @param {*} value The value to check. - * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. - * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. - */ -function isIndex(value, length) { - length = length == null ? MAX_SAFE_INTEGER : length; - return !!length && - (typeof value == 'number' || reIsUint.test(value)) && - (value > -1 && value % 1 == 0 && value < length); -} - -/** - * Checks if `value` is likely a prototype object. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a prototype, else `false`. - */ -function isPrototype(value) { - var Ctor = value && value.constructor, - proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto; - - return value === proto; -} - -/** - * Checks if `value` is in `collection`. If `collection` is a string, it's - * checked for a substring of `value`, otherwise - * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) - * is used for equality comparisons. If `fromIndex` is negative, it's used as - * the offset from the end of `collection`. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Collection - * @param {Array|Object|string} collection The collection to inspect. - * @param {*} value The value to search for. - * @param {number} [fromIndex=0] The index to search from. - * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`. - * @returns {boolean} Returns `true` if `value` is found, else `false`. - * @example - * - * _.includes([1, 2, 3], 1); - * // => true - * - * _.includes([1, 2, 3], 1, 2); - * // => false - * - * _.includes({ 'a': 1, 'b': 2 }, 1); - * // => true - * - * _.includes('abcd', 'bc'); - * // => true - */ -function includes(collection, value, fromIndex, guard) { - collection = isArrayLike(collection) ? collection : values(collection); - fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0; - - var length = collection.length; - if (fromIndex < 0) { - fromIndex = nativeMax(length + fromIndex, 0); - } - return isString(collection) - ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1) - : (!!length && baseIndexOf(collection, value, fromIndex) > -1); -} - -/** - * Checks if `value` is likely an `arguments` object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an `arguments` object, - * else `false`. - * @example - * - * _.isArguments(function() { return arguments; }()); - * // => true - * - * _.isArguments([1, 2, 3]); - * // => false - */ -function isArguments(value) { - // Safari 8.1 makes `arguments.callee` enumerable in strict mode. - return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') && - (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag); -} - -/** - * Checks if `value` is classified as an `Array` object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an array, else `false`. - * @example - * - * _.isArray([1, 2, 3]); - * // => true - * - * _.isArray(document.body.children); - * // => false - * - * _.isArray('abc'); - * // => false - * - * _.isArray(_.noop); - * // => false - */ -var isArray = Array.isArray; - -/** - * Checks if `value` is array-like. A value is considered array-like if it's - * not a function and has a `value.length` that's an integer greater than or - * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is array-like, else `false`. - * @example - * - * _.isArrayLike([1, 2, 3]); - * // => true - * - * _.isArrayLike(document.body.children); - * // => true - * - * _.isArrayLike('abc'); - * // => true - * - * _.isArrayLike(_.noop); - * // => false - */ -function isArrayLike(value) { - return value != null && isLength(value.length) && !isFunction(value); -} - -/** - * This method is like `_.isArrayLike` except that it also checks if `value` - * is an object. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an array-like object, - * else `false`. - * @example - * - * _.isArrayLikeObject([1, 2, 3]); - * // => true - * - * _.isArrayLikeObject(document.body.children); - * // => true - * - * _.isArrayLikeObject('abc'); - * // => false - * - * _.isArrayLikeObject(_.noop); - * // => false - */ -function isArrayLikeObject(value) { - return isObjectLike(value) && isArrayLike(value); -} - -/** - * Checks if `value` is classified as a `Function` object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a function, else `false`. - * @example - * - * _.isFunction(_); - * // => true - * - * _.isFunction(/abc/); - * // => false - */ -function isFunction(value) { - // The use of `Object#toString` avoids issues with the `typeof` operator - // in Safari 8-9 which returns 'object' for typed array and other constructors. - var tag = isObject(value) ? objectToString.call(value) : ''; - return tag == funcTag || tag == genTag; -} - -/** - * Checks if `value` is a valid array-like length. - * - * **Note:** This method is loosely based on - * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. - * @example - * - * _.isLength(3); - * // => true - * - * _.isLength(Number.MIN_VALUE); - * // => false - * - * _.isLength(Infinity); - * // => false - * - * _.isLength('3'); - * // => false - */ -function isLength(value) { - return typeof value == 'number' && - value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; -} - -/** - * Checks if `value` is the - * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) - * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an object, else `false`. - * @example - * - * _.isObject({}); - * // => true - * - * _.isObject([1, 2, 3]); - * // => true - * - * _.isObject(_.noop); - * // => true - * - * _.isObject(null); - * // => false - */ -function isObject(value) { - var type = typeof value; - return !!value && (type == 'object' || type == 'function'); -} - -/** - * Checks if `value` is object-like. A value is object-like if it's not `null` - * and has a `typeof` result of "object". - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is object-like, else `false`. - * @example - * - * _.isObjectLike({}); - * // => true - * - * _.isObjectLike([1, 2, 3]); - * // => true - * - * _.isObjectLike(_.noop); - * // => false - * - * _.isObjectLike(null); - * // => false - */ -function isObjectLike(value) { - return !!value && typeof value == 'object'; -} - -/** - * Checks if `value` is classified as a `String` primitive or object. - * - * @static - * @since 0.1.0 - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a string, else `false`. - * @example - * - * _.isString('abc'); - * // => true - * - * _.isString(1); - * // => false - */ -function isString(value) { - return typeof value == 'string' || - (!isArray(value) && isObjectLike(value) && objectToString.call(value) == stringTag); -} - -/** - * Checks if `value` is classified as a `Symbol` primitive or object. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. - * @example - * - * _.isSymbol(Symbol.iterator); - * // => true - * - * _.isSymbol('abc'); - * // => false - */ -function isSymbol(value) { - return typeof value == 'symbol' || - (isObjectLike(value) && objectToString.call(value) == symbolTag); -} - -/** - * Converts `value` to a finite number. - * - * @static - * @memberOf _ - * @since 4.12.0 - * @category Lang - * @param {*} value The value to convert. - * @returns {number} Returns the converted number. - * @example - * - * _.toFinite(3.2); - * // => 3.2 - * - * _.toFinite(Number.MIN_VALUE); - * // => 5e-324 - * - * _.toFinite(Infinity); - * // => 1.7976931348623157e+308 - * - * _.toFinite('3.2'); - * // => 3.2 - */ -function toFinite(value) { - if (!value) { - return value === 0 ? value : 0; - } - value = toNumber(value); - if (value === INFINITY || value === -INFINITY) { - var sign = (value < 0 ? -1 : 1); - return sign * MAX_INTEGER; - } - return value === value ? value : 0; -} - -/** - * Converts `value` to an integer. - * - * **Note:** This method is loosely based on - * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to convert. - * @returns {number} Returns the converted integer. - * @example - * - * _.toInteger(3.2); - * // => 3 - * - * _.toInteger(Number.MIN_VALUE); - * // => 0 - * - * _.toInteger(Infinity); - * // => 1.7976931348623157e+308 - * - * _.toInteger('3.2'); - * // => 3 - */ -function toInteger(value) { - var result = toFinite(value), - remainder = result % 1; - - return result === result ? (remainder ? result - remainder : result) : 0; -} - -/** - * Converts `value` to a number. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to process. - * @returns {number} Returns the number. - * @example - * - * _.toNumber(3.2); - * // => 3.2 - * - * _.toNumber(Number.MIN_VALUE); - * // => 5e-324 - * - * _.toNumber(Infinity); - * // => Infinity - * - * _.toNumber('3.2'); - * // => 3.2 - */ -function toNumber(value) { - if (typeof value == 'number') { - return value; - } - if (isSymbol(value)) { - return NAN; - } - if (isObject(value)) { - var other = typeof value.valueOf == 'function' ? value.valueOf() : value; - value = isObject(other) ? (other + '') : other; - } - if (typeof value != 'string') { - return value === 0 ? value : +value; - } - value = value.replace(reTrim, ''); - var isBinary = reIsBinary.test(value); - return (isBinary || reIsOctal.test(value)) - ? freeParseInt(value.slice(2), isBinary ? 2 : 8) - : (reIsBadHex.test(value) ? NAN : +value); -} - -/** - * Creates an array of the own enumerable property names of `object`. - * - * **Note:** Non-object values are coerced to objects. See the - * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) - * for more details. - * - * @static - * @since 0.1.0 - * @memberOf _ - * @category Object - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.keys(new Foo); - * // => ['a', 'b'] (iteration order is not guaranteed) - * - * _.keys('hi'); - * // => ['0', '1'] - */ -function keys(object) { - return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object); -} - -/** - * Creates an array of the own enumerable string keyed property values of `object`. - * - * **Note:** Non-object values are coerced to objects. - * - * @static - * @since 0.1.0 - * @memberOf _ - * @category Object - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property values. - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.values(new Foo); - * // => [1, 2] (iteration order is not guaranteed) - * - * _.values('hi'); - * // => ['h', 'i'] - */ -function values(object) { - return object ? baseValues(object, keys(object)) : []; -} - -module.exports = includes; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash.includes/package.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash.includes/package.json deleted file mode 100644 index a02e645d..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash.includes/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "name": "lodash.includes", - "version": "4.3.0", - "description": "The lodash method `_.includes` exported as a module.", - "homepage": "https://lodash.com/", - "icon": "https://lodash.com/icon.svg", - "license": "MIT", - "keywords": "lodash-modularized, includes", - "author": "John-David Dalton (http://allyoucanleet.com/)", - "contributors": [ - "John-David Dalton (http://allyoucanleet.com/)", - "Blaine Bublitz (https://github.com/phated)", - "Mathias Bynens (https://mathiasbynens.be/)" - ], - "repository": "lodash/lodash", - "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash.isboolean/LICENSE b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash.isboolean/LICENSE deleted file mode 100644 index b054ca5a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash.isboolean/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -Copyright 2012-2016 The Dojo Foundation -Based on Underscore.js, copyright 2009-2016 Jeremy Ashkenas, -DocumentCloud and Investigative Reporters & Editors - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash.isboolean/README.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash.isboolean/README.md deleted file mode 100644 index b3c476b0..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash.isboolean/README.md +++ /dev/null @@ -1,18 +0,0 @@ -# lodash.isboolean v3.0.3 - -The [lodash](https://lodash.com/) method `_.isBoolean` exported as a [Node.js](https://nodejs.org/) module. - -## Installation - -Using npm: -```bash -$ {sudo -H} npm i -g npm -$ npm i --save lodash.isboolean -``` - -In Node.js: -```js -var isBoolean = require('lodash.isboolean'); -``` - -See the [documentation](https://lodash.com/docs#isBoolean) or [package source](https://github.com/lodash/lodash/blob/3.0.3-npm-packages/lodash.isboolean) for more details. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash.isboolean/index.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash.isboolean/index.js deleted file mode 100644 index 23bbabdc..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash.isboolean/index.js +++ /dev/null @@ -1,70 +0,0 @@ -/** - * lodash 3.0.3 (Custom Build) - * Build: `lodash modularize exports="npm" -o ./` - * Copyright 2012-2016 The Dojo Foundation - * Based on Underscore.js 1.8.3 - * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - * Available under MIT license - */ - -/** `Object#toString` result references. */ -var boolTag = '[object Boolean]'; - -/** Used for built-in method references. */ -var objectProto = Object.prototype; - -/** - * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) - * of values. - */ -var objectToString = objectProto.toString; - -/** - * Checks if `value` is classified as a boolean primitive or object. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isBoolean(false); - * // => true - * - * _.isBoolean(null); - * // => false - */ -function isBoolean(value) { - return value === true || value === false || - (isObjectLike(value) && objectToString.call(value) == boolTag); -} - -/** - * Checks if `value` is object-like. A value is object-like if it's not `null` - * and has a `typeof` result of "object". - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is object-like, else `false`. - * @example - * - * _.isObjectLike({}); - * // => true - * - * _.isObjectLike([1, 2, 3]); - * // => true - * - * _.isObjectLike(_.noop); - * // => false - * - * _.isObjectLike(null); - * // => false - */ -function isObjectLike(value) { - return !!value && typeof value == 'object'; -} - -module.exports = isBoolean; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash.isboolean/package.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash.isboolean/package.json deleted file mode 100644 index 01d6e8b9..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash.isboolean/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "name": "lodash.isboolean", - "version": "3.0.3", - "description": "The lodash method `_.isBoolean` exported as a module.", - "homepage": "https://lodash.com/", - "icon": "https://lodash.com/icon.svg", - "license": "MIT", - "keywords": "lodash-modularized, isboolean", - "author": "John-David Dalton (http://allyoucanleet.com/)", - "contributors": [ - "John-David Dalton (http://allyoucanleet.com/)", - "Blaine Bublitz (https://github.com/phated)", - "Mathias Bynens (https://mathiasbynens.be/)" - ], - "repository": "lodash/lodash", - "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash.isinteger/LICENSE b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash.isinteger/LICENSE deleted file mode 100644 index e0c69d56..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash.isinteger/LICENSE +++ /dev/null @@ -1,47 +0,0 @@ -Copyright jQuery Foundation and other contributors - -Based on Underscore.js, copyright Jeremy Ashkenas, -DocumentCloud and Investigative Reporters & Editors - -This software consists of voluntary contributions made by many -individuals. For exact contribution history, see the revision history -available at https://github.com/lodash/lodash - -The following license applies to all parts of this software except as -documented below: - -==== - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -==== - -Copyright and related rights for sample code are waived via CC0. Sample -code is defined as all source code displayed within the prose of the -documentation. - -CC0: http://creativecommons.org/publicdomain/zero/1.0/ - -==== - -Files located in the node_modules and vendor directories are externally -maintained libraries used by this software which have their own -licenses; we recommend you read them, as their terms may differ from the -terms above. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash.isinteger/README.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash.isinteger/README.md deleted file mode 100644 index 3a78567b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash.isinteger/README.md +++ /dev/null @@ -1,18 +0,0 @@ -# lodash.isinteger v4.0.4 - -The [lodash](https://lodash.com/) method `_.isInteger` exported as a [Node.js](https://nodejs.org/) module. - -## Installation - -Using npm: -```bash -$ {sudo -H} npm i -g npm -$ npm i --save lodash.isinteger -``` - -In Node.js: -```js -var isInteger = require('lodash.isinteger'); -``` - -See the [documentation](https://lodash.com/docs#isInteger) or [package source](https://github.com/lodash/lodash/blob/4.0.4-npm-packages/lodash.isinteger) for more details. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash.isinteger/index.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash.isinteger/index.js deleted file mode 100644 index 3bf06f00..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash.isinteger/index.js +++ /dev/null @@ -1,265 +0,0 @@ -/** - * lodash (Custom Build) - * Build: `lodash modularize exports="npm" -o ./` - * Copyright jQuery Foundation and other contributors - * Released under MIT license - * Based on Underscore.js 1.8.3 - * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - */ - -/** Used as references for various `Number` constants. */ -var INFINITY = 1 / 0, - MAX_INTEGER = 1.7976931348623157e+308, - NAN = 0 / 0; - -/** `Object#toString` result references. */ -var symbolTag = '[object Symbol]'; - -/** Used to match leading and trailing whitespace. */ -var reTrim = /^\s+|\s+$/g; - -/** Used to detect bad signed hexadecimal string values. */ -var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; - -/** Used to detect binary string values. */ -var reIsBinary = /^0b[01]+$/i; - -/** Used to detect octal string values. */ -var reIsOctal = /^0o[0-7]+$/i; - -/** Built-in method references without a dependency on `root`. */ -var freeParseInt = parseInt; - -/** Used for built-in method references. */ -var objectProto = Object.prototype; - -/** - * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) - * of values. - */ -var objectToString = objectProto.toString; - -/** - * Checks if `value` is an integer. - * - * **Note:** This method is based on - * [`Number.isInteger`](https://mdn.io/Number/isInteger). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an integer, else `false`. - * @example - * - * _.isInteger(3); - * // => true - * - * _.isInteger(Number.MIN_VALUE); - * // => false - * - * _.isInteger(Infinity); - * // => false - * - * _.isInteger('3'); - * // => false - */ -function isInteger(value) { - return typeof value == 'number' && value == toInteger(value); -} - -/** - * Checks if `value` is the - * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) - * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an object, else `false`. - * @example - * - * _.isObject({}); - * // => true - * - * _.isObject([1, 2, 3]); - * // => true - * - * _.isObject(_.noop); - * // => true - * - * _.isObject(null); - * // => false - */ -function isObject(value) { - var type = typeof value; - return !!value && (type == 'object' || type == 'function'); -} - -/** - * Checks if `value` is object-like. A value is object-like if it's not `null` - * and has a `typeof` result of "object". - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is object-like, else `false`. - * @example - * - * _.isObjectLike({}); - * // => true - * - * _.isObjectLike([1, 2, 3]); - * // => true - * - * _.isObjectLike(_.noop); - * // => false - * - * _.isObjectLike(null); - * // => false - */ -function isObjectLike(value) { - return !!value && typeof value == 'object'; -} - -/** - * Checks if `value` is classified as a `Symbol` primitive or object. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. - * @example - * - * _.isSymbol(Symbol.iterator); - * // => true - * - * _.isSymbol('abc'); - * // => false - */ -function isSymbol(value) { - return typeof value == 'symbol' || - (isObjectLike(value) && objectToString.call(value) == symbolTag); -} - -/** - * Converts `value` to a finite number. - * - * @static - * @memberOf _ - * @since 4.12.0 - * @category Lang - * @param {*} value The value to convert. - * @returns {number} Returns the converted number. - * @example - * - * _.toFinite(3.2); - * // => 3.2 - * - * _.toFinite(Number.MIN_VALUE); - * // => 5e-324 - * - * _.toFinite(Infinity); - * // => 1.7976931348623157e+308 - * - * _.toFinite('3.2'); - * // => 3.2 - */ -function toFinite(value) { - if (!value) { - return value === 0 ? value : 0; - } - value = toNumber(value); - if (value === INFINITY || value === -INFINITY) { - var sign = (value < 0 ? -1 : 1); - return sign * MAX_INTEGER; - } - return value === value ? value : 0; -} - -/** - * Converts `value` to an integer. - * - * **Note:** This method is loosely based on - * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to convert. - * @returns {number} Returns the converted integer. - * @example - * - * _.toInteger(3.2); - * // => 3 - * - * _.toInteger(Number.MIN_VALUE); - * // => 0 - * - * _.toInteger(Infinity); - * // => 1.7976931348623157e+308 - * - * _.toInteger('3.2'); - * // => 3 - */ -function toInteger(value) { - var result = toFinite(value), - remainder = result % 1; - - return result === result ? (remainder ? result - remainder : result) : 0; -} - -/** - * Converts `value` to a number. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to process. - * @returns {number} Returns the number. - * @example - * - * _.toNumber(3.2); - * // => 3.2 - * - * _.toNumber(Number.MIN_VALUE); - * // => 5e-324 - * - * _.toNumber(Infinity); - * // => Infinity - * - * _.toNumber('3.2'); - * // => 3.2 - */ -function toNumber(value) { - if (typeof value == 'number') { - return value; - } - if (isSymbol(value)) { - return NAN; - } - if (isObject(value)) { - var other = typeof value.valueOf == 'function' ? value.valueOf() : value; - value = isObject(other) ? (other + '') : other; - } - if (typeof value != 'string') { - return value === 0 ? value : +value; - } - value = value.replace(reTrim, ''); - var isBinary = reIsBinary.test(value); - return (isBinary || reIsOctal.test(value)) - ? freeParseInt(value.slice(2), isBinary ? 2 : 8) - : (reIsBadHex.test(value) ? NAN : +value); -} - -module.exports = isInteger; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash.isinteger/package.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash.isinteger/package.json deleted file mode 100644 index 92db256f..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash.isinteger/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "name": "lodash.isinteger", - "version": "4.0.4", - "description": "The lodash method `_.isInteger` exported as a module.", - "homepage": "https://lodash.com/", - "icon": "https://lodash.com/icon.svg", - "license": "MIT", - "keywords": "lodash-modularized, isinteger", - "author": "John-David Dalton (http://allyoucanleet.com/)", - "contributors": [ - "John-David Dalton (http://allyoucanleet.com/)", - "Blaine Bublitz (https://github.com/phated)", - "Mathias Bynens (https://mathiasbynens.be/)" - ], - "repository": "lodash/lodash", - "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash.isnumber/LICENSE b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash.isnumber/LICENSE deleted file mode 100644 index b054ca5a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash.isnumber/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -Copyright 2012-2016 The Dojo Foundation -Based on Underscore.js, copyright 2009-2016 Jeremy Ashkenas, -DocumentCloud and Investigative Reporters & Editors - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash.isnumber/README.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash.isnumber/README.md deleted file mode 100644 index a1d434dd..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash.isnumber/README.md +++ /dev/null @@ -1,18 +0,0 @@ -# lodash.isnumber v3.0.3 - -The [lodash](https://lodash.com/) method `_.isNumber` exported as a [Node.js](https://nodejs.org/) module. - -## Installation - -Using npm: -```bash -$ {sudo -H} npm i -g npm -$ npm i --save lodash.isnumber -``` - -In Node.js: -```js -var isNumber = require('lodash.isnumber'); -``` - -See the [documentation](https://lodash.com/docs#isNumber) or [package source](https://github.com/lodash/lodash/blob/3.0.3-npm-packages/lodash.isnumber) for more details. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash.isnumber/index.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash.isnumber/index.js deleted file mode 100644 index 35a85732..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash.isnumber/index.js +++ /dev/null @@ -1,79 +0,0 @@ -/** - * lodash 3.0.3 (Custom Build) - * Build: `lodash modularize exports="npm" -o ./` - * Copyright 2012-2016 The Dojo Foundation - * Based on Underscore.js 1.8.3 - * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - * Available under MIT license - */ - -/** `Object#toString` result references. */ -var numberTag = '[object Number]'; - -/** Used for built-in method references. */ -var objectProto = Object.prototype; - -/** - * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) - * of values. - */ -var objectToString = objectProto.toString; - -/** - * Checks if `value` is object-like. A value is object-like if it's not `null` - * and has a `typeof` result of "object". - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is object-like, else `false`. - * @example - * - * _.isObjectLike({}); - * // => true - * - * _.isObjectLike([1, 2, 3]); - * // => true - * - * _.isObjectLike(_.noop); - * // => false - * - * _.isObjectLike(null); - * // => false - */ -function isObjectLike(value) { - return !!value && typeof value == 'object'; -} - -/** - * Checks if `value` is classified as a `Number` primitive or object. - * - * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are classified - * as numbers, use the `_.isFinite` method. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isNumber(3); - * // => true - * - * _.isNumber(Number.MIN_VALUE); - * // => true - * - * _.isNumber(Infinity); - * // => true - * - * _.isNumber('3'); - * // => false - */ -function isNumber(value) { - return typeof value == 'number' || - (isObjectLike(value) && objectToString.call(value) == numberTag); -} - -module.exports = isNumber; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash.isnumber/package.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash.isnumber/package.json deleted file mode 100644 index 4c33c2a3..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash.isnumber/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "name": "lodash.isnumber", - "version": "3.0.3", - "description": "The lodash method `_.isNumber` exported as a module.", - "homepage": "https://lodash.com/", - "icon": "https://lodash.com/icon.svg", - "license": "MIT", - "keywords": "lodash-modularized, isnumber", - "author": "John-David Dalton (http://allyoucanleet.com/)", - "contributors": [ - "John-David Dalton (http://allyoucanleet.com/)", - "Blaine Bublitz (https://github.com/phated)", - "Mathias Bynens (https://mathiasbynens.be/)" - ], - "repository": "lodash/lodash", - "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash.isplainobject/LICENSE b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash.isplainobject/LICENSE deleted file mode 100644 index e0c69d56..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash.isplainobject/LICENSE +++ /dev/null @@ -1,47 +0,0 @@ -Copyright jQuery Foundation and other contributors - -Based on Underscore.js, copyright Jeremy Ashkenas, -DocumentCloud and Investigative Reporters & Editors - -This software consists of voluntary contributions made by many -individuals. For exact contribution history, see the revision history -available at https://github.com/lodash/lodash - -The following license applies to all parts of this software except as -documented below: - -==== - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -==== - -Copyright and related rights for sample code are waived via CC0. Sample -code is defined as all source code displayed within the prose of the -documentation. - -CC0: http://creativecommons.org/publicdomain/zero/1.0/ - -==== - -Files located in the node_modules and vendor directories are externally -maintained libraries used by this software which have their own -licenses; we recommend you read them, as their terms may differ from the -terms above. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash.isplainobject/README.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash.isplainobject/README.md deleted file mode 100644 index aeefd74d..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash.isplainobject/README.md +++ /dev/null @@ -1,18 +0,0 @@ -# lodash.isplainobject v4.0.6 - -The [lodash](https://lodash.com/) method `_.isPlainObject` exported as a [Node.js](https://nodejs.org/) module. - -## Installation - -Using npm: -```bash -$ {sudo -H} npm i -g npm -$ npm i --save lodash.isplainobject -``` - -In Node.js: -```js -var isPlainObject = require('lodash.isplainobject'); -``` - -See the [documentation](https://lodash.com/docs#isPlainObject) or [package source](https://github.com/lodash/lodash/blob/4.0.6-npm-packages/lodash.isplainobject) for more details. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash.isplainobject/index.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash.isplainobject/index.js deleted file mode 100644 index 0f820ee7..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash.isplainobject/index.js +++ /dev/null @@ -1,139 +0,0 @@ -/** - * lodash (Custom Build) - * Build: `lodash modularize exports="npm" -o ./` - * Copyright jQuery Foundation and other contributors - * Released under MIT license - * Based on Underscore.js 1.8.3 - * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - */ - -/** `Object#toString` result references. */ -var objectTag = '[object Object]'; - -/** - * Checks if `value` is a host object in IE < 9. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a host object, else `false`. - */ -function isHostObject(value) { - // Many host objects are `Object` objects that can coerce to strings - // despite having improperly defined `toString` methods. - var result = false; - if (value != null && typeof value.toString != 'function') { - try { - result = !!(value + ''); - } catch (e) {} - } - return result; -} - -/** - * Creates a unary function that invokes `func` with its argument transformed. - * - * @private - * @param {Function} func The function to wrap. - * @param {Function} transform The argument transform. - * @returns {Function} Returns the new function. - */ -function overArg(func, transform) { - return function(arg) { - return func(transform(arg)); - }; -} - -/** Used for built-in method references. */ -var funcProto = Function.prototype, - objectProto = Object.prototype; - -/** Used to resolve the decompiled source of functions. */ -var funcToString = funcProto.toString; - -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; - -/** Used to infer the `Object` constructor. */ -var objectCtorString = funcToString.call(Object); - -/** - * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) - * of values. - */ -var objectToString = objectProto.toString; - -/** Built-in value references. */ -var getPrototype = overArg(Object.getPrototypeOf, Object); - -/** - * Checks if `value` is object-like. A value is object-like if it's not `null` - * and has a `typeof` result of "object". - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is object-like, else `false`. - * @example - * - * _.isObjectLike({}); - * // => true - * - * _.isObjectLike([1, 2, 3]); - * // => true - * - * _.isObjectLike(_.noop); - * // => false - * - * _.isObjectLike(null); - * // => false - */ -function isObjectLike(value) { - return !!value && typeof value == 'object'; -} - -/** - * Checks if `value` is a plain object, that is, an object created by the - * `Object` constructor or one with a `[[Prototype]]` of `null`. - * - * @static - * @memberOf _ - * @since 0.8.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a plain object, else `false`. - * @example - * - * function Foo() { - * this.a = 1; - * } - * - * _.isPlainObject(new Foo); - * // => false - * - * _.isPlainObject([1, 2, 3]); - * // => false - * - * _.isPlainObject({ 'x': 0, 'y': 0 }); - * // => true - * - * _.isPlainObject(Object.create(null)); - * // => true - */ -function isPlainObject(value) { - if (!isObjectLike(value) || - objectToString.call(value) != objectTag || isHostObject(value)) { - return false; - } - var proto = getPrototype(value); - if (proto === null) { - return true; - } - var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor; - return (typeof Ctor == 'function' && - Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString); -} - -module.exports = isPlainObject; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash.isplainobject/package.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash.isplainobject/package.json deleted file mode 100644 index 86f6a07e..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash.isplainobject/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "name": "lodash.isplainobject", - "version": "4.0.6", - "description": "The lodash method `_.isPlainObject` exported as a module.", - "homepage": "https://lodash.com/", - "icon": "https://lodash.com/icon.svg", - "license": "MIT", - "keywords": "lodash-modularized, isplainobject", - "author": "John-David Dalton (http://allyoucanleet.com/)", - "contributors": [ - "John-David Dalton (http://allyoucanleet.com/)", - "Blaine Bublitz (https://github.com/phated)", - "Mathias Bynens (https://mathiasbynens.be/)" - ], - "repository": "lodash/lodash", - "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash.isstring/LICENSE b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash.isstring/LICENSE deleted file mode 100644 index b054ca5a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash.isstring/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -Copyright 2012-2016 The Dojo Foundation -Based on Underscore.js, copyright 2009-2016 Jeremy Ashkenas, -DocumentCloud and Investigative Reporters & Editors - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash.isstring/README.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash.isstring/README.md deleted file mode 100644 index f184029a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash.isstring/README.md +++ /dev/null @@ -1,18 +0,0 @@ -# lodash.isstring v4.0.1 - -The [lodash](https://lodash.com/) method `_.isString` exported as a [Node.js](https://nodejs.org/) module. - -## Installation - -Using npm: -```bash -$ {sudo -H} npm i -g npm -$ npm i --save lodash.isstring -``` - -In Node.js: -```js -var isString = require('lodash.isstring'); -``` - -See the [documentation](https://lodash.com/docs#isString) or [package source](https://github.com/lodash/lodash/blob/4.0.1-npm-packages/lodash.isstring) for more details. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash.isstring/index.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash.isstring/index.js deleted file mode 100644 index 408225c5..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash.isstring/index.js +++ /dev/null @@ -1,95 +0,0 @@ -/** - * lodash 4.0.1 (Custom Build) - * Build: `lodash modularize exports="npm" -o ./` - * Copyright 2012-2016 The Dojo Foundation - * Based on Underscore.js 1.8.3 - * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - * Available under MIT license - */ - -/** `Object#toString` result references. */ -var stringTag = '[object String]'; - -/** Used for built-in method references. */ -var objectProto = Object.prototype; - -/** - * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) - * of values. - */ -var objectToString = objectProto.toString; - -/** - * Checks if `value` is classified as an `Array` object. - * - * @static - * @memberOf _ - * @type Function - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isArray([1, 2, 3]); - * // => true - * - * _.isArray(document.body.children); - * // => false - * - * _.isArray('abc'); - * // => false - * - * _.isArray(_.noop); - * // => false - */ -var isArray = Array.isArray; - -/** - * Checks if `value` is object-like. A value is object-like if it's not `null` - * and has a `typeof` result of "object". - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is object-like, else `false`. - * @example - * - * _.isObjectLike({}); - * // => true - * - * _.isObjectLike([1, 2, 3]); - * // => true - * - * _.isObjectLike(_.noop); - * // => false - * - * _.isObjectLike(null); - * // => false - */ -function isObjectLike(value) { - return !!value && typeof value == 'object'; -} - -/** - * Checks if `value` is classified as a `String` primitive or object. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isString('abc'); - * // => true - * - * _.isString(1); - * // => false - */ -function isString(value) { - return typeof value == 'string' || - (!isArray(value) && isObjectLike(value) && objectToString.call(value) == stringTag); -} - -module.exports = isString; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash.isstring/package.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash.isstring/package.json deleted file mode 100644 index 1331535d..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash.isstring/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "name": "lodash.isstring", - "version": "4.0.1", - "description": "The lodash method `_.isString` exported as a module.", - "homepage": "https://lodash.com/", - "icon": "https://lodash.com/icon.svg", - "license": "MIT", - "keywords": "lodash-modularized, isstring", - "author": "John-David Dalton (http://allyoucanleet.com/)", - "contributors": [ - "John-David Dalton (http://allyoucanleet.com/)", - "Blaine Bublitz (https://github.com/phated)", - "Mathias Bynens (https://mathiasbynens.be/)" - ], - "repository": "lodash/lodash", - "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash.once/LICENSE b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash.once/LICENSE deleted file mode 100644 index e0c69d56..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash.once/LICENSE +++ /dev/null @@ -1,47 +0,0 @@ -Copyright jQuery Foundation and other contributors - -Based on Underscore.js, copyright Jeremy Ashkenas, -DocumentCloud and Investigative Reporters & Editors - -This software consists of voluntary contributions made by many -individuals. For exact contribution history, see the revision history -available at https://github.com/lodash/lodash - -The following license applies to all parts of this software except as -documented below: - -==== - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -==== - -Copyright and related rights for sample code are waived via CC0. Sample -code is defined as all source code displayed within the prose of the -documentation. - -CC0: http://creativecommons.org/publicdomain/zero/1.0/ - -==== - -Files located in the node_modules and vendor directories are externally -maintained libraries used by this software which have their own -licenses; we recommend you read them, as their terms may differ from the -terms above. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash.once/README.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash.once/README.md deleted file mode 100644 index c4a2f169..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash.once/README.md +++ /dev/null @@ -1,18 +0,0 @@ -# lodash.once v4.1.1 - -The [lodash](https://lodash.com/) method `_.once` exported as a [Node.js](https://nodejs.org/) module. - -## Installation - -Using npm: -```bash -$ {sudo -H} npm i -g npm -$ npm i --save lodash.once -``` - -In Node.js: -```js -var once = require('lodash.once'); -``` - -See the [documentation](https://lodash.com/docs#once) or [package source](https://github.com/lodash/lodash/blob/4.1.1-npm-packages/lodash.once) for more details. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash.once/index.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash.once/index.js deleted file mode 100644 index 414ceb33..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash.once/index.js +++ /dev/null @@ -1,294 +0,0 @@ -/** - * lodash (Custom Build) - * Build: `lodash modularize exports="npm" -o ./` - * Copyright jQuery Foundation and other contributors - * Released under MIT license - * Based on Underscore.js 1.8.3 - * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - */ - -/** Used as the `TypeError` message for "Functions" methods. */ -var FUNC_ERROR_TEXT = 'Expected a function'; - -/** Used as references for various `Number` constants. */ -var INFINITY = 1 / 0, - MAX_INTEGER = 1.7976931348623157e+308, - NAN = 0 / 0; - -/** `Object#toString` result references. */ -var symbolTag = '[object Symbol]'; - -/** Used to match leading and trailing whitespace. */ -var reTrim = /^\s+|\s+$/g; - -/** Used to detect bad signed hexadecimal string values. */ -var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; - -/** Used to detect binary string values. */ -var reIsBinary = /^0b[01]+$/i; - -/** Used to detect octal string values. */ -var reIsOctal = /^0o[0-7]+$/i; - -/** Built-in method references without a dependency on `root`. */ -var freeParseInt = parseInt; - -/** Used for built-in method references. */ -var objectProto = Object.prototype; - -/** - * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) - * of values. - */ -var objectToString = objectProto.toString; - -/** - * Creates a function that invokes `func`, with the `this` binding and arguments - * of the created function, while it's called less than `n` times. Subsequent - * calls to the created function return the result of the last `func` invocation. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Function - * @param {number} n The number of calls at which `func` is no longer invoked. - * @param {Function} func The function to restrict. - * @returns {Function} Returns the new restricted function. - * @example - * - * jQuery(element).on('click', _.before(5, addContactToList)); - * // => Allows adding up to 4 contacts to the list. - */ -function before(n, func) { - var result; - if (typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - n = toInteger(n); - return function() { - if (--n > 0) { - result = func.apply(this, arguments); - } - if (n <= 1) { - func = undefined; - } - return result; - }; -} - -/** - * Creates a function that is restricted to invoking `func` once. Repeat calls - * to the function return the value of the first invocation. The `func` is - * invoked with the `this` binding and arguments of the created function. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Function - * @param {Function} func The function to restrict. - * @returns {Function} Returns the new restricted function. - * @example - * - * var initialize = _.once(createApplication); - * initialize(); - * initialize(); - * // => `createApplication` is invoked once - */ -function once(func) { - return before(2, func); -} - -/** - * Checks if `value` is the - * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) - * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an object, else `false`. - * @example - * - * _.isObject({}); - * // => true - * - * _.isObject([1, 2, 3]); - * // => true - * - * _.isObject(_.noop); - * // => true - * - * _.isObject(null); - * // => false - */ -function isObject(value) { - var type = typeof value; - return !!value && (type == 'object' || type == 'function'); -} - -/** - * Checks if `value` is object-like. A value is object-like if it's not `null` - * and has a `typeof` result of "object". - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is object-like, else `false`. - * @example - * - * _.isObjectLike({}); - * // => true - * - * _.isObjectLike([1, 2, 3]); - * // => true - * - * _.isObjectLike(_.noop); - * // => false - * - * _.isObjectLike(null); - * // => false - */ -function isObjectLike(value) { - return !!value && typeof value == 'object'; -} - -/** - * Checks if `value` is classified as a `Symbol` primitive or object. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. - * @example - * - * _.isSymbol(Symbol.iterator); - * // => true - * - * _.isSymbol('abc'); - * // => false - */ -function isSymbol(value) { - return typeof value == 'symbol' || - (isObjectLike(value) && objectToString.call(value) == symbolTag); -} - -/** - * Converts `value` to a finite number. - * - * @static - * @memberOf _ - * @since 4.12.0 - * @category Lang - * @param {*} value The value to convert. - * @returns {number} Returns the converted number. - * @example - * - * _.toFinite(3.2); - * // => 3.2 - * - * _.toFinite(Number.MIN_VALUE); - * // => 5e-324 - * - * _.toFinite(Infinity); - * // => 1.7976931348623157e+308 - * - * _.toFinite('3.2'); - * // => 3.2 - */ -function toFinite(value) { - if (!value) { - return value === 0 ? value : 0; - } - value = toNumber(value); - if (value === INFINITY || value === -INFINITY) { - var sign = (value < 0 ? -1 : 1); - return sign * MAX_INTEGER; - } - return value === value ? value : 0; -} - -/** - * Converts `value` to an integer. - * - * **Note:** This method is loosely based on - * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to convert. - * @returns {number} Returns the converted integer. - * @example - * - * _.toInteger(3.2); - * // => 3 - * - * _.toInteger(Number.MIN_VALUE); - * // => 0 - * - * _.toInteger(Infinity); - * // => 1.7976931348623157e+308 - * - * _.toInteger('3.2'); - * // => 3 - */ -function toInteger(value) { - var result = toFinite(value), - remainder = result % 1; - - return result === result ? (remainder ? result - remainder : result) : 0; -} - -/** - * Converts `value` to a number. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to process. - * @returns {number} Returns the number. - * @example - * - * _.toNumber(3.2); - * // => 3.2 - * - * _.toNumber(Number.MIN_VALUE); - * // => 5e-324 - * - * _.toNumber(Infinity); - * // => Infinity - * - * _.toNumber('3.2'); - * // => 3.2 - */ -function toNumber(value) { - if (typeof value == 'number') { - return value; - } - if (isSymbol(value)) { - return NAN; - } - if (isObject(value)) { - var other = typeof value.valueOf == 'function' ? value.valueOf() : value; - value = isObject(other) ? (other + '') : other; - } - if (typeof value != 'string') { - return value === 0 ? value : +value; - } - value = value.replace(reTrim, ''); - var isBinary = reIsBinary.test(value); - return (isBinary || reIsOctal.test(value)) - ? freeParseInt(value.slice(2), isBinary ? 2 : 8) - : (reIsBadHex.test(value) ? NAN : +value); -} - -module.exports = once; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash.once/package.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash.once/package.json deleted file mode 100644 index fae782c2..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash.once/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "name": "lodash.once", - "version": "4.1.1", - "description": "The lodash method `_.once` exported as a module.", - "homepage": "https://lodash.com/", - "icon": "https://lodash.com/icon.svg", - "license": "MIT", - "keywords": "lodash-modularized, once", - "author": "John-David Dalton (http://allyoucanleet.com/)", - "contributors": [ - "John-David Dalton (http://allyoucanleet.com/)", - "Blaine Bublitz (https://github.com/phated)", - "Mathias Bynens (https://mathiasbynens.be/)" - ], - "repository": "lodash/lodash", - "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/LICENSE b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/LICENSE deleted file mode 100644 index 77c42f14..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/LICENSE +++ /dev/null @@ -1,47 +0,0 @@ -Copyright OpenJS Foundation and other contributors - -Based on Underscore.js, copyright Jeremy Ashkenas, -DocumentCloud and Investigative Reporters & Editors - -This software consists of voluntary contributions made by many -individuals. For exact contribution history, see the revision history -available at https://github.com/lodash/lodash - -The following license applies to all parts of this software except as -documented below: - -==== - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -==== - -Copyright and related rights for sample code are waived via CC0. Sample -code is defined as all source code displayed within the prose of the -documentation. - -CC0: http://creativecommons.org/publicdomain/zero/1.0/ - -==== - -Files located in the node_modules and vendor directories are externally -maintained libraries used by this software which have their own -licenses; we recommend you read them, as their terms may differ from the -terms above. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/README.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/README.md deleted file mode 100644 index 3ab1a05c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/README.md +++ /dev/null @@ -1,39 +0,0 @@ -# lodash v4.17.21 - -The [Lodash](https://lodash.com/) library exported as [Node.js](https://nodejs.org/) modules. - -## Installation - -Using npm: -```shell -$ npm i -g npm -$ npm i --save lodash -``` - -In Node.js: -```js -// Load the full build. -var _ = require('lodash'); -// Load the core build. -var _ = require('lodash/core'); -// Load the FP build for immutable auto-curried iteratee-first data-last methods. -var fp = require('lodash/fp'); - -// Load method categories. -var array = require('lodash/array'); -var object = require('lodash/fp/object'); - -// Cherry-pick methods for smaller browserify/rollup/webpack bundles. -var at = require('lodash/at'); -var curryN = require('lodash/fp/curryN'); -``` - -See the [package source](https://github.com/lodash/lodash/tree/4.17.21-npm) for more details. - -**Note:**
-Install [n_](https://www.npmjs.com/package/n_) for Lodash use in the Node.js < 6 REPL. - -## Support - -Tested in Chrome 74-75, Firefox 66-67, IE 11, Edge 18, Safari 11-12, & Node.js 8-12.
-Automated [browser](https://saucelabs.com/u/lodash) & [CI](https://travis-ci.org/lodash/lodash/) test runs are available. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_DataView.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_DataView.js deleted file mode 100644 index ac2d57ca..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_DataView.js +++ /dev/null @@ -1,7 +0,0 @@ -var getNative = require('./_getNative'), - root = require('./_root'); - -/* Built-in method references that are verified to be native. */ -var DataView = getNative(root, 'DataView'); - -module.exports = DataView; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_Hash.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_Hash.js deleted file mode 100644 index b504fe34..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_Hash.js +++ /dev/null @@ -1,32 +0,0 @@ -var hashClear = require('./_hashClear'), - hashDelete = require('./_hashDelete'), - hashGet = require('./_hashGet'), - hashHas = require('./_hashHas'), - hashSet = require('./_hashSet'); - -/** - * Creates a hash object. - * - * @private - * @constructor - * @param {Array} [entries] The key-value pairs to cache. - */ -function Hash(entries) { - var index = -1, - length = entries == null ? 0 : entries.length; - - this.clear(); - while (++index < length) { - var entry = entries[index]; - this.set(entry[0], entry[1]); - } -} - -// Add methods to `Hash`. -Hash.prototype.clear = hashClear; -Hash.prototype['delete'] = hashDelete; -Hash.prototype.get = hashGet; -Hash.prototype.has = hashHas; -Hash.prototype.set = hashSet; - -module.exports = Hash; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_LazyWrapper.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_LazyWrapper.js deleted file mode 100644 index 81786c7f..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_LazyWrapper.js +++ /dev/null @@ -1,28 +0,0 @@ -var baseCreate = require('./_baseCreate'), - baseLodash = require('./_baseLodash'); - -/** Used as references for the maximum length and index of an array. */ -var MAX_ARRAY_LENGTH = 4294967295; - -/** - * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation. - * - * @private - * @constructor - * @param {*} value The value to wrap. - */ -function LazyWrapper(value) { - this.__wrapped__ = value; - this.__actions__ = []; - this.__dir__ = 1; - this.__filtered__ = false; - this.__iteratees__ = []; - this.__takeCount__ = MAX_ARRAY_LENGTH; - this.__views__ = []; -} - -// Ensure `LazyWrapper` is an instance of `baseLodash`. -LazyWrapper.prototype = baseCreate(baseLodash.prototype); -LazyWrapper.prototype.constructor = LazyWrapper; - -module.exports = LazyWrapper; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_ListCache.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_ListCache.js deleted file mode 100644 index 26895c3a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_ListCache.js +++ /dev/null @@ -1,32 +0,0 @@ -var listCacheClear = require('./_listCacheClear'), - listCacheDelete = require('./_listCacheDelete'), - listCacheGet = require('./_listCacheGet'), - listCacheHas = require('./_listCacheHas'), - listCacheSet = require('./_listCacheSet'); - -/** - * Creates an list cache object. - * - * @private - * @constructor - * @param {Array} [entries] The key-value pairs to cache. - */ -function ListCache(entries) { - var index = -1, - length = entries == null ? 0 : entries.length; - - this.clear(); - while (++index < length) { - var entry = entries[index]; - this.set(entry[0], entry[1]); - } -} - -// Add methods to `ListCache`. -ListCache.prototype.clear = listCacheClear; -ListCache.prototype['delete'] = listCacheDelete; -ListCache.prototype.get = listCacheGet; -ListCache.prototype.has = listCacheHas; -ListCache.prototype.set = listCacheSet; - -module.exports = ListCache; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_LodashWrapper.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_LodashWrapper.js deleted file mode 100644 index c1e4d9df..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_LodashWrapper.js +++ /dev/null @@ -1,22 +0,0 @@ -var baseCreate = require('./_baseCreate'), - baseLodash = require('./_baseLodash'); - -/** - * The base constructor for creating `lodash` wrapper objects. - * - * @private - * @param {*} value The value to wrap. - * @param {boolean} [chainAll] Enable explicit method chain sequences. - */ -function LodashWrapper(value, chainAll) { - this.__wrapped__ = value; - this.__actions__ = []; - this.__chain__ = !!chainAll; - this.__index__ = 0; - this.__values__ = undefined; -} - -LodashWrapper.prototype = baseCreate(baseLodash.prototype); -LodashWrapper.prototype.constructor = LodashWrapper; - -module.exports = LodashWrapper; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_Map.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_Map.js deleted file mode 100644 index b73f29a0..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_Map.js +++ /dev/null @@ -1,7 +0,0 @@ -var getNative = require('./_getNative'), - root = require('./_root'); - -/* Built-in method references that are verified to be native. */ -var Map = getNative(root, 'Map'); - -module.exports = Map; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_MapCache.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_MapCache.js deleted file mode 100644 index 4a4eea7b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_MapCache.js +++ /dev/null @@ -1,32 +0,0 @@ -var mapCacheClear = require('./_mapCacheClear'), - mapCacheDelete = require('./_mapCacheDelete'), - mapCacheGet = require('./_mapCacheGet'), - mapCacheHas = require('./_mapCacheHas'), - mapCacheSet = require('./_mapCacheSet'); - -/** - * Creates a map cache object to store key-value pairs. - * - * @private - * @constructor - * @param {Array} [entries] The key-value pairs to cache. - */ -function MapCache(entries) { - var index = -1, - length = entries == null ? 0 : entries.length; - - this.clear(); - while (++index < length) { - var entry = entries[index]; - this.set(entry[0], entry[1]); - } -} - -// Add methods to `MapCache`. -MapCache.prototype.clear = mapCacheClear; -MapCache.prototype['delete'] = mapCacheDelete; -MapCache.prototype.get = mapCacheGet; -MapCache.prototype.has = mapCacheHas; -MapCache.prototype.set = mapCacheSet; - -module.exports = MapCache; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_Promise.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_Promise.js deleted file mode 100644 index 247b9e1b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_Promise.js +++ /dev/null @@ -1,7 +0,0 @@ -var getNative = require('./_getNative'), - root = require('./_root'); - -/* Built-in method references that are verified to be native. */ -var Promise = getNative(root, 'Promise'); - -module.exports = Promise; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_Set.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_Set.js deleted file mode 100644 index b3c8dcbf..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_Set.js +++ /dev/null @@ -1,7 +0,0 @@ -var getNative = require('./_getNative'), - root = require('./_root'); - -/* Built-in method references that are verified to be native. */ -var Set = getNative(root, 'Set'); - -module.exports = Set; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_SetCache.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_SetCache.js deleted file mode 100644 index 6468b064..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_SetCache.js +++ /dev/null @@ -1,27 +0,0 @@ -var MapCache = require('./_MapCache'), - setCacheAdd = require('./_setCacheAdd'), - setCacheHas = require('./_setCacheHas'); - -/** - * - * Creates an array cache object to store unique values. - * - * @private - * @constructor - * @param {Array} [values] The values to cache. - */ -function SetCache(values) { - var index = -1, - length = values == null ? 0 : values.length; - - this.__data__ = new MapCache; - while (++index < length) { - this.add(values[index]); - } -} - -// Add methods to `SetCache`. -SetCache.prototype.add = SetCache.prototype.push = setCacheAdd; -SetCache.prototype.has = setCacheHas; - -module.exports = SetCache; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_Stack.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_Stack.js deleted file mode 100644 index 80b2cf1b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_Stack.js +++ /dev/null @@ -1,27 +0,0 @@ -var ListCache = require('./_ListCache'), - stackClear = require('./_stackClear'), - stackDelete = require('./_stackDelete'), - stackGet = require('./_stackGet'), - stackHas = require('./_stackHas'), - stackSet = require('./_stackSet'); - -/** - * Creates a stack cache object to store key-value pairs. - * - * @private - * @constructor - * @param {Array} [entries] The key-value pairs to cache. - */ -function Stack(entries) { - var data = this.__data__ = new ListCache(entries); - this.size = data.size; -} - -// Add methods to `Stack`. -Stack.prototype.clear = stackClear; -Stack.prototype['delete'] = stackDelete; -Stack.prototype.get = stackGet; -Stack.prototype.has = stackHas; -Stack.prototype.set = stackSet; - -module.exports = Stack; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_Symbol.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_Symbol.js deleted file mode 100644 index a013f7c5..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_Symbol.js +++ /dev/null @@ -1,6 +0,0 @@ -var root = require('./_root'); - -/** Built-in value references. */ -var Symbol = root.Symbol; - -module.exports = Symbol; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_Uint8Array.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_Uint8Array.js deleted file mode 100644 index 2fb30e15..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_Uint8Array.js +++ /dev/null @@ -1,6 +0,0 @@ -var root = require('./_root'); - -/** Built-in value references. */ -var Uint8Array = root.Uint8Array; - -module.exports = Uint8Array; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_WeakMap.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_WeakMap.js deleted file mode 100644 index 567f86c6..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_WeakMap.js +++ /dev/null @@ -1,7 +0,0 @@ -var getNative = require('./_getNative'), - root = require('./_root'); - -/* Built-in method references that are verified to be native. */ -var WeakMap = getNative(root, 'WeakMap'); - -module.exports = WeakMap; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_apply.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_apply.js deleted file mode 100644 index 36436dda..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_apply.js +++ /dev/null @@ -1,21 +0,0 @@ -/** - * A faster alternative to `Function#apply`, this function invokes `func` - * with the `this` binding of `thisArg` and the arguments of `args`. - * - * @private - * @param {Function} func The function to invoke. - * @param {*} thisArg The `this` binding of `func`. - * @param {Array} args The arguments to invoke `func` with. - * @returns {*} Returns the result of `func`. - */ -function apply(func, thisArg, args) { - switch (args.length) { - case 0: return func.call(thisArg); - case 1: return func.call(thisArg, args[0]); - case 2: return func.call(thisArg, args[0], args[1]); - case 3: return func.call(thisArg, args[0], args[1], args[2]); - } - return func.apply(thisArg, args); -} - -module.exports = apply; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_arrayAggregator.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_arrayAggregator.js deleted file mode 100644 index d96c3ca4..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_arrayAggregator.js +++ /dev/null @@ -1,22 +0,0 @@ -/** - * A specialized version of `baseAggregator` for arrays. - * - * @private - * @param {Array} [array] The array to iterate over. - * @param {Function} setter The function to set `accumulator` values. - * @param {Function} iteratee The iteratee to transform keys. - * @param {Object} accumulator The initial aggregated object. - * @returns {Function} Returns `accumulator`. - */ -function arrayAggregator(array, setter, iteratee, accumulator) { - var index = -1, - length = array == null ? 0 : array.length; - - while (++index < length) { - var value = array[index]; - setter(accumulator, value, iteratee(value), array); - } - return accumulator; -} - -module.exports = arrayAggregator; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_arrayEach.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_arrayEach.js deleted file mode 100644 index 2c5f5796..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_arrayEach.js +++ /dev/null @@ -1,22 +0,0 @@ -/** - * A specialized version of `_.forEach` for arrays without support for - * iteratee shorthands. - * - * @private - * @param {Array} [array] The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns `array`. - */ -function arrayEach(array, iteratee) { - var index = -1, - length = array == null ? 0 : array.length; - - while (++index < length) { - if (iteratee(array[index], index, array) === false) { - break; - } - } - return array; -} - -module.exports = arrayEach; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_arrayEachRight.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_arrayEachRight.js deleted file mode 100644 index 976ca5c2..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_arrayEachRight.js +++ /dev/null @@ -1,21 +0,0 @@ -/** - * A specialized version of `_.forEachRight` for arrays without support for - * iteratee shorthands. - * - * @private - * @param {Array} [array] The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns `array`. - */ -function arrayEachRight(array, iteratee) { - var length = array == null ? 0 : array.length; - - while (length--) { - if (iteratee(array[length], length, array) === false) { - break; - } - } - return array; -} - -module.exports = arrayEachRight; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_arrayEvery.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_arrayEvery.js deleted file mode 100644 index e26a9184..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_arrayEvery.js +++ /dev/null @@ -1,23 +0,0 @@ -/** - * A specialized version of `_.every` for arrays without support for - * iteratee shorthands. - * - * @private - * @param {Array} [array] The array to iterate over. - * @param {Function} predicate The function invoked per iteration. - * @returns {boolean} Returns `true` if all elements pass the predicate check, - * else `false`. - */ -function arrayEvery(array, predicate) { - var index = -1, - length = array == null ? 0 : array.length; - - while (++index < length) { - if (!predicate(array[index], index, array)) { - return false; - } - } - return true; -} - -module.exports = arrayEvery; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_arrayFilter.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_arrayFilter.js deleted file mode 100644 index 75ea2544..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_arrayFilter.js +++ /dev/null @@ -1,25 +0,0 @@ -/** - * A specialized version of `_.filter` for arrays without support for - * iteratee shorthands. - * - * @private - * @param {Array} [array] The array to iterate over. - * @param {Function} predicate The function invoked per iteration. - * @returns {Array} Returns the new filtered array. - */ -function arrayFilter(array, predicate) { - var index = -1, - length = array == null ? 0 : array.length, - resIndex = 0, - result = []; - - while (++index < length) { - var value = array[index]; - if (predicate(value, index, array)) { - result[resIndex++] = value; - } - } - return result; -} - -module.exports = arrayFilter; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_arrayIncludes.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_arrayIncludes.js deleted file mode 100644 index 3737a6d9..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_arrayIncludes.js +++ /dev/null @@ -1,17 +0,0 @@ -var baseIndexOf = require('./_baseIndexOf'); - -/** - * A specialized version of `_.includes` for arrays without support for - * specifying an index to search from. - * - * @private - * @param {Array} [array] The array to inspect. - * @param {*} target The value to search for. - * @returns {boolean} Returns `true` if `target` is found, else `false`. - */ -function arrayIncludes(array, value) { - var length = array == null ? 0 : array.length; - return !!length && baseIndexOf(array, value, 0) > -1; -} - -module.exports = arrayIncludes; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_arrayIncludesWith.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_arrayIncludesWith.js deleted file mode 100644 index 235fd975..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_arrayIncludesWith.js +++ /dev/null @@ -1,22 +0,0 @@ -/** - * This function is like `arrayIncludes` except that it accepts a comparator. - * - * @private - * @param {Array} [array] The array to inspect. - * @param {*} target The value to search for. - * @param {Function} comparator The comparator invoked per element. - * @returns {boolean} Returns `true` if `target` is found, else `false`. - */ -function arrayIncludesWith(array, value, comparator) { - var index = -1, - length = array == null ? 0 : array.length; - - while (++index < length) { - if (comparator(value, array[index])) { - return true; - } - } - return false; -} - -module.exports = arrayIncludesWith; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_arrayLikeKeys.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_arrayLikeKeys.js deleted file mode 100644 index b2ec9ce7..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_arrayLikeKeys.js +++ /dev/null @@ -1,49 +0,0 @@ -var baseTimes = require('./_baseTimes'), - isArguments = require('./isArguments'), - isArray = require('./isArray'), - isBuffer = require('./isBuffer'), - isIndex = require('./_isIndex'), - isTypedArray = require('./isTypedArray'); - -/** Used for built-in method references. */ -var objectProto = Object.prototype; - -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; - -/** - * Creates an array of the enumerable property names of the array-like `value`. - * - * @private - * @param {*} value The value to query. - * @param {boolean} inherited Specify returning inherited property names. - * @returns {Array} Returns the array of property names. - */ -function arrayLikeKeys(value, inherited) { - var isArr = isArray(value), - isArg = !isArr && isArguments(value), - isBuff = !isArr && !isArg && isBuffer(value), - isType = !isArr && !isArg && !isBuff && isTypedArray(value), - skipIndexes = isArr || isArg || isBuff || isType, - result = skipIndexes ? baseTimes(value.length, String) : [], - length = result.length; - - for (var key in value) { - if ((inherited || hasOwnProperty.call(value, key)) && - !(skipIndexes && ( - // Safari 9 has enumerable `arguments.length` in strict mode. - key == 'length' || - // Node.js 0.10 has enumerable non-index properties on buffers. - (isBuff && (key == 'offset' || key == 'parent')) || - // PhantomJS 2 has enumerable non-index properties on typed arrays. - (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) || - // Skip index properties. - isIndex(key, length) - ))) { - result.push(key); - } - } - return result; -} - -module.exports = arrayLikeKeys; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_arrayMap.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_arrayMap.js deleted file mode 100644 index 22b22464..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_arrayMap.js +++ /dev/null @@ -1,21 +0,0 @@ -/** - * A specialized version of `_.map` for arrays without support for iteratee - * shorthands. - * - * @private - * @param {Array} [array] The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns the new mapped array. - */ -function arrayMap(array, iteratee) { - var index = -1, - length = array == null ? 0 : array.length, - result = Array(length); - - while (++index < length) { - result[index] = iteratee(array[index], index, array); - } - return result; -} - -module.exports = arrayMap; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_arrayPush.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_arrayPush.js deleted file mode 100644 index 7d742b38..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_arrayPush.js +++ /dev/null @@ -1,20 +0,0 @@ -/** - * Appends the elements of `values` to `array`. - * - * @private - * @param {Array} array The array to modify. - * @param {Array} values The values to append. - * @returns {Array} Returns `array`. - */ -function arrayPush(array, values) { - var index = -1, - length = values.length, - offset = array.length; - - while (++index < length) { - array[offset + index] = values[index]; - } - return array; -} - -module.exports = arrayPush; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_arrayReduce.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_arrayReduce.js deleted file mode 100644 index de8b79b2..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_arrayReduce.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * A specialized version of `_.reduce` for arrays without support for - * iteratee shorthands. - * - * @private - * @param {Array} [array] The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @param {*} [accumulator] The initial value. - * @param {boolean} [initAccum] Specify using the first element of `array` as - * the initial value. - * @returns {*} Returns the accumulated value. - */ -function arrayReduce(array, iteratee, accumulator, initAccum) { - var index = -1, - length = array == null ? 0 : array.length; - - if (initAccum && length) { - accumulator = array[++index]; - } - while (++index < length) { - accumulator = iteratee(accumulator, array[index], index, array); - } - return accumulator; -} - -module.exports = arrayReduce; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_arrayReduceRight.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_arrayReduceRight.js deleted file mode 100644 index 22d8976d..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_arrayReduceRight.js +++ /dev/null @@ -1,24 +0,0 @@ -/** - * A specialized version of `_.reduceRight` for arrays without support for - * iteratee shorthands. - * - * @private - * @param {Array} [array] The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @param {*} [accumulator] The initial value. - * @param {boolean} [initAccum] Specify using the last element of `array` as - * the initial value. - * @returns {*} Returns the accumulated value. - */ -function arrayReduceRight(array, iteratee, accumulator, initAccum) { - var length = array == null ? 0 : array.length; - if (initAccum && length) { - accumulator = array[--length]; - } - while (length--) { - accumulator = iteratee(accumulator, array[length], length, array); - } - return accumulator; -} - -module.exports = arrayReduceRight; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_arraySample.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_arraySample.js deleted file mode 100644 index fcab0105..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_arraySample.js +++ /dev/null @@ -1,15 +0,0 @@ -var baseRandom = require('./_baseRandom'); - -/** - * A specialized version of `_.sample` for arrays. - * - * @private - * @param {Array} array The array to sample. - * @returns {*} Returns the random element. - */ -function arraySample(array) { - var length = array.length; - return length ? array[baseRandom(0, length - 1)] : undefined; -} - -module.exports = arraySample; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_arraySampleSize.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_arraySampleSize.js deleted file mode 100644 index 8c7e364f..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_arraySampleSize.js +++ /dev/null @@ -1,17 +0,0 @@ -var baseClamp = require('./_baseClamp'), - copyArray = require('./_copyArray'), - shuffleSelf = require('./_shuffleSelf'); - -/** - * A specialized version of `_.sampleSize` for arrays. - * - * @private - * @param {Array} array The array to sample. - * @param {number} n The number of elements to sample. - * @returns {Array} Returns the random elements. - */ -function arraySampleSize(array, n) { - return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length)); -} - -module.exports = arraySampleSize; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_arrayShuffle.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_arrayShuffle.js deleted file mode 100644 index 46313a39..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_arrayShuffle.js +++ /dev/null @@ -1,15 +0,0 @@ -var copyArray = require('./_copyArray'), - shuffleSelf = require('./_shuffleSelf'); - -/** - * A specialized version of `_.shuffle` for arrays. - * - * @private - * @param {Array} array The array to shuffle. - * @returns {Array} Returns the new shuffled array. - */ -function arrayShuffle(array) { - return shuffleSelf(copyArray(array)); -} - -module.exports = arrayShuffle; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_arraySome.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_arraySome.js deleted file mode 100644 index 6fd02fd4..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_arraySome.js +++ /dev/null @@ -1,23 +0,0 @@ -/** - * A specialized version of `_.some` for arrays without support for iteratee - * shorthands. - * - * @private - * @param {Array} [array] The array to iterate over. - * @param {Function} predicate The function invoked per iteration. - * @returns {boolean} Returns `true` if any element passes the predicate check, - * else `false`. - */ -function arraySome(array, predicate) { - var index = -1, - length = array == null ? 0 : array.length; - - while (++index < length) { - if (predicate(array[index], index, array)) { - return true; - } - } - return false; -} - -module.exports = arraySome; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_asciiSize.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_asciiSize.js deleted file mode 100644 index 11d29c33..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_asciiSize.js +++ /dev/null @@ -1,12 +0,0 @@ -var baseProperty = require('./_baseProperty'); - -/** - * Gets the size of an ASCII `string`. - * - * @private - * @param {string} string The string inspect. - * @returns {number} Returns the string size. - */ -var asciiSize = baseProperty('length'); - -module.exports = asciiSize; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_asciiToArray.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_asciiToArray.js deleted file mode 100644 index 8e3dd5b4..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_asciiToArray.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * Converts an ASCII `string` to an array. - * - * @private - * @param {string} string The string to convert. - * @returns {Array} Returns the converted array. - */ -function asciiToArray(string) { - return string.split(''); -} - -module.exports = asciiToArray; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_asciiWords.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_asciiWords.js deleted file mode 100644 index d765f0f7..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_asciiWords.js +++ /dev/null @@ -1,15 +0,0 @@ -/** Used to match words composed of alphanumeric characters. */ -var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g; - -/** - * Splits an ASCII `string` into an array of its words. - * - * @private - * @param {string} The string to inspect. - * @returns {Array} Returns the words of `string`. - */ -function asciiWords(string) { - return string.match(reAsciiWord) || []; -} - -module.exports = asciiWords; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_assignMergeValue.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_assignMergeValue.js deleted file mode 100644 index cb1185e9..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_assignMergeValue.js +++ /dev/null @@ -1,20 +0,0 @@ -var baseAssignValue = require('./_baseAssignValue'), - eq = require('./eq'); - -/** - * This function is like `assignValue` except that it doesn't assign - * `undefined` values. - * - * @private - * @param {Object} object The object to modify. - * @param {string} key The key of the property to assign. - * @param {*} value The value to assign. - */ -function assignMergeValue(object, key, value) { - if ((value !== undefined && !eq(object[key], value)) || - (value === undefined && !(key in object))) { - baseAssignValue(object, key, value); - } -} - -module.exports = assignMergeValue; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_assignValue.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_assignValue.js deleted file mode 100644 index 40839575..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_assignValue.js +++ /dev/null @@ -1,28 +0,0 @@ -var baseAssignValue = require('./_baseAssignValue'), - eq = require('./eq'); - -/** Used for built-in method references. */ -var objectProto = Object.prototype; - -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; - -/** - * Assigns `value` to `key` of `object` if the existing value is not equivalent - * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) - * for equality comparisons. - * - * @private - * @param {Object} object The object to modify. - * @param {string} key The key of the property to assign. - * @param {*} value The value to assign. - */ -function assignValue(object, key, value) { - var objValue = object[key]; - if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || - (value === undefined && !(key in object))) { - baseAssignValue(object, key, value); - } -} - -module.exports = assignValue; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_assocIndexOf.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_assocIndexOf.js deleted file mode 100644 index 5b77a2bd..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_assocIndexOf.js +++ /dev/null @@ -1,21 +0,0 @@ -var eq = require('./eq'); - -/** - * Gets the index at which the `key` is found in `array` of key-value pairs. - * - * @private - * @param {Array} array The array to inspect. - * @param {*} key The key to search for. - * @returns {number} Returns the index of the matched value, else `-1`. - */ -function assocIndexOf(array, key) { - var length = array.length; - while (length--) { - if (eq(array[length][0], key)) { - return length; - } - } - return -1; -} - -module.exports = assocIndexOf; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseAggregator.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseAggregator.js deleted file mode 100644 index 4bc9e91f..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseAggregator.js +++ /dev/null @@ -1,21 +0,0 @@ -var baseEach = require('./_baseEach'); - -/** - * Aggregates elements of `collection` on `accumulator` with keys transformed - * by `iteratee` and values set by `setter`. - * - * @private - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} setter The function to set `accumulator` values. - * @param {Function} iteratee The iteratee to transform keys. - * @param {Object} accumulator The initial aggregated object. - * @returns {Function} Returns `accumulator`. - */ -function baseAggregator(collection, setter, iteratee, accumulator) { - baseEach(collection, function(value, key, collection) { - setter(accumulator, value, iteratee(value), collection); - }); - return accumulator; -} - -module.exports = baseAggregator; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseAssign.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseAssign.js deleted file mode 100644 index e5c4a1a5..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseAssign.js +++ /dev/null @@ -1,17 +0,0 @@ -var copyObject = require('./_copyObject'), - keys = require('./keys'); - -/** - * The base implementation of `_.assign` without support for multiple sources - * or `customizer` functions. - * - * @private - * @param {Object} object The destination object. - * @param {Object} source The source object. - * @returns {Object} Returns `object`. - */ -function baseAssign(object, source) { - return object && copyObject(source, keys(source), object); -} - -module.exports = baseAssign; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseAssignIn.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseAssignIn.js deleted file mode 100644 index 6624f900..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseAssignIn.js +++ /dev/null @@ -1,17 +0,0 @@ -var copyObject = require('./_copyObject'), - keysIn = require('./keysIn'); - -/** - * The base implementation of `_.assignIn` without support for multiple sources - * or `customizer` functions. - * - * @private - * @param {Object} object The destination object. - * @param {Object} source The source object. - * @returns {Object} Returns `object`. - */ -function baseAssignIn(object, source) { - return object && copyObject(source, keysIn(source), object); -} - -module.exports = baseAssignIn; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseAssignValue.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseAssignValue.js deleted file mode 100644 index d6f66ef3..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseAssignValue.js +++ /dev/null @@ -1,25 +0,0 @@ -var defineProperty = require('./_defineProperty'); - -/** - * The base implementation of `assignValue` and `assignMergeValue` without - * value checks. - * - * @private - * @param {Object} object The object to modify. - * @param {string} key The key of the property to assign. - * @param {*} value The value to assign. - */ -function baseAssignValue(object, key, value) { - if (key == '__proto__' && defineProperty) { - defineProperty(object, key, { - 'configurable': true, - 'enumerable': true, - 'value': value, - 'writable': true - }); - } else { - object[key] = value; - } -} - -module.exports = baseAssignValue; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseAt.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseAt.js deleted file mode 100644 index 90e4237a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseAt.js +++ /dev/null @@ -1,23 +0,0 @@ -var get = require('./get'); - -/** - * The base implementation of `_.at` without support for individual paths. - * - * @private - * @param {Object} object The object to iterate over. - * @param {string[]} paths The property paths to pick. - * @returns {Array} Returns the picked elements. - */ -function baseAt(object, paths) { - var index = -1, - length = paths.length, - result = Array(length), - skip = object == null; - - while (++index < length) { - result[index] = skip ? undefined : get(object, paths[index]); - } - return result; -} - -module.exports = baseAt; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseClamp.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseClamp.js deleted file mode 100644 index a1c56929..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseClamp.js +++ /dev/null @@ -1,22 +0,0 @@ -/** - * The base implementation of `_.clamp` which doesn't coerce arguments. - * - * @private - * @param {number} number The number to clamp. - * @param {number} [lower] The lower bound. - * @param {number} upper The upper bound. - * @returns {number} Returns the clamped number. - */ -function baseClamp(number, lower, upper) { - if (number === number) { - if (upper !== undefined) { - number = number <= upper ? number : upper; - } - if (lower !== undefined) { - number = number >= lower ? number : lower; - } - } - return number; -} - -module.exports = baseClamp; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseClone.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseClone.js deleted file mode 100644 index 69f87054..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseClone.js +++ /dev/null @@ -1,166 +0,0 @@ -var Stack = require('./_Stack'), - arrayEach = require('./_arrayEach'), - assignValue = require('./_assignValue'), - baseAssign = require('./_baseAssign'), - baseAssignIn = require('./_baseAssignIn'), - cloneBuffer = require('./_cloneBuffer'), - copyArray = require('./_copyArray'), - copySymbols = require('./_copySymbols'), - copySymbolsIn = require('./_copySymbolsIn'), - getAllKeys = require('./_getAllKeys'), - getAllKeysIn = require('./_getAllKeysIn'), - getTag = require('./_getTag'), - initCloneArray = require('./_initCloneArray'), - initCloneByTag = require('./_initCloneByTag'), - initCloneObject = require('./_initCloneObject'), - isArray = require('./isArray'), - isBuffer = require('./isBuffer'), - isMap = require('./isMap'), - isObject = require('./isObject'), - isSet = require('./isSet'), - keys = require('./keys'), - keysIn = require('./keysIn'); - -/** Used to compose bitmasks for cloning. */ -var CLONE_DEEP_FLAG = 1, - CLONE_FLAT_FLAG = 2, - CLONE_SYMBOLS_FLAG = 4; - -/** `Object#toString` result references. */ -var argsTag = '[object Arguments]', - arrayTag = '[object Array]', - boolTag = '[object Boolean]', - dateTag = '[object Date]', - errorTag = '[object Error]', - funcTag = '[object Function]', - genTag = '[object GeneratorFunction]', - mapTag = '[object Map]', - numberTag = '[object Number]', - objectTag = '[object Object]', - regexpTag = '[object RegExp]', - setTag = '[object Set]', - stringTag = '[object String]', - symbolTag = '[object Symbol]', - weakMapTag = '[object WeakMap]'; - -var arrayBufferTag = '[object ArrayBuffer]', - dataViewTag = '[object DataView]', - float32Tag = '[object Float32Array]', - float64Tag = '[object Float64Array]', - int8Tag = '[object Int8Array]', - int16Tag = '[object Int16Array]', - int32Tag = '[object Int32Array]', - uint8Tag = '[object Uint8Array]', - uint8ClampedTag = '[object Uint8ClampedArray]', - uint16Tag = '[object Uint16Array]', - uint32Tag = '[object Uint32Array]'; - -/** Used to identify `toStringTag` values supported by `_.clone`. */ -var cloneableTags = {}; -cloneableTags[argsTag] = cloneableTags[arrayTag] = -cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] = -cloneableTags[boolTag] = cloneableTags[dateTag] = -cloneableTags[float32Tag] = cloneableTags[float64Tag] = -cloneableTags[int8Tag] = cloneableTags[int16Tag] = -cloneableTags[int32Tag] = cloneableTags[mapTag] = -cloneableTags[numberTag] = cloneableTags[objectTag] = -cloneableTags[regexpTag] = cloneableTags[setTag] = -cloneableTags[stringTag] = cloneableTags[symbolTag] = -cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = -cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true; -cloneableTags[errorTag] = cloneableTags[funcTag] = -cloneableTags[weakMapTag] = false; - -/** - * The base implementation of `_.clone` and `_.cloneDeep` which tracks - * traversed objects. - * - * @private - * @param {*} value The value to clone. - * @param {boolean} bitmask The bitmask flags. - * 1 - Deep clone - * 2 - Flatten inherited properties - * 4 - Clone symbols - * @param {Function} [customizer] The function to customize cloning. - * @param {string} [key] The key of `value`. - * @param {Object} [object] The parent object of `value`. - * @param {Object} [stack] Tracks traversed objects and their clone counterparts. - * @returns {*} Returns the cloned value. - */ -function baseClone(value, bitmask, customizer, key, object, stack) { - var result, - isDeep = bitmask & CLONE_DEEP_FLAG, - isFlat = bitmask & CLONE_FLAT_FLAG, - isFull = bitmask & CLONE_SYMBOLS_FLAG; - - if (customizer) { - result = object ? customizer(value, key, object, stack) : customizer(value); - } - if (result !== undefined) { - return result; - } - if (!isObject(value)) { - return value; - } - var isArr = isArray(value); - if (isArr) { - result = initCloneArray(value); - if (!isDeep) { - return copyArray(value, result); - } - } else { - var tag = getTag(value), - isFunc = tag == funcTag || tag == genTag; - - if (isBuffer(value)) { - return cloneBuffer(value, isDeep); - } - if (tag == objectTag || tag == argsTag || (isFunc && !object)) { - result = (isFlat || isFunc) ? {} : initCloneObject(value); - if (!isDeep) { - return isFlat - ? copySymbolsIn(value, baseAssignIn(result, value)) - : copySymbols(value, baseAssign(result, value)); - } - } else { - if (!cloneableTags[tag]) { - return object ? value : {}; - } - result = initCloneByTag(value, tag, isDeep); - } - } - // Check for circular references and return its corresponding clone. - stack || (stack = new Stack); - var stacked = stack.get(value); - if (stacked) { - return stacked; - } - stack.set(value, result); - - if (isSet(value)) { - value.forEach(function(subValue) { - result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack)); - }); - } else if (isMap(value)) { - value.forEach(function(subValue, key) { - result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack)); - }); - } - - var keysFunc = isFull - ? (isFlat ? getAllKeysIn : getAllKeys) - : (isFlat ? keysIn : keys); - - var props = isArr ? undefined : keysFunc(value); - arrayEach(props || value, function(subValue, key) { - if (props) { - key = subValue; - subValue = value[key]; - } - // Recursively populate clone (susceptible to call stack limits). - assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack)); - }); - return result; -} - -module.exports = baseClone; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseConforms.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseConforms.js deleted file mode 100644 index 947e20d4..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseConforms.js +++ /dev/null @@ -1,18 +0,0 @@ -var baseConformsTo = require('./_baseConformsTo'), - keys = require('./keys'); - -/** - * The base implementation of `_.conforms` which doesn't clone `source`. - * - * @private - * @param {Object} source The object of property predicates to conform to. - * @returns {Function} Returns the new spec function. - */ -function baseConforms(source) { - var props = keys(source); - return function(object) { - return baseConformsTo(object, source, props); - }; -} - -module.exports = baseConforms; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseConformsTo.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseConformsTo.js deleted file mode 100644 index e449cb84..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseConformsTo.js +++ /dev/null @@ -1,27 +0,0 @@ -/** - * The base implementation of `_.conformsTo` which accepts `props` to check. - * - * @private - * @param {Object} object The object to inspect. - * @param {Object} source The object of property predicates to conform to. - * @returns {boolean} Returns `true` if `object` conforms, else `false`. - */ -function baseConformsTo(object, source, props) { - var length = props.length; - if (object == null) { - return !length; - } - object = Object(object); - while (length--) { - var key = props[length], - predicate = source[key], - value = object[key]; - - if ((value === undefined && !(key in object)) || !predicate(value)) { - return false; - } - } - return true; -} - -module.exports = baseConformsTo; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseCreate.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseCreate.js deleted file mode 100644 index ffa6a52a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseCreate.js +++ /dev/null @@ -1,30 +0,0 @@ -var isObject = require('./isObject'); - -/** Built-in value references. */ -var objectCreate = Object.create; - -/** - * The base implementation of `_.create` without support for assigning - * properties to the created object. - * - * @private - * @param {Object} proto The object to inherit from. - * @returns {Object} Returns the new object. - */ -var baseCreate = (function() { - function object() {} - return function(proto) { - if (!isObject(proto)) { - return {}; - } - if (objectCreate) { - return objectCreate(proto); - } - object.prototype = proto; - var result = new object; - object.prototype = undefined; - return result; - }; -}()); - -module.exports = baseCreate; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseDelay.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseDelay.js deleted file mode 100644 index 1486d697..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseDelay.js +++ /dev/null @@ -1,21 +0,0 @@ -/** Error message constants. */ -var FUNC_ERROR_TEXT = 'Expected a function'; - -/** - * The base implementation of `_.delay` and `_.defer` which accepts `args` - * to provide to `func`. - * - * @private - * @param {Function} func The function to delay. - * @param {number} wait The number of milliseconds to delay invocation. - * @param {Array} args The arguments to provide to `func`. - * @returns {number|Object} Returns the timer id or timeout object. - */ -function baseDelay(func, wait, args) { - if (typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - return setTimeout(function() { func.apply(undefined, args); }, wait); -} - -module.exports = baseDelay; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseDifference.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseDifference.js deleted file mode 100644 index 343ac19f..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseDifference.js +++ /dev/null @@ -1,67 +0,0 @@ -var SetCache = require('./_SetCache'), - arrayIncludes = require('./_arrayIncludes'), - arrayIncludesWith = require('./_arrayIncludesWith'), - arrayMap = require('./_arrayMap'), - baseUnary = require('./_baseUnary'), - cacheHas = require('./_cacheHas'); - -/** Used as the size to enable large array optimizations. */ -var LARGE_ARRAY_SIZE = 200; - -/** - * The base implementation of methods like `_.difference` without support - * for excluding multiple arrays or iteratee shorthands. - * - * @private - * @param {Array} array The array to inspect. - * @param {Array} values The values to exclude. - * @param {Function} [iteratee] The iteratee invoked per element. - * @param {Function} [comparator] The comparator invoked per element. - * @returns {Array} Returns the new array of filtered values. - */ -function baseDifference(array, values, iteratee, comparator) { - var index = -1, - includes = arrayIncludes, - isCommon = true, - length = array.length, - result = [], - valuesLength = values.length; - - if (!length) { - return result; - } - if (iteratee) { - values = arrayMap(values, baseUnary(iteratee)); - } - if (comparator) { - includes = arrayIncludesWith; - isCommon = false; - } - else if (values.length >= LARGE_ARRAY_SIZE) { - includes = cacheHas; - isCommon = false; - values = new SetCache(values); - } - outer: - while (++index < length) { - var value = array[index], - computed = iteratee == null ? value : iteratee(value); - - value = (comparator || value !== 0) ? value : 0; - if (isCommon && computed === computed) { - var valuesIndex = valuesLength; - while (valuesIndex--) { - if (values[valuesIndex] === computed) { - continue outer; - } - } - result.push(value); - } - else if (!includes(values, computed, comparator)) { - result.push(value); - } - } - return result; -} - -module.exports = baseDifference; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseEach.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseEach.js deleted file mode 100644 index 512c0676..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseEach.js +++ /dev/null @@ -1,14 +0,0 @@ -var baseForOwn = require('./_baseForOwn'), - createBaseEach = require('./_createBaseEach'); - -/** - * The base implementation of `_.forEach` without support for iteratee shorthands. - * - * @private - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array|Object} Returns `collection`. - */ -var baseEach = createBaseEach(baseForOwn); - -module.exports = baseEach; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseEachRight.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseEachRight.js deleted file mode 100644 index 0a8feeca..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseEachRight.js +++ /dev/null @@ -1,14 +0,0 @@ -var baseForOwnRight = require('./_baseForOwnRight'), - createBaseEach = require('./_createBaseEach'); - -/** - * The base implementation of `_.forEachRight` without support for iteratee shorthands. - * - * @private - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array|Object} Returns `collection`. - */ -var baseEachRight = createBaseEach(baseForOwnRight, true); - -module.exports = baseEachRight; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseEvery.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseEvery.js deleted file mode 100644 index fa52f7bc..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseEvery.js +++ /dev/null @@ -1,21 +0,0 @@ -var baseEach = require('./_baseEach'); - -/** - * The base implementation of `_.every` without support for iteratee shorthands. - * - * @private - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} predicate The function invoked per iteration. - * @returns {boolean} Returns `true` if all elements pass the predicate check, - * else `false` - */ -function baseEvery(collection, predicate) { - var result = true; - baseEach(collection, function(value, index, collection) { - result = !!predicate(value, index, collection); - return result; - }); - return result; -} - -module.exports = baseEvery; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseExtremum.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseExtremum.js deleted file mode 100644 index 9d6aa77e..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseExtremum.js +++ /dev/null @@ -1,32 +0,0 @@ -var isSymbol = require('./isSymbol'); - -/** - * The base implementation of methods like `_.max` and `_.min` which accepts a - * `comparator` to determine the extremum value. - * - * @private - * @param {Array} array The array to iterate over. - * @param {Function} iteratee The iteratee invoked per iteration. - * @param {Function} comparator The comparator used to compare values. - * @returns {*} Returns the extremum value. - */ -function baseExtremum(array, iteratee, comparator) { - var index = -1, - length = array.length; - - while (++index < length) { - var value = array[index], - current = iteratee(value); - - if (current != null && (computed === undefined - ? (current === current && !isSymbol(current)) - : comparator(current, computed) - )) { - var computed = current, - result = value; - } - } - return result; -} - -module.exports = baseExtremum; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseFill.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseFill.js deleted file mode 100644 index 46ef9c76..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseFill.js +++ /dev/null @@ -1,32 +0,0 @@ -var toInteger = require('./toInteger'), - toLength = require('./toLength'); - -/** - * The base implementation of `_.fill` without an iteratee call guard. - * - * @private - * @param {Array} array The array to fill. - * @param {*} value The value to fill `array` with. - * @param {number} [start=0] The start position. - * @param {number} [end=array.length] The end position. - * @returns {Array} Returns `array`. - */ -function baseFill(array, value, start, end) { - var length = array.length; - - start = toInteger(start); - if (start < 0) { - start = -start > length ? 0 : (length + start); - } - end = (end === undefined || end > length) ? length : toInteger(end); - if (end < 0) { - end += length; - } - end = start > end ? 0 : toLength(end); - while (start < end) { - array[start++] = value; - } - return array; -} - -module.exports = baseFill; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseFilter.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseFilter.js deleted file mode 100644 index 46784773..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseFilter.js +++ /dev/null @@ -1,21 +0,0 @@ -var baseEach = require('./_baseEach'); - -/** - * The base implementation of `_.filter` without support for iteratee shorthands. - * - * @private - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} predicate The function invoked per iteration. - * @returns {Array} Returns the new filtered array. - */ -function baseFilter(collection, predicate) { - var result = []; - baseEach(collection, function(value, index, collection) { - if (predicate(value, index, collection)) { - result.push(value); - } - }); - return result; -} - -module.exports = baseFilter; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseFindIndex.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseFindIndex.js deleted file mode 100644 index e3f5d8aa..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseFindIndex.js +++ /dev/null @@ -1,24 +0,0 @@ -/** - * The base implementation of `_.findIndex` and `_.findLastIndex` without - * support for iteratee shorthands. - * - * @private - * @param {Array} array The array to inspect. - * @param {Function} predicate The function invoked per iteration. - * @param {number} fromIndex The index to search from. - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {number} Returns the index of the matched value, else `-1`. - */ -function baseFindIndex(array, predicate, fromIndex, fromRight) { - var length = array.length, - index = fromIndex + (fromRight ? 1 : -1); - - while ((fromRight ? index-- : ++index < length)) { - if (predicate(array[index], index, array)) { - return index; - } - } - return -1; -} - -module.exports = baseFindIndex; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseFindKey.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseFindKey.js deleted file mode 100644 index 2e430f3a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseFindKey.js +++ /dev/null @@ -1,23 +0,0 @@ -/** - * The base implementation of methods like `_.findKey` and `_.findLastKey`, - * without support for iteratee shorthands, which iterates over `collection` - * using `eachFunc`. - * - * @private - * @param {Array|Object} collection The collection to inspect. - * @param {Function} predicate The function invoked per iteration. - * @param {Function} eachFunc The function to iterate over `collection`. - * @returns {*} Returns the found element or its key, else `undefined`. - */ -function baseFindKey(collection, predicate, eachFunc) { - var result; - eachFunc(collection, function(value, key, collection) { - if (predicate(value, key, collection)) { - result = key; - return false; - } - }); - return result; -} - -module.exports = baseFindKey; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseFlatten.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseFlatten.js deleted file mode 100644 index 4b1e009b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseFlatten.js +++ /dev/null @@ -1,38 +0,0 @@ -var arrayPush = require('./_arrayPush'), - isFlattenable = require('./_isFlattenable'); - -/** - * The base implementation of `_.flatten` with support for restricting flattening. - * - * @private - * @param {Array} array The array to flatten. - * @param {number} depth The maximum recursion depth. - * @param {boolean} [predicate=isFlattenable] The function invoked per iteration. - * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks. - * @param {Array} [result=[]] The initial result value. - * @returns {Array} Returns the new flattened array. - */ -function baseFlatten(array, depth, predicate, isStrict, result) { - var index = -1, - length = array.length; - - predicate || (predicate = isFlattenable); - result || (result = []); - - while (++index < length) { - var value = array[index]; - if (depth > 0 && predicate(value)) { - if (depth > 1) { - // Recursively flatten arrays (susceptible to call stack limits). - baseFlatten(value, depth - 1, predicate, isStrict, result); - } else { - arrayPush(result, value); - } - } else if (!isStrict) { - result[result.length] = value; - } - } - return result; -} - -module.exports = baseFlatten; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseFor.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseFor.js deleted file mode 100644 index d946590f..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseFor.js +++ /dev/null @@ -1,16 +0,0 @@ -var createBaseFor = require('./_createBaseFor'); - -/** - * The base implementation of `baseForOwn` which iterates over `object` - * properties returned by `keysFunc` and invokes `iteratee` for each property. - * Iteratee functions may exit iteration early by explicitly returning `false`. - * - * @private - * @param {Object} object The object to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @param {Function} keysFunc The function to get the keys of `object`. - * @returns {Object} Returns `object`. - */ -var baseFor = createBaseFor(); - -module.exports = baseFor; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseForOwn.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseForOwn.js deleted file mode 100644 index 503d5234..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseForOwn.js +++ /dev/null @@ -1,16 +0,0 @@ -var baseFor = require('./_baseFor'), - keys = require('./keys'); - -/** - * The base implementation of `_.forOwn` without support for iteratee shorthands. - * - * @private - * @param {Object} object The object to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Object} Returns `object`. - */ -function baseForOwn(object, iteratee) { - return object && baseFor(object, iteratee, keys); -} - -module.exports = baseForOwn; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseForOwnRight.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseForOwnRight.js deleted file mode 100644 index a4b10e6c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseForOwnRight.js +++ /dev/null @@ -1,16 +0,0 @@ -var baseForRight = require('./_baseForRight'), - keys = require('./keys'); - -/** - * The base implementation of `_.forOwnRight` without support for iteratee shorthands. - * - * @private - * @param {Object} object The object to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Object} Returns `object`. - */ -function baseForOwnRight(object, iteratee) { - return object && baseForRight(object, iteratee, keys); -} - -module.exports = baseForOwnRight; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseForRight.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseForRight.js deleted file mode 100644 index 32842cd8..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseForRight.js +++ /dev/null @@ -1,15 +0,0 @@ -var createBaseFor = require('./_createBaseFor'); - -/** - * This function is like `baseFor` except that it iterates over properties - * in the opposite order. - * - * @private - * @param {Object} object The object to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @param {Function} keysFunc The function to get the keys of `object`. - * @returns {Object} Returns `object`. - */ -var baseForRight = createBaseFor(true); - -module.exports = baseForRight; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseFunctions.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseFunctions.js deleted file mode 100644 index d23bc9b4..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseFunctions.js +++ /dev/null @@ -1,19 +0,0 @@ -var arrayFilter = require('./_arrayFilter'), - isFunction = require('./isFunction'); - -/** - * The base implementation of `_.functions` which creates an array of - * `object` function property names filtered from `props`. - * - * @private - * @param {Object} object The object to inspect. - * @param {Array} props The property names to filter. - * @returns {Array} Returns the function names. - */ -function baseFunctions(object, props) { - return arrayFilter(props, function(key) { - return isFunction(object[key]); - }); -} - -module.exports = baseFunctions; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseGet.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseGet.js deleted file mode 100644 index a194913d..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseGet.js +++ /dev/null @@ -1,24 +0,0 @@ -var castPath = require('./_castPath'), - toKey = require('./_toKey'); - -/** - * The base implementation of `_.get` without support for default values. - * - * @private - * @param {Object} object The object to query. - * @param {Array|string} path The path of the property to get. - * @returns {*} Returns the resolved value. - */ -function baseGet(object, path) { - path = castPath(path, object); - - var index = 0, - length = path.length; - - while (object != null && index < length) { - object = object[toKey(path[index++])]; - } - return (index && index == length) ? object : undefined; -} - -module.exports = baseGet; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseGetAllKeys.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseGetAllKeys.js deleted file mode 100644 index 8ad204ea..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseGetAllKeys.js +++ /dev/null @@ -1,20 +0,0 @@ -var arrayPush = require('./_arrayPush'), - isArray = require('./isArray'); - -/** - * The base implementation of `getAllKeys` and `getAllKeysIn` which uses - * `keysFunc` and `symbolsFunc` to get the enumerable property names and - * symbols of `object`. - * - * @private - * @param {Object} object The object to query. - * @param {Function} keysFunc The function to get the keys of `object`. - * @param {Function} symbolsFunc The function to get the symbols of `object`. - * @returns {Array} Returns the array of property names and symbols. - */ -function baseGetAllKeys(object, keysFunc, symbolsFunc) { - var result = keysFunc(object); - return isArray(object) ? result : arrayPush(result, symbolsFunc(object)); -} - -module.exports = baseGetAllKeys; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseGetTag.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseGetTag.js deleted file mode 100644 index b927ccc1..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseGetTag.js +++ /dev/null @@ -1,28 +0,0 @@ -var Symbol = require('./_Symbol'), - getRawTag = require('./_getRawTag'), - objectToString = require('./_objectToString'); - -/** `Object#toString` result references. */ -var nullTag = '[object Null]', - undefinedTag = '[object Undefined]'; - -/** Built-in value references. */ -var symToStringTag = Symbol ? Symbol.toStringTag : undefined; - -/** - * The base implementation of `getTag` without fallbacks for buggy environments. - * - * @private - * @param {*} value The value to query. - * @returns {string} Returns the `toStringTag`. - */ -function baseGetTag(value) { - if (value == null) { - return value === undefined ? undefinedTag : nullTag; - } - return (symToStringTag && symToStringTag in Object(value)) - ? getRawTag(value) - : objectToString(value); -} - -module.exports = baseGetTag; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseGt.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseGt.js deleted file mode 100644 index 502d273c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseGt.js +++ /dev/null @@ -1,14 +0,0 @@ -/** - * The base implementation of `_.gt` which doesn't coerce arguments. - * - * @private - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if `value` is greater than `other`, - * else `false`. - */ -function baseGt(value, other) { - return value > other; -} - -module.exports = baseGt; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseHas.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseHas.js deleted file mode 100644 index 1b730321..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseHas.js +++ /dev/null @@ -1,19 +0,0 @@ -/** Used for built-in method references. */ -var objectProto = Object.prototype; - -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; - -/** - * The base implementation of `_.has` without support for deep paths. - * - * @private - * @param {Object} [object] The object to query. - * @param {Array|string} key The key to check. - * @returns {boolean} Returns `true` if `key` exists, else `false`. - */ -function baseHas(object, key) { - return object != null && hasOwnProperty.call(object, key); -} - -module.exports = baseHas; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseHasIn.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseHasIn.js deleted file mode 100644 index 2e0d0426..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseHasIn.js +++ /dev/null @@ -1,13 +0,0 @@ -/** - * The base implementation of `_.hasIn` without support for deep paths. - * - * @private - * @param {Object} [object] The object to query. - * @param {Array|string} key The key to check. - * @returns {boolean} Returns `true` if `key` exists, else `false`. - */ -function baseHasIn(object, key) { - return object != null && key in Object(object); -} - -module.exports = baseHasIn; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseInRange.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseInRange.js deleted file mode 100644 index ec956661..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseInRange.js +++ /dev/null @@ -1,18 +0,0 @@ -/* Built-in method references for those with the same name as other `lodash` methods. */ -var nativeMax = Math.max, - nativeMin = Math.min; - -/** - * The base implementation of `_.inRange` which doesn't coerce arguments. - * - * @private - * @param {number} number The number to check. - * @param {number} start The start of the range. - * @param {number} end The end of the range. - * @returns {boolean} Returns `true` if `number` is in the range, else `false`. - */ -function baseInRange(number, start, end) { - return number >= nativeMin(start, end) && number < nativeMax(start, end); -} - -module.exports = baseInRange; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseIndexOf.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseIndexOf.js deleted file mode 100644 index 167e706e..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseIndexOf.js +++ /dev/null @@ -1,20 +0,0 @@ -var baseFindIndex = require('./_baseFindIndex'), - baseIsNaN = require('./_baseIsNaN'), - strictIndexOf = require('./_strictIndexOf'); - -/** - * The base implementation of `_.indexOf` without `fromIndex` bounds checks. - * - * @private - * @param {Array} array The array to inspect. - * @param {*} value The value to search for. - * @param {number} fromIndex The index to search from. - * @returns {number} Returns the index of the matched value, else `-1`. - */ -function baseIndexOf(array, value, fromIndex) { - return value === value - ? strictIndexOf(array, value, fromIndex) - : baseFindIndex(array, baseIsNaN, fromIndex); -} - -module.exports = baseIndexOf; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseIndexOfWith.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseIndexOfWith.js deleted file mode 100644 index f815fe0d..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseIndexOfWith.js +++ /dev/null @@ -1,23 +0,0 @@ -/** - * This function is like `baseIndexOf` except that it accepts a comparator. - * - * @private - * @param {Array} array The array to inspect. - * @param {*} value The value to search for. - * @param {number} fromIndex The index to search from. - * @param {Function} comparator The comparator invoked per element. - * @returns {number} Returns the index of the matched value, else `-1`. - */ -function baseIndexOfWith(array, value, fromIndex, comparator) { - var index = fromIndex - 1, - length = array.length; - - while (++index < length) { - if (comparator(array[index], value)) { - return index; - } - } - return -1; -} - -module.exports = baseIndexOfWith; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseIntersection.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseIntersection.js deleted file mode 100644 index c1d250c2..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseIntersection.js +++ /dev/null @@ -1,74 +0,0 @@ -var SetCache = require('./_SetCache'), - arrayIncludes = require('./_arrayIncludes'), - arrayIncludesWith = require('./_arrayIncludesWith'), - arrayMap = require('./_arrayMap'), - baseUnary = require('./_baseUnary'), - cacheHas = require('./_cacheHas'); - -/* Built-in method references for those with the same name as other `lodash` methods. */ -var nativeMin = Math.min; - -/** - * The base implementation of methods like `_.intersection`, without support - * for iteratee shorthands, that accepts an array of arrays to inspect. - * - * @private - * @param {Array} arrays The arrays to inspect. - * @param {Function} [iteratee] The iteratee invoked per element. - * @param {Function} [comparator] The comparator invoked per element. - * @returns {Array} Returns the new array of shared values. - */ -function baseIntersection(arrays, iteratee, comparator) { - var includes = comparator ? arrayIncludesWith : arrayIncludes, - length = arrays[0].length, - othLength = arrays.length, - othIndex = othLength, - caches = Array(othLength), - maxLength = Infinity, - result = []; - - while (othIndex--) { - var array = arrays[othIndex]; - if (othIndex && iteratee) { - array = arrayMap(array, baseUnary(iteratee)); - } - maxLength = nativeMin(array.length, maxLength); - caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120)) - ? new SetCache(othIndex && array) - : undefined; - } - array = arrays[0]; - - var index = -1, - seen = caches[0]; - - outer: - while (++index < length && result.length < maxLength) { - var value = array[index], - computed = iteratee ? iteratee(value) : value; - - value = (comparator || value !== 0) ? value : 0; - if (!(seen - ? cacheHas(seen, computed) - : includes(result, computed, comparator) - )) { - othIndex = othLength; - while (--othIndex) { - var cache = caches[othIndex]; - if (!(cache - ? cacheHas(cache, computed) - : includes(arrays[othIndex], computed, comparator)) - ) { - continue outer; - } - } - if (seen) { - seen.push(computed); - } - result.push(value); - } - } - return result; -} - -module.exports = baseIntersection; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseInverter.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseInverter.js deleted file mode 100644 index fbc337f0..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseInverter.js +++ /dev/null @@ -1,21 +0,0 @@ -var baseForOwn = require('./_baseForOwn'); - -/** - * The base implementation of `_.invert` and `_.invertBy` which inverts - * `object` with values transformed by `iteratee` and set by `setter`. - * - * @private - * @param {Object} object The object to iterate over. - * @param {Function} setter The function to set `accumulator` values. - * @param {Function} iteratee The iteratee to transform values. - * @param {Object} accumulator The initial inverted object. - * @returns {Function} Returns `accumulator`. - */ -function baseInverter(object, setter, iteratee, accumulator) { - baseForOwn(object, function(value, key, object) { - setter(accumulator, iteratee(value), key, object); - }); - return accumulator; -} - -module.exports = baseInverter; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseInvoke.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseInvoke.js deleted file mode 100644 index 49bcf3c3..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseInvoke.js +++ /dev/null @@ -1,24 +0,0 @@ -var apply = require('./_apply'), - castPath = require('./_castPath'), - last = require('./last'), - parent = require('./_parent'), - toKey = require('./_toKey'); - -/** - * The base implementation of `_.invoke` without support for individual - * method arguments. - * - * @private - * @param {Object} object The object to query. - * @param {Array|string} path The path of the method to invoke. - * @param {Array} args The arguments to invoke the method with. - * @returns {*} Returns the result of the invoked method. - */ -function baseInvoke(object, path, args) { - path = castPath(path, object); - object = parent(object, path); - var func = object == null ? object : object[toKey(last(path))]; - return func == null ? undefined : apply(func, object, args); -} - -module.exports = baseInvoke; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseIsArguments.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseIsArguments.js deleted file mode 100644 index b3562cca..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseIsArguments.js +++ /dev/null @@ -1,18 +0,0 @@ -var baseGetTag = require('./_baseGetTag'), - isObjectLike = require('./isObjectLike'); - -/** `Object#toString` result references. */ -var argsTag = '[object Arguments]'; - -/** - * The base implementation of `_.isArguments`. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an `arguments` object, - */ -function baseIsArguments(value) { - return isObjectLike(value) && baseGetTag(value) == argsTag; -} - -module.exports = baseIsArguments; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseIsArrayBuffer.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseIsArrayBuffer.js deleted file mode 100644 index a2c4f30a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseIsArrayBuffer.js +++ /dev/null @@ -1,17 +0,0 @@ -var baseGetTag = require('./_baseGetTag'), - isObjectLike = require('./isObjectLike'); - -var arrayBufferTag = '[object ArrayBuffer]'; - -/** - * The base implementation of `_.isArrayBuffer` without Node.js optimizations. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`. - */ -function baseIsArrayBuffer(value) { - return isObjectLike(value) && baseGetTag(value) == arrayBufferTag; -} - -module.exports = baseIsArrayBuffer; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseIsDate.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseIsDate.js deleted file mode 100644 index ba67c785..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseIsDate.js +++ /dev/null @@ -1,18 +0,0 @@ -var baseGetTag = require('./_baseGetTag'), - isObjectLike = require('./isObjectLike'); - -/** `Object#toString` result references. */ -var dateTag = '[object Date]'; - -/** - * The base implementation of `_.isDate` without Node.js optimizations. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a date object, else `false`. - */ -function baseIsDate(value) { - return isObjectLike(value) && baseGetTag(value) == dateTag; -} - -module.exports = baseIsDate; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseIsEqual.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseIsEqual.js deleted file mode 100644 index 00a68a4f..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseIsEqual.js +++ /dev/null @@ -1,28 +0,0 @@ -var baseIsEqualDeep = require('./_baseIsEqualDeep'), - isObjectLike = require('./isObjectLike'); - -/** - * The base implementation of `_.isEqual` which supports partial comparisons - * and tracks traversed objects. - * - * @private - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @param {boolean} bitmask The bitmask flags. - * 1 - Unordered comparison - * 2 - Partial comparison - * @param {Function} [customizer] The function to customize comparisons. - * @param {Object} [stack] Tracks traversed `value` and `other` objects. - * @returns {boolean} Returns `true` if the values are equivalent, else `false`. - */ -function baseIsEqual(value, other, bitmask, customizer, stack) { - if (value === other) { - return true; - } - if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) { - return value !== value && other !== other; - } - return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack); -} - -module.exports = baseIsEqual; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseIsEqualDeep.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseIsEqualDeep.js deleted file mode 100644 index e3cfd6a8..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseIsEqualDeep.js +++ /dev/null @@ -1,83 +0,0 @@ -var Stack = require('./_Stack'), - equalArrays = require('./_equalArrays'), - equalByTag = require('./_equalByTag'), - equalObjects = require('./_equalObjects'), - getTag = require('./_getTag'), - isArray = require('./isArray'), - isBuffer = require('./isBuffer'), - isTypedArray = require('./isTypedArray'); - -/** Used to compose bitmasks for value comparisons. */ -var COMPARE_PARTIAL_FLAG = 1; - -/** `Object#toString` result references. */ -var argsTag = '[object Arguments]', - arrayTag = '[object Array]', - objectTag = '[object Object]'; - -/** Used for built-in method references. */ -var objectProto = Object.prototype; - -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; - -/** - * A specialized version of `baseIsEqual` for arrays and objects which performs - * deep comparisons and tracks traversed objects enabling objects with circular - * references to be compared. - * - * @private - * @param {Object} object The object to compare. - * @param {Object} other The other object to compare. - * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. - * @param {Function} customizer The function to customize comparisons. - * @param {Function} equalFunc The function to determine equivalents of values. - * @param {Object} [stack] Tracks traversed `object` and `other` objects. - * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. - */ -function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) { - var objIsArr = isArray(object), - othIsArr = isArray(other), - objTag = objIsArr ? arrayTag : getTag(object), - othTag = othIsArr ? arrayTag : getTag(other); - - objTag = objTag == argsTag ? objectTag : objTag; - othTag = othTag == argsTag ? objectTag : othTag; - - var objIsObj = objTag == objectTag, - othIsObj = othTag == objectTag, - isSameTag = objTag == othTag; - - if (isSameTag && isBuffer(object)) { - if (!isBuffer(other)) { - return false; - } - objIsArr = true; - objIsObj = false; - } - if (isSameTag && !objIsObj) { - stack || (stack = new Stack); - return (objIsArr || isTypedArray(object)) - ? equalArrays(object, other, bitmask, customizer, equalFunc, stack) - : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack); - } - if (!(bitmask & COMPARE_PARTIAL_FLAG)) { - var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'), - othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__'); - - if (objIsWrapped || othIsWrapped) { - var objUnwrapped = objIsWrapped ? object.value() : object, - othUnwrapped = othIsWrapped ? other.value() : other; - - stack || (stack = new Stack); - return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack); - } - } - if (!isSameTag) { - return false; - } - stack || (stack = new Stack); - return equalObjects(object, other, bitmask, customizer, equalFunc, stack); -} - -module.exports = baseIsEqualDeep; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseIsMap.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseIsMap.js deleted file mode 100644 index 02a4021c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseIsMap.js +++ /dev/null @@ -1,18 +0,0 @@ -var getTag = require('./_getTag'), - isObjectLike = require('./isObjectLike'); - -/** `Object#toString` result references. */ -var mapTag = '[object Map]'; - -/** - * The base implementation of `_.isMap` without Node.js optimizations. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a map, else `false`. - */ -function baseIsMap(value) { - return isObjectLike(value) && getTag(value) == mapTag; -} - -module.exports = baseIsMap; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseIsMatch.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseIsMatch.js deleted file mode 100644 index 72494bed..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseIsMatch.js +++ /dev/null @@ -1,62 +0,0 @@ -var Stack = require('./_Stack'), - baseIsEqual = require('./_baseIsEqual'); - -/** Used to compose bitmasks for value comparisons. */ -var COMPARE_PARTIAL_FLAG = 1, - COMPARE_UNORDERED_FLAG = 2; - -/** - * The base implementation of `_.isMatch` without support for iteratee shorthands. - * - * @private - * @param {Object} object The object to inspect. - * @param {Object} source The object of property values to match. - * @param {Array} matchData The property names, values, and compare flags to match. - * @param {Function} [customizer] The function to customize comparisons. - * @returns {boolean} Returns `true` if `object` is a match, else `false`. - */ -function baseIsMatch(object, source, matchData, customizer) { - var index = matchData.length, - length = index, - noCustomizer = !customizer; - - if (object == null) { - return !length; - } - object = Object(object); - while (index--) { - var data = matchData[index]; - if ((noCustomizer && data[2]) - ? data[1] !== object[data[0]] - : !(data[0] in object) - ) { - return false; - } - } - while (++index < length) { - data = matchData[index]; - var key = data[0], - objValue = object[key], - srcValue = data[1]; - - if (noCustomizer && data[2]) { - if (objValue === undefined && !(key in object)) { - return false; - } - } else { - var stack = new Stack; - if (customizer) { - var result = customizer(objValue, srcValue, key, object, source, stack); - } - if (!(result === undefined - ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack) - : result - )) { - return false; - } - } - } - return true; -} - -module.exports = baseIsMatch; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseIsNaN.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseIsNaN.js deleted file mode 100644 index 316f1eb1..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseIsNaN.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * The base implementation of `_.isNaN` without support for number objects. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. - */ -function baseIsNaN(value) { - return value !== value; -} - -module.exports = baseIsNaN; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseIsNative.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseIsNative.js deleted file mode 100644 index 87023304..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseIsNative.js +++ /dev/null @@ -1,47 +0,0 @@ -var isFunction = require('./isFunction'), - isMasked = require('./_isMasked'), - isObject = require('./isObject'), - toSource = require('./_toSource'); - -/** - * Used to match `RegExp` - * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). - */ -var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; - -/** Used to detect host constructors (Safari). */ -var reIsHostCtor = /^\[object .+?Constructor\]$/; - -/** Used for built-in method references. */ -var funcProto = Function.prototype, - objectProto = Object.prototype; - -/** Used to resolve the decompiled source of functions. */ -var funcToString = funcProto.toString; - -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; - -/** Used to detect if a method is native. */ -var reIsNative = RegExp('^' + - funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') - .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' -); - -/** - * The base implementation of `_.isNative` without bad shim checks. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a native function, - * else `false`. - */ -function baseIsNative(value) { - if (!isObject(value) || isMasked(value)) { - return false; - } - var pattern = isFunction(value) ? reIsNative : reIsHostCtor; - return pattern.test(toSource(value)); -} - -module.exports = baseIsNative; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseIsRegExp.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseIsRegExp.js deleted file mode 100644 index 6cd7c1ae..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseIsRegExp.js +++ /dev/null @@ -1,18 +0,0 @@ -var baseGetTag = require('./_baseGetTag'), - isObjectLike = require('./isObjectLike'); - -/** `Object#toString` result references. */ -var regexpTag = '[object RegExp]'; - -/** - * The base implementation of `_.isRegExp` without Node.js optimizations. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a regexp, else `false`. - */ -function baseIsRegExp(value) { - return isObjectLike(value) && baseGetTag(value) == regexpTag; -} - -module.exports = baseIsRegExp; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseIsSet.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseIsSet.js deleted file mode 100644 index 6dee3671..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseIsSet.js +++ /dev/null @@ -1,18 +0,0 @@ -var getTag = require('./_getTag'), - isObjectLike = require('./isObjectLike'); - -/** `Object#toString` result references. */ -var setTag = '[object Set]'; - -/** - * The base implementation of `_.isSet` without Node.js optimizations. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a set, else `false`. - */ -function baseIsSet(value) { - return isObjectLike(value) && getTag(value) == setTag; -} - -module.exports = baseIsSet; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseIsTypedArray.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseIsTypedArray.js deleted file mode 100644 index 1edb32ff..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseIsTypedArray.js +++ /dev/null @@ -1,60 +0,0 @@ -var baseGetTag = require('./_baseGetTag'), - isLength = require('./isLength'), - isObjectLike = require('./isObjectLike'); - -/** `Object#toString` result references. */ -var argsTag = '[object Arguments]', - arrayTag = '[object Array]', - boolTag = '[object Boolean]', - dateTag = '[object Date]', - errorTag = '[object Error]', - funcTag = '[object Function]', - mapTag = '[object Map]', - numberTag = '[object Number]', - objectTag = '[object Object]', - regexpTag = '[object RegExp]', - setTag = '[object Set]', - stringTag = '[object String]', - weakMapTag = '[object WeakMap]'; - -var arrayBufferTag = '[object ArrayBuffer]', - dataViewTag = '[object DataView]', - float32Tag = '[object Float32Array]', - float64Tag = '[object Float64Array]', - int8Tag = '[object Int8Array]', - int16Tag = '[object Int16Array]', - int32Tag = '[object Int32Array]', - uint8Tag = '[object Uint8Array]', - uint8ClampedTag = '[object Uint8ClampedArray]', - uint16Tag = '[object Uint16Array]', - uint32Tag = '[object Uint32Array]'; - -/** Used to identify `toStringTag` values of typed arrays. */ -var typedArrayTags = {}; -typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = -typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = -typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = -typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = -typedArrayTags[uint32Tag] = true; -typedArrayTags[argsTag] = typedArrayTags[arrayTag] = -typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = -typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = -typedArrayTags[errorTag] = typedArrayTags[funcTag] = -typedArrayTags[mapTag] = typedArrayTags[numberTag] = -typedArrayTags[objectTag] = typedArrayTags[regexpTag] = -typedArrayTags[setTag] = typedArrayTags[stringTag] = -typedArrayTags[weakMapTag] = false; - -/** - * The base implementation of `_.isTypedArray` without Node.js optimizations. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. - */ -function baseIsTypedArray(value) { - return isObjectLike(value) && - isLength(value.length) && !!typedArrayTags[baseGetTag(value)]; -} - -module.exports = baseIsTypedArray; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseIteratee.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseIteratee.js deleted file mode 100644 index 995c2575..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseIteratee.js +++ /dev/null @@ -1,31 +0,0 @@ -var baseMatches = require('./_baseMatches'), - baseMatchesProperty = require('./_baseMatchesProperty'), - identity = require('./identity'), - isArray = require('./isArray'), - property = require('./property'); - -/** - * The base implementation of `_.iteratee`. - * - * @private - * @param {*} [value=_.identity] The value to convert to an iteratee. - * @returns {Function} Returns the iteratee. - */ -function baseIteratee(value) { - // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9. - // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details. - if (typeof value == 'function') { - return value; - } - if (value == null) { - return identity; - } - if (typeof value == 'object') { - return isArray(value) - ? baseMatchesProperty(value[0], value[1]) - : baseMatches(value); - } - return property(value); -} - -module.exports = baseIteratee; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseKeys.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseKeys.js deleted file mode 100644 index 45e9e6f3..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseKeys.js +++ /dev/null @@ -1,30 +0,0 @@ -var isPrototype = require('./_isPrototype'), - nativeKeys = require('./_nativeKeys'); - -/** Used for built-in method references. */ -var objectProto = Object.prototype; - -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; - -/** - * The base implementation of `_.keys` which doesn't treat sparse arrays as dense. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. - */ -function baseKeys(object) { - if (!isPrototype(object)) { - return nativeKeys(object); - } - var result = []; - for (var key in Object(object)) { - if (hasOwnProperty.call(object, key) && key != 'constructor') { - result.push(key); - } - } - return result; -} - -module.exports = baseKeys; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseKeysIn.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseKeysIn.js deleted file mode 100644 index ea8a0a17..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseKeysIn.js +++ /dev/null @@ -1,33 +0,0 @@ -var isObject = require('./isObject'), - isPrototype = require('./_isPrototype'), - nativeKeysIn = require('./_nativeKeysIn'); - -/** Used for built-in method references. */ -var objectProto = Object.prototype; - -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; - -/** - * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. - */ -function baseKeysIn(object) { - if (!isObject(object)) { - return nativeKeysIn(object); - } - var isProto = isPrototype(object), - result = []; - - for (var key in object) { - if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) { - result.push(key); - } - } - return result; -} - -module.exports = baseKeysIn; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseLodash.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseLodash.js deleted file mode 100644 index f76c790e..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseLodash.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * The function whose prototype chain sequence wrappers inherit from. - * - * @private - */ -function baseLodash() { - // No operation performed. -} - -module.exports = baseLodash; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseLt.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseLt.js deleted file mode 100644 index 8674d294..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseLt.js +++ /dev/null @@ -1,14 +0,0 @@ -/** - * The base implementation of `_.lt` which doesn't coerce arguments. - * - * @private - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if `value` is less than `other`, - * else `false`. - */ -function baseLt(value, other) { - return value < other; -} - -module.exports = baseLt; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseMap.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseMap.js deleted file mode 100644 index 0bf5cead..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseMap.js +++ /dev/null @@ -1,22 +0,0 @@ -var baseEach = require('./_baseEach'), - isArrayLike = require('./isArrayLike'); - -/** - * The base implementation of `_.map` without support for iteratee shorthands. - * - * @private - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns the new mapped array. - */ -function baseMap(collection, iteratee) { - var index = -1, - result = isArrayLike(collection) ? Array(collection.length) : []; - - baseEach(collection, function(value, key, collection) { - result[++index] = iteratee(value, key, collection); - }); - return result; -} - -module.exports = baseMap; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseMatches.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseMatches.js deleted file mode 100644 index e56582ad..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseMatches.js +++ /dev/null @@ -1,22 +0,0 @@ -var baseIsMatch = require('./_baseIsMatch'), - getMatchData = require('./_getMatchData'), - matchesStrictComparable = require('./_matchesStrictComparable'); - -/** - * The base implementation of `_.matches` which doesn't clone `source`. - * - * @private - * @param {Object} source The object of property values to match. - * @returns {Function} Returns the new spec function. - */ -function baseMatches(source) { - var matchData = getMatchData(source); - if (matchData.length == 1 && matchData[0][2]) { - return matchesStrictComparable(matchData[0][0], matchData[0][1]); - } - return function(object) { - return object === source || baseIsMatch(object, source, matchData); - }; -} - -module.exports = baseMatches; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseMatchesProperty.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseMatchesProperty.js deleted file mode 100644 index 24afd893..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseMatchesProperty.js +++ /dev/null @@ -1,33 +0,0 @@ -var baseIsEqual = require('./_baseIsEqual'), - get = require('./get'), - hasIn = require('./hasIn'), - isKey = require('./_isKey'), - isStrictComparable = require('./_isStrictComparable'), - matchesStrictComparable = require('./_matchesStrictComparable'), - toKey = require('./_toKey'); - -/** Used to compose bitmasks for value comparisons. */ -var COMPARE_PARTIAL_FLAG = 1, - COMPARE_UNORDERED_FLAG = 2; - -/** - * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`. - * - * @private - * @param {string} path The path of the property to get. - * @param {*} srcValue The value to match. - * @returns {Function} Returns the new spec function. - */ -function baseMatchesProperty(path, srcValue) { - if (isKey(path) && isStrictComparable(srcValue)) { - return matchesStrictComparable(toKey(path), srcValue); - } - return function(object) { - var objValue = get(object, path); - return (objValue === undefined && objValue === srcValue) - ? hasIn(object, path) - : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG); - }; -} - -module.exports = baseMatchesProperty; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseMean.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseMean.js deleted file mode 100644 index fa9e00a0..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseMean.js +++ /dev/null @@ -1,20 +0,0 @@ -var baseSum = require('./_baseSum'); - -/** Used as references for various `Number` constants. */ -var NAN = 0 / 0; - -/** - * The base implementation of `_.mean` and `_.meanBy` without support for - * iteratee shorthands. - * - * @private - * @param {Array} array The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {number} Returns the mean. - */ -function baseMean(array, iteratee) { - var length = array == null ? 0 : array.length; - return length ? (baseSum(array, iteratee) / length) : NAN; -} - -module.exports = baseMean; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseMerge.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseMerge.js deleted file mode 100644 index c98b5eb0..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseMerge.js +++ /dev/null @@ -1,42 +0,0 @@ -var Stack = require('./_Stack'), - assignMergeValue = require('./_assignMergeValue'), - baseFor = require('./_baseFor'), - baseMergeDeep = require('./_baseMergeDeep'), - isObject = require('./isObject'), - keysIn = require('./keysIn'), - safeGet = require('./_safeGet'); - -/** - * The base implementation of `_.merge` without support for multiple sources. - * - * @private - * @param {Object} object The destination object. - * @param {Object} source The source object. - * @param {number} srcIndex The index of `source`. - * @param {Function} [customizer] The function to customize merged values. - * @param {Object} [stack] Tracks traversed source values and their merged - * counterparts. - */ -function baseMerge(object, source, srcIndex, customizer, stack) { - if (object === source) { - return; - } - baseFor(source, function(srcValue, key) { - stack || (stack = new Stack); - if (isObject(srcValue)) { - baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack); - } - else { - var newValue = customizer - ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack) - : undefined; - - if (newValue === undefined) { - newValue = srcValue; - } - assignMergeValue(object, key, newValue); - } - }, keysIn); -} - -module.exports = baseMerge; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseMergeDeep.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseMergeDeep.js deleted file mode 100644 index 4679e8dc..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseMergeDeep.js +++ /dev/null @@ -1,94 +0,0 @@ -var assignMergeValue = require('./_assignMergeValue'), - cloneBuffer = require('./_cloneBuffer'), - cloneTypedArray = require('./_cloneTypedArray'), - copyArray = require('./_copyArray'), - initCloneObject = require('./_initCloneObject'), - isArguments = require('./isArguments'), - isArray = require('./isArray'), - isArrayLikeObject = require('./isArrayLikeObject'), - isBuffer = require('./isBuffer'), - isFunction = require('./isFunction'), - isObject = require('./isObject'), - isPlainObject = require('./isPlainObject'), - isTypedArray = require('./isTypedArray'), - safeGet = require('./_safeGet'), - toPlainObject = require('./toPlainObject'); - -/** - * A specialized version of `baseMerge` for arrays and objects which performs - * deep merges and tracks traversed objects enabling objects with circular - * references to be merged. - * - * @private - * @param {Object} object The destination object. - * @param {Object} source The source object. - * @param {string} key The key of the value to merge. - * @param {number} srcIndex The index of `source`. - * @param {Function} mergeFunc The function to merge values. - * @param {Function} [customizer] The function to customize assigned values. - * @param {Object} [stack] Tracks traversed source values and their merged - * counterparts. - */ -function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) { - var objValue = safeGet(object, key), - srcValue = safeGet(source, key), - stacked = stack.get(srcValue); - - if (stacked) { - assignMergeValue(object, key, stacked); - return; - } - var newValue = customizer - ? customizer(objValue, srcValue, (key + ''), object, source, stack) - : undefined; - - var isCommon = newValue === undefined; - - if (isCommon) { - var isArr = isArray(srcValue), - isBuff = !isArr && isBuffer(srcValue), - isTyped = !isArr && !isBuff && isTypedArray(srcValue); - - newValue = srcValue; - if (isArr || isBuff || isTyped) { - if (isArray(objValue)) { - newValue = objValue; - } - else if (isArrayLikeObject(objValue)) { - newValue = copyArray(objValue); - } - else if (isBuff) { - isCommon = false; - newValue = cloneBuffer(srcValue, true); - } - else if (isTyped) { - isCommon = false; - newValue = cloneTypedArray(srcValue, true); - } - else { - newValue = []; - } - } - else if (isPlainObject(srcValue) || isArguments(srcValue)) { - newValue = objValue; - if (isArguments(objValue)) { - newValue = toPlainObject(objValue); - } - else if (!isObject(objValue) || isFunction(objValue)) { - newValue = initCloneObject(srcValue); - } - } - else { - isCommon = false; - } - } - if (isCommon) { - // Recursively merge objects and arrays (susceptible to call stack limits). - stack.set(srcValue, newValue); - mergeFunc(newValue, srcValue, srcIndex, customizer, stack); - stack['delete'](srcValue); - } - assignMergeValue(object, key, newValue); -} - -module.exports = baseMergeDeep; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseNth.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseNth.js deleted file mode 100644 index 0403c2a3..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseNth.js +++ /dev/null @@ -1,20 +0,0 @@ -var isIndex = require('./_isIndex'); - -/** - * The base implementation of `_.nth` which doesn't coerce arguments. - * - * @private - * @param {Array} array The array to query. - * @param {number} n The index of the element to return. - * @returns {*} Returns the nth element of `array`. - */ -function baseNth(array, n) { - var length = array.length; - if (!length) { - return; - } - n += n < 0 ? length : 0; - return isIndex(n, length) ? array[n] : undefined; -} - -module.exports = baseNth; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseOrderBy.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseOrderBy.js deleted file mode 100644 index 775a0174..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseOrderBy.js +++ /dev/null @@ -1,49 +0,0 @@ -var arrayMap = require('./_arrayMap'), - baseGet = require('./_baseGet'), - baseIteratee = require('./_baseIteratee'), - baseMap = require('./_baseMap'), - baseSortBy = require('./_baseSortBy'), - baseUnary = require('./_baseUnary'), - compareMultiple = require('./_compareMultiple'), - identity = require('./identity'), - isArray = require('./isArray'); - -/** - * The base implementation of `_.orderBy` without param guards. - * - * @private - * @param {Array|Object} collection The collection to iterate over. - * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by. - * @param {string[]} orders The sort orders of `iteratees`. - * @returns {Array} Returns the new sorted array. - */ -function baseOrderBy(collection, iteratees, orders) { - if (iteratees.length) { - iteratees = arrayMap(iteratees, function(iteratee) { - if (isArray(iteratee)) { - return function(value) { - return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee); - } - } - return iteratee; - }); - } else { - iteratees = [identity]; - } - - var index = -1; - iteratees = arrayMap(iteratees, baseUnary(baseIteratee)); - - var result = baseMap(collection, function(value, key, collection) { - var criteria = arrayMap(iteratees, function(iteratee) { - return iteratee(value); - }); - return { 'criteria': criteria, 'index': ++index, 'value': value }; - }); - - return baseSortBy(result, function(object, other) { - return compareMultiple(object, other, orders); - }); -} - -module.exports = baseOrderBy; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_basePick.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_basePick.js deleted file mode 100644 index 09b458a6..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_basePick.js +++ /dev/null @@ -1,19 +0,0 @@ -var basePickBy = require('./_basePickBy'), - hasIn = require('./hasIn'); - -/** - * The base implementation of `_.pick` without support for individual - * property identifiers. - * - * @private - * @param {Object} object The source object. - * @param {string[]} paths The property paths to pick. - * @returns {Object} Returns the new object. - */ -function basePick(object, paths) { - return basePickBy(object, paths, function(value, path) { - return hasIn(object, path); - }); -} - -module.exports = basePick; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_basePickBy.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_basePickBy.js deleted file mode 100644 index 85be68c8..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_basePickBy.js +++ /dev/null @@ -1,30 +0,0 @@ -var baseGet = require('./_baseGet'), - baseSet = require('./_baseSet'), - castPath = require('./_castPath'); - -/** - * The base implementation of `_.pickBy` without support for iteratee shorthands. - * - * @private - * @param {Object} object The source object. - * @param {string[]} paths The property paths to pick. - * @param {Function} predicate The function invoked per property. - * @returns {Object} Returns the new object. - */ -function basePickBy(object, paths, predicate) { - var index = -1, - length = paths.length, - result = {}; - - while (++index < length) { - var path = paths[index], - value = baseGet(object, path); - - if (predicate(value, path)) { - baseSet(result, castPath(path, object), value); - } - } - return result; -} - -module.exports = basePickBy; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseProperty.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseProperty.js deleted file mode 100644 index 496281ec..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseProperty.js +++ /dev/null @@ -1,14 +0,0 @@ -/** - * The base implementation of `_.property` without support for deep paths. - * - * @private - * @param {string} key The key of the property to get. - * @returns {Function} Returns the new accessor function. - */ -function baseProperty(key) { - return function(object) { - return object == null ? undefined : object[key]; - }; -} - -module.exports = baseProperty; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_basePropertyDeep.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_basePropertyDeep.js deleted file mode 100644 index 1e5aae50..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_basePropertyDeep.js +++ /dev/null @@ -1,16 +0,0 @@ -var baseGet = require('./_baseGet'); - -/** - * A specialized version of `baseProperty` which supports deep paths. - * - * @private - * @param {Array|string} path The path of the property to get. - * @returns {Function} Returns the new accessor function. - */ -function basePropertyDeep(path) { - return function(object) { - return baseGet(object, path); - }; -} - -module.exports = basePropertyDeep; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_basePropertyOf.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_basePropertyOf.js deleted file mode 100644 index 46173999..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_basePropertyOf.js +++ /dev/null @@ -1,14 +0,0 @@ -/** - * The base implementation of `_.propertyOf` without support for deep paths. - * - * @private - * @param {Object} object The object to query. - * @returns {Function} Returns the new accessor function. - */ -function basePropertyOf(object) { - return function(key) { - return object == null ? undefined : object[key]; - }; -} - -module.exports = basePropertyOf; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_basePullAll.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_basePullAll.js deleted file mode 100644 index 305720ed..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_basePullAll.js +++ /dev/null @@ -1,51 +0,0 @@ -var arrayMap = require('./_arrayMap'), - baseIndexOf = require('./_baseIndexOf'), - baseIndexOfWith = require('./_baseIndexOfWith'), - baseUnary = require('./_baseUnary'), - copyArray = require('./_copyArray'); - -/** Used for built-in method references. */ -var arrayProto = Array.prototype; - -/** Built-in value references. */ -var splice = arrayProto.splice; - -/** - * The base implementation of `_.pullAllBy` without support for iteratee - * shorthands. - * - * @private - * @param {Array} array The array to modify. - * @param {Array} values The values to remove. - * @param {Function} [iteratee] The iteratee invoked per element. - * @param {Function} [comparator] The comparator invoked per element. - * @returns {Array} Returns `array`. - */ -function basePullAll(array, values, iteratee, comparator) { - var indexOf = comparator ? baseIndexOfWith : baseIndexOf, - index = -1, - length = values.length, - seen = array; - - if (array === values) { - values = copyArray(values); - } - if (iteratee) { - seen = arrayMap(array, baseUnary(iteratee)); - } - while (++index < length) { - var fromIndex = 0, - value = values[index], - computed = iteratee ? iteratee(value) : value; - - while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) { - if (seen !== array) { - splice.call(seen, fromIndex, 1); - } - splice.call(array, fromIndex, 1); - } - } - return array; -} - -module.exports = basePullAll; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_basePullAt.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_basePullAt.js deleted file mode 100644 index c3e9e710..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_basePullAt.js +++ /dev/null @@ -1,37 +0,0 @@ -var baseUnset = require('./_baseUnset'), - isIndex = require('./_isIndex'); - -/** Used for built-in method references. */ -var arrayProto = Array.prototype; - -/** Built-in value references. */ -var splice = arrayProto.splice; - -/** - * The base implementation of `_.pullAt` without support for individual - * indexes or capturing the removed elements. - * - * @private - * @param {Array} array The array to modify. - * @param {number[]} indexes The indexes of elements to remove. - * @returns {Array} Returns `array`. - */ -function basePullAt(array, indexes) { - var length = array ? indexes.length : 0, - lastIndex = length - 1; - - while (length--) { - var index = indexes[length]; - if (length == lastIndex || index !== previous) { - var previous = index; - if (isIndex(index)) { - splice.call(array, index, 1); - } else { - baseUnset(array, index); - } - } - } - return array; -} - -module.exports = basePullAt; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseRandom.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseRandom.js deleted file mode 100644 index 94f76a76..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseRandom.js +++ /dev/null @@ -1,18 +0,0 @@ -/* Built-in method references for those with the same name as other `lodash` methods. */ -var nativeFloor = Math.floor, - nativeRandom = Math.random; - -/** - * The base implementation of `_.random` without support for returning - * floating-point numbers. - * - * @private - * @param {number} lower The lower bound. - * @param {number} upper The upper bound. - * @returns {number} Returns the random number. - */ -function baseRandom(lower, upper) { - return lower + nativeFloor(nativeRandom() * (upper - lower + 1)); -} - -module.exports = baseRandom; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseRange.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseRange.js deleted file mode 100644 index 0fb8e419..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseRange.js +++ /dev/null @@ -1,28 +0,0 @@ -/* Built-in method references for those with the same name as other `lodash` methods. */ -var nativeCeil = Math.ceil, - nativeMax = Math.max; - -/** - * The base implementation of `_.range` and `_.rangeRight` which doesn't - * coerce arguments. - * - * @private - * @param {number} start The start of the range. - * @param {number} end The end of the range. - * @param {number} step The value to increment or decrement by. - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {Array} Returns the range of numbers. - */ -function baseRange(start, end, step, fromRight) { - var index = -1, - length = nativeMax(nativeCeil((end - start) / (step || 1)), 0), - result = Array(length); - - while (length--) { - result[fromRight ? length : ++index] = start; - start += step; - } - return result; -} - -module.exports = baseRange; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseReduce.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseReduce.js deleted file mode 100644 index 5a1f8b57..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseReduce.js +++ /dev/null @@ -1,23 +0,0 @@ -/** - * The base implementation of `_.reduce` and `_.reduceRight`, without support - * for iteratee shorthands, which iterates over `collection` using `eachFunc`. - * - * @private - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @param {*} accumulator The initial value. - * @param {boolean} initAccum Specify using the first or last element of - * `collection` as the initial value. - * @param {Function} eachFunc The function to iterate over `collection`. - * @returns {*} Returns the accumulated value. - */ -function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) { - eachFunc(collection, function(value, index, collection) { - accumulator = initAccum - ? (initAccum = false, value) - : iteratee(accumulator, value, index, collection); - }); - return accumulator; -} - -module.exports = baseReduce; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseRepeat.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseRepeat.js deleted file mode 100644 index ee44c31a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseRepeat.js +++ /dev/null @@ -1,35 +0,0 @@ -/** Used as references for various `Number` constants. */ -var MAX_SAFE_INTEGER = 9007199254740991; - -/* Built-in method references for those with the same name as other `lodash` methods. */ -var nativeFloor = Math.floor; - -/** - * The base implementation of `_.repeat` which doesn't coerce arguments. - * - * @private - * @param {string} string The string to repeat. - * @param {number} n The number of times to repeat the string. - * @returns {string} Returns the repeated string. - */ -function baseRepeat(string, n) { - var result = ''; - if (!string || n < 1 || n > MAX_SAFE_INTEGER) { - return result; - } - // Leverage the exponentiation by squaring algorithm for a faster repeat. - // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details. - do { - if (n % 2) { - result += string; - } - n = nativeFloor(n / 2); - if (n) { - string += string; - } - } while (n); - - return result; -} - -module.exports = baseRepeat; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseRest.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseRest.js deleted file mode 100644 index d0dc4bdd..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseRest.js +++ /dev/null @@ -1,17 +0,0 @@ -var identity = require('./identity'), - overRest = require('./_overRest'), - setToString = require('./_setToString'); - -/** - * The base implementation of `_.rest` which doesn't validate or coerce arguments. - * - * @private - * @param {Function} func The function to apply a rest parameter to. - * @param {number} [start=func.length-1] The start position of the rest parameter. - * @returns {Function} Returns the new function. - */ -function baseRest(func, start) { - return setToString(overRest(func, start, identity), func + ''); -} - -module.exports = baseRest; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseSample.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseSample.js deleted file mode 100644 index 58582b91..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseSample.js +++ /dev/null @@ -1,15 +0,0 @@ -var arraySample = require('./_arraySample'), - values = require('./values'); - -/** - * The base implementation of `_.sample`. - * - * @private - * @param {Array|Object} collection The collection to sample. - * @returns {*} Returns the random element. - */ -function baseSample(collection) { - return arraySample(values(collection)); -} - -module.exports = baseSample; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseSampleSize.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseSampleSize.js deleted file mode 100644 index 5c90ec51..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseSampleSize.js +++ /dev/null @@ -1,18 +0,0 @@ -var baseClamp = require('./_baseClamp'), - shuffleSelf = require('./_shuffleSelf'), - values = require('./values'); - -/** - * The base implementation of `_.sampleSize` without param guards. - * - * @private - * @param {Array|Object} collection The collection to sample. - * @param {number} n The number of elements to sample. - * @returns {Array} Returns the random elements. - */ -function baseSampleSize(collection, n) { - var array = values(collection); - return shuffleSelf(array, baseClamp(n, 0, array.length)); -} - -module.exports = baseSampleSize; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseSet.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseSet.js deleted file mode 100644 index 99f4fbf9..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseSet.js +++ /dev/null @@ -1,51 +0,0 @@ -var assignValue = require('./_assignValue'), - castPath = require('./_castPath'), - isIndex = require('./_isIndex'), - isObject = require('./isObject'), - toKey = require('./_toKey'); - -/** - * The base implementation of `_.set`. - * - * @private - * @param {Object} object The object to modify. - * @param {Array|string} path The path of the property to set. - * @param {*} value The value to set. - * @param {Function} [customizer] The function to customize path creation. - * @returns {Object} Returns `object`. - */ -function baseSet(object, path, value, customizer) { - if (!isObject(object)) { - return object; - } - path = castPath(path, object); - - var index = -1, - length = path.length, - lastIndex = length - 1, - nested = object; - - while (nested != null && ++index < length) { - var key = toKey(path[index]), - newValue = value; - - if (key === '__proto__' || key === 'constructor' || key === 'prototype') { - return object; - } - - if (index != lastIndex) { - var objValue = nested[key]; - newValue = customizer ? customizer(objValue, key, nested) : undefined; - if (newValue === undefined) { - newValue = isObject(objValue) - ? objValue - : (isIndex(path[index + 1]) ? [] : {}); - } - } - assignValue(nested, key, newValue); - nested = nested[key]; - } - return object; -} - -module.exports = baseSet; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseSetData.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseSetData.js deleted file mode 100644 index c409947d..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseSetData.js +++ /dev/null @@ -1,17 +0,0 @@ -var identity = require('./identity'), - metaMap = require('./_metaMap'); - -/** - * The base implementation of `setData` without support for hot loop shorting. - * - * @private - * @param {Function} func The function to associate metadata with. - * @param {*} data The metadata. - * @returns {Function} Returns `func`. - */ -var baseSetData = !metaMap ? identity : function(func, data) { - metaMap.set(func, data); - return func; -}; - -module.exports = baseSetData; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseSetToString.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseSetToString.js deleted file mode 100644 index 89eaca38..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseSetToString.js +++ /dev/null @@ -1,22 +0,0 @@ -var constant = require('./constant'), - defineProperty = require('./_defineProperty'), - identity = require('./identity'); - -/** - * The base implementation of `setToString` without support for hot loop shorting. - * - * @private - * @param {Function} func The function to modify. - * @param {Function} string The `toString` result. - * @returns {Function} Returns `func`. - */ -var baseSetToString = !defineProperty ? identity : function(func, string) { - return defineProperty(func, 'toString', { - 'configurable': true, - 'enumerable': false, - 'value': constant(string), - 'writable': true - }); -}; - -module.exports = baseSetToString; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseShuffle.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseShuffle.js deleted file mode 100644 index 023077ac..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseShuffle.js +++ /dev/null @@ -1,15 +0,0 @@ -var shuffleSelf = require('./_shuffleSelf'), - values = require('./values'); - -/** - * The base implementation of `_.shuffle`. - * - * @private - * @param {Array|Object} collection The collection to shuffle. - * @returns {Array} Returns the new shuffled array. - */ -function baseShuffle(collection) { - return shuffleSelf(values(collection)); -} - -module.exports = baseShuffle; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseSlice.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseSlice.js deleted file mode 100644 index 786f6c99..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseSlice.js +++ /dev/null @@ -1,31 +0,0 @@ -/** - * The base implementation of `_.slice` without an iteratee call guard. - * - * @private - * @param {Array} array The array to slice. - * @param {number} [start=0] The start position. - * @param {number} [end=array.length] The end position. - * @returns {Array} Returns the slice of `array`. - */ -function baseSlice(array, start, end) { - var index = -1, - length = array.length; - - if (start < 0) { - start = -start > length ? 0 : (length + start); - } - end = end > length ? length : end; - if (end < 0) { - end += length; - } - length = start > end ? 0 : ((end - start) >>> 0); - start >>>= 0; - - var result = Array(length); - while (++index < length) { - result[index] = array[index + start]; - } - return result; -} - -module.exports = baseSlice; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseSome.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseSome.js deleted file mode 100644 index 58f3f447..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseSome.js +++ /dev/null @@ -1,22 +0,0 @@ -var baseEach = require('./_baseEach'); - -/** - * The base implementation of `_.some` without support for iteratee shorthands. - * - * @private - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} predicate The function invoked per iteration. - * @returns {boolean} Returns `true` if any element passes the predicate check, - * else `false`. - */ -function baseSome(collection, predicate) { - var result; - - baseEach(collection, function(value, index, collection) { - result = predicate(value, index, collection); - return !result; - }); - return !!result; -} - -module.exports = baseSome; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseSortBy.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseSortBy.js deleted file mode 100644 index a25c92ed..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseSortBy.js +++ /dev/null @@ -1,21 +0,0 @@ -/** - * The base implementation of `_.sortBy` which uses `comparer` to define the - * sort order of `array` and replaces criteria objects with their corresponding - * values. - * - * @private - * @param {Array} array The array to sort. - * @param {Function} comparer The function to define sort order. - * @returns {Array} Returns `array`. - */ -function baseSortBy(array, comparer) { - var length = array.length; - - array.sort(comparer); - while (length--) { - array[length] = array[length].value; - } - return array; -} - -module.exports = baseSortBy; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseSortedIndex.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseSortedIndex.js deleted file mode 100644 index 638c366c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseSortedIndex.js +++ /dev/null @@ -1,42 +0,0 @@ -var baseSortedIndexBy = require('./_baseSortedIndexBy'), - identity = require('./identity'), - isSymbol = require('./isSymbol'); - -/** Used as references for the maximum length and index of an array. */ -var MAX_ARRAY_LENGTH = 4294967295, - HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1; - -/** - * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which - * performs a binary search of `array` to determine the index at which `value` - * should be inserted into `array` in order to maintain its sort order. - * - * @private - * @param {Array} array The sorted array to inspect. - * @param {*} value The value to evaluate. - * @param {boolean} [retHighest] Specify returning the highest qualified index. - * @returns {number} Returns the index at which `value` should be inserted - * into `array`. - */ -function baseSortedIndex(array, value, retHighest) { - var low = 0, - high = array == null ? low : array.length; - - if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) { - while (low < high) { - var mid = (low + high) >>> 1, - computed = array[mid]; - - if (computed !== null && !isSymbol(computed) && - (retHighest ? (computed <= value) : (computed < value))) { - low = mid + 1; - } else { - high = mid; - } - } - return high; - } - return baseSortedIndexBy(array, value, identity, retHighest); -} - -module.exports = baseSortedIndex; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseSortedIndexBy.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseSortedIndexBy.js deleted file mode 100644 index c247b377..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseSortedIndexBy.js +++ /dev/null @@ -1,67 +0,0 @@ -var isSymbol = require('./isSymbol'); - -/** Used as references for the maximum length and index of an array. */ -var MAX_ARRAY_LENGTH = 4294967295, - MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1; - -/* Built-in method references for those with the same name as other `lodash` methods. */ -var nativeFloor = Math.floor, - nativeMin = Math.min; - -/** - * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy` - * which invokes `iteratee` for `value` and each element of `array` to compute - * their sort ranking. The iteratee is invoked with one argument; (value). - * - * @private - * @param {Array} array The sorted array to inspect. - * @param {*} value The value to evaluate. - * @param {Function} iteratee The iteratee invoked per element. - * @param {boolean} [retHighest] Specify returning the highest qualified index. - * @returns {number} Returns the index at which `value` should be inserted - * into `array`. - */ -function baseSortedIndexBy(array, value, iteratee, retHighest) { - var low = 0, - high = array == null ? 0 : array.length; - if (high === 0) { - return 0; - } - - value = iteratee(value); - var valIsNaN = value !== value, - valIsNull = value === null, - valIsSymbol = isSymbol(value), - valIsUndefined = value === undefined; - - while (low < high) { - var mid = nativeFloor((low + high) / 2), - computed = iteratee(array[mid]), - othIsDefined = computed !== undefined, - othIsNull = computed === null, - othIsReflexive = computed === computed, - othIsSymbol = isSymbol(computed); - - if (valIsNaN) { - var setLow = retHighest || othIsReflexive; - } else if (valIsUndefined) { - setLow = othIsReflexive && (retHighest || othIsDefined); - } else if (valIsNull) { - setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull); - } else if (valIsSymbol) { - setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol); - } else if (othIsNull || othIsSymbol) { - setLow = false; - } else { - setLow = retHighest ? (computed <= value) : (computed < value); - } - if (setLow) { - low = mid + 1; - } else { - high = mid; - } - } - return nativeMin(high, MAX_ARRAY_INDEX); -} - -module.exports = baseSortedIndexBy; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseSortedUniq.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseSortedUniq.js deleted file mode 100644 index 802159a3..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseSortedUniq.js +++ /dev/null @@ -1,30 +0,0 @@ -var eq = require('./eq'); - -/** - * The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without - * support for iteratee shorthands. - * - * @private - * @param {Array} array The array to inspect. - * @param {Function} [iteratee] The iteratee invoked per element. - * @returns {Array} Returns the new duplicate free array. - */ -function baseSortedUniq(array, iteratee) { - var index = -1, - length = array.length, - resIndex = 0, - result = []; - - while (++index < length) { - var value = array[index], - computed = iteratee ? iteratee(value) : value; - - if (!index || !eq(computed, seen)) { - var seen = computed; - result[resIndex++] = value === 0 ? 0 : value; - } - } - return result; -} - -module.exports = baseSortedUniq; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseSum.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseSum.js deleted file mode 100644 index a9e84c13..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseSum.js +++ /dev/null @@ -1,24 +0,0 @@ -/** - * The base implementation of `_.sum` and `_.sumBy` without support for - * iteratee shorthands. - * - * @private - * @param {Array} array The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {number} Returns the sum. - */ -function baseSum(array, iteratee) { - var result, - index = -1, - length = array.length; - - while (++index < length) { - var current = iteratee(array[index]); - if (current !== undefined) { - result = result === undefined ? current : (result + current); - } - } - return result; -} - -module.exports = baseSum; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseTimes.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseTimes.js deleted file mode 100644 index 0603fc37..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseTimes.js +++ /dev/null @@ -1,20 +0,0 @@ -/** - * The base implementation of `_.times` without support for iteratee shorthands - * or max array length checks. - * - * @private - * @param {number} n The number of times to invoke `iteratee`. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns the array of results. - */ -function baseTimes(n, iteratee) { - var index = -1, - result = Array(n); - - while (++index < n) { - result[index] = iteratee(index); - } - return result; -} - -module.exports = baseTimes; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseToNumber.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseToNumber.js deleted file mode 100644 index 04859f39..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseToNumber.js +++ /dev/null @@ -1,24 +0,0 @@ -var isSymbol = require('./isSymbol'); - -/** Used as references for various `Number` constants. */ -var NAN = 0 / 0; - -/** - * The base implementation of `_.toNumber` which doesn't ensure correct - * conversions of binary, hexadecimal, or octal string values. - * - * @private - * @param {*} value The value to process. - * @returns {number} Returns the number. - */ -function baseToNumber(value) { - if (typeof value == 'number') { - return value; - } - if (isSymbol(value)) { - return NAN; - } - return +value; -} - -module.exports = baseToNumber; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseToPairs.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseToPairs.js deleted file mode 100644 index bff19912..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseToPairs.js +++ /dev/null @@ -1,18 +0,0 @@ -var arrayMap = require('./_arrayMap'); - -/** - * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array - * of key-value pairs for `object` corresponding to the property names of `props`. - * - * @private - * @param {Object} object The object to query. - * @param {Array} props The property names to get values for. - * @returns {Object} Returns the key-value pairs. - */ -function baseToPairs(object, props) { - return arrayMap(props, function(key) { - return [key, object[key]]; - }); -} - -module.exports = baseToPairs; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseToString.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseToString.js deleted file mode 100644 index ada6ad29..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseToString.js +++ /dev/null @@ -1,37 +0,0 @@ -var Symbol = require('./_Symbol'), - arrayMap = require('./_arrayMap'), - isArray = require('./isArray'), - isSymbol = require('./isSymbol'); - -/** Used as references for various `Number` constants. */ -var INFINITY = 1 / 0; - -/** Used to convert symbols to primitives and strings. */ -var symbolProto = Symbol ? Symbol.prototype : undefined, - symbolToString = symbolProto ? symbolProto.toString : undefined; - -/** - * The base implementation of `_.toString` which doesn't convert nullish - * values to empty strings. - * - * @private - * @param {*} value The value to process. - * @returns {string} Returns the string. - */ -function baseToString(value) { - // Exit early for strings to avoid a performance hit in some environments. - if (typeof value == 'string') { - return value; - } - if (isArray(value)) { - // Recursively convert values (susceptible to call stack limits). - return arrayMap(value, baseToString) + ''; - } - if (isSymbol(value)) { - return symbolToString ? symbolToString.call(value) : ''; - } - var result = (value + ''); - return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; -} - -module.exports = baseToString; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseTrim.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseTrim.js deleted file mode 100644 index 3e2797d9..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseTrim.js +++ /dev/null @@ -1,19 +0,0 @@ -var trimmedEndIndex = require('./_trimmedEndIndex'); - -/** Used to match leading whitespace. */ -var reTrimStart = /^\s+/; - -/** - * The base implementation of `_.trim`. - * - * @private - * @param {string} string The string to trim. - * @returns {string} Returns the trimmed string. - */ -function baseTrim(string) { - return string - ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '') - : string; -} - -module.exports = baseTrim; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseUnary.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseUnary.js deleted file mode 100644 index 98639e92..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseUnary.js +++ /dev/null @@ -1,14 +0,0 @@ -/** - * The base implementation of `_.unary` without support for storing metadata. - * - * @private - * @param {Function} func The function to cap arguments for. - * @returns {Function} Returns the new capped function. - */ -function baseUnary(func) { - return function(value) { - return func(value); - }; -} - -module.exports = baseUnary; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseUniq.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseUniq.js deleted file mode 100644 index aea459dc..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseUniq.js +++ /dev/null @@ -1,72 +0,0 @@ -var SetCache = require('./_SetCache'), - arrayIncludes = require('./_arrayIncludes'), - arrayIncludesWith = require('./_arrayIncludesWith'), - cacheHas = require('./_cacheHas'), - createSet = require('./_createSet'), - setToArray = require('./_setToArray'); - -/** Used as the size to enable large array optimizations. */ -var LARGE_ARRAY_SIZE = 200; - -/** - * The base implementation of `_.uniqBy` without support for iteratee shorthands. - * - * @private - * @param {Array} array The array to inspect. - * @param {Function} [iteratee] The iteratee invoked per element. - * @param {Function} [comparator] The comparator invoked per element. - * @returns {Array} Returns the new duplicate free array. - */ -function baseUniq(array, iteratee, comparator) { - var index = -1, - includes = arrayIncludes, - length = array.length, - isCommon = true, - result = [], - seen = result; - - if (comparator) { - isCommon = false; - includes = arrayIncludesWith; - } - else if (length >= LARGE_ARRAY_SIZE) { - var set = iteratee ? null : createSet(array); - if (set) { - return setToArray(set); - } - isCommon = false; - includes = cacheHas; - seen = new SetCache; - } - else { - seen = iteratee ? [] : result; - } - outer: - while (++index < length) { - var value = array[index], - computed = iteratee ? iteratee(value) : value; - - value = (comparator || value !== 0) ? value : 0; - if (isCommon && computed === computed) { - var seenIndex = seen.length; - while (seenIndex--) { - if (seen[seenIndex] === computed) { - continue outer; - } - } - if (iteratee) { - seen.push(computed); - } - result.push(value); - } - else if (!includes(seen, computed, comparator)) { - if (seen !== result) { - seen.push(computed); - } - result.push(value); - } - } - return result; -} - -module.exports = baseUniq; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseUnset.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseUnset.js deleted file mode 100644 index eefc6e37..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseUnset.js +++ /dev/null @@ -1,20 +0,0 @@ -var castPath = require('./_castPath'), - last = require('./last'), - parent = require('./_parent'), - toKey = require('./_toKey'); - -/** - * The base implementation of `_.unset`. - * - * @private - * @param {Object} object The object to modify. - * @param {Array|string} path The property path to unset. - * @returns {boolean} Returns `true` if the property is deleted, else `false`. - */ -function baseUnset(object, path) { - path = castPath(path, object); - object = parent(object, path); - return object == null || delete object[toKey(last(path))]; -} - -module.exports = baseUnset; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseUpdate.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseUpdate.js deleted file mode 100644 index 92a62377..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseUpdate.js +++ /dev/null @@ -1,18 +0,0 @@ -var baseGet = require('./_baseGet'), - baseSet = require('./_baseSet'); - -/** - * The base implementation of `_.update`. - * - * @private - * @param {Object} object The object to modify. - * @param {Array|string} path The path of the property to update. - * @param {Function} updater The function to produce the updated value. - * @param {Function} [customizer] The function to customize path creation. - * @returns {Object} Returns `object`. - */ -function baseUpdate(object, path, updater, customizer) { - return baseSet(object, path, updater(baseGet(object, path)), customizer); -} - -module.exports = baseUpdate; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseValues.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseValues.js deleted file mode 100644 index b95faadc..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseValues.js +++ /dev/null @@ -1,19 +0,0 @@ -var arrayMap = require('./_arrayMap'); - -/** - * The base implementation of `_.values` and `_.valuesIn` which creates an - * array of `object` property values corresponding to the property names - * of `props`. - * - * @private - * @param {Object} object The object to query. - * @param {Array} props The property names to get values for. - * @returns {Object} Returns the array of property values. - */ -function baseValues(object, props) { - return arrayMap(props, function(key) { - return object[key]; - }); -} - -module.exports = baseValues; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseWhile.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseWhile.js deleted file mode 100644 index 07eac61b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseWhile.js +++ /dev/null @@ -1,26 +0,0 @@ -var baseSlice = require('./_baseSlice'); - -/** - * The base implementation of methods like `_.dropWhile` and `_.takeWhile` - * without support for iteratee shorthands. - * - * @private - * @param {Array} array The array to query. - * @param {Function} predicate The function invoked per iteration. - * @param {boolean} [isDrop] Specify dropping elements instead of taking them. - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {Array} Returns the slice of `array`. - */ -function baseWhile(array, predicate, isDrop, fromRight) { - var length = array.length, - index = fromRight ? length : -1; - - while ((fromRight ? index-- : ++index < length) && - predicate(array[index], index, array)) {} - - return isDrop - ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length)) - : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index)); -} - -module.exports = baseWhile; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseWrapperValue.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseWrapperValue.js deleted file mode 100644 index 443e0df5..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseWrapperValue.js +++ /dev/null @@ -1,25 +0,0 @@ -var LazyWrapper = require('./_LazyWrapper'), - arrayPush = require('./_arrayPush'), - arrayReduce = require('./_arrayReduce'); - -/** - * The base implementation of `wrapperValue` which returns the result of - * performing a sequence of actions on the unwrapped `value`, where each - * successive action is supplied the return value of the previous. - * - * @private - * @param {*} value The unwrapped value. - * @param {Array} actions Actions to perform to resolve the unwrapped value. - * @returns {*} Returns the resolved value. - */ -function baseWrapperValue(value, actions) { - var result = value; - if (result instanceof LazyWrapper) { - result = result.value(); - } - return arrayReduce(actions, function(result, action) { - return action.func.apply(action.thisArg, arrayPush([result], action.args)); - }, result); -} - -module.exports = baseWrapperValue; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseXor.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseXor.js deleted file mode 100644 index 8e69338b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseXor.js +++ /dev/null @@ -1,36 +0,0 @@ -var baseDifference = require('./_baseDifference'), - baseFlatten = require('./_baseFlatten'), - baseUniq = require('./_baseUniq'); - -/** - * The base implementation of methods like `_.xor`, without support for - * iteratee shorthands, that accepts an array of arrays to inspect. - * - * @private - * @param {Array} arrays The arrays to inspect. - * @param {Function} [iteratee] The iteratee invoked per element. - * @param {Function} [comparator] The comparator invoked per element. - * @returns {Array} Returns the new array of values. - */ -function baseXor(arrays, iteratee, comparator) { - var length = arrays.length; - if (length < 2) { - return length ? baseUniq(arrays[0]) : []; - } - var index = -1, - result = Array(length); - - while (++index < length) { - var array = arrays[index], - othIndex = -1; - - while (++othIndex < length) { - if (othIndex != index) { - result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator); - } - } - } - return baseUniq(baseFlatten(result, 1), iteratee, comparator); -} - -module.exports = baseXor; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseZipObject.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseZipObject.js deleted file mode 100644 index 401f85be..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_baseZipObject.js +++ /dev/null @@ -1,23 +0,0 @@ -/** - * This base implementation of `_.zipObject` which assigns values using `assignFunc`. - * - * @private - * @param {Array} props The property identifiers. - * @param {Array} values The property values. - * @param {Function} assignFunc The function to assign values. - * @returns {Object} Returns the new object. - */ -function baseZipObject(props, values, assignFunc) { - var index = -1, - length = props.length, - valsLength = values.length, - result = {}; - - while (++index < length) { - var value = index < valsLength ? values[index] : undefined; - assignFunc(result, props[index], value); - } - return result; -} - -module.exports = baseZipObject; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_cacheHas.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_cacheHas.js deleted file mode 100644 index 2dec8926..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_cacheHas.js +++ /dev/null @@ -1,13 +0,0 @@ -/** - * Checks if a `cache` value for `key` exists. - * - * @private - * @param {Object} cache The cache to query. - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ -function cacheHas(cache, key) { - return cache.has(key); -} - -module.exports = cacheHas; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_castArrayLikeObject.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_castArrayLikeObject.js deleted file mode 100644 index 92c75fa1..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_castArrayLikeObject.js +++ /dev/null @@ -1,14 +0,0 @@ -var isArrayLikeObject = require('./isArrayLikeObject'); - -/** - * Casts `value` to an empty array if it's not an array like object. - * - * @private - * @param {*} value The value to inspect. - * @returns {Array|Object} Returns the cast array-like object. - */ -function castArrayLikeObject(value) { - return isArrayLikeObject(value) ? value : []; -} - -module.exports = castArrayLikeObject; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_castFunction.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_castFunction.js deleted file mode 100644 index 98c91ae6..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_castFunction.js +++ /dev/null @@ -1,14 +0,0 @@ -var identity = require('./identity'); - -/** - * Casts `value` to `identity` if it's not a function. - * - * @private - * @param {*} value The value to inspect. - * @returns {Function} Returns cast function. - */ -function castFunction(value) { - return typeof value == 'function' ? value : identity; -} - -module.exports = castFunction; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_castPath.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_castPath.js deleted file mode 100644 index 017e4c1b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_castPath.js +++ /dev/null @@ -1,21 +0,0 @@ -var isArray = require('./isArray'), - isKey = require('./_isKey'), - stringToPath = require('./_stringToPath'), - toString = require('./toString'); - -/** - * Casts `value` to a path array if it's not one. - * - * @private - * @param {*} value The value to inspect. - * @param {Object} [object] The object to query keys on. - * @returns {Array} Returns the cast property path array. - */ -function castPath(value, object) { - if (isArray(value)) { - return value; - } - return isKey(value, object) ? [value] : stringToPath(toString(value)); -} - -module.exports = castPath; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_castRest.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_castRest.js deleted file mode 100644 index 213c66f1..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_castRest.js +++ /dev/null @@ -1,14 +0,0 @@ -var baseRest = require('./_baseRest'); - -/** - * A `baseRest` alias which can be replaced with `identity` by module - * replacement plugins. - * - * @private - * @type {Function} - * @param {Function} func The function to apply a rest parameter to. - * @returns {Function} Returns the new function. - */ -var castRest = baseRest; - -module.exports = castRest; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_castSlice.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_castSlice.js deleted file mode 100644 index 071faeba..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_castSlice.js +++ /dev/null @@ -1,18 +0,0 @@ -var baseSlice = require('./_baseSlice'); - -/** - * Casts `array` to a slice if it's needed. - * - * @private - * @param {Array} array The array to inspect. - * @param {number} start The start position. - * @param {number} [end=array.length] The end position. - * @returns {Array} Returns the cast slice. - */ -function castSlice(array, start, end) { - var length = array.length; - end = end === undefined ? length : end; - return (!start && end >= length) ? array : baseSlice(array, start, end); -} - -module.exports = castSlice; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_charsEndIndex.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_charsEndIndex.js deleted file mode 100644 index 07908ff3..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_charsEndIndex.js +++ /dev/null @@ -1,19 +0,0 @@ -var baseIndexOf = require('./_baseIndexOf'); - -/** - * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol - * that is not found in the character symbols. - * - * @private - * @param {Array} strSymbols The string symbols to inspect. - * @param {Array} chrSymbols The character symbols to find. - * @returns {number} Returns the index of the last unmatched string symbol. - */ -function charsEndIndex(strSymbols, chrSymbols) { - var index = strSymbols.length; - - while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {} - return index; -} - -module.exports = charsEndIndex; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_charsStartIndex.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_charsStartIndex.js deleted file mode 100644 index b17afd25..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_charsStartIndex.js +++ /dev/null @@ -1,20 +0,0 @@ -var baseIndexOf = require('./_baseIndexOf'); - -/** - * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol - * that is not found in the character symbols. - * - * @private - * @param {Array} strSymbols The string symbols to inspect. - * @param {Array} chrSymbols The character symbols to find. - * @returns {number} Returns the index of the first unmatched string symbol. - */ -function charsStartIndex(strSymbols, chrSymbols) { - var index = -1, - length = strSymbols.length; - - while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {} - return index; -} - -module.exports = charsStartIndex; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_cloneArrayBuffer.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_cloneArrayBuffer.js deleted file mode 100644 index c3d8f6e3..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_cloneArrayBuffer.js +++ /dev/null @@ -1,16 +0,0 @@ -var Uint8Array = require('./_Uint8Array'); - -/** - * Creates a clone of `arrayBuffer`. - * - * @private - * @param {ArrayBuffer} arrayBuffer The array buffer to clone. - * @returns {ArrayBuffer} Returns the cloned array buffer. - */ -function cloneArrayBuffer(arrayBuffer) { - var result = new arrayBuffer.constructor(arrayBuffer.byteLength); - new Uint8Array(result).set(new Uint8Array(arrayBuffer)); - return result; -} - -module.exports = cloneArrayBuffer; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_cloneBuffer.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_cloneBuffer.js deleted file mode 100644 index 27c48109..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_cloneBuffer.js +++ /dev/null @@ -1,35 +0,0 @@ -var root = require('./_root'); - -/** Detect free variable `exports`. */ -var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports; - -/** Detect free variable `module`. */ -var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module; - -/** Detect the popular CommonJS extension `module.exports`. */ -var moduleExports = freeModule && freeModule.exports === freeExports; - -/** Built-in value references. */ -var Buffer = moduleExports ? root.Buffer : undefined, - allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined; - -/** - * Creates a clone of `buffer`. - * - * @private - * @param {Buffer} buffer The buffer to clone. - * @param {boolean} [isDeep] Specify a deep clone. - * @returns {Buffer} Returns the cloned buffer. - */ -function cloneBuffer(buffer, isDeep) { - if (isDeep) { - return buffer.slice(); - } - var length = buffer.length, - result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length); - - buffer.copy(result); - return result; -} - -module.exports = cloneBuffer; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_cloneDataView.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_cloneDataView.js deleted file mode 100644 index 9c9b7b05..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_cloneDataView.js +++ /dev/null @@ -1,16 +0,0 @@ -var cloneArrayBuffer = require('./_cloneArrayBuffer'); - -/** - * Creates a clone of `dataView`. - * - * @private - * @param {Object} dataView The data view to clone. - * @param {boolean} [isDeep] Specify a deep clone. - * @returns {Object} Returns the cloned data view. - */ -function cloneDataView(dataView, isDeep) { - var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer; - return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength); -} - -module.exports = cloneDataView; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_cloneRegExp.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_cloneRegExp.js deleted file mode 100644 index 64a30dfb..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_cloneRegExp.js +++ /dev/null @@ -1,17 +0,0 @@ -/** Used to match `RegExp` flags from their coerced string values. */ -var reFlags = /\w*$/; - -/** - * Creates a clone of `regexp`. - * - * @private - * @param {Object} regexp The regexp to clone. - * @returns {Object} Returns the cloned regexp. - */ -function cloneRegExp(regexp) { - var result = new regexp.constructor(regexp.source, reFlags.exec(regexp)); - result.lastIndex = regexp.lastIndex; - return result; -} - -module.exports = cloneRegExp; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_cloneSymbol.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_cloneSymbol.js deleted file mode 100644 index bede39f5..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_cloneSymbol.js +++ /dev/null @@ -1,18 +0,0 @@ -var Symbol = require('./_Symbol'); - -/** Used to convert symbols to primitives and strings. */ -var symbolProto = Symbol ? Symbol.prototype : undefined, - symbolValueOf = symbolProto ? symbolProto.valueOf : undefined; - -/** - * Creates a clone of the `symbol` object. - * - * @private - * @param {Object} symbol The symbol object to clone. - * @returns {Object} Returns the cloned symbol object. - */ -function cloneSymbol(symbol) { - return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {}; -} - -module.exports = cloneSymbol; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_cloneTypedArray.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_cloneTypedArray.js deleted file mode 100644 index 7aad84d4..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_cloneTypedArray.js +++ /dev/null @@ -1,16 +0,0 @@ -var cloneArrayBuffer = require('./_cloneArrayBuffer'); - -/** - * Creates a clone of `typedArray`. - * - * @private - * @param {Object} typedArray The typed array to clone. - * @param {boolean} [isDeep] Specify a deep clone. - * @returns {Object} Returns the cloned typed array. - */ -function cloneTypedArray(typedArray, isDeep) { - var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer; - return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length); -} - -module.exports = cloneTypedArray; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_compareAscending.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_compareAscending.js deleted file mode 100644 index 8dc27910..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_compareAscending.js +++ /dev/null @@ -1,41 +0,0 @@ -var isSymbol = require('./isSymbol'); - -/** - * Compares values to sort them in ascending order. - * - * @private - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {number} Returns the sort order indicator for `value`. - */ -function compareAscending(value, other) { - if (value !== other) { - var valIsDefined = value !== undefined, - valIsNull = value === null, - valIsReflexive = value === value, - valIsSymbol = isSymbol(value); - - var othIsDefined = other !== undefined, - othIsNull = other === null, - othIsReflexive = other === other, - othIsSymbol = isSymbol(other); - - if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) || - (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) || - (valIsNull && othIsDefined && othIsReflexive) || - (!valIsDefined && othIsReflexive) || - !valIsReflexive) { - return 1; - } - if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) || - (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) || - (othIsNull && valIsDefined && valIsReflexive) || - (!othIsDefined && valIsReflexive) || - !othIsReflexive) { - return -1; - } - } - return 0; -} - -module.exports = compareAscending; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_compareMultiple.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_compareMultiple.js deleted file mode 100644 index ad61f0fb..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_compareMultiple.js +++ /dev/null @@ -1,44 +0,0 @@ -var compareAscending = require('./_compareAscending'); - -/** - * Used by `_.orderBy` to compare multiple properties of a value to another - * and stable sort them. - * - * If `orders` is unspecified, all values are sorted in ascending order. Otherwise, - * specify an order of "desc" for descending or "asc" for ascending sort order - * of corresponding values. - * - * @private - * @param {Object} object The object to compare. - * @param {Object} other The other object to compare. - * @param {boolean[]|string[]} orders The order to sort by for each property. - * @returns {number} Returns the sort order indicator for `object`. - */ -function compareMultiple(object, other, orders) { - var index = -1, - objCriteria = object.criteria, - othCriteria = other.criteria, - length = objCriteria.length, - ordersLength = orders.length; - - while (++index < length) { - var result = compareAscending(objCriteria[index], othCriteria[index]); - if (result) { - if (index >= ordersLength) { - return result; - } - var order = orders[index]; - return result * (order == 'desc' ? -1 : 1); - } - } - // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications - // that causes it, under certain circumstances, to provide the same value for - // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247 - // for more details. - // - // This also ensures a stable sort in V8 and other engines. - // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details. - return object.index - other.index; -} - -module.exports = compareMultiple; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_composeArgs.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_composeArgs.js deleted file mode 100644 index 1ce40f4f..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_composeArgs.js +++ /dev/null @@ -1,39 +0,0 @@ -/* Built-in method references for those with the same name as other `lodash` methods. */ -var nativeMax = Math.max; - -/** - * Creates an array that is the composition of partially applied arguments, - * placeholders, and provided arguments into a single array of arguments. - * - * @private - * @param {Array} args The provided arguments. - * @param {Array} partials The arguments to prepend to those provided. - * @param {Array} holders The `partials` placeholder indexes. - * @params {boolean} [isCurried] Specify composing for a curried function. - * @returns {Array} Returns the new array of composed arguments. - */ -function composeArgs(args, partials, holders, isCurried) { - var argsIndex = -1, - argsLength = args.length, - holdersLength = holders.length, - leftIndex = -1, - leftLength = partials.length, - rangeLength = nativeMax(argsLength - holdersLength, 0), - result = Array(leftLength + rangeLength), - isUncurried = !isCurried; - - while (++leftIndex < leftLength) { - result[leftIndex] = partials[leftIndex]; - } - while (++argsIndex < holdersLength) { - if (isUncurried || argsIndex < argsLength) { - result[holders[argsIndex]] = args[argsIndex]; - } - } - while (rangeLength--) { - result[leftIndex++] = args[argsIndex++]; - } - return result; -} - -module.exports = composeArgs; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_composeArgsRight.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_composeArgsRight.js deleted file mode 100644 index 8dc588d0..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_composeArgsRight.js +++ /dev/null @@ -1,41 +0,0 @@ -/* Built-in method references for those with the same name as other `lodash` methods. */ -var nativeMax = Math.max; - -/** - * This function is like `composeArgs` except that the arguments composition - * is tailored for `_.partialRight`. - * - * @private - * @param {Array} args The provided arguments. - * @param {Array} partials The arguments to append to those provided. - * @param {Array} holders The `partials` placeholder indexes. - * @params {boolean} [isCurried] Specify composing for a curried function. - * @returns {Array} Returns the new array of composed arguments. - */ -function composeArgsRight(args, partials, holders, isCurried) { - var argsIndex = -1, - argsLength = args.length, - holdersIndex = -1, - holdersLength = holders.length, - rightIndex = -1, - rightLength = partials.length, - rangeLength = nativeMax(argsLength - holdersLength, 0), - result = Array(rangeLength + rightLength), - isUncurried = !isCurried; - - while (++argsIndex < rangeLength) { - result[argsIndex] = args[argsIndex]; - } - var offset = argsIndex; - while (++rightIndex < rightLength) { - result[offset + rightIndex] = partials[rightIndex]; - } - while (++holdersIndex < holdersLength) { - if (isUncurried || argsIndex < argsLength) { - result[offset + holders[holdersIndex]] = args[argsIndex++]; - } - } - return result; -} - -module.exports = composeArgsRight; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_copyArray.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_copyArray.js deleted file mode 100644 index cd94d5d0..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_copyArray.js +++ /dev/null @@ -1,20 +0,0 @@ -/** - * Copies the values of `source` to `array`. - * - * @private - * @param {Array} source The array to copy values from. - * @param {Array} [array=[]] The array to copy values to. - * @returns {Array} Returns `array`. - */ -function copyArray(source, array) { - var index = -1, - length = source.length; - - array || (array = Array(length)); - while (++index < length) { - array[index] = source[index]; - } - return array; -} - -module.exports = copyArray; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_copyObject.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_copyObject.js deleted file mode 100644 index 2f2a5c23..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_copyObject.js +++ /dev/null @@ -1,40 +0,0 @@ -var assignValue = require('./_assignValue'), - baseAssignValue = require('./_baseAssignValue'); - -/** - * Copies properties of `source` to `object`. - * - * @private - * @param {Object} source The object to copy properties from. - * @param {Array} props The property identifiers to copy. - * @param {Object} [object={}] The object to copy properties to. - * @param {Function} [customizer] The function to customize copied values. - * @returns {Object} Returns `object`. - */ -function copyObject(source, props, object, customizer) { - var isNew = !object; - object || (object = {}); - - var index = -1, - length = props.length; - - while (++index < length) { - var key = props[index]; - - var newValue = customizer - ? customizer(object[key], source[key], key, object, source) - : undefined; - - if (newValue === undefined) { - newValue = source[key]; - } - if (isNew) { - baseAssignValue(object, key, newValue); - } else { - assignValue(object, key, newValue); - } - } - return object; -} - -module.exports = copyObject; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_copySymbols.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_copySymbols.js deleted file mode 100644 index c35944ab..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_copySymbols.js +++ /dev/null @@ -1,16 +0,0 @@ -var copyObject = require('./_copyObject'), - getSymbols = require('./_getSymbols'); - -/** - * Copies own symbols of `source` to `object`. - * - * @private - * @param {Object} source The object to copy symbols from. - * @param {Object} [object={}] The object to copy symbols to. - * @returns {Object} Returns `object`. - */ -function copySymbols(source, object) { - return copyObject(source, getSymbols(source), object); -} - -module.exports = copySymbols; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_copySymbolsIn.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_copySymbolsIn.js deleted file mode 100644 index fdf20a73..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_copySymbolsIn.js +++ /dev/null @@ -1,16 +0,0 @@ -var copyObject = require('./_copyObject'), - getSymbolsIn = require('./_getSymbolsIn'); - -/** - * Copies own and inherited symbols of `source` to `object`. - * - * @private - * @param {Object} source The object to copy symbols from. - * @param {Object} [object={}] The object to copy symbols to. - * @returns {Object} Returns `object`. - */ -function copySymbolsIn(source, object) { - return copyObject(source, getSymbolsIn(source), object); -} - -module.exports = copySymbolsIn; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_coreJsData.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_coreJsData.js deleted file mode 100644 index f8e5b4e3..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_coreJsData.js +++ /dev/null @@ -1,6 +0,0 @@ -var root = require('./_root'); - -/** Used to detect overreaching core-js shims. */ -var coreJsData = root['__core-js_shared__']; - -module.exports = coreJsData; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_countHolders.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_countHolders.js deleted file mode 100644 index 718fcdaa..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_countHolders.js +++ /dev/null @@ -1,21 +0,0 @@ -/** - * Gets the number of `placeholder` occurrences in `array`. - * - * @private - * @param {Array} array The array to inspect. - * @param {*} placeholder The placeholder to search for. - * @returns {number} Returns the placeholder count. - */ -function countHolders(array, placeholder) { - var length = array.length, - result = 0; - - while (length--) { - if (array[length] === placeholder) { - ++result; - } - } - return result; -} - -module.exports = countHolders; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_createAggregator.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_createAggregator.js deleted file mode 100644 index 0be42c41..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_createAggregator.js +++ /dev/null @@ -1,23 +0,0 @@ -var arrayAggregator = require('./_arrayAggregator'), - baseAggregator = require('./_baseAggregator'), - baseIteratee = require('./_baseIteratee'), - isArray = require('./isArray'); - -/** - * Creates a function like `_.groupBy`. - * - * @private - * @param {Function} setter The function to set accumulator values. - * @param {Function} [initializer] The accumulator object initializer. - * @returns {Function} Returns the new aggregator function. - */ -function createAggregator(setter, initializer) { - return function(collection, iteratee) { - var func = isArray(collection) ? arrayAggregator : baseAggregator, - accumulator = initializer ? initializer() : {}; - - return func(collection, setter, baseIteratee(iteratee, 2), accumulator); - }; -} - -module.exports = createAggregator; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_createAssigner.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_createAssigner.js deleted file mode 100644 index 1f904c51..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_createAssigner.js +++ /dev/null @@ -1,37 +0,0 @@ -var baseRest = require('./_baseRest'), - isIterateeCall = require('./_isIterateeCall'); - -/** - * Creates a function like `_.assign`. - * - * @private - * @param {Function} assigner The function to assign values. - * @returns {Function} Returns the new assigner function. - */ -function createAssigner(assigner) { - return baseRest(function(object, sources) { - var index = -1, - length = sources.length, - customizer = length > 1 ? sources[length - 1] : undefined, - guard = length > 2 ? sources[2] : undefined; - - customizer = (assigner.length > 3 && typeof customizer == 'function') - ? (length--, customizer) - : undefined; - - if (guard && isIterateeCall(sources[0], sources[1], guard)) { - customizer = length < 3 ? undefined : customizer; - length = 1; - } - object = Object(object); - while (++index < length) { - var source = sources[index]; - if (source) { - assigner(object, source, index, customizer); - } - } - return object; - }); -} - -module.exports = createAssigner; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_createBaseEach.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_createBaseEach.js deleted file mode 100644 index d24fdd1b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_createBaseEach.js +++ /dev/null @@ -1,32 +0,0 @@ -var isArrayLike = require('./isArrayLike'); - -/** - * Creates a `baseEach` or `baseEachRight` function. - * - * @private - * @param {Function} eachFunc The function to iterate over a collection. - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {Function} Returns the new base function. - */ -function createBaseEach(eachFunc, fromRight) { - return function(collection, iteratee) { - if (collection == null) { - return collection; - } - if (!isArrayLike(collection)) { - return eachFunc(collection, iteratee); - } - var length = collection.length, - index = fromRight ? length : -1, - iterable = Object(collection); - - while ((fromRight ? index-- : ++index < length)) { - if (iteratee(iterable[index], index, iterable) === false) { - break; - } - } - return collection; - }; -} - -module.exports = createBaseEach; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_createBaseFor.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_createBaseFor.js deleted file mode 100644 index 94cbf297..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_createBaseFor.js +++ /dev/null @@ -1,25 +0,0 @@ -/** - * Creates a base function for methods like `_.forIn` and `_.forOwn`. - * - * @private - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {Function} Returns the new base function. - */ -function createBaseFor(fromRight) { - return function(object, iteratee, keysFunc) { - var index = -1, - iterable = Object(object), - props = keysFunc(object), - length = props.length; - - while (length--) { - var key = props[fromRight ? length : ++index]; - if (iteratee(iterable[key], key, iterable) === false) { - break; - } - } - return object; - }; -} - -module.exports = createBaseFor; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_createBind.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_createBind.js deleted file mode 100644 index 07cb99f4..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_createBind.js +++ /dev/null @@ -1,28 +0,0 @@ -var createCtor = require('./_createCtor'), - root = require('./_root'); - -/** Used to compose bitmasks for function metadata. */ -var WRAP_BIND_FLAG = 1; - -/** - * Creates a function that wraps `func` to invoke it with the optional `this` - * binding of `thisArg`. - * - * @private - * @param {Function} func The function to wrap. - * @param {number} bitmask The bitmask flags. See `createWrap` for more details. - * @param {*} [thisArg] The `this` binding of `func`. - * @returns {Function} Returns the new wrapped function. - */ -function createBind(func, bitmask, thisArg) { - var isBind = bitmask & WRAP_BIND_FLAG, - Ctor = createCtor(func); - - function wrapper() { - var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; - return fn.apply(isBind ? thisArg : this, arguments); - } - return wrapper; -} - -module.exports = createBind; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_createCaseFirst.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_createCaseFirst.js deleted file mode 100644 index fe8ea483..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_createCaseFirst.js +++ /dev/null @@ -1,33 +0,0 @@ -var castSlice = require('./_castSlice'), - hasUnicode = require('./_hasUnicode'), - stringToArray = require('./_stringToArray'), - toString = require('./toString'); - -/** - * Creates a function like `_.lowerFirst`. - * - * @private - * @param {string} methodName The name of the `String` case method to use. - * @returns {Function} Returns the new case function. - */ -function createCaseFirst(methodName) { - return function(string) { - string = toString(string); - - var strSymbols = hasUnicode(string) - ? stringToArray(string) - : undefined; - - var chr = strSymbols - ? strSymbols[0] - : string.charAt(0); - - var trailing = strSymbols - ? castSlice(strSymbols, 1).join('') - : string.slice(1); - - return chr[methodName]() + trailing; - }; -} - -module.exports = createCaseFirst; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_createCompounder.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_createCompounder.js deleted file mode 100644 index 8d4cee2c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_createCompounder.js +++ /dev/null @@ -1,24 +0,0 @@ -var arrayReduce = require('./_arrayReduce'), - deburr = require('./deburr'), - words = require('./words'); - -/** Used to compose unicode capture groups. */ -var rsApos = "['\u2019]"; - -/** Used to match apostrophes. */ -var reApos = RegExp(rsApos, 'g'); - -/** - * Creates a function like `_.camelCase`. - * - * @private - * @param {Function} callback The function to combine each word. - * @returns {Function} Returns the new compounder function. - */ -function createCompounder(callback) { - return function(string) { - return arrayReduce(words(deburr(string).replace(reApos, '')), callback, ''); - }; -} - -module.exports = createCompounder; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_createCtor.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_createCtor.js deleted file mode 100644 index 9047aa5f..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_createCtor.js +++ /dev/null @@ -1,37 +0,0 @@ -var baseCreate = require('./_baseCreate'), - isObject = require('./isObject'); - -/** - * Creates a function that produces an instance of `Ctor` regardless of - * whether it was invoked as part of a `new` expression or by `call` or `apply`. - * - * @private - * @param {Function} Ctor The constructor to wrap. - * @returns {Function} Returns the new wrapped function. - */ -function createCtor(Ctor) { - return function() { - // Use a `switch` statement to work with class constructors. See - // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist - // for more details. - var args = arguments; - switch (args.length) { - case 0: return new Ctor; - case 1: return new Ctor(args[0]); - case 2: return new Ctor(args[0], args[1]); - case 3: return new Ctor(args[0], args[1], args[2]); - case 4: return new Ctor(args[0], args[1], args[2], args[3]); - case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]); - case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]); - case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]); - } - var thisBinding = baseCreate(Ctor.prototype), - result = Ctor.apply(thisBinding, args); - - // Mimic the constructor's `return` behavior. - // See https://es5.github.io/#x13.2.2 for more details. - return isObject(result) ? result : thisBinding; - }; -} - -module.exports = createCtor; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_createCurry.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_createCurry.js deleted file mode 100644 index f06c2cdd..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_createCurry.js +++ /dev/null @@ -1,46 +0,0 @@ -var apply = require('./_apply'), - createCtor = require('./_createCtor'), - createHybrid = require('./_createHybrid'), - createRecurry = require('./_createRecurry'), - getHolder = require('./_getHolder'), - replaceHolders = require('./_replaceHolders'), - root = require('./_root'); - -/** - * Creates a function that wraps `func` to enable currying. - * - * @private - * @param {Function} func The function to wrap. - * @param {number} bitmask The bitmask flags. See `createWrap` for more details. - * @param {number} arity The arity of `func`. - * @returns {Function} Returns the new wrapped function. - */ -function createCurry(func, bitmask, arity) { - var Ctor = createCtor(func); - - function wrapper() { - var length = arguments.length, - args = Array(length), - index = length, - placeholder = getHolder(wrapper); - - while (index--) { - args[index] = arguments[index]; - } - var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder) - ? [] - : replaceHolders(args, placeholder); - - length -= holders.length; - if (length < arity) { - return createRecurry( - func, bitmask, createHybrid, wrapper.placeholder, undefined, - args, holders, undefined, undefined, arity - length); - } - var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; - return apply(fn, this, args); - } - return wrapper; -} - -module.exports = createCurry; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_createFind.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_createFind.js deleted file mode 100644 index 8859ff89..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_createFind.js +++ /dev/null @@ -1,25 +0,0 @@ -var baseIteratee = require('./_baseIteratee'), - isArrayLike = require('./isArrayLike'), - keys = require('./keys'); - -/** - * Creates a `_.find` or `_.findLast` function. - * - * @private - * @param {Function} findIndexFunc The function to find the collection index. - * @returns {Function} Returns the new find function. - */ -function createFind(findIndexFunc) { - return function(collection, predicate, fromIndex) { - var iterable = Object(collection); - if (!isArrayLike(collection)) { - var iteratee = baseIteratee(predicate, 3); - collection = keys(collection); - predicate = function(key) { return iteratee(iterable[key], key, iterable); }; - } - var index = findIndexFunc(collection, predicate, fromIndex); - return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined; - }; -} - -module.exports = createFind; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_createFlow.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_createFlow.js deleted file mode 100644 index baaddbf5..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_createFlow.js +++ /dev/null @@ -1,78 +0,0 @@ -var LodashWrapper = require('./_LodashWrapper'), - flatRest = require('./_flatRest'), - getData = require('./_getData'), - getFuncName = require('./_getFuncName'), - isArray = require('./isArray'), - isLaziable = require('./_isLaziable'); - -/** Error message constants. */ -var FUNC_ERROR_TEXT = 'Expected a function'; - -/** Used to compose bitmasks for function metadata. */ -var WRAP_CURRY_FLAG = 8, - WRAP_PARTIAL_FLAG = 32, - WRAP_ARY_FLAG = 128, - WRAP_REARG_FLAG = 256; - -/** - * Creates a `_.flow` or `_.flowRight` function. - * - * @private - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {Function} Returns the new flow function. - */ -function createFlow(fromRight) { - return flatRest(function(funcs) { - var length = funcs.length, - index = length, - prereq = LodashWrapper.prototype.thru; - - if (fromRight) { - funcs.reverse(); - } - while (index--) { - var func = funcs[index]; - if (typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - if (prereq && !wrapper && getFuncName(func) == 'wrapper') { - var wrapper = new LodashWrapper([], true); - } - } - index = wrapper ? index : length; - while (++index < length) { - func = funcs[index]; - - var funcName = getFuncName(func), - data = funcName == 'wrapper' ? getData(func) : undefined; - - if (data && isLaziable(data[0]) && - data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) && - !data[4].length && data[9] == 1 - ) { - wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]); - } else { - wrapper = (func.length == 1 && isLaziable(func)) - ? wrapper[funcName]() - : wrapper.thru(func); - } - } - return function() { - var args = arguments, - value = args[0]; - - if (wrapper && args.length == 1 && isArray(value)) { - return wrapper.plant(value).value(); - } - var index = 0, - result = length ? funcs[index].apply(this, args) : value; - - while (++index < length) { - result = funcs[index].call(this, result); - } - return result; - }; - }); -} - -module.exports = createFlow; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_createHybrid.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_createHybrid.js deleted file mode 100644 index b671bd11..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_createHybrid.js +++ /dev/null @@ -1,92 +0,0 @@ -var composeArgs = require('./_composeArgs'), - composeArgsRight = require('./_composeArgsRight'), - countHolders = require('./_countHolders'), - createCtor = require('./_createCtor'), - createRecurry = require('./_createRecurry'), - getHolder = require('./_getHolder'), - reorder = require('./_reorder'), - replaceHolders = require('./_replaceHolders'), - root = require('./_root'); - -/** Used to compose bitmasks for function metadata. */ -var WRAP_BIND_FLAG = 1, - WRAP_BIND_KEY_FLAG = 2, - WRAP_CURRY_FLAG = 8, - WRAP_CURRY_RIGHT_FLAG = 16, - WRAP_ARY_FLAG = 128, - WRAP_FLIP_FLAG = 512; - -/** - * Creates a function that wraps `func` to invoke it with optional `this` - * binding of `thisArg`, partial application, and currying. - * - * @private - * @param {Function|string} func The function or method name to wrap. - * @param {number} bitmask The bitmask flags. See `createWrap` for more details. - * @param {*} [thisArg] The `this` binding of `func`. - * @param {Array} [partials] The arguments to prepend to those provided to - * the new function. - * @param {Array} [holders] The `partials` placeholder indexes. - * @param {Array} [partialsRight] The arguments to append to those provided - * to the new function. - * @param {Array} [holdersRight] The `partialsRight` placeholder indexes. - * @param {Array} [argPos] The argument positions of the new function. - * @param {number} [ary] The arity cap of `func`. - * @param {number} [arity] The arity of `func`. - * @returns {Function} Returns the new wrapped function. - */ -function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) { - var isAry = bitmask & WRAP_ARY_FLAG, - isBind = bitmask & WRAP_BIND_FLAG, - isBindKey = bitmask & WRAP_BIND_KEY_FLAG, - isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG), - isFlip = bitmask & WRAP_FLIP_FLAG, - Ctor = isBindKey ? undefined : createCtor(func); - - function wrapper() { - var length = arguments.length, - args = Array(length), - index = length; - - while (index--) { - args[index] = arguments[index]; - } - if (isCurried) { - var placeholder = getHolder(wrapper), - holdersCount = countHolders(args, placeholder); - } - if (partials) { - args = composeArgs(args, partials, holders, isCurried); - } - if (partialsRight) { - args = composeArgsRight(args, partialsRight, holdersRight, isCurried); - } - length -= holdersCount; - if (isCurried && length < arity) { - var newHolders = replaceHolders(args, placeholder); - return createRecurry( - func, bitmask, createHybrid, wrapper.placeholder, thisArg, - args, newHolders, argPos, ary, arity - length - ); - } - var thisBinding = isBind ? thisArg : this, - fn = isBindKey ? thisBinding[func] : func; - - length = args.length; - if (argPos) { - args = reorder(args, argPos); - } else if (isFlip && length > 1) { - args.reverse(); - } - if (isAry && ary < length) { - args.length = ary; - } - if (this && this !== root && this instanceof wrapper) { - fn = Ctor || createCtor(fn); - } - return fn.apply(thisBinding, args); - } - return wrapper; -} - -module.exports = createHybrid; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_createInverter.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_createInverter.js deleted file mode 100644 index 6c0c5629..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_createInverter.js +++ /dev/null @@ -1,17 +0,0 @@ -var baseInverter = require('./_baseInverter'); - -/** - * Creates a function like `_.invertBy`. - * - * @private - * @param {Function} setter The function to set accumulator values. - * @param {Function} toIteratee The function to resolve iteratees. - * @returns {Function} Returns the new inverter function. - */ -function createInverter(setter, toIteratee) { - return function(object, iteratee) { - return baseInverter(object, setter, toIteratee(iteratee), {}); - }; -} - -module.exports = createInverter; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_createMathOperation.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_createMathOperation.js deleted file mode 100644 index f1e238ac..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_createMathOperation.js +++ /dev/null @@ -1,38 +0,0 @@ -var baseToNumber = require('./_baseToNumber'), - baseToString = require('./_baseToString'); - -/** - * Creates a function that performs a mathematical operation on two values. - * - * @private - * @param {Function} operator The function to perform the operation. - * @param {number} [defaultValue] The value used for `undefined` arguments. - * @returns {Function} Returns the new mathematical operation function. - */ -function createMathOperation(operator, defaultValue) { - return function(value, other) { - var result; - if (value === undefined && other === undefined) { - return defaultValue; - } - if (value !== undefined) { - result = value; - } - if (other !== undefined) { - if (result === undefined) { - return other; - } - if (typeof value == 'string' || typeof other == 'string') { - value = baseToString(value); - other = baseToString(other); - } else { - value = baseToNumber(value); - other = baseToNumber(other); - } - result = operator(value, other); - } - return result; - }; -} - -module.exports = createMathOperation; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_createOver.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_createOver.js deleted file mode 100644 index 3b945516..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_createOver.js +++ /dev/null @@ -1,27 +0,0 @@ -var apply = require('./_apply'), - arrayMap = require('./_arrayMap'), - baseIteratee = require('./_baseIteratee'), - baseRest = require('./_baseRest'), - baseUnary = require('./_baseUnary'), - flatRest = require('./_flatRest'); - -/** - * Creates a function like `_.over`. - * - * @private - * @param {Function} arrayFunc The function to iterate over iteratees. - * @returns {Function} Returns the new over function. - */ -function createOver(arrayFunc) { - return flatRest(function(iteratees) { - iteratees = arrayMap(iteratees, baseUnary(baseIteratee)); - return baseRest(function(args) { - var thisArg = this; - return arrayFunc(iteratees, function(iteratee) { - return apply(iteratee, thisArg, args); - }); - }); - }); -} - -module.exports = createOver; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_createPadding.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_createPadding.js deleted file mode 100644 index 2124612b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_createPadding.js +++ /dev/null @@ -1,33 +0,0 @@ -var baseRepeat = require('./_baseRepeat'), - baseToString = require('./_baseToString'), - castSlice = require('./_castSlice'), - hasUnicode = require('./_hasUnicode'), - stringSize = require('./_stringSize'), - stringToArray = require('./_stringToArray'); - -/* Built-in method references for those with the same name as other `lodash` methods. */ -var nativeCeil = Math.ceil; - -/** - * Creates the padding for `string` based on `length`. The `chars` string - * is truncated if the number of characters exceeds `length`. - * - * @private - * @param {number} length The padding length. - * @param {string} [chars=' '] The string used as padding. - * @returns {string} Returns the padding for `string`. - */ -function createPadding(length, chars) { - chars = chars === undefined ? ' ' : baseToString(chars); - - var charsLength = chars.length; - if (charsLength < 2) { - return charsLength ? baseRepeat(chars, length) : chars; - } - var result = baseRepeat(chars, nativeCeil(length / stringSize(chars))); - return hasUnicode(chars) - ? castSlice(stringToArray(result), 0, length).join('') - : result.slice(0, length); -} - -module.exports = createPadding; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_createPartial.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_createPartial.js deleted file mode 100644 index e16c248b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_createPartial.js +++ /dev/null @@ -1,43 +0,0 @@ -var apply = require('./_apply'), - createCtor = require('./_createCtor'), - root = require('./_root'); - -/** Used to compose bitmasks for function metadata. */ -var WRAP_BIND_FLAG = 1; - -/** - * Creates a function that wraps `func` to invoke it with the `this` binding - * of `thisArg` and `partials` prepended to the arguments it receives. - * - * @private - * @param {Function} func The function to wrap. - * @param {number} bitmask The bitmask flags. See `createWrap` for more details. - * @param {*} thisArg The `this` binding of `func`. - * @param {Array} partials The arguments to prepend to those provided to - * the new function. - * @returns {Function} Returns the new wrapped function. - */ -function createPartial(func, bitmask, thisArg, partials) { - var isBind = bitmask & WRAP_BIND_FLAG, - Ctor = createCtor(func); - - function wrapper() { - var argsIndex = -1, - argsLength = arguments.length, - leftIndex = -1, - leftLength = partials.length, - args = Array(leftLength + argsLength), - fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; - - while (++leftIndex < leftLength) { - args[leftIndex] = partials[leftIndex]; - } - while (argsLength--) { - args[leftIndex++] = arguments[++argsIndex]; - } - return apply(fn, isBind ? thisArg : this, args); - } - return wrapper; -} - -module.exports = createPartial; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_createRange.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_createRange.js deleted file mode 100644 index 9f52c779..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_createRange.js +++ /dev/null @@ -1,30 +0,0 @@ -var baseRange = require('./_baseRange'), - isIterateeCall = require('./_isIterateeCall'), - toFinite = require('./toFinite'); - -/** - * Creates a `_.range` or `_.rangeRight` function. - * - * @private - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {Function} Returns the new range function. - */ -function createRange(fromRight) { - return function(start, end, step) { - if (step && typeof step != 'number' && isIterateeCall(start, end, step)) { - end = step = undefined; - } - // Ensure the sign of `-0` is preserved. - start = toFinite(start); - if (end === undefined) { - end = start; - start = 0; - } else { - end = toFinite(end); - } - step = step === undefined ? (start < end ? 1 : -1) : toFinite(step); - return baseRange(start, end, step, fromRight); - }; -} - -module.exports = createRange; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_createRecurry.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_createRecurry.js deleted file mode 100644 index eb29fb24..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_createRecurry.js +++ /dev/null @@ -1,56 +0,0 @@ -var isLaziable = require('./_isLaziable'), - setData = require('./_setData'), - setWrapToString = require('./_setWrapToString'); - -/** Used to compose bitmasks for function metadata. */ -var WRAP_BIND_FLAG = 1, - WRAP_BIND_KEY_FLAG = 2, - WRAP_CURRY_BOUND_FLAG = 4, - WRAP_CURRY_FLAG = 8, - WRAP_PARTIAL_FLAG = 32, - WRAP_PARTIAL_RIGHT_FLAG = 64; - -/** - * Creates a function that wraps `func` to continue currying. - * - * @private - * @param {Function} func The function to wrap. - * @param {number} bitmask The bitmask flags. See `createWrap` for more details. - * @param {Function} wrapFunc The function to create the `func` wrapper. - * @param {*} placeholder The placeholder value. - * @param {*} [thisArg] The `this` binding of `func`. - * @param {Array} [partials] The arguments to prepend to those provided to - * the new function. - * @param {Array} [holders] The `partials` placeholder indexes. - * @param {Array} [argPos] The argument positions of the new function. - * @param {number} [ary] The arity cap of `func`. - * @param {number} [arity] The arity of `func`. - * @returns {Function} Returns the new wrapped function. - */ -function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) { - var isCurry = bitmask & WRAP_CURRY_FLAG, - newHolders = isCurry ? holders : undefined, - newHoldersRight = isCurry ? undefined : holders, - newPartials = isCurry ? partials : undefined, - newPartialsRight = isCurry ? undefined : partials; - - bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG); - bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG); - - if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) { - bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG); - } - var newData = [ - func, bitmask, thisArg, newPartials, newHolders, newPartialsRight, - newHoldersRight, argPos, ary, arity - ]; - - var result = wrapFunc.apply(undefined, newData); - if (isLaziable(func)) { - setData(result, newData); - } - result.placeholder = placeholder; - return setWrapToString(result, func, bitmask); -} - -module.exports = createRecurry; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_createRelationalOperation.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_createRelationalOperation.js deleted file mode 100644 index a17c6b5e..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_createRelationalOperation.js +++ /dev/null @@ -1,20 +0,0 @@ -var toNumber = require('./toNumber'); - -/** - * Creates a function that performs a relational operation on two values. - * - * @private - * @param {Function} operator The function to perform the operation. - * @returns {Function} Returns the new relational operation function. - */ -function createRelationalOperation(operator) { - return function(value, other) { - if (!(typeof value == 'string' && typeof other == 'string')) { - value = toNumber(value); - other = toNumber(other); - } - return operator(value, other); - }; -} - -module.exports = createRelationalOperation; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_createRound.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_createRound.js deleted file mode 100644 index 88be5df3..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_createRound.js +++ /dev/null @@ -1,35 +0,0 @@ -var root = require('./_root'), - toInteger = require('./toInteger'), - toNumber = require('./toNumber'), - toString = require('./toString'); - -/* Built-in method references for those with the same name as other `lodash` methods. */ -var nativeIsFinite = root.isFinite, - nativeMin = Math.min; - -/** - * Creates a function like `_.round`. - * - * @private - * @param {string} methodName The name of the `Math` method to use when rounding. - * @returns {Function} Returns the new round function. - */ -function createRound(methodName) { - var func = Math[methodName]; - return function(number, precision) { - number = toNumber(number); - precision = precision == null ? 0 : nativeMin(toInteger(precision), 292); - if (precision && nativeIsFinite(number)) { - // Shift with exponential notation to avoid floating-point issues. - // See [MDN](https://mdn.io/round#Examples) for more details. - var pair = (toString(number) + 'e').split('e'), - value = func(pair[0] + 'e' + (+pair[1] + precision)); - - pair = (toString(value) + 'e').split('e'); - return +(pair[0] + 'e' + (+pair[1] - precision)); - } - return func(number); - }; -} - -module.exports = createRound; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_createSet.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_createSet.js deleted file mode 100644 index 0f644eea..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_createSet.js +++ /dev/null @@ -1,19 +0,0 @@ -var Set = require('./_Set'), - noop = require('./noop'), - setToArray = require('./_setToArray'); - -/** Used as references for various `Number` constants. */ -var INFINITY = 1 / 0; - -/** - * Creates a set object of `values`. - * - * @private - * @param {Array} values The values to add to the set. - * @returns {Object} Returns the new set. - */ -var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) { - return new Set(values); -}; - -module.exports = createSet; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_createToPairs.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_createToPairs.js deleted file mode 100644 index 568417af..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_createToPairs.js +++ /dev/null @@ -1,30 +0,0 @@ -var baseToPairs = require('./_baseToPairs'), - getTag = require('./_getTag'), - mapToArray = require('./_mapToArray'), - setToPairs = require('./_setToPairs'); - -/** `Object#toString` result references. */ -var mapTag = '[object Map]', - setTag = '[object Set]'; - -/** - * Creates a `_.toPairs` or `_.toPairsIn` function. - * - * @private - * @param {Function} keysFunc The function to get the keys of a given object. - * @returns {Function} Returns the new pairs function. - */ -function createToPairs(keysFunc) { - return function(object) { - var tag = getTag(object); - if (tag == mapTag) { - return mapToArray(object); - } - if (tag == setTag) { - return setToPairs(object); - } - return baseToPairs(object, keysFunc(object)); - }; -} - -module.exports = createToPairs; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_createWrap.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_createWrap.js deleted file mode 100644 index 33f0633e..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_createWrap.js +++ /dev/null @@ -1,106 +0,0 @@ -var baseSetData = require('./_baseSetData'), - createBind = require('./_createBind'), - createCurry = require('./_createCurry'), - createHybrid = require('./_createHybrid'), - createPartial = require('./_createPartial'), - getData = require('./_getData'), - mergeData = require('./_mergeData'), - setData = require('./_setData'), - setWrapToString = require('./_setWrapToString'), - toInteger = require('./toInteger'); - -/** Error message constants. */ -var FUNC_ERROR_TEXT = 'Expected a function'; - -/** Used to compose bitmasks for function metadata. */ -var WRAP_BIND_FLAG = 1, - WRAP_BIND_KEY_FLAG = 2, - WRAP_CURRY_FLAG = 8, - WRAP_CURRY_RIGHT_FLAG = 16, - WRAP_PARTIAL_FLAG = 32, - WRAP_PARTIAL_RIGHT_FLAG = 64; - -/* Built-in method references for those with the same name as other `lodash` methods. */ -var nativeMax = Math.max; - -/** - * Creates a function that either curries or invokes `func` with optional - * `this` binding and partially applied arguments. - * - * @private - * @param {Function|string} func The function or method name to wrap. - * @param {number} bitmask The bitmask flags. - * 1 - `_.bind` - * 2 - `_.bindKey` - * 4 - `_.curry` or `_.curryRight` of a bound function - * 8 - `_.curry` - * 16 - `_.curryRight` - * 32 - `_.partial` - * 64 - `_.partialRight` - * 128 - `_.rearg` - * 256 - `_.ary` - * 512 - `_.flip` - * @param {*} [thisArg] The `this` binding of `func`. - * @param {Array} [partials] The arguments to be partially applied. - * @param {Array} [holders] The `partials` placeholder indexes. - * @param {Array} [argPos] The argument positions of the new function. - * @param {number} [ary] The arity cap of `func`. - * @param {number} [arity] The arity of `func`. - * @returns {Function} Returns the new wrapped function. - */ -function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) { - var isBindKey = bitmask & WRAP_BIND_KEY_FLAG; - if (!isBindKey && typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - var length = partials ? partials.length : 0; - if (!length) { - bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG); - partials = holders = undefined; - } - ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0); - arity = arity === undefined ? arity : toInteger(arity); - length -= holders ? holders.length : 0; - - if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) { - var partialsRight = partials, - holdersRight = holders; - - partials = holders = undefined; - } - var data = isBindKey ? undefined : getData(func); - - var newData = [ - func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, - argPos, ary, arity - ]; - - if (data) { - mergeData(newData, data); - } - func = newData[0]; - bitmask = newData[1]; - thisArg = newData[2]; - partials = newData[3]; - holders = newData[4]; - arity = newData[9] = newData[9] === undefined - ? (isBindKey ? 0 : func.length) - : nativeMax(newData[9] - length, 0); - - if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) { - bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG); - } - if (!bitmask || bitmask == WRAP_BIND_FLAG) { - var result = createBind(func, bitmask, thisArg); - } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) { - result = createCurry(func, bitmask, arity); - } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) { - result = createPartial(func, bitmask, thisArg, partials); - } else { - result = createHybrid.apply(undefined, newData); - } - var setter = data ? baseSetData : setData; - return setWrapToString(setter(result, newData), func, bitmask); -} - -module.exports = createWrap; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_customDefaultsAssignIn.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_customDefaultsAssignIn.js deleted file mode 100644 index 1f49e6fc..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_customDefaultsAssignIn.js +++ /dev/null @@ -1,29 +0,0 @@ -var eq = require('./eq'); - -/** Used for built-in method references. */ -var objectProto = Object.prototype; - -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; - -/** - * Used by `_.defaults` to customize its `_.assignIn` use to assign properties - * of source objects to the destination object for all destination properties - * that resolve to `undefined`. - * - * @private - * @param {*} objValue The destination value. - * @param {*} srcValue The source value. - * @param {string} key The key of the property to assign. - * @param {Object} object The parent object of `objValue`. - * @returns {*} Returns the value to assign. - */ -function customDefaultsAssignIn(objValue, srcValue, key, object) { - if (objValue === undefined || - (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) { - return srcValue; - } - return objValue; -} - -module.exports = customDefaultsAssignIn; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_customDefaultsMerge.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_customDefaultsMerge.js deleted file mode 100644 index 4cab3175..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_customDefaultsMerge.js +++ /dev/null @@ -1,28 +0,0 @@ -var baseMerge = require('./_baseMerge'), - isObject = require('./isObject'); - -/** - * Used by `_.defaultsDeep` to customize its `_.merge` use to merge source - * objects into destination objects that are passed thru. - * - * @private - * @param {*} objValue The destination value. - * @param {*} srcValue The source value. - * @param {string} key The key of the property to merge. - * @param {Object} object The parent object of `objValue`. - * @param {Object} source The parent object of `srcValue`. - * @param {Object} [stack] Tracks traversed source values and their merged - * counterparts. - * @returns {*} Returns the value to assign. - */ -function customDefaultsMerge(objValue, srcValue, key, object, source, stack) { - if (isObject(objValue) && isObject(srcValue)) { - // Recursively merge objects and arrays (susceptible to call stack limits). - stack.set(srcValue, objValue); - baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack); - stack['delete'](srcValue); - } - return objValue; -} - -module.exports = customDefaultsMerge; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_customOmitClone.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_customOmitClone.js deleted file mode 100644 index 968db2ef..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_customOmitClone.js +++ /dev/null @@ -1,16 +0,0 @@ -var isPlainObject = require('./isPlainObject'); - -/** - * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain - * objects. - * - * @private - * @param {*} value The value to inspect. - * @param {string} key The key of the property to inspect. - * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`. - */ -function customOmitClone(value) { - return isPlainObject(value) ? undefined : value; -} - -module.exports = customOmitClone; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_deburrLetter.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_deburrLetter.js deleted file mode 100644 index 3e531edc..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_deburrLetter.js +++ /dev/null @@ -1,71 +0,0 @@ -var basePropertyOf = require('./_basePropertyOf'); - -/** Used to map Latin Unicode letters to basic Latin letters. */ -var deburredLetters = { - // Latin-1 Supplement block. - '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A', - '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a', - '\xc7': 'C', '\xe7': 'c', - '\xd0': 'D', '\xf0': 'd', - '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E', - '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e', - '\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I', - '\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i', - '\xd1': 'N', '\xf1': 'n', - '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O', - '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o', - '\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U', - '\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u', - '\xdd': 'Y', '\xfd': 'y', '\xff': 'y', - '\xc6': 'Ae', '\xe6': 'ae', - '\xde': 'Th', '\xfe': 'th', - '\xdf': 'ss', - // Latin Extended-A block. - '\u0100': 'A', '\u0102': 'A', '\u0104': 'A', - '\u0101': 'a', '\u0103': 'a', '\u0105': 'a', - '\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C', - '\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c', - '\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd', - '\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E', - '\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e', - '\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G', - '\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g', - '\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h', - '\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I', - '\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i', - '\u0134': 'J', '\u0135': 'j', - '\u0136': 'K', '\u0137': 'k', '\u0138': 'k', - '\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L', - '\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l', - '\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N', - '\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n', - '\u014c': 'O', '\u014e': 'O', '\u0150': 'O', - '\u014d': 'o', '\u014f': 'o', '\u0151': 'o', - '\u0154': 'R', '\u0156': 'R', '\u0158': 'R', - '\u0155': 'r', '\u0157': 'r', '\u0159': 'r', - '\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S', - '\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's', - '\u0162': 'T', '\u0164': 'T', '\u0166': 'T', - '\u0163': 't', '\u0165': 't', '\u0167': 't', - '\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U', - '\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u', - '\u0174': 'W', '\u0175': 'w', - '\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y', - '\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z', - '\u017a': 'z', '\u017c': 'z', '\u017e': 'z', - '\u0132': 'IJ', '\u0133': 'ij', - '\u0152': 'Oe', '\u0153': 'oe', - '\u0149': "'n", '\u017f': 's' -}; - -/** - * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A - * letters to basic Latin letters. - * - * @private - * @param {string} letter The matched letter to deburr. - * @returns {string} Returns the deburred letter. - */ -var deburrLetter = basePropertyOf(deburredLetters); - -module.exports = deburrLetter; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_defineProperty.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_defineProperty.js deleted file mode 100644 index b6116d92..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_defineProperty.js +++ /dev/null @@ -1,11 +0,0 @@ -var getNative = require('./_getNative'); - -var defineProperty = (function() { - try { - var func = getNative(Object, 'defineProperty'); - func({}, '', {}); - return func; - } catch (e) {} -}()); - -module.exports = defineProperty; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_equalArrays.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_equalArrays.js deleted file mode 100644 index 824228c7..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_equalArrays.js +++ /dev/null @@ -1,84 +0,0 @@ -var SetCache = require('./_SetCache'), - arraySome = require('./_arraySome'), - cacheHas = require('./_cacheHas'); - -/** Used to compose bitmasks for value comparisons. */ -var COMPARE_PARTIAL_FLAG = 1, - COMPARE_UNORDERED_FLAG = 2; - -/** - * A specialized version of `baseIsEqualDeep` for arrays with support for - * partial deep comparisons. - * - * @private - * @param {Array} array The array to compare. - * @param {Array} other The other array to compare. - * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. - * @param {Function} customizer The function to customize comparisons. - * @param {Function} equalFunc The function to determine equivalents of values. - * @param {Object} stack Tracks traversed `array` and `other` objects. - * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`. - */ -function equalArrays(array, other, bitmask, customizer, equalFunc, stack) { - var isPartial = bitmask & COMPARE_PARTIAL_FLAG, - arrLength = array.length, - othLength = other.length; - - if (arrLength != othLength && !(isPartial && othLength > arrLength)) { - return false; - } - // Check that cyclic values are equal. - var arrStacked = stack.get(array); - var othStacked = stack.get(other); - if (arrStacked && othStacked) { - return arrStacked == other && othStacked == array; - } - var index = -1, - result = true, - seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined; - - stack.set(array, other); - stack.set(other, array); - - // Ignore non-index properties. - while (++index < arrLength) { - var arrValue = array[index], - othValue = other[index]; - - if (customizer) { - var compared = isPartial - ? customizer(othValue, arrValue, index, other, array, stack) - : customizer(arrValue, othValue, index, array, other, stack); - } - if (compared !== undefined) { - if (compared) { - continue; - } - result = false; - break; - } - // Recursively compare arrays (susceptible to call stack limits). - if (seen) { - if (!arraySome(other, function(othValue, othIndex) { - if (!cacheHas(seen, othIndex) && - (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) { - return seen.push(othIndex); - } - })) { - result = false; - break; - } - } else if (!( - arrValue === othValue || - equalFunc(arrValue, othValue, bitmask, customizer, stack) - )) { - result = false; - break; - } - } - stack['delete'](array); - stack['delete'](other); - return result; -} - -module.exports = equalArrays; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_equalByTag.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_equalByTag.js deleted file mode 100644 index 71919e86..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_equalByTag.js +++ /dev/null @@ -1,112 +0,0 @@ -var Symbol = require('./_Symbol'), - Uint8Array = require('./_Uint8Array'), - eq = require('./eq'), - equalArrays = require('./_equalArrays'), - mapToArray = require('./_mapToArray'), - setToArray = require('./_setToArray'); - -/** Used to compose bitmasks for value comparisons. */ -var COMPARE_PARTIAL_FLAG = 1, - COMPARE_UNORDERED_FLAG = 2; - -/** `Object#toString` result references. */ -var boolTag = '[object Boolean]', - dateTag = '[object Date]', - errorTag = '[object Error]', - mapTag = '[object Map]', - numberTag = '[object Number]', - regexpTag = '[object RegExp]', - setTag = '[object Set]', - stringTag = '[object String]', - symbolTag = '[object Symbol]'; - -var arrayBufferTag = '[object ArrayBuffer]', - dataViewTag = '[object DataView]'; - -/** Used to convert symbols to primitives and strings. */ -var symbolProto = Symbol ? Symbol.prototype : undefined, - symbolValueOf = symbolProto ? symbolProto.valueOf : undefined; - -/** - * A specialized version of `baseIsEqualDeep` for comparing objects of - * the same `toStringTag`. - * - * **Note:** This function only supports comparing values with tags of - * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. - * - * @private - * @param {Object} object The object to compare. - * @param {Object} other The other object to compare. - * @param {string} tag The `toStringTag` of the objects to compare. - * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. - * @param {Function} customizer The function to customize comparisons. - * @param {Function} equalFunc The function to determine equivalents of values. - * @param {Object} stack Tracks traversed `object` and `other` objects. - * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. - */ -function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) { - switch (tag) { - case dataViewTag: - if ((object.byteLength != other.byteLength) || - (object.byteOffset != other.byteOffset)) { - return false; - } - object = object.buffer; - other = other.buffer; - - case arrayBufferTag: - if ((object.byteLength != other.byteLength) || - !equalFunc(new Uint8Array(object), new Uint8Array(other))) { - return false; - } - return true; - - case boolTag: - case dateTag: - case numberTag: - // Coerce booleans to `1` or `0` and dates to milliseconds. - // Invalid dates are coerced to `NaN`. - return eq(+object, +other); - - case errorTag: - return object.name == other.name && object.message == other.message; - - case regexpTag: - case stringTag: - // Coerce regexes to strings and treat strings, primitives and objects, - // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring - // for more details. - return object == (other + ''); - - case mapTag: - var convert = mapToArray; - - case setTag: - var isPartial = bitmask & COMPARE_PARTIAL_FLAG; - convert || (convert = setToArray); - - if (object.size != other.size && !isPartial) { - return false; - } - // Assume cyclic values are equal. - var stacked = stack.get(object); - if (stacked) { - return stacked == other; - } - bitmask |= COMPARE_UNORDERED_FLAG; - - // Recursively compare objects (susceptible to call stack limits). - stack.set(object, other); - var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack); - stack['delete'](object); - return result; - - case symbolTag: - if (symbolValueOf) { - return symbolValueOf.call(object) == symbolValueOf.call(other); - } - } - return false; -} - -module.exports = equalByTag; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_equalObjects.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_equalObjects.js deleted file mode 100644 index cdaacd2d..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_equalObjects.js +++ /dev/null @@ -1,90 +0,0 @@ -var getAllKeys = require('./_getAllKeys'); - -/** Used to compose bitmasks for value comparisons. */ -var COMPARE_PARTIAL_FLAG = 1; - -/** Used for built-in method references. */ -var objectProto = Object.prototype; - -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; - -/** - * A specialized version of `baseIsEqualDeep` for objects with support for - * partial deep comparisons. - * - * @private - * @param {Object} object The object to compare. - * @param {Object} other The other object to compare. - * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. - * @param {Function} customizer The function to customize comparisons. - * @param {Function} equalFunc The function to determine equivalents of values. - * @param {Object} stack Tracks traversed `object` and `other` objects. - * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. - */ -function equalObjects(object, other, bitmask, customizer, equalFunc, stack) { - var isPartial = bitmask & COMPARE_PARTIAL_FLAG, - objProps = getAllKeys(object), - objLength = objProps.length, - othProps = getAllKeys(other), - othLength = othProps.length; - - if (objLength != othLength && !isPartial) { - return false; - } - var index = objLength; - while (index--) { - var key = objProps[index]; - if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) { - return false; - } - } - // Check that cyclic values are equal. - var objStacked = stack.get(object); - var othStacked = stack.get(other); - if (objStacked && othStacked) { - return objStacked == other && othStacked == object; - } - var result = true; - stack.set(object, other); - stack.set(other, object); - - var skipCtor = isPartial; - while (++index < objLength) { - key = objProps[index]; - var objValue = object[key], - othValue = other[key]; - - if (customizer) { - var compared = isPartial - ? customizer(othValue, objValue, key, other, object, stack) - : customizer(objValue, othValue, key, object, other, stack); - } - // Recursively compare objects (susceptible to call stack limits). - if (!(compared === undefined - ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack)) - : compared - )) { - result = false; - break; - } - skipCtor || (skipCtor = key == 'constructor'); - } - if (result && !skipCtor) { - var objCtor = object.constructor, - othCtor = other.constructor; - - // Non `Object` object instances with different constructors are not equal. - if (objCtor != othCtor && - ('constructor' in object && 'constructor' in other) && - !(typeof objCtor == 'function' && objCtor instanceof objCtor && - typeof othCtor == 'function' && othCtor instanceof othCtor)) { - result = false; - } - } - stack['delete'](object); - stack['delete'](other); - return result; -} - -module.exports = equalObjects; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_escapeHtmlChar.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_escapeHtmlChar.js deleted file mode 100644 index 7ca68ee6..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_escapeHtmlChar.js +++ /dev/null @@ -1,21 +0,0 @@ -var basePropertyOf = require('./_basePropertyOf'); - -/** Used to map characters to HTML entities. */ -var htmlEscapes = { - '&': '&', - '<': '<', - '>': '>', - '"': '"', - "'": ''' -}; - -/** - * Used by `_.escape` to convert characters to HTML entities. - * - * @private - * @param {string} chr The matched character to escape. - * @returns {string} Returns the escaped character. - */ -var escapeHtmlChar = basePropertyOf(htmlEscapes); - -module.exports = escapeHtmlChar; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_escapeStringChar.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_escapeStringChar.js deleted file mode 100644 index 44eca96c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_escapeStringChar.js +++ /dev/null @@ -1,22 +0,0 @@ -/** Used to escape characters for inclusion in compiled string literals. */ -var stringEscapes = { - '\\': '\\', - "'": "'", - '\n': 'n', - '\r': 'r', - '\u2028': 'u2028', - '\u2029': 'u2029' -}; - -/** - * Used by `_.template` to escape characters for inclusion in compiled string literals. - * - * @private - * @param {string} chr The matched character to escape. - * @returns {string} Returns the escaped character. - */ -function escapeStringChar(chr) { - return '\\' + stringEscapes[chr]; -} - -module.exports = escapeStringChar; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_flatRest.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_flatRest.js deleted file mode 100644 index 94ab6cca..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_flatRest.js +++ /dev/null @@ -1,16 +0,0 @@ -var flatten = require('./flatten'), - overRest = require('./_overRest'), - setToString = require('./_setToString'); - -/** - * A specialized version of `baseRest` which flattens the rest array. - * - * @private - * @param {Function} func The function to apply a rest parameter to. - * @returns {Function} Returns the new function. - */ -function flatRest(func) { - return setToString(overRest(func, undefined, flatten), func + ''); -} - -module.exports = flatRest; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_freeGlobal.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_freeGlobal.js deleted file mode 100644 index bbec998f..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_freeGlobal.js +++ /dev/null @@ -1,4 +0,0 @@ -/** Detect free variable `global` from Node.js. */ -var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; - -module.exports = freeGlobal; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_getAllKeys.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_getAllKeys.js deleted file mode 100644 index a9ce6995..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_getAllKeys.js +++ /dev/null @@ -1,16 +0,0 @@ -var baseGetAllKeys = require('./_baseGetAllKeys'), - getSymbols = require('./_getSymbols'), - keys = require('./keys'); - -/** - * Creates an array of own enumerable property names and symbols of `object`. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names and symbols. - */ -function getAllKeys(object) { - return baseGetAllKeys(object, keys, getSymbols); -} - -module.exports = getAllKeys; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_getAllKeysIn.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_getAllKeysIn.js deleted file mode 100644 index 1b466784..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_getAllKeysIn.js +++ /dev/null @@ -1,17 +0,0 @@ -var baseGetAllKeys = require('./_baseGetAllKeys'), - getSymbolsIn = require('./_getSymbolsIn'), - keysIn = require('./keysIn'); - -/** - * Creates an array of own and inherited enumerable property names and - * symbols of `object`. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names and symbols. - */ -function getAllKeysIn(object) { - return baseGetAllKeys(object, keysIn, getSymbolsIn); -} - -module.exports = getAllKeysIn; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_getData.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_getData.js deleted file mode 100644 index a1fe7b77..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_getData.js +++ /dev/null @@ -1,15 +0,0 @@ -var metaMap = require('./_metaMap'), - noop = require('./noop'); - -/** - * Gets metadata for `func`. - * - * @private - * @param {Function} func The function to query. - * @returns {*} Returns the metadata for `func`. - */ -var getData = !metaMap ? noop : function(func) { - return metaMap.get(func); -}; - -module.exports = getData; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_getFuncName.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_getFuncName.js deleted file mode 100644 index 21e15b33..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_getFuncName.js +++ /dev/null @@ -1,31 +0,0 @@ -var realNames = require('./_realNames'); - -/** Used for built-in method references. */ -var objectProto = Object.prototype; - -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; - -/** - * Gets the name of `func`. - * - * @private - * @param {Function} func The function to query. - * @returns {string} Returns the function name. - */ -function getFuncName(func) { - var result = (func.name + ''), - array = realNames[result], - length = hasOwnProperty.call(realNames, result) ? array.length : 0; - - while (length--) { - var data = array[length], - otherFunc = data.func; - if (otherFunc == null || otherFunc == func) { - return data.name; - } - } - return result; -} - -module.exports = getFuncName; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_getHolder.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_getHolder.js deleted file mode 100644 index 65e94b5c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_getHolder.js +++ /dev/null @@ -1,13 +0,0 @@ -/** - * Gets the argument placeholder value for `func`. - * - * @private - * @param {Function} func The function to inspect. - * @returns {*} Returns the placeholder value. - */ -function getHolder(func) { - var object = func; - return object.placeholder; -} - -module.exports = getHolder; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_getMapData.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_getMapData.js deleted file mode 100644 index 17f63032..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_getMapData.js +++ /dev/null @@ -1,18 +0,0 @@ -var isKeyable = require('./_isKeyable'); - -/** - * Gets the data for `map`. - * - * @private - * @param {Object} map The map to query. - * @param {string} key The reference key. - * @returns {*} Returns the map data. - */ -function getMapData(map, key) { - var data = map.__data__; - return isKeyable(key) - ? data[typeof key == 'string' ? 'string' : 'hash'] - : data.map; -} - -module.exports = getMapData; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_getMatchData.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_getMatchData.js deleted file mode 100644 index 2cc70f91..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_getMatchData.js +++ /dev/null @@ -1,24 +0,0 @@ -var isStrictComparable = require('./_isStrictComparable'), - keys = require('./keys'); - -/** - * Gets the property names, values, and compare flags of `object`. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the match data of `object`. - */ -function getMatchData(object) { - var result = keys(object), - length = result.length; - - while (length--) { - var key = result[length], - value = object[key]; - - result[length] = [key, value, isStrictComparable(value)]; - } - return result; -} - -module.exports = getMatchData; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_getNative.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_getNative.js deleted file mode 100644 index 97a622b8..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_getNative.js +++ /dev/null @@ -1,17 +0,0 @@ -var baseIsNative = require('./_baseIsNative'), - getValue = require('./_getValue'); - -/** - * Gets the native function at `key` of `object`. - * - * @private - * @param {Object} object The object to query. - * @param {string} key The key of the method to get. - * @returns {*} Returns the function if it's native, else `undefined`. - */ -function getNative(object, key) { - var value = getValue(object, key); - return baseIsNative(value) ? value : undefined; -} - -module.exports = getNative; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_getPrototype.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_getPrototype.js deleted file mode 100644 index e8086121..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_getPrototype.js +++ /dev/null @@ -1,6 +0,0 @@ -var overArg = require('./_overArg'); - -/** Built-in value references. */ -var getPrototype = overArg(Object.getPrototypeOf, Object); - -module.exports = getPrototype; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_getRawTag.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_getRawTag.js deleted file mode 100644 index 49a95c9c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_getRawTag.js +++ /dev/null @@ -1,46 +0,0 @@ -var Symbol = require('./_Symbol'); - -/** Used for built-in method references. */ -var objectProto = Object.prototype; - -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; - -/** - * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) - * of values. - */ -var nativeObjectToString = objectProto.toString; - -/** Built-in value references. */ -var symToStringTag = Symbol ? Symbol.toStringTag : undefined; - -/** - * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values. - * - * @private - * @param {*} value The value to query. - * @returns {string} Returns the raw `toStringTag`. - */ -function getRawTag(value) { - var isOwn = hasOwnProperty.call(value, symToStringTag), - tag = value[symToStringTag]; - - try { - value[symToStringTag] = undefined; - var unmasked = true; - } catch (e) {} - - var result = nativeObjectToString.call(value); - if (unmasked) { - if (isOwn) { - value[symToStringTag] = tag; - } else { - delete value[symToStringTag]; - } - } - return result; -} - -module.exports = getRawTag; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_getSymbols.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_getSymbols.js deleted file mode 100644 index 7d6eafeb..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_getSymbols.js +++ /dev/null @@ -1,30 +0,0 @@ -var arrayFilter = require('./_arrayFilter'), - stubArray = require('./stubArray'); - -/** Used for built-in method references. */ -var objectProto = Object.prototype; - -/** Built-in value references. */ -var propertyIsEnumerable = objectProto.propertyIsEnumerable; - -/* Built-in method references for those with the same name as other `lodash` methods. */ -var nativeGetSymbols = Object.getOwnPropertySymbols; - -/** - * Creates an array of the own enumerable symbols of `object`. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of symbols. - */ -var getSymbols = !nativeGetSymbols ? stubArray : function(object) { - if (object == null) { - return []; - } - object = Object(object); - return arrayFilter(nativeGetSymbols(object), function(symbol) { - return propertyIsEnumerable.call(object, symbol); - }); -}; - -module.exports = getSymbols; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_getSymbolsIn.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_getSymbolsIn.js deleted file mode 100644 index cec0855a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_getSymbolsIn.js +++ /dev/null @@ -1,25 +0,0 @@ -var arrayPush = require('./_arrayPush'), - getPrototype = require('./_getPrototype'), - getSymbols = require('./_getSymbols'), - stubArray = require('./stubArray'); - -/* Built-in method references for those with the same name as other `lodash` methods. */ -var nativeGetSymbols = Object.getOwnPropertySymbols; - -/** - * Creates an array of the own and inherited enumerable symbols of `object`. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of symbols. - */ -var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) { - var result = []; - while (object) { - arrayPush(result, getSymbols(object)); - object = getPrototype(object); - } - return result; -}; - -module.exports = getSymbolsIn; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_getTag.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_getTag.js deleted file mode 100644 index deaf89d5..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_getTag.js +++ /dev/null @@ -1,58 +0,0 @@ -var DataView = require('./_DataView'), - Map = require('./_Map'), - Promise = require('./_Promise'), - Set = require('./_Set'), - WeakMap = require('./_WeakMap'), - baseGetTag = require('./_baseGetTag'), - toSource = require('./_toSource'); - -/** `Object#toString` result references. */ -var mapTag = '[object Map]', - objectTag = '[object Object]', - promiseTag = '[object Promise]', - setTag = '[object Set]', - weakMapTag = '[object WeakMap]'; - -var dataViewTag = '[object DataView]'; - -/** Used to detect maps, sets, and weakmaps. */ -var dataViewCtorString = toSource(DataView), - mapCtorString = toSource(Map), - promiseCtorString = toSource(Promise), - setCtorString = toSource(Set), - weakMapCtorString = toSource(WeakMap); - -/** - * Gets the `toStringTag` of `value`. - * - * @private - * @param {*} value The value to query. - * @returns {string} Returns the `toStringTag`. - */ -var getTag = baseGetTag; - -// Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6. -if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) || - (Map && getTag(new Map) != mapTag) || - (Promise && getTag(Promise.resolve()) != promiseTag) || - (Set && getTag(new Set) != setTag) || - (WeakMap && getTag(new WeakMap) != weakMapTag)) { - getTag = function(value) { - var result = baseGetTag(value), - Ctor = result == objectTag ? value.constructor : undefined, - ctorString = Ctor ? toSource(Ctor) : ''; - - if (ctorString) { - switch (ctorString) { - case dataViewCtorString: return dataViewTag; - case mapCtorString: return mapTag; - case promiseCtorString: return promiseTag; - case setCtorString: return setTag; - case weakMapCtorString: return weakMapTag; - } - } - return result; - }; -} - -module.exports = getTag; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_getValue.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_getValue.js deleted file mode 100644 index 5f7d7736..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_getValue.js +++ /dev/null @@ -1,13 +0,0 @@ -/** - * Gets the value at `key` of `object`. - * - * @private - * @param {Object} [object] The object to query. - * @param {string} key The key of the property to get. - * @returns {*} Returns the property value. - */ -function getValue(object, key) { - return object == null ? undefined : object[key]; -} - -module.exports = getValue; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_getView.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_getView.js deleted file mode 100644 index df1e5d44..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_getView.js +++ /dev/null @@ -1,33 +0,0 @@ -/* Built-in method references for those with the same name as other `lodash` methods. */ -var nativeMax = Math.max, - nativeMin = Math.min; - -/** - * Gets the view, applying any `transforms` to the `start` and `end` positions. - * - * @private - * @param {number} start The start of the view. - * @param {number} end The end of the view. - * @param {Array} transforms The transformations to apply to the view. - * @returns {Object} Returns an object containing the `start` and `end` - * positions of the view. - */ -function getView(start, end, transforms) { - var index = -1, - length = transforms.length; - - while (++index < length) { - var data = transforms[index], - size = data.size; - - switch (data.type) { - case 'drop': start += size; break; - case 'dropRight': end -= size; break; - case 'take': end = nativeMin(end, start + size); break; - case 'takeRight': start = nativeMax(start, end - size); break; - } - } - return { 'start': start, 'end': end }; -} - -module.exports = getView; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_getWrapDetails.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_getWrapDetails.js deleted file mode 100644 index 3bcc6e48..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_getWrapDetails.js +++ /dev/null @@ -1,17 +0,0 @@ -/** Used to match wrap detail comments. */ -var reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/, - reSplitDetails = /,? & /; - -/** - * Extracts wrapper details from the `source` body comment. - * - * @private - * @param {string} source The source to inspect. - * @returns {Array} Returns the wrapper details. - */ -function getWrapDetails(source) { - var match = source.match(reWrapDetails); - return match ? match[1].split(reSplitDetails) : []; -} - -module.exports = getWrapDetails; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_hasPath.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_hasPath.js deleted file mode 100644 index 93dbde15..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_hasPath.js +++ /dev/null @@ -1,39 +0,0 @@ -var castPath = require('./_castPath'), - isArguments = require('./isArguments'), - isArray = require('./isArray'), - isIndex = require('./_isIndex'), - isLength = require('./isLength'), - toKey = require('./_toKey'); - -/** - * Checks if `path` exists on `object`. - * - * @private - * @param {Object} object The object to query. - * @param {Array|string} path The path to check. - * @param {Function} hasFunc The function to check properties. - * @returns {boolean} Returns `true` if `path` exists, else `false`. - */ -function hasPath(object, path, hasFunc) { - path = castPath(path, object); - - var index = -1, - length = path.length, - result = false; - - while (++index < length) { - var key = toKey(path[index]); - if (!(result = object != null && hasFunc(object, key))) { - break; - } - object = object[key]; - } - if (result || ++index != length) { - return result; - } - length = object == null ? 0 : object.length; - return !!length && isLength(length) && isIndex(key, length) && - (isArray(object) || isArguments(object)); -} - -module.exports = hasPath; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_hasUnicode.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_hasUnicode.js deleted file mode 100644 index cb6ca15f..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_hasUnicode.js +++ /dev/null @@ -1,26 +0,0 @@ -/** Used to compose unicode character classes. */ -var rsAstralRange = '\\ud800-\\udfff', - rsComboMarksRange = '\\u0300-\\u036f', - reComboHalfMarksRange = '\\ufe20-\\ufe2f', - rsComboSymbolsRange = '\\u20d0-\\u20ff', - rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange, - rsVarRange = '\\ufe0e\\ufe0f'; - -/** Used to compose unicode capture groups. */ -var rsZWJ = '\\u200d'; - -/** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */ -var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']'); - -/** - * Checks if `string` contains Unicode symbols. - * - * @private - * @param {string} string The string to inspect. - * @returns {boolean} Returns `true` if a symbol is found, else `false`. - */ -function hasUnicode(string) { - return reHasUnicode.test(string); -} - -module.exports = hasUnicode; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_hasUnicodeWord.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_hasUnicodeWord.js deleted file mode 100644 index 95d52c44..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_hasUnicodeWord.js +++ /dev/null @@ -1,15 +0,0 @@ -/** Used to detect strings that need a more robust regexp to match words. */ -var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/; - -/** - * Checks if `string` contains a word composed of Unicode symbols. - * - * @private - * @param {string} string The string to inspect. - * @returns {boolean} Returns `true` if a word is found, else `false`. - */ -function hasUnicodeWord(string) { - return reHasUnicodeWord.test(string); -} - -module.exports = hasUnicodeWord; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_hashClear.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_hashClear.js deleted file mode 100644 index 5d4b70cc..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_hashClear.js +++ /dev/null @@ -1,15 +0,0 @@ -var nativeCreate = require('./_nativeCreate'); - -/** - * Removes all key-value entries from the hash. - * - * @private - * @name clear - * @memberOf Hash - */ -function hashClear() { - this.__data__ = nativeCreate ? nativeCreate(null) : {}; - this.size = 0; -} - -module.exports = hashClear; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_hashDelete.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_hashDelete.js deleted file mode 100644 index ea9dabf1..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_hashDelete.js +++ /dev/null @@ -1,17 +0,0 @@ -/** - * Removes `key` and its value from the hash. - * - * @private - * @name delete - * @memberOf Hash - * @param {Object} hash The hash to modify. - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */ -function hashDelete(key) { - var result = this.has(key) && delete this.__data__[key]; - this.size -= result ? 1 : 0; - return result; -} - -module.exports = hashDelete; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_hashGet.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_hashGet.js deleted file mode 100644 index 1fc2f34b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_hashGet.js +++ /dev/null @@ -1,30 +0,0 @@ -var nativeCreate = require('./_nativeCreate'); - -/** Used to stand-in for `undefined` hash values. */ -var HASH_UNDEFINED = '__lodash_hash_undefined__'; - -/** Used for built-in method references. */ -var objectProto = Object.prototype; - -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; - -/** - * Gets the hash value for `key`. - * - * @private - * @name get - * @memberOf Hash - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ -function hashGet(key) { - var data = this.__data__; - if (nativeCreate) { - var result = data[key]; - return result === HASH_UNDEFINED ? undefined : result; - } - return hasOwnProperty.call(data, key) ? data[key] : undefined; -} - -module.exports = hashGet; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_hashHas.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_hashHas.js deleted file mode 100644 index 281a5517..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_hashHas.js +++ /dev/null @@ -1,23 +0,0 @@ -var nativeCreate = require('./_nativeCreate'); - -/** Used for built-in method references. */ -var objectProto = Object.prototype; - -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; - -/** - * Checks if a hash value for `key` exists. - * - * @private - * @name has - * @memberOf Hash - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ -function hashHas(key) { - var data = this.__data__; - return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key); -} - -module.exports = hashHas; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_hashSet.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_hashSet.js deleted file mode 100644 index e1055283..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_hashSet.js +++ /dev/null @@ -1,23 +0,0 @@ -var nativeCreate = require('./_nativeCreate'); - -/** Used to stand-in for `undefined` hash values. */ -var HASH_UNDEFINED = '__lodash_hash_undefined__'; - -/** - * Sets the hash `key` to `value`. - * - * @private - * @name set - * @memberOf Hash - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - * @returns {Object} Returns the hash instance. - */ -function hashSet(key, value) { - var data = this.__data__; - this.size += this.has(key) ? 0 : 1; - data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; - return this; -} - -module.exports = hashSet; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_initCloneArray.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_initCloneArray.js deleted file mode 100644 index 078c15af..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_initCloneArray.js +++ /dev/null @@ -1,26 +0,0 @@ -/** Used for built-in method references. */ -var objectProto = Object.prototype; - -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; - -/** - * Initializes an array clone. - * - * @private - * @param {Array} array The array to clone. - * @returns {Array} Returns the initialized clone. - */ -function initCloneArray(array) { - var length = array.length, - result = new array.constructor(length); - - // Add properties assigned by `RegExp#exec`. - if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) { - result.index = array.index; - result.input = array.input; - } - return result; -} - -module.exports = initCloneArray; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_initCloneByTag.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_initCloneByTag.js deleted file mode 100644 index f69a008c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_initCloneByTag.js +++ /dev/null @@ -1,77 +0,0 @@ -var cloneArrayBuffer = require('./_cloneArrayBuffer'), - cloneDataView = require('./_cloneDataView'), - cloneRegExp = require('./_cloneRegExp'), - cloneSymbol = require('./_cloneSymbol'), - cloneTypedArray = require('./_cloneTypedArray'); - -/** `Object#toString` result references. */ -var boolTag = '[object Boolean]', - dateTag = '[object Date]', - mapTag = '[object Map]', - numberTag = '[object Number]', - regexpTag = '[object RegExp]', - setTag = '[object Set]', - stringTag = '[object String]', - symbolTag = '[object Symbol]'; - -var arrayBufferTag = '[object ArrayBuffer]', - dataViewTag = '[object DataView]', - float32Tag = '[object Float32Array]', - float64Tag = '[object Float64Array]', - int8Tag = '[object Int8Array]', - int16Tag = '[object Int16Array]', - int32Tag = '[object Int32Array]', - uint8Tag = '[object Uint8Array]', - uint8ClampedTag = '[object Uint8ClampedArray]', - uint16Tag = '[object Uint16Array]', - uint32Tag = '[object Uint32Array]'; - -/** - * Initializes an object clone based on its `toStringTag`. - * - * **Note:** This function only supports cloning values with tags of - * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`. - * - * @private - * @param {Object} object The object to clone. - * @param {string} tag The `toStringTag` of the object to clone. - * @param {boolean} [isDeep] Specify a deep clone. - * @returns {Object} Returns the initialized clone. - */ -function initCloneByTag(object, tag, isDeep) { - var Ctor = object.constructor; - switch (tag) { - case arrayBufferTag: - return cloneArrayBuffer(object); - - case boolTag: - case dateTag: - return new Ctor(+object); - - case dataViewTag: - return cloneDataView(object, isDeep); - - case float32Tag: case float64Tag: - case int8Tag: case int16Tag: case int32Tag: - case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag: - return cloneTypedArray(object, isDeep); - - case mapTag: - return new Ctor; - - case numberTag: - case stringTag: - return new Ctor(object); - - case regexpTag: - return cloneRegExp(object); - - case setTag: - return new Ctor; - - case symbolTag: - return cloneSymbol(object); - } -} - -module.exports = initCloneByTag; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_initCloneObject.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_initCloneObject.js deleted file mode 100644 index 5a13e64a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_initCloneObject.js +++ /dev/null @@ -1,18 +0,0 @@ -var baseCreate = require('./_baseCreate'), - getPrototype = require('./_getPrototype'), - isPrototype = require('./_isPrototype'); - -/** - * Initializes an object clone. - * - * @private - * @param {Object} object The object to clone. - * @returns {Object} Returns the initialized clone. - */ -function initCloneObject(object) { - return (typeof object.constructor == 'function' && !isPrototype(object)) - ? baseCreate(getPrototype(object)) - : {}; -} - -module.exports = initCloneObject; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_insertWrapDetails.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_insertWrapDetails.js deleted file mode 100644 index e7908086..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_insertWrapDetails.js +++ /dev/null @@ -1,23 +0,0 @@ -/** Used to match wrap detail comments. */ -var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/; - -/** - * Inserts wrapper `details` in a comment at the top of the `source` body. - * - * @private - * @param {string} source The source to modify. - * @returns {Array} details The details to insert. - * @returns {string} Returns the modified source. - */ -function insertWrapDetails(source, details) { - var length = details.length; - if (!length) { - return source; - } - var lastIndex = length - 1; - details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex]; - details = details.join(length > 2 ? ', ' : ' '); - return source.replace(reWrapComment, '{\n/* [wrapped with ' + details + '] */\n'); -} - -module.exports = insertWrapDetails; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_isFlattenable.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_isFlattenable.js deleted file mode 100644 index 4cc2c249..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_isFlattenable.js +++ /dev/null @@ -1,20 +0,0 @@ -var Symbol = require('./_Symbol'), - isArguments = require('./isArguments'), - isArray = require('./isArray'); - -/** Built-in value references. */ -var spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined; - -/** - * Checks if `value` is a flattenable `arguments` object or array. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is flattenable, else `false`. - */ -function isFlattenable(value) { - return isArray(value) || isArguments(value) || - !!(spreadableSymbol && value && value[spreadableSymbol]); -} - -module.exports = isFlattenable; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_isIndex.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_isIndex.js deleted file mode 100644 index 061cd390..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_isIndex.js +++ /dev/null @@ -1,25 +0,0 @@ -/** Used as references for various `Number` constants. */ -var MAX_SAFE_INTEGER = 9007199254740991; - -/** Used to detect unsigned integer values. */ -var reIsUint = /^(?:0|[1-9]\d*)$/; - -/** - * Checks if `value` is a valid array-like index. - * - * @private - * @param {*} value The value to check. - * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. - * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. - */ -function isIndex(value, length) { - var type = typeof value; - length = length == null ? MAX_SAFE_INTEGER : length; - - return !!length && - (type == 'number' || - (type != 'symbol' && reIsUint.test(value))) && - (value > -1 && value % 1 == 0 && value < length); -} - -module.exports = isIndex; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_isIterateeCall.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_isIterateeCall.js deleted file mode 100644 index a0bb5a9c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_isIterateeCall.js +++ /dev/null @@ -1,30 +0,0 @@ -var eq = require('./eq'), - isArrayLike = require('./isArrayLike'), - isIndex = require('./_isIndex'), - isObject = require('./isObject'); - -/** - * Checks if the given arguments are from an iteratee call. - * - * @private - * @param {*} value The potential iteratee value argument. - * @param {*} index The potential iteratee index or key argument. - * @param {*} object The potential iteratee object argument. - * @returns {boolean} Returns `true` if the arguments are from an iteratee call, - * else `false`. - */ -function isIterateeCall(value, index, object) { - if (!isObject(object)) { - return false; - } - var type = typeof index; - if (type == 'number' - ? (isArrayLike(object) && isIndex(index, object.length)) - : (type == 'string' && index in object) - ) { - return eq(object[index], value); - } - return false; -} - -module.exports = isIterateeCall; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_isKey.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_isKey.js deleted file mode 100644 index ff08b068..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_isKey.js +++ /dev/null @@ -1,29 +0,0 @@ -var isArray = require('./isArray'), - isSymbol = require('./isSymbol'); - -/** Used to match property names within property paths. */ -var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, - reIsPlainProp = /^\w*$/; - -/** - * Checks if `value` is a property name and not a property path. - * - * @private - * @param {*} value The value to check. - * @param {Object} [object] The object to query keys on. - * @returns {boolean} Returns `true` if `value` is a property name, else `false`. - */ -function isKey(value, object) { - if (isArray(value)) { - return false; - } - var type = typeof value; - if (type == 'number' || type == 'symbol' || type == 'boolean' || - value == null || isSymbol(value)) { - return true; - } - return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || - (object != null && value in Object(object)); -} - -module.exports = isKey; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_isKeyable.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_isKeyable.js deleted file mode 100644 index 39f1828d..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_isKeyable.js +++ /dev/null @@ -1,15 +0,0 @@ -/** - * Checks if `value` is suitable for use as unique object key. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is suitable, else `false`. - */ -function isKeyable(value) { - var type = typeof value; - return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') - ? (value !== '__proto__') - : (value === null); -} - -module.exports = isKeyable; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_isLaziable.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_isLaziable.js deleted file mode 100644 index a57c4f2d..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_isLaziable.js +++ /dev/null @@ -1,28 +0,0 @@ -var LazyWrapper = require('./_LazyWrapper'), - getData = require('./_getData'), - getFuncName = require('./_getFuncName'), - lodash = require('./wrapperLodash'); - -/** - * Checks if `func` has a lazy counterpart. - * - * @private - * @param {Function} func The function to check. - * @returns {boolean} Returns `true` if `func` has a lazy counterpart, - * else `false`. - */ -function isLaziable(func) { - var funcName = getFuncName(func), - other = lodash[funcName]; - - if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) { - return false; - } - if (func === other) { - return true; - } - var data = getData(other); - return !!data && func === data[0]; -} - -module.exports = isLaziable; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_isMaskable.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_isMaskable.js deleted file mode 100644 index eb98d09f..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_isMaskable.js +++ /dev/null @@ -1,14 +0,0 @@ -var coreJsData = require('./_coreJsData'), - isFunction = require('./isFunction'), - stubFalse = require('./stubFalse'); - -/** - * Checks if `func` is capable of being masked. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `func` is maskable, else `false`. - */ -var isMaskable = coreJsData ? isFunction : stubFalse; - -module.exports = isMaskable; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_isMasked.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_isMasked.js deleted file mode 100644 index 4b0f21ba..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_isMasked.js +++ /dev/null @@ -1,20 +0,0 @@ -var coreJsData = require('./_coreJsData'); - -/** Used to detect methods masquerading as native. */ -var maskSrcKey = (function() { - var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); - return uid ? ('Symbol(src)_1.' + uid) : ''; -}()); - -/** - * Checks if `func` has its source masked. - * - * @private - * @param {Function} func The function to check. - * @returns {boolean} Returns `true` if `func` is masked, else `false`. - */ -function isMasked(func) { - return !!maskSrcKey && (maskSrcKey in func); -} - -module.exports = isMasked; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_isPrototype.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_isPrototype.js deleted file mode 100644 index 0f29498d..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_isPrototype.js +++ /dev/null @@ -1,18 +0,0 @@ -/** Used for built-in method references. */ -var objectProto = Object.prototype; - -/** - * Checks if `value` is likely a prototype object. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a prototype, else `false`. - */ -function isPrototype(value) { - var Ctor = value && value.constructor, - proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto; - - return value === proto; -} - -module.exports = isPrototype; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_isStrictComparable.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_isStrictComparable.js deleted file mode 100644 index b59f40b8..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_isStrictComparable.js +++ /dev/null @@ -1,15 +0,0 @@ -var isObject = require('./isObject'); - -/** - * Checks if `value` is suitable for strict equality comparisons, i.e. `===`. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` if suitable for strict - * equality comparisons, else `false`. - */ -function isStrictComparable(value) { - return value === value && !isObject(value); -} - -module.exports = isStrictComparable; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_iteratorToArray.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_iteratorToArray.js deleted file mode 100644 index 47685664..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_iteratorToArray.js +++ /dev/null @@ -1,18 +0,0 @@ -/** - * Converts `iterator` to an array. - * - * @private - * @param {Object} iterator The iterator to convert. - * @returns {Array} Returns the converted array. - */ -function iteratorToArray(iterator) { - var data, - result = []; - - while (!(data = iterator.next()).done) { - result.push(data.value); - } - return result; -} - -module.exports = iteratorToArray; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_lazyClone.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_lazyClone.js deleted file mode 100644 index d8a51f87..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_lazyClone.js +++ /dev/null @@ -1,23 +0,0 @@ -var LazyWrapper = require('./_LazyWrapper'), - copyArray = require('./_copyArray'); - -/** - * Creates a clone of the lazy wrapper object. - * - * @private - * @name clone - * @memberOf LazyWrapper - * @returns {Object} Returns the cloned `LazyWrapper` object. - */ -function lazyClone() { - var result = new LazyWrapper(this.__wrapped__); - result.__actions__ = copyArray(this.__actions__); - result.__dir__ = this.__dir__; - result.__filtered__ = this.__filtered__; - result.__iteratees__ = copyArray(this.__iteratees__); - result.__takeCount__ = this.__takeCount__; - result.__views__ = copyArray(this.__views__); - return result; -} - -module.exports = lazyClone; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_lazyReverse.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_lazyReverse.js deleted file mode 100644 index c5b52190..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_lazyReverse.js +++ /dev/null @@ -1,23 +0,0 @@ -var LazyWrapper = require('./_LazyWrapper'); - -/** - * Reverses the direction of lazy iteration. - * - * @private - * @name reverse - * @memberOf LazyWrapper - * @returns {Object} Returns the new reversed `LazyWrapper` object. - */ -function lazyReverse() { - if (this.__filtered__) { - var result = new LazyWrapper(this); - result.__dir__ = -1; - result.__filtered__ = true; - } else { - result = this.clone(); - result.__dir__ *= -1; - } - return result; -} - -module.exports = lazyReverse; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_lazyValue.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_lazyValue.js deleted file mode 100644 index 371ca8d2..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_lazyValue.js +++ /dev/null @@ -1,69 +0,0 @@ -var baseWrapperValue = require('./_baseWrapperValue'), - getView = require('./_getView'), - isArray = require('./isArray'); - -/** Used to indicate the type of lazy iteratees. */ -var LAZY_FILTER_FLAG = 1, - LAZY_MAP_FLAG = 2; - -/* Built-in method references for those with the same name as other `lodash` methods. */ -var nativeMin = Math.min; - -/** - * Extracts the unwrapped value from its lazy wrapper. - * - * @private - * @name value - * @memberOf LazyWrapper - * @returns {*} Returns the unwrapped value. - */ -function lazyValue() { - var array = this.__wrapped__.value(), - dir = this.__dir__, - isArr = isArray(array), - isRight = dir < 0, - arrLength = isArr ? array.length : 0, - view = getView(0, arrLength, this.__views__), - start = view.start, - end = view.end, - length = end - start, - index = isRight ? end : (start - 1), - iteratees = this.__iteratees__, - iterLength = iteratees.length, - resIndex = 0, - takeCount = nativeMin(length, this.__takeCount__); - - if (!isArr || (!isRight && arrLength == length && takeCount == length)) { - return baseWrapperValue(array, this.__actions__); - } - var result = []; - - outer: - while (length-- && resIndex < takeCount) { - index += dir; - - var iterIndex = -1, - value = array[index]; - - while (++iterIndex < iterLength) { - var data = iteratees[iterIndex], - iteratee = data.iteratee, - type = data.type, - computed = iteratee(value); - - if (type == LAZY_MAP_FLAG) { - value = computed; - } else if (!computed) { - if (type == LAZY_FILTER_FLAG) { - continue outer; - } else { - break outer; - } - } - } - result[resIndex++] = value; - } - return result; -} - -module.exports = lazyValue; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_listCacheClear.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_listCacheClear.js deleted file mode 100644 index acbe39a5..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_listCacheClear.js +++ /dev/null @@ -1,13 +0,0 @@ -/** - * Removes all key-value entries from the list cache. - * - * @private - * @name clear - * @memberOf ListCache - */ -function listCacheClear() { - this.__data__ = []; - this.size = 0; -} - -module.exports = listCacheClear; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_listCacheDelete.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_listCacheDelete.js deleted file mode 100644 index b1384ade..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_listCacheDelete.js +++ /dev/null @@ -1,35 +0,0 @@ -var assocIndexOf = require('./_assocIndexOf'); - -/** Used for built-in method references. */ -var arrayProto = Array.prototype; - -/** Built-in value references. */ -var splice = arrayProto.splice; - -/** - * Removes `key` and its value from the list cache. - * - * @private - * @name delete - * @memberOf ListCache - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */ -function listCacheDelete(key) { - var data = this.__data__, - index = assocIndexOf(data, key); - - if (index < 0) { - return false; - } - var lastIndex = data.length - 1; - if (index == lastIndex) { - data.pop(); - } else { - splice.call(data, index, 1); - } - --this.size; - return true; -} - -module.exports = listCacheDelete; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_listCacheGet.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_listCacheGet.js deleted file mode 100644 index f8192fc3..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_listCacheGet.js +++ /dev/null @@ -1,19 +0,0 @@ -var assocIndexOf = require('./_assocIndexOf'); - -/** - * Gets the list cache value for `key`. - * - * @private - * @name get - * @memberOf ListCache - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ -function listCacheGet(key) { - var data = this.__data__, - index = assocIndexOf(data, key); - - return index < 0 ? undefined : data[index][1]; -} - -module.exports = listCacheGet; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_listCacheHas.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_listCacheHas.js deleted file mode 100644 index 2adf6714..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_listCacheHas.js +++ /dev/null @@ -1,16 +0,0 @@ -var assocIndexOf = require('./_assocIndexOf'); - -/** - * Checks if a list cache value for `key` exists. - * - * @private - * @name has - * @memberOf ListCache - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ -function listCacheHas(key) { - return assocIndexOf(this.__data__, key) > -1; -} - -module.exports = listCacheHas; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_listCacheSet.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_listCacheSet.js deleted file mode 100644 index 5855c95e..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_listCacheSet.js +++ /dev/null @@ -1,26 +0,0 @@ -var assocIndexOf = require('./_assocIndexOf'); - -/** - * Sets the list cache `key` to `value`. - * - * @private - * @name set - * @memberOf ListCache - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - * @returns {Object} Returns the list cache instance. - */ -function listCacheSet(key, value) { - var data = this.__data__, - index = assocIndexOf(data, key); - - if (index < 0) { - ++this.size; - data.push([key, value]); - } else { - data[index][1] = value; - } - return this; -} - -module.exports = listCacheSet; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_mapCacheClear.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_mapCacheClear.js deleted file mode 100644 index bc9ca204..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_mapCacheClear.js +++ /dev/null @@ -1,21 +0,0 @@ -var Hash = require('./_Hash'), - ListCache = require('./_ListCache'), - Map = require('./_Map'); - -/** - * Removes all key-value entries from the map. - * - * @private - * @name clear - * @memberOf MapCache - */ -function mapCacheClear() { - this.size = 0; - this.__data__ = { - 'hash': new Hash, - 'map': new (Map || ListCache), - 'string': new Hash - }; -} - -module.exports = mapCacheClear; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_mapCacheDelete.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_mapCacheDelete.js deleted file mode 100644 index 946ca3c9..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_mapCacheDelete.js +++ /dev/null @@ -1,18 +0,0 @@ -var getMapData = require('./_getMapData'); - -/** - * Removes `key` and its value from the map. - * - * @private - * @name delete - * @memberOf MapCache - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */ -function mapCacheDelete(key) { - var result = getMapData(this, key)['delete'](key); - this.size -= result ? 1 : 0; - return result; -} - -module.exports = mapCacheDelete; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_mapCacheGet.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_mapCacheGet.js deleted file mode 100644 index f29f55cf..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_mapCacheGet.js +++ /dev/null @@ -1,16 +0,0 @@ -var getMapData = require('./_getMapData'); - -/** - * Gets the map value for `key`. - * - * @private - * @name get - * @memberOf MapCache - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ -function mapCacheGet(key) { - return getMapData(this, key).get(key); -} - -module.exports = mapCacheGet; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_mapCacheHas.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_mapCacheHas.js deleted file mode 100644 index a1214c02..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_mapCacheHas.js +++ /dev/null @@ -1,16 +0,0 @@ -var getMapData = require('./_getMapData'); - -/** - * Checks if a map value for `key` exists. - * - * @private - * @name has - * @memberOf MapCache - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ -function mapCacheHas(key) { - return getMapData(this, key).has(key); -} - -module.exports = mapCacheHas; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_mapCacheSet.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_mapCacheSet.js deleted file mode 100644 index 73468492..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_mapCacheSet.js +++ /dev/null @@ -1,22 +0,0 @@ -var getMapData = require('./_getMapData'); - -/** - * Sets the map `key` to `value`. - * - * @private - * @name set - * @memberOf MapCache - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - * @returns {Object} Returns the map cache instance. - */ -function mapCacheSet(key, value) { - var data = getMapData(this, key), - size = data.size; - - data.set(key, value); - this.size += data.size == size ? 0 : 1; - return this; -} - -module.exports = mapCacheSet; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_mapToArray.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_mapToArray.js deleted file mode 100644 index fe3dd531..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_mapToArray.js +++ /dev/null @@ -1,18 +0,0 @@ -/** - * Converts `map` to its key-value pairs. - * - * @private - * @param {Object} map The map to convert. - * @returns {Array} Returns the key-value pairs. - */ -function mapToArray(map) { - var index = -1, - result = Array(map.size); - - map.forEach(function(value, key) { - result[++index] = [key, value]; - }); - return result; -} - -module.exports = mapToArray; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_matchesStrictComparable.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_matchesStrictComparable.js deleted file mode 100644 index f608af9e..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_matchesStrictComparable.js +++ /dev/null @@ -1,20 +0,0 @@ -/** - * A specialized version of `matchesProperty` for source values suitable - * for strict equality comparisons, i.e. `===`. - * - * @private - * @param {string} key The key of the property to get. - * @param {*} srcValue The value to match. - * @returns {Function} Returns the new spec function. - */ -function matchesStrictComparable(key, srcValue) { - return function(object) { - if (object == null) { - return false; - } - return object[key] === srcValue && - (srcValue !== undefined || (key in Object(object))); - }; -} - -module.exports = matchesStrictComparable; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_memoizeCapped.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_memoizeCapped.js deleted file mode 100644 index 7f71c8fb..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_memoizeCapped.js +++ /dev/null @@ -1,26 +0,0 @@ -var memoize = require('./memoize'); - -/** Used as the maximum memoize cache size. */ -var MAX_MEMOIZE_SIZE = 500; - -/** - * A specialized version of `_.memoize` which clears the memoized function's - * cache when it exceeds `MAX_MEMOIZE_SIZE`. - * - * @private - * @param {Function} func The function to have its output memoized. - * @returns {Function} Returns the new memoized function. - */ -function memoizeCapped(func) { - var result = memoize(func, function(key) { - if (cache.size === MAX_MEMOIZE_SIZE) { - cache.clear(); - } - return key; - }); - - var cache = result.cache; - return result; -} - -module.exports = memoizeCapped; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_mergeData.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_mergeData.js deleted file mode 100644 index cb570f97..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_mergeData.js +++ /dev/null @@ -1,90 +0,0 @@ -var composeArgs = require('./_composeArgs'), - composeArgsRight = require('./_composeArgsRight'), - replaceHolders = require('./_replaceHolders'); - -/** Used as the internal argument placeholder. */ -var PLACEHOLDER = '__lodash_placeholder__'; - -/** Used to compose bitmasks for function metadata. */ -var WRAP_BIND_FLAG = 1, - WRAP_BIND_KEY_FLAG = 2, - WRAP_CURRY_BOUND_FLAG = 4, - WRAP_CURRY_FLAG = 8, - WRAP_ARY_FLAG = 128, - WRAP_REARG_FLAG = 256; - -/* Built-in method references for those with the same name as other `lodash` methods. */ -var nativeMin = Math.min; - -/** - * Merges the function metadata of `source` into `data`. - * - * Merging metadata reduces the number of wrappers used to invoke a function. - * This is possible because methods like `_.bind`, `_.curry`, and `_.partial` - * may be applied regardless of execution order. Methods like `_.ary` and - * `_.rearg` modify function arguments, making the order in which they are - * executed important, preventing the merging of metadata. However, we make - * an exception for a safe combined case where curried functions have `_.ary` - * and or `_.rearg` applied. - * - * @private - * @param {Array} data The destination metadata. - * @param {Array} source The source metadata. - * @returns {Array} Returns `data`. - */ -function mergeData(data, source) { - var bitmask = data[1], - srcBitmask = source[1], - newBitmask = bitmask | srcBitmask, - isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG); - - var isCombo = - ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) || - ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) || - ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG)); - - // Exit early if metadata can't be merged. - if (!(isCommon || isCombo)) { - return data; - } - // Use source `thisArg` if available. - if (srcBitmask & WRAP_BIND_FLAG) { - data[2] = source[2]; - // Set when currying a bound function. - newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG; - } - // Compose partial arguments. - var value = source[3]; - if (value) { - var partials = data[3]; - data[3] = partials ? composeArgs(partials, value, source[4]) : value; - data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4]; - } - // Compose partial right arguments. - value = source[5]; - if (value) { - partials = data[5]; - data[5] = partials ? composeArgsRight(partials, value, source[6]) : value; - data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6]; - } - // Use source `argPos` if available. - value = source[7]; - if (value) { - data[7] = value; - } - // Use source `ary` if it's smaller. - if (srcBitmask & WRAP_ARY_FLAG) { - data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]); - } - // Use source `arity` if one is not provided. - if (data[9] == null) { - data[9] = source[9]; - } - // Use source `func` and merge bitmasks. - data[0] = source[0]; - data[1] = newBitmask; - - return data; -} - -module.exports = mergeData; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_metaMap.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_metaMap.js deleted file mode 100644 index 0157a0b0..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_metaMap.js +++ /dev/null @@ -1,6 +0,0 @@ -var WeakMap = require('./_WeakMap'); - -/** Used to store function metadata. */ -var metaMap = WeakMap && new WeakMap; - -module.exports = metaMap; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_nativeCreate.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_nativeCreate.js deleted file mode 100644 index c7aede85..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_nativeCreate.js +++ /dev/null @@ -1,6 +0,0 @@ -var getNative = require('./_getNative'); - -/* Built-in method references that are verified to be native. */ -var nativeCreate = getNative(Object, 'create'); - -module.exports = nativeCreate; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_nativeKeys.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_nativeKeys.js deleted file mode 100644 index 479a104a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_nativeKeys.js +++ /dev/null @@ -1,6 +0,0 @@ -var overArg = require('./_overArg'); - -/* Built-in method references for those with the same name as other `lodash` methods. */ -var nativeKeys = overArg(Object.keys, Object); - -module.exports = nativeKeys; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_nativeKeysIn.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_nativeKeysIn.js deleted file mode 100644 index 00ee5059..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_nativeKeysIn.js +++ /dev/null @@ -1,20 +0,0 @@ -/** - * This function is like - * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) - * except that it includes inherited enumerable properties. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. - */ -function nativeKeysIn(object) { - var result = []; - if (object != null) { - for (var key in Object(object)) { - result.push(key); - } - } - return result; -} - -module.exports = nativeKeysIn; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_nodeUtil.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_nodeUtil.js deleted file mode 100644 index 983d78f7..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_nodeUtil.js +++ /dev/null @@ -1,30 +0,0 @@ -var freeGlobal = require('./_freeGlobal'); - -/** Detect free variable `exports`. */ -var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports; - -/** Detect free variable `module`. */ -var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module; - -/** Detect the popular CommonJS extension `module.exports`. */ -var moduleExports = freeModule && freeModule.exports === freeExports; - -/** Detect free variable `process` from Node.js. */ -var freeProcess = moduleExports && freeGlobal.process; - -/** Used to access faster Node.js helpers. */ -var nodeUtil = (function() { - try { - // Use `util.types` for Node.js 10+. - var types = freeModule && freeModule.require && freeModule.require('util').types; - - if (types) { - return types; - } - - // Legacy `process.binding('util')` for Node.js < 10. - return freeProcess && freeProcess.binding && freeProcess.binding('util'); - } catch (e) {} -}()); - -module.exports = nodeUtil; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_objectToString.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_objectToString.js deleted file mode 100644 index c614ec09..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_objectToString.js +++ /dev/null @@ -1,22 +0,0 @@ -/** Used for built-in method references. */ -var objectProto = Object.prototype; - -/** - * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) - * of values. - */ -var nativeObjectToString = objectProto.toString; - -/** - * Converts `value` to a string using `Object.prototype.toString`. - * - * @private - * @param {*} value The value to convert. - * @returns {string} Returns the converted string. - */ -function objectToString(value) { - return nativeObjectToString.call(value); -} - -module.exports = objectToString; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_overArg.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_overArg.js deleted file mode 100644 index 651c5c55..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_overArg.js +++ /dev/null @@ -1,15 +0,0 @@ -/** - * Creates a unary function that invokes `func` with its argument transformed. - * - * @private - * @param {Function} func The function to wrap. - * @param {Function} transform The argument transform. - * @returns {Function} Returns the new function. - */ -function overArg(func, transform) { - return function(arg) { - return func(transform(arg)); - }; -} - -module.exports = overArg; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_overRest.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_overRest.js deleted file mode 100644 index c7cdef33..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_overRest.js +++ /dev/null @@ -1,36 +0,0 @@ -var apply = require('./_apply'); - -/* Built-in method references for those with the same name as other `lodash` methods. */ -var nativeMax = Math.max; - -/** - * A specialized version of `baseRest` which transforms the rest array. - * - * @private - * @param {Function} func The function to apply a rest parameter to. - * @param {number} [start=func.length-1] The start position of the rest parameter. - * @param {Function} transform The rest array transform. - * @returns {Function} Returns the new function. - */ -function overRest(func, start, transform) { - start = nativeMax(start === undefined ? (func.length - 1) : start, 0); - return function() { - var args = arguments, - index = -1, - length = nativeMax(args.length - start, 0), - array = Array(length); - - while (++index < length) { - array[index] = args[start + index]; - } - index = -1; - var otherArgs = Array(start + 1); - while (++index < start) { - otherArgs[index] = args[index]; - } - otherArgs[start] = transform(array); - return apply(func, this, otherArgs); - }; -} - -module.exports = overRest; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_parent.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_parent.js deleted file mode 100644 index f174328f..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_parent.js +++ /dev/null @@ -1,16 +0,0 @@ -var baseGet = require('./_baseGet'), - baseSlice = require('./_baseSlice'); - -/** - * Gets the parent value at `path` of `object`. - * - * @private - * @param {Object} object The object to query. - * @param {Array} path The path to get the parent value of. - * @returns {*} Returns the parent value. - */ -function parent(object, path) { - return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1)); -} - -module.exports = parent; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_reEscape.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_reEscape.js deleted file mode 100644 index 7f47eda6..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_reEscape.js +++ /dev/null @@ -1,4 +0,0 @@ -/** Used to match template delimiters. */ -var reEscape = /<%-([\s\S]+?)%>/g; - -module.exports = reEscape; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_reEvaluate.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_reEvaluate.js deleted file mode 100644 index 6adfc312..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_reEvaluate.js +++ /dev/null @@ -1,4 +0,0 @@ -/** Used to match template delimiters. */ -var reEvaluate = /<%([\s\S]+?)%>/g; - -module.exports = reEvaluate; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_reInterpolate.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_reInterpolate.js deleted file mode 100644 index d02ff0b2..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_reInterpolate.js +++ /dev/null @@ -1,4 +0,0 @@ -/** Used to match template delimiters. */ -var reInterpolate = /<%=([\s\S]+?)%>/g; - -module.exports = reInterpolate; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_realNames.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_realNames.js deleted file mode 100644 index aa0d5292..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_realNames.js +++ /dev/null @@ -1,4 +0,0 @@ -/** Used to lookup unminified function names. */ -var realNames = {}; - -module.exports = realNames; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_reorder.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_reorder.js deleted file mode 100644 index a3502b05..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_reorder.js +++ /dev/null @@ -1,29 +0,0 @@ -var copyArray = require('./_copyArray'), - isIndex = require('./_isIndex'); - -/* Built-in method references for those with the same name as other `lodash` methods. */ -var nativeMin = Math.min; - -/** - * Reorder `array` according to the specified indexes where the element at - * the first index is assigned as the first element, the element at - * the second index is assigned as the second element, and so on. - * - * @private - * @param {Array} array The array to reorder. - * @param {Array} indexes The arranged array indexes. - * @returns {Array} Returns `array`. - */ -function reorder(array, indexes) { - var arrLength = array.length, - length = nativeMin(indexes.length, arrLength), - oldArray = copyArray(array); - - while (length--) { - var index = indexes[length]; - array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined; - } - return array; -} - -module.exports = reorder; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_replaceHolders.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_replaceHolders.js deleted file mode 100644 index 74360ec4..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_replaceHolders.js +++ /dev/null @@ -1,29 +0,0 @@ -/** Used as the internal argument placeholder. */ -var PLACEHOLDER = '__lodash_placeholder__'; - -/** - * Replaces all `placeholder` elements in `array` with an internal placeholder - * and returns an array of their indexes. - * - * @private - * @param {Array} array The array to modify. - * @param {*} placeholder The placeholder to replace. - * @returns {Array} Returns the new array of placeholder indexes. - */ -function replaceHolders(array, placeholder) { - var index = -1, - length = array.length, - resIndex = 0, - result = []; - - while (++index < length) { - var value = array[index]; - if (value === placeholder || value === PLACEHOLDER) { - array[index] = PLACEHOLDER; - result[resIndex++] = index; - } - } - return result; -} - -module.exports = replaceHolders; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_root.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_root.js deleted file mode 100644 index d2852bed..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_root.js +++ /dev/null @@ -1,9 +0,0 @@ -var freeGlobal = require('./_freeGlobal'); - -/** Detect free variable `self`. */ -var freeSelf = typeof self == 'object' && self && self.Object === Object && self; - -/** Used as a reference to the global object. */ -var root = freeGlobal || freeSelf || Function('return this')(); - -module.exports = root; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_safeGet.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_safeGet.js deleted file mode 100644 index b070897d..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_safeGet.js +++ /dev/null @@ -1,21 +0,0 @@ -/** - * Gets the value at `key`, unless `key` is "__proto__" or "constructor". - * - * @private - * @param {Object} object The object to query. - * @param {string} key The key of the property to get. - * @returns {*} Returns the property value. - */ -function safeGet(object, key) { - if (key === 'constructor' && typeof object[key] === 'function') { - return; - } - - if (key == '__proto__') { - return; - } - - return object[key]; -} - -module.exports = safeGet; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_setCacheAdd.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_setCacheAdd.js deleted file mode 100644 index 1081a744..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_setCacheAdd.js +++ /dev/null @@ -1,19 +0,0 @@ -/** Used to stand-in for `undefined` hash values. */ -var HASH_UNDEFINED = '__lodash_hash_undefined__'; - -/** - * Adds `value` to the array cache. - * - * @private - * @name add - * @memberOf SetCache - * @alias push - * @param {*} value The value to cache. - * @returns {Object} Returns the cache instance. - */ -function setCacheAdd(value) { - this.__data__.set(value, HASH_UNDEFINED); - return this; -} - -module.exports = setCacheAdd; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_setCacheHas.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_setCacheHas.js deleted file mode 100644 index 9a492556..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_setCacheHas.js +++ /dev/null @@ -1,14 +0,0 @@ -/** - * Checks if `value` is in the array cache. - * - * @private - * @name has - * @memberOf SetCache - * @param {*} value The value to search for. - * @returns {number} Returns `true` if `value` is found, else `false`. - */ -function setCacheHas(value) { - return this.__data__.has(value); -} - -module.exports = setCacheHas; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_setData.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_setData.js deleted file mode 100644 index e5cf3eb9..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_setData.js +++ /dev/null @@ -1,20 +0,0 @@ -var baseSetData = require('./_baseSetData'), - shortOut = require('./_shortOut'); - -/** - * Sets metadata for `func`. - * - * **Note:** If this function becomes hot, i.e. is invoked a lot in a short - * period of time, it will trip its breaker and transition to an identity - * function to avoid garbage collection pauses in V8. See - * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070) - * for more details. - * - * @private - * @param {Function} func The function to associate metadata with. - * @param {*} data The metadata. - * @returns {Function} Returns `func`. - */ -var setData = shortOut(baseSetData); - -module.exports = setData; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_setToArray.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_setToArray.js deleted file mode 100644 index b87f0741..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_setToArray.js +++ /dev/null @@ -1,18 +0,0 @@ -/** - * Converts `set` to an array of its values. - * - * @private - * @param {Object} set The set to convert. - * @returns {Array} Returns the values. - */ -function setToArray(set) { - var index = -1, - result = Array(set.size); - - set.forEach(function(value) { - result[++index] = value; - }); - return result; -} - -module.exports = setToArray; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_setToPairs.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_setToPairs.js deleted file mode 100644 index 36ad37a0..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_setToPairs.js +++ /dev/null @@ -1,18 +0,0 @@ -/** - * Converts `set` to its value-value pairs. - * - * @private - * @param {Object} set The set to convert. - * @returns {Array} Returns the value-value pairs. - */ -function setToPairs(set) { - var index = -1, - result = Array(set.size); - - set.forEach(function(value) { - result[++index] = [value, value]; - }); - return result; -} - -module.exports = setToPairs; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_setToString.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_setToString.js deleted file mode 100644 index 6ca84196..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_setToString.js +++ /dev/null @@ -1,14 +0,0 @@ -var baseSetToString = require('./_baseSetToString'), - shortOut = require('./_shortOut'); - -/** - * Sets the `toString` method of `func` to return `string`. - * - * @private - * @param {Function} func The function to modify. - * @param {Function} string The `toString` result. - * @returns {Function} Returns `func`. - */ -var setToString = shortOut(baseSetToString); - -module.exports = setToString; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_setWrapToString.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_setWrapToString.js deleted file mode 100644 index decdc449..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_setWrapToString.js +++ /dev/null @@ -1,21 +0,0 @@ -var getWrapDetails = require('./_getWrapDetails'), - insertWrapDetails = require('./_insertWrapDetails'), - setToString = require('./_setToString'), - updateWrapDetails = require('./_updateWrapDetails'); - -/** - * Sets the `toString` method of `wrapper` to mimic the source of `reference` - * with wrapper details in a comment at the top of the source body. - * - * @private - * @param {Function} wrapper The function to modify. - * @param {Function} reference The reference function. - * @param {number} bitmask The bitmask flags. See `createWrap` for more details. - * @returns {Function} Returns `wrapper`. - */ -function setWrapToString(wrapper, reference, bitmask) { - var source = (reference + ''); - return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask))); -} - -module.exports = setWrapToString; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_shortOut.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_shortOut.js deleted file mode 100644 index 3300a079..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_shortOut.js +++ /dev/null @@ -1,37 +0,0 @@ -/** Used to detect hot functions by number of calls within a span of milliseconds. */ -var HOT_COUNT = 800, - HOT_SPAN = 16; - -/* Built-in method references for those with the same name as other `lodash` methods. */ -var nativeNow = Date.now; - -/** - * Creates a function that'll short out and invoke `identity` instead - * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN` - * milliseconds. - * - * @private - * @param {Function} func The function to restrict. - * @returns {Function} Returns the new shortable function. - */ -function shortOut(func) { - var count = 0, - lastCalled = 0; - - return function() { - var stamp = nativeNow(), - remaining = HOT_SPAN - (stamp - lastCalled); - - lastCalled = stamp; - if (remaining > 0) { - if (++count >= HOT_COUNT) { - return arguments[0]; - } - } else { - count = 0; - } - return func.apply(undefined, arguments); - }; -} - -module.exports = shortOut; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_shuffleSelf.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_shuffleSelf.js deleted file mode 100644 index 8bcc4f5c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_shuffleSelf.js +++ /dev/null @@ -1,28 +0,0 @@ -var baseRandom = require('./_baseRandom'); - -/** - * A specialized version of `_.shuffle` which mutates and sets the size of `array`. - * - * @private - * @param {Array} array The array to shuffle. - * @param {number} [size=array.length] The size of `array`. - * @returns {Array} Returns `array`. - */ -function shuffleSelf(array, size) { - var index = -1, - length = array.length, - lastIndex = length - 1; - - size = size === undefined ? length : size; - while (++index < size) { - var rand = baseRandom(index, lastIndex), - value = array[rand]; - - array[rand] = array[index]; - array[index] = value; - } - array.length = size; - return array; -} - -module.exports = shuffleSelf; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_stackClear.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_stackClear.js deleted file mode 100644 index ce8e5a92..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_stackClear.js +++ /dev/null @@ -1,15 +0,0 @@ -var ListCache = require('./_ListCache'); - -/** - * Removes all key-value entries from the stack. - * - * @private - * @name clear - * @memberOf Stack - */ -function stackClear() { - this.__data__ = new ListCache; - this.size = 0; -} - -module.exports = stackClear; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_stackDelete.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_stackDelete.js deleted file mode 100644 index ff9887ab..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_stackDelete.js +++ /dev/null @@ -1,18 +0,0 @@ -/** - * Removes `key` and its value from the stack. - * - * @private - * @name delete - * @memberOf Stack - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */ -function stackDelete(key) { - var data = this.__data__, - result = data['delete'](key); - - this.size = data.size; - return result; -} - -module.exports = stackDelete; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_stackGet.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_stackGet.js deleted file mode 100644 index 1cdf0040..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_stackGet.js +++ /dev/null @@ -1,14 +0,0 @@ -/** - * Gets the stack value for `key`. - * - * @private - * @name get - * @memberOf Stack - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ -function stackGet(key) { - return this.__data__.get(key); -} - -module.exports = stackGet; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_stackHas.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_stackHas.js deleted file mode 100644 index 16a3ad11..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_stackHas.js +++ /dev/null @@ -1,14 +0,0 @@ -/** - * Checks if a stack value for `key` exists. - * - * @private - * @name has - * @memberOf Stack - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ -function stackHas(key) { - return this.__data__.has(key); -} - -module.exports = stackHas; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_stackSet.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_stackSet.js deleted file mode 100644 index b790ac5f..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_stackSet.js +++ /dev/null @@ -1,34 +0,0 @@ -var ListCache = require('./_ListCache'), - Map = require('./_Map'), - MapCache = require('./_MapCache'); - -/** Used as the size to enable large array optimizations. */ -var LARGE_ARRAY_SIZE = 200; - -/** - * Sets the stack `key` to `value`. - * - * @private - * @name set - * @memberOf Stack - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - * @returns {Object} Returns the stack cache instance. - */ -function stackSet(key, value) { - var data = this.__data__; - if (data instanceof ListCache) { - var pairs = data.__data__; - if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) { - pairs.push([key, value]); - this.size = ++data.size; - return this; - } - data = this.__data__ = new MapCache(pairs); - } - data.set(key, value); - this.size = data.size; - return this; -} - -module.exports = stackSet; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_strictIndexOf.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_strictIndexOf.js deleted file mode 100644 index 0486a495..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_strictIndexOf.js +++ /dev/null @@ -1,23 +0,0 @@ -/** - * A specialized version of `_.indexOf` which performs strict equality - * comparisons of values, i.e. `===`. - * - * @private - * @param {Array} array The array to inspect. - * @param {*} value The value to search for. - * @param {number} fromIndex The index to search from. - * @returns {number} Returns the index of the matched value, else `-1`. - */ -function strictIndexOf(array, value, fromIndex) { - var index = fromIndex - 1, - length = array.length; - - while (++index < length) { - if (array[index] === value) { - return index; - } - } - return -1; -} - -module.exports = strictIndexOf; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_strictLastIndexOf.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_strictLastIndexOf.js deleted file mode 100644 index d7310dcc..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_strictLastIndexOf.js +++ /dev/null @@ -1,21 +0,0 @@ -/** - * A specialized version of `_.lastIndexOf` which performs strict equality - * comparisons of values, i.e. `===`. - * - * @private - * @param {Array} array The array to inspect. - * @param {*} value The value to search for. - * @param {number} fromIndex The index to search from. - * @returns {number} Returns the index of the matched value, else `-1`. - */ -function strictLastIndexOf(array, value, fromIndex) { - var index = fromIndex + 1; - while (index--) { - if (array[index] === value) { - return index; - } - } - return index; -} - -module.exports = strictLastIndexOf; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_stringSize.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_stringSize.js deleted file mode 100644 index 17ef462a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_stringSize.js +++ /dev/null @@ -1,18 +0,0 @@ -var asciiSize = require('./_asciiSize'), - hasUnicode = require('./_hasUnicode'), - unicodeSize = require('./_unicodeSize'); - -/** - * Gets the number of symbols in `string`. - * - * @private - * @param {string} string The string to inspect. - * @returns {number} Returns the string size. - */ -function stringSize(string) { - return hasUnicode(string) - ? unicodeSize(string) - : asciiSize(string); -} - -module.exports = stringSize; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_stringToArray.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_stringToArray.js deleted file mode 100644 index d161158c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_stringToArray.js +++ /dev/null @@ -1,18 +0,0 @@ -var asciiToArray = require('./_asciiToArray'), - hasUnicode = require('./_hasUnicode'), - unicodeToArray = require('./_unicodeToArray'); - -/** - * Converts `string` to an array. - * - * @private - * @param {string} string The string to convert. - * @returns {Array} Returns the converted array. - */ -function stringToArray(string) { - return hasUnicode(string) - ? unicodeToArray(string) - : asciiToArray(string); -} - -module.exports = stringToArray; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_stringToPath.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_stringToPath.js deleted file mode 100644 index 8f39f8a2..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_stringToPath.js +++ /dev/null @@ -1,27 +0,0 @@ -var memoizeCapped = require('./_memoizeCapped'); - -/** Used to match property names within property paths. */ -var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; - -/** Used to match backslashes in property paths. */ -var reEscapeChar = /\\(\\)?/g; - -/** - * Converts `string` to a property path array. - * - * @private - * @param {string} string The string to convert. - * @returns {Array} Returns the property path array. - */ -var stringToPath = memoizeCapped(function(string) { - var result = []; - if (string.charCodeAt(0) === 46 /* . */) { - result.push(''); - } - string.replace(rePropName, function(match, number, quote, subString) { - result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match)); - }); - return result; -}); - -module.exports = stringToPath; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_toKey.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_toKey.js deleted file mode 100644 index c6d645c4..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_toKey.js +++ /dev/null @@ -1,21 +0,0 @@ -var isSymbol = require('./isSymbol'); - -/** Used as references for various `Number` constants. */ -var INFINITY = 1 / 0; - -/** - * Converts `value` to a string key if it's not a string or symbol. - * - * @private - * @param {*} value The value to inspect. - * @returns {string|symbol} Returns the key. - */ -function toKey(value) { - if (typeof value == 'string' || isSymbol(value)) { - return value; - } - var result = (value + ''); - return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; -} - -module.exports = toKey; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_toSource.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_toSource.js deleted file mode 100644 index a020b386..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_toSource.js +++ /dev/null @@ -1,26 +0,0 @@ -/** Used for built-in method references. */ -var funcProto = Function.prototype; - -/** Used to resolve the decompiled source of functions. */ -var funcToString = funcProto.toString; - -/** - * Converts `func` to its source code. - * - * @private - * @param {Function} func The function to convert. - * @returns {string} Returns the source code. - */ -function toSource(func) { - if (func != null) { - try { - return funcToString.call(func); - } catch (e) {} - try { - return (func + ''); - } catch (e) {} - } - return ''; -} - -module.exports = toSource; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_trimmedEndIndex.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_trimmedEndIndex.js deleted file mode 100644 index 139439ad..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_trimmedEndIndex.js +++ /dev/null @@ -1,19 +0,0 @@ -/** Used to match a single whitespace character. */ -var reWhitespace = /\s/; - -/** - * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace - * character of `string`. - * - * @private - * @param {string} string The string to inspect. - * @returns {number} Returns the index of the last non-whitespace character. - */ -function trimmedEndIndex(string) { - var index = string.length; - - while (index-- && reWhitespace.test(string.charAt(index))) {} - return index; -} - -module.exports = trimmedEndIndex; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_unescapeHtmlChar.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_unescapeHtmlChar.js deleted file mode 100644 index a71fecb3..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_unescapeHtmlChar.js +++ /dev/null @@ -1,21 +0,0 @@ -var basePropertyOf = require('./_basePropertyOf'); - -/** Used to map HTML entities to characters. */ -var htmlUnescapes = { - '&': '&', - '<': '<', - '>': '>', - '"': '"', - ''': "'" -}; - -/** - * Used by `_.unescape` to convert HTML entities to characters. - * - * @private - * @param {string} chr The matched character to unescape. - * @returns {string} Returns the unescaped character. - */ -var unescapeHtmlChar = basePropertyOf(htmlUnescapes); - -module.exports = unescapeHtmlChar; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_unicodeSize.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_unicodeSize.js deleted file mode 100644 index 68137ec2..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_unicodeSize.js +++ /dev/null @@ -1,44 +0,0 @@ -/** Used to compose unicode character classes. */ -var rsAstralRange = '\\ud800-\\udfff', - rsComboMarksRange = '\\u0300-\\u036f', - reComboHalfMarksRange = '\\ufe20-\\ufe2f', - rsComboSymbolsRange = '\\u20d0-\\u20ff', - rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange, - rsVarRange = '\\ufe0e\\ufe0f'; - -/** Used to compose unicode capture groups. */ -var rsAstral = '[' + rsAstralRange + ']', - rsCombo = '[' + rsComboRange + ']', - rsFitz = '\\ud83c[\\udffb-\\udfff]', - rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')', - rsNonAstral = '[^' + rsAstralRange + ']', - rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}', - rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]', - rsZWJ = '\\u200d'; - -/** Used to compose unicode regexes. */ -var reOptMod = rsModifier + '?', - rsOptVar = '[' + rsVarRange + ']?', - rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*', - rsSeq = rsOptVar + reOptMod + rsOptJoin, - rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')'; - -/** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */ -var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g'); - -/** - * Gets the size of a Unicode `string`. - * - * @private - * @param {string} string The string inspect. - * @returns {number} Returns the string size. - */ -function unicodeSize(string) { - var result = reUnicode.lastIndex = 0; - while (reUnicode.test(string)) { - ++result; - } - return result; -} - -module.exports = unicodeSize; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_unicodeToArray.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_unicodeToArray.js deleted file mode 100644 index 2a725c06..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_unicodeToArray.js +++ /dev/null @@ -1,40 +0,0 @@ -/** Used to compose unicode character classes. */ -var rsAstralRange = '\\ud800-\\udfff', - rsComboMarksRange = '\\u0300-\\u036f', - reComboHalfMarksRange = '\\ufe20-\\ufe2f', - rsComboSymbolsRange = '\\u20d0-\\u20ff', - rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange, - rsVarRange = '\\ufe0e\\ufe0f'; - -/** Used to compose unicode capture groups. */ -var rsAstral = '[' + rsAstralRange + ']', - rsCombo = '[' + rsComboRange + ']', - rsFitz = '\\ud83c[\\udffb-\\udfff]', - rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')', - rsNonAstral = '[^' + rsAstralRange + ']', - rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}', - rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]', - rsZWJ = '\\u200d'; - -/** Used to compose unicode regexes. */ -var reOptMod = rsModifier + '?', - rsOptVar = '[' + rsVarRange + ']?', - rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*', - rsSeq = rsOptVar + reOptMod + rsOptJoin, - rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')'; - -/** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */ -var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g'); - -/** - * Converts a Unicode `string` to an array. - * - * @private - * @param {string} string The string to convert. - * @returns {Array} Returns the converted array. - */ -function unicodeToArray(string) { - return string.match(reUnicode) || []; -} - -module.exports = unicodeToArray; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_unicodeWords.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_unicodeWords.js deleted file mode 100644 index e72e6e0f..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_unicodeWords.js +++ /dev/null @@ -1,69 +0,0 @@ -/** Used to compose unicode character classes. */ -var rsAstralRange = '\\ud800-\\udfff', - rsComboMarksRange = '\\u0300-\\u036f', - reComboHalfMarksRange = '\\ufe20-\\ufe2f', - rsComboSymbolsRange = '\\u20d0-\\u20ff', - rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange, - rsDingbatRange = '\\u2700-\\u27bf', - rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff', - rsMathOpRange = '\\xac\\xb1\\xd7\\xf7', - rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf', - rsPunctuationRange = '\\u2000-\\u206f', - rsSpaceRange = ' \\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', - rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde', - rsVarRange = '\\ufe0e\\ufe0f', - rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange; - -/** Used to compose unicode capture groups. */ -var rsApos = "['\u2019]", - rsBreak = '[' + rsBreakRange + ']', - rsCombo = '[' + rsComboRange + ']', - rsDigits = '\\d+', - rsDingbat = '[' + rsDingbatRange + ']', - rsLower = '[' + rsLowerRange + ']', - rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']', - rsFitz = '\\ud83c[\\udffb-\\udfff]', - rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')', - rsNonAstral = '[^' + rsAstralRange + ']', - rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}', - rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]', - rsUpper = '[' + rsUpperRange + ']', - rsZWJ = '\\u200d'; - -/** Used to compose unicode regexes. */ -var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')', - rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')', - rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?', - rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?', - reOptMod = rsModifier + '?', - rsOptVar = '[' + rsVarRange + ']?', - rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*', - rsOrdLower = '\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])', - rsOrdUpper = '\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])', - rsSeq = rsOptVar + reOptMod + rsOptJoin, - rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq; - -/** Used to match complex or compound words. */ -var reUnicodeWord = RegExp([ - rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')', - rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')', - rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower, - rsUpper + '+' + rsOptContrUpper, - rsOrdUpper, - rsOrdLower, - rsDigits, - rsEmoji -].join('|'), 'g'); - -/** - * Splits a Unicode `string` into an array of its words. - * - * @private - * @param {string} The string to inspect. - * @returns {Array} Returns the words of `string`. - */ -function unicodeWords(string) { - return string.match(reUnicodeWord) || []; -} - -module.exports = unicodeWords; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_updateWrapDetails.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_updateWrapDetails.js deleted file mode 100644 index 8759fbdf..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_updateWrapDetails.js +++ /dev/null @@ -1,46 +0,0 @@ -var arrayEach = require('./_arrayEach'), - arrayIncludes = require('./_arrayIncludes'); - -/** Used to compose bitmasks for function metadata. */ -var WRAP_BIND_FLAG = 1, - WRAP_BIND_KEY_FLAG = 2, - WRAP_CURRY_FLAG = 8, - WRAP_CURRY_RIGHT_FLAG = 16, - WRAP_PARTIAL_FLAG = 32, - WRAP_PARTIAL_RIGHT_FLAG = 64, - WRAP_ARY_FLAG = 128, - WRAP_REARG_FLAG = 256, - WRAP_FLIP_FLAG = 512; - -/** Used to associate wrap methods with their bit flags. */ -var wrapFlags = [ - ['ary', WRAP_ARY_FLAG], - ['bind', WRAP_BIND_FLAG], - ['bindKey', WRAP_BIND_KEY_FLAG], - ['curry', WRAP_CURRY_FLAG], - ['curryRight', WRAP_CURRY_RIGHT_FLAG], - ['flip', WRAP_FLIP_FLAG], - ['partial', WRAP_PARTIAL_FLAG], - ['partialRight', WRAP_PARTIAL_RIGHT_FLAG], - ['rearg', WRAP_REARG_FLAG] -]; - -/** - * Updates wrapper `details` based on `bitmask` flags. - * - * @private - * @returns {Array} details The details to modify. - * @param {number} bitmask The bitmask flags. See `createWrap` for more details. - * @returns {Array} Returns `details`. - */ -function updateWrapDetails(details, bitmask) { - arrayEach(wrapFlags, function(pair) { - var value = '_.' + pair[0]; - if ((bitmask & pair[1]) && !arrayIncludes(details, value)) { - details.push(value); - } - }); - return details.sort(); -} - -module.exports = updateWrapDetails; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_wrapperClone.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_wrapperClone.js deleted file mode 100644 index 7bb58a2e..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/_wrapperClone.js +++ /dev/null @@ -1,23 +0,0 @@ -var LazyWrapper = require('./_LazyWrapper'), - LodashWrapper = require('./_LodashWrapper'), - copyArray = require('./_copyArray'); - -/** - * Creates a clone of `wrapper`. - * - * @private - * @param {Object} wrapper The wrapper to clone. - * @returns {Object} Returns the cloned wrapper. - */ -function wrapperClone(wrapper) { - if (wrapper instanceof LazyWrapper) { - return wrapper.clone(); - } - var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__); - result.__actions__ = copyArray(wrapper.__actions__); - result.__index__ = wrapper.__index__; - result.__values__ = wrapper.__values__; - return result; -} - -module.exports = wrapperClone; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/add.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/add.js deleted file mode 100644 index f0695156..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/add.js +++ /dev/null @@ -1,22 +0,0 @@ -var createMathOperation = require('./_createMathOperation'); - -/** - * Adds two numbers. - * - * @static - * @memberOf _ - * @since 3.4.0 - * @category Math - * @param {number} augend The first number in an addition. - * @param {number} addend The second number in an addition. - * @returns {number} Returns the total. - * @example - * - * _.add(6, 4); - * // => 10 - */ -var add = createMathOperation(function(augend, addend) { - return augend + addend; -}, 0); - -module.exports = add; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/after.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/after.js deleted file mode 100644 index 3900c979..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/after.js +++ /dev/null @@ -1,42 +0,0 @@ -var toInteger = require('./toInteger'); - -/** Error message constants. */ -var FUNC_ERROR_TEXT = 'Expected a function'; - -/** - * The opposite of `_.before`; this method creates a function that invokes - * `func` once it's called `n` or more times. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Function - * @param {number} n The number of calls before `func` is invoked. - * @param {Function} func The function to restrict. - * @returns {Function} Returns the new restricted function. - * @example - * - * var saves = ['profile', 'settings']; - * - * var done = _.after(saves.length, function() { - * console.log('done saving!'); - * }); - * - * _.forEach(saves, function(type) { - * asyncSave({ 'type': type, 'complete': done }); - * }); - * // => Logs 'done saving!' after the two async saves have completed. - */ -function after(n, func) { - if (typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - n = toInteger(n); - return function() { - if (--n < 1) { - return func.apply(this, arguments); - } - }; -} - -module.exports = after; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/array.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/array.js deleted file mode 100644 index af688d3e..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/array.js +++ /dev/null @@ -1,67 +0,0 @@ -module.exports = { - 'chunk': require('./chunk'), - 'compact': require('./compact'), - 'concat': require('./concat'), - 'difference': require('./difference'), - 'differenceBy': require('./differenceBy'), - 'differenceWith': require('./differenceWith'), - 'drop': require('./drop'), - 'dropRight': require('./dropRight'), - 'dropRightWhile': require('./dropRightWhile'), - 'dropWhile': require('./dropWhile'), - 'fill': require('./fill'), - 'findIndex': require('./findIndex'), - 'findLastIndex': require('./findLastIndex'), - 'first': require('./first'), - 'flatten': require('./flatten'), - 'flattenDeep': require('./flattenDeep'), - 'flattenDepth': require('./flattenDepth'), - 'fromPairs': require('./fromPairs'), - 'head': require('./head'), - 'indexOf': require('./indexOf'), - 'initial': require('./initial'), - 'intersection': require('./intersection'), - 'intersectionBy': require('./intersectionBy'), - 'intersectionWith': require('./intersectionWith'), - 'join': require('./join'), - 'last': require('./last'), - 'lastIndexOf': require('./lastIndexOf'), - 'nth': require('./nth'), - 'pull': require('./pull'), - 'pullAll': require('./pullAll'), - 'pullAllBy': require('./pullAllBy'), - 'pullAllWith': require('./pullAllWith'), - 'pullAt': require('./pullAt'), - 'remove': require('./remove'), - 'reverse': require('./reverse'), - 'slice': require('./slice'), - 'sortedIndex': require('./sortedIndex'), - 'sortedIndexBy': require('./sortedIndexBy'), - 'sortedIndexOf': require('./sortedIndexOf'), - 'sortedLastIndex': require('./sortedLastIndex'), - 'sortedLastIndexBy': require('./sortedLastIndexBy'), - 'sortedLastIndexOf': require('./sortedLastIndexOf'), - 'sortedUniq': require('./sortedUniq'), - 'sortedUniqBy': require('./sortedUniqBy'), - 'tail': require('./tail'), - 'take': require('./take'), - 'takeRight': require('./takeRight'), - 'takeRightWhile': require('./takeRightWhile'), - 'takeWhile': require('./takeWhile'), - 'union': require('./union'), - 'unionBy': require('./unionBy'), - 'unionWith': require('./unionWith'), - 'uniq': require('./uniq'), - 'uniqBy': require('./uniqBy'), - 'uniqWith': require('./uniqWith'), - 'unzip': require('./unzip'), - 'unzipWith': require('./unzipWith'), - 'without': require('./without'), - 'xor': require('./xor'), - 'xorBy': require('./xorBy'), - 'xorWith': require('./xorWith'), - 'zip': require('./zip'), - 'zipObject': require('./zipObject'), - 'zipObjectDeep': require('./zipObjectDeep'), - 'zipWith': require('./zipWith') -}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/ary.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/ary.js deleted file mode 100644 index 70c87d09..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/ary.js +++ /dev/null @@ -1,29 +0,0 @@ -var createWrap = require('./_createWrap'); - -/** Used to compose bitmasks for function metadata. */ -var WRAP_ARY_FLAG = 128; - -/** - * Creates a function that invokes `func`, with up to `n` arguments, - * ignoring any additional arguments. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Function - * @param {Function} func The function to cap arguments for. - * @param {number} [n=func.length] The arity cap. - * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. - * @returns {Function} Returns the new capped function. - * @example - * - * _.map(['6', '8', '10'], _.ary(parseInt, 1)); - * // => [6, 8, 10] - */ -function ary(func, n, guard) { - n = guard ? undefined : n; - n = (func && n == null) ? func.length : n; - return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n); -} - -module.exports = ary; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/assign.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/assign.js deleted file mode 100644 index 909db26a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/assign.js +++ /dev/null @@ -1,58 +0,0 @@ -var assignValue = require('./_assignValue'), - copyObject = require('./_copyObject'), - createAssigner = require('./_createAssigner'), - isArrayLike = require('./isArrayLike'), - isPrototype = require('./_isPrototype'), - keys = require('./keys'); - -/** Used for built-in method references. */ -var objectProto = Object.prototype; - -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; - -/** - * Assigns own enumerable string keyed properties of source objects to the - * destination object. Source objects are applied from left to right. - * Subsequent sources overwrite property assignments of previous sources. - * - * **Note:** This method mutates `object` and is loosely based on - * [`Object.assign`](https://mdn.io/Object/assign). - * - * @static - * @memberOf _ - * @since 0.10.0 - * @category Object - * @param {Object} object The destination object. - * @param {...Object} [sources] The source objects. - * @returns {Object} Returns `object`. - * @see _.assignIn - * @example - * - * function Foo() { - * this.a = 1; - * } - * - * function Bar() { - * this.c = 3; - * } - * - * Foo.prototype.b = 2; - * Bar.prototype.d = 4; - * - * _.assign({ 'a': 0 }, new Foo, new Bar); - * // => { 'a': 1, 'c': 3 } - */ -var assign = createAssigner(function(object, source) { - if (isPrototype(source) || isArrayLike(source)) { - copyObject(source, keys(source), object); - return; - } - for (var key in source) { - if (hasOwnProperty.call(source, key)) { - assignValue(object, key, source[key]); - } - } -}); - -module.exports = assign; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/assignIn.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/assignIn.js deleted file mode 100644 index e663473a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/assignIn.js +++ /dev/null @@ -1,40 +0,0 @@ -var copyObject = require('./_copyObject'), - createAssigner = require('./_createAssigner'), - keysIn = require('./keysIn'); - -/** - * This method is like `_.assign` except that it iterates over own and - * inherited source properties. - * - * **Note:** This method mutates `object`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @alias extend - * @category Object - * @param {Object} object The destination object. - * @param {...Object} [sources] The source objects. - * @returns {Object} Returns `object`. - * @see _.assign - * @example - * - * function Foo() { - * this.a = 1; - * } - * - * function Bar() { - * this.c = 3; - * } - * - * Foo.prototype.b = 2; - * Bar.prototype.d = 4; - * - * _.assignIn({ 'a': 0 }, new Foo, new Bar); - * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 } - */ -var assignIn = createAssigner(function(object, source) { - copyObject(source, keysIn(source), object); -}); - -module.exports = assignIn; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/assignInWith.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/assignInWith.js deleted file mode 100644 index 68fcc0b0..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/assignInWith.js +++ /dev/null @@ -1,38 +0,0 @@ -var copyObject = require('./_copyObject'), - createAssigner = require('./_createAssigner'), - keysIn = require('./keysIn'); - -/** - * This method is like `_.assignIn` except that it accepts `customizer` - * which is invoked to produce the assigned values. If `customizer` returns - * `undefined`, assignment is handled by the method instead. The `customizer` - * is invoked with five arguments: (objValue, srcValue, key, object, source). - * - * **Note:** This method mutates `object`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @alias extendWith - * @category Object - * @param {Object} object The destination object. - * @param {...Object} sources The source objects. - * @param {Function} [customizer] The function to customize assigned values. - * @returns {Object} Returns `object`. - * @see _.assignWith - * @example - * - * function customizer(objValue, srcValue) { - * return _.isUndefined(objValue) ? srcValue : objValue; - * } - * - * var defaults = _.partialRight(_.assignInWith, customizer); - * - * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); - * // => { 'a': 1, 'b': 2 } - */ -var assignInWith = createAssigner(function(object, source, srcIndex, customizer) { - copyObject(source, keysIn(source), object, customizer); -}); - -module.exports = assignInWith; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/assignWith.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/assignWith.js deleted file mode 100644 index 7dc6c761..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/assignWith.js +++ /dev/null @@ -1,37 +0,0 @@ -var copyObject = require('./_copyObject'), - createAssigner = require('./_createAssigner'), - keys = require('./keys'); - -/** - * This method is like `_.assign` except that it accepts `customizer` - * which is invoked to produce the assigned values. If `customizer` returns - * `undefined`, assignment is handled by the method instead. The `customizer` - * is invoked with five arguments: (objValue, srcValue, key, object, source). - * - * **Note:** This method mutates `object`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Object - * @param {Object} object The destination object. - * @param {...Object} sources The source objects. - * @param {Function} [customizer] The function to customize assigned values. - * @returns {Object} Returns `object`. - * @see _.assignInWith - * @example - * - * function customizer(objValue, srcValue) { - * return _.isUndefined(objValue) ? srcValue : objValue; - * } - * - * var defaults = _.partialRight(_.assignWith, customizer); - * - * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); - * // => { 'a': 1, 'b': 2 } - */ -var assignWith = createAssigner(function(object, source, srcIndex, customizer) { - copyObject(source, keys(source), object, customizer); -}); - -module.exports = assignWith; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/at.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/at.js deleted file mode 100644 index 781ee9e5..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/at.js +++ /dev/null @@ -1,23 +0,0 @@ -var baseAt = require('./_baseAt'), - flatRest = require('./_flatRest'); - -/** - * Creates an array of values corresponding to `paths` of `object`. - * - * @static - * @memberOf _ - * @since 1.0.0 - * @category Object - * @param {Object} object The object to iterate over. - * @param {...(string|string[])} [paths] The property paths to pick. - * @returns {Array} Returns the picked values. - * @example - * - * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] }; - * - * _.at(object, ['a[0].b.c', 'a[1]']); - * // => [3, 4] - */ -var at = flatRest(baseAt); - -module.exports = at; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/attempt.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/attempt.js deleted file mode 100644 index 624d0152..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/attempt.js +++ /dev/null @@ -1,35 +0,0 @@ -var apply = require('./_apply'), - baseRest = require('./_baseRest'), - isError = require('./isError'); - -/** - * Attempts to invoke `func`, returning either the result or the caught error - * object. Any additional arguments are provided to `func` when it's invoked. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Util - * @param {Function} func The function to attempt. - * @param {...*} [args] The arguments to invoke `func` with. - * @returns {*} Returns the `func` result or error object. - * @example - * - * // Avoid throwing errors for invalid selectors. - * var elements = _.attempt(function(selector) { - * return document.querySelectorAll(selector); - * }, '>_>'); - * - * if (_.isError(elements)) { - * elements = []; - * } - */ -var attempt = baseRest(function(func, args) { - try { - return apply(func, undefined, args); - } catch (e) { - return isError(e) ? e : new Error(e); - } -}); - -module.exports = attempt; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/before.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/before.js deleted file mode 100644 index a3e0a16c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/before.js +++ /dev/null @@ -1,40 +0,0 @@ -var toInteger = require('./toInteger'); - -/** Error message constants. */ -var FUNC_ERROR_TEXT = 'Expected a function'; - -/** - * Creates a function that invokes `func`, with the `this` binding and arguments - * of the created function, while it's called less than `n` times. Subsequent - * calls to the created function return the result of the last `func` invocation. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Function - * @param {number} n The number of calls at which `func` is no longer invoked. - * @param {Function} func The function to restrict. - * @returns {Function} Returns the new restricted function. - * @example - * - * jQuery(element).on('click', _.before(5, addContactToList)); - * // => Allows adding up to 4 contacts to the list. - */ -function before(n, func) { - var result; - if (typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - n = toInteger(n); - return function() { - if (--n > 0) { - result = func.apply(this, arguments); - } - if (n <= 1) { - func = undefined; - } - return result; - }; -} - -module.exports = before; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/bind.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/bind.js deleted file mode 100644 index b1076e93..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/bind.js +++ /dev/null @@ -1,57 +0,0 @@ -var baseRest = require('./_baseRest'), - createWrap = require('./_createWrap'), - getHolder = require('./_getHolder'), - replaceHolders = require('./_replaceHolders'); - -/** Used to compose bitmasks for function metadata. */ -var WRAP_BIND_FLAG = 1, - WRAP_PARTIAL_FLAG = 32; - -/** - * Creates a function that invokes `func` with the `this` binding of `thisArg` - * and `partials` prepended to the arguments it receives. - * - * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds, - * may be used as a placeholder for partially applied arguments. - * - * **Note:** Unlike native `Function#bind`, this method doesn't set the "length" - * property of bound functions. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Function - * @param {Function} func The function to bind. - * @param {*} thisArg The `this` binding of `func`. - * @param {...*} [partials] The arguments to be partially applied. - * @returns {Function} Returns the new bound function. - * @example - * - * function greet(greeting, punctuation) { - * return greeting + ' ' + this.user + punctuation; - * } - * - * var object = { 'user': 'fred' }; - * - * var bound = _.bind(greet, object, 'hi'); - * bound('!'); - * // => 'hi fred!' - * - * // Bound with placeholders. - * var bound = _.bind(greet, object, _, '!'); - * bound('hi'); - * // => 'hi fred!' - */ -var bind = baseRest(function(func, thisArg, partials) { - var bitmask = WRAP_BIND_FLAG; - if (partials.length) { - var holders = replaceHolders(partials, getHolder(bind)); - bitmask |= WRAP_PARTIAL_FLAG; - } - return createWrap(func, bitmask, thisArg, partials, holders); -}); - -// Assign default placeholders. -bind.placeholder = {}; - -module.exports = bind; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/bindAll.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/bindAll.js deleted file mode 100644 index a35706de..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/bindAll.js +++ /dev/null @@ -1,41 +0,0 @@ -var arrayEach = require('./_arrayEach'), - baseAssignValue = require('./_baseAssignValue'), - bind = require('./bind'), - flatRest = require('./_flatRest'), - toKey = require('./_toKey'); - -/** - * Binds methods of an object to the object itself, overwriting the existing - * method. - * - * **Note:** This method doesn't set the "length" property of bound functions. - * - * @static - * @since 0.1.0 - * @memberOf _ - * @category Util - * @param {Object} object The object to bind and assign the bound methods to. - * @param {...(string|string[])} methodNames The object method names to bind. - * @returns {Object} Returns `object`. - * @example - * - * var view = { - * 'label': 'docs', - * 'click': function() { - * console.log('clicked ' + this.label); - * } - * }; - * - * _.bindAll(view, ['click']); - * jQuery(element).on('click', view.click); - * // => Logs 'clicked docs' when clicked. - */ -var bindAll = flatRest(function(object, methodNames) { - arrayEach(methodNames, function(key) { - key = toKey(key); - baseAssignValue(object, key, bind(object[key], object)); - }); - return object; -}); - -module.exports = bindAll; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/bindKey.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/bindKey.js deleted file mode 100644 index f7fd64cd..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/bindKey.js +++ /dev/null @@ -1,68 +0,0 @@ -var baseRest = require('./_baseRest'), - createWrap = require('./_createWrap'), - getHolder = require('./_getHolder'), - replaceHolders = require('./_replaceHolders'); - -/** Used to compose bitmasks for function metadata. */ -var WRAP_BIND_FLAG = 1, - WRAP_BIND_KEY_FLAG = 2, - WRAP_PARTIAL_FLAG = 32; - -/** - * Creates a function that invokes the method at `object[key]` with `partials` - * prepended to the arguments it receives. - * - * This method differs from `_.bind` by allowing bound functions to reference - * methods that may be redefined or don't yet exist. See - * [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern) - * for more details. - * - * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic - * builds, may be used as a placeholder for partially applied arguments. - * - * @static - * @memberOf _ - * @since 0.10.0 - * @category Function - * @param {Object} object The object to invoke the method on. - * @param {string} key The key of the method. - * @param {...*} [partials] The arguments to be partially applied. - * @returns {Function} Returns the new bound function. - * @example - * - * var object = { - * 'user': 'fred', - * 'greet': function(greeting, punctuation) { - * return greeting + ' ' + this.user + punctuation; - * } - * }; - * - * var bound = _.bindKey(object, 'greet', 'hi'); - * bound('!'); - * // => 'hi fred!' - * - * object.greet = function(greeting, punctuation) { - * return greeting + 'ya ' + this.user + punctuation; - * }; - * - * bound('!'); - * // => 'hiya fred!' - * - * // Bound with placeholders. - * var bound = _.bindKey(object, 'greet', _, '!'); - * bound('hi'); - * // => 'hiya fred!' - */ -var bindKey = baseRest(function(object, key, partials) { - var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG; - if (partials.length) { - var holders = replaceHolders(partials, getHolder(bindKey)); - bitmask |= WRAP_PARTIAL_FLAG; - } - return createWrap(key, bitmask, object, partials, holders); -}); - -// Assign default placeholders. -bindKey.placeholder = {}; - -module.exports = bindKey; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/camelCase.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/camelCase.js deleted file mode 100644 index d7390def..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/camelCase.js +++ /dev/null @@ -1,29 +0,0 @@ -var capitalize = require('./capitalize'), - createCompounder = require('./_createCompounder'); - -/** - * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase). - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category String - * @param {string} [string=''] The string to convert. - * @returns {string} Returns the camel cased string. - * @example - * - * _.camelCase('Foo Bar'); - * // => 'fooBar' - * - * _.camelCase('--foo-bar--'); - * // => 'fooBar' - * - * _.camelCase('__FOO_BAR__'); - * // => 'fooBar' - */ -var camelCase = createCompounder(function(result, word, index) { - word = word.toLowerCase(); - return result + (index ? capitalize(word) : word); -}); - -module.exports = camelCase; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/capitalize.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/capitalize.js deleted file mode 100644 index 3e1600e7..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/capitalize.js +++ /dev/null @@ -1,23 +0,0 @@ -var toString = require('./toString'), - upperFirst = require('./upperFirst'); - -/** - * Converts the first character of `string` to upper case and the remaining - * to lower case. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category String - * @param {string} [string=''] The string to capitalize. - * @returns {string} Returns the capitalized string. - * @example - * - * _.capitalize('FRED'); - * // => 'Fred' - */ -function capitalize(string) { - return upperFirst(toString(string).toLowerCase()); -} - -module.exports = capitalize; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/castArray.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/castArray.js deleted file mode 100644 index e470bdb9..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/castArray.js +++ /dev/null @@ -1,44 +0,0 @@ -var isArray = require('./isArray'); - -/** - * Casts `value` as an array if it's not one. - * - * @static - * @memberOf _ - * @since 4.4.0 - * @category Lang - * @param {*} value The value to inspect. - * @returns {Array} Returns the cast array. - * @example - * - * _.castArray(1); - * // => [1] - * - * _.castArray({ 'a': 1 }); - * // => [{ 'a': 1 }] - * - * _.castArray('abc'); - * // => ['abc'] - * - * _.castArray(null); - * // => [null] - * - * _.castArray(undefined); - * // => [undefined] - * - * _.castArray(); - * // => [] - * - * var array = [1, 2, 3]; - * console.log(_.castArray(array) === array); - * // => true - */ -function castArray() { - if (!arguments.length) { - return []; - } - var value = arguments[0]; - return isArray(value) ? value : [value]; -} - -module.exports = castArray; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/ceil.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/ceil.js deleted file mode 100644 index 56c8722c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/ceil.js +++ /dev/null @@ -1,26 +0,0 @@ -var createRound = require('./_createRound'); - -/** - * Computes `number` rounded up to `precision`. - * - * @static - * @memberOf _ - * @since 3.10.0 - * @category Math - * @param {number} number The number to round up. - * @param {number} [precision=0] The precision to round up to. - * @returns {number} Returns the rounded up number. - * @example - * - * _.ceil(4.006); - * // => 5 - * - * _.ceil(6.004, 2); - * // => 6.01 - * - * _.ceil(6040, -2); - * // => 6100 - */ -var ceil = createRound('ceil'); - -module.exports = ceil; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/chain.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/chain.js deleted file mode 100644 index f6cd6475..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/chain.js +++ /dev/null @@ -1,38 +0,0 @@ -var lodash = require('./wrapperLodash'); - -/** - * Creates a `lodash` wrapper instance that wraps `value` with explicit method - * chain sequences enabled. The result of such sequences must be unwrapped - * with `_#value`. - * - * @static - * @memberOf _ - * @since 1.3.0 - * @category Seq - * @param {*} value The value to wrap. - * @returns {Object} Returns the new `lodash` wrapper instance. - * @example - * - * var users = [ - * { 'user': 'barney', 'age': 36 }, - * { 'user': 'fred', 'age': 40 }, - * { 'user': 'pebbles', 'age': 1 } - * ]; - * - * var youngest = _ - * .chain(users) - * .sortBy('age') - * .map(function(o) { - * return o.user + ' is ' + o.age; - * }) - * .head() - * .value(); - * // => 'pebbles is 1' - */ -function chain(value) { - var result = lodash(value); - result.__chain__ = true; - return result; -} - -module.exports = chain; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/chunk.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/chunk.js deleted file mode 100644 index 5b562fef..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/chunk.js +++ /dev/null @@ -1,50 +0,0 @@ -var baseSlice = require('./_baseSlice'), - isIterateeCall = require('./_isIterateeCall'), - toInteger = require('./toInteger'); - -/* Built-in method references for those with the same name as other `lodash` methods. */ -var nativeCeil = Math.ceil, - nativeMax = Math.max; - -/** - * Creates an array of elements split into groups the length of `size`. - * If `array` can't be split evenly, the final chunk will be the remaining - * elements. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Array - * @param {Array} array The array to process. - * @param {number} [size=1] The length of each chunk - * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. - * @returns {Array} Returns the new array of chunks. - * @example - * - * _.chunk(['a', 'b', 'c', 'd'], 2); - * // => [['a', 'b'], ['c', 'd']] - * - * _.chunk(['a', 'b', 'c', 'd'], 3); - * // => [['a', 'b', 'c'], ['d']] - */ -function chunk(array, size, guard) { - if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) { - size = 1; - } else { - size = nativeMax(toInteger(size), 0); - } - var length = array == null ? 0 : array.length; - if (!length || size < 1) { - return []; - } - var index = 0, - resIndex = 0, - result = Array(nativeCeil(length / size)); - - while (index < length) { - result[resIndex++] = baseSlice(array, index, (index += size)); - } - return result; -} - -module.exports = chunk; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/clamp.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/clamp.js deleted file mode 100644 index 91a72c97..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/clamp.js +++ /dev/null @@ -1,39 +0,0 @@ -var baseClamp = require('./_baseClamp'), - toNumber = require('./toNumber'); - -/** - * Clamps `number` within the inclusive `lower` and `upper` bounds. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Number - * @param {number} number The number to clamp. - * @param {number} [lower] The lower bound. - * @param {number} upper The upper bound. - * @returns {number} Returns the clamped number. - * @example - * - * _.clamp(-10, -5, 5); - * // => -5 - * - * _.clamp(10, -5, 5); - * // => 5 - */ -function clamp(number, lower, upper) { - if (upper === undefined) { - upper = lower; - lower = undefined; - } - if (upper !== undefined) { - upper = toNumber(upper); - upper = upper === upper ? upper : 0; - } - if (lower !== undefined) { - lower = toNumber(lower); - lower = lower === lower ? lower : 0; - } - return baseClamp(toNumber(number), lower, upper); -} - -module.exports = clamp; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/clone.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/clone.js deleted file mode 100644 index dd439d63..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/clone.js +++ /dev/null @@ -1,36 +0,0 @@ -var baseClone = require('./_baseClone'); - -/** Used to compose bitmasks for cloning. */ -var CLONE_SYMBOLS_FLAG = 4; - -/** - * Creates a shallow clone of `value`. - * - * **Note:** This method is loosely based on the - * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm) - * and supports cloning arrays, array buffers, booleans, date objects, maps, - * numbers, `Object` objects, regexes, sets, strings, symbols, and typed - * arrays. The own enumerable properties of `arguments` objects are cloned - * as plain objects. An empty object is returned for uncloneable values such - * as error objects, functions, DOM nodes, and WeakMaps. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to clone. - * @returns {*} Returns the cloned value. - * @see _.cloneDeep - * @example - * - * var objects = [{ 'a': 1 }, { 'b': 2 }]; - * - * var shallow = _.clone(objects); - * console.log(shallow[0] === objects[0]); - * // => true - */ -function clone(value) { - return baseClone(value, CLONE_SYMBOLS_FLAG); -} - -module.exports = clone; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/cloneDeep.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/cloneDeep.js deleted file mode 100644 index 4425fbe8..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/cloneDeep.js +++ /dev/null @@ -1,29 +0,0 @@ -var baseClone = require('./_baseClone'); - -/** Used to compose bitmasks for cloning. */ -var CLONE_DEEP_FLAG = 1, - CLONE_SYMBOLS_FLAG = 4; - -/** - * This method is like `_.clone` except that it recursively clones `value`. - * - * @static - * @memberOf _ - * @since 1.0.0 - * @category Lang - * @param {*} value The value to recursively clone. - * @returns {*} Returns the deep cloned value. - * @see _.clone - * @example - * - * var objects = [{ 'a': 1 }, { 'b': 2 }]; - * - * var deep = _.cloneDeep(objects); - * console.log(deep[0] === objects[0]); - * // => false - */ -function cloneDeep(value) { - return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG); -} - -module.exports = cloneDeep; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/cloneDeepWith.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/cloneDeepWith.js deleted file mode 100644 index fd9c6c05..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/cloneDeepWith.js +++ /dev/null @@ -1,40 +0,0 @@ -var baseClone = require('./_baseClone'); - -/** Used to compose bitmasks for cloning. */ -var CLONE_DEEP_FLAG = 1, - CLONE_SYMBOLS_FLAG = 4; - -/** - * This method is like `_.cloneWith` except that it recursively clones `value`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to recursively clone. - * @param {Function} [customizer] The function to customize cloning. - * @returns {*} Returns the deep cloned value. - * @see _.cloneWith - * @example - * - * function customizer(value) { - * if (_.isElement(value)) { - * return value.cloneNode(true); - * } - * } - * - * var el = _.cloneDeepWith(document.body, customizer); - * - * console.log(el === document.body); - * // => false - * console.log(el.nodeName); - * // => 'BODY' - * console.log(el.childNodes.length); - * // => 20 - */ -function cloneDeepWith(value, customizer) { - customizer = typeof customizer == 'function' ? customizer : undefined; - return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer); -} - -module.exports = cloneDeepWith; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/cloneWith.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/cloneWith.js deleted file mode 100644 index d2f4e756..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/cloneWith.js +++ /dev/null @@ -1,42 +0,0 @@ -var baseClone = require('./_baseClone'); - -/** Used to compose bitmasks for cloning. */ -var CLONE_SYMBOLS_FLAG = 4; - -/** - * This method is like `_.clone` except that it accepts `customizer` which - * is invoked to produce the cloned value. If `customizer` returns `undefined`, - * cloning is handled by the method instead. The `customizer` is invoked with - * up to four arguments; (value [, index|key, object, stack]). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to clone. - * @param {Function} [customizer] The function to customize cloning. - * @returns {*} Returns the cloned value. - * @see _.cloneDeepWith - * @example - * - * function customizer(value) { - * if (_.isElement(value)) { - * return value.cloneNode(false); - * } - * } - * - * var el = _.cloneWith(document.body, customizer); - * - * console.log(el === document.body); - * // => false - * console.log(el.nodeName); - * // => 'BODY' - * console.log(el.childNodes.length); - * // => 0 - */ -function cloneWith(value, customizer) { - customizer = typeof customizer == 'function' ? customizer : undefined; - return baseClone(value, CLONE_SYMBOLS_FLAG, customizer); -} - -module.exports = cloneWith; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/collection.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/collection.js deleted file mode 100644 index 77fe837f..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/collection.js +++ /dev/null @@ -1,30 +0,0 @@ -module.exports = { - 'countBy': require('./countBy'), - 'each': require('./each'), - 'eachRight': require('./eachRight'), - 'every': require('./every'), - 'filter': require('./filter'), - 'find': require('./find'), - 'findLast': require('./findLast'), - 'flatMap': require('./flatMap'), - 'flatMapDeep': require('./flatMapDeep'), - 'flatMapDepth': require('./flatMapDepth'), - 'forEach': require('./forEach'), - 'forEachRight': require('./forEachRight'), - 'groupBy': require('./groupBy'), - 'includes': require('./includes'), - 'invokeMap': require('./invokeMap'), - 'keyBy': require('./keyBy'), - 'map': require('./map'), - 'orderBy': require('./orderBy'), - 'partition': require('./partition'), - 'reduce': require('./reduce'), - 'reduceRight': require('./reduceRight'), - 'reject': require('./reject'), - 'sample': require('./sample'), - 'sampleSize': require('./sampleSize'), - 'shuffle': require('./shuffle'), - 'size': require('./size'), - 'some': require('./some'), - 'sortBy': require('./sortBy') -}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/commit.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/commit.js deleted file mode 100644 index fe4db717..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/commit.js +++ /dev/null @@ -1,33 +0,0 @@ -var LodashWrapper = require('./_LodashWrapper'); - -/** - * Executes the chain sequence and returns the wrapped result. - * - * @name commit - * @memberOf _ - * @since 3.2.0 - * @category Seq - * @returns {Object} Returns the new `lodash` wrapper instance. - * @example - * - * var array = [1, 2]; - * var wrapped = _(array).push(3); - * - * console.log(array); - * // => [1, 2] - * - * wrapped = wrapped.commit(); - * console.log(array); - * // => [1, 2, 3] - * - * wrapped.last(); - * // => 3 - * - * console.log(array); - * // => [1, 2, 3] - */ -function wrapperCommit() { - return new LodashWrapper(this.value(), this.__chain__); -} - -module.exports = wrapperCommit; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/compact.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/compact.js deleted file mode 100644 index 031fab4e..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/compact.js +++ /dev/null @@ -1,31 +0,0 @@ -/** - * Creates an array with all falsey values removed. The values `false`, `null`, - * `0`, `""`, `undefined`, and `NaN` are falsey. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Array - * @param {Array} array The array to compact. - * @returns {Array} Returns the new array of filtered values. - * @example - * - * _.compact([0, 1, false, 2, '', 3]); - * // => [1, 2, 3] - */ -function compact(array) { - var index = -1, - length = array == null ? 0 : array.length, - resIndex = 0, - result = []; - - while (++index < length) { - var value = array[index]; - if (value) { - result[resIndex++] = value; - } - } - return result; -} - -module.exports = compact; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/concat.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/concat.js deleted file mode 100644 index 1da48a4f..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/concat.js +++ /dev/null @@ -1,43 +0,0 @@ -var arrayPush = require('./_arrayPush'), - baseFlatten = require('./_baseFlatten'), - copyArray = require('./_copyArray'), - isArray = require('./isArray'); - -/** - * Creates a new array concatenating `array` with any additional arrays - * and/or values. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {Array} array The array to concatenate. - * @param {...*} [values] The values to concatenate. - * @returns {Array} Returns the new concatenated array. - * @example - * - * var array = [1]; - * var other = _.concat(array, 2, [3], [[4]]); - * - * console.log(other); - * // => [1, 2, 3, [4]] - * - * console.log(array); - * // => [1] - */ -function concat() { - var length = arguments.length; - if (!length) { - return []; - } - var args = Array(length - 1), - array = arguments[0], - index = length; - - while (index--) { - args[index - 1] = arguments[index]; - } - return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1)); -} - -module.exports = concat; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/cond.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/cond.js deleted file mode 100644 index 64555986..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/cond.js +++ /dev/null @@ -1,60 +0,0 @@ -var apply = require('./_apply'), - arrayMap = require('./_arrayMap'), - baseIteratee = require('./_baseIteratee'), - baseRest = require('./_baseRest'); - -/** Error message constants. */ -var FUNC_ERROR_TEXT = 'Expected a function'; - -/** - * Creates a function that iterates over `pairs` and invokes the corresponding - * function of the first predicate to return truthy. The predicate-function - * pairs are invoked with the `this` binding and arguments of the created - * function. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Util - * @param {Array} pairs The predicate-function pairs. - * @returns {Function} Returns the new composite function. - * @example - * - * var func = _.cond([ - * [_.matches({ 'a': 1 }), _.constant('matches A')], - * [_.conforms({ 'b': _.isNumber }), _.constant('matches B')], - * [_.stubTrue, _.constant('no match')] - * ]); - * - * func({ 'a': 1, 'b': 2 }); - * // => 'matches A' - * - * func({ 'a': 0, 'b': 1 }); - * // => 'matches B' - * - * func({ 'a': '1', 'b': '2' }); - * // => 'no match' - */ -function cond(pairs) { - var length = pairs == null ? 0 : pairs.length, - toIteratee = baseIteratee; - - pairs = !length ? [] : arrayMap(pairs, function(pair) { - if (typeof pair[1] != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - return [toIteratee(pair[0]), pair[1]]; - }); - - return baseRest(function(args) { - var index = -1; - while (++index < length) { - var pair = pairs[index]; - if (apply(pair[0], this, args)) { - return apply(pair[1], this, args); - } - } - }); -} - -module.exports = cond; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/conforms.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/conforms.js deleted file mode 100644 index 5501a949..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/conforms.js +++ /dev/null @@ -1,35 +0,0 @@ -var baseClone = require('./_baseClone'), - baseConforms = require('./_baseConforms'); - -/** Used to compose bitmasks for cloning. */ -var CLONE_DEEP_FLAG = 1; - -/** - * Creates a function that invokes the predicate properties of `source` with - * the corresponding property values of a given object, returning `true` if - * all predicates return truthy, else `false`. - * - * **Note:** The created function is equivalent to `_.conformsTo` with - * `source` partially applied. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Util - * @param {Object} source The object of property predicates to conform to. - * @returns {Function} Returns the new spec function. - * @example - * - * var objects = [ - * { 'a': 2, 'b': 1 }, - * { 'a': 1, 'b': 2 } - * ]; - * - * _.filter(objects, _.conforms({ 'b': function(n) { return n > 1; } })); - * // => [{ 'a': 1, 'b': 2 }] - */ -function conforms(source) { - return baseConforms(baseClone(source, CLONE_DEEP_FLAG)); -} - -module.exports = conforms; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/conformsTo.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/conformsTo.js deleted file mode 100644 index b8a93ebf..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/conformsTo.js +++ /dev/null @@ -1,32 +0,0 @@ -var baseConformsTo = require('./_baseConformsTo'), - keys = require('./keys'); - -/** - * Checks if `object` conforms to `source` by invoking the predicate - * properties of `source` with the corresponding property values of `object`. - * - * **Note:** This method is equivalent to `_.conforms` when `source` is - * partially applied. - * - * @static - * @memberOf _ - * @since 4.14.0 - * @category Lang - * @param {Object} object The object to inspect. - * @param {Object} source The object of property predicates to conform to. - * @returns {boolean} Returns `true` if `object` conforms, else `false`. - * @example - * - * var object = { 'a': 1, 'b': 2 }; - * - * _.conformsTo(object, { 'b': function(n) { return n > 1; } }); - * // => true - * - * _.conformsTo(object, { 'b': function(n) { return n > 2; } }); - * // => false - */ -function conformsTo(object, source) { - return source == null || baseConformsTo(object, source, keys(source)); -} - -module.exports = conformsTo; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/constant.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/constant.js deleted file mode 100644 index 655ece3f..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/constant.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * Creates a function that returns `value`. - * - * @static - * @memberOf _ - * @since 2.4.0 - * @category Util - * @param {*} value The value to return from the new function. - * @returns {Function} Returns the new constant function. - * @example - * - * var objects = _.times(2, _.constant({ 'a': 1 })); - * - * console.log(objects); - * // => [{ 'a': 1 }, { 'a': 1 }] - * - * console.log(objects[0] === objects[1]); - * // => true - */ -function constant(value) { - return function() { - return value; - }; -} - -module.exports = constant; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/core.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/core.js deleted file mode 100644 index be1d567d..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/core.js +++ /dev/null @@ -1,3877 +0,0 @@ -/** - * @license - * Lodash (Custom Build) - * Build: `lodash core -o ./dist/lodash.core.js` - * Copyright OpenJS Foundation and other contributors - * Released under MIT license - * Based on Underscore.js 1.8.3 - * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - */ -;(function() { - - /** Used as a safe reference for `undefined` in pre-ES5 environments. */ - var undefined; - - /** Used as the semantic version number. */ - var VERSION = '4.17.21'; - - /** Error message constants. */ - var FUNC_ERROR_TEXT = 'Expected a function'; - - /** Used to compose bitmasks for value comparisons. */ - var COMPARE_PARTIAL_FLAG = 1, - COMPARE_UNORDERED_FLAG = 2; - - /** Used to compose bitmasks for function metadata. */ - var WRAP_BIND_FLAG = 1, - WRAP_PARTIAL_FLAG = 32; - - /** Used as references for various `Number` constants. */ - var INFINITY = 1 / 0, - MAX_SAFE_INTEGER = 9007199254740991; - - /** `Object#toString` result references. */ - var argsTag = '[object Arguments]', - arrayTag = '[object Array]', - asyncTag = '[object AsyncFunction]', - boolTag = '[object Boolean]', - dateTag = '[object Date]', - errorTag = '[object Error]', - funcTag = '[object Function]', - genTag = '[object GeneratorFunction]', - numberTag = '[object Number]', - objectTag = '[object Object]', - proxyTag = '[object Proxy]', - regexpTag = '[object RegExp]', - stringTag = '[object String]'; - - /** Used to match HTML entities and HTML characters. */ - var reUnescapedHtml = /[&<>"']/g, - reHasUnescapedHtml = RegExp(reUnescapedHtml.source); - - /** Used to detect unsigned integer values. */ - var reIsUint = /^(?:0|[1-9]\d*)$/; - - /** Used to map characters to HTML entities. */ - var htmlEscapes = { - '&': '&', - '<': '<', - '>': '>', - '"': '"', - "'": ''' - }; - - /** Detect free variable `global` from Node.js. */ - var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; - - /** Detect free variable `self`. */ - var freeSelf = typeof self == 'object' && self && self.Object === Object && self; - - /** Used as a reference to the global object. */ - var root = freeGlobal || freeSelf || Function('return this')(); - - /** Detect free variable `exports`. */ - var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports; - - /** Detect free variable `module`. */ - var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module; - - /*--------------------------------------------------------------------------*/ - - /** - * Appends the elements of `values` to `array`. - * - * @private - * @param {Array} array The array to modify. - * @param {Array} values The values to append. - * @returns {Array} Returns `array`. - */ - function arrayPush(array, values) { - array.push.apply(array, values); - return array; - } - - /** - * The base implementation of `_.findIndex` and `_.findLastIndex` without - * support for iteratee shorthands. - * - * @private - * @param {Array} array The array to inspect. - * @param {Function} predicate The function invoked per iteration. - * @param {number} fromIndex The index to search from. - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {number} Returns the index of the matched value, else `-1`. - */ - function baseFindIndex(array, predicate, fromIndex, fromRight) { - var length = array.length, - index = fromIndex + (fromRight ? 1 : -1); - - while ((fromRight ? index-- : ++index < length)) { - if (predicate(array[index], index, array)) { - return index; - } - } - return -1; - } - - /** - * The base implementation of `_.property` without support for deep paths. - * - * @private - * @param {string} key The key of the property to get. - * @returns {Function} Returns the new accessor function. - */ - function baseProperty(key) { - return function(object) { - return object == null ? undefined : object[key]; - }; - } - - /** - * The base implementation of `_.propertyOf` without support for deep paths. - * - * @private - * @param {Object} object The object to query. - * @returns {Function} Returns the new accessor function. - */ - function basePropertyOf(object) { - return function(key) { - return object == null ? undefined : object[key]; - }; - } - - /** - * The base implementation of `_.reduce` and `_.reduceRight`, without support - * for iteratee shorthands, which iterates over `collection` using `eachFunc`. - * - * @private - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @param {*} accumulator The initial value. - * @param {boolean} initAccum Specify using the first or last element of - * `collection` as the initial value. - * @param {Function} eachFunc The function to iterate over `collection`. - * @returns {*} Returns the accumulated value. - */ - function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) { - eachFunc(collection, function(value, index, collection) { - accumulator = initAccum - ? (initAccum = false, value) - : iteratee(accumulator, value, index, collection); - }); - return accumulator; - } - - /** - * The base implementation of `_.values` and `_.valuesIn` which creates an - * array of `object` property values corresponding to the property names - * of `props`. - * - * @private - * @param {Object} object The object to query. - * @param {Array} props The property names to get values for. - * @returns {Object} Returns the array of property values. - */ - function baseValues(object, props) { - return baseMap(props, function(key) { - return object[key]; - }); - } - - /** - * Used by `_.escape` to convert characters to HTML entities. - * - * @private - * @param {string} chr The matched character to escape. - * @returns {string} Returns the escaped character. - */ - var escapeHtmlChar = basePropertyOf(htmlEscapes); - - /** - * Creates a unary function that invokes `func` with its argument transformed. - * - * @private - * @param {Function} func The function to wrap. - * @param {Function} transform The argument transform. - * @returns {Function} Returns the new function. - */ - function overArg(func, transform) { - return function(arg) { - return func(transform(arg)); - }; - } - - /*--------------------------------------------------------------------------*/ - - /** Used for built-in method references. */ - var arrayProto = Array.prototype, - objectProto = Object.prototype; - - /** Used to check objects for own properties. */ - var hasOwnProperty = objectProto.hasOwnProperty; - - /** Used to generate unique IDs. */ - var idCounter = 0; - - /** - * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) - * of values. - */ - var nativeObjectToString = objectProto.toString; - - /** Used to restore the original `_` reference in `_.noConflict`. */ - var oldDash = root._; - - /** Built-in value references. */ - var objectCreate = Object.create, - propertyIsEnumerable = objectProto.propertyIsEnumerable; - - /* Built-in method references for those with the same name as other `lodash` methods. */ - var nativeIsFinite = root.isFinite, - nativeKeys = overArg(Object.keys, Object), - nativeMax = Math.max; - - /*------------------------------------------------------------------------*/ - - /** - * Creates a `lodash` object which wraps `value` to enable implicit method - * chain sequences. Methods that operate on and return arrays, collections, - * and functions can be chained together. Methods that retrieve a single value - * or may return a primitive value will automatically end the chain sequence - * and return the unwrapped value. Otherwise, the value must be unwrapped - * with `_#value`. - * - * Explicit chain sequences, which must be unwrapped with `_#value`, may be - * enabled using `_.chain`. - * - * The execution of chained methods is lazy, that is, it's deferred until - * `_#value` is implicitly or explicitly called. - * - * Lazy evaluation allows several methods to support shortcut fusion. - * Shortcut fusion is an optimization to merge iteratee calls; this avoids - * the creation of intermediate arrays and can greatly reduce the number of - * iteratee executions. Sections of a chain sequence qualify for shortcut - * fusion if the section is applied to an array and iteratees accept only - * one argument. The heuristic for whether a section qualifies for shortcut - * fusion is subject to change. - * - * Chaining is supported in custom builds as long as the `_#value` method is - * directly or indirectly included in the build. - * - * In addition to lodash methods, wrappers have `Array` and `String` methods. - * - * The wrapper `Array` methods are: - * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift` - * - * The wrapper `String` methods are: - * `replace` and `split` - * - * The wrapper methods that support shortcut fusion are: - * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`, - * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`, - * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray` - * - * The chainable wrapper methods are: - * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`, - * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`, - * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`, - * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`, - * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`, - * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`, - * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`, - * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`, - * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`, - * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`, - * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`, - * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`, - * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`, - * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`, - * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`, - * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`, - * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`, - * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`, - * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`, - * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`, - * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`, - * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`, - * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`, - * `zipObject`, `zipObjectDeep`, and `zipWith` - * - * The wrapper methods that are **not** chainable by default are: - * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`, - * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`, - * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`, - * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`, - * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`, - * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`, - * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`, - * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`, - * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`, - * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`, - * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`, - * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`, - * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`, - * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`, - * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`, - * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`, - * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`, - * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`, - * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`, - * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`, - * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`, - * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`, - * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`, - * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`, - * `upperFirst`, `value`, and `words` - * - * @name _ - * @constructor - * @category Seq - * @param {*} value The value to wrap in a `lodash` instance. - * @returns {Object} Returns the new `lodash` wrapper instance. - * @example - * - * function square(n) { - * return n * n; - * } - * - * var wrapped = _([1, 2, 3]); - * - * // Returns an unwrapped value. - * wrapped.reduce(_.add); - * // => 6 - * - * // Returns a wrapped value. - * var squares = wrapped.map(square); - * - * _.isArray(squares); - * // => false - * - * _.isArray(squares.value()); - * // => true - */ - function lodash(value) { - return value instanceof LodashWrapper - ? value - : new LodashWrapper(value); - } - - /** - * The base implementation of `_.create` without support for assigning - * properties to the created object. - * - * @private - * @param {Object} proto The object to inherit from. - * @returns {Object} Returns the new object. - */ - var baseCreate = (function() { - function object() {} - return function(proto) { - if (!isObject(proto)) { - return {}; - } - if (objectCreate) { - return objectCreate(proto); - } - object.prototype = proto; - var result = new object; - object.prototype = undefined; - return result; - }; - }()); - - /** - * The base constructor for creating `lodash` wrapper objects. - * - * @private - * @param {*} value The value to wrap. - * @param {boolean} [chainAll] Enable explicit method chain sequences. - */ - function LodashWrapper(value, chainAll) { - this.__wrapped__ = value; - this.__actions__ = []; - this.__chain__ = !!chainAll; - } - - LodashWrapper.prototype = baseCreate(lodash.prototype); - LodashWrapper.prototype.constructor = LodashWrapper; - - /*------------------------------------------------------------------------*/ - - /** - * Assigns `value` to `key` of `object` if the existing value is not equivalent - * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) - * for equality comparisons. - * - * @private - * @param {Object} object The object to modify. - * @param {string} key The key of the property to assign. - * @param {*} value The value to assign. - */ - function assignValue(object, key, value) { - var objValue = object[key]; - if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || - (value === undefined && !(key in object))) { - baseAssignValue(object, key, value); - } - } - - /** - * The base implementation of `assignValue` and `assignMergeValue` without - * value checks. - * - * @private - * @param {Object} object The object to modify. - * @param {string} key The key of the property to assign. - * @param {*} value The value to assign. - */ - function baseAssignValue(object, key, value) { - object[key] = value; - } - - /** - * The base implementation of `_.delay` and `_.defer` which accepts `args` - * to provide to `func`. - * - * @private - * @param {Function} func The function to delay. - * @param {number} wait The number of milliseconds to delay invocation. - * @param {Array} args The arguments to provide to `func`. - * @returns {number|Object} Returns the timer id or timeout object. - */ - function baseDelay(func, wait, args) { - if (typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - return setTimeout(function() { func.apply(undefined, args); }, wait); - } - - /** - * The base implementation of `_.forEach` without support for iteratee shorthands. - * - * @private - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array|Object} Returns `collection`. - */ - var baseEach = createBaseEach(baseForOwn); - - /** - * The base implementation of `_.every` without support for iteratee shorthands. - * - * @private - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} predicate The function invoked per iteration. - * @returns {boolean} Returns `true` if all elements pass the predicate check, - * else `false` - */ - function baseEvery(collection, predicate) { - var result = true; - baseEach(collection, function(value, index, collection) { - result = !!predicate(value, index, collection); - return result; - }); - return result; - } - - /** - * The base implementation of methods like `_.max` and `_.min` which accepts a - * `comparator` to determine the extremum value. - * - * @private - * @param {Array} array The array to iterate over. - * @param {Function} iteratee The iteratee invoked per iteration. - * @param {Function} comparator The comparator used to compare values. - * @returns {*} Returns the extremum value. - */ - function baseExtremum(array, iteratee, comparator) { - var index = -1, - length = array.length; - - while (++index < length) { - var value = array[index], - current = iteratee(value); - - if (current != null && (computed === undefined - ? (current === current && !false) - : comparator(current, computed) - )) { - var computed = current, - result = value; - } - } - return result; - } - - /** - * The base implementation of `_.filter` without support for iteratee shorthands. - * - * @private - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} predicate The function invoked per iteration. - * @returns {Array} Returns the new filtered array. - */ - function baseFilter(collection, predicate) { - var result = []; - baseEach(collection, function(value, index, collection) { - if (predicate(value, index, collection)) { - result.push(value); - } - }); - return result; - } - - /** - * The base implementation of `_.flatten` with support for restricting flattening. - * - * @private - * @param {Array} array The array to flatten. - * @param {number} depth The maximum recursion depth. - * @param {boolean} [predicate=isFlattenable] The function invoked per iteration. - * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks. - * @param {Array} [result=[]] The initial result value. - * @returns {Array} Returns the new flattened array. - */ - function baseFlatten(array, depth, predicate, isStrict, result) { - var index = -1, - length = array.length; - - predicate || (predicate = isFlattenable); - result || (result = []); - - while (++index < length) { - var value = array[index]; - if (depth > 0 && predicate(value)) { - if (depth > 1) { - // Recursively flatten arrays (susceptible to call stack limits). - baseFlatten(value, depth - 1, predicate, isStrict, result); - } else { - arrayPush(result, value); - } - } else if (!isStrict) { - result[result.length] = value; - } - } - return result; - } - - /** - * The base implementation of `baseForOwn` which iterates over `object` - * properties returned by `keysFunc` and invokes `iteratee` for each property. - * Iteratee functions may exit iteration early by explicitly returning `false`. - * - * @private - * @param {Object} object The object to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @param {Function} keysFunc The function to get the keys of `object`. - * @returns {Object} Returns `object`. - */ - var baseFor = createBaseFor(); - - /** - * The base implementation of `_.forOwn` without support for iteratee shorthands. - * - * @private - * @param {Object} object The object to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Object} Returns `object`. - */ - function baseForOwn(object, iteratee) { - return object && baseFor(object, iteratee, keys); - } - - /** - * The base implementation of `_.functions` which creates an array of - * `object` function property names filtered from `props`. - * - * @private - * @param {Object} object The object to inspect. - * @param {Array} props The property names to filter. - * @returns {Array} Returns the function names. - */ - function baseFunctions(object, props) { - return baseFilter(props, function(key) { - return isFunction(object[key]); - }); - } - - /** - * The base implementation of `getTag` without fallbacks for buggy environments. - * - * @private - * @param {*} value The value to query. - * @returns {string} Returns the `toStringTag`. - */ - function baseGetTag(value) { - return objectToString(value); - } - - /** - * The base implementation of `_.gt` which doesn't coerce arguments. - * - * @private - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if `value` is greater than `other`, - * else `false`. - */ - function baseGt(value, other) { - return value > other; - } - - /** - * The base implementation of `_.isArguments`. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an `arguments` object, - */ - var baseIsArguments = noop; - - /** - * The base implementation of `_.isDate` without Node.js optimizations. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a date object, else `false`. - */ - function baseIsDate(value) { - return isObjectLike(value) && baseGetTag(value) == dateTag; - } - - /** - * The base implementation of `_.isEqual` which supports partial comparisons - * and tracks traversed objects. - * - * @private - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @param {boolean} bitmask The bitmask flags. - * 1 - Unordered comparison - * 2 - Partial comparison - * @param {Function} [customizer] The function to customize comparisons. - * @param {Object} [stack] Tracks traversed `value` and `other` objects. - * @returns {boolean} Returns `true` if the values are equivalent, else `false`. - */ - function baseIsEqual(value, other, bitmask, customizer, stack) { - if (value === other) { - return true; - } - if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) { - return value !== value && other !== other; - } - return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack); - } - - /** - * A specialized version of `baseIsEqual` for arrays and objects which performs - * deep comparisons and tracks traversed objects enabling objects with circular - * references to be compared. - * - * @private - * @param {Object} object The object to compare. - * @param {Object} other The other object to compare. - * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. - * @param {Function} customizer The function to customize comparisons. - * @param {Function} equalFunc The function to determine equivalents of values. - * @param {Object} [stack] Tracks traversed `object` and `other` objects. - * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. - */ - function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) { - var objIsArr = isArray(object), - othIsArr = isArray(other), - objTag = objIsArr ? arrayTag : baseGetTag(object), - othTag = othIsArr ? arrayTag : baseGetTag(other); - - objTag = objTag == argsTag ? objectTag : objTag; - othTag = othTag == argsTag ? objectTag : othTag; - - var objIsObj = objTag == objectTag, - othIsObj = othTag == objectTag, - isSameTag = objTag == othTag; - - stack || (stack = []); - var objStack = find(stack, function(entry) { - return entry[0] == object; - }); - var othStack = find(stack, function(entry) { - return entry[0] == other; - }); - if (objStack && othStack) { - return objStack[1] == other; - } - stack.push([object, other]); - stack.push([other, object]); - if (isSameTag && !objIsObj) { - var result = (objIsArr) - ? equalArrays(object, other, bitmask, customizer, equalFunc, stack) - : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack); - stack.pop(); - return result; - } - if (!(bitmask & COMPARE_PARTIAL_FLAG)) { - var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'), - othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__'); - - if (objIsWrapped || othIsWrapped) { - var objUnwrapped = objIsWrapped ? object.value() : object, - othUnwrapped = othIsWrapped ? other.value() : other; - - var result = equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack); - stack.pop(); - return result; - } - } - if (!isSameTag) { - return false; - } - var result = equalObjects(object, other, bitmask, customizer, equalFunc, stack); - stack.pop(); - return result; - } - - /** - * The base implementation of `_.isRegExp` without Node.js optimizations. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a regexp, else `false`. - */ - function baseIsRegExp(value) { - return isObjectLike(value) && baseGetTag(value) == regexpTag; - } - - /** - * The base implementation of `_.iteratee`. - * - * @private - * @param {*} [value=_.identity] The value to convert to an iteratee. - * @returns {Function} Returns the iteratee. - */ - function baseIteratee(func) { - if (typeof func == 'function') { - return func; - } - if (func == null) { - return identity; - } - return (typeof func == 'object' ? baseMatches : baseProperty)(func); - } - - /** - * The base implementation of `_.lt` which doesn't coerce arguments. - * - * @private - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if `value` is less than `other`, - * else `false`. - */ - function baseLt(value, other) { - return value < other; - } - - /** - * The base implementation of `_.map` without support for iteratee shorthands. - * - * @private - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns the new mapped array. - */ - function baseMap(collection, iteratee) { - var index = -1, - result = isArrayLike(collection) ? Array(collection.length) : []; - - baseEach(collection, function(value, key, collection) { - result[++index] = iteratee(value, key, collection); - }); - return result; - } - - /** - * The base implementation of `_.matches` which doesn't clone `source`. - * - * @private - * @param {Object} source The object of property values to match. - * @returns {Function} Returns the new spec function. - */ - function baseMatches(source) { - var props = nativeKeys(source); - return function(object) { - var length = props.length; - if (object == null) { - return !length; - } - object = Object(object); - while (length--) { - var key = props[length]; - if (!(key in object && - baseIsEqual(source[key], object[key], COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG) - )) { - return false; - } - } - return true; - }; - } - - /** - * The base implementation of `_.pick` without support for individual - * property identifiers. - * - * @private - * @param {Object} object The source object. - * @param {string[]} paths The property paths to pick. - * @returns {Object} Returns the new object. - */ - function basePick(object, props) { - object = Object(object); - return reduce(props, function(result, key) { - if (key in object) { - result[key] = object[key]; - } - return result; - }, {}); - } - - /** - * The base implementation of `_.rest` which doesn't validate or coerce arguments. - * - * @private - * @param {Function} func The function to apply a rest parameter to. - * @param {number} [start=func.length-1] The start position of the rest parameter. - * @returns {Function} Returns the new function. - */ - function baseRest(func, start) { - return setToString(overRest(func, start, identity), func + ''); - } - - /** - * The base implementation of `_.slice` without an iteratee call guard. - * - * @private - * @param {Array} array The array to slice. - * @param {number} [start=0] The start position. - * @param {number} [end=array.length] The end position. - * @returns {Array} Returns the slice of `array`. - */ - function baseSlice(array, start, end) { - var index = -1, - length = array.length; - - if (start < 0) { - start = -start > length ? 0 : (length + start); - } - end = end > length ? length : end; - if (end < 0) { - end += length; - } - length = start > end ? 0 : ((end - start) >>> 0); - start >>>= 0; - - var result = Array(length); - while (++index < length) { - result[index] = array[index + start]; - } - return result; - } - - /** - * Copies the values of `source` to `array`. - * - * @private - * @param {Array} source The array to copy values from. - * @param {Array} [array=[]] The array to copy values to. - * @returns {Array} Returns `array`. - */ - function copyArray(source) { - return baseSlice(source, 0, source.length); - } - - /** - * The base implementation of `_.some` without support for iteratee shorthands. - * - * @private - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} predicate The function invoked per iteration. - * @returns {boolean} Returns `true` if any element passes the predicate check, - * else `false`. - */ - function baseSome(collection, predicate) { - var result; - - baseEach(collection, function(value, index, collection) { - result = predicate(value, index, collection); - return !result; - }); - return !!result; - } - - /** - * The base implementation of `wrapperValue` which returns the result of - * performing a sequence of actions on the unwrapped `value`, where each - * successive action is supplied the return value of the previous. - * - * @private - * @param {*} value The unwrapped value. - * @param {Array} actions Actions to perform to resolve the unwrapped value. - * @returns {*} Returns the resolved value. - */ - function baseWrapperValue(value, actions) { - var result = value; - return reduce(actions, function(result, action) { - return action.func.apply(action.thisArg, arrayPush([result], action.args)); - }, result); - } - - /** - * Compares values to sort them in ascending order. - * - * @private - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {number} Returns the sort order indicator for `value`. - */ - function compareAscending(value, other) { - if (value !== other) { - var valIsDefined = value !== undefined, - valIsNull = value === null, - valIsReflexive = value === value, - valIsSymbol = false; - - var othIsDefined = other !== undefined, - othIsNull = other === null, - othIsReflexive = other === other, - othIsSymbol = false; - - if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) || - (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) || - (valIsNull && othIsDefined && othIsReflexive) || - (!valIsDefined && othIsReflexive) || - !valIsReflexive) { - return 1; - } - if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) || - (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) || - (othIsNull && valIsDefined && valIsReflexive) || - (!othIsDefined && valIsReflexive) || - !othIsReflexive) { - return -1; - } - } - return 0; - } - - /** - * Copies properties of `source` to `object`. - * - * @private - * @param {Object} source The object to copy properties from. - * @param {Array} props The property identifiers to copy. - * @param {Object} [object={}] The object to copy properties to. - * @param {Function} [customizer] The function to customize copied values. - * @returns {Object} Returns `object`. - */ - function copyObject(source, props, object, customizer) { - var isNew = !object; - object || (object = {}); - - var index = -1, - length = props.length; - - while (++index < length) { - var key = props[index]; - - var newValue = customizer - ? customizer(object[key], source[key], key, object, source) - : undefined; - - if (newValue === undefined) { - newValue = source[key]; - } - if (isNew) { - baseAssignValue(object, key, newValue); - } else { - assignValue(object, key, newValue); - } - } - return object; - } - - /** - * Creates a function like `_.assign`. - * - * @private - * @param {Function} assigner The function to assign values. - * @returns {Function} Returns the new assigner function. - */ - function createAssigner(assigner) { - return baseRest(function(object, sources) { - var index = -1, - length = sources.length, - customizer = length > 1 ? sources[length - 1] : undefined; - - customizer = (assigner.length > 3 && typeof customizer == 'function') - ? (length--, customizer) - : undefined; - - object = Object(object); - while (++index < length) { - var source = sources[index]; - if (source) { - assigner(object, source, index, customizer); - } - } - return object; - }); - } - - /** - * Creates a `baseEach` or `baseEachRight` function. - * - * @private - * @param {Function} eachFunc The function to iterate over a collection. - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {Function} Returns the new base function. - */ - function createBaseEach(eachFunc, fromRight) { - return function(collection, iteratee) { - if (collection == null) { - return collection; - } - if (!isArrayLike(collection)) { - return eachFunc(collection, iteratee); - } - var length = collection.length, - index = fromRight ? length : -1, - iterable = Object(collection); - - while ((fromRight ? index-- : ++index < length)) { - if (iteratee(iterable[index], index, iterable) === false) { - break; - } - } - return collection; - }; - } - - /** - * Creates a base function for methods like `_.forIn` and `_.forOwn`. - * - * @private - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {Function} Returns the new base function. - */ - function createBaseFor(fromRight) { - return function(object, iteratee, keysFunc) { - var index = -1, - iterable = Object(object), - props = keysFunc(object), - length = props.length; - - while (length--) { - var key = props[fromRight ? length : ++index]; - if (iteratee(iterable[key], key, iterable) === false) { - break; - } - } - return object; - }; - } - - /** - * Creates a function that produces an instance of `Ctor` regardless of - * whether it was invoked as part of a `new` expression or by `call` or `apply`. - * - * @private - * @param {Function} Ctor The constructor to wrap. - * @returns {Function} Returns the new wrapped function. - */ - function createCtor(Ctor) { - return function() { - // Use a `switch` statement to work with class constructors. See - // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist - // for more details. - var args = arguments; - var thisBinding = baseCreate(Ctor.prototype), - result = Ctor.apply(thisBinding, args); - - // Mimic the constructor's `return` behavior. - // See https://es5.github.io/#x13.2.2 for more details. - return isObject(result) ? result : thisBinding; - }; - } - - /** - * Creates a `_.find` or `_.findLast` function. - * - * @private - * @param {Function} findIndexFunc The function to find the collection index. - * @returns {Function} Returns the new find function. - */ - function createFind(findIndexFunc) { - return function(collection, predicate, fromIndex) { - var iterable = Object(collection); - if (!isArrayLike(collection)) { - var iteratee = baseIteratee(predicate, 3); - collection = keys(collection); - predicate = function(key) { return iteratee(iterable[key], key, iterable); }; - } - var index = findIndexFunc(collection, predicate, fromIndex); - return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined; - }; - } - - /** - * Creates a function that wraps `func` to invoke it with the `this` binding - * of `thisArg` and `partials` prepended to the arguments it receives. - * - * @private - * @param {Function} func The function to wrap. - * @param {number} bitmask The bitmask flags. See `createWrap` for more details. - * @param {*} thisArg The `this` binding of `func`. - * @param {Array} partials The arguments to prepend to those provided to - * the new function. - * @returns {Function} Returns the new wrapped function. - */ - function createPartial(func, bitmask, thisArg, partials) { - if (typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - var isBind = bitmask & WRAP_BIND_FLAG, - Ctor = createCtor(func); - - function wrapper() { - var argsIndex = -1, - argsLength = arguments.length, - leftIndex = -1, - leftLength = partials.length, - args = Array(leftLength + argsLength), - fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; - - while (++leftIndex < leftLength) { - args[leftIndex] = partials[leftIndex]; - } - while (argsLength--) { - args[leftIndex++] = arguments[++argsIndex]; - } - return fn.apply(isBind ? thisArg : this, args); - } - return wrapper; - } - - /** - * A specialized version of `baseIsEqualDeep` for arrays with support for - * partial deep comparisons. - * - * @private - * @param {Array} array The array to compare. - * @param {Array} other The other array to compare. - * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. - * @param {Function} customizer The function to customize comparisons. - * @param {Function} equalFunc The function to determine equivalents of values. - * @param {Object} stack Tracks traversed `array` and `other` objects. - * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`. - */ - function equalArrays(array, other, bitmask, customizer, equalFunc, stack) { - var isPartial = bitmask & COMPARE_PARTIAL_FLAG, - arrLength = array.length, - othLength = other.length; - - if (arrLength != othLength && !(isPartial && othLength > arrLength)) { - return false; - } - // Check that cyclic values are equal. - var arrStacked = stack.get(array); - var othStacked = stack.get(other); - if (arrStacked && othStacked) { - return arrStacked == other && othStacked == array; - } - var index = -1, - result = true, - seen = (bitmask & COMPARE_UNORDERED_FLAG) ? [] : undefined; - - // Ignore non-index properties. - while (++index < arrLength) { - var arrValue = array[index], - othValue = other[index]; - - var compared; - if (compared !== undefined) { - if (compared) { - continue; - } - result = false; - break; - } - // Recursively compare arrays (susceptible to call stack limits). - if (seen) { - if (!baseSome(other, function(othValue, othIndex) { - if (!indexOf(seen, othIndex) && - (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) { - return seen.push(othIndex); - } - })) { - result = false; - break; - } - } else if (!( - arrValue === othValue || - equalFunc(arrValue, othValue, bitmask, customizer, stack) - )) { - result = false; - break; - } - } - return result; - } - - /** - * A specialized version of `baseIsEqualDeep` for comparing objects of - * the same `toStringTag`. - * - * **Note:** This function only supports comparing values with tags of - * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. - * - * @private - * @param {Object} object The object to compare. - * @param {Object} other The other object to compare. - * @param {string} tag The `toStringTag` of the objects to compare. - * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. - * @param {Function} customizer The function to customize comparisons. - * @param {Function} equalFunc The function to determine equivalents of values. - * @param {Object} stack Tracks traversed `object` and `other` objects. - * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. - */ - function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) { - switch (tag) { - - case boolTag: - case dateTag: - case numberTag: - // Coerce booleans to `1` or `0` and dates to milliseconds. - // Invalid dates are coerced to `NaN`. - return eq(+object, +other); - - case errorTag: - return object.name == other.name && object.message == other.message; - - case regexpTag: - case stringTag: - // Coerce regexes to strings and treat strings, primitives and objects, - // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring - // for more details. - return object == (other + ''); - - } - return false; - } - - /** - * A specialized version of `baseIsEqualDeep` for objects with support for - * partial deep comparisons. - * - * @private - * @param {Object} object The object to compare. - * @param {Object} other The other object to compare. - * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. - * @param {Function} customizer The function to customize comparisons. - * @param {Function} equalFunc The function to determine equivalents of values. - * @param {Object} stack Tracks traversed `object` and `other` objects. - * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. - */ - function equalObjects(object, other, bitmask, customizer, equalFunc, stack) { - var isPartial = bitmask & COMPARE_PARTIAL_FLAG, - objProps = keys(object), - objLength = objProps.length, - othProps = keys(other), - othLength = othProps.length; - - if (objLength != othLength && !isPartial) { - return false; - } - var index = objLength; - while (index--) { - var key = objProps[index]; - if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) { - return false; - } - } - // Check that cyclic values are equal. - var objStacked = stack.get(object); - var othStacked = stack.get(other); - if (objStacked && othStacked) { - return objStacked == other && othStacked == object; - } - var result = true; - - var skipCtor = isPartial; - while (++index < objLength) { - key = objProps[index]; - var objValue = object[key], - othValue = other[key]; - - var compared; - // Recursively compare objects (susceptible to call stack limits). - if (!(compared === undefined - ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack)) - : compared - )) { - result = false; - break; - } - skipCtor || (skipCtor = key == 'constructor'); - } - if (result && !skipCtor) { - var objCtor = object.constructor, - othCtor = other.constructor; - - // Non `Object` object instances with different constructors are not equal. - if (objCtor != othCtor && - ('constructor' in object && 'constructor' in other) && - !(typeof objCtor == 'function' && objCtor instanceof objCtor && - typeof othCtor == 'function' && othCtor instanceof othCtor)) { - result = false; - } - } - return result; - } - - /** - * A specialized version of `baseRest` which flattens the rest array. - * - * @private - * @param {Function} func The function to apply a rest parameter to. - * @returns {Function} Returns the new function. - */ - function flatRest(func) { - return setToString(overRest(func, undefined, flatten), func + ''); - } - - /** - * Checks if `value` is a flattenable `arguments` object or array. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is flattenable, else `false`. - */ - function isFlattenable(value) { - return isArray(value) || isArguments(value); - } - - /** - * Checks if `value` is a valid array-like index. - * - * @private - * @param {*} value The value to check. - * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. - * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. - */ - function isIndex(value, length) { - var type = typeof value; - length = length == null ? MAX_SAFE_INTEGER : length; - - return !!length && - (type == 'number' || - (type != 'symbol' && reIsUint.test(value))) && - (value > -1 && value % 1 == 0 && value < length); - } - - /** - * Checks if the given arguments are from an iteratee call. - * - * @private - * @param {*} value The potential iteratee value argument. - * @param {*} index The potential iteratee index or key argument. - * @param {*} object The potential iteratee object argument. - * @returns {boolean} Returns `true` if the arguments are from an iteratee call, - * else `false`. - */ - function isIterateeCall(value, index, object) { - if (!isObject(object)) { - return false; - } - var type = typeof index; - if (type == 'number' - ? (isArrayLike(object) && isIndex(index, object.length)) - : (type == 'string' && index in object) - ) { - return eq(object[index], value); - } - return false; - } - - /** - * This function is like - * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) - * except that it includes inherited enumerable properties. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. - */ - function nativeKeysIn(object) { - var result = []; - if (object != null) { - for (var key in Object(object)) { - result.push(key); - } - } - return result; - } - - /** - * Converts `value` to a string using `Object.prototype.toString`. - * - * @private - * @param {*} value The value to convert. - * @returns {string} Returns the converted string. - */ - function objectToString(value) { - return nativeObjectToString.call(value); - } - - /** - * A specialized version of `baseRest` which transforms the rest array. - * - * @private - * @param {Function} func The function to apply a rest parameter to. - * @param {number} [start=func.length-1] The start position of the rest parameter. - * @param {Function} transform The rest array transform. - * @returns {Function} Returns the new function. - */ - function overRest(func, start, transform) { - start = nativeMax(start === undefined ? (func.length - 1) : start, 0); - return function() { - var args = arguments, - index = -1, - length = nativeMax(args.length - start, 0), - array = Array(length); - - while (++index < length) { - array[index] = args[start + index]; - } - index = -1; - var otherArgs = Array(start + 1); - while (++index < start) { - otherArgs[index] = args[index]; - } - otherArgs[start] = transform(array); - return func.apply(this, otherArgs); - }; - } - - /** - * Sets the `toString` method of `func` to return `string`. - * - * @private - * @param {Function} func The function to modify. - * @param {Function} string The `toString` result. - * @returns {Function} Returns `func`. - */ - var setToString = identity; - - /*------------------------------------------------------------------------*/ - - /** - * Creates an array with all falsey values removed. The values `false`, `null`, - * `0`, `""`, `undefined`, and `NaN` are falsey. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Array - * @param {Array} array The array to compact. - * @returns {Array} Returns the new array of filtered values. - * @example - * - * _.compact([0, 1, false, 2, '', 3]); - * // => [1, 2, 3] - */ - function compact(array) { - return baseFilter(array, Boolean); - } - - /** - * Creates a new array concatenating `array` with any additional arrays - * and/or values. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {Array} array The array to concatenate. - * @param {...*} [values] The values to concatenate. - * @returns {Array} Returns the new concatenated array. - * @example - * - * var array = [1]; - * var other = _.concat(array, 2, [3], [[4]]); - * - * console.log(other); - * // => [1, 2, 3, [4]] - * - * console.log(array); - * // => [1] - */ - function concat() { - var length = arguments.length; - if (!length) { - return []; - } - var args = Array(length - 1), - array = arguments[0], - index = length; - - while (index--) { - args[index - 1] = arguments[index]; - } - return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1)); - } - - /** - * This method is like `_.find` except that it returns the index of the first - * element `predicate` returns truthy for instead of the element itself. - * - * @static - * @memberOf _ - * @since 1.1.0 - * @category Array - * @param {Array} array The array to inspect. - * @param {Function} [predicate=_.identity] The function invoked per iteration. - * @param {number} [fromIndex=0] The index to search from. - * @returns {number} Returns the index of the found element, else `-1`. - * @example - * - * var users = [ - * { 'user': 'barney', 'active': false }, - * { 'user': 'fred', 'active': false }, - * { 'user': 'pebbles', 'active': true } - * ]; - * - * _.findIndex(users, function(o) { return o.user == 'barney'; }); - * // => 0 - * - * // The `_.matches` iteratee shorthand. - * _.findIndex(users, { 'user': 'fred', 'active': false }); - * // => 1 - * - * // The `_.matchesProperty` iteratee shorthand. - * _.findIndex(users, ['active', false]); - * // => 0 - * - * // The `_.property` iteratee shorthand. - * _.findIndex(users, 'active'); - * // => 2 - */ - function findIndex(array, predicate, fromIndex) { - var length = array == null ? 0 : array.length; - if (!length) { - return -1; - } - var index = fromIndex == null ? 0 : toInteger(fromIndex); - if (index < 0) { - index = nativeMax(length + index, 0); - } - return baseFindIndex(array, baseIteratee(predicate, 3), index); - } - - /** - * Flattens `array` a single level deep. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Array - * @param {Array} array The array to flatten. - * @returns {Array} Returns the new flattened array. - * @example - * - * _.flatten([1, [2, [3, [4]], 5]]); - * // => [1, 2, [3, [4]], 5] - */ - function flatten(array) { - var length = array == null ? 0 : array.length; - return length ? baseFlatten(array, 1) : []; - } - - /** - * Recursively flattens `array`. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Array - * @param {Array} array The array to flatten. - * @returns {Array} Returns the new flattened array. - * @example - * - * _.flattenDeep([1, [2, [3, [4]], 5]]); - * // => [1, 2, 3, 4, 5] - */ - function flattenDeep(array) { - var length = array == null ? 0 : array.length; - return length ? baseFlatten(array, INFINITY) : []; - } - - /** - * Gets the first element of `array`. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @alias first - * @category Array - * @param {Array} array The array to query. - * @returns {*} Returns the first element of `array`. - * @example - * - * _.head([1, 2, 3]); - * // => 1 - * - * _.head([]); - * // => undefined - */ - function head(array) { - return (array && array.length) ? array[0] : undefined; - } - - /** - * Gets the index at which the first occurrence of `value` is found in `array` - * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) - * for equality comparisons. If `fromIndex` is negative, it's used as the - * offset from the end of `array`. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Array - * @param {Array} array The array to inspect. - * @param {*} value The value to search for. - * @param {number} [fromIndex=0] The index to search from. - * @returns {number} Returns the index of the matched value, else `-1`. - * @example - * - * _.indexOf([1, 2, 1, 2], 2); - * // => 1 - * - * // Search from the `fromIndex`. - * _.indexOf([1, 2, 1, 2], 2, 2); - * // => 3 - */ - function indexOf(array, value, fromIndex) { - var length = array == null ? 0 : array.length; - if (typeof fromIndex == 'number') { - fromIndex = fromIndex < 0 ? nativeMax(length + fromIndex, 0) : fromIndex; - } else { - fromIndex = 0; - } - var index = (fromIndex || 0) - 1, - isReflexive = value === value; - - while (++index < length) { - var other = array[index]; - if ((isReflexive ? other === value : other !== other)) { - return index; - } - } - return -1; - } - - /** - * Gets the last element of `array`. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Array - * @param {Array} array The array to query. - * @returns {*} Returns the last element of `array`. - * @example - * - * _.last([1, 2, 3]); - * // => 3 - */ - function last(array) { - var length = array == null ? 0 : array.length; - return length ? array[length - 1] : undefined; - } - - /** - * Creates a slice of `array` from `start` up to, but not including, `end`. - * - * **Note:** This method is used instead of - * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are - * returned. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Array - * @param {Array} array The array to slice. - * @param {number} [start=0] The start position. - * @param {number} [end=array.length] The end position. - * @returns {Array} Returns the slice of `array`. - */ - function slice(array, start, end) { - var length = array == null ? 0 : array.length; - start = start == null ? 0 : +start; - end = end === undefined ? length : +end; - return length ? baseSlice(array, start, end) : []; - } - - /*------------------------------------------------------------------------*/ - - /** - * Creates a `lodash` wrapper instance that wraps `value` with explicit method - * chain sequences enabled. The result of such sequences must be unwrapped - * with `_#value`. - * - * @static - * @memberOf _ - * @since 1.3.0 - * @category Seq - * @param {*} value The value to wrap. - * @returns {Object} Returns the new `lodash` wrapper instance. - * @example - * - * var users = [ - * { 'user': 'barney', 'age': 36 }, - * { 'user': 'fred', 'age': 40 }, - * { 'user': 'pebbles', 'age': 1 } - * ]; - * - * var youngest = _ - * .chain(users) - * .sortBy('age') - * .map(function(o) { - * return o.user + ' is ' + o.age; - * }) - * .head() - * .value(); - * // => 'pebbles is 1' - */ - function chain(value) { - var result = lodash(value); - result.__chain__ = true; - return result; - } - - /** - * This method invokes `interceptor` and returns `value`. The interceptor - * is invoked with one argument; (value). The purpose of this method is to - * "tap into" a method chain sequence in order to modify intermediate results. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Seq - * @param {*} value The value to provide to `interceptor`. - * @param {Function} interceptor The function to invoke. - * @returns {*} Returns `value`. - * @example - * - * _([1, 2, 3]) - * .tap(function(array) { - * // Mutate input array. - * array.pop(); - * }) - * .reverse() - * .value(); - * // => [2, 1] - */ - function tap(value, interceptor) { - interceptor(value); - return value; - } - - /** - * This method is like `_.tap` except that it returns the result of `interceptor`. - * The purpose of this method is to "pass thru" values replacing intermediate - * results in a method chain sequence. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Seq - * @param {*} value The value to provide to `interceptor`. - * @param {Function} interceptor The function to invoke. - * @returns {*} Returns the result of `interceptor`. - * @example - * - * _(' abc ') - * .chain() - * .trim() - * .thru(function(value) { - * return [value]; - * }) - * .value(); - * // => ['abc'] - */ - function thru(value, interceptor) { - return interceptor(value); - } - - /** - * Creates a `lodash` wrapper instance with explicit method chain sequences enabled. - * - * @name chain - * @memberOf _ - * @since 0.1.0 - * @category Seq - * @returns {Object} Returns the new `lodash` wrapper instance. - * @example - * - * var users = [ - * { 'user': 'barney', 'age': 36 }, - * { 'user': 'fred', 'age': 40 } - * ]; - * - * // A sequence without explicit chaining. - * _(users).head(); - * // => { 'user': 'barney', 'age': 36 } - * - * // A sequence with explicit chaining. - * _(users) - * .chain() - * .head() - * .pick('user') - * .value(); - * // => { 'user': 'barney' } - */ - function wrapperChain() { - return chain(this); - } - - /** - * Executes the chain sequence to resolve the unwrapped value. - * - * @name value - * @memberOf _ - * @since 0.1.0 - * @alias toJSON, valueOf - * @category Seq - * @returns {*} Returns the resolved unwrapped value. - * @example - * - * _([1, 2, 3]).value(); - * // => [1, 2, 3] - */ - function wrapperValue() { - return baseWrapperValue(this.__wrapped__, this.__actions__); - } - - /*------------------------------------------------------------------------*/ - - /** - * Checks if `predicate` returns truthy for **all** elements of `collection`. - * Iteration is stopped once `predicate` returns falsey. The predicate is - * invoked with three arguments: (value, index|key, collection). - * - * **Note:** This method returns `true` for - * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because - * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of - * elements of empty collections. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [predicate=_.identity] The function invoked per iteration. - * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. - * @returns {boolean} Returns `true` if all elements pass the predicate check, - * else `false`. - * @example - * - * _.every([true, 1, null, 'yes'], Boolean); - * // => false - * - * var users = [ - * { 'user': 'barney', 'age': 36, 'active': false }, - * { 'user': 'fred', 'age': 40, 'active': false } - * ]; - * - * // The `_.matches` iteratee shorthand. - * _.every(users, { 'user': 'barney', 'active': false }); - * // => false - * - * // The `_.matchesProperty` iteratee shorthand. - * _.every(users, ['active', false]); - * // => true - * - * // The `_.property` iteratee shorthand. - * _.every(users, 'active'); - * // => false - */ - function every(collection, predicate, guard) { - predicate = guard ? undefined : predicate; - return baseEvery(collection, baseIteratee(predicate)); - } - - /** - * Iterates over elements of `collection`, returning an array of all elements - * `predicate` returns truthy for. The predicate is invoked with three - * arguments: (value, index|key, collection). - * - * **Note:** Unlike `_.remove`, this method returns a new array. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [predicate=_.identity] The function invoked per iteration. - * @returns {Array} Returns the new filtered array. - * @see _.reject - * @example - * - * var users = [ - * { 'user': 'barney', 'age': 36, 'active': true }, - * { 'user': 'fred', 'age': 40, 'active': false } - * ]; - * - * _.filter(users, function(o) { return !o.active; }); - * // => objects for ['fred'] - * - * // The `_.matches` iteratee shorthand. - * _.filter(users, { 'age': 36, 'active': true }); - * // => objects for ['barney'] - * - * // The `_.matchesProperty` iteratee shorthand. - * _.filter(users, ['active', false]); - * // => objects for ['fred'] - * - * // The `_.property` iteratee shorthand. - * _.filter(users, 'active'); - * // => objects for ['barney'] - * - * // Combining several predicates using `_.overEvery` or `_.overSome`. - * _.filter(users, _.overSome([{ 'age': 36 }, ['age', 40]])); - * // => objects for ['fred', 'barney'] - */ - function filter(collection, predicate) { - return baseFilter(collection, baseIteratee(predicate)); - } - - /** - * Iterates over elements of `collection`, returning the first element - * `predicate` returns truthy for. The predicate is invoked with three - * arguments: (value, index|key, collection). - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Collection - * @param {Array|Object} collection The collection to inspect. - * @param {Function} [predicate=_.identity] The function invoked per iteration. - * @param {number} [fromIndex=0] The index to search from. - * @returns {*} Returns the matched element, else `undefined`. - * @example - * - * var users = [ - * { 'user': 'barney', 'age': 36, 'active': true }, - * { 'user': 'fred', 'age': 40, 'active': false }, - * { 'user': 'pebbles', 'age': 1, 'active': true } - * ]; - * - * _.find(users, function(o) { return o.age < 40; }); - * // => object for 'barney' - * - * // The `_.matches` iteratee shorthand. - * _.find(users, { 'age': 1, 'active': true }); - * // => object for 'pebbles' - * - * // The `_.matchesProperty` iteratee shorthand. - * _.find(users, ['active', false]); - * // => object for 'fred' - * - * // The `_.property` iteratee shorthand. - * _.find(users, 'active'); - * // => object for 'barney' - */ - var find = createFind(findIndex); - - /** - * Iterates over elements of `collection` and invokes `iteratee` for each element. - * The iteratee is invoked with three arguments: (value, index|key, collection). - * Iteratee functions may exit iteration early by explicitly returning `false`. - * - * **Note:** As with other "Collections" methods, objects with a "length" - * property are iterated like arrays. To avoid this behavior use `_.forIn` - * or `_.forOwn` for object iteration. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @alias each - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @returns {Array|Object} Returns `collection`. - * @see _.forEachRight - * @example - * - * _.forEach([1, 2], function(value) { - * console.log(value); - * }); - * // => Logs `1` then `2`. - * - * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) { - * console.log(key); - * }); - * // => Logs 'a' then 'b' (iteration order is not guaranteed). - */ - function forEach(collection, iteratee) { - return baseEach(collection, baseIteratee(iteratee)); - } - - /** - * Creates an array of values by running each element in `collection` thru - * `iteratee`. The iteratee is invoked with three arguments: - * (value, index|key, collection). - * - * Many lodash methods are guarded to work as iteratees for methods like - * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`. - * - * The guarded methods are: - * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`, - * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`, - * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`, - * `template`, `trim`, `trimEnd`, `trimStart`, and `words` - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @returns {Array} Returns the new mapped array. - * @example - * - * function square(n) { - * return n * n; - * } - * - * _.map([4, 8], square); - * // => [16, 64] - * - * _.map({ 'a': 4, 'b': 8 }, square); - * // => [16, 64] (iteration order is not guaranteed) - * - * var users = [ - * { 'user': 'barney' }, - * { 'user': 'fred' } - * ]; - * - * // The `_.property` iteratee shorthand. - * _.map(users, 'user'); - * // => ['barney', 'fred'] - */ - function map(collection, iteratee) { - return baseMap(collection, baseIteratee(iteratee)); - } - - /** - * Reduces `collection` to a value which is the accumulated result of running - * each element in `collection` thru `iteratee`, where each successive - * invocation is supplied the return value of the previous. If `accumulator` - * is not given, the first element of `collection` is used as the initial - * value. The iteratee is invoked with four arguments: - * (accumulator, value, index|key, collection). - * - * Many lodash methods are guarded to work as iteratees for methods like - * `_.reduce`, `_.reduceRight`, and `_.transform`. - * - * The guarded methods are: - * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`, - * and `sortBy` - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @param {*} [accumulator] The initial value. - * @returns {*} Returns the accumulated value. - * @see _.reduceRight - * @example - * - * _.reduce([1, 2], function(sum, n) { - * return sum + n; - * }, 0); - * // => 3 - * - * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) { - * (result[value] || (result[value] = [])).push(key); - * return result; - * }, {}); - * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed) - */ - function reduce(collection, iteratee, accumulator) { - return baseReduce(collection, baseIteratee(iteratee), accumulator, arguments.length < 3, baseEach); - } - - /** - * Gets the size of `collection` by returning its length for array-like - * values or the number of own enumerable string keyed properties for objects. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Collection - * @param {Array|Object|string} collection The collection to inspect. - * @returns {number} Returns the collection size. - * @example - * - * _.size([1, 2, 3]); - * // => 3 - * - * _.size({ 'a': 1, 'b': 2 }); - * // => 2 - * - * _.size('pebbles'); - * // => 7 - */ - function size(collection) { - if (collection == null) { - return 0; - } - collection = isArrayLike(collection) ? collection : nativeKeys(collection); - return collection.length; - } - - /** - * Checks if `predicate` returns truthy for **any** element of `collection`. - * Iteration is stopped once `predicate` returns truthy. The predicate is - * invoked with three arguments: (value, index|key, collection). - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [predicate=_.identity] The function invoked per iteration. - * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. - * @returns {boolean} Returns `true` if any element passes the predicate check, - * else `false`. - * @example - * - * _.some([null, 0, 'yes', false], Boolean); - * // => true - * - * var users = [ - * { 'user': 'barney', 'active': true }, - * { 'user': 'fred', 'active': false } - * ]; - * - * // The `_.matches` iteratee shorthand. - * _.some(users, { 'user': 'barney', 'active': false }); - * // => false - * - * // The `_.matchesProperty` iteratee shorthand. - * _.some(users, ['active', false]); - * // => true - * - * // The `_.property` iteratee shorthand. - * _.some(users, 'active'); - * // => true - */ - function some(collection, predicate, guard) { - predicate = guard ? undefined : predicate; - return baseSome(collection, baseIteratee(predicate)); - } - - /** - * Creates an array of elements, sorted in ascending order by the results of - * running each element in a collection thru each iteratee. This method - * performs a stable sort, that is, it preserves the original sort order of - * equal elements. The iteratees are invoked with one argument: (value). - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {...(Function|Function[])} [iteratees=[_.identity]] - * The iteratees to sort by. - * @returns {Array} Returns the new sorted array. - * @example - * - * var users = [ - * { 'user': 'fred', 'age': 48 }, - * { 'user': 'barney', 'age': 36 }, - * { 'user': 'fred', 'age': 30 }, - * { 'user': 'barney', 'age': 34 } - * ]; - * - * _.sortBy(users, [function(o) { return o.user; }]); - * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 30]] - * - * _.sortBy(users, ['user', 'age']); - * // => objects for [['barney', 34], ['barney', 36], ['fred', 30], ['fred', 48]] - */ - function sortBy(collection, iteratee) { - var index = 0; - iteratee = baseIteratee(iteratee); - - return baseMap(baseMap(collection, function(value, key, collection) { - return { 'value': value, 'index': index++, 'criteria': iteratee(value, key, collection) }; - }).sort(function(object, other) { - return compareAscending(object.criteria, other.criteria) || (object.index - other.index); - }), baseProperty('value')); - } - - /*------------------------------------------------------------------------*/ - - /** - * Creates a function that invokes `func`, with the `this` binding and arguments - * of the created function, while it's called less than `n` times. Subsequent - * calls to the created function return the result of the last `func` invocation. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Function - * @param {number} n The number of calls at which `func` is no longer invoked. - * @param {Function} func The function to restrict. - * @returns {Function} Returns the new restricted function. - * @example - * - * jQuery(element).on('click', _.before(5, addContactToList)); - * // => Allows adding up to 4 contacts to the list. - */ - function before(n, func) { - var result; - if (typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - n = toInteger(n); - return function() { - if (--n > 0) { - result = func.apply(this, arguments); - } - if (n <= 1) { - func = undefined; - } - return result; - }; - } - - /** - * Creates a function that invokes `func` with the `this` binding of `thisArg` - * and `partials` prepended to the arguments it receives. - * - * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds, - * may be used as a placeholder for partially applied arguments. - * - * **Note:** Unlike native `Function#bind`, this method doesn't set the "length" - * property of bound functions. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Function - * @param {Function} func The function to bind. - * @param {*} thisArg The `this` binding of `func`. - * @param {...*} [partials] The arguments to be partially applied. - * @returns {Function} Returns the new bound function. - * @example - * - * function greet(greeting, punctuation) { - * return greeting + ' ' + this.user + punctuation; - * } - * - * var object = { 'user': 'fred' }; - * - * var bound = _.bind(greet, object, 'hi'); - * bound('!'); - * // => 'hi fred!' - * - * // Bound with placeholders. - * var bound = _.bind(greet, object, _, '!'); - * bound('hi'); - * // => 'hi fred!' - */ - var bind = baseRest(function(func, thisArg, partials) { - return createPartial(func, WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG, thisArg, partials); - }); - - /** - * Defers invoking the `func` until the current call stack has cleared. Any - * additional arguments are provided to `func` when it's invoked. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Function - * @param {Function} func The function to defer. - * @param {...*} [args] The arguments to invoke `func` with. - * @returns {number} Returns the timer id. - * @example - * - * _.defer(function(text) { - * console.log(text); - * }, 'deferred'); - * // => Logs 'deferred' after one millisecond. - */ - var defer = baseRest(function(func, args) { - return baseDelay(func, 1, args); - }); - - /** - * Invokes `func` after `wait` milliseconds. Any additional arguments are - * provided to `func` when it's invoked. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Function - * @param {Function} func The function to delay. - * @param {number} wait The number of milliseconds to delay invocation. - * @param {...*} [args] The arguments to invoke `func` with. - * @returns {number} Returns the timer id. - * @example - * - * _.delay(function(text) { - * console.log(text); - * }, 1000, 'later'); - * // => Logs 'later' after one second. - */ - var delay = baseRest(function(func, wait, args) { - return baseDelay(func, toNumber(wait) || 0, args); - }); - - /** - * Creates a function that negates the result of the predicate `func`. The - * `func` predicate is invoked with the `this` binding and arguments of the - * created function. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Function - * @param {Function} predicate The predicate to negate. - * @returns {Function} Returns the new negated function. - * @example - * - * function isEven(n) { - * return n % 2 == 0; - * } - * - * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven)); - * // => [1, 3, 5] - */ - function negate(predicate) { - if (typeof predicate != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - return function() { - var args = arguments; - return !predicate.apply(this, args); - }; - } - - /** - * Creates a function that is restricted to invoking `func` once. Repeat calls - * to the function return the value of the first invocation. The `func` is - * invoked with the `this` binding and arguments of the created function. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Function - * @param {Function} func The function to restrict. - * @returns {Function} Returns the new restricted function. - * @example - * - * var initialize = _.once(createApplication); - * initialize(); - * initialize(); - * // => `createApplication` is invoked once - */ - function once(func) { - return before(2, func); - } - - /*------------------------------------------------------------------------*/ - - /** - * Creates a shallow clone of `value`. - * - * **Note:** This method is loosely based on the - * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm) - * and supports cloning arrays, array buffers, booleans, date objects, maps, - * numbers, `Object` objects, regexes, sets, strings, symbols, and typed - * arrays. The own enumerable properties of `arguments` objects are cloned - * as plain objects. An empty object is returned for uncloneable values such - * as error objects, functions, DOM nodes, and WeakMaps. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to clone. - * @returns {*} Returns the cloned value. - * @see _.cloneDeep - * @example - * - * var objects = [{ 'a': 1 }, { 'b': 2 }]; - * - * var shallow = _.clone(objects); - * console.log(shallow[0] === objects[0]); - * // => true - */ - function clone(value) { - if (!isObject(value)) { - return value; - } - return isArray(value) ? copyArray(value) : copyObject(value, nativeKeys(value)); - } - - /** - * Performs a - * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) - * comparison between two values to determine if they are equivalent. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if the values are equivalent, else `false`. - * @example - * - * var object = { 'a': 1 }; - * var other = { 'a': 1 }; - * - * _.eq(object, object); - * // => true - * - * _.eq(object, other); - * // => false - * - * _.eq('a', 'a'); - * // => true - * - * _.eq('a', Object('a')); - * // => false - * - * _.eq(NaN, NaN); - * // => true - */ - function eq(value, other) { - return value === other || (value !== value && other !== other); - } - - /** - * Checks if `value` is likely an `arguments` object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an `arguments` object, - * else `false`. - * @example - * - * _.isArguments(function() { return arguments; }()); - * // => true - * - * _.isArguments([1, 2, 3]); - * // => false - */ - var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) { - return isObjectLike(value) && hasOwnProperty.call(value, 'callee') && - !propertyIsEnumerable.call(value, 'callee'); - }; - - /** - * Checks if `value` is classified as an `Array` object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an array, else `false`. - * @example - * - * _.isArray([1, 2, 3]); - * // => true - * - * _.isArray(document.body.children); - * // => false - * - * _.isArray('abc'); - * // => false - * - * _.isArray(_.noop); - * // => false - */ - var isArray = Array.isArray; - - /** - * Checks if `value` is array-like. A value is considered array-like if it's - * not a function and has a `value.length` that's an integer greater than or - * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is array-like, else `false`. - * @example - * - * _.isArrayLike([1, 2, 3]); - * // => true - * - * _.isArrayLike(document.body.children); - * // => true - * - * _.isArrayLike('abc'); - * // => true - * - * _.isArrayLike(_.noop); - * // => false - */ - function isArrayLike(value) { - return value != null && isLength(value.length) && !isFunction(value); - } - - /** - * Checks if `value` is classified as a boolean primitive or object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a boolean, else `false`. - * @example - * - * _.isBoolean(false); - * // => true - * - * _.isBoolean(null); - * // => false - */ - function isBoolean(value) { - return value === true || value === false || - (isObjectLike(value) && baseGetTag(value) == boolTag); - } - - /** - * Checks if `value` is classified as a `Date` object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a date object, else `false`. - * @example - * - * _.isDate(new Date); - * // => true - * - * _.isDate('Mon April 23 2012'); - * // => false - */ - var isDate = baseIsDate; - - /** - * Checks if `value` is an empty object, collection, map, or set. - * - * Objects are considered empty if they have no own enumerable string keyed - * properties. - * - * Array-like values such as `arguments` objects, arrays, buffers, strings, or - * jQuery-like collections are considered empty if they have a `length` of `0`. - * Similarly, maps and sets are considered empty if they have a `size` of `0`. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is empty, else `false`. - * @example - * - * _.isEmpty(null); - * // => true - * - * _.isEmpty(true); - * // => true - * - * _.isEmpty(1); - * // => true - * - * _.isEmpty([1, 2, 3]); - * // => false - * - * _.isEmpty({ 'a': 1 }); - * // => false - */ - function isEmpty(value) { - if (isArrayLike(value) && - (isArray(value) || isString(value) || - isFunction(value.splice) || isArguments(value))) { - return !value.length; - } - return !nativeKeys(value).length; - } - - /** - * Performs a deep comparison between two values to determine if they are - * equivalent. - * - * **Note:** This method supports comparing arrays, array buffers, booleans, - * date objects, error objects, maps, numbers, `Object` objects, regexes, - * sets, strings, symbols, and typed arrays. `Object` objects are compared - * by their own, not inherited, enumerable properties. Functions and DOM - * nodes are compared by strict equality, i.e. `===`. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if the values are equivalent, else `false`. - * @example - * - * var object = { 'a': 1 }; - * var other = { 'a': 1 }; - * - * _.isEqual(object, other); - * // => true - * - * object === other; - * // => false - */ - function isEqual(value, other) { - return baseIsEqual(value, other); - } - - /** - * Checks if `value` is a finite primitive number. - * - * **Note:** This method is based on - * [`Number.isFinite`](https://mdn.io/Number/isFinite). - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a finite number, else `false`. - * @example - * - * _.isFinite(3); - * // => true - * - * _.isFinite(Number.MIN_VALUE); - * // => true - * - * _.isFinite(Infinity); - * // => false - * - * _.isFinite('3'); - * // => false - */ - function isFinite(value) { - return typeof value == 'number' && nativeIsFinite(value); - } - - /** - * Checks if `value` is classified as a `Function` object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a function, else `false`. - * @example - * - * _.isFunction(_); - * // => true - * - * _.isFunction(/abc/); - * // => false - */ - function isFunction(value) { - if (!isObject(value)) { - return false; - } - // The use of `Object#toString` avoids issues with the `typeof` operator - // in Safari 9 which returns 'object' for typed arrays and other constructors. - var tag = baseGetTag(value); - return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag; - } - - /** - * Checks if `value` is a valid array-like length. - * - * **Note:** This method is loosely based on - * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. - * @example - * - * _.isLength(3); - * // => true - * - * _.isLength(Number.MIN_VALUE); - * // => false - * - * _.isLength(Infinity); - * // => false - * - * _.isLength('3'); - * // => false - */ - function isLength(value) { - return typeof value == 'number' && - value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; - } - - /** - * Checks if `value` is the - * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) - * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an object, else `false`. - * @example - * - * _.isObject({}); - * // => true - * - * _.isObject([1, 2, 3]); - * // => true - * - * _.isObject(_.noop); - * // => true - * - * _.isObject(null); - * // => false - */ - function isObject(value) { - var type = typeof value; - return value != null && (type == 'object' || type == 'function'); - } - - /** - * Checks if `value` is object-like. A value is object-like if it's not `null` - * and has a `typeof` result of "object". - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is object-like, else `false`. - * @example - * - * _.isObjectLike({}); - * // => true - * - * _.isObjectLike([1, 2, 3]); - * // => true - * - * _.isObjectLike(_.noop); - * // => false - * - * _.isObjectLike(null); - * // => false - */ - function isObjectLike(value) { - return value != null && typeof value == 'object'; - } - - /** - * Checks if `value` is `NaN`. - * - * **Note:** This method is based on - * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as - * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for - * `undefined` and other non-number values. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. - * @example - * - * _.isNaN(NaN); - * // => true - * - * _.isNaN(new Number(NaN)); - * // => true - * - * isNaN(undefined); - * // => true - * - * _.isNaN(undefined); - * // => false - */ - function isNaN(value) { - // An `NaN` primitive is the only value that is not equal to itself. - // Perform the `toStringTag` check first to avoid errors with some - // ActiveX objects in IE. - return isNumber(value) && value != +value; - } - - /** - * Checks if `value` is `null`. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is `null`, else `false`. - * @example - * - * _.isNull(null); - * // => true - * - * _.isNull(void 0); - * // => false - */ - function isNull(value) { - return value === null; - } - - /** - * Checks if `value` is classified as a `Number` primitive or object. - * - * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are - * classified as numbers, use the `_.isFinite` method. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a number, else `false`. - * @example - * - * _.isNumber(3); - * // => true - * - * _.isNumber(Number.MIN_VALUE); - * // => true - * - * _.isNumber(Infinity); - * // => true - * - * _.isNumber('3'); - * // => false - */ - function isNumber(value) { - return typeof value == 'number' || - (isObjectLike(value) && baseGetTag(value) == numberTag); - } - - /** - * Checks if `value` is classified as a `RegExp` object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a regexp, else `false`. - * @example - * - * _.isRegExp(/abc/); - * // => true - * - * _.isRegExp('/abc/'); - * // => false - */ - var isRegExp = baseIsRegExp; - - /** - * Checks if `value` is classified as a `String` primitive or object. - * - * @static - * @since 0.1.0 - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a string, else `false`. - * @example - * - * _.isString('abc'); - * // => true - * - * _.isString(1); - * // => false - */ - function isString(value) { - return typeof value == 'string' || - (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag); - } - - /** - * Checks if `value` is `undefined`. - * - * @static - * @since 0.1.0 - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`. - * @example - * - * _.isUndefined(void 0); - * // => true - * - * _.isUndefined(null); - * // => false - */ - function isUndefined(value) { - return value === undefined; - } - - /** - * Converts `value` to an array. - * - * @static - * @since 0.1.0 - * @memberOf _ - * @category Lang - * @param {*} value The value to convert. - * @returns {Array} Returns the converted array. - * @example - * - * _.toArray({ 'a': 1, 'b': 2 }); - * // => [1, 2] - * - * _.toArray('abc'); - * // => ['a', 'b', 'c'] - * - * _.toArray(1); - * // => [] - * - * _.toArray(null); - * // => [] - */ - function toArray(value) { - if (!isArrayLike(value)) { - return values(value); - } - return value.length ? copyArray(value) : []; - } - - /** - * Converts `value` to an integer. - * - * **Note:** This method is loosely based on - * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to convert. - * @returns {number} Returns the converted integer. - * @example - * - * _.toInteger(3.2); - * // => 3 - * - * _.toInteger(Number.MIN_VALUE); - * // => 0 - * - * _.toInteger(Infinity); - * // => 1.7976931348623157e+308 - * - * _.toInteger('3.2'); - * // => 3 - */ - var toInteger = Number; - - /** - * Converts `value` to a number. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to process. - * @returns {number} Returns the number. - * @example - * - * _.toNumber(3.2); - * // => 3.2 - * - * _.toNumber(Number.MIN_VALUE); - * // => 5e-324 - * - * _.toNumber(Infinity); - * // => Infinity - * - * _.toNumber('3.2'); - * // => 3.2 - */ - var toNumber = Number; - - /** - * Converts `value` to a string. An empty string is returned for `null` - * and `undefined` values. The sign of `-0` is preserved. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to convert. - * @returns {string} Returns the converted string. - * @example - * - * _.toString(null); - * // => '' - * - * _.toString(-0); - * // => '-0' - * - * _.toString([1, 2, 3]); - * // => '1,2,3' - */ - function toString(value) { - if (typeof value == 'string') { - return value; - } - return value == null ? '' : (value + ''); - } - - /*------------------------------------------------------------------------*/ - - /** - * Assigns own enumerable string keyed properties of source objects to the - * destination object. Source objects are applied from left to right. - * Subsequent sources overwrite property assignments of previous sources. - * - * **Note:** This method mutates `object` and is loosely based on - * [`Object.assign`](https://mdn.io/Object/assign). - * - * @static - * @memberOf _ - * @since 0.10.0 - * @category Object - * @param {Object} object The destination object. - * @param {...Object} [sources] The source objects. - * @returns {Object} Returns `object`. - * @see _.assignIn - * @example - * - * function Foo() { - * this.a = 1; - * } - * - * function Bar() { - * this.c = 3; - * } - * - * Foo.prototype.b = 2; - * Bar.prototype.d = 4; - * - * _.assign({ 'a': 0 }, new Foo, new Bar); - * // => { 'a': 1, 'c': 3 } - */ - var assign = createAssigner(function(object, source) { - copyObject(source, nativeKeys(source), object); - }); - - /** - * This method is like `_.assign` except that it iterates over own and - * inherited source properties. - * - * **Note:** This method mutates `object`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @alias extend - * @category Object - * @param {Object} object The destination object. - * @param {...Object} [sources] The source objects. - * @returns {Object} Returns `object`. - * @see _.assign - * @example - * - * function Foo() { - * this.a = 1; - * } - * - * function Bar() { - * this.c = 3; - * } - * - * Foo.prototype.b = 2; - * Bar.prototype.d = 4; - * - * _.assignIn({ 'a': 0 }, new Foo, new Bar); - * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 } - */ - var assignIn = createAssigner(function(object, source) { - copyObject(source, nativeKeysIn(source), object); - }); - - /** - * Creates an object that inherits from the `prototype` object. If a - * `properties` object is given, its own enumerable string keyed properties - * are assigned to the created object. - * - * @static - * @memberOf _ - * @since 2.3.0 - * @category Object - * @param {Object} prototype The object to inherit from. - * @param {Object} [properties] The properties to assign to the object. - * @returns {Object} Returns the new object. - * @example - * - * function Shape() { - * this.x = 0; - * this.y = 0; - * } - * - * function Circle() { - * Shape.call(this); - * } - * - * Circle.prototype = _.create(Shape.prototype, { - * 'constructor': Circle - * }); - * - * var circle = new Circle; - * circle instanceof Circle; - * // => true - * - * circle instanceof Shape; - * // => true - */ - function create(prototype, properties) { - var result = baseCreate(prototype); - return properties == null ? result : assign(result, properties); - } - - /** - * Assigns own and inherited enumerable string keyed properties of source - * objects to the destination object for all destination properties that - * resolve to `undefined`. Source objects are applied from left to right. - * Once a property is set, additional values of the same property are ignored. - * - * **Note:** This method mutates `object`. - * - * @static - * @since 0.1.0 - * @memberOf _ - * @category Object - * @param {Object} object The destination object. - * @param {...Object} [sources] The source objects. - * @returns {Object} Returns `object`. - * @see _.defaultsDeep - * @example - * - * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); - * // => { 'a': 1, 'b': 2 } - */ - var defaults = baseRest(function(object, sources) { - object = Object(object); - - var index = -1; - var length = sources.length; - var guard = length > 2 ? sources[2] : undefined; - - if (guard && isIterateeCall(sources[0], sources[1], guard)) { - length = 1; - } - - while (++index < length) { - var source = sources[index]; - var props = keysIn(source); - var propsIndex = -1; - var propsLength = props.length; - - while (++propsIndex < propsLength) { - var key = props[propsIndex]; - var value = object[key]; - - if (value === undefined || - (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) { - object[key] = source[key]; - } - } - } - - return object; - }); - - /** - * Checks if `path` is a direct property of `object`. - * - * @static - * @since 0.1.0 - * @memberOf _ - * @category Object - * @param {Object} object The object to query. - * @param {Array|string} path The path to check. - * @returns {boolean} Returns `true` if `path` exists, else `false`. - * @example - * - * var object = { 'a': { 'b': 2 } }; - * var other = _.create({ 'a': _.create({ 'b': 2 }) }); - * - * _.has(object, 'a'); - * // => true - * - * _.has(object, 'a.b'); - * // => true - * - * _.has(object, ['a', 'b']); - * // => true - * - * _.has(other, 'a'); - * // => false - */ - function has(object, path) { - return object != null && hasOwnProperty.call(object, path); - } - - /** - * Creates an array of the own enumerable property names of `object`. - * - * **Note:** Non-object values are coerced to objects. See the - * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) - * for more details. - * - * @static - * @since 0.1.0 - * @memberOf _ - * @category Object - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.keys(new Foo); - * // => ['a', 'b'] (iteration order is not guaranteed) - * - * _.keys('hi'); - * // => ['0', '1'] - */ - var keys = nativeKeys; - - /** - * Creates an array of the own and inherited enumerable property names of `object`. - * - * **Note:** Non-object values are coerced to objects. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Object - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.keysIn(new Foo); - * // => ['a', 'b', 'c'] (iteration order is not guaranteed) - */ - var keysIn = nativeKeysIn; - - /** - * Creates an object composed of the picked `object` properties. - * - * @static - * @since 0.1.0 - * @memberOf _ - * @category Object - * @param {Object} object The source object. - * @param {...(string|string[])} [paths] The property paths to pick. - * @returns {Object} Returns the new object. - * @example - * - * var object = { 'a': 1, 'b': '2', 'c': 3 }; - * - * _.pick(object, ['a', 'c']); - * // => { 'a': 1, 'c': 3 } - */ - var pick = flatRest(function(object, paths) { - return object == null ? {} : basePick(object, paths); - }); - - /** - * This method is like `_.get` except that if the resolved value is a - * function it's invoked with the `this` binding of its parent object and - * its result is returned. - * - * @static - * @since 0.1.0 - * @memberOf _ - * @category Object - * @param {Object} object The object to query. - * @param {Array|string} path The path of the property to resolve. - * @param {*} [defaultValue] The value returned for `undefined` resolved values. - * @returns {*} Returns the resolved value. - * @example - * - * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] }; - * - * _.result(object, 'a[0].b.c1'); - * // => 3 - * - * _.result(object, 'a[0].b.c2'); - * // => 4 - * - * _.result(object, 'a[0].b.c3', 'default'); - * // => 'default' - * - * _.result(object, 'a[0].b.c3', _.constant('default')); - * // => 'default' - */ - function result(object, path, defaultValue) { - var value = object == null ? undefined : object[path]; - if (value === undefined) { - value = defaultValue; - } - return isFunction(value) ? value.call(object) : value; - } - - /** - * Creates an array of the own enumerable string keyed property values of `object`. - * - * **Note:** Non-object values are coerced to objects. - * - * @static - * @since 0.1.0 - * @memberOf _ - * @category Object - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property values. - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.values(new Foo); - * // => [1, 2] (iteration order is not guaranteed) - * - * _.values('hi'); - * // => ['h', 'i'] - */ - function values(object) { - return object == null ? [] : baseValues(object, keys(object)); - } - - /*------------------------------------------------------------------------*/ - - /** - * Converts the characters "&", "<", ">", '"', and "'" in `string` to their - * corresponding HTML entities. - * - * **Note:** No other characters are escaped. To escape additional - * characters use a third-party library like [_he_](https://mths.be/he). - * - * Though the ">" character is escaped for symmetry, characters like - * ">" and "/" don't need escaping in HTML and have no special meaning - * unless they're part of a tag or unquoted attribute value. See - * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands) - * (under "semi-related fun fact") for more details. - * - * When working with HTML you should always - * [quote attribute values](http://wonko.com/post/html-escaping) to reduce - * XSS vectors. - * - * @static - * @since 0.1.0 - * @memberOf _ - * @category String - * @param {string} [string=''] The string to escape. - * @returns {string} Returns the escaped string. - * @example - * - * _.escape('fred, barney, & pebbles'); - * // => 'fred, barney, & pebbles' - */ - function escape(string) { - string = toString(string); - return (string && reHasUnescapedHtml.test(string)) - ? string.replace(reUnescapedHtml, escapeHtmlChar) - : string; - } - - /*------------------------------------------------------------------------*/ - - /** - * This method returns the first argument it receives. - * - * @static - * @since 0.1.0 - * @memberOf _ - * @category Util - * @param {*} value Any value. - * @returns {*} Returns `value`. - * @example - * - * var object = { 'a': 1 }; - * - * console.log(_.identity(object) === object); - * // => true - */ - function identity(value) { - return value; - } - - /** - * Creates a function that invokes `func` with the arguments of the created - * function. If `func` is a property name, the created function returns the - * property value for a given element. If `func` is an array or object, the - * created function returns `true` for elements that contain the equivalent - * source properties, otherwise it returns `false`. - * - * @static - * @since 4.0.0 - * @memberOf _ - * @category Util - * @param {*} [func=_.identity] The value to convert to a callback. - * @returns {Function} Returns the callback. - * @example - * - * var users = [ - * { 'user': 'barney', 'age': 36, 'active': true }, - * { 'user': 'fred', 'age': 40, 'active': false } - * ]; - * - * // The `_.matches` iteratee shorthand. - * _.filter(users, _.iteratee({ 'user': 'barney', 'active': true })); - * // => [{ 'user': 'barney', 'age': 36, 'active': true }] - * - * // The `_.matchesProperty` iteratee shorthand. - * _.filter(users, _.iteratee(['user', 'fred'])); - * // => [{ 'user': 'fred', 'age': 40 }] - * - * // The `_.property` iteratee shorthand. - * _.map(users, _.iteratee('user')); - * // => ['barney', 'fred'] - * - * // Create custom iteratee shorthands. - * _.iteratee = _.wrap(_.iteratee, function(iteratee, func) { - * return !_.isRegExp(func) ? iteratee(func) : function(string) { - * return func.test(string); - * }; - * }); - * - * _.filter(['abc', 'def'], /ef/); - * // => ['def'] - */ - var iteratee = baseIteratee; - - /** - * Creates a function that performs a partial deep comparison between a given - * object and `source`, returning `true` if the given object has equivalent - * property values, else `false`. - * - * **Note:** The created function is equivalent to `_.isMatch` with `source` - * partially applied. - * - * Partial comparisons will match empty array and empty object `source` - * values against any array or object value, respectively. See `_.isEqual` - * for a list of supported value comparisons. - * - * **Note:** Multiple values can be checked by combining several matchers - * using `_.overSome` - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Util - * @param {Object} source The object of property values to match. - * @returns {Function} Returns the new spec function. - * @example - * - * var objects = [ - * { 'a': 1, 'b': 2, 'c': 3 }, - * { 'a': 4, 'b': 5, 'c': 6 } - * ]; - * - * _.filter(objects, _.matches({ 'a': 4, 'c': 6 })); - * // => [{ 'a': 4, 'b': 5, 'c': 6 }] - * - * // Checking for several possible values - * _.filter(objects, _.overSome([_.matches({ 'a': 1 }), _.matches({ 'a': 4 })])); - * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }] - */ - function matches(source) { - return baseMatches(assign({}, source)); - } - - /** - * Adds all own enumerable string keyed function properties of a source - * object to the destination object. If `object` is a function, then methods - * are added to its prototype as well. - * - * **Note:** Use `_.runInContext` to create a pristine `lodash` function to - * avoid conflicts caused by modifying the original. - * - * @static - * @since 0.1.0 - * @memberOf _ - * @category Util - * @param {Function|Object} [object=lodash] The destination object. - * @param {Object} source The object of functions to add. - * @param {Object} [options={}] The options object. - * @param {boolean} [options.chain=true] Specify whether mixins are chainable. - * @returns {Function|Object} Returns `object`. - * @example - * - * function vowels(string) { - * return _.filter(string, function(v) { - * return /[aeiou]/i.test(v); - * }); - * } - * - * _.mixin({ 'vowels': vowels }); - * _.vowels('fred'); - * // => ['e'] - * - * _('fred').vowels().value(); - * // => ['e'] - * - * _.mixin({ 'vowels': vowels }, { 'chain': false }); - * _('fred').vowels(); - * // => ['e'] - */ - function mixin(object, source, options) { - var props = keys(source), - methodNames = baseFunctions(source, props); - - if (options == null && - !(isObject(source) && (methodNames.length || !props.length))) { - options = source; - source = object; - object = this; - methodNames = baseFunctions(source, keys(source)); - } - var chain = !(isObject(options) && 'chain' in options) || !!options.chain, - isFunc = isFunction(object); - - baseEach(methodNames, function(methodName) { - var func = source[methodName]; - object[methodName] = func; - if (isFunc) { - object.prototype[methodName] = function() { - var chainAll = this.__chain__; - if (chain || chainAll) { - var result = object(this.__wrapped__), - actions = result.__actions__ = copyArray(this.__actions__); - - actions.push({ 'func': func, 'args': arguments, 'thisArg': object }); - result.__chain__ = chainAll; - return result; - } - return func.apply(object, arrayPush([this.value()], arguments)); - }; - } - }); - - return object; - } - - /** - * Reverts the `_` variable to its previous value and returns a reference to - * the `lodash` function. - * - * @static - * @since 0.1.0 - * @memberOf _ - * @category Util - * @returns {Function} Returns the `lodash` function. - * @example - * - * var lodash = _.noConflict(); - */ - function noConflict() { - if (root._ === this) { - root._ = oldDash; - } - return this; - } - - /** - * This method returns `undefined`. - * - * @static - * @memberOf _ - * @since 2.3.0 - * @category Util - * @example - * - * _.times(2, _.noop); - * // => [undefined, undefined] - */ - function noop() { - // No operation performed. - } - - /** - * Generates a unique ID. If `prefix` is given, the ID is appended to it. - * - * @static - * @since 0.1.0 - * @memberOf _ - * @category Util - * @param {string} [prefix=''] The value to prefix the ID with. - * @returns {string} Returns the unique ID. - * @example - * - * _.uniqueId('contact_'); - * // => 'contact_104' - * - * _.uniqueId(); - * // => '105' - */ - function uniqueId(prefix) { - var id = ++idCounter; - return toString(prefix) + id; - } - - /*------------------------------------------------------------------------*/ - - /** - * Computes the maximum value of `array`. If `array` is empty or falsey, - * `undefined` is returned. - * - * @static - * @since 0.1.0 - * @memberOf _ - * @category Math - * @param {Array} array The array to iterate over. - * @returns {*} Returns the maximum value. - * @example - * - * _.max([4, 2, 8, 6]); - * // => 8 - * - * _.max([]); - * // => undefined - */ - function max(array) { - return (array && array.length) - ? baseExtremum(array, identity, baseGt) - : undefined; - } - - /** - * Computes the minimum value of `array`. If `array` is empty or falsey, - * `undefined` is returned. - * - * @static - * @since 0.1.0 - * @memberOf _ - * @category Math - * @param {Array} array The array to iterate over. - * @returns {*} Returns the minimum value. - * @example - * - * _.min([4, 2, 8, 6]); - * // => 2 - * - * _.min([]); - * // => undefined - */ - function min(array) { - return (array && array.length) - ? baseExtremum(array, identity, baseLt) - : undefined; - } - - /*------------------------------------------------------------------------*/ - - // Add methods that return wrapped values in chain sequences. - lodash.assignIn = assignIn; - lodash.before = before; - lodash.bind = bind; - lodash.chain = chain; - lodash.compact = compact; - lodash.concat = concat; - lodash.create = create; - lodash.defaults = defaults; - lodash.defer = defer; - lodash.delay = delay; - lodash.filter = filter; - lodash.flatten = flatten; - lodash.flattenDeep = flattenDeep; - lodash.iteratee = iteratee; - lodash.keys = keys; - lodash.map = map; - lodash.matches = matches; - lodash.mixin = mixin; - lodash.negate = negate; - lodash.once = once; - lodash.pick = pick; - lodash.slice = slice; - lodash.sortBy = sortBy; - lodash.tap = tap; - lodash.thru = thru; - lodash.toArray = toArray; - lodash.values = values; - - // Add aliases. - lodash.extend = assignIn; - - // Add methods to `lodash.prototype`. - mixin(lodash, lodash); - - /*------------------------------------------------------------------------*/ - - // Add methods that return unwrapped values in chain sequences. - lodash.clone = clone; - lodash.escape = escape; - lodash.every = every; - lodash.find = find; - lodash.forEach = forEach; - lodash.has = has; - lodash.head = head; - lodash.identity = identity; - lodash.indexOf = indexOf; - lodash.isArguments = isArguments; - lodash.isArray = isArray; - lodash.isBoolean = isBoolean; - lodash.isDate = isDate; - lodash.isEmpty = isEmpty; - lodash.isEqual = isEqual; - lodash.isFinite = isFinite; - lodash.isFunction = isFunction; - lodash.isNaN = isNaN; - lodash.isNull = isNull; - lodash.isNumber = isNumber; - lodash.isObject = isObject; - lodash.isRegExp = isRegExp; - lodash.isString = isString; - lodash.isUndefined = isUndefined; - lodash.last = last; - lodash.max = max; - lodash.min = min; - lodash.noConflict = noConflict; - lodash.noop = noop; - lodash.reduce = reduce; - lodash.result = result; - lodash.size = size; - lodash.some = some; - lodash.uniqueId = uniqueId; - - // Add aliases. - lodash.each = forEach; - lodash.first = head; - - mixin(lodash, (function() { - var source = {}; - baseForOwn(lodash, function(func, methodName) { - if (!hasOwnProperty.call(lodash.prototype, methodName)) { - source[methodName] = func; - } - }); - return source; - }()), { 'chain': false }); - - /*------------------------------------------------------------------------*/ - - /** - * The semantic version number. - * - * @static - * @memberOf _ - * @type {string} - */ - lodash.VERSION = VERSION; - - // Add `Array` methods to `lodash.prototype`. - baseEach(['pop', 'join', 'replace', 'reverse', 'split', 'push', 'shift', 'sort', 'splice', 'unshift'], function(methodName) { - var func = (/^(?:replace|split)$/.test(methodName) ? String.prototype : arrayProto)[methodName], - chainName = /^(?:push|sort|unshift)$/.test(methodName) ? 'tap' : 'thru', - retUnwrapped = /^(?:pop|join|replace|shift)$/.test(methodName); - - lodash.prototype[methodName] = function() { - var args = arguments; - if (retUnwrapped && !this.__chain__) { - var value = this.value(); - return func.apply(isArray(value) ? value : [], args); - } - return this[chainName](function(value) { - return func.apply(isArray(value) ? value : [], args); - }); - }; - }); - - // Add chain sequence methods to the `lodash` wrapper. - lodash.prototype.toJSON = lodash.prototype.valueOf = lodash.prototype.value = wrapperValue; - - /*--------------------------------------------------------------------------*/ - - // Some AMD build optimizers, like r.js, check for condition patterns like: - if (typeof define == 'function' && typeof define.amd == 'object' && define.amd) { - // Expose Lodash on the global object to prevent errors when Lodash is - // loaded by a script tag in the presence of an AMD loader. - // See http://requirejs.org/docs/errors.html#mismatch for more details. - // Use `_.noConflict` to remove Lodash from the global object. - root._ = lodash; - - // Define as an anonymous module so, through path mapping, it can be - // referenced as the "underscore" module. - define(function() { - return lodash; - }); - } - // Check for `exports` after `define` in case a build optimizer adds it. - else if (freeModule) { - // Export for Node.js. - (freeModule.exports = lodash)._ = lodash; - // Export for CommonJS support. - freeExports._ = lodash; - } - else { - // Export to the global object. - root._ = lodash; - } -}.call(this)); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/core.min.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/core.min.js deleted file mode 100644 index e425e4d4..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/core.min.js +++ /dev/null @@ -1,29 +0,0 @@ -/** - * @license - * Lodash (Custom Build) lodash.com/license | Underscore.js 1.8.3 underscorejs.org/LICENSE - * Build: `lodash core -o ./dist/lodash.core.js` - */ -;(function(){function n(n){return H(n)&&pn.call(n,"callee")&&!yn.call(n,"callee")}function t(n,t){return n.push.apply(n,t),n}function r(n){return function(t){return null==t?Z:t[n]}}function e(n,t,r,e,u){return u(n,function(n,u,o){r=e?(e=false,n):t(r,n,u,o)}),r}function u(n,t){return j(t,function(t){return n[t]})}function o(n){return n instanceof i?n:new i(n)}function i(n,t){this.__wrapped__=n,this.__actions__=[],this.__chain__=!!t}function c(n,t,r){if(typeof n!="function")throw new TypeError("Expected a function"); -return setTimeout(function(){n.apply(Z,r)},t)}function f(n,t){var r=true;return mn(n,function(n,e,u){return r=!!t(n,e,u)}),r}function a(n,t,r){for(var e=-1,u=n.length;++et}function b(n,t,r,e,u){return n===t||(null==n||null==t||!H(n)&&!H(t)?n!==n&&t!==t:y(n,t,r,e,b,u))}function y(n,t,r,e,u,o){var i=Nn(n),c=Nn(t),f=i?"[object Array]":hn.call(n),a=c?"[object Array]":hn.call(t),f="[object Arguments]"==f?"[object Object]":f,a="[object Arguments]"==a?"[object Object]":a,l="[object Object]"==f,c="[object Object]"==a,a=f==a;o||(o=[]);var p=An(o,function(t){return t[0]==n}),s=An(o,function(n){ -return n[0]==t});if(p&&s)return p[1]==t;if(o.push([n,t]),o.push([t,n]),a&&!l){if(i)r=T(n,t,r,e,u,o);else n:{switch(f){case"[object Boolean]":case"[object Date]":case"[object Number]":r=J(+n,+t);break n;case"[object Error]":r=n.name==t.name&&n.message==t.message;break n;case"[object RegExp]":case"[object String]":r=n==t+"";break n}r=false}return o.pop(),r}return 1&r||(i=l&&pn.call(n,"__wrapped__"),f=c&&pn.call(t,"__wrapped__"),!i&&!f)?!!a&&(r=B(n,t,r,e,u,o),o.pop(),r):(i=i?n.value():n,f=f?t.value():t, -r=u(i,f,r,e,o),o.pop(),r)}function g(n){return typeof n=="function"?n:null==n?X:(typeof n=="object"?d:r)(n)}function _(n,t){return nt&&(t=-t>u?0:u+t),r=r>u?u:r,0>r&&(r+=u),u=t>r?0:r-t>>>0,t>>>=0,r=Array(u);++ei))return false;var c=o.get(n),f=o.get(t);if(c&&f)return c==t&&f==n;for(var c=-1,f=true,a=2&r?[]:Z;++cr?jn(e+r,0):r:0,r=(r||0)-1;for(var u=t===t;++rarguments.length,mn); -}function G(n,t){var r;if(typeof t!="function")throw new TypeError("Expected a function");return n=Fn(n),function(){return 0<--n&&(r=t.apply(this,arguments)),1>=n&&(t=Z),r}}function J(n,t){return n===t||n!==n&&t!==t}function M(n){var t;return(t=null!=n)&&(t=n.length,t=typeof t=="number"&&-1=t),t&&!U(n)}function U(n){return!!V(n)&&(n=hn.call(n),"[object Function]"==n||"[object GeneratorFunction]"==n||"[object AsyncFunction]"==n||"[object Proxy]"==n)}function V(n){var t=typeof n; -return null!=n&&("object"==t||"function"==t)}function H(n){return null!=n&&typeof n=="object"}function K(n){return typeof n=="number"||H(n)&&"[object Number]"==hn.call(n)}function L(n){return typeof n=="string"||!Nn(n)&&H(n)&&"[object String]"==hn.call(n)}function Q(n){return typeof n=="string"?n:null==n?"":n+""}function W(n){return null==n?[]:u(n,Dn(n))}function X(n){return n}function Y(n,r,e){var u=Dn(r),o=h(r,u);null!=e||V(r)&&(o.length||!u.length)||(e=r,r=n,n=this,o=h(r,Dn(r)));var i=!(V(e)&&"chain"in e&&!e.chain),c=U(n); -return mn(o,function(e){var u=r[e];n[e]=u,c&&(n.prototype[e]=function(){var r=this.__chain__;if(i||r){var e=n(this.__wrapped__);return(e.__actions__=A(this.__actions__)).push({func:u,args:arguments,thisArg:n}),e.__chain__=r,e}return u.apply(n,t([this.value()],arguments))})}),n}var Z,nn=1/0,tn=/[&<>"']/g,rn=RegExp(tn.source),en=/^(?:0|[1-9]\d*)$/,un=typeof self=="object"&&self&&self.Object===Object&&self,on=typeof global=="object"&&global&&global.Object===Object&&global||un||Function("return this")(),cn=(un=typeof exports=="object"&&exports&&!exports.nodeType&&exports)&&typeof module=="object"&&module&&!module.nodeType&&module,fn=function(n){ -return function(t){return null==n?Z:n[t]}}({"&":"&","<":"<",">":">",'"':""","'":"'"}),an=Array.prototype,ln=Object.prototype,pn=ln.hasOwnProperty,sn=0,hn=ln.toString,vn=on._,bn=Object.create,yn=ln.propertyIsEnumerable,gn=on.isFinite,_n=function(n,t){return function(r){return n(t(r))}}(Object.keys,Object),jn=Math.max,dn=function(){function n(){}return function(t){return V(t)?bn?bn(t):(n.prototype=t,t=new n,n.prototype=Z,t):{}}}();i.prototype=dn(o.prototype),i.prototype.constructor=i; -var mn=function(n,t){return function(r,e){if(null==r)return r;if(!M(r))return n(r,e);for(var u=r.length,o=t?u:-1,i=Object(r);(t?o--:++or&&(r=jn(e+r,0));n:{for(t=g(t),e=n.length,r+=-1;++re||o&&c&&a||!u&&a||!i){r=1;break n}if(!o&&r { '4': 1, '6': 2 } - * - * // The `_.property` iteratee shorthand. - * _.countBy(['one', 'two', 'three'], 'length'); - * // => { '3': 2, '5': 1 } - */ -var countBy = createAggregator(function(result, value, key) { - if (hasOwnProperty.call(result, key)) { - ++result[key]; - } else { - baseAssignValue(result, key, 1); - } -}); - -module.exports = countBy; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/create.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/create.js deleted file mode 100644 index 919edb85..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/create.js +++ /dev/null @@ -1,43 +0,0 @@ -var baseAssign = require('./_baseAssign'), - baseCreate = require('./_baseCreate'); - -/** - * Creates an object that inherits from the `prototype` object. If a - * `properties` object is given, its own enumerable string keyed properties - * are assigned to the created object. - * - * @static - * @memberOf _ - * @since 2.3.0 - * @category Object - * @param {Object} prototype The object to inherit from. - * @param {Object} [properties] The properties to assign to the object. - * @returns {Object} Returns the new object. - * @example - * - * function Shape() { - * this.x = 0; - * this.y = 0; - * } - * - * function Circle() { - * Shape.call(this); - * } - * - * Circle.prototype = _.create(Shape.prototype, { - * 'constructor': Circle - * }); - * - * var circle = new Circle; - * circle instanceof Circle; - * // => true - * - * circle instanceof Shape; - * // => true - */ -function create(prototype, properties) { - var result = baseCreate(prototype); - return properties == null ? result : baseAssign(result, properties); -} - -module.exports = create; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/curry.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/curry.js deleted file mode 100644 index 918db1a4..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/curry.js +++ /dev/null @@ -1,57 +0,0 @@ -var createWrap = require('./_createWrap'); - -/** Used to compose bitmasks for function metadata. */ -var WRAP_CURRY_FLAG = 8; - -/** - * Creates a function that accepts arguments of `func` and either invokes - * `func` returning its result, if at least `arity` number of arguments have - * been provided, or returns a function that accepts the remaining `func` - * arguments, and so on. The arity of `func` may be specified if `func.length` - * is not sufficient. - * - * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds, - * may be used as a placeholder for provided arguments. - * - * **Note:** This method doesn't set the "length" property of curried functions. - * - * @static - * @memberOf _ - * @since 2.0.0 - * @category Function - * @param {Function} func The function to curry. - * @param {number} [arity=func.length] The arity of `func`. - * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. - * @returns {Function} Returns the new curried function. - * @example - * - * var abc = function(a, b, c) { - * return [a, b, c]; - * }; - * - * var curried = _.curry(abc); - * - * curried(1)(2)(3); - * // => [1, 2, 3] - * - * curried(1, 2)(3); - * // => [1, 2, 3] - * - * curried(1, 2, 3); - * // => [1, 2, 3] - * - * // Curried with placeholders. - * curried(1)(_, 3)(2); - * // => [1, 2, 3] - */ -function curry(func, arity, guard) { - arity = guard ? undefined : arity; - var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity); - result.placeholder = curry.placeholder; - return result; -} - -// Assign default placeholders. -curry.placeholder = {}; - -module.exports = curry; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/curryRight.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/curryRight.js deleted file mode 100644 index c85b6f33..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/curryRight.js +++ /dev/null @@ -1,54 +0,0 @@ -var createWrap = require('./_createWrap'); - -/** Used to compose bitmasks for function metadata. */ -var WRAP_CURRY_RIGHT_FLAG = 16; - -/** - * This method is like `_.curry` except that arguments are applied to `func` - * in the manner of `_.partialRight` instead of `_.partial`. - * - * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic - * builds, may be used as a placeholder for provided arguments. - * - * **Note:** This method doesn't set the "length" property of curried functions. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Function - * @param {Function} func The function to curry. - * @param {number} [arity=func.length] The arity of `func`. - * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. - * @returns {Function} Returns the new curried function. - * @example - * - * var abc = function(a, b, c) { - * return [a, b, c]; - * }; - * - * var curried = _.curryRight(abc); - * - * curried(3)(2)(1); - * // => [1, 2, 3] - * - * curried(2, 3)(1); - * // => [1, 2, 3] - * - * curried(1, 2, 3); - * // => [1, 2, 3] - * - * // Curried with placeholders. - * curried(3)(1, _)(2); - * // => [1, 2, 3] - */ -function curryRight(func, arity, guard) { - arity = guard ? undefined : arity; - var result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity); - result.placeholder = curryRight.placeholder; - return result; -} - -// Assign default placeholders. -curryRight.placeholder = {}; - -module.exports = curryRight; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/date.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/date.js deleted file mode 100644 index cbf5b410..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/date.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = { - 'now': require('./now') -}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/debounce.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/debounce.js deleted file mode 100644 index 8f751d53..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/debounce.js +++ /dev/null @@ -1,191 +0,0 @@ -var isObject = require('./isObject'), - now = require('./now'), - toNumber = require('./toNumber'); - -/** Error message constants. */ -var FUNC_ERROR_TEXT = 'Expected a function'; - -/* Built-in method references for those with the same name as other `lodash` methods. */ -var nativeMax = Math.max, - nativeMin = Math.min; - -/** - * Creates a debounced function that delays invoking `func` until after `wait` - * milliseconds have elapsed since the last time the debounced function was - * invoked. The debounced function comes with a `cancel` method to cancel - * delayed `func` invocations and a `flush` method to immediately invoke them. - * Provide `options` to indicate whether `func` should be invoked on the - * leading and/or trailing edge of the `wait` timeout. The `func` is invoked - * with the last arguments provided to the debounced function. Subsequent - * calls to the debounced function return the result of the last `func` - * invocation. - * - * **Note:** If `leading` and `trailing` options are `true`, `func` is - * invoked on the trailing edge of the timeout only if the debounced function - * is invoked more than once during the `wait` timeout. - * - * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred - * until to the next tick, similar to `setTimeout` with a timeout of `0`. - * - * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) - * for details over the differences between `_.debounce` and `_.throttle`. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Function - * @param {Function} func The function to debounce. - * @param {number} [wait=0] The number of milliseconds to delay. - * @param {Object} [options={}] The options object. - * @param {boolean} [options.leading=false] - * Specify invoking on the leading edge of the timeout. - * @param {number} [options.maxWait] - * The maximum time `func` is allowed to be delayed before it's invoked. - * @param {boolean} [options.trailing=true] - * Specify invoking on the trailing edge of the timeout. - * @returns {Function} Returns the new debounced function. - * @example - * - * // Avoid costly calculations while the window size is in flux. - * jQuery(window).on('resize', _.debounce(calculateLayout, 150)); - * - * // Invoke `sendMail` when clicked, debouncing subsequent calls. - * jQuery(element).on('click', _.debounce(sendMail, 300, { - * 'leading': true, - * 'trailing': false - * })); - * - * // Ensure `batchLog` is invoked once after 1 second of debounced calls. - * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 }); - * var source = new EventSource('/stream'); - * jQuery(source).on('message', debounced); - * - * // Cancel the trailing debounced invocation. - * jQuery(window).on('popstate', debounced.cancel); - */ -function debounce(func, wait, options) { - var lastArgs, - lastThis, - maxWait, - result, - timerId, - lastCallTime, - lastInvokeTime = 0, - leading = false, - maxing = false, - trailing = true; - - if (typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - wait = toNumber(wait) || 0; - if (isObject(options)) { - leading = !!options.leading; - maxing = 'maxWait' in options; - maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait; - trailing = 'trailing' in options ? !!options.trailing : trailing; - } - - function invokeFunc(time) { - var args = lastArgs, - thisArg = lastThis; - - lastArgs = lastThis = undefined; - lastInvokeTime = time; - result = func.apply(thisArg, args); - return result; - } - - function leadingEdge(time) { - // Reset any `maxWait` timer. - lastInvokeTime = time; - // Start the timer for the trailing edge. - timerId = setTimeout(timerExpired, wait); - // Invoke the leading edge. - return leading ? invokeFunc(time) : result; - } - - function remainingWait(time) { - var timeSinceLastCall = time - lastCallTime, - timeSinceLastInvoke = time - lastInvokeTime, - timeWaiting = wait - timeSinceLastCall; - - return maxing - ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke) - : timeWaiting; - } - - function shouldInvoke(time) { - var timeSinceLastCall = time - lastCallTime, - timeSinceLastInvoke = time - lastInvokeTime; - - // Either this is the first call, activity has stopped and we're at the - // trailing edge, the system time has gone backwards and we're treating - // it as the trailing edge, or we've hit the `maxWait` limit. - return (lastCallTime === undefined || (timeSinceLastCall >= wait) || - (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait)); - } - - function timerExpired() { - var time = now(); - if (shouldInvoke(time)) { - return trailingEdge(time); - } - // Restart the timer. - timerId = setTimeout(timerExpired, remainingWait(time)); - } - - function trailingEdge(time) { - timerId = undefined; - - // Only invoke if we have `lastArgs` which means `func` has been - // debounced at least once. - if (trailing && lastArgs) { - return invokeFunc(time); - } - lastArgs = lastThis = undefined; - return result; - } - - function cancel() { - if (timerId !== undefined) { - clearTimeout(timerId); - } - lastInvokeTime = 0; - lastArgs = lastCallTime = lastThis = timerId = undefined; - } - - function flush() { - return timerId === undefined ? result : trailingEdge(now()); - } - - function debounced() { - var time = now(), - isInvoking = shouldInvoke(time); - - lastArgs = arguments; - lastThis = this; - lastCallTime = time; - - if (isInvoking) { - if (timerId === undefined) { - return leadingEdge(lastCallTime); - } - if (maxing) { - // Handle invocations in a tight loop. - clearTimeout(timerId); - timerId = setTimeout(timerExpired, wait); - return invokeFunc(lastCallTime); - } - } - if (timerId === undefined) { - timerId = setTimeout(timerExpired, wait); - } - return result; - } - debounced.cancel = cancel; - debounced.flush = flush; - return debounced; -} - -module.exports = debounce; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/deburr.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/deburr.js deleted file mode 100644 index f85e314a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/deburr.js +++ /dev/null @@ -1,45 +0,0 @@ -var deburrLetter = require('./_deburrLetter'), - toString = require('./toString'); - -/** Used to match Latin Unicode letters (excluding mathematical operators). */ -var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g; - -/** Used to compose unicode character classes. */ -var rsComboMarksRange = '\\u0300-\\u036f', - reComboHalfMarksRange = '\\ufe20-\\ufe2f', - rsComboSymbolsRange = '\\u20d0-\\u20ff', - rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange; - -/** Used to compose unicode capture groups. */ -var rsCombo = '[' + rsComboRange + ']'; - -/** - * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and - * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols). - */ -var reComboMark = RegExp(rsCombo, 'g'); - -/** - * Deburrs `string` by converting - * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table) - * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A) - * letters to basic Latin letters and removing - * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks). - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category String - * @param {string} [string=''] The string to deburr. - * @returns {string} Returns the deburred string. - * @example - * - * _.deburr('déjà vu'); - * // => 'deja vu' - */ -function deburr(string) { - string = toString(string); - return string && string.replace(reLatin, deburrLetter).replace(reComboMark, ''); -} - -module.exports = deburr; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/defaultTo.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/defaultTo.js deleted file mode 100644 index 5b333592..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/defaultTo.js +++ /dev/null @@ -1,25 +0,0 @@ -/** - * Checks `value` to determine whether a default value should be returned in - * its place. The `defaultValue` is returned if `value` is `NaN`, `null`, - * or `undefined`. - * - * @static - * @memberOf _ - * @since 4.14.0 - * @category Util - * @param {*} value The value to check. - * @param {*} defaultValue The default value. - * @returns {*} Returns the resolved value. - * @example - * - * _.defaultTo(1, 10); - * // => 1 - * - * _.defaultTo(undefined, 10); - * // => 10 - */ -function defaultTo(value, defaultValue) { - return (value == null || value !== value) ? defaultValue : value; -} - -module.exports = defaultTo; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/defaults.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/defaults.js deleted file mode 100644 index c74df044..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/defaults.js +++ /dev/null @@ -1,64 +0,0 @@ -var baseRest = require('./_baseRest'), - eq = require('./eq'), - isIterateeCall = require('./_isIterateeCall'), - keysIn = require('./keysIn'); - -/** Used for built-in method references. */ -var objectProto = Object.prototype; - -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; - -/** - * Assigns own and inherited enumerable string keyed properties of source - * objects to the destination object for all destination properties that - * resolve to `undefined`. Source objects are applied from left to right. - * Once a property is set, additional values of the same property are ignored. - * - * **Note:** This method mutates `object`. - * - * @static - * @since 0.1.0 - * @memberOf _ - * @category Object - * @param {Object} object The destination object. - * @param {...Object} [sources] The source objects. - * @returns {Object} Returns `object`. - * @see _.defaultsDeep - * @example - * - * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); - * // => { 'a': 1, 'b': 2 } - */ -var defaults = baseRest(function(object, sources) { - object = Object(object); - - var index = -1; - var length = sources.length; - var guard = length > 2 ? sources[2] : undefined; - - if (guard && isIterateeCall(sources[0], sources[1], guard)) { - length = 1; - } - - while (++index < length) { - var source = sources[index]; - var props = keysIn(source); - var propsIndex = -1; - var propsLength = props.length; - - while (++propsIndex < propsLength) { - var key = props[propsIndex]; - var value = object[key]; - - if (value === undefined || - (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) { - object[key] = source[key]; - } - } - } - - return object; -}); - -module.exports = defaults; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/defaultsDeep.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/defaultsDeep.js deleted file mode 100644 index 9b5fa3ee..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/defaultsDeep.js +++ /dev/null @@ -1,30 +0,0 @@ -var apply = require('./_apply'), - baseRest = require('./_baseRest'), - customDefaultsMerge = require('./_customDefaultsMerge'), - mergeWith = require('./mergeWith'); - -/** - * This method is like `_.defaults` except that it recursively assigns - * default properties. - * - * **Note:** This method mutates `object`. - * - * @static - * @memberOf _ - * @since 3.10.0 - * @category Object - * @param {Object} object The destination object. - * @param {...Object} [sources] The source objects. - * @returns {Object} Returns `object`. - * @see _.defaults - * @example - * - * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } }); - * // => { 'a': { 'b': 2, 'c': 3 } } - */ -var defaultsDeep = baseRest(function(args) { - args.push(undefined, customDefaultsMerge); - return apply(mergeWith, undefined, args); -}); - -module.exports = defaultsDeep; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/defer.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/defer.js deleted file mode 100644 index f6d6c6fa..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/defer.js +++ /dev/null @@ -1,26 +0,0 @@ -var baseDelay = require('./_baseDelay'), - baseRest = require('./_baseRest'); - -/** - * Defers invoking the `func` until the current call stack has cleared. Any - * additional arguments are provided to `func` when it's invoked. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Function - * @param {Function} func The function to defer. - * @param {...*} [args] The arguments to invoke `func` with. - * @returns {number} Returns the timer id. - * @example - * - * _.defer(function(text) { - * console.log(text); - * }, 'deferred'); - * // => Logs 'deferred' after one millisecond. - */ -var defer = baseRest(function(func, args) { - return baseDelay(func, 1, args); -}); - -module.exports = defer; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/delay.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/delay.js deleted file mode 100644 index bd554796..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/delay.js +++ /dev/null @@ -1,28 +0,0 @@ -var baseDelay = require('./_baseDelay'), - baseRest = require('./_baseRest'), - toNumber = require('./toNumber'); - -/** - * Invokes `func` after `wait` milliseconds. Any additional arguments are - * provided to `func` when it's invoked. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Function - * @param {Function} func The function to delay. - * @param {number} wait The number of milliseconds to delay invocation. - * @param {...*} [args] The arguments to invoke `func` with. - * @returns {number} Returns the timer id. - * @example - * - * _.delay(function(text) { - * console.log(text); - * }, 1000, 'later'); - * // => Logs 'later' after one second. - */ -var delay = baseRest(function(func, wait, args) { - return baseDelay(func, toNumber(wait) || 0, args); -}); - -module.exports = delay; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/difference.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/difference.js deleted file mode 100644 index fa28bb30..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/difference.js +++ /dev/null @@ -1,33 +0,0 @@ -var baseDifference = require('./_baseDifference'), - baseFlatten = require('./_baseFlatten'), - baseRest = require('./_baseRest'), - isArrayLikeObject = require('./isArrayLikeObject'); - -/** - * Creates an array of `array` values not included in the other given arrays - * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) - * for equality comparisons. The order and references of result values are - * determined by the first array. - * - * **Note:** Unlike `_.pullAll`, this method returns a new array. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Array - * @param {Array} array The array to inspect. - * @param {...Array} [values] The values to exclude. - * @returns {Array} Returns the new array of filtered values. - * @see _.without, _.xor - * @example - * - * _.difference([2, 1], [2, 3]); - * // => [1] - */ -var difference = baseRest(function(array, values) { - return isArrayLikeObject(array) - ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true)) - : []; -}); - -module.exports = difference; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/differenceBy.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/differenceBy.js deleted file mode 100644 index 2cd63e7e..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/differenceBy.js +++ /dev/null @@ -1,44 +0,0 @@ -var baseDifference = require('./_baseDifference'), - baseFlatten = require('./_baseFlatten'), - baseIteratee = require('./_baseIteratee'), - baseRest = require('./_baseRest'), - isArrayLikeObject = require('./isArrayLikeObject'), - last = require('./last'); - -/** - * This method is like `_.difference` except that it accepts `iteratee` which - * is invoked for each element of `array` and `values` to generate the criterion - * by which they're compared. The order and references of result values are - * determined by the first array. The iteratee is invoked with one argument: - * (value). - * - * **Note:** Unlike `_.pullAllBy`, this method returns a new array. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {Array} array The array to inspect. - * @param {...Array} [values] The values to exclude. - * @param {Function} [iteratee=_.identity] The iteratee invoked per element. - * @returns {Array} Returns the new array of filtered values. - * @example - * - * _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor); - * // => [1.2] - * - * // The `_.property` iteratee shorthand. - * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x'); - * // => [{ 'x': 2 }] - */ -var differenceBy = baseRest(function(array, values) { - var iteratee = last(values); - if (isArrayLikeObject(iteratee)) { - iteratee = undefined; - } - return isArrayLikeObject(array) - ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), baseIteratee(iteratee, 2)) - : []; -}); - -module.exports = differenceBy; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/differenceWith.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/differenceWith.js deleted file mode 100644 index c0233f4b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/differenceWith.js +++ /dev/null @@ -1,40 +0,0 @@ -var baseDifference = require('./_baseDifference'), - baseFlatten = require('./_baseFlatten'), - baseRest = require('./_baseRest'), - isArrayLikeObject = require('./isArrayLikeObject'), - last = require('./last'); - -/** - * This method is like `_.difference` except that it accepts `comparator` - * which is invoked to compare elements of `array` to `values`. The order and - * references of result values are determined by the first array. The comparator - * is invoked with two arguments: (arrVal, othVal). - * - * **Note:** Unlike `_.pullAllWith`, this method returns a new array. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {Array} array The array to inspect. - * @param {...Array} [values] The values to exclude. - * @param {Function} [comparator] The comparator invoked per element. - * @returns {Array} Returns the new array of filtered values. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; - * - * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual); - * // => [{ 'x': 2, 'y': 1 }] - */ -var differenceWith = baseRest(function(array, values) { - var comparator = last(values); - if (isArrayLikeObject(comparator)) { - comparator = undefined; - } - return isArrayLikeObject(array) - ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator) - : []; -}); - -module.exports = differenceWith; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/divide.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/divide.js deleted file mode 100644 index 8cae0cd1..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/divide.js +++ /dev/null @@ -1,22 +0,0 @@ -var createMathOperation = require('./_createMathOperation'); - -/** - * Divide two numbers. - * - * @static - * @memberOf _ - * @since 4.7.0 - * @category Math - * @param {number} dividend The first number in a division. - * @param {number} divisor The second number in a division. - * @returns {number} Returns the quotient. - * @example - * - * _.divide(6, 4); - * // => 1.5 - */ -var divide = createMathOperation(function(dividend, divisor) { - return dividend / divisor; -}, 1); - -module.exports = divide; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/drop.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/drop.js deleted file mode 100644 index d5c3cbaa..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/drop.js +++ /dev/null @@ -1,38 +0,0 @@ -var baseSlice = require('./_baseSlice'), - toInteger = require('./toInteger'); - -/** - * Creates a slice of `array` with `n` elements dropped from the beginning. - * - * @static - * @memberOf _ - * @since 0.5.0 - * @category Array - * @param {Array} array The array to query. - * @param {number} [n=1] The number of elements to drop. - * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. - * @returns {Array} Returns the slice of `array`. - * @example - * - * _.drop([1, 2, 3]); - * // => [2, 3] - * - * _.drop([1, 2, 3], 2); - * // => [3] - * - * _.drop([1, 2, 3], 5); - * // => [] - * - * _.drop([1, 2, 3], 0); - * // => [1, 2, 3] - */ -function drop(array, n, guard) { - var length = array == null ? 0 : array.length; - if (!length) { - return []; - } - n = (guard || n === undefined) ? 1 : toInteger(n); - return baseSlice(array, n < 0 ? 0 : n, length); -} - -module.exports = drop; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/dropRight.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/dropRight.js deleted file mode 100644 index 441fe996..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/dropRight.js +++ /dev/null @@ -1,39 +0,0 @@ -var baseSlice = require('./_baseSlice'), - toInteger = require('./toInteger'); - -/** - * Creates a slice of `array` with `n` elements dropped from the end. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Array - * @param {Array} array The array to query. - * @param {number} [n=1] The number of elements to drop. - * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. - * @returns {Array} Returns the slice of `array`. - * @example - * - * _.dropRight([1, 2, 3]); - * // => [1, 2] - * - * _.dropRight([1, 2, 3], 2); - * // => [1] - * - * _.dropRight([1, 2, 3], 5); - * // => [] - * - * _.dropRight([1, 2, 3], 0); - * // => [1, 2, 3] - */ -function dropRight(array, n, guard) { - var length = array == null ? 0 : array.length; - if (!length) { - return []; - } - n = (guard || n === undefined) ? 1 : toInteger(n); - n = length - n; - return baseSlice(array, 0, n < 0 ? 0 : n); -} - -module.exports = dropRight; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/dropRightWhile.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/dropRightWhile.js deleted file mode 100644 index 9ad36a04..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/dropRightWhile.js +++ /dev/null @@ -1,45 +0,0 @@ -var baseIteratee = require('./_baseIteratee'), - baseWhile = require('./_baseWhile'); - -/** - * Creates a slice of `array` excluding elements dropped from the end. - * Elements are dropped until `predicate` returns falsey. The predicate is - * invoked with three arguments: (value, index, array). - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Array - * @param {Array} array The array to query. - * @param {Function} [predicate=_.identity] The function invoked per iteration. - * @returns {Array} Returns the slice of `array`. - * @example - * - * var users = [ - * { 'user': 'barney', 'active': true }, - * { 'user': 'fred', 'active': false }, - * { 'user': 'pebbles', 'active': false } - * ]; - * - * _.dropRightWhile(users, function(o) { return !o.active; }); - * // => objects for ['barney'] - * - * // The `_.matches` iteratee shorthand. - * _.dropRightWhile(users, { 'user': 'pebbles', 'active': false }); - * // => objects for ['barney', 'fred'] - * - * // The `_.matchesProperty` iteratee shorthand. - * _.dropRightWhile(users, ['active', false]); - * // => objects for ['barney'] - * - * // The `_.property` iteratee shorthand. - * _.dropRightWhile(users, 'active'); - * // => objects for ['barney', 'fred', 'pebbles'] - */ -function dropRightWhile(array, predicate) { - return (array && array.length) - ? baseWhile(array, baseIteratee(predicate, 3), true, true) - : []; -} - -module.exports = dropRightWhile; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/dropWhile.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/dropWhile.js deleted file mode 100644 index 903ef568..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/dropWhile.js +++ /dev/null @@ -1,45 +0,0 @@ -var baseIteratee = require('./_baseIteratee'), - baseWhile = require('./_baseWhile'); - -/** - * Creates a slice of `array` excluding elements dropped from the beginning. - * Elements are dropped until `predicate` returns falsey. The predicate is - * invoked with three arguments: (value, index, array). - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Array - * @param {Array} array The array to query. - * @param {Function} [predicate=_.identity] The function invoked per iteration. - * @returns {Array} Returns the slice of `array`. - * @example - * - * var users = [ - * { 'user': 'barney', 'active': false }, - * { 'user': 'fred', 'active': false }, - * { 'user': 'pebbles', 'active': true } - * ]; - * - * _.dropWhile(users, function(o) { return !o.active; }); - * // => objects for ['pebbles'] - * - * // The `_.matches` iteratee shorthand. - * _.dropWhile(users, { 'user': 'barney', 'active': false }); - * // => objects for ['fred', 'pebbles'] - * - * // The `_.matchesProperty` iteratee shorthand. - * _.dropWhile(users, ['active', false]); - * // => objects for ['pebbles'] - * - * // The `_.property` iteratee shorthand. - * _.dropWhile(users, 'active'); - * // => objects for ['barney', 'fred', 'pebbles'] - */ -function dropWhile(array, predicate) { - return (array && array.length) - ? baseWhile(array, baseIteratee(predicate, 3), true) - : []; -} - -module.exports = dropWhile; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/each.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/each.js deleted file mode 100644 index 8800f420..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/each.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./forEach'); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/eachRight.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/eachRight.js deleted file mode 100644 index 3252b2ab..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/eachRight.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./forEachRight'); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/endsWith.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/endsWith.js deleted file mode 100644 index 76fc866e..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/endsWith.js +++ /dev/null @@ -1,43 +0,0 @@ -var baseClamp = require('./_baseClamp'), - baseToString = require('./_baseToString'), - toInteger = require('./toInteger'), - toString = require('./toString'); - -/** - * Checks if `string` ends with the given target string. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category String - * @param {string} [string=''] The string to inspect. - * @param {string} [target] The string to search for. - * @param {number} [position=string.length] The position to search up to. - * @returns {boolean} Returns `true` if `string` ends with `target`, - * else `false`. - * @example - * - * _.endsWith('abc', 'c'); - * // => true - * - * _.endsWith('abc', 'b'); - * // => false - * - * _.endsWith('abc', 'b', 2); - * // => true - */ -function endsWith(string, target, position) { - string = toString(string); - target = baseToString(target); - - var length = string.length; - position = position === undefined - ? length - : baseClamp(toInteger(position), 0, length); - - var end = position; - position -= target.length; - return position >= 0 && string.slice(position, end) == target; -} - -module.exports = endsWith; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/entries.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/entries.js deleted file mode 100644 index 7a88df20..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/entries.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./toPairs'); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/entriesIn.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/entriesIn.js deleted file mode 100644 index f6c6331c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/entriesIn.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./toPairsIn'); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/eq.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/eq.js deleted file mode 100644 index a9406880..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/eq.js +++ /dev/null @@ -1,37 +0,0 @@ -/** - * Performs a - * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) - * comparison between two values to determine if they are equivalent. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if the values are equivalent, else `false`. - * @example - * - * var object = { 'a': 1 }; - * var other = { 'a': 1 }; - * - * _.eq(object, object); - * // => true - * - * _.eq(object, other); - * // => false - * - * _.eq('a', 'a'); - * // => true - * - * _.eq('a', Object('a')); - * // => false - * - * _.eq(NaN, NaN); - * // => true - */ -function eq(value, other) { - return value === other || (value !== value && other !== other); -} - -module.exports = eq; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/escape.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/escape.js deleted file mode 100644 index 9247e002..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/escape.js +++ /dev/null @@ -1,43 +0,0 @@ -var escapeHtmlChar = require('./_escapeHtmlChar'), - toString = require('./toString'); - -/** Used to match HTML entities and HTML characters. */ -var reUnescapedHtml = /[&<>"']/g, - reHasUnescapedHtml = RegExp(reUnescapedHtml.source); - -/** - * Converts the characters "&", "<", ">", '"', and "'" in `string` to their - * corresponding HTML entities. - * - * **Note:** No other characters are escaped. To escape additional - * characters use a third-party library like [_he_](https://mths.be/he). - * - * Though the ">" character is escaped for symmetry, characters like - * ">" and "/" don't need escaping in HTML and have no special meaning - * unless they're part of a tag or unquoted attribute value. See - * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands) - * (under "semi-related fun fact") for more details. - * - * When working with HTML you should always - * [quote attribute values](http://wonko.com/post/html-escaping) to reduce - * XSS vectors. - * - * @static - * @since 0.1.0 - * @memberOf _ - * @category String - * @param {string} [string=''] The string to escape. - * @returns {string} Returns the escaped string. - * @example - * - * _.escape('fred, barney, & pebbles'); - * // => 'fred, barney, & pebbles' - */ -function escape(string) { - string = toString(string); - return (string && reHasUnescapedHtml.test(string)) - ? string.replace(reUnescapedHtml, escapeHtmlChar) - : string; -} - -module.exports = escape; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/escapeRegExp.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/escapeRegExp.js deleted file mode 100644 index 0a58c69f..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/escapeRegExp.js +++ /dev/null @@ -1,32 +0,0 @@ -var toString = require('./toString'); - -/** - * Used to match `RegExp` - * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). - */ -var reRegExpChar = /[\\^$.*+?()[\]{}|]/g, - reHasRegExpChar = RegExp(reRegExpChar.source); - -/** - * Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+", - * "?", "(", ")", "[", "]", "{", "}", and "|" in `string`. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category String - * @param {string} [string=''] The string to escape. - * @returns {string} Returns the escaped string. - * @example - * - * _.escapeRegExp('[lodash](https://lodash.com/)'); - * // => '\[lodash\]\(https://lodash\.com/\)' - */ -function escapeRegExp(string) { - string = toString(string); - return (string && reHasRegExpChar.test(string)) - ? string.replace(reRegExpChar, '\\$&') - : string; -} - -module.exports = escapeRegExp; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/every.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/every.js deleted file mode 100644 index 25080dac..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/every.js +++ /dev/null @@ -1,56 +0,0 @@ -var arrayEvery = require('./_arrayEvery'), - baseEvery = require('./_baseEvery'), - baseIteratee = require('./_baseIteratee'), - isArray = require('./isArray'), - isIterateeCall = require('./_isIterateeCall'); - -/** - * Checks if `predicate` returns truthy for **all** elements of `collection`. - * Iteration is stopped once `predicate` returns falsey. The predicate is - * invoked with three arguments: (value, index|key, collection). - * - * **Note:** This method returns `true` for - * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because - * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of - * elements of empty collections. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [predicate=_.identity] The function invoked per iteration. - * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. - * @returns {boolean} Returns `true` if all elements pass the predicate check, - * else `false`. - * @example - * - * _.every([true, 1, null, 'yes'], Boolean); - * // => false - * - * var users = [ - * { 'user': 'barney', 'age': 36, 'active': false }, - * { 'user': 'fred', 'age': 40, 'active': false } - * ]; - * - * // The `_.matches` iteratee shorthand. - * _.every(users, { 'user': 'barney', 'active': false }); - * // => false - * - * // The `_.matchesProperty` iteratee shorthand. - * _.every(users, ['active', false]); - * // => true - * - * // The `_.property` iteratee shorthand. - * _.every(users, 'active'); - * // => false - */ -function every(collection, predicate, guard) { - var func = isArray(collection) ? arrayEvery : baseEvery; - if (guard && isIterateeCall(collection, predicate, guard)) { - predicate = undefined; - } - return func(collection, baseIteratee(predicate, 3)); -} - -module.exports = every; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/extend.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/extend.js deleted file mode 100644 index e00166c2..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/extend.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./assignIn'); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/extendWith.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/extendWith.js deleted file mode 100644 index dbdcb3b4..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/extendWith.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./assignInWith'); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fill.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fill.js deleted file mode 100644 index ae13aa1c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fill.js +++ /dev/null @@ -1,45 +0,0 @@ -var baseFill = require('./_baseFill'), - isIterateeCall = require('./_isIterateeCall'); - -/** - * Fills elements of `array` with `value` from `start` up to, but not - * including, `end`. - * - * **Note:** This method mutates `array`. - * - * @static - * @memberOf _ - * @since 3.2.0 - * @category Array - * @param {Array} array The array to fill. - * @param {*} value The value to fill `array` with. - * @param {number} [start=0] The start position. - * @param {number} [end=array.length] The end position. - * @returns {Array} Returns `array`. - * @example - * - * var array = [1, 2, 3]; - * - * _.fill(array, 'a'); - * console.log(array); - * // => ['a', 'a', 'a'] - * - * _.fill(Array(3), 2); - * // => [2, 2, 2] - * - * _.fill([4, 6, 8, 10], '*', 1, 3); - * // => [4, '*', '*', 10] - */ -function fill(array, value, start, end) { - var length = array == null ? 0 : array.length; - if (!length) { - return []; - } - if (start && typeof start != 'number' && isIterateeCall(array, value, start)) { - start = 0; - end = length; - } - return baseFill(array, value, start, end); -} - -module.exports = fill; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/filter.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/filter.js deleted file mode 100644 index 89e0c8c4..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/filter.js +++ /dev/null @@ -1,52 +0,0 @@ -var arrayFilter = require('./_arrayFilter'), - baseFilter = require('./_baseFilter'), - baseIteratee = require('./_baseIteratee'), - isArray = require('./isArray'); - -/** - * Iterates over elements of `collection`, returning an array of all elements - * `predicate` returns truthy for. The predicate is invoked with three - * arguments: (value, index|key, collection). - * - * **Note:** Unlike `_.remove`, this method returns a new array. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [predicate=_.identity] The function invoked per iteration. - * @returns {Array} Returns the new filtered array. - * @see _.reject - * @example - * - * var users = [ - * { 'user': 'barney', 'age': 36, 'active': true }, - * { 'user': 'fred', 'age': 40, 'active': false } - * ]; - * - * _.filter(users, function(o) { return !o.active; }); - * // => objects for ['fred'] - * - * // The `_.matches` iteratee shorthand. - * _.filter(users, { 'age': 36, 'active': true }); - * // => objects for ['barney'] - * - * // The `_.matchesProperty` iteratee shorthand. - * _.filter(users, ['active', false]); - * // => objects for ['fred'] - * - * // The `_.property` iteratee shorthand. - * _.filter(users, 'active'); - * // => objects for ['barney'] - * - * // Combining several predicates using `_.overEvery` or `_.overSome`. - * _.filter(users, _.overSome([{ 'age': 36 }, ['age', 40]])); - * // => objects for ['fred', 'barney'] - */ -function filter(collection, predicate) { - var func = isArray(collection) ? arrayFilter : baseFilter; - return func(collection, baseIteratee(predicate, 3)); -} - -module.exports = filter; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/find.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/find.js deleted file mode 100644 index de732ccb..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/find.js +++ /dev/null @@ -1,42 +0,0 @@ -var createFind = require('./_createFind'), - findIndex = require('./findIndex'); - -/** - * Iterates over elements of `collection`, returning the first element - * `predicate` returns truthy for. The predicate is invoked with three - * arguments: (value, index|key, collection). - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Collection - * @param {Array|Object} collection The collection to inspect. - * @param {Function} [predicate=_.identity] The function invoked per iteration. - * @param {number} [fromIndex=0] The index to search from. - * @returns {*} Returns the matched element, else `undefined`. - * @example - * - * var users = [ - * { 'user': 'barney', 'age': 36, 'active': true }, - * { 'user': 'fred', 'age': 40, 'active': false }, - * { 'user': 'pebbles', 'age': 1, 'active': true } - * ]; - * - * _.find(users, function(o) { return o.age < 40; }); - * // => object for 'barney' - * - * // The `_.matches` iteratee shorthand. - * _.find(users, { 'age': 1, 'active': true }); - * // => object for 'pebbles' - * - * // The `_.matchesProperty` iteratee shorthand. - * _.find(users, ['active', false]); - * // => object for 'fred' - * - * // The `_.property` iteratee shorthand. - * _.find(users, 'active'); - * // => object for 'barney' - */ -var find = createFind(findIndex); - -module.exports = find; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/findIndex.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/findIndex.js deleted file mode 100644 index 4689069f..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/findIndex.js +++ /dev/null @@ -1,55 +0,0 @@ -var baseFindIndex = require('./_baseFindIndex'), - baseIteratee = require('./_baseIteratee'), - toInteger = require('./toInteger'); - -/* Built-in method references for those with the same name as other `lodash` methods. */ -var nativeMax = Math.max; - -/** - * This method is like `_.find` except that it returns the index of the first - * element `predicate` returns truthy for instead of the element itself. - * - * @static - * @memberOf _ - * @since 1.1.0 - * @category Array - * @param {Array} array The array to inspect. - * @param {Function} [predicate=_.identity] The function invoked per iteration. - * @param {number} [fromIndex=0] The index to search from. - * @returns {number} Returns the index of the found element, else `-1`. - * @example - * - * var users = [ - * { 'user': 'barney', 'active': false }, - * { 'user': 'fred', 'active': false }, - * { 'user': 'pebbles', 'active': true } - * ]; - * - * _.findIndex(users, function(o) { return o.user == 'barney'; }); - * // => 0 - * - * // The `_.matches` iteratee shorthand. - * _.findIndex(users, { 'user': 'fred', 'active': false }); - * // => 1 - * - * // The `_.matchesProperty` iteratee shorthand. - * _.findIndex(users, ['active', false]); - * // => 0 - * - * // The `_.property` iteratee shorthand. - * _.findIndex(users, 'active'); - * // => 2 - */ -function findIndex(array, predicate, fromIndex) { - var length = array == null ? 0 : array.length; - if (!length) { - return -1; - } - var index = fromIndex == null ? 0 : toInteger(fromIndex); - if (index < 0) { - index = nativeMax(length + index, 0); - } - return baseFindIndex(array, baseIteratee(predicate, 3), index); -} - -module.exports = findIndex; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/findKey.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/findKey.js deleted file mode 100644 index cac0248a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/findKey.js +++ /dev/null @@ -1,44 +0,0 @@ -var baseFindKey = require('./_baseFindKey'), - baseForOwn = require('./_baseForOwn'), - baseIteratee = require('./_baseIteratee'); - -/** - * This method is like `_.find` except that it returns the key of the first - * element `predicate` returns truthy for instead of the element itself. - * - * @static - * @memberOf _ - * @since 1.1.0 - * @category Object - * @param {Object} object The object to inspect. - * @param {Function} [predicate=_.identity] The function invoked per iteration. - * @returns {string|undefined} Returns the key of the matched element, - * else `undefined`. - * @example - * - * var users = { - * 'barney': { 'age': 36, 'active': true }, - * 'fred': { 'age': 40, 'active': false }, - * 'pebbles': { 'age': 1, 'active': true } - * }; - * - * _.findKey(users, function(o) { return o.age < 40; }); - * // => 'barney' (iteration order is not guaranteed) - * - * // The `_.matches` iteratee shorthand. - * _.findKey(users, { 'age': 1, 'active': true }); - * // => 'pebbles' - * - * // The `_.matchesProperty` iteratee shorthand. - * _.findKey(users, ['active', false]); - * // => 'fred' - * - * // The `_.property` iteratee shorthand. - * _.findKey(users, 'active'); - * // => 'barney' - */ -function findKey(object, predicate) { - return baseFindKey(object, baseIteratee(predicate, 3), baseForOwn); -} - -module.exports = findKey; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/findLast.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/findLast.js deleted file mode 100644 index 70b4271d..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/findLast.js +++ /dev/null @@ -1,25 +0,0 @@ -var createFind = require('./_createFind'), - findLastIndex = require('./findLastIndex'); - -/** - * This method is like `_.find` except that it iterates over elements of - * `collection` from right to left. - * - * @static - * @memberOf _ - * @since 2.0.0 - * @category Collection - * @param {Array|Object} collection The collection to inspect. - * @param {Function} [predicate=_.identity] The function invoked per iteration. - * @param {number} [fromIndex=collection.length-1] The index to search from. - * @returns {*} Returns the matched element, else `undefined`. - * @example - * - * _.findLast([1, 2, 3, 4], function(n) { - * return n % 2 == 1; - * }); - * // => 3 - */ -var findLast = createFind(findLastIndex); - -module.exports = findLast; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/findLastIndex.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/findLastIndex.js deleted file mode 100644 index 7da3431f..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/findLastIndex.js +++ /dev/null @@ -1,59 +0,0 @@ -var baseFindIndex = require('./_baseFindIndex'), - baseIteratee = require('./_baseIteratee'), - toInteger = require('./toInteger'); - -/* Built-in method references for those with the same name as other `lodash` methods. */ -var nativeMax = Math.max, - nativeMin = Math.min; - -/** - * This method is like `_.findIndex` except that it iterates over elements - * of `collection` from right to left. - * - * @static - * @memberOf _ - * @since 2.0.0 - * @category Array - * @param {Array} array The array to inspect. - * @param {Function} [predicate=_.identity] The function invoked per iteration. - * @param {number} [fromIndex=array.length-1] The index to search from. - * @returns {number} Returns the index of the found element, else `-1`. - * @example - * - * var users = [ - * { 'user': 'barney', 'active': true }, - * { 'user': 'fred', 'active': false }, - * { 'user': 'pebbles', 'active': false } - * ]; - * - * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; }); - * // => 2 - * - * // The `_.matches` iteratee shorthand. - * _.findLastIndex(users, { 'user': 'barney', 'active': true }); - * // => 0 - * - * // The `_.matchesProperty` iteratee shorthand. - * _.findLastIndex(users, ['active', false]); - * // => 2 - * - * // The `_.property` iteratee shorthand. - * _.findLastIndex(users, 'active'); - * // => 0 - */ -function findLastIndex(array, predicate, fromIndex) { - var length = array == null ? 0 : array.length; - if (!length) { - return -1; - } - var index = length - 1; - if (fromIndex !== undefined) { - index = toInteger(fromIndex); - index = fromIndex < 0 - ? nativeMax(length + index, 0) - : nativeMin(index, length - 1); - } - return baseFindIndex(array, baseIteratee(predicate, 3), index, true); -} - -module.exports = findLastIndex; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/findLastKey.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/findLastKey.js deleted file mode 100644 index 66fb9fbc..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/findLastKey.js +++ /dev/null @@ -1,44 +0,0 @@ -var baseFindKey = require('./_baseFindKey'), - baseForOwnRight = require('./_baseForOwnRight'), - baseIteratee = require('./_baseIteratee'); - -/** - * This method is like `_.findKey` except that it iterates over elements of - * a collection in the opposite order. - * - * @static - * @memberOf _ - * @since 2.0.0 - * @category Object - * @param {Object} object The object to inspect. - * @param {Function} [predicate=_.identity] The function invoked per iteration. - * @returns {string|undefined} Returns the key of the matched element, - * else `undefined`. - * @example - * - * var users = { - * 'barney': { 'age': 36, 'active': true }, - * 'fred': { 'age': 40, 'active': false }, - * 'pebbles': { 'age': 1, 'active': true } - * }; - * - * _.findLastKey(users, function(o) { return o.age < 40; }); - * // => returns 'pebbles' assuming `_.findKey` returns 'barney' - * - * // The `_.matches` iteratee shorthand. - * _.findLastKey(users, { 'age': 36, 'active': true }); - * // => 'barney' - * - * // The `_.matchesProperty` iteratee shorthand. - * _.findLastKey(users, ['active', false]); - * // => 'fred' - * - * // The `_.property` iteratee shorthand. - * _.findLastKey(users, 'active'); - * // => 'pebbles' - */ -function findLastKey(object, predicate) { - return baseFindKey(object, baseIteratee(predicate, 3), baseForOwnRight); -} - -module.exports = findLastKey; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/first.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/first.js deleted file mode 100644 index 53f4ad13..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/first.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./head'); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/flake.lock b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/flake.lock deleted file mode 100644 index dd032521..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/flake.lock +++ /dev/null @@ -1,40 +0,0 @@ -{ - "nodes": { - "nixpkgs": { - "locked": { - "lastModified": 1613582597, - "narHash": "sha256-6LvipIvFuhyorHpUqK3HjySC5Y6gshXHFBhU9EJ4DoM=", - "path": "/nix/store/srvplqq673sqd9vyfhyc5w1p88y1gfm4-source", - "rev": "6b1057b452c55bb3b463f0d7055bc4ec3fd1f381", - "type": "path" - }, - "original": { - "id": "nixpkgs", - "type": "indirect" - } - }, - "root": { - "inputs": { - "nixpkgs": "nixpkgs", - "utils": "utils" - } - }, - "utils": { - "locked": { - "lastModified": 1610051610, - "narHash": "sha256-U9rPz/usA1/Aohhk7Cmc2gBrEEKRzcW4nwPWMPwja4Y=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "3982c9903e93927c2164caa727cd3f6a0e6d14cc", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - } - }, - "root": "root", - "version": 7 -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/flake.nix b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/flake.nix deleted file mode 100644 index 15a451c6..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/flake.nix +++ /dev/null @@ -1,20 +0,0 @@ -{ - inputs = { - utils.url = "github:numtide/flake-utils"; - }; - - outputs = { self, nixpkgs, utils }: - utils.lib.eachDefaultSystem (system: - let - pkgs = nixpkgs.legacyPackages."${system}"; - in rec { - devShell = pkgs.mkShell { - nativeBuildInputs = with pkgs; [ - yarn - nodejs-14_x - nodePackages.typescript-language-server - nodePackages.eslint - ]; - }; - }); -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/flatMap.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/flatMap.js deleted file mode 100644 index e6685068..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/flatMap.js +++ /dev/null @@ -1,29 +0,0 @@ -var baseFlatten = require('./_baseFlatten'), - map = require('./map'); - -/** - * Creates a flattened array of values by running each element in `collection` - * thru `iteratee` and flattening the mapped results. The iteratee is invoked - * with three arguments: (value, index|key, collection). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @returns {Array} Returns the new flattened array. - * @example - * - * function duplicate(n) { - * return [n, n]; - * } - * - * _.flatMap([1, 2], duplicate); - * // => [1, 1, 2, 2] - */ -function flatMap(collection, iteratee) { - return baseFlatten(map(collection, iteratee), 1); -} - -module.exports = flatMap; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/flatMapDeep.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/flatMapDeep.js deleted file mode 100644 index 4653d603..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/flatMapDeep.js +++ /dev/null @@ -1,31 +0,0 @@ -var baseFlatten = require('./_baseFlatten'), - map = require('./map'); - -/** Used as references for various `Number` constants. */ -var INFINITY = 1 / 0; - -/** - * This method is like `_.flatMap` except that it recursively flattens the - * mapped results. - * - * @static - * @memberOf _ - * @since 4.7.0 - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @returns {Array} Returns the new flattened array. - * @example - * - * function duplicate(n) { - * return [[[n, n]]]; - * } - * - * _.flatMapDeep([1, 2], duplicate); - * // => [1, 1, 2, 2] - */ -function flatMapDeep(collection, iteratee) { - return baseFlatten(map(collection, iteratee), INFINITY); -} - -module.exports = flatMapDeep; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/flatMapDepth.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/flatMapDepth.js deleted file mode 100644 index 6d72005c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/flatMapDepth.js +++ /dev/null @@ -1,31 +0,0 @@ -var baseFlatten = require('./_baseFlatten'), - map = require('./map'), - toInteger = require('./toInteger'); - -/** - * This method is like `_.flatMap` except that it recursively flattens the - * mapped results up to `depth` times. - * - * @static - * @memberOf _ - * @since 4.7.0 - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @param {number} [depth=1] The maximum recursion depth. - * @returns {Array} Returns the new flattened array. - * @example - * - * function duplicate(n) { - * return [[[n, n]]]; - * } - * - * _.flatMapDepth([1, 2], duplicate, 2); - * // => [[1, 1], [2, 2]] - */ -function flatMapDepth(collection, iteratee, depth) { - depth = depth === undefined ? 1 : toInteger(depth); - return baseFlatten(map(collection, iteratee), depth); -} - -module.exports = flatMapDepth; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/flatten.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/flatten.js deleted file mode 100644 index 3f09f7f7..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/flatten.js +++ /dev/null @@ -1,22 +0,0 @@ -var baseFlatten = require('./_baseFlatten'); - -/** - * Flattens `array` a single level deep. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Array - * @param {Array} array The array to flatten. - * @returns {Array} Returns the new flattened array. - * @example - * - * _.flatten([1, [2, [3, [4]], 5]]); - * // => [1, 2, [3, [4]], 5] - */ -function flatten(array) { - var length = array == null ? 0 : array.length; - return length ? baseFlatten(array, 1) : []; -} - -module.exports = flatten; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/flattenDeep.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/flattenDeep.js deleted file mode 100644 index 8ad585cf..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/flattenDeep.js +++ /dev/null @@ -1,25 +0,0 @@ -var baseFlatten = require('./_baseFlatten'); - -/** Used as references for various `Number` constants. */ -var INFINITY = 1 / 0; - -/** - * Recursively flattens `array`. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Array - * @param {Array} array The array to flatten. - * @returns {Array} Returns the new flattened array. - * @example - * - * _.flattenDeep([1, [2, [3, [4]], 5]]); - * // => [1, 2, 3, 4, 5] - */ -function flattenDeep(array) { - var length = array == null ? 0 : array.length; - return length ? baseFlatten(array, INFINITY) : []; -} - -module.exports = flattenDeep; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/flattenDepth.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/flattenDepth.js deleted file mode 100644 index 441fdcc2..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/flattenDepth.js +++ /dev/null @@ -1,33 +0,0 @@ -var baseFlatten = require('./_baseFlatten'), - toInteger = require('./toInteger'); - -/** - * Recursively flatten `array` up to `depth` times. - * - * @static - * @memberOf _ - * @since 4.4.0 - * @category Array - * @param {Array} array The array to flatten. - * @param {number} [depth=1] The maximum recursion depth. - * @returns {Array} Returns the new flattened array. - * @example - * - * var array = [1, [2, [3, [4]], 5]]; - * - * _.flattenDepth(array, 1); - * // => [1, 2, [3, [4]], 5] - * - * _.flattenDepth(array, 2); - * // => [1, 2, 3, [4], 5] - */ -function flattenDepth(array, depth) { - var length = array == null ? 0 : array.length; - if (!length) { - return []; - } - depth = depth === undefined ? 1 : toInteger(depth); - return baseFlatten(array, depth); -} - -module.exports = flattenDepth; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/flip.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/flip.js deleted file mode 100644 index c28dd789..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/flip.js +++ /dev/null @@ -1,28 +0,0 @@ -var createWrap = require('./_createWrap'); - -/** Used to compose bitmasks for function metadata. */ -var WRAP_FLIP_FLAG = 512; - -/** - * Creates a function that invokes `func` with arguments reversed. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Function - * @param {Function} func The function to flip arguments for. - * @returns {Function} Returns the new flipped function. - * @example - * - * var flipped = _.flip(function() { - * return _.toArray(arguments); - * }); - * - * flipped('a', 'b', 'c', 'd'); - * // => ['d', 'c', 'b', 'a'] - */ -function flip(func) { - return createWrap(func, WRAP_FLIP_FLAG); -} - -module.exports = flip; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/floor.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/floor.js deleted file mode 100644 index ab6dfa28..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/floor.js +++ /dev/null @@ -1,26 +0,0 @@ -var createRound = require('./_createRound'); - -/** - * Computes `number` rounded down to `precision`. - * - * @static - * @memberOf _ - * @since 3.10.0 - * @category Math - * @param {number} number The number to round down. - * @param {number} [precision=0] The precision to round down to. - * @returns {number} Returns the rounded down number. - * @example - * - * _.floor(4.006); - * // => 4 - * - * _.floor(0.046, 2); - * // => 0.04 - * - * _.floor(4060, -2); - * // => 4000 - */ -var floor = createRound('floor'); - -module.exports = floor; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/flow.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/flow.js deleted file mode 100644 index 74b6b62d..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/flow.js +++ /dev/null @@ -1,27 +0,0 @@ -var createFlow = require('./_createFlow'); - -/** - * Creates a function that returns the result of invoking the given functions - * with the `this` binding of the created function, where each successive - * invocation is supplied the return value of the previous. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Util - * @param {...(Function|Function[])} [funcs] The functions to invoke. - * @returns {Function} Returns the new composite function. - * @see _.flowRight - * @example - * - * function square(n) { - * return n * n; - * } - * - * var addSquare = _.flow([_.add, square]); - * addSquare(1, 2); - * // => 9 - */ -var flow = createFlow(); - -module.exports = flow; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/flowRight.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/flowRight.js deleted file mode 100644 index 11461410..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/flowRight.js +++ /dev/null @@ -1,26 +0,0 @@ -var createFlow = require('./_createFlow'); - -/** - * This method is like `_.flow` except that it creates a function that - * invokes the given functions from right to left. - * - * @static - * @since 3.0.0 - * @memberOf _ - * @category Util - * @param {...(Function|Function[])} [funcs] The functions to invoke. - * @returns {Function} Returns the new composite function. - * @see _.flow - * @example - * - * function square(n) { - * return n * n; - * } - * - * var addSquare = _.flowRight([square, _.add]); - * addSquare(1, 2); - * // => 9 - */ -var flowRight = createFlow(true); - -module.exports = flowRight; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/forEach.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/forEach.js deleted file mode 100644 index c64eaa73..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/forEach.js +++ /dev/null @@ -1,41 +0,0 @@ -var arrayEach = require('./_arrayEach'), - baseEach = require('./_baseEach'), - castFunction = require('./_castFunction'), - isArray = require('./isArray'); - -/** - * Iterates over elements of `collection` and invokes `iteratee` for each element. - * The iteratee is invoked with three arguments: (value, index|key, collection). - * Iteratee functions may exit iteration early by explicitly returning `false`. - * - * **Note:** As with other "Collections" methods, objects with a "length" - * property are iterated like arrays. To avoid this behavior use `_.forIn` - * or `_.forOwn` for object iteration. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @alias each - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @returns {Array|Object} Returns `collection`. - * @see _.forEachRight - * @example - * - * _.forEach([1, 2], function(value) { - * console.log(value); - * }); - * // => Logs `1` then `2`. - * - * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) { - * console.log(key); - * }); - * // => Logs 'a' then 'b' (iteration order is not guaranteed). - */ -function forEach(collection, iteratee) { - var func = isArray(collection) ? arrayEach : baseEach; - return func(collection, castFunction(iteratee)); -} - -module.exports = forEach; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/forEachRight.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/forEachRight.js deleted file mode 100644 index 7390ebaf..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/forEachRight.js +++ /dev/null @@ -1,31 +0,0 @@ -var arrayEachRight = require('./_arrayEachRight'), - baseEachRight = require('./_baseEachRight'), - castFunction = require('./_castFunction'), - isArray = require('./isArray'); - -/** - * This method is like `_.forEach` except that it iterates over elements of - * `collection` from right to left. - * - * @static - * @memberOf _ - * @since 2.0.0 - * @alias eachRight - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @returns {Array|Object} Returns `collection`. - * @see _.forEach - * @example - * - * _.forEachRight([1, 2], function(value) { - * console.log(value); - * }); - * // => Logs `2` then `1`. - */ -function forEachRight(collection, iteratee) { - var func = isArray(collection) ? arrayEachRight : baseEachRight; - return func(collection, castFunction(iteratee)); -} - -module.exports = forEachRight; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/forIn.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/forIn.js deleted file mode 100644 index 583a5963..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/forIn.js +++ /dev/null @@ -1,39 +0,0 @@ -var baseFor = require('./_baseFor'), - castFunction = require('./_castFunction'), - keysIn = require('./keysIn'); - -/** - * Iterates over own and inherited enumerable string keyed properties of an - * object and invokes `iteratee` for each property. The iteratee is invoked - * with three arguments: (value, key, object). Iteratee functions may exit - * iteration early by explicitly returning `false`. - * - * @static - * @memberOf _ - * @since 0.3.0 - * @category Object - * @param {Object} object The object to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @returns {Object} Returns `object`. - * @see _.forInRight - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.forIn(new Foo, function(value, key) { - * console.log(key); - * }); - * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed). - */ -function forIn(object, iteratee) { - return object == null - ? object - : baseFor(object, castFunction(iteratee), keysIn); -} - -module.exports = forIn; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/forInRight.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/forInRight.js deleted file mode 100644 index 4aedf58a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/forInRight.js +++ /dev/null @@ -1,37 +0,0 @@ -var baseForRight = require('./_baseForRight'), - castFunction = require('./_castFunction'), - keysIn = require('./keysIn'); - -/** - * This method is like `_.forIn` except that it iterates over properties of - * `object` in the opposite order. - * - * @static - * @memberOf _ - * @since 2.0.0 - * @category Object - * @param {Object} object The object to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @returns {Object} Returns `object`. - * @see _.forIn - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.forInRight(new Foo, function(value, key) { - * console.log(key); - * }); - * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'. - */ -function forInRight(object, iteratee) { - return object == null - ? object - : baseForRight(object, castFunction(iteratee), keysIn); -} - -module.exports = forInRight; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/forOwn.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/forOwn.js deleted file mode 100644 index 94eed840..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/forOwn.js +++ /dev/null @@ -1,36 +0,0 @@ -var baseForOwn = require('./_baseForOwn'), - castFunction = require('./_castFunction'); - -/** - * Iterates over own enumerable string keyed properties of an object and - * invokes `iteratee` for each property. The iteratee is invoked with three - * arguments: (value, key, object). Iteratee functions may exit iteration - * early by explicitly returning `false`. - * - * @static - * @memberOf _ - * @since 0.3.0 - * @category Object - * @param {Object} object The object to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @returns {Object} Returns `object`. - * @see _.forOwnRight - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.forOwn(new Foo, function(value, key) { - * console.log(key); - * }); - * // => Logs 'a' then 'b' (iteration order is not guaranteed). - */ -function forOwn(object, iteratee) { - return object && baseForOwn(object, castFunction(iteratee)); -} - -module.exports = forOwn; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/forOwnRight.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/forOwnRight.js deleted file mode 100644 index 86f338f0..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/forOwnRight.js +++ /dev/null @@ -1,34 +0,0 @@ -var baseForOwnRight = require('./_baseForOwnRight'), - castFunction = require('./_castFunction'); - -/** - * This method is like `_.forOwn` except that it iterates over properties of - * `object` in the opposite order. - * - * @static - * @memberOf _ - * @since 2.0.0 - * @category Object - * @param {Object} object The object to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @returns {Object} Returns `object`. - * @see _.forOwn - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.forOwnRight(new Foo, function(value, key) { - * console.log(key); - * }); - * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'. - */ -function forOwnRight(object, iteratee) { - return object && baseForOwnRight(object, castFunction(iteratee)); -} - -module.exports = forOwnRight; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp.js deleted file mode 100644 index e372dbbd..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp.js +++ /dev/null @@ -1,2 +0,0 @@ -var _ = require('./lodash.min').runInContext(); -module.exports = require('./fp/_baseConvert')(_, _); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/F.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/F.js deleted file mode 100644 index a05a63ad..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/F.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./stubFalse'); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/T.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/T.js deleted file mode 100644 index e2ba8ea5..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/T.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./stubTrue'); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/__.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/__.js deleted file mode 100644 index 4af98deb..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/__.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./placeholder'); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/_baseConvert.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/_baseConvert.js deleted file mode 100644 index 9baf8e19..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/_baseConvert.js +++ /dev/null @@ -1,569 +0,0 @@ -var mapping = require('./_mapping'), - fallbackHolder = require('./placeholder'); - -/** Built-in value reference. */ -var push = Array.prototype.push; - -/** - * Creates a function, with an arity of `n`, that invokes `func` with the - * arguments it receives. - * - * @private - * @param {Function} func The function to wrap. - * @param {number} n The arity of the new function. - * @returns {Function} Returns the new function. - */ -function baseArity(func, n) { - return n == 2 - ? function(a, b) { return func.apply(undefined, arguments); } - : function(a) { return func.apply(undefined, arguments); }; -} - -/** - * Creates a function that invokes `func`, with up to `n` arguments, ignoring - * any additional arguments. - * - * @private - * @param {Function} func The function to cap arguments for. - * @param {number} n The arity cap. - * @returns {Function} Returns the new function. - */ -function baseAry(func, n) { - return n == 2 - ? function(a, b) { return func(a, b); } - : function(a) { return func(a); }; -} - -/** - * Creates a clone of `array`. - * - * @private - * @param {Array} array The array to clone. - * @returns {Array} Returns the cloned array. - */ -function cloneArray(array) { - var length = array ? array.length : 0, - result = Array(length); - - while (length--) { - result[length] = array[length]; - } - return result; -} - -/** - * Creates a function that clones a given object using the assignment `func`. - * - * @private - * @param {Function} func The assignment function. - * @returns {Function} Returns the new cloner function. - */ -function createCloner(func) { - return function(object) { - return func({}, object); - }; -} - -/** - * A specialized version of `_.spread` which flattens the spread array into - * the arguments of the invoked `func`. - * - * @private - * @param {Function} func The function to spread arguments over. - * @param {number} start The start position of the spread. - * @returns {Function} Returns the new function. - */ -function flatSpread(func, start) { - return function() { - var length = arguments.length, - lastIndex = length - 1, - args = Array(length); - - while (length--) { - args[length] = arguments[length]; - } - var array = args[start], - otherArgs = args.slice(0, start); - - if (array) { - push.apply(otherArgs, array); - } - if (start != lastIndex) { - push.apply(otherArgs, args.slice(start + 1)); - } - return func.apply(this, otherArgs); - }; -} - -/** - * Creates a function that wraps `func` and uses `cloner` to clone the first - * argument it receives. - * - * @private - * @param {Function} func The function to wrap. - * @param {Function} cloner The function to clone arguments. - * @returns {Function} Returns the new immutable function. - */ -function wrapImmutable(func, cloner) { - return function() { - var length = arguments.length; - if (!length) { - return; - } - var args = Array(length); - while (length--) { - args[length] = arguments[length]; - } - var result = args[0] = cloner.apply(undefined, args); - func.apply(undefined, args); - return result; - }; -} - -/** - * The base implementation of `convert` which accepts a `util` object of methods - * required to perform conversions. - * - * @param {Object} util The util object. - * @param {string} name The name of the function to convert. - * @param {Function} func The function to convert. - * @param {Object} [options] The options object. - * @param {boolean} [options.cap=true] Specify capping iteratee arguments. - * @param {boolean} [options.curry=true] Specify currying. - * @param {boolean} [options.fixed=true] Specify fixed arity. - * @param {boolean} [options.immutable=true] Specify immutable operations. - * @param {boolean} [options.rearg=true] Specify rearranging arguments. - * @returns {Function|Object} Returns the converted function or object. - */ -function baseConvert(util, name, func, options) { - var isLib = typeof name == 'function', - isObj = name === Object(name); - - if (isObj) { - options = func; - func = name; - name = undefined; - } - if (func == null) { - throw new TypeError; - } - options || (options = {}); - - var config = { - 'cap': 'cap' in options ? options.cap : true, - 'curry': 'curry' in options ? options.curry : true, - 'fixed': 'fixed' in options ? options.fixed : true, - 'immutable': 'immutable' in options ? options.immutable : true, - 'rearg': 'rearg' in options ? options.rearg : true - }; - - var defaultHolder = isLib ? func : fallbackHolder, - forceCurry = ('curry' in options) && options.curry, - forceFixed = ('fixed' in options) && options.fixed, - forceRearg = ('rearg' in options) && options.rearg, - pristine = isLib ? func.runInContext() : undefined; - - var helpers = isLib ? func : { - 'ary': util.ary, - 'assign': util.assign, - 'clone': util.clone, - 'curry': util.curry, - 'forEach': util.forEach, - 'isArray': util.isArray, - 'isError': util.isError, - 'isFunction': util.isFunction, - 'isWeakMap': util.isWeakMap, - 'iteratee': util.iteratee, - 'keys': util.keys, - 'rearg': util.rearg, - 'toInteger': util.toInteger, - 'toPath': util.toPath - }; - - var ary = helpers.ary, - assign = helpers.assign, - clone = helpers.clone, - curry = helpers.curry, - each = helpers.forEach, - isArray = helpers.isArray, - isError = helpers.isError, - isFunction = helpers.isFunction, - isWeakMap = helpers.isWeakMap, - keys = helpers.keys, - rearg = helpers.rearg, - toInteger = helpers.toInteger, - toPath = helpers.toPath; - - var aryMethodKeys = keys(mapping.aryMethod); - - var wrappers = { - 'castArray': function(castArray) { - return function() { - var value = arguments[0]; - return isArray(value) - ? castArray(cloneArray(value)) - : castArray.apply(undefined, arguments); - }; - }, - 'iteratee': function(iteratee) { - return function() { - var func = arguments[0], - arity = arguments[1], - result = iteratee(func, arity), - length = result.length; - - if (config.cap && typeof arity == 'number') { - arity = arity > 2 ? (arity - 2) : 1; - return (length && length <= arity) ? result : baseAry(result, arity); - } - return result; - }; - }, - 'mixin': function(mixin) { - return function(source) { - var func = this; - if (!isFunction(func)) { - return mixin(func, Object(source)); - } - var pairs = []; - each(keys(source), function(key) { - if (isFunction(source[key])) { - pairs.push([key, func.prototype[key]]); - } - }); - - mixin(func, Object(source)); - - each(pairs, function(pair) { - var value = pair[1]; - if (isFunction(value)) { - func.prototype[pair[0]] = value; - } else { - delete func.prototype[pair[0]]; - } - }); - return func; - }; - }, - 'nthArg': function(nthArg) { - return function(n) { - var arity = n < 0 ? 1 : (toInteger(n) + 1); - return curry(nthArg(n), arity); - }; - }, - 'rearg': function(rearg) { - return function(func, indexes) { - var arity = indexes ? indexes.length : 0; - return curry(rearg(func, indexes), arity); - }; - }, - 'runInContext': function(runInContext) { - return function(context) { - return baseConvert(util, runInContext(context), options); - }; - } - }; - - /*--------------------------------------------------------------------------*/ - - /** - * Casts `func` to a function with an arity capped iteratee if needed. - * - * @private - * @param {string} name The name of the function to inspect. - * @param {Function} func The function to inspect. - * @returns {Function} Returns the cast function. - */ - function castCap(name, func) { - if (config.cap) { - var indexes = mapping.iterateeRearg[name]; - if (indexes) { - return iterateeRearg(func, indexes); - } - var n = !isLib && mapping.iterateeAry[name]; - if (n) { - return iterateeAry(func, n); - } - } - return func; - } - - /** - * Casts `func` to a curried function if needed. - * - * @private - * @param {string} name The name of the function to inspect. - * @param {Function} func The function to inspect. - * @param {number} n The arity of `func`. - * @returns {Function} Returns the cast function. - */ - function castCurry(name, func, n) { - return (forceCurry || (config.curry && n > 1)) - ? curry(func, n) - : func; - } - - /** - * Casts `func` to a fixed arity function if needed. - * - * @private - * @param {string} name The name of the function to inspect. - * @param {Function} func The function to inspect. - * @param {number} n The arity cap. - * @returns {Function} Returns the cast function. - */ - function castFixed(name, func, n) { - if (config.fixed && (forceFixed || !mapping.skipFixed[name])) { - var data = mapping.methodSpread[name], - start = data && data.start; - - return start === undefined ? ary(func, n) : flatSpread(func, start); - } - return func; - } - - /** - * Casts `func` to an rearged function if needed. - * - * @private - * @param {string} name The name of the function to inspect. - * @param {Function} func The function to inspect. - * @param {number} n The arity of `func`. - * @returns {Function} Returns the cast function. - */ - function castRearg(name, func, n) { - return (config.rearg && n > 1 && (forceRearg || !mapping.skipRearg[name])) - ? rearg(func, mapping.methodRearg[name] || mapping.aryRearg[n]) - : func; - } - - /** - * Creates a clone of `object` by `path`. - * - * @private - * @param {Object} object The object to clone. - * @param {Array|string} path The path to clone by. - * @returns {Object} Returns the cloned object. - */ - function cloneByPath(object, path) { - path = toPath(path); - - var index = -1, - length = path.length, - lastIndex = length - 1, - result = clone(Object(object)), - nested = result; - - while (nested != null && ++index < length) { - var key = path[index], - value = nested[key]; - - if (value != null && - !(isFunction(value) || isError(value) || isWeakMap(value))) { - nested[key] = clone(index == lastIndex ? value : Object(value)); - } - nested = nested[key]; - } - return result; - } - - /** - * Converts `lodash` to an immutable auto-curried iteratee-first data-last - * version with conversion `options` applied. - * - * @param {Object} [options] The options object. See `baseConvert` for more details. - * @returns {Function} Returns the converted `lodash`. - */ - function convertLib(options) { - return _.runInContext.convert(options)(undefined); - } - - /** - * Create a converter function for `func` of `name`. - * - * @param {string} name The name of the function to convert. - * @param {Function} func The function to convert. - * @returns {Function} Returns the new converter function. - */ - function createConverter(name, func) { - var realName = mapping.aliasToReal[name] || name, - methodName = mapping.remap[realName] || realName, - oldOptions = options; - - return function(options) { - var newUtil = isLib ? pristine : helpers, - newFunc = isLib ? pristine[methodName] : func, - newOptions = assign(assign({}, oldOptions), options); - - return baseConvert(newUtil, realName, newFunc, newOptions); - }; - } - - /** - * Creates a function that wraps `func` to invoke its iteratee, with up to `n` - * arguments, ignoring any additional arguments. - * - * @private - * @param {Function} func The function to cap iteratee arguments for. - * @param {number} n The arity cap. - * @returns {Function} Returns the new function. - */ - function iterateeAry(func, n) { - return overArg(func, function(func) { - return typeof func == 'function' ? baseAry(func, n) : func; - }); - } - - /** - * Creates a function that wraps `func` to invoke its iteratee with arguments - * arranged according to the specified `indexes` where the argument value at - * the first index is provided as the first argument, the argument value at - * the second index is provided as the second argument, and so on. - * - * @private - * @param {Function} func The function to rearrange iteratee arguments for. - * @param {number[]} indexes The arranged argument indexes. - * @returns {Function} Returns the new function. - */ - function iterateeRearg(func, indexes) { - return overArg(func, function(func) { - var n = indexes.length; - return baseArity(rearg(baseAry(func, n), indexes), n); - }); - } - - /** - * Creates a function that invokes `func` with its first argument transformed. - * - * @private - * @param {Function} func The function to wrap. - * @param {Function} transform The argument transform. - * @returns {Function} Returns the new function. - */ - function overArg(func, transform) { - return function() { - var length = arguments.length; - if (!length) { - return func(); - } - var args = Array(length); - while (length--) { - args[length] = arguments[length]; - } - var index = config.rearg ? 0 : (length - 1); - args[index] = transform(args[index]); - return func.apply(undefined, args); - }; - } - - /** - * Creates a function that wraps `func` and applys the conversions - * rules by `name`. - * - * @private - * @param {string} name The name of the function to wrap. - * @param {Function} func The function to wrap. - * @returns {Function} Returns the converted function. - */ - function wrap(name, func, placeholder) { - var result, - realName = mapping.aliasToReal[name] || name, - wrapped = func, - wrapper = wrappers[realName]; - - if (wrapper) { - wrapped = wrapper(func); - } - else if (config.immutable) { - if (mapping.mutate.array[realName]) { - wrapped = wrapImmutable(func, cloneArray); - } - else if (mapping.mutate.object[realName]) { - wrapped = wrapImmutable(func, createCloner(func)); - } - else if (mapping.mutate.set[realName]) { - wrapped = wrapImmutable(func, cloneByPath); - } - } - each(aryMethodKeys, function(aryKey) { - each(mapping.aryMethod[aryKey], function(otherName) { - if (realName == otherName) { - var data = mapping.methodSpread[realName], - afterRearg = data && data.afterRearg; - - result = afterRearg - ? castFixed(realName, castRearg(realName, wrapped, aryKey), aryKey) - : castRearg(realName, castFixed(realName, wrapped, aryKey), aryKey); - - result = castCap(realName, result); - result = castCurry(realName, result, aryKey); - return false; - } - }); - return !result; - }); - - result || (result = wrapped); - if (result == func) { - result = forceCurry ? curry(result, 1) : function() { - return func.apply(this, arguments); - }; - } - result.convert = createConverter(realName, func); - result.placeholder = func.placeholder = placeholder; - - return result; - } - - /*--------------------------------------------------------------------------*/ - - if (!isObj) { - return wrap(name, func, defaultHolder); - } - var _ = func; - - // Convert methods by ary cap. - var pairs = []; - each(aryMethodKeys, function(aryKey) { - each(mapping.aryMethod[aryKey], function(key) { - var func = _[mapping.remap[key] || key]; - if (func) { - pairs.push([key, wrap(key, func, _)]); - } - }); - }); - - // Convert remaining methods. - each(keys(_), function(key) { - var func = _[key]; - if (typeof func == 'function') { - var length = pairs.length; - while (length--) { - if (pairs[length][0] == key) { - return; - } - } - func.convert = createConverter(key, func); - pairs.push([key, func]); - } - }); - - // Assign to `_` leaving `_.prototype` unchanged to allow chaining. - each(pairs, function(pair) { - _[pair[0]] = pair[1]; - }); - - _.convert = convertLib; - _.placeholder = _; - - // Assign aliases. - each(keys(_), function(key) { - each(mapping.realToAlias[key] || [], function(alias) { - _[alias] = _[key]; - }); - }); - - return _; -} - -module.exports = baseConvert; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/_convertBrowser.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/_convertBrowser.js deleted file mode 100644 index bde030dc..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/_convertBrowser.js +++ /dev/null @@ -1,18 +0,0 @@ -var baseConvert = require('./_baseConvert'); - -/** - * Converts `lodash` to an immutable auto-curried iteratee-first data-last - * version with conversion `options` applied. - * - * @param {Function} lodash The lodash function to convert. - * @param {Object} [options] The options object. See `baseConvert` for more details. - * @returns {Function} Returns the converted `lodash`. - */ -function browserConvert(lodash, options) { - return baseConvert(lodash, lodash, options); -} - -if (typeof _ == 'function' && typeof _.runInContext == 'function') { - _ = browserConvert(_.runInContext()); -} -module.exports = browserConvert; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/_falseOptions.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/_falseOptions.js deleted file mode 100644 index 773235e3..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/_falseOptions.js +++ /dev/null @@ -1,7 +0,0 @@ -module.exports = { - 'cap': false, - 'curry': false, - 'fixed': false, - 'immutable': false, - 'rearg': false -}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/_mapping.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/_mapping.js deleted file mode 100644 index a642ec05..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/_mapping.js +++ /dev/null @@ -1,358 +0,0 @@ -/** Used to map aliases to their real names. */ -exports.aliasToReal = { - - // Lodash aliases. - 'each': 'forEach', - 'eachRight': 'forEachRight', - 'entries': 'toPairs', - 'entriesIn': 'toPairsIn', - 'extend': 'assignIn', - 'extendAll': 'assignInAll', - 'extendAllWith': 'assignInAllWith', - 'extendWith': 'assignInWith', - 'first': 'head', - - // Methods that are curried variants of others. - 'conforms': 'conformsTo', - 'matches': 'isMatch', - 'property': 'get', - - // Ramda aliases. - '__': 'placeholder', - 'F': 'stubFalse', - 'T': 'stubTrue', - 'all': 'every', - 'allPass': 'overEvery', - 'always': 'constant', - 'any': 'some', - 'anyPass': 'overSome', - 'apply': 'spread', - 'assoc': 'set', - 'assocPath': 'set', - 'complement': 'negate', - 'compose': 'flowRight', - 'contains': 'includes', - 'dissoc': 'unset', - 'dissocPath': 'unset', - 'dropLast': 'dropRight', - 'dropLastWhile': 'dropRightWhile', - 'equals': 'isEqual', - 'identical': 'eq', - 'indexBy': 'keyBy', - 'init': 'initial', - 'invertObj': 'invert', - 'juxt': 'over', - 'omitAll': 'omit', - 'nAry': 'ary', - 'path': 'get', - 'pathEq': 'matchesProperty', - 'pathOr': 'getOr', - 'paths': 'at', - 'pickAll': 'pick', - 'pipe': 'flow', - 'pluck': 'map', - 'prop': 'get', - 'propEq': 'matchesProperty', - 'propOr': 'getOr', - 'props': 'at', - 'symmetricDifference': 'xor', - 'symmetricDifferenceBy': 'xorBy', - 'symmetricDifferenceWith': 'xorWith', - 'takeLast': 'takeRight', - 'takeLastWhile': 'takeRightWhile', - 'unapply': 'rest', - 'unnest': 'flatten', - 'useWith': 'overArgs', - 'where': 'conformsTo', - 'whereEq': 'isMatch', - 'zipObj': 'zipObject' -}; - -/** Used to map ary to method names. */ -exports.aryMethod = { - '1': [ - 'assignAll', 'assignInAll', 'attempt', 'castArray', 'ceil', 'create', - 'curry', 'curryRight', 'defaultsAll', 'defaultsDeepAll', 'floor', 'flow', - 'flowRight', 'fromPairs', 'invert', 'iteratee', 'memoize', 'method', 'mergeAll', - 'methodOf', 'mixin', 'nthArg', 'over', 'overEvery', 'overSome','rest', 'reverse', - 'round', 'runInContext', 'spread', 'template', 'trim', 'trimEnd', 'trimStart', - 'uniqueId', 'words', 'zipAll' - ], - '2': [ - 'add', 'after', 'ary', 'assign', 'assignAllWith', 'assignIn', 'assignInAllWith', - 'at', 'before', 'bind', 'bindAll', 'bindKey', 'chunk', 'cloneDeepWith', - 'cloneWith', 'concat', 'conformsTo', 'countBy', 'curryN', 'curryRightN', - 'debounce', 'defaults', 'defaultsDeep', 'defaultTo', 'delay', 'difference', - 'divide', 'drop', 'dropRight', 'dropRightWhile', 'dropWhile', 'endsWith', 'eq', - 'every', 'filter', 'find', 'findIndex', 'findKey', 'findLast', 'findLastIndex', - 'findLastKey', 'flatMap', 'flatMapDeep', 'flattenDepth', 'forEach', - 'forEachRight', 'forIn', 'forInRight', 'forOwn', 'forOwnRight', 'get', - 'groupBy', 'gt', 'gte', 'has', 'hasIn', 'includes', 'indexOf', 'intersection', - 'invertBy', 'invoke', 'invokeMap', 'isEqual', 'isMatch', 'join', 'keyBy', - 'lastIndexOf', 'lt', 'lte', 'map', 'mapKeys', 'mapValues', 'matchesProperty', - 'maxBy', 'meanBy', 'merge', 'mergeAllWith', 'minBy', 'multiply', 'nth', 'omit', - 'omitBy', 'overArgs', 'pad', 'padEnd', 'padStart', 'parseInt', 'partial', - 'partialRight', 'partition', 'pick', 'pickBy', 'propertyOf', 'pull', 'pullAll', - 'pullAt', 'random', 'range', 'rangeRight', 'rearg', 'reject', 'remove', - 'repeat', 'restFrom', 'result', 'sampleSize', 'some', 'sortBy', 'sortedIndex', - 'sortedIndexOf', 'sortedLastIndex', 'sortedLastIndexOf', 'sortedUniqBy', - 'split', 'spreadFrom', 'startsWith', 'subtract', 'sumBy', 'take', 'takeRight', - 'takeRightWhile', 'takeWhile', 'tap', 'throttle', 'thru', 'times', 'trimChars', - 'trimCharsEnd', 'trimCharsStart', 'truncate', 'union', 'uniqBy', 'uniqWith', - 'unset', 'unzipWith', 'without', 'wrap', 'xor', 'zip', 'zipObject', - 'zipObjectDeep' - ], - '3': [ - 'assignInWith', 'assignWith', 'clamp', 'differenceBy', 'differenceWith', - 'findFrom', 'findIndexFrom', 'findLastFrom', 'findLastIndexFrom', 'getOr', - 'includesFrom', 'indexOfFrom', 'inRange', 'intersectionBy', 'intersectionWith', - 'invokeArgs', 'invokeArgsMap', 'isEqualWith', 'isMatchWith', 'flatMapDepth', - 'lastIndexOfFrom', 'mergeWith', 'orderBy', 'padChars', 'padCharsEnd', - 'padCharsStart', 'pullAllBy', 'pullAllWith', 'rangeStep', 'rangeStepRight', - 'reduce', 'reduceRight', 'replace', 'set', 'slice', 'sortedIndexBy', - 'sortedLastIndexBy', 'transform', 'unionBy', 'unionWith', 'update', 'xorBy', - 'xorWith', 'zipWith' - ], - '4': [ - 'fill', 'setWith', 'updateWith' - ] -}; - -/** Used to map ary to rearg configs. */ -exports.aryRearg = { - '2': [1, 0], - '3': [2, 0, 1], - '4': [3, 2, 0, 1] -}; - -/** Used to map method names to their iteratee ary. */ -exports.iterateeAry = { - 'dropRightWhile': 1, - 'dropWhile': 1, - 'every': 1, - 'filter': 1, - 'find': 1, - 'findFrom': 1, - 'findIndex': 1, - 'findIndexFrom': 1, - 'findKey': 1, - 'findLast': 1, - 'findLastFrom': 1, - 'findLastIndex': 1, - 'findLastIndexFrom': 1, - 'findLastKey': 1, - 'flatMap': 1, - 'flatMapDeep': 1, - 'flatMapDepth': 1, - 'forEach': 1, - 'forEachRight': 1, - 'forIn': 1, - 'forInRight': 1, - 'forOwn': 1, - 'forOwnRight': 1, - 'map': 1, - 'mapKeys': 1, - 'mapValues': 1, - 'partition': 1, - 'reduce': 2, - 'reduceRight': 2, - 'reject': 1, - 'remove': 1, - 'some': 1, - 'takeRightWhile': 1, - 'takeWhile': 1, - 'times': 1, - 'transform': 2 -}; - -/** Used to map method names to iteratee rearg configs. */ -exports.iterateeRearg = { - 'mapKeys': [1], - 'reduceRight': [1, 0] -}; - -/** Used to map method names to rearg configs. */ -exports.methodRearg = { - 'assignInAllWith': [1, 0], - 'assignInWith': [1, 2, 0], - 'assignAllWith': [1, 0], - 'assignWith': [1, 2, 0], - 'differenceBy': [1, 2, 0], - 'differenceWith': [1, 2, 0], - 'getOr': [2, 1, 0], - 'intersectionBy': [1, 2, 0], - 'intersectionWith': [1, 2, 0], - 'isEqualWith': [1, 2, 0], - 'isMatchWith': [2, 1, 0], - 'mergeAllWith': [1, 0], - 'mergeWith': [1, 2, 0], - 'padChars': [2, 1, 0], - 'padCharsEnd': [2, 1, 0], - 'padCharsStart': [2, 1, 0], - 'pullAllBy': [2, 1, 0], - 'pullAllWith': [2, 1, 0], - 'rangeStep': [1, 2, 0], - 'rangeStepRight': [1, 2, 0], - 'setWith': [3, 1, 2, 0], - 'sortedIndexBy': [2, 1, 0], - 'sortedLastIndexBy': [2, 1, 0], - 'unionBy': [1, 2, 0], - 'unionWith': [1, 2, 0], - 'updateWith': [3, 1, 2, 0], - 'xorBy': [1, 2, 0], - 'xorWith': [1, 2, 0], - 'zipWith': [1, 2, 0] -}; - -/** Used to map method names to spread configs. */ -exports.methodSpread = { - 'assignAll': { 'start': 0 }, - 'assignAllWith': { 'start': 0 }, - 'assignInAll': { 'start': 0 }, - 'assignInAllWith': { 'start': 0 }, - 'defaultsAll': { 'start': 0 }, - 'defaultsDeepAll': { 'start': 0 }, - 'invokeArgs': { 'start': 2 }, - 'invokeArgsMap': { 'start': 2 }, - 'mergeAll': { 'start': 0 }, - 'mergeAllWith': { 'start': 0 }, - 'partial': { 'start': 1 }, - 'partialRight': { 'start': 1 }, - 'without': { 'start': 1 }, - 'zipAll': { 'start': 0 } -}; - -/** Used to identify methods which mutate arrays or objects. */ -exports.mutate = { - 'array': { - 'fill': true, - 'pull': true, - 'pullAll': true, - 'pullAllBy': true, - 'pullAllWith': true, - 'pullAt': true, - 'remove': true, - 'reverse': true - }, - 'object': { - 'assign': true, - 'assignAll': true, - 'assignAllWith': true, - 'assignIn': true, - 'assignInAll': true, - 'assignInAllWith': true, - 'assignInWith': true, - 'assignWith': true, - 'defaults': true, - 'defaultsAll': true, - 'defaultsDeep': true, - 'defaultsDeepAll': true, - 'merge': true, - 'mergeAll': true, - 'mergeAllWith': true, - 'mergeWith': true, - }, - 'set': { - 'set': true, - 'setWith': true, - 'unset': true, - 'update': true, - 'updateWith': true - } -}; - -/** Used to map real names to their aliases. */ -exports.realToAlias = (function() { - var hasOwnProperty = Object.prototype.hasOwnProperty, - object = exports.aliasToReal, - result = {}; - - for (var key in object) { - var value = object[key]; - if (hasOwnProperty.call(result, value)) { - result[value].push(key); - } else { - result[value] = [key]; - } - } - return result; -}()); - -/** Used to map method names to other names. */ -exports.remap = { - 'assignAll': 'assign', - 'assignAllWith': 'assignWith', - 'assignInAll': 'assignIn', - 'assignInAllWith': 'assignInWith', - 'curryN': 'curry', - 'curryRightN': 'curryRight', - 'defaultsAll': 'defaults', - 'defaultsDeepAll': 'defaultsDeep', - 'findFrom': 'find', - 'findIndexFrom': 'findIndex', - 'findLastFrom': 'findLast', - 'findLastIndexFrom': 'findLastIndex', - 'getOr': 'get', - 'includesFrom': 'includes', - 'indexOfFrom': 'indexOf', - 'invokeArgs': 'invoke', - 'invokeArgsMap': 'invokeMap', - 'lastIndexOfFrom': 'lastIndexOf', - 'mergeAll': 'merge', - 'mergeAllWith': 'mergeWith', - 'padChars': 'pad', - 'padCharsEnd': 'padEnd', - 'padCharsStart': 'padStart', - 'propertyOf': 'get', - 'rangeStep': 'range', - 'rangeStepRight': 'rangeRight', - 'restFrom': 'rest', - 'spreadFrom': 'spread', - 'trimChars': 'trim', - 'trimCharsEnd': 'trimEnd', - 'trimCharsStart': 'trimStart', - 'zipAll': 'zip' -}; - -/** Used to track methods that skip fixing their arity. */ -exports.skipFixed = { - 'castArray': true, - 'flow': true, - 'flowRight': true, - 'iteratee': true, - 'mixin': true, - 'rearg': true, - 'runInContext': true -}; - -/** Used to track methods that skip rearranging arguments. */ -exports.skipRearg = { - 'add': true, - 'assign': true, - 'assignIn': true, - 'bind': true, - 'bindKey': true, - 'concat': true, - 'difference': true, - 'divide': true, - 'eq': true, - 'gt': true, - 'gte': true, - 'isEqual': true, - 'lt': true, - 'lte': true, - 'matchesProperty': true, - 'merge': true, - 'multiply': true, - 'overArgs': true, - 'partial': true, - 'partialRight': true, - 'propertyOf': true, - 'random': true, - 'range': true, - 'rangeRight': true, - 'subtract': true, - 'zip': true, - 'zipObject': true, - 'zipObjectDeep': true -}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/_util.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/_util.js deleted file mode 100644 index 1dbf36f5..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/_util.js +++ /dev/null @@ -1,16 +0,0 @@ -module.exports = { - 'ary': require('../ary'), - 'assign': require('../_baseAssign'), - 'clone': require('../clone'), - 'curry': require('../curry'), - 'forEach': require('../_arrayEach'), - 'isArray': require('../isArray'), - 'isError': require('../isError'), - 'isFunction': require('../isFunction'), - 'isWeakMap': require('../isWeakMap'), - 'iteratee': require('../iteratee'), - 'keys': require('../_baseKeys'), - 'rearg': require('../rearg'), - 'toInteger': require('../toInteger'), - 'toPath': require('../toPath') -}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/add.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/add.js deleted file mode 100644 index 816eeece..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/add.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('add', require('../add')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/after.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/after.js deleted file mode 100644 index 21a0167a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/after.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('after', require('../after')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/all.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/all.js deleted file mode 100644 index d0839f77..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/all.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./every'); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/allPass.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/allPass.js deleted file mode 100644 index 79b73ef8..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/allPass.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./overEvery'); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/always.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/always.js deleted file mode 100644 index 98877030..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/always.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./constant'); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/any.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/any.js deleted file mode 100644 index 900ac25e..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/any.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./some'); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/anyPass.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/anyPass.js deleted file mode 100644 index 2774ab37..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/anyPass.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./overSome'); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/apply.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/apply.js deleted file mode 100644 index 2b757129..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/apply.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./spread'); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/array.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/array.js deleted file mode 100644 index fe939c2c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/array.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert(require('../array')); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/ary.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/ary.js deleted file mode 100644 index 8edf1877..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/ary.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('ary', require('../ary')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/assign.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/assign.js deleted file mode 100644 index 23f47af1..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/assign.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('assign', require('../assign')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/assignAll.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/assignAll.js deleted file mode 100644 index b1d36c7e..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/assignAll.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('assignAll', require('../assign')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/assignAllWith.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/assignAllWith.js deleted file mode 100644 index 21e836e6..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/assignAllWith.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('assignAllWith', require('../assignWith')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/assignIn.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/assignIn.js deleted file mode 100644 index 6e7c65fa..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/assignIn.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('assignIn', require('../assignIn')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/assignInAll.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/assignInAll.js deleted file mode 100644 index 7ba75dba..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/assignInAll.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('assignInAll', require('../assignIn')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/assignInAllWith.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/assignInAllWith.js deleted file mode 100644 index e766903d..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/assignInAllWith.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('assignInAllWith', require('../assignInWith')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/assignInWith.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/assignInWith.js deleted file mode 100644 index acb59236..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/assignInWith.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('assignInWith', require('../assignInWith')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/assignWith.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/assignWith.js deleted file mode 100644 index eb925212..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/assignWith.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('assignWith', require('../assignWith')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/assoc.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/assoc.js deleted file mode 100644 index 7648820c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/assoc.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./set'); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/assocPath.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/assocPath.js deleted file mode 100644 index 7648820c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/assocPath.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./set'); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/at.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/at.js deleted file mode 100644 index cc39d257..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/at.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('at', require('../at')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/attempt.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/attempt.js deleted file mode 100644 index 26ca42ea..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/attempt.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('attempt', require('../attempt')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/before.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/before.js deleted file mode 100644 index 7a2de65d..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/before.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('before', require('../before')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/bind.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/bind.js deleted file mode 100644 index 5cbe4f30..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/bind.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('bind', require('../bind')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/bindAll.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/bindAll.js deleted file mode 100644 index 6b4a4a0f..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/bindAll.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('bindAll', require('../bindAll')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/bindKey.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/bindKey.js deleted file mode 100644 index 6a46c6b1..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/bindKey.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('bindKey', require('../bindKey')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/camelCase.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/camelCase.js deleted file mode 100644 index 87b77b49..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/camelCase.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('camelCase', require('../camelCase'), require('./_falseOptions')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/capitalize.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/capitalize.js deleted file mode 100644 index cac74e14..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/capitalize.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('capitalize', require('../capitalize'), require('./_falseOptions')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/castArray.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/castArray.js deleted file mode 100644 index 8681c099..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/castArray.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('castArray', require('../castArray')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/ceil.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/ceil.js deleted file mode 100644 index f416b729..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/ceil.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('ceil', require('../ceil')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/chain.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/chain.js deleted file mode 100644 index 604fe398..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/chain.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('chain', require('../chain'), require('./_falseOptions')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/chunk.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/chunk.js deleted file mode 100644 index 871ab085..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/chunk.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('chunk', require('../chunk')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/clamp.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/clamp.js deleted file mode 100644 index 3b06c01c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/clamp.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('clamp', require('../clamp')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/clone.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/clone.js deleted file mode 100644 index cadb59c9..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/clone.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('clone', require('../clone'), require('./_falseOptions')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/cloneDeep.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/cloneDeep.js deleted file mode 100644 index a6107aac..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/cloneDeep.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('cloneDeep', require('../cloneDeep'), require('./_falseOptions')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/cloneDeepWith.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/cloneDeepWith.js deleted file mode 100644 index 6f01e44a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/cloneDeepWith.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('cloneDeepWith', require('../cloneDeepWith')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/cloneWith.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/cloneWith.js deleted file mode 100644 index aa885781..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/cloneWith.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('cloneWith', require('../cloneWith')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/collection.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/collection.js deleted file mode 100644 index fc8b328a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/collection.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert(require('../collection')); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/commit.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/commit.js deleted file mode 100644 index 130a894f..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/commit.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('commit', require('../commit'), require('./_falseOptions')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/compact.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/compact.js deleted file mode 100644 index ce8f7a1a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/compact.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('compact', require('../compact'), require('./_falseOptions')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/complement.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/complement.js deleted file mode 100644 index 93eb462b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/complement.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./negate'); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/compose.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/compose.js deleted file mode 100644 index 1954e942..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/compose.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./flowRight'); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/concat.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/concat.js deleted file mode 100644 index e59346ad..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/concat.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('concat', require('../concat')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/cond.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/cond.js deleted file mode 100644 index 6a0120ef..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/cond.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('cond', require('../cond'), require('./_falseOptions')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/conforms.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/conforms.js deleted file mode 100644 index 3247f64a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/conforms.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./conformsTo'); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/conformsTo.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/conformsTo.js deleted file mode 100644 index aa7f41ec..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/conformsTo.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('conformsTo', require('../conformsTo')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/constant.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/constant.js deleted file mode 100644 index 9e406fc0..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/constant.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('constant', require('../constant'), require('./_falseOptions')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/contains.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/contains.js deleted file mode 100644 index 594722af..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/contains.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./includes'); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/convert.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/convert.js deleted file mode 100644 index 4795dc42..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/convert.js +++ /dev/null @@ -1,18 +0,0 @@ -var baseConvert = require('./_baseConvert'), - util = require('./_util'); - -/** - * Converts `func` of `name` to an immutable auto-curried iteratee-first data-last - * version with conversion `options` applied. If `name` is an object its methods - * will be converted. - * - * @param {string} name The name of the function to wrap. - * @param {Function} [func] The function to wrap. - * @param {Object} [options] The options object. See `baseConvert` for more details. - * @returns {Function|Object} Returns the converted function or object. - */ -function convert(name, func, options) { - return baseConvert(util, name, func, options); -} - -module.exports = convert; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/countBy.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/countBy.js deleted file mode 100644 index dfa46432..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/countBy.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('countBy', require('../countBy')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/create.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/create.js deleted file mode 100644 index 752025fb..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/create.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('create', require('../create')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/curry.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/curry.js deleted file mode 100644 index b0b4168c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/curry.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('curry', require('../curry')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/curryN.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/curryN.js deleted file mode 100644 index 2ae7d00a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/curryN.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('curryN', require('../curry')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/curryRight.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/curryRight.js deleted file mode 100644 index cb619eb5..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/curryRight.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('curryRight', require('../curryRight')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/curryRightN.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/curryRightN.js deleted file mode 100644 index 2495afc8..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/curryRightN.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('curryRightN', require('../curryRight')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/date.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/date.js deleted file mode 100644 index 82cb952b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/date.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert(require('../date')); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/debounce.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/debounce.js deleted file mode 100644 index 26122293..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/debounce.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('debounce', require('../debounce')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/deburr.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/deburr.js deleted file mode 100644 index 96463ab8..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/deburr.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('deburr', require('../deburr'), require('./_falseOptions')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/defaultTo.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/defaultTo.js deleted file mode 100644 index d6b52a44..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/defaultTo.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('defaultTo', require('../defaultTo')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/defaults.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/defaults.js deleted file mode 100644 index e1a8e6e7..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/defaults.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('defaults', require('../defaults')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/defaultsAll.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/defaultsAll.js deleted file mode 100644 index 238fcc3c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/defaultsAll.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('defaultsAll', require('../defaults')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/defaultsDeep.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/defaultsDeep.js deleted file mode 100644 index 1f172ff9..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/defaultsDeep.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('defaultsDeep', require('../defaultsDeep')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/defaultsDeepAll.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/defaultsDeepAll.js deleted file mode 100644 index 6835f2f0..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/defaultsDeepAll.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('defaultsDeepAll', require('../defaultsDeep')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/defer.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/defer.js deleted file mode 100644 index ec7990fe..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/defer.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('defer', require('../defer'), require('./_falseOptions')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/delay.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/delay.js deleted file mode 100644 index 556dbd56..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/delay.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('delay', require('../delay')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/difference.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/difference.js deleted file mode 100644 index 2d037654..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/difference.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('difference', require('../difference')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/differenceBy.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/differenceBy.js deleted file mode 100644 index 2f914910..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/differenceBy.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('differenceBy', require('../differenceBy')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/differenceWith.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/differenceWith.js deleted file mode 100644 index bcf5ad2e..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/differenceWith.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('differenceWith', require('../differenceWith')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/dissoc.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/dissoc.js deleted file mode 100644 index 7ec7be19..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/dissoc.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./unset'); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/dissocPath.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/dissocPath.js deleted file mode 100644 index 7ec7be19..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/dissocPath.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./unset'); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/divide.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/divide.js deleted file mode 100644 index 82048c5e..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/divide.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('divide', require('../divide')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/drop.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/drop.js deleted file mode 100644 index 2fa9b4fa..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/drop.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('drop', require('../drop')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/dropLast.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/dropLast.js deleted file mode 100644 index 174e5255..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/dropLast.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./dropRight'); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/dropLastWhile.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/dropLastWhile.js deleted file mode 100644 index be2a9d24..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/dropLastWhile.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./dropRightWhile'); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/dropRight.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/dropRight.js deleted file mode 100644 index e98881fc..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/dropRight.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('dropRight', require('../dropRight')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/dropRightWhile.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/dropRightWhile.js deleted file mode 100644 index cacaa701..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/dropRightWhile.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('dropRightWhile', require('../dropRightWhile')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/dropWhile.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/dropWhile.js deleted file mode 100644 index 285f864d..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/dropWhile.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('dropWhile', require('../dropWhile')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/each.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/each.js deleted file mode 100644 index 8800f420..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/each.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./forEach'); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/eachRight.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/eachRight.js deleted file mode 100644 index 3252b2ab..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/eachRight.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./forEachRight'); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/endsWith.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/endsWith.js deleted file mode 100644 index 17dc2a49..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/endsWith.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('endsWith', require('../endsWith')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/entries.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/entries.js deleted file mode 100644 index 7a88df20..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/entries.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./toPairs'); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/entriesIn.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/entriesIn.js deleted file mode 100644 index f6c6331c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/entriesIn.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./toPairsIn'); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/eq.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/eq.js deleted file mode 100644 index 9a3d21bf..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/eq.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('eq', require('../eq')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/equals.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/equals.js deleted file mode 100644 index e6a5ce0c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/equals.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./isEqual'); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/escape.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/escape.js deleted file mode 100644 index 52c1fbba..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/escape.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('escape', require('../escape'), require('./_falseOptions')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/escapeRegExp.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/escapeRegExp.js deleted file mode 100644 index 369b2eff..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/escapeRegExp.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('escapeRegExp', require('../escapeRegExp'), require('./_falseOptions')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/every.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/every.js deleted file mode 100644 index 95c2776c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/every.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('every', require('../every')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/extend.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/extend.js deleted file mode 100644 index e00166c2..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/extend.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./assignIn'); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/extendAll.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/extendAll.js deleted file mode 100644 index cc55b64f..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/extendAll.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./assignInAll'); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/extendAllWith.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/extendAllWith.js deleted file mode 100644 index 6679d208..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/extendAllWith.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./assignInAllWith'); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/extendWith.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/extendWith.js deleted file mode 100644 index dbdcb3b4..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/extendWith.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./assignInWith'); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/fill.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/fill.js deleted file mode 100644 index b2d47e84..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/fill.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('fill', require('../fill')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/filter.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/filter.js deleted file mode 100644 index 796d501c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/filter.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('filter', require('../filter')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/find.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/find.js deleted file mode 100644 index f805d336..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/find.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('find', require('../find')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/findFrom.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/findFrom.js deleted file mode 100644 index da8275e8..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/findFrom.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('findFrom', require('../find')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/findIndex.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/findIndex.js deleted file mode 100644 index 8c15fd11..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/findIndex.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('findIndex', require('../findIndex')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/findIndexFrom.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/findIndexFrom.js deleted file mode 100644 index 32e98cb9..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/findIndexFrom.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('findIndexFrom', require('../findIndex')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/findKey.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/findKey.js deleted file mode 100644 index 475bcfa8..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/findKey.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('findKey', require('../findKey')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/findLast.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/findLast.js deleted file mode 100644 index 093fe94e..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/findLast.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('findLast', require('../findLast')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/findLastFrom.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/findLastFrom.js deleted file mode 100644 index 76c38fba..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/findLastFrom.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('findLastFrom', require('../findLast')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/findLastIndex.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/findLastIndex.js deleted file mode 100644 index 36986df0..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/findLastIndex.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('findLastIndex', require('../findLastIndex')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/findLastIndexFrom.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/findLastIndexFrom.js deleted file mode 100644 index 34c8176c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/findLastIndexFrom.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('findLastIndexFrom', require('../findLastIndex')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/findLastKey.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/findLastKey.js deleted file mode 100644 index 5f81b604..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/findLastKey.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('findLastKey', require('../findLastKey')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/first.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/first.js deleted file mode 100644 index 53f4ad13..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/first.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./head'); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/flatMap.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/flatMap.js deleted file mode 100644 index d01dc4d0..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/flatMap.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('flatMap', require('../flatMap')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/flatMapDeep.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/flatMapDeep.js deleted file mode 100644 index 569c42eb..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/flatMapDeep.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('flatMapDeep', require('../flatMapDeep')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/flatMapDepth.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/flatMapDepth.js deleted file mode 100644 index 6eb68fde..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/flatMapDepth.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('flatMapDepth', require('../flatMapDepth')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/flatten.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/flatten.js deleted file mode 100644 index 30425d89..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/flatten.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('flatten', require('../flatten'), require('./_falseOptions')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/flattenDeep.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/flattenDeep.js deleted file mode 100644 index aed5db27..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/flattenDeep.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('flattenDeep', require('../flattenDeep'), require('./_falseOptions')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/flattenDepth.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/flattenDepth.js deleted file mode 100644 index ad65e378..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/flattenDepth.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('flattenDepth', require('../flattenDepth')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/flip.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/flip.js deleted file mode 100644 index 0547e7b4..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/flip.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('flip', require('../flip'), require('./_falseOptions')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/floor.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/floor.js deleted file mode 100644 index a6cf3358..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/floor.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('floor', require('../floor')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/flow.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/flow.js deleted file mode 100644 index cd83677a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/flow.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('flow', require('../flow')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/flowRight.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/flowRight.js deleted file mode 100644 index 972a5b9b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/flowRight.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('flowRight', require('../flowRight')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/forEach.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/forEach.js deleted file mode 100644 index 2f494521..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/forEach.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('forEach', require('../forEach')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/forEachRight.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/forEachRight.js deleted file mode 100644 index 3ff97336..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/forEachRight.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('forEachRight', require('../forEachRight')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/forIn.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/forIn.js deleted file mode 100644 index 9341749b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/forIn.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('forIn', require('../forIn')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/forInRight.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/forInRight.js deleted file mode 100644 index cecf8bbf..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/forInRight.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('forInRight', require('../forInRight')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/forOwn.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/forOwn.js deleted file mode 100644 index 246449e9..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/forOwn.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('forOwn', require('../forOwn')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/forOwnRight.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/forOwnRight.js deleted file mode 100644 index c5e826e0..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/forOwnRight.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('forOwnRight', require('../forOwnRight')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/fromPairs.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/fromPairs.js deleted file mode 100644 index f8cc5968..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/fromPairs.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('fromPairs', require('../fromPairs')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/function.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/function.js deleted file mode 100644 index dfe69b1f..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/function.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert(require('../function')); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/functions.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/functions.js deleted file mode 100644 index 09d1bb1b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/functions.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('functions', require('../functions'), require('./_falseOptions')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/functionsIn.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/functionsIn.js deleted file mode 100644 index 2cfeb83e..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/functionsIn.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('functionsIn', require('../functionsIn'), require('./_falseOptions')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/get.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/get.js deleted file mode 100644 index 6d3a3286..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/get.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('get', require('../get')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/getOr.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/getOr.js deleted file mode 100644 index 7dbf771f..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/getOr.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('getOr', require('../get')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/groupBy.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/groupBy.js deleted file mode 100644 index fc0bc78a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/groupBy.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('groupBy', require('../groupBy')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/gt.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/gt.js deleted file mode 100644 index 9e57c808..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/gt.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('gt', require('../gt')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/gte.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/gte.js deleted file mode 100644 index 45847863..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/gte.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('gte', require('../gte')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/has.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/has.js deleted file mode 100644 index b9012983..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/has.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('has', require('../has')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/hasIn.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/hasIn.js deleted file mode 100644 index b3c3d1a3..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/hasIn.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('hasIn', require('../hasIn')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/head.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/head.js deleted file mode 100644 index 2694f0a2..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/head.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('head', require('../head'), require('./_falseOptions')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/identical.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/identical.js deleted file mode 100644 index 85563f4a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/identical.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./eq'); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/identity.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/identity.js deleted file mode 100644 index 096415a5..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/identity.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('identity', require('../identity'), require('./_falseOptions')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/inRange.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/inRange.js deleted file mode 100644 index 202d940b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/inRange.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('inRange', require('../inRange')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/includes.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/includes.js deleted file mode 100644 index 11467805..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/includes.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('includes', require('../includes')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/includesFrom.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/includesFrom.js deleted file mode 100644 index 683afdb4..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/includesFrom.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('includesFrom', require('../includes')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/indexBy.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/indexBy.js deleted file mode 100644 index 7e64bc0f..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/indexBy.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./keyBy'); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/indexOf.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/indexOf.js deleted file mode 100644 index 524658eb..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/indexOf.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('indexOf', require('../indexOf')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/indexOfFrom.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/indexOfFrom.js deleted file mode 100644 index d99c822f..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/indexOfFrom.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('indexOfFrom', require('../indexOf')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/init.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/init.js deleted file mode 100644 index 2f88d8b0..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/init.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./initial'); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/initial.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/initial.js deleted file mode 100644 index b732ba0b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/initial.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('initial', require('../initial'), require('./_falseOptions')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/intersection.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/intersection.js deleted file mode 100644 index 52936d56..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/intersection.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('intersection', require('../intersection')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/intersectionBy.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/intersectionBy.js deleted file mode 100644 index 72629f27..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/intersectionBy.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('intersectionBy', require('../intersectionBy')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/intersectionWith.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/intersectionWith.js deleted file mode 100644 index e064f400..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/intersectionWith.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('intersectionWith', require('../intersectionWith')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/invert.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/invert.js deleted file mode 100644 index 2d5d1f0d..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/invert.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('invert', require('../invert')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/invertBy.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/invertBy.js deleted file mode 100644 index 63ca97ec..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/invertBy.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('invertBy', require('../invertBy')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/invertObj.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/invertObj.js deleted file mode 100644 index f1d842e4..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/invertObj.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./invert'); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/invoke.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/invoke.js deleted file mode 100644 index fcf17f0d..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/invoke.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('invoke', require('../invoke')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/invokeArgs.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/invokeArgs.js deleted file mode 100644 index d3f2953f..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/invokeArgs.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('invokeArgs', require('../invoke')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/invokeArgsMap.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/invokeArgsMap.js deleted file mode 100644 index eaa9f84f..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/invokeArgsMap.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('invokeArgsMap', require('../invokeMap')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/invokeMap.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/invokeMap.js deleted file mode 100644 index 6515fd73..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/invokeMap.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('invokeMap', require('../invokeMap')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isArguments.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isArguments.js deleted file mode 100644 index 1d93c9e5..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isArguments.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('isArguments', require('../isArguments'), require('./_falseOptions')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isArray.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isArray.js deleted file mode 100644 index ba7ade8d..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isArray.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('isArray', require('../isArray'), require('./_falseOptions')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isArrayBuffer.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isArrayBuffer.js deleted file mode 100644 index 5088513f..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isArrayBuffer.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('isArrayBuffer', require('../isArrayBuffer'), require('./_falseOptions')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isArrayLike.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isArrayLike.js deleted file mode 100644 index 8f1856bf..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isArrayLike.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('isArrayLike', require('../isArrayLike'), require('./_falseOptions')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isArrayLikeObject.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isArrayLikeObject.js deleted file mode 100644 index 21084984..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isArrayLikeObject.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('isArrayLikeObject', require('../isArrayLikeObject'), require('./_falseOptions')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isBoolean.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isBoolean.js deleted file mode 100644 index 9339f75b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isBoolean.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('isBoolean', require('../isBoolean'), require('./_falseOptions')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isBuffer.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isBuffer.js deleted file mode 100644 index e60b1238..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isBuffer.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('isBuffer', require('../isBuffer'), require('./_falseOptions')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isDate.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isDate.js deleted file mode 100644 index dc41d089..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isDate.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('isDate', require('../isDate'), require('./_falseOptions')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isElement.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isElement.js deleted file mode 100644 index 18ee039a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isElement.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('isElement', require('../isElement'), require('./_falseOptions')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isEmpty.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isEmpty.js deleted file mode 100644 index 0f4ae841..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isEmpty.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('isEmpty', require('../isEmpty'), require('./_falseOptions')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isEqual.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isEqual.js deleted file mode 100644 index 41383865..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isEqual.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('isEqual', require('../isEqual')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isEqualWith.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isEqualWith.js deleted file mode 100644 index 029ff5cd..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isEqualWith.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('isEqualWith', require('../isEqualWith')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isError.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isError.js deleted file mode 100644 index 3dfd81cc..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isError.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('isError', require('../isError'), require('./_falseOptions')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isFinite.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isFinite.js deleted file mode 100644 index 0b647b84..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isFinite.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('isFinite', require('../isFinite'), require('./_falseOptions')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isFunction.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isFunction.js deleted file mode 100644 index ff8e5c45..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isFunction.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('isFunction', require('../isFunction'), require('./_falseOptions')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isInteger.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isInteger.js deleted file mode 100644 index 67af4ff6..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isInteger.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('isInteger', require('../isInteger'), require('./_falseOptions')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isLength.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isLength.js deleted file mode 100644 index fc101c5a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isLength.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('isLength', require('../isLength'), require('./_falseOptions')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isMap.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isMap.js deleted file mode 100644 index a209aa66..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isMap.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('isMap', require('../isMap'), require('./_falseOptions')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isMatch.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isMatch.js deleted file mode 100644 index 6264ca17..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isMatch.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('isMatch', require('../isMatch')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isMatchWith.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isMatchWith.js deleted file mode 100644 index d95f3193..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isMatchWith.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('isMatchWith', require('../isMatchWith')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isNaN.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isNaN.js deleted file mode 100644 index 66a978f1..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isNaN.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('isNaN', require('../isNaN'), require('./_falseOptions')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isNative.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isNative.js deleted file mode 100644 index 3d775ba9..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isNative.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('isNative', require('../isNative'), require('./_falseOptions')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isNil.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isNil.js deleted file mode 100644 index 5952c028..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isNil.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('isNil', require('../isNil'), require('./_falseOptions')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isNull.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isNull.js deleted file mode 100644 index f201a354..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isNull.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('isNull', require('../isNull'), require('./_falseOptions')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isNumber.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isNumber.js deleted file mode 100644 index a2b5fa04..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isNumber.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('isNumber', require('../isNumber'), require('./_falseOptions')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isObject.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isObject.js deleted file mode 100644 index 231ace03..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isObject.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('isObject', require('../isObject'), require('./_falseOptions')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isObjectLike.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isObjectLike.js deleted file mode 100644 index f16082e6..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isObjectLike.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('isObjectLike', require('../isObjectLike'), require('./_falseOptions')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isPlainObject.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isPlainObject.js deleted file mode 100644 index b5bea90d..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isPlainObject.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('isPlainObject', require('../isPlainObject'), require('./_falseOptions')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isRegExp.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isRegExp.js deleted file mode 100644 index 12a1a3d7..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isRegExp.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('isRegExp', require('../isRegExp'), require('./_falseOptions')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isSafeInteger.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isSafeInteger.js deleted file mode 100644 index 7230f552..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isSafeInteger.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('isSafeInteger', require('../isSafeInteger'), require('./_falseOptions')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isSet.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isSet.js deleted file mode 100644 index 35c01f6f..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isSet.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('isSet', require('../isSet'), require('./_falseOptions')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isString.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isString.js deleted file mode 100644 index 1fd0679e..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isString.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('isString', require('../isString'), require('./_falseOptions')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isSymbol.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isSymbol.js deleted file mode 100644 index 38676956..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isSymbol.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('isSymbol', require('../isSymbol'), require('./_falseOptions')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isTypedArray.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isTypedArray.js deleted file mode 100644 index 85679538..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isTypedArray.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('isTypedArray', require('../isTypedArray'), require('./_falseOptions')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isUndefined.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isUndefined.js deleted file mode 100644 index ddbca31c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isUndefined.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('isUndefined', require('../isUndefined'), require('./_falseOptions')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isWeakMap.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isWeakMap.js deleted file mode 100644 index ef60c613..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isWeakMap.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('isWeakMap', require('../isWeakMap'), require('./_falseOptions')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isWeakSet.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isWeakSet.js deleted file mode 100644 index c99bfaa6..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/isWeakSet.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('isWeakSet', require('../isWeakSet'), require('./_falseOptions')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/iteratee.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/iteratee.js deleted file mode 100644 index 9f0f7173..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/iteratee.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('iteratee', require('../iteratee')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/join.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/join.js deleted file mode 100644 index a220e003..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/join.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('join', require('../join')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/juxt.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/juxt.js deleted file mode 100644 index f71e04e0..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/juxt.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./over'); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/kebabCase.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/kebabCase.js deleted file mode 100644 index 60737f17..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/kebabCase.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('kebabCase', require('../kebabCase'), require('./_falseOptions')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/keyBy.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/keyBy.js deleted file mode 100644 index 9a6a85d4..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/keyBy.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('keyBy', require('../keyBy')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/keys.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/keys.js deleted file mode 100644 index e12bb07f..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/keys.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('keys', require('../keys'), require('./_falseOptions')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/keysIn.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/keysIn.js deleted file mode 100644 index f3eb36a8..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/keysIn.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('keysIn', require('../keysIn'), require('./_falseOptions')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/lang.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/lang.js deleted file mode 100644 index 08cc9c14..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/lang.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert(require('../lang')); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/last.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/last.js deleted file mode 100644 index 0f716993..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/last.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('last', require('../last'), require('./_falseOptions')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/lastIndexOf.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/lastIndexOf.js deleted file mode 100644 index ddf39c30..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/lastIndexOf.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('lastIndexOf', require('../lastIndexOf')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/lastIndexOfFrom.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/lastIndexOfFrom.js deleted file mode 100644 index 1ff6a0b5..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/lastIndexOfFrom.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('lastIndexOfFrom', require('../lastIndexOf')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/lowerCase.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/lowerCase.js deleted file mode 100644 index ea64bc15..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/lowerCase.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('lowerCase', require('../lowerCase'), require('./_falseOptions')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/lowerFirst.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/lowerFirst.js deleted file mode 100644 index 539720a3..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/lowerFirst.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('lowerFirst', require('../lowerFirst'), require('./_falseOptions')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/lt.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/lt.js deleted file mode 100644 index a31d21ec..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/lt.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('lt', require('../lt')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/lte.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/lte.js deleted file mode 100644 index d795d10e..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/lte.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('lte', require('../lte')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/map.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/map.js deleted file mode 100644 index cf987943..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/map.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('map', require('../map')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/mapKeys.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/mapKeys.js deleted file mode 100644 index 16845870..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/mapKeys.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('mapKeys', require('../mapKeys')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/mapValues.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/mapValues.js deleted file mode 100644 index 40049727..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/mapValues.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('mapValues', require('../mapValues')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/matches.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/matches.js deleted file mode 100644 index 29d1e1e4..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/matches.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./isMatch'); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/matchesProperty.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/matchesProperty.js deleted file mode 100644 index 4575bd24..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/matchesProperty.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('matchesProperty', require('../matchesProperty')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/math.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/math.js deleted file mode 100644 index e8f50f79..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/math.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert(require('../math')); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/max.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/max.js deleted file mode 100644 index a66acac2..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/max.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('max', require('../max'), require('./_falseOptions')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/maxBy.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/maxBy.js deleted file mode 100644 index d083fd64..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/maxBy.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('maxBy', require('../maxBy')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/mean.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/mean.js deleted file mode 100644 index 31172460..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/mean.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('mean', require('../mean'), require('./_falseOptions')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/meanBy.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/meanBy.js deleted file mode 100644 index 556f25ed..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/meanBy.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('meanBy', require('../meanBy')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/memoize.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/memoize.js deleted file mode 100644 index 638eec63..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/memoize.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('memoize', require('../memoize')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/merge.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/merge.js deleted file mode 100644 index ac66adde..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/merge.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('merge', require('../merge')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/mergeAll.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/mergeAll.js deleted file mode 100644 index a3674d67..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/mergeAll.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('mergeAll', require('../merge')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/mergeAllWith.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/mergeAllWith.js deleted file mode 100644 index 4bd4206d..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/mergeAllWith.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('mergeAllWith', require('../mergeWith')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/mergeWith.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/mergeWith.js deleted file mode 100644 index 00d44d5e..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/mergeWith.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('mergeWith', require('../mergeWith')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/method.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/method.js deleted file mode 100644 index f4060c68..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/method.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('method', require('../method')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/methodOf.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/methodOf.js deleted file mode 100644 index 61399056..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/methodOf.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('methodOf', require('../methodOf')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/min.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/min.js deleted file mode 100644 index d12c6b40..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/min.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('min', require('../min'), require('./_falseOptions')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/minBy.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/minBy.js deleted file mode 100644 index fdb9e24d..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/minBy.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('minBy', require('../minBy')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/mixin.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/mixin.js deleted file mode 100644 index 332e6fbf..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/mixin.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('mixin', require('../mixin')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/multiply.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/multiply.js deleted file mode 100644 index 4dcf0b0d..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/multiply.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('multiply', require('../multiply')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/nAry.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/nAry.js deleted file mode 100644 index f262a76c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/nAry.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./ary'); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/negate.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/negate.js deleted file mode 100644 index 8b6dc7c5..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/negate.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('negate', require('../negate'), require('./_falseOptions')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/next.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/next.js deleted file mode 100644 index 140155e2..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/next.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('next', require('../next'), require('./_falseOptions')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/noop.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/noop.js deleted file mode 100644 index b9e32cc8..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/noop.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('noop', require('../noop'), require('./_falseOptions')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/now.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/now.js deleted file mode 100644 index 6de2068a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/now.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('now', require('../now'), require('./_falseOptions')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/nth.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/nth.js deleted file mode 100644 index da4fda74..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/nth.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('nth', require('../nth')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/nthArg.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/nthArg.js deleted file mode 100644 index fce31659..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/nthArg.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('nthArg', require('../nthArg')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/number.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/number.js deleted file mode 100644 index 5c10b884..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/number.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert(require('../number')); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/object.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/object.js deleted file mode 100644 index ae39a134..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/object.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert(require('../object')); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/omit.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/omit.js deleted file mode 100644 index fd685291..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/omit.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('omit', require('../omit')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/omitAll.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/omitAll.js deleted file mode 100644 index 144cf4b9..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/omitAll.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./omit'); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/omitBy.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/omitBy.js deleted file mode 100644 index 90df7380..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/omitBy.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('omitBy', require('../omitBy')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/once.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/once.js deleted file mode 100644 index f8f0a5c7..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/once.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('once', require('../once'), require('./_falseOptions')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/orderBy.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/orderBy.js deleted file mode 100644 index 848e2107..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/orderBy.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('orderBy', require('../orderBy')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/over.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/over.js deleted file mode 100644 index 01eba7b9..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/over.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('over', require('../over')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/overArgs.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/overArgs.js deleted file mode 100644 index 738556f0..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/overArgs.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('overArgs', require('../overArgs')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/overEvery.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/overEvery.js deleted file mode 100644 index 9f5a032d..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/overEvery.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('overEvery', require('../overEvery')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/overSome.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/overSome.js deleted file mode 100644 index 15939d58..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/overSome.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('overSome', require('../overSome')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/pad.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/pad.js deleted file mode 100644 index f1dea4a9..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/pad.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('pad', require('../pad')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/padChars.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/padChars.js deleted file mode 100644 index d6e0804c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/padChars.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('padChars', require('../pad')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/padCharsEnd.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/padCharsEnd.js deleted file mode 100644 index d4ab79ad..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/padCharsEnd.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('padCharsEnd', require('../padEnd')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/padCharsStart.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/padCharsStart.js deleted file mode 100644 index a08a3000..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/padCharsStart.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('padCharsStart', require('../padStart')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/padEnd.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/padEnd.js deleted file mode 100644 index a8522ec3..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/padEnd.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('padEnd', require('../padEnd')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/padStart.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/padStart.js deleted file mode 100644 index f4ca79d4..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/padStart.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('padStart', require('../padStart')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/parseInt.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/parseInt.js deleted file mode 100644 index 27314ccb..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/parseInt.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('parseInt', require('../parseInt')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/partial.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/partial.js deleted file mode 100644 index 5d460159..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/partial.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('partial', require('../partial')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/partialRight.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/partialRight.js deleted file mode 100644 index 7f05fed0..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/partialRight.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('partialRight', require('../partialRight')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/partition.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/partition.js deleted file mode 100644 index 2ebcacc1..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/partition.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('partition', require('../partition')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/path.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/path.js deleted file mode 100644 index b29cfb21..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/path.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./get'); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/pathEq.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/pathEq.js deleted file mode 100644 index 36c027a3..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/pathEq.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./matchesProperty'); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/pathOr.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/pathOr.js deleted file mode 100644 index 4ab58209..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/pathOr.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./getOr'); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/paths.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/paths.js deleted file mode 100644 index 1eb7950a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/paths.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./at'); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/pick.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/pick.js deleted file mode 100644 index 197393de..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/pick.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('pick', require('../pick')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/pickAll.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/pickAll.js deleted file mode 100644 index a8ecd461..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/pickAll.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./pick'); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/pickBy.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/pickBy.js deleted file mode 100644 index d832d16b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/pickBy.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('pickBy', require('../pickBy')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/pipe.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/pipe.js deleted file mode 100644 index b2e1e2cc..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/pipe.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./flow'); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/placeholder.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/placeholder.js deleted file mode 100644 index 1ce17393..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/placeholder.js +++ /dev/null @@ -1,6 +0,0 @@ -/** - * The default argument placeholder value for methods. - * - * @type {Object} - */ -module.exports = {}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/plant.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/plant.js deleted file mode 100644 index eca8f32b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/plant.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('plant', require('../plant'), require('./_falseOptions')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/pluck.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/pluck.js deleted file mode 100644 index 0d1e1abf..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/pluck.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./map'); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/prop.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/prop.js deleted file mode 100644 index b29cfb21..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/prop.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./get'); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/propEq.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/propEq.js deleted file mode 100644 index 36c027a3..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/propEq.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./matchesProperty'); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/propOr.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/propOr.js deleted file mode 100644 index 4ab58209..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/propOr.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./getOr'); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/property.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/property.js deleted file mode 100644 index b29cfb21..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/property.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./get'); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/propertyOf.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/propertyOf.js deleted file mode 100644 index f6273ee4..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/propertyOf.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('propertyOf', require('../get')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/props.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/props.js deleted file mode 100644 index 1eb7950a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/props.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./at'); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/pull.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/pull.js deleted file mode 100644 index 8d7084f0..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/pull.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('pull', require('../pull')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/pullAll.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/pullAll.js deleted file mode 100644 index 98d5c9a7..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/pullAll.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('pullAll', require('../pullAll')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/pullAllBy.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/pullAllBy.js deleted file mode 100644 index 876bc3bf..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/pullAllBy.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('pullAllBy', require('../pullAllBy')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/pullAllWith.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/pullAllWith.js deleted file mode 100644 index f71ba4d7..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/pullAllWith.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('pullAllWith', require('../pullAllWith')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/pullAt.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/pullAt.js deleted file mode 100644 index e8b3bb61..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/pullAt.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('pullAt', require('../pullAt')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/random.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/random.js deleted file mode 100644 index 99d852e4..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/random.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('random', require('../random')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/range.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/range.js deleted file mode 100644 index a6bb5911..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/range.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('range', require('../range')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/rangeRight.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/rangeRight.js deleted file mode 100644 index fdb712f9..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/rangeRight.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('rangeRight', require('../rangeRight')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/rangeStep.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/rangeStep.js deleted file mode 100644 index d72dfc20..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/rangeStep.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('rangeStep', require('../range')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/rangeStepRight.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/rangeStepRight.js deleted file mode 100644 index 8b2a67bc..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/rangeStepRight.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('rangeStepRight', require('../rangeRight')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/rearg.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/rearg.js deleted file mode 100644 index 678e02a3..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/rearg.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('rearg', require('../rearg')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/reduce.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/reduce.js deleted file mode 100644 index 4cef0a00..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/reduce.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('reduce', require('../reduce')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/reduceRight.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/reduceRight.js deleted file mode 100644 index caf5bb51..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/reduceRight.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('reduceRight', require('../reduceRight')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/reject.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/reject.js deleted file mode 100644 index c1632738..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/reject.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('reject', require('../reject')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/remove.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/remove.js deleted file mode 100644 index e9d13273..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/remove.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('remove', require('../remove')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/repeat.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/repeat.js deleted file mode 100644 index 08470f24..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/repeat.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('repeat', require('../repeat')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/replace.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/replace.js deleted file mode 100644 index 2227db62..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/replace.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('replace', require('../replace')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/rest.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/rest.js deleted file mode 100644 index c1f3d64b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/rest.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('rest', require('../rest')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/restFrom.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/restFrom.js deleted file mode 100644 index 714e42b5..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/restFrom.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('restFrom', require('../rest')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/result.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/result.js deleted file mode 100644 index f86ce071..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/result.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('result', require('../result')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/reverse.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/reverse.js deleted file mode 100644 index 07c9f5e4..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/reverse.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('reverse', require('../reverse')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/round.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/round.js deleted file mode 100644 index 4c0e5c82..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/round.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('round', require('../round')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/sample.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/sample.js deleted file mode 100644 index 6bea1254..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/sample.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('sample', require('../sample'), require('./_falseOptions')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/sampleSize.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/sampleSize.js deleted file mode 100644 index 359ed6fc..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/sampleSize.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('sampleSize', require('../sampleSize')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/seq.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/seq.js deleted file mode 100644 index d8f42b0a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/seq.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert(require('../seq')); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/set.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/set.js deleted file mode 100644 index 0b56a56c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/set.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('set', require('../set')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/setWith.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/setWith.js deleted file mode 100644 index 0b584952..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/setWith.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('setWith', require('../setWith')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/shuffle.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/shuffle.js deleted file mode 100644 index aa3a1ca5..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/shuffle.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('shuffle', require('../shuffle'), require('./_falseOptions')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/size.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/size.js deleted file mode 100644 index 7490136e..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/size.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('size', require('../size'), require('./_falseOptions')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/slice.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/slice.js deleted file mode 100644 index 15945d32..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/slice.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('slice', require('../slice')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/snakeCase.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/snakeCase.js deleted file mode 100644 index a0ff7808..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/snakeCase.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('snakeCase', require('../snakeCase'), require('./_falseOptions')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/some.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/some.js deleted file mode 100644 index a4fa2d00..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/some.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('some', require('../some')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/sortBy.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/sortBy.js deleted file mode 100644 index e0790ad5..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/sortBy.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('sortBy', require('../sortBy')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/sortedIndex.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/sortedIndex.js deleted file mode 100644 index 364a0543..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/sortedIndex.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('sortedIndex', require('../sortedIndex')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/sortedIndexBy.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/sortedIndexBy.js deleted file mode 100644 index 9593dbd1..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/sortedIndexBy.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('sortedIndexBy', require('../sortedIndexBy')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/sortedIndexOf.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/sortedIndexOf.js deleted file mode 100644 index c9084cab..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/sortedIndexOf.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('sortedIndexOf', require('../sortedIndexOf')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/sortedLastIndex.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/sortedLastIndex.js deleted file mode 100644 index 47fe241a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/sortedLastIndex.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('sortedLastIndex', require('../sortedLastIndex')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/sortedLastIndexBy.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/sortedLastIndexBy.js deleted file mode 100644 index 0f9a3473..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/sortedLastIndexBy.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('sortedLastIndexBy', require('../sortedLastIndexBy')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/sortedLastIndexOf.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/sortedLastIndexOf.js deleted file mode 100644 index 0d4d9327..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/sortedLastIndexOf.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('sortedLastIndexOf', require('../sortedLastIndexOf')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/sortedUniq.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/sortedUniq.js deleted file mode 100644 index 882d2837..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/sortedUniq.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('sortedUniq', require('../sortedUniq'), require('./_falseOptions')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/sortedUniqBy.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/sortedUniqBy.js deleted file mode 100644 index 033db91c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/sortedUniqBy.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('sortedUniqBy', require('../sortedUniqBy')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/split.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/split.js deleted file mode 100644 index 14de1a7e..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/split.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('split', require('../split')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/spread.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/spread.js deleted file mode 100644 index 2d11b707..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/spread.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('spread', require('../spread')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/spreadFrom.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/spreadFrom.js deleted file mode 100644 index 0b630df1..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/spreadFrom.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('spreadFrom', require('../spread')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/startCase.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/startCase.js deleted file mode 100644 index ada98c94..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/startCase.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('startCase', require('../startCase'), require('./_falseOptions')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/startsWith.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/startsWith.js deleted file mode 100644 index 985e2f29..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/startsWith.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('startsWith', require('../startsWith')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/string.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/string.js deleted file mode 100644 index 773b0370..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/string.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert(require('../string')); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/stubArray.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/stubArray.js deleted file mode 100644 index cd604cb4..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/stubArray.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('stubArray', require('../stubArray'), require('./_falseOptions')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/stubFalse.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/stubFalse.js deleted file mode 100644 index 32966645..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/stubFalse.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('stubFalse', require('../stubFalse'), require('./_falseOptions')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/stubObject.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/stubObject.js deleted file mode 100644 index c6c8ec47..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/stubObject.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('stubObject', require('../stubObject'), require('./_falseOptions')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/stubString.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/stubString.js deleted file mode 100644 index 701051e8..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/stubString.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('stubString', require('../stubString'), require('./_falseOptions')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/stubTrue.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/stubTrue.js deleted file mode 100644 index 9249082c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/stubTrue.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('stubTrue', require('../stubTrue'), require('./_falseOptions')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/subtract.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/subtract.js deleted file mode 100644 index d32b16d4..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/subtract.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('subtract', require('../subtract')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/sum.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/sum.js deleted file mode 100644 index 5cce12b3..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/sum.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('sum', require('../sum'), require('./_falseOptions')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/sumBy.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/sumBy.js deleted file mode 100644 index c8826565..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/sumBy.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('sumBy', require('../sumBy')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/symmetricDifference.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/symmetricDifference.js deleted file mode 100644 index 78c16add..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/symmetricDifference.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./xor'); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/symmetricDifferenceBy.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/symmetricDifferenceBy.js deleted file mode 100644 index 298fc7ff..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/symmetricDifferenceBy.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./xorBy'); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/symmetricDifferenceWith.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/symmetricDifferenceWith.js deleted file mode 100644 index 70bc6faf..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/symmetricDifferenceWith.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./xorWith'); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/tail.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/tail.js deleted file mode 100644 index f122f0ac..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/tail.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('tail', require('../tail'), require('./_falseOptions')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/take.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/take.js deleted file mode 100644 index 9af98a7b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/take.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('take', require('../take')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/takeLast.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/takeLast.js deleted file mode 100644 index e98c84a1..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/takeLast.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./takeRight'); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/takeLastWhile.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/takeLastWhile.js deleted file mode 100644 index 5367968a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/takeLastWhile.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./takeRightWhile'); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/takeRight.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/takeRight.js deleted file mode 100644 index b82950a6..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/takeRight.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('takeRight', require('../takeRight')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/takeRightWhile.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/takeRightWhile.js deleted file mode 100644 index 8ffb0a28..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/takeRightWhile.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('takeRightWhile', require('../takeRightWhile')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/takeWhile.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/takeWhile.js deleted file mode 100644 index 28136644..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/takeWhile.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('takeWhile', require('../takeWhile')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/tap.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/tap.js deleted file mode 100644 index d33ad6ec..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/tap.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('tap', require('../tap')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/template.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/template.js deleted file mode 100644 index 74857e1c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/template.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('template', require('../template')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/templateSettings.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/templateSettings.js deleted file mode 100644 index 7bcc0a82..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/templateSettings.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('templateSettings', require('../templateSettings'), require('./_falseOptions')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/throttle.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/throttle.js deleted file mode 100644 index 77fff142..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/throttle.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('throttle', require('../throttle')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/thru.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/thru.js deleted file mode 100644 index d42b3b1d..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/thru.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('thru', require('../thru')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/times.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/times.js deleted file mode 100644 index 0dab06da..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/times.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('times', require('../times')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/toArray.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/toArray.js deleted file mode 100644 index f0c360ac..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/toArray.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('toArray', require('../toArray'), require('./_falseOptions')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/toFinite.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/toFinite.js deleted file mode 100644 index 3a47687d..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/toFinite.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('toFinite', require('../toFinite'), require('./_falseOptions')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/toInteger.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/toInteger.js deleted file mode 100644 index e0af6a75..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/toInteger.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('toInteger', require('../toInteger'), require('./_falseOptions')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/toIterator.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/toIterator.js deleted file mode 100644 index 65e6baa9..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/toIterator.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('toIterator', require('../toIterator'), require('./_falseOptions')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/toJSON.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/toJSON.js deleted file mode 100644 index 2d718d0b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/toJSON.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('toJSON', require('../toJSON'), require('./_falseOptions')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/toLength.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/toLength.js deleted file mode 100644 index b97cdd93..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/toLength.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('toLength', require('../toLength'), require('./_falseOptions')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/toLower.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/toLower.js deleted file mode 100644 index 616ef36a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/toLower.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('toLower', require('../toLower'), require('./_falseOptions')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/toNumber.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/toNumber.js deleted file mode 100644 index d0c6f4d3..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/toNumber.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('toNumber', require('../toNumber'), require('./_falseOptions')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/toPairs.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/toPairs.js deleted file mode 100644 index af783786..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/toPairs.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('toPairs', require('../toPairs'), require('./_falseOptions')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/toPairsIn.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/toPairsIn.js deleted file mode 100644 index 66504abf..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/toPairsIn.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('toPairsIn', require('../toPairsIn'), require('./_falseOptions')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/toPath.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/toPath.js deleted file mode 100644 index b4d5e50f..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/toPath.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('toPath', require('../toPath'), require('./_falseOptions')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/toPlainObject.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/toPlainObject.js deleted file mode 100644 index 278bb863..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/toPlainObject.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('toPlainObject', require('../toPlainObject'), require('./_falseOptions')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/toSafeInteger.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/toSafeInteger.js deleted file mode 100644 index 367a26fd..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/toSafeInteger.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('toSafeInteger', require('../toSafeInteger'), require('./_falseOptions')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/toString.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/toString.js deleted file mode 100644 index cec4f8e2..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/toString.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('toString', require('../toString'), require('./_falseOptions')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/toUpper.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/toUpper.js deleted file mode 100644 index 54f9a560..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/toUpper.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('toUpper', require('../toUpper'), require('./_falseOptions')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/transform.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/transform.js deleted file mode 100644 index 759d088f..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/transform.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('transform', require('../transform')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/trim.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/trim.js deleted file mode 100644 index e6319a74..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/trim.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('trim', require('../trim')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/trimChars.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/trimChars.js deleted file mode 100644 index c9294de4..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/trimChars.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('trimChars', require('../trim')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/trimCharsEnd.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/trimCharsEnd.js deleted file mode 100644 index 284bc2f8..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/trimCharsEnd.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('trimCharsEnd', require('../trimEnd')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/trimCharsStart.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/trimCharsStart.js deleted file mode 100644 index ff0ee65d..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/trimCharsStart.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('trimCharsStart', require('../trimStart')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/trimEnd.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/trimEnd.js deleted file mode 100644 index 71908805..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/trimEnd.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('trimEnd', require('../trimEnd')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/trimStart.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/trimStart.js deleted file mode 100644 index fda902c3..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/trimStart.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('trimStart', require('../trimStart')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/truncate.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/truncate.js deleted file mode 100644 index d265c1de..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/truncate.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('truncate', require('../truncate')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/unapply.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/unapply.js deleted file mode 100644 index c5dfe779..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/unapply.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./rest'); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/unary.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/unary.js deleted file mode 100644 index 286c945f..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/unary.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('unary', require('../unary'), require('./_falseOptions')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/unescape.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/unescape.js deleted file mode 100644 index fddcb46e..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/unescape.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('unescape', require('../unescape'), require('./_falseOptions')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/union.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/union.js deleted file mode 100644 index ef8228d7..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/union.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('union', require('../union')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/unionBy.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/unionBy.js deleted file mode 100644 index 603687a1..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/unionBy.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('unionBy', require('../unionBy')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/unionWith.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/unionWith.js deleted file mode 100644 index 65bb3a79..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/unionWith.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('unionWith', require('../unionWith')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/uniq.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/uniq.js deleted file mode 100644 index bc185249..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/uniq.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('uniq', require('../uniq'), require('./_falseOptions')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/uniqBy.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/uniqBy.js deleted file mode 100644 index 634c6a8b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/uniqBy.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('uniqBy', require('../uniqBy')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/uniqWith.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/uniqWith.js deleted file mode 100644 index 0ec601a9..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/uniqWith.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('uniqWith', require('../uniqWith')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/uniqueId.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/uniqueId.js deleted file mode 100644 index aa8fc2f7..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/uniqueId.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('uniqueId', require('../uniqueId')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/unnest.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/unnest.js deleted file mode 100644 index 5d34060a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/unnest.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./flatten'); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/unset.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/unset.js deleted file mode 100644 index ea203a0f..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/unset.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('unset', require('../unset')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/unzip.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/unzip.js deleted file mode 100644 index cc364b3c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/unzip.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('unzip', require('../unzip'), require('./_falseOptions')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/unzipWith.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/unzipWith.js deleted file mode 100644 index 182eaa10..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/unzipWith.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('unzipWith', require('../unzipWith')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/update.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/update.js deleted file mode 100644 index b8ce2cc9..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/update.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('update', require('../update')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/updateWith.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/updateWith.js deleted file mode 100644 index d5e8282d..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/updateWith.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('updateWith', require('../updateWith')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/upperCase.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/upperCase.js deleted file mode 100644 index c886f202..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/upperCase.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('upperCase', require('../upperCase'), require('./_falseOptions')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/upperFirst.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/upperFirst.js deleted file mode 100644 index d8c04df5..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/upperFirst.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('upperFirst', require('../upperFirst'), require('./_falseOptions')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/useWith.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/useWith.js deleted file mode 100644 index d8b3df5a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/useWith.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./overArgs'); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/util.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/util.js deleted file mode 100644 index 18c00bae..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/util.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert(require('../util')); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/value.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/value.js deleted file mode 100644 index 555eec7a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/value.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('value', require('../value'), require('./_falseOptions')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/valueOf.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/valueOf.js deleted file mode 100644 index f968807d..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/valueOf.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('valueOf', require('../valueOf'), require('./_falseOptions')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/values.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/values.js deleted file mode 100644 index 2dfc5613..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/values.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('values', require('../values'), require('./_falseOptions')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/valuesIn.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/valuesIn.js deleted file mode 100644 index a1b2bb87..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/valuesIn.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('valuesIn', require('../valuesIn'), require('./_falseOptions')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/where.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/where.js deleted file mode 100644 index 3247f64a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/where.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./conformsTo'); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/whereEq.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/whereEq.js deleted file mode 100644 index 29d1e1e4..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/whereEq.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./isMatch'); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/without.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/without.js deleted file mode 100644 index bad9e125..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/without.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('without', require('../without')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/words.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/words.js deleted file mode 100644 index 4a901414..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/words.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('words', require('../words')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/wrap.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/wrap.js deleted file mode 100644 index e93bd8a1..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/wrap.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('wrap', require('../wrap')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/wrapperAt.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/wrapperAt.js deleted file mode 100644 index 8f0a310f..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/wrapperAt.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('wrapperAt', require('../wrapperAt'), require('./_falseOptions')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/wrapperChain.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/wrapperChain.js deleted file mode 100644 index 2a48ea2b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/wrapperChain.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('wrapperChain', require('../wrapperChain'), require('./_falseOptions')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/wrapperLodash.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/wrapperLodash.js deleted file mode 100644 index a7162d08..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/wrapperLodash.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('wrapperLodash', require('../wrapperLodash'), require('./_falseOptions')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/wrapperReverse.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/wrapperReverse.js deleted file mode 100644 index e1481aab..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/wrapperReverse.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('wrapperReverse', require('../wrapperReverse'), require('./_falseOptions')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/wrapperValue.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/wrapperValue.js deleted file mode 100644 index 8eb9112f..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/wrapperValue.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('wrapperValue', require('../wrapperValue'), require('./_falseOptions')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/xor.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/xor.js deleted file mode 100644 index 29e28194..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/xor.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('xor', require('../xor')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/xorBy.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/xorBy.js deleted file mode 100644 index b355686d..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/xorBy.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('xorBy', require('../xorBy')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/xorWith.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/xorWith.js deleted file mode 100644 index 8e05739a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/xorWith.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('xorWith', require('../xorWith')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/zip.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/zip.js deleted file mode 100644 index 69e147a4..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/zip.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('zip', require('../zip')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/zipAll.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/zipAll.js deleted file mode 100644 index efa8ccbf..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/zipAll.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('zipAll', require('../zip')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/zipObj.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/zipObj.js deleted file mode 100644 index f4a34531..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/zipObj.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./zipObject'); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/zipObject.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/zipObject.js deleted file mode 100644 index 462dbb68..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/zipObject.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('zipObject', require('../zipObject')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/zipObjectDeep.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/zipObjectDeep.js deleted file mode 100644 index 53a5d338..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/zipObjectDeep.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('zipObjectDeep', require('../zipObjectDeep')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/zipWith.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/zipWith.js deleted file mode 100644 index c5cf9e21..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fp/zipWith.js +++ /dev/null @@ -1,5 +0,0 @@ -var convert = require('./convert'), - func = convert('zipWith', require('../zipWith')); - -func.placeholder = require('./placeholder'); -module.exports = func; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fromPairs.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fromPairs.js deleted file mode 100644 index ee7940d2..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/fromPairs.js +++ /dev/null @@ -1,28 +0,0 @@ -/** - * The inverse of `_.toPairs`; this method returns an object composed - * from key-value `pairs`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {Array} pairs The key-value pairs. - * @returns {Object} Returns the new object. - * @example - * - * _.fromPairs([['a', 1], ['b', 2]]); - * // => { 'a': 1, 'b': 2 } - */ -function fromPairs(pairs) { - var index = -1, - length = pairs == null ? 0 : pairs.length, - result = {}; - - while (++index < length) { - var pair = pairs[index]; - result[pair[0]] = pair[1]; - } - return result; -} - -module.exports = fromPairs; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/function.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/function.js deleted file mode 100644 index b0fc6d93..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/function.js +++ /dev/null @@ -1,25 +0,0 @@ -module.exports = { - 'after': require('./after'), - 'ary': require('./ary'), - 'before': require('./before'), - 'bind': require('./bind'), - 'bindKey': require('./bindKey'), - 'curry': require('./curry'), - 'curryRight': require('./curryRight'), - 'debounce': require('./debounce'), - 'defer': require('./defer'), - 'delay': require('./delay'), - 'flip': require('./flip'), - 'memoize': require('./memoize'), - 'negate': require('./negate'), - 'once': require('./once'), - 'overArgs': require('./overArgs'), - 'partial': require('./partial'), - 'partialRight': require('./partialRight'), - 'rearg': require('./rearg'), - 'rest': require('./rest'), - 'spread': require('./spread'), - 'throttle': require('./throttle'), - 'unary': require('./unary'), - 'wrap': require('./wrap') -}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/functions.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/functions.js deleted file mode 100644 index 9722928f..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/functions.js +++ /dev/null @@ -1,31 +0,0 @@ -var baseFunctions = require('./_baseFunctions'), - keys = require('./keys'); - -/** - * Creates an array of function property names from own enumerable properties - * of `object`. - * - * @static - * @since 0.1.0 - * @memberOf _ - * @category Object - * @param {Object} object The object to inspect. - * @returns {Array} Returns the function names. - * @see _.functionsIn - * @example - * - * function Foo() { - * this.a = _.constant('a'); - * this.b = _.constant('b'); - * } - * - * Foo.prototype.c = _.constant('c'); - * - * _.functions(new Foo); - * // => ['a', 'b'] - */ -function functions(object) { - return object == null ? [] : baseFunctions(object, keys(object)); -} - -module.exports = functions; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/functionsIn.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/functionsIn.js deleted file mode 100644 index f00345d0..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/functionsIn.js +++ /dev/null @@ -1,31 +0,0 @@ -var baseFunctions = require('./_baseFunctions'), - keysIn = require('./keysIn'); - -/** - * Creates an array of function property names from own and inherited - * enumerable properties of `object`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Object - * @param {Object} object The object to inspect. - * @returns {Array} Returns the function names. - * @see _.functions - * @example - * - * function Foo() { - * this.a = _.constant('a'); - * this.b = _.constant('b'); - * } - * - * Foo.prototype.c = _.constant('c'); - * - * _.functionsIn(new Foo); - * // => ['a', 'b', 'c'] - */ -function functionsIn(object) { - return object == null ? [] : baseFunctions(object, keysIn(object)); -} - -module.exports = functionsIn; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/get.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/get.js deleted file mode 100644 index 8805ff92..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/get.js +++ /dev/null @@ -1,33 +0,0 @@ -var baseGet = require('./_baseGet'); - -/** - * Gets the value at `path` of `object`. If the resolved value is - * `undefined`, the `defaultValue` is returned in its place. - * - * @static - * @memberOf _ - * @since 3.7.0 - * @category Object - * @param {Object} object The object to query. - * @param {Array|string} path The path of the property to get. - * @param {*} [defaultValue] The value returned for `undefined` resolved values. - * @returns {*} Returns the resolved value. - * @example - * - * var object = { 'a': [{ 'b': { 'c': 3 } }] }; - * - * _.get(object, 'a[0].b.c'); - * // => 3 - * - * _.get(object, ['a', '0', 'b', 'c']); - * // => 3 - * - * _.get(object, 'a.b.c', 'default'); - * // => 'default' - */ -function get(object, path, defaultValue) { - var result = object == null ? undefined : baseGet(object, path); - return result === undefined ? defaultValue : result; -} - -module.exports = get; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/groupBy.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/groupBy.js deleted file mode 100644 index babf4f6b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/groupBy.js +++ /dev/null @@ -1,41 +0,0 @@ -var baseAssignValue = require('./_baseAssignValue'), - createAggregator = require('./_createAggregator'); - -/** Used for built-in method references. */ -var objectProto = Object.prototype; - -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; - -/** - * Creates an object composed of keys generated from the results of running - * each element of `collection` thru `iteratee`. The order of grouped values - * is determined by the order they occur in `collection`. The corresponding - * value of each key is an array of elements responsible for generating the - * key. The iteratee is invoked with one argument: (value). - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [iteratee=_.identity] The iteratee to transform keys. - * @returns {Object} Returns the composed aggregate object. - * @example - * - * _.groupBy([6.1, 4.2, 6.3], Math.floor); - * // => { '4': [4.2], '6': [6.1, 6.3] } - * - * // The `_.property` iteratee shorthand. - * _.groupBy(['one', 'two', 'three'], 'length'); - * // => { '3': ['one', 'two'], '5': ['three'] } - */ -var groupBy = createAggregator(function(result, value, key) { - if (hasOwnProperty.call(result, key)) { - result[key].push(value); - } else { - baseAssignValue(result, key, [value]); - } -}); - -module.exports = groupBy; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/gt.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/gt.js deleted file mode 100644 index 3a662828..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/gt.js +++ /dev/null @@ -1,29 +0,0 @@ -var baseGt = require('./_baseGt'), - createRelationalOperation = require('./_createRelationalOperation'); - -/** - * Checks if `value` is greater than `other`. - * - * @static - * @memberOf _ - * @since 3.9.0 - * @category Lang - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if `value` is greater than `other`, - * else `false`. - * @see _.lt - * @example - * - * _.gt(3, 1); - * // => true - * - * _.gt(3, 3); - * // => false - * - * _.gt(1, 3); - * // => false - */ -var gt = createRelationalOperation(baseGt); - -module.exports = gt; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/gte.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/gte.js deleted file mode 100644 index 4180a687..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/gte.js +++ /dev/null @@ -1,30 +0,0 @@ -var createRelationalOperation = require('./_createRelationalOperation'); - -/** - * Checks if `value` is greater than or equal to `other`. - * - * @static - * @memberOf _ - * @since 3.9.0 - * @category Lang - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if `value` is greater than or equal to - * `other`, else `false`. - * @see _.lte - * @example - * - * _.gte(3, 1); - * // => true - * - * _.gte(3, 3); - * // => true - * - * _.gte(1, 3); - * // => false - */ -var gte = createRelationalOperation(function(value, other) { - return value >= other; -}); - -module.exports = gte; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/has.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/has.js deleted file mode 100644 index 34df55e8..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/has.js +++ /dev/null @@ -1,35 +0,0 @@ -var baseHas = require('./_baseHas'), - hasPath = require('./_hasPath'); - -/** - * Checks if `path` is a direct property of `object`. - * - * @static - * @since 0.1.0 - * @memberOf _ - * @category Object - * @param {Object} object The object to query. - * @param {Array|string} path The path to check. - * @returns {boolean} Returns `true` if `path` exists, else `false`. - * @example - * - * var object = { 'a': { 'b': 2 } }; - * var other = _.create({ 'a': _.create({ 'b': 2 }) }); - * - * _.has(object, 'a'); - * // => true - * - * _.has(object, 'a.b'); - * // => true - * - * _.has(object, ['a', 'b']); - * // => true - * - * _.has(other, 'a'); - * // => false - */ -function has(object, path) { - return object != null && hasPath(object, path, baseHas); -} - -module.exports = has; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/hasIn.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/hasIn.js deleted file mode 100644 index 06a36865..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/hasIn.js +++ /dev/null @@ -1,34 +0,0 @@ -var baseHasIn = require('./_baseHasIn'), - hasPath = require('./_hasPath'); - -/** - * Checks if `path` is a direct or inherited property of `object`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Object - * @param {Object} object The object to query. - * @param {Array|string} path The path to check. - * @returns {boolean} Returns `true` if `path` exists, else `false`. - * @example - * - * var object = _.create({ 'a': _.create({ 'b': 2 }) }); - * - * _.hasIn(object, 'a'); - * // => true - * - * _.hasIn(object, 'a.b'); - * // => true - * - * _.hasIn(object, ['a', 'b']); - * // => true - * - * _.hasIn(object, 'b'); - * // => false - */ -function hasIn(object, path) { - return object != null && hasPath(object, path, baseHasIn); -} - -module.exports = hasIn; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/head.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/head.js deleted file mode 100644 index dee9d1f1..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/head.js +++ /dev/null @@ -1,23 +0,0 @@ -/** - * Gets the first element of `array`. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @alias first - * @category Array - * @param {Array} array The array to query. - * @returns {*} Returns the first element of `array`. - * @example - * - * _.head([1, 2, 3]); - * // => 1 - * - * _.head([]); - * // => undefined - */ -function head(array) { - return (array && array.length) ? array[0] : undefined; -} - -module.exports = head; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/identity.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/identity.js deleted file mode 100644 index 2d5d963c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/identity.js +++ /dev/null @@ -1,21 +0,0 @@ -/** - * This method returns the first argument it receives. - * - * @static - * @since 0.1.0 - * @memberOf _ - * @category Util - * @param {*} value Any value. - * @returns {*} Returns `value`. - * @example - * - * var object = { 'a': 1 }; - * - * console.log(_.identity(object) === object); - * // => true - */ -function identity(value) { - return value; -} - -module.exports = identity; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/inRange.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/inRange.js deleted file mode 100644 index f20728d9..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/inRange.js +++ /dev/null @@ -1,55 +0,0 @@ -var baseInRange = require('./_baseInRange'), - toFinite = require('./toFinite'), - toNumber = require('./toNumber'); - -/** - * Checks if `n` is between `start` and up to, but not including, `end`. If - * `end` is not specified, it's set to `start` with `start` then set to `0`. - * If `start` is greater than `end` the params are swapped to support - * negative ranges. - * - * @static - * @memberOf _ - * @since 3.3.0 - * @category Number - * @param {number} number The number to check. - * @param {number} [start=0] The start of the range. - * @param {number} end The end of the range. - * @returns {boolean} Returns `true` if `number` is in the range, else `false`. - * @see _.range, _.rangeRight - * @example - * - * _.inRange(3, 2, 4); - * // => true - * - * _.inRange(4, 8); - * // => true - * - * _.inRange(4, 2); - * // => false - * - * _.inRange(2, 2); - * // => false - * - * _.inRange(1.2, 2); - * // => true - * - * _.inRange(5.2, 4); - * // => false - * - * _.inRange(-3, -2, -6); - * // => true - */ -function inRange(number, start, end) { - start = toFinite(start); - if (end === undefined) { - end = start; - start = 0; - } else { - end = toFinite(end); - } - number = toNumber(number); - return baseInRange(number, start, end); -} - -module.exports = inRange; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/includes.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/includes.js deleted file mode 100644 index ae0deedc..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/includes.js +++ /dev/null @@ -1,53 +0,0 @@ -var baseIndexOf = require('./_baseIndexOf'), - isArrayLike = require('./isArrayLike'), - isString = require('./isString'), - toInteger = require('./toInteger'), - values = require('./values'); - -/* Built-in method references for those with the same name as other `lodash` methods. */ -var nativeMax = Math.max; - -/** - * Checks if `value` is in `collection`. If `collection` is a string, it's - * checked for a substring of `value`, otherwise - * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) - * is used for equality comparisons. If `fromIndex` is negative, it's used as - * the offset from the end of `collection`. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Collection - * @param {Array|Object|string} collection The collection to inspect. - * @param {*} value The value to search for. - * @param {number} [fromIndex=0] The index to search from. - * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`. - * @returns {boolean} Returns `true` if `value` is found, else `false`. - * @example - * - * _.includes([1, 2, 3], 1); - * // => true - * - * _.includes([1, 2, 3], 1, 2); - * // => false - * - * _.includes({ 'a': 1, 'b': 2 }, 1); - * // => true - * - * _.includes('abcd', 'bc'); - * // => true - */ -function includes(collection, value, fromIndex, guard) { - collection = isArrayLike(collection) ? collection : values(collection); - fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0; - - var length = collection.length; - if (fromIndex < 0) { - fromIndex = nativeMax(length + fromIndex, 0); - } - return isString(collection) - ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1) - : (!!length && baseIndexOf(collection, value, fromIndex) > -1); -} - -module.exports = includes; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/index.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/index.js deleted file mode 100644 index 5d063e21..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./lodash'); \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/indexOf.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/indexOf.js deleted file mode 100644 index 3c644af2..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/indexOf.js +++ /dev/null @@ -1,42 +0,0 @@ -var baseIndexOf = require('./_baseIndexOf'), - toInteger = require('./toInteger'); - -/* Built-in method references for those with the same name as other `lodash` methods. */ -var nativeMax = Math.max; - -/** - * Gets the index at which the first occurrence of `value` is found in `array` - * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) - * for equality comparisons. If `fromIndex` is negative, it's used as the - * offset from the end of `array`. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Array - * @param {Array} array The array to inspect. - * @param {*} value The value to search for. - * @param {number} [fromIndex=0] The index to search from. - * @returns {number} Returns the index of the matched value, else `-1`. - * @example - * - * _.indexOf([1, 2, 1, 2], 2); - * // => 1 - * - * // Search from the `fromIndex`. - * _.indexOf([1, 2, 1, 2], 2, 2); - * // => 3 - */ -function indexOf(array, value, fromIndex) { - var length = array == null ? 0 : array.length; - if (!length) { - return -1; - } - var index = fromIndex == null ? 0 : toInteger(fromIndex); - if (index < 0) { - index = nativeMax(length + index, 0); - } - return baseIndexOf(array, value, index); -} - -module.exports = indexOf; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/initial.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/initial.js deleted file mode 100644 index f47fc509..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/initial.js +++ /dev/null @@ -1,22 +0,0 @@ -var baseSlice = require('./_baseSlice'); - -/** - * Gets all but the last element of `array`. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Array - * @param {Array} array The array to query. - * @returns {Array} Returns the slice of `array`. - * @example - * - * _.initial([1, 2, 3]); - * // => [1, 2] - */ -function initial(array) { - var length = array == null ? 0 : array.length; - return length ? baseSlice(array, 0, -1) : []; -} - -module.exports = initial; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/intersection.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/intersection.js deleted file mode 100644 index a94c1351..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/intersection.js +++ /dev/null @@ -1,30 +0,0 @@ -var arrayMap = require('./_arrayMap'), - baseIntersection = require('./_baseIntersection'), - baseRest = require('./_baseRest'), - castArrayLikeObject = require('./_castArrayLikeObject'); - -/** - * Creates an array of unique values that are included in all given arrays - * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) - * for equality comparisons. The order and references of result values are - * determined by the first array. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Array - * @param {...Array} [arrays] The arrays to inspect. - * @returns {Array} Returns the new array of intersecting values. - * @example - * - * _.intersection([2, 1], [2, 3]); - * // => [2] - */ -var intersection = baseRest(function(arrays) { - var mapped = arrayMap(arrays, castArrayLikeObject); - return (mapped.length && mapped[0] === arrays[0]) - ? baseIntersection(mapped) - : []; -}); - -module.exports = intersection; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/intersectionBy.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/intersectionBy.js deleted file mode 100644 index 31461aae..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/intersectionBy.js +++ /dev/null @@ -1,45 +0,0 @@ -var arrayMap = require('./_arrayMap'), - baseIntersection = require('./_baseIntersection'), - baseIteratee = require('./_baseIteratee'), - baseRest = require('./_baseRest'), - castArrayLikeObject = require('./_castArrayLikeObject'), - last = require('./last'); - -/** - * This method is like `_.intersection` except that it accepts `iteratee` - * which is invoked for each element of each `arrays` to generate the criterion - * by which they're compared. The order and references of result values are - * determined by the first array. The iteratee is invoked with one argument: - * (value). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {...Array} [arrays] The arrays to inspect. - * @param {Function} [iteratee=_.identity] The iteratee invoked per element. - * @returns {Array} Returns the new array of intersecting values. - * @example - * - * _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor); - * // => [2.1] - * - * // The `_.property` iteratee shorthand. - * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); - * // => [{ 'x': 1 }] - */ -var intersectionBy = baseRest(function(arrays) { - var iteratee = last(arrays), - mapped = arrayMap(arrays, castArrayLikeObject); - - if (iteratee === last(mapped)) { - iteratee = undefined; - } else { - mapped.pop(); - } - return (mapped.length && mapped[0] === arrays[0]) - ? baseIntersection(mapped, baseIteratee(iteratee, 2)) - : []; -}); - -module.exports = intersectionBy; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/intersectionWith.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/intersectionWith.js deleted file mode 100644 index 63cabfaa..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/intersectionWith.js +++ /dev/null @@ -1,41 +0,0 @@ -var arrayMap = require('./_arrayMap'), - baseIntersection = require('./_baseIntersection'), - baseRest = require('./_baseRest'), - castArrayLikeObject = require('./_castArrayLikeObject'), - last = require('./last'); - -/** - * This method is like `_.intersection` except that it accepts `comparator` - * which is invoked to compare elements of `arrays`. The order and references - * of result values are determined by the first array. The comparator is - * invoked with two arguments: (arrVal, othVal). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {...Array} [arrays] The arrays to inspect. - * @param {Function} [comparator] The comparator invoked per element. - * @returns {Array} Returns the new array of intersecting values. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; - * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; - * - * _.intersectionWith(objects, others, _.isEqual); - * // => [{ 'x': 1, 'y': 2 }] - */ -var intersectionWith = baseRest(function(arrays) { - var comparator = last(arrays), - mapped = arrayMap(arrays, castArrayLikeObject); - - comparator = typeof comparator == 'function' ? comparator : undefined; - if (comparator) { - mapped.pop(); - } - return (mapped.length && mapped[0] === arrays[0]) - ? baseIntersection(mapped, undefined, comparator) - : []; -}); - -module.exports = intersectionWith; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/invert.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/invert.js deleted file mode 100644 index 8c479509..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/invert.js +++ /dev/null @@ -1,42 +0,0 @@ -var constant = require('./constant'), - createInverter = require('./_createInverter'), - identity = require('./identity'); - -/** Used for built-in method references. */ -var objectProto = Object.prototype; - -/** - * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) - * of values. - */ -var nativeObjectToString = objectProto.toString; - -/** - * Creates an object composed of the inverted keys and values of `object`. - * If `object` contains duplicate values, subsequent values overwrite - * property assignments of previous values. - * - * @static - * @memberOf _ - * @since 0.7.0 - * @category Object - * @param {Object} object The object to invert. - * @returns {Object} Returns the new inverted object. - * @example - * - * var object = { 'a': 1, 'b': 2, 'c': 1 }; - * - * _.invert(object); - * // => { '1': 'c', '2': 'b' } - */ -var invert = createInverter(function(result, value, key) { - if (value != null && - typeof value.toString != 'function') { - value = nativeObjectToString.call(value); - } - - result[value] = key; -}, constant(identity)); - -module.exports = invert; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/invertBy.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/invertBy.js deleted file mode 100644 index 3f4f7e53..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/invertBy.js +++ /dev/null @@ -1,56 +0,0 @@ -var baseIteratee = require('./_baseIteratee'), - createInverter = require('./_createInverter'); - -/** Used for built-in method references. */ -var objectProto = Object.prototype; - -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; - -/** - * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) - * of values. - */ -var nativeObjectToString = objectProto.toString; - -/** - * This method is like `_.invert` except that the inverted object is generated - * from the results of running each element of `object` thru `iteratee`. The - * corresponding inverted value of each inverted key is an array of keys - * responsible for generating the inverted value. The iteratee is invoked - * with one argument: (value). - * - * @static - * @memberOf _ - * @since 4.1.0 - * @category Object - * @param {Object} object The object to invert. - * @param {Function} [iteratee=_.identity] The iteratee invoked per element. - * @returns {Object} Returns the new inverted object. - * @example - * - * var object = { 'a': 1, 'b': 2, 'c': 1 }; - * - * _.invertBy(object); - * // => { '1': ['a', 'c'], '2': ['b'] } - * - * _.invertBy(object, function(value) { - * return 'group' + value; - * }); - * // => { 'group1': ['a', 'c'], 'group2': ['b'] } - */ -var invertBy = createInverter(function(result, value, key) { - if (value != null && - typeof value.toString != 'function') { - value = nativeObjectToString.call(value); - } - - if (hasOwnProperty.call(result, value)) { - result[value].push(key); - } else { - result[value] = [key]; - } -}, baseIteratee); - -module.exports = invertBy; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/invoke.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/invoke.js deleted file mode 100644 index 97d51eb5..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/invoke.js +++ /dev/null @@ -1,24 +0,0 @@ -var baseInvoke = require('./_baseInvoke'), - baseRest = require('./_baseRest'); - -/** - * Invokes the method at `path` of `object`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Object - * @param {Object} object The object to query. - * @param {Array|string} path The path of the method to invoke. - * @param {...*} [args] The arguments to invoke the method with. - * @returns {*} Returns the result of the invoked method. - * @example - * - * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] }; - * - * _.invoke(object, 'a[0].b.c.slice', 1, 3); - * // => [2, 3] - */ -var invoke = baseRest(baseInvoke); - -module.exports = invoke; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/invokeMap.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/invokeMap.js deleted file mode 100644 index 8da5126c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/invokeMap.js +++ /dev/null @@ -1,41 +0,0 @@ -var apply = require('./_apply'), - baseEach = require('./_baseEach'), - baseInvoke = require('./_baseInvoke'), - baseRest = require('./_baseRest'), - isArrayLike = require('./isArrayLike'); - -/** - * Invokes the method at `path` of each element in `collection`, returning - * an array of the results of each invoked method. Any additional arguments - * are provided to each invoked method. If `path` is a function, it's invoked - * for, and `this` bound to, each element in `collection`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Array|Function|string} path The path of the method to invoke or - * the function invoked per iteration. - * @param {...*} [args] The arguments to invoke each method with. - * @returns {Array} Returns the array of results. - * @example - * - * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort'); - * // => [[1, 5, 7], [1, 2, 3]] - * - * _.invokeMap([123, 456], String.prototype.split, ''); - * // => [['1', '2', '3'], ['4', '5', '6']] - */ -var invokeMap = baseRest(function(collection, path, args) { - var index = -1, - isFunc = typeof path == 'function', - result = isArrayLike(collection) ? Array(collection.length) : []; - - baseEach(collection, function(value) { - result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args); - }); - return result; -}); - -module.exports = invokeMap; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isArguments.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isArguments.js deleted file mode 100644 index 8b9ed66c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isArguments.js +++ /dev/null @@ -1,36 +0,0 @@ -var baseIsArguments = require('./_baseIsArguments'), - isObjectLike = require('./isObjectLike'); - -/** Used for built-in method references. */ -var objectProto = Object.prototype; - -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; - -/** Built-in value references. */ -var propertyIsEnumerable = objectProto.propertyIsEnumerable; - -/** - * Checks if `value` is likely an `arguments` object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an `arguments` object, - * else `false`. - * @example - * - * _.isArguments(function() { return arguments; }()); - * // => true - * - * _.isArguments([1, 2, 3]); - * // => false - */ -var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) { - return isObjectLike(value) && hasOwnProperty.call(value, 'callee') && - !propertyIsEnumerable.call(value, 'callee'); -}; - -module.exports = isArguments; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isArray.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isArray.js deleted file mode 100644 index 88ab55fd..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isArray.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * Checks if `value` is classified as an `Array` object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an array, else `false`. - * @example - * - * _.isArray([1, 2, 3]); - * // => true - * - * _.isArray(document.body.children); - * // => false - * - * _.isArray('abc'); - * // => false - * - * _.isArray(_.noop); - * // => false - */ -var isArray = Array.isArray; - -module.exports = isArray; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isArrayBuffer.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isArrayBuffer.js deleted file mode 100644 index 12904a64..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isArrayBuffer.js +++ /dev/null @@ -1,27 +0,0 @@ -var baseIsArrayBuffer = require('./_baseIsArrayBuffer'), - baseUnary = require('./_baseUnary'), - nodeUtil = require('./_nodeUtil'); - -/* Node.js helper references. */ -var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer; - -/** - * Checks if `value` is classified as an `ArrayBuffer` object. - * - * @static - * @memberOf _ - * @since 4.3.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`. - * @example - * - * _.isArrayBuffer(new ArrayBuffer(2)); - * // => true - * - * _.isArrayBuffer(new Array(2)); - * // => false - */ -var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer; - -module.exports = isArrayBuffer; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isArrayLike.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isArrayLike.js deleted file mode 100644 index 0f966805..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isArrayLike.js +++ /dev/null @@ -1,33 +0,0 @@ -var isFunction = require('./isFunction'), - isLength = require('./isLength'); - -/** - * Checks if `value` is array-like. A value is considered array-like if it's - * not a function and has a `value.length` that's an integer greater than or - * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is array-like, else `false`. - * @example - * - * _.isArrayLike([1, 2, 3]); - * // => true - * - * _.isArrayLike(document.body.children); - * // => true - * - * _.isArrayLike('abc'); - * // => true - * - * _.isArrayLike(_.noop); - * // => false - */ -function isArrayLike(value) { - return value != null && isLength(value.length) && !isFunction(value); -} - -module.exports = isArrayLike; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isArrayLikeObject.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isArrayLikeObject.js deleted file mode 100644 index 6c4812a8..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isArrayLikeObject.js +++ /dev/null @@ -1,33 +0,0 @@ -var isArrayLike = require('./isArrayLike'), - isObjectLike = require('./isObjectLike'); - -/** - * This method is like `_.isArrayLike` except that it also checks if `value` - * is an object. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an array-like object, - * else `false`. - * @example - * - * _.isArrayLikeObject([1, 2, 3]); - * // => true - * - * _.isArrayLikeObject(document.body.children); - * // => true - * - * _.isArrayLikeObject('abc'); - * // => false - * - * _.isArrayLikeObject(_.noop); - * // => false - */ -function isArrayLikeObject(value) { - return isObjectLike(value) && isArrayLike(value); -} - -module.exports = isArrayLikeObject; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isBoolean.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isBoolean.js deleted file mode 100644 index a43ed4b8..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isBoolean.js +++ /dev/null @@ -1,29 +0,0 @@ -var baseGetTag = require('./_baseGetTag'), - isObjectLike = require('./isObjectLike'); - -/** `Object#toString` result references. */ -var boolTag = '[object Boolean]'; - -/** - * Checks if `value` is classified as a boolean primitive or object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a boolean, else `false`. - * @example - * - * _.isBoolean(false); - * // => true - * - * _.isBoolean(null); - * // => false - */ -function isBoolean(value) { - return value === true || value === false || - (isObjectLike(value) && baseGetTag(value) == boolTag); -} - -module.exports = isBoolean; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isBuffer.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isBuffer.js deleted file mode 100644 index c103cc74..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isBuffer.js +++ /dev/null @@ -1,38 +0,0 @@ -var root = require('./_root'), - stubFalse = require('./stubFalse'); - -/** Detect free variable `exports`. */ -var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports; - -/** Detect free variable `module`. */ -var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module; - -/** Detect the popular CommonJS extension `module.exports`. */ -var moduleExports = freeModule && freeModule.exports === freeExports; - -/** Built-in value references. */ -var Buffer = moduleExports ? root.Buffer : undefined; - -/* Built-in method references for those with the same name as other `lodash` methods. */ -var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined; - -/** - * Checks if `value` is a buffer. - * - * @static - * @memberOf _ - * @since 4.3.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a buffer, else `false`. - * @example - * - * _.isBuffer(new Buffer(2)); - * // => true - * - * _.isBuffer(new Uint8Array(2)); - * // => false - */ -var isBuffer = nativeIsBuffer || stubFalse; - -module.exports = isBuffer; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isDate.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isDate.js deleted file mode 100644 index 7f0209fc..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isDate.js +++ /dev/null @@ -1,27 +0,0 @@ -var baseIsDate = require('./_baseIsDate'), - baseUnary = require('./_baseUnary'), - nodeUtil = require('./_nodeUtil'); - -/* Node.js helper references. */ -var nodeIsDate = nodeUtil && nodeUtil.isDate; - -/** - * Checks if `value` is classified as a `Date` object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a date object, else `false`. - * @example - * - * _.isDate(new Date); - * // => true - * - * _.isDate('Mon April 23 2012'); - * // => false - */ -var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate; - -module.exports = isDate; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isElement.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isElement.js deleted file mode 100644 index 76ae29c3..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isElement.js +++ /dev/null @@ -1,25 +0,0 @@ -var isObjectLike = require('./isObjectLike'), - isPlainObject = require('./isPlainObject'); - -/** - * Checks if `value` is likely a DOM element. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`. - * @example - * - * _.isElement(document.body); - * // => true - * - * _.isElement(''); - * // => false - */ -function isElement(value) { - return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value); -} - -module.exports = isElement; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isEmpty.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isEmpty.js deleted file mode 100644 index 3597294a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isEmpty.js +++ /dev/null @@ -1,77 +0,0 @@ -var baseKeys = require('./_baseKeys'), - getTag = require('./_getTag'), - isArguments = require('./isArguments'), - isArray = require('./isArray'), - isArrayLike = require('./isArrayLike'), - isBuffer = require('./isBuffer'), - isPrototype = require('./_isPrototype'), - isTypedArray = require('./isTypedArray'); - -/** `Object#toString` result references. */ -var mapTag = '[object Map]', - setTag = '[object Set]'; - -/** Used for built-in method references. */ -var objectProto = Object.prototype; - -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; - -/** - * Checks if `value` is an empty object, collection, map, or set. - * - * Objects are considered empty if they have no own enumerable string keyed - * properties. - * - * Array-like values such as `arguments` objects, arrays, buffers, strings, or - * jQuery-like collections are considered empty if they have a `length` of `0`. - * Similarly, maps and sets are considered empty if they have a `size` of `0`. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is empty, else `false`. - * @example - * - * _.isEmpty(null); - * // => true - * - * _.isEmpty(true); - * // => true - * - * _.isEmpty(1); - * // => true - * - * _.isEmpty([1, 2, 3]); - * // => false - * - * _.isEmpty({ 'a': 1 }); - * // => false - */ -function isEmpty(value) { - if (value == null) { - return true; - } - if (isArrayLike(value) && - (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' || - isBuffer(value) || isTypedArray(value) || isArguments(value))) { - return !value.length; - } - var tag = getTag(value); - if (tag == mapTag || tag == setTag) { - return !value.size; - } - if (isPrototype(value)) { - return !baseKeys(value).length; - } - for (var key in value) { - if (hasOwnProperty.call(value, key)) { - return false; - } - } - return true; -} - -module.exports = isEmpty; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isEqual.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isEqual.js deleted file mode 100644 index 5e23e76c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isEqual.js +++ /dev/null @@ -1,35 +0,0 @@ -var baseIsEqual = require('./_baseIsEqual'); - -/** - * Performs a deep comparison between two values to determine if they are - * equivalent. - * - * **Note:** This method supports comparing arrays, array buffers, booleans, - * date objects, error objects, maps, numbers, `Object` objects, regexes, - * sets, strings, symbols, and typed arrays. `Object` objects are compared - * by their own, not inherited, enumerable properties. Functions and DOM - * nodes are compared by strict equality, i.e. `===`. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if the values are equivalent, else `false`. - * @example - * - * var object = { 'a': 1 }; - * var other = { 'a': 1 }; - * - * _.isEqual(object, other); - * // => true - * - * object === other; - * // => false - */ -function isEqual(value, other) { - return baseIsEqual(value, other); -} - -module.exports = isEqual; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isEqualWith.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isEqualWith.js deleted file mode 100644 index 21bdc7ff..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isEqualWith.js +++ /dev/null @@ -1,41 +0,0 @@ -var baseIsEqual = require('./_baseIsEqual'); - -/** - * This method is like `_.isEqual` except that it accepts `customizer` which - * is invoked to compare values. If `customizer` returns `undefined`, comparisons - * are handled by the method instead. The `customizer` is invoked with up to - * six arguments: (objValue, othValue [, index|key, object, other, stack]). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @param {Function} [customizer] The function to customize comparisons. - * @returns {boolean} Returns `true` if the values are equivalent, else `false`. - * @example - * - * function isGreeting(value) { - * return /^h(?:i|ello)$/.test(value); - * } - * - * function customizer(objValue, othValue) { - * if (isGreeting(objValue) && isGreeting(othValue)) { - * return true; - * } - * } - * - * var array = ['hello', 'goodbye']; - * var other = ['hi', 'goodbye']; - * - * _.isEqualWith(array, other, customizer); - * // => true - */ -function isEqualWith(value, other, customizer) { - customizer = typeof customizer == 'function' ? customizer : undefined; - var result = customizer ? customizer(value, other) : undefined; - return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result; -} - -module.exports = isEqualWith; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isError.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isError.js deleted file mode 100644 index b4f41e00..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isError.js +++ /dev/null @@ -1,36 +0,0 @@ -var baseGetTag = require('./_baseGetTag'), - isObjectLike = require('./isObjectLike'), - isPlainObject = require('./isPlainObject'); - -/** `Object#toString` result references. */ -var domExcTag = '[object DOMException]', - errorTag = '[object Error]'; - -/** - * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`, - * `SyntaxError`, `TypeError`, or `URIError` object. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an error object, else `false`. - * @example - * - * _.isError(new Error); - * // => true - * - * _.isError(Error); - * // => false - */ -function isError(value) { - if (!isObjectLike(value)) { - return false; - } - var tag = baseGetTag(value); - return tag == errorTag || tag == domExcTag || - (typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value)); -} - -module.exports = isError; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isFinite.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isFinite.js deleted file mode 100644 index 601842bc..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isFinite.js +++ /dev/null @@ -1,36 +0,0 @@ -var root = require('./_root'); - -/* Built-in method references for those with the same name as other `lodash` methods. */ -var nativeIsFinite = root.isFinite; - -/** - * Checks if `value` is a finite primitive number. - * - * **Note:** This method is based on - * [`Number.isFinite`](https://mdn.io/Number/isFinite). - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a finite number, else `false`. - * @example - * - * _.isFinite(3); - * // => true - * - * _.isFinite(Number.MIN_VALUE); - * // => true - * - * _.isFinite(Infinity); - * // => false - * - * _.isFinite('3'); - * // => false - */ -function isFinite(value) { - return typeof value == 'number' && nativeIsFinite(value); -} - -module.exports = isFinite; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isFunction.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isFunction.js deleted file mode 100644 index 907a8cd8..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isFunction.js +++ /dev/null @@ -1,37 +0,0 @@ -var baseGetTag = require('./_baseGetTag'), - isObject = require('./isObject'); - -/** `Object#toString` result references. */ -var asyncTag = '[object AsyncFunction]', - funcTag = '[object Function]', - genTag = '[object GeneratorFunction]', - proxyTag = '[object Proxy]'; - -/** - * Checks if `value` is classified as a `Function` object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a function, else `false`. - * @example - * - * _.isFunction(_); - * // => true - * - * _.isFunction(/abc/); - * // => false - */ -function isFunction(value) { - if (!isObject(value)) { - return false; - } - // The use of `Object#toString` avoids issues with the `typeof` operator - // in Safari 9 which returns 'object' for typed arrays and other constructors. - var tag = baseGetTag(value); - return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag; -} - -module.exports = isFunction; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isInteger.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isInteger.js deleted file mode 100644 index 66aa87d5..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isInteger.js +++ /dev/null @@ -1,33 +0,0 @@ -var toInteger = require('./toInteger'); - -/** - * Checks if `value` is an integer. - * - * **Note:** This method is based on - * [`Number.isInteger`](https://mdn.io/Number/isInteger). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an integer, else `false`. - * @example - * - * _.isInteger(3); - * // => true - * - * _.isInteger(Number.MIN_VALUE); - * // => false - * - * _.isInteger(Infinity); - * // => false - * - * _.isInteger('3'); - * // => false - */ -function isInteger(value) { - return typeof value == 'number' && value == toInteger(value); -} - -module.exports = isInteger; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isLength.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isLength.js deleted file mode 100644 index 3a95caa9..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isLength.js +++ /dev/null @@ -1,35 +0,0 @@ -/** Used as references for various `Number` constants. */ -var MAX_SAFE_INTEGER = 9007199254740991; - -/** - * Checks if `value` is a valid array-like length. - * - * **Note:** This method is loosely based on - * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. - * @example - * - * _.isLength(3); - * // => true - * - * _.isLength(Number.MIN_VALUE); - * // => false - * - * _.isLength(Infinity); - * // => false - * - * _.isLength('3'); - * // => false - */ -function isLength(value) { - return typeof value == 'number' && - value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; -} - -module.exports = isLength; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isMap.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isMap.js deleted file mode 100644 index 44f8517e..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isMap.js +++ /dev/null @@ -1,27 +0,0 @@ -var baseIsMap = require('./_baseIsMap'), - baseUnary = require('./_baseUnary'), - nodeUtil = require('./_nodeUtil'); - -/* Node.js helper references. */ -var nodeIsMap = nodeUtil && nodeUtil.isMap; - -/** - * Checks if `value` is classified as a `Map` object. - * - * @static - * @memberOf _ - * @since 4.3.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a map, else `false`. - * @example - * - * _.isMap(new Map); - * // => true - * - * _.isMap(new WeakMap); - * // => false - */ -var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap; - -module.exports = isMap; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isMatch.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isMatch.js deleted file mode 100644 index 9773a18c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isMatch.js +++ /dev/null @@ -1,36 +0,0 @@ -var baseIsMatch = require('./_baseIsMatch'), - getMatchData = require('./_getMatchData'); - -/** - * Performs a partial deep comparison between `object` and `source` to - * determine if `object` contains equivalent property values. - * - * **Note:** This method is equivalent to `_.matches` when `source` is - * partially applied. - * - * Partial comparisons will match empty array and empty object `source` - * values against any array or object value, respectively. See `_.isEqual` - * for a list of supported value comparisons. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Lang - * @param {Object} object The object to inspect. - * @param {Object} source The object of property values to match. - * @returns {boolean} Returns `true` if `object` is a match, else `false`. - * @example - * - * var object = { 'a': 1, 'b': 2 }; - * - * _.isMatch(object, { 'b': 2 }); - * // => true - * - * _.isMatch(object, { 'b': 1 }); - * // => false - */ -function isMatch(object, source) { - return object === source || baseIsMatch(object, source, getMatchData(source)); -} - -module.exports = isMatch; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isMatchWith.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isMatchWith.js deleted file mode 100644 index 187b6a61..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isMatchWith.js +++ /dev/null @@ -1,41 +0,0 @@ -var baseIsMatch = require('./_baseIsMatch'), - getMatchData = require('./_getMatchData'); - -/** - * This method is like `_.isMatch` except that it accepts `customizer` which - * is invoked to compare values. If `customizer` returns `undefined`, comparisons - * are handled by the method instead. The `customizer` is invoked with five - * arguments: (objValue, srcValue, index|key, object, source). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {Object} object The object to inspect. - * @param {Object} source The object of property values to match. - * @param {Function} [customizer] The function to customize comparisons. - * @returns {boolean} Returns `true` if `object` is a match, else `false`. - * @example - * - * function isGreeting(value) { - * return /^h(?:i|ello)$/.test(value); - * } - * - * function customizer(objValue, srcValue) { - * if (isGreeting(objValue) && isGreeting(srcValue)) { - * return true; - * } - * } - * - * var object = { 'greeting': 'hello' }; - * var source = { 'greeting': 'hi' }; - * - * _.isMatchWith(object, source, customizer); - * // => true - */ -function isMatchWith(object, source, customizer) { - customizer = typeof customizer == 'function' ? customizer : undefined; - return baseIsMatch(object, source, getMatchData(source), customizer); -} - -module.exports = isMatchWith; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isNaN.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isNaN.js deleted file mode 100644 index 7d0d783b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isNaN.js +++ /dev/null @@ -1,38 +0,0 @@ -var isNumber = require('./isNumber'); - -/** - * Checks if `value` is `NaN`. - * - * **Note:** This method is based on - * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as - * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for - * `undefined` and other non-number values. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. - * @example - * - * _.isNaN(NaN); - * // => true - * - * _.isNaN(new Number(NaN)); - * // => true - * - * isNaN(undefined); - * // => true - * - * _.isNaN(undefined); - * // => false - */ -function isNaN(value) { - // An `NaN` primitive is the only value that is not equal to itself. - // Perform the `toStringTag` check first to avoid errors with some - // ActiveX objects in IE. - return isNumber(value) && value != +value; -} - -module.exports = isNaN; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isNative.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isNative.js deleted file mode 100644 index f0cb8d58..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isNative.js +++ /dev/null @@ -1,40 +0,0 @@ -var baseIsNative = require('./_baseIsNative'), - isMaskable = require('./_isMaskable'); - -/** Error message constants. */ -var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.'; - -/** - * Checks if `value` is a pristine native function. - * - * **Note:** This method can't reliably detect native functions in the presence - * of the core-js package because core-js circumvents this kind of detection. - * Despite multiple requests, the core-js maintainer has made it clear: any - * attempt to fix the detection will be obstructed. As a result, we're left - * with little choice but to throw an error. Unfortunately, this also affects - * packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill), - * which rely on core-js. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a native function, - * else `false`. - * @example - * - * _.isNative(Array.prototype.push); - * // => true - * - * _.isNative(_); - * // => false - */ -function isNative(value) { - if (isMaskable(value)) { - throw new Error(CORE_ERROR_TEXT); - } - return baseIsNative(value); -} - -module.exports = isNative; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isNil.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isNil.js deleted file mode 100644 index 79f05052..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isNil.js +++ /dev/null @@ -1,25 +0,0 @@ -/** - * Checks if `value` is `null` or `undefined`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is nullish, else `false`. - * @example - * - * _.isNil(null); - * // => true - * - * _.isNil(void 0); - * // => true - * - * _.isNil(NaN); - * // => false - */ -function isNil(value) { - return value == null; -} - -module.exports = isNil; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isNull.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isNull.js deleted file mode 100644 index c0a374d7..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isNull.js +++ /dev/null @@ -1,22 +0,0 @@ -/** - * Checks if `value` is `null`. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is `null`, else `false`. - * @example - * - * _.isNull(null); - * // => true - * - * _.isNull(void 0); - * // => false - */ -function isNull(value) { - return value === null; -} - -module.exports = isNull; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isNumber.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isNumber.js deleted file mode 100644 index cd34ee46..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isNumber.js +++ /dev/null @@ -1,38 +0,0 @@ -var baseGetTag = require('./_baseGetTag'), - isObjectLike = require('./isObjectLike'); - -/** `Object#toString` result references. */ -var numberTag = '[object Number]'; - -/** - * Checks if `value` is classified as a `Number` primitive or object. - * - * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are - * classified as numbers, use the `_.isFinite` method. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a number, else `false`. - * @example - * - * _.isNumber(3); - * // => true - * - * _.isNumber(Number.MIN_VALUE); - * // => true - * - * _.isNumber(Infinity); - * // => true - * - * _.isNumber('3'); - * // => false - */ -function isNumber(value) { - return typeof value == 'number' || - (isObjectLike(value) && baseGetTag(value) == numberTag); -} - -module.exports = isNumber; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isObject.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isObject.js deleted file mode 100644 index 1dc89391..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isObject.js +++ /dev/null @@ -1,31 +0,0 @@ -/** - * Checks if `value` is the - * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) - * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an object, else `false`. - * @example - * - * _.isObject({}); - * // => true - * - * _.isObject([1, 2, 3]); - * // => true - * - * _.isObject(_.noop); - * // => true - * - * _.isObject(null); - * // => false - */ -function isObject(value) { - var type = typeof value; - return value != null && (type == 'object' || type == 'function'); -} - -module.exports = isObject; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isObjectLike.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isObjectLike.js deleted file mode 100644 index 301716b5..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isObjectLike.js +++ /dev/null @@ -1,29 +0,0 @@ -/** - * Checks if `value` is object-like. A value is object-like if it's not `null` - * and has a `typeof` result of "object". - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is object-like, else `false`. - * @example - * - * _.isObjectLike({}); - * // => true - * - * _.isObjectLike([1, 2, 3]); - * // => true - * - * _.isObjectLike(_.noop); - * // => false - * - * _.isObjectLike(null); - * // => false - */ -function isObjectLike(value) { - return value != null && typeof value == 'object'; -} - -module.exports = isObjectLike; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isPlainObject.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isPlainObject.js deleted file mode 100644 index 23873731..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isPlainObject.js +++ /dev/null @@ -1,62 +0,0 @@ -var baseGetTag = require('./_baseGetTag'), - getPrototype = require('./_getPrototype'), - isObjectLike = require('./isObjectLike'); - -/** `Object#toString` result references. */ -var objectTag = '[object Object]'; - -/** Used for built-in method references. */ -var funcProto = Function.prototype, - objectProto = Object.prototype; - -/** Used to resolve the decompiled source of functions. */ -var funcToString = funcProto.toString; - -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; - -/** Used to infer the `Object` constructor. */ -var objectCtorString = funcToString.call(Object); - -/** - * Checks if `value` is a plain object, that is, an object created by the - * `Object` constructor or one with a `[[Prototype]]` of `null`. - * - * @static - * @memberOf _ - * @since 0.8.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a plain object, else `false`. - * @example - * - * function Foo() { - * this.a = 1; - * } - * - * _.isPlainObject(new Foo); - * // => false - * - * _.isPlainObject([1, 2, 3]); - * // => false - * - * _.isPlainObject({ 'x': 0, 'y': 0 }); - * // => true - * - * _.isPlainObject(Object.create(null)); - * // => true - */ -function isPlainObject(value) { - if (!isObjectLike(value) || baseGetTag(value) != objectTag) { - return false; - } - var proto = getPrototype(value); - if (proto === null) { - return true; - } - var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor; - return typeof Ctor == 'function' && Ctor instanceof Ctor && - funcToString.call(Ctor) == objectCtorString; -} - -module.exports = isPlainObject; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isRegExp.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isRegExp.js deleted file mode 100644 index 76c9b6e9..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isRegExp.js +++ /dev/null @@ -1,27 +0,0 @@ -var baseIsRegExp = require('./_baseIsRegExp'), - baseUnary = require('./_baseUnary'), - nodeUtil = require('./_nodeUtil'); - -/* Node.js helper references. */ -var nodeIsRegExp = nodeUtil && nodeUtil.isRegExp; - -/** - * Checks if `value` is classified as a `RegExp` object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a regexp, else `false`. - * @example - * - * _.isRegExp(/abc/); - * // => true - * - * _.isRegExp('/abc/'); - * // => false - */ -var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp; - -module.exports = isRegExp; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isSafeInteger.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isSafeInteger.js deleted file mode 100644 index 2a48526e..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isSafeInteger.js +++ /dev/null @@ -1,37 +0,0 @@ -var isInteger = require('./isInteger'); - -/** Used as references for various `Number` constants. */ -var MAX_SAFE_INTEGER = 9007199254740991; - -/** - * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754 - * double precision number which isn't the result of a rounded unsafe integer. - * - * **Note:** This method is based on - * [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a safe integer, else `false`. - * @example - * - * _.isSafeInteger(3); - * // => true - * - * _.isSafeInteger(Number.MIN_VALUE); - * // => false - * - * _.isSafeInteger(Infinity); - * // => false - * - * _.isSafeInteger('3'); - * // => false - */ -function isSafeInteger(value) { - return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER; -} - -module.exports = isSafeInteger; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isSet.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isSet.js deleted file mode 100644 index ab88bdf8..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isSet.js +++ /dev/null @@ -1,27 +0,0 @@ -var baseIsSet = require('./_baseIsSet'), - baseUnary = require('./_baseUnary'), - nodeUtil = require('./_nodeUtil'); - -/* Node.js helper references. */ -var nodeIsSet = nodeUtil && nodeUtil.isSet; - -/** - * Checks if `value` is classified as a `Set` object. - * - * @static - * @memberOf _ - * @since 4.3.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a set, else `false`. - * @example - * - * _.isSet(new Set); - * // => true - * - * _.isSet(new WeakSet); - * // => false - */ -var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet; - -module.exports = isSet; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isString.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isString.js deleted file mode 100644 index 627eb9c3..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isString.js +++ /dev/null @@ -1,30 +0,0 @@ -var baseGetTag = require('./_baseGetTag'), - isArray = require('./isArray'), - isObjectLike = require('./isObjectLike'); - -/** `Object#toString` result references. */ -var stringTag = '[object String]'; - -/** - * Checks if `value` is classified as a `String` primitive or object. - * - * @static - * @since 0.1.0 - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a string, else `false`. - * @example - * - * _.isString('abc'); - * // => true - * - * _.isString(1); - * // => false - */ -function isString(value) { - return typeof value == 'string' || - (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag); -} - -module.exports = isString; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isSymbol.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isSymbol.js deleted file mode 100644 index dfb60b97..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isSymbol.js +++ /dev/null @@ -1,29 +0,0 @@ -var baseGetTag = require('./_baseGetTag'), - isObjectLike = require('./isObjectLike'); - -/** `Object#toString` result references. */ -var symbolTag = '[object Symbol]'; - -/** - * Checks if `value` is classified as a `Symbol` primitive or object. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. - * @example - * - * _.isSymbol(Symbol.iterator); - * // => true - * - * _.isSymbol('abc'); - * // => false - */ -function isSymbol(value) { - return typeof value == 'symbol' || - (isObjectLike(value) && baseGetTag(value) == symbolTag); -} - -module.exports = isSymbol; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isTypedArray.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isTypedArray.js deleted file mode 100644 index da3f8dd1..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isTypedArray.js +++ /dev/null @@ -1,27 +0,0 @@ -var baseIsTypedArray = require('./_baseIsTypedArray'), - baseUnary = require('./_baseUnary'), - nodeUtil = require('./_nodeUtil'); - -/* Node.js helper references. */ -var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray; - -/** - * Checks if `value` is classified as a typed array. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. - * @example - * - * _.isTypedArray(new Uint8Array); - * // => true - * - * _.isTypedArray([]); - * // => false - */ -var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray; - -module.exports = isTypedArray; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isUndefined.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isUndefined.js deleted file mode 100644 index 377d121a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isUndefined.js +++ /dev/null @@ -1,22 +0,0 @@ -/** - * Checks if `value` is `undefined`. - * - * @static - * @since 0.1.0 - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`. - * @example - * - * _.isUndefined(void 0); - * // => true - * - * _.isUndefined(null); - * // => false - */ -function isUndefined(value) { - return value === undefined; -} - -module.exports = isUndefined; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isWeakMap.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isWeakMap.js deleted file mode 100644 index 8d36f663..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isWeakMap.js +++ /dev/null @@ -1,28 +0,0 @@ -var getTag = require('./_getTag'), - isObjectLike = require('./isObjectLike'); - -/** `Object#toString` result references. */ -var weakMapTag = '[object WeakMap]'; - -/** - * Checks if `value` is classified as a `WeakMap` object. - * - * @static - * @memberOf _ - * @since 4.3.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a weak map, else `false`. - * @example - * - * _.isWeakMap(new WeakMap); - * // => true - * - * _.isWeakMap(new Map); - * // => false - */ -function isWeakMap(value) { - return isObjectLike(value) && getTag(value) == weakMapTag; -} - -module.exports = isWeakMap; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isWeakSet.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isWeakSet.js deleted file mode 100644 index e628b261..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/isWeakSet.js +++ /dev/null @@ -1,28 +0,0 @@ -var baseGetTag = require('./_baseGetTag'), - isObjectLike = require('./isObjectLike'); - -/** `Object#toString` result references. */ -var weakSetTag = '[object WeakSet]'; - -/** - * Checks if `value` is classified as a `WeakSet` object. - * - * @static - * @memberOf _ - * @since 4.3.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a weak set, else `false`. - * @example - * - * _.isWeakSet(new WeakSet); - * // => true - * - * _.isWeakSet(new Set); - * // => false - */ -function isWeakSet(value) { - return isObjectLike(value) && baseGetTag(value) == weakSetTag; -} - -module.exports = isWeakSet; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/iteratee.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/iteratee.js deleted file mode 100644 index 61b73a8c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/iteratee.js +++ /dev/null @@ -1,53 +0,0 @@ -var baseClone = require('./_baseClone'), - baseIteratee = require('./_baseIteratee'); - -/** Used to compose bitmasks for cloning. */ -var CLONE_DEEP_FLAG = 1; - -/** - * Creates a function that invokes `func` with the arguments of the created - * function. If `func` is a property name, the created function returns the - * property value for a given element. If `func` is an array or object, the - * created function returns `true` for elements that contain the equivalent - * source properties, otherwise it returns `false`. - * - * @static - * @since 4.0.0 - * @memberOf _ - * @category Util - * @param {*} [func=_.identity] The value to convert to a callback. - * @returns {Function} Returns the callback. - * @example - * - * var users = [ - * { 'user': 'barney', 'age': 36, 'active': true }, - * { 'user': 'fred', 'age': 40, 'active': false } - * ]; - * - * // The `_.matches` iteratee shorthand. - * _.filter(users, _.iteratee({ 'user': 'barney', 'active': true })); - * // => [{ 'user': 'barney', 'age': 36, 'active': true }] - * - * // The `_.matchesProperty` iteratee shorthand. - * _.filter(users, _.iteratee(['user', 'fred'])); - * // => [{ 'user': 'fred', 'age': 40 }] - * - * // The `_.property` iteratee shorthand. - * _.map(users, _.iteratee('user')); - * // => ['barney', 'fred'] - * - * // Create custom iteratee shorthands. - * _.iteratee = _.wrap(_.iteratee, function(iteratee, func) { - * return !_.isRegExp(func) ? iteratee(func) : function(string) { - * return func.test(string); - * }; - * }); - * - * _.filter(['abc', 'def'], /ef/); - * // => ['def'] - */ -function iteratee(func) { - return baseIteratee(typeof func == 'function' ? func : baseClone(func, CLONE_DEEP_FLAG)); -} - -module.exports = iteratee; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/join.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/join.js deleted file mode 100644 index 45de079f..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/join.js +++ /dev/null @@ -1,26 +0,0 @@ -/** Used for built-in method references. */ -var arrayProto = Array.prototype; - -/* Built-in method references for those with the same name as other `lodash` methods. */ -var nativeJoin = arrayProto.join; - -/** - * Converts all elements in `array` into a string separated by `separator`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {Array} array The array to convert. - * @param {string} [separator=','] The element separator. - * @returns {string} Returns the joined string. - * @example - * - * _.join(['a', 'b', 'c'], '~'); - * // => 'a~b~c' - */ -function join(array, separator) { - return array == null ? '' : nativeJoin.call(array, separator); -} - -module.exports = join; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/kebabCase.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/kebabCase.js deleted file mode 100644 index 8a52be64..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/kebabCase.js +++ /dev/null @@ -1,28 +0,0 @@ -var createCompounder = require('./_createCompounder'); - -/** - * Converts `string` to - * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles). - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category String - * @param {string} [string=''] The string to convert. - * @returns {string} Returns the kebab cased string. - * @example - * - * _.kebabCase('Foo Bar'); - * // => 'foo-bar' - * - * _.kebabCase('fooBar'); - * // => 'foo-bar' - * - * _.kebabCase('__FOO_BAR__'); - * // => 'foo-bar' - */ -var kebabCase = createCompounder(function(result, word, index) { - return result + (index ? '-' : '') + word.toLowerCase(); -}); - -module.exports = kebabCase; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/keyBy.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/keyBy.js deleted file mode 100644 index acc007a0..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/keyBy.js +++ /dev/null @@ -1,36 +0,0 @@ -var baseAssignValue = require('./_baseAssignValue'), - createAggregator = require('./_createAggregator'); - -/** - * Creates an object composed of keys generated from the results of running - * each element of `collection` thru `iteratee`. The corresponding value of - * each key is the last element responsible for generating the key. The - * iteratee is invoked with one argument: (value). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [iteratee=_.identity] The iteratee to transform keys. - * @returns {Object} Returns the composed aggregate object. - * @example - * - * var array = [ - * { 'dir': 'left', 'code': 97 }, - * { 'dir': 'right', 'code': 100 } - * ]; - * - * _.keyBy(array, function(o) { - * return String.fromCharCode(o.code); - * }); - * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } } - * - * _.keyBy(array, 'dir'); - * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } } - */ -var keyBy = createAggregator(function(result, value, key) { - baseAssignValue(result, key, value); -}); - -module.exports = keyBy; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/keys.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/keys.js deleted file mode 100644 index d143c718..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/keys.js +++ /dev/null @@ -1,37 +0,0 @@ -var arrayLikeKeys = require('./_arrayLikeKeys'), - baseKeys = require('./_baseKeys'), - isArrayLike = require('./isArrayLike'); - -/** - * Creates an array of the own enumerable property names of `object`. - * - * **Note:** Non-object values are coerced to objects. See the - * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) - * for more details. - * - * @static - * @since 0.1.0 - * @memberOf _ - * @category Object - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.keys(new Foo); - * // => ['a', 'b'] (iteration order is not guaranteed) - * - * _.keys('hi'); - * // => ['0', '1'] - */ -function keys(object) { - return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object); -} - -module.exports = keys; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/keysIn.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/keysIn.js deleted file mode 100644 index a62308f2..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/keysIn.js +++ /dev/null @@ -1,32 +0,0 @@ -var arrayLikeKeys = require('./_arrayLikeKeys'), - baseKeysIn = require('./_baseKeysIn'), - isArrayLike = require('./isArrayLike'); - -/** - * Creates an array of the own and inherited enumerable property names of `object`. - * - * **Note:** Non-object values are coerced to objects. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Object - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.keysIn(new Foo); - * // => ['a', 'b', 'c'] (iteration order is not guaranteed) - */ -function keysIn(object) { - return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object); -} - -module.exports = keysIn; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/lang.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/lang.js deleted file mode 100644 index a3962169..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/lang.js +++ /dev/null @@ -1,58 +0,0 @@ -module.exports = { - 'castArray': require('./castArray'), - 'clone': require('./clone'), - 'cloneDeep': require('./cloneDeep'), - 'cloneDeepWith': require('./cloneDeepWith'), - 'cloneWith': require('./cloneWith'), - 'conformsTo': require('./conformsTo'), - 'eq': require('./eq'), - 'gt': require('./gt'), - 'gte': require('./gte'), - 'isArguments': require('./isArguments'), - 'isArray': require('./isArray'), - 'isArrayBuffer': require('./isArrayBuffer'), - 'isArrayLike': require('./isArrayLike'), - 'isArrayLikeObject': require('./isArrayLikeObject'), - 'isBoolean': require('./isBoolean'), - 'isBuffer': require('./isBuffer'), - 'isDate': require('./isDate'), - 'isElement': require('./isElement'), - 'isEmpty': require('./isEmpty'), - 'isEqual': require('./isEqual'), - 'isEqualWith': require('./isEqualWith'), - 'isError': require('./isError'), - 'isFinite': require('./isFinite'), - 'isFunction': require('./isFunction'), - 'isInteger': require('./isInteger'), - 'isLength': require('./isLength'), - 'isMap': require('./isMap'), - 'isMatch': require('./isMatch'), - 'isMatchWith': require('./isMatchWith'), - 'isNaN': require('./isNaN'), - 'isNative': require('./isNative'), - 'isNil': require('./isNil'), - 'isNull': require('./isNull'), - 'isNumber': require('./isNumber'), - 'isObject': require('./isObject'), - 'isObjectLike': require('./isObjectLike'), - 'isPlainObject': require('./isPlainObject'), - 'isRegExp': require('./isRegExp'), - 'isSafeInteger': require('./isSafeInteger'), - 'isSet': require('./isSet'), - 'isString': require('./isString'), - 'isSymbol': require('./isSymbol'), - 'isTypedArray': require('./isTypedArray'), - 'isUndefined': require('./isUndefined'), - 'isWeakMap': require('./isWeakMap'), - 'isWeakSet': require('./isWeakSet'), - 'lt': require('./lt'), - 'lte': require('./lte'), - 'toArray': require('./toArray'), - 'toFinite': require('./toFinite'), - 'toInteger': require('./toInteger'), - 'toLength': require('./toLength'), - 'toNumber': require('./toNumber'), - 'toPlainObject': require('./toPlainObject'), - 'toSafeInteger': require('./toSafeInteger'), - 'toString': require('./toString') -}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/last.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/last.js deleted file mode 100644 index cad1eafa..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/last.js +++ /dev/null @@ -1,20 +0,0 @@ -/** - * Gets the last element of `array`. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Array - * @param {Array} array The array to query. - * @returns {*} Returns the last element of `array`. - * @example - * - * _.last([1, 2, 3]); - * // => 3 - */ -function last(array) { - var length = array == null ? 0 : array.length; - return length ? array[length - 1] : undefined; -} - -module.exports = last; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/lastIndexOf.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/lastIndexOf.js deleted file mode 100644 index dabfb613..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/lastIndexOf.js +++ /dev/null @@ -1,46 +0,0 @@ -var baseFindIndex = require('./_baseFindIndex'), - baseIsNaN = require('./_baseIsNaN'), - strictLastIndexOf = require('./_strictLastIndexOf'), - toInteger = require('./toInteger'); - -/* Built-in method references for those with the same name as other `lodash` methods. */ -var nativeMax = Math.max, - nativeMin = Math.min; - -/** - * This method is like `_.indexOf` except that it iterates over elements of - * `array` from right to left. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Array - * @param {Array} array The array to inspect. - * @param {*} value The value to search for. - * @param {number} [fromIndex=array.length-1] The index to search from. - * @returns {number} Returns the index of the matched value, else `-1`. - * @example - * - * _.lastIndexOf([1, 2, 1, 2], 2); - * // => 3 - * - * // Search from the `fromIndex`. - * _.lastIndexOf([1, 2, 1, 2], 2, 2); - * // => 1 - */ -function lastIndexOf(array, value, fromIndex) { - var length = array == null ? 0 : array.length; - if (!length) { - return -1; - } - var index = length; - if (fromIndex !== undefined) { - index = toInteger(fromIndex); - index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1); - } - return value === value - ? strictLastIndexOf(array, value, index) - : baseFindIndex(array, baseIsNaN, index, true); -} - -module.exports = lastIndexOf; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/lodash.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/lodash.js deleted file mode 100644 index 4131e936..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/lodash/lodash.js +++ /dev/null @@ -1,17209 +0,0 @@ -/** - * @license - * Lodash - * Copyright OpenJS Foundation and other contributors - * Released under MIT license - * Based on Underscore.js 1.8.3 - * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - */ -;(function() { - - /** Used as a safe reference for `undefined` in pre-ES5 environments. */ - var undefined; - - /** Used as the semantic version number. */ - var VERSION = '4.17.21'; - - /** Used as the size to enable large array optimizations. */ - var LARGE_ARRAY_SIZE = 200; - - /** Error message constants. */ - var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.', - FUNC_ERROR_TEXT = 'Expected a function', - INVALID_TEMPL_VAR_ERROR_TEXT = 'Invalid `variable` option passed into `_.template`'; - - /** Used to stand-in for `undefined` hash values. */ - var HASH_UNDEFINED = '__lodash_hash_undefined__'; - - /** Used as the maximum memoize cache size. */ - var MAX_MEMOIZE_SIZE = 500; - - /** Used as the internal argument placeholder. */ - var PLACEHOLDER = '__lodash_placeholder__'; - - /** Used to compose bitmasks for cloning. */ - var CLONE_DEEP_FLAG = 1, - CLONE_FLAT_FLAG = 2, - CLONE_SYMBOLS_FLAG = 4; - - /** Used to compose bitmasks for value comparisons. */ - var COMPARE_PARTIAL_FLAG = 1, - COMPARE_UNORDERED_FLAG = 2; - - /** Used to compose bitmasks for function metadata. */ - var WRAP_BIND_FLAG = 1, - WRAP_BIND_KEY_FLAG = 2, - WRAP_CURRY_BOUND_FLAG = 4, - WRAP_CURRY_FLAG = 8, - WRAP_CURRY_RIGHT_FLAG = 16, - WRAP_PARTIAL_FLAG = 32, - WRAP_PARTIAL_RIGHT_FLAG = 64, - WRAP_ARY_FLAG = 128, - WRAP_REARG_FLAG = 256, - WRAP_FLIP_FLAG = 512; - - /** Used as default options for `_.truncate`. */ - var DEFAULT_TRUNC_LENGTH = 30, - DEFAULT_TRUNC_OMISSION = '...'; - - /** Used to detect hot functions by number of calls within a span of milliseconds. */ - var HOT_COUNT = 800, - HOT_SPAN = 16; - - /** Used to indicate the type of lazy iteratees. */ - var LAZY_FILTER_FLAG = 1, - LAZY_MAP_FLAG = 2, - LAZY_WHILE_FLAG = 3; - - /** Used as references for various `Number` constants. */ - var INFINITY = 1 / 0, - MAX_SAFE_INTEGER = 9007199254740991, - MAX_INTEGER = 1.7976931348623157e+308, - NAN = 0 / 0; - - /** Used as references for the maximum length and index of an array. */ - var MAX_ARRAY_LENGTH = 4294967295, - MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1, - HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1; - - /** Used to associate wrap methods with their bit flags. */ - var wrapFlags = [ - ['ary', WRAP_ARY_FLAG], - ['bind', WRAP_BIND_FLAG], - ['bindKey', WRAP_BIND_KEY_FLAG], - ['curry', WRAP_CURRY_FLAG], - ['curryRight', WRAP_CURRY_RIGHT_FLAG], - ['flip', WRAP_FLIP_FLAG], - ['partial', WRAP_PARTIAL_FLAG], - ['partialRight', WRAP_PARTIAL_RIGHT_FLAG], - ['rearg', WRAP_REARG_FLAG] - ]; - - /** `Object#toString` result references. */ - var argsTag = '[object Arguments]', - arrayTag = '[object Array]', - asyncTag = '[object AsyncFunction]', - boolTag = '[object Boolean]', - dateTag = '[object Date]', - domExcTag = '[object DOMException]', - errorTag = '[object Error]', - funcTag = '[object Function]', - genTag = '[object GeneratorFunction]', - mapTag = '[object Map]', - numberTag = '[object Number]', - nullTag = '[object Null]', - objectTag = '[object Object]', - promiseTag = '[object Promise]', - proxyTag = '[object Proxy]', - regexpTag = '[object RegExp]', - setTag = '[object Set]', - stringTag = '[object String]', - symbolTag = '[object Symbol]', - undefinedTag = '[object Undefined]', - weakMapTag = '[object WeakMap]', - weakSetTag = '[object WeakSet]'; - - var arrayBufferTag = '[object ArrayBuffer]', - dataViewTag = '[object DataView]', - float32Tag = '[object Float32Array]', - float64Tag = '[object Float64Array]', - int8Tag = '[object Int8Array]', - int16Tag = '[object Int16Array]', - int32Tag = '[object Int32Array]', - uint8Tag = '[object Uint8Array]', - uint8ClampedTag = '[object Uint8ClampedArray]', - uint16Tag = '[object Uint16Array]', - uint32Tag = '[object Uint32Array]'; - - /** Used to match empty string literals in compiled template source. */ - var reEmptyStringLeading = /\b__p \+= '';/g, - reEmptyStringMiddle = /\b(__p \+=) '' \+/g, - reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g; - - /** Used to match HTML entities and HTML characters. */ - var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g, - reUnescapedHtml = /[&<>"']/g, - reHasEscapedHtml = RegExp(reEscapedHtml.source), - reHasUnescapedHtml = RegExp(reUnescapedHtml.source); - - /** Used to match template delimiters. */ - var reEscape = /<%-([\s\S]+?)%>/g, - reEvaluate = /<%([\s\S]+?)%>/g, - reInterpolate = /<%=([\s\S]+?)%>/g; - - /** Used to match property names within property paths. */ - var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, - reIsPlainProp = /^\w*$/, - rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; - - /** - * Used to match `RegExp` - * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). - */ - var reRegExpChar = /[\\^$.*+?()[\]{}|]/g, - reHasRegExpChar = RegExp(reRegExpChar.source); - - /** Used to match leading whitespace. */ - var reTrimStart = /^\s+/; - - /** Used to match a single whitespace character. */ - var reWhitespace = /\s/; - - /** Used to match wrap detail comments. */ - var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/, - reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/, - reSplitDetails = /,? & /; - - /** Used to match words composed of alphanumeric characters. */ - var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g; - - /** - * Used to validate the `validate` option in `_.template` variable. - * - * Forbids characters which could potentially change the meaning of the function argument definition: - * - "()," (modification of function parameters) - * - "=" (default value) - * - "[]{}" (destructuring of function parameters) - * - "/" (beginning of a comment) - * - whitespace - */ - var reForbiddenIdentifierChars = /[()=,{}\[\]\/\s]/; - - /** Used to match backslashes in property paths. */ - var reEscapeChar = /\\(\\)?/g; - - /** - * Used to match - * [ES template delimiters](http://ecma-international.org/ecma-262/7.0/#sec-template-literal-lexical-components). - */ - var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g; - - /** Used to match `RegExp` flags from their coerced string values. */ - var reFlags = /\w*$/; - - /** Used to detect bad signed hexadecimal string values. */ - var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; - - /** Used to detect binary string values. */ - var reIsBinary = /^0b[01]+$/i; - - /** Used to detect host constructors (Safari). */ - var reIsHostCtor = /^\[object .+?Constructor\]$/; - - /** Used to detect octal string values. */ - var reIsOctal = /^0o[0-7]+$/i; - - /** Used to detect unsigned integer values. */ - var reIsUint = /^(?:0|[1-9]\d*)$/; - - /** Used to match Latin Unicode letters (excluding mathematical operators). */ - var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g; - - /** Used to ensure capturing order of template delimiters. */ - var reNoMatch = /($^)/; - - /** Used to match unescaped characters in compiled string literals. */ - var reUnescapedString = /['\n\r\u2028\u2029\\]/g; - - /** Used to compose unicode character classes. */ - var rsAstralRange = '\\ud800-\\udfff', - rsComboMarksRange = '\\u0300-\\u036f', - reComboHalfMarksRange = '\\ufe20-\\ufe2f', - rsComboSymbolsRange = '\\u20d0-\\u20ff', - rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange, - rsDingbatRange = '\\u2700-\\u27bf', - rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff', - rsMathOpRange = '\\xac\\xb1\\xd7\\xf7', - rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf', - rsPunctuationRange = '\\u2000-\\u206f', - rsSpaceRange = ' \\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', - rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde', - rsVarRange = '\\ufe0e\\ufe0f', - rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange; - - /** Used to compose unicode capture groups. */ - var rsApos = "['\u2019]", - rsAstral = '[' + rsAstralRange + ']', - rsBreak = '[' + rsBreakRange + ']', - rsCombo = '[' + rsComboRange + ']', - rsDigits = '\\d+', - rsDingbat = '[' + rsDingbatRange + ']', - rsLower = '[' + rsLowerRange + ']', - rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']', - rsFitz = '\\ud83c[\\udffb-\\udfff]', - rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')', - rsNonAstral = '[^' + rsAstralRange + ']', - rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}', - rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]', - rsUpper = '[' + rsUpperRange + ']', - rsZWJ = '\\u200d'; - - /** Used to compose unicode regexes. */ - var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')', - rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')', - rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?', - rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?', - reOptMod = rsModifier + '?', - rsOptVar = '[' + rsVarRange + ']?', - rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*', - rsOrdLower = '\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])', - rsOrdUpper = '\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])', - rsSeq = rsOptVar + reOptMod + rsOptJoin, - rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq, - rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')'; - - /** Used to match apostrophes. */ - var reApos = RegExp(rsApos, 'g'); - - /** - * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and - * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols). - */ - var reComboMark = RegExp(rsCombo, 'g'); - - /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */ - var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g'); - - /** Used to match complex or compound words. */ - var reUnicodeWord = RegExp([ - rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')', - rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')', - rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower, - rsUpper + '+' + rsOptContrUpper, - rsOrdUpper, - rsOrdLower, - rsDigits, - rsEmoji - ].join('|'), 'g'); - - /** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */ - var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']'); - - /** Used to detect strings that need a more robust regexp to match words. */ - var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/; - - /** Used to assign default `context` object properties. */ - var contextProps = [ - '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' - ]; - - /** Used to make template sourceURLs easier to identify. */ - var templateCounter = -1; - - /** Used to identify `toStringTag` values of typed arrays. */ - var typedArrayTags = {}; - typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = - typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = - typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = - typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = - typedArrayTags[uint32Tag] = true; - typedArrayTags[argsTag] = typedArrayTags[arrayTag] = - typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = - typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = - typedArrayTags[errorTag] = typedArrayTags[funcTag] = - typedArrayTags[mapTag] = typedArrayTags[numberTag] = - typedArrayTags[objectTag] = typedArrayTags[regexpTag] = - typedArrayTags[setTag] = typedArrayTags[stringTag] = - typedArrayTags[weakMapTag] = false; - - /** Used to identify `toStringTag` values supported by `_.clone`. */ - var cloneableTags = {}; - cloneableTags[argsTag] = cloneableTags[arrayTag] = - cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] = - cloneableTags[boolTag] = cloneableTags[dateTag] = - cloneableTags[float32Tag] = cloneableTags[float64Tag] = - cloneableTags[int8Tag] = cloneableTags[int16Tag] = - cloneableTags[int32Tag] = cloneableTags[mapTag] = - cloneableTags[numberTag] = cloneableTags[objectTag] = - cloneableTags[regexpTag] = cloneableTags[setTag] = - cloneableTags[stringTag] = cloneableTags[symbolTag] = - cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = - cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true; - cloneableTags[errorTag] = cloneableTags[funcTag] = - cloneableTags[weakMapTag] = false; - - /** Used to map Latin Unicode letters to basic Latin letters. */ - var deburredLetters = { - // Latin-1 Supplement block. - '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A', - '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a', - '\xc7': 'C', '\xe7': 'c', - '\xd0': 'D', '\xf0': 'd', - '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E', - '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e', - '\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I', - '\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i', - '\xd1': 'N', '\xf1': 'n', - '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O', - '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o', - '\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U', - '\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u', - '\xdd': 'Y', '\xfd': 'y', '\xff': 'y', - '\xc6': 'Ae', '\xe6': 'ae', - '\xde': 'Th', '\xfe': 'th', - '\xdf': 'ss', - // Latin Extended-A block. - '\u0100': 'A', '\u0102': 'A', '\u0104': 'A', - '\u0101': 'a', '\u0103': 'a', '\u0105': 'a', - '\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C', - '\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c', - '\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd', - '\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E', - '\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e', - '\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G', - '\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g', - '\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h', - '\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I', - '\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i', - '\u0134': 'J', '\u0135': 'j', - '\u0136': 'K', '\u0137': 'k', '\u0138': 'k', - '\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L', - '\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l', - '\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N', - '\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n', - '\u014c': 'O', '\u014e': 'O', '\u0150': 'O', - '\u014d': 'o', '\u014f': 'o', '\u0151': 'o', - '\u0154': 'R', '\u0156': 'R', '\u0158': 'R', - '\u0155': 'r', '\u0157': 'r', '\u0159': 'r', - '\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S', - '\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's', - '\u0162': 'T', '\u0164': 'T', '\u0166': 'T', - '\u0163': 't', '\u0165': 't', '\u0167': 't', - '\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U', - '\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u', - '\u0174': 'W', '\u0175': 'w', - '\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y', - '\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z', - '\u017a': 'z', '\u017c': 'z', '\u017e': 'z', - '\u0132': 'IJ', '\u0133': 'ij', - '\u0152': 'Oe', '\u0153': 'oe', - '\u0149': "'n", '\u017f': 's' - }; - - /** Used to map characters to HTML entities. */ - var htmlEscapes = { - '&': '&', - '<': '<', - '>': '>', - '"': '"', - "'": ''' - }; - - /** Used to map HTML entities to characters. */ - var htmlUnescapes = { - '&': '&', - '<': '<', - '>': '>', - '"': '"', - ''': "'" - }; - - /** Used to escape characters for inclusion in compiled string literals. */ - var stringEscapes = { - '\\': '\\', - "'": "'", - '\n': 'n', - '\r': 'r', - '\u2028': 'u2028', - '\u2029': 'u2029' - }; - - /** Built-in method references without a dependency on `root`. */ - var freeParseFloat = parseFloat, - freeParseInt = parseInt; - - /** Detect free variable `global` from Node.js. */ - var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; - - /** Detect free variable `self`. */ - var freeSelf = typeof self == 'object' && self && self.Object === Object && self; - - /** Used as a reference to the global object. */ - var root = freeGlobal || freeSelf || Function('return this')(); - - /** Detect free variable `exports`. */ - var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports; - - /** Detect free variable `module`. */ - var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module; - - /** Detect the popular CommonJS extension `module.exports`. */ - var moduleExports = freeModule && freeModule.exports === freeExports; - - /** Detect free variable `process` from Node.js. */ - var freeProcess = moduleExports && freeGlobal.process; - - /** Used to access faster Node.js helpers. */ - var nodeUtil = (function() { - try { - // Use `util.types` for Node.js 10+. - var types = freeModule && freeModule.require && freeModule.require('util').types; - - if (types) { - return types; - } - - // Legacy `process.binding('util')` for Node.js < 10. - return freeProcess && freeProcess.binding && freeProcess.binding('util'); - } catch (e) {} - }()); - - /* Node.js helper references. */ - var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer, - nodeIsDate = nodeUtil && nodeUtil.isDate, - nodeIsMap = nodeUtil && nodeUtil.isMap, - nodeIsRegExp = nodeUtil && nodeUtil.isRegExp, - nodeIsSet = nodeUtil && nodeUtil.isSet, - nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray; - - /*--------------------------------------------------------------------------*/ - - /** - * A faster alternative to `Function#apply`, this function invokes `func` - * with the `this` binding of `thisArg` and the arguments of `args`. - * - * @private - * @param {Function} func The function to invoke. - * @param {*} thisArg The `this` binding of `func`. - * @param {Array} args The arguments to invoke `func` with. - * @returns {*} Returns the result of `func`. - */ - function apply(func, thisArg, args) { - switch (args.length) { - case 0: return func.call(thisArg); - case 1: return func.call(thisArg, args[0]); - case 2: return func.call(thisArg, args[0], args[1]); - case 3: return func.call(thisArg, args[0], args[1], args[2]); - } - return func.apply(thisArg, args); - } - - /** - * A specialized version of `baseAggregator` for arrays. - * - * @private - * @param {Array} [array] The array to iterate over. - * @param {Function} setter The function to set `accumulator` values. - * @param {Function} iteratee The iteratee to transform keys. - * @param {Object} accumulator The initial aggregated object. - * @returns {Function} Returns `accumulator`. - */ - function arrayAggregator(array, setter, iteratee, accumulator) { - var index = -1, - length = array == null ? 0 : array.length; - - while (++index < length) { - var value = array[index]; - setter(accumulator, value, iteratee(value), array); - } - return accumulator; - } - - /** - * A specialized version of `_.forEach` for arrays without support for - * iteratee shorthands. - * - * @private - * @param {Array} [array] The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns `array`. - */ - function arrayEach(array, iteratee) { - var index = -1, - length = array == null ? 0 : array.length; - - while (++index < length) { - if (iteratee(array[index], index, array) === false) { - break; - } - } - return array; - } - - /** - * A specialized version of `_.forEachRight` for arrays without support for - * iteratee shorthands. - * - * @private - * @param {Array} [array] The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns `array`. - */ - function arrayEachRight(array, iteratee) { - var length = array == null ? 0 : array.length; - - while (length--) { - if (iteratee(array[length], length, array) === false) { - break; - } - } - return array; - } - - /** - * A specialized version of `_.every` for arrays without support for - * iteratee shorthands. - * - * @private - * @param {Array} [array] The array to iterate over. - * @param {Function} predicate The function invoked per iteration. - * @returns {boolean} Returns `true` if all elements pass the predicate check, - * else `false`. - */ - function arrayEvery(array, predicate) { - var index = -1, - length = array == null ? 0 : array.length; - - while (++index < length) { - if (!predicate(array[index], index, array)) { - return false; - } - } - return true; - } - - /** - * A specialized version of `_.filter` for arrays without support for - * iteratee shorthands. - * - * @private - * @param {Array} [array] The array to iterate over. - * @param {Function} predicate The function invoked per iteration. - * @returns {Array} Returns the new filtered array. - */ - function arrayFilter(array, predicate) { - var index = -1, - length = array == null ? 0 : array.length, - resIndex = 0, - result = []; - - while (++index < length) { - var value = array[index]; - if (predicate(value, index, array)) { - result[resIndex++] = value; - } - } - return result; - } - - /** - * A specialized version of `_.includes` for arrays without support for - * specifying an index to search from. - * - * @private - * @param {Array} [array] The array to inspect. - * @param {*} target The value to search for. - * @returns {boolean} Returns `true` if `target` is found, else `false`. - */ - function arrayIncludes(array, value) { - var length = array == null ? 0 : array.length; - return !!length && baseIndexOf(array, value, 0) > -1; - } - - /** - * This function is like `arrayIncludes` except that it accepts a comparator. - * - * @private - * @param {Array} [array] The array to inspect. - * @param {*} target The value to search for. - * @param {Function} comparator The comparator invoked per element. - * @returns {boolean} Returns `true` if `target` is found, else `false`. - */ - function arrayIncludesWith(array, value, comparator) { - var index = -1, - length = array == null ? 0 : array.length; - - while (++index < length) { - if (comparator(value, array[index])) { - return true; - } - } - return false; - } - - /** - * A specialized version of `_.map` for arrays without support for iteratee - * shorthands. - * - * @private - * @param {Array} [array] The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns the new mapped array. - */ - function arrayMap(array, iteratee) { - var index = -1, - length = array == null ? 0 : array.length, - result = Array(length); - - while (++index < length) { - result[index] = iteratee(array[index], index, array); - } - return result; - } - - /** - * Appends the elements of `values` to `array`. - * - * @private - * @param {Array} array The array to modify. - * @param {Array} values The values to append. - * @returns {Array} Returns `array`. - */ - function arrayPush(array, values) { - var index = -1, - length = values.length, - offset = array.length; - - while (++index < length) { - array[offset + index] = values[index]; - } - return array; - } - - /** - * A specialized version of `_.reduce` for arrays without support for - * iteratee shorthands. - * - * @private - * @param {Array} [array] The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @param {*} [accumulator] The initial value. - * @param {boolean} [initAccum] Specify using the first element of `array` as - * the initial value. - * @returns {*} Returns the accumulated value. - */ - function arrayReduce(array, iteratee, accumulator, initAccum) { - var index = -1, - length = array == null ? 0 : array.length; - - if (initAccum && length) { - accumulator = array[++index]; - } - while (++index < length) { - accumulator = iteratee(accumulator, array[index], index, array); - } - return accumulator; - } - - /** - * A specialized version of `_.reduceRight` for arrays without support for - * iteratee shorthands. - * - * @private - * @param {Array} [array] The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @param {*} [accumulator] The initial value. - * @param {boolean} [initAccum] Specify using the last element of `array` as - * the initial value. - * @returns {*} Returns the accumulated value. - */ - function arrayReduceRight(array, iteratee, accumulator, initAccum) { - var length = array == null ? 0 : array.length; - if (initAccum && length) { - accumulator = array[--length]; - } - while (length--) { - accumulator = iteratee(accumulator, array[length], length, array); - } - return accumulator; - } - - /** - * A specialized version of `_.some` for arrays without support for iteratee - * shorthands. - * - * @private - * @param {Array} [array] The array to iterate over. - * @param {Function} predicate The function invoked per iteration. - * @returns {boolean} Returns `true` if any element passes the predicate check, - * else `false`. - */ - function arraySome(array, predicate) { - var index = -1, - length = array == null ? 0 : array.length; - - while (++index < length) { - if (predicate(array[index], index, array)) { - return true; - } - } - return false; - } - - /** - * Gets the size of an ASCII `string`. - * - * @private - * @param {string} string The string inspect. - * @returns {number} Returns the string size. - */ - var asciiSize = baseProperty('length'); - - /** - * Converts an ASCII `string` to an array. - * - * @private - * @param {string} string The string to convert. - * @returns {Array} Returns the converted array. - */ - function asciiToArray(string) { - return string.split(''); - } - - /** - * Splits an ASCII `string` into an array of its words. - * - * @private - * @param {string} The string to inspect. - * @returns {Array} Returns the words of `string`. - */ - function asciiWords(string) { - return string.match(reAsciiWord) || []; - } - - /** - * The base implementation of methods like `_.findKey` and `_.findLastKey`, - * without support for iteratee shorthands, which iterates over `collection` - * using `eachFunc`. - * - * @private - * @param {Array|Object} collection The collection to inspect. - * @param {Function} predicate The function invoked per iteration. - * @param {Function} eachFunc The function to iterate over `collection`. - * @returns {*} Returns the found element or its key, else `undefined`. - */ - function baseFindKey(collection, predicate, eachFunc) { - var result; - eachFunc(collection, function(value, key, collection) { - if (predicate(value, key, collection)) { - result = key; - return false; - } - }); - return result; - } - - /** - * The base implementation of `_.findIndex` and `_.findLastIndex` without - * support for iteratee shorthands. - * - * @private - * @param {Array} array The array to inspect. - * @param {Function} predicate The function invoked per iteration. - * @param {number} fromIndex The index to search from. - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {number} Returns the index of the matched value, else `-1`. - */ - function baseFindIndex(array, predicate, fromIndex, fromRight) { - var length = array.length, - index = fromIndex + (fromRight ? 1 : -1); - - while ((fromRight ? index-- : ++index < length)) { - if (predicate(array[index], index, array)) { - return index; - } - } - return -1; - } - - /** - * The base implementation of `_.indexOf` without `fromIndex` bounds checks. - * - * @private - * @param {Array} array The array to inspect. - * @param {*} value The value to search for. - * @param {number} fromIndex The index to search from. - * @returns {number} Returns the index of the matched value, else `-1`. - */ - function baseIndexOf(array, value, fromIndex) { - return value === value - ? strictIndexOf(array, value, fromIndex) - : baseFindIndex(array, baseIsNaN, fromIndex); - } - - /** - * This function is like `baseIndexOf` except that it accepts a comparator. - * - * @private - * @param {Array} array The array to inspect. - * @param {*} value The value to search for. - * @param {number} fromIndex The index to search from. - * @param {Function} comparator The comparator invoked per element. - * @returns {number} Returns the index of the matched value, else `-1`. - */ - function baseIndexOfWith(array, value, fromIndex, comparator) { - var index = fromIndex - 1, - length = array.length; - - while (++index < length) { - if (comparator(array[index], value)) { - return index; - } - } - return -1; - } - - /** - * The base implementation of `_.isNaN` without support for number objects. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. - */ - function baseIsNaN(value) { - return value !== value; - } - - /** - * The base implementation of `_.mean` and `_.meanBy` without support for - * iteratee shorthands. - * - * @private - * @param {Array} array The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {number} Returns the mean. - */ - function baseMean(array, iteratee) { - var length = array == null ? 0 : array.length; - return length ? (baseSum(array, iteratee) / length) : NAN; - } - - /** - * The base implementation of `_.property` without support for deep paths. - * - * @private - * @param {string} key The key of the property to get. - * @returns {Function} Returns the new accessor function. - */ - function baseProperty(key) { - return function(object) { - return object == null ? undefined : object[key]; - }; - } - - /** - * The base implementation of `_.propertyOf` without support for deep paths. - * - * @private - * @param {Object} object The object to query. - * @returns {Function} Returns the new accessor function. - */ - function basePropertyOf(object) { - return function(key) { - return object == null ? undefined : object[key]; - }; - } - - /** - * The base implementation of `_.reduce` and `_.reduceRight`, without support - * for iteratee shorthands, which iterates over `collection` using `eachFunc`. - * - * @private - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @param {*} accumulator The initial value. - * @param {boolean} initAccum Specify using the first or last element of - * `collection` as the initial value. - * @param {Function} eachFunc The function to iterate over `collection`. - * @returns {*} Returns the accumulated value. - */ - function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) { - eachFunc(collection, function(value, index, collection) { - accumulator = initAccum - ? (initAccum = false, value) - : iteratee(accumulator, value, index, collection); - }); - return accumulator; - } - - /** - * The base implementation of `_.sortBy` which uses `comparer` to define the - * sort order of `array` and replaces criteria objects with their corresponding - * values. - * - * @private - * @param {Array} array The array to sort. - * @param {Function} comparer The function to define sort order. - * @returns {Array} Returns `array`. - */ - function baseSortBy(array, comparer) { - var length = array.length; - - array.sort(comparer); - while (length--) { - array[length] = array[length].value; - } - return array; - } - - /** - * The base implementation of `_.sum` and `_.sumBy` without support for - * iteratee shorthands. - * - * @private - * @param {Array} array The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {number} Returns the sum. - */ - function baseSum(array, iteratee) { - var result, - index = -1, - length = array.length; - - while (++index < length) { - var current = iteratee(array[index]); - if (current !== undefined) { - result = result === undefined ? current : (result + current); - } - } - return result; - } - - /** - * The base implementation of `_.times` without support for iteratee shorthands - * or max array length checks. - * - * @private - * @param {number} n The number of times to invoke `iteratee`. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns the array of results. - */ - function baseTimes(n, iteratee) { - var index = -1, - result = Array(n); - - while (++index < n) { - result[index] = iteratee(index); - } - return result; - } - - /** - * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array - * of key-value pairs for `object` corresponding to the property names of `props`. - * - * @private - * @param {Object} object The object to query. - * @param {Array} props The property names to get values for. - * @returns {Object} Returns the key-value pairs. - */ - function baseToPairs(object, props) { - return arrayMap(props, function(key) { - return [key, object[key]]; - }); - } - - /** - * The base implementation of `_.trim`. - * - * @private - * @param {string} string The string to trim. - * @returns {string} Returns the trimmed string. - */ - function baseTrim(string) { - return string - ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '') - : string; - } - - /** - * The base implementation of `_.unary` without support for storing metadata. - * - * @private - * @param {Function} func The function to cap arguments for. - * @returns {Function} Returns the new capped function. - */ - function baseUnary(func) { - return function(value) { - return func(value); - }; - } - - /** - * The base implementation of `_.values` and `_.valuesIn` which creates an - * array of `object` property values corresponding to the property names - * of `props`. - * - * @private - * @param {Object} object The object to query. - * @param {Array} props The property names to get values for. - * @returns {Object} Returns the array of property values. - */ - function baseValues(object, props) { - return arrayMap(props, function(key) { - return object[key]; - }); - } - - /** - * Checks if a `cache` value for `key` exists. - * - * @private - * @param {Object} cache The cache to query. - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ - function cacheHas(cache, key) { - return cache.has(key); - } - - /** - * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol - * that is not found in the character symbols. - * - * @private - * @param {Array} strSymbols The string symbols to inspect. - * @param {Array} chrSymbols The character symbols to find. - * @returns {number} Returns the index of the first unmatched string symbol. - */ - function charsStartIndex(strSymbols, chrSymbols) { - var index = -1, - length = strSymbols.length; - - while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {} - return index; - } - - /** - * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol - * that is not found in the character symbols. - * - * @private - * @param {Array} strSymbols The string symbols to inspect. - * @param {Array} chrSymbols The character symbols to find. - * @returns {number} Returns the index of the last unmatched string symbol. - */ - function charsEndIndex(strSymbols, chrSymbols) { - var index = strSymbols.length; - - while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {} - return index; - } - - /** - * Gets the number of `placeholder` occurrences in `array`. - * - * @private - * @param {Array} array The array to inspect. - * @param {*} placeholder The placeholder to search for. - * @returns {number} Returns the placeholder count. - */ - function countHolders(array, placeholder) { - var length = array.length, - result = 0; - - while (length--) { - if (array[length] === placeholder) { - ++result; - } - } - return result; - } - - /** - * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A - * letters to basic Latin letters. - * - * @private - * @param {string} letter The matched letter to deburr. - * @returns {string} Returns the deburred letter. - */ - var deburrLetter = basePropertyOf(deburredLetters); - - /** - * Used by `_.escape` to convert characters to HTML entities. - * - * @private - * @param {string} chr The matched character to escape. - * @returns {string} Returns the escaped character. - */ - var escapeHtmlChar = basePropertyOf(htmlEscapes); - - /** - * Used by `_.template` to escape characters for inclusion in compiled string literals. - * - * @private - * @param {string} chr The matched character to escape. - * @returns {string} Returns the escaped character. - */ - function escapeStringChar(chr) { - return '\\' + stringEscapes[chr]; - } - - /** - * Gets the value at `key` of `object`. - * - * @private - * @param {Object} [object] The object to query. - * @param {string} key The key of the property to get. - * @returns {*} Returns the property value. - */ - function getValue(object, key) { - return object == null ? undefined : object[key]; - } - - /** - * Checks if `string` contains Unicode symbols. - * - * @private - * @param {string} string The string to inspect. - * @returns {boolean} Returns `true` if a symbol is found, else `false`. - */ - function hasUnicode(string) { - return reHasUnicode.test(string); - } - - /** - * Checks if `string` contains a word composed of Unicode symbols. - * - * @private - * @param {string} string The string to inspect. - * @returns {boolean} Returns `true` if a word is found, else `false`. - */ - function hasUnicodeWord(string) { - return reHasUnicodeWord.test(string); - } - - /** - * Converts `iterator` to an array. - * - * @private - * @param {Object} iterator The iterator to convert. - * @returns {Array} Returns the converted array. - */ - function iteratorToArray(iterator) { - var data, - result = []; - - while (!(data = iterator.next()).done) { - result.push(data.value); - } - return result; - } - - /** - * Converts `map` to its key-value pairs. - * - * @private - * @param {Object} map The map to convert. - * @returns {Array} Returns the key-value pairs. - */ - function mapToArray(map) { - var index = -1, - result = Array(map.size); - - map.forEach(function(value, key) { - result[++index] = [key, value]; - }); - return result; - } - - /** - * Creates a unary function that invokes `func` with its argument transformed. - * - * @private - * @param {Function} func The function to wrap. - * @param {Function} transform The argument transform. - * @returns {Function} Returns the new function. - */ - function overArg(func, transform) { - return function(arg) { - return func(transform(arg)); - }; - } - - /** - * Replaces all `placeholder` elements in `array` with an internal placeholder - * and returns an array of their indexes. - * - * @private - * @param {Array} array The array to modify. - * @param {*} placeholder The placeholder to replace. - * @returns {Array} Returns the new array of placeholder indexes. - */ - function replaceHolders(array, placeholder) { - var index = -1, - length = array.length, - resIndex = 0, - result = []; - - while (++index < length) { - var value = array[index]; - if (value === placeholder || value === PLACEHOLDER) { - array[index] = PLACEHOLDER; - result[resIndex++] = index; - } - } - return result; - } - - /** - * Converts `set` to an array of its values. - * - * @private - * @param {Object} set The set to convert. - * @returns {Array} Returns the values. - */ - function setToArray(set) { - var index = -1, - result = Array(set.size); - - set.forEach(function(value) { - result[++index] = value; - }); - return result; - } - - /** - * Converts `set` to its value-value pairs. - * - * @private - * @param {Object} set The set to convert. - * @returns {Array} Returns the value-value pairs. - */ - function setToPairs(set) { - var index = -1, - result = Array(set.size); - - set.forEach(function(value) { - result[++index] = [value, value]; - }); - return result; - } - - /** - * A specialized version of `_.indexOf` which performs strict equality - * comparisons of values, i.e. `===`. - * - * @private - * @param {Array} array The array to inspect. - * @param {*} value The value to search for. - * @param {number} fromIndex The index to search from. - * @returns {number} Returns the index of the matched value, else `-1`. - */ - function strictIndexOf(array, value, fromIndex) { - var index = fromIndex - 1, - length = array.length; - - while (++index < length) { - if (array[index] === value) { - return index; - } - } - return -1; - } - - /** - * A specialized version of `_.lastIndexOf` which performs strict equality - * comparisons of values, i.e. `===`. - * - * @private - * @param {Array} array The array to inspect. - * @param {*} value The value to search for. - * @param {number} fromIndex The index to search from. - * @returns {number} Returns the index of the matched value, else `-1`. - */ - function strictLastIndexOf(array, value, fromIndex) { - var index = fromIndex + 1; - while (index--) { - if (array[index] === value) { - return index; - } - } - return index; - } - - /** - * Gets the number of symbols in `string`. - * - * @private - * @param {string} string The string to inspect. - * @returns {number} Returns the string size. - */ - function stringSize(string) { - return hasUnicode(string) - ? unicodeSize(string) - : asciiSize(string); - } - - /** - * Converts `string` to an array. - * - * @private - * @param {string} string The string to convert. - * @returns {Array} Returns the converted array. - */ - function stringToArray(string) { - return hasUnicode(string) - ? unicodeToArray(string) - : asciiToArray(string); - } - - /** - * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace - * character of `string`. - * - * @private - * @param {string} string The string to inspect. - * @returns {number} Returns the index of the last non-whitespace character. - */ - function trimmedEndIndex(string) { - var index = string.length; - - while (index-- && reWhitespace.test(string.charAt(index))) {} - return index; - } - - /** - * Used by `_.unescape` to convert HTML entities to characters. - * - * @private - * @param {string} chr The matched character to unescape. - * @returns {string} Returns the unescaped character. - */ - var unescapeHtmlChar = basePropertyOf(htmlUnescapes); - - /** - * Gets the size of a Unicode `string`. - * - * @private - * @param {string} string The string inspect. - * @returns {number} Returns the string size. - */ - function unicodeSize(string) { - var result = reUnicode.lastIndex = 0; - while (reUnicode.test(string)) { - ++result; - } - return result; - } - - /** - * Converts a Unicode `string` to an array. - * - * @private - * @param {string} string The string to convert. - * @returns {Array} Returns the converted array. - */ - function unicodeToArray(string) { - return string.match(reUnicode) || []; - } - - /** - * Splits a Unicode `string` into an array of its words. - * - * @private - * @param {string} The string to inspect. - * @returns {Array} Returns the words of `string`. - */ - function unicodeWords(string) { - return string.match(reUnicodeWord) || []; - } - - /*--------------------------------------------------------------------------*/ - - /** - * Create a new pristine `lodash` function using the `context` object. - * - * @static - * @memberOf _ - * @since 1.1.0 - * @category Util - * @param {Object} [context=root] The context object. - * @returns {Function} Returns a new `lodash` function. - * @example - * - * _.mixin({ 'foo': _.constant('foo') }); - * - * var lodash = _.runInContext(); - * lodash.mixin({ 'bar': lodash.constant('bar') }); - * - * _.isFunction(_.foo); - * // => true - * _.isFunction(_.bar); - * // => false - * - * lodash.isFunction(lodash.foo); - * // => false - * lodash.isFunction(lodash.bar); - * // => true - * - * // Create a suped-up `defer` in Node.js. - * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer; - */ - var runInContext = (function runInContext(context) { - context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps)); - - /** Built-in constructor references. */ - var Array = context.Array, - Date = context.Date, - Error = context.Error, - Function = context.Function, - Math = context.Math, - Object = context.Object, - RegExp = context.RegExp, - String = context.String, - TypeError = context.TypeError; - - /** Used for built-in method references. */ - var arrayProto = Array.prototype, - funcProto = Function.prototype, - objectProto = Object.prototype; - - /** Used to detect overreaching core-js shims. */ - var coreJsData = context['__core-js_shared__']; - - /** Used to resolve the decompiled source of functions. */ - var funcToString = funcProto.toString; - - /** Used to check objects for own properties. */ - var hasOwnProperty = objectProto.hasOwnProperty; - - /** Used to generate unique IDs. */ - var idCounter = 0; - - /** Used to detect methods masquerading as native. */ - var maskSrcKey = (function() { - var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); - return uid ? ('Symbol(src)_1.' + uid) : ''; - }()); - - /** - * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) - * of values. - */ - var nativeObjectToString = objectProto.toString; - - /** Used to infer the `Object` constructor. */ - var objectCtorString = funcToString.call(Object); - - /** Used to restore the original `_` reference in `_.noConflict`. */ - var oldDash = root._; - - /** Used to detect if a method is native. */ - var reIsNative = RegExp('^' + - funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') - .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' - ); - - /** Built-in value references. */ - var Buffer = moduleExports ? context.Buffer : undefined, - Symbol = context.Symbol, - Uint8Array = context.Uint8Array, - allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined, - getPrototype = overArg(Object.getPrototypeOf, Object), - objectCreate = Object.create, - propertyIsEnumerable = objectProto.propertyIsEnumerable, - splice = arrayProto.splice, - spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined, - symIterator = Symbol ? Symbol.iterator : undefined, - symToStringTag = Symbol ? Symbol.toStringTag : undefined; - - var defineProperty = (function() { - try { - var func = getNative(Object, 'defineProperty'); - func({}, '', {}); - return func; - } catch (e) {} - }()); - - /** Mocked built-ins. */ - var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout, - ctxNow = Date && Date.now !== root.Date.now && Date.now, - ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout; - - /* Built-in method references for those with the same name as other `lodash` methods. */ - var nativeCeil = Math.ceil, - nativeFloor = Math.floor, - nativeGetSymbols = Object.getOwnPropertySymbols, - nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined, - nativeIsFinite = context.isFinite, - nativeJoin = arrayProto.join, - nativeKeys = overArg(Object.keys, Object), - nativeMax = Math.max, - nativeMin = Math.min, - nativeNow = Date.now, - nativeParseInt = context.parseInt, - nativeRandom = Math.random, - nativeReverse = arrayProto.reverse; - - /* Built-in method references that are verified to be native. */ - var DataView = getNative(context, 'DataView'), - Map = getNative(context, 'Map'), - Promise = getNative(context, 'Promise'), - Set = getNative(context, 'Set'), - WeakMap = getNative(context, 'WeakMap'), - nativeCreate = getNative(Object, 'create'); - - /** Used to store function metadata. */ - var metaMap = WeakMap && new WeakMap; - - /** Used to lookup unminified function names. */ - var realNames = {}; - - /** Used to detect maps, sets, and weakmaps. */ - var dataViewCtorString = toSource(DataView), - mapCtorString = toSource(Map), - promiseCtorString = toSource(Promise), - setCtorString = toSource(Set), - weakMapCtorString = toSource(WeakMap); - - /** Used to convert symbols to primitives and strings. */ - var symbolProto = Symbol ? Symbol.prototype : undefined, - symbolValueOf = symbolProto ? symbolProto.valueOf : undefined, - symbolToString = symbolProto ? symbolProto.toString : undefined; - - /*------------------------------------------------------------------------*/ - - /** - * Creates a `lodash` object which wraps `value` to enable implicit method - * chain sequences. Methods that operate on and return arrays, collections, - * and functions can be chained together. Methods that retrieve a single value - * or may return a primitive value will automatically end the chain sequence - * and return the unwrapped value. Otherwise, the value must be unwrapped - * with `_#value`. - * - * Explicit chain sequences, which must be unwrapped with `_#value`, may be - * enabled using `_.chain`. - * - * The execution of chained methods is lazy, that is, it's deferred until - * `_#value` is implicitly or explicitly called. - * - * Lazy evaluation allows several methods to support shortcut fusion. - * Shortcut fusion is an optimization to merge iteratee calls; this avoids - * the creation of intermediate arrays and can greatly reduce the number of - * iteratee executions. Sections of a chain sequence qualify for shortcut - * fusion if the section is applied to an array and iteratees accept only - * one argument. The heuristic for whether a section qualifies for shortcut - * fusion is subject to change. - * - * Chaining is supported in custom builds as long as the `_#value` method is - * directly or indirectly included in the build. - * - * In addition to lodash methods, wrappers have `Array` and `String` methods. - * - * The wrapper `Array` methods are: - * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift` - * - * The wrapper `String` methods are: - * `replace` and `split` - * - * The wrapper methods that support shortcut fusion are: - * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`, - * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`, - * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray` - * - * The chainable wrapper methods are: - * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`, - * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`, - * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`, - * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`, - * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`, - * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`, - * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`, - * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`, - * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`, - * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`, - * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`, - * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`, - * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`, - * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`, - * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`, - * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`, - * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`, - * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`, - * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`, - * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`, - * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`, - * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`, - * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`, - * `zipObject`, `zipObjectDeep`, and `zipWith` - * - * The wrapper methods that are **not** chainable by default are: - * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`, - * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`, - * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`, - * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`, - * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`, - * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`, - * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`, - * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`, - * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`, - * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`, - * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`, - * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`, - * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`, - * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`, - * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`, - * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`, - * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`, - * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`, - * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`, - * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`, - * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`, - * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`, - * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`, - * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`, - * `upperFirst`, `value`, and `words` - * - * @name _ - * @constructor - * @category Seq - * @param {*} value The value to wrap in a `lodash` instance. - * @returns {Object} Returns the new `lodash` wrapper instance. - * @example - * - * function square(n) { - * return n * n; - * } - * - * var wrapped = _([1, 2, 3]); - * - * // Returns an unwrapped value. - * wrapped.reduce(_.add); - * // => 6 - * - * // Returns a wrapped value. - * var squares = wrapped.map(square); - * - * _.isArray(squares); - * // => false - * - * _.isArray(squares.value()); - * // => true - */ - function lodash(value) { - if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) { - if (value instanceof LodashWrapper) { - return value; - } - if (hasOwnProperty.call(value, '__wrapped__')) { - return wrapperClone(value); - } - } - return new LodashWrapper(value); - } - - /** - * The base implementation of `_.create` without support for assigning - * properties to the created object. - * - * @private - * @param {Object} proto The object to inherit from. - * @returns {Object} Returns the new object. - */ - var baseCreate = (function() { - function object() {} - return function(proto) { - if (!isObject(proto)) { - return {}; - } - if (objectCreate) { - return objectCreate(proto); - } - object.prototype = proto; - var result = new object; - object.prototype = undefined; - return result; - }; - }()); - - /** - * The function whose prototype chain sequence wrappers inherit from. - * - * @private - */ - function baseLodash() { - // No operation performed. - } - - /** - * The base constructor for creating `lodash` wrapper objects. - * - * @private - * @param {*} value The value to wrap. - * @param {boolean} [chainAll] Enable explicit method chain sequences. - */ - function LodashWrapper(value, chainAll) { - this.__wrapped__ = value; - this.__actions__ = []; - this.__chain__ = !!chainAll; - this.__index__ = 0; - this.__values__ = undefined; - } - - /** - * By default, the template delimiters used by lodash are like those in - * embedded Ruby (ERB) as well as ES2015 template strings. Change the - * following template settings to use alternative delimiters. - * - * @static - * @memberOf _ - * @type {Object} - */ - lodash.templateSettings = { - - /** - * Used to detect `data` property values to be HTML-escaped. - * - * @memberOf _.templateSettings - * @type {RegExp} - */ - 'escape': reEscape, - - /** - * Used to detect code to be evaluated. - * - * @memberOf _.templateSettings - * @type {RegExp} - */ - 'evaluate': reEvaluate, - - /** - * Used to detect `data` property values to inject. - * - * @memberOf _.templateSettings - * @type {RegExp} - */ - 'interpolate': reInterpolate, - - /** - * Used to reference the data object in the template text. - * - * @memberOf _.templateSettings - * @type {string} - */ - 'variable': '', - - /** - * Used to import variables into the compiled template. - * - * @memberOf _.templateSettings - * @type {Object} - */ - 'imports': { - - /** - * A reference to the `lodash` function. - * - * @memberOf _.templateSettings.imports - * @type {Function} - */ - '_': lodash - } - }; - - // Ensure wrappers are instances of `baseLodash`. - lodash.prototype = baseLodash.prototype; - lodash.prototype.constructor = lodash; - - LodashWrapper.prototype = baseCreate(baseLodash.prototype); - LodashWrapper.prototype.constructor = LodashWrapper; - - /*------------------------------------------------------------------------*/ - - /** - * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation. - * - * @private - * @constructor - * @param {*} value The value to wrap. - */ - function LazyWrapper(value) { - this.__wrapped__ = value; - this.__actions__ = []; - this.__dir__ = 1; - this.__filtered__ = false; - this.__iteratees__ = []; - this.__takeCount__ = MAX_ARRAY_LENGTH; - this.__views__ = []; - } - - /** - * Creates a clone of the lazy wrapper object. - * - * @private - * @name clone - * @memberOf LazyWrapper - * @returns {Object} Returns the cloned `LazyWrapper` object. - */ - function lazyClone() { - var result = new LazyWrapper(this.__wrapped__); - result.__actions__ = copyArray(this.__actions__); - result.__dir__ = this.__dir__; - result.__filtered__ = this.__filtered__; - result.__iteratees__ = copyArray(this.__iteratees__); - result.__takeCount__ = this.__takeCount__; - result.__views__ = copyArray(this.__views__); - return result; - } - - /** - * Reverses the direction of lazy iteration. - * - * @private - * @name reverse - * @memberOf LazyWrapper - * @returns {Object} Returns the new reversed `LazyWrapper` object. - */ - function lazyReverse() { - if (this.__filtered__) { - var result = new LazyWrapper(this); - result.__dir__ = -1; - result.__filtered__ = true; - } else { - result = this.clone(); - result.__dir__ *= -1; - } - return result; - } - - /** - * Extracts the unwrapped value from its lazy wrapper. - * - * @private - * @name value - * @memberOf LazyWrapper - * @returns {*} Returns the unwrapped value. - */ - function lazyValue() { - var array = this.__wrapped__.value(), - dir = this.__dir__, - isArr = isArray(array), - isRight = dir < 0, - arrLength = isArr ? array.length : 0, - view = getView(0, arrLength, this.__views__), - start = view.start, - end = view.end, - length = end - start, - index = isRight ? end : (start - 1), - iteratees = this.__iteratees__, - iterLength = iteratees.length, - resIndex = 0, - takeCount = nativeMin(length, this.__takeCount__); - - if (!isArr || (!isRight && arrLength == length && takeCount == length)) { - return baseWrapperValue(array, this.__actions__); - } - var result = []; - - outer: - while (length-- && resIndex < takeCount) { - index += dir; - - var iterIndex = -1, - value = array[index]; - - while (++iterIndex < iterLength) { - var data = iteratees[iterIndex], - iteratee = data.iteratee, - type = data.type, - computed = iteratee(value); - - if (type == LAZY_MAP_FLAG) { - value = computed; - } else if (!computed) { - if (type == LAZY_FILTER_FLAG) { - continue outer; - } else { - break outer; - } - } - } - result[resIndex++] = value; - } - return result; - } - - // Ensure `LazyWrapper` is an instance of `baseLodash`. - LazyWrapper.prototype = baseCreate(baseLodash.prototype); - LazyWrapper.prototype.constructor = LazyWrapper; - - /*------------------------------------------------------------------------*/ - - /** - * Creates a hash object. - * - * @private - * @constructor - * @param {Array} [entries] The key-value pairs to cache. - */ - function Hash(entries) { - var index = -1, - length = entries == null ? 0 : entries.length; - - this.clear(); - while (++index < length) { - var entry = entries[index]; - this.set(entry[0], entry[1]); - } - } - - /** - * Removes all key-value entries from the hash. - * - * @private - * @name clear - * @memberOf Hash - */ - function hashClear() { - this.__data__ = nativeCreate ? nativeCreate(null) : {}; - this.size = 0; - } - - /** - * Removes `key` and its value from the hash. - * - * @private - * @name delete - * @memberOf Hash - * @param {Object} hash The hash to modify. - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */ - function hashDelete(key) { - var result = this.has(key) && delete this.__data__[key]; - this.size -= result ? 1 : 0; - return result; - } - - /** - * Gets the hash value for `key`. - * - * @private - * @name get - * @memberOf Hash - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ - function hashGet(key) { - var data = this.__data__; - if (nativeCreate) { - var result = data[key]; - return result === HASH_UNDEFINED ? undefined : result; - } - return hasOwnProperty.call(data, key) ? data[key] : undefined; - } - - /** - * Checks if a hash value for `key` exists. - * - * @private - * @name has - * @memberOf Hash - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ - function hashHas(key) { - var data = this.__data__; - return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key); - } - - /** - * Sets the hash `key` to `value`. - * - * @private - * @name set - * @memberOf Hash - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - * @returns {Object} Returns the hash instance. - */ - function hashSet(key, value) { - var data = this.__data__; - this.size += this.has(key) ? 0 : 1; - data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; - return this; - } - - // Add methods to `Hash`. - Hash.prototype.clear = hashClear; - Hash.prototype['delete'] = hashDelete; - Hash.prototype.get = hashGet; - Hash.prototype.has = hashHas; - Hash.prototype.set = hashSet; - - /*------------------------------------------------------------------------*/ - - /** - * Creates an list cache object. - * - * @private - * @constructor - * @param {Array} [entries] The key-value pairs to cache. - */ - function ListCache(entries) { - var index = -1, - length = entries == null ? 0 : entries.length; - - this.clear(); - while (++index < length) { - var entry = entries[index]; - this.set(entry[0], entry[1]); - } - } - - /** - * Removes all key-value entries from the list cache. - * - * @private - * @name clear - * @memberOf ListCache - */ - function listCacheClear() { - this.__data__ = []; - this.size = 0; - } - - /** - * Removes `key` and its value from the list cache. - * - * @private - * @name delete - * @memberOf ListCache - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */ - function listCacheDelete(key) { - var data = this.__data__, - index = assocIndexOf(data, key); - - if (index < 0) { - return false; - } - var lastIndex = data.length - 1; - if (index == lastIndex) { - data.pop(); - } else { - splice.call(data, index, 1); - } - --this.size; - return true; - } - - /** - * Gets the list cache value for `key`. - * - * @private - * @name get - * @memberOf ListCache - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ - function listCacheGet(key) { - var data = this.__data__, - index = assocIndexOf(data, key); - - return index < 0 ? undefined : data[index][1]; - } - - /** - * Checks if a list cache value for `key` exists. - * - * @private - * @name has - * @memberOf ListCache - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ - function listCacheHas(key) { - return assocIndexOf(this.__data__, key) > -1; - } - - /** - * Sets the list cache `key` to `value`. - * - * @private - * @name set - * @memberOf ListCache - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - * @returns {Object} Returns the list cache instance. - */ - function listCacheSet(key, value) { - var data = this.__data__, - index = assocIndexOf(data, key); - - if (index < 0) { - ++this.size; - data.push([key, value]); - } else { - data[index][1] = value; - } - return this; - } - - // Add methods to `ListCache`. - ListCache.prototype.clear = listCacheClear; - ListCache.prototype['delete'] = listCacheDelete; - ListCache.prototype.get = listCacheGet; - ListCache.prototype.has = listCacheHas; - ListCache.prototype.set = listCacheSet; - - /*------------------------------------------------------------------------*/ - - /** - * Creates a map cache object to store key-value pairs. - * - * @private - * @constructor - * @param {Array} [entries] The key-value pairs to cache. - */ - function MapCache(entries) { - var index = -1, - length = entries == null ? 0 : entries.length; - - this.clear(); - while (++index < length) { - var entry = entries[index]; - this.set(entry[0], entry[1]); - } - } - - /** - * Removes all key-value entries from the map. - * - * @private - * @name clear - * @memberOf MapCache - */ - function mapCacheClear() { - this.size = 0; - this.__data__ = { - 'hash': new Hash, - 'map': new (Map || ListCache), - 'string': new Hash - }; - } - - /** - * Removes `key` and its value from the map. - * - * @private - * @name delete - * @memberOf MapCache - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */ - function mapCacheDelete(key) { - var result = getMapData(this, key)['delete'](key); - this.size -= result ? 1 : 0; - return result; - } - - /** - * Gets the map value for `key`. - * - * @private - * @name get - * @memberOf MapCache - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ - function mapCacheGet(key) { - return getMapData(this, key).get(key); - } - - /** - * Checks if a map value for `key` exists. - * - * @private - * @name has - * @memberOf MapCache - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ - function mapCacheHas(key) { - return getMapData(this, key).has(key); - } - - /** - * Sets the map `key` to `value`. - * - * @private - * @name set - * @memberOf MapCache - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - * @returns {Object} Returns the map cache instance. - */ - function mapCacheSet(key, value) { - var data = getMapData(this, key), - size = data.size; - - data.set(key, value); - this.size += data.size == size ? 0 : 1; - return this; - } - - // Add methods to `MapCache`. - MapCache.prototype.clear = mapCacheClear; - MapCache.prototype['delete'] = mapCacheDelete; - MapCache.prototype.get = mapCacheGet; - MapCache.prototype.has = mapCacheHas; - MapCache.prototype.set = mapCacheSet; - - /*------------------------------------------------------------------------*/ - - /** - * - * Creates an array cache object to store unique values. - * - * @private - * @constructor - * @param {Array} [values] The values to cache. - */ - function SetCache(values) { - var index = -1, - length = values == null ? 0 : values.length; - - this.__data__ = new MapCache; - while (++index < length) { - this.add(values[index]); - } - } - - /** - * Adds `value` to the array cache. - * - * @private - * @name add - * @memberOf SetCache - * @alias push - * @param {*} value The value to cache. - * @returns {Object} Returns the cache instance. - */ - function setCacheAdd(value) { - this.__data__.set(value, HASH_UNDEFINED); - return this; - } - - /** - * Checks if `value` is in the array cache. - * - * @private - * @name has - * @memberOf SetCache - * @param {*} value The value to search for. - * @returns {number} Returns `true` if `value` is found, else `false`. - */ - function setCacheHas(value) { - return this.__data__.has(value); - } - - // Add methods to `SetCache`. - SetCache.prototype.add = SetCache.prototype.push = setCacheAdd; - SetCache.prototype.has = setCacheHas; - - /*------------------------------------------------------------------------*/ - - /** - * Creates a stack cache object to store key-value pairs. - * - * @private - * @constructor - * @param {Array} [entries] The key-value pairs to cache. - */ - function Stack(entries) { - var data = this.__data__ = new ListCache(entries); - this.size = data.size; - } - - /** - * Removes all key-value entries from the stack. - * - * @private - * @name clear - * @memberOf Stack - */ - function stackClear() { - this.__data__ = new ListCache; - this.size = 0; - } - - /** - * Removes `key` and its value from the stack. - * - * @private - * @name delete - * @memberOf Stack - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */ - function stackDelete(key) { - var data = this.__data__, - result = data['delete'](key); - - this.size = data.size; - return result; - } - - /** - * Gets the stack value for `key`. - * - * @private - * @name get - * @memberOf Stack - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ - function stackGet(key) { - return this.__data__.get(key); - } - - /** - * Checks if a stack value for `key` exists. - * - * @private - * @name has - * @memberOf Stack - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ - function stackHas(key) { - return this.__data__.has(key); - } - - /** - * Sets the stack `key` to `value`. - * - * @private - * @name set - * @memberOf Stack - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - * @returns {Object} Returns the stack cache instance. - */ - function stackSet(key, value) { - var data = this.__data__; - if (data instanceof ListCache) { - var pairs = data.__data__; - if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) { - pairs.push([key, value]); - this.size = ++data.size; - return this; - } - data = this.__data__ = new MapCache(pairs); - } - data.set(key, value); - this.size = data.size; - return this; - } - - // Add methods to `Stack`. - Stack.prototype.clear = stackClear; - Stack.prototype['delete'] = stackDelete; - Stack.prototype.get = stackGet; - Stack.prototype.has = stackHas; - Stack.prototype.set = stackSet; - - /*------------------------------------------------------------------------*/ - - /** - * Creates an array of the enumerable property names of the array-like `value`. - * - * @private - * @param {*} value The value to query. - * @param {boolean} inherited Specify returning inherited property names. - * @returns {Array} Returns the array of property names. - */ - function arrayLikeKeys(value, inherited) { - var isArr = isArray(value), - isArg = !isArr && isArguments(value), - isBuff = !isArr && !isArg && isBuffer(value), - isType = !isArr && !isArg && !isBuff && isTypedArray(value), - skipIndexes = isArr || isArg || isBuff || isType, - result = skipIndexes ? baseTimes(value.length, String) : [], - length = result.length; - - for (var key in value) { - if ((inherited || hasOwnProperty.call(value, key)) && - !(skipIndexes && ( - // Safari 9 has enumerable `arguments.length` in strict mode. - key == 'length' || - // Node.js 0.10 has enumerable non-index properties on buffers. - (isBuff && (key == 'offset' || key == 'parent')) || - // PhantomJS 2 has enumerable non-index properties on typed arrays. - (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) || - // Skip index properties. - isIndex(key, length) - ))) { - result.push(key); - } - } - return result; - } - - /** - * A specialized version of `_.sample` for arrays. - * - * @private - * @param {Array} array The array to sample. - * @returns {*} Returns the random element. - */ - function arraySample(array) { - var length = array.length; - return length ? array[baseRandom(0, length - 1)] : undefined; - } - - /** - * A specialized version of `_.sampleSize` for arrays. - * - * @private - * @param {Array} array The array to sample. - * @param {number} n The number of elements to sample. - * @returns {Array} Returns the random elements. - */ - function arraySampleSize(array, n) { - return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length)); - } - - /** - * A specialized version of `_.shuffle` for arrays. - * - * @private - * @param {Array} array The array to shuffle. - * @returns {Array} Returns the new shuffled array. - */ - function arrayShuffle(array) { - return shuffleSelf(copyArray(array)); - } - - /** - * This function is like `assignValue` except that it doesn't assign - * `undefined` values. - * - * @private - * @param {Object} object The object to modify. - * @param {string} key The key of the property to assign. - * @param {*} value The value to assign. - */ - function assignMergeValue(object, key, value) { - if ((value !== undefined && !eq(object[key], value)) || - (value === undefined && !(key in object))) { - baseAssignValue(object, key, value); - } - } - - /** - * Assigns `value` to `key` of `object` if the existing value is not equivalent - * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) - * for equality comparisons. - * - * @private - * @param {Object} object The object to modify. - * @param {string} key The key of the property to assign. - * @param {*} value The value to assign. - */ - function assignValue(object, key, value) { - var objValue = object[key]; - if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || - (value === undefined && !(key in object))) { - baseAssignValue(object, key, value); - } - } - - /** - * Gets the index at which the `key` is found in `array` of key-value pairs. - * - * @private - * @param {Array} array The array to inspect. - * @param {*} key The key to search for. - * @returns {number} Returns the index of the matched value, else `-1`. - */ - function assocIndexOf(array, key) { - var length = array.length; - while (length--) { - if (eq(array[length][0], key)) { - return length; - } - } - return -1; - } - - /** - * Aggregates elements of `collection` on `accumulator` with keys transformed - * by `iteratee` and values set by `setter`. - * - * @private - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} setter The function to set `accumulator` values. - * @param {Function} iteratee The iteratee to transform keys. - * @param {Object} accumulator The initial aggregated object. - * @returns {Function} Returns `accumulator`. - */ - function baseAggregator(collection, setter, iteratee, accumulator) { - baseEach(collection, function(value, key, collection) { - setter(accumulator, value, iteratee(value), collection); - }); - return accumulator; - } - - /** - * The base implementation of `_.assign` without support for multiple sources - * or `customizer` functions. - * - * @private - * @param {Object} object The destination object. - * @param {Object} source The source object. - * @returns {Object} Returns `object`. - */ - function baseAssign(object, source) { - return object && copyObject(source, keys(source), object); - } - - /** - * The base implementation of `_.assignIn` without support for multiple sources - * or `customizer` functions. - * - * @private - * @param {Object} object The destination object. - * @param {Object} source The source object. - * @returns {Object} Returns `object`. - */ - function baseAssignIn(object, source) { - return object && copyObject(source, keysIn(source), object); - } - - /** - * The base implementation of `assignValue` and `assignMergeValue` without - * value checks. - * - * @private - * @param {Object} object The object to modify. - * @param {string} key The key of the property to assign. - * @param {*} value The value to assign. - */ - function baseAssignValue(object, key, value) { - if (key == '__proto__' && defineProperty) { - defineProperty(object, key, { - 'configurable': true, - 'enumerable': true, - 'value': value, - 'writable': true - }); - } else { - object[key] = value; - } - } - - /** - * The base implementation of `_.at` without support for individual paths. - * - * @private - * @param {Object} object The object to iterate over. - * @param {string[]} paths The property paths to pick. - * @returns {Array} Returns the picked elements. - */ - function baseAt(object, paths) { - var index = -1, - length = paths.length, - result = Array(length), - skip = object == null; - - while (++index < length) { - result[index] = skip ? undefined : get(object, paths[index]); - } - return result; - } - - /** - * The base implementation of `_.clamp` which doesn't coerce arguments. - * - * @private - * @param {number} number The number to clamp. - * @param {number} [lower] The lower bound. - * @param {number} upper The upper bound. - * @returns {number} Returns the clamped number. - */ - function baseClamp(number, lower, upper) { - if (number === number) { - if (upper !== undefined) { - number = number <= upper ? number : upper; - } - if (lower !== undefined) { - number = number >= lower ? number : lower; - } - } - return number; - } - - /** - * The base implementation of `_.clone` and `_.cloneDeep` which tracks - * traversed objects. - * - * @private - * @param {*} value The value to clone. - * @param {boolean} bitmask The bitmask flags. - * 1 - Deep clone - * 2 - Flatten inherited properties - * 4 - Clone symbols - * @param {Function} [customizer] The function to customize cloning. - * @param {string} [key] The key of `value`. - * @param {Object} [object] The parent object of `value`. - * @param {Object} [stack] Tracks traversed objects and their clone counterparts. - * @returns {*} Returns the cloned value. - */ - function baseClone(value, bitmask, customizer, key, object, stack) { - var result, - isDeep = bitmask & CLONE_DEEP_FLAG, - isFlat = bitmask & CLONE_FLAT_FLAG, - isFull = bitmask & CLONE_SYMBOLS_FLAG; - - if (customizer) { - result = object ? customizer(value, key, object, stack) : customizer(value); - } - if (result !== undefined) { - return result; - } - if (!isObject(value)) { - return value; - } - var isArr = isArray(value); - if (isArr) { - result = initCloneArray(value); - if (!isDeep) { - return copyArray(value, result); - } - } else { - var tag = getTag(value), - isFunc = tag == funcTag || tag == genTag; - - if (isBuffer(value)) { - return cloneBuffer(value, isDeep); - } - if (tag == objectTag || tag == argsTag || (isFunc && !object)) { - result = (isFlat || isFunc) ? {} : initCloneObject(value); - if (!isDeep) { - return isFlat - ? copySymbolsIn(value, baseAssignIn(result, value)) - : copySymbols(value, baseAssign(result, value)); - } - } else { - if (!cloneableTags[tag]) { - return object ? value : {}; - } - result = initCloneByTag(value, tag, isDeep); - } - } - // Check for circular references and return its corresponding clone. - stack || (stack = new Stack); - var stacked = stack.get(value); - if (stacked) { - return stacked; - } - stack.set(value, result); - - if (isSet(value)) { - value.forEach(function(subValue) { - result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack)); - }); - } else if (isMap(value)) { - value.forEach(function(subValue, key) { - result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack)); - }); - } - - var keysFunc = isFull - ? (isFlat ? getAllKeysIn : getAllKeys) - : (isFlat ? keysIn : keys); - - var props = isArr ? undefined : keysFunc(value); - arrayEach(props || value, function(subValue, key) { - if (props) { - key = subValue; - subValue = value[key]; - } - // Recursively populate clone (susceptible to call stack limits). - assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack)); - }); - return result; - } - - /** - * The base implementation of `_.conforms` which doesn't clone `source`. - * - * @private - * @param {Object} source The object of property predicates to conform to. - * @returns {Function} Returns the new spec function. - */ - function baseConforms(source) { - var props = keys(source); - return function(object) { - return baseConformsTo(object, source, props); - }; - } - - /** - * The base implementation of `_.conformsTo` which accepts `props` to check. - * - * @private - * @param {Object} object The object to inspect. - * @param {Object} source The object of property predicates to conform to. - * @returns {boolean} Returns `true` if `object` conforms, else `false`. - */ - function baseConformsTo(object, source, props) { - var length = props.length; - if (object == null) { - return !length; - } - object = Object(object); - while (length--) { - var key = props[length], - predicate = source[key], - value = object[key]; - - if ((value === undefined && !(key in object)) || !predicate(value)) { - return false; - } - } - return true; - } - - /** - * The base implementation of `_.delay` and `_.defer` which accepts `args` - * to provide to `func`. - * - * @private - * @param {Function} func The function to delay. - * @param {number} wait The number of milliseconds to delay invocation. - * @param {Array} args The arguments to provide to `func`. - * @returns {number|Object} Returns the timer id or timeout object. - */ - function baseDelay(func, wait, args) { - if (typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - return setTimeout(function() { func.apply(undefined, args); }, wait); - } - - /** - * The base implementation of methods like `_.difference` without support - * for excluding multiple arrays or iteratee shorthands. - * - * @private - * @param {Array} array The array to inspect. - * @param {Array} values The values to exclude. - * @param {Function} [iteratee] The iteratee invoked per element. - * @param {Function} [comparator] The comparator invoked per element. - * @returns {Array} Returns the new array of filtered values. - */ - function baseDifference(array, values, iteratee, comparator) { - var index = -1, - includes = arrayIncludes, - isCommon = true, - length = array.length, - result = [], - valuesLength = values.length; - - if (!length) { - return result; - } - if (iteratee) { - values = arrayMap(values, baseUnary(iteratee)); - } - if (comparator) { - includes = arrayIncludesWith; - isCommon = false; - } - else if (values.length >= LARGE_ARRAY_SIZE) { - includes = cacheHas; - isCommon = false; - values = new SetCache(values); - } - outer: - while (++index < length) { - var value = array[index], - computed = iteratee == null ? value : iteratee(value); - - value = (comparator || value !== 0) ? value : 0; - if (isCommon && computed === computed) { - var valuesIndex = valuesLength; - while (valuesIndex--) { - if (values[valuesIndex] === computed) { - continue outer; - } - } - result.push(value); - } - else if (!includes(values, computed, comparator)) { - result.push(value); - } - } - return result; - } - - /** - * The base implementation of `_.forEach` without support for iteratee shorthands. - * - * @private - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array|Object} Returns `collection`. - */ - var baseEach = createBaseEach(baseForOwn); - - /** - * The base implementation of `_.forEachRight` without support for iteratee shorthands. - * - * @private - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array|Object} Returns `collection`. - */ - var baseEachRight = createBaseEach(baseForOwnRight, true); - - /** - * The base implementation of `_.every` without support for iteratee shorthands. - * - * @private - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} predicate The function invoked per iteration. - * @returns {boolean} Returns `true` if all elements pass the predicate check, - * else `false` - */ - function baseEvery(collection, predicate) { - var result = true; - baseEach(collection, function(value, index, collection) { - result = !!predicate(value, index, collection); - return result; - }); - return result; - } - - /** - * The base implementation of methods like `_.max` and `_.min` which accepts a - * `comparator` to determine the extremum value. - * - * @private - * @param {Array} array The array to iterate over. - * @param {Function} iteratee The iteratee invoked per iteration. - * @param {Function} comparator The comparator used to compare values. - * @returns {*} Returns the extremum value. - */ - function baseExtremum(array, iteratee, comparator) { - var index = -1, - length = array.length; - - while (++index < length) { - var value = array[index], - current = iteratee(value); - - if (current != null && (computed === undefined - ? (current === current && !isSymbol(current)) - : comparator(current, computed) - )) { - var computed = current, - result = value; - } - } - return result; - } - - /** - * The base implementation of `_.fill` without an iteratee call guard. - * - * @private - * @param {Array} array The array to fill. - * @param {*} value The value to fill `array` with. - * @param {number} [start=0] The start position. - * @param {number} [end=array.length] The end position. - * @returns {Array} Returns `array`. - */ - function baseFill(array, value, start, end) { - var length = array.length; - - start = toInteger(start); - if (start < 0) { - start = -start > length ? 0 : (length + start); - } - end = (end === undefined || end > length) ? length : toInteger(end); - if (end < 0) { - end += length; - } - end = start > end ? 0 : toLength(end); - while (start < end) { - array[start++] = value; - } - return array; - } - - /** - * The base implementation of `_.filter` without support for iteratee shorthands. - * - * @private - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} predicate The function invoked per iteration. - * @returns {Array} Returns the new filtered array. - */ - function baseFilter(collection, predicate) { - var result = []; - baseEach(collection, function(value, index, collection) { - if (predicate(value, index, collection)) { - result.push(value); - } - }); - return result; - } - - /** - * The base implementation of `_.flatten` with support for restricting flattening. - * - * @private - * @param {Array} array The array to flatten. - * @param {number} depth The maximum recursion depth. - * @param {boolean} [predicate=isFlattenable] The function invoked per iteration. - * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks. - * @param {Array} [result=[]] The initial result value. - * @returns {Array} Returns the new flattened array. - */ - function baseFlatten(array, depth, predicate, isStrict, result) { - var index = -1, - length = array.length; - - predicate || (predicate = isFlattenable); - result || (result = []); - - while (++index < length) { - var value = array[index]; - if (depth > 0 && predicate(value)) { - if (depth > 1) { - // Recursively flatten arrays (susceptible to call stack limits). - baseFlatten(value, depth - 1, predicate, isStrict, result); - } else { - arrayPush(result, value); - } - } else if (!isStrict) { - result[result.length] = value; - } - } - return result; - } - - /** - * The base implementation of `baseForOwn` which iterates over `object` - * properties returned by `keysFunc` and invokes `iteratee` for each property. - * Iteratee functions may exit iteration early by explicitly returning `false`. - * - * @private - * @param {Object} object The object to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @param {Function} keysFunc The function to get the keys of `object`. - * @returns {Object} Returns `object`. - */ - var baseFor = createBaseFor(); - - /** - * This function is like `baseFor` except that it iterates over properties - * in the opposite order. - * - * @private - * @param {Object} object The object to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @param {Function} keysFunc The function to get the keys of `object`. - * @returns {Object} Returns `object`. - */ - var baseForRight = createBaseFor(true); - - /** - * The base implementation of `_.forOwn` without support for iteratee shorthands. - * - * @private - * @param {Object} object The object to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Object} Returns `object`. - */ - function baseForOwn(object, iteratee) { - return object && baseFor(object, iteratee, keys); - } - - /** - * The base implementation of `_.forOwnRight` without support for iteratee shorthands. - * - * @private - * @param {Object} object The object to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Object} Returns `object`. - */ - function baseForOwnRight(object, iteratee) { - return object && baseForRight(object, iteratee, keys); - } - - /** - * The base implementation of `_.functions` which creates an array of - * `object` function property names filtered from `props`. - * - * @private - * @param {Object} object The object to inspect. - * @param {Array} props The property names to filter. - * @returns {Array} Returns the function names. - */ - function baseFunctions(object, props) { - return arrayFilter(props, function(key) { - return isFunction(object[key]); - }); - } - - /** - * The base implementation of `_.get` without support for default values. - * - * @private - * @param {Object} object The object to query. - * @param {Array|string} path The path of the property to get. - * @returns {*} Returns the resolved value. - */ - function baseGet(object, path) { - path = castPath(path, object); - - var index = 0, - length = path.length; - - while (object != null && index < length) { - object = object[toKey(path[index++])]; - } - return (index && index == length) ? object : undefined; - } - - /** - * The base implementation of `getAllKeys` and `getAllKeysIn` which uses - * `keysFunc` and `symbolsFunc` to get the enumerable property names and - * symbols of `object`. - * - * @private - * @param {Object} object The object to query. - * @param {Function} keysFunc The function to get the keys of `object`. - * @param {Function} symbolsFunc The function to get the symbols of `object`. - * @returns {Array} Returns the array of property names and symbols. - */ - function baseGetAllKeys(object, keysFunc, symbolsFunc) { - var result = keysFunc(object); - return isArray(object) ? result : arrayPush(result, symbolsFunc(object)); - } - - /** - * The base implementation of `getTag` without fallbacks for buggy environments. - * - * @private - * @param {*} value The value to query. - * @returns {string} Returns the `toStringTag`. - */ - function baseGetTag(value) { - if (value == null) { - return value === undefined ? undefinedTag : nullTag; - } - return (symToStringTag && symToStringTag in Object(value)) - ? getRawTag(value) - : objectToString(value); - } - - /** - * The base implementation of `_.gt` which doesn't coerce arguments. - * - * @private - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if `value` is greater than `other`, - * else `false`. - */ - function baseGt(value, other) { - return value > other; - } - - /** - * The base implementation of `_.has` without support for deep paths. - * - * @private - * @param {Object} [object] The object to query. - * @param {Array|string} key The key to check. - * @returns {boolean} Returns `true` if `key` exists, else `false`. - */ - function baseHas(object, key) { - return object != null && hasOwnProperty.call(object, key); - } - - /** - * The base implementation of `_.hasIn` without support for deep paths. - * - * @private - * @param {Object} [object] The object to query. - * @param {Array|string} key The key to check. - * @returns {boolean} Returns `true` if `key` exists, else `false`. - */ - function baseHasIn(object, key) { - return object != null && key in Object(object); - } - - /** - * The base implementation of `_.inRange` which doesn't coerce arguments. - * - * @private - * @param {number} number The number to check. - * @param {number} start The start of the range. - * @param {number} end The end of the range. - * @returns {boolean} Returns `true` if `number` is in the range, else `false`. - */ - function baseInRange(number, start, end) { - return number >= nativeMin(start, end) && number < nativeMax(start, end); - } - - /** - * The base implementation of methods like `_.intersection`, without support - * for iteratee shorthands, that accepts an array of arrays to inspect. - * - * @private - * @param {Array} arrays The arrays to inspect. - * @param {Function} [iteratee] The iteratee invoked per element. - * @param {Function} [comparator] The comparator invoked per element. - * @returns {Array} Returns the new array of shared values. - */ - function baseIntersection(arrays, iteratee, comparator) { - var includes = comparator ? arrayIncludesWith : arrayIncludes, - length = arrays[0].length, - othLength = arrays.length, - othIndex = othLength, - caches = Array(othLength), - maxLength = Infinity, - result = []; - - while (othIndex--) { - var array = arrays[othIndex]; - if (othIndex && iteratee) { - array = arrayMap(array, baseUnary(iteratee)); - } - maxLength = nativeMin(array.length, maxLength); - caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120)) - ? new SetCache(othIndex && array) - : undefined; - } - array = arrays[0]; - - var index = -1, - seen = caches[0]; - - outer: - while (++index < length && result.length < maxLength) { - var value = array[index], - computed = iteratee ? iteratee(value) : value; - - value = (comparator || value !== 0) ? value : 0; - if (!(seen - ? cacheHas(seen, computed) - : includes(result, computed, comparator) - )) { - othIndex = othLength; - while (--othIndex) { - var cache = caches[othIndex]; - if (!(cache - ? cacheHas(cache, computed) - : includes(arrays[othIndex], computed, comparator)) - ) { - continue outer; - } - } - if (seen) { - seen.push(computed); - } - result.push(value); - } - } - return result; - } - - /** - * The base implementation of `_.invert` and `_.invertBy` which inverts - * `object` with values transformed by `iteratee` and set by `setter`. - * - * @private - * @param {Object} object The object to iterate over. - * @param {Function} setter The function to set `accumulator` values. - * @param {Function} iteratee The iteratee to transform values. - * @param {Object} accumulator The initial inverted object. - * @returns {Function} Returns `accumulator`. - */ - function baseInverter(object, setter, iteratee, accumulator) { - baseForOwn(object, function(value, key, object) { - setter(accumulator, iteratee(value), key, object); - }); - return accumulator; - } - - /** - * The base implementation of `_.invoke` without support for individual - * method arguments. - * - * @private - * @param {Object} object The object to query. - * @param {Array|string} path The path of the method to invoke. - * @param {Array} args The arguments to invoke the method with. - * @returns {*} Returns the result of the invoked method. - */ - function baseInvoke(object, path, args) { - path = castPath(path, object); - object = parent(object, path); - var func = object == null ? object : object[toKey(last(path))]; - return func == null ? undefined : apply(func, object, args); - } - - /** - * The base implementation of `_.isArguments`. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an `arguments` object, - */ - function baseIsArguments(value) { - return isObjectLike(value) && baseGetTag(value) == argsTag; - } - - /** - * The base implementation of `_.isArrayBuffer` without Node.js optimizations. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`. - */ - function baseIsArrayBuffer(value) { - return isObjectLike(value) && baseGetTag(value) == arrayBufferTag; - } - - /** - * The base implementation of `_.isDate` without Node.js optimizations. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a date object, else `false`. - */ - function baseIsDate(value) { - return isObjectLike(value) && baseGetTag(value) == dateTag; - } - - /** - * The base implementation of `_.isEqual` which supports partial comparisons - * and tracks traversed objects. - * - * @private - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @param {boolean} bitmask The bitmask flags. - * 1 - Unordered comparison - * 2 - Partial comparison - * @param {Function} [customizer] The function to customize comparisons. - * @param {Object} [stack] Tracks traversed `value` and `other` objects. - * @returns {boolean} Returns `true` if the values are equivalent, else `false`. - */ - function baseIsEqual(value, other, bitmask, customizer, stack) { - if (value === other) { - return true; - } - if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) { - return value !== value && other !== other; - } - return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack); - } - - /** - * A specialized version of `baseIsEqual` for arrays and objects which performs - * deep comparisons and tracks traversed objects enabling objects with circular - * references to be compared. - * - * @private - * @param {Object} object The object to compare. - * @param {Object} other The other object to compare. - * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. - * @param {Function} customizer The function to customize comparisons. - * @param {Function} equalFunc The function to determine equivalents of values. - * @param {Object} [stack] Tracks traversed `object` and `other` objects. - * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. - */ - function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) { - var objIsArr = isArray(object), - othIsArr = isArray(other), - objTag = objIsArr ? arrayTag : getTag(object), - othTag = othIsArr ? arrayTag : getTag(other); - - objTag = objTag == argsTag ? objectTag : objTag; - othTag = othTag == argsTag ? objectTag : othTag; - - var objIsObj = objTag == objectTag, - othIsObj = othTag == objectTag, - isSameTag = objTag == othTag; - - if (isSameTag && isBuffer(object)) { - if (!isBuffer(other)) { - return false; - } - objIsArr = true; - objIsObj = false; - } - if (isSameTag && !objIsObj) { - stack || (stack = new Stack); - return (objIsArr || isTypedArray(object)) - ? equalArrays(object, other, bitmask, customizer, equalFunc, stack) - : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack); - } - if (!(bitmask & COMPARE_PARTIAL_FLAG)) { - var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'), - othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__'); - - if (objIsWrapped || othIsWrapped) { - var objUnwrapped = objIsWrapped ? object.value() : object, - othUnwrapped = othIsWrapped ? other.value() : other; - - stack || (stack = new Stack); - return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack); - } - } - if (!isSameTag) { - return false; - } - stack || (stack = new Stack); - return equalObjects(object, other, bitmask, customizer, equalFunc, stack); - } - - /** - * The base implementation of `_.isMap` without Node.js optimizations. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a map, else `false`. - */ - function baseIsMap(value) { - return isObjectLike(value) && getTag(value) == mapTag; - } - - /** - * The base implementation of `_.isMatch` without support for iteratee shorthands. - * - * @private - * @param {Object} object The object to inspect. - * @param {Object} source The object of property values to match. - * @param {Array} matchData The property names, values, and compare flags to match. - * @param {Function} [customizer] The function to customize comparisons. - * @returns {boolean} Returns `true` if `object` is a match, else `false`. - */ - function baseIsMatch(object, source, matchData, customizer) { - var index = matchData.length, - length = index, - noCustomizer = !customizer; - - if (object == null) { - return !length; - } - object = Object(object); - while (index--) { - var data = matchData[index]; - if ((noCustomizer && data[2]) - ? data[1] !== object[data[0]] - : !(data[0] in object) - ) { - return false; - } - } - while (++index < length) { - data = matchData[index]; - var key = data[0], - objValue = object[key], - srcValue = data[1]; - - if (noCustomizer && data[2]) { - if (objValue === undefined && !(key in object)) { - return false; - } - } else { - var stack = new Stack; - if (customizer) { - var result = customizer(objValue, srcValue, key, object, source, stack); - } - if (!(result === undefined - ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack) - : result - )) { - return false; - } - } - } - return true; - } - - /** - * The base implementation of `_.isNative` without bad shim checks. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a native function, - * else `false`. - */ - function baseIsNative(value) { - if (!isObject(value) || isMasked(value)) { - return false; - } - var pattern = isFunction(value) ? reIsNative : reIsHostCtor; - return pattern.test(toSource(value)); - } - - /** - * The base implementation of `_.isRegExp` without Node.js optimizations. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a regexp, else `false`. - */ - function baseIsRegExp(value) { - return isObjectLike(value) && baseGetTag(value) == regexpTag; - } - - /** - * The base implementation of `_.isSet` without Node.js optimizations. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a set, else `false`. - */ - function baseIsSet(value) { - return isObjectLike(value) && getTag(value) == setTag; - } - - /** - * The base implementation of `_.isTypedArray` without Node.js optimizations. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. - */ - function baseIsTypedArray(value) { - return isObjectLike(value) && - isLength(value.length) && !!typedArrayTags[baseGetTag(value)]; - } - - /** - * The base implementation of `_.iteratee`. - * - * @private - * @param {*} [value=_.identity] The value to convert to an iteratee. - * @returns {Function} Returns the iteratee. - */ - function baseIteratee(value) { - // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9. - // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details. - if (typeof value == 'function') { - return value; - } - if (value == null) { - return identity; - } - if (typeof value == 'object') { - return isArray(value) - ? baseMatchesProperty(value[0], value[1]) - : baseMatches(value); - } - return property(value); - } - - /** - * The base implementation of `_.keys` which doesn't treat sparse arrays as dense. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. - */ - function baseKeys(object) { - if (!isPrototype(object)) { - return nativeKeys(object); - } - var result = []; - for (var key in Object(object)) { - if (hasOwnProperty.call(object, key) && key != 'constructor') { - result.push(key); - } - } - return result; - } - - /** - * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. - */ - function baseKeysIn(object) { - if (!isObject(object)) { - return nativeKeysIn(object); - } - var isProto = isPrototype(object), - result = []; - - for (var key in object) { - if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) { - result.push(key); - } - } - return result; - } - - /** - * The base implementation of `_.lt` which doesn't coerce arguments. - * - * @private - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if `value` is less than `other`, - * else `false`. - */ - function baseLt(value, other) { - return value < other; - } - - /** - * The base implementation of `_.map` without support for iteratee shorthands. - * - * @private - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns the new mapped array. - */ - function baseMap(collection, iteratee) { - var index = -1, - result = isArrayLike(collection) ? Array(collection.length) : []; - - baseEach(collection, function(value, key, collection) { - result[++index] = iteratee(value, key, collection); - }); - return result; - } - - /** - * The base implementation of `_.matches` which doesn't clone `source`. - * - * @private - * @param {Object} source The object of property values to match. - * @returns {Function} Returns the new spec function. - */ - function baseMatches(source) { - var matchData = getMatchData(source); - if (matchData.length == 1 && matchData[0][2]) { - return matchesStrictComparable(matchData[0][0], matchData[0][1]); - } - return function(object) { - return object === source || baseIsMatch(object, source, matchData); - }; - } - - /** - * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`. - * - * @private - * @param {string} path The path of the property to get. - * @param {*} srcValue The value to match. - * @returns {Function} Returns the new spec function. - */ - function baseMatchesProperty(path, srcValue) { - if (isKey(path) && isStrictComparable(srcValue)) { - return matchesStrictComparable(toKey(path), srcValue); - } - return function(object) { - var objValue = get(object, path); - return (objValue === undefined && objValue === srcValue) - ? hasIn(object, path) - : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG); - }; - } - - /** - * The base implementation of `_.merge` without support for multiple sources. - * - * @private - * @param {Object} object The destination object. - * @param {Object} source The source object. - * @param {number} srcIndex The index of `source`. - * @param {Function} [customizer] The function to customize merged values. - * @param {Object} [stack] Tracks traversed source values and their merged - * counterparts. - */ - function baseMerge(object, source, srcIndex, customizer, stack) { - if (object === source) { - return; - } - baseFor(source, function(srcValue, key) { - stack || (stack = new Stack); - if (isObject(srcValue)) { - baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack); - } - else { - var newValue = customizer - ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack) - : undefined; - - if (newValue === undefined) { - newValue = srcValue; - } - assignMergeValue(object, key, newValue); - } - }, keysIn); - } - - /** - * A specialized version of `baseMerge` for arrays and objects which performs - * deep merges and tracks traversed objects enabling objects with circular - * references to be merged. - * - * @private - * @param {Object} object The destination object. - * @param {Object} source The source object. - * @param {string} key The key of the value to merge. - * @param {number} srcIndex The index of `source`. - * @param {Function} mergeFunc The function to merge values. - * @param {Function} [customizer] The function to customize assigned values. - * @param {Object} [stack] Tracks traversed source values and their merged - * counterparts. - */ - function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) { - var objValue = safeGet(object, key), - srcValue = safeGet(source, key), - stacked = stack.get(srcValue); - - if (stacked) { - assignMergeValue(object, key, stacked); - return; - } - var newValue = customizer - ? customizer(objValue, srcValue, (key + ''), object, source, stack) - : undefined; - - var isCommon = newValue === undefined; - - if (isCommon) { - var isArr = isArray(srcValue), - isBuff = !isArr && isBuffer(srcValue), - isTyped = !isArr && !isBuff && isTypedArray(srcValue); - - newValue = srcValue; - if (isArr || isBuff || isTyped) { - if (isArray(objValue)) { - newValue = objValue; - } - else if (isArrayLikeObject(objValue)) { - newValue = copyArray(objValue); - } - else if (isBuff) { - isCommon = false; - newValue = cloneBuffer(srcValue, true); - } - else if (isTyped) { - isCommon = false; - newValue = cloneTypedArray(srcValue, true); - } - else { - newValue = []; - } - } - else if (isPlainObject(srcValue) || isArguments(srcValue)) { - newValue = objValue; - if (isArguments(objValue)) { - newValue = toPlainObject(objValue); - } - else if (!isObject(objValue) || isFunction(objValue)) { - newValue = initCloneObject(srcValue); - } - } - else { - isCommon = false; - } - } - if (isCommon) { - // Recursively merge objects and arrays (susceptible to call stack limits). - stack.set(srcValue, newValue); - mergeFunc(newValue, srcValue, srcIndex, customizer, stack); - stack['delete'](srcValue); - } - assignMergeValue(object, key, newValue); - } - - /** - * The base implementation of `_.nth` which doesn't coerce arguments. - * - * @private - * @param {Array} array The array to query. - * @param {number} n The index of the element to return. - * @returns {*} Returns the nth element of `array`. - */ - function baseNth(array, n) { - var length = array.length; - if (!length) { - return; - } - n += n < 0 ? length : 0; - return isIndex(n, length) ? array[n] : undefined; - } - - /** - * The base implementation of `_.orderBy` without param guards. - * - * @private - * @param {Array|Object} collection The collection to iterate over. - * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by. - * @param {string[]} orders The sort orders of `iteratees`. - * @returns {Array} Returns the new sorted array. - */ - function baseOrderBy(collection, iteratees, orders) { - if (iteratees.length) { - iteratees = arrayMap(iteratees, function(iteratee) { - if (isArray(iteratee)) { - return function(value) { - return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee); - } - } - return iteratee; - }); - } else { - iteratees = [identity]; - } - - var index = -1; - iteratees = arrayMap(iteratees, baseUnary(getIteratee())); - - var result = baseMap(collection, function(value, key, collection) { - var criteria = arrayMap(iteratees, function(iteratee) { - return iteratee(value); - }); - return { 'criteria': criteria, 'index': ++index, 'value': value }; - }); - - return baseSortBy(result, function(object, other) { - return compareMultiple(object, other, orders); - }); - } - - /** - * The base implementation of `_.pick` without support for individual - * property identifiers. - * - * @private - * @param {Object} object The source object. - * @param {string[]} paths The property paths to pick. - * @returns {Object} Returns the new object. - */ - function basePick(object, paths) { - return basePickBy(object, paths, function(value, path) { - return hasIn(object, path); - }); - } - - /** - * The base implementation of `_.pickBy` without support for iteratee shorthands. - * - * @private - * @param {Object} object The source object. - * @param {string[]} paths The property paths to pick. - * @param {Function} predicate The function invoked per property. - * @returns {Object} Returns the new object. - */ - function basePickBy(object, paths, predicate) { - var index = -1, - length = paths.length, - result = {}; - - while (++index < length) { - var path = paths[index], - value = baseGet(object, path); - - if (predicate(value, path)) { - baseSet(result, castPath(path, object), value); - } - } - return result; - } - - /** - * A specialized version of `baseProperty` which supports deep paths. - * - * @private - * @param {Array|string} path The path of the property to get. - * @returns {Function} Returns the new accessor function. - */ - function basePropertyDeep(path) { - return function(object) { - return baseGet(object, path); - }; - } - - /** - * The base implementation of `_.pullAllBy` without support for iteratee - * shorthands. - * - * @private - * @param {Array} array The array to modify. - * @param {Array} values The values to remove. - * @param {Function} [iteratee] The iteratee invoked per element. - * @param {Function} [comparator] The comparator invoked per element. - * @returns {Array} Returns `array`. - */ - function basePullAll(array, values, iteratee, comparator) { - var indexOf = comparator ? baseIndexOfWith : baseIndexOf, - index = -1, - length = values.length, - seen = array; - - if (array === values) { - values = copyArray(values); - } - if (iteratee) { - seen = arrayMap(array, baseUnary(iteratee)); - } - while (++index < length) { - var fromIndex = 0, - value = values[index], - computed = iteratee ? iteratee(value) : value; - - while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) { - if (seen !== array) { - splice.call(seen, fromIndex, 1); - } - splice.call(array, fromIndex, 1); - } - } - return array; - } - - /** - * The base implementation of `_.pullAt` without support for individual - * indexes or capturing the removed elements. - * - * @private - * @param {Array} array The array to modify. - * @param {number[]} indexes The indexes of elements to remove. - * @returns {Array} Returns `array`. - */ - function basePullAt(array, indexes) { - var length = array ? indexes.length : 0, - lastIndex = length - 1; - - while (length--) { - var index = indexes[length]; - if (length == lastIndex || index !== previous) { - var previous = index; - if (isIndex(index)) { - splice.call(array, index, 1); - } else { - baseUnset(array, index); - } - } - } - return array; - } - - /** - * The base implementation of `_.random` without support for returning - * floating-point numbers. - * - * @private - * @param {number} lower The lower bound. - * @param {number} upper The upper bound. - * @returns {number} Returns the random number. - */ - function baseRandom(lower, upper) { - return lower + nativeFloor(nativeRandom() * (upper - lower + 1)); - } - - /** - * The base implementation of `_.range` and `_.rangeRight` which doesn't - * coerce arguments. - * - * @private - * @param {number} start The start of the range. - * @param {number} end The end of the range. - * @param {number} step The value to increment or decrement by. - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {Array} Returns the range of numbers. - */ - function baseRange(start, end, step, fromRight) { - var index = -1, - length = nativeMax(nativeCeil((end - start) / (step || 1)), 0), - result = Array(length); - - while (length--) { - result[fromRight ? length : ++index] = start; - start += step; - } - return result; - } - - /** - * The base implementation of `_.repeat` which doesn't coerce arguments. - * - * @private - * @param {string} string The string to repeat. - * @param {number} n The number of times to repeat the string. - * @returns {string} Returns the repeated string. - */ - function baseRepeat(string, n) { - var result = ''; - if (!string || n < 1 || n > MAX_SAFE_INTEGER) { - return result; - } - // Leverage the exponentiation by squaring algorithm for a faster repeat. - // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details. - do { - if (n % 2) { - result += string; - } - n = nativeFloor(n / 2); - if (n) { - string += string; - } - } while (n); - - return result; - } - - /** - * The base implementation of `_.rest` which doesn't validate or coerce arguments. - * - * @private - * @param {Function} func The function to apply a rest parameter to. - * @param {number} [start=func.length-1] The start position of the rest parameter. - * @returns {Function} Returns the new function. - */ - function baseRest(func, start) { - return setToString(overRest(func, start, identity), func + ''); - } - - /** - * The base implementation of `_.sample`. - * - * @private - * @param {Array|Object} collection The collection to sample. - * @returns {*} Returns the random element. - */ - function baseSample(collection) { - return arraySample(values(collection)); - } - - /** - * The base implementation of `_.sampleSize` without param guards. - * - * @private - * @param {Array|Object} collection The collection to sample. - * @param {number} n The number of elements to sample. - * @returns {Array} Returns the random elements. - */ - function baseSampleSize(collection, n) { - var array = values(collection); - return shuffleSelf(array, baseClamp(n, 0, array.length)); - } - - /** - * The base implementation of `_.set`. - * - * @private - * @param {Object} object The object to modify. - * @param {Array|string} path The path of the property to set. - * @param {*} value The value to set. - * @param {Function} [customizer] The function to customize path creation. - * @returns {Object} Returns `object`. - */ - function baseSet(object, path, value, customizer) { - if (!isObject(object)) { - return object; - } - path = castPath(path, object); - - var index = -1, - length = path.length, - lastIndex = length - 1, - nested = object; - - while (nested != null && ++index < length) { - var key = toKey(path[index]), - newValue = value; - - if (key === '__proto__' || key === 'constructor' || key === 'prototype') { - return object; - } - - if (index != lastIndex) { - var objValue = nested[key]; - newValue = customizer ? customizer(objValue, key, nested) : undefined; - if (newValue === undefined) { - newValue = isObject(objValue) - ? objValue - : (isIndex(path[index + 1]) ? [] : {}); - } - } - assignValue(nested, key, newValue); - nested = nested[key]; - } - return object; - } - - /** - * The base implementation of `setData` without support for hot loop shorting. - * - * @private - * @param {Function} func The function to associate metadata with. - * @param {*} data The metadata. - * @returns {Function} Returns `func`. - */ - var baseSetData = !metaMap ? identity : function(func, data) { - metaMap.set(func, data); - return func; - }; - - /** - * The base implementation of `setToString` without support for hot loop shorting. - * - * @private - * @param {Function} func The function to modify. - * @param {Function} string The `toString` result. - * @returns {Function} Returns `func`. - */ - var baseSetToString = !defineProperty ? identity : function(func, string) { - return defineProperty(func, 'toString', { - 'configurable': true, - 'enumerable': false, - 'value': constant(string), - 'writable': true - }); - }; - - /** - * The base implementation of `_.shuffle`. - * - * @private - * @param {Array|Object} collection The collection to shuffle. - * @returns {Array} Returns the new shuffled array. - */ - function baseShuffle(collection) { - return shuffleSelf(values(collection)); - } - - /** - * The base implementation of `_.slice` without an iteratee call guard. - * - * @private - * @param {Array} array The array to slice. - * @param {number} [start=0] The start position. - * @param {number} [end=array.length] The end position. - * @returns {Array} Returns the slice of `array`. - */ - function baseSlice(array, start, end) { - var index = -1, - length = array.length; - - if (start < 0) { - start = -start > length ? 0 : (length + start); - } - end = end > length ? length : end; - if (end < 0) { - end += length; - } - length = start > end ? 0 : ((end - start) >>> 0); - start >>>= 0; - - var result = Array(length); - while (++index < length) { - result[index] = array[index + start]; - } - return result; - } - - /** - * The base implementation of `_.some` without support for iteratee shorthands. - * - * @private - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} predicate The function invoked per iteration. - * @returns {boolean} Returns `true` if any element passes the predicate check, - * else `false`. - */ - function baseSome(collection, predicate) { - var result; - - baseEach(collection, function(value, index, collection) { - result = predicate(value, index, collection); - return !result; - }); - return !!result; - } - - /** - * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which - * performs a binary search of `array` to determine the index at which `value` - * should be inserted into `array` in order to maintain its sort order. - * - * @private - * @param {Array} array The sorted array to inspect. - * @param {*} value The value to evaluate. - * @param {boolean} [retHighest] Specify returning the highest qualified index. - * @returns {number} Returns the index at which `value` should be inserted - * into `array`. - */ - function baseSortedIndex(array, value, retHighest) { - var low = 0, - high = array == null ? low : array.length; - - if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) { - while (low < high) { - var mid = (low + high) >>> 1, - computed = array[mid]; - - if (computed !== null && !isSymbol(computed) && - (retHighest ? (computed <= value) : (computed < value))) { - low = mid + 1; - } else { - high = mid; - } - } - return high; - } - return baseSortedIndexBy(array, value, identity, retHighest); - } - - /** - * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy` - * which invokes `iteratee` for `value` and each element of `array` to compute - * their sort ranking. The iteratee is invoked with one argument; (value). - * - * @private - * @param {Array} array The sorted array to inspect. - * @param {*} value The value to evaluate. - * @param {Function} iteratee The iteratee invoked per element. - * @param {boolean} [retHighest] Specify returning the highest qualified index. - * @returns {number} Returns the index at which `value` should be inserted - * into `array`. - */ - function baseSortedIndexBy(array, value, iteratee, retHighest) { - var low = 0, - high = array == null ? 0 : array.length; - if (high === 0) { - return 0; - } - - value = iteratee(value); - var valIsNaN = value !== value, - valIsNull = value === null, - valIsSymbol = isSymbol(value), - valIsUndefined = value === undefined; - - while (low < high) { - var mid = nativeFloor((low + high) / 2), - computed = iteratee(array[mid]), - othIsDefined = computed !== undefined, - othIsNull = computed === null, - othIsReflexive = computed === computed, - othIsSymbol = isSymbol(computed); - - if (valIsNaN) { - var setLow = retHighest || othIsReflexive; - } else if (valIsUndefined) { - setLow = othIsReflexive && (retHighest || othIsDefined); - } else if (valIsNull) { - setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull); - } else if (valIsSymbol) { - setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol); - } else if (othIsNull || othIsSymbol) { - setLow = false; - } else { - setLow = retHighest ? (computed <= value) : (computed < value); - } - if (setLow) { - low = mid + 1; - } else { - high = mid; - } - } - return nativeMin(high, MAX_ARRAY_INDEX); - } - - /** - * The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without - * support for iteratee shorthands. - * - * @private - * @param {Array} array The array to inspect. - * @param {Function} [iteratee] The iteratee invoked per element. - * @returns {Array} Returns the new duplicate free array. - */ - function baseSortedUniq(array, iteratee) { - var index = -1, - length = array.length, - resIndex = 0, - result = []; - - while (++index < length) { - var value = array[index], - computed = iteratee ? iteratee(value) : value; - - if (!index || !eq(computed, seen)) { - var seen = computed; - result[resIndex++] = value === 0 ? 0 : value; - } - } - return result; - } - - /** - * The base implementation of `_.toNumber` which doesn't ensure correct - * conversions of binary, hexadecimal, or octal string values. - * - * @private - * @param {*} value The value to process. - * @returns {number} Returns the number. - */ - function baseToNumber(value) { - if (typeof value == 'number') { - return value; - } - if (isSymbol(value)) { - return NAN; - } - return +value; - } - - /** - * The base implementation of `_.toString` which doesn't convert nullish - * values to empty strings. - * - * @private - * @param {*} value The value to process. - * @returns {string} Returns the string. - */ - function baseToString(value) { - // Exit early for strings to avoid a performance hit in some environments. - if (typeof value == 'string') { - return value; - } - if (isArray(value)) { - // Recursively convert values (susceptible to call stack limits). - return arrayMap(value, baseToString) + ''; - } - if (isSymbol(value)) { - return symbolToString ? symbolToString.call(value) : ''; - } - var result = (value + ''); - return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; - } - - /** - * The base implementation of `_.uniqBy` without support for iteratee shorthands. - * - * @private - * @param {Array} array The array to inspect. - * @param {Function} [iteratee] The iteratee invoked per element. - * @param {Function} [comparator] The comparator invoked per element. - * @returns {Array} Returns the new duplicate free array. - */ - function baseUniq(array, iteratee, comparator) { - var index = -1, - includes = arrayIncludes, - length = array.length, - isCommon = true, - result = [], - seen = result; - - if (comparator) { - isCommon = false; - includes = arrayIncludesWith; - } - else if (length >= LARGE_ARRAY_SIZE) { - var set = iteratee ? null : createSet(array); - if (set) { - return setToArray(set); - } - isCommon = false; - includes = cacheHas; - seen = new SetCache; - } - else { - seen = iteratee ? [] : result; - } - outer: - while (++index < length) { - var value = array[index], - computed = iteratee ? iteratee(value) : value; - - value = (comparator || value !== 0) ? value : 0; - if (isCommon && computed === computed) { - var seenIndex = seen.length; - while (seenIndex--) { - if (seen[seenIndex] === computed) { - continue outer; - } - } - if (iteratee) { - seen.push(computed); - } - result.push(value); - } - else if (!includes(seen, computed, comparator)) { - if (seen !== result) { - seen.push(computed); - } - result.push(value); - } - } - return result; - } - - /** - * The base implementation of `_.unset`. - * - * @private - * @param {Object} object The object to modify. - * @param {Array|string} path The property path to unset. - * @returns {boolean} Returns `true` if the property is deleted, else `false`. - */ - function baseUnset(object, path) { - path = castPath(path, object); - object = parent(object, path); - return object == null || delete object[toKey(last(path))]; - } - - /** - * The base implementation of `_.update`. - * - * @private - * @param {Object} object The object to modify. - * @param {Array|string} path The path of the property to update. - * @param {Function} updater The function to produce the updated value. - * @param {Function} [customizer] The function to customize path creation. - * @returns {Object} Returns `object`. - */ - function baseUpdate(object, path, updater, customizer) { - return baseSet(object, path, updater(baseGet(object, path)), customizer); - } - - /** - * The base implementation of methods like `_.dropWhile` and `_.takeWhile` - * without support for iteratee shorthands. - * - * @private - * @param {Array} array The array to query. - * @param {Function} predicate The function invoked per iteration. - * @param {boolean} [isDrop] Specify dropping elements instead of taking them. - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {Array} Returns the slice of `array`. - */ - function baseWhile(array, predicate, isDrop, fromRight) { - var length = array.length, - index = fromRight ? length : -1; - - while ((fromRight ? index-- : ++index < length) && - predicate(array[index], index, array)) {} - - return isDrop - ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length)) - : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index)); - } - - /** - * The base implementation of `wrapperValue` which returns the result of - * performing a sequence of actions on the unwrapped `value`, where each - * successive action is supplied the return value of the previous. - * - * @private - * @param {*} value The unwrapped value. - * @param {Array} actions Actions to perform to resolve the unwrapped value. - * @returns {*} Returns the resolved value. - */ - function baseWrapperValue(value, actions) { - var result = value; - if (result instanceof LazyWrapper) { - result = result.value(); - } - return arrayReduce(actions, function(result, action) { - return action.func.apply(action.thisArg, arrayPush([result], action.args)); - }, result); - } - - /** - * The base implementation of methods like `_.xor`, without support for - * iteratee shorthands, that accepts an array of arrays to inspect. - * - * @private - * @param {Array} arrays The arrays to inspect. - * @param {Function} [iteratee] The iteratee invoked per element. - * @param {Function} [comparator] The comparator invoked per element. - * @returns {Array} Returns the new array of values. - */ - function baseXor(arrays, iteratee, comparator) { - var length = arrays.length; - if (length < 2) { - return length ? baseUniq(arrays[0]) : []; - } - var index = -1, - result = Array(length); - - while (++index < length) { - var array = arrays[index], - othIndex = -1; - - while (++othIndex < length) { - if (othIndex != index) { - result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator); - } - } - } - return baseUniq(baseFlatten(result, 1), iteratee, comparator); - } - - /** - * This base implementation of `_.zipObject` which assigns values using `assignFunc`. - * - * @private - * @param {Array} props The property identifiers. - * @param {Array} values The property values. - * @param {Function} assignFunc The function to assign values. - * @returns {Object} Returns the new object. - */ - function baseZipObject(props, values, assignFunc) { - var index = -1, - length = props.length, - valsLength = values.length, - result = {}; - - while (++index < length) { - var value = index < valsLength ? values[index] : undefined; - assignFunc(result, props[index], value); - } - return result; - } - - /** - * Casts `value` to an empty array if it's not an array like object. - * - * @private - * @param {*} value The value to inspect. - * @returns {Array|Object} Returns the cast array-like object. - */ - function castArrayLikeObject(value) { - return isArrayLikeObject(value) ? value : []; - } - - /** - * Casts `value` to `identity` if it's not a function. - * - * @private - * @param {*} value The value to inspect. - * @returns {Function} Returns cast function. - */ - function castFunction(value) { - return typeof value == 'function' ? value : identity; - } - - /** - * Casts `value` to a path array if it's not one. - * - * @private - * @param {*} value The value to inspect. - * @param {Object} [object] The object to query keys on. - * @returns {Array} Returns the cast property path array. - */ - function castPath(value, object) { - if (isArray(value)) { - return value; - } - return isKey(value, object) ? [value] : stringToPath(toString(value)); - } - - /** - * A `baseRest` alias which can be replaced with `identity` by module - * replacement plugins. - * - * @private - * @type {Function} - * @param {Function} func The function to apply a rest parameter to. - * @returns {Function} Returns the new function. - */ - var castRest = baseRest; - - /** - * Casts `array` to a slice if it's needed. - * - * @private - * @param {Array} array The array to inspect. - * @param {number} start The start position. - * @param {number} [end=array.length] The end position. - * @returns {Array} Returns the cast slice. - */ - function castSlice(array, start, end) { - var length = array.length; - end = end === undefined ? length : end; - return (!start && end >= length) ? array : baseSlice(array, start, end); - } - - /** - * A simple wrapper around the global [`clearTimeout`](https://mdn.io/clearTimeout). - * - * @private - * @param {number|Object} id The timer id or timeout object of the timer to clear. - */ - var clearTimeout = ctxClearTimeout || function(id) { - return root.clearTimeout(id); - }; - - /** - * Creates a clone of `buffer`. - * - * @private - * @param {Buffer} buffer The buffer to clone. - * @param {boolean} [isDeep] Specify a deep clone. - * @returns {Buffer} Returns the cloned buffer. - */ - function cloneBuffer(buffer, isDeep) { - if (isDeep) { - return buffer.slice(); - } - var length = buffer.length, - result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length); - - buffer.copy(result); - return result; - } - - /** - * Creates a clone of `arrayBuffer`. - * - * @private - * @param {ArrayBuffer} arrayBuffer The array buffer to clone. - * @returns {ArrayBuffer} Returns the cloned array buffer. - */ - function cloneArrayBuffer(arrayBuffer) { - var result = new arrayBuffer.constructor(arrayBuffer.byteLength); - new Uint8Array(result).set(new Uint8Array(arrayBuffer)); - return result; - } - - /** - * Creates a clone of `dataView`. - * - * @private - * @param {Object} dataView The data view to clone. - * @param {boolean} [isDeep] Specify a deep clone. - * @returns {Object} Returns the cloned data view. - */ - function cloneDataView(dataView, isDeep) { - var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer; - return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength); - } - - /** - * Creates a clone of `regexp`. - * - * @private - * @param {Object} regexp The regexp to clone. - * @returns {Object} Returns the cloned regexp. - */ - function cloneRegExp(regexp) { - var result = new regexp.constructor(regexp.source, reFlags.exec(regexp)); - result.lastIndex = regexp.lastIndex; - return result; - } - - /** - * Creates a clone of the `symbol` object. - * - * @private - * @param {Object} symbol The symbol object to clone. - * @returns {Object} Returns the cloned symbol object. - */ - function cloneSymbol(symbol) { - return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {}; - } - - /** - * Creates a clone of `typedArray`. - * - * @private - * @param {Object} typedArray The typed array to clone. - * @param {boolean} [isDeep] Specify a deep clone. - * @returns {Object} Returns the cloned typed array. - */ - function cloneTypedArray(typedArray, isDeep) { - var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer; - return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length); - } - - /** - * Compares values to sort them in ascending order. - * - * @private - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {number} Returns the sort order indicator for `value`. - */ - function compareAscending(value, other) { - if (value !== other) { - var valIsDefined = value !== undefined, - valIsNull = value === null, - valIsReflexive = value === value, - valIsSymbol = isSymbol(value); - - var othIsDefined = other !== undefined, - othIsNull = other === null, - othIsReflexive = other === other, - othIsSymbol = isSymbol(other); - - if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) || - (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) || - (valIsNull && othIsDefined && othIsReflexive) || - (!valIsDefined && othIsReflexive) || - !valIsReflexive) { - return 1; - } - if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) || - (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) || - (othIsNull && valIsDefined && valIsReflexive) || - (!othIsDefined && valIsReflexive) || - !othIsReflexive) { - return -1; - } - } - return 0; - } - - /** - * Used by `_.orderBy` to compare multiple properties of a value to another - * and stable sort them. - * - * If `orders` is unspecified, all values are sorted in ascending order. Otherwise, - * specify an order of "desc" for descending or "asc" for ascending sort order - * of corresponding values. - * - * @private - * @param {Object} object The object to compare. - * @param {Object} other The other object to compare. - * @param {boolean[]|string[]} orders The order to sort by for each property. - * @returns {number} Returns the sort order indicator for `object`. - */ - function compareMultiple(object, other, orders) { - var index = -1, - objCriteria = object.criteria, - othCriteria = other.criteria, - length = objCriteria.length, - ordersLength = orders.length; - - while (++index < length) { - var result = compareAscending(objCriteria[index], othCriteria[index]); - if (result) { - if (index >= ordersLength) { - return result; - } - var order = orders[index]; - return result * (order == 'desc' ? -1 : 1); - } - } - // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications - // that causes it, under certain circumstances, to provide the same value for - // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247 - // for more details. - // - // This also ensures a stable sort in V8 and other engines. - // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details. - return object.index - other.index; - } - - /** - * Creates an array that is the composition of partially applied arguments, - * placeholders, and provided arguments into a single array of arguments. - * - * @private - * @param {Array} args The provided arguments. - * @param {Array} partials The arguments to prepend to those provided. - * @param {Array} holders The `partials` placeholder indexes. - * @params {boolean} [isCurried] Specify composing for a curried function. - * @returns {Array} Returns the new array of composed arguments. - */ - function composeArgs(args, partials, holders, isCurried) { - var argsIndex = -1, - argsLength = args.length, - holdersLength = holders.length, - leftIndex = -1, - leftLength = partials.length, - rangeLength = nativeMax(argsLength - holdersLength, 0), - result = Array(leftLength + rangeLength), - isUncurried = !isCurried; - - while (++leftIndex < leftLength) { - result[leftIndex] = partials[leftIndex]; - } - while (++argsIndex < holdersLength) { - if (isUncurried || argsIndex < argsLength) { - result[holders[argsIndex]] = args[argsIndex]; - } - } - while (rangeLength--) { - result[leftIndex++] = args[argsIndex++]; - } - return result; - } - - /** - * This function is like `composeArgs` except that the arguments composition - * is tailored for `_.partialRight`. - * - * @private - * @param {Array} args The provided arguments. - * @param {Array} partials The arguments to append to those provided. - * @param {Array} holders The `partials` placeholder indexes. - * @params {boolean} [isCurried] Specify composing for a curried function. - * @returns {Array} Returns the new array of composed arguments. - */ - function composeArgsRight(args, partials, holders, isCurried) { - var argsIndex = -1, - argsLength = args.length, - holdersIndex = -1, - holdersLength = holders.length, - rightIndex = -1, - rightLength = partials.length, - rangeLength = nativeMax(argsLength - holdersLength, 0), - result = Array(rangeLength + rightLength), - isUncurried = !isCurried; - - while (++argsIndex < rangeLength) { - result[argsIndex] = args[argsIndex]; - } - var offset = argsIndex; - while (++rightIndex < rightLength) { - result[offset + rightIndex] = partials[rightIndex]; - } - while (++holdersIndex < holdersLength) { - if (isUncurried || argsIndex < argsLength) { - result[offset + holders[holdersIndex]] = args[argsIndex++]; - } - } - return result; - } - - /** - * Copies the values of `source` to `array`. - * - * @private - * @param {Array} source The array to copy values from. - * @param {Array} [array=[]] The array to copy values to. - * @returns {Array} Returns `array`. - */ - function copyArray(source, array) { - var index = -1, - length = source.length; - - array || (array = Array(length)); - while (++index < length) { - array[index] = source[index]; - } - return array; - } - - /** - * Copies properties of `source` to `object`. - * - * @private - * @param {Object} source The object to copy properties from. - * @param {Array} props The property identifiers to copy. - * @param {Object} [object={}] The object to copy properties to. - * @param {Function} [customizer] The function to customize copied values. - * @returns {Object} Returns `object`. - */ - function copyObject(source, props, object, customizer) { - var isNew = !object; - object || (object = {}); - - var index = -1, - length = props.length; - - while (++index < length) { - var key = props[index]; - - var newValue = customizer - ? customizer(object[key], source[key], key, object, source) - : undefined; - - if (newValue === undefined) { - newValue = source[key]; - } - if (isNew) { - baseAssignValue(object, key, newValue); - } else { - assignValue(object, key, newValue); - } - } - return object; - } - - /** - * Copies own symbols of `source` to `object`. - * - * @private - * @param {Object} source The object to copy symbols from. - * @param {Object} [object={}] The object to copy symbols to. - * @returns {Object} Returns `object`. - */ - function copySymbols(source, object) { - return copyObject(source, getSymbols(source), object); - } - - /** - * Copies own and inherited symbols of `source` to `object`. - * - * @private - * @param {Object} source The object to copy symbols from. - * @param {Object} [object={}] The object to copy symbols to. - * @returns {Object} Returns `object`. - */ - function copySymbolsIn(source, object) { - return copyObject(source, getSymbolsIn(source), object); - } - - /** - * Creates a function like `_.groupBy`. - * - * @private - * @param {Function} setter The function to set accumulator values. - * @param {Function} [initializer] The accumulator object initializer. - * @returns {Function} Returns the new aggregator function. - */ - function createAggregator(setter, initializer) { - return function(collection, iteratee) { - var func = isArray(collection) ? arrayAggregator : baseAggregator, - accumulator = initializer ? initializer() : {}; - - return func(collection, setter, getIteratee(iteratee, 2), accumulator); - }; - } - - /** - * Creates a function like `_.assign`. - * - * @private - * @param {Function} assigner The function to assign values. - * @returns {Function} Returns the new assigner function. - */ - function createAssigner(assigner) { - return baseRest(function(object, sources) { - var index = -1, - length = sources.length, - customizer = length > 1 ? sources[length - 1] : undefined, - guard = length > 2 ? sources[2] : undefined; - - customizer = (assigner.length > 3 && typeof customizer == 'function') - ? (length--, customizer) - : undefined; - - if (guard && isIterateeCall(sources[0], sources[1], guard)) { - customizer = length < 3 ? undefined : customizer; - length = 1; - } - object = Object(object); - while (++index < length) { - var source = sources[index]; - if (source) { - assigner(object, source, index, customizer); - } - } - return object; - }); - } - - /** - * Creates a `baseEach` or `baseEachRight` function. - * - * @private - * @param {Function} eachFunc The function to iterate over a collection. - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {Function} Returns the new base function. - */ - function createBaseEach(eachFunc, fromRight) { - return function(collection, iteratee) { - if (collection == null) { - return collection; - } - if (!isArrayLike(collection)) { - return eachFunc(collection, iteratee); - } - var length = collection.length, - index = fromRight ? length : -1, - iterable = Object(collection); - - while ((fromRight ? index-- : ++index < length)) { - if (iteratee(iterable[index], index, iterable) === false) { - break; - } - } - return collection; - }; - } - - /** - * Creates a base function for methods like `_.forIn` and `_.forOwn`. - * - * @private - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {Function} Returns the new base function. - */ - function createBaseFor(fromRight) { - return function(object, iteratee, keysFunc) { - var index = -1, - iterable = Object(object), - props = keysFunc(object), - length = props.length; - - while (length--) { - var key = props[fromRight ? length : ++index]; - if (iteratee(iterable[key], key, iterable) === false) { - break; - } - } - return object; - }; - } - - /** - * Creates a function that wraps `func` to invoke it with the optional `this` - * binding of `thisArg`. - * - * @private - * @param {Function} func The function to wrap. - * @param {number} bitmask The bitmask flags. See `createWrap` for more details. - * @param {*} [thisArg] The `this` binding of `func`. - * @returns {Function} Returns the new wrapped function. - */ - function createBind(func, bitmask, thisArg) { - var isBind = bitmask & WRAP_BIND_FLAG, - Ctor = createCtor(func); - - function wrapper() { - var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; - return fn.apply(isBind ? thisArg : this, arguments); - } - return wrapper; - } - - /** - * Creates a function like `_.lowerFirst`. - * - * @private - * @param {string} methodName The name of the `String` case method to use. - * @returns {Function} Returns the new case function. - */ - function createCaseFirst(methodName) { - return function(string) { - string = toString(string); - - var strSymbols = hasUnicode(string) - ? stringToArray(string) - : undefined; - - var chr = strSymbols - ? strSymbols[0] - : string.charAt(0); - - var trailing = strSymbols - ? castSlice(strSymbols, 1).join('') - : string.slice(1); - - return chr[methodName]() + trailing; - }; - } - - /** - * Creates a function like `_.camelCase`. - * - * @private - * @param {Function} callback The function to combine each word. - * @returns {Function} Returns the new compounder function. - */ - function createCompounder(callback) { - return function(string) { - return arrayReduce(words(deburr(string).replace(reApos, '')), callback, ''); - }; - } - - /** - * Creates a function that produces an instance of `Ctor` regardless of - * whether it was invoked as part of a `new` expression or by `call` or `apply`. - * - * @private - * @param {Function} Ctor The constructor to wrap. - * @returns {Function} Returns the new wrapped function. - */ - function createCtor(Ctor) { - return function() { - // Use a `switch` statement to work with class constructors. See - // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist - // for more details. - var args = arguments; - switch (args.length) { - case 0: return new Ctor; - case 1: return new Ctor(args[0]); - case 2: return new Ctor(args[0], args[1]); - case 3: return new Ctor(args[0], args[1], args[2]); - case 4: return new Ctor(args[0], args[1], args[2], args[3]); - case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]); - case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]); - case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]); - } - var thisBinding = baseCreate(Ctor.prototype), - result = Ctor.apply(thisBinding, args); - - // Mimic the constructor's `return` behavior. - // See https://es5.github.io/#x13.2.2 for more details. - return isObject(result) ? result : thisBinding; - }; - } - - /** - * Creates a function that wraps `func` to enable currying. - * - * @private - * @param {Function} func The function to wrap. - * @param {number} bitmask The bitmask flags. See `createWrap` for more details. - * @param {number} arity The arity of `func`. - * @returns {Function} Returns the new wrapped function. - */ - function createCurry(func, bitmask, arity) { - var Ctor = createCtor(func); - - function wrapper() { - var length = arguments.length, - args = Array(length), - index = length, - placeholder = getHolder(wrapper); - - while (index--) { - args[index] = arguments[index]; - } - var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder) - ? [] - : replaceHolders(args, placeholder); - - length -= holders.length; - if (length < arity) { - return createRecurry( - func, bitmask, createHybrid, wrapper.placeholder, undefined, - args, holders, undefined, undefined, arity - length); - } - var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; - return apply(fn, this, args); - } - return wrapper; - } - - /** - * Creates a `_.find` or `_.findLast` function. - * - * @private - * @param {Function} findIndexFunc The function to find the collection index. - * @returns {Function} Returns the new find function. - */ - function createFind(findIndexFunc) { - return function(collection, predicate, fromIndex) { - var iterable = Object(collection); - if (!isArrayLike(collection)) { - var iteratee = getIteratee(predicate, 3); - collection = keys(collection); - predicate = function(key) { return iteratee(iterable[key], key, iterable); }; - } - var index = findIndexFunc(collection, predicate, fromIndex); - return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined; - }; - } - - /** - * Creates a `_.flow` or `_.flowRight` function. - * - * @private - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {Function} Returns the new flow function. - */ - function createFlow(fromRight) { - return flatRest(function(funcs) { - var length = funcs.length, - index = length, - prereq = LodashWrapper.prototype.thru; - - if (fromRight) { - funcs.reverse(); - } - while (index--) { - var func = funcs[index]; - if (typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - if (prereq && !wrapper && getFuncName(func) == 'wrapper') { - var wrapper = new LodashWrapper([], true); - } - } - index = wrapper ? index : length; - while (++index < length) { - func = funcs[index]; - - var funcName = getFuncName(func), - data = funcName == 'wrapper' ? getData(func) : undefined; - - if (data && isLaziable(data[0]) && - data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) && - !data[4].length && data[9] == 1 - ) { - wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]); - } else { - wrapper = (func.length == 1 && isLaziable(func)) - ? wrapper[funcName]() - : wrapper.thru(func); - } - } - return function() { - var args = arguments, - value = args[0]; - - if (wrapper && args.length == 1 && isArray(value)) { - return wrapper.plant(value).value(); - } - var index = 0, - result = length ? funcs[index].apply(this, args) : value; - - while (++index < length) { - result = funcs[index].call(this, result); - } - return result; - }; - }); - } - - /** - * Creates a function that wraps `func` to invoke it with optional `this` - * binding of `thisArg`, partial application, and currying. - * - * @private - * @param {Function|string} func The function or method name to wrap. - * @param {number} bitmask The bitmask flags. See `createWrap` for more details. - * @param {*} [thisArg] The `this` binding of `func`. - * @param {Array} [partials] The arguments to prepend to those provided to - * the new function. - * @param {Array} [holders] The `partials` placeholder indexes. - * @param {Array} [partialsRight] The arguments to append to those provided - * to the new function. - * @param {Array} [holdersRight] The `partialsRight` placeholder indexes. - * @param {Array} [argPos] The argument positions of the new function. - * @param {number} [ary] The arity cap of `func`. - * @param {number} [arity] The arity of `func`. - * @returns {Function} Returns the new wrapped function. - */ - function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) { - var isAry = bitmask & WRAP_ARY_FLAG, - isBind = bitmask & WRAP_BIND_FLAG, - isBindKey = bitmask & WRAP_BIND_KEY_FLAG, - isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG), - isFlip = bitmask & WRAP_FLIP_FLAG, - Ctor = isBindKey ? undefined : createCtor(func); - - function wrapper() { - var length = arguments.length, - args = Array(length), - index = length; - - while (index--) { - args[index] = arguments[index]; - } - if (isCurried) { - var placeholder = getHolder(wrapper), - holdersCount = countHolders(args, placeholder); - } - if (partials) { - args = composeArgs(args, partials, holders, isCurried); - } - if (partialsRight) { - args = composeArgsRight(args, partialsRight, holdersRight, isCurried); - } - length -= holdersCount; - if (isCurried && length < arity) { - var newHolders = replaceHolders(args, placeholder); - return createRecurry( - func, bitmask, createHybrid, wrapper.placeholder, thisArg, - args, newHolders, argPos, ary, arity - length - ); - } - var thisBinding = isBind ? thisArg : this, - fn = isBindKey ? thisBinding[func] : func; - - length = args.length; - if (argPos) { - args = reorder(args, argPos); - } else if (isFlip && length > 1) { - args.reverse(); - } - if (isAry && ary < length) { - args.length = ary; - } - if (this && this !== root && this instanceof wrapper) { - fn = Ctor || createCtor(fn); - } - return fn.apply(thisBinding, args); - } - return wrapper; - } - - /** - * Creates a function like `_.invertBy`. - * - * @private - * @param {Function} setter The function to set accumulator values. - * @param {Function} toIteratee The function to resolve iteratees. - * @returns {Function} Returns the new inverter function. - */ - function createInverter(setter, toIteratee) { - return function(object, iteratee) { - return baseInverter(object, setter, toIteratee(iteratee), {}); - }; - } - - /** - * Creates a function that performs a mathematical operation on two values. - * - * @private - * @param {Function} operator The function to perform the operation. - * @param {number} [defaultValue] The value used for `undefined` arguments. - * @returns {Function} Returns the new mathematical operation function. - */ - function createMathOperation(operator, defaultValue) { - return function(value, other) { - var result; - if (value === undefined && other === undefined) { - return defaultValue; - } - if (value !== undefined) { - result = value; - } - if (other !== undefined) { - if (result === undefined) { - return other; - } - if (typeof value == 'string' || typeof other == 'string') { - value = baseToString(value); - other = baseToString(other); - } else { - value = baseToNumber(value); - other = baseToNumber(other); - } - result = operator(value, other); - } - return result; - }; - } - - /** - * Creates a function like `_.over`. - * - * @private - * @param {Function} arrayFunc The function to iterate over iteratees. - * @returns {Function} Returns the new over function. - */ - function createOver(arrayFunc) { - return flatRest(function(iteratees) { - iteratees = arrayMap(iteratees, baseUnary(getIteratee())); - return baseRest(function(args) { - var thisArg = this; - return arrayFunc(iteratees, function(iteratee) { - return apply(iteratee, thisArg, args); - }); - }); - }); - } - - /** - * Creates the padding for `string` based on `length`. The `chars` string - * is truncated if the number of characters exceeds `length`. - * - * @private - * @param {number} length The padding length. - * @param {string} [chars=' '] The string used as padding. - * @returns {string} Returns the padding for `string`. - */ - function createPadding(length, chars) { - chars = chars === undefined ? ' ' : baseToString(chars); - - var charsLength = chars.length; - if (charsLength < 2) { - return charsLength ? baseRepeat(chars, length) : chars; - } - var result = baseRepeat(chars, nativeCeil(length / stringSize(chars))); - return hasUnicode(chars) - ? castSlice(stringToArray(result), 0, length).join('') - : result.slice(0, length); - } - - /** - * Creates a function that wraps `func` to invoke it with the `this` binding - * of `thisArg` and `partials` prepended to the arguments it receives. - * - * @private - * @param {Function} func The function to wrap. - * @param {number} bitmask The bitmask flags. See `createWrap` for more details. - * @param {*} thisArg The `this` binding of `func`. - * @param {Array} partials The arguments to prepend to those provided to - * the new function. - * @returns {Function} Returns the new wrapped function. - */ - function createPartial(func, bitmask, thisArg, partials) { - var isBind = bitmask & WRAP_BIND_FLAG, - Ctor = createCtor(func); - - function wrapper() { - var argsIndex = -1, - argsLength = arguments.length, - leftIndex = -1, - leftLength = partials.length, - args = Array(leftLength + argsLength), - fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; - - while (++leftIndex < leftLength) { - args[leftIndex] = partials[leftIndex]; - } - while (argsLength--) { - args[leftIndex++] = arguments[++argsIndex]; - } - return apply(fn, isBind ? thisArg : this, args); - } - return wrapper; - } - - /** - * Creates a `_.range` or `_.rangeRight` function. - * - * @private - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {Function} Returns the new range function. - */ - function createRange(fromRight) { - return function(start, end, step) { - if (step && typeof step != 'number' && isIterateeCall(start, end, step)) { - end = step = undefined; - } - // Ensure the sign of `-0` is preserved. - start = toFinite(start); - if (end === undefined) { - end = start; - start = 0; - } else { - end = toFinite(end); - } - step = step === undefined ? (start < end ? 1 : -1) : toFinite(step); - return baseRange(start, end, step, fromRight); - }; - } - - /** - * Creates a function that performs a relational operation on two values. - * - * @private - * @param {Function} operator The function to perform the operation. - * @returns {Function} Returns the new relational operation function. - */ - function createRelationalOperation(operator) { - return function(value, other) { - if (!(typeof value == 'string' && typeof other == 'string')) { - value = toNumber(value); - other = toNumber(other); - } - return operator(value, other); - }; - } - - /** - * Creates a function that wraps `func` to continue currying. - * - * @private - * @param {Function} func The function to wrap. - * @param {number} bitmask The bitmask flags. See `createWrap` for more details. - * @param {Function} wrapFunc The function to create the `func` wrapper. - * @param {*} placeholder The placeholder value. - * @param {*} [thisArg] The `this` binding of `func`. - * @param {Array} [partials] The arguments to prepend to those provided to - * the new function. - * @param {Array} [holders] The `partials` placeholder indexes. - * @param {Array} [argPos] The argument positions of the new function. - * @param {number} [ary] The arity cap of `func`. - * @param {number} [arity] The arity of `func`. - * @returns {Function} Returns the new wrapped function. - */ - function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) { - var isCurry = bitmask & WRAP_CURRY_FLAG, - newHolders = isCurry ? holders : undefined, - newHoldersRight = isCurry ? undefined : holders, - newPartials = isCurry ? partials : undefined, - newPartialsRight = isCurry ? undefined : partials; - - bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG); - bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG); - - if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) { - bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG); - } - var newData = [ - func, bitmask, thisArg, newPartials, newHolders, newPartialsRight, - newHoldersRight, argPos, ary, arity - ]; - - var result = wrapFunc.apply(undefined, newData); - if (isLaziable(func)) { - setData(result, newData); - } - result.placeholder = placeholder; - return setWrapToString(result, func, bitmask); - } - - /** - * Creates a function like `_.round`. - * - * @private - * @param {string} methodName The name of the `Math` method to use when rounding. - * @returns {Function} Returns the new round function. - */ - function createRound(methodName) { - var func = Math[methodName]; - return function(number, precision) { - number = toNumber(number); - precision = precision == null ? 0 : nativeMin(toInteger(precision), 292); - if (precision && nativeIsFinite(number)) { - // Shift with exponential notation to avoid floating-point issues. - // See [MDN](https://mdn.io/round#Examples) for more details. - var pair = (toString(number) + 'e').split('e'), - value = func(pair[0] + 'e' + (+pair[1] + precision)); - - pair = (toString(value) + 'e').split('e'); - return +(pair[0] + 'e' + (+pair[1] - precision)); - } - return func(number); - }; - } - - /** - * Creates a set object of `values`. - * - * @private - * @param {Array} values The values to add to the set. - * @returns {Object} Returns the new set. - */ - var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) { - return new Set(values); - }; - - /** - * Creates a `_.toPairs` or `_.toPairsIn` function. - * - * @private - * @param {Function} keysFunc The function to get the keys of a given object. - * @returns {Function} Returns the new pairs function. - */ - function createToPairs(keysFunc) { - return function(object) { - var tag = getTag(object); - if (tag == mapTag) { - return mapToArray(object); - } - if (tag == setTag) { - return setToPairs(object); - } - return baseToPairs(object, keysFunc(object)); - }; - } - - /** - * Creates a function that either curries or invokes `func` with optional - * `this` binding and partially applied arguments. - * - * @private - * @param {Function|string} func The function or method name to wrap. - * @param {number} bitmask The bitmask flags. - * 1 - `_.bind` - * 2 - `_.bindKey` - * 4 - `_.curry` or `_.curryRight` of a bound function - * 8 - `_.curry` - * 16 - `_.curryRight` - * 32 - `_.partial` - * 64 - `_.partialRight` - * 128 - `_.rearg` - * 256 - `_.ary` - * 512 - `_.flip` - * @param {*} [thisArg] The `this` binding of `func`. - * @param {Array} [partials] The arguments to be partially applied. - * @param {Array} [holders] The `partials` placeholder indexes. - * @param {Array} [argPos] The argument positions of the new function. - * @param {number} [ary] The arity cap of `func`. - * @param {number} [arity] The arity of `func`. - * @returns {Function} Returns the new wrapped function. - */ - function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) { - var isBindKey = bitmask & WRAP_BIND_KEY_FLAG; - if (!isBindKey && typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - var length = partials ? partials.length : 0; - if (!length) { - bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG); - partials = holders = undefined; - } - ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0); - arity = arity === undefined ? arity : toInteger(arity); - length -= holders ? holders.length : 0; - - if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) { - var partialsRight = partials, - holdersRight = holders; - - partials = holders = undefined; - } - var data = isBindKey ? undefined : getData(func); - - var newData = [ - func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, - argPos, ary, arity - ]; - - if (data) { - mergeData(newData, data); - } - func = newData[0]; - bitmask = newData[1]; - thisArg = newData[2]; - partials = newData[3]; - holders = newData[4]; - arity = newData[9] = newData[9] === undefined - ? (isBindKey ? 0 : func.length) - : nativeMax(newData[9] - length, 0); - - if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) { - bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG); - } - if (!bitmask || bitmask == WRAP_BIND_FLAG) { - var result = createBind(func, bitmask, thisArg); - } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) { - result = createCurry(func, bitmask, arity); - } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) { - result = createPartial(func, bitmask, thisArg, partials); - } else { - result = createHybrid.apply(undefined, newData); - } - var setter = data ? baseSetData : setData; - return setWrapToString(setter(result, newData), func, bitmask); - } - - /** - * Used by `_.defaults` to customize its `_.assignIn` use to assign properties - * of source objects to the destination object for all destination properties - * that resolve to `undefined`. - * - * @private - * @param {*} objValue The destination value. - * @param {*} srcValue The source value. - * @param {string} key The key of the property to assign. - * @param {Object} object The parent object of `objValue`. - * @returns {*} Returns the value to assign. - */ - function customDefaultsAssignIn(objValue, srcValue, key, object) { - if (objValue === undefined || - (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) { - return srcValue; - } - return objValue; - } - - /** - * Used by `_.defaultsDeep` to customize its `_.merge` use to merge source - * objects into destination objects that are passed thru. - * - * @private - * @param {*} objValue The destination value. - * @param {*} srcValue The source value. - * @param {string} key The key of the property to merge. - * @param {Object} object The parent object of `objValue`. - * @param {Object} source The parent object of `srcValue`. - * @param {Object} [stack] Tracks traversed source values and their merged - * counterparts. - * @returns {*} Returns the value to assign. - */ - function customDefaultsMerge(objValue, srcValue, key, object, source, stack) { - if (isObject(objValue) && isObject(srcValue)) { - // Recursively merge objects and arrays (susceptible to call stack limits). - stack.set(srcValue, objValue); - baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack); - stack['delete'](srcValue); - } - return objValue; - } - - /** - * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain - * objects. - * - * @private - * @param {*} value The value to inspect. - * @param {string} key The key of the property to inspect. - * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`. - */ - function customOmitClone(value) { - return isPlainObject(value) ? undefined : value; - } - - /** - * A specialized version of `baseIsEqualDeep` for arrays with support for - * partial deep comparisons. - * - * @private - * @param {Array} array The array to compare. - * @param {Array} other The other array to compare. - * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. - * @param {Function} customizer The function to customize comparisons. - * @param {Function} equalFunc The function to determine equivalents of values. - * @param {Object} stack Tracks traversed `array` and `other` objects. - * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`. - */ - function equalArrays(array, other, bitmask, customizer, equalFunc, stack) { - var isPartial = bitmask & COMPARE_PARTIAL_FLAG, - arrLength = array.length, - othLength = other.length; - - if (arrLength != othLength && !(isPartial && othLength > arrLength)) { - return false; - } - // Check that cyclic values are equal. - var arrStacked = stack.get(array); - var othStacked = stack.get(other); - if (arrStacked && othStacked) { - return arrStacked == other && othStacked == array; - } - var index = -1, - result = true, - seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined; - - stack.set(array, other); - stack.set(other, array); - - // Ignore non-index properties. - while (++index < arrLength) { - var arrValue = array[index], - othValue = other[index]; - - if (customizer) { - var compared = isPartial - ? customizer(othValue, arrValue, index, other, array, stack) - : customizer(arrValue, othValue, index, array, other, stack); - } - if (compared !== undefined) { - if (compared) { - continue; - } - result = false; - break; - } - // Recursively compare arrays (susceptible to call stack limits). - if (seen) { - if (!arraySome(other, function(othValue, othIndex) { - if (!cacheHas(seen, othIndex) && - (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) { - return seen.push(othIndex); - } - })) { - result = false; - break; - } - } else if (!( - arrValue === othValue || - equalFunc(arrValue, othValue, bitmask, customizer, stack) - )) { - result = false; - break; - } - } - stack['delete'](array); - stack['delete'](other); - return result; - } - - /** - * A specialized version of `baseIsEqualDeep` for comparing objects of - * the same `toStringTag`. - * - * **Note:** This function only supports comparing values with tags of - * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. - * - * @private - * @param {Object} object The object to compare. - * @param {Object} other The other object to compare. - * @param {string} tag The `toStringTag` of the objects to compare. - * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. - * @param {Function} customizer The function to customize comparisons. - * @param {Function} equalFunc The function to determine equivalents of values. - * @param {Object} stack Tracks traversed `object` and `other` objects. - * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. - */ - function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) { - switch (tag) { - case dataViewTag: - if ((object.byteLength != other.byteLength) || - (object.byteOffset != other.byteOffset)) { - return false; - } - object = object.buffer; - other = other.buffer; - - case arrayBufferTag: - if ((object.byteLength != other.byteLength) || - !equalFunc(new Uint8Array(object), new Uint8Array(other))) { - return false; - } - return true; - - case boolTag: - case dateTag: - case numberTag: - // Coerce booleans to `1` or `0` and dates to milliseconds. - // Invalid dates are coerced to `NaN`. - return eq(+object, +other); - - case errorTag: - return object.name == other.name && object.message == other.message; - - case regexpTag: - case stringTag: - // Coerce regexes to strings and treat strings, primitives and objects, - // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring - // for more details. - return object == (other + ''); - - case mapTag: - var convert = mapToArray; - - case setTag: - var isPartial = bitmask & COMPARE_PARTIAL_FLAG; - convert || (convert = setToArray); - - if (object.size != other.size && !isPartial) { - return false; - } - // Assume cyclic values are equal. - var stacked = stack.get(object); - if (stacked) { - return stacked == other; - } - bitmask |= COMPARE_UNORDERED_FLAG; - - // Recursively compare objects (susceptible to call stack limits). - stack.set(object, other); - var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack); - stack['delete'](object); - return result; - - case symbolTag: - if (symbolValueOf) { - return symbolValueOf.call(object) == symbolValueOf.call(other); - } - } - return false; - } - - /** - * A specialized version of `baseIsEqualDeep` for objects with support for - * partial deep comparisons. - * - * @private - * @param {Object} object The object to compare. - * @param {Object} other The other object to compare. - * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. - * @param {Function} customizer The function to customize comparisons. - * @param {Function} equalFunc The function to determine equivalents of values. - * @param {Object} stack Tracks traversed `object` and `other` objects. - * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. - */ - function equalObjects(object, other, bitmask, customizer, equalFunc, stack) { - var isPartial = bitmask & COMPARE_PARTIAL_FLAG, - objProps = getAllKeys(object), - objLength = objProps.length, - othProps = getAllKeys(other), - othLength = othProps.length; - - if (objLength != othLength && !isPartial) { - return false; - } - var index = objLength; - while (index--) { - var key = objProps[index]; - if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) { - return false; - } - } - // Check that cyclic values are equal. - var objStacked = stack.get(object); - var othStacked = stack.get(other); - if (objStacked && othStacked) { - return objStacked == other && othStacked == object; - } - var result = true; - stack.set(object, other); - stack.set(other, object); - - var skipCtor = isPartial; - while (++index < objLength) { - key = objProps[index]; - var objValue = object[key], - othValue = other[key]; - - if (customizer) { - var compared = isPartial - ? customizer(othValue, objValue, key, other, object, stack) - : customizer(objValue, othValue, key, object, other, stack); - } - // Recursively compare objects (susceptible to call stack limits). - if (!(compared === undefined - ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack)) - : compared - )) { - result = false; - break; - } - skipCtor || (skipCtor = key == 'constructor'); - } - if (result && !skipCtor) { - var objCtor = object.constructor, - othCtor = other.constructor; - - // Non `Object` object instances with different constructors are not equal. - if (objCtor != othCtor && - ('constructor' in object && 'constructor' in other) && - !(typeof objCtor == 'function' && objCtor instanceof objCtor && - typeof othCtor == 'function' && othCtor instanceof othCtor)) { - result = false; - } - } - stack['delete'](object); - stack['delete'](other); - return result; - } - - /** - * A specialized version of `baseRest` which flattens the rest array. - * - * @private - * @param {Function} func The function to apply a rest parameter to. - * @returns {Function} Returns the new function. - */ - function flatRest(func) { - return setToString(overRest(func, undefined, flatten), func + ''); - } - - /** - * Creates an array of own enumerable property names and symbols of `object`. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names and symbols. - */ - function getAllKeys(object) { - return baseGetAllKeys(object, keys, getSymbols); - } - - /** - * Creates an array of own and inherited enumerable property names and - * symbols of `object`. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names and symbols. - */ - function getAllKeysIn(object) { - return baseGetAllKeys(object, keysIn, getSymbolsIn); - } - - /** - * Gets metadata for `func`. - * - * @private - * @param {Function} func The function to query. - * @returns {*} Returns the metadata for `func`. - */ - var getData = !metaMap ? noop : function(func) { - return metaMap.get(func); - }; - - /** - * Gets the name of `func`. - * - * @private - * @param {Function} func The function to query. - * @returns {string} Returns the function name. - */ - function getFuncName(func) { - var result = (func.name + ''), - array = realNames[result], - length = hasOwnProperty.call(realNames, result) ? array.length : 0; - - while (length--) { - var data = array[length], - otherFunc = data.func; - if (otherFunc == null || otherFunc == func) { - return data.name; - } - } - return result; - } - - /** - * Gets the argument placeholder value for `func`. - * - * @private - * @param {Function} func The function to inspect. - * @returns {*} Returns the placeholder value. - */ - function getHolder(func) { - var object = hasOwnProperty.call(lodash, 'placeholder') ? lodash : func; - return object.placeholder; - } - - /** - * Gets the appropriate "iteratee" function. If `_.iteratee` is customized, - * this function returns the custom method, otherwise it returns `baseIteratee`. - * If arguments are provided, the chosen function is invoked with them and - * its result is returned. - * - * @private - * @param {*} [value] The value to convert to an iteratee. - * @param {number} [arity] The arity of the created iteratee. - * @returns {Function} Returns the chosen function or its result. - */ - function getIteratee() { - var result = lodash.iteratee || iteratee; - result = result === iteratee ? baseIteratee : result; - return arguments.length ? result(arguments[0], arguments[1]) : result; - } - - /** - * Gets the data for `map`. - * - * @private - * @param {Object} map The map to query. - * @param {string} key The reference key. - * @returns {*} Returns the map data. - */ - function getMapData(map, key) { - var data = map.__data__; - return isKeyable(key) - ? data[typeof key == 'string' ? 'string' : 'hash'] - : data.map; - } - - /** - * Gets the property names, values, and compare flags of `object`. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the match data of `object`. - */ - function getMatchData(object) { - var result = keys(object), - length = result.length; - - while (length--) { - var key = result[length], - value = object[key]; - - result[length] = [key, value, isStrictComparable(value)]; - } - return result; - } - - /** - * Gets the native function at `key` of `object`. - * - * @private - * @param {Object} object The object to query. - * @param {string} key The key of the method to get. - * @returns {*} Returns the function if it's native, else `undefined`. - */ - function getNative(object, key) { - var value = getValue(object, key); - return baseIsNative(value) ? value : undefined; - } - - /** - * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values. - * - * @private - * @param {*} value The value to query. - * @returns {string} Returns the raw `toStringTag`. - */ - function getRawTag(value) { - var isOwn = hasOwnProperty.call(value, symToStringTag), - tag = value[symToStringTag]; - - try { - value[symToStringTag] = undefined; - var unmasked = true; - } catch (e) {} - - var result = nativeObjectToString.call(value); - if (unmasked) { - if (isOwn) { - value[symToStringTag] = tag; - } else { - delete value[symToStringTag]; - } - } - return result; - } - - /** - * Creates an array of the own enumerable symbols of `object`. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of symbols. - */ - var getSymbols = !nativeGetSymbols ? stubArray : function(object) { - if (object == null) { - return []; - } - object = Object(object); - return arrayFilter(nativeGetSymbols(object), function(symbol) { - return propertyIsEnumerable.call(object, symbol); - }); - }; - - /** - * Creates an array of the own and inherited enumerable symbols of `object`. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of symbols. - */ - var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) { - var result = []; - while (object) { - arrayPush(result, getSymbols(object)); - object = getPrototype(object); - } - return result; - }; - - /** - * Gets the `toStringTag` of `value`. - * - * @private - * @param {*} value The value to query. - * @returns {string} Returns the `toStringTag`. - */ - var getTag = baseGetTag; - - // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6. - if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) || - (Map && getTag(new Map) != mapTag) || - (Promise && getTag(Promise.resolve()) != promiseTag) || - (Set && getTag(new Set) != setTag) || - (WeakMap && getTag(new WeakMap) != weakMapTag)) { - getTag = function(value) { - var result = baseGetTag(value), - Ctor = result == objectTag ? value.constructor : undefined, - ctorString = Ctor ? toSource(Ctor) : ''; - - if (ctorString) { - switch (ctorString) { - case dataViewCtorString: return dataViewTag; - case mapCtorString: return mapTag; - case promiseCtorString: return promiseTag; - case setCtorString: return setTag; - case weakMapCtorString: return weakMapTag; - } - } - return result; - }; - } - - /** - * Gets the view, applying any `transforms` to the `start` and `end` positions. - * - * @private - * @param {number} start The start of the view. - * @param {number} end The end of the view. - * @param {Array} transforms The transformations to apply to the view. - * @returns {Object} Returns an object containing the `start` and `end` - * positions of the view. - */ - function getView(start, end, transforms) { - var index = -1, - length = transforms.length; - - while (++index < length) { - var data = transforms[index], - size = data.size; - - switch (data.type) { - case 'drop': start += size; break; - case 'dropRight': end -= size; break; - case 'take': end = nativeMin(end, start + size); break; - case 'takeRight': start = nativeMax(start, end - size); break; - } - } - return { 'start': start, 'end': end }; - } - - /** - * Extracts wrapper details from the `source` body comment. - * - * @private - * @param {string} source The source to inspect. - * @returns {Array} Returns the wrapper details. - */ - function getWrapDetails(source) { - var match = source.match(reWrapDetails); - return match ? match[1].split(reSplitDetails) : []; - } - - /** - * Checks if `path` exists on `object`. - * - * @private - * @param {Object} object The object to query. - * @param {Array|string} path The path to check. - * @param {Function} hasFunc The function to check properties. - * @returns {boolean} Returns `true` if `path` exists, else `false`. - */ - function hasPath(object, path, hasFunc) { - path = castPath(path, object); - - var index = -1, - length = path.length, - result = false; - - while (++index < length) { - var key = toKey(path[index]); - if (!(result = object != null && hasFunc(object, key))) { - break; - } - object = object[key]; - } - if (result || ++index != length) { - return result; - } - length = object == null ? 0 : object.length; - return !!length && isLength(length) && isIndex(key, length) && - (isArray(object) || isArguments(object)); - } - - /** - * Initializes an array clone. - * - * @private - * @param {Array} array The array to clone. - * @returns {Array} Returns the initialized clone. - */ - function initCloneArray(array) { - var length = array.length, - result = new array.constructor(length); - - // Add properties assigned by `RegExp#exec`. - if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) { - result.index = array.index; - result.input = array.input; - } - return result; - } - - /** - * Initializes an object clone. - * - * @private - * @param {Object} object The object to clone. - * @returns {Object} Returns the initialized clone. - */ - function initCloneObject(object) { - return (typeof object.constructor == 'function' && !isPrototype(object)) - ? baseCreate(getPrototype(object)) - : {}; - } - - /** - * Initializes an object clone based on its `toStringTag`. - * - * **Note:** This function only supports cloning values with tags of - * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`. - * - * @private - * @param {Object} object The object to clone. - * @param {string} tag The `toStringTag` of the object to clone. - * @param {boolean} [isDeep] Specify a deep clone. - * @returns {Object} Returns the initialized clone. - */ - function initCloneByTag(object, tag, isDeep) { - var Ctor = object.constructor; - switch (tag) { - case arrayBufferTag: - return cloneArrayBuffer(object); - - case boolTag: - case dateTag: - return new Ctor(+object); - - case dataViewTag: - return cloneDataView(object, isDeep); - - case float32Tag: case float64Tag: - case int8Tag: case int16Tag: case int32Tag: - case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag: - return cloneTypedArray(object, isDeep); - - case mapTag: - return new Ctor; - - case numberTag: - case stringTag: - return new Ctor(object); - - case regexpTag: - return cloneRegExp(object); - - case setTag: - return new Ctor; - - case symbolTag: - return cloneSymbol(object); - } - } - - /** - * Inserts wrapper `details` in a comment at the top of the `source` body. - * - * @private - * @param {string} source The source to modify. - * @returns {Array} details The details to insert. - * @returns {string} Returns the modified source. - */ - function insertWrapDetails(source, details) { - var length = details.length; - if (!length) { - return source; - } - var lastIndex = length - 1; - details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex]; - details = details.join(length > 2 ? ', ' : ' '); - return source.replace(reWrapComment, '{\n/* [wrapped with ' + details + '] */\n'); - } - - /** - * Checks if `value` is a flattenable `arguments` object or array. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is flattenable, else `false`. - */ - function isFlattenable(value) { - return isArray(value) || isArguments(value) || - !!(spreadableSymbol && value && value[spreadableSymbol]); - } - - /** - * Checks if `value` is a valid array-like index. - * - * @private - * @param {*} value The value to check. - * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. - * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. - */ - function isIndex(value, length) { - var type = typeof value; - length = length == null ? MAX_SAFE_INTEGER : length; - - return !!length && - (type == 'number' || - (type != 'symbol' && reIsUint.test(value))) && - (value > -1 && value % 1 == 0 && value < length); - } - - /** - * Checks if the given arguments are from an iteratee call. - * - * @private - * @param {*} value The potential iteratee value argument. - * @param {*} index The potential iteratee index or key argument. - * @param {*} object The potential iteratee object argument. - * @returns {boolean} Returns `true` if the arguments are from an iteratee call, - * else `false`. - */ - function isIterateeCall(value, index, object) { - if (!isObject(object)) { - return false; - } - var type = typeof index; - if (type == 'number' - ? (isArrayLike(object) && isIndex(index, object.length)) - : (type == 'string' && index in object) - ) { - return eq(object[index], value); - } - return false; - } - - /** - * Checks if `value` is a property name and not a property path. - * - * @private - * @param {*} value The value to check. - * @param {Object} [object] The object to query keys on. - * @returns {boolean} Returns `true` if `value` is a property name, else `false`. - */ - function isKey(value, object) { - if (isArray(value)) { - return false; - } - var type = typeof value; - if (type == 'number' || type == 'symbol' || type == 'boolean' || - value == null || isSymbol(value)) { - return true; - } - return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || - (object != null && value in Object(object)); - } - - /** - * Checks if `value` is suitable for use as unique object key. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is suitable, else `false`. - */ - function isKeyable(value) { - var type = typeof value; - return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') - ? (value !== '__proto__') - : (value === null); - } - - /** - * Checks if `func` has a lazy counterpart. - * - * @private - * @param {Function} func The function to check. - * @returns {boolean} Returns `true` if `func` has a lazy counterpart, - * else `false`. - */ - function isLaziable(func) { - var funcName = getFuncName(func), - other = lodash[funcName]; - - if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) { - return false; - } - if (func === other) { - return true; - } - var data = getData(other); - return !!data && func === data[0]; - } - - /** - * Checks if `func` has its source masked. - * - * @private - * @param {Function} func The function to check. - * @returns {boolean} Returns `true` if `func` is masked, else `false`. - */ - function isMasked(func) { - return !!maskSrcKey && (maskSrcKey in func); - } - - /** - * Checks if `func` is capable of being masked. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `func` is maskable, else `false`. - */ - var isMaskable = coreJsData ? isFunction : stubFalse; - - /** - * Checks if `value` is likely a prototype object. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a prototype, else `false`. - */ - function isPrototype(value) { - var Ctor = value && value.constructor, - proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto; - - return value === proto; - } - - /** - * Checks if `value` is suitable for strict equality comparisons, i.e. `===`. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` if suitable for strict - * equality comparisons, else `false`. - */ - function isStrictComparable(value) { - return value === value && !isObject(value); - } - - /** - * A specialized version of `matchesProperty` for source values suitable - * for strict equality comparisons, i.e. `===`. - * - * @private - * @param {string} key The key of the property to get. - * @param {*} srcValue The value to match. - * @returns {Function} Returns the new spec function. - */ - function matchesStrictComparable(key, srcValue) { - return function(object) { - if (object == null) { - return false; - } - return object[key] === srcValue && - (srcValue !== undefined || (key in Object(object))); - }; - } - - /** - * A specialized version of `_.memoize` which clears the memoized function's - * cache when it exceeds `MAX_MEMOIZE_SIZE`. - * - * @private - * @param {Function} func The function to have its output memoized. - * @returns {Function} Returns the new memoized function. - */ - function memoizeCapped(func) { - var result = memoize(func, function(key) { - if (cache.size === MAX_MEMOIZE_SIZE) { - cache.clear(); - } - return key; - }); - - var cache = result.cache; - return result; - } - - /** - * Merges the function metadata of `source` into `data`. - * - * Merging metadata reduces the number of wrappers used to invoke a function. - * This is possible because methods like `_.bind`, `_.curry`, and `_.partial` - * may be applied regardless of execution order. Methods like `_.ary` and - * `_.rearg` modify function arguments, making the order in which they are - * executed important, preventing the merging of metadata. However, we make - * an exception for a safe combined case where curried functions have `_.ary` - * and or `_.rearg` applied. - * - * @private - * @param {Array} data The destination metadata. - * @param {Array} source The source metadata. - * @returns {Array} Returns `data`. - */ - function mergeData(data, source) { - var bitmask = data[1], - srcBitmask = source[1], - newBitmask = bitmask | srcBitmask, - isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG); - - var isCombo = - ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) || - ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) || - ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG)); - - // Exit early if metadata can't be merged. - if (!(isCommon || isCombo)) { - return data; - } - // Use source `thisArg` if available. - if (srcBitmask & WRAP_BIND_FLAG) { - data[2] = source[2]; - // Set when currying a bound function. - newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG; - } - // Compose partial arguments. - var value = source[3]; - if (value) { - var partials = data[3]; - data[3] = partials ? composeArgs(partials, value, source[4]) : value; - data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4]; - } - // Compose partial right arguments. - value = source[5]; - if (value) { - partials = data[5]; - data[5] = partials ? composeArgsRight(partials, value, source[6]) : value; - data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6]; - } - // Use source `argPos` if available. - value = source[7]; - if (value) { - data[7] = value; - } - // Use source `ary` if it's smaller. - if (srcBitmask & WRAP_ARY_FLAG) { - data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]); - } - // Use source `arity` if one is not provided. - if (data[9] == null) { - data[9] = source[9]; - } - // Use source `func` and merge bitmasks. - data[0] = source[0]; - data[1] = newBitmask; - - return data; - } - - /** - * This function is like - * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) - * except that it includes inherited enumerable properties. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. - */ - function nativeKeysIn(object) { - var result = []; - if (object != null) { - for (var key in Object(object)) { - result.push(key); - } - } - return result; - } - - /** - * Converts `value` to a string using `Object.prototype.toString`. - * - * @private - * @param {*} value The value to convert. - * @returns {string} Returns the converted string. - */ - function objectToString(value) { - return nativeObjectToString.call(value); - } - - /** - * A specialized version of `baseRest` which transforms the rest array. - * - * @private - * @param {Function} func The function to apply a rest parameter to. - * @param {number} [start=func.length-1] The start position of the rest parameter. - * @param {Function} transform The rest array transform. - * @returns {Function} Returns the new function. - */ - function overRest(func, start, transform) { - start = nativeMax(start === undefined ? (func.length - 1) : start, 0); - return function() { - var args = arguments, - index = -1, - length = nativeMax(args.length - start, 0), - array = Array(length); - - while (++index < length) { - array[index] = args[start + index]; - } - index = -1; - var otherArgs = Array(start + 1); - while (++index < start) { - otherArgs[index] = args[index]; - } - otherArgs[start] = transform(array); - return apply(func, this, otherArgs); - }; - } - - /** - * Gets the parent value at `path` of `object`. - * - * @private - * @param {Object} object The object to query. - * @param {Array} path The path to get the parent value of. - * @returns {*} Returns the parent value. - */ - function parent(object, path) { - return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1)); - } - - /** - * Reorder `array` according to the specified indexes where the element at - * the first index is assigned as the first element, the element at - * the second index is assigned as the second element, and so on. - * - * @private - * @param {Array} array The array to reorder. - * @param {Array} indexes The arranged array indexes. - * @returns {Array} Returns `array`. - */ - function reorder(array, indexes) { - var arrLength = array.length, - length = nativeMin(indexes.length, arrLength), - oldArray = copyArray(array); - - while (length--) { - var index = indexes[length]; - array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined; - } - return array; - } - - /** - * Gets the value at `key`, unless `key` is "__proto__" or "constructor". - * - * @private - * @param {Object} object The object to query. - * @param {string} key The key of the property to get. - * @returns {*} Returns the property value. - */ - function safeGet(object, key) { - if (key === 'constructor' && typeof object[key] === 'function') { - return; - } - - if (key == '__proto__') { - return; - } - - return object[key]; - } - - /** - * Sets metadata for `func`. - * - * **Note:** If this function becomes hot, i.e. is invoked a lot in a short - * period of time, it will trip its breaker and transition to an identity - * function to avoid garbage collection pauses in V8. See - * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070) - * for more details. - * - * @private - * @param {Function} func The function to associate metadata with. - * @param {*} data The metadata. - * @returns {Function} Returns `func`. - */ - var setData = shortOut(baseSetData); - - /** - * A simple wrapper around the global [`setTimeout`](https://mdn.io/setTimeout). - * - * @private - * @param {Function} func The function to delay. - * @param {number} wait The number of milliseconds to delay invocation. - * @returns {number|Object} Returns the timer id or timeout object. - */ - var setTimeout = ctxSetTimeout || function(func, wait) { - return root.setTimeout(func, wait); - }; - - /** - * Sets the `toString` method of `func` to return `string`. - * - * @private - * @param {Function} func The function to modify. - * @param {Function} string The `toString` result. - * @returns {Function} Returns `func`. - */ - var setToString = shortOut(baseSetToString); - - /** - * Sets the `toString` method of `wrapper` to mimic the source of `reference` - * with wrapper details in a comment at the top of the source body. - * - * @private - * @param {Function} wrapper The function to modify. - * @param {Function} reference The reference function. - * @param {number} bitmask The bitmask flags. See `createWrap` for more details. - * @returns {Function} Returns `wrapper`. - */ - function setWrapToString(wrapper, reference, bitmask) { - var source = (reference + ''); - return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask))); - } - - /** - * Creates a function that'll short out and invoke `identity` instead - * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN` - * milliseconds. - * - * @private - * @param {Function} func The function to restrict. - * @returns {Function} Returns the new shortable function. - */ - function shortOut(func) { - var count = 0, - lastCalled = 0; - - return function() { - var stamp = nativeNow(), - remaining = HOT_SPAN - (stamp - lastCalled); - - lastCalled = stamp; - if (remaining > 0) { - if (++count >= HOT_COUNT) { - return arguments[0]; - } - } else { - count = 0; - } - return func.apply(undefined, arguments); - }; - } - - /** - * A specialized version of `_.shuffle` which mutates and sets the size of `array`. - * - * @private - * @param {Array} array The array to shuffle. - * @param {number} [size=array.length] The size of `array`. - * @returns {Array} Returns `array`. - */ - function shuffleSelf(array, size) { - var index = -1, - length = array.length, - lastIndex = length - 1; - - size = size === undefined ? length : size; - while (++index < size) { - var rand = baseRandom(index, lastIndex), - value = array[rand]; - - array[rand] = array[index]; - array[index] = value; - } - array.length = size; - return array; - } - - /** - * Converts `string` to a property path array. - * - * @private - * @param {string} string The string to convert. - * @returns {Array} Returns the property path array. - */ - var stringToPath = memoizeCapped(function(string) { - var result = []; - if (string.charCodeAt(0) === 46 /* . */) { - result.push(''); - } - string.replace(rePropName, function(match, number, quote, subString) { - result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match)); - }); - return result; - }); - - /** - * Converts `value` to a string key if it's not a string or symbol. - * - * @private - * @param {*} value The value to inspect. - * @returns {string|symbol} Returns the key. - */ - function toKey(value) { - if (typeof value == 'string' || isSymbol(value)) { - return value; - } - var result = (value + ''); - return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; - } - - /** - * Converts `func` to its source code. - * - * @private - * @param {Function} func The function to convert. - * @returns {string} Returns the source code. - */ - function toSource(func) { - if (func != null) { - try { - return funcToString.call(func); - } catch (e) {} - try { - return (func + ''); - } catch (e) {} - } - return ''; - } - - /** - * Updates wrapper `details` based on `bitmask` flags. - * - * @private - * @returns {Array} details The details to modify. - * @param {number} bitmask The bitmask flags. See `createWrap` for more details. - * @returns {Array} Returns `details`. - */ - function updateWrapDetails(details, bitmask) { - arrayEach(wrapFlags, function(pair) { - var value = '_.' + pair[0]; - if ((bitmask & pair[1]) && !arrayIncludes(details, value)) { - details.push(value); - } - }); - return details.sort(); - } - - /** - * Creates a clone of `wrapper`. - * - * @private - * @param {Object} wrapper The wrapper to clone. - * @returns {Object} Returns the cloned wrapper. - */ - function wrapperClone(wrapper) { - if (wrapper instanceof LazyWrapper) { - return wrapper.clone(); - } - var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__); - result.__actions__ = copyArray(wrapper.__actions__); - result.__index__ = wrapper.__index__; - result.__values__ = wrapper.__values__; - return result; - } - - /*------------------------------------------------------------------------*/ - - /** - * Creates an array of elements split into groups the length of `size`. - * If `array` can't be split evenly, the final chunk will be the remaining - * elements. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Array - * @param {Array} array The array to process. - * @param {number} [size=1] The length of each chunk - * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. - * @returns {Array} Returns the new array of chunks. - * @example - * - * _.chunk(['a', 'b', 'c', 'd'], 2); - * // => [['a', 'b'], ['c', 'd']] - * - * _.chunk(['a', 'b', 'c', 'd'], 3); - * // => [['a', 'b', 'c'], ['d']] - */ - function chunk(array, size, guard) { - if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) { - size = 1; - } else { - size = nativeMax(toInteger(size), 0); - } - var length = array == null ? 0 : array.length; - if (!length || size < 1) { - return []; - } - var index = 0, - resIndex = 0, - result = Array(nativeCeil(length / size)); - - while (index < length) { - result[resIndex++] = baseSlice(array, index, (index += size)); - } - return result; - } - - /** - * Creates an array with all falsey values removed. The values `false`, `null`, - * `0`, `""`, `undefined`, and `NaN` are falsey. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Array - * @param {Array} array The array to compact. - * @returns {Array} Returns the new array of filtered values. - * @example - * - * _.compact([0, 1, false, 2, '', 3]); - * // => [1, 2, 3] - */ - function compact(array) { - var index = -1, - length = array == null ? 0 : array.length, - resIndex = 0, - result = []; - - while (++index < length) { - var value = array[index]; - if (value) { - result[resIndex++] = value; - } - } - return result; - } - - /** - * Creates a new array concatenating `array` with any additional arrays - * and/or values. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {Array} array The array to concatenate. - * @param {...*} [values] The values to concatenate. - * @returns {Array} Returns the new concatenated array. - * @example - * - * var array = [1]; - * var other = _.concat(array, 2, [3], [[4]]); - * - * console.log(other); - * // => [1, 2, 3, [4]] - * - * console.log(array); - * // => [1] - */ - function concat() { - var length = arguments.length; - if (!length) { - return []; - } - var args = Array(length - 1), - array = arguments[0], - index = length; - - while (index--) { - args[index - 1] = arguments[index]; - } - return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1)); - } - - /** - * Creates an array of `array` values not included in the other given arrays - * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) - * for equality comparisons. The order and references of result values are - * determined by the first array. - * - * **Note:** Unlike `_.pullAll`, this method returns a new array. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Array - * @param {Array} array The array to inspect. - * @param {...Array} [values] The values to exclude. - * @returns {Array} Returns the new array of filtered values. - * @see _.without, _.xor - * @example - * - * _.difference([2, 1], [2, 3]); - * // => [1] - */ - var difference = baseRest(function(array, values) { - return isArrayLikeObject(array) - ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true)) - : []; - }); - - /** - * This method is like `_.difference` except that it accepts `iteratee` which - * is invoked for each element of `array` and `values` to generate the criterion - * by which they're compared. The order and references of result values are - * determined by the first array. The iteratee is invoked with one argument: - * (value). - * - * **Note:** Unlike `_.pullAllBy`, this method returns a new array. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {Array} array The array to inspect. - * @param {...Array} [values] The values to exclude. - * @param {Function} [iteratee=_.identity] The iteratee invoked per element. - * @returns {Array} Returns the new array of filtered values. - * @example - * - * _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor); - * // => [1.2] - * - * // The `_.property` iteratee shorthand. - * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x'); - * // => [{ 'x': 2 }] - */ - var differenceBy = baseRest(function(array, values) { - var iteratee = last(values); - if (isArrayLikeObject(iteratee)) { - iteratee = undefined; - } - return isArrayLikeObject(array) - ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee, 2)) - : []; - }); - - /** - * This method is like `_.difference` except that it accepts `comparator` - * which is invoked to compare elements of `array` to `values`. The order and - * references of result values are determined by the first array. The comparator - * is invoked with two arguments: (arrVal, othVal). - * - * **Note:** Unlike `_.pullAllWith`, this method returns a new array. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {Array} array The array to inspect. - * @param {...Array} [values] The values to exclude. - * @param {Function} [comparator] The comparator invoked per element. - * @returns {Array} Returns the new array of filtered values. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; - * - * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual); - * // => [{ 'x': 2, 'y': 1 }] - */ - var differenceWith = baseRest(function(array, values) { - var comparator = last(values); - if (isArrayLikeObject(comparator)) { - comparator = undefined; - } - return isArrayLikeObject(array) - ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator) - : []; - }); - - /** - * Creates a slice of `array` with `n` elements dropped from the beginning. - * - * @static - * @memberOf _ - * @since 0.5.0 - * @category Array - * @param {Array} array The array to query. - * @param {number} [n=1] The number of elements to drop. - * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. - * @returns {Array} Returns the slice of `array`. - * @example - * - * _.drop([1, 2, 3]); - * // => [2, 3] - * - * _.drop([1, 2, 3], 2); - * // => [3] - * - * _.drop([1, 2, 3], 5); - * // => [] - * - * _.drop([1, 2, 3], 0); - * // => [1, 2, 3] - */ - function drop(array, n, guard) { - var length = array == null ? 0 : array.length; - if (!length) { - return []; - } - n = (guard || n === undefined) ? 1 : toInteger(n); - return baseSlice(array, n < 0 ? 0 : n, length); - } - - /** - * Creates a slice of `array` with `n` elements dropped from the end. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Array - * @param {Array} array The array to query. - * @param {number} [n=1] The number of elements to drop. - * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. - * @returns {Array} Returns the slice of `array`. - * @example - * - * _.dropRight([1, 2, 3]); - * // => [1, 2] - * - * _.dropRight([1, 2, 3], 2); - * // => [1] - * - * _.dropRight([1, 2, 3], 5); - * // => [] - * - * _.dropRight([1, 2, 3], 0); - * // => [1, 2, 3] - */ - function dropRight(array, n, guard) { - var length = array == null ? 0 : array.length; - if (!length) { - return []; - } - n = (guard || n === undefined) ? 1 : toInteger(n); - n = length - n; - return baseSlice(array, 0, n < 0 ? 0 : n); - } - - /** - * Creates a slice of `array` excluding elements dropped from the end. - * Elements are dropped until `predicate` returns falsey. The predicate is - * invoked with three arguments: (value, index, array). - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Array - * @param {Array} array The array to query. - * @param {Function} [predicate=_.identity] The function invoked per iteration. - * @returns {Array} Returns the slice of `array`. - * @example - * - * var users = [ - * { 'user': 'barney', 'active': true }, - * { 'user': 'fred', 'active': false }, - * { 'user': 'pebbles', 'active': false } - * ]; - * - * _.dropRightWhile(users, function(o) { return !o.active; }); - * // => objects for ['barney'] - * - * // The `_.matches` iteratee shorthand. - * _.dropRightWhile(users, { 'user': 'pebbles', 'active': false }); - * // => objects for ['barney', 'fred'] - * - * // The `_.matchesProperty` iteratee shorthand. - * _.dropRightWhile(users, ['active', false]); - * // => objects for ['barney'] - * - * // The `_.property` iteratee shorthand. - * _.dropRightWhile(users, 'active'); - * // => objects for ['barney', 'fred', 'pebbles'] - */ - function dropRightWhile(array, predicate) { - return (array && array.length) - ? baseWhile(array, getIteratee(predicate, 3), true, true) - : []; - } - - /** - * Creates a slice of `array` excluding elements dropped from the beginning. - * Elements are dropped until `predicate` returns falsey. The predicate is - * invoked with three arguments: (value, index, array). - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Array - * @param {Array} array The array to query. - * @param {Function} [predicate=_.identity] The function invoked per iteration. - * @returns {Array} Returns the slice of `array`. - * @example - * - * var users = [ - * { 'user': 'barney', 'active': false }, - * { 'user': 'fred', 'active': false }, - * { 'user': 'pebbles', 'active': true } - * ]; - * - * _.dropWhile(users, function(o) { return !o.active; }); - * // => objects for ['pebbles'] - * - * // The `_.matches` iteratee shorthand. - * _.dropWhile(users, { 'user': 'barney', 'active': false }); - * // => objects for ['fred', 'pebbles'] - * - * // The `_.matchesProperty` iteratee shorthand. - * _.dropWhile(users, ['active', false]); - * // => objects for ['pebbles'] - * - * // The `_.property` iteratee shorthand. - * _.dropWhile(users, 'active'); - * // => objects for ['barney', 'fred', 'pebbles'] - */ - function dropWhile(array, predicate) { - return (array && array.length) - ? baseWhile(array, getIteratee(predicate, 3), true) - : []; - } - - /** - * Fills elements of `array` with `value` from `start` up to, but not - * including, `end`. - * - * **Note:** This method mutates `array`. - * - * @static - * @memberOf _ - * @since 3.2.0 - * @category Array - * @param {Array} array The array to fill. - * @param {*} value The value to fill `array` with. - * @param {number} [start=0] The start position. - * @param {number} [end=array.length] The end position. - * @returns {Array} Returns `array`. - * @example - * - * var array = [1, 2, 3]; - * - * _.fill(array, 'a'); - * console.log(array); - * // => ['a', 'a', 'a'] - * - * _.fill(Array(3), 2); - * // => [2, 2, 2] - * - * _.fill([4, 6, 8, 10], '*', 1, 3); - * // => [4, '*', '*', 10] - */ - function fill(array, value, start, end) { - var length = array == null ? 0 : array.length; - if (!length) { - return []; - } - if (start && typeof start != 'number' && isIterateeCall(array, value, start)) { - start = 0; - end = length; - } - return baseFill(array, value, start, end); - } - - /** - * This method is like `_.find` except that it returns the index of the first - * element `predicate` returns truthy for instead of the element itself. - * - * @static - * @memberOf _ - * @since 1.1.0 - * @category Array - * @param {Array} array The array to inspect. - * @param {Function} [predicate=_.identity] The function invoked per iteration. - * @param {number} [fromIndex=0] The index to search from. - * @returns {number} Returns the index of the found element, else `-1`. - * @example - * - * var users = [ - * { 'user': 'barney', 'active': false }, - * { 'user': 'fred', 'active': false }, - * { 'user': 'pebbles', 'active': true } - * ]; - * - * _.findIndex(users, function(o) { return o.user == 'barney'; }); - * // => 0 - * - * // The `_.matches` iteratee shorthand. - * _.findIndex(users, { 'user': 'fred', 'active': false }); - * // => 1 - * - * // The `_.matchesProperty` iteratee shorthand. - * _.findIndex(users, ['active', false]); - * // => 0 - * - * // The `_.property` iteratee shorthand. - * _.findIndex(users, 'active'); - * // => 2 - */ - function findIndex(array, predicate, fromIndex) { - var length = array == null ? 0 : array.length; - if (!length) { - return -1; - } - var index = fromIndex == null ? 0 : toInteger(fromIndex); - if (index < 0) { - index = nativeMax(length + index, 0); - } - return baseFindIndex(array, getIteratee(predicate, 3), index); - } - - /** - * This method is like `_.findIndex` except that it iterates over elements - * of `collection` from right to left. - * - * @static - * @memberOf _ - * @since 2.0.0 - * @category Array - * @param {Array} array The array to inspect. - * @param {Function} [predicate=_.identity] The function invoked per iteration. - * @param {number} [fromIndex=array.length-1] The index to search from. - * @returns {number} Returns the index of the found element, else `-1`. - * @example - * - * var users = [ - * { 'user': 'barney', 'active': true }, - * { 'user': 'fred', 'active': false }, - * { 'user': 'pebbles', 'active': false } - * ]; - * - * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; }); - * // => 2 - * - * // The `_.matches` iteratee shorthand. - * _.findLastIndex(users, { 'user': 'barney', 'active': true }); - * // => 0 - * - * // The `_.matchesProperty` iteratee shorthand. - * _.findLastIndex(users, ['active', false]); - * // => 2 - * - * // The `_.property` iteratee shorthand. - * _.findLastIndex(users, 'active'); - * // => 0 - */ - function findLastIndex(array, predicate, fromIndex) { - var length = array == null ? 0 : array.length; - if (!length) { - return -1; - } - var index = length - 1; - if (fromIndex !== undefined) { - index = toInteger(fromIndex); - index = fromIndex < 0 - ? nativeMax(length + index, 0) - : nativeMin(index, length - 1); - } - return baseFindIndex(array, getIteratee(predicate, 3), index, true); - } - - /** - * Flattens `array` a single level deep. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Array - * @param {Array} array The array to flatten. - * @returns {Array} Returns the new flattened array. - * @example - * - * _.flatten([1, [2, [3, [4]], 5]]); - * // => [1, 2, [3, [4]], 5] - */ - function flatten(array) { - var length = array == null ? 0 : array.length; - return length ? baseFlatten(array, 1) : []; - } - - /** - * Recursively flattens `array`. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Array - * @param {Array} array The array to flatten. - * @returns {Array} Returns the new flattened array. - * @example - * - * _.flattenDeep([1, [2, [3, [4]], 5]]); - * // => [1, 2, 3, 4, 5] - */ - function flattenDeep(array) { - var length = array == null ? 0 : array.length; - return length ? baseFlatten(array, INFINITY) : []; - } - - /** - * Recursively flatten `array` up to `depth` times. - * - * @static - * @memberOf _ - * @since 4.4.0 - * @category Array - * @param {Array} array The array to flatten. - * @param {number} [depth=1] The maximum recursion depth. - * @returns {Array} Returns the new flattened array. - * @example - * - * var array = [1, [2, [3, [4]], 5]]; - * - * _.flattenDepth(array, 1); - * // => [1, 2, [3, [4]], 5] - * - * _.flattenDepth(array, 2); - * // => [1, 2, 3, [4], 5] - */ - function flattenDepth(array, depth) { - var length = array == null ? 0 : array.length; - if (!length) { - return []; - } - depth = depth === undefined ? 1 : toInteger(depth); - return baseFlatten(array, depth); - } - - /** - * The inverse of `_.toPairs`; this method returns an object composed - * from key-value `pairs`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {Array} pairs The key-value pairs. - * @returns {Object} Returns the new object. - * @example - * - * _.fromPairs([['a', 1], ['b', 2]]); - * // => { 'a': 1, 'b': 2 } - */ - function fromPairs(pairs) { - var index = -1, - length = pairs == null ? 0 : pairs.length, - result = {}; - - while (++index < length) { - var pair = pairs[index]; - result[pair[0]] = pair[1]; - } - return result; - } - - /** - * Gets the first element of `array`. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @alias first - * @category Array - * @param {Array} array The array to query. - * @returns {*} Returns the first element of `array`. - * @example - * - * _.head([1, 2, 3]); - * // => 1 - * - * _.head([]); - * // => undefined - */ - function head(array) { - return (array && array.length) ? array[0] : undefined; - } - - /** - * Gets the index at which the first occurrence of `value` is found in `array` - * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) - * for equality comparisons. If `fromIndex` is negative, it's used as the - * offset from the end of `array`. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Array - * @param {Array} array The array to inspect. - * @param {*} value The value to search for. - * @param {number} [fromIndex=0] The index to search from. - * @returns {number} Returns the index of the matched value, else `-1`. - * @example - * - * _.indexOf([1, 2, 1, 2], 2); - * // => 1 - * - * // Search from the `fromIndex`. - * _.indexOf([1, 2, 1, 2], 2, 2); - * // => 3 - */ - function indexOf(array, value, fromIndex) { - var length = array == null ? 0 : array.length; - if (!length) { - return -1; - } - var index = fromIndex == null ? 0 : toInteger(fromIndex); - if (index < 0) { - index = nativeMax(length + index, 0); - } - return baseIndexOf(array, value, index); - } - - /** - * Gets all but the last element of `array`. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Array - * @param {Array} array The array to query. - * @returns {Array} Returns the slice of `array`. - * @example - * - * _.initial([1, 2, 3]); - * // => [1, 2] - */ - function initial(array) { - var length = array == null ? 0 : array.length; - return length ? baseSlice(array, 0, -1) : []; - } - - /** - * Creates an array of unique values that are included in all given arrays - * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) - * for equality comparisons. The order and references of result values are - * determined by the first array. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Array - * @param {...Array} [arrays] The arrays to inspect. - * @returns {Array} Returns the new array of intersecting values. - * @example - * - * _.intersection([2, 1], [2, 3]); - * // => [2] - */ - var intersection = baseRest(function(arrays) { - var mapped = arrayMap(arrays, castArrayLikeObject); - return (mapped.length && mapped[0] === arrays[0]) - ? baseIntersection(mapped) - : []; - }); - - /** - * This method is like `_.intersection` except that it accepts `iteratee` - * which is invoked for each element of each `arrays` to generate the criterion - * by which they're compared. The order and references of result values are - * determined by the first array. The iteratee is invoked with one argument: - * (value). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {...Array} [arrays] The arrays to inspect. - * @param {Function} [iteratee=_.identity] The iteratee invoked per element. - * @returns {Array} Returns the new array of intersecting values. - * @example - * - * _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor); - * // => [2.1] - * - * // The `_.property` iteratee shorthand. - * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); - * // => [{ 'x': 1 }] - */ - var intersectionBy = baseRest(function(arrays) { - var iteratee = last(arrays), - mapped = arrayMap(arrays, castArrayLikeObject); - - if (iteratee === last(mapped)) { - iteratee = undefined; - } else { - mapped.pop(); - } - return (mapped.length && mapped[0] === arrays[0]) - ? baseIntersection(mapped, getIteratee(iteratee, 2)) - : []; - }); - - /** - * This method is like `_.intersection` except that it accepts `comparator` - * which is invoked to compare elements of `arrays`. The order and references - * of result values are determined by the first array. The comparator is - * invoked with two arguments: (arrVal, othVal). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {...Array} [arrays] The arrays to inspect. - * @param {Function} [comparator] The comparator invoked per element. - * @returns {Array} Returns the new array of intersecting values. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; - * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; - * - * _.intersectionWith(objects, others, _.isEqual); - * // => [{ 'x': 1, 'y': 2 }] - */ - var intersectionWith = baseRest(function(arrays) { - var comparator = last(arrays), - mapped = arrayMap(arrays, castArrayLikeObject); - - comparator = typeof comparator == 'function' ? comparator : undefined; - if (comparator) { - mapped.pop(); - } - return (mapped.length && mapped[0] === arrays[0]) - ? baseIntersection(mapped, undefined, comparator) - : []; - }); - - /** - * Converts all elements in `array` into a string separated by `separator`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {Array} array The array to convert. - * @param {string} [separator=','] The element separator. - * @returns {string} Returns the joined string. - * @example - * - * _.join(['a', 'b', 'c'], '~'); - * // => 'a~b~c' - */ - function join(array, separator) { - return array == null ? '' : nativeJoin.call(array, separator); - } - - /** - * Gets the last element of `array`. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Array - * @param {Array} array The array to query. - * @returns {*} Returns the last element of `array`. - * @example - * - * _.last([1, 2, 3]); - * // => 3 - */ - function last(array) { - var length = array == null ? 0 : array.length; - return length ? array[length - 1] : undefined; - } - - /** - * This method is like `_.indexOf` except that it iterates over elements of - * `array` from right to left. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Array - * @param {Array} array The array to inspect. - * @param {*} value The value to search for. - * @param {number} [fromIndex=array.length-1] The index to search from. - * @returns {number} Returns the index of the matched value, else `-1`. - * @example - * - * _.lastIndexOf([1, 2, 1, 2], 2); - * // => 3 - * - * // Search from the `fromIndex`. - * _.lastIndexOf([1, 2, 1, 2], 2, 2); - * // => 1 - */ - function lastIndexOf(array, value, fromIndex) { - var length = array == null ? 0 : array.length; - if (!length) { - return -1; - } - var index = length; - if (fromIndex !== undefined) { - index = toInteger(fromIndex); - index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1); - } - return value === value - ? strictLastIndexOf(array, value, index) - : baseFindIndex(array, baseIsNaN, index, true); - } - - /** - * Gets the element at index `n` of `array`. If `n` is negative, the nth - * element from the end is returned. - * - * @static - * @memberOf _ - * @since 4.11.0 - * @category Array - * @param {Array} array The array to query. - * @param {number} [n=0] The index of the element to return. - * @returns {*} Returns the nth element of `array`. - * @example - * - * var array = ['a', 'b', 'c', 'd']; - * - * _.nth(array, 1); - * // => 'b' - * - * _.nth(array, -2); - * // => 'c'; - */ - function nth(array, n) { - return (array && array.length) ? baseNth(array, toInteger(n)) : undefined; - } - - /** - * Removes all given values from `array` using - * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) - * for equality comparisons. - * - * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove` - * to remove elements from an array by predicate. - * - * @static - * @memberOf _ - * @since 2.0.0 - * @category Array - * @param {Array} array The array to modify. - * @param {...*} [values] The values to remove. - * @returns {Array} Returns `array`. - * @example - * - * var array = ['a', 'b', 'c', 'a', 'b', 'c']; - * - * _.pull(array, 'a', 'c'); - * console.log(array); - * // => ['b', 'b'] - */ - var pull = baseRest(pullAll); - - /** - * This method is like `_.pull` except that it accepts an array of values to remove. - * - * **Note:** Unlike `_.difference`, this method mutates `array`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {Array} array The array to modify. - * @param {Array} values The values to remove. - * @returns {Array} Returns `array`. - * @example - * - * var array = ['a', 'b', 'c', 'a', 'b', 'c']; - * - * _.pullAll(array, ['a', 'c']); - * console.log(array); - * // => ['b', 'b'] - */ - function pullAll(array, values) { - return (array && array.length && values && values.length) - ? basePullAll(array, values) - : array; - } - - /** - * This method is like `_.pullAll` except that it accepts `iteratee` which is - * invoked for each element of `array` and `values` to generate the criterion - * by which they're compared. The iteratee is invoked with one argument: (value). - * - * **Note:** Unlike `_.differenceBy`, this method mutates `array`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {Array} array The array to modify. - * @param {Array} values The values to remove. - * @param {Function} [iteratee=_.identity] The iteratee invoked per element. - * @returns {Array} Returns `array`. - * @example - * - * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }]; - * - * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x'); - * console.log(array); - * // => [{ 'x': 2 }] - */ - function pullAllBy(array, values, iteratee) { - return (array && array.length && values && values.length) - ? basePullAll(array, values, getIteratee(iteratee, 2)) - : array; - } - - /** - * This method is like `_.pullAll` except that it accepts `comparator` which - * is invoked to compare elements of `array` to `values`. The comparator is - * invoked with two arguments: (arrVal, othVal). - * - * **Note:** Unlike `_.differenceWith`, this method mutates `array`. - * - * @static - * @memberOf _ - * @since 4.6.0 - * @category Array - * @param {Array} array The array to modify. - * @param {Array} values The values to remove. - * @param {Function} [comparator] The comparator invoked per element. - * @returns {Array} Returns `array`. - * @example - * - * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }]; - * - * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual); - * console.log(array); - * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }] - */ - function pullAllWith(array, values, comparator) { - return (array && array.length && values && values.length) - ? basePullAll(array, values, undefined, comparator) - : array; - } - - /** - * Removes elements from `array` corresponding to `indexes` and returns an - * array of removed elements. - * - * **Note:** Unlike `_.at`, this method mutates `array`. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Array - * @param {Array} array The array to modify. - * @param {...(number|number[])} [indexes] The indexes of elements to remove. - * @returns {Array} Returns the new array of removed elements. - * @example - * - * var array = ['a', 'b', 'c', 'd']; - * var pulled = _.pullAt(array, [1, 3]); - * - * console.log(array); - * // => ['a', 'c'] - * - * console.log(pulled); - * // => ['b', 'd'] - */ - var pullAt = flatRest(function(array, indexes) { - var length = array == null ? 0 : array.length, - result = baseAt(array, indexes); - - basePullAt(array, arrayMap(indexes, function(index) { - return isIndex(index, length) ? +index : index; - }).sort(compareAscending)); - - return result; - }); - - /** - * Removes all elements from `array` that `predicate` returns truthy for - * and returns an array of the removed elements. The predicate is invoked - * with three arguments: (value, index, array). - * - * **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull` - * to pull elements from an array by value. - * - * @static - * @memberOf _ - * @since 2.0.0 - * @category Array - * @param {Array} array The array to modify. - * @param {Function} [predicate=_.identity] The function invoked per iteration. - * @returns {Array} Returns the new array of removed elements. - * @example - * - * var array = [1, 2, 3, 4]; - * var evens = _.remove(array, function(n) { - * return n % 2 == 0; - * }); - * - * console.log(array); - * // => [1, 3] - * - * console.log(evens); - * // => [2, 4] - */ - function remove(array, predicate) { - var result = []; - if (!(array && array.length)) { - return result; - } - var index = -1, - indexes = [], - length = array.length; - - predicate = getIteratee(predicate, 3); - while (++index < length) { - var value = array[index]; - if (predicate(value, index, array)) { - result.push(value); - indexes.push(index); - } - } - basePullAt(array, indexes); - return result; - } - - /** - * Reverses `array` so that the first element becomes the last, the second - * element becomes the second to last, and so on. - * - * **Note:** This method mutates `array` and is based on - * [`Array#reverse`](https://mdn.io/Array/reverse). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {Array} array The array to modify. - * @returns {Array} Returns `array`. - * @example - * - * var array = [1, 2, 3]; - * - * _.reverse(array); - * // => [3, 2, 1] - * - * console.log(array); - * // => [3, 2, 1] - */ - function reverse(array) { - return array == null ? array : nativeReverse.call(array); - } - - /** - * Creates a slice of `array` from `start` up to, but not including, `end`. - * - * **Note:** This method is used instead of - * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are - * returned. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Array - * @param {Array} array The array to slice. - * @param {number} [start=0] The start position. - * @param {number} [end=array.length] The end position. - * @returns {Array} Returns the slice of `array`. - */ - function slice(array, start, end) { - var length = array == null ? 0 : array.length; - if (!length) { - return []; - } - if (end && typeof end != 'number' && isIterateeCall(array, start, end)) { - start = 0; - end = length; - } - else { - start = start == null ? 0 : toInteger(start); - end = end === undefined ? length : toInteger(end); - } - return baseSlice(array, start, end); - } - - /** - * Uses a binary search to determine the lowest index at which `value` - * should be inserted into `array` in order to maintain its sort order. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Array - * @param {Array} array The sorted array to inspect. - * @param {*} value The value to evaluate. - * @returns {number} Returns the index at which `value` should be inserted - * into `array`. - * @example - * - * _.sortedIndex([30, 50], 40); - * // => 1 - */ - function sortedIndex(array, value) { - return baseSortedIndex(array, value); - } - - /** - * This method is like `_.sortedIndex` except that it accepts `iteratee` - * which is invoked for `value` and each element of `array` to compute their - * sort ranking. The iteratee is invoked with one argument: (value). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {Array} array The sorted array to inspect. - * @param {*} value The value to evaluate. - * @param {Function} [iteratee=_.identity] The iteratee invoked per element. - * @returns {number} Returns the index at which `value` should be inserted - * into `array`. - * @example - * - * var objects = [{ 'x': 4 }, { 'x': 5 }]; - * - * _.sortedIndexBy(objects, { 'x': 4 }, function(o) { return o.x; }); - * // => 0 - * - * // The `_.property` iteratee shorthand. - * _.sortedIndexBy(objects, { 'x': 4 }, 'x'); - * // => 0 - */ - function sortedIndexBy(array, value, iteratee) { - return baseSortedIndexBy(array, value, getIteratee(iteratee, 2)); - } - - /** - * This method is like `_.indexOf` except that it performs a binary - * search on a sorted `array`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {Array} array The array to inspect. - * @param {*} value The value to search for. - * @returns {number} Returns the index of the matched value, else `-1`. - * @example - * - * _.sortedIndexOf([4, 5, 5, 5, 6], 5); - * // => 1 - */ - function sortedIndexOf(array, value) { - var length = array == null ? 0 : array.length; - if (length) { - var index = baseSortedIndex(array, value); - if (index < length && eq(array[index], value)) { - return index; - } - } - return -1; - } - - /** - * This method is like `_.sortedIndex` except that it returns the highest - * index at which `value` should be inserted into `array` in order to - * maintain its sort order. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Array - * @param {Array} array The sorted array to inspect. - * @param {*} value The value to evaluate. - * @returns {number} Returns the index at which `value` should be inserted - * into `array`. - * @example - * - * _.sortedLastIndex([4, 5, 5, 5, 6], 5); - * // => 4 - */ - function sortedLastIndex(array, value) { - return baseSortedIndex(array, value, true); - } - - /** - * This method is like `_.sortedLastIndex` except that it accepts `iteratee` - * which is invoked for `value` and each element of `array` to compute their - * sort ranking. The iteratee is invoked with one argument: (value). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {Array} array The sorted array to inspect. - * @param {*} value The value to evaluate. - * @param {Function} [iteratee=_.identity] The iteratee invoked per element. - * @returns {number} Returns the index at which `value` should be inserted - * into `array`. - * @example - * - * var objects = [{ 'x': 4 }, { 'x': 5 }]; - * - * _.sortedLastIndexBy(objects, { 'x': 4 }, function(o) { return o.x; }); - * // => 1 - * - * // The `_.property` iteratee shorthand. - * _.sortedLastIndexBy(objects, { 'x': 4 }, 'x'); - * // => 1 - */ - function sortedLastIndexBy(array, value, iteratee) { - return baseSortedIndexBy(array, value, getIteratee(iteratee, 2), true); - } - - /** - * This method is like `_.lastIndexOf` except that it performs a binary - * search on a sorted `array`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {Array} array The array to inspect. - * @param {*} value The value to search for. - * @returns {number} Returns the index of the matched value, else `-1`. - * @example - * - * _.sortedLastIndexOf([4, 5, 5, 5, 6], 5); - * // => 3 - */ - function sortedLastIndexOf(array, value) { - var length = array == null ? 0 : array.length; - if (length) { - var index = baseSortedIndex(array, value, true) - 1; - if (eq(array[index], value)) { - return index; - } - } - return -1; - } - - /** - * This method is like `_.uniq` except that it's designed and optimized - * for sorted arrays. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {Array} array The array to inspect. - * @returns {Array} Returns the new duplicate free array. - * @example - * - * _.sortedUniq([1, 1, 2]); - * // => [1, 2] - */ - function sortedUniq(array) { - return (array && array.length) - ? baseSortedUniq(array) - : []; - } - - /** - * This method is like `_.uniqBy` except that it's designed and optimized - * for sorted arrays. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {Array} array The array to inspect. - * @param {Function} [iteratee] The iteratee invoked per element. - * @returns {Array} Returns the new duplicate free array. - * @example - * - * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor); - * // => [1.1, 2.3] - */ - function sortedUniqBy(array, iteratee) { - return (array && array.length) - ? baseSortedUniq(array, getIteratee(iteratee, 2)) - : []; - } - - /** - * Gets all but the first element of `array`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {Array} array The array to query. - * @returns {Array} Returns the slice of `array`. - * @example - * - * _.tail([1, 2, 3]); - * // => [2, 3] - */ - function tail(array) { - var length = array == null ? 0 : array.length; - return length ? baseSlice(array, 1, length) : []; - } - - /** - * Creates a slice of `array` with `n` elements taken from the beginning. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Array - * @param {Array} array The array to query. - * @param {number} [n=1] The number of elements to take. - * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. - * @returns {Array} Returns the slice of `array`. - * @example - * - * _.take([1, 2, 3]); - * // => [1] - * - * _.take([1, 2, 3], 2); - * // => [1, 2] - * - * _.take([1, 2, 3], 5); - * // => [1, 2, 3] - * - * _.take([1, 2, 3], 0); - * // => [] - */ - function take(array, n, guard) { - if (!(array && array.length)) { - return []; - } - n = (guard || n === undefined) ? 1 : toInteger(n); - return baseSlice(array, 0, n < 0 ? 0 : n); - } - - /** - * Creates a slice of `array` with `n` elements taken from the end. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Array - * @param {Array} array The array to query. - * @param {number} [n=1] The number of elements to take. - * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. - * @returns {Array} Returns the slice of `array`. - * @example - * - * _.takeRight([1, 2, 3]); - * // => [3] - * - * _.takeRight([1, 2, 3], 2); - * // => [2, 3] - * - * _.takeRight([1, 2, 3], 5); - * // => [1, 2, 3] - * - * _.takeRight([1, 2, 3], 0); - * // => [] - */ - function takeRight(array, n, guard) { - var length = array == null ? 0 : array.length; - if (!length) { - return []; - } - n = (guard || n === undefined) ? 1 : toInteger(n); - n = length - n; - return baseSlice(array, n < 0 ? 0 : n, length); - } - - /** - * Creates a slice of `array` with elements taken from the end. Elements are - * taken until `predicate` returns falsey. The predicate is invoked with - * three arguments: (value, index, array). - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Array - * @param {Array} array The array to query. - * @param {Function} [predicate=_.identity] The function invoked per iteration. - * @returns {Array} Returns the slice of `array`. - * @example - * - * var users = [ - * { 'user': 'barney', 'active': true }, - * { 'user': 'fred', 'active': false }, - * { 'user': 'pebbles', 'active': false } - * ]; - * - * _.takeRightWhile(users, function(o) { return !o.active; }); - * // => objects for ['fred', 'pebbles'] - * - * // The `_.matches` iteratee shorthand. - * _.takeRightWhile(users, { 'user': 'pebbles', 'active': false }); - * // => objects for ['pebbles'] - * - * // The `_.matchesProperty` iteratee shorthand. - * _.takeRightWhile(users, ['active', false]); - * // => objects for ['fred', 'pebbles'] - * - * // The `_.property` iteratee shorthand. - * _.takeRightWhile(users, 'active'); - * // => [] - */ - function takeRightWhile(array, predicate) { - return (array && array.length) - ? baseWhile(array, getIteratee(predicate, 3), false, true) - : []; - } - - /** - * Creates a slice of `array` with elements taken from the beginning. Elements - * are taken until `predicate` returns falsey. The predicate is invoked with - * three arguments: (value, index, array). - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Array - * @param {Array} array The array to query. - * @param {Function} [predicate=_.identity] The function invoked per iteration. - * @returns {Array} Returns the slice of `array`. - * @example - * - * var users = [ - * { 'user': 'barney', 'active': false }, - * { 'user': 'fred', 'active': false }, - * { 'user': 'pebbles', 'active': true } - * ]; - * - * _.takeWhile(users, function(o) { return !o.active; }); - * // => objects for ['barney', 'fred'] - * - * // The `_.matches` iteratee shorthand. - * _.takeWhile(users, { 'user': 'barney', 'active': false }); - * // => objects for ['barney'] - * - * // The `_.matchesProperty` iteratee shorthand. - * _.takeWhile(users, ['active', false]); - * // => objects for ['barney', 'fred'] - * - * // The `_.property` iteratee shorthand. - * _.takeWhile(users, 'active'); - * // => [] - */ - function takeWhile(array, predicate) { - return (array && array.length) - ? baseWhile(array, getIteratee(predicate, 3)) - : []; - } - - /** - * Creates an array of unique values, in order, from all given arrays using - * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) - * for equality comparisons. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Array - * @param {...Array} [arrays] The arrays to inspect. - * @returns {Array} Returns the new array of combined values. - * @example - * - * _.union([2], [1, 2]); - * // => [2, 1] - */ - var union = baseRest(function(arrays) { - return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true)); - }); - - /** - * This method is like `_.union` except that it accepts `iteratee` which is - * invoked for each element of each `arrays` to generate the criterion by - * which uniqueness is computed. Result values are chosen from the first - * array in which the value occurs. The iteratee is invoked with one argument: - * (value). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {...Array} [arrays] The arrays to inspect. - * @param {Function} [iteratee=_.identity] The iteratee invoked per element. - * @returns {Array} Returns the new array of combined values. - * @example - * - * _.unionBy([2.1], [1.2, 2.3], Math.floor); - * // => [2.1, 1.2] - * - * // The `_.property` iteratee shorthand. - * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); - * // => [{ 'x': 1 }, { 'x': 2 }] - */ - var unionBy = baseRest(function(arrays) { - var iteratee = last(arrays); - if (isArrayLikeObject(iteratee)) { - iteratee = undefined; - } - return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee, 2)); - }); - - /** - * This method is like `_.union` except that it accepts `comparator` which - * is invoked to compare elements of `arrays`. Result values are chosen from - * the first array in which the value occurs. The comparator is invoked - * with two arguments: (arrVal, othVal). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {...Array} [arrays] The arrays to inspect. - * @param {Function} [comparator] The comparator invoked per element. - * @returns {Array} Returns the new array of combined values. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; - * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; - * - * _.unionWith(objects, others, _.isEqual); - * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] - */ - var unionWith = baseRest(function(arrays) { - var comparator = last(arrays); - comparator = typeof comparator == 'function' ? comparator : undefined; - return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined, comparator); - }); - - /** - * Creates a duplicate-free version of an array, using - * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) - * for equality comparisons, in which only the first occurrence of each element - * is kept. The order of result values is determined by the order they occur - * in the array. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Array - * @param {Array} array The array to inspect. - * @returns {Array} Returns the new duplicate free array. - * @example - * - * _.uniq([2, 1, 2]); - * // => [2, 1] - */ - function uniq(array) { - return (array && array.length) ? baseUniq(array) : []; - } - - /** - * This method is like `_.uniq` except that it accepts `iteratee` which is - * invoked for each element in `array` to generate the criterion by which - * uniqueness is computed. The order of result values is determined by the - * order they occur in the array. The iteratee is invoked with one argument: - * (value). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {Array} array The array to inspect. - * @param {Function} [iteratee=_.identity] The iteratee invoked per element. - * @returns {Array} Returns the new duplicate free array. - * @example - * - * _.uniqBy([2.1, 1.2, 2.3], Math.floor); - * // => [2.1, 1.2] - * - * // The `_.property` iteratee shorthand. - * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x'); - * // => [{ 'x': 1 }, { 'x': 2 }] - */ - function uniqBy(array, iteratee) { - return (array && array.length) ? baseUniq(array, getIteratee(iteratee, 2)) : []; - } - - /** - * This method is like `_.uniq` except that it accepts `comparator` which - * is invoked to compare elements of `array`. The order of result values is - * determined by the order they occur in the array.The comparator is invoked - * with two arguments: (arrVal, othVal). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {Array} array The array to inspect. - * @param {Function} [comparator] The comparator invoked per element. - * @returns {Array} Returns the new duplicate free array. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }]; - * - * _.uniqWith(objects, _.isEqual); - * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }] - */ - function uniqWith(array, comparator) { - comparator = typeof comparator == 'function' ? comparator : undefined; - return (array && array.length) ? baseUniq(array, undefined, comparator) : []; - } - - /** - * This method is like `_.zip` except that it accepts an array of grouped - * elements and creates an array regrouping the elements to their pre-zip - * configuration. - * - * @static - * @memberOf _ - * @since 1.2.0 - * @category Array - * @param {Array} array The array of grouped elements to process. - * @returns {Array} Returns the new array of regrouped elements. - * @example - * - * var zipped = _.zip(['a', 'b'], [1, 2], [true, false]); - * // => [['a', 1, true], ['b', 2, false]] - * - * _.unzip(zipped); - * // => [['a', 'b'], [1, 2], [true, false]] - */ - function unzip(array) { - if (!(array && array.length)) { - return []; - } - var length = 0; - array = arrayFilter(array, function(group) { - if (isArrayLikeObject(group)) { - length = nativeMax(group.length, length); - return true; - } - }); - return baseTimes(length, function(index) { - return arrayMap(array, baseProperty(index)); - }); - } - - /** - * This method is like `_.unzip` except that it accepts `iteratee` to specify - * how regrouped values should be combined. The iteratee is invoked with the - * elements of each group: (...group). - * - * @static - * @memberOf _ - * @since 3.8.0 - * @category Array - * @param {Array} array The array of grouped elements to process. - * @param {Function} [iteratee=_.identity] The function to combine - * regrouped values. - * @returns {Array} Returns the new array of regrouped elements. - * @example - * - * var zipped = _.zip([1, 2], [10, 20], [100, 200]); - * // => [[1, 10, 100], [2, 20, 200]] - * - * _.unzipWith(zipped, _.add); - * // => [3, 30, 300] - */ - function unzipWith(array, iteratee) { - if (!(array && array.length)) { - return []; - } - var result = unzip(array); - if (iteratee == null) { - return result; - } - return arrayMap(result, function(group) { - return apply(iteratee, undefined, group); - }); - } - - /** - * Creates an array excluding all given values using - * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) - * for equality comparisons. - * - * **Note:** Unlike `_.pull`, this method returns a new array. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Array - * @param {Array} array The array to inspect. - * @param {...*} [values] The values to exclude. - * @returns {Array} Returns the new array of filtered values. - * @see _.difference, _.xor - * @example - * - * _.without([2, 1, 2, 3], 1, 2); - * // => [3] - */ - var without = baseRest(function(array, values) { - return isArrayLikeObject(array) - ? baseDifference(array, values) - : []; - }); - - /** - * Creates an array of unique values that is the - * [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference) - * of the given arrays. The order of result values is determined by the order - * they occur in the arrays. - * - * @static - * @memberOf _ - * @since 2.4.0 - * @category Array - * @param {...Array} [arrays] The arrays to inspect. - * @returns {Array} Returns the new array of filtered values. - * @see _.difference, _.without - * @example - * - * _.xor([2, 1], [2, 3]); - * // => [1, 3] - */ - var xor = baseRest(function(arrays) { - return baseXor(arrayFilter(arrays, isArrayLikeObject)); - }); - - /** - * This method is like `_.xor` except that it accepts `iteratee` which is - * invoked for each element of each `arrays` to generate the criterion by - * which by which they're compared. The order of result values is determined - * by the order they occur in the arrays. The iteratee is invoked with one - * argument: (value). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {...Array} [arrays] The arrays to inspect. - * @param {Function} [iteratee=_.identity] The iteratee invoked per element. - * @returns {Array} Returns the new array of filtered values. - * @example - * - * _.xorBy([2.1, 1.2], [2.3, 3.4], Math.floor); - * // => [1.2, 3.4] - * - * // The `_.property` iteratee shorthand. - * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); - * // => [{ 'x': 2 }] - */ - var xorBy = baseRest(function(arrays) { - var iteratee = last(arrays); - if (isArrayLikeObject(iteratee)) { - iteratee = undefined; - } - return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee, 2)); - }); - - /** - * This method is like `_.xor` except that it accepts `comparator` which is - * invoked to compare elements of `arrays`. The order of result values is - * determined by the order they occur in the arrays. The comparator is invoked - * with two arguments: (arrVal, othVal). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {...Array} [arrays] The arrays to inspect. - * @param {Function} [comparator] The comparator invoked per element. - * @returns {Array} Returns the new array of filtered values. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; - * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; - * - * _.xorWith(objects, others, _.isEqual); - * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] - */ - var xorWith = baseRest(function(arrays) { - var comparator = last(arrays); - comparator = typeof comparator == 'function' ? comparator : undefined; - return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined, comparator); - }); - - /** - * Creates an array of grouped elements, the first of which contains the - * first elements of the given arrays, the second of which contains the - * second elements of the given arrays, and so on. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Array - * @param {...Array} [arrays] The arrays to process. - * @returns {Array} Returns the new array of grouped elements. - * @example - * - * _.zip(['a', 'b'], [1, 2], [true, false]); - * // => [['a', 1, true], ['b', 2, false]] - */ - var zip = baseRest(unzip); - - /** - * This method is like `_.fromPairs` except that it accepts two arrays, - * one of property identifiers and one of corresponding values. - * - * @static - * @memberOf _ - * @since 0.4.0 - * @category Array - * @param {Array} [props=[]] The property identifiers. - * @param {Array} [values=[]] The property values. - * @returns {Object} Returns the new object. - * @example - * - * _.zipObject(['a', 'b'], [1, 2]); - * // => { 'a': 1, 'b': 2 } - */ - function zipObject(props, values) { - return baseZipObject(props || [], values || [], assignValue); - } - - /** - * This method is like `_.zipObject` except that it supports property paths. - * - * @static - * @memberOf _ - * @since 4.1.0 - * @category Array - * @param {Array} [props=[]] The property identifiers. - * @param {Array} [values=[]] The property values. - * @returns {Object} Returns the new object. - * @example - * - * _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]); - * // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } } - */ - function zipObjectDeep(props, values) { - return baseZipObject(props || [], values || [], baseSet); - } - - /** - * This method is like `_.zip` except that it accepts `iteratee` to specify - * how grouped values should be combined. The iteratee is invoked with the - * elements of each group: (...group). - * - * @static - * @memberOf _ - * @since 3.8.0 - * @category Array - * @param {...Array} [arrays] The arrays to process. - * @param {Function} [iteratee=_.identity] The function to combine - * grouped values. - * @returns {Array} Returns the new array of grouped elements. - * @example - * - * _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) { - * return a + b + c; - * }); - * // => [111, 222] - */ - var zipWith = baseRest(function(arrays) { - var length = arrays.length, - iteratee = length > 1 ? arrays[length - 1] : undefined; - - iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined; - return unzipWith(arrays, iteratee); - }); - - /*------------------------------------------------------------------------*/ - - /** - * Creates a `lodash` wrapper instance that wraps `value` with explicit method - * chain sequences enabled. The result of such sequences must be unwrapped - * with `_#value`. - * - * @static - * @memberOf _ - * @since 1.3.0 - * @category Seq - * @param {*} value The value to wrap. - * @returns {Object} Returns the new `lodash` wrapper instance. - * @example - * - * var users = [ - * { 'user': 'barney', 'age': 36 }, - * { 'user': 'fred', 'age': 40 }, - * { 'user': 'pebbles', 'age': 1 } - * ]; - * - * var youngest = _ - * .chain(users) - * .sortBy('age') - * .map(function(o) { - * return o.user + ' is ' + o.age; - * }) - * .head() - * .value(); - * // => 'pebbles is 1' - */ - function chain(value) { - var result = lodash(value); - result.__chain__ = true; - return result; - } - - /** - * This method invokes `interceptor` and returns `value`. The interceptor - * is invoked with one argument; (value). The purpose of this method is to - * "tap into" a method chain sequence in order to modify intermediate results. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Seq - * @param {*} value The value to provide to `interceptor`. - * @param {Function} interceptor The function to invoke. - * @returns {*} Returns `value`. - * @example - * - * _([1, 2, 3]) - * .tap(function(array) { - * // Mutate input array. - * array.pop(); - * }) - * .reverse() - * .value(); - * // => [2, 1] - */ - function tap(value, interceptor) { - interceptor(value); - return value; - } - - /** - * This method is like `_.tap` except that it returns the result of `interceptor`. - * The purpose of this method is to "pass thru" values replacing intermediate - * results in a method chain sequence. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Seq - * @param {*} value The value to provide to `interceptor`. - * @param {Function} interceptor The function to invoke. - * @returns {*} Returns the result of `interceptor`. - * @example - * - * _(' abc ') - * .chain() - * .trim() - * .thru(function(value) { - * return [value]; - * }) - * .value(); - * // => ['abc'] - */ - function thru(value, interceptor) { - return interceptor(value); - } - - /** - * This method is the wrapper version of `_.at`. - * - * @name at - * @memberOf _ - * @since 1.0.0 - * @category Seq - * @param {...(string|string[])} [paths] The property paths to pick. - * @returns {Object} Returns the new `lodash` wrapper instance. - * @example - * - * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] }; - * - * _(object).at(['a[0].b.c', 'a[1]']).value(); - * // => [3, 4] - */ - var wrapperAt = flatRest(function(paths) { - var length = paths.length, - start = length ? paths[0] : 0, - value = this.__wrapped__, - interceptor = function(object) { return baseAt(object, paths); }; - - if (length > 1 || this.__actions__.length || - !(value instanceof LazyWrapper) || !isIndex(start)) { - return this.thru(interceptor); - } - value = value.slice(start, +start + (length ? 1 : 0)); - value.__actions__.push({ - 'func': thru, - 'args': [interceptor], - 'thisArg': undefined - }); - return new LodashWrapper(value, this.__chain__).thru(function(array) { - if (length && !array.length) { - array.push(undefined); - } - return array; - }); - }); - - /** - * Creates a `lodash` wrapper instance with explicit method chain sequences enabled. - * - * @name chain - * @memberOf _ - * @since 0.1.0 - * @category Seq - * @returns {Object} Returns the new `lodash` wrapper instance. - * @example - * - * var users = [ - * { 'user': 'barney', 'age': 36 }, - * { 'user': 'fred', 'age': 40 } - * ]; - * - * // A sequence without explicit chaining. - * _(users).head(); - * // => { 'user': 'barney', 'age': 36 } - * - * // A sequence with explicit chaining. - * _(users) - * .chain() - * .head() - * .pick('user') - * .value(); - * // => { 'user': 'barney' } - */ - function wrapperChain() { - return chain(this); - } - - /** - * Executes the chain sequence and returns the wrapped result. - * - * @name commit - * @memberOf _ - * @since 3.2.0 - * @category Seq - * @returns {Object} Returns the new `lodash` wrapper instance. - * @example - * - * var array = [1, 2]; - * var wrapped = _(array).push(3); - * - * console.log(array); - * // => [1, 2] - * - * wrapped = wrapped.commit(); - * console.log(array); - * // => [1, 2, 3] - * - * wrapped.last(); - * // => 3 - * - * console.log(array); - * // => [1, 2, 3] - */ - function wrapperCommit() { - return new LodashWrapper(this.value(), this.__chain__); - } - - /** - * Gets the next value on a wrapped object following the - * [iterator protocol](https://mdn.io/iteration_protocols#iterator). - * - * @name next - * @memberOf _ - * @since 4.0.0 - * @category Seq - * @returns {Object} Returns the next iterator value. - * @example - * - * var wrapped = _([1, 2]); - * - * wrapped.next(); - * // => { 'done': false, 'value': 1 } - * - * wrapped.next(); - * // => { 'done': false, 'value': 2 } - * - * wrapped.next(); - * // => { 'done': true, 'value': undefined } - */ - function wrapperNext() { - if (this.__values__ === undefined) { - this.__values__ = toArray(this.value()); - } - var done = this.__index__ >= this.__values__.length, - value = done ? undefined : this.__values__[this.__index__++]; - - return { 'done': done, 'value': value }; - } - - /** - * Enables the wrapper to be iterable. - * - * @name Symbol.iterator - * @memberOf _ - * @since 4.0.0 - * @category Seq - * @returns {Object} Returns the wrapper object. - * @example - * - * var wrapped = _([1, 2]); - * - * wrapped[Symbol.iterator]() === wrapped; - * // => true - * - * Array.from(wrapped); - * // => [1, 2] - */ - function wrapperToIterator() { - return this; - } - - /** - * Creates a clone of the chain sequence planting `value` as the wrapped value. - * - * @name plant - * @memberOf _ - * @since 3.2.0 - * @category Seq - * @param {*} value The value to plant. - * @returns {Object} Returns the new `lodash` wrapper instance. - * @example - * - * function square(n) { - * return n * n; - * } - * - * var wrapped = _([1, 2]).map(square); - * var other = wrapped.plant([3, 4]); - * - * other.value(); - * // => [9, 16] - * - * wrapped.value(); - * // => [1, 4] - */ - function wrapperPlant(value) { - var result, - parent = this; - - while (parent instanceof baseLodash) { - var clone = wrapperClone(parent); - clone.__index__ = 0; - clone.__values__ = undefined; - if (result) { - previous.__wrapped__ = clone; - } else { - result = clone; - } - var previous = clone; - parent = parent.__wrapped__; - } - previous.__wrapped__ = value; - return result; - } - - /** - * This method is the wrapper version of `_.reverse`. - * - * **Note:** This method mutates the wrapped array. - * - * @name reverse - * @memberOf _ - * @since 0.1.0 - * @category Seq - * @returns {Object} Returns the new `lodash` wrapper instance. - * @example - * - * var array = [1, 2, 3]; - * - * _(array).reverse().value() - * // => [3, 2, 1] - * - * console.log(array); - * // => [3, 2, 1] - */ - function wrapperReverse() { - var value = this.__wrapped__; - if (value instanceof LazyWrapper) { - var wrapped = value; - if (this.__actions__.length) { - wrapped = new LazyWrapper(this); - } - wrapped = wrapped.reverse(); - wrapped.__actions__.push({ - 'func': thru, - 'args': [reverse], - 'thisArg': undefined - }); - return new LodashWrapper(wrapped, this.__chain__); - } - return this.thru(reverse); - } - - /** - * Executes the chain sequence to resolve the unwrapped value. - * - * @name value - * @memberOf _ - * @since 0.1.0 - * @alias toJSON, valueOf - * @category Seq - * @returns {*} Returns the resolved unwrapped value. - * @example - * - * _([1, 2, 3]).value(); - * // => [1, 2, 3] - */ - function wrapperValue() { - return baseWrapperValue(this.__wrapped__, this.__actions__); - } - - /*------------------------------------------------------------------------*/ - - /** - * Creates an object composed of keys generated from the results of running - * each element of `collection` thru `iteratee`. The corresponding value of - * each key is the number of times the key was returned by `iteratee`. The - * iteratee is invoked with one argument: (value). - * - * @static - * @memberOf _ - * @since 0.5.0 - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [iteratee=_.identity] The iteratee to transform keys. - * @returns {Object} Returns the composed aggregate object. - * @example - * - * _.countBy([6.1, 4.2, 6.3], Math.floor); - * // => { '4': 1, '6': 2 } - * - * // The `_.property` iteratee shorthand. - * _.countBy(['one', 'two', 'three'], 'length'); - * // => { '3': 2, '5': 1 } - */ - var countBy = createAggregator(function(result, value, key) { - if (hasOwnProperty.call(result, key)) { - ++result[key]; - } else { - baseAssignValue(result, key, 1); - } - }); - - /** - * Checks if `predicate` returns truthy for **all** elements of `collection`. - * Iteration is stopped once `predicate` returns falsey. The predicate is - * invoked with three arguments: (value, index|key, collection). - * - * **Note:** This method returns `true` for - * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because - * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of - * elements of empty collections. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [predicate=_.identity] The function invoked per iteration. - * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. - * @returns {boolean} Returns `true` if all elements pass the predicate check, - * else `false`. - * @example - * - * _.every([true, 1, null, 'yes'], Boolean); - * // => false - * - * var users = [ - * { 'user': 'barney', 'age': 36, 'active': false }, - * { 'user': 'fred', 'age': 40, 'active': false } - * ]; - * - * // The `_.matches` iteratee shorthand. - * _.every(users, { 'user': 'barney', 'active': false }); - * // => false - * - * // The `_.matchesProperty` iteratee shorthand. - * _.every(users, ['active', false]); - * // => true - * - * // The `_.property` iteratee shorthand. - * _.every(users, 'active'); - * // => false - */ - function every(collection, predicate, guard) { - var func = isArray(collection) ? arrayEvery : baseEvery; - if (guard && isIterateeCall(collection, predicate, guard)) { - predicate = undefined; - } - return func(collection, getIteratee(predicate, 3)); - } - - /** - * Iterates over elements of `collection`, returning an array of all elements - * `predicate` returns truthy for. The predicate is invoked with three - * arguments: (value, index|key, collection). - * - * **Note:** Unlike `_.remove`, this method returns a new array. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [predicate=_.identity] The function invoked per iteration. - * @returns {Array} Returns the new filtered array. - * @see _.reject - * @example - * - * var users = [ - * { 'user': 'barney', 'age': 36, 'active': true }, - * { 'user': 'fred', 'age': 40, 'active': false } - * ]; - * - * _.filter(users, function(o) { return !o.active; }); - * // => objects for ['fred'] - * - * // The `_.matches` iteratee shorthand. - * _.filter(users, { 'age': 36, 'active': true }); - * // => objects for ['barney'] - * - * // The `_.matchesProperty` iteratee shorthand. - * _.filter(users, ['active', false]); - * // => objects for ['fred'] - * - * // The `_.property` iteratee shorthand. - * _.filter(users, 'active'); - * // => objects for ['barney'] - * - * // Combining several predicates using `_.overEvery` or `_.overSome`. - * _.filter(users, _.overSome([{ 'age': 36 }, ['age', 40]])); - * // => objects for ['fred', 'barney'] - */ - function filter(collection, predicate) { - var func = isArray(collection) ? arrayFilter : baseFilter; - return func(collection, getIteratee(predicate, 3)); - } - - /** - * Iterates over elements of `collection`, returning the first element - * `predicate` returns truthy for. The predicate is invoked with three - * arguments: (value, index|key, collection). - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Collection - * @param {Array|Object} collection The collection to inspect. - * @param {Function} [predicate=_.identity] The function invoked per iteration. - * @param {number} [fromIndex=0] The index to search from. - * @returns {*} Returns the matched element, else `undefined`. - * @example - * - * var users = [ - * { 'user': 'barney', 'age': 36, 'active': true }, - * { 'user': 'fred', 'age': 40, 'active': false }, - * { 'user': 'pebbles', 'age': 1, 'active': true } - * ]; - * - * _.find(users, function(o) { return o.age < 40; }); - * // => object for 'barney' - * - * // The `_.matches` iteratee shorthand. - * _.find(users, { 'age': 1, 'active': true }); - * // => object for 'pebbles' - * - * // The `_.matchesProperty` iteratee shorthand. - * _.find(users, ['active', false]); - * // => object for 'fred' - * - * // The `_.property` iteratee shorthand. - * _.find(users, 'active'); - * // => object for 'barney' - */ - var find = createFind(findIndex); - - /** - * This method is like `_.find` except that it iterates over elements of - * `collection` from right to left. - * - * @static - * @memberOf _ - * @since 2.0.0 - * @category Collection - * @param {Array|Object} collection The collection to inspect. - * @param {Function} [predicate=_.identity] The function invoked per iteration. - * @param {number} [fromIndex=collection.length-1] The index to search from. - * @returns {*} Returns the matched element, else `undefined`. - * @example - * - * _.findLast([1, 2, 3, 4], function(n) { - * return n % 2 == 1; - * }); - * // => 3 - */ - var findLast = createFind(findLastIndex); - - /** - * Creates a flattened array of values by running each element in `collection` - * thru `iteratee` and flattening the mapped results. The iteratee is invoked - * with three arguments: (value, index|key, collection). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @returns {Array} Returns the new flattened array. - * @example - * - * function duplicate(n) { - * return [n, n]; - * } - * - * _.flatMap([1, 2], duplicate); - * // => [1, 1, 2, 2] - */ - function flatMap(collection, iteratee) { - return baseFlatten(map(collection, iteratee), 1); - } - - /** - * This method is like `_.flatMap` except that it recursively flattens the - * mapped results. - * - * @static - * @memberOf _ - * @since 4.7.0 - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @returns {Array} Returns the new flattened array. - * @example - * - * function duplicate(n) { - * return [[[n, n]]]; - * } - * - * _.flatMapDeep([1, 2], duplicate); - * // => [1, 1, 2, 2] - */ - function flatMapDeep(collection, iteratee) { - return baseFlatten(map(collection, iteratee), INFINITY); - } - - /** - * This method is like `_.flatMap` except that it recursively flattens the - * mapped results up to `depth` times. - * - * @static - * @memberOf _ - * @since 4.7.0 - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @param {number} [depth=1] The maximum recursion depth. - * @returns {Array} Returns the new flattened array. - * @example - * - * function duplicate(n) { - * return [[[n, n]]]; - * } - * - * _.flatMapDepth([1, 2], duplicate, 2); - * // => [[1, 1], [2, 2]] - */ - function flatMapDepth(collection, iteratee, depth) { - depth = depth === undefined ? 1 : toInteger(depth); - return baseFlatten(map(collection, iteratee), depth); - } - - /** - * Iterates over elements of `collection` and invokes `iteratee` for each element. - * The iteratee is invoked with three arguments: (value, index|key, collection). - * Iteratee functions may exit iteration early by explicitly returning `false`. - * - * **Note:** As with other "Collections" methods, objects with a "length" - * property are iterated like arrays. To avoid this behavior use `_.forIn` - * or `_.forOwn` for object iteration. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @alias each - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @returns {Array|Object} Returns `collection`. - * @see _.forEachRight - * @example - * - * _.forEach([1, 2], function(value) { - * console.log(value); - * }); - * // => Logs `1` then `2`. - * - * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) { - * console.log(key); - * }); - * // => Logs 'a' then 'b' (iteration order is not guaranteed). - */ - function forEach(collection, iteratee) { - var func = isArray(collection) ? arrayEach : baseEach; - return func(collection, getIteratee(iteratee, 3)); - } - - /** - * This method is like `_.forEach` except that it iterates over elements of - * `collection` from right to left. - * - * @static - * @memberOf _ - * @since 2.0.0 - * @alias eachRight - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @returns {Array|Object} Returns `collection`. - * @see _.forEach - * @example - * - * _.forEachRight([1, 2], function(value) { - * console.log(value); - * }); - * // => Logs `2` then `1`. - */ - function forEachRight(collection, iteratee) { - var func = isArray(collection) ? arrayEachRight : baseEachRight; - return func(collection, getIteratee(iteratee, 3)); - } - - /** - * Creates an object composed of keys generated from the results of running - * each element of `collection` thru `iteratee`. The order of grouped values - * is determined by the order they occur in `collection`. The corresponding - * value of each key is an array of elements responsible for generating the - * key. The iteratee is invoked with one argument: (value). - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [iteratee=_.identity] The iteratee to transform keys. - * @returns {Object} Returns the composed aggregate object. - * @example - * - * _.groupBy([6.1, 4.2, 6.3], Math.floor); - * // => { '4': [4.2], '6': [6.1, 6.3] } - * - * // The `_.property` iteratee shorthand. - * _.groupBy(['one', 'two', 'three'], 'length'); - * // => { '3': ['one', 'two'], '5': ['three'] } - */ - var groupBy = createAggregator(function(result, value, key) { - if (hasOwnProperty.call(result, key)) { - result[key].push(value); - } else { - baseAssignValue(result, key, [value]); - } - }); - - /** - * Checks if `value` is in `collection`. If `collection` is a string, it's - * checked for a substring of `value`, otherwise - * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) - * is used for equality comparisons. If `fromIndex` is negative, it's used as - * the offset from the end of `collection`. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Collection - * @param {Array|Object|string} collection The collection to inspect. - * @param {*} value The value to search for. - * @param {number} [fromIndex=0] The index to search from. - * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`. - * @returns {boolean} Returns `true` if `value` is found, else `false`. - * @example - * - * _.includes([1, 2, 3], 1); - * // => true - * - * _.includes([1, 2, 3], 1, 2); - * // => false - * - * _.includes({ 'a': 1, 'b': 2 }, 1); - * // => true - * - * _.includes('abcd', 'bc'); - * // => true - */ - function includes(collection, value, fromIndex, guard) { - collection = isArrayLike(collection) ? collection : values(collection); - fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0; - - var length = collection.length; - if (fromIndex < 0) { - fromIndex = nativeMax(length + fromIndex, 0); - } - return isString(collection) - ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1) - : (!!length && baseIndexOf(collection, value, fromIndex) > -1); - } - - /** - * Invokes the method at `path` of each element in `collection`, returning - * an array of the results of each invoked method. Any additional arguments - * are provided to each invoked method. If `path` is a function, it's invoked - * for, and `this` bound to, each element in `collection`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Array|Function|string} path The path of the method to invoke or - * the function invoked per iteration. - * @param {...*} [args] The arguments to invoke each method with. - * @returns {Array} Returns the array of results. - * @example - * - * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort'); - * // => [[1, 5, 7], [1, 2, 3]] - * - * _.invokeMap([123, 456], String.prototype.split, ''); - * // => [['1', '2', '3'], ['4', '5', '6']] - */ - var invokeMap = baseRest(function(collection, path, args) { - var index = -1, - isFunc = typeof path == 'function', - result = isArrayLike(collection) ? Array(collection.length) : []; - - baseEach(collection, function(value) { - result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args); - }); - return result; - }); - - /** - * Creates an object composed of keys generated from the results of running - * each element of `collection` thru `iteratee`. The corresponding value of - * each key is the last element responsible for generating the key. The - * iteratee is invoked with one argument: (value). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [iteratee=_.identity] The iteratee to transform keys. - * @returns {Object} Returns the composed aggregate object. - * @example - * - * var array = [ - * { 'dir': 'left', 'code': 97 }, - * { 'dir': 'right', 'code': 100 } - * ]; - * - * _.keyBy(array, function(o) { - * return String.fromCharCode(o.code); - * }); - * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } } - * - * _.keyBy(array, 'dir'); - * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } } - */ - var keyBy = createAggregator(function(result, value, key) { - baseAssignValue(result, key, value); - }); - - /** - * Creates an array of values by running each element in `collection` thru - * `iteratee`. The iteratee is invoked with three arguments: - * (value, index|key, collection). - * - * Many lodash methods are guarded to work as iteratees for methods like - * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`. - * - * The guarded methods are: - * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`, - * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`, - * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`, - * `template`, `trim`, `trimEnd`, `trimStart`, and `words` - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @returns {Array} Returns the new mapped array. - * @example - * - * function square(n) { - * return n * n; - * } - * - * _.map([4, 8], square); - * // => [16, 64] - * - * _.map({ 'a': 4, 'b': 8 }, square); - * // => [16, 64] (iteration order is not guaranteed) - * - * var users = [ - * { 'user': 'barney' }, - * { 'user': 'fred' } - * ]; - * - * // The `_.property` iteratee shorthand. - * _.map(users, 'user'); - * // => ['barney', 'fred'] - */ - function map(collection, iteratee) { - var func = isArray(collection) ? arrayMap : baseMap; - return func(collection, getIteratee(iteratee, 3)); - } - - /** - * This method is like `_.sortBy` except that it allows specifying the sort - * orders of the iteratees to sort by. If `orders` is unspecified, all values - * are sorted in ascending order. Otherwise, specify an order of "desc" for - * descending or "asc" for ascending sort order of corresponding values. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]] - * The iteratees to sort by. - * @param {string[]} [orders] The sort orders of `iteratees`. - * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`. - * @returns {Array} Returns the new sorted array. - * @example - * - * var users = [ - * { 'user': 'fred', 'age': 48 }, - * { 'user': 'barney', 'age': 34 }, - * { 'user': 'fred', 'age': 40 }, - * { 'user': 'barney', 'age': 36 } - * ]; - * - * // Sort by `user` in ascending order and by `age` in descending order. - * _.orderBy(users, ['user', 'age'], ['asc', 'desc']); - * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]] - */ - function orderBy(collection, iteratees, orders, guard) { - if (collection == null) { - return []; - } - if (!isArray(iteratees)) { - iteratees = iteratees == null ? [] : [iteratees]; - } - orders = guard ? undefined : orders; - if (!isArray(orders)) { - orders = orders == null ? [] : [orders]; - } - return baseOrderBy(collection, iteratees, orders); - } - - /** - * Creates an array of elements split into two groups, the first of which - * contains elements `predicate` returns truthy for, the second of which - * contains elements `predicate` returns falsey for. The predicate is - * invoked with one argument: (value). - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [predicate=_.identity] The function invoked per iteration. - * @returns {Array} Returns the array of grouped elements. - * @example - * - * var users = [ - * { 'user': 'barney', 'age': 36, 'active': false }, - * { 'user': 'fred', 'age': 40, 'active': true }, - * { 'user': 'pebbles', 'age': 1, 'active': false } - * ]; - * - * _.partition(users, function(o) { return o.active; }); - * // => objects for [['fred'], ['barney', 'pebbles']] - * - * // The `_.matches` iteratee shorthand. - * _.partition(users, { 'age': 1, 'active': false }); - * // => objects for [['pebbles'], ['barney', 'fred']] - * - * // The `_.matchesProperty` iteratee shorthand. - * _.partition(users, ['active', false]); - * // => objects for [['barney', 'pebbles'], ['fred']] - * - * // The `_.property` iteratee shorthand. - * _.partition(users, 'active'); - * // => objects for [['fred'], ['barney', 'pebbles']] - */ - var partition = createAggregator(function(result, value, key) { - result[key ? 0 : 1].push(value); - }, function() { return [[], []]; }); - - /** - * Reduces `collection` to a value which is the accumulated result of running - * each element in `collection` thru `iteratee`, where each successive - * invocation is supplied the return value of the previous. If `accumulator` - * is not given, the first element of `collection` is used as the initial - * value. The iteratee is invoked with four arguments: - * (accumulator, value, index|key, collection). - * - * Many lodash methods are guarded to work as iteratees for methods like - * `_.reduce`, `_.reduceRight`, and `_.transform`. - * - * The guarded methods are: - * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`, - * and `sortBy` - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @param {*} [accumulator] The initial value. - * @returns {*} Returns the accumulated value. - * @see _.reduceRight - * @example - * - * _.reduce([1, 2], function(sum, n) { - * return sum + n; - * }, 0); - * // => 3 - * - * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) { - * (result[value] || (result[value] = [])).push(key); - * return result; - * }, {}); - * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed) - */ - function reduce(collection, iteratee, accumulator) { - var func = isArray(collection) ? arrayReduce : baseReduce, - initAccum = arguments.length < 3; - - return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEach); - } - - /** - * This method is like `_.reduce` except that it iterates over elements of - * `collection` from right to left. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @param {*} [accumulator] The initial value. - * @returns {*} Returns the accumulated value. - * @see _.reduce - * @example - * - * var array = [[0, 1], [2, 3], [4, 5]]; - * - * _.reduceRight(array, function(flattened, other) { - * return flattened.concat(other); - * }, []); - * // => [4, 5, 2, 3, 0, 1] - */ - function reduceRight(collection, iteratee, accumulator) { - var func = isArray(collection) ? arrayReduceRight : baseReduce, - initAccum = arguments.length < 3; - - return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEachRight); - } - - /** - * The opposite of `_.filter`; this method returns the elements of `collection` - * that `predicate` does **not** return truthy for. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [predicate=_.identity] The function invoked per iteration. - * @returns {Array} Returns the new filtered array. - * @see _.filter - * @example - * - * var users = [ - * { 'user': 'barney', 'age': 36, 'active': false }, - * { 'user': 'fred', 'age': 40, 'active': true } - * ]; - * - * _.reject(users, function(o) { return !o.active; }); - * // => objects for ['fred'] - * - * // The `_.matches` iteratee shorthand. - * _.reject(users, { 'age': 40, 'active': true }); - * // => objects for ['barney'] - * - * // The `_.matchesProperty` iteratee shorthand. - * _.reject(users, ['active', false]); - * // => objects for ['fred'] - * - * // The `_.property` iteratee shorthand. - * _.reject(users, 'active'); - * // => objects for ['barney'] - */ - function reject(collection, predicate) { - var func = isArray(collection) ? arrayFilter : baseFilter; - return func(collection, negate(getIteratee(predicate, 3))); - } - - /** - * Gets a random element from `collection`. - * - * @static - * @memberOf _ - * @since 2.0.0 - * @category Collection - * @param {Array|Object} collection The collection to sample. - * @returns {*} Returns the random element. - * @example - * - * _.sample([1, 2, 3, 4]); - * // => 2 - */ - function sample(collection) { - var func = isArray(collection) ? arraySample : baseSample; - return func(collection); - } - - /** - * Gets `n` random elements at unique keys from `collection` up to the - * size of `collection`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Collection - * @param {Array|Object} collection The collection to sample. - * @param {number} [n=1] The number of elements to sample. - * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. - * @returns {Array} Returns the random elements. - * @example - * - * _.sampleSize([1, 2, 3], 2); - * // => [3, 1] - * - * _.sampleSize([1, 2, 3], 4); - * // => [2, 3, 1] - */ - function sampleSize(collection, n, guard) { - if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) { - n = 1; - } else { - n = toInteger(n); - } - var func = isArray(collection) ? arraySampleSize : baseSampleSize; - return func(collection, n); - } - - /** - * Creates an array of shuffled values, using a version of the - * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle). - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Collection - * @param {Array|Object} collection The collection to shuffle. - * @returns {Array} Returns the new shuffled array. - * @example - * - * _.shuffle([1, 2, 3, 4]); - * // => [4, 1, 3, 2] - */ - function shuffle(collection) { - var func = isArray(collection) ? arrayShuffle : baseShuffle; - return func(collection); - } - - /** - * Gets the size of `collection` by returning its length for array-like - * values or the number of own enumerable string keyed properties for objects. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Collection - * @param {Array|Object|string} collection The collection to inspect. - * @returns {number} Returns the collection size. - * @example - * - * _.size([1, 2, 3]); - * // => 3 - * - * _.size({ 'a': 1, 'b': 2 }); - * // => 2 - * - * _.size('pebbles'); - * // => 7 - */ - function size(collection) { - if (collection == null) { - return 0; - } - if (isArrayLike(collection)) { - return isString(collection) ? stringSize(collection) : collection.length; - } - var tag = getTag(collection); - if (tag == mapTag || tag == setTag) { - return collection.size; - } - return baseKeys(collection).length; - } - - /** - * Checks if `predicate` returns truthy for **any** element of `collection`. - * Iteration is stopped once `predicate` returns truthy. The predicate is - * invoked with three arguments: (value, index|key, collection). - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [predicate=_.identity] The function invoked per iteration. - * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. - * @returns {boolean} Returns `true` if any element passes the predicate check, - * else `false`. - * @example - * - * _.some([null, 0, 'yes', false], Boolean); - * // => true - * - * var users = [ - * { 'user': 'barney', 'active': true }, - * { 'user': 'fred', 'active': false } - * ]; - * - * // The `_.matches` iteratee shorthand. - * _.some(users, { 'user': 'barney', 'active': false }); - * // => false - * - * // The `_.matchesProperty` iteratee shorthand. - * _.some(users, ['active', false]); - * // => true - * - * // The `_.property` iteratee shorthand. - * _.some(users, 'active'); - * // => true - */ - function some(collection, predicate, guard) { - var func = isArray(collection) ? arraySome : baseSome; - if (guard && isIterateeCall(collection, predicate, guard)) { - predicate = undefined; - } - return func(collection, getIteratee(predicate, 3)); - } - - /** - * Creates an array of elements, sorted in ascending order by the results of - * running each element in a collection thru each iteratee. This method - * performs a stable sort, that is, it preserves the original sort order of - * equal elements. The iteratees are invoked with one argument: (value). - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {...(Function|Function[])} [iteratees=[_.identity]] - * The iteratees to sort by. - * @returns {Array} Returns the new sorted array. - * @example - * - * var users = [ - * { 'user': 'fred', 'age': 48 }, - * { 'user': 'barney', 'age': 36 }, - * { 'user': 'fred', 'age': 30 }, - * { 'user': 'barney', 'age': 34 } - * ]; - * - * _.sortBy(users, [function(o) { return o.user; }]); - * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 30]] - * - * _.sortBy(users, ['user', 'age']); - * // => objects for [['barney', 34], ['barney', 36], ['fred', 30], ['fred', 48]] - */ - var sortBy = baseRest(function(collection, iteratees) { - if (collection == null) { - return []; - } - var length = iteratees.length; - if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) { - iteratees = []; - } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) { - iteratees = [iteratees[0]]; - } - return baseOrderBy(collection, baseFlatten(iteratees, 1), []); - }); - - /*------------------------------------------------------------------------*/ - - /** - * Gets the timestamp of the number of milliseconds that have elapsed since - * the Unix epoch (1 January 1970 00:00:00 UTC). - * - * @static - * @memberOf _ - * @since 2.4.0 - * @category Date - * @returns {number} Returns the timestamp. - * @example - * - * _.defer(function(stamp) { - * console.log(_.now() - stamp); - * }, _.now()); - * // => Logs the number of milliseconds it took for the deferred invocation. - */ - var now = ctxNow || function() { - return root.Date.now(); - }; - - /*------------------------------------------------------------------------*/ - - /** - * The opposite of `_.before`; this method creates a function that invokes - * `func` once it's called `n` or more times. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Function - * @param {number} n The number of calls before `func` is invoked. - * @param {Function} func The function to restrict. - * @returns {Function} Returns the new restricted function. - * @example - * - * var saves = ['profile', 'settings']; - * - * var done = _.after(saves.length, function() { - * console.log('done saving!'); - * }); - * - * _.forEach(saves, function(type) { - * asyncSave({ 'type': type, 'complete': done }); - * }); - * // => Logs 'done saving!' after the two async saves have completed. - */ - function after(n, func) { - if (typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - n = toInteger(n); - return function() { - if (--n < 1) { - return func.apply(this, arguments); - } - }; - } - - /** - * Creates a function that invokes `func`, with up to `n` arguments, - * ignoring any additional arguments. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Function - * @param {Function} func The function to cap arguments for. - * @param {number} [n=func.length] The arity cap. - * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. - * @returns {Function} Returns the new capped function. - * @example - * - * _.map(['6', '8', '10'], _.ary(parseInt, 1)); - * // => [6, 8, 10] - */ - function ary(func, n, guard) { - n = guard ? undefined : n; - n = (func && n == null) ? func.length : n; - return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n); - } - - /** - * Creates a function that invokes `func`, with the `this` binding and arguments - * of the created function, while it's called less than `n` times. Subsequent - * calls to the created function return the result of the last `func` invocation. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Function - * @param {number} n The number of calls at which `func` is no longer invoked. - * @param {Function} func The function to restrict. - * @returns {Function} Returns the new restricted function. - * @example - * - * jQuery(element).on('click', _.before(5, addContactToList)); - * // => Allows adding up to 4 contacts to the list. - */ - function before(n, func) { - var result; - if (typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - n = toInteger(n); - return function() { - if (--n > 0) { - result = func.apply(this, arguments); - } - if (n <= 1) { - func = undefined; - } - return result; - }; - } - - /** - * Creates a function that invokes `func` with the `this` binding of `thisArg` - * and `partials` prepended to the arguments it receives. - * - * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds, - * may be used as a placeholder for partially applied arguments. - * - * **Note:** Unlike native `Function#bind`, this method doesn't set the "length" - * property of bound functions. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Function - * @param {Function} func The function to bind. - * @param {*} thisArg The `this` binding of `func`. - * @param {...*} [partials] The arguments to be partially applied. - * @returns {Function} Returns the new bound function. - * @example - * - * function greet(greeting, punctuation) { - * return greeting + ' ' + this.user + punctuation; - * } - * - * var object = { 'user': 'fred' }; - * - * var bound = _.bind(greet, object, 'hi'); - * bound('!'); - * // => 'hi fred!' - * - * // Bound with placeholders. - * var bound = _.bind(greet, object, _, '!'); - * bound('hi'); - * // => 'hi fred!' - */ - var bind = baseRest(function(func, thisArg, partials) { - var bitmask = WRAP_BIND_FLAG; - if (partials.length) { - var holders = replaceHolders(partials, getHolder(bind)); - bitmask |= WRAP_PARTIAL_FLAG; - } - return createWrap(func, bitmask, thisArg, partials, holders); - }); - - /** - * Creates a function that invokes the method at `object[key]` with `partials` - * prepended to the arguments it receives. - * - * This method differs from `_.bind` by allowing bound functions to reference - * methods that may be redefined or don't yet exist. See - * [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern) - * for more details. - * - * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic - * builds, may be used as a placeholder for partially applied arguments. - * - * @static - * @memberOf _ - * @since 0.10.0 - * @category Function - * @param {Object} object The object to invoke the method on. - * @param {string} key The key of the method. - * @param {...*} [partials] The arguments to be partially applied. - * @returns {Function} Returns the new bound function. - * @example - * - * var object = { - * 'user': 'fred', - * 'greet': function(greeting, punctuation) { - * return greeting + ' ' + this.user + punctuation; - * } - * }; - * - * var bound = _.bindKey(object, 'greet', 'hi'); - * bound('!'); - * // => 'hi fred!' - * - * object.greet = function(greeting, punctuation) { - * return greeting + 'ya ' + this.user + punctuation; - * }; - * - * bound('!'); - * // => 'hiya fred!' - * - * // Bound with placeholders. - * var bound = _.bindKey(object, 'greet', _, '!'); - * bound('hi'); - * // => 'hiya fred!' - */ - var bindKey = baseRest(function(object, key, partials) { - var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG; - if (partials.length) { - var holders = replaceHolders(partials, getHolder(bindKey)); - bitmask |= WRAP_PARTIAL_FLAG; - } - return createWrap(key, bitmask, object, partials, holders); - }); - - /** - * Creates a function that accepts arguments of `func` and either invokes - * `func` returning its result, if at least `arity` number of arguments have - * been provided, or returns a function that accepts the remaining `func` - * arguments, and so on. The arity of `func` may be specified if `func.length` - * is not sufficient. - * - * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds, - * may be used as a placeholder for provided arguments. - * - * **Note:** This method doesn't set the "length" property of curried functions. - * - * @static - * @memberOf _ - * @since 2.0.0 - * @category Function - * @param {Function} func The function to curry. - * @param {number} [arity=func.length] The arity of `func`. - * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. - * @returns {Function} Returns the new curried function. - * @example - * - * var abc = function(a, b, c) { - * return [a, b, c]; - * }; - * - * var curried = _.curry(abc); - * - * curried(1)(2)(3); - * // => [1, 2, 3] - * - * curried(1, 2)(3); - * // => [1, 2, 3] - * - * curried(1, 2, 3); - * // => [1, 2, 3] - * - * // Curried with placeholders. - * curried(1)(_, 3)(2); - * // => [1, 2, 3] - */ - function curry(func, arity, guard) { - arity = guard ? undefined : arity; - var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity); - result.placeholder = curry.placeholder; - return result; - } - - /** - * This method is like `_.curry` except that arguments are applied to `func` - * in the manner of `_.partialRight` instead of `_.partial`. - * - * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic - * builds, may be used as a placeholder for provided arguments. - * - * **Note:** This method doesn't set the "length" property of curried functions. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Function - * @param {Function} func The function to curry. - * @param {number} [arity=func.length] The arity of `func`. - * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. - * @returns {Function} Returns the new curried function. - * @example - * - * var abc = function(a, b, c) { - * return [a, b, c]; - * }; - * - * var curried = _.curryRight(abc); - * - * curried(3)(2)(1); - * // => [1, 2, 3] - * - * curried(2, 3)(1); - * // => [1, 2, 3] - * - * curried(1, 2, 3); - * // => [1, 2, 3] - * - * // Curried with placeholders. - * curried(3)(1, _)(2); - * // => [1, 2, 3] - */ - function curryRight(func, arity, guard) { - arity = guard ? undefined : arity; - var result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity); - result.placeholder = curryRight.placeholder; - return result; - } - - /** - * Creates a debounced function that delays invoking `func` until after `wait` - * milliseconds have elapsed since the last time the debounced function was - * invoked. The debounced function comes with a `cancel` method to cancel - * delayed `func` invocations and a `flush` method to immediately invoke them. - * Provide `options` to indicate whether `func` should be invoked on the - * leading and/or trailing edge of the `wait` timeout. The `func` is invoked - * with the last arguments provided to the debounced function. Subsequent - * calls to the debounced function return the result of the last `func` - * invocation. - * - * **Note:** If `leading` and `trailing` options are `true`, `func` is - * invoked on the trailing edge of the timeout only if the debounced function - * is invoked more than once during the `wait` timeout. - * - * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred - * until to the next tick, similar to `setTimeout` with a timeout of `0`. - * - * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) - * for details over the differences between `_.debounce` and `_.throttle`. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Function - * @param {Function} func The function to debounce. - * @param {number} [wait=0] The number of milliseconds to delay. - * @param {Object} [options={}] The options object. - * @param {boolean} [options.leading=false] - * Specify invoking on the leading edge of the timeout. - * @param {number} [options.maxWait] - * The maximum time `func` is allowed to be delayed before it's invoked. - * @param {boolean} [options.trailing=true] - * Specify invoking on the trailing edge of the timeout. - * @returns {Function} Returns the new debounced function. - * @example - * - * // Avoid costly calculations while the window size is in flux. - * jQuery(window).on('resize', _.debounce(calculateLayout, 150)); - * - * // Invoke `sendMail` when clicked, debouncing subsequent calls. - * jQuery(element).on('click', _.debounce(sendMail, 300, { - * 'leading': true, - * 'trailing': false - * })); - * - * // Ensure `batchLog` is invoked once after 1 second of debounced calls. - * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 }); - * var source = new EventSource('/stream'); - * jQuery(source).on('message', debounced); - * - * // Cancel the trailing debounced invocation. - * jQuery(window).on('popstate', debounced.cancel); - */ - function debounce(func, wait, options) { - var lastArgs, - lastThis, - maxWait, - result, - timerId, - lastCallTime, - lastInvokeTime = 0, - leading = false, - maxing = false, - trailing = true; - - if (typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - wait = toNumber(wait) || 0; - if (isObject(options)) { - leading = !!options.leading; - maxing = 'maxWait' in options; - maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait; - trailing = 'trailing' in options ? !!options.trailing : trailing; - } - - function invokeFunc(time) { - var args = lastArgs, - thisArg = lastThis; - - lastArgs = lastThis = undefined; - lastInvokeTime = time; - result = func.apply(thisArg, args); - return result; - } - - function leadingEdge(time) { - // Reset any `maxWait` timer. - lastInvokeTime = time; - // Start the timer for the trailing edge. - timerId = setTimeout(timerExpired, wait); - // Invoke the leading edge. - return leading ? invokeFunc(time) : result; - } - - function remainingWait(time) { - var timeSinceLastCall = time - lastCallTime, - timeSinceLastInvoke = time - lastInvokeTime, - timeWaiting = wait - timeSinceLastCall; - - return maxing - ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke) - : timeWaiting; - } - - function shouldInvoke(time) { - var timeSinceLastCall = time - lastCallTime, - timeSinceLastInvoke = time - lastInvokeTime; - - // Either this is the first call, activity has stopped and we're at the - // trailing edge, the system time has gone backwards and we're treating - // it as the trailing edge, or we've hit the `maxWait` limit. - return (lastCallTime === undefined || (timeSinceLastCall >= wait) || - (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait)); - } - - function timerExpired() { - var time = now(); - if (shouldInvoke(time)) { - return trailingEdge(time); - } - // Restart the timer. - timerId = setTimeout(timerExpired, remainingWait(time)); - } - - function trailingEdge(time) { - timerId = undefined; - - // Only invoke if we have `lastArgs` which means `func` has been - // debounced at least once. - if (trailing && lastArgs) { - return invokeFunc(time); - } - lastArgs = lastThis = undefined; - return result; - } - - function cancel() { - if (timerId !== undefined) { - clearTimeout(timerId); - } - lastInvokeTime = 0; - lastArgs = lastCallTime = lastThis = timerId = undefined; - } - - function flush() { - return timerId === undefined ? result : trailingEdge(now()); - } - - function debounced() { - var time = now(), - isInvoking = shouldInvoke(time); - - lastArgs = arguments; - lastThis = this; - lastCallTime = time; - - if (isInvoking) { - if (timerId === undefined) { - return leadingEdge(lastCallTime); - } - if (maxing) { - // Handle invocations in a tight loop. - clearTimeout(timerId); - timerId = setTimeout(timerExpired, wait); - return invokeFunc(lastCallTime); - } - } - if (timerId === undefined) { - timerId = setTimeout(timerExpired, wait); - } - return result; - } - debounced.cancel = cancel; - debounced.flush = flush; - return debounced; - } - - /** - * Defers invoking the `func` until the current call stack has cleared. Any - * additional arguments are provided to `func` when it's invoked. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Function - * @param {Function} func The function to defer. - * @param {...*} [args] The arguments to invoke `func` with. - * @returns {number} Returns the timer id. - * @example - * - * _.defer(function(text) { - * console.log(text); - * }, 'deferred'); - * // => Logs 'deferred' after one millisecond. - */ - var defer = baseRest(function(func, args) { - return baseDelay(func, 1, args); - }); - - /** - * Invokes `func` after `wait` milliseconds. Any additional arguments are - * provided to `func` when it's invoked. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Function - * @param {Function} func The function to delay. - * @param {number} wait The number of milliseconds to delay invocation. - * @param {...*} [args] The arguments to invoke `func` with. - * @returns {number} Returns the timer id. - * @example - * - * _.delay(function(text) { - * console.log(text); - * }, 1000, 'later'); - * // => Logs 'later' after one second. - */ - var delay = baseRest(function(func, wait, args) { - return baseDelay(func, toNumber(wait) || 0, args); - }); - - /** - * Creates a function that invokes `func` with arguments reversed. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Function - * @param {Function} func The function to flip arguments for. - * @returns {Function} Returns the new flipped function. - * @example - * - * var flipped = _.flip(function() { - * return _.toArray(arguments); - * }); - * - * flipped('a', 'b', 'c', 'd'); - * // => ['d', 'c', 'b', 'a'] - */ - function flip(func) { - return createWrap(func, WRAP_FLIP_FLAG); - } - - /** - * Creates a function that memoizes the result of `func`. If `resolver` is - * provided, it determines the cache key for storing the result based on the - * arguments provided to the memoized function. By default, the first argument - * provided to the memoized function is used as the map cache key. The `func` - * is invoked with the `this` binding of the memoized function. - * - * **Note:** The cache is exposed as the `cache` property on the memoized - * function. Its creation may be customized by replacing the `_.memoize.Cache` - * constructor with one whose instances implement the - * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object) - * method interface of `clear`, `delete`, `get`, `has`, and `set`. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Function - * @param {Function} func The function to have its output memoized. - * @param {Function} [resolver] The function to resolve the cache key. - * @returns {Function} Returns the new memoized function. - * @example - * - * var object = { 'a': 1, 'b': 2 }; - * var other = { 'c': 3, 'd': 4 }; - * - * var values = _.memoize(_.values); - * values(object); - * // => [1, 2] - * - * values(other); - * // => [3, 4] - * - * object.a = 2; - * values(object); - * // => [1, 2] - * - * // Modify the result cache. - * values.cache.set(object, ['a', 'b']); - * values(object); - * // => ['a', 'b'] - * - * // Replace `_.memoize.Cache`. - * _.memoize.Cache = WeakMap; - */ - function memoize(func, resolver) { - if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) { - throw new TypeError(FUNC_ERROR_TEXT); - } - var memoized = function() { - var args = arguments, - key = resolver ? resolver.apply(this, args) : args[0], - cache = memoized.cache; - - if (cache.has(key)) { - return cache.get(key); - } - var result = func.apply(this, args); - memoized.cache = cache.set(key, result) || cache; - return result; - }; - memoized.cache = new (memoize.Cache || MapCache); - return memoized; - } - - // Expose `MapCache`. - memoize.Cache = MapCache; - - /** - * Creates a function that negates the result of the predicate `func`. The - * `func` predicate is invoked with the `this` binding and arguments of the - * created function. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Function - * @param {Function} predicate The predicate to negate. - * @returns {Function} Returns the new negated function. - * @example - * - * function isEven(n) { - * return n % 2 == 0; - * } - * - * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven)); - * // => [1, 3, 5] - */ - function negate(predicate) { - if (typeof predicate != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - return function() { - var args = arguments; - switch (args.length) { - case 0: return !predicate.call(this); - case 1: return !predicate.call(this, args[0]); - case 2: return !predicate.call(this, args[0], args[1]); - case 3: return !predicate.call(this, args[0], args[1], args[2]); - } - return !predicate.apply(this, args); - }; - } - - /** - * Creates a function that is restricted to invoking `func` once. Repeat calls - * to the function return the value of the first invocation. The `func` is - * invoked with the `this` binding and arguments of the created function. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Function - * @param {Function} func The function to restrict. - * @returns {Function} Returns the new restricted function. - * @example - * - * var initialize = _.once(createApplication); - * initialize(); - * initialize(); - * // => `createApplication` is invoked once - */ - function once(func) { - return before(2, func); - } - - /** - * Creates a function that invokes `func` with its arguments transformed. - * - * @static - * @since 4.0.0 - * @memberOf _ - * @category Function - * @param {Function} func The function to wrap. - * @param {...(Function|Function[])} [transforms=[_.identity]] - * The argument transforms. - * @returns {Function} Returns the new function. - * @example - * - * function doubled(n) { - * return n * 2; - * } - * - * function square(n) { - * return n * n; - * } - * - * var func = _.overArgs(function(x, y) { - * return [x, y]; - * }, [square, doubled]); - * - * func(9, 3); - * // => [81, 6] - * - * func(10, 5); - * // => [100, 10] - */ - var overArgs = castRest(function(func, transforms) { - transforms = (transforms.length == 1 && isArray(transforms[0])) - ? arrayMap(transforms[0], baseUnary(getIteratee())) - : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee())); - - var funcsLength = transforms.length; - return baseRest(function(args) { - var index = -1, - length = nativeMin(args.length, funcsLength); - - while (++index < length) { - args[index] = transforms[index].call(this, args[index]); - } - return apply(func, this, args); - }); - }); - - /** - * Creates a function that invokes `func` with `partials` prepended to the - * arguments it receives. This method is like `_.bind` except it does **not** - * alter the `this` binding. - * - * The `_.partial.placeholder` value, which defaults to `_` in monolithic - * builds, may be used as a placeholder for partially applied arguments. - * - * **Note:** This method doesn't set the "length" property of partially - * applied functions. - * - * @static - * @memberOf _ - * @since 0.2.0 - * @category Function - * @param {Function} func The function to partially apply arguments to. - * @param {...*} [partials] The arguments to be partially applied. - * @returns {Function} Returns the new partially applied function. - * @example - * - * function greet(greeting, name) { - * return greeting + ' ' + name; - * } - * - * var sayHelloTo = _.partial(greet, 'hello'); - * sayHelloTo('fred'); - * // => 'hello fred' - * - * // Partially applied with placeholders. - * var greetFred = _.partial(greet, _, 'fred'); - * greetFred('hi'); - * // => 'hi fred' - */ - var partial = baseRest(function(func, partials) { - var holders = replaceHolders(partials, getHolder(partial)); - return createWrap(func, WRAP_PARTIAL_FLAG, undefined, partials, holders); - }); - - /** - * This method is like `_.partial` except that partially applied arguments - * are appended to the arguments it receives. - * - * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic - * builds, may be used as a placeholder for partially applied arguments. - * - * **Note:** This method doesn't set the "length" property of partially - * applied functions. - * - * @static - * @memberOf _ - * @since 1.0.0 - * @category Function - * @param {Function} func The function to partially apply arguments to. - * @param {...*} [partials] The arguments to be partially applied. - * @returns {Function} Returns the new partially applied function. - * @example - * - * function greet(greeting, name) { - * return greeting + ' ' + name; - * } - * - * var greetFred = _.partialRight(greet, 'fred'); - * greetFred('hi'); - * // => 'hi fred' - * - * // Partially applied with placeholders. - * var sayHelloTo = _.partialRight(greet, 'hello', _); - * sayHelloTo('fred'); - * // => 'hello fred' - */ - var partialRight = baseRest(function(func, partials) { - var holders = replaceHolders(partials, getHolder(partialRight)); - return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined, partials, holders); - }); - - /** - * Creates a function that invokes `func` with arguments arranged according - * to the specified `indexes` where the argument value at the first index is - * provided as the first argument, the argument value at the second index is - * provided as the second argument, and so on. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Function - * @param {Function} func The function to rearrange arguments for. - * @param {...(number|number[])} indexes The arranged argument indexes. - * @returns {Function} Returns the new function. - * @example - * - * var rearged = _.rearg(function(a, b, c) { - * return [a, b, c]; - * }, [2, 0, 1]); - * - * rearged('b', 'c', 'a') - * // => ['a', 'b', 'c'] - */ - var rearg = flatRest(function(func, indexes) { - return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes); - }); - - /** - * Creates a function that invokes `func` with the `this` binding of the - * created function and arguments from `start` and beyond provided as - * an array. - * - * **Note:** This method is based on the - * [rest parameter](https://mdn.io/rest_parameters). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Function - * @param {Function} func The function to apply a rest parameter to. - * @param {number} [start=func.length-1] The start position of the rest parameter. - * @returns {Function} Returns the new function. - * @example - * - * var say = _.rest(function(what, names) { - * return what + ' ' + _.initial(names).join(', ') + - * (_.size(names) > 1 ? ', & ' : '') + _.last(names); - * }); - * - * say('hello', 'fred', 'barney', 'pebbles'); - * // => 'hello fred, barney, & pebbles' - */ - function rest(func, start) { - if (typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - start = start === undefined ? start : toInteger(start); - return baseRest(func, start); - } - - /** - * Creates a function that invokes `func` with the `this` binding of the - * create function and an array of arguments much like - * [`Function#apply`](http://www.ecma-international.org/ecma-262/7.0/#sec-function.prototype.apply). - * - * **Note:** This method is based on the - * [spread operator](https://mdn.io/spread_operator). - * - * @static - * @memberOf _ - * @since 3.2.0 - * @category Function - * @param {Function} func The function to spread arguments over. - * @param {number} [start=0] The start position of the spread. - * @returns {Function} Returns the new function. - * @example - * - * var say = _.spread(function(who, what) { - * return who + ' says ' + what; - * }); - * - * say(['fred', 'hello']); - * // => 'fred says hello' - * - * var numbers = Promise.all([ - * Promise.resolve(40), - * Promise.resolve(36) - * ]); - * - * numbers.then(_.spread(function(x, y) { - * return x + y; - * })); - * // => a Promise of 76 - */ - function spread(func, start) { - if (typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - start = start == null ? 0 : nativeMax(toInteger(start), 0); - return baseRest(function(args) { - var array = args[start], - otherArgs = castSlice(args, 0, start); - - if (array) { - arrayPush(otherArgs, array); - } - return apply(func, this, otherArgs); - }); - } - - /** - * Creates a throttled function that only invokes `func` at most once per - * every `wait` milliseconds. The throttled function comes with a `cancel` - * method to cancel delayed `func` invocations and a `flush` method to - * immediately invoke them. Provide `options` to indicate whether `func` - * should be invoked on the leading and/or trailing edge of the `wait` - * timeout. The `func` is invoked with the last arguments provided to the - * throttled function. Subsequent calls to the throttled function return the - * result of the last `func` invocation. - * - * **Note:** If `leading` and `trailing` options are `true`, `func` is - * invoked on the trailing edge of the timeout only if the throttled function - * is invoked more than once during the `wait` timeout. - * - * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred - * until to the next tick, similar to `setTimeout` with a timeout of `0`. - * - * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) - * for details over the differences between `_.throttle` and `_.debounce`. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Function - * @param {Function} func The function to throttle. - * @param {number} [wait=0] The number of milliseconds to throttle invocations to. - * @param {Object} [options={}] The options object. - * @param {boolean} [options.leading=true] - * Specify invoking on the leading edge of the timeout. - * @param {boolean} [options.trailing=true] - * Specify invoking on the trailing edge of the timeout. - * @returns {Function} Returns the new throttled function. - * @example - * - * // Avoid excessively updating the position while scrolling. - * jQuery(window).on('scroll', _.throttle(updatePosition, 100)); - * - * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes. - * var throttled = _.throttle(renewToken, 300000, { 'trailing': false }); - * jQuery(element).on('click', throttled); - * - * // Cancel the trailing throttled invocation. - * jQuery(window).on('popstate', throttled.cancel); - */ - function throttle(func, wait, options) { - var leading = true, - trailing = true; - - if (typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - if (isObject(options)) { - leading = 'leading' in options ? !!options.leading : leading; - trailing = 'trailing' in options ? !!options.trailing : trailing; - } - return debounce(func, wait, { - 'leading': leading, - 'maxWait': wait, - 'trailing': trailing - }); - } - - /** - * Creates a function that accepts up to one argument, ignoring any - * additional arguments. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Function - * @param {Function} func The function to cap arguments for. - * @returns {Function} Returns the new capped function. - * @example - * - * _.map(['6', '8', '10'], _.unary(parseInt)); - * // => [6, 8, 10] - */ - function unary(func) { - return ary(func, 1); - } - - /** - * Creates a function that provides `value` to `wrapper` as its first - * argument. Any additional arguments provided to the function are appended - * to those provided to the `wrapper`. The wrapper is invoked with the `this` - * binding of the created function. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Function - * @param {*} value The value to wrap. - * @param {Function} [wrapper=identity] The wrapper function. - * @returns {Function} Returns the new function. - * @example - * - * var p = _.wrap(_.escape, function(func, text) { - * return '

' + func(text) + '

'; - * }); - * - * p('fred, barney, & pebbles'); - * // => '

fred, barney, & pebbles

' - */ - function wrap(value, wrapper) { - return partial(castFunction(wrapper), value); - } - - /*------------------------------------------------------------------------*/ - - /** - * Casts `value` as an array if it's not one. - * - * @static - * @memberOf _ - * @since 4.4.0 - * @category Lang - * @param {*} value The value to inspect. - * @returns {Array} Returns the cast array. - * @example - * - * _.castArray(1); - * // => [1] - * - * _.castArray({ 'a': 1 }); - * // => [{ 'a': 1 }] - * - * _.castArray('abc'); - * // => ['abc'] - * - * _.castArray(null); - * // => [null] - * - * _.castArray(undefined); - * // => [undefined] - * - * _.castArray(); - * // => [] - * - * var array = [1, 2, 3]; - * console.log(_.castArray(array) === array); - * // => true - */ - function castArray() { - if (!arguments.length) { - return []; - } - var value = arguments[0]; - return isArray(value) ? value : [value]; - } - - /** - * Creates a shallow clone of `value`. - * - * **Note:** This method is loosely based on the - * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm) - * and supports cloning arrays, array buffers, booleans, date objects, maps, - * numbers, `Object` objects, regexes, sets, strings, symbols, and typed - * arrays. The own enumerable properties of `arguments` objects are cloned - * as plain objects. An empty object is returned for uncloneable values such - * as error objects, functions, DOM nodes, and WeakMaps. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to clone. - * @returns {*} Returns the cloned value. - * @see _.cloneDeep - * @example - * - * var objects = [{ 'a': 1 }, { 'b': 2 }]; - * - * var shallow = _.clone(objects); - * console.log(shallow[0] === objects[0]); - * // => true - */ - function clone(value) { - return baseClone(value, CLONE_SYMBOLS_FLAG); - } - - /** - * This method is like `_.clone` except that it accepts `customizer` which - * is invoked to produce the cloned value. If `customizer` returns `undefined`, - * cloning is handled by the method instead. The `customizer` is invoked with - * up to four arguments; (value [, index|key, object, stack]). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to clone. - * @param {Function} [customizer] The function to customize cloning. - * @returns {*} Returns the cloned value. - * @see _.cloneDeepWith - * @example - * - * function customizer(value) { - * if (_.isElement(value)) { - * return value.cloneNode(false); - * } - * } - * - * var el = _.cloneWith(document.body, customizer); - * - * console.log(el === document.body); - * // => false - * console.log(el.nodeName); - * // => 'BODY' - * console.log(el.childNodes.length); - * // => 0 - */ - function cloneWith(value, customizer) { - customizer = typeof customizer == 'function' ? customizer : undefined; - return baseClone(value, CLONE_SYMBOLS_FLAG, customizer); - } - - /** - * This method is like `_.clone` except that it recursively clones `value`. - * - * @static - * @memberOf _ - * @since 1.0.0 - * @category Lang - * @param {*} value The value to recursively clone. - * @returns {*} Returns the deep cloned value. - * @see _.clone - * @example - * - * var objects = [{ 'a': 1 }, { 'b': 2 }]; - * - * var deep = _.cloneDeep(objects); - * console.log(deep[0] === objects[0]); - * // => false - */ - function cloneDeep(value) { - return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG); - } - - /** - * This method is like `_.cloneWith` except that it recursively clones `value`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to recursively clone. - * @param {Function} [customizer] The function to customize cloning. - * @returns {*} Returns the deep cloned value. - * @see _.cloneWith - * @example - * - * function customizer(value) { - * if (_.isElement(value)) { - * return value.cloneNode(true); - * } - * } - * - * var el = _.cloneDeepWith(document.body, customizer); - * - * console.log(el === document.body); - * // => false - * console.log(el.nodeName); - * // => 'BODY' - * console.log(el.childNodes.length); - * // => 20 - */ - function cloneDeepWith(value, customizer) { - customizer = typeof customizer == 'function' ? customizer : undefined; - return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer); - } - - /** - * Checks if `object` conforms to `source` by invoking the predicate - * properties of `source` with the corresponding property values of `object`. - * - * **Note:** This method is equivalent to `_.conforms` when `source` is - * partially applied. - * - * @static - * @memberOf _ - * @since 4.14.0 - * @category Lang - * @param {Object} object The object to inspect. - * @param {Object} source The object of property predicates to conform to. - * @returns {boolean} Returns `true` if `object` conforms, else `false`. - * @example - * - * var object = { 'a': 1, 'b': 2 }; - * - * _.conformsTo(object, { 'b': function(n) { return n > 1; } }); - * // => true - * - * _.conformsTo(object, { 'b': function(n) { return n > 2; } }); - * // => false - */ - function conformsTo(object, source) { - return source == null || baseConformsTo(object, source, keys(source)); - } - - /** - * Performs a - * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) - * comparison between two values to determine if they are equivalent. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if the values are equivalent, else `false`. - * @example - * - * var object = { 'a': 1 }; - * var other = { 'a': 1 }; - * - * _.eq(object, object); - * // => true - * - * _.eq(object, other); - * // => false - * - * _.eq('a', 'a'); - * // => true - * - * _.eq('a', Object('a')); - * // => false - * - * _.eq(NaN, NaN); - * // => true - */ - function eq(value, other) { - return value === other || (value !== value && other !== other); - } - - /** - * Checks if `value` is greater than `other`. - * - * @static - * @memberOf _ - * @since 3.9.0 - * @category Lang - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if `value` is greater than `other`, - * else `false`. - * @see _.lt - * @example - * - * _.gt(3, 1); - * // => true - * - * _.gt(3, 3); - * // => false - * - * _.gt(1, 3); - * // => false - */ - var gt = createRelationalOperation(baseGt); - - /** - * Checks if `value` is greater than or equal to `other`. - * - * @static - * @memberOf _ - * @since 3.9.0 - * @category Lang - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if `value` is greater than or equal to - * `other`, else `false`. - * @see _.lte - * @example - * - * _.gte(3, 1); - * // => true - * - * _.gte(3, 3); - * // => true - * - * _.gte(1, 3); - * // => false - */ - var gte = createRelationalOperation(function(value, other) { - return value >= other; - }); - - /** - * Checks if `value` is likely an `arguments` object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an `arguments` object, - * else `false`. - * @example - * - * _.isArguments(function() { return arguments; }()); - * // => true - * - * _.isArguments([1, 2, 3]); - * // => false - */ - var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) { - return isObjectLike(value) && hasOwnProperty.call(value, 'callee') && - !propertyIsEnumerable.call(value, 'callee'); - }; - - /** - * Checks if `value` is classified as an `Array` object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an array, else `false`. - * @example - * - * _.isArray([1, 2, 3]); - * // => true - * - * _.isArray(document.body.children); - * // => false - * - * _.isArray('abc'); - * // => false - * - * _.isArray(_.noop); - * // => false - */ - var isArray = Array.isArray; - - /** - * Checks if `value` is classified as an `ArrayBuffer` object. - * - * @static - * @memberOf _ - * @since 4.3.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`. - * @example - * - * _.isArrayBuffer(new ArrayBuffer(2)); - * // => true - * - * _.isArrayBuffer(new Array(2)); - * // => false - */ - var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer; - - /** - * Checks if `value` is array-like. A value is considered array-like if it's - * not a function and has a `value.length` that's an integer greater than or - * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is array-like, else `false`. - * @example - * - * _.isArrayLike([1, 2, 3]); - * // => true - * - * _.isArrayLike(document.body.children); - * // => true - * - * _.isArrayLike('abc'); - * // => true - * - * _.isArrayLike(_.noop); - * // => false - */ - function isArrayLike(value) { - return value != null && isLength(value.length) && !isFunction(value); - } - - /** - * This method is like `_.isArrayLike` except that it also checks if `value` - * is an object. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an array-like object, - * else `false`. - * @example - * - * _.isArrayLikeObject([1, 2, 3]); - * // => true - * - * _.isArrayLikeObject(document.body.children); - * // => true - * - * _.isArrayLikeObject('abc'); - * // => false - * - * _.isArrayLikeObject(_.noop); - * // => false - */ - function isArrayLikeObject(value) { - return isObjectLike(value) && isArrayLike(value); - } - - /** - * Checks if `value` is classified as a boolean primitive or object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a boolean, else `false`. - * @example - * - * _.isBoolean(false); - * // => true - * - * _.isBoolean(null); - * // => false - */ - function isBoolean(value) { - return value === true || value === false || - (isObjectLike(value) && baseGetTag(value) == boolTag); - } - - /** - * Checks if `value` is a buffer. - * - * @static - * @memberOf _ - * @since 4.3.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a buffer, else `false`. - * @example - * - * _.isBuffer(new Buffer(2)); - * // => true - * - * _.isBuffer(new Uint8Array(2)); - * // => false - */ - var isBuffer = nativeIsBuffer || stubFalse; - - /** - * Checks if `value` is classified as a `Date` object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a date object, else `false`. - * @example - * - * _.isDate(new Date); - * // => true - * - * _.isDate('Mon April 23 2012'); - * // => false - */ - var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate; - - /** - * Checks if `value` is likely a DOM element. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`. - * @example - * - * _.isElement(document.body); - * // => true - * - * _.isElement(''); - * // => false - */ - function isElement(value) { - return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value); - } - - /** - * Checks if `value` is an empty object, collection, map, or set. - * - * Objects are considered empty if they have no own enumerable string keyed - * properties. - * - * Array-like values such as `arguments` objects, arrays, buffers, strings, or - * jQuery-like collections are considered empty if they have a `length` of `0`. - * Similarly, maps and sets are considered empty if they have a `size` of `0`. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is empty, else `false`. - * @example - * - * _.isEmpty(null); - * // => true - * - * _.isEmpty(true); - * // => true - * - * _.isEmpty(1); - * // => true - * - * _.isEmpty([1, 2, 3]); - * // => false - * - * _.isEmpty({ 'a': 1 }); - * // => false - */ - function isEmpty(value) { - if (value == null) { - return true; - } - if (isArrayLike(value) && - (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' || - isBuffer(value) || isTypedArray(value) || isArguments(value))) { - return !value.length; - } - var tag = getTag(value); - if (tag == mapTag || tag == setTag) { - return !value.size; - } - if (isPrototype(value)) { - return !baseKeys(value).length; - } - for (var key in value) { - if (hasOwnProperty.call(value, key)) { - return false; - } - } - return true; - } - - /** - * Performs a deep comparison between two values to determine if they are - * equivalent. - * - * **Note:** This method supports comparing arrays, array buffers, booleans, - * date objects, error objects, maps, numbers, `Object` objects, regexes, - * sets, strings, symbols, and typed arrays. `Object` objects are compared - * by their own, not inherited, enumerable properties. Functions and DOM - * nodes are compared by strict equality, i.e. `===`. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if the values are equivalent, else `false`. - * @example - * - * var object = { 'a': 1 }; - * var other = { 'a': 1 }; - * - * _.isEqual(object, other); - * // => true - * - * object === other; - * // => false - */ - function isEqual(value, other) { - return baseIsEqual(value, other); - } - - /** - * This method is like `_.isEqual` except that it accepts `customizer` which - * is invoked to compare values. If `customizer` returns `undefined`, comparisons - * are handled by the method instead. The `customizer` is invoked with up to - * six arguments: (objValue, othValue [, index|key, object, other, stack]). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @param {Function} [customizer] The function to customize comparisons. - * @returns {boolean} Returns `true` if the values are equivalent, else `false`. - * @example - * - * function isGreeting(value) { - * return /^h(?:i|ello)$/.test(value); - * } - * - * function customizer(objValue, othValue) { - * if (isGreeting(objValue) && isGreeting(othValue)) { - * return true; - * } - * } - * - * var array = ['hello', 'goodbye']; - * var other = ['hi', 'goodbye']; - * - * _.isEqualWith(array, other, customizer); - * // => true - */ - function isEqualWith(value, other, customizer) { - customizer = typeof customizer == 'function' ? customizer : undefined; - var result = customizer ? customizer(value, other) : undefined; - return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result; - } - - /** - * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`, - * `SyntaxError`, `TypeError`, or `URIError` object. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an error object, else `false`. - * @example - * - * _.isError(new Error); - * // => true - * - * _.isError(Error); - * // => false - */ - function isError(value) { - if (!isObjectLike(value)) { - return false; - } - var tag = baseGetTag(value); - return tag == errorTag || tag == domExcTag || - (typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value)); - } - - /** - * Checks if `value` is a finite primitive number. - * - * **Note:** This method is based on - * [`Number.isFinite`](https://mdn.io/Number/isFinite). - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a finite number, else `false`. - * @example - * - * _.isFinite(3); - * // => true - * - * _.isFinite(Number.MIN_VALUE); - * // => true - * - * _.isFinite(Infinity); - * // => false - * - * _.isFinite('3'); - * // => false - */ - function isFinite(value) { - return typeof value == 'number' && nativeIsFinite(value); - } - - /** - * Checks if `value` is classified as a `Function` object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a function, else `false`. - * @example - * - * _.isFunction(_); - * // => true - * - * _.isFunction(/abc/); - * // => false - */ - function isFunction(value) { - if (!isObject(value)) { - return false; - } - // The use of `Object#toString` avoids issues with the `typeof` operator - // in Safari 9 which returns 'object' for typed arrays and other constructors. - var tag = baseGetTag(value); - return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag; - } - - /** - * Checks if `value` is an integer. - * - * **Note:** This method is based on - * [`Number.isInteger`](https://mdn.io/Number/isInteger). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an integer, else `false`. - * @example - * - * _.isInteger(3); - * // => true - * - * _.isInteger(Number.MIN_VALUE); - * // => false - * - * _.isInteger(Infinity); - * // => false - * - * _.isInteger('3'); - * // => false - */ - function isInteger(value) { - return typeof value == 'number' && value == toInteger(value); - } - - /** - * Checks if `value` is a valid array-like length. - * - * **Note:** This method is loosely based on - * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. - * @example - * - * _.isLength(3); - * // => true - * - * _.isLength(Number.MIN_VALUE); - * // => false - * - * _.isLength(Infinity); - * // => false - * - * _.isLength('3'); - * // => false - */ - function isLength(value) { - return typeof value == 'number' && - value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; - } - - /** - * Checks if `value` is the - * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) - * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an object, else `false`. - * @example - * - * _.isObject({}); - * // => true - * - * _.isObject([1, 2, 3]); - * // => true - * - * _.isObject(_.noop); - * // => true - * - * _.isObject(null); - * // => false - */ - function isObject(value) { - var type = typeof value; - return value != null && (type == 'object' || type == 'function'); - } - - /** - * Checks if `value` is object-like. A value is object-like if it's not `null` - * and has a `typeof` result of "object". - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is object-like, else `false`. - * @example - * - * _.isObjectLike({}); - * // => true - * - * _.isObjectLike([1, 2, 3]); - * // => true - * - * _.isObjectLike(_.noop); - * // => false - * - * _.isObjectLike(null); - * // => false - */ - function isObjectLike(value) { - return value != null && typeof value == 'object'; - } - - /** - * Checks if `value` is classified as a `Map` object. - * - * @static - * @memberOf _ - * @since 4.3.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a map, else `false`. - * @example - * - * _.isMap(new Map); - * // => true - * - * _.isMap(new WeakMap); - * // => false - */ - var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap; - - /** - * Performs a partial deep comparison between `object` and `source` to - * determine if `object` contains equivalent property values. - * - * **Note:** This method is equivalent to `_.matches` when `source` is - * partially applied. - * - * Partial comparisons will match empty array and empty object `source` - * values against any array or object value, respectively. See `_.isEqual` - * for a list of supported value comparisons. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Lang - * @param {Object} object The object to inspect. - * @param {Object} source The object of property values to match. - * @returns {boolean} Returns `true` if `object` is a match, else `false`. - * @example - * - * var object = { 'a': 1, 'b': 2 }; - * - * _.isMatch(object, { 'b': 2 }); - * // => true - * - * _.isMatch(object, { 'b': 1 }); - * // => false - */ - function isMatch(object, source) { - return object === source || baseIsMatch(object, source, getMatchData(source)); - } - - /** - * This method is like `_.isMatch` except that it accepts `customizer` which - * is invoked to compare values. If `customizer` returns `undefined`, comparisons - * are handled by the method instead. The `customizer` is invoked with five - * arguments: (objValue, srcValue, index|key, object, source). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {Object} object The object to inspect. - * @param {Object} source The object of property values to match. - * @param {Function} [customizer] The function to customize comparisons. - * @returns {boolean} Returns `true` if `object` is a match, else `false`. - * @example - * - * function isGreeting(value) { - * return /^h(?:i|ello)$/.test(value); - * } - * - * function customizer(objValue, srcValue) { - * if (isGreeting(objValue) && isGreeting(srcValue)) { - * return true; - * } - * } - * - * var object = { 'greeting': 'hello' }; - * var source = { 'greeting': 'hi' }; - * - * _.isMatchWith(object, source, customizer); - * // => true - */ - function isMatchWith(object, source, customizer) { - customizer = typeof customizer == 'function' ? customizer : undefined; - return baseIsMatch(object, source, getMatchData(source), customizer); - } - - /** - * Checks if `value` is `NaN`. - * - * **Note:** This method is based on - * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as - * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for - * `undefined` and other non-number values. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. - * @example - * - * _.isNaN(NaN); - * // => true - * - * _.isNaN(new Number(NaN)); - * // => true - * - * isNaN(undefined); - * // => true - * - * _.isNaN(undefined); - * // => false - */ - function isNaN(value) { - // An `NaN` primitive is the only value that is not equal to itself. - // Perform the `toStringTag` check first to avoid errors with some - // ActiveX objects in IE. - return isNumber(value) && value != +value; - } - - /** - * Checks if `value` is a pristine native function. - * - * **Note:** This method can't reliably detect native functions in the presence - * of the core-js package because core-js circumvents this kind of detection. - * Despite multiple requests, the core-js maintainer has made it clear: any - * attempt to fix the detection will be obstructed. As a result, we're left - * with little choice but to throw an error. Unfortunately, this also affects - * packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill), - * which rely on core-js. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a native function, - * else `false`. - * @example - * - * _.isNative(Array.prototype.push); - * // => true - * - * _.isNative(_); - * // => false - */ - function isNative(value) { - if (isMaskable(value)) { - throw new Error(CORE_ERROR_TEXT); - } - return baseIsNative(value); - } - - /** - * Checks if `value` is `null`. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is `null`, else `false`. - * @example - * - * _.isNull(null); - * // => true - * - * _.isNull(void 0); - * // => false - */ - function isNull(value) { - return value === null; - } - - /** - * Checks if `value` is `null` or `undefined`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is nullish, else `false`. - * @example - * - * _.isNil(null); - * // => true - * - * _.isNil(void 0); - * // => true - * - * _.isNil(NaN); - * // => false - */ - function isNil(value) { - return value == null; - } - - /** - * Checks if `value` is classified as a `Number` primitive or object. - * - * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are - * classified as numbers, use the `_.isFinite` method. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a number, else `false`. - * @example - * - * _.isNumber(3); - * // => true - * - * _.isNumber(Number.MIN_VALUE); - * // => true - * - * _.isNumber(Infinity); - * // => true - * - * _.isNumber('3'); - * // => false - */ - function isNumber(value) { - return typeof value == 'number' || - (isObjectLike(value) && baseGetTag(value) == numberTag); - } - - /** - * Checks if `value` is a plain object, that is, an object created by the - * `Object` constructor or one with a `[[Prototype]]` of `null`. - * - * @static - * @memberOf _ - * @since 0.8.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a plain object, else `false`. - * @example - * - * function Foo() { - * this.a = 1; - * } - * - * _.isPlainObject(new Foo); - * // => false - * - * _.isPlainObject([1, 2, 3]); - * // => false - * - * _.isPlainObject({ 'x': 0, 'y': 0 }); - * // => true - * - * _.isPlainObject(Object.create(null)); - * // => true - */ - function isPlainObject(value) { - if (!isObjectLike(value) || baseGetTag(value) != objectTag) { - return false; - } - var proto = getPrototype(value); - if (proto === null) { - return true; - } - var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor; - return typeof Ctor == 'function' && Ctor instanceof Ctor && - funcToString.call(Ctor) == objectCtorString; - } - - /** - * Checks if `value` is classified as a `RegExp` object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a regexp, else `false`. - * @example - * - * _.isRegExp(/abc/); - * // => true - * - * _.isRegExp('/abc/'); - * // => false - */ - var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp; - - /** - * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754 - * double precision number which isn't the result of a rounded unsafe integer. - * - * **Note:** This method is based on - * [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a safe integer, else `false`. - * @example - * - * _.isSafeInteger(3); - * // => true - * - * _.isSafeInteger(Number.MIN_VALUE); - * // => false - * - * _.isSafeInteger(Infinity); - * // => false - * - * _.isSafeInteger('3'); - * // => false - */ - function isSafeInteger(value) { - return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER; - } - - /** - * Checks if `value` is classified as a `Set` object. - * - * @static - * @memberOf _ - * @since 4.3.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a set, else `false`. - * @example - * - * _.isSet(new Set); - * // => true - * - * _.isSet(new WeakSet); - * // => false - */ - var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet; - - /** - * Checks if `value` is classified as a `String` primitive or object. - * - * @static - * @since 0.1.0 - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a string, else `false`. - * @example - * - * _.isString('abc'); - * // => true - * - * _.isString(1); - * // => false - */ - function isString(value) { - return typeof value == 'string' || - (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag); - } - - /** - * Checks if `value` is classified as a `Symbol` primitive or object. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. - * @example - * - * _.isSymbol(Symbol.iterator); - * // => true - * - * _.isSymbol('abc'); - * // => false - */ - function isSymbol(value) { - return typeof value == 'symbol' || - (isObjectLike(value) && baseGetTag(value) == symbolTag); - } - - /** - * Checks if `value` is classified as a typed array. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. - * @example - * - * _.isTypedArray(new Uint8Array); - * // => true - * - * _.isTypedArray([]); - * // => false - */ - var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray; - - /** - * Checks if `value` is `undefined`. - * - * @static - * @since 0.1.0 - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`. - * @example - * - * _.isUndefined(void 0); - * // => true - * - * _.isUndefined(null); - * // => false - */ - function isUndefined(value) { - return value === undefined; - } - - /** - * Checks if `value` is classified as a `WeakMap` object. - * - * @static - * @memberOf _ - * @since 4.3.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a weak map, else `false`. - * @example - * - * _.isWeakMap(new WeakMap); - * // => true - * - * _.isWeakMap(new Map); - * // => false - */ - function isWeakMap(value) { - return isObjectLike(value) && getTag(value) == weakMapTag; - } - - /** - * Checks if `value` is classified as a `WeakSet` object. - * - * @static - * @memberOf _ - * @since 4.3.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a weak set, else `false`. - * @example - * - * _.isWeakSet(new WeakSet); - * // => true - * - * _.isWeakSet(new Set); - * // => false - */ - function isWeakSet(value) { - return isObjectLike(value) && baseGetTag(value) == weakSetTag; - } - - /** - * Checks if `value` is less than `other`. - * - * @static - * @memberOf _ - * @since 3.9.0 - * @category Lang - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if `value` is less than `other`, - * else `false`. - * @see _.gt - * @example - * - * _.lt(1, 3); - * // => true - * - * _.lt(3, 3); - * // => false - * - * _.lt(3, 1); - * // => false - */ - var lt = createRelationalOperation(baseLt); - - /** - * Checks if `value` is less than or equal to `other`. - * - * @static - * @memberOf _ - * @since 3.9.0 - * @category Lang - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if `value` is less than or equal to - * `other`, else `false`. - * @see _.gte - * @example - * - * _.lte(1, 3); - * // => true - * - * _.lte(3, 3); - * // => true - * - * _.lte(3, 1); - * // => false - */ - var lte = createRelationalOperation(function(value, other) { - return value <= other; - }); - - /** - * Converts `value` to an array. - * - * @static - * @since 0.1.0 - * @memberOf _ - * @category Lang - * @param {*} value The value to convert. - * @returns {Array} Returns the converted array. - * @example - * - * _.toArray({ 'a': 1, 'b': 2 }); - * // => [1, 2] - * - * _.toArray('abc'); - * // => ['a', 'b', 'c'] - * - * _.toArray(1); - * // => [] - * - * _.toArray(null); - * // => [] - */ - function toArray(value) { - if (!value) { - return []; - } - if (isArrayLike(value)) { - return isString(value) ? stringToArray(value) : copyArray(value); - } - if (symIterator && value[symIterator]) { - return iteratorToArray(value[symIterator]()); - } - var tag = getTag(value), - func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values); - - return func(value); - } - - /** - * Converts `value` to a finite number. - * - * @static - * @memberOf _ - * @since 4.12.0 - * @category Lang - * @param {*} value The value to convert. - * @returns {number} Returns the converted number. - * @example - * - * _.toFinite(3.2); - * // => 3.2 - * - * _.toFinite(Number.MIN_VALUE); - * // => 5e-324 - * - * _.toFinite(Infinity); - * // => 1.7976931348623157e+308 - * - * _.toFinite('3.2'); - * // => 3.2 - */ - function toFinite(value) { - if (!value) { - return value === 0 ? value : 0; - } - value = toNumber(value); - if (value === INFINITY || value === -INFINITY) { - var sign = (value < 0 ? -1 : 1); - return sign * MAX_INTEGER; - } - return value === value ? value : 0; - } - - /** - * Converts `value` to an integer. - * - * **Note:** This method is loosely based on - * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to convert. - * @returns {number} Returns the converted integer. - * @example - * - * _.toInteger(3.2); - * // => 3 - * - * _.toInteger(Number.MIN_VALUE); - * // => 0 - * - * _.toInteger(Infinity); - * // => 1.7976931348623157e+308 - * - * _.toInteger('3.2'); - * // => 3 - */ - function toInteger(value) { - var result = toFinite(value), - remainder = result % 1; - - return result === result ? (remainder ? result - remainder : result) : 0; - } - - /** - * Converts `value` to an integer suitable for use as the length of an - * array-like object. - * - * **Note:** This method is based on - * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to convert. - * @returns {number} Returns the converted integer. - * @example - * - * _.toLength(3.2); - * // => 3 - * - * _.toLength(Number.MIN_VALUE); - * // => 0 - * - * _.toLength(Infinity); - * // => 4294967295 - * - * _.toLength('3.2'); - * // => 3 - */ - function toLength(value) { - return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0; - } - - /** - * Converts `value` to a number. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to process. - * @returns {number} Returns the number. - * @example - * - * _.toNumber(3.2); - * // => 3.2 - * - * _.toNumber(Number.MIN_VALUE); - * // => 5e-324 - * - * _.toNumber(Infinity); - * // => Infinity - * - * _.toNumber('3.2'); - * // => 3.2 - */ - function toNumber(value) { - if (typeof value == 'number') { - return value; - } - if (isSymbol(value)) { - return NAN; - } - if (isObject(value)) { - var other = typeof value.valueOf == 'function' ? value.valueOf() : value; - value = isObject(other) ? (other + '') : other; - } - if (typeof value != 'string') { - return value === 0 ? value : +value; - } - value = baseTrim(value); - var isBinary = reIsBinary.test(value); - return (isBinary || reIsOctal.test(value)) - ? freeParseInt(value.slice(2), isBinary ? 2 : 8) - : (reIsBadHex.test(value) ? NAN : +value); - } - - /** - * Converts `value` to a plain object flattening inherited enumerable string - * keyed properties of `value` to own properties of the plain object. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Lang - * @param {*} value The value to convert. - * @returns {Object} Returns the converted plain object. - * @example - * - * function Foo() { - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.assign({ 'a': 1 }, new Foo); - * // => { 'a': 1, 'b': 2 } - * - * _.assign({ 'a': 1 }, _.toPlainObject(new Foo)); - * // => { 'a': 1, 'b': 2, 'c': 3 } - */ - function toPlainObject(value) { - return copyObject(value, keysIn(value)); - } - - /** - * Converts `value` to a safe integer. A safe integer can be compared and - * represented correctly. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to convert. - * @returns {number} Returns the converted integer. - * @example - * - * _.toSafeInteger(3.2); - * // => 3 - * - * _.toSafeInteger(Number.MIN_VALUE); - * // => 0 - * - * _.toSafeInteger(Infinity); - * // => 9007199254740991 - * - * _.toSafeInteger('3.2'); - * // => 3 - */ - function toSafeInteger(value) { - return value - ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER) - : (value === 0 ? value : 0); - } - - /** - * Converts `value` to a string. An empty string is returned for `null` - * and `undefined` values. The sign of `-0` is preserved. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to convert. - * @returns {string} Returns the converted string. - * @example - * - * _.toString(null); - * // => '' - * - * _.toString(-0); - * // => '-0' - * - * _.toString([1, 2, 3]); - * // => '1,2,3' - */ - function toString(value) { - return value == null ? '' : baseToString(value); - } - - /*------------------------------------------------------------------------*/ - - /** - * Assigns own enumerable string keyed properties of source objects to the - * destination object. Source objects are applied from left to right. - * Subsequent sources overwrite property assignments of previous sources. - * - * **Note:** This method mutates `object` and is loosely based on - * [`Object.assign`](https://mdn.io/Object/assign). - * - * @static - * @memberOf _ - * @since 0.10.0 - * @category Object - * @param {Object} object The destination object. - * @param {...Object} [sources] The source objects. - * @returns {Object} Returns `object`. - * @see _.assignIn - * @example - * - * function Foo() { - * this.a = 1; - * } - * - * function Bar() { - * this.c = 3; - * } - * - * Foo.prototype.b = 2; - * Bar.prototype.d = 4; - * - * _.assign({ 'a': 0 }, new Foo, new Bar); - * // => { 'a': 1, 'c': 3 } - */ - var assign = createAssigner(function(object, source) { - if (isPrototype(source) || isArrayLike(source)) { - copyObject(source, keys(source), object); - return; - } - for (var key in source) { - if (hasOwnProperty.call(source, key)) { - assignValue(object, key, source[key]); - } - } - }); - - /** - * This method is like `_.assign` except that it iterates over own and - * inherited source properties. - * - * **Note:** This method mutates `object`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @alias extend - * @category Object - * @param {Object} object The destination object. - * @param {...Object} [sources] The source objects. - * @returns {Object} Returns `object`. - * @see _.assign - * @example - * - * function Foo() { - * this.a = 1; - * } - * - * function Bar() { - * this.c = 3; - * } - * - * Foo.prototype.b = 2; - * Bar.prototype.d = 4; - * - * _.assignIn({ 'a': 0 }, new Foo, new Bar); - * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 } - */ - var assignIn = createAssigner(function(object, source) { - copyObject(source, keysIn(source), object); - }); - - /** - * This method is like `_.assignIn` except that it accepts `customizer` - * which is invoked to produce the assigned values. If `customizer` returns - * `undefined`, assignment is handled by the method instead. The `customizer` - * is invoked with five arguments: (objValue, srcValue, key, object, source). - * - * **Note:** This method mutates `object`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @alias extendWith - * @category Object - * @param {Object} object The destination object. - * @param {...Object} sources The source objects. - * @param {Function} [customizer] The function to customize assigned values. - * @returns {Object} Returns `object`. - * @see _.assignWith - * @example - * - * function customizer(objValue, srcValue) { - * return _.isUndefined(objValue) ? srcValue : objValue; - * } - * - * var defaults = _.partialRight(_.assignInWith, customizer); - * - * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); - * // => { 'a': 1, 'b': 2 } - */ - var assignInWith = createAssigner(function(object, source, srcIndex, customizer) { - copyObject(source, keysIn(source), object, customizer); - }); - - /** - * This method is like `_.assign` except that it accepts `customizer` - * which is invoked to produce the assigned values. If `customizer` returns - * `undefined`, assignment is handled by the method instead. The `customizer` - * is invoked with five arguments: (objValue, srcValue, key, object, source). - * - * **Note:** This method mutates `object`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Object - * @param {Object} object The destination object. - * @param {...Object} sources The source objects. - * @param {Function} [customizer] The function to customize assigned values. - * @returns {Object} Returns `object`. - * @see _.assignInWith - * @example - * - * function customizer(objValue, srcValue) { - * return _.isUndefined(objValue) ? srcValue : objValue; - * } - * - * var defaults = _.partialRight(_.assignWith, customizer); - * - * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); - * // => { 'a': 1, 'b': 2 } - */ - var assignWith = createAssigner(function(object, source, srcIndex, customizer) { - copyObject(source, keys(source), object, customizer); - }); - - /** - * Creates an array of values corresponding to `paths` of `object`. - * - * @static - * @memberOf _ - * @since 1.0.0 - * @category Object - * @param {Object} object The object to iterate over. - * @param {...(string|string[])} [paths] The property paths to pick. - * @returns {Array} Returns the picked values. - * @example - * - * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] }; - * - * _.at(object, ['a[0].b.c', 'a[1]']); - * // => [3, 4] - */ - var at = flatRest(baseAt); - - /** - * Creates an object that inherits from the `prototype` object. If a - * `properties` object is given, its own enumerable string keyed properties - * are assigned to the created object. - * - * @static - * @memberOf _ - * @since 2.3.0 - * @category Object - * @param {Object} prototype The object to inherit from. - * @param {Object} [properties] The properties to assign to the object. - * @returns {Object} Returns the new object. - * @example - * - * function Shape() { - * this.x = 0; - * this.y = 0; - * } - * - * function Circle() { - * Shape.call(this); - * } - * - * Circle.prototype = _.create(Shape.prototype, { - * 'constructor': Circle - * }); - * - * var circle = new Circle; - * circle instanceof Circle; - * // => true - * - * circle instanceof Shape; - * // => true - */ - function create(prototype, properties) { - var result = baseCreate(prototype); - return properties == null ? result : baseAssign(result, properties); - } - - /** - * Assigns own and inherited enumerable string keyed properties of source - * objects to the destination object for all destination properties that - * resolve to `undefined`. Source objects are applied from left to right. - * Once a property is set, additional values of the same property are ignored. - * - * **Note:** This method mutates `object`. - * - * @static - * @since 0.1.0 - * @memberOf _ - * @category Object - * @param {Object} object The destination object. - * @param {...Object} [sources] The source objects. - * @returns {Object} Returns `object`. - * @see _.defaultsDeep - * @example - * - * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); - * // => { 'a': 1, 'b': 2 } - */ - var defaults = baseRest(function(object, sources) { - object = Object(object); - - var index = -1; - var length = sources.length; - var guard = length > 2 ? sources[2] : undefined; - - if (guard && isIterateeCall(sources[0], sources[1], guard)) { - length = 1; - } - - while (++index < length) { - var source = sources[index]; - var props = keysIn(source); - var propsIndex = -1; - var propsLength = props.length; - - while (++propsIndex < propsLength) { - var key = props[propsIndex]; - var value = object[key]; - - if (value === undefined || - (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) { - object[key] = source[key]; - } - } - } - - return object; - }); - - /** - * This method is like `_.defaults` except that it recursively assigns - * default properties. - * - * **Note:** This method mutates `object`. - * - * @static - * @memberOf _ - * @since 3.10.0 - * @category Object - * @param {Object} object The destination object. - * @param {...Object} [sources] The source objects. - * @returns {Object} Returns `object`. - * @see _.defaults - * @example - * - * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } }); - * // => { 'a': { 'b': 2, 'c': 3 } } - */ - var defaultsDeep = baseRest(function(args) { - args.push(undefined, customDefaultsMerge); - return apply(mergeWith, undefined, args); - }); - - /** - * This method is like `_.find` except that it returns the key of the first - * element `predicate` returns truthy for instead of the element itself. - * - * @static - * @memberOf _ - * @since 1.1.0 - * @category Object - * @param {Object} object The object to inspect. - * @param {Function} [predicate=_.identity] The function invoked per iteration. - * @returns {string|undefined} Returns the key of the matched element, - * else `undefined`. - * @example - * - * var users = { - * 'barney': { 'age': 36, 'active': true }, - * 'fred': { 'age': 40, 'active': false }, - * 'pebbles': { 'age': 1, 'active': true } - * }; - * - * _.findKey(users, function(o) { return o.age < 40; }); - * // => 'barney' (iteration order is not guaranteed) - * - * // The `_.matches` iteratee shorthand. - * _.findKey(users, { 'age': 1, 'active': true }); - * // => 'pebbles' - * - * // The `_.matchesProperty` iteratee shorthand. - * _.findKey(users, ['active', false]); - * // => 'fred' - * - * // The `_.property` iteratee shorthand. - * _.findKey(users, 'active'); - * // => 'barney' - */ - function findKey(object, predicate) { - return baseFindKey(object, getIteratee(predicate, 3), baseForOwn); - } - - /** - * This method is like `_.findKey` except that it iterates over elements of - * a collection in the opposite order. - * - * @static - * @memberOf _ - * @since 2.0.0 - * @category Object - * @param {Object} object The object to inspect. - * @param {Function} [predicate=_.identity] The function invoked per iteration. - * @returns {string|undefined} Returns the key of the matched element, - * else `undefined`. - * @example - * - * var users = { - * 'barney': { 'age': 36, 'active': true }, - * 'fred': { 'age': 40, 'active': false }, - * 'pebbles': { 'age': 1, 'active': true } - * }; - * - * _.findLastKey(users, function(o) { return o.age < 40; }); - * // => returns 'pebbles' assuming `_.findKey` returns 'barney' - * - * // The `_.matches` iteratee shorthand. - * _.findLastKey(users, { 'age': 36, 'active': true }); - * // => 'barney' - * - * // The `_.matchesProperty` iteratee shorthand. - * _.findLastKey(users, ['active', false]); - * // => 'fred' - * - * // The `_.property` iteratee shorthand. - * _.findLastKey(users, 'active'); - * // => 'pebbles' - */ - function findLastKey(object, predicate) { - return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight); - } - - /** - * Iterates over own and inherited enumerable string keyed properties of an - * object and invokes `iteratee` for each property. The iteratee is invoked - * with three arguments: (value, key, object). Iteratee functions may exit - * iteration early by explicitly returning `false`. - * - * @static - * @memberOf _ - * @since 0.3.0 - * @category Object - * @param {Object} object The object to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @returns {Object} Returns `object`. - * @see _.forInRight - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.forIn(new Foo, function(value, key) { - * console.log(key); - * }); - * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed). - */ - function forIn(object, iteratee) { - return object == null - ? object - : baseFor(object, getIteratee(iteratee, 3), keysIn); - } - - /** - * This method is like `_.forIn` except that it iterates over properties of - * `object` in the opposite order. - * - * @static - * @memberOf _ - * @since 2.0.0 - * @category Object - * @param {Object} object The object to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @returns {Object} Returns `object`. - * @see _.forIn - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.forInRight(new Foo, function(value, key) { - * console.log(key); - * }); - * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'. - */ - function forInRight(object, iteratee) { - return object == null - ? object - : baseForRight(object, getIteratee(iteratee, 3), keysIn); - } - - /** - * Iterates over own enumerable string keyed properties of an object and - * invokes `iteratee` for each property. The iteratee is invoked with three - * arguments: (value, key, object). Iteratee functions may exit iteration - * early by explicitly returning `false`. - * - * @static - * @memberOf _ - * @since 0.3.0 - * @category Object - * @param {Object} object The object to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @returns {Object} Returns `object`. - * @see _.forOwnRight - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.forOwn(new Foo, function(value, key) { - * console.log(key); - * }); - * // => Logs 'a' then 'b' (iteration order is not guaranteed). - */ - function forOwn(object, iteratee) { - return object && baseForOwn(object, getIteratee(iteratee, 3)); - } - - /** - * This method is like `_.forOwn` except that it iterates over properties of - * `object` in the opposite order. - * - * @static - * @memberOf _ - * @since 2.0.0 - * @category Object - * @param {Object} object The object to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @returns {Object} Returns `object`. - * @see _.forOwn - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.forOwnRight(new Foo, function(value, key) { - * console.log(key); - * }); - * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'. - */ - function forOwnRight(object, iteratee) { - return object && baseForOwnRight(object, getIteratee(iteratee, 3)); - } - - /** - * Creates an array of function property names from own enumerable properties - * of `object`. - * - * @static - * @since 0.1.0 - * @memberOf _ - * @category Object - * @param {Object} object The object to inspect. - * @returns {Array} Returns the function names. - * @see _.functionsIn - * @example - * - * function Foo() { - * this.a = _.constant('a'); - * this.b = _.constant('b'); - * } - * - * Foo.prototype.c = _.constant('c'); - * - * _.functions(new Foo); - * // => ['a', 'b'] - */ - function functions(object) { - return object == null ? [] : baseFunctions(object, keys(object)); - } - - /** - * Creates an array of function property names from own and inherited - * enumerable properties of `object`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Object - * @param {Object} object The object to inspect. - * @returns {Array} Returns the function names. - * @see _.functions - * @example - * - * function Foo() { - * this.a = _.constant('a'); - * this.b = _.constant('b'); - * } - * - * Foo.prototype.c = _.constant('c'); - * - * _.functionsIn(new Foo); - * // => ['a', 'b', 'c'] - */ - function functionsIn(object) { - return object == null ? [] : baseFunctions(object, keysIn(object)); - } - - /** - * Gets the value at `path` of `object`. If the resolved value is - * `undefined`, the `defaultValue` is returned in its place. - * - * @static - * @memberOf _ - * @since 3.7.0 - * @category Object - * @param {Object} object The object to query. - * @param {Array|string} path The path of the property to get. - * @param {*} [defaultValue] The value returned for `undefined` resolved values. - * @returns {*} Returns the resolved value. - * @example - * - * var object = { 'a': [{ 'b': { 'c': 3 } }] }; - * - * _.get(object, 'a[0].b.c'); - * // => 3 - * - * _.get(object, ['a', '0', 'b', 'c']); - * // => 3 - * - * _.get(object, 'a.b.c', 'default'); - * // => 'default' - */ - function get(object, path, defaultValue) { - var result = object == null ? undefined : baseGet(object, path); - return result === undefined ? defaultValue : result; - } - - /** - * Checks if `path` is a direct property of `object`. - * - * @static - * @since 0.1.0 - * @memberOf _ - * @category Object - * @param {Object} object The object to query. - * @param {Array|string} path The path to check. - * @returns {boolean} Returns `true` if `path` exists, else `false`. - * @example - * - * var object = { 'a': { 'b': 2 } }; - * var other = _.create({ 'a': _.create({ 'b': 2 }) }); - * - * _.has(object, 'a'); - * // => true - * - * _.has(object, 'a.b'); - * // => true - * - * _.has(object, ['a', 'b']); - * // => true - * - * _.has(other, 'a'); - * // => false - */ - function has(object, path) { - return object != null && hasPath(object, path, baseHas); - } - - /** - * Checks if `path` is a direct or inherited property of `object`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Object - * @param {Object} object The object to query. - * @param {Array|string} path The path to check. - * @returns {boolean} Returns `true` if `path` exists, else `false`. - * @example - * - * var object = _.create({ 'a': _.create({ 'b': 2 }) }); - * - * _.hasIn(object, 'a'); - * // => true - * - * _.hasIn(object, 'a.b'); - * // => true - * - * _.hasIn(object, ['a', 'b']); - * // => true - * - * _.hasIn(object, 'b'); - * // => false - */ - function hasIn(object, path) { - return object != null && hasPath(object, path, baseHasIn); - } - - /** - * Creates an object composed of the inverted keys and values of `object`. - * If `object` contains duplicate values, subsequent values overwrite - * property assignments of previous values. - * - * @static - * @memberOf _ - * @since 0.7.0 - * @category Object - * @param {Object} object The object to invert. - * @returns {Object} Returns the new inverted object. - * @example - * - * var object = { 'a': 1, 'b': 2, 'c': 1 }; - * - * _.invert(object); - * // => { '1': 'c', '2': 'b' } - */ - var invert = createInverter(function(result, value, key) { - if (value != null && - typeof value.toString != 'function') { - value = nativeObjectToString.call(value); - } - - result[value] = key; - }, constant(identity)); - - /** - * This method is like `_.invert` except that the inverted object is generated - * from the results of running each element of `object` thru `iteratee`. The - * corresponding inverted value of each inverted key is an array of keys - * responsible for generating the inverted value. The iteratee is invoked - * with one argument: (value). - * - * @static - * @memberOf _ - * @since 4.1.0 - * @category Object - * @param {Object} object The object to invert. - * @param {Function} [iteratee=_.identity] The iteratee invoked per element. - * @returns {Object} Returns the new inverted object. - * @example - * - * var object = { 'a': 1, 'b': 2, 'c': 1 }; - * - * _.invertBy(object); - * // => { '1': ['a', 'c'], '2': ['b'] } - * - * _.invertBy(object, function(value) { - * return 'group' + value; - * }); - * // => { 'group1': ['a', 'c'], 'group2': ['b'] } - */ - var invertBy = createInverter(function(result, value, key) { - if (value != null && - typeof value.toString != 'function') { - value = nativeObjectToString.call(value); - } - - if (hasOwnProperty.call(result, value)) { - result[value].push(key); - } else { - result[value] = [key]; - } - }, getIteratee); - - /** - * Invokes the method at `path` of `object`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Object - * @param {Object} object The object to query. - * @param {Array|string} path The path of the method to invoke. - * @param {...*} [args] The arguments to invoke the method with. - * @returns {*} Returns the result of the invoked method. - * @example - * - * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] }; - * - * _.invoke(object, 'a[0].b.c.slice', 1, 3); - * // => [2, 3] - */ - var invoke = baseRest(baseInvoke); - - /** - * Creates an array of the own enumerable property names of `object`. - * - * **Note:** Non-object values are coerced to objects. See the - * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) - * for more details. - * - * @static - * @since 0.1.0 - * @memberOf _ - * @category Object - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.keys(new Foo); - * // => ['a', 'b'] (iteration order is not guaranteed) - * - * _.keys('hi'); - * // => ['0', '1'] - */ - function keys(object) { - return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object); - } - - /** - * Creates an array of the own and inherited enumerable property names of `object`. - * - * **Note:** Non-object values are coerced to objects. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Object - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.keysIn(new Foo); - * // => ['a', 'b', 'c'] (iteration order is not guaranteed) - */ - function keysIn(object) { - return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object); - } - - /** - * The opposite of `_.mapValues`; this method creates an object with the - * same values as `object` and keys generated by running each own enumerable - * string keyed property of `object` thru `iteratee`. The iteratee is invoked - * with three arguments: (value, key, object). - * - * @static - * @memberOf _ - * @since 3.8.0 - * @category Object - * @param {Object} object The object to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @returns {Object} Returns the new mapped object. - * @see _.mapValues - * @example - * - * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) { - * return key + value; - * }); - * // => { 'a1': 1, 'b2': 2 } - */ - function mapKeys(object, iteratee) { - var result = {}; - iteratee = getIteratee(iteratee, 3); - - baseForOwn(object, function(value, key, object) { - baseAssignValue(result, iteratee(value, key, object), value); - }); - return result; - } - - /** - * Creates an object with the same keys as `object` and values generated - * by running each own enumerable string keyed property of `object` thru - * `iteratee`. The iteratee is invoked with three arguments: - * (value, key, object). - * - * @static - * @memberOf _ - * @since 2.4.0 - * @category Object - * @param {Object} object The object to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @returns {Object} Returns the new mapped object. - * @see _.mapKeys - * @example - * - * var users = { - * 'fred': { 'user': 'fred', 'age': 40 }, - * 'pebbles': { 'user': 'pebbles', 'age': 1 } - * }; - * - * _.mapValues(users, function(o) { return o.age; }); - * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed) - * - * // The `_.property` iteratee shorthand. - * _.mapValues(users, 'age'); - * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed) - */ - function mapValues(object, iteratee) { - var result = {}; - iteratee = getIteratee(iteratee, 3); - - baseForOwn(object, function(value, key, object) { - baseAssignValue(result, key, iteratee(value, key, object)); - }); - return result; - } - - /** - * This method is like `_.assign` except that it recursively merges own and - * inherited enumerable string keyed properties of source objects into the - * destination object. Source properties that resolve to `undefined` are - * skipped if a destination value exists. Array and plain object properties - * are merged recursively. Other objects and value types are overridden by - * assignment. Source objects are applied from left to right. Subsequent - * sources overwrite property assignments of previous sources. - * - * **Note:** This method mutates `object`. - * - * @static - * @memberOf _ - * @since 0.5.0 - * @category Object - * @param {Object} object The destination object. - * @param {...Object} [sources] The source objects. - * @returns {Object} Returns `object`. - * @example - * - * var object = { - * 'a': [{ 'b': 2 }, { 'd': 4 }] - * }; - * - * var other = { - * 'a': [{ 'c': 3 }, { 'e': 5 }] - * }; - * - * _.merge(object, other); - * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] } - */ - var merge = createAssigner(function(object, source, srcIndex) { - baseMerge(object, source, srcIndex); - }); - - /** - * This method is like `_.merge` except that it accepts `customizer` which - * is invoked to produce the merged values of the destination and source - * properties. If `customizer` returns `undefined`, merging is handled by the - * method instead. The `customizer` is invoked with six arguments: - * (objValue, srcValue, key, object, source, stack). - * - * **Note:** This method mutates `object`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Object - * @param {Object} object The destination object. - * @param {...Object} sources The source objects. - * @param {Function} customizer The function to customize assigned values. - * @returns {Object} Returns `object`. - * @example - * - * function customizer(objValue, srcValue) { - * if (_.isArray(objValue)) { - * return objValue.concat(srcValue); - * } - * } - * - * var object = { 'a': [1], 'b': [2] }; - * var other = { 'a': [3], 'b': [4] }; - * - * _.mergeWith(object, other, customizer); - * // => { 'a': [1, 3], 'b': [2, 4] } - */ - var mergeWith = createAssigner(function(object, source, srcIndex, customizer) { - baseMerge(object, source, srcIndex, customizer); - }); - - /** - * The opposite of `_.pick`; this method creates an object composed of the - * own and inherited enumerable property paths of `object` that are not omitted. - * - * **Note:** This method is considerably slower than `_.pick`. - * - * @static - * @since 0.1.0 - * @memberOf _ - * @category Object - * @param {Object} object The source object. - * @param {...(string|string[])} [paths] The property paths to omit. - * @returns {Object} Returns the new object. - * @example - * - * var object = { 'a': 1, 'b': '2', 'c': 3 }; - * - * _.omit(object, ['a', 'c']); - * // => { 'b': '2' } - */ - var omit = flatRest(function(object, paths) { - var result = {}; - if (object == null) { - return result; - } - var isDeep = false; - paths = arrayMap(paths, function(path) { - path = castPath(path, object); - isDeep || (isDeep = path.length > 1); - return path; - }); - copyObject(object, getAllKeysIn(object), result); - if (isDeep) { - result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone); - } - var length = paths.length; - while (length--) { - baseUnset(result, paths[length]); - } - return result; - }); - - /** - * The opposite of `_.pickBy`; this method creates an object composed of - * the own and inherited enumerable string keyed properties of `object` that - * `predicate` doesn't return truthy for. The predicate is invoked with two - * arguments: (value, key). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Object - * @param {Object} object The source object. - * @param {Function} [predicate=_.identity] The function invoked per property. - * @returns {Object} Returns the new object. - * @example - * - * var object = { 'a': 1, 'b': '2', 'c': 3 }; - * - * _.omitBy(object, _.isNumber); - * // => { 'b': '2' } - */ - function omitBy(object, predicate) { - return pickBy(object, negate(getIteratee(predicate))); - } - - /** - * Creates an object composed of the picked `object` properties. - * - * @static - * @since 0.1.0 - * @memberOf _ - * @category Object - * @param {Object} object The source object. - * @param {...(string|string[])} [paths] The property paths to pick. - * @returns {Object} Returns the new object. - * @example - * - * var object = { 'a': 1, 'b': '2', 'c': 3 }; - * - * _.pick(object, ['a', 'c']); - * // => { 'a': 1, 'c': 3 } - */ - var pick = flatRest(function(object, paths) { - return object == null ? {} : basePick(object, paths); - }); - - /** - * Creates an object composed of the `object` properties `predicate` returns - * truthy for. The predicate is invoked with two arguments: (value, key). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Object - * @param {Object} object The source object. - * @param {Function} [predicate=_.identity] The function invoked per property. - * @returns {Object} Returns the new object. - * @example - * - * var object = { 'a': 1, 'b': '2', 'c': 3 }; - * - * _.pickBy(object, _.isNumber); - * // => { 'a': 1, 'c': 3 } - */ - function pickBy(object, predicate) { - if (object == null) { - return {}; - } - var props = arrayMap(getAllKeysIn(object), function(prop) { - return [prop]; - }); - predicate = getIteratee(predicate); - return basePickBy(object, props, function(value, path) { - return predicate(value, path[0]); - }); - } - - /** - * This method is like `_.get` except that if the resolved value is a - * function it's invoked with the `this` binding of its parent object and - * its result is returned. - * - * @static - * @since 0.1.0 - * @memberOf _ - * @category Object - * @param {Object} object The object to query. - * @param {Array|string} path The path of the property to resolve. - * @param {*} [defaultValue] The value returned for `undefined` resolved values. - * @returns {*} Returns the resolved value. - * @example - * - * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] }; - * - * _.result(object, 'a[0].b.c1'); - * // => 3 - * - * _.result(object, 'a[0].b.c2'); - * // => 4 - * - * _.result(object, 'a[0].b.c3', 'default'); - * // => 'default' - * - * _.result(object, 'a[0].b.c3', _.constant('default')); - * // => 'default' - */ - function result(object, path, defaultValue) { - path = castPath(path, object); - - var index = -1, - length = path.length; - - // Ensure the loop is entered when path is empty. - if (!length) { - length = 1; - object = undefined; - } - while (++index < length) { - var value = object == null ? undefined : object[toKey(path[index])]; - if (value === undefined) { - index = length; - value = defaultValue; - } - object = isFunction(value) ? value.call(object) : value; - } - return object; - } - - /** - * Sets the value at `path` of `object`. If a portion of `path` doesn't exist, - * it's created. Arrays are created for missing index properties while objects - * are created for all other missing properties. Use `_.setWith` to customize - * `path` creation. - * - * **Note:** This method mutates `object`. - * - * @static - * @memberOf _ - * @since 3.7.0 - * @category Object - * @param {Object} object The object to modify. - * @param {Array|string} path The path of the property to set. - * @param {*} value The value to set. - * @returns {Object} Returns `object`. - * @example - * - * var object = { 'a': [{ 'b': { 'c': 3 } }] }; - * - * _.set(object, 'a[0].b.c', 4); - * console.log(object.a[0].b.c); - * // => 4 - * - * _.set(object, ['x', '0', 'y', 'z'], 5); - * console.log(object.x[0].y.z); - * // => 5 - */ - function set(object, path, value) { - return object == null ? object : baseSet(object, path, value); - } - - /** - * This method is like `_.set` except that it accepts `customizer` which is - * invoked to produce the objects of `path`. If `customizer` returns `undefined` - * path creation is handled by the method instead. The `customizer` is invoked - * with three arguments: (nsValue, key, nsObject). - * - * **Note:** This method mutates `object`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Object - * @param {Object} object The object to modify. - * @param {Array|string} path The path of the property to set. - * @param {*} value The value to set. - * @param {Function} [customizer] The function to customize assigned values. - * @returns {Object} Returns `object`. - * @example - * - * var object = {}; - * - * _.setWith(object, '[0][1]', 'a', Object); - * // => { '0': { '1': 'a' } } - */ - function setWith(object, path, value, customizer) { - customizer = typeof customizer == 'function' ? customizer : undefined; - return object == null ? object : baseSet(object, path, value, customizer); - } - - /** - * Creates an array of own enumerable string keyed-value pairs for `object` - * which can be consumed by `_.fromPairs`. If `object` is a map or set, its - * entries are returned. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @alias entries - * @category Object - * @param {Object} object The object to query. - * @returns {Array} Returns the key-value pairs. - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.toPairs(new Foo); - * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed) - */ - var toPairs = createToPairs(keys); - - /** - * Creates an array of own and inherited enumerable string keyed-value pairs - * for `object` which can be consumed by `_.fromPairs`. If `object` is a map - * or set, its entries are returned. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @alias entriesIn - * @category Object - * @param {Object} object The object to query. - * @returns {Array} Returns the key-value pairs. - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.toPairsIn(new Foo); - * // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed) - */ - var toPairsIn = createToPairs(keysIn); - - /** - * An alternative to `_.reduce`; this method transforms `object` to a new - * `accumulator` object which is the result of running each of its own - * enumerable string keyed properties thru `iteratee`, with each invocation - * potentially mutating the `accumulator` object. If `accumulator` is not - * provided, a new object with the same `[[Prototype]]` will be used. The - * iteratee is invoked with four arguments: (accumulator, value, key, object). - * Iteratee functions may exit iteration early by explicitly returning `false`. - * - * @static - * @memberOf _ - * @since 1.3.0 - * @category Object - * @param {Object} object The object to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @param {*} [accumulator] The custom accumulator value. - * @returns {*} Returns the accumulated value. - * @example - * - * _.transform([2, 3, 4], function(result, n) { - * result.push(n *= n); - * return n % 2 == 0; - * }, []); - * // => [4, 9] - * - * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) { - * (result[value] || (result[value] = [])).push(key); - * }, {}); - * // => { '1': ['a', 'c'], '2': ['b'] } - */ - function transform(object, iteratee, accumulator) { - var isArr = isArray(object), - isArrLike = isArr || isBuffer(object) || isTypedArray(object); - - iteratee = getIteratee(iteratee, 4); - if (accumulator == null) { - var Ctor = object && object.constructor; - if (isArrLike) { - accumulator = isArr ? new Ctor : []; - } - else if (isObject(object)) { - accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {}; - } - else { - accumulator = {}; - } - } - (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object) { - return iteratee(accumulator, value, index, object); - }); - return accumulator; - } - - /** - * Removes the property at `path` of `object`. - * - * **Note:** This method mutates `object`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Object - * @param {Object} object The object to modify. - * @param {Array|string} path The path of the property to unset. - * @returns {boolean} Returns `true` if the property is deleted, else `false`. - * @example - * - * var object = { 'a': [{ 'b': { 'c': 7 } }] }; - * _.unset(object, 'a[0].b.c'); - * // => true - * - * console.log(object); - * // => { 'a': [{ 'b': {} }] }; - * - * _.unset(object, ['a', '0', 'b', 'c']); - * // => true - * - * console.log(object); - * // => { 'a': [{ 'b': {} }] }; - */ - function unset(object, path) { - return object == null ? true : baseUnset(object, path); - } - - /** - * This method is like `_.set` except that accepts `updater` to produce the - * value to set. Use `_.updateWith` to customize `path` creation. The `updater` - * is invoked with one argument: (value). - * - * **Note:** This method mutates `object`. - * - * @static - * @memberOf _ - * @since 4.6.0 - * @category Object - * @param {Object} object The object to modify. - * @param {Array|string} path The path of the property to set. - * @param {Function} updater The function to produce the updated value. - * @returns {Object} Returns `object`. - * @example - * - * var object = { 'a': [{ 'b': { 'c': 3 } }] }; - * - * _.update(object, 'a[0].b.c', function(n) { return n * n; }); - * console.log(object.a[0].b.c); - * // => 9 - * - * _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; }); - * console.log(object.x[0].y.z); - * // => 0 - */ - function update(object, path, updater) { - return object == null ? object : baseUpdate(object, path, castFunction(updater)); - } - - /** - * This method is like `_.update` except that it accepts `customizer` which is - * invoked to produce the objects of `path`. If `customizer` returns `undefined` - * path creation is handled by the method instead. The `customizer` is invoked - * with three arguments: (nsValue, key, nsObject). - * - * **Note:** This method mutates `object`. - * - * @static - * @memberOf _ - * @since 4.6.0 - * @category Object - * @param {Object} object The object to modify. - * @param {Array|string} path The path of the property to set. - * @param {Function} updater The function to produce the updated value. - * @param {Function} [customizer] The function to customize assigned values. - * @returns {Object} Returns `object`. - * @example - * - * var object = {}; - * - * _.updateWith(object, '[0][1]', _.constant('a'), Object); - * // => { '0': { '1': 'a' } } - */ - function updateWith(object, path, updater, customizer) { - customizer = typeof customizer == 'function' ? customizer : undefined; - return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer); - } - - /** - * Creates an array of the own enumerable string keyed property values of `object`. - * - * **Note:** Non-object values are coerced to objects. - * - * @static - * @since 0.1.0 - * @memberOf _ - * @category Object - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property values. - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.values(new Foo); - * // => [1, 2] (iteration order is not guaranteed) - * - * _.values('hi'); - * // => ['h', 'i'] - */ - function values(object) { - return object == null ? [] : baseValues(object, keys(object)); - } - - /** - * Creates an array of the own and inherited enumerable string keyed property - * values of `object`. - * - * **Note:** Non-object values are coerced to objects. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Object - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property values. - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.valuesIn(new Foo); - * // => [1, 2, 3] (iteration order is not guaranteed) - */ - function valuesIn(object) { - return object == null ? [] : baseValues(object, keysIn(object)); - } - - /*------------------------------------------------------------------------*/ - - /** - * Clamps `number` within the inclusive `lower` and `upper` bounds. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Number - * @param {number} number The number to clamp. - * @param {number} [lower] The lower bound. - * @param {number} upper The upper bound. - * @returns {number} Returns the clamped number. - * @example - * - * _.clamp(-10, -5, 5); - * // => -5 - * - * _.clamp(10, -5, 5); - * // => 5 - */ - function clamp(number, lower, upper) { - if (upper === undefined) { - upper = lower; - lower = undefined; - } - if (upper !== undefined) { - upper = toNumber(upper); - upper = upper === upper ? upper : 0; - } - if (lower !== undefined) { - lower = toNumber(lower); - lower = lower === lower ? lower : 0; - } - return baseClamp(toNumber(number), lower, upper); - } - - /** - * Checks if `n` is between `start` and up to, but not including, `end`. If - * `end` is not specified, it's set to `start` with `start` then set to `0`. - * If `start` is greater than `end` the params are swapped to support - * negative ranges. - * - * @static - * @memberOf _ - * @since 3.3.0 - * @category Number - * @param {number} number The number to check. - * @param {number} [start=0] The start of the range. - * @param {number} end The end of the range. - * @returns {boolean} Returns `true` if `number` is in the range, else `false`. - * @see _.range, _.rangeRight - * @example - * - * _.inRange(3, 2, 4); - * // => true - * - * _.inRange(4, 8); - * // => true - * - * _.inRange(4, 2); - * // => false - * - * _.inRange(2, 2); - * // => false - * - * _.inRange(1.2, 2); - * // => true - * - * _.inRange(5.2, 4); - * // => false - * - * _.inRange(-3, -2, -6); - * // => true - */ - function inRange(number, start, end) { - start = toFinite(start); - if (end === undefined) { - end = start; - start = 0; - } else { - end = toFinite(end); - } - number = toNumber(number); - return baseInRange(number, start, end); - } - - /** - * Produces a random number between the inclusive `lower` and `upper` bounds. - * If only one argument is provided a number between `0` and the given number - * is returned. If `floating` is `true`, or either `lower` or `upper` are - * floats, a floating-point number is returned instead of an integer. - * - * **Note:** JavaScript follows the IEEE-754 standard for resolving - * floating-point values which can produce unexpected results. - * - * @static - * @memberOf _ - * @since 0.7.0 - * @category Number - * @param {number} [lower=0] The lower bound. - * @param {number} [upper=1] The upper bound. - * @param {boolean} [floating] Specify returning a floating-point number. - * @returns {number} Returns the random number. - * @example - * - * _.random(0, 5); - * // => an integer between 0 and 5 - * - * _.random(5); - * // => also an integer between 0 and 5 - * - * _.random(5, true); - * // => a floating-point number between 0 and 5 - * - * _.random(1.2, 5.2); - * // => a floating-point number between 1.2 and 5.2 - */ - function random(lower, upper, floating) { - if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) { - upper = floating = undefined; - } - if (floating === undefined) { - if (typeof upper == 'boolean') { - floating = upper; - upper = undefined; - } - else if (typeof lower == 'boolean') { - floating = lower; - lower = undefined; - } - } - if (lower === undefined && upper === undefined) { - lower = 0; - upper = 1; - } - else { - lower = toFinite(lower); - if (upper === undefined) { - upper = lower; - lower = 0; - } else { - upper = toFinite(upper); - } - } - if (lower > upper) { - var temp = lower; - lower = upper; - upper = temp; - } - if (floating || lower % 1 || upper % 1) { - var rand = nativeRandom(); - return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper); - } - return baseRandom(lower, upper); - } - - /*------------------------------------------------------------------------*/ - - /** - * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase). - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category String - * @param {string} [string=''] The string to convert. - * @returns {string} Returns the camel cased string. - * @example - * - * _.camelCase('Foo Bar'); - * // => 'fooBar' - * - * _.camelCase('--foo-bar--'); - * // => 'fooBar' - * - * _.camelCase('__FOO_BAR__'); - * // => 'fooBar' - */ - var camelCase = createCompounder(function(result, word, index) { - word = word.toLowerCase(); - return result + (index ? capitalize(word) : word); - }); - - /** - * Converts the first character of `string` to upper case and the remaining - * to lower case. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category String - * @param {string} [string=''] The string to capitalize. - * @returns {string} Returns the capitalized string. - * @example - * - * _.capitalize('FRED'); - * // => 'Fred' - */ - function capitalize(string) { - return upperFirst(toString(string).toLowerCase()); - } - - /** - * Deburrs `string` by converting - * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table) - * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A) - * letters to basic Latin letters and removing - * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks). - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category String - * @param {string} [string=''] The string to deburr. - * @returns {string} Returns the deburred string. - * @example - * - * _.deburr('déjà vu'); - * // => 'deja vu' - */ - function deburr(string) { - string = toString(string); - return string && string.replace(reLatin, deburrLetter).replace(reComboMark, ''); - } - - /** - * Checks if `string` ends with the given target string. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category String - * @param {string} [string=''] The string to inspect. - * @param {string} [target] The string to search for. - * @param {number} [position=string.length] The position to search up to. - * @returns {boolean} Returns `true` if `string` ends with `target`, - * else `false`. - * @example - * - * _.endsWith('abc', 'c'); - * // => true - * - * _.endsWith('abc', 'b'); - * // => false - * - * _.endsWith('abc', 'b', 2); - * // => true - */ - function endsWith(string, target, position) { - string = toString(string); - target = baseToString(target); - - var length = string.length; - position = position === undefined - ? length - : baseClamp(toInteger(position), 0, length); - - var end = position; - position -= target.length; - return position >= 0 && string.slice(position, end) == target; - } - - /** - * Converts the characters "&", "<", ">", '"', and "'" in `string` to their - * corresponding HTML entities. - * - * **Note:** No other characters are escaped. To escape additional - * characters use a third-party library like [_he_](https://mths.be/he). - * - * Though the ">" character is escaped for symmetry, characters like - * ">" and "/" don't need escaping in HTML and have no special meaning - * unless they're part of a tag or unquoted attribute value. See - * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands) - * (under "semi-related fun fact") for more details. - * - * When working with HTML you should always - * [quote attribute values](http://wonko.com/post/html-escaping) to reduce - * XSS vectors. - * - * @static - * @since 0.1.0 - * @memberOf _ - * @category String - * @param {string} [string=''] The string to escape. - * @returns {string} Returns the escaped string. - * @example - * - * _.escape('fred, barney, & pebbles'); - * // => 'fred, barney, & pebbles' - */ - function escape(string) { - string = toString(string); - return (string && reHasUnescapedHtml.test(string)) - ? string.replace(reUnescapedHtml, escapeHtmlChar) - : string; - } - - /** - * Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+", - * "?", "(", ")", "[", "]", "{", "}", and "|" in `string`. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category String - * @param {string} [string=''] The string to escape. - * @returns {string} Returns the escaped string. - * @example - * - * _.escapeRegExp('[lodash](https://lodash.com/)'); - * // => '\[lodash\]\(https://lodash\.com/\)' - */ - function escapeRegExp(string) { - string = toString(string); - return (string && reHasRegExpChar.test(string)) - ? string.replace(reRegExpChar, '\\$&') - : string; - } - - /** - * Converts `string` to - * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles). - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category String - * @param {string} [string=''] The string to convert. - * @returns {string} Returns the kebab cased string. - * @example - * - * _.kebabCase('Foo Bar'); - * // => 'foo-bar' - * - * _.kebabCase('fooBar'); - * // => 'foo-bar' - * - * _.kebabCase('__FOO_BAR__'); - * // => 'foo-bar' - */ - var kebabCase = createCompounder(function(result, word, index) { - return result + (index ? '-' : '') + word.toLowerCase(); - }); - - /** - * Converts `string`, as space separated words, to lower case. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category String - * @param {string} [string=''] The string to convert. - * @returns {string} Returns the lower cased string. - * @example - * - * _.lowerCase('--Foo-Bar--'); - * // => 'foo bar' - * - * _.lowerCase('fooBar'); - * // => 'foo bar' - * - * _.lowerCase('__FOO_BAR__'); - * // => 'foo bar' - */ - var lowerCase = createCompounder(function(result, word, index) { - return result + (index ? ' ' : '') + word.toLowerCase(); - }); - - /** - * Converts the first character of `string` to lower case. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category String - * @param {string} [string=''] The string to convert. - * @returns {string} Returns the converted string. - * @example - * - * _.lowerFirst('Fred'); - * // => 'fred' - * - * _.lowerFirst('FRED'); - * // => 'fRED' - */ - var lowerFirst = createCaseFirst('toLowerCase'); - - /** - * Pads `string` on the left and right sides if it's shorter than `length`. - * Padding characters are truncated if they can't be evenly divided by `length`. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category String - * @param {string} [string=''] The string to pad. - * @param {number} [length=0] The padding length. - * @param {string} [chars=' '] The string used as padding. - * @returns {string} Returns the padded string. - * @example - * - * _.pad('abc', 8); - * // => ' abc ' - * - * _.pad('abc', 8, '_-'); - * // => '_-abc_-_' - * - * _.pad('abc', 3); - * // => 'abc' - */ - function pad(string, length, chars) { - string = toString(string); - length = toInteger(length); - - var strLength = length ? stringSize(string) : 0; - if (!length || strLength >= length) { - return string; - } - var mid = (length - strLength) / 2; - return ( - createPadding(nativeFloor(mid), chars) + - string + - createPadding(nativeCeil(mid), chars) - ); - } - - /** - * Pads `string` on the right side if it's shorter than `length`. Padding - * characters are truncated if they exceed `length`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category String - * @param {string} [string=''] The string to pad. - * @param {number} [length=0] The padding length. - * @param {string} [chars=' '] The string used as padding. - * @returns {string} Returns the padded string. - * @example - * - * _.padEnd('abc', 6); - * // => 'abc ' - * - * _.padEnd('abc', 6, '_-'); - * // => 'abc_-_' - * - * _.padEnd('abc', 3); - * // => 'abc' - */ - function padEnd(string, length, chars) { - string = toString(string); - length = toInteger(length); - - var strLength = length ? stringSize(string) : 0; - return (length && strLength < length) - ? (string + createPadding(length - strLength, chars)) - : string; - } - - /** - * Pads `string` on the left side if it's shorter than `length`. Padding - * characters are truncated if they exceed `length`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category String - * @param {string} [string=''] The string to pad. - * @param {number} [length=0] The padding length. - * @param {string} [chars=' '] The string used as padding. - * @returns {string} Returns the padded string. - * @example - * - * _.padStart('abc', 6); - * // => ' abc' - * - * _.padStart('abc', 6, '_-'); - * // => '_-_abc' - * - * _.padStart('abc', 3); - * // => 'abc' - */ - function padStart(string, length, chars) { - string = toString(string); - length = toInteger(length); - - var strLength = length ? stringSize(string) : 0; - return (length && strLength < length) - ? (createPadding(length - strLength, chars) + string) - : string; - } - - /** - * Converts `string` to an integer of the specified radix. If `radix` is - * `undefined` or `0`, a `radix` of `10` is used unless `value` is a - * hexadecimal, in which case a `radix` of `16` is used. - * - * **Note:** This method aligns with the - * [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`. - * - * @static - * @memberOf _ - * @since 1.1.0 - * @category String - * @param {string} string The string to convert. - * @param {number} [radix=10] The radix to interpret `value` by. - * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. - * @returns {number} Returns the converted integer. - * @example - * - * _.parseInt('08'); - * // => 8 - * - * _.map(['6', '08', '10'], _.parseInt); - * // => [6, 8, 10] - */ - function parseInt(string, radix, guard) { - if (guard || radix == null) { - radix = 0; - } else if (radix) { - radix = +radix; - } - return nativeParseInt(toString(string).replace(reTrimStart, ''), radix || 0); - } - - /** - * Repeats the given string `n` times. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category String - * @param {string} [string=''] The string to repeat. - * @param {number} [n=1] The number of times to repeat the string. - * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. - * @returns {string} Returns the repeated string. - * @example - * - * _.repeat('*', 3); - * // => '***' - * - * _.repeat('abc', 2); - * // => 'abcabc' - * - * _.repeat('abc', 0); - * // => '' - */ - function repeat(string, n, guard) { - if ((guard ? isIterateeCall(string, n, guard) : n === undefined)) { - n = 1; - } else { - n = toInteger(n); - } - return baseRepeat(toString(string), n); - } - - /** - * Replaces matches for `pattern` in `string` with `replacement`. - * - * **Note:** This method is based on - * [`String#replace`](https://mdn.io/String/replace). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category String - * @param {string} [string=''] The string to modify. - * @param {RegExp|string} pattern The pattern to replace. - * @param {Function|string} replacement The match replacement. - * @returns {string} Returns the modified string. - * @example - * - * _.replace('Hi Fred', 'Fred', 'Barney'); - * // => 'Hi Barney' - */ - function replace() { - var args = arguments, - string = toString(args[0]); - - return args.length < 3 ? string : string.replace(args[1], args[2]); - } - - /** - * Converts `string` to - * [snake case](https://en.wikipedia.org/wiki/Snake_case). - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category String - * @param {string} [string=''] The string to convert. - * @returns {string} Returns the snake cased string. - * @example - * - * _.snakeCase('Foo Bar'); - * // => 'foo_bar' - * - * _.snakeCase('fooBar'); - * // => 'foo_bar' - * - * _.snakeCase('--FOO-BAR--'); - * // => 'foo_bar' - */ - var snakeCase = createCompounder(function(result, word, index) { - return result + (index ? '_' : '') + word.toLowerCase(); - }); - - /** - * Splits `string` by `separator`. - * - * **Note:** This method is based on - * [`String#split`](https://mdn.io/String/split). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category String - * @param {string} [string=''] The string to split. - * @param {RegExp|string} separator The separator pattern to split by. - * @param {number} [limit] The length to truncate results to. - * @returns {Array} Returns the string segments. - * @example - * - * _.split('a-b-c', '-', 2); - * // => ['a', 'b'] - */ - function split(string, separator, limit) { - if (limit && typeof limit != 'number' && isIterateeCall(string, separator, limit)) { - separator = limit = undefined; - } - limit = limit === undefined ? MAX_ARRAY_LENGTH : limit >>> 0; - if (!limit) { - return []; - } - string = toString(string); - if (string && ( - typeof separator == 'string' || - (separator != null && !isRegExp(separator)) - )) { - separator = baseToString(separator); - if (!separator && hasUnicode(string)) { - return castSlice(stringToArray(string), 0, limit); - } - } - return string.split(separator, limit); - } - - /** - * Converts `string` to - * [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage). - * - * @static - * @memberOf _ - * @since 3.1.0 - * @category String - * @param {string} [string=''] The string to convert. - * @returns {string} Returns the start cased string. - * @example - * - * _.startCase('--foo-bar--'); - * // => 'Foo Bar' - * - * _.startCase('fooBar'); - * // => 'Foo Bar' - * - * _.startCase('__FOO_BAR__'); - * // => 'FOO BAR' - */ - var startCase = createCompounder(function(result, word, index) { - return result + (index ? ' ' : '') + upperFirst(word); - }); - - /** - * Checks if `string` starts with the given target string. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category String - * @param {string} [string=''] The string to inspect. - * @param {string} [target] The string to search for. - * @param {number} [position=0] The position to search from. - * @returns {boolean} Returns `true` if `string` starts with `target`, - * else `false`. - * @example - * - * _.startsWith('abc', 'a'); - * // => true - * - * _.startsWith('abc', 'b'); - * // => false - * - * _.startsWith('abc', 'b', 1); - * // => true - */ - function startsWith(string, target, position) { - string = toString(string); - position = position == null - ? 0 - : baseClamp(toInteger(position), 0, string.length); - - target = baseToString(target); - return string.slice(position, position + target.length) == target; - } - - /** - * Creates a compiled template function that can interpolate data properties - * in "interpolate" delimiters, HTML-escape interpolated data properties in - * "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data - * properties may be accessed as free variables in the template. If a setting - * object is given, it takes precedence over `_.templateSettings` values. - * - * **Note:** In the development build `_.template` utilizes - * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl) - * for easier debugging. - * - * For more information on precompiling templates see - * [lodash's custom builds documentation](https://lodash.com/custom-builds). - * - * For more information on Chrome extension sandboxes see - * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval). - * - * @static - * @since 0.1.0 - * @memberOf _ - * @category String - * @param {string} [string=''] The template string. - * @param {Object} [options={}] The options object. - * @param {RegExp} [options.escape=_.templateSettings.escape] - * The HTML "escape" delimiter. - * @param {RegExp} [options.evaluate=_.templateSettings.evaluate] - * The "evaluate" delimiter. - * @param {Object} [options.imports=_.templateSettings.imports] - * An object to import into the template as free variables. - * @param {RegExp} [options.interpolate=_.templateSettings.interpolate] - * The "interpolate" delimiter. - * @param {string} [options.sourceURL='lodash.templateSources[n]'] - * The sourceURL of the compiled template. - * @param {string} [options.variable='obj'] - * The data object variable name. - * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. - * @returns {Function} Returns the compiled template function. - * @example - * - * // Use the "interpolate" delimiter to create a compiled template. - * var compiled = _.template('hello <%= user %>!'); - * compiled({ 'user': 'fred' }); - * // => 'hello fred!' - * - * // Use the HTML "escape" delimiter to escape data property values. - * var compiled = _.template('<%- value %>'); - * compiled({ 'value': ' - - - -``` - -## License - -Copyright (c) 2011-2022, Christopher Jeffrey. (MIT License) diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/marked/bin/marked.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/marked/bin/marked.js deleted file mode 100755 index 50312462..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/marked/bin/marked.js +++ /dev/null @@ -1,217 +0,0 @@ -#!/usr/bin/env node - -/** - * Marked CLI - * Copyright (c) 2011-2013, Christopher Jeffrey (MIT License) - */ - -import { promises } from 'fs'; -import { marked } from '../lib/marked.esm.js'; - -const { readFile, writeFile } = promises; - -/** - * Man Page - */ - -async function help() { - const { spawn } = await import('child_process'); - - const options = { - cwd: process.cwd(), - env: process.env, - setsid: false, - stdio: 'inherit' - }; - - const { dirname, resolve } = await import('path'); - const { fileURLToPath } = await import('url'); - const __dirname = dirname(fileURLToPath(import.meta.url)); - const helpText = await readFile(resolve(__dirname, '../man/marked.1.txt'), 'utf8'); - - // eslint-disable-next-line promise/param-names - await new Promise(res => { - spawn('man', [resolve(__dirname, '../man/marked.1')], options) - .on('error', () => { - console.log(helpText); - }) - .on('close', res); - }); -} - -async function version() { - const { createRequire } = await import('module'); - const require = createRequire(import.meta.url); - const pkg = require('../package.json'); - console.log(pkg.version); -} - -/** - * Main - */ - -async function main(argv) { - const files = []; - const options = {}; - let input; - let output; - let string; - let arg; - let tokens; - let opt; - - function getarg() { - let arg = argv.shift(); - - if (arg.indexOf('--') === 0) { - // e.g. --opt - arg = arg.split('='); - if (arg.length > 1) { - // e.g. --opt=val - argv.unshift(arg.slice(1).join('=')); - } - arg = arg[0]; - } else if (arg[0] === '-') { - if (arg.length > 2) { - // e.g. -abc - argv = arg.substring(1).split('').map(function(ch) { - return '-' + ch; - }).concat(argv); - arg = argv.shift(); - } else { - // e.g. -a - } - } else { - // e.g. foo - } - - return arg; - } - - while (argv.length) { - arg = getarg(); - switch (arg) { - case '-o': - case '--output': - output = argv.shift(); - break; - case '-i': - case '--input': - input = argv.shift(); - break; - case '-s': - case '--string': - string = argv.shift(); - break; - case '-t': - case '--tokens': - tokens = true; - break; - case '-h': - case '--help': - return await help(); - case '-v': - case '--version': - return await version(); - default: - if (arg.indexOf('--') === 0) { - opt = camelize(arg.replace(/^--(no-)?/, '')); - if (!marked.defaults.hasOwnProperty(opt)) { - continue; - } - if (arg.indexOf('--no-') === 0) { - options[opt] = typeof marked.defaults[opt] !== 'boolean' - ? null - : false; - } else { - options[opt] = typeof marked.defaults[opt] !== 'boolean' - ? argv.shift() - : true; - } - } else { - files.push(arg); - } - break; - } - } - - async function getData() { - if (!input) { - if (files.length <= 2) { - if (string) { - return string; - } - return await getStdin(); - } - input = files.pop(); - } - return await readFile(input, 'utf8'); - } - - const data = await getData(); - - const html = tokens - ? JSON.stringify(marked.lexer(data, options), null, 2) - : marked(data, options); - - if (output) { - return await writeFile(output, html); - } - - process.stdout.write(html + '\n'); -} - -/** - * Helpers - */ - -function getStdin() { - return new Promise((resolve, reject) => { - const stdin = process.stdin; - let buff = ''; - - stdin.setEncoding('utf8'); - - stdin.on('data', function(data) { - buff += data; - }); - - stdin.on('error', function(err) { - reject(err); - }); - - stdin.on('end', function() { - resolve(buff); - }); - - stdin.resume(); - }); -} - -/** - * @param {string} text - */ -function camelize(text) { - return text.replace(/(\w)-(\w)/g, function(_, a, b) { - return a + b.toUpperCase(); - }); -} - -function handleError(err) { - if (err.code === 'ENOENT') { - console.error('marked: output to ' + err.path + ': No such directory'); - return process.exit(1); - } - throw err; -} - -/** - * Expose / Entry Point - */ - -process.title = 'marked'; -main(process.argv.slice()).then(code => { - process.exit(code || 0); -}).catch(err => { - handleError(err); -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/marked/lib/marked.cjs b/packages/wyatt_notification_bloc/example/scripts/node_modules/marked/lib/marked.cjs deleted file mode 100644 index d8b76f54..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/marked/lib/marked.cjs +++ /dev/null @@ -1,2692 +0,0 @@ -/** - * marked - a markdown parser - * Copyright (c) 2011-2022, Christopher Jeffrey. (MIT Licensed) - * https://github.com/markedjs/marked - */ - -/** - * DO NOT EDIT THIS FILE - * The code in this file is generated from files in ./src/ - */ - -'use strict'; - -function _defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } -} -function _createClass(Constructor, protoProps, staticProps) { - if (protoProps) _defineProperties(Constructor.prototype, protoProps); - if (staticProps) _defineProperties(Constructor, staticProps); - Object.defineProperty(Constructor, "prototype", { - writable: false - }); - return Constructor; -} -function _unsupportedIterableToArray(o, minLen) { - if (!o) return; - if (typeof o === "string") return _arrayLikeToArray(o, minLen); - var n = Object.prototype.toString.call(o).slice(8, -1); - if (n === "Object" && o.constructor) n = o.constructor.name; - if (n === "Map" || n === "Set") return Array.from(o); - if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); -} -function _arrayLikeToArray(arr, len) { - if (len == null || len > arr.length) len = arr.length; - for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; - return arr2; -} -function _createForOfIteratorHelperLoose(o, allowArrayLike) { - var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; - if (it) return (it = it.call(o)).next.bind(it); - if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { - if (it) o = it; - var i = 0; - return function () { - if (i >= o.length) return { - done: true - }; - return { - done: false, - value: o[i++] - }; - }; - } - throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); -} - -function getDefaults() { - return { - async: false, - baseUrl: null, - breaks: false, - extensions: null, - gfm: true, - headerIds: true, - headerPrefix: '', - highlight: null, - langPrefix: 'language-', - mangle: true, - pedantic: false, - renderer: null, - sanitize: false, - sanitizer: null, - silent: false, - smartypants: false, - tokenizer: null, - walkTokens: null, - xhtml: false - }; -} -exports.defaults = getDefaults(); -function changeDefaults(newDefaults) { - exports.defaults = newDefaults; -} - -/** - * Helpers - */ -var escapeTest = /[&<>"']/; -var escapeReplace = new RegExp(escapeTest.source, 'g'); -var escapeTestNoEncode = /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/; -var escapeReplaceNoEncode = new RegExp(escapeTestNoEncode.source, 'g'); -var escapeReplacements = { - '&': '&', - '<': '<', - '>': '>', - '"': '"', - "'": ''' -}; -var getEscapeReplacement = function getEscapeReplacement(ch) { - return escapeReplacements[ch]; -}; -function escape(html, encode) { - if (encode) { - if (escapeTest.test(html)) { - return html.replace(escapeReplace, getEscapeReplacement); - } - } else { - if (escapeTestNoEncode.test(html)) { - return html.replace(escapeReplaceNoEncode, getEscapeReplacement); - } - } - return html; -} -var unescapeTest = /&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig; - -/** - * @param {string} html - */ -function unescape(html) { - // explicitly match decimal, hex, and named HTML entities - return html.replace(unescapeTest, function (_, n) { - n = n.toLowerCase(); - if (n === 'colon') return ':'; - if (n.charAt(0) === '#') { - return n.charAt(1) === 'x' ? String.fromCharCode(parseInt(n.substring(2), 16)) : String.fromCharCode(+n.substring(1)); - } - return ''; - }); -} -var caret = /(^|[^\[])\^/g; - -/** - * @param {string | RegExp} regex - * @param {string} opt - */ -function edit(regex, opt) { - regex = typeof regex === 'string' ? regex : regex.source; - opt = opt || ''; - var obj = { - replace: function replace(name, val) { - val = val.source || val; - val = val.replace(caret, '$1'); - regex = regex.replace(name, val); - return obj; - }, - getRegex: function getRegex() { - return new RegExp(regex, opt); - } - }; - return obj; -} -var nonWordAndColonTest = /[^\w:]/g; -var originIndependentUrl = /^$|^[a-z][a-z0-9+.-]*:|^[?#]/i; - -/** - * @param {boolean} sanitize - * @param {string} base - * @param {string} href - */ -function cleanUrl(sanitize, base, href) { - if (sanitize) { - var prot; - try { - prot = decodeURIComponent(unescape(href)).replace(nonWordAndColonTest, '').toLowerCase(); - } catch (e) { - return null; - } - if (prot.indexOf('javascript:') === 0 || prot.indexOf('vbscript:') === 0 || prot.indexOf('data:') === 0) { - return null; - } - } - if (base && !originIndependentUrl.test(href)) { - href = resolveUrl(base, href); - } - try { - href = encodeURI(href).replace(/%25/g, '%'); - } catch (e) { - return null; - } - return href; -} -var baseUrls = {}; -var justDomain = /^[^:]+:\/*[^/]*$/; -var protocol = /^([^:]+:)[\s\S]*$/; -var domain = /^([^:]+:\/*[^/]*)[\s\S]*$/; - -/** - * @param {string} base - * @param {string} href - */ -function resolveUrl(base, href) { - if (!baseUrls[' ' + base]) { - // we can ignore everything in base after the last slash of its path component, - // but we might need to add _that_ - // https://tools.ietf.org/html/rfc3986#section-3 - if (justDomain.test(base)) { - baseUrls[' ' + base] = base + '/'; - } else { - baseUrls[' ' + base] = rtrim(base, '/', true); - } - } - base = baseUrls[' ' + base]; - var relativeBase = base.indexOf(':') === -1; - if (href.substring(0, 2) === '//') { - if (relativeBase) { - return href; - } - return base.replace(protocol, '$1') + href; - } else if (href.charAt(0) === '/') { - if (relativeBase) { - return href; - } - return base.replace(domain, '$1') + href; - } else { - return base + href; - } -} -var noopTest = { - exec: function noopTest() {} -}; -function merge(obj) { - var i = 1, - target, - key; - for (; i < arguments.length; i++) { - target = arguments[i]; - for (key in target) { - if (Object.prototype.hasOwnProperty.call(target, key)) { - obj[key] = target[key]; - } - } - } - return obj; -} -function splitCells(tableRow, count) { - // ensure that every cell-delimiting pipe has a space - // before it to distinguish it from an escaped pipe - var row = tableRow.replace(/\|/g, function (match, offset, str) { - var escaped = false, - curr = offset; - while (--curr >= 0 && str[curr] === '\\') { - escaped = !escaped; - } - if (escaped) { - // odd number of slashes means | is escaped - // so we leave it alone - return '|'; - } else { - // add space before unescaped | - return ' |'; - } - }), - cells = row.split(/ \|/); - var i = 0; - - // First/last cell in a row cannot be empty if it has no leading/trailing pipe - if (!cells[0].trim()) { - cells.shift(); - } - if (cells.length > 0 && !cells[cells.length - 1].trim()) { - cells.pop(); - } - if (cells.length > count) { - cells.splice(count); - } else { - while (cells.length < count) { - cells.push(''); - } - } - for (; i < cells.length; i++) { - // leading or trailing whitespace is ignored per the gfm spec - cells[i] = cells[i].trim().replace(/\\\|/g, '|'); - } - return cells; -} - -/** - * Remove trailing 'c's. Equivalent to str.replace(/c*$/, ''). - * /c*$/ is vulnerable to REDOS. - * - * @param {string} str - * @param {string} c - * @param {boolean} invert Remove suffix of non-c chars instead. Default falsey. - */ -function rtrim(str, c, invert) { - var l = str.length; - if (l === 0) { - return ''; - } - - // Length of suffix matching the invert condition. - var suffLen = 0; - - // Step left until we fail to match the invert condition. - while (suffLen < l) { - var currChar = str.charAt(l - suffLen - 1); - if (currChar === c && !invert) { - suffLen++; - } else if (currChar !== c && invert) { - suffLen++; - } else { - break; - } - } - return str.slice(0, l - suffLen); -} -function findClosingBracket(str, b) { - if (str.indexOf(b[1]) === -1) { - return -1; - } - var l = str.length; - var level = 0, - i = 0; - for (; i < l; i++) { - if (str[i] === '\\') { - i++; - } else if (str[i] === b[0]) { - level++; - } else if (str[i] === b[1]) { - level--; - if (level < 0) { - return i; - } - } - } - return -1; -} -function checkSanitizeDeprecation(opt) { - if (opt && opt.sanitize && !opt.silent) { - console.warn('marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options'); - } -} - -// copied from https://stackoverflow.com/a/5450113/806777 -/** - * @param {string} pattern - * @param {number} count - */ -function repeatString(pattern, count) { - if (count < 1) { - return ''; - } - var result = ''; - while (count > 1) { - if (count & 1) { - result += pattern; - } - count >>= 1; - pattern += pattern; - } - return result + pattern; -} - -function outputLink(cap, link, raw, lexer) { - var href = link.href; - var title = link.title ? escape(link.title) : null; - var text = cap[1].replace(/\\([\[\]])/g, '$1'); - if (cap[0].charAt(0) !== '!') { - lexer.state.inLink = true; - var token = { - type: 'link', - raw: raw, - href: href, - title: title, - text: text, - tokens: lexer.inlineTokens(text) - }; - lexer.state.inLink = false; - return token; - } - return { - type: 'image', - raw: raw, - href: href, - title: title, - text: escape(text) - }; -} -function indentCodeCompensation(raw, text) { - var matchIndentToCode = raw.match(/^(\s+)(?:```)/); - if (matchIndentToCode === null) { - return text; - } - var indentToCode = matchIndentToCode[1]; - return text.split('\n').map(function (node) { - var matchIndentInNode = node.match(/^\s+/); - if (matchIndentInNode === null) { - return node; - } - var indentInNode = matchIndentInNode[0]; - if (indentInNode.length >= indentToCode.length) { - return node.slice(indentToCode.length); - } - return node; - }).join('\n'); -} - -/** - * Tokenizer - */ -var Tokenizer = /*#__PURE__*/function () { - function Tokenizer(options) { - this.options = options || exports.defaults; - } - var _proto = Tokenizer.prototype; - _proto.space = function space(src) { - var cap = this.rules.block.newline.exec(src); - if (cap && cap[0].length > 0) { - return { - type: 'space', - raw: cap[0] - }; - } - }; - _proto.code = function code(src) { - var cap = this.rules.block.code.exec(src); - if (cap) { - var text = cap[0].replace(/^ {1,4}/gm, ''); - return { - type: 'code', - raw: cap[0], - codeBlockStyle: 'indented', - text: !this.options.pedantic ? rtrim(text, '\n') : text - }; - } - }; - _proto.fences = function fences(src) { - var cap = this.rules.block.fences.exec(src); - if (cap) { - var raw = cap[0]; - var text = indentCodeCompensation(raw, cap[3] || ''); - return { - type: 'code', - raw: raw, - lang: cap[2] ? cap[2].trim().replace(this.rules.inline._escapes, '$1') : cap[2], - text: text - }; - } - }; - _proto.heading = function heading(src) { - var cap = this.rules.block.heading.exec(src); - if (cap) { - var text = cap[2].trim(); - - // remove trailing #s - if (/#$/.test(text)) { - var trimmed = rtrim(text, '#'); - if (this.options.pedantic) { - text = trimmed.trim(); - } else if (!trimmed || / $/.test(trimmed)) { - // CommonMark requires space before trailing #s - text = trimmed.trim(); - } - } - return { - type: 'heading', - raw: cap[0], - depth: cap[1].length, - text: text, - tokens: this.lexer.inline(text) - }; - } - }; - _proto.hr = function hr(src) { - var cap = this.rules.block.hr.exec(src); - if (cap) { - return { - type: 'hr', - raw: cap[0] - }; - } - }; - _proto.blockquote = function blockquote(src) { - var cap = this.rules.block.blockquote.exec(src); - if (cap) { - var text = cap[0].replace(/^ *>[ \t]?/gm, ''); - return { - type: 'blockquote', - raw: cap[0], - tokens: this.lexer.blockTokens(text, []), - text: text - }; - } - }; - _proto.list = function list(src) { - var cap = this.rules.block.list.exec(src); - if (cap) { - var raw, istask, ischecked, indent, i, blankLine, endsWithBlankLine, line, nextLine, rawLine, itemContents, endEarly; - var bull = cap[1].trim(); - var isordered = bull.length > 1; - var list = { - type: 'list', - raw: '', - ordered: isordered, - start: isordered ? +bull.slice(0, -1) : '', - loose: false, - items: [] - }; - bull = isordered ? "\\d{1,9}\\" + bull.slice(-1) : "\\" + bull; - if (this.options.pedantic) { - bull = isordered ? bull : '[*+-]'; - } - - // Get next list item - var itemRegex = new RegExp("^( {0,3}" + bull + ")((?:[\t ][^\\n]*)?(?:\\n|$))"); - - // Check if current bullet point can start a new List Item - while (src) { - endEarly = false; - if (!(cap = itemRegex.exec(src))) { - break; - } - if (this.rules.block.hr.test(src)) { - // End list if bullet was actually HR (possibly move into itemRegex?) - break; - } - raw = cap[0]; - src = src.substring(raw.length); - line = cap[2].split('\n', 1)[0]; - nextLine = src.split('\n', 1)[0]; - if (this.options.pedantic) { - indent = 2; - itemContents = line.trimLeft(); - } else { - indent = cap[2].search(/[^ ]/); // Find first non-space char - indent = indent > 4 ? 1 : indent; // Treat indented code blocks (> 4 spaces) as having only 1 indent - itemContents = line.slice(indent); - indent += cap[1].length; - } - blankLine = false; - if (!line && /^ *$/.test(nextLine)) { - // Items begin with at most one blank line - raw += nextLine + '\n'; - src = src.substring(nextLine.length + 1); - endEarly = true; - } - if (!endEarly) { - var nextBulletRegex = new RegExp("^ {0," + Math.min(3, indent - 1) + "}(?:[*+-]|\\d{1,9}[.)])((?: [^\\n]*)?(?:\\n|$))"); - var hrRegex = new RegExp("^ {0," + Math.min(3, indent - 1) + "}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)"); - var fencesBeginRegex = new RegExp("^ {0," + Math.min(3, indent - 1) + "}(?:```|~~~)"); - var headingBeginRegex = new RegExp("^ {0," + Math.min(3, indent - 1) + "}#"); - - // Check if following lines should be included in List Item - while (src) { - rawLine = src.split('\n', 1)[0]; - line = rawLine; - - // Re-align to follow commonmark nesting rules - if (this.options.pedantic) { - line = line.replace(/^ {1,4}(?=( {4})*[^ ])/g, ' '); - } - - // End list item if found code fences - if (fencesBeginRegex.test(line)) { - break; - } - - // End list item if found start of new heading - if (headingBeginRegex.test(line)) { - break; - } - - // End list item if found start of new bullet - if (nextBulletRegex.test(line)) { - break; - } - - // Horizontal rule found - if (hrRegex.test(src)) { - break; - } - if (line.search(/[^ ]/) >= indent || !line.trim()) { - // Dedent if possible - itemContents += '\n' + line.slice(indent); - } else if (!blankLine) { - // Until blank line, item doesn't need indentation - itemContents += '\n' + line; - } else { - // Otherwise, improper indentation ends this item - break; - } - if (!blankLine && !line.trim()) { - // Check if current line is blank - blankLine = true; - } - raw += rawLine + '\n'; - src = src.substring(rawLine.length + 1); - } - } - if (!list.loose) { - // If the previous item ended with a blank line, the list is loose - if (endsWithBlankLine) { - list.loose = true; - } else if (/\n *\n *$/.test(raw)) { - endsWithBlankLine = true; - } - } - - // Check for task list items - if (this.options.gfm) { - istask = /^\[[ xX]\] /.exec(itemContents); - if (istask) { - ischecked = istask[0] !== '[ ] '; - itemContents = itemContents.replace(/^\[[ xX]\] +/, ''); - } - } - list.items.push({ - type: 'list_item', - raw: raw, - task: !!istask, - checked: ischecked, - loose: false, - text: itemContents - }); - list.raw += raw; - } - - // Do not consume newlines at end of final item. Alternatively, make itemRegex *start* with any newlines to simplify/speed up endsWithBlankLine logic - list.items[list.items.length - 1].raw = raw.trimRight(); - list.items[list.items.length - 1].text = itemContents.trimRight(); - list.raw = list.raw.trimRight(); - var l = list.items.length; - - // Item child tokens handled here at end because we needed to have the final item to trim it first - for (i = 0; i < l; i++) { - this.lexer.state.top = false; - list.items[i].tokens = this.lexer.blockTokens(list.items[i].text, []); - var spacers = list.items[i].tokens.filter(function (t) { - return t.type === 'space'; - }); - var hasMultipleLineBreaks = spacers.every(function (t) { - var chars = t.raw.split(''); - var lineBreaks = 0; - for (var _iterator = _createForOfIteratorHelperLoose(chars), _step; !(_step = _iterator()).done;) { - var _char = _step.value; - if (_char === '\n') { - lineBreaks += 1; - } - if (lineBreaks > 1) { - return true; - } - } - return false; - }); - if (!list.loose && spacers.length && hasMultipleLineBreaks) { - // Having a single line break doesn't mean a list is loose. A single line break is terminating the last list item - list.loose = true; - list.items[i].loose = true; - } - } - return list; - } - }; - _proto.html = function html(src) { - var cap = this.rules.block.html.exec(src); - if (cap) { - var token = { - type: 'html', - raw: cap[0], - pre: !this.options.sanitizer && (cap[1] === 'pre' || cap[1] === 'script' || cap[1] === 'style'), - text: cap[0] - }; - if (this.options.sanitize) { - var text = this.options.sanitizer ? this.options.sanitizer(cap[0]) : escape(cap[0]); - token.type = 'paragraph'; - token.text = text; - token.tokens = this.lexer.inline(text); - } - return token; - } - }; - _proto.def = function def(src) { - var cap = this.rules.block.def.exec(src); - if (cap) { - var tag = cap[1].toLowerCase().replace(/\s+/g, ' '); - var href = cap[2] ? cap[2].replace(/^<(.*)>$/, '$1').replace(this.rules.inline._escapes, '$1') : ''; - var title = cap[3] ? cap[3].substring(1, cap[3].length - 1).replace(this.rules.inline._escapes, '$1') : cap[3]; - return { - type: 'def', - tag: tag, - raw: cap[0], - href: href, - title: title - }; - } - }; - _proto.table = function table(src) { - var cap = this.rules.block.table.exec(src); - if (cap) { - var item = { - type: 'table', - header: splitCells(cap[1]).map(function (c) { - return { - text: c - }; - }), - align: cap[2].replace(/^ *|\| *$/g, '').split(/ *\| */), - rows: cap[3] && cap[3].trim() ? cap[3].replace(/\n[ \t]*$/, '').split('\n') : [] - }; - if (item.header.length === item.align.length) { - item.raw = cap[0]; - var l = item.align.length; - var i, j, k, row; - for (i = 0; i < l; i++) { - if (/^ *-+: *$/.test(item.align[i])) { - item.align[i] = 'right'; - } else if (/^ *:-+: *$/.test(item.align[i])) { - item.align[i] = 'center'; - } else if (/^ *:-+ *$/.test(item.align[i])) { - item.align[i] = 'left'; - } else { - item.align[i] = null; - } - } - l = item.rows.length; - for (i = 0; i < l; i++) { - item.rows[i] = splitCells(item.rows[i], item.header.length).map(function (c) { - return { - text: c - }; - }); - } - - // parse child tokens inside headers and cells - - // header child tokens - l = item.header.length; - for (j = 0; j < l; j++) { - item.header[j].tokens = this.lexer.inline(item.header[j].text); - } - - // cell child tokens - l = item.rows.length; - for (j = 0; j < l; j++) { - row = item.rows[j]; - for (k = 0; k < row.length; k++) { - row[k].tokens = this.lexer.inline(row[k].text); - } - } - return item; - } - } - }; - _proto.lheading = function lheading(src) { - var cap = this.rules.block.lheading.exec(src); - if (cap) { - return { - type: 'heading', - raw: cap[0], - depth: cap[2].charAt(0) === '=' ? 1 : 2, - text: cap[1], - tokens: this.lexer.inline(cap[1]) - }; - } - }; - _proto.paragraph = function paragraph(src) { - var cap = this.rules.block.paragraph.exec(src); - if (cap) { - var text = cap[1].charAt(cap[1].length - 1) === '\n' ? cap[1].slice(0, -1) : cap[1]; - return { - type: 'paragraph', - raw: cap[0], - text: text, - tokens: this.lexer.inline(text) - }; - } - }; - _proto.text = function text(src) { - var cap = this.rules.block.text.exec(src); - if (cap) { - return { - type: 'text', - raw: cap[0], - text: cap[0], - tokens: this.lexer.inline(cap[0]) - }; - } - }; - _proto.escape = function escape$1(src) { - var cap = this.rules.inline.escape.exec(src); - if (cap) { - return { - type: 'escape', - raw: cap[0], - text: escape(cap[1]) - }; - } - }; - _proto.tag = function tag(src) { - var cap = this.rules.inline.tag.exec(src); - if (cap) { - if (!this.lexer.state.inLink && /^
/i.test(cap[0])) { - this.lexer.state.inLink = false; - } - if (!this.lexer.state.inRawBlock && /^<(pre|code|kbd|script)(\s|>)/i.test(cap[0])) { - this.lexer.state.inRawBlock = true; - } else if (this.lexer.state.inRawBlock && /^<\/(pre|code|kbd|script)(\s|>)/i.test(cap[0])) { - this.lexer.state.inRawBlock = false; - } - return { - type: this.options.sanitize ? 'text' : 'html', - raw: cap[0], - inLink: this.lexer.state.inLink, - inRawBlock: this.lexer.state.inRawBlock, - text: this.options.sanitize ? this.options.sanitizer ? this.options.sanitizer(cap[0]) : escape(cap[0]) : cap[0] - }; - } - }; - _proto.link = function link(src) { - var cap = this.rules.inline.link.exec(src); - if (cap) { - var trimmedUrl = cap[2].trim(); - if (!this.options.pedantic && /^$/.test(trimmedUrl)) { - return; - } - - // ending angle bracket cannot be escaped - var rtrimSlash = rtrim(trimmedUrl.slice(0, -1), '\\'); - if ((trimmedUrl.length - rtrimSlash.length) % 2 === 0) { - return; - } - } else { - // find closing parenthesis - var lastParenIndex = findClosingBracket(cap[2], '()'); - if (lastParenIndex > -1) { - var start = cap[0].indexOf('!') === 0 ? 5 : 4; - var linkLen = start + cap[1].length + lastParenIndex; - cap[2] = cap[2].substring(0, lastParenIndex); - cap[0] = cap[0].substring(0, linkLen).trim(); - cap[3] = ''; - } - } - var href = cap[2]; - var title = ''; - if (this.options.pedantic) { - // split pedantic href and title - var link = /^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(href); - if (link) { - href = link[1]; - title = link[3]; - } - } else { - title = cap[3] ? cap[3].slice(1, -1) : ''; - } - href = href.trim(); - if (/^$/.test(trimmedUrl)) { - // pedantic allows starting angle bracket without ending angle bracket - href = href.slice(1); - } else { - href = href.slice(1, -1); - } - } - return outputLink(cap, { - href: href ? href.replace(this.rules.inline._escapes, '$1') : href, - title: title ? title.replace(this.rules.inline._escapes, '$1') : title - }, cap[0], this.lexer); - } - }; - _proto.reflink = function reflink(src, links) { - var cap; - if ((cap = this.rules.inline.reflink.exec(src)) || (cap = this.rules.inline.nolink.exec(src))) { - var link = (cap[2] || cap[1]).replace(/\s+/g, ' '); - link = links[link.toLowerCase()]; - if (!link) { - var text = cap[0].charAt(0); - return { - type: 'text', - raw: text, - text: text - }; - } - return outputLink(cap, link, cap[0], this.lexer); - } - }; - _proto.emStrong = function emStrong(src, maskedSrc, prevChar) { - if (prevChar === void 0) { - prevChar = ''; - } - var match = this.rules.inline.emStrong.lDelim.exec(src); - if (!match) return; - - // _ can't be between two alphanumerics. \p{L}\p{N} includes non-english alphabet/numbers as well - if (match[3] && prevChar.match(/(?:[0-9A-Za-z\xAA\xB2\xB3\xB5\xB9\xBA\xBC-\xBE\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u0660-\u0669\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07C0-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0966-\u096F\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09E6-\u09F1\u09F4-\u09F9\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A66-\u0A6F\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AE6-\u0AEF\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B66-\u0B6F\u0B71-\u0B77\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0BE6-\u0BF2\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C66-\u0C6F\u0C78-\u0C7E\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CE6-\u0CEF\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D58-\u0D61\u0D66-\u0D78\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DE6-\u0DEF\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F20-\u0F33\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F-\u1049\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u1090-\u1099\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1369-\u137C\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A16\u1A20-\u1A54\u1A80-\u1A89\u1A90-\u1A99\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B50-\u1B59\u1B83-\u1BA0\u1BAE-\u1BE5\u1C00-\u1C23\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2070\u2071\u2074-\u2079\u207F-\u2089\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2150-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2CFD\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u3192-\u3195\u31A0-\u31BF\u31F0-\u31FF\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA830-\uA835\uA840-\uA873\uA882-\uA8B3\uA8D0-\uA8D9\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA900-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF-\uA9D9\uA9E0-\uA9E4\uA9E6-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA50-\uAA59\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDD8B\uDE80-\uDE9C\uDEA0-\uDED0\uDEE1-\uDEFB\uDF00-\uDF23\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC58-\uDC76\uDC79-\uDC9E\uDCA7-\uDCAF\uDCE0-\uDCF2\uDCF4\uDCF5\uDCFB-\uDD1B\uDD20-\uDD39\uDD80-\uDDB7\uDDBC-\uDDCF\uDDD2-\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE40-\uDE48\uDE60-\uDE7E\uDE80-\uDE9F\uDEC0-\uDEC7\uDEC9-\uDEE4\uDEEB-\uDEEF\uDF00-\uDF35\uDF40-\uDF55\uDF58-\uDF72\uDF78-\uDF91\uDFA9-\uDFAF]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDCFA-\uDD23\uDD30-\uDD39\uDE60-\uDE7E\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF27\uDF30-\uDF45\uDF51-\uDF54\uDF70-\uDF81\uDFB0-\uDFCB\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC52-\uDC6F\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD03-\uDD26\uDD36-\uDD3F\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDD0-\uDDDA\uDDDC\uDDE1-\uDDF4\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDEF0-\uDEF9\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC50-\uDC59\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE50-\uDE59\uDE80-\uDEAA\uDEB8\uDEC0-\uDEC9\uDF00-\uDF1A\uDF30-\uDF3B\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCF2\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDD50-\uDD59\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC50-\uDC6C\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD50-\uDD59\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDDA0-\uDDA9\uDEE0-\uDEF2\uDFB0\uDFC0-\uDFD4]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDE70-\uDEBE\uDEC0-\uDEC9\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF50-\uDF59\uDF5B-\uDF61\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE96\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD834[\uDEE0-\uDEF3\uDF60-\uDF78]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD837[\uDF00-\uDF1E]|\uD838[\uDD00-\uDD2C\uDD37-\uDD3D\uDD40-\uDD49\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB\uDEF0-\uDEF9]|\uD839[\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDCC7-\uDCCF\uDD00-\uDD43\uDD4B\uDD50-\uDD59]|\uD83B[\uDC71-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDCB4\uDD01-\uDD2D\uDD2F-\uDD3D\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD83C[\uDD00-\uDD0C]|\uD83E[\uDFF0-\uDFF9]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF38\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A])/)) return; - var nextChar = match[1] || match[2] || ''; - if (!nextChar || nextChar && (prevChar === '' || this.rules.inline.punctuation.exec(prevChar))) { - var lLength = match[0].length - 1; - var rDelim, - rLength, - delimTotal = lLength, - midDelimTotal = 0; - var endReg = match[0][0] === '*' ? this.rules.inline.emStrong.rDelimAst : this.rules.inline.emStrong.rDelimUnd; - endReg.lastIndex = 0; - - // Clip maskedSrc to same section of string as src (move to lexer?) - maskedSrc = maskedSrc.slice(-1 * src.length + lLength); - while ((match = endReg.exec(maskedSrc)) != null) { - rDelim = match[1] || match[2] || match[3] || match[4] || match[5] || match[6]; - if (!rDelim) continue; // skip single * in __abc*abc__ - - rLength = rDelim.length; - if (match[3] || match[4]) { - // found another Left Delim - delimTotal += rLength; - continue; - } else if (match[5] || match[6]) { - // either Left or Right Delim - if (lLength % 3 && !((lLength + rLength) % 3)) { - midDelimTotal += rLength; - continue; // CommonMark Emphasis Rules 9-10 - } - } - - delimTotal -= rLength; - if (delimTotal > 0) continue; // Haven't found enough closing delimiters - - // Remove extra characters. *a*** -> *a* - rLength = Math.min(rLength, rLength + delimTotal + midDelimTotal); - var raw = src.slice(0, lLength + match.index + (match[0].length - rDelim.length) + rLength); - - // Create `em` if smallest delimiter has odd char count. *a*** - if (Math.min(lLength, rLength) % 2) { - var _text = raw.slice(1, -1); - return { - type: 'em', - raw: raw, - text: _text, - tokens: this.lexer.inlineTokens(_text) - }; - } - - // Create 'strong' if smallest delimiter has even char count. **a*** - var text = raw.slice(2, -2); - return { - type: 'strong', - raw: raw, - text: text, - tokens: this.lexer.inlineTokens(text) - }; - } - } - }; - _proto.codespan = function codespan(src) { - var cap = this.rules.inline.code.exec(src); - if (cap) { - var text = cap[2].replace(/\n/g, ' '); - var hasNonSpaceChars = /[^ ]/.test(text); - var hasSpaceCharsOnBothEnds = /^ /.test(text) && / $/.test(text); - if (hasNonSpaceChars && hasSpaceCharsOnBothEnds) { - text = text.substring(1, text.length - 1); - } - text = escape(text, true); - return { - type: 'codespan', - raw: cap[0], - text: text - }; - } - }; - _proto.br = function br(src) { - var cap = this.rules.inline.br.exec(src); - if (cap) { - return { - type: 'br', - raw: cap[0] - }; - } - }; - _proto.del = function del(src) { - var cap = this.rules.inline.del.exec(src); - if (cap) { - return { - type: 'del', - raw: cap[0], - text: cap[2], - tokens: this.lexer.inlineTokens(cap[2]) - }; - } - }; - _proto.autolink = function autolink(src, mangle) { - var cap = this.rules.inline.autolink.exec(src); - if (cap) { - var text, href; - if (cap[2] === '@') { - text = escape(this.options.mangle ? mangle(cap[1]) : cap[1]); - href = 'mailto:' + text; - } else { - text = escape(cap[1]); - href = text; - } - return { - type: 'link', - raw: cap[0], - text: text, - href: href, - tokens: [{ - type: 'text', - raw: text, - text: text - }] - }; - } - }; - _proto.url = function url(src, mangle) { - var cap; - if (cap = this.rules.inline.url.exec(src)) { - var text, href; - if (cap[2] === '@') { - text = escape(this.options.mangle ? mangle(cap[0]) : cap[0]); - href = 'mailto:' + text; - } else { - // do extended autolink path validation - var prevCapZero; - do { - prevCapZero = cap[0]; - cap[0] = this.rules.inline._backpedal.exec(cap[0])[0]; - } while (prevCapZero !== cap[0]); - text = escape(cap[0]); - if (cap[1] === 'www.') { - href = 'http://' + text; - } else { - href = text; - } - } - return { - type: 'link', - raw: cap[0], - text: text, - href: href, - tokens: [{ - type: 'text', - raw: text, - text: text - }] - }; - } - }; - _proto.inlineText = function inlineText(src, smartypants) { - var cap = this.rules.inline.text.exec(src); - if (cap) { - var text; - if (this.lexer.state.inRawBlock) { - text = this.options.sanitize ? this.options.sanitizer ? this.options.sanitizer(cap[0]) : escape(cap[0]) : cap[0]; - } else { - text = escape(this.options.smartypants ? smartypants(cap[0]) : cap[0]); - } - return { - type: 'text', - raw: cap[0], - text: text - }; - } - }; - return Tokenizer; -}(); - -/** - * Block-Level Grammar - */ -var block = { - newline: /^(?: *(?:\n|$))+/, - code: /^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/, - fences: /^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?=\n|$)|$)/, - hr: /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, - heading: /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, - blockquote: /^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/, - list: /^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/, - html: '^ {0,3}(?:' // optional indentation - + '<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)' // (1) - + '|comment[^\\n]*(\\n+|$)' // (2) - + '|<\\?[\\s\\S]*?(?:\\?>\\n*|$)' // (3) - + '|\\n*|$)' // (4) - + '|\\n*|$)' // (5) - + '|)[\\s\\S]*?(?:(?:\\n *)+\\n|$)' // (6) - + '|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)' // (7) open tag - + '|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)' // (7) closing tag - + ')', - def: /^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/, - table: noopTest, - lheading: /^((?:.|\n(?!\n))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, - // regex template, placeholders will be replaced according to different paragraph - // interruption rules of commonmark and the original markdown spec: - _paragraph: /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, - text: /^[^\n]+/ -}; -block._label = /(?!\s*\])(?:\\.|[^\[\]\\])+/; -block._title = /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/; -block.def = edit(block.def).replace('label', block._label).replace('title', block._title).getRegex(); -block.bullet = /(?:[*+-]|\d{1,9}[.)])/; -block.listItemStart = edit(/^( *)(bull) */).replace('bull', block.bullet).getRegex(); -block.list = edit(block.list).replace(/bull/g, block.bullet).replace('hr', '\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))').replace('def', '\\n+(?=' + block.def.source + ')').getRegex(); -block._tag = 'address|article|aside|base|basefont|blockquote|body|caption' + '|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption' + '|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe' + '|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option' + '|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr' + '|track|ul'; -block._comment = /|$)/; -block.html = edit(block.html, 'i').replace('comment', block._comment).replace('tag', block._tag).replace('attribute', / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(); -block.paragraph = edit(block._paragraph).replace('hr', block.hr).replace('heading', ' {0,3}#{1,6} ').replace('|lheading', '') // setex headings don't interrupt commonmark paragraphs -.replace('|table', '').replace('blockquote', ' {0,3}>').replace('fences', ' {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n').replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt -.replace('html', ')|<(?:script|pre|style|textarea|!--)').replace('tag', block._tag) // pars can be interrupted by type (6) html blocks -.getRegex(); -block.blockquote = edit(block.blockquote).replace('paragraph', block.paragraph).getRegex(); - -/** - * Normal Block Grammar - */ - -block.normal = merge({}, block); - -/** - * GFM Block Grammar - */ - -block.gfm = merge({}, block.normal, { - table: '^ *([^\\n ].*\\|.*)\\n' // Header - + ' {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?' // Align - + '(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)' // Cells -}); - -block.gfm.table = edit(block.gfm.table).replace('hr', block.hr).replace('heading', ' {0,3}#{1,6} ').replace('blockquote', ' {0,3}>').replace('code', ' {4}[^\\n]').replace('fences', ' {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n').replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt -.replace('html', ')|<(?:script|pre|style|textarea|!--)').replace('tag', block._tag) // tables can be interrupted by type (6) html blocks -.getRegex(); -block.gfm.paragraph = edit(block._paragraph).replace('hr', block.hr).replace('heading', ' {0,3}#{1,6} ').replace('|lheading', '') // setex headings don't interrupt commonmark paragraphs -.replace('table', block.gfm.table) // interrupt paragraphs with table -.replace('blockquote', ' {0,3}>').replace('fences', ' {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n').replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt -.replace('html', ')|<(?:script|pre|style|textarea|!--)').replace('tag', block._tag) // pars can be interrupted by type (6) html blocks -.getRegex(); -/** - * Pedantic grammar (original John Gruber's loose markdown specification) - */ - -block.pedantic = merge({}, block.normal, { - html: edit('^ *(?:comment *(?:\\n|\\s*$)' + '|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)' // closed tag - + '|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))').replace('comment', block._comment).replace(/tag/g, '(?!(?:' + 'a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub' + '|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)' + '\\b)\\w+(?!:|[^\\w\\s@]*@)\\b').getRegex(), - def: /^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/, - heading: /^(#{1,6})(.*)(?:\n+|$)/, - fences: noopTest, - // fences not supported - lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/, - paragraph: edit(block.normal._paragraph).replace('hr', block.hr).replace('heading', ' *#{1,6} *[^\n]').replace('lheading', block.lheading).replace('blockquote', ' {0,3}>').replace('|fences', '').replace('|list', '').replace('|html', '').getRegex() -}); - -/** - * Inline-Level Grammar - */ -var inline = { - escape: /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, - autolink: /^<(scheme:[^\s\x00-\x1f<>]*|email)>/, - url: noopTest, - tag: '^comment' + '|^' // self-closing tag - + '|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>' // open tag - + '|^<\\?[\\s\\S]*?\\?>' // processing instruction, e.g. - + '|^' // declaration, e.g. - + '|^', - // CDATA section - link: /^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/, - reflink: /^!?\[(label)\]\[(ref)\]/, - nolink: /^!?\[(ref)\](?:\[\])?/, - reflinkSearch: 'reflink|nolink(?!\\()', - emStrong: { - lDelim: /^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/, - // (1) and (2) can only be a Right Delimiter. (3) and (4) can only be Left. (5) and (6) can be either Left or Right. - // () Skip orphan inside strong () Consume to delim (1) #*** (2) a***#, a*** (3) #***a, ***a (4) ***# (5) #***# (6) a***a - rDelimAst: /^(?:[^_*\\]|\\.)*?\_\_(?:[^_*\\]|\\.)*?\*(?:[^_*\\]|\\.)*?(?=\_\_)|(?:[^*\\]|\\.)+(?=[^*])|[punct_](\*+)(?=[\s]|$)|(?:[^punct*_\s\\]|\\.)(\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|(?:[^punct*_\s\\]|\\.)(\*+)(?=[^punct*_\s])/, - rDelimUnd: /^(?:[^_*\\]|\\.)*?\*\*(?:[^_*\\]|\\.)*?\_(?:[^_*\\]|\\.)*?(?=\*\*)|(?:[^_\\]|\\.)+(?=[^_])|[punct*](\_+)(?=[\s]|$)|(?:[^punct*_\s\\]|\\.)(\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/ // ^- Not allowed for _ - }, - - code: /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, - br: /^( {2,}|\\)\n(?!\s*$)/, - del: noopTest, - text: /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~'; -inline.punctuation = edit(inline.punctuation).replace(/punctuation/g, inline._punctuation).getRegex(); - -// sequences em should skip over [title](link), `code`, -inline.blockSkip = /\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g; -// lookbehind is not available on Safari as of version 16 -// inline.escapedEmSt = /(?<=(?:^|[^\\)(?:\\[^])*)\\[*_]/g; -inline.escapedEmSt = /(?:^|[^\\])(?:\\\\)*\\[*_]/g; -inline._comment = edit(block._comment).replace('(?:-->|$)', '-->').getRegex(); -inline.emStrong.lDelim = edit(inline.emStrong.lDelim).replace(/punct/g, inline._punctuation).getRegex(); -inline.emStrong.rDelimAst = edit(inline.emStrong.rDelimAst, 'g').replace(/punct/g, inline._punctuation).getRegex(); -inline.emStrong.rDelimUnd = edit(inline.emStrong.rDelimUnd, 'g').replace(/punct/g, inline._punctuation).getRegex(); -inline._escapes = /\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g; -inline._scheme = /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/; -inline._email = /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/; -inline.autolink = edit(inline.autolink).replace('scheme', inline._scheme).replace('email', inline._email).getRegex(); -inline._attribute = /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/; -inline.tag = edit(inline.tag).replace('comment', inline._comment).replace('attribute', inline._attribute).getRegex(); -inline._label = /(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/; -inline._href = /<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/; -inline._title = /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/; -inline.link = edit(inline.link).replace('label', inline._label).replace('href', inline._href).replace('title', inline._title).getRegex(); -inline.reflink = edit(inline.reflink).replace('label', inline._label).replace('ref', block._label).getRegex(); -inline.nolink = edit(inline.nolink).replace('ref', block._label).getRegex(); -inline.reflinkSearch = edit(inline.reflinkSearch, 'g').replace('reflink', inline.reflink).replace('nolink', inline.nolink).getRegex(); - -/** - * Normal Inline Grammar - */ - -inline.normal = merge({}, inline); - -/** - * Pedantic Inline Grammar - */ - -inline.pedantic = merge({}, inline.normal, { - strong: { - start: /^__|\*\*/, - middle: /^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/, - endAst: /\*\*(?!\*)/g, - endUnd: /__(?!_)/g - }, - em: { - start: /^_|\*/, - middle: /^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/, - endAst: /\*(?!\*)/g, - endUnd: /_(?!_)/g - }, - link: edit(/^!?\[(label)\]\((.*?)\)/).replace('label', inline._label).getRegex(), - reflink: edit(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace('label', inline._label).getRegex() -}); - -/** - * GFM Inline Grammar - */ - -inline.gfm = merge({}, inline.normal, { - escape: edit(inline.escape).replace('])', '~|])').getRegex(), - _extended_email: /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/, - url: /^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/, - _backpedal: /(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/, - del: /^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/, - text: /^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\ 0.5) { - ch = 'x' + ch.toString(16); - } - out += '&#' + ch + ';'; - } - return out; -} - -/** - * Block Lexer - */ -var Lexer = /*#__PURE__*/function () { - function Lexer(options) { - this.tokens = []; - this.tokens.links = Object.create(null); - this.options = options || exports.defaults; - this.options.tokenizer = this.options.tokenizer || new Tokenizer(); - this.tokenizer = this.options.tokenizer; - this.tokenizer.options = this.options; - this.tokenizer.lexer = this; - this.inlineQueue = []; - this.state = { - inLink: false, - inRawBlock: false, - top: true - }; - var rules = { - block: block.normal, - inline: inline.normal - }; - if (this.options.pedantic) { - rules.block = block.pedantic; - rules.inline = inline.pedantic; - } else if (this.options.gfm) { - rules.block = block.gfm; - if (this.options.breaks) { - rules.inline = inline.breaks; - } else { - rules.inline = inline.gfm; - } - } - this.tokenizer.rules = rules; - } - - /** - * Expose Rules - */ - /** - * Static Lex Method - */ - Lexer.lex = function lex(src, options) { - var lexer = new Lexer(options); - return lexer.lex(src); - } - - /** - * Static Lex Inline Method - */; - Lexer.lexInline = function lexInline(src, options) { - var lexer = new Lexer(options); - return lexer.inlineTokens(src); - } - - /** - * Preprocessing - */; - var _proto = Lexer.prototype; - _proto.lex = function lex(src) { - src = src.replace(/\r\n|\r/g, '\n'); - this.blockTokens(src, this.tokens); - var next; - while (next = this.inlineQueue.shift()) { - this.inlineTokens(next.src, next.tokens); - } - return this.tokens; - } - - /** - * Lexing - */; - _proto.blockTokens = function blockTokens(src, tokens) { - var _this = this; - if (tokens === void 0) { - tokens = []; - } - if (this.options.pedantic) { - src = src.replace(/\t/g, ' ').replace(/^ +$/gm, ''); - } else { - src = src.replace(/^( *)(\t+)/gm, function (_, leading, tabs) { - return leading + ' '.repeat(tabs.length); - }); - } - var token, lastToken, cutSrc, lastParagraphClipped; - while (src) { - if (this.options.extensions && this.options.extensions.block && this.options.extensions.block.some(function (extTokenizer) { - if (token = extTokenizer.call({ - lexer: _this - }, src, tokens)) { - src = src.substring(token.raw.length); - tokens.push(token); - return true; - } - return false; - })) { - continue; - } - - // newline - if (token = this.tokenizer.space(src)) { - src = src.substring(token.raw.length); - if (token.raw.length === 1 && tokens.length > 0) { - // if there's a single \n as a spacer, it's terminating the last line, - // so move it there so that we don't get unecessary paragraph tags - tokens[tokens.length - 1].raw += '\n'; - } else { - tokens.push(token); - } - continue; - } - - // code - if (token = this.tokenizer.code(src)) { - src = src.substring(token.raw.length); - lastToken = tokens[tokens.length - 1]; - // An indented code block cannot interrupt a paragraph. - if (lastToken && (lastToken.type === 'paragraph' || lastToken.type === 'text')) { - lastToken.raw += '\n' + token.raw; - lastToken.text += '\n' + token.text; - this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text; - } else { - tokens.push(token); - } - continue; - } - - // fences - if (token = this.tokenizer.fences(src)) { - src = src.substring(token.raw.length); - tokens.push(token); - continue; - } - - // heading - if (token = this.tokenizer.heading(src)) { - src = src.substring(token.raw.length); - tokens.push(token); - continue; - } - - // hr - if (token = this.tokenizer.hr(src)) { - src = src.substring(token.raw.length); - tokens.push(token); - continue; - } - - // blockquote - if (token = this.tokenizer.blockquote(src)) { - src = src.substring(token.raw.length); - tokens.push(token); - continue; - } - - // list - if (token = this.tokenizer.list(src)) { - src = src.substring(token.raw.length); - tokens.push(token); - continue; - } - - // html - if (token = this.tokenizer.html(src)) { - src = src.substring(token.raw.length); - tokens.push(token); - continue; - } - - // def - if (token = this.tokenizer.def(src)) { - src = src.substring(token.raw.length); - lastToken = tokens[tokens.length - 1]; - if (lastToken && (lastToken.type === 'paragraph' || lastToken.type === 'text')) { - lastToken.raw += '\n' + token.raw; - lastToken.text += '\n' + token.raw; - this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text; - } else if (!this.tokens.links[token.tag]) { - this.tokens.links[token.tag] = { - href: token.href, - title: token.title - }; - } - continue; - } - - // table (gfm) - if (token = this.tokenizer.table(src)) { - src = src.substring(token.raw.length); - tokens.push(token); - continue; - } - - // lheading - if (token = this.tokenizer.lheading(src)) { - src = src.substring(token.raw.length); - tokens.push(token); - continue; - } - - // top-level paragraph - // prevent paragraph consuming extensions by clipping 'src' to extension start - cutSrc = src; - if (this.options.extensions && this.options.extensions.startBlock) { - (function () { - var startIndex = Infinity; - var tempSrc = src.slice(1); - var tempStart = void 0; - _this.options.extensions.startBlock.forEach(function (getStartIndex) { - tempStart = getStartIndex.call({ - lexer: this - }, tempSrc); - if (typeof tempStart === 'number' && tempStart >= 0) { - startIndex = Math.min(startIndex, tempStart); - } - }); - if (startIndex < Infinity && startIndex >= 0) { - cutSrc = src.substring(0, startIndex + 1); - } - })(); - } - if (this.state.top && (token = this.tokenizer.paragraph(cutSrc))) { - lastToken = tokens[tokens.length - 1]; - if (lastParagraphClipped && lastToken.type === 'paragraph') { - lastToken.raw += '\n' + token.raw; - lastToken.text += '\n' + token.text; - this.inlineQueue.pop(); - this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text; - } else { - tokens.push(token); - } - lastParagraphClipped = cutSrc.length !== src.length; - src = src.substring(token.raw.length); - continue; - } - - // text - if (token = this.tokenizer.text(src)) { - src = src.substring(token.raw.length); - lastToken = tokens[tokens.length - 1]; - if (lastToken && lastToken.type === 'text') { - lastToken.raw += '\n' + token.raw; - lastToken.text += '\n' + token.text; - this.inlineQueue.pop(); - this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text; - } else { - tokens.push(token); - } - continue; - } - if (src) { - var errMsg = 'Infinite loop on byte: ' + src.charCodeAt(0); - if (this.options.silent) { - console.error(errMsg); - break; - } else { - throw new Error(errMsg); - } - } - } - this.state.top = true; - return tokens; - }; - _proto.inline = function inline(src, tokens) { - if (tokens === void 0) { - tokens = []; - } - this.inlineQueue.push({ - src: src, - tokens: tokens - }); - return tokens; - } - - /** - * Lexing/Compiling - */; - _proto.inlineTokens = function inlineTokens(src, tokens) { - var _this2 = this; - if (tokens === void 0) { - tokens = []; - } - var token, lastToken, cutSrc; - - // String with links masked to avoid interference with em and strong - var maskedSrc = src; - var match; - var keepPrevChar, prevChar; - - // Mask out reflinks - if (this.tokens.links) { - var links = Object.keys(this.tokens.links); - if (links.length > 0) { - while ((match = this.tokenizer.rules.inline.reflinkSearch.exec(maskedSrc)) != null) { - if (links.includes(match[0].slice(match[0].lastIndexOf('[') + 1, -1))) { - maskedSrc = maskedSrc.slice(0, match.index) + '[' + repeatString('a', match[0].length - 2) + ']' + maskedSrc.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex); - } - } - } - } - // Mask out other blocks - while ((match = this.tokenizer.rules.inline.blockSkip.exec(maskedSrc)) != null) { - maskedSrc = maskedSrc.slice(0, match.index) + '[' + repeatString('a', match[0].length - 2) + ']' + maskedSrc.slice(this.tokenizer.rules.inline.blockSkip.lastIndex); - } - - // Mask out escaped em & strong delimiters - while ((match = this.tokenizer.rules.inline.escapedEmSt.exec(maskedSrc)) != null) { - maskedSrc = maskedSrc.slice(0, match.index + match[0].length - 2) + '++' + maskedSrc.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex); - this.tokenizer.rules.inline.escapedEmSt.lastIndex--; - } - while (src) { - if (!keepPrevChar) { - prevChar = ''; - } - keepPrevChar = false; - - // extensions - if (this.options.extensions && this.options.extensions.inline && this.options.extensions.inline.some(function (extTokenizer) { - if (token = extTokenizer.call({ - lexer: _this2 - }, src, tokens)) { - src = src.substring(token.raw.length); - tokens.push(token); - return true; - } - return false; - })) { - continue; - } - - // escape - if (token = this.tokenizer.escape(src)) { - src = src.substring(token.raw.length); - tokens.push(token); - continue; - } - - // tag - if (token = this.tokenizer.tag(src)) { - src = src.substring(token.raw.length); - lastToken = tokens[tokens.length - 1]; - if (lastToken && token.type === 'text' && lastToken.type === 'text') { - lastToken.raw += token.raw; - lastToken.text += token.text; - } else { - tokens.push(token); - } - continue; - } - - // link - if (token = this.tokenizer.link(src)) { - src = src.substring(token.raw.length); - tokens.push(token); - continue; - } - - // reflink, nolink - if (token = this.tokenizer.reflink(src, this.tokens.links)) { - src = src.substring(token.raw.length); - lastToken = tokens[tokens.length - 1]; - if (lastToken && token.type === 'text' && lastToken.type === 'text') { - lastToken.raw += token.raw; - lastToken.text += token.text; - } else { - tokens.push(token); - } - continue; - } - - // em & strong - if (token = this.tokenizer.emStrong(src, maskedSrc, prevChar)) { - src = src.substring(token.raw.length); - tokens.push(token); - continue; - } - - // code - if (token = this.tokenizer.codespan(src)) { - src = src.substring(token.raw.length); - tokens.push(token); - continue; - } - - // br - if (token = this.tokenizer.br(src)) { - src = src.substring(token.raw.length); - tokens.push(token); - continue; - } - - // del (gfm) - if (token = this.tokenizer.del(src)) { - src = src.substring(token.raw.length); - tokens.push(token); - continue; - } - - // autolink - if (token = this.tokenizer.autolink(src, mangle)) { - src = src.substring(token.raw.length); - tokens.push(token); - continue; - } - - // url (gfm) - if (!this.state.inLink && (token = this.tokenizer.url(src, mangle))) { - src = src.substring(token.raw.length); - tokens.push(token); - continue; - } - - // text - // prevent inlineText consuming extensions by clipping 'src' to extension start - cutSrc = src; - if (this.options.extensions && this.options.extensions.startInline) { - (function () { - var startIndex = Infinity; - var tempSrc = src.slice(1); - var tempStart = void 0; - _this2.options.extensions.startInline.forEach(function (getStartIndex) { - tempStart = getStartIndex.call({ - lexer: this - }, tempSrc); - if (typeof tempStart === 'number' && tempStart >= 0) { - startIndex = Math.min(startIndex, tempStart); - } - }); - if (startIndex < Infinity && startIndex >= 0) { - cutSrc = src.substring(0, startIndex + 1); - } - })(); - } - if (token = this.tokenizer.inlineText(cutSrc, smartypants)) { - src = src.substring(token.raw.length); - if (token.raw.slice(-1) !== '_') { - // Track prevChar before string of ____ started - prevChar = token.raw.slice(-1); - } - keepPrevChar = true; - lastToken = tokens[tokens.length - 1]; - if (lastToken && lastToken.type === 'text') { - lastToken.raw += token.raw; - lastToken.text += token.text; - } else { - tokens.push(token); - } - continue; - } - if (src) { - var errMsg = 'Infinite loop on byte: ' + src.charCodeAt(0); - if (this.options.silent) { - console.error(errMsg); - break; - } else { - throw new Error(errMsg); - } - } - } - return tokens; - }; - _createClass(Lexer, null, [{ - key: "rules", - get: function get() { - return { - block: block, - inline: inline - }; - } - }]); - return Lexer; -}(); - -/** - * Renderer - */ -var Renderer = /*#__PURE__*/function () { - function Renderer(options) { - this.options = options || exports.defaults; - } - var _proto = Renderer.prototype; - _proto.code = function code(_code, infostring, escaped) { - var lang = (infostring || '').match(/\S*/)[0]; - if (this.options.highlight) { - var out = this.options.highlight(_code, lang); - if (out != null && out !== _code) { - escaped = true; - _code = out; - } - } - _code = _code.replace(/\n$/, '') + '\n'; - if (!lang) { - return '
' + (escaped ? _code : escape(_code, true)) + '
\n'; - } - return '
' + (escaped ? _code : escape(_code, true)) + '
\n'; - } - - /** - * @param {string} quote - */; - _proto.blockquote = function blockquote(quote) { - return "
\n" + quote + "
\n"; - }; - _proto.html = function html(_html) { - return _html; - } - - /** - * @param {string} text - * @param {string} level - * @param {string} raw - * @param {any} slugger - */; - _proto.heading = function heading(text, level, raw, slugger) { - if (this.options.headerIds) { - var id = this.options.headerPrefix + slugger.slug(raw); - return "" + text + "\n"; - } - - // ignore IDs - return "" + text + "\n"; - }; - _proto.hr = function hr() { - return this.options.xhtml ? '
\n' : '
\n'; - }; - _proto.list = function list(body, ordered, start) { - var type = ordered ? 'ol' : 'ul', - startatt = ordered && start !== 1 ? ' start="' + start + '"' : ''; - return '<' + type + startatt + '>\n' + body + '\n'; - } - - /** - * @param {string} text - */; - _proto.listitem = function listitem(text) { - return "
  • " + text + "
  • \n"; - }; - _proto.checkbox = function checkbox(checked) { - return ' '; - } - - /** - * @param {string} text - */; - _proto.paragraph = function paragraph(text) { - return "

    " + text + "

    \n"; - } - - /** - * @param {string} header - * @param {string} body - */; - _proto.table = function table(header, body) { - if (body) body = "" + body + ""; - return '\n' + '\n' + header + '\n' + body + '
    \n'; - } - - /** - * @param {string} content - */; - _proto.tablerow = function tablerow(content) { - return "\n" + content + "\n"; - }; - _proto.tablecell = function tablecell(content, flags) { - var type = flags.header ? 'th' : 'td'; - var tag = flags.align ? "<" + type + " align=\"" + flags.align + "\">" : "<" + type + ">"; - return tag + content + ("\n"); - } - - /** - * span level renderer - * @param {string} text - */; - _proto.strong = function strong(text) { - return "" + text + ""; - } - - /** - * @param {string} text - */; - _proto.em = function em(text) { - return "" + text + ""; - } - - /** - * @param {string} text - */; - _proto.codespan = function codespan(text) { - return "" + text + ""; - }; - _proto.br = function br() { - return this.options.xhtml ? '
    ' : '
    '; - } - - /** - * @param {string} text - */; - _proto.del = function del(text) { - return "" + text + ""; - } - - /** - * @param {string} href - * @param {string} title - * @param {string} text - */; - _proto.link = function link(href, title, text) { - href = cleanUrl(this.options.sanitize, this.options.baseUrl, href); - if (href === null) { - return text; - } - var out = '
    '; - return out; - } - - /** - * @param {string} href - * @param {string} title - * @param {string} text - */; - _proto.image = function image(href, title, text) { - href = cleanUrl(this.options.sanitize, this.options.baseUrl, href); - if (href === null) { - return text; - } - var out = "\""' : '>'; - return out; - }; - _proto.text = function text(_text) { - return _text; - }; - return Renderer; -}(); - -/** - * TextRenderer - * returns only the textual part of the token - */ -var TextRenderer = /*#__PURE__*/function () { - function TextRenderer() {} - var _proto = TextRenderer.prototype; - // no need for block level renderers - _proto.strong = function strong(text) { - return text; - }; - _proto.em = function em(text) { - return text; - }; - _proto.codespan = function codespan(text) { - return text; - }; - _proto.del = function del(text) { - return text; - }; - _proto.html = function html(text) { - return text; - }; - _proto.text = function text(_text) { - return _text; - }; - _proto.link = function link(href, title, text) { - return '' + text; - }; - _proto.image = function image(href, title, text) { - return '' + text; - }; - _proto.br = function br() { - return ''; - }; - return TextRenderer; -}(); - -/** - * Slugger generates header id - */ -var Slugger = /*#__PURE__*/function () { - function Slugger() { - this.seen = {}; - } - - /** - * @param {string} value - */ - var _proto = Slugger.prototype; - _proto.serialize = function serialize(value) { - return value.toLowerCase().trim() - // remove html tags - .replace(/<[!\/a-z].*?>/ig, '') - // remove unwanted chars - .replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g, '').replace(/\s/g, '-'); - } - - /** - * Finds the next safe (unique) slug to use - * @param {string} originalSlug - * @param {boolean} isDryRun - */; - _proto.getNextSafeSlug = function getNextSafeSlug(originalSlug, isDryRun) { - var slug = originalSlug; - var occurenceAccumulator = 0; - if (this.seen.hasOwnProperty(slug)) { - occurenceAccumulator = this.seen[originalSlug]; - do { - occurenceAccumulator++; - slug = originalSlug + '-' + occurenceAccumulator; - } while (this.seen.hasOwnProperty(slug)); - } - if (!isDryRun) { - this.seen[originalSlug] = occurenceAccumulator; - this.seen[slug] = 0; - } - return slug; - } - - /** - * Convert string to unique id - * @param {object} [options] - * @param {boolean} [options.dryrun] Generates the next unique slug without - * updating the internal accumulator. - */; - _proto.slug = function slug(value, options) { - if (options === void 0) { - options = {}; - } - var slug = this.serialize(value); - return this.getNextSafeSlug(slug, options.dryrun); - }; - return Slugger; -}(); - -/** - * Parsing & Compiling - */ -var Parser = /*#__PURE__*/function () { - function Parser(options) { - this.options = options || exports.defaults; - this.options.renderer = this.options.renderer || new Renderer(); - this.renderer = this.options.renderer; - this.renderer.options = this.options; - this.textRenderer = new TextRenderer(); - this.slugger = new Slugger(); - } - - /** - * Static Parse Method - */ - Parser.parse = function parse(tokens, options) { - var parser = new Parser(options); - return parser.parse(tokens); - } - - /** - * Static Parse Inline Method - */; - Parser.parseInline = function parseInline(tokens, options) { - var parser = new Parser(options); - return parser.parseInline(tokens); - } - - /** - * Parse Loop - */; - var _proto = Parser.prototype; - _proto.parse = function parse(tokens, top) { - if (top === void 0) { - top = true; - } - var out = '', - i, - j, - k, - l2, - l3, - row, - cell, - header, - body, - token, - ordered, - start, - loose, - itemBody, - item, - checked, - task, - checkbox, - ret; - var l = tokens.length; - for (i = 0; i < l; i++) { - token = tokens[i]; - - // Run any renderer extensions - if (this.options.extensions && this.options.extensions.renderers && this.options.extensions.renderers[token.type]) { - ret = this.options.extensions.renderers[token.type].call({ - parser: this - }, token); - if (ret !== false || !['space', 'hr', 'heading', 'code', 'table', 'blockquote', 'list', 'html', 'paragraph', 'text'].includes(token.type)) { - out += ret || ''; - continue; - } - } - switch (token.type) { - case 'space': - { - continue; - } - case 'hr': - { - out += this.renderer.hr(); - continue; - } - case 'heading': - { - out += this.renderer.heading(this.parseInline(token.tokens), token.depth, unescape(this.parseInline(token.tokens, this.textRenderer)), this.slugger); - continue; - } - case 'code': - { - out += this.renderer.code(token.text, token.lang, token.escaped); - continue; - } - case 'table': - { - header = ''; - - // header - cell = ''; - l2 = token.header.length; - for (j = 0; j < l2; j++) { - cell += this.renderer.tablecell(this.parseInline(token.header[j].tokens), { - header: true, - align: token.align[j] - }); - } - header += this.renderer.tablerow(cell); - body = ''; - l2 = token.rows.length; - for (j = 0; j < l2; j++) { - row = token.rows[j]; - cell = ''; - l3 = row.length; - for (k = 0; k < l3; k++) { - cell += this.renderer.tablecell(this.parseInline(row[k].tokens), { - header: false, - align: token.align[k] - }); - } - body += this.renderer.tablerow(cell); - } - out += this.renderer.table(header, body); - continue; - } - case 'blockquote': - { - body = this.parse(token.tokens); - out += this.renderer.blockquote(body); - continue; - } - case 'list': - { - ordered = token.ordered; - start = token.start; - loose = token.loose; - l2 = token.items.length; - body = ''; - for (j = 0; j < l2; j++) { - item = token.items[j]; - checked = item.checked; - task = item.task; - itemBody = ''; - if (item.task) { - checkbox = this.renderer.checkbox(checked); - if (loose) { - if (item.tokens.length > 0 && item.tokens[0].type === 'paragraph') { - item.tokens[0].text = checkbox + ' ' + item.tokens[0].text; - if (item.tokens[0].tokens && item.tokens[0].tokens.length > 0 && item.tokens[0].tokens[0].type === 'text') { - item.tokens[0].tokens[0].text = checkbox + ' ' + item.tokens[0].tokens[0].text; - } - } else { - item.tokens.unshift({ - type: 'text', - text: checkbox - }); - } - } else { - itemBody += checkbox; - } - } - itemBody += this.parse(item.tokens, loose); - body += this.renderer.listitem(itemBody, task, checked); - } - out += this.renderer.list(body, ordered, start); - continue; - } - case 'html': - { - // TODO parse inline content if parameter markdown=1 - out += this.renderer.html(token.text); - continue; - } - case 'paragraph': - { - out += this.renderer.paragraph(this.parseInline(token.tokens)); - continue; - } - case 'text': - { - body = token.tokens ? this.parseInline(token.tokens) : token.text; - while (i + 1 < l && tokens[i + 1].type === 'text') { - token = tokens[++i]; - body += '\n' + (token.tokens ? this.parseInline(token.tokens) : token.text); - } - out += top ? this.renderer.paragraph(body) : body; - continue; - } - default: - { - var errMsg = 'Token with "' + token.type + '" type was not found.'; - if (this.options.silent) { - console.error(errMsg); - return; - } else { - throw new Error(errMsg); - } - } - } - } - return out; - } - - /** - * Parse Inline Tokens - */; - _proto.parseInline = function parseInline(tokens, renderer) { - renderer = renderer || this.renderer; - var out = '', - i, - token, - ret; - var l = tokens.length; - for (i = 0; i < l; i++) { - token = tokens[i]; - - // Run any renderer extensions - if (this.options.extensions && this.options.extensions.renderers && this.options.extensions.renderers[token.type]) { - ret = this.options.extensions.renderers[token.type].call({ - parser: this - }, token); - if (ret !== false || !['escape', 'html', 'link', 'image', 'strong', 'em', 'codespan', 'br', 'del', 'text'].includes(token.type)) { - out += ret || ''; - continue; - } - } - switch (token.type) { - case 'escape': - { - out += renderer.text(token.text); - break; - } - case 'html': - { - out += renderer.html(token.text); - break; - } - case 'link': - { - out += renderer.link(token.href, token.title, this.parseInline(token.tokens, renderer)); - break; - } - case 'image': - { - out += renderer.image(token.href, token.title, token.text); - break; - } - case 'strong': - { - out += renderer.strong(this.parseInline(token.tokens, renderer)); - break; - } - case 'em': - { - out += renderer.em(this.parseInline(token.tokens, renderer)); - break; - } - case 'codespan': - { - out += renderer.codespan(token.text); - break; - } - case 'br': - { - out += renderer.br(); - break; - } - case 'del': - { - out += renderer.del(this.parseInline(token.tokens, renderer)); - break; - } - case 'text': - { - out += renderer.text(token.text); - break; - } - default: - { - var errMsg = 'Token with "' + token.type + '" type was not found.'; - if (this.options.silent) { - console.error(errMsg); - return; - } else { - throw new Error(errMsg); - } - } - } - } - return out; - }; - return Parser; -}(); - -/** - * Marked - */ -function marked(src, opt, callback) { - // throw error in case of non string input - if (typeof src === 'undefined' || src === null) { - throw new Error('marked(): input parameter is undefined or null'); - } - if (typeof src !== 'string') { - throw new Error('marked(): input parameter is of type ' + Object.prototype.toString.call(src) + ', string expected'); - } - if (typeof opt === 'function') { - callback = opt; - opt = null; - } - opt = merge({}, marked.defaults, opt || {}); - checkSanitizeDeprecation(opt); - if (callback) { - var highlight = opt.highlight; - var tokens; - try { - tokens = Lexer.lex(src, opt); - } catch (e) { - return callback(e); - } - var done = function done(err) { - var out; - if (!err) { - try { - if (opt.walkTokens) { - marked.walkTokens(tokens, opt.walkTokens); - } - out = Parser.parse(tokens, opt); - } catch (e) { - err = e; - } - } - opt.highlight = highlight; - return err ? callback(err) : callback(null, out); - }; - if (!highlight || highlight.length < 3) { - return done(); - } - delete opt.highlight; - if (!tokens.length) return done(); - var pending = 0; - marked.walkTokens(tokens, function (token) { - if (token.type === 'code') { - pending++; - setTimeout(function () { - highlight(token.text, token.lang, function (err, code) { - if (err) { - return done(err); - } - if (code != null && code !== token.text) { - token.text = code; - token.escaped = true; - } - pending--; - if (pending === 0) { - done(); - } - }); - }, 0); - } - }); - if (pending === 0) { - done(); - } - return; - } - function onError(e) { - e.message += '\nPlease report this to https://github.com/markedjs/marked.'; - if (opt.silent) { - return '

    An error occurred:

    ' + escape(e.message + '', true) + '
    '; - } - throw e; - } - try { - var _tokens = Lexer.lex(src, opt); - if (opt.walkTokens) { - if (opt.async) { - return Promise.all(marked.walkTokens(_tokens, opt.walkTokens)).then(function () { - return Parser.parse(_tokens, opt); - })["catch"](onError); - } - marked.walkTokens(_tokens, opt.walkTokens); - } - return Parser.parse(_tokens, opt); - } catch (e) { - onError(e); - } -} - -/** - * Options - */ - -marked.options = marked.setOptions = function (opt) { - merge(marked.defaults, opt); - changeDefaults(marked.defaults); - return marked; -}; -marked.getDefaults = getDefaults; -marked.defaults = exports.defaults; - -/** - * Use Extension - */ - -marked.use = function () { - var extensions = marked.defaults.extensions || { - renderers: {}, - childTokens: {} - }; - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - args.forEach(function (pack) { - // copy options to new object - var opts = merge({}, pack); - - // set async to true if it was set to true before - opts.async = marked.defaults.async || opts.async; - - // ==-- Parse "addon" extensions --== // - if (pack.extensions) { - pack.extensions.forEach(function (ext) { - if (!ext.name) { - throw new Error('extension name required'); - } - if (ext.renderer) { - // Renderer extensions - var prevRenderer = extensions.renderers[ext.name]; - if (prevRenderer) { - // Replace extension with func to run new extension but fall back if false - extensions.renderers[ext.name] = function () { - for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { - args[_key2] = arguments[_key2]; - } - var ret = ext.renderer.apply(this, args); - if (ret === false) { - ret = prevRenderer.apply(this, args); - } - return ret; - }; - } else { - extensions.renderers[ext.name] = ext.renderer; - } - } - if (ext.tokenizer) { - // Tokenizer Extensions - if (!ext.level || ext.level !== 'block' && ext.level !== 'inline') { - throw new Error("extension level must be 'block' or 'inline'"); - } - if (extensions[ext.level]) { - extensions[ext.level].unshift(ext.tokenizer); - } else { - extensions[ext.level] = [ext.tokenizer]; - } - if (ext.start) { - // Function to check for start of token - if (ext.level === 'block') { - if (extensions.startBlock) { - extensions.startBlock.push(ext.start); - } else { - extensions.startBlock = [ext.start]; - } - } else if (ext.level === 'inline') { - if (extensions.startInline) { - extensions.startInline.push(ext.start); - } else { - extensions.startInline = [ext.start]; - } - } - } - } - if (ext.childTokens) { - // Child tokens to be visited by walkTokens - extensions.childTokens[ext.name] = ext.childTokens; - } - }); - opts.extensions = extensions; - } - - // ==-- Parse "overwrite" extensions --== // - if (pack.renderer) { - (function () { - var renderer = marked.defaults.renderer || new Renderer(); - var _loop = function _loop(prop) { - var prevRenderer = renderer[prop]; - // Replace renderer with func to run extension, but fall back if false - renderer[prop] = function () { - for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { - args[_key3] = arguments[_key3]; - } - var ret = pack.renderer[prop].apply(renderer, args); - if (ret === false) { - ret = prevRenderer.apply(renderer, args); - } - return ret; - }; - }; - for (var prop in pack.renderer) { - _loop(prop); - } - opts.renderer = renderer; - })(); - } - if (pack.tokenizer) { - (function () { - var tokenizer = marked.defaults.tokenizer || new Tokenizer(); - var _loop2 = function _loop2(prop) { - var prevTokenizer = tokenizer[prop]; - // Replace tokenizer with func to run extension, but fall back if false - tokenizer[prop] = function () { - for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) { - args[_key4] = arguments[_key4]; - } - var ret = pack.tokenizer[prop].apply(tokenizer, args); - if (ret === false) { - ret = prevTokenizer.apply(tokenizer, args); - } - return ret; - }; - }; - for (var prop in pack.tokenizer) { - _loop2(prop); - } - opts.tokenizer = tokenizer; - })(); - } - - // ==-- Parse WalkTokens extensions --== // - if (pack.walkTokens) { - var _walkTokens = marked.defaults.walkTokens; - opts.walkTokens = function (token) { - var values = []; - values.push(pack.walkTokens.call(this, token)); - if (_walkTokens) { - values = values.concat(_walkTokens.call(this, token)); - } - return values; - }; - } - marked.setOptions(opts); - }); -}; - -/** - * Run callback for every token - */ - -marked.walkTokens = function (tokens, callback) { - var values = []; - var _loop3 = function _loop3() { - var token = _step.value; - values = values.concat(callback.call(marked, token)); - switch (token.type) { - case 'table': - { - for (var _iterator2 = _createForOfIteratorHelperLoose(token.header), _step2; !(_step2 = _iterator2()).done;) { - var cell = _step2.value; - values = values.concat(marked.walkTokens(cell.tokens, callback)); - } - for (var _iterator3 = _createForOfIteratorHelperLoose(token.rows), _step3; !(_step3 = _iterator3()).done;) { - var row = _step3.value; - for (var _iterator4 = _createForOfIteratorHelperLoose(row), _step4; !(_step4 = _iterator4()).done;) { - var _cell = _step4.value; - values = values.concat(marked.walkTokens(_cell.tokens, callback)); - } - } - break; - } - case 'list': - { - values = values.concat(marked.walkTokens(token.items, callback)); - break; - } - default: - { - if (marked.defaults.extensions && marked.defaults.extensions.childTokens && marked.defaults.extensions.childTokens[token.type]) { - // Walk any extensions - marked.defaults.extensions.childTokens[token.type].forEach(function (childTokens) { - values = values.concat(marked.walkTokens(token[childTokens], callback)); - }); - } else if (token.tokens) { - values = values.concat(marked.walkTokens(token.tokens, callback)); - } - } - } - }; - for (var _iterator = _createForOfIteratorHelperLoose(tokens), _step; !(_step = _iterator()).done;) { - _loop3(); - } - return values; -}; - -/** - * Parse Inline - * @param {string} src - */ -marked.parseInline = function (src, opt) { - // throw error in case of non string input - if (typeof src === 'undefined' || src === null) { - throw new Error('marked.parseInline(): input parameter is undefined or null'); - } - if (typeof src !== 'string') { - throw new Error('marked.parseInline(): input parameter is of type ' + Object.prototype.toString.call(src) + ', string expected'); - } - opt = merge({}, marked.defaults, opt || {}); - checkSanitizeDeprecation(opt); - try { - var tokens = Lexer.lexInline(src, opt); - if (opt.walkTokens) { - marked.walkTokens(tokens, opt.walkTokens); - } - return Parser.parseInline(tokens, opt); - } catch (e) { - e.message += '\nPlease report this to https://github.com/markedjs/marked.'; - if (opt.silent) { - return '

    An error occurred:

    ' + escape(e.message + '', true) + '
    '; - } - throw e; - } -}; - -/** - * Expose - */ -marked.Parser = Parser; -marked.parser = Parser.parse; -marked.Renderer = Renderer; -marked.TextRenderer = TextRenderer; -marked.Lexer = Lexer; -marked.lexer = Lexer.lex; -marked.Tokenizer = Tokenizer; -marked.Slugger = Slugger; -marked.parse = marked; -var options = marked.options; -var setOptions = marked.setOptions; -var use = marked.use; -var walkTokens = marked.walkTokens; -var parseInline = marked.parseInline; -var parse = marked; -var parser = Parser.parse; -var lexer = Lexer.lex; - -exports.Lexer = Lexer; -exports.Parser = Parser; -exports.Renderer = Renderer; -exports.Slugger = Slugger; -exports.TextRenderer = TextRenderer; -exports.Tokenizer = Tokenizer; -exports.getDefaults = getDefaults; -exports.lexer = lexer; -exports.marked = marked; -exports.options = options; -exports.parse = parse; -exports.parseInline = parseInline; -exports.parser = parser; -exports.setOptions = setOptions; -exports.use = use; -exports.walkTokens = walkTokens; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/marked/lib/marked.esm.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/marked/lib/marked.esm.js deleted file mode 100644 index 877d92d4..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/marked/lib/marked.esm.js +++ /dev/null @@ -1,2809 +0,0 @@ -/** - * marked - a markdown parser - * Copyright (c) 2011-2022, Christopher Jeffrey. (MIT Licensed) - * https://github.com/markedjs/marked - */ - -/** - * DO NOT EDIT THIS FILE - * The code in this file is generated from files in ./src/ - */ - -function getDefaults() { - return { - async: false, - baseUrl: null, - breaks: false, - extensions: null, - gfm: true, - headerIds: true, - headerPrefix: '', - highlight: null, - langPrefix: 'language-', - mangle: true, - pedantic: false, - renderer: null, - sanitize: false, - sanitizer: null, - silent: false, - smartypants: false, - tokenizer: null, - walkTokens: null, - xhtml: false - }; -} - -let defaults = getDefaults(); - -function changeDefaults(newDefaults) { - defaults = newDefaults; -} - -/** - * Helpers - */ -const escapeTest = /[&<>"']/; -const escapeReplace = new RegExp(escapeTest.source, 'g'); -const escapeTestNoEncode = /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/; -const escapeReplaceNoEncode = new RegExp(escapeTestNoEncode.source, 'g'); -const escapeReplacements = { - '&': '&', - '<': '<', - '>': '>', - '"': '"', - "'": ''' -}; -const getEscapeReplacement = (ch) => escapeReplacements[ch]; -function escape(html, encode) { - if (encode) { - if (escapeTest.test(html)) { - return html.replace(escapeReplace, getEscapeReplacement); - } - } else { - if (escapeTestNoEncode.test(html)) { - return html.replace(escapeReplaceNoEncode, getEscapeReplacement); - } - } - - return html; -} - -const unescapeTest = /&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig; - -/** - * @param {string} html - */ -function unescape(html) { - // explicitly match decimal, hex, and named HTML entities - return html.replace(unescapeTest, (_, n) => { - n = n.toLowerCase(); - if (n === 'colon') return ':'; - if (n.charAt(0) === '#') { - return n.charAt(1) === 'x' - ? String.fromCharCode(parseInt(n.substring(2), 16)) - : String.fromCharCode(+n.substring(1)); - } - return ''; - }); -} - -const caret = /(^|[^\[])\^/g; - -/** - * @param {string | RegExp} regex - * @param {string} opt - */ -function edit(regex, opt) { - regex = typeof regex === 'string' ? regex : regex.source; - opt = opt || ''; - const obj = { - replace: (name, val) => { - val = val.source || val; - val = val.replace(caret, '$1'); - regex = regex.replace(name, val); - return obj; - }, - getRegex: () => { - return new RegExp(regex, opt); - } - }; - return obj; -} - -const nonWordAndColonTest = /[^\w:]/g; -const originIndependentUrl = /^$|^[a-z][a-z0-9+.-]*:|^[?#]/i; - -/** - * @param {boolean} sanitize - * @param {string} base - * @param {string} href - */ -function cleanUrl(sanitize, base, href) { - if (sanitize) { - let prot; - try { - prot = decodeURIComponent(unescape(href)) - .replace(nonWordAndColonTest, '') - .toLowerCase(); - } catch (e) { - return null; - } - if (prot.indexOf('javascript:') === 0 || prot.indexOf('vbscript:') === 0 || prot.indexOf('data:') === 0) { - return null; - } - } - if (base && !originIndependentUrl.test(href)) { - href = resolveUrl(base, href); - } - try { - href = encodeURI(href).replace(/%25/g, '%'); - } catch (e) { - return null; - } - return href; -} - -const baseUrls = {}; -const justDomain = /^[^:]+:\/*[^/]*$/; -const protocol = /^([^:]+:)[\s\S]*$/; -const domain = /^([^:]+:\/*[^/]*)[\s\S]*$/; - -/** - * @param {string} base - * @param {string} href - */ -function resolveUrl(base, href) { - if (!baseUrls[' ' + base]) { - // we can ignore everything in base after the last slash of its path component, - // but we might need to add _that_ - // https://tools.ietf.org/html/rfc3986#section-3 - if (justDomain.test(base)) { - baseUrls[' ' + base] = base + '/'; - } else { - baseUrls[' ' + base] = rtrim(base, '/', true); - } - } - base = baseUrls[' ' + base]; - const relativeBase = base.indexOf(':') === -1; - - if (href.substring(0, 2) === '//') { - if (relativeBase) { - return href; - } - return base.replace(protocol, '$1') + href; - } else if (href.charAt(0) === '/') { - if (relativeBase) { - return href; - } - return base.replace(domain, '$1') + href; - } else { - return base + href; - } -} - -const noopTest = { exec: function noopTest() {} }; - -function merge(obj) { - let i = 1, - target, - key; - - for (; i < arguments.length; i++) { - target = arguments[i]; - for (key in target) { - if (Object.prototype.hasOwnProperty.call(target, key)) { - obj[key] = target[key]; - } - } - } - - return obj; -} - -function splitCells(tableRow, count) { - // ensure that every cell-delimiting pipe has a space - // before it to distinguish it from an escaped pipe - const row = tableRow.replace(/\|/g, (match, offset, str) => { - let escaped = false, - curr = offset; - while (--curr >= 0 && str[curr] === '\\') escaped = !escaped; - if (escaped) { - // odd number of slashes means | is escaped - // so we leave it alone - return '|'; - } else { - // add space before unescaped | - return ' |'; - } - }), - cells = row.split(/ \|/); - let i = 0; - - // First/last cell in a row cannot be empty if it has no leading/trailing pipe - if (!cells[0].trim()) { cells.shift(); } - if (cells.length > 0 && !cells[cells.length - 1].trim()) { cells.pop(); } - - if (cells.length > count) { - cells.splice(count); - } else { - while (cells.length < count) cells.push(''); - } - - for (; i < cells.length; i++) { - // leading or trailing whitespace is ignored per the gfm spec - cells[i] = cells[i].trim().replace(/\\\|/g, '|'); - } - return cells; -} - -/** - * Remove trailing 'c's. Equivalent to str.replace(/c*$/, ''). - * /c*$/ is vulnerable to REDOS. - * - * @param {string} str - * @param {string} c - * @param {boolean} invert Remove suffix of non-c chars instead. Default falsey. - */ -function rtrim(str, c, invert) { - const l = str.length; - if (l === 0) { - return ''; - } - - // Length of suffix matching the invert condition. - let suffLen = 0; - - // Step left until we fail to match the invert condition. - while (suffLen < l) { - const currChar = str.charAt(l - suffLen - 1); - if (currChar === c && !invert) { - suffLen++; - } else if (currChar !== c && invert) { - suffLen++; - } else { - break; - } - } - - return str.slice(0, l - suffLen); -} - -function findClosingBracket(str, b) { - if (str.indexOf(b[1]) === -1) { - return -1; - } - const l = str.length; - let level = 0, - i = 0; - for (; i < l; i++) { - if (str[i] === '\\') { - i++; - } else if (str[i] === b[0]) { - level++; - } else if (str[i] === b[1]) { - level--; - if (level < 0) { - return i; - } - } - } - return -1; -} - -function checkSanitizeDeprecation(opt) { - if (opt && opt.sanitize && !opt.silent) { - console.warn('marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options'); - } -} - -// copied from https://stackoverflow.com/a/5450113/806777 -/** - * @param {string} pattern - * @param {number} count - */ -function repeatString(pattern, count) { - if (count < 1) { - return ''; - } - let result = ''; - while (count > 1) { - if (count & 1) { - result += pattern; - } - count >>= 1; - pattern += pattern; - } - return result + pattern; -} - -function outputLink(cap, link, raw, lexer) { - const href = link.href; - const title = link.title ? escape(link.title) : null; - const text = cap[1].replace(/\\([\[\]])/g, '$1'); - - if (cap[0].charAt(0) !== '!') { - lexer.state.inLink = true; - const token = { - type: 'link', - raw, - href, - title, - text, - tokens: lexer.inlineTokens(text) - }; - lexer.state.inLink = false; - return token; - } - return { - type: 'image', - raw, - href, - title, - text: escape(text) - }; -} - -function indentCodeCompensation(raw, text) { - const matchIndentToCode = raw.match(/^(\s+)(?:```)/); - - if (matchIndentToCode === null) { - return text; - } - - const indentToCode = matchIndentToCode[1]; - - return text - .split('\n') - .map(node => { - const matchIndentInNode = node.match(/^\s+/); - if (matchIndentInNode === null) { - return node; - } - - const [indentInNode] = matchIndentInNode; - - if (indentInNode.length >= indentToCode.length) { - return node.slice(indentToCode.length); - } - - return node; - }) - .join('\n'); -} - -/** - * Tokenizer - */ -class Tokenizer { - constructor(options) { - this.options = options || defaults; - } - - space(src) { - const cap = this.rules.block.newline.exec(src); - if (cap && cap[0].length > 0) { - return { - type: 'space', - raw: cap[0] - }; - } - } - - code(src) { - const cap = this.rules.block.code.exec(src); - if (cap) { - const text = cap[0].replace(/^ {1,4}/gm, ''); - return { - type: 'code', - raw: cap[0], - codeBlockStyle: 'indented', - text: !this.options.pedantic - ? rtrim(text, '\n') - : text - }; - } - } - - fences(src) { - const cap = this.rules.block.fences.exec(src); - if (cap) { - const raw = cap[0]; - const text = indentCodeCompensation(raw, cap[3] || ''); - - return { - type: 'code', - raw, - lang: cap[2] ? cap[2].trim().replace(this.rules.inline._escapes, '$1') : cap[2], - text - }; - } - } - - heading(src) { - const cap = this.rules.block.heading.exec(src); - if (cap) { - let text = cap[2].trim(); - - // remove trailing #s - if (/#$/.test(text)) { - const trimmed = rtrim(text, '#'); - if (this.options.pedantic) { - text = trimmed.trim(); - } else if (!trimmed || / $/.test(trimmed)) { - // CommonMark requires space before trailing #s - text = trimmed.trim(); - } - } - - return { - type: 'heading', - raw: cap[0], - depth: cap[1].length, - text, - tokens: this.lexer.inline(text) - }; - } - } - - hr(src) { - const cap = this.rules.block.hr.exec(src); - if (cap) { - return { - type: 'hr', - raw: cap[0] - }; - } - } - - blockquote(src) { - const cap = this.rules.block.blockquote.exec(src); - if (cap) { - const text = cap[0].replace(/^ *>[ \t]?/gm, ''); - - return { - type: 'blockquote', - raw: cap[0], - tokens: this.lexer.blockTokens(text, []), - text - }; - } - } - - list(src) { - let cap = this.rules.block.list.exec(src); - if (cap) { - let raw, istask, ischecked, indent, i, blankLine, endsWithBlankLine, - line, nextLine, rawLine, itemContents, endEarly; - - let bull = cap[1].trim(); - const isordered = bull.length > 1; - - const list = { - type: 'list', - raw: '', - ordered: isordered, - start: isordered ? +bull.slice(0, -1) : '', - loose: false, - items: [] - }; - - bull = isordered ? `\\d{1,9}\\${bull.slice(-1)}` : `\\${bull}`; - - if (this.options.pedantic) { - bull = isordered ? bull : '[*+-]'; - } - - // Get next list item - const itemRegex = new RegExp(`^( {0,3}${bull})((?:[\t ][^\\n]*)?(?:\\n|$))`); - - // Check if current bullet point can start a new List Item - while (src) { - endEarly = false; - if (!(cap = itemRegex.exec(src))) { - break; - } - - if (this.rules.block.hr.test(src)) { // End list if bullet was actually HR (possibly move into itemRegex?) - break; - } - - raw = cap[0]; - src = src.substring(raw.length); - - line = cap[2].split('\n', 1)[0]; - nextLine = src.split('\n', 1)[0]; - - if (this.options.pedantic) { - indent = 2; - itemContents = line.trimLeft(); - } else { - indent = cap[2].search(/[^ ]/); // Find first non-space char - indent = indent > 4 ? 1 : indent; // Treat indented code blocks (> 4 spaces) as having only 1 indent - itemContents = line.slice(indent); - indent += cap[1].length; - } - - blankLine = false; - - if (!line && /^ *$/.test(nextLine)) { // Items begin with at most one blank line - raw += nextLine + '\n'; - src = src.substring(nextLine.length + 1); - endEarly = true; - } - - if (!endEarly) { - const nextBulletRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}(?:[*+-]|\\d{1,9}[.)])((?: [^\\n]*)?(?:\\n|$))`); - const hrRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`); - const fencesBeginRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}(?:\`\`\`|~~~)`); - const headingBeginRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}#`); - - // Check if following lines should be included in List Item - while (src) { - rawLine = src.split('\n', 1)[0]; - line = rawLine; - - // Re-align to follow commonmark nesting rules - if (this.options.pedantic) { - line = line.replace(/^ {1,4}(?=( {4})*[^ ])/g, ' '); - } - - // End list item if found code fences - if (fencesBeginRegex.test(line)) { - break; - } - - // End list item if found start of new heading - if (headingBeginRegex.test(line)) { - break; - } - - // End list item if found start of new bullet - if (nextBulletRegex.test(line)) { - break; - } - - // Horizontal rule found - if (hrRegex.test(src)) { - break; - } - - if (line.search(/[^ ]/) >= indent || !line.trim()) { // Dedent if possible - itemContents += '\n' + line.slice(indent); - } else if (!blankLine) { // Until blank line, item doesn't need indentation - itemContents += '\n' + line; - } else { // Otherwise, improper indentation ends this item - break; - } - - if (!blankLine && !line.trim()) { // Check if current line is blank - blankLine = true; - } - - raw += rawLine + '\n'; - src = src.substring(rawLine.length + 1); - } - } - - if (!list.loose) { - // If the previous item ended with a blank line, the list is loose - if (endsWithBlankLine) { - list.loose = true; - } else if (/\n *\n *$/.test(raw)) { - endsWithBlankLine = true; - } - } - - // Check for task list items - if (this.options.gfm) { - istask = /^\[[ xX]\] /.exec(itemContents); - if (istask) { - ischecked = istask[0] !== '[ ] '; - itemContents = itemContents.replace(/^\[[ xX]\] +/, ''); - } - } - - list.items.push({ - type: 'list_item', - raw, - task: !!istask, - checked: ischecked, - loose: false, - text: itemContents - }); - - list.raw += raw; - } - - // Do not consume newlines at end of final item. Alternatively, make itemRegex *start* with any newlines to simplify/speed up endsWithBlankLine logic - list.items[list.items.length - 1].raw = raw.trimRight(); - list.items[list.items.length - 1].text = itemContents.trimRight(); - list.raw = list.raw.trimRight(); - - const l = list.items.length; - - // Item child tokens handled here at end because we needed to have the final item to trim it first - for (i = 0; i < l; i++) { - this.lexer.state.top = false; - list.items[i].tokens = this.lexer.blockTokens(list.items[i].text, []); - const spacers = list.items[i].tokens.filter(t => t.type === 'space'); - const hasMultipleLineBreaks = spacers.every(t => { - const chars = t.raw.split(''); - let lineBreaks = 0; - for (const char of chars) { - if (char === '\n') { - lineBreaks += 1; - } - if (lineBreaks > 1) { - return true; - } - } - - return false; - }); - - if (!list.loose && spacers.length && hasMultipleLineBreaks) { - // Having a single line break doesn't mean a list is loose. A single line break is terminating the last list item - list.loose = true; - list.items[i].loose = true; - } - } - - return list; - } - } - - html(src) { - const cap = this.rules.block.html.exec(src); - if (cap) { - const token = { - type: 'html', - raw: cap[0], - pre: !this.options.sanitizer - && (cap[1] === 'pre' || cap[1] === 'script' || cap[1] === 'style'), - text: cap[0] - }; - if (this.options.sanitize) { - const text = this.options.sanitizer ? this.options.sanitizer(cap[0]) : escape(cap[0]); - token.type = 'paragraph'; - token.text = text; - token.tokens = this.lexer.inline(text); - } - return token; - } - } - - def(src) { - const cap = this.rules.block.def.exec(src); - if (cap) { - const tag = cap[1].toLowerCase().replace(/\s+/g, ' '); - const href = cap[2] ? cap[2].replace(/^<(.*)>$/, '$1').replace(this.rules.inline._escapes, '$1') : ''; - const title = cap[3] ? cap[3].substring(1, cap[3].length - 1).replace(this.rules.inline._escapes, '$1') : cap[3]; - return { - type: 'def', - tag, - raw: cap[0], - href, - title - }; - } - } - - table(src) { - const cap = this.rules.block.table.exec(src); - if (cap) { - const item = { - type: 'table', - header: splitCells(cap[1]).map(c => { return { text: c }; }), - align: cap[2].replace(/^ *|\| *$/g, '').split(/ *\| */), - rows: cap[3] && cap[3].trim() ? cap[3].replace(/\n[ \t]*$/, '').split('\n') : [] - }; - - if (item.header.length === item.align.length) { - item.raw = cap[0]; - - let l = item.align.length; - let i, j, k, row; - for (i = 0; i < l; i++) { - if (/^ *-+: *$/.test(item.align[i])) { - item.align[i] = 'right'; - } else if (/^ *:-+: *$/.test(item.align[i])) { - item.align[i] = 'center'; - } else if (/^ *:-+ *$/.test(item.align[i])) { - item.align[i] = 'left'; - } else { - item.align[i] = null; - } - } - - l = item.rows.length; - for (i = 0; i < l; i++) { - item.rows[i] = splitCells(item.rows[i], item.header.length).map(c => { return { text: c }; }); - } - - // parse child tokens inside headers and cells - - // header child tokens - l = item.header.length; - for (j = 0; j < l; j++) { - item.header[j].tokens = this.lexer.inline(item.header[j].text); - } - - // cell child tokens - l = item.rows.length; - for (j = 0; j < l; j++) { - row = item.rows[j]; - for (k = 0; k < row.length; k++) { - row[k].tokens = this.lexer.inline(row[k].text); - } - } - - return item; - } - } - } - - lheading(src) { - const cap = this.rules.block.lheading.exec(src); - if (cap) { - return { - type: 'heading', - raw: cap[0], - depth: cap[2].charAt(0) === '=' ? 1 : 2, - text: cap[1], - tokens: this.lexer.inline(cap[1]) - }; - } - } - - paragraph(src) { - const cap = this.rules.block.paragraph.exec(src); - if (cap) { - const text = cap[1].charAt(cap[1].length - 1) === '\n' - ? cap[1].slice(0, -1) - : cap[1]; - return { - type: 'paragraph', - raw: cap[0], - text, - tokens: this.lexer.inline(text) - }; - } - } - - text(src) { - const cap = this.rules.block.text.exec(src); - if (cap) { - return { - type: 'text', - raw: cap[0], - text: cap[0], - tokens: this.lexer.inline(cap[0]) - }; - } - } - - escape(src) { - const cap = this.rules.inline.escape.exec(src); - if (cap) { - return { - type: 'escape', - raw: cap[0], - text: escape(cap[1]) - }; - } - } - - tag(src) { - const cap = this.rules.inline.tag.exec(src); - if (cap) { - if (!this.lexer.state.inLink && /^
    /i.test(cap[0])) { - this.lexer.state.inLink = false; - } - if (!this.lexer.state.inRawBlock && /^<(pre|code|kbd|script)(\s|>)/i.test(cap[0])) { - this.lexer.state.inRawBlock = true; - } else if (this.lexer.state.inRawBlock && /^<\/(pre|code|kbd|script)(\s|>)/i.test(cap[0])) { - this.lexer.state.inRawBlock = false; - } - - return { - type: this.options.sanitize - ? 'text' - : 'html', - raw: cap[0], - inLink: this.lexer.state.inLink, - inRawBlock: this.lexer.state.inRawBlock, - text: this.options.sanitize - ? (this.options.sanitizer - ? this.options.sanitizer(cap[0]) - : escape(cap[0])) - : cap[0] - }; - } - } - - link(src) { - const cap = this.rules.inline.link.exec(src); - if (cap) { - const trimmedUrl = cap[2].trim(); - if (!this.options.pedantic && /^$/.test(trimmedUrl))) { - return; - } - - // ending angle bracket cannot be escaped - const rtrimSlash = rtrim(trimmedUrl.slice(0, -1), '\\'); - if ((trimmedUrl.length - rtrimSlash.length) % 2 === 0) { - return; - } - } else { - // find closing parenthesis - const lastParenIndex = findClosingBracket(cap[2], '()'); - if (lastParenIndex > -1) { - const start = cap[0].indexOf('!') === 0 ? 5 : 4; - const linkLen = start + cap[1].length + lastParenIndex; - cap[2] = cap[2].substring(0, lastParenIndex); - cap[0] = cap[0].substring(0, linkLen).trim(); - cap[3] = ''; - } - } - let href = cap[2]; - let title = ''; - if (this.options.pedantic) { - // split pedantic href and title - const link = /^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(href); - - if (link) { - href = link[1]; - title = link[3]; - } - } else { - title = cap[3] ? cap[3].slice(1, -1) : ''; - } - - href = href.trim(); - if (/^$/.test(trimmedUrl))) { - // pedantic allows starting angle bracket without ending angle bracket - href = href.slice(1); - } else { - href = href.slice(1, -1); - } - } - return outputLink(cap, { - href: href ? href.replace(this.rules.inline._escapes, '$1') : href, - title: title ? title.replace(this.rules.inline._escapes, '$1') : title - }, cap[0], this.lexer); - } - } - - reflink(src, links) { - let cap; - if ((cap = this.rules.inline.reflink.exec(src)) - || (cap = this.rules.inline.nolink.exec(src))) { - let link = (cap[2] || cap[1]).replace(/\s+/g, ' '); - link = links[link.toLowerCase()]; - if (!link) { - const text = cap[0].charAt(0); - return { - type: 'text', - raw: text, - text - }; - } - return outputLink(cap, link, cap[0], this.lexer); - } - } - - emStrong(src, maskedSrc, prevChar = '') { - let match = this.rules.inline.emStrong.lDelim.exec(src); - if (!match) return; - - // _ can't be between two alphanumerics. \p{L}\p{N} includes non-english alphabet/numbers as well - if (match[3] && prevChar.match(/[\p{L}\p{N}]/u)) return; - - const nextChar = match[1] || match[2] || ''; - - if (!nextChar || (nextChar && (prevChar === '' || this.rules.inline.punctuation.exec(prevChar)))) { - const lLength = match[0].length - 1; - let rDelim, rLength, delimTotal = lLength, midDelimTotal = 0; - - const endReg = match[0][0] === '*' ? this.rules.inline.emStrong.rDelimAst : this.rules.inline.emStrong.rDelimUnd; - endReg.lastIndex = 0; - - // Clip maskedSrc to same section of string as src (move to lexer?) - maskedSrc = maskedSrc.slice(-1 * src.length + lLength); - - while ((match = endReg.exec(maskedSrc)) != null) { - rDelim = match[1] || match[2] || match[3] || match[4] || match[5] || match[6]; - - if (!rDelim) continue; // skip single * in __abc*abc__ - - rLength = rDelim.length; - - if (match[3] || match[4]) { // found another Left Delim - delimTotal += rLength; - continue; - } else if (match[5] || match[6]) { // either Left or Right Delim - if (lLength % 3 && !((lLength + rLength) % 3)) { - midDelimTotal += rLength; - continue; // CommonMark Emphasis Rules 9-10 - } - } - - delimTotal -= rLength; - - if (delimTotal > 0) continue; // Haven't found enough closing delimiters - - // Remove extra characters. *a*** -> *a* - rLength = Math.min(rLength, rLength + delimTotal + midDelimTotal); - - const raw = src.slice(0, lLength + match.index + (match[0].length - rDelim.length) + rLength); - - // Create `em` if smallest delimiter has odd char count. *a*** - if (Math.min(lLength, rLength) % 2) { - const text = raw.slice(1, -1); - return { - type: 'em', - raw, - text, - tokens: this.lexer.inlineTokens(text) - }; - } - - // Create 'strong' if smallest delimiter has even char count. **a*** - const text = raw.slice(2, -2); - return { - type: 'strong', - raw, - text, - tokens: this.lexer.inlineTokens(text) - }; - } - } - } - - codespan(src) { - const cap = this.rules.inline.code.exec(src); - if (cap) { - let text = cap[2].replace(/\n/g, ' '); - const hasNonSpaceChars = /[^ ]/.test(text); - const hasSpaceCharsOnBothEnds = /^ /.test(text) && / $/.test(text); - if (hasNonSpaceChars && hasSpaceCharsOnBothEnds) { - text = text.substring(1, text.length - 1); - } - text = escape(text, true); - return { - type: 'codespan', - raw: cap[0], - text - }; - } - } - - br(src) { - const cap = this.rules.inline.br.exec(src); - if (cap) { - return { - type: 'br', - raw: cap[0] - }; - } - } - - del(src) { - const cap = this.rules.inline.del.exec(src); - if (cap) { - return { - type: 'del', - raw: cap[0], - text: cap[2], - tokens: this.lexer.inlineTokens(cap[2]) - }; - } - } - - autolink(src, mangle) { - const cap = this.rules.inline.autolink.exec(src); - if (cap) { - let text, href; - if (cap[2] === '@') { - text = escape(this.options.mangle ? mangle(cap[1]) : cap[1]); - href = 'mailto:' + text; - } else { - text = escape(cap[1]); - href = text; - } - - return { - type: 'link', - raw: cap[0], - text, - href, - tokens: [ - { - type: 'text', - raw: text, - text - } - ] - }; - } - } - - url(src, mangle) { - let cap; - if (cap = this.rules.inline.url.exec(src)) { - let text, href; - if (cap[2] === '@') { - text = escape(this.options.mangle ? mangle(cap[0]) : cap[0]); - href = 'mailto:' + text; - } else { - // do extended autolink path validation - let prevCapZero; - do { - prevCapZero = cap[0]; - cap[0] = this.rules.inline._backpedal.exec(cap[0])[0]; - } while (prevCapZero !== cap[0]); - text = escape(cap[0]); - if (cap[1] === 'www.') { - href = 'http://' + text; - } else { - href = text; - } - } - return { - type: 'link', - raw: cap[0], - text, - href, - tokens: [ - { - type: 'text', - raw: text, - text - } - ] - }; - } - } - - inlineText(src, smartypants) { - const cap = this.rules.inline.text.exec(src); - if (cap) { - let text; - if (this.lexer.state.inRawBlock) { - text = this.options.sanitize ? (this.options.sanitizer ? this.options.sanitizer(cap[0]) : escape(cap[0])) : cap[0]; - } else { - text = escape(this.options.smartypants ? smartypants(cap[0]) : cap[0]); - } - return { - type: 'text', - raw: cap[0], - text - }; - } - } -} - -/** - * Block-Level Grammar - */ -const block = { - newline: /^(?: *(?:\n|$))+/, - code: /^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/, - fences: /^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?=\n|$)|$)/, - hr: /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, - heading: /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, - blockquote: /^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/, - list: /^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/, - html: '^ {0,3}(?:' // optional indentation - + '<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)' // (1) - + '|comment[^\\n]*(\\n+|$)' // (2) - + '|<\\?[\\s\\S]*?(?:\\?>\\n*|$)' // (3) - + '|\\n*|$)' // (4) - + '|\\n*|$)' // (5) - + '|)[\\s\\S]*?(?:(?:\\n *)+\\n|$)' // (6) - + '|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)' // (7) open tag - + '|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)' // (7) closing tag - + ')', - def: /^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/, - table: noopTest, - lheading: /^((?:.|\n(?!\n))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, - // regex template, placeholders will be replaced according to different paragraph - // interruption rules of commonmark and the original markdown spec: - _paragraph: /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, - text: /^[^\n]+/ -}; - -block._label = /(?!\s*\])(?:\\.|[^\[\]\\])+/; -block._title = /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/; -block.def = edit(block.def) - .replace('label', block._label) - .replace('title', block._title) - .getRegex(); - -block.bullet = /(?:[*+-]|\d{1,9}[.)])/; -block.listItemStart = edit(/^( *)(bull) */) - .replace('bull', block.bullet) - .getRegex(); - -block.list = edit(block.list) - .replace(/bull/g, block.bullet) - .replace('hr', '\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))') - .replace('def', '\\n+(?=' + block.def.source + ')') - .getRegex(); - -block._tag = 'address|article|aside|base|basefont|blockquote|body|caption' - + '|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption' - + '|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe' - + '|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option' - + '|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr' - + '|track|ul'; -block._comment = /|$)/; -block.html = edit(block.html, 'i') - .replace('comment', block._comment) - .replace('tag', block._tag) - .replace('attribute', / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/) - .getRegex(); - -block.paragraph = edit(block._paragraph) - .replace('hr', block.hr) - .replace('heading', ' {0,3}#{1,6} ') - .replace('|lheading', '') // setex headings don't interrupt commonmark paragraphs - .replace('|table', '') - .replace('blockquote', ' {0,3}>') - .replace('fences', ' {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n') - .replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt - .replace('html', ')|<(?:script|pre|style|textarea|!--)') - .replace('tag', block._tag) // pars can be interrupted by type (6) html blocks - .getRegex(); - -block.blockquote = edit(block.blockquote) - .replace('paragraph', block.paragraph) - .getRegex(); - -/** - * Normal Block Grammar - */ - -block.normal = merge({}, block); - -/** - * GFM Block Grammar - */ - -block.gfm = merge({}, block.normal, { - table: '^ *([^\\n ].*\\|.*)\\n' // Header - + ' {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?' // Align - + '(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)' // Cells -}); - -block.gfm.table = edit(block.gfm.table) - .replace('hr', block.hr) - .replace('heading', ' {0,3}#{1,6} ') - .replace('blockquote', ' {0,3}>') - .replace('code', ' {4}[^\\n]') - .replace('fences', ' {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n') - .replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt - .replace('html', ')|<(?:script|pre|style|textarea|!--)') - .replace('tag', block._tag) // tables can be interrupted by type (6) html blocks - .getRegex(); - -block.gfm.paragraph = edit(block._paragraph) - .replace('hr', block.hr) - .replace('heading', ' {0,3}#{1,6} ') - .replace('|lheading', '') // setex headings don't interrupt commonmark paragraphs - .replace('table', block.gfm.table) // interrupt paragraphs with table - .replace('blockquote', ' {0,3}>') - .replace('fences', ' {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n') - .replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt - .replace('html', ')|<(?:script|pre|style|textarea|!--)') - .replace('tag', block._tag) // pars can be interrupted by type (6) html blocks - .getRegex(); -/** - * Pedantic grammar (original John Gruber's loose markdown specification) - */ - -block.pedantic = merge({}, block.normal, { - html: edit( - '^ *(?:comment *(?:\\n|\\s*$)' - + '|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)' // closed tag - + '|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))') - .replace('comment', block._comment) - .replace(/tag/g, '(?!(?:' - + 'a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub' - + '|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)' - + '\\b)\\w+(?!:|[^\\w\\s@]*@)\\b') - .getRegex(), - def: /^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/, - heading: /^(#{1,6})(.*)(?:\n+|$)/, - fences: noopTest, // fences not supported - lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/, - paragraph: edit(block.normal._paragraph) - .replace('hr', block.hr) - .replace('heading', ' *#{1,6} *[^\n]') - .replace('lheading', block.lheading) - .replace('blockquote', ' {0,3}>') - .replace('|fences', '') - .replace('|list', '') - .replace('|html', '') - .getRegex() -}); - -/** - * Inline-Level Grammar - */ -const inline = { - escape: /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, - autolink: /^<(scheme:[^\s\x00-\x1f<>]*|email)>/, - url: noopTest, - tag: '^comment' - + '|^' // self-closing tag - + '|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>' // open tag - + '|^<\\?[\\s\\S]*?\\?>' // processing instruction, e.g. - + '|^' // declaration, e.g. - + '|^', // CDATA section - link: /^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/, - reflink: /^!?\[(label)\]\[(ref)\]/, - nolink: /^!?\[(ref)\](?:\[\])?/, - reflinkSearch: 'reflink|nolink(?!\\()', - emStrong: { - lDelim: /^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/, - // (1) and (2) can only be a Right Delimiter. (3) and (4) can only be Left. (5) and (6) can be either Left or Right. - // () Skip orphan inside strong () Consume to delim (1) #*** (2) a***#, a*** (3) #***a, ***a (4) ***# (5) #***# (6) a***a - rDelimAst: /^(?:[^_*\\]|\\.)*?\_\_(?:[^_*\\]|\\.)*?\*(?:[^_*\\]|\\.)*?(?=\_\_)|(?:[^*\\]|\\.)+(?=[^*])|[punct_](\*+)(?=[\s]|$)|(?:[^punct*_\s\\]|\\.)(\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|(?:[^punct*_\s\\]|\\.)(\*+)(?=[^punct*_\s])/, - rDelimUnd: /^(?:[^_*\\]|\\.)*?\*\*(?:[^_*\\]|\\.)*?\_(?:[^_*\\]|\\.)*?(?=\*\*)|(?:[^_\\]|\\.)+(?=[^_])|[punct*](\_+)(?=[\s]|$)|(?:[^punct*_\s\\]|\\.)(\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/ // ^- Not allowed for _ - }, - code: /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, - br: /^( {2,}|\\)\n(?!\s*$)/, - del: noopTest, - text: /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~'; -inline.punctuation = edit(inline.punctuation).replace(/punctuation/g, inline._punctuation).getRegex(); - -// sequences em should skip over [title](link), `code`, -inline.blockSkip = /\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g; -// lookbehind is not available on Safari as of version 16 -// inline.escapedEmSt = /(?<=(?:^|[^\\)(?:\\[^])*)\\[*_]/g; -inline.escapedEmSt = /(?:^|[^\\])(?:\\\\)*\\[*_]/g; - -inline._comment = edit(block._comment).replace('(?:-->|$)', '-->').getRegex(); - -inline.emStrong.lDelim = edit(inline.emStrong.lDelim) - .replace(/punct/g, inline._punctuation) - .getRegex(); - -inline.emStrong.rDelimAst = edit(inline.emStrong.rDelimAst, 'g') - .replace(/punct/g, inline._punctuation) - .getRegex(); - -inline.emStrong.rDelimUnd = edit(inline.emStrong.rDelimUnd, 'g') - .replace(/punct/g, inline._punctuation) - .getRegex(); - -inline._escapes = /\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g; - -inline._scheme = /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/; -inline._email = /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/; -inline.autolink = edit(inline.autolink) - .replace('scheme', inline._scheme) - .replace('email', inline._email) - .getRegex(); - -inline._attribute = /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/; - -inline.tag = edit(inline.tag) - .replace('comment', inline._comment) - .replace('attribute', inline._attribute) - .getRegex(); - -inline._label = /(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/; -inline._href = /<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/; -inline._title = /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/; - -inline.link = edit(inline.link) - .replace('label', inline._label) - .replace('href', inline._href) - .replace('title', inline._title) - .getRegex(); - -inline.reflink = edit(inline.reflink) - .replace('label', inline._label) - .replace('ref', block._label) - .getRegex(); - -inline.nolink = edit(inline.nolink) - .replace('ref', block._label) - .getRegex(); - -inline.reflinkSearch = edit(inline.reflinkSearch, 'g') - .replace('reflink', inline.reflink) - .replace('nolink', inline.nolink) - .getRegex(); - -/** - * Normal Inline Grammar - */ - -inline.normal = merge({}, inline); - -/** - * Pedantic Inline Grammar - */ - -inline.pedantic = merge({}, inline.normal, { - strong: { - start: /^__|\*\*/, - middle: /^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/, - endAst: /\*\*(?!\*)/g, - endUnd: /__(?!_)/g - }, - em: { - start: /^_|\*/, - middle: /^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/, - endAst: /\*(?!\*)/g, - endUnd: /_(?!_)/g - }, - link: edit(/^!?\[(label)\]\((.*?)\)/) - .replace('label', inline._label) - .getRegex(), - reflink: edit(/^!?\[(label)\]\s*\[([^\]]*)\]/) - .replace('label', inline._label) - .getRegex() -}); - -/** - * GFM Inline Grammar - */ - -inline.gfm = merge({}, inline.normal, { - escape: edit(inline.escape).replace('])', '~|])').getRegex(), - _extended_email: /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/, - url: /^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/, - _backpedal: /(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/, - del: /^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/, - text: /^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\ 0.5) { - ch = 'x' + ch.toString(16); - } - out += '&#' + ch + ';'; - } - - return out; -} - -/** - * Block Lexer - */ -class Lexer { - constructor(options) { - this.tokens = []; - this.tokens.links = Object.create(null); - this.options = options || defaults; - this.options.tokenizer = this.options.tokenizer || new Tokenizer(); - this.tokenizer = this.options.tokenizer; - this.tokenizer.options = this.options; - this.tokenizer.lexer = this; - this.inlineQueue = []; - this.state = { - inLink: false, - inRawBlock: false, - top: true - }; - - const rules = { - block: block.normal, - inline: inline.normal - }; - - if (this.options.pedantic) { - rules.block = block.pedantic; - rules.inline = inline.pedantic; - } else if (this.options.gfm) { - rules.block = block.gfm; - if (this.options.breaks) { - rules.inline = inline.breaks; - } else { - rules.inline = inline.gfm; - } - } - this.tokenizer.rules = rules; - } - - /** - * Expose Rules - */ - static get rules() { - return { - block, - inline - }; - } - - /** - * Static Lex Method - */ - static lex(src, options) { - const lexer = new Lexer(options); - return lexer.lex(src); - } - - /** - * Static Lex Inline Method - */ - static lexInline(src, options) { - const lexer = new Lexer(options); - return lexer.inlineTokens(src); - } - - /** - * Preprocessing - */ - lex(src) { - src = src - .replace(/\r\n|\r/g, '\n'); - - this.blockTokens(src, this.tokens); - - let next; - while (next = this.inlineQueue.shift()) { - this.inlineTokens(next.src, next.tokens); - } - - return this.tokens; - } - - /** - * Lexing - */ - blockTokens(src, tokens = []) { - if (this.options.pedantic) { - src = src.replace(/\t/g, ' ').replace(/^ +$/gm, ''); - } else { - src = src.replace(/^( *)(\t+)/gm, (_, leading, tabs) => { - return leading + ' '.repeat(tabs.length); - }); - } - - let token, lastToken, cutSrc, lastParagraphClipped; - - while (src) { - if (this.options.extensions - && this.options.extensions.block - && this.options.extensions.block.some((extTokenizer) => { - if (token = extTokenizer.call({ lexer: this }, src, tokens)) { - src = src.substring(token.raw.length); - tokens.push(token); - return true; - } - return false; - })) { - continue; - } - - // newline - if (token = this.tokenizer.space(src)) { - src = src.substring(token.raw.length); - if (token.raw.length === 1 && tokens.length > 0) { - // if there's a single \n as a spacer, it's terminating the last line, - // so move it there so that we don't get unecessary paragraph tags - tokens[tokens.length - 1].raw += '\n'; - } else { - tokens.push(token); - } - continue; - } - - // code - if (token = this.tokenizer.code(src)) { - src = src.substring(token.raw.length); - lastToken = tokens[tokens.length - 1]; - // An indented code block cannot interrupt a paragraph. - if (lastToken && (lastToken.type === 'paragraph' || lastToken.type === 'text')) { - lastToken.raw += '\n' + token.raw; - lastToken.text += '\n' + token.text; - this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text; - } else { - tokens.push(token); - } - continue; - } - - // fences - if (token = this.tokenizer.fences(src)) { - src = src.substring(token.raw.length); - tokens.push(token); - continue; - } - - // heading - if (token = this.tokenizer.heading(src)) { - src = src.substring(token.raw.length); - tokens.push(token); - continue; - } - - // hr - if (token = this.tokenizer.hr(src)) { - src = src.substring(token.raw.length); - tokens.push(token); - continue; - } - - // blockquote - if (token = this.tokenizer.blockquote(src)) { - src = src.substring(token.raw.length); - tokens.push(token); - continue; - } - - // list - if (token = this.tokenizer.list(src)) { - src = src.substring(token.raw.length); - tokens.push(token); - continue; - } - - // html - if (token = this.tokenizer.html(src)) { - src = src.substring(token.raw.length); - tokens.push(token); - continue; - } - - // def - if (token = this.tokenizer.def(src)) { - src = src.substring(token.raw.length); - lastToken = tokens[tokens.length - 1]; - if (lastToken && (lastToken.type === 'paragraph' || lastToken.type === 'text')) { - lastToken.raw += '\n' + token.raw; - lastToken.text += '\n' + token.raw; - this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text; - } else if (!this.tokens.links[token.tag]) { - this.tokens.links[token.tag] = { - href: token.href, - title: token.title - }; - } - continue; - } - - // table (gfm) - if (token = this.tokenizer.table(src)) { - src = src.substring(token.raw.length); - tokens.push(token); - continue; - } - - // lheading - if (token = this.tokenizer.lheading(src)) { - src = src.substring(token.raw.length); - tokens.push(token); - continue; - } - - // top-level paragraph - // prevent paragraph consuming extensions by clipping 'src' to extension start - cutSrc = src; - if (this.options.extensions && this.options.extensions.startBlock) { - let startIndex = Infinity; - const tempSrc = src.slice(1); - let tempStart; - this.options.extensions.startBlock.forEach(function(getStartIndex) { - tempStart = getStartIndex.call({ lexer: this }, tempSrc); - if (typeof tempStart === 'number' && tempStart >= 0) { startIndex = Math.min(startIndex, tempStart); } - }); - if (startIndex < Infinity && startIndex >= 0) { - cutSrc = src.substring(0, startIndex + 1); - } - } - if (this.state.top && (token = this.tokenizer.paragraph(cutSrc))) { - lastToken = tokens[tokens.length - 1]; - if (lastParagraphClipped && lastToken.type === 'paragraph') { - lastToken.raw += '\n' + token.raw; - lastToken.text += '\n' + token.text; - this.inlineQueue.pop(); - this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text; - } else { - tokens.push(token); - } - lastParagraphClipped = (cutSrc.length !== src.length); - src = src.substring(token.raw.length); - continue; - } - - // text - if (token = this.tokenizer.text(src)) { - src = src.substring(token.raw.length); - lastToken = tokens[tokens.length - 1]; - if (lastToken && lastToken.type === 'text') { - lastToken.raw += '\n' + token.raw; - lastToken.text += '\n' + token.text; - this.inlineQueue.pop(); - this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text; - } else { - tokens.push(token); - } - continue; - } - - if (src) { - const errMsg = 'Infinite loop on byte: ' + src.charCodeAt(0); - if (this.options.silent) { - console.error(errMsg); - break; - } else { - throw new Error(errMsg); - } - } - } - - this.state.top = true; - return tokens; - } - - inline(src, tokens = []) { - this.inlineQueue.push({ src, tokens }); - return tokens; - } - - /** - * Lexing/Compiling - */ - inlineTokens(src, tokens = []) { - let token, lastToken, cutSrc; - - // String with links masked to avoid interference with em and strong - let maskedSrc = src; - let match; - let keepPrevChar, prevChar; - - // Mask out reflinks - if (this.tokens.links) { - const links = Object.keys(this.tokens.links); - if (links.length > 0) { - while ((match = this.tokenizer.rules.inline.reflinkSearch.exec(maskedSrc)) != null) { - if (links.includes(match[0].slice(match[0].lastIndexOf('[') + 1, -1))) { - maskedSrc = maskedSrc.slice(0, match.index) + '[' + repeatString('a', match[0].length - 2) + ']' + maskedSrc.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex); - } - } - } - } - // Mask out other blocks - while ((match = this.tokenizer.rules.inline.blockSkip.exec(maskedSrc)) != null) { - maskedSrc = maskedSrc.slice(0, match.index) + '[' + repeatString('a', match[0].length - 2) + ']' + maskedSrc.slice(this.tokenizer.rules.inline.blockSkip.lastIndex); - } - - // Mask out escaped em & strong delimiters - while ((match = this.tokenizer.rules.inline.escapedEmSt.exec(maskedSrc)) != null) { - maskedSrc = maskedSrc.slice(0, match.index + match[0].length - 2) + '++' + maskedSrc.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex); - this.tokenizer.rules.inline.escapedEmSt.lastIndex--; - } - - while (src) { - if (!keepPrevChar) { - prevChar = ''; - } - keepPrevChar = false; - - // extensions - if (this.options.extensions - && this.options.extensions.inline - && this.options.extensions.inline.some((extTokenizer) => { - if (token = extTokenizer.call({ lexer: this }, src, tokens)) { - src = src.substring(token.raw.length); - tokens.push(token); - return true; - } - return false; - })) { - continue; - } - - // escape - if (token = this.tokenizer.escape(src)) { - src = src.substring(token.raw.length); - tokens.push(token); - continue; - } - - // tag - if (token = this.tokenizer.tag(src)) { - src = src.substring(token.raw.length); - lastToken = tokens[tokens.length - 1]; - if (lastToken && token.type === 'text' && lastToken.type === 'text') { - lastToken.raw += token.raw; - lastToken.text += token.text; - } else { - tokens.push(token); - } - continue; - } - - // link - if (token = this.tokenizer.link(src)) { - src = src.substring(token.raw.length); - tokens.push(token); - continue; - } - - // reflink, nolink - if (token = this.tokenizer.reflink(src, this.tokens.links)) { - src = src.substring(token.raw.length); - lastToken = tokens[tokens.length - 1]; - if (lastToken && token.type === 'text' && lastToken.type === 'text') { - lastToken.raw += token.raw; - lastToken.text += token.text; - } else { - tokens.push(token); - } - continue; - } - - // em & strong - if (token = this.tokenizer.emStrong(src, maskedSrc, prevChar)) { - src = src.substring(token.raw.length); - tokens.push(token); - continue; - } - - // code - if (token = this.tokenizer.codespan(src)) { - src = src.substring(token.raw.length); - tokens.push(token); - continue; - } - - // br - if (token = this.tokenizer.br(src)) { - src = src.substring(token.raw.length); - tokens.push(token); - continue; - } - - // del (gfm) - if (token = this.tokenizer.del(src)) { - src = src.substring(token.raw.length); - tokens.push(token); - continue; - } - - // autolink - if (token = this.tokenizer.autolink(src, mangle)) { - src = src.substring(token.raw.length); - tokens.push(token); - continue; - } - - // url (gfm) - if (!this.state.inLink && (token = this.tokenizer.url(src, mangle))) { - src = src.substring(token.raw.length); - tokens.push(token); - continue; - } - - // text - // prevent inlineText consuming extensions by clipping 'src' to extension start - cutSrc = src; - if (this.options.extensions && this.options.extensions.startInline) { - let startIndex = Infinity; - const tempSrc = src.slice(1); - let tempStart; - this.options.extensions.startInline.forEach(function(getStartIndex) { - tempStart = getStartIndex.call({ lexer: this }, tempSrc); - if (typeof tempStart === 'number' && tempStart >= 0) { startIndex = Math.min(startIndex, tempStart); } - }); - if (startIndex < Infinity && startIndex >= 0) { - cutSrc = src.substring(0, startIndex + 1); - } - } - if (token = this.tokenizer.inlineText(cutSrc, smartypants)) { - src = src.substring(token.raw.length); - if (token.raw.slice(-1) !== '_') { // Track prevChar before string of ____ started - prevChar = token.raw.slice(-1); - } - keepPrevChar = true; - lastToken = tokens[tokens.length - 1]; - if (lastToken && lastToken.type === 'text') { - lastToken.raw += token.raw; - lastToken.text += token.text; - } else { - tokens.push(token); - } - continue; - } - - if (src) { - const errMsg = 'Infinite loop on byte: ' + src.charCodeAt(0); - if (this.options.silent) { - console.error(errMsg); - break; - } else { - throw new Error(errMsg); - } - } - } - - return tokens; - } -} - -/** - * Renderer - */ -class Renderer { - constructor(options) { - this.options = options || defaults; - } - - code(code, infostring, escaped) { - const lang = (infostring || '').match(/\S*/)[0]; - if (this.options.highlight) { - const out = this.options.highlight(code, lang); - if (out != null && out !== code) { - escaped = true; - code = out; - } - } - - code = code.replace(/\n$/, '') + '\n'; - - if (!lang) { - return '
    '
    -        + (escaped ? code : escape(code, true))
    -        + '
    \n'; - } - - return '
    '
    -      + (escaped ? code : escape(code, true))
    -      + '
    \n'; - } - - /** - * @param {string} quote - */ - blockquote(quote) { - return `
    \n${quote}
    \n`; - } - - html(html) { - return html; - } - - /** - * @param {string} text - * @param {string} level - * @param {string} raw - * @param {any} slugger - */ - heading(text, level, raw, slugger) { - if (this.options.headerIds) { - const id = this.options.headerPrefix + slugger.slug(raw); - return `${text}\n`; - } - - // ignore IDs - return `${text}\n`; - } - - hr() { - return this.options.xhtml ? '
    \n' : '
    \n'; - } - - list(body, ordered, start) { - const type = ordered ? 'ol' : 'ul', - startatt = (ordered && start !== 1) ? (' start="' + start + '"') : ''; - return '<' + type + startatt + '>\n' + body + '\n'; - } - - /** - * @param {string} text - */ - listitem(text) { - return `
  • ${text}
  • \n`; - } - - checkbox(checked) { - return ' '; - } - - /** - * @param {string} text - */ - paragraph(text) { - return `

    ${text}

    \n`; - } - - /** - * @param {string} header - * @param {string} body - */ - table(header, body) { - if (body) body = `${body}`; - - return '\n' - + '\n' - + header - + '\n' - + body - + '
    \n'; - } - - /** - * @param {string} content - */ - tablerow(content) { - return `\n${content}\n`; - } - - tablecell(content, flags) { - const type = flags.header ? 'th' : 'td'; - const tag = flags.align - ? `<${type} align="${flags.align}">` - : `<${type}>`; - return tag + content + `\n`; - } - - /** - * span level renderer - * @param {string} text - */ - strong(text) { - return `${text}`; - } - - /** - * @param {string} text - */ - em(text) { - return `${text}`; - } - - /** - * @param {string} text - */ - codespan(text) { - return `${text}`; - } - - br() { - return this.options.xhtml ? '
    ' : '
    '; - } - - /** - * @param {string} text - */ - del(text) { - return `${text}`; - } - - /** - * @param {string} href - * @param {string} title - * @param {string} text - */ - link(href, title, text) { - href = cleanUrl(this.options.sanitize, this.options.baseUrl, href); - if (href === null) { - return text; - } - let out = '
    '; - return out; - } - - /** - * @param {string} href - * @param {string} title - * @param {string} text - */ - image(href, title, text) { - href = cleanUrl(this.options.sanitize, this.options.baseUrl, href); - if (href === null) { - return text; - } - - let out = `${text}' : '>'; - return out; - } - - text(text) { - return text; - } -} - -/** - * TextRenderer - * returns only the textual part of the token - */ -class TextRenderer { - // no need for block level renderers - strong(text) { - return text; - } - - em(text) { - return text; - } - - codespan(text) { - return text; - } - - del(text) { - return text; - } - - html(text) { - return text; - } - - text(text) { - return text; - } - - link(href, title, text) { - return '' + text; - } - - image(href, title, text) { - return '' + text; - } - - br() { - return ''; - } -} - -/** - * Slugger generates header id - */ -class Slugger { - constructor() { - this.seen = {}; - } - - /** - * @param {string} value - */ - serialize(value) { - return value - .toLowerCase() - .trim() - // remove html tags - .replace(/<[!\/a-z].*?>/ig, '') - // remove unwanted chars - .replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g, '') - .replace(/\s/g, '-'); - } - - /** - * Finds the next safe (unique) slug to use - * @param {string} originalSlug - * @param {boolean} isDryRun - */ - getNextSafeSlug(originalSlug, isDryRun) { - let slug = originalSlug; - let occurenceAccumulator = 0; - if (this.seen.hasOwnProperty(slug)) { - occurenceAccumulator = this.seen[originalSlug]; - do { - occurenceAccumulator++; - slug = originalSlug + '-' + occurenceAccumulator; - } while (this.seen.hasOwnProperty(slug)); - } - if (!isDryRun) { - this.seen[originalSlug] = occurenceAccumulator; - this.seen[slug] = 0; - } - return slug; - } - - /** - * Convert string to unique id - * @param {object} [options] - * @param {boolean} [options.dryrun] Generates the next unique slug without - * updating the internal accumulator. - */ - slug(value, options = {}) { - const slug = this.serialize(value); - return this.getNextSafeSlug(slug, options.dryrun); - } -} - -/** - * Parsing & Compiling - */ -class Parser { - constructor(options) { - this.options = options || defaults; - this.options.renderer = this.options.renderer || new Renderer(); - this.renderer = this.options.renderer; - this.renderer.options = this.options; - this.textRenderer = new TextRenderer(); - this.slugger = new Slugger(); - } - - /** - * Static Parse Method - */ - static parse(tokens, options) { - const parser = new Parser(options); - return parser.parse(tokens); - } - - /** - * Static Parse Inline Method - */ - static parseInline(tokens, options) { - const parser = new Parser(options); - return parser.parseInline(tokens); - } - - /** - * Parse Loop - */ - parse(tokens, top = true) { - let out = '', - i, - j, - k, - l2, - l3, - row, - cell, - header, - body, - token, - ordered, - start, - loose, - itemBody, - item, - checked, - task, - checkbox, - ret; - - const l = tokens.length; - for (i = 0; i < l; i++) { - token = tokens[i]; - - // Run any renderer extensions - if (this.options.extensions && this.options.extensions.renderers && this.options.extensions.renderers[token.type]) { - ret = this.options.extensions.renderers[token.type].call({ parser: this }, token); - if (ret !== false || !['space', 'hr', 'heading', 'code', 'table', 'blockquote', 'list', 'html', 'paragraph', 'text'].includes(token.type)) { - out += ret || ''; - continue; - } - } - - switch (token.type) { - case 'space': { - continue; - } - case 'hr': { - out += this.renderer.hr(); - continue; - } - case 'heading': { - out += this.renderer.heading( - this.parseInline(token.tokens), - token.depth, - unescape(this.parseInline(token.tokens, this.textRenderer)), - this.slugger); - continue; - } - case 'code': { - out += this.renderer.code(token.text, - token.lang, - token.escaped); - continue; - } - case 'table': { - header = ''; - - // header - cell = ''; - l2 = token.header.length; - for (j = 0; j < l2; j++) { - cell += this.renderer.tablecell( - this.parseInline(token.header[j].tokens), - { header: true, align: token.align[j] } - ); - } - header += this.renderer.tablerow(cell); - - body = ''; - l2 = token.rows.length; - for (j = 0; j < l2; j++) { - row = token.rows[j]; - - cell = ''; - l3 = row.length; - for (k = 0; k < l3; k++) { - cell += this.renderer.tablecell( - this.parseInline(row[k].tokens), - { header: false, align: token.align[k] } - ); - } - - body += this.renderer.tablerow(cell); - } - out += this.renderer.table(header, body); - continue; - } - case 'blockquote': { - body = this.parse(token.tokens); - out += this.renderer.blockquote(body); - continue; - } - case 'list': { - ordered = token.ordered; - start = token.start; - loose = token.loose; - l2 = token.items.length; - - body = ''; - for (j = 0; j < l2; j++) { - item = token.items[j]; - checked = item.checked; - task = item.task; - - itemBody = ''; - if (item.task) { - checkbox = this.renderer.checkbox(checked); - if (loose) { - if (item.tokens.length > 0 && item.tokens[0].type === 'paragraph') { - item.tokens[0].text = checkbox + ' ' + item.tokens[0].text; - if (item.tokens[0].tokens && item.tokens[0].tokens.length > 0 && item.tokens[0].tokens[0].type === 'text') { - item.tokens[0].tokens[0].text = checkbox + ' ' + item.tokens[0].tokens[0].text; - } - } else { - item.tokens.unshift({ - type: 'text', - text: checkbox - }); - } - } else { - itemBody += checkbox; - } - } - - itemBody += this.parse(item.tokens, loose); - body += this.renderer.listitem(itemBody, task, checked); - } - - out += this.renderer.list(body, ordered, start); - continue; - } - case 'html': { - // TODO parse inline content if parameter markdown=1 - out += this.renderer.html(token.text); - continue; - } - case 'paragraph': { - out += this.renderer.paragraph(this.parseInline(token.tokens)); - continue; - } - case 'text': { - body = token.tokens ? this.parseInline(token.tokens) : token.text; - while (i + 1 < l && tokens[i + 1].type === 'text') { - token = tokens[++i]; - body += '\n' + (token.tokens ? this.parseInline(token.tokens) : token.text); - } - out += top ? this.renderer.paragraph(body) : body; - continue; - } - - default: { - const errMsg = 'Token with "' + token.type + '" type was not found.'; - if (this.options.silent) { - console.error(errMsg); - return; - } else { - throw new Error(errMsg); - } - } - } - } - - return out; - } - - /** - * Parse Inline Tokens - */ - parseInline(tokens, renderer) { - renderer = renderer || this.renderer; - let out = '', - i, - token, - ret; - - const l = tokens.length; - for (i = 0; i < l; i++) { - token = tokens[i]; - - // Run any renderer extensions - if (this.options.extensions && this.options.extensions.renderers && this.options.extensions.renderers[token.type]) { - ret = this.options.extensions.renderers[token.type].call({ parser: this }, token); - if (ret !== false || !['escape', 'html', 'link', 'image', 'strong', 'em', 'codespan', 'br', 'del', 'text'].includes(token.type)) { - out += ret || ''; - continue; - } - } - - switch (token.type) { - case 'escape': { - out += renderer.text(token.text); - break; - } - case 'html': { - out += renderer.html(token.text); - break; - } - case 'link': { - out += renderer.link(token.href, token.title, this.parseInline(token.tokens, renderer)); - break; - } - case 'image': { - out += renderer.image(token.href, token.title, token.text); - break; - } - case 'strong': { - out += renderer.strong(this.parseInline(token.tokens, renderer)); - break; - } - case 'em': { - out += renderer.em(this.parseInline(token.tokens, renderer)); - break; - } - case 'codespan': { - out += renderer.codespan(token.text); - break; - } - case 'br': { - out += renderer.br(); - break; - } - case 'del': { - out += renderer.del(this.parseInline(token.tokens, renderer)); - break; - } - case 'text': { - out += renderer.text(token.text); - break; - } - default: { - const errMsg = 'Token with "' + token.type + '" type was not found.'; - if (this.options.silent) { - console.error(errMsg); - return; - } else { - throw new Error(errMsg); - } - } - } - } - return out; - } -} - -/** - * Marked - */ -function marked(src, opt, callback) { - // throw error in case of non string input - if (typeof src === 'undefined' || src === null) { - throw new Error('marked(): input parameter is undefined or null'); - } - if (typeof src !== 'string') { - throw new Error('marked(): input parameter is of type ' - + Object.prototype.toString.call(src) + ', string expected'); - } - - if (typeof opt === 'function') { - callback = opt; - opt = null; - } - - opt = merge({}, marked.defaults, opt || {}); - checkSanitizeDeprecation(opt); - - if (callback) { - const highlight = opt.highlight; - let tokens; - - try { - tokens = Lexer.lex(src, opt); - } catch (e) { - return callback(e); - } - - const done = function(err) { - let out; - - if (!err) { - try { - if (opt.walkTokens) { - marked.walkTokens(tokens, opt.walkTokens); - } - out = Parser.parse(tokens, opt); - } catch (e) { - err = e; - } - } - - opt.highlight = highlight; - - return err - ? callback(err) - : callback(null, out); - }; - - if (!highlight || highlight.length < 3) { - return done(); - } - - delete opt.highlight; - - if (!tokens.length) return done(); - - let pending = 0; - marked.walkTokens(tokens, function(token) { - if (token.type === 'code') { - pending++; - setTimeout(() => { - highlight(token.text, token.lang, function(err, code) { - if (err) { - return done(err); - } - if (code != null && code !== token.text) { - token.text = code; - token.escaped = true; - } - - pending--; - if (pending === 0) { - done(); - } - }); - }, 0); - } - }); - - if (pending === 0) { - done(); - } - - return; - } - - function onError(e) { - e.message += '\nPlease report this to https://github.com/markedjs/marked.'; - if (opt.silent) { - return '

    An error occurred:

    '
    -        + escape(e.message + '', true)
    -        + '
    '; - } - throw e; - } - - try { - const tokens = Lexer.lex(src, opt); - if (opt.walkTokens) { - if (opt.async) { - return Promise.all(marked.walkTokens(tokens, opt.walkTokens)) - .then(() => { - return Parser.parse(tokens, opt); - }) - .catch(onError); - } - marked.walkTokens(tokens, opt.walkTokens); - } - return Parser.parse(tokens, opt); - } catch (e) { - onError(e); - } -} - -/** - * Options - */ - -marked.options = -marked.setOptions = function(opt) { - merge(marked.defaults, opt); - changeDefaults(marked.defaults); - return marked; -}; - -marked.getDefaults = getDefaults; - -marked.defaults = defaults; - -/** - * Use Extension - */ - -marked.use = function(...args) { - const extensions = marked.defaults.extensions || { renderers: {}, childTokens: {} }; - - args.forEach((pack) => { - // copy options to new object - const opts = merge({}, pack); - - // set async to true if it was set to true before - opts.async = marked.defaults.async || opts.async; - - // ==-- Parse "addon" extensions --== // - if (pack.extensions) { - pack.extensions.forEach((ext) => { - if (!ext.name) { - throw new Error('extension name required'); - } - if (ext.renderer) { // Renderer extensions - const prevRenderer = extensions.renderers[ext.name]; - if (prevRenderer) { - // Replace extension with func to run new extension but fall back if false - extensions.renderers[ext.name] = function(...args) { - let ret = ext.renderer.apply(this, args); - if (ret === false) { - ret = prevRenderer.apply(this, args); - } - return ret; - }; - } else { - extensions.renderers[ext.name] = ext.renderer; - } - } - if (ext.tokenizer) { // Tokenizer Extensions - if (!ext.level || (ext.level !== 'block' && ext.level !== 'inline')) { - throw new Error("extension level must be 'block' or 'inline'"); - } - if (extensions[ext.level]) { - extensions[ext.level].unshift(ext.tokenizer); - } else { - extensions[ext.level] = [ext.tokenizer]; - } - if (ext.start) { // Function to check for start of token - if (ext.level === 'block') { - if (extensions.startBlock) { - extensions.startBlock.push(ext.start); - } else { - extensions.startBlock = [ext.start]; - } - } else if (ext.level === 'inline') { - if (extensions.startInline) { - extensions.startInline.push(ext.start); - } else { - extensions.startInline = [ext.start]; - } - } - } - } - if (ext.childTokens) { // Child tokens to be visited by walkTokens - extensions.childTokens[ext.name] = ext.childTokens; - } - }); - opts.extensions = extensions; - } - - // ==-- Parse "overwrite" extensions --== // - if (pack.renderer) { - const renderer = marked.defaults.renderer || new Renderer(); - for (const prop in pack.renderer) { - const prevRenderer = renderer[prop]; - // Replace renderer with func to run extension, but fall back if false - renderer[prop] = (...args) => { - let ret = pack.renderer[prop].apply(renderer, args); - if (ret === false) { - ret = prevRenderer.apply(renderer, args); - } - return ret; - }; - } - opts.renderer = renderer; - } - if (pack.tokenizer) { - const tokenizer = marked.defaults.tokenizer || new Tokenizer(); - for (const prop in pack.tokenizer) { - const prevTokenizer = tokenizer[prop]; - // Replace tokenizer with func to run extension, but fall back if false - tokenizer[prop] = (...args) => { - let ret = pack.tokenizer[prop].apply(tokenizer, args); - if (ret === false) { - ret = prevTokenizer.apply(tokenizer, args); - } - return ret; - }; - } - opts.tokenizer = tokenizer; - } - - // ==-- Parse WalkTokens extensions --== // - if (pack.walkTokens) { - const walkTokens = marked.defaults.walkTokens; - opts.walkTokens = function(token) { - let values = []; - values.push(pack.walkTokens.call(this, token)); - if (walkTokens) { - values = values.concat(walkTokens.call(this, token)); - } - return values; - }; - } - - marked.setOptions(opts); - }); -}; - -/** - * Run callback for every token - */ - -marked.walkTokens = function(tokens, callback) { - let values = []; - for (const token of tokens) { - values = values.concat(callback.call(marked, token)); - switch (token.type) { - case 'table': { - for (const cell of token.header) { - values = values.concat(marked.walkTokens(cell.tokens, callback)); - } - for (const row of token.rows) { - for (const cell of row) { - values = values.concat(marked.walkTokens(cell.tokens, callback)); - } - } - break; - } - case 'list': { - values = values.concat(marked.walkTokens(token.items, callback)); - break; - } - default: { - if (marked.defaults.extensions && marked.defaults.extensions.childTokens && marked.defaults.extensions.childTokens[token.type]) { // Walk any extensions - marked.defaults.extensions.childTokens[token.type].forEach(function(childTokens) { - values = values.concat(marked.walkTokens(token[childTokens], callback)); - }); - } else if (token.tokens) { - values = values.concat(marked.walkTokens(token.tokens, callback)); - } - } - } - } - return values; -}; - -/** - * Parse Inline - * @param {string} src - */ -marked.parseInline = function(src, opt) { - // throw error in case of non string input - if (typeof src === 'undefined' || src === null) { - throw new Error('marked.parseInline(): input parameter is undefined or null'); - } - if (typeof src !== 'string') { - throw new Error('marked.parseInline(): input parameter is of type ' - + Object.prototype.toString.call(src) + ', string expected'); - } - - opt = merge({}, marked.defaults, opt || {}); - checkSanitizeDeprecation(opt); - - try { - const tokens = Lexer.lexInline(src, opt); - if (opt.walkTokens) { - marked.walkTokens(tokens, opt.walkTokens); - } - return Parser.parseInline(tokens, opt); - } catch (e) { - e.message += '\nPlease report this to https://github.com/markedjs/marked.'; - if (opt.silent) { - return '

    An error occurred:

    '
    -        + escape(e.message + '', true)
    -        + '
    '; - } - throw e; - } -}; - -/** - * Expose - */ -marked.Parser = Parser; -marked.parser = Parser.parse; -marked.Renderer = Renderer; -marked.TextRenderer = TextRenderer; -marked.Lexer = Lexer; -marked.lexer = Lexer.lex; -marked.Tokenizer = Tokenizer; -marked.Slugger = Slugger; -marked.parse = marked; - -const options = marked.options; -const setOptions = marked.setOptions; -const use = marked.use; -const walkTokens = marked.walkTokens; -const parseInline = marked.parseInline; -const parse = marked; -const parser = Parser.parse; -const lexer = Lexer.lex; - -export { Lexer, Parser, Renderer, Slugger, TextRenderer, Tokenizer, defaults, getDefaults, lexer, marked, options, parse, parseInline, parser, setOptions, use, walkTokens }; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/marked/lib/marked.umd.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/marked/lib/marked.umd.js deleted file mode 100644 index f50f6a02..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/marked/lib/marked.umd.js +++ /dev/null @@ -1,2698 +0,0 @@ -/** - * marked - a markdown parser - * Copyright (c) 2011-2022, Christopher Jeffrey. (MIT Licensed) - * https://github.com/markedjs/marked - */ - -/** - * DO NOT EDIT THIS FILE - * The code in this file is generated from files in ./src/ - */ - -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : - typeof define === 'function' && define.amd ? define(['exports'], factory) : - (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.marked = {})); -})(this, (function (exports) { 'use strict'; - - function _defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } - } - function _createClass(Constructor, protoProps, staticProps) { - if (protoProps) _defineProperties(Constructor.prototype, protoProps); - if (staticProps) _defineProperties(Constructor, staticProps); - Object.defineProperty(Constructor, "prototype", { - writable: false - }); - return Constructor; - } - function _unsupportedIterableToArray(o, minLen) { - if (!o) return; - if (typeof o === "string") return _arrayLikeToArray(o, minLen); - var n = Object.prototype.toString.call(o).slice(8, -1); - if (n === "Object" && o.constructor) n = o.constructor.name; - if (n === "Map" || n === "Set") return Array.from(o); - if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); - } - function _arrayLikeToArray(arr, len) { - if (len == null || len > arr.length) len = arr.length; - for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; - return arr2; - } - function _createForOfIteratorHelperLoose(o, allowArrayLike) { - var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; - if (it) return (it = it.call(o)).next.bind(it); - if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { - if (it) o = it; - var i = 0; - return function () { - if (i >= o.length) return { - done: true - }; - return { - done: false, - value: o[i++] - }; - }; - } - throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); - } - - function getDefaults() { - return { - async: false, - baseUrl: null, - breaks: false, - extensions: null, - gfm: true, - headerIds: true, - headerPrefix: '', - highlight: null, - langPrefix: 'language-', - mangle: true, - pedantic: false, - renderer: null, - sanitize: false, - sanitizer: null, - silent: false, - smartypants: false, - tokenizer: null, - walkTokens: null, - xhtml: false - }; - } - exports.defaults = getDefaults(); - function changeDefaults(newDefaults) { - exports.defaults = newDefaults; - } - - /** - * Helpers - */ - var escapeTest = /[&<>"']/; - var escapeReplace = new RegExp(escapeTest.source, 'g'); - var escapeTestNoEncode = /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/; - var escapeReplaceNoEncode = new RegExp(escapeTestNoEncode.source, 'g'); - var escapeReplacements = { - '&': '&', - '<': '<', - '>': '>', - '"': '"', - "'": ''' - }; - var getEscapeReplacement = function getEscapeReplacement(ch) { - return escapeReplacements[ch]; - }; - function escape(html, encode) { - if (encode) { - if (escapeTest.test(html)) { - return html.replace(escapeReplace, getEscapeReplacement); - } - } else { - if (escapeTestNoEncode.test(html)) { - return html.replace(escapeReplaceNoEncode, getEscapeReplacement); - } - } - return html; - } - var unescapeTest = /&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig; - - /** - * @param {string} html - */ - function unescape(html) { - // explicitly match decimal, hex, and named HTML entities - return html.replace(unescapeTest, function (_, n) { - n = n.toLowerCase(); - if (n === 'colon') return ':'; - if (n.charAt(0) === '#') { - return n.charAt(1) === 'x' ? String.fromCharCode(parseInt(n.substring(2), 16)) : String.fromCharCode(+n.substring(1)); - } - return ''; - }); - } - var caret = /(^|[^\[])\^/g; - - /** - * @param {string | RegExp} regex - * @param {string} opt - */ - function edit(regex, opt) { - regex = typeof regex === 'string' ? regex : regex.source; - opt = opt || ''; - var obj = { - replace: function replace(name, val) { - val = val.source || val; - val = val.replace(caret, '$1'); - regex = regex.replace(name, val); - return obj; - }, - getRegex: function getRegex() { - return new RegExp(regex, opt); - } - }; - return obj; - } - var nonWordAndColonTest = /[^\w:]/g; - var originIndependentUrl = /^$|^[a-z][a-z0-9+.-]*:|^[?#]/i; - - /** - * @param {boolean} sanitize - * @param {string} base - * @param {string} href - */ - function cleanUrl(sanitize, base, href) { - if (sanitize) { - var prot; - try { - prot = decodeURIComponent(unescape(href)).replace(nonWordAndColonTest, '').toLowerCase(); - } catch (e) { - return null; - } - if (prot.indexOf('javascript:') === 0 || prot.indexOf('vbscript:') === 0 || prot.indexOf('data:') === 0) { - return null; - } - } - if (base && !originIndependentUrl.test(href)) { - href = resolveUrl(base, href); - } - try { - href = encodeURI(href).replace(/%25/g, '%'); - } catch (e) { - return null; - } - return href; - } - var baseUrls = {}; - var justDomain = /^[^:]+:\/*[^/]*$/; - var protocol = /^([^:]+:)[\s\S]*$/; - var domain = /^([^:]+:\/*[^/]*)[\s\S]*$/; - - /** - * @param {string} base - * @param {string} href - */ - function resolveUrl(base, href) { - if (!baseUrls[' ' + base]) { - // we can ignore everything in base after the last slash of its path component, - // but we might need to add _that_ - // https://tools.ietf.org/html/rfc3986#section-3 - if (justDomain.test(base)) { - baseUrls[' ' + base] = base + '/'; - } else { - baseUrls[' ' + base] = rtrim(base, '/', true); - } - } - base = baseUrls[' ' + base]; - var relativeBase = base.indexOf(':') === -1; - if (href.substring(0, 2) === '//') { - if (relativeBase) { - return href; - } - return base.replace(protocol, '$1') + href; - } else if (href.charAt(0) === '/') { - if (relativeBase) { - return href; - } - return base.replace(domain, '$1') + href; - } else { - return base + href; - } - } - var noopTest = { - exec: function noopTest() {} - }; - function merge(obj) { - var i = 1, - target, - key; - for (; i < arguments.length; i++) { - target = arguments[i]; - for (key in target) { - if (Object.prototype.hasOwnProperty.call(target, key)) { - obj[key] = target[key]; - } - } - } - return obj; - } - function splitCells(tableRow, count) { - // ensure that every cell-delimiting pipe has a space - // before it to distinguish it from an escaped pipe - var row = tableRow.replace(/\|/g, function (match, offset, str) { - var escaped = false, - curr = offset; - while (--curr >= 0 && str[curr] === '\\') { - escaped = !escaped; - } - if (escaped) { - // odd number of slashes means | is escaped - // so we leave it alone - return '|'; - } else { - // add space before unescaped | - return ' |'; - } - }), - cells = row.split(/ \|/); - var i = 0; - - // First/last cell in a row cannot be empty if it has no leading/trailing pipe - if (!cells[0].trim()) { - cells.shift(); - } - if (cells.length > 0 && !cells[cells.length - 1].trim()) { - cells.pop(); - } - if (cells.length > count) { - cells.splice(count); - } else { - while (cells.length < count) { - cells.push(''); - } - } - for (; i < cells.length; i++) { - // leading or trailing whitespace is ignored per the gfm spec - cells[i] = cells[i].trim().replace(/\\\|/g, '|'); - } - return cells; - } - - /** - * Remove trailing 'c's. Equivalent to str.replace(/c*$/, ''). - * /c*$/ is vulnerable to REDOS. - * - * @param {string} str - * @param {string} c - * @param {boolean} invert Remove suffix of non-c chars instead. Default falsey. - */ - function rtrim(str, c, invert) { - var l = str.length; - if (l === 0) { - return ''; - } - - // Length of suffix matching the invert condition. - var suffLen = 0; - - // Step left until we fail to match the invert condition. - while (suffLen < l) { - var currChar = str.charAt(l - suffLen - 1); - if (currChar === c && !invert) { - suffLen++; - } else if (currChar !== c && invert) { - suffLen++; - } else { - break; - } - } - return str.slice(0, l - suffLen); - } - function findClosingBracket(str, b) { - if (str.indexOf(b[1]) === -1) { - return -1; - } - var l = str.length; - var level = 0, - i = 0; - for (; i < l; i++) { - if (str[i] === '\\') { - i++; - } else if (str[i] === b[0]) { - level++; - } else if (str[i] === b[1]) { - level--; - if (level < 0) { - return i; - } - } - } - return -1; - } - function checkSanitizeDeprecation(opt) { - if (opt && opt.sanitize && !opt.silent) { - console.warn('marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options'); - } - } - - // copied from https://stackoverflow.com/a/5450113/806777 - /** - * @param {string} pattern - * @param {number} count - */ - function repeatString(pattern, count) { - if (count < 1) { - return ''; - } - var result = ''; - while (count > 1) { - if (count & 1) { - result += pattern; - } - count >>= 1; - pattern += pattern; - } - return result + pattern; - } - - function outputLink(cap, link, raw, lexer) { - var href = link.href; - var title = link.title ? escape(link.title) : null; - var text = cap[1].replace(/\\([\[\]])/g, '$1'); - if (cap[0].charAt(0) !== '!') { - lexer.state.inLink = true; - var token = { - type: 'link', - raw: raw, - href: href, - title: title, - text: text, - tokens: lexer.inlineTokens(text) - }; - lexer.state.inLink = false; - return token; - } - return { - type: 'image', - raw: raw, - href: href, - title: title, - text: escape(text) - }; - } - function indentCodeCompensation(raw, text) { - var matchIndentToCode = raw.match(/^(\s+)(?:```)/); - if (matchIndentToCode === null) { - return text; - } - var indentToCode = matchIndentToCode[1]; - return text.split('\n').map(function (node) { - var matchIndentInNode = node.match(/^\s+/); - if (matchIndentInNode === null) { - return node; - } - var indentInNode = matchIndentInNode[0]; - if (indentInNode.length >= indentToCode.length) { - return node.slice(indentToCode.length); - } - return node; - }).join('\n'); - } - - /** - * Tokenizer - */ - var Tokenizer = /*#__PURE__*/function () { - function Tokenizer(options) { - this.options = options || exports.defaults; - } - var _proto = Tokenizer.prototype; - _proto.space = function space(src) { - var cap = this.rules.block.newline.exec(src); - if (cap && cap[0].length > 0) { - return { - type: 'space', - raw: cap[0] - }; - } - }; - _proto.code = function code(src) { - var cap = this.rules.block.code.exec(src); - if (cap) { - var text = cap[0].replace(/^ {1,4}/gm, ''); - return { - type: 'code', - raw: cap[0], - codeBlockStyle: 'indented', - text: !this.options.pedantic ? rtrim(text, '\n') : text - }; - } - }; - _proto.fences = function fences(src) { - var cap = this.rules.block.fences.exec(src); - if (cap) { - var raw = cap[0]; - var text = indentCodeCompensation(raw, cap[3] || ''); - return { - type: 'code', - raw: raw, - lang: cap[2] ? cap[2].trim().replace(this.rules.inline._escapes, '$1') : cap[2], - text: text - }; - } - }; - _proto.heading = function heading(src) { - var cap = this.rules.block.heading.exec(src); - if (cap) { - var text = cap[2].trim(); - - // remove trailing #s - if (/#$/.test(text)) { - var trimmed = rtrim(text, '#'); - if (this.options.pedantic) { - text = trimmed.trim(); - } else if (!trimmed || / $/.test(trimmed)) { - // CommonMark requires space before trailing #s - text = trimmed.trim(); - } - } - return { - type: 'heading', - raw: cap[0], - depth: cap[1].length, - text: text, - tokens: this.lexer.inline(text) - }; - } - }; - _proto.hr = function hr(src) { - var cap = this.rules.block.hr.exec(src); - if (cap) { - return { - type: 'hr', - raw: cap[0] - }; - } - }; - _proto.blockquote = function blockquote(src) { - var cap = this.rules.block.blockquote.exec(src); - if (cap) { - var text = cap[0].replace(/^ *>[ \t]?/gm, ''); - return { - type: 'blockquote', - raw: cap[0], - tokens: this.lexer.blockTokens(text, []), - text: text - }; - } - }; - _proto.list = function list(src) { - var cap = this.rules.block.list.exec(src); - if (cap) { - var raw, istask, ischecked, indent, i, blankLine, endsWithBlankLine, line, nextLine, rawLine, itemContents, endEarly; - var bull = cap[1].trim(); - var isordered = bull.length > 1; - var list = { - type: 'list', - raw: '', - ordered: isordered, - start: isordered ? +bull.slice(0, -1) : '', - loose: false, - items: [] - }; - bull = isordered ? "\\d{1,9}\\" + bull.slice(-1) : "\\" + bull; - if (this.options.pedantic) { - bull = isordered ? bull : '[*+-]'; - } - - // Get next list item - var itemRegex = new RegExp("^( {0,3}" + bull + ")((?:[\t ][^\\n]*)?(?:\\n|$))"); - - // Check if current bullet point can start a new List Item - while (src) { - endEarly = false; - if (!(cap = itemRegex.exec(src))) { - break; - } - if (this.rules.block.hr.test(src)) { - // End list if bullet was actually HR (possibly move into itemRegex?) - break; - } - raw = cap[0]; - src = src.substring(raw.length); - line = cap[2].split('\n', 1)[0]; - nextLine = src.split('\n', 1)[0]; - if (this.options.pedantic) { - indent = 2; - itemContents = line.trimLeft(); - } else { - indent = cap[2].search(/[^ ]/); // Find first non-space char - indent = indent > 4 ? 1 : indent; // Treat indented code blocks (> 4 spaces) as having only 1 indent - itemContents = line.slice(indent); - indent += cap[1].length; - } - blankLine = false; - if (!line && /^ *$/.test(nextLine)) { - // Items begin with at most one blank line - raw += nextLine + '\n'; - src = src.substring(nextLine.length + 1); - endEarly = true; - } - if (!endEarly) { - var nextBulletRegex = new RegExp("^ {0," + Math.min(3, indent - 1) + "}(?:[*+-]|\\d{1,9}[.)])((?: [^\\n]*)?(?:\\n|$))"); - var hrRegex = new RegExp("^ {0," + Math.min(3, indent - 1) + "}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)"); - var fencesBeginRegex = new RegExp("^ {0," + Math.min(3, indent - 1) + "}(?:```|~~~)"); - var headingBeginRegex = new RegExp("^ {0," + Math.min(3, indent - 1) + "}#"); - - // Check if following lines should be included in List Item - while (src) { - rawLine = src.split('\n', 1)[0]; - line = rawLine; - - // Re-align to follow commonmark nesting rules - if (this.options.pedantic) { - line = line.replace(/^ {1,4}(?=( {4})*[^ ])/g, ' '); - } - - // End list item if found code fences - if (fencesBeginRegex.test(line)) { - break; - } - - // End list item if found start of new heading - if (headingBeginRegex.test(line)) { - break; - } - - // End list item if found start of new bullet - if (nextBulletRegex.test(line)) { - break; - } - - // Horizontal rule found - if (hrRegex.test(src)) { - break; - } - if (line.search(/[^ ]/) >= indent || !line.trim()) { - // Dedent if possible - itemContents += '\n' + line.slice(indent); - } else if (!blankLine) { - // Until blank line, item doesn't need indentation - itemContents += '\n' + line; - } else { - // Otherwise, improper indentation ends this item - break; - } - if (!blankLine && !line.trim()) { - // Check if current line is blank - blankLine = true; - } - raw += rawLine + '\n'; - src = src.substring(rawLine.length + 1); - } - } - if (!list.loose) { - // If the previous item ended with a blank line, the list is loose - if (endsWithBlankLine) { - list.loose = true; - } else if (/\n *\n *$/.test(raw)) { - endsWithBlankLine = true; - } - } - - // Check for task list items - if (this.options.gfm) { - istask = /^\[[ xX]\] /.exec(itemContents); - if (istask) { - ischecked = istask[0] !== '[ ] '; - itemContents = itemContents.replace(/^\[[ xX]\] +/, ''); - } - } - list.items.push({ - type: 'list_item', - raw: raw, - task: !!istask, - checked: ischecked, - loose: false, - text: itemContents - }); - list.raw += raw; - } - - // Do not consume newlines at end of final item. Alternatively, make itemRegex *start* with any newlines to simplify/speed up endsWithBlankLine logic - list.items[list.items.length - 1].raw = raw.trimRight(); - list.items[list.items.length - 1].text = itemContents.trimRight(); - list.raw = list.raw.trimRight(); - var l = list.items.length; - - // Item child tokens handled here at end because we needed to have the final item to trim it first - for (i = 0; i < l; i++) { - this.lexer.state.top = false; - list.items[i].tokens = this.lexer.blockTokens(list.items[i].text, []); - var spacers = list.items[i].tokens.filter(function (t) { - return t.type === 'space'; - }); - var hasMultipleLineBreaks = spacers.every(function (t) { - var chars = t.raw.split(''); - var lineBreaks = 0; - for (var _iterator = _createForOfIteratorHelperLoose(chars), _step; !(_step = _iterator()).done;) { - var _char = _step.value; - if (_char === '\n') { - lineBreaks += 1; - } - if (lineBreaks > 1) { - return true; - } - } - return false; - }); - if (!list.loose && spacers.length && hasMultipleLineBreaks) { - // Having a single line break doesn't mean a list is loose. A single line break is terminating the last list item - list.loose = true; - list.items[i].loose = true; - } - } - return list; - } - }; - _proto.html = function html(src) { - var cap = this.rules.block.html.exec(src); - if (cap) { - var token = { - type: 'html', - raw: cap[0], - pre: !this.options.sanitizer && (cap[1] === 'pre' || cap[1] === 'script' || cap[1] === 'style'), - text: cap[0] - }; - if (this.options.sanitize) { - var text = this.options.sanitizer ? this.options.sanitizer(cap[0]) : escape(cap[0]); - token.type = 'paragraph'; - token.text = text; - token.tokens = this.lexer.inline(text); - } - return token; - } - }; - _proto.def = function def(src) { - var cap = this.rules.block.def.exec(src); - if (cap) { - var tag = cap[1].toLowerCase().replace(/\s+/g, ' '); - var href = cap[2] ? cap[2].replace(/^<(.*)>$/, '$1').replace(this.rules.inline._escapes, '$1') : ''; - var title = cap[3] ? cap[3].substring(1, cap[3].length - 1).replace(this.rules.inline._escapes, '$1') : cap[3]; - return { - type: 'def', - tag: tag, - raw: cap[0], - href: href, - title: title - }; - } - }; - _proto.table = function table(src) { - var cap = this.rules.block.table.exec(src); - if (cap) { - var item = { - type: 'table', - header: splitCells(cap[1]).map(function (c) { - return { - text: c - }; - }), - align: cap[2].replace(/^ *|\| *$/g, '').split(/ *\| */), - rows: cap[3] && cap[3].trim() ? cap[3].replace(/\n[ \t]*$/, '').split('\n') : [] - }; - if (item.header.length === item.align.length) { - item.raw = cap[0]; - var l = item.align.length; - var i, j, k, row; - for (i = 0; i < l; i++) { - if (/^ *-+: *$/.test(item.align[i])) { - item.align[i] = 'right'; - } else if (/^ *:-+: *$/.test(item.align[i])) { - item.align[i] = 'center'; - } else if (/^ *:-+ *$/.test(item.align[i])) { - item.align[i] = 'left'; - } else { - item.align[i] = null; - } - } - l = item.rows.length; - for (i = 0; i < l; i++) { - item.rows[i] = splitCells(item.rows[i], item.header.length).map(function (c) { - return { - text: c - }; - }); - } - - // parse child tokens inside headers and cells - - // header child tokens - l = item.header.length; - for (j = 0; j < l; j++) { - item.header[j].tokens = this.lexer.inline(item.header[j].text); - } - - // cell child tokens - l = item.rows.length; - for (j = 0; j < l; j++) { - row = item.rows[j]; - for (k = 0; k < row.length; k++) { - row[k].tokens = this.lexer.inline(row[k].text); - } - } - return item; - } - } - }; - _proto.lheading = function lheading(src) { - var cap = this.rules.block.lheading.exec(src); - if (cap) { - return { - type: 'heading', - raw: cap[0], - depth: cap[2].charAt(0) === '=' ? 1 : 2, - text: cap[1], - tokens: this.lexer.inline(cap[1]) - }; - } - }; - _proto.paragraph = function paragraph(src) { - var cap = this.rules.block.paragraph.exec(src); - if (cap) { - var text = cap[1].charAt(cap[1].length - 1) === '\n' ? cap[1].slice(0, -1) : cap[1]; - return { - type: 'paragraph', - raw: cap[0], - text: text, - tokens: this.lexer.inline(text) - }; - } - }; - _proto.text = function text(src) { - var cap = this.rules.block.text.exec(src); - if (cap) { - return { - type: 'text', - raw: cap[0], - text: cap[0], - tokens: this.lexer.inline(cap[0]) - }; - } - }; - _proto.escape = function escape$1(src) { - var cap = this.rules.inline.escape.exec(src); - if (cap) { - return { - type: 'escape', - raw: cap[0], - text: escape(cap[1]) - }; - } - }; - _proto.tag = function tag(src) { - var cap = this.rules.inline.tag.exec(src); - if (cap) { - if (!this.lexer.state.inLink && /^
    /i.test(cap[0])) { - this.lexer.state.inLink = false; - } - if (!this.lexer.state.inRawBlock && /^<(pre|code|kbd|script)(\s|>)/i.test(cap[0])) { - this.lexer.state.inRawBlock = true; - } else if (this.lexer.state.inRawBlock && /^<\/(pre|code|kbd|script)(\s|>)/i.test(cap[0])) { - this.lexer.state.inRawBlock = false; - } - return { - type: this.options.sanitize ? 'text' : 'html', - raw: cap[0], - inLink: this.lexer.state.inLink, - inRawBlock: this.lexer.state.inRawBlock, - text: this.options.sanitize ? this.options.sanitizer ? this.options.sanitizer(cap[0]) : escape(cap[0]) : cap[0] - }; - } - }; - _proto.link = function link(src) { - var cap = this.rules.inline.link.exec(src); - if (cap) { - var trimmedUrl = cap[2].trim(); - if (!this.options.pedantic && /^$/.test(trimmedUrl)) { - return; - } - - // ending angle bracket cannot be escaped - var rtrimSlash = rtrim(trimmedUrl.slice(0, -1), '\\'); - if ((trimmedUrl.length - rtrimSlash.length) % 2 === 0) { - return; - } - } else { - // find closing parenthesis - var lastParenIndex = findClosingBracket(cap[2], '()'); - if (lastParenIndex > -1) { - var start = cap[0].indexOf('!') === 0 ? 5 : 4; - var linkLen = start + cap[1].length + lastParenIndex; - cap[2] = cap[2].substring(0, lastParenIndex); - cap[0] = cap[0].substring(0, linkLen).trim(); - cap[3] = ''; - } - } - var href = cap[2]; - var title = ''; - if (this.options.pedantic) { - // split pedantic href and title - var link = /^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(href); - if (link) { - href = link[1]; - title = link[3]; - } - } else { - title = cap[3] ? cap[3].slice(1, -1) : ''; - } - href = href.trim(); - if (/^$/.test(trimmedUrl)) { - // pedantic allows starting angle bracket without ending angle bracket - href = href.slice(1); - } else { - href = href.slice(1, -1); - } - } - return outputLink(cap, { - href: href ? href.replace(this.rules.inline._escapes, '$1') : href, - title: title ? title.replace(this.rules.inline._escapes, '$1') : title - }, cap[0], this.lexer); - } - }; - _proto.reflink = function reflink(src, links) { - var cap; - if ((cap = this.rules.inline.reflink.exec(src)) || (cap = this.rules.inline.nolink.exec(src))) { - var link = (cap[2] || cap[1]).replace(/\s+/g, ' '); - link = links[link.toLowerCase()]; - if (!link) { - var text = cap[0].charAt(0); - return { - type: 'text', - raw: text, - text: text - }; - } - return outputLink(cap, link, cap[0], this.lexer); - } - }; - _proto.emStrong = function emStrong(src, maskedSrc, prevChar) { - if (prevChar === void 0) { - prevChar = ''; - } - var match = this.rules.inline.emStrong.lDelim.exec(src); - if (!match) return; - - // _ can't be between two alphanumerics. \p{L}\p{N} includes non-english alphabet/numbers as well - if (match[3] && prevChar.match(/(?:[0-9A-Za-z\xAA\xB2\xB3\xB5\xB9\xBA\xBC-\xBE\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u0660-\u0669\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07C0-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0966-\u096F\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09E6-\u09F1\u09F4-\u09F9\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A66-\u0A6F\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AE6-\u0AEF\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B66-\u0B6F\u0B71-\u0B77\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0BE6-\u0BF2\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C66-\u0C6F\u0C78-\u0C7E\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CE6-\u0CEF\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D58-\u0D61\u0D66-\u0D78\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DE6-\u0DEF\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F20-\u0F33\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F-\u1049\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u1090-\u1099\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1369-\u137C\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A16\u1A20-\u1A54\u1A80-\u1A89\u1A90-\u1A99\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B50-\u1B59\u1B83-\u1BA0\u1BAE-\u1BE5\u1C00-\u1C23\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2070\u2071\u2074-\u2079\u207F-\u2089\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2150-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2CFD\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u3192-\u3195\u31A0-\u31BF\u31F0-\u31FF\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA830-\uA835\uA840-\uA873\uA882-\uA8B3\uA8D0-\uA8D9\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA900-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF-\uA9D9\uA9E0-\uA9E4\uA9E6-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA50-\uAA59\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDD8B\uDE80-\uDE9C\uDEA0-\uDED0\uDEE1-\uDEFB\uDF00-\uDF23\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC58-\uDC76\uDC79-\uDC9E\uDCA7-\uDCAF\uDCE0-\uDCF2\uDCF4\uDCF5\uDCFB-\uDD1B\uDD20-\uDD39\uDD80-\uDDB7\uDDBC-\uDDCF\uDDD2-\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE40-\uDE48\uDE60-\uDE7E\uDE80-\uDE9F\uDEC0-\uDEC7\uDEC9-\uDEE4\uDEEB-\uDEEF\uDF00-\uDF35\uDF40-\uDF55\uDF58-\uDF72\uDF78-\uDF91\uDFA9-\uDFAF]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDCFA-\uDD23\uDD30-\uDD39\uDE60-\uDE7E\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF27\uDF30-\uDF45\uDF51-\uDF54\uDF70-\uDF81\uDFB0-\uDFCB\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC52-\uDC6F\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD03-\uDD26\uDD36-\uDD3F\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDD0-\uDDDA\uDDDC\uDDE1-\uDDF4\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDEF0-\uDEF9\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC50-\uDC59\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE50-\uDE59\uDE80-\uDEAA\uDEB8\uDEC0-\uDEC9\uDF00-\uDF1A\uDF30-\uDF3B\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCF2\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDD50-\uDD59\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC50-\uDC6C\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD50-\uDD59\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDDA0-\uDDA9\uDEE0-\uDEF2\uDFB0\uDFC0-\uDFD4]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDE70-\uDEBE\uDEC0-\uDEC9\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF50-\uDF59\uDF5B-\uDF61\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE96\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD834[\uDEE0-\uDEF3\uDF60-\uDF78]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD837[\uDF00-\uDF1E]|\uD838[\uDD00-\uDD2C\uDD37-\uDD3D\uDD40-\uDD49\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB\uDEF0-\uDEF9]|\uD839[\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDCC7-\uDCCF\uDD00-\uDD43\uDD4B\uDD50-\uDD59]|\uD83B[\uDC71-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDCB4\uDD01-\uDD2D\uDD2F-\uDD3D\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD83C[\uDD00-\uDD0C]|\uD83E[\uDFF0-\uDFF9]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF38\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A])/)) return; - var nextChar = match[1] || match[2] || ''; - if (!nextChar || nextChar && (prevChar === '' || this.rules.inline.punctuation.exec(prevChar))) { - var lLength = match[0].length - 1; - var rDelim, - rLength, - delimTotal = lLength, - midDelimTotal = 0; - var endReg = match[0][0] === '*' ? this.rules.inline.emStrong.rDelimAst : this.rules.inline.emStrong.rDelimUnd; - endReg.lastIndex = 0; - - // Clip maskedSrc to same section of string as src (move to lexer?) - maskedSrc = maskedSrc.slice(-1 * src.length + lLength); - while ((match = endReg.exec(maskedSrc)) != null) { - rDelim = match[1] || match[2] || match[3] || match[4] || match[5] || match[6]; - if (!rDelim) continue; // skip single * in __abc*abc__ - - rLength = rDelim.length; - if (match[3] || match[4]) { - // found another Left Delim - delimTotal += rLength; - continue; - } else if (match[5] || match[6]) { - // either Left or Right Delim - if (lLength % 3 && !((lLength + rLength) % 3)) { - midDelimTotal += rLength; - continue; // CommonMark Emphasis Rules 9-10 - } - } - - delimTotal -= rLength; - if (delimTotal > 0) continue; // Haven't found enough closing delimiters - - // Remove extra characters. *a*** -> *a* - rLength = Math.min(rLength, rLength + delimTotal + midDelimTotal); - var raw = src.slice(0, lLength + match.index + (match[0].length - rDelim.length) + rLength); - - // Create `em` if smallest delimiter has odd char count. *a*** - if (Math.min(lLength, rLength) % 2) { - var _text = raw.slice(1, -1); - return { - type: 'em', - raw: raw, - text: _text, - tokens: this.lexer.inlineTokens(_text) - }; - } - - // Create 'strong' if smallest delimiter has even char count. **a*** - var text = raw.slice(2, -2); - return { - type: 'strong', - raw: raw, - text: text, - tokens: this.lexer.inlineTokens(text) - }; - } - } - }; - _proto.codespan = function codespan(src) { - var cap = this.rules.inline.code.exec(src); - if (cap) { - var text = cap[2].replace(/\n/g, ' '); - var hasNonSpaceChars = /[^ ]/.test(text); - var hasSpaceCharsOnBothEnds = /^ /.test(text) && / $/.test(text); - if (hasNonSpaceChars && hasSpaceCharsOnBothEnds) { - text = text.substring(1, text.length - 1); - } - text = escape(text, true); - return { - type: 'codespan', - raw: cap[0], - text: text - }; - } - }; - _proto.br = function br(src) { - var cap = this.rules.inline.br.exec(src); - if (cap) { - return { - type: 'br', - raw: cap[0] - }; - } - }; - _proto.del = function del(src) { - var cap = this.rules.inline.del.exec(src); - if (cap) { - return { - type: 'del', - raw: cap[0], - text: cap[2], - tokens: this.lexer.inlineTokens(cap[2]) - }; - } - }; - _proto.autolink = function autolink(src, mangle) { - var cap = this.rules.inline.autolink.exec(src); - if (cap) { - var text, href; - if (cap[2] === '@') { - text = escape(this.options.mangle ? mangle(cap[1]) : cap[1]); - href = 'mailto:' + text; - } else { - text = escape(cap[1]); - href = text; - } - return { - type: 'link', - raw: cap[0], - text: text, - href: href, - tokens: [{ - type: 'text', - raw: text, - text: text - }] - }; - } - }; - _proto.url = function url(src, mangle) { - var cap; - if (cap = this.rules.inline.url.exec(src)) { - var text, href; - if (cap[2] === '@') { - text = escape(this.options.mangle ? mangle(cap[0]) : cap[0]); - href = 'mailto:' + text; - } else { - // do extended autolink path validation - var prevCapZero; - do { - prevCapZero = cap[0]; - cap[0] = this.rules.inline._backpedal.exec(cap[0])[0]; - } while (prevCapZero !== cap[0]); - text = escape(cap[0]); - if (cap[1] === 'www.') { - href = 'http://' + text; - } else { - href = text; - } - } - return { - type: 'link', - raw: cap[0], - text: text, - href: href, - tokens: [{ - type: 'text', - raw: text, - text: text - }] - }; - } - }; - _proto.inlineText = function inlineText(src, smartypants) { - var cap = this.rules.inline.text.exec(src); - if (cap) { - var text; - if (this.lexer.state.inRawBlock) { - text = this.options.sanitize ? this.options.sanitizer ? this.options.sanitizer(cap[0]) : escape(cap[0]) : cap[0]; - } else { - text = escape(this.options.smartypants ? smartypants(cap[0]) : cap[0]); - } - return { - type: 'text', - raw: cap[0], - text: text - }; - } - }; - return Tokenizer; - }(); - - /** - * Block-Level Grammar - */ - var block = { - newline: /^(?: *(?:\n|$))+/, - code: /^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/, - fences: /^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?=\n|$)|$)/, - hr: /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, - heading: /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, - blockquote: /^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/, - list: /^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/, - html: '^ {0,3}(?:' // optional indentation - + '<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)' // (1) - + '|comment[^\\n]*(\\n+|$)' // (2) - + '|<\\?[\\s\\S]*?(?:\\?>\\n*|$)' // (3) - + '|\\n*|$)' // (4) - + '|\\n*|$)' // (5) - + '|)[\\s\\S]*?(?:(?:\\n *)+\\n|$)' // (6) - + '|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)' // (7) open tag - + '|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)' // (7) closing tag - + ')', - def: /^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/, - table: noopTest, - lheading: /^((?:.|\n(?!\n))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, - // regex template, placeholders will be replaced according to different paragraph - // interruption rules of commonmark and the original markdown spec: - _paragraph: /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, - text: /^[^\n]+/ - }; - block._label = /(?!\s*\])(?:\\.|[^\[\]\\])+/; - block._title = /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/; - block.def = edit(block.def).replace('label', block._label).replace('title', block._title).getRegex(); - block.bullet = /(?:[*+-]|\d{1,9}[.)])/; - block.listItemStart = edit(/^( *)(bull) */).replace('bull', block.bullet).getRegex(); - block.list = edit(block.list).replace(/bull/g, block.bullet).replace('hr', '\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))').replace('def', '\\n+(?=' + block.def.source + ')').getRegex(); - block._tag = 'address|article|aside|base|basefont|blockquote|body|caption' + '|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption' + '|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe' + '|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option' + '|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr' + '|track|ul'; - block._comment = /|$)/; - block.html = edit(block.html, 'i').replace('comment', block._comment).replace('tag', block._tag).replace('attribute', / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(); - block.paragraph = edit(block._paragraph).replace('hr', block.hr).replace('heading', ' {0,3}#{1,6} ').replace('|lheading', '') // setex headings don't interrupt commonmark paragraphs - .replace('|table', '').replace('blockquote', ' {0,3}>').replace('fences', ' {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n').replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt - .replace('html', ')|<(?:script|pre|style|textarea|!--)').replace('tag', block._tag) // pars can be interrupted by type (6) html blocks - .getRegex(); - block.blockquote = edit(block.blockquote).replace('paragraph', block.paragraph).getRegex(); - - /** - * Normal Block Grammar - */ - - block.normal = merge({}, block); - - /** - * GFM Block Grammar - */ - - block.gfm = merge({}, block.normal, { - table: '^ *([^\\n ].*\\|.*)\\n' // Header - + ' {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?' // Align - + '(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)' // Cells - }); - - block.gfm.table = edit(block.gfm.table).replace('hr', block.hr).replace('heading', ' {0,3}#{1,6} ').replace('blockquote', ' {0,3}>').replace('code', ' {4}[^\\n]').replace('fences', ' {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n').replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt - .replace('html', ')|<(?:script|pre|style|textarea|!--)').replace('tag', block._tag) // tables can be interrupted by type (6) html blocks - .getRegex(); - block.gfm.paragraph = edit(block._paragraph).replace('hr', block.hr).replace('heading', ' {0,3}#{1,6} ').replace('|lheading', '') // setex headings don't interrupt commonmark paragraphs - .replace('table', block.gfm.table) // interrupt paragraphs with table - .replace('blockquote', ' {0,3}>').replace('fences', ' {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n').replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt - .replace('html', ')|<(?:script|pre|style|textarea|!--)').replace('tag', block._tag) // pars can be interrupted by type (6) html blocks - .getRegex(); - /** - * Pedantic grammar (original John Gruber's loose markdown specification) - */ - - block.pedantic = merge({}, block.normal, { - html: edit('^ *(?:comment *(?:\\n|\\s*$)' + '|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)' // closed tag - + '|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))').replace('comment', block._comment).replace(/tag/g, '(?!(?:' + 'a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub' + '|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)' + '\\b)\\w+(?!:|[^\\w\\s@]*@)\\b').getRegex(), - def: /^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/, - heading: /^(#{1,6})(.*)(?:\n+|$)/, - fences: noopTest, - // fences not supported - lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/, - paragraph: edit(block.normal._paragraph).replace('hr', block.hr).replace('heading', ' *#{1,6} *[^\n]').replace('lheading', block.lheading).replace('blockquote', ' {0,3}>').replace('|fences', '').replace('|list', '').replace('|html', '').getRegex() - }); - - /** - * Inline-Level Grammar - */ - var inline = { - escape: /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, - autolink: /^<(scheme:[^\s\x00-\x1f<>]*|email)>/, - url: noopTest, - tag: '^comment' + '|^' // self-closing tag - + '|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>' // open tag - + '|^<\\?[\\s\\S]*?\\?>' // processing instruction, e.g. - + '|^' // declaration, e.g. - + '|^', - // CDATA section - link: /^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/, - reflink: /^!?\[(label)\]\[(ref)\]/, - nolink: /^!?\[(ref)\](?:\[\])?/, - reflinkSearch: 'reflink|nolink(?!\\()', - emStrong: { - lDelim: /^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/, - // (1) and (2) can only be a Right Delimiter. (3) and (4) can only be Left. (5) and (6) can be either Left or Right. - // () Skip orphan inside strong () Consume to delim (1) #*** (2) a***#, a*** (3) #***a, ***a (4) ***# (5) #***# (6) a***a - rDelimAst: /^(?:[^_*\\]|\\.)*?\_\_(?:[^_*\\]|\\.)*?\*(?:[^_*\\]|\\.)*?(?=\_\_)|(?:[^*\\]|\\.)+(?=[^*])|[punct_](\*+)(?=[\s]|$)|(?:[^punct*_\s\\]|\\.)(\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|(?:[^punct*_\s\\]|\\.)(\*+)(?=[^punct*_\s])/, - rDelimUnd: /^(?:[^_*\\]|\\.)*?\*\*(?:[^_*\\]|\\.)*?\_(?:[^_*\\]|\\.)*?(?=\*\*)|(?:[^_\\]|\\.)+(?=[^_])|[punct*](\_+)(?=[\s]|$)|(?:[^punct*_\s\\]|\\.)(\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/ // ^- Not allowed for _ - }, - - code: /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, - br: /^( {2,}|\\)\n(?!\s*$)/, - del: noopTest, - text: /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~'; - inline.punctuation = edit(inline.punctuation).replace(/punctuation/g, inline._punctuation).getRegex(); - - // sequences em should skip over [title](link), `code`, - inline.blockSkip = /\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g; - // lookbehind is not available on Safari as of version 16 - // inline.escapedEmSt = /(?<=(?:^|[^\\)(?:\\[^])*)\\[*_]/g; - inline.escapedEmSt = /(?:^|[^\\])(?:\\\\)*\\[*_]/g; - inline._comment = edit(block._comment).replace('(?:-->|$)', '-->').getRegex(); - inline.emStrong.lDelim = edit(inline.emStrong.lDelim).replace(/punct/g, inline._punctuation).getRegex(); - inline.emStrong.rDelimAst = edit(inline.emStrong.rDelimAst, 'g').replace(/punct/g, inline._punctuation).getRegex(); - inline.emStrong.rDelimUnd = edit(inline.emStrong.rDelimUnd, 'g').replace(/punct/g, inline._punctuation).getRegex(); - inline._escapes = /\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g; - inline._scheme = /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/; - inline._email = /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/; - inline.autolink = edit(inline.autolink).replace('scheme', inline._scheme).replace('email', inline._email).getRegex(); - inline._attribute = /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/; - inline.tag = edit(inline.tag).replace('comment', inline._comment).replace('attribute', inline._attribute).getRegex(); - inline._label = /(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/; - inline._href = /<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/; - inline._title = /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/; - inline.link = edit(inline.link).replace('label', inline._label).replace('href', inline._href).replace('title', inline._title).getRegex(); - inline.reflink = edit(inline.reflink).replace('label', inline._label).replace('ref', block._label).getRegex(); - inline.nolink = edit(inline.nolink).replace('ref', block._label).getRegex(); - inline.reflinkSearch = edit(inline.reflinkSearch, 'g').replace('reflink', inline.reflink).replace('nolink', inline.nolink).getRegex(); - - /** - * Normal Inline Grammar - */ - - inline.normal = merge({}, inline); - - /** - * Pedantic Inline Grammar - */ - - inline.pedantic = merge({}, inline.normal, { - strong: { - start: /^__|\*\*/, - middle: /^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/, - endAst: /\*\*(?!\*)/g, - endUnd: /__(?!_)/g - }, - em: { - start: /^_|\*/, - middle: /^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/, - endAst: /\*(?!\*)/g, - endUnd: /_(?!_)/g - }, - link: edit(/^!?\[(label)\]\((.*?)\)/).replace('label', inline._label).getRegex(), - reflink: edit(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace('label', inline._label).getRegex() - }); - - /** - * GFM Inline Grammar - */ - - inline.gfm = merge({}, inline.normal, { - escape: edit(inline.escape).replace('])', '~|])').getRegex(), - _extended_email: /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/, - url: /^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/, - _backpedal: /(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/, - del: /^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/, - text: /^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\ 0.5) { - ch = 'x' + ch.toString(16); - } - out += '&#' + ch + ';'; - } - return out; - } - - /** - * Block Lexer - */ - var Lexer = /*#__PURE__*/function () { - function Lexer(options) { - this.tokens = []; - this.tokens.links = Object.create(null); - this.options = options || exports.defaults; - this.options.tokenizer = this.options.tokenizer || new Tokenizer(); - this.tokenizer = this.options.tokenizer; - this.tokenizer.options = this.options; - this.tokenizer.lexer = this; - this.inlineQueue = []; - this.state = { - inLink: false, - inRawBlock: false, - top: true - }; - var rules = { - block: block.normal, - inline: inline.normal - }; - if (this.options.pedantic) { - rules.block = block.pedantic; - rules.inline = inline.pedantic; - } else if (this.options.gfm) { - rules.block = block.gfm; - if (this.options.breaks) { - rules.inline = inline.breaks; - } else { - rules.inline = inline.gfm; - } - } - this.tokenizer.rules = rules; - } - - /** - * Expose Rules - */ - /** - * Static Lex Method - */ - Lexer.lex = function lex(src, options) { - var lexer = new Lexer(options); - return lexer.lex(src); - } - - /** - * Static Lex Inline Method - */; - Lexer.lexInline = function lexInline(src, options) { - var lexer = new Lexer(options); - return lexer.inlineTokens(src); - } - - /** - * Preprocessing - */; - var _proto = Lexer.prototype; - _proto.lex = function lex(src) { - src = src.replace(/\r\n|\r/g, '\n'); - this.blockTokens(src, this.tokens); - var next; - while (next = this.inlineQueue.shift()) { - this.inlineTokens(next.src, next.tokens); - } - return this.tokens; - } - - /** - * Lexing - */; - _proto.blockTokens = function blockTokens(src, tokens) { - var _this = this; - if (tokens === void 0) { - tokens = []; - } - if (this.options.pedantic) { - src = src.replace(/\t/g, ' ').replace(/^ +$/gm, ''); - } else { - src = src.replace(/^( *)(\t+)/gm, function (_, leading, tabs) { - return leading + ' '.repeat(tabs.length); - }); - } - var token, lastToken, cutSrc, lastParagraphClipped; - while (src) { - if (this.options.extensions && this.options.extensions.block && this.options.extensions.block.some(function (extTokenizer) { - if (token = extTokenizer.call({ - lexer: _this - }, src, tokens)) { - src = src.substring(token.raw.length); - tokens.push(token); - return true; - } - return false; - })) { - continue; - } - - // newline - if (token = this.tokenizer.space(src)) { - src = src.substring(token.raw.length); - if (token.raw.length === 1 && tokens.length > 0) { - // if there's a single \n as a spacer, it's terminating the last line, - // so move it there so that we don't get unecessary paragraph tags - tokens[tokens.length - 1].raw += '\n'; - } else { - tokens.push(token); - } - continue; - } - - // code - if (token = this.tokenizer.code(src)) { - src = src.substring(token.raw.length); - lastToken = tokens[tokens.length - 1]; - // An indented code block cannot interrupt a paragraph. - if (lastToken && (lastToken.type === 'paragraph' || lastToken.type === 'text')) { - lastToken.raw += '\n' + token.raw; - lastToken.text += '\n' + token.text; - this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text; - } else { - tokens.push(token); - } - continue; - } - - // fences - if (token = this.tokenizer.fences(src)) { - src = src.substring(token.raw.length); - tokens.push(token); - continue; - } - - // heading - if (token = this.tokenizer.heading(src)) { - src = src.substring(token.raw.length); - tokens.push(token); - continue; - } - - // hr - if (token = this.tokenizer.hr(src)) { - src = src.substring(token.raw.length); - tokens.push(token); - continue; - } - - // blockquote - if (token = this.tokenizer.blockquote(src)) { - src = src.substring(token.raw.length); - tokens.push(token); - continue; - } - - // list - if (token = this.tokenizer.list(src)) { - src = src.substring(token.raw.length); - tokens.push(token); - continue; - } - - // html - if (token = this.tokenizer.html(src)) { - src = src.substring(token.raw.length); - tokens.push(token); - continue; - } - - // def - if (token = this.tokenizer.def(src)) { - src = src.substring(token.raw.length); - lastToken = tokens[tokens.length - 1]; - if (lastToken && (lastToken.type === 'paragraph' || lastToken.type === 'text')) { - lastToken.raw += '\n' + token.raw; - lastToken.text += '\n' + token.raw; - this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text; - } else if (!this.tokens.links[token.tag]) { - this.tokens.links[token.tag] = { - href: token.href, - title: token.title - }; - } - continue; - } - - // table (gfm) - if (token = this.tokenizer.table(src)) { - src = src.substring(token.raw.length); - tokens.push(token); - continue; - } - - // lheading - if (token = this.tokenizer.lheading(src)) { - src = src.substring(token.raw.length); - tokens.push(token); - continue; - } - - // top-level paragraph - // prevent paragraph consuming extensions by clipping 'src' to extension start - cutSrc = src; - if (this.options.extensions && this.options.extensions.startBlock) { - (function () { - var startIndex = Infinity; - var tempSrc = src.slice(1); - var tempStart = void 0; - _this.options.extensions.startBlock.forEach(function (getStartIndex) { - tempStart = getStartIndex.call({ - lexer: this - }, tempSrc); - if (typeof tempStart === 'number' && tempStart >= 0) { - startIndex = Math.min(startIndex, tempStart); - } - }); - if (startIndex < Infinity && startIndex >= 0) { - cutSrc = src.substring(0, startIndex + 1); - } - })(); - } - if (this.state.top && (token = this.tokenizer.paragraph(cutSrc))) { - lastToken = tokens[tokens.length - 1]; - if (lastParagraphClipped && lastToken.type === 'paragraph') { - lastToken.raw += '\n' + token.raw; - lastToken.text += '\n' + token.text; - this.inlineQueue.pop(); - this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text; - } else { - tokens.push(token); - } - lastParagraphClipped = cutSrc.length !== src.length; - src = src.substring(token.raw.length); - continue; - } - - // text - if (token = this.tokenizer.text(src)) { - src = src.substring(token.raw.length); - lastToken = tokens[tokens.length - 1]; - if (lastToken && lastToken.type === 'text') { - lastToken.raw += '\n' + token.raw; - lastToken.text += '\n' + token.text; - this.inlineQueue.pop(); - this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text; - } else { - tokens.push(token); - } - continue; - } - if (src) { - var errMsg = 'Infinite loop on byte: ' + src.charCodeAt(0); - if (this.options.silent) { - console.error(errMsg); - break; - } else { - throw new Error(errMsg); - } - } - } - this.state.top = true; - return tokens; - }; - _proto.inline = function inline(src, tokens) { - if (tokens === void 0) { - tokens = []; - } - this.inlineQueue.push({ - src: src, - tokens: tokens - }); - return tokens; - } - - /** - * Lexing/Compiling - */; - _proto.inlineTokens = function inlineTokens(src, tokens) { - var _this2 = this; - if (tokens === void 0) { - tokens = []; - } - var token, lastToken, cutSrc; - - // String with links masked to avoid interference with em and strong - var maskedSrc = src; - var match; - var keepPrevChar, prevChar; - - // Mask out reflinks - if (this.tokens.links) { - var links = Object.keys(this.tokens.links); - if (links.length > 0) { - while ((match = this.tokenizer.rules.inline.reflinkSearch.exec(maskedSrc)) != null) { - if (links.includes(match[0].slice(match[0].lastIndexOf('[') + 1, -1))) { - maskedSrc = maskedSrc.slice(0, match.index) + '[' + repeatString('a', match[0].length - 2) + ']' + maskedSrc.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex); - } - } - } - } - // Mask out other blocks - while ((match = this.tokenizer.rules.inline.blockSkip.exec(maskedSrc)) != null) { - maskedSrc = maskedSrc.slice(0, match.index) + '[' + repeatString('a', match[0].length - 2) + ']' + maskedSrc.slice(this.tokenizer.rules.inline.blockSkip.lastIndex); - } - - // Mask out escaped em & strong delimiters - while ((match = this.tokenizer.rules.inline.escapedEmSt.exec(maskedSrc)) != null) { - maskedSrc = maskedSrc.slice(0, match.index + match[0].length - 2) + '++' + maskedSrc.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex); - this.tokenizer.rules.inline.escapedEmSt.lastIndex--; - } - while (src) { - if (!keepPrevChar) { - prevChar = ''; - } - keepPrevChar = false; - - // extensions - if (this.options.extensions && this.options.extensions.inline && this.options.extensions.inline.some(function (extTokenizer) { - if (token = extTokenizer.call({ - lexer: _this2 - }, src, tokens)) { - src = src.substring(token.raw.length); - tokens.push(token); - return true; - } - return false; - })) { - continue; - } - - // escape - if (token = this.tokenizer.escape(src)) { - src = src.substring(token.raw.length); - tokens.push(token); - continue; - } - - // tag - if (token = this.tokenizer.tag(src)) { - src = src.substring(token.raw.length); - lastToken = tokens[tokens.length - 1]; - if (lastToken && token.type === 'text' && lastToken.type === 'text') { - lastToken.raw += token.raw; - lastToken.text += token.text; - } else { - tokens.push(token); - } - continue; - } - - // link - if (token = this.tokenizer.link(src)) { - src = src.substring(token.raw.length); - tokens.push(token); - continue; - } - - // reflink, nolink - if (token = this.tokenizer.reflink(src, this.tokens.links)) { - src = src.substring(token.raw.length); - lastToken = tokens[tokens.length - 1]; - if (lastToken && token.type === 'text' && lastToken.type === 'text') { - lastToken.raw += token.raw; - lastToken.text += token.text; - } else { - tokens.push(token); - } - continue; - } - - // em & strong - if (token = this.tokenizer.emStrong(src, maskedSrc, prevChar)) { - src = src.substring(token.raw.length); - tokens.push(token); - continue; - } - - // code - if (token = this.tokenizer.codespan(src)) { - src = src.substring(token.raw.length); - tokens.push(token); - continue; - } - - // br - if (token = this.tokenizer.br(src)) { - src = src.substring(token.raw.length); - tokens.push(token); - continue; - } - - // del (gfm) - if (token = this.tokenizer.del(src)) { - src = src.substring(token.raw.length); - tokens.push(token); - continue; - } - - // autolink - if (token = this.tokenizer.autolink(src, mangle)) { - src = src.substring(token.raw.length); - tokens.push(token); - continue; - } - - // url (gfm) - if (!this.state.inLink && (token = this.tokenizer.url(src, mangle))) { - src = src.substring(token.raw.length); - tokens.push(token); - continue; - } - - // text - // prevent inlineText consuming extensions by clipping 'src' to extension start - cutSrc = src; - if (this.options.extensions && this.options.extensions.startInline) { - (function () { - var startIndex = Infinity; - var tempSrc = src.slice(1); - var tempStart = void 0; - _this2.options.extensions.startInline.forEach(function (getStartIndex) { - tempStart = getStartIndex.call({ - lexer: this - }, tempSrc); - if (typeof tempStart === 'number' && tempStart >= 0) { - startIndex = Math.min(startIndex, tempStart); - } - }); - if (startIndex < Infinity && startIndex >= 0) { - cutSrc = src.substring(0, startIndex + 1); - } - })(); - } - if (token = this.tokenizer.inlineText(cutSrc, smartypants)) { - src = src.substring(token.raw.length); - if (token.raw.slice(-1) !== '_') { - // Track prevChar before string of ____ started - prevChar = token.raw.slice(-1); - } - keepPrevChar = true; - lastToken = tokens[tokens.length - 1]; - if (lastToken && lastToken.type === 'text') { - lastToken.raw += token.raw; - lastToken.text += token.text; - } else { - tokens.push(token); - } - continue; - } - if (src) { - var errMsg = 'Infinite loop on byte: ' + src.charCodeAt(0); - if (this.options.silent) { - console.error(errMsg); - break; - } else { - throw new Error(errMsg); - } - } - } - return tokens; - }; - _createClass(Lexer, null, [{ - key: "rules", - get: function get() { - return { - block: block, - inline: inline - }; - } - }]); - return Lexer; - }(); - - /** - * Renderer - */ - var Renderer = /*#__PURE__*/function () { - function Renderer(options) { - this.options = options || exports.defaults; - } - var _proto = Renderer.prototype; - _proto.code = function code(_code, infostring, escaped) { - var lang = (infostring || '').match(/\S*/)[0]; - if (this.options.highlight) { - var out = this.options.highlight(_code, lang); - if (out != null && out !== _code) { - escaped = true; - _code = out; - } - } - _code = _code.replace(/\n$/, '') + '\n'; - if (!lang) { - return '
    ' + (escaped ? _code : escape(_code, true)) + '
    \n'; - } - return '
    ' + (escaped ? _code : escape(_code, true)) + '
    \n'; - } - - /** - * @param {string} quote - */; - _proto.blockquote = function blockquote(quote) { - return "
    \n" + quote + "
    \n"; - }; - _proto.html = function html(_html) { - return _html; - } - - /** - * @param {string} text - * @param {string} level - * @param {string} raw - * @param {any} slugger - */; - _proto.heading = function heading(text, level, raw, slugger) { - if (this.options.headerIds) { - var id = this.options.headerPrefix + slugger.slug(raw); - return "" + text + "\n"; - } - - // ignore IDs - return "" + text + "\n"; - }; - _proto.hr = function hr() { - return this.options.xhtml ? '
    \n' : '
    \n'; - }; - _proto.list = function list(body, ordered, start) { - var type = ordered ? 'ol' : 'ul', - startatt = ordered && start !== 1 ? ' start="' + start + '"' : ''; - return '<' + type + startatt + '>\n' + body + '\n'; - } - - /** - * @param {string} text - */; - _proto.listitem = function listitem(text) { - return "
  • " + text + "
  • \n"; - }; - _proto.checkbox = function checkbox(checked) { - return ' '; - } - - /** - * @param {string} text - */; - _proto.paragraph = function paragraph(text) { - return "

    " + text + "

    \n"; - } - - /** - * @param {string} header - * @param {string} body - */; - _proto.table = function table(header, body) { - if (body) body = "" + body + ""; - return '\n' + '\n' + header + '\n' + body + '
    \n'; - } - - /** - * @param {string} content - */; - _proto.tablerow = function tablerow(content) { - return "\n" + content + "\n"; - }; - _proto.tablecell = function tablecell(content, flags) { - var type = flags.header ? 'th' : 'td'; - var tag = flags.align ? "<" + type + " align=\"" + flags.align + "\">" : "<" + type + ">"; - return tag + content + ("\n"); - } - - /** - * span level renderer - * @param {string} text - */; - _proto.strong = function strong(text) { - return "" + text + ""; - } - - /** - * @param {string} text - */; - _proto.em = function em(text) { - return "" + text + ""; - } - - /** - * @param {string} text - */; - _proto.codespan = function codespan(text) { - return "" + text + ""; - }; - _proto.br = function br() { - return this.options.xhtml ? '
    ' : '
    '; - } - - /** - * @param {string} text - */; - _proto.del = function del(text) { - return "" + text + ""; - } - - /** - * @param {string} href - * @param {string} title - * @param {string} text - */; - _proto.link = function link(href, title, text) { - href = cleanUrl(this.options.sanitize, this.options.baseUrl, href); - if (href === null) { - return text; - } - var out = '
    '; - return out; - } - - /** - * @param {string} href - * @param {string} title - * @param {string} text - */; - _proto.image = function image(href, title, text) { - href = cleanUrl(this.options.sanitize, this.options.baseUrl, href); - if (href === null) { - return text; - } - var out = "\""' : '>'; - return out; - }; - _proto.text = function text(_text) { - return _text; - }; - return Renderer; - }(); - - /** - * TextRenderer - * returns only the textual part of the token - */ - var TextRenderer = /*#__PURE__*/function () { - function TextRenderer() {} - var _proto = TextRenderer.prototype; - // no need for block level renderers - _proto.strong = function strong(text) { - return text; - }; - _proto.em = function em(text) { - return text; - }; - _proto.codespan = function codespan(text) { - return text; - }; - _proto.del = function del(text) { - return text; - }; - _proto.html = function html(text) { - return text; - }; - _proto.text = function text(_text) { - return _text; - }; - _proto.link = function link(href, title, text) { - return '' + text; - }; - _proto.image = function image(href, title, text) { - return '' + text; - }; - _proto.br = function br() { - return ''; - }; - return TextRenderer; - }(); - - /** - * Slugger generates header id - */ - var Slugger = /*#__PURE__*/function () { - function Slugger() { - this.seen = {}; - } - - /** - * @param {string} value - */ - var _proto = Slugger.prototype; - _proto.serialize = function serialize(value) { - return value.toLowerCase().trim() - // remove html tags - .replace(/<[!\/a-z].*?>/ig, '') - // remove unwanted chars - .replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g, '').replace(/\s/g, '-'); - } - - /** - * Finds the next safe (unique) slug to use - * @param {string} originalSlug - * @param {boolean} isDryRun - */; - _proto.getNextSafeSlug = function getNextSafeSlug(originalSlug, isDryRun) { - var slug = originalSlug; - var occurenceAccumulator = 0; - if (this.seen.hasOwnProperty(slug)) { - occurenceAccumulator = this.seen[originalSlug]; - do { - occurenceAccumulator++; - slug = originalSlug + '-' + occurenceAccumulator; - } while (this.seen.hasOwnProperty(slug)); - } - if (!isDryRun) { - this.seen[originalSlug] = occurenceAccumulator; - this.seen[slug] = 0; - } - return slug; - } - - /** - * Convert string to unique id - * @param {object} [options] - * @param {boolean} [options.dryrun] Generates the next unique slug without - * updating the internal accumulator. - */; - _proto.slug = function slug(value, options) { - if (options === void 0) { - options = {}; - } - var slug = this.serialize(value); - return this.getNextSafeSlug(slug, options.dryrun); - }; - return Slugger; - }(); - - /** - * Parsing & Compiling - */ - var Parser = /*#__PURE__*/function () { - function Parser(options) { - this.options = options || exports.defaults; - this.options.renderer = this.options.renderer || new Renderer(); - this.renderer = this.options.renderer; - this.renderer.options = this.options; - this.textRenderer = new TextRenderer(); - this.slugger = new Slugger(); - } - - /** - * Static Parse Method - */ - Parser.parse = function parse(tokens, options) { - var parser = new Parser(options); - return parser.parse(tokens); - } - - /** - * Static Parse Inline Method - */; - Parser.parseInline = function parseInline(tokens, options) { - var parser = new Parser(options); - return parser.parseInline(tokens); - } - - /** - * Parse Loop - */; - var _proto = Parser.prototype; - _proto.parse = function parse(tokens, top) { - if (top === void 0) { - top = true; - } - var out = '', - i, - j, - k, - l2, - l3, - row, - cell, - header, - body, - token, - ordered, - start, - loose, - itemBody, - item, - checked, - task, - checkbox, - ret; - var l = tokens.length; - for (i = 0; i < l; i++) { - token = tokens[i]; - - // Run any renderer extensions - if (this.options.extensions && this.options.extensions.renderers && this.options.extensions.renderers[token.type]) { - ret = this.options.extensions.renderers[token.type].call({ - parser: this - }, token); - if (ret !== false || !['space', 'hr', 'heading', 'code', 'table', 'blockquote', 'list', 'html', 'paragraph', 'text'].includes(token.type)) { - out += ret || ''; - continue; - } - } - switch (token.type) { - case 'space': - { - continue; - } - case 'hr': - { - out += this.renderer.hr(); - continue; - } - case 'heading': - { - out += this.renderer.heading(this.parseInline(token.tokens), token.depth, unescape(this.parseInline(token.tokens, this.textRenderer)), this.slugger); - continue; - } - case 'code': - { - out += this.renderer.code(token.text, token.lang, token.escaped); - continue; - } - case 'table': - { - header = ''; - - // header - cell = ''; - l2 = token.header.length; - for (j = 0; j < l2; j++) { - cell += this.renderer.tablecell(this.parseInline(token.header[j].tokens), { - header: true, - align: token.align[j] - }); - } - header += this.renderer.tablerow(cell); - body = ''; - l2 = token.rows.length; - for (j = 0; j < l2; j++) { - row = token.rows[j]; - cell = ''; - l3 = row.length; - for (k = 0; k < l3; k++) { - cell += this.renderer.tablecell(this.parseInline(row[k].tokens), { - header: false, - align: token.align[k] - }); - } - body += this.renderer.tablerow(cell); - } - out += this.renderer.table(header, body); - continue; - } - case 'blockquote': - { - body = this.parse(token.tokens); - out += this.renderer.blockquote(body); - continue; - } - case 'list': - { - ordered = token.ordered; - start = token.start; - loose = token.loose; - l2 = token.items.length; - body = ''; - for (j = 0; j < l2; j++) { - item = token.items[j]; - checked = item.checked; - task = item.task; - itemBody = ''; - if (item.task) { - checkbox = this.renderer.checkbox(checked); - if (loose) { - if (item.tokens.length > 0 && item.tokens[0].type === 'paragraph') { - item.tokens[0].text = checkbox + ' ' + item.tokens[0].text; - if (item.tokens[0].tokens && item.tokens[0].tokens.length > 0 && item.tokens[0].tokens[0].type === 'text') { - item.tokens[0].tokens[0].text = checkbox + ' ' + item.tokens[0].tokens[0].text; - } - } else { - item.tokens.unshift({ - type: 'text', - text: checkbox - }); - } - } else { - itemBody += checkbox; - } - } - itemBody += this.parse(item.tokens, loose); - body += this.renderer.listitem(itemBody, task, checked); - } - out += this.renderer.list(body, ordered, start); - continue; - } - case 'html': - { - // TODO parse inline content if parameter markdown=1 - out += this.renderer.html(token.text); - continue; - } - case 'paragraph': - { - out += this.renderer.paragraph(this.parseInline(token.tokens)); - continue; - } - case 'text': - { - body = token.tokens ? this.parseInline(token.tokens) : token.text; - while (i + 1 < l && tokens[i + 1].type === 'text') { - token = tokens[++i]; - body += '\n' + (token.tokens ? this.parseInline(token.tokens) : token.text); - } - out += top ? this.renderer.paragraph(body) : body; - continue; - } - default: - { - var errMsg = 'Token with "' + token.type + '" type was not found.'; - if (this.options.silent) { - console.error(errMsg); - return; - } else { - throw new Error(errMsg); - } - } - } - } - return out; - } - - /** - * Parse Inline Tokens - */; - _proto.parseInline = function parseInline(tokens, renderer) { - renderer = renderer || this.renderer; - var out = '', - i, - token, - ret; - var l = tokens.length; - for (i = 0; i < l; i++) { - token = tokens[i]; - - // Run any renderer extensions - if (this.options.extensions && this.options.extensions.renderers && this.options.extensions.renderers[token.type]) { - ret = this.options.extensions.renderers[token.type].call({ - parser: this - }, token); - if (ret !== false || !['escape', 'html', 'link', 'image', 'strong', 'em', 'codespan', 'br', 'del', 'text'].includes(token.type)) { - out += ret || ''; - continue; - } - } - switch (token.type) { - case 'escape': - { - out += renderer.text(token.text); - break; - } - case 'html': - { - out += renderer.html(token.text); - break; - } - case 'link': - { - out += renderer.link(token.href, token.title, this.parseInline(token.tokens, renderer)); - break; - } - case 'image': - { - out += renderer.image(token.href, token.title, token.text); - break; - } - case 'strong': - { - out += renderer.strong(this.parseInline(token.tokens, renderer)); - break; - } - case 'em': - { - out += renderer.em(this.parseInline(token.tokens, renderer)); - break; - } - case 'codespan': - { - out += renderer.codespan(token.text); - break; - } - case 'br': - { - out += renderer.br(); - break; - } - case 'del': - { - out += renderer.del(this.parseInline(token.tokens, renderer)); - break; - } - case 'text': - { - out += renderer.text(token.text); - break; - } - default: - { - var errMsg = 'Token with "' + token.type + '" type was not found.'; - if (this.options.silent) { - console.error(errMsg); - return; - } else { - throw new Error(errMsg); - } - } - } - } - return out; - }; - return Parser; - }(); - - /** - * Marked - */ - function marked(src, opt, callback) { - // throw error in case of non string input - if (typeof src === 'undefined' || src === null) { - throw new Error('marked(): input parameter is undefined or null'); - } - if (typeof src !== 'string') { - throw new Error('marked(): input parameter is of type ' + Object.prototype.toString.call(src) + ', string expected'); - } - if (typeof opt === 'function') { - callback = opt; - opt = null; - } - opt = merge({}, marked.defaults, opt || {}); - checkSanitizeDeprecation(opt); - if (callback) { - var highlight = opt.highlight; - var tokens; - try { - tokens = Lexer.lex(src, opt); - } catch (e) { - return callback(e); - } - var done = function done(err) { - var out; - if (!err) { - try { - if (opt.walkTokens) { - marked.walkTokens(tokens, opt.walkTokens); - } - out = Parser.parse(tokens, opt); - } catch (e) { - err = e; - } - } - opt.highlight = highlight; - return err ? callback(err) : callback(null, out); - }; - if (!highlight || highlight.length < 3) { - return done(); - } - delete opt.highlight; - if (!tokens.length) return done(); - var pending = 0; - marked.walkTokens(tokens, function (token) { - if (token.type === 'code') { - pending++; - setTimeout(function () { - highlight(token.text, token.lang, function (err, code) { - if (err) { - return done(err); - } - if (code != null && code !== token.text) { - token.text = code; - token.escaped = true; - } - pending--; - if (pending === 0) { - done(); - } - }); - }, 0); - } - }); - if (pending === 0) { - done(); - } - return; - } - function onError(e) { - e.message += '\nPlease report this to https://github.com/markedjs/marked.'; - if (opt.silent) { - return '

    An error occurred:

    ' + escape(e.message + '', true) + '
    '; - } - throw e; - } - try { - var _tokens = Lexer.lex(src, opt); - if (opt.walkTokens) { - if (opt.async) { - return Promise.all(marked.walkTokens(_tokens, opt.walkTokens)).then(function () { - return Parser.parse(_tokens, opt); - })["catch"](onError); - } - marked.walkTokens(_tokens, opt.walkTokens); - } - return Parser.parse(_tokens, opt); - } catch (e) { - onError(e); - } - } - - /** - * Options - */ - - marked.options = marked.setOptions = function (opt) { - merge(marked.defaults, opt); - changeDefaults(marked.defaults); - return marked; - }; - marked.getDefaults = getDefaults; - marked.defaults = exports.defaults; - - /** - * Use Extension - */ - - marked.use = function () { - var extensions = marked.defaults.extensions || { - renderers: {}, - childTokens: {} - }; - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - args.forEach(function (pack) { - // copy options to new object - var opts = merge({}, pack); - - // set async to true if it was set to true before - opts.async = marked.defaults.async || opts.async; - - // ==-- Parse "addon" extensions --== // - if (pack.extensions) { - pack.extensions.forEach(function (ext) { - if (!ext.name) { - throw new Error('extension name required'); - } - if (ext.renderer) { - // Renderer extensions - var prevRenderer = extensions.renderers[ext.name]; - if (prevRenderer) { - // Replace extension with func to run new extension but fall back if false - extensions.renderers[ext.name] = function () { - for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { - args[_key2] = arguments[_key2]; - } - var ret = ext.renderer.apply(this, args); - if (ret === false) { - ret = prevRenderer.apply(this, args); - } - return ret; - }; - } else { - extensions.renderers[ext.name] = ext.renderer; - } - } - if (ext.tokenizer) { - // Tokenizer Extensions - if (!ext.level || ext.level !== 'block' && ext.level !== 'inline') { - throw new Error("extension level must be 'block' or 'inline'"); - } - if (extensions[ext.level]) { - extensions[ext.level].unshift(ext.tokenizer); - } else { - extensions[ext.level] = [ext.tokenizer]; - } - if (ext.start) { - // Function to check for start of token - if (ext.level === 'block') { - if (extensions.startBlock) { - extensions.startBlock.push(ext.start); - } else { - extensions.startBlock = [ext.start]; - } - } else if (ext.level === 'inline') { - if (extensions.startInline) { - extensions.startInline.push(ext.start); - } else { - extensions.startInline = [ext.start]; - } - } - } - } - if (ext.childTokens) { - // Child tokens to be visited by walkTokens - extensions.childTokens[ext.name] = ext.childTokens; - } - }); - opts.extensions = extensions; - } - - // ==-- Parse "overwrite" extensions --== // - if (pack.renderer) { - (function () { - var renderer = marked.defaults.renderer || new Renderer(); - var _loop = function _loop(prop) { - var prevRenderer = renderer[prop]; - // Replace renderer with func to run extension, but fall back if false - renderer[prop] = function () { - for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { - args[_key3] = arguments[_key3]; - } - var ret = pack.renderer[prop].apply(renderer, args); - if (ret === false) { - ret = prevRenderer.apply(renderer, args); - } - return ret; - }; - }; - for (var prop in pack.renderer) { - _loop(prop); - } - opts.renderer = renderer; - })(); - } - if (pack.tokenizer) { - (function () { - var tokenizer = marked.defaults.tokenizer || new Tokenizer(); - var _loop2 = function _loop2(prop) { - var prevTokenizer = tokenizer[prop]; - // Replace tokenizer with func to run extension, but fall back if false - tokenizer[prop] = function () { - for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) { - args[_key4] = arguments[_key4]; - } - var ret = pack.tokenizer[prop].apply(tokenizer, args); - if (ret === false) { - ret = prevTokenizer.apply(tokenizer, args); - } - return ret; - }; - }; - for (var prop in pack.tokenizer) { - _loop2(prop); - } - opts.tokenizer = tokenizer; - })(); - } - - // ==-- Parse WalkTokens extensions --== // - if (pack.walkTokens) { - var _walkTokens = marked.defaults.walkTokens; - opts.walkTokens = function (token) { - var values = []; - values.push(pack.walkTokens.call(this, token)); - if (_walkTokens) { - values = values.concat(_walkTokens.call(this, token)); - } - return values; - }; - } - marked.setOptions(opts); - }); - }; - - /** - * Run callback for every token - */ - - marked.walkTokens = function (tokens, callback) { - var values = []; - var _loop3 = function _loop3() { - var token = _step.value; - values = values.concat(callback.call(marked, token)); - switch (token.type) { - case 'table': - { - for (var _iterator2 = _createForOfIteratorHelperLoose(token.header), _step2; !(_step2 = _iterator2()).done;) { - var cell = _step2.value; - values = values.concat(marked.walkTokens(cell.tokens, callback)); - } - for (var _iterator3 = _createForOfIteratorHelperLoose(token.rows), _step3; !(_step3 = _iterator3()).done;) { - var row = _step3.value; - for (var _iterator4 = _createForOfIteratorHelperLoose(row), _step4; !(_step4 = _iterator4()).done;) { - var _cell = _step4.value; - values = values.concat(marked.walkTokens(_cell.tokens, callback)); - } - } - break; - } - case 'list': - { - values = values.concat(marked.walkTokens(token.items, callback)); - break; - } - default: - { - if (marked.defaults.extensions && marked.defaults.extensions.childTokens && marked.defaults.extensions.childTokens[token.type]) { - // Walk any extensions - marked.defaults.extensions.childTokens[token.type].forEach(function (childTokens) { - values = values.concat(marked.walkTokens(token[childTokens], callback)); - }); - } else if (token.tokens) { - values = values.concat(marked.walkTokens(token.tokens, callback)); - } - } - } - }; - for (var _iterator = _createForOfIteratorHelperLoose(tokens), _step; !(_step = _iterator()).done;) { - _loop3(); - } - return values; - }; - - /** - * Parse Inline - * @param {string} src - */ - marked.parseInline = function (src, opt) { - // throw error in case of non string input - if (typeof src === 'undefined' || src === null) { - throw new Error('marked.parseInline(): input parameter is undefined or null'); - } - if (typeof src !== 'string') { - throw new Error('marked.parseInline(): input parameter is of type ' + Object.prototype.toString.call(src) + ', string expected'); - } - opt = merge({}, marked.defaults, opt || {}); - checkSanitizeDeprecation(opt); - try { - var tokens = Lexer.lexInline(src, opt); - if (opt.walkTokens) { - marked.walkTokens(tokens, opt.walkTokens); - } - return Parser.parseInline(tokens, opt); - } catch (e) { - e.message += '\nPlease report this to https://github.com/markedjs/marked.'; - if (opt.silent) { - return '

    An error occurred:

    ' + escape(e.message + '', true) + '
    '; - } - throw e; - } - }; - - /** - * Expose - */ - marked.Parser = Parser; - marked.parser = Parser.parse; - marked.Renderer = Renderer; - marked.TextRenderer = TextRenderer; - marked.Lexer = Lexer; - marked.lexer = Lexer.lex; - marked.Tokenizer = Tokenizer; - marked.Slugger = Slugger; - marked.parse = marked; - var options = marked.options; - var setOptions = marked.setOptions; - var use = marked.use; - var walkTokens = marked.walkTokens; - var parseInline = marked.parseInline; - var parse = marked; - var parser = Parser.parse; - var lexer = Lexer.lex; - - exports.Lexer = Lexer; - exports.Parser = Parser; - exports.Renderer = Renderer; - exports.Slugger = Slugger; - exports.TextRenderer = TextRenderer; - exports.Tokenizer = Tokenizer; - exports.getDefaults = getDefaults; - exports.lexer = lexer; - exports.marked = marked; - exports.options = options; - exports.parse = parse; - exports.parseInline = parseInline; - exports.parser = parser; - exports.setOptions = setOptions; - exports.use = use; - exports.walkTokens = walkTokens; - -})); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/marked/man/marked.1 b/packages/wyatt_notification_bloc/example/scripts/node_modules/marked/man/marked.1 deleted file mode 100644 index 4dd24fd1..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/marked/man/marked.1 +++ /dev/null @@ -1,92 +0,0 @@ -.ds q \N'34' -.TH marked 1 - -.SH NAME -marked \- a javascript markdown parser - -.SH SYNOPSIS -.B marked -[\-o \fI\fP] [\-i \fI\fP] [\-s \fI\fP] [\-\-help] -[\-\-tokens] [\-\-pedantic] [\-\-gfm] -[\-\-breaks] [\-\-sanitize] -[\-\-smart\-lists] [\-\-lang\-prefix \fI\fP] -[\-\-no\-etc...] [\-\-silent] [\fIfilename\fP] - -.SH DESCRIPTION -.B marked -is a full-featured javascript markdown parser, built for speed. -It also includes multiple GFM features. - -.SH EXAMPLES -.TP -cat in.md | marked > out.html -.TP -echo "hello *world*" | marked -.TP -marked \-o out.html \-i in.md \-\-gfm -.TP -marked \-\-output="hello world.html" \-i in.md \-\-no-breaks - -.SH OPTIONS -.TP -.BI \-o,\ \-\-output\ [\fIoutput\fP] -Specify file output. If none is specified, write to stdout. -.TP -.BI \-i,\ \-\-input\ [\fIinput\fP] -Specify file input, otherwise use last argument as input file. -If no input file is specified, read from stdin. -.TP -.BI \-s,\ \-\-string\ [\fIstring\fP] -Specify string input instead of a file. -.TP -.BI \-t,\ \-\-tokens -Output a token stream instead of html. -.TP -.BI \-\-pedantic -Conform to obscure parts of markdown.pl as much as possible. -Don't fix original markdown bugs. -.TP -.BI \-\-gfm -Enable github flavored markdown. -.TP -.BI \-\-breaks -Enable GFM line breaks. Only works with the gfm option. -.TP -.BI \-\-sanitize -Sanitize output. Ignore any HTML input. -.TP -.BI \-\-smart\-lists -Use smarter list behavior than the original markdown. -.TP -.BI \-\-lang\-prefix\ [\fIprefix\fP] -Set the prefix for code block classes. -.TP -.BI \-\-mangle -Mangle email addresses. -.TP -.BI \-\-no\-sanitize,\ \-no-etc... -The inverse of any of the marked options above. -.TP -.BI \-\-silent -Silence error output. -.TP -.BI \-h,\ \-\-help -Display help information. - -.SH CONFIGURATION -For configuring and running programmatically. - -.B Example - - import { marked } from 'marked'; - marked('*foo*', { gfm: true }); - -.SH BUGS -Please report any bugs to https://github.com/markedjs/marked. - -.SH LICENSE -Copyright (c) 2011-2014, Christopher Jeffrey (MIT License). - -.SH "SEE ALSO" -.BR markdown(1), -.BR node.js(1) diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/marked/man/marked.1.txt b/packages/wyatt_notification_bloc/example/scripts/node_modules/marked/man/marked.1.txt deleted file mode 100644 index 1a6816bc..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/marked/man/marked.1.txt +++ /dev/null @@ -1,86 +0,0 @@ -marked(1) General Commands Manual marked(1) - -NAME - marked - a javascript markdown parser - -SYNOPSIS - marked [-o ] [-i ] [-s ] [--help] [--tokens] - [--pedantic] [--gfm] [--breaks] [--sanitize] [--smart-lists] - [--lang-prefix ] [--no-etc...] [--silent] [filename] - - -DESCRIPTION - marked is a full-featured javascript markdown parser, built for speed. - It also includes multiple GFM features. - -EXAMPLES - cat in.md | marked > out.html - - echo "hello *world*" | marked - - marked -o out.html -i in.md --gfm - - marked --output="hello world.html" -i in.md --no-breaks - -OPTIONS - -o, --output [output] - Specify file output. If none is specified, write to stdout. - - -i, --input [input] - Specify file input, otherwise use last argument as input file. - If no input file is specified, read from stdin. - - -s, --string [string] - Specify string input instead of a file. - - -t, --tokens - Output a token stream instead of html. - - --pedantic - Conform to obscure parts of markdown.pl as much as possible. - Don't fix original markdown bugs. - - --gfm Enable github flavored markdown. - - --breaks - Enable GFM line breaks. Only works with the gfm option. - - --sanitize - Sanitize output. Ignore any HTML input. - - --smart-lists - Use smarter list behavior than the original markdown. - - --lang-prefix [prefix] - Set the prefix for code block classes. - - --mangle - Mangle email addresses. - - --no-sanitize, -no-etc... - The inverse of any of the marked options above. - - --silent - Silence error output. - - -h, --help - Display help information. - -CONFIGURATION - For configuring and running programmatically. - - Example - - import { marked } from 'marked'; - marked('*foo*', { gfm: true }); - -BUGS - Please report any bugs to https://github.com/markedjs/marked. - -LICENSE - Copyright (c) 2011-2014, Christopher Jeffrey (MIT License). - -SEE ALSO - markdown(1), node.js(1) - - marked(1) diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/marked/marked.min.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/marked/marked.min.js deleted file mode 100644 index 530804c3..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/marked/marked.min.js +++ /dev/null @@ -1,6 +0,0 @@ -/** - * marked - a markdown parser - * Copyright (c) 2011-2022, Christopher Jeffrey. (MIT Licensed) - * https://github.com/markedjs/marked - */ -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).marked={})}(this,function(r){"use strict";function i(e,t){for(var u=0;ue.length)&&(t=e.length);for(var u=0,n=new Array(t);u=e.length?{done:!0}:{done:!1,value:e[u++]}};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function e(){return{async:!1,baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}r.defaults=e();function u(e){return t[e]}var n=/[&<>"']/,l=new RegExp(n.source,"g"),a=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,o=new RegExp(a.source,"g"),t={"&":"&","<":"<",">":">",'"':""","'":"'"};function D(e,t){if(t){if(n.test(e))return e.replace(l,u)}else if(a.test(e))return e.replace(o,u);return e}var c=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function x(e){return e.replace(c,function(e,t){return"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""})}var h=/(^|[^\[])\^/g;function p(u,e){u="string"==typeof u?u:u.source,e=e||"";var n={replace:function(e,t){return t=(t=t.source||t).replace(h,"$1"),u=u.replace(e,t),n},getRegex:function(){return new RegExp(u,e)}};return n}var f=/[^\w:]/g,Z=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function g(e,t,u){if(e){try{n=decodeURIComponent(x(u)).replace(f,"").toLowerCase()}catch(e){return null}if(0===n.indexOf("javascript:")||0===n.indexOf("vbscript:")||0===n.indexOf("data:"))return null}var n;t&&!Z.test(u)&&(e=u,F[" "+(n=t)]||(q.test(n)?F[" "+n]=n+"/":F[" "+n]=k(n,"/",!0)),t=-1===(n=F[" "+n]).indexOf(":"),u="//"===e.substring(0,2)?t?e:n.replace(O,"$1")+e:"/"===e.charAt(0)?t?e:n.replace(L,"$1")+e:n+e);try{u=encodeURI(u).replace(/%25/g,"%")}catch(e){return null}return u}var F={},q=/^[^:]+:\/*[^/]*$/,O=/^([^:]+:)[\s\S]*$/,L=/^([^:]+:\/*[^/]*)[\s\S]*$/;var A={exec:function(){}};function d(e){for(var t,u,n=1;nt)u.splice(t);else for(;u.length>=1,e+=e;return u+e}function b(e,t,u,n){var r=t.href,t=t.title?D(t.title):null,i=e[1].replace(/\\([\[\]])/g,"$1");return"!"!==e[0].charAt(0)?(n.state.inLink=!0,e={type:"link",raw:u,href:r,title:t,text:i,tokens:n.inlineTokens(i)},n.state.inLink=!1,e):{type:"image",raw:u,href:r,title:t,text:D(i)}}var w=function(){function e(e){this.options=e||r.defaults}var t=e.prototype;return t.space=function(e){e=this.rules.block.newline.exec(e);if(e&&0=r.length?e.slice(r.length):e}).join("\n")),{type:"code",raw:t,lang:e[2]&&e[2].trim().replace(this.rules.inline._escapes,"$1"),text:u}},t.heading=function(e){var t,u,e=this.rules.block.heading.exec(e);if(e)return t=e[2].trim(),/#$/.test(t)&&(u=k(t,"#"),!this.options.pedantic&&u&&!/ $/.test(u)||(t=u.trim())),{type:"heading",raw:e[0],depth:e[1].length,text:t,tokens:this.lexer.inline(t)}},t.hr=function(e){e=this.rules.block.hr.exec(e);if(e)return{type:"hr",raw:e[0]}},t.blockquote=function(e){var t,e=this.rules.block.blockquote.exec(e);if(e)return t=e[0].replace(/^ *>[ \t]?/gm,""),{type:"blockquote",raw:e[0],tokens:this.lexer.blockTokens(t,[]),text:t}},t.list=function(e){var t=this.rules.block.list.exec(e);if(t){var u,n,r,i,s,l,a,o,D,c,h,p=1<(g=t[1].trim()).length,f={type:"list",raw:"",ordered:p,start:p?+g.slice(0,-1):"",loose:!1,items:[]},g=p?"\\d{1,9}\\"+g.slice(-1):"\\"+g;this.options.pedantic&&(g=p?g:"[*+-]");for(var F=new RegExp("^( {0,3}"+g+")((?:[\t ][^\\n]*)?(?:\\n|$))");e&&(h=!1,t=F.exec(e))&&!this.rules.block.hr.test(e);){if(u=t[0],e=e.substring(u.length),a=t[2].split("\n",1)[0],o=e.split("\n",1)[0],this.options.pedantic?(i=2,c=a.trimLeft()):(i=t[2].search(/[^ ]/),c=a.slice(i=4=i||!a.trim())c+="\n"+a.slice(i);else{if(s)break;c+="\n"+a}s||a.trim()||(s=!0),u+=D+"\n",e=e.substring(D.length+1)}f.loose||(l?f.loose=!0:/\n *\n *$/.test(u)&&(l=!0)),this.options.gfm&&(n=/^\[[ xX]\] /.exec(c))&&(r="[ ] "!==n[0],c=c.replace(/^\[[ xX]\] +/,"")),f.items.push({type:"list_item",raw:u,task:!!n,checked:r,loose:!1,text:c}),f.raw+=u}f.items[f.items.length-1].raw=u.trimRight(),f.items[f.items.length-1].text=c.trimRight(),f.raw=f.raw.trimRight();for(var E=f.items.length,x=0;x$/,"$1").replace(this.rules.inline._escapes,"$1"):"",n=e[3]&&e[3].substring(1,e[3].length-1).replace(this.rules.inline._escapes,"$1"),{type:"def",tag:t,raw:e[0],href:u,title:n}},t.table=function(e){e=this.rules.block.table.exec(e);if(e){var t={type:"table",header:C(e[1]).map(function(e){return{text:e}}),align:e[2].replace(/^ *|\| *$/g,"").split(/ *\| */),rows:e[3]&&e[3].trim()?e[3].replace(/\n[ \t]*$/,"").split("\n"):[]};if(t.header.length===t.align.length){t.raw=e[0];for(var u,n,r,i=t.align.length,s=0;s/i.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:this.options.sanitize?"text":"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(e[0]):D(e[0]):e[0]}},t.link=function(e){e=this.rules.inline.link.exec(e);if(e){var t=e[2].trim();if(!this.options.pedantic&&/^$/.test(t))return;var u=k(t.slice(0,-1),"\\");if((t.length-u.length)%2==0)return}else{u=function(e,t){if(-1!==e.indexOf(t[1]))for(var u=e.length,n=0,r=0;r$/.test(t)?u.slice(1):u.slice(1,-1):u)&&u.replace(this.rules.inline._escapes,"$1"),title:r&&r.replace(this.rules.inline._escapes,"$1")},e[0],this.lexer)}},t.reflink=function(e,t){var u;if(u=(u=this.rules.inline.reflink.exec(e))||this.rules.inline.nolink.exec(e))return(e=t[(e=(u[2]||u[1]).replace(/\s+/g," ")).toLowerCase()])?b(u,e,u[0],this.lexer):{type:"text",raw:t=u[0].charAt(0),text:t}},t.emStrong=function(e,t,u){void 0===u&&(u="");var n=this.rules.inline.emStrong.lDelim.exec(e);if(n&&(!n[3]||!u.match(/(?:[0-9A-Za-z\xAA\xB2\xB3\xB5\xB9\xBA\xBC-\xBE\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u0660-\u0669\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07C0-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0966-\u096F\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09E6-\u09F1\u09F4-\u09F9\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A66-\u0A6F\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AE6-\u0AEF\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B66-\u0B6F\u0B71-\u0B77\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0BE6-\u0BF2\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C66-\u0C6F\u0C78-\u0C7E\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CE6-\u0CEF\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D58-\u0D61\u0D66-\u0D78\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DE6-\u0DEF\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F20-\u0F33\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F-\u1049\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u1090-\u1099\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1369-\u137C\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A16\u1A20-\u1A54\u1A80-\u1A89\u1A90-\u1A99\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B50-\u1B59\u1B83-\u1BA0\u1BAE-\u1BE5\u1C00-\u1C23\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2070\u2071\u2074-\u2079\u207F-\u2089\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2150-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2CFD\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u3192-\u3195\u31A0-\u31BF\u31F0-\u31FF\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA830-\uA835\uA840-\uA873\uA882-\uA8B3\uA8D0-\uA8D9\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA900-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF-\uA9D9\uA9E0-\uA9E4\uA9E6-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA50-\uAA59\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDD8B\uDE80-\uDE9C\uDEA0-\uDED0\uDEE1-\uDEFB\uDF00-\uDF23\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC58-\uDC76\uDC79-\uDC9E\uDCA7-\uDCAF\uDCE0-\uDCF2\uDCF4\uDCF5\uDCFB-\uDD1B\uDD20-\uDD39\uDD80-\uDDB7\uDDBC-\uDDCF\uDDD2-\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE40-\uDE48\uDE60-\uDE7E\uDE80-\uDE9F\uDEC0-\uDEC7\uDEC9-\uDEE4\uDEEB-\uDEEF\uDF00-\uDF35\uDF40-\uDF55\uDF58-\uDF72\uDF78-\uDF91\uDFA9-\uDFAF]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDCFA-\uDD23\uDD30-\uDD39\uDE60-\uDE7E\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF27\uDF30-\uDF45\uDF51-\uDF54\uDF70-\uDF81\uDFB0-\uDFCB\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC52-\uDC6F\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD03-\uDD26\uDD36-\uDD3F\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDD0-\uDDDA\uDDDC\uDDE1-\uDDF4\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDEF0-\uDEF9\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC50-\uDC59\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE50-\uDE59\uDE80-\uDEAA\uDEB8\uDEC0-\uDEC9\uDF00-\uDF1A\uDF30-\uDF3B\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCF2\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDD50-\uDD59\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC50-\uDC6C\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD50-\uDD59\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDDA0-\uDDA9\uDEE0-\uDEF2\uDFB0\uDFC0-\uDFD4]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDE70-\uDEBE\uDEC0-\uDEC9\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF50-\uDF59\uDF5B-\uDF61\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE96\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD834[\uDEE0-\uDEF3\uDF60-\uDF78]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD837[\uDF00-\uDF1E]|\uD838[\uDD00-\uDD2C\uDD37-\uDD3D\uDD40-\uDD49\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB\uDEF0-\uDEF9]|\uD839[\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDCC7-\uDCCF\uDD00-\uDD43\uDD4B\uDD50-\uDD59]|\uD83B[\uDC71-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDCB4\uDD01-\uDD2D\uDD2F-\uDD3D\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD83C[\uDD00-\uDD0C]|\uD83E[\uDFF0-\uDFF9]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF38\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A])/))){var r=n[1]||n[2]||"";if(!r||""===u||this.rules.inline.punctuation.exec(u)){var i=n[0].length-1,s=i,l=0,a="*"===n[0][0]?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(a.lastIndex=0,t=t.slice(-1*e.length+i);null!=(n=a.exec(t));){var o,D=n[1]||n[2]||n[3]||n[4]||n[5]||n[6];if(D)if(o=D.length,n[3]||n[4])s+=o;else if((n[5]||n[6])&&i%3&&!((i+o)%3))l+=o;else if(!(0<(s-=o)))return o=Math.min(o,o+s+l),D=e.slice(0,i+n.index+(n[0].length-D.length)+o),Math.min(i,o)%2?(o=D.slice(1,-1),{type:"em",raw:D,text:o,tokens:this.lexer.inlineTokens(o)}):(o=D.slice(2,-2),{type:"strong",raw:D,text:o,tokens:this.lexer.inlineTokens(o)})}}}},t.codespan=function(e){var t,u,n,e=this.rules.inline.code.exec(e);if(e)return n=e[2].replace(/\n/g," "),t=/[^ ]/.test(n),u=/^ /.test(n)&&/ $/.test(n),n=D(n=t&&u?n.substring(1,n.length-1):n,!0),{type:"codespan",raw:e[0],text:n}},t.br=function(e){e=this.rules.inline.br.exec(e);if(e)return{type:"br",raw:e[0]}},t.del=function(e){e=this.rules.inline.del.exec(e);if(e)return{type:"del",raw:e[0],text:e[2],tokens:this.lexer.inlineTokens(e[2])}},t.autolink=function(e,t){var u,e=this.rules.inline.autolink.exec(e);if(e)return t="@"===e[2]?"mailto:"+(u=D(this.options.mangle?t(e[1]):e[1])):u=D(e[1]),{type:"link",raw:e[0],text:u,href:t,tokens:[{type:"text",raw:u,text:u}]}},t.url=function(e,t){var u,n,r,i;if(u=this.rules.inline.url.exec(e)){if("@"===u[2])r="mailto:"+(n=D(this.options.mangle?t(u[0]):u[0]));else{for(;i=u[0],u[0]=this.rules.inline._backpedal.exec(u[0])[0],i!==u[0];);n=D(u[0]),r="www."===u[1]?"http://"+n:n}return{type:"link",raw:u[0],text:n,href:r,tokens:[{type:"text",raw:n,text:n}]}}},t.inlineText=function(e,t){e=this.rules.inline.text.exec(e);if(e)return t=this.lexer.state.inRawBlock?this.options.sanitize?this.options.sanitizer?this.options.sanitizer(e[0]):D(e[0]):e[0]:D(this.options.smartypants?t(e[0]):e[0]),{type:"text",raw:e[0],text:t}},e}(),y={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?=\n|$)|$)/,hr:/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,table:A,lheading:/^((?:.|\n(?!\n))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/,_label:/(?!\s*\])(?:\\.|[^\[\]\\])+/,_title:/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/},v=(y.def=p(y.def).replace("label",y._label).replace("title",y._title).getRegex(),y.bullet=/(?:[*+-]|\d{1,9}[.)])/,y.listItemStart=p(/^( *)(bull) */).replace("bull",y.bullet).getRegex(),y.list=p(y.list).replace(/bull/g,y.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+y.def.source+")").getRegex(),y._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",y._comment=/|$)/,y.html=p(y.html,"i").replace("comment",y._comment).replace("tag",y._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),y.paragraph=p(y._paragraph).replace("hr",y.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",y._tag).getRegex(),y.blockquote=p(y.blockquote).replace("paragraph",y.paragraph).getRegex(),y.normal=d({},y),y.gfm=d({},y.normal,{table:"^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),y.gfm.table=p(y.gfm.table).replace("hr",y.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",y._tag).getRegex(),y.gfm.paragraph=p(y._paragraph).replace("hr",y.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("table",y.gfm.table).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",y._tag).getRegex(),y.pedantic=d({},y.normal,{html:p("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",y._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:A,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:p(y.normal._paragraph).replace("hr",y.hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",y.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()}),{escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:A,tag:"^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(ref)\]/,nolink:/^!?\[(ref)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/^(?:[^_*\\]|\\.)*?\_\_(?:[^_*\\]|\\.)*?\*(?:[^_*\\]|\\.)*?(?=\_\_)|(?:[^*\\]|\\.)+(?=[^*])|[punct_](\*+)(?=[\s]|$)|(?:[^punct*_\s\\]|\\.)(\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|(?:[^punct*_\s\\]|\\.)(\*+)(?=[^punct*_\s])/,rDelimUnd:/^(?:[^_*\\]|\\.)*?\*\*(?:[^_*\\]|\\.)*?\_(?:[^_*\\]|\\.)*?(?=\*\*)|(?:[^_\\]|\\.)+(?=[^_])|[punct*](\_+)(?=[\s]|$)|(?:[^punct*_\s\\]|\\.)(\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:A,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~",v.punctuation=p(v.punctuation).replace(/punctuation/g,v._punctuation).getRegex(),v.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,v.escapedEmSt=/(?:^|[^\\])(?:\\\\)*\\[*_]/g,v._comment=p(y._comment).replace("(?:--\x3e|$)","--\x3e").getRegex(),v.emStrong.lDelim=p(v.emStrong.lDelim).replace(/punct/g,v._punctuation).getRegex(),v.emStrong.rDelimAst=p(v.emStrong.rDelimAst,"g").replace(/punct/g,v._punctuation).getRegex(),v.emStrong.rDelimUnd=p(v.emStrong.rDelimUnd,"g").replace(/punct/g,v._punctuation).getRegex(),v._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,v._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,v._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,v.autolink=p(v.autolink).replace("scheme",v._scheme).replace("email",v._email).getRegex(),v._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,v.tag=p(v.tag).replace("comment",v._comment).replace("attribute",v._attribute).getRegex(),v._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,v._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,v._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,v.link=p(v.link).replace("label",v._label).replace("href",v._href).replace("title",v._title).getRegex(),v.reflink=p(v.reflink).replace("label",v._label).replace("ref",y._label).getRegex(),v.nolink=p(v.nolink).replace("ref",y._label).getRegex(),v.reflinkSearch=p(v.reflinkSearch,"g").replace("reflink",v.reflink).replace("nolink",v.nolink).getRegex(),v.normal=d({},v),v.pedantic=d({},v.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:p(/^!?\[(label)\]\((.*?)\)/).replace("label",v._label).getRegex(),reflink:p(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",v._label).getRegex()}),v.gfm=d({},v.normal,{escape:p(v.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\'+(u?e:D(e,!0))+"\n":"
    "+(u?e:D(e,!0))+"
    \n"},t.blockquote=function(e){return"
    \n"+e+"
    \n"},t.html=function(e){return e},t.heading=function(e,t,u,n){return this.options.headerIds?"'+e+"\n":""+e+"\n"},t.hr=function(){return this.options.xhtml?"
    \n":"
    \n"},t.list=function(e,t,u){var n=t?"ol":"ul";return"<"+n+(t&&1!==u?' start="'+u+'"':"")+">\n"+e+"\n"},t.listitem=function(e){return"
  • "+e+"
  • \n"},t.checkbox=function(e){return" "},t.paragraph=function(e){return"

    "+e+"

    \n"},t.table=function(e,t){return"\n\n"+e+"\n"+(t=t&&""+t+"")+"
    \n"},t.tablerow=function(e){return"\n"+e+"\n"},t.tablecell=function(e,t){var u=t.header?"th":"td";return(t.align?"<"+u+' align="'+t.align+'">':"<"+u+">")+e+"\n"},t.strong=function(e){return""+e+""},t.em=function(e){return""+e+""},t.codespan=function(e){return""+e+""},t.br=function(){return this.options.xhtml?"
    ":"
    "},t.del=function(e){return""+e+""},t.link=function(e,t,u){return null===(e=g(this.options.sanitize,this.options.baseUrl,e))?u:(e='
    "+u+"")},t.image=function(e,t,u){return null===(e=g(this.options.sanitize,this.options.baseUrl,e))?u:(e=''+u+'":">"))},t.text=function(e){return e},e}(),S=function(){function e(){}var t=e.prototype;return t.strong=function(e){return e},t.em=function(e){return e},t.codespan=function(e){return e},t.del=function(e){return e},t.html=function(e){return e},t.text=function(e){return e},t.link=function(e,t,u){return""+u},t.image=function(e,t,u){return""+u},t.br=function(){return""},e}(),T=function(){function e(){this.seen={}}var t=e.prototype;return t.serialize=function(e){return e.toLowerCase().trim().replace(/<[!\/a-z].*?>/gi,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")},t.getNextSafeSlug=function(e,t){var u=e,n=0;if(this.seen.hasOwnProperty(u))for(n=this.seen[e];u=e+"-"+ ++n,this.seen.hasOwnProperty(u););return t||(this.seen[e]=n,this.seen[u]=0),u},t.slug=function(e,t){void 0===t&&(t={});e=this.serialize(e);return this.getNextSafeSlug(e,t.dryrun)},e}(),R=function(){function u(e){this.options=e||r.defaults,this.options.renderer=this.options.renderer||new $,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new S,this.slugger=new T}u.parse=function(e,t){return new u(t).parse(e)},u.parseInline=function(e,t){return new u(t).parseInline(e)};var e=u.prototype;return e.parse=function(e,t){void 0===t&&(t=!0);for(var u,n,r,i,s,l,a,o,D,c,h,p,f,g,F,A,d="",C=e.length,k=0;kAn error occurred:

    "+D(e.message+"",!0)+"
    ";throw e}try{var a=z.lex(e,u);if(u.walkTokens){if(u.async)return Promise.all(I.walkTokens(a,u.walkTokens)).then(function(){return R.parse(a,u)}).catch(t);I.walkTokens(a,u.walkTokens)}return R.parse(a,u)}catch(e){t(e)}}I.options=I.setOptions=function(e){return d(I.defaults,e),e=I.defaults,r.defaults=e,I},I.getDefaults=e,I.defaults=r.defaults,I.use=function(){for(var o=I.defaults.extensions||{renderers:{},childTokens:{}},e=arguments.length,t=new Array(e),u=0;uAn error occurred:

    "+D(e.message+"",!0)+"
    ";throw e}},I.Parser=R,I.parser=R.parse,I.Renderer=$,I.TextRenderer=S,I.Lexer=z,I.lexer=z.lex,I.Tokenizer=w,I.Slugger=T;var A=(I.parse=I).options,P=I.setOptions,Q=I.use,U=I.walkTokens,M=I.parseInline,N=I,X=R.parse,G=z.lex;r.Lexer=z,r.Parser=R,r.Renderer=$,r.Slugger=T,r.TextRenderer=S,r.Tokenizer=w,r.getDefaults=e,r.lexer=G,r.marked=I,r.options=A,r.parse=N,r.parseInline=M,r.parser=X,r.setOptions=P,r.use=Q,r.walkTokens=U}); \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/marked/package.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/marked/package.json deleted file mode 100644 index c052fedb..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/marked/package.json +++ /dev/null @@ -1,94 +0,0 @@ -{ - "name": "marked", - "description": "A markdown parser built for speed", - "author": "Christopher Jeffrey", - "version": "4.2.3", - "type": "module", - "main": "./lib/marked.cjs", - "module": "./lib/marked.esm.js", - "browser": "./lib/marked.umd.js", - "bin": { - "marked": "bin/marked.js" - }, - "man": "./man/marked.1", - "files": [ - "bin/", - "lib/", - "src/", - "man/", - "marked.min.js" - ], - "exports": { - ".": { - "import": "./lib/marked.esm.js", - "default": "./lib/marked.cjs" - }, - "./bin/marked": "./bin/marked.js", - "./package.json": "./package.json" - }, - "repository": "git://github.com/markedjs/marked.git", - "homepage": "https://marked.js.org", - "bugs": { - "url": "http://github.com/markedjs/marked/issues" - }, - "license": "MIT", - "keywords": [ - "markdown", - "markup", - "html" - ], - "tags": [ - "markdown", - "markup", - "html" - ], - "devDependencies": { - "@babel/core": "^7.20.2", - "@babel/preset-env": "^7.20.2", - "@markedjs/html-differ": "^4.0.2", - "@rollup/plugin-babel": "^6.0.2", - "@semantic-release/commit-analyzer": "^9.0.2", - "@semantic-release/git": "^10.0.1", - "@semantic-release/github": "^8.0.6", - "@semantic-release/npm": "^9.0.1", - "@semantic-release/release-notes-generator": "^10.0.3", - "cheerio": "^1.0.0-rc.12", - "commonmark": "0.30.0", - "eslint": "^8.27.0", - "eslint-config-standard": "^17.0.0", - "eslint-plugin-import": "^2.26.0", - "eslint-plugin-n": "^15.5.1", - "eslint-plugin-promise": "^6.1.1", - "front-matter": "^4.0.2", - "highlight.js": "^11.6.0", - "jasmine": "^4.5.0", - "markdown-it": "13.0.1", - "node-fetch": "^3.3.0", - "rollup": "^3.3.0", - "semantic-release": "^19.0.5", - "titleize": "^3.0.0", - "uglify-js": "^3.17.4", - "vuln-regex-detector": "^1.3.0" - }, - "scripts": { - "test": "jasmine --config=jasmine.json", - "test:all": "npm test && npm run test:lint", - "test:unit": "npm test -- test/unit/**/*-spec.js", - "test:specs": "npm test -- test/specs/**/*-spec.js", - "test:lint": "eslint .", - "test:redos": "node test/vuln-regex.js", - "test:update": "node test/update-specs.js", - "rules": "node test/rules.js", - "bench": "npm run rollup && node test/bench.js", - "lint": "eslint --fix .", - "build:reset": "git checkout upstream/master lib/marked.cjs lib/marked.umd.js lib/marked.esm.js marked.min.js", - "build": "npm run rollup && npm run minify", - "build:docs": "node build-docs.js", - "rollup": "rollup -c rollup.config.js", - "minify": "uglifyjs lib/marked.umd.js -cm --comments /Copyright/ -o marked.min.js", - "preversion": "npm run build && (git diff --quiet || git commit -am build)" - }, - "engines": { - "node": ">= 12" - } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/marked/src/Lexer.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/marked/src/Lexer.js deleted file mode 100644 index acb0fc29..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/marked/src/Lexer.js +++ /dev/null @@ -1,503 +0,0 @@ -import { Tokenizer } from './Tokenizer.js'; -import { defaults } from './defaults.js'; -import { block, inline } from './rules.js'; -import { repeatString } from './helpers.js'; - -/** - * smartypants text replacement - * @param {string} text - */ -function smartypants(text) { - return text - // em-dashes - .replace(/---/g, '\u2014') - // en-dashes - .replace(/--/g, '\u2013') - // opening singles - .replace(/(^|[-\u2014/(\[{"\s])'/g, '$1\u2018') - // closing singles & apostrophes - .replace(/'/g, '\u2019') - // opening doubles - .replace(/(^|[-\u2014/(\[{\u2018\s])"/g, '$1\u201c') - // closing doubles - .replace(/"/g, '\u201d') - // ellipses - .replace(/\.{3}/g, '\u2026'); -} - -/** - * mangle email addresses - * @param {string} text - */ -function mangle(text) { - let out = '', - i, - ch; - - const l = text.length; - for (i = 0; i < l; i++) { - ch = text.charCodeAt(i); - if (Math.random() > 0.5) { - ch = 'x' + ch.toString(16); - } - out += '&#' + ch + ';'; - } - - return out; -} - -/** - * Block Lexer - */ -export class Lexer { - constructor(options) { - this.tokens = []; - this.tokens.links = Object.create(null); - this.options = options || defaults; - this.options.tokenizer = this.options.tokenizer || new Tokenizer(); - this.tokenizer = this.options.tokenizer; - this.tokenizer.options = this.options; - this.tokenizer.lexer = this; - this.inlineQueue = []; - this.state = { - inLink: false, - inRawBlock: false, - top: true - }; - - const rules = { - block: block.normal, - inline: inline.normal - }; - - if (this.options.pedantic) { - rules.block = block.pedantic; - rules.inline = inline.pedantic; - } else if (this.options.gfm) { - rules.block = block.gfm; - if (this.options.breaks) { - rules.inline = inline.breaks; - } else { - rules.inline = inline.gfm; - } - } - this.tokenizer.rules = rules; - } - - /** - * Expose Rules - */ - static get rules() { - return { - block, - inline - }; - } - - /** - * Static Lex Method - */ - static lex(src, options) { - const lexer = new Lexer(options); - return lexer.lex(src); - } - - /** - * Static Lex Inline Method - */ - static lexInline(src, options) { - const lexer = new Lexer(options); - return lexer.inlineTokens(src); - } - - /** - * Preprocessing - */ - lex(src) { - src = src - .replace(/\r\n|\r/g, '\n'); - - this.blockTokens(src, this.tokens); - - let next; - while (next = this.inlineQueue.shift()) { - this.inlineTokens(next.src, next.tokens); - } - - return this.tokens; - } - - /** - * Lexing - */ - blockTokens(src, tokens = []) { - if (this.options.pedantic) { - src = src.replace(/\t/g, ' ').replace(/^ +$/gm, ''); - } else { - src = src.replace(/^( *)(\t+)/gm, (_, leading, tabs) => { - return leading + ' '.repeat(tabs.length); - }); - } - - let token, lastToken, cutSrc, lastParagraphClipped; - - while (src) { - if (this.options.extensions - && this.options.extensions.block - && this.options.extensions.block.some((extTokenizer) => { - if (token = extTokenizer.call({ lexer: this }, src, tokens)) { - src = src.substring(token.raw.length); - tokens.push(token); - return true; - } - return false; - })) { - continue; - } - - // newline - if (token = this.tokenizer.space(src)) { - src = src.substring(token.raw.length); - if (token.raw.length === 1 && tokens.length > 0) { - // if there's a single \n as a spacer, it's terminating the last line, - // so move it there so that we don't get unecessary paragraph tags - tokens[tokens.length - 1].raw += '\n'; - } else { - tokens.push(token); - } - continue; - } - - // code - if (token = this.tokenizer.code(src)) { - src = src.substring(token.raw.length); - lastToken = tokens[tokens.length - 1]; - // An indented code block cannot interrupt a paragraph. - if (lastToken && (lastToken.type === 'paragraph' || lastToken.type === 'text')) { - lastToken.raw += '\n' + token.raw; - lastToken.text += '\n' + token.text; - this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text; - } else { - tokens.push(token); - } - continue; - } - - // fences - if (token = this.tokenizer.fences(src)) { - src = src.substring(token.raw.length); - tokens.push(token); - continue; - } - - // heading - if (token = this.tokenizer.heading(src)) { - src = src.substring(token.raw.length); - tokens.push(token); - continue; - } - - // hr - if (token = this.tokenizer.hr(src)) { - src = src.substring(token.raw.length); - tokens.push(token); - continue; - } - - // blockquote - if (token = this.tokenizer.blockquote(src)) { - src = src.substring(token.raw.length); - tokens.push(token); - continue; - } - - // list - if (token = this.tokenizer.list(src)) { - src = src.substring(token.raw.length); - tokens.push(token); - continue; - } - - // html - if (token = this.tokenizer.html(src)) { - src = src.substring(token.raw.length); - tokens.push(token); - continue; - } - - // def - if (token = this.tokenizer.def(src)) { - src = src.substring(token.raw.length); - lastToken = tokens[tokens.length - 1]; - if (lastToken && (lastToken.type === 'paragraph' || lastToken.type === 'text')) { - lastToken.raw += '\n' + token.raw; - lastToken.text += '\n' + token.raw; - this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text; - } else if (!this.tokens.links[token.tag]) { - this.tokens.links[token.tag] = { - href: token.href, - title: token.title - }; - } - continue; - } - - // table (gfm) - if (token = this.tokenizer.table(src)) { - src = src.substring(token.raw.length); - tokens.push(token); - continue; - } - - // lheading - if (token = this.tokenizer.lheading(src)) { - src = src.substring(token.raw.length); - tokens.push(token); - continue; - } - - // top-level paragraph - // prevent paragraph consuming extensions by clipping 'src' to extension start - cutSrc = src; - if (this.options.extensions && this.options.extensions.startBlock) { - let startIndex = Infinity; - const tempSrc = src.slice(1); - let tempStart; - this.options.extensions.startBlock.forEach(function(getStartIndex) { - tempStart = getStartIndex.call({ lexer: this }, tempSrc); - if (typeof tempStart === 'number' && tempStart >= 0) { startIndex = Math.min(startIndex, tempStart); } - }); - if (startIndex < Infinity && startIndex >= 0) { - cutSrc = src.substring(0, startIndex + 1); - } - } - if (this.state.top && (token = this.tokenizer.paragraph(cutSrc))) { - lastToken = tokens[tokens.length - 1]; - if (lastParagraphClipped && lastToken.type === 'paragraph') { - lastToken.raw += '\n' + token.raw; - lastToken.text += '\n' + token.text; - this.inlineQueue.pop(); - this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text; - } else { - tokens.push(token); - } - lastParagraphClipped = (cutSrc.length !== src.length); - src = src.substring(token.raw.length); - continue; - } - - // text - if (token = this.tokenizer.text(src)) { - src = src.substring(token.raw.length); - lastToken = tokens[tokens.length - 1]; - if (lastToken && lastToken.type === 'text') { - lastToken.raw += '\n' + token.raw; - lastToken.text += '\n' + token.text; - this.inlineQueue.pop(); - this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text; - } else { - tokens.push(token); - } - continue; - } - - if (src) { - const errMsg = 'Infinite loop on byte: ' + src.charCodeAt(0); - if (this.options.silent) { - console.error(errMsg); - break; - } else { - throw new Error(errMsg); - } - } - } - - this.state.top = true; - return tokens; - } - - inline(src, tokens = []) { - this.inlineQueue.push({ src, tokens }); - return tokens; - } - - /** - * Lexing/Compiling - */ - inlineTokens(src, tokens = []) { - let token, lastToken, cutSrc; - - // String with links masked to avoid interference with em and strong - let maskedSrc = src; - let match; - let keepPrevChar, prevChar; - - // Mask out reflinks - if (this.tokens.links) { - const links = Object.keys(this.tokens.links); - if (links.length > 0) { - while ((match = this.tokenizer.rules.inline.reflinkSearch.exec(maskedSrc)) != null) { - if (links.includes(match[0].slice(match[0].lastIndexOf('[') + 1, -1))) { - maskedSrc = maskedSrc.slice(0, match.index) + '[' + repeatString('a', match[0].length - 2) + ']' + maskedSrc.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex); - } - } - } - } - // Mask out other blocks - while ((match = this.tokenizer.rules.inline.blockSkip.exec(maskedSrc)) != null) { - maskedSrc = maskedSrc.slice(0, match.index) + '[' + repeatString('a', match[0].length - 2) + ']' + maskedSrc.slice(this.tokenizer.rules.inline.blockSkip.lastIndex); - } - - // Mask out escaped em & strong delimiters - while ((match = this.tokenizer.rules.inline.escapedEmSt.exec(maskedSrc)) != null) { - maskedSrc = maskedSrc.slice(0, match.index + match[0].length - 2) + '++' + maskedSrc.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex); - this.tokenizer.rules.inline.escapedEmSt.lastIndex--; - } - - while (src) { - if (!keepPrevChar) { - prevChar = ''; - } - keepPrevChar = false; - - // extensions - if (this.options.extensions - && this.options.extensions.inline - && this.options.extensions.inline.some((extTokenizer) => { - if (token = extTokenizer.call({ lexer: this }, src, tokens)) { - src = src.substring(token.raw.length); - tokens.push(token); - return true; - } - return false; - })) { - continue; - } - - // escape - if (token = this.tokenizer.escape(src)) { - src = src.substring(token.raw.length); - tokens.push(token); - continue; - } - - // tag - if (token = this.tokenizer.tag(src)) { - src = src.substring(token.raw.length); - lastToken = tokens[tokens.length - 1]; - if (lastToken && token.type === 'text' && lastToken.type === 'text') { - lastToken.raw += token.raw; - lastToken.text += token.text; - } else { - tokens.push(token); - } - continue; - } - - // link - if (token = this.tokenizer.link(src)) { - src = src.substring(token.raw.length); - tokens.push(token); - continue; - } - - // reflink, nolink - if (token = this.tokenizer.reflink(src, this.tokens.links)) { - src = src.substring(token.raw.length); - lastToken = tokens[tokens.length - 1]; - if (lastToken && token.type === 'text' && lastToken.type === 'text') { - lastToken.raw += token.raw; - lastToken.text += token.text; - } else { - tokens.push(token); - } - continue; - } - - // em & strong - if (token = this.tokenizer.emStrong(src, maskedSrc, prevChar)) { - src = src.substring(token.raw.length); - tokens.push(token); - continue; - } - - // code - if (token = this.tokenizer.codespan(src)) { - src = src.substring(token.raw.length); - tokens.push(token); - continue; - } - - // br - if (token = this.tokenizer.br(src)) { - src = src.substring(token.raw.length); - tokens.push(token); - continue; - } - - // del (gfm) - if (token = this.tokenizer.del(src)) { - src = src.substring(token.raw.length); - tokens.push(token); - continue; - } - - // autolink - if (token = this.tokenizer.autolink(src, mangle)) { - src = src.substring(token.raw.length); - tokens.push(token); - continue; - } - - // url (gfm) - if (!this.state.inLink && (token = this.tokenizer.url(src, mangle))) { - src = src.substring(token.raw.length); - tokens.push(token); - continue; - } - - // text - // prevent inlineText consuming extensions by clipping 'src' to extension start - cutSrc = src; - if (this.options.extensions && this.options.extensions.startInline) { - let startIndex = Infinity; - const tempSrc = src.slice(1); - let tempStart; - this.options.extensions.startInline.forEach(function(getStartIndex) { - tempStart = getStartIndex.call({ lexer: this }, tempSrc); - if (typeof tempStart === 'number' && tempStart >= 0) { startIndex = Math.min(startIndex, tempStart); } - }); - if (startIndex < Infinity && startIndex >= 0) { - cutSrc = src.substring(0, startIndex + 1); - } - } - if (token = this.tokenizer.inlineText(cutSrc, smartypants)) { - src = src.substring(token.raw.length); - if (token.raw.slice(-1) !== '_') { // Track prevChar before string of ____ started - prevChar = token.raw.slice(-1); - } - keepPrevChar = true; - lastToken = tokens[tokens.length - 1]; - if (lastToken && lastToken.type === 'text') { - lastToken.raw += token.raw; - lastToken.text += token.text; - } else { - tokens.push(token); - } - continue; - } - - if (src) { - const errMsg = 'Infinite loop on byte: ' + src.charCodeAt(0); - if (this.options.silent) { - console.error(errMsg); - break; - } else { - throw new Error(errMsg); - } - } - } - - return tokens; - } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/marked/src/Parser.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/marked/src/Parser.js deleted file mode 100644 index a22a2bcf..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/marked/src/Parser.js +++ /dev/null @@ -1,286 +0,0 @@ -import { Renderer } from './Renderer.js'; -import { TextRenderer } from './TextRenderer.js'; -import { Slugger } from './Slugger.js'; -import { defaults } from './defaults.js'; -import { - unescape -} from './helpers.js'; - -/** - * Parsing & Compiling - */ -export class Parser { - constructor(options) { - this.options = options || defaults; - this.options.renderer = this.options.renderer || new Renderer(); - this.renderer = this.options.renderer; - this.renderer.options = this.options; - this.textRenderer = new TextRenderer(); - this.slugger = new Slugger(); - } - - /** - * Static Parse Method - */ - static parse(tokens, options) { - const parser = new Parser(options); - return parser.parse(tokens); - } - - /** - * Static Parse Inline Method - */ - static parseInline(tokens, options) { - const parser = new Parser(options); - return parser.parseInline(tokens); - } - - /** - * Parse Loop - */ - parse(tokens, top = true) { - let out = '', - i, - j, - k, - l2, - l3, - row, - cell, - header, - body, - token, - ordered, - start, - loose, - itemBody, - item, - checked, - task, - checkbox, - ret; - - const l = tokens.length; - for (i = 0; i < l; i++) { - token = tokens[i]; - - // Run any renderer extensions - if (this.options.extensions && this.options.extensions.renderers && this.options.extensions.renderers[token.type]) { - ret = this.options.extensions.renderers[token.type].call({ parser: this }, token); - if (ret !== false || !['space', 'hr', 'heading', 'code', 'table', 'blockquote', 'list', 'html', 'paragraph', 'text'].includes(token.type)) { - out += ret || ''; - continue; - } - } - - switch (token.type) { - case 'space': { - continue; - } - case 'hr': { - out += this.renderer.hr(); - continue; - } - case 'heading': { - out += this.renderer.heading( - this.parseInline(token.tokens), - token.depth, - unescape(this.parseInline(token.tokens, this.textRenderer)), - this.slugger); - continue; - } - case 'code': { - out += this.renderer.code(token.text, - token.lang, - token.escaped); - continue; - } - case 'table': { - header = ''; - - // header - cell = ''; - l2 = token.header.length; - for (j = 0; j < l2; j++) { - cell += this.renderer.tablecell( - this.parseInline(token.header[j].tokens), - { header: true, align: token.align[j] } - ); - } - header += this.renderer.tablerow(cell); - - body = ''; - l2 = token.rows.length; - for (j = 0; j < l2; j++) { - row = token.rows[j]; - - cell = ''; - l3 = row.length; - for (k = 0; k < l3; k++) { - cell += this.renderer.tablecell( - this.parseInline(row[k].tokens), - { header: false, align: token.align[k] } - ); - } - - body += this.renderer.tablerow(cell); - } - out += this.renderer.table(header, body); - continue; - } - case 'blockquote': { - body = this.parse(token.tokens); - out += this.renderer.blockquote(body); - continue; - } - case 'list': { - ordered = token.ordered; - start = token.start; - loose = token.loose; - l2 = token.items.length; - - body = ''; - for (j = 0; j < l2; j++) { - item = token.items[j]; - checked = item.checked; - task = item.task; - - itemBody = ''; - if (item.task) { - checkbox = this.renderer.checkbox(checked); - if (loose) { - if (item.tokens.length > 0 && item.tokens[0].type === 'paragraph') { - item.tokens[0].text = checkbox + ' ' + item.tokens[0].text; - if (item.tokens[0].tokens && item.tokens[0].tokens.length > 0 && item.tokens[0].tokens[0].type === 'text') { - item.tokens[0].tokens[0].text = checkbox + ' ' + item.tokens[0].tokens[0].text; - } - } else { - item.tokens.unshift({ - type: 'text', - text: checkbox - }); - } - } else { - itemBody += checkbox; - } - } - - itemBody += this.parse(item.tokens, loose); - body += this.renderer.listitem(itemBody, task, checked); - } - - out += this.renderer.list(body, ordered, start); - continue; - } - case 'html': { - // TODO parse inline content if parameter markdown=1 - out += this.renderer.html(token.text); - continue; - } - case 'paragraph': { - out += this.renderer.paragraph(this.parseInline(token.tokens)); - continue; - } - case 'text': { - body = token.tokens ? this.parseInline(token.tokens) : token.text; - while (i + 1 < l && tokens[i + 1].type === 'text') { - token = tokens[++i]; - body += '\n' + (token.tokens ? this.parseInline(token.tokens) : token.text); - } - out += top ? this.renderer.paragraph(body) : body; - continue; - } - - default: { - const errMsg = 'Token with "' + token.type + '" type was not found.'; - if (this.options.silent) { - console.error(errMsg); - return; - } else { - throw new Error(errMsg); - } - } - } - } - - return out; - } - - /** - * Parse Inline Tokens - */ - parseInline(tokens, renderer) { - renderer = renderer || this.renderer; - let out = '', - i, - token, - ret; - - const l = tokens.length; - for (i = 0; i < l; i++) { - token = tokens[i]; - - // Run any renderer extensions - if (this.options.extensions && this.options.extensions.renderers && this.options.extensions.renderers[token.type]) { - ret = this.options.extensions.renderers[token.type].call({ parser: this }, token); - if (ret !== false || !['escape', 'html', 'link', 'image', 'strong', 'em', 'codespan', 'br', 'del', 'text'].includes(token.type)) { - out += ret || ''; - continue; - } - } - - switch (token.type) { - case 'escape': { - out += renderer.text(token.text); - break; - } - case 'html': { - out += renderer.html(token.text); - break; - } - case 'link': { - out += renderer.link(token.href, token.title, this.parseInline(token.tokens, renderer)); - break; - } - case 'image': { - out += renderer.image(token.href, token.title, token.text); - break; - } - case 'strong': { - out += renderer.strong(this.parseInline(token.tokens, renderer)); - break; - } - case 'em': { - out += renderer.em(this.parseInline(token.tokens, renderer)); - break; - } - case 'codespan': { - out += renderer.codespan(token.text); - break; - } - case 'br': { - out += renderer.br(); - break; - } - case 'del': { - out += renderer.del(this.parseInline(token.tokens, renderer)); - break; - } - case 'text': { - out += renderer.text(token.text); - break; - } - default: { - const errMsg = 'Token with "' + token.type + '" type was not found.'; - if (this.options.silent) { - console.error(errMsg); - return; - } else { - throw new Error(errMsg); - } - } - } - } - return out; - } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/marked/src/Renderer.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/marked/src/Renderer.js deleted file mode 100644 index 5fe915dd..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/marked/src/Renderer.js +++ /dev/null @@ -1,203 +0,0 @@ -import { defaults } from './defaults.js'; -import { - cleanUrl, - escape -} from './helpers.js'; - -/** - * Renderer - */ -export class Renderer { - constructor(options) { - this.options = options || defaults; - } - - code(code, infostring, escaped) { - const lang = (infostring || '').match(/\S*/)[0]; - if (this.options.highlight) { - const out = this.options.highlight(code, lang); - if (out != null && out !== code) { - escaped = true; - code = out; - } - } - - code = code.replace(/\n$/, '') + '\n'; - - if (!lang) { - return '
    '
    -        + (escaped ? code : escape(code, true))
    -        + '
    \n'; - } - - return '
    '
    -      + (escaped ? code : escape(code, true))
    -      + '
    \n'; - } - - /** - * @param {string} quote - */ - blockquote(quote) { - return `
    \n${quote}
    \n`; - } - - html(html) { - return html; - } - - /** - * @param {string} text - * @param {string} level - * @param {string} raw - * @param {any} slugger - */ - heading(text, level, raw, slugger) { - if (this.options.headerIds) { - const id = this.options.headerPrefix + slugger.slug(raw); - return `${text}\n`; - } - - // ignore IDs - return `${text}\n`; - } - - hr() { - return this.options.xhtml ? '
    \n' : '
    \n'; - } - - list(body, ordered, start) { - const type = ordered ? 'ol' : 'ul', - startatt = (ordered && start !== 1) ? (' start="' + start + '"') : ''; - return '<' + type + startatt + '>\n' + body + '\n'; - } - - /** - * @param {string} text - */ - listitem(text) { - return `
  • ${text}
  • \n`; - } - - checkbox(checked) { - return ' '; - } - - /** - * @param {string} text - */ - paragraph(text) { - return `

    ${text}

    \n`; - } - - /** - * @param {string} header - * @param {string} body - */ - table(header, body) { - if (body) body = `${body}`; - - return '\n' - + '\n' - + header - + '\n' - + body - + '
    \n'; - } - - /** - * @param {string} content - */ - tablerow(content) { - return `\n${content}\n`; - } - - tablecell(content, flags) { - const type = flags.header ? 'th' : 'td'; - const tag = flags.align - ? `<${type} align="${flags.align}">` - : `<${type}>`; - return tag + content + `\n`; - } - - /** - * span level renderer - * @param {string} text - */ - strong(text) { - return `${text}`; - } - - /** - * @param {string} text - */ - em(text) { - return `${text}`; - } - - /** - * @param {string} text - */ - codespan(text) { - return `${text}`; - } - - br() { - return this.options.xhtml ? '
    ' : '
    '; - } - - /** - * @param {string} text - */ - del(text) { - return `${text}`; - } - - /** - * @param {string} href - * @param {string} title - * @param {string} text - */ - link(href, title, text) { - href = cleanUrl(this.options.sanitize, this.options.baseUrl, href); - if (href === null) { - return text; - } - let out = ''; - return out; - } - - /** - * @param {string} href - * @param {string} title - * @param {string} text - */ - image(href, title, text) { - href = cleanUrl(this.options.sanitize, this.options.baseUrl, href); - if (href === null) { - return text; - } - - let out = `${text}' : '>'; - return out; - } - - text(text) { - return text; - } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/marked/src/Slugger.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/marked/src/Slugger.js deleted file mode 100644 index a0b68f51..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/marked/src/Slugger.js +++ /dev/null @@ -1,55 +0,0 @@ -/** - * Slugger generates header id - */ -export class Slugger { - constructor() { - this.seen = {}; - } - - /** - * @param {string} value - */ - serialize(value) { - return value - .toLowerCase() - .trim() - // remove html tags - .replace(/<[!\/a-z].*?>/ig, '') - // remove unwanted chars - .replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g, '') - .replace(/\s/g, '-'); - } - - /** - * Finds the next safe (unique) slug to use - * @param {string} originalSlug - * @param {boolean} isDryRun - */ - getNextSafeSlug(originalSlug, isDryRun) { - let slug = originalSlug; - let occurenceAccumulator = 0; - if (this.seen.hasOwnProperty(slug)) { - occurenceAccumulator = this.seen[originalSlug]; - do { - occurenceAccumulator++; - slug = originalSlug + '-' + occurenceAccumulator; - } while (this.seen.hasOwnProperty(slug)); - } - if (!isDryRun) { - this.seen[originalSlug] = occurenceAccumulator; - this.seen[slug] = 0; - } - return slug; - } - - /** - * Convert string to unique id - * @param {object} [options] - * @param {boolean} [options.dryrun] Generates the next unique slug without - * updating the internal accumulator. - */ - slug(value, options = {}) { - const slug = this.serialize(value); - return this.getNextSafeSlug(slug, options.dryrun); - } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/marked/src/TextRenderer.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/marked/src/TextRenderer.js deleted file mode 100644 index 4d6e08f5..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/marked/src/TextRenderer.js +++ /dev/null @@ -1,42 +0,0 @@ -/** - * TextRenderer - * returns only the textual part of the token - */ -export class TextRenderer { - // no need for block level renderers - strong(text) { - return text; - } - - em(text) { - return text; - } - - codespan(text) { - return text; - } - - del(text) { - return text; - } - - html(text) { - return text; - } - - text(text) { - return text; - } - - link(href, title, text) { - return '' + text; - } - - image(href, title, text) { - return '' + text; - } - - br() { - return ''; - } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/marked/src/Tokenizer.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/marked/src/Tokenizer.js deleted file mode 100644 index 42064621..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/marked/src/Tokenizer.js +++ /dev/null @@ -1,779 +0,0 @@ -import { defaults } from './defaults.js'; -import { - rtrim, - splitCells, - escape, - findClosingBracket -} from './helpers.js'; - -function outputLink(cap, link, raw, lexer) { - const href = link.href; - const title = link.title ? escape(link.title) : null; - const text = cap[1].replace(/\\([\[\]])/g, '$1'); - - if (cap[0].charAt(0) !== '!') { - lexer.state.inLink = true; - const token = { - type: 'link', - raw, - href, - title, - text, - tokens: lexer.inlineTokens(text) - }; - lexer.state.inLink = false; - return token; - } - return { - type: 'image', - raw, - href, - title, - text: escape(text) - }; -} - -function indentCodeCompensation(raw, text) { - const matchIndentToCode = raw.match(/^(\s+)(?:```)/); - - if (matchIndentToCode === null) { - return text; - } - - const indentToCode = matchIndentToCode[1]; - - return text - .split('\n') - .map(node => { - const matchIndentInNode = node.match(/^\s+/); - if (matchIndentInNode === null) { - return node; - } - - const [indentInNode] = matchIndentInNode; - - if (indentInNode.length >= indentToCode.length) { - return node.slice(indentToCode.length); - } - - return node; - }) - .join('\n'); -} - -/** - * Tokenizer - */ -export class Tokenizer { - constructor(options) { - this.options = options || defaults; - } - - space(src) { - const cap = this.rules.block.newline.exec(src); - if (cap && cap[0].length > 0) { - return { - type: 'space', - raw: cap[0] - }; - } - } - - code(src) { - const cap = this.rules.block.code.exec(src); - if (cap) { - const text = cap[0].replace(/^ {1,4}/gm, ''); - return { - type: 'code', - raw: cap[0], - codeBlockStyle: 'indented', - text: !this.options.pedantic - ? rtrim(text, '\n') - : text - }; - } - } - - fences(src) { - const cap = this.rules.block.fences.exec(src); - if (cap) { - const raw = cap[0]; - const text = indentCodeCompensation(raw, cap[3] || ''); - - return { - type: 'code', - raw, - lang: cap[2] ? cap[2].trim().replace(this.rules.inline._escapes, '$1') : cap[2], - text - }; - } - } - - heading(src) { - const cap = this.rules.block.heading.exec(src); - if (cap) { - let text = cap[2].trim(); - - // remove trailing #s - if (/#$/.test(text)) { - const trimmed = rtrim(text, '#'); - if (this.options.pedantic) { - text = trimmed.trim(); - } else if (!trimmed || / $/.test(trimmed)) { - // CommonMark requires space before trailing #s - text = trimmed.trim(); - } - } - - return { - type: 'heading', - raw: cap[0], - depth: cap[1].length, - text, - tokens: this.lexer.inline(text) - }; - } - } - - hr(src) { - const cap = this.rules.block.hr.exec(src); - if (cap) { - return { - type: 'hr', - raw: cap[0] - }; - } - } - - blockquote(src) { - const cap = this.rules.block.blockquote.exec(src); - if (cap) { - const text = cap[0].replace(/^ *>[ \t]?/gm, ''); - - return { - type: 'blockquote', - raw: cap[0], - tokens: this.lexer.blockTokens(text, []), - text - }; - } - } - - list(src) { - let cap = this.rules.block.list.exec(src); - if (cap) { - let raw, istask, ischecked, indent, i, blankLine, endsWithBlankLine, - line, nextLine, rawLine, itemContents, endEarly; - - let bull = cap[1].trim(); - const isordered = bull.length > 1; - - const list = { - type: 'list', - raw: '', - ordered: isordered, - start: isordered ? +bull.slice(0, -1) : '', - loose: false, - items: [] - }; - - bull = isordered ? `\\d{1,9}\\${bull.slice(-1)}` : `\\${bull}`; - - if (this.options.pedantic) { - bull = isordered ? bull : '[*+-]'; - } - - // Get next list item - const itemRegex = new RegExp(`^( {0,3}${bull})((?:[\t ][^\\n]*)?(?:\\n|$))`); - - // Check if current bullet point can start a new List Item - while (src) { - endEarly = false; - if (!(cap = itemRegex.exec(src))) { - break; - } - - if (this.rules.block.hr.test(src)) { // End list if bullet was actually HR (possibly move into itemRegex?) - break; - } - - raw = cap[0]; - src = src.substring(raw.length); - - line = cap[2].split('\n', 1)[0]; - nextLine = src.split('\n', 1)[0]; - - if (this.options.pedantic) { - indent = 2; - itemContents = line.trimLeft(); - } else { - indent = cap[2].search(/[^ ]/); // Find first non-space char - indent = indent > 4 ? 1 : indent; // Treat indented code blocks (> 4 spaces) as having only 1 indent - itemContents = line.slice(indent); - indent += cap[1].length; - } - - blankLine = false; - - if (!line && /^ *$/.test(nextLine)) { // Items begin with at most one blank line - raw += nextLine + '\n'; - src = src.substring(nextLine.length + 1); - endEarly = true; - } - - if (!endEarly) { - const nextBulletRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}(?:[*+-]|\\d{1,9}[.)])((?: [^\\n]*)?(?:\\n|$))`); - const hrRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`); - const fencesBeginRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}(?:\`\`\`|~~~)`); - const headingBeginRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}#`); - - // Check if following lines should be included in List Item - while (src) { - rawLine = src.split('\n', 1)[0]; - line = rawLine; - - // Re-align to follow commonmark nesting rules - if (this.options.pedantic) { - line = line.replace(/^ {1,4}(?=( {4})*[^ ])/g, ' '); - } - - // End list item if found code fences - if (fencesBeginRegex.test(line)) { - break; - } - - // End list item if found start of new heading - if (headingBeginRegex.test(line)) { - break; - } - - // End list item if found start of new bullet - if (nextBulletRegex.test(line)) { - break; - } - - // Horizontal rule found - if (hrRegex.test(src)) { - break; - } - - if (line.search(/[^ ]/) >= indent || !line.trim()) { // Dedent if possible - itemContents += '\n' + line.slice(indent); - } else if (!blankLine) { // Until blank line, item doesn't need indentation - itemContents += '\n' + line; - } else { // Otherwise, improper indentation ends this item - break; - } - - if (!blankLine && !line.trim()) { // Check if current line is blank - blankLine = true; - } - - raw += rawLine + '\n'; - src = src.substring(rawLine.length + 1); - } - } - - if (!list.loose) { - // If the previous item ended with a blank line, the list is loose - if (endsWithBlankLine) { - list.loose = true; - } else if (/\n *\n *$/.test(raw)) { - endsWithBlankLine = true; - } - } - - // Check for task list items - if (this.options.gfm) { - istask = /^\[[ xX]\] /.exec(itemContents); - if (istask) { - ischecked = istask[0] !== '[ ] '; - itemContents = itemContents.replace(/^\[[ xX]\] +/, ''); - } - } - - list.items.push({ - type: 'list_item', - raw, - task: !!istask, - checked: ischecked, - loose: false, - text: itemContents - }); - - list.raw += raw; - } - - // Do not consume newlines at end of final item. Alternatively, make itemRegex *start* with any newlines to simplify/speed up endsWithBlankLine logic - list.items[list.items.length - 1].raw = raw.trimRight(); - list.items[list.items.length - 1].text = itemContents.trimRight(); - list.raw = list.raw.trimRight(); - - const l = list.items.length; - - // Item child tokens handled here at end because we needed to have the final item to trim it first - for (i = 0; i < l; i++) { - this.lexer.state.top = false; - list.items[i].tokens = this.lexer.blockTokens(list.items[i].text, []); - const spacers = list.items[i].tokens.filter(t => t.type === 'space'); - const hasMultipleLineBreaks = spacers.every(t => { - const chars = t.raw.split(''); - let lineBreaks = 0; - for (const char of chars) { - if (char === '\n') { - lineBreaks += 1; - } - if (lineBreaks > 1) { - return true; - } - } - - return false; - }); - - if (!list.loose && spacers.length && hasMultipleLineBreaks) { - // Having a single line break doesn't mean a list is loose. A single line break is terminating the last list item - list.loose = true; - list.items[i].loose = true; - } - } - - return list; - } - } - - html(src) { - const cap = this.rules.block.html.exec(src); - if (cap) { - const token = { - type: 'html', - raw: cap[0], - pre: !this.options.sanitizer - && (cap[1] === 'pre' || cap[1] === 'script' || cap[1] === 'style'), - text: cap[0] - }; - if (this.options.sanitize) { - const text = this.options.sanitizer ? this.options.sanitizer(cap[0]) : escape(cap[0]); - token.type = 'paragraph'; - token.text = text; - token.tokens = this.lexer.inline(text); - } - return token; - } - } - - def(src) { - const cap = this.rules.block.def.exec(src); - if (cap) { - const tag = cap[1].toLowerCase().replace(/\s+/g, ' '); - const href = cap[2] ? cap[2].replace(/^<(.*)>$/, '$1').replace(this.rules.inline._escapes, '$1') : ''; - const title = cap[3] ? cap[3].substring(1, cap[3].length - 1).replace(this.rules.inline._escapes, '$1') : cap[3]; - return { - type: 'def', - tag, - raw: cap[0], - href, - title - }; - } - } - - table(src) { - const cap = this.rules.block.table.exec(src); - if (cap) { - const item = { - type: 'table', - header: splitCells(cap[1]).map(c => { return { text: c }; }), - align: cap[2].replace(/^ *|\| *$/g, '').split(/ *\| */), - rows: cap[3] && cap[3].trim() ? cap[3].replace(/\n[ \t]*$/, '').split('\n') : [] - }; - - if (item.header.length === item.align.length) { - item.raw = cap[0]; - - let l = item.align.length; - let i, j, k, row; - for (i = 0; i < l; i++) { - if (/^ *-+: *$/.test(item.align[i])) { - item.align[i] = 'right'; - } else if (/^ *:-+: *$/.test(item.align[i])) { - item.align[i] = 'center'; - } else if (/^ *:-+ *$/.test(item.align[i])) { - item.align[i] = 'left'; - } else { - item.align[i] = null; - } - } - - l = item.rows.length; - for (i = 0; i < l; i++) { - item.rows[i] = splitCells(item.rows[i], item.header.length).map(c => { return { text: c }; }); - } - - // parse child tokens inside headers and cells - - // header child tokens - l = item.header.length; - for (j = 0; j < l; j++) { - item.header[j].tokens = this.lexer.inline(item.header[j].text); - } - - // cell child tokens - l = item.rows.length; - for (j = 0; j < l; j++) { - row = item.rows[j]; - for (k = 0; k < row.length; k++) { - row[k].tokens = this.lexer.inline(row[k].text); - } - } - - return item; - } - } - } - - lheading(src) { - const cap = this.rules.block.lheading.exec(src); - if (cap) { - return { - type: 'heading', - raw: cap[0], - depth: cap[2].charAt(0) === '=' ? 1 : 2, - text: cap[1], - tokens: this.lexer.inline(cap[1]) - }; - } - } - - paragraph(src) { - const cap = this.rules.block.paragraph.exec(src); - if (cap) { - const text = cap[1].charAt(cap[1].length - 1) === '\n' - ? cap[1].slice(0, -1) - : cap[1]; - return { - type: 'paragraph', - raw: cap[0], - text, - tokens: this.lexer.inline(text) - }; - } - } - - text(src) { - const cap = this.rules.block.text.exec(src); - if (cap) { - return { - type: 'text', - raw: cap[0], - text: cap[0], - tokens: this.lexer.inline(cap[0]) - }; - } - } - - escape(src) { - const cap = this.rules.inline.escape.exec(src); - if (cap) { - return { - type: 'escape', - raw: cap[0], - text: escape(cap[1]) - }; - } - } - - tag(src) { - const cap = this.rules.inline.tag.exec(src); - if (cap) { - if (!this.lexer.state.inLink && /^/i.test(cap[0])) { - this.lexer.state.inLink = false; - } - if (!this.lexer.state.inRawBlock && /^<(pre|code|kbd|script)(\s|>)/i.test(cap[0])) { - this.lexer.state.inRawBlock = true; - } else if (this.lexer.state.inRawBlock && /^<\/(pre|code|kbd|script)(\s|>)/i.test(cap[0])) { - this.lexer.state.inRawBlock = false; - } - - return { - type: this.options.sanitize - ? 'text' - : 'html', - raw: cap[0], - inLink: this.lexer.state.inLink, - inRawBlock: this.lexer.state.inRawBlock, - text: this.options.sanitize - ? (this.options.sanitizer - ? this.options.sanitizer(cap[0]) - : escape(cap[0])) - : cap[0] - }; - } - } - - link(src) { - const cap = this.rules.inline.link.exec(src); - if (cap) { - const trimmedUrl = cap[2].trim(); - if (!this.options.pedantic && /^$/.test(trimmedUrl))) { - return; - } - - // ending angle bracket cannot be escaped - const rtrimSlash = rtrim(trimmedUrl.slice(0, -1), '\\'); - if ((trimmedUrl.length - rtrimSlash.length) % 2 === 0) { - return; - } - } else { - // find closing parenthesis - const lastParenIndex = findClosingBracket(cap[2], '()'); - if (lastParenIndex > -1) { - const start = cap[0].indexOf('!') === 0 ? 5 : 4; - const linkLen = start + cap[1].length + lastParenIndex; - cap[2] = cap[2].substring(0, lastParenIndex); - cap[0] = cap[0].substring(0, linkLen).trim(); - cap[3] = ''; - } - } - let href = cap[2]; - let title = ''; - if (this.options.pedantic) { - // split pedantic href and title - const link = /^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(href); - - if (link) { - href = link[1]; - title = link[3]; - } - } else { - title = cap[3] ? cap[3].slice(1, -1) : ''; - } - - href = href.trim(); - if (/^$/.test(trimmedUrl))) { - // pedantic allows starting angle bracket without ending angle bracket - href = href.slice(1); - } else { - href = href.slice(1, -1); - } - } - return outputLink(cap, { - href: href ? href.replace(this.rules.inline._escapes, '$1') : href, - title: title ? title.replace(this.rules.inline._escapes, '$1') : title - }, cap[0], this.lexer); - } - } - - reflink(src, links) { - let cap; - if ((cap = this.rules.inline.reflink.exec(src)) - || (cap = this.rules.inline.nolink.exec(src))) { - let link = (cap[2] || cap[1]).replace(/\s+/g, ' '); - link = links[link.toLowerCase()]; - if (!link) { - const text = cap[0].charAt(0); - return { - type: 'text', - raw: text, - text - }; - } - return outputLink(cap, link, cap[0], this.lexer); - } - } - - emStrong(src, maskedSrc, prevChar = '') { - let match = this.rules.inline.emStrong.lDelim.exec(src); - if (!match) return; - - // _ can't be between two alphanumerics. \p{L}\p{N} includes non-english alphabet/numbers as well - if (match[3] && prevChar.match(/[\p{L}\p{N}]/u)) return; - - const nextChar = match[1] || match[2] || ''; - - if (!nextChar || (nextChar && (prevChar === '' || this.rules.inline.punctuation.exec(prevChar)))) { - const lLength = match[0].length - 1; - let rDelim, rLength, delimTotal = lLength, midDelimTotal = 0; - - const endReg = match[0][0] === '*' ? this.rules.inline.emStrong.rDelimAst : this.rules.inline.emStrong.rDelimUnd; - endReg.lastIndex = 0; - - // Clip maskedSrc to same section of string as src (move to lexer?) - maskedSrc = maskedSrc.slice(-1 * src.length + lLength); - - while ((match = endReg.exec(maskedSrc)) != null) { - rDelim = match[1] || match[2] || match[3] || match[4] || match[5] || match[6]; - - if (!rDelim) continue; // skip single * in __abc*abc__ - - rLength = rDelim.length; - - if (match[3] || match[4]) { // found another Left Delim - delimTotal += rLength; - continue; - } else if (match[5] || match[6]) { // either Left or Right Delim - if (lLength % 3 && !((lLength + rLength) % 3)) { - midDelimTotal += rLength; - continue; // CommonMark Emphasis Rules 9-10 - } - } - - delimTotal -= rLength; - - if (delimTotal > 0) continue; // Haven't found enough closing delimiters - - // Remove extra characters. *a*** -> *a* - rLength = Math.min(rLength, rLength + delimTotal + midDelimTotal); - - const raw = src.slice(0, lLength + match.index + (match[0].length - rDelim.length) + rLength); - - // Create `em` if smallest delimiter has odd char count. *a*** - if (Math.min(lLength, rLength) % 2) { - const text = raw.slice(1, -1); - return { - type: 'em', - raw, - text, - tokens: this.lexer.inlineTokens(text) - }; - } - - // Create 'strong' if smallest delimiter has even char count. **a*** - const text = raw.slice(2, -2); - return { - type: 'strong', - raw, - text, - tokens: this.lexer.inlineTokens(text) - }; - } - } - } - - codespan(src) { - const cap = this.rules.inline.code.exec(src); - if (cap) { - let text = cap[2].replace(/\n/g, ' '); - const hasNonSpaceChars = /[^ ]/.test(text); - const hasSpaceCharsOnBothEnds = /^ /.test(text) && / $/.test(text); - if (hasNonSpaceChars && hasSpaceCharsOnBothEnds) { - text = text.substring(1, text.length - 1); - } - text = escape(text, true); - return { - type: 'codespan', - raw: cap[0], - text - }; - } - } - - br(src) { - const cap = this.rules.inline.br.exec(src); - if (cap) { - return { - type: 'br', - raw: cap[0] - }; - } - } - - del(src) { - const cap = this.rules.inline.del.exec(src); - if (cap) { - return { - type: 'del', - raw: cap[0], - text: cap[2], - tokens: this.lexer.inlineTokens(cap[2]) - }; - } - } - - autolink(src, mangle) { - const cap = this.rules.inline.autolink.exec(src); - if (cap) { - let text, href; - if (cap[2] === '@') { - text = escape(this.options.mangle ? mangle(cap[1]) : cap[1]); - href = 'mailto:' + text; - } else { - text = escape(cap[1]); - href = text; - } - - return { - type: 'link', - raw: cap[0], - text, - href, - tokens: [ - { - type: 'text', - raw: text, - text - } - ] - }; - } - } - - url(src, mangle) { - let cap; - if (cap = this.rules.inline.url.exec(src)) { - let text, href; - if (cap[2] === '@') { - text = escape(this.options.mangle ? mangle(cap[0]) : cap[0]); - href = 'mailto:' + text; - } else { - // do extended autolink path validation - let prevCapZero; - do { - prevCapZero = cap[0]; - cap[0] = this.rules.inline._backpedal.exec(cap[0])[0]; - } while (prevCapZero !== cap[0]); - text = escape(cap[0]); - if (cap[1] === 'www.') { - href = 'http://' + text; - } else { - href = text; - } - } - return { - type: 'link', - raw: cap[0], - text, - href, - tokens: [ - { - type: 'text', - raw: text, - text - } - ] - }; - } - } - - inlineText(src, smartypants) { - const cap = this.rules.inline.text.exec(src); - if (cap) { - let text; - if (this.lexer.state.inRawBlock) { - text = this.options.sanitize ? (this.options.sanitizer ? this.options.sanitizer(cap[0]) : escape(cap[0])) : cap[0]; - } else { - text = escape(this.options.smartypants ? smartypants(cap[0]) : cap[0]); - } - return { - type: 'text', - raw: cap[0], - text - }; - } - } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/marked/src/defaults.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/marked/src/defaults.js deleted file mode 100644 index a1ae5136..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/marked/src/defaults.js +++ /dev/null @@ -1,29 +0,0 @@ -export function getDefaults() { - return { - async: false, - baseUrl: null, - breaks: false, - extensions: null, - gfm: true, - headerIds: true, - headerPrefix: '', - highlight: null, - langPrefix: 'language-', - mangle: true, - pedantic: false, - renderer: null, - sanitize: false, - sanitizer: null, - silent: false, - smartypants: false, - tokenizer: null, - walkTokens: null, - xhtml: false - }; -} - -export let defaults = getDefaults(); - -export function changeDefaults(newDefaults) { - defaults = newDefaults; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/marked/src/helpers.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/marked/src/helpers.js deleted file mode 100644 index 711b5d19..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/marked/src/helpers.js +++ /dev/null @@ -1,276 +0,0 @@ -/** - * Helpers - */ -const escapeTest = /[&<>"']/; -const escapeReplace = new RegExp(escapeTest.source, 'g'); -const escapeTestNoEncode = /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/; -const escapeReplaceNoEncode = new RegExp(escapeTestNoEncode.source, 'g'); -const escapeReplacements = { - '&': '&', - '<': '<', - '>': '>', - '"': '"', - "'": ''' -}; -const getEscapeReplacement = (ch) => escapeReplacements[ch]; -export function escape(html, encode) { - if (encode) { - if (escapeTest.test(html)) { - return html.replace(escapeReplace, getEscapeReplacement); - } - } else { - if (escapeTestNoEncode.test(html)) { - return html.replace(escapeReplaceNoEncode, getEscapeReplacement); - } - } - - return html; -} - -const unescapeTest = /&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig; - -/** - * @param {string} html - */ -export function unescape(html) { - // explicitly match decimal, hex, and named HTML entities - return html.replace(unescapeTest, (_, n) => { - n = n.toLowerCase(); - if (n === 'colon') return ':'; - if (n.charAt(0) === '#') { - return n.charAt(1) === 'x' - ? String.fromCharCode(parseInt(n.substring(2), 16)) - : String.fromCharCode(+n.substring(1)); - } - return ''; - }); -} - -const caret = /(^|[^\[])\^/g; - -/** - * @param {string | RegExp} regex - * @param {string} opt - */ -export function edit(regex, opt) { - regex = typeof regex === 'string' ? regex : regex.source; - opt = opt || ''; - const obj = { - replace: (name, val) => { - val = val.source || val; - val = val.replace(caret, '$1'); - regex = regex.replace(name, val); - return obj; - }, - getRegex: () => { - return new RegExp(regex, opt); - } - }; - return obj; -} - -const nonWordAndColonTest = /[^\w:]/g; -const originIndependentUrl = /^$|^[a-z][a-z0-9+.-]*:|^[?#]/i; - -/** - * @param {boolean} sanitize - * @param {string} base - * @param {string} href - */ -export function cleanUrl(sanitize, base, href) { - if (sanitize) { - let prot; - try { - prot = decodeURIComponent(unescape(href)) - .replace(nonWordAndColonTest, '') - .toLowerCase(); - } catch (e) { - return null; - } - if (prot.indexOf('javascript:') === 0 || prot.indexOf('vbscript:') === 0 || prot.indexOf('data:') === 0) { - return null; - } - } - if (base && !originIndependentUrl.test(href)) { - href = resolveUrl(base, href); - } - try { - href = encodeURI(href).replace(/%25/g, '%'); - } catch (e) { - return null; - } - return href; -} - -const baseUrls = {}; -const justDomain = /^[^:]+:\/*[^/]*$/; -const protocol = /^([^:]+:)[\s\S]*$/; -const domain = /^([^:]+:\/*[^/]*)[\s\S]*$/; - -/** - * @param {string} base - * @param {string} href - */ -export function resolveUrl(base, href) { - if (!baseUrls[' ' + base]) { - // we can ignore everything in base after the last slash of its path component, - // but we might need to add _that_ - // https://tools.ietf.org/html/rfc3986#section-3 - if (justDomain.test(base)) { - baseUrls[' ' + base] = base + '/'; - } else { - baseUrls[' ' + base] = rtrim(base, '/', true); - } - } - base = baseUrls[' ' + base]; - const relativeBase = base.indexOf(':') === -1; - - if (href.substring(0, 2) === '//') { - if (relativeBase) { - return href; - } - return base.replace(protocol, '$1') + href; - } else if (href.charAt(0) === '/') { - if (relativeBase) { - return href; - } - return base.replace(domain, '$1') + href; - } else { - return base + href; - } -} - -export const noopTest = { exec: function noopTest() {} }; - -export function merge(obj) { - let i = 1, - target, - key; - - for (; i < arguments.length; i++) { - target = arguments[i]; - for (key in target) { - if (Object.prototype.hasOwnProperty.call(target, key)) { - obj[key] = target[key]; - } - } - } - - return obj; -} - -export function splitCells(tableRow, count) { - // ensure that every cell-delimiting pipe has a space - // before it to distinguish it from an escaped pipe - const row = tableRow.replace(/\|/g, (match, offset, str) => { - let escaped = false, - curr = offset; - while (--curr >= 0 && str[curr] === '\\') escaped = !escaped; - if (escaped) { - // odd number of slashes means | is escaped - // so we leave it alone - return '|'; - } else { - // add space before unescaped | - return ' |'; - } - }), - cells = row.split(/ \|/); - let i = 0; - - // First/last cell in a row cannot be empty if it has no leading/trailing pipe - if (!cells[0].trim()) { cells.shift(); } - if (cells.length > 0 && !cells[cells.length - 1].trim()) { cells.pop(); } - - if (cells.length > count) { - cells.splice(count); - } else { - while (cells.length < count) cells.push(''); - } - - for (; i < cells.length; i++) { - // leading or trailing whitespace is ignored per the gfm spec - cells[i] = cells[i].trim().replace(/\\\|/g, '|'); - } - return cells; -} - -/** - * Remove trailing 'c's. Equivalent to str.replace(/c*$/, ''). - * /c*$/ is vulnerable to REDOS. - * - * @param {string} str - * @param {string} c - * @param {boolean} invert Remove suffix of non-c chars instead. Default falsey. - */ -export function rtrim(str, c, invert) { - const l = str.length; - if (l === 0) { - return ''; - } - - // Length of suffix matching the invert condition. - let suffLen = 0; - - // Step left until we fail to match the invert condition. - while (suffLen < l) { - const currChar = str.charAt(l - suffLen - 1); - if (currChar === c && !invert) { - suffLen++; - } else if (currChar !== c && invert) { - suffLen++; - } else { - break; - } - } - - return str.slice(0, l - suffLen); -} - -export function findClosingBracket(str, b) { - if (str.indexOf(b[1]) === -1) { - return -1; - } - const l = str.length; - let level = 0, - i = 0; - for (; i < l; i++) { - if (str[i] === '\\') { - i++; - } else if (str[i] === b[0]) { - level++; - } else if (str[i] === b[1]) { - level--; - if (level < 0) { - return i; - } - } - } - return -1; -} - -export function checkSanitizeDeprecation(opt) { - if (opt && opt.sanitize && !opt.silent) { - console.warn('marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options'); - } -} - -// copied from https://stackoverflow.com/a/5450113/806777 -/** - * @param {string} pattern - * @param {number} count - */ -export function repeatString(pattern, count) { - if (count < 1) { - return ''; - } - let result = ''; - while (count > 1) { - if (count & 1) { - result += pattern; - } - count >>= 1; - pattern += pattern; - } - return result + pattern; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/marked/src/marked.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/marked/src/marked.js deleted file mode 100644 index 157c8ec2..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/marked/src/marked.js +++ /dev/null @@ -1,366 +0,0 @@ -import { Lexer } from './Lexer.js'; -import { Parser } from './Parser.js'; -import { Tokenizer } from './Tokenizer.js'; -import { Renderer } from './Renderer.js'; -import { TextRenderer } from './TextRenderer.js'; -import { Slugger } from './Slugger.js'; -import { - merge, - checkSanitizeDeprecation, - escape -} from './helpers.js'; -import { - getDefaults, - changeDefaults, - defaults -} from './defaults.js'; - -/** - * Marked - */ -export function marked(src, opt, callback) { - // throw error in case of non string input - if (typeof src === 'undefined' || src === null) { - throw new Error('marked(): input parameter is undefined or null'); - } - if (typeof src !== 'string') { - throw new Error('marked(): input parameter is of type ' - + Object.prototype.toString.call(src) + ', string expected'); - } - - if (typeof opt === 'function') { - callback = opt; - opt = null; - } - - opt = merge({}, marked.defaults, opt || {}); - checkSanitizeDeprecation(opt); - - if (callback) { - const highlight = opt.highlight; - let tokens; - - try { - tokens = Lexer.lex(src, opt); - } catch (e) { - return callback(e); - } - - const done = function(err) { - let out; - - if (!err) { - try { - if (opt.walkTokens) { - marked.walkTokens(tokens, opt.walkTokens); - } - out = Parser.parse(tokens, opt); - } catch (e) { - err = e; - } - } - - opt.highlight = highlight; - - return err - ? callback(err) - : callback(null, out); - }; - - if (!highlight || highlight.length < 3) { - return done(); - } - - delete opt.highlight; - - if (!tokens.length) return done(); - - let pending = 0; - marked.walkTokens(tokens, function(token) { - if (token.type === 'code') { - pending++; - setTimeout(() => { - highlight(token.text, token.lang, function(err, code) { - if (err) { - return done(err); - } - if (code != null && code !== token.text) { - token.text = code; - token.escaped = true; - } - - pending--; - if (pending === 0) { - done(); - } - }); - }, 0); - } - }); - - if (pending === 0) { - done(); - } - - return; - } - - function onError(e) { - e.message += '\nPlease report this to https://github.com/markedjs/marked.'; - if (opt.silent) { - return '

    An error occurred:

    '
    -        + escape(e.message + '', true)
    -        + '
    '; - } - throw e; - } - - try { - const tokens = Lexer.lex(src, opt); - if (opt.walkTokens) { - if (opt.async) { - return Promise.all(marked.walkTokens(tokens, opt.walkTokens)) - .then(() => { - return Parser.parse(tokens, opt); - }) - .catch(onError); - } - marked.walkTokens(tokens, opt.walkTokens); - } - return Parser.parse(tokens, opt); - } catch (e) { - onError(e); - } -} - -/** - * Options - */ - -marked.options = -marked.setOptions = function(opt) { - merge(marked.defaults, opt); - changeDefaults(marked.defaults); - return marked; -}; - -marked.getDefaults = getDefaults; - -marked.defaults = defaults; - -/** - * Use Extension - */ - -marked.use = function(...args) { - const extensions = marked.defaults.extensions || { renderers: {}, childTokens: {} }; - - args.forEach((pack) => { - // copy options to new object - const opts = merge({}, pack); - - // set async to true if it was set to true before - opts.async = marked.defaults.async || opts.async; - - // ==-- Parse "addon" extensions --== // - if (pack.extensions) { - pack.extensions.forEach((ext) => { - if (!ext.name) { - throw new Error('extension name required'); - } - if (ext.renderer) { // Renderer extensions - const prevRenderer = extensions.renderers[ext.name]; - if (prevRenderer) { - // Replace extension with func to run new extension but fall back if false - extensions.renderers[ext.name] = function(...args) { - let ret = ext.renderer.apply(this, args); - if (ret === false) { - ret = prevRenderer.apply(this, args); - } - return ret; - }; - } else { - extensions.renderers[ext.name] = ext.renderer; - } - } - if (ext.tokenizer) { // Tokenizer Extensions - if (!ext.level || (ext.level !== 'block' && ext.level !== 'inline')) { - throw new Error("extension level must be 'block' or 'inline'"); - } - if (extensions[ext.level]) { - extensions[ext.level].unshift(ext.tokenizer); - } else { - extensions[ext.level] = [ext.tokenizer]; - } - if (ext.start) { // Function to check for start of token - if (ext.level === 'block') { - if (extensions.startBlock) { - extensions.startBlock.push(ext.start); - } else { - extensions.startBlock = [ext.start]; - } - } else if (ext.level === 'inline') { - if (extensions.startInline) { - extensions.startInline.push(ext.start); - } else { - extensions.startInline = [ext.start]; - } - } - } - } - if (ext.childTokens) { // Child tokens to be visited by walkTokens - extensions.childTokens[ext.name] = ext.childTokens; - } - }); - opts.extensions = extensions; - } - - // ==-- Parse "overwrite" extensions --== // - if (pack.renderer) { - const renderer = marked.defaults.renderer || new Renderer(); - for (const prop in pack.renderer) { - const prevRenderer = renderer[prop]; - // Replace renderer with func to run extension, but fall back if false - renderer[prop] = (...args) => { - let ret = pack.renderer[prop].apply(renderer, args); - if (ret === false) { - ret = prevRenderer.apply(renderer, args); - } - return ret; - }; - } - opts.renderer = renderer; - } - if (pack.tokenizer) { - const tokenizer = marked.defaults.tokenizer || new Tokenizer(); - for (const prop in pack.tokenizer) { - const prevTokenizer = tokenizer[prop]; - // Replace tokenizer with func to run extension, but fall back if false - tokenizer[prop] = (...args) => { - let ret = pack.tokenizer[prop].apply(tokenizer, args); - if (ret === false) { - ret = prevTokenizer.apply(tokenizer, args); - } - return ret; - }; - } - opts.tokenizer = tokenizer; - } - - // ==-- Parse WalkTokens extensions --== // - if (pack.walkTokens) { - const walkTokens = marked.defaults.walkTokens; - opts.walkTokens = function(token) { - let values = []; - values.push(pack.walkTokens.call(this, token)); - if (walkTokens) { - values = values.concat(walkTokens.call(this, token)); - } - return values; - }; - } - - marked.setOptions(opts); - }); -}; - -/** - * Run callback for every token - */ - -marked.walkTokens = function(tokens, callback) { - let values = []; - for (const token of tokens) { - values = values.concat(callback.call(marked, token)); - switch (token.type) { - case 'table': { - for (const cell of token.header) { - values = values.concat(marked.walkTokens(cell.tokens, callback)); - } - for (const row of token.rows) { - for (const cell of row) { - values = values.concat(marked.walkTokens(cell.tokens, callback)); - } - } - break; - } - case 'list': { - values = values.concat(marked.walkTokens(token.items, callback)); - break; - } - default: { - if (marked.defaults.extensions && marked.defaults.extensions.childTokens && marked.defaults.extensions.childTokens[token.type]) { // Walk any extensions - marked.defaults.extensions.childTokens[token.type].forEach(function(childTokens) { - values = values.concat(marked.walkTokens(token[childTokens], callback)); - }); - } else if (token.tokens) { - values = values.concat(marked.walkTokens(token.tokens, callback)); - } - } - } - } - return values; -}; - -/** - * Parse Inline - * @param {string} src - */ -marked.parseInline = function(src, opt) { - // throw error in case of non string input - if (typeof src === 'undefined' || src === null) { - throw new Error('marked.parseInline(): input parameter is undefined or null'); - } - if (typeof src !== 'string') { - throw new Error('marked.parseInline(): input parameter is of type ' - + Object.prototype.toString.call(src) + ', string expected'); - } - - opt = merge({}, marked.defaults, opt || {}); - checkSanitizeDeprecation(opt); - - try { - const tokens = Lexer.lexInline(src, opt); - if (opt.walkTokens) { - marked.walkTokens(tokens, opt.walkTokens); - } - return Parser.parseInline(tokens, opt); - } catch (e) { - e.message += '\nPlease report this to https://github.com/markedjs/marked.'; - if (opt.silent) { - return '

    An error occurred:

    '
    -        + escape(e.message + '', true)
    -        + '
    '; - } - throw e; - } -}; - -/** - * Expose - */ -marked.Parser = Parser; -marked.parser = Parser.parse; -marked.Renderer = Renderer; -marked.TextRenderer = TextRenderer; -marked.Lexer = Lexer; -marked.lexer = Lexer.lex; -marked.Tokenizer = Tokenizer; -marked.Slugger = Slugger; -marked.parse = marked; - -export const options = marked.options; -export const setOptions = marked.setOptions; -export const use = marked.use; -export const walkTokens = marked.walkTokens; -export const parseInline = marked.parseInline; -export const parse = marked; -export const parser = Parser.parse; -export const lexer = Lexer.lex; -export { defaults, getDefaults } from './defaults.js'; -export { Lexer } from './Lexer.js'; -export { Parser } from './Parser.js'; -export { Tokenizer } from './Tokenizer.js'; -export { Renderer } from './Renderer.js'; -export { TextRenderer } from './TextRenderer.js'; -export { Slugger } from './Slugger.js'; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/marked/src/rules.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/marked/src/rules.js deleted file mode 100644 index 6b29dfd0..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/marked/src/rules.js +++ /dev/null @@ -1,305 +0,0 @@ -import { - noopTest, - edit, - merge -} from './helpers.js'; - -/** - * Block-Level Grammar - */ -export const block = { - newline: /^(?: *(?:\n|$))+/, - code: /^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/, - fences: /^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?=\n|$)|$)/, - hr: /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, - heading: /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, - blockquote: /^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/, - list: /^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/, - html: '^ {0,3}(?:' // optional indentation - + '<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)' // (1) - + '|comment[^\\n]*(\\n+|$)' // (2) - + '|<\\?[\\s\\S]*?(?:\\?>\\n*|$)' // (3) - + '|\\n*|$)' // (4) - + '|\\n*|$)' // (5) - + '|)[\\s\\S]*?(?:(?:\\n *)+\\n|$)' // (6) - + '|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)' // (7) open tag - + '|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)' // (7) closing tag - + ')', - def: /^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/, - table: noopTest, - lheading: /^((?:.|\n(?!\n))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, - // regex template, placeholders will be replaced according to different paragraph - // interruption rules of commonmark and the original markdown spec: - _paragraph: /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, - text: /^[^\n]+/ -}; - -block._label = /(?!\s*\])(?:\\.|[^\[\]\\])+/; -block._title = /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/; -block.def = edit(block.def) - .replace('label', block._label) - .replace('title', block._title) - .getRegex(); - -block.bullet = /(?:[*+-]|\d{1,9}[.)])/; -block.listItemStart = edit(/^( *)(bull) */) - .replace('bull', block.bullet) - .getRegex(); - -block.list = edit(block.list) - .replace(/bull/g, block.bullet) - .replace('hr', '\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))') - .replace('def', '\\n+(?=' + block.def.source + ')') - .getRegex(); - -block._tag = 'address|article|aside|base|basefont|blockquote|body|caption' - + '|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption' - + '|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe' - + '|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option' - + '|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr' - + '|track|ul'; -block._comment = /|$)/; -block.html = edit(block.html, 'i') - .replace('comment', block._comment) - .replace('tag', block._tag) - .replace('attribute', / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/) - .getRegex(); - -block.paragraph = edit(block._paragraph) - .replace('hr', block.hr) - .replace('heading', ' {0,3}#{1,6} ') - .replace('|lheading', '') // setex headings don't interrupt commonmark paragraphs - .replace('|table', '') - .replace('blockquote', ' {0,3}>') - .replace('fences', ' {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n') - .replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt - .replace('html', ')|<(?:script|pre|style|textarea|!--)') - .replace('tag', block._tag) // pars can be interrupted by type (6) html blocks - .getRegex(); - -block.blockquote = edit(block.blockquote) - .replace('paragraph', block.paragraph) - .getRegex(); - -/** - * Normal Block Grammar - */ - -block.normal = merge({}, block); - -/** - * GFM Block Grammar - */ - -block.gfm = merge({}, block.normal, { - table: '^ *([^\\n ].*\\|.*)\\n' // Header - + ' {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?' // Align - + '(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)' // Cells -}); - -block.gfm.table = edit(block.gfm.table) - .replace('hr', block.hr) - .replace('heading', ' {0,3}#{1,6} ') - .replace('blockquote', ' {0,3}>') - .replace('code', ' {4}[^\\n]') - .replace('fences', ' {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n') - .replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt - .replace('html', ')|<(?:script|pre|style|textarea|!--)') - .replace('tag', block._tag) // tables can be interrupted by type (6) html blocks - .getRegex(); - -block.gfm.paragraph = edit(block._paragraph) - .replace('hr', block.hr) - .replace('heading', ' {0,3}#{1,6} ') - .replace('|lheading', '') // setex headings don't interrupt commonmark paragraphs - .replace('table', block.gfm.table) // interrupt paragraphs with table - .replace('blockquote', ' {0,3}>') - .replace('fences', ' {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n') - .replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt - .replace('html', ')|<(?:script|pre|style|textarea|!--)') - .replace('tag', block._tag) // pars can be interrupted by type (6) html blocks - .getRegex(); -/** - * Pedantic grammar (original John Gruber's loose markdown specification) - */ - -block.pedantic = merge({}, block.normal, { - html: edit( - '^ *(?:comment *(?:\\n|\\s*$)' - + '|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)' // closed tag - + '|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))') - .replace('comment', block._comment) - .replace(/tag/g, '(?!(?:' - + 'a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub' - + '|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)' - + '\\b)\\w+(?!:|[^\\w\\s@]*@)\\b') - .getRegex(), - def: /^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/, - heading: /^(#{1,6})(.*)(?:\n+|$)/, - fences: noopTest, // fences not supported - lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/, - paragraph: edit(block.normal._paragraph) - .replace('hr', block.hr) - .replace('heading', ' *#{1,6} *[^\n]') - .replace('lheading', block.lheading) - .replace('blockquote', ' {0,3}>') - .replace('|fences', '') - .replace('|list', '') - .replace('|html', '') - .getRegex() -}); - -/** - * Inline-Level Grammar - */ -export const inline = { - escape: /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, - autolink: /^<(scheme:[^\s\x00-\x1f<>]*|email)>/, - url: noopTest, - tag: '^comment' - + '|^' // self-closing tag - + '|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>' // open tag - + '|^<\\?[\\s\\S]*?\\?>' // processing instruction, e.g. - + '|^' // declaration, e.g. - + '|^', // CDATA section - link: /^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/, - reflink: /^!?\[(label)\]\[(ref)\]/, - nolink: /^!?\[(ref)\](?:\[\])?/, - reflinkSearch: 'reflink|nolink(?!\\()', - emStrong: { - lDelim: /^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/, - // (1) and (2) can only be a Right Delimiter. (3) and (4) can only be Left. (5) and (6) can be either Left or Right. - // () Skip orphan inside strong () Consume to delim (1) #*** (2) a***#, a*** (3) #***a, ***a (4) ***# (5) #***# (6) a***a - rDelimAst: /^(?:[^_*\\]|\\.)*?\_\_(?:[^_*\\]|\\.)*?\*(?:[^_*\\]|\\.)*?(?=\_\_)|(?:[^*\\]|\\.)+(?=[^*])|[punct_](\*+)(?=[\s]|$)|(?:[^punct*_\s\\]|\\.)(\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|(?:[^punct*_\s\\]|\\.)(\*+)(?=[^punct*_\s])/, - rDelimUnd: /^(?:[^_*\\]|\\.)*?\*\*(?:[^_*\\]|\\.)*?\_(?:[^_*\\]|\\.)*?(?=\*\*)|(?:[^_\\]|\\.)+(?=[^_])|[punct*](\_+)(?=[\s]|$)|(?:[^punct*_\s\\]|\\.)(\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/ // ^- Not allowed for _ - }, - code: /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, - br: /^( {2,}|\\)\n(?!\s*$)/, - del: noopTest, - text: /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~'; -inline.punctuation = edit(inline.punctuation).replace(/punctuation/g, inline._punctuation).getRegex(); - -// sequences em should skip over [title](link), `code`, -inline.blockSkip = /\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g; -// lookbehind is not available on Safari as of version 16 -// inline.escapedEmSt = /(?<=(?:^|[^\\)(?:\\[^])*)\\[*_]/g; -inline.escapedEmSt = /(?:^|[^\\])(?:\\\\)*\\[*_]/g; - -inline._comment = edit(block._comment).replace('(?:-->|$)', '-->').getRegex(); - -inline.emStrong.lDelim = edit(inline.emStrong.lDelim) - .replace(/punct/g, inline._punctuation) - .getRegex(); - -inline.emStrong.rDelimAst = edit(inline.emStrong.rDelimAst, 'g') - .replace(/punct/g, inline._punctuation) - .getRegex(); - -inline.emStrong.rDelimUnd = edit(inline.emStrong.rDelimUnd, 'g') - .replace(/punct/g, inline._punctuation) - .getRegex(); - -inline._escapes = /\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g; - -inline._scheme = /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/; -inline._email = /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/; -inline.autolink = edit(inline.autolink) - .replace('scheme', inline._scheme) - .replace('email', inline._email) - .getRegex(); - -inline._attribute = /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/; - -inline.tag = edit(inline.tag) - .replace('comment', inline._comment) - .replace('attribute', inline._attribute) - .getRegex(); - -inline._label = /(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/; -inline._href = /<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/; -inline._title = /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/; - -inline.link = edit(inline.link) - .replace('label', inline._label) - .replace('href', inline._href) - .replace('title', inline._title) - .getRegex(); - -inline.reflink = edit(inline.reflink) - .replace('label', inline._label) - .replace('ref', block._label) - .getRegex(); - -inline.nolink = edit(inline.nolink) - .replace('ref', block._label) - .getRegex(); - -inline.reflinkSearch = edit(inline.reflinkSearch, 'g') - .replace('reflink', inline.reflink) - .replace('nolink', inline.nolink) - .getRegex(); - -/** - * Normal Inline Grammar - */ - -inline.normal = merge({}, inline); - -/** - * Pedantic Inline Grammar - */ - -inline.pedantic = merge({}, inline.normal, { - strong: { - start: /^__|\*\*/, - middle: /^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/, - endAst: /\*\*(?!\*)/g, - endUnd: /__(?!_)/g - }, - em: { - start: /^_|\*/, - middle: /^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/, - endAst: /\*(?!\*)/g, - endUnd: /_(?!_)/g - }, - link: edit(/^!?\[(label)\]\((.*?)\)/) - .replace('label', inline._label) - .getRegex(), - reflink: edit(/^!?\[(label)\]\s*\[([^\]]*)\]/) - .replace('label', inline._label) - .getRegex() -}); - -/** - * GFM Inline Grammar - */ - -inline.gfm = merge({}, inline.normal, { - escape: edit(inline.escape).replace('])', '~|])').getRegex(), - _extended_email: /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/, - url: /^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/, - _backpedal: /(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/, - del: /^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/, - text: /^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\ URL utilities for [markdown-it](https://github.com/markdown-it/markdown-it) parser. - - -## API - -### .encode(str [, exclude, keepEncoded]) -> String - -Percent-encode a string, avoiding double encoding. Don't touch `/a-zA-Z0-9/` + -excluded chars + `/%[a-fA-F0-9]{2}/` (if not disabled). Broken surrorates are -replaced with `U+FFFD`. - -Params: - -- __str__ - input string. -- __exclude__ - optional, `;/?:@&=+$,-_.!~*'()#`. Additional chars to keep intact - (except `/a-zA-Z0-9/`). -- __keepEncoded__ - optional, `true`. By default it skips already encoded sequences - (`/%[a-fA-F0-9]{2}/`). If set to `false`, `%` will be encoded. - - -### encode.defaultChars, encode.componentChars - -You can use these constants as second argument to `encode` function. - - - `encode.defaultChars` is the same exclude set as in the standard `encodeURI()` function - - `encode.componentChars` is the same exclude set as in the `encodeURIComponent()` function - -For example, `encode('something', encode.componentChars, true)` is roughly the equivalent of -the `encodeURIComponent()` function (except `encode()` doesn't throw). - - -### .decode(str [, exclude]) -> String - -Decode percent-encoded string. Invalid percent-encoded sequences (e.g. `%2G`) -are left as is. Invalid UTF-8 characters are replaced with `U+FFFD`. - - -Params: - -- __str__ - input string. -- __exclude__ - set of characters to leave encoded, optional, `;/?:@&=+$,#`. - - -### decode.defaultChars, decode.componentChars - -You can use these constants as second argument to `decode` function. - - - `decode.defaultChars` is the same exclude set as in the standard `decodeURI()` function - - `decode.componentChars` is the same exclude set as in the `decodeURIComponent()` function - -For example, `decode('something', decode.defaultChars)` has the same behavior as -`decodeURI('something')` on a correctly encoded input. - - -### .parse(url, slashesDenoteHost) -> urlObs - -Parse url string. Similar to node's [url.parse](http://nodejs.org/api/url.html#url_url_parse_urlstr_parsequerystring_slashesdenotehost), but without any -normalizations and query string parse. - - - __url__ - input url (string) - - __slashesDenoteHost__ - if url starts with `//`, expect a hostname after it. Optional, `false`. - -Result (hash): - -- protocol -- slashes -- auth -- port -- hostname -- hash -- search -- pathname - -Difference with node's `url`: - -1. No leading slash in paths, e.g. in `url.parse('http://foo?bar')` pathname is - ``, not `/` -2. Backslashes are not replaced with slashes, so `http:\\example.org\` is - treated like a relative path -3. Trailing colon is treated like a part of the path, i.e. in - `http://example.org:foo` pathname is `:foo` -4. Nothing is URL-encoded in the resulting object, (in joyent/node some chars - in auth and paths are encoded) -5. `url.parse()` does not have `parseQueryString` argument -6. Removed extraneous result properties: `host`, `path`, `query`, etc., - which can be constructed using other parts of the url. - - -### .format(urlObject) - -Format an object previously obtained with `.parse()` function. Similar to node's -[url.format](http://nodejs.org/api/url.html#url_url_format_urlobj). - - -## License - -[MIT](https://github.com/markdown-it/mdurl/blob/master/LICENSE) diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/mdurl/decode.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/mdurl/decode.js deleted file mode 100644 index 189d7b9c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/mdurl/decode.js +++ /dev/null @@ -1,122 +0,0 @@ - -'use strict'; - - -/* eslint-disable no-bitwise */ - -var decodeCache = {}; - -function getDecodeCache(exclude) { - var i, ch, cache = decodeCache[exclude]; - if (cache) { return cache; } - - cache = decodeCache[exclude] = []; - - for (i = 0; i < 128; i++) { - ch = String.fromCharCode(i); - cache.push(ch); - } - - for (i = 0; i < exclude.length; i++) { - ch = exclude.charCodeAt(i); - cache[ch] = '%' + ('0' + ch.toString(16).toUpperCase()).slice(-2); - } - - return cache; -} - - -// Decode percent-encoded string. -// -function decode(string, exclude) { - var cache; - - if (typeof exclude !== 'string') { - exclude = decode.defaultChars; - } - - cache = getDecodeCache(exclude); - - return string.replace(/(%[a-f0-9]{2})+/gi, function(seq) { - var i, l, b1, b2, b3, b4, chr, - result = ''; - - for (i = 0, l = seq.length; i < l; i += 3) { - b1 = parseInt(seq.slice(i + 1, i + 3), 16); - - if (b1 < 0x80) { - result += cache[b1]; - continue; - } - - if ((b1 & 0xE0) === 0xC0 && (i + 3 < l)) { - // 110xxxxx 10xxxxxx - b2 = parseInt(seq.slice(i + 4, i + 6), 16); - - if ((b2 & 0xC0) === 0x80) { - chr = ((b1 << 6) & 0x7C0) | (b2 & 0x3F); - - if (chr < 0x80) { - result += '\ufffd\ufffd'; - } else { - result += String.fromCharCode(chr); - } - - i += 3; - continue; - } - } - - if ((b1 & 0xF0) === 0xE0 && (i + 6 < l)) { - // 1110xxxx 10xxxxxx 10xxxxxx - b2 = parseInt(seq.slice(i + 4, i + 6), 16); - b3 = parseInt(seq.slice(i + 7, i + 9), 16); - - if ((b2 & 0xC0) === 0x80 && (b3 & 0xC0) === 0x80) { - chr = ((b1 << 12) & 0xF000) | ((b2 << 6) & 0xFC0) | (b3 & 0x3F); - - if (chr < 0x800 || (chr >= 0xD800 && chr <= 0xDFFF)) { - result += '\ufffd\ufffd\ufffd'; - } else { - result += String.fromCharCode(chr); - } - - i += 6; - continue; - } - } - - if ((b1 & 0xF8) === 0xF0 && (i + 9 < l)) { - // 111110xx 10xxxxxx 10xxxxxx 10xxxxxx - b2 = parseInt(seq.slice(i + 4, i + 6), 16); - b3 = parseInt(seq.slice(i + 7, i + 9), 16); - b4 = parseInt(seq.slice(i + 10, i + 12), 16); - - if ((b2 & 0xC0) === 0x80 && (b3 & 0xC0) === 0x80 && (b4 & 0xC0) === 0x80) { - chr = ((b1 << 18) & 0x1C0000) | ((b2 << 12) & 0x3F000) | ((b3 << 6) & 0xFC0) | (b4 & 0x3F); - - if (chr < 0x10000 || chr > 0x10FFFF) { - result += '\ufffd\ufffd\ufffd\ufffd'; - } else { - chr -= 0x10000; - result += String.fromCharCode(0xD800 + (chr >> 10), 0xDC00 + (chr & 0x3FF)); - } - - i += 9; - continue; - } - } - - result += '\ufffd'; - } - - return result; - }); -} - - -decode.defaultChars = ';/?:@&=+$,#'; -decode.componentChars = ''; - - -module.exports = decode; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/mdurl/encode.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/mdurl/encode.js deleted file mode 100644 index 6dff4f96..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/mdurl/encode.js +++ /dev/null @@ -1,98 +0,0 @@ - -'use strict'; - - -var encodeCache = {}; - - -// Create a lookup array where anything but characters in `chars` string -// and alphanumeric chars is percent-encoded. -// -function getEncodeCache(exclude) { - var i, ch, cache = encodeCache[exclude]; - if (cache) { return cache; } - - cache = encodeCache[exclude] = []; - - for (i = 0; i < 128; i++) { - ch = String.fromCharCode(i); - - if (/^[0-9a-z]$/i.test(ch)) { - // always allow unencoded alphanumeric characters - cache.push(ch); - } else { - cache.push('%' + ('0' + i.toString(16).toUpperCase()).slice(-2)); - } - } - - for (i = 0; i < exclude.length; i++) { - cache[exclude.charCodeAt(i)] = exclude[i]; - } - - return cache; -} - - -// Encode unsafe characters with percent-encoding, skipping already -// encoded sequences. -// -// - string - string to encode -// - exclude - list of characters to ignore (in addition to a-zA-Z0-9) -// - keepEscaped - don't encode '%' in a correct escape sequence (default: true) -// -function encode(string, exclude, keepEscaped) { - var i, l, code, nextCode, cache, - result = ''; - - if (typeof exclude !== 'string') { - // encode(string, keepEscaped) - keepEscaped = exclude; - exclude = encode.defaultChars; - } - - if (typeof keepEscaped === 'undefined') { - keepEscaped = true; - } - - cache = getEncodeCache(exclude); - - for (i = 0, l = string.length; i < l; i++) { - code = string.charCodeAt(i); - - if (keepEscaped && code === 0x25 /* % */ && i + 2 < l) { - if (/^[0-9a-f]{2}$/i.test(string.slice(i + 1, i + 3))) { - result += string.slice(i, i + 3); - i += 2; - continue; - } - } - - if (code < 128) { - result += cache[code]; - continue; - } - - if (code >= 0xD800 && code <= 0xDFFF) { - if (code >= 0xD800 && code <= 0xDBFF && i + 1 < l) { - nextCode = string.charCodeAt(i + 1); - if (nextCode >= 0xDC00 && nextCode <= 0xDFFF) { - result += encodeURIComponent(string[i] + string[i + 1]); - i++; - continue; - } - } - result += '%EF%BF%BD'; - continue; - } - - result += encodeURIComponent(string[i]); - } - - return result; -} - -encode.defaultChars = ";/?:@&=+$,-_.!~*'()#"; -encode.componentChars = "-_.!~*'()"; - - -module.exports = encode; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/mdurl/format.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/mdurl/format.js deleted file mode 100644 index c4eb9f4a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/mdurl/format.js +++ /dev/null @@ -1,25 +0,0 @@ - -'use strict'; - - -module.exports = function format(url) { - var result = ''; - - result += url.protocol || ''; - result += url.slashes ? '//' : ''; - result += url.auth ? url.auth + '@' : ''; - - if (url.hostname && url.hostname.indexOf(':') !== -1) { - // ipv6 address - result += '[' + url.hostname + ']'; - } else { - result += url.hostname || ''; - } - - result += url.port ? ':' + url.port : ''; - result += url.pathname || ''; - result += url.search || ''; - result += url.hash || ''; - - return result; -}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/mdurl/index.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/mdurl/index.js deleted file mode 100644 index 194abff5..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/mdurl/index.js +++ /dev/null @@ -1,7 +0,0 @@ -'use strict'; - - -module.exports.encode = require('./encode'); -module.exports.decode = require('./decode'); -module.exports.format = require('./format'); -module.exports.parse = require('./parse'); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/mdurl/package.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/mdurl/package.json deleted file mode 100644 index 017d740b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/mdurl/package.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "name": "mdurl", - "version": "1.0.1", - "description": "URL utilities for markdown-it", - "repository": "markdown-it/mdurl", - "license": "MIT", - "scripts": { - "test": "make test" - }, - "devDependencies": { - "mocha": "*", - "eslint": "0.13.0", - "eslint-plugin-nodeca": "^1.0.0", - "istanbul": "*" - } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/mdurl/parse.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/mdurl/parse.js deleted file mode 100644 index 6c33ac12..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/mdurl/parse.js +++ /dev/null @@ -1,312 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - -'use strict'; - -// -// Changes from joyent/node: -// -// 1. No leading slash in paths, -// e.g. in `url.parse('http://foo?bar')` pathname is ``, not `/` -// -// 2. Backslashes are not replaced with slashes, -// so `http:\\example.org\` is treated like a relative path -// -// 3. Trailing colon is treated like a part of the path, -// i.e. in `http://example.org:foo` pathname is `:foo` -// -// 4. Nothing is URL-encoded in the resulting object, -// (in joyent/node some chars in auth and paths are encoded) -// -// 5. `url.parse()` does not have `parseQueryString` argument -// -// 6. Removed extraneous result properties: `host`, `path`, `query`, etc., -// which can be constructed using other parts of the url. -// - - -function Url() { - this.protocol = null; - this.slashes = null; - this.auth = null; - this.port = null; - this.hostname = null; - this.hash = null; - this.search = null; - this.pathname = null; -} - -// Reference: RFC 3986, RFC 1808, RFC 2396 - -// define these here so at least they only have to be -// compiled once on the first module load. -var protocolPattern = /^([a-z0-9.+-]+:)/i, - portPattern = /:[0-9]*$/, - - // Special case for a simple path URL - simplePathPattern = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/, - - // RFC 2396: characters reserved for delimiting URLs. - // We actually just auto-escape these. - delims = [ '<', '>', '"', '`', ' ', '\r', '\n', '\t' ], - - // RFC 2396: characters not allowed for various reasons. - unwise = [ '{', '}', '|', '\\', '^', '`' ].concat(delims), - - // Allowed by RFCs, but cause of XSS attacks. Always escape these. - autoEscape = [ '\'' ].concat(unwise), - // Characters that are never ever allowed in a hostname. - // Note that any invalid chars are also handled, but these - // are the ones that are *expected* to be seen, so we fast-path - // them. - nonHostChars = [ '%', '/', '?', ';', '#' ].concat(autoEscape), - hostEndingChars = [ '/', '?', '#' ], - hostnameMaxLen = 255, - hostnamePartPattern = /^[+a-z0-9A-Z_-]{0,63}$/, - hostnamePartStart = /^([+a-z0-9A-Z_-]{0,63})(.*)$/, - // protocols that can allow "unsafe" and "unwise" chars. - /* eslint-disable no-script-url */ - // protocols that never have a hostname. - hostlessProtocol = { - 'javascript': true, - 'javascript:': true - }, - // protocols that always contain a // bit. - slashedProtocol = { - 'http': true, - 'https': true, - 'ftp': true, - 'gopher': true, - 'file': true, - 'http:': true, - 'https:': true, - 'ftp:': true, - 'gopher:': true, - 'file:': true - }; - /* eslint-enable no-script-url */ - -function urlParse(url, slashesDenoteHost) { - if (url && url instanceof Url) { return url; } - - var u = new Url(); - u.parse(url, slashesDenoteHost); - return u; -} - -Url.prototype.parse = function(url, slashesDenoteHost) { - var i, l, lowerProto, hec, slashes, - rest = url; - - // trim before proceeding. - // This is to support parse stuff like " http://foo.com \n" - rest = rest.trim(); - - if (!slashesDenoteHost && url.split('#').length === 1) { - // Try fast path regexp - var simplePath = simplePathPattern.exec(rest); - if (simplePath) { - this.pathname = simplePath[1]; - if (simplePath[2]) { - this.search = simplePath[2]; - } - return this; - } - } - - var proto = protocolPattern.exec(rest); - if (proto) { - proto = proto[0]; - lowerProto = proto.toLowerCase(); - this.protocol = proto; - rest = rest.substr(proto.length); - } - - // figure out if it's got a host - // user@server is *always* interpreted as a hostname, and url - // resolution will treat //foo/bar as host=foo,path=bar because that's - // how the browser resolves relative URLs. - if (slashesDenoteHost || proto || rest.match(/^\/\/[^@\/]+@[^@\/]+/)) { - slashes = rest.substr(0, 2) === '//'; - if (slashes && !(proto && hostlessProtocol[proto])) { - rest = rest.substr(2); - this.slashes = true; - } - } - - if (!hostlessProtocol[proto] && - (slashes || (proto && !slashedProtocol[proto]))) { - - // there's a hostname. - // the first instance of /, ?, ;, or # ends the host. - // - // If there is an @ in the hostname, then non-host chars *are* allowed - // to the left of the last @ sign, unless some host-ending character - // comes *before* the @-sign. - // URLs are obnoxious. - // - // ex: - // http://a@b@c/ => user:a@b host:c - // http://a@b?@c => user:a host:c path:/?@c - - // v0.12 TODO(isaacs): This is not quite how Chrome does things. - // Review our test case against browsers more comprehensively. - - // find the first instance of any hostEndingChars - var hostEnd = -1; - for (i = 0; i < hostEndingChars.length; i++) { - hec = rest.indexOf(hostEndingChars[i]); - if (hec !== -1 && (hostEnd === -1 || hec < hostEnd)) { - hostEnd = hec; - } - } - - // at this point, either we have an explicit point where the - // auth portion cannot go past, or the last @ char is the decider. - var auth, atSign; - if (hostEnd === -1) { - // atSign can be anywhere. - atSign = rest.lastIndexOf('@'); - } else { - // atSign must be in auth portion. - // http://a@b/c@d => host:b auth:a path:/c@d - atSign = rest.lastIndexOf('@', hostEnd); - } - - // Now we have a portion which is definitely the auth. - // Pull that off. - if (atSign !== -1) { - auth = rest.slice(0, atSign); - rest = rest.slice(atSign + 1); - this.auth = auth; - } - - // the host is the remaining to the left of the first non-host char - hostEnd = -1; - for (i = 0; i < nonHostChars.length; i++) { - hec = rest.indexOf(nonHostChars[i]); - if (hec !== -1 && (hostEnd === -1 || hec < hostEnd)) { - hostEnd = hec; - } - } - // if we still have not hit it, then the entire thing is a host. - if (hostEnd === -1) { - hostEnd = rest.length; - } - - if (rest[hostEnd - 1] === ':') { hostEnd--; } - var host = rest.slice(0, hostEnd); - rest = rest.slice(hostEnd); - - // pull out port. - this.parseHost(host); - - // we've indicated that there is a hostname, - // so even if it's empty, it has to be present. - this.hostname = this.hostname || ''; - - // if hostname begins with [ and ends with ] - // assume that it's an IPv6 address. - var ipv6Hostname = this.hostname[0] === '[' && - this.hostname[this.hostname.length - 1] === ']'; - - // validate a little. - if (!ipv6Hostname) { - var hostparts = this.hostname.split(/\./); - for (i = 0, l = hostparts.length; i < l; i++) { - var part = hostparts[i]; - if (!part) { continue; } - if (!part.match(hostnamePartPattern)) { - var newpart = ''; - for (var j = 0, k = part.length; j < k; j++) { - if (part.charCodeAt(j) > 127) { - // we replace non-ASCII char with a temporary placeholder - // we need this to make sure size of hostname is not - // broken by replacing non-ASCII by nothing - newpart += 'x'; - } else { - newpart += part[j]; - } - } - // we test again with ASCII char only - if (!newpart.match(hostnamePartPattern)) { - var validParts = hostparts.slice(0, i); - var notHost = hostparts.slice(i + 1); - var bit = part.match(hostnamePartStart); - if (bit) { - validParts.push(bit[1]); - notHost.unshift(bit[2]); - } - if (notHost.length) { - rest = notHost.join('.') + rest; - } - this.hostname = validParts.join('.'); - break; - } - } - } - } - - if (this.hostname.length > hostnameMaxLen) { - this.hostname = ''; - } - - // strip [ and ] from the hostname - // the host field still retains them, though - if (ipv6Hostname) { - this.hostname = this.hostname.substr(1, this.hostname.length - 2); - } - } - - // chop off from the tail first. - var hash = rest.indexOf('#'); - if (hash !== -1) { - // got a fragment string. - this.hash = rest.substr(hash); - rest = rest.slice(0, hash); - } - var qm = rest.indexOf('?'); - if (qm !== -1) { - this.search = rest.substr(qm); - rest = rest.slice(0, qm); - } - if (rest) { this.pathname = rest; } - if (slashedProtocol[lowerProto] && - this.hostname && !this.pathname) { - this.pathname = ''; - } - - return this; -}; - -Url.prototype.parseHost = function(host) { - var port = portPattern.exec(host); - if (port) { - port = port[0]; - if (port !== ':') { - this.port = port.substr(1); - } - host = host.substr(0, host.length - port.length); - } - if (host) { this.hostname = host; } -}; - -module.exports = urlParse; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/mime-db/HISTORY.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/mime-db/HISTORY.md deleted file mode 100644 index 7436f641..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/mime-db/HISTORY.md +++ /dev/null @@ -1,507 +0,0 @@ -1.52.0 / 2022-02-21 -=================== - - * Add extensions from IANA for more `image/*` types - * Add extension `.asc` to `application/pgp-keys` - * Add extensions to various XML types - * Add new upstream MIME types - -1.51.0 / 2021-11-08 -=================== - - * Add new upstream MIME types - * Mark `image/vnd.microsoft.icon` as compressible - * Mark `image/vnd.ms-dds` as compressible - -1.50.0 / 2021-09-15 -=================== - - * Add deprecated iWorks mime types and extensions - * Add new upstream MIME types - -1.49.0 / 2021-07-26 -=================== - - * Add extension `.trig` to `application/trig` - * Add new upstream MIME types - -1.48.0 / 2021-05-30 -=================== - - * Add extension `.mvt` to `application/vnd.mapbox-vector-tile` - * Add new upstream MIME types - * Mark `text/yaml` as compressible - -1.47.0 / 2021-04-01 -=================== - - * Add new upstream MIME types - * Remove ambigious extensions from IANA for `application/*+xml` types - * Update primary extension to `.es` for `application/ecmascript` - -1.46.0 / 2021-02-13 -=================== - - * Add extension `.amr` to `audio/amr` - * Add extension `.m4s` to `video/iso.segment` - * Add extension `.opus` to `audio/ogg` - * Add new upstream MIME types - -1.45.0 / 2020-09-22 -=================== - - * Add `application/ubjson` with extension `.ubj` - * Add `image/avif` with extension `.avif` - * Add `image/ktx2` with extension `.ktx2` - * Add extension `.dbf` to `application/vnd.dbf` - * Add extension `.rar` to `application/vnd.rar` - * Add extension `.td` to `application/urc-targetdesc+xml` - * Add new upstream MIME types - * Fix extension of `application/vnd.apple.keynote` to be `.key` - -1.44.0 / 2020-04-22 -=================== - - * Add charsets from IANA - * Add extension `.cjs` to `application/node` - * Add new upstream MIME types - -1.43.0 / 2020-01-05 -=================== - - * Add `application/x-keepass2` with extension `.kdbx` - * Add extension `.mxmf` to `audio/mobile-xmf` - * Add extensions from IANA for `application/*+xml` types - * Add new upstream MIME types - -1.42.0 / 2019-09-25 -=================== - - * Add `image/vnd.ms-dds` with extension `.dds` - * Add new upstream MIME types - * Remove compressible from `multipart/mixed` - -1.41.0 / 2019-08-30 -=================== - - * Add new upstream MIME types - * Add `application/toml` with extension `.toml` - * Mark `font/ttf` as compressible - -1.40.0 / 2019-04-20 -=================== - - * Add extensions from IANA for `model/*` types - * Add `text/mdx` with extension `.mdx` - -1.39.0 / 2019-04-04 -=================== - - * Add extensions `.siv` and `.sieve` to `application/sieve` - * Add new upstream MIME types - -1.38.0 / 2019-02-04 -=================== - - * Add extension `.nq` to `application/n-quads` - * Add extension `.nt` to `application/n-triples` - * Add new upstream MIME types - * Mark `text/less` as compressible - -1.37.0 / 2018-10-19 -=================== - - * Add extensions to HEIC image types - * Add new upstream MIME types - -1.36.0 / 2018-08-20 -=================== - - * Add Apple file extensions from IANA - * Add extensions from IANA for `image/*` types - * Add new upstream MIME types - -1.35.0 / 2018-07-15 -=================== - - * Add extension `.owl` to `application/rdf+xml` - * Add new upstream MIME types - - Removes extension `.woff` from `application/font-woff` - -1.34.0 / 2018-06-03 -=================== - - * Add extension `.csl` to `application/vnd.citationstyles.style+xml` - * Add extension `.es` to `application/ecmascript` - * Add new upstream MIME types - * Add `UTF-8` as default charset for `text/turtle` - * Mark all XML-derived types as compressible - -1.33.0 / 2018-02-15 -=================== - - * Add extensions from IANA for `message/*` types - * Add new upstream MIME types - * Fix some incorrect OOXML types - * Remove `application/font-woff2` - -1.32.0 / 2017-11-29 -=================== - - * Add new upstream MIME types - * Update `text/hjson` to registered `application/hjson` - * Add `text/shex` with extension `.shex` - -1.31.0 / 2017-10-25 -=================== - - * Add `application/raml+yaml` with extension `.raml` - * Add `application/wasm` with extension `.wasm` - * Add new `font` type from IANA - * Add new upstream font extensions - * Add new upstream MIME types - * Add extensions for JPEG-2000 images - -1.30.0 / 2017-08-27 -=================== - - * Add `application/vnd.ms-outlook` - * Add `application/x-arj` - * Add extension `.mjs` to `application/javascript` - * Add glTF types and extensions - * Add new upstream MIME types - * Add `text/x-org` - * Add VirtualBox MIME types - * Fix `source` records for `video/*` types that are IANA - * Update `font/opentype` to registered `font/otf` - -1.29.0 / 2017-07-10 -=================== - - * Add `application/fido.trusted-apps+json` - * Add extension `.wadl` to `application/vnd.sun.wadl+xml` - * Add new upstream MIME types - * Add `UTF-8` as default charset for `text/css` - -1.28.0 / 2017-05-14 -=================== - - * Add new upstream MIME types - * Add extension `.gz` to `application/gzip` - * Update extensions `.md` and `.markdown` to be `text/markdown` - -1.27.0 / 2017-03-16 -=================== - - * Add new upstream MIME types - * Add `image/apng` with extension `.apng` - -1.26.0 / 2017-01-14 -=================== - - * Add new upstream MIME types - * Add extension `.geojson` to `application/geo+json` - -1.25.0 / 2016-11-11 -=================== - - * Add new upstream MIME types - -1.24.0 / 2016-09-18 -=================== - - * Add `audio/mp3` - * Add new upstream MIME types - -1.23.0 / 2016-05-01 -=================== - - * Add new upstream MIME types - * Add extension `.3gpp` to `audio/3gpp` - -1.22.0 / 2016-02-15 -=================== - - * Add `text/slim` - * Add extension `.rng` to `application/xml` - * Add new upstream MIME types - * Fix extension of `application/dash+xml` to be `.mpd` - * Update primary extension to `.m4a` for `audio/mp4` - -1.21.0 / 2016-01-06 -=================== - - * Add Google document types - * Add new upstream MIME types - -1.20.0 / 2015-11-10 -=================== - - * Add `text/x-suse-ymp` - * Add new upstream MIME types - -1.19.0 / 2015-09-17 -=================== - - * Add `application/vnd.apple.pkpass` - * Add new upstream MIME types - -1.18.0 / 2015-09-03 -=================== - - * Add new upstream MIME types - -1.17.0 / 2015-08-13 -=================== - - * Add `application/x-msdos-program` - * Add `audio/g711-0` - * Add `image/vnd.mozilla.apng` - * Add extension `.exe` to `application/x-msdos-program` - -1.16.0 / 2015-07-29 -=================== - - * Add `application/vnd.uri-map` - -1.15.0 / 2015-07-13 -=================== - - * Add `application/x-httpd-php` - -1.14.0 / 2015-06-25 -=================== - - * Add `application/scim+json` - * Add `application/vnd.3gpp.ussd+xml` - * Add `application/vnd.biopax.rdf+xml` - * Add `text/x-processing` - -1.13.0 / 2015-06-07 -=================== - - * Add nginx as a source - * Add `application/x-cocoa` - * Add `application/x-java-archive-diff` - * Add `application/x-makeself` - * Add `application/x-perl` - * Add `application/x-pilot` - * Add `application/x-redhat-package-manager` - * Add `application/x-sea` - * Add `audio/x-m4a` - * Add `audio/x-realaudio` - * Add `image/x-jng` - * Add `text/mathml` - -1.12.0 / 2015-06-05 -=================== - - * Add `application/bdoc` - * Add `application/vnd.hyperdrive+json` - * Add `application/x-bdoc` - * Add extension `.rtf` to `text/rtf` - -1.11.0 / 2015-05-31 -=================== - - * Add `audio/wav` - * Add `audio/wave` - * Add extension `.litcoffee` to `text/coffeescript` - * Add extension `.sfd-hdstx` to `application/vnd.hydrostatix.sof-data` - * Add extension `.n-gage` to `application/vnd.nokia.n-gage.symbian.install` - -1.10.0 / 2015-05-19 -=================== - - * Add `application/vnd.balsamiq.bmpr` - * Add `application/vnd.microsoft.portable-executable` - * Add `application/x-ns-proxy-autoconfig` - -1.9.1 / 2015-04-19 -================== - - * Remove `.json` extension from `application/manifest+json` - - This is causing bugs downstream - -1.9.0 / 2015-04-19 -================== - - * Add `application/manifest+json` - * Add `application/vnd.micro+json` - * Add `image/vnd.zbrush.pcx` - * Add `image/x-ms-bmp` - -1.8.0 / 2015-03-13 -================== - - * Add `application/vnd.citationstyles.style+xml` - * Add `application/vnd.fastcopy-disk-image` - * Add `application/vnd.gov.sk.xmldatacontainer+xml` - * Add extension `.jsonld` to `application/ld+json` - -1.7.0 / 2015-02-08 -================== - - * Add `application/vnd.gerber` - * Add `application/vnd.msa-disk-image` - -1.6.1 / 2015-02-05 -================== - - * Community extensions ownership transferred from `node-mime` - -1.6.0 / 2015-01-29 -================== - - * Add `application/jose` - * Add `application/jose+json` - * Add `application/json-seq` - * Add `application/jwk+json` - * Add `application/jwk-set+json` - * Add `application/jwt` - * Add `application/rdap+json` - * Add `application/vnd.gov.sk.e-form+xml` - * Add `application/vnd.ims.imsccv1p3` - -1.5.0 / 2014-12-30 -================== - - * Add `application/vnd.oracle.resource+json` - * Fix various invalid MIME type entries - - `application/mbox+xml` - - `application/oscp-response` - - `application/vwg-multiplexed` - - `audio/g721` - -1.4.0 / 2014-12-21 -================== - - * Add `application/vnd.ims.imsccv1p2` - * Fix various invalid MIME type entries - - `application/vnd-acucobol` - - `application/vnd-curl` - - `application/vnd-dart` - - `application/vnd-dxr` - - `application/vnd-fdf` - - `application/vnd-mif` - - `application/vnd-sema` - - `application/vnd-wap-wmlc` - - `application/vnd.adobe.flash-movie` - - `application/vnd.dece-zip` - - `application/vnd.dvb_service` - - `application/vnd.micrografx-igx` - - `application/vnd.sealed-doc` - - `application/vnd.sealed-eml` - - `application/vnd.sealed-mht` - - `application/vnd.sealed-ppt` - - `application/vnd.sealed-tiff` - - `application/vnd.sealed-xls` - - `application/vnd.sealedmedia.softseal-html` - - `application/vnd.sealedmedia.softseal-pdf` - - `application/vnd.wap-slc` - - `application/vnd.wap-wbxml` - - `audio/vnd.sealedmedia.softseal-mpeg` - - `image/vnd-djvu` - - `image/vnd-svf` - - `image/vnd-wap-wbmp` - - `image/vnd.sealed-png` - - `image/vnd.sealedmedia.softseal-gif` - - `image/vnd.sealedmedia.softseal-jpg` - - `model/vnd-dwf` - - `model/vnd.parasolid.transmit-binary` - - `model/vnd.parasolid.transmit-text` - - `text/vnd-a` - - `text/vnd-curl` - - `text/vnd.wap-wml` - * Remove example template MIME types - - `application/example` - - `audio/example` - - `image/example` - - `message/example` - - `model/example` - - `multipart/example` - - `text/example` - - `video/example` - -1.3.1 / 2014-12-16 -================== - - * Fix missing extensions - - `application/json5` - - `text/hjson` - -1.3.0 / 2014-12-07 -================== - - * Add `application/a2l` - * Add `application/aml` - * Add `application/atfx` - * Add `application/atxml` - * Add `application/cdfx+xml` - * Add `application/dii` - * Add `application/json5` - * Add `application/lxf` - * Add `application/mf4` - * Add `application/vnd.apache.thrift.compact` - * Add `application/vnd.apache.thrift.json` - * Add `application/vnd.coffeescript` - * Add `application/vnd.enphase.envoy` - * Add `application/vnd.ims.imsccv1p1` - * Add `text/csv-schema` - * Add `text/hjson` - * Add `text/markdown` - * Add `text/yaml` - -1.2.0 / 2014-11-09 -================== - - * Add `application/cea` - * Add `application/dit` - * Add `application/vnd.gov.sk.e-form+zip` - * Add `application/vnd.tmd.mediaflex.api+xml` - * Type `application/epub+zip` is now IANA-registered - -1.1.2 / 2014-10-23 -================== - - * Rebuild database for `application/x-www-form-urlencoded` change - -1.1.1 / 2014-10-20 -================== - - * Mark `application/x-www-form-urlencoded` as compressible. - -1.1.0 / 2014-09-28 -================== - - * Add `application/font-woff2` - -1.0.3 / 2014-09-25 -================== - - * Fix engine requirement in package - -1.0.2 / 2014-09-25 -================== - - * Add `application/coap-group+json` - * Add `application/dcd` - * Add `application/vnd.apache.thrift.binary` - * Add `image/vnd.tencent.tap` - * Mark all JSON-derived types as compressible - * Update `text/vtt` data - -1.0.1 / 2014-08-30 -================== - - * Fix extension ordering - -1.0.0 / 2014-08-30 -================== - - * Add `application/atf` - * Add `application/merge-patch+json` - * Add `multipart/x-mixed-replace` - * Add `source: 'apache'` metadata - * Add `source: 'iana'` metadata - * Remove badly-assumed charset data diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/mime-db/LICENSE b/packages/wyatt_notification_bloc/example/scripts/node_modules/mime-db/LICENSE deleted file mode 100644 index 0751cb10..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/mime-db/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -(The MIT License) - -Copyright (c) 2014 Jonathan Ong -Copyright (c) 2015-2022 Douglas Christopher Wilson - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -'Software'), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/mime-db/README.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/mime-db/README.md deleted file mode 100644 index 5a8fcfe4..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/mime-db/README.md +++ /dev/null @@ -1,100 +0,0 @@ -# mime-db - -[![NPM Version][npm-version-image]][npm-url] -[![NPM Downloads][npm-downloads-image]][npm-url] -[![Node.js Version][node-image]][node-url] -[![Build Status][ci-image]][ci-url] -[![Coverage Status][coveralls-image]][coveralls-url] - -This is a large database of mime types and information about them. -It consists of a single, public JSON file and does not include any logic, -allowing it to remain as un-opinionated as possible with an API. -It aggregates data from the following sources: - -- http://www.iana.org/assignments/media-types/media-types.xhtml -- http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types -- http://hg.nginx.org/nginx/raw-file/default/conf/mime.types - -## Installation - -```bash -npm install mime-db -``` - -### Database Download - -If you're crazy enough to use this in the browser, you can just grab the -JSON file using [jsDelivr](https://www.jsdelivr.com/). It is recommended to -replace `master` with [a release tag](https://github.com/jshttp/mime-db/tags) -as the JSON format may change in the future. - -``` -https://cdn.jsdelivr.net/gh/jshttp/mime-db@master/db.json -``` - -## Usage - -```js -var db = require('mime-db') - -// grab data on .js files -var data = db['application/javascript'] -``` - -## Data Structure - -The JSON file is a map lookup for lowercased mime types. -Each mime type has the following properties: - -- `.source` - where the mime type is defined. - If not set, it's probably a custom media type. - - `apache` - [Apache common media types](http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types) - - `iana` - [IANA-defined media types](http://www.iana.org/assignments/media-types/media-types.xhtml) - - `nginx` - [nginx media types](http://hg.nginx.org/nginx/raw-file/default/conf/mime.types) -- `.extensions[]` - known extensions associated with this mime type. -- `.compressible` - whether a file of this type can be gzipped. -- `.charset` - the default charset associated with this type, if any. - -If unknown, every property could be `undefined`. - -## Contributing - -To edit the database, only make PRs against `src/custom-types.json` or -`src/custom-suffix.json`. - -The `src/custom-types.json` file is a JSON object with the MIME type as the -keys and the values being an object with the following keys: - -- `compressible` - leave out if you don't know, otherwise `true`/`false` to - indicate whether the data represented by the type is typically compressible. -- `extensions` - include an array of file extensions that are associated with - the type. -- `notes` - human-readable notes about the type, typically what the type is. -- `sources` - include an array of URLs of where the MIME type and the associated - extensions are sourced from. This needs to be a [primary source](https://en.wikipedia.org/wiki/Primary_source); - links to type aggregating sites and Wikipedia are _not acceptable_. - -To update the build, run `npm run build`. - -### Adding Custom Media Types - -The best way to get new media types included in this library is to register -them with the IANA. The community registration procedure is outlined in -[RFC 6838 section 5](http://tools.ietf.org/html/rfc6838#section-5). Types -registered with the IANA are automatically pulled into this library. - -If that is not possible / feasible, they can be added directly here as a -"custom" type. To do this, it is required to have a primary source that -definitively lists the media type. If an extension is going to be listed as -associateed with this media type, the source must definitively link the -media type and extension as well. - -[ci-image]: https://badgen.net/github/checks/jshttp/mime-db/master?label=ci -[ci-url]: https://github.com/jshttp/mime-db/actions?query=workflow%3Aci -[coveralls-image]: https://badgen.net/coveralls/c/github/jshttp/mime-db/master -[coveralls-url]: https://coveralls.io/r/jshttp/mime-db?branch=master -[node-image]: https://badgen.net/npm/node/mime-db -[node-url]: https://nodejs.org/en/download -[npm-downloads-image]: https://badgen.net/npm/dm/mime-db -[npm-url]: https://npmjs.org/package/mime-db -[npm-version-image]: https://badgen.net/npm/v/mime-db diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/mime-db/db.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/mime-db/db.json deleted file mode 100644 index eb9c42c4..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/mime-db/db.json +++ /dev/null @@ -1,8519 +0,0 @@ -{ - "application/1d-interleaved-parityfec": { - "source": "iana" - }, - "application/3gpdash-qoe-report+xml": { - "source": "iana", - "charset": "UTF-8", - "compressible": true - }, - "application/3gpp-ims+xml": { - "source": "iana", - "compressible": true - }, - "application/3gpphal+json": { - "source": "iana", - "compressible": true - }, - "application/3gpphalforms+json": { - "source": "iana", - "compressible": true - }, - "application/a2l": { - "source": "iana" - }, - "application/ace+cbor": { - "source": "iana" - }, - "application/activemessage": { - "source": "iana" - }, - "application/activity+json": { - "source": "iana", - "compressible": true - }, - "application/alto-costmap+json": { - "source": "iana", - "compressible": true - }, - "application/alto-costmapfilter+json": { - "source": "iana", - "compressible": true - }, - "application/alto-directory+json": { - "source": "iana", - "compressible": true - }, - "application/alto-endpointcost+json": { - "source": "iana", - "compressible": true - }, - "application/alto-endpointcostparams+json": { - "source": "iana", - "compressible": true - }, - "application/alto-endpointprop+json": { - "source": "iana", - "compressible": true - }, - "application/alto-endpointpropparams+json": { - "source": "iana", - "compressible": true - }, - "application/alto-error+json": { - "source": "iana", - "compressible": true - }, - "application/alto-networkmap+json": { - "source": "iana", - "compressible": true - }, - "application/alto-networkmapfilter+json": { - "source": "iana", - "compressible": true - }, - "application/alto-updatestreamcontrol+json": { - "source": "iana", - "compressible": true - }, - "application/alto-updatestreamparams+json": { - "source": "iana", - "compressible": true - }, - "application/aml": { - "source": "iana" - }, - "application/andrew-inset": { - "source": "iana", - "extensions": ["ez"] - }, - "application/applefile": { - "source": "iana" - }, - "application/applixware": { - "source": "apache", - "extensions": ["aw"] - }, - "application/at+jwt": { - "source": "iana" - }, - "application/atf": { - "source": "iana" - }, - "application/atfx": { - "source": "iana" - }, - "application/atom+xml": { - "source": "iana", - "compressible": true, - "extensions": ["atom"] - }, - "application/atomcat+xml": { - "source": "iana", - "compressible": true, - "extensions": ["atomcat"] - }, - "application/atomdeleted+xml": { - "source": "iana", - "compressible": true, - "extensions": ["atomdeleted"] - }, - "application/atomicmail": { - "source": "iana" - }, - "application/atomsvc+xml": { - "source": "iana", - "compressible": true, - "extensions": ["atomsvc"] - }, - "application/atsc-dwd+xml": { - "source": "iana", - "compressible": true, - "extensions": ["dwd"] - }, - "application/atsc-dynamic-event-message": { - "source": "iana" - }, - "application/atsc-held+xml": { - "source": "iana", - "compressible": true, - "extensions": ["held"] - }, - "application/atsc-rdt+json": { - "source": "iana", - "compressible": true - }, - "application/atsc-rsat+xml": { - "source": "iana", - "compressible": true, - "extensions": ["rsat"] - }, - "application/atxml": { - "source": "iana" - }, - "application/auth-policy+xml": { - "source": "iana", - "compressible": true - }, - "application/bacnet-xdd+zip": { - "source": "iana", - "compressible": false - }, - "application/batch-smtp": { - "source": "iana" - }, - "application/bdoc": { - "compressible": false, - "extensions": ["bdoc"] - }, - "application/beep+xml": { - "source": "iana", - "charset": "UTF-8", - "compressible": true - }, - "application/calendar+json": { - "source": "iana", - "compressible": true - }, - "application/calendar+xml": { - "source": "iana", - "compressible": true, - "extensions": ["xcs"] - }, - "application/call-completion": { - "source": "iana" - }, - "application/cals-1840": { - "source": "iana" - }, - "application/captive+json": { - "source": "iana", - "compressible": true - }, - "application/cbor": { - "source": "iana" - }, - "application/cbor-seq": { - "source": "iana" - }, - "application/cccex": { - "source": "iana" - }, - "application/ccmp+xml": { - "source": "iana", - "compressible": true - }, - "application/ccxml+xml": { - "source": "iana", - "compressible": true, - "extensions": ["ccxml"] - }, - "application/cdfx+xml": { - "source": "iana", - "compressible": true, - "extensions": ["cdfx"] - }, - "application/cdmi-capability": { - "source": "iana", - "extensions": ["cdmia"] - }, - "application/cdmi-container": { - "source": "iana", - "extensions": ["cdmic"] - }, - "application/cdmi-domain": { - "source": "iana", - "extensions": ["cdmid"] - }, - "application/cdmi-object": { - "source": "iana", - "extensions": ["cdmio"] - }, - "application/cdmi-queue": { - "source": "iana", - "extensions": ["cdmiq"] - }, - "application/cdni": { - "source": "iana" - }, - "application/cea": { - "source": "iana" - }, - "application/cea-2018+xml": { - "source": "iana", - "compressible": true - }, - "application/cellml+xml": { - "source": "iana", - "compressible": true - }, - "application/cfw": { - "source": "iana" - }, - "application/city+json": { - "source": "iana", - "compressible": true - }, - "application/clr": { - "source": "iana" - }, - "application/clue+xml": { - "source": "iana", - "compressible": true - }, - "application/clue_info+xml": { - "source": "iana", - "compressible": true - }, - "application/cms": { - "source": "iana" - }, - "application/cnrp+xml": { - "source": "iana", - "compressible": true - }, - "application/coap-group+json": { - "source": "iana", - "compressible": true - }, - "application/coap-payload": { - "source": "iana" - }, - "application/commonground": { - "source": "iana" - }, - "application/conference-info+xml": { - "source": "iana", - "compressible": true - }, - "application/cose": { - "source": "iana" - }, - "application/cose-key": { - "source": "iana" - }, - "application/cose-key-set": { - "source": "iana" - }, - "application/cpl+xml": { - "source": "iana", - "compressible": true, - "extensions": ["cpl"] - }, - "application/csrattrs": { - "source": "iana" - }, - "application/csta+xml": { - "source": "iana", - "compressible": true - }, - "application/cstadata+xml": { - "source": "iana", - "compressible": true - }, - "application/csvm+json": { - "source": "iana", - "compressible": true - }, - "application/cu-seeme": { - "source": "apache", - "extensions": ["cu"] - }, - "application/cwt": { - "source": "iana" - }, - "application/cybercash": { - "source": "iana" - }, - "application/dart": { - "compressible": true - }, - "application/dash+xml": { - "source": "iana", - "compressible": true, - "extensions": ["mpd"] - }, - "application/dash-patch+xml": { - "source": "iana", - "compressible": true, - "extensions": ["mpp"] - }, - "application/dashdelta": { - "source": "iana" - }, - "application/davmount+xml": { - "source": "iana", - "compressible": true, - "extensions": ["davmount"] - }, - "application/dca-rft": { - "source": "iana" - }, - "application/dcd": { - "source": "iana" - }, - "application/dec-dx": { - "source": "iana" - }, - "application/dialog-info+xml": { - "source": "iana", - "compressible": true - }, - "application/dicom": { - "source": "iana" - }, - "application/dicom+json": { - "source": "iana", - "compressible": true - }, - "application/dicom+xml": { - "source": "iana", - "compressible": true - }, - "application/dii": { - "source": "iana" - }, - "application/dit": { - "source": "iana" - }, - "application/dns": { - "source": "iana" - }, - "application/dns+json": { - "source": "iana", - "compressible": true - }, - "application/dns-message": { - "source": "iana" - }, - "application/docbook+xml": { - "source": "apache", - "compressible": true, - "extensions": ["dbk"] - }, - "application/dots+cbor": { - "source": "iana" - }, - "application/dskpp+xml": { - "source": "iana", - "compressible": true - }, - "application/dssc+der": { - "source": "iana", - "extensions": ["dssc"] - }, - "application/dssc+xml": { - "source": "iana", - "compressible": true, - "extensions": ["xdssc"] - }, - "application/dvcs": { - "source": "iana" - }, - "application/ecmascript": { - "source": "iana", - "compressible": true, - "extensions": ["es","ecma"] - }, - "application/edi-consent": { - "source": "iana" - }, - "application/edi-x12": { - "source": "iana", - "compressible": false - }, - "application/edifact": { - "source": "iana", - "compressible": false - }, - "application/efi": { - "source": "iana" - }, - "application/elm+json": { - "source": "iana", - "charset": "UTF-8", - "compressible": true - }, - "application/elm+xml": { - "source": "iana", - "compressible": true - }, - "application/emergencycalldata.cap+xml": { - "source": "iana", - "charset": "UTF-8", - "compressible": true - }, - "application/emergencycalldata.comment+xml": { - "source": "iana", - "compressible": true - }, - "application/emergencycalldata.control+xml": { - "source": "iana", - "compressible": true - }, - "application/emergencycalldata.deviceinfo+xml": { - "source": "iana", - "compressible": true - }, - "application/emergencycalldata.ecall.msd": { - "source": "iana" - }, - "application/emergencycalldata.providerinfo+xml": { - "source": "iana", - "compressible": true - }, - "application/emergencycalldata.serviceinfo+xml": { - "source": "iana", - "compressible": true - }, - "application/emergencycalldata.subscriberinfo+xml": { - "source": "iana", - "compressible": true - }, - "application/emergencycalldata.veds+xml": { - "source": "iana", - "compressible": true - }, - "application/emma+xml": { - "source": "iana", - "compressible": true, - "extensions": ["emma"] - }, - "application/emotionml+xml": { - "source": "iana", - "compressible": true, - "extensions": ["emotionml"] - }, - "application/encaprtp": { - "source": "iana" - }, - "application/epp+xml": { - "source": "iana", - "compressible": true - }, - "application/epub+zip": { - "source": "iana", - "compressible": false, - "extensions": ["epub"] - }, - "application/eshop": { - "source": "iana" - }, - "application/exi": { - "source": "iana", - "extensions": ["exi"] - }, - "application/expect-ct-report+json": { - "source": "iana", - "compressible": true - }, - "application/express": { - "source": "iana", - "extensions": ["exp"] - }, - "application/fastinfoset": { - "source": "iana" - }, - "application/fastsoap": { - "source": "iana" - }, - "application/fdt+xml": { - "source": "iana", - "compressible": true, - "extensions": ["fdt"] - }, - "application/fhir+json": { - "source": "iana", - "charset": "UTF-8", - "compressible": true - }, - "application/fhir+xml": { - "source": "iana", - "charset": "UTF-8", - "compressible": true - }, - "application/fido.trusted-apps+json": { - "compressible": true - }, - "application/fits": { - "source": "iana" - }, - "application/flexfec": { - "source": "iana" - }, - "application/font-sfnt": { - "source": "iana" - }, - "application/font-tdpfr": { - "source": "iana", - "extensions": ["pfr"] - }, - "application/font-woff": { - "source": "iana", - "compressible": false - }, - "application/framework-attributes+xml": { - "source": "iana", - "compressible": true - }, - "application/geo+json": { - "source": "iana", - "compressible": true, - "extensions": ["geojson"] - }, - "application/geo+json-seq": { - "source": "iana" - }, - "application/geopackage+sqlite3": { - "source": "iana" - }, - "application/geoxacml+xml": { - "source": "iana", - "compressible": true - }, - "application/gltf-buffer": { - "source": "iana" - }, - "application/gml+xml": { - "source": "iana", - "compressible": true, - "extensions": ["gml"] - }, - "application/gpx+xml": { - "source": "apache", - "compressible": true, - "extensions": ["gpx"] - }, - "application/gxf": { - "source": "apache", - "extensions": ["gxf"] - }, - "application/gzip": { - "source": "iana", - "compressible": false, - "extensions": ["gz"] - }, - "application/h224": { - "source": "iana" - }, - "application/held+xml": { - "source": "iana", - "compressible": true - }, - "application/hjson": { - "extensions": ["hjson"] - }, - "application/http": { - "source": "iana" - }, - "application/hyperstudio": { - "source": "iana", - "extensions": ["stk"] - }, - "application/ibe-key-request+xml": { - "source": "iana", - "compressible": true - }, - "application/ibe-pkg-reply+xml": { - "source": "iana", - "compressible": true - }, - "application/ibe-pp-data": { - "source": "iana" - }, - "application/iges": { - "source": "iana" - }, - "application/im-iscomposing+xml": { - "source": "iana", - "charset": "UTF-8", - "compressible": true - }, - "application/index": { - "source": "iana" - }, - "application/index.cmd": { - "source": "iana" - }, - "application/index.obj": { - "source": "iana" - }, - "application/index.response": { - "source": "iana" - }, - "application/index.vnd": { - "source": "iana" - }, - "application/inkml+xml": { - "source": "iana", - "compressible": true, - "extensions": ["ink","inkml"] - }, - "application/iotp": { - "source": "iana" - }, - "application/ipfix": { - "source": "iana", - "extensions": ["ipfix"] - }, - "application/ipp": { - "source": "iana" - }, - "application/isup": { - "source": "iana" - }, - "application/its+xml": { - "source": "iana", - "compressible": true, - "extensions": ["its"] - }, - "application/java-archive": { - "source": "apache", - "compressible": false, - "extensions": ["jar","war","ear"] - }, - "application/java-serialized-object": { - "source": "apache", - "compressible": false, - "extensions": ["ser"] - }, - "application/java-vm": { - "source": "apache", - "compressible": false, - "extensions": ["class"] - }, - "application/javascript": { - "source": "iana", - "charset": "UTF-8", - "compressible": true, - "extensions": ["js","mjs"] - }, - "application/jf2feed+json": { - "source": "iana", - "compressible": true - }, - "application/jose": { - "source": "iana" - }, - "application/jose+json": { - "source": "iana", - "compressible": true - }, - "application/jrd+json": { - "source": "iana", - "compressible": true - }, - "application/jscalendar+json": { - "source": "iana", - "compressible": true - }, - "application/json": { - "source": "iana", - "charset": "UTF-8", - "compressible": true, - "extensions": ["json","map"] - }, - "application/json-patch+json": { - "source": "iana", - "compressible": true - }, - "application/json-seq": { - "source": "iana" - }, - "application/json5": { - "extensions": ["json5"] - }, - "application/jsonml+json": { - "source": "apache", - "compressible": true, - "extensions": ["jsonml"] - }, - "application/jwk+json": { - "source": "iana", - "compressible": true - }, - "application/jwk-set+json": { - "source": "iana", - "compressible": true - }, - "application/jwt": { - "source": "iana" - }, - "application/kpml-request+xml": { - "source": "iana", - "compressible": true - }, - "application/kpml-response+xml": { - "source": "iana", - "compressible": true - }, - "application/ld+json": { - "source": "iana", - "compressible": true, - "extensions": ["jsonld"] - }, - "application/lgr+xml": { - "source": "iana", - "compressible": true, - "extensions": ["lgr"] - }, - "application/link-format": { - "source": "iana" - }, - "application/load-control+xml": { - "source": "iana", - "compressible": true - }, - "application/lost+xml": { - "source": "iana", - "compressible": true, - "extensions": ["lostxml"] - }, - "application/lostsync+xml": { - "source": "iana", - "compressible": true - }, - "application/lpf+zip": { - "source": "iana", - "compressible": false - }, - "application/lxf": { - "source": "iana" - }, - "application/mac-binhex40": { - "source": "iana", - "extensions": ["hqx"] - }, - "application/mac-compactpro": { - "source": "apache", - "extensions": ["cpt"] - }, - "application/macwriteii": { - "source": "iana" - }, - "application/mads+xml": { - "source": "iana", - "compressible": true, - "extensions": ["mads"] - }, - "application/manifest+json": { - "source": "iana", - "charset": "UTF-8", - "compressible": true, - "extensions": ["webmanifest"] - }, - "application/marc": { - "source": "iana", - "extensions": ["mrc"] - }, - "application/marcxml+xml": { - "source": "iana", - "compressible": true, - "extensions": ["mrcx"] - }, - "application/mathematica": { - "source": "iana", - "extensions": ["ma","nb","mb"] - }, - "application/mathml+xml": { - "source": "iana", - "compressible": true, - "extensions": ["mathml"] - }, - "application/mathml-content+xml": { - "source": "iana", - "compressible": true - }, - "application/mathml-presentation+xml": { - "source": "iana", - "compressible": true - }, - "application/mbms-associated-procedure-description+xml": { - "source": "iana", - "compressible": true - }, - "application/mbms-deregister+xml": { - "source": "iana", - "compressible": true - }, - "application/mbms-envelope+xml": { - "source": "iana", - "compressible": true - }, - "application/mbms-msk+xml": { - "source": "iana", - "compressible": true - }, - "application/mbms-msk-response+xml": { - "source": "iana", - "compressible": true - }, - "application/mbms-protection-description+xml": { - "source": "iana", - "compressible": true - }, - "application/mbms-reception-report+xml": { - "source": "iana", - "compressible": true - }, - "application/mbms-register+xml": { - "source": "iana", - "compressible": true - }, - "application/mbms-register-response+xml": { - "source": "iana", - "compressible": true - }, - "application/mbms-schedule+xml": { - "source": "iana", - "compressible": true - }, - "application/mbms-user-service-description+xml": { - "source": "iana", - "compressible": true - }, - "application/mbox": { - "source": "iana", - "extensions": ["mbox"] - }, - "application/media-policy-dataset+xml": { - "source": "iana", - "compressible": true, - "extensions": ["mpf"] - }, - "application/media_control+xml": { - "source": "iana", - "compressible": true - }, - "application/mediaservercontrol+xml": { - "source": "iana", - "compressible": true, - "extensions": ["mscml"] - }, - "application/merge-patch+json": { - "source": "iana", - "compressible": true - }, - "application/metalink+xml": { - "source": "apache", - "compressible": true, - "extensions": ["metalink"] - }, - "application/metalink4+xml": { - "source": "iana", - "compressible": true, - "extensions": ["meta4"] - }, - "application/mets+xml": { - "source": "iana", - "compressible": true, - "extensions": ["mets"] - }, - "application/mf4": { - "source": "iana" - }, - "application/mikey": { - "source": "iana" - }, - "application/mipc": { - "source": "iana" - }, - "application/missing-blocks+cbor-seq": { - "source": "iana" - }, - "application/mmt-aei+xml": { - "source": "iana", - "compressible": true, - "extensions": ["maei"] - }, - "application/mmt-usd+xml": { - "source": "iana", - "compressible": true, - "extensions": ["musd"] - }, - "application/mods+xml": { - "source": "iana", - "compressible": true, - "extensions": ["mods"] - }, - "application/moss-keys": { - "source": "iana" - }, - "application/moss-signature": { - "source": "iana" - }, - "application/mosskey-data": { - "source": "iana" - }, - "application/mosskey-request": { - "source": "iana" - }, - "application/mp21": { - "source": "iana", - "extensions": ["m21","mp21"] - }, - "application/mp4": { - "source": "iana", - "extensions": ["mp4s","m4p"] - }, - "application/mpeg4-generic": { - "source": "iana" - }, - "application/mpeg4-iod": { - "source": "iana" - }, - "application/mpeg4-iod-xmt": { - "source": "iana" - }, - "application/mrb-consumer+xml": { - "source": "iana", - "compressible": true - }, - "application/mrb-publish+xml": { - "source": "iana", - "compressible": true - }, - "application/msc-ivr+xml": { - "source": "iana", - "charset": "UTF-8", - "compressible": true - }, - "application/msc-mixer+xml": { - "source": "iana", - "charset": "UTF-8", - "compressible": true - }, - "application/msword": { - "source": "iana", - "compressible": false, - "extensions": ["doc","dot"] - }, - "application/mud+json": { - "source": "iana", - "compressible": true - }, - "application/multipart-core": { - "source": "iana" - }, - "application/mxf": { - "source": "iana", - "extensions": ["mxf"] - }, - "application/n-quads": { - "source": "iana", - "extensions": ["nq"] - }, - "application/n-triples": { - "source": "iana", - "extensions": ["nt"] - }, - "application/nasdata": { - "source": "iana" - }, - "application/news-checkgroups": { - "source": "iana", - "charset": "US-ASCII" - }, - "application/news-groupinfo": { - "source": "iana", - "charset": "US-ASCII" - }, - "application/news-transmission": { - "source": "iana" - }, - "application/nlsml+xml": { - "source": "iana", - "compressible": true - }, - "application/node": { - "source": "iana", - "extensions": ["cjs"] - }, - "application/nss": { - "source": "iana" - }, - "application/oauth-authz-req+jwt": { - "source": "iana" - }, - "application/oblivious-dns-message": { - "source": "iana" - }, - "application/ocsp-request": { - "source": "iana" - }, - "application/ocsp-response": { - "source": "iana" - }, - "application/octet-stream": { - "source": "iana", - "compressible": false, - "extensions": ["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"] - }, - "application/oda": { - "source": "iana", - "extensions": ["oda"] - }, - "application/odm+xml": { - "source": "iana", - "compressible": true - }, - "application/odx": { - "source": "iana" - }, - "application/oebps-package+xml": { - "source": "iana", - "compressible": true, - "extensions": ["opf"] - }, - "application/ogg": { - "source": "iana", - "compressible": false, - "extensions": ["ogx"] - }, - "application/omdoc+xml": { - "source": "apache", - "compressible": true, - "extensions": ["omdoc"] - }, - "application/onenote": { - "source": "apache", - "extensions": ["onetoc","onetoc2","onetmp","onepkg"] - }, - "application/opc-nodeset+xml": { - "source": "iana", - "compressible": true - }, - "application/oscore": { - "source": "iana" - }, - "application/oxps": { - "source": "iana", - "extensions": ["oxps"] - }, - "application/p21": { - "source": "iana" - }, - "application/p21+zip": { - "source": "iana", - "compressible": false - }, - "application/p2p-overlay+xml": { - "source": "iana", - "compressible": true, - "extensions": ["relo"] - }, - "application/parityfec": { - "source": "iana" - }, - "application/passport": { - "source": "iana" - }, - "application/patch-ops-error+xml": { - "source": "iana", - "compressible": true, - "extensions": ["xer"] - }, - "application/pdf": { - "source": "iana", - "compressible": false, - "extensions": ["pdf"] - }, - "application/pdx": { - "source": "iana" - }, - "application/pem-certificate-chain": { - "source": "iana" - }, - "application/pgp-encrypted": { - "source": "iana", - "compressible": false, - "extensions": ["pgp"] - }, - "application/pgp-keys": { - "source": "iana", - "extensions": ["asc"] - }, - "application/pgp-signature": { - "source": "iana", - "extensions": ["asc","sig"] - }, - "application/pics-rules": { - "source": "apache", - "extensions": ["prf"] - }, - "application/pidf+xml": { - "source": "iana", - "charset": "UTF-8", - "compressible": true - }, - "application/pidf-diff+xml": { - "source": "iana", - "charset": "UTF-8", - "compressible": true - }, - "application/pkcs10": { - "source": "iana", - "extensions": ["p10"] - }, - "application/pkcs12": { - "source": "iana" - }, - "application/pkcs7-mime": { - "source": "iana", - "extensions": ["p7m","p7c"] - }, - "application/pkcs7-signature": { - "source": "iana", - "extensions": ["p7s"] - }, - "application/pkcs8": { - "source": "iana", - "extensions": ["p8"] - }, - "application/pkcs8-encrypted": { - "source": "iana" - }, - "application/pkix-attr-cert": { - "source": "iana", - "extensions": ["ac"] - }, - "application/pkix-cert": { - "source": "iana", - "extensions": ["cer"] - }, - "application/pkix-crl": { - "source": "iana", - "extensions": ["crl"] - }, - "application/pkix-pkipath": { - "source": "iana", - "extensions": ["pkipath"] - }, - "application/pkixcmp": { - "source": "iana", - "extensions": ["pki"] - }, - "application/pls+xml": { - "source": "iana", - "compressible": true, - "extensions": ["pls"] - }, - "application/poc-settings+xml": { - "source": "iana", - "charset": "UTF-8", - "compressible": true - }, - "application/postscript": { - "source": "iana", - "compressible": true, - "extensions": ["ai","eps","ps"] - }, - "application/ppsp-tracker+json": { - "source": "iana", - "compressible": true - }, - "application/problem+json": { - "source": "iana", - "compressible": true - }, - "application/problem+xml": { - "source": "iana", - "compressible": true - }, - "application/provenance+xml": { - "source": "iana", - "compressible": true, - "extensions": ["provx"] - }, - "application/prs.alvestrand.titrax-sheet": { - "source": "iana" - }, - "application/prs.cww": { - "source": "iana", - "extensions": ["cww"] - }, - "application/prs.cyn": { - "source": "iana", - "charset": "7-BIT" - }, - "application/prs.hpub+zip": { - "source": "iana", - "compressible": false - }, - "application/prs.nprend": { - "source": "iana" - }, - "application/prs.plucker": { - "source": "iana" - }, - "application/prs.rdf-xml-crypt": { - "source": "iana" - }, - "application/prs.xsf+xml": { - "source": "iana", - "compressible": true - }, - "application/pskc+xml": { - "source": "iana", - "compressible": true, - "extensions": ["pskcxml"] - }, - "application/pvd+json": { - "source": "iana", - "compressible": true - }, - "application/qsig": { - "source": "iana" - }, - "application/raml+yaml": { - "compressible": true, - "extensions": ["raml"] - }, - "application/raptorfec": { - "source": "iana" - }, - "application/rdap+json": { - "source": "iana", - "compressible": true - }, - "application/rdf+xml": { - "source": "iana", - "compressible": true, - "extensions": ["rdf","owl"] - }, - "application/reginfo+xml": { - "source": "iana", - "compressible": true, - "extensions": ["rif"] - }, - "application/relax-ng-compact-syntax": { - "source": "iana", - "extensions": ["rnc"] - }, - "application/remote-printing": { - "source": "iana" - }, - "application/reputon+json": { - "source": "iana", - "compressible": true - }, - "application/resource-lists+xml": { - "source": "iana", - "compressible": true, - "extensions": ["rl"] - }, - "application/resource-lists-diff+xml": { - "source": "iana", - "compressible": true, - "extensions": ["rld"] - }, - "application/rfc+xml": { - "source": "iana", - "compressible": true - }, - "application/riscos": { - "source": "iana" - }, - "application/rlmi+xml": { - "source": "iana", - "compressible": true - }, - "application/rls-services+xml": { - "source": "iana", - "compressible": true, - "extensions": ["rs"] - }, - "application/route-apd+xml": { - "source": "iana", - "compressible": true, - "extensions": ["rapd"] - }, - "application/route-s-tsid+xml": { - "source": "iana", - "compressible": true, - "extensions": ["sls"] - }, - "application/route-usd+xml": { - "source": "iana", - "compressible": true, - "extensions": ["rusd"] - }, - "application/rpki-ghostbusters": { - "source": "iana", - "extensions": ["gbr"] - }, - "application/rpki-manifest": { - "source": "iana", - "extensions": ["mft"] - }, - "application/rpki-publication": { - "source": "iana" - }, - "application/rpki-roa": { - "source": "iana", - "extensions": ["roa"] - }, - "application/rpki-updown": { - "source": "iana" - }, - "application/rsd+xml": { - "source": "apache", - "compressible": true, - "extensions": ["rsd"] - }, - "application/rss+xml": { - "source": "apache", - "compressible": true, - "extensions": ["rss"] - }, - "application/rtf": { - "source": "iana", - "compressible": true, - "extensions": ["rtf"] - }, - "application/rtploopback": { - "source": "iana" - }, - "application/rtx": { - "source": "iana" - }, - "application/samlassertion+xml": { - "source": "iana", - "compressible": true - }, - "application/samlmetadata+xml": { - "source": "iana", - "compressible": true - }, - "application/sarif+json": { - "source": "iana", - "compressible": true - }, - "application/sarif-external-properties+json": { - "source": "iana", - "compressible": true - }, - "application/sbe": { - "source": "iana" - }, - "application/sbml+xml": { - "source": "iana", - "compressible": true, - "extensions": ["sbml"] - }, - "application/scaip+xml": { - "source": "iana", - "compressible": true - }, - "application/scim+json": { - "source": "iana", - "compressible": true - }, - "application/scvp-cv-request": { - "source": "iana", - "extensions": ["scq"] - }, - "application/scvp-cv-response": { - "source": "iana", - "extensions": ["scs"] - }, - "application/scvp-vp-request": { - "source": "iana", - "extensions": ["spq"] - }, - "application/scvp-vp-response": { - "source": "iana", - "extensions": ["spp"] - }, - "application/sdp": { - "source": "iana", - "extensions": ["sdp"] - }, - "application/secevent+jwt": { - "source": "iana" - }, - "application/senml+cbor": { - "source": "iana" - }, - "application/senml+json": { - "source": "iana", - "compressible": true - }, - "application/senml+xml": { - "source": "iana", - "compressible": true, - "extensions": ["senmlx"] - }, - "application/senml-etch+cbor": { - "source": "iana" - }, - "application/senml-etch+json": { - "source": "iana", - "compressible": true - }, - "application/senml-exi": { - "source": "iana" - }, - "application/sensml+cbor": { - "source": "iana" - }, - "application/sensml+json": { - "source": "iana", - "compressible": true - }, - "application/sensml+xml": { - "source": "iana", - "compressible": true, - "extensions": ["sensmlx"] - }, - "application/sensml-exi": { - "source": "iana" - }, - "application/sep+xml": { - "source": "iana", - "compressible": true - }, - "application/sep-exi": { - "source": "iana" - }, - "application/session-info": { - "source": "iana" - }, - "application/set-payment": { - "source": "iana" - }, - "application/set-payment-initiation": { - "source": "iana", - "extensions": ["setpay"] - }, - "application/set-registration": { - "source": "iana" - }, - "application/set-registration-initiation": { - "source": "iana", - "extensions": ["setreg"] - }, - "application/sgml": { - "source": "iana" - }, - "application/sgml-open-catalog": { - "source": "iana" - }, - "application/shf+xml": { - "source": "iana", - "compressible": true, - "extensions": ["shf"] - }, - "application/sieve": { - "source": "iana", - "extensions": ["siv","sieve"] - }, - "application/simple-filter+xml": { - "source": "iana", - "compressible": true - }, - "application/simple-message-summary": { - "source": "iana" - }, - "application/simplesymbolcontainer": { - "source": "iana" - }, - "application/sipc": { - "source": "iana" - }, - "application/slate": { - "source": "iana" - }, - "application/smil": { - "source": "iana" - }, - "application/smil+xml": { - "source": "iana", - "compressible": true, - "extensions": ["smi","smil"] - }, - "application/smpte336m": { - "source": "iana" - }, - "application/soap+fastinfoset": { - "source": "iana" - }, - "application/soap+xml": { - "source": "iana", - "compressible": true - }, - "application/sparql-query": { - "source": "iana", - "extensions": ["rq"] - }, - "application/sparql-results+xml": { - "source": "iana", - "compressible": true, - "extensions": ["srx"] - }, - "application/spdx+json": { - "source": "iana", - "compressible": true - }, - "application/spirits-event+xml": { - "source": "iana", - "compressible": true - }, - "application/sql": { - "source": "iana" - }, - "application/srgs": { - "source": "iana", - "extensions": ["gram"] - }, - "application/srgs+xml": { - "source": "iana", - "compressible": true, - "extensions": ["grxml"] - }, - "application/sru+xml": { - "source": "iana", - "compressible": true, - "extensions": ["sru"] - }, - "application/ssdl+xml": { - "source": "apache", - "compressible": true, - "extensions": ["ssdl"] - }, - "application/ssml+xml": { - "source": "iana", - "compressible": true, - "extensions": ["ssml"] - }, - "application/stix+json": { - "source": "iana", - "compressible": true - }, - "application/swid+xml": { - "source": "iana", - "compressible": true, - "extensions": ["swidtag"] - }, - "application/tamp-apex-update": { - "source": "iana" - }, - "application/tamp-apex-update-confirm": { - "source": "iana" - }, - "application/tamp-community-update": { - "source": "iana" - }, - "application/tamp-community-update-confirm": { - "source": "iana" - }, - "application/tamp-error": { - "source": "iana" - }, - "application/tamp-sequence-adjust": { - "source": "iana" - }, - "application/tamp-sequence-adjust-confirm": { - "source": "iana" - }, - "application/tamp-status-query": { - "source": "iana" - }, - "application/tamp-status-response": { - "source": "iana" - }, - "application/tamp-update": { - "source": "iana" - }, - "application/tamp-update-confirm": { - "source": "iana" - }, - "application/tar": { - "compressible": true - }, - "application/taxii+json": { - "source": "iana", - "compressible": true - }, - "application/td+json": { - "source": "iana", - "compressible": true - }, - "application/tei+xml": { - "source": "iana", - "compressible": true, - "extensions": ["tei","teicorpus"] - }, - "application/tetra_isi": { - "source": "iana" - }, - "application/thraud+xml": { - "source": "iana", - "compressible": true, - "extensions": ["tfi"] - }, - "application/timestamp-query": { - "source": "iana" - }, - "application/timestamp-reply": { - "source": "iana" - }, - "application/timestamped-data": { - "source": "iana", - "extensions": ["tsd"] - }, - "application/tlsrpt+gzip": { - "source": "iana" - }, - "application/tlsrpt+json": { - "source": "iana", - "compressible": true - }, - "application/tnauthlist": { - "source": "iana" - }, - "application/token-introspection+jwt": { - "source": "iana" - }, - "application/toml": { - "compressible": true, - "extensions": ["toml"] - }, - "application/trickle-ice-sdpfrag": { - "source": "iana" - }, - "application/trig": { - "source": "iana", - "extensions": ["trig"] - }, - "application/ttml+xml": { - "source": "iana", - "compressible": true, - "extensions": ["ttml"] - }, - "application/tve-trigger": { - "source": "iana" - }, - "application/tzif": { - "source": "iana" - }, - "application/tzif-leap": { - "source": "iana" - }, - "application/ubjson": { - "compressible": false, - "extensions": ["ubj"] - }, - "application/ulpfec": { - "source": "iana" - }, - "application/urc-grpsheet+xml": { - "source": "iana", - "compressible": true - }, - "application/urc-ressheet+xml": { - "source": "iana", - "compressible": true, - "extensions": ["rsheet"] - }, - "application/urc-targetdesc+xml": { - "source": "iana", - "compressible": true, - "extensions": ["td"] - }, - "application/urc-uisocketdesc+xml": { - "source": "iana", - "compressible": true - }, - "application/vcard+json": { - "source": "iana", - "compressible": true - }, - "application/vcard+xml": { - "source": "iana", - "compressible": true - }, - "application/vemmi": { - "source": "iana" - }, - "application/vividence.scriptfile": { - "source": "apache" - }, - "application/vnd.1000minds.decision-model+xml": { - "source": "iana", - "compressible": true, - "extensions": ["1km"] - }, - "application/vnd.3gpp-prose+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp-prose-pc3ch+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp-v2x-local-service-information": { - "source": "iana" - }, - "application/vnd.3gpp.5gnas": { - "source": "iana" - }, - "application/vnd.3gpp.access-transfer-events+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.bsf+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.gmop+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.gtpc": { - "source": "iana" - }, - "application/vnd.3gpp.interworking-data": { - "source": "iana" - }, - "application/vnd.3gpp.lpp": { - "source": "iana" - }, - "application/vnd.3gpp.mc-signalling-ear": { - "source": "iana" - }, - "application/vnd.3gpp.mcdata-affiliation-command+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.mcdata-info+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.mcdata-payload": { - "source": "iana" - }, - "application/vnd.3gpp.mcdata-service-config+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.mcdata-signalling": { - "source": "iana" - }, - "application/vnd.3gpp.mcdata-ue-config+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.mcdata-user-profile+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.mcptt-affiliation-command+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.mcptt-floor-request+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.mcptt-info+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.mcptt-location-info+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.mcptt-mbms-usage-info+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.mcptt-service-config+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.mcptt-signed+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.mcptt-ue-config+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.mcptt-ue-init-config+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.mcptt-user-profile+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.mcvideo-affiliation-command+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.mcvideo-affiliation-info+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.mcvideo-info+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.mcvideo-location-info+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.mcvideo-mbms-usage-info+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.mcvideo-service-config+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.mcvideo-transmission-request+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.mcvideo-ue-config+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.mcvideo-user-profile+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.mid-call+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.ngap": { - "source": "iana" - }, - "application/vnd.3gpp.pfcp": { - "source": "iana" - }, - "application/vnd.3gpp.pic-bw-large": { - "source": "iana", - "extensions": ["plb"] - }, - "application/vnd.3gpp.pic-bw-small": { - "source": "iana", - "extensions": ["psb"] - }, - "application/vnd.3gpp.pic-bw-var": { - "source": "iana", - "extensions": ["pvb"] - }, - "application/vnd.3gpp.s1ap": { - "source": "iana" - }, - "application/vnd.3gpp.sms": { - "source": "iana" - }, - "application/vnd.3gpp.sms+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.srvcc-ext+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.srvcc-info+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.state-and-event-info+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.ussd+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp2.bcmcsinfo+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp2.sms": { - "source": "iana" - }, - "application/vnd.3gpp2.tcap": { - "source": "iana", - "extensions": ["tcap"] - }, - "application/vnd.3lightssoftware.imagescal": { - "source": "iana" - }, - "application/vnd.3m.post-it-notes": { - "source": "iana", - "extensions": ["pwn"] - }, - "application/vnd.accpac.simply.aso": { - "source": "iana", - "extensions": ["aso"] - }, - "application/vnd.accpac.simply.imp": { - "source": "iana", - "extensions": ["imp"] - }, - "application/vnd.acucobol": { - "source": "iana", - "extensions": ["acu"] - }, - "application/vnd.acucorp": { - "source": "iana", - "extensions": ["atc","acutc"] - }, - "application/vnd.adobe.air-application-installer-package+zip": { - "source": "apache", - "compressible": false, - "extensions": ["air"] - }, - "application/vnd.adobe.flash.movie": { - "source": "iana" - }, - "application/vnd.adobe.formscentral.fcdt": { - "source": "iana", - "extensions": ["fcdt"] - }, - "application/vnd.adobe.fxp": { - "source": "iana", - "extensions": ["fxp","fxpl"] - }, - "application/vnd.adobe.partial-upload": { - "source": "iana" - }, - "application/vnd.adobe.xdp+xml": { - "source": "iana", - "compressible": true, - "extensions": ["xdp"] - }, - "application/vnd.adobe.xfdf": { - "source": "iana", - "extensions": ["xfdf"] - }, - "application/vnd.aether.imp": { - "source": "iana" - }, - "application/vnd.afpc.afplinedata": { - "source": "iana" - }, - "application/vnd.afpc.afplinedata-pagedef": { - "source": "iana" - }, - "application/vnd.afpc.cmoca-cmresource": { - "source": "iana" - }, - "application/vnd.afpc.foca-charset": { - "source": "iana" - }, - "application/vnd.afpc.foca-codedfont": { - "source": "iana" - }, - "application/vnd.afpc.foca-codepage": { - "source": "iana" - }, - "application/vnd.afpc.modca": { - "source": "iana" - }, - "application/vnd.afpc.modca-cmtable": { - "source": "iana" - }, - "application/vnd.afpc.modca-formdef": { - "source": "iana" - }, - "application/vnd.afpc.modca-mediummap": { - "source": "iana" - }, - "application/vnd.afpc.modca-objectcontainer": { - "source": "iana" - }, - "application/vnd.afpc.modca-overlay": { - "source": "iana" - }, - "application/vnd.afpc.modca-pagesegment": { - "source": "iana" - }, - "application/vnd.age": { - "source": "iana", - "extensions": ["age"] - }, - "application/vnd.ah-barcode": { - "source": "iana" - }, - "application/vnd.ahead.space": { - "source": "iana", - "extensions": ["ahead"] - }, - "application/vnd.airzip.filesecure.azf": { - "source": "iana", - "extensions": ["azf"] - }, - "application/vnd.airzip.filesecure.azs": { - "source": "iana", - "extensions": ["azs"] - }, - "application/vnd.amadeus+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.amazon.ebook": { - "source": "apache", - "extensions": ["azw"] - }, - "application/vnd.amazon.mobi8-ebook": { - "source": "iana" - }, - "application/vnd.americandynamics.acc": { - "source": "iana", - "extensions": ["acc"] - }, - "application/vnd.amiga.ami": { - "source": "iana", - "extensions": ["ami"] - }, - "application/vnd.amundsen.maze+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.android.ota": { - "source": "iana" - }, - "application/vnd.android.package-archive": { - "source": "apache", - "compressible": false, - "extensions": ["apk"] - }, - "application/vnd.anki": { - "source": "iana" - }, - "application/vnd.anser-web-certificate-issue-initiation": { - "source": "iana", - "extensions": ["cii"] - }, - "application/vnd.anser-web-funds-transfer-initiation": { - "source": "apache", - "extensions": ["fti"] - }, - "application/vnd.antix.game-component": { - "source": "iana", - "extensions": ["atx"] - }, - "application/vnd.apache.arrow.file": { - "source": "iana" - }, - "application/vnd.apache.arrow.stream": { - "source": "iana" - }, - "application/vnd.apache.thrift.binary": { - "source": "iana" - }, - "application/vnd.apache.thrift.compact": { - "source": "iana" - }, - "application/vnd.apache.thrift.json": { - "source": "iana" - }, - "application/vnd.api+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.aplextor.warrp+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.apothekende.reservation+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.apple.installer+xml": { - "source": "iana", - "compressible": true, - "extensions": ["mpkg"] - }, - "application/vnd.apple.keynote": { - "source": "iana", - "extensions": ["key"] - }, - "application/vnd.apple.mpegurl": { - "source": "iana", - "extensions": ["m3u8"] - }, - "application/vnd.apple.numbers": { - "source": "iana", - "extensions": ["numbers"] - }, - "application/vnd.apple.pages": { - "source": "iana", - "extensions": ["pages"] - }, - "application/vnd.apple.pkpass": { - "compressible": false, - "extensions": ["pkpass"] - }, - "application/vnd.arastra.swi": { - "source": "iana" - }, - "application/vnd.aristanetworks.swi": { - "source": "iana", - "extensions": ["swi"] - }, - "application/vnd.artisan+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.artsquare": { - "source": "iana" - }, - "application/vnd.astraea-software.iota": { - "source": "iana", - "extensions": ["iota"] - }, - "application/vnd.audiograph": { - "source": "iana", - "extensions": ["aep"] - }, - "application/vnd.autopackage": { - "source": "iana" - }, - "application/vnd.avalon+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.avistar+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.balsamiq.bmml+xml": { - "source": "iana", - "compressible": true, - "extensions": ["bmml"] - }, - "application/vnd.balsamiq.bmpr": { - "source": "iana" - }, - "application/vnd.banana-accounting": { - "source": "iana" - }, - "application/vnd.bbf.usp.error": { - "source": "iana" - }, - "application/vnd.bbf.usp.msg": { - "source": "iana" - }, - "application/vnd.bbf.usp.msg+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.bekitzur-stech+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.bint.med-content": { - "source": "iana" - }, - "application/vnd.biopax.rdf+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.blink-idb-value-wrapper": { - "source": "iana" - }, - "application/vnd.blueice.multipass": { - "source": "iana", - "extensions": ["mpm"] - }, - "application/vnd.bluetooth.ep.oob": { - "source": "iana" - }, - "application/vnd.bluetooth.le.oob": { - "source": "iana" - }, - "application/vnd.bmi": { - "source": "iana", - "extensions": ["bmi"] - }, - "application/vnd.bpf": { - "source": "iana" - }, - "application/vnd.bpf3": { - "source": "iana" - }, - "application/vnd.businessobjects": { - "source": "iana", - "extensions": ["rep"] - }, - "application/vnd.byu.uapi+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.cab-jscript": { - "source": "iana" - }, - "application/vnd.canon-cpdl": { - "source": "iana" - }, - "application/vnd.canon-lips": { - "source": "iana" - }, - "application/vnd.capasystems-pg+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.cendio.thinlinc.clientconf": { - "source": "iana" - }, - "application/vnd.century-systems.tcp_stream": { - "source": "iana" - }, - "application/vnd.chemdraw+xml": { - "source": "iana", - "compressible": true, - "extensions": ["cdxml"] - }, - "application/vnd.chess-pgn": { - "source": "iana" - }, - "application/vnd.chipnuts.karaoke-mmd": { - "source": "iana", - "extensions": ["mmd"] - }, - "application/vnd.ciedi": { - "source": "iana" - }, - "application/vnd.cinderella": { - "source": "iana", - "extensions": ["cdy"] - }, - "application/vnd.cirpack.isdn-ext": { - "source": "iana" - }, - "application/vnd.citationstyles.style+xml": { - "source": "iana", - "compressible": true, - "extensions": ["csl"] - }, - "application/vnd.claymore": { - "source": "iana", - "extensions": ["cla"] - }, - "application/vnd.cloanto.rp9": { - "source": "iana", - "extensions": ["rp9"] - }, - "application/vnd.clonk.c4group": { - "source": "iana", - "extensions": ["c4g","c4d","c4f","c4p","c4u"] - }, - "application/vnd.cluetrust.cartomobile-config": { - "source": "iana", - "extensions": ["c11amc"] - }, - "application/vnd.cluetrust.cartomobile-config-pkg": { - "source": "iana", - "extensions": ["c11amz"] - }, - "application/vnd.coffeescript": { - "source": "iana" - }, - "application/vnd.collabio.xodocuments.document": { - "source": "iana" - }, - "application/vnd.collabio.xodocuments.document-template": { - "source": "iana" - }, - "application/vnd.collabio.xodocuments.presentation": { - "source": "iana" - }, - "application/vnd.collabio.xodocuments.presentation-template": { - "source": "iana" - }, - "application/vnd.collabio.xodocuments.spreadsheet": { - "source": "iana" - }, - "application/vnd.collabio.xodocuments.spreadsheet-template": { - "source": "iana" - }, - "application/vnd.collection+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.collection.doc+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.collection.next+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.comicbook+zip": { - "source": "iana", - "compressible": false - }, - "application/vnd.comicbook-rar": { - "source": "iana" - }, - "application/vnd.commerce-battelle": { - "source": "iana" - }, - "application/vnd.commonspace": { - "source": "iana", - "extensions": ["csp"] - }, - "application/vnd.contact.cmsg": { - "source": "iana", - "extensions": ["cdbcmsg"] - }, - "application/vnd.coreos.ignition+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.cosmocaller": { - "source": "iana", - "extensions": ["cmc"] - }, - "application/vnd.crick.clicker": { - "source": "iana", - "extensions": ["clkx"] - }, - "application/vnd.crick.clicker.keyboard": { - "source": "iana", - "extensions": ["clkk"] - }, - "application/vnd.crick.clicker.palette": { - "source": "iana", - "extensions": ["clkp"] - }, - "application/vnd.crick.clicker.template": { - "source": "iana", - "extensions": ["clkt"] - }, - "application/vnd.crick.clicker.wordbank": { - "source": "iana", - "extensions": ["clkw"] - }, - "application/vnd.criticaltools.wbs+xml": { - "source": "iana", - "compressible": true, - "extensions": ["wbs"] - }, - "application/vnd.cryptii.pipe+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.crypto-shade-file": { - "source": "iana" - }, - "application/vnd.cryptomator.encrypted": { - "source": "iana" - }, - "application/vnd.cryptomator.vault": { - "source": "iana" - }, - "application/vnd.ctc-posml": { - "source": "iana", - "extensions": ["pml"] - }, - "application/vnd.ctct.ws+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.cups-pdf": { - "source": "iana" - }, - "application/vnd.cups-postscript": { - "source": "iana" - }, - "application/vnd.cups-ppd": { - "source": "iana", - "extensions": ["ppd"] - }, - "application/vnd.cups-raster": { - "source": "iana" - }, - "application/vnd.cups-raw": { - "source": "iana" - }, - "application/vnd.curl": { - "source": "iana" - }, - "application/vnd.curl.car": { - "source": "apache", - "extensions": ["car"] - }, - "application/vnd.curl.pcurl": { - "source": "apache", - "extensions": ["pcurl"] - }, - "application/vnd.cyan.dean.root+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.cybank": { - "source": "iana" - }, - "application/vnd.cyclonedx+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.cyclonedx+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.d2l.coursepackage1p0+zip": { - "source": "iana", - "compressible": false - }, - "application/vnd.d3m-dataset": { - "source": "iana" - }, - "application/vnd.d3m-problem": { - "source": "iana" - }, - "application/vnd.dart": { - "source": "iana", - "compressible": true, - "extensions": ["dart"] - }, - "application/vnd.data-vision.rdz": { - "source": "iana", - "extensions": ["rdz"] - }, - "application/vnd.datapackage+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.dataresource+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.dbf": { - "source": "iana", - "extensions": ["dbf"] - }, - "application/vnd.debian.binary-package": { - "source": "iana" - }, - "application/vnd.dece.data": { - "source": "iana", - "extensions": ["uvf","uvvf","uvd","uvvd"] - }, - "application/vnd.dece.ttml+xml": { - "source": "iana", - "compressible": true, - "extensions": ["uvt","uvvt"] - }, - "application/vnd.dece.unspecified": { - "source": "iana", - "extensions": ["uvx","uvvx"] - }, - "application/vnd.dece.zip": { - "source": "iana", - "extensions": ["uvz","uvvz"] - }, - "application/vnd.denovo.fcselayout-link": { - "source": "iana", - "extensions": ["fe_launch"] - }, - "application/vnd.desmume.movie": { - "source": "iana" - }, - "application/vnd.dir-bi.plate-dl-nosuffix": { - "source": "iana" - }, - "application/vnd.dm.delegation+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.dna": { - "source": "iana", - "extensions": ["dna"] - }, - "application/vnd.document+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.dolby.mlp": { - "source": "apache", - "extensions": ["mlp"] - }, - "application/vnd.dolby.mobile.1": { - "source": "iana" - }, - "application/vnd.dolby.mobile.2": { - "source": "iana" - }, - "application/vnd.doremir.scorecloud-binary-document": { - "source": "iana" - }, - "application/vnd.dpgraph": { - "source": "iana", - "extensions": ["dpg"] - }, - "application/vnd.dreamfactory": { - "source": "iana", - "extensions": ["dfac"] - }, - "application/vnd.drive+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.ds-keypoint": { - "source": "apache", - "extensions": ["kpxx"] - }, - "application/vnd.dtg.local": { - "source": "iana" - }, - "application/vnd.dtg.local.flash": { - "source": "iana" - }, - "application/vnd.dtg.local.html": { - "source": "iana" - }, - "application/vnd.dvb.ait": { - "source": "iana", - "extensions": ["ait"] - }, - "application/vnd.dvb.dvbisl+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.dvb.dvbj": { - "source": "iana" - }, - "application/vnd.dvb.esgcontainer": { - "source": "iana" - }, - "application/vnd.dvb.ipdcdftnotifaccess": { - "source": "iana" - }, - "application/vnd.dvb.ipdcesgaccess": { - "source": "iana" - }, - "application/vnd.dvb.ipdcesgaccess2": { - "source": "iana" - }, - "application/vnd.dvb.ipdcesgpdd": { - "source": "iana" - }, - "application/vnd.dvb.ipdcroaming": { - "source": "iana" - }, - "application/vnd.dvb.iptv.alfec-base": { - "source": "iana" - }, - "application/vnd.dvb.iptv.alfec-enhancement": { - "source": "iana" - }, - "application/vnd.dvb.notif-aggregate-root+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.dvb.notif-container+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.dvb.notif-generic+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.dvb.notif-ia-msglist+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.dvb.notif-ia-registration-request+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.dvb.notif-ia-registration-response+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.dvb.notif-init+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.dvb.pfr": { - "source": "iana" - }, - "application/vnd.dvb.service": { - "source": "iana", - "extensions": ["svc"] - }, - "application/vnd.dxr": { - "source": "iana" - }, - "application/vnd.dynageo": { - "source": "iana", - "extensions": ["geo"] - }, - "application/vnd.dzr": { - "source": "iana" - }, - "application/vnd.easykaraoke.cdgdownload": { - "source": "iana" - }, - "application/vnd.ecdis-update": { - "source": "iana" - }, - "application/vnd.ecip.rlp": { - "source": "iana" - }, - "application/vnd.eclipse.ditto+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.ecowin.chart": { - "source": "iana", - "extensions": ["mag"] - }, - "application/vnd.ecowin.filerequest": { - "source": "iana" - }, - "application/vnd.ecowin.fileupdate": { - "source": "iana" - }, - "application/vnd.ecowin.series": { - "source": "iana" - }, - "application/vnd.ecowin.seriesrequest": { - "source": "iana" - }, - "application/vnd.ecowin.seriesupdate": { - "source": "iana" - }, - "application/vnd.efi.img": { - "source": "iana" - }, - "application/vnd.efi.iso": { - "source": "iana" - }, - "application/vnd.emclient.accessrequest+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.enliven": { - "source": "iana", - "extensions": ["nml"] - }, - "application/vnd.enphase.envoy": { - "source": "iana" - }, - "application/vnd.eprints.data+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.epson.esf": { - "source": "iana", - "extensions": ["esf"] - }, - "application/vnd.epson.msf": { - "source": "iana", - "extensions": ["msf"] - }, - "application/vnd.epson.quickanime": { - "source": "iana", - "extensions": ["qam"] - }, - "application/vnd.epson.salt": { - "source": "iana", - "extensions": ["slt"] - }, - "application/vnd.epson.ssf": { - "source": "iana", - "extensions": ["ssf"] - }, - "application/vnd.ericsson.quickcall": { - "source": "iana" - }, - "application/vnd.espass-espass+zip": { - "source": "iana", - "compressible": false - }, - "application/vnd.eszigno3+xml": { - "source": "iana", - "compressible": true, - "extensions": ["es3","et3"] - }, - "application/vnd.etsi.aoc+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.etsi.asic-e+zip": { - "source": "iana", - "compressible": false - }, - "application/vnd.etsi.asic-s+zip": { - "source": "iana", - "compressible": false - }, - "application/vnd.etsi.cug+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.etsi.iptvcommand+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.etsi.iptvdiscovery+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.etsi.iptvprofile+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.etsi.iptvsad-bc+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.etsi.iptvsad-cod+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.etsi.iptvsad-npvr+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.etsi.iptvservice+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.etsi.iptvsync+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.etsi.iptvueprofile+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.etsi.mcid+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.etsi.mheg5": { - "source": "iana" - }, - "application/vnd.etsi.overload-control-policy-dataset+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.etsi.pstn+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.etsi.sci+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.etsi.simservs+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.etsi.timestamp-token": { - "source": "iana" - }, - "application/vnd.etsi.tsl+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.etsi.tsl.der": { - "source": "iana" - }, - "application/vnd.eu.kasparian.car+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.eudora.data": { - "source": "iana" - }, - "application/vnd.evolv.ecig.profile": { - "source": "iana" - }, - "application/vnd.evolv.ecig.settings": { - "source": "iana" - }, - "application/vnd.evolv.ecig.theme": { - "source": "iana" - }, - "application/vnd.exstream-empower+zip": { - "source": "iana", - "compressible": false - }, - "application/vnd.exstream-package": { - "source": "iana" - }, - "application/vnd.ezpix-album": { - "source": "iana", - "extensions": ["ez2"] - }, - "application/vnd.ezpix-package": { - "source": "iana", - "extensions": ["ez3"] - }, - "application/vnd.f-secure.mobile": { - "source": "iana" - }, - "application/vnd.familysearch.gedcom+zip": { - "source": "iana", - "compressible": false - }, - "application/vnd.fastcopy-disk-image": { - "source": "iana" - }, - "application/vnd.fdf": { - "source": "iana", - "extensions": ["fdf"] - }, - "application/vnd.fdsn.mseed": { - "source": "iana", - "extensions": ["mseed"] - }, - "application/vnd.fdsn.seed": { - "source": "iana", - "extensions": ["seed","dataless"] - }, - "application/vnd.ffsns": { - "source": "iana" - }, - "application/vnd.ficlab.flb+zip": { - "source": "iana", - "compressible": false - }, - "application/vnd.filmit.zfc": { - "source": "iana" - }, - "application/vnd.fints": { - "source": "iana" - }, - "application/vnd.firemonkeys.cloudcell": { - "source": "iana" - }, - "application/vnd.flographit": { - "source": "iana", - "extensions": ["gph"] - }, - "application/vnd.fluxtime.clip": { - "source": "iana", - "extensions": ["ftc"] - }, - "application/vnd.font-fontforge-sfd": { - "source": "iana" - }, - "application/vnd.framemaker": { - "source": "iana", - "extensions": ["fm","frame","maker","book"] - }, - "application/vnd.frogans.fnc": { - "source": "iana", - "extensions": ["fnc"] - }, - "application/vnd.frogans.ltf": { - "source": "iana", - "extensions": ["ltf"] - }, - "application/vnd.fsc.weblaunch": { - "source": "iana", - "extensions": ["fsc"] - }, - "application/vnd.fujifilm.fb.docuworks": { - "source": "iana" - }, - "application/vnd.fujifilm.fb.docuworks.binder": { - "source": "iana" - }, - "application/vnd.fujifilm.fb.docuworks.container": { - "source": "iana" - }, - "application/vnd.fujifilm.fb.jfi+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.fujitsu.oasys": { - "source": "iana", - "extensions": ["oas"] - }, - "application/vnd.fujitsu.oasys2": { - "source": "iana", - "extensions": ["oa2"] - }, - "application/vnd.fujitsu.oasys3": { - "source": "iana", - "extensions": ["oa3"] - }, - "application/vnd.fujitsu.oasysgp": { - "source": "iana", - "extensions": ["fg5"] - }, - "application/vnd.fujitsu.oasysprs": { - "source": "iana", - "extensions": ["bh2"] - }, - "application/vnd.fujixerox.art-ex": { - "source": "iana" - }, - "application/vnd.fujixerox.art4": { - "source": "iana" - }, - "application/vnd.fujixerox.ddd": { - "source": "iana", - "extensions": ["ddd"] - }, - "application/vnd.fujixerox.docuworks": { - "source": "iana", - "extensions": ["xdw"] - }, - "application/vnd.fujixerox.docuworks.binder": { - "source": "iana", - "extensions": ["xbd"] - }, - "application/vnd.fujixerox.docuworks.container": { - "source": "iana" - }, - "application/vnd.fujixerox.hbpl": { - "source": "iana" - }, - "application/vnd.fut-misnet": { - "source": "iana" - }, - "application/vnd.futoin+cbor": { - "source": "iana" - }, - "application/vnd.futoin+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.fuzzysheet": { - "source": "iana", - "extensions": ["fzs"] - }, - "application/vnd.genomatix.tuxedo": { - "source": "iana", - "extensions": ["txd"] - }, - "application/vnd.gentics.grd+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.geo+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.geocube+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.geogebra.file": { - "source": "iana", - "extensions": ["ggb"] - }, - "application/vnd.geogebra.slides": { - "source": "iana" - }, - "application/vnd.geogebra.tool": { - "source": "iana", - "extensions": ["ggt"] - }, - "application/vnd.geometry-explorer": { - "source": "iana", - "extensions": ["gex","gre"] - }, - "application/vnd.geonext": { - "source": "iana", - "extensions": ["gxt"] - }, - "application/vnd.geoplan": { - "source": "iana", - "extensions": ["g2w"] - }, - "application/vnd.geospace": { - "source": "iana", - "extensions": ["g3w"] - }, - "application/vnd.gerber": { - "source": "iana" - }, - "application/vnd.globalplatform.card-content-mgt": { - "source": "iana" - }, - "application/vnd.globalplatform.card-content-mgt-response": { - "source": "iana" - }, - "application/vnd.gmx": { - "source": "iana", - "extensions": ["gmx"] - }, - "application/vnd.google-apps.document": { - "compressible": false, - "extensions": ["gdoc"] - }, - "application/vnd.google-apps.presentation": { - "compressible": false, - "extensions": ["gslides"] - }, - "application/vnd.google-apps.spreadsheet": { - "compressible": false, - "extensions": ["gsheet"] - }, - "application/vnd.google-earth.kml+xml": { - "source": "iana", - "compressible": true, - "extensions": ["kml"] - }, - "application/vnd.google-earth.kmz": { - "source": "iana", - "compressible": false, - "extensions": ["kmz"] - }, - "application/vnd.gov.sk.e-form+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.gov.sk.e-form+zip": { - "source": "iana", - "compressible": false - }, - "application/vnd.gov.sk.xmldatacontainer+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.grafeq": { - "source": "iana", - "extensions": ["gqf","gqs"] - }, - "application/vnd.gridmp": { - "source": "iana" - }, - "application/vnd.groove-account": { - "source": "iana", - "extensions": ["gac"] - }, - "application/vnd.groove-help": { - "source": "iana", - "extensions": ["ghf"] - }, - "application/vnd.groove-identity-message": { - "source": "iana", - "extensions": ["gim"] - }, - "application/vnd.groove-injector": { - "source": "iana", - "extensions": ["grv"] - }, - "application/vnd.groove-tool-message": { - "source": "iana", - "extensions": ["gtm"] - }, - "application/vnd.groove-tool-template": { - "source": "iana", - "extensions": ["tpl"] - }, - "application/vnd.groove-vcard": { - "source": "iana", - "extensions": ["vcg"] - }, - "application/vnd.hal+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.hal+xml": { - "source": "iana", - "compressible": true, - "extensions": ["hal"] - }, - "application/vnd.handheld-entertainment+xml": { - "source": "iana", - "compressible": true, - "extensions": ["zmm"] - }, - "application/vnd.hbci": { - "source": "iana", - "extensions": ["hbci"] - }, - "application/vnd.hc+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.hcl-bireports": { - "source": "iana" - }, - "application/vnd.hdt": { - "source": "iana" - }, - "application/vnd.heroku+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.hhe.lesson-player": { - "source": "iana", - "extensions": ["les"] - }, - "application/vnd.hl7cda+xml": { - "source": "iana", - "charset": "UTF-8", - "compressible": true - }, - "application/vnd.hl7v2+xml": { - "source": "iana", - "charset": "UTF-8", - "compressible": true - }, - "application/vnd.hp-hpgl": { - "source": "iana", - "extensions": ["hpgl"] - }, - "application/vnd.hp-hpid": { - "source": "iana", - "extensions": ["hpid"] - }, - "application/vnd.hp-hps": { - "source": "iana", - "extensions": ["hps"] - }, - "application/vnd.hp-jlyt": { - "source": "iana", - "extensions": ["jlt"] - }, - "application/vnd.hp-pcl": { - "source": "iana", - "extensions": ["pcl"] - }, - "application/vnd.hp-pclxl": { - "source": "iana", - "extensions": ["pclxl"] - }, - "application/vnd.httphone": { - "source": "iana" - }, - "application/vnd.hydrostatix.sof-data": { - "source": "iana", - "extensions": ["sfd-hdstx"] - }, - "application/vnd.hyper+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.hyper-item+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.hyperdrive+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.hzn-3d-crossword": { - "source": "iana" - }, - "application/vnd.ibm.afplinedata": { - "source": "iana" - }, - "application/vnd.ibm.electronic-media": { - "source": "iana" - }, - "application/vnd.ibm.minipay": { - "source": "iana", - "extensions": ["mpy"] - }, - "application/vnd.ibm.modcap": { - "source": "iana", - "extensions": ["afp","listafp","list3820"] - }, - "application/vnd.ibm.rights-management": { - "source": "iana", - "extensions": ["irm"] - }, - "application/vnd.ibm.secure-container": { - "source": "iana", - "extensions": ["sc"] - }, - "application/vnd.iccprofile": { - "source": "iana", - "extensions": ["icc","icm"] - }, - "application/vnd.ieee.1905": { - "source": "iana" - }, - "application/vnd.igloader": { - "source": "iana", - "extensions": ["igl"] - }, - "application/vnd.imagemeter.folder+zip": { - "source": "iana", - "compressible": false - }, - "application/vnd.imagemeter.image+zip": { - "source": "iana", - "compressible": false - }, - "application/vnd.immervision-ivp": { - "source": "iana", - "extensions": ["ivp"] - }, - "application/vnd.immervision-ivu": { - "source": "iana", - "extensions": ["ivu"] - }, - "application/vnd.ims.imsccv1p1": { - "source": "iana" - }, - "application/vnd.ims.imsccv1p2": { - "source": "iana" - }, - "application/vnd.ims.imsccv1p3": { - "source": "iana" - }, - "application/vnd.ims.lis.v2.result+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.ims.lti.v2.toolconsumerprofile+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.ims.lti.v2.toolproxy+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.ims.lti.v2.toolproxy.id+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.ims.lti.v2.toolsettings+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.ims.lti.v2.toolsettings.simple+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.informedcontrol.rms+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.informix-visionary": { - "source": "iana" - }, - "application/vnd.infotech.project": { - "source": "iana" - }, - "application/vnd.infotech.project+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.innopath.wamp.notification": { - "source": "iana" - }, - "application/vnd.insors.igm": { - "source": "iana", - "extensions": ["igm"] - }, - "application/vnd.intercon.formnet": { - "source": "iana", - "extensions": ["xpw","xpx"] - }, - "application/vnd.intergeo": { - "source": "iana", - "extensions": ["i2g"] - }, - "application/vnd.intertrust.digibox": { - "source": "iana" - }, - "application/vnd.intertrust.nncp": { - "source": "iana" - }, - "application/vnd.intu.qbo": { - "source": "iana", - "extensions": ["qbo"] - }, - "application/vnd.intu.qfx": { - "source": "iana", - "extensions": ["qfx"] - }, - "application/vnd.iptc.g2.catalogitem+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.iptc.g2.conceptitem+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.iptc.g2.knowledgeitem+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.iptc.g2.newsitem+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.iptc.g2.newsmessage+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.iptc.g2.packageitem+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.iptc.g2.planningitem+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.ipunplugged.rcprofile": { - "source": "iana", - "extensions": ["rcprofile"] - }, - "application/vnd.irepository.package+xml": { - "source": "iana", - "compressible": true, - "extensions": ["irp"] - }, - "application/vnd.is-xpr": { - "source": "iana", - "extensions": ["xpr"] - }, - "application/vnd.isac.fcs": { - "source": "iana", - "extensions": ["fcs"] - }, - "application/vnd.iso11783-10+zip": { - "source": "iana", - "compressible": false - }, - "application/vnd.jam": { - "source": "iana", - "extensions": ["jam"] - }, - "application/vnd.japannet-directory-service": { - "source": "iana" - }, - "application/vnd.japannet-jpnstore-wakeup": { - "source": "iana" - }, - "application/vnd.japannet-payment-wakeup": { - "source": "iana" - }, - "application/vnd.japannet-registration": { - "source": "iana" - }, - "application/vnd.japannet-registration-wakeup": { - "source": "iana" - }, - "application/vnd.japannet-setstore-wakeup": { - "source": "iana" - }, - "application/vnd.japannet-verification": { - "source": "iana" - }, - "application/vnd.japannet-verification-wakeup": { - "source": "iana" - }, - "application/vnd.jcp.javame.midlet-rms": { - "source": "iana", - "extensions": ["rms"] - }, - "application/vnd.jisp": { - "source": "iana", - "extensions": ["jisp"] - }, - "application/vnd.joost.joda-archive": { - "source": "iana", - "extensions": ["joda"] - }, - "application/vnd.jsk.isdn-ngn": { - "source": "iana" - }, - "application/vnd.kahootz": { - "source": "iana", - "extensions": ["ktz","ktr"] - }, - "application/vnd.kde.karbon": { - "source": "iana", - "extensions": ["karbon"] - }, - "application/vnd.kde.kchart": { - "source": "iana", - "extensions": ["chrt"] - }, - "application/vnd.kde.kformula": { - "source": "iana", - "extensions": ["kfo"] - }, - "application/vnd.kde.kivio": { - "source": "iana", - "extensions": ["flw"] - }, - "application/vnd.kde.kontour": { - "source": "iana", - "extensions": ["kon"] - }, - "application/vnd.kde.kpresenter": { - "source": "iana", - "extensions": ["kpr","kpt"] - }, - "application/vnd.kde.kspread": { - "source": "iana", - "extensions": ["ksp"] - }, - "application/vnd.kde.kword": { - "source": "iana", - "extensions": ["kwd","kwt"] - }, - "application/vnd.kenameaapp": { - "source": "iana", - "extensions": ["htke"] - }, - "application/vnd.kidspiration": { - "source": "iana", - "extensions": ["kia"] - }, - "application/vnd.kinar": { - "source": "iana", - "extensions": ["kne","knp"] - }, - "application/vnd.koan": { - "source": "iana", - "extensions": ["skp","skd","skt","skm"] - }, - "application/vnd.kodak-descriptor": { - "source": "iana", - "extensions": ["sse"] - }, - "application/vnd.las": { - "source": "iana" - }, - "application/vnd.las.las+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.las.las+xml": { - "source": "iana", - "compressible": true, - "extensions": ["lasxml"] - }, - "application/vnd.laszip": { - "source": "iana" - }, - "application/vnd.leap+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.liberty-request+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.llamagraphics.life-balance.desktop": { - "source": "iana", - "extensions": ["lbd"] - }, - "application/vnd.llamagraphics.life-balance.exchange+xml": { - "source": "iana", - "compressible": true, - "extensions": ["lbe"] - }, - "application/vnd.logipipe.circuit+zip": { - "source": "iana", - "compressible": false - }, - "application/vnd.loom": { - "source": "iana" - }, - "application/vnd.lotus-1-2-3": { - "source": "iana", - "extensions": ["123"] - }, - "application/vnd.lotus-approach": { - "source": "iana", - "extensions": ["apr"] - }, - "application/vnd.lotus-freelance": { - "source": "iana", - "extensions": ["pre"] - }, - "application/vnd.lotus-notes": { - "source": "iana", - "extensions": ["nsf"] - }, - "application/vnd.lotus-organizer": { - "source": "iana", - "extensions": ["org"] - }, - "application/vnd.lotus-screencam": { - "source": "iana", - "extensions": ["scm"] - }, - "application/vnd.lotus-wordpro": { - "source": "iana", - "extensions": ["lwp"] - }, - "application/vnd.macports.portpkg": { - "source": "iana", - "extensions": ["portpkg"] - }, - "application/vnd.mapbox-vector-tile": { - "source": "iana", - "extensions": ["mvt"] - }, - "application/vnd.marlin.drm.actiontoken+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.marlin.drm.conftoken+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.marlin.drm.license+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.marlin.drm.mdcf": { - "source": "iana" - }, - "application/vnd.mason+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.maxar.archive.3tz+zip": { - "source": "iana", - "compressible": false - }, - "application/vnd.maxmind.maxmind-db": { - "source": "iana" - }, - "application/vnd.mcd": { - "source": "iana", - "extensions": ["mcd"] - }, - "application/vnd.medcalcdata": { - "source": "iana", - "extensions": ["mc1"] - }, - "application/vnd.mediastation.cdkey": { - "source": "iana", - "extensions": ["cdkey"] - }, - "application/vnd.meridian-slingshot": { - "source": "iana" - }, - "application/vnd.mfer": { - "source": "iana", - "extensions": ["mwf"] - }, - "application/vnd.mfmp": { - "source": "iana", - "extensions": ["mfm"] - }, - "application/vnd.micro+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.micrografx.flo": { - "source": "iana", - "extensions": ["flo"] - }, - "application/vnd.micrografx.igx": { - "source": "iana", - "extensions": ["igx"] - }, - "application/vnd.microsoft.portable-executable": { - "source": "iana" - }, - "application/vnd.microsoft.windows.thumbnail-cache": { - "source": "iana" - }, - "application/vnd.miele+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.mif": { - "source": "iana", - "extensions": ["mif"] - }, - "application/vnd.minisoft-hp3000-save": { - "source": "iana" - }, - "application/vnd.mitsubishi.misty-guard.trustweb": { - "source": "iana" - }, - "application/vnd.mobius.daf": { - "source": "iana", - "extensions": ["daf"] - }, - "application/vnd.mobius.dis": { - "source": "iana", - "extensions": ["dis"] - }, - "application/vnd.mobius.mbk": { - "source": "iana", - "extensions": ["mbk"] - }, - "application/vnd.mobius.mqy": { - "source": "iana", - "extensions": ["mqy"] - }, - "application/vnd.mobius.msl": { - "source": "iana", - "extensions": ["msl"] - }, - "application/vnd.mobius.plc": { - "source": "iana", - "extensions": ["plc"] - }, - "application/vnd.mobius.txf": { - "source": "iana", - "extensions": ["txf"] - }, - "application/vnd.mophun.application": { - "source": "iana", - "extensions": ["mpn"] - }, - "application/vnd.mophun.certificate": { - "source": "iana", - "extensions": ["mpc"] - }, - "application/vnd.motorola.flexsuite": { - "source": "iana" - }, - "application/vnd.motorola.flexsuite.adsi": { - "source": "iana" - }, - "application/vnd.motorola.flexsuite.fis": { - "source": "iana" - }, - "application/vnd.motorola.flexsuite.gotap": { - "source": "iana" - }, - "application/vnd.motorola.flexsuite.kmr": { - "source": "iana" - }, - "application/vnd.motorola.flexsuite.ttc": { - "source": "iana" - }, - "application/vnd.motorola.flexsuite.wem": { - "source": "iana" - }, - "application/vnd.motorola.iprm": { - "source": "iana" - }, - "application/vnd.mozilla.xul+xml": { - "source": "iana", - "compressible": true, - "extensions": ["xul"] - }, - "application/vnd.ms-3mfdocument": { - "source": "iana" - }, - "application/vnd.ms-artgalry": { - "source": "iana", - "extensions": ["cil"] - }, - "application/vnd.ms-asf": { - "source": "iana" - }, - "application/vnd.ms-cab-compressed": { - "source": "iana", - "extensions": ["cab"] - }, - "application/vnd.ms-color.iccprofile": { - "source": "apache" - }, - "application/vnd.ms-excel": { - "source": "iana", - "compressible": false, - "extensions": ["xls","xlm","xla","xlc","xlt","xlw"] - }, - "application/vnd.ms-excel.addin.macroenabled.12": { - "source": "iana", - "extensions": ["xlam"] - }, - "application/vnd.ms-excel.sheet.binary.macroenabled.12": { - "source": "iana", - "extensions": ["xlsb"] - }, - "application/vnd.ms-excel.sheet.macroenabled.12": { - "source": "iana", - "extensions": ["xlsm"] - }, - "application/vnd.ms-excel.template.macroenabled.12": { - "source": "iana", - "extensions": ["xltm"] - }, - "application/vnd.ms-fontobject": { - "source": "iana", - "compressible": true, - "extensions": ["eot"] - }, - "application/vnd.ms-htmlhelp": { - "source": "iana", - "extensions": ["chm"] - }, - "application/vnd.ms-ims": { - "source": "iana", - "extensions": ["ims"] - }, - "application/vnd.ms-lrm": { - "source": "iana", - "extensions": ["lrm"] - }, - "application/vnd.ms-office.activex+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.ms-officetheme": { - "source": "iana", - "extensions": ["thmx"] - }, - "application/vnd.ms-opentype": { - "source": "apache", - "compressible": true - }, - "application/vnd.ms-outlook": { - "compressible": false, - "extensions": ["msg"] - }, - "application/vnd.ms-package.obfuscated-opentype": { - "source": "apache" - }, - "application/vnd.ms-pki.seccat": { - "source": "apache", - "extensions": ["cat"] - }, - "application/vnd.ms-pki.stl": { - "source": "apache", - "extensions": ["stl"] - }, - "application/vnd.ms-playready.initiator+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.ms-powerpoint": { - "source": "iana", - "compressible": false, - "extensions": ["ppt","pps","pot"] - }, - "application/vnd.ms-powerpoint.addin.macroenabled.12": { - "source": "iana", - "extensions": ["ppam"] - }, - "application/vnd.ms-powerpoint.presentation.macroenabled.12": { - "source": "iana", - "extensions": ["pptm"] - }, - "application/vnd.ms-powerpoint.slide.macroenabled.12": { - "source": "iana", - "extensions": ["sldm"] - }, - "application/vnd.ms-powerpoint.slideshow.macroenabled.12": { - "source": "iana", - "extensions": ["ppsm"] - }, - "application/vnd.ms-powerpoint.template.macroenabled.12": { - "source": "iana", - "extensions": ["potm"] - }, - "application/vnd.ms-printdevicecapabilities+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.ms-printing.printticket+xml": { - "source": "apache", - "compressible": true - }, - "application/vnd.ms-printschematicket+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.ms-project": { - "source": "iana", - "extensions": ["mpp","mpt"] - }, - "application/vnd.ms-tnef": { - "source": "iana" - }, - "application/vnd.ms-windows.devicepairing": { - "source": "iana" - }, - "application/vnd.ms-windows.nwprinting.oob": { - "source": "iana" - }, - "application/vnd.ms-windows.printerpairing": { - "source": "iana" - }, - "application/vnd.ms-windows.wsd.oob": { - "source": "iana" - }, - "application/vnd.ms-wmdrm.lic-chlg-req": { - "source": "iana" - }, - "application/vnd.ms-wmdrm.lic-resp": { - "source": "iana" - }, - "application/vnd.ms-wmdrm.meter-chlg-req": { - "source": "iana" - }, - "application/vnd.ms-wmdrm.meter-resp": { - "source": "iana" - }, - "application/vnd.ms-word.document.macroenabled.12": { - "source": "iana", - "extensions": ["docm"] - }, - "application/vnd.ms-word.template.macroenabled.12": { - "source": "iana", - "extensions": ["dotm"] - }, - "application/vnd.ms-works": { - "source": "iana", - "extensions": ["wps","wks","wcm","wdb"] - }, - "application/vnd.ms-wpl": { - "source": "iana", - "extensions": ["wpl"] - }, - "application/vnd.ms-xpsdocument": { - "source": "iana", - "compressible": false, - "extensions": ["xps"] - }, - "application/vnd.msa-disk-image": { - "source": "iana" - }, - "application/vnd.mseq": { - "source": "iana", - "extensions": ["mseq"] - }, - "application/vnd.msign": { - "source": "iana" - }, - "application/vnd.multiad.creator": { - "source": "iana" - }, - "application/vnd.multiad.creator.cif": { - "source": "iana" - }, - "application/vnd.music-niff": { - "source": "iana" - }, - "application/vnd.musician": { - "source": "iana", - "extensions": ["mus"] - }, - "application/vnd.muvee.style": { - "source": "iana", - "extensions": ["msty"] - }, - "application/vnd.mynfc": { - "source": "iana", - "extensions": ["taglet"] - }, - "application/vnd.nacamar.ybrid+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.ncd.control": { - "source": "iana" - }, - "application/vnd.ncd.reference": { - "source": "iana" - }, - "application/vnd.nearst.inv+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.nebumind.line": { - "source": "iana" - }, - "application/vnd.nervana": { - "source": "iana" - }, - "application/vnd.netfpx": { - "source": "iana" - }, - "application/vnd.neurolanguage.nlu": { - "source": "iana", - "extensions": ["nlu"] - }, - "application/vnd.nimn": { - "source": "iana" - }, - "application/vnd.nintendo.nitro.rom": { - "source": "iana" - }, - "application/vnd.nintendo.snes.rom": { - "source": "iana" - }, - "application/vnd.nitf": { - "source": "iana", - "extensions": ["ntf","nitf"] - }, - "application/vnd.noblenet-directory": { - "source": "iana", - "extensions": ["nnd"] - }, - "application/vnd.noblenet-sealer": { - "source": "iana", - "extensions": ["nns"] - }, - "application/vnd.noblenet-web": { - "source": "iana", - "extensions": ["nnw"] - }, - "application/vnd.nokia.catalogs": { - "source": "iana" - }, - "application/vnd.nokia.conml+wbxml": { - "source": "iana" - }, - "application/vnd.nokia.conml+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.nokia.iptv.config+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.nokia.isds-radio-presets": { - "source": "iana" - }, - "application/vnd.nokia.landmark+wbxml": { - "source": "iana" - }, - "application/vnd.nokia.landmark+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.nokia.landmarkcollection+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.nokia.n-gage.ac+xml": { - "source": "iana", - "compressible": true, - "extensions": ["ac"] - }, - "application/vnd.nokia.n-gage.data": { - "source": "iana", - "extensions": ["ngdat"] - }, - "application/vnd.nokia.n-gage.symbian.install": { - "source": "iana", - "extensions": ["n-gage"] - }, - "application/vnd.nokia.ncd": { - "source": "iana" - }, - "application/vnd.nokia.pcd+wbxml": { - "source": "iana" - }, - "application/vnd.nokia.pcd+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.nokia.radio-preset": { - "source": "iana", - "extensions": ["rpst"] - }, - "application/vnd.nokia.radio-presets": { - "source": "iana", - "extensions": ["rpss"] - }, - "application/vnd.novadigm.edm": { - "source": "iana", - "extensions": ["edm"] - }, - "application/vnd.novadigm.edx": { - "source": "iana", - "extensions": ["edx"] - }, - "application/vnd.novadigm.ext": { - "source": "iana", - "extensions": ["ext"] - }, - "application/vnd.ntt-local.content-share": { - "source": "iana" - }, - "application/vnd.ntt-local.file-transfer": { - "source": "iana" - }, - "application/vnd.ntt-local.ogw_remote-access": { - "source": "iana" - }, - "application/vnd.ntt-local.sip-ta_remote": { - "source": "iana" - }, - "application/vnd.ntt-local.sip-ta_tcp_stream": { - "source": "iana" - }, - "application/vnd.oasis.opendocument.chart": { - "source": "iana", - "extensions": ["odc"] - }, - "application/vnd.oasis.opendocument.chart-template": { - "source": "iana", - "extensions": ["otc"] - }, - "application/vnd.oasis.opendocument.database": { - "source": "iana", - "extensions": ["odb"] - }, - "application/vnd.oasis.opendocument.formula": { - "source": "iana", - "extensions": ["odf"] - }, - "application/vnd.oasis.opendocument.formula-template": { - "source": "iana", - "extensions": ["odft"] - }, - "application/vnd.oasis.opendocument.graphics": { - "source": "iana", - "compressible": false, - "extensions": ["odg"] - }, - "application/vnd.oasis.opendocument.graphics-template": { - "source": "iana", - "extensions": ["otg"] - }, - "application/vnd.oasis.opendocument.image": { - "source": "iana", - "extensions": ["odi"] - }, - "application/vnd.oasis.opendocument.image-template": { - "source": "iana", - "extensions": ["oti"] - }, - "application/vnd.oasis.opendocument.presentation": { - "source": "iana", - "compressible": false, - "extensions": ["odp"] - }, - "application/vnd.oasis.opendocument.presentation-template": { - "source": "iana", - "extensions": ["otp"] - }, - "application/vnd.oasis.opendocument.spreadsheet": { - "source": "iana", - "compressible": false, - "extensions": ["ods"] - }, - "application/vnd.oasis.opendocument.spreadsheet-template": { - "source": "iana", - "extensions": ["ots"] - }, - "application/vnd.oasis.opendocument.text": { - "source": "iana", - "compressible": false, - "extensions": ["odt"] - }, - "application/vnd.oasis.opendocument.text-master": { - "source": "iana", - "extensions": ["odm"] - }, - "application/vnd.oasis.opendocument.text-template": { - "source": "iana", - "extensions": ["ott"] - }, - "application/vnd.oasis.opendocument.text-web": { - "source": "iana", - "extensions": ["oth"] - }, - "application/vnd.obn": { - "source": "iana" - }, - "application/vnd.ocf+cbor": { - "source": "iana" - }, - "application/vnd.oci.image.manifest.v1+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.oftn.l10n+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.oipf.contentaccessdownload+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oipf.contentaccessstreaming+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oipf.cspg-hexbinary": { - "source": "iana" - }, - "application/vnd.oipf.dae.svg+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oipf.dae.xhtml+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oipf.mippvcontrolmessage+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oipf.pae.gem": { - "source": "iana" - }, - "application/vnd.oipf.spdiscovery+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oipf.spdlist+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oipf.ueprofile+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oipf.userprofile+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.olpc-sugar": { - "source": "iana", - "extensions": ["xo"] - }, - "application/vnd.oma-scws-config": { - "source": "iana" - }, - "application/vnd.oma-scws-http-request": { - "source": "iana" - }, - "application/vnd.oma-scws-http-response": { - "source": "iana" - }, - "application/vnd.oma.bcast.associated-procedure-parameter+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oma.bcast.drm-trigger+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oma.bcast.imd+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oma.bcast.ltkm": { - "source": "iana" - }, - "application/vnd.oma.bcast.notification+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oma.bcast.provisioningtrigger": { - "source": "iana" - }, - "application/vnd.oma.bcast.sgboot": { - "source": "iana" - }, - "application/vnd.oma.bcast.sgdd+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oma.bcast.sgdu": { - "source": "iana" - }, - "application/vnd.oma.bcast.simple-symbol-container": { - "source": "iana" - }, - "application/vnd.oma.bcast.smartcard-trigger+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oma.bcast.sprov+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oma.bcast.stkm": { - "source": "iana" - }, - "application/vnd.oma.cab-address-book+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oma.cab-feature-handler+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oma.cab-pcc+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oma.cab-subs-invite+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oma.cab-user-prefs+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oma.dcd": { - "source": "iana" - }, - "application/vnd.oma.dcdc": { - "source": "iana" - }, - "application/vnd.oma.dd2+xml": { - "source": "iana", - "compressible": true, - "extensions": ["dd2"] - }, - "application/vnd.oma.drm.risd+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oma.group-usage-list+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oma.lwm2m+cbor": { - "source": "iana" - }, - "application/vnd.oma.lwm2m+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.oma.lwm2m+tlv": { - "source": "iana" - }, - "application/vnd.oma.pal+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oma.poc.detailed-progress-report+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oma.poc.final-report+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oma.poc.groups+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oma.poc.invocation-descriptor+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oma.poc.optimized-progress-report+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oma.push": { - "source": "iana" - }, - "application/vnd.oma.scidm.messages+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oma.xcap-directory+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.omads-email+xml": { - "source": "iana", - "charset": "UTF-8", - "compressible": true - }, - "application/vnd.omads-file+xml": { - "source": "iana", - "charset": "UTF-8", - "compressible": true - }, - "application/vnd.omads-folder+xml": { - "source": "iana", - "charset": "UTF-8", - "compressible": true - }, - "application/vnd.omaloc-supl-init": { - "source": "iana" - }, - "application/vnd.onepager": { - "source": "iana" - }, - "application/vnd.onepagertamp": { - "source": "iana" - }, - "application/vnd.onepagertamx": { - "source": "iana" - }, - "application/vnd.onepagertat": { - "source": "iana" - }, - "application/vnd.onepagertatp": { - "source": "iana" - }, - "application/vnd.onepagertatx": { - "source": "iana" - }, - "application/vnd.openblox.game+xml": { - "source": "iana", - "compressible": true, - "extensions": ["obgx"] - }, - "application/vnd.openblox.game-binary": { - "source": "iana" - }, - "application/vnd.openeye.oeb": { - "source": "iana" - }, - "application/vnd.openofficeorg.extension": { - "source": "apache", - "extensions": ["oxt"] - }, - "application/vnd.openstreetmap.data+xml": { - "source": "iana", - "compressible": true, - "extensions": ["osm"] - }, - "application/vnd.opentimestamps.ots": { - "source": "iana" - }, - "application/vnd.openxmlformats-officedocument.custom-properties+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.customxmlproperties+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.drawing+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.drawingml.chart+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.extended-properties+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.presentationml.comments+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.presentationml.presentation": { - "source": "iana", - "compressible": false, - "extensions": ["pptx"] - }, - "application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.presentationml.presprops+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.presentationml.slide": { - "source": "iana", - "extensions": ["sldx"] - }, - "application/vnd.openxmlformats-officedocument.presentationml.slide+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.presentationml.slideshow": { - "source": "iana", - "extensions": ["ppsx"] - }, - "application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.presentationml.tags+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.presentationml.template": { - "source": "iana", - "extensions": ["potx"] - }, - "application/vnd.openxmlformats-officedocument.presentationml.template.main+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": { - "source": "iana", - "compressible": false, - "extensions": ["xlsx"] - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.template": { - "source": "iana", - "extensions": ["xltx"] - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.theme+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.themeoverride+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.vmldrawing": { - "source": "iana" - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.document": { - "source": "iana", - "compressible": false, - "extensions": ["docx"] - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.template": { - "source": "iana", - "extensions": ["dotx"] - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-package.core-properties+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-package.relationships+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oracle.resource+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.orange.indata": { - "source": "iana" - }, - "application/vnd.osa.netdeploy": { - "source": "iana" - }, - "application/vnd.osgeo.mapguide.package": { - "source": "iana", - "extensions": ["mgp"] - }, - "application/vnd.osgi.bundle": { - "source": "iana" - }, - "application/vnd.osgi.dp": { - "source": "iana", - "extensions": ["dp"] - }, - "application/vnd.osgi.subsystem": { - "source": "iana", - "extensions": ["esa"] - }, - "application/vnd.otps.ct-kip+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oxli.countgraph": { - "source": "iana" - }, - "application/vnd.pagerduty+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.palm": { - "source": "iana", - "extensions": ["pdb","pqa","oprc"] - }, - "application/vnd.panoply": { - "source": "iana" - }, - "application/vnd.paos.xml": { - "source": "iana" - }, - "application/vnd.patentdive": { - "source": "iana" - }, - "application/vnd.patientecommsdoc": { - "source": "iana" - }, - "application/vnd.pawaafile": { - "source": "iana", - "extensions": ["paw"] - }, - "application/vnd.pcos": { - "source": "iana" - }, - "application/vnd.pg.format": { - "source": "iana", - "extensions": ["str"] - }, - "application/vnd.pg.osasli": { - "source": "iana", - "extensions": ["ei6"] - }, - "application/vnd.piaccess.application-licence": { - "source": "iana" - }, - "application/vnd.picsel": { - "source": "iana", - "extensions": ["efif"] - }, - "application/vnd.pmi.widget": { - "source": "iana", - "extensions": ["wg"] - }, - "application/vnd.poc.group-advertisement+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.pocketlearn": { - "source": "iana", - "extensions": ["plf"] - }, - "application/vnd.powerbuilder6": { - "source": "iana", - "extensions": ["pbd"] - }, - "application/vnd.powerbuilder6-s": { - "source": "iana" - }, - "application/vnd.powerbuilder7": { - "source": "iana" - }, - "application/vnd.powerbuilder7-s": { - "source": "iana" - }, - "application/vnd.powerbuilder75": { - "source": "iana" - }, - "application/vnd.powerbuilder75-s": { - "source": "iana" - }, - "application/vnd.preminet": { - "source": "iana" - }, - "application/vnd.previewsystems.box": { - "source": "iana", - "extensions": ["box"] - }, - "application/vnd.proteus.magazine": { - "source": "iana", - "extensions": ["mgz"] - }, - "application/vnd.psfs": { - "source": "iana" - }, - "application/vnd.publishare-delta-tree": { - "source": "iana", - "extensions": ["qps"] - }, - "application/vnd.pvi.ptid1": { - "source": "iana", - "extensions": ["ptid"] - }, - "application/vnd.pwg-multiplexed": { - "source": "iana" - }, - "application/vnd.pwg-xhtml-print+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.qualcomm.brew-app-res": { - "source": "iana" - }, - "application/vnd.quarantainenet": { - "source": "iana" - }, - "application/vnd.quark.quarkxpress": { - "source": "iana", - "extensions": ["qxd","qxt","qwd","qwt","qxl","qxb"] - }, - "application/vnd.quobject-quoxdocument": { - "source": "iana" - }, - "application/vnd.radisys.moml+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.radisys.msml+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.radisys.msml-audit+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.radisys.msml-audit-conf+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.radisys.msml-audit-conn+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.radisys.msml-audit-dialog+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.radisys.msml-audit-stream+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.radisys.msml-conf+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.radisys.msml-dialog+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.radisys.msml-dialog-base+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.radisys.msml-dialog-fax-detect+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.radisys.msml-dialog-fax-sendrecv+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.radisys.msml-dialog-group+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.radisys.msml-dialog-speech+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.radisys.msml-dialog-transform+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.rainstor.data": { - "source": "iana" - }, - "application/vnd.rapid": { - "source": "iana" - }, - "application/vnd.rar": { - "source": "iana", - "extensions": ["rar"] - }, - "application/vnd.realvnc.bed": { - "source": "iana", - "extensions": ["bed"] - }, - "application/vnd.recordare.musicxml": { - "source": "iana", - "extensions": ["mxl"] - }, - "application/vnd.recordare.musicxml+xml": { - "source": "iana", - "compressible": true, - "extensions": ["musicxml"] - }, - "application/vnd.renlearn.rlprint": { - "source": "iana" - }, - "application/vnd.resilient.logic": { - "source": "iana" - }, - "application/vnd.restful+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.rig.cryptonote": { - "source": "iana", - "extensions": ["cryptonote"] - }, - "application/vnd.rim.cod": { - "source": "apache", - "extensions": ["cod"] - }, - "application/vnd.rn-realmedia": { - "source": "apache", - "extensions": ["rm"] - }, - "application/vnd.rn-realmedia-vbr": { - "source": "apache", - "extensions": ["rmvb"] - }, - "application/vnd.route66.link66+xml": { - "source": "iana", - "compressible": true, - "extensions": ["link66"] - }, - "application/vnd.rs-274x": { - "source": "iana" - }, - "application/vnd.ruckus.download": { - "source": "iana" - }, - "application/vnd.s3sms": { - "source": "iana" - }, - "application/vnd.sailingtracker.track": { - "source": "iana", - "extensions": ["st"] - }, - "application/vnd.sar": { - "source": "iana" - }, - "application/vnd.sbm.cid": { - "source": "iana" - }, - "application/vnd.sbm.mid2": { - "source": "iana" - }, - "application/vnd.scribus": { - "source": "iana" - }, - "application/vnd.sealed.3df": { - "source": "iana" - }, - "application/vnd.sealed.csf": { - "source": "iana" - }, - "application/vnd.sealed.doc": { - "source": "iana" - }, - "application/vnd.sealed.eml": { - "source": "iana" - }, - "application/vnd.sealed.mht": { - "source": "iana" - }, - "application/vnd.sealed.net": { - "source": "iana" - }, - "application/vnd.sealed.ppt": { - "source": "iana" - }, - "application/vnd.sealed.tiff": { - "source": "iana" - }, - "application/vnd.sealed.xls": { - "source": "iana" - }, - "application/vnd.sealedmedia.softseal.html": { - "source": "iana" - }, - "application/vnd.sealedmedia.softseal.pdf": { - "source": "iana" - }, - "application/vnd.seemail": { - "source": "iana", - "extensions": ["see"] - }, - "application/vnd.seis+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.sema": { - "source": "iana", - "extensions": ["sema"] - }, - "application/vnd.semd": { - "source": "iana", - "extensions": ["semd"] - }, - "application/vnd.semf": { - "source": "iana", - "extensions": ["semf"] - }, - "application/vnd.shade-save-file": { - "source": "iana" - }, - "application/vnd.shana.informed.formdata": { - "source": "iana", - "extensions": ["ifm"] - }, - "application/vnd.shana.informed.formtemplate": { - "source": "iana", - "extensions": ["itp"] - }, - "application/vnd.shana.informed.interchange": { - "source": "iana", - "extensions": ["iif"] - }, - "application/vnd.shana.informed.package": { - "source": "iana", - "extensions": ["ipk"] - }, - "application/vnd.shootproof+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.shopkick+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.shp": { - "source": "iana" - }, - "application/vnd.shx": { - "source": "iana" - }, - "application/vnd.sigrok.session": { - "source": "iana" - }, - "application/vnd.simtech-mindmapper": { - "source": "iana", - "extensions": ["twd","twds"] - }, - "application/vnd.siren+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.smaf": { - "source": "iana", - "extensions": ["mmf"] - }, - "application/vnd.smart.notebook": { - "source": "iana" - }, - "application/vnd.smart.teacher": { - "source": "iana", - "extensions": ["teacher"] - }, - "application/vnd.snesdev-page-table": { - "source": "iana" - }, - "application/vnd.software602.filler.form+xml": { - "source": "iana", - "compressible": true, - "extensions": ["fo"] - }, - "application/vnd.software602.filler.form-xml-zip": { - "source": "iana" - }, - "application/vnd.solent.sdkm+xml": { - "source": "iana", - "compressible": true, - "extensions": ["sdkm","sdkd"] - }, - "application/vnd.spotfire.dxp": { - "source": "iana", - "extensions": ["dxp"] - }, - "application/vnd.spotfire.sfs": { - "source": "iana", - "extensions": ["sfs"] - }, - "application/vnd.sqlite3": { - "source": "iana" - }, - "application/vnd.sss-cod": { - "source": "iana" - }, - "application/vnd.sss-dtf": { - "source": "iana" - }, - "application/vnd.sss-ntf": { - "source": "iana" - }, - "application/vnd.stardivision.calc": { - "source": "apache", - "extensions": ["sdc"] - }, - "application/vnd.stardivision.draw": { - "source": "apache", - "extensions": ["sda"] - }, - "application/vnd.stardivision.impress": { - "source": "apache", - "extensions": ["sdd"] - }, - "application/vnd.stardivision.math": { - "source": "apache", - "extensions": ["smf"] - }, - "application/vnd.stardivision.writer": { - "source": "apache", - "extensions": ["sdw","vor"] - }, - "application/vnd.stardivision.writer-global": { - "source": "apache", - "extensions": ["sgl"] - }, - "application/vnd.stepmania.package": { - "source": "iana", - "extensions": ["smzip"] - }, - "application/vnd.stepmania.stepchart": { - "source": "iana", - "extensions": ["sm"] - }, - "application/vnd.street-stream": { - "source": "iana" - }, - "application/vnd.sun.wadl+xml": { - "source": "iana", - "compressible": true, - "extensions": ["wadl"] - }, - "application/vnd.sun.xml.calc": { - "source": "apache", - "extensions": ["sxc"] - }, - "application/vnd.sun.xml.calc.template": { - "source": "apache", - "extensions": ["stc"] - }, - "application/vnd.sun.xml.draw": { - "source": "apache", - "extensions": ["sxd"] - }, - "application/vnd.sun.xml.draw.template": { - "source": "apache", - "extensions": ["std"] - }, - "application/vnd.sun.xml.impress": { - "source": "apache", - "extensions": ["sxi"] - }, - "application/vnd.sun.xml.impress.template": { - "source": "apache", - "extensions": ["sti"] - }, - "application/vnd.sun.xml.math": { - "source": "apache", - "extensions": ["sxm"] - }, - "application/vnd.sun.xml.writer": { - "source": "apache", - "extensions": ["sxw"] - }, - "application/vnd.sun.xml.writer.global": { - "source": "apache", - "extensions": ["sxg"] - }, - "application/vnd.sun.xml.writer.template": { - "source": "apache", - "extensions": ["stw"] - }, - "application/vnd.sus-calendar": { - "source": "iana", - "extensions": ["sus","susp"] - }, - "application/vnd.svd": { - "source": "iana", - "extensions": ["svd"] - }, - "application/vnd.swiftview-ics": { - "source": "iana" - }, - "application/vnd.sycle+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.syft+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.symbian.install": { - "source": "apache", - "extensions": ["sis","sisx"] - }, - "application/vnd.syncml+xml": { - "source": "iana", - "charset": "UTF-8", - "compressible": true, - "extensions": ["xsm"] - }, - "application/vnd.syncml.dm+wbxml": { - "source": "iana", - "charset": "UTF-8", - "extensions": ["bdm"] - }, - "application/vnd.syncml.dm+xml": { - "source": "iana", - "charset": "UTF-8", - "compressible": true, - "extensions": ["xdm"] - }, - "application/vnd.syncml.dm.notification": { - "source": "iana" - }, - "application/vnd.syncml.dmddf+wbxml": { - "source": "iana" - }, - "application/vnd.syncml.dmddf+xml": { - "source": "iana", - "charset": "UTF-8", - "compressible": true, - "extensions": ["ddf"] - }, - "application/vnd.syncml.dmtnds+wbxml": { - "source": "iana" - }, - "application/vnd.syncml.dmtnds+xml": { - "source": "iana", - "charset": "UTF-8", - "compressible": true - }, - "application/vnd.syncml.ds.notification": { - "source": "iana" - }, - "application/vnd.tableschema+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.tao.intent-module-archive": { - "source": "iana", - "extensions": ["tao"] - }, - "application/vnd.tcpdump.pcap": { - "source": "iana", - "extensions": ["pcap","cap","dmp"] - }, - "application/vnd.think-cell.ppttc+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.tmd.mediaflex.api+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.tml": { - "source": "iana" - }, - "application/vnd.tmobile-livetv": { - "source": "iana", - "extensions": ["tmo"] - }, - "application/vnd.tri.onesource": { - "source": "iana" - }, - "application/vnd.trid.tpt": { - "source": "iana", - "extensions": ["tpt"] - }, - "application/vnd.triscape.mxs": { - "source": "iana", - "extensions": ["mxs"] - }, - "application/vnd.trueapp": { - "source": "iana", - "extensions": ["tra"] - }, - "application/vnd.truedoc": { - "source": "iana" - }, - "application/vnd.ubisoft.webplayer": { - "source": "iana" - }, - "application/vnd.ufdl": { - "source": "iana", - "extensions": ["ufd","ufdl"] - }, - "application/vnd.uiq.theme": { - "source": "iana", - "extensions": ["utz"] - }, - "application/vnd.umajin": { - "source": "iana", - "extensions": ["umj"] - }, - "application/vnd.unity": { - "source": "iana", - "extensions": ["unityweb"] - }, - "application/vnd.uoml+xml": { - "source": "iana", - "compressible": true, - "extensions": ["uoml"] - }, - "application/vnd.uplanet.alert": { - "source": "iana" - }, - "application/vnd.uplanet.alert-wbxml": { - "source": "iana" - }, - "application/vnd.uplanet.bearer-choice": { - "source": "iana" - }, - "application/vnd.uplanet.bearer-choice-wbxml": { - "source": "iana" - }, - "application/vnd.uplanet.cacheop": { - "source": "iana" - }, - "application/vnd.uplanet.cacheop-wbxml": { - "source": "iana" - }, - "application/vnd.uplanet.channel": { - "source": "iana" - }, - "application/vnd.uplanet.channel-wbxml": { - "source": "iana" - }, - "application/vnd.uplanet.list": { - "source": "iana" - }, - "application/vnd.uplanet.list-wbxml": { - "source": "iana" - }, - "application/vnd.uplanet.listcmd": { - "source": "iana" - }, - "application/vnd.uplanet.listcmd-wbxml": { - "source": "iana" - }, - "application/vnd.uplanet.signal": { - "source": "iana" - }, - "application/vnd.uri-map": { - "source": "iana" - }, - "application/vnd.valve.source.material": { - "source": "iana" - }, - "application/vnd.vcx": { - "source": "iana", - "extensions": ["vcx"] - }, - "application/vnd.vd-study": { - "source": "iana" - }, - "application/vnd.vectorworks": { - "source": "iana" - }, - "application/vnd.vel+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.verimatrix.vcas": { - "source": "iana" - }, - "application/vnd.veritone.aion+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.veryant.thin": { - "source": "iana" - }, - "application/vnd.ves.encrypted": { - "source": "iana" - }, - "application/vnd.vidsoft.vidconference": { - "source": "iana" - }, - "application/vnd.visio": { - "source": "iana", - "extensions": ["vsd","vst","vss","vsw"] - }, - "application/vnd.visionary": { - "source": "iana", - "extensions": ["vis"] - }, - "application/vnd.vividence.scriptfile": { - "source": "iana" - }, - "application/vnd.vsf": { - "source": "iana", - "extensions": ["vsf"] - }, - "application/vnd.wap.sic": { - "source": "iana" - }, - "application/vnd.wap.slc": { - "source": "iana" - }, - "application/vnd.wap.wbxml": { - "source": "iana", - "charset": "UTF-8", - "extensions": ["wbxml"] - }, - "application/vnd.wap.wmlc": { - "source": "iana", - "extensions": ["wmlc"] - }, - "application/vnd.wap.wmlscriptc": { - "source": "iana", - "extensions": ["wmlsc"] - }, - "application/vnd.webturbo": { - "source": "iana", - "extensions": ["wtb"] - }, - "application/vnd.wfa.dpp": { - "source": "iana" - }, - "application/vnd.wfa.p2p": { - "source": "iana" - }, - "application/vnd.wfa.wsc": { - "source": "iana" - }, - "application/vnd.windows.devicepairing": { - "source": "iana" - }, - "application/vnd.wmc": { - "source": "iana" - }, - "application/vnd.wmf.bootstrap": { - "source": "iana" - }, - "application/vnd.wolfram.mathematica": { - "source": "iana" - }, - "application/vnd.wolfram.mathematica.package": { - "source": "iana" - }, - "application/vnd.wolfram.player": { - "source": "iana", - "extensions": ["nbp"] - }, - "application/vnd.wordperfect": { - "source": "iana", - "extensions": ["wpd"] - }, - "application/vnd.wqd": { - "source": "iana", - "extensions": ["wqd"] - }, - "application/vnd.wrq-hp3000-labelled": { - "source": "iana" - }, - "application/vnd.wt.stf": { - "source": "iana", - "extensions": ["stf"] - }, - "application/vnd.wv.csp+wbxml": { - "source": "iana" - }, - "application/vnd.wv.csp+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.wv.ssp+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.xacml+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.xara": { - "source": "iana", - "extensions": ["xar"] - }, - "application/vnd.xfdl": { - "source": "iana", - "extensions": ["xfdl"] - }, - "application/vnd.xfdl.webform": { - "source": "iana" - }, - "application/vnd.xmi+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.xmpie.cpkg": { - "source": "iana" - }, - "application/vnd.xmpie.dpkg": { - "source": "iana" - }, - "application/vnd.xmpie.plan": { - "source": "iana" - }, - "application/vnd.xmpie.ppkg": { - "source": "iana" - }, - "application/vnd.xmpie.xlim": { - "source": "iana" - }, - "application/vnd.yamaha.hv-dic": { - "source": "iana", - "extensions": ["hvd"] - }, - "application/vnd.yamaha.hv-script": { - "source": "iana", - "extensions": ["hvs"] - }, - "application/vnd.yamaha.hv-voice": { - "source": "iana", - "extensions": ["hvp"] - }, - "application/vnd.yamaha.openscoreformat": { - "source": "iana", - "extensions": ["osf"] - }, - "application/vnd.yamaha.openscoreformat.osfpvg+xml": { - "source": "iana", - "compressible": true, - "extensions": ["osfpvg"] - }, - "application/vnd.yamaha.remote-setup": { - "source": "iana" - }, - "application/vnd.yamaha.smaf-audio": { - "source": "iana", - "extensions": ["saf"] - }, - "application/vnd.yamaha.smaf-phrase": { - "source": "iana", - "extensions": ["spf"] - }, - "application/vnd.yamaha.through-ngn": { - "source": "iana" - }, - "application/vnd.yamaha.tunnel-udpencap": { - "source": "iana" - }, - "application/vnd.yaoweme": { - "source": "iana" - }, - "application/vnd.yellowriver-custom-menu": { - "source": "iana", - "extensions": ["cmp"] - }, - "application/vnd.youtube.yt": { - "source": "iana" - }, - "application/vnd.zul": { - "source": "iana", - "extensions": ["zir","zirz"] - }, - "application/vnd.zzazz.deck+xml": { - "source": "iana", - "compressible": true, - "extensions": ["zaz"] - }, - "application/voicexml+xml": { - "source": "iana", - "compressible": true, - "extensions": ["vxml"] - }, - "application/voucher-cms+json": { - "source": "iana", - "compressible": true - }, - "application/vq-rtcpxr": { - "source": "iana" - }, - "application/wasm": { - "source": "iana", - "compressible": true, - "extensions": ["wasm"] - }, - "application/watcherinfo+xml": { - "source": "iana", - "compressible": true, - "extensions": ["wif"] - }, - "application/webpush-options+json": { - "source": "iana", - "compressible": true - }, - "application/whoispp-query": { - "source": "iana" - }, - "application/whoispp-response": { - "source": "iana" - }, - "application/widget": { - "source": "iana", - "extensions": ["wgt"] - }, - "application/winhlp": { - "source": "apache", - "extensions": ["hlp"] - }, - "application/wita": { - "source": "iana" - }, - "application/wordperfect5.1": { - "source": "iana" - }, - "application/wsdl+xml": { - "source": "iana", - "compressible": true, - "extensions": ["wsdl"] - }, - "application/wspolicy+xml": { - "source": "iana", - "compressible": true, - "extensions": ["wspolicy"] - }, - "application/x-7z-compressed": { - "source": "apache", - "compressible": false, - "extensions": ["7z"] - }, - "application/x-abiword": { - "source": "apache", - "extensions": ["abw"] - }, - "application/x-ace-compressed": { - "source": "apache", - "extensions": ["ace"] - }, - "application/x-amf": { - "source": "apache" - }, - "application/x-apple-diskimage": { - "source": "apache", - "extensions": ["dmg"] - }, - "application/x-arj": { - "compressible": false, - "extensions": ["arj"] - }, - "application/x-authorware-bin": { - "source": "apache", - "extensions": ["aab","x32","u32","vox"] - }, - "application/x-authorware-map": { - "source": "apache", - "extensions": ["aam"] - }, - "application/x-authorware-seg": { - "source": "apache", - "extensions": ["aas"] - }, - "application/x-bcpio": { - "source": "apache", - "extensions": ["bcpio"] - }, - "application/x-bdoc": { - "compressible": false, - "extensions": ["bdoc"] - }, - "application/x-bittorrent": { - "source": "apache", - "extensions": ["torrent"] - }, - "application/x-blorb": { - "source": "apache", - "extensions": ["blb","blorb"] - }, - "application/x-bzip": { - "source": "apache", - "compressible": false, - "extensions": ["bz"] - }, - "application/x-bzip2": { - "source": "apache", - "compressible": false, - "extensions": ["bz2","boz"] - }, - "application/x-cbr": { - "source": "apache", - "extensions": ["cbr","cba","cbt","cbz","cb7"] - }, - "application/x-cdlink": { - "source": "apache", - "extensions": ["vcd"] - }, - "application/x-cfs-compressed": { - "source": "apache", - "extensions": ["cfs"] - }, - "application/x-chat": { - "source": "apache", - "extensions": ["chat"] - }, - "application/x-chess-pgn": { - "source": "apache", - "extensions": ["pgn"] - }, - "application/x-chrome-extension": { - "extensions": ["crx"] - }, - "application/x-cocoa": { - "source": "nginx", - "extensions": ["cco"] - }, - "application/x-compress": { - "source": "apache" - }, - "application/x-conference": { - "source": "apache", - "extensions": ["nsc"] - }, - "application/x-cpio": { - "source": "apache", - "extensions": ["cpio"] - }, - "application/x-csh": { - "source": "apache", - "extensions": ["csh"] - }, - "application/x-deb": { - "compressible": false - }, - "application/x-debian-package": { - "source": "apache", - "extensions": ["deb","udeb"] - }, - "application/x-dgc-compressed": { - "source": "apache", - "extensions": ["dgc"] - }, - "application/x-director": { - "source": "apache", - "extensions": ["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"] - }, - "application/x-doom": { - "source": "apache", - "extensions": ["wad"] - }, - "application/x-dtbncx+xml": { - "source": "apache", - "compressible": true, - "extensions": ["ncx"] - }, - "application/x-dtbook+xml": { - "source": "apache", - "compressible": true, - "extensions": ["dtb"] - }, - "application/x-dtbresource+xml": { - "source": "apache", - "compressible": true, - "extensions": ["res"] - }, - "application/x-dvi": { - "source": "apache", - "compressible": false, - "extensions": ["dvi"] - }, - "application/x-envoy": { - "source": "apache", - "extensions": ["evy"] - }, - "application/x-eva": { - "source": "apache", - "extensions": ["eva"] - }, - "application/x-font-bdf": { - "source": "apache", - "extensions": ["bdf"] - }, - "application/x-font-dos": { - "source": "apache" - }, - "application/x-font-framemaker": { - "source": "apache" - }, - "application/x-font-ghostscript": { - "source": "apache", - "extensions": ["gsf"] - }, - "application/x-font-libgrx": { - "source": "apache" - }, - "application/x-font-linux-psf": { - "source": "apache", - "extensions": ["psf"] - }, - "application/x-font-pcf": { - "source": "apache", - "extensions": ["pcf"] - }, - "application/x-font-snf": { - "source": "apache", - "extensions": ["snf"] - }, - "application/x-font-speedo": { - "source": "apache" - }, - "application/x-font-sunos-news": { - "source": "apache" - }, - "application/x-font-type1": { - "source": "apache", - "extensions": ["pfa","pfb","pfm","afm"] - }, - "application/x-font-vfont": { - "source": "apache" - }, - "application/x-freearc": { - "source": "apache", - "extensions": ["arc"] - }, - "application/x-futuresplash": { - "source": "apache", - "extensions": ["spl"] - }, - "application/x-gca-compressed": { - "source": "apache", - "extensions": ["gca"] - }, - "application/x-glulx": { - "source": "apache", - "extensions": ["ulx"] - }, - "application/x-gnumeric": { - "source": "apache", - "extensions": ["gnumeric"] - }, - "application/x-gramps-xml": { - "source": "apache", - "extensions": ["gramps"] - }, - "application/x-gtar": { - "source": "apache", - "extensions": ["gtar"] - }, - "application/x-gzip": { - "source": "apache" - }, - "application/x-hdf": { - "source": "apache", - "extensions": ["hdf"] - }, - "application/x-httpd-php": { - "compressible": true, - "extensions": ["php"] - }, - "application/x-install-instructions": { - "source": "apache", - "extensions": ["install"] - }, - "application/x-iso9660-image": { - "source": "apache", - "extensions": ["iso"] - }, - "application/x-iwork-keynote-sffkey": { - "extensions": ["key"] - }, - "application/x-iwork-numbers-sffnumbers": { - "extensions": ["numbers"] - }, - "application/x-iwork-pages-sffpages": { - "extensions": ["pages"] - }, - "application/x-java-archive-diff": { - "source": "nginx", - "extensions": ["jardiff"] - }, - "application/x-java-jnlp-file": { - "source": "apache", - "compressible": false, - "extensions": ["jnlp"] - }, - "application/x-javascript": { - "compressible": true - }, - "application/x-keepass2": { - "extensions": ["kdbx"] - }, - "application/x-latex": { - "source": "apache", - "compressible": false, - "extensions": ["latex"] - }, - "application/x-lua-bytecode": { - "extensions": ["luac"] - }, - "application/x-lzh-compressed": { - "source": "apache", - "extensions": ["lzh","lha"] - }, - "application/x-makeself": { - "source": "nginx", - "extensions": ["run"] - }, - "application/x-mie": { - "source": "apache", - "extensions": ["mie"] - }, - "application/x-mobipocket-ebook": { - "source": "apache", - "extensions": ["prc","mobi"] - }, - "application/x-mpegurl": { - "compressible": false - }, - "application/x-ms-application": { - "source": "apache", - "extensions": ["application"] - }, - "application/x-ms-shortcut": { - "source": "apache", - "extensions": ["lnk"] - }, - "application/x-ms-wmd": { - "source": "apache", - "extensions": ["wmd"] - }, - "application/x-ms-wmz": { - "source": "apache", - "extensions": ["wmz"] - }, - "application/x-ms-xbap": { - "source": "apache", - "extensions": ["xbap"] - }, - "application/x-msaccess": { - "source": "apache", - "extensions": ["mdb"] - }, - "application/x-msbinder": { - "source": "apache", - "extensions": ["obd"] - }, - "application/x-mscardfile": { - "source": "apache", - "extensions": ["crd"] - }, - "application/x-msclip": { - "source": "apache", - "extensions": ["clp"] - }, - "application/x-msdos-program": { - "extensions": ["exe"] - }, - "application/x-msdownload": { - "source": "apache", - "extensions": ["exe","dll","com","bat","msi"] - }, - "application/x-msmediaview": { - "source": "apache", - "extensions": ["mvb","m13","m14"] - }, - "application/x-msmetafile": { - "source": "apache", - "extensions": ["wmf","wmz","emf","emz"] - }, - "application/x-msmoney": { - "source": "apache", - "extensions": ["mny"] - }, - "application/x-mspublisher": { - "source": "apache", - "extensions": ["pub"] - }, - "application/x-msschedule": { - "source": "apache", - "extensions": ["scd"] - }, - "application/x-msterminal": { - "source": "apache", - "extensions": ["trm"] - }, - "application/x-mswrite": { - "source": "apache", - "extensions": ["wri"] - }, - "application/x-netcdf": { - "source": "apache", - "extensions": ["nc","cdf"] - }, - "application/x-ns-proxy-autoconfig": { - "compressible": true, - "extensions": ["pac"] - }, - "application/x-nzb": { - "source": "apache", - "extensions": ["nzb"] - }, - "application/x-perl": { - "source": "nginx", - "extensions": ["pl","pm"] - }, - "application/x-pilot": { - "source": "nginx", - "extensions": ["prc","pdb"] - }, - "application/x-pkcs12": { - "source": "apache", - "compressible": false, - "extensions": ["p12","pfx"] - }, - "application/x-pkcs7-certificates": { - "source": "apache", - "extensions": ["p7b","spc"] - }, - "application/x-pkcs7-certreqresp": { - "source": "apache", - "extensions": ["p7r"] - }, - "application/x-pki-message": { - "source": "iana" - }, - "application/x-rar-compressed": { - "source": "apache", - "compressible": false, - "extensions": ["rar"] - }, - "application/x-redhat-package-manager": { - "source": "nginx", - "extensions": ["rpm"] - }, - "application/x-research-info-systems": { - "source": "apache", - "extensions": ["ris"] - }, - "application/x-sea": { - "source": "nginx", - "extensions": ["sea"] - }, - "application/x-sh": { - "source": "apache", - "compressible": true, - "extensions": ["sh"] - }, - "application/x-shar": { - "source": "apache", - "extensions": ["shar"] - }, - "application/x-shockwave-flash": { - "source": "apache", - "compressible": false, - "extensions": ["swf"] - }, - "application/x-silverlight-app": { - "source": "apache", - "extensions": ["xap"] - }, - "application/x-sql": { - "source": "apache", - "extensions": ["sql"] - }, - "application/x-stuffit": { - "source": "apache", - "compressible": false, - "extensions": ["sit"] - }, - "application/x-stuffitx": { - "source": "apache", - "extensions": ["sitx"] - }, - "application/x-subrip": { - "source": "apache", - "extensions": ["srt"] - }, - "application/x-sv4cpio": { - "source": "apache", - "extensions": ["sv4cpio"] - }, - "application/x-sv4crc": { - "source": "apache", - "extensions": ["sv4crc"] - }, - "application/x-t3vm-image": { - "source": "apache", - "extensions": ["t3"] - }, - "application/x-tads": { - "source": "apache", - "extensions": ["gam"] - }, - "application/x-tar": { - "source": "apache", - "compressible": true, - "extensions": ["tar"] - }, - "application/x-tcl": { - "source": "apache", - "extensions": ["tcl","tk"] - }, - "application/x-tex": { - "source": "apache", - "extensions": ["tex"] - }, - "application/x-tex-tfm": { - "source": "apache", - "extensions": ["tfm"] - }, - "application/x-texinfo": { - "source": "apache", - "extensions": ["texinfo","texi"] - }, - "application/x-tgif": { - "source": "apache", - "extensions": ["obj"] - }, - "application/x-ustar": { - "source": "apache", - "extensions": ["ustar"] - }, - "application/x-virtualbox-hdd": { - "compressible": true, - "extensions": ["hdd"] - }, - "application/x-virtualbox-ova": { - "compressible": true, - "extensions": ["ova"] - }, - "application/x-virtualbox-ovf": { - "compressible": true, - "extensions": ["ovf"] - }, - "application/x-virtualbox-vbox": { - "compressible": true, - "extensions": ["vbox"] - }, - "application/x-virtualbox-vbox-extpack": { - "compressible": false, - "extensions": ["vbox-extpack"] - }, - "application/x-virtualbox-vdi": { - "compressible": true, - "extensions": ["vdi"] - }, - "application/x-virtualbox-vhd": { - "compressible": true, - "extensions": ["vhd"] - }, - "application/x-virtualbox-vmdk": { - "compressible": true, - "extensions": ["vmdk"] - }, - "application/x-wais-source": { - "source": "apache", - "extensions": ["src"] - }, - "application/x-web-app-manifest+json": { - "compressible": true, - "extensions": ["webapp"] - }, - "application/x-www-form-urlencoded": { - "source": "iana", - "compressible": true - }, - "application/x-x509-ca-cert": { - "source": "iana", - "extensions": ["der","crt","pem"] - }, - "application/x-x509-ca-ra-cert": { - "source": "iana" - }, - "application/x-x509-next-ca-cert": { - "source": "iana" - }, - "application/x-xfig": { - "source": "apache", - "extensions": ["fig"] - }, - "application/x-xliff+xml": { - "source": "apache", - "compressible": true, - "extensions": ["xlf"] - }, - "application/x-xpinstall": { - "source": "apache", - "compressible": false, - "extensions": ["xpi"] - }, - "application/x-xz": { - "source": "apache", - "extensions": ["xz"] - }, - "application/x-zmachine": { - "source": "apache", - "extensions": ["z1","z2","z3","z4","z5","z6","z7","z8"] - }, - "application/x400-bp": { - "source": "iana" - }, - "application/xacml+xml": { - "source": "iana", - "compressible": true - }, - "application/xaml+xml": { - "source": "apache", - "compressible": true, - "extensions": ["xaml"] - }, - "application/xcap-att+xml": { - "source": "iana", - "compressible": true, - "extensions": ["xav"] - }, - "application/xcap-caps+xml": { - "source": "iana", - "compressible": true, - "extensions": ["xca"] - }, - "application/xcap-diff+xml": { - "source": "iana", - "compressible": true, - "extensions": ["xdf"] - }, - "application/xcap-el+xml": { - "source": "iana", - "compressible": true, - "extensions": ["xel"] - }, - "application/xcap-error+xml": { - "source": "iana", - "compressible": true - }, - "application/xcap-ns+xml": { - "source": "iana", - "compressible": true, - "extensions": ["xns"] - }, - "application/xcon-conference-info+xml": { - "source": "iana", - "compressible": true - }, - "application/xcon-conference-info-diff+xml": { - "source": "iana", - "compressible": true - }, - "application/xenc+xml": { - "source": "iana", - "compressible": true, - "extensions": ["xenc"] - }, - "application/xhtml+xml": { - "source": "iana", - "compressible": true, - "extensions": ["xhtml","xht"] - }, - "application/xhtml-voice+xml": { - "source": "apache", - "compressible": true - }, - "application/xliff+xml": { - "source": "iana", - "compressible": true, - "extensions": ["xlf"] - }, - "application/xml": { - "source": "iana", - "compressible": true, - "extensions": ["xml","xsl","xsd","rng"] - }, - "application/xml-dtd": { - "source": "iana", - "compressible": true, - "extensions": ["dtd"] - }, - "application/xml-external-parsed-entity": { - "source": "iana" - }, - "application/xml-patch+xml": { - "source": "iana", - "compressible": true - }, - "application/xmpp+xml": { - "source": "iana", - "compressible": true - }, - "application/xop+xml": { - "source": "iana", - "compressible": true, - "extensions": ["xop"] - }, - "application/xproc+xml": { - "source": "apache", - "compressible": true, - "extensions": ["xpl"] - }, - "application/xslt+xml": { - "source": "iana", - "compressible": true, - "extensions": ["xsl","xslt"] - }, - "application/xspf+xml": { - "source": "apache", - "compressible": true, - "extensions": ["xspf"] - }, - "application/xv+xml": { - "source": "iana", - "compressible": true, - "extensions": ["mxml","xhvml","xvml","xvm"] - }, - "application/yang": { - "source": "iana", - "extensions": ["yang"] - }, - "application/yang-data+json": { - "source": "iana", - "compressible": true - }, - "application/yang-data+xml": { - "source": "iana", - "compressible": true - }, - "application/yang-patch+json": { - "source": "iana", - "compressible": true - }, - "application/yang-patch+xml": { - "source": "iana", - "compressible": true - }, - "application/yin+xml": { - "source": "iana", - "compressible": true, - "extensions": ["yin"] - }, - "application/zip": { - "source": "iana", - "compressible": false, - "extensions": ["zip"] - }, - "application/zlib": { - "source": "iana" - }, - "application/zstd": { - "source": "iana" - }, - "audio/1d-interleaved-parityfec": { - "source": "iana" - }, - "audio/32kadpcm": { - "source": "iana" - }, - "audio/3gpp": { - "source": "iana", - "compressible": false, - "extensions": ["3gpp"] - }, - "audio/3gpp2": { - "source": "iana" - }, - "audio/aac": { - "source": "iana" - }, - "audio/ac3": { - "source": "iana" - }, - "audio/adpcm": { - "source": "apache", - "extensions": ["adp"] - }, - "audio/amr": { - "source": "iana", - "extensions": ["amr"] - }, - "audio/amr-wb": { - "source": "iana" - }, - "audio/amr-wb+": { - "source": "iana" - }, - "audio/aptx": { - "source": "iana" - }, - "audio/asc": { - "source": "iana" - }, - "audio/atrac-advanced-lossless": { - "source": "iana" - }, - "audio/atrac-x": { - "source": "iana" - }, - "audio/atrac3": { - "source": "iana" - }, - "audio/basic": { - "source": "iana", - "compressible": false, - "extensions": ["au","snd"] - }, - "audio/bv16": { - "source": "iana" - }, - "audio/bv32": { - "source": "iana" - }, - "audio/clearmode": { - "source": "iana" - }, - "audio/cn": { - "source": "iana" - }, - "audio/dat12": { - "source": "iana" - }, - "audio/dls": { - "source": "iana" - }, - "audio/dsr-es201108": { - "source": "iana" - }, - "audio/dsr-es202050": { - "source": "iana" - }, - "audio/dsr-es202211": { - "source": "iana" - }, - "audio/dsr-es202212": { - "source": "iana" - }, - "audio/dv": { - "source": "iana" - }, - "audio/dvi4": { - "source": "iana" - }, - "audio/eac3": { - "source": "iana" - }, - "audio/encaprtp": { - "source": "iana" - }, - "audio/evrc": { - "source": "iana" - }, - "audio/evrc-qcp": { - "source": "iana" - }, - "audio/evrc0": { - "source": "iana" - }, - "audio/evrc1": { - "source": "iana" - }, - "audio/evrcb": { - "source": "iana" - }, - "audio/evrcb0": { - "source": "iana" - }, - "audio/evrcb1": { - "source": "iana" - }, - "audio/evrcnw": { - "source": "iana" - }, - "audio/evrcnw0": { - "source": "iana" - }, - "audio/evrcnw1": { - "source": "iana" - }, - "audio/evrcwb": { - "source": "iana" - }, - "audio/evrcwb0": { - "source": "iana" - }, - "audio/evrcwb1": { - "source": "iana" - }, - "audio/evs": { - "source": "iana" - }, - "audio/flexfec": { - "source": "iana" - }, - "audio/fwdred": { - "source": "iana" - }, - "audio/g711-0": { - "source": "iana" - }, - "audio/g719": { - "source": "iana" - }, - "audio/g722": { - "source": "iana" - }, - "audio/g7221": { - "source": "iana" - }, - "audio/g723": { - "source": "iana" - }, - "audio/g726-16": { - "source": "iana" - }, - "audio/g726-24": { - "source": "iana" - }, - "audio/g726-32": { - "source": "iana" - }, - "audio/g726-40": { - "source": "iana" - }, - "audio/g728": { - "source": "iana" - }, - "audio/g729": { - "source": "iana" - }, - "audio/g7291": { - "source": "iana" - }, - "audio/g729d": { - "source": "iana" - }, - "audio/g729e": { - "source": "iana" - }, - "audio/gsm": { - "source": "iana" - }, - "audio/gsm-efr": { - "source": "iana" - }, - "audio/gsm-hr-08": { - "source": "iana" - }, - "audio/ilbc": { - "source": "iana" - }, - "audio/ip-mr_v2.5": { - "source": "iana" - }, - "audio/isac": { - "source": "apache" - }, - "audio/l16": { - "source": "iana" - }, - "audio/l20": { - "source": "iana" - }, - "audio/l24": { - "source": "iana", - "compressible": false - }, - "audio/l8": { - "source": "iana" - }, - "audio/lpc": { - "source": "iana" - }, - "audio/melp": { - "source": "iana" - }, - "audio/melp1200": { - "source": "iana" - }, - "audio/melp2400": { - "source": "iana" - }, - "audio/melp600": { - "source": "iana" - }, - "audio/mhas": { - "source": "iana" - }, - "audio/midi": { - "source": "apache", - "extensions": ["mid","midi","kar","rmi"] - }, - "audio/mobile-xmf": { - "source": "iana", - "extensions": ["mxmf"] - }, - "audio/mp3": { - "compressible": false, - "extensions": ["mp3"] - }, - "audio/mp4": { - "source": "iana", - "compressible": false, - "extensions": ["m4a","mp4a"] - }, - "audio/mp4a-latm": { - "source": "iana" - }, - "audio/mpa": { - "source": "iana" - }, - "audio/mpa-robust": { - "source": "iana" - }, - "audio/mpeg": { - "source": "iana", - "compressible": false, - "extensions": ["mpga","mp2","mp2a","mp3","m2a","m3a"] - }, - "audio/mpeg4-generic": { - "source": "iana" - }, - "audio/musepack": { - "source": "apache" - }, - "audio/ogg": { - "source": "iana", - "compressible": false, - "extensions": ["oga","ogg","spx","opus"] - }, - "audio/opus": { - "source": "iana" - }, - "audio/parityfec": { - "source": "iana" - }, - "audio/pcma": { - "source": "iana" - }, - "audio/pcma-wb": { - "source": "iana" - }, - "audio/pcmu": { - "source": "iana" - }, - "audio/pcmu-wb": { - "source": "iana" - }, - "audio/prs.sid": { - "source": "iana" - }, - "audio/qcelp": { - "source": "iana" - }, - "audio/raptorfec": { - "source": "iana" - }, - "audio/red": { - "source": "iana" - }, - "audio/rtp-enc-aescm128": { - "source": "iana" - }, - "audio/rtp-midi": { - "source": "iana" - }, - "audio/rtploopback": { - "source": "iana" - }, - "audio/rtx": { - "source": "iana" - }, - "audio/s3m": { - "source": "apache", - "extensions": ["s3m"] - }, - "audio/scip": { - "source": "iana" - }, - "audio/silk": { - "source": "apache", - "extensions": ["sil"] - }, - "audio/smv": { - "source": "iana" - }, - "audio/smv-qcp": { - "source": "iana" - }, - "audio/smv0": { - "source": "iana" - }, - "audio/sofa": { - "source": "iana" - }, - "audio/sp-midi": { - "source": "iana" - }, - "audio/speex": { - "source": "iana" - }, - "audio/t140c": { - "source": "iana" - }, - "audio/t38": { - "source": "iana" - }, - "audio/telephone-event": { - "source": "iana" - }, - "audio/tetra_acelp": { - "source": "iana" - }, - "audio/tetra_acelp_bb": { - "source": "iana" - }, - "audio/tone": { - "source": "iana" - }, - "audio/tsvcis": { - "source": "iana" - }, - "audio/uemclip": { - "source": "iana" - }, - "audio/ulpfec": { - "source": "iana" - }, - "audio/usac": { - "source": "iana" - }, - "audio/vdvi": { - "source": "iana" - }, - "audio/vmr-wb": { - "source": "iana" - }, - "audio/vnd.3gpp.iufp": { - "source": "iana" - }, - "audio/vnd.4sb": { - "source": "iana" - }, - "audio/vnd.audiokoz": { - "source": "iana" - }, - "audio/vnd.celp": { - "source": "iana" - }, - "audio/vnd.cisco.nse": { - "source": "iana" - }, - "audio/vnd.cmles.radio-events": { - "source": "iana" - }, - "audio/vnd.cns.anp1": { - "source": "iana" - }, - "audio/vnd.cns.inf1": { - "source": "iana" - }, - "audio/vnd.dece.audio": { - "source": "iana", - "extensions": ["uva","uvva"] - }, - "audio/vnd.digital-winds": { - "source": "iana", - "extensions": ["eol"] - }, - "audio/vnd.dlna.adts": { - "source": "iana" - }, - "audio/vnd.dolby.heaac.1": { - "source": "iana" - }, - "audio/vnd.dolby.heaac.2": { - "source": "iana" - }, - "audio/vnd.dolby.mlp": { - "source": "iana" - }, - "audio/vnd.dolby.mps": { - "source": "iana" - }, - "audio/vnd.dolby.pl2": { - "source": "iana" - }, - "audio/vnd.dolby.pl2x": { - "source": "iana" - }, - "audio/vnd.dolby.pl2z": { - "source": "iana" - }, - "audio/vnd.dolby.pulse.1": { - "source": "iana" - }, - "audio/vnd.dra": { - "source": "iana", - "extensions": ["dra"] - }, - "audio/vnd.dts": { - "source": "iana", - "extensions": ["dts"] - }, - "audio/vnd.dts.hd": { - "source": "iana", - "extensions": ["dtshd"] - }, - "audio/vnd.dts.uhd": { - "source": "iana" - }, - "audio/vnd.dvb.file": { - "source": "iana" - }, - "audio/vnd.everad.plj": { - "source": "iana" - }, - "audio/vnd.hns.audio": { - "source": "iana" - }, - "audio/vnd.lucent.voice": { - "source": "iana", - "extensions": ["lvp"] - }, - "audio/vnd.ms-playready.media.pya": { - "source": "iana", - "extensions": ["pya"] - }, - "audio/vnd.nokia.mobile-xmf": { - "source": "iana" - }, - "audio/vnd.nortel.vbk": { - "source": "iana" - }, - "audio/vnd.nuera.ecelp4800": { - "source": "iana", - "extensions": ["ecelp4800"] - }, - "audio/vnd.nuera.ecelp7470": { - "source": "iana", - "extensions": ["ecelp7470"] - }, - "audio/vnd.nuera.ecelp9600": { - "source": "iana", - "extensions": ["ecelp9600"] - }, - "audio/vnd.octel.sbc": { - "source": "iana" - }, - "audio/vnd.presonus.multitrack": { - "source": "iana" - }, - "audio/vnd.qcelp": { - "source": "iana" - }, - "audio/vnd.rhetorex.32kadpcm": { - "source": "iana" - }, - "audio/vnd.rip": { - "source": "iana", - "extensions": ["rip"] - }, - "audio/vnd.rn-realaudio": { - "compressible": false - }, - "audio/vnd.sealedmedia.softseal.mpeg": { - "source": "iana" - }, - "audio/vnd.vmx.cvsd": { - "source": "iana" - }, - "audio/vnd.wave": { - "compressible": false - }, - "audio/vorbis": { - "source": "iana", - "compressible": false - }, - "audio/vorbis-config": { - "source": "iana" - }, - "audio/wav": { - "compressible": false, - "extensions": ["wav"] - }, - "audio/wave": { - "compressible": false, - "extensions": ["wav"] - }, - "audio/webm": { - "source": "apache", - "compressible": false, - "extensions": ["weba"] - }, - "audio/x-aac": { - "source": "apache", - "compressible": false, - "extensions": ["aac"] - }, - "audio/x-aiff": { - "source": "apache", - "extensions": ["aif","aiff","aifc"] - }, - "audio/x-caf": { - "source": "apache", - "compressible": false, - "extensions": ["caf"] - }, - "audio/x-flac": { - "source": "apache", - "extensions": ["flac"] - }, - "audio/x-m4a": { - "source": "nginx", - "extensions": ["m4a"] - }, - "audio/x-matroska": { - "source": "apache", - "extensions": ["mka"] - }, - "audio/x-mpegurl": { - "source": "apache", - "extensions": ["m3u"] - }, - "audio/x-ms-wax": { - "source": "apache", - "extensions": ["wax"] - }, - "audio/x-ms-wma": { - "source": "apache", - "extensions": ["wma"] - }, - "audio/x-pn-realaudio": { - "source": "apache", - "extensions": ["ram","ra"] - }, - "audio/x-pn-realaudio-plugin": { - "source": "apache", - "extensions": ["rmp"] - }, - "audio/x-realaudio": { - "source": "nginx", - "extensions": ["ra"] - }, - "audio/x-tta": { - "source": "apache" - }, - "audio/x-wav": { - "source": "apache", - "extensions": ["wav"] - }, - "audio/xm": { - "source": "apache", - "extensions": ["xm"] - }, - "chemical/x-cdx": { - "source": "apache", - "extensions": ["cdx"] - }, - "chemical/x-cif": { - "source": "apache", - "extensions": ["cif"] - }, - "chemical/x-cmdf": { - "source": "apache", - "extensions": ["cmdf"] - }, - "chemical/x-cml": { - "source": "apache", - "extensions": ["cml"] - }, - "chemical/x-csml": { - "source": "apache", - "extensions": ["csml"] - }, - "chemical/x-pdb": { - "source": "apache" - }, - "chemical/x-xyz": { - "source": "apache", - "extensions": ["xyz"] - }, - "font/collection": { - "source": "iana", - "extensions": ["ttc"] - }, - "font/otf": { - "source": "iana", - "compressible": true, - "extensions": ["otf"] - }, - "font/sfnt": { - "source": "iana" - }, - "font/ttf": { - "source": "iana", - "compressible": true, - "extensions": ["ttf"] - }, - "font/woff": { - "source": "iana", - "extensions": ["woff"] - }, - "font/woff2": { - "source": "iana", - "extensions": ["woff2"] - }, - "image/aces": { - "source": "iana", - "extensions": ["exr"] - }, - "image/apng": { - "compressible": false, - "extensions": ["apng"] - }, - "image/avci": { - "source": "iana", - "extensions": ["avci"] - }, - "image/avcs": { - "source": "iana", - "extensions": ["avcs"] - }, - "image/avif": { - "source": "iana", - "compressible": false, - "extensions": ["avif"] - }, - "image/bmp": { - "source": "iana", - "compressible": true, - "extensions": ["bmp"] - }, - "image/cgm": { - "source": "iana", - "extensions": ["cgm"] - }, - "image/dicom-rle": { - "source": "iana", - "extensions": ["drle"] - }, - "image/emf": { - "source": "iana", - "extensions": ["emf"] - }, - "image/fits": { - "source": "iana", - "extensions": ["fits"] - }, - "image/g3fax": { - "source": "iana", - "extensions": ["g3"] - }, - "image/gif": { - "source": "iana", - "compressible": false, - "extensions": ["gif"] - }, - "image/heic": { - "source": "iana", - "extensions": ["heic"] - }, - "image/heic-sequence": { - "source": "iana", - "extensions": ["heics"] - }, - "image/heif": { - "source": "iana", - "extensions": ["heif"] - }, - "image/heif-sequence": { - "source": "iana", - "extensions": ["heifs"] - }, - "image/hej2k": { - "source": "iana", - "extensions": ["hej2"] - }, - "image/hsj2": { - "source": "iana", - "extensions": ["hsj2"] - }, - "image/ief": { - "source": "iana", - "extensions": ["ief"] - }, - "image/jls": { - "source": "iana", - "extensions": ["jls"] - }, - "image/jp2": { - "source": "iana", - "compressible": false, - "extensions": ["jp2","jpg2"] - }, - "image/jpeg": { - "source": "iana", - "compressible": false, - "extensions": ["jpeg","jpg","jpe"] - }, - "image/jph": { - "source": "iana", - "extensions": ["jph"] - }, - "image/jphc": { - "source": "iana", - "extensions": ["jhc"] - }, - "image/jpm": { - "source": "iana", - "compressible": false, - "extensions": ["jpm"] - }, - "image/jpx": { - "source": "iana", - "compressible": false, - "extensions": ["jpx","jpf"] - }, - "image/jxr": { - "source": "iana", - "extensions": ["jxr"] - }, - "image/jxra": { - "source": "iana", - "extensions": ["jxra"] - }, - "image/jxrs": { - "source": "iana", - "extensions": ["jxrs"] - }, - "image/jxs": { - "source": "iana", - "extensions": ["jxs"] - }, - "image/jxsc": { - "source": "iana", - "extensions": ["jxsc"] - }, - "image/jxsi": { - "source": "iana", - "extensions": ["jxsi"] - }, - "image/jxss": { - "source": "iana", - "extensions": ["jxss"] - }, - "image/ktx": { - "source": "iana", - "extensions": ["ktx"] - }, - "image/ktx2": { - "source": "iana", - "extensions": ["ktx2"] - }, - "image/naplps": { - "source": "iana" - }, - "image/pjpeg": { - "compressible": false - }, - "image/png": { - "source": "iana", - "compressible": false, - "extensions": ["png"] - }, - "image/prs.btif": { - "source": "iana", - "extensions": ["btif"] - }, - "image/prs.pti": { - "source": "iana", - "extensions": ["pti"] - }, - "image/pwg-raster": { - "source": "iana" - }, - "image/sgi": { - "source": "apache", - "extensions": ["sgi"] - }, - "image/svg+xml": { - "source": "iana", - "compressible": true, - "extensions": ["svg","svgz"] - }, - "image/t38": { - "source": "iana", - "extensions": ["t38"] - }, - "image/tiff": { - "source": "iana", - "compressible": false, - "extensions": ["tif","tiff"] - }, - "image/tiff-fx": { - "source": "iana", - "extensions": ["tfx"] - }, - "image/vnd.adobe.photoshop": { - "source": "iana", - "compressible": true, - "extensions": ["psd"] - }, - "image/vnd.airzip.accelerator.azv": { - "source": "iana", - "extensions": ["azv"] - }, - "image/vnd.cns.inf2": { - "source": "iana" - }, - "image/vnd.dece.graphic": { - "source": "iana", - "extensions": ["uvi","uvvi","uvg","uvvg"] - }, - "image/vnd.djvu": { - "source": "iana", - "extensions": ["djvu","djv"] - }, - "image/vnd.dvb.subtitle": { - "source": "iana", - "extensions": ["sub"] - }, - "image/vnd.dwg": { - "source": "iana", - "extensions": ["dwg"] - }, - "image/vnd.dxf": { - "source": "iana", - "extensions": ["dxf"] - }, - "image/vnd.fastbidsheet": { - "source": "iana", - "extensions": ["fbs"] - }, - "image/vnd.fpx": { - "source": "iana", - "extensions": ["fpx"] - }, - "image/vnd.fst": { - "source": "iana", - "extensions": ["fst"] - }, - "image/vnd.fujixerox.edmics-mmr": { - "source": "iana", - "extensions": ["mmr"] - }, - "image/vnd.fujixerox.edmics-rlc": { - "source": "iana", - "extensions": ["rlc"] - }, - "image/vnd.globalgraphics.pgb": { - "source": "iana" - }, - "image/vnd.microsoft.icon": { - "source": "iana", - "compressible": true, - "extensions": ["ico"] - }, - "image/vnd.mix": { - "source": "iana" - }, - "image/vnd.mozilla.apng": { - "source": "iana" - }, - "image/vnd.ms-dds": { - "compressible": true, - "extensions": ["dds"] - }, - "image/vnd.ms-modi": { - "source": "iana", - "extensions": ["mdi"] - }, - "image/vnd.ms-photo": { - "source": "apache", - "extensions": ["wdp"] - }, - "image/vnd.net-fpx": { - "source": "iana", - "extensions": ["npx"] - }, - "image/vnd.pco.b16": { - "source": "iana", - "extensions": ["b16"] - }, - "image/vnd.radiance": { - "source": "iana" - }, - "image/vnd.sealed.png": { - "source": "iana" - }, - "image/vnd.sealedmedia.softseal.gif": { - "source": "iana" - }, - "image/vnd.sealedmedia.softseal.jpg": { - "source": "iana" - }, - "image/vnd.svf": { - "source": "iana" - }, - "image/vnd.tencent.tap": { - "source": "iana", - "extensions": ["tap"] - }, - "image/vnd.valve.source.texture": { - "source": "iana", - "extensions": ["vtf"] - }, - "image/vnd.wap.wbmp": { - "source": "iana", - "extensions": ["wbmp"] - }, - "image/vnd.xiff": { - "source": "iana", - "extensions": ["xif"] - }, - "image/vnd.zbrush.pcx": { - "source": "iana", - "extensions": ["pcx"] - }, - "image/webp": { - "source": "apache", - "extensions": ["webp"] - }, - "image/wmf": { - "source": "iana", - "extensions": ["wmf"] - }, - "image/x-3ds": { - "source": "apache", - "extensions": ["3ds"] - }, - "image/x-cmu-raster": { - "source": "apache", - "extensions": ["ras"] - }, - "image/x-cmx": { - "source": "apache", - "extensions": ["cmx"] - }, - "image/x-freehand": { - "source": "apache", - "extensions": ["fh","fhc","fh4","fh5","fh7"] - }, - "image/x-icon": { - "source": "apache", - "compressible": true, - "extensions": ["ico"] - }, - "image/x-jng": { - "source": "nginx", - "extensions": ["jng"] - }, - "image/x-mrsid-image": { - "source": "apache", - "extensions": ["sid"] - }, - "image/x-ms-bmp": { - "source": "nginx", - "compressible": true, - "extensions": ["bmp"] - }, - "image/x-pcx": { - "source": "apache", - "extensions": ["pcx"] - }, - "image/x-pict": { - "source": "apache", - "extensions": ["pic","pct"] - }, - "image/x-portable-anymap": { - "source": "apache", - "extensions": ["pnm"] - }, - "image/x-portable-bitmap": { - "source": "apache", - "extensions": ["pbm"] - }, - "image/x-portable-graymap": { - "source": "apache", - "extensions": ["pgm"] - }, - "image/x-portable-pixmap": { - "source": "apache", - "extensions": ["ppm"] - }, - "image/x-rgb": { - "source": "apache", - "extensions": ["rgb"] - }, - "image/x-tga": { - "source": "apache", - "extensions": ["tga"] - }, - "image/x-xbitmap": { - "source": "apache", - "extensions": ["xbm"] - }, - "image/x-xcf": { - "compressible": false - }, - "image/x-xpixmap": { - "source": "apache", - "extensions": ["xpm"] - }, - "image/x-xwindowdump": { - "source": "apache", - "extensions": ["xwd"] - }, - "message/cpim": { - "source": "iana" - }, - "message/delivery-status": { - "source": "iana" - }, - "message/disposition-notification": { - "source": "iana", - "extensions": [ - "disposition-notification" - ] - }, - "message/external-body": { - "source": "iana" - }, - "message/feedback-report": { - "source": "iana" - }, - "message/global": { - "source": "iana", - "extensions": ["u8msg"] - }, - "message/global-delivery-status": { - "source": "iana", - "extensions": ["u8dsn"] - }, - "message/global-disposition-notification": { - "source": "iana", - "extensions": ["u8mdn"] - }, - "message/global-headers": { - "source": "iana", - "extensions": ["u8hdr"] - }, - "message/http": { - "source": "iana", - "compressible": false - }, - "message/imdn+xml": { - "source": "iana", - "compressible": true - }, - "message/news": { - "source": "iana" - }, - "message/partial": { - "source": "iana", - "compressible": false - }, - "message/rfc822": { - "source": "iana", - "compressible": true, - "extensions": ["eml","mime"] - }, - "message/s-http": { - "source": "iana" - }, - "message/sip": { - "source": "iana" - }, - "message/sipfrag": { - "source": "iana" - }, - "message/tracking-status": { - "source": "iana" - }, - "message/vnd.si.simp": { - "source": "iana" - }, - "message/vnd.wfa.wsc": { - "source": "iana", - "extensions": ["wsc"] - }, - "model/3mf": { - "source": "iana", - "extensions": ["3mf"] - }, - "model/e57": { - "source": "iana" - }, - "model/gltf+json": { - "source": "iana", - "compressible": true, - "extensions": ["gltf"] - }, - "model/gltf-binary": { - "source": "iana", - "compressible": true, - "extensions": ["glb"] - }, - "model/iges": { - "source": "iana", - "compressible": false, - "extensions": ["igs","iges"] - }, - "model/mesh": { - "source": "iana", - "compressible": false, - "extensions": ["msh","mesh","silo"] - }, - "model/mtl": { - "source": "iana", - "extensions": ["mtl"] - }, - "model/obj": { - "source": "iana", - "extensions": ["obj"] - }, - "model/step": { - "source": "iana" - }, - "model/step+xml": { - "source": "iana", - "compressible": true, - "extensions": ["stpx"] - }, - "model/step+zip": { - "source": "iana", - "compressible": false, - "extensions": ["stpz"] - }, - "model/step-xml+zip": { - "source": "iana", - "compressible": false, - "extensions": ["stpxz"] - }, - "model/stl": { - "source": "iana", - "extensions": ["stl"] - }, - "model/vnd.collada+xml": { - "source": "iana", - "compressible": true, - "extensions": ["dae"] - }, - "model/vnd.dwf": { - "source": "iana", - "extensions": ["dwf"] - }, - "model/vnd.flatland.3dml": { - "source": "iana" - }, - "model/vnd.gdl": { - "source": "iana", - "extensions": ["gdl"] - }, - "model/vnd.gs-gdl": { - "source": "apache" - }, - "model/vnd.gs.gdl": { - "source": "iana" - }, - "model/vnd.gtw": { - "source": "iana", - "extensions": ["gtw"] - }, - "model/vnd.moml+xml": { - "source": "iana", - "compressible": true - }, - "model/vnd.mts": { - "source": "iana", - "extensions": ["mts"] - }, - "model/vnd.opengex": { - "source": "iana", - "extensions": ["ogex"] - }, - "model/vnd.parasolid.transmit.binary": { - "source": "iana", - "extensions": ["x_b"] - }, - "model/vnd.parasolid.transmit.text": { - "source": "iana", - "extensions": ["x_t"] - }, - "model/vnd.pytha.pyox": { - "source": "iana" - }, - "model/vnd.rosette.annotated-data-model": { - "source": "iana" - }, - "model/vnd.sap.vds": { - "source": "iana", - "extensions": ["vds"] - }, - "model/vnd.usdz+zip": { - "source": "iana", - "compressible": false, - "extensions": ["usdz"] - }, - "model/vnd.valve.source.compiled-map": { - "source": "iana", - "extensions": ["bsp"] - }, - "model/vnd.vtu": { - "source": "iana", - "extensions": ["vtu"] - }, - "model/vrml": { - "source": "iana", - "compressible": false, - "extensions": ["wrl","vrml"] - }, - "model/x3d+binary": { - "source": "apache", - "compressible": false, - "extensions": ["x3db","x3dbz"] - }, - "model/x3d+fastinfoset": { - "source": "iana", - "extensions": ["x3db"] - }, - "model/x3d+vrml": { - "source": "apache", - "compressible": false, - "extensions": ["x3dv","x3dvz"] - }, - "model/x3d+xml": { - "source": "iana", - "compressible": true, - "extensions": ["x3d","x3dz"] - }, - "model/x3d-vrml": { - "source": "iana", - "extensions": ["x3dv"] - }, - "multipart/alternative": { - "source": "iana", - "compressible": false - }, - "multipart/appledouble": { - "source": "iana" - }, - "multipart/byteranges": { - "source": "iana" - }, - "multipart/digest": { - "source": "iana" - }, - "multipart/encrypted": { - "source": "iana", - "compressible": false - }, - "multipart/form-data": { - "source": "iana", - "compressible": false - }, - "multipart/header-set": { - "source": "iana" - }, - "multipart/mixed": { - "source": "iana" - }, - "multipart/multilingual": { - "source": "iana" - }, - "multipart/parallel": { - "source": "iana" - }, - "multipart/related": { - "source": "iana", - "compressible": false - }, - "multipart/report": { - "source": "iana" - }, - "multipart/signed": { - "source": "iana", - "compressible": false - }, - "multipart/vnd.bint.med-plus": { - "source": "iana" - }, - "multipart/voice-message": { - "source": "iana" - }, - "multipart/x-mixed-replace": { - "source": "iana" - }, - "text/1d-interleaved-parityfec": { - "source": "iana" - }, - "text/cache-manifest": { - "source": "iana", - "compressible": true, - "extensions": ["appcache","manifest"] - }, - "text/calendar": { - "source": "iana", - "extensions": ["ics","ifb"] - }, - "text/calender": { - "compressible": true - }, - "text/cmd": { - "compressible": true - }, - "text/coffeescript": { - "extensions": ["coffee","litcoffee"] - }, - "text/cql": { - "source": "iana" - }, - "text/cql-expression": { - "source": "iana" - }, - "text/cql-identifier": { - "source": "iana" - }, - "text/css": { - "source": "iana", - "charset": "UTF-8", - "compressible": true, - "extensions": ["css"] - }, - "text/csv": { - "source": "iana", - "compressible": true, - "extensions": ["csv"] - }, - "text/csv-schema": { - "source": "iana" - }, - "text/directory": { - "source": "iana" - }, - "text/dns": { - "source": "iana" - }, - "text/ecmascript": { - "source": "iana" - }, - "text/encaprtp": { - "source": "iana" - }, - "text/enriched": { - "source": "iana" - }, - "text/fhirpath": { - "source": "iana" - }, - "text/flexfec": { - "source": "iana" - }, - "text/fwdred": { - "source": "iana" - }, - "text/gff3": { - "source": "iana" - }, - "text/grammar-ref-list": { - "source": "iana" - }, - "text/html": { - "source": "iana", - "compressible": true, - "extensions": ["html","htm","shtml"] - }, - "text/jade": { - "extensions": ["jade"] - }, - "text/javascript": { - "source": "iana", - "compressible": true - }, - "text/jcr-cnd": { - "source": "iana" - }, - "text/jsx": { - "compressible": true, - "extensions": ["jsx"] - }, - "text/less": { - "compressible": true, - "extensions": ["less"] - }, - "text/markdown": { - "source": "iana", - "compressible": true, - "extensions": ["markdown","md"] - }, - "text/mathml": { - "source": "nginx", - "extensions": ["mml"] - }, - "text/mdx": { - "compressible": true, - "extensions": ["mdx"] - }, - "text/mizar": { - "source": "iana" - }, - "text/n3": { - "source": "iana", - "charset": "UTF-8", - "compressible": true, - "extensions": ["n3"] - }, - "text/parameters": { - "source": "iana", - "charset": "UTF-8" - }, - "text/parityfec": { - "source": "iana" - }, - "text/plain": { - "source": "iana", - "compressible": true, - "extensions": ["txt","text","conf","def","list","log","in","ini"] - }, - "text/provenance-notation": { - "source": "iana", - "charset": "UTF-8" - }, - "text/prs.fallenstein.rst": { - "source": "iana" - }, - "text/prs.lines.tag": { - "source": "iana", - "extensions": ["dsc"] - }, - "text/prs.prop.logic": { - "source": "iana" - }, - "text/raptorfec": { - "source": "iana" - }, - "text/red": { - "source": "iana" - }, - "text/rfc822-headers": { - "source": "iana" - }, - "text/richtext": { - "source": "iana", - "compressible": true, - "extensions": ["rtx"] - }, - "text/rtf": { - "source": "iana", - "compressible": true, - "extensions": ["rtf"] - }, - "text/rtp-enc-aescm128": { - "source": "iana" - }, - "text/rtploopback": { - "source": "iana" - }, - "text/rtx": { - "source": "iana" - }, - "text/sgml": { - "source": "iana", - "extensions": ["sgml","sgm"] - }, - "text/shaclc": { - "source": "iana" - }, - "text/shex": { - "source": "iana", - "extensions": ["shex"] - }, - "text/slim": { - "extensions": ["slim","slm"] - }, - "text/spdx": { - "source": "iana", - "extensions": ["spdx"] - }, - "text/strings": { - "source": "iana" - }, - "text/stylus": { - "extensions": ["stylus","styl"] - }, - "text/t140": { - "source": "iana" - }, - "text/tab-separated-values": { - "source": "iana", - "compressible": true, - "extensions": ["tsv"] - }, - "text/troff": { - "source": "iana", - "extensions": ["t","tr","roff","man","me","ms"] - }, - "text/turtle": { - "source": "iana", - "charset": "UTF-8", - "extensions": ["ttl"] - }, - "text/ulpfec": { - "source": "iana" - }, - "text/uri-list": { - "source": "iana", - "compressible": true, - "extensions": ["uri","uris","urls"] - }, - "text/vcard": { - "source": "iana", - "compressible": true, - "extensions": ["vcard"] - }, - "text/vnd.a": { - "source": "iana" - }, - "text/vnd.abc": { - "source": "iana" - }, - "text/vnd.ascii-art": { - "source": "iana" - }, - "text/vnd.curl": { - "source": "iana", - "extensions": ["curl"] - }, - "text/vnd.curl.dcurl": { - "source": "apache", - "extensions": ["dcurl"] - }, - "text/vnd.curl.mcurl": { - "source": "apache", - "extensions": ["mcurl"] - }, - "text/vnd.curl.scurl": { - "source": "apache", - "extensions": ["scurl"] - }, - "text/vnd.debian.copyright": { - "source": "iana", - "charset": "UTF-8" - }, - "text/vnd.dmclientscript": { - "source": "iana" - }, - "text/vnd.dvb.subtitle": { - "source": "iana", - "extensions": ["sub"] - }, - "text/vnd.esmertec.theme-descriptor": { - "source": "iana", - "charset": "UTF-8" - }, - "text/vnd.familysearch.gedcom": { - "source": "iana", - "extensions": ["ged"] - }, - "text/vnd.ficlab.flt": { - "source": "iana" - }, - "text/vnd.fly": { - "source": "iana", - "extensions": ["fly"] - }, - "text/vnd.fmi.flexstor": { - "source": "iana", - "extensions": ["flx"] - }, - "text/vnd.gml": { - "source": "iana" - }, - "text/vnd.graphviz": { - "source": "iana", - "extensions": ["gv"] - }, - "text/vnd.hans": { - "source": "iana" - }, - "text/vnd.hgl": { - "source": "iana" - }, - "text/vnd.in3d.3dml": { - "source": "iana", - "extensions": ["3dml"] - }, - "text/vnd.in3d.spot": { - "source": "iana", - "extensions": ["spot"] - }, - "text/vnd.iptc.newsml": { - "source": "iana" - }, - "text/vnd.iptc.nitf": { - "source": "iana" - }, - "text/vnd.latex-z": { - "source": "iana" - }, - "text/vnd.motorola.reflex": { - "source": "iana" - }, - "text/vnd.ms-mediapackage": { - "source": "iana" - }, - "text/vnd.net2phone.commcenter.command": { - "source": "iana" - }, - "text/vnd.radisys.msml-basic-layout": { - "source": "iana" - }, - "text/vnd.senx.warpscript": { - "source": "iana" - }, - "text/vnd.si.uricatalogue": { - "source": "iana" - }, - "text/vnd.sosi": { - "source": "iana" - }, - "text/vnd.sun.j2me.app-descriptor": { - "source": "iana", - "charset": "UTF-8", - "extensions": ["jad"] - }, - "text/vnd.trolltech.linguist": { - "source": "iana", - "charset": "UTF-8" - }, - "text/vnd.wap.si": { - "source": "iana" - }, - "text/vnd.wap.sl": { - "source": "iana" - }, - "text/vnd.wap.wml": { - "source": "iana", - "extensions": ["wml"] - }, - "text/vnd.wap.wmlscript": { - "source": "iana", - "extensions": ["wmls"] - }, - "text/vtt": { - "source": "iana", - "charset": "UTF-8", - "compressible": true, - "extensions": ["vtt"] - }, - "text/x-asm": { - "source": "apache", - "extensions": ["s","asm"] - }, - "text/x-c": { - "source": "apache", - "extensions": ["c","cc","cxx","cpp","h","hh","dic"] - }, - "text/x-component": { - "source": "nginx", - "extensions": ["htc"] - }, - "text/x-fortran": { - "source": "apache", - "extensions": ["f","for","f77","f90"] - }, - "text/x-gwt-rpc": { - "compressible": true - }, - "text/x-handlebars-template": { - "extensions": ["hbs"] - }, - "text/x-java-source": { - "source": "apache", - "extensions": ["java"] - }, - "text/x-jquery-tmpl": { - "compressible": true - }, - "text/x-lua": { - "extensions": ["lua"] - }, - "text/x-markdown": { - "compressible": true, - "extensions": ["mkd"] - }, - "text/x-nfo": { - "source": "apache", - "extensions": ["nfo"] - }, - "text/x-opml": { - "source": "apache", - "extensions": ["opml"] - }, - "text/x-org": { - "compressible": true, - "extensions": ["org"] - }, - "text/x-pascal": { - "source": "apache", - "extensions": ["p","pas"] - }, - "text/x-processing": { - "compressible": true, - "extensions": ["pde"] - }, - "text/x-sass": { - "extensions": ["sass"] - }, - "text/x-scss": { - "extensions": ["scss"] - }, - "text/x-setext": { - "source": "apache", - "extensions": ["etx"] - }, - "text/x-sfv": { - "source": "apache", - "extensions": ["sfv"] - }, - "text/x-suse-ymp": { - "compressible": true, - "extensions": ["ymp"] - }, - "text/x-uuencode": { - "source": "apache", - "extensions": ["uu"] - }, - "text/x-vcalendar": { - "source": "apache", - "extensions": ["vcs"] - }, - "text/x-vcard": { - "source": "apache", - "extensions": ["vcf"] - }, - "text/xml": { - "source": "iana", - "compressible": true, - "extensions": ["xml"] - }, - "text/xml-external-parsed-entity": { - "source": "iana" - }, - "text/yaml": { - "compressible": true, - "extensions": ["yaml","yml"] - }, - "video/1d-interleaved-parityfec": { - "source": "iana" - }, - "video/3gpp": { - "source": "iana", - "extensions": ["3gp","3gpp"] - }, - "video/3gpp-tt": { - "source": "iana" - }, - "video/3gpp2": { - "source": "iana", - "extensions": ["3g2"] - }, - "video/av1": { - "source": "iana" - }, - "video/bmpeg": { - "source": "iana" - }, - "video/bt656": { - "source": "iana" - }, - "video/celb": { - "source": "iana" - }, - "video/dv": { - "source": "iana" - }, - "video/encaprtp": { - "source": "iana" - }, - "video/ffv1": { - "source": "iana" - }, - "video/flexfec": { - "source": "iana" - }, - "video/h261": { - "source": "iana", - "extensions": ["h261"] - }, - "video/h263": { - "source": "iana", - "extensions": ["h263"] - }, - "video/h263-1998": { - "source": "iana" - }, - "video/h263-2000": { - "source": "iana" - }, - "video/h264": { - "source": "iana", - "extensions": ["h264"] - }, - "video/h264-rcdo": { - "source": "iana" - }, - "video/h264-svc": { - "source": "iana" - }, - "video/h265": { - "source": "iana" - }, - "video/iso.segment": { - "source": "iana", - "extensions": ["m4s"] - }, - "video/jpeg": { - "source": "iana", - "extensions": ["jpgv"] - }, - "video/jpeg2000": { - "source": "iana" - }, - "video/jpm": { - "source": "apache", - "extensions": ["jpm","jpgm"] - }, - "video/jxsv": { - "source": "iana" - }, - "video/mj2": { - "source": "iana", - "extensions": ["mj2","mjp2"] - }, - "video/mp1s": { - "source": "iana" - }, - "video/mp2p": { - "source": "iana" - }, - "video/mp2t": { - "source": "iana", - "extensions": ["ts"] - }, - "video/mp4": { - "source": "iana", - "compressible": false, - "extensions": ["mp4","mp4v","mpg4"] - }, - "video/mp4v-es": { - "source": "iana" - }, - "video/mpeg": { - "source": "iana", - "compressible": false, - "extensions": ["mpeg","mpg","mpe","m1v","m2v"] - }, - "video/mpeg4-generic": { - "source": "iana" - }, - "video/mpv": { - "source": "iana" - }, - "video/nv": { - "source": "iana" - }, - "video/ogg": { - "source": "iana", - "compressible": false, - "extensions": ["ogv"] - }, - "video/parityfec": { - "source": "iana" - }, - "video/pointer": { - "source": "iana" - }, - "video/quicktime": { - "source": "iana", - "compressible": false, - "extensions": ["qt","mov"] - }, - "video/raptorfec": { - "source": "iana" - }, - "video/raw": { - "source": "iana" - }, - "video/rtp-enc-aescm128": { - "source": "iana" - }, - "video/rtploopback": { - "source": "iana" - }, - "video/rtx": { - "source": "iana" - }, - "video/scip": { - "source": "iana" - }, - "video/smpte291": { - "source": "iana" - }, - "video/smpte292m": { - "source": "iana" - }, - "video/ulpfec": { - "source": "iana" - }, - "video/vc1": { - "source": "iana" - }, - "video/vc2": { - "source": "iana" - }, - "video/vnd.cctv": { - "source": "iana" - }, - "video/vnd.dece.hd": { - "source": "iana", - "extensions": ["uvh","uvvh"] - }, - "video/vnd.dece.mobile": { - "source": "iana", - "extensions": ["uvm","uvvm"] - }, - "video/vnd.dece.mp4": { - "source": "iana" - }, - "video/vnd.dece.pd": { - "source": "iana", - "extensions": ["uvp","uvvp"] - }, - "video/vnd.dece.sd": { - "source": "iana", - "extensions": ["uvs","uvvs"] - }, - "video/vnd.dece.video": { - "source": "iana", - "extensions": ["uvv","uvvv"] - }, - "video/vnd.directv.mpeg": { - "source": "iana" - }, - "video/vnd.directv.mpeg-tts": { - "source": "iana" - }, - "video/vnd.dlna.mpeg-tts": { - "source": "iana" - }, - "video/vnd.dvb.file": { - "source": "iana", - "extensions": ["dvb"] - }, - "video/vnd.fvt": { - "source": "iana", - "extensions": ["fvt"] - }, - "video/vnd.hns.video": { - "source": "iana" - }, - "video/vnd.iptvforum.1dparityfec-1010": { - "source": "iana" - }, - "video/vnd.iptvforum.1dparityfec-2005": { - "source": "iana" - }, - "video/vnd.iptvforum.2dparityfec-1010": { - "source": "iana" - }, - "video/vnd.iptvforum.2dparityfec-2005": { - "source": "iana" - }, - "video/vnd.iptvforum.ttsavc": { - "source": "iana" - }, - "video/vnd.iptvforum.ttsmpeg2": { - "source": "iana" - }, - "video/vnd.motorola.video": { - "source": "iana" - }, - "video/vnd.motorola.videop": { - "source": "iana" - }, - "video/vnd.mpegurl": { - "source": "iana", - "extensions": ["mxu","m4u"] - }, - "video/vnd.ms-playready.media.pyv": { - "source": "iana", - "extensions": ["pyv"] - }, - "video/vnd.nokia.interleaved-multimedia": { - "source": "iana" - }, - "video/vnd.nokia.mp4vr": { - "source": "iana" - }, - "video/vnd.nokia.videovoip": { - "source": "iana" - }, - "video/vnd.objectvideo": { - "source": "iana" - }, - "video/vnd.radgamettools.bink": { - "source": "iana" - }, - "video/vnd.radgamettools.smacker": { - "source": "iana" - }, - "video/vnd.sealed.mpeg1": { - "source": "iana" - }, - "video/vnd.sealed.mpeg4": { - "source": "iana" - }, - "video/vnd.sealed.swf": { - "source": "iana" - }, - "video/vnd.sealedmedia.softseal.mov": { - "source": "iana" - }, - "video/vnd.uvvu.mp4": { - "source": "iana", - "extensions": ["uvu","uvvu"] - }, - "video/vnd.vivo": { - "source": "iana", - "extensions": ["viv"] - }, - "video/vnd.youtube.yt": { - "source": "iana" - }, - "video/vp8": { - "source": "iana" - }, - "video/vp9": { - "source": "iana" - }, - "video/webm": { - "source": "apache", - "compressible": false, - "extensions": ["webm"] - }, - "video/x-f4v": { - "source": "apache", - "extensions": ["f4v"] - }, - "video/x-fli": { - "source": "apache", - "extensions": ["fli"] - }, - "video/x-flv": { - "source": "apache", - "compressible": false, - "extensions": ["flv"] - }, - "video/x-m4v": { - "source": "apache", - "extensions": ["m4v"] - }, - "video/x-matroska": { - "source": "apache", - "compressible": false, - "extensions": ["mkv","mk3d","mks"] - }, - "video/x-mng": { - "source": "apache", - "extensions": ["mng"] - }, - "video/x-ms-asf": { - "source": "apache", - "extensions": ["asf","asx"] - }, - "video/x-ms-vob": { - "source": "apache", - "extensions": ["vob"] - }, - "video/x-ms-wm": { - "source": "apache", - "extensions": ["wm"] - }, - "video/x-ms-wmv": { - "source": "apache", - "compressible": false, - "extensions": ["wmv"] - }, - "video/x-ms-wmx": { - "source": "apache", - "extensions": ["wmx"] - }, - "video/x-ms-wvx": { - "source": "apache", - "extensions": ["wvx"] - }, - "video/x-msvideo": { - "source": "apache", - "extensions": ["avi"] - }, - "video/x-sgi-movie": { - "source": "apache", - "extensions": ["movie"] - }, - "video/x-smv": { - "source": "apache", - "extensions": ["smv"] - }, - "x-conference/x-cooltalk": { - "source": "apache", - "extensions": ["ice"] - }, - "x-shader/x-fragment": { - "compressible": true - }, - "x-shader/x-vertex": { - "compressible": true - } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/mime-db/index.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/mime-db/index.js deleted file mode 100644 index ec2be30d..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/mime-db/index.js +++ /dev/null @@ -1,12 +0,0 @@ -/*! - * mime-db - * Copyright(c) 2014 Jonathan Ong - * Copyright(c) 2015-2022 Douglas Christopher Wilson - * MIT Licensed - */ - -/** - * Module exports. - */ - -module.exports = require('./db.json') diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/mime-db/package.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/mime-db/package.json deleted file mode 100644 index 32c14b84..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/mime-db/package.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "name": "mime-db", - "description": "Media Type Database", - "version": "1.52.0", - "contributors": [ - "Douglas Christopher Wilson ", - "Jonathan Ong (http://jongleberry.com)", - "Robert Kieffer (http://github.com/broofa)" - ], - "license": "MIT", - "keywords": [ - "mime", - "db", - "type", - "types", - "database", - "charset", - "charsets" - ], - "repository": "jshttp/mime-db", - "devDependencies": { - "bluebird": "3.7.2", - "co": "4.6.0", - "cogent": "1.0.1", - "csv-parse": "4.16.3", - "eslint": "7.32.0", - "eslint-config-standard": "15.0.1", - "eslint-plugin-import": "2.25.4", - "eslint-plugin-markdown": "2.2.1", - "eslint-plugin-node": "11.1.0", - "eslint-plugin-promise": "5.1.1", - "eslint-plugin-standard": "4.1.0", - "gnode": "0.1.2", - "media-typer": "1.1.0", - "mocha": "9.2.1", - "nyc": "15.1.0", - "raw-body": "2.5.0", - "stream-to-array": "2.3.0" - }, - "files": [ - "HISTORY.md", - "LICENSE", - "README.md", - "db.json", - "index.js" - ], - "engines": { - "node": ">= 0.6" - }, - "scripts": { - "build": "node scripts/build", - "fetch": "node scripts/fetch-apache && gnode scripts/fetch-iana && node scripts/fetch-nginx", - "lint": "eslint .", - "test": "mocha --reporter spec --bail --check-leaks test/", - "test-ci": "nyc --reporter=lcov --reporter=text npm test", - "test-cov": "nyc --reporter=html --reporter=text npm test", - "update": "npm run fetch && npm run build", - "version": "node scripts/version-history.js && git add HISTORY.md" - } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/mime-types/HISTORY.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/mime-types/HISTORY.md deleted file mode 100644 index c5043b75..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/mime-types/HISTORY.md +++ /dev/null @@ -1,397 +0,0 @@ -2.1.35 / 2022-03-12 -=================== - - * deps: mime-db@1.52.0 - - Add extensions from IANA for more `image/*` types - - Add extension `.asc` to `application/pgp-keys` - - Add extensions to various XML types - - Add new upstream MIME types - -2.1.34 / 2021-11-08 -=================== - - * deps: mime-db@1.51.0 - - Add new upstream MIME types - -2.1.33 / 2021-10-01 -=================== - - * deps: mime-db@1.50.0 - - Add deprecated iWorks mime types and extensions - - Add new upstream MIME types - -2.1.32 / 2021-07-27 -=================== - - * deps: mime-db@1.49.0 - - Add extension `.trig` to `application/trig` - - Add new upstream MIME types - -2.1.31 / 2021-06-01 -=================== - - * deps: mime-db@1.48.0 - - Add extension `.mvt` to `application/vnd.mapbox-vector-tile` - - Add new upstream MIME types - -2.1.30 / 2021-04-02 -=================== - - * deps: mime-db@1.47.0 - - Add extension `.amr` to `audio/amr` - - Remove ambigious extensions from IANA for `application/*+xml` types - - Update primary extension to `.es` for `application/ecmascript` - -2.1.29 / 2021-02-17 -=================== - - * deps: mime-db@1.46.0 - - Add extension `.amr` to `audio/amr` - - Add extension `.m4s` to `video/iso.segment` - - Add extension `.opus` to `audio/ogg` - - Add new upstream MIME types - -2.1.28 / 2021-01-01 -=================== - - * deps: mime-db@1.45.0 - - Add `application/ubjson` with extension `.ubj` - - Add `image/avif` with extension `.avif` - - Add `image/ktx2` with extension `.ktx2` - - Add extension `.dbf` to `application/vnd.dbf` - - Add extension `.rar` to `application/vnd.rar` - - Add extension `.td` to `application/urc-targetdesc+xml` - - Add new upstream MIME types - - Fix extension of `application/vnd.apple.keynote` to be `.key` - -2.1.27 / 2020-04-23 -=================== - - * deps: mime-db@1.44.0 - - Add charsets from IANA - - Add extension `.cjs` to `application/node` - - Add new upstream MIME types - -2.1.26 / 2020-01-05 -=================== - - * deps: mime-db@1.43.0 - - Add `application/x-keepass2` with extension `.kdbx` - - Add extension `.mxmf` to `audio/mobile-xmf` - - Add extensions from IANA for `application/*+xml` types - - Add new upstream MIME types - -2.1.25 / 2019-11-12 -=================== - - * deps: mime-db@1.42.0 - - Add new upstream MIME types - - Add `application/toml` with extension `.toml` - - Add `image/vnd.ms-dds` with extension `.dds` - -2.1.24 / 2019-04-20 -=================== - - * deps: mime-db@1.40.0 - - Add extensions from IANA for `model/*` types - - Add `text/mdx` with extension `.mdx` - -2.1.23 / 2019-04-17 -=================== - - * deps: mime-db@~1.39.0 - - Add extensions `.siv` and `.sieve` to `application/sieve` - - Add new upstream MIME types - -2.1.22 / 2019-02-14 -=================== - - * deps: mime-db@~1.38.0 - - Add extension `.nq` to `application/n-quads` - - Add extension `.nt` to `application/n-triples` - - Add new upstream MIME types - -2.1.21 / 2018-10-19 -=================== - - * deps: mime-db@~1.37.0 - - Add extensions to HEIC image types - - Add new upstream MIME types - -2.1.20 / 2018-08-26 -=================== - - * deps: mime-db@~1.36.0 - - Add Apple file extensions from IANA - - Add extensions from IANA for `image/*` types - - Add new upstream MIME types - -2.1.19 / 2018-07-17 -=================== - - * deps: mime-db@~1.35.0 - - Add extension `.csl` to `application/vnd.citationstyles.style+xml` - - Add extension `.es` to `application/ecmascript` - - Add extension `.owl` to `application/rdf+xml` - - Add new upstream MIME types - - Add UTF-8 as default charset for `text/turtle` - -2.1.18 / 2018-02-16 -=================== - - * deps: mime-db@~1.33.0 - - Add `application/raml+yaml` with extension `.raml` - - Add `application/wasm` with extension `.wasm` - - Add `text/shex` with extension `.shex` - - Add extensions for JPEG-2000 images - - Add extensions from IANA for `message/*` types - - Add new upstream MIME types - - Update font MIME types - - Update `text/hjson` to registered `application/hjson` - -2.1.17 / 2017-09-01 -=================== - - * deps: mime-db@~1.30.0 - - Add `application/vnd.ms-outlook` - - Add `application/x-arj` - - Add extension `.mjs` to `application/javascript` - - Add glTF types and extensions - - Add new upstream MIME types - - Add `text/x-org` - - Add VirtualBox MIME types - - Fix `source` records for `video/*` types that are IANA - - Update `font/opentype` to registered `font/otf` - -2.1.16 / 2017-07-24 -=================== - - * deps: mime-db@~1.29.0 - - Add `application/fido.trusted-apps+json` - - Add extension `.wadl` to `application/vnd.sun.wadl+xml` - - Add extension `.gz` to `application/gzip` - - Add new upstream MIME types - - Update extensions `.md` and `.markdown` to be `text/markdown` - -2.1.15 / 2017-03-23 -=================== - - * deps: mime-db@~1.27.0 - - Add new mime types - - Add `image/apng` - -2.1.14 / 2017-01-14 -=================== - - * deps: mime-db@~1.26.0 - - Add new mime types - -2.1.13 / 2016-11-18 -=================== - - * deps: mime-db@~1.25.0 - - Add new mime types - -2.1.12 / 2016-09-18 -=================== - - * deps: mime-db@~1.24.0 - - Add new mime types - - Add `audio/mp3` - -2.1.11 / 2016-05-01 -=================== - - * deps: mime-db@~1.23.0 - - Add new mime types - -2.1.10 / 2016-02-15 -=================== - - * deps: mime-db@~1.22.0 - - Add new mime types - - Fix extension of `application/dash+xml` - - Update primary extension for `audio/mp4` - -2.1.9 / 2016-01-06 -================== - - * deps: mime-db@~1.21.0 - - Add new mime types - -2.1.8 / 2015-11-30 -================== - - * deps: mime-db@~1.20.0 - - Add new mime types - -2.1.7 / 2015-09-20 -================== - - * deps: mime-db@~1.19.0 - - Add new mime types - -2.1.6 / 2015-09-03 -================== - - * deps: mime-db@~1.18.0 - - Add new mime types - -2.1.5 / 2015-08-20 -================== - - * deps: mime-db@~1.17.0 - - Add new mime types - -2.1.4 / 2015-07-30 -================== - - * deps: mime-db@~1.16.0 - - Add new mime types - -2.1.3 / 2015-07-13 -================== - - * deps: mime-db@~1.15.0 - - Add new mime types - -2.1.2 / 2015-06-25 -================== - - * deps: mime-db@~1.14.0 - - Add new mime types - -2.1.1 / 2015-06-08 -================== - - * perf: fix deopt during mapping - -2.1.0 / 2015-06-07 -================== - - * Fix incorrectly treating extension-less file name as extension - - i.e. `'path/to/json'` will no longer return `application/json` - * Fix `.charset(type)` to accept parameters - * Fix `.charset(type)` to match case-insensitive - * Improve generation of extension to MIME mapping - * Refactor internals for readability and no argument reassignment - * Prefer `application/*` MIME types from the same source - * Prefer any type over `application/octet-stream` - * deps: mime-db@~1.13.0 - - Add nginx as a source - - Add new mime types - -2.0.14 / 2015-06-06 -=================== - - * deps: mime-db@~1.12.0 - - Add new mime types - -2.0.13 / 2015-05-31 -=================== - - * deps: mime-db@~1.11.0 - - Add new mime types - -2.0.12 / 2015-05-19 -=================== - - * deps: mime-db@~1.10.0 - - Add new mime types - -2.0.11 / 2015-05-05 -=================== - - * deps: mime-db@~1.9.1 - - Add new mime types - -2.0.10 / 2015-03-13 -=================== - - * deps: mime-db@~1.8.0 - - Add new mime types - -2.0.9 / 2015-02-09 -================== - - * deps: mime-db@~1.7.0 - - Add new mime types - - Community extensions ownership transferred from `node-mime` - -2.0.8 / 2015-01-29 -================== - - * deps: mime-db@~1.6.0 - - Add new mime types - -2.0.7 / 2014-12-30 -================== - - * deps: mime-db@~1.5.0 - - Add new mime types - - Fix various invalid MIME type entries - -2.0.6 / 2014-12-30 -================== - - * deps: mime-db@~1.4.0 - - Add new mime types - - Fix various invalid MIME type entries - - Remove example template MIME types - -2.0.5 / 2014-12-29 -================== - - * deps: mime-db@~1.3.1 - - Fix missing extensions - -2.0.4 / 2014-12-10 -================== - - * deps: mime-db@~1.3.0 - - Add new mime types - -2.0.3 / 2014-11-09 -================== - - * deps: mime-db@~1.2.0 - - Add new mime types - -2.0.2 / 2014-09-28 -================== - - * deps: mime-db@~1.1.0 - - Add new mime types - - Update charsets - -2.0.1 / 2014-09-07 -================== - - * Support Node.js 0.6 - -2.0.0 / 2014-09-02 -================== - - * Use `mime-db` - * Remove `.define()` - -1.0.2 / 2014-08-04 -================== - - * Set charset=utf-8 for `text/javascript` - -1.0.1 / 2014-06-24 -================== - - * Add `text/jsx` type - -1.0.0 / 2014-05-12 -================== - - * Return `false` for unknown types - * Set charset=utf-8 for `application/json` - -0.1.0 / 2014-05-02 -================== - - * Initial release diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/mime-types/LICENSE b/packages/wyatt_notification_bloc/example/scripts/node_modules/mime-types/LICENSE deleted file mode 100644 index 06166077..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/mime-types/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -(The MIT License) - -Copyright (c) 2014 Jonathan Ong -Copyright (c) 2015 Douglas Christopher Wilson - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -'Software'), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/mime-types/README.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/mime-types/README.md deleted file mode 100644 index 48d2fb47..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/mime-types/README.md +++ /dev/null @@ -1,113 +0,0 @@ -# mime-types - -[![NPM Version][npm-version-image]][npm-url] -[![NPM Downloads][npm-downloads-image]][npm-url] -[![Node.js Version][node-version-image]][node-version-url] -[![Build Status][ci-image]][ci-url] -[![Test Coverage][coveralls-image]][coveralls-url] - -The ultimate javascript content-type utility. - -Similar to [the `mime@1.x` module](https://www.npmjs.com/package/mime), except: - -- __No fallbacks.__ Instead of naively returning the first available type, - `mime-types` simply returns `false`, so do - `var type = mime.lookup('unrecognized') || 'application/octet-stream'`. -- No `new Mime()` business, so you could do `var lookup = require('mime-types').lookup`. -- No `.define()` functionality -- Bug fixes for `.lookup(path)` - -Otherwise, the API is compatible with `mime` 1.x. - -## Install - -This is a [Node.js](https://nodejs.org/en/) module available through the -[npm registry](https://www.npmjs.com/). Installation is done using the -[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally): - -```sh -$ npm install mime-types -``` - -## Adding Types - -All mime types are based on [mime-db](https://www.npmjs.com/package/mime-db), -so open a PR there if you'd like to add mime types. - -## API - -```js -var mime = require('mime-types') -``` - -All functions return `false` if input is invalid or not found. - -### mime.lookup(path) - -Lookup the content-type associated with a file. - -```js -mime.lookup('json') // 'application/json' -mime.lookup('.md') // 'text/markdown' -mime.lookup('file.html') // 'text/html' -mime.lookup('folder/file.js') // 'application/javascript' -mime.lookup('folder/.htaccess') // false - -mime.lookup('cats') // false -``` - -### mime.contentType(type) - -Create a full content-type header given a content-type or extension. -When given an extension, `mime.lookup` is used to get the matching -content-type, otherwise the given content-type is used. Then if the -content-type does not already have a `charset` parameter, `mime.charset` -is used to get the default charset and add to the returned content-type. - -```js -mime.contentType('markdown') // 'text/x-markdown; charset=utf-8' -mime.contentType('file.json') // 'application/json; charset=utf-8' -mime.contentType('text/html') // 'text/html; charset=utf-8' -mime.contentType('text/html; charset=iso-8859-1') // 'text/html; charset=iso-8859-1' - -// from a full path -mime.contentType(path.extname('/path/to/file.json')) // 'application/json; charset=utf-8' -``` - -### mime.extension(type) - -Get the default extension for a content-type. - -```js -mime.extension('application/octet-stream') // 'bin' -``` - -### mime.charset(type) - -Lookup the implied default charset of a content-type. - -```js -mime.charset('text/markdown') // 'UTF-8' -``` - -### var type = mime.types[extension] - -A map of content-types by extension. - -### [extensions...] = mime.extensions[type] - -A map of extensions by content-type. - -## License - -[MIT](LICENSE) - -[ci-image]: https://badgen.net/github/checks/jshttp/mime-types/master?label=ci -[ci-url]: https://github.com/jshttp/mime-types/actions/workflows/ci.yml -[coveralls-image]: https://badgen.net/coveralls/c/github/jshttp/mime-types/master -[coveralls-url]: https://coveralls.io/r/jshttp/mime-types?branch=master -[node-version-image]: https://badgen.net/npm/node/mime-types -[node-version-url]: https://nodejs.org/en/download -[npm-downloads-image]: https://badgen.net/npm/dm/mime-types -[npm-url]: https://npmjs.org/package/mime-types -[npm-version-image]: https://badgen.net/npm/v/mime-types diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/mime-types/index.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/mime-types/index.js deleted file mode 100644 index b9f34d59..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/mime-types/index.js +++ /dev/null @@ -1,188 +0,0 @@ -/*! - * mime-types - * Copyright(c) 2014 Jonathan Ong - * Copyright(c) 2015 Douglas Christopher Wilson - * MIT Licensed - */ - -'use strict' - -/** - * Module dependencies. - * @private - */ - -var db = require('mime-db') -var extname = require('path').extname - -/** - * Module variables. - * @private - */ - -var EXTRACT_TYPE_REGEXP = /^\s*([^;\s]*)(?:;|\s|$)/ -var TEXT_TYPE_REGEXP = /^text\//i - -/** - * Module exports. - * @public - */ - -exports.charset = charset -exports.charsets = { lookup: charset } -exports.contentType = contentType -exports.extension = extension -exports.extensions = Object.create(null) -exports.lookup = lookup -exports.types = Object.create(null) - -// Populate the extensions/types maps -populateMaps(exports.extensions, exports.types) - -/** - * Get the default charset for a MIME type. - * - * @param {string} type - * @return {boolean|string} - */ - -function charset (type) { - if (!type || typeof type !== 'string') { - return false - } - - // TODO: use media-typer - var match = EXTRACT_TYPE_REGEXP.exec(type) - var mime = match && db[match[1].toLowerCase()] - - if (mime && mime.charset) { - return mime.charset - } - - // default text/* to utf-8 - if (match && TEXT_TYPE_REGEXP.test(match[1])) { - return 'UTF-8' - } - - return false -} - -/** - * Create a full Content-Type header given a MIME type or extension. - * - * @param {string} str - * @return {boolean|string} - */ - -function contentType (str) { - // TODO: should this even be in this module? - if (!str || typeof str !== 'string') { - return false - } - - var mime = str.indexOf('/') === -1 - ? exports.lookup(str) - : str - - if (!mime) { - return false - } - - // TODO: use content-type or other module - if (mime.indexOf('charset') === -1) { - var charset = exports.charset(mime) - if (charset) mime += '; charset=' + charset.toLowerCase() - } - - return mime -} - -/** - * Get the default extension for a MIME type. - * - * @param {string} type - * @return {boolean|string} - */ - -function extension (type) { - if (!type || typeof type !== 'string') { - return false - } - - // TODO: use media-typer - var match = EXTRACT_TYPE_REGEXP.exec(type) - - // get extensions - var exts = match && exports.extensions[match[1].toLowerCase()] - - if (!exts || !exts.length) { - return false - } - - return exts[0] -} - -/** - * Lookup the MIME type for a file path/extension. - * - * @param {string} path - * @return {boolean|string} - */ - -function lookup (path) { - if (!path || typeof path !== 'string') { - return false - } - - // get the extension ("ext" or ".ext" or full path) - var extension = extname('x.' + path) - .toLowerCase() - .substr(1) - - if (!extension) { - return false - } - - return exports.types[extension] || false -} - -/** - * Populate the extensions and types maps. - * @private - */ - -function populateMaps (extensions, types) { - // source preference (least -> most) - var preference = ['nginx', 'apache', undefined, 'iana'] - - Object.keys(db).forEach(function forEachMimeType (type) { - var mime = db[type] - var exts = mime.extensions - - if (!exts || !exts.length) { - return - } - - // mime -> extensions - extensions[type] = exts - - // extension -> mime - for (var i = 0; i < exts.length; i++) { - var extension = exts[i] - - if (types[extension]) { - var from = preference.indexOf(db[types[extension]].source) - var to = preference.indexOf(mime.source) - - if (types[extension] !== 'application/octet-stream' && - (from > to || (from === to && types[extension].substr(0, 12) === 'application/'))) { - // skip the remapping - continue - } - } - - // set the extension -> mime - types[extension] = type - } - }) -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/mime-types/package.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/mime-types/package.json deleted file mode 100644 index bbef6964..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/mime-types/package.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "name": "mime-types", - "description": "The ultimate javascript content-type utility.", - "version": "2.1.35", - "contributors": [ - "Douglas Christopher Wilson ", - "Jeremiah Senkpiel (https://searchbeam.jit.su)", - "Jonathan Ong (http://jongleberry.com)" - ], - "license": "MIT", - "keywords": [ - "mime", - "types" - ], - "repository": "jshttp/mime-types", - "dependencies": { - "mime-db": "1.52.0" - }, - "devDependencies": { - "eslint": "7.32.0", - "eslint-config-standard": "14.1.1", - "eslint-plugin-import": "2.25.4", - "eslint-plugin-markdown": "2.2.1", - "eslint-plugin-node": "11.1.0", - "eslint-plugin-promise": "5.2.0", - "eslint-plugin-standard": "4.1.0", - "mocha": "9.2.2", - "nyc": "15.1.0" - }, - "files": [ - "HISTORY.md", - "LICENSE", - "index.js" - ], - "engines": { - "node": ">= 0.6" - }, - "scripts": { - "lint": "eslint .", - "test": "mocha --reporter spec test/test.js", - "test-ci": "nyc --reporter=lcov --reporter=text npm test", - "test-cov": "nyc --reporter=html --reporter=text npm test" - } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/mime/CHANGELOG.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/mime/CHANGELOG.md deleted file mode 100644 index cdf9be58..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/mime/CHANGELOG.md +++ /dev/null @@ -1,312 +0,0 @@ -# Changelog - -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. - -## [3.0.0](https://github.com/broofa/mime/compare/v2.6.0...v3.0.0) (2021-11-03) - - -### ⚠ BREAKING CHANGES - -* drop support for node < 10.x - -### Bug Fixes - -* skypack.dev for direct browser import, fixes [#263](https://github.com/broofa/mime/issues/263) ([41db4c0](https://github.com/broofa/mime/commit/41db4c042ccf50ea7baf3d2160ea37dcca37998d)) - - -### update - -* drop support for node < 10.x ([8857363](https://github.com/broofa/mime/commit/8857363ae0446ed0229b17291cf4483cf801f0d0)) - -## [2.6.0](https://github.com/broofa/mime/compare/v2.5.2...v2.6.0) (2021-11-02) - - -### Features - -* mime-db@1.50.0 ([cef0cc4](https://github.com/broofa/mime/commit/cef0cc484ff6d05ff1e12b54ca3e8b856fbc14d8)) - -### [2.5.2](https://github.com/broofa/mime/compare/v2.5.0...v2.5.2) (2021-02-17) - - -### Bug Fixes - -* update to mime-db@1.46.0, fixes [#253](https://github.com/broofa/mime/issues/253) ([f10e6aa](https://github.com/broofa/mime/commit/f10e6aa62e1356de7e2491d7fb4374c8dac65800)) - -## [2.5.0](https://github.com/broofa/mime/compare/v2.4.7...v2.5.0) (2021-01-16) - - -### Features - -* improved CLI ([#244](https://github.com/broofa/mime/issues/244)) ([c8a8356](https://github.com/broofa/mime/commit/c8a8356e3b27f3ef46b64b89b428fdb547b14d5f)) - -### [2.4.7](https://github.com/broofa/mime/compare/v2.4.6...v2.4.7) (2020-12-16) - - -### Bug Fixes - -* update to latest mime-db ([43b09ef](https://github.com/broofa/mime/commit/43b09eff0233eacc449af2b1f99a19ba9e104a44)) - -### [2.4.6](https://github.com/broofa/mime/compare/v2.4.5...v2.4.6) (2020-05-27) - - -### Bug Fixes - -* add cli.js to package.json files ([#237](https://github.com/broofa/mime/issues/237)) ([6c070bc](https://github.com/broofa/mime/commit/6c070bc298fa12a48e2ed126fbb9de641a1e7ebc)) - -### [2.4.5](https://github.com/broofa/mime/compare/v2.4.4...v2.4.5) (2020-05-01) - - -### Bug Fixes - -* fix [#236](https://github.com/broofa/mime/issues/236) ([7f4ecd0](https://github.com/broofa/mime/commit/7f4ecd0d850ed22c9e3bfda2c11fc74e4dde12a7)) -* update to latest mime-db ([c5cb3f2](https://github.com/broofa/mime/commit/c5cb3f2ab8b07642a066efbde1142af1b90c927b)) - -### [2.4.4](https://github.com/broofa/mime/compare/v2.4.3...v2.4.4) (2019-06-07) - - - -### [2.4.3](https://github.com/broofa/mime/compare/v2.4.2...v2.4.3) (2019-05-15) - - - -### [2.4.2](https://github.com/broofa/mime/compare/v2.4.1...v2.4.2) (2019-04-07) - - -### Bug Fixes - -* don't use arrow function introduced in 2.4.1 ([2e00b5c](https://github.com/broofa/mime/commit/2e00b5c)) - - - -### [2.4.1](https://github.com/broofa/mime/compare/v2.4.0...v2.4.1) (2019-04-03) - - -### Bug Fixes - -* update MDN and mime-db types ([3e567a9](https://github.com/broofa/mime/commit/3e567a9)) - - - -# [2.4.0](https://github.com/broofa/mime/compare/v2.3.1...v2.4.0) (2018-11-26) - - -### Features - -* Bind exported methods ([9d2a7b8](https://github.com/broofa/mime/commit/9d2a7b8)) -* update to mime-db@1.37.0 ([49e6e41](https://github.com/broofa/mime/commit/49e6e41)) - - - -### [2.3.1](https://github.com/broofa/mime/compare/v2.3.0...v2.3.1) (2018-04-11) - - -### Bug Fixes - -* fix [#198](https://github.com/broofa/mime/issues/198) ([25ca180](https://github.com/broofa/mime/commit/25ca180)) - - - -# [2.3.0](https://github.com/broofa/mime/compare/v2.2.2...v2.3.0) (2018-04-11) - - -### Bug Fixes - -* fix [#192](https://github.com/broofa/mime/issues/192) ([5c35df6](https://github.com/broofa/mime/commit/5c35df6)) - - -### Features - -* add travis-ci testing ([d64160f](https://github.com/broofa/mime/commit/d64160f)) - - - -### [2.2.2](https://github.com/broofa/mime/compare/v2.2.1...v2.2.2) (2018-03-30) - - -### Bug Fixes - -* update types files to mime-db@1.32.0 ([85aac16](https://github.com/broofa/mime/commit/85aac16)) - - -### [2.2.1](https://github.com/broofa/mime/compare/v2.2.0...v2.2.1) (2018-03-30) - - -### Bug Fixes - -* Retain type->extension mappings for non-default types. Fixes [#180](https://github.com/broofa/mime/issues/180) ([b5c83fb](https://github.com/broofa/mime/commit/b5c83fb)) - - - -# [2.2.0](https://github.com/broofa/mime/compare/v2.1.0...v2.2.0) (2018-01-04) - - -### Features - -* Retain type->extension mappings for non-default types. Fixes [#180](https://github.com/broofa/mime/issues/180) ([10f82ac](https://github.com/broofa/mime/commit/10f82ac)) - - - -# [2.1.0](https://github.com/broofa/mime/compare/v2.0.5...v2.1.0) (2017-12-22) - - -### Features - -* Upgrade to mime-db@1.32.0. Fixes [#185](https://github.com/broofa/mime/issues/185) ([3f775ba](https://github.com/broofa/mime/commit/3f775ba)) - - - -### [2.0.5](https://github.com/broofa/mime/compare/v2.0.1...v2.0.5) (2017-12-22) - - -### Bug Fixes - -* ES5 support (back to node v0.4) ([f14ccb6](https://github.com/broofa/mime/commit/f14ccb6)) - - - -# Changelog - -### v2.0.4 (24/11/2017) -- [**closed**] Switch to mime-score module for resolving extension contention issues. [#182](https://github.com/broofa/mime/issues/182) -- [**closed**] Update mime-db to 1.31.0 in v1.x branch [#181](https://github.com/broofa/mime/issues/181) - ---- - -## v1.5.0 (22/11/2017) -- [**closed**] need ES5 version ready in npm package [#179](https://github.com/broofa/mime/issues/179) -- [**closed**] mime-db no trace of iWork - pages / numbers / etc. [#178](https://github.com/broofa/mime/issues/178) -- [**closed**] How it works in brownser ? [#176](https://github.com/broofa/mime/issues/176) -- [**closed**] Missing `./Mime` [#175](https://github.com/broofa/mime/issues/175) -- [**closed**] Vulnerable Regular Expression [#167](https://github.com/broofa/mime/issues/167) - ---- - -### v2.0.3 (25/09/2017) -*No changelog for this release.* - ---- - -### v1.4.1 (25/09/2017) -- [**closed**] Issue when bundling with webpack [#172](https://github.com/broofa/mime/issues/172) - ---- - -### v2.0.2 (15/09/2017) -- [**V2**] fs.readFileSync is not a function [#165](https://github.com/broofa/mime/issues/165) -- [**closed**] The extension for video/quicktime should map to .mov, not .qt [#164](https://github.com/broofa/mime/issues/164) -- [**V2**] [v2 Feedback request] Mime class API [#163](https://github.com/broofa/mime/issues/163) -- [**V2**] [v2 Feedback request] Resolving conflicts over extensions [#162](https://github.com/broofa/mime/issues/162) -- [**V2**] Allow callers to load module with official, full, or no defined types. [#161](https://github.com/broofa/mime/issues/161) -- [**V2**] Use "facets" to resolve extension conflicts [#160](https://github.com/broofa/mime/issues/160) -- [**V2**] Remove fs and path dependencies [#152](https://github.com/broofa/mime/issues/152) -- [**V2**] Default content-type should not be application/octet-stream [#139](https://github.com/broofa/mime/issues/139) -- [**V2**] reset mime-types [#124](https://github.com/broofa/mime/issues/124) -- [**V2**] Extensionless paths should return null or false [#113](https://github.com/broofa/mime/issues/113) - ---- - -### v2.0.1 (14/09/2017) -- [**closed**] Changelog for v2.0 does not mention breaking changes [#171](https://github.com/broofa/mime/issues/171) -- [**closed**] MIME breaking with 'class' declaration as it is without 'use strict mode' [#170](https://github.com/broofa/mime/issues/170) - ---- - -## v2.0.0 (12/09/2017) -- [**closed**] woff and woff2 [#168](https://github.com/broofa/mime/issues/168) - ---- - -## v1.4.0 (28/08/2017) -- [**closed**] support for ac3 voc files [#159](https://github.com/broofa/mime/issues/159) -- [**closed**] Help understanding change from application/xml to text/xml [#158](https://github.com/broofa/mime/issues/158) -- [**closed**] no longer able to override mimetype [#157](https://github.com/broofa/mime/issues/157) -- [**closed**] application/vnd.adobe.photoshop [#147](https://github.com/broofa/mime/issues/147) -- [**closed**] Directories should appear as something other than application/octet-stream [#135](https://github.com/broofa/mime/issues/135) -- [**closed**] requested features [#131](https://github.com/broofa/mime/issues/131) -- [**closed**] Make types.json loading optional? [#129](https://github.com/broofa/mime/issues/129) -- [**closed**] Cannot find module './types.json' [#120](https://github.com/broofa/mime/issues/120) -- [**V2**] .wav files show up as "audio/x-wav" instead of "audio/x-wave" [#118](https://github.com/broofa/mime/issues/118) -- [**closed**] Don't be a pain in the ass for node community [#108](https://github.com/broofa/mime/issues/108) -- [**closed**] don't make default_type global [#78](https://github.com/broofa/mime/issues/78) -- [**closed**] mime.extension() fails if the content-type is parameterized [#74](https://github.com/broofa/mime/issues/74) - ---- - -### v1.3.6 (11/05/2017) -- [**closed**] .md should be text/markdown as of March 2016 [#154](https://github.com/broofa/mime/issues/154) -- [**closed**] Error while installing mime [#153](https://github.com/broofa/mime/issues/153) -- [**closed**] application/manifest+json [#149](https://github.com/broofa/mime/issues/149) -- [**closed**] Dynamic adaptive streaming over HTTP (DASH) file extension typo [#141](https://github.com/broofa/mime/issues/141) -- [**closed**] charsets image/png undefined [#140](https://github.com/broofa/mime/issues/140) -- [**closed**] Mime-db dependency out of date [#130](https://github.com/broofa/mime/issues/130) -- [**closed**] how to support plist? [#126](https://github.com/broofa/mime/issues/126) -- [**closed**] how does .types file format look like? [#123](https://github.com/broofa/mime/issues/123) -- [**closed**] Feature: support for expanding MIME patterns [#121](https://github.com/broofa/mime/issues/121) -- [**closed**] DEBUG_MIME doesn't work [#117](https://github.com/broofa/mime/issues/117) - ---- - -### v1.3.4 (06/02/2015) -*No changelog for this release.* - ---- - -### v1.3.3 (06/02/2015) -*No changelog for this release.* - ---- - -### v1.3.1 (05/02/2015) -- [**closed**] Consider adding support for Handlebars .hbs file ending [#111](https://github.com/broofa/mime/issues/111) -- [**closed**] Consider adding support for hjson. [#110](https://github.com/broofa/mime/issues/110) -- [**closed**] Add mime type for Opus audio files [#94](https://github.com/broofa/mime/issues/94) -- [**closed**] Consider making the `Requesting New Types` information more visible [#77](https://github.com/broofa/mime/issues/77) - ---- - -## v1.3.0 (05/02/2015) -- [**closed**] Add common name? [#114](https://github.com/broofa/mime/issues/114) -- [**closed**] application/x-yaml [#104](https://github.com/broofa/mime/issues/104) -- [**closed**] Add mime type for WOFF file format 2.0 [#102](https://github.com/broofa/mime/issues/102) -- [**closed**] application/x-msi for .msi [#99](https://github.com/broofa/mime/issues/99) -- [**closed**] Add mimetype for gettext translation files [#98](https://github.com/broofa/mime/issues/98) -- [**closed**] collaborators [#88](https://github.com/broofa/mime/issues/88) -- [**closed**] getting errot in installation of mime module...any1 can help? [#87](https://github.com/broofa/mime/issues/87) -- [**closed**] should application/json's charset be utf8? [#86](https://github.com/broofa/mime/issues/86) -- [**closed**] Add "license" and "licenses" to package.json [#81](https://github.com/broofa/mime/issues/81) -- [**closed**] lookup with extension-less file on Windows returns wrong type [#68](https://github.com/broofa/mime/issues/68) - ---- - -### v1.2.11 (15/08/2013) -- [**closed**] Update mime.types [#65](https://github.com/broofa/mime/issues/65) -- [**closed**] Publish a new version [#63](https://github.com/broofa/mime/issues/63) -- [**closed**] README should state upfront that "application/octet-stream" is default for unknown extension [#55](https://github.com/broofa/mime/issues/55) -- [**closed**] Suggested improvement to the charset API [#52](https://github.com/broofa/mime/issues/52) - ---- - -### v1.2.10 (25/07/2013) -- [**closed**] Mime type for woff files should be application/font-woff and not application/x-font-woff [#62](https://github.com/broofa/mime/issues/62) -- [**closed**] node.types in conflict with mime.types [#51](https://github.com/broofa/mime/issues/51) - ---- - -### v1.2.9 (17/01/2013) -- [**closed**] Please update "mime" NPM [#49](https://github.com/broofa/mime/issues/49) -- [**closed**] Please add semicolon [#46](https://github.com/broofa/mime/issues/46) -- [**closed**] parse full mime types [#43](https://github.com/broofa/mime/issues/43) - ---- - -### v1.2.8 (10/01/2013) -- [**closed**] /js directory mime is application/javascript. Is it correct? [#47](https://github.com/broofa/mime/issues/47) -- [**closed**] Add mime types for lua code. [#45](https://github.com/broofa/mime/issues/45) - ---- - -### v1.2.7 (19/10/2012) -- [**closed**] cannot install 1.2.7 via npm [#41](https://github.com/broofa/mime/issues/41) -- [**closed**] Transfer ownership to @broofa [#36](https://github.com/broofa/mime/issues/36) -- [**closed**] it's wrong to set charset to UTF-8 for text [#30](https://github.com/broofa/mime/issues/30) -- [**closed**] Allow multiple instances of MIME types container [#27](https://github.com/broofa/mime/issues/27) diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/mime/LICENSE b/packages/wyatt_notification_bloc/example/scripts/node_modules/mime/LICENSE deleted file mode 100644 index d3f46f7e..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/mime/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2010 Benjamin Thomas, Robert Kieffer - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/mime/Mime.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/mime/Mime.js deleted file mode 100644 index 969a66e4..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/mime/Mime.js +++ /dev/null @@ -1,97 +0,0 @@ -'use strict'; - -/** - * @param typeMap [Object] Map of MIME type -> Array[extensions] - * @param ... - */ -function Mime() { - this._types = Object.create(null); - this._extensions = Object.create(null); - - for (let i = 0; i < arguments.length; i++) { - this.define(arguments[i]); - } - - this.define = this.define.bind(this); - this.getType = this.getType.bind(this); - this.getExtension = this.getExtension.bind(this); -} - -/** - * Define mimetype -> extension mappings. Each key is a mime-type that maps - * to an array of extensions associated with the type. The first extension is - * used as the default extension for the type. - * - * e.g. mime.define({'audio/ogg', ['oga', 'ogg', 'spx']}); - * - * If a type declares an extension that has already been defined, an error will - * be thrown. To suppress this error and force the extension to be associated - * with the new type, pass `force`=true. Alternatively, you may prefix the - * extension with "*" to map the type to extension, without mapping the - * extension to the type. - * - * e.g. mime.define({'audio/wav', ['wav']}, {'audio/x-wav', ['*wav']}); - * - * - * @param map (Object) type definitions - * @param force (Boolean) if true, force overriding of existing definitions - */ -Mime.prototype.define = function(typeMap, force) { - for (let type in typeMap) { - let extensions = typeMap[type].map(function(t) { - return t.toLowerCase(); - }); - type = type.toLowerCase(); - - for (let i = 0; i < extensions.length; i++) { - const ext = extensions[i]; - - // '*' prefix = not the preferred type for this extension. So fixup the - // extension, and skip it. - if (ext[0] === '*') { - continue; - } - - if (!force && (ext in this._types)) { - throw new Error( - 'Attempt to change mapping for "' + ext + - '" extension from "' + this._types[ext] + '" to "' + type + - '". Pass `force=true` to allow this, otherwise remove "' + ext + - '" from the list of extensions for "' + type + '".' - ); - } - - this._types[ext] = type; - } - - // Use first extension as default - if (force || !this._extensions[type]) { - const ext = extensions[0]; - this._extensions[type] = (ext[0] !== '*') ? ext : ext.substr(1); - } - } -}; - -/** - * Lookup a mime type based on extension - */ -Mime.prototype.getType = function(path) { - path = String(path); - let last = path.replace(/^.*[/\\]/, '').toLowerCase(); - let ext = last.replace(/^.*\./, '').toLowerCase(); - - let hasPath = last.length < path.length; - let hasDot = ext.length < last.length - 1; - - return (hasDot || !hasPath) && this._types[ext] || null; -}; - -/** - * Return file extension associated with a mime type - */ -Mime.prototype.getExtension = function(type) { - type = /^\s*([^;\s]*)/.test(type) && RegExp.$1; - return type && this._extensions[type.toLowerCase()] || null; -}; - -module.exports = Mime; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/mime/README.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/mime/README.md deleted file mode 100644 index fc816cbc..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/mime/README.md +++ /dev/null @@ -1,178 +0,0 @@ - -# Mime - -A comprehensive, compact MIME type module. - -[![Build Status](https://travis-ci.org/broofa/mime.svg?branch=master)](https://travis-ci.org/broofa/mime) - -## Install - -### NPM -``` -npm install mime -``` - -### Browser - -It is recommended that you use a bundler such as -[webpack](https://webpack.github.io/) or [browserify](http://browserify.org/) to -package your code. However, browser-ready versions are available via -skypack.dev as follows: -``` -// Full version - -``` - -``` -// "lite" version - -``` - -## Quick Start - -For the full version (800+ MIME types, 1,000+ extensions): - -```javascript -const mime = require('mime'); - -mime.getType('txt'); // ⇨ 'text/plain' -mime.getExtension('text/plain'); // ⇨ 'txt' -``` - -See [Mime API](#mime-api) below for API details. - -## Lite Version - -The "lite" version of this module omits vendor-specific (`*/vnd.*`) and -experimental (`*/x-*`) types. It weighs in at ~2.5KB, compared to 8KB for the -full version. To load the lite version: - -```javascript -const mime = require('mime/lite'); -``` - -## Mime .vs. mime-types .vs. mime-db modules - -For those of you wondering about the difference between these [popular] NPM modules, -here's a brief rundown ... - -[`mime-db`](https://github.com/jshttp/mime-db) is "the source of -truth" for MIME type information. It is not an API. Rather, it is a canonical -dataset of mime type definitions pulled from IANA, Apache, NGINX, and custom mappings -submitted by the Node.js community. - -[`mime-types`](https://github.com/jshttp/mime-types) is a thin -wrapper around mime-db that provides an API drop-in compatible(ish) with `mime @ < v1.3.6` API. - -`mime` is, as of v2, a self-contained module bundled with a pre-optimized version -of the `mime-db` dataset. It provides a simplified API with the following characteristics: - -* Intelligently resolved type conflicts (See [mime-score](https://github.com/broofa/mime-score) for details) -* Method naming consistent with industry best-practices -* Compact footprint. E.g. The minified+compressed sizes of the various modules: - -Module | Size ---- | --- -`mime-db` | 18 KB -`mime-types` | same as mime-db -`mime` | 8 KB -`mime/lite` | 2 KB - -## Mime API - -Both `require('mime')` and `require('mime/lite')` return instances of the MIME -class, documented below. - -Note: Inputs to this API are case-insensitive. Outputs (returned values) will -be lowercase. - -### new Mime(typeMap, ... more maps) - -Most users of this module will not need to create Mime instances directly. -However if you would like to create custom mappings, you may do so as follows -... - -```javascript -// Require Mime class -const Mime = require('mime/Mime'); - -// Define mime type -> extensions map -const typeMap = { - 'text/abc': ['abc', 'alpha', 'bet'], - 'text/def': ['leppard'] -}; - -// Create and use Mime instance -const myMime = new Mime(typeMap); -myMime.getType('abc'); // ⇨ 'text/abc' -myMime.getExtension('text/def'); // ⇨ 'leppard' -``` - -If more than one map argument is provided, each map is `define()`ed (see below), in order. - -### mime.getType(pathOrExtension) - -Get mime type for the given path or extension. E.g. - -```javascript -mime.getType('js'); // ⇨ 'application/javascript' -mime.getType('json'); // ⇨ 'application/json' - -mime.getType('txt'); // ⇨ 'text/plain' -mime.getType('dir/text.txt'); // ⇨ 'text/plain' -mime.getType('dir\\text.txt'); // ⇨ 'text/plain' -mime.getType('.text.txt'); // ⇨ 'text/plain' -mime.getType('.txt'); // ⇨ 'text/plain' -``` - -`null` is returned in cases where an extension is not detected or recognized - -```javascript -mime.getType('foo/txt'); // ⇨ null -mime.getType('bogus_type'); // ⇨ null -``` - -### mime.getExtension(type) -Get extension for the given mime type. Charset options (often included in -Content-Type headers) are ignored. - -```javascript -mime.getExtension('text/plain'); // ⇨ 'txt' -mime.getExtension('application/json'); // ⇨ 'json' -mime.getExtension('text/html; charset=utf8'); // ⇨ 'html' -``` - -### mime.define(typeMap[, force = false]) - -Define [more] type mappings. - -`typeMap` is a map of type -> extensions, as documented in `new Mime`, above. - -By default this method will throw an error if you try to map a type to an -extension that is already assigned to another type. Passing `true` for the -`force` argument will suppress this behavior (overriding any previous mapping). - -```javascript -mime.define({'text/x-abc': ['abc', 'abcd']}); - -mime.getType('abcd'); // ⇨ 'text/x-abc' -mime.getExtension('text/x-abc') // ⇨ 'abc' -``` - -## Command Line - - mime [path_or_extension] - -E.g. - - > mime scripts/jquery.js - application/javascript - ----- -Markdown generated from [src/README_js.md](src/README_js.md) by [![RunMD Logo](http://i.imgur.com/h0FVyzU.png)](https://github.com/broofa/runmd) \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/mime/cli.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/mime/cli.js deleted file mode 100755 index ab70a49c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/mime/cli.js +++ /dev/null @@ -1,46 +0,0 @@ -#!/usr/bin/env node - -'use strict'; - -process.title = 'mime'; -let mime = require('.'); -let pkg = require('./package.json'); -let args = process.argv.splice(2); - -if (args.includes('--version') || args.includes('-v') || args.includes('--v')) { - console.log(pkg.version); - process.exit(0); -} else if (args.includes('--name') || args.includes('-n') || args.includes('--n')) { - console.log(pkg.name); - process.exit(0); -} else if (args.includes('--help') || args.includes('-h') || args.includes('--h')) { - console.log(pkg.name + ' - ' + pkg.description + '\n'); - console.log(`Usage: - - mime [flags] [path_or_extension] - - Flags: - --help, -h Show this message - --version, -v Display the version - --name, -n Print the name of the program - - Note: the command will exit after it executes if a command is specified - The path_or_extension is the path to the file or the extension of the file. - - Examples: - mime --help - mime --version - mime --name - mime -v - mime src/log.js - mime new.py - mime foo.sh - `); - process.exit(0); -} - -let file = args[0]; -let type = mime.getType(file); - -process.stdout.write(type + '\n'); - diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/mime/index.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/mime/index.js deleted file mode 100644 index fadcf8d6..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/mime/index.js +++ /dev/null @@ -1,4 +0,0 @@ -'use strict'; - -let Mime = require('./Mime'); -module.exports = new Mime(require('./types/standard'), require('./types/other')); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/mime/lite.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/mime/lite.js deleted file mode 100644 index 835cffb3..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/mime/lite.js +++ /dev/null @@ -1,4 +0,0 @@ -'use strict'; - -let Mime = require('./Mime'); -module.exports = new Mime(require('./types/standard')); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/mime/package.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/mime/package.json deleted file mode 100644 index 84f51323..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/mime/package.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "author": { - "name": "Robert Kieffer", - "url": "http://github.com/broofa", - "email": "robert@broofa.com" - }, - "engines": { - "node": ">=10.0.0" - }, - "bin": { - "mime": "cli.js" - }, - "contributors": [], - "description": "A comprehensive library for mime-type mapping", - "license": "MIT", - "dependencies": {}, - "devDependencies": { - "benchmark": "*", - "chalk": "4.1.2", - "eslint": "8.1.0", - "mime-db": "1.50.0", - "mime-score": "1.2.0", - "mime-types": "2.1.33", - "mocha": "9.1.3", - "runmd": "*", - "standard-version": "9.3.2" - }, - "files": [ - "index.js", - "lite.js", - "Mime.js", - "cli.js", - "/types" - ], - "scripts": { - "prepare": "node src/build.js && runmd --output README.md src/README_js.md", - "release": "standard-version", - "benchmark": "node src/benchmark.js", - "md": "runmd --watch --output README.md src/README_js.md", - "test": "mocha src/test.js" - }, - "keywords": [ - "util", - "mime" - ], - "name": "mime", - "repository": { - "url": "https://github.com/broofa/mime", - "type": "git" - }, - "version": "3.0.0" -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/mime/types/other.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/mime/types/other.js deleted file mode 100644 index bb6a0353..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/mime/types/other.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = {"application/prs.cww":["cww"],"application/vnd.1000minds.decision-model+xml":["1km"],"application/vnd.3gpp.pic-bw-large":["plb"],"application/vnd.3gpp.pic-bw-small":["psb"],"application/vnd.3gpp.pic-bw-var":["pvb"],"application/vnd.3gpp2.tcap":["tcap"],"application/vnd.3m.post-it-notes":["pwn"],"application/vnd.accpac.simply.aso":["aso"],"application/vnd.accpac.simply.imp":["imp"],"application/vnd.acucobol":["acu"],"application/vnd.acucorp":["atc","acutc"],"application/vnd.adobe.air-application-installer-package+zip":["air"],"application/vnd.adobe.formscentral.fcdt":["fcdt"],"application/vnd.adobe.fxp":["fxp","fxpl"],"application/vnd.adobe.xdp+xml":["xdp"],"application/vnd.adobe.xfdf":["xfdf"],"application/vnd.ahead.space":["ahead"],"application/vnd.airzip.filesecure.azf":["azf"],"application/vnd.airzip.filesecure.azs":["azs"],"application/vnd.amazon.ebook":["azw"],"application/vnd.americandynamics.acc":["acc"],"application/vnd.amiga.ami":["ami"],"application/vnd.android.package-archive":["apk"],"application/vnd.anser-web-certificate-issue-initiation":["cii"],"application/vnd.anser-web-funds-transfer-initiation":["fti"],"application/vnd.antix.game-component":["atx"],"application/vnd.apple.installer+xml":["mpkg"],"application/vnd.apple.keynote":["key"],"application/vnd.apple.mpegurl":["m3u8"],"application/vnd.apple.numbers":["numbers"],"application/vnd.apple.pages":["pages"],"application/vnd.apple.pkpass":["pkpass"],"application/vnd.aristanetworks.swi":["swi"],"application/vnd.astraea-software.iota":["iota"],"application/vnd.audiograph":["aep"],"application/vnd.balsamiq.bmml+xml":["bmml"],"application/vnd.blueice.multipass":["mpm"],"application/vnd.bmi":["bmi"],"application/vnd.businessobjects":["rep"],"application/vnd.chemdraw+xml":["cdxml"],"application/vnd.chipnuts.karaoke-mmd":["mmd"],"application/vnd.cinderella":["cdy"],"application/vnd.citationstyles.style+xml":["csl"],"application/vnd.claymore":["cla"],"application/vnd.cloanto.rp9":["rp9"],"application/vnd.clonk.c4group":["c4g","c4d","c4f","c4p","c4u"],"application/vnd.cluetrust.cartomobile-config":["c11amc"],"application/vnd.cluetrust.cartomobile-config-pkg":["c11amz"],"application/vnd.commonspace":["csp"],"application/vnd.contact.cmsg":["cdbcmsg"],"application/vnd.cosmocaller":["cmc"],"application/vnd.crick.clicker":["clkx"],"application/vnd.crick.clicker.keyboard":["clkk"],"application/vnd.crick.clicker.palette":["clkp"],"application/vnd.crick.clicker.template":["clkt"],"application/vnd.crick.clicker.wordbank":["clkw"],"application/vnd.criticaltools.wbs+xml":["wbs"],"application/vnd.ctc-posml":["pml"],"application/vnd.cups-ppd":["ppd"],"application/vnd.curl.car":["car"],"application/vnd.curl.pcurl":["pcurl"],"application/vnd.dart":["dart"],"application/vnd.data-vision.rdz":["rdz"],"application/vnd.dbf":["dbf"],"application/vnd.dece.data":["uvf","uvvf","uvd","uvvd"],"application/vnd.dece.ttml+xml":["uvt","uvvt"],"application/vnd.dece.unspecified":["uvx","uvvx"],"application/vnd.dece.zip":["uvz","uvvz"],"application/vnd.denovo.fcselayout-link":["fe_launch"],"application/vnd.dna":["dna"],"application/vnd.dolby.mlp":["mlp"],"application/vnd.dpgraph":["dpg"],"application/vnd.dreamfactory":["dfac"],"application/vnd.ds-keypoint":["kpxx"],"application/vnd.dvb.ait":["ait"],"application/vnd.dvb.service":["svc"],"application/vnd.dynageo":["geo"],"application/vnd.ecowin.chart":["mag"],"application/vnd.enliven":["nml"],"application/vnd.epson.esf":["esf"],"application/vnd.epson.msf":["msf"],"application/vnd.epson.quickanime":["qam"],"application/vnd.epson.salt":["slt"],"application/vnd.epson.ssf":["ssf"],"application/vnd.eszigno3+xml":["es3","et3"],"application/vnd.ezpix-album":["ez2"],"application/vnd.ezpix-package":["ez3"],"application/vnd.fdf":["fdf"],"application/vnd.fdsn.mseed":["mseed"],"application/vnd.fdsn.seed":["seed","dataless"],"application/vnd.flographit":["gph"],"application/vnd.fluxtime.clip":["ftc"],"application/vnd.framemaker":["fm","frame","maker","book"],"application/vnd.frogans.fnc":["fnc"],"application/vnd.frogans.ltf":["ltf"],"application/vnd.fsc.weblaunch":["fsc"],"application/vnd.fujitsu.oasys":["oas"],"application/vnd.fujitsu.oasys2":["oa2"],"application/vnd.fujitsu.oasys3":["oa3"],"application/vnd.fujitsu.oasysgp":["fg5"],"application/vnd.fujitsu.oasysprs":["bh2"],"application/vnd.fujixerox.ddd":["ddd"],"application/vnd.fujixerox.docuworks":["xdw"],"application/vnd.fujixerox.docuworks.binder":["xbd"],"application/vnd.fuzzysheet":["fzs"],"application/vnd.genomatix.tuxedo":["txd"],"application/vnd.geogebra.file":["ggb"],"application/vnd.geogebra.tool":["ggt"],"application/vnd.geometry-explorer":["gex","gre"],"application/vnd.geonext":["gxt"],"application/vnd.geoplan":["g2w"],"application/vnd.geospace":["g3w"],"application/vnd.gmx":["gmx"],"application/vnd.google-apps.document":["gdoc"],"application/vnd.google-apps.presentation":["gslides"],"application/vnd.google-apps.spreadsheet":["gsheet"],"application/vnd.google-earth.kml+xml":["kml"],"application/vnd.google-earth.kmz":["kmz"],"application/vnd.grafeq":["gqf","gqs"],"application/vnd.groove-account":["gac"],"application/vnd.groove-help":["ghf"],"application/vnd.groove-identity-message":["gim"],"application/vnd.groove-injector":["grv"],"application/vnd.groove-tool-message":["gtm"],"application/vnd.groove-tool-template":["tpl"],"application/vnd.groove-vcard":["vcg"],"application/vnd.hal+xml":["hal"],"application/vnd.handheld-entertainment+xml":["zmm"],"application/vnd.hbci":["hbci"],"application/vnd.hhe.lesson-player":["les"],"application/vnd.hp-hpgl":["hpgl"],"application/vnd.hp-hpid":["hpid"],"application/vnd.hp-hps":["hps"],"application/vnd.hp-jlyt":["jlt"],"application/vnd.hp-pcl":["pcl"],"application/vnd.hp-pclxl":["pclxl"],"application/vnd.hydrostatix.sof-data":["sfd-hdstx"],"application/vnd.ibm.minipay":["mpy"],"application/vnd.ibm.modcap":["afp","listafp","list3820"],"application/vnd.ibm.rights-management":["irm"],"application/vnd.ibm.secure-container":["sc"],"application/vnd.iccprofile":["icc","icm"],"application/vnd.igloader":["igl"],"application/vnd.immervision-ivp":["ivp"],"application/vnd.immervision-ivu":["ivu"],"application/vnd.insors.igm":["igm"],"application/vnd.intercon.formnet":["xpw","xpx"],"application/vnd.intergeo":["i2g"],"application/vnd.intu.qbo":["qbo"],"application/vnd.intu.qfx":["qfx"],"application/vnd.ipunplugged.rcprofile":["rcprofile"],"application/vnd.irepository.package+xml":["irp"],"application/vnd.is-xpr":["xpr"],"application/vnd.isac.fcs":["fcs"],"application/vnd.jam":["jam"],"application/vnd.jcp.javame.midlet-rms":["rms"],"application/vnd.jisp":["jisp"],"application/vnd.joost.joda-archive":["joda"],"application/vnd.kahootz":["ktz","ktr"],"application/vnd.kde.karbon":["karbon"],"application/vnd.kde.kchart":["chrt"],"application/vnd.kde.kformula":["kfo"],"application/vnd.kde.kivio":["flw"],"application/vnd.kde.kontour":["kon"],"application/vnd.kde.kpresenter":["kpr","kpt"],"application/vnd.kde.kspread":["ksp"],"application/vnd.kde.kword":["kwd","kwt"],"application/vnd.kenameaapp":["htke"],"application/vnd.kidspiration":["kia"],"application/vnd.kinar":["kne","knp"],"application/vnd.koan":["skp","skd","skt","skm"],"application/vnd.kodak-descriptor":["sse"],"application/vnd.las.las+xml":["lasxml"],"application/vnd.llamagraphics.life-balance.desktop":["lbd"],"application/vnd.llamagraphics.life-balance.exchange+xml":["lbe"],"application/vnd.lotus-1-2-3":["123"],"application/vnd.lotus-approach":["apr"],"application/vnd.lotus-freelance":["pre"],"application/vnd.lotus-notes":["nsf"],"application/vnd.lotus-organizer":["org"],"application/vnd.lotus-screencam":["scm"],"application/vnd.lotus-wordpro":["lwp"],"application/vnd.macports.portpkg":["portpkg"],"application/vnd.mapbox-vector-tile":["mvt"],"application/vnd.mcd":["mcd"],"application/vnd.medcalcdata":["mc1"],"application/vnd.mediastation.cdkey":["cdkey"],"application/vnd.mfer":["mwf"],"application/vnd.mfmp":["mfm"],"application/vnd.micrografx.flo":["flo"],"application/vnd.micrografx.igx":["igx"],"application/vnd.mif":["mif"],"application/vnd.mobius.daf":["daf"],"application/vnd.mobius.dis":["dis"],"application/vnd.mobius.mbk":["mbk"],"application/vnd.mobius.mqy":["mqy"],"application/vnd.mobius.msl":["msl"],"application/vnd.mobius.plc":["plc"],"application/vnd.mobius.txf":["txf"],"application/vnd.mophun.application":["mpn"],"application/vnd.mophun.certificate":["mpc"],"application/vnd.mozilla.xul+xml":["xul"],"application/vnd.ms-artgalry":["cil"],"application/vnd.ms-cab-compressed":["cab"],"application/vnd.ms-excel":["xls","xlm","xla","xlc","xlt","xlw"],"application/vnd.ms-excel.addin.macroenabled.12":["xlam"],"application/vnd.ms-excel.sheet.binary.macroenabled.12":["xlsb"],"application/vnd.ms-excel.sheet.macroenabled.12":["xlsm"],"application/vnd.ms-excel.template.macroenabled.12":["xltm"],"application/vnd.ms-fontobject":["eot"],"application/vnd.ms-htmlhelp":["chm"],"application/vnd.ms-ims":["ims"],"application/vnd.ms-lrm":["lrm"],"application/vnd.ms-officetheme":["thmx"],"application/vnd.ms-outlook":["msg"],"application/vnd.ms-pki.seccat":["cat"],"application/vnd.ms-pki.stl":["*stl"],"application/vnd.ms-powerpoint":["ppt","pps","pot"],"application/vnd.ms-powerpoint.addin.macroenabled.12":["ppam"],"application/vnd.ms-powerpoint.presentation.macroenabled.12":["pptm"],"application/vnd.ms-powerpoint.slide.macroenabled.12":["sldm"],"application/vnd.ms-powerpoint.slideshow.macroenabled.12":["ppsm"],"application/vnd.ms-powerpoint.template.macroenabled.12":["potm"],"application/vnd.ms-project":["mpp","mpt"],"application/vnd.ms-word.document.macroenabled.12":["docm"],"application/vnd.ms-word.template.macroenabled.12":["dotm"],"application/vnd.ms-works":["wps","wks","wcm","wdb"],"application/vnd.ms-wpl":["wpl"],"application/vnd.ms-xpsdocument":["xps"],"application/vnd.mseq":["mseq"],"application/vnd.musician":["mus"],"application/vnd.muvee.style":["msty"],"application/vnd.mynfc":["taglet"],"application/vnd.neurolanguage.nlu":["nlu"],"application/vnd.nitf":["ntf","nitf"],"application/vnd.noblenet-directory":["nnd"],"application/vnd.noblenet-sealer":["nns"],"application/vnd.noblenet-web":["nnw"],"application/vnd.nokia.n-gage.ac+xml":["*ac"],"application/vnd.nokia.n-gage.data":["ngdat"],"application/vnd.nokia.n-gage.symbian.install":["n-gage"],"application/vnd.nokia.radio-preset":["rpst"],"application/vnd.nokia.radio-presets":["rpss"],"application/vnd.novadigm.edm":["edm"],"application/vnd.novadigm.edx":["edx"],"application/vnd.novadigm.ext":["ext"],"application/vnd.oasis.opendocument.chart":["odc"],"application/vnd.oasis.opendocument.chart-template":["otc"],"application/vnd.oasis.opendocument.database":["odb"],"application/vnd.oasis.opendocument.formula":["odf"],"application/vnd.oasis.opendocument.formula-template":["odft"],"application/vnd.oasis.opendocument.graphics":["odg"],"application/vnd.oasis.opendocument.graphics-template":["otg"],"application/vnd.oasis.opendocument.image":["odi"],"application/vnd.oasis.opendocument.image-template":["oti"],"application/vnd.oasis.opendocument.presentation":["odp"],"application/vnd.oasis.opendocument.presentation-template":["otp"],"application/vnd.oasis.opendocument.spreadsheet":["ods"],"application/vnd.oasis.opendocument.spreadsheet-template":["ots"],"application/vnd.oasis.opendocument.text":["odt"],"application/vnd.oasis.opendocument.text-master":["odm"],"application/vnd.oasis.opendocument.text-template":["ott"],"application/vnd.oasis.opendocument.text-web":["oth"],"application/vnd.olpc-sugar":["xo"],"application/vnd.oma.dd2+xml":["dd2"],"application/vnd.openblox.game+xml":["obgx"],"application/vnd.openofficeorg.extension":["oxt"],"application/vnd.openstreetmap.data+xml":["osm"],"application/vnd.openxmlformats-officedocument.presentationml.presentation":["pptx"],"application/vnd.openxmlformats-officedocument.presentationml.slide":["sldx"],"application/vnd.openxmlformats-officedocument.presentationml.slideshow":["ppsx"],"application/vnd.openxmlformats-officedocument.presentationml.template":["potx"],"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":["xlsx"],"application/vnd.openxmlformats-officedocument.spreadsheetml.template":["xltx"],"application/vnd.openxmlformats-officedocument.wordprocessingml.document":["docx"],"application/vnd.openxmlformats-officedocument.wordprocessingml.template":["dotx"],"application/vnd.osgeo.mapguide.package":["mgp"],"application/vnd.osgi.dp":["dp"],"application/vnd.osgi.subsystem":["esa"],"application/vnd.palm":["pdb","pqa","oprc"],"application/vnd.pawaafile":["paw"],"application/vnd.pg.format":["str"],"application/vnd.pg.osasli":["ei6"],"application/vnd.picsel":["efif"],"application/vnd.pmi.widget":["wg"],"application/vnd.pocketlearn":["plf"],"application/vnd.powerbuilder6":["pbd"],"application/vnd.previewsystems.box":["box"],"application/vnd.proteus.magazine":["mgz"],"application/vnd.publishare-delta-tree":["qps"],"application/vnd.pvi.ptid1":["ptid"],"application/vnd.quark.quarkxpress":["qxd","qxt","qwd","qwt","qxl","qxb"],"application/vnd.rar":["rar"],"application/vnd.realvnc.bed":["bed"],"application/vnd.recordare.musicxml":["mxl"],"application/vnd.recordare.musicxml+xml":["musicxml"],"application/vnd.rig.cryptonote":["cryptonote"],"application/vnd.rim.cod":["cod"],"application/vnd.rn-realmedia":["rm"],"application/vnd.rn-realmedia-vbr":["rmvb"],"application/vnd.route66.link66+xml":["link66"],"application/vnd.sailingtracker.track":["st"],"application/vnd.seemail":["see"],"application/vnd.sema":["sema"],"application/vnd.semd":["semd"],"application/vnd.semf":["semf"],"application/vnd.shana.informed.formdata":["ifm"],"application/vnd.shana.informed.formtemplate":["itp"],"application/vnd.shana.informed.interchange":["iif"],"application/vnd.shana.informed.package":["ipk"],"application/vnd.simtech-mindmapper":["twd","twds"],"application/vnd.smaf":["mmf"],"application/vnd.smart.teacher":["teacher"],"application/vnd.software602.filler.form+xml":["fo"],"application/vnd.solent.sdkm+xml":["sdkm","sdkd"],"application/vnd.spotfire.dxp":["dxp"],"application/vnd.spotfire.sfs":["sfs"],"application/vnd.stardivision.calc":["sdc"],"application/vnd.stardivision.draw":["sda"],"application/vnd.stardivision.impress":["sdd"],"application/vnd.stardivision.math":["smf"],"application/vnd.stardivision.writer":["sdw","vor"],"application/vnd.stardivision.writer-global":["sgl"],"application/vnd.stepmania.package":["smzip"],"application/vnd.stepmania.stepchart":["sm"],"application/vnd.sun.wadl+xml":["wadl"],"application/vnd.sun.xml.calc":["sxc"],"application/vnd.sun.xml.calc.template":["stc"],"application/vnd.sun.xml.draw":["sxd"],"application/vnd.sun.xml.draw.template":["std"],"application/vnd.sun.xml.impress":["sxi"],"application/vnd.sun.xml.impress.template":["sti"],"application/vnd.sun.xml.math":["sxm"],"application/vnd.sun.xml.writer":["sxw"],"application/vnd.sun.xml.writer.global":["sxg"],"application/vnd.sun.xml.writer.template":["stw"],"application/vnd.sus-calendar":["sus","susp"],"application/vnd.svd":["svd"],"application/vnd.symbian.install":["sis","sisx"],"application/vnd.syncml+xml":["xsm"],"application/vnd.syncml.dm+wbxml":["bdm"],"application/vnd.syncml.dm+xml":["xdm"],"application/vnd.syncml.dmddf+xml":["ddf"],"application/vnd.tao.intent-module-archive":["tao"],"application/vnd.tcpdump.pcap":["pcap","cap","dmp"],"application/vnd.tmobile-livetv":["tmo"],"application/vnd.trid.tpt":["tpt"],"application/vnd.triscape.mxs":["mxs"],"application/vnd.trueapp":["tra"],"application/vnd.ufdl":["ufd","ufdl"],"application/vnd.uiq.theme":["utz"],"application/vnd.umajin":["umj"],"application/vnd.unity":["unityweb"],"application/vnd.uoml+xml":["uoml"],"application/vnd.vcx":["vcx"],"application/vnd.visio":["vsd","vst","vss","vsw"],"application/vnd.visionary":["vis"],"application/vnd.vsf":["vsf"],"application/vnd.wap.wbxml":["wbxml"],"application/vnd.wap.wmlc":["wmlc"],"application/vnd.wap.wmlscriptc":["wmlsc"],"application/vnd.webturbo":["wtb"],"application/vnd.wolfram.player":["nbp"],"application/vnd.wordperfect":["wpd"],"application/vnd.wqd":["wqd"],"application/vnd.wt.stf":["stf"],"application/vnd.xara":["xar"],"application/vnd.xfdl":["xfdl"],"application/vnd.yamaha.hv-dic":["hvd"],"application/vnd.yamaha.hv-script":["hvs"],"application/vnd.yamaha.hv-voice":["hvp"],"application/vnd.yamaha.openscoreformat":["osf"],"application/vnd.yamaha.openscoreformat.osfpvg+xml":["osfpvg"],"application/vnd.yamaha.smaf-audio":["saf"],"application/vnd.yamaha.smaf-phrase":["spf"],"application/vnd.yellowriver-custom-menu":["cmp"],"application/vnd.zul":["zir","zirz"],"application/vnd.zzazz.deck+xml":["zaz"],"application/x-7z-compressed":["7z"],"application/x-abiword":["abw"],"application/x-ace-compressed":["ace"],"application/x-apple-diskimage":["*dmg"],"application/x-arj":["arj"],"application/x-authorware-bin":["aab","x32","u32","vox"],"application/x-authorware-map":["aam"],"application/x-authorware-seg":["aas"],"application/x-bcpio":["bcpio"],"application/x-bdoc":["*bdoc"],"application/x-bittorrent":["torrent"],"application/x-blorb":["blb","blorb"],"application/x-bzip":["bz"],"application/x-bzip2":["bz2","boz"],"application/x-cbr":["cbr","cba","cbt","cbz","cb7"],"application/x-cdlink":["vcd"],"application/x-cfs-compressed":["cfs"],"application/x-chat":["chat"],"application/x-chess-pgn":["pgn"],"application/x-chrome-extension":["crx"],"application/x-cocoa":["cco"],"application/x-conference":["nsc"],"application/x-cpio":["cpio"],"application/x-csh":["csh"],"application/x-debian-package":["*deb","udeb"],"application/x-dgc-compressed":["dgc"],"application/x-director":["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"],"application/x-doom":["wad"],"application/x-dtbncx+xml":["ncx"],"application/x-dtbook+xml":["dtb"],"application/x-dtbresource+xml":["res"],"application/x-dvi":["dvi"],"application/x-envoy":["evy"],"application/x-eva":["eva"],"application/x-font-bdf":["bdf"],"application/x-font-ghostscript":["gsf"],"application/x-font-linux-psf":["psf"],"application/x-font-pcf":["pcf"],"application/x-font-snf":["snf"],"application/x-font-type1":["pfa","pfb","pfm","afm"],"application/x-freearc":["arc"],"application/x-futuresplash":["spl"],"application/x-gca-compressed":["gca"],"application/x-glulx":["ulx"],"application/x-gnumeric":["gnumeric"],"application/x-gramps-xml":["gramps"],"application/x-gtar":["gtar"],"application/x-hdf":["hdf"],"application/x-httpd-php":["php"],"application/x-install-instructions":["install"],"application/x-iso9660-image":["*iso"],"application/x-iwork-keynote-sffkey":["*key"],"application/x-iwork-numbers-sffnumbers":["*numbers"],"application/x-iwork-pages-sffpages":["*pages"],"application/x-java-archive-diff":["jardiff"],"application/x-java-jnlp-file":["jnlp"],"application/x-keepass2":["kdbx"],"application/x-latex":["latex"],"application/x-lua-bytecode":["luac"],"application/x-lzh-compressed":["lzh","lha"],"application/x-makeself":["run"],"application/x-mie":["mie"],"application/x-mobipocket-ebook":["prc","mobi"],"application/x-ms-application":["application"],"application/x-ms-shortcut":["lnk"],"application/x-ms-wmd":["wmd"],"application/x-ms-wmz":["wmz"],"application/x-ms-xbap":["xbap"],"application/x-msaccess":["mdb"],"application/x-msbinder":["obd"],"application/x-mscardfile":["crd"],"application/x-msclip":["clp"],"application/x-msdos-program":["*exe"],"application/x-msdownload":["*exe","*dll","com","bat","*msi"],"application/x-msmediaview":["mvb","m13","m14"],"application/x-msmetafile":["*wmf","*wmz","*emf","emz"],"application/x-msmoney":["mny"],"application/x-mspublisher":["pub"],"application/x-msschedule":["scd"],"application/x-msterminal":["trm"],"application/x-mswrite":["wri"],"application/x-netcdf":["nc","cdf"],"application/x-ns-proxy-autoconfig":["pac"],"application/x-nzb":["nzb"],"application/x-perl":["pl","pm"],"application/x-pilot":["*prc","*pdb"],"application/x-pkcs12":["p12","pfx"],"application/x-pkcs7-certificates":["p7b","spc"],"application/x-pkcs7-certreqresp":["p7r"],"application/x-rar-compressed":["*rar"],"application/x-redhat-package-manager":["rpm"],"application/x-research-info-systems":["ris"],"application/x-sea":["sea"],"application/x-sh":["sh"],"application/x-shar":["shar"],"application/x-shockwave-flash":["swf"],"application/x-silverlight-app":["xap"],"application/x-sql":["sql"],"application/x-stuffit":["sit"],"application/x-stuffitx":["sitx"],"application/x-subrip":["srt"],"application/x-sv4cpio":["sv4cpio"],"application/x-sv4crc":["sv4crc"],"application/x-t3vm-image":["t3"],"application/x-tads":["gam"],"application/x-tar":["tar"],"application/x-tcl":["tcl","tk"],"application/x-tex":["tex"],"application/x-tex-tfm":["tfm"],"application/x-texinfo":["texinfo","texi"],"application/x-tgif":["*obj"],"application/x-ustar":["ustar"],"application/x-virtualbox-hdd":["hdd"],"application/x-virtualbox-ova":["ova"],"application/x-virtualbox-ovf":["ovf"],"application/x-virtualbox-vbox":["vbox"],"application/x-virtualbox-vbox-extpack":["vbox-extpack"],"application/x-virtualbox-vdi":["vdi"],"application/x-virtualbox-vhd":["vhd"],"application/x-virtualbox-vmdk":["vmdk"],"application/x-wais-source":["src"],"application/x-web-app-manifest+json":["webapp"],"application/x-x509-ca-cert":["der","crt","pem"],"application/x-xfig":["fig"],"application/x-xliff+xml":["*xlf"],"application/x-xpinstall":["xpi"],"application/x-xz":["xz"],"application/x-zmachine":["z1","z2","z3","z4","z5","z6","z7","z8"],"audio/vnd.dece.audio":["uva","uvva"],"audio/vnd.digital-winds":["eol"],"audio/vnd.dra":["dra"],"audio/vnd.dts":["dts"],"audio/vnd.dts.hd":["dtshd"],"audio/vnd.lucent.voice":["lvp"],"audio/vnd.ms-playready.media.pya":["pya"],"audio/vnd.nuera.ecelp4800":["ecelp4800"],"audio/vnd.nuera.ecelp7470":["ecelp7470"],"audio/vnd.nuera.ecelp9600":["ecelp9600"],"audio/vnd.rip":["rip"],"audio/x-aac":["aac"],"audio/x-aiff":["aif","aiff","aifc"],"audio/x-caf":["caf"],"audio/x-flac":["flac"],"audio/x-m4a":["*m4a"],"audio/x-matroska":["mka"],"audio/x-mpegurl":["m3u"],"audio/x-ms-wax":["wax"],"audio/x-ms-wma":["wma"],"audio/x-pn-realaudio":["ram","ra"],"audio/x-pn-realaudio-plugin":["rmp"],"audio/x-realaudio":["*ra"],"audio/x-wav":["*wav"],"chemical/x-cdx":["cdx"],"chemical/x-cif":["cif"],"chemical/x-cmdf":["cmdf"],"chemical/x-cml":["cml"],"chemical/x-csml":["csml"],"chemical/x-xyz":["xyz"],"image/prs.btif":["btif"],"image/prs.pti":["pti"],"image/vnd.adobe.photoshop":["psd"],"image/vnd.airzip.accelerator.azv":["azv"],"image/vnd.dece.graphic":["uvi","uvvi","uvg","uvvg"],"image/vnd.djvu":["djvu","djv"],"image/vnd.dvb.subtitle":["*sub"],"image/vnd.dwg":["dwg"],"image/vnd.dxf":["dxf"],"image/vnd.fastbidsheet":["fbs"],"image/vnd.fpx":["fpx"],"image/vnd.fst":["fst"],"image/vnd.fujixerox.edmics-mmr":["mmr"],"image/vnd.fujixerox.edmics-rlc":["rlc"],"image/vnd.microsoft.icon":["ico"],"image/vnd.ms-dds":["dds"],"image/vnd.ms-modi":["mdi"],"image/vnd.ms-photo":["wdp"],"image/vnd.net-fpx":["npx"],"image/vnd.pco.b16":["b16"],"image/vnd.tencent.tap":["tap"],"image/vnd.valve.source.texture":["vtf"],"image/vnd.wap.wbmp":["wbmp"],"image/vnd.xiff":["xif"],"image/vnd.zbrush.pcx":["pcx"],"image/x-3ds":["3ds"],"image/x-cmu-raster":["ras"],"image/x-cmx":["cmx"],"image/x-freehand":["fh","fhc","fh4","fh5","fh7"],"image/x-icon":["*ico"],"image/x-jng":["jng"],"image/x-mrsid-image":["sid"],"image/x-ms-bmp":["*bmp"],"image/x-pcx":["*pcx"],"image/x-pict":["pic","pct"],"image/x-portable-anymap":["pnm"],"image/x-portable-bitmap":["pbm"],"image/x-portable-graymap":["pgm"],"image/x-portable-pixmap":["ppm"],"image/x-rgb":["rgb"],"image/x-tga":["tga"],"image/x-xbitmap":["xbm"],"image/x-xpixmap":["xpm"],"image/x-xwindowdump":["xwd"],"message/vnd.wfa.wsc":["wsc"],"model/vnd.collada+xml":["dae"],"model/vnd.dwf":["dwf"],"model/vnd.gdl":["gdl"],"model/vnd.gtw":["gtw"],"model/vnd.mts":["mts"],"model/vnd.opengex":["ogex"],"model/vnd.parasolid.transmit.binary":["x_b"],"model/vnd.parasolid.transmit.text":["x_t"],"model/vnd.sap.vds":["vds"],"model/vnd.usdz+zip":["usdz"],"model/vnd.valve.source.compiled-map":["bsp"],"model/vnd.vtu":["vtu"],"text/prs.lines.tag":["dsc"],"text/vnd.curl":["curl"],"text/vnd.curl.dcurl":["dcurl"],"text/vnd.curl.mcurl":["mcurl"],"text/vnd.curl.scurl":["scurl"],"text/vnd.dvb.subtitle":["sub"],"text/vnd.fly":["fly"],"text/vnd.fmi.flexstor":["flx"],"text/vnd.graphviz":["gv"],"text/vnd.in3d.3dml":["3dml"],"text/vnd.in3d.spot":["spot"],"text/vnd.sun.j2me.app-descriptor":["jad"],"text/vnd.wap.wml":["wml"],"text/vnd.wap.wmlscript":["wmls"],"text/x-asm":["s","asm"],"text/x-c":["c","cc","cxx","cpp","h","hh","dic"],"text/x-component":["htc"],"text/x-fortran":["f","for","f77","f90"],"text/x-handlebars-template":["hbs"],"text/x-java-source":["java"],"text/x-lua":["lua"],"text/x-markdown":["mkd"],"text/x-nfo":["nfo"],"text/x-opml":["opml"],"text/x-org":["*org"],"text/x-pascal":["p","pas"],"text/x-processing":["pde"],"text/x-sass":["sass"],"text/x-scss":["scss"],"text/x-setext":["etx"],"text/x-sfv":["sfv"],"text/x-suse-ymp":["ymp"],"text/x-uuencode":["uu"],"text/x-vcalendar":["vcs"],"text/x-vcard":["vcf"],"video/vnd.dece.hd":["uvh","uvvh"],"video/vnd.dece.mobile":["uvm","uvvm"],"video/vnd.dece.pd":["uvp","uvvp"],"video/vnd.dece.sd":["uvs","uvvs"],"video/vnd.dece.video":["uvv","uvvv"],"video/vnd.dvb.file":["dvb"],"video/vnd.fvt":["fvt"],"video/vnd.mpegurl":["mxu","m4u"],"video/vnd.ms-playready.media.pyv":["pyv"],"video/vnd.uvvu.mp4":["uvu","uvvu"],"video/vnd.vivo":["viv"],"video/x-f4v":["f4v"],"video/x-fli":["fli"],"video/x-flv":["flv"],"video/x-m4v":["m4v"],"video/x-matroska":["mkv","mk3d","mks"],"video/x-mng":["mng"],"video/x-ms-asf":["asf","asx"],"video/x-ms-vob":["vob"],"video/x-ms-wm":["wm"],"video/x-ms-wmv":["wmv"],"video/x-ms-wmx":["wmx"],"video/x-ms-wvx":["wvx"],"video/x-msvideo":["avi"],"video/x-sgi-movie":["movie"],"video/x-smv":["smv"],"x-conference/x-cooltalk":["ice"]}; \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/mime/types/standard.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/mime/types/standard.js deleted file mode 100644 index 5ee9937e..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/mime/types/standard.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = {"application/andrew-inset":["ez"],"application/applixware":["aw"],"application/atom+xml":["atom"],"application/atomcat+xml":["atomcat"],"application/atomdeleted+xml":["atomdeleted"],"application/atomsvc+xml":["atomsvc"],"application/atsc-dwd+xml":["dwd"],"application/atsc-held+xml":["held"],"application/atsc-rsat+xml":["rsat"],"application/bdoc":["bdoc"],"application/calendar+xml":["xcs"],"application/ccxml+xml":["ccxml"],"application/cdfx+xml":["cdfx"],"application/cdmi-capability":["cdmia"],"application/cdmi-container":["cdmic"],"application/cdmi-domain":["cdmid"],"application/cdmi-object":["cdmio"],"application/cdmi-queue":["cdmiq"],"application/cu-seeme":["cu"],"application/dash+xml":["mpd"],"application/davmount+xml":["davmount"],"application/docbook+xml":["dbk"],"application/dssc+der":["dssc"],"application/dssc+xml":["xdssc"],"application/ecmascript":["es","ecma"],"application/emma+xml":["emma"],"application/emotionml+xml":["emotionml"],"application/epub+zip":["epub"],"application/exi":["exi"],"application/express":["exp"],"application/fdt+xml":["fdt"],"application/font-tdpfr":["pfr"],"application/geo+json":["geojson"],"application/gml+xml":["gml"],"application/gpx+xml":["gpx"],"application/gxf":["gxf"],"application/gzip":["gz"],"application/hjson":["hjson"],"application/hyperstudio":["stk"],"application/inkml+xml":["ink","inkml"],"application/ipfix":["ipfix"],"application/its+xml":["its"],"application/java-archive":["jar","war","ear"],"application/java-serialized-object":["ser"],"application/java-vm":["class"],"application/javascript":["js","mjs"],"application/json":["json","map"],"application/json5":["json5"],"application/jsonml+json":["jsonml"],"application/ld+json":["jsonld"],"application/lgr+xml":["lgr"],"application/lost+xml":["lostxml"],"application/mac-binhex40":["hqx"],"application/mac-compactpro":["cpt"],"application/mads+xml":["mads"],"application/manifest+json":["webmanifest"],"application/marc":["mrc"],"application/marcxml+xml":["mrcx"],"application/mathematica":["ma","nb","mb"],"application/mathml+xml":["mathml"],"application/mbox":["mbox"],"application/mediaservercontrol+xml":["mscml"],"application/metalink+xml":["metalink"],"application/metalink4+xml":["meta4"],"application/mets+xml":["mets"],"application/mmt-aei+xml":["maei"],"application/mmt-usd+xml":["musd"],"application/mods+xml":["mods"],"application/mp21":["m21","mp21"],"application/mp4":["mp4s","m4p"],"application/msword":["doc","dot"],"application/mxf":["mxf"],"application/n-quads":["nq"],"application/n-triples":["nt"],"application/node":["cjs"],"application/octet-stream":["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"],"application/oda":["oda"],"application/oebps-package+xml":["opf"],"application/ogg":["ogx"],"application/omdoc+xml":["omdoc"],"application/onenote":["onetoc","onetoc2","onetmp","onepkg"],"application/oxps":["oxps"],"application/p2p-overlay+xml":["relo"],"application/patch-ops-error+xml":["xer"],"application/pdf":["pdf"],"application/pgp-encrypted":["pgp"],"application/pgp-signature":["asc","sig"],"application/pics-rules":["prf"],"application/pkcs10":["p10"],"application/pkcs7-mime":["p7m","p7c"],"application/pkcs7-signature":["p7s"],"application/pkcs8":["p8"],"application/pkix-attr-cert":["ac"],"application/pkix-cert":["cer"],"application/pkix-crl":["crl"],"application/pkix-pkipath":["pkipath"],"application/pkixcmp":["pki"],"application/pls+xml":["pls"],"application/postscript":["ai","eps","ps"],"application/provenance+xml":["provx"],"application/pskc+xml":["pskcxml"],"application/raml+yaml":["raml"],"application/rdf+xml":["rdf","owl"],"application/reginfo+xml":["rif"],"application/relax-ng-compact-syntax":["rnc"],"application/resource-lists+xml":["rl"],"application/resource-lists-diff+xml":["rld"],"application/rls-services+xml":["rs"],"application/route-apd+xml":["rapd"],"application/route-s-tsid+xml":["sls"],"application/route-usd+xml":["rusd"],"application/rpki-ghostbusters":["gbr"],"application/rpki-manifest":["mft"],"application/rpki-roa":["roa"],"application/rsd+xml":["rsd"],"application/rss+xml":["rss"],"application/rtf":["rtf"],"application/sbml+xml":["sbml"],"application/scvp-cv-request":["scq"],"application/scvp-cv-response":["scs"],"application/scvp-vp-request":["spq"],"application/scvp-vp-response":["spp"],"application/sdp":["sdp"],"application/senml+xml":["senmlx"],"application/sensml+xml":["sensmlx"],"application/set-payment-initiation":["setpay"],"application/set-registration-initiation":["setreg"],"application/shf+xml":["shf"],"application/sieve":["siv","sieve"],"application/smil+xml":["smi","smil"],"application/sparql-query":["rq"],"application/sparql-results+xml":["srx"],"application/srgs":["gram"],"application/srgs+xml":["grxml"],"application/sru+xml":["sru"],"application/ssdl+xml":["ssdl"],"application/ssml+xml":["ssml"],"application/swid+xml":["swidtag"],"application/tei+xml":["tei","teicorpus"],"application/thraud+xml":["tfi"],"application/timestamped-data":["tsd"],"application/toml":["toml"],"application/trig":["trig"],"application/ttml+xml":["ttml"],"application/ubjson":["ubj"],"application/urc-ressheet+xml":["rsheet"],"application/urc-targetdesc+xml":["td"],"application/voicexml+xml":["vxml"],"application/wasm":["wasm"],"application/widget":["wgt"],"application/winhlp":["hlp"],"application/wsdl+xml":["wsdl"],"application/wspolicy+xml":["wspolicy"],"application/xaml+xml":["xaml"],"application/xcap-att+xml":["xav"],"application/xcap-caps+xml":["xca"],"application/xcap-diff+xml":["xdf"],"application/xcap-el+xml":["xel"],"application/xcap-ns+xml":["xns"],"application/xenc+xml":["xenc"],"application/xhtml+xml":["xhtml","xht"],"application/xliff+xml":["xlf"],"application/xml":["xml","xsl","xsd","rng"],"application/xml-dtd":["dtd"],"application/xop+xml":["xop"],"application/xproc+xml":["xpl"],"application/xslt+xml":["*xsl","xslt"],"application/xspf+xml":["xspf"],"application/xv+xml":["mxml","xhvml","xvml","xvm"],"application/yang":["yang"],"application/yin+xml":["yin"],"application/zip":["zip"],"audio/3gpp":["*3gpp"],"audio/adpcm":["adp"],"audio/amr":["amr"],"audio/basic":["au","snd"],"audio/midi":["mid","midi","kar","rmi"],"audio/mobile-xmf":["mxmf"],"audio/mp3":["*mp3"],"audio/mp4":["m4a","mp4a"],"audio/mpeg":["mpga","mp2","mp2a","mp3","m2a","m3a"],"audio/ogg":["oga","ogg","spx","opus"],"audio/s3m":["s3m"],"audio/silk":["sil"],"audio/wav":["wav"],"audio/wave":["*wav"],"audio/webm":["weba"],"audio/xm":["xm"],"font/collection":["ttc"],"font/otf":["otf"],"font/ttf":["ttf"],"font/woff":["woff"],"font/woff2":["woff2"],"image/aces":["exr"],"image/apng":["apng"],"image/avif":["avif"],"image/bmp":["bmp"],"image/cgm":["cgm"],"image/dicom-rle":["drle"],"image/emf":["emf"],"image/fits":["fits"],"image/g3fax":["g3"],"image/gif":["gif"],"image/heic":["heic"],"image/heic-sequence":["heics"],"image/heif":["heif"],"image/heif-sequence":["heifs"],"image/hej2k":["hej2"],"image/hsj2":["hsj2"],"image/ief":["ief"],"image/jls":["jls"],"image/jp2":["jp2","jpg2"],"image/jpeg":["jpeg","jpg","jpe"],"image/jph":["jph"],"image/jphc":["jhc"],"image/jpm":["jpm"],"image/jpx":["jpx","jpf"],"image/jxr":["jxr"],"image/jxra":["jxra"],"image/jxrs":["jxrs"],"image/jxs":["jxs"],"image/jxsc":["jxsc"],"image/jxsi":["jxsi"],"image/jxss":["jxss"],"image/ktx":["ktx"],"image/ktx2":["ktx2"],"image/png":["png"],"image/sgi":["sgi"],"image/svg+xml":["svg","svgz"],"image/t38":["t38"],"image/tiff":["tif","tiff"],"image/tiff-fx":["tfx"],"image/webp":["webp"],"image/wmf":["wmf"],"message/disposition-notification":["disposition-notification"],"message/global":["u8msg"],"message/global-delivery-status":["u8dsn"],"message/global-disposition-notification":["u8mdn"],"message/global-headers":["u8hdr"],"message/rfc822":["eml","mime"],"model/3mf":["3mf"],"model/gltf+json":["gltf"],"model/gltf-binary":["glb"],"model/iges":["igs","iges"],"model/mesh":["msh","mesh","silo"],"model/mtl":["mtl"],"model/obj":["obj"],"model/step+xml":["stpx"],"model/step+zip":["stpz"],"model/step-xml+zip":["stpxz"],"model/stl":["stl"],"model/vrml":["wrl","vrml"],"model/x3d+binary":["*x3db","x3dbz"],"model/x3d+fastinfoset":["x3db"],"model/x3d+vrml":["*x3dv","x3dvz"],"model/x3d+xml":["x3d","x3dz"],"model/x3d-vrml":["x3dv"],"text/cache-manifest":["appcache","manifest"],"text/calendar":["ics","ifb"],"text/coffeescript":["coffee","litcoffee"],"text/css":["css"],"text/csv":["csv"],"text/html":["html","htm","shtml"],"text/jade":["jade"],"text/jsx":["jsx"],"text/less":["less"],"text/markdown":["markdown","md"],"text/mathml":["mml"],"text/mdx":["mdx"],"text/n3":["n3"],"text/plain":["txt","text","conf","def","list","log","in","ini"],"text/richtext":["rtx"],"text/rtf":["*rtf"],"text/sgml":["sgml","sgm"],"text/shex":["shex"],"text/slim":["slim","slm"],"text/spdx":["spdx"],"text/stylus":["stylus","styl"],"text/tab-separated-values":["tsv"],"text/troff":["t","tr","roff","man","me","ms"],"text/turtle":["ttl"],"text/uri-list":["uri","uris","urls"],"text/vcard":["vcard"],"text/vtt":["vtt"],"text/xml":["*xml"],"text/yaml":["yaml","yml"],"video/3gpp":["3gp","3gpp"],"video/3gpp2":["3g2"],"video/h261":["h261"],"video/h263":["h263"],"video/h264":["h264"],"video/iso.segment":["m4s"],"video/jpeg":["jpgv"],"video/jpm":["*jpm","jpgm"],"video/mj2":["mj2","mjp2"],"video/mp2t":["ts"],"video/mp4":["mp4","mp4v","mpg4"],"video/mpeg":["mpeg","mpg","mpe","m1v","m2v"],"video/ogg":["ogv"],"video/quicktime":["qt","mov"],"video/webm":["webm"]}; \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/minimatch/LICENSE b/packages/wyatt_notification_bloc/example/scripts/node_modules/minimatch/LICENSE deleted file mode 100644 index 9517b7d9..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/minimatch/LICENSE +++ /dev/null @@ -1,15 +0,0 @@ -The ISC License - -Copyright (c) 2011-2022 Isaac Z. Schlueter and Contributors - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR -IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/minimatch/README.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/minimatch/README.md deleted file mode 100644 index a5bdefaa..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/minimatch/README.md +++ /dev/null @@ -1,259 +0,0 @@ -# minimatch - -A minimal matching utility. - -[![Build Status](https://travis-ci.org/isaacs/minimatch.svg?branch=master)](http://travis-ci.org/isaacs/minimatch) - - -This is the matching library used internally by npm. - -It works by converting glob expressions into JavaScript `RegExp` -objects. - -## Usage - -```javascript -var minimatch = require("minimatch") - -minimatch("bar.foo", "*.foo") // true! -minimatch("bar.foo", "*.bar") // false! -minimatch("bar.foo", "*.+(bar|foo)", { debug: true }) // true, and noisy! -``` - -## Features - -Supports these glob features: - -* Brace Expansion -* Extended glob matching -* "Globstar" `**` matching - -See: - -* `man sh` -* `man bash` -* `man 3 fnmatch` -* `man 5 gitignore` - -## Windows - -**Please only use forward-slashes in glob expressions.** - -Though windows uses either `/` or `\` as its path separator, only `/` -characters are used by this glob implementation. You must use -forward-slashes **only** in glob expressions. Back-slashes in patterns -will always be interpreted as escape characters, not path separators. - -Note that `\` or `/` _will_ be interpreted as path separators in paths on -Windows, and will match against `/` in glob expressions. - -So just always use `/` in patterns. - -## Minimatch Class - -Create a minimatch object by instantiating the `minimatch.Minimatch` class. - -```javascript -var Minimatch = require("minimatch").Minimatch -var mm = new Minimatch(pattern, options) -``` - -### Properties - -* `pattern` The original pattern the minimatch object represents. -* `options` The options supplied to the constructor. -* `set` A 2-dimensional array of regexp or string expressions. - Each row in the - array corresponds to a brace-expanded pattern. Each item in the row - corresponds to a single path-part. For example, the pattern - `{a,b/c}/d` would expand to a set of patterns like: - - [ [ a, d ] - , [ b, c, d ] ] - - If a portion of the pattern doesn't have any "magic" in it - (that is, it's something like `"foo"` rather than `fo*o?`), then it - will be left as a string rather than converted to a regular - expression. - -* `regexp` Created by the `makeRe` method. A single regular expression - expressing the entire pattern. This is useful in cases where you wish - to use the pattern somewhat like `fnmatch(3)` with `FNM_PATH` enabled. -* `negate` True if the pattern is negated. -* `comment` True if the pattern is a comment. -* `empty` True if the pattern is `""`. - -### Methods - -* `makeRe` Generate the `regexp` member if necessary, and return it. - Will return `false` if the pattern is invalid. -* `match(fname)` Return true if the filename matches the pattern, or - false otherwise. -* `matchOne(fileArray, patternArray, partial)` Take a `/`-split - filename, and match it against a single row in the `regExpSet`. This - method is mainly for internal use, but is exposed so that it can be - used by a glob-walker that needs to avoid excessive filesystem calls. - -All other methods are internal, and will be called as necessary. - -### minimatch(path, pattern, options) - -Main export. Tests a path against the pattern using the options. - -```javascript -var isJS = minimatch(file, "*.js", { matchBase: true }) -``` - -### minimatch.filter(pattern, options) - -Returns a function that tests its -supplied argument, suitable for use with `Array.filter`. Example: - -```javascript -var javascripts = fileList.filter(minimatch.filter("*.js", {matchBase: true})) -``` - -### minimatch.match(list, pattern, options) - -Match against the list of -files, in the style of fnmatch or glob. If nothing is matched, and -options.nonull is set, then return a list containing the pattern itself. - -```javascript -var javascripts = minimatch.match(fileList, "*.js", {matchBase: true}) -``` - -### minimatch.makeRe(pattern, options) - -Make a regular expression object from the pattern. - -## Options - -All options are `false` by default. - -### debug - -Dump a ton of stuff to stderr. - -### nobrace - -Do not expand `{a,b}` and `{1..3}` brace sets. - -### noglobstar - -Disable `**` matching against multiple folder names. - -### dot - -Allow patterns to match filenames starting with a period, even if -the pattern does not explicitly have a period in that spot. - -Note that by default, `a/**/b` will **not** match `a/.d/b`, unless `dot` -is set. - -### noext - -Disable "extglob" style patterns like `+(a|b)`. - -### nocase - -Perform a case-insensitive match. - -### nonull - -When a match is not found by `minimatch.match`, return a list containing -the pattern itself if this option is set. When not set, an empty list -is returned if there are no matches. - -### matchBase - -If set, then patterns without slashes will be matched -against the basename of the path if it contains slashes. For example, -`a?b` would match the path `/xyz/123/acb`, but not `/xyz/acb/123`. - -### nocomment - -Suppress the behavior of treating `#` at the start of a pattern as a -comment. - -### nonegate - -Suppress the behavior of treating a leading `!` character as negation. - -### flipNegate - -Returns from negate expressions the same as if they were not negated. -(Ie, true on a hit, false on a miss.) - -### partial - -Compare a partial path to a pattern. As long as the parts of the path that -are present are not contradicted by the pattern, it will be treated as a -match. This is useful in applications where you're walking through a -folder structure, and don't yet have the full path, but want to ensure that -you do not walk down paths that can never be a match. - -For example, - -```js -minimatch('/a/b', '/a/*/c/d', { partial: true }) // true, might be /a/b/c/d -minimatch('/a/b', '/**/d', { partial: true }) // true, might be /a/b/.../d -minimatch('/x/y/z', '/a/**/z', { partial: true }) // false, because x !== a -``` - -### windowsPathsNoEscape - -Use `\\` as a path separator _only_, and _never_ as an escape -character. If set, all `\\` characters are replaced with `/` in -the pattern. Note that this makes it **impossible** to match -against paths containing literal glob pattern characters, but -allows matching with patterns constructed using `path.join()` and -`path.resolve()` on Windows platforms, mimicking the (buggy!) -behavior of earlier versions on Windows. Please use with -caution, and be mindful of [the caveat about Windows -paths](#windows). - -For legacy reasons, this is also set if -`options.allowWindowsEscape` is set to the exact value `false`. - -## Comparisons to other fnmatch/glob implementations - -While strict compliance with the existing standards is a worthwhile -goal, some discrepancies exist between minimatch and other -implementations, and are intentional. - -If the pattern starts with a `!` character, then it is negated. Set the -`nonegate` flag to suppress this behavior, and treat leading `!` -characters normally. This is perhaps relevant if you wish to start the -pattern with a negative extglob pattern like `!(a|B)`. Multiple `!` -characters at the start of a pattern will negate the pattern multiple -times. - -If a pattern starts with `#`, then it is treated as a comment, and -will not match anything. Use `\#` to match a literal `#` at the -start of a line, or set the `nocomment` flag to suppress this behavior. - -The double-star character `**` is supported by default, unless the -`noglobstar` flag is set. This is supported in the manner of bsdglob -and bash 4.1, where `**` only has special significance if it is the only -thing in a path part. That is, `a/**/b` will match `a/x/y/b`, but -`a/**b` will not. - -If an escaped pattern has no matches, and the `nonull` flag is set, -then minimatch.match returns the pattern as-provided, rather than -interpreting the character escapes. For example, -`minimatch.match([], "\\*a\\?")` will return `"\\*a\\?"` rather than -`"*a?"`. This is akin to setting the `nullglob` option in bash, except -that it does not resolve escaped pattern characters. - -If brace expansion is not disabled, then it is performed before any -other interpretation of the glob pattern. Thus, a pattern like -`+(a|{b),c)}`, which would not be valid in bash or zsh, is expanded -**first** into the set of `+(a|b)` and `+(a|c)`, and those patterns are -checked for validity. Since those two are valid, matching proceeds. - -Note that `fnmatch(3)` in libc is an extremely naive string comparison -matcher, which does not do anything special for slashes. This library is -designed to be used in glob searching and file walkers, and so it does do -special things with `/`. Thus, `foo*` will not match `foo/bar` in this -library, even though it would in `fnmatch(3)`. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/minimatch/lib/path.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/minimatch/lib/path.js deleted file mode 100644 index ffe453d9..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/minimatch/lib/path.js +++ /dev/null @@ -1,4 +0,0 @@ -const isWindows = typeof process === 'object' && - process && - process.platform === 'win32' -module.exports = isWindows ? { sep: '\\' } : { sep: '/' } diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/minimatch/minimatch.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/minimatch/minimatch.js deleted file mode 100644 index 71c96a1f..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/minimatch/minimatch.js +++ /dev/null @@ -1,906 +0,0 @@ -const minimatch = module.exports = (p, pattern, options = {}) => { - assertValidPattern(pattern) - - // shortcut: comments match nothing. - if (!options.nocomment && pattern.charAt(0) === '#') { - return false - } - - return new Minimatch(pattern, options).match(p) -} - -module.exports = minimatch - -const path = require('./lib/path.js') -minimatch.sep = path.sep - -const GLOBSTAR = Symbol('globstar **') -minimatch.GLOBSTAR = GLOBSTAR -const expand = require('brace-expansion') - -const plTypes = { - '!': { open: '(?:(?!(?:', close: '))[^/]*?)'}, - '?': { open: '(?:', close: ')?' }, - '+': { open: '(?:', close: ')+' }, - '*': { open: '(?:', close: ')*' }, - '@': { open: '(?:', close: ')' } -} - -// any single thing other than / -// don't need to escape / when using new RegExp() -const qmark = '[^/]' - -// * => any number of characters -const star = qmark + '*?' - -// ** when dots are allowed. Anything goes, except .. and . -// not (^ or / followed by one or two dots followed by $ or /), -// followed by anything, any number of times. -const twoStarDot = '(?:(?!(?:\\\/|^)(?:\\.{1,2})($|\\\/)).)*?' - -// not a ^ or / followed by a dot, -// followed by anything, any number of times. -const twoStarNoDot = '(?:(?!(?:\\\/|^)\\.).)*?' - -// "abc" -> { a:true, b:true, c:true } -const charSet = s => s.split('').reduce((set, c) => { - set[c] = true - return set -}, {}) - -// characters that need to be escaped in RegExp. -const reSpecials = charSet('().*{}+?[]^$\\!') - -// characters that indicate we have to add the pattern start -const addPatternStartSet = charSet('[.(') - -// normalizes slashes. -const slashSplit = /\/+/ - -minimatch.filter = (pattern, options = {}) => - (p, i, list) => minimatch(p, pattern, options) - -const ext = (a, b = {}) => { - const t = {} - Object.keys(a).forEach(k => t[k] = a[k]) - Object.keys(b).forEach(k => t[k] = b[k]) - return t -} - -minimatch.defaults = def => { - if (!def || typeof def !== 'object' || !Object.keys(def).length) { - return minimatch - } - - const orig = minimatch - - const m = (p, pattern, options) => orig(p, pattern, ext(def, options)) - m.Minimatch = class Minimatch extends orig.Minimatch { - constructor (pattern, options) { - super(pattern, ext(def, options)) - } - } - m.Minimatch.defaults = options => orig.defaults(ext(def, options)).Minimatch - m.filter = (pattern, options) => orig.filter(pattern, ext(def, options)) - m.defaults = options => orig.defaults(ext(def, options)) - m.makeRe = (pattern, options) => orig.makeRe(pattern, ext(def, options)) - m.braceExpand = (pattern, options) => orig.braceExpand(pattern, ext(def, options)) - m.match = (list, pattern, options) => orig.match(list, pattern, ext(def, options)) - - return m -} - - - - - -// Brace expansion: -// a{b,c}d -> abd acd -// a{b,}c -> abc ac -// a{0..3}d -> a0d a1d a2d a3d -// a{b,c{d,e}f}g -> abg acdfg acefg -// a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg -// -// Invalid sets are not expanded. -// a{2..}b -> a{2..}b -// a{b}c -> a{b}c -minimatch.braceExpand = (pattern, options) => braceExpand(pattern, options) - -const braceExpand = (pattern, options = {}) => { - assertValidPattern(pattern) - - // Thanks to Yeting Li for - // improving this regexp to avoid a ReDOS vulnerability. - if (options.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern)) { - // shortcut. no need to expand. - return [pattern] - } - - return expand(pattern) -} - -const MAX_PATTERN_LENGTH = 1024 * 64 -const assertValidPattern = pattern => { - if (typeof pattern !== 'string') { - throw new TypeError('invalid pattern') - } - - if (pattern.length > MAX_PATTERN_LENGTH) { - throw new TypeError('pattern is too long') - } -} - -// parse a component of the expanded set. -// At this point, no pattern may contain "/" in it -// so we're going to return a 2d array, where each entry is the full -// pattern, split on '/', and then turned into a regular expression. -// A regexp is made at the end which joins each array with an -// escaped /, and another full one which joins each regexp with |. -// -// Following the lead of Bash 4.1, note that "**" only has special meaning -// when it is the *only* thing in a path portion. Otherwise, any series -// of * is equivalent to a single *. Globstar behavior is enabled by -// default, and can be disabled by setting options.noglobstar. -const SUBPARSE = Symbol('subparse') - -minimatch.makeRe = (pattern, options) => - new Minimatch(pattern, options || {}).makeRe() - -minimatch.match = (list, pattern, options = {}) => { - const mm = new Minimatch(pattern, options) - list = list.filter(f => mm.match(f)) - if (mm.options.nonull && !list.length) { - list.push(pattern) - } - return list -} - -// replace stuff like \* with * -const globUnescape = s => s.replace(/\\(.)/g, '$1') -const regExpEscape = s => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&') - -class Minimatch { - constructor (pattern, options) { - assertValidPattern(pattern) - - if (!options) options = {} - - this.options = options - this.set = [] - this.pattern = pattern - this.windowsPathsNoEscape = !!options.windowsPathsNoEscape || - options.allowWindowsEscape === false - if (this.windowsPathsNoEscape) { - this.pattern = this.pattern.replace(/\\/g, '/') - } - this.regexp = null - this.negate = false - this.comment = false - this.empty = false - this.partial = !!options.partial - - // make the set of regexps etc. - this.make() - } - - debug () {} - - make () { - const pattern = this.pattern - const options = this.options - - // empty patterns and comments match nothing. - if (!options.nocomment && pattern.charAt(0) === '#') { - this.comment = true - return - } - if (!pattern) { - this.empty = true - return - } - - // step 1: figure out negation, etc. - this.parseNegate() - - // step 2: expand braces - let set = this.globSet = this.braceExpand() - - if (options.debug) this.debug = (...args) => console.error(...args) - - this.debug(this.pattern, set) - - // step 3: now we have a set, so turn each one into a series of path-portion - // matching patterns. - // These will be regexps, except in the case of "**", which is - // set to the GLOBSTAR object for globstar behavior, - // and will not contain any / characters - set = this.globParts = set.map(s => s.split(slashSplit)) - - this.debug(this.pattern, set) - - // glob --> regexps - set = set.map((s, si, set) => s.map(this.parse, this)) - - this.debug(this.pattern, set) - - // filter out everything that didn't compile properly. - set = set.filter(s => s.indexOf(false) === -1) - - this.debug(this.pattern, set) - - this.set = set - } - - parseNegate () { - if (this.options.nonegate) return - - const pattern = this.pattern - let negate = false - let negateOffset = 0 - - for (let i = 0; i < pattern.length && pattern.charAt(i) === '!'; i++) { - negate = !negate - negateOffset++ - } - - if (negateOffset) this.pattern = pattern.substr(negateOffset) - this.negate = negate - } - - // set partial to true to test if, for example, - // "/a/b" matches the start of "/*/b/*/d" - // Partial means, if you run out of file before you run - // out of pattern, then that's fine, as long as all - // the parts match. - matchOne (file, pattern, partial) { - var options = this.options - - this.debug('matchOne', - { 'this': this, file: file, pattern: pattern }) - - this.debug('matchOne', file.length, pattern.length) - - for (var fi = 0, - pi = 0, - fl = file.length, - pl = pattern.length - ; (fi < fl) && (pi < pl) - ; fi++, pi++) { - this.debug('matchOne loop') - var p = pattern[pi] - var f = file[fi] - - this.debug(pattern, p, f) - - // should be impossible. - // some invalid regexp stuff in the set. - /* istanbul ignore if */ - if (p === false) return false - - if (p === GLOBSTAR) { - this.debug('GLOBSTAR', [pattern, p, f]) - - // "**" - // a/**/b/**/c would match the following: - // a/b/x/y/z/c - // a/x/y/z/b/c - // a/b/x/b/x/c - // a/b/c - // To do this, take the rest of the pattern after - // the **, and see if it would match the file remainder. - // If so, return success. - // If not, the ** "swallows" a segment, and try again. - // This is recursively awful. - // - // a/**/b/**/c matching a/b/x/y/z/c - // - a matches a - // - doublestar - // - matchOne(b/x/y/z/c, b/**/c) - // - b matches b - // - doublestar - // - matchOne(x/y/z/c, c) -> no - // - matchOne(y/z/c, c) -> no - // - matchOne(z/c, c) -> no - // - matchOne(c, c) yes, hit - var fr = fi - var pr = pi + 1 - if (pr === pl) { - this.debug('** at the end') - // a ** at the end will just swallow the rest. - // We have found a match. - // however, it will not swallow /.x, unless - // options.dot is set. - // . and .. are *never* matched by **, for explosively - // exponential reasons. - for (; fi < fl; fi++) { - if (file[fi] === '.' || file[fi] === '..' || - (!options.dot && file[fi].charAt(0) === '.')) return false - } - return true - } - - // ok, let's see if we can swallow whatever we can. - while (fr < fl) { - var swallowee = file[fr] - - this.debug('\nglobstar while', file, fr, pattern, pr, swallowee) - - // XXX remove this slice. Just pass the start index. - if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) { - this.debug('globstar found match!', fr, fl, swallowee) - // found a match. - return true - } else { - // can't swallow "." or ".." ever. - // can only swallow ".foo" when explicitly asked. - if (swallowee === '.' || swallowee === '..' || - (!options.dot && swallowee.charAt(0) === '.')) { - this.debug('dot detected!', file, fr, pattern, pr) - break - } - - // ** swallows a segment, and continue. - this.debug('globstar swallow a segment, and continue') - fr++ - } - } - - // no match was found. - // However, in partial mode, we can't say this is necessarily over. - // If there's more *pattern* left, then - /* istanbul ignore if */ - if (partial) { - // ran out of file - this.debug('\n>>> no match, partial?', file, fr, pattern, pr) - if (fr === fl) return true - } - return false - } - - // something other than ** - // non-magic patterns just have to match exactly - // patterns with magic have been turned into regexps. - var hit - if (typeof p === 'string') { - hit = f === p - this.debug('string match', p, f, hit) - } else { - hit = f.match(p) - this.debug('pattern match', p, f, hit) - } - - if (!hit) return false - } - - // Note: ending in / means that we'll get a final "" - // at the end of the pattern. This can only match a - // corresponding "" at the end of the file. - // If the file ends in /, then it can only match a - // a pattern that ends in /, unless the pattern just - // doesn't have any more for it. But, a/b/ should *not* - // match "a/b/*", even though "" matches against the - // [^/]*? pattern, except in partial mode, where it might - // simply not be reached yet. - // However, a/b/ should still satisfy a/* - - // now either we fell off the end of the pattern, or we're done. - if (fi === fl && pi === pl) { - // ran out of pattern and filename at the same time. - // an exact hit! - return true - } else if (fi === fl) { - // ran out of file, but still had pattern left. - // this is ok if we're doing the match as part of - // a glob fs traversal. - return partial - } else /* istanbul ignore else */ if (pi === pl) { - // ran out of pattern, still have file left. - // this is only acceptable if we're on the very last - // empty segment of a file with a trailing slash. - // a/* should match a/b/ - return (fi === fl - 1) && (file[fi] === '') - } - - // should be unreachable. - /* istanbul ignore next */ - throw new Error('wtf?') - } - - braceExpand () { - return braceExpand(this.pattern, this.options) - } - - parse (pattern, isSub) { - assertValidPattern(pattern) - - const options = this.options - - // shortcuts - if (pattern === '**') { - if (!options.noglobstar) - return GLOBSTAR - else - pattern = '*' - } - if (pattern === '') return '' - - let re = '' - let hasMagic = !!options.nocase - let escaping = false - // ? => one single character - const patternListStack = [] - const negativeLists = [] - let stateChar - let inClass = false - let reClassStart = -1 - let classStart = -1 - let cs - let pl - let sp - // . and .. never match anything that doesn't start with ., - // even when options.dot is set. - const patternStart = pattern.charAt(0) === '.' ? '' // anything - // not (start or / followed by . or .. followed by / or end) - : options.dot ? '(?!(?:^|\\\/)\\.{1,2}(?:$|\\\/))' - : '(?!\\.)' - - const clearStateChar = () => { - if (stateChar) { - // we had some state-tracking character - // that wasn't consumed by this pass. - switch (stateChar) { - case '*': - re += star - hasMagic = true - break - case '?': - re += qmark - hasMagic = true - break - default: - re += '\\' + stateChar - break - } - this.debug('clearStateChar %j %j', stateChar, re) - stateChar = false - } - } - - for (let i = 0, c; (i < pattern.length) && (c = pattern.charAt(i)); i++) { - this.debug('%s\t%s %s %j', pattern, i, re, c) - - // skip over any that are escaped. - if (escaping) { - /* istanbul ignore next - completely not allowed, even escaped. */ - if (c === '/') { - return false - } - - if (reSpecials[c]) { - re += '\\' - } - re += c - escaping = false - continue - } - - switch (c) { - /* istanbul ignore next */ - case '/': { - // Should already be path-split by now. - return false - } - - case '\\': - clearStateChar() - escaping = true - continue - - // the various stateChar values - // for the "extglob" stuff. - case '?': - case '*': - case '+': - case '@': - case '!': - this.debug('%s\t%s %s %j <-- stateChar', pattern, i, re, c) - - // all of those are literals inside a class, except that - // the glob [!a] means [^a] in regexp - if (inClass) { - this.debug(' in class') - if (c === '!' && i === classStart + 1) c = '^' - re += c - continue - } - - // if we already have a stateChar, then it means - // that there was something like ** or +? in there. - // Handle the stateChar, then proceed with this one. - this.debug('call clearStateChar %j', stateChar) - clearStateChar() - stateChar = c - // if extglob is disabled, then +(asdf|foo) isn't a thing. - // just clear the statechar *now*, rather than even diving into - // the patternList stuff. - if (options.noext) clearStateChar() - continue - - case '(': - if (inClass) { - re += '(' - continue - } - - if (!stateChar) { - re += '\\(' - continue - } - - patternListStack.push({ - type: stateChar, - start: i - 1, - reStart: re.length, - open: plTypes[stateChar].open, - close: plTypes[stateChar].close - }) - // negation is (?:(?!js)[^/]*) - re += stateChar === '!' ? '(?:(?!(?:' : '(?:' - this.debug('plType %j %j', stateChar, re) - stateChar = false - continue - - case ')': - if (inClass || !patternListStack.length) { - re += '\\)' - continue - } - - clearStateChar() - hasMagic = true - pl = patternListStack.pop() - // negation is (?:(?!js)[^/]*) - // The others are (?:) - re += pl.close - if (pl.type === '!') { - negativeLists.push(pl) - } - pl.reEnd = re.length - continue - - case '|': - if (inClass || !patternListStack.length) { - re += '\\|' - continue - } - - clearStateChar() - re += '|' - continue - - // these are mostly the same in regexp and glob - case '[': - // swallow any state-tracking char before the [ - clearStateChar() - - if (inClass) { - re += '\\' + c - continue - } - - inClass = true - classStart = i - reClassStart = re.length - re += c - continue - - case ']': - // a right bracket shall lose its special - // meaning and represent itself in - // a bracket expression if it occurs - // first in the list. -- POSIX.2 2.8.3.2 - if (i === classStart + 1 || !inClass) { - re += '\\' + c - continue - } - - // handle the case where we left a class open. - // "[z-a]" is valid, equivalent to "\[z-a\]" - // split where the last [ was, make sure we don't have - // an invalid re. if so, re-walk the contents of the - // would-be class to re-translate any characters that - // were passed through as-is - // TODO: It would probably be faster to determine this - // without a try/catch and a new RegExp, but it's tricky - // to do safely. For now, this is safe and works. - cs = pattern.substring(classStart + 1, i) - try { - RegExp('[' + cs + ']') - } catch (er) { - // not a valid class! - sp = this.parse(cs, SUBPARSE) - re = re.substr(0, reClassStart) + '\\[' + sp[0] + '\\]' - hasMagic = hasMagic || sp[1] - inClass = false - continue - } - - // finish up the class. - hasMagic = true - inClass = false - re += c - continue - - default: - // swallow any state char that wasn't consumed - clearStateChar() - - if (reSpecials[c] && !(c === '^' && inClass)) { - re += '\\' - } - - re += c - break - - } // switch - } // for - - // handle the case where we left a class open. - // "[abc" is valid, equivalent to "\[abc" - if (inClass) { - // split where the last [ was, and escape it - // this is a huge pita. We now have to re-walk - // the contents of the would-be class to re-translate - // any characters that were passed through as-is - cs = pattern.substr(classStart + 1) - sp = this.parse(cs, SUBPARSE) - re = re.substr(0, reClassStart) + '\\[' + sp[0] - hasMagic = hasMagic || sp[1] - } - - // handle the case where we had a +( thing at the *end* - // of the pattern. - // each pattern list stack adds 3 chars, and we need to go through - // and escape any | chars that were passed through as-is for the regexp. - // Go through and escape them, taking care not to double-escape any - // | chars that were already escaped. - for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) { - let tail - tail = re.slice(pl.reStart + pl.open.length) - this.debug('setting tail', re, pl) - // maybe some even number of \, then maybe 1 \, followed by a | - tail = tail.replace(/((?:\\{2}){0,64})(\\?)\|/g, (_, $1, $2) => { - /* istanbul ignore else - should already be done */ - if (!$2) { - // the | isn't already escaped, so escape it. - $2 = '\\' - } - - // need to escape all those slashes *again*, without escaping the - // one that we need for escaping the | character. As it works out, - // escaping an even number of slashes can be done by simply repeating - // it exactly after itself. That's why this trick works. - // - // I am sorry that you have to see this. - return $1 + $1 + $2 + '|' - }) - - this.debug('tail=%j\n %s', tail, tail, pl, re) - const t = pl.type === '*' ? star - : pl.type === '?' ? qmark - : '\\' + pl.type - - hasMagic = true - re = re.slice(0, pl.reStart) + t + '\\(' + tail - } - - // handle trailing things that only matter at the very end. - clearStateChar() - if (escaping) { - // trailing \\ - re += '\\\\' - } - - // only need to apply the nodot start if the re starts with - // something that could conceivably capture a dot - const addPatternStart = addPatternStartSet[re.charAt(0)] - - // Hack to work around lack of negative lookbehind in JS - // A pattern like: *.!(x).!(y|z) needs to ensure that a name - // like 'a.xyz.yz' doesn't match. So, the first negative - // lookahead, has to look ALL the way ahead, to the end of - // the pattern. - for (let n = negativeLists.length - 1; n > -1; n--) { - const nl = negativeLists[n] - - const nlBefore = re.slice(0, nl.reStart) - const nlFirst = re.slice(nl.reStart, nl.reEnd - 8) - let nlAfter = re.slice(nl.reEnd) - const nlLast = re.slice(nl.reEnd - 8, nl.reEnd) + nlAfter - - // Handle nested stuff like *(*.js|!(*.json)), where open parens - // mean that we should *not* include the ) in the bit that is considered - // "after" the negated section. - const openParensBefore = nlBefore.split('(').length - 1 - let cleanAfter = nlAfter - for (let i = 0; i < openParensBefore; i++) { - cleanAfter = cleanAfter.replace(/\)[+*?]?/, '') - } - nlAfter = cleanAfter - - const dollar = nlAfter === '' && isSub !== SUBPARSE ? '$' : '' - re = nlBefore + nlFirst + nlAfter + dollar + nlLast - } - - // if the re is not "" at this point, then we need to make sure - // it doesn't match against an empty path part. - // Otherwise a/* will match a/, which it should not. - if (re !== '' && hasMagic) { - re = '(?=.)' + re - } - - if (addPatternStart) { - re = patternStart + re - } - - // parsing just a piece of a larger pattern. - if (isSub === SUBPARSE) { - return [re, hasMagic] - } - - // skip the regexp for non-magical patterns - // unescape anything in it, though, so that it'll be - // an exact match against a file etc. - if (!hasMagic) { - return globUnescape(pattern) - } - - const flags = options.nocase ? 'i' : '' - try { - return Object.assign(new RegExp('^' + re + '$', flags), { - _glob: pattern, - _src: re, - }) - } catch (er) /* istanbul ignore next - should be impossible */ { - // If it was an invalid regular expression, then it can't match - // anything. This trick looks for a character after the end of - // the string, which is of course impossible, except in multi-line - // mode, but it's not a /m regex. - return new RegExp('$.') - } - } - - makeRe () { - if (this.regexp || this.regexp === false) return this.regexp - - // at this point, this.set is a 2d array of partial - // pattern strings, or "**". - // - // It's better to use .match(). This function shouldn't - // be used, really, but it's pretty convenient sometimes, - // when you just want to work with a regex. - const set = this.set - - if (!set.length) { - this.regexp = false - return this.regexp - } - const options = this.options - - const twoStar = options.noglobstar ? star - : options.dot ? twoStarDot - : twoStarNoDot - const flags = options.nocase ? 'i' : '' - - // coalesce globstars and regexpify non-globstar patterns - // if it's the only item, then we just do one twoStar - // if it's the first, and there are more, prepend (\/|twoStar\/)? to next - // if it's the last, append (\/twoStar|) to previous - // if it's in the middle, append (\/|\/twoStar\/) to previous - // then filter out GLOBSTAR symbols - let re = set.map(pattern => { - pattern = pattern.map(p => - typeof p === 'string' ? regExpEscape(p) - : p === GLOBSTAR ? GLOBSTAR - : p._src - ).reduce((set, p) => { - if (!(set[set.length - 1] === GLOBSTAR && p === GLOBSTAR)) { - set.push(p) - } - return set - }, []) - pattern.forEach((p, i) => { - if (p !== GLOBSTAR || pattern[i-1] === GLOBSTAR) { - return - } - if (i === 0) { - if (pattern.length > 1) { - pattern[i+1] = '(?:\\\/|' + twoStar + '\\\/)?' + pattern[i+1] - } else { - pattern[i] = twoStar - } - } else if (i === pattern.length - 1) { - pattern[i-1] += '(?:\\\/|' + twoStar + ')?' - } else { - pattern[i-1] += '(?:\\\/|\\\/' + twoStar + '\\\/)' + pattern[i+1] - pattern[i+1] = GLOBSTAR - } - }) - return pattern.filter(p => p !== GLOBSTAR).join('/') - }).join('|') - - // must match entire pattern - // ending in a * or ** will make it less strict. - re = '^(?:' + re + ')$' - - // can match anything, as long as it's not this. - if (this.negate) re = '^(?!' + re + ').*$' - - try { - this.regexp = new RegExp(re, flags) - } catch (ex) /* istanbul ignore next - should be impossible */ { - this.regexp = false - } - return this.regexp - } - - match (f, partial = this.partial) { - this.debug('match', f, this.pattern) - // short-circuit in the case of busted things. - // comments, etc. - if (this.comment) return false - if (this.empty) return f === '' - - if (f === '/' && partial) return true - - const options = this.options - - // windows: need to use /, not \ - if (path.sep !== '/') { - f = f.split(path.sep).join('/') - } - - // treat the test path as a set of pathparts. - f = f.split(slashSplit) - this.debug(this.pattern, 'split', f) - - // just ONE of the pattern sets in this.set needs to match - // in order for it to be valid. If negating, then just one - // match means that we have failed. - // Either way, return on the first hit. - - const set = this.set - this.debug(this.pattern, 'set', set) - - // Find the basename of the path by looking for the last non-empty segment - let filename - for (let i = f.length - 1; i >= 0; i--) { - filename = f[i] - if (filename) break - } - - for (let i = 0; i < set.length; i++) { - const pattern = set[i] - let file = f - if (options.matchBase && pattern.length === 1) { - file = [filename] - } - const hit = this.matchOne(file, pattern, partial) - if (hit) { - if (options.flipNegate) return true - return !this.negate - } - } - - // didn't get any hits. this is success if it's a negative - // pattern, failure otherwise. - if (options.flipNegate) return false - return this.negate - } - - static defaults (def) { - return minimatch.defaults(def).Minimatch - } -} - -minimatch.Minimatch = Minimatch diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/minimatch/package.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/minimatch/package.json deleted file mode 100644 index 8e1a8428..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/minimatch/package.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "author": "Isaac Z. Schlueter (http://blog.izs.me)", - "name": "minimatch", - "description": "a glob matcher in javascript", - "version": "5.1.0", - "repository": { - "type": "git", - "url": "git://github.com/isaacs/minimatch.git" - }, - "main": "minimatch.js", - "scripts": { - "test": "tap", - "snap": "tap", - "preversion": "npm test", - "postversion": "npm publish", - "prepublishOnly": "git push origin --follow-tags" - }, - "engines": { - "node": ">=10" - }, - "dependencies": { - "brace-expansion": "^2.0.1" - }, - "devDependencies": { - "tap": "^15.1.6" - }, - "license": "ISC", - "files": [ - "minimatch.js", - "lib" - ] -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/minimist/.eslintrc b/packages/wyatt_notification_bloc/example/scripts/node_modules/minimist/.eslintrc deleted file mode 100644 index 137f67b4..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/minimist/.eslintrc +++ /dev/null @@ -1,54 +0,0 @@ -{ - "root": true, - - "extends": "@ljharb/eslint-config/node/0.4", - - "rules": { - "array-bracket-spacing": 0, - "array-element-newline": 0, - "brace-style": 1, - "camelcase": 1, - "comma-dangle": 1, - "comma-spacing": 1, - "complexity": 0, - "curly": 1, - "dot-notation": 1, - "eol-last": 1, - "func-style": 1, - "function-paren-newline": 1, - "indent": [1, 4], - "key-spacing": 1, - "max-lines-per-function": 0, - "max-nested-callbacks": 1, - "max-statements": 0, - "multiline-comment-style": 1, - "no-array-constructor": 1, - "no-continue": 1, - "no-div-regex": 1, - "no-extra-parens": 1, - "no-mixed-operators": 1, - "no-multi-spaces": 1, - "no-multiple-empty-lines": 1, - "no-param-reassign": 1, - "no-plusplus": 1, - "no-proto": 1, - "no-redeclare": 1, - "no-restricted-syntax": 1, - "no-shadow": 1, - "no-trailing-spaces": 1, - "no-unused-vars": 1, - "no-use-before-define": 1, - "object-curly-newline": 1, - "object-curly-spacing": 1, - "operator-linebreak": 1, - "quote-props": 1, - "quotes": 1, - "semi-style": 1, - "semi": 1, - "space-before-blocks": 1, - "space-before-function-paren": 1, - "space-infix-ops": 1, - "strict": 1, - "wrap-regex": 1, - }, -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/minimist/.github/FUNDING.yml b/packages/wyatt_notification_bloc/example/scripts/node_modules/minimist/.github/FUNDING.yml deleted file mode 100644 index a9366222..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/minimist/.github/FUNDING.yml +++ /dev/null @@ -1,12 +0,0 @@ -# These are supported funding model platforms - -github: [ljharb] -patreon: # Replace with a single Patreon username -open_collective: # Replace with a single Open Collective username -ko_fi: # Replace with a single Ko-fi username -tidelift: npm/minimist -community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry -liberapay: # Replace with a single Liberapay username -issuehunt: # Replace with a single IssueHunt username -otechie: # Replace with a single Otechie username -custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/minimist/.nycrc b/packages/wyatt_notification_bloc/example/scripts/node_modules/minimist/.nycrc deleted file mode 100644 index 55c3d293..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/minimist/.nycrc +++ /dev/null @@ -1,14 +0,0 @@ -{ - "all": true, - "check-coverage": false, - "reporter": ["text-summary", "text", "html", "json"], - "lines": 86, - "statements": 85.93, - "functions": 82.43, - "branches": 76.06, - "exclude": [ - "coverage", - "example", - "test" - ] -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/minimist/CHANGELOG.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/minimist/CHANGELOG.md deleted file mode 100644 index e0e00bd0..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/minimist/CHANGELOG.md +++ /dev/null @@ -1,212 +0,0 @@ -# Changelog - -All notable changes to this project will be documented in this file. - -The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) -and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). - -## [v1.2.7](https://github.com/minimistjs/minimist/compare/v1.2.6...v1.2.7) - 2022-10-10 - -### Commits - -- [meta] add `auto-changelog` [`0ebf4eb`](https://github.com/minimistjs/minimist/commit/0ebf4ebcd5f7787a5524d31a849ef41316b83c3c) -- [actions] add reusable workflows [`e115b63`](https://github.com/minimistjs/minimist/commit/e115b63fa9d3909f33b00a2db647ff79068388de) -- [eslint] add eslint; rules to enable later are warnings [`f58745b`](https://github.com/minimistjs/minimist/commit/f58745b9bb84348e1be72af7dbba5840c7c13013) -- [Dev Deps] switch from `covert` to `nyc` [`ab03356`](https://github.com/minimistjs/minimist/commit/ab033567b9c8b31117cb026dc7f1e592ce455c65) -- [readme] rename and add badges [`236f4a0`](https://github.com/minimistjs/minimist/commit/236f4a07e4ebe5ee44f1496ec6974991ab293ffd) -- [meta] create FUNDING.yml; add `funding` in package.json [`783a49b`](https://github.com/minimistjs/minimist/commit/783a49bfd47e8335d3098a8cac75662cf71eb32a) -- [meta] use `npmignore` to autogenerate an npmignore file [`f81ece6`](https://github.com/minimistjs/minimist/commit/f81ece6aaec2fa14e69ff4f1e0407a8c4e2635a2) -- Only apps should have lockfiles [`56cad44`](https://github.com/minimistjs/minimist/commit/56cad44c7f879b9bb5ec18fcc349308024a89bfc) -- [Dev Deps] update `covert`, `tape`; remove unnecessary `tap` [`49c5f9f`](https://github.com/minimistjs/minimist/commit/49c5f9fb7e6a92db9eb340cc679de92fb3aacded) -- [Tests] add `aud` in `posttest` [`228ae93`](https://github.com/minimistjs/minimist/commit/228ae938f3cd9db9dfd8bd7458b076a7b2aef280) -- [meta] add `safe-publish-latest` [`01fc23f`](https://github.com/minimistjs/minimist/commit/01fc23f5104f85c75059972e01dd33796ab529ff) -- [meta] update repo URLs [`6b164c7`](https://github.com/minimistjs/minimist/commit/6b164c7d68e0b6bf32f894699effdfb7c63041dd) - -## [v1.2.6](https://github.com/minimistjs/minimist/compare/v1.2.5...v1.2.6) - 2022-03-21 - -### Commits - -- test from prototype pollution PR [`bc8ecee`](https://github.com/minimistjs/minimist/commit/bc8ecee43875261f4f17eb20b1243d3ed15e70eb) -- isConstructorOrProto adapted from PR [`c2b9819`](https://github.com/minimistjs/minimist/commit/c2b981977fa834b223b408cfb860f933c9811e4d) -- security notice for additional prototype pollution issue [`ef88b93`](https://github.com/minimistjs/minimist/commit/ef88b9325f77b5ee643ccfc97e2ebda577e4c4e2) - -## [v1.2.5](https://github.com/minimistjs/minimist/compare/v1.2.4...v1.2.5) - 2020-03-12 - -## [v1.2.4](https://github.com/minimistjs/minimist/compare/v1.2.3...v1.2.4) - 2020-03-11 - -### Commits - -- security notice [`4cf1354`](https://github.com/minimistjs/minimist/commit/4cf1354839cb972e38496d35e12f806eea92c11f) -- additional test for constructor prototype pollution [`1043d21`](https://github.com/minimistjs/minimist/commit/1043d212c3caaf871966e710f52cfdf02f9eea4b) - -## [v1.2.3](https://github.com/minimistjs/minimist/compare/v1.2.2...v1.2.3) - 2020-03-10 - -### Commits - -- more failing proto pollution tests [`13c01a5`](https://github.com/minimistjs/minimist/commit/13c01a5327736903704984b7f65616b8476850cc) -- even more aggressive checks for protocol pollution [`38a4d1c`](https://github.com/minimistjs/minimist/commit/38a4d1caead72ef99e824bb420a2528eec03d9ab) - -## [v1.2.2](https://github.com/minimistjs/minimist/compare/v1.2.1...v1.2.2) - 2020-03-10 - -### Commits - -- failing test for protocol pollution [`0efed03`](https://github.com/minimistjs/minimist/commit/0efed0340ec8433638758f7ca0c77cb20a0bfbab) -- cleanup [`67d3722`](https://github.com/minimistjs/minimist/commit/67d3722413448d00a62963d2d30c34656a92d7e2) -- console.dir -> console.log [`47acf72`](https://github.com/minimistjs/minimist/commit/47acf72c715a630bf9ea013867f47f1dd69dfc54) -- don't assign onto __proto__ [`63e7ed0`](https://github.com/minimistjs/minimist/commit/63e7ed05aa4b1889ec2f3b196426db4500cbda94) - -## [v1.2.1](https://github.com/minimistjs/minimist/compare/v1.2.0...v1.2.1) - 2020-03-10 - -### Merged - -- move the `opts['--']` example back where it belongs [`#63`](https://github.com/minimistjs/minimist/pull/63) - -### Commits - -- add test [`6be5dae`](https://github.com/minimistjs/minimist/commit/6be5dae35a32a987bcf4137fcd6c19c5200ee909) -- fix bad boolean regexp [`ac3fc79`](https://github.com/minimistjs/minimist/commit/ac3fc796e63b95128fdbdf67ea7fad71bd59aa76) - -## [v1.2.0](https://github.com/minimistjs/minimist/compare/v1.1.3...v1.2.0) - 2015-08-24 - -### Commits - -- failing -k=v short test [`63416b8`](https://github.com/minimistjs/minimist/commit/63416b8cd1d0d70e4714564cce465a36e4dd26d7) -- kv short fix [`6bbe145`](https://github.com/minimistjs/minimist/commit/6bbe14529166245e86424f220a2321442fe88dc3) -- failing kv short test [`f72ab7f`](https://github.com/minimistjs/minimist/commit/f72ab7f4572adc52902c9b6873cc969192f01b10) -- fixed kv test [`f5a48c3`](https://github.com/minimistjs/minimist/commit/f5a48c3e50e40ca54f00c8e84de4b4d6e9897fa8) -- enforce space between arg key and value [`86b321a`](https://github.com/minimistjs/minimist/commit/86b321affe648a8e016c095a4f0efa9d9074f502) - -## [v1.1.3](https://github.com/minimistjs/minimist/compare/v1.1.2...v1.1.3) - 2015-08-06 - -### Commits - -- add failing test - boolean alias array [`0fa3c5b`](https://github.com/minimistjs/minimist/commit/0fa3c5b3dd98551ddecf5392831b4c21211743fc) -- fix boolean values with multiple aliases [`9c0a6e7`](https://github.com/minimistjs/minimist/commit/9c0a6e7de25a273b11bbf9a7464f0bd833779795) - -## [v1.1.2](https://github.com/minimistjs/minimist/compare/v1.1.1...v1.1.2) - 2015-07-22 - -### Commits - -- Convert boolean arguments to boolean values [`8f3dc27`](https://github.com/minimistjs/minimist/commit/8f3dc27cf833f1d54671b6d0bcb55c2fe19672a9) -- use non-ancient npm, node 0.12 and iojs [`61ed1d0`](https://github.com/minimistjs/minimist/commit/61ed1d034b9ec7282764ce76f3992b1a0b4906ae) -- an older npm for 0.8 [`25cf778`](https://github.com/minimistjs/minimist/commit/25cf778b1220e7838a526832ad6972f75244054f) - -## [v1.1.1](https://github.com/minimistjs/minimist/compare/v1.1.0...v1.1.1) - 2015-03-10 - -### Commits - -- check that they type of a value is a boolean, not just that it is currently set to a boolean [`6863198`](https://github.com/minimistjs/minimist/commit/6863198e36139830ff1f20ffdceaddd93f2c1db9) -- upgrade tape, fix type issues from old tape version [`806712d`](https://github.com/minimistjs/minimist/commit/806712df91604ed02b8e39aa372b84aea659ee34) -- test for setting a boolean to a null default [`8c444fe`](https://github.com/minimistjs/minimist/commit/8c444fe89384ded7d441c120915ea60620b01dd3) -- if the previous value was a boolean, without an default (or with an alias) don't make an array either [`e5f419a`](https://github.com/minimistjs/minimist/commit/e5f419a3b5b3bc3f9e5ac71b7040621af70ed2dd) - -## [v1.1.0](https://github.com/minimistjs/minimist/compare/v1.0.0...v1.1.0) - 2014-08-10 - -### Commits - -- add support for handling "unknown" options not registered with the parser. [`6f3cc5d`](https://github.com/minimistjs/minimist/commit/6f3cc5d4e84524932a6ef2ce3592acc67cdd4383) -- reformat package.json [`02ed371`](https://github.com/minimistjs/minimist/commit/02ed37115194d3697ff358e8e25e5e66bab1d9f8) -- coverage script [`e5531ba`](https://github.com/minimistjs/minimist/commit/e5531ba0479da3b8138d3d8cac545d84ccb1c8df) -- extra fn to get 100% coverage again [`a6972da`](https://github.com/minimistjs/minimist/commit/a6972da89e56bf77642f8ec05a13b6558db93498) - -## [v1.0.0](https://github.com/minimistjs/minimist/compare/v0.2.1...v1.0.0) - 2014-08-10 - -### Commits - -- added stopEarly option [`471c7e4`](https://github.com/minimistjs/minimist/commit/471c7e4a7e910fc7ad8f9df850a186daf32c64e9) -- fix list [`fef6ae7`](https://github.com/minimistjs/minimist/commit/fef6ae79c38b9dc1c49569abb7cd04eb965eac5e) - -## [v0.2.1](https://github.com/minimistjs/minimist/compare/v0.2.0...v0.2.1) - 2020-03-12 - -## [v0.2.0](https://github.com/minimistjs/minimist/compare/v0.1.0...v0.2.0) - 2014-06-19 - -### Commits - -- support all-boolean mode [`450a97f`](https://github.com/minimistjs/minimist/commit/450a97f6e2bc85c7a4a13185c19a818d9a5ebe69) - -## [v0.1.0](https://github.com/minimistjs/minimist/compare/v0.0.10...v0.1.0) - 2014-05-12 - -### Commits - -- Provide a mechanism to segregate -- arguments [`ce4a1e6`](https://github.com/minimistjs/minimist/commit/ce4a1e63a7e8d5ab88d2a3768adefa6af98a445a) -- documented argv['--'] [`14db0e6`](https://github.com/minimistjs/minimist/commit/14db0e6dbc6d2b9e472adaa54dad7004b364634f) -- Adding a test-case for notFlags segregation [`715c1e3`](https://github.com/minimistjs/minimist/commit/715c1e3714be223f998f6c537af6b505f0236c16) - -## [v0.0.10](https://github.com/minimistjs/minimist/compare/v0.0.9...v0.0.10) - 2014-05-11 - -### Commits - -- dedicated boolean test [`46e448f`](https://github.com/minimistjs/minimist/commit/46e448f9f513cfeb2bcc8b688b9b47ba1e515c2b) -- dedicated num test [`9bf2d36`](https://github.com/minimistjs/minimist/commit/9bf2d36f1d3b8795be90b8f7de0a937f098aa394) -- aliased values treated as strings [`1ab743b`](https://github.com/minimistjs/minimist/commit/1ab743bad4484d69f1259bed42f9531de01119de) -- cover the case of already numbers, at 100% coverage [`b2bb044`](https://github.com/minimistjs/minimist/commit/b2bb04436599d77a2ce029e8e555e25b3aa55d13) -- another test for higher coverage [`3662624`](https://github.com/minimistjs/minimist/commit/3662624be976d5489d486a856849c048d13be903) - -## [v0.0.9](https://github.com/minimistjs/minimist/compare/v0.0.8...v0.0.9) - 2014-05-08 - -### Commits - -- Eliminate `longest` fn. [`824f642`](https://github.com/minimistjs/minimist/commit/824f642038d1b02ede68b6261d1d65163390929a) - -## [v0.0.8](https://github.com/minimistjs/minimist/compare/v0.0.7...v0.0.8) - 2014-02-20 - -### Commits - -- return '' if flag is string and empty [`fa63ed4`](https://github.com/minimistjs/minimist/commit/fa63ed4651a4ef4eefddce34188e0d98d745a263) -- handle joined single letters [`66c248f`](https://github.com/minimistjs/minimist/commit/66c248f0241d4d421d193b022e9e365f11178534) - -## [v0.0.7](https://github.com/minimistjs/minimist/compare/v0.0.6...v0.0.7) - 2014-02-08 - -### Commits - -- another swap of .test for .match [`d1da408`](https://github.com/minimistjs/minimist/commit/d1da40819acbe846d89a5c02721211e3c1260dde) - -## [v0.0.6](https://github.com/minimistjs/minimist/compare/v0.0.5...v0.0.6) - 2014-02-08 - -### Commits - -- use .test() instead of .match() to not crash on non-string values in the arguments array [`7e0d1ad`](https://github.com/minimistjs/minimist/commit/7e0d1add8c9e5b9b20a4d3d0f9a94d824c578da1) - -## [v0.0.5](https://github.com/minimistjs/minimist/compare/v0.0.4...v0.0.5) - 2013-09-18 - -### Commits - -- Improve '--' handling. [`b11822c`](https://github.com/minimistjs/minimist/commit/b11822c09cc9d2460f30384d12afc0b953c037a4) - -## [v0.0.4](https://github.com/minimistjs/minimist/compare/v0.0.3...v0.0.4) - 2013-09-17 - -## [v0.0.3](https://github.com/minimistjs/minimist/compare/v0.0.2...v0.0.3) - 2013-09-12 - -### Commits - -- failing test for single dash preceeding a double dash [`b465514`](https://github.com/minimistjs/minimist/commit/b465514b82c9ae28972d714facd951deb2ad762b) -- fix for the dot test [`6a095f1`](https://github.com/minimistjs/minimist/commit/6a095f1d364c8fab2d6753d2291a0649315d297a) - -## [v0.0.2](https://github.com/minimistjs/minimist/compare/v0.0.1...v0.0.2) - 2013-08-28 - -### Commits - -- allow dotted aliases & defaults [`321c33e`](https://github.com/minimistjs/minimist/commit/321c33e755485faaeb44eeb1c05d33b2e0a5a7c4) -- use a better version of ff [`e40f611`](https://github.com/minimistjs/minimist/commit/e40f61114cf7be6f7947f7b3eed345853a67dbbb) - -## [v0.0.1](https://github.com/minimistjs/minimist/compare/v0.0.0...v0.0.1) - 2013-06-25 - -### Commits - -- remove trailing commas [`6ff0fa0`](https://github.com/minimistjs/minimist/commit/6ff0fa055064f15dbe06d50b89d5173a6796e1db) - -## v0.0.0 - 2013-06-25 - -### Commits - -- half of the parse test ported [`3079326`](https://github.com/minimistjs/minimist/commit/307932601325087de6cf94188eb798ffc4f3088a) -- stripped down code and a passing test from optimist [`7cced88`](https://github.com/minimistjs/minimist/commit/7cced88d82e399d1a03ed23eb667f04d3f320d10) -- ported parse tests completely over [`9448754`](https://github.com/minimistjs/minimist/commit/944875452e0820df6830b1408c26a0f7d3e1db04) -- docs, package.json [`a5bf46a`](https://github.com/minimistjs/minimist/commit/a5bf46ac9bb3bd114a9c340276c62c1091e538d5) -- move more short tests into short.js [`503edb5`](https://github.com/minimistjs/minimist/commit/503edb5c41d89c0d40831ee517154fc13b0f18b9) -- default bool test was wrong, not the code [`1b9f5db`](https://github.com/minimistjs/minimist/commit/1b9f5db4741b49962846081b68518de824992097) -- passing long tests ripped out of parse.js [`7972c4a`](https://github.com/minimistjs/minimist/commit/7972c4aff1f4803079e1668006658e2a761a0428) -- badges [`84c0370`](https://github.com/minimistjs/minimist/commit/84c037063664d42878aace715fe6572ce01b6f3b) -- all the tests now ported, some failures [`64239ed`](https://github.com/minimistjs/minimist/commit/64239edfe92c711c4eb0da254fcdfad2a5fdb605) -- failing short test [`f8a5341`](https://github.com/minimistjs/minimist/commit/f8a534112dd1138d2fad722def56a848480c446f) -- fixed the numeric test [`6b034f3`](https://github.com/minimistjs/minimist/commit/6b034f37c79342c60083ed97fd222e16928aac51) diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/minimist/LICENSE b/packages/wyatt_notification_bloc/example/scripts/node_modules/minimist/LICENSE deleted file mode 100644 index ee27ba4b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/minimist/LICENSE +++ /dev/null @@ -1,18 +0,0 @@ -This software is released under the MIT license: - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/minimist/README.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/minimist/README.md deleted file mode 100644 index 30ff92df..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/minimist/README.md +++ /dev/null @@ -1,117 +0,0 @@ -# minimist [![Version Badge][npm-version-svg]][package-url] - -[![github actions][actions-image]][actions-url] -[![coverage][codecov-image]][codecov-url] -[![License][license-image]][license-url] -[![Downloads][downloads-image]][downloads-url] - -[![npm badge][npm-badge-png]][package-url] - -parse argument options - -This module is the guts of optimist's argument parser without all the -fanciful decoration. - -# example - -``` js -var argv = require('minimist')(process.argv.slice(2)); -console.log(argv); -``` - -``` -$ node example/parse.js -a beep -b boop -{ _: [], a: 'beep', b: 'boop' } -``` - -``` -$ node example/parse.js -x 3 -y 4 -n5 -abc --beep=boop foo bar baz -{ _: [ 'foo', 'bar', 'baz' ], - x: 3, - y: 4, - n: 5, - a: true, - b: true, - c: true, - beep: 'boop' } -``` - -# security - -Previous versions had a prototype pollution bug that could cause privilege -escalation in some circumstances when handling untrusted user input. - -Please use version 1.2.6 or later: - -* https://security.snyk.io/vuln/SNYK-JS-MINIMIST-2429795 (version <=1.2.5) -* https://snyk.io/vuln/SNYK-JS-MINIMIST-559764 (version <=1.2.3) - -# methods - -``` js -var parseArgs = require('minimist') -``` - -## var argv = parseArgs(args, opts={}) - -Return an argument object `argv` populated with the array arguments from `args`. - -`argv._` contains all the arguments that didn't have an option associated with -them. - -Numeric-looking arguments will be returned as numbers unless `opts.string` or -`opts.boolean` is set for that argument name. - -Any arguments after `'--'` will not be parsed and will end up in `argv._`. - -options can be: - -* `opts.string` - a string or array of strings argument names to always treat as -strings -* `opts.boolean` - a boolean, string or array of strings to always treat as -booleans. if `true` will treat all double hyphenated arguments without equal signs -as boolean (e.g. affects `--foo`, not `-f` or `--foo=bar`) -* `opts.alias` - an object mapping string names to strings or arrays of string -argument names to use as aliases -* `opts.default` - an object mapping string argument names to default values -* `opts.stopEarly` - when true, populate `argv._` with everything after the -first non-option -* `opts['--']` - when true, populate `argv._` with everything before the `--` -and `argv['--']` with everything after the `--`. Here's an example: - - ``` - > require('./')('one two three -- four five --six'.split(' '), { '--': true }) - { _: [ 'one', 'two', 'three' ], - '--': [ 'four', 'five', '--six' ] } - ``` - - Note that with `opts['--']` set, parsing for arguments still stops after the - `--`. - -* `opts.unknown` - a function which is invoked with a command line parameter not -defined in the `opts` configuration object. If the function returns `false`, the -unknown option is not added to `argv`. - -# install - -With [npm](https://npmjs.org) do: - -``` -npm install minimist -``` - -# license - -MIT - -[package-url]: https://npmjs.org/package/minimist -[npm-version-svg]: https://versionbadg.es/minimistjs/minimist.svg -[npm-badge-png]: https://nodei.co/npm/minimist.png?downloads=true&stars=true -[license-image]: https://img.shields.io/npm/l/minimist.svg -[license-url]: LICENSE -[downloads-image]: https://img.shields.io/npm/dm/minimist.svg -[downloads-url]: https://npm-stat.com/charts.html?package=minimist -[codecov-image]: https://codecov.io/gh/minimistjs/minimist/branch/main/graphs/badge.svg -[codecov-url]: https://app.codecov.io/gh/minimistjs/minimist/ -[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/minimistjs/minimist -[actions-url]: https://github.com/minimistjs/minimist/actions diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/minimist/example/parse.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/minimist/example/parse.js deleted file mode 100644 index f7c8d498..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/minimist/example/parse.js +++ /dev/null @@ -1,2 +0,0 @@ -var argv = require('../')(process.argv.slice(2)); -console.log(argv); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/minimist/index.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/minimist/index.js deleted file mode 100644 index d9c3eb79..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/minimist/index.js +++ /dev/null @@ -1,249 +0,0 @@ -module.exports = function (args, opts) { - if (!opts) opts = {}; - - var flags = { bools : {}, strings : {}, unknownFn: null }; - - if (typeof opts['unknown'] === 'function') { - flags.unknownFn = opts['unknown']; - } - - if (typeof opts['boolean'] === 'boolean' && opts['boolean']) { - flags.allBools = true; - } else { - [].concat(opts['boolean']).filter(Boolean).forEach(function (key) { - flags.bools[key] = true; - }); - } - - var aliases = {}; - Object.keys(opts.alias || {}).forEach(function (key) { - aliases[key] = [].concat(opts.alias[key]); - aliases[key].forEach(function (x) { - aliases[x] = [key].concat(aliases[key].filter(function (y) { - return x !== y; - })); - }); - }); - - [].concat(opts.string).filter(Boolean).forEach(function (key) { - flags.strings[key] = true; - if (aliases[key]) { - flags.strings[aliases[key]] = true; - } - }); - - var defaults = opts['default'] || {}; - - var argv = { _ : [] }; - Object.keys(flags.bools).forEach(function (key) { - setArg(key, defaults[key] === undefined ? false : defaults[key]); - }); - - var notFlags = []; - - if (args.indexOf('--') !== -1) { - notFlags = args.slice(args.indexOf('--')+1); - args = args.slice(0, args.indexOf('--')); - } - - function argDefined(key, arg) { - return (flags.allBools && /^--[^=]+$/.test(arg)) || - flags.strings[key] || flags.bools[key] || aliases[key]; - } - - function setArg (key, val, arg) { - if (arg && flags.unknownFn && !argDefined(key, arg)) { - if (flags.unknownFn(arg) === false) return; - } - - var value = !flags.strings[key] && isNumber(val) - ? Number(val) : val - ; - setKey(argv, key.split('.'), value); - - (aliases[key] || []).forEach(function (x) { - setKey(argv, x.split('.'), value); - }); - } - - function setKey (obj, keys, value) { - var o = obj; - for (var i = 0; i < keys.length-1; i++) { - var key = keys[i]; - if (isConstructorOrProto(o, key)) return; - if (o[key] === undefined) o[key] = {}; - if (o[key] === Object.prototype || o[key] === Number.prototype - || o[key] === String.prototype) o[key] = {}; - if (o[key] === Array.prototype) o[key] = []; - o = o[key]; - } - - var key = keys[keys.length - 1]; - if (isConstructorOrProto(o, key)) return; - if (o === Object.prototype || o === Number.prototype - || o === String.prototype) o = {}; - if (o === Array.prototype) o = []; - if (o[key] === undefined || flags.bools[key] || typeof o[key] === 'boolean') { - o[key] = value; - } - else if (Array.isArray(o[key])) { - o[key].push(value); - } - else { - o[key] = [ o[key], value ]; - } - } - - function aliasIsBoolean(key) { - return aliases[key].some(function (x) { - return flags.bools[x]; - }); - } - - for (var i = 0; i < args.length; i++) { - var arg = args[i]; - - if (/^--.+=/.test(arg)) { - // Using [\s\S] instead of . because js doesn't support the - // 'dotall' regex modifier. See: - // http://stackoverflow.com/a/1068308/13216 - var m = arg.match(/^--([^=]+)=([\s\S]*)$/); - var key = m[1]; - var value = m[2]; - if (flags.bools[key]) { - value = value !== 'false'; - } - setArg(key, value, arg); - } - else if (/^--no-.+/.test(arg)) { - var key = arg.match(/^--no-(.+)/)[1]; - setArg(key, false, arg); - } - else if (/^--.+/.test(arg)) { - var key = arg.match(/^--(.+)/)[1]; - var next = args[i + 1]; - if (next !== undefined && !/^-/.test(next) - && !flags.bools[key] - && !flags.allBools - && (aliases[key] ? !aliasIsBoolean(key) : true)) { - setArg(key, next, arg); - i++; - } - else if (/^(true|false)$/.test(next)) { - setArg(key, next === 'true', arg); - i++; - } - else { - setArg(key, flags.strings[key] ? '' : true, arg); - } - } - else if (/^-[^-]+/.test(arg)) { - var letters = arg.slice(1,-1).split(''); - - var broken = false; - for (var j = 0; j < letters.length; j++) { - var next = arg.slice(j+2); - - if (next === '-') { - setArg(letters[j], next, arg) - continue; - } - - if (/[A-Za-z]/.test(letters[j]) && /=/.test(next)) { - setArg(letters[j], next.split('=')[1], arg); - broken = true; - break; - } - - if (/[A-Za-z]/.test(letters[j]) - && /-?\d+(\.\d*)?(e-?\d+)?$/.test(next)) { - setArg(letters[j], next, arg); - broken = true; - break; - } - - if (letters[j+1] && letters[j+1].match(/\W/)) { - setArg(letters[j], arg.slice(j+2), arg); - broken = true; - break; - } - else { - setArg(letters[j], flags.strings[letters[j]] ? '' : true, arg); - } - } - - var key = arg.slice(-1)[0]; - if (!broken && key !== '-') { - if (args[i+1] && !/^(-|--)[^-]/.test(args[i+1]) - && !flags.bools[key] - && (aliases[key] ? !aliasIsBoolean(key) : true)) { - setArg(key, args[i+1], arg); - i++; - } - else if (args[i+1] && /^(true|false)$/.test(args[i+1])) { - setArg(key, args[i+1] === 'true', arg); - i++; - } - else { - setArg(key, flags.strings[key] ? '' : true, arg); - } - } - } - else { - if (!flags.unknownFn || flags.unknownFn(arg) !== false) { - argv._.push( - flags.strings['_'] || !isNumber(arg) ? arg : Number(arg) - ); - } - if (opts.stopEarly) { - argv._.push.apply(argv._, args.slice(i + 1)); - break; - } - } - } - - Object.keys(defaults).forEach(function (key) { - if (!hasKey(argv, key.split('.'))) { - setKey(argv, key.split('.'), defaults[key]); - - (aliases[key] || []).forEach(function (x) { - setKey(argv, x.split('.'), defaults[key]); - }); - } - }); - - if (opts['--']) { - argv['--'] = new Array(); - notFlags.forEach(function(key) { - argv['--'].push(key); - }); - } - else { - notFlags.forEach(function(key) { - argv._.push(key); - }); - } - - return argv; -}; - -function hasKey (obj, keys) { - var o = obj; - keys.slice(0,-1).forEach(function (key) { - o = (o[key] || {}); - }); - - var key = keys[keys.length - 1]; - return key in o; -} - -function isNumber (x) { - if (typeof x === 'number') return true; - if (/^0x[0-9a-f]+$/i.test(x)) return true; - return /^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(x); -} - - -function isConstructorOrProto (obj, key) { - return key === 'constructor' && typeof obj[key] === 'function' || key === '__proto__'; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/minimist/package.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/minimist/package.json deleted file mode 100644 index 89a639ed..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/minimist/package.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "name": "minimist", - "version": "1.2.7", - "description": "parse argument options", - "main": "index.js", - "devDependencies": { - "@ljharb/eslint-config": "^21.0.0", - "aud": "^2.0.1", - "auto-changelog": "^2.4.0", - "eslint": "=8.8.0", - "in-publish": "^2.0.1", - "npmignore": "^0.3.0", - "nyc": "^10.3.2", - "safe-publish-latest": "^2.0.0", - "tape": "^5.6.1" - }, - "scripts": { - "prepack": "npmignore --auto --commentLines=auto", - "prepublishOnly": "safe-publish-latest", - "prepublish": "not-in-publish || npm run prepublishOnly", - "lint": "eslint --ext=js,mjs .", - "pretest": "npm run lint", - "tests-only": "nyc tape test/*.js", - "test": "npm run tests-only", - "posttest": "aud --production", - "version": "auto-changelog && git add CHANGELOG.md", - "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"" - }, - "testling": { - "files": "test/*.js", - "browsers": [ - "ie/6..latest", - "ff/5", - "firefox/latest", - "chrome/10", - "chrome/latest", - "safari/5.1", - "safari/latest", - "opera/12" - ] - }, - "repository": { - "type": "git", - "url": "git://github.com/minimistjs/minimist.git" - }, - "homepage": "https://github.com/minimistjs/minimist", - "keywords": [ - "argv", - "getopt", - "parser", - "optimist" - ], - "author": { - "name": "James Halliday", - "email": "mail@substack.net", - "url": "http://substack.net" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - }, - "license": "MIT", - "auto-changelog": { - "output": "CHANGELOG.md", - "template": "keepachangelog", - "unreleased": false, - "commitLimit": false, - "backfillLimit": false, - "hideCredit": true - }, - "publishConfig": { - "ignore": [ - ".github/workflows" - ] - } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/minimist/test/all_bool.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/minimist/test/all_bool.js deleted file mode 100644 index ac835483..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/minimist/test/all_bool.js +++ /dev/null @@ -1,32 +0,0 @@ -var parse = require('../'); -var test = require('tape'); - -test('flag boolean true (default all --args to boolean)', function (t) { - var argv = parse(['moo', '--honk', 'cow'], { - boolean: true - }); - - t.deepEqual(argv, { - honk: true, - _: ['moo', 'cow'] - }); - - t.deepEqual(typeof argv.honk, 'boolean'); - t.end(); -}); - -test('flag boolean true only affects double hyphen arguments without equals signs', function (t) { - var argv = parse(['moo', '--honk', 'cow', '-p', '55', '--tacos=good'], { - boolean: true - }); - - t.deepEqual(argv, { - honk: true, - tacos: 'good', - p: 55, - _: ['moo', 'cow'] - }); - - t.deepEqual(typeof argv.honk, 'boolean'); - t.end(); -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/minimist/test/bool.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/minimist/test/bool.js deleted file mode 100644 index 5f7dbde1..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/minimist/test/bool.js +++ /dev/null @@ -1,178 +0,0 @@ -var parse = require('../'); -var test = require('tape'); - -test('flag boolean default false', function (t) { - var argv = parse(['moo'], { - boolean: ['t', 'verbose'], - default: { verbose: false, t: false } - }); - - t.deepEqual(argv, { - verbose: false, - t: false, - _: ['moo'] - }); - - t.deepEqual(typeof argv.verbose, 'boolean'); - t.deepEqual(typeof argv.t, 'boolean'); - t.end(); - -}); - -test('boolean groups', function (t) { - var argv = parse([ '-x', '-z', 'one', 'two', 'three' ], { - boolean: ['x','y','z'] - }); - - t.deepEqual(argv, { - x : true, - y : false, - z : true, - _ : [ 'one', 'two', 'three' ] - }); - - t.deepEqual(typeof argv.x, 'boolean'); - t.deepEqual(typeof argv.y, 'boolean'); - t.deepEqual(typeof argv.z, 'boolean'); - t.end(); -}); -test('boolean and alias with chainable api', function (t) { - var aliased = [ '-h', 'derp' ]; - var regular = [ '--herp', 'derp' ]; - var opts = { - herp: { alias: 'h', boolean: true } - }; - var aliasedArgv = parse(aliased, { - boolean: 'herp', - alias: { h: 'herp' } - }); - var propertyArgv = parse(regular, { - boolean: 'herp', - alias: { h: 'herp' } - }); - var expected = { - herp: true, - h: true, - '_': [ 'derp' ] - }; - - t.same(aliasedArgv, expected); - t.same(propertyArgv, expected); - t.end(); -}); - -test('boolean and alias with options hash', function (t) { - var aliased = [ '-h', 'derp' ]; - var regular = [ '--herp', 'derp' ]; - var opts = { - alias: { 'h': 'herp' }, - boolean: 'herp' - }; - var aliasedArgv = parse(aliased, opts); - var propertyArgv = parse(regular, opts); - var expected = { - herp: true, - h: true, - '_': [ 'derp' ] - }; - t.same(aliasedArgv, expected); - t.same(propertyArgv, expected); - t.end(); -}); - -test('boolean and alias array with options hash', function (t) { - var aliased = [ '-h', 'derp' ]; - var regular = [ '--herp', 'derp' ]; - var alt = [ '--harp', 'derp' ]; - var opts = { - alias: { 'h': ['herp', 'harp'] }, - boolean: 'h' - }; - var aliasedArgv = parse(aliased, opts); - var propertyArgv = parse(regular, opts); - var altPropertyArgv = parse(alt, opts); - var expected = { - harp: true, - herp: true, - h: true, - '_': [ 'derp' ] - }; - t.same(aliasedArgv, expected); - t.same(propertyArgv, expected); - t.same(altPropertyArgv, expected); - t.end(); -}); - -test('boolean and alias using explicit true', function (t) { - var aliased = [ '-h', 'true' ]; - var regular = [ '--herp', 'true' ]; - var opts = { - alias: { h: 'herp' }, - boolean: 'h' - }; - var aliasedArgv = parse(aliased, opts); - var propertyArgv = parse(regular, opts); - var expected = { - herp: true, - h: true, - '_': [ ] - }; - - t.same(aliasedArgv, expected); - t.same(propertyArgv, expected); - t.end(); -}); - -// regression, see https://github.com/substack/node-optimist/issues/71 -test('boolean and --x=true', function(t) { - var parsed = parse(['--boool', '--other=true'], { - boolean: 'boool' - }); - - t.same(parsed.boool, true); - t.same(parsed.other, 'true'); - - parsed = parse(['--boool', '--other=false'], { - boolean: 'boool' - }); - - t.same(parsed.boool, true); - t.same(parsed.other, 'false'); - t.end(); -}); - -test('boolean --boool=true', function (t) { - var parsed = parse(['--boool=true'], { - default: { - boool: false - }, - boolean: ['boool'] - }); - - t.same(parsed.boool, true); - t.end(); -}); - -test('boolean --boool=false', function (t) { - var parsed = parse(['--boool=false'], { - default: { - boool: true - }, - boolean: ['boool'] - }); - - t.same(parsed.boool, false); - t.end(); -}); - -test('boolean using something similar to true', function (t) { - var opts = { boolean: 'h' }; - var result = parse(['-h', 'true.txt'], opts); - var expected = { - h: true, - '_': ['true.txt'] - }; - - t.same(result, expected); - t.end(); -}); \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/minimist/test/dash.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/minimist/test/dash.js deleted file mode 100644 index 5a4fa5be..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/minimist/test/dash.js +++ /dev/null @@ -1,31 +0,0 @@ -var parse = require('../'); -var test = require('tape'); - -test('-', function (t) { - t.plan(5); - t.deepEqual(parse([ '-n', '-' ]), { n: '-', _: [] }); - t.deepEqual(parse([ '-' ]), { _: [ '-' ] }); - t.deepEqual(parse([ '-f-' ]), { f: '-', _: [] }); - t.deepEqual( - parse([ '-b', '-' ], { boolean: 'b' }), - { b: true, _: [ '-' ] } - ); - t.deepEqual( - parse([ '-s', '-' ], { string: 's' }), - { s: '-', _: [] } - ); -}); - -test('-a -- b', function (t) { - t.plan(3); - t.deepEqual(parse([ '-a', '--', 'b' ]), { a: true, _: [ 'b' ] }); - t.deepEqual(parse([ '--a', '--', 'b' ]), { a: true, _: [ 'b' ] }); - t.deepEqual(parse([ '--a', '--', 'b' ]), { a: true, _: [ 'b' ] }); -}); - -test('move arguments after the -- into their own `--` array', function(t) { - t.plan(1); - t.deepEqual( - parse([ '--name', 'John', 'before', '--', 'after' ], { '--': true }), - { name: 'John', _: [ 'before' ], '--': [ 'after' ] }); -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/minimist/test/default_bool.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/minimist/test/default_bool.js deleted file mode 100644 index 780a3112..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/minimist/test/default_bool.js +++ /dev/null @@ -1,35 +0,0 @@ -var test = require('tape'); -var parse = require('../'); - -test('boolean default true', function (t) { - var argv = parse([], { - boolean: 'sometrue', - default: { sometrue: true } - }); - t.equal(argv.sometrue, true); - t.end(); -}); - -test('boolean default false', function (t) { - var argv = parse([], { - boolean: 'somefalse', - default: { somefalse: false } - }); - t.equal(argv.somefalse, false); - t.end(); -}); - -test('boolean default to null', function (t) { - var argv = parse([], { - boolean: 'maybe', - default: { maybe: null } - }); - t.equal(argv.maybe, null); - var argv = parse(['--maybe'], { - boolean: 'maybe', - default: { maybe: null } - }); - t.equal(argv.maybe, true); - t.end(); - -}) diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/minimist/test/dotted.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/minimist/test/dotted.js deleted file mode 100644 index d8b3e856..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/minimist/test/dotted.js +++ /dev/null @@ -1,22 +0,0 @@ -var parse = require('../'); -var test = require('tape'); - -test('dotted alias', function (t) { - var argv = parse(['--a.b', '22'], {default: {'a.b': 11}, alias: {'a.b': 'aa.bb'}}); - t.equal(argv.a.b, 22); - t.equal(argv.aa.bb, 22); - t.end(); -}); - -test('dotted default', function (t) { - var argv = parse('', {default: {'a.b': 11}, alias: {'a.b': 'aa.bb'}}); - t.equal(argv.a.b, 11); - t.equal(argv.aa.bb, 11); - t.end(); -}); - -test('dotted default with no alias', function (t) { - var argv = parse('', {default: {'a.b': 11}}); - t.equal(argv.a.b, 11); - t.end(); -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/minimist/test/kv_short.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/minimist/test/kv_short.js deleted file mode 100644 index f813b305..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/minimist/test/kv_short.js +++ /dev/null @@ -1,16 +0,0 @@ -var parse = require('../'); -var test = require('tape'); - -test('short -k=v' , function (t) { - t.plan(1); - - var argv = parse([ '-b=123' ]); - t.deepEqual(argv, { b: 123, _: [] }); -}); - -test('multi short -k=v' , function (t) { - t.plan(1); - - var argv = parse([ '-a=whatever', '-b=robots' ]); - t.deepEqual(argv, { a: 'whatever', b: 'robots', _: [] }); -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/minimist/test/long.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/minimist/test/long.js deleted file mode 100644 index 5d3a1e09..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/minimist/test/long.js +++ /dev/null @@ -1,31 +0,0 @@ -var test = require('tape'); -var parse = require('../'); - -test('long opts', function (t) { - t.deepEqual( - parse([ '--bool' ]), - { bool : true, _ : [] }, - 'long boolean' - ); - t.deepEqual( - parse([ '--pow', 'xixxle' ]), - { pow : 'xixxle', _ : [] }, - 'long capture sp' - ); - t.deepEqual( - parse([ '--pow=xixxle' ]), - { pow : 'xixxle', _ : [] }, - 'long capture eq' - ); - t.deepEqual( - parse([ '--host', 'localhost', '--port', '555' ]), - { host : 'localhost', port : 555, _ : [] }, - 'long captures sp' - ); - t.deepEqual( - parse([ '--host=localhost', '--port=555' ]), - { host : 'localhost', port : 555, _ : [] }, - 'long captures eq' - ); - t.end(); -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/minimist/test/num.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/minimist/test/num.js deleted file mode 100644 index 2cc77f4d..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/minimist/test/num.js +++ /dev/null @@ -1,36 +0,0 @@ -var parse = require('../'); -var test = require('tape'); - -test('nums', function (t) { - var argv = parse([ - '-x', '1234', - '-y', '5.67', - '-z', '1e7', - '-w', '10f', - '--hex', '0xdeadbeef', - '789' - ]); - t.deepEqual(argv, { - x : 1234, - y : 5.67, - z : 1e7, - w : '10f', - hex : 0xdeadbeef, - _ : [ 789 ] - }); - t.deepEqual(typeof argv.x, 'number'); - t.deepEqual(typeof argv.y, 'number'); - t.deepEqual(typeof argv.z, 'number'); - t.deepEqual(typeof argv.w, 'string'); - t.deepEqual(typeof argv.hex, 'number'); - t.deepEqual(typeof argv._[0], 'number'); - t.end(); -}); - -test('already a number', function (t) { - var argv = parse([ '-x', 1234, 789 ]); - t.deepEqual(argv, { x : 1234, _ : [ 789 ] }); - t.deepEqual(typeof argv.x, 'number'); - t.deepEqual(typeof argv._[0], 'number'); - t.end(); -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/minimist/test/parse.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/minimist/test/parse.js deleted file mode 100644 index 7b4a2a17..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/minimist/test/parse.js +++ /dev/null @@ -1,197 +0,0 @@ -var parse = require('../'); -var test = require('tape'); - -test('parse args', function (t) { - t.deepEqual( - parse([ '--no-moo' ]), - { moo : false, _ : [] }, - 'no' - ); - t.deepEqual( - parse([ '-v', 'a', '-v', 'b', '-v', 'c' ]), - { v : ['a','b','c'], _ : [] }, - 'multi' - ); - t.end(); -}); - -test('comprehensive', function (t) { - t.deepEqual( - parse([ - '--name=meowmers', 'bare', '-cats', 'woo', - '-h', 'awesome', '--multi=quux', - '--key', 'value', - '-b', '--bool', '--no-meep', '--multi=baz', - '--', '--not-a-flag', 'eek' - ]), - { - c : true, - a : true, - t : true, - s : 'woo', - h : 'awesome', - b : true, - bool : true, - key : 'value', - multi : [ 'quux', 'baz' ], - meep : false, - name : 'meowmers', - _ : [ 'bare', '--not-a-flag', 'eek' ] - } - ); - t.end(); -}); - -test('flag boolean', function (t) { - var argv = parse([ '-t', 'moo' ], { boolean: 't' }); - t.deepEqual(argv, { t : true, _ : [ 'moo' ] }); - t.deepEqual(typeof argv.t, 'boolean'); - t.end(); -}); - -test('flag boolean value', function (t) { - var argv = parse(['--verbose', 'false', 'moo', '-t', 'true'], { - boolean: [ 't', 'verbose' ], - default: { verbose: true } - }); - - t.deepEqual(argv, { - verbose: false, - t: true, - _: ['moo'] - }); - - t.deepEqual(typeof argv.verbose, 'boolean'); - t.deepEqual(typeof argv.t, 'boolean'); - t.end(); -}); - -test('newlines in params' , function (t) { - var args = parse([ '-s', "X\nX" ]) - t.deepEqual(args, { _ : [], s : "X\nX" }); - - // reproduce in bash: - // VALUE="new - // line" - // node program.js --s="$VALUE" - args = parse([ "--s=X\nX" ]) - t.deepEqual(args, { _ : [], s : "X\nX" }); - t.end(); -}); - -test('strings' , function (t) { - var s = parse([ '-s', '0001234' ], { string: 's' }).s; - t.equal(s, '0001234'); - t.equal(typeof s, 'string'); - - var x = parse([ '-x', '56' ], { string: 'x' }).x; - t.equal(x, '56'); - t.equal(typeof x, 'string'); - t.end(); -}); - -test('stringArgs', function (t) { - var s = parse([ ' ', ' ' ], { string: '_' })._; - t.same(s.length, 2); - t.same(typeof s[0], 'string'); - t.same(s[0], ' '); - t.same(typeof s[1], 'string'); - t.same(s[1], ' '); - t.end(); -}); - -test('empty strings', function(t) { - var s = parse([ '-s' ], { string: 's' }).s; - t.equal(s, ''); - t.equal(typeof s, 'string'); - - var str = parse([ '--str' ], { string: 'str' }).str; - t.equal(str, ''); - t.equal(typeof str, 'string'); - - var letters = parse([ '-art' ], { - string: [ 'a', 't' ] - }); - - t.equal(letters.a, ''); - t.equal(letters.r, true); - t.equal(letters.t, ''); - - t.end(); -}); - - -test('string and alias', function(t) { - var x = parse([ '--str', '000123' ], { - string: 's', - alias: { s: 'str' } - }); - - t.equal(x.str, '000123'); - t.equal(typeof x.str, 'string'); - t.equal(x.s, '000123'); - t.equal(typeof x.s, 'string'); - - var y = parse([ '-s', '000123' ], { - string: 'str', - alias: { str: 's' } - }); - - t.equal(y.str, '000123'); - t.equal(typeof y.str, 'string'); - t.equal(y.s, '000123'); - t.equal(typeof y.s, 'string'); - t.end(); -}); - -test('slashBreak', function (t) { - t.same( - parse([ '-I/foo/bar/baz' ]), - { I : '/foo/bar/baz', _ : [] } - ); - t.same( - parse([ '-xyz/foo/bar/baz' ]), - { x : true, y : true, z : '/foo/bar/baz', _ : [] } - ); - t.end(); -}); - -test('alias', function (t) { - var argv = parse([ '-f', '11', '--zoom', '55' ], { - alias: { z: 'zoom' } - }); - t.equal(argv.zoom, 55); - t.equal(argv.z, argv.zoom); - t.equal(argv.f, 11); - t.end(); -}); - -test('multiAlias', function (t) { - var argv = parse([ '-f', '11', '--zoom', '55' ], { - alias: { z: [ 'zm', 'zoom' ] } - }); - t.equal(argv.zoom, 55); - t.equal(argv.z, argv.zoom); - t.equal(argv.z, argv.zm); - t.equal(argv.f, 11); - t.end(); -}); - -test('nested dotted objects', function (t) { - var argv = parse([ - '--foo.bar', '3', '--foo.baz', '4', - '--foo.quux.quibble', '5', '--foo.quux.o_O', - '--beep.boop' - ]); - - t.same(argv.foo, { - bar : 3, - baz : 4, - quux : { - quibble : 5, - o_O : true - } - }); - t.same(argv.beep, { boop : true }); - t.end(); -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/minimist/test/parse_modified.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/minimist/test/parse_modified.js deleted file mode 100644 index ab620dc5..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/minimist/test/parse_modified.js +++ /dev/null @@ -1,9 +0,0 @@ -var parse = require('../'); -var test = require('tape'); - -test('parse with modifier functions' , function (t) { - t.plan(1); - - var argv = parse([ '-b', '123' ], { boolean: 'b' }); - t.deepEqual(argv, { b: true, _: [123] }); -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/minimist/test/proto.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/minimist/test/proto.js deleted file mode 100644 index 4ac62df2..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/minimist/test/proto.js +++ /dev/null @@ -1,60 +0,0 @@ -var parse = require('../'); -var test = require('tape'); - -test('proto pollution', function (t) { - var argv = parse(['--__proto__.x','123']); - t.equal({}.x, undefined); - t.equal(argv.__proto__.x, undefined); - t.equal(argv.x, undefined); - t.end(); -}); - -test('proto pollution (array)', function (t) { - var argv = parse(['--x','4','--x','5','--x.__proto__.z','789']); - t.equal({}.z, undefined); - t.deepEqual(argv.x, [4,5]); - t.equal(argv.x.z, undefined); - t.equal(argv.x.__proto__.z, undefined); - t.end(); -}); - -test('proto pollution (number)', function (t) { - var argv = parse(['--x','5','--x.__proto__.z','100']); - t.equal({}.z, undefined); - t.equal((4).z, undefined); - t.equal(argv.x, 5); - t.equal(argv.x.z, undefined); - t.end(); -}); - -test('proto pollution (string)', function (t) { - var argv = parse(['--x','abc','--x.__proto__.z','def']); - t.equal({}.z, undefined); - t.equal('...'.z, undefined); - t.equal(argv.x, 'abc'); - t.equal(argv.x.z, undefined); - t.end(); -}); - -test('proto pollution (constructor)', function (t) { - var argv = parse(['--constructor.prototype.y','123']); - t.equal({}.y, undefined); - t.equal(argv.y, undefined); - t.end(); -}); - -test('proto pollution (constructor function)', function (t) { - var argv = parse(['--_.concat.constructor.prototype.y', '123']); - function fnToBeTested() {} - t.equal(fnToBeTested.y, undefined); - t.equal(argv.y, undefined); - t.end(); -}); - -// powered by snyk - https://github.com/backstage/backstage/issues/10343 -test('proto pollution (constructor function) snyk', function (t) { - var argv = parse('--_.constructor.constructor.prototype.foo bar'.split(' ')); - t.equal((function(){}).foo, undefined); - t.equal(argv.y, undefined); - t.end(); -}) diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/minimist/test/short.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/minimist/test/short.js deleted file mode 100644 index d513a1c2..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/minimist/test/short.js +++ /dev/null @@ -1,67 +0,0 @@ -var parse = require('../'); -var test = require('tape'); - -test('numeric short args', function (t) { - t.plan(2); - t.deepEqual(parse([ '-n123' ]), { n: 123, _: [] }); - t.deepEqual( - parse([ '-123', '456' ]), - { 1: true, 2: true, 3: 456, _: [] } - ); -}); - -test('short', function (t) { - t.deepEqual( - parse([ '-b' ]), - { b : true, _ : [] }, - 'short boolean' - ); - t.deepEqual( - parse([ 'foo', 'bar', 'baz' ]), - { _ : [ 'foo', 'bar', 'baz' ] }, - 'bare' - ); - t.deepEqual( - parse([ '-cats' ]), - { c : true, a : true, t : true, s : true, _ : [] }, - 'group' - ); - t.deepEqual( - parse([ '-cats', 'meow' ]), - { c : true, a : true, t : true, s : 'meow', _ : [] }, - 'short group next' - ); - t.deepEqual( - parse([ '-h', 'localhost' ]), - { h : 'localhost', _ : [] }, - 'short capture' - ); - t.deepEqual( - parse([ '-h', 'localhost', '-p', '555' ]), - { h : 'localhost', p : 555, _ : [] }, - 'short captures' - ); - t.end(); -}); - -test('mixed short bool and capture', function (t) { - t.same( - parse([ '-h', 'localhost', '-fp', '555', 'script.js' ]), - { - f : true, p : 555, h : 'localhost', - _ : [ 'script.js' ] - } - ); - t.end(); -}); - -test('short and long', function (t) { - t.deepEqual( - parse([ '-h', 'localhost', '-fp', '555', 'script.js' ]), - { - f : true, p : 555, h : 'localhost', - _ : [ 'script.js' ] - } - ); - t.end(); -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/minimist/test/stop_early.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/minimist/test/stop_early.js deleted file mode 100644 index bdf9fbcb..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/minimist/test/stop_early.js +++ /dev/null @@ -1,15 +0,0 @@ -var parse = require('../'); -var test = require('tape'); - -test('stops parsing on the first non-option when stopEarly is set', function (t) { - var argv = parse(['--aaa', 'bbb', 'ccc', '--ddd'], { - stopEarly: true - }); - - t.deepEqual(argv, { - aaa: 'bbb', - _: ['ccc', '--ddd'] - }); - - t.end(); -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/minimist/test/unknown.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/minimist/test/unknown.js deleted file mode 100644 index 462a36bd..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/minimist/test/unknown.js +++ /dev/null @@ -1,102 +0,0 @@ -var parse = require('../'); -var test = require('tape'); - -test('boolean and alias is not unknown', function (t) { - var unknown = []; - function unknownFn(arg) { - unknown.push(arg); - return false; - } - var aliased = [ '-h', 'true', '--derp', 'true' ]; - var regular = [ '--herp', 'true', '-d', 'true' ]; - var opts = { - alias: { h: 'herp' }, - boolean: 'h', - unknown: unknownFn - }; - var aliasedArgv = parse(aliased, opts); - var propertyArgv = parse(regular, opts); - - t.same(unknown, ['--derp', '-d']); - t.end(); -}); - -test('flag boolean true any double hyphen argument is not unknown', function (t) { - var unknown = []; - function unknownFn(arg) { - unknown.push(arg); - return false; - } - var argv = parse(['--honk', '--tacos=good', 'cow', '-p', '55'], { - boolean: true, - unknown: unknownFn - }); - t.same(unknown, ['--tacos=good', 'cow', '-p']); - t.same(argv, { - honk: true, - _: [] - }); - t.end(); -}); - -test('string and alias is not unknown', function (t) { - var unknown = []; - function unknownFn(arg) { - unknown.push(arg); - return false; - } - var aliased = [ '-h', 'hello', '--derp', 'goodbye' ]; - var regular = [ '--herp', 'hello', '-d', 'moon' ]; - var opts = { - alias: { h: 'herp' }, - string: 'h', - unknown: unknownFn - }; - var aliasedArgv = parse(aliased, opts); - var propertyArgv = parse(regular, opts); - - t.same(unknown, ['--derp', '-d']); - t.end(); -}); - -test('default and alias is not unknown', function (t) { - var unknown = []; - function unknownFn(arg) { - unknown.push(arg); - return false; - } - var aliased = [ '-h', 'hello' ]; - var regular = [ '--herp', 'hello' ]; - var opts = { - default: { 'h': 'bar' }, - alias: { 'h': 'herp' }, - unknown: unknownFn - }; - var aliasedArgv = parse(aliased, opts); - var propertyArgv = parse(regular, opts); - - t.same(unknown, []); - t.end(); - unknownFn(); // exercise fn for 100% coverage -}); - -test('value following -- is not unknown', function (t) { - var unknown = []; - function unknownFn(arg) { - unknown.push(arg); - return false; - } - var aliased = [ '--bad', '--', 'good', 'arg' ]; - var opts = { - '--': true, - unknown: unknownFn - }; - var argv = parse(aliased, opts); - - t.same(unknown, ['--bad']); - t.same(argv, { - '--': ['good', 'arg'], - '_': [] - }) - t.end(); -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/minimist/test/whitespace.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/minimist/test/whitespace.js deleted file mode 100644 index 8a52a58c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/minimist/test/whitespace.js +++ /dev/null @@ -1,8 +0,0 @@ -var parse = require('../'); -var test = require('tape'); - -test('whitespace should be whitespace' , function (t) { - t.plan(1); - var x = parse([ '-x', '\t' ]).x; - t.equal(x, '\t'); -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/mkdirp/CHANGELOG.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/mkdirp/CHANGELOG.md deleted file mode 100644 index 81458380..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/mkdirp/CHANGELOG.md +++ /dev/null @@ -1,15 +0,0 @@ -# Changers Lorgs! - -## 1.0 - -Full rewrite. Essentially a brand new module. - -- Return a promise instead of taking a callback. -- Use native `fs.mkdir(path, { recursive: true })` when available. -- Drop support for outdated Node.js versions. (Technically still works on - Node.js v8, but only 10 and above are officially supported.) - -## 0.x - -Original and most widely used recursive directory creation implementation -in JavaScript, dating back to 2010. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/mkdirp/LICENSE b/packages/wyatt_notification_bloc/example/scripts/node_modules/mkdirp/LICENSE deleted file mode 100644 index 13fcd15f..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/mkdirp/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -Copyright James Halliday (mail@substack.net) and Isaac Z. Schlueter (i@izs.me) - -This project is free software released under the MIT license: - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/mkdirp/bin/cmd.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/mkdirp/bin/cmd.js deleted file mode 100755 index 6e0aa8dc..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/mkdirp/bin/cmd.js +++ /dev/null @@ -1,68 +0,0 @@ -#!/usr/bin/env node - -const usage = () => ` -usage: mkdirp [DIR1,DIR2..] {OPTIONS} - - Create each supplied directory including any necessary parent directories - that don't yet exist. - - If the directory already exists, do nothing. - -OPTIONS are: - - -m If a directory needs to be created, set the mode as an octal - --mode= permission string. - - -v --version Print the mkdirp version number - - -h --help Print this helpful banner - - -p --print Print the first directories created for each path provided - - --manual Use manual implementation, even if native is available -` - -const dirs = [] -const opts = {} -let print = false -let dashdash = false -let manual = false -for (const arg of process.argv.slice(2)) { - if (dashdash) - dirs.push(arg) - else if (arg === '--') - dashdash = true - else if (arg === '--manual') - manual = true - else if (/^-h/.test(arg) || /^--help/.test(arg)) { - console.log(usage()) - process.exit(0) - } else if (arg === '-v' || arg === '--version') { - console.log(require('../package.json').version) - process.exit(0) - } else if (arg === '-p' || arg === '--print') { - print = true - } else if (/^-m/.test(arg) || /^--mode=/.test(arg)) { - const mode = parseInt(arg.replace(/^(-m|--mode=)/, ''), 8) - if (isNaN(mode)) { - console.error(`invalid mode argument: ${arg}\nMust be an octal number.`) - process.exit(1) - } - opts.mode = mode - } else - dirs.push(arg) -} - -const mkdirp = require('../') -const impl = manual ? mkdirp.manual : mkdirp -if (dirs.length === 0) - console.error(usage()) - -Promise.all(dirs.map(dir => impl(dir, opts))) - .then(made => print ? made.forEach(m => m && console.log(m)) : null) - .catch(er => { - console.error(er.message) - if (er.code) - console.error(' code: ' + er.code) - process.exit(1) - }) diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/mkdirp/index.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/mkdirp/index.js deleted file mode 100644 index ad7a16c9..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/mkdirp/index.js +++ /dev/null @@ -1,31 +0,0 @@ -const optsArg = require('./lib/opts-arg.js') -const pathArg = require('./lib/path-arg.js') - -const {mkdirpNative, mkdirpNativeSync} = require('./lib/mkdirp-native.js') -const {mkdirpManual, mkdirpManualSync} = require('./lib/mkdirp-manual.js') -const {useNative, useNativeSync} = require('./lib/use-native.js') - - -const mkdirp = (path, opts) => { - path = pathArg(path) - opts = optsArg(opts) - return useNative(opts) - ? mkdirpNative(path, opts) - : mkdirpManual(path, opts) -} - -const mkdirpSync = (path, opts) => { - path = pathArg(path) - opts = optsArg(opts) - return useNativeSync(opts) - ? mkdirpNativeSync(path, opts) - : mkdirpManualSync(path, opts) -} - -mkdirp.sync = mkdirpSync -mkdirp.native = (path, opts) => mkdirpNative(pathArg(path), optsArg(opts)) -mkdirp.manual = (path, opts) => mkdirpManual(pathArg(path), optsArg(opts)) -mkdirp.nativeSync = (path, opts) => mkdirpNativeSync(pathArg(path), optsArg(opts)) -mkdirp.manualSync = (path, opts) => mkdirpManualSync(pathArg(path), optsArg(opts)) - -module.exports = mkdirp diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/mkdirp/lib/find-made.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/mkdirp/lib/find-made.js deleted file mode 100644 index 022e492c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/mkdirp/lib/find-made.js +++ /dev/null @@ -1,29 +0,0 @@ -const {dirname} = require('path') - -const findMade = (opts, parent, path = undefined) => { - // we never want the 'made' return value to be a root directory - if (path === parent) - return Promise.resolve() - - return opts.statAsync(parent).then( - st => st.isDirectory() ? path : undefined, // will fail later - er => er.code === 'ENOENT' - ? findMade(opts, dirname(parent), parent) - : undefined - ) -} - -const findMadeSync = (opts, parent, path = undefined) => { - if (path === parent) - return undefined - - try { - return opts.statSync(parent).isDirectory() ? path : undefined - } catch (er) { - return er.code === 'ENOENT' - ? findMadeSync(opts, dirname(parent), parent) - : undefined - } -} - -module.exports = {findMade, findMadeSync} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/mkdirp/lib/mkdirp-manual.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/mkdirp/lib/mkdirp-manual.js deleted file mode 100644 index 2eb18cd6..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/mkdirp/lib/mkdirp-manual.js +++ /dev/null @@ -1,64 +0,0 @@ -const {dirname} = require('path') - -const mkdirpManual = (path, opts, made) => { - opts.recursive = false - const parent = dirname(path) - if (parent === path) { - return opts.mkdirAsync(path, opts).catch(er => { - // swallowed by recursive implementation on posix systems - // any other error is a failure - if (er.code !== 'EISDIR') - throw er - }) - } - - return opts.mkdirAsync(path, opts).then(() => made || path, er => { - if (er.code === 'ENOENT') - return mkdirpManual(parent, opts) - .then(made => mkdirpManual(path, opts, made)) - if (er.code !== 'EEXIST' && er.code !== 'EROFS') - throw er - return opts.statAsync(path).then(st => { - if (st.isDirectory()) - return made - else - throw er - }, () => { throw er }) - }) -} - -const mkdirpManualSync = (path, opts, made) => { - const parent = dirname(path) - opts.recursive = false - - if (parent === path) { - try { - return opts.mkdirSync(path, opts) - } catch (er) { - // swallowed by recursive implementation on posix systems - // any other error is a failure - if (er.code !== 'EISDIR') - throw er - else - return - } - } - - try { - opts.mkdirSync(path, opts) - return made || path - } catch (er) { - if (er.code === 'ENOENT') - return mkdirpManualSync(path, opts, mkdirpManualSync(parent, opts, made)) - if (er.code !== 'EEXIST' && er.code !== 'EROFS') - throw er - try { - if (!opts.statSync(path).isDirectory()) - throw er - } catch (_) { - throw er - } - } -} - -module.exports = {mkdirpManual, mkdirpManualSync} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/mkdirp/lib/mkdirp-native.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/mkdirp/lib/mkdirp-native.js deleted file mode 100644 index c7a6b698..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/mkdirp/lib/mkdirp-native.js +++ /dev/null @@ -1,39 +0,0 @@ -const {dirname} = require('path') -const {findMade, findMadeSync} = require('./find-made.js') -const {mkdirpManual, mkdirpManualSync} = require('./mkdirp-manual.js') - -const mkdirpNative = (path, opts) => { - opts.recursive = true - const parent = dirname(path) - if (parent === path) - return opts.mkdirAsync(path, opts) - - return findMade(opts, path).then(made => - opts.mkdirAsync(path, opts).then(() => made) - .catch(er => { - if (er.code === 'ENOENT') - return mkdirpManual(path, opts) - else - throw er - })) -} - -const mkdirpNativeSync = (path, opts) => { - opts.recursive = true - const parent = dirname(path) - if (parent === path) - return opts.mkdirSync(path, opts) - - const made = findMadeSync(opts, path) - try { - opts.mkdirSync(path, opts) - return made - } catch (er) { - if (er.code === 'ENOENT') - return mkdirpManualSync(path, opts) - else - throw er - } -} - -module.exports = {mkdirpNative, mkdirpNativeSync} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/mkdirp/lib/opts-arg.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/mkdirp/lib/opts-arg.js deleted file mode 100644 index 2fa4833f..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/mkdirp/lib/opts-arg.js +++ /dev/null @@ -1,23 +0,0 @@ -const { promisify } = require('util') -const fs = require('fs') -const optsArg = opts => { - if (!opts) - opts = { mode: 0o777, fs } - else if (typeof opts === 'object') - opts = { mode: 0o777, fs, ...opts } - else if (typeof opts === 'number') - opts = { mode: opts, fs } - else if (typeof opts === 'string') - opts = { mode: parseInt(opts, 8), fs } - else - throw new TypeError('invalid options argument') - - opts.mkdir = opts.mkdir || opts.fs.mkdir || fs.mkdir - opts.mkdirAsync = promisify(opts.mkdir) - opts.stat = opts.stat || opts.fs.stat || fs.stat - opts.statAsync = promisify(opts.stat) - opts.statSync = opts.statSync || opts.fs.statSync || fs.statSync - opts.mkdirSync = opts.mkdirSync || opts.fs.mkdirSync || fs.mkdirSync - return opts -} -module.exports = optsArg diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/mkdirp/lib/path-arg.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/mkdirp/lib/path-arg.js deleted file mode 100644 index cc07de5a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/mkdirp/lib/path-arg.js +++ /dev/null @@ -1,29 +0,0 @@ -const platform = process.env.__TESTING_MKDIRP_PLATFORM__ || process.platform -const { resolve, parse } = require('path') -const pathArg = path => { - if (/\0/.test(path)) { - // simulate same failure that node raises - throw Object.assign( - new TypeError('path must be a string without null bytes'), - { - path, - code: 'ERR_INVALID_ARG_VALUE', - } - ) - } - - path = resolve(path) - if (platform === 'win32') { - const badWinChars = /[*|"<>?:]/ - const {root} = parse(path) - if (badWinChars.test(path.substr(root.length))) { - throw Object.assign(new Error('Illegal characters in path.'), { - path, - code: 'EINVAL', - }) - } - } - - return path -} -module.exports = pathArg diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/mkdirp/lib/use-native.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/mkdirp/lib/use-native.js deleted file mode 100644 index 079361de..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/mkdirp/lib/use-native.js +++ /dev/null @@ -1,10 +0,0 @@ -const fs = require('fs') - -const version = process.env.__TESTING_MKDIRP_NODE_VERSION__ || process.version -const versArr = version.replace(/^v/, '').split('.') -const hasNative = +versArr[0] > 10 || +versArr[0] === 10 && +versArr[1] >= 12 - -const useNative = !hasNative ? () => false : opts => opts.mkdir === fs.mkdir -const useNativeSync = !hasNative ? () => false : opts => opts.mkdirSync === fs.mkdirSync - -module.exports = {useNative, useNativeSync} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/mkdirp/package.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/mkdirp/package.json deleted file mode 100644 index 2913ed09..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/mkdirp/package.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "name": "mkdirp", - "description": "Recursively mkdir, like `mkdir -p`", - "version": "1.0.4", - "main": "index.js", - "keywords": [ - "mkdir", - "directory", - "make dir", - "make", - "dir", - "recursive", - "native" - ], - "repository": { - "type": "git", - "url": "https://github.com/isaacs/node-mkdirp.git" - }, - "scripts": { - "test": "tap", - "snap": "tap", - "preversion": "npm test", - "postversion": "npm publish", - "postpublish": "git push origin --follow-tags" - }, - "tap": { - "check-coverage": true, - "coverage-map": "map.js" - }, - "devDependencies": { - "require-inject": "^1.4.4", - "tap": "^14.10.7" - }, - "bin": "bin/cmd.js", - "license": "MIT", - "engines": { - "node": ">=10" - }, - "files": [ - "bin", - "lib", - "index.js" - ] -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/mkdirp/readme.markdown b/packages/wyatt_notification_bloc/example/scripts/node_modules/mkdirp/readme.markdown deleted file mode 100644 index 827de590..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/mkdirp/readme.markdown +++ /dev/null @@ -1,266 +0,0 @@ -# mkdirp - -Like `mkdir -p`, but in Node.js! - -Now with a modern API and no\* bugs! - -\* may contain some bugs - -# example - -## pow.js - -```js -const mkdirp = require('mkdirp') - -// return value is a Promise resolving to the first directory created -mkdirp('/tmp/foo/bar/baz').then(made => - console.log(`made directories, starting with ${made}`)) -``` - -Output (where `/tmp/foo` already exists) - -``` -made directories, starting with /tmp/foo/bar -``` - -Or, if you don't have time to wait around for promises: - -```js -const mkdirp = require('mkdirp') - -// return value is the first directory created -const made = mkdirp.sync('/tmp/foo/bar/baz') -console.log(`made directories, starting with ${made}`) -``` - -And now /tmp/foo/bar/baz exists, huzzah! - -# methods - -```js -const mkdirp = require('mkdirp') -``` - -## mkdirp(dir, [opts]) -> Promise - -Create a new directory and any necessary subdirectories at `dir` with octal -permission string `opts.mode`. If `opts` is a string or number, it will be -treated as the `opts.mode`. - -If `opts.mode` isn't specified, it defaults to `0o777 & -(~process.umask())`. - -Promise resolves to first directory `made` that had to be created, or -`undefined` if everything already exists. Promise rejects if any errors -are encountered. Note that, in the case of promise rejection, some -directories _may_ have been created, as recursive directory creation is not -an atomic operation. - -You can optionally pass in an alternate `fs` implementation by passing in -`opts.fs`. Your implementation should have `opts.fs.mkdir(path, opts, cb)` -and `opts.fs.stat(path, cb)`. - -You can also override just one or the other of `mkdir` and `stat` by -passing in `opts.stat` or `opts.mkdir`, or providing an `fs` option that -only overrides one of these. - -## mkdirp.sync(dir, opts) -> String|null - -Synchronously create a new directory and any necessary subdirectories at -`dir` with octal permission string `opts.mode`. If `opts` is a string or -number, it will be treated as the `opts.mode`. - -If `opts.mode` isn't specified, it defaults to `0o777 & -(~process.umask())`. - -Returns the first directory that had to be created, or undefined if -everything already exists. - -You can optionally pass in an alternate `fs` implementation by passing in -`opts.fs`. Your implementation should have `opts.fs.mkdirSync(path, mode)` -and `opts.fs.statSync(path)`. - -You can also override just one or the other of `mkdirSync` and `statSync` -by passing in `opts.statSync` or `opts.mkdirSync`, or providing an `fs` -option that only overrides one of these. - -## mkdirp.manual, mkdirp.manualSync - -Use the manual implementation (not the native one). This is the default -when the native implementation is not available or the stat/mkdir -implementation is overridden. - -## mkdirp.native, mkdirp.nativeSync - -Use the native implementation (not the manual one). This is the default -when the native implementation is available and stat/mkdir are not -overridden. - -# implementation - -On Node.js v10.12.0 and above, use the native `fs.mkdir(p, -{recursive:true})` option, unless `fs.mkdir`/`fs.mkdirSync` has been -overridden by an option. - -## native implementation - -- If the path is a root directory, then pass it to the underlying - implementation and return the result/error. (In this case, it'll either - succeed or fail, but we aren't actually creating any dirs.) -- Walk up the path statting each directory, to find the first path that - will be created, `made`. -- Call `fs.mkdir(path, { recursive: true })` (or `fs.mkdirSync`) -- If error, raise it to the caller. -- Return `made`. - -## manual implementation - -- Call underlying `fs.mkdir` implementation, with `recursive: false` -- If error: - - If path is a root directory, raise to the caller and do not handle it - - If ENOENT, mkdirp parent dir, store result as `made` - - stat(path) - - If error, raise original `mkdir` error - - If directory, return `made` - - Else, raise original `mkdir` error -- else - - return `undefined` if a root dir, or `made` if set, or `path` - -## windows vs unix caveat - -On Windows file systems, attempts to create a root directory (ie, a drive -letter or root UNC path) will fail. If the root directory exists, then it -will fail with `EPERM`. If the root directory does not exist, then it will -fail with `ENOENT`. - -On posix file systems, attempts to create a root directory (in recursive -mode) will succeed silently, as it is treated like just another directory -that already exists. (In non-recursive mode, of course, it fails with -`EEXIST`.) - -In order to preserve this system-specific behavior (and because it's not as -if we can create the parent of a root directory anyway), attempts to create -a root directory are passed directly to the `fs` implementation, and any -errors encountered are not handled. - -## native error caveat - -The native implementation (as of at least Node.js v13.4.0) does not provide -appropriate errors in some cases (see -[nodejs/node#31481](https://github.com/nodejs/node/issues/31481) and -[nodejs/node#28015](https://github.com/nodejs/node/issues/28015)). - -In order to work around this issue, the native implementation will fall -back to the manual implementation if an `ENOENT` error is encountered. - -# choosing a recursive mkdir implementation - -There are a few to choose from! Use the one that suits your needs best :D - -## use `fs.mkdir(path, {recursive: true}, cb)` if: - -- You wish to optimize performance even at the expense of other factors. -- You don't need to know the first dir created. -- You are ok with getting `ENOENT` as the error when some other problem is - the actual cause. -- You can limit your platforms to Node.js v10.12 and above. -- You're ok with using callbacks instead of promises. -- You don't need/want a CLI. -- You don't need to override the `fs` methods in use. - -## use this module (mkdirp 1.x) if: - -- You need to know the first directory that was created. -- You wish to use the native implementation if available, but fall back - when it's not. -- You prefer promise-returning APIs to callback-taking APIs. -- You want more useful error messages than the native recursive mkdir - provides (at least as of Node.js v13.4), and are ok with re-trying on - `ENOENT` to achieve this. -- You need (or at least, are ok with) a CLI. -- You need to override the `fs` methods in use. - -## use [`make-dir`](http://npm.im/make-dir) if: - -- You do not need to know the first dir created (and wish to save a few - `stat` calls when using the native implementation for this reason). -- You wish to use the native implementation if available, but fall back - when it's not. -- You prefer promise-returning APIs to callback-taking APIs. -- You are ok with occasionally getting `ENOENT` errors for failures that - are actually related to something other than a missing file system entry. -- You don't need/want a CLI. -- You need to override the `fs` methods in use. - -## use mkdirp 0.x if: - -- You need to know the first directory that was created. -- You need (or at least, are ok with) a CLI. -- You need to override the `fs` methods in use. -- You're ok with using callbacks instead of promises. -- You are not running on Windows, where the root-level ENOENT errors can - lead to infinite regress. -- You think vinyl just sounds warmer and richer for some weird reason. -- You are supporting truly ancient Node.js versions, before even the advent - of a `Promise` language primitive. (Please don't. You deserve better.) - -# cli - -This package also ships with a `mkdirp` command. - -``` -$ mkdirp -h - -usage: mkdirp [DIR1,DIR2..] {OPTIONS} - - Create each supplied directory including any necessary parent directories - that don't yet exist. - - If the directory already exists, do nothing. - -OPTIONS are: - - -m If a directory needs to be created, set the mode as an octal - --mode= permission string. - - -v --version Print the mkdirp version number - - -h --help Print this helpful banner - - -p --print Print the first directories created for each path provided - - --manual Use manual implementation, even if native is available -``` - -# install - -With [npm](http://npmjs.org) do: - -``` -npm install mkdirp -``` - -to get the library locally, or - -``` -npm install -g mkdirp -``` - -to get the command everywhere, or - -``` -npx mkdirp ... -``` - -to run the command without installing it globally. - -# platform support - -This module works on node v8, but only v10 and above are officially -supported, as Node v8 reached its LTS end of life 2020-01-01, which is in -the past, as of this writing. - -# license - -MIT diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/ms/index.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/ms/index.js deleted file mode 100644 index c4498bcc..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/ms/index.js +++ /dev/null @@ -1,162 +0,0 @@ -/** - * Helpers. - */ - -var s = 1000; -var m = s * 60; -var h = m * 60; -var d = h * 24; -var w = d * 7; -var y = d * 365.25; - -/** - * Parse or format the given `val`. - * - * Options: - * - * - `long` verbose formatting [false] - * - * @param {String|Number} val - * @param {Object} [options] - * @throws {Error} throw an error if val is not a non-empty string or a number - * @return {String|Number} - * @api public - */ - -module.exports = function(val, options) { - options = options || {}; - var type = typeof val; - if (type === 'string' && val.length > 0) { - return parse(val); - } else if (type === 'number' && isFinite(val)) { - return options.long ? fmtLong(val) : fmtShort(val); - } - throw new Error( - 'val is not a non-empty string or a valid number. val=' + - JSON.stringify(val) - ); -}; - -/** - * Parse the given `str` and return milliseconds. - * - * @param {String} str - * @return {Number} - * @api private - */ - -function parse(str) { - str = String(str); - if (str.length > 100) { - return; - } - var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec( - str - ); - if (!match) { - return; - } - var n = parseFloat(match[1]); - var type = (match[2] || 'ms').toLowerCase(); - switch (type) { - case 'years': - case 'year': - case 'yrs': - case 'yr': - case 'y': - return n * y; - case 'weeks': - case 'week': - case 'w': - return n * w; - case 'days': - case 'day': - case 'd': - return n * d; - case 'hours': - case 'hour': - case 'hrs': - case 'hr': - case 'h': - return n * h; - case 'minutes': - case 'minute': - case 'mins': - case 'min': - case 'm': - return n * m; - case 'seconds': - case 'second': - case 'secs': - case 'sec': - case 's': - return n * s; - case 'milliseconds': - case 'millisecond': - case 'msecs': - case 'msec': - case 'ms': - return n; - default: - return undefined; - } -} - -/** - * Short format for `ms`. - * - * @param {Number} ms - * @return {String} - * @api private - */ - -function fmtShort(ms) { - var msAbs = Math.abs(ms); - if (msAbs >= d) { - return Math.round(ms / d) + 'd'; - } - if (msAbs >= h) { - return Math.round(ms / h) + 'h'; - } - if (msAbs >= m) { - return Math.round(ms / m) + 'm'; - } - if (msAbs >= s) { - return Math.round(ms / s) + 's'; - } - return ms + 'ms'; -} - -/** - * Long format for `ms`. - * - * @param {Number} ms - * @return {String} - * @api private - */ - -function fmtLong(ms) { - var msAbs = Math.abs(ms); - if (msAbs >= d) { - return plural(ms, msAbs, d, 'day'); - } - if (msAbs >= h) { - return plural(ms, msAbs, h, 'hour'); - } - if (msAbs >= m) { - return plural(ms, msAbs, m, 'minute'); - } - if (msAbs >= s) { - return plural(ms, msAbs, s, 'second'); - } - return ms + ' ms'; -} - -/** - * Pluralization helper. - */ - -function plural(ms, msAbs, n, name) { - var isPlural = msAbs >= n * 1.5; - return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : ''); -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/ms/license.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/ms/license.md deleted file mode 100644 index 69b61253..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/ms/license.md +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2016 Zeit, Inc. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/ms/package.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/ms/package.json deleted file mode 100644 index eea666e1..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/ms/package.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "name": "ms", - "version": "2.1.2", - "description": "Tiny millisecond conversion utility", - "repository": "zeit/ms", - "main": "./index", - "files": [ - "index.js" - ], - "scripts": { - "precommit": "lint-staged", - "lint": "eslint lib/* bin/*", - "test": "mocha tests.js" - }, - "eslintConfig": { - "extends": "eslint:recommended", - "env": { - "node": true, - "es6": true - } - }, - "lint-staged": { - "*.js": [ - "npm run lint", - "prettier --single-quote --write", - "git add" - ] - }, - "license": "MIT", - "devDependencies": { - "eslint": "4.12.1", - "expect.js": "0.3.1", - "husky": "0.14.3", - "lint-staged": "5.0.0", - "mocha": "4.0.1" - } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/ms/readme.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/ms/readme.md deleted file mode 100644 index 9a1996b1..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/ms/readme.md +++ /dev/null @@ -1,60 +0,0 @@ -# ms - -[![Build Status](https://travis-ci.org/zeit/ms.svg?branch=master)](https://travis-ci.org/zeit/ms) -[![Join the community on Spectrum](https://withspectrum.github.io/badge/badge.svg)](https://spectrum.chat/zeit) - -Use this package to easily convert various time formats to milliseconds. - -## Examples - -```js -ms('2 days') // 172800000 -ms('1d') // 86400000 -ms('10h') // 36000000 -ms('2.5 hrs') // 9000000 -ms('2h') // 7200000 -ms('1m') // 60000 -ms('5s') // 5000 -ms('1y') // 31557600000 -ms('100') // 100 -ms('-3 days') // -259200000 -ms('-1h') // -3600000 -ms('-200') // -200 -``` - -### Convert from Milliseconds - -```js -ms(60000) // "1m" -ms(2 * 60000) // "2m" -ms(-3 * 60000) // "-3m" -ms(ms('10 hours')) // "10h" -``` - -### Time Format Written-Out - -```js -ms(60000, { long: true }) // "1 minute" -ms(2 * 60000, { long: true }) // "2 minutes" -ms(-3 * 60000, { long: true }) // "-3 minutes" -ms(ms('10 hours'), { long: true }) // "10 hours" -``` - -## Features - -- Works both in [Node.js](https://nodejs.org) and in the browser -- If a number is supplied to `ms`, a string with a unit is returned -- If a string that contains the number is supplied, it returns it as a number (e.g.: it returns `100` for `'100'`) -- If you pass a string with a number and a valid unit, the number of equivalent milliseconds is returned - -## Related Packages - -- [ms.macro](https://github.com/knpwrs/ms.macro) - Run `ms` as a macro at build-time. - -## Caught a Bug? - -1. [Fork](https://help.github.com/articles/fork-a-repo/) this repository to your own GitHub account and then [clone](https://help.github.com/articles/cloning-a-repository/) it to your local device -2. Link the package to the global module directory: `npm link` -3. Within the module you want to test your local development instance of ms, just link it to the dependencies: `npm link ms`. Instead of the default one from npm, Node.js will now use your clone of ms! - -As always, you can run the tests using: `npm test` diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/node-fetch/LICENSE.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/node-fetch/LICENSE.md deleted file mode 100644 index 660ffecb..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/node-fetch/LICENSE.md +++ /dev/null @@ -1,22 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2016 David Frank - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/node-fetch/README.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/node-fetch/README.md deleted file mode 100644 index 2dde7428..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/node-fetch/README.md +++ /dev/null @@ -1,590 +0,0 @@ -node-fetch -========== - -[![npm version][npm-image]][npm-url] -[![build status][travis-image]][travis-url] -[![coverage status][codecov-image]][codecov-url] -[![install size][install-size-image]][install-size-url] -[![Discord][discord-image]][discord-url] - -A light-weight module that brings `window.fetch` to Node.js - -(We are looking for [v2 maintainers and collaborators](https://github.com/bitinn/node-fetch/issues/567)) - -[![Backers][opencollective-image]][opencollective-url] - - - -- [Motivation](#motivation) -- [Features](#features) -- [Difference from client-side fetch](#difference-from-client-side-fetch) -- [Installation](#installation) -- [Loading and configuring the module](#loading-and-configuring-the-module) -- [Common Usage](#common-usage) - - [Plain text or HTML](#plain-text-or-html) - - [JSON](#json) - - [Simple Post](#simple-post) - - [Post with JSON](#post-with-json) - - [Post with form parameters](#post-with-form-parameters) - - [Handling exceptions](#handling-exceptions) - - [Handling client and server errors](#handling-client-and-server-errors) -- [Advanced Usage](#advanced-usage) - - [Streams](#streams) - - [Buffer](#buffer) - - [Accessing Headers and other Meta data](#accessing-headers-and-other-meta-data) - - [Extract Set-Cookie Header](#extract-set-cookie-header) - - [Post data using a file stream](#post-data-using-a-file-stream) - - [Post with form-data (detect multipart)](#post-with-form-data-detect-multipart) - - [Request cancellation with AbortSignal](#request-cancellation-with-abortsignal) -- [API](#api) - - [fetch(url[, options])](#fetchurl-options) - - [Options](#options) - - [Class: Request](#class-request) - - [Class: Response](#class-response) - - [Class: Headers](#class-headers) - - [Interface: Body](#interface-body) - - [Class: FetchError](#class-fetcherror) -- [License](#license) -- [Acknowledgement](#acknowledgement) - - - -## Motivation - -Instead of implementing `XMLHttpRequest` in Node.js to run browser-specific [Fetch polyfill](https://github.com/github/fetch), why not go from native `http` to `fetch` API directly? Hence, `node-fetch`, minimal code for a `window.fetch` compatible API on Node.js runtime. - -See Matt Andrews' [isomorphic-fetch](https://github.com/matthew-andrews/isomorphic-fetch) or Leonardo Quixada's [cross-fetch](https://github.com/lquixada/cross-fetch) for isomorphic usage (exports `node-fetch` for server-side, `whatwg-fetch` for client-side). - -## Features - -- Stay consistent with `window.fetch` API. -- Make conscious trade-off when following [WHATWG fetch spec][whatwg-fetch] and [stream spec](https://streams.spec.whatwg.org/) implementation details, document known differences. -- Use native promise but allow substituting it with [insert your favorite promise library]. -- Use native Node streams for body on both request and response. -- Decode content encoding (gzip/deflate) properly and convert string output (such as `res.text()` and `res.json()`) to UTF-8 automatically. -- Useful extensions such as timeout, redirect limit, response size limit, [explicit errors](ERROR-HANDLING.md) for troubleshooting. - -## Difference from client-side fetch - -- See [Known Differences](LIMITS.md) for details. -- If you happen to use a missing feature that `window.fetch` offers, feel free to open an issue. -- Pull requests are welcomed too! - -## Installation - -Current stable release (`2.x`) - -```sh -$ npm install node-fetch -``` - -## Loading and configuring the module -We suggest you load the module via `require` until the stabilization of ES modules in node: -```js -const fetch = require('node-fetch'); -``` - -If you are using a Promise library other than native, set it through `fetch.Promise`: -```js -const Bluebird = require('bluebird'); - -fetch.Promise = Bluebird; -``` - -## Common Usage - -NOTE: The documentation below is up-to-date with `2.x` releases; see the [`1.x` readme](https://github.com/bitinn/node-fetch/blob/1.x/README.md), [changelog](https://github.com/bitinn/node-fetch/blob/1.x/CHANGELOG.md) and [2.x upgrade guide](UPGRADE-GUIDE.md) for the differences. - -#### Plain text or HTML -```js -fetch('https://github.com/') - .then(res => res.text()) - .then(body => console.log(body)); -``` - -#### JSON - -```js - -fetch('https://api.github.com/users/github') - .then(res => res.json()) - .then(json => console.log(json)); -``` - -#### Simple Post -```js -fetch('https://httpbin.org/post', { method: 'POST', body: 'a=1' }) - .then(res => res.json()) // expecting a json response - .then(json => console.log(json)); -``` - -#### Post with JSON - -```js -const body = { a: 1 }; - -fetch('https://httpbin.org/post', { - method: 'post', - body: JSON.stringify(body), - headers: { 'Content-Type': 'application/json' }, - }) - .then(res => res.json()) - .then(json => console.log(json)); -``` - -#### Post with form parameters -`URLSearchParams` is available in Node.js as of v7.5.0. See [official documentation](https://nodejs.org/api/url.html#url_class_urlsearchparams) for more usage methods. - -NOTE: The `Content-Type` header is only set automatically to `x-www-form-urlencoded` when an instance of `URLSearchParams` is given as such: - -```js -const { URLSearchParams } = require('url'); - -const params = new URLSearchParams(); -params.append('a', 1); - -fetch('https://httpbin.org/post', { method: 'POST', body: params }) - .then(res => res.json()) - .then(json => console.log(json)); -``` - -#### Handling exceptions -NOTE: 3xx-5xx responses are *NOT* exceptions and should be handled in `then()`; see the next section for more information. - -Adding a catch to the fetch promise chain will catch *all* exceptions, such as errors originating from node core libraries, network errors and operational errors, which are instances of FetchError. See the [error handling document](ERROR-HANDLING.md) for more details. - -```js -fetch('https://domain.invalid/') - .catch(err => console.error(err)); -``` - -#### Handling client and server errors -It is common to create a helper function to check that the response contains no client (4xx) or server (5xx) error responses: - -```js -function checkStatus(res) { - if (res.ok) { // res.status >= 200 && res.status < 300 - return res; - } else { - throw MyCustomError(res.statusText); - } -} - -fetch('https://httpbin.org/status/400') - .then(checkStatus) - .then(res => console.log('will not get here...')) -``` - -## Advanced Usage - -#### Streams -The "Node.js way" is to use streams when possible: - -```js -fetch('https://assets-cdn.github.com/images/modules/logos_page/Octocat.png') - .then(res => { - const dest = fs.createWriteStream('./octocat.png'); - res.body.pipe(dest); - }); -``` - -#### Buffer -If you prefer to cache binary data in full, use buffer(). (NOTE: `buffer()` is a `node-fetch`-only API) - -```js -const fileType = require('file-type'); - -fetch('https://assets-cdn.github.com/images/modules/logos_page/Octocat.png') - .then(res => res.buffer()) - .then(buffer => fileType(buffer)) - .then(type => { /* ... */ }); -``` - -#### Accessing Headers and other Meta data -```js -fetch('https://github.com/') - .then(res => { - console.log(res.ok); - console.log(res.status); - console.log(res.statusText); - console.log(res.headers.raw()); - console.log(res.headers.get('content-type')); - }); -``` - -#### Extract Set-Cookie Header - -Unlike browsers, you can access raw `Set-Cookie` headers manually using `Headers.raw()`. This is a `node-fetch` only API. - -```js -fetch(url).then(res => { - // returns an array of values, instead of a string of comma-separated values - console.log(res.headers.raw()['set-cookie']); -}); -``` - -#### Post data using a file stream - -```js -const { createReadStream } = require('fs'); - -const stream = createReadStream('input.txt'); - -fetch('https://httpbin.org/post', { method: 'POST', body: stream }) - .then(res => res.json()) - .then(json => console.log(json)); -``` - -#### Post with form-data (detect multipart) - -```js -const FormData = require('form-data'); - -const form = new FormData(); -form.append('a', 1); - -fetch('https://httpbin.org/post', { method: 'POST', body: form }) - .then(res => res.json()) - .then(json => console.log(json)); - -// OR, using custom headers -// NOTE: getHeaders() is non-standard API - -const form = new FormData(); -form.append('a', 1); - -const options = { - method: 'POST', - body: form, - headers: form.getHeaders() -} - -fetch('https://httpbin.org/post', options) - .then(res => res.json()) - .then(json => console.log(json)); -``` - -#### Request cancellation with AbortSignal - -> NOTE: You may cancel streamed requests only on Node >= v8.0.0 - -You may cancel requests with `AbortController`. A suggested implementation is [`abort-controller`](https://www.npmjs.com/package/abort-controller). - -An example of timing out a request after 150ms could be achieved as the following: - -```js -import AbortController from 'abort-controller'; - -const controller = new AbortController(); -const timeout = setTimeout( - () => { controller.abort(); }, - 150, -); - -fetch(url, { signal: controller.signal }) - .then(res => res.json()) - .then( - data => { - useData(data) - }, - err => { - if (err.name === 'AbortError') { - // request was aborted - } - }, - ) - .finally(() => { - clearTimeout(timeout); - }); -``` - -See [test cases](https://github.com/bitinn/node-fetch/blob/master/test/test.js) for more examples. - - -## API - -### fetch(url[, options]) - -- `url` A string representing the URL for fetching -- `options` [Options](#fetch-options) for the HTTP(S) request -- Returns: Promise<[Response](#class-response)> - -Perform an HTTP(S) fetch. - -`url` should be an absolute url, such as `https://example.com/`. A path-relative URL (`/file/under/root`) or protocol-relative URL (`//can-be-http-or-https.com/`) will result in a rejected `Promise`. - -
    -### Options - -The default values are shown after each option key. - -```js -{ - // These properties are part of the Fetch Standard - method: 'GET', - headers: {}, // request headers. format is the identical to that accepted by the Headers constructor (see below) - body: null, // request body. can be null, a string, a Buffer, a Blob, or a Node.js Readable stream - redirect: 'follow', // set to `manual` to extract redirect headers, `error` to reject redirect - signal: null, // pass an instance of AbortSignal to optionally abort requests - - // The following properties are node-fetch extensions - follow: 20, // maximum redirect count. 0 to not follow redirect - timeout: 0, // req/res timeout in ms, it resets on redirect. 0 to disable (OS limit applies). Signal is recommended instead. - compress: true, // support gzip/deflate content encoding. false to disable - size: 0, // maximum response body size in bytes. 0 to disable - agent: null // http(s).Agent instance or function that returns an instance (see below) -} -``` - -##### Default Headers - -If no values are set, the following request headers will be sent automatically: - -Header | Value -------------------- | -------------------------------------------------------- -`Accept-Encoding` | `gzip,deflate` _(when `options.compress === true`)_ -`Accept` | `*/*` -`Connection` | `close` _(when no `options.agent` is present)_ -`Content-Length` | _(automatically calculated, if possible)_ -`Transfer-Encoding` | `chunked` _(when `req.body` is a stream)_ -`User-Agent` | `node-fetch/1.0 (+https://github.com/bitinn/node-fetch)` - -Note: when `body` is a `Stream`, `Content-Length` is not set automatically. - -##### Custom Agent - -The `agent` option allows you to specify networking related options which are out of the scope of Fetch, including and not limited to the following: - -- Support self-signed certificate -- Use only IPv4 or IPv6 -- Custom DNS Lookup - -See [`http.Agent`](https://nodejs.org/api/http.html#http_new_agent_options) for more information. - -In addition, the `agent` option accepts a function that returns `http`(s)`.Agent` instance given current [URL](https://nodejs.org/api/url.html), this is useful during a redirection chain across HTTP and HTTPS protocol. - -```js -const httpAgent = new http.Agent({ - keepAlive: true -}); -const httpsAgent = new https.Agent({ - keepAlive: true -}); - -const options = { - agent: function (_parsedURL) { - if (_parsedURL.protocol == 'http:') { - return httpAgent; - } else { - return httpsAgent; - } - } -} -``` - - -### Class: Request - -An HTTP(S) request containing information about URL, method, headers, and the body. This class implements the [Body](#iface-body) interface. - -Due to the nature of Node.js, the following properties are not implemented at this moment: - -- `type` -- `destination` -- `referrer` -- `referrerPolicy` -- `mode` -- `credentials` -- `cache` -- `integrity` -- `keepalive` - -The following node-fetch extension properties are provided: - -- `follow` -- `compress` -- `counter` -- `agent` - -See [options](#fetch-options) for exact meaning of these extensions. - -#### new Request(input[, options]) - -*(spec-compliant)* - -- `input` A string representing a URL, or another `Request` (which will be cloned) -- `options` [Options][#fetch-options] for the HTTP(S) request - -Constructs a new `Request` object. The constructor is identical to that in the [browser](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request). - -In most cases, directly `fetch(url, options)` is simpler than creating a `Request` object. - - -### Class: Response - -An HTTP(S) response. This class implements the [Body](#iface-body) interface. - -The following properties are not implemented in node-fetch at this moment: - -- `Response.error()` -- `Response.redirect()` -- `type` -- `trailer` - -#### new Response([body[, options]]) - -*(spec-compliant)* - -- `body` A `String` or [`Readable` stream][node-readable] -- `options` A [`ResponseInit`][response-init] options dictionary - -Constructs a new `Response` object. The constructor is identical to that in the [browser](https://developer.mozilla.org/en-US/docs/Web/API/Response/Response). - -Because Node.js does not implement service workers (for which this class was designed), one rarely has to construct a `Response` directly. - -#### response.ok - -*(spec-compliant)* - -Convenience property representing if the request ended normally. Will evaluate to true if the response status was greater than or equal to 200 but smaller than 300. - -#### response.redirected - -*(spec-compliant)* - -Convenience property representing if the request has been redirected at least once. Will evaluate to true if the internal redirect counter is greater than 0. - - -### Class: Headers - -This class allows manipulating and iterating over a set of HTTP headers. All methods specified in the [Fetch Standard][whatwg-fetch] are implemented. - -#### new Headers([init]) - -*(spec-compliant)* - -- `init` Optional argument to pre-fill the `Headers` object - -Construct a new `Headers` object. `init` can be either `null`, a `Headers` object, an key-value map object or any iterable object. - -```js -// Example adapted from https://fetch.spec.whatwg.org/#example-headers-class - -const meta = { - 'Content-Type': 'text/xml', - 'Breaking-Bad': '<3' -}; -const headers = new Headers(meta); - -// The above is equivalent to -const meta = [ - [ 'Content-Type', 'text/xml' ], - [ 'Breaking-Bad', '<3' ] -]; -const headers = new Headers(meta); - -// You can in fact use any iterable objects, like a Map or even another Headers -const meta = new Map(); -meta.set('Content-Type', 'text/xml'); -meta.set('Breaking-Bad', '<3'); -const headers = new Headers(meta); -const copyOfHeaders = new Headers(headers); -``` - - -### Interface: Body - -`Body` is an abstract interface with methods that are applicable to both `Request` and `Response` classes. - -The following methods are not yet implemented in node-fetch at this moment: - -- `formData()` - -#### body.body - -*(deviation from spec)* - -* Node.js [`Readable` stream][node-readable] - -Data are encapsulated in the `Body` object. Note that while the [Fetch Standard][whatwg-fetch] requires the property to always be a WHATWG `ReadableStream`, in node-fetch it is a Node.js [`Readable` stream][node-readable]. - -#### body.bodyUsed - -*(spec-compliant)* - -* `Boolean` - -A boolean property for if this body has been consumed. Per the specs, a consumed body cannot be used again. - -#### body.arrayBuffer() -#### body.blob() -#### body.json() -#### body.text() - -*(spec-compliant)* - -* Returns: Promise - -Consume the body and return a promise that will resolve to one of these formats. - -#### body.buffer() - -*(node-fetch extension)* - -* Returns: Promise<Buffer> - -Consume the body and return a promise that will resolve to a Buffer. - -#### body.textConverted() - -*(node-fetch extension)* - -* Returns: Promise<String> - -Identical to `body.text()`, except instead of always converting to UTF-8, encoding sniffing will be performed and text converted to UTF-8 if possible. - -(This API requires an optional dependency of the npm package [encoding](https://www.npmjs.com/package/encoding), which you need to install manually. `webpack` users may see [a warning message](https://github.com/bitinn/node-fetch/issues/412#issuecomment-379007792) due to this optional dependency.) - - -### Class: FetchError - -*(node-fetch extension)* - -An operational error in the fetching process. See [ERROR-HANDLING.md][] for more info. - - -### Class: AbortError - -*(node-fetch extension)* - -An Error thrown when the request is aborted in response to an `AbortSignal`'s `abort` event. It has a `name` property of `AbortError`. See [ERROR-HANDLING.MD][] for more info. - -## Acknowledgement - -Thanks to [github/fetch](https://github.com/github/fetch) for providing a solid implementation reference. - -`node-fetch` v1 was maintained by [@bitinn](https://github.com/bitinn); v2 was maintained by [@TimothyGu](https://github.com/timothygu), [@bitinn](https://github.com/bitinn) and [@jimmywarting](https://github.com/jimmywarting); v2 readme is written by [@jkantr](https://github.com/jkantr). - -## License - -MIT - -[npm-image]: https://flat.badgen.net/npm/v/node-fetch -[npm-url]: https://www.npmjs.com/package/node-fetch -[travis-image]: https://flat.badgen.net/travis/bitinn/node-fetch -[travis-url]: https://travis-ci.org/bitinn/node-fetch -[codecov-image]: https://flat.badgen.net/codecov/c/github/bitinn/node-fetch/master -[codecov-url]: https://codecov.io/gh/bitinn/node-fetch -[install-size-image]: https://flat.badgen.net/packagephobia/install/node-fetch -[install-size-url]: https://packagephobia.now.sh/result?p=node-fetch -[discord-image]: https://img.shields.io/discord/619915844268326952?color=%237289DA&label=Discord&style=flat-square -[discord-url]: https://discord.gg/Zxbndcm -[opencollective-image]: https://opencollective.com/node-fetch/backers.svg -[opencollective-url]: https://opencollective.com/node-fetch -[whatwg-fetch]: https://fetch.spec.whatwg.org/ -[response-init]: https://fetch.spec.whatwg.org/#responseinit -[node-readable]: https://nodejs.org/api/stream.html#stream_readable_streams -[mdn-headers]: https://developer.mozilla.org/en-US/docs/Web/API/Headers -[LIMITS.md]: https://github.com/bitinn/node-fetch/blob/master/LIMITS.md -[ERROR-HANDLING.md]: https://github.com/bitinn/node-fetch/blob/master/ERROR-HANDLING.md -[UPGRADE-GUIDE.md]: https://github.com/bitinn/node-fetch/blob/master/UPGRADE-GUIDE.md diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/node-fetch/browser.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/node-fetch/browser.js deleted file mode 100644 index 83c54c58..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/node-fetch/browser.js +++ /dev/null @@ -1,25 +0,0 @@ -"use strict"; - -// ref: https://github.com/tc39/proposal-global -var getGlobal = function () { - // the only reliable means to get the global object is - // `Function('return this')()` - // However, this causes CSP violations in Chrome apps. - if (typeof self !== 'undefined') { return self; } - if (typeof window !== 'undefined') { return window; } - if (typeof global !== 'undefined') { return global; } - throw new Error('unable to locate global object'); -} - -var global = getGlobal(); - -module.exports = exports = global.fetch; - -// Needed for TypeScript and Webpack. -if (global.fetch) { - exports.default = global.fetch.bind(global); -} - -exports.Headers = global.Headers; -exports.Request = global.Request; -exports.Response = global.Response; \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/node-fetch/lib/index.es.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/node-fetch/lib/index.es.js deleted file mode 100644 index 4852f7cb..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/node-fetch/lib/index.es.js +++ /dev/null @@ -1,1688 +0,0 @@ -process.emitWarning("The .es.js file is deprecated. Use .mjs instead."); - -import Stream from 'stream'; -import http from 'http'; -import Url from 'url'; -import whatwgUrl from 'whatwg-url'; -import https from 'https'; -import zlib from 'zlib'; - -// Based on https://github.com/tmpvar/jsdom/blob/aa85b2abf07766ff7bf5c1f6daafb3726f2f2db5/lib/jsdom/living/blob.js - -// fix for "Readable" isn't a named export issue -const Readable = Stream.Readable; - -const BUFFER = Symbol('buffer'); -const TYPE = Symbol('type'); - -class Blob { - constructor() { - this[TYPE] = ''; - - const blobParts = arguments[0]; - const options = arguments[1]; - - const buffers = []; - let size = 0; - - if (blobParts) { - const a = blobParts; - const length = Number(a.length); - for (let i = 0; i < length; i++) { - const element = a[i]; - let buffer; - if (element instanceof Buffer) { - buffer = element; - } else if (ArrayBuffer.isView(element)) { - buffer = Buffer.from(element.buffer, element.byteOffset, element.byteLength); - } else if (element instanceof ArrayBuffer) { - buffer = Buffer.from(element); - } else if (element instanceof Blob) { - buffer = element[BUFFER]; - } else { - buffer = Buffer.from(typeof element === 'string' ? element : String(element)); - } - size += buffer.length; - buffers.push(buffer); - } - } - - this[BUFFER] = Buffer.concat(buffers); - - let type = options && options.type !== undefined && String(options.type).toLowerCase(); - if (type && !/[^\u0020-\u007E]/.test(type)) { - this[TYPE] = type; - } - } - get size() { - return this[BUFFER].length; - } - get type() { - return this[TYPE]; - } - text() { - return Promise.resolve(this[BUFFER].toString()); - } - arrayBuffer() { - const buf = this[BUFFER]; - const ab = buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength); - return Promise.resolve(ab); - } - stream() { - const readable = new Readable(); - readable._read = function () {}; - readable.push(this[BUFFER]); - readable.push(null); - return readable; - } - toString() { - return '[object Blob]'; - } - slice() { - const size = this.size; - - const start = arguments[0]; - const end = arguments[1]; - let relativeStart, relativeEnd; - if (start === undefined) { - relativeStart = 0; - } else if (start < 0) { - relativeStart = Math.max(size + start, 0); - } else { - relativeStart = Math.min(start, size); - } - if (end === undefined) { - relativeEnd = size; - } else if (end < 0) { - relativeEnd = Math.max(size + end, 0); - } else { - relativeEnd = Math.min(end, size); - } - const span = Math.max(relativeEnd - relativeStart, 0); - - const buffer = this[BUFFER]; - const slicedBuffer = buffer.slice(relativeStart, relativeStart + span); - const blob = new Blob([], { type: arguments[2] }); - blob[BUFFER] = slicedBuffer; - return blob; - } -} - -Object.defineProperties(Blob.prototype, { - size: { enumerable: true }, - type: { enumerable: true }, - slice: { enumerable: true } -}); - -Object.defineProperty(Blob.prototype, Symbol.toStringTag, { - value: 'Blob', - writable: false, - enumerable: false, - configurable: true -}); - -/** - * fetch-error.js - * - * FetchError interface for operational errors - */ - -/** - * Create FetchError instance - * - * @param String message Error message for human - * @param String type Error type for machine - * @param String systemError For Node.js system error - * @return FetchError - */ -function FetchError(message, type, systemError) { - Error.call(this, message); - - this.message = message; - this.type = type; - - // when err.type is `system`, err.code contains system error code - if (systemError) { - this.code = this.errno = systemError.code; - } - - // hide custom error implementation details from end-users - Error.captureStackTrace(this, this.constructor); -} - -FetchError.prototype = Object.create(Error.prototype); -FetchError.prototype.constructor = FetchError; -FetchError.prototype.name = 'FetchError'; - -let convert; -try { - convert = require('encoding').convert; -} catch (e) {} - -const INTERNALS = Symbol('Body internals'); - -// fix an issue where "PassThrough" isn't a named export for node <10 -const PassThrough = Stream.PassThrough; - -/** - * Body mixin - * - * Ref: https://fetch.spec.whatwg.org/#body - * - * @param Stream body Readable stream - * @param Object opts Response options - * @return Void - */ -function Body(body) { - var _this = this; - - var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, - _ref$size = _ref.size; - - let size = _ref$size === undefined ? 0 : _ref$size; - var _ref$timeout = _ref.timeout; - let timeout = _ref$timeout === undefined ? 0 : _ref$timeout; - - if (body == null) { - // body is undefined or null - body = null; - } else if (isURLSearchParams(body)) { - // body is a URLSearchParams - body = Buffer.from(body.toString()); - } else if (isBlob(body)) ; else if (Buffer.isBuffer(body)) ; else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') { - // body is ArrayBuffer - body = Buffer.from(body); - } else if (ArrayBuffer.isView(body)) { - // body is ArrayBufferView - body = Buffer.from(body.buffer, body.byteOffset, body.byteLength); - } else if (body instanceof Stream) ; else { - // none of the above - // coerce to string then buffer - body = Buffer.from(String(body)); - } - this[INTERNALS] = { - body, - disturbed: false, - error: null - }; - this.size = size; - this.timeout = timeout; - - if (body instanceof Stream) { - body.on('error', function (err) { - const error = err.name === 'AbortError' ? err : new FetchError(`Invalid response body while trying to fetch ${_this.url}: ${err.message}`, 'system', err); - _this[INTERNALS].error = error; - }); - } -} - -Body.prototype = { - get body() { - return this[INTERNALS].body; - }, - - get bodyUsed() { - return this[INTERNALS].disturbed; - }, - - /** - * Decode response as ArrayBuffer - * - * @return Promise - */ - arrayBuffer() { - return consumeBody.call(this).then(function (buf) { - return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength); - }); - }, - - /** - * Return raw response as Blob - * - * @return Promise - */ - blob() { - let ct = this.headers && this.headers.get('content-type') || ''; - return consumeBody.call(this).then(function (buf) { - return Object.assign( - // Prevent copying - new Blob([], { - type: ct.toLowerCase() - }), { - [BUFFER]: buf - }); - }); - }, - - /** - * Decode response as json - * - * @return Promise - */ - json() { - var _this2 = this; - - return consumeBody.call(this).then(function (buffer) { - try { - return JSON.parse(buffer.toString()); - } catch (err) { - return Body.Promise.reject(new FetchError(`invalid json response body at ${_this2.url} reason: ${err.message}`, 'invalid-json')); - } - }); - }, - - /** - * Decode response as text - * - * @return Promise - */ - text() { - return consumeBody.call(this).then(function (buffer) { - return buffer.toString(); - }); - }, - - /** - * Decode response as buffer (non-spec api) - * - * @return Promise - */ - buffer() { - return consumeBody.call(this); - }, - - /** - * Decode response as text, while automatically detecting the encoding and - * trying to decode to UTF-8 (non-spec api) - * - * @return Promise - */ - textConverted() { - var _this3 = this; - - return consumeBody.call(this).then(function (buffer) { - return convertBody(buffer, _this3.headers); - }); - } -}; - -// In browsers, all properties are enumerable. -Object.defineProperties(Body.prototype, { - body: { enumerable: true }, - bodyUsed: { enumerable: true }, - arrayBuffer: { enumerable: true }, - blob: { enumerable: true }, - json: { enumerable: true }, - text: { enumerable: true } -}); - -Body.mixIn = function (proto) { - for (const name of Object.getOwnPropertyNames(Body.prototype)) { - // istanbul ignore else: future proof - if (!(name in proto)) { - const desc = Object.getOwnPropertyDescriptor(Body.prototype, name); - Object.defineProperty(proto, name, desc); - } - } -}; - -/** - * Consume and convert an entire Body to a Buffer. - * - * Ref: https://fetch.spec.whatwg.org/#concept-body-consume-body - * - * @return Promise - */ -function consumeBody() { - var _this4 = this; - - if (this[INTERNALS].disturbed) { - return Body.Promise.reject(new TypeError(`body used already for: ${this.url}`)); - } - - this[INTERNALS].disturbed = true; - - if (this[INTERNALS].error) { - return Body.Promise.reject(this[INTERNALS].error); - } - - let body = this.body; - - // body is null - if (body === null) { - return Body.Promise.resolve(Buffer.alloc(0)); - } - - // body is blob - if (isBlob(body)) { - body = body.stream(); - } - - // body is buffer - if (Buffer.isBuffer(body)) { - return Body.Promise.resolve(body); - } - - // istanbul ignore if: should never happen - if (!(body instanceof Stream)) { - return Body.Promise.resolve(Buffer.alloc(0)); - } - - // body is stream - // get ready to actually consume the body - let accum = []; - let accumBytes = 0; - let abort = false; - - return new Body.Promise(function (resolve, reject) { - let resTimeout; - - // allow timeout on slow response body - if (_this4.timeout) { - resTimeout = setTimeout(function () { - abort = true; - reject(new FetchError(`Response timeout while trying to fetch ${_this4.url} (over ${_this4.timeout}ms)`, 'body-timeout')); - }, _this4.timeout); - } - - // handle stream errors - body.on('error', function (err) { - if (err.name === 'AbortError') { - // if the request was aborted, reject with this Error - abort = true; - reject(err); - } else { - // other errors, such as incorrect content-encoding - reject(new FetchError(`Invalid response body while trying to fetch ${_this4.url}: ${err.message}`, 'system', err)); - } - }); - - body.on('data', function (chunk) { - if (abort || chunk === null) { - return; - } - - if (_this4.size && accumBytes + chunk.length > _this4.size) { - abort = true; - reject(new FetchError(`content size at ${_this4.url} over limit: ${_this4.size}`, 'max-size')); - return; - } - - accumBytes += chunk.length; - accum.push(chunk); - }); - - body.on('end', function () { - if (abort) { - return; - } - - clearTimeout(resTimeout); - - try { - resolve(Buffer.concat(accum, accumBytes)); - } catch (err) { - // handle streams that have accumulated too much data (issue #414) - reject(new FetchError(`Could not create Buffer from response body for ${_this4.url}: ${err.message}`, 'system', err)); - } - }); - }); -} - -/** - * Detect buffer encoding and convert to target encoding - * ref: http://www.w3.org/TR/2011/WD-html5-20110113/parsing.html#determining-the-character-encoding - * - * @param Buffer buffer Incoming buffer - * @param String encoding Target encoding - * @return String - */ -function convertBody(buffer, headers) { - if (typeof convert !== 'function') { - throw new Error('The package `encoding` must be installed to use the textConverted() function'); - } - - const ct = headers.get('content-type'); - let charset = 'utf-8'; - let res, str; - - // header - if (ct) { - res = /charset=([^;]*)/i.exec(ct); - } - - // no charset in content type, peek at response body for at most 1024 bytes - str = buffer.slice(0, 1024).toString(); - - // html5 - if (!res && str) { - res = / 0 && arguments[0] !== undefined ? arguments[0] : undefined; - - this[MAP] = Object.create(null); - - if (init instanceof Headers) { - const rawHeaders = init.raw(); - const headerNames = Object.keys(rawHeaders); - - for (const headerName of headerNames) { - for (const value of rawHeaders[headerName]) { - this.append(headerName, value); - } - } - - return; - } - - // We don't worry about converting prop to ByteString here as append() - // will handle it. - if (init == null) ; else if (typeof init === 'object') { - const method = init[Symbol.iterator]; - if (method != null) { - if (typeof method !== 'function') { - throw new TypeError('Header pairs must be iterable'); - } - - // sequence> - // Note: per spec we have to first exhaust the lists then process them - const pairs = []; - for (const pair of init) { - if (typeof pair !== 'object' || typeof pair[Symbol.iterator] !== 'function') { - throw new TypeError('Each header pair must be iterable'); - } - pairs.push(Array.from(pair)); - } - - for (const pair of pairs) { - if (pair.length !== 2) { - throw new TypeError('Each header pair must be a name/value tuple'); - } - this.append(pair[0], pair[1]); - } - } else { - // record - for (const key of Object.keys(init)) { - const value = init[key]; - this.append(key, value); - } - } - } else { - throw new TypeError('Provided initializer must be an object'); - } - } - - /** - * Return combined header value given name - * - * @param String name Header name - * @return Mixed - */ - get(name) { - name = `${name}`; - validateName(name); - const key = find(this[MAP], name); - if (key === undefined) { - return null; - } - - return this[MAP][key].join(', '); - } - - /** - * Iterate over all headers - * - * @param Function callback Executed for each item with parameters (value, name, thisArg) - * @param Boolean thisArg `this` context for callback function - * @return Void - */ - forEach(callback) { - let thisArg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined; - - let pairs = getHeaders(this); - let i = 0; - while (i < pairs.length) { - var _pairs$i = pairs[i]; - const name = _pairs$i[0], - value = _pairs$i[1]; - - callback.call(thisArg, value, name, this); - pairs = getHeaders(this); - i++; - } - } - - /** - * Overwrite header values given name - * - * @param String name Header name - * @param String value Header value - * @return Void - */ - set(name, value) { - name = `${name}`; - value = `${value}`; - validateName(name); - validateValue(value); - const key = find(this[MAP], name); - this[MAP][key !== undefined ? key : name] = [value]; - } - - /** - * Append a value onto existing header - * - * @param String name Header name - * @param String value Header value - * @return Void - */ - append(name, value) { - name = `${name}`; - value = `${value}`; - validateName(name); - validateValue(value); - const key = find(this[MAP], name); - if (key !== undefined) { - this[MAP][key].push(value); - } else { - this[MAP][name] = [value]; - } - } - - /** - * Check for header name existence - * - * @param String name Header name - * @return Boolean - */ - has(name) { - name = `${name}`; - validateName(name); - return find(this[MAP], name) !== undefined; - } - - /** - * Delete all header values given name - * - * @param String name Header name - * @return Void - */ - delete(name) { - name = `${name}`; - validateName(name); - const key = find(this[MAP], name); - if (key !== undefined) { - delete this[MAP][key]; - } - } - - /** - * Return raw headers (non-spec api) - * - * @return Object - */ - raw() { - return this[MAP]; - } - - /** - * Get an iterator on keys. - * - * @return Iterator - */ - keys() { - return createHeadersIterator(this, 'key'); - } - - /** - * Get an iterator on values. - * - * @return Iterator - */ - values() { - return createHeadersIterator(this, 'value'); - } - - /** - * Get an iterator on entries. - * - * This is the default iterator of the Headers object. - * - * @return Iterator - */ - [Symbol.iterator]() { - return createHeadersIterator(this, 'key+value'); - } -} -Headers.prototype.entries = Headers.prototype[Symbol.iterator]; - -Object.defineProperty(Headers.prototype, Symbol.toStringTag, { - value: 'Headers', - writable: false, - enumerable: false, - configurable: true -}); - -Object.defineProperties(Headers.prototype, { - get: { enumerable: true }, - forEach: { enumerable: true }, - set: { enumerable: true }, - append: { enumerable: true }, - has: { enumerable: true }, - delete: { enumerable: true }, - keys: { enumerable: true }, - values: { enumerable: true }, - entries: { enumerable: true } -}); - -function getHeaders(headers) { - let kind = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'key+value'; - - const keys = Object.keys(headers[MAP]).sort(); - return keys.map(kind === 'key' ? function (k) { - return k.toLowerCase(); - } : kind === 'value' ? function (k) { - return headers[MAP][k].join(', '); - } : function (k) { - return [k.toLowerCase(), headers[MAP][k].join(', ')]; - }); -} - -const INTERNAL = Symbol('internal'); - -function createHeadersIterator(target, kind) { - const iterator = Object.create(HeadersIteratorPrototype); - iterator[INTERNAL] = { - target, - kind, - index: 0 - }; - return iterator; -} - -const HeadersIteratorPrototype = Object.setPrototypeOf({ - next() { - // istanbul ignore if - if (!this || Object.getPrototypeOf(this) !== HeadersIteratorPrototype) { - throw new TypeError('Value of `this` is not a HeadersIterator'); - } - - var _INTERNAL = this[INTERNAL]; - const target = _INTERNAL.target, - kind = _INTERNAL.kind, - index = _INTERNAL.index; - - const values = getHeaders(target, kind); - const len = values.length; - if (index >= len) { - return { - value: undefined, - done: true - }; - } - - this[INTERNAL].index = index + 1; - - return { - value: values[index], - done: false - }; - } -}, Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]()))); - -Object.defineProperty(HeadersIteratorPrototype, Symbol.toStringTag, { - value: 'HeadersIterator', - writable: false, - enumerable: false, - configurable: true -}); - -/** - * Export the Headers object in a form that Node.js can consume. - * - * @param Headers headers - * @return Object - */ -function exportNodeCompatibleHeaders(headers) { - const obj = Object.assign({ __proto__: null }, headers[MAP]); - - // http.request() only supports string as Host header. This hack makes - // specifying custom Host header possible. - const hostHeaderKey = find(headers[MAP], 'Host'); - if (hostHeaderKey !== undefined) { - obj[hostHeaderKey] = obj[hostHeaderKey][0]; - } - - return obj; -} - -/** - * Create a Headers object from an object of headers, ignoring those that do - * not conform to HTTP grammar productions. - * - * @param Object obj Object of headers - * @return Headers - */ -function createHeadersLenient(obj) { - const headers = new Headers(); - for (const name of Object.keys(obj)) { - if (invalidTokenRegex.test(name)) { - continue; - } - if (Array.isArray(obj[name])) { - for (const val of obj[name]) { - if (invalidHeaderCharRegex.test(val)) { - continue; - } - if (headers[MAP][name] === undefined) { - headers[MAP][name] = [val]; - } else { - headers[MAP][name].push(val); - } - } - } else if (!invalidHeaderCharRegex.test(obj[name])) { - headers[MAP][name] = [obj[name]]; - } - } - return headers; -} - -const INTERNALS$1 = Symbol('Response internals'); - -// fix an issue where "STATUS_CODES" aren't a named export for node <10 -const STATUS_CODES = http.STATUS_CODES; - -/** - * Response class - * - * @param Stream body Readable stream - * @param Object opts Response options - * @return Void - */ -class Response { - constructor() { - let body = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null; - let opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - - Body.call(this, body, opts); - - const status = opts.status || 200; - const headers = new Headers(opts.headers); - - if (body != null && !headers.has('Content-Type')) { - const contentType = extractContentType(body); - if (contentType) { - headers.append('Content-Type', contentType); - } - } - - this[INTERNALS$1] = { - url: opts.url, - status, - statusText: opts.statusText || STATUS_CODES[status], - headers, - counter: opts.counter - }; - } - - get url() { - return this[INTERNALS$1].url || ''; - } - - get status() { - return this[INTERNALS$1].status; - } - - /** - * Convenience property representing if the request ended normally - */ - get ok() { - return this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300; - } - - get redirected() { - return this[INTERNALS$1].counter > 0; - } - - get statusText() { - return this[INTERNALS$1].statusText; - } - - get headers() { - return this[INTERNALS$1].headers; - } - - /** - * Clone this response - * - * @return Response - */ - clone() { - return new Response(clone(this), { - url: this.url, - status: this.status, - statusText: this.statusText, - headers: this.headers, - ok: this.ok, - redirected: this.redirected - }); - } -} - -Body.mixIn(Response.prototype); - -Object.defineProperties(Response.prototype, { - url: { enumerable: true }, - status: { enumerable: true }, - ok: { enumerable: true }, - redirected: { enumerable: true }, - statusText: { enumerable: true }, - headers: { enumerable: true }, - clone: { enumerable: true } -}); - -Object.defineProperty(Response.prototype, Symbol.toStringTag, { - value: 'Response', - writable: false, - enumerable: false, - configurable: true -}); - -const INTERNALS$2 = Symbol('Request internals'); -const URL = Url.URL || whatwgUrl.URL; - -// fix an issue where "format", "parse" aren't a named export for node <10 -const parse_url = Url.parse; -const format_url = Url.format; - -/** - * Wrapper around `new URL` to handle arbitrary URLs - * - * @param {string} urlStr - * @return {void} - */ -function parseURL(urlStr) { - /* - Check whether the URL is absolute or not - Scheme: https://tools.ietf.org/html/rfc3986#section-3.1 - Absolute URL: https://tools.ietf.org/html/rfc3986#section-4.3 - */ - if (/^[a-zA-Z][a-zA-Z\d+\-.]*:/.exec(urlStr)) { - urlStr = new URL(urlStr).toString(); - } - - // Fallback to old implementation for arbitrary URLs - return parse_url(urlStr); -} - -const streamDestructionSupported = 'destroy' in Stream.Readable.prototype; - -/** - * Check if a value is an instance of Request. - * - * @param Mixed input - * @return Boolean - */ -function isRequest(input) { - return typeof input === 'object' && typeof input[INTERNALS$2] === 'object'; -} - -function isAbortSignal(signal) { - const proto = signal && typeof signal === 'object' && Object.getPrototypeOf(signal); - return !!(proto && proto.constructor.name === 'AbortSignal'); -} - -/** - * Request class - * - * @param Mixed input Url or Request instance - * @param Object init Custom options - * @return Void - */ -class Request { - constructor(input) { - let init = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - - let parsedURL; - - // normalize input - if (!isRequest(input)) { - if (input && input.href) { - // in order to support Node.js' Url objects; though WHATWG's URL objects - // will fall into this branch also (since their `toString()` will return - // `href` property anyway) - parsedURL = parseURL(input.href); - } else { - // coerce input to a string before attempting to parse - parsedURL = parseURL(`${input}`); - } - input = {}; - } else { - parsedURL = parseURL(input.url); - } - - let method = init.method || input.method || 'GET'; - method = method.toUpperCase(); - - if ((init.body != null || isRequest(input) && input.body !== null) && (method === 'GET' || method === 'HEAD')) { - throw new TypeError('Request with GET/HEAD method cannot have body'); - } - - let inputBody = init.body != null ? init.body : isRequest(input) && input.body !== null ? clone(input) : null; - - Body.call(this, inputBody, { - timeout: init.timeout || input.timeout || 0, - size: init.size || input.size || 0 - }); - - const headers = new Headers(init.headers || input.headers || {}); - - if (inputBody != null && !headers.has('Content-Type')) { - const contentType = extractContentType(inputBody); - if (contentType) { - headers.append('Content-Type', contentType); - } - } - - let signal = isRequest(input) ? input.signal : null; - if ('signal' in init) signal = init.signal; - - if (signal != null && !isAbortSignal(signal)) { - throw new TypeError('Expected signal to be an instanceof AbortSignal'); - } - - this[INTERNALS$2] = { - method, - redirect: init.redirect || input.redirect || 'follow', - headers, - parsedURL, - signal - }; - - // node-fetch-only options - this.follow = init.follow !== undefined ? init.follow : input.follow !== undefined ? input.follow : 20; - this.compress = init.compress !== undefined ? init.compress : input.compress !== undefined ? input.compress : true; - this.counter = init.counter || input.counter || 0; - this.agent = init.agent || input.agent; - } - - get method() { - return this[INTERNALS$2].method; - } - - get url() { - return format_url(this[INTERNALS$2].parsedURL); - } - - get headers() { - return this[INTERNALS$2].headers; - } - - get redirect() { - return this[INTERNALS$2].redirect; - } - - get signal() { - return this[INTERNALS$2].signal; - } - - /** - * Clone this request - * - * @return Request - */ - clone() { - return new Request(this); - } -} - -Body.mixIn(Request.prototype); - -Object.defineProperty(Request.prototype, Symbol.toStringTag, { - value: 'Request', - writable: false, - enumerable: false, - configurable: true -}); - -Object.defineProperties(Request.prototype, { - method: { enumerable: true }, - url: { enumerable: true }, - headers: { enumerable: true }, - redirect: { enumerable: true }, - clone: { enumerable: true }, - signal: { enumerable: true } -}); - -/** - * Convert a Request to Node.js http request options. - * - * @param Request A Request instance - * @return Object The options object to be passed to http.request - */ -function getNodeRequestOptions(request) { - const parsedURL = request[INTERNALS$2].parsedURL; - const headers = new Headers(request[INTERNALS$2].headers); - - // fetch step 1.3 - if (!headers.has('Accept')) { - headers.set('Accept', '*/*'); - } - - // Basic fetch - if (!parsedURL.protocol || !parsedURL.hostname) { - throw new TypeError('Only absolute URLs are supported'); - } - - if (!/^https?:$/.test(parsedURL.protocol)) { - throw new TypeError('Only HTTP(S) protocols are supported'); - } - - if (request.signal && request.body instanceof Stream.Readable && !streamDestructionSupported) { - throw new Error('Cancellation of streamed requests with AbortSignal is not supported in node < 8'); - } - - // HTTP-network-or-cache fetch steps 2.4-2.7 - let contentLengthValue = null; - if (request.body == null && /^(POST|PUT)$/i.test(request.method)) { - contentLengthValue = '0'; - } - if (request.body != null) { - const totalBytes = getTotalBytes(request); - if (typeof totalBytes === 'number') { - contentLengthValue = String(totalBytes); - } - } - if (contentLengthValue) { - headers.set('Content-Length', contentLengthValue); - } - - // HTTP-network-or-cache fetch step 2.11 - if (!headers.has('User-Agent')) { - headers.set('User-Agent', 'node-fetch/1.0 (+https://github.com/bitinn/node-fetch)'); - } - - // HTTP-network-or-cache fetch step 2.15 - if (request.compress && !headers.has('Accept-Encoding')) { - headers.set('Accept-Encoding', 'gzip,deflate'); - } - - let agent = request.agent; - if (typeof agent === 'function') { - agent = agent(parsedURL); - } - - if (!headers.has('Connection') && !agent) { - headers.set('Connection', 'close'); - } - - // HTTP-network fetch step 4.2 - // chunked encoding is handled by Node.js - - return Object.assign({}, parsedURL, { - method: request.method, - headers: exportNodeCompatibleHeaders(headers), - agent - }); -} - -/** - * abort-error.js - * - * AbortError interface for cancelled requests - */ - -/** - * Create AbortError instance - * - * @param String message Error message for human - * @return AbortError - */ -function AbortError(message) { - Error.call(this, message); - - this.type = 'aborted'; - this.message = message; - - // hide custom error implementation details from end-users - Error.captureStackTrace(this, this.constructor); -} - -AbortError.prototype = Object.create(Error.prototype); -AbortError.prototype.constructor = AbortError; -AbortError.prototype.name = 'AbortError'; - -const URL$1 = Url.URL || whatwgUrl.URL; - -// fix an issue where "PassThrough", "resolve" aren't a named export for node <10 -const PassThrough$1 = Stream.PassThrough; - -const isDomainOrSubdomain = function isDomainOrSubdomain(destination, original) { - const orig = new URL$1(original).hostname; - const dest = new URL$1(destination).hostname; - - return orig === dest || orig[orig.length - dest.length - 1] === '.' && orig.endsWith(dest); -}; - -/** - * Fetch function - * - * @param Mixed url Absolute url or Request instance - * @param Object opts Fetch options - * @return Promise - */ -function fetch(url, opts) { - - // allow custom promise - if (!fetch.Promise) { - throw new Error('native promise missing, set fetch.Promise to your favorite alternative'); - } - - Body.Promise = fetch.Promise; - - // wrap http.request into fetch - return new fetch.Promise(function (resolve, reject) { - // build request object - const request = new Request(url, opts); - const options = getNodeRequestOptions(request); - - const send = (options.protocol === 'https:' ? https : http).request; - const signal = request.signal; - - let response = null; - - const abort = function abort() { - let error = new AbortError('The user aborted a request.'); - reject(error); - if (request.body && request.body instanceof Stream.Readable) { - request.body.destroy(error); - } - if (!response || !response.body) return; - response.body.emit('error', error); - }; - - if (signal && signal.aborted) { - abort(); - return; - } - - const abortAndFinalize = function abortAndFinalize() { - abort(); - finalize(); - }; - - // send request - const req = send(options); - let reqTimeout; - - if (signal) { - signal.addEventListener('abort', abortAndFinalize); - } - - function finalize() { - req.abort(); - if (signal) signal.removeEventListener('abort', abortAndFinalize); - clearTimeout(reqTimeout); - } - - if (request.timeout) { - req.once('socket', function (socket) { - reqTimeout = setTimeout(function () { - reject(new FetchError(`network timeout at: ${request.url}`, 'request-timeout')); - finalize(); - }, request.timeout); - }); - } - - req.on('error', function (err) { - reject(new FetchError(`request to ${request.url} failed, reason: ${err.message}`, 'system', err)); - finalize(); - }); - - req.on('response', function (res) { - clearTimeout(reqTimeout); - - const headers = createHeadersLenient(res.headers); - - // HTTP fetch step 5 - if (fetch.isRedirect(res.statusCode)) { - // HTTP fetch step 5.2 - const location = headers.get('Location'); - - // HTTP fetch step 5.3 - let locationURL = null; - try { - locationURL = location === null ? null : new URL$1(location, request.url).toString(); - } catch (err) { - // error here can only be invalid URL in Location: header - // do not throw when options.redirect == manual - // let the user extract the errorneous redirect URL - if (request.redirect !== 'manual') { - reject(new FetchError(`uri requested responds with an invalid redirect URL: ${location}`, 'invalid-redirect')); - finalize(); - return; - } - } - - // HTTP fetch step 5.5 - switch (request.redirect) { - case 'error': - reject(new FetchError(`uri requested responds with a redirect, redirect mode is set to error: ${request.url}`, 'no-redirect')); - finalize(); - return; - case 'manual': - // node-fetch-specific step: make manual redirect a bit easier to use by setting the Location header value to the resolved URL. - if (locationURL !== null) { - // handle corrupted header - try { - headers.set('Location', locationURL); - } catch (err) { - // istanbul ignore next: nodejs server prevent invalid response headers, we can't test this through normal request - reject(err); - } - } - break; - case 'follow': - // HTTP-redirect fetch step 2 - if (locationURL === null) { - break; - } - - // HTTP-redirect fetch step 5 - if (request.counter >= request.follow) { - reject(new FetchError(`maximum redirect reached at: ${request.url}`, 'max-redirect')); - finalize(); - return; - } - - // HTTP-redirect fetch step 6 (counter increment) - // Create a new Request object. - const requestOpts = { - headers: new Headers(request.headers), - follow: request.follow, - counter: request.counter + 1, - agent: request.agent, - compress: request.compress, - method: request.method, - body: request.body, - signal: request.signal, - timeout: request.timeout, - size: request.size - }; - - if (!isDomainOrSubdomain(request.url, locationURL)) { - for (const name of ['authorization', 'www-authenticate', 'cookie', 'cookie2']) { - requestOpts.headers.delete(name); - } - } - - // HTTP-redirect fetch step 9 - if (res.statusCode !== 303 && request.body && getTotalBytes(request) === null) { - reject(new FetchError('Cannot follow redirect with body being a readable stream', 'unsupported-redirect')); - finalize(); - return; - } - - // HTTP-redirect fetch step 11 - if (res.statusCode === 303 || (res.statusCode === 301 || res.statusCode === 302) && request.method === 'POST') { - requestOpts.method = 'GET'; - requestOpts.body = undefined; - requestOpts.headers.delete('content-length'); - } - - // HTTP-redirect fetch step 15 - resolve(fetch(new Request(locationURL, requestOpts))); - finalize(); - return; - } - } - - // prepare response - res.once('end', function () { - if (signal) signal.removeEventListener('abort', abortAndFinalize); - }); - let body = res.pipe(new PassThrough$1()); - - const response_options = { - url: request.url, - status: res.statusCode, - statusText: res.statusMessage, - headers: headers, - size: request.size, - timeout: request.timeout, - counter: request.counter - }; - - // HTTP-network fetch step 12.1.1.3 - const codings = headers.get('Content-Encoding'); - - // HTTP-network fetch step 12.1.1.4: handle content codings - - // in following scenarios we ignore compression support - // 1. compression support is disabled - // 2. HEAD request - // 3. no Content-Encoding header - // 4. no content response (204) - // 5. content not modified response (304) - if (!request.compress || request.method === 'HEAD' || codings === null || res.statusCode === 204 || res.statusCode === 304) { - response = new Response(body, response_options); - resolve(response); - return; - } - - // For Node v6+ - // Be less strict when decoding compressed responses, since sometimes - // servers send slightly invalid responses that are still accepted - // by common browsers. - // Always using Z_SYNC_FLUSH is what cURL does. - const zlibOptions = { - flush: zlib.Z_SYNC_FLUSH, - finishFlush: zlib.Z_SYNC_FLUSH - }; - - // for gzip - if (codings == 'gzip' || codings == 'x-gzip') { - body = body.pipe(zlib.createGunzip(zlibOptions)); - response = new Response(body, response_options); - resolve(response); - return; - } - - // for deflate - if (codings == 'deflate' || codings == 'x-deflate') { - // handle the infamous raw deflate response from old servers - // a hack for old IIS and Apache servers - const raw = res.pipe(new PassThrough$1()); - raw.once('data', function (chunk) { - // see http://stackoverflow.com/questions/37519828 - if ((chunk[0] & 0x0F) === 0x08) { - body = body.pipe(zlib.createInflate()); - } else { - body = body.pipe(zlib.createInflateRaw()); - } - response = new Response(body, response_options); - resolve(response); - }); - return; - } - - // for br - if (codings == 'br' && typeof zlib.createBrotliDecompress === 'function') { - body = body.pipe(zlib.createBrotliDecompress()); - response = new Response(body, response_options); - resolve(response); - return; - } - - // otherwise, use response as-is - response = new Response(body, response_options); - resolve(response); - }); - - writeToStream(req, request); - }); -} -/** - * Redirect code matching - * - * @param Number code Status code - * @return Boolean - */ -fetch.isRedirect = function (code) { - return code === 301 || code === 302 || code === 303 || code === 307 || code === 308; -}; - -// expose Promise -fetch.Promise = global.Promise; - -export default fetch; -export { Headers, Request, Response, FetchError }; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/node-fetch/lib/index.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/node-fetch/lib/index.js deleted file mode 100644 index e5b04f10..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/node-fetch/lib/index.js +++ /dev/null @@ -1,1697 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, '__esModule', { value: true }); - -function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } - -var Stream = _interopDefault(require('stream')); -var http = _interopDefault(require('http')); -var Url = _interopDefault(require('url')); -var whatwgUrl = _interopDefault(require('whatwg-url')); -var https = _interopDefault(require('https')); -var zlib = _interopDefault(require('zlib')); - -// Based on https://github.com/tmpvar/jsdom/blob/aa85b2abf07766ff7bf5c1f6daafb3726f2f2db5/lib/jsdom/living/blob.js - -// fix for "Readable" isn't a named export issue -const Readable = Stream.Readable; - -const BUFFER = Symbol('buffer'); -const TYPE = Symbol('type'); - -class Blob { - constructor() { - this[TYPE] = ''; - - const blobParts = arguments[0]; - const options = arguments[1]; - - const buffers = []; - let size = 0; - - if (blobParts) { - const a = blobParts; - const length = Number(a.length); - for (let i = 0; i < length; i++) { - const element = a[i]; - let buffer; - if (element instanceof Buffer) { - buffer = element; - } else if (ArrayBuffer.isView(element)) { - buffer = Buffer.from(element.buffer, element.byteOffset, element.byteLength); - } else if (element instanceof ArrayBuffer) { - buffer = Buffer.from(element); - } else if (element instanceof Blob) { - buffer = element[BUFFER]; - } else { - buffer = Buffer.from(typeof element === 'string' ? element : String(element)); - } - size += buffer.length; - buffers.push(buffer); - } - } - - this[BUFFER] = Buffer.concat(buffers); - - let type = options && options.type !== undefined && String(options.type).toLowerCase(); - if (type && !/[^\u0020-\u007E]/.test(type)) { - this[TYPE] = type; - } - } - get size() { - return this[BUFFER].length; - } - get type() { - return this[TYPE]; - } - text() { - return Promise.resolve(this[BUFFER].toString()); - } - arrayBuffer() { - const buf = this[BUFFER]; - const ab = buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength); - return Promise.resolve(ab); - } - stream() { - const readable = new Readable(); - readable._read = function () {}; - readable.push(this[BUFFER]); - readable.push(null); - return readable; - } - toString() { - return '[object Blob]'; - } - slice() { - const size = this.size; - - const start = arguments[0]; - const end = arguments[1]; - let relativeStart, relativeEnd; - if (start === undefined) { - relativeStart = 0; - } else if (start < 0) { - relativeStart = Math.max(size + start, 0); - } else { - relativeStart = Math.min(start, size); - } - if (end === undefined) { - relativeEnd = size; - } else if (end < 0) { - relativeEnd = Math.max(size + end, 0); - } else { - relativeEnd = Math.min(end, size); - } - const span = Math.max(relativeEnd - relativeStart, 0); - - const buffer = this[BUFFER]; - const slicedBuffer = buffer.slice(relativeStart, relativeStart + span); - const blob = new Blob([], { type: arguments[2] }); - blob[BUFFER] = slicedBuffer; - return blob; - } -} - -Object.defineProperties(Blob.prototype, { - size: { enumerable: true }, - type: { enumerable: true }, - slice: { enumerable: true } -}); - -Object.defineProperty(Blob.prototype, Symbol.toStringTag, { - value: 'Blob', - writable: false, - enumerable: false, - configurable: true -}); - -/** - * fetch-error.js - * - * FetchError interface for operational errors - */ - -/** - * Create FetchError instance - * - * @param String message Error message for human - * @param String type Error type for machine - * @param String systemError For Node.js system error - * @return FetchError - */ -function FetchError(message, type, systemError) { - Error.call(this, message); - - this.message = message; - this.type = type; - - // when err.type is `system`, err.code contains system error code - if (systemError) { - this.code = this.errno = systemError.code; - } - - // hide custom error implementation details from end-users - Error.captureStackTrace(this, this.constructor); -} - -FetchError.prototype = Object.create(Error.prototype); -FetchError.prototype.constructor = FetchError; -FetchError.prototype.name = 'FetchError'; - -let convert; -try { - convert = require('encoding').convert; -} catch (e) {} - -const INTERNALS = Symbol('Body internals'); - -// fix an issue where "PassThrough" isn't a named export for node <10 -const PassThrough = Stream.PassThrough; - -/** - * Body mixin - * - * Ref: https://fetch.spec.whatwg.org/#body - * - * @param Stream body Readable stream - * @param Object opts Response options - * @return Void - */ -function Body(body) { - var _this = this; - - var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, - _ref$size = _ref.size; - - let size = _ref$size === undefined ? 0 : _ref$size; - var _ref$timeout = _ref.timeout; - let timeout = _ref$timeout === undefined ? 0 : _ref$timeout; - - if (body == null) { - // body is undefined or null - body = null; - } else if (isURLSearchParams(body)) { - // body is a URLSearchParams - body = Buffer.from(body.toString()); - } else if (isBlob(body)) ; else if (Buffer.isBuffer(body)) ; else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') { - // body is ArrayBuffer - body = Buffer.from(body); - } else if (ArrayBuffer.isView(body)) { - // body is ArrayBufferView - body = Buffer.from(body.buffer, body.byteOffset, body.byteLength); - } else if (body instanceof Stream) ; else { - // none of the above - // coerce to string then buffer - body = Buffer.from(String(body)); - } - this[INTERNALS] = { - body, - disturbed: false, - error: null - }; - this.size = size; - this.timeout = timeout; - - if (body instanceof Stream) { - body.on('error', function (err) { - const error = err.name === 'AbortError' ? err : new FetchError(`Invalid response body while trying to fetch ${_this.url}: ${err.message}`, 'system', err); - _this[INTERNALS].error = error; - }); - } -} - -Body.prototype = { - get body() { - return this[INTERNALS].body; - }, - - get bodyUsed() { - return this[INTERNALS].disturbed; - }, - - /** - * Decode response as ArrayBuffer - * - * @return Promise - */ - arrayBuffer() { - return consumeBody.call(this).then(function (buf) { - return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength); - }); - }, - - /** - * Return raw response as Blob - * - * @return Promise - */ - blob() { - let ct = this.headers && this.headers.get('content-type') || ''; - return consumeBody.call(this).then(function (buf) { - return Object.assign( - // Prevent copying - new Blob([], { - type: ct.toLowerCase() - }), { - [BUFFER]: buf - }); - }); - }, - - /** - * Decode response as json - * - * @return Promise - */ - json() { - var _this2 = this; - - return consumeBody.call(this).then(function (buffer) { - try { - return JSON.parse(buffer.toString()); - } catch (err) { - return Body.Promise.reject(new FetchError(`invalid json response body at ${_this2.url} reason: ${err.message}`, 'invalid-json')); - } - }); - }, - - /** - * Decode response as text - * - * @return Promise - */ - text() { - return consumeBody.call(this).then(function (buffer) { - return buffer.toString(); - }); - }, - - /** - * Decode response as buffer (non-spec api) - * - * @return Promise - */ - buffer() { - return consumeBody.call(this); - }, - - /** - * Decode response as text, while automatically detecting the encoding and - * trying to decode to UTF-8 (non-spec api) - * - * @return Promise - */ - textConverted() { - var _this3 = this; - - return consumeBody.call(this).then(function (buffer) { - return convertBody(buffer, _this3.headers); - }); - } -}; - -// In browsers, all properties are enumerable. -Object.defineProperties(Body.prototype, { - body: { enumerable: true }, - bodyUsed: { enumerable: true }, - arrayBuffer: { enumerable: true }, - blob: { enumerable: true }, - json: { enumerable: true }, - text: { enumerable: true } -}); - -Body.mixIn = function (proto) { - for (const name of Object.getOwnPropertyNames(Body.prototype)) { - // istanbul ignore else: future proof - if (!(name in proto)) { - const desc = Object.getOwnPropertyDescriptor(Body.prototype, name); - Object.defineProperty(proto, name, desc); - } - } -}; - -/** - * Consume and convert an entire Body to a Buffer. - * - * Ref: https://fetch.spec.whatwg.org/#concept-body-consume-body - * - * @return Promise - */ -function consumeBody() { - var _this4 = this; - - if (this[INTERNALS].disturbed) { - return Body.Promise.reject(new TypeError(`body used already for: ${this.url}`)); - } - - this[INTERNALS].disturbed = true; - - if (this[INTERNALS].error) { - return Body.Promise.reject(this[INTERNALS].error); - } - - let body = this.body; - - // body is null - if (body === null) { - return Body.Promise.resolve(Buffer.alloc(0)); - } - - // body is blob - if (isBlob(body)) { - body = body.stream(); - } - - // body is buffer - if (Buffer.isBuffer(body)) { - return Body.Promise.resolve(body); - } - - // istanbul ignore if: should never happen - if (!(body instanceof Stream)) { - return Body.Promise.resolve(Buffer.alloc(0)); - } - - // body is stream - // get ready to actually consume the body - let accum = []; - let accumBytes = 0; - let abort = false; - - return new Body.Promise(function (resolve, reject) { - let resTimeout; - - // allow timeout on slow response body - if (_this4.timeout) { - resTimeout = setTimeout(function () { - abort = true; - reject(new FetchError(`Response timeout while trying to fetch ${_this4.url} (over ${_this4.timeout}ms)`, 'body-timeout')); - }, _this4.timeout); - } - - // handle stream errors - body.on('error', function (err) { - if (err.name === 'AbortError') { - // if the request was aborted, reject with this Error - abort = true; - reject(err); - } else { - // other errors, such as incorrect content-encoding - reject(new FetchError(`Invalid response body while trying to fetch ${_this4.url}: ${err.message}`, 'system', err)); - } - }); - - body.on('data', function (chunk) { - if (abort || chunk === null) { - return; - } - - if (_this4.size && accumBytes + chunk.length > _this4.size) { - abort = true; - reject(new FetchError(`content size at ${_this4.url} over limit: ${_this4.size}`, 'max-size')); - return; - } - - accumBytes += chunk.length; - accum.push(chunk); - }); - - body.on('end', function () { - if (abort) { - return; - } - - clearTimeout(resTimeout); - - try { - resolve(Buffer.concat(accum, accumBytes)); - } catch (err) { - // handle streams that have accumulated too much data (issue #414) - reject(new FetchError(`Could not create Buffer from response body for ${_this4.url}: ${err.message}`, 'system', err)); - } - }); - }); -} - -/** - * Detect buffer encoding and convert to target encoding - * ref: http://www.w3.org/TR/2011/WD-html5-20110113/parsing.html#determining-the-character-encoding - * - * @param Buffer buffer Incoming buffer - * @param String encoding Target encoding - * @return String - */ -function convertBody(buffer, headers) { - if (typeof convert !== 'function') { - throw new Error('The package `encoding` must be installed to use the textConverted() function'); - } - - const ct = headers.get('content-type'); - let charset = 'utf-8'; - let res, str; - - // header - if (ct) { - res = /charset=([^;]*)/i.exec(ct); - } - - // no charset in content type, peek at response body for at most 1024 bytes - str = buffer.slice(0, 1024).toString(); - - // html5 - if (!res && str) { - res = / 0 && arguments[0] !== undefined ? arguments[0] : undefined; - - this[MAP] = Object.create(null); - - if (init instanceof Headers) { - const rawHeaders = init.raw(); - const headerNames = Object.keys(rawHeaders); - - for (const headerName of headerNames) { - for (const value of rawHeaders[headerName]) { - this.append(headerName, value); - } - } - - return; - } - - // We don't worry about converting prop to ByteString here as append() - // will handle it. - if (init == null) ; else if (typeof init === 'object') { - const method = init[Symbol.iterator]; - if (method != null) { - if (typeof method !== 'function') { - throw new TypeError('Header pairs must be iterable'); - } - - // sequence> - // Note: per spec we have to first exhaust the lists then process them - const pairs = []; - for (const pair of init) { - if (typeof pair !== 'object' || typeof pair[Symbol.iterator] !== 'function') { - throw new TypeError('Each header pair must be iterable'); - } - pairs.push(Array.from(pair)); - } - - for (const pair of pairs) { - if (pair.length !== 2) { - throw new TypeError('Each header pair must be a name/value tuple'); - } - this.append(pair[0], pair[1]); - } - } else { - // record - for (const key of Object.keys(init)) { - const value = init[key]; - this.append(key, value); - } - } - } else { - throw new TypeError('Provided initializer must be an object'); - } - } - - /** - * Return combined header value given name - * - * @param String name Header name - * @return Mixed - */ - get(name) { - name = `${name}`; - validateName(name); - const key = find(this[MAP], name); - if (key === undefined) { - return null; - } - - return this[MAP][key].join(', '); - } - - /** - * Iterate over all headers - * - * @param Function callback Executed for each item with parameters (value, name, thisArg) - * @param Boolean thisArg `this` context for callback function - * @return Void - */ - forEach(callback) { - let thisArg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined; - - let pairs = getHeaders(this); - let i = 0; - while (i < pairs.length) { - var _pairs$i = pairs[i]; - const name = _pairs$i[0], - value = _pairs$i[1]; - - callback.call(thisArg, value, name, this); - pairs = getHeaders(this); - i++; - } - } - - /** - * Overwrite header values given name - * - * @param String name Header name - * @param String value Header value - * @return Void - */ - set(name, value) { - name = `${name}`; - value = `${value}`; - validateName(name); - validateValue(value); - const key = find(this[MAP], name); - this[MAP][key !== undefined ? key : name] = [value]; - } - - /** - * Append a value onto existing header - * - * @param String name Header name - * @param String value Header value - * @return Void - */ - append(name, value) { - name = `${name}`; - value = `${value}`; - validateName(name); - validateValue(value); - const key = find(this[MAP], name); - if (key !== undefined) { - this[MAP][key].push(value); - } else { - this[MAP][name] = [value]; - } - } - - /** - * Check for header name existence - * - * @param String name Header name - * @return Boolean - */ - has(name) { - name = `${name}`; - validateName(name); - return find(this[MAP], name) !== undefined; - } - - /** - * Delete all header values given name - * - * @param String name Header name - * @return Void - */ - delete(name) { - name = `${name}`; - validateName(name); - const key = find(this[MAP], name); - if (key !== undefined) { - delete this[MAP][key]; - } - } - - /** - * Return raw headers (non-spec api) - * - * @return Object - */ - raw() { - return this[MAP]; - } - - /** - * Get an iterator on keys. - * - * @return Iterator - */ - keys() { - return createHeadersIterator(this, 'key'); - } - - /** - * Get an iterator on values. - * - * @return Iterator - */ - values() { - return createHeadersIterator(this, 'value'); - } - - /** - * Get an iterator on entries. - * - * This is the default iterator of the Headers object. - * - * @return Iterator - */ - [Symbol.iterator]() { - return createHeadersIterator(this, 'key+value'); - } -} -Headers.prototype.entries = Headers.prototype[Symbol.iterator]; - -Object.defineProperty(Headers.prototype, Symbol.toStringTag, { - value: 'Headers', - writable: false, - enumerable: false, - configurable: true -}); - -Object.defineProperties(Headers.prototype, { - get: { enumerable: true }, - forEach: { enumerable: true }, - set: { enumerable: true }, - append: { enumerable: true }, - has: { enumerable: true }, - delete: { enumerable: true }, - keys: { enumerable: true }, - values: { enumerable: true }, - entries: { enumerable: true } -}); - -function getHeaders(headers) { - let kind = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'key+value'; - - const keys = Object.keys(headers[MAP]).sort(); - return keys.map(kind === 'key' ? function (k) { - return k.toLowerCase(); - } : kind === 'value' ? function (k) { - return headers[MAP][k].join(', '); - } : function (k) { - return [k.toLowerCase(), headers[MAP][k].join(', ')]; - }); -} - -const INTERNAL = Symbol('internal'); - -function createHeadersIterator(target, kind) { - const iterator = Object.create(HeadersIteratorPrototype); - iterator[INTERNAL] = { - target, - kind, - index: 0 - }; - return iterator; -} - -const HeadersIteratorPrototype = Object.setPrototypeOf({ - next() { - // istanbul ignore if - if (!this || Object.getPrototypeOf(this) !== HeadersIteratorPrototype) { - throw new TypeError('Value of `this` is not a HeadersIterator'); - } - - var _INTERNAL = this[INTERNAL]; - const target = _INTERNAL.target, - kind = _INTERNAL.kind, - index = _INTERNAL.index; - - const values = getHeaders(target, kind); - const len = values.length; - if (index >= len) { - return { - value: undefined, - done: true - }; - } - - this[INTERNAL].index = index + 1; - - return { - value: values[index], - done: false - }; - } -}, Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]()))); - -Object.defineProperty(HeadersIteratorPrototype, Symbol.toStringTag, { - value: 'HeadersIterator', - writable: false, - enumerable: false, - configurable: true -}); - -/** - * Export the Headers object in a form that Node.js can consume. - * - * @param Headers headers - * @return Object - */ -function exportNodeCompatibleHeaders(headers) { - const obj = Object.assign({ __proto__: null }, headers[MAP]); - - // http.request() only supports string as Host header. This hack makes - // specifying custom Host header possible. - const hostHeaderKey = find(headers[MAP], 'Host'); - if (hostHeaderKey !== undefined) { - obj[hostHeaderKey] = obj[hostHeaderKey][0]; - } - - return obj; -} - -/** - * Create a Headers object from an object of headers, ignoring those that do - * not conform to HTTP grammar productions. - * - * @param Object obj Object of headers - * @return Headers - */ -function createHeadersLenient(obj) { - const headers = new Headers(); - for (const name of Object.keys(obj)) { - if (invalidTokenRegex.test(name)) { - continue; - } - if (Array.isArray(obj[name])) { - for (const val of obj[name]) { - if (invalidHeaderCharRegex.test(val)) { - continue; - } - if (headers[MAP][name] === undefined) { - headers[MAP][name] = [val]; - } else { - headers[MAP][name].push(val); - } - } - } else if (!invalidHeaderCharRegex.test(obj[name])) { - headers[MAP][name] = [obj[name]]; - } - } - return headers; -} - -const INTERNALS$1 = Symbol('Response internals'); - -// fix an issue where "STATUS_CODES" aren't a named export for node <10 -const STATUS_CODES = http.STATUS_CODES; - -/** - * Response class - * - * @param Stream body Readable stream - * @param Object opts Response options - * @return Void - */ -class Response { - constructor() { - let body = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null; - let opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - - Body.call(this, body, opts); - - const status = opts.status || 200; - const headers = new Headers(opts.headers); - - if (body != null && !headers.has('Content-Type')) { - const contentType = extractContentType(body); - if (contentType) { - headers.append('Content-Type', contentType); - } - } - - this[INTERNALS$1] = { - url: opts.url, - status, - statusText: opts.statusText || STATUS_CODES[status], - headers, - counter: opts.counter - }; - } - - get url() { - return this[INTERNALS$1].url || ''; - } - - get status() { - return this[INTERNALS$1].status; - } - - /** - * Convenience property representing if the request ended normally - */ - get ok() { - return this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300; - } - - get redirected() { - return this[INTERNALS$1].counter > 0; - } - - get statusText() { - return this[INTERNALS$1].statusText; - } - - get headers() { - return this[INTERNALS$1].headers; - } - - /** - * Clone this response - * - * @return Response - */ - clone() { - return new Response(clone(this), { - url: this.url, - status: this.status, - statusText: this.statusText, - headers: this.headers, - ok: this.ok, - redirected: this.redirected - }); - } -} - -Body.mixIn(Response.prototype); - -Object.defineProperties(Response.prototype, { - url: { enumerable: true }, - status: { enumerable: true }, - ok: { enumerable: true }, - redirected: { enumerable: true }, - statusText: { enumerable: true }, - headers: { enumerable: true }, - clone: { enumerable: true } -}); - -Object.defineProperty(Response.prototype, Symbol.toStringTag, { - value: 'Response', - writable: false, - enumerable: false, - configurable: true -}); - -const INTERNALS$2 = Symbol('Request internals'); -const URL = Url.URL || whatwgUrl.URL; - -// fix an issue where "format", "parse" aren't a named export for node <10 -const parse_url = Url.parse; -const format_url = Url.format; - -/** - * Wrapper around `new URL` to handle arbitrary URLs - * - * @param {string} urlStr - * @return {void} - */ -function parseURL(urlStr) { - /* - Check whether the URL is absolute or not - Scheme: https://tools.ietf.org/html/rfc3986#section-3.1 - Absolute URL: https://tools.ietf.org/html/rfc3986#section-4.3 - */ - if (/^[a-zA-Z][a-zA-Z\d+\-.]*:/.exec(urlStr)) { - urlStr = new URL(urlStr).toString(); - } - - // Fallback to old implementation for arbitrary URLs - return parse_url(urlStr); -} - -const streamDestructionSupported = 'destroy' in Stream.Readable.prototype; - -/** - * Check if a value is an instance of Request. - * - * @param Mixed input - * @return Boolean - */ -function isRequest(input) { - return typeof input === 'object' && typeof input[INTERNALS$2] === 'object'; -} - -function isAbortSignal(signal) { - const proto = signal && typeof signal === 'object' && Object.getPrototypeOf(signal); - return !!(proto && proto.constructor.name === 'AbortSignal'); -} - -/** - * Request class - * - * @param Mixed input Url or Request instance - * @param Object init Custom options - * @return Void - */ -class Request { - constructor(input) { - let init = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - - let parsedURL; - - // normalize input - if (!isRequest(input)) { - if (input && input.href) { - // in order to support Node.js' Url objects; though WHATWG's URL objects - // will fall into this branch also (since their `toString()` will return - // `href` property anyway) - parsedURL = parseURL(input.href); - } else { - // coerce input to a string before attempting to parse - parsedURL = parseURL(`${input}`); - } - input = {}; - } else { - parsedURL = parseURL(input.url); - } - - let method = init.method || input.method || 'GET'; - method = method.toUpperCase(); - - if ((init.body != null || isRequest(input) && input.body !== null) && (method === 'GET' || method === 'HEAD')) { - throw new TypeError('Request with GET/HEAD method cannot have body'); - } - - let inputBody = init.body != null ? init.body : isRequest(input) && input.body !== null ? clone(input) : null; - - Body.call(this, inputBody, { - timeout: init.timeout || input.timeout || 0, - size: init.size || input.size || 0 - }); - - const headers = new Headers(init.headers || input.headers || {}); - - if (inputBody != null && !headers.has('Content-Type')) { - const contentType = extractContentType(inputBody); - if (contentType) { - headers.append('Content-Type', contentType); - } - } - - let signal = isRequest(input) ? input.signal : null; - if ('signal' in init) signal = init.signal; - - if (signal != null && !isAbortSignal(signal)) { - throw new TypeError('Expected signal to be an instanceof AbortSignal'); - } - - this[INTERNALS$2] = { - method, - redirect: init.redirect || input.redirect || 'follow', - headers, - parsedURL, - signal - }; - - // node-fetch-only options - this.follow = init.follow !== undefined ? init.follow : input.follow !== undefined ? input.follow : 20; - this.compress = init.compress !== undefined ? init.compress : input.compress !== undefined ? input.compress : true; - this.counter = init.counter || input.counter || 0; - this.agent = init.agent || input.agent; - } - - get method() { - return this[INTERNALS$2].method; - } - - get url() { - return format_url(this[INTERNALS$2].parsedURL); - } - - get headers() { - return this[INTERNALS$2].headers; - } - - get redirect() { - return this[INTERNALS$2].redirect; - } - - get signal() { - return this[INTERNALS$2].signal; - } - - /** - * Clone this request - * - * @return Request - */ - clone() { - return new Request(this); - } -} - -Body.mixIn(Request.prototype); - -Object.defineProperty(Request.prototype, Symbol.toStringTag, { - value: 'Request', - writable: false, - enumerable: false, - configurable: true -}); - -Object.defineProperties(Request.prototype, { - method: { enumerable: true }, - url: { enumerable: true }, - headers: { enumerable: true }, - redirect: { enumerable: true }, - clone: { enumerable: true }, - signal: { enumerable: true } -}); - -/** - * Convert a Request to Node.js http request options. - * - * @param Request A Request instance - * @return Object The options object to be passed to http.request - */ -function getNodeRequestOptions(request) { - const parsedURL = request[INTERNALS$2].parsedURL; - const headers = new Headers(request[INTERNALS$2].headers); - - // fetch step 1.3 - if (!headers.has('Accept')) { - headers.set('Accept', '*/*'); - } - - // Basic fetch - if (!parsedURL.protocol || !parsedURL.hostname) { - throw new TypeError('Only absolute URLs are supported'); - } - - if (!/^https?:$/.test(parsedURL.protocol)) { - throw new TypeError('Only HTTP(S) protocols are supported'); - } - - if (request.signal && request.body instanceof Stream.Readable && !streamDestructionSupported) { - throw new Error('Cancellation of streamed requests with AbortSignal is not supported in node < 8'); - } - - // HTTP-network-or-cache fetch steps 2.4-2.7 - let contentLengthValue = null; - if (request.body == null && /^(POST|PUT)$/i.test(request.method)) { - contentLengthValue = '0'; - } - if (request.body != null) { - const totalBytes = getTotalBytes(request); - if (typeof totalBytes === 'number') { - contentLengthValue = String(totalBytes); - } - } - if (contentLengthValue) { - headers.set('Content-Length', contentLengthValue); - } - - // HTTP-network-or-cache fetch step 2.11 - if (!headers.has('User-Agent')) { - headers.set('User-Agent', 'node-fetch/1.0 (+https://github.com/bitinn/node-fetch)'); - } - - // HTTP-network-or-cache fetch step 2.15 - if (request.compress && !headers.has('Accept-Encoding')) { - headers.set('Accept-Encoding', 'gzip,deflate'); - } - - let agent = request.agent; - if (typeof agent === 'function') { - agent = agent(parsedURL); - } - - if (!headers.has('Connection') && !agent) { - headers.set('Connection', 'close'); - } - - // HTTP-network fetch step 4.2 - // chunked encoding is handled by Node.js - - return Object.assign({}, parsedURL, { - method: request.method, - headers: exportNodeCompatibleHeaders(headers), - agent - }); -} - -/** - * abort-error.js - * - * AbortError interface for cancelled requests - */ - -/** - * Create AbortError instance - * - * @param String message Error message for human - * @return AbortError - */ -function AbortError(message) { - Error.call(this, message); - - this.type = 'aborted'; - this.message = message; - - // hide custom error implementation details from end-users - Error.captureStackTrace(this, this.constructor); -} - -AbortError.prototype = Object.create(Error.prototype); -AbortError.prototype.constructor = AbortError; -AbortError.prototype.name = 'AbortError'; - -const URL$1 = Url.URL || whatwgUrl.URL; - -// fix an issue where "PassThrough", "resolve" aren't a named export for node <10 -const PassThrough$1 = Stream.PassThrough; - -const isDomainOrSubdomain = function isDomainOrSubdomain(destination, original) { - const orig = new URL$1(original).hostname; - const dest = new URL$1(destination).hostname; - - return orig === dest || orig[orig.length - dest.length - 1] === '.' && orig.endsWith(dest); -}; - -/** - * Fetch function - * - * @param Mixed url Absolute url or Request instance - * @param Object opts Fetch options - * @return Promise - */ -function fetch(url, opts) { - - // allow custom promise - if (!fetch.Promise) { - throw new Error('native promise missing, set fetch.Promise to your favorite alternative'); - } - - Body.Promise = fetch.Promise; - - // wrap http.request into fetch - return new fetch.Promise(function (resolve, reject) { - // build request object - const request = new Request(url, opts); - const options = getNodeRequestOptions(request); - - const send = (options.protocol === 'https:' ? https : http).request; - const signal = request.signal; - - let response = null; - - const abort = function abort() { - let error = new AbortError('The user aborted a request.'); - reject(error); - if (request.body && request.body instanceof Stream.Readable) { - request.body.destroy(error); - } - if (!response || !response.body) return; - response.body.emit('error', error); - }; - - if (signal && signal.aborted) { - abort(); - return; - } - - const abortAndFinalize = function abortAndFinalize() { - abort(); - finalize(); - }; - - // send request - const req = send(options); - let reqTimeout; - - if (signal) { - signal.addEventListener('abort', abortAndFinalize); - } - - function finalize() { - req.abort(); - if (signal) signal.removeEventListener('abort', abortAndFinalize); - clearTimeout(reqTimeout); - } - - if (request.timeout) { - req.once('socket', function (socket) { - reqTimeout = setTimeout(function () { - reject(new FetchError(`network timeout at: ${request.url}`, 'request-timeout')); - finalize(); - }, request.timeout); - }); - } - - req.on('error', function (err) { - reject(new FetchError(`request to ${request.url} failed, reason: ${err.message}`, 'system', err)); - finalize(); - }); - - req.on('response', function (res) { - clearTimeout(reqTimeout); - - const headers = createHeadersLenient(res.headers); - - // HTTP fetch step 5 - if (fetch.isRedirect(res.statusCode)) { - // HTTP fetch step 5.2 - const location = headers.get('Location'); - - // HTTP fetch step 5.3 - let locationURL = null; - try { - locationURL = location === null ? null : new URL$1(location, request.url).toString(); - } catch (err) { - // error here can only be invalid URL in Location: header - // do not throw when options.redirect == manual - // let the user extract the errorneous redirect URL - if (request.redirect !== 'manual') { - reject(new FetchError(`uri requested responds with an invalid redirect URL: ${location}`, 'invalid-redirect')); - finalize(); - return; - } - } - - // HTTP fetch step 5.5 - switch (request.redirect) { - case 'error': - reject(new FetchError(`uri requested responds with a redirect, redirect mode is set to error: ${request.url}`, 'no-redirect')); - finalize(); - return; - case 'manual': - // node-fetch-specific step: make manual redirect a bit easier to use by setting the Location header value to the resolved URL. - if (locationURL !== null) { - // handle corrupted header - try { - headers.set('Location', locationURL); - } catch (err) { - // istanbul ignore next: nodejs server prevent invalid response headers, we can't test this through normal request - reject(err); - } - } - break; - case 'follow': - // HTTP-redirect fetch step 2 - if (locationURL === null) { - break; - } - - // HTTP-redirect fetch step 5 - if (request.counter >= request.follow) { - reject(new FetchError(`maximum redirect reached at: ${request.url}`, 'max-redirect')); - finalize(); - return; - } - - // HTTP-redirect fetch step 6 (counter increment) - // Create a new Request object. - const requestOpts = { - headers: new Headers(request.headers), - follow: request.follow, - counter: request.counter + 1, - agent: request.agent, - compress: request.compress, - method: request.method, - body: request.body, - signal: request.signal, - timeout: request.timeout, - size: request.size - }; - - if (!isDomainOrSubdomain(request.url, locationURL)) { - for (const name of ['authorization', 'www-authenticate', 'cookie', 'cookie2']) { - requestOpts.headers.delete(name); - } - } - - // HTTP-redirect fetch step 9 - if (res.statusCode !== 303 && request.body && getTotalBytes(request) === null) { - reject(new FetchError('Cannot follow redirect with body being a readable stream', 'unsupported-redirect')); - finalize(); - return; - } - - // HTTP-redirect fetch step 11 - if (res.statusCode === 303 || (res.statusCode === 301 || res.statusCode === 302) && request.method === 'POST') { - requestOpts.method = 'GET'; - requestOpts.body = undefined; - requestOpts.headers.delete('content-length'); - } - - // HTTP-redirect fetch step 15 - resolve(fetch(new Request(locationURL, requestOpts))); - finalize(); - return; - } - } - - // prepare response - res.once('end', function () { - if (signal) signal.removeEventListener('abort', abortAndFinalize); - }); - let body = res.pipe(new PassThrough$1()); - - const response_options = { - url: request.url, - status: res.statusCode, - statusText: res.statusMessage, - headers: headers, - size: request.size, - timeout: request.timeout, - counter: request.counter - }; - - // HTTP-network fetch step 12.1.1.3 - const codings = headers.get('Content-Encoding'); - - // HTTP-network fetch step 12.1.1.4: handle content codings - - // in following scenarios we ignore compression support - // 1. compression support is disabled - // 2. HEAD request - // 3. no Content-Encoding header - // 4. no content response (204) - // 5. content not modified response (304) - if (!request.compress || request.method === 'HEAD' || codings === null || res.statusCode === 204 || res.statusCode === 304) { - response = new Response(body, response_options); - resolve(response); - return; - } - - // For Node v6+ - // Be less strict when decoding compressed responses, since sometimes - // servers send slightly invalid responses that are still accepted - // by common browsers. - // Always using Z_SYNC_FLUSH is what cURL does. - const zlibOptions = { - flush: zlib.Z_SYNC_FLUSH, - finishFlush: zlib.Z_SYNC_FLUSH - }; - - // for gzip - if (codings == 'gzip' || codings == 'x-gzip') { - body = body.pipe(zlib.createGunzip(zlibOptions)); - response = new Response(body, response_options); - resolve(response); - return; - } - - // for deflate - if (codings == 'deflate' || codings == 'x-deflate') { - // handle the infamous raw deflate response from old servers - // a hack for old IIS and Apache servers - const raw = res.pipe(new PassThrough$1()); - raw.once('data', function (chunk) { - // see http://stackoverflow.com/questions/37519828 - if ((chunk[0] & 0x0F) === 0x08) { - body = body.pipe(zlib.createInflate()); - } else { - body = body.pipe(zlib.createInflateRaw()); - } - response = new Response(body, response_options); - resolve(response); - }); - return; - } - - // for br - if (codings == 'br' && typeof zlib.createBrotliDecompress === 'function') { - body = body.pipe(zlib.createBrotliDecompress()); - response = new Response(body, response_options); - resolve(response); - return; - } - - // otherwise, use response as-is - response = new Response(body, response_options); - resolve(response); - }); - - writeToStream(req, request); - }); -} -/** - * Redirect code matching - * - * @param Number code Status code - * @return Boolean - */ -fetch.isRedirect = function (code) { - return code === 301 || code === 302 || code === 303 || code === 307 || code === 308; -}; - -// expose Promise -fetch.Promise = global.Promise; - -module.exports = exports = fetch; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.default = exports; -exports.Headers = Headers; -exports.Request = Request; -exports.Response = Response; -exports.FetchError = FetchError; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/node-fetch/lib/index.mjs b/packages/wyatt_notification_bloc/example/scripts/node_modules/node-fetch/lib/index.mjs deleted file mode 100644 index 49ee05ec..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/node-fetch/lib/index.mjs +++ /dev/null @@ -1,1686 +0,0 @@ -import Stream from 'stream'; -import http from 'http'; -import Url from 'url'; -import whatwgUrl from 'whatwg-url'; -import https from 'https'; -import zlib from 'zlib'; - -// Based on https://github.com/tmpvar/jsdom/blob/aa85b2abf07766ff7bf5c1f6daafb3726f2f2db5/lib/jsdom/living/blob.js - -// fix for "Readable" isn't a named export issue -const Readable = Stream.Readable; - -const BUFFER = Symbol('buffer'); -const TYPE = Symbol('type'); - -class Blob { - constructor() { - this[TYPE] = ''; - - const blobParts = arguments[0]; - const options = arguments[1]; - - const buffers = []; - let size = 0; - - if (blobParts) { - const a = blobParts; - const length = Number(a.length); - for (let i = 0; i < length; i++) { - const element = a[i]; - let buffer; - if (element instanceof Buffer) { - buffer = element; - } else if (ArrayBuffer.isView(element)) { - buffer = Buffer.from(element.buffer, element.byteOffset, element.byteLength); - } else if (element instanceof ArrayBuffer) { - buffer = Buffer.from(element); - } else if (element instanceof Blob) { - buffer = element[BUFFER]; - } else { - buffer = Buffer.from(typeof element === 'string' ? element : String(element)); - } - size += buffer.length; - buffers.push(buffer); - } - } - - this[BUFFER] = Buffer.concat(buffers); - - let type = options && options.type !== undefined && String(options.type).toLowerCase(); - if (type && !/[^\u0020-\u007E]/.test(type)) { - this[TYPE] = type; - } - } - get size() { - return this[BUFFER].length; - } - get type() { - return this[TYPE]; - } - text() { - return Promise.resolve(this[BUFFER].toString()); - } - arrayBuffer() { - const buf = this[BUFFER]; - const ab = buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength); - return Promise.resolve(ab); - } - stream() { - const readable = new Readable(); - readable._read = function () {}; - readable.push(this[BUFFER]); - readable.push(null); - return readable; - } - toString() { - return '[object Blob]'; - } - slice() { - const size = this.size; - - const start = arguments[0]; - const end = arguments[1]; - let relativeStart, relativeEnd; - if (start === undefined) { - relativeStart = 0; - } else if (start < 0) { - relativeStart = Math.max(size + start, 0); - } else { - relativeStart = Math.min(start, size); - } - if (end === undefined) { - relativeEnd = size; - } else if (end < 0) { - relativeEnd = Math.max(size + end, 0); - } else { - relativeEnd = Math.min(end, size); - } - const span = Math.max(relativeEnd - relativeStart, 0); - - const buffer = this[BUFFER]; - const slicedBuffer = buffer.slice(relativeStart, relativeStart + span); - const blob = new Blob([], { type: arguments[2] }); - blob[BUFFER] = slicedBuffer; - return blob; - } -} - -Object.defineProperties(Blob.prototype, { - size: { enumerable: true }, - type: { enumerable: true }, - slice: { enumerable: true } -}); - -Object.defineProperty(Blob.prototype, Symbol.toStringTag, { - value: 'Blob', - writable: false, - enumerable: false, - configurable: true -}); - -/** - * fetch-error.js - * - * FetchError interface for operational errors - */ - -/** - * Create FetchError instance - * - * @param String message Error message for human - * @param String type Error type for machine - * @param String systemError For Node.js system error - * @return FetchError - */ -function FetchError(message, type, systemError) { - Error.call(this, message); - - this.message = message; - this.type = type; - - // when err.type is `system`, err.code contains system error code - if (systemError) { - this.code = this.errno = systemError.code; - } - - // hide custom error implementation details from end-users - Error.captureStackTrace(this, this.constructor); -} - -FetchError.prototype = Object.create(Error.prototype); -FetchError.prototype.constructor = FetchError; -FetchError.prototype.name = 'FetchError'; - -let convert; -try { - convert = require('encoding').convert; -} catch (e) {} - -const INTERNALS = Symbol('Body internals'); - -// fix an issue where "PassThrough" isn't a named export for node <10 -const PassThrough = Stream.PassThrough; - -/** - * Body mixin - * - * Ref: https://fetch.spec.whatwg.org/#body - * - * @param Stream body Readable stream - * @param Object opts Response options - * @return Void - */ -function Body(body) { - var _this = this; - - var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, - _ref$size = _ref.size; - - let size = _ref$size === undefined ? 0 : _ref$size; - var _ref$timeout = _ref.timeout; - let timeout = _ref$timeout === undefined ? 0 : _ref$timeout; - - if (body == null) { - // body is undefined or null - body = null; - } else if (isURLSearchParams(body)) { - // body is a URLSearchParams - body = Buffer.from(body.toString()); - } else if (isBlob(body)) ; else if (Buffer.isBuffer(body)) ; else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') { - // body is ArrayBuffer - body = Buffer.from(body); - } else if (ArrayBuffer.isView(body)) { - // body is ArrayBufferView - body = Buffer.from(body.buffer, body.byteOffset, body.byteLength); - } else if (body instanceof Stream) ; else { - // none of the above - // coerce to string then buffer - body = Buffer.from(String(body)); - } - this[INTERNALS] = { - body, - disturbed: false, - error: null - }; - this.size = size; - this.timeout = timeout; - - if (body instanceof Stream) { - body.on('error', function (err) { - const error = err.name === 'AbortError' ? err : new FetchError(`Invalid response body while trying to fetch ${_this.url}: ${err.message}`, 'system', err); - _this[INTERNALS].error = error; - }); - } -} - -Body.prototype = { - get body() { - return this[INTERNALS].body; - }, - - get bodyUsed() { - return this[INTERNALS].disturbed; - }, - - /** - * Decode response as ArrayBuffer - * - * @return Promise - */ - arrayBuffer() { - return consumeBody.call(this).then(function (buf) { - return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength); - }); - }, - - /** - * Return raw response as Blob - * - * @return Promise - */ - blob() { - let ct = this.headers && this.headers.get('content-type') || ''; - return consumeBody.call(this).then(function (buf) { - return Object.assign( - // Prevent copying - new Blob([], { - type: ct.toLowerCase() - }), { - [BUFFER]: buf - }); - }); - }, - - /** - * Decode response as json - * - * @return Promise - */ - json() { - var _this2 = this; - - return consumeBody.call(this).then(function (buffer) { - try { - return JSON.parse(buffer.toString()); - } catch (err) { - return Body.Promise.reject(new FetchError(`invalid json response body at ${_this2.url} reason: ${err.message}`, 'invalid-json')); - } - }); - }, - - /** - * Decode response as text - * - * @return Promise - */ - text() { - return consumeBody.call(this).then(function (buffer) { - return buffer.toString(); - }); - }, - - /** - * Decode response as buffer (non-spec api) - * - * @return Promise - */ - buffer() { - return consumeBody.call(this); - }, - - /** - * Decode response as text, while automatically detecting the encoding and - * trying to decode to UTF-8 (non-spec api) - * - * @return Promise - */ - textConverted() { - var _this3 = this; - - return consumeBody.call(this).then(function (buffer) { - return convertBody(buffer, _this3.headers); - }); - } -}; - -// In browsers, all properties are enumerable. -Object.defineProperties(Body.prototype, { - body: { enumerable: true }, - bodyUsed: { enumerable: true }, - arrayBuffer: { enumerable: true }, - blob: { enumerable: true }, - json: { enumerable: true }, - text: { enumerable: true } -}); - -Body.mixIn = function (proto) { - for (const name of Object.getOwnPropertyNames(Body.prototype)) { - // istanbul ignore else: future proof - if (!(name in proto)) { - const desc = Object.getOwnPropertyDescriptor(Body.prototype, name); - Object.defineProperty(proto, name, desc); - } - } -}; - -/** - * Consume and convert an entire Body to a Buffer. - * - * Ref: https://fetch.spec.whatwg.org/#concept-body-consume-body - * - * @return Promise - */ -function consumeBody() { - var _this4 = this; - - if (this[INTERNALS].disturbed) { - return Body.Promise.reject(new TypeError(`body used already for: ${this.url}`)); - } - - this[INTERNALS].disturbed = true; - - if (this[INTERNALS].error) { - return Body.Promise.reject(this[INTERNALS].error); - } - - let body = this.body; - - // body is null - if (body === null) { - return Body.Promise.resolve(Buffer.alloc(0)); - } - - // body is blob - if (isBlob(body)) { - body = body.stream(); - } - - // body is buffer - if (Buffer.isBuffer(body)) { - return Body.Promise.resolve(body); - } - - // istanbul ignore if: should never happen - if (!(body instanceof Stream)) { - return Body.Promise.resolve(Buffer.alloc(0)); - } - - // body is stream - // get ready to actually consume the body - let accum = []; - let accumBytes = 0; - let abort = false; - - return new Body.Promise(function (resolve, reject) { - let resTimeout; - - // allow timeout on slow response body - if (_this4.timeout) { - resTimeout = setTimeout(function () { - abort = true; - reject(new FetchError(`Response timeout while trying to fetch ${_this4.url} (over ${_this4.timeout}ms)`, 'body-timeout')); - }, _this4.timeout); - } - - // handle stream errors - body.on('error', function (err) { - if (err.name === 'AbortError') { - // if the request was aborted, reject with this Error - abort = true; - reject(err); - } else { - // other errors, such as incorrect content-encoding - reject(new FetchError(`Invalid response body while trying to fetch ${_this4.url}: ${err.message}`, 'system', err)); - } - }); - - body.on('data', function (chunk) { - if (abort || chunk === null) { - return; - } - - if (_this4.size && accumBytes + chunk.length > _this4.size) { - abort = true; - reject(new FetchError(`content size at ${_this4.url} over limit: ${_this4.size}`, 'max-size')); - return; - } - - accumBytes += chunk.length; - accum.push(chunk); - }); - - body.on('end', function () { - if (abort) { - return; - } - - clearTimeout(resTimeout); - - try { - resolve(Buffer.concat(accum, accumBytes)); - } catch (err) { - // handle streams that have accumulated too much data (issue #414) - reject(new FetchError(`Could not create Buffer from response body for ${_this4.url}: ${err.message}`, 'system', err)); - } - }); - }); -} - -/** - * Detect buffer encoding and convert to target encoding - * ref: http://www.w3.org/TR/2011/WD-html5-20110113/parsing.html#determining-the-character-encoding - * - * @param Buffer buffer Incoming buffer - * @param String encoding Target encoding - * @return String - */ -function convertBody(buffer, headers) { - if (typeof convert !== 'function') { - throw new Error('The package `encoding` must be installed to use the textConverted() function'); - } - - const ct = headers.get('content-type'); - let charset = 'utf-8'; - let res, str; - - // header - if (ct) { - res = /charset=([^;]*)/i.exec(ct); - } - - // no charset in content type, peek at response body for at most 1024 bytes - str = buffer.slice(0, 1024).toString(); - - // html5 - if (!res && str) { - res = / 0 && arguments[0] !== undefined ? arguments[0] : undefined; - - this[MAP] = Object.create(null); - - if (init instanceof Headers) { - const rawHeaders = init.raw(); - const headerNames = Object.keys(rawHeaders); - - for (const headerName of headerNames) { - for (const value of rawHeaders[headerName]) { - this.append(headerName, value); - } - } - - return; - } - - // We don't worry about converting prop to ByteString here as append() - // will handle it. - if (init == null) ; else if (typeof init === 'object') { - const method = init[Symbol.iterator]; - if (method != null) { - if (typeof method !== 'function') { - throw new TypeError('Header pairs must be iterable'); - } - - // sequence> - // Note: per spec we have to first exhaust the lists then process them - const pairs = []; - for (const pair of init) { - if (typeof pair !== 'object' || typeof pair[Symbol.iterator] !== 'function') { - throw new TypeError('Each header pair must be iterable'); - } - pairs.push(Array.from(pair)); - } - - for (const pair of pairs) { - if (pair.length !== 2) { - throw new TypeError('Each header pair must be a name/value tuple'); - } - this.append(pair[0], pair[1]); - } - } else { - // record - for (const key of Object.keys(init)) { - const value = init[key]; - this.append(key, value); - } - } - } else { - throw new TypeError('Provided initializer must be an object'); - } - } - - /** - * Return combined header value given name - * - * @param String name Header name - * @return Mixed - */ - get(name) { - name = `${name}`; - validateName(name); - const key = find(this[MAP], name); - if (key === undefined) { - return null; - } - - return this[MAP][key].join(', '); - } - - /** - * Iterate over all headers - * - * @param Function callback Executed for each item with parameters (value, name, thisArg) - * @param Boolean thisArg `this` context for callback function - * @return Void - */ - forEach(callback) { - let thisArg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined; - - let pairs = getHeaders(this); - let i = 0; - while (i < pairs.length) { - var _pairs$i = pairs[i]; - const name = _pairs$i[0], - value = _pairs$i[1]; - - callback.call(thisArg, value, name, this); - pairs = getHeaders(this); - i++; - } - } - - /** - * Overwrite header values given name - * - * @param String name Header name - * @param String value Header value - * @return Void - */ - set(name, value) { - name = `${name}`; - value = `${value}`; - validateName(name); - validateValue(value); - const key = find(this[MAP], name); - this[MAP][key !== undefined ? key : name] = [value]; - } - - /** - * Append a value onto existing header - * - * @param String name Header name - * @param String value Header value - * @return Void - */ - append(name, value) { - name = `${name}`; - value = `${value}`; - validateName(name); - validateValue(value); - const key = find(this[MAP], name); - if (key !== undefined) { - this[MAP][key].push(value); - } else { - this[MAP][name] = [value]; - } - } - - /** - * Check for header name existence - * - * @param String name Header name - * @return Boolean - */ - has(name) { - name = `${name}`; - validateName(name); - return find(this[MAP], name) !== undefined; - } - - /** - * Delete all header values given name - * - * @param String name Header name - * @return Void - */ - delete(name) { - name = `${name}`; - validateName(name); - const key = find(this[MAP], name); - if (key !== undefined) { - delete this[MAP][key]; - } - } - - /** - * Return raw headers (non-spec api) - * - * @return Object - */ - raw() { - return this[MAP]; - } - - /** - * Get an iterator on keys. - * - * @return Iterator - */ - keys() { - return createHeadersIterator(this, 'key'); - } - - /** - * Get an iterator on values. - * - * @return Iterator - */ - values() { - return createHeadersIterator(this, 'value'); - } - - /** - * Get an iterator on entries. - * - * This is the default iterator of the Headers object. - * - * @return Iterator - */ - [Symbol.iterator]() { - return createHeadersIterator(this, 'key+value'); - } -} -Headers.prototype.entries = Headers.prototype[Symbol.iterator]; - -Object.defineProperty(Headers.prototype, Symbol.toStringTag, { - value: 'Headers', - writable: false, - enumerable: false, - configurable: true -}); - -Object.defineProperties(Headers.prototype, { - get: { enumerable: true }, - forEach: { enumerable: true }, - set: { enumerable: true }, - append: { enumerable: true }, - has: { enumerable: true }, - delete: { enumerable: true }, - keys: { enumerable: true }, - values: { enumerable: true }, - entries: { enumerable: true } -}); - -function getHeaders(headers) { - let kind = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'key+value'; - - const keys = Object.keys(headers[MAP]).sort(); - return keys.map(kind === 'key' ? function (k) { - return k.toLowerCase(); - } : kind === 'value' ? function (k) { - return headers[MAP][k].join(', '); - } : function (k) { - return [k.toLowerCase(), headers[MAP][k].join(', ')]; - }); -} - -const INTERNAL = Symbol('internal'); - -function createHeadersIterator(target, kind) { - const iterator = Object.create(HeadersIteratorPrototype); - iterator[INTERNAL] = { - target, - kind, - index: 0 - }; - return iterator; -} - -const HeadersIteratorPrototype = Object.setPrototypeOf({ - next() { - // istanbul ignore if - if (!this || Object.getPrototypeOf(this) !== HeadersIteratorPrototype) { - throw new TypeError('Value of `this` is not a HeadersIterator'); - } - - var _INTERNAL = this[INTERNAL]; - const target = _INTERNAL.target, - kind = _INTERNAL.kind, - index = _INTERNAL.index; - - const values = getHeaders(target, kind); - const len = values.length; - if (index >= len) { - return { - value: undefined, - done: true - }; - } - - this[INTERNAL].index = index + 1; - - return { - value: values[index], - done: false - }; - } -}, Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]()))); - -Object.defineProperty(HeadersIteratorPrototype, Symbol.toStringTag, { - value: 'HeadersIterator', - writable: false, - enumerable: false, - configurable: true -}); - -/** - * Export the Headers object in a form that Node.js can consume. - * - * @param Headers headers - * @return Object - */ -function exportNodeCompatibleHeaders(headers) { - const obj = Object.assign({ __proto__: null }, headers[MAP]); - - // http.request() only supports string as Host header. This hack makes - // specifying custom Host header possible. - const hostHeaderKey = find(headers[MAP], 'Host'); - if (hostHeaderKey !== undefined) { - obj[hostHeaderKey] = obj[hostHeaderKey][0]; - } - - return obj; -} - -/** - * Create a Headers object from an object of headers, ignoring those that do - * not conform to HTTP grammar productions. - * - * @param Object obj Object of headers - * @return Headers - */ -function createHeadersLenient(obj) { - const headers = new Headers(); - for (const name of Object.keys(obj)) { - if (invalidTokenRegex.test(name)) { - continue; - } - if (Array.isArray(obj[name])) { - for (const val of obj[name]) { - if (invalidHeaderCharRegex.test(val)) { - continue; - } - if (headers[MAP][name] === undefined) { - headers[MAP][name] = [val]; - } else { - headers[MAP][name].push(val); - } - } - } else if (!invalidHeaderCharRegex.test(obj[name])) { - headers[MAP][name] = [obj[name]]; - } - } - return headers; -} - -const INTERNALS$1 = Symbol('Response internals'); - -// fix an issue where "STATUS_CODES" aren't a named export for node <10 -const STATUS_CODES = http.STATUS_CODES; - -/** - * Response class - * - * @param Stream body Readable stream - * @param Object opts Response options - * @return Void - */ -class Response { - constructor() { - let body = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null; - let opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - - Body.call(this, body, opts); - - const status = opts.status || 200; - const headers = new Headers(opts.headers); - - if (body != null && !headers.has('Content-Type')) { - const contentType = extractContentType(body); - if (contentType) { - headers.append('Content-Type', contentType); - } - } - - this[INTERNALS$1] = { - url: opts.url, - status, - statusText: opts.statusText || STATUS_CODES[status], - headers, - counter: opts.counter - }; - } - - get url() { - return this[INTERNALS$1].url || ''; - } - - get status() { - return this[INTERNALS$1].status; - } - - /** - * Convenience property representing if the request ended normally - */ - get ok() { - return this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300; - } - - get redirected() { - return this[INTERNALS$1].counter > 0; - } - - get statusText() { - return this[INTERNALS$1].statusText; - } - - get headers() { - return this[INTERNALS$1].headers; - } - - /** - * Clone this response - * - * @return Response - */ - clone() { - return new Response(clone(this), { - url: this.url, - status: this.status, - statusText: this.statusText, - headers: this.headers, - ok: this.ok, - redirected: this.redirected - }); - } -} - -Body.mixIn(Response.prototype); - -Object.defineProperties(Response.prototype, { - url: { enumerable: true }, - status: { enumerable: true }, - ok: { enumerable: true }, - redirected: { enumerable: true }, - statusText: { enumerable: true }, - headers: { enumerable: true }, - clone: { enumerable: true } -}); - -Object.defineProperty(Response.prototype, Symbol.toStringTag, { - value: 'Response', - writable: false, - enumerable: false, - configurable: true -}); - -const INTERNALS$2 = Symbol('Request internals'); -const URL = Url.URL || whatwgUrl.URL; - -// fix an issue where "format", "parse" aren't a named export for node <10 -const parse_url = Url.parse; -const format_url = Url.format; - -/** - * Wrapper around `new URL` to handle arbitrary URLs - * - * @param {string} urlStr - * @return {void} - */ -function parseURL(urlStr) { - /* - Check whether the URL is absolute or not - Scheme: https://tools.ietf.org/html/rfc3986#section-3.1 - Absolute URL: https://tools.ietf.org/html/rfc3986#section-4.3 - */ - if (/^[a-zA-Z][a-zA-Z\d+\-.]*:/.exec(urlStr)) { - urlStr = new URL(urlStr).toString(); - } - - // Fallback to old implementation for arbitrary URLs - return parse_url(urlStr); -} - -const streamDestructionSupported = 'destroy' in Stream.Readable.prototype; - -/** - * Check if a value is an instance of Request. - * - * @param Mixed input - * @return Boolean - */ -function isRequest(input) { - return typeof input === 'object' && typeof input[INTERNALS$2] === 'object'; -} - -function isAbortSignal(signal) { - const proto = signal && typeof signal === 'object' && Object.getPrototypeOf(signal); - return !!(proto && proto.constructor.name === 'AbortSignal'); -} - -/** - * Request class - * - * @param Mixed input Url or Request instance - * @param Object init Custom options - * @return Void - */ -class Request { - constructor(input) { - let init = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - - let parsedURL; - - // normalize input - if (!isRequest(input)) { - if (input && input.href) { - // in order to support Node.js' Url objects; though WHATWG's URL objects - // will fall into this branch also (since their `toString()` will return - // `href` property anyway) - parsedURL = parseURL(input.href); - } else { - // coerce input to a string before attempting to parse - parsedURL = parseURL(`${input}`); - } - input = {}; - } else { - parsedURL = parseURL(input.url); - } - - let method = init.method || input.method || 'GET'; - method = method.toUpperCase(); - - if ((init.body != null || isRequest(input) && input.body !== null) && (method === 'GET' || method === 'HEAD')) { - throw new TypeError('Request with GET/HEAD method cannot have body'); - } - - let inputBody = init.body != null ? init.body : isRequest(input) && input.body !== null ? clone(input) : null; - - Body.call(this, inputBody, { - timeout: init.timeout || input.timeout || 0, - size: init.size || input.size || 0 - }); - - const headers = new Headers(init.headers || input.headers || {}); - - if (inputBody != null && !headers.has('Content-Type')) { - const contentType = extractContentType(inputBody); - if (contentType) { - headers.append('Content-Type', contentType); - } - } - - let signal = isRequest(input) ? input.signal : null; - if ('signal' in init) signal = init.signal; - - if (signal != null && !isAbortSignal(signal)) { - throw new TypeError('Expected signal to be an instanceof AbortSignal'); - } - - this[INTERNALS$2] = { - method, - redirect: init.redirect || input.redirect || 'follow', - headers, - parsedURL, - signal - }; - - // node-fetch-only options - this.follow = init.follow !== undefined ? init.follow : input.follow !== undefined ? input.follow : 20; - this.compress = init.compress !== undefined ? init.compress : input.compress !== undefined ? input.compress : true; - this.counter = init.counter || input.counter || 0; - this.agent = init.agent || input.agent; - } - - get method() { - return this[INTERNALS$2].method; - } - - get url() { - return format_url(this[INTERNALS$2].parsedURL); - } - - get headers() { - return this[INTERNALS$2].headers; - } - - get redirect() { - return this[INTERNALS$2].redirect; - } - - get signal() { - return this[INTERNALS$2].signal; - } - - /** - * Clone this request - * - * @return Request - */ - clone() { - return new Request(this); - } -} - -Body.mixIn(Request.prototype); - -Object.defineProperty(Request.prototype, Symbol.toStringTag, { - value: 'Request', - writable: false, - enumerable: false, - configurable: true -}); - -Object.defineProperties(Request.prototype, { - method: { enumerable: true }, - url: { enumerable: true }, - headers: { enumerable: true }, - redirect: { enumerable: true }, - clone: { enumerable: true }, - signal: { enumerable: true } -}); - -/** - * Convert a Request to Node.js http request options. - * - * @param Request A Request instance - * @return Object The options object to be passed to http.request - */ -function getNodeRequestOptions(request) { - const parsedURL = request[INTERNALS$2].parsedURL; - const headers = new Headers(request[INTERNALS$2].headers); - - // fetch step 1.3 - if (!headers.has('Accept')) { - headers.set('Accept', '*/*'); - } - - // Basic fetch - if (!parsedURL.protocol || !parsedURL.hostname) { - throw new TypeError('Only absolute URLs are supported'); - } - - if (!/^https?:$/.test(parsedURL.protocol)) { - throw new TypeError('Only HTTP(S) protocols are supported'); - } - - if (request.signal && request.body instanceof Stream.Readable && !streamDestructionSupported) { - throw new Error('Cancellation of streamed requests with AbortSignal is not supported in node < 8'); - } - - // HTTP-network-or-cache fetch steps 2.4-2.7 - let contentLengthValue = null; - if (request.body == null && /^(POST|PUT)$/i.test(request.method)) { - contentLengthValue = '0'; - } - if (request.body != null) { - const totalBytes = getTotalBytes(request); - if (typeof totalBytes === 'number') { - contentLengthValue = String(totalBytes); - } - } - if (contentLengthValue) { - headers.set('Content-Length', contentLengthValue); - } - - // HTTP-network-or-cache fetch step 2.11 - if (!headers.has('User-Agent')) { - headers.set('User-Agent', 'node-fetch/1.0 (+https://github.com/bitinn/node-fetch)'); - } - - // HTTP-network-or-cache fetch step 2.15 - if (request.compress && !headers.has('Accept-Encoding')) { - headers.set('Accept-Encoding', 'gzip,deflate'); - } - - let agent = request.agent; - if (typeof agent === 'function') { - agent = agent(parsedURL); - } - - if (!headers.has('Connection') && !agent) { - headers.set('Connection', 'close'); - } - - // HTTP-network fetch step 4.2 - // chunked encoding is handled by Node.js - - return Object.assign({}, parsedURL, { - method: request.method, - headers: exportNodeCompatibleHeaders(headers), - agent - }); -} - -/** - * abort-error.js - * - * AbortError interface for cancelled requests - */ - -/** - * Create AbortError instance - * - * @param String message Error message for human - * @return AbortError - */ -function AbortError(message) { - Error.call(this, message); - - this.type = 'aborted'; - this.message = message; - - // hide custom error implementation details from end-users - Error.captureStackTrace(this, this.constructor); -} - -AbortError.prototype = Object.create(Error.prototype); -AbortError.prototype.constructor = AbortError; -AbortError.prototype.name = 'AbortError'; - -const URL$1 = Url.URL || whatwgUrl.URL; - -// fix an issue where "PassThrough", "resolve" aren't a named export for node <10 -const PassThrough$1 = Stream.PassThrough; - -const isDomainOrSubdomain = function isDomainOrSubdomain(destination, original) { - const orig = new URL$1(original).hostname; - const dest = new URL$1(destination).hostname; - - return orig === dest || orig[orig.length - dest.length - 1] === '.' && orig.endsWith(dest); -}; - -/** - * Fetch function - * - * @param Mixed url Absolute url or Request instance - * @param Object opts Fetch options - * @return Promise - */ -function fetch(url, opts) { - - // allow custom promise - if (!fetch.Promise) { - throw new Error('native promise missing, set fetch.Promise to your favorite alternative'); - } - - Body.Promise = fetch.Promise; - - // wrap http.request into fetch - return new fetch.Promise(function (resolve, reject) { - // build request object - const request = new Request(url, opts); - const options = getNodeRequestOptions(request); - - const send = (options.protocol === 'https:' ? https : http).request; - const signal = request.signal; - - let response = null; - - const abort = function abort() { - let error = new AbortError('The user aborted a request.'); - reject(error); - if (request.body && request.body instanceof Stream.Readable) { - request.body.destroy(error); - } - if (!response || !response.body) return; - response.body.emit('error', error); - }; - - if (signal && signal.aborted) { - abort(); - return; - } - - const abortAndFinalize = function abortAndFinalize() { - abort(); - finalize(); - }; - - // send request - const req = send(options); - let reqTimeout; - - if (signal) { - signal.addEventListener('abort', abortAndFinalize); - } - - function finalize() { - req.abort(); - if (signal) signal.removeEventListener('abort', abortAndFinalize); - clearTimeout(reqTimeout); - } - - if (request.timeout) { - req.once('socket', function (socket) { - reqTimeout = setTimeout(function () { - reject(new FetchError(`network timeout at: ${request.url}`, 'request-timeout')); - finalize(); - }, request.timeout); - }); - } - - req.on('error', function (err) { - reject(new FetchError(`request to ${request.url} failed, reason: ${err.message}`, 'system', err)); - finalize(); - }); - - req.on('response', function (res) { - clearTimeout(reqTimeout); - - const headers = createHeadersLenient(res.headers); - - // HTTP fetch step 5 - if (fetch.isRedirect(res.statusCode)) { - // HTTP fetch step 5.2 - const location = headers.get('Location'); - - // HTTP fetch step 5.3 - let locationURL = null; - try { - locationURL = location === null ? null : new URL$1(location, request.url).toString(); - } catch (err) { - // error here can only be invalid URL in Location: header - // do not throw when options.redirect == manual - // let the user extract the errorneous redirect URL - if (request.redirect !== 'manual') { - reject(new FetchError(`uri requested responds with an invalid redirect URL: ${location}`, 'invalid-redirect')); - finalize(); - return; - } - } - - // HTTP fetch step 5.5 - switch (request.redirect) { - case 'error': - reject(new FetchError(`uri requested responds with a redirect, redirect mode is set to error: ${request.url}`, 'no-redirect')); - finalize(); - return; - case 'manual': - // node-fetch-specific step: make manual redirect a bit easier to use by setting the Location header value to the resolved URL. - if (locationURL !== null) { - // handle corrupted header - try { - headers.set('Location', locationURL); - } catch (err) { - // istanbul ignore next: nodejs server prevent invalid response headers, we can't test this through normal request - reject(err); - } - } - break; - case 'follow': - // HTTP-redirect fetch step 2 - if (locationURL === null) { - break; - } - - // HTTP-redirect fetch step 5 - if (request.counter >= request.follow) { - reject(new FetchError(`maximum redirect reached at: ${request.url}`, 'max-redirect')); - finalize(); - return; - } - - // HTTP-redirect fetch step 6 (counter increment) - // Create a new Request object. - const requestOpts = { - headers: new Headers(request.headers), - follow: request.follow, - counter: request.counter + 1, - agent: request.agent, - compress: request.compress, - method: request.method, - body: request.body, - signal: request.signal, - timeout: request.timeout, - size: request.size - }; - - if (!isDomainOrSubdomain(request.url, locationURL)) { - for (const name of ['authorization', 'www-authenticate', 'cookie', 'cookie2']) { - requestOpts.headers.delete(name); - } - } - - // HTTP-redirect fetch step 9 - if (res.statusCode !== 303 && request.body && getTotalBytes(request) === null) { - reject(new FetchError('Cannot follow redirect with body being a readable stream', 'unsupported-redirect')); - finalize(); - return; - } - - // HTTP-redirect fetch step 11 - if (res.statusCode === 303 || (res.statusCode === 301 || res.statusCode === 302) && request.method === 'POST') { - requestOpts.method = 'GET'; - requestOpts.body = undefined; - requestOpts.headers.delete('content-length'); - } - - // HTTP-redirect fetch step 15 - resolve(fetch(new Request(locationURL, requestOpts))); - finalize(); - return; - } - } - - // prepare response - res.once('end', function () { - if (signal) signal.removeEventListener('abort', abortAndFinalize); - }); - let body = res.pipe(new PassThrough$1()); - - const response_options = { - url: request.url, - status: res.statusCode, - statusText: res.statusMessage, - headers: headers, - size: request.size, - timeout: request.timeout, - counter: request.counter - }; - - // HTTP-network fetch step 12.1.1.3 - const codings = headers.get('Content-Encoding'); - - // HTTP-network fetch step 12.1.1.4: handle content codings - - // in following scenarios we ignore compression support - // 1. compression support is disabled - // 2. HEAD request - // 3. no Content-Encoding header - // 4. no content response (204) - // 5. content not modified response (304) - if (!request.compress || request.method === 'HEAD' || codings === null || res.statusCode === 204 || res.statusCode === 304) { - response = new Response(body, response_options); - resolve(response); - return; - } - - // For Node v6+ - // Be less strict when decoding compressed responses, since sometimes - // servers send slightly invalid responses that are still accepted - // by common browsers. - // Always using Z_SYNC_FLUSH is what cURL does. - const zlibOptions = { - flush: zlib.Z_SYNC_FLUSH, - finishFlush: zlib.Z_SYNC_FLUSH - }; - - // for gzip - if (codings == 'gzip' || codings == 'x-gzip') { - body = body.pipe(zlib.createGunzip(zlibOptions)); - response = new Response(body, response_options); - resolve(response); - return; - } - - // for deflate - if (codings == 'deflate' || codings == 'x-deflate') { - // handle the infamous raw deflate response from old servers - // a hack for old IIS and Apache servers - const raw = res.pipe(new PassThrough$1()); - raw.once('data', function (chunk) { - // see http://stackoverflow.com/questions/37519828 - if ((chunk[0] & 0x0F) === 0x08) { - body = body.pipe(zlib.createInflate()); - } else { - body = body.pipe(zlib.createInflateRaw()); - } - response = new Response(body, response_options); - resolve(response); - }); - return; - } - - // for br - if (codings == 'br' && typeof zlib.createBrotliDecompress === 'function') { - body = body.pipe(zlib.createBrotliDecompress()); - response = new Response(body, response_options); - resolve(response); - return; - } - - // otherwise, use response as-is - response = new Response(body, response_options); - resolve(response); - }); - - writeToStream(req, request); - }); -} -/** - * Redirect code matching - * - * @param Number code Status code - * @return Boolean - */ -fetch.isRedirect = function (code) { - return code === 301 || code === 302 || code === 303 || code === 307 || code === 308; -}; - -// expose Promise -fetch.Promise = global.Promise; - -export default fetch; -export { Headers, Request, Response, FetchError }; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/node-fetch/package.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/node-fetch/package.json deleted file mode 100644 index 3c1bd8da..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/node-fetch/package.json +++ /dev/null @@ -1,76 +0,0 @@ -{ - "name": "node-fetch", - "version": "2.6.7", - "description": "A light-weight module that brings window.fetch to node.js", - "main": "lib/index.js", - "browser": "./browser.js", - "module": "lib/index.mjs", - "files": [ - "lib/index.js", - "lib/index.mjs", - "lib/index.es.js", - "browser.js" - ], - "engines": { - "node": "4.x || >=6.0.0" - }, - "scripts": { - "build": "cross-env BABEL_ENV=rollup rollup -c", - "prepare": "npm run build", - "test": "cross-env BABEL_ENV=test mocha --require babel-register --throw-deprecation test/test.js", - "report": "cross-env BABEL_ENV=coverage nyc --reporter lcov --reporter text mocha -R spec test/test.js", - "coverage": "cross-env BABEL_ENV=coverage nyc --reporter json --reporter text mocha -R spec test/test.js && codecov -f coverage/coverage-final.json" - }, - "repository": { - "type": "git", - "url": "https://github.com/bitinn/node-fetch.git" - }, - "keywords": [ - "fetch", - "http", - "promise" - ], - "author": "David Frank", - "license": "MIT", - "bugs": { - "url": "https://github.com/bitinn/node-fetch/issues" - }, - "homepage": "https://github.com/bitinn/node-fetch", - "dependencies": { - "whatwg-url": "^5.0.0" - }, - "peerDependencies": { - "encoding": "^0.1.0" - }, - "peerDependenciesMeta": { - "encoding": { - "optional": true - } - }, - "devDependencies": { - "@ungap/url-search-params": "^0.1.2", - "abort-controller": "^1.1.0", - "abortcontroller-polyfill": "^1.3.0", - "babel-core": "^6.26.3", - "babel-plugin-istanbul": "^4.1.6", - "babel-preset-env": "^1.6.1", - "babel-register": "^6.16.3", - "chai": "^3.5.0", - "chai-as-promised": "^7.1.1", - "chai-iterator": "^1.1.1", - "chai-string": "~1.3.0", - "codecov": "3.3.0", - "cross-env": "^5.2.0", - "form-data": "^2.3.3", - "is-builtin-module": "^1.0.0", - "mocha": "^5.0.0", - "nyc": "11.9.0", - "parted": "^0.1.1", - "promise": "^8.0.3", - "resumer": "0.0.0", - "rollup": "^0.63.4", - "rollup-plugin-babel": "^3.0.7", - "string-to-arraybuffer": "^1.0.2", - "teeny-request": "3.7.0" - } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/CHANGELOG.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/CHANGELOG.md deleted file mode 100644 index 27d0e3a0..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/CHANGELOG.md +++ /dev/null @@ -1,412 +0,0 @@ -Forge ChangeLog -=============== - -## 1.3.1 - 2022-03-29 - -### Fixes -- RFC 3447 and RFC 8017 allow for optional `DigestAlgorithm` `NULL` parameters - for `sha*` algorithms and require `NULL` paramters for `md2` and `md5` - algorithms. - -## 1.3.0 - 2022-03-17 - -### Security -- Three RSA PKCS#1 v1.5 signature verification issues were reported by Moosa - Yahyazadeh (moosa-yahyazadeh@uiowa.edu). -- **HIGH**: Leniency in checking `digestAlgorithm` structure can lead to - signature forgery. - - The code is lenient in checking the digest algorithm structure. This can - allow a crafted structure that steals padding bytes and uses unchecked - portion of the PKCS#1 encoded message to forge a signature when a low - public exponent is being used. For more information, please see - ["Bleichenbacher's RSA signature forgery based on implementation - error"](https://mailarchive.ietf.org/arch/msg/openpgp/5rnE9ZRN1AokBVj3VqblGlP63QE/) - by Hal Finney. - - CVE ID: [CVE-2022-24771](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-24771) - - GHSA ID: [GHSA-cfm4-qjh2-4765](https://github.com/digitalbazaar/forge/security/advisories/GHSA-cfm4-qjh2-4765) -- **HIGH**: Failing to check tailing garbage bytes can lead to signature - forgery. - - The code does not check for tailing garbage bytes after decoding a - `DigestInfo` ASN.1 structure. This can allow padding bytes to be removed - and garbage data added to forge a signature when a low public exponent is - being used. For more information, please see ["Bleichenbacher's RSA - signature forgery based on implementation - error"](https://mailarchive.ietf.org/arch/msg/openpgp/5rnE9ZRN1AokBVj3VqblGlP63QE/) - by Hal Finney. - - CVE ID: [CVE-2022-24772](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-24772) - - GHSA ID: [GHSA-x4jg-mjrx-434g](https://github.com/digitalbazaar/forge/security/advisories/GHSA-x4jg-mjrx-434g) -- **MEDIUM**: Leniency in checking type octet. - - `DigestInfo` is not properly checked for proper ASN.1 structure. This can - lead to successful verification with signatures that contain invalid - structures but a valid digest. - - CVE ID: [CVE-2022-24773](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-24773) - - GHSA ID: [GHSA-2r2c-g63r-vccr](https://github.com/digitalbazaar/forge/security/advisories/GHSA-2r2c-g63r-vccr) - -### Fixed -- [asn1] Add fallback to pretty print invalid UTF8 data. -- [asn1] `fromDer` is now more strict and will default to ensuring all input - bytes are parsed or throw an error. A new option `parseAllBytes` can disable - this behavior. - - **NOTE**: The previous behavior is being changed since it can lead to - security issues with crafted inputs. It is possible that code doing custom - DER parsing may need to adapt to this new behavior and optional flag. -- [rsa] Add and use a validator to check for proper structure of parsed ASN.1 - `RSASSA-PKCS-v1_5` `DigestInfo` data. Additionally check that the hash - algorithm identifier is a known value from RFC 8017 - `PKCS1-v1-5DigestAlgorithms`. An invalid `DigestInfo` or algorithm identifier - will now throw an error. - - **NOTE**: The previous lenient behavior is being changed to be more strict - since it could lead to security issues with crafted inputs. It is possible - that code may have to handle the errors from these stricter checks. - -### Added -- [oid] Added missing RFC 8017 PKCS1-v1-5DigestAlgorithms algorithm - identifiers: - - `1.2.840.113549.2.2` / `md2` - - `2.16.840.1.101.3.4.2.4` / `sha224` - - `2.16.840.1.101.3.4.2.5` / `sha512-224` - - `2.16.840.1.101.3.4.2.6` / `sha512-256` - -## 1.2.1 - 2022-01-11 - -### Fixed -- [tests]: Load entire module to improve top-level testing and coverage - reporting. -- [log]: Refactor logging setup to avoid use of `URLSearchParams`. - -## 1.2.0 - 2022-01-07 - -### Fixed -- [x509] 'Expected' and 'Actual' issuers were backwards in verification failure - message. - -### Added -- [oid,x509]: Added OID `1.3.14.3.2.29 / sha1WithRSASignature` for sha1 with - RSA. Considered a deprecated equivalent to `1.2.840.113549.1.1.5 / - sha1WithRSAEncryption`. See [discussion and - links](https://github.com/digitalbazaar/forge/issues/825). - -### Changed -- [x509]: Reduce duplicate code. Add helper function to create a signature - digest given an signature algorithm OID. Add helper function to verify - signatures. - -## 1.1.0 - 2022-01-06 - -### Fixed -- [x509]: Correctly compute certificate issuer and subject hashes to match - behavior of openssl. -- [pem]: Accept certificate requests with "NEW" in the label. "BEGIN NEW - CERTIFICATE REQUEST" handled as "BEGIN CERTIFICATE REQUEST". - -## 1.0.0 - 2022-01-04 - -### Notes -- **1.0.0**! -- This project is over a decade old! Time for a 1.0.0 release. -- The URL related changes may expose bugs in some of the networking related - code (unrelated to the much wider used cryptography code). The automated and - manual test coverage for this code is weak at best. Issues or patches to - update the code or tests would be appreciated. - -### Removed -- **SECURITY**, **BREAKING**: Remove `forge.debug` API. The API has the - potential for prototype pollution. This API was only briefly used by the - maintainers for internal project debug purposes and was never intended to be - used with untrusted user inputs. This API was not documented or advertised - and is being removed rather than fixed. -- **SECURITY**, **BREAKING**: Remove `forge.util.parseUrl()` (and - `forge.http.parseUrl` alias) and use the [WHATWG URL - Standard](https://url.spec.whatwg.org/). `URL` is supported by modern browers - and modern Node.js. This change is needed to address URL parsing security - issues. If `forge.util.parseUrl()` is used directly or through `forge.xhr` or - `forge.http` APIs, and support is needed for environments without `URL` - support, then a polyfill must be used. -- **BREAKING**: Remove `forge.task` API. This API was never used, documented, - or advertised by the maintainers. If anyone was using this API and wishes to - continue development it in other project, please let the maintainers know. - Due to use in the test suite, a modified version is located in - `tests/support/`. -- **BREAKING**: Remove `forge.util.makeLink`, `forge.util.makeRequest`, - `forge.util.parseFragment`, `forge.util.getQueryVariables`. Replace with - `URL`, `URLSearchParams`, and custom code as needed. - -### Changed -- **BREAKING**: Increase supported Node.js version to 6.13.0 for URL support. -- **BREAKING**: Renamed `master` branch to `main`. -- **BREAKING**: Release process updated to use tooling that prefixes versions - with `v`. Other tools, scripts, or scanners may need to adapt. -- **BREAKING**: Remove docs related to Bower and - [forge-dist](https://github.com/digitalbazaar/forge-dist). Install using - [another method](./README.md#installation). - -### Added -- OIDs for `surname`, `title`, and `givenName`. - -### Fixed -- **BREAKING**: OID 2.5.4.5 name fixed from `serialName` to `serialNumber`. - Depending on how applications used this id to name association it could cause - compatibility issues. - -## 0.10.0 - 2020-09-01 - -### Changed -- **BREAKING**: Node.js 4 no longer supported. The code *may* still work, and - non-invasive patches to keep it working will be considered. However, more - modern tools no longer support old Node.js versions making testing difficult. - -### Removed -- **BREAKING**: Remove `util.getPath`, `util.setPath`, and `util.deletePath`. - `util.setPath` had a potential prototype pollution security issue when used - with unsafe inputs. These functions are not used by `forge` itself. They date - from an early time when `forge` was targeted at providing general helper - functions. The library direction changed to be more focused on cryptography. - Many other excellent libraries are more suitable for general utilities. If - you need a replacement for these functions, consider `get`, `set`, and `unset` - from [lodash](https://lodash.com/). But also consider the potential similar - security issues with those APIs. - -## 0.9.2 - 2020-09-01 - -### Changed -- Added `util.setPath` security note to function docs and to README. - -### Notes -- **SECURITY**: The `util.setPath` function has the potential to cause - prototype pollution if used with unsafe input. - - This function is **not** used internally by `forge`. - - The rest of the library is unaffected by this issue. - - **Do not** use unsafe input with this function. - - Usage with known input should function as expected. (Including input - intentionally using potentially problematic keys.) - - No code changes will be made to address this issue in 0.9.x. The current - behavior *could* be considered a feature rather than a security issue. - 0.10.0 will be released that removes `util.getPath` and `util.setPath`. - Consider `get` and `set` from [lodash](https://lodash.com/) if you need - replacements. But also consider the potential similar security issues with - those APIs. - - https://snyk.io/vuln/SNYK-JS-NODEFORGE-598677 - - https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-7720 - -## 0.9.1 - 2019-09-26 - -### Fixed -- Ensure DES-CBC given IV is long enough for block size. - -## 0.9.0 - 2019-09-04 - -### Added -- Add ed25519.publicKeyFromAsn1 and ed25519.privateKeyFromAsn1 APIs. -- A few OIDs used in EV certs. - -### Fixed -- Improve ed25519 NativeBuffer check. - -## 0.8.5 - 2019-06-18 - -### Fixed -- Remove use of `const`. - -## 0.8.4 - 2019-05-22 - -### Changed -- Replace all instances of Node.js `new Buffer` with `Buffer.from` and `Buffer.alloc`. - -## 0.8.3 - 2019-05-15 - -### Fixed -- Use basic character set for code. - -## 0.8.2 - 2019-03-18 - -### Fixed -- Fix tag calculation when continuing an AES-GCM block. - -### Changed -- Switch to eslint. - -## 0.8.1 - 2019-02-23 - -### Fixed -- Fix off-by-1 bug with kem random generation. - -## 0.8.0 - 2019-01-31 - -### Fixed -- Handle creation of certificates with `notBefore` and `notAfter` dates less - than Jan 1, 1950 or greater than or equal to Jan 1, 2050. - -### Added -- Add OID 2.5.4.13 "description". -- Add OID 2.16.840.1.113730.1.13 "nsComment". - - Also handle extension when creating a certificate. -- `pki.verifyCertificateChain`: - - Add `validityCheckDate` option to allow checking the certificate validity - period against an arbitrary `Date` or `null` for no check at all. The - current date is used by default. -- `tls.createConnection`: - - Add `verifyOptions` option that passes through to - `pki.verifyCertificateChain`. Can be used for the above `validityCheckDate` - option. - -### Changed -- Support WebCrypto API in web workers. -- `rsa.generateKeyPair`: - - Use `crypto.generateKeyPair`/`crypto.generateKeyPairSync` on Node.js if - available (10.12.0+) and not in pure JS mode. - - Use JS fallback in `rsa.generateKeyPair` if `prng` option specified since - this isn't supported by current native APIs. - - Only run key generation comparison tests if keys will be deterministic. -- PhantomJS is deprecated, now using Headless Chrome with Karma. -- **Note**: Using Headless Chrome vs PhantomJS may cause newer JS features to - slip into releases without proper support for older runtimes and browsers. - Please report such issues and they will be addressed. -- `pki.verifyCertificateChain`: - - Signature changed to `(caStore, chain, options)`. Older `(caStore, chain, - verify)` signature is still supported. New style is to to pass in a - `verify` option. - -## 0.7.6 - 2018-08-14 - -### Added -- Test on Node.js 10.x. -- Support for PKCS#7 detached signatures. - -### Changed -- Improve webpack/browser detection. - -## 0.7.5 - 2018-03-30 - -### Fixed -- Remove use of `const`. - -## 0.7.4 - 2018-03-07 - -### Fixed -- Potential regex denial of service in form.js. - -### Added -- Support for ED25519. -- Support for baseN/base58. - -## 0.7.3 - 2018-03-05 - -- Re-publish with npm 5.6.0 due to file timestamp issues. - -## 0.7.2 - 2018-02-27 - -### Added -- Support verification of SHA-384 certificates. -- `1.2.840.10040.4.3'`/`dsa-with-sha1` OID. - -### Fixed -- Support importing PKCS#7 data with no certificates. RFC 2315 sec 9.1 states - certificates are optional. -- `asn1.equals` loop bug. -- Fortuna implementation bugs. - -## 0.7.1 - 2017-03-27 - -### Fixed - -- Fix digestLength for hashes based on SHA-512. - -## 0.7.0 - 2017-02-07 - -### Fixed - -- Fix test looping bugs so all tests are run. -- Improved ASN.1 parsing. Many failure cases eliminated. More sanity checks. - Better behavior in default mode of parsing BIT STRINGs. Better handling of - parsed BIT STRINGs in `toDer()`. More tests. -- Improve X.509 BIT STRING handling by using new capture modes. - -### Changed - -- Major refactor to use CommonJS plus a browser build system. -- Updated tests, examples, docs. -- Updated dependencies. -- Updated flash build system. -- Improve OID mapping code. -- Change test servers from Python to JavaScript. -- Improve PhantomJS support. -- Move Bower/bundle support to - [forge-dist](https://github.com/digitalbazaar/forge-dist). -- **BREAKING**: Require minimal digest algorithm dependencies from individual - modules. -- Enforce currently supported bit param values for byte buffer access. May be - **BREAKING** for code that depended on unspecified and/or incorrect behavior. -- Improve `asn1.prettyPrint()` BIT STRING display. - -### Added - -- webpack bundler support via `npm run build`: - - Builds `.js`, `.min.js`, and basic sourcemaps. - - Basic build: `forge.js`. - - Build with extra utils and networking support: `forge.all.js`. - - Build WebWorker support: `prime.worker.js`. -- Browserify support in package.json. -- Karma browser testing. -- `forge.options` field. -- `forge.options.usePureJavaScript` flag. -- `forge.util.isNodejs` flag (used to select "native" APIs). -- Run PhantomJS tests in Travis-CI. -- Add "Donations" section to README. -- Add IRC to "Contact" section of README. -- Add "Security Considerations" section to README. -- Add pbkdf2 usePureJavaScript test. -- Add rsa.generateKeyPair async and usePureJavaScript tests. -- Add .editorconfig support. -- Add `md.all.js` which includes all digest algorithms. -- Add asn1 `equals()` and `copy()`. -- Add asn1 `validate()` capture options for BIT STRING contents and value. - -### Removed - -- **BREAKING**: Can no longer call `forge({...})` to create new instances. -- Remove a large amount of old cruft. - -### Migration from 0.6.x to 0.7.x - -- (all) If you used the feature to create a new forge instance with new - configuration options you will need to rework your code. That ability has - been removed due to implementation complexity. The main rare use was to set - the option to use pure JavaScript. That is now available as a library global - flag `forge.options.usePureJavaScript`. -- (npm,bower) If you used the default main file there is little to nothing to - change. -- (npm) If you accessed a sub-resource like `forge/js/pki` you should either - switch to just using the main `forge` and access `forge.pki` or update to - `forge/lib/pki`. -- (bower) If you used a sub-resource like `forge/js/pki` you should switch to - just using `forge` and access `forge.pki`. The bower release bundles - everything in one minified file. -- (bower) A configured workerScript like - `/bower_components/forge/js/prime.worker.js` will need to change to - `/bower_components/forge/dist/prime.worker.min.js`. -- (all) If you used the networking support or flash socket support, you will - need to use a custom build and/or adjust where files are loaded from. This - functionality is not included in the bower distribution by default and is - also now in a different directory. -- (all) The library should now directly support building custom bundles with - webpack, browserify, or similar. -- (all) If building a custom bundle ensure the correct dependencies are - included. In particular, note there is now a `md.all.js` file to include all - digest algorithms. Individual files limit what they include by default to - allow smaller custom builds. For instance, `pbdkf2.js` has a `sha1` default - but does not include any algorithm files by default. This allows the - possibility to include only `sha256` without the overhead of `sha1` and - `sha512`. - -### Notes - -- This major update requires updating the version to 0.7.x. The existing - work-in-progress "0.7.x" branch will be painfully rebased on top of this new - 0.7.x and moved forward to 0.8.x or later as needed. -- 0.7.x is a start of simplifying forge based on common issues and what has - appeared to be the most common usage. Please file issues with feedback if the - changes are problematic for your use cases. - -## 0.6.x - 2016 and earlier - -- See Git commit log or https://github.com/digitalbazaar/forge. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/LICENSE b/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/LICENSE deleted file mode 100644 index 2b48a95b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/LICENSE +++ /dev/null @@ -1,331 +0,0 @@ -You may use the Forge project under the terms of either the BSD License or the -GNU General Public License (GPL) Version 2. - -The BSD License is recommended for most projects. It is simple and easy to -understand and it places almost no restrictions on what you can do with the -Forge project. - -If the GPL suits your project better you are also free to use Forge under -that license. - -You don't have to do anything special to choose one license or the other and -you don't have to notify anyone which license you are using. You are free to -use this project in commercial projects as long as the copyright header is -left intact. - -If you are a commercial entity and use this set of libraries in your -commercial software then reasonable payment to Digital Bazaar, if you can -afford it, is not required but is expected and would be appreciated. If this -library saves you time, then it's saving you money. The cost of developing -the Forge software was on the order of several hundred hours and tens of -thousands of dollars. We are attempting to strike a balance between helping -the development community while not being taken advantage of by lucrative -commercial entities for our efforts. - -------------------------------------------------------------------------------- -New BSD License (3-clause) -Copyright (c) 2010, Digital Bazaar, Inc. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of Digital Bazaar, Inc. nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL DIGITAL BAZAAR BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -------------------------------------------------------------------------------- - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Lesser General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/README.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/README.md deleted file mode 100644 index 6f3279ef..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/README.md +++ /dev/null @@ -1,2071 +0,0 @@ -# Forge - -[![npm package](https://nodei.co/npm/node-forge.png?downloads=true&downloadRank=true&stars=true)](https://nodei.co/npm/node-forge/) - -[![Build Status](https://github.com/digitalbazaar/forge/workflows/Main%20Checks/badge.svg)](https://github.com/digitalbazaar/forge/actions?query=workflow%3A%22Main+Checks%22) - -A native implementation of [TLS][] (and various other cryptographic tools) in -[JavaScript][]. - -Introduction ------------- - -The Forge software is a fully native implementation of the [TLS][] protocol -in JavaScript, a set of cryptography utilities, and a set of tools for -developing Web Apps that utilize many network resources. - -Performance ------------- - -Forge is fast. Benchmarks against other popular JavaScript cryptography -libraries can be found here: - -* http://dominictarr.github.io/crypto-bench/ -* http://cryptojs.altervista.org/test/simulate-threading-speed_test.html - -Documentation -------------- - -* [Introduction](#introduction) -* [Performance](#performance) -* [Installation](#installation) -* [Testing](#testing) -* [Contributing](#contributing) - -### API - -* [Options](#options) - -### Transports - -* [TLS](#tls) -* [HTTP](#http) -* [SSH](#ssh) -* [XHR](#xhr) -* [Sockets](#socket) - -### Ciphers - -* [CIPHER](#cipher) -* [AES](#aes) -* [DES](#des) -* [RC2](#rc2) - -### PKI - -* [ED25519](#ed25519) -* [RSA](#rsa) -* [RSA-KEM](#rsakem) -* [X.509](#x509) -* [PKCS#5](#pkcs5) -* [PKCS#7](#pkcs7) -* [PKCS#8](#pkcs8) -* [PKCS#10](#pkcs10) -* [PKCS#12](#pkcs12) -* [ASN.1](#asn) - -### Message Digests - -* [SHA1](#sha1) -* [SHA256](#sha256) -* [SHA384](#sha384) -* [SHA512](#sha512) -* [MD5](#md5) -* [HMAC](#hmac) - -### Utilities - -* [Prime](#prime) -* [PRNG](#prng) -* [Tasks](#task) -* [Utilities](#util) -* [Logging](#log) -* [Flash Networking Support](#flash) - -### Other - -* [Security Considerations](#security-considerations) -* [Library Background](#library-background) -* [Contact](#contact) -* [Donations](#donations) - ---------------------------------------- - -Installation ------------- - -**Note**: Please see the [Security Considerations](#security-considerations) -section before using packaging systems and pre-built files. - -Forge uses a [CommonJS][] module structure with a build process for browser -bundles. The older [0.6.x][] branch with standalone files is available but will -not be regularly updated. - -### Node.js - -If you want to use forge with [Node.js][], it is available through `npm`: - -https://www.npmjs.com/package/node-forge - -Installation: - - npm install node-forge - -You can then use forge as a regular module: - -```js -var forge = require('node-forge'); -``` - -The npm package includes pre-built `forge.min.js`, `forge.all.min.js`, and -`prime.worker.min.js` using the [UMD][] format. - -### jsDelivr CDN - -To use it via [jsDelivr](https://www.jsdelivr.com/package/npm/node-forge) include this in your html: - -```html - -``` - -### unpkg CDN - -To use it via [unpkg](https://unpkg.com/#/) include this in your html: - -```html - -``` - -### Development Requirements - -The core JavaScript has the following requirements to build and test: - -* Building a browser bundle: - * Node.js - * npm -* Testing - * Node.js - * npm - * Chrome, Firefox, Safari (optional) - -Some special networking features can optionally use a Flash component. See the -[Flash README](./flash/README.md) for details. - -### Building for a web browser - -To create single file bundles for use with browsers run the following: - - npm install - npm run build - -This will create single non-minimized and minimized files that can be -included in the browser: - - dist/forge.js - dist/forge.min.js - -A bundle that adds some utilities and networking support is also available: - - dist/forge.all.js - dist/forge.all.min.js - -Include the file via: - -```html - -``` -or -```html - -``` - -The above bundles will synchronously create a global 'forge' object. - -**Note**: These bundles will not include any WebWorker scripts (eg: -`dist/prime.worker.js`), so these will need to be accessible from the browser -if any WebWorkers are used. - -### Building a custom browser bundle - -The build process uses [webpack][] and the [config](./webpack.config.js) file -can be modified to generate a file or files that only contain the parts of -forge you need. - -[Browserify][] override support is also present in `package.json`. - -Testing -------- - -### Prepare to run tests - - npm install - -### Running automated tests with Node.js - -Forge natively runs in a [Node.js][] environment: - - npm test - -### Running automated tests with Headless Chrome - -Automated testing is done via [Karma][]. By default it will run the tests with -Headless Chrome. - - npm run test-karma - -Is 'mocha' reporter output too verbose? Other reporters are available. Try -'dots', 'progress', or 'tap'. - - npm run test-karma -- --reporters progress - -By default [webpack][] is used. [Browserify][] can also be used. - - BUNDLER=browserify npm run test-karma - -### Running automated tests with one or more browsers - -You can also specify one or more browsers to use. - - npm run test-karma -- --browsers Chrome,Firefox,Safari,ChromeHeadless - -The reporter option and `BUNDLER` environment variable can also be used. - -### Running manual tests in a browser - -Testing in a browser uses [webpack][] to combine forge and all tests and then -loading the result in a browser. A simple web server is provided that will -output the HTTP or HTTPS URLs to load. It also will start a simple Flash Policy -Server. Unit tests and older legacy tests are provided. Custom ports can be -used by running `node tests/server.js` manually. - -To run the unit tests in a browser a special forge build is required: - - npm run test-build - -To run legacy browser based tests the main forge build is required: - - npm run build - -The tests are run with a custom server that prints out the URLs to use: - - npm run test-server - -### Running other tests - -There are some other random tests and benchmarks available in the tests -directory. - -### Coverage testing - -To perform coverage testing of the unit tests, run the following. The results -will be put in the `coverage/` directory. Note that coverage testing can slow -down some tests considerably. - - npm install - npm run coverage - -Contributing ------------- - -Any contributions (eg: PRs) that are accepted will be brought under the same -license used by the rest of the Forge project. This license allows Forge to -be used under the terms of either the BSD License or the GNU General Public -License (GPL) Version 2. - -See: [LICENSE](https://github.com/digitalbazaar/forge/blob/cbebca3780658703d925b61b2caffb1d263a6c1d/LICENSE) - -If a contribution contains 3rd party source code with its own license, it -may retain it, so long as that license is compatible with the Forge license. - -API ---- - - - -### Options - -If at any time you wish to disable the use of native code, where available, -for particular forge features like its secure random number generator, you -may set the ```forge.options.usePureJavaScript``` flag to ```true```. It is -not recommended that you set this flag as native code is typically more -performant and may have stronger security properties. It may be useful to -set this flag to test certain features that you plan to run in environments -that are different from your testing environment. - -To disable native code when including forge in the browser: - -```js -// run this *after* including the forge script -forge.options.usePureJavaScript = true; -``` - -To disable native code when using Node.js: - -```js -var forge = require('node-forge'); -forge.options.usePureJavaScript = true; -``` - -Transports ----------- - - - -### TLS - -Provides a native javascript client and server-side [TLS][] implementation. - -__Examples__ - -```js -// create TLS client -var client = forge.tls.createConnection({ - server: false, - caStore: /* Array of PEM-formatted certs or a CA store object */, - sessionCache: {}, - // supported cipher suites in order of preference - cipherSuites: [ - forge.tls.CipherSuites.TLS_RSA_WITH_AES_128_CBC_SHA, - forge.tls.CipherSuites.TLS_RSA_WITH_AES_256_CBC_SHA], - virtualHost: 'example.com', - verify: function(connection, verified, depth, certs) { - if(depth === 0) { - var cn = certs[0].subject.getField('CN').value; - if(cn !== 'example.com') { - verified = { - alert: forge.tls.Alert.Description.bad_certificate, - message: 'Certificate common name does not match hostname.' - }; - } - } - return verified; - }, - connected: function(connection) { - console.log('connected'); - // send message to server - connection.prepare(forge.util.encodeUtf8('Hi server!')); - /* NOTE: experimental, start heartbeat retransmission timer - myHeartbeatTimer = setInterval(function() { - connection.prepareHeartbeatRequest(forge.util.createBuffer('1234')); - }, 5*60*1000);*/ - }, - /* provide a client-side cert if you want - getCertificate: function(connection, hint) { - return myClientCertificate; - }, - /* the private key for the client-side cert if provided */ - getPrivateKey: function(connection, cert) { - return myClientPrivateKey; - }, - tlsDataReady: function(connection) { - // TLS data (encrypted) is ready to be sent to the server - sendToServerSomehow(connection.tlsData.getBytes()); - // if you were communicating with the server below, you'd do: - // server.process(connection.tlsData.getBytes()); - }, - dataReady: function(connection) { - // clear data from the server is ready - console.log('the server sent: ' + - forge.util.decodeUtf8(connection.data.getBytes())); - // close connection - connection.close(); - }, - /* NOTE: experimental - heartbeatReceived: function(connection, payload) { - // restart retransmission timer, look at payload - clearInterval(myHeartbeatTimer); - myHeartbeatTimer = setInterval(function() { - connection.prepareHeartbeatRequest(forge.util.createBuffer('1234')); - }, 5*60*1000); - payload.getBytes(); - },*/ - closed: function(connection) { - console.log('disconnected'); - }, - error: function(connection, error) { - console.log('uh oh', error); - } -}); - -// start the handshake process -client.handshake(); - -// when encrypted TLS data is received from the server, process it -client.process(encryptedBytesFromServer); - -// create TLS server -var server = forge.tls.createConnection({ - server: true, - caStore: /* Array of PEM-formatted certs or a CA store object */, - sessionCache: {}, - // supported cipher suites in order of preference - cipherSuites: [ - forge.tls.CipherSuites.TLS_RSA_WITH_AES_128_CBC_SHA, - forge.tls.CipherSuites.TLS_RSA_WITH_AES_256_CBC_SHA], - // require a client-side certificate if you want - verifyClient: true, - verify: function(connection, verified, depth, certs) { - if(depth === 0) { - var cn = certs[0].subject.getField('CN').value; - if(cn !== 'the-client') { - verified = { - alert: forge.tls.Alert.Description.bad_certificate, - message: 'Certificate common name does not match expected client.' - }; - } - } - return verified; - }, - connected: function(connection) { - console.log('connected'); - // send message to client - connection.prepare(forge.util.encodeUtf8('Hi client!')); - /* NOTE: experimental, start heartbeat retransmission timer - myHeartbeatTimer = setInterval(function() { - connection.prepareHeartbeatRequest(forge.util.createBuffer('1234')); - }, 5*60*1000);*/ - }, - getCertificate: function(connection, hint) { - return myServerCertificate; - }, - getPrivateKey: function(connection, cert) { - return myServerPrivateKey; - }, - tlsDataReady: function(connection) { - // TLS data (encrypted) is ready to be sent to the client - sendToClientSomehow(connection.tlsData.getBytes()); - // if you were communicating with the client above you'd do: - // client.process(connection.tlsData.getBytes()); - }, - dataReady: function(connection) { - // clear data from the client is ready - console.log('the client sent: ' + - forge.util.decodeUtf8(connection.data.getBytes())); - // close connection - connection.close(); - }, - /* NOTE: experimental - heartbeatReceived: function(connection, payload) { - // restart retransmission timer, look at payload - clearInterval(myHeartbeatTimer); - myHeartbeatTimer = setInterval(function() { - connection.prepareHeartbeatRequest(forge.util.createBuffer('1234')); - }, 5*60*1000); - payload.getBytes(); - },*/ - closed: function(connection) { - console.log('disconnected'); - }, - error: function(connection, error) { - console.log('uh oh', error); - } -}); - -// when encrypted TLS data is received from the client, process it -server.process(encryptedBytesFromClient); -``` - -Connect to a TLS server using node's net.Socket: - -```js -var socket = new net.Socket(); - -var client = forge.tls.createConnection({ - server: false, - verify: function(connection, verified, depth, certs) { - // skip verification for testing - console.log('[tls] server certificate verified'); - return true; - }, - connected: function(connection) { - console.log('[tls] connected'); - // prepare some data to send (note that the string is interpreted as - // 'binary' encoded, which works for HTTP which only uses ASCII, use - // forge.util.encodeUtf8(str) otherwise - client.prepare('GET / HTTP/1.0\r\n\r\n'); - }, - tlsDataReady: function(connection) { - // encrypted data is ready to be sent to the server - var data = connection.tlsData.getBytes(); - socket.write(data, 'binary'); // encoding should be 'binary' - }, - dataReady: function(connection) { - // clear data from the server is ready - var data = connection.data.getBytes(); - console.log('[tls] data received from the server: ' + data); - }, - closed: function() { - console.log('[tls] disconnected'); - }, - error: function(connection, error) { - console.log('[tls] error', error); - } -}); - -socket.on('connect', function() { - console.log('[socket] connected'); - client.handshake(); -}); -socket.on('data', function(data) { - client.process(data.toString('binary')); // encoding should be 'binary' -}); -socket.on('end', function() { - console.log('[socket] disconnected'); -}); - -// connect to google.com -socket.connect(443, 'google.com'); - -// or connect to gmail's imap server (but don't send the HTTP header above) -//socket.connect(993, 'imap.gmail.com'); -``` - - - -### HTTP - -Provides a native [JavaScript][] mini-implementation of an http client that -uses pooled sockets. - -__Examples__ - -```js -// create an HTTP GET request -var request = forge.http.createRequest({method: 'GET', path: url.path}); - -// send the request somewhere -sendSomehow(request.toString()); - -// receive response -var buffer = forge.util.createBuffer(); -var response = forge.http.createResponse(); -var someAsyncDataHandler = function(bytes) { - if(!response.bodyReceived) { - buffer.putBytes(bytes); - if(!response.headerReceived) { - if(response.readHeader(buffer)) { - console.log('HTTP response header: ' + response.toString()); - } - } - if(response.headerReceived && !response.bodyReceived) { - if(response.readBody(buffer)) { - console.log('HTTP response body: ' + response.body); - } - } - } -}; -``` - - - -### SSH - -Provides some SSH utility functions. - -__Examples__ - -```js -// encodes (and optionally encrypts) a private RSA key as a Putty PPK file -forge.ssh.privateKeyToPutty(privateKey, passphrase, comment); - -// encodes a public RSA key as an OpenSSH file -forge.ssh.publicKeyToOpenSSH(key, comment); - -// encodes a private RSA key as an OpenSSH file -forge.ssh.privateKeyToOpenSSH(privateKey, passphrase); - -// gets the SSH public key fingerprint in a byte buffer -forge.ssh.getPublicKeyFingerprint(key); - -// gets a hex-encoded, colon-delimited SSH public key fingerprint -forge.ssh.getPublicKeyFingerprint(key, {encoding: 'hex', delimiter: ':'}); -``` - - - -### XHR - -Provides an XmlHttpRequest implementation using forge.http as a backend. - -__Examples__ - -```js -// TODO -``` - - - -### Sockets - -Provides an interface to create and use raw sockets provided via Flash. - -__Examples__ - -```js -// TODO -``` - -Ciphers -------- - - - -### CIPHER - -Provides a basic API for block encryption and decryption. There is built-in -support for the ciphers: [AES][], [3DES][], and [DES][], and for the modes -of operation: [ECB][], [CBC][], [CFB][], [OFB][], [CTR][], and [GCM][]. - -These algorithms are currently supported: - -* AES-ECB -* AES-CBC -* AES-CFB -* AES-OFB -* AES-CTR -* AES-GCM -* 3DES-ECB -* 3DES-CBC -* DES-ECB -* DES-CBC - -When using an [AES][] algorithm, the key size will determine whether -AES-128, AES-192, or AES-256 is used (all are supported). When a [DES][] -algorithm is used, the key size will determine whether [3DES][] or regular -[DES][] is used. Use a [3DES][] algorithm to enforce Triple-DES. - -__Examples__ - -```js -// generate a random key and IV -// Note: a key size of 16 bytes will use AES-128, 24 => AES-192, 32 => AES-256 -var key = forge.random.getBytesSync(16); -var iv = forge.random.getBytesSync(16); - -/* alternatively, generate a password-based 16-byte key -var salt = forge.random.getBytesSync(128); -var key = forge.pkcs5.pbkdf2('password', salt, numIterations, 16); -*/ - -// encrypt some bytes using CBC mode -// (other modes include: ECB, CFB, OFB, CTR, and GCM) -// Note: CBC and ECB modes use PKCS#7 padding as default -var cipher = forge.cipher.createCipher('AES-CBC', key); -cipher.start({iv: iv}); -cipher.update(forge.util.createBuffer(someBytes)); -cipher.finish(); -var encrypted = cipher.output; -// outputs encrypted hex -console.log(encrypted.toHex()); - -// decrypt some bytes using CBC mode -// (other modes include: CFB, OFB, CTR, and GCM) -var decipher = forge.cipher.createDecipher('AES-CBC', key); -decipher.start({iv: iv}); -decipher.update(encrypted); -var result = decipher.finish(); // check 'result' for true/false -// outputs decrypted hex -console.log(decipher.output.toHex()); - -// decrypt bytes using CBC mode and streaming -// Performance can suffer for large multi-MB inputs due to buffer -// manipulations. Stream processing in chunks can offer significant -// improvement. CPU intensive update() calls could also be performed with -// setImmediate/setTimeout to avoid blocking the main browser UI thread (not -// shown here). Optimal block size depends on the JavaScript VM and other -// factors. Encryption can use a simple technique for increased performance. -var encryptedBytes = encrypted.bytes(); -var decipher = forge.cipher.createDecipher('AES-CBC', key); -decipher.start({iv: iv}); -var length = encryptedBytes.length; -var chunkSize = 1024 * 64; -var index = 0; -var decrypted = ''; -do { - decrypted += decipher.output.getBytes(); - var buf = forge.util.createBuffer(encryptedBytes.substr(index, chunkSize)); - decipher.update(buf); - index += chunkSize; -} while(index < length); -var result = decipher.finish(); -assert(result); -decrypted += decipher.output.getBytes(); -console.log(forge.util.bytesToHex(decrypted)); - -// encrypt some bytes using GCM mode -var cipher = forge.cipher.createCipher('AES-GCM', key); -cipher.start({ - iv: iv, // should be a 12-byte binary-encoded string or byte buffer - additionalData: 'binary-encoded string', // optional - tagLength: 128 // optional, defaults to 128 bits -}); -cipher.update(forge.util.createBuffer(someBytes)); -cipher.finish(); -var encrypted = cipher.output; -var tag = cipher.mode.tag; -// outputs encrypted hex -console.log(encrypted.toHex()); -// outputs authentication tag -console.log(tag.toHex()); - -// decrypt some bytes using GCM mode -var decipher = forge.cipher.createDecipher('AES-GCM', key); -decipher.start({ - iv: iv, - additionalData: 'binary-encoded string', // optional - tagLength: 128, // optional, defaults to 128 bits - tag: tag // authentication tag from encryption -}); -decipher.update(encrypted); -var pass = decipher.finish(); -// pass is false if there was a failure (eg: authentication tag didn't match) -if(pass) { - // outputs decrypted hex - console.log(decipher.output.toHex()); -} -``` - -Using forge in Node.js to match openssl's "enc" command line tool (**Note**: OpenSSL "enc" uses a non-standard file format with a custom key derivation function and a fixed iteration count of 1, which some consider less secure than alternatives such as [OpenPGP](https://tools.ietf.org/html/rfc4880)/[GnuPG](https://www.gnupg.org/)): - -```js -var forge = require('node-forge'); -var fs = require('fs'); - -// openssl enc -des3 -in input.txt -out input.enc -function encrypt(password) { - var input = fs.readFileSync('input.txt', {encoding: 'binary'}); - - // 3DES key and IV sizes - var keySize = 24; - var ivSize = 8; - - // get derived bytes - // Notes: - // 1. If using an alternative hash (eg: "-md sha1") pass - // "forge.md.sha1.create()" as the final parameter. - // 2. If using "-nosalt", set salt to null. - var salt = forge.random.getBytesSync(8); - // var md = forge.md.sha1.create(); // "-md sha1" - var derivedBytes = forge.pbe.opensslDeriveBytes( - password, salt, keySize + ivSize/*, md*/); - var buffer = forge.util.createBuffer(derivedBytes); - var key = buffer.getBytes(keySize); - var iv = buffer.getBytes(ivSize); - - var cipher = forge.cipher.createCipher('3DES-CBC', key); - cipher.start({iv: iv}); - cipher.update(forge.util.createBuffer(input, 'binary')); - cipher.finish(); - - var output = forge.util.createBuffer(); - - // if using a salt, prepend this to the output: - if(salt !== null) { - output.putBytes('Salted__'); // (add to match openssl tool output) - output.putBytes(salt); - } - output.putBuffer(cipher.output); - - fs.writeFileSync('input.enc', output.getBytes(), {encoding: 'binary'}); -} - -// openssl enc -d -des3 -in input.enc -out input.dec.txt -function decrypt(password) { - var input = fs.readFileSync('input.enc', {encoding: 'binary'}); - - // parse salt from input - input = forge.util.createBuffer(input, 'binary'); - // skip "Salted__" (if known to be present) - input.getBytes('Salted__'.length); - // read 8-byte salt - var salt = input.getBytes(8); - - // Note: if using "-nosalt", skip above parsing and use - // var salt = null; - - // 3DES key and IV sizes - var keySize = 24; - var ivSize = 8; - - var derivedBytes = forge.pbe.opensslDeriveBytes( - password, salt, keySize + ivSize); - var buffer = forge.util.createBuffer(derivedBytes); - var key = buffer.getBytes(keySize); - var iv = buffer.getBytes(ivSize); - - var decipher = forge.cipher.createDecipher('3DES-CBC', key); - decipher.start({iv: iv}); - decipher.update(input); - var result = decipher.finish(); // check 'result' for true/false - - fs.writeFileSync( - 'input.dec.txt', decipher.output.getBytes(), {encoding: 'binary'}); -} -``` - - - -### AES - -Provides [AES][] encryption and decryption in [CBC][], [CFB][], [OFB][], -[CTR][], and [GCM][] modes. See [CIPHER](#cipher) for examples. - - - -### DES - -Provides [3DES][] and [DES][] encryption and decryption in [ECB][] and -[CBC][] modes. See [CIPHER](#cipher) for examples. - - - -### RC2 - -__Examples__ - -```js -// generate a random key and IV -var key = forge.random.getBytesSync(16); -var iv = forge.random.getBytesSync(8); - -// encrypt some bytes -var cipher = forge.rc2.createEncryptionCipher(key); -cipher.start(iv); -cipher.update(forge.util.createBuffer(someBytes)); -cipher.finish(); -var encrypted = cipher.output; -// outputs encrypted hex -console.log(encrypted.toHex()); - -// decrypt some bytes -var cipher = forge.rc2.createDecryptionCipher(key); -cipher.start(iv); -cipher.update(encrypted); -cipher.finish(); -// outputs decrypted hex -console.log(cipher.output.toHex()); -``` - -PKI ---- - -Provides [X.509][] certificate support, ED25519 key generation and -signing/verifying, and RSA public and private key encoding, decoding, -encryption/decryption, and signing/verifying. - - - -### ED25519 - -Special thanks to [TweetNaCl.js][] for providing the bulk of the implementation. - -__Examples__ - -```js -var ed25519 = forge.pki.ed25519; - -// generate a random ED25519 keypair -var keypair = ed25519.generateKeyPair(); -// `keypair.publicKey` is a node.js Buffer or Uint8Array -// `keypair.privateKey` is a node.js Buffer or Uint8Array - -// generate a random ED25519 keypair based on a random 32-byte seed -var seed = forge.random.getBytesSync(32); -var keypair = ed25519.generateKeyPair({seed: seed}); - -// generate a random ED25519 keypair based on a "password" 32-byte seed -var password = 'Mai9ohgh6ahxee0jutheew0pungoozil'; -var seed = new forge.util.ByteBuffer(password, 'utf8'); -var keypair = ed25519.generateKeyPair({seed: seed}); - -// sign a UTF-8 message -var signature = ED25519.sign({ - message: 'test', - // also accepts `binary` if you want to pass a binary string - encoding: 'utf8', - // node.js Buffer, Uint8Array, forge ByteBuffer, binary string - privateKey: privateKey -}); -// `signature` is a node.js Buffer or Uint8Array - -// sign a message passed as a buffer -var signature = ED25519.sign({ - // also accepts a forge ByteBuffer or Uint8Array - message: Buffer.from('test', 'utf8'), - privateKey: privateKey -}); - -// sign a message digest (shorter "message" == better performance) -var md = forge.md.sha256.create(); -md.update('test', 'utf8'); -var signature = ED25519.sign({ - md: md, - privateKey: privateKey -}); - -// verify a signature on a UTF-8 message -var verified = ED25519.verify({ - message: 'test', - encoding: 'utf8', - // node.js Buffer, Uint8Array, forge ByteBuffer, or binary string - signature: signature, - // node.js Buffer, Uint8Array, forge ByteBuffer, or binary string - publicKey: publicKey -}); -// `verified` is true/false - -// sign a message passed as a buffer -var verified = ED25519.verify({ - // also accepts a forge ByteBuffer or Uint8Array - message: Buffer.from('test', 'utf8'), - // node.js Buffer, Uint8Array, forge ByteBuffer, or binary string - signature: signature, - // node.js Buffer, Uint8Array, forge ByteBuffer, or binary string - publicKey: publicKey -}); - -// verify a signature on a message digest -var md = forge.md.sha256.create(); -md.update('test', 'utf8'); -var verified = ED25519.verify({ - md: md, - // node.js Buffer, Uint8Array, forge ByteBuffer, or binary string - signature: signature, - // node.js Buffer, Uint8Array, forge ByteBuffer, or binary string - publicKey: publicKey -}); -``` - - - -### RSA - -__Examples__ - -```js -var rsa = forge.pki.rsa; - -// generate an RSA key pair synchronously -// *NOT RECOMMENDED*: Can be significantly slower than async and may block -// JavaScript execution. Will use native Node.js 10.12.0+ API if possible. -var keypair = rsa.generateKeyPair({bits: 2048, e: 0x10001}); - -// generate an RSA key pair asynchronously (uses web workers if available) -// use workers: -1 to run a fast core estimator to optimize # of workers -// *RECOMMENDED*: Can be significantly faster than sync. Will use native -// Node.js 10.12.0+ or WebCrypto API if possible. -rsa.generateKeyPair({bits: 2048, workers: 2}, function(err, keypair) { - // keypair.privateKey, keypair.publicKey -}); - -// generate an RSA key pair in steps that attempt to run for a specified period -// of time on the main JS thread -var state = rsa.createKeyPairGenerationState(2048, 0x10001); -var step = function() { - // run for 100 ms - if(!rsa.stepKeyPairGenerationState(state, 100)) { - setTimeout(step, 1); - } - else { - // done, turn off progress indicator, use state.keys - } -}; -// turn on progress indicator, schedule generation to run -setTimeout(step); - -// sign data with a private key and output DigestInfo DER-encoded bytes -// (defaults to RSASSA PKCS#1 v1.5) -var md = forge.md.sha1.create(); -md.update('sign this', 'utf8'); -var signature = privateKey.sign(md); - -// verify data with a public key -// (defaults to RSASSA PKCS#1 v1.5) -var verified = publicKey.verify(md.digest().bytes(), signature); - -// sign data using RSASSA-PSS where PSS uses a SHA-1 hash, a SHA-1 based -// masking function MGF1, and a 20 byte salt -var md = forge.md.sha1.create(); -md.update('sign this', 'utf8'); -var pss = forge.pss.create({ - md: forge.md.sha1.create(), - mgf: forge.mgf.mgf1.create(forge.md.sha1.create()), - saltLength: 20 - // optionally pass 'prng' with a custom PRNG implementation - // optionalls pass 'salt' with a forge.util.ByteBuffer w/custom salt -}); -var signature = privateKey.sign(md, pss); - -// verify RSASSA-PSS signature -var pss = forge.pss.create({ - md: forge.md.sha1.create(), - mgf: forge.mgf.mgf1.create(forge.md.sha1.create()), - saltLength: 20 - // optionally pass 'prng' with a custom PRNG implementation -}); -var md = forge.md.sha1.create(); -md.update('sign this', 'utf8'); -publicKey.verify(md.digest().getBytes(), signature, pss); - -// encrypt data with a public key (defaults to RSAES PKCS#1 v1.5) -var encrypted = publicKey.encrypt(bytes); - -// decrypt data with a private key (defaults to RSAES PKCS#1 v1.5) -var decrypted = privateKey.decrypt(encrypted); - -// encrypt data with a public key using RSAES PKCS#1 v1.5 -var encrypted = publicKey.encrypt(bytes, 'RSAES-PKCS1-V1_5'); - -// decrypt data with a private key using RSAES PKCS#1 v1.5 -var decrypted = privateKey.decrypt(encrypted, 'RSAES-PKCS1-V1_5'); - -// encrypt data with a public key using RSAES-OAEP -var encrypted = publicKey.encrypt(bytes, 'RSA-OAEP'); - -// decrypt data with a private key using RSAES-OAEP -var decrypted = privateKey.decrypt(encrypted, 'RSA-OAEP'); - -// encrypt data with a public key using RSAES-OAEP/SHA-256 -var encrypted = publicKey.encrypt(bytes, 'RSA-OAEP', { - md: forge.md.sha256.create() -}); - -// decrypt data with a private key using RSAES-OAEP/SHA-256 -var decrypted = privateKey.decrypt(encrypted, 'RSA-OAEP', { - md: forge.md.sha256.create() -}); - -// encrypt data with a public key using RSAES-OAEP/SHA-256/MGF1-SHA-1 -// compatible with Java's RSA/ECB/OAEPWithSHA-256AndMGF1Padding -var encrypted = publicKey.encrypt(bytes, 'RSA-OAEP', { - md: forge.md.sha256.create(), - mgf1: { - md: forge.md.sha1.create() - } -}); - -// decrypt data with a private key using RSAES-OAEP/SHA-256/MGF1-SHA-1 -// compatible with Java's RSA/ECB/OAEPWithSHA-256AndMGF1Padding -var decrypted = privateKey.decrypt(encrypted, 'RSA-OAEP', { - md: forge.md.sha256.create(), - mgf1: { - md: forge.md.sha1.create() - } -}); - -``` - - - -### RSA-KEM - -__Examples__ - -```js -// generate an RSA key pair asynchronously (uses web workers if available) -// use workers: -1 to run a fast core estimator to optimize # of workers -forge.rsa.generateKeyPair({bits: 2048, workers: -1}, function(err, keypair) { - // keypair.privateKey, keypair.publicKey -}); - -// generate and encapsulate a 16-byte secret key -var kdf1 = new forge.kem.kdf1(forge.md.sha1.create()); -var kem = forge.kem.rsa.create(kdf1); -var result = kem.encrypt(keypair.publicKey, 16); -// result has 'encapsulation' and 'key' - -// encrypt some bytes -var iv = forge.random.getBytesSync(12); -var someBytes = 'hello world!'; -var cipher = forge.cipher.createCipher('AES-GCM', result.key); -cipher.start({iv: iv}); -cipher.update(forge.util.createBuffer(someBytes)); -cipher.finish(); -var encrypted = cipher.output.getBytes(); -var tag = cipher.mode.tag.getBytes(); - -// send 'encrypted', 'iv', 'tag', and result.encapsulation to recipient - -// decrypt encapsulated 16-byte secret key -var kdf1 = new forge.kem.kdf1(forge.md.sha1.create()); -var kem = forge.kem.rsa.create(kdf1); -var key = kem.decrypt(keypair.privateKey, result.encapsulation, 16); - -// decrypt some bytes -var decipher = forge.cipher.createDecipher('AES-GCM', key); -decipher.start({iv: iv, tag: tag}); -decipher.update(forge.util.createBuffer(encrypted)); -var pass = decipher.finish(); -// pass is false if there was a failure (eg: authentication tag didn't match) -if(pass) { - // outputs 'hello world!' - console.log(decipher.output.getBytes()); -} - -``` - - - -### X.509 - -__Examples__ - -```js -var pki = forge.pki; - -// convert a PEM-formatted public key to a Forge public key -var publicKey = pki.publicKeyFromPem(pem); - -// convert a Forge public key to PEM-format -var pem = pki.publicKeyToPem(publicKey); - -// convert an ASN.1 SubjectPublicKeyInfo to a Forge public key -var publicKey = pki.publicKeyFromAsn1(subjectPublicKeyInfo); - -// convert a Forge public key to an ASN.1 SubjectPublicKeyInfo -var subjectPublicKeyInfo = pki.publicKeyToAsn1(publicKey); - -// gets a SHA-1 RSAPublicKey fingerprint a byte buffer -pki.getPublicKeyFingerprint(key); - -// gets a SHA-1 SubjectPublicKeyInfo fingerprint a byte buffer -pki.getPublicKeyFingerprint(key, {type: 'SubjectPublicKeyInfo'}); - -// gets a hex-encoded, colon-delimited SHA-1 RSAPublicKey public key fingerprint -pki.getPublicKeyFingerprint(key, {encoding: 'hex', delimiter: ':'}); - -// gets a hex-encoded, colon-delimited SHA-1 SubjectPublicKeyInfo public key fingerprint -pki.getPublicKeyFingerprint(key, { - type: 'SubjectPublicKeyInfo', - encoding: 'hex', - delimiter: ':' -}); - -// gets a hex-encoded, colon-delimited MD5 RSAPublicKey public key fingerprint -pki.getPublicKeyFingerprint(key, { - md: forge.md.md5.create(), - encoding: 'hex', - delimiter: ':' -}); - -// creates a CA store -var caStore = pki.createCaStore([/* PEM-encoded cert */, ...]); - -// add a certificate to the CA store -caStore.addCertificate(certObjectOrPemString); - -// gets the issuer (its certificate) for the given certificate -var issuerCert = caStore.getIssuer(subjectCert); - -// verifies a certificate chain against a CA store -pki.verifyCertificateChain(caStore, chain, customVerifyCallback); - -// signs a certificate using the given private key -cert.sign(privateKey); - -// signs a certificate using SHA-256 instead of SHA-1 -cert.sign(privateKey, forge.md.sha256.create()); - -// verifies an issued certificate using the certificates public key -var verified = issuer.verify(issued); - -// generate a keypair and create an X.509v3 certificate -var keys = pki.rsa.generateKeyPair(2048); -var cert = pki.createCertificate(); -cert.publicKey = keys.publicKey; -// alternatively set public key from a csr -//cert.publicKey = csr.publicKey; -// NOTE: serialNumber is the hex encoded value of an ASN.1 INTEGER. -// Conforming CAs should ensure serialNumber is: -// - no more than 20 octets -// - non-negative (prefix a '00' if your value starts with a '1' bit) -cert.serialNumber = '01'; -cert.validity.notBefore = new Date(); -cert.validity.notAfter = new Date(); -cert.validity.notAfter.setFullYear(cert.validity.notBefore.getFullYear() + 1); -var attrs = [{ - name: 'commonName', - value: 'example.org' -}, { - name: 'countryName', - value: 'US' -}, { - shortName: 'ST', - value: 'Virginia' -}, { - name: 'localityName', - value: 'Blacksburg' -}, { - name: 'organizationName', - value: 'Test' -}, { - shortName: 'OU', - value: 'Test' -}]; -cert.setSubject(attrs); -// alternatively set subject from a csr -//cert.setSubject(csr.subject.attributes); -cert.setIssuer(attrs); -cert.setExtensions([{ - name: 'basicConstraints', - cA: true -}, { - name: 'keyUsage', - keyCertSign: true, - digitalSignature: true, - nonRepudiation: true, - keyEncipherment: true, - dataEncipherment: true -}, { - name: 'extKeyUsage', - serverAuth: true, - clientAuth: true, - codeSigning: true, - emailProtection: true, - timeStamping: true -}, { - name: 'nsCertType', - client: true, - server: true, - email: true, - objsign: true, - sslCA: true, - emailCA: true, - objCA: true -}, { - name: 'subjectAltName', - altNames: [{ - type: 6, // URI - value: 'http://example.org/webid#me' - }, { - type: 7, // IP - ip: '127.0.0.1' - }] -}, { - name: 'subjectKeyIdentifier' -}]); -/* alternatively set extensions from a csr -var extensions = csr.getAttribute({name: 'extensionRequest'}).extensions; -// optionally add more extensions -extensions.push.apply(extensions, [{ - name: 'basicConstraints', - cA: true -}, { - name: 'keyUsage', - keyCertSign: true, - digitalSignature: true, - nonRepudiation: true, - keyEncipherment: true, - dataEncipherment: true -}]); -cert.setExtensions(extensions); -*/ -// self-sign certificate -cert.sign(keys.privateKey); - -// convert a Forge certificate to PEM -var pem = pki.certificateToPem(cert); - -// convert a Forge certificate from PEM -var cert = pki.certificateFromPem(pem); - -// convert an ASN.1 X.509x3 object to a Forge certificate -var cert = pki.certificateFromAsn1(obj); - -// convert a Forge certificate to an ASN.1 X.509v3 object -var asn1Cert = pki.certificateToAsn1(cert); -``` - - - -### PKCS#5 - -Provides the password-based key-derivation function from [PKCS#5][]. - -__Examples__ - -```js -// generate a password-based 16-byte key -// note an optional message digest can be passed as the final parameter -var salt = forge.random.getBytesSync(128); -var derivedKey = forge.pkcs5.pbkdf2('password', salt, numIterations, 16); - -// generate key asynchronously -// note an optional message digest can be passed before the callback -forge.pkcs5.pbkdf2('password', salt, numIterations, 16, function(err, derivedKey) { - // do something w/derivedKey -}); -``` - - - -### PKCS#7 - -Provides cryptographically protected messages from [PKCS#7][]. - -__Examples__ - -```js -// convert a message from PEM -var p7 = forge.pkcs7.messageFromPem(pem); -// look at p7.recipients - -// find a recipient by the issuer of a certificate -var recipient = p7.findRecipient(cert); - -// decrypt -p7.decrypt(p7.recipients[0], privateKey); - -// create a p7 enveloped message -var p7 = forge.pkcs7.createEnvelopedData(); - -// add a recipient -var cert = forge.pki.certificateFromPem(certPem); -p7.addRecipient(cert); - -// set content -p7.content = forge.util.createBuffer('Hello'); - -// encrypt -p7.encrypt(); - -// convert message to PEM -var pem = forge.pkcs7.messageToPem(p7); - -// create a degenerate PKCS#7 certificate container -// (CRLs not currently supported, only certificates) -var p7 = forge.pkcs7.createSignedData(); -p7.addCertificate(certOrCertPem1); -p7.addCertificate(certOrCertPem2); -var pem = forge.pkcs7.messageToPem(p7); - -// create PKCS#7 signed data with authenticatedAttributes -// attributes include: PKCS#9 content-type, message-digest, and signing-time -var p7 = forge.pkcs7.createSignedData(); -p7.content = forge.util.createBuffer('Some content to be signed.', 'utf8'); -p7.addCertificate(certOrCertPem); -p7.addSigner({ - key: privateKeyAssociatedWithCert, - certificate: certOrCertPem, - digestAlgorithm: forge.pki.oids.sha256, - authenticatedAttributes: [{ - type: forge.pki.oids.contentType, - value: forge.pki.oids.data - }, { - type: forge.pki.oids.messageDigest - // value will be auto-populated at signing time - }, { - type: forge.pki.oids.signingTime, - // value can also be auto-populated at signing time - value: new Date() - }] -}); -p7.sign(); -var pem = forge.pkcs7.messageToPem(p7); - -// PKCS#7 Sign in detached mode. -// Includes the signature and certificate without the signed data. -p7.sign({detached: true}); - -``` - - - -### PKCS#8 - -__Examples__ - -```js -var pki = forge.pki; - -// convert a PEM-formatted private key to a Forge private key -var privateKey = pki.privateKeyFromPem(pem); - -// convert a Forge private key to PEM-format -var pem = pki.privateKeyToPem(privateKey); - -// convert an ASN.1 PrivateKeyInfo or RSAPrivateKey to a Forge private key -var privateKey = pki.privateKeyFromAsn1(rsaPrivateKey); - -// convert a Forge private key to an ASN.1 RSAPrivateKey -var rsaPrivateKey = pki.privateKeyToAsn1(privateKey); - -// wrap an RSAPrivateKey ASN.1 object in a PKCS#8 ASN.1 PrivateKeyInfo -var privateKeyInfo = pki.wrapRsaPrivateKey(rsaPrivateKey); - -// convert a PKCS#8 ASN.1 PrivateKeyInfo to PEM -var pem = pki.privateKeyInfoToPem(privateKeyInfo); - -// encrypts a PrivateKeyInfo using a custom password and -// outputs an EncryptedPrivateKeyInfo -var encryptedPrivateKeyInfo = pki.encryptPrivateKeyInfo( - privateKeyInfo, 'myCustomPasswordHere', { - algorithm: 'aes256', // 'aes128', 'aes192', 'aes256', '3des' - }); - -// decrypts an ASN.1 EncryptedPrivateKeyInfo that was encrypted -// with a custom password -var privateKeyInfo = pki.decryptPrivateKeyInfo( - encryptedPrivateKeyInfo, 'myCustomPasswordHere'); - -// converts an EncryptedPrivateKeyInfo to PEM -var pem = pki.encryptedPrivateKeyToPem(encryptedPrivateKeyInfo); - -// converts a PEM-encoded EncryptedPrivateKeyInfo to ASN.1 format -var encryptedPrivateKeyInfo = pki.encryptedPrivateKeyFromPem(pem); - -// wraps and encrypts a Forge private key and outputs it in PEM format -var pem = pki.encryptRsaPrivateKey(privateKey, 'password'); - -// encrypts a Forge private key and outputs it in PEM format using OpenSSL's -// proprietary legacy format + encapsulated PEM headers (DEK-Info) -var pem = pki.encryptRsaPrivateKey(privateKey, 'password', {legacy: true}); - -// decrypts a PEM-formatted, encrypted private key -var privateKey = pki.decryptRsaPrivateKey(pem, 'password'); - -// sets an RSA public key from a private key -var publicKey = pki.setRsaPublicKey(privateKey.n, privateKey.e); -``` - - - -### PKCS#10 - -Provides certification requests or certificate signing requests (CSR) from -[PKCS#10][]. - -__Examples__ - -```js -// generate a key pair -var keys = forge.pki.rsa.generateKeyPair(2048); - -// create a certification request (CSR) -var csr = forge.pki.createCertificationRequest(); -csr.publicKey = keys.publicKey; -csr.setSubject([{ - name: 'commonName', - value: 'example.org' -}, { - name: 'countryName', - value: 'US' -}, { - shortName: 'ST', - value: 'Virginia' -}, { - name: 'localityName', - value: 'Blacksburg' -}, { - name: 'organizationName', - value: 'Test' -}, { - shortName: 'OU', - value: 'Test' -}]); -// set (optional) attributes -csr.setAttributes([{ - name: 'challengePassword', - value: 'password' -}, { - name: 'unstructuredName', - value: 'My Company, Inc.' -}, { - name: 'extensionRequest', - extensions: [{ - name: 'subjectAltName', - altNames: [{ - // 2 is DNS type - type: 2, - value: 'test.domain.com' - }, { - type: 2, - value: 'other.domain.com', - }, { - type: 2, - value: 'www.domain.net' - }] - }] -}]); - -// sign certification request -csr.sign(keys.privateKey); - -// verify certification request -var verified = csr.verify(); - -// convert certification request to PEM-format -var pem = forge.pki.certificationRequestToPem(csr); - -// convert a Forge certification request from PEM-format -var csr = forge.pki.certificationRequestFromPem(pem); - -// get an attribute -csr.getAttribute({name: 'challengePassword'}); - -// get extensions array -csr.getAttribute({name: 'extensionRequest'}).extensions; - -``` - - - -### PKCS#12 - -Provides the cryptographic archive file format from [PKCS#12][]. - -**Note for Chrome/Firefox/iOS/similar users**: If you have trouble importing -a PKCS#12 container, try using the TripleDES algorithm. It can be passed -to `forge.pkcs12.toPkcs12Asn1` using the `{algorithm: '3des'}` option. - -__Examples__ - -```js -// decode p12 from base64 -var p12Der = forge.util.decode64(p12b64); -// get p12 as ASN.1 object -var p12Asn1 = forge.asn1.fromDer(p12Der); -// decrypt p12 using the password 'password' -var p12 = forge.pkcs12.pkcs12FromAsn1(p12Asn1, 'password'); -// decrypt p12 using non-strict parsing mode (resolves some ASN.1 parse errors) -var p12 = forge.pkcs12.pkcs12FromAsn1(p12Asn1, false, 'password'); -// decrypt p12 using literally no password (eg: Mac OS X/apple push) -var p12 = forge.pkcs12.pkcs12FromAsn1(p12Asn1); -// decrypt p12 using an "empty" password (eg: OpenSSL with no password input) -var p12 = forge.pkcs12.pkcs12FromAsn1(p12Asn1, ''); -// p12.safeContents is an array of safe contents, each of -// which contains an array of safeBags - -// get bags by friendlyName -var bags = p12.getBags({friendlyName: 'test'}); -// bags are key'd by attribute type (here "friendlyName") -// and the key values are an array of matching objects -var cert = bags.friendlyName[0]; - -// get bags by localKeyId -var bags = p12.getBags({localKeyId: buffer}); -// bags are key'd by attribute type (here "localKeyId") -// and the key values are an array of matching objects -var cert = bags.localKeyId[0]; - -// get bags by localKeyId (input in hex) -var bags = p12.getBags({localKeyIdHex: '7b59377ff142d0be4565e9ac3d396c01401cd879'}); -// bags are key'd by attribute type (here "localKeyId", *not* "localKeyIdHex") -// and the key values are an array of matching objects -var cert = bags.localKeyId[0]; - -// get bags by type -var bags = p12.getBags({bagType: forge.pki.oids.certBag}); -// bags are key'd by bagType and each bagType key's value -// is an array of matches (in this case, certificate objects) -var cert = bags[forge.pki.oids.certBag][0]; - -// get bags by friendlyName and filter on bag type -var bags = p12.getBags({ - friendlyName: 'test', - bagType: forge.pki.oids.certBag -}); - -// get key bags -var bags = p12.getBags({bagType: forge.pki.oids.keyBag}); -// get key -var bag = bags[forge.pki.oids.keyBag][0]; -var key = bag.key; -// if the key is in a format unrecognized by forge then -// bag.key will be `null`, use bag.asn1 to get the ASN.1 -// representation of the key -if(bag.key === null) { - var keyAsn1 = bag.asn1; - // can now convert back to DER/PEM/etc for export -} - -// generate a p12 using AES (default) -var p12Asn1 = forge.pkcs12.toPkcs12Asn1( - privateKey, certificateChain, 'password'); - -// generate a p12 that can be imported by Chrome/Firefox/iOS -// (requires the use of Triple DES instead of AES) -var p12Asn1 = forge.pkcs12.toPkcs12Asn1( - privateKey, certificateChain, 'password', - {algorithm: '3des'}); - -// base64-encode p12 -var p12Der = forge.asn1.toDer(p12Asn1).getBytes(); -var p12b64 = forge.util.encode64(p12Der); - -// create download link for p12 -var a = document.createElement('a'); -a.download = 'example.p12'; -a.setAttribute('href', 'data:application/x-pkcs12;base64,' + p12b64); -a.appendChild(document.createTextNode('Download')); -``` - - - -### ASN.1 - -Provides [ASN.1][] DER encoding and decoding. - -__Examples__ - -```js -var asn1 = forge.asn1; - -// create a SubjectPublicKeyInfo -var subjectPublicKeyInfo = - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // AlgorithmIdentifier - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // algorithm - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false, - asn1.oidToDer(pki.oids['rsaEncryption']).getBytes()), - // parameters (null) - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.NULL, false, '') - ]), - // subjectPublicKey - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.BITSTRING, false, [ - // RSAPublicKey - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // modulus (n) - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, - _bnToBytes(key.n)), - // publicExponent (e) - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, - _bnToBytes(key.e)) - ]) - ]) - ]); - -// serialize an ASN.1 object to DER format -var derBuffer = asn1.toDer(subjectPublicKeyInfo); - -// deserialize to an ASN.1 object from a byte buffer filled with DER data -var object = asn1.fromDer(derBuffer); - -// convert an OID dot-separated string to a byte buffer -var derOidBuffer = asn1.oidToDer('1.2.840.113549.1.1.5'); - -// convert a byte buffer with a DER-encoded OID to a dot-separated string -console.log(asn1.derToOid(derOidBuffer)); -// output: 1.2.840.113549.1.1.5 - -// validates that an ASN.1 object matches a particular ASN.1 structure and -// captures data of interest from that structure for easy access -var publicKeyValidator = { - name: 'SubjectPublicKeyInfo', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - captureAsn1: 'subjectPublicKeyInfo', - value: [{ - name: 'SubjectPublicKeyInfo.AlgorithmIdentifier', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - value: [{ - name: 'AlgorithmIdentifier.algorithm', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.OID, - constructed: false, - capture: 'publicKeyOid' - }] - }, { - // subjectPublicKey - name: 'SubjectPublicKeyInfo.subjectPublicKey', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.BITSTRING, - constructed: false, - value: [{ - // RSAPublicKey - name: 'SubjectPublicKeyInfo.subjectPublicKey.RSAPublicKey', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - optional: true, - captureAsn1: 'rsaPublicKey' - }] - }] -}; - -var capture = {}; -var errors = []; -if(!asn1.validate( - publicKeyValidator, subjectPublicKeyInfo, validator, capture, errors)) { - throw 'ASN.1 object is not a SubjectPublicKeyInfo.'; -} -// capture.subjectPublicKeyInfo contains the full ASN.1 object -// capture.rsaPublicKey contains the full ASN.1 object for the RSA public key -// capture.publicKeyOid only contains the value for the OID -var oid = asn1.derToOid(capture.publicKeyOid); -if(oid !== pki.oids['rsaEncryption']) { - throw 'Unsupported OID.'; -} - -// pretty print an ASN.1 object to a string for debugging purposes -asn1.prettyPrint(object); -``` - -Message Digests ----------------- - - - -### SHA1 - -Provides [SHA-1][] message digests. - -__Examples__ - -```js -var md = forge.md.sha1.create(); -md.update('The quick brown fox jumps over the lazy dog'); -console.log(md.digest().toHex()); -// output: 2fd4e1c67a2d28fced849ee1bb76e7391b93eb12 -``` - - - -### SHA256 - -Provides [SHA-256][] message digests. - -__Examples__ - -```js -var md = forge.md.sha256.create(); -md.update('The quick brown fox jumps over the lazy dog'); -console.log(md.digest().toHex()); -// output: d7a8fbb307d7809469ca9abcb0082e4f8d5651e46d3cdb762d02d0bf37c9e592 -``` - - - -### SHA384 - -Provides [SHA-384][] message digests. - -__Examples__ - -```js -var md = forge.md.sha384.create(); -md.update('The quick brown fox jumps over the lazy dog'); -console.log(md.digest().toHex()); -// output: ca737f1014a48f4c0b6dd43cb177b0afd9e5169367544c494011e3317dbf9a509cb1e5dc1e85a941bbee3d7f2afbc9b1 -``` - - - -### SHA512 - -Provides [SHA-512][] message digests. - -__Examples__ - -```js -// SHA-512 -var md = forge.md.sha512.create(); -md.update('The quick brown fox jumps over the lazy dog'); -console.log(md.digest().toHex()); -// output: 07e547d9586f6a73f73fbac0435ed76951218fb7d0c8d788a309d785436bbb642e93a252a954f23912547d1e8a3b5ed6e1bfd7097821233fa0538f3db854fee6 - -// SHA-512/224 -var md = forge.md.sha512.sha224.create(); -md.update('The quick brown fox jumps over the lazy dog'); -console.log(md.digest().toHex()); -// output: 944cd2847fb54558d4775db0485a50003111c8e5daa63fe722c6aa37 - -// SHA-512/256 -var md = forge.md.sha512.sha256.create(); -md.update('The quick brown fox jumps over the lazy dog'); -console.log(md.digest().toHex()); -// output: dd9d67b371519c339ed8dbd25af90e976a1eeefd4ad3d889005e532fc5bef04d -``` - - - -### MD5 - -Provides [MD5][] message digests. - -__Examples__ - -```js -var md = forge.md.md5.create(); -md.update('The quick brown fox jumps over the lazy dog'); -console.log(md.digest().toHex()); -// output: 9e107d9d372bb6826bd81d3542a419d6 -``` - - - -### HMAC - -Provides [HMAC][] w/any supported message digest algorithm. - -__Examples__ - -```js -var hmac = forge.hmac.create(); -hmac.start('sha1', 'Jefe'); -hmac.update('what do ya want for nothing?'); -console.log(hmac.digest().toHex()); -// output: effcdf6ae5eb2fa2d27416d5f184df9c259a7c79 -``` - -Utilities ---------- - - - -### Prime - -Provides an API for generating large, random, probable primes. - -__Examples__ - -```js -// generate a random prime on the main JS thread -var bits = 1024; -forge.prime.generateProbablePrime(bits, function(err, num) { - console.log('random prime', num.toString(16)); -}); - -// generate a random prime using Web Workers (if available, otherwise -// falls back to the main thread) -var bits = 1024; -var options = { - algorithm: { - name: 'PRIMEINC', - workers: -1 // auto-optimize # of workers - } -}; -forge.prime.generateProbablePrime(bits, options, function(err, num) { - console.log('random prime', num.toString(16)); -}); -``` - - - -### PRNG - -Provides a [Fortuna][]-based cryptographically-secure pseudo-random number -generator, to be used with a cryptographic function backend, e.g. [AES][]. An -implementation using [AES][] as a backend is provided. An API for collecting -entropy is given, though if window.crypto.getRandomValues is available, it will -be used automatically. - -__Examples__ - -```js -// get some random bytes synchronously -var bytes = forge.random.getBytesSync(32); -console.log(forge.util.bytesToHex(bytes)); - -// get some random bytes asynchronously -forge.random.getBytes(32, function(err, bytes) { - console.log(forge.util.bytesToHex(bytes)); -}); - -// collect some entropy if you'd like -forge.random.collect(someRandomBytes); -jQuery().mousemove(function(e) { - forge.random.collectInt(e.clientX, 16); - forge.random.collectInt(e.clientY, 16); -}); - -// specify a seed file for use with the synchronous API if you'd like -forge.random.seedFileSync = function(needed) { - // get 'needed' number of random bytes from somewhere - return fetchedRandomBytes; -}; - -// specify a seed file for use with the asynchronous API if you'd like -forge.random.seedFile = function(needed, callback) { - // get the 'needed' number of random bytes from somewhere - callback(null, fetchedRandomBytes); -}); - -// register the main thread to send entropy or a Web Worker to receive -// entropy on demand from the main thread -forge.random.registerWorker(self); - -// generate a new instance of a PRNG with no collected entropy -var myPrng = forge.random.createInstance(); -``` - - - -### Tasks - -Provides queuing and synchronizing tasks in a web application. - -__Examples__ - -```js -// TODO -``` - - - -### Utilities - -Provides utility functions, including byte buffer support, base64, -bytes to/from hex, zlib inflate/deflate, etc. - -__Examples__ - -```js -// encode/decode base64 -var encoded = forge.util.encode64(str); -var str = forge.util.decode64(encoded); - -// encode/decode UTF-8 -var encoded = forge.util.encodeUtf8(str); -var str = forge.util.decodeUtf8(encoded); - -// bytes to/from hex -var bytes = forge.util.hexToBytes(hex); -var hex = forge.util.bytesToHex(bytes); - -// create an empty byte buffer -var buffer = forge.util.createBuffer(); -// create a byte buffer from raw binary bytes -var buffer = forge.util.createBuffer(input, 'raw'); -// create a byte buffer from utf8 bytes -var buffer = forge.util.createBuffer(input, 'utf8'); - -// get the length of the buffer in bytes -buffer.length(); -// put bytes into the buffer -buffer.putBytes(bytes); -// put a 32-bit integer into the buffer -buffer.putInt32(10); -// buffer to hex -buffer.toHex(); -// get a copy of the bytes in the buffer -bytes.bytes(/* count */); -// empty this buffer and get its contents -bytes.getBytes(/* count */); - -// convert a forge buffer into a Node.js Buffer -// make sure you specify the encoding as 'binary' -var forgeBuffer = forge.util.createBuffer(); -var nodeBuffer = Buffer.from(forgeBuffer.getBytes(), 'binary'); - -// convert a Node.js Buffer into a forge buffer -// make sure you specify the encoding as 'binary' -var nodeBuffer = Buffer.from('CAFE', 'hex'); -var forgeBuffer = forge.util.createBuffer(nodeBuffer.toString('binary')); -``` - - - -### Logging - -Provides logging to a javascript console using various categories and -levels of verbosity. - -__Examples__ - -```js -// TODO -``` - - - -### Flash Networking Support - -The [flash README](./flash/README.md) provides details on rebuilding the -optional Flash component used for networking. It also provides details on -Policy Server support. - -Security Considerations ------------------------ - -When using this code please keep the following in mind: - -- Cryptography is hard. Please review and test this code before depending on it - for critical functionality. -- The nature of JavaScript is that execution of this code depends on trusting a - very large set of JavaScript tools and systems. Consider runtime variations, - runtime characteristics, runtime optimization, code optimization, code - minimization, code obfuscation, bundling tools, possible bugs, the Forge code - itself, and so on. -- If using pre-built bundles from [NPM][], another CDN, or similar, be aware - someone else ran the tools to create those files. -- Use a secure transport channel such as [TLS][] to load scripts and consider - using additional security mechanisms such as [Subresource Integrity][] script - attributes. -- Use "native" functionality where possible. This can be critical when dealing - with performance and random number generation. Note that the JavaScript - random number algorithms should perform well if given suitable entropy. -- Understand possible attacks against cryptographic systems. For instance side - channel and timing attacks may be possible due to the difficulty in - implementing constant time algorithms in pure JavaScript. -- Certain features in this library are less susceptible to attacks depending on - usage. This primarily includes features that deal with data format - manipulation or those that are not involved in communication. - -Library Background ------------------- - -* https://digitalbazaar.com/2010/07/20/javascript-tls-1/ -* https://digitalbazaar.com/2010/07/20/javascript-tls-2/ - -Contact -------- - -* Code: https://github.com/digitalbazaar/forge -* Bugs: https://github.com/digitalbazaar/forge/issues -* Email: support@digitalbazaar.com -* IRC: [#forgejs][] on [Libera.Chat][] (people may also be on [freenode][] for - historical reasons). - -Donations ---------- - -Financial support is welcome and helps contribute to futher development: - -* For [PayPal][] please send to paypal@digitalbazaar.com. -* Something else? Please contact support@digitalbazaar.com. - -[#forgejs]: https://webchat.freenode.net/?channels=#forgejs -[0.6.x]: https://github.com/digitalbazaar/forge/tree/0.6.x -[3DES]: https://en.wikipedia.org/wiki/Triple_DES -[AES]: https://en.wikipedia.org/wiki/Advanced_Encryption_Standard -[ASN.1]: https://en.wikipedia.org/wiki/ASN.1 -[Browserify]: http://browserify.org/ -[CBC]: https://en.wikipedia.org/wiki/Block_cipher_mode_of_operation -[CFB]: https://en.wikipedia.org/wiki/Block_cipher_mode_of_operation -[CTR]: https://en.wikipedia.org/wiki/Block_cipher_mode_of_operation -[CommonJS]: https://en.wikipedia.org/wiki/CommonJS -[DES]: https://en.wikipedia.org/wiki/Data_Encryption_Standard -[ECB]: https://en.wikipedia.org/wiki/Block_cipher_mode_of_operation -[Fortuna]: https://en.wikipedia.org/wiki/Fortuna_(PRNG) -[GCM]: https://en.wikipedia.org/wiki/GCM_mode -[HMAC]: https://en.wikipedia.org/wiki/HMAC -[JavaScript]: https://en.wikipedia.org/wiki/JavaScript -[Karma]: https://karma-runner.github.io/ -[Libera.Chat]: https://libera.chat/ -[MD5]: https://en.wikipedia.org/wiki/MD5 -[NPM]: https://www.npmjs.com/ -[Node.js]: https://nodejs.org/ -[OFB]: https://en.wikipedia.org/wiki/Block_cipher_mode_of_operation -[PKCS#10]: https://en.wikipedia.org/wiki/Certificate_signing_request -[PKCS#12]: https://en.wikipedia.org/wiki/PKCS_%E2%99%AF12 -[PKCS#5]: https://en.wikipedia.org/wiki/PKCS -[PKCS#7]: https://en.wikipedia.org/wiki/Cryptographic_Message_Syntax -[PayPal]: https://www.paypal.com/ -[RC2]: https://en.wikipedia.org/wiki/RC2 -[SHA-1]: https://en.wikipedia.org/wiki/SHA-1 -[SHA-256]: https://en.wikipedia.org/wiki/SHA-256 -[SHA-384]: https://en.wikipedia.org/wiki/SHA-384 -[SHA-512]: https://en.wikipedia.org/wiki/SHA-512 -[Subresource Integrity]: https://www.w3.org/TR/SRI/ -[TLS]: https://en.wikipedia.org/wiki/Transport_Layer_Security -[UMD]: https://github.com/umdjs/umd -[X.509]: https://en.wikipedia.org/wiki/X.509 -[freenode]: https://freenode.net/ -[unpkg]: https://unpkg.com/ -[webpack]: https://webpack.github.io/ -[TweetNaCl.js]: https://github.com/dchest/tweetnacl-js diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/dist/forge.all.min.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/dist/forge.all.min.js deleted file mode 100644 index 65dccf27..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/dist/forge.all.min.js +++ /dev/null @@ -1,2 +0,0 @@ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.forge=t():e.forge=t()}(window,(function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var a=t[n]={i:n,l:!1,exports:{}};return e[n].call(a.exports,a,a.exports,r),a.l=!0,a.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)r.d(n,a,function(t){return e[t]}.bind(null,a));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=34)}([function(e,t){e.exports={options:{usePureJavaScript:!1}}},function(e,t,r){(function(t){var n=r(0),a=r(38),i=e.exports=n.util=n.util||{};function s(e){if(8!==e&&16!==e&&24!==e&&32!==e)throw new Error("Only 8, 16, 24, or 32 bits supported: "+e)}function o(e){if(this.data="",this.read=0,"string"==typeof e)this.data=e;else if(i.isArrayBuffer(e)||i.isArrayBufferView(e))if("undefined"!=typeof Buffer&&e instanceof Buffer)this.data=e.toString("binary");else{var t=new Uint8Array(e);try{this.data=String.fromCharCode.apply(null,t)}catch(e){for(var r=0;r15?(r=Date.now(),s(e)):(t.push(e),1===t.length&&a.setAttribute("a",n=!n))}}i.nextTick=i.setImmediate}(),i.isNodejs="undefined"!=typeof process&&process.versions&&process.versions.node,i.globalScope=i.isNodejs?t:"undefined"==typeof self?window:self,i.isArray=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},i.isArrayBuffer=function(e){return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer},i.isArrayBufferView=function(e){return e&&i.isArrayBuffer(e.buffer)&&void 0!==e.byteLength},i.ByteBuffer=o,i.ByteStringBuffer=o;i.ByteStringBuffer.prototype._optimizeConstructedString=function(e){this._constructedStringLength+=e,this._constructedStringLength>4096&&(this.data.substr(0,1),this._constructedStringLength=0)},i.ByteStringBuffer.prototype.length=function(){return this.data.length-this.read},i.ByteStringBuffer.prototype.isEmpty=function(){return this.length()<=0},i.ByteStringBuffer.prototype.putByte=function(e){return this.putBytes(String.fromCharCode(e))},i.ByteStringBuffer.prototype.fillWithByte=function(e,t){e=String.fromCharCode(e);for(var r=this.data;t>0;)1&t&&(r+=e),(t>>>=1)>0&&(e+=e);return this.data=r,this._optimizeConstructedString(t),this},i.ByteStringBuffer.prototype.putBytes=function(e){return this.data+=e,this._optimizeConstructedString(e.length),this},i.ByteStringBuffer.prototype.putString=function(e){return this.putBytes(i.encodeUtf8(e))},i.ByteStringBuffer.prototype.putInt16=function(e){return this.putBytes(String.fromCharCode(e>>8&255)+String.fromCharCode(255&e))},i.ByteStringBuffer.prototype.putInt24=function(e){return this.putBytes(String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(255&e))},i.ByteStringBuffer.prototype.putInt32=function(e){return this.putBytes(String.fromCharCode(e>>24&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(255&e))},i.ByteStringBuffer.prototype.putInt16Le=function(e){return this.putBytes(String.fromCharCode(255&e)+String.fromCharCode(e>>8&255))},i.ByteStringBuffer.prototype.putInt24Le=function(e){return this.putBytes(String.fromCharCode(255&e)+String.fromCharCode(e>>8&255)+String.fromCharCode(e>>16&255))},i.ByteStringBuffer.prototype.putInt32Le=function(e){return this.putBytes(String.fromCharCode(255&e)+String.fromCharCode(e>>8&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>24&255))},i.ByteStringBuffer.prototype.putInt=function(e,t){s(t);var r="";do{t-=8,r+=String.fromCharCode(e>>t&255)}while(t>0);return this.putBytes(r)},i.ByteStringBuffer.prototype.putSignedInt=function(e,t){return e<0&&(e+=2<0);return t},i.ByteStringBuffer.prototype.getSignedInt=function(e){var t=this.getInt(e),r=2<=r&&(t-=r<<1),t},i.ByteStringBuffer.prototype.getBytes=function(e){var t;return e?(e=Math.min(this.length(),e),t=this.data.slice(this.read,this.read+e),this.read+=e):0===e?t="":(t=0===this.read?this.data:this.data.slice(this.read),this.clear()),t},i.ByteStringBuffer.prototype.bytes=function(e){return void 0===e?this.data.slice(this.read):this.data.slice(this.read,this.read+e)},i.ByteStringBuffer.prototype.at=function(e){return this.data.charCodeAt(this.read+e)},i.ByteStringBuffer.prototype.setAt=function(e,t){return this.data=this.data.substr(0,this.read+e)+String.fromCharCode(t)+this.data.substr(this.read+e+1),this},i.ByteStringBuffer.prototype.last=function(){return this.data.charCodeAt(this.data.length-1)},i.ByteStringBuffer.prototype.copy=function(){var e=i.createBuffer(this.data);return e.read=this.read,e},i.ByteStringBuffer.prototype.compact=function(){return this.read>0&&(this.data=this.data.slice(this.read),this.read=0),this},i.ByteStringBuffer.prototype.clear=function(){return this.data="",this.read=0,this},i.ByteStringBuffer.prototype.truncate=function(e){var t=Math.max(0,this.length()-e);return this.data=this.data.substr(this.read,t),this.read=0,this},i.ByteStringBuffer.prototype.toHex=function(){for(var e="",t=this.read;t=e)return this;t=Math.max(t||this.growSize,e);var r=new Uint8Array(this.data.buffer,this.data.byteOffset,this.data.byteLength),n=new Uint8Array(this.length()+t);return n.set(r),this.data=new DataView(n.buffer),this},i.DataBuffer.prototype.putByte=function(e){return this.accommodate(1),this.data.setUint8(this.write++,e),this},i.DataBuffer.prototype.fillWithByte=function(e,t){this.accommodate(t);for(var r=0;r>8&65535),this.data.setInt8(this.write,e>>16&255),this.write+=3,this},i.DataBuffer.prototype.putInt32=function(e){return this.accommodate(4),this.data.setInt32(this.write,e),this.write+=4,this},i.DataBuffer.prototype.putInt16Le=function(e){return this.accommodate(2),this.data.setInt16(this.write,e,!0),this.write+=2,this},i.DataBuffer.prototype.putInt24Le=function(e){return this.accommodate(3),this.data.setInt8(this.write,e>>16&255),this.data.setInt16(this.write,e>>8&65535,!0),this.write+=3,this},i.DataBuffer.prototype.putInt32Le=function(e){return this.accommodate(4),this.data.setInt32(this.write,e,!0),this.write+=4,this},i.DataBuffer.prototype.putInt=function(e,t){s(t),this.accommodate(t/8);do{t-=8,this.data.setInt8(this.write++,e>>t&255)}while(t>0);return this},i.DataBuffer.prototype.putSignedInt=function(e,t){return s(t),this.accommodate(t/8),e<0&&(e+=2<0);return t},i.DataBuffer.prototype.getSignedInt=function(e){var t=this.getInt(e),r=2<=r&&(t-=r<<1),t},i.DataBuffer.prototype.getBytes=function(e){var t;return e?(e=Math.min(this.length(),e),t=this.data.slice(this.read,this.read+e),this.read+=e):0===e?t="":(t=0===this.read?this.data:this.data.slice(this.read),this.clear()),t},i.DataBuffer.prototype.bytes=function(e){return void 0===e?this.data.slice(this.read):this.data.slice(this.read,this.read+e)},i.DataBuffer.prototype.at=function(e){return this.data.getUint8(this.read+e)},i.DataBuffer.prototype.setAt=function(e,t){return this.data.setUint8(e,t),this},i.DataBuffer.prototype.last=function(){return this.data.getUint8(this.write-1)},i.DataBuffer.prototype.copy=function(){return new i.DataBuffer(this)},i.DataBuffer.prototype.compact=function(){if(this.read>0){var e=new Uint8Array(this.data.buffer,this.read),t=new Uint8Array(e.byteLength);t.set(e),this.data=new DataView(t),this.write-=this.read,this.read=0}return this},i.DataBuffer.prototype.clear=function(){return this.data=new DataView(new ArrayBuffer(0)),this.read=this.write=0,this},i.DataBuffer.prototype.truncate=function(e){return this.write=Math.max(0,this.length()-e),this.read=Math.min(this.read,this.write),this},i.DataBuffer.prototype.toHex=function(){for(var e="",t=this.read;t0;)1&t&&(r+=e),(t>>>=1)>0&&(e+=e);return r},i.xorBytes=function(e,t,r){for(var n="",a="",i="",s=0,o=0;r>0;--r,++s)a=e.charCodeAt(s)^t.charCodeAt(s),o>=10&&(n+=i,i="",o=0),i+=String.fromCharCode(a),++o;return n+=i},i.hexToBytes=function(e){var t="",r=0;for(!0&e.length&&(r=1,t+=String.fromCharCode(parseInt(e[0],16)));r>24&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(255&e)};var c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",u=[62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,64,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51],l="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";i.encode64=function(e,t){for(var r,n,a,i="",s="",o=0;o>2),i+=c.charAt((3&r)<<4|n>>4),isNaN(n)?i+="==":(i+=c.charAt((15&n)<<2|a>>6),i+=isNaN(a)?"=":c.charAt(63&a)),t&&i.length>t&&(s+=i.substr(0,t)+"\r\n",i=i.substr(t));return s+=i},i.decode64=function(e){e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var t,r,n,a,i="",s=0;s>4),64!==n&&(i+=String.fromCharCode((15&r)<<4|n>>2),64!==a&&(i+=String.fromCharCode((3&n)<<6|a)));return i},i.encodeUtf8=function(e){return unescape(encodeURIComponent(e))},i.decodeUtf8=function(e){return decodeURIComponent(escape(e))},i.binary={raw:{},hex:{},base64:{},base58:{},baseN:{encode:a.encode,decode:a.decode}},i.binary.raw.encode=function(e){return String.fromCharCode.apply(null,e)},i.binary.raw.decode=function(e,t,r){var n=t;n||(n=new Uint8Array(e.length));for(var a=r=r||0,i=0;i>2),i+=c.charAt((3&r)<<4|n>>4),isNaN(n)?i+="==":(i+=c.charAt((15&n)<<2|a>>6),i+=isNaN(a)?"=":c.charAt(63&a)),t&&i.length>t&&(s+=i.substr(0,t)+"\r\n",i=i.substr(t));return s+=i},i.binary.base64.decode=function(e,t,r){var n,a,i,s,o=t;o||(o=new Uint8Array(3*Math.ceil(e.length/4))),e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var c=0,l=r=r||0;c>4,64!==i&&(o[l++]=(15&a)<<4|i>>2,64!==s&&(o[l++]=(3&i)<<6|s));return t?l-r:o.subarray(0,l)},i.binary.base58.encode=function(e,t){return i.binary.baseN.encode(e,l,t)},i.binary.base58.decode=function(e,t){return i.binary.baseN.decode(e,l,t)},i.text={utf8:{},utf16:{}},i.text.utf8.encode=function(e,t,r){e=i.encodeUtf8(e);var n=t;n||(n=new Uint8Array(e.length));for(var a=r=r||0,s=0;s0&&i.push(r),s=n.lastIndex;var o=t[0][1];switch(o){case"s":case"o":a");break;case"%":i.push("%");break;default:i.push("<%"+o+"?>")}}return i.push(e.substring(s)),i.join("")},i.formatNumber=function(e,t,r,n){var a=e,i=isNaN(t=Math.abs(t))?2:t,s=void 0===r?",":r,o=void 0===n?".":n,c=a<0?"-":"",u=parseInt(a=Math.abs(+a||0).toFixed(i),10)+"",l=u.length>3?u.length%3:0;return c+(l?u.substr(0,l)+o:"")+u.substr(l).replace(/(\d{3})(?=\d)/g,"$1"+o)+(i?s+Math.abs(a-u).toFixed(i).slice(2):"")},i.formatSize=function(e){return e=e>=1073741824?i.formatNumber(e/1073741824,2,".","")+" GiB":e>=1048576?i.formatNumber(e/1048576,2,".","")+" MiB":e>=1024?i.formatNumber(e/1024,0)+" KiB":i.formatNumber(e,0)+" bytes"},i.bytesFromIP=function(e){return-1!==e.indexOf(".")?i.bytesFromIPv4(e):-1!==e.indexOf(":")?i.bytesFromIPv6(e):null},i.bytesFromIPv4=function(e){if(4!==(e=e.split(".")).length)return null;for(var t=i.createBuffer(),r=0;rr[n].end-r[n].start&&(n=r.length-1)):r.push({start:c,end:c})}t.push(s)}if(r.length>0){var u=r[n];u.end-u.start>0&&(t.splice(u.start,u.end-u.start+1,""),0===u.start&&t.unshift(""),7===u.end&&t.push(""))}return t.join(":")},i.estimateCores=function(e,t){if("function"==typeof e&&(t=e,e={}),e=e||{},"cores"in i&&!e.update)return t(null,i.cores);if("undefined"!=typeof navigator&&"hardwareConcurrency"in navigator&&navigator.hardwareConcurrency>0)return i.cores=navigator.hardwareConcurrency,t(null,i.cores);if("undefined"==typeof Worker)return i.cores=1,t(null,i.cores);if("undefined"==typeof Blob)return i.cores=2,t(null,i.cores);var r=URL.createObjectURL(new Blob(["(",function(){self.addEventListener("message",(function(e){for(var t=Date.now(),r=t+4;Date.now()o.st&&a.sta.st&&o.stt){var n=new Error("Too few bytes to parse DER.");throw n.available=e.length(),n.remaining=t,n.requested=r,n}}a.Class={UNIVERSAL:0,APPLICATION:64,CONTEXT_SPECIFIC:128,PRIVATE:192},a.Type={NONE:0,BOOLEAN:1,INTEGER:2,BITSTRING:3,OCTETSTRING:4,NULL:5,OID:6,ODESC:7,EXTERNAL:8,REAL:9,ENUMERATED:10,EMBEDDED:11,UTF8:12,ROID:13,SEQUENCE:16,SET:17,PRINTABLESTRING:19,IA5STRING:22,UTCTIME:23,GENERALIZEDTIME:24,BMPSTRING:30},a.create=function(e,t,r,i,s){if(n.util.isArray(i)){for(var o=[],c=0;cr){if(s.strict){var d=new Error("Too few bytes to read ASN.1 value.");throw d.available=t.length(),d.remaining=r,d.requested=h,d}h=r}var y=32==(32&c);if(y)if(p=[],void 0===h)for(;;){if(i(t,r,2),t.bytes(2)===String.fromCharCode(0,0)){t.getBytes(2),r-=2;break}o=t.length(),p.push(e(t,r,n+1,s)),r-=o-t.length()}else for(;h>0;)o=t.length(),p.push(e(t,h,n+1,s)),r-=o-t.length(),h-=o-t.length();void 0===p&&u===a.Class.UNIVERSAL&&l===a.Type.BITSTRING&&(f=t.bytes(h));if(void 0===p&&s.decodeBitStrings&&u===a.Class.UNIVERSAL&&l===a.Type.BITSTRING&&h>1){var g=t.read,v=r,m=0;if(l===a.Type.BITSTRING&&(i(t,r,1),m=t.getByte(),r--),0===m)try{o=t.length();var C=e(t,r,n+1,{strict:!0,decodeBitStrings:!0}),E=o-t.length();r-=E,l==a.Type.BITSTRING&&E++;var S=C.tagClass;E!==h||S!==a.Class.UNIVERSAL&&S!==a.Class.CONTEXT_SPECIFIC||(p=[C])}catch(e){}void 0===p&&(t.read=g,r=v)}if(void 0===p){if(void 0===h){if(s.strict)throw new Error("Non-constructed ASN.1 object of indefinite length.");h=r}if(l===a.Type.BMPSTRING)for(p="";h>0;h-=2)i(t,r,2),p+=String.fromCharCode(t.getInt16()),r-=2;else p=t.getBytes(h),r-=h}var T=void 0===f?null:{bitStringContents:f};return a.create(u,l,y,p,T)}(e,e.length(),0,t);if(t.parseAllBytes&&0!==e.length()){var o=new Error("Unparsed DER bytes remain after ASN.1 parsing.");throw o.byteCount=r,o.remaining=e.length(),o}return s},a.toDer=function(e){var t=n.util.createBuffer(),r=e.tagClass|e.type,i=n.util.createBuffer(),s=!1;if("bitStringContents"in e&&(s=!0,e.original&&(s=a.equals(e,e.original))),s)i.putBytes(e.bitStringContents);else if(e.composed){e.constructed?r|=32:i.putByte(0);for(var o=0;o1&&(0===e.value.charCodeAt(0)&&0==(128&e.value.charCodeAt(1))||255===e.value.charCodeAt(0)&&128==(128&e.value.charCodeAt(1)))?i.putBytes(e.value.substr(1)):i.putBytes(e.value);if(t.putByte(r),i.length()<=127)t.putByte(127&i.length());else{var c=i.length(),u="";do{u+=String.fromCharCode(255&c),c>>>=8}while(c>0);t.putByte(128|u.length);for(o=u.length-1;o>=0;--o)t.putByte(u.charCodeAt(o))}return t.putBuffer(i),t},a.oidToDer=function(e){var t,r,a,i,s=e.split("."),o=n.util.createBuffer();o.putByte(40*parseInt(s[0],10)+parseInt(s[1],10));for(var c=2;c>>=7,t||(i|=128),r.push(i),t=!1}while(a>0);for(var u=r.length-1;u>=0;--u)o.putByte(r[u])}return o},a.derToOid=function(e){var t;"string"==typeof e&&(e=n.util.createBuffer(e));var r=e.getByte();t=Math.floor(r/40)+"."+r%40;for(var a=0;e.length()>0;)a<<=7,128&(r=e.getByte())?a+=127&r:(t+="."+(a+r),a=0);return t},a.utcTimeToDate=function(e){var t=new Date,r=parseInt(e.substr(0,2),10);r=r>=50?1900+r:2e3+r;var n=parseInt(e.substr(2,2),10)-1,a=parseInt(e.substr(4,2),10),i=parseInt(e.substr(6,2),10),s=parseInt(e.substr(8,2),10),o=0;if(e.length>11){var c=e.charAt(10),u=10;"+"!==c&&"-"!==c&&(o=parseInt(e.substr(10,2),10),u+=2)}if(t.setUTCFullYear(r,n,a),t.setUTCHours(i,s,o,0),u&&("+"===(c=e.charAt(u))||"-"===c)){var l=60*parseInt(e.substr(u+1,2),10)+parseInt(e.substr(u+4,2),10);l*=6e4,"+"===c?t.setTime(+t-l):t.setTime(+t+l)}return t},a.generalizedTimeToDate=function(e){var t=new Date,r=parseInt(e.substr(0,4),10),n=parseInt(e.substr(4,2),10)-1,a=parseInt(e.substr(6,2),10),i=parseInt(e.substr(8,2),10),s=parseInt(e.substr(10,2),10),o=parseInt(e.substr(12,2),10),c=0,u=0,l=!1;"Z"===e.charAt(e.length-1)&&(l=!0);var p=e.length-5,f=e.charAt(p);"+"!==f&&"-"!==f||(u=60*parseInt(e.substr(p+1,2),10)+parseInt(e.substr(p+4,2),10),u*=6e4,"+"===f&&(u*=-1),l=!0);return"."===e.charAt(14)&&(c=1e3*parseFloat(e.substr(14),10)),l?(t.setUTCFullYear(r,n,a),t.setUTCHours(i,s,o,c),t.setTime(+t+u)):(t.setFullYear(r,n,a),t.setHours(i,s,o,c)),t},a.dateToUtcTime=function(e){if("string"==typeof e)return e;var t="",r=[];r.push((""+e.getUTCFullYear()).substr(2)),r.push(""+(e.getUTCMonth()+1)),r.push(""+e.getUTCDate()),r.push(""+e.getUTCHours()),r.push(""+e.getUTCMinutes()),r.push(""+e.getUTCSeconds());for(var n=0;n=-128&&e<128)return t.putSignedInt(e,8);if(e>=-32768&&e<32768)return t.putSignedInt(e,16);if(e>=-8388608&&e<8388608)return t.putSignedInt(e,24);if(e>=-2147483648&&e<2147483648)return t.putSignedInt(e,32);var r=new Error("Integer too large; max is 32-bits.");throw r.integer=e,r},a.derToInteger=function(e){"string"==typeof e&&(e=n.util.createBuffer(e));var t=8*e.length();if(t>32)throw new Error("Integer too large; max is 32-bits.");return e.getSignedInt(t)},a.validate=function(e,t,r,i){var s=!1;if(e.tagClass!==t.tagClass&&void 0!==t.tagClass||e.type!==t.type&&void 0!==t.type)i&&(e.tagClass!==t.tagClass&&i.push("["+t.name+'] Expected tag class "'+t.tagClass+'", got "'+e.tagClass+'"'),e.type!==t.type&&i.push("["+t.name+'] Expected type "'+t.type+'", got "'+e.type+'"'));else if(e.constructed===t.constructed||void 0===t.constructed){if(s=!0,t.value&&n.util.isArray(t.value))for(var o=0,c=0;s&&c0&&(i+="\n");for(var o="",c=0;c1?i+="0x"+n.util.bytesToHex(e.value.slice(1)):i+="(none)",e.value.length>0){var f=e.value.charCodeAt(0);1==f?i+=" (1 unused bit shown)":f>1&&(i+=" ("+f+" unused bits shown)")}}else if(e.type===a.Type.OCTETSTRING)s.test(e.value)||(i+="("+e.value+") "),i+="0x"+n.util.bytesToHex(e.value);else if(e.type===a.Type.UTF8)try{i+=n.util.decodeUtf8(e.value)}catch(t){if("URI malformed"!==t.message)throw t;i+="0x"+n.util.bytesToHex(e.value)+" (malformed UTF8)"}else e.type===a.Type.PRINTABLESTRING||e.type===a.Type.IA5String?i+=e.value:s.test(e.value)?i+="0x"+n.util.bytesToHex(e.value):0===e.value.length?i+="[null]":i+=e.value}return i}},function(e,t,r){var n=r(0);e.exports=n.md=n.md||{},n.md.algorithms=n.md.algorithms||{}},function(e,t,r){var n=r(0);function a(e,t){n.cipher.registerAlgorithm(e,(function(){return new n.aes.Algorithm(e,t)}))}r(14),r(20),r(1),e.exports=n.aes=n.aes||{},n.aes.startEncrypting=function(e,t,r,n){var a=d({key:e,output:r,decrypt:!1,mode:n});return a.start(t),a},n.aes.createEncryptionCipher=function(e,t){return d({key:e,output:null,decrypt:!1,mode:t})},n.aes.startDecrypting=function(e,t,r,n){var a=d({key:e,output:r,decrypt:!0,mode:n});return a.start(t),a},n.aes.createDecryptionCipher=function(e,t){return d({key:e,output:null,decrypt:!0,mode:t})},n.aes.Algorithm=function(e,t){l||p();var r=this;r.name=e,r.mode=new t({blockSize:16,cipher:{encrypt:function(e,t){return h(r._w,e,t,!1)},decrypt:function(e,t){return h(r._w,e,t,!0)}}}),r._init=!1},n.aes.Algorithm.prototype.initialize=function(e){if(!this._init){var t,r=e.key;if("string"!=typeof r||16!==r.length&&24!==r.length&&32!==r.length){if(n.util.isArray(r)&&(16===r.length||24===r.length||32===r.length)){t=r,r=n.util.createBuffer();for(var a=0;a>>=2;for(a=0;a>8^255&p^99,i[y]=p,s[p]=y,h=(f=e[p])<<24^p<<16^p<<8^p^f,d=((r=e[y])^(n=e[r])^(a=e[n]))<<24^(y^a)<<16^(y^n^a)<<8^y^r^a;for(var v=0;v<4;++v)c[v][y]=h,u[v][p]=d,h=h<<24|h>>>8,d=d<<24|d>>>8;0===y?y=g=1:(y=r^e[e[e[r^a]]],g^=e[e[g]])}}function f(e,t){for(var r,n=e.slice(0),a=1,s=n.length,c=4*(s+6+1),l=s;l>>16&255]<<24^i[r>>>8&255]<<16^i[255&r]<<8^i[r>>>24]^o[a]<<24,a++):s>6&&l%s==4&&(r=i[r>>>24]<<24^i[r>>>16&255]<<16^i[r>>>8&255]<<8^i[255&r]),n[l]=n[l-s]^r;if(t){for(var p,f=u[0],h=u[1],d=u[2],y=u[3],g=n.slice(0),v=(l=0,(c=n.length)-4);l>>24]]^h[i[p>>>16&255]]^d[i[p>>>8&255]]^y[i[255&p]];n=g}return n}function h(e,t,r,n){var a,o,l,p,f,h,d,y,g,v,m,C,E=e.length/4-1;n?(a=u[0],o=u[1],l=u[2],p=u[3],f=s):(a=c[0],o=c[1],l=c[2],p=c[3],f=i),h=t[0]^e[0],d=t[n?3:1]^e[1],y=t[2]^e[2],g=t[n?1:3]^e[3];for(var S=3,T=1;T>>24]^o[d>>>16&255]^l[y>>>8&255]^p[255&g]^e[++S],m=a[d>>>24]^o[y>>>16&255]^l[g>>>8&255]^p[255&h]^e[++S],C=a[y>>>24]^o[g>>>16&255]^l[h>>>8&255]^p[255&d]^e[++S],g=a[g>>>24]^o[h>>>16&255]^l[d>>>8&255]^p[255&y]^e[++S],h=v,d=m,y=C;r[0]=f[h>>>24]<<24^f[d>>>16&255]<<16^f[y>>>8&255]<<8^f[255&g]^e[++S],r[n?3:1]=f[d>>>24]<<24^f[y>>>16&255]<<16^f[g>>>8&255]<<8^f[255&h]^e[++S],r[2]=f[y>>>24]<<24^f[g>>>16&255]<<16^f[h>>>8&255]<<8^f[255&d]^e[++S],r[n?1:3]=f[g>>>24]<<24^f[h>>>16&255]<<16^f[d>>>8&255]<<8^f[255&y]^e[++S]}function d(e){var t,r="AES-"+((e=e||{}).mode||"CBC").toUpperCase(),a=(t=e.decrypt?n.cipher.createDecipher(r,e.key):n.cipher.createCipher(r,e.key)).start;return t.start=function(e,r){var i=null;r instanceof n.util.ByteBuffer&&(i=r,r={}),(r=r||{}).output=i,r.iv=e,a.call(t,r)},t}},function(e,t,r){var n=r(0);n.pki=n.pki||{};var a=e.exports=n.pki.oids=n.oids=n.oids||{};function i(e,t){a[e]=t,a[t]=e}function s(e,t){a[e]=t}i("1.2.840.113549.1.1.1","rsaEncryption"),i("1.2.840.113549.1.1.4","md5WithRSAEncryption"),i("1.2.840.113549.1.1.5","sha1WithRSAEncryption"),i("1.2.840.113549.1.1.7","RSAES-OAEP"),i("1.2.840.113549.1.1.8","mgf1"),i("1.2.840.113549.1.1.9","pSpecified"),i("1.2.840.113549.1.1.10","RSASSA-PSS"),i("1.2.840.113549.1.1.11","sha256WithRSAEncryption"),i("1.2.840.113549.1.1.12","sha384WithRSAEncryption"),i("1.2.840.113549.1.1.13","sha512WithRSAEncryption"),i("1.3.101.112","EdDSA25519"),i("1.2.840.10040.4.3","dsa-with-sha1"),i("1.3.14.3.2.7","desCBC"),i("1.3.14.3.2.26","sha1"),i("1.3.14.3.2.29","sha1WithRSASignature"),i("2.16.840.1.101.3.4.2.1","sha256"),i("2.16.840.1.101.3.4.2.2","sha384"),i("2.16.840.1.101.3.4.2.3","sha512"),i("2.16.840.1.101.3.4.2.4","sha224"),i("2.16.840.1.101.3.4.2.5","sha512-224"),i("2.16.840.1.101.3.4.2.6","sha512-256"),i("1.2.840.113549.2.2","md2"),i("1.2.840.113549.2.5","md5"),i("1.2.840.113549.1.7.1","data"),i("1.2.840.113549.1.7.2","signedData"),i("1.2.840.113549.1.7.3","envelopedData"),i("1.2.840.113549.1.7.4","signedAndEnvelopedData"),i("1.2.840.113549.1.7.5","digestedData"),i("1.2.840.113549.1.7.6","encryptedData"),i("1.2.840.113549.1.9.1","emailAddress"),i("1.2.840.113549.1.9.2","unstructuredName"),i("1.2.840.113549.1.9.3","contentType"),i("1.2.840.113549.1.9.4","messageDigest"),i("1.2.840.113549.1.9.5","signingTime"),i("1.2.840.113549.1.9.6","counterSignature"),i("1.2.840.113549.1.9.7","challengePassword"),i("1.2.840.113549.1.9.8","unstructuredAddress"),i("1.2.840.113549.1.9.14","extensionRequest"),i("1.2.840.113549.1.9.20","friendlyName"),i("1.2.840.113549.1.9.21","localKeyId"),i("1.2.840.113549.1.9.22.1","x509Certificate"),i("1.2.840.113549.1.12.10.1.1","keyBag"),i("1.2.840.113549.1.12.10.1.2","pkcs8ShroudedKeyBag"),i("1.2.840.113549.1.12.10.1.3","certBag"),i("1.2.840.113549.1.12.10.1.4","crlBag"),i("1.2.840.113549.1.12.10.1.5","secretBag"),i("1.2.840.113549.1.12.10.1.6","safeContentsBag"),i("1.2.840.113549.1.5.13","pkcs5PBES2"),i("1.2.840.113549.1.5.12","pkcs5PBKDF2"),i("1.2.840.113549.1.12.1.1","pbeWithSHAAnd128BitRC4"),i("1.2.840.113549.1.12.1.2","pbeWithSHAAnd40BitRC4"),i("1.2.840.113549.1.12.1.3","pbeWithSHAAnd3-KeyTripleDES-CBC"),i("1.2.840.113549.1.12.1.4","pbeWithSHAAnd2-KeyTripleDES-CBC"),i("1.2.840.113549.1.12.1.5","pbeWithSHAAnd128BitRC2-CBC"),i("1.2.840.113549.1.12.1.6","pbewithSHAAnd40BitRC2-CBC"),i("1.2.840.113549.2.7","hmacWithSHA1"),i("1.2.840.113549.2.8","hmacWithSHA224"),i("1.2.840.113549.2.9","hmacWithSHA256"),i("1.2.840.113549.2.10","hmacWithSHA384"),i("1.2.840.113549.2.11","hmacWithSHA512"),i("1.2.840.113549.3.7","des-EDE3-CBC"),i("2.16.840.1.101.3.4.1.2","aes128-CBC"),i("2.16.840.1.101.3.4.1.22","aes192-CBC"),i("2.16.840.1.101.3.4.1.42","aes256-CBC"),i("2.5.4.3","commonName"),i("2.5.4.4","surname"),i("2.5.4.5","serialNumber"),i("2.5.4.6","countryName"),i("2.5.4.7","localityName"),i("2.5.4.8","stateOrProvinceName"),i("2.5.4.9","streetAddress"),i("2.5.4.10","organizationName"),i("2.5.4.11","organizationalUnitName"),i("2.5.4.12","title"),i("2.5.4.13","description"),i("2.5.4.15","businessCategory"),i("2.5.4.17","postalCode"),i("2.5.4.42","givenName"),i("1.3.6.1.4.1.311.60.2.1.2","jurisdictionOfIncorporationStateOrProvinceName"),i("1.3.6.1.4.1.311.60.2.1.3","jurisdictionOfIncorporationCountryName"),i("2.16.840.1.113730.1.1","nsCertType"),i("2.16.840.1.113730.1.13","nsComment"),s("2.5.29.1","authorityKeyIdentifier"),s("2.5.29.2","keyAttributes"),s("2.5.29.3","certificatePolicies"),s("2.5.29.4","keyUsageRestriction"),s("2.5.29.5","policyMapping"),s("2.5.29.6","subtreesConstraint"),s("2.5.29.7","subjectAltName"),s("2.5.29.8","issuerAltName"),s("2.5.29.9","subjectDirectoryAttributes"),s("2.5.29.10","basicConstraints"),s("2.5.29.11","nameConstraints"),s("2.5.29.12","policyConstraints"),s("2.5.29.13","basicConstraints"),i("2.5.29.14","subjectKeyIdentifier"),i("2.5.29.15","keyUsage"),s("2.5.29.16","privateKeyUsagePeriod"),i("2.5.29.17","subjectAltName"),i("2.5.29.18","issuerAltName"),i("2.5.29.19","basicConstraints"),s("2.5.29.20","cRLNumber"),s("2.5.29.21","cRLReason"),s("2.5.29.22","expirationDate"),s("2.5.29.23","instructionCode"),s("2.5.29.24","invalidityDate"),s("2.5.29.25","cRLDistributionPoints"),s("2.5.29.26","issuingDistributionPoint"),s("2.5.29.27","deltaCRLIndicator"),s("2.5.29.28","issuingDistributionPoint"),s("2.5.29.29","certificateIssuer"),s("2.5.29.30","nameConstraints"),i("2.5.29.31","cRLDistributionPoints"),i("2.5.29.32","certificatePolicies"),s("2.5.29.33","policyMappings"),s("2.5.29.34","policyConstraints"),i("2.5.29.35","authorityKeyIdentifier"),s("2.5.29.36","policyConstraints"),i("2.5.29.37","extKeyUsage"),s("2.5.29.46","freshestCRL"),s("2.5.29.54","inhibitAnyPolicy"),i("1.3.6.1.4.1.11129.2.4.2","timestampList"),i("1.3.6.1.5.5.7.1.1","authorityInfoAccess"),i("1.3.6.1.5.5.7.3.1","serverAuth"),i("1.3.6.1.5.5.7.3.2","clientAuth"),i("1.3.6.1.5.5.7.3.3","codeSigning"),i("1.3.6.1.5.5.7.3.4","emailProtection"),i("1.3.6.1.5.5.7.3.8","timeStamping")},function(e,t,r){var n=r(0);r(1);var a=e.exports=n.pem=n.pem||{};function i(e){for(var t=e.name+": ",r=[],n=function(e,t){return" "+t},a=0;a65&&-1!==s){var o=t[s];","===o?(++s,t=t.substr(0,s)+"\r\n "+t.substr(s)):t=t.substr(0,s)+"\r\n"+o+t.substr(s+1),i=a-s-1,s=-1,++a}else" "!==t[a]&&"\t"!==t[a]&&","!==t[a]||(s=a);return t}function s(e){return e.replace(/^\s+/,"")}a.encode=function(e,t){t=t||{};var r,a="-----BEGIN "+e.type+"-----\r\n";if(e.procType&&(a+=i(r={name:"Proc-Type",values:[String(e.procType.version),e.procType.type]})),e.contentDomain&&(a+=i(r={name:"Content-Domain",values:[e.contentDomain]})),e.dekInfo&&(r={name:"DEK-Info",values:[e.dekInfo.algorithm]},e.dekInfo.parameters&&r.values.push(e.dekInfo.parameters),a+=i(r)),e.headers)for(var s=0;st.blockLength&&(t.start(),t.update(s.bytes()),s=t.digest()),r=n.util.createBuffer(),a=n.util.createBuffer(),u=s.length();for(c=0;c>>0,c>>>0];for(var u=a.fullMessageLength.length-1;u>=0;--u)a.fullMessageLength[u]+=c[1],c[1]=c[0]+(a.fullMessageLength[u]/4294967296>>>0),a.fullMessageLength[u]=a.fullMessageLength[u]>>>0,c[0]=c[1]/4294967296>>>0;return t.putBytes(i),o(e,r,t),(t.read>2048||0===t.length())&&t.compact(),a},a.digest=function(){var s=n.util.createBuffer();s.putBytes(t.bytes());var c,u=a.fullMessageLength[a.fullMessageLength.length-1]+a.messageLengthSize&a.blockLength-1;s.putBytes(i.substr(0,a.blockLength-u));for(var l=8*a.fullMessageLength[0],p=0;p>>0,s.putInt32(l>>>0),l=c>>>0;s.putInt32(l);var f={h0:e.h0,h1:e.h1,h2:e.h2,h3:e.h3,h4:e.h4};o(f,r,s);var h=n.util.createBuffer();return h.putInt32(f.h0),h.putInt32(f.h1),h.putInt32(f.h2),h.putInt32(f.h3),h.putInt32(f.h4),h},a};var i=null,s=!1;function o(e,t,r){for(var n,a,i,s,o,c,u,l=r.length();l>=64;){for(a=e.h0,i=e.h1,s=e.h2,o=e.h3,c=e.h4,u=0;u<16;++u)n=r.getInt32(),t[u]=n,n=(a<<5|a>>>27)+(o^i&(s^o))+c+1518500249+n,c=o,o=s,s=(i<<30|i>>>2)>>>0,i=a,a=n;for(;u<20;++u)n=(n=t[u-3]^t[u-8]^t[u-14]^t[u-16])<<1|n>>>31,t[u]=n,n=(a<<5|a>>>27)+(o^i&(s^o))+c+1518500249+n,c=o,o=s,s=(i<<30|i>>>2)>>>0,i=a,a=n;for(;u<32;++u)n=(n=t[u-3]^t[u-8]^t[u-14]^t[u-16])<<1|n>>>31,t[u]=n,n=(a<<5|a>>>27)+(i^s^o)+c+1859775393+n,c=o,o=s,s=(i<<30|i>>>2)>>>0,i=a,a=n;for(;u<40;++u)n=(n=t[u-6]^t[u-16]^t[u-28]^t[u-32])<<2|n>>>30,t[u]=n,n=(a<<5|a>>>27)+(i^s^o)+c+1859775393+n,c=o,o=s,s=(i<<30|i>>>2)>>>0,i=a,a=n;for(;u<60;++u)n=(n=t[u-6]^t[u-16]^t[u-28]^t[u-32])<<2|n>>>30,t[u]=n,n=(a<<5|a>>>27)+(i&s|o&(i^s))+c+2400959708+n,c=o,o=s,s=(i<<30|i>>>2)>>>0,i=a,a=n;for(;u<80;++u)n=(n=t[u-6]^t[u-16]^t[u-28]^t[u-32])<<2|n>>>30,t[u]=n,n=(a<<5|a>>>27)+(i^s^o)+c+3395469782+n,c=o,o=s,s=(i<<30|i>>>2)>>>0,i=a,a=n;e.h0=e.h0+a|0,e.h1=e.h1+i|0,e.h2=e.h2+s|0,e.h3=e.h3+o|0,e.h4=e.h4+c|0,l-=64}}},function(e,t,r){var n=r(0);r(3),r(8),r(15),r(7),r(21),r(2),r(9),r(1);var a=function(e,t,r,a){var i=n.util.createBuffer(),s=e.length>>1,o=s+(1&e.length),c=e.substr(0,o),u=e.substr(s,o),l=n.util.createBuffer(),p=n.hmac.create();r=t+r;var f=Math.ceil(a/16),h=Math.ceil(a/20);p.start("MD5",c);var d=n.util.createBuffer();l.putBytes(r);for(var y=0;y0&&(u.queue(e,u.createAlert(e,{level:u.Alert.Level.warning,description:u.Alert.Description.no_renegotiation})),u.flush(e)),e.process()},u.parseHelloMessage=function(e,t,r){var a=null,i=e.entity===u.ConnectionEnd.client;if(r<38)e.error(e,{message:i?"Invalid ServerHello message. Message too short.":"Invalid ClientHello message. Message too short.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.illegal_parameter}});else{var s=t.fragment,c=s.length();if(a={version:{major:s.getByte(),minor:s.getByte()},random:n.util.createBuffer(s.getBytes(32)),session_id:o(s,1),extensions:[]},i?(a.cipher_suite=s.getBytes(2),a.compression_method=s.getByte()):(a.cipher_suites=o(s,2),a.compression_methods=o(s,1)),(c=r-(c-s.length()))>0){for(var l=o(s,2);l.length()>0;)a.extensions.push({type:[l.getByte(),l.getByte()],data:o(l,2)});if(!i)for(var p=0;p0;){if(0!==h.getByte())break;e.session.extensions.server_name.serverNameList.push(o(h,2).getBytes())}}}if(e.session.version&&(a.version.major!==e.session.version.major||a.version.minor!==e.session.version.minor))return e.error(e,{message:"TLS version change is disallowed during renegotiation.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.protocol_version}});if(i)e.session.cipherSuite=u.getCipherSuite(a.cipher_suite);else for(var d=n.util.createBuffer(a.cipher_suites.bytes());d.length()>0&&(e.session.cipherSuite=u.getCipherSuite(d.getBytes(2)),null===e.session.cipherSuite););if(null===e.session.cipherSuite)return e.error(e,{message:"No cipher suites in common.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.handshake_failure},cipherSuite:n.util.bytesToHex(a.cipher_suite)});e.session.compressionMethod=i?a.compression_method:u.CompressionMethod.none}return a},u.createSecurityParameters=function(e,t){var r=e.entity===u.ConnectionEnd.client,n=t.random.bytes(),a=r?e.session.sp.client_random:n,i=r?n:u.createRandom().getBytes();e.session.sp={entity:e.entity,prf_algorithm:u.PRFAlgorithm.tls_prf_sha256,bulk_cipher_algorithm:null,cipher_type:null,enc_key_length:null,block_length:null,fixed_iv_length:null,record_iv_length:null,mac_algorithm:null,mac_length:null,mac_key_length:null,compression_algorithm:e.session.compressionMethod,pre_master_secret:null,master_secret:null,client_random:a,server_random:i}},u.handleServerHello=function(e,t,r){var n=u.parseHelloMessage(e,t,r);if(!e.fail){if(!(n.version.minor<=e.version.minor))return e.error(e,{message:"Incompatible TLS version.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.protocol_version}});e.version.minor=n.version.minor,e.session.version=e.version;var a=n.session_id.bytes();a.length>0&&a===e.session.id?(e.expect=d,e.session.resuming=!0,e.session.sp.server_random=n.random.bytes()):(e.expect=l,e.session.resuming=!1,u.createSecurityParameters(e,n)),e.session.id=a,e.process()}},u.handleClientHello=function(e,t,r){var a=u.parseHelloMessage(e,t,r);if(!e.fail){var i=a.session_id.bytes(),s=null;if(e.sessionCache&&(null===(s=e.sessionCache.getSession(i))?i="":(s.version.major!==a.version.major||s.version.minor>a.version.minor)&&(s=null,i="")),0===i.length&&(i=n.random.getBytes(32)),e.session.id=i,e.session.clientHelloVersion=a.version,e.session.sp={},s)e.version=e.session.version=s.version,e.session.sp=s.sp;else{for(var o,c=1;c0;)a=o(c.certificate_list,3),i=n.asn1.fromDer(a),a=n.pki.certificateFromAsn1(i,!0),l.push(a)}catch(t){return e.error(e,{message:"Could not parse certificate list.",cause:t,send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.bad_certificate}})}var f=e.entity===u.ConnectionEnd.client;!f&&!0!==e.verifyClient||0!==l.length?0===l.length?e.expect=f?p:C:(f?e.session.serverCertificate=l[0]:e.session.clientCertificate=l[0],u.verifyCertificateChain(e,l)&&(e.expect=f?p:C)):e.error(e,{message:f?"No server certificate provided.":"No client certificate provided.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.illegal_parameter}}),e.process()},u.handleServerKeyExchange=function(e,t,r){if(r>0)return e.error(e,{message:"Invalid key parameters. Only RSA is supported.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.unsupported_certificate}});e.expect=f,e.process()},u.handleClientKeyExchange=function(e,t,r){if(r<48)return e.error(e,{message:"Invalid key parameters. Only RSA is supported.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.unsupported_certificate}});var a=t.fragment,i={enc_pre_master_secret:o(a,2).getBytes()},s=null;if(e.getPrivateKey)try{s=e.getPrivateKey(e,e.session.serverCertificate),s=n.pki.privateKeyFromPem(s)}catch(t){e.error(e,{message:"Could not get private key.",cause:t,send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.internal_error}})}if(null===s)return e.error(e,{message:"No private key set.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.internal_error}});try{var c=e.session.sp;c.pre_master_secret=s.decrypt(i.enc_pre_master_secret);var l=e.session.clientHelloVersion;if(l.major!==c.pre_master_secret.charCodeAt(0)||l.minor!==c.pre_master_secret.charCodeAt(1))throw new Error("TLS version rollback attack detected.")}catch(e){c.pre_master_secret=n.random.getBytes(48)}e.expect=S,null!==e.session.clientCertificate&&(e.expect=E),e.process()},u.handleCertificateRequest=function(e,t,r){if(r<3)return e.error(e,{message:"Invalid CertificateRequest. Message too short.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.illegal_parameter}});var n=t.fragment,a={certificate_types:o(n,1),certificate_authorities:o(n,2)};e.session.certificateRequest=a,e.expect=h,e.process()},u.handleCertificateVerify=function(e,t,r){if(r<2)return e.error(e,{message:"Invalid CertificateVerify. Message too short.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.illegal_parameter}});var a=t.fragment;a.read-=4;var i=a.bytes();a.read+=4;var s={signature:o(a,2).getBytes()},c=n.util.createBuffer();c.putBuffer(e.session.md5.digest()),c.putBuffer(e.session.sha1.digest()),c=c.getBytes();try{if(!e.session.clientCertificate.publicKey.verify(c,s.signature,"NONE"))throw new Error("CertificateVerify signature does not match.");e.session.md5.update(i),e.session.sha1.update(i)}catch(t){return e.error(e,{message:"Bad signature in CertificateVerify.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.handshake_failure}})}e.expect=S,e.process()},u.handleServerHelloDone=function(e,t,r){if(r>0)return e.error(e,{message:"Invalid ServerHelloDone message. Invalid length.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.record_overflow}});if(null===e.serverCertificate){var a={message:"No server certificate provided. Not enough security.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.insufficient_security}},i=e.verify(e,a.alert.description,0,[]);if(!0!==i)return(i||0===i)&&("object"!=typeof i||n.util.isArray(i)?"number"==typeof i&&(a.alert.description=i):(i.message&&(a.message=i.message),i.alert&&(a.alert.description=i.alert))),e.error(e,a)}null!==e.session.certificateRequest&&(t=u.createRecord(e,{type:u.ContentType.handshake,data:u.createCertificate(e)}),u.queue(e,t)),t=u.createRecord(e,{type:u.ContentType.handshake,data:u.createClientKeyExchange(e)}),u.queue(e,t),e.expect=v;var s=function(e,t){null!==e.session.certificateRequest&&null!==e.session.clientCertificate&&u.queue(e,u.createRecord(e,{type:u.ContentType.handshake,data:u.createCertificateVerify(e,t)})),u.queue(e,u.createRecord(e,{type:u.ContentType.change_cipher_spec,data:u.createChangeCipherSpec()})),e.state.pending=u.createConnectionState(e),e.state.current.write=e.state.pending.write,u.queue(e,u.createRecord(e,{type:u.ContentType.handshake,data:u.createFinished(e)})),e.expect=d,u.flush(e),e.process()};if(null===e.session.certificateRequest||null===e.session.clientCertificate)return s(e,null);u.getClientSignature(e,s)},u.handleChangeCipherSpec=function(e,t){if(1!==t.fragment.getByte())return e.error(e,{message:"Invalid ChangeCipherSpec message received.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.illegal_parameter}});var r=e.entity===u.ConnectionEnd.client;(e.session.resuming&&r||!e.session.resuming&&!r)&&(e.state.pending=u.createConnectionState(e)),e.state.current.read=e.state.pending.read,(!e.session.resuming&&r||e.session.resuming&&!r)&&(e.state.pending=null),e.expect=r?y:T,e.process()},u.handleFinished=function(e,t,r){var i=t.fragment;i.read-=4;var s=i.bytes();i.read+=4;var o=t.fragment.getBytes();(i=n.util.createBuffer()).putBuffer(e.session.md5.digest()),i.putBuffer(e.session.sha1.digest());var c=e.entity===u.ConnectionEnd.client,l=c?"server finished":"client finished",p=e.session.sp;if((i=a(p.master_secret,l,i.getBytes(),12)).getBytes()!==o)return e.error(e,{message:"Invalid verify_data in Finished message.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.decrypt_error}});e.session.md5.update(s),e.session.sha1.update(s),(e.session.resuming&&c||!e.session.resuming&&!c)&&(u.queue(e,u.createRecord(e,{type:u.ContentType.change_cipher_spec,data:u.createChangeCipherSpec()})),e.state.current.write=e.state.pending.write,e.state.pending=null,u.queue(e,u.createRecord(e,{type:u.ContentType.handshake,data:u.createFinished(e)}))),e.expect=c?g:I,e.handshaking=!1,++e.handshakes,e.peerCertificate=c?e.session.serverCertificate:e.session.clientCertificate,u.flush(e),e.isConnected=!0,e.connected(e),e.process()},u.handleAlert=function(e,t){var r,n=t.fragment,a={level:n.getByte(),description:n.getByte()};switch(a.description){case u.Alert.Description.close_notify:r="Connection closed.";break;case u.Alert.Description.unexpected_message:r="Unexpected message.";break;case u.Alert.Description.bad_record_mac:r="Bad record MAC.";break;case u.Alert.Description.decryption_failed:r="Decryption failed.";break;case u.Alert.Description.record_overflow:r="Record overflow.";break;case u.Alert.Description.decompression_failure:r="Decompression failed.";break;case u.Alert.Description.handshake_failure:r="Handshake failure.";break;case u.Alert.Description.bad_certificate:r="Bad certificate.";break;case u.Alert.Description.unsupported_certificate:r="Unsupported certificate.";break;case u.Alert.Description.certificate_revoked:r="Certificate revoked.";break;case u.Alert.Description.certificate_expired:r="Certificate expired.";break;case u.Alert.Description.certificate_unknown:r="Certificate unknown.";break;case u.Alert.Description.illegal_parameter:r="Illegal parameter.";break;case u.Alert.Description.unknown_ca:r="Unknown certificate authority.";break;case u.Alert.Description.access_denied:r="Access denied.";break;case u.Alert.Description.decode_error:r="Decode error.";break;case u.Alert.Description.decrypt_error:r="Decrypt error.";break;case u.Alert.Description.export_restriction:r="Export restriction.";break;case u.Alert.Description.protocol_version:r="Unsupported protocol version.";break;case u.Alert.Description.insufficient_security:r="Insufficient security.";break;case u.Alert.Description.internal_error:r="Internal error.";break;case u.Alert.Description.user_canceled:r="User canceled.";break;case u.Alert.Description.no_renegotiation:r="Renegotiation not supported.";break;default:r="Unknown error."}if(a.description===u.Alert.Description.close_notify)return e.close();e.error(e,{message:r,send:!1,origin:e.entity===u.ConnectionEnd.client?"server":"client",alert:a}),e.process()},u.handleHandshake=function(e,t){var r=t.fragment,a=r.getByte(),i=r.getInt24();if(i>r.length())return e.fragmented=t,t.fragment=n.util.createBuffer(),r.read-=4,e.process();e.fragmented=null,r.read-=4;var s=r.bytes(i+4);r.read+=4,a in x[e.entity][e.expect]?(e.entity!==u.ConnectionEnd.server||e.open||e.fail||(e.handshaking=!0,e.session={version:null,extensions:{server_name:{serverNameList:[]}},cipherSuite:null,compressionMethod:null,serverCertificate:null,clientCertificate:null,md5:n.md.md5.create(),sha1:n.md.sha1.create()}),a!==u.HandshakeType.hello_request&&a!==u.HandshakeType.certificate_verify&&a!==u.HandshakeType.finished&&(e.session.md5.update(s),e.session.sha1.update(s)),x[e.entity][e.expect][a](e,t,i)):u.handleUnexpected(e,t)},u.handleApplicationData=function(e,t){e.data.putBuffer(t.fragment),e.dataReady(e),e.process()},u.handleHeartbeat=function(e,t){var r=t.fragment,a=r.getByte(),i=r.getInt16(),s=r.getBytes(i);if(a===u.HeartbeatMessageType.heartbeat_request){if(e.handshaking||i>s.length)return e.process();u.queue(e,u.createRecord(e,{type:u.ContentType.heartbeat,data:u.createHeartbeat(u.HeartbeatMessageType.heartbeat_response,s)})),u.flush(e)}else if(a===u.HeartbeatMessageType.heartbeat_response){if(s!==e.expectedHeartbeatPayload)return e.process();e.heartbeatReceived&&e.heartbeatReceived(e,n.util.createBuffer(s))}e.process()};var l=1,p=2,f=3,h=4,d=5,y=6,g=7,v=8,m=1,C=2,E=3,S=4,T=5,I=6,b=u.handleUnexpected,A=u.handleChangeCipherSpec,B=u.handleAlert,N=u.handleHandshake,k=u.handleApplicationData,w=u.handleHeartbeat,R=[];R[u.ConnectionEnd.client]=[[b,B,N,b,w],[b,B,N,b,w],[b,B,N,b,w],[b,B,N,b,w],[b,B,N,b,w],[A,B,b,b,w],[b,B,N,b,w],[b,B,N,k,w],[b,B,N,b,w]],R[u.ConnectionEnd.server]=[[b,B,N,b,w],[b,B,N,b,w],[b,B,N,b,w],[b,B,N,b,w],[A,B,b,b,w],[b,B,N,b,w],[b,B,N,k,w],[b,B,N,b,w]];var L=u.handleHelloRequest,_=u.handleServerHello,U=u.handleCertificate,D=u.handleServerKeyExchange,P=u.handleCertificateRequest,V=u.handleServerHelloDone,O=u.handleFinished,x=[];x[u.ConnectionEnd.client]=[[b,b,_,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b],[L,b,b,b,b,b,b,b,b,b,b,U,D,P,V,b,b,b,b,b,b],[L,b,b,b,b,b,b,b,b,b,b,b,D,P,V,b,b,b,b,b,b],[L,b,b,b,b,b,b,b,b,b,b,b,b,P,V,b,b,b,b,b,b],[L,b,b,b,b,b,b,b,b,b,b,b,b,b,V,b,b,b,b,b,b],[L,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b],[L,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,O],[L,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b],[L,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b]];var K=u.handleClientHello,M=u.handleClientKeyExchange,F=u.handleCertificateVerify;x[u.ConnectionEnd.server]=[[b,K,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b],[b,b,b,b,b,b,b,b,b,b,b,U,b,b,b,b,b,b,b,b,b],[b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,M,b,b,b,b],[b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,F,b,b,b,b,b],[b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b],[b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,O],[b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b],[b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b]],u.generateKeys=function(e,t){var r=a,n=t.client_random+t.server_random;e.session.resuming||(t.master_secret=r(t.pre_master_secret,"master secret",n,48).bytes(),t.pre_master_secret=null),n=t.server_random+t.client_random;var i=2*t.mac_key_length+2*t.enc_key_length,s=e.version.major===u.Versions.TLS_1_0.major&&e.version.minor===u.Versions.TLS_1_0.minor;s&&(i+=2*t.fixed_iv_length);var o=r(t.master_secret,"key expansion",n,i),c={client_write_MAC_key:o.getBytes(t.mac_key_length),server_write_MAC_key:o.getBytes(t.mac_key_length),client_write_key:o.getBytes(t.enc_key_length),server_write_key:o.getBytes(t.enc_key_length)};return s&&(c.client_write_IV=o.getBytes(t.fixed_iv_length),c.server_write_IV=o.getBytes(t.fixed_iv_length)),c},u.createConnectionState=function(e){var t=e.entity===u.ConnectionEnd.client,r=function(){var e={sequenceNumber:[0,0],macKey:null,macLength:0,macFunction:null,cipherState:null,cipherFunction:function(e){return!0},compressionState:null,compressFunction:function(e){return!0},updateSequenceNumber:function(){4294967295===e.sequenceNumber[1]?(e.sequenceNumber[1]=0,++e.sequenceNumber[0]):++e.sequenceNumber[1]}};return e},n={read:r(),write:r()};if(n.read.update=function(e,t){return n.read.cipherFunction(t,n.read)?n.read.compressFunction(e,t,n.read)||e.error(e,{message:"Could not decompress record.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.decompression_failure}}):e.error(e,{message:"Could not decrypt record or bad MAC.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.bad_record_mac}}),!e.fail},n.write.update=function(e,t){return n.write.compressFunction(e,t,n.write)?n.write.cipherFunction(t,n.write)||e.error(e,{message:"Could not encrypt record.",send:!1,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.internal_error}}):e.error(e,{message:"Could not compress record.",send:!1,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.internal_error}}),!e.fail},e.session){var a=e.session.sp;switch(e.session.cipherSuite.initSecurityParameters(a),a.keys=u.generateKeys(e,a),n.read.macKey=t?a.keys.server_write_MAC_key:a.keys.client_write_MAC_key,n.write.macKey=t?a.keys.client_write_MAC_key:a.keys.server_write_MAC_key,e.session.cipherSuite.initConnectionState(n,e,a),a.compression_algorithm){case u.CompressionMethod.none:break;case u.CompressionMethod.deflate:n.read.compressFunction=s,n.write.compressFunction=i;break;default:throw new Error("Unsupported compression algorithm.")}}return n},u.createRandom=function(){var e=new Date,t=+e+6e4*e.getTimezoneOffset(),r=n.util.createBuffer();return r.putInt32(t),r.putBytes(n.random.getBytes(28)),r},u.createRecord=function(e,t){return t.data?{type:t.type,version:{major:e.version.major,minor:e.version.minor},length:t.data.length(),fragment:t.data}:null},u.createAlert=function(e,t){var r=n.util.createBuffer();return r.putByte(t.level),r.putByte(t.description),u.createRecord(e,{type:u.ContentType.alert,data:r})},u.createClientHello=function(e){e.session.clientHelloVersion={major:e.version.major,minor:e.version.minor};for(var t=n.util.createBuffer(),r=0;r0&&(d+=2);var y=e.session.id,g=y.length+1+2+4+28+2+i+1+o+d,v=n.util.createBuffer();return v.putByte(u.HandshakeType.client_hello),v.putInt24(g),v.putByte(e.version.major),v.putByte(e.version.minor),v.putBytes(e.session.sp.client_random),c(v,1,n.util.createBuffer(y)),c(v,2,t),c(v,1,s),d>0&&c(v,2,l),v},u.createServerHello=function(e){var t=e.session.id,r=t.length+1+2+4+28+2+1,a=n.util.createBuffer();return a.putByte(u.HandshakeType.server_hello),a.putInt24(r),a.putByte(e.version.major),a.putByte(e.version.minor),a.putBytes(e.session.sp.server_random),c(a,1,n.util.createBuffer(t)),a.putByte(e.session.cipherSuite.id[0]),a.putByte(e.session.cipherSuite.id[1]),a.putByte(e.session.compressionMethod),a},u.createCertificate=function(e){var t,r=e.entity===u.ConnectionEnd.client,a=null;e.getCertificate&&(t=r?e.session.certificateRequest:e.session.extensions.server_name.serverNameList,a=e.getCertificate(e,t));var i=n.util.createBuffer();if(null!==a)try{n.util.isArray(a)||(a=[a]);for(var s=null,o=0;ou.MaxFragment;)a.push(u.createRecord(e,{type:t.type,data:n.util.createBuffer(i.slice(0,u.MaxFragment))})),i=i.slice(u.MaxFragment);i.length>0&&a.push(u.createRecord(e,{type:t.type,data:n.util.createBuffer(i)}))}for(var s=0;s0&&(a=r.order[0]),null!==a&&a in r.cache)for(var i in t=r.cache[a],delete r.cache[a],r.order)if(r.order[i]===a){r.order.splice(i,1);break}return t},r.setSession=function(e,t){if(r.order.length===r.capacity){var a=r.order.shift();delete r.cache[a]}a=n.util.bytesToHex(e);r.order.push(a),r.cache[a]=t}}return r},u.createConnection=function(e){var t=null;t=e.caStore?n.util.isArray(e.caStore)?n.pki.createCaStore(e.caStore):e.caStore:n.pki.createCaStore();var r=e.cipherSuites||null;if(null===r)for(var a in r=[],u.CipherSuites)r.push(u.CipherSuites[a]);var i=e.server?u.ConnectionEnd.server:u.ConnectionEnd.client,s=e.sessionCache?u.createSessionCache(e.sessionCache):null,o={version:{major:u.Version.major,minor:u.Version.minor},entity:i,sessionId:e.sessionId,caStore:t,sessionCache:s,cipherSuites:r,connected:e.connected,virtualHost:e.virtualHost||null,verifyClient:e.verifyClient||!1,verify:e.verify||function(e,t,r,n){return t},verifyOptions:e.verifyOptions||{},getCertificate:e.getCertificate||null,getPrivateKey:e.getPrivateKey||null,getSignature:e.getSignature||null,input:n.util.createBuffer(),tlsData:n.util.createBuffer(),data:n.util.createBuffer(),tlsDataReady:e.tlsDataReady,dataReady:e.dataReady,heartbeatReceived:e.heartbeatReceived,closed:e.closed,error:function(t,r){r.origin=r.origin||(t.entity===u.ConnectionEnd.client?"client":"server"),r.send&&(u.queue(t,u.createAlert(t,r.alert)),u.flush(t));var n=!1!==r.fatal;n&&(t.fail=!0),e.error(t,r),n&&t.close(!1)},deflate:e.deflate||null,inflate:e.inflate||null,reset:function(e){o.version={major:u.Version.major,minor:u.Version.minor},o.record=null,o.session=null,o.peerCertificate=null,o.state={pending:null,current:null},o.expect=(o.entity,u.ConnectionEnd.client,0),o.fragmented=null,o.records=[],o.open=!1,o.handshakes=0,o.handshaking=!1,o.isConnected=!1,o.fail=!(e||void 0===e),o.input.clear(),o.tlsData.clear(),o.data.clear(),o.state.current=u.createConnectionState(o)}};o.reset();return o.handshake=function(e){if(o.entity!==u.ConnectionEnd.client)o.error(o,{message:"Cannot initiate handshake as a server.",fatal:!1});else if(o.handshaking)o.error(o,{message:"Handshake already in progress.",fatal:!1});else{o.fail&&!o.open&&0===o.handshakes&&(o.fail=!1),o.handshaking=!0;var t=null;(e=e||"").length>0&&(o.sessionCache&&(t=o.sessionCache.getSession(e)),null===t&&(e="")),0===e.length&&o.sessionCache&&null!==(t=o.sessionCache.getSession())&&(e=t.id),o.session={id:e,version:null,cipherSuite:null,compressionMethod:null,serverCertificate:null,certificateRequest:null,clientCertificate:null,sp:{},md5:n.md.md5.create(),sha1:n.md.sha1.create()},t&&(o.version=t.version,o.session.sp=t.sp),o.session.sp.client_random=u.createRandom().getBytes(),o.open=!0,u.queue(o,u.createRecord(o,{type:u.ContentType.handshake,data:u.createClientHello(o)})),u.flush(o)}},o.process=function(e){var t=0;return e&&o.input.putBytes(e),o.fail||(null!==o.record&&o.record.ready&&o.record.fragment.isEmpty()&&(o.record=null),null===o.record&&(t=function(e){var t=0,r=e.input,a=r.length();if(a<5)t=5-a;else{e.record={type:r.getByte(),version:{major:r.getByte(),minor:r.getByte()},length:r.getInt16(),fragment:n.util.createBuffer(),ready:!1};var i=e.record.version.major===e.version.major;i&&e.session&&e.session.version&&(i=e.record.version.minor===e.version.minor),i||e.error(e,{message:"Incompatible TLS version.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.protocol_version}})}return t}(o)),o.fail||null===o.record||o.record.ready||(t=function(e){var t=0,r=e.input,n=r.length();n8?3:1,v=[],m=[0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0],C=0,E=0;E>>4^T))<<4,S^=t=65535&((T^=t)>>>-16^S),S^=(t=858993459&(S>>>2^(T^=t<<-16)))<<2,S^=t=65535&((T^=t)>>>-16^S),S^=(t=1431655765&(S>>>1^(T^=t<<-16)))<<1,S^=t=16711935&((T^=t)>>>8^S),t=(S^=(t=1431655765&(S>>>1^(T^=t<<8)))<<1)<<8|(T^=t)>>>20&240,S=T<<24|T<<8&16711680|T>>>8&65280|T>>>24&240,T=t;for(var I=0;I>>26,T=T<<2|T>>>26):(S=S<<1|S>>>27,T=T<<1|T>>>27);var b=r[(S&=-15)>>>28]|n[S>>>24&15]|a[S>>>20&15]|i[S>>>16&15]|s[S>>>12&15]|o[S>>>8&15]|c[S>>>4&15],A=u[(T&=-15)>>>28]|l[T>>>24&15]|p[T>>>20&15]|f[T>>>16&15]|h[T>>>12&15]|d[T>>>8&15]|y[T>>>4&15];t=65535&(A>>>16^b),v[C++]=b^t,v[C++]=A^t<<16}}return v}(t),this._init=!0}},a("DES-ECB",n.cipher.modes.ecb),a("DES-CBC",n.cipher.modes.cbc),a("DES-CFB",n.cipher.modes.cfb),a("DES-OFB",n.cipher.modes.ofb),a("DES-CTR",n.cipher.modes.ctr),a("3DES-ECB",n.cipher.modes.ecb),a("3DES-CBC",n.cipher.modes.cbc),a("3DES-CFB",n.cipher.modes.cfb),a("3DES-OFB",n.cipher.modes.ofb),a("3DES-CTR",n.cipher.modes.ctr);var i=[16843776,0,65536,16843780,16842756,66564,4,65536,1024,16843776,16843780,1024,16778244,16842756,16777216,4,1028,16778240,16778240,66560,66560,16842752,16842752,16778244,65540,16777220,16777220,65540,0,1028,66564,16777216,65536,16843780,4,16842752,16843776,16777216,16777216,1024,16842756,65536,66560,16777220,1024,4,16778244,66564,16843780,65540,16842752,16778244,16777220,1028,66564,16843776,1028,16778240,16778240,0,65540,66560,0,16842756],s=[-2146402272,-2147450880,32768,1081376,1048576,32,-2146435040,-2147450848,-2147483616,-2146402272,-2146402304,-2147483648,-2147450880,1048576,32,-2146435040,1081344,1048608,-2147450848,0,-2147483648,32768,1081376,-2146435072,1048608,-2147483616,0,1081344,32800,-2146402304,-2146435072,32800,0,1081376,-2146435040,1048576,-2147450848,-2146435072,-2146402304,32768,-2146435072,-2147450880,32,-2146402272,1081376,32,32768,-2147483648,32800,-2146402304,1048576,-2147483616,1048608,-2147450848,-2147483616,1048608,1081344,0,-2147450880,32800,-2147483648,-2146435040,-2146402272,1081344],o=[520,134349312,0,134348808,134218240,0,131592,134218240,131080,134217736,134217736,131072,134349320,131080,134348800,520,134217728,8,134349312,512,131584,134348800,134348808,131592,134218248,131584,131072,134218248,8,134349320,512,134217728,134349312,134217728,131080,520,131072,134349312,134218240,0,512,131080,134349320,134218240,134217736,512,0,134348808,134218248,131072,134217728,134349320,8,131592,131584,134217736,134348800,134218248,520,134348800,131592,8,134348808,131584],c=[8396801,8321,8321,128,8396928,8388737,8388609,8193,0,8396800,8396800,8396929,129,0,8388736,8388609,1,8192,8388608,8396801,128,8388608,8193,8320,8388737,1,8320,8388736,8192,8396928,8396929,129,8388736,8388609,8396800,8396929,129,0,0,8396800,8320,8388736,8388737,1,8396801,8321,8321,128,8396929,129,1,8192,8388609,8193,8396928,8388737,8193,8320,8388608,8396801,128,8388608,8192,8396928],u=[256,34078976,34078720,1107296512,524288,256,1073741824,34078720,1074266368,524288,33554688,1074266368,1107296512,1107820544,524544,1073741824,33554432,1074266112,1074266112,0,1073742080,1107820800,1107820800,33554688,1107820544,1073742080,0,1107296256,34078976,33554432,1107296256,524544,524288,1107296512,256,33554432,1073741824,34078720,1107296512,1074266368,33554688,1073741824,1107820544,34078976,1074266368,256,33554432,1107820544,1107820800,524544,1107296256,1107820800,34078720,0,1074266112,1107296256,524544,33554688,1073742080,524288,0,1074266112,34078976,1073742080],l=[536870928,541065216,16384,541081616,541065216,16,541081616,4194304,536887296,4210704,4194304,536870928,4194320,536887296,536870912,16400,0,4194320,536887312,16384,4210688,536887312,16,541065232,541065232,0,4210704,541081600,16400,4210688,541081600,536870912,536887296,16,541065232,4210688,541081616,4194304,16400,536870928,4194304,536887296,536870912,16400,536870928,541081616,4210688,541065216,4210704,541081600,0,541065232,16,16384,541065216,4210704,16384,4194320,536887312,0,541081600,536870912,4194320,536887312],p=[2097152,69206018,67110914,0,2048,67110914,2099202,69208064,69208066,2097152,0,67108866,2,67108864,69206018,2050,67110912,2099202,2097154,67110912,67108866,69206016,69208064,2097154,69206016,2048,2050,69208066,2099200,2,67108864,2099200,67108864,2099200,2097152,67110914,67110914,69206018,69206018,2,2097154,67108864,67110912,2097152,69208064,2050,2099202,69208064,2050,67108866,69208066,69206016,2099200,0,2,69208066,0,2099202,69206016,2048,67108866,67110912,2048,2097154],f=[268439616,4096,262144,268701760,268435456,268439616,64,268435456,262208,268697600,268701760,266240,268701696,266304,4096,64,268697600,268435520,268439552,4160,266240,262208,268697664,268701696,4160,0,0,268697664,268435520,268439552,266304,262144,266304,262144,268701696,4096,64,268697664,4096,266304,268439552,64,268435520,268697600,268697664,268435456,262144,268439616,0,268701760,262208,268435520,268697600,268439552,268439616,0,268701760,266240,266240,4160,4160,262208,268435456,268701696];function h(e,t,r,n){var a,h,d=32===e.length?3:9;a=3===d?n?[30,-2,-2]:[0,32,2]:n?[94,62,-2,32,64,2,30,-2,-2]:[0,32,2,62,30,-2,64,96,2];var y=t[0],g=t[1];y^=(h=252645135&(y>>>4^g))<<4,y^=(h=65535&(y>>>16^(g^=h)))<<16,y^=h=858993459&((g^=h)>>>2^y),y^=h=16711935&((g^=h<<2)>>>8^y),y=(y^=(h=1431655765&(y>>>1^(g^=h<<8)))<<1)<<1|y>>>31,g=(g^=h)<<1|g>>>31;for(var v=0;v>>4|g<<28)^e[E+1];h=y,y=g,g=h^(s[S>>>24&63]|c[S>>>16&63]|l[S>>>8&63]|f[63&S]|i[T>>>24&63]|o[T>>>16&63]|u[T>>>8&63]|p[63&T])}h=y,y=g,g=h}g=g>>>1|g<<31,g^=h=1431655765&((y=y>>>1|y<<31)>>>1^g),g^=(h=16711935&(g>>>8^(y^=h<<1)))<<8,g^=(h=858993459&(g>>>2^(y^=h)))<<2,g^=h=65535&((y^=h)>>>16^g),g^=h=252645135&((y^=h<<16)>>>4^g),y^=h<<4,r[0]=y,r[1]=g}function d(e){var t,r="DES-"+((e=e||{}).mode||"CBC").toUpperCase(),a=(t=e.decrypt?n.cipher.createDecipher(r,e.key):n.cipher.createCipher(r,e.key)).start;return t.start=function(e,r){var i=null;r instanceof n.util.ByteBuffer&&(i=r,r={}),(r=r||{}).output=i,r.iv=e,a.call(t,r)},t}},function(e,t,r){var n=r(0);if(r(3),r(13),r(6),r(26),r(27),r(2),r(1),void 0===a)var a=n.jsbn.BigInteger;var i=n.util.isNodejs?r(17):null,s=n.asn1,o=n.util;n.pki=n.pki||{},e.exports=n.pki.rsa=n.rsa=n.rsa||{};var c=n.pki,u=[6,4,2,4,2,4,6,2],l={name:"PrivateKeyInfo",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:s.Class.UNIVERSAL,type:s.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:s.Class.UNIVERSAL,type:s.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]},p={name:"RSAPrivateKey",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPrivateKey.version",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"RSAPrivateKey.modulus",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyModulus"},{name:"RSAPrivateKey.publicExponent",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyPublicExponent"},{name:"RSAPrivateKey.privateExponent",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyPrivateExponent"},{name:"RSAPrivateKey.prime1",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyPrime1"},{name:"RSAPrivateKey.prime2",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyPrime2"},{name:"RSAPrivateKey.exponent1",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyExponent1"},{name:"RSAPrivateKey.exponent2",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyExponent2"},{name:"RSAPrivateKey.coefficient",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyCoefficient"}]},f={name:"RSAPublicKey",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPublicKey.modulus",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"publicKeyModulus"},{name:"RSAPublicKey.exponent",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"publicKeyExponent"}]},h=n.pki.rsa.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:s.Class.UNIVERSAL,type:s.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{name:"SubjectPublicKeyInfo.subjectPublicKey",tagClass:s.Class.UNIVERSAL,type:s.Type.BITSTRING,constructed:!1,value:[{name:"SubjectPublicKeyInfo.subjectPublicKey.RSAPublicKey",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"rsaPublicKey"}]}]},d={name:"DigestInfo",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,value:[{name:"DigestInfo.DigestAlgorithm",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,value:[{name:"DigestInfo.DigestAlgorithm.algorithmIdentifier",tagClass:s.Class.UNIVERSAL,type:s.Type.OID,constructed:!1,capture:"algorithmIdentifier"},{name:"DigestInfo.DigestAlgorithm.parameters",tagClass:s.Class.UNIVERSAL,type:s.Type.NULL,capture:"parameters",optional:!0,constructed:!1}]},{name:"DigestInfo.digest",tagClass:s.Class.UNIVERSAL,type:s.Type.OCTETSTRING,constructed:!1,capture:"digest"}]},y=function(e){var t;if(!(e.algorithm in c.oids)){var r=new Error("Unknown message digest algorithm.");throw r.algorithm=e.algorithm,r}t=c.oids[e.algorithm];var n=s.oidToDer(t).getBytes(),a=s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[]),i=s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[]);i.value.push(s.create(s.Class.UNIVERSAL,s.Type.OID,!1,n)),i.value.push(s.create(s.Class.UNIVERSAL,s.Type.NULL,!1,""));var o=s.create(s.Class.UNIVERSAL,s.Type.OCTETSTRING,!1,e.digest().getBytes());return a.value.push(i),a.value.push(o),s.toDer(a).getBytes()},g=function(e,t,r){if(r)return e.modPow(t.e,t.n);if(!t.p||!t.q)return e.modPow(t.d,t.n);var i;t.dP||(t.dP=t.d.mod(t.p.subtract(a.ONE))),t.dQ||(t.dQ=t.d.mod(t.q.subtract(a.ONE))),t.qInv||(t.qInv=t.q.modInverse(t.p));do{i=new a(n.util.bytesToHex(n.random.getBytes(t.n.bitLength()/8)),16)}while(i.compareTo(t.n)>=0||!i.gcd(t.n).equals(a.ONE));for(var s=(e=e.multiply(i.modPow(t.e,t.n)).mod(t.n)).mod(t.p).modPow(t.dP,t.p),o=e.mod(t.q).modPow(t.dQ,t.q);s.compareTo(o)<0;)s=s.add(t.p);var c=s.subtract(o).multiply(t.qInv).mod(t.p).multiply(t.q).add(o);return c=c.multiply(i.modInverse(t.n)).mod(t.n)};function v(e,t,r){var a=n.util.createBuffer(),i=Math.ceil(t.n.bitLength()/8);if(e.length>i-11){var s=new Error("Message is too long for PKCS#1 v1.5 padding.");throw s.length=e.length,s.max=i-11,s}a.putByte(0),a.putByte(r);var o,c=i-3-e.length;if(0===r||1===r){o=0===r?0:255;for(var u=0;u0;){var l=0,p=n.random.getBytes(c);for(u=0;u1;){if(255!==s.getByte()){--s.read;break}++u}else if(2===c)for(u=0;s.length()>1;){if(0===s.getByte()){--s.read;break}++u}if(0!==s.getByte()||u!==i-3-s.length())throw new Error("Encryption block is invalid.");return s.getBytes()}function C(e,t,r){"function"==typeof t&&(r=t,t={});var i={algorithm:{name:(t=t||{}).algorithm||"PRIMEINC",options:{workers:t.workers||2,workLoad:t.workLoad||100,workerScript:t.workerScript}}};function s(){o(e.pBits,(function(t,n){return t?r(t):(e.p=n,null!==e.q?u(t,e.q):void o(e.qBits,u))}))}function o(e,t){n.prime.generateProbablePrime(e,i,t)}function u(t,n){if(t)return r(t);if(e.q=n,e.p.compareTo(e.q)<0){var i=e.p;e.p=e.q,e.q=i}if(0!==e.p.subtract(a.ONE).gcd(e.e).compareTo(a.ONE))return e.p=null,void s();if(0!==e.q.subtract(a.ONE).gcd(e.e).compareTo(a.ONE))return e.q=null,void o(e.qBits,u);if(e.p1=e.p.subtract(a.ONE),e.q1=e.q.subtract(a.ONE),e.phi=e.p1.multiply(e.q1),0!==e.phi.gcd(e.e).compareTo(a.ONE))return e.p=e.q=null,void s();if(e.n=e.p.multiply(e.q),e.n.bitLength()!==e.bits)return e.q=null,void o(e.qBits,u);var l=e.e.modInverse(e.phi);e.keys={privateKey:c.rsa.setPrivateKey(e.n,e.e,l,e.p,e.q,l.mod(e.p1),l.mod(e.q1),e.q.modInverse(e.p)),publicKey:c.rsa.setPublicKey(e.n,e.e)},r(null,e.keys)}"prng"in t&&(i.prng=t.prng),s()}function E(e){var t=e.toString(16);t[0]>="8"&&(t="00"+t);var r=n.util.hexToBytes(t);return r.length>1&&(0===r.charCodeAt(0)&&0==(128&r.charCodeAt(1))||255===r.charCodeAt(0)&&128==(128&r.charCodeAt(1)))?r.substr(1):r}function S(e){return e<=100?27:e<=150?18:e<=200?15:e<=250?12:e<=300?9:e<=350?8:e<=400?7:e<=500?6:e<=600?5:e<=800?4:e<=1250?3:2}function T(e){return n.util.isNodejs&&"function"==typeof i[e]}function I(e){return void 0!==o.globalScope&&"object"==typeof o.globalScope.crypto&&"object"==typeof o.globalScope.crypto.subtle&&"function"==typeof o.globalScope.crypto.subtle[e]}function b(e){return void 0!==o.globalScope&&"object"==typeof o.globalScope.msCrypto&&"object"==typeof o.globalScope.msCrypto.subtle&&"function"==typeof o.globalScope.msCrypto.subtle[e]}function A(e){for(var t=n.util.hexToBytes(e.toString(16)),r=new Uint8Array(t.length),a=0;a0;)l.putByte(0),--p;return l.putBytes(n.util.hexToBytes(u)),l.getBytes()},c.rsa.decrypt=function(e,t,r,i){var s=Math.ceil(t.n.bitLength()/8);if(e.length!==s){var o=new Error("Encrypted message length is invalid.");throw o.length=e.length,o.expected=s,o}var c=new a(n.util.createBuffer(e).toHex(),16);if(c.compareTo(t.n)>=0)throw new Error("Encrypted message is invalid.");for(var u=g(c,t,r).toString(16),l=n.util.createBuffer(),p=s-Math.ceil(u.length/2);p>0;)l.putByte(0),--p;return l.putBytes(n.util.hexToBytes(u)),!1!==i?m(l.getBytes(),t,r):l.getBytes()},c.rsa.createKeyPairGenerationState=function(e,t,r){"string"==typeof e&&(e=parseInt(e,10)),e=e||2048;var i,s=(r=r||{}).prng||n.random,o={nextBytes:function(e){for(var t=s.getBytesSync(e.length),r=0;r>1,pBits:e-(e>>1),pqState:0,num:null,keys:null}).e.fromInt(i.eInt),i},c.rsa.stepKeyPairGenerationState=function(e,t){"algorithm"in e||(e.algorithm="PRIMEINC");var r=new a(null);r.fromInt(30);for(var n,i=0,s=function(e,t){return e|t},o=+new Date,l=0;null===e.keys&&(t<=0||lp?e.pqState=0:e.num.isProbablePrime(S(e.num.bitLength()))?++e.pqState:e.num.dAddOffset(u[i++%8],0):2===e.pqState?e.pqState=0===e.num.subtract(a.ONE).gcd(e.e).compareTo(a.ONE)?3:0:3===e.pqState&&(e.pqState=0,null===e.p?e.p=e.num:e.q=e.num,null!==e.p&&null!==e.q&&++e.state,e.num=null)}else if(1===e.state)e.p.compareTo(e.q)<0&&(e.num=e.p,e.p=e.q,e.q=e.num),++e.state;else if(2===e.state)e.p1=e.p.subtract(a.ONE),e.q1=e.q.subtract(a.ONE),e.phi=e.p1.multiply(e.q1),++e.state;else if(3===e.state)0===e.phi.gcd(e.e).compareTo(a.ONE)?++e.state:(e.p=null,e.q=null,e.state=0);else if(4===e.state)e.n=e.p.multiply(e.q),e.n.bitLength()===e.bits?++e.state:(e.q=null,e.state=0);else if(5===e.state){var h=e.e.modInverse(e.phi);e.keys={privateKey:c.rsa.setPrivateKey(e.n,e.e,h,e.p,e.q,h.mod(e.p1),h.mod(e.q1),e.q.modInverse(e.p)),publicKey:c.rsa.setPublicKey(e.n,e.e)}}l+=(n=+new Date)-o,o=n}return null!==e.keys},c.rsa.generateKeyPair=function(e,t,r,a){if(1===arguments.length?"object"==typeof e?(r=e,e=void 0):"function"==typeof e&&(a=e,e=void 0):2===arguments.length?"number"==typeof e?"function"==typeof t?(a=t,t=void 0):"number"!=typeof t&&(r=t,t=void 0):(r=e,a=t,e=void 0,t=void 0):3===arguments.length&&("number"==typeof t?"function"==typeof r&&(a=r,r=void 0):(a=r,r=t,t=void 0)),r=r||{},void 0===e&&(e=r.bits||2048),void 0===t&&(t=r.e||65537),!n.options.usePureJavaScript&&!r.prng&&e>=256&&e<=16384&&(65537===t||3===t))if(a){if(T("generateKeyPair"))return i.generateKeyPair("rsa",{modulusLength:e,publicExponent:t,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}},(function(e,t,r){if(e)return a(e);a(null,{privateKey:c.privateKeyFromPem(r),publicKey:c.publicKeyFromPem(t)})}));if(I("generateKey")&&I("exportKey"))return o.globalScope.crypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:e,publicExponent:A(t),hash:{name:"SHA-256"}},!0,["sign","verify"]).then((function(e){return o.globalScope.crypto.subtle.exportKey("pkcs8",e.privateKey)})).then(void 0,(function(e){a(e)})).then((function(e){if(e){var t=c.privateKeyFromAsn1(s.fromDer(n.util.createBuffer(e)));a(null,{privateKey:t,publicKey:c.setRsaPublicKey(t.n,t.e)})}}));if(b("generateKey")&&b("exportKey")){var u=o.globalScope.msCrypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:e,publicExponent:A(t),hash:{name:"SHA-256"}},!0,["sign","verify"]);return u.oncomplete=function(e){var t=e.target.result,r=o.globalScope.msCrypto.subtle.exportKey("pkcs8",t.privateKey);r.oncomplete=function(e){var t=e.target.result,r=c.privateKeyFromAsn1(s.fromDer(n.util.createBuffer(t)));a(null,{privateKey:r,publicKey:c.setRsaPublicKey(r.n,r.e)})},r.onerror=function(e){a(e)}},void(u.onerror=function(e){a(e)})}}else if(T("generateKeyPairSync")){var l=i.generateKeyPairSync("rsa",{modulusLength:e,publicExponent:t,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}});return{privateKey:c.privateKeyFromPem(l.privateKey),publicKey:c.publicKeyFromPem(l.publicKey)}}var p=c.rsa.createKeyPairGenerationState(e,t,r);if(!a)return c.rsa.stepKeyPairGenerationState(p,0),p.keys;C(p,r,a)},c.setRsaPublicKey=c.rsa.setPublicKey=function(e,t){var r={n:e,e:t,encrypt:function(e,t,a){if("string"==typeof t?t=t.toUpperCase():void 0===t&&(t="RSAES-PKCS1-V1_5"),"RSAES-PKCS1-V1_5"===t)t={encode:function(e,t,r){return v(e,t,2).getBytes()}};else if("RSA-OAEP"===t||"RSAES-OAEP"===t)t={encode:function(e,t){return n.pkcs1.encode_rsa_oaep(t,e,a)}};else if(-1!==["RAW","NONE","NULL",null].indexOf(t))t={encode:function(e){return e}};else if("string"==typeof t)throw new Error('Unsupported encryption scheme: "'+t+'".');var i=t.encode(e,r,!0);return c.rsa.encrypt(i,r,!0)},verify:function(e,t,a,i){"string"==typeof a?a=a.toUpperCase():void 0===a&&(a="RSASSA-PKCS1-V1_5"),void 0===i&&(i={_parseAllDigestBytes:!0}),"_parseAllDigestBytes"in i||(i._parseAllDigestBytes=!0),"RSASSA-PKCS1-V1_5"===a?a={verify:function(e,t){t=m(t,r,!0);var a=s.fromDer(t,{parseAllBytes:i._parseAllDigestBytes}),o={},c=[];if(!s.validate(a,d,o,c))throw(u=new Error("ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value.")).errors=c,u;var u,l=s.derToOid(o.algorithmIdentifier);if(l!==n.oids.md2&&l!==n.oids.md5&&l!==n.oids.sha1&&l!==n.oids.sha224&&l!==n.oids.sha256&&l!==n.oids.sha384&&l!==n.oids.sha512&&l!==n.oids["sha512-224"]&&l!==n.oids["sha512-256"])throw(u=new Error("Unknown RSASSA-PKCS1-v1_5 DigestAlgorithm identifier.")).oid=l,u;if((l===n.oids.md2||l===n.oids.md5)&&!("parameters"in o))throw new Error("ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value. Missing algorithm identifer NULL parameters.");return e===o.digest}}:"NONE"!==a&&"NULL"!==a&&null!==a||(a={verify:function(e,t){return e===(t=m(t,r,!0))}});var o=c.rsa.decrypt(t,r,!0,!1);return a.verify(e,o,r.n.bitLength())}};return r},c.setRsaPrivateKey=c.rsa.setPrivateKey=function(e,t,r,a,i,s,o,u){var l={n:e,e:t,d:r,p:a,q:i,dP:s,dQ:o,qInv:u,decrypt:function(e,t,r){"string"==typeof t?t=t.toUpperCase():void 0===t&&(t="RSAES-PKCS1-V1_5");var a=c.rsa.decrypt(e,l,!1,!1);if("RSAES-PKCS1-V1_5"===t)t={decode:m};else if("RSA-OAEP"===t||"RSAES-OAEP"===t)t={decode:function(e,t){return n.pkcs1.decode_rsa_oaep(t,e,r)}};else{if(-1===["RAW","NONE","NULL",null].indexOf(t))throw new Error('Unsupported encryption scheme: "'+t+'".');t={decode:function(e){return e}}}return t.decode(a,l,!1)},sign:function(e,t){var r=!1;"string"==typeof t&&(t=t.toUpperCase()),void 0===t||"RSASSA-PKCS1-V1_5"===t?(t={encode:y},r=1):"NONE"!==t&&"NULL"!==t&&null!==t||(t={encode:function(){return e}},r=1);var n=t.encode(e,l.n.bitLength());return c.rsa.encrypt(n,l,r)}};return l},c.wrapRsaPrivateKey=function(e){return s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,s.integerToDer(0).getBytes()),s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[s.create(s.Class.UNIVERSAL,s.Type.OID,!1,s.oidToDer(c.oids.rsaEncryption).getBytes()),s.create(s.Class.UNIVERSAL,s.Type.NULL,!1,"")]),s.create(s.Class.UNIVERSAL,s.Type.OCTETSTRING,!1,s.toDer(e).getBytes())])},c.privateKeyFromAsn1=function(e){var t,r,i,o,u,f,h,d,y={},g=[];if(s.validate(e,l,y,g)&&(e=s.fromDer(n.util.createBuffer(y.privateKey))),y={},g=[],!s.validate(e,p,y,g)){var v=new Error("Cannot read private key. ASN.1 object does not contain an RSAPrivateKey.");throw v.errors=g,v}return t=n.util.createBuffer(y.privateKeyModulus).toHex(),r=n.util.createBuffer(y.privateKeyPublicExponent).toHex(),i=n.util.createBuffer(y.privateKeyPrivateExponent).toHex(),o=n.util.createBuffer(y.privateKeyPrime1).toHex(),u=n.util.createBuffer(y.privateKeyPrime2).toHex(),f=n.util.createBuffer(y.privateKeyExponent1).toHex(),h=n.util.createBuffer(y.privateKeyExponent2).toHex(),d=n.util.createBuffer(y.privateKeyCoefficient).toHex(),c.setRsaPrivateKey(new a(t,16),new a(r,16),new a(i,16),new a(o,16),new a(u,16),new a(f,16),new a(h,16),new a(d,16))},c.privateKeyToAsn1=c.privateKeyToRSAPrivateKey=function(e){return s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,s.integerToDer(0).getBytes()),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,E(e.n)),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,E(e.e)),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,E(e.d)),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,E(e.p)),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,E(e.q)),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,E(e.dP)),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,E(e.dQ)),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,E(e.qInv))])},c.publicKeyFromAsn1=function(e){var t={},r=[];if(s.validate(e,h,t,r)){var i,o=s.derToOid(t.publicKeyOid);if(o!==c.oids.rsaEncryption)throw(i=new Error("Cannot read public key. Unknown OID.")).oid=o,i;e=t.rsaPublicKey}if(r=[],!s.validate(e,f,t,r))throw(i=new Error("Cannot read public key. ASN.1 object does not contain an RSAPublicKey.")).errors=r,i;var u=n.util.createBuffer(t.publicKeyModulus).toHex(),l=n.util.createBuffer(t.publicKeyExponent).toHex();return c.setRsaPublicKey(new a(u,16),new a(l,16))},c.publicKeyToAsn1=c.publicKeyToSubjectPublicKeyInfo=function(e){return s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[s.create(s.Class.UNIVERSAL,s.Type.OID,!1,s.oidToDer(c.oids.rsaEncryption).getBytes()),s.create(s.Class.UNIVERSAL,s.Type.NULL,!1,"")]),s.create(s.Class.UNIVERSAL,s.Type.BITSTRING,!1,[c.publicKeyToRSAPublicKey(e)])])},c.publicKeyToRSAPublicKey=function(e){return s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,E(e.n)),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,E(e.e))])}},function(e,t,r){var n,a=r(0);e.exports=a.jsbn=a.jsbn||{};function i(e,t,r){this.data=[],null!=e&&("number"==typeof e?this.fromNumber(e,t,r):null==t&&"string"!=typeof e?this.fromString(e,256):this.fromString(e,t))}function s(){return new i(null)}function o(e,t,r,n,a,i){for(var s=16383&t,o=t>>14;--i>=0;){var c=16383&this.data[e],u=this.data[e++]>>14,l=o*c+u*s;a=((c=s*c+((16383&l)<<14)+r.data[n]+a)>>28)+(l>>14)+o*u,r.data[n++]=268435455&c}return a}a.jsbn.BigInteger=i,"undefined"==typeof navigator?(i.prototype.am=o,n=28):"Microsoft Internet Explorer"==navigator.appName?(i.prototype.am=function(e,t,r,n,a,i){for(var s=32767&t,o=t>>15;--i>=0;){var c=32767&this.data[e],u=this.data[e++]>>15,l=o*c+u*s;a=((c=s*c+((32767&l)<<15)+r.data[n]+(1073741823&a))>>>30)+(l>>>15)+o*u+(a>>>30),r.data[n++]=1073741823&c}return a},n=30):"Netscape"!=navigator.appName?(i.prototype.am=function(e,t,r,n,a,i){for(;--i>=0;){var s=t*this.data[e++]+r.data[n]+a;a=Math.floor(s/67108864),r.data[n++]=67108863&s}return a},n=26):(i.prototype.am=o,n=28),i.prototype.DB=n,i.prototype.DM=(1<>>16)&&(e=t,r+=16),0!=(t=e>>8)&&(e=t,r+=8),0!=(t=e>>4)&&(e=t,r+=4),0!=(t=e>>2)&&(e=t,r+=2),0!=(t=e>>1)&&(e=t,r+=1),r}function y(e){this.m=e}function g(e){this.m=e,this.mp=e.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<>=16,t+=16),0==(255&e)&&(e>>=8,t+=8),0==(15&e)&&(e>>=4,t+=4),0==(3&e)&&(e>>=2,t+=2),0==(1&e)&&++t,t}function T(e){for(var t=0;0!=e;)e&=e-1,++t;return t}function I(){}function b(e){return e}function A(e){this.r2=s(),this.q3=s(),i.ONE.dlShiftTo(2*e.t,this.r2),this.mu=this.r2.divide(e),this.m=e}y.prototype.convert=function(e){return e.s<0||e.compareTo(this.m)>=0?e.mod(this.m):e},y.prototype.revert=function(e){return e},y.prototype.reduce=function(e){e.divRemTo(this.m,null,e)},y.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},y.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},g.prototype.convert=function(e){var t=s();return e.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),e.s<0&&t.compareTo(i.ZERO)>0&&this.m.subTo(t,t),t},g.prototype.revert=function(e){var t=s();return e.copyTo(t),this.reduce(t),t},g.prototype.reduce=function(e){for(;e.t<=this.mt2;)e.data[e.t++]=0;for(var t=0;t>15)*this.mpl&this.um)<<15)&e.DM;for(r=t+this.m.t,e.data[r]+=this.m.am(0,n,e,t,0,this.m.t);e.data[r]>=e.DV;)e.data[r]-=e.DV,e.data[++r]++}e.clamp(),e.drShiftTo(this.m.t,e),e.compareTo(this.m)>=0&&e.subTo(this.m,e)},g.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},g.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},i.prototype.copyTo=function(e){for(var t=this.t-1;t>=0;--t)e.data[t]=this.data[t];e.t=this.t,e.s=this.s},i.prototype.fromInt=function(e){this.t=1,this.s=e<0?-1:0,e>0?this.data[0]=e:e<-1?this.data[0]=e+this.DV:this.t=0},i.prototype.fromString=function(e,t){var r;if(16==t)r=4;else if(8==t)r=3;else if(256==t)r=8;else if(2==t)r=1;else if(32==t)r=5;else{if(4!=t)return void this.fromRadix(e,t);r=2}this.t=0,this.s=0;for(var n=e.length,a=!1,s=0;--n>=0;){var o=8==r?255&e[n]:f(e,n);o<0?"-"==e.charAt(n)&&(a=!0):(a=!1,0==s?this.data[this.t++]=o:s+r>this.DB?(this.data[this.t-1]|=(o&(1<>this.DB-s):this.data[this.t-1]|=o<=this.DB&&(s-=this.DB))}8==r&&0!=(128&e[0])&&(this.s=-1,s>0&&(this.data[this.t-1]|=(1<0&&this.data[this.t-1]==e;)--this.t},i.prototype.dlShiftTo=function(e,t){var r;for(r=this.t-1;r>=0;--r)t.data[r+e]=this.data[r];for(r=e-1;r>=0;--r)t.data[r]=0;t.t=this.t+e,t.s=this.s},i.prototype.drShiftTo=function(e,t){for(var r=e;r=0;--r)t.data[r+s+1]=this.data[r]>>a|o,o=(this.data[r]&i)<=0;--r)t.data[r]=0;t.data[s]=o,t.t=this.t+s+1,t.s=this.s,t.clamp()},i.prototype.rShiftTo=function(e,t){t.s=this.s;var r=Math.floor(e/this.DB);if(r>=this.t)t.t=0;else{var n=e%this.DB,a=this.DB-n,i=(1<>n;for(var s=r+1;s>n;n>0&&(t.data[this.t-r-1]|=(this.s&i)<>=this.DB;if(e.t>=this.DB;n+=this.s}else{for(n+=this.s;r>=this.DB;n-=e.s}t.s=n<0?-1:0,n<-1?t.data[r++]=this.DV+n:n>0&&(t.data[r++]=n),t.t=r,t.clamp()},i.prototype.multiplyTo=function(e,t){var r=this.abs(),n=e.abs(),a=r.t;for(t.t=a+n.t;--a>=0;)t.data[a]=0;for(a=0;a=0;)e.data[r]=0;for(r=0;r=t.DV&&(e.data[r+t.t]-=t.DV,e.data[r+t.t+1]=1)}e.t>0&&(e.data[e.t-1]+=t.am(r,t.data[r],e,2*r,0,1)),e.s=0,e.clamp()},i.prototype.divRemTo=function(e,t,r){var n=e.abs();if(!(n.t<=0)){var a=this.abs();if(a.t0?(n.lShiftTo(l,o),a.lShiftTo(l,r)):(n.copyTo(o),a.copyTo(r));var p=o.t,f=o.data[p-1];if(0!=f){var h=f*(1<1?o.data[p-2]>>this.F2:0),y=this.FV/h,g=(1<=0&&(r.data[r.t++]=1,r.subTo(E,r)),i.ONE.dlShiftTo(p,E),E.subTo(o,o);o.t=0;){var S=r.data[--m]==f?this.DM:Math.floor(r.data[m]*y+(r.data[m-1]+v)*g);if((r.data[m]+=o.am(0,S,r,C,0,p))0&&r.rShiftTo(l,r),c<0&&i.ZERO.subTo(r,r)}}},i.prototype.invDigit=function(){if(this.t<1)return 0;var e=this.data[0];if(0==(1&e))return 0;var t=3&e;return(t=(t=(t=(t=t*(2-(15&e)*t)&15)*(2-(255&e)*t)&255)*(2-((65535&e)*t&65535))&65535)*(2-e*t%this.DV)%this.DV)>0?this.DV-t:-t},i.prototype.isEven=function(){return 0==(this.t>0?1&this.data[0]:this.s)},i.prototype.exp=function(e,t){if(e>4294967295||e<1)return i.ONE;var r=s(),n=s(),a=t.convert(this),o=d(e)-1;for(a.copyTo(r);--o>=0;)if(t.sqrTo(r,n),(e&1<0)t.mulTo(n,a,r);else{var c=r;r=n,n=c}return t.revert(r)},i.prototype.toString=function(e){if(this.s<0)return"-"+this.negate().toString(e);var t;if(16==e)t=4;else if(8==e)t=3;else if(2==e)t=1;else if(32==e)t=5;else{if(4!=e)return this.toRadix(e);t=2}var r,n=(1<0)for(o>o)>0&&(a=!0,i=p(r));s>=0;)o>(o+=this.DB-t)):(r=this.data[s]>>(o-=t)&n,o<=0&&(o+=this.DB,--s)),r>0&&(a=!0),a&&(i+=p(r));return a?i:"0"},i.prototype.negate=function(){var e=s();return i.ZERO.subTo(this,e),e},i.prototype.abs=function(){return this.s<0?this.negate():this},i.prototype.compareTo=function(e){var t=this.s-e.s;if(0!=t)return t;var r=this.t;if(0!=(t=r-e.t))return this.s<0?-t:t;for(;--r>=0;)if(0!=(t=this.data[r]-e.data[r]))return t;return 0},i.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+d(this.data[this.t-1]^this.s&this.DM)},i.prototype.mod=function(e){var t=s();return this.abs().divRemTo(e,null,t),this.s<0&&t.compareTo(i.ZERO)>0&&e.subTo(t,t),t},i.prototype.modPowInt=function(e,t){var r;return r=e<256||t.isEven()?new y(t):new g(t),this.exp(e,r)},i.ZERO=h(0),i.ONE=h(1),I.prototype.convert=b,I.prototype.revert=b,I.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r)},I.prototype.sqrTo=function(e,t){e.squareTo(t)},A.prototype.convert=function(e){if(e.s<0||e.t>2*this.m.t)return e.mod(this.m);if(e.compareTo(this.m)<0)return e;var t=s();return e.copyTo(t),this.reduce(t),t},A.prototype.revert=function(e){return e},A.prototype.reduce=function(e){for(e.drShiftTo(this.m.t-1,this.r2),e.t>this.m.t+1&&(e.t=this.m.t+1,e.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);e.compareTo(this.r2)<0;)e.dAddOffset(1,this.m.t+1);for(e.subTo(this.r2,e);e.compareTo(this.m)>=0;)e.subTo(this.m,e)},A.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},A.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)};var B=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509],N=(1<<26)/B[B.length-1];i.prototype.chunkSize=function(e){return Math.floor(Math.LN2*this.DB/Math.log(e))},i.prototype.toRadix=function(e){if(null==e&&(e=10),0==this.signum()||e<2||e>36)return"0";var t=this.chunkSize(e),r=Math.pow(e,t),n=h(r),a=s(),i=s(),o="";for(this.divRemTo(n,a,i);a.signum()>0;)o=(r+i.intValue()).toString(e).substr(1)+o,a.divRemTo(n,a,i);return i.intValue().toString(e)+o},i.prototype.fromRadix=function(e,t){this.fromInt(0),null==t&&(t=10);for(var r=this.chunkSize(t),n=Math.pow(t,r),a=!1,s=0,o=0,c=0;c=r&&(this.dMultiply(n),this.dAddOffset(o,0),s=0,o=0))}s>0&&(this.dMultiply(Math.pow(t,s)),this.dAddOffset(o,0)),a&&i.ZERO.subTo(this,this)},i.prototype.fromNumber=function(e,t,r){if("number"==typeof t)if(e<2)this.fromInt(1);else for(this.fromNumber(e,r),this.testBit(e-1)||this.bitwiseTo(i.ONE.shiftLeft(e-1),m,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(t);)this.dAddOffset(2,0),this.bitLength()>e&&this.subTo(i.ONE.shiftLeft(e-1),this);else{var n=new Array,a=7&e;n.length=1+(e>>3),t.nextBytes(n),a>0?n[0]&=(1<>=this.DB;if(e.t>=this.DB;n+=this.s}else{for(n+=this.s;r>=this.DB;n+=e.s}t.s=n<0?-1:0,n>0?t.data[r++]=n:n<-1&&(t.data[r++]=this.DV+n),t.t=r,t.clamp()},i.prototype.dMultiply=function(e){this.data[this.t]=this.am(0,e-1,this,0,0,this.t),++this.t,this.clamp()},i.prototype.dAddOffset=function(e,t){if(0!=e){for(;this.t<=t;)this.data[this.t++]=0;for(this.data[t]+=e;this.data[t]>=this.DV;)this.data[t]-=this.DV,++t>=this.t&&(this.data[this.t++]=0),++this.data[t]}},i.prototype.multiplyLowerTo=function(e,t,r){var n,a=Math.min(this.t+e.t,t);for(r.s=0,r.t=a;a>0;)r.data[--a]=0;for(n=r.t-this.t;a=0;)r.data[n]=0;for(n=Math.max(t-this.t,0);n0)if(0==t)r=this.data[0]%e;else for(var n=this.t-1;n>=0;--n)r=(t*r+this.data[n])%e;return r},i.prototype.millerRabin=function(e){var t=this.subtract(i.ONE),r=t.getLowestSetBit();if(r<=0)return!1;for(var n,a=t.shiftRight(r),s={nextBytes:function(e){for(var t=0;t=0);var c=n.modPow(a,this);if(0!=c.compareTo(i.ONE)&&0!=c.compareTo(t)){for(var u=1;u++>24},i.prototype.shortValue=function(){return 0==this.t?this.s:this.data[0]<<16>>16},i.prototype.signum=function(){return this.s<0?-1:this.t<=0||1==this.t&&this.data[0]<=0?0:1},i.prototype.toByteArray=function(){var e=this.t,t=new Array;t[0]=this.s;var r,n=this.DB-e*this.DB%8,a=0;if(e-- >0)for(n>n)!=(this.s&this.DM)>>n&&(t[a++]=r|this.s<=0;)n<8?(r=(this.data[e]&(1<>(n+=this.DB-8)):(r=this.data[e]>>(n-=8)&255,n<=0&&(n+=this.DB,--e)),0!=(128&r)&&(r|=-256),0==a&&(128&this.s)!=(128&r)&&++a,(a>0||r!=this.s)&&(t[a++]=r);return t},i.prototype.equals=function(e){return 0==this.compareTo(e)},i.prototype.min=function(e){return this.compareTo(e)<0?this:e},i.prototype.max=function(e){return this.compareTo(e)>0?this:e},i.prototype.and=function(e){var t=s();return this.bitwiseTo(e,v,t),t},i.prototype.or=function(e){var t=s();return this.bitwiseTo(e,m,t),t},i.prototype.xor=function(e){var t=s();return this.bitwiseTo(e,C,t),t},i.prototype.andNot=function(e){var t=s();return this.bitwiseTo(e,E,t),t},i.prototype.not=function(){for(var e=s(),t=0;t=this.t?0!=this.s:0!=(this.data[t]&1<1){var p=s();for(n.sqrTo(o[1],p);c<=l;)o[c]=s(),n.mulTo(p,o[c-2],o[c]),c+=2}var f,v,m=e.t-1,C=!0,E=s();for(a=d(e.data[m])-1;m>=0;){for(a>=u?f=e.data[m]>>a-u&l:(f=(e.data[m]&(1<0&&(f|=e.data[m-1]>>this.DB+a-u)),c=r;0==(1&f);)f>>=1,--c;if((a-=c)<0&&(a+=this.DB,--m),C)o[f].copyTo(i),C=!1;else{for(;c>1;)n.sqrTo(i,E),n.sqrTo(E,i),c-=2;c>0?n.sqrTo(i,E):(v=i,i=E,E=v),n.mulTo(E,o[f],i)}for(;m>=0&&0==(e.data[m]&1<=0?(r.subTo(n,r),t&&a.subTo(o,a),s.subTo(c,s)):(n.subTo(r,n),t&&o.subTo(a,o),c.subTo(s,c))}return 0!=n.compareTo(i.ONE)?i.ZERO:c.compareTo(e)>=0?c.subtract(e):c.signum()<0?(c.addTo(e,c),c.signum()<0?c.add(e):c):c},i.prototype.pow=function(e){return this.exp(e,new I)},i.prototype.gcd=function(e){var t=this.s<0?this.negate():this.clone(),r=e.s<0?e.negate():e.clone();if(t.compareTo(r)<0){var n=t;t=r,r=n}var a=t.getLowestSetBit(),i=r.getLowestSetBit();if(i<0)return t;for(a0&&(t.rShiftTo(i,t),r.rShiftTo(i,r));t.signum()>0;)(a=t.getLowestSetBit())>0&&t.rShiftTo(a,t),(a=r.getLowestSetBit())>0&&r.rShiftTo(a,r),t.compareTo(r)>=0?(t.subTo(r,t),t.rShiftTo(1,t)):(r.subTo(t,r),r.rShiftTo(1,r));return i>0&&r.lShiftTo(i,r),r},i.prototype.isProbablePrime=function(e){var t,r=this.abs();if(1==r.t&&r.data[0]<=B[B.length-1]){for(t=0;t>>0,o>>>0];for(var c=a.fullMessageLength.length-1;c>=0;--c)a.fullMessageLength[c]+=o[1],o[1]=o[0]+(a.fullMessageLength[c]/4294967296>>>0),a.fullMessageLength[c]=a.fullMessageLength[c]>>>0,o[0]=o[1]/4294967296>>>0;return t.putBytes(i),l(e,r,t),(t.read>2048||0===t.length())&&t.compact(),a},a.digest=function(){var s=n.util.createBuffer();s.putBytes(t.bytes());var o=a.fullMessageLength[a.fullMessageLength.length-1]+a.messageLengthSize&a.blockLength-1;s.putBytes(i.substr(0,a.blockLength-o));for(var c,u=0,p=a.fullMessageLength.length-1;p>=0;--p)u=(c=8*a.fullMessageLength[p]+u)/4294967296>>>0,s.putInt32Le(c>>>0);var f={h0:e.h0,h1:e.h1,h2:e.h2,h3:e.h3};l(f,r,s);var h=n.util.createBuffer();return h.putInt32Le(f.h0),h.putInt32Le(f.h1),h.putInt32Le(f.h2),h.putInt32Le(f.h3),h},a};var i=null,s=null,o=null,c=null,u=!1;function l(e,t,r){for(var n,a,i,u,l,p,f,h=r.length();h>=64;){for(a=e.h0,i=e.h1,u=e.h2,l=e.h3,f=0;f<16;++f)t[f]=r.getInt32Le(),n=a+(l^i&(u^l))+c[f]+t[f],a=l,l=u,u=i,i+=n<<(p=o[f])|n>>>32-p;for(;f<32;++f)n=a+(u^l&(i^u))+c[f]+t[s[f]],a=l,l=u,u=i,i+=n<<(p=o[f])|n>>>32-p;for(;f<48;++f)n=a+(i^u^l)+c[f]+t[s[f]],a=l,l=u,u=i,i+=n<<(p=o[f])|n>>>32-p;for(;f<64;++f)n=a+(u^(i|~l))+c[f]+t[s[f]],a=l,l=u,u=i,i+=n<<(p=o[f])|n>>>32-p;e.h0=e.h0+a|0,e.h1=e.h1+i|0,e.h2=e.h2+u|0,e.h3=e.h3+l|0,h-=64}}},function(e,t,r){var n=r(0);r(8),r(4),r(1);var a,i=n.pkcs5=n.pkcs5||{};n.util.isNodejs&&!n.options.usePureJavaScript&&(a=r(17)),e.exports=n.pbkdf2=i.pbkdf2=function(e,t,r,i,s,o){if("function"==typeof s&&(o=s,s=null),n.util.isNodejs&&!n.options.usePureJavaScript&&a.pbkdf2&&(null===s||"object"!=typeof s)&&(a.pbkdf2Sync.length>4||!s||"sha1"===s))return"string"!=typeof s&&(s="sha1"),e=Buffer.from(e,"binary"),t=Buffer.from(t,"binary"),o?4===a.pbkdf2Sync.length?a.pbkdf2(e,t,r,i,(function(e,t){if(e)return o(e);o(null,t.toString("binary"))})):a.pbkdf2(e,t,r,i,s,(function(e,t){if(e)return o(e);o(null,t.toString("binary"))})):4===a.pbkdf2Sync.length?a.pbkdf2Sync(e,t,r,i).toString("binary"):a.pbkdf2Sync(e,t,r,i,s).toString("binary");if(null==s&&(s="sha1"),"string"==typeof s){if(!(s in n.md.algorithms))throw new Error("Unknown hash algorithm: "+s);s=n.md[s].create()}var c=s.digestLength;if(i>4294967295*c){var u=new Error("Derived key is too long.");if(o)return o(u);throw u}var l=Math.ceil(i/c),p=i-(l-1)*c,f=n.hmac.create();f.start(s,e);var h,d,y,g="";if(!o){for(var v=1;v<=l;++v){f.start(null,null),f.update(t),f.update(n.util.int32ToBytes(v)),h=y=f.digest().getBytes();for(var m=2;m<=r;++m)f.start(null,null),f.update(y),d=f.digest().getBytes(),h=n.util.xorBytes(h,d,c),y=d;g+=vl)return o(null,g);f.start(null,null),f.update(t),f.update(n.util.int32ToBytes(v)),h=y=f.digest().getBytes(),m=2,E()}function E(){if(m<=r)return f.start(null,null),f.update(y),d=f.digest().getBytes(),h=n.util.xorBytes(h,d,c),y=d,++m,n.util.setImmediate(E);g+=v128)throw new Error('Invalid "nsComment" content.');e.value=a.create(a.Class.UNIVERSAL,a.Type.IA5STRING,!1,e.comment)}else if("subjectKeyIdentifier"===e.name&&t.cert){var h=t.cert.generateSubjectKeyIdentifier();e.subjectKeyIdentifier=h.toHex(),e.value=a.create(a.Class.UNIVERSAL,a.Type.OCTETSTRING,!1,h.getBytes())}else if("authorityKeyIdentifier"===e.name&&t.cert){e.value=a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[]);l=e.value.value;if(e.keyIdentifier){var d=!0===e.keyIdentifier?t.cert.generateSubjectKeyIdentifier().getBytes():e.keyIdentifier;l.push(a.create(a.Class.CONTEXT_SPECIFIC,0,!1,d))}if(e.authorityCertIssuer){var y=[a.create(a.Class.CONTEXT_SPECIFIC,4,!0,[v(!0===e.authorityCertIssuer?t.cert.issuer:e.authorityCertIssuer)])];l.push(a.create(a.Class.CONTEXT_SPECIFIC,1,!0,y))}if(e.serialNumber){var g=n.util.hexToBytes(!0===e.serialNumber?t.cert.serialNumber:e.serialNumber);l.push(a.create(a.Class.CONTEXT_SPECIFIC,2,!1,g))}}else if("cRLDistributionPoints"===e.name){e.value=a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[]);l=e.value.value;var m,C=a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[]),E=a.create(a.Class.CONTEXT_SPECIFIC,0,!0,[]);for(f=0;f2)throw new Error("Cannot read notBefore/notAfter validity times; more than two times were provided in the certificate.");if(p.length<2)throw new Error("Cannot read notBefore/notAfter validity times; they were not provided as either UTCTime or GeneralizedTime.");if(c.validity.notBefore=p[0],c.validity.notAfter=p[1],c.tbsCertificate=r.tbsCertificate,t){c.md=y({signatureOid:c.signatureOid,type:"certificate"});var f=a.toDer(c.tbsCertificate);c.md.update(f.getBytes())}var g=n.md.sha1.create(),v=a.toDer(r.certIssuer);g.update(v.getBytes()),c.issuer.getField=function(e){return h(c.issuer,e)},c.issuer.addField=function(e){m([e]),c.issuer.attributes.push(e)},c.issuer.attributes=i.RDNAttributesAsArray(r.certIssuer),r.certIssuerUniqueId&&(c.issuer.uniqueId=r.certIssuerUniqueId),c.issuer.hash=g.digest().toHex();var C=n.md.sha1.create(),E=a.toDer(r.certSubject);return C.update(E.getBytes()),c.subject.getField=function(e){return h(c.subject,e)},c.subject.addField=function(e){m([e]),c.subject.attributes.push(e)},c.subject.attributes=i.RDNAttributesAsArray(r.certSubject),r.certSubjectUniqueId&&(c.subject.uniqueId=r.certSubjectUniqueId),c.subject.hash=C.digest().toHex(),r.certExtensions?c.extensions=i.certificateExtensionsFromAsn1(r.certExtensions):c.extensions=[],c.publicKey=i.publicKeyFromAsn1(r.subjectPublicKeyInfo),c},i.certificateExtensionsFromAsn1=function(e){for(var t=[],r=0;r1&&(r=c.value.charCodeAt(1),i=c.value.length>2?c.value.charCodeAt(2):0),t.digitalSignature=128==(128&r),t.nonRepudiation=64==(64&r),t.keyEncipherment=32==(32&r),t.dataEncipherment=16==(16&r),t.keyAgreement=8==(8&r),t.keyCertSign=4==(4&r),t.cRLSign=2==(2&r),t.encipherOnly=1==(1&r),t.decipherOnly=128==(128&i)}else if("basicConstraints"===t.name){(c=a.fromDer(t.value)).value.length>0&&c.value[0].type===a.Type.BOOLEAN?t.cA=0!==c.value[0].value.charCodeAt(0):t.cA=!1;var o=null;c.value.length>0&&c.value[0].type===a.Type.INTEGER?o=c.value[0].value:c.value.length>1&&(o=c.value[1].value),null!==o&&(t.pathLenConstraint=a.derToInteger(o))}else if("extKeyUsage"===t.name)for(var c=a.fromDer(t.value),u=0;u1&&(r=c.value.charCodeAt(1)),t.client=128==(128&r),t.server=64==(64&r),t.email=32==(32&r),t.objsign=16==(16&r),t.reserved=8==(8&r),t.sslCA=4==(4&r),t.emailCA=2==(2&r),t.objCA=1==(1&r)}else if("subjectAltName"===t.name||"issuerAltName"===t.name){var p;t.altNames=[];c=a.fromDer(t.value);for(var f=0;f=T&&e0&&s.value.push(i.certificateExtensionsToAsn1(e.extensions)),s},i.getCertificationRequestInfo=function(e){return a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,a.integerToDer(e.version).getBytes()),v(e.subject),i.publicKeyToAsn1(e.publicKey),S(e)])},i.distinguishedNameToAsn1=function(e){return v(e)},i.certificateToAsn1=function(e){var t=e.tbsCertificate||i.getTBSCertificate(e);return a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[t,a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.OID,!1,a.oidToDer(e.signatureOid).getBytes()),E(e.signatureOid,e.signatureParameters)]),a.create(a.Class.UNIVERSAL,a.Type.BITSTRING,!1,String.fromCharCode(0)+e.signature)])},i.certificateExtensionsToAsn1=function(e){var t=a.create(a.Class.CONTEXT_SPECIFIC,3,!0,[]),r=a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[]);t.value.push(r);for(var n=0;nl.validity.notAfter)&&(c={message:"Certificate is not valid yet or has expired.",error:i.certificateError.certificate_expired,notBefore:l.validity.notBefore,notAfter:l.validity.notAfter,now:s}),null===c){if(null===(p=t[0]||e.getIssuer(l))&&l.isIssuer(l)&&(f=!0,p=l),p){var h=p;n.util.isArray(h)||(h=[h]);for(var d=!1;!d&&h.length>0;){p=h.shift();try{d=p.verify(l)}catch(e){}}d||(c={message:"Certificate signature is invalid.",error:i.certificateError.bad_certificate})}null!==c||p&&!f||e.hasCertificate(l)||(c={message:"Certificate is not trusted.",error:i.certificateError.unknown_ca})}if(null===c&&p&&!l.isIssuer(p)&&(c={message:"Certificate issuer is invalid.",error:i.certificateError.bad_certificate}),null===c)for(var y={keyUsage:!0,basicConstraints:!0},g=0;null===c&&gm.pathLenConstraint&&(c={message:"Certificate basicConstraints pathLenConstraint violated.",error:i.certificateError.bad_certificate})}var E=null===c||c.error,S=r.verify?r.verify(E,u,a):E;if(!0!==S)throw!0===E&&(c={message:"The application rejected the certificate.",error:i.certificateError.bad_certificate}),(S||0===S)&&("object"!=typeof S||n.util.isArray(S)?"string"==typeof S&&(c.error=S):(S.message&&(c.message=S.message),S.error&&(c.error=S.error))),c;c=null,o=!1,++u}while(t.length>0);return!0}},function(e,t,r){var n=r(0);r(2),r(1),(e.exports=n.pss=n.pss||{}).create=function(e){3===arguments.length&&(e={md:arguments[0],mgf:arguments[1],saltLength:arguments[2]});var t,r=e.md,a=e.mgf,i=r.digestLength,s=e.salt||null;if("string"==typeof s&&(s=n.util.createBuffer(s)),"saltLength"in e)t=e.saltLength;else{if(null===s)throw new Error("Salt length not specified or specific salt not given.");t=s.length()}if(null!==s&&s.length()!==t)throw new Error("Given salt length does not match length of given salt.");var o=e.prng||n.random,c={encode:function(e,c){var u,l,p=c-1,f=Math.ceil(p/8),h=e.digest().getBytes();if(f>8*f-p&255;return(E=String.fromCharCode(E.charCodeAt(0)&~S)+E.substr(1))+y+String.fromCharCode(188)},verify:function(e,s,o){var c,u=o-1,l=Math.ceil(u/8);if(s=s.substr(-l),l>8*l-u&255;if(0!=(f.charCodeAt(0)&d))throw new Error("Bits beyond keysize not zero as expected.");var y=a.generate(h,p),g="";for(c=0;c4){var r=e;e=n.util.createBuffer();for(var a=0;a0))return!0;for(var n=0;n0))return!0;for(var n=0;n0)return!1;var r=e.length(),n=e.at(r-1);return!(n>this.blockSize<<2)&&(e.truncate(n),!0)},a.cbc=function(e){e=e||{},this.name="CBC",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)},a.cbc.prototype.start=function(e){if(null===e.iv){if(!this._prev)throw new Error("Invalid IV parameter.");this._iv=this._prev.slice(0)}else{if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=i(e.iv,this.blockSize),this._prev=this._iv.slice(0)}},a.cbc.prototype.encrypt=function(e,t,r){if(e.length()0))return!0;for(var n=0;n0))return!0;for(var n=0;n0)return!1;var r=e.length(),n=e.at(r-1);return!(n>this.blockSize<<2)&&(e.truncate(n),!0)},a.cfb=function(e){e=e||{},this.name="CFB",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialBlock=new Array(this._ints),this._partialOutput=n.util.createBuffer(),this._partialBytes=0},a.cfb.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=i(e.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},a.cfb.prototype.encrypt=function(e,t,r){var n=e.length();if(0===n)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&n>=this.blockSize)for(var a=0;a0&&(i=this.blockSize-i),this._partialOutput.clear();for(a=0;a0)e.read-=this.blockSize;else for(a=0;a0&&this._partialOutput.getBytes(this._partialBytes),i>0&&!r)return t.putBytes(this._partialOutput.getBytes(i-this._partialBytes)),this._partialBytes=i,!0;t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}},a.cfb.prototype.decrypt=function(e,t,r){var n=e.length();if(0===n)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&n>=this.blockSize)for(var a=0;a0&&(i=this.blockSize-i),this._partialOutput.clear();for(a=0;a0)e.read-=this.blockSize;else for(a=0;a0&&this._partialOutput.getBytes(this._partialBytes),i>0&&!r)return t.putBytes(this._partialOutput.getBytes(i-this._partialBytes)),this._partialBytes=i,!0;t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}},a.ofb=function(e){e=e||{},this.name="OFB",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=n.util.createBuffer(),this._partialBytes=0},a.ofb.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=i(e.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},a.ofb.prototype.encrypt=function(e,t,r){var n=e.length();if(0===e.length())return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&n>=this.blockSize)for(var a=0;a0&&(i=this.blockSize-i),this._partialOutput.clear();for(a=0;a0)e.read-=this.blockSize;else for(a=0;a0&&this._partialOutput.getBytes(this._partialBytes),i>0&&!r)return t.putBytes(this._partialOutput.getBytes(i-this._partialBytes)),this._partialBytes=i,!0;t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}},a.ofb.prototype.decrypt=a.ofb.prototype.encrypt,a.ctr=function(e){e=e||{},this.name="CTR",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=n.util.createBuffer(),this._partialBytes=0},a.ctr.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=i(e.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},a.ctr.prototype.encrypt=function(e,t,r){var n=e.length();if(0===n)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&n>=this.blockSize)for(var a=0;a0&&(i=this.blockSize-i),this._partialOutput.clear();for(a=0;a0&&(e.read-=this.blockSize),this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),i>0&&!r)return t.putBytes(this._partialOutput.getBytes(i-this._partialBytes)),this._partialBytes=i,!0;t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}s(this._inBlock)},a.ctr.prototype.decrypt=a.ctr.prototype.encrypt,a.gcm=function(e){e=e||{},this.name="GCM",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints),this._partialOutput=n.util.createBuffer(),this._partialBytes=0,this._R=3774873600},a.gcm.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");var t,r=n.util.createBuffer(e.iv);if(this._cipherLength=0,t="additionalData"in e?n.util.createBuffer(e.additionalData):n.util.createBuffer(),this._tagLength="tagLength"in e?e.tagLength:128,this._tag=null,e.decrypt&&(this._tag=n.util.createBuffer(e.tag).getBytes(),this._tag.length!==this._tagLength/8))throw new Error("Authentication tag does not match tag length.");this._hashBlock=new Array(this._ints),this.tag=null,this._hashSubkey=new Array(this._ints),this.cipher.encrypt([0,0,0,0],this._hashSubkey),this.componentBits=4,this._m=this.generateHashTable(this._hashSubkey,this.componentBits);var a=r.length();if(12===a)this._j0=[r.getInt32(),r.getInt32(),r.getInt32(),1];else{for(this._j0=[0,0,0,0];r.length()>0;)this._j0=this.ghash(this._hashSubkey,this._j0,[r.getInt32(),r.getInt32(),r.getInt32(),r.getInt32()]);this._j0=this.ghash(this._hashSubkey,this._j0,[0,0].concat(o(8*a)))}this._inBlock=this._j0.slice(0),s(this._inBlock),this._partialBytes=0,t=n.util.createBuffer(t),this._aDataLength=o(8*t.length());var i=t.length()%this.blockSize;for(i&&t.fillWithByte(0,this.blockSize-i),this._s=[0,0,0,0];t.length()>0;)this._s=this.ghash(this._hashSubkey,this._s,[t.getInt32(),t.getInt32(),t.getInt32(),t.getInt32()])},a.gcm.prototype.encrypt=function(e,t,r){var n=e.length();if(0===n)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&n>=this.blockSize){for(var a=0;a0&&(i=this.blockSize-i),this._partialOutput.clear();for(a=0;a0&&this._partialOutput.getBytes(this._partialBytes),i>0&&!r)return e.read-=this.blockSize,t.putBytes(this._partialOutput.getBytes(i-this._partialBytes)),this._partialBytes=i,!0;t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}this._s=this.ghash(this._hashSubkey,this._s,this._outBlock),s(this._inBlock)},a.gcm.prototype.decrypt=function(e,t,r){var n=e.length();if(n0))return!0;this.cipher.encrypt(this._inBlock,this._outBlock),s(this._inBlock),this._hashBlock[0]=e.getInt32(),this._hashBlock[1]=e.getInt32(),this._hashBlock[2]=e.getInt32(),this._hashBlock[3]=e.getInt32(),this._s=this.ghash(this._hashSubkey,this._s,this._hashBlock);for(var a=0;a0;--n)t[n]=e[n]>>>1|(1&e[n-1])<<31;t[0]=e[0]>>>1,r&&(t[0]^=this._R)},a.gcm.prototype.tableMultiply=function(e){for(var t=[0,0,0,0],r=0;r<32;++r){var n=e[r/8|0]>>>4*(7-r%8)&15,a=this._m[r][n];t[0]^=a[0],t[1]^=a[1],t[2]^=a[2],t[3]^=a[3]}return t},a.gcm.prototype.ghash=function(e,t,r){return t[0]^=r[0],t[1]^=r[1],t[2]^=r[2],t[3]^=r[3],this.tableMultiply(t)},a.gcm.prototype.generateHashTable=function(e,t){for(var r=8/t,n=4*r,a=16*r,i=new Array(a),s=0;s>>1,a=new Array(r);a[n]=e.slice(0);for(var i=n>>>1;i>0;)this.pow(a[2*i],a[i]=[]),i>>=1;for(i=2;i=0;c--)w>>=8,w+=A.at(c)+k.at(c),k.setAt(c,255&w);N.putBuffer(k)}E=N,p.putBuffer(I)}return p.truncate(p.length()-i),p},s.pbe.getCipher=function(e,t,r){switch(e){case s.oids.pkcs5PBES2:return s.pbe.getCipherForPBES2(e,t,r);case s.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:case s.oids["pbewithSHAAnd40BitRC2-CBC"]:return s.pbe.getCipherForPKCS12PBE(e,t,r);default:var n=new Error("Cannot read encrypted PBE data block. Unsupported OID.");throw n.oid=e,n.supportedOids=["pkcs5PBES2","pbeWithSHAAnd3-KeyTripleDES-CBC","pbewithSHAAnd40BitRC2-CBC"],n}},s.pbe.getCipherForPBES2=function(e,t,r){var a,o={},c=[];if(!i.validate(t,u,o,c))throw(a=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.")).errors=c,a;if((e=i.derToOid(o.kdfOid))!==s.oids.pkcs5PBKDF2)throw(a=new Error("Cannot read encrypted private key. Unsupported key derivation function OID.")).oid=e,a.supportedOids=["pkcs5PBKDF2"],a;if((e=i.derToOid(o.encOid))!==s.oids["aes128-CBC"]&&e!==s.oids["aes192-CBC"]&&e!==s.oids["aes256-CBC"]&&e!==s.oids["des-EDE3-CBC"]&&e!==s.oids.desCBC)throw(a=new Error("Cannot read encrypted private key. Unsupported encryption scheme OID.")).oid=e,a.supportedOids=["aes128-CBC","aes192-CBC","aes256-CBC","des-EDE3-CBC","desCBC"],a;var l,p,h=o.kdfSalt,d=n.util.createBuffer(o.kdfIterationCount);switch(d=d.getInt(d.length()<<3),s.oids[e]){case"aes128-CBC":l=16,p=n.aes.createDecryptionCipher;break;case"aes192-CBC":l=24,p=n.aes.createDecryptionCipher;break;case"aes256-CBC":l=32,p=n.aes.createDecryptionCipher;break;case"des-EDE3-CBC":l=24,p=n.des.createDecryptionCipher;break;case"desCBC":l=8,p=n.des.createDecryptionCipher}var y=f(o.prfOid),g=n.pkcs5.pbkdf2(r,h,d,l,y),v=o.encIv,m=p(g);return m.start(v),m},s.pbe.getCipherForPKCS12PBE=function(e,t,r){var a={},o=[];if(!i.validate(t,l,a,o))throw(y=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.")).errors=o,y;var c,u,p,h=n.util.createBuffer(a.salt),d=n.util.createBuffer(a.iterations);switch(d=d.getInt(d.length()<<3),e){case s.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:c=24,u=8,p=n.des.startDecrypting;break;case s.oids["pbewithSHAAnd40BitRC2-CBC"]:c=5,u=8,p=function(e,t){var r=n.rc2.createDecryptionCipher(e,40);return r.start(t,null),r};break;default:var y;throw(y=new Error("Cannot read PKCS #12 PBE data block. Unsupported OID.")).oid=e,y}var g=f(a.prfOid),v=s.pbe.generatePkcs12Key(r,h,1,d,c,g);return g.start(),p(v,s.pbe.generatePkcs12Key(r,h,2,d,u,g))},s.pbe.opensslDeriveBytes=function(e,t,r,a){if(null==a){if(!("md5"in n.md))throw new Error('"md5" hash algorithm unavailable.');a=n.md.md5.create()}null===t&&(t="");for(var i=[p(a,e+t)],s=16,o=1;s>>0,o>>>0];for(var u=a.fullMessageLength.length-1;u>=0;--u)a.fullMessageLength[u]+=o[1],o[1]=o[0]+(a.fullMessageLength[u]/4294967296>>>0),a.fullMessageLength[u]=a.fullMessageLength[u]>>>0,o[0]=o[1]/4294967296>>>0;return t.putBytes(i),c(e,r,t),(t.read>2048||0===t.length())&&t.compact(),a},a.digest=function(){var s=n.util.createBuffer();s.putBytes(t.bytes());var o,u=a.fullMessageLength[a.fullMessageLength.length-1]+a.messageLengthSize&a.blockLength-1;s.putBytes(i.substr(0,a.blockLength-u));for(var l=8*a.fullMessageLength[0],p=0;p>>0,s.putInt32(l>>>0),l=o>>>0;s.putInt32(l);var f={h0:e.h0,h1:e.h1,h2:e.h2,h3:e.h3,h4:e.h4,h5:e.h5,h6:e.h6,h7:e.h7};c(f,r,s);var h=n.util.createBuffer();return h.putInt32(f.h0),h.putInt32(f.h1),h.putInt32(f.h2),h.putInt32(f.h3),h.putInt32(f.h4),h.putInt32(f.h5),h.putInt32(f.h6),h.putInt32(f.h7),h},a};var i=null,s=!1,o=null;function c(e,t,r){for(var n,a,i,s,c,u,l,p,f,h,d,y,g,v=r.length();v>=64;){for(c=0;c<16;++c)t[c]=r.getInt32();for(;c<64;++c)n=((n=t[c-2])>>>17|n<<15)^(n>>>19|n<<13)^n>>>10,a=((a=t[c-15])>>>7|a<<25)^(a>>>18|a<<14)^a>>>3,t[c]=n+t[c-7]+a+t[c-16]|0;for(u=e.h0,l=e.h1,p=e.h2,f=e.h3,h=e.h4,d=e.h5,y=e.h6,g=e.h7,c=0;c<64;++c)i=(u>>>2|u<<30)^(u>>>13|u<<19)^(u>>>22|u<<10),s=u&l|p&(u^l),n=g+((h>>>6|h<<26)^(h>>>11|h<<21)^(h>>>25|h<<7))+(y^h&(d^y))+o[c]+t[c],g=y,y=d,d=h,h=f+n>>>0,f=p,p=l,l=u,u=n+(a=i+s)>>>0;e.h0=e.h0+u|0,e.h1=e.h1+l|0,e.h2=e.h2+p|0,e.h3=e.h3+f|0,e.h4=e.h4+h|0,e.h5=e.h5+d|0,e.h6=e.h6+y|0,e.h7=e.h7+g|0,v-=64}}},function(e,t,r){var n=r(0);r(1);var a=null;!n.util.isNodejs||n.options.usePureJavaScript||process.versions["node-webkit"]||(a=r(17)),(e.exports=n.prng=n.prng||{}).create=function(e){for(var t={plugin:e,key:null,seed:null,time:null,reseeds:0,generated:0,keyBytes:""},r=e.md,i=new Array(32),s=0;s<32;++s)i[s]=r.create();function o(){if(t.pools[0].messageLength>=32)return c();var e=32-t.pools[0].messageLength<<5;t.collect(t.seedFileSync(e)),c()}function c(){t.reseeds=4294967295===t.reseeds?0:t.reseeds+1;var e=t.plugin.md.create();e.update(t.keyBytes);for(var r=1,n=0;n<32;++n)t.reseeds%r==0&&(e.update(t.pools[n].digest().getBytes()),t.pools[n].start()),r<<=1;t.keyBytes=e.digest().getBytes(),e.start(),e.update(t.keyBytes);var a=e.digest().getBytes();t.key=t.plugin.formatKey(t.keyBytes),t.seed=t.plugin.formatSeed(a),t.generated=0}function u(e){var t=null,r=n.util.globalScope,a=r.crypto||r.msCrypto;a&&a.getRandomValues&&(t=function(e){return a.getRandomValues(e)});var i=n.util.createBuffer();if(t)for(;i.length()>16)))<<16,f=4294967295&(l=(2147483647&(l+=u>>15))+(l>>31));for(c=0;c<3;++c)p=f>>>(c<<3),p^=Math.floor(256*Math.random()),i.putByte(255&p)}return i.getBytes(e)}return t.pools=i,t.pool=0,t.generate=function(e,r){if(!r)return t.generateSync(e);var a=t.plugin.cipher,i=t.plugin.increment,s=t.plugin.formatKey,o=t.plugin.formatSeed,u=n.util.createBuffer();t.key=null,function l(p){if(p)return r(p);if(u.length()>=e)return r(null,u.getBytes(e));t.generated>1048575&&(t.key=null);if(null===t.key)return n.util.nextTick((function(){!function(e){if(t.pools[0].messageLength>=32)return c(),e();var r=32-t.pools[0].messageLength<<5;t.seedFile(r,(function(r,n){if(r)return e(r);t.collect(n),c(),e()}))}(l)}));var f=a(t.key,t.seed);t.generated+=f.length,u.putBytes(f),t.key=s(a(t.key,i(t.seed))),t.seed=o(a(t.key,t.seed)),n.util.setImmediate(l)}()},t.generateSync=function(e){var r=t.plugin.cipher,a=t.plugin.increment,i=t.plugin.formatKey,s=t.plugin.formatSeed;t.key=null;for(var c=n.util.createBuffer();c.length()1048575&&(t.key=null),null===t.key&&o();var u=r(t.key,t.seed);t.generated+=u.length,c.putBytes(u),t.key=i(r(t.key,a(t.seed))),t.seed=s(r(t.key,t.seed))}return c.getBytes(e)},a?(t.seedFile=function(e,t){a.randomBytes(e,(function(e,r){if(e)return t(e);t(null,r.toString())}))},t.seedFileSync=function(e){return a.randomBytes(e).toString()}):(t.seedFile=function(e,t){try{t(null,u(e))}catch(e){t(e)}},t.seedFileSync=u),t.collect=function(e){for(var r=e.length,n=0;n>a&255);t.collect(n)},t.registerWorker=function(e){if(e===self)t.seedFile=function(e,t){self.addEventListener("message",(function e(r){var n=r.data;n.forge&&n.forge.prng&&(self.removeEventListener("message",e),t(n.forge.prng.err,n.forge.prng.bytes))})),self.postMessage({forge:{prng:{needed:e}}})};else{e.addEventListener("message",(function(r){var n=r.data;n.forge&&n.forge.prng&&t.seedFile(n.forge.prng.needed,(function(t,r){e.postMessage({forge:{prng:{err:t,bytes:r}}})}))}))}},t}},function(e,t,r){var n=r(0);r(1);var a=[217,120,249,196,25,221,181,237,40,233,253,121,74,160,216,157,198,126,55,131,43,118,83,142,98,76,100,136,68,139,251,162,23,154,89,245,135,179,79,19,97,69,109,141,9,129,125,50,189,143,64,235,134,183,123,11,240,149,33,34,92,107,78,130,84,214,101,147,206,96,178,28,115,86,192,20,167,140,241,220,18,117,202,31,59,190,228,209,66,61,212,48,163,60,182,38,111,191,14,218,70,105,7,87,39,242,29,155,188,148,67,3,248,17,199,246,144,239,62,231,6,195,213,47,200,102,30,215,8,232,234,222,128,82,238,247,132,170,114,172,53,77,106,42,150,26,210,113,90,21,73,116,75,159,208,94,4,24,164,236,194,224,65,110,15,81,203,204,36,145,175,80,161,244,112,57,153,124,58,133,35,184,180,122,252,2,54,91,37,85,151,49,45,93,250,152,227,138,146,174,5,223,41,16,103,108,186,201,211,0,230,207,225,158,168,44,99,22,1,63,88,226,137,169,13,56,52,27,171,51,255,176,187,72,12,95,185,177,205,46,197,243,219,71,229,165,156,119,10,166,32,104,254,127,193,173],i=[1,2,3,5],s=function(e,t){return e<>16-t},o=function(e,t){return(65535&e)>>t|e<<16-t&65535};e.exports=n.rc2=n.rc2||{},n.rc2.expandKey=function(e,t){"string"==typeof e&&(e=n.util.createBuffer(e)),t=t||128;var r,i=e,s=e.length(),o=t,c=Math.ceil(o/8),u=255>>(7&o);for(r=s;r<128;r++)i.putByte(a[i.at(r-1)+i.at(r-s)&255]);for(i.setAt(128-c,a[i.at(128-c)&u]),r=127-c;r>=0;r--)i.setAt(r,a[i.at(r+1)^i.at(r+c)]);return i};var c=function(e,t,r){var a,c,u,l,p=!1,f=null,h=null,d=null,y=[];for(e=n.rc2.expandKey(e,t),u=0;u<64;u++)y.push(e.getInt16Le());r?(a=function(e){for(u=0;u<4;u++)e[u]+=y[l]+(e[(u+3)%4]&e[(u+2)%4])+(~e[(u+3)%4]&e[(u+1)%4]),e[u]=s(e[u],i[u]),l++},c=function(e){for(u=0;u<4;u++)e[u]+=y[63&e[(u+3)%4]]}):(a=function(e){for(u=3;u>=0;u--)e[u]=o(e[u],i[u]),e[u]-=y[l]+(e[(u+3)%4]&e[(u+2)%4])+(~e[(u+3)%4]&e[(u+1)%4]),l--},c=function(e){for(u=3;u>=0;u--)e[u]-=y[63&e[(u+3)%4]]});var g=function(e){var t=[];for(u=0;u<4;u++){var n=f.getInt16Le();null!==d&&(r?n^=d.getInt16Le():d.putInt16Le(n)),t.push(65535&n)}l=r?0:63;for(var a=0;a=8;)g([[5,a],[1,c],[6,a],[1,c],[5,a]])},finish:function(e){var t=!0;if(r)if(e)t=e(8,f,!r);else{var n=8===f.length()?8:8-f.length();f.fillWithByte(n,n)}if(t&&(p=!0,v.update()),!r&&(t=0===f.length()))if(e)t=e(8,h,!r);else{var a=h.length(),i=h.at(a-1);i>a?t=!1:h.truncate(i)}return t}}};n.rc2.startEncrypting=function(e,t,r){var a=n.rc2.createEncryptionCipher(e,128);return a.start(t,r),a},n.rc2.createEncryptionCipher=function(e,t){return c(e,t,!0)},n.rc2.startDecrypting=function(e,t,r){var a=n.rc2.createDecryptionCipher(e,128);return a.start(t,r),a},n.rc2.createDecryptionCipher=function(e,t){return c(e,t,!1)}},function(e,t,r){var n=r(0);r(1),r(2),r(9);var a=e.exports=n.pkcs1=n.pkcs1||{};function i(e,t,r){r||(r=n.md.sha1.create());for(var a="",i=Math.ceil(t/r.digestLength),s=0;s>24&255,s>>16&255,s>>8&255,255&s);r.start(),r.update(e+o),a+=r.digest().getBytes()}return a.substring(0,t)}a.encode_rsa_oaep=function(e,t,r){var a,s,o,c;"string"==typeof r?(a=r,s=arguments[3]||void 0,o=arguments[4]||void 0):r&&(a=r.label||void 0,s=r.seed||void 0,o=r.md||void 0,r.mgf1&&r.mgf1.md&&(c=r.mgf1.md)),o?o.start():o=n.md.sha1.create(),c||(c=o);var u=Math.ceil(e.n.bitLength()/8),l=u-2*o.digestLength-2;if(t.length>l)throw(g=new Error("RSAES-OAEP input message length is too long.")).length=t.length,g.maxLength=l,g;a||(a=""),o.update(a,"raw");for(var p=o.digest(),f="",h=l-t.length,d=0;de&&(s=c(e,t));var h=s.toString(16);a.target.postMessage({hex:h,workLoad:l}),s.dAddOffset(p,0)}}}h()}(e,t,a,i);return o(e,t,a,i)}(e,u,i.options,a);throw new Error("Invalid prime generation algorithm: "+i.name)}}function o(e,t,r,i){var s=c(e,t),o=function(e){return e<=100?27:e<=150?18:e<=200?15:e<=250?12:e<=300?9:e<=350?8:e<=400?7:e<=500?6:e<=600?5:e<=800?4:e<=1250?3:2}(s.bitLength());"millerRabinTests"in r&&(o=r.millerRabinTests);var u=10;"maxBlockTime"in r&&(u=r.maxBlockTime),function e(t,r,i,s,o,u,l){var p=+new Date;do{if(t.bitLength()>r&&(t=c(r,i)),t.isProbablePrime(o))return l(null,t);t.dAddOffset(a[s++%8],0)}while(u<0||+new Date-p=0&&a.push(o):a.push(o))}return a}function h(e){if(e.composed||e.constructed){for(var t=n.util.createBuffer(),r=0;r0&&(c=a.create(a.Class.UNIVERSAL,a.Type.SET,!0,p));var f=[],h=[];null!==t&&(h=n.util.isArray(t)?t:[t]);for(var d=[],y=0;y0){var C=a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,d),E=a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.OID,!1,a.oidToDer(i.oids.data).getBytes()),a.create(a.Class.CONTEXT_SPECIFIC,0,!0,[a.create(a.Class.UNIVERSAL,a.Type.OCTETSTRING,!1,a.toDer(C).getBytes())])]);f.push(E)}var S=null;if(null!==e){var T=i.wrapRsaPrivateKey(i.privateKeyToAsn1(e));S=null===r?a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.OID,!1,a.oidToDer(i.oids.keyBag).getBytes()),a.create(a.Class.CONTEXT_SPECIFIC,0,!0,[T]),c]):a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.OID,!1,a.oidToDer(i.oids.pkcs8ShroudedKeyBag).getBytes()),a.create(a.Class.CONTEXT_SPECIFIC,0,!0,[i.encryptPrivateKeyInfo(T,r,o)]),c]);var I=a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[S]),b=a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.OID,!1,a.oidToDer(i.oids.data).getBytes()),a.create(a.Class.CONTEXT_SPECIFIC,0,!0,[a.create(a.Class.UNIVERSAL,a.Type.OCTETSTRING,!1,a.toDer(I).getBytes())])]);f.push(b)}var A,B=a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,f);if(o.useMac){var N=n.md.sha1.create(),k=new n.util.ByteBuffer(n.random.getBytes(o.saltSize)),w=o.count,R=(e=s.generateKey(r,k,3,w,20),n.hmac.create());R.start(N,e),R.update(a.toDer(B).getBytes());var L=R.getMac();A=a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.OID,!1,a.oidToDer(i.oids.sha1).getBytes()),a.create(a.Class.UNIVERSAL,a.Type.NULL,!1,"")]),a.create(a.Class.UNIVERSAL,a.Type.OCTETSTRING,!1,L.getBytes())]),a.create(a.Class.UNIVERSAL,a.Type.OCTETSTRING,!1,k.getBytes()),a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,a.integerToDer(w).getBytes())])}return a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,a.integerToDer(3).getBytes()),a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.OID,!1,a.oidToDer(i.oids.data).getBytes()),a.create(a.Class.CONTEXT_SPECIFIC,0,!0,[a.create(a.Class.UNIVERSAL,a.Type.OCTETSTRING,!1,a.toDer(B).getBytes())])]),A])},s.generateKey=n.pbe.generatePkcs12Key},function(e,t,r){var n=r(0);r(3),r(1);var a=n.asn1,i=e.exports=n.pkcs7asn1=n.pkcs7asn1||{};n.pkcs7=n.pkcs7||{},n.pkcs7.asn1=i;var s={name:"ContentInfo",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.ContentType",tagClass:a.Class.UNIVERSAL,type:a.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:a.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,captureAsn1:"content"}]};i.contentInfoValidator=s;var o={name:"EncryptedContentInfo",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentType",tagClass:a.Class.UNIVERSAL,type:a.Type.OID,constructed:!1,capture:"contentType"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentEncryptionAlgorithm.algorithm",tagClass:a.Class.UNIVERSAL,type:a.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm.parameter",tagClass:a.Class.UNIVERSAL,captureAsn1:"encParameter"}]},{name:"EncryptedContentInfo.encryptedContent",tagClass:a.Class.CONTEXT_SPECIFIC,type:0,capture:"encryptedContent",captureAsn1:"encryptedContentAsn1"}]};i.envelopedDataValidator={name:"EnvelopedData",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"EnvelopedData.Version",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"version"},{name:"EnvelopedData.RecipientInfos",tagClass:a.Class.UNIVERSAL,type:a.Type.SET,constructed:!0,captureAsn1:"recipientInfos"}].concat(o)},i.encryptedDataValidator={name:"EncryptedData",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedData.Version",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"version"}].concat(o)};var c={name:"SignerInfo",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.version",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1},{name:"SignerInfo.issuerAndSerialNumber",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.issuerAndSerialNumber.issuer",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"SignerInfo.issuerAndSerialNumber.serialNumber",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"SignerInfo.digestAlgorithm",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.digestAlgorithm.algorithm",tagClass:a.Class.UNIVERSAL,type:a.Type.OID,constructed:!1,capture:"digestAlgorithm"},{name:"SignerInfo.digestAlgorithm.parameter",tagClass:a.Class.UNIVERSAL,constructed:!1,captureAsn1:"digestParameter",optional:!0}]},{name:"SignerInfo.authenticatedAttributes",tagClass:a.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"authenticatedAttributes"},{name:"SignerInfo.digestEncryptionAlgorithm",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,capture:"signatureAlgorithm"},{name:"SignerInfo.encryptedDigest",tagClass:a.Class.UNIVERSAL,type:a.Type.OCTETSTRING,constructed:!1,capture:"signature"},{name:"SignerInfo.unauthenticatedAttributes",tagClass:a.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,capture:"unauthenticatedAttributes"}]};i.signedDataValidator={name:"SignedData",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"SignedData.Version",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"version"},{name:"SignedData.DigestAlgorithms",tagClass:a.Class.UNIVERSAL,type:a.Type.SET,constructed:!0,captureAsn1:"digestAlgorithms"},s,{name:"SignedData.Certificates",tagClass:a.Class.CONTEXT_SPECIFIC,type:0,optional:!0,captureAsn1:"certificates"},{name:"SignedData.CertificateRevocationLists",tagClass:a.Class.CONTEXT_SPECIFIC,type:1,optional:!0,captureAsn1:"crls"},{name:"SignedData.SignerInfos",tagClass:a.Class.UNIVERSAL,type:a.Type.SET,capture:"signerInfos",optional:!0,value:[c]}]},i.recipientInfoValidator={name:"RecipientInfo",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.version",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"version"},{name:"RecipientInfo.issuerAndSerial",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.issuerAndSerial.issuer",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"RecipientInfo.issuerAndSerial.serialNumber",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"RecipientInfo.keyEncryptionAlgorithm",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.keyEncryptionAlgorithm.algorithm",tagClass:a.Class.UNIVERSAL,type:a.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"RecipientInfo.keyEncryptionAlgorithm.parameter",tagClass:a.Class.UNIVERSAL,constructed:!1,captureAsn1:"encParameter",optional:!0}]},{name:"RecipientInfo.encryptedKey",tagClass:a.Class.UNIVERSAL,type:a.Type.OCTETSTRING,constructed:!1,capture:"encKey"}]}},function(e,t,r){var n=r(0);r(1),n.mgf=n.mgf||{},(e.exports=n.mgf.mgf1=n.mgf1=n.mgf1||{}).create=function(e){return{generate:function(t,r){for(var a=new n.util.ByteBuffer,i=Math.ceil(r/e.digestLength),s=0;s>>0,s>>>0];for(var o=h.fullMessageLength.length-1;o>=0;--o)h.fullMessageLength[o]+=s[1],s[1]=s[0]+(h.fullMessageLength[o]/4294967296>>>0),h.fullMessageLength[o]=h.fullMessageLength[o]>>>0,s[0]=s[1]/4294967296>>>0;return a.putBytes(e),l(r,i,a),(a.read>2048||0===a.length())&&a.compact(),h},h.digest=function(){var t=n.util.createBuffer();t.putBytes(a.bytes());var o,c=h.fullMessageLength[h.fullMessageLength.length-1]+h.messageLengthSize&h.blockLength-1;t.putBytes(s.substr(0,h.blockLength-c));for(var u=8*h.fullMessageLength[0],p=0;p>>0,t.putInt32(u>>>0),u=o>>>0;t.putInt32(u);var f=new Array(r.length);for(p=0;p=128;){for(R=0;R<16;++R)t[R][0]=r.getInt32()>>>0,t[R][1]=r.getInt32()>>>0;for(;R<80;++R)n=(((L=(U=t[R-2])[0])>>>19|(_=U[1])<<13)^(_>>>29|L<<3)^L>>>6)>>>0,a=((L<<13|_>>>19)^(_<<3|L>>>29)^(L<<26|_>>>6))>>>0,i=(((L=(P=t[R-15])[0])>>>1|(_=P[1])<<31)^(L>>>8|_<<24)^L>>>7)>>>0,s=((L<<31|_>>>1)^(L<<24|_>>>8)^(L<<25|_>>>7))>>>0,D=t[R-7],V=t[R-16],_=a+D[1]+s+V[1],t[R][0]=n+D[0]+i+V[0]+(_/4294967296>>>0)>>>0,t[R][1]=_>>>0;for(d=e[0][0],y=e[0][1],g=e[1][0],v=e[1][1],m=e[2][0],C=e[2][1],E=e[3][0],S=e[3][1],T=e[4][0],I=e[4][1],b=e[5][0],A=e[5][1],B=e[6][0],N=e[6][1],k=e[7][0],w=e[7][1],R=0;R<80;++R)l=((T>>>14|I<<18)^(T>>>18|I<<14)^(I>>>9|T<<23))>>>0,p=(B^T&(b^B))>>>0,o=((d>>>28|y<<4)^(y>>>2|d<<30)^(y>>>7|d<<25))>>>0,u=((d<<4|y>>>28)^(y<<30|d>>>2)^(y<<25|d>>>7))>>>0,f=(d&g|m&(d^g))>>>0,h=(y&v|C&(y^v))>>>0,_=w+(((T<<18|I>>>14)^(T<<14|I>>>18)^(I<<23|T>>>9))>>>0)+((N^I&(A^N))>>>0)+c[R][1]+t[R][1],n=k+l+p+c[R][0]+t[R][0]+(_/4294967296>>>0)>>>0,a=_>>>0,i=o+f+((_=u+h)/4294967296>>>0)>>>0,s=_>>>0,k=B,w=N,B=b,N=A,b=T,A=I,T=E+n+((_=S+a)/4294967296>>>0)>>>0,I=_>>>0,E=m,S=C,m=g,C=v,g=d,v=y,d=n+i+((_=a+s)/4294967296>>>0)>>>0,y=_>>>0;_=e[0][1]+y,e[0][0]=e[0][0]+d+(_/4294967296>>>0)>>>0,e[0][1]=_>>>0,_=e[1][1]+v,e[1][0]=e[1][0]+g+(_/4294967296>>>0)>>>0,e[1][1]=_>>>0,_=e[2][1]+C,e[2][0]=e[2][0]+m+(_/4294967296>>>0)>>>0,e[2][1]=_>>>0,_=e[3][1]+S,e[3][0]=e[3][0]+E+(_/4294967296>>>0)>>>0,e[3][1]=_>>>0,_=e[4][1]+I,e[4][0]=e[4][0]+T+(_/4294967296>>>0)>>>0,e[4][1]=_>>>0,_=e[5][1]+A,e[5][0]=e[5][0]+b+(_/4294967296>>>0)>>>0,e[5][1]=_>>>0,_=e[6][1]+N,e[6][0]=e[6][0]+B+(_/4294967296>>>0)>>>0,e[6][1]=_>>>0,_=e[7][1]+w,e[7][0]=e[7][0]+k+(_/4294967296>>>0)>>>0,e[7][1]=_>>>0,O-=128}}},function(e,t,r){var n=r(0);r(1);var a=e.exports=n.net=n.net||{};a.socketPools={},a.createSocketPool=function(e){e.msie=e.msie||!1;var t=e.flashId,r=document.getElementById(t);r.init({marshallExceptions:!e.msie});var i={id:t,flashApi:r,sockets:{},policyPort:e.policyPort||0,policyUrl:e.policyUrl||null};a.socketPools[t]=i,!0===e.msie?i.handler=function(e){if(e.id in i.sockets){var t;switch(e.type){case"connect":t="connected";break;case"close":t="closed";break;case"socketData":t="data";break;default:t="error"}setTimeout((function(){i.sockets[e.id][t](e)}),0)}}:i.handler=function(e){if(e.id in i.sockets){var t;switch(e.type){case"connect":t="connected";break;case"close":t="closed";break;case"socketData":t="data";break;default:t="error"}i.sockets[e.id][t](e)}};var s="forge.net.socketPools['"+t+"'].handler";return r.subscribe("connect",s),r.subscribe("close",s),r.subscribe("socketData",s),r.subscribe("ioError",s),r.subscribe("securityError",s),i.destroy=function(){for(var t in delete a.socketPools[e.flashId],i.sockets)i.sockets[t].destroy();i.sockets={},r.cleanup()},i.createSocket=function(e){e=e||{};var t=r.create(),a={id:t,connected:e.connected||function(e){},closed:e.closed||function(e){},data:e.data||function(e){},error:e.error||function(e){},destroy:function(){r.destroy(t),delete i.sockets[t]},connect:function(e){var n=e.policyUrl||null,a=0;null===n&&0!==e.policyPort&&(a=e.policyPort||i.policyPort),r.connect(t,e.host,e.port,a,n)},close:function(){r.close(t),a.closed({id:a.id,type:"close",bytesAvailable:0})},isConnected:function(){return r.isConnected(t)},send:function(e){return r.send(t,n.util.encode64(e))},receive:function(e){var a=r.receive(t,e).rval;return null===a?null:n.util.decode64(a)},bytesAvailable:function(){return r.getBytesAvailable(t)}};return i.sockets[t]=a,a},i},a.destroySocketPool=function(e){e.flashId in a.socketPools&&a.socketPools[e.flashId].destroy()},a.createSocket=function(e){var t=null;e.flashId in a.socketPools&&(t=a.socketPools[e.flashId].createSocket(e));return t}},function(e,t,r){var n=r(0);r(10),r(1);var a=e.exports=n.http=n.http||{},i=function(e){return e.toLowerCase().replace(/(^.)|(-.)/g,(function(e){return e.toUpperCase()}))},s=function(e){return"forge.http."+e.url.protocol.slice(0,-1)+"."+e.url.hostname+"."+e.url.port},o=function(e){if(e.persistCookies)try{var t=n.util.getItem(e.socketPool.flashApi,s(e),"cookies");e.cookies=t||{}}catch(e){}},c=function(e){if(e.persistCookies)try{n.util.setItem(e.socketPool.flashApi,s(e),"cookies",e.cookies)}catch(e){}o(e)},u=function(e,t){t.isConnected()?(t.options.request.connectTime=+new Date,t.connected({type:"connect",id:t.id})):(t.options.request.connectTime=+new Date,t.connect({host:e.url.hostname,port:e.url.port,policyPort:e.policyPort,policyUrl:e.policyUrl}))},l=function(e,t){t.buffer.clear();for(var r=null;null===r&&e.requests.length>0;)(r=e.requests.shift()).request.aborted&&(r=null);null===r?(null!==t.options&&(t.options=null),e.idle.push(t)):(t.retries=1,t.options=r,u(e,t))},p=function(e,t,r){t.options=null,t.connected=function(r){if(null===t.options)l(e,t);else{var n=t.options.request;if(n.connectTime=+new Date-n.connectTime,r.socket=t,t.options.connected(r),n.aborted)t.close();else{var a=n.toString();n.body&&(a+=n.body),n.time=+new Date,t.send(a),n.time=+new Date-n.time,t.options.response.time=+new Date,t.sending=!0}}},t.closed=function(r){if(t.sending)t.sending=!1,t.retries>0?(--t.retries,u(e,t)):t.error({id:t.id,type:"ioError",message:"Connection closed during send. Broken pipe.",bytesAvailable:0});else{var n=t.options.response;n.readBodyUntilClose&&(n.time=+new Date-n.time,n.bodyReceived=!0,t.options.bodyReady({request:t.options.request,response:n,socket:t})),t.options.closed(r),l(e,t)}},t.data=function(r){if(t.sending=!1,t.options.request.aborted)t.close();else{var n=t.options.response,a=t.receive(r.bytesAvailable);if(null!==a)if(t.buffer.putBytes(a),n.headerReceived||(n.readHeader(t.buffer),n.headerReceived&&t.options.headerReady({request:t.options.request,response:n,socket:t})),n.headerReceived&&!n.bodyReceived&&n.readBody(t.buffer),n.bodyReceived)t.options.bodyReady({request:t.options.request,response:n,socket:t}),-1!=(n.getField("Connection")||"").indexOf("close")||"HTTP/1.0"===n.version&&null===n.getField("Keep-Alive")?t.close():l(e,t)}},t.error=function(e){t.options.error({type:e.type,message:e.message,request:t.options.request,response:t.options.response,socket:t}),t.close()},r?((t=n.tls.wrapSocket({sessionId:null,sessionCache:{},caStore:r.caStore,cipherSuites:r.cipherSuites,socket:t,virtualHost:r.virtualHost,verify:r.verify,getCertificate:r.getCertificate,getPrivateKey:r.getPrivateKey,getSignature:r.getSignature,deflate:r.deflate||null,inflate:r.inflate||null})).options=null,t.buffer=n.util.createBuffer(),e.sockets.push(t),r.prime?t.connect({host:e.url.hostname,port:e.url.port,policyPort:e.policyPort,policyUrl:e.policyUrl}):e.idle.push(t)):(t.buffer=n.util.createBuffer(),e.sockets.push(t),e.idle.push(t))},f=function(e){var t=!1;if(-1!==e.maxAge){var r=y(new Date);e.created+e.maxAge<=r&&(t=!0)}return t};a.createClient=function(e){var t,r=null;e.caCerts&&(r=n.pki.createCaStore(e.caCerts)),e.url=e.url||window.location.protocol+"//"+window.location.host;try{t=new URL(e.url)}catch(t){var i=new Error("Invalid url.");throw i.details={url:e.url},i}e.connections=e.connections||1;var l=e.socketPool,h={url:t,socketPool:l,policyPort:e.policyPort,policyUrl:e.policyUrl,requests:[],sockets:[],idle:[],secure:"https:"===t.protocol,cookies:{},persistCookies:void 0===e.persistCookies||e.persistCookies};o(h);var d=null;h.secure&&(d={caStore:r,cipherSuites:e.cipherSuites||null,virtualHost:e.virtualHost||t.hostname,verify:e.verify||function(e,t,r,n){if(0===r&&!0===t){var a=n[r].subject.getField("CN");null!==a&&h.url.hostname===a.value||(t={message:"Certificate common name does not match url host."})}return t},getCertificate:e.getCertificate||null,getPrivateKey:e.getPrivateKey||null,getSignature:e.getSignature||null,prime:e.primeTlsSockets||!1},null!==l.flashApi&&(d.deflate=function(e){return n.util.deflate(l.flashApi,e,!0)},d.inflate=function(e){return n.util.inflate(l.flashApi,e,!0)}));for(var g=0;g100?(t.body=n.util.deflate(t.flashApi,t.body),t.bodyDeflated=!0,t.setField("Content-Encoding","deflate"),t.setField("Content-Length",t.body.length)):null!==t.body&&t.setField("Content-Length",t.body.length);var e=t.method.toUpperCase()+" "+t.path+" "+t.version+"\r\n";for(var r in t.fields)for(var a=t.fields[r],i=0;i=3)){var o=new Error("Invalid http response header.");throw o.details={line:r},o}a.version=n[0],a.code=parseInt(n[1],10),a.message=n.slice(2).join(" ")}else 0===r.length?a.headerReceived=!0:s(r);return a.headerReceived};return a.readBody=function(e){var o=a.getField("Content-Length"),c=a.getField("Transfer-Encoding");if(null!==o&&(o=parseInt(o)),null!==o&&o>=0)a.body=a.body||"",a.body+=e.getBytes(o),a.bodyReceived=a.body.length===o;else if(null!==c){if(-1==c.indexOf("chunked")){var u=new Error("Unknown Transfer-Encoding.");throw u.details={transferEncoding:c},u}a.body=a.body||"",function(e){for(var n="";null!==n&&e.length()>0;)if(t>0){if(t+2>e.length())break;a.body+=e.getBytes(t),e.getBytes(2),t=0}else if(r)for(n=i(e);null!==n;)n.length>0?(s(n),n=i(e)):(a.bodyReceived=!0,n=null);else null!==(n=i(e))&&(t=parseInt(n.split(";",1)[0],16),r=0===t);a.bodyReceived}(e)}else null!==o&&o<0||null===o&&null!==a.getField("Content-Type")?(a.body=a.body||"",a.body+=e.getBytes(),a.readBodyUntilClose=!0):(a.body=null,a.bodyReceived=!0);return a.bodyReceived&&(a.time=+new Date-a.time),null!==a.flashApi&&a.bodyReceived&&null!==a.body&&"deflate"===a.getField("Content-Encoding")&&(a.body=n.util.inflate(a.flashApi,a.body)),a.bodyReceived},a.getCookies=function(){var e=[];if("Set-Cookie"in a.fields)for(var t=a.fields["Set-Cookie"],r=+new Date/1e3,n=/\s*([^=]*)=?([^;]*)(;|$)/g,i=0;i0;)o.push(u%i),u=u/i|0}for(a=0;0===e[a]&&a=0;--a)n+=t[o[a]]}else n=function(e,t){var r=0,n=t.length,a=t.charAt(0),i=[0];for(r=0;r0;)i.push(o%n),o=o/n|0}var c="";for(r=0;0===e.at(r)&&r=0;--r)c+=t[i[r]];return c}(e,t);if(r){var l=new RegExp(".{1,"+r+"}","g");n=n.match(l).join("\r\n")}return n},r.decode=function(e,t){if("string"!=typeof e)throw new TypeError('"input" must be a string.');if("string"!=typeof t)throw new TypeError('"alphabet" must be a string.');var r=n[t];if(!r){r=n[t]=[];for(var a=0;a>=8;for(;l>0;)o.push(255&l),l>>=8}for(var p=0;e[p]===s&&p=a.Versions.TLS_1_1.minor&&c.output.putBytes(r),c.update(e.fragment),c.finish(o)&&(e.fragment=c.output,e.length=e.fragment.length(),i=!0),i}function o(e,t,r){if(!r){var n=e-t.length()%e;t.fillWithByte(n-1,n)}return!0}function c(e,t,r){var n=!0;if(r){for(var a=t.length(),i=t.last(),s=a-1-i;s=o?(e.fragment=s.output.getBytes(l-o),u=s.output.getBytes(o)):e.fragment=s.output.getBytes(),e.fragment=n.util.createBuffer(e.fragment),e.length=e.fragment.length();var p=t.macFunction(t.macKey,t.sequenceNumber,e);return t.updateSequenceNumber(),i=function(e,t,r){var a=n.hmac.create();return a.start("SHA1",e),a.update(t),t=a.digest().getBytes(),a.start(null,null),a.update(r),r=a.digest().getBytes(),t===r}(t.macKey,u,p)&&i}a.CipherSuites.TLS_RSA_WITH_AES_128_CBC_SHA={id:[0,47],name:"TLS_RSA_WITH_AES_128_CBC_SHA",initSecurityParameters:function(e){e.bulk_cipher_algorithm=a.BulkCipherAlgorithm.aes,e.cipher_type=a.CipherType.block,e.enc_key_length=16,e.block_length=16,e.fixed_iv_length=16,e.record_iv_length=16,e.mac_algorithm=a.MACAlgorithm.hmac_sha1,e.mac_length=20,e.mac_key_length=20},initConnectionState:i},a.CipherSuites.TLS_RSA_WITH_AES_256_CBC_SHA={id:[0,53],name:"TLS_RSA_WITH_AES_256_CBC_SHA",initSecurityParameters:function(e){e.bulk_cipher_algorithm=a.BulkCipherAlgorithm.aes,e.cipher_type=a.CipherType.block,e.enc_key_length=32,e.block_length=16,e.fixed_iv_length=16,e.record_iv_length=16,e.mac_algorithm=a.MACAlgorithm.hmac_sha1,e.mac_length=20,e.mac_key_length=20},initConnectionState:i}},function(e,t,r){var n=r(0);r(30),e.exports=n.mgf=n.mgf||{},n.mgf.mgf1=n.mgf1},function(e,t,r){var n=r(0);r(13),r(2),r(31),r(1);var a=r(42),i=a.publicKeyValidator,s=a.privateKeyValidator;if(void 0===o)var o=n.jsbn.BigInteger;var c=n.util.ByteBuffer,u="undefined"==typeof Buffer?Uint8Array:Buffer;n.pki=n.pki||{},e.exports=n.pki.ed25519=n.ed25519=n.ed25519||{};var l=n.ed25519;function p(e){var t=e.message;if(t instanceof Uint8Array||t instanceof u)return t;var r=e.encoding;if(void 0===t){if(!e.md)throw new TypeError('"options.message" or "options.md" not specified.');t=e.md.digest().getBytes(),r="binary"}if("string"==typeof t&&!r)throw new TypeError('"options.encoding" must be "binary" or "utf8".');if("string"==typeof t){if("undefined"!=typeof Buffer)return Buffer.from(t,r);t=new c(t,r)}else if(!(t instanceof c))throw new TypeError('"options.message" must be a node.js Buffer, a Uint8Array, a forge ByteBuffer, or a string with "options.encoding" specifying its encoding.');for(var n=new u(t.length()),a=0;a=0;--r)x(n,n),1!==r&&K(n,n,t);for(r=0;r<16;++r)e[r]=n[r]}(r,r),K(r,r,a),K(r,r,i),K(r,r,i),K(e[0],r,i),x(n,e[0]),K(n,n,i),N(n,a)&&K(e[0],e[0],C);if(x(n,e[0]),K(n,n,i),N(n,a))return-1;w(e[0])===t[31]>>7&&O(e[0],f,e[0]);return K(e[3],e[0],e[1]),0}(o,n))return-1;for(a=0;a=0};var f=P(),h=P([1]),d=P([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),y=P([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),g=P([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),v=P([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),m=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]),C=P([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function E(e,t){var r=n.md.sha512.create(),a=new c(e);r.update(a.getBytes(t),"binary");var i=r.digest().getBytes();if("undefined"!=typeof Buffer)return Buffer.from(i,"binary");for(var s=new u(l.constants.HASH_BYTE_LENGTH),o=0;o<64;++o)s[o]=i.charCodeAt(o);return s}function S(e,t){var r,n,a,i;for(n=63;n>=32;--n){for(r=0,a=n-32,i=n-12;a>8,t[a]-=256*r;t[a]+=r,t[n]=0}for(r=0,a=0;a<32;++a)t[a]+=r-(t[31]>>4)*m[a],r=t[a]>>8,t[a]&=255;for(a=0;a<32;++a)t[a]-=r*m[a];for(n=0;n<32;++n)t[n+1]+=t[n]>>8,e[n]=255&t[n]}function T(e){for(var t=new Float64Array(64),r=0;r<64;++r)t[r]=e[r],e[r]=0;S(e,t)}function I(e,t){var r=P(),n=P(),a=P(),i=P(),s=P(),o=P(),c=P(),u=P(),l=P();O(r,e[1],e[0]),O(l,t[1],t[0]),K(r,r,l),V(n,e[0],e[1]),V(l,t[0],t[1]),K(n,n,l),K(a,e[3],t[3]),K(a,a,y),K(i,e[2],t[2]),V(i,i,i),O(s,n,r),O(o,i,a),V(c,i,a),V(u,n,r),K(e[0],s,o),K(e[1],u,c),K(e[2],c,o),K(e[3],s,u)}function b(e,t,r){for(var n=0;n<4;++n)D(e[n],t[n],r)}function A(e,t){var r=P(),n=P(),a=P();!function(e,t){var r,n=P();for(r=0;r<16;++r)n[r]=t[r];for(r=253;r>=0;--r)x(n,n),2!==r&&4!==r&&K(n,n,t);for(r=0;r<16;++r)e[r]=n[r]}(a,t[2]),K(r,t[0],a),K(n,t[1],a),B(e,n),e[31]^=w(r)<<7}function B(e,t){var r,n,a,i=P(),s=P();for(r=0;r<16;++r)s[r]=t[r];for(U(s),U(s),U(s),n=0;n<2;++n){for(i[0]=s[0]-65517,r=1;r<15;++r)i[r]=s[r]-65535-(i[r-1]>>16&1),i[r-1]&=65535;i[15]=s[15]-32767-(i[14]>>16&1),a=i[15]>>16&1,i[14]&=65535,D(s,i,1-a)}for(r=0;r<16;r++)e[2*r]=255&s[r],e[2*r+1]=s[r]>>8}function N(e,t){var r=new u(32),n=new u(32);return B(r,e),B(n,t),k(r,0,n,0)}function k(e,t,r,n){return function(e,t,r,n,a){var i,s=0;for(i=0;i>>8)-1}(e,t,r,n,32)}function w(e){var t=new u(32);return B(t,e),1&t[0]}function R(e,t,r){var n,a;for(_(e[0],f),_(e[1],h),_(e[2],h),_(e[3],f),a=255;a>=0;--a)b(e,t,n=r[a/8|0]>>(7&a)&1),I(t,e),I(e,e),b(e,t,n)}function L(e,t){var r=[P(),P(),P(),P()];_(r[0],g),_(r[1],v),_(r[2],h),K(r[3],g,v),R(e,r,t)}function _(e,t){var r;for(r=0;r<16;r++)e[r]=0|t[r]}function U(e){var t,r,n=1;for(t=0;t<16;++t)r=e[t]+n+65535,n=Math.floor(r/65536),e[t]=r-65536*n;e[0]+=n-1+37*(n-1)}function D(e,t,r){for(var n,a=~(r-1),i=0;i<16;++i)n=a&(e[i]^t[i]),e[i]^=n,t[i]^=n}function P(e){var t,r=new Float64Array(16);if(e)for(t=0;t0&&(s=n.util.fillString(String.fromCharCode(0),c)+s),{encapsulation:t.encrypt(s,"NONE"),key:e.generate(s,i)}},decrypt:function(t,r,n){var a=t.decrypt(r,"NONE");return e.generate(a,n)}};return i},n.kem.kdf1=function(e,t){i(this,e,0,t||e.digestLength)},n.kem.kdf2=function(e,t){i(this,e,1,t||e.digestLength)}},function(e,t,r){var n=r(0);r(1),e.exports=n.log=n.log||{},n.log.levels=["none","error","warning","info","debug","verbose","max"];var a={},i=[],s=null;n.log.LEVEL_LOCKED=2,n.log.NO_LEVEL_CHECK=4,n.log.INTERPOLATE=8;for(var o=0;o0){for(var r=a.create(a.Class.CONTEXT_SPECIFIC,1,!0,[]),i=0;i=r&&s0&&s.value[0].value.push(a.create(a.Class.CONTEXT_SPECIFIC,0,!0,t)),i.length>0&&s.value[0].value.push(a.create(a.Class.CONTEXT_SPECIFIC,1,!0,i)),s.value[0].value.push(a.create(a.Class.UNIVERSAL,a.Type.SET,!0,e.signerInfos)),a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.OID,!1,a.oidToDer(e.type).getBytes()),s])},addSigner:function(t){var r=t.issuer,a=t.serialNumber;if(t.certificate){var i=t.certificate;"string"==typeof i&&(i=n.pki.certificateFromPem(i)),r=i.issuer.attributes,a=i.serialNumber}var s=t.key;if(!s)throw new Error("Could not add PKCS#7 signer; no private key specified.");"string"==typeof s&&(s=n.pki.privateKeyFromPem(s));var o=t.digestAlgorithm||n.pki.oids.sha1;switch(o){case n.pki.oids.sha1:case n.pki.oids.sha256:case n.pki.oids.sha384:case n.pki.oids.sha512:case n.pki.oids.md5:break;default:throw new Error("Could not add PKCS#7 signer; unknown message digest algorithm: "+o)}var c=t.authenticatedAttributes||[];if(c.length>0){for(var u=!1,l=!1,p=0;p="8"&&(r="00"+r);var a=n.util.hexToBytes(r);e.putInt32(a.length),e.putBytes(a)}function s(e,t){e.putInt32(t.length),e.putString(t)}function o(){for(var e=n.md.sha1.create(),t=arguments.length,r=0;r0&&r.push(t[1]),t.length>=2&&r.push(t[2]);return 0===r.length&&r.push(e),r}(t))})),t=s,n.each(t,(function(a,s){if(i&&0!==s.length&&s in i&&(s=i[s]),0===s.length&&(s=e.length),e[s])a==t.length-1?(n.isArray(e[s])||(e[s]=[e[s]]),e[s].push(r)):e=e[s];else if(a==t.length-1)e[s]=r;else{var o=t[a+1];if(0===o.length)e[s]=[];else{var c=o-0==o&&o.length>0;e[s]=c?[]:{}}e=e[s]}}))},o.serialize=function(e,t,r){var a={};return t=t||".",n.each(e.serializeArray(),(function(){i(a,this.name.split(t),this.value||"",r)})),a}},function(e,t,r){var n=r(0);r(10),n.tls.wrapSocket=function(e){var t=e.socket,r={id:t.id,connected:t.connected||function(e){},closed:t.closed||function(e){},data:t.data||function(e){},error:t.error||function(e){}},a=n.tls.createConnection({server:!1,sessionId:e.sessionId||null,caStore:e.caStore||[],sessionCache:e.sessionCache||null,cipherSuites:e.cipherSuites||null,virtualHost:e.virtualHost,verify:e.verify,getCertificate:e.getCertificate,getPrivateKey:e.getPrivateKey,getSignature:e.getSignature,deflate:e.deflate,inflate:e.inflate,connected:function(e){1===e.handshakes&&r.connected({id:t.id,type:"connect",bytesAvailable:e.data.length()})},tlsDataReady:function(e){return t.send(e.tlsData.getBytes())},dataReady:function(e){r.data({id:t.id,type:"socketData",bytesAvailable:e.data.length()})},closed:function(e){t.close()},error:function(e,n){r.error({id:t.id,type:"tlsError",message:n.message,bytesAvailable:0,error:n}),t.close()}});t.connected=function(t){a.handshake(e.sessionId)},t.closed=function(e){a.open&&a.handshaking&&r.error({id:t.id,type:"ioError",message:"Connection closed during handshake.",bytesAvailable:0}),a.close(),r.closed({id:t.id,type:"close",bytesAvailable:0})},t.error=function(e){r.error({id:t.id,type:e.type,message:e.message,bytesAvailable:0}),a.close()};var i=0;return t.data=function(e){if(a.open){if(e.bytesAvailable>=i){var r=Math.max(e.bytesAvailable,i),n=t.receive(r);null!==n&&(i=a.process(n))}}else t.receive(e.bytesAvailable)},r.destroy=function(){t.destroy()},r.setSessionCache=function(e){a.sessionCache=tls.createSessionCache(e)},r.connect=function(e){t.connect(e)},r.close=function(){a.close()},r.isConnected=function(){return a.isConnected&&t.isConnected()},r.send=function(e){return a.prepare(e)},r.receive=function(e){return a.data.getBytes(e)},r.bytesAvailable=function(){return a.data.length()},r}},function(e,t,r){var n=r(0);r(32),r(33);var a,i,s,o,c,u,l,p,f,h,d=e.exports=n.xhr=n.xhr||{};a=jQuery,i="forge.xhr",s=null,o=0,c=null,u=null,l={},p=10,f=n.net,h=n.http,d.init=function(e){n.log.debug(i,"initializing",e),o=e.policyPort||o,c=e.policyUrl||c,p=e.connections||p,s=f.createSocketPool({flashId:e.flashId,policyPort:o,policyUrl:c,msie:e.msie||!1}),u=h.createClient({url:e.url||window.location.protocol+"//"+window.location.host,socketPool:s,policyPort:o,policyUrl:c,connections:e.connections||p,caCerts:e.caCerts,cipherSuites:e.cipherSuites,persistCookies:e.persistCookies||!0,primeTlsSockets:e.primeTlsSockets||!1,verify:e.verify,getCertificate:e.getCertificate,getPrivateKey:e.getPrivateKey,getSignature:e.getSignature}),l[u.url.origin]=u,n.log.debug(i,"ready")},d.cleanup=function(){for(var e in l)l[e].destroy();l={},u=null,s.destroy(),s=null},d.setCookie=function(e){if(e.maxAge=e.maxAge||-1,e.domain)for(var t in l){var r=l[t];h.withinCookieDomain(r.url,e)&&r.secure===e.secure&&r.setCookie(e)}else u.setCookie(e)},d.getCookie=function(e,t,r){var a=null;if(r)for(var i in l){var s=l[i];if(h.withinCookieDomain(s.url,r)){var o=s.getCookie(e,t);null!==o&&(null===a?a=o:n.util.isArray(a)?a.push(o):a=[a,o])}}else a=u.getCookie(e,t);return a},d.removeCookie=function(e,t,r){var n=!1;if(r)for(var a in l){var i=l[a];h.withinCookieDomain(i.url,r)&&i.removeCookie(e,t)&&(n=!0)}else n=u.removeCookie(e,t);return n},d.create=function(e){e=a.extend({logWarningOnError:!0,verbose:!1,logError:function(){},logWarning:function(){},logDebug:function(){},logVerbose:function(){},url:null},e||{});var t={client:null,request:null,response:null,asynchronous:!0,sendFlag:!1,errorFlag:!1},r={error:e.logError||n.log.error,warning:e.logWarning||n.log.warning,debug:e.logDebug||n.log.debug,verbose:e.logVerbose||n.log.verbose},f={onreadystatechange:null,readyState:0,responseText:"",responseXML:null,status:0,statusText:""};if(null===e.url)t.client=u;else{var d;try{d=new URL(e.url)}catch(t){new Error("Invalid url.").details={url:e.url}}d.origin in l?t.client=l[d.origin]:(t.client=h.createClient({url:e.url,socketPool:s,policyPort:e.policyPort||o,policyUrl:e.policyUrl||c,connections:e.connections||p,caCerts:e.caCerts,cipherSuites:e.cipherSuites,persistCookies:e.persistCookies||!0,primeTlsSockets:e.primeTlsSockets||!1,verify:e.verify,getCertificate:e.getCertificate,getPrivateKey:e.getPrivateKey,getSignature:e.getSignature}),l[d.origin]=t.client)}return f.open=function(e,r,n,a,i){switch(e){case"DELETE":case"GET":case"HEAD":case"OPTIONS":case"PATCH":case"POST":case"PUT":break;case"CONNECT":case"TRACE":case"TRACK":throw new Error("CONNECT, TRACE and TRACK methods are disallowed");default:throw new Error("Invalid method: "+e)}t.sendFlag=!1,f.responseText="",f.responseXML=null,f.status=0,f.statusText="",t.request=h.createRequest({method:e,path:r}),f.readyState=1,f.onreadystatechange&&f.onreadystatechange()},f.setRequestHeader=function(e,r){if(1!=f.readyState||t.sendFlag)throw new Error("XHR not open or sending");t.request.setField(e,r)},f.send=function(e){if(1!=f.readyState||t.sendFlag)throw new Error("XHR not open or sending");if(e&&"GET"!==t.request.method&&"HEAD"!==t.request.method)if("undefined"!=typeof XMLSerializer)if(e instanceof Document){var n=new XMLSerializer;t.request.body=n.serializeToString(e)}else t.request.body=e;else void 0!==e.xml?t.request.body=e.xml:t.request.body=e;t.errorFlag=!1,t.sendFlag=!0,f.onreadystatechange&&f.onreadystatechange();var a={};a.request=t.request,a.headerReady=function(e){f.cookies=t.client.cookies,f.readyState=2,f.status=e.response.code,f.statusText=e.response.message,t.response=e.response,f.onreadystatechange&&f.onreadystatechange(),t.response.aborted||(f.readyState=3,f.onreadystatechange&&f.onreadystatechange())},a.bodyReady=function(e){f.readyState=4;var n=e.response.getField("Content-Type");if(n&&(0===n.indexOf("text/xml")||0===n.indexOf("application/xml")||-1!==n.indexOf("+xml")))try{var s=new ActiveXObject("MicrosoftXMLDOM");s.async=!1,s.loadXML(e.response.body),f.responseXML=s}catch(e){var o=new DOMParser;f.responseXML=o.parseFromString(e.body,"text/xml")}var c=0;null!==e.response.body&&(f.responseText=e.response.body,c=e.response.body.length);var u=t.request,l=u.method+" "+u.path+" "+f.status+" "+f.statusText+" "+c+"B "+(e.request.connectTime+e.request.time+e.response.time)+"ms";a.verbose?(f.status>=400&&a.logWarningOnError?r.warning:r.verbose)(i,l,e,e.response.body?"\n"+e.response.body:"\nNo content"):(f.status>=400&&a.logWarningOnError?r.warning:r.debug)(i,l),f.onreadystatechange&&f.onreadystatechange()},a.error=function(e){var n=t.request;r.error(i,n.method+" "+n.path,e),f.responseText="",f.responseXML=null,t.errorFlag=!0,f.status=0,f.statusText="",f.readyState=4,f.onreadystatechange&&f.onreadystatechange()},t.client.send(a)},f.abort=function(){t.request.abort(),f.responseText="",f.responseXML=null,t.errorFlag=!0,f.status=0,f.statusText="",t.request=null,t.response=null,4===f.readyState||0===f.readyState||1===f.readyState&&!t.sendFlag||(f.readyState=4,t.sendFlag=!1,f.onreadystatechange&&f.onreadystatechange()),f.readyState=0},f.getAllResponseHeaders=function(){var e="";if(null!==t.response){var r=t.response.fields;a.each(r,(function(t,r){a.each(r,(function(r,n){e+=t+": "+n+"\r\n"}))}))}return e},f.getResponseHeader=function(e){var r=null;return null!==t.response&&e in t.response.fields&&(r=t.response.fields[e],n.util.isArray(r)&&(r=r.join())),r},f}}])})); -//# sourceMappingURL=forge.all.min.js.map \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/dist/forge.min.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/dist/forge.min.js deleted file mode 100644 index 17773f62..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/dist/forge.min.js +++ /dev/null @@ -1,2 +0,0 @@ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.forge=t():e.forge=t()}(window,(function(){return function(e){var t={};function r(a){if(t[a])return t[a].exports;var n=t[a]={i:a,l:!1,exports:{}};return e[a].call(n.exports,n,n.exports,r),n.l=!0,n.exports}return r.m=e,r.c=t,r.d=function(e,t,a){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:a})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var a=Object.create(null);if(r.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)r.d(a,n,function(t){return e[t]}.bind(null,n));return a},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=32)}([function(e,t){e.exports={options:{usePureJavaScript:!1}}},function(e,t,r){(function(t){var a=r(0),n=r(35),i=e.exports=a.util=a.util||{};function s(e){if(8!==e&&16!==e&&24!==e&&32!==e)throw new Error("Only 8, 16, 24, or 32 bits supported: "+e)}function o(e){if(this.data="",this.read=0,"string"==typeof e)this.data=e;else if(i.isArrayBuffer(e)||i.isArrayBufferView(e))if("undefined"!=typeof Buffer&&e instanceof Buffer)this.data=e.toString("binary");else{var t=new Uint8Array(e);try{this.data=String.fromCharCode.apply(null,t)}catch(e){for(var r=0;r15?(r=Date.now(),s(e)):(t.push(e),1===t.length&&n.setAttribute("a",a=!a))}}i.nextTick=i.setImmediate}(),i.isNodejs="undefined"!=typeof process&&process.versions&&process.versions.node,i.globalScope=i.isNodejs?t:"undefined"==typeof self?window:self,i.isArray=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},i.isArrayBuffer=function(e){return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer},i.isArrayBufferView=function(e){return e&&i.isArrayBuffer(e.buffer)&&void 0!==e.byteLength},i.ByteBuffer=o,i.ByteStringBuffer=o;i.ByteStringBuffer.prototype._optimizeConstructedString=function(e){this._constructedStringLength+=e,this._constructedStringLength>4096&&(this.data.substr(0,1),this._constructedStringLength=0)},i.ByteStringBuffer.prototype.length=function(){return this.data.length-this.read},i.ByteStringBuffer.prototype.isEmpty=function(){return this.length()<=0},i.ByteStringBuffer.prototype.putByte=function(e){return this.putBytes(String.fromCharCode(e))},i.ByteStringBuffer.prototype.fillWithByte=function(e,t){e=String.fromCharCode(e);for(var r=this.data;t>0;)1&t&&(r+=e),(t>>>=1)>0&&(e+=e);return this.data=r,this._optimizeConstructedString(t),this},i.ByteStringBuffer.prototype.putBytes=function(e){return this.data+=e,this._optimizeConstructedString(e.length),this},i.ByteStringBuffer.prototype.putString=function(e){return this.putBytes(i.encodeUtf8(e))},i.ByteStringBuffer.prototype.putInt16=function(e){return this.putBytes(String.fromCharCode(e>>8&255)+String.fromCharCode(255&e))},i.ByteStringBuffer.prototype.putInt24=function(e){return this.putBytes(String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(255&e))},i.ByteStringBuffer.prototype.putInt32=function(e){return this.putBytes(String.fromCharCode(e>>24&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(255&e))},i.ByteStringBuffer.prototype.putInt16Le=function(e){return this.putBytes(String.fromCharCode(255&e)+String.fromCharCode(e>>8&255))},i.ByteStringBuffer.prototype.putInt24Le=function(e){return this.putBytes(String.fromCharCode(255&e)+String.fromCharCode(e>>8&255)+String.fromCharCode(e>>16&255))},i.ByteStringBuffer.prototype.putInt32Le=function(e){return this.putBytes(String.fromCharCode(255&e)+String.fromCharCode(e>>8&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>24&255))},i.ByteStringBuffer.prototype.putInt=function(e,t){s(t);var r="";do{t-=8,r+=String.fromCharCode(e>>t&255)}while(t>0);return this.putBytes(r)},i.ByteStringBuffer.prototype.putSignedInt=function(e,t){return e<0&&(e+=2<0);return t},i.ByteStringBuffer.prototype.getSignedInt=function(e){var t=this.getInt(e),r=2<=r&&(t-=r<<1),t},i.ByteStringBuffer.prototype.getBytes=function(e){var t;return e?(e=Math.min(this.length(),e),t=this.data.slice(this.read,this.read+e),this.read+=e):0===e?t="":(t=0===this.read?this.data:this.data.slice(this.read),this.clear()),t},i.ByteStringBuffer.prototype.bytes=function(e){return void 0===e?this.data.slice(this.read):this.data.slice(this.read,this.read+e)},i.ByteStringBuffer.prototype.at=function(e){return this.data.charCodeAt(this.read+e)},i.ByteStringBuffer.prototype.setAt=function(e,t){return this.data=this.data.substr(0,this.read+e)+String.fromCharCode(t)+this.data.substr(this.read+e+1),this},i.ByteStringBuffer.prototype.last=function(){return this.data.charCodeAt(this.data.length-1)},i.ByteStringBuffer.prototype.copy=function(){var e=i.createBuffer(this.data);return e.read=this.read,e},i.ByteStringBuffer.prototype.compact=function(){return this.read>0&&(this.data=this.data.slice(this.read),this.read=0),this},i.ByteStringBuffer.prototype.clear=function(){return this.data="",this.read=0,this},i.ByteStringBuffer.prototype.truncate=function(e){var t=Math.max(0,this.length()-e);return this.data=this.data.substr(this.read,t),this.read=0,this},i.ByteStringBuffer.prototype.toHex=function(){for(var e="",t=this.read;t=e)return this;t=Math.max(t||this.growSize,e);var r=new Uint8Array(this.data.buffer,this.data.byteOffset,this.data.byteLength),a=new Uint8Array(this.length()+t);return a.set(r),this.data=new DataView(a.buffer),this},i.DataBuffer.prototype.putByte=function(e){return this.accommodate(1),this.data.setUint8(this.write++,e),this},i.DataBuffer.prototype.fillWithByte=function(e,t){this.accommodate(t);for(var r=0;r>8&65535),this.data.setInt8(this.write,e>>16&255),this.write+=3,this},i.DataBuffer.prototype.putInt32=function(e){return this.accommodate(4),this.data.setInt32(this.write,e),this.write+=4,this},i.DataBuffer.prototype.putInt16Le=function(e){return this.accommodate(2),this.data.setInt16(this.write,e,!0),this.write+=2,this},i.DataBuffer.prototype.putInt24Le=function(e){return this.accommodate(3),this.data.setInt8(this.write,e>>16&255),this.data.setInt16(this.write,e>>8&65535,!0),this.write+=3,this},i.DataBuffer.prototype.putInt32Le=function(e){return this.accommodate(4),this.data.setInt32(this.write,e,!0),this.write+=4,this},i.DataBuffer.prototype.putInt=function(e,t){s(t),this.accommodate(t/8);do{t-=8,this.data.setInt8(this.write++,e>>t&255)}while(t>0);return this},i.DataBuffer.prototype.putSignedInt=function(e,t){return s(t),this.accommodate(t/8),e<0&&(e+=2<0);return t},i.DataBuffer.prototype.getSignedInt=function(e){var t=this.getInt(e),r=2<=r&&(t-=r<<1),t},i.DataBuffer.prototype.getBytes=function(e){var t;return e?(e=Math.min(this.length(),e),t=this.data.slice(this.read,this.read+e),this.read+=e):0===e?t="":(t=0===this.read?this.data:this.data.slice(this.read),this.clear()),t},i.DataBuffer.prototype.bytes=function(e){return void 0===e?this.data.slice(this.read):this.data.slice(this.read,this.read+e)},i.DataBuffer.prototype.at=function(e){return this.data.getUint8(this.read+e)},i.DataBuffer.prototype.setAt=function(e,t){return this.data.setUint8(e,t),this},i.DataBuffer.prototype.last=function(){return this.data.getUint8(this.write-1)},i.DataBuffer.prototype.copy=function(){return new i.DataBuffer(this)},i.DataBuffer.prototype.compact=function(){if(this.read>0){var e=new Uint8Array(this.data.buffer,this.read),t=new Uint8Array(e.byteLength);t.set(e),this.data=new DataView(t),this.write-=this.read,this.read=0}return this},i.DataBuffer.prototype.clear=function(){return this.data=new DataView(new ArrayBuffer(0)),this.read=this.write=0,this},i.DataBuffer.prototype.truncate=function(e){return this.write=Math.max(0,this.length()-e),this.read=Math.min(this.read,this.write),this},i.DataBuffer.prototype.toHex=function(){for(var e="",t=this.read;t0;)1&t&&(r+=e),(t>>>=1)>0&&(e+=e);return r},i.xorBytes=function(e,t,r){for(var a="",n="",i="",s=0,o=0;r>0;--r,++s)n=e.charCodeAt(s)^t.charCodeAt(s),o>=10&&(a+=i,i="",o=0),i+=String.fromCharCode(n),++o;return a+=i},i.hexToBytes=function(e){var t="",r=0;for(!0&e.length&&(r=1,t+=String.fromCharCode(parseInt(e[0],16)));r>24&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(255&e)};var c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",u=[62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,64,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51],l="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";i.encode64=function(e,t){for(var r,a,n,i="",s="",o=0;o>2),i+=c.charAt((3&r)<<4|a>>4),isNaN(a)?i+="==":(i+=c.charAt((15&a)<<2|n>>6),i+=isNaN(n)?"=":c.charAt(63&n)),t&&i.length>t&&(s+=i.substr(0,t)+"\r\n",i=i.substr(t));return s+=i},i.decode64=function(e){e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var t,r,a,n,i="",s=0;s>4),64!==a&&(i+=String.fromCharCode((15&r)<<4|a>>2),64!==n&&(i+=String.fromCharCode((3&a)<<6|n)));return i},i.encodeUtf8=function(e){return unescape(encodeURIComponent(e))},i.decodeUtf8=function(e){return decodeURIComponent(escape(e))},i.binary={raw:{},hex:{},base64:{},base58:{},baseN:{encode:n.encode,decode:n.decode}},i.binary.raw.encode=function(e){return String.fromCharCode.apply(null,e)},i.binary.raw.decode=function(e,t,r){var a=t;a||(a=new Uint8Array(e.length));for(var n=r=r||0,i=0;i>2),i+=c.charAt((3&r)<<4|a>>4),isNaN(a)?i+="==":(i+=c.charAt((15&a)<<2|n>>6),i+=isNaN(n)?"=":c.charAt(63&n)),t&&i.length>t&&(s+=i.substr(0,t)+"\r\n",i=i.substr(t));return s+=i},i.binary.base64.decode=function(e,t,r){var a,n,i,s,o=t;o||(o=new Uint8Array(3*Math.ceil(e.length/4))),e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var c=0,l=r=r||0;c>4,64!==i&&(o[l++]=(15&n)<<4|i>>2,64!==s&&(o[l++]=(3&i)<<6|s));return t?l-r:o.subarray(0,l)},i.binary.base58.encode=function(e,t){return i.binary.baseN.encode(e,l,t)},i.binary.base58.decode=function(e,t){return i.binary.baseN.decode(e,l,t)},i.text={utf8:{},utf16:{}},i.text.utf8.encode=function(e,t,r){e=i.encodeUtf8(e);var a=t;a||(a=new Uint8Array(e.length));for(var n=r=r||0,s=0;s0&&i.push(r),s=a.lastIndex;var o=t[0][1];switch(o){case"s":case"o":n");break;case"%":i.push("%");break;default:i.push("<%"+o+"?>")}}return i.push(e.substring(s)),i.join("")},i.formatNumber=function(e,t,r,a){var n=e,i=isNaN(t=Math.abs(t))?2:t,s=void 0===r?",":r,o=void 0===a?".":a,c=n<0?"-":"",u=parseInt(n=Math.abs(+n||0).toFixed(i),10)+"",l=u.length>3?u.length%3:0;return c+(l?u.substr(0,l)+o:"")+u.substr(l).replace(/(\d{3})(?=\d)/g,"$1"+o)+(i?s+Math.abs(n-u).toFixed(i).slice(2):"")},i.formatSize=function(e){return e=e>=1073741824?i.formatNumber(e/1073741824,2,".","")+" GiB":e>=1048576?i.formatNumber(e/1048576,2,".","")+" MiB":e>=1024?i.formatNumber(e/1024,0)+" KiB":i.formatNumber(e,0)+" bytes"},i.bytesFromIP=function(e){return-1!==e.indexOf(".")?i.bytesFromIPv4(e):-1!==e.indexOf(":")?i.bytesFromIPv6(e):null},i.bytesFromIPv4=function(e){if(4!==(e=e.split(".")).length)return null;for(var t=i.createBuffer(),r=0;rr[a].end-r[a].start&&(a=r.length-1)):r.push({start:c,end:c})}t.push(s)}if(r.length>0){var u=r[a];u.end-u.start>0&&(t.splice(u.start,u.end-u.start+1,""),0===u.start&&t.unshift(""),7===u.end&&t.push(""))}return t.join(":")},i.estimateCores=function(e,t){if("function"==typeof e&&(t=e,e={}),e=e||{},"cores"in i&&!e.update)return t(null,i.cores);if("undefined"!=typeof navigator&&"hardwareConcurrency"in navigator&&navigator.hardwareConcurrency>0)return i.cores=navigator.hardwareConcurrency,t(null,i.cores);if("undefined"==typeof Worker)return i.cores=1,t(null,i.cores);if("undefined"==typeof Blob)return i.cores=2,t(null,i.cores);var r=URL.createObjectURL(new Blob(["(",function(){self.addEventListener("message",(function(e){for(var t=Date.now(),r=t+4;Date.now()o.st&&n.stn.st&&o.stt){var a=new Error("Too few bytes to parse DER.");throw a.available=e.length(),a.remaining=t,a.requested=r,a}}n.Class={UNIVERSAL:0,APPLICATION:64,CONTEXT_SPECIFIC:128,PRIVATE:192},n.Type={NONE:0,BOOLEAN:1,INTEGER:2,BITSTRING:3,OCTETSTRING:4,NULL:5,OID:6,ODESC:7,EXTERNAL:8,REAL:9,ENUMERATED:10,EMBEDDED:11,UTF8:12,ROID:13,SEQUENCE:16,SET:17,PRINTABLESTRING:19,IA5STRING:22,UTCTIME:23,GENERALIZEDTIME:24,BMPSTRING:30},n.create=function(e,t,r,i,s){if(a.util.isArray(i)){for(var o=[],c=0;cr){if(s.strict){var d=new Error("Too few bytes to read ASN.1 value.");throw d.available=t.length(),d.remaining=r,d.requested=h,d}h=r}var y=32==(32&c);if(y)if(p=[],void 0===h)for(;;){if(i(t,r,2),t.bytes(2)===String.fromCharCode(0,0)){t.getBytes(2),r-=2;break}o=t.length(),p.push(e(t,r,a+1,s)),r-=o-t.length()}else for(;h>0;)o=t.length(),p.push(e(t,h,a+1,s)),r-=o-t.length(),h-=o-t.length();void 0===p&&u===n.Class.UNIVERSAL&&l===n.Type.BITSTRING&&(f=t.bytes(h));if(void 0===p&&s.decodeBitStrings&&u===n.Class.UNIVERSAL&&l===n.Type.BITSTRING&&h>1){var g=t.read,v=r,m=0;if(l===n.Type.BITSTRING&&(i(t,r,1),m=t.getByte(),r--),0===m)try{o=t.length();var C=e(t,r,a+1,{strict:!0,decodeBitStrings:!0}),E=o-t.length();r-=E,l==n.Type.BITSTRING&&E++;var S=C.tagClass;E!==h||S!==n.Class.UNIVERSAL&&S!==n.Class.CONTEXT_SPECIFIC||(p=[C])}catch(e){}void 0===p&&(t.read=g,r=v)}if(void 0===p){if(void 0===h){if(s.strict)throw new Error("Non-constructed ASN.1 object of indefinite length.");h=r}if(l===n.Type.BMPSTRING)for(p="";h>0;h-=2)i(t,r,2),p+=String.fromCharCode(t.getInt16()),r-=2;else p=t.getBytes(h),r-=h}var T=void 0===f?null:{bitStringContents:f};return n.create(u,l,y,p,T)}(e,e.length(),0,t);if(t.parseAllBytes&&0!==e.length()){var o=new Error("Unparsed DER bytes remain after ASN.1 parsing.");throw o.byteCount=r,o.remaining=e.length(),o}return s},n.toDer=function(e){var t=a.util.createBuffer(),r=e.tagClass|e.type,i=a.util.createBuffer(),s=!1;if("bitStringContents"in e&&(s=!0,e.original&&(s=n.equals(e,e.original))),s)i.putBytes(e.bitStringContents);else if(e.composed){e.constructed?r|=32:i.putByte(0);for(var o=0;o1&&(0===e.value.charCodeAt(0)&&0==(128&e.value.charCodeAt(1))||255===e.value.charCodeAt(0)&&128==(128&e.value.charCodeAt(1)))?i.putBytes(e.value.substr(1)):i.putBytes(e.value);if(t.putByte(r),i.length()<=127)t.putByte(127&i.length());else{var c=i.length(),u="";do{u+=String.fromCharCode(255&c),c>>>=8}while(c>0);t.putByte(128|u.length);for(o=u.length-1;o>=0;--o)t.putByte(u.charCodeAt(o))}return t.putBuffer(i),t},n.oidToDer=function(e){var t,r,n,i,s=e.split("."),o=a.util.createBuffer();o.putByte(40*parseInt(s[0],10)+parseInt(s[1],10));for(var c=2;c>>=7,t||(i|=128),r.push(i),t=!1}while(n>0);for(var u=r.length-1;u>=0;--u)o.putByte(r[u])}return o},n.derToOid=function(e){var t;"string"==typeof e&&(e=a.util.createBuffer(e));var r=e.getByte();t=Math.floor(r/40)+"."+r%40;for(var n=0;e.length()>0;)n<<=7,128&(r=e.getByte())?n+=127&r:(t+="."+(n+r),n=0);return t},n.utcTimeToDate=function(e){var t=new Date,r=parseInt(e.substr(0,2),10);r=r>=50?1900+r:2e3+r;var a=parseInt(e.substr(2,2),10)-1,n=parseInt(e.substr(4,2),10),i=parseInt(e.substr(6,2),10),s=parseInt(e.substr(8,2),10),o=0;if(e.length>11){var c=e.charAt(10),u=10;"+"!==c&&"-"!==c&&(o=parseInt(e.substr(10,2),10),u+=2)}if(t.setUTCFullYear(r,a,n),t.setUTCHours(i,s,o,0),u&&("+"===(c=e.charAt(u))||"-"===c)){var l=60*parseInt(e.substr(u+1,2),10)+parseInt(e.substr(u+4,2),10);l*=6e4,"+"===c?t.setTime(+t-l):t.setTime(+t+l)}return t},n.generalizedTimeToDate=function(e){var t=new Date,r=parseInt(e.substr(0,4),10),a=parseInt(e.substr(4,2),10)-1,n=parseInt(e.substr(6,2),10),i=parseInt(e.substr(8,2),10),s=parseInt(e.substr(10,2),10),o=parseInt(e.substr(12,2),10),c=0,u=0,l=!1;"Z"===e.charAt(e.length-1)&&(l=!0);var p=e.length-5,f=e.charAt(p);"+"!==f&&"-"!==f||(u=60*parseInt(e.substr(p+1,2),10)+parseInt(e.substr(p+4,2),10),u*=6e4,"+"===f&&(u*=-1),l=!0);return"."===e.charAt(14)&&(c=1e3*parseFloat(e.substr(14),10)),l?(t.setUTCFullYear(r,a,n),t.setUTCHours(i,s,o,c),t.setTime(+t+u)):(t.setFullYear(r,a,n),t.setHours(i,s,o,c)),t},n.dateToUtcTime=function(e){if("string"==typeof e)return e;var t="",r=[];r.push((""+e.getUTCFullYear()).substr(2)),r.push(""+(e.getUTCMonth()+1)),r.push(""+e.getUTCDate()),r.push(""+e.getUTCHours()),r.push(""+e.getUTCMinutes()),r.push(""+e.getUTCSeconds());for(var a=0;a=-128&&e<128)return t.putSignedInt(e,8);if(e>=-32768&&e<32768)return t.putSignedInt(e,16);if(e>=-8388608&&e<8388608)return t.putSignedInt(e,24);if(e>=-2147483648&&e<2147483648)return t.putSignedInt(e,32);var r=new Error("Integer too large; max is 32-bits.");throw r.integer=e,r},n.derToInteger=function(e){"string"==typeof e&&(e=a.util.createBuffer(e));var t=8*e.length();if(t>32)throw new Error("Integer too large; max is 32-bits.");return e.getSignedInt(t)},n.validate=function(e,t,r,i){var s=!1;if(e.tagClass!==t.tagClass&&void 0!==t.tagClass||e.type!==t.type&&void 0!==t.type)i&&(e.tagClass!==t.tagClass&&i.push("["+t.name+'] Expected tag class "'+t.tagClass+'", got "'+e.tagClass+'"'),e.type!==t.type&&i.push("["+t.name+'] Expected type "'+t.type+'", got "'+e.type+'"'));else if(e.constructed===t.constructed||void 0===t.constructed){if(s=!0,t.value&&a.util.isArray(t.value))for(var o=0,c=0;s&&c0&&(i+="\n");for(var o="",c=0;c1?i+="0x"+a.util.bytesToHex(e.value.slice(1)):i+="(none)",e.value.length>0){var f=e.value.charCodeAt(0);1==f?i+=" (1 unused bit shown)":f>1&&(i+=" ("+f+" unused bits shown)")}}else if(e.type===n.Type.OCTETSTRING)s.test(e.value)||(i+="("+e.value+") "),i+="0x"+a.util.bytesToHex(e.value);else if(e.type===n.Type.UTF8)try{i+=a.util.decodeUtf8(e.value)}catch(t){if("URI malformed"!==t.message)throw t;i+="0x"+a.util.bytesToHex(e.value)+" (malformed UTF8)"}else e.type===n.Type.PRINTABLESTRING||e.type===n.Type.IA5String?i+=e.value:s.test(e.value)?i+="0x"+a.util.bytesToHex(e.value):0===e.value.length?i+="[null]":i+=e.value}return i}},function(e,t,r){var a=r(0);e.exports=a.md=a.md||{},a.md.algorithms=a.md.algorithms||{}},function(e,t,r){var a=r(0);function n(e,t){a.cipher.registerAlgorithm(e,(function(){return new a.aes.Algorithm(e,t)}))}r(13),r(19),r(1),e.exports=a.aes=a.aes||{},a.aes.startEncrypting=function(e,t,r,a){var n=d({key:e,output:r,decrypt:!1,mode:a});return n.start(t),n},a.aes.createEncryptionCipher=function(e,t){return d({key:e,output:null,decrypt:!1,mode:t})},a.aes.startDecrypting=function(e,t,r,a){var n=d({key:e,output:r,decrypt:!0,mode:a});return n.start(t),n},a.aes.createDecryptionCipher=function(e,t){return d({key:e,output:null,decrypt:!0,mode:t})},a.aes.Algorithm=function(e,t){l||p();var r=this;r.name=e,r.mode=new t({blockSize:16,cipher:{encrypt:function(e,t){return h(r._w,e,t,!1)},decrypt:function(e,t){return h(r._w,e,t,!0)}}}),r._init=!1},a.aes.Algorithm.prototype.initialize=function(e){if(!this._init){var t,r=e.key;if("string"!=typeof r||16!==r.length&&24!==r.length&&32!==r.length){if(a.util.isArray(r)&&(16===r.length||24===r.length||32===r.length)){t=r,r=a.util.createBuffer();for(var n=0;n>>=2;for(n=0;n>8^255&p^99,i[y]=p,s[p]=y,h=(f=e[p])<<24^p<<16^p<<8^p^f,d=((r=e[y])^(a=e[r])^(n=e[a]))<<24^(y^n)<<16^(y^a^n)<<8^y^r^n;for(var v=0;v<4;++v)c[v][y]=h,u[v][p]=d,h=h<<24|h>>>8,d=d<<24|d>>>8;0===y?y=g=1:(y=r^e[e[e[r^n]]],g^=e[e[g]])}}function f(e,t){for(var r,a=e.slice(0),n=1,s=a.length,c=4*(s+6+1),l=s;l>>16&255]<<24^i[r>>>8&255]<<16^i[255&r]<<8^i[r>>>24]^o[n]<<24,n++):s>6&&l%s==4&&(r=i[r>>>24]<<24^i[r>>>16&255]<<16^i[r>>>8&255]<<8^i[255&r]),a[l]=a[l-s]^r;if(t){for(var p,f=u[0],h=u[1],d=u[2],y=u[3],g=a.slice(0),v=(l=0,(c=a.length)-4);l>>24]]^h[i[p>>>16&255]]^d[i[p>>>8&255]]^y[i[255&p]];a=g}return a}function h(e,t,r,a){var n,o,l,p,f,h,d,y,g,v,m,C,E=e.length/4-1;a?(n=u[0],o=u[1],l=u[2],p=u[3],f=s):(n=c[0],o=c[1],l=c[2],p=c[3],f=i),h=t[0]^e[0],d=t[a?3:1]^e[1],y=t[2]^e[2],g=t[a?1:3]^e[3];for(var S=3,T=1;T>>24]^o[d>>>16&255]^l[y>>>8&255]^p[255&g]^e[++S],m=n[d>>>24]^o[y>>>16&255]^l[g>>>8&255]^p[255&h]^e[++S],C=n[y>>>24]^o[g>>>16&255]^l[h>>>8&255]^p[255&d]^e[++S],g=n[g>>>24]^o[h>>>16&255]^l[d>>>8&255]^p[255&y]^e[++S],h=v,d=m,y=C;r[0]=f[h>>>24]<<24^f[d>>>16&255]<<16^f[y>>>8&255]<<8^f[255&g]^e[++S],r[a?3:1]=f[d>>>24]<<24^f[y>>>16&255]<<16^f[g>>>8&255]<<8^f[255&h]^e[++S],r[2]=f[y>>>24]<<24^f[g>>>16&255]<<16^f[h>>>8&255]<<8^f[255&d]^e[++S],r[a?1:3]=f[g>>>24]<<24^f[h>>>16&255]<<16^f[d>>>8&255]<<8^f[255&y]^e[++S]}function d(e){var t,r="AES-"+((e=e||{}).mode||"CBC").toUpperCase(),n=(t=e.decrypt?a.cipher.createDecipher(r,e.key):a.cipher.createCipher(r,e.key)).start;return t.start=function(e,r){var i=null;r instanceof a.util.ByteBuffer&&(i=r,r={}),(r=r||{}).output=i,r.iv=e,n.call(t,r)},t}},function(e,t,r){var a=r(0);a.pki=a.pki||{};var n=e.exports=a.pki.oids=a.oids=a.oids||{};function i(e,t){n[e]=t,n[t]=e}function s(e,t){n[e]=t}i("1.2.840.113549.1.1.1","rsaEncryption"),i("1.2.840.113549.1.1.4","md5WithRSAEncryption"),i("1.2.840.113549.1.1.5","sha1WithRSAEncryption"),i("1.2.840.113549.1.1.7","RSAES-OAEP"),i("1.2.840.113549.1.1.8","mgf1"),i("1.2.840.113549.1.1.9","pSpecified"),i("1.2.840.113549.1.1.10","RSASSA-PSS"),i("1.2.840.113549.1.1.11","sha256WithRSAEncryption"),i("1.2.840.113549.1.1.12","sha384WithRSAEncryption"),i("1.2.840.113549.1.1.13","sha512WithRSAEncryption"),i("1.3.101.112","EdDSA25519"),i("1.2.840.10040.4.3","dsa-with-sha1"),i("1.3.14.3.2.7","desCBC"),i("1.3.14.3.2.26","sha1"),i("1.3.14.3.2.29","sha1WithRSASignature"),i("2.16.840.1.101.3.4.2.1","sha256"),i("2.16.840.1.101.3.4.2.2","sha384"),i("2.16.840.1.101.3.4.2.3","sha512"),i("2.16.840.1.101.3.4.2.4","sha224"),i("2.16.840.1.101.3.4.2.5","sha512-224"),i("2.16.840.1.101.3.4.2.6","sha512-256"),i("1.2.840.113549.2.2","md2"),i("1.2.840.113549.2.5","md5"),i("1.2.840.113549.1.7.1","data"),i("1.2.840.113549.1.7.2","signedData"),i("1.2.840.113549.1.7.3","envelopedData"),i("1.2.840.113549.1.7.4","signedAndEnvelopedData"),i("1.2.840.113549.1.7.5","digestedData"),i("1.2.840.113549.1.7.6","encryptedData"),i("1.2.840.113549.1.9.1","emailAddress"),i("1.2.840.113549.1.9.2","unstructuredName"),i("1.2.840.113549.1.9.3","contentType"),i("1.2.840.113549.1.9.4","messageDigest"),i("1.2.840.113549.1.9.5","signingTime"),i("1.2.840.113549.1.9.6","counterSignature"),i("1.2.840.113549.1.9.7","challengePassword"),i("1.2.840.113549.1.9.8","unstructuredAddress"),i("1.2.840.113549.1.9.14","extensionRequest"),i("1.2.840.113549.1.9.20","friendlyName"),i("1.2.840.113549.1.9.21","localKeyId"),i("1.2.840.113549.1.9.22.1","x509Certificate"),i("1.2.840.113549.1.12.10.1.1","keyBag"),i("1.2.840.113549.1.12.10.1.2","pkcs8ShroudedKeyBag"),i("1.2.840.113549.1.12.10.1.3","certBag"),i("1.2.840.113549.1.12.10.1.4","crlBag"),i("1.2.840.113549.1.12.10.1.5","secretBag"),i("1.2.840.113549.1.12.10.1.6","safeContentsBag"),i("1.2.840.113549.1.5.13","pkcs5PBES2"),i("1.2.840.113549.1.5.12","pkcs5PBKDF2"),i("1.2.840.113549.1.12.1.1","pbeWithSHAAnd128BitRC4"),i("1.2.840.113549.1.12.1.2","pbeWithSHAAnd40BitRC4"),i("1.2.840.113549.1.12.1.3","pbeWithSHAAnd3-KeyTripleDES-CBC"),i("1.2.840.113549.1.12.1.4","pbeWithSHAAnd2-KeyTripleDES-CBC"),i("1.2.840.113549.1.12.1.5","pbeWithSHAAnd128BitRC2-CBC"),i("1.2.840.113549.1.12.1.6","pbewithSHAAnd40BitRC2-CBC"),i("1.2.840.113549.2.7","hmacWithSHA1"),i("1.2.840.113549.2.8","hmacWithSHA224"),i("1.2.840.113549.2.9","hmacWithSHA256"),i("1.2.840.113549.2.10","hmacWithSHA384"),i("1.2.840.113549.2.11","hmacWithSHA512"),i("1.2.840.113549.3.7","des-EDE3-CBC"),i("2.16.840.1.101.3.4.1.2","aes128-CBC"),i("2.16.840.1.101.3.4.1.22","aes192-CBC"),i("2.16.840.1.101.3.4.1.42","aes256-CBC"),i("2.5.4.3","commonName"),i("2.5.4.4","surname"),i("2.5.4.5","serialNumber"),i("2.5.4.6","countryName"),i("2.5.4.7","localityName"),i("2.5.4.8","stateOrProvinceName"),i("2.5.4.9","streetAddress"),i("2.5.4.10","organizationName"),i("2.5.4.11","organizationalUnitName"),i("2.5.4.12","title"),i("2.5.4.13","description"),i("2.5.4.15","businessCategory"),i("2.5.4.17","postalCode"),i("2.5.4.42","givenName"),i("1.3.6.1.4.1.311.60.2.1.2","jurisdictionOfIncorporationStateOrProvinceName"),i("1.3.6.1.4.1.311.60.2.1.3","jurisdictionOfIncorporationCountryName"),i("2.16.840.1.113730.1.1","nsCertType"),i("2.16.840.1.113730.1.13","nsComment"),s("2.5.29.1","authorityKeyIdentifier"),s("2.5.29.2","keyAttributes"),s("2.5.29.3","certificatePolicies"),s("2.5.29.4","keyUsageRestriction"),s("2.5.29.5","policyMapping"),s("2.5.29.6","subtreesConstraint"),s("2.5.29.7","subjectAltName"),s("2.5.29.8","issuerAltName"),s("2.5.29.9","subjectDirectoryAttributes"),s("2.5.29.10","basicConstraints"),s("2.5.29.11","nameConstraints"),s("2.5.29.12","policyConstraints"),s("2.5.29.13","basicConstraints"),i("2.5.29.14","subjectKeyIdentifier"),i("2.5.29.15","keyUsage"),s("2.5.29.16","privateKeyUsagePeriod"),i("2.5.29.17","subjectAltName"),i("2.5.29.18","issuerAltName"),i("2.5.29.19","basicConstraints"),s("2.5.29.20","cRLNumber"),s("2.5.29.21","cRLReason"),s("2.5.29.22","expirationDate"),s("2.5.29.23","instructionCode"),s("2.5.29.24","invalidityDate"),s("2.5.29.25","cRLDistributionPoints"),s("2.5.29.26","issuingDistributionPoint"),s("2.5.29.27","deltaCRLIndicator"),s("2.5.29.28","issuingDistributionPoint"),s("2.5.29.29","certificateIssuer"),s("2.5.29.30","nameConstraints"),i("2.5.29.31","cRLDistributionPoints"),i("2.5.29.32","certificatePolicies"),s("2.5.29.33","policyMappings"),s("2.5.29.34","policyConstraints"),i("2.5.29.35","authorityKeyIdentifier"),s("2.5.29.36","policyConstraints"),i("2.5.29.37","extKeyUsage"),s("2.5.29.46","freshestCRL"),s("2.5.29.54","inhibitAnyPolicy"),i("1.3.6.1.4.1.11129.2.4.2","timestampList"),i("1.3.6.1.5.5.7.1.1","authorityInfoAccess"),i("1.3.6.1.5.5.7.3.1","serverAuth"),i("1.3.6.1.5.5.7.3.2","clientAuth"),i("1.3.6.1.5.5.7.3.3","codeSigning"),i("1.3.6.1.5.5.7.3.4","emailProtection"),i("1.3.6.1.5.5.7.3.8","timeStamping")},function(e,t,r){var a=r(0);r(1);var n=e.exports=a.pem=a.pem||{};function i(e){for(var t=e.name+": ",r=[],a=function(e,t){return" "+t},n=0;n65&&-1!==s){var o=t[s];","===o?(++s,t=t.substr(0,s)+"\r\n "+t.substr(s)):t=t.substr(0,s)+"\r\n"+o+t.substr(s+1),i=n-s-1,s=-1,++n}else" "!==t[n]&&"\t"!==t[n]&&","!==t[n]||(s=n);return t}function s(e){return e.replace(/^\s+/,"")}n.encode=function(e,t){t=t||{};var r,n="-----BEGIN "+e.type+"-----\r\n";if(e.procType&&(n+=i(r={name:"Proc-Type",values:[String(e.procType.version),e.procType.type]})),e.contentDomain&&(n+=i(r={name:"Content-Domain",values:[e.contentDomain]})),e.dekInfo&&(r={name:"DEK-Info",values:[e.dekInfo.algorithm]},e.dekInfo.parameters&&r.values.push(e.dekInfo.parameters),n+=i(r)),e.headers)for(var s=0;st.blockLength&&(t.start(),t.update(s.bytes()),s=t.digest()),r=a.util.createBuffer(),n=a.util.createBuffer(),u=s.length();for(c=0;c>>0,c>>>0];for(var u=n.fullMessageLength.length-1;u>=0;--u)n.fullMessageLength[u]+=c[1],c[1]=c[0]+(n.fullMessageLength[u]/4294967296>>>0),n.fullMessageLength[u]=n.fullMessageLength[u]>>>0,c[0]=c[1]/4294967296>>>0;return t.putBytes(i),o(e,r,t),(t.read>2048||0===t.length())&&t.compact(),n},n.digest=function(){var s=a.util.createBuffer();s.putBytes(t.bytes());var c,u=n.fullMessageLength[n.fullMessageLength.length-1]+n.messageLengthSize&n.blockLength-1;s.putBytes(i.substr(0,n.blockLength-u));for(var l=8*n.fullMessageLength[0],p=0;p>>0,s.putInt32(l>>>0),l=c>>>0;s.putInt32(l);var f={h0:e.h0,h1:e.h1,h2:e.h2,h3:e.h3,h4:e.h4};o(f,r,s);var h=a.util.createBuffer();return h.putInt32(f.h0),h.putInt32(f.h1),h.putInt32(f.h2),h.putInt32(f.h3),h.putInt32(f.h4),h},n};var i=null,s=!1;function o(e,t,r){for(var a,n,i,s,o,c,u,l=r.length();l>=64;){for(n=e.h0,i=e.h1,s=e.h2,o=e.h3,c=e.h4,u=0;u<16;++u)a=r.getInt32(),t[u]=a,a=(n<<5|n>>>27)+(o^i&(s^o))+c+1518500249+a,c=o,o=s,s=(i<<30|i>>>2)>>>0,i=n,n=a;for(;u<20;++u)a=(a=t[u-3]^t[u-8]^t[u-14]^t[u-16])<<1|a>>>31,t[u]=a,a=(n<<5|n>>>27)+(o^i&(s^o))+c+1518500249+a,c=o,o=s,s=(i<<30|i>>>2)>>>0,i=n,n=a;for(;u<32;++u)a=(a=t[u-3]^t[u-8]^t[u-14]^t[u-16])<<1|a>>>31,t[u]=a,a=(n<<5|n>>>27)+(i^s^o)+c+1859775393+a,c=o,o=s,s=(i<<30|i>>>2)>>>0,i=n,n=a;for(;u<40;++u)a=(a=t[u-6]^t[u-16]^t[u-28]^t[u-32])<<2|a>>>30,t[u]=a,a=(n<<5|n>>>27)+(i^s^o)+c+1859775393+a,c=o,o=s,s=(i<<30|i>>>2)>>>0,i=n,n=a;for(;u<60;++u)a=(a=t[u-6]^t[u-16]^t[u-28]^t[u-32])<<2|a>>>30,t[u]=a,a=(n<<5|n>>>27)+(i&s|o&(i^s))+c+2400959708+a,c=o,o=s,s=(i<<30|i>>>2)>>>0,i=n,n=a;for(;u<80;++u)a=(a=t[u-6]^t[u-16]^t[u-28]^t[u-32])<<2|a>>>30,t[u]=a,a=(n<<5|n>>>27)+(i^s^o)+c+3395469782+a,c=o,o=s,s=(i<<30|i>>>2)>>>0,i=n,n=a;e.h0=e.h0+n|0,e.h1=e.h1+i|0,e.h2=e.h2+s|0,e.h3=e.h3+o|0,e.h4=e.h4+c|0,l-=64}}},function(e,t,r){var a=r(0);function n(e,t){a.cipher.registerAlgorithm(e,(function(){return new a.des.Algorithm(e,t)}))}r(13),r(19),r(1),e.exports=a.des=a.des||{},a.des.startEncrypting=function(e,t,r,a){var n=d({key:e,output:r,decrypt:!1,mode:a||(null===t?"ECB":"CBC")});return n.start(t),n},a.des.createEncryptionCipher=function(e,t){return d({key:e,output:null,decrypt:!1,mode:t})},a.des.startDecrypting=function(e,t,r,a){var n=d({key:e,output:r,decrypt:!0,mode:a||(null===t?"ECB":"CBC")});return n.start(t),n},a.des.createDecryptionCipher=function(e,t){return d({key:e,output:null,decrypt:!0,mode:t})},a.des.Algorithm=function(e,t){var r=this;r.name=e,r.mode=new t({blockSize:8,cipher:{encrypt:function(e,t){return h(r._keys,e,t,!1)},decrypt:function(e,t){return h(r._keys,e,t,!0)}}}),r._init=!1},a.des.Algorithm.prototype.initialize=function(e){if(!this._init){var t=a.util.createBuffer(e.key);if(0===this.name.indexOf("3DES")&&24!==t.length())throw new Error("Invalid Triple-DES key size: "+8*t.length());this._keys=function(e){for(var t,r=[0,4,536870912,536870916,65536,65540,536936448,536936452,512,516,536871424,536871428,66048,66052,536936960,536936964],a=[0,1,1048576,1048577,67108864,67108865,68157440,68157441,256,257,1048832,1048833,67109120,67109121,68157696,68157697],n=[0,8,2048,2056,16777216,16777224,16779264,16779272,0,8,2048,2056,16777216,16777224,16779264,16779272],i=[0,2097152,134217728,136314880,8192,2105344,134225920,136323072,131072,2228224,134348800,136445952,139264,2236416,134356992,136454144],s=[0,262144,16,262160,0,262144,16,262160,4096,266240,4112,266256,4096,266240,4112,266256],o=[0,1024,32,1056,0,1024,32,1056,33554432,33555456,33554464,33555488,33554432,33555456,33554464,33555488],c=[0,268435456,524288,268959744,2,268435458,524290,268959746,0,268435456,524288,268959744,2,268435458,524290,268959746],u=[0,65536,2048,67584,536870912,536936448,536872960,536938496,131072,196608,133120,198656,537001984,537067520,537004032,537069568],l=[0,262144,0,262144,2,262146,2,262146,33554432,33816576,33554432,33816576,33554434,33816578,33554434,33816578],p=[0,268435456,8,268435464,0,268435456,8,268435464,1024,268436480,1032,268436488,1024,268436480,1032,268436488],f=[0,32,0,32,1048576,1048608,1048576,1048608,8192,8224,8192,8224,1056768,1056800,1056768,1056800],h=[0,16777216,512,16777728,2097152,18874368,2097664,18874880,67108864,83886080,67109376,83886592,69206016,85983232,69206528,85983744],d=[0,4096,134217728,134221824,524288,528384,134742016,134746112,16,4112,134217744,134221840,524304,528400,134742032,134746128],y=[0,4,256,260,0,4,256,260,1,5,257,261,1,5,257,261],g=e.length()>8?3:1,v=[],m=[0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0],C=0,E=0;E>>4^T))<<4,S^=t=65535&((T^=t)>>>-16^S),S^=(t=858993459&(S>>>2^(T^=t<<-16)))<<2,S^=t=65535&((T^=t)>>>-16^S),S^=(t=1431655765&(S>>>1^(T^=t<<-16)))<<1,S^=t=16711935&((T^=t)>>>8^S),t=(S^=(t=1431655765&(S>>>1^(T^=t<<8)))<<1)<<8|(T^=t)>>>20&240,S=T<<24|T<<8&16711680|T>>>8&65280|T>>>24&240,T=t;for(var I=0;I>>26,T=T<<2|T>>>26):(S=S<<1|S>>>27,T=T<<1|T>>>27);var A=r[(S&=-15)>>>28]|a[S>>>24&15]|n[S>>>20&15]|i[S>>>16&15]|s[S>>>12&15]|o[S>>>8&15]|c[S>>>4&15],B=u[(T&=-15)>>>28]|l[T>>>24&15]|p[T>>>20&15]|f[T>>>16&15]|h[T>>>12&15]|d[T>>>8&15]|y[T>>>4&15];t=65535&(B>>>16^A),v[C++]=A^t,v[C++]=B^t<<16}}return v}(t),this._init=!0}},n("DES-ECB",a.cipher.modes.ecb),n("DES-CBC",a.cipher.modes.cbc),n("DES-CFB",a.cipher.modes.cfb),n("DES-OFB",a.cipher.modes.ofb),n("DES-CTR",a.cipher.modes.ctr),n("3DES-ECB",a.cipher.modes.ecb),n("3DES-CBC",a.cipher.modes.cbc),n("3DES-CFB",a.cipher.modes.cfb),n("3DES-OFB",a.cipher.modes.ofb),n("3DES-CTR",a.cipher.modes.ctr);var i=[16843776,0,65536,16843780,16842756,66564,4,65536,1024,16843776,16843780,1024,16778244,16842756,16777216,4,1028,16778240,16778240,66560,66560,16842752,16842752,16778244,65540,16777220,16777220,65540,0,1028,66564,16777216,65536,16843780,4,16842752,16843776,16777216,16777216,1024,16842756,65536,66560,16777220,1024,4,16778244,66564,16843780,65540,16842752,16778244,16777220,1028,66564,16843776,1028,16778240,16778240,0,65540,66560,0,16842756],s=[-2146402272,-2147450880,32768,1081376,1048576,32,-2146435040,-2147450848,-2147483616,-2146402272,-2146402304,-2147483648,-2147450880,1048576,32,-2146435040,1081344,1048608,-2147450848,0,-2147483648,32768,1081376,-2146435072,1048608,-2147483616,0,1081344,32800,-2146402304,-2146435072,32800,0,1081376,-2146435040,1048576,-2147450848,-2146435072,-2146402304,32768,-2146435072,-2147450880,32,-2146402272,1081376,32,32768,-2147483648,32800,-2146402304,1048576,-2147483616,1048608,-2147450848,-2147483616,1048608,1081344,0,-2147450880,32800,-2147483648,-2146435040,-2146402272,1081344],o=[520,134349312,0,134348808,134218240,0,131592,134218240,131080,134217736,134217736,131072,134349320,131080,134348800,520,134217728,8,134349312,512,131584,134348800,134348808,131592,134218248,131584,131072,134218248,8,134349320,512,134217728,134349312,134217728,131080,520,131072,134349312,134218240,0,512,131080,134349320,134218240,134217736,512,0,134348808,134218248,131072,134217728,134349320,8,131592,131584,134217736,134348800,134218248,520,134348800,131592,8,134348808,131584],c=[8396801,8321,8321,128,8396928,8388737,8388609,8193,0,8396800,8396800,8396929,129,0,8388736,8388609,1,8192,8388608,8396801,128,8388608,8193,8320,8388737,1,8320,8388736,8192,8396928,8396929,129,8388736,8388609,8396800,8396929,129,0,0,8396800,8320,8388736,8388737,1,8396801,8321,8321,128,8396929,129,1,8192,8388609,8193,8396928,8388737,8193,8320,8388608,8396801,128,8388608,8192,8396928],u=[256,34078976,34078720,1107296512,524288,256,1073741824,34078720,1074266368,524288,33554688,1074266368,1107296512,1107820544,524544,1073741824,33554432,1074266112,1074266112,0,1073742080,1107820800,1107820800,33554688,1107820544,1073742080,0,1107296256,34078976,33554432,1107296256,524544,524288,1107296512,256,33554432,1073741824,34078720,1107296512,1074266368,33554688,1073741824,1107820544,34078976,1074266368,256,33554432,1107820544,1107820800,524544,1107296256,1107820800,34078720,0,1074266112,1107296256,524544,33554688,1073742080,524288,0,1074266112,34078976,1073742080],l=[536870928,541065216,16384,541081616,541065216,16,541081616,4194304,536887296,4210704,4194304,536870928,4194320,536887296,536870912,16400,0,4194320,536887312,16384,4210688,536887312,16,541065232,541065232,0,4210704,541081600,16400,4210688,541081600,536870912,536887296,16,541065232,4210688,541081616,4194304,16400,536870928,4194304,536887296,536870912,16400,536870928,541081616,4210688,541065216,4210704,541081600,0,541065232,16,16384,541065216,4210704,16384,4194320,536887312,0,541081600,536870912,4194320,536887312],p=[2097152,69206018,67110914,0,2048,67110914,2099202,69208064,69208066,2097152,0,67108866,2,67108864,69206018,2050,67110912,2099202,2097154,67110912,67108866,69206016,69208064,2097154,69206016,2048,2050,69208066,2099200,2,67108864,2099200,67108864,2099200,2097152,67110914,67110914,69206018,69206018,2,2097154,67108864,67110912,2097152,69208064,2050,2099202,69208064,2050,67108866,69208066,69206016,2099200,0,2,69208066,0,2099202,69206016,2048,67108866,67110912,2048,2097154],f=[268439616,4096,262144,268701760,268435456,268439616,64,268435456,262208,268697600,268701760,266240,268701696,266304,4096,64,268697600,268435520,268439552,4160,266240,262208,268697664,268701696,4160,0,0,268697664,268435520,268439552,266304,262144,266304,262144,268701696,4096,64,268697664,4096,266304,268439552,64,268435520,268697600,268697664,268435456,262144,268439616,0,268701760,262208,268435520,268697600,268439552,268439616,0,268701760,266240,266240,4160,4160,262208,268435456,268701696];function h(e,t,r,a){var n,h,d=32===e.length?3:9;n=3===d?a?[30,-2,-2]:[0,32,2]:a?[94,62,-2,32,64,2,30,-2,-2]:[0,32,2,62,30,-2,64,96,2];var y=t[0],g=t[1];y^=(h=252645135&(y>>>4^g))<<4,y^=(h=65535&(y>>>16^(g^=h)))<<16,y^=h=858993459&((g^=h)>>>2^y),y^=h=16711935&((g^=h<<2)>>>8^y),y=(y^=(h=1431655765&(y>>>1^(g^=h<<8)))<<1)<<1|y>>>31,g=(g^=h)<<1|g>>>31;for(var v=0;v>>4|g<<28)^e[E+1];h=y,y=g,g=h^(s[S>>>24&63]|c[S>>>16&63]|l[S>>>8&63]|f[63&S]|i[T>>>24&63]|o[T>>>16&63]|u[T>>>8&63]|p[63&T])}h=y,y=g,g=h}g=g>>>1|g<<31,g^=h=1431655765&((y=y>>>1|y<<31)>>>1^g),g^=(h=16711935&(g>>>8^(y^=h<<1)))<<8,g^=(h=858993459&(g>>>2^(y^=h)))<<2,g^=h=65535&((y^=h)>>>16^g),g^=h=252645135&((y^=h<<16)>>>4^g),y^=h<<4,r[0]=y,r[1]=g}function d(e){var t,r="DES-"+((e=e||{}).mode||"CBC").toUpperCase(),n=(t=e.decrypt?a.cipher.createDecipher(r,e.key):a.cipher.createCipher(r,e.key)).start;return t.start=function(e,r){var i=null;r instanceof a.util.ByteBuffer&&(i=r,r={}),(r=r||{}).output=i,r.iv=e,n.call(t,r)},t}},function(e,t,r){var a=r(0);if(r(3),r(12),r(6),r(26),r(27),r(2),r(1),void 0===n)var n=a.jsbn.BigInteger;var i=a.util.isNodejs?r(16):null,s=a.asn1,o=a.util;a.pki=a.pki||{},e.exports=a.pki.rsa=a.rsa=a.rsa||{};var c=a.pki,u=[6,4,2,4,2,4,6,2],l={name:"PrivateKeyInfo",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:s.Class.UNIVERSAL,type:s.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:s.Class.UNIVERSAL,type:s.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]},p={name:"RSAPrivateKey",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPrivateKey.version",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"RSAPrivateKey.modulus",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyModulus"},{name:"RSAPrivateKey.publicExponent",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyPublicExponent"},{name:"RSAPrivateKey.privateExponent",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyPrivateExponent"},{name:"RSAPrivateKey.prime1",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyPrime1"},{name:"RSAPrivateKey.prime2",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyPrime2"},{name:"RSAPrivateKey.exponent1",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyExponent1"},{name:"RSAPrivateKey.exponent2",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyExponent2"},{name:"RSAPrivateKey.coefficient",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyCoefficient"}]},f={name:"RSAPublicKey",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPublicKey.modulus",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"publicKeyModulus"},{name:"RSAPublicKey.exponent",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"publicKeyExponent"}]},h=a.pki.rsa.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:s.Class.UNIVERSAL,type:s.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{name:"SubjectPublicKeyInfo.subjectPublicKey",tagClass:s.Class.UNIVERSAL,type:s.Type.BITSTRING,constructed:!1,value:[{name:"SubjectPublicKeyInfo.subjectPublicKey.RSAPublicKey",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"rsaPublicKey"}]}]},d={name:"DigestInfo",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,value:[{name:"DigestInfo.DigestAlgorithm",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,value:[{name:"DigestInfo.DigestAlgorithm.algorithmIdentifier",tagClass:s.Class.UNIVERSAL,type:s.Type.OID,constructed:!1,capture:"algorithmIdentifier"},{name:"DigestInfo.DigestAlgorithm.parameters",tagClass:s.Class.UNIVERSAL,type:s.Type.NULL,capture:"parameters",optional:!0,constructed:!1}]},{name:"DigestInfo.digest",tagClass:s.Class.UNIVERSAL,type:s.Type.OCTETSTRING,constructed:!1,capture:"digest"}]},y=function(e){var t;if(!(e.algorithm in c.oids)){var r=new Error("Unknown message digest algorithm.");throw r.algorithm=e.algorithm,r}t=c.oids[e.algorithm];var a=s.oidToDer(t).getBytes(),n=s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[]),i=s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[]);i.value.push(s.create(s.Class.UNIVERSAL,s.Type.OID,!1,a)),i.value.push(s.create(s.Class.UNIVERSAL,s.Type.NULL,!1,""));var o=s.create(s.Class.UNIVERSAL,s.Type.OCTETSTRING,!1,e.digest().getBytes());return n.value.push(i),n.value.push(o),s.toDer(n).getBytes()},g=function(e,t,r){if(r)return e.modPow(t.e,t.n);if(!t.p||!t.q)return e.modPow(t.d,t.n);var i;t.dP||(t.dP=t.d.mod(t.p.subtract(n.ONE))),t.dQ||(t.dQ=t.d.mod(t.q.subtract(n.ONE))),t.qInv||(t.qInv=t.q.modInverse(t.p));do{i=new n(a.util.bytesToHex(a.random.getBytes(t.n.bitLength()/8)),16)}while(i.compareTo(t.n)>=0||!i.gcd(t.n).equals(n.ONE));for(var s=(e=e.multiply(i.modPow(t.e,t.n)).mod(t.n)).mod(t.p).modPow(t.dP,t.p),o=e.mod(t.q).modPow(t.dQ,t.q);s.compareTo(o)<0;)s=s.add(t.p);var c=s.subtract(o).multiply(t.qInv).mod(t.p).multiply(t.q).add(o);return c=c.multiply(i.modInverse(t.n)).mod(t.n)};function v(e,t,r){var n=a.util.createBuffer(),i=Math.ceil(t.n.bitLength()/8);if(e.length>i-11){var s=new Error("Message is too long for PKCS#1 v1.5 padding.");throw s.length=e.length,s.max=i-11,s}n.putByte(0),n.putByte(r);var o,c=i-3-e.length;if(0===r||1===r){o=0===r?0:255;for(var u=0;u0;){var l=0,p=a.random.getBytes(c);for(u=0;u1;){if(255!==s.getByte()){--s.read;break}++u}else if(2===c)for(u=0;s.length()>1;){if(0===s.getByte()){--s.read;break}++u}if(0!==s.getByte()||u!==i-3-s.length())throw new Error("Encryption block is invalid.");return s.getBytes()}function C(e,t,r){"function"==typeof t&&(r=t,t={});var i={algorithm:{name:(t=t||{}).algorithm||"PRIMEINC",options:{workers:t.workers||2,workLoad:t.workLoad||100,workerScript:t.workerScript}}};function s(){o(e.pBits,(function(t,a){return t?r(t):(e.p=a,null!==e.q?u(t,e.q):void o(e.qBits,u))}))}function o(e,t){a.prime.generateProbablePrime(e,i,t)}function u(t,a){if(t)return r(t);if(e.q=a,e.p.compareTo(e.q)<0){var i=e.p;e.p=e.q,e.q=i}if(0!==e.p.subtract(n.ONE).gcd(e.e).compareTo(n.ONE))return e.p=null,void s();if(0!==e.q.subtract(n.ONE).gcd(e.e).compareTo(n.ONE))return e.q=null,void o(e.qBits,u);if(e.p1=e.p.subtract(n.ONE),e.q1=e.q.subtract(n.ONE),e.phi=e.p1.multiply(e.q1),0!==e.phi.gcd(e.e).compareTo(n.ONE))return e.p=e.q=null,void s();if(e.n=e.p.multiply(e.q),e.n.bitLength()!==e.bits)return e.q=null,void o(e.qBits,u);var l=e.e.modInverse(e.phi);e.keys={privateKey:c.rsa.setPrivateKey(e.n,e.e,l,e.p,e.q,l.mod(e.p1),l.mod(e.q1),e.q.modInverse(e.p)),publicKey:c.rsa.setPublicKey(e.n,e.e)},r(null,e.keys)}"prng"in t&&(i.prng=t.prng),s()}function E(e){var t=e.toString(16);t[0]>="8"&&(t="00"+t);var r=a.util.hexToBytes(t);return r.length>1&&(0===r.charCodeAt(0)&&0==(128&r.charCodeAt(1))||255===r.charCodeAt(0)&&128==(128&r.charCodeAt(1)))?r.substr(1):r}function S(e){return e<=100?27:e<=150?18:e<=200?15:e<=250?12:e<=300?9:e<=350?8:e<=400?7:e<=500?6:e<=600?5:e<=800?4:e<=1250?3:2}function T(e){return a.util.isNodejs&&"function"==typeof i[e]}function I(e){return void 0!==o.globalScope&&"object"==typeof o.globalScope.crypto&&"object"==typeof o.globalScope.crypto.subtle&&"function"==typeof o.globalScope.crypto.subtle[e]}function A(e){return void 0!==o.globalScope&&"object"==typeof o.globalScope.msCrypto&&"object"==typeof o.globalScope.msCrypto.subtle&&"function"==typeof o.globalScope.msCrypto.subtle[e]}function B(e){for(var t=a.util.hexToBytes(e.toString(16)),r=new Uint8Array(t.length),n=0;n0;)l.putByte(0),--p;return l.putBytes(a.util.hexToBytes(u)),l.getBytes()},c.rsa.decrypt=function(e,t,r,i){var s=Math.ceil(t.n.bitLength()/8);if(e.length!==s){var o=new Error("Encrypted message length is invalid.");throw o.length=e.length,o.expected=s,o}var c=new n(a.util.createBuffer(e).toHex(),16);if(c.compareTo(t.n)>=0)throw new Error("Encrypted message is invalid.");for(var u=g(c,t,r).toString(16),l=a.util.createBuffer(),p=s-Math.ceil(u.length/2);p>0;)l.putByte(0),--p;return l.putBytes(a.util.hexToBytes(u)),!1!==i?m(l.getBytes(),t,r):l.getBytes()},c.rsa.createKeyPairGenerationState=function(e,t,r){"string"==typeof e&&(e=parseInt(e,10)),e=e||2048;var i,s=(r=r||{}).prng||a.random,o={nextBytes:function(e){for(var t=s.getBytesSync(e.length),r=0;r>1,pBits:e-(e>>1),pqState:0,num:null,keys:null}).e.fromInt(i.eInt),i},c.rsa.stepKeyPairGenerationState=function(e,t){"algorithm"in e||(e.algorithm="PRIMEINC");var r=new n(null);r.fromInt(30);for(var a,i=0,s=function(e,t){return e|t},o=+new Date,l=0;null===e.keys&&(t<=0||lp?e.pqState=0:e.num.isProbablePrime(S(e.num.bitLength()))?++e.pqState:e.num.dAddOffset(u[i++%8],0):2===e.pqState?e.pqState=0===e.num.subtract(n.ONE).gcd(e.e).compareTo(n.ONE)?3:0:3===e.pqState&&(e.pqState=0,null===e.p?e.p=e.num:e.q=e.num,null!==e.p&&null!==e.q&&++e.state,e.num=null)}else if(1===e.state)e.p.compareTo(e.q)<0&&(e.num=e.p,e.p=e.q,e.q=e.num),++e.state;else if(2===e.state)e.p1=e.p.subtract(n.ONE),e.q1=e.q.subtract(n.ONE),e.phi=e.p1.multiply(e.q1),++e.state;else if(3===e.state)0===e.phi.gcd(e.e).compareTo(n.ONE)?++e.state:(e.p=null,e.q=null,e.state=0);else if(4===e.state)e.n=e.p.multiply(e.q),e.n.bitLength()===e.bits?++e.state:(e.q=null,e.state=0);else if(5===e.state){var h=e.e.modInverse(e.phi);e.keys={privateKey:c.rsa.setPrivateKey(e.n,e.e,h,e.p,e.q,h.mod(e.p1),h.mod(e.q1),e.q.modInverse(e.p)),publicKey:c.rsa.setPublicKey(e.n,e.e)}}l+=(a=+new Date)-o,o=a}return null!==e.keys},c.rsa.generateKeyPair=function(e,t,r,n){if(1===arguments.length?"object"==typeof e?(r=e,e=void 0):"function"==typeof e&&(n=e,e=void 0):2===arguments.length?"number"==typeof e?"function"==typeof t?(n=t,t=void 0):"number"!=typeof t&&(r=t,t=void 0):(r=e,n=t,e=void 0,t=void 0):3===arguments.length&&("number"==typeof t?"function"==typeof r&&(n=r,r=void 0):(n=r,r=t,t=void 0)),r=r||{},void 0===e&&(e=r.bits||2048),void 0===t&&(t=r.e||65537),!a.options.usePureJavaScript&&!r.prng&&e>=256&&e<=16384&&(65537===t||3===t))if(n){if(T("generateKeyPair"))return i.generateKeyPair("rsa",{modulusLength:e,publicExponent:t,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}},(function(e,t,r){if(e)return n(e);n(null,{privateKey:c.privateKeyFromPem(r),publicKey:c.publicKeyFromPem(t)})}));if(I("generateKey")&&I("exportKey"))return o.globalScope.crypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:e,publicExponent:B(t),hash:{name:"SHA-256"}},!0,["sign","verify"]).then((function(e){return o.globalScope.crypto.subtle.exportKey("pkcs8",e.privateKey)})).then(void 0,(function(e){n(e)})).then((function(e){if(e){var t=c.privateKeyFromAsn1(s.fromDer(a.util.createBuffer(e)));n(null,{privateKey:t,publicKey:c.setRsaPublicKey(t.n,t.e)})}}));if(A("generateKey")&&A("exportKey")){var u=o.globalScope.msCrypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:e,publicExponent:B(t),hash:{name:"SHA-256"}},!0,["sign","verify"]);return u.oncomplete=function(e){var t=e.target.result,r=o.globalScope.msCrypto.subtle.exportKey("pkcs8",t.privateKey);r.oncomplete=function(e){var t=e.target.result,r=c.privateKeyFromAsn1(s.fromDer(a.util.createBuffer(t)));n(null,{privateKey:r,publicKey:c.setRsaPublicKey(r.n,r.e)})},r.onerror=function(e){n(e)}},void(u.onerror=function(e){n(e)})}}else if(T("generateKeyPairSync")){var l=i.generateKeyPairSync("rsa",{modulusLength:e,publicExponent:t,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}});return{privateKey:c.privateKeyFromPem(l.privateKey),publicKey:c.publicKeyFromPem(l.publicKey)}}var p=c.rsa.createKeyPairGenerationState(e,t,r);if(!n)return c.rsa.stepKeyPairGenerationState(p,0),p.keys;C(p,r,n)},c.setRsaPublicKey=c.rsa.setPublicKey=function(e,t){var r={n:e,e:t,encrypt:function(e,t,n){if("string"==typeof t?t=t.toUpperCase():void 0===t&&(t="RSAES-PKCS1-V1_5"),"RSAES-PKCS1-V1_5"===t)t={encode:function(e,t,r){return v(e,t,2).getBytes()}};else if("RSA-OAEP"===t||"RSAES-OAEP"===t)t={encode:function(e,t){return a.pkcs1.encode_rsa_oaep(t,e,n)}};else if(-1!==["RAW","NONE","NULL",null].indexOf(t))t={encode:function(e){return e}};else if("string"==typeof t)throw new Error('Unsupported encryption scheme: "'+t+'".');var i=t.encode(e,r,!0);return c.rsa.encrypt(i,r,!0)},verify:function(e,t,n,i){"string"==typeof n?n=n.toUpperCase():void 0===n&&(n="RSASSA-PKCS1-V1_5"),void 0===i&&(i={_parseAllDigestBytes:!0}),"_parseAllDigestBytes"in i||(i._parseAllDigestBytes=!0),"RSASSA-PKCS1-V1_5"===n?n={verify:function(e,t){t=m(t,r,!0);var n=s.fromDer(t,{parseAllBytes:i._parseAllDigestBytes}),o={},c=[];if(!s.validate(n,d,o,c))throw(u=new Error("ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value.")).errors=c,u;var u,l=s.derToOid(o.algorithmIdentifier);if(l!==a.oids.md2&&l!==a.oids.md5&&l!==a.oids.sha1&&l!==a.oids.sha224&&l!==a.oids.sha256&&l!==a.oids.sha384&&l!==a.oids.sha512&&l!==a.oids["sha512-224"]&&l!==a.oids["sha512-256"])throw(u=new Error("Unknown RSASSA-PKCS1-v1_5 DigestAlgorithm identifier.")).oid=l,u;if((l===a.oids.md2||l===a.oids.md5)&&!("parameters"in o))throw new Error("ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value. Missing algorithm identifer NULL parameters.");return e===o.digest}}:"NONE"!==n&&"NULL"!==n&&null!==n||(n={verify:function(e,t){return e===(t=m(t,r,!0))}});var o=c.rsa.decrypt(t,r,!0,!1);return n.verify(e,o,r.n.bitLength())}};return r},c.setRsaPrivateKey=c.rsa.setPrivateKey=function(e,t,r,n,i,s,o,u){var l={n:e,e:t,d:r,p:n,q:i,dP:s,dQ:o,qInv:u,decrypt:function(e,t,r){"string"==typeof t?t=t.toUpperCase():void 0===t&&(t="RSAES-PKCS1-V1_5");var n=c.rsa.decrypt(e,l,!1,!1);if("RSAES-PKCS1-V1_5"===t)t={decode:m};else if("RSA-OAEP"===t||"RSAES-OAEP"===t)t={decode:function(e,t){return a.pkcs1.decode_rsa_oaep(t,e,r)}};else{if(-1===["RAW","NONE","NULL",null].indexOf(t))throw new Error('Unsupported encryption scheme: "'+t+'".');t={decode:function(e){return e}}}return t.decode(n,l,!1)},sign:function(e,t){var r=!1;"string"==typeof t&&(t=t.toUpperCase()),void 0===t||"RSASSA-PKCS1-V1_5"===t?(t={encode:y},r=1):"NONE"!==t&&"NULL"!==t&&null!==t||(t={encode:function(){return e}},r=1);var a=t.encode(e,l.n.bitLength());return c.rsa.encrypt(a,l,r)}};return l},c.wrapRsaPrivateKey=function(e){return s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,s.integerToDer(0).getBytes()),s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[s.create(s.Class.UNIVERSAL,s.Type.OID,!1,s.oidToDer(c.oids.rsaEncryption).getBytes()),s.create(s.Class.UNIVERSAL,s.Type.NULL,!1,"")]),s.create(s.Class.UNIVERSAL,s.Type.OCTETSTRING,!1,s.toDer(e).getBytes())])},c.privateKeyFromAsn1=function(e){var t,r,i,o,u,f,h,d,y={},g=[];if(s.validate(e,l,y,g)&&(e=s.fromDer(a.util.createBuffer(y.privateKey))),y={},g=[],!s.validate(e,p,y,g)){var v=new Error("Cannot read private key. ASN.1 object does not contain an RSAPrivateKey.");throw v.errors=g,v}return t=a.util.createBuffer(y.privateKeyModulus).toHex(),r=a.util.createBuffer(y.privateKeyPublicExponent).toHex(),i=a.util.createBuffer(y.privateKeyPrivateExponent).toHex(),o=a.util.createBuffer(y.privateKeyPrime1).toHex(),u=a.util.createBuffer(y.privateKeyPrime2).toHex(),f=a.util.createBuffer(y.privateKeyExponent1).toHex(),h=a.util.createBuffer(y.privateKeyExponent2).toHex(),d=a.util.createBuffer(y.privateKeyCoefficient).toHex(),c.setRsaPrivateKey(new n(t,16),new n(r,16),new n(i,16),new n(o,16),new n(u,16),new n(f,16),new n(h,16),new n(d,16))},c.privateKeyToAsn1=c.privateKeyToRSAPrivateKey=function(e){return s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,s.integerToDer(0).getBytes()),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,E(e.n)),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,E(e.e)),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,E(e.d)),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,E(e.p)),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,E(e.q)),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,E(e.dP)),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,E(e.dQ)),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,E(e.qInv))])},c.publicKeyFromAsn1=function(e){var t={},r=[];if(s.validate(e,h,t,r)){var i,o=s.derToOid(t.publicKeyOid);if(o!==c.oids.rsaEncryption)throw(i=new Error("Cannot read public key. Unknown OID.")).oid=o,i;e=t.rsaPublicKey}if(r=[],!s.validate(e,f,t,r))throw(i=new Error("Cannot read public key. ASN.1 object does not contain an RSAPublicKey.")).errors=r,i;var u=a.util.createBuffer(t.publicKeyModulus).toHex(),l=a.util.createBuffer(t.publicKeyExponent).toHex();return c.setRsaPublicKey(new n(u,16),new n(l,16))},c.publicKeyToAsn1=c.publicKeyToSubjectPublicKeyInfo=function(e){return s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[s.create(s.Class.UNIVERSAL,s.Type.OID,!1,s.oidToDer(c.oids.rsaEncryption).getBytes()),s.create(s.Class.UNIVERSAL,s.Type.NULL,!1,"")]),s.create(s.Class.UNIVERSAL,s.Type.BITSTRING,!1,[c.publicKeyToRSAPublicKey(e)])])},c.publicKeyToRSAPublicKey=function(e){return s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,E(e.n)),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,E(e.e))])}},function(e,t,r){var a,n=r(0);e.exports=n.jsbn=n.jsbn||{};function i(e,t,r){this.data=[],null!=e&&("number"==typeof e?this.fromNumber(e,t,r):null==t&&"string"!=typeof e?this.fromString(e,256):this.fromString(e,t))}function s(){return new i(null)}function o(e,t,r,a,n,i){for(var s=16383&t,o=t>>14;--i>=0;){var c=16383&this.data[e],u=this.data[e++]>>14,l=o*c+u*s;n=((c=s*c+((16383&l)<<14)+r.data[a]+n)>>28)+(l>>14)+o*u,r.data[a++]=268435455&c}return n}n.jsbn.BigInteger=i,"undefined"==typeof navigator?(i.prototype.am=o,a=28):"Microsoft Internet Explorer"==navigator.appName?(i.prototype.am=function(e,t,r,a,n,i){for(var s=32767&t,o=t>>15;--i>=0;){var c=32767&this.data[e],u=this.data[e++]>>15,l=o*c+u*s;n=((c=s*c+((32767&l)<<15)+r.data[a]+(1073741823&n))>>>30)+(l>>>15)+o*u+(n>>>30),r.data[a++]=1073741823&c}return n},a=30):"Netscape"!=navigator.appName?(i.prototype.am=function(e,t,r,a,n,i){for(;--i>=0;){var s=t*this.data[e++]+r.data[a]+n;n=Math.floor(s/67108864),r.data[a++]=67108863&s}return n},a=26):(i.prototype.am=o,a=28),i.prototype.DB=a,i.prototype.DM=(1<>>16)&&(e=t,r+=16),0!=(t=e>>8)&&(e=t,r+=8),0!=(t=e>>4)&&(e=t,r+=4),0!=(t=e>>2)&&(e=t,r+=2),0!=(t=e>>1)&&(e=t,r+=1),r}function y(e){this.m=e}function g(e){this.m=e,this.mp=e.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<>=16,t+=16),0==(255&e)&&(e>>=8,t+=8),0==(15&e)&&(e>>=4,t+=4),0==(3&e)&&(e>>=2,t+=2),0==(1&e)&&++t,t}function T(e){for(var t=0;0!=e;)e&=e-1,++t;return t}function I(){}function A(e){return e}function B(e){this.r2=s(),this.q3=s(),i.ONE.dlShiftTo(2*e.t,this.r2),this.mu=this.r2.divide(e),this.m=e}y.prototype.convert=function(e){return e.s<0||e.compareTo(this.m)>=0?e.mod(this.m):e},y.prototype.revert=function(e){return e},y.prototype.reduce=function(e){e.divRemTo(this.m,null,e)},y.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},y.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},g.prototype.convert=function(e){var t=s();return e.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),e.s<0&&t.compareTo(i.ZERO)>0&&this.m.subTo(t,t),t},g.prototype.revert=function(e){var t=s();return e.copyTo(t),this.reduce(t),t},g.prototype.reduce=function(e){for(;e.t<=this.mt2;)e.data[e.t++]=0;for(var t=0;t>15)*this.mpl&this.um)<<15)&e.DM;for(r=t+this.m.t,e.data[r]+=this.m.am(0,a,e,t,0,this.m.t);e.data[r]>=e.DV;)e.data[r]-=e.DV,e.data[++r]++}e.clamp(),e.drShiftTo(this.m.t,e),e.compareTo(this.m)>=0&&e.subTo(this.m,e)},g.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},g.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},i.prototype.copyTo=function(e){for(var t=this.t-1;t>=0;--t)e.data[t]=this.data[t];e.t=this.t,e.s=this.s},i.prototype.fromInt=function(e){this.t=1,this.s=e<0?-1:0,e>0?this.data[0]=e:e<-1?this.data[0]=e+this.DV:this.t=0},i.prototype.fromString=function(e,t){var r;if(16==t)r=4;else if(8==t)r=3;else if(256==t)r=8;else if(2==t)r=1;else if(32==t)r=5;else{if(4!=t)return void this.fromRadix(e,t);r=2}this.t=0,this.s=0;for(var a=e.length,n=!1,s=0;--a>=0;){var o=8==r?255&e[a]:f(e,a);o<0?"-"==e.charAt(a)&&(n=!0):(n=!1,0==s?this.data[this.t++]=o:s+r>this.DB?(this.data[this.t-1]|=(o&(1<>this.DB-s):this.data[this.t-1]|=o<=this.DB&&(s-=this.DB))}8==r&&0!=(128&e[0])&&(this.s=-1,s>0&&(this.data[this.t-1]|=(1<0&&this.data[this.t-1]==e;)--this.t},i.prototype.dlShiftTo=function(e,t){var r;for(r=this.t-1;r>=0;--r)t.data[r+e]=this.data[r];for(r=e-1;r>=0;--r)t.data[r]=0;t.t=this.t+e,t.s=this.s},i.prototype.drShiftTo=function(e,t){for(var r=e;r=0;--r)t.data[r+s+1]=this.data[r]>>n|o,o=(this.data[r]&i)<=0;--r)t.data[r]=0;t.data[s]=o,t.t=this.t+s+1,t.s=this.s,t.clamp()},i.prototype.rShiftTo=function(e,t){t.s=this.s;var r=Math.floor(e/this.DB);if(r>=this.t)t.t=0;else{var a=e%this.DB,n=this.DB-a,i=(1<>a;for(var s=r+1;s>a;a>0&&(t.data[this.t-r-1]|=(this.s&i)<>=this.DB;if(e.t>=this.DB;a+=this.s}else{for(a+=this.s;r>=this.DB;a-=e.s}t.s=a<0?-1:0,a<-1?t.data[r++]=this.DV+a:a>0&&(t.data[r++]=a),t.t=r,t.clamp()},i.prototype.multiplyTo=function(e,t){var r=this.abs(),a=e.abs(),n=r.t;for(t.t=n+a.t;--n>=0;)t.data[n]=0;for(n=0;n=0;)e.data[r]=0;for(r=0;r=t.DV&&(e.data[r+t.t]-=t.DV,e.data[r+t.t+1]=1)}e.t>0&&(e.data[e.t-1]+=t.am(r,t.data[r],e,2*r,0,1)),e.s=0,e.clamp()},i.prototype.divRemTo=function(e,t,r){var a=e.abs();if(!(a.t<=0)){var n=this.abs();if(n.t0?(a.lShiftTo(l,o),n.lShiftTo(l,r)):(a.copyTo(o),n.copyTo(r));var p=o.t,f=o.data[p-1];if(0!=f){var h=f*(1<1?o.data[p-2]>>this.F2:0),y=this.FV/h,g=(1<=0&&(r.data[r.t++]=1,r.subTo(E,r)),i.ONE.dlShiftTo(p,E),E.subTo(o,o);o.t=0;){var S=r.data[--m]==f?this.DM:Math.floor(r.data[m]*y+(r.data[m-1]+v)*g);if((r.data[m]+=o.am(0,S,r,C,0,p))0&&r.rShiftTo(l,r),c<0&&i.ZERO.subTo(r,r)}}},i.prototype.invDigit=function(){if(this.t<1)return 0;var e=this.data[0];if(0==(1&e))return 0;var t=3&e;return(t=(t=(t=(t=t*(2-(15&e)*t)&15)*(2-(255&e)*t)&255)*(2-((65535&e)*t&65535))&65535)*(2-e*t%this.DV)%this.DV)>0?this.DV-t:-t},i.prototype.isEven=function(){return 0==(this.t>0?1&this.data[0]:this.s)},i.prototype.exp=function(e,t){if(e>4294967295||e<1)return i.ONE;var r=s(),a=s(),n=t.convert(this),o=d(e)-1;for(n.copyTo(r);--o>=0;)if(t.sqrTo(r,a),(e&1<0)t.mulTo(a,n,r);else{var c=r;r=a,a=c}return t.revert(r)},i.prototype.toString=function(e){if(this.s<0)return"-"+this.negate().toString(e);var t;if(16==e)t=4;else if(8==e)t=3;else if(2==e)t=1;else if(32==e)t=5;else{if(4!=e)return this.toRadix(e);t=2}var r,a=(1<0)for(o>o)>0&&(n=!0,i=p(r));s>=0;)o>(o+=this.DB-t)):(r=this.data[s]>>(o-=t)&a,o<=0&&(o+=this.DB,--s)),r>0&&(n=!0),n&&(i+=p(r));return n?i:"0"},i.prototype.negate=function(){var e=s();return i.ZERO.subTo(this,e),e},i.prototype.abs=function(){return this.s<0?this.negate():this},i.prototype.compareTo=function(e){var t=this.s-e.s;if(0!=t)return t;var r=this.t;if(0!=(t=r-e.t))return this.s<0?-t:t;for(;--r>=0;)if(0!=(t=this.data[r]-e.data[r]))return t;return 0},i.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+d(this.data[this.t-1]^this.s&this.DM)},i.prototype.mod=function(e){var t=s();return this.abs().divRemTo(e,null,t),this.s<0&&t.compareTo(i.ZERO)>0&&e.subTo(t,t),t},i.prototype.modPowInt=function(e,t){var r;return r=e<256||t.isEven()?new y(t):new g(t),this.exp(e,r)},i.ZERO=h(0),i.ONE=h(1),I.prototype.convert=A,I.prototype.revert=A,I.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r)},I.prototype.sqrTo=function(e,t){e.squareTo(t)},B.prototype.convert=function(e){if(e.s<0||e.t>2*this.m.t)return e.mod(this.m);if(e.compareTo(this.m)<0)return e;var t=s();return e.copyTo(t),this.reduce(t),t},B.prototype.revert=function(e){return e},B.prototype.reduce=function(e){for(e.drShiftTo(this.m.t-1,this.r2),e.t>this.m.t+1&&(e.t=this.m.t+1,e.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);e.compareTo(this.r2)<0;)e.dAddOffset(1,this.m.t+1);for(e.subTo(this.r2,e);e.compareTo(this.m)>=0;)e.subTo(this.m,e)},B.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},B.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)};var b=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509],N=(1<<26)/b[b.length-1];i.prototype.chunkSize=function(e){return Math.floor(Math.LN2*this.DB/Math.log(e))},i.prototype.toRadix=function(e){if(null==e&&(e=10),0==this.signum()||e<2||e>36)return"0";var t=this.chunkSize(e),r=Math.pow(e,t),a=h(r),n=s(),i=s(),o="";for(this.divRemTo(a,n,i);n.signum()>0;)o=(r+i.intValue()).toString(e).substr(1)+o,n.divRemTo(a,n,i);return i.intValue().toString(e)+o},i.prototype.fromRadix=function(e,t){this.fromInt(0),null==t&&(t=10);for(var r=this.chunkSize(t),a=Math.pow(t,r),n=!1,s=0,o=0,c=0;c=r&&(this.dMultiply(a),this.dAddOffset(o,0),s=0,o=0))}s>0&&(this.dMultiply(Math.pow(t,s)),this.dAddOffset(o,0)),n&&i.ZERO.subTo(this,this)},i.prototype.fromNumber=function(e,t,r){if("number"==typeof t)if(e<2)this.fromInt(1);else for(this.fromNumber(e,r),this.testBit(e-1)||this.bitwiseTo(i.ONE.shiftLeft(e-1),m,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(t);)this.dAddOffset(2,0),this.bitLength()>e&&this.subTo(i.ONE.shiftLeft(e-1),this);else{var a=new Array,n=7&e;a.length=1+(e>>3),t.nextBytes(a),n>0?a[0]&=(1<>=this.DB;if(e.t>=this.DB;a+=this.s}else{for(a+=this.s;r>=this.DB;a+=e.s}t.s=a<0?-1:0,a>0?t.data[r++]=a:a<-1&&(t.data[r++]=this.DV+a),t.t=r,t.clamp()},i.prototype.dMultiply=function(e){this.data[this.t]=this.am(0,e-1,this,0,0,this.t),++this.t,this.clamp()},i.prototype.dAddOffset=function(e,t){if(0!=e){for(;this.t<=t;)this.data[this.t++]=0;for(this.data[t]+=e;this.data[t]>=this.DV;)this.data[t]-=this.DV,++t>=this.t&&(this.data[this.t++]=0),++this.data[t]}},i.prototype.multiplyLowerTo=function(e,t,r){var a,n=Math.min(this.t+e.t,t);for(r.s=0,r.t=n;n>0;)r.data[--n]=0;for(a=r.t-this.t;n=0;)r.data[a]=0;for(a=Math.max(t-this.t,0);a0)if(0==t)r=this.data[0]%e;else for(var a=this.t-1;a>=0;--a)r=(t*r+this.data[a])%e;return r},i.prototype.millerRabin=function(e){var t=this.subtract(i.ONE),r=t.getLowestSetBit();if(r<=0)return!1;for(var a,n=t.shiftRight(r),s={nextBytes:function(e){for(var t=0;t=0);var c=a.modPow(n,this);if(0!=c.compareTo(i.ONE)&&0!=c.compareTo(t)){for(var u=1;u++>24},i.prototype.shortValue=function(){return 0==this.t?this.s:this.data[0]<<16>>16},i.prototype.signum=function(){return this.s<0?-1:this.t<=0||1==this.t&&this.data[0]<=0?0:1},i.prototype.toByteArray=function(){var e=this.t,t=new Array;t[0]=this.s;var r,a=this.DB-e*this.DB%8,n=0;if(e-- >0)for(a>a)!=(this.s&this.DM)>>a&&(t[n++]=r|this.s<=0;)a<8?(r=(this.data[e]&(1<>(a+=this.DB-8)):(r=this.data[e]>>(a-=8)&255,a<=0&&(a+=this.DB,--e)),0!=(128&r)&&(r|=-256),0==n&&(128&this.s)!=(128&r)&&++n,(n>0||r!=this.s)&&(t[n++]=r);return t},i.prototype.equals=function(e){return 0==this.compareTo(e)},i.prototype.min=function(e){return this.compareTo(e)<0?this:e},i.prototype.max=function(e){return this.compareTo(e)>0?this:e},i.prototype.and=function(e){var t=s();return this.bitwiseTo(e,v,t),t},i.prototype.or=function(e){var t=s();return this.bitwiseTo(e,m,t),t},i.prototype.xor=function(e){var t=s();return this.bitwiseTo(e,C,t),t},i.prototype.andNot=function(e){var t=s();return this.bitwiseTo(e,E,t),t},i.prototype.not=function(){for(var e=s(),t=0;t=this.t?0!=this.s:0!=(this.data[t]&1<1){var p=s();for(a.sqrTo(o[1],p);c<=l;)o[c]=s(),a.mulTo(p,o[c-2],o[c]),c+=2}var f,v,m=e.t-1,C=!0,E=s();for(n=d(e.data[m])-1;m>=0;){for(n>=u?f=e.data[m]>>n-u&l:(f=(e.data[m]&(1<0&&(f|=e.data[m-1]>>this.DB+n-u)),c=r;0==(1&f);)f>>=1,--c;if((n-=c)<0&&(n+=this.DB,--m),C)o[f].copyTo(i),C=!1;else{for(;c>1;)a.sqrTo(i,E),a.sqrTo(E,i),c-=2;c>0?a.sqrTo(i,E):(v=i,i=E,E=v),a.mulTo(E,o[f],i)}for(;m>=0&&0==(e.data[m]&1<=0?(r.subTo(a,r),t&&n.subTo(o,n),s.subTo(c,s)):(a.subTo(r,a),t&&o.subTo(n,o),c.subTo(s,c))}return 0!=a.compareTo(i.ONE)?i.ZERO:c.compareTo(e)>=0?c.subtract(e):c.signum()<0?(c.addTo(e,c),c.signum()<0?c.add(e):c):c},i.prototype.pow=function(e){return this.exp(e,new I)},i.prototype.gcd=function(e){var t=this.s<0?this.negate():this.clone(),r=e.s<0?e.negate():e.clone();if(t.compareTo(r)<0){var a=t;t=r,r=a}var n=t.getLowestSetBit(),i=r.getLowestSetBit();if(i<0)return t;for(n0&&(t.rShiftTo(i,t),r.rShiftTo(i,r));t.signum()>0;)(n=t.getLowestSetBit())>0&&t.rShiftTo(n,t),(n=r.getLowestSetBit())>0&&r.rShiftTo(n,r),t.compareTo(r)>=0?(t.subTo(r,t),t.rShiftTo(1,t)):(r.subTo(t,r),r.rShiftTo(1,r));return i>0&&r.lShiftTo(i,r),r},i.prototype.isProbablePrime=function(e){var t,r=this.abs();if(1==r.t&&r.data[0]<=b[b.length-1]){for(t=0;t>>0,o>>>0];for(var c=n.fullMessageLength.length-1;c>=0;--c)n.fullMessageLength[c]+=o[1],o[1]=o[0]+(n.fullMessageLength[c]/4294967296>>>0),n.fullMessageLength[c]=n.fullMessageLength[c]>>>0,o[0]=o[1]/4294967296>>>0;return t.putBytes(i),l(e,r,t),(t.read>2048||0===t.length())&&t.compact(),n},n.digest=function(){var s=a.util.createBuffer();s.putBytes(t.bytes());var o=n.fullMessageLength[n.fullMessageLength.length-1]+n.messageLengthSize&n.blockLength-1;s.putBytes(i.substr(0,n.blockLength-o));for(var c,u=0,p=n.fullMessageLength.length-1;p>=0;--p)u=(c=8*n.fullMessageLength[p]+u)/4294967296>>>0,s.putInt32Le(c>>>0);var f={h0:e.h0,h1:e.h1,h2:e.h2,h3:e.h3};l(f,r,s);var h=a.util.createBuffer();return h.putInt32Le(f.h0),h.putInt32Le(f.h1),h.putInt32Le(f.h2),h.putInt32Le(f.h3),h},n};var i=null,s=null,o=null,c=null,u=!1;function l(e,t,r){for(var a,n,i,u,l,p,f,h=r.length();h>=64;){for(n=e.h0,i=e.h1,u=e.h2,l=e.h3,f=0;f<16;++f)t[f]=r.getInt32Le(),a=n+(l^i&(u^l))+c[f]+t[f],n=l,l=u,u=i,i+=a<<(p=o[f])|a>>>32-p;for(;f<32;++f)a=n+(u^l&(i^u))+c[f]+t[s[f]],n=l,l=u,u=i,i+=a<<(p=o[f])|a>>>32-p;for(;f<48;++f)a=n+(i^u^l)+c[f]+t[s[f]],n=l,l=u,u=i,i+=a<<(p=o[f])|a>>>32-p;for(;f<64;++f)a=n+(u^(i|~l))+c[f]+t[s[f]],n=l,l=u,u=i,i+=a<<(p=o[f])|a>>>32-p;e.h0=e.h0+n|0,e.h1=e.h1+i|0,e.h2=e.h2+u|0,e.h3=e.h3+l|0,h-=64}}},function(e,t,r){var a=r(0);r(8),r(4),r(1);var n,i=a.pkcs5=a.pkcs5||{};a.util.isNodejs&&!a.options.usePureJavaScript&&(n=r(16)),e.exports=a.pbkdf2=i.pbkdf2=function(e,t,r,i,s,o){if("function"==typeof s&&(o=s,s=null),a.util.isNodejs&&!a.options.usePureJavaScript&&n.pbkdf2&&(null===s||"object"!=typeof s)&&(n.pbkdf2Sync.length>4||!s||"sha1"===s))return"string"!=typeof s&&(s="sha1"),e=Buffer.from(e,"binary"),t=Buffer.from(t,"binary"),o?4===n.pbkdf2Sync.length?n.pbkdf2(e,t,r,i,(function(e,t){if(e)return o(e);o(null,t.toString("binary"))})):n.pbkdf2(e,t,r,i,s,(function(e,t){if(e)return o(e);o(null,t.toString("binary"))})):4===n.pbkdf2Sync.length?n.pbkdf2Sync(e,t,r,i).toString("binary"):n.pbkdf2Sync(e,t,r,i,s).toString("binary");if(null==s&&(s="sha1"),"string"==typeof s){if(!(s in a.md.algorithms))throw new Error("Unknown hash algorithm: "+s);s=a.md[s].create()}var c=s.digestLength;if(i>4294967295*c){var u=new Error("Derived key is too long.");if(o)return o(u);throw u}var l=Math.ceil(i/c),p=i-(l-1)*c,f=a.hmac.create();f.start(s,e);var h,d,y,g="";if(!o){for(var v=1;v<=l;++v){f.start(null,null),f.update(t),f.update(a.util.int32ToBytes(v)),h=y=f.digest().getBytes();for(var m=2;m<=r;++m)f.start(null,null),f.update(y),d=f.digest().getBytes(),h=a.util.xorBytes(h,d,c),y=d;g+=vl)return o(null,g);f.start(null,null),f.update(t),f.update(a.util.int32ToBytes(v)),h=y=f.digest().getBytes(),m=2,E()}function E(){if(m<=r)return f.start(null,null),f.update(y),d=f.digest().getBytes(),h=a.util.xorBytes(h,d,c),y=d,++m,a.util.setImmediate(E);g+=v128)throw new Error('Invalid "nsComment" content.');e.value=n.create(n.Class.UNIVERSAL,n.Type.IA5STRING,!1,e.comment)}else if("subjectKeyIdentifier"===e.name&&t.cert){var h=t.cert.generateSubjectKeyIdentifier();e.subjectKeyIdentifier=h.toHex(),e.value=n.create(n.Class.UNIVERSAL,n.Type.OCTETSTRING,!1,h.getBytes())}else if("authorityKeyIdentifier"===e.name&&t.cert){e.value=n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[]);l=e.value.value;if(e.keyIdentifier){var d=!0===e.keyIdentifier?t.cert.generateSubjectKeyIdentifier().getBytes():e.keyIdentifier;l.push(n.create(n.Class.CONTEXT_SPECIFIC,0,!1,d))}if(e.authorityCertIssuer){var y=[n.create(n.Class.CONTEXT_SPECIFIC,4,!0,[v(!0===e.authorityCertIssuer?t.cert.issuer:e.authorityCertIssuer)])];l.push(n.create(n.Class.CONTEXT_SPECIFIC,1,!0,y))}if(e.serialNumber){var g=a.util.hexToBytes(!0===e.serialNumber?t.cert.serialNumber:e.serialNumber);l.push(n.create(n.Class.CONTEXT_SPECIFIC,2,!1,g))}}else if("cRLDistributionPoints"===e.name){e.value=n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[]);l=e.value.value;var m,C=n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[]),E=n.create(n.Class.CONTEXT_SPECIFIC,0,!0,[]);for(f=0;f2)throw new Error("Cannot read notBefore/notAfter validity times; more than two times were provided in the certificate.");if(p.length<2)throw new Error("Cannot read notBefore/notAfter validity times; they were not provided as either UTCTime or GeneralizedTime.");if(c.validity.notBefore=p[0],c.validity.notAfter=p[1],c.tbsCertificate=r.tbsCertificate,t){c.md=y({signatureOid:c.signatureOid,type:"certificate"});var f=n.toDer(c.tbsCertificate);c.md.update(f.getBytes())}var g=a.md.sha1.create(),v=n.toDer(r.certIssuer);g.update(v.getBytes()),c.issuer.getField=function(e){return h(c.issuer,e)},c.issuer.addField=function(e){m([e]),c.issuer.attributes.push(e)},c.issuer.attributes=i.RDNAttributesAsArray(r.certIssuer),r.certIssuerUniqueId&&(c.issuer.uniqueId=r.certIssuerUniqueId),c.issuer.hash=g.digest().toHex();var C=a.md.sha1.create(),E=n.toDer(r.certSubject);return C.update(E.getBytes()),c.subject.getField=function(e){return h(c.subject,e)},c.subject.addField=function(e){m([e]),c.subject.attributes.push(e)},c.subject.attributes=i.RDNAttributesAsArray(r.certSubject),r.certSubjectUniqueId&&(c.subject.uniqueId=r.certSubjectUniqueId),c.subject.hash=C.digest().toHex(),r.certExtensions?c.extensions=i.certificateExtensionsFromAsn1(r.certExtensions):c.extensions=[],c.publicKey=i.publicKeyFromAsn1(r.subjectPublicKeyInfo),c},i.certificateExtensionsFromAsn1=function(e){for(var t=[],r=0;r1&&(r=c.value.charCodeAt(1),i=c.value.length>2?c.value.charCodeAt(2):0),t.digitalSignature=128==(128&r),t.nonRepudiation=64==(64&r),t.keyEncipherment=32==(32&r),t.dataEncipherment=16==(16&r),t.keyAgreement=8==(8&r),t.keyCertSign=4==(4&r),t.cRLSign=2==(2&r),t.encipherOnly=1==(1&r),t.decipherOnly=128==(128&i)}else if("basicConstraints"===t.name){(c=n.fromDer(t.value)).value.length>0&&c.value[0].type===n.Type.BOOLEAN?t.cA=0!==c.value[0].value.charCodeAt(0):t.cA=!1;var o=null;c.value.length>0&&c.value[0].type===n.Type.INTEGER?o=c.value[0].value:c.value.length>1&&(o=c.value[1].value),null!==o&&(t.pathLenConstraint=n.derToInteger(o))}else if("extKeyUsage"===t.name)for(var c=n.fromDer(t.value),u=0;u1&&(r=c.value.charCodeAt(1)),t.client=128==(128&r),t.server=64==(64&r),t.email=32==(32&r),t.objsign=16==(16&r),t.reserved=8==(8&r),t.sslCA=4==(4&r),t.emailCA=2==(2&r),t.objCA=1==(1&r)}else if("subjectAltName"===t.name||"issuerAltName"===t.name){var p;t.altNames=[];c=n.fromDer(t.value);for(var f=0;f=T&&e0&&s.value.push(i.certificateExtensionsToAsn1(e.extensions)),s},i.getCertificationRequestInfo=function(e){return n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[n.create(n.Class.UNIVERSAL,n.Type.INTEGER,!1,n.integerToDer(e.version).getBytes()),v(e.subject),i.publicKeyToAsn1(e.publicKey),S(e)])},i.distinguishedNameToAsn1=function(e){return v(e)},i.certificateToAsn1=function(e){var t=e.tbsCertificate||i.getTBSCertificate(e);return n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[t,n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[n.create(n.Class.UNIVERSAL,n.Type.OID,!1,n.oidToDer(e.signatureOid).getBytes()),E(e.signatureOid,e.signatureParameters)]),n.create(n.Class.UNIVERSAL,n.Type.BITSTRING,!1,String.fromCharCode(0)+e.signature)])},i.certificateExtensionsToAsn1=function(e){var t=n.create(n.Class.CONTEXT_SPECIFIC,3,!0,[]),r=n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[]);t.value.push(r);for(var a=0;al.validity.notAfter)&&(c={message:"Certificate is not valid yet or has expired.",error:i.certificateError.certificate_expired,notBefore:l.validity.notBefore,notAfter:l.validity.notAfter,now:s}),null===c){if(null===(p=t[0]||e.getIssuer(l))&&l.isIssuer(l)&&(f=!0,p=l),p){var h=p;a.util.isArray(h)||(h=[h]);for(var d=!1;!d&&h.length>0;){p=h.shift();try{d=p.verify(l)}catch(e){}}d||(c={message:"Certificate signature is invalid.",error:i.certificateError.bad_certificate})}null!==c||p&&!f||e.hasCertificate(l)||(c={message:"Certificate is not trusted.",error:i.certificateError.unknown_ca})}if(null===c&&p&&!l.isIssuer(p)&&(c={message:"Certificate issuer is invalid.",error:i.certificateError.bad_certificate}),null===c)for(var y={keyUsage:!0,basicConstraints:!0},g=0;null===c&&gm.pathLenConstraint&&(c={message:"Certificate basicConstraints pathLenConstraint violated.",error:i.certificateError.bad_certificate})}var E=null===c||c.error,S=r.verify?r.verify(E,u,n):E;if(!0!==S)throw!0===E&&(c={message:"The application rejected the certificate.",error:i.certificateError.bad_certificate}),(S||0===S)&&("object"!=typeof S||a.util.isArray(S)?"string"==typeof S&&(c.error=S):(S.message&&(c.message=S.message),S.error&&(c.error=S.error))),c;c=null,o=!1,++u}while(t.length>0);return!0}},function(e,t,r){var a=r(0);r(2),r(1),(e.exports=a.pss=a.pss||{}).create=function(e){3===arguments.length&&(e={md:arguments[0],mgf:arguments[1],saltLength:arguments[2]});var t,r=e.md,n=e.mgf,i=r.digestLength,s=e.salt||null;if("string"==typeof s&&(s=a.util.createBuffer(s)),"saltLength"in e)t=e.saltLength;else{if(null===s)throw new Error("Salt length not specified or specific salt not given.");t=s.length()}if(null!==s&&s.length()!==t)throw new Error("Given salt length does not match length of given salt.");var o=e.prng||a.random,c={encode:function(e,c){var u,l,p=c-1,f=Math.ceil(p/8),h=e.digest().getBytes();if(f>8*f-p&255;return(E=String.fromCharCode(E.charCodeAt(0)&~S)+E.substr(1))+y+String.fromCharCode(188)},verify:function(e,s,o){var c,u=o-1,l=Math.ceil(u/8);if(s=s.substr(-l),l>8*l-u&255;if(0!=(f.charCodeAt(0)&d))throw new Error("Bits beyond keysize not zero as expected.");var y=n.generate(h,p),g="";for(c=0;c4){var r=e;e=a.util.createBuffer();for(var n=0;n0))return!0;for(var a=0;a0))return!0;for(var a=0;a0)return!1;var r=e.length(),a=e.at(r-1);return!(a>this.blockSize<<2)&&(e.truncate(a),!0)},n.cbc=function(e){e=e||{},this.name="CBC",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)},n.cbc.prototype.start=function(e){if(null===e.iv){if(!this._prev)throw new Error("Invalid IV parameter.");this._iv=this._prev.slice(0)}else{if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=i(e.iv,this.blockSize),this._prev=this._iv.slice(0)}},n.cbc.prototype.encrypt=function(e,t,r){if(e.length()0))return!0;for(var a=0;a0))return!0;for(var a=0;a0)return!1;var r=e.length(),a=e.at(r-1);return!(a>this.blockSize<<2)&&(e.truncate(a),!0)},n.cfb=function(e){e=e||{},this.name="CFB",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialBlock=new Array(this._ints),this._partialOutput=a.util.createBuffer(),this._partialBytes=0},n.cfb.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=i(e.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},n.cfb.prototype.encrypt=function(e,t,r){var a=e.length();if(0===a)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&a>=this.blockSize)for(var n=0;n0&&(i=this.blockSize-i),this._partialOutput.clear();for(n=0;n0)e.read-=this.blockSize;else for(n=0;n0&&this._partialOutput.getBytes(this._partialBytes),i>0&&!r)return t.putBytes(this._partialOutput.getBytes(i-this._partialBytes)),this._partialBytes=i,!0;t.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=0}},n.cfb.prototype.decrypt=function(e,t,r){var a=e.length();if(0===a)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&a>=this.blockSize)for(var n=0;n0&&(i=this.blockSize-i),this._partialOutput.clear();for(n=0;n0)e.read-=this.blockSize;else for(n=0;n0&&this._partialOutput.getBytes(this._partialBytes),i>0&&!r)return t.putBytes(this._partialOutput.getBytes(i-this._partialBytes)),this._partialBytes=i,!0;t.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=0}},n.ofb=function(e){e=e||{},this.name="OFB",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=a.util.createBuffer(),this._partialBytes=0},n.ofb.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=i(e.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},n.ofb.prototype.encrypt=function(e,t,r){var a=e.length();if(0===e.length())return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&a>=this.blockSize)for(var n=0;n0&&(i=this.blockSize-i),this._partialOutput.clear();for(n=0;n0)e.read-=this.blockSize;else for(n=0;n0&&this._partialOutput.getBytes(this._partialBytes),i>0&&!r)return t.putBytes(this._partialOutput.getBytes(i-this._partialBytes)),this._partialBytes=i,!0;t.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=0}},n.ofb.prototype.decrypt=n.ofb.prototype.encrypt,n.ctr=function(e){e=e||{},this.name="CTR",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=a.util.createBuffer(),this._partialBytes=0},n.ctr.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=i(e.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},n.ctr.prototype.encrypt=function(e,t,r){var a=e.length();if(0===a)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&a>=this.blockSize)for(var n=0;n0&&(i=this.blockSize-i),this._partialOutput.clear();for(n=0;n0&&(e.read-=this.blockSize),this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),i>0&&!r)return t.putBytes(this._partialOutput.getBytes(i-this._partialBytes)),this._partialBytes=i,!0;t.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=0}s(this._inBlock)},n.ctr.prototype.decrypt=n.ctr.prototype.encrypt,n.gcm=function(e){e=e||{},this.name="GCM",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints),this._partialOutput=a.util.createBuffer(),this._partialBytes=0,this._R=3774873600},n.gcm.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");var t,r=a.util.createBuffer(e.iv);if(this._cipherLength=0,t="additionalData"in e?a.util.createBuffer(e.additionalData):a.util.createBuffer(),this._tagLength="tagLength"in e?e.tagLength:128,this._tag=null,e.decrypt&&(this._tag=a.util.createBuffer(e.tag).getBytes(),this._tag.length!==this._tagLength/8))throw new Error("Authentication tag does not match tag length.");this._hashBlock=new Array(this._ints),this.tag=null,this._hashSubkey=new Array(this._ints),this.cipher.encrypt([0,0,0,0],this._hashSubkey),this.componentBits=4,this._m=this.generateHashTable(this._hashSubkey,this.componentBits);var n=r.length();if(12===n)this._j0=[r.getInt32(),r.getInt32(),r.getInt32(),1];else{for(this._j0=[0,0,0,0];r.length()>0;)this._j0=this.ghash(this._hashSubkey,this._j0,[r.getInt32(),r.getInt32(),r.getInt32(),r.getInt32()]);this._j0=this.ghash(this._hashSubkey,this._j0,[0,0].concat(o(8*n)))}this._inBlock=this._j0.slice(0),s(this._inBlock),this._partialBytes=0,t=a.util.createBuffer(t),this._aDataLength=o(8*t.length());var i=t.length()%this.blockSize;for(i&&t.fillWithByte(0,this.blockSize-i),this._s=[0,0,0,0];t.length()>0;)this._s=this.ghash(this._hashSubkey,this._s,[t.getInt32(),t.getInt32(),t.getInt32(),t.getInt32()])},n.gcm.prototype.encrypt=function(e,t,r){var a=e.length();if(0===a)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&a>=this.blockSize){for(var n=0;n0&&(i=this.blockSize-i),this._partialOutput.clear();for(n=0;n0&&this._partialOutput.getBytes(this._partialBytes),i>0&&!r)return e.read-=this.blockSize,t.putBytes(this._partialOutput.getBytes(i-this._partialBytes)),this._partialBytes=i,!0;t.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=0}this._s=this.ghash(this._hashSubkey,this._s,this._outBlock),s(this._inBlock)},n.gcm.prototype.decrypt=function(e,t,r){var a=e.length();if(a0))return!0;this.cipher.encrypt(this._inBlock,this._outBlock),s(this._inBlock),this._hashBlock[0]=e.getInt32(),this._hashBlock[1]=e.getInt32(),this._hashBlock[2]=e.getInt32(),this._hashBlock[3]=e.getInt32(),this._s=this.ghash(this._hashSubkey,this._s,this._hashBlock);for(var n=0;n0;--a)t[a]=e[a]>>>1|(1&e[a-1])<<31;t[0]=e[0]>>>1,r&&(t[0]^=this._R)},n.gcm.prototype.tableMultiply=function(e){for(var t=[0,0,0,0],r=0;r<32;++r){var a=e[r/8|0]>>>4*(7-r%8)&15,n=this._m[r][a];t[0]^=n[0],t[1]^=n[1],t[2]^=n[2],t[3]^=n[3]}return t},n.gcm.prototype.ghash=function(e,t,r){return t[0]^=r[0],t[1]^=r[1],t[2]^=r[2],t[3]^=r[3],this.tableMultiply(t)},n.gcm.prototype.generateHashTable=function(e,t){for(var r=8/t,a=4*r,n=16*r,i=new Array(n),s=0;s>>1,n=new Array(r);n[a]=e.slice(0);for(var i=a>>>1;i>0;)this.pow(n[2*i],n[i]=[]),i>>=1;for(i=2;i>1,o=s+(1&e.length),c=e.substr(0,o),u=e.substr(s,o),l=a.util.createBuffer(),p=a.hmac.create();r=t+r;var f=Math.ceil(n/16),h=Math.ceil(n/20);p.start("MD5",c);var d=a.util.createBuffer();l.putBytes(r);for(var y=0;y0&&(u.queue(e,u.createAlert(e,{level:u.Alert.Level.warning,description:u.Alert.Description.no_renegotiation})),u.flush(e)),e.process()},u.parseHelloMessage=function(e,t,r){var n=null,i=e.entity===u.ConnectionEnd.client;if(r<38)e.error(e,{message:i?"Invalid ServerHello message. Message too short.":"Invalid ClientHello message. Message too short.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.illegal_parameter}});else{var s=t.fragment,c=s.length();if(n={version:{major:s.getByte(),minor:s.getByte()},random:a.util.createBuffer(s.getBytes(32)),session_id:o(s,1),extensions:[]},i?(n.cipher_suite=s.getBytes(2),n.compression_method=s.getByte()):(n.cipher_suites=o(s,2),n.compression_methods=o(s,1)),(c=r-(c-s.length()))>0){for(var l=o(s,2);l.length()>0;)n.extensions.push({type:[l.getByte(),l.getByte()],data:o(l,2)});if(!i)for(var p=0;p0;){if(0!==h.getByte())break;e.session.extensions.server_name.serverNameList.push(o(h,2).getBytes())}}}if(e.session.version&&(n.version.major!==e.session.version.major||n.version.minor!==e.session.version.minor))return e.error(e,{message:"TLS version change is disallowed during renegotiation.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.protocol_version}});if(i)e.session.cipherSuite=u.getCipherSuite(n.cipher_suite);else for(var d=a.util.createBuffer(n.cipher_suites.bytes());d.length()>0&&(e.session.cipherSuite=u.getCipherSuite(d.getBytes(2)),null===e.session.cipherSuite););if(null===e.session.cipherSuite)return e.error(e,{message:"No cipher suites in common.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.handshake_failure},cipherSuite:a.util.bytesToHex(n.cipher_suite)});e.session.compressionMethod=i?n.compression_method:u.CompressionMethod.none}return n},u.createSecurityParameters=function(e,t){var r=e.entity===u.ConnectionEnd.client,a=t.random.bytes(),n=r?e.session.sp.client_random:a,i=r?a:u.createRandom().getBytes();e.session.sp={entity:e.entity,prf_algorithm:u.PRFAlgorithm.tls_prf_sha256,bulk_cipher_algorithm:null,cipher_type:null,enc_key_length:null,block_length:null,fixed_iv_length:null,record_iv_length:null,mac_algorithm:null,mac_length:null,mac_key_length:null,compression_algorithm:e.session.compressionMethod,pre_master_secret:null,master_secret:null,client_random:n,server_random:i}},u.handleServerHello=function(e,t,r){var a=u.parseHelloMessage(e,t,r);if(!e.fail){if(!(a.version.minor<=e.version.minor))return e.error(e,{message:"Incompatible TLS version.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.protocol_version}});e.version.minor=a.version.minor,e.session.version=e.version;var n=a.session_id.bytes();n.length>0&&n===e.session.id?(e.expect=d,e.session.resuming=!0,e.session.sp.server_random=a.random.bytes()):(e.expect=l,e.session.resuming=!1,u.createSecurityParameters(e,a)),e.session.id=n,e.process()}},u.handleClientHello=function(e,t,r){var n=u.parseHelloMessage(e,t,r);if(!e.fail){var i=n.session_id.bytes(),s=null;if(e.sessionCache&&(null===(s=e.sessionCache.getSession(i))?i="":(s.version.major!==n.version.major||s.version.minor>n.version.minor)&&(s=null,i="")),0===i.length&&(i=a.random.getBytes(32)),e.session.id=i,e.session.clientHelloVersion=n.version,e.session.sp={},s)e.version=e.session.version=s.version,e.session.sp=s.sp;else{for(var o,c=1;c0;)n=o(c.certificate_list,3),i=a.asn1.fromDer(n),n=a.pki.certificateFromAsn1(i,!0),l.push(n)}catch(t){return e.error(e,{message:"Could not parse certificate list.",cause:t,send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.bad_certificate}})}var f=e.entity===u.ConnectionEnd.client;!f&&!0!==e.verifyClient||0!==l.length?0===l.length?e.expect=f?p:C:(f?e.session.serverCertificate=l[0]:e.session.clientCertificate=l[0],u.verifyCertificateChain(e,l)&&(e.expect=f?p:C)):e.error(e,{message:f?"No server certificate provided.":"No client certificate provided.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.illegal_parameter}}),e.process()},u.handleServerKeyExchange=function(e,t,r){if(r>0)return e.error(e,{message:"Invalid key parameters. Only RSA is supported.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.unsupported_certificate}});e.expect=f,e.process()},u.handleClientKeyExchange=function(e,t,r){if(r<48)return e.error(e,{message:"Invalid key parameters. Only RSA is supported.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.unsupported_certificate}});var n=t.fragment,i={enc_pre_master_secret:o(n,2).getBytes()},s=null;if(e.getPrivateKey)try{s=e.getPrivateKey(e,e.session.serverCertificate),s=a.pki.privateKeyFromPem(s)}catch(t){e.error(e,{message:"Could not get private key.",cause:t,send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.internal_error}})}if(null===s)return e.error(e,{message:"No private key set.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.internal_error}});try{var c=e.session.sp;c.pre_master_secret=s.decrypt(i.enc_pre_master_secret);var l=e.session.clientHelloVersion;if(l.major!==c.pre_master_secret.charCodeAt(0)||l.minor!==c.pre_master_secret.charCodeAt(1))throw new Error("TLS version rollback attack detected.")}catch(e){c.pre_master_secret=a.random.getBytes(48)}e.expect=S,null!==e.session.clientCertificate&&(e.expect=E),e.process()},u.handleCertificateRequest=function(e,t,r){if(r<3)return e.error(e,{message:"Invalid CertificateRequest. Message too short.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.illegal_parameter}});var a=t.fragment,n={certificate_types:o(a,1),certificate_authorities:o(a,2)};e.session.certificateRequest=n,e.expect=h,e.process()},u.handleCertificateVerify=function(e,t,r){if(r<2)return e.error(e,{message:"Invalid CertificateVerify. Message too short.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.illegal_parameter}});var n=t.fragment;n.read-=4;var i=n.bytes();n.read+=4;var s={signature:o(n,2).getBytes()},c=a.util.createBuffer();c.putBuffer(e.session.md5.digest()),c.putBuffer(e.session.sha1.digest()),c=c.getBytes();try{if(!e.session.clientCertificate.publicKey.verify(c,s.signature,"NONE"))throw new Error("CertificateVerify signature does not match.");e.session.md5.update(i),e.session.sha1.update(i)}catch(t){return e.error(e,{message:"Bad signature in CertificateVerify.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.handshake_failure}})}e.expect=S,e.process()},u.handleServerHelloDone=function(e,t,r){if(r>0)return e.error(e,{message:"Invalid ServerHelloDone message. Invalid length.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.record_overflow}});if(null===e.serverCertificate){var n={message:"No server certificate provided. Not enough security.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.insufficient_security}},i=e.verify(e,n.alert.description,0,[]);if(!0!==i)return(i||0===i)&&("object"!=typeof i||a.util.isArray(i)?"number"==typeof i&&(n.alert.description=i):(i.message&&(n.message=i.message),i.alert&&(n.alert.description=i.alert))),e.error(e,n)}null!==e.session.certificateRequest&&(t=u.createRecord(e,{type:u.ContentType.handshake,data:u.createCertificate(e)}),u.queue(e,t)),t=u.createRecord(e,{type:u.ContentType.handshake,data:u.createClientKeyExchange(e)}),u.queue(e,t),e.expect=v;var s=function(e,t){null!==e.session.certificateRequest&&null!==e.session.clientCertificate&&u.queue(e,u.createRecord(e,{type:u.ContentType.handshake,data:u.createCertificateVerify(e,t)})),u.queue(e,u.createRecord(e,{type:u.ContentType.change_cipher_spec,data:u.createChangeCipherSpec()})),e.state.pending=u.createConnectionState(e),e.state.current.write=e.state.pending.write,u.queue(e,u.createRecord(e,{type:u.ContentType.handshake,data:u.createFinished(e)})),e.expect=d,u.flush(e),e.process()};if(null===e.session.certificateRequest||null===e.session.clientCertificate)return s(e,null);u.getClientSignature(e,s)},u.handleChangeCipherSpec=function(e,t){if(1!==t.fragment.getByte())return e.error(e,{message:"Invalid ChangeCipherSpec message received.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.illegal_parameter}});var r=e.entity===u.ConnectionEnd.client;(e.session.resuming&&r||!e.session.resuming&&!r)&&(e.state.pending=u.createConnectionState(e)),e.state.current.read=e.state.pending.read,(!e.session.resuming&&r||e.session.resuming&&!r)&&(e.state.pending=null),e.expect=r?y:T,e.process()},u.handleFinished=function(e,t,r){var i=t.fragment;i.read-=4;var s=i.bytes();i.read+=4;var o=t.fragment.getBytes();(i=a.util.createBuffer()).putBuffer(e.session.md5.digest()),i.putBuffer(e.session.sha1.digest());var c=e.entity===u.ConnectionEnd.client,l=c?"server finished":"client finished",p=e.session.sp;if((i=n(p.master_secret,l,i.getBytes(),12)).getBytes()!==o)return e.error(e,{message:"Invalid verify_data in Finished message.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.decrypt_error}});e.session.md5.update(s),e.session.sha1.update(s),(e.session.resuming&&c||!e.session.resuming&&!c)&&(u.queue(e,u.createRecord(e,{type:u.ContentType.change_cipher_spec,data:u.createChangeCipherSpec()})),e.state.current.write=e.state.pending.write,e.state.pending=null,u.queue(e,u.createRecord(e,{type:u.ContentType.handshake,data:u.createFinished(e)}))),e.expect=c?g:I,e.handshaking=!1,++e.handshakes,e.peerCertificate=c?e.session.serverCertificate:e.session.clientCertificate,u.flush(e),e.isConnected=!0,e.connected(e),e.process()},u.handleAlert=function(e,t){var r,a=t.fragment,n={level:a.getByte(),description:a.getByte()};switch(n.description){case u.Alert.Description.close_notify:r="Connection closed.";break;case u.Alert.Description.unexpected_message:r="Unexpected message.";break;case u.Alert.Description.bad_record_mac:r="Bad record MAC.";break;case u.Alert.Description.decryption_failed:r="Decryption failed.";break;case u.Alert.Description.record_overflow:r="Record overflow.";break;case u.Alert.Description.decompression_failure:r="Decompression failed.";break;case u.Alert.Description.handshake_failure:r="Handshake failure.";break;case u.Alert.Description.bad_certificate:r="Bad certificate.";break;case u.Alert.Description.unsupported_certificate:r="Unsupported certificate.";break;case u.Alert.Description.certificate_revoked:r="Certificate revoked.";break;case u.Alert.Description.certificate_expired:r="Certificate expired.";break;case u.Alert.Description.certificate_unknown:r="Certificate unknown.";break;case u.Alert.Description.illegal_parameter:r="Illegal parameter.";break;case u.Alert.Description.unknown_ca:r="Unknown certificate authority.";break;case u.Alert.Description.access_denied:r="Access denied.";break;case u.Alert.Description.decode_error:r="Decode error.";break;case u.Alert.Description.decrypt_error:r="Decrypt error.";break;case u.Alert.Description.export_restriction:r="Export restriction.";break;case u.Alert.Description.protocol_version:r="Unsupported protocol version.";break;case u.Alert.Description.insufficient_security:r="Insufficient security.";break;case u.Alert.Description.internal_error:r="Internal error.";break;case u.Alert.Description.user_canceled:r="User canceled.";break;case u.Alert.Description.no_renegotiation:r="Renegotiation not supported.";break;default:r="Unknown error."}if(n.description===u.Alert.Description.close_notify)return e.close();e.error(e,{message:r,send:!1,origin:e.entity===u.ConnectionEnd.client?"server":"client",alert:n}),e.process()},u.handleHandshake=function(e,t){var r=t.fragment,n=r.getByte(),i=r.getInt24();if(i>r.length())return e.fragmented=t,t.fragment=a.util.createBuffer(),r.read-=4,e.process();e.fragmented=null,r.read-=4;var s=r.bytes(i+4);r.read+=4,n in K[e.entity][e.expect]?(e.entity!==u.ConnectionEnd.server||e.open||e.fail||(e.handshaking=!0,e.session={version:null,extensions:{server_name:{serverNameList:[]}},cipherSuite:null,compressionMethod:null,serverCertificate:null,clientCertificate:null,md5:a.md.md5.create(),sha1:a.md.sha1.create()}),n!==u.HandshakeType.hello_request&&n!==u.HandshakeType.certificate_verify&&n!==u.HandshakeType.finished&&(e.session.md5.update(s),e.session.sha1.update(s)),K[e.entity][e.expect][n](e,t,i)):u.handleUnexpected(e,t)},u.handleApplicationData=function(e,t){e.data.putBuffer(t.fragment),e.dataReady(e),e.process()},u.handleHeartbeat=function(e,t){var r=t.fragment,n=r.getByte(),i=r.getInt16(),s=r.getBytes(i);if(n===u.HeartbeatMessageType.heartbeat_request){if(e.handshaking||i>s.length)return e.process();u.queue(e,u.createRecord(e,{type:u.ContentType.heartbeat,data:u.createHeartbeat(u.HeartbeatMessageType.heartbeat_response,s)})),u.flush(e)}else if(n===u.HeartbeatMessageType.heartbeat_response){if(s!==e.expectedHeartbeatPayload)return e.process();e.heartbeatReceived&&e.heartbeatReceived(e,a.util.createBuffer(s))}e.process()};var l=1,p=2,f=3,h=4,d=5,y=6,g=7,v=8,m=1,C=2,E=3,S=4,T=5,I=6,A=u.handleUnexpected,B=u.handleChangeCipherSpec,b=u.handleAlert,N=u.handleHandshake,R=u.handleApplicationData,w=u.handleHeartbeat,_=[];_[u.ConnectionEnd.client]=[[A,b,N,A,w],[A,b,N,A,w],[A,b,N,A,w],[A,b,N,A,w],[A,b,N,A,w],[B,b,A,A,w],[A,b,N,A,w],[A,b,N,R,w],[A,b,N,A,w]],_[u.ConnectionEnd.server]=[[A,b,N,A,w],[A,b,N,A,w],[A,b,N,A,w],[A,b,N,A,w],[B,b,A,A,w],[A,b,N,A,w],[A,b,N,R,w],[A,b,N,A,w]];var L=u.handleHelloRequest,k=u.handleServerHello,U=u.handleCertificate,D=u.handleServerKeyExchange,P=u.handleCertificateRequest,V=u.handleServerHelloDone,O=u.handleFinished,K=[];K[u.ConnectionEnd.client]=[[A,A,k,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A],[L,A,A,A,A,A,A,A,A,A,A,U,D,P,V,A,A,A,A,A,A],[L,A,A,A,A,A,A,A,A,A,A,A,D,P,V,A,A,A,A,A,A],[L,A,A,A,A,A,A,A,A,A,A,A,A,P,V,A,A,A,A,A,A],[L,A,A,A,A,A,A,A,A,A,A,A,A,A,V,A,A,A,A,A,A],[L,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A],[L,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,O],[L,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A],[L,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A]];var x=u.handleClientHello,M=u.handleClientKeyExchange,F=u.handleCertificateVerify;K[u.ConnectionEnd.server]=[[A,x,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A],[A,A,A,A,A,A,A,A,A,A,A,U,A,A,A,A,A,A,A,A,A],[A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,M,A,A,A,A],[A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,F,A,A,A,A,A],[A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A],[A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,O],[A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A],[A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A]],u.generateKeys=function(e,t){var r=n,a=t.client_random+t.server_random;e.session.resuming||(t.master_secret=r(t.pre_master_secret,"master secret",a,48).bytes(),t.pre_master_secret=null),a=t.server_random+t.client_random;var i=2*t.mac_key_length+2*t.enc_key_length,s=e.version.major===u.Versions.TLS_1_0.major&&e.version.minor===u.Versions.TLS_1_0.minor;s&&(i+=2*t.fixed_iv_length);var o=r(t.master_secret,"key expansion",a,i),c={client_write_MAC_key:o.getBytes(t.mac_key_length),server_write_MAC_key:o.getBytes(t.mac_key_length),client_write_key:o.getBytes(t.enc_key_length),server_write_key:o.getBytes(t.enc_key_length)};return s&&(c.client_write_IV=o.getBytes(t.fixed_iv_length),c.server_write_IV=o.getBytes(t.fixed_iv_length)),c},u.createConnectionState=function(e){var t=e.entity===u.ConnectionEnd.client,r=function(){var e={sequenceNumber:[0,0],macKey:null,macLength:0,macFunction:null,cipherState:null,cipherFunction:function(e){return!0},compressionState:null,compressFunction:function(e){return!0},updateSequenceNumber:function(){4294967295===e.sequenceNumber[1]?(e.sequenceNumber[1]=0,++e.sequenceNumber[0]):++e.sequenceNumber[1]}};return e},a={read:r(),write:r()};if(a.read.update=function(e,t){return a.read.cipherFunction(t,a.read)?a.read.compressFunction(e,t,a.read)||e.error(e,{message:"Could not decompress record.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.decompression_failure}}):e.error(e,{message:"Could not decrypt record or bad MAC.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.bad_record_mac}}),!e.fail},a.write.update=function(e,t){return a.write.compressFunction(e,t,a.write)?a.write.cipherFunction(t,a.write)||e.error(e,{message:"Could not encrypt record.",send:!1,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.internal_error}}):e.error(e,{message:"Could not compress record.",send:!1,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.internal_error}}),!e.fail},e.session){var n=e.session.sp;switch(e.session.cipherSuite.initSecurityParameters(n),n.keys=u.generateKeys(e,n),a.read.macKey=t?n.keys.server_write_MAC_key:n.keys.client_write_MAC_key,a.write.macKey=t?n.keys.client_write_MAC_key:n.keys.server_write_MAC_key,e.session.cipherSuite.initConnectionState(a,e,n),n.compression_algorithm){case u.CompressionMethod.none:break;case u.CompressionMethod.deflate:a.read.compressFunction=s,a.write.compressFunction=i;break;default:throw new Error("Unsupported compression algorithm.")}}return a},u.createRandom=function(){var e=new Date,t=+e+6e4*e.getTimezoneOffset(),r=a.util.createBuffer();return r.putInt32(t),r.putBytes(a.random.getBytes(28)),r},u.createRecord=function(e,t){return t.data?{type:t.type,version:{major:e.version.major,minor:e.version.minor},length:t.data.length(),fragment:t.data}:null},u.createAlert=function(e,t){var r=a.util.createBuffer();return r.putByte(t.level),r.putByte(t.description),u.createRecord(e,{type:u.ContentType.alert,data:r})},u.createClientHello=function(e){e.session.clientHelloVersion={major:e.version.major,minor:e.version.minor};for(var t=a.util.createBuffer(),r=0;r0&&(d+=2);var y=e.session.id,g=y.length+1+2+4+28+2+i+1+o+d,v=a.util.createBuffer();return v.putByte(u.HandshakeType.client_hello),v.putInt24(g),v.putByte(e.version.major),v.putByte(e.version.minor),v.putBytes(e.session.sp.client_random),c(v,1,a.util.createBuffer(y)),c(v,2,t),c(v,1,s),d>0&&c(v,2,l),v},u.createServerHello=function(e){var t=e.session.id,r=t.length+1+2+4+28+2+1,n=a.util.createBuffer();return n.putByte(u.HandshakeType.server_hello),n.putInt24(r),n.putByte(e.version.major),n.putByte(e.version.minor),n.putBytes(e.session.sp.server_random),c(n,1,a.util.createBuffer(t)),n.putByte(e.session.cipherSuite.id[0]),n.putByte(e.session.cipherSuite.id[1]),n.putByte(e.session.compressionMethod),n},u.createCertificate=function(e){var t,r=e.entity===u.ConnectionEnd.client,n=null;e.getCertificate&&(t=r?e.session.certificateRequest:e.session.extensions.server_name.serverNameList,n=e.getCertificate(e,t));var i=a.util.createBuffer();if(null!==n)try{a.util.isArray(n)||(n=[n]);for(var s=null,o=0;ou.MaxFragment;)n.push(u.createRecord(e,{type:t.type,data:a.util.createBuffer(i.slice(0,u.MaxFragment))})),i=i.slice(u.MaxFragment);i.length>0&&n.push(u.createRecord(e,{type:t.type,data:a.util.createBuffer(i)}))}for(var s=0;s0&&(n=r.order[0]),null!==n&&n in r.cache)for(var i in t=r.cache[n],delete r.cache[n],r.order)if(r.order[i]===n){r.order.splice(i,1);break}return t},r.setSession=function(e,t){if(r.order.length===r.capacity){var n=r.order.shift();delete r.cache[n]}n=a.util.bytesToHex(e);r.order.push(n),r.cache[n]=t}}return r},u.createConnection=function(e){var t=null;t=e.caStore?a.util.isArray(e.caStore)?a.pki.createCaStore(e.caStore):e.caStore:a.pki.createCaStore();var r=e.cipherSuites||null;if(null===r)for(var n in r=[],u.CipherSuites)r.push(u.CipherSuites[n]);var i=e.server?u.ConnectionEnd.server:u.ConnectionEnd.client,s=e.sessionCache?u.createSessionCache(e.sessionCache):null,o={version:{major:u.Version.major,minor:u.Version.minor},entity:i,sessionId:e.sessionId,caStore:t,sessionCache:s,cipherSuites:r,connected:e.connected,virtualHost:e.virtualHost||null,verifyClient:e.verifyClient||!1,verify:e.verify||function(e,t,r,a){return t},verifyOptions:e.verifyOptions||{},getCertificate:e.getCertificate||null,getPrivateKey:e.getPrivateKey||null,getSignature:e.getSignature||null,input:a.util.createBuffer(),tlsData:a.util.createBuffer(),data:a.util.createBuffer(),tlsDataReady:e.tlsDataReady,dataReady:e.dataReady,heartbeatReceived:e.heartbeatReceived,closed:e.closed,error:function(t,r){r.origin=r.origin||(t.entity===u.ConnectionEnd.client?"client":"server"),r.send&&(u.queue(t,u.createAlert(t,r.alert)),u.flush(t));var a=!1!==r.fatal;a&&(t.fail=!0),e.error(t,r),a&&t.close(!1)},deflate:e.deflate||null,inflate:e.inflate||null,reset:function(e){o.version={major:u.Version.major,minor:u.Version.minor},o.record=null,o.session=null,o.peerCertificate=null,o.state={pending:null,current:null},o.expect=(o.entity,u.ConnectionEnd.client,0),o.fragmented=null,o.records=[],o.open=!1,o.handshakes=0,o.handshaking=!1,o.isConnected=!1,o.fail=!(e||void 0===e),o.input.clear(),o.tlsData.clear(),o.data.clear(),o.state.current=u.createConnectionState(o)}};o.reset();return o.handshake=function(e){if(o.entity!==u.ConnectionEnd.client)o.error(o,{message:"Cannot initiate handshake as a server.",fatal:!1});else if(o.handshaking)o.error(o,{message:"Handshake already in progress.",fatal:!1});else{o.fail&&!o.open&&0===o.handshakes&&(o.fail=!1),o.handshaking=!0;var t=null;(e=e||"").length>0&&(o.sessionCache&&(t=o.sessionCache.getSession(e)),null===t&&(e="")),0===e.length&&o.sessionCache&&null!==(t=o.sessionCache.getSession())&&(e=t.id),o.session={id:e,version:null,cipherSuite:null,compressionMethod:null,serverCertificate:null,certificateRequest:null,clientCertificate:null,sp:{},md5:a.md.md5.create(),sha1:a.md.sha1.create()},t&&(o.version=t.version,o.session.sp=t.sp),o.session.sp.client_random=u.createRandom().getBytes(),o.open=!0,u.queue(o,u.createRecord(o,{type:u.ContentType.handshake,data:u.createClientHello(o)})),u.flush(o)}},o.process=function(e){var t=0;return e&&o.input.putBytes(e),o.fail||(null!==o.record&&o.record.ready&&o.record.fragment.isEmpty()&&(o.record=null),null===o.record&&(t=function(e){var t=0,r=e.input,n=r.length();if(n<5)t=5-n;else{e.record={type:r.getByte(),version:{major:r.getByte(),minor:r.getByte()},length:r.getInt16(),fragment:a.util.createBuffer(),ready:!1};var i=e.record.version.major===e.version.major;i&&e.session&&e.session.version&&(i=e.record.version.minor===e.version.minor),i||e.error(e,{message:"Incompatible TLS version.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.protocol_version}})}return t}(o)),o.fail||null===o.record||o.record.ready||(t=function(e){var t=0,r=e.input,a=r.length();a=0;c--)w>>=8,w+=B.at(c)+R.at(c),R.setAt(c,255&w);N.putBuffer(R)}E=N,p.putBuffer(I)}return p.truncate(p.length()-i),p},s.pbe.getCipher=function(e,t,r){switch(e){case s.oids.pkcs5PBES2:return s.pbe.getCipherForPBES2(e,t,r);case s.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:case s.oids["pbewithSHAAnd40BitRC2-CBC"]:return s.pbe.getCipherForPKCS12PBE(e,t,r);default:var a=new Error("Cannot read encrypted PBE data block. Unsupported OID.");throw a.oid=e,a.supportedOids=["pkcs5PBES2","pbeWithSHAAnd3-KeyTripleDES-CBC","pbewithSHAAnd40BitRC2-CBC"],a}},s.pbe.getCipherForPBES2=function(e,t,r){var n,o={},c=[];if(!i.validate(t,u,o,c))throw(n=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.")).errors=c,n;if((e=i.derToOid(o.kdfOid))!==s.oids.pkcs5PBKDF2)throw(n=new Error("Cannot read encrypted private key. Unsupported key derivation function OID.")).oid=e,n.supportedOids=["pkcs5PBKDF2"],n;if((e=i.derToOid(o.encOid))!==s.oids["aes128-CBC"]&&e!==s.oids["aes192-CBC"]&&e!==s.oids["aes256-CBC"]&&e!==s.oids["des-EDE3-CBC"]&&e!==s.oids.desCBC)throw(n=new Error("Cannot read encrypted private key. Unsupported encryption scheme OID.")).oid=e,n.supportedOids=["aes128-CBC","aes192-CBC","aes256-CBC","des-EDE3-CBC","desCBC"],n;var l,p,h=o.kdfSalt,d=a.util.createBuffer(o.kdfIterationCount);switch(d=d.getInt(d.length()<<3),s.oids[e]){case"aes128-CBC":l=16,p=a.aes.createDecryptionCipher;break;case"aes192-CBC":l=24,p=a.aes.createDecryptionCipher;break;case"aes256-CBC":l=32,p=a.aes.createDecryptionCipher;break;case"des-EDE3-CBC":l=24,p=a.des.createDecryptionCipher;break;case"desCBC":l=8,p=a.des.createDecryptionCipher}var y=f(o.prfOid),g=a.pkcs5.pbkdf2(r,h,d,l,y),v=o.encIv,m=p(g);return m.start(v),m},s.pbe.getCipherForPKCS12PBE=function(e,t,r){var n={},o=[];if(!i.validate(t,l,n,o))throw(y=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.")).errors=o,y;var c,u,p,h=a.util.createBuffer(n.salt),d=a.util.createBuffer(n.iterations);switch(d=d.getInt(d.length()<<3),e){case s.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:c=24,u=8,p=a.des.startDecrypting;break;case s.oids["pbewithSHAAnd40BitRC2-CBC"]:c=5,u=8,p=function(e,t){var r=a.rc2.createDecryptionCipher(e,40);return r.start(t,null),r};break;default:var y;throw(y=new Error("Cannot read PKCS #12 PBE data block. Unsupported OID.")).oid=e,y}var g=f(n.prfOid),v=s.pbe.generatePkcs12Key(r,h,1,d,c,g);return g.start(),p(v,s.pbe.generatePkcs12Key(r,h,2,d,u,g))},s.pbe.opensslDeriveBytes=function(e,t,r,n){if(null==n){if(!("md5"in a.md))throw new Error('"md5" hash algorithm unavailable.');n=a.md.md5.create()}null===t&&(t="");for(var i=[p(n,e+t)],s=16,o=1;s>>0,o>>>0];for(var u=n.fullMessageLength.length-1;u>=0;--u)n.fullMessageLength[u]+=o[1],o[1]=o[0]+(n.fullMessageLength[u]/4294967296>>>0),n.fullMessageLength[u]=n.fullMessageLength[u]>>>0,o[0]=o[1]/4294967296>>>0;return t.putBytes(i),c(e,r,t),(t.read>2048||0===t.length())&&t.compact(),n},n.digest=function(){var s=a.util.createBuffer();s.putBytes(t.bytes());var o,u=n.fullMessageLength[n.fullMessageLength.length-1]+n.messageLengthSize&n.blockLength-1;s.putBytes(i.substr(0,n.blockLength-u));for(var l=8*n.fullMessageLength[0],p=0;p>>0,s.putInt32(l>>>0),l=o>>>0;s.putInt32(l);var f={h0:e.h0,h1:e.h1,h2:e.h2,h3:e.h3,h4:e.h4,h5:e.h5,h6:e.h6,h7:e.h7};c(f,r,s);var h=a.util.createBuffer();return h.putInt32(f.h0),h.putInt32(f.h1),h.putInt32(f.h2),h.putInt32(f.h3),h.putInt32(f.h4),h.putInt32(f.h5),h.putInt32(f.h6),h.putInt32(f.h7),h},n};var i=null,s=!1,o=null;function c(e,t,r){for(var a,n,i,s,c,u,l,p,f,h,d,y,g,v=r.length();v>=64;){for(c=0;c<16;++c)t[c]=r.getInt32();for(;c<64;++c)a=((a=t[c-2])>>>17|a<<15)^(a>>>19|a<<13)^a>>>10,n=((n=t[c-15])>>>7|n<<25)^(n>>>18|n<<14)^n>>>3,t[c]=a+t[c-7]+n+t[c-16]|0;for(u=e.h0,l=e.h1,p=e.h2,f=e.h3,h=e.h4,d=e.h5,y=e.h6,g=e.h7,c=0;c<64;++c)i=(u>>>2|u<<30)^(u>>>13|u<<19)^(u>>>22|u<<10),s=u&l|p&(u^l),a=g+((h>>>6|h<<26)^(h>>>11|h<<21)^(h>>>25|h<<7))+(y^h&(d^y))+o[c]+t[c],g=y,y=d,d=h,h=f+a>>>0,f=p,p=l,l=u,u=a+(n=i+s)>>>0;e.h0=e.h0+u|0,e.h1=e.h1+l|0,e.h2=e.h2+p|0,e.h3=e.h3+f|0,e.h4=e.h4+h|0,e.h5=e.h5+d|0,e.h6=e.h6+y|0,e.h7=e.h7+g|0,v-=64}}},function(e,t,r){var a=r(0);r(1);var n=null;!a.util.isNodejs||a.options.usePureJavaScript||process.versions["node-webkit"]||(n=r(16)),(e.exports=a.prng=a.prng||{}).create=function(e){for(var t={plugin:e,key:null,seed:null,time:null,reseeds:0,generated:0,keyBytes:""},r=e.md,i=new Array(32),s=0;s<32;++s)i[s]=r.create();function o(){if(t.pools[0].messageLength>=32)return c();var e=32-t.pools[0].messageLength<<5;t.collect(t.seedFileSync(e)),c()}function c(){t.reseeds=4294967295===t.reseeds?0:t.reseeds+1;var e=t.plugin.md.create();e.update(t.keyBytes);for(var r=1,a=0;a<32;++a)t.reseeds%r==0&&(e.update(t.pools[a].digest().getBytes()),t.pools[a].start()),r<<=1;t.keyBytes=e.digest().getBytes(),e.start(),e.update(t.keyBytes);var n=e.digest().getBytes();t.key=t.plugin.formatKey(t.keyBytes),t.seed=t.plugin.formatSeed(n),t.generated=0}function u(e){var t=null,r=a.util.globalScope,n=r.crypto||r.msCrypto;n&&n.getRandomValues&&(t=function(e){return n.getRandomValues(e)});var i=a.util.createBuffer();if(t)for(;i.length()>16)))<<16,f=4294967295&(l=(2147483647&(l+=u>>15))+(l>>31));for(c=0;c<3;++c)p=f>>>(c<<3),p^=Math.floor(256*Math.random()),i.putByte(255&p)}return i.getBytes(e)}return t.pools=i,t.pool=0,t.generate=function(e,r){if(!r)return t.generateSync(e);var n=t.plugin.cipher,i=t.plugin.increment,s=t.plugin.formatKey,o=t.plugin.formatSeed,u=a.util.createBuffer();t.key=null,function l(p){if(p)return r(p);if(u.length()>=e)return r(null,u.getBytes(e));t.generated>1048575&&(t.key=null);if(null===t.key)return a.util.nextTick((function(){!function(e){if(t.pools[0].messageLength>=32)return c(),e();var r=32-t.pools[0].messageLength<<5;t.seedFile(r,(function(r,a){if(r)return e(r);t.collect(a),c(),e()}))}(l)}));var f=n(t.key,t.seed);t.generated+=f.length,u.putBytes(f),t.key=s(n(t.key,i(t.seed))),t.seed=o(n(t.key,t.seed)),a.util.setImmediate(l)}()},t.generateSync=function(e){var r=t.plugin.cipher,n=t.plugin.increment,i=t.plugin.formatKey,s=t.plugin.formatSeed;t.key=null;for(var c=a.util.createBuffer();c.length()1048575&&(t.key=null),null===t.key&&o();var u=r(t.key,t.seed);t.generated+=u.length,c.putBytes(u),t.key=i(r(t.key,n(t.seed))),t.seed=s(r(t.key,t.seed))}return c.getBytes(e)},n?(t.seedFile=function(e,t){n.randomBytes(e,(function(e,r){if(e)return t(e);t(null,r.toString())}))},t.seedFileSync=function(e){return n.randomBytes(e).toString()}):(t.seedFile=function(e,t){try{t(null,u(e))}catch(e){t(e)}},t.seedFileSync=u),t.collect=function(e){for(var r=e.length,a=0;a>n&255);t.collect(a)},t.registerWorker=function(e){if(e===self)t.seedFile=function(e,t){self.addEventListener("message",(function e(r){var a=r.data;a.forge&&a.forge.prng&&(self.removeEventListener("message",e),t(a.forge.prng.err,a.forge.prng.bytes))})),self.postMessage({forge:{prng:{needed:e}}})};else{e.addEventListener("message",(function(r){var a=r.data;a.forge&&a.forge.prng&&t.seedFile(a.forge.prng.needed,(function(t,r){e.postMessage({forge:{prng:{err:t,bytes:r}}})}))}))}},t}},function(e,t,r){var a=r(0);r(1);var n=[217,120,249,196,25,221,181,237,40,233,253,121,74,160,216,157,198,126,55,131,43,118,83,142,98,76,100,136,68,139,251,162,23,154,89,245,135,179,79,19,97,69,109,141,9,129,125,50,189,143,64,235,134,183,123,11,240,149,33,34,92,107,78,130,84,214,101,147,206,96,178,28,115,86,192,20,167,140,241,220,18,117,202,31,59,190,228,209,66,61,212,48,163,60,182,38,111,191,14,218,70,105,7,87,39,242,29,155,188,148,67,3,248,17,199,246,144,239,62,231,6,195,213,47,200,102,30,215,8,232,234,222,128,82,238,247,132,170,114,172,53,77,106,42,150,26,210,113,90,21,73,116,75,159,208,94,4,24,164,236,194,224,65,110,15,81,203,204,36,145,175,80,161,244,112,57,153,124,58,133,35,184,180,122,252,2,54,91,37,85,151,49,45,93,250,152,227,138,146,174,5,223,41,16,103,108,186,201,211,0,230,207,225,158,168,44,99,22,1,63,88,226,137,169,13,56,52,27,171,51,255,176,187,72,12,95,185,177,205,46,197,243,219,71,229,165,156,119,10,166,32,104,254,127,193,173],i=[1,2,3,5],s=function(e,t){return e<>16-t},o=function(e,t){return(65535&e)>>t|e<<16-t&65535};e.exports=a.rc2=a.rc2||{},a.rc2.expandKey=function(e,t){"string"==typeof e&&(e=a.util.createBuffer(e)),t=t||128;var r,i=e,s=e.length(),o=t,c=Math.ceil(o/8),u=255>>(7&o);for(r=s;r<128;r++)i.putByte(n[i.at(r-1)+i.at(r-s)&255]);for(i.setAt(128-c,n[i.at(128-c)&u]),r=127-c;r>=0;r--)i.setAt(r,n[i.at(r+1)^i.at(r+c)]);return i};var c=function(e,t,r){var n,c,u,l,p=!1,f=null,h=null,d=null,y=[];for(e=a.rc2.expandKey(e,t),u=0;u<64;u++)y.push(e.getInt16Le());r?(n=function(e){for(u=0;u<4;u++)e[u]+=y[l]+(e[(u+3)%4]&e[(u+2)%4])+(~e[(u+3)%4]&e[(u+1)%4]),e[u]=s(e[u],i[u]),l++},c=function(e){for(u=0;u<4;u++)e[u]+=y[63&e[(u+3)%4]]}):(n=function(e){for(u=3;u>=0;u--)e[u]=o(e[u],i[u]),e[u]-=y[l]+(e[(u+3)%4]&e[(u+2)%4])+(~e[(u+3)%4]&e[(u+1)%4]),l--},c=function(e){for(u=3;u>=0;u--)e[u]-=y[63&e[(u+3)%4]]});var g=function(e){var t=[];for(u=0;u<4;u++){var a=f.getInt16Le();null!==d&&(r?a^=d.getInt16Le():d.putInt16Le(a)),t.push(65535&a)}l=r?0:63;for(var n=0;n=8;)g([[5,n],[1,c],[6,n],[1,c],[5,n]])},finish:function(e){var t=!0;if(r)if(e)t=e(8,f,!r);else{var a=8===f.length()?8:8-f.length();f.fillWithByte(a,a)}if(t&&(p=!0,v.update()),!r&&(t=0===f.length()))if(e)t=e(8,h,!r);else{var n=h.length(),i=h.at(n-1);i>n?t=!1:h.truncate(i)}return t}}};a.rc2.startEncrypting=function(e,t,r){var n=a.rc2.createEncryptionCipher(e,128);return n.start(t,r),n},a.rc2.createEncryptionCipher=function(e,t){return c(e,t,!0)},a.rc2.startDecrypting=function(e,t,r){var n=a.rc2.createDecryptionCipher(e,128);return n.start(t,r),n},a.rc2.createDecryptionCipher=function(e,t){return c(e,t,!1)}},function(e,t,r){var a=r(0);r(1),r(2),r(9);var n=e.exports=a.pkcs1=a.pkcs1||{};function i(e,t,r){r||(r=a.md.sha1.create());for(var n="",i=Math.ceil(t/r.digestLength),s=0;s>24&255,s>>16&255,s>>8&255,255&s);r.start(),r.update(e+o),n+=r.digest().getBytes()}return n.substring(0,t)}n.encode_rsa_oaep=function(e,t,r){var n,s,o,c;"string"==typeof r?(n=r,s=arguments[3]||void 0,o=arguments[4]||void 0):r&&(n=r.label||void 0,s=r.seed||void 0,o=r.md||void 0,r.mgf1&&r.mgf1.md&&(c=r.mgf1.md)),o?o.start():o=a.md.sha1.create(),c||(c=o);var u=Math.ceil(e.n.bitLength()/8),l=u-2*o.digestLength-2;if(t.length>l)throw(g=new Error("RSAES-OAEP input message length is too long.")).length=t.length,g.maxLength=l,g;n||(n=""),o.update(n,"raw");for(var p=o.digest(),f="",h=l-t.length,d=0;de&&(s=c(e,t));var h=s.toString(16);n.target.postMessage({hex:h,workLoad:l}),s.dAddOffset(p,0)}}}h()}(e,t,n,i);return o(e,t,n,i)}(e,u,i.options,n);throw new Error("Invalid prime generation algorithm: "+i.name)}}function o(e,t,r,i){var s=c(e,t),o=function(e){return e<=100?27:e<=150?18:e<=200?15:e<=250?12:e<=300?9:e<=350?8:e<=400?7:e<=500?6:e<=600?5:e<=800?4:e<=1250?3:2}(s.bitLength());"millerRabinTests"in r&&(o=r.millerRabinTests);var u=10;"maxBlockTime"in r&&(u=r.maxBlockTime),function e(t,r,i,s,o,u,l){var p=+new Date;do{if(t.bitLength()>r&&(t=c(r,i)),t.isProbablePrime(o))return l(null,t);t.dAddOffset(n[s++%8],0)}while(u<0||+new Date-p=0&&n.push(o):n.push(o))}return n}function h(e){if(e.composed||e.constructed){for(var t=a.util.createBuffer(),r=0;r0&&(c=n.create(n.Class.UNIVERSAL,n.Type.SET,!0,p));var f=[],h=[];null!==t&&(h=a.util.isArray(t)?t:[t]);for(var d=[],y=0;y0){var C=n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,d),E=n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[n.create(n.Class.UNIVERSAL,n.Type.OID,!1,n.oidToDer(i.oids.data).getBytes()),n.create(n.Class.CONTEXT_SPECIFIC,0,!0,[n.create(n.Class.UNIVERSAL,n.Type.OCTETSTRING,!1,n.toDer(C).getBytes())])]);f.push(E)}var S=null;if(null!==e){var T=i.wrapRsaPrivateKey(i.privateKeyToAsn1(e));S=null===r?n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[n.create(n.Class.UNIVERSAL,n.Type.OID,!1,n.oidToDer(i.oids.keyBag).getBytes()),n.create(n.Class.CONTEXT_SPECIFIC,0,!0,[T]),c]):n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[n.create(n.Class.UNIVERSAL,n.Type.OID,!1,n.oidToDer(i.oids.pkcs8ShroudedKeyBag).getBytes()),n.create(n.Class.CONTEXT_SPECIFIC,0,!0,[i.encryptPrivateKeyInfo(T,r,o)]),c]);var I=n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[S]),A=n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[n.create(n.Class.UNIVERSAL,n.Type.OID,!1,n.oidToDer(i.oids.data).getBytes()),n.create(n.Class.CONTEXT_SPECIFIC,0,!0,[n.create(n.Class.UNIVERSAL,n.Type.OCTETSTRING,!1,n.toDer(I).getBytes())])]);f.push(A)}var B,b=n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,f);if(o.useMac){var N=a.md.sha1.create(),R=new a.util.ByteBuffer(a.random.getBytes(o.saltSize)),w=o.count,_=(e=s.generateKey(r,R,3,w,20),a.hmac.create());_.start(N,e),_.update(n.toDer(b).getBytes());var L=_.getMac();B=n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[n.create(n.Class.UNIVERSAL,n.Type.OID,!1,n.oidToDer(i.oids.sha1).getBytes()),n.create(n.Class.UNIVERSAL,n.Type.NULL,!1,"")]),n.create(n.Class.UNIVERSAL,n.Type.OCTETSTRING,!1,L.getBytes())]),n.create(n.Class.UNIVERSAL,n.Type.OCTETSTRING,!1,R.getBytes()),n.create(n.Class.UNIVERSAL,n.Type.INTEGER,!1,n.integerToDer(w).getBytes())])}return n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[n.create(n.Class.UNIVERSAL,n.Type.INTEGER,!1,n.integerToDer(3).getBytes()),n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[n.create(n.Class.UNIVERSAL,n.Type.OID,!1,n.oidToDer(i.oids.data).getBytes()),n.create(n.Class.CONTEXT_SPECIFIC,0,!0,[n.create(n.Class.UNIVERSAL,n.Type.OCTETSTRING,!1,n.toDer(b).getBytes())])]),B])},s.generateKey=a.pbe.generatePkcs12Key},function(e,t,r){var a=r(0);r(3),r(1);var n=a.asn1,i=e.exports=a.pkcs7asn1=a.pkcs7asn1||{};a.pkcs7=a.pkcs7||{},a.pkcs7.asn1=i;var s={name:"ContentInfo",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.ContentType",tagClass:n.Class.UNIVERSAL,type:n.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:n.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,captureAsn1:"content"}]};i.contentInfoValidator=s;var o={name:"EncryptedContentInfo",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentType",tagClass:n.Class.UNIVERSAL,type:n.Type.OID,constructed:!1,capture:"contentType"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentEncryptionAlgorithm.algorithm",tagClass:n.Class.UNIVERSAL,type:n.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm.parameter",tagClass:n.Class.UNIVERSAL,captureAsn1:"encParameter"}]},{name:"EncryptedContentInfo.encryptedContent",tagClass:n.Class.CONTEXT_SPECIFIC,type:0,capture:"encryptedContent",captureAsn1:"encryptedContentAsn1"}]};i.envelopedDataValidator={name:"EnvelopedData",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,value:[{name:"EnvelopedData.Version",tagClass:n.Class.UNIVERSAL,type:n.Type.INTEGER,constructed:!1,capture:"version"},{name:"EnvelopedData.RecipientInfos",tagClass:n.Class.UNIVERSAL,type:n.Type.SET,constructed:!0,captureAsn1:"recipientInfos"}].concat(o)},i.encryptedDataValidator={name:"EncryptedData",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedData.Version",tagClass:n.Class.UNIVERSAL,type:n.Type.INTEGER,constructed:!1,capture:"version"}].concat(o)};var c={name:"SignerInfo",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.version",tagClass:n.Class.UNIVERSAL,type:n.Type.INTEGER,constructed:!1},{name:"SignerInfo.issuerAndSerialNumber",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.issuerAndSerialNumber.issuer",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"SignerInfo.issuerAndSerialNumber.serialNumber",tagClass:n.Class.UNIVERSAL,type:n.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"SignerInfo.digestAlgorithm",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.digestAlgorithm.algorithm",tagClass:n.Class.UNIVERSAL,type:n.Type.OID,constructed:!1,capture:"digestAlgorithm"},{name:"SignerInfo.digestAlgorithm.parameter",tagClass:n.Class.UNIVERSAL,constructed:!1,captureAsn1:"digestParameter",optional:!0}]},{name:"SignerInfo.authenticatedAttributes",tagClass:n.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"authenticatedAttributes"},{name:"SignerInfo.digestEncryptionAlgorithm",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,capture:"signatureAlgorithm"},{name:"SignerInfo.encryptedDigest",tagClass:n.Class.UNIVERSAL,type:n.Type.OCTETSTRING,constructed:!1,capture:"signature"},{name:"SignerInfo.unauthenticatedAttributes",tagClass:n.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,capture:"unauthenticatedAttributes"}]};i.signedDataValidator={name:"SignedData",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,value:[{name:"SignedData.Version",tagClass:n.Class.UNIVERSAL,type:n.Type.INTEGER,constructed:!1,capture:"version"},{name:"SignedData.DigestAlgorithms",tagClass:n.Class.UNIVERSAL,type:n.Type.SET,constructed:!0,captureAsn1:"digestAlgorithms"},s,{name:"SignedData.Certificates",tagClass:n.Class.CONTEXT_SPECIFIC,type:0,optional:!0,captureAsn1:"certificates"},{name:"SignedData.CertificateRevocationLists",tagClass:n.Class.CONTEXT_SPECIFIC,type:1,optional:!0,captureAsn1:"crls"},{name:"SignedData.SignerInfos",tagClass:n.Class.UNIVERSAL,type:n.Type.SET,capture:"signerInfos",optional:!0,value:[c]}]},i.recipientInfoValidator={name:"RecipientInfo",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.version",tagClass:n.Class.UNIVERSAL,type:n.Type.INTEGER,constructed:!1,capture:"version"},{name:"RecipientInfo.issuerAndSerial",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.issuerAndSerial.issuer",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"RecipientInfo.issuerAndSerial.serialNumber",tagClass:n.Class.UNIVERSAL,type:n.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"RecipientInfo.keyEncryptionAlgorithm",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.keyEncryptionAlgorithm.algorithm",tagClass:n.Class.UNIVERSAL,type:n.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"RecipientInfo.keyEncryptionAlgorithm.parameter",tagClass:n.Class.UNIVERSAL,constructed:!1,captureAsn1:"encParameter",optional:!0}]},{name:"RecipientInfo.encryptedKey",tagClass:n.Class.UNIVERSAL,type:n.Type.OCTETSTRING,constructed:!1,capture:"encKey"}]}},function(e,t,r){var a=r(0);r(1),a.mgf=a.mgf||{},(e.exports=a.mgf.mgf1=a.mgf1=a.mgf1||{}).create=function(e){return{generate:function(t,r){for(var n=new a.util.ByteBuffer,i=Math.ceil(r/e.digestLength),s=0;s>>0,s>>>0];for(var o=h.fullMessageLength.length-1;o>=0;--o)h.fullMessageLength[o]+=s[1],s[1]=s[0]+(h.fullMessageLength[o]/4294967296>>>0),h.fullMessageLength[o]=h.fullMessageLength[o]>>>0,s[0]=s[1]/4294967296>>>0;return n.putBytes(e),l(r,i,n),(n.read>2048||0===n.length())&&n.compact(),h},h.digest=function(){var t=a.util.createBuffer();t.putBytes(n.bytes());var o,c=h.fullMessageLength[h.fullMessageLength.length-1]+h.messageLengthSize&h.blockLength-1;t.putBytes(s.substr(0,h.blockLength-c));for(var u=8*h.fullMessageLength[0],p=0;p>>0,t.putInt32(u>>>0),u=o>>>0;t.putInt32(u);var f=new Array(r.length);for(p=0;p=128;){for(_=0;_<16;++_)t[_][0]=r.getInt32()>>>0,t[_][1]=r.getInt32()>>>0;for(;_<80;++_)a=(((L=(U=t[_-2])[0])>>>19|(k=U[1])<<13)^(k>>>29|L<<3)^L>>>6)>>>0,n=((L<<13|k>>>19)^(k<<3|L>>>29)^(L<<26|k>>>6))>>>0,i=(((L=(P=t[_-15])[0])>>>1|(k=P[1])<<31)^(L>>>8|k<<24)^L>>>7)>>>0,s=((L<<31|k>>>1)^(L<<24|k>>>8)^(L<<25|k>>>7))>>>0,D=t[_-7],V=t[_-16],k=n+D[1]+s+V[1],t[_][0]=a+D[0]+i+V[0]+(k/4294967296>>>0)>>>0,t[_][1]=k>>>0;for(d=e[0][0],y=e[0][1],g=e[1][0],v=e[1][1],m=e[2][0],C=e[2][1],E=e[3][0],S=e[3][1],T=e[4][0],I=e[4][1],A=e[5][0],B=e[5][1],b=e[6][0],N=e[6][1],R=e[7][0],w=e[7][1],_=0;_<80;++_)l=((T>>>14|I<<18)^(T>>>18|I<<14)^(I>>>9|T<<23))>>>0,p=(b^T&(A^b))>>>0,o=((d>>>28|y<<4)^(y>>>2|d<<30)^(y>>>7|d<<25))>>>0,u=((d<<4|y>>>28)^(y<<30|d>>>2)^(y<<25|d>>>7))>>>0,f=(d&g|m&(d^g))>>>0,h=(y&v|C&(y^v))>>>0,k=w+(((T<<18|I>>>14)^(T<<14|I>>>18)^(I<<23|T>>>9))>>>0)+((N^I&(B^N))>>>0)+c[_][1]+t[_][1],a=R+l+p+c[_][0]+t[_][0]+(k/4294967296>>>0)>>>0,n=k>>>0,i=o+f+((k=u+h)/4294967296>>>0)>>>0,s=k>>>0,R=b,w=N,b=A,N=B,A=T,B=I,T=E+a+((k=S+n)/4294967296>>>0)>>>0,I=k>>>0,E=m,S=C,m=g,C=v,g=d,v=y,d=a+i+((k=n+s)/4294967296>>>0)>>>0,y=k>>>0;k=e[0][1]+y,e[0][0]=e[0][0]+d+(k/4294967296>>>0)>>>0,e[0][1]=k>>>0,k=e[1][1]+v,e[1][0]=e[1][0]+g+(k/4294967296>>>0)>>>0,e[1][1]=k>>>0,k=e[2][1]+C,e[2][0]=e[2][0]+m+(k/4294967296>>>0)>>>0,e[2][1]=k>>>0,k=e[3][1]+S,e[3][0]=e[3][0]+E+(k/4294967296>>>0)>>>0,e[3][1]=k>>>0,k=e[4][1]+I,e[4][0]=e[4][0]+T+(k/4294967296>>>0)>>>0,e[4][1]=k>>>0,k=e[5][1]+B,e[5][0]=e[5][0]+A+(k/4294967296>>>0)>>>0,e[5][1]=k>>>0,k=e[6][1]+N,e[6][0]=e[6][0]+b+(k/4294967296>>>0)>>>0,e[6][1]=k>>>0,k=e[7][1]+w,e[7][0]=e[7][0]+R+(k/4294967296>>>0)>>>0,e[7][1]=k>>>0,O-=128}}},function(e,t,r){e.exports=r(33)},function(e,t,r){e.exports=r(0),r(5),r(36),r(3),r(13),r(10),r(38),r(8),r(40),r(41),r(42),r(30),r(15),r(7),r(26),r(28),r(43),r(21),r(27),r(24),r(18),r(2),r(25),r(44),r(20),r(1)},function(e,t){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(e){"object"==typeof window&&(r=window)}e.exports=r},function(e,t){var r={};e.exports=r;var a={};r.encode=function(e,t,r){if("string"!=typeof t)throw new TypeError('"alphabet" must be a string.');if(void 0!==r&&"number"!=typeof r)throw new TypeError('"maxline" must be a number.');var a="";if(e instanceof Uint8Array){var n=0,i=t.length,s=t.charAt(0),o=[0];for(n=0;n0;)o.push(u%i),u=u/i|0}for(n=0;0===e[n]&&n=0;--n)a+=t[o[n]]}else a=function(e,t){var r=0,a=t.length,n=t.charAt(0),i=[0];for(r=0;r0;)i.push(o%a),o=o/a|0}var c="";for(r=0;0===e.at(r)&&r=0;--r)c+=t[i[r]];return c}(e,t);if(r){var l=new RegExp(".{1,"+r+"}","g");a=a.match(l).join("\r\n")}return a},r.decode=function(e,t){if("string"!=typeof e)throw new TypeError('"input" must be a string.');if("string"!=typeof t)throw new TypeError('"alphabet" must be a string.');var r=a[t];if(!r){r=a[t]=[];for(var n=0;n>=8;for(;l>0;)o.push(255&l),l>>=8}for(var p=0;e[p]===s&&p=n.Versions.TLS_1_1.minor&&c.output.putBytes(r),c.update(e.fragment),c.finish(o)&&(e.fragment=c.output,e.length=e.fragment.length(),i=!0),i}function o(e,t,r){if(!r){var a=e-t.length()%e;t.fillWithByte(a-1,a)}return!0}function c(e,t,r){var a=!0;if(r){for(var n=t.length(),i=t.last(),s=n-1-i;s=o?(e.fragment=s.output.getBytes(l-o),u=s.output.getBytes(o)):e.fragment=s.output.getBytes(),e.fragment=a.util.createBuffer(e.fragment),e.length=e.fragment.length();var p=t.macFunction(t.macKey,t.sequenceNumber,e);return t.updateSequenceNumber(),i=function(e,t,r){var n=a.hmac.create();return n.start("SHA1",e),n.update(t),t=n.digest().getBytes(),n.start(null,null),n.update(r),r=n.digest().getBytes(),t===r}(t.macKey,u,p)&&i}n.CipherSuites.TLS_RSA_WITH_AES_128_CBC_SHA={id:[0,47],name:"TLS_RSA_WITH_AES_128_CBC_SHA",initSecurityParameters:function(e){e.bulk_cipher_algorithm=n.BulkCipherAlgorithm.aes,e.cipher_type=n.CipherType.block,e.enc_key_length=16,e.block_length=16,e.fixed_iv_length=16,e.record_iv_length=16,e.mac_algorithm=n.MACAlgorithm.hmac_sha1,e.mac_length=20,e.mac_key_length=20},initConnectionState:i},n.CipherSuites.TLS_RSA_WITH_AES_256_CBC_SHA={id:[0,53],name:"TLS_RSA_WITH_AES_256_CBC_SHA",initSecurityParameters:function(e){e.bulk_cipher_algorithm=n.BulkCipherAlgorithm.aes,e.cipher_type=n.CipherType.block,e.enc_key_length=32,e.block_length=16,e.fixed_iv_length=16,e.record_iv_length=16,e.mac_algorithm=n.MACAlgorithm.hmac_sha1,e.mac_length=20,e.mac_key_length=20},initConnectionState:i}},function(e,t,r){var a=r(0);r(30),e.exports=a.mgf=a.mgf||{},a.mgf.mgf1=a.mgf1},function(e,t,r){var a=r(0);r(12),r(2),r(31),r(1);var n=r(39),i=n.publicKeyValidator,s=n.privateKeyValidator;if(void 0===o)var o=a.jsbn.BigInteger;var c=a.util.ByteBuffer,u="undefined"==typeof Buffer?Uint8Array:Buffer;a.pki=a.pki||{},e.exports=a.pki.ed25519=a.ed25519=a.ed25519||{};var l=a.ed25519;function p(e){var t=e.message;if(t instanceof Uint8Array||t instanceof u)return t;var r=e.encoding;if(void 0===t){if(!e.md)throw new TypeError('"options.message" or "options.md" not specified.');t=e.md.digest().getBytes(),r="binary"}if("string"==typeof t&&!r)throw new TypeError('"options.encoding" must be "binary" or "utf8".');if("string"==typeof t){if("undefined"!=typeof Buffer)return Buffer.from(t,r);t=new c(t,r)}else if(!(t instanceof c))throw new TypeError('"options.message" must be a node.js Buffer, a Uint8Array, a forge ByteBuffer, or a string with "options.encoding" specifying its encoding.');for(var a=new u(t.length()),n=0;n=0;--r)K(a,a),1!==r&&x(a,a,t);for(r=0;r<16;++r)e[r]=a[r]}(r,r),x(r,r,n),x(r,r,i),x(r,r,i),x(e[0],r,i),K(a,e[0]),x(a,a,i),N(a,n)&&x(e[0],e[0],C);if(K(a,e[0]),x(a,a,i),N(a,n))return-1;w(e[0])===t[31]>>7&&O(e[0],f,e[0]);return x(e[3],e[0],e[1]),0}(o,a))return-1;for(n=0;n=0};var f=P(),h=P([1]),d=P([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),y=P([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),g=P([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),v=P([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),m=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]),C=P([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function E(e,t){var r=a.md.sha512.create(),n=new c(e);r.update(n.getBytes(t),"binary");var i=r.digest().getBytes();if("undefined"!=typeof Buffer)return Buffer.from(i,"binary");for(var s=new u(l.constants.HASH_BYTE_LENGTH),o=0;o<64;++o)s[o]=i.charCodeAt(o);return s}function S(e,t){var r,a,n,i;for(a=63;a>=32;--a){for(r=0,n=a-32,i=a-12;n>8,t[n]-=256*r;t[n]+=r,t[a]=0}for(r=0,n=0;n<32;++n)t[n]+=r-(t[31]>>4)*m[n],r=t[n]>>8,t[n]&=255;for(n=0;n<32;++n)t[n]-=r*m[n];for(a=0;a<32;++a)t[a+1]+=t[a]>>8,e[a]=255&t[a]}function T(e){for(var t=new Float64Array(64),r=0;r<64;++r)t[r]=e[r],e[r]=0;S(e,t)}function I(e,t){var r=P(),a=P(),n=P(),i=P(),s=P(),o=P(),c=P(),u=P(),l=P();O(r,e[1],e[0]),O(l,t[1],t[0]),x(r,r,l),V(a,e[0],e[1]),V(l,t[0],t[1]),x(a,a,l),x(n,e[3],t[3]),x(n,n,y),x(i,e[2],t[2]),V(i,i,i),O(s,a,r),O(o,i,n),V(c,i,n),V(u,a,r),x(e[0],s,o),x(e[1],u,c),x(e[2],c,o),x(e[3],s,u)}function A(e,t,r){for(var a=0;a<4;++a)D(e[a],t[a],r)}function B(e,t){var r=P(),a=P(),n=P();!function(e,t){var r,a=P();for(r=0;r<16;++r)a[r]=t[r];for(r=253;r>=0;--r)K(a,a),2!==r&&4!==r&&x(a,a,t);for(r=0;r<16;++r)e[r]=a[r]}(n,t[2]),x(r,t[0],n),x(a,t[1],n),b(e,a),e[31]^=w(r)<<7}function b(e,t){var r,a,n,i=P(),s=P();for(r=0;r<16;++r)s[r]=t[r];for(U(s),U(s),U(s),a=0;a<2;++a){for(i[0]=s[0]-65517,r=1;r<15;++r)i[r]=s[r]-65535-(i[r-1]>>16&1),i[r-1]&=65535;i[15]=s[15]-32767-(i[14]>>16&1),n=i[15]>>16&1,i[14]&=65535,D(s,i,1-n)}for(r=0;r<16;r++)e[2*r]=255&s[r],e[2*r+1]=s[r]>>8}function N(e,t){var r=new u(32),a=new u(32);return b(r,e),b(a,t),R(r,0,a,0)}function R(e,t,r,a){return function(e,t,r,a,n){var i,s=0;for(i=0;i>>8)-1}(e,t,r,a,32)}function w(e){var t=new u(32);return b(t,e),1&t[0]}function _(e,t,r){var a,n;for(k(e[0],f),k(e[1],h),k(e[2],h),k(e[3],f),n=255;n>=0;--n)A(e,t,a=r[n/8|0]>>(7&n)&1),I(t,e),I(e,e),A(e,t,a)}function L(e,t){var r=[P(),P(),P(),P()];k(r[0],g),k(r[1],v),k(r[2],h),x(r[3],g,v),_(e,r,t)}function k(e,t){var r;for(r=0;r<16;r++)e[r]=0|t[r]}function U(e){var t,r,a=1;for(t=0;t<16;++t)r=e[t]+a+65535,a=Math.floor(r/65536),e[t]=r-65536*a;e[0]+=a-1+37*(a-1)}function D(e,t,r){for(var a,n=~(r-1),i=0;i<16;++i)a=n&(e[i]^t[i]),e[i]^=a,t[i]^=a}function P(e){var t,r=new Float64Array(16);if(e)for(t=0;t0&&(s=a.util.fillString(String.fromCharCode(0),c)+s),{encapsulation:t.encrypt(s,"NONE"),key:e.generate(s,i)}},decrypt:function(t,r,a){var n=t.decrypt(r,"NONE");return e.generate(n,a)}};return i},a.kem.kdf1=function(e,t){i(this,e,0,t||e.digestLength)},a.kem.kdf2=function(e,t){i(this,e,1,t||e.digestLength)}},function(e,t,r){var a=r(0);r(1),e.exports=a.log=a.log||{},a.log.levels=["none","error","warning","info","debug","verbose","max"];var n={},i=[],s=null;a.log.LEVEL_LOCKED=2,a.log.NO_LEVEL_CHECK=4,a.log.INTERPOLATE=8;for(var o=0;o0){for(var r=n.create(n.Class.CONTEXT_SPECIFIC,1,!0,[]),i=0;i=r&&s0&&s.value[0].value.push(n.create(n.Class.CONTEXT_SPECIFIC,0,!0,t)),i.length>0&&s.value[0].value.push(n.create(n.Class.CONTEXT_SPECIFIC,1,!0,i)),s.value[0].value.push(n.create(n.Class.UNIVERSAL,n.Type.SET,!0,e.signerInfos)),n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[n.create(n.Class.UNIVERSAL,n.Type.OID,!1,n.oidToDer(e.type).getBytes()),s])},addSigner:function(t){var r=t.issuer,n=t.serialNumber;if(t.certificate){var i=t.certificate;"string"==typeof i&&(i=a.pki.certificateFromPem(i)),r=i.issuer.attributes,n=i.serialNumber}var s=t.key;if(!s)throw new Error("Could not add PKCS#7 signer; no private key specified.");"string"==typeof s&&(s=a.pki.privateKeyFromPem(s));var o=t.digestAlgorithm||a.pki.oids.sha1;switch(o){case a.pki.oids.sha1:case a.pki.oids.sha256:case a.pki.oids.sha384:case a.pki.oids.sha512:case a.pki.oids.md5:break;default:throw new Error("Could not add PKCS#7 signer; unknown message digest algorithm: "+o)}var c=t.authenticatedAttributes||[];if(c.length>0){for(var u=!1,l=!1,p=0;p="8"&&(r="00"+r);var n=a.util.hexToBytes(r);e.putInt32(n.length),e.putBytes(n)}function s(e,t){e.putInt32(t.length),e.putString(t)}function o(){for(var e=a.md.sha1.create(),t=arguments.length,r=0;r=0);var u=o.modPow(s,t);if(0!==u.compareTo(a.ONE)&&0!==u.compareTo(i)){for(var f=r;--f;){if(0===(u=u.modPowInt(2,t)).compareTo(a.ONE))return!1;if(0===u.compareTo(i))break}if(0===f)return!1}}var p;return!0}(t)}},function(t,i,r){var o,s=r(0);t.exports=s.jsbn=s.jsbn||{};function e(t,i,r){this.data=[],null!=t&&("number"==typeof t?this.fromNumber(t,i,r):null==i&&"string"!=typeof t?this.fromString(t,256):this.fromString(t,i))}function a(){return new e(null)}function n(t,i,r,o,s,e){for(var a=16383&i,n=i>>14;--e>=0;){var h=16383&this.data[t],u=this.data[t++]>>14,f=n*h+u*a;s=((h=a*h+((16383&f)<<14)+r.data[o]+s)>>28)+(f>>14)+n*u,r.data[o++]=268435455&h}return s}s.jsbn.BigInteger=e,"undefined"==typeof navigator?(e.prototype.am=n,o=28):"Microsoft Internet Explorer"==navigator.appName?(e.prototype.am=function(t,i,r,o,s,e){for(var a=32767&i,n=i>>15;--e>=0;){var h=32767&this.data[t],u=this.data[t++]>>15,f=n*h+u*a;s=((h=a*h+((32767&f)<<15)+r.data[o]+(1073741823&s))>>>30)+(f>>>15)+n*u+(s>>>30),r.data[o++]=1073741823&h}return s},o=30):"Netscape"!=navigator.appName?(e.prototype.am=function(t,i,r,o,s,e){for(;--e>=0;){var a=i*this.data[t++]+r.data[o]+s;s=Math.floor(a/67108864),r.data[o++]=67108863&a}return s},o=26):(e.prototype.am=n,o=28),e.prototype.DB=o,e.prototype.DM=(1<>>16)&&(t=i,r+=16),0!=(i=t>>8)&&(t=i,r+=8),0!=(i=t>>4)&&(t=i,r+=4),0!=(i=t>>2)&&(t=i,r+=2),0!=(i=t>>1)&&(t=i,r+=1),r}function l(t){this.m=t}function v(t){this.m=t,this.mp=t.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<>=16,i+=16),0==(255&t)&&(t>>=8,i+=8),0==(15&t)&&(t>>=4,i+=4),0==(3&t)&&(t>>=2,i+=2),0==(1&t)&&++i,i}function B(t){for(var i=0;0!=t;)t&=t-1,++i;return i}function S(){}function M(t){return t}function w(t){this.r2=a(),this.q3=a(),e.ONE.dlShiftTo(2*t.t,this.r2),this.mu=this.r2.divide(t),this.m=t}l.prototype.convert=function(t){return t.s<0||t.compareTo(this.m)>=0?t.mod(this.m):t},l.prototype.revert=function(t){return t},l.prototype.reduce=function(t){t.divRemTo(this.m,null,t)},l.prototype.mulTo=function(t,i,r){t.multiplyTo(i,r),this.reduce(r)},l.prototype.sqrTo=function(t,i){t.squareTo(i),this.reduce(i)},v.prototype.convert=function(t){var i=a();return t.abs().dlShiftTo(this.m.t,i),i.divRemTo(this.m,null,i),t.s<0&&i.compareTo(e.ZERO)>0&&this.m.subTo(i,i),i},v.prototype.revert=function(t){var i=a();return t.copyTo(i),this.reduce(i),i},v.prototype.reduce=function(t){for(;t.t<=this.mt2;)t.data[t.t++]=0;for(var i=0;i>15)*this.mpl&this.um)<<15)&t.DM;for(r=i+this.m.t,t.data[r]+=this.m.am(0,o,t,i,0,this.m.t);t.data[r]>=t.DV;)t.data[r]-=t.DV,t.data[++r]++}t.clamp(),t.drShiftTo(this.m.t,t),t.compareTo(this.m)>=0&&t.subTo(this.m,t)},v.prototype.mulTo=function(t,i,r){t.multiplyTo(i,r),this.reduce(r)},v.prototype.sqrTo=function(t,i){t.squareTo(i),this.reduce(i)},e.prototype.copyTo=function(t){for(var i=this.t-1;i>=0;--i)t.data[i]=this.data[i];t.t=this.t,t.s=this.s},e.prototype.fromInt=function(t){this.t=1,this.s=t<0?-1:0,t>0?this.data[0]=t:t<-1?this.data[0]=t+this.DV:this.t=0},e.prototype.fromString=function(t,i){var r;if(16==i)r=4;else if(8==i)r=3;else if(256==i)r=8;else if(2==i)r=1;else if(32==i)r=5;else{if(4!=i)return void this.fromRadix(t,i);r=2}this.t=0,this.s=0;for(var o=t.length,s=!1,a=0;--o>=0;){var n=8==r?255&t[o]:d(t,o);n<0?"-"==t.charAt(o)&&(s=!0):(s=!1,0==a?this.data[this.t++]=n:a+r>this.DB?(this.data[this.t-1]|=(n&(1<>this.DB-a):this.data[this.t-1]|=n<=this.DB&&(a-=this.DB))}8==r&&0!=(128&t[0])&&(this.s=-1,a>0&&(this.data[this.t-1]|=(1<0&&this.data[this.t-1]==t;)--this.t},e.prototype.dlShiftTo=function(t,i){var r;for(r=this.t-1;r>=0;--r)i.data[r+t]=this.data[r];for(r=t-1;r>=0;--r)i.data[r]=0;i.t=this.t+t,i.s=this.s},e.prototype.drShiftTo=function(t,i){for(var r=t;r=0;--r)i.data[r+a+1]=this.data[r]>>s|n,n=(this.data[r]&e)<=0;--r)i.data[r]=0;i.data[a]=n,i.t=this.t+a+1,i.s=this.s,i.clamp()},e.prototype.rShiftTo=function(t,i){i.s=this.s;var r=Math.floor(t/this.DB);if(r>=this.t)i.t=0;else{var o=t%this.DB,s=this.DB-o,e=(1<>o;for(var a=r+1;a>o;o>0&&(i.data[this.t-r-1]|=(this.s&e)<>=this.DB;if(t.t>=this.DB;o+=this.s}else{for(o+=this.s;r>=this.DB;o-=t.s}i.s=o<0?-1:0,o<-1?i.data[r++]=this.DV+o:o>0&&(i.data[r++]=o),i.t=r,i.clamp()},e.prototype.multiplyTo=function(t,i){var r=this.abs(),o=t.abs(),s=r.t;for(i.t=s+o.t;--s>=0;)i.data[s]=0;for(s=0;s=0;)t.data[r]=0;for(r=0;r=i.DV&&(t.data[r+i.t]-=i.DV,t.data[r+i.t+1]=1)}t.t>0&&(t.data[t.t-1]+=i.am(r,i.data[r],t,2*r,0,1)),t.s=0,t.clamp()},e.prototype.divRemTo=function(t,i,r){var o=t.abs();if(!(o.t<=0)){var s=this.abs();if(s.t0?(o.lShiftTo(f,n),s.lShiftTo(f,r)):(o.copyTo(n),s.copyTo(r));var p=n.t,d=n.data[p-1];if(0!=d){var c=d*(1<1?n.data[p-2]>>this.F2:0),l=this.FV/c,v=(1<=0&&(r.data[r.t++]=1,r.subTo(g,r)),e.ONE.dlShiftTo(p,g),g.subTo(n,n);n.t=0;){var D=r.data[--y]==d?this.DM:Math.floor(r.data[y]*l+(r.data[y-1]+T)*v);if((r.data[y]+=n.am(0,D,r,b,0,p))0&&r.rShiftTo(f,r),h<0&&e.ZERO.subTo(r,r)}}},e.prototype.invDigit=function(){if(this.t<1)return 0;var t=this.data[0];if(0==(1&t))return 0;var i=3&t;return(i=(i=(i=(i=i*(2-(15&t)*i)&15)*(2-(255&t)*i)&255)*(2-((65535&t)*i&65535))&65535)*(2-t*i%this.DV)%this.DV)>0?this.DV-i:-i},e.prototype.isEven=function(){return 0==(this.t>0?1&this.data[0]:this.s)},e.prototype.exp=function(t,i){if(t>4294967295||t<1)return e.ONE;var r=a(),o=a(),s=i.convert(this),n=m(t)-1;for(s.copyTo(r);--n>=0;)if(i.sqrTo(r,o),(t&1<0)i.mulTo(o,s,r);else{var h=r;r=o,o=h}return i.revert(r)},e.prototype.toString=function(t){if(this.s<0)return"-"+this.negate().toString(t);var i;if(16==t)i=4;else if(8==t)i=3;else if(2==t)i=1;else if(32==t)i=5;else{if(4!=t)return this.toRadix(t);i=2}var r,o=(1<0)for(n>n)>0&&(s=!0,e=p(r));a>=0;)n>(n+=this.DB-i)):(r=this.data[a]>>(n-=i)&o,n<=0&&(n+=this.DB,--a)),r>0&&(s=!0),s&&(e+=p(r));return s?e:"0"},e.prototype.negate=function(){var t=a();return e.ZERO.subTo(this,t),t},e.prototype.abs=function(){return this.s<0?this.negate():this},e.prototype.compareTo=function(t){var i=this.s-t.s;if(0!=i)return i;var r=this.t;if(0!=(i=r-t.t))return this.s<0?-i:i;for(;--r>=0;)if(0!=(i=this.data[r]-t.data[r]))return i;return 0},e.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+m(this.data[this.t-1]^this.s&this.DM)},e.prototype.mod=function(t){var i=a();return this.abs().divRemTo(t,null,i),this.s<0&&i.compareTo(e.ZERO)>0&&t.subTo(i,i),i},e.prototype.modPowInt=function(t,i){var r;return r=t<256||i.isEven()?new l(i):new v(i),this.exp(t,r)},e.ZERO=c(0),e.ONE=c(1),S.prototype.convert=M,S.prototype.revert=M,S.prototype.mulTo=function(t,i,r){t.multiplyTo(i,r)},S.prototype.sqrTo=function(t,i){t.squareTo(i)},w.prototype.convert=function(t){if(t.s<0||t.t>2*this.m.t)return t.mod(this.m);if(t.compareTo(this.m)<0)return t;var i=a();return t.copyTo(i),this.reduce(i),i},w.prototype.revert=function(t){return t},w.prototype.reduce=function(t){for(t.drShiftTo(this.m.t-1,this.r2),t.t>this.m.t+1&&(t.t=this.m.t+1,t.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);t.compareTo(this.r2)<0;)t.dAddOffset(1,this.m.t+1);for(t.subTo(this.r2,t);t.compareTo(this.m)>=0;)t.subTo(this.m,t)},w.prototype.mulTo=function(t,i,r){t.multiplyTo(i,r),this.reduce(r)},w.prototype.sqrTo=function(t,i){t.squareTo(i),this.reduce(i)};var E=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509],O=(1<<26)/E[E.length-1];e.prototype.chunkSize=function(t){return Math.floor(Math.LN2*this.DB/Math.log(t))},e.prototype.toRadix=function(t){if(null==t&&(t=10),0==this.signum()||t<2||t>36)return"0";var i=this.chunkSize(t),r=Math.pow(t,i),o=c(r),s=a(),e=a(),n="";for(this.divRemTo(o,s,e);s.signum()>0;)n=(r+e.intValue()).toString(t).substr(1)+n,s.divRemTo(o,s,e);return e.intValue().toString(t)+n},e.prototype.fromRadix=function(t,i){this.fromInt(0),null==i&&(i=10);for(var r=this.chunkSize(i),o=Math.pow(i,r),s=!1,a=0,n=0,h=0;h=r&&(this.dMultiply(o),this.dAddOffset(n,0),a=0,n=0))}a>0&&(this.dMultiply(Math.pow(i,a)),this.dAddOffset(n,0)),s&&e.ZERO.subTo(this,this)},e.prototype.fromNumber=function(t,i,r){if("number"==typeof i)if(t<2)this.fromInt(1);else for(this.fromNumber(t,r),this.testBit(t-1)||this.bitwiseTo(e.ONE.shiftLeft(t-1),y,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(i);)this.dAddOffset(2,0),this.bitLength()>t&&this.subTo(e.ONE.shiftLeft(t-1),this);else{var o=new Array,s=7&t;o.length=1+(t>>3),i.nextBytes(o),s>0?o[0]&=(1<>=this.DB;if(t.t>=this.DB;o+=this.s}else{for(o+=this.s;r>=this.DB;o+=t.s}i.s=o<0?-1:0,o>0?i.data[r++]=o:o<-1&&(i.data[r++]=this.DV+o),i.t=r,i.clamp()},e.prototype.dMultiply=function(t){this.data[this.t]=this.am(0,t-1,this,0,0,this.t),++this.t,this.clamp()},e.prototype.dAddOffset=function(t,i){if(0!=t){for(;this.t<=i;)this.data[this.t++]=0;for(this.data[i]+=t;this.data[i]>=this.DV;)this.data[i]-=this.DV,++i>=this.t&&(this.data[this.t++]=0),++this.data[i]}},e.prototype.multiplyLowerTo=function(t,i,r){var o,s=Math.min(this.t+t.t,i);for(r.s=0,r.t=s;s>0;)r.data[--s]=0;for(o=r.t-this.t;s=0;)r.data[o]=0;for(o=Math.max(i-this.t,0);o0)if(0==i)r=this.data[0]%t;else for(var o=this.t-1;o>=0;--o)r=(i*r+this.data[o])%t;return r},e.prototype.millerRabin=function(t){var i=this.subtract(e.ONE),r=i.getLowestSetBit();if(r<=0)return!1;for(var o,s=i.shiftRight(r),a={nextBytes:function(t){for(var i=0;i=0);var h=o.modPow(s,this);if(0!=h.compareTo(e.ONE)&&0!=h.compareTo(i)){for(var u=1;u++>24},e.prototype.shortValue=function(){return 0==this.t?this.s:this.data[0]<<16>>16},e.prototype.signum=function(){return this.s<0?-1:this.t<=0||1==this.t&&this.data[0]<=0?0:1},e.prototype.toByteArray=function(){var t=this.t,i=new Array;i[0]=this.s;var r,o=this.DB-t*this.DB%8,s=0;if(t-- >0)for(o>o)!=(this.s&this.DM)>>o&&(i[s++]=r|this.s<=0;)o<8?(r=(this.data[t]&(1<>(o+=this.DB-8)):(r=this.data[t]>>(o-=8)&255,o<=0&&(o+=this.DB,--t)),0!=(128&r)&&(r|=-256),0==s&&(128&this.s)!=(128&r)&&++s,(s>0||r!=this.s)&&(i[s++]=r);return i},e.prototype.equals=function(t){return 0==this.compareTo(t)},e.prototype.min=function(t){return this.compareTo(t)<0?this:t},e.prototype.max=function(t){return this.compareTo(t)>0?this:t},e.prototype.and=function(t){var i=a();return this.bitwiseTo(t,T,i),i},e.prototype.or=function(t){var i=a();return this.bitwiseTo(t,y,i),i},e.prototype.xor=function(t){var i=a();return this.bitwiseTo(t,b,i),i},e.prototype.andNot=function(t){var i=a();return this.bitwiseTo(t,g,i),i},e.prototype.not=function(){for(var t=a(),i=0;i=this.t?0!=this.s:0!=(this.data[i]&1<1){var p=a();for(o.sqrTo(n[1],p);h<=f;)n[h]=a(),o.mulTo(p,n[h-2],n[h]),h+=2}var d,T,y=t.t-1,b=!0,g=a();for(s=m(t.data[y])-1;y>=0;){for(s>=u?d=t.data[y]>>s-u&f:(d=(t.data[y]&(1<0&&(d|=t.data[y-1]>>this.DB+s-u)),h=r;0==(1&d);)d>>=1,--h;if((s-=h)<0&&(s+=this.DB,--y),b)n[d].copyTo(e),b=!1;else{for(;h>1;)o.sqrTo(e,g),o.sqrTo(g,e),h-=2;h>0?o.sqrTo(e,g):(T=e,e=g,g=T),o.mulTo(g,n[d],e)}for(;y>=0&&0==(t.data[y]&1<=0?(r.subTo(o,r),i&&s.subTo(n,s),a.subTo(h,a)):(o.subTo(r,o),i&&n.subTo(s,n),h.subTo(a,h))}return 0!=o.compareTo(e.ONE)?e.ZERO:h.compareTo(t)>=0?h.subtract(t):h.signum()<0?(h.addTo(t,h),h.signum()<0?h.add(t):h):h},e.prototype.pow=function(t){return this.exp(t,new S)},e.prototype.gcd=function(t){var i=this.s<0?this.negate():this.clone(),r=t.s<0?t.negate():t.clone();if(i.compareTo(r)<0){var o=i;i=r,r=o}var s=i.getLowestSetBit(),e=r.getLowestSetBit();if(e<0)return i;for(s0&&(i.rShiftTo(e,i),r.rShiftTo(e,r));i.signum()>0;)(s=i.getLowestSetBit())>0&&i.rShiftTo(s,i),(s=r.getLowestSetBit())>0&&r.rShiftTo(s,r),i.compareTo(r)>=0?(i.subTo(r,i),i.rShiftTo(1,i)):(r.subTo(i,r),r.rShiftTo(1,r));return e>0&&r.lShiftTo(e,r),r},e.prototype.isProbablePrime=function(t){var i,r=this.abs();if(1==r.t&&r.data[0]<=E[E.length-1]){for(i=0;in8uFT685yDP~}E^(ZSfF+G3387pF)roE5ki@}G z0q%8?WGOPSB_qix+{?Wo5JCwh^iJp{bV6?-^e)RJruW`^2fyE$UCFW&xc~3H_kEu) zXLshz%$YN1&N*{tW|g~45$`BU;nj*#!IY}vVTz*sr}P=7DEr1+!&B?4YJAH&+M|i7 z$n7^al1z3^oiu6b(xnrZ?lv(NUo>ggz4zXG(&QU_9hc#s=2N;HbRaA6?YtUliKEdX6m1<|U8*WN81YP|!DJH_JC= z@~(T@Y!G(eNrR;AU@(FED^=c))P0rdysxkCaF2=^)&WAl>~KZ?ja)c;{9%~!XFLs% zXDB&07Hd}?DznZ~6kwHb+}{z}Rq-kll{{rXPhTHnTooE7_R$<89GJqN^>MG^T-W$REwKdy(Y@n65>ki3toJgVZYHasTo>n@m@- ztv%tMwmcb<*nHwD)M~f&*2>mZZHZ2QG6>l^T_=_&lA(^`oLR1lb@kTkj;Nbwyj-L;9SqjzB1`f@5tus3yGG3bXxDa2fZYc?XoC zJ(S3+oh=i!(QwRF(-jR;pKg@fLddgAC9|HISg`m9Elbw6dOHTqO3|Ra+8$dZ+M;bqBS?zS)tLw4t&V(jX$B#1 zkVwX3%Z*?x8U=4!usxOt<+UZI+xbwdNQ9!TMm!V@wJix1FA60|M-r7w{B7;Tu{+Tf zAS(zEDTn|h+oJY65lYrVKa558+Y=9U#Fm6)k{F6pDlwvYdaR?f4Z1c^FQk|;TT(9z zruh@0J$HvK#vs)440`GSwB9P;T5B9Sr-j?Q5)lpa8A|3QV_Ch{g0Ze>QoxA)dbq6} z-HN5L_~N4YK%H~jlNk-cq@>(=TdTuFb#$9dIOxK*Xd)C(&Iv7@)fNpU^pHds+OPTZ zYNYV;?5s??k}=z8Gst%I=V}ggg~OqELT{G*YR&DSrZp3*dO|W}bU;Zn}fnmX8a z^4g`MPLDt&CGAkjY`N6svaaaX$YOu%pt&fsXKo;J^tOz zk(?V3VOa4{>#Tmh2yeHZ1JBn_fpl$9mtmO6K-9vvWF&)eqk-)jDP>EwFq@LoPX)Ha z(Mc;|+<480?;$=Nhv`C6dZN*o%cQ@(ecK9}7(%Ai=5KF1DwH#tk=vdRyNxH19VZ!F zlI+l)p~8U`M+~4cux!FM*UKrBC+{iO%1Ir|CSgFKc+}sX*WBNstJ&$%XtukgAy2na zp60CR%0toS`3({3;Ohjb@YfT%xc&ig5k^8ipj{bA1GUjmxD$_OnX?x&t-Hwh5qFo*JG|O1} zLW$B&KN86SL0PeXaBQjDHb_p4M5x>Lr8i3(ef zCqS&vi@_L+`lX5pb=mSA|62004x&ELh-b#rsx?!y*MwQ)YYeQ7qJ>Br^U zw$}hd4aJ8Ia8$V^BXcvv(XL=A6Cw-RQ|b0bNsosXVI~U^zapp%wKh{(!nMR7Z}Y<% zJrbWljf4wP?-FQUBHu~OqMG?Ze>4__K9DohA!HaFV%3H=m`HR{UAQ)LvgG6c>!w$!!+I9r67*hwTtNo*}5Pi(tFgG&oK;ZdZqP_77yKQ{-FmqW31 z8*~aFoA%nM3>20nDJCO#ARhGx4+-xt>k1oy~n=}S(iNC!oR5n0+9iO?~pLsK< zyeK0OXWLZKyp>y+=f}o2IrLBPMssW1BJiNwFL!eU(fz#Togr5y;cg~1S`-bnx-yAE zXYMll!vVR%=FS*;T3&-?a(?}+f&n?BIi6_8Ten{Y%}YY@w(#;Q*?E3$MtT!kX`MxG zL~xrcuMCX6)eX}t=TU_0~QU98X(LOqI4_)@8mb)JY~C4K8=dAcEYe46*IBD@c_PofKsBMYd8atEyCJ zWHH{&HFeYHH#E<#oKtyFbv@~++`>DmP*yp2?yTDBmGi(T*q%LiR`tB<(wzC8?)c@r zY4hjJL!GL+g>w*ZCzHhb(x`V@<@AG_53W9}d2W4mLql~{A&v0h(DJ$D+(WG%$Yahy z)y>s&s@(P_ygJ&N?;soIRo2hTv(XJne>~}u1+{Yya!DkdPx18n>VeF8}1JMtzI@Afxrw?jTFnxY~LtTCI{JB+?^Q!YO*Vi*;sdISzA&f%W7s- zAKJXIb`HeaTseJS?E(~+5YdH*>0(PO5jT*VF3+u3Rh_9>)?c$KR-~fhz=K}%x2l$ln<`mfc%_;$_7?$KrXsy$eikh=&*KHRdbHMmu@5Q zE&$K{qb48UKk!175lfids=7JV*##h8g%EdGZsBxWJDQ=8Rfm=5)C)=tsh9DoEY#~^ z88FMN9@Ue%$AO+*x1d_LBPitNLbZ|Wgd%(FoHQvLLnh@QZIiOm(xki%)w8On+h!pp zUX(x}EW=S->Y`yr-9nLw#Fh@R<>(k^))^#7j&|LQ&QuJjSxfp}KYuP}wLGV?+@8d{ zIx)ZAdG(cZ8fxn5XJ?qmMih2kyF#sGQx3td&_-;^VHD<6z`zUoi!t~j+mN#?7uts; zS=WWd!s)llgCN%KvQ?8>tVtctM|!>_FuQhMo?KGVx}z;wo{V+Q!iw8IU{jJP55!_g zgf;%o{sT$$Qbb~$9qUSjrc0kPCga9tk#CNoVQsW7iOugoYCE+$yJFOoN-!_BjanWA z@=zWKHIYx-xy%MkAg=5vriVO>sdjE1^4k&%BW(!vI{m?rhmI4IZAloLD^5p~*pL*U zED2e};W)6j2D_OfrD@COW`kU>Bphv>LpKs+1x3+J%C0>OE6V)#WLpO$UW1^9{J&jN zZfnWh`r6r*^@laj!UW968ssQX^`Y}f^{cY@hJ444r`Olco#$lgs}I7I7uuNxmG!li zbLKU8b12XX+fbP8iM(P%A=WRLQAQG;a6HywN8g4`99_wG^R&a7Ypb@es;;S=KWm=T z86ktER%+3~9I|*s{*r|rx z{>*W%cYj5`jLcaX2Xg{$$=;(AuH%Bd%>*Yk}&L&H1qTKNcipzDm(b&(B zui7eRi6{(@g>+gA#*Nq8L(xUa$o9^GVgF%aWy5avfnlJl4HgkC8*q0q)xL5t2O_KN zw|z=T+W|y_*vJm7B;_R6_mEw2#9t5@nR|gXbNryk4h+vG>%Yq?!#g@pkN9Ak9 zDkc!uCyba~;CAje#*Ht`rerNQ?ZG5rLAw``M5M1L<(8lz-sN=T(x!0(gaE}cVGQwg$>n+<7(#}X4f$6 zsr0#gcBiccna(B8F6TyO92@WPIq6WV?i4!LG~@D@b+p@bFtKcEMHih7f?zC>*rioQ z>OL$WQ+=)sJB75e&&}>q^n`RXZfq|?VN7JJ)M_U%g0?Q-idGRA2-(Vys1SQ8c~dmb z9n4%5<>y=)jnnAXXq;y$DUv*f$=p_wR1$_GI!zvPh&a|UmQVwG?#==(=cZ{~VPN1r z6KTDDW6~M37u1riE~CbkNM-V6<~Gzi)#sKdx!DUkmgULbS&b9E{r2}2RK^!|k?-n0K+QY z$_&f5ZM~X2?APS6j|U+@e0r=kRGD;Vr;X0!D5#XTQdQ`v6Z1@~)O4q^MmsR@(3OZ3 z$X1yprC z+&?EDO^$VUpHzV`)hflan?KtF1L9~*pEZUnjlP)*2}_Q6t3^Cb5&AZw*fom|)`WWr9RHMFcQEH721 zfig2M=N5)d9N({;beQhToEK~*yRn61A=tRjKHc|?rIO1=$N;8&{>uS4QWdj zIQ-b#eUBZWVmVx7&W{rBWC`RZ`a87GMSP?czM=7L-=XBuYBw+5wg@8Al5`!f&8wYV zU7s)0ncES26EVQ;3g~-hVPe4d1e(0hhb2HabUR#D=lJL3C1bN+YG zy1&yOXv3f&I(O#Nj)W_d(hwF0Lp#oi`Q+h*FLN>hX_DmHvTOd>A<&CMx?uHW{1#RU<$m6$JnS*OG zuj*wOIqBlahJ`iR*h5Z$oDAo5kxaKTsU_guL*j^7Ta@{jn-wq*%hwUFRWIx0|M(~W z$I)z&fgM*nMLaN1=c1O*$J>)07_t*p7bkKqVC2z!dDk}MW*v)UWqUhoV@I&XtlemL z+IMDKIus44a7Qc|GCJ)lY!}wdmhrY-n4cZRCbPW@!A{-M=v-UVmkWyVb<#(S2Ra)S zp=6{DYra1q0*GluaCy94BqM&mNVWx%0-@$&v8d~axQK)TanTxD;z#9A)k}>KBXQKtVJX6CLf#J4DBF6d;iFgFw7XU>%K!q`w2?L+xGEN1KQ)MrE36 zfnAb(Bt=IIY$TS)gFLW^2mL&h;73Jxaw!i+c`(6)NAXraZ(Yn=Lp;>Z7sYuf%DWOg z+{VLk9trWbb{^^CZ3*6%10fz*&J(E6#zRRS3i0+OygkXoe%==6OWOF7 zD32`X{toUxiif&*$71de^P~KHv7avr@oepHtlO~lkh#}NQOAOVQ-K!OMS+#lfnIQJ*Ge>o38t`Xh} z#$!Bugc^>=c^GuT47y&zBT3!{CfoVq4&LtP?E&5%ct<<$i1DbOM_YL` z#G{b&avtm8F-R}LkL=>{D334Y35>LZCt^I2;E5zpw((>;PlDA1UlQU=V|;m=8te?I zt%(2_NT`bvOVtR{@JcG;2Q}K7P@`=a(UBNYEULna)a2rJHQ5nSlbvm9a!I>-Q~)!- zm`A{PWKlUQ7v=fo-tyA&VdW#seVU>v<>SgHR7}>CirVs-6|<0ESW#H$OYH-b9y1@*CxeVquSe~I47_89XMTRIg zM2Vr58ElBb$_+Nu&?*dlxWPsk#wdf2Hu!diYkPz5VDKFc!!+DG8J;nQI@ZV=Z{+W6 zxU5k=w!Oh78+p4Lg;R{e-HgKB4Zep_xTjJ0H=}Sbqi}DdaH>(bk5RaHb`V6zQ2$6$2^n`^K`jFNhzq`@ee zXOzr0N){NUhZ^iK!+W^F{$a32gEbkf*6-$hYrAEavqhh&Hagl88=28j|l>L{+~@!yB|2Xit0|Z_uCk z0^aCjVhV5c!@7}9F7`PQ#(6R~ z^flZ#;54L9$9pZ_XW)G%-e=)`Hs0speJ z%aOhUa24QcZj=L8ehn1%S^yMu#P!@5xt<#b-T=4}b#8*j;azz%(zgI^1>6p}18^7M z9>9Ho2LKNN9tJ!Dcnt6a;3>c}fad@&0J;G^fX#qjz{`MF0j~qz1iTG+7w|sdL%_#? zPXV6;z65*?_!jUT;0M4@fL{Q=0sa82P+@3*;{eA4P5_()SOYi}a5~@&z*&H^0p|eD z1)K+f+}Zi6G3^4RF9ci!xEOE=;AfJfYD`~;^ku41bvfV)z?H~f1-Ke;4d7b9b%5&u z>s4cq8}PnSHL7m{+zhw{a4X<8;BNBeT`v4CB9#Re0M%AdMtSpifYVw6~6rqq~8R*MWX|}19%VcKHvkuhp6)r z-XG)r3ErQohWHWhp8&rA_JvUK+7C`l7;}#m#*D*^8OPzZ3UEANHQ)qvdJ^Ddz#8Q1 zjTxs2_hG{QmMYvQ3E^G@?e7CV5F<*EW9|o;3ddXO-l-J6wiLdu)TsR! zOnf3nlo_?3qUzVkeJ|YaBNABngBUTySokBD{|WFj;1|HJfZqVW1O5Q?0pKqduF#By z#{gCWj@3q#yI&IJM(rBS-L00pPtlM*MKfwo)kX|O$x!!)7}S^w_YbVXeHN0V3f+HT zP}>){%|iDYuDY#)JGuR%0fjS0Nv7!ZD*?vncLjnHcxX%rO%sZX<>yNT)A8WC5DMoU z0U9DLS=S&sgk_xacyN^qAUxPAqUN9kRiL+$`Exli=uh^kxE)~5`_KMRS7qQ=adD>N ze@r6WSp-#(L^5yZ4+S23jJfQ3(4zXSt#6j=lt)vD19Fb=O3TWe*-}bL6hm?!PP0K$?dMz+LLiwzl%qEn*PU9q zl!j)f!t>`-VGFvD=qdkwUjAR05$ZdqL&lVhL1k@C6a!T(wjpTnqhlc4gFi+66BVZ! zlIBXk{Hbu>82~}S@(bJ*ic91>f07qz*A;_ItCX0i;DcsZageguo>WTY|4EnLKk1gU z{EWrsfXzfUqtatoHZ`0cBeK~+B4EnM|H1fW4}T$qAvpx4amopkUXAhsd2a^Gbxmx; z9SN7q1r75+TcEQpSB8>Qt^SFY1*1fkdz(Fdl=F}bD_I8mc^U9G$f^xe5%}X$#if&) zkW-W6E0y|_{nMR#ic9OSHbAGOjp@0G(Zuw2J2*4W$U~HImu+I?Fl>G0Qiu6qUxV&A zoFsKNsH1`0<4=dIT}EbRsKqX}ieK7lFf&LC$oMFUwK)s0C^aZP55dsn7-rZ6RMH>Tw8&Xj^Zm{PPSQ@np;O7UJy zDcKwDYbsO9_F>A9eYv|x8LsTd-Nni%&;CpqeE?IoJCG^9N~UZ-jVU`!hwd}AiWa15 znXIANI*5FoXNJ2>*@@K>=QFu`h%&C=V2mIy4>ZQlV#~`2Q7pltym0o=L%Fi&p{nw?!7@s8nj1vba*2$&_}c9NfW_S%t)r8s*B|7*`JI|(QyLMJF*j5=a`ci>BGs4baoA+j!%)# zQwi_!oW@9Qr^8Dec{-d(d@Wih&cGviCLUd9;j!dwJeHn=$3M@-<6r0DarF6k{QCkt z{&OK7E7(PN9>Xrib0xb3&tuu8jJR8e=PGs?p2xGxS*1eUU4i!rcwdS4iFjXy_epqP zjrYlTUxW7=ysyRk6uhs)`&7KI2b{*%<9Rx}0nfGUMm*18H{p3E_Ws&vh9_N*=@j&Q`XUP3thOG<=>9MUcqk1Xs^Uho}>Fa@Vpv3d5*5{!t+|};yJp# z2hZ!VgJ;Tm?A@7i19t9AxeVu>lpjXv-E0${_pp)U z+`B0EvF#s0$)ikp46nzT@&uDc@FXMKeF~l2&z`oY;~8WgV9(;*fM zLS`fDwlisD9!4n5l}+qLMyj+K=||WWbp0snWz^qGcs|ZvX4L5`cs|Kq#q%ll8lF$H z*YSLYy@BVm>`gqMV{hU4JocPSd4c_hDJk|2lHKeWJk#u5JbT!q822P}r9SKMPYd3A z_K@C(C?>NH(7E?RU`8q**{psnb?y_e_Y(UAl7E@eNMDg7eU;G=Ut=`3*BK4!4Mqcb zQ!@FM9M0Qv2=7Sd-({cT`5yZWd`wZkV9Mu6?56y{lu_KhyYdSw_=1GN*q8R}EBp1e z)bwxU^IOTzcQXCG&EXHA`748S`HlUE$8oYaO*w(HU%}sM zK4h4CFXdz|ev`ugU0UZKC|Scv^-ke^Y?ynhaysXB1wyXn6`*h#FId63au#2~Rpo4c z4ASS|sVe94l}Mk*kL64`pC5$(p=K*sYKVPOVK>Bump=@;#(i@N($}i?6YQ-hIL<}3r zFXcKb;_5oCbC+T&W3|hG5La?`Iajz>Rj=SW;zadI?2}OKD#Q^kWs0(gQm4!pS5wvN zIJ*W_1r0^bSFYp5>VhUEkS)9(g(tv7QCfnL6|2ETN}Cc@Gvzm;+%AZn&9n^mCSYlh z#p*fiI>eagGStw{V;8dBGF5H?%i=c9ZUu*81829_5+0$GfDL&xr8Lp2KA9409*GG#_ zID3xk+lkLOd!Fk)@daluaD9966=x}~?;yV6tefjQin|y~bKMl*bJoN4oy3ovy~y=3 z;%Ck_bA7D%m9s5eA18k2te5NKMIUD`aeaa~MrAK^eP?m3%3k5RC042IRj%(MR;%na zu1^#vs_b>HPZB4q>?AhP<1D+X6CXE1}Tj%;GZ>TT>{%=7K+W6bjgczfkuroe4( zVaf;0m8tj%6yihnDRzDzvCmNPWA-^O)<0oi@M7ar_9ZWNea61x#qQ7HRyqfwWG|8*0KS7bahWaz~$m>#nff{+;>aWlu zuSfk2w0>g0gVxV%1$X^{_AaFl&AGBd)m5$>gS`}2R;s!Nccd1p$MEB@r&`HZsm0o{ za1+W&T+c9eyb2B8z}RZE6nCpMlY(aQ1eG+Hu@hBjFxIrwcvey;QIq>sYN|R-1vQ0Z zxPtRct&^$NgDMP@tx>T%%g?`_vrOTLa<-#j$_TbE-0qHSKcVn3%p(+aS2h#T@9xYH ziZ+Lp2t}XA3WZ`cvLg}Z`q@7PbBEZ`Lh*#zDVSSjgzGG(o`8Ks!M}x)cN`M=h&gV? zyAVOfEqE6pw73m#?=6frVa4w=?LlNq9>Sw^B%<<1kr?tm9_3#$EEz%>x{9lx<6VL6 z#;{+I7!F5zEZ!qdoL`OTwP~9p{|>GI`$SQwEmU~ zPpDg~a!T)&3h$grPfdk)$)xv5g(qgx`=-K^GU@$N;mMiw{;BY;ne+jv@RUsYz*Km* zOu8}^-aV6^mJ08YNl#CO_spcLQsKX4($%T(UYT@FD!g|leNZYqHItr^3h$FiKc&{4 zp)&8jijtb#J^65D!j=h>ckW<~}Z5N~JUGcow*)O9j_R!(}sy1Ma{ zWDjCveuLVduAZ&Z>6qJN3s_Z!2Qy6q-ZDAFx;t3PN~zQw{{yLWR8zURq)1UHXDZ=y z)fHG;6vej!D{Kc(HS(EUiR_dzS!7JAaoo&tN@Ogma^L!MCX`_7J>GgrrTm5oB_8A` z89q-Pb3=)#&}5GBpRam{(E!slz+Pv7#5;Hxt8DvG0!hh$x&UX(jp@` zb9+XoCa0{|s8-6C;lvjio3dV)EwP2sRJUgj$gt%i_4bkiMWMv%@WtvXFVBCS8%l;ioM?T-x$1bQ_18{o zS@j#4!N^>y;r2X>k@;45f_lpOmP(;QY5DAt&w#LB+Q2T3vb!K{K+}LQm0{QbTi>Z@ z`@L+nDyXHbA5=6%qn7KCsJkAzyoaI$G~W#w-S}B;S+Cx3PRUTv+eU4J(7)1<1A4lr z?go{63kW3#^_w%OZwCy@tzxe0<(RgltltOAW<(C-Thieh)e=on(sehf$~GwfK7g`E z6>iTQNx63{X!i}KU6w<;w+FPBY}p3UzJ8)<%wwLWd5TVx4z3sW2jU%qUi)=u^m2FT z(kMeL-N8d_YzGu#g&=C0oga~H~OD#azYs}z@PpmTEN4pq_iQ|?q1 z-L2%45VveCM7J%(nFEFBTSZbl(dm_ZCgie}ID57w&UP*bc9&Y1PsL6qNmLu%Gu?{a zqm-y7CCcmWmf}Rte-9FkGiT0JY=+wPvHpYUm94Ci_~)pSu3l58tor{#`di7to(5|b z;nn$U2K#3ZHk~Mv}L)axWs4%UK?7%|u@ZJkirSW0aI!jn*%Q|e`%!d)icvsr1ZBWQ%Bp`+<#uf7Wq#kUPHtD7Hv7Q#9=`<&{zrmcq(WIr1>Fuf8q$)kq037v)E<^VN z0>~a)=Tp|X!q&QgfaXK(6s6ceX!1oiH1ScqVY^1vHf~`Xx8{T`RnmMx!Z)AUbu-?N zR9>om#`~$Z_Y=}O9#N&046;z^F>MRg>|$wEj)h7`pn+5WqpEkmKZ{?eo^_ZLs#(vg zPM~HjvaNN#>VHg?G0yqIsXc@3eHpt-20Gf~Qp&f>K<5cqoAh?Vtvm^9o2ir-x~J%A zDV?Bj#3Kdrl zYCplyj>aoTs>+cHjI@kq`5gWyBONQ(w^aj| zx9n8^?+iLnjEE; zU4&kcW~Pq$zbL;wUtm2_WAs0lU`nO)i*Bq<*sYRBIdyA~0@0|B2(!}T8R@Z%^rY1| z!{B57Zy3I9@ndGpqA{q?(HJE6Tyn31`*M!G@R-!(kkY~@w~U+Il2#|T^Z;H2nE3Bd zWt9Aj?1)urC}XOy_jMJNbfqR+*NO$?OowIi*V*~uj0sIo(ViN$N1z+EDANr;l#Pn) z3-riiI9iImw)C?rKgkcl+NT&;MVrUYWDfJs0bkUK`^n7_k_2o=7FUX z{;Gvj&2Ag(!yRqV5aB3!*O z2nQ3;{MF=8s2ZmhePu*+B@wO4v^B+5nQ}>n|0Nl{eUR>ULKWKnsmabBU^A$N??F_Hw~Q*fWrDEw{tBryp=BXSqnft#KEZ`H36b-v z%_J(Na3t|{5G>ZZ0W42nz-mJ3s?Ck3tKIUrD^+uVf@a%uD8UdYfiv5-bcrZ9+kt^5 z3_DeGpk%DBQlYMPBzyOQ;g?j~;Q6S?eg{!d$u!+|AUiRp8(9Z21`V_dG2h??zw@bM?QXLLv2V{o0@r&;y3Q-etISl%p2fte;R!2P?EF zUuLrPC1apMb#tY~Q4I`}2q3|rdv=P;R6wi+7o_4t*7T81?@a$D@5ro9Q$+uU%F?#V zrt9X=k%%SSLc4wNaJotNgQA;M97EIWq3HvMrh6CX3{8VX?U5NYGFQL|xG*x8%h+mU z@H77pN2Xz98hNK7r}Xtfj9?4A??T@Vj=tSlbp$3y$m9>(I^cCM;s4`$4?H=)H z_{(n5#Uxr|4cquYZn6f6uH@9^A-0m7nNg(8B$SpbcoDY23l!v0-Yu1;Xp({4d^%%W?h*9EuKVk27U*%n?GRlbsETJyr; z{jI6KdBC;Xta@+>EF_f*H<)7Gge{SVw2Paw%H)CT2bc4eNEbPe?#NQ`nn>lmYd0^ZIw7B{}HT6c?@_f=L? z%<69DylFjeEOF}Iz*$WR^RMT0Xffc%gKC|?W}d(ll#X(7^f80&UOQV}X0#57WJ4J_ zeBj8zGb(a4@L@*(%D9xnqW&m3!l7klvMpwA1;f-G!=PvXL0MbB~&5oR?o#}B}C!&p{lF`%(nsFFrwA8YAjpwS)v2=K8wvyZ7O`WOWi zpQ!#%RJ`9~{`VN(zcK%BtZ|*1cJ3nDiN@|(8ms>+jhwa}9BoHt+nz*i7`4f%6QxjM z(A>rdSDu>Oaw8`P+;k&PO;h|ga^#^Xohl@AI`&M^Yq1zBhatZFl0N=LO_VBB!xb-NlS_C7~5*`n7ZcvMT7o{x%QqeBX+~ zU;+8yAhx_%r_yv&kw%XRd0?g_f<_OadU8=Nw03(B!HSj+xWSG?kFGo1J%K!l$xn3$ zJb`>H<7Y6jqHsd6fDS@wUFw>E6-u8FEDRL*KUH0YoALsA0oRa6`uaAx1MYw^3Df^nYHsnPSSk zBkh-p0-oaS&?##Eb)_9p$?oK@>(TlVK8cmkz1$3Pc8`djb=ISTE~Oq5w!3RQGT@n} z)Evn$Q!Zp&NT&Tuom7uMkqWp1qV7D#F+xS@QguzQhCc~^r6R(z-e#DNfL5uvG9#KApo18&<;Wg+*-0nN zJh(=g!{W)|knL_e8wdQM;MNVhk)>DEy z$VX6Ut+V^WECw*Edb(yURLB)XbaXl^M&Om|sXLpofPvvIC0_-5O|^W^x>GebFvT~f z=4&oM68taYs;=+S9sYxb?_f2nxw3Lg%PCCe?;*LQ{okl9->Sq|a|Af)u@ zNEjK9j>6?AbUB5`(^-xyQI6UsD_7Y+ER&Wy18e2#l!YG!0ik1v)xY7<*Zy9}i$!ti?_F~;>I8uWa zh=9H_=<%8)FHgWdny5i0E@Hu;C^_J2DO^poOPG@5 zhETkUad_mth;lDc-a<#qnSs#3av_nI$I89w9!Xyl#h=?fIb;DQquwpe8DZaJ?Wd+uCvUi0(hyym;|6br)S9QzCItuy_)t1x=$)-PtEoAQZ9(Smi6ikj3-7ah>9mL zVQBh3vLY6Jr>160qY-<2yJn4`z@Uego|ey8K<}yfoFi_4p@PPVOoOjz9o(5Dk?9JP zMbtpYS+~eT=+ZZk!n?c`BonB(Bri3+<`Yi#w+Z7#VDlCN8|v&NCZG}%wl%Wj#enXL z&|MKlbSKLu;|Dj9x4#2gc+tX3E!O-`TfoL@G-`2*Y%zHoG8nrJ8Pu#6iuJNskA|np zhCBVW@Gv9TNTT*>jQ;PBOw_Jh&y*ftDa8Uk-8JVU4k;uh0hOA|D1*wUOC@L_OFosA zke5a%eX4C|()0@n*ODJTL9EE%+-=oTv?aYc!Y$-7;ntRP_(a4Iz3K2t6iSE``O3Pr zOvUy`h6-z?%a|e7n85DT)WInt`EMRnw0S?b#DuSfHQ^O;-z{bhy zy2GakGVQ-ProAJI8c&7GT$TrNG%mXdUM$;zNXM+yjf13JuqilG;O4P!A}I{AQ2 zwhsVvXJRj}=?mau{$iuS%SH~|BxLs(rwQ(rVsbVbThel)k(L_`kjE3dKiX-XE}Zku zafcRQ2Ydo+Tr2F2W!|XBzZ=i!FV08taU{628Euiva<)-TH*u^~HxcD?XzwY8gYlbq zclb;}=Lp3ZF=f;KGihw+Lh!2aWUD}==gC&P=Cs<9E-to@1KyzHfJ|(hp3rOE#8IOM z@h!Q6^Vxvy@dY$6wHO0C%Na)DsL0L4HI`^pd|u6E`xb89#v`}zrdzqSfk$rTO}BCD zP9C|9H{H&yyLsex-n4;R_wvXF-gF1I?&py^c+;KSdXPu%XFVtw(v}9^P~>w;tz_dwJ7++wC=WDQ7wfz7c+t7xfD8Z3v0PVZTU!T zL9~90jCU@Pia!KpXN&CVS`jq+7SfSRrDh{SYI=t+Q2g%@{dEHs?6Rzao#QB&cU0sy zYJ54%9M0XsGN*GNFyEoYky7ApW!pGcx=mU_5h{MnYd+>mcg?wi{POKv;m?!!4Uz~J z$d)xcyhbgig>4OQe2C3_h$;Rxs*Og)I|ed+C+k1!xl0B`Ub;`QBgu`-u5>q};CZbK zo_Vit#YpVoXm>_iWWDix0e_A4l!6&-%QhlTa(Ne!C&N02kf67xW#sA=Bk3+FC4YD8 z-CM@dPq7vGSP0T`PdtY9!~tY7P8zEzq5_S+T?**8m*}#|vuwr`mr;BLoT1BQP+)Km zQ?cG3Ie@c~#EE8eqI<{L3$fPE358r6DG0hibW^k#5NIL;6kRLs25sG?rHf0z(a7$Z zBN++-eiDK0seZcKe}QOxpQUHM&q(6;=1A^7xnSgFPSakbslK1lIgC7Je}u_BF5Ys` z_D96|pz#39p4B`}G#}h%n`haI3cF1O>O9on<~eG!u|NL;jky2-V$^WgUDMhwHFFP z&b&~t6&DIb2p5T&7YSv>MS?CuXszjn1i(gPzFeti=0hU>r&wB^3LyR+-*TNAzF5%n z60u%Ryq@-7DpHM)vzd=GCGr^dH;=LKI{A$lI(w7ZUkzt)Ct=U?_5j>4c}n@#0G#vv z@qco0&R57;9Gy_rZIR33V=_=#2NUQYP;bv)jK}&=^lTte^&mCIfBF9j|Nj$Sv0b=A z5T}nzE3UEiK}J6`;l)#E;xU`FbYjml1UvT=)tN)&o+srarpD3~kBxNG;{|#=O=|pv zR1U90PHs|Pm7CNjnaVZy&vXEa?n}NP`jWMh)@-tWguiTKguiTKhJM+`sDIhUs57`F zB|A91Ex|gJ3Ln!?Vu`f@h<7DIZhGldeX~4OALU|F7{l$h@*`-w2FtC15{%U;;W;HF zuY=U(SF!8Z>FP7=A@&4&My6h7Z?pGhN_k4o!vPf9zQX=e_K(ox$v>Nbr%BHGGRJ=H z`OGo8Qi*ANl+An;x&>0G)$MW!e?dSj+w%T`wLUZ!Y4?Ld0A@AbBumb@Qz$YhHM$cvpr=k6|2E} zcD8yQiK~tuEJma&`O7(L8=`_(TAs9}yd@?$Ehh>hS zvTUuR#R@i^)scR_NWfc(^&non{Z6C=*Rp%q1GYLm&*+E+dkRP3gZTgR+lv=i=K5rt z4Kobd%`>^dL{gH--k7E_qzC_1gx%qb)qxi<-I*n>I~9JC`A;TSla`ZTC#k-`a>Zr$ zpVg%Q!l<;6oW6P_-C2&FY?HQZ(%mvd{-~vKNOz6w#9NTn54+bKqA#-k%dgD?gP<)r zOL;G&Q{+%)DgTgl%b87uKh5ez=Gto@hOWH^VvgUc&WQss=hI4p*pV)Ks`&S*9M@TC)Dc$P$@#aF#we&)SClPn+f$+|9Ke(UkB1) z<89Q^^e1f7rP%62R`(KlwU1b_3{#MQozd0SN6g`revFf`jN>zwVSl$Ic`P}?Nv2uJ z-}|d(jmY7<)N@bJ}UXL;pghUO}V$ z$ceNtgf}pRu^0j>yer*zi!BCP2I!qt1$&W^h}DA;wj$&pjvrj(#4G|Gy_Yd8@ZIg` z>icppG7q>bovlR4sK|q?@v8nkcPVxz53$Cp`!Qv}jBLEdX)t6|Bl_648!6TS3xo4e=X zUMla&mVesU*OM;FgU3ks&>h_Mg3qu>u|A>?tVEmrT@js(P?X+HH$YCDj|i}&hT7TZ zX}$8E(XQq#m)D6}%V!MF@OmK+)7Fbk^mU6E@=jkL{SvE?!mV`84cLsxdZ=3{2K$IkFBK?hr`&qUh!X+aeR`?-^2-aV1~!pU*kI#^#iIn|3`!TQR{ZT({c zJ_5TEZCzhq?tefj$|p=<-2ZWI9Bb8_0pkhddSz9LNxdc`v6r0QsSoL>IsMb3qx%f2w=bkS!jbj^pS zOFrH5>5<>o=TW6m9Yud~i+JGIY(-f|VTh3)5XJe5O|tPDF0U8A;jrS4{0xFSh=RuN zC|e-EDgTahyLb78q4S%te7ZBlNa*FaUmHVgXL;pFkWXJ3ruzCa+!Hm@jt-A^7e-WC zMmZfApi=WYx|PFdFKo@hSF-ULR8dWxf-KFSdk{{her8JXd(_{b5S9bjPd0YSiG3-- z_9EFPk1E&v#N-Y<(?y<5f8gLeL+)}$=91L%<;dLqHPL;=Vn@}{Da*LpU zSm7?A7+&RWp}4%tJwkDNm3xKa@hbNTB~K{#3nkyBJRp<;m-3)c3d@v-gi`=lbWWi z7`3J4d!Fd+-g@-(k_)f&=DKs!ZFrw$&Mo&wQS-1+K(7ZR$_}7gI_r3i{AhZN|9j>g zFEPJ~GMG_19sYt@tF?9hFPJxz54b4X@&o$!CK)Q*F5Qjwh>ivQgo0nc&c09r!#${b zlRX9S(CYdUAAOMYH3-qTDMj}_Ds3`bek7`+nbLz)e;cu$e!-s(xcpzTmY=A~uULza zLX~2>3SU2=xW5Od_E)UsXR7@i)&7}kS5g&^b%J(_^YMzuI#KKI2xGX7v0Jb0{_bBv+$qf)$?WqhbeTlve#Qpp+kB!eYpQE>#o@(ScyDpLI&K0AAv5F6*!0^ zHj44yGAEO%QuC-#!0Z&27jNk6bEz(#N?~Ga9utzA6vQRd-%$EHI}M(~Uor$Dn5|UH zFUWntYK~J`?RPLMgQFe=OWDEIe!MF0$f(hAA3kZ{z zqAaIyxW5h1WbzqMec!^@(xP!|5mt>qxW%l~H0yNDTB})SXx5pUb(UtGty$-2 z*14K>o@Sk|Sr=&5g_?DdW?igVmuS|dnzc@|F4L^bHR}q^x>B>Q(yXgB>l)3vRB5 z(XP|lpv~vj9kT3BD!WT2@22EEGIzr;R3$y@tLJ}8q9Qt~00e29`8 zG4f99VM=b2*iDptL?$1hxlGv9h`7)-s z(|U!HhY|8HBwm#ryhga!W%3P5z9}2MMaj2i@*PUPE0gb1@;#Y+kCN|8svl7DLy7%} zk{?4uI;~GA`KiQyDye@;v-DZNxIdTJ&nfwZ#C}Q1ub@<&*4LE$Mq&AVn{~H#gy$ zQu-(0U(&+gfd2@52>7p5cm!A%SeIjUh+lVO+F+{;n;bOhCqh^->8=nKO}aaTLnhrB z!o8-Y$*_YZgLX@X;fQJVaMV>8GwIYG8b^h)Nt-=X0h}-`bJ!(lJzl zkBTvh`H0ntv(j-Kg_(%M(h0C9K^8$U6Lbm$6HKRp;LT!9;!|`6WpHaTTDS&JSGwum z;@EW7@Cop1u}m>JIwwjQ4ty{SadkS6vI`(f(m%s-5S}8QLmx^{L16WC(QttL2rSG= zOj>4^&6{lQ^BPJuDh||;8D7y-R$U@hEu7e=Dh+Bz!h+{~Yp&N$h{U)lw0_heAf)3pV zLVS_HLwCR;LeO0x*eC@USePiSfYd}T$TuPq1pY&7Am2*MAm4#}Z}`G7FET)W5PJjp z5#%T78^|vvy)`rH*@EsbYQALfm4dG`-1j7|96j`_VZ!s!lZmnO;%G09!u=XCj+U%C zo5M5A{$}W2I2m3>WqeyidPzayS#3wKJy+B#`KvxM4x;70)tVF_{XHznt*dP3fWNEL z<0HGS`FIsyR9b8QIc}j4wy;)ft6yuYJ|qHna`nMTV6LH>l3w>$Q;W@Kg8@Ia_;jd- z6FK}M5&&P2wb{L@?ZI_eVO@%X?b++$x>Q%v-uJRMLasY$li8ag^K8;S#O-lOMcd5A zaJu5V%v3pNt$Q_-H^+fgb|H~;P4iaozuSk9#M<@v|^GR}HxJFYi& zitA4)6F2eA8#PC=p~6?GlFjW&8@1|dct{hS5tX>_**k42$qyhj&`z~A{0CK(WOSE@ zzsGiQ*&!9~m3A7JIcjQKhJJ??GAo~oGNo{zD=+wtsF;%6k!+%+T97ZRzJx!RkR|q` zD%z76xU8vO)+xcKA5*xMeUgP%bn3MVBpq)zv=b^?09^^KDV4Mph(4+QX909ksSZE( zQuK0eUIjHfr-D^Gsi5;T)0nL)jO~JgRZQSva=)^(IQx`}cBSSgu-0?h@sr@sIDQ)Z zS;tqwpL6^y_z&a*9L<+?BH+BMFoy~k96t|!$?*%|msPZ7uNL-xTheaBZ!Y1j{wDW{ N=}kMC{SRmsVf86^2=M>_ diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/aes.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/aes.js deleted file mode 100644 index 3c1ddb29..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/aes.js +++ /dev/null @@ -1,1091 +0,0 @@ -/** - * Advanced Encryption Standard (AES) implementation. - * - * This implementation is based on the public domain library 'jscrypto' which - * was written by: - * - * Emily Stark (estark@stanford.edu) - * Mike Hamburg (mhamburg@stanford.edu) - * Dan Boneh (dabo@cs.stanford.edu) - * - * Parts of this code are based on the OpenSSL implementation of AES: - * http://www.openssl.org - * - * @author Dave Longley - * - * Copyright (c) 2010-2014 Digital Bazaar, Inc. - */ -var forge = require('./forge'); -require('./cipher'); -require('./cipherModes'); -require('./util'); - -/* AES API */ -module.exports = forge.aes = forge.aes || {}; - -/** - * Deprecated. Instead, use: - * - * var cipher = forge.cipher.createCipher('AES-', key); - * cipher.start({iv: iv}); - * - * Creates an AES cipher object to encrypt data using the given symmetric key. - * The output will be stored in the 'output' member of the returned cipher. - * - * The key and iv may be given as a string of bytes, an array of bytes, - * a byte buffer, or an array of 32-bit words. - * - * @param key the symmetric key to use. - * @param iv the initialization vector to use. - * @param output the buffer to write to, null to create one. - * @param mode the cipher mode to use (default: 'CBC'). - * - * @return the cipher. - */ -forge.aes.startEncrypting = function(key, iv, output, mode) { - var cipher = _createCipher({ - key: key, - output: output, - decrypt: false, - mode: mode - }); - cipher.start(iv); - return cipher; -}; - -/** - * Deprecated. Instead, use: - * - * var cipher = forge.cipher.createCipher('AES-', key); - * - * Creates an AES cipher object to encrypt data using the given symmetric key. - * - * The key may be given as a string of bytes, an array of bytes, a - * byte buffer, or an array of 32-bit words. - * - * @param key the symmetric key to use. - * @param mode the cipher mode to use (default: 'CBC'). - * - * @return the cipher. - */ -forge.aes.createEncryptionCipher = function(key, mode) { - return _createCipher({ - key: key, - output: null, - decrypt: false, - mode: mode - }); -}; - -/** - * Deprecated. Instead, use: - * - * var decipher = forge.cipher.createDecipher('AES-', key); - * decipher.start({iv: iv}); - * - * Creates an AES cipher object to decrypt data using the given symmetric key. - * The output will be stored in the 'output' member of the returned cipher. - * - * The key and iv may be given as a string of bytes, an array of bytes, - * a byte buffer, or an array of 32-bit words. - * - * @param key the symmetric key to use. - * @param iv the initialization vector to use. - * @param output the buffer to write to, null to create one. - * @param mode the cipher mode to use (default: 'CBC'). - * - * @return the cipher. - */ -forge.aes.startDecrypting = function(key, iv, output, mode) { - var cipher = _createCipher({ - key: key, - output: output, - decrypt: true, - mode: mode - }); - cipher.start(iv); - return cipher; -}; - -/** - * Deprecated. Instead, use: - * - * var decipher = forge.cipher.createDecipher('AES-', key); - * - * Creates an AES cipher object to decrypt data using the given symmetric key. - * - * The key may be given as a string of bytes, an array of bytes, a - * byte buffer, or an array of 32-bit words. - * - * @param key the symmetric key to use. - * @param mode the cipher mode to use (default: 'CBC'). - * - * @return the cipher. - */ -forge.aes.createDecryptionCipher = function(key, mode) { - return _createCipher({ - key: key, - output: null, - decrypt: true, - mode: mode - }); -}; - -/** - * Creates a new AES cipher algorithm object. - * - * @param name the name of the algorithm. - * @param mode the mode factory function. - * - * @return the AES algorithm object. - */ -forge.aes.Algorithm = function(name, mode) { - if(!init) { - initialize(); - } - var self = this; - self.name = name; - self.mode = new mode({ - blockSize: 16, - cipher: { - encrypt: function(inBlock, outBlock) { - return _updateBlock(self._w, inBlock, outBlock, false); - }, - decrypt: function(inBlock, outBlock) { - return _updateBlock(self._w, inBlock, outBlock, true); - } - } - }); - self._init = false; -}; - -/** - * Initializes this AES algorithm by expanding its key. - * - * @param options the options to use. - * key the key to use with this algorithm. - * decrypt true if the algorithm should be initialized for decryption, - * false for encryption. - */ -forge.aes.Algorithm.prototype.initialize = function(options) { - if(this._init) { - return; - } - - var key = options.key; - var tmp; - - /* Note: The key may be a string of bytes, an array of bytes, a byte - buffer, or an array of 32-bit integers. If the key is in bytes, then - it must be 16, 24, or 32 bytes in length. If it is in 32-bit - integers, it must be 4, 6, or 8 integers long. */ - - if(typeof key === 'string' && - (key.length === 16 || key.length === 24 || key.length === 32)) { - // convert key string into byte buffer - key = forge.util.createBuffer(key); - } else if(forge.util.isArray(key) && - (key.length === 16 || key.length === 24 || key.length === 32)) { - // convert key integer array into byte buffer - tmp = key; - key = forge.util.createBuffer(); - for(var i = 0; i < tmp.length; ++i) { - key.putByte(tmp[i]); - } - } - - // convert key byte buffer into 32-bit integer array - if(!forge.util.isArray(key)) { - tmp = key; - key = []; - - // key lengths of 16, 24, 32 bytes allowed - var len = tmp.length(); - if(len === 16 || len === 24 || len === 32) { - len = len >>> 2; - for(var i = 0; i < len; ++i) { - key.push(tmp.getInt32()); - } - } - } - - // key must be an array of 32-bit integers by now - if(!forge.util.isArray(key) || - !(key.length === 4 || key.length === 6 || key.length === 8)) { - throw new Error('Invalid key parameter.'); - } - - // encryption operation is always used for these modes - var mode = this.mode.name; - var encryptOp = (['CFB', 'OFB', 'CTR', 'GCM'].indexOf(mode) !== -1); - - // do key expansion - this._w = _expandKey(key, options.decrypt && !encryptOp); - this._init = true; -}; - -/** - * Expands a key. Typically only used for testing. - * - * @param key the symmetric key to expand, as an array of 32-bit words. - * @param decrypt true to expand for decryption, false for encryption. - * - * @return the expanded key. - */ -forge.aes._expandKey = function(key, decrypt) { - if(!init) { - initialize(); - } - return _expandKey(key, decrypt); -}; - -/** - * Updates a single block. Typically only used for testing. - * - * @param w the expanded key to use. - * @param input an array of block-size 32-bit words. - * @param output an array of block-size 32-bit words. - * @param decrypt true to decrypt, false to encrypt. - */ -forge.aes._updateBlock = _updateBlock; - -/** Register AES algorithms **/ - -registerAlgorithm('AES-ECB', forge.cipher.modes.ecb); -registerAlgorithm('AES-CBC', forge.cipher.modes.cbc); -registerAlgorithm('AES-CFB', forge.cipher.modes.cfb); -registerAlgorithm('AES-OFB', forge.cipher.modes.ofb); -registerAlgorithm('AES-CTR', forge.cipher.modes.ctr); -registerAlgorithm('AES-GCM', forge.cipher.modes.gcm); - -function registerAlgorithm(name, mode) { - var factory = function() { - return new forge.aes.Algorithm(name, mode); - }; - forge.cipher.registerAlgorithm(name, factory); -} - -/** AES implementation **/ - -var init = false; // not yet initialized -var Nb = 4; // number of words comprising the state (AES = 4) -var sbox; // non-linear substitution table used in key expansion -var isbox; // inversion of sbox -var rcon; // round constant word array -var mix; // mix-columns table -var imix; // inverse mix-columns table - -/** - * Performs initialization, ie: precomputes tables to optimize for speed. - * - * One way to understand how AES works is to imagine that 'addition' and - * 'multiplication' are interfaces that require certain mathematical - * properties to hold true (ie: they are associative) but they might have - * different implementations and produce different kinds of results ... - * provided that their mathematical properties remain true. AES defines - * its own methods of addition and multiplication but keeps some important - * properties the same, ie: associativity and distributivity. The - * explanation below tries to shed some light on how AES defines addition - * and multiplication of bytes and 32-bit words in order to perform its - * encryption and decryption algorithms. - * - * The basics: - * - * The AES algorithm views bytes as binary representations of polynomials - * that have either 1 or 0 as the coefficients. It defines the addition - * or subtraction of two bytes as the XOR operation. It also defines the - * multiplication of two bytes as a finite field referred to as GF(2^8) - * (Note: 'GF' means "Galois Field" which is a field that contains a finite - * number of elements so GF(2^8) has 256 elements). - * - * This means that any two bytes can be represented as binary polynomials; - * when they multiplied together and modularly reduced by an irreducible - * polynomial of the 8th degree, the results are the field GF(2^8). The - * specific irreducible polynomial that AES uses in hexadecimal is 0x11b. - * This multiplication is associative with 0x01 as the identity: - * - * (b * 0x01 = GF(b, 0x01) = b). - * - * The operation GF(b, 0x02) can be performed at the byte level by left - * shifting b once and then XOR'ing it (to perform the modular reduction) - * with 0x11b if b is >= 128. Repeated application of the multiplication - * of 0x02 can be used to implement the multiplication of any two bytes. - * - * For instance, multiplying 0x57 and 0x13, denoted as GF(0x57, 0x13), can - * be performed by factoring 0x13 into 0x01, 0x02, and 0x10. Then these - * factors can each be multiplied by 0x57 and then added together. To do - * the multiplication, values for 0x57 multiplied by each of these 3 factors - * can be precomputed and stored in a table. To add them, the values from - * the table are XOR'd together. - * - * AES also defines addition and multiplication of words, that is 4-byte - * numbers represented as polynomials of 3 degrees where the coefficients - * are the values of the bytes. - * - * The word [a0, a1, a2, a3] is a polynomial a3x^3 + a2x^2 + a1x + a0. - * - * Addition is performed by XOR'ing like powers of x. Multiplication - * is performed in two steps, the first is an algebriac expansion as - * you would do normally (where addition is XOR). But the result is - * a polynomial larger than 3 degrees and thus it cannot fit in a word. So - * next the result is modularly reduced by an AES-specific polynomial of - * degree 4 which will always produce a polynomial of less than 4 degrees - * such that it will fit in a word. In AES, this polynomial is x^4 + 1. - * - * The modular product of two polynomials 'a' and 'b' is thus: - * - * d(x) = d3x^3 + d2x^2 + d1x + d0 - * with - * d0 = GF(a0, b0) ^ GF(a3, b1) ^ GF(a2, b2) ^ GF(a1, b3) - * d1 = GF(a1, b0) ^ GF(a0, b1) ^ GF(a3, b2) ^ GF(a2, b3) - * d2 = GF(a2, b0) ^ GF(a1, b1) ^ GF(a0, b2) ^ GF(a3, b3) - * d3 = GF(a3, b0) ^ GF(a2, b1) ^ GF(a1, b2) ^ GF(a0, b3) - * - * As a matrix: - * - * [d0] = [a0 a3 a2 a1][b0] - * [d1] [a1 a0 a3 a2][b1] - * [d2] [a2 a1 a0 a3][b2] - * [d3] [a3 a2 a1 a0][b3] - * - * Special polynomials defined by AES (0x02 == {02}): - * a(x) = {03}x^3 + {01}x^2 + {01}x + {02} - * a^-1(x) = {0b}x^3 + {0d}x^2 + {09}x + {0e}. - * - * These polynomials are used in the MixColumns() and InverseMixColumns() - * operations, respectively, to cause each element in the state to affect - * the output (referred to as diffusing). - * - * RotWord() uses: a0 = a1 = a2 = {00} and a3 = {01}, which is the - * polynomial x3. - * - * The ShiftRows() method modifies the last 3 rows in the state (where - * the state is 4 words with 4 bytes per word) by shifting bytes cyclically. - * The 1st byte in the second row is moved to the end of the row. The 1st - * and 2nd bytes in the third row are moved to the end of the row. The 1st, - * 2nd, and 3rd bytes are moved in the fourth row. - * - * More details on how AES arithmetic works: - * - * In the polynomial representation of binary numbers, XOR performs addition - * and subtraction and multiplication in GF(2^8) denoted as GF(a, b) - * corresponds with the multiplication of polynomials modulo an irreducible - * polynomial of degree 8. In other words, for AES, GF(a, b) will multiply - * polynomial 'a' with polynomial 'b' and then do a modular reduction by - * an AES-specific irreducible polynomial of degree 8. - * - * A polynomial is irreducible if its only divisors are one and itself. For - * the AES algorithm, this irreducible polynomial is: - * - * m(x) = x^8 + x^4 + x^3 + x + 1, - * - * or {01}{1b} in hexadecimal notation, where each coefficient is a bit: - * 100011011 = 283 = 0x11b. - * - * For example, GF(0x57, 0x83) = 0xc1 because - * - * 0x57 = 87 = 01010111 = x^6 + x^4 + x^2 + x + 1 - * 0x85 = 131 = 10000101 = x^7 + x + 1 - * - * (x^6 + x^4 + x^2 + x + 1) * (x^7 + x + 1) - * = x^13 + x^11 + x^9 + x^8 + x^7 + - * x^7 + x^5 + x^3 + x^2 + x + - * x^6 + x^4 + x^2 + x + 1 - * = x^13 + x^11 + x^9 + x^8 + x^6 + x^5 + x^4 + x^3 + 1 = y - * y modulo (x^8 + x^4 + x^3 + x + 1) - * = x^7 + x^6 + 1. - * - * The modular reduction by m(x) guarantees the result will be a binary - * polynomial of less than degree 8, so that it can fit in a byte. - * - * The operation to multiply a binary polynomial b with x (the polynomial - * x in binary representation is 00000010) is: - * - * b_7x^8 + b_6x^7 + b_5x^6 + b_4x^5 + b_3x^4 + b_2x^3 + b_1x^2 + b_0x^1 - * - * To get GF(b, x) we must reduce that by m(x). If b_7 is 0 (that is the - * most significant bit is 0 in b) then the result is already reduced. If - * it is 1, then we can reduce it by subtracting m(x) via an XOR. - * - * It follows that multiplication by x (00000010 or 0x02) can be implemented - * by performing a left shift followed by a conditional bitwise XOR with - * 0x1b. This operation on bytes is denoted by xtime(). Multiplication by - * higher powers of x can be implemented by repeated application of xtime(). - * - * By adding intermediate results, multiplication by any constant can be - * implemented. For instance: - * - * GF(0x57, 0x13) = 0xfe because: - * - * xtime(b) = (b & 128) ? (b << 1 ^ 0x11b) : (b << 1) - * - * Note: We XOR with 0x11b instead of 0x1b because in javascript our - * datatype for b can be larger than 1 byte, so a left shift will not - * automatically eliminate bits that overflow a byte ... by XOR'ing the - * overflow bit with 1 (the extra one from 0x11b) we zero it out. - * - * GF(0x57, 0x02) = xtime(0x57) = 0xae - * GF(0x57, 0x04) = xtime(0xae) = 0x47 - * GF(0x57, 0x08) = xtime(0x47) = 0x8e - * GF(0x57, 0x10) = xtime(0x8e) = 0x07 - * - * GF(0x57, 0x13) = GF(0x57, (0x01 ^ 0x02 ^ 0x10)) - * - * And by the distributive property (since XOR is addition and GF() is - * multiplication): - * - * = GF(0x57, 0x01) ^ GF(0x57, 0x02) ^ GF(0x57, 0x10) - * = 0x57 ^ 0xae ^ 0x07 - * = 0xfe. - */ -function initialize() { - init = true; - - /* Populate the Rcon table. These are the values given by - [x^(i-1),{00},{00},{00}] where x^(i-1) are powers of x (and x = 0x02) - in the field of GF(2^8), where i starts at 1. - - rcon[0] = [0x00, 0x00, 0x00, 0x00] - rcon[1] = [0x01, 0x00, 0x00, 0x00] 2^(1-1) = 2^0 = 1 - rcon[2] = [0x02, 0x00, 0x00, 0x00] 2^(2-1) = 2^1 = 2 - ... - rcon[9] = [0x1B, 0x00, 0x00, 0x00] 2^(9-1) = 2^8 = 0x1B - rcon[10] = [0x36, 0x00, 0x00, 0x00] 2^(10-1) = 2^9 = 0x36 - - We only store the first byte because it is the only one used. - */ - rcon = [0x00, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1B, 0x36]; - - // compute xtime table which maps i onto GF(i, 0x02) - var xtime = new Array(256); - for(var i = 0; i < 128; ++i) { - xtime[i] = i << 1; - xtime[i + 128] = (i + 128) << 1 ^ 0x11B; - } - - // compute all other tables - sbox = new Array(256); - isbox = new Array(256); - mix = new Array(4); - imix = new Array(4); - for(var i = 0; i < 4; ++i) { - mix[i] = new Array(256); - imix[i] = new Array(256); - } - var e = 0, ei = 0, e2, e4, e8, sx, sx2, me, ime; - for(var i = 0; i < 256; ++i) { - /* We need to generate the SubBytes() sbox and isbox tables so that - we can perform byte substitutions. This requires us to traverse - all of the elements in GF, find their multiplicative inverses, - and apply to each the following affine transformation: - - bi' = bi ^ b(i + 4) mod 8 ^ b(i + 5) mod 8 ^ b(i + 6) mod 8 ^ - b(i + 7) mod 8 ^ ci - for 0 <= i < 8, where bi is the ith bit of the byte, and ci is the - ith bit of a byte c with the value {63} or {01100011}. - - It is possible to traverse every possible value in a Galois field - using what is referred to as a 'generator'. There are many - generators (128 out of 256): 3,5,6,9,11,82 to name a few. To fully - traverse GF we iterate 255 times, multiplying by our generator - each time. - - On each iteration we can determine the multiplicative inverse for - the current element. - - Suppose there is an element in GF 'e'. For a given generator 'g', - e = g^x. The multiplicative inverse of e is g^(255 - x). It turns - out that if use the inverse of a generator as another generator - it will produce all of the corresponding multiplicative inverses - at the same time. For this reason, we choose 5 as our inverse - generator because it only requires 2 multiplies and 1 add and its - inverse, 82, requires relatively few operations as well. - - In order to apply the affine transformation, the multiplicative - inverse 'ei' of 'e' can be repeatedly XOR'd (4 times) with a - bit-cycling of 'ei'. To do this 'ei' is first stored in 's' and - 'x'. Then 's' is left shifted and the high bit of 's' is made the - low bit. The resulting value is stored in 's'. Then 'x' is XOR'd - with 's' and stored in 'x'. On each subsequent iteration the same - operation is performed. When 4 iterations are complete, 'x' is - XOR'd with 'c' (0x63) and the transformed value is stored in 'x'. - For example: - - s = 01000001 - x = 01000001 - - iteration 1: s = 10000010, x ^= s - iteration 2: s = 00000101, x ^= s - iteration 3: s = 00001010, x ^= s - iteration 4: s = 00010100, x ^= s - x ^= 0x63 - - This can be done with a loop where s = (s << 1) | (s >> 7). However, - it can also be done by using a single 16-bit (in this case 32-bit) - number 'sx'. Since XOR is an associative operation, we can set 'sx' - to 'ei' and then XOR it with 'sx' left-shifted 1,2,3, and 4 times. - The most significant bits will flow into the high 8 bit positions - and be correctly XOR'd with one another. All that remains will be - to cycle the high 8 bits by XOR'ing them all with the lower 8 bits - afterwards. - - At the same time we're populating sbox and isbox we can precompute - the multiplication we'll need to do to do MixColumns() later. - */ - - // apply affine transformation - sx = ei ^ (ei << 1) ^ (ei << 2) ^ (ei << 3) ^ (ei << 4); - sx = (sx >> 8) ^ (sx & 255) ^ 0x63; - - // update tables - sbox[e] = sx; - isbox[sx] = e; - - /* Mixing columns is done using matrix multiplication. The columns - that are to be mixed are each a single word in the current state. - The state has Nb columns (4 columns). Therefore each column is a - 4 byte word. So to mix the columns in a single column 'c' where - its rows are r0, r1, r2, and r3, we use the following matrix - multiplication: - - [2 3 1 1]*[r0,c]=[r'0,c] - [1 2 3 1] [r1,c] [r'1,c] - [1 1 2 3] [r2,c] [r'2,c] - [3 1 1 2] [r3,c] [r'3,c] - - r0, r1, r2, and r3 are each 1 byte of one of the words in the - state (a column). To do matrix multiplication for each mixed - column c' we multiply the corresponding row from the left matrix - with the corresponding column from the right matrix. In total, we - get 4 equations: - - r0,c' = 2*r0,c + 3*r1,c + 1*r2,c + 1*r3,c - r1,c' = 1*r0,c + 2*r1,c + 3*r2,c + 1*r3,c - r2,c' = 1*r0,c + 1*r1,c + 2*r2,c + 3*r3,c - r3,c' = 3*r0,c + 1*r1,c + 1*r2,c + 2*r3,c - - As usual, the multiplication is as previously defined and the - addition is XOR. In order to optimize mixing columns we can store - the multiplication results in tables. If you think of the whole - column as a word (it might help to visualize by mentally rotating - the equations above by counterclockwise 90 degrees) then you can - see that it would be useful to map the multiplications performed on - each byte (r0, r1, r2, r3) onto a word as well. For instance, we - could map 2*r0,1*r0,1*r0,3*r0 onto a word by storing 2*r0 in the - highest 8 bits and 3*r0 in the lowest 8 bits (with the other two - respectively in the middle). This means that a table can be - constructed that uses r0 as an index to the word. We can do the - same with r1, r2, and r3, creating a total of 4 tables. - - To construct a full c', we can just look up each byte of c in - their respective tables and XOR the results together. - - Also, to build each table we only have to calculate the word - for 2,1,1,3 for every byte ... which we can do on each iteration - of this loop since we will iterate over every byte. After we have - calculated 2,1,1,3 we can get the results for the other tables - by cycling the byte at the end to the beginning. For instance - we can take the result of table 2,1,1,3 and produce table 3,2,1,1 - by moving the right most byte to the left most position just like - how you can imagine the 3 moved out of 2,1,1,3 and to the front - to produce 3,2,1,1. - - There is another optimization in that the same multiples of - the current element we need in order to advance our generator - to the next iteration can be reused in performing the 2,1,1,3 - calculation. We also calculate the inverse mix column tables, - with e,9,d,b being the inverse of 2,1,1,3. - - When we're done, and we need to actually mix columns, the first - byte of each state word should be put through mix[0] (2,1,1,3), - the second through mix[1] (3,2,1,1) and so forth. Then they should - be XOR'd together to produce the fully mixed column. - */ - - // calculate mix and imix table values - sx2 = xtime[sx]; - e2 = xtime[e]; - e4 = xtime[e2]; - e8 = xtime[e4]; - me = - (sx2 << 24) ^ // 2 - (sx << 16) ^ // 1 - (sx << 8) ^ // 1 - (sx ^ sx2); // 3 - ime = - (e2 ^ e4 ^ e8) << 24 ^ // E (14) - (e ^ e8) << 16 ^ // 9 - (e ^ e4 ^ e8) << 8 ^ // D (13) - (e ^ e2 ^ e8); // B (11) - // produce each of the mix tables by rotating the 2,1,1,3 value - for(var n = 0; n < 4; ++n) { - mix[n][e] = me; - imix[n][sx] = ime; - // cycle the right most byte to the left most position - // ie: 2,1,1,3 becomes 3,2,1,1 - me = me << 24 | me >>> 8; - ime = ime << 24 | ime >>> 8; - } - - // get next element and inverse - if(e === 0) { - // 1 is the inverse of 1 - e = ei = 1; - } else { - // e = 2e + 2*2*2*(10e)) = multiply e by 82 (chosen generator) - // ei = ei + 2*2*ei = multiply ei by 5 (inverse generator) - e = e2 ^ xtime[xtime[xtime[e2 ^ e8]]]; - ei ^= xtime[xtime[ei]]; - } - } -} - -/** - * Generates a key schedule using the AES key expansion algorithm. - * - * The AES algorithm takes the Cipher Key, K, and performs a Key Expansion - * routine to generate a key schedule. The Key Expansion generates a total - * of Nb*(Nr + 1) words: the algorithm requires an initial set of Nb words, - * and each of the Nr rounds requires Nb words of key data. The resulting - * key schedule consists of a linear array of 4-byte words, denoted [wi ], - * with i in the range 0 <= i < Nb(Nr + 1). - * - * KeyExpansion(byte key[4*Nk], word w[Nb*(Nr+1)], Nk) - * AES-128 (Nb=4, Nk=4, Nr=10) - * AES-192 (Nb=4, Nk=6, Nr=12) - * AES-256 (Nb=4, Nk=8, Nr=14) - * Note: Nr=Nk+6. - * - * Nb is the number of columns (32-bit words) comprising the State (or - * number of bytes in a block). For AES, Nb=4. - * - * @param key the key to schedule (as an array of 32-bit words). - * @param decrypt true to modify the key schedule to decrypt, false not to. - * - * @return the generated key schedule. - */ -function _expandKey(key, decrypt) { - // copy the key's words to initialize the key schedule - var w = key.slice(0); - - /* RotWord() will rotate a word, moving the first byte to the last - byte's position (shifting the other bytes left). - - We will be getting the value of Rcon at i / Nk. 'i' will iterate - from Nk to (Nb * Nr+1). Nk = 4 (4 byte key), Nb = 4 (4 words in - a block), Nr = Nk + 6 (10). Therefore 'i' will iterate from - 4 to 44 (exclusive). Each time we iterate 4 times, i / Nk will - increase by 1. We use a counter iNk to keep track of this. - */ - - // go through the rounds expanding the key - var temp, iNk = 1; - var Nk = w.length; - var Nr1 = Nk + 6 + 1; - var end = Nb * Nr1; - for(var i = Nk; i < end; ++i) { - temp = w[i - 1]; - if(i % Nk === 0) { - // temp = SubWord(RotWord(temp)) ^ Rcon[i / Nk] - temp = - sbox[temp >>> 16 & 255] << 24 ^ - sbox[temp >>> 8 & 255] << 16 ^ - sbox[temp & 255] << 8 ^ - sbox[temp >>> 24] ^ (rcon[iNk] << 24); - iNk++; - } else if(Nk > 6 && (i % Nk === 4)) { - // temp = SubWord(temp) - temp = - sbox[temp >>> 24] << 24 ^ - sbox[temp >>> 16 & 255] << 16 ^ - sbox[temp >>> 8 & 255] << 8 ^ - sbox[temp & 255]; - } - w[i] = w[i - Nk] ^ temp; - } - - /* When we are updating a cipher block we always use the code path for - encryption whether we are decrypting or not (to shorten code and - simplify the generation of look up tables). However, because there - are differences in the decryption algorithm, other than just swapping - in different look up tables, we must transform our key schedule to - account for these changes: - - 1. The decryption algorithm gets its key rounds in reverse order. - 2. The decryption algorithm adds the round key before mixing columns - instead of afterwards. - - We don't need to modify our key schedule to handle the first case, - we can just traverse the key schedule in reverse order when decrypting. - - The second case requires a little work. - - The tables we built for performing rounds will take an input and then - perform SubBytes() and MixColumns() or, for the decrypt version, - InvSubBytes() and InvMixColumns(). But the decrypt algorithm requires - us to AddRoundKey() before InvMixColumns(). This means we'll need to - apply some transformations to the round key to inverse-mix its columns - so they'll be correct for moving AddRoundKey() to after the state has - had its columns inverse-mixed. - - To inverse-mix the columns of the state when we're decrypting we use a - lookup table that will apply InvSubBytes() and InvMixColumns() at the - same time. However, the round key's bytes are not inverse-substituted - in the decryption algorithm. To get around this problem, we can first - substitute the bytes in the round key so that when we apply the - transformation via the InvSubBytes()+InvMixColumns() table, it will - undo our substitution leaving us with the original value that we - want -- and then inverse-mix that value. - - This change will correctly alter our key schedule so that we can XOR - each round key with our already transformed decryption state. This - allows us to use the same code path as the encryption algorithm. - - We make one more change to the decryption key. Since the decryption - algorithm runs in reverse from the encryption algorithm, we reverse - the order of the round keys to avoid having to iterate over the key - schedule backwards when running the encryption algorithm later in - decryption mode. In addition to reversing the order of the round keys, - we also swap each round key's 2nd and 4th rows. See the comments - section where rounds are performed for more details about why this is - done. These changes are done inline with the other substitution - described above. - */ - if(decrypt) { - var tmp; - var m0 = imix[0]; - var m1 = imix[1]; - var m2 = imix[2]; - var m3 = imix[3]; - var wnew = w.slice(0); - end = w.length; - for(var i = 0, wi = end - Nb; i < end; i += Nb, wi -= Nb) { - // do not sub the first or last round key (round keys are Nb - // words) as no column mixing is performed before they are added, - // but do change the key order - if(i === 0 || i === (end - Nb)) { - wnew[i] = w[wi]; - wnew[i + 1] = w[wi + 3]; - wnew[i + 2] = w[wi + 2]; - wnew[i + 3] = w[wi + 1]; - } else { - // substitute each round key byte because the inverse-mix - // table will inverse-substitute it (effectively cancel the - // substitution because round key bytes aren't sub'd in - // decryption mode) and swap indexes 3 and 1 - for(var n = 0; n < Nb; ++n) { - tmp = w[wi + n]; - wnew[i + (3&-n)] = - m0[sbox[tmp >>> 24]] ^ - m1[sbox[tmp >>> 16 & 255]] ^ - m2[sbox[tmp >>> 8 & 255]] ^ - m3[sbox[tmp & 255]]; - } - } - } - w = wnew; - } - - return w; -} - -/** - * Updates a single block (16 bytes) using AES. The update will either - * encrypt or decrypt the block. - * - * @param w the key schedule. - * @param input the input block (an array of 32-bit words). - * @param output the updated output block. - * @param decrypt true to decrypt the block, false to encrypt it. - */ -function _updateBlock(w, input, output, decrypt) { - /* - Cipher(byte in[4*Nb], byte out[4*Nb], word w[Nb*(Nr+1)]) - begin - byte state[4,Nb] - state = in - AddRoundKey(state, w[0, Nb-1]) - for round = 1 step 1 to Nr-1 - SubBytes(state) - ShiftRows(state) - MixColumns(state) - AddRoundKey(state, w[round*Nb, (round+1)*Nb-1]) - end for - SubBytes(state) - ShiftRows(state) - AddRoundKey(state, w[Nr*Nb, (Nr+1)*Nb-1]) - out = state - end - - InvCipher(byte in[4*Nb], byte out[4*Nb], word w[Nb*(Nr+1)]) - begin - byte state[4,Nb] - state = in - AddRoundKey(state, w[Nr*Nb, (Nr+1)*Nb-1]) - for round = Nr-1 step -1 downto 1 - InvShiftRows(state) - InvSubBytes(state) - AddRoundKey(state, w[round*Nb, (round+1)*Nb-1]) - InvMixColumns(state) - end for - InvShiftRows(state) - InvSubBytes(state) - AddRoundKey(state, w[0, Nb-1]) - out = state - end - */ - - // Encrypt: AddRoundKey(state, w[0, Nb-1]) - // Decrypt: AddRoundKey(state, w[Nr*Nb, (Nr+1)*Nb-1]) - var Nr = w.length / 4 - 1; - var m0, m1, m2, m3, sub; - if(decrypt) { - m0 = imix[0]; - m1 = imix[1]; - m2 = imix[2]; - m3 = imix[3]; - sub = isbox; - } else { - m0 = mix[0]; - m1 = mix[1]; - m2 = mix[2]; - m3 = mix[3]; - sub = sbox; - } - var a, b, c, d, a2, b2, c2; - a = input[0] ^ w[0]; - b = input[decrypt ? 3 : 1] ^ w[1]; - c = input[2] ^ w[2]; - d = input[decrypt ? 1 : 3] ^ w[3]; - var i = 3; - - /* In order to share code we follow the encryption algorithm when both - encrypting and decrypting. To account for the changes required in the - decryption algorithm, we use different lookup tables when decrypting - and use a modified key schedule to account for the difference in the - order of transformations applied when performing rounds. We also get - key rounds in reverse order (relative to encryption). */ - for(var round = 1; round < Nr; ++round) { - /* As described above, we'll be using table lookups to perform the - column mixing. Each column is stored as a word in the state (the - array 'input' has one column as a word at each index). In order to - mix a column, we perform these transformations on each row in c, - which is 1 byte in each word. The new column for c0 is c'0: - - m0 m1 m2 m3 - r0,c'0 = 2*r0,c0 + 3*r1,c0 + 1*r2,c0 + 1*r3,c0 - r1,c'0 = 1*r0,c0 + 2*r1,c0 + 3*r2,c0 + 1*r3,c0 - r2,c'0 = 1*r0,c0 + 1*r1,c0 + 2*r2,c0 + 3*r3,c0 - r3,c'0 = 3*r0,c0 + 1*r1,c0 + 1*r2,c0 + 2*r3,c0 - - So using mix tables where c0 is a word with r0 being its upper - 8 bits and r3 being its lower 8 bits: - - m0[c0 >> 24] will yield this word: [2*r0,1*r0,1*r0,3*r0] - ... - m3[c0 & 255] will yield this word: [1*r3,1*r3,3*r3,2*r3] - - Therefore to mix the columns in each word in the state we - do the following (& 255 omitted for brevity): - c'0,r0 = m0[c0 >> 24] ^ m1[c1 >> 16] ^ m2[c2 >> 8] ^ m3[c3] - c'0,r1 = m0[c0 >> 24] ^ m1[c1 >> 16] ^ m2[c2 >> 8] ^ m3[c3] - c'0,r2 = m0[c0 >> 24] ^ m1[c1 >> 16] ^ m2[c2 >> 8] ^ m3[c3] - c'0,r3 = m0[c0 >> 24] ^ m1[c1 >> 16] ^ m2[c2 >> 8] ^ m3[c3] - - However, before mixing, the algorithm requires us to perform - ShiftRows(). The ShiftRows() transformation cyclically shifts the - last 3 rows of the state over different offsets. The first row - (r = 0) is not shifted. - - s'_r,c = s_r,(c + shift(r, Nb) mod Nb - for 0 < r < 4 and 0 <= c < Nb and - shift(1, 4) = 1 - shift(2, 4) = 2 - shift(3, 4) = 3. - - This causes the first byte in r = 1 to be moved to the end of - the row, the first 2 bytes in r = 2 to be moved to the end of - the row, the first 3 bytes in r = 3 to be moved to the end of - the row: - - r1: [c0 c1 c2 c3] => [c1 c2 c3 c0] - r2: [c0 c1 c2 c3] [c2 c3 c0 c1] - r3: [c0 c1 c2 c3] [c3 c0 c1 c2] - - We can make these substitutions inline with our column mixing to - generate an updated set of equations to produce each word in the - state (note the columns have changed positions): - - c0 c1 c2 c3 => c0 c1 c2 c3 - c0 c1 c2 c3 c1 c2 c3 c0 (cycled 1 byte) - c0 c1 c2 c3 c2 c3 c0 c1 (cycled 2 bytes) - c0 c1 c2 c3 c3 c0 c1 c2 (cycled 3 bytes) - - Therefore: - - c'0 = 2*r0,c0 + 3*r1,c1 + 1*r2,c2 + 1*r3,c3 - c'0 = 1*r0,c0 + 2*r1,c1 + 3*r2,c2 + 1*r3,c3 - c'0 = 1*r0,c0 + 1*r1,c1 + 2*r2,c2 + 3*r3,c3 - c'0 = 3*r0,c0 + 1*r1,c1 + 1*r2,c2 + 2*r3,c3 - - c'1 = 2*r0,c1 + 3*r1,c2 + 1*r2,c3 + 1*r3,c0 - c'1 = 1*r0,c1 + 2*r1,c2 + 3*r2,c3 + 1*r3,c0 - c'1 = 1*r0,c1 + 1*r1,c2 + 2*r2,c3 + 3*r3,c0 - c'1 = 3*r0,c1 + 1*r1,c2 + 1*r2,c3 + 2*r3,c0 - - ... and so forth for c'2 and c'3. The important distinction is - that the columns are cycling, with c0 being used with the m0 - map when calculating c0, but c1 being used with the m0 map when - calculating c1 ... and so forth. - - When performing the inverse we transform the mirror image and - skip the bottom row, instead of the top one, and move upwards: - - c3 c2 c1 c0 => c0 c3 c2 c1 (cycled 3 bytes) *same as encryption - c3 c2 c1 c0 c1 c0 c3 c2 (cycled 2 bytes) - c3 c2 c1 c0 c2 c1 c0 c3 (cycled 1 byte) *same as encryption - c3 c2 c1 c0 c3 c2 c1 c0 - - If you compare the resulting matrices for ShiftRows()+MixColumns() - and for InvShiftRows()+InvMixColumns() the 2nd and 4th columns are - different (in encrypt mode vs. decrypt mode). So in order to use - the same code to handle both encryption and decryption, we will - need to do some mapping. - - If in encryption mode we let a=c0, b=c1, c=c2, d=c3, and r be - a row number in the state, then the resulting matrix in encryption - mode for applying the above transformations would be: - - r1: a b c d - r2: b c d a - r3: c d a b - r4: d a b c - - If we did the same in decryption mode we would get: - - r1: a d c b - r2: b a d c - r3: c b a d - r4: d c b a - - If instead we swap d and b (set b=c3 and d=c1), then we get: - - r1: a b c d - r2: d a b c - r3: c d a b - r4: b c d a - - Now the 1st and 3rd rows are the same as the encryption matrix. All - we need to do then to make the mapping exactly the same is to swap - the 2nd and 4th rows when in decryption mode. To do this without - having to do it on each iteration, we swapped the 2nd and 4th rows - in the decryption key schedule. We also have to do the swap above - when we first pull in the input and when we set the final output. */ - a2 = - m0[a >>> 24] ^ - m1[b >>> 16 & 255] ^ - m2[c >>> 8 & 255] ^ - m3[d & 255] ^ w[++i]; - b2 = - m0[b >>> 24] ^ - m1[c >>> 16 & 255] ^ - m2[d >>> 8 & 255] ^ - m3[a & 255] ^ w[++i]; - c2 = - m0[c >>> 24] ^ - m1[d >>> 16 & 255] ^ - m2[a >>> 8 & 255] ^ - m3[b & 255] ^ w[++i]; - d = - m0[d >>> 24] ^ - m1[a >>> 16 & 255] ^ - m2[b >>> 8 & 255] ^ - m3[c & 255] ^ w[++i]; - a = a2; - b = b2; - c = c2; - } - - /* - Encrypt: - SubBytes(state) - ShiftRows(state) - AddRoundKey(state, w[Nr*Nb, (Nr+1)*Nb-1]) - - Decrypt: - InvShiftRows(state) - InvSubBytes(state) - AddRoundKey(state, w[0, Nb-1]) - */ - // Note: rows are shifted inline - output[0] = - (sub[a >>> 24] << 24) ^ - (sub[b >>> 16 & 255] << 16) ^ - (sub[c >>> 8 & 255] << 8) ^ - (sub[d & 255]) ^ w[++i]; - output[decrypt ? 3 : 1] = - (sub[b >>> 24] << 24) ^ - (sub[c >>> 16 & 255] << 16) ^ - (sub[d >>> 8 & 255] << 8) ^ - (sub[a & 255]) ^ w[++i]; - output[2] = - (sub[c >>> 24] << 24) ^ - (sub[d >>> 16 & 255] << 16) ^ - (sub[a >>> 8 & 255] << 8) ^ - (sub[b & 255]) ^ w[++i]; - output[decrypt ? 1 : 3] = - (sub[d >>> 24] << 24) ^ - (sub[a >>> 16 & 255] << 16) ^ - (sub[b >>> 8 & 255] << 8) ^ - (sub[c & 255]) ^ w[++i]; -} - -/** - * Deprecated. Instead, use: - * - * forge.cipher.createCipher('AES-', key); - * forge.cipher.createDecipher('AES-', key); - * - * Creates a deprecated AES cipher object. This object's mode will default to - * CBC (cipher-block-chaining). - * - * The key and iv may be given as a string of bytes, an array of bytes, a - * byte buffer, or an array of 32-bit words. - * - * @param options the options to use. - * key the symmetric key to use. - * output the buffer to write to. - * decrypt true for decryption, false for encryption. - * mode the cipher mode to use (default: 'CBC'). - * - * @return the cipher. - */ -function _createCipher(options) { - options = options || {}; - var mode = (options.mode || 'CBC').toUpperCase(); - var algorithm = 'AES-' + mode; - - var cipher; - if(options.decrypt) { - cipher = forge.cipher.createDecipher(algorithm, options.key); - } else { - cipher = forge.cipher.createCipher(algorithm, options.key); - } - - // backwards compatible start API - var start = cipher.start; - cipher.start = function(iv, options) { - // backwards compatibility: support second arg as output buffer - var output = null; - if(options instanceof forge.util.ByteBuffer) { - output = options; - options = {}; - } - options = options || {}; - options.output = output; - options.iv = iv; - start.call(cipher, options); - }; - - return cipher; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/aesCipherSuites.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/aesCipherSuites.js deleted file mode 100644 index fed60f36..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/aesCipherSuites.js +++ /dev/null @@ -1,282 +0,0 @@ -/** - * A Javascript implementation of AES Cipher Suites for TLS. - * - * @author Dave Longley - * - * Copyright (c) 2009-2015 Digital Bazaar, Inc. - * - */ -var forge = require('./forge'); -require('./aes'); -require('./tls'); - -var tls = module.exports = forge.tls; - -/** - * Supported cipher suites. - */ -tls.CipherSuites['TLS_RSA_WITH_AES_128_CBC_SHA'] = { - id: [0x00, 0x2f], - name: 'TLS_RSA_WITH_AES_128_CBC_SHA', - initSecurityParameters: function(sp) { - sp.bulk_cipher_algorithm = tls.BulkCipherAlgorithm.aes; - sp.cipher_type = tls.CipherType.block; - sp.enc_key_length = 16; - sp.block_length = 16; - sp.fixed_iv_length = 16; - sp.record_iv_length = 16; - sp.mac_algorithm = tls.MACAlgorithm.hmac_sha1; - sp.mac_length = 20; - sp.mac_key_length = 20; - }, - initConnectionState: initConnectionState -}; -tls.CipherSuites['TLS_RSA_WITH_AES_256_CBC_SHA'] = { - id: [0x00, 0x35], - name: 'TLS_RSA_WITH_AES_256_CBC_SHA', - initSecurityParameters: function(sp) { - sp.bulk_cipher_algorithm = tls.BulkCipherAlgorithm.aes; - sp.cipher_type = tls.CipherType.block; - sp.enc_key_length = 32; - sp.block_length = 16; - sp.fixed_iv_length = 16; - sp.record_iv_length = 16; - sp.mac_algorithm = tls.MACAlgorithm.hmac_sha1; - sp.mac_length = 20; - sp.mac_key_length = 20; - }, - initConnectionState: initConnectionState -}; - -function initConnectionState(state, c, sp) { - var client = (c.entity === forge.tls.ConnectionEnd.client); - - // cipher setup - state.read.cipherState = { - init: false, - cipher: forge.cipher.createDecipher('AES-CBC', client ? - sp.keys.server_write_key : sp.keys.client_write_key), - iv: client ? sp.keys.server_write_IV : sp.keys.client_write_IV - }; - state.write.cipherState = { - init: false, - cipher: forge.cipher.createCipher('AES-CBC', client ? - sp.keys.client_write_key : sp.keys.server_write_key), - iv: client ? sp.keys.client_write_IV : sp.keys.server_write_IV - }; - state.read.cipherFunction = decrypt_aes_cbc_sha1; - state.write.cipherFunction = encrypt_aes_cbc_sha1; - - // MAC setup - state.read.macLength = state.write.macLength = sp.mac_length; - state.read.macFunction = state.write.macFunction = tls.hmac_sha1; -} - -/** - * Encrypts the TLSCompressed record into a TLSCipherText record using AES - * in CBC mode. - * - * @param record the TLSCompressed record to encrypt. - * @param s the ConnectionState to use. - * - * @return true on success, false on failure. - */ -function encrypt_aes_cbc_sha1(record, s) { - var rval = false; - - // append MAC to fragment, update sequence number - var mac = s.macFunction(s.macKey, s.sequenceNumber, record); - record.fragment.putBytes(mac); - s.updateSequenceNumber(); - - // TLS 1.1+ use an explicit IV every time to protect against CBC attacks - var iv; - if(record.version.minor === tls.Versions.TLS_1_0.minor) { - // use the pre-generated IV when initializing for TLS 1.0, otherwise use - // the residue from the previous encryption - iv = s.cipherState.init ? null : s.cipherState.iv; - } else { - iv = forge.random.getBytesSync(16); - } - - s.cipherState.init = true; - - // start cipher - var cipher = s.cipherState.cipher; - cipher.start({iv: iv}); - - // TLS 1.1+ write IV into output - if(record.version.minor >= tls.Versions.TLS_1_1.minor) { - cipher.output.putBytes(iv); - } - - // do encryption (default padding is appropriate) - cipher.update(record.fragment); - if(cipher.finish(encrypt_aes_cbc_sha1_padding)) { - // set record fragment to encrypted output - record.fragment = cipher.output; - record.length = record.fragment.length(); - rval = true; - } - - return rval; -} - -/** - * Handles padding for aes_cbc_sha1 in encrypt mode. - * - * @param blockSize the block size. - * @param input the input buffer. - * @param decrypt true in decrypt mode, false in encrypt mode. - * - * @return true on success, false on failure. - */ -function encrypt_aes_cbc_sha1_padding(blockSize, input, decrypt) { - /* The encrypted data length (TLSCiphertext.length) is one more than the sum - of SecurityParameters.block_length, TLSCompressed.length, - SecurityParameters.mac_length, and padding_length. - - The padding may be any length up to 255 bytes long, as long as it results in - the TLSCiphertext.length being an integral multiple of the block length. - Lengths longer than necessary might be desirable to frustrate attacks on a - protocol based on analysis of the lengths of exchanged messages. Each uint8 - in the padding data vector must be filled with the padding length value. - - The padding length should be such that the total size of the - GenericBlockCipher structure is a multiple of the cipher's block length. - Legal values range from zero to 255, inclusive. This length specifies the - length of the padding field exclusive of the padding_length field itself. - - This is slightly different from PKCS#7 because the padding value is 1 - less than the actual number of padding bytes if you include the - padding_length uint8 itself as a padding byte. */ - if(!decrypt) { - // get the number of padding bytes required to reach the blockSize and - // subtract 1 for the padding value (to make room for the padding_length - // uint8) - var padding = blockSize - (input.length() % blockSize); - input.fillWithByte(padding - 1, padding); - } - return true; -} - -/** - * Handles padding for aes_cbc_sha1 in decrypt mode. - * - * @param blockSize the block size. - * @param output the output buffer. - * @param decrypt true in decrypt mode, false in encrypt mode. - * - * @return true on success, false on failure. - */ -function decrypt_aes_cbc_sha1_padding(blockSize, output, decrypt) { - var rval = true; - if(decrypt) { - /* The last byte in the output specifies the number of padding bytes not - including itself. Each of the padding bytes has the same value as that - last byte (known as the padding_length). Here we check all padding - bytes to ensure they have the value of padding_length even if one of - them is bad in order to ward-off timing attacks. */ - var len = output.length(); - var paddingLength = output.last(); - for(var i = len - 1 - paddingLength; i < len - 1; ++i) { - rval = rval && (output.at(i) == paddingLength); - } - if(rval) { - // trim off padding bytes and last padding length byte - output.truncate(paddingLength + 1); - } - } - return rval; -} - -/** - * Decrypts a TLSCipherText record into a TLSCompressed record using - * AES in CBC mode. - * - * @param record the TLSCipherText record to decrypt. - * @param s the ConnectionState to use. - * - * @return true on success, false on failure. - */ -function decrypt_aes_cbc_sha1(record, s) { - var rval = false; - - var iv; - if(record.version.minor === tls.Versions.TLS_1_0.minor) { - // use pre-generated IV when initializing for TLS 1.0, otherwise use the - // residue from the previous decryption - iv = s.cipherState.init ? null : s.cipherState.iv; - } else { - // TLS 1.1+ use an explicit IV every time to protect against CBC attacks - // that is appended to the record fragment - iv = record.fragment.getBytes(16); - } - - s.cipherState.init = true; - - // start cipher - var cipher = s.cipherState.cipher; - cipher.start({iv: iv}); - - // do decryption - cipher.update(record.fragment); - rval = cipher.finish(decrypt_aes_cbc_sha1_padding); - - // even if decryption fails, keep going to minimize timing attacks - - // decrypted data: - // first (len - 20) bytes = application data - // last 20 bytes = MAC - var macLen = s.macLength; - - // create a random MAC to check against should the mac length check fail - // Note: do this regardless of the failure to keep timing consistent - var mac = forge.random.getBytesSync(macLen); - - // get fragment and mac - var len = cipher.output.length(); - if(len >= macLen) { - record.fragment = cipher.output.getBytes(len - macLen); - mac = cipher.output.getBytes(macLen); - } else { - // bad data, but get bytes anyway to try to keep timing consistent - record.fragment = cipher.output.getBytes(); - } - record.fragment = forge.util.createBuffer(record.fragment); - record.length = record.fragment.length(); - - // see if data integrity checks out, update sequence number - var mac2 = s.macFunction(s.macKey, s.sequenceNumber, record); - s.updateSequenceNumber(); - rval = compareMacs(s.macKey, mac, mac2) && rval; - return rval; -} - -/** - * Safely compare two MACs. This function will compare two MACs in a way - * that protects against timing attacks. - * - * TODO: Expose elsewhere as a utility API. - * - * See: https://www.nccgroup.trust/us/about-us/newsroom-and-events/blog/2011/february/double-hmac-verification/ - * - * @param key the MAC key to use. - * @param mac1 as a binary-encoded string of bytes. - * @param mac2 as a binary-encoded string of bytes. - * - * @return true if the MACs are the same, false if not. - */ -function compareMacs(key, mac1, mac2) { - var hmac = forge.hmac.create(); - - hmac.start('SHA1', key); - hmac.update(mac1); - mac1 = hmac.digest().getBytes(); - - hmac.start(null, null); - hmac.update(mac2); - mac2 = hmac.digest().getBytes(); - - return mac1 === mac2; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/asn1-validator.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/asn1-validator.js deleted file mode 100644 index 2be32850..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/asn1-validator.js +++ /dev/null @@ -1,91 +0,0 @@ -/** - * Copyright (c) 2019 Digital Bazaar, Inc. - */ - -var forge = require('./forge'); -require('./asn1'); -var asn1 = forge.asn1; - -exports.privateKeyValidator = { - // PrivateKeyInfo - name: 'PrivateKeyInfo', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - value: [{ - // Version (INTEGER) - name: 'PrivateKeyInfo.version', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.INTEGER, - constructed: false, - capture: 'privateKeyVersion' - }, { - // privateKeyAlgorithm - name: 'PrivateKeyInfo.privateKeyAlgorithm', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - value: [{ - name: 'AlgorithmIdentifier.algorithm', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.OID, - constructed: false, - capture: 'privateKeyOid' - }] - }, { - // PrivateKey - name: 'PrivateKeyInfo', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.OCTETSTRING, - constructed: false, - capture: 'privateKey' - }] -}; - -exports.publicKeyValidator = { - name: 'SubjectPublicKeyInfo', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - captureAsn1: 'subjectPublicKeyInfo', - value: [{ - name: 'SubjectPublicKeyInfo.AlgorithmIdentifier', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - value: [{ - name: 'AlgorithmIdentifier.algorithm', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.OID, - constructed: false, - capture: 'publicKeyOid' - }] - }, - // capture group for ed25519PublicKey - { - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.BITSTRING, - constructed: false, - composed: true, - captureBitStringValue: 'ed25519PublicKey' - } - // FIXME: this is capture group for rsaPublicKey, use it in this API or - // discard? - /* { - // subjectPublicKey - name: 'SubjectPublicKeyInfo.subjectPublicKey', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.BITSTRING, - constructed: false, - value: [{ - // RSAPublicKey - name: 'SubjectPublicKeyInfo.subjectPublicKey.RSAPublicKey', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - optional: true, - captureAsn1: 'rsaPublicKey' - }] - } */ - ] -}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/asn1.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/asn1.js deleted file mode 100644 index 4025f8a9..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/asn1.js +++ /dev/null @@ -1,1434 +0,0 @@ -/** - * Javascript implementation of Abstract Syntax Notation Number One. - * - * @author Dave Longley - * - * Copyright (c) 2010-2015 Digital Bazaar, Inc. - * - * An API for storing data using the Abstract Syntax Notation Number One - * format using DER (Distinguished Encoding Rules) encoding. This encoding is - * commonly used to store data for PKI, i.e. X.509 Certificates, and this - * implementation exists for that purpose. - * - * Abstract Syntax Notation Number One (ASN.1) is used to define the abstract - * syntax of information without restricting the way the information is encoded - * for transmission. It provides a standard that allows for open systems - * communication. ASN.1 defines the syntax of information data and a number of - * simple data types as well as a notation for describing them and specifying - * values for them. - * - * The RSA algorithm creates public and private keys that are often stored in - * X.509 or PKCS#X formats -- which use ASN.1 (encoded in DER format). This - * class provides the most basic functionality required to store and load DSA - * keys that are encoded according to ASN.1. - * - * The most common binary encodings for ASN.1 are BER (Basic Encoding Rules) - * and DER (Distinguished Encoding Rules). DER is just a subset of BER that - * has stricter requirements for how data must be encoded. - * - * Each ASN.1 structure has a tag (a byte identifying the ASN.1 structure type) - * and a byte array for the value of this ASN1 structure which may be data or a - * list of ASN.1 structures. - * - * Each ASN.1 structure using BER is (Tag-Length-Value): - * - * | byte 0 | bytes X | bytes Y | - * |--------|---------|---------- - * | tag | length | value | - * - * ASN.1 allows for tags to be of "High-tag-number form" which allows a tag to - * be two or more octets, but that is not supported by this class. A tag is - * only 1 byte. Bits 1-5 give the tag number (ie the data type within a - * particular 'class'), 6 indicates whether or not the ASN.1 value is - * constructed from other ASN.1 values, and bits 7 and 8 give the 'class'. If - * bits 7 and 8 are both zero, the class is UNIVERSAL. If only bit 7 is set, - * then the class is APPLICATION. If only bit 8 is set, then the class is - * CONTEXT_SPECIFIC. If both bits 7 and 8 are set, then the class is PRIVATE. - * The tag numbers for the data types for the class UNIVERSAL are listed below: - * - * UNIVERSAL 0 Reserved for use by the encoding rules - * UNIVERSAL 1 Boolean type - * UNIVERSAL 2 Integer type - * UNIVERSAL 3 Bitstring type - * UNIVERSAL 4 Octetstring type - * UNIVERSAL 5 Null type - * UNIVERSAL 6 Object identifier type - * UNIVERSAL 7 Object descriptor type - * UNIVERSAL 8 External type and Instance-of type - * UNIVERSAL 9 Real type - * UNIVERSAL 10 Enumerated type - * UNIVERSAL 11 Embedded-pdv type - * UNIVERSAL 12 UTF8String type - * UNIVERSAL 13 Relative object identifier type - * UNIVERSAL 14-15 Reserved for future editions - * UNIVERSAL 16 Sequence and Sequence-of types - * UNIVERSAL 17 Set and Set-of types - * UNIVERSAL 18-22, 25-30 Character string types - * UNIVERSAL 23-24 Time types - * - * The length of an ASN.1 structure is specified after the tag identifier. - * There is a definite form and an indefinite form. The indefinite form may - * be used if the encoding is constructed and not all immediately available. - * The indefinite form is encoded using a length byte with only the 8th bit - * set. The end of the constructed object is marked using end-of-contents - * octets (two zero bytes). - * - * The definite form looks like this: - * - * The length may take up 1 or more bytes, it depends on the length of the - * value of the ASN.1 structure. DER encoding requires that if the ASN.1 - * structure has a value that has a length greater than 127, more than 1 byte - * will be used to store its length, otherwise just one byte will be used. - * This is strict. - * - * In the case that the length of the ASN.1 value is less than 127, 1 octet - * (byte) is used to store the "short form" length. The 8th bit has a value of - * 0 indicating the length is "short form" and not "long form" and bits 7-1 - * give the length of the data. (The 8th bit is the left-most, most significant - * bit: also known as big endian or network format). - * - * In the case that the length of the ASN.1 value is greater than 127, 2 to - * 127 octets (bytes) are used to store the "long form" length. The first - * byte's 8th bit is set to 1 to indicate the length is "long form." Bits 7-1 - * give the number of additional octets. All following octets are in base 256 - * with the most significant digit first (typical big-endian binary unsigned - * integer storage). So, for instance, if the length of a value was 257, the - * first byte would be set to: - * - * 10000010 = 130 = 0x82. - * - * This indicates there are 2 octets (base 256) for the length. The second and - * third bytes (the octets just mentioned) would store the length in base 256: - * - * octet 2: 00000001 = 1 * 256^1 = 256 - * octet 3: 00000001 = 1 * 256^0 = 1 - * total = 257 - * - * The algorithm for converting a js integer value of 257 to base-256 is: - * - * var value = 257; - * var bytes = []; - * bytes[0] = (value >>> 8) & 0xFF; // most significant byte first - * bytes[1] = value & 0xFF; // least significant byte last - * - * On the ASN.1 UNIVERSAL Object Identifier (OID) type: - * - * An OID can be written like: "value1.value2.value3...valueN" - * - * The DER encoding rules: - * - * The first byte has the value 40 * value1 + value2. - * The following bytes, if any, encode the remaining values. Each value is - * encoded in base 128, most significant digit first (big endian), with as - * few digits as possible, and the most significant bit of each byte set - * to 1 except the last in each value's encoding. For example: Given the - * OID "1.2.840.113549", its DER encoding is (remember each byte except the - * last one in each encoding is OR'd with 0x80): - * - * byte 1: 40 * 1 + 2 = 42 = 0x2A. - * bytes 2-3: 128 * 6 + 72 = 840 = 6 72 = 6 72 = 0x0648 = 0x8648 - * bytes 4-6: 16384 * 6 + 128 * 119 + 13 = 6 119 13 = 0x06770D = 0x86F70D - * - * The final value is: 0x2A864886F70D. - * The full OID (including ASN.1 tag and length of 6 bytes) is: - * 0x06062A864886F70D - */ -var forge = require('./forge'); -require('./util'); -require('./oids'); - -/* ASN.1 API */ -var asn1 = module.exports = forge.asn1 = forge.asn1 || {}; - -/** - * ASN.1 classes. - */ -asn1.Class = { - UNIVERSAL: 0x00, - APPLICATION: 0x40, - CONTEXT_SPECIFIC: 0x80, - PRIVATE: 0xC0 -}; - -/** - * ASN.1 types. Not all types are supported by this implementation, only - * those necessary to implement a simple PKI are implemented. - */ -asn1.Type = { - NONE: 0, - BOOLEAN: 1, - INTEGER: 2, - BITSTRING: 3, - OCTETSTRING: 4, - NULL: 5, - OID: 6, - ODESC: 7, - EXTERNAL: 8, - REAL: 9, - ENUMERATED: 10, - EMBEDDED: 11, - UTF8: 12, - ROID: 13, - SEQUENCE: 16, - SET: 17, - PRINTABLESTRING: 19, - IA5STRING: 22, - UTCTIME: 23, - GENERALIZEDTIME: 24, - BMPSTRING: 30 -}; - -/** - * Creates a new asn1 object. - * - * @param tagClass the tag class for the object. - * @param type the data type (tag number) for the object. - * @param constructed true if the asn1 object is in constructed form. - * @param value the value for the object, if it is not constructed. - * @param [options] the options to use: - * [bitStringContents] the plain BIT STRING content including padding - * byte. - * - * @return the asn1 object. - */ -asn1.create = function(tagClass, type, constructed, value, options) { - /* An asn1 object has a tagClass, a type, a constructed flag, and a - value. The value's type depends on the constructed flag. If - constructed, it will contain a list of other asn1 objects. If not, - it will contain the ASN.1 value as an array of bytes formatted - according to the ASN.1 data type. */ - - // remove undefined values - if(forge.util.isArray(value)) { - var tmp = []; - for(var i = 0; i < value.length; ++i) { - if(value[i] !== undefined) { - tmp.push(value[i]); - } - } - value = tmp; - } - - var obj = { - tagClass: tagClass, - type: type, - constructed: constructed, - composed: constructed || forge.util.isArray(value), - value: value - }; - if(options && 'bitStringContents' in options) { - // TODO: copy byte buffer if it's a buffer not a string - obj.bitStringContents = options.bitStringContents; - // TODO: add readonly flag to avoid this overhead - // save copy to detect changes - obj.original = asn1.copy(obj); - } - return obj; -}; - -/** - * Copies an asn1 object. - * - * @param obj the asn1 object. - * @param [options] copy options: - * [excludeBitStringContents] true to not copy bitStringContents - * - * @return the a copy of the asn1 object. - */ -asn1.copy = function(obj, options) { - var copy; - - if(forge.util.isArray(obj)) { - copy = []; - for(var i = 0; i < obj.length; ++i) { - copy.push(asn1.copy(obj[i], options)); - } - return copy; - } - - if(typeof obj === 'string') { - // TODO: copy byte buffer if it's a buffer not a string - return obj; - } - - copy = { - tagClass: obj.tagClass, - type: obj.type, - constructed: obj.constructed, - composed: obj.composed, - value: asn1.copy(obj.value, options) - }; - if(options && !options.excludeBitStringContents) { - // TODO: copy byte buffer if it's a buffer not a string - copy.bitStringContents = obj.bitStringContents; - } - return copy; -}; - -/** - * Compares asn1 objects for equality. - * - * Note this function does not run in constant time. - * - * @param obj1 the first asn1 object. - * @param obj2 the second asn1 object. - * @param [options] compare options: - * [includeBitStringContents] true to compare bitStringContents - * - * @return true if the asn1 objects are equal. - */ -asn1.equals = function(obj1, obj2, options) { - if(forge.util.isArray(obj1)) { - if(!forge.util.isArray(obj2)) { - return false; - } - if(obj1.length !== obj2.length) { - return false; - } - for(var i = 0; i < obj1.length; ++i) { - if(!asn1.equals(obj1[i], obj2[i])) { - return false; - } - } - return true; - } - - if(typeof obj1 !== typeof obj2) { - return false; - } - - if(typeof obj1 === 'string') { - return obj1 === obj2; - } - - var equal = obj1.tagClass === obj2.tagClass && - obj1.type === obj2.type && - obj1.constructed === obj2.constructed && - obj1.composed === obj2.composed && - asn1.equals(obj1.value, obj2.value); - if(options && options.includeBitStringContents) { - equal = equal && (obj1.bitStringContents === obj2.bitStringContents); - } - - return equal; -}; - -/** - * Gets the length of a BER-encoded ASN.1 value. - * - * In case the length is not specified, undefined is returned. - * - * @param b the BER-encoded ASN.1 byte buffer, starting with the first - * length byte. - * - * @return the length of the BER-encoded ASN.1 value or undefined. - */ -asn1.getBerValueLength = function(b) { - // TODO: move this function and related DER/BER functions to a der.js - // file; better abstract ASN.1 away from der/ber. - var b2 = b.getByte(); - if(b2 === 0x80) { - return undefined; - } - - // see if the length is "short form" or "long form" (bit 8 set) - var length; - var longForm = b2 & 0x80; - if(!longForm) { - // length is just the first byte - length = b2; - } else { - // the number of bytes the length is specified in bits 7 through 1 - // and each length byte is in big-endian base-256 - length = b.getInt((b2 & 0x7F) << 3); - } - return length; -}; - -/** - * Check if the byte buffer has enough bytes. Throws an Error if not. - * - * @param bytes the byte buffer to parse from. - * @param remaining the bytes remaining in the current parsing state. - * @param n the number of bytes the buffer must have. - */ -function _checkBufferLength(bytes, remaining, n) { - if(n > remaining) { - var error = new Error('Too few bytes to parse DER.'); - error.available = bytes.length(); - error.remaining = remaining; - error.requested = n; - throw error; - } -} - -/** - * Gets the length of a BER-encoded ASN.1 value. - * - * In case the length is not specified, undefined is returned. - * - * @param bytes the byte buffer to parse from. - * @param remaining the bytes remaining in the current parsing state. - * - * @return the length of the BER-encoded ASN.1 value or undefined. - */ -var _getValueLength = function(bytes, remaining) { - // TODO: move this function and related DER/BER functions to a der.js - // file; better abstract ASN.1 away from der/ber. - // fromDer already checked that this byte exists - var b2 = bytes.getByte(); - remaining--; - if(b2 === 0x80) { - return undefined; - } - - // see if the length is "short form" or "long form" (bit 8 set) - var length; - var longForm = b2 & 0x80; - if(!longForm) { - // length is just the first byte - length = b2; - } else { - // the number of bytes the length is specified in bits 7 through 1 - // and each length byte is in big-endian base-256 - var longFormBytes = b2 & 0x7F; - _checkBufferLength(bytes, remaining, longFormBytes); - length = bytes.getInt(longFormBytes << 3); - } - // FIXME: this will only happen for 32 bit getInt with high bit set - if(length < 0) { - throw new Error('Negative length: ' + length); - } - return length; -}; - -/** - * Parses an asn1 object from a byte buffer in DER format. - * - * @param bytes the byte buffer to parse from. - * @param [strict] true to be strict when checking value lengths, false to - * allow truncated values (default: true). - * @param [options] object with options or boolean strict flag - * [strict] true to be strict when checking value lengths, false to - * allow truncated values (default: true). - * [parseAllBytes] true to ensure all bytes are parsed - * (default: true) - * [decodeBitStrings] true to attempt to decode the content of - * BIT STRINGs (not OCTET STRINGs) using strict mode. Note that - * without schema support to understand the data context this can - * erroneously decode values that happen to be valid ASN.1. This - * flag will be deprecated or removed as soon as schema support is - * available. (default: true) - * - * @throws Will throw an error for various malformed input conditions. - * - * @return the parsed asn1 object. - */ -asn1.fromDer = function(bytes, options) { - if(options === undefined) { - options = { - strict: true, - parseAllBytes: true, - decodeBitStrings: true - }; - } - if(typeof options === 'boolean') { - options = { - strict: options, - parseAllBytes: true, - decodeBitStrings: true - }; - } - if(!('strict' in options)) { - options.strict = true; - } - if(!('parseAllBytes' in options)) { - options.parseAllBytes = true; - } - if(!('decodeBitStrings' in options)) { - options.decodeBitStrings = true; - } - - // wrap in buffer if needed - if(typeof bytes === 'string') { - bytes = forge.util.createBuffer(bytes); - } - - var byteCount = bytes.length(); - var value = _fromDer(bytes, bytes.length(), 0, options); - if(options.parseAllBytes && bytes.length() !== 0) { - var error = new Error('Unparsed DER bytes remain after ASN.1 parsing.'); - error.byteCount = byteCount; - error.remaining = bytes.length(); - throw error; - } - return value; -}; - -/** - * Internal function to parse an asn1 object from a byte buffer in DER format. - * - * @param bytes the byte buffer to parse from. - * @param remaining the number of bytes remaining for this chunk. - * @param depth the current parsing depth. - * @param options object with same options as fromDer(). - * - * @return the parsed asn1 object. - */ -function _fromDer(bytes, remaining, depth, options) { - // temporary storage for consumption calculations - var start; - - // minimum length for ASN.1 DER structure is 2 - _checkBufferLength(bytes, remaining, 2); - - // get the first byte - var b1 = bytes.getByte(); - // consumed one byte - remaining--; - - // get the tag class - var tagClass = (b1 & 0xC0); - - // get the type (bits 1-5) - var type = b1 & 0x1F; - - // get the variable value length and adjust remaining bytes - start = bytes.length(); - var length = _getValueLength(bytes, remaining); - remaining -= start - bytes.length(); - - // ensure there are enough bytes to get the value - if(length !== undefined && length > remaining) { - if(options.strict) { - var error = new Error('Too few bytes to read ASN.1 value.'); - error.available = bytes.length(); - error.remaining = remaining; - error.requested = length; - throw error; - } - // Note: be lenient with truncated values and use remaining state bytes - length = remaining; - } - - // value storage - var value; - // possible BIT STRING contents storage - var bitStringContents; - - // constructed flag is bit 6 (32 = 0x20) of the first byte - var constructed = ((b1 & 0x20) === 0x20); - if(constructed) { - // parse child asn1 objects from the value - value = []; - if(length === undefined) { - // asn1 object of indefinite length, read until end tag - for(;;) { - _checkBufferLength(bytes, remaining, 2); - if(bytes.bytes(2) === String.fromCharCode(0, 0)) { - bytes.getBytes(2); - remaining -= 2; - break; - } - start = bytes.length(); - value.push(_fromDer(bytes, remaining, depth + 1, options)); - remaining -= start - bytes.length(); - } - } else { - // parsing asn1 object of definite length - while(length > 0) { - start = bytes.length(); - value.push(_fromDer(bytes, length, depth + 1, options)); - remaining -= start - bytes.length(); - length -= start - bytes.length(); - } - } - } - - // if a BIT STRING, save the contents including padding - if(value === undefined && tagClass === asn1.Class.UNIVERSAL && - type === asn1.Type.BITSTRING) { - bitStringContents = bytes.bytes(length); - } - - // determine if a non-constructed value should be decoded as a composed - // value that contains other ASN.1 objects. BIT STRINGs (and OCTET STRINGs) - // can be used this way. - if(value === undefined && options.decodeBitStrings && - tagClass === asn1.Class.UNIVERSAL && - // FIXME: OCTET STRINGs not yet supported here - // .. other parts of forge expect to decode OCTET STRINGs manually - (type === asn1.Type.BITSTRING /*|| type === asn1.Type.OCTETSTRING*/) && - length > 1) { - // save read position - var savedRead = bytes.read; - var savedRemaining = remaining; - var unused = 0; - if(type === asn1.Type.BITSTRING) { - /* The first octet gives the number of bits by which the length of the - bit string is less than the next multiple of eight (this is called - the "number of unused bits"). - - The second and following octets give the value of the bit string - converted to an octet string. */ - _checkBufferLength(bytes, remaining, 1); - unused = bytes.getByte(); - remaining--; - } - // if all bits are used, maybe the BIT/OCTET STRING holds ASN.1 objs - if(unused === 0) { - try { - // attempt to parse child asn1 object from the value - // (stored in array to signal composed value) - start = bytes.length(); - var subOptions = { - // enforce strict mode to avoid parsing ASN.1 from plain data - strict: true, - decodeBitStrings: true - }; - var composed = _fromDer(bytes, remaining, depth + 1, subOptions); - var used = start - bytes.length(); - remaining -= used; - if(type == asn1.Type.BITSTRING) { - used++; - } - - // if the data all decoded and the class indicates UNIVERSAL or - // CONTEXT_SPECIFIC then assume we've got an encapsulated ASN.1 object - var tc = composed.tagClass; - if(used === length && - (tc === asn1.Class.UNIVERSAL || tc === asn1.Class.CONTEXT_SPECIFIC)) { - value = [composed]; - } - } catch(ex) { - } - } - if(value === undefined) { - // restore read position - bytes.read = savedRead; - remaining = savedRemaining; - } - } - - if(value === undefined) { - // asn1 not constructed or composed, get raw value - // TODO: do DER to OID conversion and vice-versa in .toDer? - - if(length === undefined) { - if(options.strict) { - throw new Error('Non-constructed ASN.1 object of indefinite length.'); - } - // be lenient and use remaining state bytes - length = remaining; - } - - if(type === asn1.Type.BMPSTRING) { - value = ''; - for(; length > 0; length -= 2) { - _checkBufferLength(bytes, remaining, 2); - value += String.fromCharCode(bytes.getInt16()); - remaining -= 2; - } - } else { - value = bytes.getBytes(length); - remaining -= length; - } - } - - // add BIT STRING contents if available - var asn1Options = bitStringContents === undefined ? null : { - bitStringContents: bitStringContents - }; - - // create and return asn1 object - return asn1.create(tagClass, type, constructed, value, asn1Options); -} - -/** - * Converts the given asn1 object to a buffer of bytes in DER format. - * - * @param asn1 the asn1 object to convert to bytes. - * - * @return the buffer of bytes. - */ -asn1.toDer = function(obj) { - var bytes = forge.util.createBuffer(); - - // build the first byte - var b1 = obj.tagClass | obj.type; - - // for storing the ASN.1 value - var value = forge.util.createBuffer(); - - // use BIT STRING contents if available and data not changed - var useBitStringContents = false; - if('bitStringContents' in obj) { - useBitStringContents = true; - if(obj.original) { - useBitStringContents = asn1.equals(obj, obj.original); - } - } - - if(useBitStringContents) { - value.putBytes(obj.bitStringContents); - } else if(obj.composed) { - // if composed, use each child asn1 object's DER bytes as value - // turn on 6th bit (0x20 = 32) to indicate asn1 is constructed - // from other asn1 objects - if(obj.constructed) { - b1 |= 0x20; - } else { - // type is a bit string, add unused bits of 0x00 - value.putByte(0x00); - } - - // add all of the child DER bytes together - for(var i = 0; i < obj.value.length; ++i) { - if(obj.value[i] !== undefined) { - value.putBuffer(asn1.toDer(obj.value[i])); - } - } - } else { - // use asn1.value directly - if(obj.type === asn1.Type.BMPSTRING) { - for(var i = 0; i < obj.value.length; ++i) { - value.putInt16(obj.value.charCodeAt(i)); - } - } else { - // ensure integer is minimally-encoded - // TODO: should all leading bytes be stripped vs just one? - // .. ex '00 00 01' => '01'? - if(obj.type === asn1.Type.INTEGER && - obj.value.length > 1 && - // leading 0x00 for positive integer - ((obj.value.charCodeAt(0) === 0 && - (obj.value.charCodeAt(1) & 0x80) === 0) || - // leading 0xFF for negative integer - (obj.value.charCodeAt(0) === 0xFF && - (obj.value.charCodeAt(1) & 0x80) === 0x80))) { - value.putBytes(obj.value.substr(1)); - } else { - value.putBytes(obj.value); - } - } - } - - // add tag byte - bytes.putByte(b1); - - // use "short form" encoding - if(value.length() <= 127) { - // one byte describes the length - // bit 8 = 0 and bits 7-1 = length - bytes.putByte(value.length() & 0x7F); - } else { - // use "long form" encoding - // 2 to 127 bytes describe the length - // first byte: bit 8 = 1 and bits 7-1 = # of additional bytes - // other bytes: length in base 256, big-endian - var len = value.length(); - var lenBytes = ''; - do { - lenBytes += String.fromCharCode(len & 0xFF); - len = len >>> 8; - } while(len > 0); - - // set first byte to # bytes used to store the length and turn on - // bit 8 to indicate long-form length is used - bytes.putByte(lenBytes.length | 0x80); - - // concatenate length bytes in reverse since they were generated - // little endian and we need big endian - for(var i = lenBytes.length - 1; i >= 0; --i) { - bytes.putByte(lenBytes.charCodeAt(i)); - } - } - - // concatenate value bytes - bytes.putBuffer(value); - return bytes; -}; - -/** - * Converts an OID dot-separated string to a byte buffer. The byte buffer - * contains only the DER-encoded value, not any tag or length bytes. - * - * @param oid the OID dot-separated string. - * - * @return the byte buffer. - */ -asn1.oidToDer = function(oid) { - // split OID into individual values - var values = oid.split('.'); - var bytes = forge.util.createBuffer(); - - // first byte is 40 * value1 + value2 - bytes.putByte(40 * parseInt(values[0], 10) + parseInt(values[1], 10)); - // other bytes are each value in base 128 with 8th bit set except for - // the last byte for each value - var last, valueBytes, value, b; - for(var i = 2; i < values.length; ++i) { - // produce value bytes in reverse because we don't know how many - // bytes it will take to store the value - last = true; - valueBytes = []; - value = parseInt(values[i], 10); - do { - b = value & 0x7F; - value = value >>> 7; - // if value is not last, then turn on 8th bit - if(!last) { - b |= 0x80; - } - valueBytes.push(b); - last = false; - } while(value > 0); - - // add value bytes in reverse (needs to be in big endian) - for(var n = valueBytes.length - 1; n >= 0; --n) { - bytes.putByte(valueBytes[n]); - } - } - - return bytes; -}; - -/** - * Converts a DER-encoded byte buffer to an OID dot-separated string. The - * byte buffer should contain only the DER-encoded value, not any tag or - * length bytes. - * - * @param bytes the byte buffer. - * - * @return the OID dot-separated string. - */ -asn1.derToOid = function(bytes) { - var oid; - - // wrap in buffer if needed - if(typeof bytes === 'string') { - bytes = forge.util.createBuffer(bytes); - } - - // first byte is 40 * value1 + value2 - var b = bytes.getByte(); - oid = Math.floor(b / 40) + '.' + (b % 40); - - // other bytes are each value in base 128 with 8th bit set except for - // the last byte for each value - var value = 0; - while(bytes.length() > 0) { - b = bytes.getByte(); - value = value << 7; - // not the last byte for the value - if(b & 0x80) { - value += b & 0x7F; - } else { - // last byte - oid += '.' + (value + b); - value = 0; - } - } - - return oid; -}; - -/** - * Converts a UTCTime value to a date. - * - * Note: GeneralizedTime has 4 digits for the year and is used for X.509 - * dates past 2049. Parsing that structure hasn't been implemented yet. - * - * @param utc the UTCTime value to convert. - * - * @return the date. - */ -asn1.utcTimeToDate = function(utc) { - /* The following formats can be used: - - YYMMDDhhmmZ - YYMMDDhhmm+hh'mm' - YYMMDDhhmm-hh'mm' - YYMMDDhhmmssZ - YYMMDDhhmmss+hh'mm' - YYMMDDhhmmss-hh'mm' - - Where: - - YY is the least significant two digits of the year - MM is the month (01 to 12) - DD is the day (01 to 31) - hh is the hour (00 to 23) - mm are the minutes (00 to 59) - ss are the seconds (00 to 59) - Z indicates that local time is GMT, + indicates that local time is - later than GMT, and - indicates that local time is earlier than GMT - hh' is the absolute value of the offset from GMT in hours - mm' is the absolute value of the offset from GMT in minutes */ - var date = new Date(); - - // if YY >= 50 use 19xx, if YY < 50 use 20xx - var year = parseInt(utc.substr(0, 2), 10); - year = (year >= 50) ? 1900 + year : 2000 + year; - var MM = parseInt(utc.substr(2, 2), 10) - 1; // use 0-11 for month - var DD = parseInt(utc.substr(4, 2), 10); - var hh = parseInt(utc.substr(6, 2), 10); - var mm = parseInt(utc.substr(8, 2), 10); - var ss = 0; - - // not just YYMMDDhhmmZ - if(utc.length > 11) { - // get character after minutes - var c = utc.charAt(10); - var end = 10; - - // see if seconds are present - if(c !== '+' && c !== '-') { - // get seconds - ss = parseInt(utc.substr(10, 2), 10); - end += 2; - } - } - - // update date - date.setUTCFullYear(year, MM, DD); - date.setUTCHours(hh, mm, ss, 0); - - if(end) { - // get +/- after end of time - c = utc.charAt(end); - if(c === '+' || c === '-') { - // get hours+minutes offset - var hhoffset = parseInt(utc.substr(end + 1, 2), 10); - var mmoffset = parseInt(utc.substr(end + 4, 2), 10); - - // calculate offset in milliseconds - var offset = hhoffset * 60 + mmoffset; - offset *= 60000; - - // apply offset - if(c === '+') { - date.setTime(+date - offset); - } else { - date.setTime(+date + offset); - } - } - } - - return date; -}; - -/** - * Converts a GeneralizedTime value to a date. - * - * @param gentime the GeneralizedTime value to convert. - * - * @return the date. - */ -asn1.generalizedTimeToDate = function(gentime) { - /* The following formats can be used: - - YYYYMMDDHHMMSS - YYYYMMDDHHMMSS.fff - YYYYMMDDHHMMSSZ - YYYYMMDDHHMMSS.fffZ - YYYYMMDDHHMMSS+hh'mm' - YYYYMMDDHHMMSS.fff+hh'mm' - YYYYMMDDHHMMSS-hh'mm' - YYYYMMDDHHMMSS.fff-hh'mm' - - Where: - - YYYY is the year - MM is the month (01 to 12) - DD is the day (01 to 31) - hh is the hour (00 to 23) - mm are the minutes (00 to 59) - ss are the seconds (00 to 59) - .fff is the second fraction, accurate to three decimal places - Z indicates that local time is GMT, + indicates that local time is - later than GMT, and - indicates that local time is earlier than GMT - hh' is the absolute value of the offset from GMT in hours - mm' is the absolute value of the offset from GMT in minutes */ - var date = new Date(); - - var YYYY = parseInt(gentime.substr(0, 4), 10); - var MM = parseInt(gentime.substr(4, 2), 10) - 1; // use 0-11 for month - var DD = parseInt(gentime.substr(6, 2), 10); - var hh = parseInt(gentime.substr(8, 2), 10); - var mm = parseInt(gentime.substr(10, 2), 10); - var ss = parseInt(gentime.substr(12, 2), 10); - var fff = 0; - var offset = 0; - var isUTC = false; - - if(gentime.charAt(gentime.length - 1) === 'Z') { - isUTC = true; - } - - var end = gentime.length - 5, c = gentime.charAt(end); - if(c === '+' || c === '-') { - // get hours+minutes offset - var hhoffset = parseInt(gentime.substr(end + 1, 2), 10); - var mmoffset = parseInt(gentime.substr(end + 4, 2), 10); - - // calculate offset in milliseconds - offset = hhoffset * 60 + mmoffset; - offset *= 60000; - - // apply offset - if(c === '+') { - offset *= -1; - } - - isUTC = true; - } - - // check for second fraction - if(gentime.charAt(14) === '.') { - fff = parseFloat(gentime.substr(14), 10) * 1000; - } - - if(isUTC) { - date.setUTCFullYear(YYYY, MM, DD); - date.setUTCHours(hh, mm, ss, fff); - - // apply offset - date.setTime(+date + offset); - } else { - date.setFullYear(YYYY, MM, DD); - date.setHours(hh, mm, ss, fff); - } - - return date; -}; - -/** - * Converts a date to a UTCTime value. - * - * Note: GeneralizedTime has 4 digits for the year and is used for X.509 - * dates past 2049. Converting to a GeneralizedTime hasn't been - * implemented yet. - * - * @param date the date to convert. - * - * @return the UTCTime value. - */ -asn1.dateToUtcTime = function(date) { - // TODO: validate; currently assumes proper format - if(typeof date === 'string') { - return date; - } - - var rval = ''; - - // create format YYMMDDhhmmssZ - var format = []; - format.push(('' + date.getUTCFullYear()).substr(2)); - format.push('' + (date.getUTCMonth() + 1)); - format.push('' + date.getUTCDate()); - format.push('' + date.getUTCHours()); - format.push('' + date.getUTCMinutes()); - format.push('' + date.getUTCSeconds()); - - // ensure 2 digits are used for each format entry - for(var i = 0; i < format.length; ++i) { - if(format[i].length < 2) { - rval += '0'; - } - rval += format[i]; - } - rval += 'Z'; - - return rval; -}; - -/** - * Converts a date to a GeneralizedTime value. - * - * @param date the date to convert. - * - * @return the GeneralizedTime value as a string. - */ -asn1.dateToGeneralizedTime = function(date) { - // TODO: validate; currently assumes proper format - if(typeof date === 'string') { - return date; - } - - var rval = ''; - - // create format YYYYMMDDHHMMSSZ - var format = []; - format.push('' + date.getUTCFullYear()); - format.push('' + (date.getUTCMonth() + 1)); - format.push('' + date.getUTCDate()); - format.push('' + date.getUTCHours()); - format.push('' + date.getUTCMinutes()); - format.push('' + date.getUTCSeconds()); - - // ensure 2 digits are used for each format entry - for(var i = 0; i < format.length; ++i) { - if(format[i].length < 2) { - rval += '0'; - } - rval += format[i]; - } - rval += 'Z'; - - return rval; -}; - -/** - * Converts a javascript integer to a DER-encoded byte buffer to be used - * as the value for an INTEGER type. - * - * @param x the integer. - * - * @return the byte buffer. - */ -asn1.integerToDer = function(x) { - var rval = forge.util.createBuffer(); - if(x >= -0x80 && x < 0x80) { - return rval.putSignedInt(x, 8); - } - if(x >= -0x8000 && x < 0x8000) { - return rval.putSignedInt(x, 16); - } - if(x >= -0x800000 && x < 0x800000) { - return rval.putSignedInt(x, 24); - } - if(x >= -0x80000000 && x < 0x80000000) { - return rval.putSignedInt(x, 32); - } - var error = new Error('Integer too large; max is 32-bits.'); - error.integer = x; - throw error; -}; - -/** - * Converts a DER-encoded byte buffer to a javascript integer. This is - * typically used to decode the value of an INTEGER type. - * - * @param bytes the byte buffer. - * - * @return the integer. - */ -asn1.derToInteger = function(bytes) { - // wrap in buffer if needed - if(typeof bytes === 'string') { - bytes = forge.util.createBuffer(bytes); - } - - var n = bytes.length() * 8; - if(n > 32) { - throw new Error('Integer too large; max is 32-bits.'); - } - return bytes.getSignedInt(n); -}; - -/** - * Validates that the given ASN.1 object is at least a super set of the - * given ASN.1 structure. Only tag classes and types are checked. An - * optional map may also be provided to capture ASN.1 values while the - * structure is checked. - * - * To capture an ASN.1 value, set an object in the validator's 'capture' - * parameter to the key to use in the capture map. To capture the full - * ASN.1 object, specify 'captureAsn1'. To capture BIT STRING bytes, including - * the leading unused bits counter byte, specify 'captureBitStringContents'. - * To capture BIT STRING bytes, without the leading unused bits counter byte, - * specify 'captureBitStringValue'. - * - * Objects in the validator may set a field 'optional' to true to indicate - * that it isn't necessary to pass validation. - * - * @param obj the ASN.1 object to validate. - * @param v the ASN.1 structure validator. - * @param capture an optional map to capture values in. - * @param errors an optional array for storing validation errors. - * - * @return true on success, false on failure. - */ -asn1.validate = function(obj, v, capture, errors) { - var rval = false; - - // ensure tag class and type are the same if specified - if((obj.tagClass === v.tagClass || typeof(v.tagClass) === 'undefined') && - (obj.type === v.type || typeof(v.type) === 'undefined')) { - // ensure constructed flag is the same if specified - if(obj.constructed === v.constructed || - typeof(v.constructed) === 'undefined') { - rval = true; - - // handle sub values - if(v.value && forge.util.isArray(v.value)) { - var j = 0; - for(var i = 0; rval && i < v.value.length; ++i) { - rval = v.value[i].optional || false; - if(obj.value[j]) { - rval = asn1.validate(obj.value[j], v.value[i], capture, errors); - if(rval) { - ++j; - } else if(v.value[i].optional) { - rval = true; - } - } - if(!rval && errors) { - errors.push( - '[' + v.name + '] ' + - 'Tag class "' + v.tagClass + '", type "' + - v.type + '" expected value length "' + - v.value.length + '", got "' + - obj.value.length + '"'); - } - } - } - - if(rval && capture) { - if(v.capture) { - capture[v.capture] = obj.value; - } - if(v.captureAsn1) { - capture[v.captureAsn1] = obj; - } - if(v.captureBitStringContents && 'bitStringContents' in obj) { - capture[v.captureBitStringContents] = obj.bitStringContents; - } - if(v.captureBitStringValue && 'bitStringContents' in obj) { - var value; - if(obj.bitStringContents.length < 2) { - capture[v.captureBitStringValue] = ''; - } else { - // FIXME: support unused bits with data shifting - var unused = obj.bitStringContents.charCodeAt(0); - if(unused !== 0) { - throw new Error( - 'captureBitStringValue only supported for zero unused bits'); - } - capture[v.captureBitStringValue] = obj.bitStringContents.slice(1); - } - } - } - } else if(errors) { - errors.push( - '[' + v.name + '] ' + - 'Expected constructed "' + v.constructed + '", got "' + - obj.constructed + '"'); - } - } else if(errors) { - if(obj.tagClass !== v.tagClass) { - errors.push( - '[' + v.name + '] ' + - 'Expected tag class "' + v.tagClass + '", got "' + - obj.tagClass + '"'); - } - if(obj.type !== v.type) { - errors.push( - '[' + v.name + '] ' + - 'Expected type "' + v.type + '", got "' + obj.type + '"'); - } - } - return rval; -}; - -// regex for testing for non-latin characters -var _nonLatinRegex = /[^\\u0000-\\u00ff]/; - -/** - * Pretty prints an ASN.1 object to a string. - * - * @param obj the object to write out. - * @param level the level in the tree. - * @param indentation the indentation to use. - * - * @return the string. - */ -asn1.prettyPrint = function(obj, level, indentation) { - var rval = ''; - - // set default level and indentation - level = level || 0; - indentation = indentation || 2; - - // start new line for deep levels - if(level > 0) { - rval += '\n'; - } - - // create indent - var indent = ''; - for(var i = 0; i < level * indentation; ++i) { - indent += ' '; - } - - // print class:type - rval += indent + 'Tag: '; - switch(obj.tagClass) { - case asn1.Class.UNIVERSAL: - rval += 'Universal:'; - break; - case asn1.Class.APPLICATION: - rval += 'Application:'; - break; - case asn1.Class.CONTEXT_SPECIFIC: - rval += 'Context-Specific:'; - break; - case asn1.Class.PRIVATE: - rval += 'Private:'; - break; - } - - if(obj.tagClass === asn1.Class.UNIVERSAL) { - rval += obj.type; - - // known types - switch(obj.type) { - case asn1.Type.NONE: - rval += ' (None)'; - break; - case asn1.Type.BOOLEAN: - rval += ' (Boolean)'; - break; - case asn1.Type.INTEGER: - rval += ' (Integer)'; - break; - case asn1.Type.BITSTRING: - rval += ' (Bit string)'; - break; - case asn1.Type.OCTETSTRING: - rval += ' (Octet string)'; - break; - case asn1.Type.NULL: - rval += ' (Null)'; - break; - case asn1.Type.OID: - rval += ' (Object Identifier)'; - break; - case asn1.Type.ODESC: - rval += ' (Object Descriptor)'; - break; - case asn1.Type.EXTERNAL: - rval += ' (External or Instance of)'; - break; - case asn1.Type.REAL: - rval += ' (Real)'; - break; - case asn1.Type.ENUMERATED: - rval += ' (Enumerated)'; - break; - case asn1.Type.EMBEDDED: - rval += ' (Embedded PDV)'; - break; - case asn1.Type.UTF8: - rval += ' (UTF8)'; - break; - case asn1.Type.ROID: - rval += ' (Relative Object Identifier)'; - break; - case asn1.Type.SEQUENCE: - rval += ' (Sequence)'; - break; - case asn1.Type.SET: - rval += ' (Set)'; - break; - case asn1.Type.PRINTABLESTRING: - rval += ' (Printable String)'; - break; - case asn1.Type.IA5String: - rval += ' (IA5String (ASCII))'; - break; - case asn1.Type.UTCTIME: - rval += ' (UTC time)'; - break; - case asn1.Type.GENERALIZEDTIME: - rval += ' (Generalized time)'; - break; - case asn1.Type.BMPSTRING: - rval += ' (BMP String)'; - break; - } - } else { - rval += obj.type; - } - - rval += '\n'; - rval += indent + 'Constructed: ' + obj.constructed + '\n'; - - if(obj.composed) { - var subvalues = 0; - var sub = ''; - for(var i = 0; i < obj.value.length; ++i) { - if(obj.value[i] !== undefined) { - subvalues += 1; - sub += asn1.prettyPrint(obj.value[i], level + 1, indentation); - if((i + 1) < obj.value.length) { - sub += ','; - } - } - } - rval += indent + 'Sub values: ' + subvalues + sub; - } else { - rval += indent + 'Value: '; - if(obj.type === asn1.Type.OID) { - var oid = asn1.derToOid(obj.value); - rval += oid; - if(forge.pki && forge.pki.oids) { - if(oid in forge.pki.oids) { - rval += ' (' + forge.pki.oids[oid] + ') '; - } - } - } - if(obj.type === asn1.Type.INTEGER) { - try { - rval += asn1.derToInteger(obj.value); - } catch(ex) { - rval += '0x' + forge.util.bytesToHex(obj.value); - } - } else if(obj.type === asn1.Type.BITSTRING) { - // TODO: shift bits as needed to display without padding - if(obj.value.length > 1) { - // remove unused bits field - rval += '0x' + forge.util.bytesToHex(obj.value.slice(1)); - } else { - rval += '(none)'; - } - // show unused bit count - if(obj.value.length > 0) { - var unused = obj.value.charCodeAt(0); - if(unused == 1) { - rval += ' (1 unused bit shown)'; - } else if(unused > 1) { - rval += ' (' + unused + ' unused bits shown)'; - } - } - } else if(obj.type === asn1.Type.OCTETSTRING) { - if(!_nonLatinRegex.test(obj.value)) { - rval += '(' + obj.value + ') '; - } - rval += '0x' + forge.util.bytesToHex(obj.value); - } else if(obj.type === asn1.Type.UTF8) { - try { - rval += forge.util.decodeUtf8(obj.value); - } catch(e) { - if(e.message === 'URI malformed') { - rval += - '0x' + forge.util.bytesToHex(obj.value) + ' (malformed UTF8)'; - } else { - throw e; - } - } - } else if(obj.type === asn1.Type.PRINTABLESTRING || - obj.type === asn1.Type.IA5String) { - rval += obj.value; - } else if(_nonLatinRegex.test(obj.value)) { - rval += '0x' + forge.util.bytesToHex(obj.value); - } else if(obj.value.length === 0) { - rval += '[null]'; - } else { - rval += obj.value; - } - } - - return rval; -}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/baseN.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/baseN.js deleted file mode 100644 index 824fa36d..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/baseN.js +++ /dev/null @@ -1,186 +0,0 @@ -/** - * Base-N/Base-X encoding/decoding functions. - * - * Original implementation from base-x: - * https://github.com/cryptocoinjs/base-x - * - * Which is MIT licensed: - * - * The MIT License (MIT) - * - * Copyright base-x contributors (c) 2016 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ -var api = {}; -module.exports = api; - -// baseN alphabet indexes -var _reverseAlphabets = {}; - -/** - * BaseN-encodes a Uint8Array using the given alphabet. - * - * @param input the Uint8Array to encode. - * @param maxline the maximum number of encoded characters per line to use, - * defaults to none. - * - * @return the baseN-encoded output string. - */ -api.encode = function(input, alphabet, maxline) { - if(typeof alphabet !== 'string') { - throw new TypeError('"alphabet" must be a string.'); - } - if(maxline !== undefined && typeof maxline !== 'number') { - throw new TypeError('"maxline" must be a number.'); - } - - var output = ''; - - if(!(input instanceof Uint8Array)) { - // assume forge byte buffer - output = _encodeWithByteBuffer(input, alphabet); - } else { - var i = 0; - var base = alphabet.length; - var first = alphabet.charAt(0); - var digits = [0]; - for(i = 0; i < input.length; ++i) { - for(var j = 0, carry = input[i]; j < digits.length; ++j) { - carry += digits[j] << 8; - digits[j] = carry % base; - carry = (carry / base) | 0; - } - - while(carry > 0) { - digits.push(carry % base); - carry = (carry / base) | 0; - } - } - - // deal with leading zeros - for(i = 0; input[i] === 0 && i < input.length - 1; ++i) { - output += first; - } - // convert digits to a string - for(i = digits.length - 1; i >= 0; --i) { - output += alphabet[digits[i]]; - } - } - - if(maxline) { - var regex = new RegExp('.{1,' + maxline + '}', 'g'); - output = output.match(regex).join('\r\n'); - } - - return output; -}; - -/** - * Decodes a baseN-encoded (using the given alphabet) string to a - * Uint8Array. - * - * @param input the baseN-encoded input string. - * - * @return the Uint8Array. - */ -api.decode = function(input, alphabet) { - if(typeof input !== 'string') { - throw new TypeError('"input" must be a string.'); - } - if(typeof alphabet !== 'string') { - throw new TypeError('"alphabet" must be a string.'); - } - - var table = _reverseAlphabets[alphabet]; - if(!table) { - // compute reverse alphabet - table = _reverseAlphabets[alphabet] = []; - for(var i = 0; i < alphabet.length; ++i) { - table[alphabet.charCodeAt(i)] = i; - } - } - - // remove whitespace characters - input = input.replace(/\s/g, ''); - - var base = alphabet.length; - var first = alphabet.charAt(0); - var bytes = [0]; - for(var i = 0; i < input.length; i++) { - var value = table[input.charCodeAt(i)]; - if(value === undefined) { - return; - } - - for(var j = 0, carry = value; j < bytes.length; ++j) { - carry += bytes[j] * base; - bytes[j] = carry & 0xff; - carry >>= 8; - } - - while(carry > 0) { - bytes.push(carry & 0xff); - carry >>= 8; - } - } - - // deal with leading zeros - for(var k = 0; input[k] === first && k < input.length - 1; ++k) { - bytes.push(0); - } - - if(typeof Buffer !== 'undefined') { - return Buffer.from(bytes.reverse()); - } - - return new Uint8Array(bytes.reverse()); -}; - -function _encodeWithByteBuffer(input, alphabet) { - var i = 0; - var base = alphabet.length; - var first = alphabet.charAt(0); - var digits = [0]; - for(i = 0; i < input.length(); ++i) { - for(var j = 0, carry = input.at(i); j < digits.length; ++j) { - carry += digits[j] << 8; - digits[j] = carry % base; - carry = (carry / base) | 0; - } - - while(carry > 0) { - digits.push(carry % base); - carry = (carry / base) | 0; - } - } - - var output = ''; - - // deal with leading zeros - for(i = 0; input.at(i) === 0 && i < input.length() - 1; ++i) { - output += first; - } - // convert digits to a string - for(i = digits.length - 1; i >= 0; --i) { - output += alphabet[digits[i]]; - } - - return output; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/cipher.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/cipher.js deleted file mode 100644 index f2c36e65..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/cipher.js +++ /dev/null @@ -1,230 +0,0 @@ -/** - * Cipher base API. - * - * @author Dave Longley - * - * Copyright (c) 2010-2014 Digital Bazaar, Inc. - */ -var forge = require('./forge'); -require('./util'); - -module.exports = forge.cipher = forge.cipher || {}; - -// registered algorithms -forge.cipher.algorithms = forge.cipher.algorithms || {}; - -/** - * Creates a cipher object that can be used to encrypt data using the given - * algorithm and key. The algorithm may be provided as a string value for a - * previously registered algorithm or it may be given as a cipher algorithm - * API object. - * - * @param algorithm the algorithm to use, either a string or an algorithm API - * object. - * @param key the key to use, as a binary-encoded string of bytes or a - * byte buffer. - * - * @return the cipher. - */ -forge.cipher.createCipher = function(algorithm, key) { - var api = algorithm; - if(typeof api === 'string') { - api = forge.cipher.getAlgorithm(api); - if(api) { - api = api(); - } - } - if(!api) { - throw new Error('Unsupported algorithm: ' + algorithm); - } - - // assume block cipher - return new forge.cipher.BlockCipher({ - algorithm: api, - key: key, - decrypt: false - }); -}; - -/** - * Creates a decipher object that can be used to decrypt data using the given - * algorithm and key. The algorithm may be provided as a string value for a - * previously registered algorithm or it may be given as a cipher algorithm - * API object. - * - * @param algorithm the algorithm to use, either a string or an algorithm API - * object. - * @param key the key to use, as a binary-encoded string of bytes or a - * byte buffer. - * - * @return the cipher. - */ -forge.cipher.createDecipher = function(algorithm, key) { - var api = algorithm; - if(typeof api === 'string') { - api = forge.cipher.getAlgorithm(api); - if(api) { - api = api(); - } - } - if(!api) { - throw new Error('Unsupported algorithm: ' + algorithm); - } - - // assume block cipher - return new forge.cipher.BlockCipher({ - algorithm: api, - key: key, - decrypt: true - }); -}; - -/** - * Registers an algorithm by name. If the name was already registered, the - * algorithm API object will be overwritten. - * - * @param name the name of the algorithm. - * @param algorithm the algorithm API object. - */ -forge.cipher.registerAlgorithm = function(name, algorithm) { - name = name.toUpperCase(); - forge.cipher.algorithms[name] = algorithm; -}; - -/** - * Gets a registered algorithm by name. - * - * @param name the name of the algorithm. - * - * @return the algorithm, if found, null if not. - */ -forge.cipher.getAlgorithm = function(name) { - name = name.toUpperCase(); - if(name in forge.cipher.algorithms) { - return forge.cipher.algorithms[name]; - } - return null; -}; - -var BlockCipher = forge.cipher.BlockCipher = function(options) { - this.algorithm = options.algorithm; - this.mode = this.algorithm.mode; - this.blockSize = this.mode.blockSize; - this._finish = false; - this._input = null; - this.output = null; - this._op = options.decrypt ? this.mode.decrypt : this.mode.encrypt; - this._decrypt = options.decrypt; - this.algorithm.initialize(options); -}; - -/** - * Starts or restarts the encryption or decryption process, whichever - * was previously configured. - * - * For non-GCM mode, the IV may be a binary-encoded string of bytes, an array - * of bytes, a byte buffer, or an array of 32-bit integers. If the IV is in - * bytes, then it must be Nb (16) bytes in length. If the IV is given in as - * 32-bit integers, then it must be 4 integers long. - * - * Note: an IV is not required or used in ECB mode. - * - * For GCM-mode, the IV must be given as a binary-encoded string of bytes or - * a byte buffer. The number of bytes should be 12 (96 bits) as recommended - * by NIST SP-800-38D but another length may be given. - * - * @param options the options to use: - * iv the initialization vector to use as a binary-encoded string of - * bytes, null to reuse the last ciphered block from a previous - * update() (this "residue" method is for legacy support only). - * additionalData additional authentication data as a binary-encoded - * string of bytes, for 'GCM' mode, (default: none). - * tagLength desired length of authentication tag, in bits, for - * 'GCM' mode (0-128, default: 128). - * tag the authentication tag to check if decrypting, as a - * binary-encoded string of bytes. - * output the output the buffer to write to, null to create one. - */ -BlockCipher.prototype.start = function(options) { - options = options || {}; - var opts = {}; - for(var key in options) { - opts[key] = options[key]; - } - opts.decrypt = this._decrypt; - this._finish = false; - this._input = forge.util.createBuffer(); - this.output = options.output || forge.util.createBuffer(); - this.mode.start(opts); -}; - -/** - * Updates the next block according to the cipher mode. - * - * @param input the buffer to read from. - */ -BlockCipher.prototype.update = function(input) { - if(input) { - // input given, so empty it into the input buffer - this._input.putBuffer(input); - } - - // do cipher operation until it needs more input and not finished - while(!this._op.call(this.mode, this._input, this.output, this._finish) && - !this._finish) {} - - // free consumed memory from input buffer - this._input.compact(); -}; - -/** - * Finishes encrypting or decrypting. - * - * @param pad a padding function to use in CBC mode, null for default, - * signature(blockSize, buffer, decrypt). - * - * @return true if successful, false on error. - */ -BlockCipher.prototype.finish = function(pad) { - // backwards-compatibility w/deprecated padding API - // Note: will overwrite padding functions even after another start() call - if(pad && (this.mode.name === 'ECB' || this.mode.name === 'CBC')) { - this.mode.pad = function(input) { - return pad(this.blockSize, input, false); - }; - this.mode.unpad = function(output) { - return pad(this.blockSize, output, true); - }; - } - - // build options for padding and afterFinish functions - var options = {}; - options.decrypt = this._decrypt; - - // get # of bytes that won't fill a block - options.overflow = this._input.length() % this.blockSize; - - if(!this._decrypt && this.mode.pad) { - if(!this.mode.pad(this._input, options)) { - return false; - } - } - - // do final update - this._finish = true; - this.update(); - - if(this._decrypt && this.mode.unpad) { - if(!this.mode.unpad(this.output, options)) { - return false; - } - } - - if(this.mode.afterFinish) { - if(!this.mode.afterFinish(this.output, options)) { - return false; - } - } - - return true; -}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/cipherModes.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/cipherModes.js deleted file mode 100644 index 339915cc..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/cipherModes.js +++ /dev/null @@ -1,999 +0,0 @@ -/** - * Supported cipher modes. - * - * @author Dave Longley - * - * Copyright (c) 2010-2014 Digital Bazaar, Inc. - */ -var forge = require('./forge'); -require('./util'); - -forge.cipher = forge.cipher || {}; - -// supported cipher modes -var modes = module.exports = forge.cipher.modes = forge.cipher.modes || {}; - -/** Electronic codebook (ECB) (Don't use this; it's not secure) **/ - -modes.ecb = function(options) { - options = options || {}; - this.name = 'ECB'; - this.cipher = options.cipher; - this.blockSize = options.blockSize || 16; - this._ints = this.blockSize / 4; - this._inBlock = new Array(this._ints); - this._outBlock = new Array(this._ints); -}; - -modes.ecb.prototype.start = function(options) {}; - -modes.ecb.prototype.encrypt = function(input, output, finish) { - // not enough input to encrypt - if(input.length() < this.blockSize && !(finish && input.length() > 0)) { - return true; - } - - // get next block - for(var i = 0; i < this._ints; ++i) { - this._inBlock[i] = input.getInt32(); - } - - // encrypt block - this.cipher.encrypt(this._inBlock, this._outBlock); - - // write output - for(var i = 0; i < this._ints; ++i) { - output.putInt32(this._outBlock[i]); - } -}; - -modes.ecb.prototype.decrypt = function(input, output, finish) { - // not enough input to decrypt - if(input.length() < this.blockSize && !(finish && input.length() > 0)) { - return true; - } - - // get next block - for(var i = 0; i < this._ints; ++i) { - this._inBlock[i] = input.getInt32(); - } - - // decrypt block - this.cipher.decrypt(this._inBlock, this._outBlock); - - // write output - for(var i = 0; i < this._ints; ++i) { - output.putInt32(this._outBlock[i]); - } -}; - -modes.ecb.prototype.pad = function(input, options) { - // add PKCS#7 padding to block (each pad byte is the - // value of the number of pad bytes) - var padding = (input.length() === this.blockSize ? - this.blockSize : (this.blockSize - input.length())); - input.fillWithByte(padding, padding); - return true; -}; - -modes.ecb.prototype.unpad = function(output, options) { - // check for error: input data not a multiple of blockSize - if(options.overflow > 0) { - return false; - } - - // ensure padding byte count is valid - var len = output.length(); - var count = output.at(len - 1); - if(count > (this.blockSize << 2)) { - return false; - } - - // trim off padding bytes - output.truncate(count); - return true; -}; - -/** Cipher-block Chaining (CBC) **/ - -modes.cbc = function(options) { - options = options || {}; - this.name = 'CBC'; - this.cipher = options.cipher; - this.blockSize = options.blockSize || 16; - this._ints = this.blockSize / 4; - this._inBlock = new Array(this._ints); - this._outBlock = new Array(this._ints); -}; - -modes.cbc.prototype.start = function(options) { - // Note: legacy support for using IV residue (has security flaws) - // if IV is null, reuse block from previous processing - if(options.iv === null) { - // must have a previous block - if(!this._prev) { - throw new Error('Invalid IV parameter.'); - } - this._iv = this._prev.slice(0); - } else if(!('iv' in options)) { - throw new Error('Invalid IV parameter.'); - } else { - // save IV as "previous" block - this._iv = transformIV(options.iv, this.blockSize); - this._prev = this._iv.slice(0); - } -}; - -modes.cbc.prototype.encrypt = function(input, output, finish) { - // not enough input to encrypt - if(input.length() < this.blockSize && !(finish && input.length() > 0)) { - return true; - } - - // get next block - // CBC XOR's IV (or previous block) with plaintext - for(var i = 0; i < this._ints; ++i) { - this._inBlock[i] = this._prev[i] ^ input.getInt32(); - } - - // encrypt block - this.cipher.encrypt(this._inBlock, this._outBlock); - - // write output, save previous block - for(var i = 0; i < this._ints; ++i) { - output.putInt32(this._outBlock[i]); - } - this._prev = this._outBlock; -}; - -modes.cbc.prototype.decrypt = function(input, output, finish) { - // not enough input to decrypt - if(input.length() < this.blockSize && !(finish && input.length() > 0)) { - return true; - } - - // get next block - for(var i = 0; i < this._ints; ++i) { - this._inBlock[i] = input.getInt32(); - } - - // decrypt block - this.cipher.decrypt(this._inBlock, this._outBlock); - - // write output, save previous ciphered block - // CBC XOR's IV (or previous block) with ciphertext - for(var i = 0; i < this._ints; ++i) { - output.putInt32(this._prev[i] ^ this._outBlock[i]); - } - this._prev = this._inBlock.slice(0); -}; - -modes.cbc.prototype.pad = function(input, options) { - // add PKCS#7 padding to block (each pad byte is the - // value of the number of pad bytes) - var padding = (input.length() === this.blockSize ? - this.blockSize : (this.blockSize - input.length())); - input.fillWithByte(padding, padding); - return true; -}; - -modes.cbc.prototype.unpad = function(output, options) { - // check for error: input data not a multiple of blockSize - if(options.overflow > 0) { - return false; - } - - // ensure padding byte count is valid - var len = output.length(); - var count = output.at(len - 1); - if(count > (this.blockSize << 2)) { - return false; - } - - // trim off padding bytes - output.truncate(count); - return true; -}; - -/** Cipher feedback (CFB) **/ - -modes.cfb = function(options) { - options = options || {}; - this.name = 'CFB'; - this.cipher = options.cipher; - this.blockSize = options.blockSize || 16; - this._ints = this.blockSize / 4; - this._inBlock = null; - this._outBlock = new Array(this._ints); - this._partialBlock = new Array(this._ints); - this._partialOutput = forge.util.createBuffer(); - this._partialBytes = 0; -}; - -modes.cfb.prototype.start = function(options) { - if(!('iv' in options)) { - throw new Error('Invalid IV parameter.'); - } - // use IV as first input - this._iv = transformIV(options.iv, this.blockSize); - this._inBlock = this._iv.slice(0); - this._partialBytes = 0; -}; - -modes.cfb.prototype.encrypt = function(input, output, finish) { - // not enough input to encrypt - var inputLength = input.length(); - if(inputLength === 0) { - return true; - } - - // encrypt block - this.cipher.encrypt(this._inBlock, this._outBlock); - - // handle full block - if(this._partialBytes === 0 && inputLength >= this.blockSize) { - // XOR input with output, write input as output - for(var i = 0; i < this._ints; ++i) { - this._inBlock[i] = input.getInt32() ^ this._outBlock[i]; - output.putInt32(this._inBlock[i]); - } - return; - } - - // handle partial block - var partialBytes = (this.blockSize - inputLength) % this.blockSize; - if(partialBytes > 0) { - partialBytes = this.blockSize - partialBytes; - } - - // XOR input with output, write input as partial output - this._partialOutput.clear(); - for(var i = 0; i < this._ints; ++i) { - this._partialBlock[i] = input.getInt32() ^ this._outBlock[i]; - this._partialOutput.putInt32(this._partialBlock[i]); - } - - if(partialBytes > 0) { - // block still incomplete, restore input buffer - input.read -= this.blockSize; - } else { - // block complete, update input block - for(var i = 0; i < this._ints; ++i) { - this._inBlock[i] = this._partialBlock[i]; - } - } - - // skip any previous partial bytes - if(this._partialBytes > 0) { - this._partialOutput.getBytes(this._partialBytes); - } - - if(partialBytes > 0 && !finish) { - output.putBytes(this._partialOutput.getBytes( - partialBytes - this._partialBytes)); - this._partialBytes = partialBytes; - return true; - } - - output.putBytes(this._partialOutput.getBytes( - inputLength - this._partialBytes)); - this._partialBytes = 0; -}; - -modes.cfb.prototype.decrypt = function(input, output, finish) { - // not enough input to decrypt - var inputLength = input.length(); - if(inputLength === 0) { - return true; - } - - // encrypt block (CFB always uses encryption mode) - this.cipher.encrypt(this._inBlock, this._outBlock); - - // handle full block - if(this._partialBytes === 0 && inputLength >= this.blockSize) { - // XOR input with output, write input as output - for(var i = 0; i < this._ints; ++i) { - this._inBlock[i] = input.getInt32(); - output.putInt32(this._inBlock[i] ^ this._outBlock[i]); - } - return; - } - - // handle partial block - var partialBytes = (this.blockSize - inputLength) % this.blockSize; - if(partialBytes > 0) { - partialBytes = this.blockSize - partialBytes; - } - - // XOR input with output, write input as partial output - this._partialOutput.clear(); - for(var i = 0; i < this._ints; ++i) { - this._partialBlock[i] = input.getInt32(); - this._partialOutput.putInt32(this._partialBlock[i] ^ this._outBlock[i]); - } - - if(partialBytes > 0) { - // block still incomplete, restore input buffer - input.read -= this.blockSize; - } else { - // block complete, update input block - for(var i = 0; i < this._ints; ++i) { - this._inBlock[i] = this._partialBlock[i]; - } - } - - // skip any previous partial bytes - if(this._partialBytes > 0) { - this._partialOutput.getBytes(this._partialBytes); - } - - if(partialBytes > 0 && !finish) { - output.putBytes(this._partialOutput.getBytes( - partialBytes - this._partialBytes)); - this._partialBytes = partialBytes; - return true; - } - - output.putBytes(this._partialOutput.getBytes( - inputLength - this._partialBytes)); - this._partialBytes = 0; -}; - -/** Output feedback (OFB) **/ - -modes.ofb = function(options) { - options = options || {}; - this.name = 'OFB'; - this.cipher = options.cipher; - this.blockSize = options.blockSize || 16; - this._ints = this.blockSize / 4; - this._inBlock = null; - this._outBlock = new Array(this._ints); - this._partialOutput = forge.util.createBuffer(); - this._partialBytes = 0; -}; - -modes.ofb.prototype.start = function(options) { - if(!('iv' in options)) { - throw new Error('Invalid IV parameter.'); - } - // use IV as first input - this._iv = transformIV(options.iv, this.blockSize); - this._inBlock = this._iv.slice(0); - this._partialBytes = 0; -}; - -modes.ofb.prototype.encrypt = function(input, output, finish) { - // not enough input to encrypt - var inputLength = input.length(); - if(input.length() === 0) { - return true; - } - - // encrypt block (OFB always uses encryption mode) - this.cipher.encrypt(this._inBlock, this._outBlock); - - // handle full block - if(this._partialBytes === 0 && inputLength >= this.blockSize) { - // XOR input with output and update next input - for(var i = 0; i < this._ints; ++i) { - output.putInt32(input.getInt32() ^ this._outBlock[i]); - this._inBlock[i] = this._outBlock[i]; - } - return; - } - - // handle partial block - var partialBytes = (this.blockSize - inputLength) % this.blockSize; - if(partialBytes > 0) { - partialBytes = this.blockSize - partialBytes; - } - - // XOR input with output - this._partialOutput.clear(); - for(var i = 0; i < this._ints; ++i) { - this._partialOutput.putInt32(input.getInt32() ^ this._outBlock[i]); - } - - if(partialBytes > 0) { - // block still incomplete, restore input buffer - input.read -= this.blockSize; - } else { - // block complete, update input block - for(var i = 0; i < this._ints; ++i) { - this._inBlock[i] = this._outBlock[i]; - } - } - - // skip any previous partial bytes - if(this._partialBytes > 0) { - this._partialOutput.getBytes(this._partialBytes); - } - - if(partialBytes > 0 && !finish) { - output.putBytes(this._partialOutput.getBytes( - partialBytes - this._partialBytes)); - this._partialBytes = partialBytes; - return true; - } - - output.putBytes(this._partialOutput.getBytes( - inputLength - this._partialBytes)); - this._partialBytes = 0; -}; - -modes.ofb.prototype.decrypt = modes.ofb.prototype.encrypt; - -/** Counter (CTR) **/ - -modes.ctr = function(options) { - options = options || {}; - this.name = 'CTR'; - this.cipher = options.cipher; - this.blockSize = options.blockSize || 16; - this._ints = this.blockSize / 4; - this._inBlock = null; - this._outBlock = new Array(this._ints); - this._partialOutput = forge.util.createBuffer(); - this._partialBytes = 0; -}; - -modes.ctr.prototype.start = function(options) { - if(!('iv' in options)) { - throw new Error('Invalid IV parameter.'); - } - // use IV as first input - this._iv = transformIV(options.iv, this.blockSize); - this._inBlock = this._iv.slice(0); - this._partialBytes = 0; -}; - -modes.ctr.prototype.encrypt = function(input, output, finish) { - // not enough input to encrypt - var inputLength = input.length(); - if(inputLength === 0) { - return true; - } - - // encrypt block (CTR always uses encryption mode) - this.cipher.encrypt(this._inBlock, this._outBlock); - - // handle full block - if(this._partialBytes === 0 && inputLength >= this.blockSize) { - // XOR input with output - for(var i = 0; i < this._ints; ++i) { - output.putInt32(input.getInt32() ^ this._outBlock[i]); - } - } else { - // handle partial block - var partialBytes = (this.blockSize - inputLength) % this.blockSize; - if(partialBytes > 0) { - partialBytes = this.blockSize - partialBytes; - } - - // XOR input with output - this._partialOutput.clear(); - for(var i = 0; i < this._ints; ++i) { - this._partialOutput.putInt32(input.getInt32() ^ this._outBlock[i]); - } - - if(partialBytes > 0) { - // block still incomplete, restore input buffer - input.read -= this.blockSize; - } - - // skip any previous partial bytes - if(this._partialBytes > 0) { - this._partialOutput.getBytes(this._partialBytes); - } - - if(partialBytes > 0 && !finish) { - output.putBytes(this._partialOutput.getBytes( - partialBytes - this._partialBytes)); - this._partialBytes = partialBytes; - return true; - } - - output.putBytes(this._partialOutput.getBytes( - inputLength - this._partialBytes)); - this._partialBytes = 0; - } - - // block complete, increment counter (input block) - inc32(this._inBlock); -}; - -modes.ctr.prototype.decrypt = modes.ctr.prototype.encrypt; - -/** Galois/Counter Mode (GCM) **/ - -modes.gcm = function(options) { - options = options || {}; - this.name = 'GCM'; - this.cipher = options.cipher; - this.blockSize = options.blockSize || 16; - this._ints = this.blockSize / 4; - this._inBlock = new Array(this._ints); - this._outBlock = new Array(this._ints); - this._partialOutput = forge.util.createBuffer(); - this._partialBytes = 0; - - // R is actually this value concatenated with 120 more zero bits, but - // we only XOR against R so the other zeros have no effect -- we just - // apply this value to the first integer in a block - this._R = 0xE1000000; -}; - -modes.gcm.prototype.start = function(options) { - if(!('iv' in options)) { - throw new Error('Invalid IV parameter.'); - } - // ensure IV is a byte buffer - var iv = forge.util.createBuffer(options.iv); - - // no ciphered data processed yet - this._cipherLength = 0; - - // default additional data is none - var additionalData; - if('additionalData' in options) { - additionalData = forge.util.createBuffer(options.additionalData); - } else { - additionalData = forge.util.createBuffer(); - } - - // default tag length is 128 bits - if('tagLength' in options) { - this._tagLength = options.tagLength; - } else { - this._tagLength = 128; - } - - // if tag is given, ensure tag matches tag length - this._tag = null; - if(options.decrypt) { - // save tag to check later - this._tag = forge.util.createBuffer(options.tag).getBytes(); - if(this._tag.length !== (this._tagLength / 8)) { - throw new Error('Authentication tag does not match tag length.'); - } - } - - // create tmp storage for hash calculation - this._hashBlock = new Array(this._ints); - - // no tag generated yet - this.tag = null; - - // generate hash subkey - // (apply block cipher to "zero" block) - this._hashSubkey = new Array(this._ints); - this.cipher.encrypt([0, 0, 0, 0], this._hashSubkey); - - // generate table M - // use 4-bit tables (32 component decomposition of a 16 byte value) - // 8-bit tables take more space and are known to have security - // vulnerabilities (in native implementations) - this.componentBits = 4; - this._m = this.generateHashTable(this._hashSubkey, this.componentBits); - - // Note: support IV length different from 96 bits? (only supporting - // 96 bits is recommended by NIST SP-800-38D) - // generate J_0 - var ivLength = iv.length(); - if(ivLength === 12) { - // 96-bit IV - this._j0 = [iv.getInt32(), iv.getInt32(), iv.getInt32(), 1]; - } else { - // IV is NOT 96-bits - this._j0 = [0, 0, 0, 0]; - while(iv.length() > 0) { - this._j0 = this.ghash( - this._hashSubkey, this._j0, - [iv.getInt32(), iv.getInt32(), iv.getInt32(), iv.getInt32()]); - } - this._j0 = this.ghash( - this._hashSubkey, this._j0, [0, 0].concat(from64To32(ivLength * 8))); - } - - // generate ICB (initial counter block) - this._inBlock = this._j0.slice(0); - inc32(this._inBlock); - this._partialBytes = 0; - - // consume authentication data - additionalData = forge.util.createBuffer(additionalData); - // save additional data length as a BE 64-bit number - this._aDataLength = from64To32(additionalData.length() * 8); - // pad additional data to 128 bit (16 byte) block size - var overflow = additionalData.length() % this.blockSize; - if(overflow) { - additionalData.fillWithByte(0, this.blockSize - overflow); - } - this._s = [0, 0, 0, 0]; - while(additionalData.length() > 0) { - this._s = this.ghash(this._hashSubkey, this._s, [ - additionalData.getInt32(), - additionalData.getInt32(), - additionalData.getInt32(), - additionalData.getInt32() - ]); - } -}; - -modes.gcm.prototype.encrypt = function(input, output, finish) { - // not enough input to encrypt - var inputLength = input.length(); - if(inputLength === 0) { - return true; - } - - // encrypt block - this.cipher.encrypt(this._inBlock, this._outBlock); - - // handle full block - if(this._partialBytes === 0 && inputLength >= this.blockSize) { - // XOR input with output - for(var i = 0; i < this._ints; ++i) { - output.putInt32(this._outBlock[i] ^= input.getInt32()); - } - this._cipherLength += this.blockSize; - } else { - // handle partial block - var partialBytes = (this.blockSize - inputLength) % this.blockSize; - if(partialBytes > 0) { - partialBytes = this.blockSize - partialBytes; - } - - // XOR input with output - this._partialOutput.clear(); - for(var i = 0; i < this._ints; ++i) { - this._partialOutput.putInt32(input.getInt32() ^ this._outBlock[i]); - } - - if(partialBytes <= 0 || finish) { - // handle overflow prior to hashing - if(finish) { - // get block overflow - var overflow = inputLength % this.blockSize; - this._cipherLength += overflow; - // truncate for hash function - this._partialOutput.truncate(this.blockSize - overflow); - } else { - this._cipherLength += this.blockSize; - } - - // get output block for hashing - for(var i = 0; i < this._ints; ++i) { - this._outBlock[i] = this._partialOutput.getInt32(); - } - this._partialOutput.read -= this.blockSize; - } - - // skip any previous partial bytes - if(this._partialBytes > 0) { - this._partialOutput.getBytes(this._partialBytes); - } - - if(partialBytes > 0 && !finish) { - // block still incomplete, restore input buffer, get partial output, - // and return early - input.read -= this.blockSize; - output.putBytes(this._partialOutput.getBytes( - partialBytes - this._partialBytes)); - this._partialBytes = partialBytes; - return true; - } - - output.putBytes(this._partialOutput.getBytes( - inputLength - this._partialBytes)); - this._partialBytes = 0; - } - - // update hash block S - this._s = this.ghash(this._hashSubkey, this._s, this._outBlock); - - // increment counter (input block) - inc32(this._inBlock); -}; - -modes.gcm.prototype.decrypt = function(input, output, finish) { - // not enough input to decrypt - var inputLength = input.length(); - if(inputLength < this.blockSize && !(finish && inputLength > 0)) { - return true; - } - - // encrypt block (GCM always uses encryption mode) - this.cipher.encrypt(this._inBlock, this._outBlock); - - // increment counter (input block) - inc32(this._inBlock); - - // update hash block S - this._hashBlock[0] = input.getInt32(); - this._hashBlock[1] = input.getInt32(); - this._hashBlock[2] = input.getInt32(); - this._hashBlock[3] = input.getInt32(); - this._s = this.ghash(this._hashSubkey, this._s, this._hashBlock); - - // XOR hash input with output - for(var i = 0; i < this._ints; ++i) { - output.putInt32(this._outBlock[i] ^ this._hashBlock[i]); - } - - // increment cipher data length - if(inputLength < this.blockSize) { - this._cipherLength += inputLength % this.blockSize; - } else { - this._cipherLength += this.blockSize; - } -}; - -modes.gcm.prototype.afterFinish = function(output, options) { - var rval = true; - - // handle overflow - if(options.decrypt && options.overflow) { - output.truncate(this.blockSize - options.overflow); - } - - // handle authentication tag - this.tag = forge.util.createBuffer(); - - // concatenate additional data length with cipher length - var lengths = this._aDataLength.concat(from64To32(this._cipherLength * 8)); - - // include lengths in hash - this._s = this.ghash(this._hashSubkey, this._s, lengths); - - // do GCTR(J_0, S) - var tag = []; - this.cipher.encrypt(this._j0, tag); - for(var i = 0; i < this._ints; ++i) { - this.tag.putInt32(this._s[i] ^ tag[i]); - } - - // trim tag to length - this.tag.truncate(this.tag.length() % (this._tagLength / 8)); - - // check authentication tag - if(options.decrypt && this.tag.bytes() !== this._tag) { - rval = false; - } - - return rval; -}; - -/** - * See NIST SP-800-38D 6.3 (Algorithm 1). This function performs Galois - * field multiplication. The field, GF(2^128), is defined by the polynomial: - * - * x^128 + x^7 + x^2 + x + 1 - * - * Which is represented in little-endian binary form as: 11100001 (0xe1). When - * the value of a coefficient is 1, a bit is set. The value R, is the - * concatenation of this value and 120 zero bits, yielding a 128-bit value - * which matches the block size. - * - * This function will multiply two elements (vectors of bytes), X and Y, in - * the field GF(2^128). The result is initialized to zero. For each bit of - * X (out of 128), x_i, if x_i is set, then the result is multiplied (XOR'd) - * by the current value of Y. For each bit, the value of Y will be raised by - * a power of x (multiplied by the polynomial x). This can be achieved by - * shifting Y once to the right. If the current value of Y, prior to being - * multiplied by x, has 0 as its LSB, then it is a 127th degree polynomial. - * Otherwise, we must divide by R after shifting to find the remainder. - * - * @param x the first block to multiply by the second. - * @param y the second block to multiply by the first. - * - * @return the block result of the multiplication. - */ -modes.gcm.prototype.multiply = function(x, y) { - var z_i = [0, 0, 0, 0]; - var v_i = y.slice(0); - - // calculate Z_128 (block has 128 bits) - for(var i = 0; i < 128; ++i) { - // if x_i is 0, Z_{i+1} = Z_i (unchanged) - // else Z_{i+1} = Z_i ^ V_i - // get x_i by finding 32-bit int position, then left shift 1 by remainder - var x_i = x[(i / 32) | 0] & (1 << (31 - i % 32)); - if(x_i) { - z_i[0] ^= v_i[0]; - z_i[1] ^= v_i[1]; - z_i[2] ^= v_i[2]; - z_i[3] ^= v_i[3]; - } - - // if LSB(V_i) is 1, V_i = V_i >> 1 - // else V_i = (V_i >> 1) ^ R - this.pow(v_i, v_i); - } - - return z_i; -}; - -modes.gcm.prototype.pow = function(x, out) { - // if LSB(x) is 1, x = x >>> 1 - // else x = (x >>> 1) ^ R - var lsb = x[3] & 1; - - // always do x >>> 1: - // starting with the rightmost integer, shift each integer to the right - // one bit, pulling in the bit from the integer to the left as its top - // most bit (do this for the last 3 integers) - for(var i = 3; i > 0; --i) { - out[i] = (x[i] >>> 1) | ((x[i - 1] & 1) << 31); - } - // shift the first integer normally - out[0] = x[0] >>> 1; - - // if lsb was not set, then polynomial had a degree of 127 and doesn't - // need to divided; otherwise, XOR with R to find the remainder; we only - // need to XOR the first integer since R technically ends w/120 zero bits - if(lsb) { - out[0] ^= this._R; - } -}; - -modes.gcm.prototype.tableMultiply = function(x) { - // assumes 4-bit tables are used - var z = [0, 0, 0, 0]; - for(var i = 0; i < 32; ++i) { - var idx = (i / 8) | 0; - var x_i = (x[idx] >>> ((7 - (i % 8)) * 4)) & 0xF; - var ah = this._m[i][x_i]; - z[0] ^= ah[0]; - z[1] ^= ah[1]; - z[2] ^= ah[2]; - z[3] ^= ah[3]; - } - return z; -}; - -/** - * A continuing version of the GHASH algorithm that operates on a single - * block. The hash block, last hash value (Ym) and the new block to hash - * are given. - * - * @param h the hash block. - * @param y the previous value for Ym, use [0, 0, 0, 0] for a new hash. - * @param x the block to hash. - * - * @return the hashed value (Ym). - */ -modes.gcm.prototype.ghash = function(h, y, x) { - y[0] ^= x[0]; - y[1] ^= x[1]; - y[2] ^= x[2]; - y[3] ^= x[3]; - return this.tableMultiply(y); - //return this.multiply(y, h); -}; - -/** - * Precomputes a table for multiplying against the hash subkey. This - * mechanism provides a substantial speed increase over multiplication - * performed without a table. The table-based multiplication this table is - * for solves X * H by multiplying each component of X by H and then - * composing the results together using XOR. - * - * This function can be used to generate tables with different bit sizes - * for the components, however, this implementation assumes there are - * 32 components of X (which is a 16 byte vector), therefore each component - * takes 4-bits (so the table is constructed with bits=4). - * - * @param h the hash subkey. - * @param bits the bit size for a component. - */ -modes.gcm.prototype.generateHashTable = function(h, bits) { - // TODO: There are further optimizations that would use only the - // first table M_0 (or some variant) along with a remainder table; - // this can be explored in the future - var multiplier = 8 / bits; - var perInt = 4 * multiplier; - var size = 16 * multiplier; - var m = new Array(size); - for(var i = 0; i < size; ++i) { - var tmp = [0, 0, 0, 0]; - var idx = (i / perInt) | 0; - var shft = ((perInt - 1 - (i % perInt)) * bits); - tmp[idx] = (1 << (bits - 1)) << shft; - m[i] = this.generateSubHashTable(this.multiply(tmp, h), bits); - } - return m; -}; - -/** - * Generates a table for multiplying against the hash subkey for one - * particular component (out of all possible component values). - * - * @param mid the pre-multiplied value for the middle key of the table. - * @param bits the bit size for a component. - */ -modes.gcm.prototype.generateSubHashTable = function(mid, bits) { - // compute the table quickly by minimizing the number of - // POW operations -- they only need to be performed for powers of 2, - // all other entries can be composed from those powers using XOR - var size = 1 << bits; - var half = size >>> 1; - var m = new Array(size); - m[half] = mid.slice(0); - var i = half >>> 1; - while(i > 0) { - // raise m0[2 * i] and store in m0[i] - this.pow(m[2 * i], m[i] = []); - i >>= 1; - } - i = 2; - while(i < half) { - for(var j = 1; j < i; ++j) { - var m_i = m[i]; - var m_j = m[j]; - m[i + j] = [ - m_i[0] ^ m_j[0], - m_i[1] ^ m_j[1], - m_i[2] ^ m_j[2], - m_i[3] ^ m_j[3] - ]; - } - i *= 2; - } - m[0] = [0, 0, 0, 0]; - /* Note: We could avoid storing these by doing composition during multiply - calculate top half using composition by speed is preferred. */ - for(i = half + 1; i < size; ++i) { - var c = m[i ^ half]; - m[i] = [mid[0] ^ c[0], mid[1] ^ c[1], mid[2] ^ c[2], mid[3] ^ c[3]]; - } - return m; -}; - -/** Utility functions */ - -function transformIV(iv, blockSize) { - if(typeof iv === 'string') { - // convert iv string into byte buffer - iv = forge.util.createBuffer(iv); - } - - if(forge.util.isArray(iv) && iv.length > 4) { - // convert iv byte array into byte buffer - var tmp = iv; - iv = forge.util.createBuffer(); - for(var i = 0; i < tmp.length; ++i) { - iv.putByte(tmp[i]); - } - } - - if(iv.length() < blockSize) { - throw new Error( - 'Invalid IV length; got ' + iv.length() + - ' bytes and expected ' + blockSize + ' bytes.'); - } - - if(!forge.util.isArray(iv)) { - // convert iv byte buffer into 32-bit integer array - var ints = []; - var blocks = blockSize / 4; - for(var i = 0; i < blocks; ++i) { - ints.push(iv.getInt32()); - } - iv = ints; - } - - return iv; -} - -function inc32(block) { - // increment last 32 bits of block only - block[block.length - 1] = (block[block.length - 1] + 1) & 0xFFFFFFFF; -} - -function from64To32(num) { - // convert 64-bit number to two BE Int32s - return [(num / 0x100000000) | 0, num & 0xFFFFFFFF]; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/des.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/des.js deleted file mode 100644 index ed8239aa..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/des.js +++ /dev/null @@ -1,496 +0,0 @@ -/** - * DES (Data Encryption Standard) implementation. - * - * This implementation supports DES as well as 3DES-EDE in ECB and CBC mode. - * It is based on the BSD-licensed implementation by Paul Tero: - * - * Paul Tero, July 2001 - * http://www.tero.co.uk/des/ - * - * Optimised for performance with large blocks by - * Michael Hayworth, November 2001 - * http://www.netdealing.com - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * @author Stefan Siegl - * @author Dave Longley - * - * Copyright (c) 2012 Stefan Siegl - * Copyright (c) 2012-2014 Digital Bazaar, Inc. - */ -var forge = require('./forge'); -require('./cipher'); -require('./cipherModes'); -require('./util'); - -/* DES API */ -module.exports = forge.des = forge.des || {}; - -/** - * Deprecated. Instead, use: - * - * var cipher = forge.cipher.createCipher('DES-', key); - * cipher.start({iv: iv}); - * - * Creates an DES cipher object to encrypt data using the given symmetric key. - * The output will be stored in the 'output' member of the returned cipher. - * - * The key and iv may be given as binary-encoded strings of bytes or - * byte buffers. - * - * @param key the symmetric key to use (64 or 192 bits). - * @param iv the initialization vector to use. - * @param output the buffer to write to, null to create one. - * @param mode the cipher mode to use (default: 'CBC' if IV is - * given, 'ECB' if null). - * - * @return the cipher. - */ -forge.des.startEncrypting = function(key, iv, output, mode) { - var cipher = _createCipher({ - key: key, - output: output, - decrypt: false, - mode: mode || (iv === null ? 'ECB' : 'CBC') - }); - cipher.start(iv); - return cipher; -}; - -/** - * Deprecated. Instead, use: - * - * var cipher = forge.cipher.createCipher('DES-', key); - * - * Creates an DES cipher object to encrypt data using the given symmetric key. - * - * The key may be given as a binary-encoded string of bytes or a byte buffer. - * - * @param key the symmetric key to use (64 or 192 bits). - * @param mode the cipher mode to use (default: 'CBC'). - * - * @return the cipher. - */ -forge.des.createEncryptionCipher = function(key, mode) { - return _createCipher({ - key: key, - output: null, - decrypt: false, - mode: mode - }); -}; - -/** - * Deprecated. Instead, use: - * - * var decipher = forge.cipher.createDecipher('DES-', key); - * decipher.start({iv: iv}); - * - * Creates an DES cipher object to decrypt data using the given symmetric key. - * The output will be stored in the 'output' member of the returned cipher. - * - * The key and iv may be given as binary-encoded strings of bytes or - * byte buffers. - * - * @param key the symmetric key to use (64 or 192 bits). - * @param iv the initialization vector to use. - * @param output the buffer to write to, null to create one. - * @param mode the cipher mode to use (default: 'CBC' if IV is - * given, 'ECB' if null). - * - * @return the cipher. - */ -forge.des.startDecrypting = function(key, iv, output, mode) { - var cipher = _createCipher({ - key: key, - output: output, - decrypt: true, - mode: mode || (iv === null ? 'ECB' : 'CBC') - }); - cipher.start(iv); - return cipher; -}; - -/** - * Deprecated. Instead, use: - * - * var decipher = forge.cipher.createDecipher('DES-', key); - * - * Creates an DES cipher object to decrypt data using the given symmetric key. - * - * The key may be given as a binary-encoded string of bytes or a byte buffer. - * - * @param key the symmetric key to use (64 or 192 bits). - * @param mode the cipher mode to use (default: 'CBC'). - * - * @return the cipher. - */ -forge.des.createDecryptionCipher = function(key, mode) { - return _createCipher({ - key: key, - output: null, - decrypt: true, - mode: mode - }); -}; - -/** - * Creates a new DES cipher algorithm object. - * - * @param name the name of the algorithm. - * @param mode the mode factory function. - * - * @return the DES algorithm object. - */ -forge.des.Algorithm = function(name, mode) { - var self = this; - self.name = name; - self.mode = new mode({ - blockSize: 8, - cipher: { - encrypt: function(inBlock, outBlock) { - return _updateBlock(self._keys, inBlock, outBlock, false); - }, - decrypt: function(inBlock, outBlock) { - return _updateBlock(self._keys, inBlock, outBlock, true); - } - } - }); - self._init = false; -}; - -/** - * Initializes this DES algorithm by expanding its key. - * - * @param options the options to use. - * key the key to use with this algorithm. - * decrypt true if the algorithm should be initialized for decryption, - * false for encryption. - */ -forge.des.Algorithm.prototype.initialize = function(options) { - if(this._init) { - return; - } - - var key = forge.util.createBuffer(options.key); - if(this.name.indexOf('3DES') === 0) { - if(key.length() !== 24) { - throw new Error('Invalid Triple-DES key size: ' + key.length() * 8); - } - } - - // do key expansion to 16 or 48 subkeys (single or triple DES) - this._keys = _createKeys(key); - this._init = true; -}; - -/** Register DES algorithms **/ - -registerAlgorithm('DES-ECB', forge.cipher.modes.ecb); -registerAlgorithm('DES-CBC', forge.cipher.modes.cbc); -registerAlgorithm('DES-CFB', forge.cipher.modes.cfb); -registerAlgorithm('DES-OFB', forge.cipher.modes.ofb); -registerAlgorithm('DES-CTR', forge.cipher.modes.ctr); - -registerAlgorithm('3DES-ECB', forge.cipher.modes.ecb); -registerAlgorithm('3DES-CBC', forge.cipher.modes.cbc); -registerAlgorithm('3DES-CFB', forge.cipher.modes.cfb); -registerAlgorithm('3DES-OFB', forge.cipher.modes.ofb); -registerAlgorithm('3DES-CTR', forge.cipher.modes.ctr); - -function registerAlgorithm(name, mode) { - var factory = function() { - return new forge.des.Algorithm(name, mode); - }; - forge.cipher.registerAlgorithm(name, factory); -} - -/** DES implementation **/ - -var spfunction1 = [0x1010400,0,0x10000,0x1010404,0x1010004,0x10404,0x4,0x10000,0x400,0x1010400,0x1010404,0x400,0x1000404,0x1010004,0x1000000,0x4,0x404,0x1000400,0x1000400,0x10400,0x10400,0x1010000,0x1010000,0x1000404,0x10004,0x1000004,0x1000004,0x10004,0,0x404,0x10404,0x1000000,0x10000,0x1010404,0x4,0x1010000,0x1010400,0x1000000,0x1000000,0x400,0x1010004,0x10000,0x10400,0x1000004,0x400,0x4,0x1000404,0x10404,0x1010404,0x10004,0x1010000,0x1000404,0x1000004,0x404,0x10404,0x1010400,0x404,0x1000400,0x1000400,0,0x10004,0x10400,0,0x1010004]; -var spfunction2 = [-0x7fef7fe0,-0x7fff8000,0x8000,0x108020,0x100000,0x20,-0x7fefffe0,-0x7fff7fe0,-0x7fffffe0,-0x7fef7fe0,-0x7fef8000,-0x80000000,-0x7fff8000,0x100000,0x20,-0x7fefffe0,0x108000,0x100020,-0x7fff7fe0,0,-0x80000000,0x8000,0x108020,-0x7ff00000,0x100020,-0x7fffffe0,0,0x108000,0x8020,-0x7fef8000,-0x7ff00000,0x8020,0,0x108020,-0x7fefffe0,0x100000,-0x7fff7fe0,-0x7ff00000,-0x7fef8000,0x8000,-0x7ff00000,-0x7fff8000,0x20,-0x7fef7fe0,0x108020,0x20,0x8000,-0x80000000,0x8020,-0x7fef8000,0x100000,-0x7fffffe0,0x100020,-0x7fff7fe0,-0x7fffffe0,0x100020,0x108000,0,-0x7fff8000,0x8020,-0x80000000,-0x7fefffe0,-0x7fef7fe0,0x108000]; -var spfunction3 = [0x208,0x8020200,0,0x8020008,0x8000200,0,0x20208,0x8000200,0x20008,0x8000008,0x8000008,0x20000,0x8020208,0x20008,0x8020000,0x208,0x8000000,0x8,0x8020200,0x200,0x20200,0x8020000,0x8020008,0x20208,0x8000208,0x20200,0x20000,0x8000208,0x8,0x8020208,0x200,0x8000000,0x8020200,0x8000000,0x20008,0x208,0x20000,0x8020200,0x8000200,0,0x200,0x20008,0x8020208,0x8000200,0x8000008,0x200,0,0x8020008,0x8000208,0x20000,0x8000000,0x8020208,0x8,0x20208,0x20200,0x8000008,0x8020000,0x8000208,0x208,0x8020000,0x20208,0x8,0x8020008,0x20200]; -var spfunction4 = [0x802001,0x2081,0x2081,0x80,0x802080,0x800081,0x800001,0x2001,0,0x802000,0x802000,0x802081,0x81,0,0x800080,0x800001,0x1,0x2000,0x800000,0x802001,0x80,0x800000,0x2001,0x2080,0x800081,0x1,0x2080,0x800080,0x2000,0x802080,0x802081,0x81,0x800080,0x800001,0x802000,0x802081,0x81,0,0,0x802000,0x2080,0x800080,0x800081,0x1,0x802001,0x2081,0x2081,0x80,0x802081,0x81,0x1,0x2000,0x800001,0x2001,0x802080,0x800081,0x2001,0x2080,0x800000,0x802001,0x80,0x800000,0x2000,0x802080]; -var spfunction5 = [0x100,0x2080100,0x2080000,0x42000100,0x80000,0x100,0x40000000,0x2080000,0x40080100,0x80000,0x2000100,0x40080100,0x42000100,0x42080000,0x80100,0x40000000,0x2000000,0x40080000,0x40080000,0,0x40000100,0x42080100,0x42080100,0x2000100,0x42080000,0x40000100,0,0x42000000,0x2080100,0x2000000,0x42000000,0x80100,0x80000,0x42000100,0x100,0x2000000,0x40000000,0x2080000,0x42000100,0x40080100,0x2000100,0x40000000,0x42080000,0x2080100,0x40080100,0x100,0x2000000,0x42080000,0x42080100,0x80100,0x42000000,0x42080100,0x2080000,0,0x40080000,0x42000000,0x80100,0x2000100,0x40000100,0x80000,0,0x40080000,0x2080100,0x40000100]; -var spfunction6 = [0x20000010,0x20400000,0x4000,0x20404010,0x20400000,0x10,0x20404010,0x400000,0x20004000,0x404010,0x400000,0x20000010,0x400010,0x20004000,0x20000000,0x4010,0,0x400010,0x20004010,0x4000,0x404000,0x20004010,0x10,0x20400010,0x20400010,0,0x404010,0x20404000,0x4010,0x404000,0x20404000,0x20000000,0x20004000,0x10,0x20400010,0x404000,0x20404010,0x400000,0x4010,0x20000010,0x400000,0x20004000,0x20000000,0x4010,0x20000010,0x20404010,0x404000,0x20400000,0x404010,0x20404000,0,0x20400010,0x10,0x4000,0x20400000,0x404010,0x4000,0x400010,0x20004010,0,0x20404000,0x20000000,0x400010,0x20004010]; -var spfunction7 = [0x200000,0x4200002,0x4000802,0,0x800,0x4000802,0x200802,0x4200800,0x4200802,0x200000,0,0x4000002,0x2,0x4000000,0x4200002,0x802,0x4000800,0x200802,0x200002,0x4000800,0x4000002,0x4200000,0x4200800,0x200002,0x4200000,0x800,0x802,0x4200802,0x200800,0x2,0x4000000,0x200800,0x4000000,0x200800,0x200000,0x4000802,0x4000802,0x4200002,0x4200002,0x2,0x200002,0x4000000,0x4000800,0x200000,0x4200800,0x802,0x200802,0x4200800,0x802,0x4000002,0x4200802,0x4200000,0x200800,0,0x2,0x4200802,0,0x200802,0x4200000,0x800,0x4000002,0x4000800,0x800,0x200002]; -var spfunction8 = [0x10001040,0x1000,0x40000,0x10041040,0x10000000,0x10001040,0x40,0x10000000,0x40040,0x10040000,0x10041040,0x41000,0x10041000,0x41040,0x1000,0x40,0x10040000,0x10000040,0x10001000,0x1040,0x41000,0x40040,0x10040040,0x10041000,0x1040,0,0,0x10040040,0x10000040,0x10001000,0x41040,0x40000,0x41040,0x40000,0x10041000,0x1000,0x40,0x10040040,0x1000,0x41040,0x10001000,0x40,0x10000040,0x10040000,0x10040040,0x10000000,0x40000,0x10001040,0,0x10041040,0x40040,0x10000040,0x10040000,0x10001000,0x10001040,0,0x10041040,0x41000,0x41000,0x1040,0x1040,0x40040,0x10000000,0x10041000]; - -/** - * Create necessary sub keys. - * - * @param key the 64-bit or 192-bit key. - * - * @return the expanded keys. - */ -function _createKeys(key) { - var pc2bytes0 = [0,0x4,0x20000000,0x20000004,0x10000,0x10004,0x20010000,0x20010004,0x200,0x204,0x20000200,0x20000204,0x10200,0x10204,0x20010200,0x20010204], - pc2bytes1 = [0,0x1,0x100000,0x100001,0x4000000,0x4000001,0x4100000,0x4100001,0x100,0x101,0x100100,0x100101,0x4000100,0x4000101,0x4100100,0x4100101], - pc2bytes2 = [0,0x8,0x800,0x808,0x1000000,0x1000008,0x1000800,0x1000808,0,0x8,0x800,0x808,0x1000000,0x1000008,0x1000800,0x1000808], - pc2bytes3 = [0,0x200000,0x8000000,0x8200000,0x2000,0x202000,0x8002000,0x8202000,0x20000,0x220000,0x8020000,0x8220000,0x22000,0x222000,0x8022000,0x8222000], - pc2bytes4 = [0,0x40000,0x10,0x40010,0,0x40000,0x10,0x40010,0x1000,0x41000,0x1010,0x41010,0x1000,0x41000,0x1010,0x41010], - pc2bytes5 = [0,0x400,0x20,0x420,0,0x400,0x20,0x420,0x2000000,0x2000400,0x2000020,0x2000420,0x2000000,0x2000400,0x2000020,0x2000420], - pc2bytes6 = [0,0x10000000,0x80000,0x10080000,0x2,0x10000002,0x80002,0x10080002,0,0x10000000,0x80000,0x10080000,0x2,0x10000002,0x80002,0x10080002], - pc2bytes7 = [0,0x10000,0x800,0x10800,0x20000000,0x20010000,0x20000800,0x20010800,0x20000,0x30000,0x20800,0x30800,0x20020000,0x20030000,0x20020800,0x20030800], - pc2bytes8 = [0,0x40000,0,0x40000,0x2,0x40002,0x2,0x40002,0x2000000,0x2040000,0x2000000,0x2040000,0x2000002,0x2040002,0x2000002,0x2040002], - pc2bytes9 = [0,0x10000000,0x8,0x10000008,0,0x10000000,0x8,0x10000008,0x400,0x10000400,0x408,0x10000408,0x400,0x10000400,0x408,0x10000408], - pc2bytes10 = [0,0x20,0,0x20,0x100000,0x100020,0x100000,0x100020,0x2000,0x2020,0x2000,0x2020,0x102000,0x102020,0x102000,0x102020], - pc2bytes11 = [0,0x1000000,0x200,0x1000200,0x200000,0x1200000,0x200200,0x1200200,0x4000000,0x5000000,0x4000200,0x5000200,0x4200000,0x5200000,0x4200200,0x5200200], - pc2bytes12 = [0,0x1000,0x8000000,0x8001000,0x80000,0x81000,0x8080000,0x8081000,0x10,0x1010,0x8000010,0x8001010,0x80010,0x81010,0x8080010,0x8081010], - pc2bytes13 = [0,0x4,0x100,0x104,0,0x4,0x100,0x104,0x1,0x5,0x101,0x105,0x1,0x5,0x101,0x105]; - - // how many iterations (1 for des, 3 for triple des) - // changed by Paul 16/6/2007 to use Triple DES for 9+ byte keys - var iterations = key.length() > 8 ? 3 : 1; - - // stores the return keys - var keys = []; - - // now define the left shifts which need to be done - var shifts = [0, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0]; - - var n = 0, tmp; - for(var j = 0; j < iterations; j++) { - var left = key.getInt32(); - var right = key.getInt32(); - - tmp = ((left >>> 4) ^ right) & 0x0f0f0f0f; - right ^= tmp; - left ^= (tmp << 4); - - tmp = ((right >>> -16) ^ left) & 0x0000ffff; - left ^= tmp; - right ^= (tmp << -16); - - tmp = ((left >>> 2) ^ right) & 0x33333333; - right ^= tmp; - left ^= (tmp << 2); - - tmp = ((right >>> -16) ^ left) & 0x0000ffff; - left ^= tmp; - right ^= (tmp << -16); - - tmp = ((left >>> 1) ^ right) & 0x55555555; - right ^= tmp; - left ^= (tmp << 1); - - tmp = ((right >>> 8) ^ left) & 0x00ff00ff; - left ^= tmp; - right ^= (tmp << 8); - - tmp = ((left >>> 1) ^ right) & 0x55555555; - right ^= tmp; - left ^= (tmp << 1); - - // right needs to be shifted and OR'd with last four bits of left - tmp = (left << 8) | ((right >>> 20) & 0x000000f0); - - // left needs to be put upside down - left = ((right << 24) | ((right << 8) & 0xff0000) | - ((right >>> 8) & 0xff00) | ((right >>> 24) & 0xf0)); - right = tmp; - - // now go through and perform these shifts on the left and right keys - for(var i = 0; i < shifts.length; ++i) { - //shift the keys either one or two bits to the left - if(shifts[i]) { - left = (left << 2) | (left >>> 26); - right = (right << 2) | (right >>> 26); - } else { - left = (left << 1) | (left >>> 27); - right = (right << 1) | (right >>> 27); - } - left &= -0xf; - right &= -0xf; - - // now apply PC-2, in such a way that E is easier when encrypting or - // decrypting this conversion will look like PC-2 except only the last 6 - // bits of each byte are used rather than 48 consecutive bits and the - // order of lines will be according to how the S selection functions will - // be applied: S2, S4, S6, S8, S1, S3, S5, S7 - var lefttmp = ( - pc2bytes0[left >>> 28] | pc2bytes1[(left >>> 24) & 0xf] | - pc2bytes2[(left >>> 20) & 0xf] | pc2bytes3[(left >>> 16) & 0xf] | - pc2bytes4[(left >>> 12) & 0xf] | pc2bytes5[(left >>> 8) & 0xf] | - pc2bytes6[(left >>> 4) & 0xf]); - var righttmp = ( - pc2bytes7[right >>> 28] | pc2bytes8[(right >>> 24) & 0xf] | - pc2bytes9[(right >>> 20) & 0xf] | pc2bytes10[(right >>> 16) & 0xf] | - pc2bytes11[(right >>> 12) & 0xf] | pc2bytes12[(right >>> 8) & 0xf] | - pc2bytes13[(right >>> 4) & 0xf]); - tmp = ((righttmp >>> 16) ^ lefttmp) & 0x0000ffff; - keys[n++] = lefttmp ^ tmp; - keys[n++] = righttmp ^ (tmp << 16); - } - } - - return keys; -} - -/** - * Updates a single block (1 byte) using DES. The update will either - * encrypt or decrypt the block. - * - * @param keys the expanded keys. - * @param input the input block (an array of 32-bit words). - * @param output the updated output block. - * @param decrypt true to decrypt the block, false to encrypt it. - */ -function _updateBlock(keys, input, output, decrypt) { - // set up loops for single or triple DES - var iterations = keys.length === 32 ? 3 : 9; - var looping; - if(iterations === 3) { - looping = decrypt ? [30, -2, -2] : [0, 32, 2]; - } else { - looping = (decrypt ? - [94, 62, -2, 32, 64, 2, 30, -2, -2] : - [0, 32, 2, 62, 30, -2, 64, 96, 2]); - } - - var tmp; - - var left = input[0]; - var right = input[1]; - - // first each 64 bit chunk of the message must be permuted according to IP - tmp = ((left >>> 4) ^ right) & 0x0f0f0f0f; - right ^= tmp; - left ^= (tmp << 4); - - tmp = ((left >>> 16) ^ right) & 0x0000ffff; - right ^= tmp; - left ^= (tmp << 16); - - tmp = ((right >>> 2) ^ left) & 0x33333333; - left ^= tmp; - right ^= (tmp << 2); - - tmp = ((right >>> 8) ^ left) & 0x00ff00ff; - left ^= tmp; - right ^= (tmp << 8); - - tmp = ((left >>> 1) ^ right) & 0x55555555; - right ^= tmp; - left ^= (tmp << 1); - - // rotate left 1 bit - left = ((left << 1) | (left >>> 31)); - right = ((right << 1) | (right >>> 31)); - - for(var j = 0; j < iterations; j += 3) { - var endloop = looping[j + 1]; - var loopinc = looping[j + 2]; - - // now go through and perform the encryption or decryption - for(var i = looping[j]; i != endloop; i += loopinc) { - var right1 = right ^ keys[i]; - var right2 = ((right >>> 4) | (right << 28)) ^ keys[i + 1]; - - // passing these bytes through the S selection functions - tmp = left; - left = right; - right = tmp ^ ( - spfunction2[(right1 >>> 24) & 0x3f] | - spfunction4[(right1 >>> 16) & 0x3f] | - spfunction6[(right1 >>> 8) & 0x3f] | - spfunction8[right1 & 0x3f] | - spfunction1[(right2 >>> 24) & 0x3f] | - spfunction3[(right2 >>> 16) & 0x3f] | - spfunction5[(right2 >>> 8) & 0x3f] | - spfunction7[right2 & 0x3f]); - } - // unreverse left and right - tmp = left; - left = right; - right = tmp; - } - - // rotate right 1 bit - left = ((left >>> 1) | (left << 31)); - right = ((right >>> 1) | (right << 31)); - - // now perform IP-1, which is IP in the opposite direction - tmp = ((left >>> 1) ^ right) & 0x55555555; - right ^= tmp; - left ^= (tmp << 1); - - tmp = ((right >>> 8) ^ left) & 0x00ff00ff; - left ^= tmp; - right ^= (tmp << 8); - - tmp = ((right >>> 2) ^ left) & 0x33333333; - left ^= tmp; - right ^= (tmp << 2); - - tmp = ((left >>> 16) ^ right) & 0x0000ffff; - right ^= tmp; - left ^= (tmp << 16); - - tmp = ((left >>> 4) ^ right) & 0x0f0f0f0f; - right ^= tmp; - left ^= (tmp << 4); - - output[0] = left; - output[1] = right; -} - -/** - * Deprecated. Instead, use: - * - * forge.cipher.createCipher('DES-', key); - * forge.cipher.createDecipher('DES-', key); - * - * Creates a deprecated DES cipher object. This object's mode will default to - * CBC (cipher-block-chaining). - * - * The key may be given as a binary-encoded string of bytes or a byte buffer. - * - * @param options the options to use. - * key the symmetric key to use (64 or 192 bits). - * output the buffer to write to. - * decrypt true for decryption, false for encryption. - * mode the cipher mode to use (default: 'CBC'). - * - * @return the cipher. - */ -function _createCipher(options) { - options = options || {}; - var mode = (options.mode || 'CBC').toUpperCase(); - var algorithm = 'DES-' + mode; - - var cipher; - if(options.decrypt) { - cipher = forge.cipher.createDecipher(algorithm, options.key); - } else { - cipher = forge.cipher.createCipher(algorithm, options.key); - } - - // backwards compatible start API - var start = cipher.start; - cipher.start = function(iv, options) { - // backwards compatibility: support second arg as output buffer - var output = null; - if(options instanceof forge.util.ByteBuffer) { - output = options; - options = {}; - } - options = options || {}; - options.output = output; - options.iv = iv; - start.call(cipher, options); - }; - - return cipher; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/ed25519.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/ed25519.js deleted file mode 100644 index f3e6faaa..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/ed25519.js +++ /dev/null @@ -1,1072 +0,0 @@ -/** - * JavaScript implementation of Ed25519. - * - * Copyright (c) 2017-2019 Digital Bazaar, Inc. - * - * This implementation is based on the most excellent TweetNaCl which is - * in the public domain. Many thanks to its contributors: - * - * https://github.com/dchest/tweetnacl-js - */ -var forge = require('./forge'); -require('./jsbn'); -require('./random'); -require('./sha512'); -require('./util'); -var asn1Validator = require('./asn1-validator'); -var publicKeyValidator = asn1Validator.publicKeyValidator; -var privateKeyValidator = asn1Validator.privateKeyValidator; - -if(typeof BigInteger === 'undefined') { - var BigInteger = forge.jsbn.BigInteger; -} - -var ByteBuffer = forge.util.ByteBuffer; -var NativeBuffer = typeof Buffer === 'undefined' ? Uint8Array : Buffer; - -/* - * Ed25519 algorithms, see RFC 8032: - * https://tools.ietf.org/html/rfc8032 - */ -forge.pki = forge.pki || {}; -module.exports = forge.pki.ed25519 = forge.ed25519 = forge.ed25519 || {}; -var ed25519 = forge.ed25519; - -ed25519.constants = {}; -ed25519.constants.PUBLIC_KEY_BYTE_LENGTH = 32; -ed25519.constants.PRIVATE_KEY_BYTE_LENGTH = 64; -ed25519.constants.SEED_BYTE_LENGTH = 32; -ed25519.constants.SIGN_BYTE_LENGTH = 64; -ed25519.constants.HASH_BYTE_LENGTH = 64; - -ed25519.generateKeyPair = function(options) { - options = options || {}; - var seed = options.seed; - if(seed === undefined) { - // generate seed - seed = forge.random.getBytesSync(ed25519.constants.SEED_BYTE_LENGTH); - } else if(typeof seed === 'string') { - if(seed.length !== ed25519.constants.SEED_BYTE_LENGTH) { - throw new TypeError( - '"seed" must be ' + ed25519.constants.SEED_BYTE_LENGTH + - ' bytes in length.'); - } - } else if(!(seed instanceof Uint8Array)) { - throw new TypeError( - '"seed" must be a node.js Buffer, Uint8Array, or a binary string.'); - } - - seed = messageToNativeBuffer({message: seed, encoding: 'binary'}); - - var pk = new NativeBuffer(ed25519.constants.PUBLIC_KEY_BYTE_LENGTH); - var sk = new NativeBuffer(ed25519.constants.PRIVATE_KEY_BYTE_LENGTH); - for(var i = 0; i < 32; ++i) { - sk[i] = seed[i]; - } - crypto_sign_keypair(pk, sk); - return {publicKey: pk, privateKey: sk}; -}; - -/** - * Converts a private key from a RFC8410 ASN.1 encoding. - * - * @param obj - The asn1 representation of a private key. - * - * @returns {Object} keyInfo - The key information. - * @returns {Buffer|Uint8Array} keyInfo.privateKeyBytes - 32 private key bytes. - */ -ed25519.privateKeyFromAsn1 = function(obj) { - var capture = {}; - var errors = []; - var valid = forge.asn1.validate(obj, privateKeyValidator, capture, errors); - if(!valid) { - var error = new Error('Invalid Key.'); - error.errors = errors; - throw error; - } - var oid = forge.asn1.derToOid(capture.privateKeyOid); - var ed25519Oid = forge.oids.EdDSA25519; - if(oid !== ed25519Oid) { - throw new Error('Invalid OID "' + oid + '"; OID must be "' + - ed25519Oid + '".'); - } - var privateKey = capture.privateKey; - // manually extract the private key bytes from nested octet string, see FIXME: - // https://github.com/digitalbazaar/forge/blob/master/lib/asn1.js#L542 - var privateKeyBytes = messageToNativeBuffer({ - message: forge.asn1.fromDer(privateKey).value, - encoding: 'binary' - }); - // TODO: RFC8410 specifies a format for encoding the public key bytes along - // with the private key bytes. `publicKeyBytes` can be returned in the - // future. https://tools.ietf.org/html/rfc8410#section-10.3 - return {privateKeyBytes: privateKeyBytes}; -}; - -/** - * Converts a public key from a RFC8410 ASN.1 encoding. - * - * @param obj - The asn1 representation of a public key. - * - * @return {Buffer|Uint8Array} - 32 public key bytes. - */ -ed25519.publicKeyFromAsn1 = function(obj) { - // get SubjectPublicKeyInfo - var capture = {}; - var errors = []; - var valid = forge.asn1.validate(obj, publicKeyValidator, capture, errors); - if(!valid) { - var error = new Error('Invalid Key.'); - error.errors = errors; - throw error; - } - var oid = forge.asn1.derToOid(capture.publicKeyOid); - var ed25519Oid = forge.oids.EdDSA25519; - if(oid !== ed25519Oid) { - throw new Error('Invalid OID "' + oid + '"; OID must be "' + - ed25519Oid + '".'); - } - var publicKeyBytes = capture.ed25519PublicKey; - if(publicKeyBytes.length !== ed25519.constants.PUBLIC_KEY_BYTE_LENGTH) { - throw new Error('Key length is invalid.'); - } - return messageToNativeBuffer({ - message: publicKeyBytes, - encoding: 'binary' - }); -}; - -ed25519.publicKeyFromPrivateKey = function(options) { - options = options || {}; - var privateKey = messageToNativeBuffer({ - message: options.privateKey, encoding: 'binary' - }); - if(privateKey.length !== ed25519.constants.PRIVATE_KEY_BYTE_LENGTH) { - throw new TypeError( - '"options.privateKey" must have a byte length of ' + - ed25519.constants.PRIVATE_KEY_BYTE_LENGTH); - } - - var pk = new NativeBuffer(ed25519.constants.PUBLIC_KEY_BYTE_LENGTH); - for(var i = 0; i < pk.length; ++i) { - pk[i] = privateKey[32 + i]; - } - return pk; -}; - -ed25519.sign = function(options) { - options = options || {}; - var msg = messageToNativeBuffer(options); - var privateKey = messageToNativeBuffer({ - message: options.privateKey, - encoding: 'binary' - }); - if(privateKey.length === ed25519.constants.SEED_BYTE_LENGTH) { - var keyPair = ed25519.generateKeyPair({seed: privateKey}); - privateKey = keyPair.privateKey; - } else if(privateKey.length !== ed25519.constants.PRIVATE_KEY_BYTE_LENGTH) { - throw new TypeError( - '"options.privateKey" must have a byte length of ' + - ed25519.constants.SEED_BYTE_LENGTH + ' or ' + - ed25519.constants.PRIVATE_KEY_BYTE_LENGTH); - } - - var signedMsg = new NativeBuffer( - ed25519.constants.SIGN_BYTE_LENGTH + msg.length); - crypto_sign(signedMsg, msg, msg.length, privateKey); - - var sig = new NativeBuffer(ed25519.constants.SIGN_BYTE_LENGTH); - for(var i = 0; i < sig.length; ++i) { - sig[i] = signedMsg[i]; - } - return sig; -}; - -ed25519.verify = function(options) { - options = options || {}; - var msg = messageToNativeBuffer(options); - if(options.signature === undefined) { - throw new TypeError( - '"options.signature" must be a node.js Buffer, a Uint8Array, a forge ' + - 'ByteBuffer, or a binary string.'); - } - var sig = messageToNativeBuffer({ - message: options.signature, - encoding: 'binary' - }); - if(sig.length !== ed25519.constants.SIGN_BYTE_LENGTH) { - throw new TypeError( - '"options.signature" must have a byte length of ' + - ed25519.constants.SIGN_BYTE_LENGTH); - } - var publicKey = messageToNativeBuffer({ - message: options.publicKey, - encoding: 'binary' - }); - if(publicKey.length !== ed25519.constants.PUBLIC_KEY_BYTE_LENGTH) { - throw new TypeError( - '"options.publicKey" must have a byte length of ' + - ed25519.constants.PUBLIC_KEY_BYTE_LENGTH); - } - - var sm = new NativeBuffer(ed25519.constants.SIGN_BYTE_LENGTH + msg.length); - var m = new NativeBuffer(ed25519.constants.SIGN_BYTE_LENGTH + msg.length); - var i; - for(i = 0; i < ed25519.constants.SIGN_BYTE_LENGTH; ++i) { - sm[i] = sig[i]; - } - for(i = 0; i < msg.length; ++i) { - sm[i + ed25519.constants.SIGN_BYTE_LENGTH] = msg[i]; - } - return (crypto_sign_open(m, sm, sm.length, publicKey) >= 0); -}; - -function messageToNativeBuffer(options) { - var message = options.message; - if(message instanceof Uint8Array || message instanceof NativeBuffer) { - return message; - } - - var encoding = options.encoding; - if(message === undefined) { - if(options.md) { - // TODO: more rigorous validation that `md` is a MessageDigest - message = options.md.digest().getBytes(); - encoding = 'binary'; - } else { - throw new TypeError('"options.message" or "options.md" not specified.'); - } - } - - if(typeof message === 'string' && !encoding) { - throw new TypeError('"options.encoding" must be "binary" or "utf8".'); - } - - if(typeof message === 'string') { - if(typeof Buffer !== 'undefined') { - return Buffer.from(message, encoding); - } - message = new ByteBuffer(message, encoding); - } else if(!(message instanceof ByteBuffer)) { - throw new TypeError( - '"options.message" must be a node.js Buffer, a Uint8Array, a forge ' + - 'ByteBuffer, or a string with "options.encoding" specifying its ' + - 'encoding.'); - } - - // convert to native buffer - var buffer = new NativeBuffer(message.length()); - for(var i = 0; i < buffer.length; ++i) { - buffer[i] = message.at(i); - } - return buffer; -} - -var gf0 = gf(); -var gf1 = gf([1]); -var D = gf([ - 0x78a3, 0x1359, 0x4dca, 0x75eb, 0xd8ab, 0x4141, 0x0a4d, 0x0070, - 0xe898, 0x7779, 0x4079, 0x8cc7, 0xfe73, 0x2b6f, 0x6cee, 0x5203]); -var D2 = gf([ - 0xf159, 0x26b2, 0x9b94, 0xebd6, 0xb156, 0x8283, 0x149a, 0x00e0, - 0xd130, 0xeef3, 0x80f2, 0x198e, 0xfce7, 0x56df, 0xd9dc, 0x2406]); -var X = gf([ - 0xd51a, 0x8f25, 0x2d60, 0xc956, 0xa7b2, 0x9525, 0xc760, 0x692c, - 0xdc5c, 0xfdd6, 0xe231, 0xc0a4, 0x53fe, 0xcd6e, 0x36d3, 0x2169]); -var Y = gf([ - 0x6658, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, - 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666]); -var L = new Float64Array([ - 0xed, 0xd3, 0xf5, 0x5c, 0x1a, 0x63, 0x12, 0x58, - 0xd6, 0x9c, 0xf7, 0xa2, 0xde, 0xf9, 0xde, 0x14, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x10]); -var I = gf([ - 0xa0b0, 0x4a0e, 0x1b27, 0xc4ee, 0xe478, 0xad2f, 0x1806, 0x2f43, - 0xd7a7, 0x3dfb, 0x0099, 0x2b4d, 0xdf0b, 0x4fc1, 0x2480, 0x2b83]); - -// TODO: update forge buffer implementation to use `Buffer` or `Uint8Array`, -// whichever is available, to improve performance -function sha512(msg, msgLen) { - // Note: `out` and `msg` are NativeBuffer - var md = forge.md.sha512.create(); - var buffer = new ByteBuffer(msg); - md.update(buffer.getBytes(msgLen), 'binary'); - var hash = md.digest().getBytes(); - if(typeof Buffer !== 'undefined') { - return Buffer.from(hash, 'binary'); - } - var out = new NativeBuffer(ed25519.constants.HASH_BYTE_LENGTH); - for(var i = 0; i < 64; ++i) { - out[i] = hash.charCodeAt(i); - } - return out; -} - -function crypto_sign_keypair(pk, sk) { - var p = [gf(), gf(), gf(), gf()]; - var i; - - var d = sha512(sk, 32); - d[0] &= 248; - d[31] &= 127; - d[31] |= 64; - - scalarbase(p, d); - pack(pk, p); - - for(i = 0; i < 32; ++i) { - sk[i + 32] = pk[i]; - } - return 0; -} - -// Note: difference from C - smlen returned, not passed as argument. -function crypto_sign(sm, m, n, sk) { - var i, j, x = new Float64Array(64); - var p = [gf(), gf(), gf(), gf()]; - - var d = sha512(sk, 32); - d[0] &= 248; - d[31] &= 127; - d[31] |= 64; - - var smlen = n + 64; - for(i = 0; i < n; ++i) { - sm[64 + i] = m[i]; - } - for(i = 0; i < 32; ++i) { - sm[32 + i] = d[32 + i]; - } - - var r = sha512(sm.subarray(32), n + 32); - reduce(r); - scalarbase(p, r); - pack(sm, p); - - for(i = 32; i < 64; ++i) { - sm[i] = sk[i]; - } - var h = sha512(sm, n + 64); - reduce(h); - - for(i = 32; i < 64; ++i) { - x[i] = 0; - } - for(i = 0; i < 32; ++i) { - x[i] = r[i]; - } - for(i = 0; i < 32; ++i) { - for(j = 0; j < 32; j++) { - x[i + j] += h[i] * d[j]; - } - } - - modL(sm.subarray(32), x); - return smlen; -} - -function crypto_sign_open(m, sm, n, pk) { - var i, mlen; - var t = new NativeBuffer(32); - var p = [gf(), gf(), gf(), gf()], - q = [gf(), gf(), gf(), gf()]; - - mlen = -1; - if(n < 64) { - return -1; - } - - if(unpackneg(q, pk)) { - return -1; - } - - for(i = 0; i < n; ++i) { - m[i] = sm[i]; - } - for(i = 0; i < 32; ++i) { - m[i + 32] = pk[i]; - } - var h = sha512(m, n); - reduce(h); - scalarmult(p, q, h); - - scalarbase(q, sm.subarray(32)); - add(p, q); - pack(t, p); - - n -= 64; - if(crypto_verify_32(sm, 0, t, 0)) { - for(i = 0; i < n; ++i) { - m[i] = 0; - } - return -1; - } - - for(i = 0; i < n; ++i) { - m[i] = sm[i + 64]; - } - mlen = n; - return mlen; -} - -function modL(r, x) { - var carry, i, j, k; - for(i = 63; i >= 32; --i) { - carry = 0; - for(j = i - 32, k = i - 12; j < k; ++j) { - x[j] += carry - 16 * x[i] * L[j - (i - 32)]; - carry = (x[j] + 128) >> 8; - x[j] -= carry * 256; - } - x[j] += carry; - x[i] = 0; - } - carry = 0; - for(j = 0; j < 32; ++j) { - x[j] += carry - (x[31] >> 4) * L[j]; - carry = x[j] >> 8; - x[j] &= 255; - } - for(j = 0; j < 32; ++j) { - x[j] -= carry * L[j]; - } - for(i = 0; i < 32; ++i) { - x[i + 1] += x[i] >> 8; - r[i] = x[i] & 255; - } -} - -function reduce(r) { - var x = new Float64Array(64); - for(var i = 0; i < 64; ++i) { - x[i] = r[i]; - r[i] = 0; - } - modL(r, x); -} - -function add(p, q) { - var a = gf(), b = gf(), c = gf(), - d = gf(), e = gf(), f = gf(), - g = gf(), h = gf(), t = gf(); - - Z(a, p[1], p[0]); - Z(t, q[1], q[0]); - M(a, a, t); - A(b, p[0], p[1]); - A(t, q[0], q[1]); - M(b, b, t); - M(c, p[3], q[3]); - M(c, c, D2); - M(d, p[2], q[2]); - A(d, d, d); - Z(e, b, a); - Z(f, d, c); - A(g, d, c); - A(h, b, a); - - M(p[0], e, f); - M(p[1], h, g); - M(p[2], g, f); - M(p[3], e, h); -} - -function cswap(p, q, b) { - for(var i = 0; i < 4; ++i) { - sel25519(p[i], q[i], b); - } -} - -function pack(r, p) { - var tx = gf(), ty = gf(), zi = gf(); - inv25519(zi, p[2]); - M(tx, p[0], zi); - M(ty, p[1], zi); - pack25519(r, ty); - r[31] ^= par25519(tx) << 7; -} - -function pack25519(o, n) { - var i, j, b; - var m = gf(), t = gf(); - for(i = 0; i < 16; ++i) { - t[i] = n[i]; - } - car25519(t); - car25519(t); - car25519(t); - for(j = 0; j < 2; ++j) { - m[0] = t[0] - 0xffed; - for(i = 1; i < 15; ++i) { - m[i] = t[i] - 0xffff - ((m[i - 1] >> 16) & 1); - m[i-1] &= 0xffff; - } - m[15] = t[15] - 0x7fff - ((m[14] >> 16) & 1); - b = (m[15] >> 16) & 1; - m[14] &= 0xffff; - sel25519(t, m, 1 - b); - } - for (i = 0; i < 16; i++) { - o[2 * i] = t[i] & 0xff; - o[2 * i + 1] = t[i] >> 8; - } -} - -function unpackneg(r, p) { - var t = gf(), chk = gf(), num = gf(), - den = gf(), den2 = gf(), den4 = gf(), - den6 = gf(); - - set25519(r[2], gf1); - unpack25519(r[1], p); - S(num, r[1]); - M(den, num, D); - Z(num, num, r[2]); - A(den, r[2], den); - - S(den2, den); - S(den4, den2); - M(den6, den4, den2); - M(t, den6, num); - M(t, t, den); - - pow2523(t, t); - M(t, t, num); - M(t, t, den); - M(t, t, den); - M(r[0], t, den); - - S(chk, r[0]); - M(chk, chk, den); - if(neq25519(chk, num)) { - M(r[0], r[0], I); - } - - S(chk, r[0]); - M(chk, chk, den); - if(neq25519(chk, num)) { - return -1; - } - - if(par25519(r[0]) === (p[31] >> 7)) { - Z(r[0], gf0, r[0]); - } - - M(r[3], r[0], r[1]); - return 0; -} - -function unpack25519(o, n) { - var i; - for(i = 0; i < 16; ++i) { - o[i] = n[2 * i] + (n[2 * i + 1] << 8); - } - o[15] &= 0x7fff; -} - -function pow2523(o, i) { - var c = gf(); - var a; - for(a = 0; a < 16; ++a) { - c[a] = i[a]; - } - for(a = 250; a >= 0; --a) { - S(c, c); - if(a !== 1) { - M(c, c, i); - } - } - for(a = 0; a < 16; ++a) { - o[a] = c[a]; - } -} - -function neq25519(a, b) { - var c = new NativeBuffer(32); - var d = new NativeBuffer(32); - pack25519(c, a); - pack25519(d, b); - return crypto_verify_32(c, 0, d, 0); -} - -function crypto_verify_32(x, xi, y, yi) { - return vn(x, xi, y, yi, 32); -} - -function vn(x, xi, y, yi, n) { - var i, d = 0; - for(i = 0; i < n; ++i) { - d |= x[xi + i] ^ y[yi + i]; - } - return (1 & ((d - 1) >>> 8)) - 1; -} - -function par25519(a) { - var d = new NativeBuffer(32); - pack25519(d, a); - return d[0] & 1; -} - -function scalarmult(p, q, s) { - var b, i; - set25519(p[0], gf0); - set25519(p[1], gf1); - set25519(p[2], gf1); - set25519(p[3], gf0); - for(i = 255; i >= 0; --i) { - b = (s[(i / 8)|0] >> (i & 7)) & 1; - cswap(p, q, b); - add(q, p); - add(p, p); - cswap(p, q, b); - } -} - -function scalarbase(p, s) { - var q = [gf(), gf(), gf(), gf()]; - set25519(q[0], X); - set25519(q[1], Y); - set25519(q[2], gf1); - M(q[3], X, Y); - scalarmult(p, q, s); -} - -function set25519(r, a) { - var i; - for(i = 0; i < 16; i++) { - r[i] = a[i] | 0; - } -} - -function inv25519(o, i) { - var c = gf(); - var a; - for(a = 0; a < 16; ++a) { - c[a] = i[a]; - } - for(a = 253; a >= 0; --a) { - S(c, c); - if(a !== 2 && a !== 4) { - M(c, c, i); - } - } - for(a = 0; a < 16; ++a) { - o[a] = c[a]; - } -} - -function car25519(o) { - var i, v, c = 1; - for(i = 0; i < 16; ++i) { - v = o[i] + c + 65535; - c = Math.floor(v / 65536); - o[i] = v - c * 65536; - } - o[0] += c - 1 + 37 * (c - 1); -} - -function sel25519(p, q, b) { - var t, c = ~(b - 1); - for(var i = 0; i < 16; ++i) { - t = c & (p[i] ^ q[i]); - p[i] ^= t; - q[i] ^= t; - } -} - -function gf(init) { - var i, r = new Float64Array(16); - if(init) { - for(i = 0; i < init.length; ++i) { - r[i] = init[i]; - } - } - return r; -} - -function A(o, a, b) { - for(var i = 0; i < 16; ++i) { - o[i] = a[i] + b[i]; - } -} - -function Z(o, a, b) { - for(var i = 0; i < 16; ++i) { - o[i] = a[i] - b[i]; - } -} - -function S(o, a) { - M(o, a, a); -} - -function M(o, a, b) { - var v, c, - t0 = 0, t1 = 0, t2 = 0, t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, - t8 = 0, t9 = 0, t10 = 0, t11 = 0, t12 = 0, t13 = 0, t14 = 0, t15 = 0, - t16 = 0, t17 = 0, t18 = 0, t19 = 0, t20 = 0, t21 = 0, t22 = 0, t23 = 0, - t24 = 0, t25 = 0, t26 = 0, t27 = 0, t28 = 0, t29 = 0, t30 = 0, - b0 = b[0], - b1 = b[1], - b2 = b[2], - b3 = b[3], - b4 = b[4], - b5 = b[5], - b6 = b[6], - b7 = b[7], - b8 = b[8], - b9 = b[9], - b10 = b[10], - b11 = b[11], - b12 = b[12], - b13 = b[13], - b14 = b[14], - b15 = b[15]; - - v = a[0]; - t0 += v * b0; - t1 += v * b1; - t2 += v * b2; - t3 += v * b3; - t4 += v * b4; - t5 += v * b5; - t6 += v * b6; - t7 += v * b7; - t8 += v * b8; - t9 += v * b9; - t10 += v * b10; - t11 += v * b11; - t12 += v * b12; - t13 += v * b13; - t14 += v * b14; - t15 += v * b15; - v = a[1]; - t1 += v * b0; - t2 += v * b1; - t3 += v * b2; - t4 += v * b3; - t5 += v * b4; - t6 += v * b5; - t7 += v * b6; - t8 += v * b7; - t9 += v * b8; - t10 += v * b9; - t11 += v * b10; - t12 += v * b11; - t13 += v * b12; - t14 += v * b13; - t15 += v * b14; - t16 += v * b15; - v = a[2]; - t2 += v * b0; - t3 += v * b1; - t4 += v * b2; - t5 += v * b3; - t6 += v * b4; - t7 += v * b5; - t8 += v * b6; - t9 += v * b7; - t10 += v * b8; - t11 += v * b9; - t12 += v * b10; - t13 += v * b11; - t14 += v * b12; - t15 += v * b13; - t16 += v * b14; - t17 += v * b15; - v = a[3]; - t3 += v * b0; - t4 += v * b1; - t5 += v * b2; - t6 += v * b3; - t7 += v * b4; - t8 += v * b5; - t9 += v * b6; - t10 += v * b7; - t11 += v * b8; - t12 += v * b9; - t13 += v * b10; - t14 += v * b11; - t15 += v * b12; - t16 += v * b13; - t17 += v * b14; - t18 += v * b15; - v = a[4]; - t4 += v * b0; - t5 += v * b1; - t6 += v * b2; - t7 += v * b3; - t8 += v * b4; - t9 += v * b5; - t10 += v * b6; - t11 += v * b7; - t12 += v * b8; - t13 += v * b9; - t14 += v * b10; - t15 += v * b11; - t16 += v * b12; - t17 += v * b13; - t18 += v * b14; - t19 += v * b15; - v = a[5]; - t5 += v * b0; - t6 += v * b1; - t7 += v * b2; - t8 += v * b3; - t9 += v * b4; - t10 += v * b5; - t11 += v * b6; - t12 += v * b7; - t13 += v * b8; - t14 += v * b9; - t15 += v * b10; - t16 += v * b11; - t17 += v * b12; - t18 += v * b13; - t19 += v * b14; - t20 += v * b15; - v = a[6]; - t6 += v * b0; - t7 += v * b1; - t8 += v * b2; - t9 += v * b3; - t10 += v * b4; - t11 += v * b5; - t12 += v * b6; - t13 += v * b7; - t14 += v * b8; - t15 += v * b9; - t16 += v * b10; - t17 += v * b11; - t18 += v * b12; - t19 += v * b13; - t20 += v * b14; - t21 += v * b15; - v = a[7]; - t7 += v * b0; - t8 += v * b1; - t9 += v * b2; - t10 += v * b3; - t11 += v * b4; - t12 += v * b5; - t13 += v * b6; - t14 += v * b7; - t15 += v * b8; - t16 += v * b9; - t17 += v * b10; - t18 += v * b11; - t19 += v * b12; - t20 += v * b13; - t21 += v * b14; - t22 += v * b15; - v = a[8]; - t8 += v * b0; - t9 += v * b1; - t10 += v * b2; - t11 += v * b3; - t12 += v * b4; - t13 += v * b5; - t14 += v * b6; - t15 += v * b7; - t16 += v * b8; - t17 += v * b9; - t18 += v * b10; - t19 += v * b11; - t20 += v * b12; - t21 += v * b13; - t22 += v * b14; - t23 += v * b15; - v = a[9]; - t9 += v * b0; - t10 += v * b1; - t11 += v * b2; - t12 += v * b3; - t13 += v * b4; - t14 += v * b5; - t15 += v * b6; - t16 += v * b7; - t17 += v * b8; - t18 += v * b9; - t19 += v * b10; - t20 += v * b11; - t21 += v * b12; - t22 += v * b13; - t23 += v * b14; - t24 += v * b15; - v = a[10]; - t10 += v * b0; - t11 += v * b1; - t12 += v * b2; - t13 += v * b3; - t14 += v * b4; - t15 += v * b5; - t16 += v * b6; - t17 += v * b7; - t18 += v * b8; - t19 += v * b9; - t20 += v * b10; - t21 += v * b11; - t22 += v * b12; - t23 += v * b13; - t24 += v * b14; - t25 += v * b15; - v = a[11]; - t11 += v * b0; - t12 += v * b1; - t13 += v * b2; - t14 += v * b3; - t15 += v * b4; - t16 += v * b5; - t17 += v * b6; - t18 += v * b7; - t19 += v * b8; - t20 += v * b9; - t21 += v * b10; - t22 += v * b11; - t23 += v * b12; - t24 += v * b13; - t25 += v * b14; - t26 += v * b15; - v = a[12]; - t12 += v * b0; - t13 += v * b1; - t14 += v * b2; - t15 += v * b3; - t16 += v * b4; - t17 += v * b5; - t18 += v * b6; - t19 += v * b7; - t20 += v * b8; - t21 += v * b9; - t22 += v * b10; - t23 += v * b11; - t24 += v * b12; - t25 += v * b13; - t26 += v * b14; - t27 += v * b15; - v = a[13]; - t13 += v * b0; - t14 += v * b1; - t15 += v * b2; - t16 += v * b3; - t17 += v * b4; - t18 += v * b5; - t19 += v * b6; - t20 += v * b7; - t21 += v * b8; - t22 += v * b9; - t23 += v * b10; - t24 += v * b11; - t25 += v * b12; - t26 += v * b13; - t27 += v * b14; - t28 += v * b15; - v = a[14]; - t14 += v * b0; - t15 += v * b1; - t16 += v * b2; - t17 += v * b3; - t18 += v * b4; - t19 += v * b5; - t20 += v * b6; - t21 += v * b7; - t22 += v * b8; - t23 += v * b9; - t24 += v * b10; - t25 += v * b11; - t26 += v * b12; - t27 += v * b13; - t28 += v * b14; - t29 += v * b15; - v = a[15]; - t15 += v * b0; - t16 += v * b1; - t17 += v * b2; - t18 += v * b3; - t19 += v * b4; - t20 += v * b5; - t21 += v * b6; - t22 += v * b7; - t23 += v * b8; - t24 += v * b9; - t25 += v * b10; - t26 += v * b11; - t27 += v * b12; - t28 += v * b13; - t29 += v * b14; - t30 += v * b15; - - t0 += 38 * t16; - t1 += 38 * t17; - t2 += 38 * t18; - t3 += 38 * t19; - t4 += 38 * t20; - t5 += 38 * t21; - t6 += 38 * t22; - t7 += 38 * t23; - t8 += 38 * t24; - t9 += 38 * t25; - t10 += 38 * t26; - t11 += 38 * t27; - t12 += 38 * t28; - t13 += 38 * t29; - t14 += 38 * t30; - // t15 left as is - - // first car - c = 1; - v = t0 + c + 65535; c = Math.floor(v / 65536); t0 = v - c * 65536; - v = t1 + c + 65535; c = Math.floor(v / 65536); t1 = v - c * 65536; - v = t2 + c + 65535; c = Math.floor(v / 65536); t2 = v - c * 65536; - v = t3 + c + 65535; c = Math.floor(v / 65536); t3 = v - c * 65536; - v = t4 + c + 65535; c = Math.floor(v / 65536); t4 = v - c * 65536; - v = t5 + c + 65535; c = Math.floor(v / 65536); t5 = v - c * 65536; - v = t6 + c + 65535; c = Math.floor(v / 65536); t6 = v - c * 65536; - v = t7 + c + 65535; c = Math.floor(v / 65536); t7 = v - c * 65536; - v = t8 + c + 65535; c = Math.floor(v / 65536); t8 = v - c * 65536; - v = t9 + c + 65535; c = Math.floor(v / 65536); t9 = v - c * 65536; - v = t10 + c + 65535; c = Math.floor(v / 65536); t10 = v - c * 65536; - v = t11 + c + 65535; c = Math.floor(v / 65536); t11 = v - c * 65536; - v = t12 + c + 65535; c = Math.floor(v / 65536); t12 = v - c * 65536; - v = t13 + c + 65535; c = Math.floor(v / 65536); t13 = v - c * 65536; - v = t14 + c + 65535; c = Math.floor(v / 65536); t14 = v - c * 65536; - v = t15 + c + 65535; c = Math.floor(v / 65536); t15 = v - c * 65536; - t0 += c-1 + 37 * (c-1); - - // second car - c = 1; - v = t0 + c + 65535; c = Math.floor(v / 65536); t0 = v - c * 65536; - v = t1 + c + 65535; c = Math.floor(v / 65536); t1 = v - c * 65536; - v = t2 + c + 65535; c = Math.floor(v / 65536); t2 = v - c * 65536; - v = t3 + c + 65535; c = Math.floor(v / 65536); t3 = v - c * 65536; - v = t4 + c + 65535; c = Math.floor(v / 65536); t4 = v - c * 65536; - v = t5 + c + 65535; c = Math.floor(v / 65536); t5 = v - c * 65536; - v = t6 + c + 65535; c = Math.floor(v / 65536); t6 = v - c * 65536; - v = t7 + c + 65535; c = Math.floor(v / 65536); t7 = v - c * 65536; - v = t8 + c + 65535; c = Math.floor(v / 65536); t8 = v - c * 65536; - v = t9 + c + 65535; c = Math.floor(v / 65536); t9 = v - c * 65536; - v = t10 + c + 65535; c = Math.floor(v / 65536); t10 = v - c * 65536; - v = t11 + c + 65535; c = Math.floor(v / 65536); t11 = v - c * 65536; - v = t12 + c + 65535; c = Math.floor(v / 65536); t12 = v - c * 65536; - v = t13 + c + 65535; c = Math.floor(v / 65536); t13 = v - c * 65536; - v = t14 + c + 65535; c = Math.floor(v / 65536); t14 = v - c * 65536; - v = t15 + c + 65535; c = Math.floor(v / 65536); t15 = v - c * 65536; - t0 += c-1 + 37 * (c-1); - - o[ 0] = t0; - o[ 1] = t1; - o[ 2] = t2; - o[ 3] = t3; - o[ 4] = t4; - o[ 5] = t5; - o[ 6] = t6; - o[ 7] = t7; - o[ 8] = t8; - o[ 9] = t9; - o[10] = t10; - o[11] = t11; - o[12] = t12; - o[13] = t13; - o[14] = t14; - o[15] = t15; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/forge.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/forge.js deleted file mode 100644 index 2e243a9d..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/forge.js +++ /dev/null @@ -1,13 +0,0 @@ -/** - * Node.js module for Forge. - * - * @author Dave Longley - * - * Copyright 2011-2016 Digital Bazaar, Inc. - */ -module.exports = { - // default options - options: { - usePureJavaScript: false - } -}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/form.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/form.js deleted file mode 100644 index 4d7843a2..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/form.js +++ /dev/null @@ -1,149 +0,0 @@ -/** - * Functions for manipulating web forms. - * - * @author David I. Lehn - * @author Dave Longley - * @author Mike Johnson - * - * Copyright (c) 2011-2014 Digital Bazaar, Inc. All rights reserved. - */ -var forge = require('./forge'); - -/* Form API */ -var form = module.exports = forge.form = forge.form || {}; - -(function($) { - -/** - * Regex for parsing a single name property (handles array brackets). - */ -var _regex = /([^\[]*?)\[(.*?)\]/g; - -/** - * Parses a single name property into an array with the name and any - * array indices. - * - * @param name the name to parse. - * - * @return the array of the name and its array indices in order. - */ -var _parseName = function(name) { - var rval = []; - - var matches; - while(!!(matches = _regex.exec(name))) { - if(matches[1].length > 0) { - rval.push(matches[1]); - } - if(matches.length >= 2) { - rval.push(matches[2]); - } - } - if(rval.length === 0) { - rval.push(name); - } - - return rval; -}; - -/** - * Adds a field from the given form to the given object. - * - * @param obj the object. - * @param names the field as an array of object property names. - * @param value the value of the field. - * @param dict a dictionary of names to replace. - */ -var _addField = function(obj, names, value, dict) { - // combine array names that fall within square brackets - var tmp = []; - for(var i = 0; i < names.length; ++i) { - // check name for starting square bracket but no ending one - var name = names[i]; - if(name.indexOf('[') !== -1 && name.indexOf(']') === -1 && - i < names.length - 1) { - do { - name += '.' + names[++i]; - } while(i < names.length - 1 && names[i].indexOf(']') === -1); - } - tmp.push(name); - } - names = tmp; - - // split out array indexes - var tmp = []; - $.each(names, function(n, name) { - tmp = tmp.concat(_parseName(name)); - }); - names = tmp; - - // iterate over object property names until value is set - $.each(names, function(n, name) { - // do dictionary name replacement - if(dict && name.length !== 0 && name in dict) { - name = dict[name]; - } - - // blank name indicates appending to an array, set name to - // new last index of array - if(name.length === 0) { - name = obj.length; - } - - // value already exists, append value - if(obj[name]) { - // last name in the field - if(n == names.length - 1) { - // more than one value, so convert into an array - if(!$.isArray(obj[name])) { - obj[name] = [obj[name]]; - } - obj[name].push(value); - } else { - // not last name, go deeper into object - obj = obj[name]; - } - } else if(n == names.length - 1) { - // new value, last name in the field, set value - obj[name] = value; - } else { - // new value, not last name, go deeper - // get next name - var next = names[n + 1]; - - // blank next value indicates array-appending, so create array - if(next.length === 0) { - obj[name] = []; - } else { - // if next name is a number create an array, otherwise a map - var isNum = ((next - 0) == next && next.length > 0); - obj[name] = isNum ? [] : {}; - } - obj = obj[name]; - } - }); -}; - -/** - * Serializes a form to a JSON object. Object properties will be separated - * using the given separator (defaults to '.') and by square brackets. - * - * @param input the jquery form to serialize. - * @param sep the object-property separator (defaults to '.'). - * @param dict a dictionary of names to replace (name=replace). - * - * @return the JSON-serialized form. - */ -form.serialize = function(input, sep, dict) { - var rval = {}; - - // add all fields in the form to the object - sep = sep || '.'; - $.each(input.serializeArray(), function() { - _addField(rval, this.name.split(sep), this.value || '', dict); - }); - - return rval; -}; - -})(jQuery); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/hmac.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/hmac.js deleted file mode 100644 index b155f247..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/hmac.js +++ /dev/null @@ -1,146 +0,0 @@ -/** - * Hash-based Message Authentication Code implementation. Requires a message - * digest object that can be obtained, for example, from forge.md.sha1 or - * forge.md.md5. - * - * @author Dave Longley - * - * Copyright (c) 2010-2012 Digital Bazaar, Inc. All rights reserved. - */ -var forge = require('./forge'); -require('./md'); -require('./util'); - -/* HMAC API */ -var hmac = module.exports = forge.hmac = forge.hmac || {}; - -/** - * Creates an HMAC object that uses the given message digest object. - * - * @return an HMAC object. - */ -hmac.create = function() { - // the hmac key to use - var _key = null; - - // the message digest to use - var _md = null; - - // the inner padding - var _ipadding = null; - - // the outer padding - var _opadding = null; - - // hmac context - var ctx = {}; - - /** - * Starts or restarts the HMAC with the given key and message digest. - * - * @param md the message digest to use, null to reuse the previous one, - * a string to use builtin 'sha1', 'md5', 'sha256'. - * @param key the key to use as a string, array of bytes, byte buffer, - * or null to reuse the previous key. - */ - ctx.start = function(md, key) { - if(md !== null) { - if(typeof md === 'string') { - // create builtin message digest - md = md.toLowerCase(); - if(md in forge.md.algorithms) { - _md = forge.md.algorithms[md].create(); - } else { - throw new Error('Unknown hash algorithm "' + md + '"'); - } - } else { - // store message digest - _md = md; - } - } - - if(key === null) { - // reuse previous key - key = _key; - } else { - if(typeof key === 'string') { - // convert string into byte buffer - key = forge.util.createBuffer(key); - } else if(forge.util.isArray(key)) { - // convert byte array into byte buffer - var tmp = key; - key = forge.util.createBuffer(); - for(var i = 0; i < tmp.length; ++i) { - key.putByte(tmp[i]); - } - } - - // if key is longer than blocksize, hash it - var keylen = key.length(); - if(keylen > _md.blockLength) { - _md.start(); - _md.update(key.bytes()); - key = _md.digest(); - } - - // mix key into inner and outer padding - // ipadding = [0x36 * blocksize] ^ key - // opadding = [0x5C * blocksize] ^ key - _ipadding = forge.util.createBuffer(); - _opadding = forge.util.createBuffer(); - keylen = key.length(); - for(var i = 0; i < keylen; ++i) { - var tmp = key.at(i); - _ipadding.putByte(0x36 ^ tmp); - _opadding.putByte(0x5C ^ tmp); - } - - // if key is shorter than blocksize, add additional padding - if(keylen < _md.blockLength) { - var tmp = _md.blockLength - keylen; - for(var i = 0; i < tmp; ++i) { - _ipadding.putByte(0x36); - _opadding.putByte(0x5C); - } - } - _key = key; - _ipadding = _ipadding.bytes(); - _opadding = _opadding.bytes(); - } - - // digest is done like so: hash(opadding | hash(ipadding | message)) - - // prepare to do inner hash - // hash(ipadding | message) - _md.start(); - _md.update(_ipadding); - }; - - /** - * Updates the HMAC with the given message bytes. - * - * @param bytes the bytes to update with. - */ - ctx.update = function(bytes) { - _md.update(bytes); - }; - - /** - * Produces the Message Authentication Code (MAC). - * - * @return a byte buffer containing the digest value. - */ - ctx.getMac = function() { - // digest is done like so: hash(opadding | hash(ipadding | message)) - // here we do the outer hashing - var inner = _md.digest().bytes(); - _md.start(); - _md.update(_opadding); - _md.update(inner); - return _md.digest(); - }; - // alias for getMac - ctx.digest = ctx.getMac; - - return ctx; -}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/http.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/http.js deleted file mode 100644 index fe52986b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/http.js +++ /dev/null @@ -1,1346 +0,0 @@ -/** - * HTTP client-side implementation that uses forge.net sockets. - * - * @author Dave Longley - * - * Copyright (c) 2010-2014 Digital Bazaar, Inc. All rights reserved. - */ -var forge = require('./forge'); -require('./tls'); -require('./util'); - -// define http namespace -var http = module.exports = forge.http = forge.http || {}; - -// logging category -var cat = 'forge.http'; - -// normalizes an http header field name -var _normalize = function(name) { - return name.toLowerCase().replace(/(^.)|(-.)/g, - function(a) {return a.toUpperCase();}); -}; - -/** - * Gets the local storage ID for the given client. - * - * @param client the client to get the local storage ID for. - * - * @return the local storage ID to use. - */ -var _getStorageId = function(client) { - // TODO: include browser in ID to avoid sharing cookies between - // browsers (if this is undesirable) - // navigator.userAgent - return 'forge.http.' + - client.url.protocol.slice(0, -1) + '.' + - client.url.hostname + '.' + - client.url.port; -}; - -/** - * Loads persistent cookies from disk for the given client. - * - * @param client the client. - */ -var _loadCookies = function(client) { - if(client.persistCookies) { - try { - var cookies = forge.util.getItem( - client.socketPool.flashApi, - _getStorageId(client), 'cookies'); - client.cookies = cookies || {}; - } catch(ex) { - // no flash storage available, just silently fail - // TODO: i assume we want this logged somewhere or - // should it actually generate an error - //forge.log.error(cat, ex); - } - } -}; - -/** - * Saves persistent cookies on disk for the given client. - * - * @param client the client. - */ -var _saveCookies = function(client) { - if(client.persistCookies) { - try { - forge.util.setItem( - client.socketPool.flashApi, - _getStorageId(client), 'cookies', client.cookies); - } catch(ex) { - // no flash storage available, just silently fail - // TODO: i assume we want this logged somewhere or - // should it actually generate an error - //forge.log.error(cat, ex); - } - } - - // FIXME: remove me - _loadCookies(client); -}; - -/** - * Clears persistent cookies on disk for the given client. - * - * @param client the client. - */ -var _clearCookies = function(client) { - if(client.persistCookies) { - try { - // only thing stored is 'cookies', so clear whole storage - forge.util.clearItems( - client.socketPool.flashApi, - _getStorageId(client)); - } catch(ex) { - // no flash storage available, just silently fail - // TODO: i assume we want this logged somewhere or - // should it actually generate an error - //forge.log.error(cat, ex); - } - } -}; - -/** - * Connects and sends a request. - * - * @param client the http client. - * @param socket the socket to use. - */ -var _doRequest = function(client, socket) { - if(socket.isConnected()) { - // already connected - socket.options.request.connectTime = +new Date(); - socket.connected({ - type: 'connect', - id: socket.id - }); - } else { - // connect - socket.options.request.connectTime = +new Date(); - socket.connect({ - host: client.url.hostname, - port: client.url.port, - policyPort: client.policyPort, - policyUrl: client.policyUrl - }); - } -}; - -/** - * Handles the next request or marks a socket as idle. - * - * @param client the http client. - * @param socket the socket. - */ -var _handleNextRequest = function(client, socket) { - // clear buffer - socket.buffer.clear(); - - // get pending request - var pending = null; - while(pending === null && client.requests.length > 0) { - pending = client.requests.shift(); - if(pending.request.aborted) { - pending = null; - } - } - - // mark socket idle if no pending requests - if(pending === null) { - if(socket.options !== null) { - socket.options = null; - } - client.idle.push(socket); - } else { - // handle pending request, allow 1 retry - socket.retries = 1; - socket.options = pending; - _doRequest(client, socket); - } -}; - -/** - * Sets up a socket for use with an http client. - * - * @param client the parent http client. - * @param socket the socket to set up. - * @param tlsOptions if the socket must use TLS, the TLS options. - */ -var _initSocket = function(client, socket, tlsOptions) { - // no socket options yet - socket.options = null; - - // set up handlers - socket.connected = function(e) { - // socket primed by caching TLS session, handle next request - if(socket.options === null) { - _handleNextRequest(client, socket); - } else { - // socket in use - var request = socket.options.request; - request.connectTime = +new Date() - request.connectTime; - e.socket = socket; - socket.options.connected(e); - if(request.aborted) { - socket.close(); - } else { - var out = request.toString(); - if(request.body) { - out += request.body; - } - request.time = +new Date(); - socket.send(out); - request.time = +new Date() - request.time; - socket.options.response.time = +new Date(); - socket.sending = true; - } - } - }; - socket.closed = function(e) { - if(socket.sending) { - socket.sending = false; - if(socket.retries > 0) { - --socket.retries; - _doRequest(client, socket); - } else { - // error, closed during send - socket.error({ - id: socket.id, - type: 'ioError', - message: 'Connection closed during send. Broken pipe.', - bytesAvailable: 0 - }); - } - } else { - // handle unspecified content-length transfer - var response = socket.options.response; - if(response.readBodyUntilClose) { - response.time = +new Date() - response.time; - response.bodyReceived = true; - socket.options.bodyReady({ - request: socket.options.request, - response: response, - socket: socket - }); - } - socket.options.closed(e); - _handleNextRequest(client, socket); - } - }; - socket.data = function(e) { - socket.sending = false; - var request = socket.options.request; - if(request.aborted) { - socket.close(); - } else { - // receive all bytes available - var response = socket.options.response; - var bytes = socket.receive(e.bytesAvailable); - if(bytes !== null) { - // receive header and then body - socket.buffer.putBytes(bytes); - if(!response.headerReceived) { - response.readHeader(socket.buffer); - if(response.headerReceived) { - socket.options.headerReady({ - request: socket.options.request, - response: response, - socket: socket - }); - } - } - if(response.headerReceived && !response.bodyReceived) { - response.readBody(socket.buffer); - } - if(response.bodyReceived) { - socket.options.bodyReady({ - request: socket.options.request, - response: response, - socket: socket - }); - // close connection if requested or by default on http/1.0 - var value = response.getField('Connection') || ''; - if(value.indexOf('close') != -1 || - (response.version === 'HTTP/1.0' && - response.getField('Keep-Alive') === null)) { - socket.close(); - } else { - _handleNextRequest(client, socket); - } - } - } - } - }; - socket.error = function(e) { - // do error callback, include request - socket.options.error({ - type: e.type, - message: e.message, - request: socket.options.request, - response: socket.options.response, - socket: socket - }); - socket.close(); - }; - - // wrap socket for TLS - if(tlsOptions) { - socket = forge.tls.wrapSocket({ - sessionId: null, - sessionCache: {}, - caStore: tlsOptions.caStore, - cipherSuites: tlsOptions.cipherSuites, - socket: socket, - virtualHost: tlsOptions.virtualHost, - verify: tlsOptions.verify, - getCertificate: tlsOptions.getCertificate, - getPrivateKey: tlsOptions.getPrivateKey, - getSignature: tlsOptions.getSignature, - deflate: tlsOptions.deflate || null, - inflate: tlsOptions.inflate || null - }); - - socket.options = null; - socket.buffer = forge.util.createBuffer(); - client.sockets.push(socket); - if(tlsOptions.prime) { - // prime socket by connecting and caching TLS session, will do - // next request from there - socket.connect({ - host: client.url.hostname, - port: client.url.port, - policyPort: client.policyPort, - policyUrl: client.policyUrl - }); - } else { - // do not prime socket, just add as idle - client.idle.push(socket); - } - } else { - // no need to prime non-TLS sockets - socket.buffer = forge.util.createBuffer(); - client.sockets.push(socket); - client.idle.push(socket); - } -}; - -/** - * Checks to see if the given cookie has expired. If the cookie's max-age - * plus its created time is less than the time now, it has expired, unless - * its max-age is set to -1 which indicates it will never expire. - * - * @param cookie the cookie to check. - * - * @return true if it has expired, false if not. - */ -var _hasCookieExpired = function(cookie) { - var rval = false; - - if(cookie.maxAge !== -1) { - var now = _getUtcTime(new Date()); - var expires = cookie.created + cookie.maxAge; - if(expires <= now) { - rval = true; - } - } - - return rval; -}; - -/** - * Adds cookies in the given client to the given request. - * - * @param client the client. - * @param request the request. - */ -var _writeCookies = function(client, request) { - var expired = []; - var url = client.url; - var cookies = client.cookies; - for(var name in cookies) { - // get cookie paths - var paths = cookies[name]; - for(var p in paths) { - var cookie = paths[p]; - if(_hasCookieExpired(cookie)) { - // store for clean up - expired.push(cookie); - } else if(request.path.indexOf(cookie.path) === 0) { - // path or path's ancestor must match cookie.path - request.addCookie(cookie); - } - } - } - - // clean up expired cookies - for(var i = 0; i < expired.length; ++i) { - var cookie = expired[i]; - client.removeCookie(cookie.name, cookie.path); - } -}; - -/** - * Gets cookies from the given response and adds the to the given client. - * - * @param client the client. - * @param response the response. - */ -var _readCookies = function(client, response) { - var cookies = response.getCookies(); - for(var i = 0; i < cookies.length; ++i) { - try { - client.setCookie(cookies[i]); - } catch(ex) { - // ignore failure to add other-domain, etc. cookies - } - } -}; - -/** - * Creates an http client that uses forge.net sockets as a backend and - * forge.tls for security. - * - * @param options: - * url: the url to connect to (scheme://host:port). - * socketPool: the flash socket pool to use. - * policyPort: the flash policy port to use (if other than the - * socket pool default), use 0 for flash default. - * policyUrl: the flash policy file URL to use (if provided will - * be used instead of a policy port). - * connections: number of connections to use to handle requests. - * caCerts: an array of certificates to trust for TLS, certs may - * be PEM-formatted or cert objects produced via forge.pki. - * cipherSuites: an optional array of cipher suites to use, - * see forge.tls.CipherSuites. - * virtualHost: the virtual server name to use in a TLS SNI - * extension, if not provided the url host will be used. - * verify: a custom TLS certificate verify callback to use. - * getCertificate: an optional callback used to get a client-side - * certificate (see forge.tls for details). - * getPrivateKey: an optional callback used to get a client-side - * private key (see forge.tls for details). - * getSignature: an optional callback used to get a client-side - * signature (see forge.tls for details). - * persistCookies: true to use persistent cookies via flash local - * storage, false to only keep cookies in javascript. - * primeTlsSockets: true to immediately connect TLS sockets on - * their creation so that they will cache TLS sessions for reuse. - * - * @return the client. - */ -http.createClient = function(options) { - // create CA store to share with all TLS connections - var caStore = null; - if(options.caCerts) { - caStore = forge.pki.createCaStore(options.caCerts); - } - - // get scheme, host, and port from url - options.url = (options.url || - window.location.protocol + '//' + window.location.host); - var url; - try { - url = new URL(options.url); - } catch(e) { - var error = new Error('Invalid url.'); - error.details = {url: options.url}; - throw error; - } - - // default to 1 connection - options.connections = options.connections || 1; - - // create client - var sp = options.socketPool; - var client = { - // url - url: url, - // socket pool - socketPool: sp, - // the policy port to use - policyPort: options.policyPort, - // policy url to use - policyUrl: options.policyUrl, - // queue of requests to service - requests: [], - // all sockets - sockets: [], - // idle sockets - idle: [], - // whether or not the connections are secure - secure: (url.protocol === 'https:'), - // cookie jar (key'd off of name and then path, there is only 1 domain - // and one setting for secure per client so name+path is unique) - cookies: {}, - // default to flash storage of cookies - persistCookies: (typeof(options.persistCookies) === 'undefined') ? - true : options.persistCookies - }; - - // load cookies from disk - _loadCookies(client); - - /** - * A default certificate verify function that checks a certificate common - * name against the client's URL host. - * - * @param c the TLS connection. - * @param verified true if cert is verified, otherwise alert number. - * @param depth the chain depth. - * @param certs the cert chain. - * - * @return true if verified and the common name matches the host, error - * otherwise. - */ - var _defaultCertificateVerify = function(c, verified, depth, certs) { - if(depth === 0 && verified === true) { - // compare common name to url host - var cn = certs[depth].subject.getField('CN'); - if(cn === null || client.url.hostname !== cn.value) { - verified = { - message: 'Certificate common name does not match url host.' - }; - } - } - return verified; - }; - - // determine if TLS is used - var tlsOptions = null; - if(client.secure) { - tlsOptions = { - caStore: caStore, - cipherSuites: options.cipherSuites || null, - virtualHost: options.virtualHost || url.hostname, - verify: options.verify || _defaultCertificateVerify, - getCertificate: options.getCertificate || null, - getPrivateKey: options.getPrivateKey || null, - getSignature: options.getSignature || null, - prime: options.primeTlsSockets || false - }; - - // if socket pool uses a flash api, then add deflate support to TLS - if(sp.flashApi !== null) { - tlsOptions.deflate = function(bytes) { - // strip 2 byte zlib header and 4 byte trailer - return forge.util.deflate(sp.flashApi, bytes, true); - }; - tlsOptions.inflate = function(bytes) { - return forge.util.inflate(sp.flashApi, bytes, true); - }; - } - } - - // create and initialize sockets - for(var i = 0; i < options.connections; ++i) { - _initSocket(client, sp.createSocket(), tlsOptions); - } - - /** - * Sends a request. A method 'abort' will be set on the request that - * can be called to attempt to abort the request. - * - * @param options: - * request: the request to send. - * connected: a callback for when the connection is open. - * closed: a callback for when the connection is closed. - * headerReady: a callback for when the response header arrives. - * bodyReady: a callback for when the response body arrives. - * error: a callback for if an error occurs. - */ - client.send = function(options) { - // add host header if not set - if(options.request.getField('Host') === null) { - options.request.setField('Host', client.url.origin); - } - - // set default dummy handlers - var opts = {}; - opts.request = options.request; - opts.connected = options.connected || function() {}; - opts.closed = options.close || function() {}; - opts.headerReady = function(e) { - // read cookies - _readCookies(client, e.response); - if(options.headerReady) { - options.headerReady(e); - } - }; - opts.bodyReady = options.bodyReady || function() {}; - opts.error = options.error || function() {}; - - // create response - opts.response = http.createResponse(); - opts.response.time = 0; - opts.response.flashApi = client.socketPool.flashApi; - opts.request.flashApi = client.socketPool.flashApi; - - // create abort function - opts.request.abort = function() { - // set aborted, clear handlers - opts.request.aborted = true; - opts.connected = function() {}; - opts.closed = function() {}; - opts.headerReady = function() {}; - opts.bodyReady = function() {}; - opts.error = function() {}; - }; - - // add cookies to request - _writeCookies(client, opts.request); - - // queue request options if there are no idle sockets - if(client.idle.length === 0) { - client.requests.push(opts); - } else { - // use an idle socket, prefer an idle *connected* socket first - var socket = null; - var len = client.idle.length; - for(var i = 0; socket === null && i < len; ++i) { - socket = client.idle[i]; - if(socket.isConnected()) { - client.idle.splice(i, 1); - } else { - socket = null; - } - } - // no connected socket available, get unconnected socket - if(socket === null) { - socket = client.idle.pop(); - } - socket.options = opts; - _doRequest(client, socket); - } - }; - - /** - * Destroys this client. - */ - client.destroy = function() { - // clear pending requests, close and destroy sockets - client.requests = []; - for(var i = 0; i < client.sockets.length; ++i) { - client.sockets[i].close(); - client.sockets[i].destroy(); - } - client.socketPool = null; - client.sockets = []; - client.idle = []; - }; - - /** - * Sets a cookie for use with all connections made by this client. Any - * cookie with the same name will be replaced. If the cookie's value - * is undefined, null, or the blank string, the cookie will be removed. - * - * If the cookie's domain doesn't match this client's url host or the - * cookie's secure flag doesn't match this client's url scheme, then - * setting the cookie will fail with an exception. - * - * @param cookie the cookie with parameters: - * name: the name of the cookie. - * value: the value of the cookie. - * comment: an optional comment string. - * maxAge: the age of the cookie in seconds relative to created time. - * secure: true if the cookie must be sent over a secure protocol. - * httpOnly: true to restrict access to the cookie from javascript - * (inaffective since the cookies are stored in javascript). - * path: the path for the cookie. - * domain: optional domain the cookie belongs to (must start with dot). - * version: optional version of the cookie. - * created: creation time, in UTC seconds, of the cookie. - */ - client.setCookie = function(cookie) { - var rval; - if(typeof(cookie.name) !== 'undefined') { - if(cookie.value === null || typeof(cookie.value) === 'undefined' || - cookie.value === '') { - // remove cookie - rval = client.removeCookie(cookie.name, cookie.path); - } else { - // set cookie defaults - cookie.comment = cookie.comment || ''; - cookie.maxAge = cookie.maxAge || 0; - cookie.secure = (typeof(cookie.secure) === 'undefined') ? - true : cookie.secure; - cookie.httpOnly = cookie.httpOnly || true; - cookie.path = cookie.path || '/'; - cookie.domain = cookie.domain || null; - cookie.version = cookie.version || null; - cookie.created = _getUtcTime(new Date()); - - // do secure check - if(cookie.secure !== client.secure) { - var error = new Error('Http client url scheme is incompatible ' + - 'with cookie secure flag.'); - error.url = client.url; - error.cookie = cookie; - throw error; - } - // make sure url host is within cookie.domain - if(!http.withinCookieDomain(client.url, cookie)) { - var error = new Error('Http client url scheme is incompatible ' + - 'with cookie secure flag.'); - error.url = client.url; - error.cookie = cookie; - throw error; - } - - // add new cookie - if(!(cookie.name in client.cookies)) { - client.cookies[cookie.name] = {}; - } - client.cookies[cookie.name][cookie.path] = cookie; - rval = true; - - // save cookies - _saveCookies(client); - } - } - - return rval; - }; - - /** - * Gets a cookie by its name. - * - * @param name the name of the cookie to retrieve. - * @param path an optional path for the cookie (if there are multiple - * cookies with the same name but different paths). - * - * @return the cookie or null if not found. - */ - client.getCookie = function(name, path) { - var rval = null; - if(name in client.cookies) { - var paths = client.cookies[name]; - - // get path-specific cookie - if(path) { - if(path in paths) { - rval = paths[path]; - } - } else { - // get first cookie - for(var p in paths) { - rval = paths[p]; - break; - } - } - } - return rval; - }; - - /** - * Removes a cookie. - * - * @param name the name of the cookie to remove. - * @param path an optional path for the cookie (if there are multiple - * cookies with the same name but different paths). - * - * @return true if a cookie was removed, false if not. - */ - client.removeCookie = function(name, path) { - var rval = false; - if(name in client.cookies) { - // delete the specific path - if(path) { - var paths = client.cookies[name]; - if(path in paths) { - rval = true; - delete client.cookies[name][path]; - // clean up entry if empty - var empty = true; - for(var i in client.cookies[name]) { - empty = false; - break; - } - if(empty) { - delete client.cookies[name]; - } - } - } else { - // delete all cookies with the given name - rval = true; - delete client.cookies[name]; - } - } - if(rval) { - // save cookies - _saveCookies(client); - } - return rval; - }; - - /** - * Clears all cookies stored in this client. - */ - client.clearCookies = function() { - client.cookies = {}; - _clearCookies(client); - }; - - if(forge.log) { - forge.log.debug('forge.http', 'created client', options); - } - - return client; -}; - -/** - * Trims the whitespace off of the beginning and end of a string. - * - * @param str the string to trim. - * - * @return the trimmed string. - */ -var _trimString = function(str) { - return str.replace(/^\s*/, '').replace(/\s*$/, ''); -}; - -/** - * Creates an http header object. - * - * @return the http header object. - */ -var _createHeader = function() { - var header = { - fields: {}, - setField: function(name, value) { - // normalize field name, trim value - header.fields[_normalize(name)] = [_trimString('' + value)]; - }, - appendField: function(name, value) { - name = _normalize(name); - if(!(name in header.fields)) { - header.fields[name] = []; - } - header.fields[name].push(_trimString('' + value)); - }, - getField: function(name, index) { - var rval = null; - name = _normalize(name); - if(name in header.fields) { - index = index || 0; - rval = header.fields[name][index]; - } - return rval; - } - }; - return header; -}; - -/** - * Gets the time in utc seconds given a date. - * - * @param d the date to use. - * - * @return the time in utc seconds. - */ -var _getUtcTime = function(d) { - var utc = +d + d.getTimezoneOffset() * 60000; - return Math.floor(+new Date() / 1000); -}; - -/** - * Creates an http request. - * - * @param options: - * version: the version. - * method: the method. - * path: the path. - * body: the body. - * headers: custom header fields to add, - * eg: [{'Content-Length': 0}]. - * - * @return the http request. - */ -http.createRequest = function(options) { - options = options || {}; - var request = _createHeader(); - request.version = options.version || 'HTTP/1.1'; - request.method = options.method || null; - request.path = options.path || null; - request.body = options.body || null; - request.bodyDeflated = false; - request.flashApi = null; - - // add custom headers - var headers = options.headers || []; - if(!forge.util.isArray(headers)) { - headers = [headers]; - } - for(var i = 0; i < headers.length; ++i) { - for(var name in headers[i]) { - request.appendField(name, headers[i][name]); - } - } - - /** - * Adds a cookie to the request 'Cookie' header. - * - * @param cookie a cookie to add. - */ - request.addCookie = function(cookie) { - var value = ''; - var field = request.getField('Cookie'); - if(field !== null) { - // separate cookies by semi-colons - value = field + '; '; - } - - // get current time in utc seconds - var now = _getUtcTime(new Date()); - - // output cookie name and value - value += cookie.name + '=' + cookie.value; - request.setField('Cookie', value); - }; - - /** - * Converts an http request into a string that can be sent as an - * HTTP request. Does not include any data. - * - * @return the string representation of the request. - */ - request.toString = function() { - /* Sample request header: - GET /some/path/?query HTTP/1.1 - Host: www.someurl.com - Connection: close - Accept-Encoding: deflate - Accept: image/gif, text/html - User-Agent: Mozilla 4.0 - */ - - // set default headers - if(request.getField('User-Agent') === null) { - request.setField('User-Agent', 'forge.http 1.0'); - } - if(request.getField('Accept') === null) { - request.setField('Accept', '*/*'); - } - if(request.getField('Connection') === null) { - request.setField('Connection', 'keep-alive'); - request.setField('Keep-Alive', '115'); - } - - // add Accept-Encoding if not specified - if(request.flashApi !== null && - request.getField('Accept-Encoding') === null) { - request.setField('Accept-Encoding', 'deflate'); - } - - // if the body isn't null, deflate it if its larger than 100 bytes - if(request.flashApi !== null && request.body !== null && - request.getField('Content-Encoding') === null && - !request.bodyDeflated && request.body.length > 100) { - // use flash to compress data - request.body = forge.util.deflate(request.flashApi, request.body); - request.bodyDeflated = true; - request.setField('Content-Encoding', 'deflate'); - request.setField('Content-Length', request.body.length); - } else if(request.body !== null) { - // set content length for body - request.setField('Content-Length', request.body.length); - } - - // build start line - var rval = - request.method.toUpperCase() + ' ' + request.path + ' ' + - request.version + '\r\n'; - - // add each header - for(var name in request.fields) { - var fields = request.fields[name]; - for(var i = 0; i < fields.length; ++i) { - rval += name + ': ' + fields[i] + '\r\n'; - } - } - // final terminating CRLF - rval += '\r\n'; - - return rval; - }; - - return request; -}; - -/** - * Creates an empty http response header. - * - * @return the empty http response header. - */ -http.createResponse = function() { - // private vars - var _first = true; - var _chunkSize = 0; - var _chunksFinished = false; - - // create response - var response = _createHeader(); - response.version = null; - response.code = 0; - response.message = null; - response.body = null; - response.headerReceived = false; - response.bodyReceived = false; - response.flashApi = null; - - /** - * Reads a line that ends in CRLF from a byte buffer. - * - * @param b the byte buffer. - * - * @return the line or null if none was found. - */ - var _readCrlf = function(b) { - var line = null; - var i = b.data.indexOf('\r\n', b.read); - if(i != -1) { - // read line, skip CRLF - line = b.getBytes(i - b.read); - b.getBytes(2); - } - return line; - }; - - /** - * Parses a header field and appends it to the response. - * - * @param line the header field line. - */ - var _parseHeader = function(line) { - var tmp = line.indexOf(':'); - var name = line.substring(0, tmp++); - response.appendField( - name, (tmp < line.length) ? line.substring(tmp) : ''); - }; - - /** - * Reads an http response header from a buffer of bytes. - * - * @param b the byte buffer to parse the header from. - * - * @return true if the whole header was read, false if not. - */ - response.readHeader = function(b) { - // read header lines (each ends in CRLF) - var line = ''; - while(!response.headerReceived && line !== null) { - line = _readCrlf(b); - if(line !== null) { - // parse first line - if(_first) { - _first = false; - var tmp = line.split(' '); - if(tmp.length >= 3) { - response.version = tmp[0]; - response.code = parseInt(tmp[1], 10); - response.message = tmp.slice(2).join(' '); - } else { - // invalid header - var error = new Error('Invalid http response header.'); - error.details = {'line': line}; - throw error; - } - } else if(line.length === 0) { - // handle final line, end of header - response.headerReceived = true; - } else { - _parseHeader(line); - } - } - } - - return response.headerReceived; - }; - - /** - * Reads some chunked http response entity-body from the given buffer of - * bytes. - * - * @param b the byte buffer to read from. - * - * @return true if the whole body was read, false if not. - */ - var _readChunkedBody = function(b) { - /* Chunked transfer-encoding sends data in a series of chunks, - followed by a set of 0-N http trailers. - The format is as follows: - - chunk-size (in hex) CRLF - chunk data (with "chunk-size" many bytes) CRLF - ... (N many chunks) - chunk-size (of 0 indicating the last chunk) CRLF - N many http trailers followed by CRLF - blank line + CRLF (terminates the trailers) - - If there are no http trailers, then after the chunk-size of 0, - there is still a single CRLF (indicating the blank line + CRLF - that terminates the trailers). In other words, you always terminate - the trailers with blank line + CRLF, regardless of 0-N trailers. */ - - /* From RFC-2616, section 3.6.1, here is the pseudo-code for - implementing chunked transfer-encoding: - - length := 0 - read chunk-size, chunk-extension (if any) and CRLF - while (chunk-size > 0) { - read chunk-data and CRLF - append chunk-data to entity-body - length := length + chunk-size - read chunk-size and CRLF - } - read entity-header - while (entity-header not empty) { - append entity-header to existing header fields - read entity-header - } - Content-Length := length - Remove "chunked" from Transfer-Encoding - */ - - var line = ''; - while(line !== null && b.length() > 0) { - // if in the process of reading a chunk - if(_chunkSize > 0) { - // if there are not enough bytes to read chunk and its - // trailing CRLF, we must wait for more data to be received - if(_chunkSize + 2 > b.length()) { - break; - } - - // read chunk data, skip CRLF - response.body += b.getBytes(_chunkSize); - b.getBytes(2); - _chunkSize = 0; - } else if(!_chunksFinished) { - // more chunks, read next chunk-size line - line = _readCrlf(b); - if(line !== null) { - // parse chunk-size (ignore any chunk extension) - _chunkSize = parseInt(line.split(';', 1)[0], 16); - _chunksFinished = (_chunkSize === 0); - } - } else { - // chunks finished, read next trailer - line = _readCrlf(b); - while(line !== null) { - if(line.length > 0) { - // parse trailer - _parseHeader(line); - // read next trailer - line = _readCrlf(b); - } else { - // body received - response.bodyReceived = true; - line = null; - } - } - } - } - - return response.bodyReceived; - }; - - /** - * Reads an http response body from a buffer of bytes. - * - * @param b the byte buffer to read from. - * - * @return true if the whole body was read, false if not. - */ - response.readBody = function(b) { - var contentLength = response.getField('Content-Length'); - var transferEncoding = response.getField('Transfer-Encoding'); - if(contentLength !== null) { - contentLength = parseInt(contentLength); - } - - // read specified length - if(contentLength !== null && contentLength >= 0) { - response.body = response.body || ''; - response.body += b.getBytes(contentLength); - response.bodyReceived = (response.body.length === contentLength); - } else if(transferEncoding !== null) { - // read chunked encoding - if(transferEncoding.indexOf('chunked') != -1) { - response.body = response.body || ''; - _readChunkedBody(b); - } else { - var error = new Error('Unknown Transfer-Encoding.'); - error.details = {'transferEncoding': transferEncoding}; - throw error; - } - } else if((contentLength !== null && contentLength < 0) || - (contentLength === null && - response.getField('Content-Type') !== null)) { - // read all data in the buffer - response.body = response.body || ''; - response.body += b.getBytes(); - response.readBodyUntilClose = true; - } else { - // no body - response.body = null; - response.bodyReceived = true; - } - - if(response.bodyReceived) { - response.time = +new Date() - response.time; - } - - if(response.flashApi !== null && - response.bodyReceived && response.body !== null && - response.getField('Content-Encoding') === 'deflate') { - // inflate using flash api - response.body = forge.util.inflate( - response.flashApi, response.body); - } - - return response.bodyReceived; - }; - - /** - * Parses an array of cookies from the 'Set-Cookie' field, if present. - * - * @return the array of cookies. - */ - response.getCookies = function() { - var rval = []; - - // get Set-Cookie field - if('Set-Cookie' in response.fields) { - var field = response.fields['Set-Cookie']; - - // get current local time in seconds - var now = +new Date() / 1000; - - // regex for parsing 'name1=value1; name2=value2; name3' - var regex = /\s*([^=]*)=?([^;]*)(;|$)/g; - - // examples: - // Set-Cookie: cookie1_name=cookie1_value; max-age=0; path=/ - // Set-Cookie: c2=v2; expires=Thu, 21-Aug-2008 23:47:25 GMT; path=/ - for(var i = 0; i < field.length; ++i) { - var fv = field[i]; - var m; - regex.lastIndex = 0; - var first = true; - var cookie = {}; - do { - m = regex.exec(fv); - if(m !== null) { - var name = _trimString(m[1]); - var value = _trimString(m[2]); - - // cookie_name=value - if(first) { - cookie.name = name; - cookie.value = value; - first = false; - } else { - // property_name=value - name = name.toLowerCase(); - switch(name) { - case 'expires': - // replace hyphens w/spaces so date will parse - value = value.replace(/-/g, ' '); - var secs = Date.parse(value) / 1000; - cookie.maxAge = Math.max(0, secs - now); - break; - case 'max-age': - cookie.maxAge = parseInt(value, 10); - break; - case 'secure': - cookie.secure = true; - break; - case 'httponly': - cookie.httpOnly = true; - break; - default: - if(name !== '') { - cookie[name] = value; - } - } - } - } - } while(m !== null && m[0] !== ''); - rval.push(cookie); - } - } - - return rval; - }; - - /** - * Converts an http response into a string that can be sent as an - * HTTP response. Does not include any data. - * - * @return the string representation of the response. - */ - response.toString = function() { - /* Sample response header: - HTTP/1.0 200 OK - Host: www.someurl.com - Connection: close - */ - - // build start line - var rval = - response.version + ' ' + response.code + ' ' + response.message + '\r\n'; - - // add each header - for(var name in response.fields) { - var fields = response.fields[name]; - for(var i = 0; i < fields.length; ++i) { - rval += name + ': ' + fields[i] + '\r\n'; - } - } - // final terminating CRLF - rval += '\r\n'; - - return rval; - }; - - return response; -}; - -/** - * Returns true if the given url is within the given cookie's domain. - * - * @param url the url to check. - * @param cookie the cookie or cookie domain to check. - */ -http.withinCookieDomain = function(url, cookie) { - var rval = false; - - // cookie may be null, a cookie object, or a domain string - var domain = (cookie === null || typeof cookie === 'string') ? - cookie : cookie.domain; - - // any domain will do - if(domain === null) { - rval = true; - } else if(domain.charAt(0) === '.') { - // ensure domain starts with a '.' - // parse URL as necessary - if(typeof url === 'string') { - url = new URL(url); - } - - // add '.' to front of URL hostname to match against domain - var host = '.' + url.hostname; - - // if the host ends with domain then it falls within it - var idx = host.lastIndexOf(domain); - if(idx !== -1 && (idx + domain.length === host.length)) { - rval = true; - } - } - - return rval; -}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/index.all.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/index.all.js deleted file mode 100644 index 22ba72b6..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/index.all.js +++ /dev/null @@ -1,16 +0,0 @@ -/** - * Node.js module for Forge with extra utils and networking. - * - * @author Dave Longley - * - * Copyright 2011-2016 Digital Bazaar, Inc. - */ -module.exports = require('./forge'); -// require core forge -require('./index'); -// additional utils and networking support -require('./form'); -require('./socket'); -require('./tlssocket'); -require('./http'); -require('./xhr'); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/index.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/index.js deleted file mode 100644 index 6cdd5a9c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/index.js +++ /dev/null @@ -1,33 +0,0 @@ -/** - * Node.js module for Forge. - * - * @author Dave Longley - * - * Copyright 2011-2016 Digital Bazaar, Inc. - */ -module.exports = require('./forge'); -require('./aes'); -require('./aesCipherSuites'); -require('./asn1'); -require('./cipher'); -require('./des'); -require('./ed25519'); -require('./hmac'); -require('./kem'); -require('./log'); -require('./md.all'); -require('./mgf1'); -require('./pbkdf2'); -require('./pem'); -require('./pkcs1'); -require('./pkcs12'); -require('./pkcs7'); -require('./pki'); -require('./prime'); -require('./prng'); -require('./pss'); -require('./random'); -require('./rc2'); -require('./ssh'); -require('./tls'); -require('./util'); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/jsbn.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/jsbn.js deleted file mode 100644 index 11f965c5..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/jsbn.js +++ /dev/null @@ -1,1264 +0,0 @@ -// Copyright (c) 2005 Tom Wu -// All Rights Reserved. -// See "LICENSE" for details. - -// Basic JavaScript BN library - subset useful for RSA encryption. - -/* -Licensing (LICENSE) -------------------- - -This software is covered under the following copyright: -*/ -/* - * Copyright (c) 2003-2005 Tom Wu - * All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * - * IN NO EVENT SHALL TOM WU BE LIABLE FOR ANY SPECIAL, INCIDENTAL, - * INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES WHATSOEVER - * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER OR NOT ADVISED OF - * THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF LIABILITY, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * - * In addition, the following condition applies: - * - * All redistributions must retain an intact copy of this copyright notice - * and disclaimer. - */ -/* -Address all questions regarding this license to: - - Tom Wu - tjw@cs.Stanford.EDU -*/ -var forge = require('./forge'); - -module.exports = forge.jsbn = forge.jsbn || {}; - -// Bits per digit -var dbits; - -// JavaScript engine analysis -var canary = 0xdeadbeefcafe; -var j_lm = ((canary&0xffffff)==0xefcafe); - -// (public) Constructor -function BigInteger(a,b,c) { - this.data = []; - if(a != null) - if("number" == typeof a) this.fromNumber(a,b,c); - else if(b == null && "string" != typeof a) this.fromString(a,256); - else this.fromString(a,b); -} -forge.jsbn.BigInteger = BigInteger; - -// return new, unset BigInteger -function nbi() { return new BigInteger(null); } - -// am: Compute w_j += (x*this_i), propagate carries, -// c is initial carry, returns final carry. -// c < 3*dvalue, x < 2*dvalue, this_i < dvalue -// We need to select the fastest one that works in this environment. - -// am1: use a single mult and divide to get the high bits, -// max digit bits should be 26 because -// max internal value = 2*dvalue^2-2*dvalue (< 2^53) -function am1(i,x,w,j,c,n) { - while(--n >= 0) { - var v = x*this.data[i++]+w.data[j]+c; - c = Math.floor(v/0x4000000); - w.data[j++] = v&0x3ffffff; - } - return c; -} -// am2 avoids a big mult-and-extract completely. -// Max digit bits should be <= 30 because we do bitwise ops -// on values up to 2*hdvalue^2-hdvalue-1 (< 2^31) -function am2(i,x,w,j,c,n) { - var xl = x&0x7fff, xh = x>>15; - while(--n >= 0) { - var l = this.data[i]&0x7fff; - var h = this.data[i++]>>15; - var m = xh*l+h*xl; - l = xl*l+((m&0x7fff)<<15)+w.data[j]+(c&0x3fffffff); - c = (l>>>30)+(m>>>15)+xh*h+(c>>>30); - w.data[j++] = l&0x3fffffff; - } - return c; -} -// Alternately, set max digit bits to 28 since some -// browsers slow down when dealing with 32-bit numbers. -function am3(i,x,w,j,c,n) { - var xl = x&0x3fff, xh = x>>14; - while(--n >= 0) { - var l = this.data[i]&0x3fff; - var h = this.data[i++]>>14; - var m = xh*l+h*xl; - l = xl*l+((m&0x3fff)<<14)+w.data[j]+c; - c = (l>>28)+(m>>14)+xh*h; - w.data[j++] = l&0xfffffff; - } - return c; -} - -// node.js (no browser) -if(typeof(navigator) === 'undefined') -{ - BigInteger.prototype.am = am3; - dbits = 28; -} else if(j_lm && (navigator.appName == "Microsoft Internet Explorer")) { - BigInteger.prototype.am = am2; - dbits = 30; -} else if(j_lm && (navigator.appName != "Netscape")) { - BigInteger.prototype.am = am1; - dbits = 26; -} else { // Mozilla/Netscape seems to prefer am3 - BigInteger.prototype.am = am3; - dbits = 28; -} - -BigInteger.prototype.DB = dbits; -BigInteger.prototype.DM = ((1<= 0; --i) r.data[i] = this.data[i]; - r.t = this.t; - r.s = this.s; -} - -// (protected) set from integer value x, -DV <= x < DV -function bnpFromInt(x) { - this.t = 1; - this.s = (x<0)?-1:0; - if(x > 0) this.data[0] = x; - else if(x < -1) this.data[0] = x+this.DV; - else this.t = 0; -} - -// return bigint initialized to value -function nbv(i) { var r = nbi(); r.fromInt(i); return r; } - -// (protected) set from string and radix -function bnpFromString(s,b) { - var k; - if(b == 16) k = 4; - else if(b == 8) k = 3; - else if(b == 256) k = 8; // byte array - else if(b == 2) k = 1; - else if(b == 32) k = 5; - else if(b == 4) k = 2; - else { this.fromRadix(s,b); return; } - this.t = 0; - this.s = 0; - var i = s.length, mi = false, sh = 0; - while(--i >= 0) { - var x = (k==8)?s[i]&0xff:intAt(s,i); - if(x < 0) { - if(s.charAt(i) == "-") mi = true; - continue; - } - mi = false; - if(sh == 0) - this.data[this.t++] = x; - else if(sh+k > this.DB) { - this.data[this.t-1] |= (x&((1<<(this.DB-sh))-1))<>(this.DB-sh)); - } else - this.data[this.t-1] |= x<= this.DB) sh -= this.DB; - } - if(k == 8 && (s[0]&0x80) != 0) { - this.s = -1; - if(sh > 0) this.data[this.t-1] |= ((1<<(this.DB-sh))-1)< 0 && this.data[this.t-1] == c) --this.t; -} - -// (public) return string representation in given radix -function bnToString(b) { - if(this.s < 0) return "-"+this.negate().toString(b); - var k; - if(b == 16) k = 4; - else if(b == 8) k = 3; - else if(b == 2) k = 1; - else if(b == 32) k = 5; - else if(b == 4) k = 2; - else return this.toRadix(b); - var km = (1< 0) { - if(p < this.DB && (d = this.data[i]>>p) > 0) { m = true; r = int2char(d); } - while(i >= 0) { - if(p < k) { - d = (this.data[i]&((1<>(p+=this.DB-k); - } else { - d = (this.data[i]>>(p-=k))&km; - if(p <= 0) { p += this.DB; --i; } - } - if(d > 0) m = true; - if(m) r += int2char(d); - } - } - return m?r:"0"; -} - -// (public) -this -function bnNegate() { var r = nbi(); BigInteger.ZERO.subTo(this,r); return r; } - -// (public) |this| -function bnAbs() { return (this.s<0)?this.negate():this; } - -// (public) return + if this > a, - if this < a, 0 if equal -function bnCompareTo(a) { - var r = this.s-a.s; - if(r != 0) return r; - var i = this.t; - r = i-a.t; - if(r != 0) return (this.s<0)?-r:r; - while(--i >= 0) if((r=this.data[i]-a.data[i]) != 0) return r; - return 0; -} - -// returns bit length of the integer x -function nbits(x) { - var r = 1, t; - if((t=x>>>16) != 0) { x = t; r += 16; } - if((t=x>>8) != 0) { x = t; r += 8; } - if((t=x>>4) != 0) { x = t; r += 4; } - if((t=x>>2) != 0) { x = t; r += 2; } - if((t=x>>1) != 0) { x = t; r += 1; } - return r; -} - -// (public) return the number of bits in "this" -function bnBitLength() { - if(this.t <= 0) return 0; - return this.DB*(this.t-1)+nbits(this.data[this.t-1]^(this.s&this.DM)); -} - -// (protected) r = this << n*DB -function bnpDLShiftTo(n,r) { - var i; - for(i = this.t-1; i >= 0; --i) r.data[i+n] = this.data[i]; - for(i = n-1; i >= 0; --i) r.data[i] = 0; - r.t = this.t+n; - r.s = this.s; -} - -// (protected) r = this >> n*DB -function bnpDRShiftTo(n,r) { - for(var i = n; i < this.t; ++i) r.data[i-n] = this.data[i]; - r.t = Math.max(this.t-n,0); - r.s = this.s; -} - -// (protected) r = this << n -function bnpLShiftTo(n,r) { - var bs = n%this.DB; - var cbs = this.DB-bs; - var bm = (1<= 0; --i) { - r.data[i+ds+1] = (this.data[i]>>cbs)|c; - c = (this.data[i]&bm)<= 0; --i) r.data[i] = 0; - r.data[ds] = c; - r.t = this.t+ds+1; - r.s = this.s; - r.clamp(); -} - -// (protected) r = this >> n -function bnpRShiftTo(n,r) { - r.s = this.s; - var ds = Math.floor(n/this.DB); - if(ds >= this.t) { r.t = 0; return; } - var bs = n%this.DB; - var cbs = this.DB-bs; - var bm = (1<>bs; - for(var i = ds+1; i < this.t; ++i) { - r.data[i-ds-1] |= (this.data[i]&bm)<>bs; - } - if(bs > 0) r.data[this.t-ds-1] |= (this.s&bm)<>= this.DB; - } - if(a.t < this.t) { - c -= a.s; - while(i < this.t) { - c += this.data[i]; - r.data[i++] = c&this.DM; - c >>= this.DB; - } - c += this.s; - } else { - c += this.s; - while(i < a.t) { - c -= a.data[i]; - r.data[i++] = c&this.DM; - c >>= this.DB; - } - c -= a.s; - } - r.s = (c<0)?-1:0; - if(c < -1) r.data[i++] = this.DV+c; - else if(c > 0) r.data[i++] = c; - r.t = i; - r.clamp(); -} - -// (protected) r = this * a, r != this,a (HAC 14.12) -// "this" should be the larger one if appropriate. -function bnpMultiplyTo(a,r) { - var x = this.abs(), y = a.abs(); - var i = x.t; - r.t = i+y.t; - while(--i >= 0) r.data[i] = 0; - for(i = 0; i < y.t; ++i) r.data[i+x.t] = x.am(0,y.data[i],r,i,0,x.t); - r.s = 0; - r.clamp(); - if(this.s != a.s) BigInteger.ZERO.subTo(r,r); -} - -// (protected) r = this^2, r != this (HAC 14.16) -function bnpSquareTo(r) { - var x = this.abs(); - var i = r.t = 2*x.t; - while(--i >= 0) r.data[i] = 0; - for(i = 0; i < x.t-1; ++i) { - var c = x.am(i,x.data[i],r,2*i,0,1); - if((r.data[i+x.t]+=x.am(i+1,2*x.data[i],r,2*i+1,c,x.t-i-1)) >= x.DV) { - r.data[i+x.t] -= x.DV; - r.data[i+x.t+1] = 1; - } - } - if(r.t > 0) r.data[r.t-1] += x.am(i,x.data[i],r,2*i,0,1); - r.s = 0; - r.clamp(); -} - -// (protected) divide this by m, quotient and remainder to q, r (HAC 14.20) -// r != q, this != m. q or r may be null. -function bnpDivRemTo(m,q,r) { - var pm = m.abs(); - if(pm.t <= 0) return; - var pt = this.abs(); - if(pt.t < pm.t) { - if(q != null) q.fromInt(0); - if(r != null) this.copyTo(r); - return; - } - if(r == null) r = nbi(); - var y = nbi(), ts = this.s, ms = m.s; - var nsh = this.DB-nbits(pm.data[pm.t-1]); // normalize modulus - if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); } else { pm.copyTo(y); pt.copyTo(r); } - var ys = y.t; - var y0 = y.data[ys-1]; - if(y0 == 0) return; - var yt = y0*(1<1)?y.data[ys-2]>>this.F2:0); - var d1 = this.FV/yt, d2 = (1<= 0) { - r.data[r.t++] = 1; - r.subTo(t,r); - } - BigInteger.ONE.dlShiftTo(ys,t); - t.subTo(y,y); // "negative" y so we can replace sub with am later - while(y.t < ys) y.data[y.t++] = 0; - while(--j >= 0) { - // Estimate quotient digit - var qd = (r.data[--i]==y0)?this.DM:Math.floor(r.data[i]*d1+(r.data[i-1]+e)*d2); - if((r.data[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out - y.dlShiftTo(j,t); - r.subTo(t,r); - while(r.data[i] < --qd) r.subTo(t,r); - } - } - if(q != null) { - r.drShiftTo(ys,q); - if(ts != ms) BigInteger.ZERO.subTo(q,q); - } - r.t = ys; - r.clamp(); - if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder - if(ts < 0) BigInteger.ZERO.subTo(r,r); -} - -// (public) this mod a -function bnMod(a) { - var r = nbi(); - this.abs().divRemTo(a,null,r); - if(this.s < 0 && r.compareTo(BigInteger.ZERO) > 0) a.subTo(r,r); - return r; -} - -// Modular reduction using "classic" algorithm -function Classic(m) { this.m = m; } -function cConvert(x) { - if(x.s < 0 || x.compareTo(this.m) >= 0) return x.mod(this.m); - else return x; -} -function cRevert(x) { return x; } -function cReduce(x) { x.divRemTo(this.m,null,x); } -function cMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); } -function cSqrTo(x,r) { x.squareTo(r); this.reduce(r); } - -Classic.prototype.convert = cConvert; -Classic.prototype.revert = cRevert; -Classic.prototype.reduce = cReduce; -Classic.prototype.mulTo = cMulTo; -Classic.prototype.sqrTo = cSqrTo; - -// (protected) return "-1/this % 2^DB"; useful for Mont. reduction -// justification: -// xy == 1 (mod m) -// xy = 1+km -// xy(2-xy) = (1+km)(1-km) -// x[y(2-xy)] = 1-k^2m^2 -// x[y(2-xy)] == 1 (mod m^2) -// if y is 1/x mod m, then y(2-xy) is 1/x mod m^2 -// should reduce x and y(2-xy) by m^2 at each step to keep size bounded. -// JS multiply "overflows" differently from C/C++, so care is needed here. -function bnpInvDigit() { - if(this.t < 1) return 0; - var x = this.data[0]; - if((x&1) == 0) return 0; - var y = x&3; // y == 1/x mod 2^2 - y = (y*(2-(x&0xf)*y))&0xf; // y == 1/x mod 2^4 - y = (y*(2-(x&0xff)*y))&0xff; // y == 1/x mod 2^8 - y = (y*(2-(((x&0xffff)*y)&0xffff)))&0xffff; // y == 1/x mod 2^16 - // last step - calculate inverse mod DV directly; - // assumes 16 < DB <= 32 and assumes ability to handle 48-bit ints - y = (y*(2-x*y%this.DV))%this.DV; // y == 1/x mod 2^dbits - // we really want the negative inverse, and -DV < y < DV - return (y>0)?this.DV-y:-y; -} - -// Montgomery reduction -function Montgomery(m) { - this.m = m; - this.mp = m.invDigit(); - this.mpl = this.mp&0x7fff; - this.mph = this.mp>>15; - this.um = (1<<(m.DB-15))-1; - this.mt2 = 2*m.t; -} - -// xR mod m -function montConvert(x) { - var r = nbi(); - x.abs().dlShiftTo(this.m.t,r); - r.divRemTo(this.m,null,r); - if(x.s < 0 && r.compareTo(BigInteger.ZERO) > 0) this.m.subTo(r,r); - return r; -} - -// x/R mod m -function montRevert(x) { - var r = nbi(); - x.copyTo(r); - this.reduce(r); - return r; -} - -// x = x/R mod m (HAC 14.32) -function montReduce(x) { - while(x.t <= this.mt2) // pad x so am has enough room later - x.data[x.t++] = 0; - for(var i = 0; i < this.m.t; ++i) { - // faster way of calculating u0 = x.data[i]*mp mod DV - var j = x.data[i]&0x7fff; - var u0 = (j*this.mpl+(((j*this.mph+(x.data[i]>>15)*this.mpl)&this.um)<<15))&x.DM; - // use am to combine the multiply-shift-add into one call - j = i+this.m.t; - x.data[j] += this.m.am(0,u0,x,i,0,this.m.t); - // propagate carry - while(x.data[j] >= x.DV) { x.data[j] -= x.DV; x.data[++j]++; } - } - x.clamp(); - x.drShiftTo(this.m.t,x); - if(x.compareTo(this.m) >= 0) x.subTo(this.m,x); -} - -// r = "x^2/R mod m"; x != r -function montSqrTo(x,r) { x.squareTo(r); this.reduce(r); } - -// r = "xy/R mod m"; x,y != r -function montMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); } - -Montgomery.prototype.convert = montConvert; -Montgomery.prototype.revert = montRevert; -Montgomery.prototype.reduce = montReduce; -Montgomery.prototype.mulTo = montMulTo; -Montgomery.prototype.sqrTo = montSqrTo; - -// (protected) true iff this is even -function bnpIsEven() { return ((this.t>0)?(this.data[0]&1):this.s) == 0; } - -// (protected) this^e, e < 2^32, doing sqr and mul with "r" (HAC 14.79) -function bnpExp(e,z) { - if(e > 0xffffffff || e < 1) return BigInteger.ONE; - var r = nbi(), r2 = nbi(), g = z.convert(this), i = nbits(e)-1; - g.copyTo(r); - while(--i >= 0) { - z.sqrTo(r,r2); - if((e&(1< 0) z.mulTo(r2,g,r); - else { var t = r; r = r2; r2 = t; } - } - return z.revert(r); -} - -// (public) this^e % m, 0 <= e < 2^32 -function bnModPowInt(e,m) { - var z; - if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m); - return this.exp(e,z); -} - -// protected -BigInteger.prototype.copyTo = bnpCopyTo; -BigInteger.prototype.fromInt = bnpFromInt; -BigInteger.prototype.fromString = bnpFromString; -BigInteger.prototype.clamp = bnpClamp; -BigInteger.prototype.dlShiftTo = bnpDLShiftTo; -BigInteger.prototype.drShiftTo = bnpDRShiftTo; -BigInteger.prototype.lShiftTo = bnpLShiftTo; -BigInteger.prototype.rShiftTo = bnpRShiftTo; -BigInteger.prototype.subTo = bnpSubTo; -BigInteger.prototype.multiplyTo = bnpMultiplyTo; -BigInteger.prototype.squareTo = bnpSquareTo; -BigInteger.prototype.divRemTo = bnpDivRemTo; -BigInteger.prototype.invDigit = bnpInvDigit; -BigInteger.prototype.isEven = bnpIsEven; -BigInteger.prototype.exp = bnpExp; - -// public -BigInteger.prototype.toString = bnToString; -BigInteger.prototype.negate = bnNegate; -BigInteger.prototype.abs = bnAbs; -BigInteger.prototype.compareTo = bnCompareTo; -BigInteger.prototype.bitLength = bnBitLength; -BigInteger.prototype.mod = bnMod; -BigInteger.prototype.modPowInt = bnModPowInt; - -// "constants" -BigInteger.ZERO = nbv(0); -BigInteger.ONE = nbv(1); - -// jsbn2 lib - -//Copyright (c) 2005-2009 Tom Wu -//All Rights Reserved. -//See "LICENSE" for details (See jsbn.js for LICENSE). - -//Extended JavaScript BN functions, required for RSA private ops. - -//Version 1.1: new BigInteger("0", 10) returns "proper" zero - -//(public) -function bnClone() { var r = nbi(); this.copyTo(r); return r; } - -//(public) return value as integer -function bnIntValue() { -if(this.s < 0) { - if(this.t == 1) return this.data[0]-this.DV; - else if(this.t == 0) return -1; -} else if(this.t == 1) return this.data[0]; -else if(this.t == 0) return 0; -// assumes 16 < DB < 32 -return ((this.data[1]&((1<<(32-this.DB))-1))<>24; } - -//(public) return value as short (assumes DB>=16) -function bnShortValue() { return (this.t==0)?this.s:(this.data[0]<<16)>>16; } - -//(protected) return x s.t. r^x < DV -function bnpChunkSize(r) { return Math.floor(Math.LN2*this.DB/Math.log(r)); } - -//(public) 0 if this == 0, 1 if this > 0 -function bnSigNum() { -if(this.s < 0) return -1; -else if(this.t <= 0 || (this.t == 1 && this.data[0] <= 0)) return 0; -else return 1; -} - -//(protected) convert to radix string -function bnpToRadix(b) { -if(b == null) b = 10; -if(this.signum() == 0 || b < 2 || b > 36) return "0"; -var cs = this.chunkSize(b); -var a = Math.pow(b,cs); -var d = nbv(a), y = nbi(), z = nbi(), r = ""; -this.divRemTo(d,y,z); -while(y.signum() > 0) { - r = (a+z.intValue()).toString(b).substr(1) + r; - y.divRemTo(d,y,z); -} -return z.intValue().toString(b) + r; -} - -//(protected) convert from radix string -function bnpFromRadix(s,b) { -this.fromInt(0); -if(b == null) b = 10; -var cs = this.chunkSize(b); -var d = Math.pow(b,cs), mi = false, j = 0, w = 0; -for(var i = 0; i < s.length; ++i) { - var x = intAt(s,i); - if(x < 0) { - if(s.charAt(i) == "-" && this.signum() == 0) mi = true; - continue; - } - w = b*w+x; - if(++j >= cs) { - this.dMultiply(d); - this.dAddOffset(w,0); - j = 0; - w = 0; - } -} -if(j > 0) { - this.dMultiply(Math.pow(b,j)); - this.dAddOffset(w,0); -} -if(mi) BigInteger.ZERO.subTo(this,this); -} - -//(protected) alternate constructor -function bnpFromNumber(a,b,c) { -if("number" == typeof b) { - // new BigInteger(int,int,RNG) - if(a < 2) this.fromInt(1); - else { - this.fromNumber(a,c); - if(!this.testBit(a-1)) // force MSB set - this.bitwiseTo(BigInteger.ONE.shiftLeft(a-1),op_or,this); - if(this.isEven()) this.dAddOffset(1,0); // force odd - while(!this.isProbablePrime(b)) { - this.dAddOffset(2,0); - if(this.bitLength() > a) this.subTo(BigInteger.ONE.shiftLeft(a-1),this); - } - } -} else { - // new BigInteger(int,RNG) - var x = new Array(), t = a&7; - x.length = (a>>3)+1; - b.nextBytes(x); - if(t > 0) x[0] &= ((1< 0) { - if(p < this.DB && (d = this.data[i]>>p) != (this.s&this.DM)>>p) - r[k++] = d|(this.s<<(this.DB-p)); - while(i >= 0) { - if(p < 8) { - d = (this.data[i]&((1<>(p+=this.DB-8); - } else { - d = (this.data[i]>>(p-=8))&0xff; - if(p <= 0) { p += this.DB; --i; } - } - if((d&0x80) != 0) d |= -256; - if(k == 0 && (this.s&0x80) != (d&0x80)) ++k; - if(k > 0 || d != this.s) r[k++] = d; - } -} -return r; -} - -function bnEquals(a) { return(this.compareTo(a)==0); } -function bnMin(a) { return(this.compareTo(a)<0)?this:a; } -function bnMax(a) { return(this.compareTo(a)>0)?this:a; } - -//(protected) r = this op a (bitwise) -function bnpBitwiseTo(a,op,r) { -var i, f, m = Math.min(a.t,this.t); -for(i = 0; i < m; ++i) r.data[i] = op(this.data[i],a.data[i]); -if(a.t < this.t) { - f = a.s&this.DM; - for(i = m; i < this.t; ++i) r.data[i] = op(this.data[i],f); - r.t = this.t; -} else { - f = this.s&this.DM; - for(i = m; i < a.t; ++i) r.data[i] = op(f,a.data[i]); - r.t = a.t; -} -r.s = op(this.s,a.s); -r.clamp(); -} - -//(public) this & a -function op_and(x,y) { return x&y; } -function bnAnd(a) { var r = nbi(); this.bitwiseTo(a,op_and,r); return r; } - -//(public) this | a -function op_or(x,y) { return x|y; } -function bnOr(a) { var r = nbi(); this.bitwiseTo(a,op_or,r); return r; } - -//(public) this ^ a -function op_xor(x,y) { return x^y; } -function bnXor(a) { var r = nbi(); this.bitwiseTo(a,op_xor,r); return r; } - -//(public) this & ~a -function op_andnot(x,y) { return x&~y; } -function bnAndNot(a) { var r = nbi(); this.bitwiseTo(a,op_andnot,r); return r; } - -//(public) ~this -function bnNot() { -var r = nbi(); -for(var i = 0; i < this.t; ++i) r.data[i] = this.DM&~this.data[i]; -r.t = this.t; -r.s = ~this.s; -return r; -} - -//(public) this << n -function bnShiftLeft(n) { -var r = nbi(); -if(n < 0) this.rShiftTo(-n,r); else this.lShiftTo(n,r); -return r; -} - -//(public) this >> n -function bnShiftRight(n) { -var r = nbi(); -if(n < 0) this.lShiftTo(-n,r); else this.rShiftTo(n,r); -return r; -} - -//return index of lowest 1-bit in x, x < 2^31 -function lbit(x) { -if(x == 0) return -1; -var r = 0; -if((x&0xffff) == 0) { x >>= 16; r += 16; } -if((x&0xff) == 0) { x >>= 8; r += 8; } -if((x&0xf) == 0) { x >>= 4; r += 4; } -if((x&3) == 0) { x >>= 2; r += 2; } -if((x&1) == 0) ++r; -return r; -} - -//(public) returns index of lowest 1-bit (or -1 if none) -function bnGetLowestSetBit() { -for(var i = 0; i < this.t; ++i) - if(this.data[i] != 0) return i*this.DB+lbit(this.data[i]); -if(this.s < 0) return this.t*this.DB; -return -1; -} - -//return number of 1 bits in x -function cbit(x) { -var r = 0; -while(x != 0) { x &= x-1; ++r; } -return r; -} - -//(public) return number of set bits -function bnBitCount() { -var r = 0, x = this.s&this.DM; -for(var i = 0; i < this.t; ++i) r += cbit(this.data[i]^x); -return r; -} - -//(public) true iff nth bit is set -function bnTestBit(n) { -var j = Math.floor(n/this.DB); -if(j >= this.t) return(this.s!=0); -return((this.data[j]&(1<<(n%this.DB)))!=0); -} - -//(protected) this op (1<>= this.DB; -} -if(a.t < this.t) { - c += a.s; - while(i < this.t) { - c += this.data[i]; - r.data[i++] = c&this.DM; - c >>= this.DB; - } - c += this.s; -} else { - c += this.s; - while(i < a.t) { - c += a.data[i]; - r.data[i++] = c&this.DM; - c >>= this.DB; - } - c += a.s; -} -r.s = (c<0)?-1:0; -if(c > 0) r.data[i++] = c; -else if(c < -1) r.data[i++] = this.DV+c; -r.t = i; -r.clamp(); -} - -//(public) this + a -function bnAdd(a) { var r = nbi(); this.addTo(a,r); return r; } - -//(public) this - a -function bnSubtract(a) { var r = nbi(); this.subTo(a,r); return r; } - -//(public) this * a -function bnMultiply(a) { var r = nbi(); this.multiplyTo(a,r); return r; } - -//(public) this / a -function bnDivide(a) { var r = nbi(); this.divRemTo(a,r,null); return r; } - -//(public) this % a -function bnRemainder(a) { var r = nbi(); this.divRemTo(a,null,r); return r; } - -//(public) [this/a,this%a] -function bnDivideAndRemainder(a) { -var q = nbi(), r = nbi(); -this.divRemTo(a,q,r); -return new Array(q,r); -} - -//(protected) this *= n, this >= 0, 1 < n < DV -function bnpDMultiply(n) { -this.data[this.t] = this.am(0,n-1,this,0,0,this.t); -++this.t; -this.clamp(); -} - -//(protected) this += n << w words, this >= 0 -function bnpDAddOffset(n,w) { -if(n == 0) return; -while(this.t <= w) this.data[this.t++] = 0; -this.data[w] += n; -while(this.data[w] >= this.DV) { - this.data[w] -= this.DV; - if(++w >= this.t) this.data[this.t++] = 0; - ++this.data[w]; -} -} - -//A "null" reducer -function NullExp() {} -function nNop(x) { return x; } -function nMulTo(x,y,r) { x.multiplyTo(y,r); } -function nSqrTo(x,r) { x.squareTo(r); } - -NullExp.prototype.convert = nNop; -NullExp.prototype.revert = nNop; -NullExp.prototype.mulTo = nMulTo; -NullExp.prototype.sqrTo = nSqrTo; - -//(public) this^e -function bnPow(e) { return this.exp(e,new NullExp()); } - -//(protected) r = lower n words of "this * a", a.t <= n -//"this" should be the larger one if appropriate. -function bnpMultiplyLowerTo(a,n,r) { -var i = Math.min(this.t+a.t,n); -r.s = 0; // assumes a,this >= 0 -r.t = i; -while(i > 0) r.data[--i] = 0; -var j; -for(j = r.t-this.t; i < j; ++i) r.data[i+this.t] = this.am(0,a.data[i],r,i,0,this.t); -for(j = Math.min(a.t,n); i < j; ++i) this.am(0,a.data[i],r,i,0,n-i); -r.clamp(); -} - -//(protected) r = "this * a" without lower n words, n > 0 -//"this" should be the larger one if appropriate. -function bnpMultiplyUpperTo(a,n,r) { ---n; -var i = r.t = this.t+a.t-n; -r.s = 0; // assumes a,this >= 0 -while(--i >= 0) r.data[i] = 0; -for(i = Math.max(n-this.t,0); i < a.t; ++i) - r.data[this.t+i-n] = this.am(n-i,a.data[i],r,0,0,this.t+i-n); -r.clamp(); -r.drShiftTo(1,r); -} - -//Barrett modular reduction -function Barrett(m) { -// setup Barrett -this.r2 = nbi(); -this.q3 = nbi(); -BigInteger.ONE.dlShiftTo(2*m.t,this.r2); -this.mu = this.r2.divide(m); -this.m = m; -} - -function barrettConvert(x) { -if(x.s < 0 || x.t > 2*this.m.t) return x.mod(this.m); -else if(x.compareTo(this.m) < 0) return x; -else { var r = nbi(); x.copyTo(r); this.reduce(r); return r; } -} - -function barrettRevert(x) { return x; } - -//x = x mod m (HAC 14.42) -function barrettReduce(x) { -x.drShiftTo(this.m.t-1,this.r2); -if(x.t > this.m.t+1) { x.t = this.m.t+1; x.clamp(); } -this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3); -this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2); -while(x.compareTo(this.r2) < 0) x.dAddOffset(1,this.m.t+1); -x.subTo(this.r2,x); -while(x.compareTo(this.m) >= 0) x.subTo(this.m,x); -} - -//r = x^2 mod m; x != r -function barrettSqrTo(x,r) { x.squareTo(r); this.reduce(r); } - -//r = x*y mod m; x,y != r -function barrettMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); } - -Barrett.prototype.convert = barrettConvert; -Barrett.prototype.revert = barrettRevert; -Barrett.prototype.reduce = barrettReduce; -Barrett.prototype.mulTo = barrettMulTo; -Barrett.prototype.sqrTo = barrettSqrTo; - -//(public) this^e % m (HAC 14.85) -function bnModPow(e,m) { -var i = e.bitLength(), k, r = nbv(1), z; -if(i <= 0) return r; -else if(i < 18) k = 1; -else if(i < 48) k = 3; -else if(i < 144) k = 4; -else if(i < 768) k = 5; -else k = 6; -if(i < 8) - z = new Classic(m); -else if(m.isEven()) - z = new Barrett(m); -else - z = new Montgomery(m); - -// precomputation -var g = new Array(), n = 3, k1 = k-1, km = (1< 1) { - var g2 = nbi(); - z.sqrTo(g[1],g2); - while(n <= km) { - g[n] = nbi(); - z.mulTo(g2,g[n-2],g[n]); - n += 2; - } -} - -var j = e.t-1, w, is1 = true, r2 = nbi(), t; -i = nbits(e.data[j])-1; -while(j >= 0) { - if(i >= k1) w = (e.data[j]>>(i-k1))&km; - else { - w = (e.data[j]&((1<<(i+1))-1))<<(k1-i); - if(j > 0) w |= e.data[j-1]>>(this.DB+i-k1); - } - - n = k; - while((w&1) == 0) { w >>= 1; --n; } - if((i -= n) < 0) { i += this.DB; --j; } - if(is1) { // ret == 1, don't bother squaring or multiplying it - g[w].copyTo(r); - is1 = false; - } else { - while(n > 1) { z.sqrTo(r,r2); z.sqrTo(r2,r); n -= 2; } - if(n > 0) z.sqrTo(r,r2); else { t = r; r = r2; r2 = t; } - z.mulTo(r2,g[w],r); - } - - while(j >= 0 && (e.data[j]&(1< 0) { - x.rShiftTo(g,x); - y.rShiftTo(g,y); -} -while(x.signum() > 0) { - if((i = x.getLowestSetBit()) > 0) x.rShiftTo(i,x); - if((i = y.getLowestSetBit()) > 0) y.rShiftTo(i,y); - if(x.compareTo(y) >= 0) { - x.subTo(y,x); - x.rShiftTo(1,x); - } else { - y.subTo(x,y); - y.rShiftTo(1,y); - } -} -if(g > 0) y.lShiftTo(g,y); -return y; -} - -//(protected) this % n, n < 2^26 -function bnpModInt(n) { -if(n <= 0) return 0; -var d = this.DV%n, r = (this.s<0)?n-1:0; -if(this.t > 0) - if(d == 0) r = this.data[0]%n; - else for(var i = this.t-1; i >= 0; --i) r = (d*r+this.data[i])%n; -return r; -} - -//(public) 1/this % m (HAC 14.61) -function bnModInverse(m) { -var ac = m.isEven(); -if((this.isEven() && ac) || m.signum() == 0) return BigInteger.ZERO; -var u = m.clone(), v = this.clone(); -var a = nbv(1), b = nbv(0), c = nbv(0), d = nbv(1); -while(u.signum() != 0) { - while(u.isEven()) { - u.rShiftTo(1,u); - if(ac) { - if(!a.isEven() || !b.isEven()) { a.addTo(this,a); b.subTo(m,b); } - a.rShiftTo(1,a); - } else if(!b.isEven()) b.subTo(m,b); - b.rShiftTo(1,b); - } - while(v.isEven()) { - v.rShiftTo(1,v); - if(ac) { - if(!c.isEven() || !d.isEven()) { c.addTo(this,c); d.subTo(m,d); } - c.rShiftTo(1,c); - } else if(!d.isEven()) d.subTo(m,d); - d.rShiftTo(1,d); - } - if(u.compareTo(v) >= 0) { - u.subTo(v,u); - if(ac) a.subTo(c,a); - b.subTo(d,b); - } else { - v.subTo(u,v); - if(ac) c.subTo(a,c); - d.subTo(b,d); - } -} -if(v.compareTo(BigInteger.ONE) != 0) return BigInteger.ZERO; -if(d.compareTo(m) >= 0) return d.subtract(m); -if(d.signum() < 0) d.addTo(m,d); else return d; -if(d.signum() < 0) return d.add(m); else return d; -} - -var lowprimes = [2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509]; -var lplim = (1<<26)/lowprimes[lowprimes.length-1]; - -//(public) test primality with certainty >= 1-.5^t -function bnIsProbablePrime(t) { -var i, x = this.abs(); -if(x.t == 1 && x.data[0] <= lowprimes[lowprimes.length-1]) { - for(i = 0; i < lowprimes.length; ++i) - if(x.data[0] == lowprimes[i]) return true; - return false; -} -if(x.isEven()) return false; -i = 1; -while(i < lowprimes.length) { - var m = lowprimes[i], j = i+1; - while(j < lowprimes.length && m < lplim) m *= lowprimes[j++]; - m = x.modInt(m); - while(i < j) if(m%lowprimes[i++] == 0) return false; -} -return x.millerRabin(t); -} - -//(protected) true if probably prime (HAC 4.24, Miller-Rabin) -function bnpMillerRabin(t) { -var n1 = this.subtract(BigInteger.ONE); -var k = n1.getLowestSetBit(); -if(k <= 0) return false; -var r = n1.shiftRight(k); -var prng = bnGetPrng(); -var a; -for(var i = 0; i < t; ++i) { - // select witness 'a' at random from between 1 and n1 - do { - a = new BigInteger(this.bitLength(), prng); - } - while(a.compareTo(BigInteger.ONE) <= 0 || a.compareTo(n1) >= 0); - var y = a.modPow(r,this); - if(y.compareTo(BigInteger.ONE) != 0 && y.compareTo(n1) != 0) { - var j = 1; - while(j++ < k && y.compareTo(n1) != 0) { - y = y.modPowInt(2,this); - if(y.compareTo(BigInteger.ONE) == 0) return false; - } - if(y.compareTo(n1) != 0) return false; - } -} -return true; -} - -// get pseudo random number generator -function bnGetPrng() { - // create prng with api that matches BigInteger secure random - return { - // x is an array to fill with bytes - nextBytes: function(x) { - for(var i = 0; i < x.length; ++i) { - x[i] = Math.floor(Math.random() * 0x0100); - } - } - }; -} - -//protected -BigInteger.prototype.chunkSize = bnpChunkSize; -BigInteger.prototype.toRadix = bnpToRadix; -BigInteger.prototype.fromRadix = bnpFromRadix; -BigInteger.prototype.fromNumber = bnpFromNumber; -BigInteger.prototype.bitwiseTo = bnpBitwiseTo; -BigInteger.prototype.changeBit = bnpChangeBit; -BigInteger.prototype.addTo = bnpAddTo; -BigInteger.prototype.dMultiply = bnpDMultiply; -BigInteger.prototype.dAddOffset = bnpDAddOffset; -BigInteger.prototype.multiplyLowerTo = bnpMultiplyLowerTo; -BigInteger.prototype.multiplyUpperTo = bnpMultiplyUpperTo; -BigInteger.prototype.modInt = bnpModInt; -BigInteger.prototype.millerRabin = bnpMillerRabin; - -//public -BigInteger.prototype.clone = bnClone; -BigInteger.prototype.intValue = bnIntValue; -BigInteger.prototype.byteValue = bnByteValue; -BigInteger.prototype.shortValue = bnShortValue; -BigInteger.prototype.signum = bnSigNum; -BigInteger.prototype.toByteArray = bnToByteArray; -BigInteger.prototype.equals = bnEquals; -BigInteger.prototype.min = bnMin; -BigInteger.prototype.max = bnMax; -BigInteger.prototype.and = bnAnd; -BigInteger.prototype.or = bnOr; -BigInteger.prototype.xor = bnXor; -BigInteger.prototype.andNot = bnAndNot; -BigInteger.prototype.not = bnNot; -BigInteger.prototype.shiftLeft = bnShiftLeft; -BigInteger.prototype.shiftRight = bnShiftRight; -BigInteger.prototype.getLowestSetBit = bnGetLowestSetBit; -BigInteger.prototype.bitCount = bnBitCount; -BigInteger.prototype.testBit = bnTestBit; -BigInteger.prototype.setBit = bnSetBit; -BigInteger.prototype.clearBit = bnClearBit; -BigInteger.prototype.flipBit = bnFlipBit; -BigInteger.prototype.add = bnAdd; -BigInteger.prototype.subtract = bnSubtract; -BigInteger.prototype.multiply = bnMultiply; -BigInteger.prototype.divide = bnDivide; -BigInteger.prototype.remainder = bnRemainder; -BigInteger.prototype.divideAndRemainder = bnDivideAndRemainder; -BigInteger.prototype.modPow = bnModPow; -BigInteger.prototype.modInverse = bnModInverse; -BigInteger.prototype.pow = bnPow; -BigInteger.prototype.gcd = bnGCD; -BigInteger.prototype.isProbablePrime = bnIsProbablePrime; - -//BigInteger interfaces not implemented in jsbn: - -//BigInteger(int signum, byte[] magnitude) -//double doubleValue() -//float floatValue() -//int hashCode() -//long longValue() -//static BigInteger valueOf(long val) diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/kem.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/kem.js deleted file mode 100644 index 1967016d..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/kem.js +++ /dev/null @@ -1,168 +0,0 @@ -/** - * Javascript implementation of RSA-KEM. - * - * @author Lautaro Cozzani Rodriguez - * @author Dave Longley - * - * Copyright (c) 2014 Lautaro Cozzani - * Copyright (c) 2014 Digital Bazaar, Inc. - */ -var forge = require('./forge'); -require('./util'); -require('./random'); -require('./jsbn'); - -module.exports = forge.kem = forge.kem || {}; - -var BigInteger = forge.jsbn.BigInteger; - -/** - * The API for the RSA Key Encapsulation Mechanism (RSA-KEM) from ISO 18033-2. - */ -forge.kem.rsa = {}; - -/** - * Creates an RSA KEM API object for generating a secret asymmetric key. - * - * The symmetric key may be generated via a call to 'encrypt', which will - * produce a ciphertext to be transmitted to the recipient and a key to be - * kept secret. The ciphertext is a parameter to be passed to 'decrypt' which - * will produce the same secret key for the recipient to use to decrypt a - * message that was encrypted with the secret key. - * - * @param kdf the KDF API to use (eg: new forge.kem.kdf1()). - * @param options the options to use. - * [prng] a custom crypto-secure pseudo-random number generator to use, - * that must define "getBytesSync". - */ -forge.kem.rsa.create = function(kdf, options) { - options = options || {}; - var prng = options.prng || forge.random; - - var kem = {}; - - /** - * Generates a secret key and its encapsulation. - * - * @param publicKey the RSA public key to encrypt with. - * @param keyLength the length, in bytes, of the secret key to generate. - * - * @return an object with: - * encapsulation: the ciphertext for generating the secret key, as a - * binary-encoded string of bytes. - * key: the secret key to use for encrypting a message. - */ - kem.encrypt = function(publicKey, keyLength) { - // generate a random r where 1 < r < n - var byteLength = Math.ceil(publicKey.n.bitLength() / 8); - var r; - do { - r = new BigInteger( - forge.util.bytesToHex(prng.getBytesSync(byteLength)), - 16).mod(publicKey.n); - } while(r.compareTo(BigInteger.ONE) <= 0); - - // prepend r with zeros - r = forge.util.hexToBytes(r.toString(16)); - var zeros = byteLength - r.length; - if(zeros > 0) { - r = forge.util.fillString(String.fromCharCode(0), zeros) + r; - } - - // encrypt the random - var encapsulation = publicKey.encrypt(r, 'NONE'); - - // generate the secret key - var key = kdf.generate(r, keyLength); - - return {encapsulation: encapsulation, key: key}; - }; - - /** - * Decrypts an encapsulated secret key. - * - * @param privateKey the RSA private key to decrypt with. - * @param encapsulation the ciphertext for generating the secret key, as - * a binary-encoded string of bytes. - * @param keyLength the length, in bytes, of the secret key to generate. - * - * @return the secret key as a binary-encoded string of bytes. - */ - kem.decrypt = function(privateKey, encapsulation, keyLength) { - // decrypt the encapsulation and generate the secret key - var r = privateKey.decrypt(encapsulation, 'NONE'); - return kdf.generate(r, keyLength); - }; - - return kem; -}; - -// TODO: add forge.kem.kdf.create('KDF1', {md: ..., ...}) API? - -/** - * Creates a key derivation API object that implements KDF1 per ISO 18033-2. - * - * @param md the hash API to use. - * @param [digestLength] an optional digest length that must be positive and - * less than or equal to md.digestLength. - * - * @return a KDF1 API object. - */ -forge.kem.kdf1 = function(md, digestLength) { - _createKDF(this, md, 0, digestLength || md.digestLength); -}; - -/** - * Creates a key derivation API object that implements KDF2 per ISO 18033-2. - * - * @param md the hash API to use. - * @param [digestLength] an optional digest length that must be positive and - * less than or equal to md.digestLength. - * - * @return a KDF2 API object. - */ -forge.kem.kdf2 = function(md, digestLength) { - _createKDF(this, md, 1, digestLength || md.digestLength); -}; - -/** - * Creates a KDF1 or KDF2 API object. - * - * @param md the hash API to use. - * @param counterStart the starting index for the counter. - * @param digestLength the digest length to use. - * - * @return the KDF API object. - */ -function _createKDF(kdf, md, counterStart, digestLength) { - /** - * Generate a key of the specified length. - * - * @param x the binary-encoded byte string to generate a key from. - * @param length the number of bytes to generate (the size of the key). - * - * @return the key as a binary-encoded string. - */ - kdf.generate = function(x, length) { - var key = new forge.util.ByteBuffer(); - - // run counter from counterStart to ceil(length / Hash.len) - var k = Math.ceil(length / digestLength) + counterStart; - - var c = new forge.util.ByteBuffer(); - for(var i = counterStart; i < k; ++i) { - // I2OSP(i, 4): convert counter to an octet string of 4 octets - c.putInt32(i); - - // digest 'x' and the counter and add the result to the key - md.start(); - md.update(x + c.getBytes()); - var hash = md.digest(); - key.putBytes(hash.getBytes(digestLength)); - } - - // truncate to the correct key length - key.truncate(key.length() - length); - return key.getBytes(); - }; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/log.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/log.js deleted file mode 100644 index 4ef70059..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/log.js +++ /dev/null @@ -1,319 +0,0 @@ -/** - * Cross-browser support for logging in a web application. - * - * @author David I. Lehn - * - * Copyright (c) 2008-2013 Digital Bazaar, Inc. - */ -var forge = require('./forge'); -require('./util'); - -/* LOG API */ -module.exports = forge.log = forge.log || {}; - -/** - * Application logging system. - * - * Each logger level available as it's own function of the form: - * forge.log.level(category, args...) - * The category is an arbitrary string, and the args are the same as - * Firebug's console.log API. By default the call will be output as: - * 'LEVEL [category] , args[1], ...' - * This enables proper % formatting via the first argument. - * Each category is enabled by default but can be enabled or disabled with - * the setCategoryEnabled() function. - */ -// list of known levels -forge.log.levels = [ - 'none', 'error', 'warning', 'info', 'debug', 'verbose', 'max']; -// info on the levels indexed by name: -// index: level index -// name: uppercased display name -var sLevelInfo = {}; -// list of loggers -var sLoggers = []; -/** - * Standard console logger. If no console support is enabled this will - * remain null. Check before using. - */ -var sConsoleLogger = null; - -// logger flags -/** - * Lock the level at the current value. Used in cases where user config may - * set the level such that only critical messages are seen but more verbose - * messages are needed for debugging or other purposes. - */ -forge.log.LEVEL_LOCKED = (1 << 1); -/** - * Always call log function. By default, the logging system will check the - * message level against logger.level before calling the log function. This - * flag allows the function to do its own check. - */ -forge.log.NO_LEVEL_CHECK = (1 << 2); -/** - * Perform message interpolation with the passed arguments. "%" style - * fields in log messages will be replaced by arguments as needed. Some - * loggers, such as Firebug, may do this automatically. The original log - * message will be available as 'message' and the interpolated version will - * be available as 'fullMessage'. - */ -forge.log.INTERPOLATE = (1 << 3); - -// setup each log level -for(var i = 0; i < forge.log.levels.length; ++i) { - var level = forge.log.levels[i]; - sLevelInfo[level] = { - index: i, - name: level.toUpperCase() - }; -} - -/** - * Message logger. Will dispatch a message to registered loggers as needed. - * - * @param message message object - */ -forge.log.logMessage = function(message) { - var messageLevelIndex = sLevelInfo[message.level].index; - for(var i = 0; i < sLoggers.length; ++i) { - var logger = sLoggers[i]; - if(logger.flags & forge.log.NO_LEVEL_CHECK) { - logger.f(message); - } else { - // get logger level - var loggerLevelIndex = sLevelInfo[logger.level].index; - // check level - if(messageLevelIndex <= loggerLevelIndex) { - // message critical enough, call logger - logger.f(logger, message); - } - } - } -}; - -/** - * Sets the 'standard' key on a message object to: - * "LEVEL [category] " + message - * - * @param message a message log object - */ -forge.log.prepareStandard = function(message) { - if(!('standard' in message)) { - message.standard = - sLevelInfo[message.level].name + - //' ' + +message.timestamp + - ' [' + message.category + '] ' + - message.message; - } -}; - -/** - * Sets the 'full' key on a message object to the original message - * interpolated via % formatting with the message arguments. - * - * @param message a message log object. - */ -forge.log.prepareFull = function(message) { - if(!('full' in message)) { - // copy args and insert message at the front - var args = [message.message]; - args = args.concat([] || message['arguments']); - // format the message - message.full = forge.util.format.apply(this, args); - } -}; - -/** - * Applies both preparseStandard() and prepareFull() to a message object and - * store result in 'standardFull'. - * - * @param message a message log object. - */ -forge.log.prepareStandardFull = function(message) { - if(!('standardFull' in message)) { - // FIXME implement 'standardFull' logging - forge.log.prepareStandard(message); - message.standardFull = message.standard; - } -}; - -// create log level functions -if(true) { - // levels for which we want functions - var levels = ['error', 'warning', 'info', 'debug', 'verbose']; - for(var i = 0; i < levels.length; ++i) { - // wrap in a function to ensure proper level var is passed - (function(level) { - // create function for this level - forge.log[level] = function(category, message/*, args...*/) { - // convert arguments to real array, remove category and message - var args = Array.prototype.slice.call(arguments).slice(2); - // create message object - // Note: interpolation and standard formatting is done lazily - var msg = { - timestamp: new Date(), - level: level, - category: category, - message: message, - 'arguments': args - /*standard*/ - /*full*/ - /*fullMessage*/ - }; - // process this message - forge.log.logMessage(msg); - }; - })(levels[i]); - } -} - -/** - * Creates a new logger with specified custom logging function. - * - * The logging function has a signature of: - * function(logger, message) - * logger: current logger - * message: object: - * level: level id - * category: category - * message: string message - * arguments: Array of extra arguments - * fullMessage: interpolated message and arguments if INTERPOLATE flag set - * - * @param logFunction a logging function which takes a log message object - * as a parameter. - * - * @return a logger object. - */ -forge.log.makeLogger = function(logFunction) { - var logger = { - flags: 0, - f: logFunction - }; - forge.log.setLevel(logger, 'none'); - return logger; -}; - -/** - * Sets the current log level on a logger. - * - * @param logger the target logger. - * @param level the new maximum log level as a string. - * - * @return true if set, false if not. - */ -forge.log.setLevel = function(logger, level) { - var rval = false; - if(logger && !(logger.flags & forge.log.LEVEL_LOCKED)) { - for(var i = 0; i < forge.log.levels.length; ++i) { - var aValidLevel = forge.log.levels[i]; - if(level == aValidLevel) { - // set level - logger.level = level; - rval = true; - break; - } - } - } - - return rval; -}; - -/** - * Locks the log level at its current value. - * - * @param logger the target logger. - * @param lock boolean lock value, default to true. - */ -forge.log.lock = function(logger, lock) { - if(typeof lock === 'undefined' || lock) { - logger.flags |= forge.log.LEVEL_LOCKED; - } else { - logger.flags &= ~forge.log.LEVEL_LOCKED; - } -}; - -/** - * Adds a logger. - * - * @param logger the logger object. - */ -forge.log.addLogger = function(logger) { - sLoggers.push(logger); -}; - -// setup the console logger if possible, else create fake console.log -if(typeof(console) !== 'undefined' && 'log' in console) { - var logger; - if(console.error && console.warn && console.info && console.debug) { - // looks like Firebug-style logging is available - // level handlers map - var levelHandlers = { - error: console.error, - warning: console.warn, - info: console.info, - debug: console.debug, - verbose: console.debug - }; - var f = function(logger, message) { - forge.log.prepareStandard(message); - var handler = levelHandlers[message.level]; - // prepend standard message and concat args - var args = [message.standard]; - args = args.concat(message['arguments'].slice()); - // apply to low-level console function - handler.apply(console, args); - }; - logger = forge.log.makeLogger(f); - } else { - // only appear to have basic console.log - var f = function(logger, message) { - forge.log.prepareStandardFull(message); - console.log(message.standardFull); - }; - logger = forge.log.makeLogger(f); - } - forge.log.setLevel(logger, 'debug'); - forge.log.addLogger(logger); - sConsoleLogger = logger; -} else { - // define fake console.log to avoid potential script errors on - // browsers that do not have console logging - console = { - log: function() {} - }; -} - -/* - * Check for logging control query vars in current URL. - * - * console.level= - * Set's the console log level by name. Useful to override defaults and - * allow more verbose logging before a user config is loaded. - * - * console.lock= - * Lock the console log level at whatever level it is set at. This is run - * after console.level is processed. Useful to force a level of verbosity - * that could otherwise be limited by a user config. - */ -if(sConsoleLogger !== null && - typeof window !== 'undefined' && window.location -) { - var query = new URL(window.location.href).searchParams; - if(query.has('console.level')) { - // set with last value - forge.log.setLevel( - sConsoleLogger, query.get('console.level').slice(-1)[0]); - } - if(query.has('console.lock')) { - // set with last value - var lock = query.get('console.lock').slice(-1)[0]; - if(lock == 'true') { - forge.log.lock(sConsoleLogger); - } - } -} - -// provide public access to console logger -forge.log.consoleLogger = sConsoleLogger; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/md.all.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/md.all.js deleted file mode 100644 index 4e0974bd..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/md.all.js +++ /dev/null @@ -1,13 +0,0 @@ -/** - * Node.js module for all known Forge message digests. - * - * @author Dave Longley - * - * Copyright 2011-2017 Digital Bazaar, Inc. - */ -module.exports = require('./md'); - -require('./md5'); -require('./sha1'); -require('./sha256'); -require('./sha512'); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/md.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/md.js deleted file mode 100644 index e4a280c5..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/md.js +++ /dev/null @@ -1,11 +0,0 @@ -/** - * Node.js module for Forge message digests. - * - * @author Dave Longley - * - * Copyright 2011-2017 Digital Bazaar, Inc. - */ -var forge = require('./forge'); - -module.exports = forge.md = forge.md || {}; -forge.md.algorithms = forge.md.algorithms || {}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/md5.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/md5.js deleted file mode 100644 index d0ba8f65..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/md5.js +++ /dev/null @@ -1,289 +0,0 @@ -/** - * Message Digest Algorithm 5 with 128-bit digest (MD5) implementation. - * - * @author Dave Longley - * - * Copyright (c) 2010-2014 Digital Bazaar, Inc. - */ -var forge = require('./forge'); -require('./md'); -require('./util'); - -var md5 = module.exports = forge.md5 = forge.md5 || {}; -forge.md.md5 = forge.md.algorithms.md5 = md5; - -/** - * Creates an MD5 message digest object. - * - * @return a message digest object. - */ -md5.create = function() { - // do initialization as necessary - if(!_initialized) { - _init(); - } - - // MD5 state contains four 32-bit integers - var _state = null; - - // input buffer - var _input = forge.util.createBuffer(); - - // used for word storage - var _w = new Array(16); - - // message digest object - var md = { - algorithm: 'md5', - blockLength: 64, - digestLength: 16, - // 56-bit length of message so far (does not including padding) - messageLength: 0, - // true message length - fullMessageLength: null, - // size of message length in bytes - messageLengthSize: 8 - }; - - /** - * Starts the digest. - * - * @return this digest object. - */ - md.start = function() { - // up to 56-bit message length for convenience - md.messageLength = 0; - - // full message length (set md.messageLength64 for backwards-compatibility) - md.fullMessageLength = md.messageLength64 = []; - var int32s = md.messageLengthSize / 4; - for(var i = 0; i < int32s; ++i) { - md.fullMessageLength.push(0); - } - _input = forge.util.createBuffer(); - _state = { - h0: 0x67452301, - h1: 0xEFCDAB89, - h2: 0x98BADCFE, - h3: 0x10325476 - }; - return md; - }; - // start digest automatically for first time - md.start(); - - /** - * Updates the digest with the given message input. The given input can - * treated as raw input (no encoding will be applied) or an encoding of - * 'utf8' maybe given to encode the input using UTF-8. - * - * @param msg the message input to update with. - * @param encoding the encoding to use (default: 'raw', other: 'utf8'). - * - * @return this digest object. - */ - md.update = function(msg, encoding) { - if(encoding === 'utf8') { - msg = forge.util.encodeUtf8(msg); - } - - // update message length - var len = msg.length; - md.messageLength += len; - len = [(len / 0x100000000) >>> 0, len >>> 0]; - for(var i = md.fullMessageLength.length - 1; i >= 0; --i) { - md.fullMessageLength[i] += len[1]; - len[1] = len[0] + ((md.fullMessageLength[i] / 0x100000000) >>> 0); - md.fullMessageLength[i] = md.fullMessageLength[i] >>> 0; - len[0] = (len[1] / 0x100000000) >>> 0; - } - - // add bytes to input buffer - _input.putBytes(msg); - - // process bytes - _update(_state, _w, _input); - - // compact input buffer every 2K or if empty - if(_input.read > 2048 || _input.length() === 0) { - _input.compact(); - } - - return md; - }; - - /** - * Produces the digest. - * - * @return a byte buffer containing the digest value. - */ - md.digest = function() { - /* Note: Here we copy the remaining bytes in the input buffer and - add the appropriate MD5 padding. Then we do the final update - on a copy of the state so that if the user wants to get - intermediate digests they can do so. */ - - /* Determine the number of bytes that must be added to the message - to ensure its length is congruent to 448 mod 512. In other words, - the data to be digested must be a multiple of 512 bits (or 128 bytes). - This data includes the message, some padding, and the length of the - message. Since the length of the message will be encoded as 8 bytes (64 - bits), that means that the last segment of the data must have 56 bytes - (448 bits) of message and padding. Therefore, the length of the message - plus the padding must be congruent to 448 mod 512 because - 512 - 128 = 448. - - In order to fill up the message length it must be filled with - padding that begins with 1 bit followed by all 0 bits. Padding - must *always* be present, so if the message length is already - congruent to 448 mod 512, then 512 padding bits must be added. */ - - var finalBlock = forge.util.createBuffer(); - finalBlock.putBytes(_input.bytes()); - - // compute remaining size to be digested (include message length size) - var remaining = ( - md.fullMessageLength[md.fullMessageLength.length - 1] + - md.messageLengthSize); - - // add padding for overflow blockSize - overflow - // _padding starts with 1 byte with first bit is set (byte value 128), then - // there may be up to (blockSize - 1) other pad bytes - var overflow = remaining & (md.blockLength - 1); - finalBlock.putBytes(_padding.substr(0, md.blockLength - overflow)); - - // serialize message length in bits in little-endian order; since length - // is stored in bytes we multiply by 8 and add carry - var bits, carry = 0; - for(var i = md.fullMessageLength.length - 1; i >= 0; --i) { - bits = md.fullMessageLength[i] * 8 + carry; - carry = (bits / 0x100000000) >>> 0; - finalBlock.putInt32Le(bits >>> 0); - } - - var s2 = { - h0: _state.h0, - h1: _state.h1, - h2: _state.h2, - h3: _state.h3 - }; - _update(s2, _w, finalBlock); - var rval = forge.util.createBuffer(); - rval.putInt32Le(s2.h0); - rval.putInt32Le(s2.h1); - rval.putInt32Le(s2.h2); - rval.putInt32Le(s2.h3); - return rval; - }; - - return md; -}; - -// padding, constant tables for calculating md5 -var _padding = null; -var _g = null; -var _r = null; -var _k = null; -var _initialized = false; - -/** - * Initializes the constant tables. - */ -function _init() { - // create padding - _padding = String.fromCharCode(128); - _padding += forge.util.fillString(String.fromCharCode(0x00), 64); - - // g values - _g = [ - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 1, 6, 11, 0, 5, 10, 15, 4, 9, 14, 3, 8, 13, 2, 7, 12, - 5, 8, 11, 14, 1, 4, 7, 10, 13, 0, 3, 6, 9, 12, 15, 2, - 0, 7, 14, 5, 12, 3, 10, 1, 8, 15, 6, 13, 4, 11, 2, 9]; - - // rounds table - _r = [ - 7, 12, 17, 22, 7, 12, 17, 22, 7, 12, 17, 22, 7, 12, 17, 22, - 5, 9, 14, 20, 5, 9, 14, 20, 5, 9, 14, 20, 5, 9, 14, 20, - 4, 11, 16, 23, 4, 11, 16, 23, 4, 11, 16, 23, 4, 11, 16, 23, - 6, 10, 15, 21, 6, 10, 15, 21, 6, 10, 15, 21, 6, 10, 15, 21]; - - // get the result of abs(sin(i + 1)) as a 32-bit integer - _k = new Array(64); - for(var i = 0; i < 64; ++i) { - _k[i] = Math.floor(Math.abs(Math.sin(i + 1)) * 0x100000000); - } - - // now initialized - _initialized = true; -} - -/** - * Updates an MD5 state with the given byte buffer. - * - * @param s the MD5 state to update. - * @param w the array to use to store words. - * @param bytes the byte buffer to update with. - */ -function _update(s, w, bytes) { - // consume 512 bit (64 byte) chunks - var t, a, b, c, d, f, r, i; - var len = bytes.length(); - while(len >= 64) { - // initialize hash value for this chunk - a = s.h0; - b = s.h1; - c = s.h2; - d = s.h3; - - // round 1 - for(i = 0; i < 16; ++i) { - w[i] = bytes.getInt32Le(); - f = d ^ (b & (c ^ d)); - t = (a + f + _k[i] + w[i]); - r = _r[i]; - a = d; - d = c; - c = b; - b += (t << r) | (t >>> (32 - r)); - } - // round 2 - for(; i < 32; ++i) { - f = c ^ (d & (b ^ c)); - t = (a + f + _k[i] + w[_g[i]]); - r = _r[i]; - a = d; - d = c; - c = b; - b += (t << r) | (t >>> (32 - r)); - } - // round 3 - for(; i < 48; ++i) { - f = b ^ c ^ d; - t = (a + f + _k[i] + w[_g[i]]); - r = _r[i]; - a = d; - d = c; - c = b; - b += (t << r) | (t >>> (32 - r)); - } - // round 4 - for(; i < 64; ++i) { - f = c ^ (b | ~d); - t = (a + f + _k[i] + w[_g[i]]); - r = _r[i]; - a = d; - d = c; - c = b; - b += (t << r) | (t >>> (32 - r)); - } - - // update hash state - s.h0 = (s.h0 + a) | 0; - s.h1 = (s.h1 + b) | 0; - s.h2 = (s.h2 + c) | 0; - s.h3 = (s.h3 + d) | 0; - - len -= 64; - } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/mgf.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/mgf.js deleted file mode 100644 index 0223bc36..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/mgf.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * Node.js module for Forge mask generation functions. - * - * @author Stefan Siegl - * - * Copyright 2012 Stefan Siegl - */ -var forge = require('./forge'); -require('./mgf1'); - -module.exports = forge.mgf = forge.mgf || {}; -forge.mgf.mgf1 = forge.mgf1; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/mgf1.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/mgf1.js deleted file mode 100644 index 25ed1f7f..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/mgf1.js +++ /dev/null @@ -1,57 +0,0 @@ -/** - * Javascript implementation of mask generation function MGF1. - * - * @author Stefan Siegl - * @author Dave Longley - * - * Copyright (c) 2012 Stefan Siegl - * Copyright (c) 2014 Digital Bazaar, Inc. - */ -var forge = require('./forge'); -require('./util'); - -forge.mgf = forge.mgf || {}; -var mgf1 = module.exports = forge.mgf.mgf1 = forge.mgf1 = forge.mgf1 || {}; - -/** - * Creates a MGF1 mask generation function object. - * - * @param md the message digest API to use (eg: forge.md.sha1.create()). - * - * @return a mask generation function object. - */ -mgf1.create = function(md) { - var mgf = { - /** - * Generate mask of specified length. - * - * @param {String} seed The seed for mask generation. - * @param maskLen Number of bytes to generate. - * @return {String} The generated mask. - */ - generate: function(seed, maskLen) { - /* 2. Let T be the empty octet string. */ - var t = new forge.util.ByteBuffer(); - - /* 3. For counter from 0 to ceil(maskLen / hLen), do the following: */ - var len = Math.ceil(maskLen / md.digestLength); - for(var i = 0; i < len; i++) { - /* a. Convert counter to an octet string C of length 4 octets */ - var c = new forge.util.ByteBuffer(); - c.putInt32(i); - - /* b. Concatenate the hash of the seed mgfSeed and C to the octet - * string T: */ - md.start(); - md.update(seed + c.getBytes()); - t.putBuffer(md.digest()); - } - - /* Output the leading maskLen octets of T as the octet string mask. */ - t.truncate(t.length() - maskLen); - return t.getBytes(); - } - }; - - return mgf; -}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/oids.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/oids.js deleted file mode 100644 index d1504eb1..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/oids.js +++ /dev/null @@ -1,179 +0,0 @@ -/** - * Object IDs for ASN.1. - * - * @author Dave Longley - * - * Copyright (c) 2010-2013 Digital Bazaar, Inc. - */ -var forge = require('./forge'); - -forge.pki = forge.pki || {}; -var oids = module.exports = forge.pki.oids = forge.oids = forge.oids || {}; - -// set id to name mapping and name to id mapping -function _IN(id, name) { - oids[id] = name; - oids[name] = id; -} -// set id to name mapping only -function _I_(id, name) { - oids[id] = name; -} - -// algorithm OIDs -_IN('1.2.840.113549.1.1.1', 'rsaEncryption'); -// Note: md2 & md4 not implemented -//_IN('1.2.840.113549.1.1.2', 'md2WithRSAEncryption'); -//_IN('1.2.840.113549.1.1.3', 'md4WithRSAEncryption'); -_IN('1.2.840.113549.1.1.4', 'md5WithRSAEncryption'); -_IN('1.2.840.113549.1.1.5', 'sha1WithRSAEncryption'); -_IN('1.2.840.113549.1.1.7', 'RSAES-OAEP'); -_IN('1.2.840.113549.1.1.8', 'mgf1'); -_IN('1.2.840.113549.1.1.9', 'pSpecified'); -_IN('1.2.840.113549.1.1.10', 'RSASSA-PSS'); -_IN('1.2.840.113549.1.1.11', 'sha256WithRSAEncryption'); -_IN('1.2.840.113549.1.1.12', 'sha384WithRSAEncryption'); -_IN('1.2.840.113549.1.1.13', 'sha512WithRSAEncryption'); -// Edwards-curve Digital Signature Algorithm (EdDSA) Ed25519 -_IN('1.3.101.112', 'EdDSA25519'); - -_IN('1.2.840.10040.4.3', 'dsa-with-sha1'); - -_IN('1.3.14.3.2.7', 'desCBC'); - -_IN('1.3.14.3.2.26', 'sha1'); -// Deprecated equivalent of sha1WithRSAEncryption -_IN('1.3.14.3.2.29', 'sha1WithRSASignature'); -_IN('2.16.840.1.101.3.4.2.1', 'sha256'); -_IN('2.16.840.1.101.3.4.2.2', 'sha384'); -_IN('2.16.840.1.101.3.4.2.3', 'sha512'); -_IN('2.16.840.1.101.3.4.2.4', 'sha224'); -_IN('2.16.840.1.101.3.4.2.5', 'sha512-224'); -_IN('2.16.840.1.101.3.4.2.6', 'sha512-256'); -_IN('1.2.840.113549.2.2', 'md2'); -_IN('1.2.840.113549.2.5', 'md5'); - -// pkcs#7 content types -_IN('1.2.840.113549.1.7.1', 'data'); -_IN('1.2.840.113549.1.7.2', 'signedData'); -_IN('1.2.840.113549.1.7.3', 'envelopedData'); -_IN('1.2.840.113549.1.7.4', 'signedAndEnvelopedData'); -_IN('1.2.840.113549.1.7.5', 'digestedData'); -_IN('1.2.840.113549.1.7.6', 'encryptedData'); - -// pkcs#9 oids -_IN('1.2.840.113549.1.9.1', 'emailAddress'); -_IN('1.2.840.113549.1.9.2', 'unstructuredName'); -_IN('1.2.840.113549.1.9.3', 'contentType'); -_IN('1.2.840.113549.1.9.4', 'messageDigest'); -_IN('1.2.840.113549.1.9.5', 'signingTime'); -_IN('1.2.840.113549.1.9.6', 'counterSignature'); -_IN('1.2.840.113549.1.9.7', 'challengePassword'); -_IN('1.2.840.113549.1.9.8', 'unstructuredAddress'); -_IN('1.2.840.113549.1.9.14', 'extensionRequest'); - -_IN('1.2.840.113549.1.9.20', 'friendlyName'); -_IN('1.2.840.113549.1.9.21', 'localKeyId'); -_IN('1.2.840.113549.1.9.22.1', 'x509Certificate'); - -// pkcs#12 safe bags -_IN('1.2.840.113549.1.12.10.1.1', 'keyBag'); -_IN('1.2.840.113549.1.12.10.1.2', 'pkcs8ShroudedKeyBag'); -_IN('1.2.840.113549.1.12.10.1.3', 'certBag'); -_IN('1.2.840.113549.1.12.10.1.4', 'crlBag'); -_IN('1.2.840.113549.1.12.10.1.5', 'secretBag'); -_IN('1.2.840.113549.1.12.10.1.6', 'safeContentsBag'); - -// password-based-encryption for pkcs#12 -_IN('1.2.840.113549.1.5.13', 'pkcs5PBES2'); -_IN('1.2.840.113549.1.5.12', 'pkcs5PBKDF2'); - -_IN('1.2.840.113549.1.12.1.1', 'pbeWithSHAAnd128BitRC4'); -_IN('1.2.840.113549.1.12.1.2', 'pbeWithSHAAnd40BitRC4'); -_IN('1.2.840.113549.1.12.1.3', 'pbeWithSHAAnd3-KeyTripleDES-CBC'); -_IN('1.2.840.113549.1.12.1.4', 'pbeWithSHAAnd2-KeyTripleDES-CBC'); -_IN('1.2.840.113549.1.12.1.5', 'pbeWithSHAAnd128BitRC2-CBC'); -_IN('1.2.840.113549.1.12.1.6', 'pbewithSHAAnd40BitRC2-CBC'); - -// hmac OIDs -_IN('1.2.840.113549.2.7', 'hmacWithSHA1'); -_IN('1.2.840.113549.2.8', 'hmacWithSHA224'); -_IN('1.2.840.113549.2.9', 'hmacWithSHA256'); -_IN('1.2.840.113549.2.10', 'hmacWithSHA384'); -_IN('1.2.840.113549.2.11', 'hmacWithSHA512'); - -// symmetric key algorithm oids -_IN('1.2.840.113549.3.7', 'des-EDE3-CBC'); -_IN('2.16.840.1.101.3.4.1.2', 'aes128-CBC'); -_IN('2.16.840.1.101.3.4.1.22', 'aes192-CBC'); -_IN('2.16.840.1.101.3.4.1.42', 'aes256-CBC'); - -// certificate issuer/subject OIDs -_IN('2.5.4.3', 'commonName'); -_IN('2.5.4.4', 'surname'); -_IN('2.5.4.5', 'serialNumber'); -_IN('2.5.4.6', 'countryName'); -_IN('2.5.4.7', 'localityName'); -_IN('2.5.4.8', 'stateOrProvinceName'); -_IN('2.5.4.9', 'streetAddress'); -_IN('2.5.4.10', 'organizationName'); -_IN('2.5.4.11', 'organizationalUnitName'); -_IN('2.5.4.12', 'title'); -_IN('2.5.4.13', 'description'); -_IN('2.5.4.15', 'businessCategory'); -_IN('2.5.4.17', 'postalCode'); -_IN('2.5.4.42', 'givenName'); -_IN('1.3.6.1.4.1.311.60.2.1.2', 'jurisdictionOfIncorporationStateOrProvinceName'); -_IN('1.3.6.1.4.1.311.60.2.1.3', 'jurisdictionOfIncorporationCountryName'); - -// X.509 extension OIDs -_IN('2.16.840.1.113730.1.1', 'nsCertType'); -_IN('2.16.840.1.113730.1.13', 'nsComment'); // deprecated in theory; still widely used -_I_('2.5.29.1', 'authorityKeyIdentifier'); // deprecated, use .35 -_I_('2.5.29.2', 'keyAttributes'); // obsolete use .37 or .15 -_I_('2.5.29.3', 'certificatePolicies'); // deprecated, use .32 -_I_('2.5.29.4', 'keyUsageRestriction'); // obsolete use .37 or .15 -_I_('2.5.29.5', 'policyMapping'); // deprecated use .33 -_I_('2.5.29.6', 'subtreesConstraint'); // obsolete use .30 -_I_('2.5.29.7', 'subjectAltName'); // deprecated use .17 -_I_('2.5.29.8', 'issuerAltName'); // deprecated use .18 -_I_('2.5.29.9', 'subjectDirectoryAttributes'); -_I_('2.5.29.10', 'basicConstraints'); // deprecated use .19 -_I_('2.5.29.11', 'nameConstraints'); // deprecated use .30 -_I_('2.5.29.12', 'policyConstraints'); // deprecated use .36 -_I_('2.5.29.13', 'basicConstraints'); // deprecated use .19 -_IN('2.5.29.14', 'subjectKeyIdentifier'); -_IN('2.5.29.15', 'keyUsage'); -_I_('2.5.29.16', 'privateKeyUsagePeriod'); -_IN('2.5.29.17', 'subjectAltName'); -_IN('2.5.29.18', 'issuerAltName'); -_IN('2.5.29.19', 'basicConstraints'); -_I_('2.5.29.20', 'cRLNumber'); -_I_('2.5.29.21', 'cRLReason'); -_I_('2.5.29.22', 'expirationDate'); -_I_('2.5.29.23', 'instructionCode'); -_I_('2.5.29.24', 'invalidityDate'); -_I_('2.5.29.25', 'cRLDistributionPoints'); // deprecated use .31 -_I_('2.5.29.26', 'issuingDistributionPoint'); // deprecated use .28 -_I_('2.5.29.27', 'deltaCRLIndicator'); -_I_('2.5.29.28', 'issuingDistributionPoint'); -_I_('2.5.29.29', 'certificateIssuer'); -_I_('2.5.29.30', 'nameConstraints'); -_IN('2.5.29.31', 'cRLDistributionPoints'); -_IN('2.5.29.32', 'certificatePolicies'); -_I_('2.5.29.33', 'policyMappings'); -_I_('2.5.29.34', 'policyConstraints'); // deprecated use .36 -_IN('2.5.29.35', 'authorityKeyIdentifier'); -_I_('2.5.29.36', 'policyConstraints'); -_IN('2.5.29.37', 'extKeyUsage'); -_I_('2.5.29.46', 'freshestCRL'); -_I_('2.5.29.54', 'inhibitAnyPolicy'); - -// extKeyUsage purposes -_IN('1.3.6.1.4.1.11129.2.4.2', 'timestampList'); -_IN('1.3.6.1.5.5.7.1.1', 'authorityInfoAccess'); -_IN('1.3.6.1.5.5.7.3.1', 'serverAuth'); -_IN('1.3.6.1.5.5.7.3.2', 'clientAuth'); -_IN('1.3.6.1.5.5.7.3.3', 'codeSigning'); -_IN('1.3.6.1.5.5.7.3.4', 'emailProtection'); -_IN('1.3.6.1.5.5.7.3.8', 'timeStamping'); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/pbe.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/pbe.js deleted file mode 100644 index cf8456ba..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/pbe.js +++ /dev/null @@ -1,1023 +0,0 @@ -/** - * Password-based encryption functions. - * - * @author Dave Longley - * @author Stefan Siegl - * - * Copyright (c) 2010-2013 Digital Bazaar, Inc. - * Copyright (c) 2012 Stefan Siegl - * - * An EncryptedPrivateKeyInfo: - * - * EncryptedPrivateKeyInfo ::= SEQUENCE { - * encryptionAlgorithm EncryptionAlgorithmIdentifier, - * encryptedData EncryptedData } - * - * EncryptionAlgorithmIdentifier ::= AlgorithmIdentifier - * - * EncryptedData ::= OCTET STRING - */ -var forge = require('./forge'); -require('./aes'); -require('./asn1'); -require('./des'); -require('./md'); -require('./oids'); -require('./pbkdf2'); -require('./pem'); -require('./random'); -require('./rc2'); -require('./rsa'); -require('./util'); - -if(typeof BigInteger === 'undefined') { - var BigInteger = forge.jsbn.BigInteger; -} - -// shortcut for asn.1 API -var asn1 = forge.asn1; - -/* Password-based encryption implementation. */ -var pki = forge.pki = forge.pki || {}; -module.exports = pki.pbe = forge.pbe = forge.pbe || {}; -var oids = pki.oids; - -// validator for an EncryptedPrivateKeyInfo structure -// Note: Currently only works w/algorithm params -var encryptedPrivateKeyValidator = { - name: 'EncryptedPrivateKeyInfo', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - value: [{ - name: 'EncryptedPrivateKeyInfo.encryptionAlgorithm', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - value: [{ - name: 'AlgorithmIdentifier.algorithm', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.OID, - constructed: false, - capture: 'encryptionOid' - }, { - name: 'AlgorithmIdentifier.parameters', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - captureAsn1: 'encryptionParams' - }] - }, { - // encryptedData - name: 'EncryptedPrivateKeyInfo.encryptedData', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.OCTETSTRING, - constructed: false, - capture: 'encryptedData' - }] -}; - -// validator for a PBES2Algorithms structure -// Note: Currently only works w/PBKDF2 + AES encryption schemes -var PBES2AlgorithmsValidator = { - name: 'PBES2Algorithms', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - value: [{ - name: 'PBES2Algorithms.keyDerivationFunc', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - value: [{ - name: 'PBES2Algorithms.keyDerivationFunc.oid', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.OID, - constructed: false, - capture: 'kdfOid' - }, { - name: 'PBES2Algorithms.params', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - value: [{ - name: 'PBES2Algorithms.params.salt', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.OCTETSTRING, - constructed: false, - capture: 'kdfSalt' - }, { - name: 'PBES2Algorithms.params.iterationCount', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.INTEGER, - constructed: false, - capture: 'kdfIterationCount' - }, { - name: 'PBES2Algorithms.params.keyLength', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.INTEGER, - constructed: false, - optional: true, - capture: 'keyLength' - }, { - // prf - name: 'PBES2Algorithms.params.prf', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - optional: true, - value: [{ - name: 'PBES2Algorithms.params.prf.algorithm', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.OID, - constructed: false, - capture: 'prfOid' - }] - }] - }] - }, { - name: 'PBES2Algorithms.encryptionScheme', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - value: [{ - name: 'PBES2Algorithms.encryptionScheme.oid', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.OID, - constructed: false, - capture: 'encOid' - }, { - name: 'PBES2Algorithms.encryptionScheme.iv', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.OCTETSTRING, - constructed: false, - capture: 'encIv' - }] - }] -}; - -var pkcs12PbeParamsValidator = { - name: 'pkcs-12PbeParams', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - value: [{ - name: 'pkcs-12PbeParams.salt', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.OCTETSTRING, - constructed: false, - capture: 'salt' - }, { - name: 'pkcs-12PbeParams.iterations', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.INTEGER, - constructed: false, - capture: 'iterations' - }] -}; - -/** - * Encrypts a ASN.1 PrivateKeyInfo object, producing an EncryptedPrivateKeyInfo. - * - * PBES2Algorithms ALGORITHM-IDENTIFIER ::= - * { {PBES2-params IDENTIFIED BY id-PBES2}, ...} - * - * id-PBES2 OBJECT IDENTIFIER ::= {pkcs-5 13} - * - * PBES2-params ::= SEQUENCE { - * keyDerivationFunc AlgorithmIdentifier {{PBES2-KDFs}}, - * encryptionScheme AlgorithmIdentifier {{PBES2-Encs}} - * } - * - * PBES2-KDFs ALGORITHM-IDENTIFIER ::= - * { {PBKDF2-params IDENTIFIED BY id-PBKDF2}, ... } - * - * PBES2-Encs ALGORITHM-IDENTIFIER ::= { ... } - * - * PBKDF2-params ::= SEQUENCE { - * salt CHOICE { - * specified OCTET STRING, - * otherSource AlgorithmIdentifier {{PBKDF2-SaltSources}} - * }, - * iterationCount INTEGER (1..MAX), - * keyLength INTEGER (1..MAX) OPTIONAL, - * prf AlgorithmIdentifier {{PBKDF2-PRFs}} DEFAULT algid-hmacWithSHA1 - * } - * - * @param obj the ASN.1 PrivateKeyInfo object. - * @param password the password to encrypt with. - * @param options: - * algorithm the encryption algorithm to use - * ('aes128', 'aes192', 'aes256', '3des'), defaults to 'aes128'. - * count the iteration count to use. - * saltSize the salt size to use. - * prfAlgorithm the PRF message digest algorithm to use - * ('sha1', 'sha224', 'sha256', 'sha384', 'sha512') - * - * @return the ASN.1 EncryptedPrivateKeyInfo. - */ -pki.encryptPrivateKeyInfo = function(obj, password, options) { - // set default options - options = options || {}; - options.saltSize = options.saltSize || 8; - options.count = options.count || 2048; - options.algorithm = options.algorithm || 'aes128'; - options.prfAlgorithm = options.prfAlgorithm || 'sha1'; - - // generate PBE params - var salt = forge.random.getBytesSync(options.saltSize); - var count = options.count; - var countBytes = asn1.integerToDer(count); - var dkLen; - var encryptionAlgorithm; - var encryptedData; - if(options.algorithm.indexOf('aes') === 0 || options.algorithm === 'des') { - // do PBES2 - var ivLen, encOid, cipherFn; - switch(options.algorithm) { - case 'aes128': - dkLen = 16; - ivLen = 16; - encOid = oids['aes128-CBC']; - cipherFn = forge.aes.createEncryptionCipher; - break; - case 'aes192': - dkLen = 24; - ivLen = 16; - encOid = oids['aes192-CBC']; - cipherFn = forge.aes.createEncryptionCipher; - break; - case 'aes256': - dkLen = 32; - ivLen = 16; - encOid = oids['aes256-CBC']; - cipherFn = forge.aes.createEncryptionCipher; - break; - case 'des': - dkLen = 8; - ivLen = 8; - encOid = oids['desCBC']; - cipherFn = forge.des.createEncryptionCipher; - break; - default: - var error = new Error('Cannot encrypt private key. Unknown encryption algorithm.'); - error.algorithm = options.algorithm; - throw error; - } - - // get PRF message digest - var prfAlgorithm = 'hmacWith' + options.prfAlgorithm.toUpperCase(); - var md = prfAlgorithmToMessageDigest(prfAlgorithm); - - // encrypt private key using pbe SHA-1 and AES/DES - var dk = forge.pkcs5.pbkdf2(password, salt, count, dkLen, md); - var iv = forge.random.getBytesSync(ivLen); - var cipher = cipherFn(dk); - cipher.start(iv); - cipher.update(asn1.toDer(obj)); - cipher.finish(); - encryptedData = cipher.output.getBytes(); - - // get PBKDF2-params - var params = createPbkdf2Params(salt, countBytes, dkLen, prfAlgorithm); - - encryptionAlgorithm = asn1.create( - asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false, - asn1.oidToDer(oids['pkcs5PBES2']).getBytes()), - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // keyDerivationFunc - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false, - asn1.oidToDer(oids['pkcs5PBKDF2']).getBytes()), - // PBKDF2-params - params - ]), - // encryptionScheme - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false, - asn1.oidToDer(encOid).getBytes()), - // iv - asn1.create( - asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false, iv) - ]) - ]) - ]); - } else if(options.algorithm === '3des') { - // Do PKCS12 PBE - dkLen = 24; - - var saltBytes = new forge.util.ByteBuffer(salt); - var dk = pki.pbe.generatePkcs12Key(password, saltBytes, 1, count, dkLen); - var iv = pki.pbe.generatePkcs12Key(password, saltBytes, 2, count, dkLen); - var cipher = forge.des.createEncryptionCipher(dk); - cipher.start(iv); - cipher.update(asn1.toDer(obj)); - cipher.finish(); - encryptedData = cipher.output.getBytes(); - - encryptionAlgorithm = asn1.create( - asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false, - asn1.oidToDer(oids['pbeWithSHAAnd3-KeyTripleDES-CBC']).getBytes()), - // pkcs-12PbeParams - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // salt - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false, salt), - // iteration count - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, - countBytes.getBytes()) - ]) - ]); - } else { - var error = new Error('Cannot encrypt private key. Unknown encryption algorithm.'); - error.algorithm = options.algorithm; - throw error; - } - - // EncryptedPrivateKeyInfo - var rval = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // encryptionAlgorithm - encryptionAlgorithm, - // encryptedData - asn1.create( - asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false, encryptedData) - ]); - return rval; -}; - -/** - * Decrypts a ASN.1 PrivateKeyInfo object. - * - * @param obj the ASN.1 EncryptedPrivateKeyInfo object. - * @param password the password to decrypt with. - * - * @return the ASN.1 PrivateKeyInfo on success, null on failure. - */ -pki.decryptPrivateKeyInfo = function(obj, password) { - var rval = null; - - // get PBE params - var capture = {}; - var errors = []; - if(!asn1.validate(obj, encryptedPrivateKeyValidator, capture, errors)) { - var error = new Error('Cannot read encrypted private key. ' + - 'ASN.1 object is not a supported EncryptedPrivateKeyInfo.'); - error.errors = errors; - throw error; - } - - // get cipher - var oid = asn1.derToOid(capture.encryptionOid); - var cipher = pki.pbe.getCipher(oid, capture.encryptionParams, password); - - // get encrypted data - var encrypted = forge.util.createBuffer(capture.encryptedData); - - cipher.update(encrypted); - if(cipher.finish()) { - rval = asn1.fromDer(cipher.output); - } - - return rval; -}; - -/** - * Converts a EncryptedPrivateKeyInfo to PEM format. - * - * @param epki the EncryptedPrivateKeyInfo. - * @param maxline the maximum characters per line, defaults to 64. - * - * @return the PEM-formatted encrypted private key. - */ -pki.encryptedPrivateKeyToPem = function(epki, maxline) { - // convert to DER, then PEM-encode - var msg = { - type: 'ENCRYPTED PRIVATE KEY', - body: asn1.toDer(epki).getBytes() - }; - return forge.pem.encode(msg, {maxline: maxline}); -}; - -/** - * Converts a PEM-encoded EncryptedPrivateKeyInfo to ASN.1 format. Decryption - * is not performed. - * - * @param pem the EncryptedPrivateKeyInfo in PEM-format. - * - * @return the ASN.1 EncryptedPrivateKeyInfo. - */ -pki.encryptedPrivateKeyFromPem = function(pem) { - var msg = forge.pem.decode(pem)[0]; - - if(msg.type !== 'ENCRYPTED PRIVATE KEY') { - var error = new Error('Could not convert encrypted private key from PEM; ' + - 'PEM header type is "ENCRYPTED PRIVATE KEY".'); - error.headerType = msg.type; - throw error; - } - if(msg.procType && msg.procType.type === 'ENCRYPTED') { - throw new Error('Could not convert encrypted private key from PEM; ' + - 'PEM is encrypted.'); - } - - // convert DER to ASN.1 object - return asn1.fromDer(msg.body); -}; - -/** - * Encrypts an RSA private key. By default, the key will be wrapped in - * a PrivateKeyInfo and encrypted to produce a PKCS#8 EncryptedPrivateKeyInfo. - * This is the standard, preferred way to encrypt a private key. - * - * To produce a non-standard PEM-encrypted private key that uses encapsulated - * headers to indicate the encryption algorithm (old-style non-PKCS#8 OpenSSL - * private key encryption), set the 'legacy' option to true. Note: Using this - * option will cause the iteration count to be forced to 1. - * - * Note: The 'des' algorithm is supported, but it is not considered to be - * secure because it only uses a single 56-bit key. If possible, it is highly - * recommended that a different algorithm be used. - * - * @param rsaKey the RSA key to encrypt. - * @param password the password to use. - * @param options: - * algorithm: the encryption algorithm to use - * ('aes128', 'aes192', 'aes256', '3des', 'des'). - * count: the iteration count to use. - * saltSize: the salt size to use. - * legacy: output an old non-PKCS#8 PEM-encrypted+encapsulated - * headers (DEK-Info) private key. - * - * @return the PEM-encoded ASN.1 EncryptedPrivateKeyInfo. - */ -pki.encryptRsaPrivateKey = function(rsaKey, password, options) { - // standard PKCS#8 - options = options || {}; - if(!options.legacy) { - // encrypt PrivateKeyInfo - var rval = pki.wrapRsaPrivateKey(pki.privateKeyToAsn1(rsaKey)); - rval = pki.encryptPrivateKeyInfo(rval, password, options); - return pki.encryptedPrivateKeyToPem(rval); - } - - // legacy non-PKCS#8 - var algorithm; - var iv; - var dkLen; - var cipherFn; - switch(options.algorithm) { - case 'aes128': - algorithm = 'AES-128-CBC'; - dkLen = 16; - iv = forge.random.getBytesSync(16); - cipherFn = forge.aes.createEncryptionCipher; - break; - case 'aes192': - algorithm = 'AES-192-CBC'; - dkLen = 24; - iv = forge.random.getBytesSync(16); - cipherFn = forge.aes.createEncryptionCipher; - break; - case 'aes256': - algorithm = 'AES-256-CBC'; - dkLen = 32; - iv = forge.random.getBytesSync(16); - cipherFn = forge.aes.createEncryptionCipher; - break; - case '3des': - algorithm = 'DES-EDE3-CBC'; - dkLen = 24; - iv = forge.random.getBytesSync(8); - cipherFn = forge.des.createEncryptionCipher; - break; - case 'des': - algorithm = 'DES-CBC'; - dkLen = 8; - iv = forge.random.getBytesSync(8); - cipherFn = forge.des.createEncryptionCipher; - break; - default: - var error = new Error('Could not encrypt RSA private key; unsupported ' + - 'encryption algorithm "' + options.algorithm + '".'); - error.algorithm = options.algorithm; - throw error; - } - - // encrypt private key using OpenSSL legacy key derivation - var dk = forge.pbe.opensslDeriveBytes(password, iv.substr(0, 8), dkLen); - var cipher = cipherFn(dk); - cipher.start(iv); - cipher.update(asn1.toDer(pki.privateKeyToAsn1(rsaKey))); - cipher.finish(); - - var msg = { - type: 'RSA PRIVATE KEY', - procType: { - version: '4', - type: 'ENCRYPTED' - }, - dekInfo: { - algorithm: algorithm, - parameters: forge.util.bytesToHex(iv).toUpperCase() - }, - body: cipher.output.getBytes() - }; - return forge.pem.encode(msg); -}; - -/** - * Decrypts an RSA private key. - * - * @param pem the PEM-formatted EncryptedPrivateKeyInfo to decrypt. - * @param password the password to use. - * - * @return the RSA key on success, null on failure. - */ -pki.decryptRsaPrivateKey = function(pem, password) { - var rval = null; - - var msg = forge.pem.decode(pem)[0]; - - if(msg.type !== 'ENCRYPTED PRIVATE KEY' && - msg.type !== 'PRIVATE KEY' && - msg.type !== 'RSA PRIVATE KEY') { - var error = new Error('Could not convert private key from PEM; PEM header type ' + - 'is not "ENCRYPTED PRIVATE KEY", "PRIVATE KEY", or "RSA PRIVATE KEY".'); - error.headerType = error; - throw error; - } - - if(msg.procType && msg.procType.type === 'ENCRYPTED') { - var dkLen; - var cipherFn; - switch(msg.dekInfo.algorithm) { - case 'DES-CBC': - dkLen = 8; - cipherFn = forge.des.createDecryptionCipher; - break; - case 'DES-EDE3-CBC': - dkLen = 24; - cipherFn = forge.des.createDecryptionCipher; - break; - case 'AES-128-CBC': - dkLen = 16; - cipherFn = forge.aes.createDecryptionCipher; - break; - case 'AES-192-CBC': - dkLen = 24; - cipherFn = forge.aes.createDecryptionCipher; - break; - case 'AES-256-CBC': - dkLen = 32; - cipherFn = forge.aes.createDecryptionCipher; - break; - case 'RC2-40-CBC': - dkLen = 5; - cipherFn = function(key) { - return forge.rc2.createDecryptionCipher(key, 40); - }; - break; - case 'RC2-64-CBC': - dkLen = 8; - cipherFn = function(key) { - return forge.rc2.createDecryptionCipher(key, 64); - }; - break; - case 'RC2-128-CBC': - dkLen = 16; - cipherFn = function(key) { - return forge.rc2.createDecryptionCipher(key, 128); - }; - break; - default: - var error = new Error('Could not decrypt private key; unsupported ' + - 'encryption algorithm "' + msg.dekInfo.algorithm + '".'); - error.algorithm = msg.dekInfo.algorithm; - throw error; - } - - // use OpenSSL legacy key derivation - var iv = forge.util.hexToBytes(msg.dekInfo.parameters); - var dk = forge.pbe.opensslDeriveBytes(password, iv.substr(0, 8), dkLen); - var cipher = cipherFn(dk); - cipher.start(iv); - cipher.update(forge.util.createBuffer(msg.body)); - if(cipher.finish()) { - rval = cipher.output.getBytes(); - } else { - return rval; - } - } else { - rval = msg.body; - } - - if(msg.type === 'ENCRYPTED PRIVATE KEY') { - rval = pki.decryptPrivateKeyInfo(asn1.fromDer(rval), password); - } else { - // decryption already performed above - rval = asn1.fromDer(rval); - } - - if(rval !== null) { - rval = pki.privateKeyFromAsn1(rval); - } - - return rval; -}; - -/** - * Derives a PKCS#12 key. - * - * @param password the password to derive the key material from, null or - * undefined for none. - * @param salt the salt, as a ByteBuffer, to use. - * @param id the PKCS#12 ID byte (1 = key material, 2 = IV, 3 = MAC). - * @param iter the iteration count. - * @param n the number of bytes to derive from the password. - * @param md the message digest to use, defaults to SHA-1. - * - * @return a ByteBuffer with the bytes derived from the password. - */ -pki.pbe.generatePkcs12Key = function(password, salt, id, iter, n, md) { - var j, l; - - if(typeof md === 'undefined' || md === null) { - if(!('sha1' in forge.md)) { - throw new Error('"sha1" hash algorithm unavailable.'); - } - md = forge.md.sha1.create(); - } - - var u = md.digestLength; - var v = md.blockLength; - var result = new forge.util.ByteBuffer(); - - /* Convert password to Unicode byte buffer + trailing 0-byte. */ - var passBuf = new forge.util.ByteBuffer(); - if(password !== null && password !== undefined) { - for(l = 0; l < password.length; l++) { - passBuf.putInt16(password.charCodeAt(l)); - } - passBuf.putInt16(0); - } - - /* Length of salt and password in BYTES. */ - var p = passBuf.length(); - var s = salt.length(); - - /* 1. Construct a string, D (the "diversifier"), by concatenating - v copies of ID. */ - var D = new forge.util.ByteBuffer(); - D.fillWithByte(id, v); - - /* 2. Concatenate copies of the salt together to create a string S of length - v * ceil(s / v) bytes (the final copy of the salt may be trunacted - to create S). - Note that if the salt is the empty string, then so is S. */ - var Slen = v * Math.ceil(s / v); - var S = new forge.util.ByteBuffer(); - for(l = 0; l < Slen; l++) { - S.putByte(salt.at(l % s)); - } - - /* 3. Concatenate copies of the password together to create a string P of - length v * ceil(p / v) bytes (the final copy of the password may be - truncated to create P). - Note that if the password is the empty string, then so is P. */ - var Plen = v * Math.ceil(p / v); - var P = new forge.util.ByteBuffer(); - for(l = 0; l < Plen; l++) { - P.putByte(passBuf.at(l % p)); - } - - /* 4. Set I=S||P to be the concatenation of S and P. */ - var I = S; - I.putBuffer(P); - - /* 5. Set c=ceil(n / u). */ - var c = Math.ceil(n / u); - - /* 6. For i=1, 2, ..., c, do the following: */ - for(var i = 1; i <= c; i++) { - /* a) Set Ai=H^r(D||I). (l.e. the rth hash of D||I, H(H(H(...H(D||I)))) */ - var buf = new forge.util.ByteBuffer(); - buf.putBytes(D.bytes()); - buf.putBytes(I.bytes()); - for(var round = 0; round < iter; round++) { - md.start(); - md.update(buf.getBytes()); - buf = md.digest(); - } - - /* b) Concatenate copies of Ai to create a string B of length v bytes (the - final copy of Ai may be truncated to create B). */ - var B = new forge.util.ByteBuffer(); - for(l = 0; l < v; l++) { - B.putByte(buf.at(l % u)); - } - - /* c) Treating I as a concatenation I0, I1, ..., Ik-1 of v-byte blocks, - where k=ceil(s / v) + ceil(p / v), modify I by setting - Ij=(Ij+B+1) mod 2v for each j. */ - var k = Math.ceil(s / v) + Math.ceil(p / v); - var Inew = new forge.util.ByteBuffer(); - for(j = 0; j < k; j++) { - var chunk = new forge.util.ByteBuffer(I.getBytes(v)); - var x = 0x1ff; - for(l = B.length() - 1; l >= 0; l--) { - x = x >> 8; - x += B.at(l) + chunk.at(l); - chunk.setAt(l, x & 0xff); - } - Inew.putBuffer(chunk); - } - I = Inew; - - /* Add Ai to A. */ - result.putBuffer(buf); - } - - result.truncate(result.length() - n); - return result; -}; - -/** - * Get new Forge cipher object instance. - * - * @param oid the OID (in string notation). - * @param params the ASN.1 params object. - * @param password the password to decrypt with. - * - * @return new cipher object instance. - */ -pki.pbe.getCipher = function(oid, params, password) { - switch(oid) { - case pki.oids['pkcs5PBES2']: - return pki.pbe.getCipherForPBES2(oid, params, password); - - case pki.oids['pbeWithSHAAnd3-KeyTripleDES-CBC']: - case pki.oids['pbewithSHAAnd40BitRC2-CBC']: - return pki.pbe.getCipherForPKCS12PBE(oid, params, password); - - default: - var error = new Error('Cannot read encrypted PBE data block. Unsupported OID.'); - error.oid = oid; - error.supportedOids = [ - 'pkcs5PBES2', - 'pbeWithSHAAnd3-KeyTripleDES-CBC', - 'pbewithSHAAnd40BitRC2-CBC' - ]; - throw error; - } -}; - -/** - * Get new Forge cipher object instance according to PBES2 params block. - * - * The returned cipher instance is already started using the IV - * from PBES2 parameter block. - * - * @param oid the PKCS#5 PBKDF2 OID (in string notation). - * @param params the ASN.1 PBES2-params object. - * @param password the password to decrypt with. - * - * @return new cipher object instance. - */ -pki.pbe.getCipherForPBES2 = function(oid, params, password) { - // get PBE params - var capture = {}; - var errors = []; - if(!asn1.validate(params, PBES2AlgorithmsValidator, capture, errors)) { - var error = new Error('Cannot read password-based-encryption algorithm ' + - 'parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.'); - error.errors = errors; - throw error; - } - - // check oids - oid = asn1.derToOid(capture.kdfOid); - if(oid !== pki.oids['pkcs5PBKDF2']) { - var error = new Error('Cannot read encrypted private key. ' + - 'Unsupported key derivation function OID.'); - error.oid = oid; - error.supportedOids = ['pkcs5PBKDF2']; - throw error; - } - oid = asn1.derToOid(capture.encOid); - if(oid !== pki.oids['aes128-CBC'] && - oid !== pki.oids['aes192-CBC'] && - oid !== pki.oids['aes256-CBC'] && - oid !== pki.oids['des-EDE3-CBC'] && - oid !== pki.oids['desCBC']) { - var error = new Error('Cannot read encrypted private key. ' + - 'Unsupported encryption scheme OID.'); - error.oid = oid; - error.supportedOids = [ - 'aes128-CBC', 'aes192-CBC', 'aes256-CBC', 'des-EDE3-CBC', 'desCBC']; - throw error; - } - - // set PBE params - var salt = capture.kdfSalt; - var count = forge.util.createBuffer(capture.kdfIterationCount); - count = count.getInt(count.length() << 3); - var dkLen; - var cipherFn; - switch(pki.oids[oid]) { - case 'aes128-CBC': - dkLen = 16; - cipherFn = forge.aes.createDecryptionCipher; - break; - case 'aes192-CBC': - dkLen = 24; - cipherFn = forge.aes.createDecryptionCipher; - break; - case 'aes256-CBC': - dkLen = 32; - cipherFn = forge.aes.createDecryptionCipher; - break; - case 'des-EDE3-CBC': - dkLen = 24; - cipherFn = forge.des.createDecryptionCipher; - break; - case 'desCBC': - dkLen = 8; - cipherFn = forge.des.createDecryptionCipher; - break; - } - - // get PRF message digest - var md = prfOidToMessageDigest(capture.prfOid); - - // decrypt private key using pbe with chosen PRF and AES/DES - var dk = forge.pkcs5.pbkdf2(password, salt, count, dkLen, md); - var iv = capture.encIv; - var cipher = cipherFn(dk); - cipher.start(iv); - - return cipher; -}; - -/** - * Get new Forge cipher object instance for PKCS#12 PBE. - * - * The returned cipher instance is already started using the key & IV - * derived from the provided password and PKCS#12 PBE salt. - * - * @param oid The PKCS#12 PBE OID (in string notation). - * @param params The ASN.1 PKCS#12 PBE-params object. - * @param password The password to decrypt with. - * - * @return the new cipher object instance. - */ -pki.pbe.getCipherForPKCS12PBE = function(oid, params, password) { - // get PBE params - var capture = {}; - var errors = []; - if(!asn1.validate(params, pkcs12PbeParamsValidator, capture, errors)) { - var error = new Error('Cannot read password-based-encryption algorithm ' + - 'parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.'); - error.errors = errors; - throw error; - } - - var salt = forge.util.createBuffer(capture.salt); - var count = forge.util.createBuffer(capture.iterations); - count = count.getInt(count.length() << 3); - - var dkLen, dIvLen, cipherFn; - switch(oid) { - case pki.oids['pbeWithSHAAnd3-KeyTripleDES-CBC']: - dkLen = 24; - dIvLen = 8; - cipherFn = forge.des.startDecrypting; - break; - - case pki.oids['pbewithSHAAnd40BitRC2-CBC']: - dkLen = 5; - dIvLen = 8; - cipherFn = function(key, iv) { - var cipher = forge.rc2.createDecryptionCipher(key, 40); - cipher.start(iv, null); - return cipher; - }; - break; - - default: - var error = new Error('Cannot read PKCS #12 PBE data block. Unsupported OID.'); - error.oid = oid; - throw error; - } - - // get PRF message digest - var md = prfOidToMessageDigest(capture.prfOid); - var key = pki.pbe.generatePkcs12Key(password, salt, 1, count, dkLen, md); - md.start(); - var iv = pki.pbe.generatePkcs12Key(password, salt, 2, count, dIvLen, md); - - return cipherFn(key, iv); -}; - -/** - * OpenSSL's legacy key derivation function. - * - * See: http://www.openssl.org/docs/crypto/EVP_BytesToKey.html - * - * @param password the password to derive the key from. - * @param salt the salt to use, null for none. - * @param dkLen the number of bytes needed for the derived key. - * @param [options] the options to use: - * [md] an optional message digest object to use. - */ -pki.pbe.opensslDeriveBytes = function(password, salt, dkLen, md) { - if(typeof md === 'undefined' || md === null) { - if(!('md5' in forge.md)) { - throw new Error('"md5" hash algorithm unavailable.'); - } - md = forge.md.md5.create(); - } - if(salt === null) { - salt = ''; - } - var digests = [hash(md, password + salt)]; - for(var length = 16, i = 1; length < dkLen; ++i, length += 16) { - digests.push(hash(md, digests[i - 1] + password + salt)); - } - return digests.join('').substr(0, dkLen); -}; - -function hash(md, bytes) { - return md.start().update(bytes).digest().getBytes(); -} - -function prfOidToMessageDigest(prfOid) { - // get PRF algorithm, default to SHA-1 - var prfAlgorithm; - if(!prfOid) { - prfAlgorithm = 'hmacWithSHA1'; - } else { - prfAlgorithm = pki.oids[asn1.derToOid(prfOid)]; - if(!prfAlgorithm) { - var error = new Error('Unsupported PRF OID.'); - error.oid = prfOid; - error.supported = [ - 'hmacWithSHA1', 'hmacWithSHA224', 'hmacWithSHA256', 'hmacWithSHA384', - 'hmacWithSHA512']; - throw error; - } - } - return prfAlgorithmToMessageDigest(prfAlgorithm); -} - -function prfAlgorithmToMessageDigest(prfAlgorithm) { - var factory = forge.md; - switch(prfAlgorithm) { - case 'hmacWithSHA224': - factory = forge.md.sha512; - case 'hmacWithSHA1': - case 'hmacWithSHA256': - case 'hmacWithSHA384': - case 'hmacWithSHA512': - prfAlgorithm = prfAlgorithm.substr(8).toLowerCase(); - break; - default: - var error = new Error('Unsupported PRF algorithm.'); - error.algorithm = prfAlgorithm; - error.supported = [ - 'hmacWithSHA1', 'hmacWithSHA224', 'hmacWithSHA256', 'hmacWithSHA384', - 'hmacWithSHA512']; - throw error; - } - if(!factory || !(prfAlgorithm in factory)) { - throw new Error('Unknown hash algorithm: ' + prfAlgorithm); - } - return factory[prfAlgorithm].create(); -} - -function createPbkdf2Params(salt, countBytes, dkLen, prfAlgorithm) { - var params = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // salt - asn1.create( - asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false, salt), - // iteration count - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, - countBytes.getBytes()) - ]); - // when PRF algorithm is not SHA-1 default, add key length and PRF algorithm - if(prfAlgorithm !== 'hmacWithSHA1') { - params.value.push( - // key length - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, - forge.util.hexToBytes(dkLen.toString(16))), - // AlgorithmIdentifier - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // algorithm - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false, - asn1.oidToDer(pki.oids[prfAlgorithm]).getBytes()), - // parameters (null) - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.NULL, false, '') - ])); - } - return params; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/pbkdf2.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/pbkdf2.js deleted file mode 100644 index 714560e3..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/pbkdf2.js +++ /dev/null @@ -1,211 +0,0 @@ -/** - * Password-Based Key-Derivation Function #2 implementation. - * - * See RFC 2898 for details. - * - * @author Dave Longley - * - * Copyright (c) 2010-2013 Digital Bazaar, Inc. - */ -var forge = require('./forge'); -require('./hmac'); -require('./md'); -require('./util'); - -var pkcs5 = forge.pkcs5 = forge.pkcs5 || {}; - -var crypto; -if(forge.util.isNodejs && !forge.options.usePureJavaScript) { - crypto = require('crypto'); -} - -/** - * Derives a key from a password. - * - * @param p the password as a binary-encoded string of bytes. - * @param s the salt as a binary-encoded string of bytes. - * @param c the iteration count, a positive integer. - * @param dkLen the intended length, in bytes, of the derived key, - * (max: 2^32 - 1) * hash length of the PRF. - * @param [md] the message digest (or algorithm identifier as a string) to use - * in the PRF, defaults to SHA-1. - * @param [callback(err, key)] presence triggers asynchronous version, called - * once the operation completes. - * - * @return the derived key, as a binary-encoded string of bytes, for the - * synchronous version (if no callback is specified). - */ -module.exports = forge.pbkdf2 = pkcs5.pbkdf2 = function( - p, s, c, dkLen, md, callback) { - if(typeof md === 'function') { - callback = md; - md = null; - } - - // use native implementation if possible and not disabled, note that - // some node versions only support SHA-1, others allow digest to be changed - if(forge.util.isNodejs && !forge.options.usePureJavaScript && - crypto.pbkdf2 && (md === null || typeof md !== 'object') && - (crypto.pbkdf2Sync.length > 4 || (!md || md === 'sha1'))) { - if(typeof md !== 'string') { - // default prf to SHA-1 - md = 'sha1'; - } - p = Buffer.from(p, 'binary'); - s = Buffer.from(s, 'binary'); - if(!callback) { - if(crypto.pbkdf2Sync.length === 4) { - return crypto.pbkdf2Sync(p, s, c, dkLen).toString('binary'); - } - return crypto.pbkdf2Sync(p, s, c, dkLen, md).toString('binary'); - } - if(crypto.pbkdf2Sync.length === 4) { - return crypto.pbkdf2(p, s, c, dkLen, function(err, key) { - if(err) { - return callback(err); - } - callback(null, key.toString('binary')); - }); - } - return crypto.pbkdf2(p, s, c, dkLen, md, function(err, key) { - if(err) { - return callback(err); - } - callback(null, key.toString('binary')); - }); - } - - if(typeof md === 'undefined' || md === null) { - // default prf to SHA-1 - md = 'sha1'; - } - if(typeof md === 'string') { - if(!(md in forge.md.algorithms)) { - throw new Error('Unknown hash algorithm: ' + md); - } - md = forge.md[md].create(); - } - - var hLen = md.digestLength; - - /* 1. If dkLen > (2^32 - 1) * hLen, output "derived key too long" and - stop. */ - if(dkLen > (0xFFFFFFFF * hLen)) { - var err = new Error('Derived key is too long.'); - if(callback) { - return callback(err); - } - throw err; - } - - /* 2. Let len be the number of hLen-octet blocks in the derived key, - rounding up, and let r be the number of octets in the last - block: - - len = CEIL(dkLen / hLen), - r = dkLen - (len - 1) * hLen. */ - var len = Math.ceil(dkLen / hLen); - var r = dkLen - (len - 1) * hLen; - - /* 3. For each block of the derived key apply the function F defined - below to the password P, the salt S, the iteration count c, and - the block index to compute the block: - - T_1 = F(P, S, c, 1), - T_2 = F(P, S, c, 2), - ... - T_len = F(P, S, c, len), - - where the function F is defined as the exclusive-or sum of the - first c iterates of the underlying pseudorandom function PRF - applied to the password P and the concatenation of the salt S - and the block index i: - - F(P, S, c, i) = u_1 XOR u_2 XOR ... XOR u_c - - where - - u_1 = PRF(P, S || INT(i)), - u_2 = PRF(P, u_1), - ... - u_c = PRF(P, u_{c-1}). - - Here, INT(i) is a four-octet encoding of the integer i, most - significant octet first. */ - var prf = forge.hmac.create(); - prf.start(md, p); - var dk = ''; - var xor, u_c, u_c1; - - // sync version - if(!callback) { - for(var i = 1; i <= len; ++i) { - // PRF(P, S || INT(i)) (first iteration) - prf.start(null, null); - prf.update(s); - prf.update(forge.util.int32ToBytes(i)); - xor = u_c1 = prf.digest().getBytes(); - - // PRF(P, u_{c-1}) (other iterations) - for(var j = 2; j <= c; ++j) { - prf.start(null, null); - prf.update(u_c1); - u_c = prf.digest().getBytes(); - // F(p, s, c, i) - xor = forge.util.xorBytes(xor, u_c, hLen); - u_c1 = u_c; - } - - /* 4. Concatenate the blocks and extract the first dkLen octets to - produce a derived key DK: - - DK = T_1 || T_2 || ... || T_len<0..r-1> */ - dk += (i < len) ? xor : xor.substr(0, r); - } - /* 5. Output the derived key DK. */ - return dk; - } - - // async version - var i = 1, j; - function outer() { - if(i > len) { - // done - return callback(null, dk); - } - - // PRF(P, S || INT(i)) (first iteration) - prf.start(null, null); - prf.update(s); - prf.update(forge.util.int32ToBytes(i)); - xor = u_c1 = prf.digest().getBytes(); - - // PRF(P, u_{c-1}) (other iterations) - j = 2; - inner(); - } - - function inner() { - if(j <= c) { - prf.start(null, null); - prf.update(u_c1); - u_c = prf.digest().getBytes(); - // F(p, s, c, i) - xor = forge.util.xorBytes(xor, u_c, hLen); - u_c1 = u_c; - ++j; - return forge.util.setImmediate(inner); - } - - /* 4. Concatenate the blocks and extract the first dkLen octets to - produce a derived key DK: - - DK = T_1 || T_2 || ... || T_len<0..r-1> */ - dk += (i < len) ? xor : xor.substr(0, r); - - ++i; - outer(); - } - - outer(); -}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/pem.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/pem.js deleted file mode 100644 index 1992bc77..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/pem.js +++ /dev/null @@ -1,237 +0,0 @@ -/** - * Javascript implementation of basic PEM (Privacy Enhanced Mail) algorithms. - * - * See: RFC 1421. - * - * @author Dave Longley - * - * Copyright (c) 2013-2014 Digital Bazaar, Inc. - * - * A Forge PEM object has the following fields: - * - * type: identifies the type of message (eg: "RSA PRIVATE KEY"). - * - * procType: identifies the type of processing performed on the message, - * it has two subfields: version and type, eg: 4,ENCRYPTED. - * - * contentDomain: identifies the type of content in the message, typically - * only uses the value: "RFC822". - * - * dekInfo: identifies the message encryption algorithm and mode and includes - * any parameters for the algorithm, it has two subfields: algorithm and - * parameters, eg: DES-CBC,F8143EDE5960C597. - * - * headers: contains all other PEM encapsulated headers -- where order is - * significant (for pairing data like recipient ID + key info). - * - * body: the binary-encoded body. - */ -var forge = require('./forge'); -require('./util'); - -// shortcut for pem API -var pem = module.exports = forge.pem = forge.pem || {}; - -/** - * Encodes (serializes) the given PEM object. - * - * @param msg the PEM message object to encode. - * @param options the options to use: - * maxline the maximum characters per line for the body, (default: 64). - * - * @return the PEM-formatted string. - */ -pem.encode = function(msg, options) { - options = options || {}; - var rval = '-----BEGIN ' + msg.type + '-----\r\n'; - - // encode special headers - var header; - if(msg.procType) { - header = { - name: 'Proc-Type', - values: [String(msg.procType.version), msg.procType.type] - }; - rval += foldHeader(header); - } - if(msg.contentDomain) { - header = {name: 'Content-Domain', values: [msg.contentDomain]}; - rval += foldHeader(header); - } - if(msg.dekInfo) { - header = {name: 'DEK-Info', values: [msg.dekInfo.algorithm]}; - if(msg.dekInfo.parameters) { - header.values.push(msg.dekInfo.parameters); - } - rval += foldHeader(header); - } - - if(msg.headers) { - // encode all other headers - for(var i = 0; i < msg.headers.length; ++i) { - rval += foldHeader(msg.headers[i]); - } - } - - // terminate header - if(msg.procType) { - rval += '\r\n'; - } - - // add body - rval += forge.util.encode64(msg.body, options.maxline || 64) + '\r\n'; - - rval += '-----END ' + msg.type + '-----\r\n'; - return rval; -}; - -/** - * Decodes (deserializes) all PEM messages found in the given string. - * - * @param str the PEM-formatted string to decode. - * - * @return the PEM message objects in an array. - */ -pem.decode = function(str) { - var rval = []; - - // split string into PEM messages (be lenient w/EOF on BEGIN line) - var rMessage = /\s*-----BEGIN ([A-Z0-9- ]+)-----\r?\n?([\x21-\x7e\s]+?(?:\r?\n\r?\n))?([:A-Za-z0-9+\/=\s]+?)-----END \1-----/g; - var rHeader = /([\x21-\x7e]+):\s*([\x21-\x7e\s^:]+)/; - var rCRLF = /\r?\n/; - var match; - while(true) { - match = rMessage.exec(str); - if(!match) { - break; - } - - // accept "NEW CERTIFICATE REQUEST" as "CERTIFICATE REQUEST" - // https://datatracker.ietf.org/doc/html/rfc7468#section-7 - var type = match[1]; - if(type === 'NEW CERTIFICATE REQUEST') { - type = 'CERTIFICATE REQUEST'; - } - - var msg = { - type: type, - procType: null, - contentDomain: null, - dekInfo: null, - headers: [], - body: forge.util.decode64(match[3]) - }; - rval.push(msg); - - // no headers - if(!match[2]) { - continue; - } - - // parse headers - var lines = match[2].split(rCRLF); - var li = 0; - while(match && li < lines.length) { - // get line, trim any rhs whitespace - var line = lines[li].replace(/\s+$/, ''); - - // RFC2822 unfold any following folded lines - for(var nl = li + 1; nl < lines.length; ++nl) { - var next = lines[nl]; - if(!/\s/.test(next[0])) { - break; - } - line += next; - li = nl; - } - - // parse header - match = line.match(rHeader); - if(match) { - var header = {name: match[1], values: []}; - var values = match[2].split(','); - for(var vi = 0; vi < values.length; ++vi) { - header.values.push(ltrim(values[vi])); - } - - // Proc-Type must be the first header - if(!msg.procType) { - if(header.name !== 'Proc-Type') { - throw new Error('Invalid PEM formatted message. The first ' + - 'encapsulated header must be "Proc-Type".'); - } else if(header.values.length !== 2) { - throw new Error('Invalid PEM formatted message. The "Proc-Type" ' + - 'header must have two subfields.'); - } - msg.procType = {version: values[0], type: values[1]}; - } else if(!msg.contentDomain && header.name === 'Content-Domain') { - // special-case Content-Domain - msg.contentDomain = values[0] || ''; - } else if(!msg.dekInfo && header.name === 'DEK-Info') { - // special-case DEK-Info - if(header.values.length === 0) { - throw new Error('Invalid PEM formatted message. The "DEK-Info" ' + - 'header must have at least one subfield.'); - } - msg.dekInfo = {algorithm: values[0], parameters: values[1] || null}; - } else { - msg.headers.push(header); - } - } - - ++li; - } - - if(msg.procType === 'ENCRYPTED' && !msg.dekInfo) { - throw new Error('Invalid PEM formatted message. The "DEK-Info" ' + - 'header must be present if "Proc-Type" is "ENCRYPTED".'); - } - } - - if(rval.length === 0) { - throw new Error('Invalid PEM formatted message.'); - } - - return rval; -}; - -function foldHeader(header) { - var rval = header.name + ': '; - - // ensure values with CRLF are folded - var values = []; - var insertSpace = function(match, $1) { - return ' ' + $1; - }; - for(var i = 0; i < header.values.length; ++i) { - values.push(header.values[i].replace(/^(\S+\r\n)/, insertSpace)); - } - rval += values.join(',') + '\r\n'; - - // do folding - var length = 0; - var candidate = -1; - for(var i = 0; i < rval.length; ++i, ++length) { - if(length > 65 && candidate !== -1) { - var insert = rval[candidate]; - if(insert === ',') { - ++candidate; - rval = rval.substr(0, candidate) + '\r\n ' + rval.substr(candidate); - } else { - rval = rval.substr(0, candidate) + - '\r\n' + insert + rval.substr(candidate + 1); - } - length = (i - candidate - 1); - candidate = -1; - ++i; - } else if(rval[i] === ' ' || rval[i] === '\t' || rval[i] === ',') { - candidate = i; - } - } - - return rval; -} - -function ltrim(str) { - return str.replace(/^\s+/, ''); -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/pkcs1.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/pkcs1.js deleted file mode 100644 index a3af9242..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/pkcs1.js +++ /dev/null @@ -1,276 +0,0 @@ -/** - * Partial implementation of PKCS#1 v2.2: RSA-OEAP - * - * Modified but based on the following MIT and BSD licensed code: - * - * https://github.com/kjur/jsjws/blob/master/rsa.js: - * - * The 'jsjws'(JSON Web Signature JavaScript Library) License - * - * Copyright (c) 2012 Kenji Urushima - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - * - * http://webrsa.cvs.sourceforge.net/viewvc/webrsa/Client/RSAES-OAEP.js?content-type=text%2Fplain: - * - * RSAES-OAEP.js - * $Id: RSAES-OAEP.js,v 1.1.1.1 2003/03/19 15:37:20 ellispritchard Exp $ - * JavaScript Implementation of PKCS #1 v2.1 RSA CRYPTOGRAPHY STANDARD (RSA Laboratories, June 14, 2002) - * Copyright (C) Ellis Pritchard, Guardian Unlimited 2003. - * Contact: ellis@nukinetics.com - * Distributed under the BSD License. - * - * Official documentation: http://www.rsa.com/rsalabs/node.asp?id=2125 - * - * @author Evan Jones (http://evanjones.ca/) - * @author Dave Longley - * - * Copyright (c) 2013-2014 Digital Bazaar, Inc. - */ -var forge = require('./forge'); -require('./util'); -require('./random'); -require('./sha1'); - -// shortcut for PKCS#1 API -var pkcs1 = module.exports = forge.pkcs1 = forge.pkcs1 || {}; - -/** - * Encode the given RSAES-OAEP message (M) using key, with optional label (L) - * and seed. - * - * This method does not perform RSA encryption, it only encodes the message - * using RSAES-OAEP. - * - * @param key the RSA key to use. - * @param message the message to encode. - * @param options the options to use: - * label an optional label to use. - * seed the seed to use. - * md the message digest object to use, undefined for SHA-1. - * mgf1 optional mgf1 parameters: - * md the message digest object to use for MGF1. - * - * @return the encoded message bytes. - */ -pkcs1.encode_rsa_oaep = function(key, message, options) { - // parse arguments - var label; - var seed; - var md; - var mgf1Md; - // legacy args (label, seed, md) - if(typeof options === 'string') { - label = options; - seed = arguments[3] || undefined; - md = arguments[4] || undefined; - } else if(options) { - label = options.label || undefined; - seed = options.seed || undefined; - md = options.md || undefined; - if(options.mgf1 && options.mgf1.md) { - mgf1Md = options.mgf1.md; - } - } - - // default OAEP to SHA-1 message digest - if(!md) { - md = forge.md.sha1.create(); - } else { - md.start(); - } - - // default MGF-1 to same as OAEP - if(!mgf1Md) { - mgf1Md = md; - } - - // compute length in bytes and check output - var keyLength = Math.ceil(key.n.bitLength() / 8); - var maxLength = keyLength - 2 * md.digestLength - 2; - if(message.length > maxLength) { - var error = new Error('RSAES-OAEP input message length is too long.'); - error.length = message.length; - error.maxLength = maxLength; - throw error; - } - - if(!label) { - label = ''; - } - md.update(label, 'raw'); - var lHash = md.digest(); - - var PS = ''; - var PS_length = maxLength - message.length; - for(var i = 0; i < PS_length; i++) { - PS += '\x00'; - } - - var DB = lHash.getBytes() + PS + '\x01' + message; - - if(!seed) { - seed = forge.random.getBytes(md.digestLength); - } else if(seed.length !== md.digestLength) { - var error = new Error('Invalid RSAES-OAEP seed. The seed length must ' + - 'match the digest length.'); - error.seedLength = seed.length; - error.digestLength = md.digestLength; - throw error; - } - - var dbMask = rsa_mgf1(seed, keyLength - md.digestLength - 1, mgf1Md); - var maskedDB = forge.util.xorBytes(DB, dbMask, DB.length); - - var seedMask = rsa_mgf1(maskedDB, md.digestLength, mgf1Md); - var maskedSeed = forge.util.xorBytes(seed, seedMask, seed.length); - - // return encoded message - return '\x00' + maskedSeed + maskedDB; -}; - -/** - * Decode the given RSAES-OAEP encoded message (EM) using key, with optional - * label (L). - * - * This method does not perform RSA decryption, it only decodes the message - * using RSAES-OAEP. - * - * @param key the RSA key to use. - * @param em the encoded message to decode. - * @param options the options to use: - * label an optional label to use. - * md the message digest object to use for OAEP, undefined for SHA-1. - * mgf1 optional mgf1 parameters: - * md the message digest object to use for MGF1. - * - * @return the decoded message bytes. - */ -pkcs1.decode_rsa_oaep = function(key, em, options) { - // parse args - var label; - var md; - var mgf1Md; - // legacy args - if(typeof options === 'string') { - label = options; - md = arguments[3] || undefined; - } else if(options) { - label = options.label || undefined; - md = options.md || undefined; - if(options.mgf1 && options.mgf1.md) { - mgf1Md = options.mgf1.md; - } - } - - // compute length in bytes - var keyLength = Math.ceil(key.n.bitLength() / 8); - - if(em.length !== keyLength) { - var error = new Error('RSAES-OAEP encoded message length is invalid.'); - error.length = em.length; - error.expectedLength = keyLength; - throw error; - } - - // default OAEP to SHA-1 message digest - if(md === undefined) { - md = forge.md.sha1.create(); - } else { - md.start(); - } - - // default MGF-1 to same as OAEP - if(!mgf1Md) { - mgf1Md = md; - } - - if(keyLength < 2 * md.digestLength + 2) { - throw new Error('RSAES-OAEP key is too short for the hash function.'); - } - - if(!label) { - label = ''; - } - md.update(label, 'raw'); - var lHash = md.digest().getBytes(); - - // split the message into its parts - var y = em.charAt(0); - var maskedSeed = em.substring(1, md.digestLength + 1); - var maskedDB = em.substring(1 + md.digestLength); - - var seedMask = rsa_mgf1(maskedDB, md.digestLength, mgf1Md); - var seed = forge.util.xorBytes(maskedSeed, seedMask, maskedSeed.length); - - var dbMask = rsa_mgf1(seed, keyLength - md.digestLength - 1, mgf1Md); - var db = forge.util.xorBytes(maskedDB, dbMask, maskedDB.length); - - var lHashPrime = db.substring(0, md.digestLength); - - // constant time check that all values match what is expected - var error = (y !== '\x00'); - - // constant time check lHash vs lHashPrime - for(var i = 0; i < md.digestLength; ++i) { - error |= (lHash.charAt(i) !== lHashPrime.charAt(i)); - } - - // "constant time" find the 0x1 byte separating the padding (zeros) from the - // message - // TODO: It must be possible to do this in a better/smarter way? - var in_ps = 1; - var index = md.digestLength; - for(var j = md.digestLength; j < db.length; j++) { - var code = db.charCodeAt(j); - - var is_0 = (code & 0x1) ^ 0x1; - - // non-zero if not 0 or 1 in the ps section - var error_mask = in_ps ? 0xfffe : 0x0000; - error |= (code & error_mask); - - // latch in_ps to zero after we find 0x1 - in_ps = in_ps & is_0; - index += in_ps; - } - - if(error || db.charCodeAt(index) !== 0x1) { - throw new Error('Invalid RSAES-OAEP padding.'); - } - - return db.substring(index + 1); -}; - -function rsa_mgf1(seed, maskLength, hash) { - // default to SHA-1 message digest - if(!hash) { - hash = forge.md.sha1.create(); - } - var t = ''; - var count = Math.ceil(maskLength / hash.digestLength); - for(var i = 0; i < count; ++i) { - var c = String.fromCharCode( - (i >> 24) & 0xFF, (i >> 16) & 0xFF, (i >> 8) & 0xFF, i & 0xFF); - hash.start(); - hash.update(seed + c); - t += hash.digest().getBytes(); - } - return t.substring(0, maskLength); -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/pkcs12.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/pkcs12.js deleted file mode 100644 index cd06c494..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/pkcs12.js +++ /dev/null @@ -1,1074 +0,0 @@ -/** - * Javascript implementation of PKCS#12. - * - * @author Dave Longley - * @author Stefan Siegl - * - * Copyright (c) 2010-2014 Digital Bazaar, Inc. - * Copyright (c) 2012 Stefan Siegl - * - * The ASN.1 representation of PKCS#12 is as follows - * (see ftp://ftp.rsasecurity.com/pub/pkcs/pkcs-12/pkcs-12-tc1.pdf for details) - * - * PFX ::= SEQUENCE { - * version INTEGER {v3(3)}(v3,...), - * authSafe ContentInfo, - * macData MacData OPTIONAL - * } - * - * MacData ::= SEQUENCE { - * mac DigestInfo, - * macSalt OCTET STRING, - * iterations INTEGER DEFAULT 1 - * } - * Note: The iterations default is for historical reasons and its use is - * deprecated. A higher value, like 1024, is recommended. - * - * DigestInfo is defined in PKCS#7 as follows: - * - * DigestInfo ::= SEQUENCE { - * digestAlgorithm DigestAlgorithmIdentifier, - * digest Digest - * } - * - * DigestAlgorithmIdentifier ::= AlgorithmIdentifier - * - * The AlgorithmIdentifier contains an Object Identifier (OID) and parameters - * for the algorithm, if any. In the case of SHA1 there is none. - * - * AlgorithmIdentifer ::= SEQUENCE { - * algorithm OBJECT IDENTIFIER, - * parameters ANY DEFINED BY algorithm OPTIONAL - * } - * - * Digest ::= OCTET STRING - * - * - * ContentInfo ::= SEQUENCE { - * contentType ContentType, - * content [0] EXPLICIT ANY DEFINED BY contentType OPTIONAL - * } - * - * ContentType ::= OBJECT IDENTIFIER - * - * AuthenticatedSafe ::= SEQUENCE OF ContentInfo - * -- Data if unencrypted - * -- EncryptedData if password-encrypted - * -- EnvelopedData if public key-encrypted - * - * - * SafeContents ::= SEQUENCE OF SafeBag - * - * SafeBag ::= SEQUENCE { - * bagId BAG-TYPE.&id ({PKCS12BagSet}) - * bagValue [0] EXPLICIT BAG-TYPE.&Type({PKCS12BagSet}{@bagId}), - * bagAttributes SET OF PKCS12Attribute OPTIONAL - * } - * - * PKCS12Attribute ::= SEQUENCE { - * attrId ATTRIBUTE.&id ({PKCS12AttrSet}), - * attrValues SET OF ATTRIBUTE.&Type ({PKCS12AttrSet}{@attrId}) - * } -- This type is compatible with the X.500 type 'Attribute' - * - * PKCS12AttrSet ATTRIBUTE ::= { - * friendlyName | -- from PKCS #9 - * localKeyId, -- from PKCS #9 - * ... -- Other attributes are allowed - * } - * - * CertBag ::= SEQUENCE { - * certId BAG-TYPE.&id ({CertTypes}), - * certValue [0] EXPLICIT BAG-TYPE.&Type ({CertTypes}{@certId}) - * } - * - * x509Certificate BAG-TYPE ::= {OCTET STRING IDENTIFIED BY {certTypes 1}} - * -- DER-encoded X.509 certificate stored in OCTET STRING - * - * sdsiCertificate BAG-TYPE ::= {IA5String IDENTIFIED BY {certTypes 2}} - * -- Base64-encoded SDSI certificate stored in IA5String - * - * CertTypes BAG-TYPE ::= { - * x509Certificate | - * sdsiCertificate, - * ... -- For future extensions - * } - */ -var forge = require('./forge'); -require('./asn1'); -require('./hmac'); -require('./oids'); -require('./pkcs7asn1'); -require('./pbe'); -require('./random'); -require('./rsa'); -require('./sha1'); -require('./util'); -require('./x509'); - -// shortcut for asn.1 & PKI API -var asn1 = forge.asn1; -var pki = forge.pki; - -// shortcut for PKCS#12 API -var p12 = module.exports = forge.pkcs12 = forge.pkcs12 || {}; - -var contentInfoValidator = { - name: 'ContentInfo', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, // a ContentInfo - constructed: true, - value: [{ - name: 'ContentInfo.contentType', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.OID, - constructed: false, - capture: 'contentType' - }, { - name: 'ContentInfo.content', - tagClass: asn1.Class.CONTEXT_SPECIFIC, - constructed: true, - captureAsn1: 'content' - }] -}; - -var pfxValidator = { - name: 'PFX', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - value: [{ - name: 'PFX.version', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.INTEGER, - constructed: false, - capture: 'version' - }, - contentInfoValidator, { - name: 'PFX.macData', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - optional: true, - captureAsn1: 'mac', - value: [{ - name: 'PFX.macData.mac', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, // DigestInfo - constructed: true, - value: [{ - name: 'PFX.macData.mac.digestAlgorithm', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, // DigestAlgorithmIdentifier - constructed: true, - value: [{ - name: 'PFX.macData.mac.digestAlgorithm.algorithm', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.OID, - constructed: false, - capture: 'macAlgorithm' - }, { - name: 'PFX.macData.mac.digestAlgorithm.parameters', - tagClass: asn1.Class.UNIVERSAL, - captureAsn1: 'macAlgorithmParameters' - }] - }, { - name: 'PFX.macData.mac.digest', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.OCTETSTRING, - constructed: false, - capture: 'macDigest' - }] - }, { - name: 'PFX.macData.macSalt', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.OCTETSTRING, - constructed: false, - capture: 'macSalt' - }, { - name: 'PFX.macData.iterations', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.INTEGER, - constructed: false, - optional: true, - capture: 'macIterations' - }] - }] -}; - -var safeBagValidator = { - name: 'SafeBag', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - value: [{ - name: 'SafeBag.bagId', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.OID, - constructed: false, - capture: 'bagId' - }, { - name: 'SafeBag.bagValue', - tagClass: asn1.Class.CONTEXT_SPECIFIC, - constructed: true, - captureAsn1: 'bagValue' - }, { - name: 'SafeBag.bagAttributes', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SET, - constructed: true, - optional: true, - capture: 'bagAttributes' - }] -}; - -var attributeValidator = { - name: 'Attribute', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - value: [{ - name: 'Attribute.attrId', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.OID, - constructed: false, - capture: 'oid' - }, { - name: 'Attribute.attrValues', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SET, - constructed: true, - capture: 'values' - }] -}; - -var certBagValidator = { - name: 'CertBag', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - value: [{ - name: 'CertBag.certId', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.OID, - constructed: false, - capture: 'certId' - }, { - name: 'CertBag.certValue', - tagClass: asn1.Class.CONTEXT_SPECIFIC, - constructed: true, - /* So far we only support X.509 certificates (which are wrapped in - an OCTET STRING, hence hard code that here). */ - value: [{ - name: 'CertBag.certValue[0]', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Class.OCTETSTRING, - constructed: false, - capture: 'cert' - }] - }] -}; - -/** - * Search SafeContents structure for bags with matching attributes. - * - * The search can optionally be narrowed by a certain bag type. - * - * @param safeContents the SafeContents structure to search in. - * @param attrName the name of the attribute to compare against. - * @param attrValue the attribute value to search for. - * @param [bagType] bag type to narrow search by. - * - * @return an array of matching bags. - */ -function _getBagsByAttribute(safeContents, attrName, attrValue, bagType) { - var result = []; - - for(var i = 0; i < safeContents.length; i++) { - for(var j = 0; j < safeContents[i].safeBags.length; j++) { - var bag = safeContents[i].safeBags[j]; - if(bagType !== undefined && bag.type !== bagType) { - continue; - } - // only filter by bag type, no attribute specified - if(attrName === null) { - result.push(bag); - continue; - } - if(bag.attributes[attrName] !== undefined && - bag.attributes[attrName].indexOf(attrValue) >= 0) { - result.push(bag); - } - } - } - - return result; -} - -/** - * Converts a PKCS#12 PFX in ASN.1 notation into a PFX object. - * - * @param obj The PKCS#12 PFX in ASN.1 notation. - * @param strict true to use strict DER decoding, false not to (default: true). - * @param {String} password Password to decrypt with (optional). - * - * @return PKCS#12 PFX object. - */ -p12.pkcs12FromAsn1 = function(obj, strict, password) { - // handle args - if(typeof strict === 'string') { - password = strict; - strict = true; - } else if(strict === undefined) { - strict = true; - } - - // validate PFX and capture data - var capture = {}; - var errors = []; - if(!asn1.validate(obj, pfxValidator, capture, errors)) { - var error = new Error('Cannot read PKCS#12 PFX. ' + - 'ASN.1 object is not an PKCS#12 PFX.'); - error.errors = error; - throw error; - } - - var pfx = { - version: capture.version.charCodeAt(0), - safeContents: [], - - /** - * Gets bags with matching attributes. - * - * @param filter the attributes to filter by: - * [localKeyId] the localKeyId to search for. - * [localKeyIdHex] the localKeyId in hex to search for. - * [friendlyName] the friendly name to search for. - * [bagType] bag type to narrow each attribute search by. - * - * @return a map of attribute type to an array of matching bags or, if no - * attribute was given but a bag type, the map key will be the - * bag type. - */ - getBags: function(filter) { - var rval = {}; - - var localKeyId; - if('localKeyId' in filter) { - localKeyId = filter.localKeyId; - } else if('localKeyIdHex' in filter) { - localKeyId = forge.util.hexToBytes(filter.localKeyIdHex); - } - - // filter on bagType only - if(localKeyId === undefined && !('friendlyName' in filter) && - 'bagType' in filter) { - rval[filter.bagType] = _getBagsByAttribute( - pfx.safeContents, null, null, filter.bagType); - } - - if(localKeyId !== undefined) { - rval.localKeyId = _getBagsByAttribute( - pfx.safeContents, 'localKeyId', - localKeyId, filter.bagType); - } - if('friendlyName' in filter) { - rval.friendlyName = _getBagsByAttribute( - pfx.safeContents, 'friendlyName', - filter.friendlyName, filter.bagType); - } - - return rval; - }, - - /** - * DEPRECATED: use getBags() instead. - * - * Get bags with matching friendlyName attribute. - * - * @param friendlyName the friendly name to search for. - * @param [bagType] bag type to narrow search by. - * - * @return an array of bags with matching friendlyName attribute. - */ - getBagsByFriendlyName: function(friendlyName, bagType) { - return _getBagsByAttribute( - pfx.safeContents, 'friendlyName', friendlyName, bagType); - }, - - /** - * DEPRECATED: use getBags() instead. - * - * Get bags with matching localKeyId attribute. - * - * @param localKeyId the localKeyId to search for. - * @param [bagType] bag type to narrow search by. - * - * @return an array of bags with matching localKeyId attribute. - */ - getBagsByLocalKeyId: function(localKeyId, bagType) { - return _getBagsByAttribute( - pfx.safeContents, 'localKeyId', localKeyId, bagType); - } - }; - - if(capture.version.charCodeAt(0) !== 3) { - var error = new Error('PKCS#12 PFX of version other than 3 not supported.'); - error.version = capture.version.charCodeAt(0); - throw error; - } - - if(asn1.derToOid(capture.contentType) !== pki.oids.data) { - var error = new Error('Only PKCS#12 PFX in password integrity mode supported.'); - error.oid = asn1.derToOid(capture.contentType); - throw error; - } - - var data = capture.content.value[0]; - if(data.tagClass !== asn1.Class.UNIVERSAL || - data.type !== asn1.Type.OCTETSTRING) { - throw new Error('PKCS#12 authSafe content data is not an OCTET STRING.'); - } - data = _decodePkcs7Data(data); - - // check for MAC - if(capture.mac) { - var md = null; - var macKeyBytes = 0; - var macAlgorithm = asn1.derToOid(capture.macAlgorithm); - switch(macAlgorithm) { - case pki.oids.sha1: - md = forge.md.sha1.create(); - macKeyBytes = 20; - break; - case pki.oids.sha256: - md = forge.md.sha256.create(); - macKeyBytes = 32; - break; - case pki.oids.sha384: - md = forge.md.sha384.create(); - macKeyBytes = 48; - break; - case pki.oids.sha512: - md = forge.md.sha512.create(); - macKeyBytes = 64; - break; - case pki.oids.md5: - md = forge.md.md5.create(); - macKeyBytes = 16; - break; - } - if(md === null) { - throw new Error('PKCS#12 uses unsupported MAC algorithm: ' + macAlgorithm); - } - - // verify MAC (iterations default to 1) - var macSalt = new forge.util.ByteBuffer(capture.macSalt); - var macIterations = (('macIterations' in capture) ? - parseInt(forge.util.bytesToHex(capture.macIterations), 16) : 1); - var macKey = p12.generateKey( - password, macSalt, 3, macIterations, macKeyBytes, md); - var mac = forge.hmac.create(); - mac.start(md, macKey); - mac.update(data.value); - var macValue = mac.getMac(); - if(macValue.getBytes() !== capture.macDigest) { - throw new Error('PKCS#12 MAC could not be verified. Invalid password?'); - } - } - - _decodeAuthenticatedSafe(pfx, data.value, strict, password); - return pfx; -}; - -/** - * Decodes PKCS#7 Data. PKCS#7 (RFC 2315) defines "Data" as an OCTET STRING, - * but it is sometimes an OCTET STRING that is composed/constructed of chunks, - * each its own OCTET STRING. This is BER-encoding vs. DER-encoding. This - * function transforms this corner-case into the usual simple, - * non-composed/constructed OCTET STRING. - * - * This function may be moved to ASN.1 at some point to better deal with - * more BER-encoding issues, should they arise. - * - * @param data the ASN.1 Data object to transform. - */ -function _decodePkcs7Data(data) { - // handle special case of "chunked" data content: an octet string composed - // of other octet strings - if(data.composed || data.constructed) { - var value = forge.util.createBuffer(); - for(var i = 0; i < data.value.length; ++i) { - value.putBytes(data.value[i].value); - } - data.composed = data.constructed = false; - data.value = value.getBytes(); - } - return data; -} - -/** - * Decode PKCS#12 AuthenticatedSafe (BER encoded) into PFX object. - * - * The AuthenticatedSafe is a BER-encoded SEQUENCE OF ContentInfo. - * - * @param pfx The PKCS#12 PFX object to fill. - * @param {String} authSafe BER-encoded AuthenticatedSafe. - * @param strict true to use strict DER decoding, false not to. - * @param {String} password Password to decrypt with (optional). - */ -function _decodeAuthenticatedSafe(pfx, authSafe, strict, password) { - authSafe = asn1.fromDer(authSafe, strict); /* actually it's BER encoded */ - - if(authSafe.tagClass !== asn1.Class.UNIVERSAL || - authSafe.type !== asn1.Type.SEQUENCE || - authSafe.constructed !== true) { - throw new Error('PKCS#12 AuthenticatedSafe expected to be a ' + - 'SEQUENCE OF ContentInfo'); - } - - for(var i = 0; i < authSafe.value.length; i++) { - var contentInfo = authSafe.value[i]; - - // validate contentInfo and capture data - var capture = {}; - var errors = []; - if(!asn1.validate(contentInfo, contentInfoValidator, capture, errors)) { - var error = new Error('Cannot read ContentInfo.'); - error.errors = errors; - throw error; - } - - var obj = { - encrypted: false - }; - var safeContents = null; - var data = capture.content.value[0]; - switch(asn1.derToOid(capture.contentType)) { - case pki.oids.data: - if(data.tagClass !== asn1.Class.UNIVERSAL || - data.type !== asn1.Type.OCTETSTRING) { - throw new Error('PKCS#12 SafeContents Data is not an OCTET STRING.'); - } - safeContents = _decodePkcs7Data(data).value; - break; - case pki.oids.encryptedData: - safeContents = _decryptSafeContents(data, password); - obj.encrypted = true; - break; - default: - var error = new Error('Unsupported PKCS#12 contentType.'); - error.contentType = asn1.derToOid(capture.contentType); - throw error; - } - - obj.safeBags = _decodeSafeContents(safeContents, strict, password); - pfx.safeContents.push(obj); - } -} - -/** - * Decrypt PKCS#7 EncryptedData structure. - * - * @param data ASN.1 encoded EncryptedContentInfo object. - * @param password The user-provided password. - * - * @return The decrypted SafeContents (ASN.1 object). - */ -function _decryptSafeContents(data, password) { - var capture = {}; - var errors = []; - if(!asn1.validate( - data, forge.pkcs7.asn1.encryptedDataValidator, capture, errors)) { - var error = new Error('Cannot read EncryptedContentInfo.'); - error.errors = errors; - throw error; - } - - var oid = asn1.derToOid(capture.contentType); - if(oid !== pki.oids.data) { - var error = new Error( - 'PKCS#12 EncryptedContentInfo ContentType is not Data.'); - error.oid = oid; - throw error; - } - - // get cipher - oid = asn1.derToOid(capture.encAlgorithm); - var cipher = pki.pbe.getCipher(oid, capture.encParameter, password); - - // get encrypted data - var encryptedContentAsn1 = _decodePkcs7Data(capture.encryptedContentAsn1); - var encrypted = forge.util.createBuffer(encryptedContentAsn1.value); - - cipher.update(encrypted); - if(!cipher.finish()) { - throw new Error('Failed to decrypt PKCS#12 SafeContents.'); - } - - return cipher.output.getBytes(); -} - -/** - * Decode PKCS#12 SafeContents (BER-encoded) into array of Bag objects. - * - * The safeContents is a BER-encoded SEQUENCE OF SafeBag. - * - * @param {String} safeContents BER-encoded safeContents. - * @param strict true to use strict DER decoding, false not to. - * @param {String} password Password to decrypt with (optional). - * - * @return {Array} Array of Bag objects. - */ -function _decodeSafeContents(safeContents, strict, password) { - // if strict and no safe contents, return empty safes - if(!strict && safeContents.length === 0) { - return []; - } - - // actually it's BER-encoded - safeContents = asn1.fromDer(safeContents, strict); - - if(safeContents.tagClass !== asn1.Class.UNIVERSAL || - safeContents.type !== asn1.Type.SEQUENCE || - safeContents.constructed !== true) { - throw new Error( - 'PKCS#12 SafeContents expected to be a SEQUENCE OF SafeBag.'); - } - - var res = []; - for(var i = 0; i < safeContents.value.length; i++) { - var safeBag = safeContents.value[i]; - - // validate SafeBag and capture data - var capture = {}; - var errors = []; - if(!asn1.validate(safeBag, safeBagValidator, capture, errors)) { - var error = new Error('Cannot read SafeBag.'); - error.errors = errors; - throw error; - } - - /* Create bag object and push to result array. */ - var bag = { - type: asn1.derToOid(capture.bagId), - attributes: _decodeBagAttributes(capture.bagAttributes) - }; - res.push(bag); - - var validator, decoder; - var bagAsn1 = capture.bagValue.value[0]; - switch(bag.type) { - case pki.oids.pkcs8ShroudedKeyBag: - /* bagAsn1 has a EncryptedPrivateKeyInfo, which we need to decrypt. - Afterwards we can handle it like a keyBag, - which is a PrivateKeyInfo. */ - bagAsn1 = pki.decryptPrivateKeyInfo(bagAsn1, password); - if(bagAsn1 === null) { - throw new Error( - 'Unable to decrypt PKCS#8 ShroudedKeyBag, wrong password?'); - } - - /* fall through */ - case pki.oids.keyBag: - /* A PKCS#12 keyBag is a simple PrivateKeyInfo as understood by our - PKI module, hence we don't have to do validation/capturing here, - just pass what we already got. */ - try { - bag.key = pki.privateKeyFromAsn1(bagAsn1); - } catch(e) { - // ignore unknown key type, pass asn1 value - bag.key = null; - bag.asn1 = bagAsn1; - } - continue; /* Nothing more to do. */ - - case pki.oids.certBag: - /* A PKCS#12 certBag can wrap both X.509 and sdsi certificates. - Therefore put the SafeBag content through another validator to - capture the fields. Afterwards check & store the results. */ - validator = certBagValidator; - decoder = function() { - if(asn1.derToOid(capture.certId) !== pki.oids.x509Certificate) { - var error = new Error( - 'Unsupported certificate type, only X.509 supported.'); - error.oid = asn1.derToOid(capture.certId); - throw error; - } - - // true=produce cert hash - var certAsn1 = asn1.fromDer(capture.cert, strict); - try { - bag.cert = pki.certificateFromAsn1(certAsn1, true); - } catch(e) { - // ignore unknown cert type, pass asn1 value - bag.cert = null; - bag.asn1 = certAsn1; - } - }; - break; - - default: - var error = new Error('Unsupported PKCS#12 SafeBag type.'); - error.oid = bag.type; - throw error; - } - - /* Validate SafeBag value (i.e. CertBag, etc.) and capture data if needed. */ - if(validator !== undefined && - !asn1.validate(bagAsn1, validator, capture, errors)) { - var error = new Error('Cannot read PKCS#12 ' + validator.name); - error.errors = errors; - throw error; - } - - /* Call decoder function from above to store the results. */ - decoder(); - } - - return res; -} - -/** - * Decode PKCS#12 SET OF PKCS12Attribute into JavaScript object. - * - * @param attributes SET OF PKCS12Attribute (ASN.1 object). - * - * @return the decoded attributes. - */ -function _decodeBagAttributes(attributes) { - var decodedAttrs = {}; - - if(attributes !== undefined) { - for(var i = 0; i < attributes.length; ++i) { - var capture = {}; - var errors = []; - if(!asn1.validate(attributes[i], attributeValidator, capture, errors)) { - var error = new Error('Cannot read PKCS#12 BagAttribute.'); - error.errors = errors; - throw error; - } - - var oid = asn1.derToOid(capture.oid); - if(pki.oids[oid] === undefined) { - // unsupported attribute type, ignore. - continue; - } - - decodedAttrs[pki.oids[oid]] = []; - for(var j = 0; j < capture.values.length; ++j) { - decodedAttrs[pki.oids[oid]].push(capture.values[j].value); - } - } - } - - return decodedAttrs; -} - -/** - * Wraps a private key and certificate in a PKCS#12 PFX wrapper. If a - * password is provided then the private key will be encrypted. - * - * An entire certificate chain may also be included. To do this, pass - * an array for the "cert" parameter where the first certificate is - * the one that is paired with the private key and each subsequent one - * verifies the previous one. The certificates may be in PEM format or - * have been already parsed by Forge. - * - * @todo implement password-based-encryption for the whole package - * - * @param key the private key. - * @param cert the certificate (may be an array of certificates in order - * to specify a certificate chain). - * @param password the password to use, null for none. - * @param options: - * algorithm the encryption algorithm to use - * ('aes128', 'aes192', 'aes256', '3des'), defaults to 'aes128'. - * count the iteration count to use. - * saltSize the salt size to use. - * useMac true to include a MAC, false not to, defaults to true. - * localKeyId the local key ID to use, in hex. - * friendlyName the friendly name to use. - * generateLocalKeyId true to generate a random local key ID, - * false not to, defaults to true. - * - * @return the PKCS#12 PFX ASN.1 object. - */ -p12.toPkcs12Asn1 = function(key, cert, password, options) { - // set default options - options = options || {}; - options.saltSize = options.saltSize || 8; - options.count = options.count || 2048; - options.algorithm = options.algorithm || options.encAlgorithm || 'aes128'; - if(!('useMac' in options)) { - options.useMac = true; - } - if(!('localKeyId' in options)) { - options.localKeyId = null; - } - if(!('generateLocalKeyId' in options)) { - options.generateLocalKeyId = true; - } - - var localKeyId = options.localKeyId; - var bagAttrs; - if(localKeyId !== null) { - localKeyId = forge.util.hexToBytes(localKeyId); - } else if(options.generateLocalKeyId) { - // use SHA-1 of paired cert, if available - if(cert) { - var pairedCert = forge.util.isArray(cert) ? cert[0] : cert; - if(typeof pairedCert === 'string') { - pairedCert = pki.certificateFromPem(pairedCert); - } - var sha1 = forge.md.sha1.create(); - sha1.update(asn1.toDer(pki.certificateToAsn1(pairedCert)).getBytes()); - localKeyId = sha1.digest().getBytes(); - } else { - // FIXME: consider using SHA-1 of public key (which can be generated - // from private key components), see: cert.generateSubjectKeyIdentifier - // generate random bytes - localKeyId = forge.random.getBytes(20); - } - } - - var attrs = []; - if(localKeyId !== null) { - attrs.push( - // localKeyID - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // attrId - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false, - asn1.oidToDer(pki.oids.localKeyId).getBytes()), - // attrValues - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SET, true, [ - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false, - localKeyId) - ]) - ])); - } - if('friendlyName' in options) { - attrs.push( - // friendlyName - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // attrId - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false, - asn1.oidToDer(pki.oids.friendlyName).getBytes()), - // attrValues - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SET, true, [ - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.BMPSTRING, false, - options.friendlyName) - ]) - ])); - } - - if(attrs.length > 0) { - bagAttrs = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SET, true, attrs); - } - - // collect contents for AuthenticatedSafe - var contents = []; - - // create safe bag(s) for certificate chain - var chain = []; - if(cert !== null) { - if(forge.util.isArray(cert)) { - chain = cert; - } else { - chain = [cert]; - } - } - - var certSafeBags = []; - for(var i = 0; i < chain.length; ++i) { - // convert cert from PEM as necessary - cert = chain[i]; - if(typeof cert === 'string') { - cert = pki.certificateFromPem(cert); - } - - // SafeBag - var certBagAttrs = (i === 0) ? bagAttrs : undefined; - var certAsn1 = pki.certificateToAsn1(cert); - var certSafeBag = - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // bagId - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false, - asn1.oidToDer(pki.oids.certBag).getBytes()), - // bagValue - asn1.create(asn1.Class.CONTEXT_SPECIFIC, 0, true, [ - // CertBag - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // certId - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false, - asn1.oidToDer(pki.oids.x509Certificate).getBytes()), - // certValue (x509Certificate) - asn1.create(asn1.Class.CONTEXT_SPECIFIC, 0, true, [ - asn1.create( - asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false, - asn1.toDer(certAsn1).getBytes()) - ])])]), - // bagAttributes (OPTIONAL) - certBagAttrs - ]); - certSafeBags.push(certSafeBag); - } - - if(certSafeBags.length > 0) { - // SafeContents - var certSafeContents = asn1.create( - asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, certSafeBags); - - // ContentInfo - var certCI = - // PKCS#7 ContentInfo - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // contentType - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false, - // OID for the content type is 'data' - asn1.oidToDer(pki.oids.data).getBytes()), - // content - asn1.create(asn1.Class.CONTEXT_SPECIFIC, 0, true, [ - asn1.create( - asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false, - asn1.toDer(certSafeContents).getBytes()) - ]) - ]); - contents.push(certCI); - } - - // create safe contents for private key - var keyBag = null; - if(key !== null) { - // SafeBag - var pkAsn1 = pki.wrapRsaPrivateKey(pki.privateKeyToAsn1(key)); - if(password === null) { - // no encryption - keyBag = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // bagId - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false, - asn1.oidToDer(pki.oids.keyBag).getBytes()), - // bagValue - asn1.create(asn1.Class.CONTEXT_SPECIFIC, 0, true, [ - // PrivateKeyInfo - pkAsn1 - ]), - // bagAttributes (OPTIONAL) - bagAttrs - ]); - } else { - // encrypted PrivateKeyInfo - keyBag = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // bagId - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false, - asn1.oidToDer(pki.oids.pkcs8ShroudedKeyBag).getBytes()), - // bagValue - asn1.create(asn1.Class.CONTEXT_SPECIFIC, 0, true, [ - // EncryptedPrivateKeyInfo - pki.encryptPrivateKeyInfo(pkAsn1, password, options) - ]), - // bagAttributes (OPTIONAL) - bagAttrs - ]); - } - - // SafeContents - var keySafeContents = - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [keyBag]); - - // ContentInfo - var keyCI = - // PKCS#7 ContentInfo - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // contentType - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false, - // OID for the content type is 'data' - asn1.oidToDer(pki.oids.data).getBytes()), - // content - asn1.create(asn1.Class.CONTEXT_SPECIFIC, 0, true, [ - asn1.create( - asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false, - asn1.toDer(keySafeContents).getBytes()) - ]) - ]); - contents.push(keyCI); - } - - // create AuthenticatedSafe by stringing together the contents - var safe = asn1.create( - asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, contents); - - var macData; - if(options.useMac) { - // MacData - var sha1 = forge.md.sha1.create(); - var macSalt = new forge.util.ByteBuffer( - forge.random.getBytes(options.saltSize)); - var count = options.count; - // 160-bit key - var key = p12.generateKey(password, macSalt, 3, count, 20); - var mac = forge.hmac.create(); - mac.start(sha1, key); - mac.update(asn1.toDer(safe).getBytes()); - var macValue = mac.getMac(); - macData = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // mac DigestInfo - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // digestAlgorithm - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // algorithm = SHA-1 - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false, - asn1.oidToDer(pki.oids.sha1).getBytes()), - // parameters = Null - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.NULL, false, '') - ]), - // digest - asn1.create( - asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, - false, macValue.getBytes()) - ]), - // macSalt OCTET STRING - asn1.create( - asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false, macSalt.getBytes()), - // iterations INTEGER (XXX: Only support count < 65536) - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, - asn1.integerToDer(count).getBytes() - ) - ]); - } - - // PFX - return asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // version (3) - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, - asn1.integerToDer(3).getBytes()), - // PKCS#7 ContentInfo - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // contentType - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false, - // OID for the content type is 'data' - asn1.oidToDer(pki.oids.data).getBytes()), - // content - asn1.create(asn1.Class.CONTEXT_SPECIFIC, 0, true, [ - asn1.create( - asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false, - asn1.toDer(safe).getBytes()) - ]) - ]), - macData - ]); -}; - -/** - * Derives a PKCS#12 key. - * - * @param password the password to derive the key material from, null or - * undefined for none. - * @param salt the salt, as a ByteBuffer, to use. - * @param id the PKCS#12 ID byte (1 = key material, 2 = IV, 3 = MAC). - * @param iter the iteration count. - * @param n the number of bytes to derive from the password. - * @param md the message digest to use, defaults to SHA-1. - * - * @return a ByteBuffer with the bytes derived from the password. - */ -p12.generateKey = forge.pbe.generatePkcs12Key; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/pkcs7.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/pkcs7.js deleted file mode 100644 index 3a5d845c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/pkcs7.js +++ /dev/null @@ -1,1260 +0,0 @@ -/** - * Javascript implementation of PKCS#7 v1.5. - * - * @author Stefan Siegl - * @author Dave Longley - * - * Copyright (c) 2012 Stefan Siegl - * Copyright (c) 2012-2015 Digital Bazaar, Inc. - * - * Currently this implementation only supports ContentType of EnvelopedData, - * EncryptedData, or SignedData at the root level. The top level elements may - * contain only a ContentInfo of ContentType Data, i.e. plain data. Further - * nesting is not (yet) supported. - * - * The Forge validators for PKCS #7's ASN.1 structures are available from - * a separate file pkcs7asn1.js, since those are referenced from other - * PKCS standards like PKCS #12. - */ -var forge = require('./forge'); -require('./aes'); -require('./asn1'); -require('./des'); -require('./oids'); -require('./pem'); -require('./pkcs7asn1'); -require('./random'); -require('./util'); -require('./x509'); - -// shortcut for ASN.1 API -var asn1 = forge.asn1; - -// shortcut for PKCS#7 API -var p7 = module.exports = forge.pkcs7 = forge.pkcs7 || {}; - -/** - * Converts a PKCS#7 message from PEM format. - * - * @param pem the PEM-formatted PKCS#7 message. - * - * @return the PKCS#7 message. - */ -p7.messageFromPem = function(pem) { - var msg = forge.pem.decode(pem)[0]; - - if(msg.type !== 'PKCS7') { - var error = new Error('Could not convert PKCS#7 message from PEM; PEM ' + - 'header type is not "PKCS#7".'); - error.headerType = msg.type; - throw error; - } - if(msg.procType && msg.procType.type === 'ENCRYPTED') { - throw new Error('Could not convert PKCS#7 message from PEM; PEM is encrypted.'); - } - - // convert DER to ASN.1 object - var obj = asn1.fromDer(msg.body); - - return p7.messageFromAsn1(obj); -}; - -/** - * Converts a PKCS#7 message to PEM format. - * - * @param msg The PKCS#7 message object - * @param maxline The maximum characters per line, defaults to 64. - * - * @return The PEM-formatted PKCS#7 message. - */ -p7.messageToPem = function(msg, maxline) { - // convert to ASN.1, then DER, then PEM-encode - var pemObj = { - type: 'PKCS7', - body: asn1.toDer(msg.toAsn1()).getBytes() - }; - return forge.pem.encode(pemObj, {maxline: maxline}); -}; - -/** - * Converts a PKCS#7 message from an ASN.1 object. - * - * @param obj the ASN.1 representation of a ContentInfo. - * - * @return the PKCS#7 message. - */ -p7.messageFromAsn1 = function(obj) { - // validate root level ContentInfo and capture data - var capture = {}; - var errors = []; - if(!asn1.validate(obj, p7.asn1.contentInfoValidator, capture, errors)) { - var error = new Error('Cannot read PKCS#7 message. ' + - 'ASN.1 object is not an PKCS#7 ContentInfo.'); - error.errors = errors; - throw error; - } - - var contentType = asn1.derToOid(capture.contentType); - var msg; - - switch(contentType) { - case forge.pki.oids.envelopedData: - msg = p7.createEnvelopedData(); - break; - - case forge.pki.oids.encryptedData: - msg = p7.createEncryptedData(); - break; - - case forge.pki.oids.signedData: - msg = p7.createSignedData(); - break; - - default: - throw new Error('Cannot read PKCS#7 message. ContentType with OID ' + - contentType + ' is not (yet) supported.'); - } - - msg.fromAsn1(capture.content.value[0]); - return msg; -}; - -p7.createSignedData = function() { - var msg = null; - msg = { - type: forge.pki.oids.signedData, - version: 1, - certificates: [], - crls: [], - // TODO: add json-formatted signer stuff here? - signers: [], - // populated during sign() - digestAlgorithmIdentifiers: [], - contentInfo: null, - signerInfos: [], - - fromAsn1: function(obj) { - // validate SignedData content block and capture data. - _fromAsn1(msg, obj, p7.asn1.signedDataValidator); - msg.certificates = []; - msg.crls = []; - msg.digestAlgorithmIdentifiers = []; - msg.contentInfo = null; - msg.signerInfos = []; - - if(msg.rawCapture.certificates) { - var certs = msg.rawCapture.certificates.value; - for(var i = 0; i < certs.length; ++i) { - msg.certificates.push(forge.pki.certificateFromAsn1(certs[i])); - } - } - - // TODO: parse crls - }, - - toAsn1: function() { - // degenerate case with no content - if(!msg.contentInfo) { - msg.sign(); - } - - var certs = []; - for(var i = 0; i < msg.certificates.length; ++i) { - certs.push(forge.pki.certificateToAsn1(msg.certificates[i])); - } - - var crls = []; - // TODO: implement CRLs - - // [0] SignedData - var signedData = asn1.create(asn1.Class.CONTEXT_SPECIFIC, 0, true, [ - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // Version - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, - asn1.integerToDer(msg.version).getBytes()), - // DigestAlgorithmIdentifiers - asn1.create( - asn1.Class.UNIVERSAL, asn1.Type.SET, true, - msg.digestAlgorithmIdentifiers), - // ContentInfo - msg.contentInfo - ]) - ]); - if(certs.length > 0) { - // [0] IMPLICIT ExtendedCertificatesAndCertificates OPTIONAL - signedData.value[0].value.push( - asn1.create(asn1.Class.CONTEXT_SPECIFIC, 0, true, certs)); - } - if(crls.length > 0) { - // [1] IMPLICIT CertificateRevocationLists OPTIONAL - signedData.value[0].value.push( - asn1.create(asn1.Class.CONTEXT_SPECIFIC, 1, true, crls)); - } - // SignerInfos - signedData.value[0].value.push( - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SET, true, - msg.signerInfos)); - - // ContentInfo - return asn1.create( - asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // ContentType - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false, - asn1.oidToDer(msg.type).getBytes()), - // [0] SignedData - signedData - ]); - }, - - /** - * Add (another) entity to list of signers. - * - * Note: If authenticatedAttributes are provided, then, per RFC 2315, - * they must include at least two attributes: content type and - * message digest. The message digest attribute value will be - * auto-calculated during signing and will be ignored if provided. - * - * Here's an example of providing these two attributes: - * - * forge.pkcs7.createSignedData(); - * p7.addSigner({ - * issuer: cert.issuer.attributes, - * serialNumber: cert.serialNumber, - * key: privateKey, - * digestAlgorithm: forge.pki.oids.sha1, - * authenticatedAttributes: [{ - * type: forge.pki.oids.contentType, - * value: forge.pki.oids.data - * }, { - * type: forge.pki.oids.messageDigest - * }] - * }); - * - * TODO: Support [subjectKeyIdentifier] as signer's ID. - * - * @param signer the signer information: - * key the signer's private key. - * [certificate] a certificate containing the public key - * associated with the signer's private key; use this option as - * an alternative to specifying signer.issuer and - * signer.serialNumber. - * [issuer] the issuer attributes (eg: cert.issuer.attributes). - * [serialNumber] the signer's certificate's serial number in - * hexadecimal (eg: cert.serialNumber). - * [digestAlgorithm] the message digest OID, as a string, to use - * (eg: forge.pki.oids.sha1). - * [authenticatedAttributes] an optional array of attributes - * to also sign along with the content. - */ - addSigner: function(signer) { - var issuer = signer.issuer; - var serialNumber = signer.serialNumber; - if(signer.certificate) { - var cert = signer.certificate; - if(typeof cert === 'string') { - cert = forge.pki.certificateFromPem(cert); - } - issuer = cert.issuer.attributes; - serialNumber = cert.serialNumber; - } - var key = signer.key; - if(!key) { - throw new Error( - 'Could not add PKCS#7 signer; no private key specified.'); - } - if(typeof key === 'string') { - key = forge.pki.privateKeyFromPem(key); - } - - // ensure OID known for digest algorithm - var digestAlgorithm = signer.digestAlgorithm || forge.pki.oids.sha1; - switch(digestAlgorithm) { - case forge.pki.oids.sha1: - case forge.pki.oids.sha256: - case forge.pki.oids.sha384: - case forge.pki.oids.sha512: - case forge.pki.oids.md5: - break; - default: - throw new Error( - 'Could not add PKCS#7 signer; unknown message digest algorithm: ' + - digestAlgorithm); - } - - // if authenticatedAttributes is present, then the attributes - // must contain at least PKCS #9 content-type and message-digest - var authenticatedAttributes = signer.authenticatedAttributes || []; - if(authenticatedAttributes.length > 0) { - var contentType = false; - var messageDigest = false; - for(var i = 0; i < authenticatedAttributes.length; ++i) { - var attr = authenticatedAttributes[i]; - if(!contentType && attr.type === forge.pki.oids.contentType) { - contentType = true; - if(messageDigest) { - break; - } - continue; - } - if(!messageDigest && attr.type === forge.pki.oids.messageDigest) { - messageDigest = true; - if(contentType) { - break; - } - continue; - } - } - - if(!contentType || !messageDigest) { - throw new Error('Invalid signer.authenticatedAttributes. If ' + - 'signer.authenticatedAttributes is specified, then it must ' + - 'contain at least two attributes, PKCS #9 content-type and ' + - 'PKCS #9 message-digest.'); - } - } - - msg.signers.push({ - key: key, - version: 1, - issuer: issuer, - serialNumber: serialNumber, - digestAlgorithm: digestAlgorithm, - signatureAlgorithm: forge.pki.oids.rsaEncryption, - signature: null, - authenticatedAttributes: authenticatedAttributes, - unauthenticatedAttributes: [] - }); - }, - - /** - * Signs the content. - * @param options Options to apply when signing: - * [detached] boolean. If signing should be done in detached mode. Defaults to false. - */ - sign: function(options) { - options = options || {}; - // auto-generate content info - if(typeof msg.content !== 'object' || msg.contentInfo === null) { - // use Data ContentInfo - msg.contentInfo = asn1.create( - asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // ContentType - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false, - asn1.oidToDer(forge.pki.oids.data).getBytes()) - ]); - - // add actual content, if present - if('content' in msg) { - var content; - if(msg.content instanceof forge.util.ByteBuffer) { - content = msg.content.bytes(); - } else if(typeof msg.content === 'string') { - content = forge.util.encodeUtf8(msg.content); - } - - if (options.detached) { - msg.detachedContent = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false, content); - } else { - msg.contentInfo.value.push( - // [0] EXPLICIT content - asn1.create(asn1.Class.CONTEXT_SPECIFIC, 0, true, [ - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false, - content) - ])); - } - } - } - - // no signers, return early (degenerate case for certificate container) - if(msg.signers.length === 0) { - return; - } - - // generate digest algorithm identifiers - var mds = addDigestAlgorithmIds(); - - // generate signerInfos - addSignerInfos(mds); - }, - - verify: function() { - throw new Error('PKCS#7 signature verification not yet implemented.'); - }, - - /** - * Add a certificate. - * - * @param cert the certificate to add. - */ - addCertificate: function(cert) { - // convert from PEM - if(typeof cert === 'string') { - cert = forge.pki.certificateFromPem(cert); - } - msg.certificates.push(cert); - }, - - /** - * Add a certificate revokation list. - * - * @param crl the certificate revokation list to add. - */ - addCertificateRevokationList: function(crl) { - throw new Error('PKCS#7 CRL support not yet implemented.'); - } - }; - return msg; - - function addDigestAlgorithmIds() { - var mds = {}; - - for(var i = 0; i < msg.signers.length; ++i) { - var signer = msg.signers[i]; - var oid = signer.digestAlgorithm; - if(!(oid in mds)) { - // content digest - mds[oid] = forge.md[forge.pki.oids[oid]].create(); - } - if(signer.authenticatedAttributes.length === 0) { - // no custom attributes to digest; use content message digest - signer.md = mds[oid]; - } else { - // custom attributes to be digested; use own message digest - // TODO: optimize to just copy message digest state if that - // feature is ever supported with message digests - signer.md = forge.md[forge.pki.oids[oid]].create(); - } - } - - // add unique digest algorithm identifiers - msg.digestAlgorithmIdentifiers = []; - for(var oid in mds) { - msg.digestAlgorithmIdentifiers.push( - // AlgorithmIdentifier - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // algorithm - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false, - asn1.oidToDer(oid).getBytes()), - // parameters (null) - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.NULL, false, '') - ])); - } - - return mds; - } - - function addSignerInfos(mds) { - var content; - - if (msg.detachedContent) { - // Signature has been made in detached mode. - content = msg.detachedContent; - } else { - // Note: ContentInfo is a SEQUENCE with 2 values, second value is - // the content field and is optional for a ContentInfo but required here - // since signers are present - // get ContentInfo content - content = msg.contentInfo.value[1]; - // skip [0] EXPLICIT content wrapper - content = content.value[0]; - } - - if(!content) { - throw new Error( - 'Could not sign PKCS#7 message; there is no content to sign.'); - } - - // get ContentInfo content type - var contentType = asn1.derToOid(msg.contentInfo.value[0].value); - - // serialize content - var bytes = asn1.toDer(content); - - // skip identifier and length per RFC 2315 9.3 - // skip identifier (1 byte) - bytes.getByte(); - // read and discard length bytes - asn1.getBerValueLength(bytes); - bytes = bytes.getBytes(); - - // digest content DER value bytes - for(var oid in mds) { - mds[oid].start().update(bytes); - } - - // sign content - var signingTime = new Date(); - for(var i = 0; i < msg.signers.length; ++i) { - var signer = msg.signers[i]; - - if(signer.authenticatedAttributes.length === 0) { - // if ContentInfo content type is not "Data", then - // authenticatedAttributes must be present per RFC 2315 - if(contentType !== forge.pki.oids.data) { - throw new Error( - 'Invalid signer; authenticatedAttributes must be present ' + - 'when the ContentInfo content type is not PKCS#7 Data.'); - } - } else { - // process authenticated attributes - // [0] IMPLICIT - signer.authenticatedAttributesAsn1 = asn1.create( - asn1.Class.CONTEXT_SPECIFIC, 0, true, []); - - // per RFC 2315, attributes are to be digested using a SET container - // not the above [0] IMPLICIT container - var attrsAsn1 = asn1.create( - asn1.Class.UNIVERSAL, asn1.Type.SET, true, []); - - for(var ai = 0; ai < signer.authenticatedAttributes.length; ++ai) { - var attr = signer.authenticatedAttributes[ai]; - if(attr.type === forge.pki.oids.messageDigest) { - // use content message digest as value - attr.value = mds[signer.digestAlgorithm].digest(); - } else if(attr.type === forge.pki.oids.signingTime) { - // auto-populate signing time if not already set - if(!attr.value) { - attr.value = signingTime; - } - } - - // convert to ASN.1 and push onto Attributes SET (for signing) and - // onto authenticatedAttributesAsn1 to complete SignedData ASN.1 - // TODO: optimize away duplication - attrsAsn1.value.push(_attributeToAsn1(attr)); - signer.authenticatedAttributesAsn1.value.push(_attributeToAsn1(attr)); - } - - // DER-serialize and digest SET OF attributes only - bytes = asn1.toDer(attrsAsn1).getBytes(); - signer.md.start().update(bytes); - } - - // sign digest - signer.signature = signer.key.sign(signer.md, 'RSASSA-PKCS1-V1_5'); - } - - // add signer info - msg.signerInfos = _signersToAsn1(msg.signers); - } -}; - -/** - * Creates an empty PKCS#7 message of type EncryptedData. - * - * @return the message. - */ -p7.createEncryptedData = function() { - var msg = null; - msg = { - type: forge.pki.oids.encryptedData, - version: 0, - encryptedContent: { - algorithm: forge.pki.oids['aes256-CBC'] - }, - - /** - * Reads an EncryptedData content block (in ASN.1 format) - * - * @param obj The ASN.1 representation of the EncryptedData content block - */ - fromAsn1: function(obj) { - // Validate EncryptedData content block and capture data. - _fromAsn1(msg, obj, p7.asn1.encryptedDataValidator); - }, - - /** - * Decrypt encrypted content - * - * @param key The (symmetric) key as a byte buffer - */ - decrypt: function(key) { - if(key !== undefined) { - msg.encryptedContent.key = key; - } - _decryptContent(msg); - } - }; - return msg; -}; - -/** - * Creates an empty PKCS#7 message of type EnvelopedData. - * - * @return the message. - */ -p7.createEnvelopedData = function() { - var msg = null; - msg = { - type: forge.pki.oids.envelopedData, - version: 0, - recipients: [], - encryptedContent: { - algorithm: forge.pki.oids['aes256-CBC'] - }, - - /** - * Reads an EnvelopedData content block (in ASN.1 format) - * - * @param obj the ASN.1 representation of the EnvelopedData content block. - */ - fromAsn1: function(obj) { - // validate EnvelopedData content block and capture data - var capture = _fromAsn1(msg, obj, p7.asn1.envelopedDataValidator); - msg.recipients = _recipientsFromAsn1(capture.recipientInfos.value); - }, - - toAsn1: function() { - // ContentInfo - return asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // ContentType - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false, - asn1.oidToDer(msg.type).getBytes()), - // [0] EnvelopedData - asn1.create(asn1.Class.CONTEXT_SPECIFIC, 0, true, [ - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // Version - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, - asn1.integerToDer(msg.version).getBytes()), - // RecipientInfos - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SET, true, - _recipientsToAsn1(msg.recipients)), - // EncryptedContentInfo - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, - _encryptedContentToAsn1(msg.encryptedContent)) - ]) - ]) - ]); - }, - - /** - * Find recipient by X.509 certificate's issuer. - * - * @param cert the certificate with the issuer to look for. - * - * @return the recipient object. - */ - findRecipient: function(cert) { - var sAttr = cert.issuer.attributes; - - for(var i = 0; i < msg.recipients.length; ++i) { - var r = msg.recipients[i]; - var rAttr = r.issuer; - - if(r.serialNumber !== cert.serialNumber) { - continue; - } - - if(rAttr.length !== sAttr.length) { - continue; - } - - var match = true; - for(var j = 0; j < sAttr.length; ++j) { - if(rAttr[j].type !== sAttr[j].type || - rAttr[j].value !== sAttr[j].value) { - match = false; - break; - } - } - - if(match) { - return r; - } - } - - return null; - }, - - /** - * Decrypt enveloped content - * - * @param recipient The recipient object related to the private key - * @param privKey The (RSA) private key object - */ - decrypt: function(recipient, privKey) { - if(msg.encryptedContent.key === undefined && recipient !== undefined && - privKey !== undefined) { - switch(recipient.encryptedContent.algorithm) { - case forge.pki.oids.rsaEncryption: - case forge.pki.oids.desCBC: - var key = privKey.decrypt(recipient.encryptedContent.content); - msg.encryptedContent.key = forge.util.createBuffer(key); - break; - - default: - throw new Error('Unsupported asymmetric cipher, ' + - 'OID ' + recipient.encryptedContent.algorithm); - } - } - - _decryptContent(msg); - }, - - /** - * Add (another) entity to list of recipients. - * - * @param cert The certificate of the entity to add. - */ - addRecipient: function(cert) { - msg.recipients.push({ - version: 0, - issuer: cert.issuer.attributes, - serialNumber: cert.serialNumber, - encryptedContent: { - // We simply assume rsaEncryption here, since forge.pki only - // supports RSA so far. If the PKI module supports other - // ciphers one day, we need to modify this one as well. - algorithm: forge.pki.oids.rsaEncryption, - key: cert.publicKey - } - }); - }, - - /** - * Encrypt enveloped content. - * - * This function supports two optional arguments, cipher and key, which - * can be used to influence symmetric encryption. Unless cipher is - * provided, the cipher specified in encryptedContent.algorithm is used - * (defaults to AES-256-CBC). If no key is provided, encryptedContent.key - * is (re-)used. If that one's not set, a random key will be generated - * automatically. - * - * @param [key] The key to be used for symmetric encryption. - * @param [cipher] The OID of the symmetric cipher to use. - */ - encrypt: function(key, cipher) { - // Part 1: Symmetric encryption - if(msg.encryptedContent.content === undefined) { - cipher = cipher || msg.encryptedContent.algorithm; - key = key || msg.encryptedContent.key; - - var keyLen, ivLen, ciphFn; - switch(cipher) { - case forge.pki.oids['aes128-CBC']: - keyLen = 16; - ivLen = 16; - ciphFn = forge.aes.createEncryptionCipher; - break; - - case forge.pki.oids['aes192-CBC']: - keyLen = 24; - ivLen = 16; - ciphFn = forge.aes.createEncryptionCipher; - break; - - case forge.pki.oids['aes256-CBC']: - keyLen = 32; - ivLen = 16; - ciphFn = forge.aes.createEncryptionCipher; - break; - - case forge.pki.oids['des-EDE3-CBC']: - keyLen = 24; - ivLen = 8; - ciphFn = forge.des.createEncryptionCipher; - break; - - default: - throw new Error('Unsupported symmetric cipher, OID ' + cipher); - } - - if(key === undefined) { - key = forge.util.createBuffer(forge.random.getBytes(keyLen)); - } else if(key.length() != keyLen) { - throw new Error('Symmetric key has wrong length; ' + - 'got ' + key.length() + ' bytes, expected ' + keyLen + '.'); - } - - // Keep a copy of the key & IV in the object, so the caller can - // use it for whatever reason. - msg.encryptedContent.algorithm = cipher; - msg.encryptedContent.key = key; - msg.encryptedContent.parameter = forge.util.createBuffer( - forge.random.getBytes(ivLen)); - - var ciph = ciphFn(key); - ciph.start(msg.encryptedContent.parameter.copy()); - ciph.update(msg.content); - - // The finish function does PKCS#7 padding by default, therefore - // no action required by us. - if(!ciph.finish()) { - throw new Error('Symmetric encryption failed.'); - } - - msg.encryptedContent.content = ciph.output; - } - - // Part 2: asymmetric encryption for each recipient - for(var i = 0; i < msg.recipients.length; ++i) { - var recipient = msg.recipients[i]; - - // Nothing to do, encryption already done. - if(recipient.encryptedContent.content !== undefined) { - continue; - } - - switch(recipient.encryptedContent.algorithm) { - case forge.pki.oids.rsaEncryption: - recipient.encryptedContent.content = - recipient.encryptedContent.key.encrypt( - msg.encryptedContent.key.data); - break; - - default: - throw new Error('Unsupported asymmetric cipher, OID ' + - recipient.encryptedContent.algorithm); - } - } - } - }; - return msg; -}; - -/** - * Converts a single recipient from an ASN.1 object. - * - * @param obj the ASN.1 RecipientInfo. - * - * @return the recipient object. - */ -function _recipientFromAsn1(obj) { - // validate EnvelopedData content block and capture data - var capture = {}; - var errors = []; - if(!asn1.validate(obj, p7.asn1.recipientInfoValidator, capture, errors)) { - var error = new Error('Cannot read PKCS#7 RecipientInfo. ' + - 'ASN.1 object is not an PKCS#7 RecipientInfo.'); - error.errors = errors; - throw error; - } - - return { - version: capture.version.charCodeAt(0), - issuer: forge.pki.RDNAttributesAsArray(capture.issuer), - serialNumber: forge.util.createBuffer(capture.serial).toHex(), - encryptedContent: { - algorithm: asn1.derToOid(capture.encAlgorithm), - parameter: capture.encParameter ? capture.encParameter.value : undefined, - content: capture.encKey - } - }; -} - -/** - * Converts a single recipient object to an ASN.1 object. - * - * @param obj the recipient object. - * - * @return the ASN.1 RecipientInfo. - */ -function _recipientToAsn1(obj) { - return asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // Version - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, - asn1.integerToDer(obj.version).getBytes()), - // IssuerAndSerialNumber - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // Name - forge.pki.distinguishedNameToAsn1({attributes: obj.issuer}), - // Serial - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, - forge.util.hexToBytes(obj.serialNumber)) - ]), - // KeyEncryptionAlgorithmIdentifier - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // Algorithm - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false, - asn1.oidToDer(obj.encryptedContent.algorithm).getBytes()), - // Parameter, force NULL, only RSA supported for now. - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.NULL, false, '') - ]), - // EncryptedKey - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false, - obj.encryptedContent.content) - ]); -} - -/** - * Map a set of RecipientInfo ASN.1 objects to recipient objects. - * - * @param infos an array of ASN.1 representations RecipientInfo (i.e. SET OF). - * - * @return an array of recipient objects. - */ -function _recipientsFromAsn1(infos) { - var ret = []; - for(var i = 0; i < infos.length; ++i) { - ret.push(_recipientFromAsn1(infos[i])); - } - return ret; -} - -/** - * Map an array of recipient objects to ASN.1 RecipientInfo objects. - * - * @param recipients an array of recipientInfo objects. - * - * @return an array of ASN.1 RecipientInfos. - */ -function _recipientsToAsn1(recipients) { - var ret = []; - for(var i = 0; i < recipients.length; ++i) { - ret.push(_recipientToAsn1(recipients[i])); - } - return ret; -} - -/** - * Converts a single signer from an ASN.1 object. - * - * @param obj the ASN.1 representation of a SignerInfo. - * - * @return the signer object. - */ -function _signerFromAsn1(obj) { - // validate EnvelopedData content block and capture data - var capture = {}; - var errors = []; - if(!asn1.validate(obj, p7.asn1.signerInfoValidator, capture, errors)) { - var error = new Error('Cannot read PKCS#7 SignerInfo. ' + - 'ASN.1 object is not an PKCS#7 SignerInfo.'); - error.errors = errors; - throw error; - } - - var rval = { - version: capture.version.charCodeAt(0), - issuer: forge.pki.RDNAttributesAsArray(capture.issuer), - serialNumber: forge.util.createBuffer(capture.serial).toHex(), - digestAlgorithm: asn1.derToOid(capture.digestAlgorithm), - signatureAlgorithm: asn1.derToOid(capture.signatureAlgorithm), - signature: capture.signature, - authenticatedAttributes: [], - unauthenticatedAttributes: [] - }; - - // TODO: convert attributes - var authenticatedAttributes = capture.authenticatedAttributes || []; - var unauthenticatedAttributes = capture.unauthenticatedAttributes || []; - - return rval; -} - -/** - * Converts a single signerInfo object to an ASN.1 object. - * - * @param obj the signerInfo object. - * - * @return the ASN.1 representation of a SignerInfo. - */ -function _signerToAsn1(obj) { - // SignerInfo - var rval = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // version - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, - asn1.integerToDer(obj.version).getBytes()), - // issuerAndSerialNumber - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // name - forge.pki.distinguishedNameToAsn1({attributes: obj.issuer}), - // serial - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, - forge.util.hexToBytes(obj.serialNumber)) - ]), - // digestAlgorithm - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // algorithm - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false, - asn1.oidToDer(obj.digestAlgorithm).getBytes()), - // parameters (null) - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.NULL, false, '') - ]) - ]); - - // authenticatedAttributes (OPTIONAL) - if(obj.authenticatedAttributesAsn1) { - // add ASN.1 previously generated during signing - rval.value.push(obj.authenticatedAttributesAsn1); - } - - // digestEncryptionAlgorithm - rval.value.push(asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // algorithm - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false, - asn1.oidToDer(obj.signatureAlgorithm).getBytes()), - // parameters (null) - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.NULL, false, '') - ])); - - // encryptedDigest - rval.value.push(asn1.create( - asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false, obj.signature)); - - // unauthenticatedAttributes (OPTIONAL) - if(obj.unauthenticatedAttributes.length > 0) { - // [1] IMPLICIT - var attrsAsn1 = asn1.create(asn1.Class.CONTEXT_SPECIFIC, 1, true, []); - for(var i = 0; i < obj.unauthenticatedAttributes.length; ++i) { - var attr = obj.unauthenticatedAttributes[i]; - attrsAsn1.values.push(_attributeToAsn1(attr)); - } - rval.value.push(attrsAsn1); - } - - return rval; -} - -/** - * Map a set of SignerInfo ASN.1 objects to an array of signer objects. - * - * @param signerInfoAsn1s an array of ASN.1 SignerInfos (i.e. SET OF). - * - * @return an array of signers objects. - */ -function _signersFromAsn1(signerInfoAsn1s) { - var ret = []; - for(var i = 0; i < signerInfoAsn1s.length; ++i) { - ret.push(_signerFromAsn1(signerInfoAsn1s[i])); - } - return ret; -} - -/** - * Map an array of signer objects to ASN.1 objects. - * - * @param signers an array of signer objects. - * - * @return an array of ASN.1 SignerInfos. - */ -function _signersToAsn1(signers) { - var ret = []; - for(var i = 0; i < signers.length; ++i) { - ret.push(_signerToAsn1(signers[i])); - } - return ret; -} - -/** - * Convert an attribute object to an ASN.1 Attribute. - * - * @param attr the attribute object. - * - * @return the ASN.1 Attribute. - */ -function _attributeToAsn1(attr) { - var value; - - // TODO: generalize to support more attributes - if(attr.type === forge.pki.oids.contentType) { - value = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false, - asn1.oidToDer(attr.value).getBytes()); - } else if(attr.type === forge.pki.oids.messageDigest) { - value = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false, - attr.value.bytes()); - } else if(attr.type === forge.pki.oids.signingTime) { - /* Note per RFC 2985: Dates between 1 January 1950 and 31 December 2049 - (inclusive) MUST be encoded as UTCTime. Any dates with year values - before 1950 or after 2049 MUST be encoded as GeneralizedTime. [Further,] - UTCTime values MUST be expressed in Greenwich Mean Time (Zulu) and MUST - include seconds (i.e., times are YYMMDDHHMMSSZ), even where the - number of seconds is zero. Midnight (GMT) must be represented as - "YYMMDD000000Z". */ - // TODO: make these module-level constants - var jan_1_1950 = new Date('1950-01-01T00:00:00Z'); - var jan_1_2050 = new Date('2050-01-01T00:00:00Z'); - var date = attr.value; - if(typeof date === 'string') { - // try to parse date - var timestamp = Date.parse(date); - if(!isNaN(timestamp)) { - date = new Date(timestamp); - } else if(date.length === 13) { - // YYMMDDHHMMSSZ (13 chars for UTCTime) - date = asn1.utcTimeToDate(date); - } else { - // assume generalized time - date = asn1.generalizedTimeToDate(date); - } - } - - if(date >= jan_1_1950 && date < jan_1_2050) { - value = asn1.create( - asn1.Class.UNIVERSAL, asn1.Type.UTCTIME, false, - asn1.dateToUtcTime(date)); - } else { - value = asn1.create( - asn1.Class.UNIVERSAL, asn1.Type.GENERALIZEDTIME, false, - asn1.dateToGeneralizedTime(date)); - } - } - - // TODO: expose as common API call - // create a RelativeDistinguishedName set - // each value in the set is an AttributeTypeAndValue first - // containing the type (an OID) and second the value - return asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // AttributeType - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false, - asn1.oidToDer(attr.type).getBytes()), - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SET, true, [ - // AttributeValue - value - ]) - ]); -} - -/** - * Map messages encrypted content to ASN.1 objects. - * - * @param ec The encryptedContent object of the message. - * - * @return ASN.1 representation of the encryptedContent object (SEQUENCE). - */ -function _encryptedContentToAsn1(ec) { - return [ - // ContentType, always Data for the moment - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false, - asn1.oidToDer(forge.pki.oids.data).getBytes()), - // ContentEncryptionAlgorithmIdentifier - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // Algorithm - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false, - asn1.oidToDer(ec.algorithm).getBytes()), - // Parameters (IV) - !ec.parameter ? - undefined : - asn1.create( - asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false, - ec.parameter.getBytes()) - ]), - // [0] EncryptedContent - asn1.create(asn1.Class.CONTEXT_SPECIFIC, 0, true, [ - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false, - ec.content.getBytes()) - ]) - ]; -} - -/** - * Reads the "common part" of an PKCS#7 content block (in ASN.1 format) - * - * This function reads the "common part" of the PKCS#7 content blocks - * EncryptedData and EnvelopedData, i.e. version number and symmetrically - * encrypted content block. - * - * The result of the ASN.1 validate and capture process is returned - * to allow the caller to extract further data, e.g. the list of recipients - * in case of a EnvelopedData object. - * - * @param msg the PKCS#7 object to read the data to. - * @param obj the ASN.1 representation of the content block. - * @param validator the ASN.1 structure validator object to use. - * - * @return the value map captured by validator object. - */ -function _fromAsn1(msg, obj, validator) { - var capture = {}; - var errors = []; - if(!asn1.validate(obj, validator, capture, errors)) { - var error = new Error('Cannot read PKCS#7 message. ' + - 'ASN.1 object is not a supported PKCS#7 message.'); - error.errors = error; - throw error; - } - - // Check contentType, so far we only support (raw) Data. - var contentType = asn1.derToOid(capture.contentType); - if(contentType !== forge.pki.oids.data) { - throw new Error('Unsupported PKCS#7 message. ' + - 'Only wrapped ContentType Data supported.'); - } - - if(capture.encryptedContent) { - var content = ''; - if(forge.util.isArray(capture.encryptedContent)) { - for(var i = 0; i < capture.encryptedContent.length; ++i) { - if(capture.encryptedContent[i].type !== asn1.Type.OCTETSTRING) { - throw new Error('Malformed PKCS#7 message, expecting encrypted ' + - 'content constructed of only OCTET STRING objects.'); - } - content += capture.encryptedContent[i].value; - } - } else { - content = capture.encryptedContent; - } - msg.encryptedContent = { - algorithm: asn1.derToOid(capture.encAlgorithm), - parameter: forge.util.createBuffer(capture.encParameter.value), - content: forge.util.createBuffer(content) - }; - } - - if(capture.content) { - var content = ''; - if(forge.util.isArray(capture.content)) { - for(var i = 0; i < capture.content.length; ++i) { - if(capture.content[i].type !== asn1.Type.OCTETSTRING) { - throw new Error('Malformed PKCS#7 message, expecting ' + - 'content constructed of only OCTET STRING objects.'); - } - content += capture.content[i].value; - } - } else { - content = capture.content; - } - msg.content = forge.util.createBuffer(content); - } - - msg.version = capture.version.charCodeAt(0); - msg.rawCapture = capture; - - return capture; -} - -/** - * Decrypt the symmetrically encrypted content block of the PKCS#7 message. - * - * Decryption is skipped in case the PKCS#7 message object already has a - * (decrypted) content attribute. The algorithm, key and cipher parameters - * (probably the iv) are taken from the encryptedContent attribute of the - * message object. - * - * @param The PKCS#7 message object. - */ -function _decryptContent(msg) { - if(msg.encryptedContent.key === undefined) { - throw new Error('Symmetric key not available.'); - } - - if(msg.content === undefined) { - var ciph; - - switch(msg.encryptedContent.algorithm) { - case forge.pki.oids['aes128-CBC']: - case forge.pki.oids['aes192-CBC']: - case forge.pki.oids['aes256-CBC']: - ciph = forge.aes.createDecryptionCipher(msg.encryptedContent.key); - break; - - case forge.pki.oids['desCBC']: - case forge.pki.oids['des-EDE3-CBC']: - ciph = forge.des.createDecryptionCipher(msg.encryptedContent.key); - break; - - default: - throw new Error('Unsupported symmetric cipher, OID ' + - msg.encryptedContent.algorithm); - } - ciph.start(msg.encryptedContent.parameter); - ciph.update(msg.encryptedContent.content); - - if(!ciph.finish()) { - throw new Error('Symmetric decryption failed.'); - } - - msg.content = ciph.output; - } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/pkcs7asn1.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/pkcs7asn1.js deleted file mode 100644 index 0e13c891..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/pkcs7asn1.js +++ /dev/null @@ -1,410 +0,0 @@ -/** - * Javascript implementation of ASN.1 validators for PKCS#7 v1.5. - * - * @author Dave Longley - * @author Stefan Siegl - * - * Copyright (c) 2012-2015 Digital Bazaar, Inc. - * Copyright (c) 2012 Stefan Siegl - * - * The ASN.1 representation of PKCS#7 is as follows - * (see RFC #2315 for details, http://www.ietf.org/rfc/rfc2315.txt): - * - * A PKCS#7 message consists of a ContentInfo on root level, which may - * contain any number of further ContentInfo nested into it. - * - * ContentInfo ::= SEQUENCE { - * contentType ContentType, - * content [0] EXPLICIT ANY DEFINED BY contentType OPTIONAL - * } - * - * ContentType ::= OBJECT IDENTIFIER - * - * EnvelopedData ::= SEQUENCE { - * version Version, - * recipientInfos RecipientInfos, - * encryptedContentInfo EncryptedContentInfo - * } - * - * EncryptedData ::= SEQUENCE { - * version Version, - * encryptedContentInfo EncryptedContentInfo - * } - * - * id-signedData OBJECT IDENTIFIER ::= { iso(1) member-body(2) - * us(840) rsadsi(113549) pkcs(1) pkcs7(7) 2 } - * - * SignedData ::= SEQUENCE { - * version INTEGER, - * digestAlgorithms DigestAlgorithmIdentifiers, - * contentInfo ContentInfo, - * certificates [0] IMPLICIT Certificates OPTIONAL, - * crls [1] IMPLICIT CertificateRevocationLists OPTIONAL, - * signerInfos SignerInfos - * } - * - * SignerInfos ::= SET OF SignerInfo - * - * SignerInfo ::= SEQUENCE { - * version Version, - * issuerAndSerialNumber IssuerAndSerialNumber, - * digestAlgorithm DigestAlgorithmIdentifier, - * authenticatedAttributes [0] IMPLICIT Attributes OPTIONAL, - * digestEncryptionAlgorithm DigestEncryptionAlgorithmIdentifier, - * encryptedDigest EncryptedDigest, - * unauthenticatedAttributes [1] IMPLICIT Attributes OPTIONAL - * } - * - * EncryptedDigest ::= OCTET STRING - * - * Attributes ::= SET OF Attribute - * - * Attribute ::= SEQUENCE { - * attrType OBJECT IDENTIFIER, - * attrValues SET OF AttributeValue - * } - * - * AttributeValue ::= ANY - * - * Version ::= INTEGER - * - * RecipientInfos ::= SET OF RecipientInfo - * - * EncryptedContentInfo ::= SEQUENCE { - * contentType ContentType, - * contentEncryptionAlgorithm ContentEncryptionAlgorithmIdentifier, - * encryptedContent [0] IMPLICIT EncryptedContent OPTIONAL - * } - * - * ContentEncryptionAlgorithmIdentifier ::= AlgorithmIdentifier - * - * The AlgorithmIdentifier contains an Object Identifier (OID) and parameters - * for the algorithm, if any. In the case of AES and DES3, there is only one, - * the IV. - * - * AlgorithmIdentifer ::= SEQUENCE { - * algorithm OBJECT IDENTIFIER, - * parameters ANY DEFINED BY algorithm OPTIONAL - * } - * - * EncryptedContent ::= OCTET STRING - * - * RecipientInfo ::= SEQUENCE { - * version Version, - * issuerAndSerialNumber IssuerAndSerialNumber, - * keyEncryptionAlgorithm KeyEncryptionAlgorithmIdentifier, - * encryptedKey EncryptedKey - * } - * - * IssuerAndSerialNumber ::= SEQUENCE { - * issuer Name, - * serialNumber CertificateSerialNumber - * } - * - * CertificateSerialNumber ::= INTEGER - * - * KeyEncryptionAlgorithmIdentifier ::= AlgorithmIdentifier - * - * EncryptedKey ::= OCTET STRING - */ -var forge = require('./forge'); -require('./asn1'); -require('./util'); - -// shortcut for ASN.1 API -var asn1 = forge.asn1; - -// shortcut for PKCS#7 API -var p7v = module.exports = forge.pkcs7asn1 = forge.pkcs7asn1 || {}; -forge.pkcs7 = forge.pkcs7 || {}; -forge.pkcs7.asn1 = p7v; - -var contentInfoValidator = { - name: 'ContentInfo', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - value: [{ - name: 'ContentInfo.ContentType', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.OID, - constructed: false, - capture: 'contentType' - }, { - name: 'ContentInfo.content', - tagClass: asn1.Class.CONTEXT_SPECIFIC, - type: 0, - constructed: true, - optional: true, - captureAsn1: 'content' - }] -}; -p7v.contentInfoValidator = contentInfoValidator; - -var encryptedContentInfoValidator = { - name: 'EncryptedContentInfo', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - value: [{ - name: 'EncryptedContentInfo.contentType', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.OID, - constructed: false, - capture: 'contentType' - }, { - name: 'EncryptedContentInfo.contentEncryptionAlgorithm', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - value: [{ - name: 'EncryptedContentInfo.contentEncryptionAlgorithm.algorithm', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.OID, - constructed: false, - capture: 'encAlgorithm' - }, { - name: 'EncryptedContentInfo.contentEncryptionAlgorithm.parameter', - tagClass: asn1.Class.UNIVERSAL, - captureAsn1: 'encParameter' - }] - }, { - name: 'EncryptedContentInfo.encryptedContent', - tagClass: asn1.Class.CONTEXT_SPECIFIC, - type: 0, - /* The PKCS#7 structure output by OpenSSL somewhat differs from what - * other implementations do generate. - * - * OpenSSL generates a structure like this: - * SEQUENCE { - * ... - * [0] - * 26 DA 67 D2 17 9C 45 3C B1 2A A8 59 2F 29 33 38 - * C3 C3 DF 86 71 74 7A 19 9F 40 D0 29 BE 85 90 45 - * ... - * } - * - * Whereas other implementations (and this PKCS#7 module) generate: - * SEQUENCE { - * ... - * [0] { - * OCTET STRING - * 26 DA 67 D2 17 9C 45 3C B1 2A A8 59 2F 29 33 38 - * C3 C3 DF 86 71 74 7A 19 9F 40 D0 29 BE 85 90 45 - * ... - * } - * } - * - * In order to support both, we just capture the context specific - * field here. The OCTET STRING bit is removed below. - */ - capture: 'encryptedContent', - captureAsn1: 'encryptedContentAsn1' - }] -}; - -p7v.envelopedDataValidator = { - name: 'EnvelopedData', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - value: [{ - name: 'EnvelopedData.Version', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.INTEGER, - constructed: false, - capture: 'version' - }, { - name: 'EnvelopedData.RecipientInfos', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SET, - constructed: true, - captureAsn1: 'recipientInfos' - }].concat(encryptedContentInfoValidator) -}; - -p7v.encryptedDataValidator = { - name: 'EncryptedData', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - value: [{ - name: 'EncryptedData.Version', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.INTEGER, - constructed: false, - capture: 'version' - }].concat(encryptedContentInfoValidator) -}; - -var signerValidator = { - name: 'SignerInfo', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - value: [{ - name: 'SignerInfo.version', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.INTEGER, - constructed: false - }, { - name: 'SignerInfo.issuerAndSerialNumber', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - value: [{ - name: 'SignerInfo.issuerAndSerialNumber.issuer', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - captureAsn1: 'issuer' - }, { - name: 'SignerInfo.issuerAndSerialNumber.serialNumber', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.INTEGER, - constructed: false, - capture: 'serial' - }] - }, { - name: 'SignerInfo.digestAlgorithm', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - value: [{ - name: 'SignerInfo.digestAlgorithm.algorithm', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.OID, - constructed: false, - capture: 'digestAlgorithm' - }, { - name: 'SignerInfo.digestAlgorithm.parameter', - tagClass: asn1.Class.UNIVERSAL, - constructed: false, - captureAsn1: 'digestParameter', - optional: true - }] - }, { - name: 'SignerInfo.authenticatedAttributes', - tagClass: asn1.Class.CONTEXT_SPECIFIC, - type: 0, - constructed: true, - optional: true, - capture: 'authenticatedAttributes' - }, { - name: 'SignerInfo.digestEncryptionAlgorithm', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - capture: 'signatureAlgorithm' - }, { - name: 'SignerInfo.encryptedDigest', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.OCTETSTRING, - constructed: false, - capture: 'signature' - }, { - name: 'SignerInfo.unauthenticatedAttributes', - tagClass: asn1.Class.CONTEXT_SPECIFIC, - type: 1, - constructed: true, - optional: true, - capture: 'unauthenticatedAttributes' - }] -}; - -p7v.signedDataValidator = { - name: 'SignedData', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - value: [{ - name: 'SignedData.Version', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.INTEGER, - constructed: false, - capture: 'version' - }, { - name: 'SignedData.DigestAlgorithms', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SET, - constructed: true, - captureAsn1: 'digestAlgorithms' - }, - contentInfoValidator, - { - name: 'SignedData.Certificates', - tagClass: asn1.Class.CONTEXT_SPECIFIC, - type: 0, - optional: true, - captureAsn1: 'certificates' - }, { - name: 'SignedData.CertificateRevocationLists', - tagClass: asn1.Class.CONTEXT_SPECIFIC, - type: 1, - optional: true, - captureAsn1: 'crls' - }, { - name: 'SignedData.SignerInfos', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SET, - capture: 'signerInfos', - optional: true, - value: [signerValidator] - }] -}; - -p7v.recipientInfoValidator = { - name: 'RecipientInfo', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - value: [{ - name: 'RecipientInfo.version', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.INTEGER, - constructed: false, - capture: 'version' - }, { - name: 'RecipientInfo.issuerAndSerial', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - value: [{ - name: 'RecipientInfo.issuerAndSerial.issuer', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - captureAsn1: 'issuer' - }, { - name: 'RecipientInfo.issuerAndSerial.serialNumber', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.INTEGER, - constructed: false, - capture: 'serial' - }] - }, { - name: 'RecipientInfo.keyEncryptionAlgorithm', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - value: [{ - name: 'RecipientInfo.keyEncryptionAlgorithm.algorithm', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.OID, - constructed: false, - capture: 'encAlgorithm' - }, { - name: 'RecipientInfo.keyEncryptionAlgorithm.parameter', - tagClass: asn1.Class.UNIVERSAL, - constructed: false, - captureAsn1: 'encParameter', - optional: true - }] - }, { - name: 'RecipientInfo.encryptedKey', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.OCTETSTRING, - constructed: false, - capture: 'encKey' - }] -}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/pki.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/pki.js deleted file mode 100644 index ee82ff1c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/pki.js +++ /dev/null @@ -1,102 +0,0 @@ -/** - * Javascript implementation of a basic Public Key Infrastructure, including - * support for RSA public and private keys. - * - * @author Dave Longley - * - * Copyright (c) 2010-2013 Digital Bazaar, Inc. - */ -var forge = require('./forge'); -require('./asn1'); -require('./oids'); -require('./pbe'); -require('./pem'); -require('./pbkdf2'); -require('./pkcs12'); -require('./pss'); -require('./rsa'); -require('./util'); -require('./x509'); - -// shortcut for asn.1 API -var asn1 = forge.asn1; - -/* Public Key Infrastructure (PKI) implementation. */ -var pki = module.exports = forge.pki = forge.pki || {}; - -/** - * NOTE: THIS METHOD IS DEPRECATED. Use pem.decode() instead. - * - * Converts PEM-formatted data to DER. - * - * @param pem the PEM-formatted data. - * - * @return the DER-formatted data. - */ -pki.pemToDer = function(pem) { - var msg = forge.pem.decode(pem)[0]; - if(msg.procType && msg.procType.type === 'ENCRYPTED') { - throw new Error('Could not convert PEM to DER; PEM is encrypted.'); - } - return forge.util.createBuffer(msg.body); -}; - -/** - * Converts an RSA private key from PEM format. - * - * @param pem the PEM-formatted private key. - * - * @return the private key. - */ -pki.privateKeyFromPem = function(pem) { - var msg = forge.pem.decode(pem)[0]; - - if(msg.type !== 'PRIVATE KEY' && msg.type !== 'RSA PRIVATE KEY') { - var error = new Error('Could not convert private key from PEM; PEM ' + - 'header type is not "PRIVATE KEY" or "RSA PRIVATE KEY".'); - error.headerType = msg.type; - throw error; - } - if(msg.procType && msg.procType.type === 'ENCRYPTED') { - throw new Error('Could not convert private key from PEM; PEM is encrypted.'); - } - - // convert DER to ASN.1 object - var obj = asn1.fromDer(msg.body); - - return pki.privateKeyFromAsn1(obj); -}; - -/** - * Converts an RSA private key to PEM format. - * - * @param key the private key. - * @param maxline the maximum characters per line, defaults to 64. - * - * @return the PEM-formatted private key. - */ -pki.privateKeyToPem = function(key, maxline) { - // convert to ASN.1, then DER, then PEM-encode - var msg = { - type: 'RSA PRIVATE KEY', - body: asn1.toDer(pki.privateKeyToAsn1(key)).getBytes() - }; - return forge.pem.encode(msg, {maxline: maxline}); -}; - -/** - * Converts a PrivateKeyInfo to PEM format. - * - * @param pki the PrivateKeyInfo. - * @param maxline the maximum characters per line, defaults to 64. - * - * @return the PEM-formatted private key. - */ -pki.privateKeyInfoToPem = function(pki, maxline) { - // convert to DER, then PEM-encode - var msg = { - type: 'PRIVATE KEY', - body: asn1.toDer(pki).getBytes() - }; - return forge.pem.encode(msg, {maxline: maxline}); -}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/prime.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/prime.js deleted file mode 100644 index 3d51473f..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/prime.js +++ /dev/null @@ -1,297 +0,0 @@ -/** - * Prime number generation API. - * - * @author Dave Longley - * - * Copyright (c) 2014 Digital Bazaar, Inc. - */ -var forge = require('./forge'); -require('./util'); -require('./jsbn'); -require('./random'); - -(function() { - -// forge.prime already defined -if(forge.prime) { - module.exports = forge.prime; - return; -} - -/* PRIME API */ -var prime = module.exports = forge.prime = forge.prime || {}; - -var BigInteger = forge.jsbn.BigInteger; - -// primes are 30k+i for i = 1, 7, 11, 13, 17, 19, 23, 29 -var GCD_30_DELTA = [6, 4, 2, 4, 2, 4, 6, 2]; -var THIRTY = new BigInteger(null); -THIRTY.fromInt(30); -var op_or = function(x, y) {return x|y;}; - -/** - * Generates a random probable prime with the given number of bits. - * - * Alternative algorithms can be specified by name as a string or as an - * object with custom options like so: - * - * { - * name: 'PRIMEINC', - * options: { - * maxBlockTime: , - * millerRabinTests: , - * workerScript: , - * workers: . - * workLoad: the size of the work load, ie: number of possible prime - * numbers for each web worker to check per work assignment, - * (default: 100). - * } - * } - * - * @param bits the number of bits for the prime number. - * @param options the options to use. - * [algorithm] the algorithm to use (default: 'PRIMEINC'). - * [prng] a custom crypto-secure pseudo-random number generator to use, - * that must define "getBytesSync". - * - * @return callback(err, num) called once the operation completes. - */ -prime.generateProbablePrime = function(bits, options, callback) { - if(typeof options === 'function') { - callback = options; - options = {}; - } - options = options || {}; - - // default to PRIMEINC algorithm - var algorithm = options.algorithm || 'PRIMEINC'; - if(typeof algorithm === 'string') { - algorithm = {name: algorithm}; - } - algorithm.options = algorithm.options || {}; - - // create prng with api that matches BigInteger secure random - var prng = options.prng || forge.random; - var rng = { - // x is an array to fill with bytes - nextBytes: function(x) { - var b = prng.getBytesSync(x.length); - for(var i = 0; i < x.length; ++i) { - x[i] = b.charCodeAt(i); - } - } - }; - - if(algorithm.name === 'PRIMEINC') { - return primeincFindPrime(bits, rng, algorithm.options, callback); - } - - throw new Error('Invalid prime generation algorithm: ' + algorithm.name); -}; - -function primeincFindPrime(bits, rng, options, callback) { - if('workers' in options) { - return primeincFindPrimeWithWorkers(bits, rng, options, callback); - } - return primeincFindPrimeWithoutWorkers(bits, rng, options, callback); -} - -function primeincFindPrimeWithoutWorkers(bits, rng, options, callback) { - // initialize random number - var num = generateRandom(bits, rng); - - /* Note: All primes are of the form 30k+i for i < 30 and gcd(30, i)=1. The - number we are given is always aligned at 30k + 1. Each time the number is - determined not to be prime we add to get to the next 'i', eg: if the number - was at 30k + 1 we add 6. */ - var deltaIdx = 0; - - // get required number of MR tests - var mrTests = getMillerRabinTests(num.bitLength()); - if('millerRabinTests' in options) { - mrTests = options.millerRabinTests; - } - - // find prime nearest to 'num' for maxBlockTime ms - // 10 ms gives 5ms of leeway for other calculations before dropping - // below 60fps (1000/60 == 16.67), but in reality, the number will - // likely be higher due to an 'atomic' big int modPow - var maxBlockTime = 10; - if('maxBlockTime' in options) { - maxBlockTime = options.maxBlockTime; - } - - _primeinc(num, bits, rng, deltaIdx, mrTests, maxBlockTime, callback); -} - -function _primeinc(num, bits, rng, deltaIdx, mrTests, maxBlockTime, callback) { - var start = +new Date(); - do { - // overflow, regenerate random number - if(num.bitLength() > bits) { - num = generateRandom(bits, rng); - } - // do primality test - if(num.isProbablePrime(mrTests)) { - return callback(null, num); - } - // get next potential prime - num.dAddOffset(GCD_30_DELTA[deltaIdx++ % 8], 0); - } while(maxBlockTime < 0 || (+new Date() - start < maxBlockTime)); - - // keep trying later - forge.util.setImmediate(function() { - _primeinc(num, bits, rng, deltaIdx, mrTests, maxBlockTime, callback); - }); -} - -// NOTE: This algorithm is indeterminate in nature because workers -// run in parallel looking at different segments of numbers. Even if this -// algorithm is run twice with the same input from a predictable RNG, it -// may produce different outputs. -function primeincFindPrimeWithWorkers(bits, rng, options, callback) { - // web workers unavailable - if(typeof Worker === 'undefined') { - return primeincFindPrimeWithoutWorkers(bits, rng, options, callback); - } - - // initialize random number - var num = generateRandom(bits, rng); - - // use web workers to generate keys - var numWorkers = options.workers; - var workLoad = options.workLoad || 100; - var range = workLoad * 30 / 8; - var workerScript = options.workerScript || 'forge/prime.worker.js'; - if(numWorkers === -1) { - return forge.util.estimateCores(function(err, cores) { - if(err) { - // default to 2 - cores = 2; - } - numWorkers = cores - 1; - generate(); - }); - } - generate(); - - function generate() { - // require at least 1 worker - numWorkers = Math.max(1, numWorkers); - - // TODO: consider optimizing by starting workers outside getPrime() ... - // note that in order to clean up they will have to be made internally - // asynchronous which may actually be slower - - // start workers immediately - var workers = []; - for(var i = 0; i < numWorkers; ++i) { - // FIXME: fix path or use blob URLs - workers[i] = new Worker(workerScript); - } - var running = numWorkers; - - // listen for requests from workers and assign ranges to find prime - for(var i = 0; i < numWorkers; ++i) { - workers[i].addEventListener('message', workerMessage); - } - - /* Note: The distribution of random numbers is unknown. Therefore, each - web worker is continuously allocated a range of numbers to check for a - random number until one is found. - - Every 30 numbers will be checked just 8 times, because prime numbers - have the form: - - 30k+i, for i < 30 and gcd(30, i)=1 (there are 8 values of i for this) - - Therefore, if we want a web worker to run N checks before asking for - a new range of numbers, each range must contain N*30/8 numbers. - - For 100 checks (workLoad), this is a range of 375. */ - - var found = false; - function workerMessage(e) { - // ignore message, prime already found - if(found) { - return; - } - - --running; - var data = e.data; - if(data.found) { - // terminate all workers - for(var i = 0; i < workers.length; ++i) { - workers[i].terminate(); - } - found = true; - return callback(null, new BigInteger(data.prime, 16)); - } - - // overflow, regenerate random number - if(num.bitLength() > bits) { - num = generateRandom(bits, rng); - } - - // assign new range to check - var hex = num.toString(16); - - // start prime search - e.target.postMessage({ - hex: hex, - workLoad: workLoad - }); - - num.dAddOffset(range, 0); - } - } -} - -/** - * Generates a random number using the given number of bits and RNG. - * - * @param bits the number of bits for the number. - * @param rng the random number generator to use. - * - * @return the random number. - */ -function generateRandom(bits, rng) { - var num = new BigInteger(bits, rng); - // force MSB set - var bits1 = bits - 1; - if(!num.testBit(bits1)) { - num.bitwiseTo(BigInteger.ONE.shiftLeft(bits1), op_or, num); - } - // align number on 30k+1 boundary - num.dAddOffset(31 - num.mod(THIRTY).byteValue(), 0); - return num; -} - -/** - * Returns the required number of Miller-Rabin tests to generate a - * prime with an error probability of (1/2)^80. - * - * See Handbook of Applied Cryptography Chapter 4, Table 4.4. - * - * @param bits the bit size. - * - * @return the required number of iterations. - */ -function getMillerRabinTests(bits) { - if(bits <= 100) return 27; - if(bits <= 150) return 18; - if(bits <= 200) return 15; - if(bits <= 250) return 12; - if(bits <= 300) return 9; - if(bits <= 350) return 8; - if(bits <= 400) return 7; - if(bits <= 500) return 6; - if(bits <= 600) return 5; - if(bits <= 800) return 4; - if(bits <= 1250) return 3; - return 2; -} - -})(); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/prime.worker.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/prime.worker.js deleted file mode 100644 index ce1355d9..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/prime.worker.js +++ /dev/null @@ -1,168 +0,0 @@ -/** - * RSA Key Generation Worker. - * - * @author Dave Longley - * - * Copyright (c) 2013 Digital Bazaar, Inc. - */ -// worker is built using CommonJS syntax to include all code in one worker file -//importScripts('jsbn.js'); -var forge = require('./forge'); -require('./jsbn'); - -// prime constants -var LOW_PRIMES = [2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997]; -var LP_LIMIT = (1 << 26) / LOW_PRIMES[LOW_PRIMES.length - 1]; - -var BigInteger = forge.jsbn.BigInteger; -var BIG_TWO = new BigInteger(null); -BIG_TWO.fromInt(2); - -self.addEventListener('message', function(e) { - var result = findPrime(e.data); - self.postMessage(result); -}); - -// start receiving ranges to check -self.postMessage({found: false}); - -// primes are 30k+i for i = 1, 7, 11, 13, 17, 19, 23, 29 -var GCD_30_DELTA = [6, 4, 2, 4, 2, 4, 6, 2]; - -function findPrime(data) { - // TODO: abstract based on data.algorithm (PRIMEINC vs. others) - - // create BigInteger from given random bytes - var num = new BigInteger(data.hex, 16); - - /* Note: All primes are of the form 30k+i for i < 30 and gcd(30, i)=1. The - number we are given is always aligned at 30k + 1. Each time the number is - determined not to be prime we add to get to the next 'i', eg: if the number - was at 30k + 1 we add 6. */ - var deltaIdx = 0; - - // find nearest prime - var workLoad = data.workLoad; - for(var i = 0; i < workLoad; ++i) { - // do primality test - if(isProbablePrime(num)) { - return {found: true, prime: num.toString(16)}; - } - // get next potential prime - num.dAddOffset(GCD_30_DELTA[deltaIdx++ % 8], 0); - } - - return {found: false}; -} - -function isProbablePrime(n) { - // divide by low primes, ignore even checks, etc (n alread aligned properly) - var i = 1; - while(i < LOW_PRIMES.length) { - var m = LOW_PRIMES[i]; - var j = i + 1; - while(j < LOW_PRIMES.length && m < LP_LIMIT) { - m *= LOW_PRIMES[j++]; - } - m = n.modInt(m); - while(i < j) { - if(m % LOW_PRIMES[i++] === 0) { - return false; - } - } - } - return runMillerRabin(n); -} - -// HAC 4.24, Miller-Rabin -function runMillerRabin(n) { - // n1 = n - 1 - var n1 = n.subtract(BigInteger.ONE); - - // get s and d such that n1 = 2^s * d - var s = n1.getLowestSetBit(); - if(s <= 0) { - return false; - } - var d = n1.shiftRight(s); - - var k = _getMillerRabinTests(n.bitLength()); - var prng = getPrng(); - var a; - for(var i = 0; i < k; ++i) { - // select witness 'a' at random from between 1 and n - 1 - do { - a = new BigInteger(n.bitLength(), prng); - } while(a.compareTo(BigInteger.ONE) <= 0 || a.compareTo(n1) >= 0); - - /* See if 'a' is a composite witness. */ - - // x = a^d mod n - var x = a.modPow(d, n); - - // probably prime - if(x.compareTo(BigInteger.ONE) === 0 || x.compareTo(n1) === 0) { - continue; - } - - var j = s; - while(--j) { - // x = x^2 mod a - x = x.modPowInt(2, n); - - // 'n' is composite because no previous x == -1 mod n - if(x.compareTo(BigInteger.ONE) === 0) { - return false; - } - // x == -1 mod n, so probably prime - if(x.compareTo(n1) === 0) { - break; - } - } - - // 'x' is first_x^(n1/2) and is not +/- 1, so 'n' is not prime - if(j === 0) { - return false; - } - } - - return true; -} - -// get pseudo random number generator -function getPrng() { - // create prng with api that matches BigInteger secure random - return { - // x is an array to fill with bytes - nextBytes: function(x) { - for(var i = 0; i < x.length; ++i) { - x[i] = Math.floor(Math.random() * 0xFF); - } - } - }; -} - -/** - * Returns the required number of Miller-Rabin tests to generate a - * prime with an error probability of (1/2)^80. - * - * See Handbook of Applied Cryptography Chapter 4, Table 4.4. - * - * @param bits the bit size. - * - * @return the required number of iterations. - */ -function _getMillerRabinTests(bits) { - if(bits <= 100) return 27; - if(bits <= 150) return 18; - if(bits <= 200) return 15; - if(bits <= 250) return 12; - if(bits <= 300) return 9; - if(bits <= 350) return 8; - if(bits <= 400) return 7; - if(bits <= 500) return 6; - if(bits <= 600) return 5; - if(bits <= 800) return 4; - if(bits <= 1250) return 3; - return 2; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/prng.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/prng.js deleted file mode 100644 index d3bd22e0..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/prng.js +++ /dev/null @@ -1,419 +0,0 @@ -/** - * A javascript implementation of a cryptographically-secure - * Pseudo Random Number Generator (PRNG). The Fortuna algorithm is followed - * here though the use of SHA-256 is not enforced; when generating an - * a PRNG context, the hashing algorithm and block cipher used for - * the generator are specified via a plugin. - * - * @author Dave Longley - * - * Copyright (c) 2010-2014 Digital Bazaar, Inc. - */ -var forge = require('./forge'); -require('./util'); - -var _crypto = null; -if(forge.util.isNodejs && !forge.options.usePureJavaScript && - !process.versions['node-webkit']) { - _crypto = require('crypto'); -} - -/* PRNG API */ -var prng = module.exports = forge.prng = forge.prng || {}; - -/** - * Creates a new PRNG context. - * - * A PRNG plugin must be passed in that will provide: - * - * 1. A function that initializes the key and seed of a PRNG context. It - * will be given a 16 byte key and a 16 byte seed. Any key expansion - * or transformation of the seed from a byte string into an array of - * integers (or similar) should be performed. - * 2. The cryptographic function used by the generator. It takes a key and - * a seed. - * 3. A seed increment function. It takes the seed and returns seed + 1. - * 4. An api to create a message digest. - * - * For an example, see random.js. - * - * @param plugin the PRNG plugin to use. - */ -prng.create = function(plugin) { - var ctx = { - plugin: plugin, - key: null, - seed: null, - time: null, - // number of reseeds so far - reseeds: 0, - // amount of data generated so far - generated: 0, - // no initial key bytes - keyBytes: '' - }; - - // create 32 entropy pools (each is a message digest) - var md = plugin.md; - var pools = new Array(32); - for(var i = 0; i < 32; ++i) { - pools[i] = md.create(); - } - ctx.pools = pools; - - // entropy pools are written to cyclically, starting at index 0 - ctx.pool = 0; - - /** - * Generates random bytes. The bytes may be generated synchronously or - * asynchronously. Web workers must use the asynchronous interface or - * else the behavior is undefined. - * - * @param count the number of random bytes to generate. - * @param [callback(err, bytes)] called once the operation completes. - * - * @return count random bytes as a string. - */ - ctx.generate = function(count, callback) { - // do synchronously - if(!callback) { - return ctx.generateSync(count); - } - - // simple generator using counter-based CBC - var cipher = ctx.plugin.cipher; - var increment = ctx.plugin.increment; - var formatKey = ctx.plugin.formatKey; - var formatSeed = ctx.plugin.formatSeed; - var b = forge.util.createBuffer(); - - // paranoid deviation from Fortuna: - // reset key for every request to protect previously - // generated random bytes should the key be discovered; - // there is no 100ms based reseeding because of this - // forced reseed for every `generate` call - ctx.key = null; - - generate(); - - function generate(err) { - if(err) { - return callback(err); - } - - // sufficient bytes generated - if(b.length() >= count) { - return callback(null, b.getBytes(count)); - } - - // if amount of data generated is greater than 1 MiB, trigger reseed - if(ctx.generated > 0xfffff) { - ctx.key = null; - } - - if(ctx.key === null) { - // prevent stack overflow - return forge.util.nextTick(function() { - _reseed(generate); - }); - } - - // generate the random bytes - var bytes = cipher(ctx.key, ctx.seed); - ctx.generated += bytes.length; - b.putBytes(bytes); - - // generate bytes for a new key and seed - ctx.key = formatKey(cipher(ctx.key, increment(ctx.seed))); - ctx.seed = formatSeed(cipher(ctx.key, ctx.seed)); - - forge.util.setImmediate(generate); - } - }; - - /** - * Generates random bytes synchronously. - * - * @param count the number of random bytes to generate. - * - * @return count random bytes as a string. - */ - ctx.generateSync = function(count) { - // simple generator using counter-based CBC - var cipher = ctx.plugin.cipher; - var increment = ctx.plugin.increment; - var formatKey = ctx.plugin.formatKey; - var formatSeed = ctx.plugin.formatSeed; - - // paranoid deviation from Fortuna: - // reset key for every request to protect previously - // generated random bytes should the key be discovered; - // there is no 100ms based reseeding because of this - // forced reseed for every `generateSync` call - ctx.key = null; - - var b = forge.util.createBuffer(); - while(b.length() < count) { - // if amount of data generated is greater than 1 MiB, trigger reseed - if(ctx.generated > 0xfffff) { - ctx.key = null; - } - - if(ctx.key === null) { - _reseedSync(); - } - - // generate the random bytes - var bytes = cipher(ctx.key, ctx.seed); - ctx.generated += bytes.length; - b.putBytes(bytes); - - // generate bytes for a new key and seed - ctx.key = formatKey(cipher(ctx.key, increment(ctx.seed))); - ctx.seed = formatSeed(cipher(ctx.key, ctx.seed)); - } - - return b.getBytes(count); - }; - - /** - * Private function that asynchronously reseeds a generator. - * - * @param callback(err) called once the operation completes. - */ - function _reseed(callback) { - if(ctx.pools[0].messageLength >= 32) { - _seed(); - return callback(); - } - // not enough seed data... - var needed = (32 - ctx.pools[0].messageLength) << 5; - ctx.seedFile(needed, function(err, bytes) { - if(err) { - return callback(err); - } - ctx.collect(bytes); - _seed(); - callback(); - }); - } - - /** - * Private function that synchronously reseeds a generator. - */ - function _reseedSync() { - if(ctx.pools[0].messageLength >= 32) { - return _seed(); - } - // not enough seed data... - var needed = (32 - ctx.pools[0].messageLength) << 5; - ctx.collect(ctx.seedFileSync(needed)); - _seed(); - } - - /** - * Private function that seeds a generator once enough bytes are available. - */ - function _seed() { - // update reseed count - ctx.reseeds = (ctx.reseeds === 0xffffffff) ? 0 : ctx.reseeds + 1; - - // goal is to update `key` via: - // key = hash(key + s) - // where 's' is all collected entropy from selected pools, then... - - // create a plugin-based message digest - var md = ctx.plugin.md.create(); - - // consume current key bytes - md.update(ctx.keyBytes); - - // digest the entropy of pools whose index k meet the - // condition 'n mod 2^k == 0' where n is the number of reseeds - var _2powK = 1; - for(var k = 0; k < 32; ++k) { - if(ctx.reseeds % _2powK === 0) { - md.update(ctx.pools[k].digest().getBytes()); - ctx.pools[k].start(); - } - _2powK = _2powK << 1; - } - - // get digest for key bytes - ctx.keyBytes = md.digest().getBytes(); - - // paranoid deviation from Fortuna: - // update `seed` via `seed = hash(key)` - // instead of initializing to zero once and only - // ever incrementing it - md.start(); - md.update(ctx.keyBytes); - var seedBytes = md.digest().getBytes(); - - // update state - ctx.key = ctx.plugin.formatKey(ctx.keyBytes); - ctx.seed = ctx.plugin.formatSeed(seedBytes); - ctx.generated = 0; - } - - /** - * The built-in default seedFile. This seedFile is used when entropy - * is needed immediately. - * - * @param needed the number of bytes that are needed. - * - * @return the random bytes. - */ - function defaultSeedFile(needed) { - // use window.crypto.getRandomValues strong source of entropy if available - var getRandomValues = null; - var globalScope = forge.util.globalScope; - var _crypto = globalScope.crypto || globalScope.msCrypto; - if(_crypto && _crypto.getRandomValues) { - getRandomValues = function(arr) { - return _crypto.getRandomValues(arr); - }; - } - - var b = forge.util.createBuffer(); - if(getRandomValues) { - while(b.length() < needed) { - // max byte length is 65536 before QuotaExceededError is thrown - // http://www.w3.org/TR/WebCryptoAPI/#RandomSource-method-getRandomValues - var count = Math.max(1, Math.min(needed - b.length(), 65536) / 4); - var entropy = new Uint32Array(Math.floor(count)); - try { - getRandomValues(entropy); - for(var i = 0; i < entropy.length; ++i) { - b.putInt32(entropy[i]); - } - } catch(e) { - /* only ignore QuotaExceededError */ - if(!(typeof QuotaExceededError !== 'undefined' && - e instanceof QuotaExceededError)) { - throw e; - } - } - } - } - - // be sad and add some weak random data - if(b.length() < needed) { - /* Draws from Park-Miller "minimal standard" 31 bit PRNG, - implemented with David G. Carta's optimization: with 32 bit math - and without division (Public Domain). */ - var hi, lo, next; - var seed = Math.floor(Math.random() * 0x010000); - while(b.length() < needed) { - lo = 16807 * (seed & 0xFFFF); - hi = 16807 * (seed >> 16); - lo += (hi & 0x7FFF) << 16; - lo += hi >> 15; - lo = (lo & 0x7FFFFFFF) + (lo >> 31); - seed = lo & 0xFFFFFFFF; - - // consume lower 3 bytes of seed - for(var i = 0; i < 3; ++i) { - // throw in more pseudo random - next = seed >>> (i << 3); - next ^= Math.floor(Math.random() * 0x0100); - b.putByte(next & 0xFF); - } - } - } - - return b.getBytes(needed); - } - // initialize seed file APIs - if(_crypto) { - // use nodejs async API - ctx.seedFile = function(needed, callback) { - _crypto.randomBytes(needed, function(err, bytes) { - if(err) { - return callback(err); - } - callback(null, bytes.toString()); - }); - }; - // use nodejs sync API - ctx.seedFileSync = function(needed) { - return _crypto.randomBytes(needed).toString(); - }; - } else { - ctx.seedFile = function(needed, callback) { - try { - callback(null, defaultSeedFile(needed)); - } catch(e) { - callback(e); - } - }; - ctx.seedFileSync = defaultSeedFile; - } - - /** - * Adds entropy to a prng ctx's accumulator. - * - * @param bytes the bytes of entropy as a string. - */ - ctx.collect = function(bytes) { - // iterate over pools distributing entropy cyclically - var count = bytes.length; - for(var i = 0; i < count; ++i) { - ctx.pools[ctx.pool].update(bytes.substr(i, 1)); - ctx.pool = (ctx.pool === 31) ? 0 : ctx.pool + 1; - } - }; - - /** - * Collects an integer of n bits. - * - * @param i the integer entropy. - * @param n the number of bits in the integer. - */ - ctx.collectInt = function(i, n) { - var bytes = ''; - for(var x = 0; x < n; x += 8) { - bytes += String.fromCharCode((i >> x) & 0xFF); - } - ctx.collect(bytes); - }; - - /** - * Registers a Web Worker to receive immediate entropy from the main thread. - * This method is required until Web Workers can access the native crypto - * API. This method should be called twice for each created worker, once in - * the main thread, and once in the worker itself. - * - * @param worker the worker to register. - */ - ctx.registerWorker = function(worker) { - // worker receives random bytes - if(worker === self) { - ctx.seedFile = function(needed, callback) { - function listener(e) { - var data = e.data; - if(data.forge && data.forge.prng) { - self.removeEventListener('message', listener); - callback(data.forge.prng.err, data.forge.prng.bytes); - } - } - self.addEventListener('message', listener); - self.postMessage({forge: {prng: {needed: needed}}}); - }; - } else { - // main thread sends random bytes upon request - var listener = function(e) { - var data = e.data; - if(data.forge && data.forge.prng) { - ctx.seedFile(data.forge.prng.needed, function(err, bytes) { - worker.postMessage({forge: {prng: {err: err, bytes: bytes}}}); - }); - } - }; - // TODO: do we need to remove the event listener when the worker dies? - worker.addEventListener('message', listener); - } - }; - - return ctx; -}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/pss.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/pss.js deleted file mode 100644 index 2596693c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/pss.js +++ /dev/null @@ -1,241 +0,0 @@ -/** - * Javascript implementation of PKCS#1 PSS signature padding. - * - * @author Stefan Siegl - * - * Copyright (c) 2012 Stefan Siegl - */ -var forge = require('./forge'); -require('./random'); -require('./util'); - -// shortcut for PSS API -var pss = module.exports = forge.pss = forge.pss || {}; - -/** - * Creates a PSS signature scheme object. - * - * There are several ways to provide a salt for encoding: - * - * 1. Specify the saltLength only and the built-in PRNG will generate it. - * 2. Specify the saltLength and a custom PRNG with 'getBytesSync' defined that - * will be used. - * 3. Specify the salt itself as a forge.util.ByteBuffer. - * - * @param options the options to use: - * md the message digest object to use, a forge md instance. - * mgf the mask generation function to use, a forge mgf instance. - * [saltLength] the length of the salt in octets. - * [prng] the pseudo-random number generator to use to produce a salt. - * [salt] the salt to use when encoding. - * - * @return a signature scheme object. - */ -pss.create = function(options) { - // backwards compatibility w/legacy args: hash, mgf, sLen - if(arguments.length === 3) { - options = { - md: arguments[0], - mgf: arguments[1], - saltLength: arguments[2] - }; - } - - var hash = options.md; - var mgf = options.mgf; - var hLen = hash.digestLength; - - var salt_ = options.salt || null; - if(typeof salt_ === 'string') { - // assume binary-encoded string - salt_ = forge.util.createBuffer(salt_); - } - - var sLen; - if('saltLength' in options) { - sLen = options.saltLength; - } else if(salt_ !== null) { - sLen = salt_.length(); - } else { - throw new Error('Salt length not specified or specific salt not given.'); - } - - if(salt_ !== null && salt_.length() !== sLen) { - throw new Error('Given salt length does not match length of given salt.'); - } - - var prng = options.prng || forge.random; - - var pssobj = {}; - - /** - * Encodes a PSS signature. - * - * This function implements EMSA-PSS-ENCODE as per RFC 3447, section 9.1.1. - * - * @param md the message digest object with the hash to sign. - * @param modsBits the length of the RSA modulus in bits. - * - * @return the encoded message as a binary-encoded string of length - * ceil((modBits - 1) / 8). - */ - pssobj.encode = function(md, modBits) { - var i; - var emBits = modBits - 1; - var emLen = Math.ceil(emBits / 8); - - /* 2. Let mHash = Hash(M), an octet string of length hLen. */ - var mHash = md.digest().getBytes(); - - /* 3. If emLen < hLen + sLen + 2, output "encoding error" and stop. */ - if(emLen < hLen + sLen + 2) { - throw new Error('Message is too long to encrypt.'); - } - - /* 4. Generate a random octet string salt of length sLen; if sLen = 0, - * then salt is the empty string. */ - var salt; - if(salt_ === null) { - salt = prng.getBytesSync(sLen); - } else { - salt = salt_.bytes(); - } - - /* 5. Let M' = (0x)00 00 00 00 00 00 00 00 || mHash || salt; */ - var m_ = new forge.util.ByteBuffer(); - m_.fillWithByte(0, 8); - m_.putBytes(mHash); - m_.putBytes(salt); - - /* 6. Let H = Hash(M'), an octet string of length hLen. */ - hash.start(); - hash.update(m_.getBytes()); - var h = hash.digest().getBytes(); - - /* 7. Generate an octet string PS consisting of emLen - sLen - hLen - 2 - * zero octets. The length of PS may be 0. */ - var ps = new forge.util.ByteBuffer(); - ps.fillWithByte(0, emLen - sLen - hLen - 2); - - /* 8. Let DB = PS || 0x01 || salt; DB is an octet string of length - * emLen - hLen - 1. */ - ps.putByte(0x01); - ps.putBytes(salt); - var db = ps.getBytes(); - - /* 9. Let dbMask = MGF(H, emLen - hLen - 1). */ - var maskLen = emLen - hLen - 1; - var dbMask = mgf.generate(h, maskLen); - - /* 10. Let maskedDB = DB \xor dbMask. */ - var maskedDB = ''; - for(i = 0; i < maskLen; i++) { - maskedDB += String.fromCharCode(db.charCodeAt(i) ^ dbMask.charCodeAt(i)); - } - - /* 11. Set the leftmost 8emLen - emBits bits of the leftmost octet in - * maskedDB to zero. */ - var mask = (0xFF00 >> (8 * emLen - emBits)) & 0xFF; - maskedDB = String.fromCharCode(maskedDB.charCodeAt(0) & ~mask) + - maskedDB.substr(1); - - /* 12. Let EM = maskedDB || H || 0xbc. - * 13. Output EM. */ - return maskedDB + h + String.fromCharCode(0xbc); - }; - - /** - * Verifies a PSS signature. - * - * This function implements EMSA-PSS-VERIFY as per RFC 3447, section 9.1.2. - * - * @param mHash the message digest hash, as a binary-encoded string, to - * compare against the signature. - * @param em the encoded message, as a binary-encoded string - * (RSA decryption result). - * @param modsBits the length of the RSA modulus in bits. - * - * @return true if the signature was verified, false if not. - */ - pssobj.verify = function(mHash, em, modBits) { - var i; - var emBits = modBits - 1; - var emLen = Math.ceil(emBits / 8); - - /* c. Convert the message representative m to an encoded message EM - * of length emLen = ceil((modBits - 1) / 8) octets, where modBits - * is the length in bits of the RSA modulus n */ - em = em.substr(-emLen); - - /* 3. If emLen < hLen + sLen + 2, output "inconsistent" and stop. */ - if(emLen < hLen + sLen + 2) { - throw new Error('Inconsistent parameters to PSS signature verification.'); - } - - /* 4. If the rightmost octet of EM does not have hexadecimal value - * 0xbc, output "inconsistent" and stop. */ - if(em.charCodeAt(emLen - 1) !== 0xbc) { - throw new Error('Encoded message does not end in 0xBC.'); - } - - /* 5. Let maskedDB be the leftmost emLen - hLen - 1 octets of EM, and - * let H be the next hLen octets. */ - var maskLen = emLen - hLen - 1; - var maskedDB = em.substr(0, maskLen); - var h = em.substr(maskLen, hLen); - - /* 6. If the leftmost 8emLen - emBits bits of the leftmost octet in - * maskedDB are not all equal to zero, output "inconsistent" and stop. */ - var mask = (0xFF00 >> (8 * emLen - emBits)) & 0xFF; - if((maskedDB.charCodeAt(0) & mask) !== 0) { - throw new Error('Bits beyond keysize not zero as expected.'); - } - - /* 7. Let dbMask = MGF(H, emLen - hLen - 1). */ - var dbMask = mgf.generate(h, maskLen); - - /* 8. Let DB = maskedDB \xor dbMask. */ - var db = ''; - for(i = 0; i < maskLen; i++) { - db += String.fromCharCode(maskedDB.charCodeAt(i) ^ dbMask.charCodeAt(i)); - } - - /* 9. Set the leftmost 8emLen - emBits bits of the leftmost octet - * in DB to zero. */ - db = String.fromCharCode(db.charCodeAt(0) & ~mask) + db.substr(1); - - /* 10. If the emLen - hLen - sLen - 2 leftmost octets of DB are not zero - * or if the octet at position emLen - hLen - sLen - 1 (the leftmost - * position is "position 1") does not have hexadecimal value 0x01, - * output "inconsistent" and stop. */ - var checkLen = emLen - hLen - sLen - 2; - for(i = 0; i < checkLen; i++) { - if(db.charCodeAt(i) !== 0x00) { - throw new Error('Leftmost octets not zero as expected'); - } - } - - if(db.charCodeAt(checkLen) !== 0x01) { - throw new Error('Inconsistent PSS signature, 0x01 marker not found'); - } - - /* 11. Let salt be the last sLen octets of DB. */ - var salt = db.substr(-sLen); - - /* 12. Let M' = (0x)00 00 00 00 00 00 00 00 || mHash || salt */ - var m_ = new forge.util.ByteBuffer(); - m_.fillWithByte(0, 8); - m_.putBytes(mHash); - m_.putBytes(salt); - - /* 13. Let H' = Hash(M'), an octet string of length hLen. */ - hash.start(); - hash.update(m_.getBytes()); - var h_ = hash.digest().getBytes(); - - /* 14. If H = H', output "consistent." Otherwise, output "inconsistent." */ - return h === h_; - }; - - return pssobj; -}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/random.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/random.js deleted file mode 100644 index d4e4bea9..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/random.js +++ /dev/null @@ -1,191 +0,0 @@ -/** - * An API for getting cryptographically-secure random bytes. The bytes are - * generated using the Fortuna algorithm devised by Bruce Schneier and - * Niels Ferguson. - * - * Getting strong random bytes is not yet easy to do in javascript. The only - * truish random entropy that can be collected is from the mouse, keyboard, or - * from timing with respect to page loads, etc. This generator makes a poor - * attempt at providing random bytes when those sources haven't yet provided - * enough entropy to initially seed or to reseed the PRNG. - * - * @author Dave Longley - * - * Copyright (c) 2009-2014 Digital Bazaar, Inc. - */ -var forge = require('./forge'); -require('./aes'); -require('./sha256'); -require('./prng'); -require('./util'); - -(function() { - -// forge.random already defined -if(forge.random && forge.random.getBytes) { - module.exports = forge.random; - return; -} - -(function(jQuery) { - -// the default prng plugin, uses AES-128 -var prng_aes = {}; -var _prng_aes_output = new Array(4); -var _prng_aes_buffer = forge.util.createBuffer(); -prng_aes.formatKey = function(key) { - // convert the key into 32-bit integers - var tmp = forge.util.createBuffer(key); - key = new Array(4); - key[0] = tmp.getInt32(); - key[1] = tmp.getInt32(); - key[2] = tmp.getInt32(); - key[3] = tmp.getInt32(); - - // return the expanded key - return forge.aes._expandKey(key, false); -}; -prng_aes.formatSeed = function(seed) { - // convert seed into 32-bit integers - var tmp = forge.util.createBuffer(seed); - seed = new Array(4); - seed[0] = tmp.getInt32(); - seed[1] = tmp.getInt32(); - seed[2] = tmp.getInt32(); - seed[3] = tmp.getInt32(); - return seed; -}; -prng_aes.cipher = function(key, seed) { - forge.aes._updateBlock(key, seed, _prng_aes_output, false); - _prng_aes_buffer.putInt32(_prng_aes_output[0]); - _prng_aes_buffer.putInt32(_prng_aes_output[1]); - _prng_aes_buffer.putInt32(_prng_aes_output[2]); - _prng_aes_buffer.putInt32(_prng_aes_output[3]); - return _prng_aes_buffer.getBytes(); -}; -prng_aes.increment = function(seed) { - // FIXME: do we care about carry or signed issues? - ++seed[3]; - return seed; -}; -prng_aes.md = forge.md.sha256; - -/** - * Creates a new PRNG. - */ -function spawnPrng() { - var ctx = forge.prng.create(prng_aes); - - /** - * Gets random bytes. If a native secure crypto API is unavailable, this - * method tries to make the bytes more unpredictable by drawing from data that - * can be collected from the user of the browser, eg: mouse movement. - * - * If a callback is given, this method will be called asynchronously. - * - * @param count the number of random bytes to get. - * @param [callback(err, bytes)] called once the operation completes. - * - * @return the random bytes in a string. - */ - ctx.getBytes = function(count, callback) { - return ctx.generate(count, callback); - }; - - /** - * Gets random bytes asynchronously. If a native secure crypto API is - * unavailable, this method tries to make the bytes more unpredictable by - * drawing from data that can be collected from the user of the browser, - * eg: mouse movement. - * - * @param count the number of random bytes to get. - * - * @return the random bytes in a string. - */ - ctx.getBytesSync = function(count) { - return ctx.generate(count); - }; - - return ctx; -} - -// create default prng context -var _ctx = spawnPrng(); - -// add other sources of entropy only if window.crypto.getRandomValues is not -// available -- otherwise this source will be automatically used by the prng -var getRandomValues = null; -var globalScope = forge.util.globalScope; -var _crypto = globalScope.crypto || globalScope.msCrypto; -if(_crypto && _crypto.getRandomValues) { - getRandomValues = function(arr) { - return _crypto.getRandomValues(arr); - }; -} - -if(forge.options.usePureJavaScript || - (!forge.util.isNodejs && !getRandomValues)) { - // if this is a web worker, do not use weak entropy, instead register to - // receive strong entropy asynchronously from the main thread - if(typeof window === 'undefined' || window.document === undefined) { - // FIXME: - } - - // get load time entropy - _ctx.collectInt(+new Date(), 32); - - // add some entropy from navigator object - if(typeof(navigator) !== 'undefined') { - var _navBytes = ''; - for(var key in navigator) { - try { - if(typeof(navigator[key]) == 'string') { - _navBytes += navigator[key]; - } - } catch(e) { - /* Some navigator keys might not be accessible, e.g. the geolocation - attribute throws an exception if touched in Mozilla chrome:// - context. - - Silently ignore this and just don't use this as a source of - entropy. */ - } - } - _ctx.collect(_navBytes); - _navBytes = null; - } - - // add mouse and keyboard collectors if jquery is available - if(jQuery) { - // set up mouse entropy capture - jQuery().mousemove(function(e) { - // add mouse coords - _ctx.collectInt(e.clientX, 16); - _ctx.collectInt(e.clientY, 16); - }); - - // set up keyboard entropy capture - jQuery().keypress(function(e) { - _ctx.collectInt(e.charCode, 8); - }); - } -} - -/* Random API */ -if(!forge.random) { - forge.random = _ctx; -} else { - // extend forge.random with _ctx - for(var key in _ctx) { - forge.random[key] = _ctx[key]; - } -} - -// expose spawn PRNG -forge.random.createInstance = spawnPrng; - -module.exports = forge.random; - -})(typeof(jQuery) !== 'undefined' ? jQuery : null); - -})(); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/rc2.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/rc2.js deleted file mode 100644 index e33f78a7..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/rc2.js +++ /dev/null @@ -1,410 +0,0 @@ -/** - * RC2 implementation. - * - * @author Stefan Siegl - * - * Copyright (c) 2012 Stefan Siegl - * - * Information on the RC2 cipher is available from RFC #2268, - * http://www.ietf.org/rfc/rfc2268.txt - */ -var forge = require('./forge'); -require('./util'); - -var piTable = [ - 0xd9, 0x78, 0xf9, 0xc4, 0x19, 0xdd, 0xb5, 0xed, 0x28, 0xe9, 0xfd, 0x79, 0x4a, 0xa0, 0xd8, 0x9d, - 0xc6, 0x7e, 0x37, 0x83, 0x2b, 0x76, 0x53, 0x8e, 0x62, 0x4c, 0x64, 0x88, 0x44, 0x8b, 0xfb, 0xa2, - 0x17, 0x9a, 0x59, 0xf5, 0x87, 0xb3, 0x4f, 0x13, 0x61, 0x45, 0x6d, 0x8d, 0x09, 0x81, 0x7d, 0x32, - 0xbd, 0x8f, 0x40, 0xeb, 0x86, 0xb7, 0x7b, 0x0b, 0xf0, 0x95, 0x21, 0x22, 0x5c, 0x6b, 0x4e, 0x82, - 0x54, 0xd6, 0x65, 0x93, 0xce, 0x60, 0xb2, 0x1c, 0x73, 0x56, 0xc0, 0x14, 0xa7, 0x8c, 0xf1, 0xdc, - 0x12, 0x75, 0xca, 0x1f, 0x3b, 0xbe, 0xe4, 0xd1, 0x42, 0x3d, 0xd4, 0x30, 0xa3, 0x3c, 0xb6, 0x26, - 0x6f, 0xbf, 0x0e, 0xda, 0x46, 0x69, 0x07, 0x57, 0x27, 0xf2, 0x1d, 0x9b, 0xbc, 0x94, 0x43, 0x03, - 0xf8, 0x11, 0xc7, 0xf6, 0x90, 0xef, 0x3e, 0xe7, 0x06, 0xc3, 0xd5, 0x2f, 0xc8, 0x66, 0x1e, 0xd7, - 0x08, 0xe8, 0xea, 0xde, 0x80, 0x52, 0xee, 0xf7, 0x84, 0xaa, 0x72, 0xac, 0x35, 0x4d, 0x6a, 0x2a, - 0x96, 0x1a, 0xd2, 0x71, 0x5a, 0x15, 0x49, 0x74, 0x4b, 0x9f, 0xd0, 0x5e, 0x04, 0x18, 0xa4, 0xec, - 0xc2, 0xe0, 0x41, 0x6e, 0x0f, 0x51, 0xcb, 0xcc, 0x24, 0x91, 0xaf, 0x50, 0xa1, 0xf4, 0x70, 0x39, - 0x99, 0x7c, 0x3a, 0x85, 0x23, 0xb8, 0xb4, 0x7a, 0xfc, 0x02, 0x36, 0x5b, 0x25, 0x55, 0x97, 0x31, - 0x2d, 0x5d, 0xfa, 0x98, 0xe3, 0x8a, 0x92, 0xae, 0x05, 0xdf, 0x29, 0x10, 0x67, 0x6c, 0xba, 0xc9, - 0xd3, 0x00, 0xe6, 0xcf, 0xe1, 0x9e, 0xa8, 0x2c, 0x63, 0x16, 0x01, 0x3f, 0x58, 0xe2, 0x89, 0xa9, - 0x0d, 0x38, 0x34, 0x1b, 0xab, 0x33, 0xff, 0xb0, 0xbb, 0x48, 0x0c, 0x5f, 0xb9, 0xb1, 0xcd, 0x2e, - 0xc5, 0xf3, 0xdb, 0x47, 0xe5, 0xa5, 0x9c, 0x77, 0x0a, 0xa6, 0x20, 0x68, 0xfe, 0x7f, 0xc1, 0xad -]; - -var s = [1, 2, 3, 5]; - -/** - * Rotate a word left by given number of bits. - * - * Bits that are shifted out on the left are put back in on the right - * hand side. - * - * @param word The word to shift left. - * @param bits The number of bits to shift by. - * @return The rotated word. - */ -var rol = function(word, bits) { - return ((word << bits) & 0xffff) | ((word & 0xffff) >> (16 - bits)); -}; - -/** - * Rotate a word right by given number of bits. - * - * Bits that are shifted out on the right are put back in on the left - * hand side. - * - * @param word The word to shift right. - * @param bits The number of bits to shift by. - * @return The rotated word. - */ -var ror = function(word, bits) { - return ((word & 0xffff) >> bits) | ((word << (16 - bits)) & 0xffff); -}; - -/* RC2 API */ -module.exports = forge.rc2 = forge.rc2 || {}; - -/** - * Perform RC2 key expansion as per RFC #2268, section 2. - * - * @param key variable-length user key (between 1 and 128 bytes) - * @param effKeyBits number of effective key bits (default: 128) - * @return the expanded RC2 key (ByteBuffer of 128 bytes) - */ -forge.rc2.expandKey = function(key, effKeyBits) { - if(typeof key === 'string') { - key = forge.util.createBuffer(key); - } - effKeyBits = effKeyBits || 128; - - /* introduce variables that match the names used in RFC #2268 */ - var L = key; - var T = key.length(); - var T1 = effKeyBits; - var T8 = Math.ceil(T1 / 8); - var TM = 0xff >> (T1 & 0x07); - var i; - - for(i = T; i < 128; i++) { - L.putByte(piTable[(L.at(i - 1) + L.at(i - T)) & 0xff]); - } - - L.setAt(128 - T8, piTable[L.at(128 - T8) & TM]); - - for(i = 127 - T8; i >= 0; i--) { - L.setAt(i, piTable[L.at(i + 1) ^ L.at(i + T8)]); - } - - return L; -}; - -/** - * Creates a RC2 cipher object. - * - * @param key the symmetric key to use (as base for key generation). - * @param bits the number of effective key bits. - * @param encrypt false for decryption, true for encryption. - * - * @return the cipher. - */ -var createCipher = function(key, bits, encrypt) { - var _finish = false, _input = null, _output = null, _iv = null; - var mixRound, mashRound; - var i, j, K = []; - - /* Expand key and fill into K[] Array */ - key = forge.rc2.expandKey(key, bits); - for(i = 0; i < 64; i++) { - K.push(key.getInt16Le()); - } - - if(encrypt) { - /** - * Perform one mixing round "in place". - * - * @param R Array of four words to perform mixing on. - */ - mixRound = function(R) { - for(i = 0; i < 4; i++) { - R[i] += K[j] + (R[(i + 3) % 4] & R[(i + 2) % 4]) + - ((~R[(i + 3) % 4]) & R[(i + 1) % 4]); - R[i] = rol(R[i], s[i]); - j++; - } - }; - - /** - * Perform one mashing round "in place". - * - * @param R Array of four words to perform mashing on. - */ - mashRound = function(R) { - for(i = 0; i < 4; i++) { - R[i] += K[R[(i + 3) % 4] & 63]; - } - }; - } else { - /** - * Perform one r-mixing round "in place". - * - * @param R Array of four words to perform mixing on. - */ - mixRound = function(R) { - for(i = 3; i >= 0; i--) { - R[i] = ror(R[i], s[i]); - R[i] -= K[j] + (R[(i + 3) % 4] & R[(i + 2) % 4]) + - ((~R[(i + 3) % 4]) & R[(i + 1) % 4]); - j--; - } - }; - - /** - * Perform one r-mashing round "in place". - * - * @param R Array of four words to perform mashing on. - */ - mashRound = function(R) { - for(i = 3; i >= 0; i--) { - R[i] -= K[R[(i + 3) % 4] & 63]; - } - }; - } - - /** - * Run the specified cipher execution plan. - * - * This function takes four words from the input buffer, applies the IV on - * it (if requested) and runs the provided execution plan. - * - * The plan must be put together in form of a array of arrays. Where the - * outer one is simply a list of steps to perform and the inner one needs - * to have two elements: the first one telling how many rounds to perform, - * the second one telling what to do (i.e. the function to call). - * - * @param {Array} plan The plan to execute. - */ - var runPlan = function(plan) { - var R = []; - - /* Get data from input buffer and fill the four words into R */ - for(i = 0; i < 4; i++) { - var val = _input.getInt16Le(); - - if(_iv !== null) { - if(encrypt) { - /* We're encrypting, apply the IV first. */ - val ^= _iv.getInt16Le(); - } else { - /* We're decryption, keep cipher text for next block. */ - _iv.putInt16Le(val); - } - } - - R.push(val & 0xffff); - } - - /* Reset global "j" variable as per spec. */ - j = encrypt ? 0 : 63; - - /* Run execution plan. */ - for(var ptr = 0; ptr < plan.length; ptr++) { - for(var ctr = 0; ctr < plan[ptr][0]; ctr++) { - plan[ptr][1](R); - } - } - - /* Write back result to output buffer. */ - for(i = 0; i < 4; i++) { - if(_iv !== null) { - if(encrypt) { - /* We're encrypting in CBC-mode, feed back encrypted bytes into - IV buffer to carry it forward to next block. */ - _iv.putInt16Le(R[i]); - } else { - R[i] ^= _iv.getInt16Le(); - } - } - - _output.putInt16Le(R[i]); - } - }; - - /* Create cipher object */ - var cipher = null; - cipher = { - /** - * Starts or restarts the encryption or decryption process, whichever - * was previously configured. - * - * To use the cipher in CBC mode, iv may be given either as a string - * of bytes, or as a byte buffer. For ECB mode, give null as iv. - * - * @param iv the initialization vector to use, null for ECB mode. - * @param output the output the buffer to write to, null to create one. - */ - start: function(iv, output) { - if(iv) { - /* CBC mode */ - if(typeof iv === 'string') { - iv = forge.util.createBuffer(iv); - } - } - - _finish = false; - _input = forge.util.createBuffer(); - _output = output || new forge.util.createBuffer(); - _iv = iv; - - cipher.output = _output; - }, - - /** - * Updates the next block. - * - * @param input the buffer to read from. - */ - update: function(input) { - if(!_finish) { - // not finishing, so fill the input buffer with more input - _input.putBuffer(input); - } - - while(_input.length() >= 8) { - runPlan([ - [ 5, mixRound ], - [ 1, mashRound ], - [ 6, mixRound ], - [ 1, mashRound ], - [ 5, mixRound ] - ]); - } - }, - - /** - * Finishes encrypting or decrypting. - * - * @param pad a padding function to use, null for PKCS#7 padding, - * signature(blockSize, buffer, decrypt). - * - * @return true if successful, false on error. - */ - finish: function(pad) { - var rval = true; - - if(encrypt) { - if(pad) { - rval = pad(8, _input, !encrypt); - } else { - // add PKCS#7 padding to block (each pad byte is the - // value of the number of pad bytes) - var padding = (_input.length() === 8) ? 8 : (8 - _input.length()); - _input.fillWithByte(padding, padding); - } - } - - if(rval) { - // do final update - _finish = true; - cipher.update(); - } - - if(!encrypt) { - // check for error: input data not a multiple of block size - rval = (_input.length() === 0); - if(rval) { - if(pad) { - rval = pad(8, _output, !encrypt); - } else { - // ensure padding byte count is valid - var len = _output.length(); - var count = _output.at(len - 1); - - if(count > len) { - rval = false; - } else { - // trim off padding bytes - _output.truncate(count); - } - } - } - } - - return rval; - } - }; - - return cipher; -}; - -/** - * Creates an RC2 cipher object to encrypt data in ECB or CBC mode using the - * given symmetric key. The output will be stored in the 'output' member - * of the returned cipher. - * - * The key and iv may be given as a string of bytes or a byte buffer. - * The cipher is initialized to use 128 effective key bits. - * - * @param key the symmetric key to use. - * @param iv the initialization vector to use. - * @param output the buffer to write to, null to create one. - * - * @return the cipher. - */ -forge.rc2.startEncrypting = function(key, iv, output) { - var cipher = forge.rc2.createEncryptionCipher(key, 128); - cipher.start(iv, output); - return cipher; -}; - -/** - * Creates an RC2 cipher object to encrypt data in ECB or CBC mode using the - * given symmetric key. - * - * The key may be given as a string of bytes or a byte buffer. - * - * To start encrypting call start() on the cipher with an iv and optional - * output buffer. - * - * @param key the symmetric key to use. - * - * @return the cipher. - */ -forge.rc2.createEncryptionCipher = function(key, bits) { - return createCipher(key, bits, true); -}; - -/** - * Creates an RC2 cipher object to decrypt data in ECB or CBC mode using the - * given symmetric key. The output will be stored in the 'output' member - * of the returned cipher. - * - * The key and iv may be given as a string of bytes or a byte buffer. - * The cipher is initialized to use 128 effective key bits. - * - * @param key the symmetric key to use. - * @param iv the initialization vector to use. - * @param output the buffer to write to, null to create one. - * - * @return the cipher. - */ -forge.rc2.startDecrypting = function(key, iv, output) { - var cipher = forge.rc2.createDecryptionCipher(key, 128); - cipher.start(iv, output); - return cipher; -}; - -/** - * Creates an RC2 cipher object to decrypt data in ECB or CBC mode using the - * given symmetric key. - * - * The key may be given as a string of bytes or a byte buffer. - * - * To start decrypting call start() on the cipher with an iv and optional - * output buffer. - * - * @param key the symmetric key to use. - * - * @return the cipher. - */ -forge.rc2.createDecryptionCipher = function(key, bits) { - return createCipher(key, bits, false); -}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/rsa.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/rsa.js deleted file mode 100644 index 5c73209f..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/rsa.js +++ /dev/null @@ -1,1949 +0,0 @@ -/** - * Javascript implementation of basic RSA algorithms. - * - * @author Dave Longley - * - * Copyright (c) 2010-2014 Digital Bazaar, Inc. - * - * The only algorithm currently supported for PKI is RSA. - * - * An RSA key is often stored in ASN.1 DER format. The SubjectPublicKeyInfo - * ASN.1 structure is composed of an algorithm of type AlgorithmIdentifier - * and a subjectPublicKey of type bit string. - * - * The AlgorithmIdentifier contains an Object Identifier (OID) and parameters - * for the algorithm, if any. In the case of RSA, there aren't any. - * - * SubjectPublicKeyInfo ::= SEQUENCE { - * algorithm AlgorithmIdentifier, - * subjectPublicKey BIT STRING - * } - * - * AlgorithmIdentifer ::= SEQUENCE { - * algorithm OBJECT IDENTIFIER, - * parameters ANY DEFINED BY algorithm OPTIONAL - * } - * - * For an RSA public key, the subjectPublicKey is: - * - * RSAPublicKey ::= SEQUENCE { - * modulus INTEGER, -- n - * publicExponent INTEGER -- e - * } - * - * PrivateKeyInfo ::= SEQUENCE { - * version Version, - * privateKeyAlgorithm PrivateKeyAlgorithmIdentifier, - * privateKey PrivateKey, - * attributes [0] IMPLICIT Attributes OPTIONAL - * } - * - * Version ::= INTEGER - * PrivateKeyAlgorithmIdentifier ::= AlgorithmIdentifier - * PrivateKey ::= OCTET STRING - * Attributes ::= SET OF Attribute - * - * An RSA private key as the following structure: - * - * RSAPrivateKey ::= SEQUENCE { - * version Version, - * modulus INTEGER, -- n - * publicExponent INTEGER, -- e - * privateExponent INTEGER, -- d - * prime1 INTEGER, -- p - * prime2 INTEGER, -- q - * exponent1 INTEGER, -- d mod (p-1) - * exponent2 INTEGER, -- d mod (q-1) - * coefficient INTEGER -- (inverse of q) mod p - * } - * - * Version ::= INTEGER - * - * The OID for the RSA key algorithm is: 1.2.840.113549.1.1.1 - */ -var forge = require('./forge'); -require('./asn1'); -require('./jsbn'); -require('./oids'); -require('./pkcs1'); -require('./prime'); -require('./random'); -require('./util'); - -if(typeof BigInteger === 'undefined') { - var BigInteger = forge.jsbn.BigInteger; -} - -var _crypto = forge.util.isNodejs ? require('crypto') : null; - -// shortcut for asn.1 API -var asn1 = forge.asn1; - -// shortcut for util API -var util = forge.util; - -/* - * RSA encryption and decryption, see RFC 2313. - */ -forge.pki = forge.pki || {}; -module.exports = forge.pki.rsa = forge.rsa = forge.rsa || {}; -var pki = forge.pki; - -// for finding primes, which are 30k+i for i = 1, 7, 11, 13, 17, 19, 23, 29 -var GCD_30_DELTA = [6, 4, 2, 4, 2, 4, 6, 2]; - -// validator for a PrivateKeyInfo structure -var privateKeyValidator = { - // PrivateKeyInfo - name: 'PrivateKeyInfo', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - value: [{ - // Version (INTEGER) - name: 'PrivateKeyInfo.version', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.INTEGER, - constructed: false, - capture: 'privateKeyVersion' - }, { - // privateKeyAlgorithm - name: 'PrivateKeyInfo.privateKeyAlgorithm', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - value: [{ - name: 'AlgorithmIdentifier.algorithm', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.OID, - constructed: false, - capture: 'privateKeyOid' - }] - }, { - // PrivateKey - name: 'PrivateKeyInfo', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.OCTETSTRING, - constructed: false, - capture: 'privateKey' - }] -}; - -// validator for an RSA private key -var rsaPrivateKeyValidator = { - // RSAPrivateKey - name: 'RSAPrivateKey', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - value: [{ - // Version (INTEGER) - name: 'RSAPrivateKey.version', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.INTEGER, - constructed: false, - capture: 'privateKeyVersion' - }, { - // modulus (n) - name: 'RSAPrivateKey.modulus', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.INTEGER, - constructed: false, - capture: 'privateKeyModulus' - }, { - // publicExponent (e) - name: 'RSAPrivateKey.publicExponent', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.INTEGER, - constructed: false, - capture: 'privateKeyPublicExponent' - }, { - // privateExponent (d) - name: 'RSAPrivateKey.privateExponent', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.INTEGER, - constructed: false, - capture: 'privateKeyPrivateExponent' - }, { - // prime1 (p) - name: 'RSAPrivateKey.prime1', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.INTEGER, - constructed: false, - capture: 'privateKeyPrime1' - }, { - // prime2 (q) - name: 'RSAPrivateKey.prime2', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.INTEGER, - constructed: false, - capture: 'privateKeyPrime2' - }, { - // exponent1 (d mod (p-1)) - name: 'RSAPrivateKey.exponent1', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.INTEGER, - constructed: false, - capture: 'privateKeyExponent1' - }, { - // exponent2 (d mod (q-1)) - name: 'RSAPrivateKey.exponent2', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.INTEGER, - constructed: false, - capture: 'privateKeyExponent2' - }, { - // coefficient ((inverse of q) mod p) - name: 'RSAPrivateKey.coefficient', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.INTEGER, - constructed: false, - capture: 'privateKeyCoefficient' - }] -}; - -// validator for an RSA public key -var rsaPublicKeyValidator = { - // RSAPublicKey - name: 'RSAPublicKey', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - value: [{ - // modulus (n) - name: 'RSAPublicKey.modulus', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.INTEGER, - constructed: false, - capture: 'publicKeyModulus' - }, { - // publicExponent (e) - name: 'RSAPublicKey.exponent', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.INTEGER, - constructed: false, - capture: 'publicKeyExponent' - }] -}; - -// validator for an SubjectPublicKeyInfo structure -// Note: Currently only works with an RSA public key -var publicKeyValidator = forge.pki.rsa.publicKeyValidator = { - name: 'SubjectPublicKeyInfo', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - captureAsn1: 'subjectPublicKeyInfo', - value: [{ - name: 'SubjectPublicKeyInfo.AlgorithmIdentifier', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - value: [{ - name: 'AlgorithmIdentifier.algorithm', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.OID, - constructed: false, - capture: 'publicKeyOid' - }] - }, { - // subjectPublicKey - name: 'SubjectPublicKeyInfo.subjectPublicKey', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.BITSTRING, - constructed: false, - value: [{ - // RSAPublicKey - name: 'SubjectPublicKeyInfo.subjectPublicKey.RSAPublicKey', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - optional: true, - captureAsn1: 'rsaPublicKey' - }] - }] -}; - -// validator for a DigestInfo structure -var digestInfoValidator = { - name: 'DigestInfo', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - value: [{ - name: 'DigestInfo.DigestAlgorithm', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - value: [{ - name: 'DigestInfo.DigestAlgorithm.algorithmIdentifier', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.OID, - constructed: false, - capture: 'algorithmIdentifier' - }, { - // NULL paramters - name: 'DigestInfo.DigestAlgorithm.parameters', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.NULL, - // captured only to check existence for md2 and md5 - capture: 'parameters', - optional: true, - constructed: false - }] - }, { - // digest - name: 'DigestInfo.digest', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.OCTETSTRING, - constructed: false, - capture: 'digest' - }] -}; - -/** - * Wrap digest in DigestInfo object. - * - * This function implements EMSA-PKCS1-v1_5-ENCODE as per RFC 3447. - * - * DigestInfo ::= SEQUENCE { - * digestAlgorithm DigestAlgorithmIdentifier, - * digest Digest - * } - * - * DigestAlgorithmIdentifier ::= AlgorithmIdentifier - * Digest ::= OCTET STRING - * - * @param md the message digest object with the hash to sign. - * - * @return the encoded message (ready for RSA encrytion) - */ -var emsaPkcs1v15encode = function(md) { - // get the oid for the algorithm - var oid; - if(md.algorithm in pki.oids) { - oid = pki.oids[md.algorithm]; - } else { - var error = new Error('Unknown message digest algorithm.'); - error.algorithm = md.algorithm; - throw error; - } - var oidBytes = asn1.oidToDer(oid).getBytes(); - - // create the digest info - var digestInfo = asn1.create( - asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, []); - var digestAlgorithm = asn1.create( - asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, []); - digestAlgorithm.value.push(asn1.create( - asn1.Class.UNIVERSAL, asn1.Type.OID, false, oidBytes)); - digestAlgorithm.value.push(asn1.create( - asn1.Class.UNIVERSAL, asn1.Type.NULL, false, '')); - var digest = asn1.create( - asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, - false, md.digest().getBytes()); - digestInfo.value.push(digestAlgorithm); - digestInfo.value.push(digest); - - // encode digest info - return asn1.toDer(digestInfo).getBytes(); -}; - -/** - * Performs x^c mod n (RSA encryption or decryption operation). - * - * @param x the number to raise and mod. - * @param key the key to use. - * @param pub true if the key is public, false if private. - * - * @return the result of x^c mod n. - */ -var _modPow = function(x, key, pub) { - if(pub) { - return x.modPow(key.e, key.n); - } - - if(!key.p || !key.q) { - // allow calculation without CRT params (slow) - return x.modPow(key.d, key.n); - } - - // pre-compute dP, dQ, and qInv if necessary - if(!key.dP) { - key.dP = key.d.mod(key.p.subtract(BigInteger.ONE)); - } - if(!key.dQ) { - key.dQ = key.d.mod(key.q.subtract(BigInteger.ONE)); - } - if(!key.qInv) { - key.qInv = key.q.modInverse(key.p); - } - - /* Chinese remainder theorem (CRT) states: - - Suppose n1, n2, ..., nk are positive integers which are pairwise - coprime (n1 and n2 have no common factors other than 1). For any - integers x1, x2, ..., xk there exists an integer x solving the - system of simultaneous congruences (where ~= means modularly - congruent so a ~= b mod n means a mod n = b mod n): - - x ~= x1 mod n1 - x ~= x2 mod n2 - ... - x ~= xk mod nk - - This system of congruences has a single simultaneous solution x - between 0 and n - 1. Furthermore, each xk solution and x itself - is congruent modulo the product n = n1*n2*...*nk. - So x1 mod n = x2 mod n = xk mod n = x mod n. - - The single simultaneous solution x can be solved with the following - equation: - - x = sum(xi*ri*si) mod n where ri = n/ni and si = ri^-1 mod ni. - - Where x is less than n, xi = x mod ni. - - For RSA we are only concerned with k = 2. The modulus n = pq, where - p and q are coprime. The RSA decryption algorithm is: - - y = x^d mod n - - Given the above: - - x1 = x^d mod p - r1 = n/p = q - s1 = q^-1 mod p - x2 = x^d mod q - r2 = n/q = p - s2 = p^-1 mod q - - So y = (x1r1s1 + x2r2s2) mod n - = ((x^d mod p)q(q^-1 mod p) + (x^d mod q)p(p^-1 mod q)) mod n - - According to Fermat's Little Theorem, if the modulus P is prime, - for any integer A not evenly divisible by P, A^(P-1) ~= 1 mod P. - Since A is not divisible by P it follows that if: - N ~= M mod (P - 1), then A^N mod P = A^M mod P. Therefore: - - A^N mod P = A^(M mod (P - 1)) mod P. (The latter takes less effort - to calculate). In order to calculate x^d mod p more quickly the - exponent d mod (p - 1) is stored in the RSA private key (the same - is done for x^d mod q). These values are referred to as dP and dQ - respectively. Therefore we now have: - - y = ((x^dP mod p)q(q^-1 mod p) + (x^dQ mod q)p(p^-1 mod q)) mod n - - Since we'll be reducing x^dP by modulo p (same for q) we can also - reduce x by p (and q respectively) before hand. Therefore, let - - xp = ((x mod p)^dP mod p), and - xq = ((x mod q)^dQ mod q), yielding: - - y = (xp*q*(q^-1 mod p) + xq*p*(p^-1 mod q)) mod n - - This can be further reduced to a simple algorithm that only - requires 1 inverse (the q inverse is used) to be used and stored. - The algorithm is called Garner's algorithm. If qInv is the - inverse of q, we simply calculate: - - y = (qInv*(xp - xq) mod p) * q + xq - - However, there are two further complications. First, we need to - ensure that xp > xq to prevent signed BigIntegers from being used - so we add p until this is true (since we will be mod'ing with - p anyway). Then, there is a known timing attack on algorithms - using the CRT. To mitigate this risk, "cryptographic blinding" - should be used. This requires simply generating a random number r - between 0 and n-1 and its inverse and multiplying x by r^e before - calculating y and then multiplying y by r^-1 afterwards. Note that - r must be coprime with n (gcd(r, n) === 1) in order to have an - inverse. - */ - - // cryptographic blinding - var r; - do { - r = new BigInteger( - forge.util.bytesToHex(forge.random.getBytes(key.n.bitLength() / 8)), - 16); - } while(r.compareTo(key.n) >= 0 || !r.gcd(key.n).equals(BigInteger.ONE)); - x = x.multiply(r.modPow(key.e, key.n)).mod(key.n); - - // calculate xp and xq - var xp = x.mod(key.p).modPow(key.dP, key.p); - var xq = x.mod(key.q).modPow(key.dQ, key.q); - - // xp must be larger than xq to avoid signed bit usage - while(xp.compareTo(xq) < 0) { - xp = xp.add(key.p); - } - - // do last step - var y = xp.subtract(xq) - .multiply(key.qInv).mod(key.p) - .multiply(key.q).add(xq); - - // remove effect of random for cryptographic blinding - y = y.multiply(r.modInverse(key.n)).mod(key.n); - - return y; -}; - -/** - * NOTE: THIS METHOD IS DEPRECATED, use 'sign' on a private key object or - * 'encrypt' on a public key object instead. - * - * Performs RSA encryption. - * - * The parameter bt controls whether to put padding bytes before the - * message passed in. Set bt to either true or false to disable padding - * completely (in order to handle e.g. EMSA-PSS encoding seperately before), - * signaling whether the encryption operation is a public key operation - * (i.e. encrypting data) or not, i.e. private key operation (data signing). - * - * For PKCS#1 v1.5 padding pass in the block type to use, i.e. either 0x01 - * (for signing) or 0x02 (for encryption). The key operation mode (private - * or public) is derived from this flag in that case). - * - * @param m the message to encrypt as a byte string. - * @param key the RSA key to use. - * @param bt for PKCS#1 v1.5 padding, the block type to use - * (0x01 for private key, 0x02 for public), - * to disable padding: true = public key, false = private key. - * - * @return the encrypted bytes as a string. - */ -pki.rsa.encrypt = function(m, key, bt) { - var pub = bt; - var eb; - - // get the length of the modulus in bytes - var k = Math.ceil(key.n.bitLength() / 8); - - if(bt !== false && bt !== true) { - // legacy, default to PKCS#1 v1.5 padding - pub = (bt === 0x02); - eb = _encodePkcs1_v1_5(m, key, bt); - } else { - eb = forge.util.createBuffer(); - eb.putBytes(m); - } - - // load encryption block as big integer 'x' - // FIXME: hex conversion inefficient, get BigInteger w/byte strings - var x = new BigInteger(eb.toHex(), 16); - - // do RSA encryption - var y = _modPow(x, key, pub); - - // convert y into the encrypted data byte string, if y is shorter in - // bytes than k, then prepend zero bytes to fill up ed - // FIXME: hex conversion inefficient, get BigInteger w/byte strings - var yhex = y.toString(16); - var ed = forge.util.createBuffer(); - var zeros = k - Math.ceil(yhex.length / 2); - while(zeros > 0) { - ed.putByte(0x00); - --zeros; - } - ed.putBytes(forge.util.hexToBytes(yhex)); - return ed.getBytes(); -}; - -/** - * NOTE: THIS METHOD IS DEPRECATED, use 'decrypt' on a private key object or - * 'verify' on a public key object instead. - * - * Performs RSA decryption. - * - * The parameter ml controls whether to apply PKCS#1 v1.5 padding - * or not. Set ml = false to disable padding removal completely - * (in order to handle e.g. EMSA-PSS later on) and simply pass back - * the RSA encryption block. - * - * @param ed the encrypted data to decrypt in as a byte string. - * @param key the RSA key to use. - * @param pub true for a public key operation, false for private. - * @param ml the message length, if known, false to disable padding. - * - * @return the decrypted message as a byte string. - */ -pki.rsa.decrypt = function(ed, key, pub, ml) { - // get the length of the modulus in bytes - var k = Math.ceil(key.n.bitLength() / 8); - - // error if the length of the encrypted data ED is not k - if(ed.length !== k) { - var error = new Error('Encrypted message length is invalid.'); - error.length = ed.length; - error.expected = k; - throw error; - } - - // convert encrypted data into a big integer - // FIXME: hex conversion inefficient, get BigInteger w/byte strings - var y = new BigInteger(forge.util.createBuffer(ed).toHex(), 16); - - // y must be less than the modulus or it wasn't the result of - // a previous mod operation (encryption) using that modulus - if(y.compareTo(key.n) >= 0) { - throw new Error('Encrypted message is invalid.'); - } - - // do RSA decryption - var x = _modPow(y, key, pub); - - // create the encryption block, if x is shorter in bytes than k, then - // prepend zero bytes to fill up eb - // FIXME: hex conversion inefficient, get BigInteger w/byte strings - var xhex = x.toString(16); - var eb = forge.util.createBuffer(); - var zeros = k - Math.ceil(xhex.length / 2); - while(zeros > 0) { - eb.putByte(0x00); - --zeros; - } - eb.putBytes(forge.util.hexToBytes(xhex)); - - if(ml !== false) { - // legacy, default to PKCS#1 v1.5 padding - return _decodePkcs1_v1_5(eb.getBytes(), key, pub); - } - - // return message - return eb.getBytes(); -}; - -/** - * Creates an RSA key-pair generation state object. It is used to allow - * key-generation to be performed in steps. It also allows for a UI to - * display progress updates. - * - * @param bits the size for the private key in bits, defaults to 2048. - * @param e the public exponent to use, defaults to 65537 (0x10001). - * @param [options] the options to use. - * prng a custom crypto-secure pseudo-random number generator to use, - * that must define "getBytesSync". - * algorithm the algorithm to use (default: 'PRIMEINC'). - * - * @return the state object to use to generate the key-pair. - */ -pki.rsa.createKeyPairGenerationState = function(bits, e, options) { - // TODO: migrate step-based prime generation code to forge.prime - - // set default bits - if(typeof(bits) === 'string') { - bits = parseInt(bits, 10); - } - bits = bits || 2048; - - // create prng with api that matches BigInteger secure random - options = options || {}; - var prng = options.prng || forge.random; - var rng = { - // x is an array to fill with bytes - nextBytes: function(x) { - var b = prng.getBytesSync(x.length); - for(var i = 0; i < x.length; ++i) { - x[i] = b.charCodeAt(i); - } - } - }; - - var algorithm = options.algorithm || 'PRIMEINC'; - - // create PRIMEINC algorithm state - var rval; - if(algorithm === 'PRIMEINC') { - rval = { - algorithm: algorithm, - state: 0, - bits: bits, - rng: rng, - eInt: e || 65537, - e: new BigInteger(null), - p: null, - q: null, - qBits: bits >> 1, - pBits: bits - (bits >> 1), - pqState: 0, - num: null, - keys: null - }; - rval.e.fromInt(rval.eInt); - } else { - throw new Error('Invalid key generation algorithm: ' + algorithm); - } - - return rval; -}; - -/** - * Attempts to runs the key-generation algorithm for at most n seconds - * (approximately) using the given state. When key-generation has completed, - * the keys will be stored in state.keys. - * - * To use this function to update a UI while generating a key or to prevent - * causing browser lockups/warnings, set "n" to a value other than 0. A - * simple pattern for generating a key and showing a progress indicator is: - * - * var state = pki.rsa.createKeyPairGenerationState(2048); - * var step = function() { - * // step key-generation, run algorithm for 100 ms, repeat - * if(!forge.pki.rsa.stepKeyPairGenerationState(state, 100)) { - * setTimeout(step, 1); - * } else { - * // key-generation complete - * // TODO: turn off progress indicator here - * // TODO: use the generated key-pair in "state.keys" - * } - * }; - * // TODO: turn on progress indicator here - * setTimeout(step, 0); - * - * @param state the state to use. - * @param n the maximum number of milliseconds to run the algorithm for, 0 - * to run the algorithm to completion. - * - * @return true if the key-generation completed, false if not. - */ -pki.rsa.stepKeyPairGenerationState = function(state, n) { - // set default algorithm if not set - if(!('algorithm' in state)) { - state.algorithm = 'PRIMEINC'; - } - - // TODO: migrate step-based prime generation code to forge.prime - // TODO: abstract as PRIMEINC algorithm - - // do key generation (based on Tom Wu's rsa.js, see jsbn.js license) - // with some minor optimizations and designed to run in steps - - // local state vars - var THIRTY = new BigInteger(null); - THIRTY.fromInt(30); - var deltaIdx = 0; - var op_or = function(x, y) {return x | y;}; - - // keep stepping until time limit is reached or done - var t1 = +new Date(); - var t2; - var total = 0; - while(state.keys === null && (n <= 0 || total < n)) { - // generate p or q - if(state.state === 0) { - /* Note: All primes are of the form: - - 30k+i, for i < 30 and gcd(30, i)=1, where there are 8 values for i - - When we generate a random number, we always align it at 30k + 1. Each - time the number is determined not to be prime we add to get to the - next 'i', eg: if the number was at 30k + 1 we add 6. */ - var bits = (state.p === null) ? state.pBits : state.qBits; - var bits1 = bits - 1; - - // get a random number - if(state.pqState === 0) { - state.num = new BigInteger(bits, state.rng); - // force MSB set - if(!state.num.testBit(bits1)) { - state.num.bitwiseTo( - BigInteger.ONE.shiftLeft(bits1), op_or, state.num); - } - // align number on 30k+1 boundary - state.num.dAddOffset(31 - state.num.mod(THIRTY).byteValue(), 0); - deltaIdx = 0; - - ++state.pqState; - } else if(state.pqState === 1) { - // try to make the number a prime - if(state.num.bitLength() > bits) { - // overflow, try again - state.pqState = 0; - // do primality test - } else if(state.num.isProbablePrime( - _getMillerRabinTests(state.num.bitLength()))) { - ++state.pqState; - } else { - // get next potential prime - state.num.dAddOffset(GCD_30_DELTA[deltaIdx++ % 8], 0); - } - } else if(state.pqState === 2) { - // ensure number is coprime with e - state.pqState = - (state.num.subtract(BigInteger.ONE).gcd(state.e) - .compareTo(BigInteger.ONE) === 0) ? 3 : 0; - } else if(state.pqState === 3) { - // store p or q - state.pqState = 0; - if(state.p === null) { - state.p = state.num; - } else { - state.q = state.num; - } - - // advance state if both p and q are ready - if(state.p !== null && state.q !== null) { - ++state.state; - } - state.num = null; - } - } else if(state.state === 1) { - // ensure p is larger than q (swap them if not) - if(state.p.compareTo(state.q) < 0) { - state.num = state.p; - state.p = state.q; - state.q = state.num; - } - ++state.state; - } else if(state.state === 2) { - // compute phi: (p - 1)(q - 1) (Euler's totient function) - state.p1 = state.p.subtract(BigInteger.ONE); - state.q1 = state.q.subtract(BigInteger.ONE); - state.phi = state.p1.multiply(state.q1); - ++state.state; - } else if(state.state === 3) { - // ensure e and phi are coprime - if(state.phi.gcd(state.e).compareTo(BigInteger.ONE) === 0) { - // phi and e are coprime, advance - ++state.state; - } else { - // phi and e aren't coprime, so generate a new p and q - state.p = null; - state.q = null; - state.state = 0; - } - } else if(state.state === 4) { - // create n, ensure n is has the right number of bits - state.n = state.p.multiply(state.q); - - // ensure n is right number of bits - if(state.n.bitLength() === state.bits) { - // success, advance - ++state.state; - } else { - // failed, get new q - state.q = null; - state.state = 0; - } - } else if(state.state === 5) { - // set keys - var d = state.e.modInverse(state.phi); - state.keys = { - privateKey: pki.rsa.setPrivateKey( - state.n, state.e, d, state.p, state.q, - d.mod(state.p1), d.mod(state.q1), - state.q.modInverse(state.p)), - publicKey: pki.rsa.setPublicKey(state.n, state.e) - }; - } - - // update timing - t2 = +new Date(); - total += t2 - t1; - t1 = t2; - } - - return state.keys !== null; -}; - -/** - * Generates an RSA public-private key pair in a single call. - * - * To generate a key-pair in steps (to allow for progress updates and to - * prevent blocking or warnings in slow browsers) then use the key-pair - * generation state functions. - * - * To generate a key-pair asynchronously (either through web-workers, if - * available, or by breaking up the work on the main thread), pass a - * callback function. - * - * @param [bits] the size for the private key in bits, defaults to 2048. - * @param [e] the public exponent to use, defaults to 65537. - * @param [options] options for key-pair generation, if given then 'bits' - * and 'e' must *not* be given: - * bits the size for the private key in bits, (default: 2048). - * e the public exponent to use, (default: 65537 (0x10001)). - * workerScript the worker script URL. - * workers the number of web workers (if supported) to use, - * (default: 2). - * workLoad the size of the work load, ie: number of possible prime - * numbers for each web worker to check per work assignment, - * (default: 100). - * prng a custom crypto-secure pseudo-random number generator to use, - * that must define "getBytesSync". Disables use of native APIs. - * algorithm the algorithm to use (default: 'PRIMEINC'). - * @param [callback(err, keypair)] called once the operation completes. - * - * @return an object with privateKey and publicKey properties. - */ -pki.rsa.generateKeyPair = function(bits, e, options, callback) { - // (bits), (options), (callback) - if(arguments.length === 1) { - if(typeof bits === 'object') { - options = bits; - bits = undefined; - } else if(typeof bits === 'function') { - callback = bits; - bits = undefined; - } - } else if(arguments.length === 2) { - // (bits, e), (bits, options), (bits, callback), (options, callback) - if(typeof bits === 'number') { - if(typeof e === 'function') { - callback = e; - e = undefined; - } else if(typeof e !== 'number') { - options = e; - e = undefined; - } - } else { - options = bits; - callback = e; - bits = undefined; - e = undefined; - } - } else if(arguments.length === 3) { - // (bits, e, options), (bits, e, callback), (bits, options, callback) - if(typeof e === 'number') { - if(typeof options === 'function') { - callback = options; - options = undefined; - } - } else { - callback = options; - options = e; - e = undefined; - } - } - options = options || {}; - if(bits === undefined) { - bits = options.bits || 2048; - } - if(e === undefined) { - e = options.e || 0x10001; - } - - // use native code if permitted, available, and parameters are acceptable - if(!forge.options.usePureJavaScript && !options.prng && - bits >= 256 && bits <= 16384 && (e === 0x10001 || e === 3)) { - if(callback) { - // try native async - if(_detectNodeCrypto('generateKeyPair')) { - return _crypto.generateKeyPair('rsa', { - modulusLength: bits, - publicExponent: e, - publicKeyEncoding: { - type: 'spki', - format: 'pem' - }, - privateKeyEncoding: { - type: 'pkcs8', - format: 'pem' - } - }, function(err, pub, priv) { - if(err) { - return callback(err); - } - callback(null, { - privateKey: pki.privateKeyFromPem(priv), - publicKey: pki.publicKeyFromPem(pub) - }); - }); - } - if(_detectSubtleCrypto('generateKey') && - _detectSubtleCrypto('exportKey')) { - // use standard native generateKey - return util.globalScope.crypto.subtle.generateKey({ - name: 'RSASSA-PKCS1-v1_5', - modulusLength: bits, - publicExponent: _intToUint8Array(e), - hash: {name: 'SHA-256'} - }, true /* key can be exported*/, ['sign', 'verify']) - .then(function(pair) { - return util.globalScope.crypto.subtle.exportKey( - 'pkcs8', pair.privateKey); - // avoiding catch(function(err) {...}) to support IE <= 8 - }).then(undefined, function(err) { - callback(err); - }).then(function(pkcs8) { - if(pkcs8) { - var privateKey = pki.privateKeyFromAsn1( - asn1.fromDer(forge.util.createBuffer(pkcs8))); - callback(null, { - privateKey: privateKey, - publicKey: pki.setRsaPublicKey(privateKey.n, privateKey.e) - }); - } - }); - } - if(_detectSubtleMsCrypto('generateKey') && - _detectSubtleMsCrypto('exportKey')) { - var genOp = util.globalScope.msCrypto.subtle.generateKey({ - name: 'RSASSA-PKCS1-v1_5', - modulusLength: bits, - publicExponent: _intToUint8Array(e), - hash: {name: 'SHA-256'} - }, true /* key can be exported*/, ['sign', 'verify']); - genOp.oncomplete = function(e) { - var pair = e.target.result; - var exportOp = util.globalScope.msCrypto.subtle.exportKey( - 'pkcs8', pair.privateKey); - exportOp.oncomplete = function(e) { - var pkcs8 = e.target.result; - var privateKey = pki.privateKeyFromAsn1( - asn1.fromDer(forge.util.createBuffer(pkcs8))); - callback(null, { - privateKey: privateKey, - publicKey: pki.setRsaPublicKey(privateKey.n, privateKey.e) - }); - }; - exportOp.onerror = function(err) { - callback(err); - }; - }; - genOp.onerror = function(err) { - callback(err); - }; - return; - } - } else { - // try native sync - if(_detectNodeCrypto('generateKeyPairSync')) { - var keypair = _crypto.generateKeyPairSync('rsa', { - modulusLength: bits, - publicExponent: e, - publicKeyEncoding: { - type: 'spki', - format: 'pem' - }, - privateKeyEncoding: { - type: 'pkcs8', - format: 'pem' - } - }); - return { - privateKey: pki.privateKeyFromPem(keypair.privateKey), - publicKey: pki.publicKeyFromPem(keypair.publicKey) - }; - } - } - } - - // use JavaScript implementation - var state = pki.rsa.createKeyPairGenerationState(bits, e, options); - if(!callback) { - pki.rsa.stepKeyPairGenerationState(state, 0); - return state.keys; - } - _generateKeyPair(state, options, callback); -}; - -/** - * Sets an RSA public key from BigIntegers modulus and exponent. - * - * @param n the modulus. - * @param e the exponent. - * - * @return the public key. - */ -pki.setRsaPublicKey = pki.rsa.setPublicKey = function(n, e) { - var key = { - n: n, - e: e - }; - - /** - * Encrypts the given data with this public key. Newer applications - * should use the 'RSA-OAEP' decryption scheme, 'RSAES-PKCS1-V1_5' is for - * legacy applications. - * - * @param data the byte string to encrypt. - * @param scheme the encryption scheme to use: - * 'RSAES-PKCS1-V1_5' (default), - * 'RSA-OAEP', - * 'RAW', 'NONE', or null to perform raw RSA encryption, - * an object with an 'encode' property set to a function - * with the signature 'function(data, key)' that returns - * a binary-encoded string representing the encoded data. - * @param schemeOptions any scheme-specific options. - * - * @return the encrypted byte string. - */ - key.encrypt = function(data, scheme, schemeOptions) { - if(typeof scheme === 'string') { - scheme = scheme.toUpperCase(); - } else if(scheme === undefined) { - scheme = 'RSAES-PKCS1-V1_5'; - } - - if(scheme === 'RSAES-PKCS1-V1_5') { - scheme = { - encode: function(m, key, pub) { - return _encodePkcs1_v1_5(m, key, 0x02).getBytes(); - } - }; - } else if(scheme === 'RSA-OAEP' || scheme === 'RSAES-OAEP') { - scheme = { - encode: function(m, key) { - return forge.pkcs1.encode_rsa_oaep(key, m, schemeOptions); - } - }; - } else if(['RAW', 'NONE', 'NULL', null].indexOf(scheme) !== -1) { - scheme = {encode: function(e) {return e;}}; - } else if(typeof scheme === 'string') { - throw new Error('Unsupported encryption scheme: "' + scheme + '".'); - } - - // do scheme-based encoding then rsa encryption - var e = scheme.encode(data, key, true); - return pki.rsa.encrypt(e, key, true); - }; - - /** - * Verifies the given signature against the given digest. - * - * PKCS#1 supports multiple (currently two) signature schemes: - * RSASSA-PKCS1-V1_5 and RSASSA-PSS. - * - * By default this implementation uses the "old scheme", i.e. - * RSASSA-PKCS1-V1_5, in which case once RSA-decrypted, the - * signature is an OCTET STRING that holds a DigestInfo. - * - * DigestInfo ::= SEQUENCE { - * digestAlgorithm DigestAlgorithmIdentifier, - * digest Digest - * } - * DigestAlgorithmIdentifier ::= AlgorithmIdentifier - * Digest ::= OCTET STRING - * - * To perform PSS signature verification, provide an instance - * of Forge PSS object as the scheme parameter. - * - * @param digest the message digest hash to compare against the signature, - * as a binary-encoded string. - * @param signature the signature to verify, as a binary-encoded string. - * @param scheme signature verification scheme to use: - * 'RSASSA-PKCS1-V1_5' or undefined for RSASSA PKCS#1 v1.5, - * a Forge PSS object for RSASSA-PSS, - * 'NONE' or null for none, DigestInfo will not be expected, but - * PKCS#1 v1.5 padding will still be used. - * @param options optional verify options - * _parseAllDigestBytes testing flag to control parsing of all - * digest bytes. Unsupported and not for general usage. - * (default: true) - * - * @return true if the signature was verified, false if not. - */ - key.verify = function(digest, signature, scheme, options) { - if(typeof scheme === 'string') { - scheme = scheme.toUpperCase(); - } else if(scheme === undefined) { - scheme = 'RSASSA-PKCS1-V1_5'; - } - if(options === undefined) { - options = { - _parseAllDigestBytes: true - }; - } - if(!('_parseAllDigestBytes' in options)) { - options._parseAllDigestBytes = true; - } - - if(scheme === 'RSASSA-PKCS1-V1_5') { - scheme = { - verify: function(digest, d) { - // remove padding - d = _decodePkcs1_v1_5(d, key, true); - // d is ASN.1 BER-encoded DigestInfo - var obj = asn1.fromDer(d, { - parseAllBytes: options._parseAllDigestBytes - }); - - // validate DigestInfo - var capture = {}; - var errors = []; - if(!asn1.validate(obj, digestInfoValidator, capture, errors)) { - var error = new Error( - 'ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 ' + - 'DigestInfo value.'); - error.errors = errors; - throw error; - } - // check hash algorithm identifier - // see PKCS1-v1-5DigestAlgorithms in RFC 8017 - // FIXME: add support to vaidator for strict value choices - var oid = asn1.derToOid(capture.algorithmIdentifier); - if(!(oid === forge.oids.md2 || - oid === forge.oids.md5 || - oid === forge.oids.sha1 || - oid === forge.oids.sha224 || - oid === forge.oids.sha256 || - oid === forge.oids.sha384 || - oid === forge.oids.sha512 || - oid === forge.oids['sha512-224'] || - oid === forge.oids['sha512-256'])) { - var error = new Error( - 'Unknown RSASSA-PKCS1-v1_5 DigestAlgorithm identifier.'); - error.oid = oid; - throw error; - } - - // special check for md2 and md5 that NULL parameters exist - if(oid === forge.oids.md2 || oid === forge.oids.md5) { - if(!('parameters' in capture)) { - throw new Error( - 'ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 ' + - 'DigestInfo value. ' + - 'Missing algorithm identifer NULL parameters.'); - } - } - - // compare the given digest to the decrypted one - return digest === capture.digest; - } - }; - } else if(scheme === 'NONE' || scheme === 'NULL' || scheme === null) { - scheme = { - verify: function(digest, d) { - // remove padding - d = _decodePkcs1_v1_5(d, key, true); - return digest === d; - } - }; - } - - // do rsa decryption w/o any decoding, then verify -- which does decoding - var d = pki.rsa.decrypt(signature, key, true, false); - return scheme.verify(digest, d, key.n.bitLength()); - }; - - return key; -}; - -/** - * Sets an RSA private key from BigIntegers modulus, exponent, primes, - * prime exponents, and modular multiplicative inverse. - * - * @param n the modulus. - * @param e the public exponent. - * @param d the private exponent ((inverse of e) mod n). - * @param p the first prime. - * @param q the second prime. - * @param dP exponent1 (d mod (p-1)). - * @param dQ exponent2 (d mod (q-1)). - * @param qInv ((inverse of q) mod p) - * - * @return the private key. - */ -pki.setRsaPrivateKey = pki.rsa.setPrivateKey = function( - n, e, d, p, q, dP, dQ, qInv) { - var key = { - n: n, - e: e, - d: d, - p: p, - q: q, - dP: dP, - dQ: dQ, - qInv: qInv - }; - - /** - * Decrypts the given data with this private key. The decryption scheme - * must match the one used to encrypt the data. - * - * @param data the byte string to decrypt. - * @param scheme the decryption scheme to use: - * 'RSAES-PKCS1-V1_5' (default), - * 'RSA-OAEP', - * 'RAW', 'NONE', or null to perform raw RSA decryption. - * @param schemeOptions any scheme-specific options. - * - * @return the decrypted byte string. - */ - key.decrypt = function(data, scheme, schemeOptions) { - if(typeof scheme === 'string') { - scheme = scheme.toUpperCase(); - } else if(scheme === undefined) { - scheme = 'RSAES-PKCS1-V1_5'; - } - - // do rsa decryption w/o any decoding - var d = pki.rsa.decrypt(data, key, false, false); - - if(scheme === 'RSAES-PKCS1-V1_5') { - scheme = {decode: _decodePkcs1_v1_5}; - } else if(scheme === 'RSA-OAEP' || scheme === 'RSAES-OAEP') { - scheme = { - decode: function(d, key) { - return forge.pkcs1.decode_rsa_oaep(key, d, schemeOptions); - } - }; - } else if(['RAW', 'NONE', 'NULL', null].indexOf(scheme) !== -1) { - scheme = {decode: function(d) {return d;}}; - } else { - throw new Error('Unsupported encryption scheme: "' + scheme + '".'); - } - - // decode according to scheme - return scheme.decode(d, key, false); - }; - - /** - * Signs the given digest, producing a signature. - * - * PKCS#1 supports multiple (currently two) signature schemes: - * RSASSA-PKCS1-V1_5 and RSASSA-PSS. - * - * By default this implementation uses the "old scheme", i.e. - * RSASSA-PKCS1-V1_5. In order to generate a PSS signature, provide - * an instance of Forge PSS object as the scheme parameter. - * - * @param md the message digest object with the hash to sign. - * @param scheme the signature scheme to use: - * 'RSASSA-PKCS1-V1_5' or undefined for RSASSA PKCS#1 v1.5, - * a Forge PSS object for RSASSA-PSS, - * 'NONE' or null for none, DigestInfo will not be used but - * PKCS#1 v1.5 padding will still be used. - * - * @return the signature as a byte string. - */ - key.sign = function(md, scheme) { - /* Note: The internal implementation of RSA operations is being - transitioned away from a PKCS#1 v1.5 hard-coded scheme. Some legacy - code like the use of an encoding block identifier 'bt' will eventually - be removed. */ - - // private key operation - var bt = false; - - if(typeof scheme === 'string') { - scheme = scheme.toUpperCase(); - } - - if(scheme === undefined || scheme === 'RSASSA-PKCS1-V1_5') { - scheme = {encode: emsaPkcs1v15encode}; - bt = 0x01; - } else if(scheme === 'NONE' || scheme === 'NULL' || scheme === null) { - scheme = {encode: function() {return md;}}; - bt = 0x01; - } - - // encode and then encrypt - var d = scheme.encode(md, key.n.bitLength()); - return pki.rsa.encrypt(d, key, bt); - }; - - return key; -}; - -/** - * Wraps an RSAPrivateKey ASN.1 object in an ASN.1 PrivateKeyInfo object. - * - * @param rsaKey the ASN.1 RSAPrivateKey. - * - * @return the ASN.1 PrivateKeyInfo. - */ -pki.wrapRsaPrivateKey = function(rsaKey) { - // PrivateKeyInfo - return asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // version (0) - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, - asn1.integerToDer(0).getBytes()), - // privateKeyAlgorithm - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - asn1.create( - asn1.Class.UNIVERSAL, asn1.Type.OID, false, - asn1.oidToDer(pki.oids.rsaEncryption).getBytes()), - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.NULL, false, '') - ]), - // PrivateKey - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false, - asn1.toDer(rsaKey).getBytes()) - ]); -}; - -/** - * Converts a private key from an ASN.1 object. - * - * @param obj the ASN.1 representation of a PrivateKeyInfo containing an - * RSAPrivateKey or an RSAPrivateKey. - * - * @return the private key. - */ -pki.privateKeyFromAsn1 = function(obj) { - // get PrivateKeyInfo - var capture = {}; - var errors = []; - if(asn1.validate(obj, privateKeyValidator, capture, errors)) { - obj = asn1.fromDer(forge.util.createBuffer(capture.privateKey)); - } - - // get RSAPrivateKey - capture = {}; - errors = []; - if(!asn1.validate(obj, rsaPrivateKeyValidator, capture, errors)) { - var error = new Error('Cannot read private key. ' + - 'ASN.1 object does not contain an RSAPrivateKey.'); - error.errors = errors; - throw error; - } - - // Note: Version is currently ignored. - // capture.privateKeyVersion - // FIXME: inefficient, get a BigInteger that uses byte strings - var n, e, d, p, q, dP, dQ, qInv; - n = forge.util.createBuffer(capture.privateKeyModulus).toHex(); - e = forge.util.createBuffer(capture.privateKeyPublicExponent).toHex(); - d = forge.util.createBuffer(capture.privateKeyPrivateExponent).toHex(); - p = forge.util.createBuffer(capture.privateKeyPrime1).toHex(); - q = forge.util.createBuffer(capture.privateKeyPrime2).toHex(); - dP = forge.util.createBuffer(capture.privateKeyExponent1).toHex(); - dQ = forge.util.createBuffer(capture.privateKeyExponent2).toHex(); - qInv = forge.util.createBuffer(capture.privateKeyCoefficient).toHex(); - - // set private key - return pki.setRsaPrivateKey( - new BigInteger(n, 16), - new BigInteger(e, 16), - new BigInteger(d, 16), - new BigInteger(p, 16), - new BigInteger(q, 16), - new BigInteger(dP, 16), - new BigInteger(dQ, 16), - new BigInteger(qInv, 16)); -}; - -/** - * Converts a private key to an ASN.1 RSAPrivateKey. - * - * @param key the private key. - * - * @return the ASN.1 representation of an RSAPrivateKey. - */ -pki.privateKeyToAsn1 = pki.privateKeyToRSAPrivateKey = function(key) { - // RSAPrivateKey - return asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // version (0 = only 2 primes, 1 multiple primes) - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, - asn1.integerToDer(0).getBytes()), - // modulus (n) - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, - _bnToBytes(key.n)), - // publicExponent (e) - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, - _bnToBytes(key.e)), - // privateExponent (d) - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, - _bnToBytes(key.d)), - // privateKeyPrime1 (p) - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, - _bnToBytes(key.p)), - // privateKeyPrime2 (q) - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, - _bnToBytes(key.q)), - // privateKeyExponent1 (dP) - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, - _bnToBytes(key.dP)), - // privateKeyExponent2 (dQ) - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, - _bnToBytes(key.dQ)), - // coefficient (qInv) - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, - _bnToBytes(key.qInv)) - ]); -}; - -/** - * Converts a public key from an ASN.1 SubjectPublicKeyInfo or RSAPublicKey. - * - * @param obj the asn1 representation of a SubjectPublicKeyInfo or RSAPublicKey. - * - * @return the public key. - */ -pki.publicKeyFromAsn1 = function(obj) { - // get SubjectPublicKeyInfo - var capture = {}; - var errors = []; - if(asn1.validate(obj, publicKeyValidator, capture, errors)) { - // get oid - var oid = asn1.derToOid(capture.publicKeyOid); - if(oid !== pki.oids.rsaEncryption) { - var error = new Error('Cannot read public key. Unknown OID.'); - error.oid = oid; - throw error; - } - obj = capture.rsaPublicKey; - } - - // get RSA params - errors = []; - if(!asn1.validate(obj, rsaPublicKeyValidator, capture, errors)) { - var error = new Error('Cannot read public key. ' + - 'ASN.1 object does not contain an RSAPublicKey.'); - error.errors = errors; - throw error; - } - - // FIXME: inefficient, get a BigInteger that uses byte strings - var n = forge.util.createBuffer(capture.publicKeyModulus).toHex(); - var e = forge.util.createBuffer(capture.publicKeyExponent).toHex(); - - // set public key - return pki.setRsaPublicKey( - new BigInteger(n, 16), - new BigInteger(e, 16)); -}; - -/** - * Converts a public key to an ASN.1 SubjectPublicKeyInfo. - * - * @param key the public key. - * - * @return the asn1 representation of a SubjectPublicKeyInfo. - */ -pki.publicKeyToAsn1 = pki.publicKeyToSubjectPublicKeyInfo = function(key) { - // SubjectPublicKeyInfo - return asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // AlgorithmIdentifier - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // algorithm - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false, - asn1.oidToDer(pki.oids.rsaEncryption).getBytes()), - // parameters (null) - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.NULL, false, '') - ]), - // subjectPublicKey - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.BITSTRING, false, [ - pki.publicKeyToRSAPublicKey(key) - ]) - ]); -}; - -/** - * Converts a public key to an ASN.1 RSAPublicKey. - * - * @param key the public key. - * - * @return the asn1 representation of a RSAPublicKey. - */ -pki.publicKeyToRSAPublicKey = function(key) { - // RSAPublicKey - return asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // modulus (n) - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, - _bnToBytes(key.n)), - // publicExponent (e) - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, - _bnToBytes(key.e)) - ]); -}; - -/** - * Encodes a message using PKCS#1 v1.5 padding. - * - * @param m the message to encode. - * @param key the RSA key to use. - * @param bt the block type to use, i.e. either 0x01 (for signing) or 0x02 - * (for encryption). - * - * @return the padded byte buffer. - */ -function _encodePkcs1_v1_5(m, key, bt) { - var eb = forge.util.createBuffer(); - - // get the length of the modulus in bytes - var k = Math.ceil(key.n.bitLength() / 8); - - /* use PKCS#1 v1.5 padding */ - if(m.length > (k - 11)) { - var error = new Error('Message is too long for PKCS#1 v1.5 padding.'); - error.length = m.length; - error.max = k - 11; - throw error; - } - - /* A block type BT, a padding string PS, and the data D shall be - formatted into an octet string EB, the encryption block: - - EB = 00 || BT || PS || 00 || D - - The block type BT shall be a single octet indicating the structure of - the encryption block. For this version of the document it shall have - value 00, 01, or 02. For a private-key operation, the block type - shall be 00 or 01. For a public-key operation, it shall be 02. - - The padding string PS shall consist of k-3-||D|| octets. For block - type 00, the octets shall have value 00; for block type 01, they - shall have value FF; and for block type 02, they shall be - pseudorandomly generated and nonzero. This makes the length of the - encryption block EB equal to k. */ - - // build the encryption block - eb.putByte(0x00); - eb.putByte(bt); - - // create the padding - var padNum = k - 3 - m.length; - var padByte; - // private key op - if(bt === 0x00 || bt === 0x01) { - padByte = (bt === 0x00) ? 0x00 : 0xFF; - for(var i = 0; i < padNum; ++i) { - eb.putByte(padByte); - } - } else { - // public key op - // pad with random non-zero values - while(padNum > 0) { - var numZeros = 0; - var padBytes = forge.random.getBytes(padNum); - for(var i = 0; i < padNum; ++i) { - padByte = padBytes.charCodeAt(i); - if(padByte === 0) { - ++numZeros; - } else { - eb.putByte(padByte); - } - } - padNum = numZeros; - } - } - - // zero followed by message - eb.putByte(0x00); - eb.putBytes(m); - - return eb; -} - -/** - * Decodes a message using PKCS#1 v1.5 padding. - * - * @param em the message to decode. - * @param key the RSA key to use. - * @param pub true if the key is a public key, false if it is private. - * @param ml the message length, if specified. - * - * @return the decoded bytes. - */ -function _decodePkcs1_v1_5(em, key, pub, ml) { - // get the length of the modulus in bytes - var k = Math.ceil(key.n.bitLength() / 8); - - /* It is an error if any of the following conditions occurs: - - 1. The encryption block EB cannot be parsed unambiguously. - 2. The padding string PS consists of fewer than eight octets - or is inconsisent with the block type BT. - 3. The decryption process is a public-key operation and the block - type BT is not 00 or 01, or the decryption process is a - private-key operation and the block type is not 02. - */ - - // parse the encryption block - var eb = forge.util.createBuffer(em); - var first = eb.getByte(); - var bt = eb.getByte(); - if(first !== 0x00 || - (pub && bt !== 0x00 && bt !== 0x01) || - (!pub && bt != 0x02) || - (pub && bt === 0x00 && typeof(ml) === 'undefined')) { - throw new Error('Encryption block is invalid.'); - } - - var padNum = 0; - if(bt === 0x00) { - // check all padding bytes for 0x00 - padNum = k - 3 - ml; - for(var i = 0; i < padNum; ++i) { - if(eb.getByte() !== 0x00) { - throw new Error('Encryption block is invalid.'); - } - } - } else if(bt === 0x01) { - // find the first byte that isn't 0xFF, should be after all padding - padNum = 0; - while(eb.length() > 1) { - if(eb.getByte() !== 0xFF) { - --eb.read; - break; - } - ++padNum; - } - } else if(bt === 0x02) { - // look for 0x00 byte - padNum = 0; - while(eb.length() > 1) { - if(eb.getByte() === 0x00) { - --eb.read; - break; - } - ++padNum; - } - } - - // zero must be 0x00 and padNum must be (k - 3 - message length) - var zero = eb.getByte(); - if(zero !== 0x00 || padNum !== (k - 3 - eb.length())) { - throw new Error('Encryption block is invalid.'); - } - - return eb.getBytes(); -} - -/** - * Runs the key-generation algorithm asynchronously, either in the background - * via Web Workers, or using the main thread and setImmediate. - * - * @param state the key-pair generation state. - * @param [options] options for key-pair generation: - * workerScript the worker script URL. - * workers the number of web workers (if supported) to use, - * (default: 2, -1 to use estimated cores minus one). - * workLoad the size of the work load, ie: number of possible prime - * numbers for each web worker to check per work assignment, - * (default: 100). - * @param callback(err, keypair) called once the operation completes. - */ -function _generateKeyPair(state, options, callback) { - if(typeof options === 'function') { - callback = options; - options = {}; - } - options = options || {}; - - var opts = { - algorithm: { - name: options.algorithm || 'PRIMEINC', - options: { - workers: options.workers || 2, - workLoad: options.workLoad || 100, - workerScript: options.workerScript - } - } - }; - if('prng' in options) { - opts.prng = options.prng; - } - - generate(); - - function generate() { - // find p and then q (done in series to simplify) - getPrime(state.pBits, function(err, num) { - if(err) { - return callback(err); - } - state.p = num; - if(state.q !== null) { - return finish(err, state.q); - } - getPrime(state.qBits, finish); - }); - } - - function getPrime(bits, callback) { - forge.prime.generateProbablePrime(bits, opts, callback); - } - - function finish(err, num) { - if(err) { - return callback(err); - } - - // set q - state.q = num; - - // ensure p is larger than q (swap them if not) - if(state.p.compareTo(state.q) < 0) { - var tmp = state.p; - state.p = state.q; - state.q = tmp; - } - - // ensure p is coprime with e - if(state.p.subtract(BigInteger.ONE).gcd(state.e) - .compareTo(BigInteger.ONE) !== 0) { - state.p = null; - generate(); - return; - } - - // ensure q is coprime with e - if(state.q.subtract(BigInteger.ONE).gcd(state.e) - .compareTo(BigInteger.ONE) !== 0) { - state.q = null; - getPrime(state.qBits, finish); - return; - } - - // compute phi: (p - 1)(q - 1) (Euler's totient function) - state.p1 = state.p.subtract(BigInteger.ONE); - state.q1 = state.q.subtract(BigInteger.ONE); - state.phi = state.p1.multiply(state.q1); - - // ensure e and phi are coprime - if(state.phi.gcd(state.e).compareTo(BigInteger.ONE) !== 0) { - // phi and e aren't coprime, so generate a new p and q - state.p = state.q = null; - generate(); - return; - } - - // create n, ensure n is has the right number of bits - state.n = state.p.multiply(state.q); - if(state.n.bitLength() !== state.bits) { - // failed, get new q - state.q = null; - getPrime(state.qBits, finish); - return; - } - - // set keys - var d = state.e.modInverse(state.phi); - state.keys = { - privateKey: pki.rsa.setPrivateKey( - state.n, state.e, d, state.p, state.q, - d.mod(state.p1), d.mod(state.q1), - state.q.modInverse(state.p)), - publicKey: pki.rsa.setPublicKey(state.n, state.e) - }; - - callback(null, state.keys); - } -} - -/** - * Converts a positive BigInteger into 2's-complement big-endian bytes. - * - * @param b the big integer to convert. - * - * @return the bytes. - */ -function _bnToBytes(b) { - // prepend 0x00 if first byte >= 0x80 - var hex = b.toString(16); - if(hex[0] >= '8') { - hex = '00' + hex; - } - var bytes = forge.util.hexToBytes(hex); - - // ensure integer is minimally-encoded - if(bytes.length > 1 && - // leading 0x00 for positive integer - ((bytes.charCodeAt(0) === 0 && - (bytes.charCodeAt(1) & 0x80) === 0) || - // leading 0xFF for negative integer - (bytes.charCodeAt(0) === 0xFF && - (bytes.charCodeAt(1) & 0x80) === 0x80))) { - return bytes.substr(1); - } - return bytes; -} - -/** - * Returns the required number of Miller-Rabin tests to generate a - * prime with an error probability of (1/2)^80. - * - * See Handbook of Applied Cryptography Chapter 4, Table 4.4. - * - * @param bits the bit size. - * - * @return the required number of iterations. - */ -function _getMillerRabinTests(bits) { - if(bits <= 100) return 27; - if(bits <= 150) return 18; - if(bits <= 200) return 15; - if(bits <= 250) return 12; - if(bits <= 300) return 9; - if(bits <= 350) return 8; - if(bits <= 400) return 7; - if(bits <= 500) return 6; - if(bits <= 600) return 5; - if(bits <= 800) return 4; - if(bits <= 1250) return 3; - return 2; -} - -/** - * Performs feature detection on the Node crypto interface. - * - * @param fn the feature (function) to detect. - * - * @return true if detected, false if not. - */ -function _detectNodeCrypto(fn) { - return forge.util.isNodejs && typeof _crypto[fn] === 'function'; -} - -/** - * Performs feature detection on the SubtleCrypto interface. - * - * @param fn the feature (function) to detect. - * - * @return true if detected, false if not. - */ -function _detectSubtleCrypto(fn) { - return (typeof util.globalScope !== 'undefined' && - typeof util.globalScope.crypto === 'object' && - typeof util.globalScope.crypto.subtle === 'object' && - typeof util.globalScope.crypto.subtle[fn] === 'function'); -} - -/** - * Performs feature detection on the deprecated Microsoft Internet Explorer - * outdated SubtleCrypto interface. This function should only be used after - * checking for the modern, standard SubtleCrypto interface. - * - * @param fn the feature (function) to detect. - * - * @return true if detected, false if not. - */ -function _detectSubtleMsCrypto(fn) { - return (typeof util.globalScope !== 'undefined' && - typeof util.globalScope.msCrypto === 'object' && - typeof util.globalScope.msCrypto.subtle === 'object' && - typeof util.globalScope.msCrypto.subtle[fn] === 'function'); -} - -function _intToUint8Array(x) { - var bytes = forge.util.hexToBytes(x.toString(16)); - var buffer = new Uint8Array(bytes.length); - for(var i = 0; i < bytes.length; ++i) { - buffer[i] = bytes.charCodeAt(i); - } - return buffer; -} - -function _privateKeyFromJwk(jwk) { - if(jwk.kty !== 'RSA') { - throw new Error( - 'Unsupported key algorithm "' + jwk.kty + '"; algorithm must be "RSA".'); - } - return pki.setRsaPrivateKey( - _base64ToBigInt(jwk.n), - _base64ToBigInt(jwk.e), - _base64ToBigInt(jwk.d), - _base64ToBigInt(jwk.p), - _base64ToBigInt(jwk.q), - _base64ToBigInt(jwk.dp), - _base64ToBigInt(jwk.dq), - _base64ToBigInt(jwk.qi)); -} - -function _publicKeyFromJwk(jwk) { - if(jwk.kty !== 'RSA') { - throw new Error('Key algorithm must be "RSA".'); - } - return pki.setRsaPublicKey( - _base64ToBigInt(jwk.n), - _base64ToBigInt(jwk.e)); -} - -function _base64ToBigInt(b64) { - return new BigInteger(forge.util.bytesToHex(forge.util.decode64(b64)), 16); -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/sha1.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/sha1.js deleted file mode 100644 index 5f84eb66..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/sha1.js +++ /dev/null @@ -1,319 +0,0 @@ -/** - * Secure Hash Algorithm with 160-bit digest (SHA-1) implementation. - * - * @author Dave Longley - * - * Copyright (c) 2010-2015 Digital Bazaar, Inc. - */ -var forge = require('./forge'); -require('./md'); -require('./util'); - -var sha1 = module.exports = forge.sha1 = forge.sha1 || {}; -forge.md.sha1 = forge.md.algorithms.sha1 = sha1; - -/** - * Creates a SHA-1 message digest object. - * - * @return a message digest object. - */ -sha1.create = function() { - // do initialization as necessary - if(!_initialized) { - _init(); - } - - // SHA-1 state contains five 32-bit integers - var _state = null; - - // input buffer - var _input = forge.util.createBuffer(); - - // used for word storage - var _w = new Array(80); - - // message digest object - var md = { - algorithm: 'sha1', - blockLength: 64, - digestLength: 20, - // 56-bit length of message so far (does not including padding) - messageLength: 0, - // true message length - fullMessageLength: null, - // size of message length in bytes - messageLengthSize: 8 - }; - - /** - * Starts the digest. - * - * @return this digest object. - */ - md.start = function() { - // up to 56-bit message length for convenience - md.messageLength = 0; - - // full message length (set md.messageLength64 for backwards-compatibility) - md.fullMessageLength = md.messageLength64 = []; - var int32s = md.messageLengthSize / 4; - for(var i = 0; i < int32s; ++i) { - md.fullMessageLength.push(0); - } - _input = forge.util.createBuffer(); - _state = { - h0: 0x67452301, - h1: 0xEFCDAB89, - h2: 0x98BADCFE, - h3: 0x10325476, - h4: 0xC3D2E1F0 - }; - return md; - }; - // start digest automatically for first time - md.start(); - - /** - * Updates the digest with the given message input. The given input can - * treated as raw input (no encoding will be applied) or an encoding of - * 'utf8' maybe given to encode the input using UTF-8. - * - * @param msg the message input to update with. - * @param encoding the encoding to use (default: 'raw', other: 'utf8'). - * - * @return this digest object. - */ - md.update = function(msg, encoding) { - if(encoding === 'utf8') { - msg = forge.util.encodeUtf8(msg); - } - - // update message length - var len = msg.length; - md.messageLength += len; - len = [(len / 0x100000000) >>> 0, len >>> 0]; - for(var i = md.fullMessageLength.length - 1; i >= 0; --i) { - md.fullMessageLength[i] += len[1]; - len[1] = len[0] + ((md.fullMessageLength[i] / 0x100000000) >>> 0); - md.fullMessageLength[i] = md.fullMessageLength[i] >>> 0; - len[0] = ((len[1] / 0x100000000) >>> 0); - } - - // add bytes to input buffer - _input.putBytes(msg); - - // process bytes - _update(_state, _w, _input); - - // compact input buffer every 2K or if empty - if(_input.read > 2048 || _input.length() === 0) { - _input.compact(); - } - - return md; - }; - - /** - * Produces the digest. - * - * @return a byte buffer containing the digest value. - */ - md.digest = function() { - /* Note: Here we copy the remaining bytes in the input buffer and - add the appropriate SHA-1 padding. Then we do the final update - on a copy of the state so that if the user wants to get - intermediate digests they can do so. */ - - /* Determine the number of bytes that must be added to the message - to ensure its length is congruent to 448 mod 512. In other words, - the data to be digested must be a multiple of 512 bits (or 128 bytes). - This data includes the message, some padding, and the length of the - message. Since the length of the message will be encoded as 8 bytes (64 - bits), that means that the last segment of the data must have 56 bytes - (448 bits) of message and padding. Therefore, the length of the message - plus the padding must be congruent to 448 mod 512 because - 512 - 128 = 448. - - In order to fill up the message length it must be filled with - padding that begins with 1 bit followed by all 0 bits. Padding - must *always* be present, so if the message length is already - congruent to 448 mod 512, then 512 padding bits must be added. */ - - var finalBlock = forge.util.createBuffer(); - finalBlock.putBytes(_input.bytes()); - - // compute remaining size to be digested (include message length size) - var remaining = ( - md.fullMessageLength[md.fullMessageLength.length - 1] + - md.messageLengthSize); - - // add padding for overflow blockSize - overflow - // _padding starts with 1 byte with first bit is set (byte value 128), then - // there may be up to (blockSize - 1) other pad bytes - var overflow = remaining & (md.blockLength - 1); - finalBlock.putBytes(_padding.substr(0, md.blockLength - overflow)); - - // serialize message length in bits in big-endian order; since length - // is stored in bytes we multiply by 8 and add carry from next int - var next, carry; - var bits = md.fullMessageLength[0] * 8; - for(var i = 0; i < md.fullMessageLength.length - 1; ++i) { - next = md.fullMessageLength[i + 1] * 8; - carry = (next / 0x100000000) >>> 0; - bits += carry; - finalBlock.putInt32(bits >>> 0); - bits = next >>> 0; - } - finalBlock.putInt32(bits); - - var s2 = { - h0: _state.h0, - h1: _state.h1, - h2: _state.h2, - h3: _state.h3, - h4: _state.h4 - }; - _update(s2, _w, finalBlock); - var rval = forge.util.createBuffer(); - rval.putInt32(s2.h0); - rval.putInt32(s2.h1); - rval.putInt32(s2.h2); - rval.putInt32(s2.h3); - rval.putInt32(s2.h4); - return rval; - }; - - return md; -}; - -// sha-1 padding bytes not initialized yet -var _padding = null; -var _initialized = false; - -/** - * Initializes the constant tables. - */ -function _init() { - // create padding - _padding = String.fromCharCode(128); - _padding += forge.util.fillString(String.fromCharCode(0x00), 64); - - // now initialized - _initialized = true; -} - -/** - * Updates a SHA-1 state with the given byte buffer. - * - * @param s the SHA-1 state to update. - * @param w the array to use to store words. - * @param bytes the byte buffer to update with. - */ -function _update(s, w, bytes) { - // consume 512 bit (64 byte) chunks - var t, a, b, c, d, e, f, i; - var len = bytes.length(); - while(len >= 64) { - // the w array will be populated with sixteen 32-bit big-endian words - // and then extended into 80 32-bit words according to SHA-1 algorithm - // and for 32-79 using Max Locktyukhin's optimization - - // initialize hash value for this chunk - a = s.h0; - b = s.h1; - c = s.h2; - d = s.h3; - e = s.h4; - - // round 1 - for(i = 0; i < 16; ++i) { - t = bytes.getInt32(); - w[i] = t; - f = d ^ (b & (c ^ d)); - t = ((a << 5) | (a >>> 27)) + f + e + 0x5A827999 + t; - e = d; - d = c; - // `>>> 0` necessary to avoid iOS/Safari 10 optimization bug - c = ((b << 30) | (b >>> 2)) >>> 0; - b = a; - a = t; - } - for(; i < 20; ++i) { - t = (w[i - 3] ^ w[i - 8] ^ w[i - 14] ^ w[i - 16]); - t = (t << 1) | (t >>> 31); - w[i] = t; - f = d ^ (b & (c ^ d)); - t = ((a << 5) | (a >>> 27)) + f + e + 0x5A827999 + t; - e = d; - d = c; - // `>>> 0` necessary to avoid iOS/Safari 10 optimization bug - c = ((b << 30) | (b >>> 2)) >>> 0; - b = a; - a = t; - } - // round 2 - for(; i < 32; ++i) { - t = (w[i - 3] ^ w[i - 8] ^ w[i - 14] ^ w[i - 16]); - t = (t << 1) | (t >>> 31); - w[i] = t; - f = b ^ c ^ d; - t = ((a << 5) | (a >>> 27)) + f + e + 0x6ED9EBA1 + t; - e = d; - d = c; - // `>>> 0` necessary to avoid iOS/Safari 10 optimization bug - c = ((b << 30) | (b >>> 2)) >>> 0; - b = a; - a = t; - } - for(; i < 40; ++i) { - t = (w[i - 6] ^ w[i - 16] ^ w[i - 28] ^ w[i - 32]); - t = (t << 2) | (t >>> 30); - w[i] = t; - f = b ^ c ^ d; - t = ((a << 5) | (a >>> 27)) + f + e + 0x6ED9EBA1 + t; - e = d; - d = c; - // `>>> 0` necessary to avoid iOS/Safari 10 optimization bug - c = ((b << 30) | (b >>> 2)) >>> 0; - b = a; - a = t; - } - // round 3 - for(; i < 60; ++i) { - t = (w[i - 6] ^ w[i - 16] ^ w[i - 28] ^ w[i - 32]); - t = (t << 2) | (t >>> 30); - w[i] = t; - f = (b & c) | (d & (b ^ c)); - t = ((a << 5) | (a >>> 27)) + f + e + 0x8F1BBCDC + t; - e = d; - d = c; - // `>>> 0` necessary to avoid iOS/Safari 10 optimization bug - c = ((b << 30) | (b >>> 2)) >>> 0; - b = a; - a = t; - } - // round 4 - for(; i < 80; ++i) { - t = (w[i - 6] ^ w[i - 16] ^ w[i - 28] ^ w[i - 32]); - t = (t << 2) | (t >>> 30); - w[i] = t; - f = b ^ c ^ d; - t = ((a << 5) | (a >>> 27)) + f + e + 0xCA62C1D6 + t; - e = d; - d = c; - // `>>> 0` necessary to avoid iOS/Safari 10 optimization bug - c = ((b << 30) | (b >>> 2)) >>> 0; - b = a; - a = t; - } - - // update hash state - s.h0 = (s.h0 + a) | 0; - s.h1 = (s.h1 + b) | 0; - s.h2 = (s.h2 + c) | 0; - s.h3 = (s.h3 + d) | 0; - s.h4 = (s.h4 + e) | 0; - - len -= 64; - } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/sha256.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/sha256.js deleted file mode 100644 index 0659ad71..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/sha256.js +++ /dev/null @@ -1,327 +0,0 @@ -/** - * Secure Hash Algorithm with 256-bit digest (SHA-256) implementation. - * - * See FIPS 180-2 for details. - * - * @author Dave Longley - * - * Copyright (c) 2010-2015 Digital Bazaar, Inc. - */ -var forge = require('./forge'); -require('./md'); -require('./util'); - -var sha256 = module.exports = forge.sha256 = forge.sha256 || {}; -forge.md.sha256 = forge.md.algorithms.sha256 = sha256; - -/** - * Creates a SHA-256 message digest object. - * - * @return a message digest object. - */ -sha256.create = function() { - // do initialization as necessary - if(!_initialized) { - _init(); - } - - // SHA-256 state contains eight 32-bit integers - var _state = null; - - // input buffer - var _input = forge.util.createBuffer(); - - // used for word storage - var _w = new Array(64); - - // message digest object - var md = { - algorithm: 'sha256', - blockLength: 64, - digestLength: 32, - // 56-bit length of message so far (does not including padding) - messageLength: 0, - // true message length - fullMessageLength: null, - // size of message length in bytes - messageLengthSize: 8 - }; - - /** - * Starts the digest. - * - * @return this digest object. - */ - md.start = function() { - // up to 56-bit message length for convenience - md.messageLength = 0; - - // full message length (set md.messageLength64 for backwards-compatibility) - md.fullMessageLength = md.messageLength64 = []; - var int32s = md.messageLengthSize / 4; - for(var i = 0; i < int32s; ++i) { - md.fullMessageLength.push(0); - } - _input = forge.util.createBuffer(); - _state = { - h0: 0x6A09E667, - h1: 0xBB67AE85, - h2: 0x3C6EF372, - h3: 0xA54FF53A, - h4: 0x510E527F, - h5: 0x9B05688C, - h6: 0x1F83D9AB, - h7: 0x5BE0CD19 - }; - return md; - }; - // start digest automatically for first time - md.start(); - - /** - * Updates the digest with the given message input. The given input can - * treated as raw input (no encoding will be applied) or an encoding of - * 'utf8' maybe given to encode the input using UTF-8. - * - * @param msg the message input to update with. - * @param encoding the encoding to use (default: 'raw', other: 'utf8'). - * - * @return this digest object. - */ - md.update = function(msg, encoding) { - if(encoding === 'utf8') { - msg = forge.util.encodeUtf8(msg); - } - - // update message length - var len = msg.length; - md.messageLength += len; - len = [(len / 0x100000000) >>> 0, len >>> 0]; - for(var i = md.fullMessageLength.length - 1; i >= 0; --i) { - md.fullMessageLength[i] += len[1]; - len[1] = len[0] + ((md.fullMessageLength[i] / 0x100000000) >>> 0); - md.fullMessageLength[i] = md.fullMessageLength[i] >>> 0; - len[0] = ((len[1] / 0x100000000) >>> 0); - } - - // add bytes to input buffer - _input.putBytes(msg); - - // process bytes - _update(_state, _w, _input); - - // compact input buffer every 2K or if empty - if(_input.read > 2048 || _input.length() === 0) { - _input.compact(); - } - - return md; - }; - - /** - * Produces the digest. - * - * @return a byte buffer containing the digest value. - */ - md.digest = function() { - /* Note: Here we copy the remaining bytes in the input buffer and - add the appropriate SHA-256 padding. Then we do the final update - on a copy of the state so that if the user wants to get - intermediate digests they can do so. */ - - /* Determine the number of bytes that must be added to the message - to ensure its length is congruent to 448 mod 512. In other words, - the data to be digested must be a multiple of 512 bits (or 128 bytes). - This data includes the message, some padding, and the length of the - message. Since the length of the message will be encoded as 8 bytes (64 - bits), that means that the last segment of the data must have 56 bytes - (448 bits) of message and padding. Therefore, the length of the message - plus the padding must be congruent to 448 mod 512 because - 512 - 128 = 448. - - In order to fill up the message length it must be filled with - padding that begins with 1 bit followed by all 0 bits. Padding - must *always* be present, so if the message length is already - congruent to 448 mod 512, then 512 padding bits must be added. */ - - var finalBlock = forge.util.createBuffer(); - finalBlock.putBytes(_input.bytes()); - - // compute remaining size to be digested (include message length size) - var remaining = ( - md.fullMessageLength[md.fullMessageLength.length - 1] + - md.messageLengthSize); - - // add padding for overflow blockSize - overflow - // _padding starts with 1 byte with first bit is set (byte value 128), then - // there may be up to (blockSize - 1) other pad bytes - var overflow = remaining & (md.blockLength - 1); - finalBlock.putBytes(_padding.substr(0, md.blockLength - overflow)); - - // serialize message length in bits in big-endian order; since length - // is stored in bytes we multiply by 8 and add carry from next int - var next, carry; - var bits = md.fullMessageLength[0] * 8; - for(var i = 0; i < md.fullMessageLength.length - 1; ++i) { - next = md.fullMessageLength[i + 1] * 8; - carry = (next / 0x100000000) >>> 0; - bits += carry; - finalBlock.putInt32(bits >>> 0); - bits = next >>> 0; - } - finalBlock.putInt32(bits); - - var s2 = { - h0: _state.h0, - h1: _state.h1, - h2: _state.h2, - h3: _state.h3, - h4: _state.h4, - h5: _state.h5, - h6: _state.h6, - h7: _state.h7 - }; - _update(s2, _w, finalBlock); - var rval = forge.util.createBuffer(); - rval.putInt32(s2.h0); - rval.putInt32(s2.h1); - rval.putInt32(s2.h2); - rval.putInt32(s2.h3); - rval.putInt32(s2.h4); - rval.putInt32(s2.h5); - rval.putInt32(s2.h6); - rval.putInt32(s2.h7); - return rval; - }; - - return md; -}; - -// sha-256 padding bytes not initialized yet -var _padding = null; -var _initialized = false; - -// table of constants -var _k = null; - -/** - * Initializes the constant tables. - */ -function _init() { - // create padding - _padding = String.fromCharCode(128); - _padding += forge.util.fillString(String.fromCharCode(0x00), 64); - - // create K table for SHA-256 - _k = [ - 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, - 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5, - 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, - 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174, - 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, - 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da, - 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, - 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967, - 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, - 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85, - 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, - 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070, - 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, - 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3, - 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, - 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2]; - - // now initialized - _initialized = true; -} - -/** - * Updates a SHA-256 state with the given byte buffer. - * - * @param s the SHA-256 state to update. - * @param w the array to use to store words. - * @param bytes the byte buffer to update with. - */ -function _update(s, w, bytes) { - // consume 512 bit (64 byte) chunks - var t1, t2, s0, s1, ch, maj, i, a, b, c, d, e, f, g, h; - var len = bytes.length(); - while(len >= 64) { - // the w array will be populated with sixteen 32-bit big-endian words - // and then extended into 64 32-bit words according to SHA-256 - for(i = 0; i < 16; ++i) { - w[i] = bytes.getInt32(); - } - for(; i < 64; ++i) { - // XOR word 2 words ago rot right 17, rot right 19, shft right 10 - t1 = w[i - 2]; - t1 = - ((t1 >>> 17) | (t1 << 15)) ^ - ((t1 >>> 19) | (t1 << 13)) ^ - (t1 >>> 10); - // XOR word 15 words ago rot right 7, rot right 18, shft right 3 - t2 = w[i - 15]; - t2 = - ((t2 >>> 7) | (t2 << 25)) ^ - ((t2 >>> 18) | (t2 << 14)) ^ - (t2 >>> 3); - // sum(t1, word 7 ago, t2, word 16 ago) modulo 2^32 - w[i] = (t1 + w[i - 7] + t2 + w[i - 16]) | 0; - } - - // initialize hash value for this chunk - a = s.h0; - b = s.h1; - c = s.h2; - d = s.h3; - e = s.h4; - f = s.h5; - g = s.h6; - h = s.h7; - - // round function - for(i = 0; i < 64; ++i) { - // Sum1(e) - s1 = - ((e >>> 6) | (e << 26)) ^ - ((e >>> 11) | (e << 21)) ^ - ((e >>> 25) | (e << 7)); - // Ch(e, f, g) (optimized the same way as SHA-1) - ch = g ^ (e & (f ^ g)); - // Sum0(a) - s0 = - ((a >>> 2) | (a << 30)) ^ - ((a >>> 13) | (a << 19)) ^ - ((a >>> 22) | (a << 10)); - // Maj(a, b, c) (optimized the same way as SHA-1) - maj = (a & b) | (c & (a ^ b)); - - // main algorithm - t1 = h + s1 + ch + _k[i] + w[i]; - t2 = s0 + maj; - h = g; - g = f; - f = e; - // `>>> 0` necessary to avoid iOS/Safari 10 optimization bug - // can't truncate with `| 0` - e = (d + t1) >>> 0; - d = c; - c = b; - b = a; - // `>>> 0` necessary to avoid iOS/Safari 10 optimization bug - // can't truncate with `| 0` - a = (t1 + t2) >>> 0; - } - - // update hash state - s.h0 = (s.h0 + a) | 0; - s.h1 = (s.h1 + b) | 0; - s.h2 = (s.h2 + c) | 0; - s.h3 = (s.h3 + d) | 0; - s.h4 = (s.h4 + e) | 0; - s.h5 = (s.h5 + f) | 0; - s.h6 = (s.h6 + g) | 0; - s.h7 = (s.h7 + h) | 0; - len -= 64; - } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/sha512.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/sha512.js deleted file mode 100644 index e09b442a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/sha512.js +++ /dev/null @@ -1,561 +0,0 @@ -/** - * Secure Hash Algorithm with a 1024-bit block size implementation. - * - * This includes: SHA-512, SHA-384, SHA-512/224, and SHA-512/256. For - * SHA-256 (block size 512 bits), see sha256.js. - * - * See FIPS 180-4 for details. - * - * @author Dave Longley - * - * Copyright (c) 2014-2015 Digital Bazaar, Inc. - */ -var forge = require('./forge'); -require('./md'); -require('./util'); - -var sha512 = module.exports = forge.sha512 = forge.sha512 || {}; - -// SHA-512 -forge.md.sha512 = forge.md.algorithms.sha512 = sha512; - -// SHA-384 -var sha384 = forge.sha384 = forge.sha512.sha384 = forge.sha512.sha384 || {}; -sha384.create = function() { - return sha512.create('SHA-384'); -}; -forge.md.sha384 = forge.md.algorithms.sha384 = sha384; - -// SHA-512/256 -forge.sha512.sha256 = forge.sha512.sha256 || { - create: function() { - return sha512.create('SHA-512/256'); - } -}; -forge.md['sha512/256'] = forge.md.algorithms['sha512/256'] = - forge.sha512.sha256; - -// SHA-512/224 -forge.sha512.sha224 = forge.sha512.sha224 || { - create: function() { - return sha512.create('SHA-512/224'); - } -}; -forge.md['sha512/224'] = forge.md.algorithms['sha512/224'] = - forge.sha512.sha224; - -/** - * Creates a SHA-2 message digest object. - * - * @param algorithm the algorithm to use (SHA-512, SHA-384, SHA-512/224, - * SHA-512/256). - * - * @return a message digest object. - */ -sha512.create = function(algorithm) { - // do initialization as necessary - if(!_initialized) { - _init(); - } - - if(typeof algorithm === 'undefined') { - algorithm = 'SHA-512'; - } - - if(!(algorithm in _states)) { - throw new Error('Invalid SHA-512 algorithm: ' + algorithm); - } - - // SHA-512 state contains eight 64-bit integers (each as two 32-bit ints) - var _state = _states[algorithm]; - var _h = null; - - // input buffer - var _input = forge.util.createBuffer(); - - // used for 64-bit word storage - var _w = new Array(80); - for(var wi = 0; wi < 80; ++wi) { - _w[wi] = new Array(2); - } - - // determine digest length by algorithm name (default) - var digestLength = 64; - switch(algorithm) { - case 'SHA-384': - digestLength = 48; - break; - case 'SHA-512/256': - digestLength = 32; - break; - case 'SHA-512/224': - digestLength = 28; - break; - } - - // message digest object - var md = { - // SHA-512 => sha512 - algorithm: algorithm.replace('-', '').toLowerCase(), - blockLength: 128, - digestLength: digestLength, - // 56-bit length of message so far (does not including padding) - messageLength: 0, - // true message length - fullMessageLength: null, - // size of message length in bytes - messageLengthSize: 16 - }; - - /** - * Starts the digest. - * - * @return this digest object. - */ - md.start = function() { - // up to 56-bit message length for convenience - md.messageLength = 0; - - // full message length (set md.messageLength128 for backwards-compatibility) - md.fullMessageLength = md.messageLength128 = []; - var int32s = md.messageLengthSize / 4; - for(var i = 0; i < int32s; ++i) { - md.fullMessageLength.push(0); - } - _input = forge.util.createBuffer(); - _h = new Array(_state.length); - for(var i = 0; i < _state.length; ++i) { - _h[i] = _state[i].slice(0); - } - return md; - }; - // start digest automatically for first time - md.start(); - - /** - * Updates the digest with the given message input. The given input can - * treated as raw input (no encoding will be applied) or an encoding of - * 'utf8' maybe given to encode the input using UTF-8. - * - * @param msg the message input to update with. - * @param encoding the encoding to use (default: 'raw', other: 'utf8'). - * - * @return this digest object. - */ - md.update = function(msg, encoding) { - if(encoding === 'utf8') { - msg = forge.util.encodeUtf8(msg); - } - - // update message length - var len = msg.length; - md.messageLength += len; - len = [(len / 0x100000000) >>> 0, len >>> 0]; - for(var i = md.fullMessageLength.length - 1; i >= 0; --i) { - md.fullMessageLength[i] += len[1]; - len[1] = len[0] + ((md.fullMessageLength[i] / 0x100000000) >>> 0); - md.fullMessageLength[i] = md.fullMessageLength[i] >>> 0; - len[0] = ((len[1] / 0x100000000) >>> 0); - } - - // add bytes to input buffer - _input.putBytes(msg); - - // process bytes - _update(_h, _w, _input); - - // compact input buffer every 2K or if empty - if(_input.read > 2048 || _input.length() === 0) { - _input.compact(); - } - - return md; - }; - - /** - * Produces the digest. - * - * @return a byte buffer containing the digest value. - */ - md.digest = function() { - /* Note: Here we copy the remaining bytes in the input buffer and - add the appropriate SHA-512 padding. Then we do the final update - on a copy of the state so that if the user wants to get - intermediate digests they can do so. */ - - /* Determine the number of bytes that must be added to the message - to ensure its length is congruent to 896 mod 1024. In other words, - the data to be digested must be a multiple of 1024 bits (or 128 bytes). - This data includes the message, some padding, and the length of the - message. Since the length of the message will be encoded as 16 bytes (128 - bits), that means that the last segment of the data must have 112 bytes - (896 bits) of message and padding. Therefore, the length of the message - plus the padding must be congruent to 896 mod 1024 because - 1024 - 128 = 896. - - In order to fill up the message length it must be filled with - padding that begins with 1 bit followed by all 0 bits. Padding - must *always* be present, so if the message length is already - congruent to 896 mod 1024, then 1024 padding bits must be added. */ - - var finalBlock = forge.util.createBuffer(); - finalBlock.putBytes(_input.bytes()); - - // compute remaining size to be digested (include message length size) - var remaining = ( - md.fullMessageLength[md.fullMessageLength.length - 1] + - md.messageLengthSize); - - // add padding for overflow blockSize - overflow - // _padding starts with 1 byte with first bit is set (byte value 128), then - // there may be up to (blockSize - 1) other pad bytes - var overflow = remaining & (md.blockLength - 1); - finalBlock.putBytes(_padding.substr(0, md.blockLength - overflow)); - - // serialize message length in bits in big-endian order; since length - // is stored in bytes we multiply by 8 and add carry from next int - var next, carry; - var bits = md.fullMessageLength[0] * 8; - for(var i = 0; i < md.fullMessageLength.length - 1; ++i) { - next = md.fullMessageLength[i + 1] * 8; - carry = (next / 0x100000000) >>> 0; - bits += carry; - finalBlock.putInt32(bits >>> 0); - bits = next >>> 0; - } - finalBlock.putInt32(bits); - - var h = new Array(_h.length); - for(var i = 0; i < _h.length; ++i) { - h[i] = _h[i].slice(0); - } - _update(h, _w, finalBlock); - var rval = forge.util.createBuffer(); - var hlen; - if(algorithm === 'SHA-512') { - hlen = h.length; - } else if(algorithm === 'SHA-384') { - hlen = h.length - 2; - } else { - hlen = h.length - 4; - } - for(var i = 0; i < hlen; ++i) { - rval.putInt32(h[i][0]); - if(i !== hlen - 1 || algorithm !== 'SHA-512/224') { - rval.putInt32(h[i][1]); - } - } - return rval; - }; - - return md; -}; - -// sha-512 padding bytes not initialized yet -var _padding = null; -var _initialized = false; - -// table of constants -var _k = null; - -// initial hash states -var _states = null; - -/** - * Initializes the constant tables. - */ -function _init() { - // create padding - _padding = String.fromCharCode(128); - _padding += forge.util.fillString(String.fromCharCode(0x00), 128); - - // create K table for SHA-512 - _k = [ - [0x428a2f98, 0xd728ae22], [0x71374491, 0x23ef65cd], - [0xb5c0fbcf, 0xec4d3b2f], [0xe9b5dba5, 0x8189dbbc], - [0x3956c25b, 0xf348b538], [0x59f111f1, 0xb605d019], - [0x923f82a4, 0xaf194f9b], [0xab1c5ed5, 0xda6d8118], - [0xd807aa98, 0xa3030242], [0x12835b01, 0x45706fbe], - [0x243185be, 0x4ee4b28c], [0x550c7dc3, 0xd5ffb4e2], - [0x72be5d74, 0xf27b896f], [0x80deb1fe, 0x3b1696b1], - [0x9bdc06a7, 0x25c71235], [0xc19bf174, 0xcf692694], - [0xe49b69c1, 0x9ef14ad2], [0xefbe4786, 0x384f25e3], - [0x0fc19dc6, 0x8b8cd5b5], [0x240ca1cc, 0x77ac9c65], - [0x2de92c6f, 0x592b0275], [0x4a7484aa, 0x6ea6e483], - [0x5cb0a9dc, 0xbd41fbd4], [0x76f988da, 0x831153b5], - [0x983e5152, 0xee66dfab], [0xa831c66d, 0x2db43210], - [0xb00327c8, 0x98fb213f], [0xbf597fc7, 0xbeef0ee4], - [0xc6e00bf3, 0x3da88fc2], [0xd5a79147, 0x930aa725], - [0x06ca6351, 0xe003826f], [0x14292967, 0x0a0e6e70], - [0x27b70a85, 0x46d22ffc], [0x2e1b2138, 0x5c26c926], - [0x4d2c6dfc, 0x5ac42aed], [0x53380d13, 0x9d95b3df], - [0x650a7354, 0x8baf63de], [0x766a0abb, 0x3c77b2a8], - [0x81c2c92e, 0x47edaee6], [0x92722c85, 0x1482353b], - [0xa2bfe8a1, 0x4cf10364], [0xa81a664b, 0xbc423001], - [0xc24b8b70, 0xd0f89791], [0xc76c51a3, 0x0654be30], - [0xd192e819, 0xd6ef5218], [0xd6990624, 0x5565a910], - [0xf40e3585, 0x5771202a], [0x106aa070, 0x32bbd1b8], - [0x19a4c116, 0xb8d2d0c8], [0x1e376c08, 0x5141ab53], - [0x2748774c, 0xdf8eeb99], [0x34b0bcb5, 0xe19b48a8], - [0x391c0cb3, 0xc5c95a63], [0x4ed8aa4a, 0xe3418acb], - [0x5b9cca4f, 0x7763e373], [0x682e6ff3, 0xd6b2b8a3], - [0x748f82ee, 0x5defb2fc], [0x78a5636f, 0x43172f60], - [0x84c87814, 0xa1f0ab72], [0x8cc70208, 0x1a6439ec], - [0x90befffa, 0x23631e28], [0xa4506ceb, 0xde82bde9], - [0xbef9a3f7, 0xb2c67915], [0xc67178f2, 0xe372532b], - [0xca273ece, 0xea26619c], [0xd186b8c7, 0x21c0c207], - [0xeada7dd6, 0xcde0eb1e], [0xf57d4f7f, 0xee6ed178], - [0x06f067aa, 0x72176fba], [0x0a637dc5, 0xa2c898a6], - [0x113f9804, 0xbef90dae], [0x1b710b35, 0x131c471b], - [0x28db77f5, 0x23047d84], [0x32caab7b, 0x40c72493], - [0x3c9ebe0a, 0x15c9bebc], [0x431d67c4, 0x9c100d4c], - [0x4cc5d4be, 0xcb3e42b6], [0x597f299c, 0xfc657e2a], - [0x5fcb6fab, 0x3ad6faec], [0x6c44198c, 0x4a475817] - ]; - - // initial hash states - _states = {}; - _states['SHA-512'] = [ - [0x6a09e667, 0xf3bcc908], - [0xbb67ae85, 0x84caa73b], - [0x3c6ef372, 0xfe94f82b], - [0xa54ff53a, 0x5f1d36f1], - [0x510e527f, 0xade682d1], - [0x9b05688c, 0x2b3e6c1f], - [0x1f83d9ab, 0xfb41bd6b], - [0x5be0cd19, 0x137e2179] - ]; - _states['SHA-384'] = [ - [0xcbbb9d5d, 0xc1059ed8], - [0x629a292a, 0x367cd507], - [0x9159015a, 0x3070dd17], - [0x152fecd8, 0xf70e5939], - [0x67332667, 0xffc00b31], - [0x8eb44a87, 0x68581511], - [0xdb0c2e0d, 0x64f98fa7], - [0x47b5481d, 0xbefa4fa4] - ]; - _states['SHA-512/256'] = [ - [0x22312194, 0xFC2BF72C], - [0x9F555FA3, 0xC84C64C2], - [0x2393B86B, 0x6F53B151], - [0x96387719, 0x5940EABD], - [0x96283EE2, 0xA88EFFE3], - [0xBE5E1E25, 0x53863992], - [0x2B0199FC, 0x2C85B8AA], - [0x0EB72DDC, 0x81C52CA2] - ]; - _states['SHA-512/224'] = [ - [0x8C3D37C8, 0x19544DA2], - [0x73E19966, 0x89DCD4D6], - [0x1DFAB7AE, 0x32FF9C82], - [0x679DD514, 0x582F9FCF], - [0x0F6D2B69, 0x7BD44DA8], - [0x77E36F73, 0x04C48942], - [0x3F9D85A8, 0x6A1D36C8], - [0x1112E6AD, 0x91D692A1] - ]; - - // now initialized - _initialized = true; -} - -/** - * Updates a SHA-512 state with the given byte buffer. - * - * @param s the SHA-512 state to update. - * @param w the array to use to store words. - * @param bytes the byte buffer to update with. - */ -function _update(s, w, bytes) { - // consume 512 bit (128 byte) chunks - var t1_hi, t1_lo; - var t2_hi, t2_lo; - var s0_hi, s0_lo; - var s1_hi, s1_lo; - var ch_hi, ch_lo; - var maj_hi, maj_lo; - var a_hi, a_lo; - var b_hi, b_lo; - var c_hi, c_lo; - var d_hi, d_lo; - var e_hi, e_lo; - var f_hi, f_lo; - var g_hi, g_lo; - var h_hi, h_lo; - var i, hi, lo, w2, w7, w15, w16; - var len = bytes.length(); - while(len >= 128) { - // the w array will be populated with sixteen 64-bit big-endian words - // and then extended into 64 64-bit words according to SHA-512 - for(i = 0; i < 16; ++i) { - w[i][0] = bytes.getInt32() >>> 0; - w[i][1] = bytes.getInt32() >>> 0; - } - for(; i < 80; ++i) { - // for word 2 words ago: ROTR 19(x) ^ ROTR 61(x) ^ SHR 6(x) - w2 = w[i - 2]; - hi = w2[0]; - lo = w2[1]; - - // high bits - t1_hi = ( - ((hi >>> 19) | (lo << 13)) ^ // ROTR 19 - ((lo >>> 29) | (hi << 3)) ^ // ROTR 61/(swap + ROTR 29) - (hi >>> 6)) >>> 0; // SHR 6 - // low bits - t1_lo = ( - ((hi << 13) | (lo >>> 19)) ^ // ROTR 19 - ((lo << 3) | (hi >>> 29)) ^ // ROTR 61/(swap + ROTR 29) - ((hi << 26) | (lo >>> 6))) >>> 0; // SHR 6 - - // for word 15 words ago: ROTR 1(x) ^ ROTR 8(x) ^ SHR 7(x) - w15 = w[i - 15]; - hi = w15[0]; - lo = w15[1]; - - // high bits - t2_hi = ( - ((hi >>> 1) | (lo << 31)) ^ // ROTR 1 - ((hi >>> 8) | (lo << 24)) ^ // ROTR 8 - (hi >>> 7)) >>> 0; // SHR 7 - // low bits - t2_lo = ( - ((hi << 31) | (lo >>> 1)) ^ // ROTR 1 - ((hi << 24) | (lo >>> 8)) ^ // ROTR 8 - ((hi << 25) | (lo >>> 7))) >>> 0; // SHR 7 - - // sum(t1, word 7 ago, t2, word 16 ago) modulo 2^64 (carry lo overflow) - w7 = w[i - 7]; - w16 = w[i - 16]; - lo = (t1_lo + w7[1] + t2_lo + w16[1]); - w[i][0] = (t1_hi + w7[0] + t2_hi + w16[0] + - ((lo / 0x100000000) >>> 0)) >>> 0; - w[i][1] = lo >>> 0; - } - - // initialize hash value for this chunk - a_hi = s[0][0]; - a_lo = s[0][1]; - b_hi = s[1][0]; - b_lo = s[1][1]; - c_hi = s[2][0]; - c_lo = s[2][1]; - d_hi = s[3][0]; - d_lo = s[3][1]; - e_hi = s[4][0]; - e_lo = s[4][1]; - f_hi = s[5][0]; - f_lo = s[5][1]; - g_hi = s[6][0]; - g_lo = s[6][1]; - h_hi = s[7][0]; - h_lo = s[7][1]; - - // round function - for(i = 0; i < 80; ++i) { - // Sum1(e) = ROTR 14(e) ^ ROTR 18(e) ^ ROTR 41(e) - s1_hi = ( - ((e_hi >>> 14) | (e_lo << 18)) ^ // ROTR 14 - ((e_hi >>> 18) | (e_lo << 14)) ^ // ROTR 18 - ((e_lo >>> 9) | (e_hi << 23))) >>> 0; // ROTR 41/(swap + ROTR 9) - s1_lo = ( - ((e_hi << 18) | (e_lo >>> 14)) ^ // ROTR 14 - ((e_hi << 14) | (e_lo >>> 18)) ^ // ROTR 18 - ((e_lo << 23) | (e_hi >>> 9))) >>> 0; // ROTR 41/(swap + ROTR 9) - - // Ch(e, f, g) (optimized the same way as SHA-1) - ch_hi = (g_hi ^ (e_hi & (f_hi ^ g_hi))) >>> 0; - ch_lo = (g_lo ^ (e_lo & (f_lo ^ g_lo))) >>> 0; - - // Sum0(a) = ROTR 28(a) ^ ROTR 34(a) ^ ROTR 39(a) - s0_hi = ( - ((a_hi >>> 28) | (a_lo << 4)) ^ // ROTR 28 - ((a_lo >>> 2) | (a_hi << 30)) ^ // ROTR 34/(swap + ROTR 2) - ((a_lo >>> 7) | (a_hi << 25))) >>> 0; // ROTR 39/(swap + ROTR 7) - s0_lo = ( - ((a_hi << 4) | (a_lo >>> 28)) ^ // ROTR 28 - ((a_lo << 30) | (a_hi >>> 2)) ^ // ROTR 34/(swap + ROTR 2) - ((a_lo << 25) | (a_hi >>> 7))) >>> 0; // ROTR 39/(swap + ROTR 7) - - // Maj(a, b, c) (optimized the same way as SHA-1) - maj_hi = ((a_hi & b_hi) | (c_hi & (a_hi ^ b_hi))) >>> 0; - maj_lo = ((a_lo & b_lo) | (c_lo & (a_lo ^ b_lo))) >>> 0; - - // main algorithm - // t1 = (h + s1 + ch + _k[i] + _w[i]) modulo 2^64 (carry lo overflow) - lo = (h_lo + s1_lo + ch_lo + _k[i][1] + w[i][1]); - t1_hi = (h_hi + s1_hi + ch_hi + _k[i][0] + w[i][0] + - ((lo / 0x100000000) >>> 0)) >>> 0; - t1_lo = lo >>> 0; - - // t2 = s0 + maj modulo 2^64 (carry lo overflow) - lo = s0_lo + maj_lo; - t2_hi = (s0_hi + maj_hi + ((lo / 0x100000000) >>> 0)) >>> 0; - t2_lo = lo >>> 0; - - h_hi = g_hi; - h_lo = g_lo; - - g_hi = f_hi; - g_lo = f_lo; - - f_hi = e_hi; - f_lo = e_lo; - - // e = (d + t1) modulo 2^64 (carry lo overflow) - lo = d_lo + t1_lo; - e_hi = (d_hi + t1_hi + ((lo / 0x100000000) >>> 0)) >>> 0; - e_lo = lo >>> 0; - - d_hi = c_hi; - d_lo = c_lo; - - c_hi = b_hi; - c_lo = b_lo; - - b_hi = a_hi; - b_lo = a_lo; - - // a = (t1 + t2) modulo 2^64 (carry lo overflow) - lo = t1_lo + t2_lo; - a_hi = (t1_hi + t2_hi + ((lo / 0x100000000) >>> 0)) >>> 0; - a_lo = lo >>> 0; - } - - // update hash state (additional modulo 2^64) - lo = s[0][1] + a_lo; - s[0][0] = (s[0][0] + a_hi + ((lo / 0x100000000) >>> 0)) >>> 0; - s[0][1] = lo >>> 0; - - lo = s[1][1] + b_lo; - s[1][0] = (s[1][0] + b_hi + ((lo / 0x100000000) >>> 0)) >>> 0; - s[1][1] = lo >>> 0; - - lo = s[2][1] + c_lo; - s[2][0] = (s[2][0] + c_hi + ((lo / 0x100000000) >>> 0)) >>> 0; - s[2][1] = lo >>> 0; - - lo = s[3][1] + d_lo; - s[3][0] = (s[3][0] + d_hi + ((lo / 0x100000000) >>> 0)) >>> 0; - s[3][1] = lo >>> 0; - - lo = s[4][1] + e_lo; - s[4][0] = (s[4][0] + e_hi + ((lo / 0x100000000) >>> 0)) >>> 0; - s[4][1] = lo >>> 0; - - lo = s[5][1] + f_lo; - s[5][0] = (s[5][0] + f_hi + ((lo / 0x100000000) >>> 0)) >>> 0; - s[5][1] = lo >>> 0; - - lo = s[6][1] + g_lo; - s[6][0] = (s[6][0] + g_hi + ((lo / 0x100000000) >>> 0)) >>> 0; - s[6][1] = lo >>> 0; - - lo = s[7][1] + h_lo; - s[7][0] = (s[7][0] + h_hi + ((lo / 0x100000000) >>> 0)) >>> 0; - s[7][1] = lo >>> 0; - - len -= 128; - } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/socket.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/socket.js deleted file mode 100644 index 3a1d7ff2..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/socket.js +++ /dev/null @@ -1,287 +0,0 @@ -/** - * Socket implementation that uses flash SocketPool class as a backend. - * - * @author Dave Longley - * - * Copyright (c) 2010-2013 Digital Bazaar, Inc. - */ -var forge = require('./forge'); -require('./util'); - -// define net namespace -var net = module.exports = forge.net = forge.net || {}; - -// map of flash ID to socket pool -net.socketPools = {}; - -/** - * Creates a flash socket pool. - * - * @param options: - * flashId: the dom ID for the flash object element. - * policyPort: the default policy port for sockets, 0 to use the - * flash default. - * policyUrl: the default policy file URL for sockets (if provided - * used instead of a policy port). - * msie: true if the browser is msie, false if not. - * - * @return the created socket pool. - */ -net.createSocketPool = function(options) { - // set default - options.msie = options.msie || false; - - // initialize the flash interface - var spId = options.flashId; - var api = document.getElementById(spId); - api.init({marshallExceptions: !options.msie}); - - // create socket pool entry - var sp = { - // ID of the socket pool - id: spId, - // flash interface - flashApi: api, - // map of socket ID to sockets - sockets: {}, - // default policy port - policyPort: options.policyPort || 0, - // default policy URL - policyUrl: options.policyUrl || null - }; - net.socketPools[spId] = sp; - - // create event handler, subscribe to flash events - if(options.msie === true) { - sp.handler = function(e) { - if(e.id in sp.sockets) { - // get handler function - var f; - switch(e.type) { - case 'connect': - f = 'connected'; - break; - case 'close': - f = 'closed'; - break; - case 'socketData': - f = 'data'; - break; - default: - f = 'error'; - break; - } - /* IE calls javascript on the thread of the external object - that triggered the event (in this case flash) ... which will - either run concurrently with other javascript or pre-empt any - running javascript in the middle of its execution (BAD!) ... - calling setTimeout() will schedule the javascript to run on - the javascript thread and solve this EVIL problem. */ - setTimeout(function() {sp.sockets[e.id][f](e);}, 0); - } - }; - } else { - sp.handler = function(e) { - if(e.id in sp.sockets) { - // get handler function - var f; - switch(e.type) { - case 'connect': - f = 'connected'; - break; - case 'close': - f = 'closed'; - break; - case 'socketData': - f = 'data'; - break; - default: - f = 'error'; - break; - } - sp.sockets[e.id][f](e); - } - }; - } - var handler = 'forge.net.socketPools[\'' + spId + '\'].handler'; - api.subscribe('connect', handler); - api.subscribe('close', handler); - api.subscribe('socketData', handler); - api.subscribe('ioError', handler); - api.subscribe('securityError', handler); - - /** - * Destroys a socket pool. The socket pool still needs to be cleaned - * up via net.cleanup(). - */ - sp.destroy = function() { - delete net.socketPools[options.flashId]; - for(var id in sp.sockets) { - sp.sockets[id].destroy(); - } - sp.sockets = {}; - api.cleanup(); - }; - - /** - * Creates a new socket. - * - * @param options: - * connected: function(event) called when the socket connects. - * closed: function(event) called when the socket closes. - * data: function(event) called when socket data has arrived, - * it can be read from the socket using receive(). - * error: function(event) called when a socket error occurs. - */ - sp.createSocket = function(options) { - // default to empty options - options = options || {}; - - // create flash socket - var id = api.create(); - - // create javascript socket wrapper - var socket = { - id: id, - // set handlers - connected: options.connected || function(e) {}, - closed: options.closed || function(e) {}, - data: options.data || function(e) {}, - error: options.error || function(e) {} - }; - - /** - * Destroys this socket. - */ - socket.destroy = function() { - api.destroy(id); - delete sp.sockets[id]; - }; - - /** - * Connects this socket. - * - * @param options: - * host: the host to connect to. - * port: the port to connect to. - * policyPort: the policy port to use (if non-default), 0 to - * use the flash default. - * policyUrl: the policy file URL to use (instead of port). - */ - socket.connect = function(options) { - // give precedence to policy URL over policy port - // if no policy URL and passed port isn't 0, use default port, - // otherwise use 0 for the port - var policyUrl = options.policyUrl || null; - var policyPort = 0; - if(policyUrl === null && options.policyPort !== 0) { - policyPort = options.policyPort || sp.policyPort; - } - api.connect(id, options.host, options.port, policyPort, policyUrl); - }; - - /** - * Closes this socket. - */ - socket.close = function() { - api.close(id); - socket.closed({ - id: socket.id, - type: 'close', - bytesAvailable: 0 - }); - }; - - /** - * Determines if the socket is connected or not. - * - * @return true if connected, false if not. - */ - socket.isConnected = function() { - return api.isConnected(id); - }; - - /** - * Writes bytes to this socket. - * - * @param bytes the bytes (as a string) to write. - * - * @return true on success, false on failure. - */ - socket.send = function(bytes) { - return api.send(id, forge.util.encode64(bytes)); - }; - - /** - * Reads bytes from this socket (non-blocking). Fewer than the number - * of bytes requested may be read if enough bytes are not available. - * - * This method should be called from the data handler if there are - * enough bytes available. To see how many bytes are available, check - * the 'bytesAvailable' property on the event in the data handler or - * call the bytesAvailable() function on the socket. If the browser is - * msie, then the bytesAvailable() function should be used to avoid - * race conditions. Otherwise, using the property on the data handler's - * event may be quicker. - * - * @param count the maximum number of bytes to read. - * - * @return the bytes read (as a string) or null on error. - */ - socket.receive = function(count) { - var rval = api.receive(id, count).rval; - return (rval === null) ? null : forge.util.decode64(rval); - }; - - /** - * Gets the number of bytes available for receiving on the socket. - * - * @return the number of bytes available for receiving. - */ - socket.bytesAvailable = function() { - return api.getBytesAvailable(id); - }; - - // store and return socket - sp.sockets[id] = socket; - return socket; - }; - - return sp; -}; - -/** - * Destroys a flash socket pool. - * - * @param options: - * flashId: the dom ID for the flash object element. - */ -net.destroySocketPool = function(options) { - if(options.flashId in net.socketPools) { - var sp = net.socketPools[options.flashId]; - sp.destroy(); - } -}; - -/** - * Creates a new socket. - * - * @param options: - * flashId: the dom ID for the flash object element. - * connected: function(event) called when the socket connects. - * closed: function(event) called when the socket closes. - * data: function(event) called when socket data has arrived, it - * can be read from the socket using receive(). - * error: function(event) called when a socket error occurs. - * - * @return the created socket. - */ -net.createSocket = function(options) { - var socket = null; - if(options.flashId in net.socketPools) { - // get related socket pool - var sp = net.socketPools[options.flashId]; - socket = sp.createSocket(options); - } - return socket; -}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/ssh.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/ssh.js deleted file mode 100644 index 6480203a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/ssh.js +++ /dev/null @@ -1,236 +0,0 @@ -/** - * Functions to output keys in SSH-friendly formats. - * - * This is part of the Forge project which may be used under the terms of - * either the BSD License or the GNU General Public License (GPL) Version 2. - * - * See: https://github.com/digitalbazaar/forge/blob/cbebca3780658703d925b61b2caffb1d263a6c1d/LICENSE - * - * @author https://github.com/shellac - */ -var forge = require('./forge'); -require('./aes'); -require('./hmac'); -require('./md5'); -require('./sha1'); -require('./util'); - -var ssh = module.exports = forge.ssh = forge.ssh || {}; - -/** - * Encodes (and optionally encrypts) a private RSA key as a Putty PPK file. - * - * @param privateKey the key. - * @param passphrase a passphrase to protect the key (falsy for no encryption). - * @param comment a comment to include in the key file. - * - * @return the PPK file as a string. - */ -ssh.privateKeyToPutty = function(privateKey, passphrase, comment) { - comment = comment || ''; - passphrase = passphrase || ''; - var algorithm = 'ssh-rsa'; - var encryptionAlgorithm = (passphrase === '') ? 'none' : 'aes256-cbc'; - - var ppk = 'PuTTY-User-Key-File-2: ' + algorithm + '\r\n'; - ppk += 'Encryption: ' + encryptionAlgorithm + '\r\n'; - ppk += 'Comment: ' + comment + '\r\n'; - - // public key into buffer for ppk - var pubbuffer = forge.util.createBuffer(); - _addStringToBuffer(pubbuffer, algorithm); - _addBigIntegerToBuffer(pubbuffer, privateKey.e); - _addBigIntegerToBuffer(pubbuffer, privateKey.n); - - // write public key - var pub = forge.util.encode64(pubbuffer.bytes(), 64); - var length = Math.floor(pub.length / 66) + 1; // 66 = 64 + \r\n - ppk += 'Public-Lines: ' + length + '\r\n'; - ppk += pub; - - // private key into a buffer - var privbuffer = forge.util.createBuffer(); - _addBigIntegerToBuffer(privbuffer, privateKey.d); - _addBigIntegerToBuffer(privbuffer, privateKey.p); - _addBigIntegerToBuffer(privbuffer, privateKey.q); - _addBigIntegerToBuffer(privbuffer, privateKey.qInv); - - // optionally encrypt the private key - var priv; - if(!passphrase) { - // use the unencrypted buffer - priv = forge.util.encode64(privbuffer.bytes(), 64); - } else { - // encrypt RSA key using passphrase - var encLen = privbuffer.length() + 16 - 1; - encLen -= encLen % 16; - - // pad private key with sha1-d data -- needs to be a multiple of 16 - var padding = _sha1(privbuffer.bytes()); - - padding.truncate(padding.length() - encLen + privbuffer.length()); - privbuffer.putBuffer(padding); - - var aeskey = forge.util.createBuffer(); - aeskey.putBuffer(_sha1('\x00\x00\x00\x00', passphrase)); - aeskey.putBuffer(_sha1('\x00\x00\x00\x01', passphrase)); - - // encrypt some bytes using CBC mode - // key is 40 bytes, so truncate *by* 8 bytes - var cipher = forge.aes.createEncryptionCipher(aeskey.truncate(8), 'CBC'); - cipher.start(forge.util.createBuffer().fillWithByte(0, 16)); - cipher.update(privbuffer.copy()); - cipher.finish(); - var encrypted = cipher.output; - - // Note: this appears to differ from Putty -- is forge wrong, or putty? - // due to padding we finish as an exact multiple of 16 - encrypted.truncate(16); // all padding - - priv = forge.util.encode64(encrypted.bytes(), 64); - } - - // output private key - length = Math.floor(priv.length / 66) + 1; // 64 + \r\n - ppk += '\r\nPrivate-Lines: ' + length + '\r\n'; - ppk += priv; - - // MAC - var mackey = _sha1('putty-private-key-file-mac-key', passphrase); - - var macbuffer = forge.util.createBuffer(); - _addStringToBuffer(macbuffer, algorithm); - _addStringToBuffer(macbuffer, encryptionAlgorithm); - _addStringToBuffer(macbuffer, comment); - macbuffer.putInt32(pubbuffer.length()); - macbuffer.putBuffer(pubbuffer); - macbuffer.putInt32(privbuffer.length()); - macbuffer.putBuffer(privbuffer); - - var hmac = forge.hmac.create(); - hmac.start('sha1', mackey); - hmac.update(macbuffer.bytes()); - - ppk += '\r\nPrivate-MAC: ' + hmac.digest().toHex() + '\r\n'; - - return ppk; -}; - -/** - * Encodes a public RSA key as an OpenSSH file. - * - * @param key the key. - * @param comment a comment. - * - * @return the public key in OpenSSH format. - */ -ssh.publicKeyToOpenSSH = function(key, comment) { - var type = 'ssh-rsa'; - comment = comment || ''; - - var buffer = forge.util.createBuffer(); - _addStringToBuffer(buffer, type); - _addBigIntegerToBuffer(buffer, key.e); - _addBigIntegerToBuffer(buffer, key.n); - - return type + ' ' + forge.util.encode64(buffer.bytes()) + ' ' + comment; -}; - -/** - * Encodes a private RSA key as an OpenSSH file. - * - * @param key the key. - * @param passphrase a passphrase to protect the key (falsy for no encryption). - * - * @return the public key in OpenSSH format. - */ -ssh.privateKeyToOpenSSH = function(privateKey, passphrase) { - if(!passphrase) { - return forge.pki.privateKeyToPem(privateKey); - } - // OpenSSH private key is just a legacy format, it seems - return forge.pki.encryptRsaPrivateKey(privateKey, passphrase, - {legacy: true, algorithm: 'aes128'}); -}; - -/** - * Gets the SSH fingerprint for the given public key. - * - * @param options the options to use. - * [md] the message digest object to use (defaults to forge.md.md5). - * [encoding] an alternative output encoding, such as 'hex' - * (defaults to none, outputs a byte buffer). - * [delimiter] the delimiter to use between bytes for 'hex' encoded - * output, eg: ':' (defaults to none). - * - * @return the fingerprint as a byte buffer or other encoding based on options. - */ -ssh.getPublicKeyFingerprint = function(key, options) { - options = options || {}; - var md = options.md || forge.md.md5.create(); - - var type = 'ssh-rsa'; - var buffer = forge.util.createBuffer(); - _addStringToBuffer(buffer, type); - _addBigIntegerToBuffer(buffer, key.e); - _addBigIntegerToBuffer(buffer, key.n); - - // hash public key bytes - md.start(); - md.update(buffer.getBytes()); - var digest = md.digest(); - if(options.encoding === 'hex') { - var hex = digest.toHex(); - if(options.delimiter) { - return hex.match(/.{2}/g).join(options.delimiter); - } - return hex; - } else if(options.encoding === 'binary') { - return digest.getBytes(); - } else if(options.encoding) { - throw new Error('Unknown encoding "' + options.encoding + '".'); - } - return digest; -}; - -/** - * Adds len(val) then val to a buffer. - * - * @param buffer the buffer to add to. - * @param val a big integer. - */ -function _addBigIntegerToBuffer(buffer, val) { - var hexVal = val.toString(16); - // ensure 2s complement +ve - if(hexVal[0] >= '8') { - hexVal = '00' + hexVal; - } - var bytes = forge.util.hexToBytes(hexVal); - buffer.putInt32(bytes.length); - buffer.putBytes(bytes); -} - -/** - * Adds len(val) then val to a buffer. - * - * @param buffer the buffer to add to. - * @param val a string. - */ -function _addStringToBuffer(buffer, val) { - buffer.putInt32(val.length); - buffer.putString(val); -} - -/** - * Hashes the arguments into one value using SHA-1. - * - * @return the sha1 hash of the provided arguments. - */ -function _sha1() { - var sha = forge.md.sha1.create(); - var num = arguments.length; - for (var i = 0; i < num; ++i) { - sha.update(arguments[i]); - } - return sha.digest(); -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/tls.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/tls.js deleted file mode 100644 index fadfd646..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/tls.js +++ /dev/null @@ -1,4282 +0,0 @@ -/** - * A Javascript implementation of Transport Layer Security (TLS). - * - * @author Dave Longley - * - * Copyright (c) 2009-2014 Digital Bazaar, Inc. - * - * The TLS Handshake Protocol involves the following steps: - * - * - Exchange hello messages to agree on algorithms, exchange random values, - * and check for session resumption. - * - * - Exchange the necessary cryptographic parameters to allow the client and - * server to agree on a premaster secret. - * - * - Exchange certificates and cryptographic information to allow the client - * and server to authenticate themselves. - * - * - Generate a master secret from the premaster secret and exchanged random - * values. - * - * - Provide security parameters to the record layer. - * - * - Allow the client and server to verify that their peer has calculated the - * same security parameters and that the handshake occurred without tampering - * by an attacker. - * - * Up to 4 different messages may be sent during a key exchange. The server - * certificate, the server key exchange, the client certificate, and the - * client key exchange. - * - * A typical handshake (from the client's perspective). - * - * 1. Client sends ClientHello. - * 2. Client receives ServerHello. - * 3. Client receives optional Certificate. - * 4. Client receives optional ServerKeyExchange. - * 5. Client receives ServerHelloDone. - * 6. Client sends optional Certificate. - * 7. Client sends ClientKeyExchange. - * 8. Client sends optional CertificateVerify. - * 9. Client sends ChangeCipherSpec. - * 10. Client sends Finished. - * 11. Client receives ChangeCipherSpec. - * 12. Client receives Finished. - * 13. Client sends/receives application data. - * - * To reuse an existing session: - * - * 1. Client sends ClientHello with session ID for reuse. - * 2. Client receives ServerHello with same session ID if reusing. - * 3. Client receives ChangeCipherSpec message if reusing. - * 4. Client receives Finished. - * 5. Client sends ChangeCipherSpec. - * 6. Client sends Finished. - * - * Note: Client ignores HelloRequest if in the middle of a handshake. - * - * Record Layer: - * - * The record layer fragments information blocks into TLSPlaintext records - * carrying data in chunks of 2^14 bytes or less. Client message boundaries are - * not preserved in the record layer (i.e., multiple client messages of the - * same ContentType MAY be coalesced into a single TLSPlaintext record, or a - * single message MAY be fragmented across several records). - * - * struct { - * uint8 major; - * uint8 minor; - * } ProtocolVersion; - * - * struct { - * ContentType type; - * ProtocolVersion version; - * uint16 length; - * opaque fragment[TLSPlaintext.length]; - * } TLSPlaintext; - * - * type: - * The higher-level protocol used to process the enclosed fragment. - * - * version: - * The version of the protocol being employed. TLS Version 1.2 uses version - * {3, 3}. TLS Version 1.0 uses version {3, 1}. Note that a client that - * supports multiple versions of TLS may not know what version will be - * employed before it receives the ServerHello. - * - * length: - * The length (in bytes) of the following TLSPlaintext.fragment. The length - * MUST NOT exceed 2^14 = 16384 bytes. - * - * fragment: - * The application data. This data is transparent and treated as an - * independent block to be dealt with by the higher-level protocol specified - * by the type field. - * - * Implementations MUST NOT send zero-length fragments of Handshake, Alert, or - * ChangeCipherSpec content types. Zero-length fragments of Application data - * MAY be sent as they are potentially useful as a traffic analysis - * countermeasure. - * - * Note: Data of different TLS record layer content types MAY be interleaved. - * Application data is generally of lower precedence for transmission than - * other content types. However, records MUST be delivered to the network in - * the same order as they are protected by the record layer. Recipients MUST - * receive and process interleaved application layer traffic during handshakes - * subsequent to the first one on a connection. - * - * struct { - * ContentType type; // same as TLSPlaintext.type - * ProtocolVersion version;// same as TLSPlaintext.version - * uint16 length; - * opaque fragment[TLSCompressed.length]; - * } TLSCompressed; - * - * length: - * The length (in bytes) of the following TLSCompressed.fragment. - * The length MUST NOT exceed 2^14 + 1024. - * - * fragment: - * The compressed form of TLSPlaintext.fragment. - * - * Note: A CompressionMethod.null operation is an identity operation; no fields - * are altered. In this implementation, since no compression is supported, - * uncompressed records are always the same as compressed records. - * - * Encryption Information: - * - * The encryption and MAC functions translate a TLSCompressed structure into a - * TLSCiphertext. The decryption functions reverse the process. The MAC of the - * record also includes a sequence number so that missing, extra, or repeated - * messages are detectable. - * - * struct { - * ContentType type; - * ProtocolVersion version; - * uint16 length; - * select (SecurityParameters.cipher_type) { - * case stream: GenericStreamCipher; - * case block: GenericBlockCipher; - * case aead: GenericAEADCipher; - * } fragment; - * } TLSCiphertext; - * - * type: - * The type field is identical to TLSCompressed.type. - * - * version: - * The version field is identical to TLSCompressed.version. - * - * length: - * The length (in bytes) of the following TLSCiphertext.fragment. - * The length MUST NOT exceed 2^14 + 2048. - * - * fragment: - * The encrypted form of TLSCompressed.fragment, with the MAC. - * - * Note: Only CBC Block Ciphers are supported by this implementation. - * - * The TLSCompressed.fragment structures are converted to/from block - * TLSCiphertext.fragment structures. - * - * struct { - * opaque IV[SecurityParameters.record_iv_length]; - * block-ciphered struct { - * opaque content[TLSCompressed.length]; - * opaque MAC[SecurityParameters.mac_length]; - * uint8 padding[GenericBlockCipher.padding_length]; - * uint8 padding_length; - * }; - * } GenericBlockCipher; - * - * The MAC is generated as described in Section 6.2.3.1. - * - * IV: - * The Initialization Vector (IV) SHOULD be chosen at random, and MUST be - * unpredictable. Note that in versions of TLS prior to 1.1, there was no - * IV field, and the last ciphertext block of the previous record (the "CBC - * residue") was used as the IV. This was changed to prevent the attacks - * described in [CBCATT]. For block ciphers, the IV length is of length - * SecurityParameters.record_iv_length, which is equal to the - * SecurityParameters.block_size. - * - * padding: - * Padding that is added to force the length of the plaintext to be an - * integral multiple of the block cipher's block length. The padding MAY be - * any length up to 255 bytes, as long as it results in the - * TLSCiphertext.length being an integral multiple of the block length. - * Lengths longer than necessary might be desirable to frustrate attacks on - * a protocol that are based on analysis of the lengths of exchanged - * messages. Each uint8 in the padding data vector MUST be filled with the - * padding length value. The receiver MUST check this padding and MUST use - * the bad_record_mac alert to indicate padding errors. - * - * padding_length: - * The padding length MUST be such that the total size of the - * GenericBlockCipher structure is a multiple of the cipher's block length. - * Legal values range from zero to 255, inclusive. This length specifies the - * length of the padding field exclusive of the padding_length field itself. - * - * The encrypted data length (TLSCiphertext.length) is one more than the sum of - * SecurityParameters.block_length, TLSCompressed.length, - * SecurityParameters.mac_length, and padding_length. - * - * Example: If the block length is 8 bytes, the content length - * (TLSCompressed.length) is 61 bytes, and the MAC length is 20 bytes, then the - * length before padding is 82 bytes (this does not include the IV. Thus, the - * padding length modulo 8 must be equal to 6 in order to make the total length - * an even multiple of 8 bytes (the block length). The padding length can be - * 6, 14, 22, and so on, through 254. If the padding length were the minimum - * necessary, 6, the padding would be 6 bytes, each containing the value 6. - * Thus, the last 8 octets of the GenericBlockCipher before block encryption - * would be xx 06 06 06 06 06 06 06, where xx is the last octet of the MAC. - * - * Note: With block ciphers in CBC mode (Cipher Block Chaining), it is critical - * that the entire plaintext of the record be known before any ciphertext is - * transmitted. Otherwise, it is possible for the attacker to mount the attack - * described in [CBCATT]. - * - * Implementation note: Canvel et al. [CBCTIME] have demonstrated a timing - * attack on CBC padding based on the time required to compute the MAC. In - * order to defend against this attack, implementations MUST ensure that - * record processing time is essentially the same whether or not the padding - * is correct. In general, the best way to do this is to compute the MAC even - * if the padding is incorrect, and only then reject the packet. For instance, - * if the pad appears to be incorrect, the implementation might assume a - * zero-length pad and then compute the MAC. This leaves a small timing - * channel, since MAC performance depends, to some extent, on the size of the - * data fragment, but it is not believed to be large enough to be exploitable, - * due to the large block size of existing MACs and the small size of the - * timing signal. - */ -var forge = require('./forge'); -require('./asn1'); -require('./hmac'); -require('./md5'); -require('./pem'); -require('./pki'); -require('./random'); -require('./sha1'); -require('./util'); - -/** - * Generates pseudo random bytes by mixing the result of two hash functions, - * MD5 and SHA-1. - * - * prf_TLS1(secret, label, seed) = - * P_MD5(S1, label + seed) XOR P_SHA-1(S2, label + seed); - * - * Each P_hash function functions as follows: - * - * P_hash(secret, seed) = HMAC_hash(secret, A(1) + seed) + - * HMAC_hash(secret, A(2) + seed) + - * HMAC_hash(secret, A(3) + seed) + ... - * A() is defined as: - * A(0) = seed - * A(i) = HMAC_hash(secret, A(i-1)) - * - * The '+' operator denotes concatenation. - * - * As many iterations A(N) as are needed are performed to generate enough - * pseudo random byte output. If an iteration creates more data than is - * necessary, then it is truncated. - * - * Therefore: - * A(1) = HMAC_hash(secret, A(0)) - * = HMAC_hash(secret, seed) - * A(2) = HMAC_hash(secret, A(1)) - * = HMAC_hash(secret, HMAC_hash(secret, seed)) - * - * Therefore: - * P_hash(secret, seed) = - * HMAC_hash(secret, HMAC_hash(secret, A(0)) + seed) + - * HMAC_hash(secret, HMAC_hash(secret, A(1)) + seed) + - * ... - * - * Therefore: - * P_hash(secret, seed) = - * HMAC_hash(secret, HMAC_hash(secret, seed) + seed) + - * HMAC_hash(secret, HMAC_hash(secret, HMAC_hash(secret, seed)) + seed) + - * ... - * - * @param secret the secret to use. - * @param label the label to use. - * @param seed the seed value to use. - * @param length the number of bytes to generate. - * - * @return the pseudo random bytes in a byte buffer. - */ -var prf_TLS1 = function(secret, label, seed, length) { - var rval = forge.util.createBuffer(); - - /* For TLS 1.0, the secret is split in half, into two secrets of equal - length. If the secret has an odd length then the last byte of the first - half will be the same as the first byte of the second. The length of the - two secrets is half of the secret rounded up. */ - var idx = (secret.length >> 1); - var slen = idx + (secret.length & 1); - var s1 = secret.substr(0, slen); - var s2 = secret.substr(idx, slen); - var ai = forge.util.createBuffer(); - var hmac = forge.hmac.create(); - seed = label + seed; - - // determine the number of iterations that must be performed to generate - // enough output bytes, md5 creates 16 byte hashes, sha1 creates 20 - var md5itr = Math.ceil(length / 16); - var sha1itr = Math.ceil(length / 20); - - // do md5 iterations - hmac.start('MD5', s1); - var md5bytes = forge.util.createBuffer(); - ai.putBytes(seed); - for(var i = 0; i < md5itr; ++i) { - // HMAC_hash(secret, A(i-1)) - hmac.start(null, null); - hmac.update(ai.getBytes()); - ai.putBuffer(hmac.digest()); - - // HMAC_hash(secret, A(i) + seed) - hmac.start(null, null); - hmac.update(ai.bytes() + seed); - md5bytes.putBuffer(hmac.digest()); - } - - // do sha1 iterations - hmac.start('SHA1', s2); - var sha1bytes = forge.util.createBuffer(); - ai.clear(); - ai.putBytes(seed); - for(var i = 0; i < sha1itr; ++i) { - // HMAC_hash(secret, A(i-1)) - hmac.start(null, null); - hmac.update(ai.getBytes()); - ai.putBuffer(hmac.digest()); - - // HMAC_hash(secret, A(i) + seed) - hmac.start(null, null); - hmac.update(ai.bytes() + seed); - sha1bytes.putBuffer(hmac.digest()); - } - - // XOR the md5 bytes with the sha1 bytes - rval.putBytes(forge.util.xorBytes( - md5bytes.getBytes(), sha1bytes.getBytes(), length)); - - return rval; -}; - -/** - * Generates pseudo random bytes using a SHA256 algorithm. For TLS 1.2. - * - * @param secret the secret to use. - * @param label the label to use. - * @param seed the seed value to use. - * @param length the number of bytes to generate. - * - * @return the pseudo random bytes in a byte buffer. - */ -var prf_sha256 = function(secret, label, seed, length) { - // FIXME: implement me for TLS 1.2 -}; - -/** - * Gets a MAC for a record using the SHA-1 hash algorithm. - * - * @param key the mac key. - * @param state the sequence number (array of two 32-bit integers). - * @param record the record. - * - * @return the sha-1 hash (20 bytes) for the given record. - */ -var hmac_sha1 = function(key, seqNum, record) { - /* MAC is computed like so: - HMAC_hash( - key, seqNum + - TLSCompressed.type + - TLSCompressed.version + - TLSCompressed.length + - TLSCompressed.fragment) - */ - var hmac = forge.hmac.create(); - hmac.start('SHA1', key); - var b = forge.util.createBuffer(); - b.putInt32(seqNum[0]); - b.putInt32(seqNum[1]); - b.putByte(record.type); - b.putByte(record.version.major); - b.putByte(record.version.minor); - b.putInt16(record.length); - b.putBytes(record.fragment.bytes()); - hmac.update(b.getBytes()); - return hmac.digest().getBytes(); -}; - -/** - * Compresses the TLSPlaintext record into a TLSCompressed record using the - * deflate algorithm. - * - * @param c the TLS connection. - * @param record the TLSPlaintext record to compress. - * @param s the ConnectionState to use. - * - * @return true on success, false on failure. - */ -var deflate = function(c, record, s) { - var rval = false; - - try { - var bytes = c.deflate(record.fragment.getBytes()); - record.fragment = forge.util.createBuffer(bytes); - record.length = bytes.length; - rval = true; - } catch(ex) { - // deflate error, fail out - } - - return rval; -}; - -/** - * Decompresses the TLSCompressed record into a TLSPlaintext record using the - * deflate algorithm. - * - * @param c the TLS connection. - * @param record the TLSCompressed record to decompress. - * @param s the ConnectionState to use. - * - * @return true on success, false on failure. - */ -var inflate = function(c, record, s) { - var rval = false; - - try { - var bytes = c.inflate(record.fragment.getBytes()); - record.fragment = forge.util.createBuffer(bytes); - record.length = bytes.length; - rval = true; - } catch(ex) { - // inflate error, fail out - } - - return rval; -}; - -/** - * Reads a TLS variable-length vector from a byte buffer. - * - * Variable-length vectors are defined by specifying a subrange of legal - * lengths, inclusively, using the notation . When these are - * encoded, the actual length precedes the vector's contents in the byte - * stream. The length will be in the form of a number consuming as many bytes - * as required to hold the vector's specified maximum (ceiling) length. A - * variable-length vector with an actual length field of zero is referred to - * as an empty vector. - * - * @param b the byte buffer. - * @param lenBytes the number of bytes required to store the length. - * - * @return the resulting byte buffer. - */ -var readVector = function(b, lenBytes) { - var len = 0; - switch(lenBytes) { - case 1: - len = b.getByte(); - break; - case 2: - len = b.getInt16(); - break; - case 3: - len = b.getInt24(); - break; - case 4: - len = b.getInt32(); - break; - } - - // read vector bytes into a new buffer - return forge.util.createBuffer(b.getBytes(len)); -}; - -/** - * Writes a TLS variable-length vector to a byte buffer. - * - * @param b the byte buffer. - * @param lenBytes the number of bytes required to store the length. - * @param v the byte buffer vector. - */ -var writeVector = function(b, lenBytes, v) { - // encode length at the start of the vector, where the number of bytes for - // the length is the maximum number of bytes it would take to encode the - // vector's ceiling - b.putInt(v.length(), lenBytes << 3); - b.putBuffer(v); -}; - -/** - * The tls implementation. - */ -var tls = {}; - -/** - * Version: TLS 1.2 = 3.3, TLS 1.1 = 3.2, TLS 1.0 = 3.1. Both TLS 1.1 and - * TLS 1.2 were still too new (ie: openSSL didn't implement them) at the time - * of this implementation so TLS 1.0 was implemented instead. - */ -tls.Versions = { - TLS_1_0: {major: 3, minor: 1}, - TLS_1_1: {major: 3, minor: 2}, - TLS_1_2: {major: 3, minor: 3} -}; -tls.SupportedVersions = [ - tls.Versions.TLS_1_1, - tls.Versions.TLS_1_0 -]; -tls.Version = tls.SupportedVersions[0]; - -/** - * Maximum fragment size. True maximum is 16384, but we fragment before that - * to allow for unusual small increases during compression. - */ -tls.MaxFragment = 16384 - 1024; - -/** - * Whether this entity is considered the "client" or "server". - * enum { server, client } ConnectionEnd; - */ -tls.ConnectionEnd = { - server: 0, - client: 1 -}; - -/** - * Pseudo-random function algorithm used to generate keys from the master - * secret. - * enum { tls_prf_sha256 } PRFAlgorithm; - */ -tls.PRFAlgorithm = { - tls_prf_sha256: 0 -}; - -/** - * Bulk encryption algorithms. - * enum { null, rc4, des3, aes } BulkCipherAlgorithm; - */ -tls.BulkCipherAlgorithm = { - none: null, - rc4: 0, - des3: 1, - aes: 2 -}; - -/** - * Cipher types. - * enum { stream, block, aead } CipherType; - */ -tls.CipherType = { - stream: 0, - block: 1, - aead: 2 -}; - -/** - * MAC (Message Authentication Code) algorithms. - * enum { null, hmac_md5, hmac_sha1, hmac_sha256, - * hmac_sha384, hmac_sha512} MACAlgorithm; - */ -tls.MACAlgorithm = { - none: null, - hmac_md5: 0, - hmac_sha1: 1, - hmac_sha256: 2, - hmac_sha384: 3, - hmac_sha512: 4 -}; - -/** - * Compression algorithms. - * enum { null(0), deflate(1), (255) } CompressionMethod; - */ -tls.CompressionMethod = { - none: 0, - deflate: 1 -}; - -/** - * TLS record content types. - * enum { - * change_cipher_spec(20), alert(21), handshake(22), - * application_data(23), (255) - * } ContentType; - */ -tls.ContentType = { - change_cipher_spec: 20, - alert: 21, - handshake: 22, - application_data: 23, - heartbeat: 24 -}; - -/** - * TLS handshake types. - * enum { - * hello_request(0), client_hello(1), server_hello(2), - * certificate(11), server_key_exchange (12), - * certificate_request(13), server_hello_done(14), - * certificate_verify(15), client_key_exchange(16), - * finished(20), (255) - * } HandshakeType; - */ -tls.HandshakeType = { - hello_request: 0, - client_hello: 1, - server_hello: 2, - certificate: 11, - server_key_exchange: 12, - certificate_request: 13, - server_hello_done: 14, - certificate_verify: 15, - client_key_exchange: 16, - finished: 20 -}; - -/** - * TLS Alert Protocol. - * - * enum { warning(1), fatal(2), (255) } AlertLevel; - * - * enum { - * close_notify(0), - * unexpected_message(10), - * bad_record_mac(20), - * decryption_failed(21), - * record_overflow(22), - * decompression_failure(30), - * handshake_failure(40), - * bad_certificate(42), - * unsupported_certificate(43), - * certificate_revoked(44), - * certificate_expired(45), - * certificate_unknown(46), - * illegal_parameter(47), - * unknown_ca(48), - * access_denied(49), - * decode_error(50), - * decrypt_error(51), - * export_restriction(60), - * protocol_version(70), - * insufficient_security(71), - * internal_error(80), - * user_canceled(90), - * no_renegotiation(100), - * (255) - * } AlertDescription; - * - * struct { - * AlertLevel level; - * AlertDescription description; - * } Alert; - */ -tls.Alert = {}; -tls.Alert.Level = { - warning: 1, - fatal: 2 -}; -tls.Alert.Description = { - close_notify: 0, - unexpected_message: 10, - bad_record_mac: 20, - decryption_failed: 21, - record_overflow: 22, - decompression_failure: 30, - handshake_failure: 40, - bad_certificate: 42, - unsupported_certificate: 43, - certificate_revoked: 44, - certificate_expired: 45, - certificate_unknown: 46, - illegal_parameter: 47, - unknown_ca: 48, - access_denied: 49, - decode_error: 50, - decrypt_error: 51, - export_restriction: 60, - protocol_version: 70, - insufficient_security: 71, - internal_error: 80, - user_canceled: 90, - no_renegotiation: 100 -}; - -/** - * TLS Heartbeat Message types. - * enum { - * heartbeat_request(1), - * heartbeat_response(2), - * (255) - * } HeartbeatMessageType; - */ -tls.HeartbeatMessageType = { - heartbeat_request: 1, - heartbeat_response: 2 -}; - -/** - * Supported cipher suites. - */ -tls.CipherSuites = {}; - -/** - * Gets a supported cipher suite from its 2 byte ID. - * - * @param twoBytes two bytes in a string. - * - * @return the matching supported cipher suite or null. - */ -tls.getCipherSuite = function(twoBytes) { - var rval = null; - for(var key in tls.CipherSuites) { - var cs = tls.CipherSuites[key]; - if(cs.id[0] === twoBytes.charCodeAt(0) && - cs.id[1] === twoBytes.charCodeAt(1)) { - rval = cs; - break; - } - } - return rval; -}; - -/** - * Called when an unexpected record is encountered. - * - * @param c the connection. - * @param record the record. - */ -tls.handleUnexpected = function(c, record) { - // if connection is client and closed, ignore unexpected messages - var ignore = (!c.open && c.entity === tls.ConnectionEnd.client); - if(!ignore) { - c.error(c, { - message: 'Unexpected message. Received TLS record out of order.', - send: true, - alert: { - level: tls.Alert.Level.fatal, - description: tls.Alert.Description.unexpected_message - } - }); - } -}; - -/** - * Called when a client receives a HelloRequest record. - * - * @param c the connection. - * @param record the record. - * @param length the length of the handshake message. - */ -tls.handleHelloRequest = function(c, record, length) { - // ignore renegotiation requests from the server during a handshake, but - // if handshaking, send a warning alert that renegotation is denied - if(!c.handshaking && c.handshakes > 0) { - // send alert warning - tls.queue(c, tls.createAlert(c, { - level: tls.Alert.Level.warning, - description: tls.Alert.Description.no_renegotiation - })); - tls.flush(c); - } - - // continue - c.process(); -}; - -/** - * Parses a hello message from a ClientHello or ServerHello record. - * - * @param record the record to parse. - * - * @return the parsed message. - */ -tls.parseHelloMessage = function(c, record, length) { - var msg = null; - - var client = (c.entity === tls.ConnectionEnd.client); - - // minimum of 38 bytes in message - if(length < 38) { - c.error(c, { - message: client ? - 'Invalid ServerHello message. Message too short.' : - 'Invalid ClientHello message. Message too short.', - send: true, - alert: { - level: tls.Alert.Level.fatal, - description: tls.Alert.Description.illegal_parameter - } - }); - } else { - // use 'remaining' to calculate # of remaining bytes in the message - var b = record.fragment; - var remaining = b.length(); - msg = { - version: { - major: b.getByte(), - minor: b.getByte() - }, - random: forge.util.createBuffer(b.getBytes(32)), - session_id: readVector(b, 1), - extensions: [] - }; - if(client) { - msg.cipher_suite = b.getBytes(2); - msg.compression_method = b.getByte(); - } else { - msg.cipher_suites = readVector(b, 2); - msg.compression_methods = readVector(b, 1); - } - - // read extensions if there are any bytes left in the message - remaining = length - (remaining - b.length()); - if(remaining > 0) { - // parse extensions - var exts = readVector(b, 2); - while(exts.length() > 0) { - msg.extensions.push({ - type: [exts.getByte(), exts.getByte()], - data: readVector(exts, 2) - }); - } - - // TODO: make extension support modular - if(!client) { - for(var i = 0; i < msg.extensions.length; ++i) { - var ext = msg.extensions[i]; - - // support SNI extension - if(ext.type[0] === 0x00 && ext.type[1] === 0x00) { - // get server name list - var snl = readVector(ext.data, 2); - while(snl.length() > 0) { - // read server name type - var snType = snl.getByte(); - - // only HostName type (0x00) is known, break out if - // another type is detected - if(snType !== 0x00) { - break; - } - - // add host name to server name list - c.session.extensions.server_name.serverNameList.push( - readVector(snl, 2).getBytes()); - } - } - } - } - } - - // version already set, do not allow version change - if(c.session.version) { - if(msg.version.major !== c.session.version.major || - msg.version.minor !== c.session.version.minor) { - return c.error(c, { - message: 'TLS version change is disallowed during renegotiation.', - send: true, - alert: { - level: tls.Alert.Level.fatal, - description: tls.Alert.Description.protocol_version - } - }); - } - } - - // get the chosen (ServerHello) cipher suite - if(client) { - // FIXME: should be checking configured acceptable cipher suites - c.session.cipherSuite = tls.getCipherSuite(msg.cipher_suite); - } else { - // get a supported preferred (ClientHello) cipher suite - // choose the first supported cipher suite - var tmp = forge.util.createBuffer(msg.cipher_suites.bytes()); - while(tmp.length() > 0) { - // FIXME: should be checking configured acceptable suites - // cipher suites take up 2 bytes - c.session.cipherSuite = tls.getCipherSuite(tmp.getBytes(2)); - if(c.session.cipherSuite !== null) { - break; - } - } - } - - // cipher suite not supported - if(c.session.cipherSuite === null) { - return c.error(c, { - message: 'No cipher suites in common.', - send: true, - alert: { - level: tls.Alert.Level.fatal, - description: tls.Alert.Description.handshake_failure - }, - cipherSuite: forge.util.bytesToHex(msg.cipher_suite) - }); - } - - // TODO: handle compression methods - if(client) { - c.session.compressionMethod = msg.compression_method; - } else { - // no compression - c.session.compressionMethod = tls.CompressionMethod.none; - } - } - - return msg; -}; - -/** - * Creates security parameters for the given connection based on the given - * hello message. - * - * @param c the TLS connection. - * @param msg the hello message. - */ -tls.createSecurityParameters = function(c, msg) { - /* Note: security params are from TLS 1.2, some values like prf_algorithm - are ignored for TLS 1.0/1.1 and the builtin as specified in the spec is - used. */ - - // TODO: handle other options from server when more supported - - // get client and server randoms - var client = (c.entity === tls.ConnectionEnd.client); - var msgRandom = msg.random.bytes(); - var cRandom = client ? c.session.sp.client_random : msgRandom; - var sRandom = client ? msgRandom : tls.createRandom().getBytes(); - - // create new security parameters - c.session.sp = { - entity: c.entity, - prf_algorithm: tls.PRFAlgorithm.tls_prf_sha256, - bulk_cipher_algorithm: null, - cipher_type: null, - enc_key_length: null, - block_length: null, - fixed_iv_length: null, - record_iv_length: null, - mac_algorithm: null, - mac_length: null, - mac_key_length: null, - compression_algorithm: c.session.compressionMethod, - pre_master_secret: null, - master_secret: null, - client_random: cRandom, - server_random: sRandom - }; -}; - -/** - * Called when a client receives a ServerHello record. - * - * When a ServerHello message will be sent: - * The server will send this message in response to a client hello message - * when it was able to find an acceptable set of algorithms. If it cannot - * find such a match, it will respond with a handshake failure alert. - * - * uint24 length; - * struct { - * ProtocolVersion server_version; - * Random random; - * SessionID session_id; - * CipherSuite cipher_suite; - * CompressionMethod compression_method; - * select(extensions_present) { - * case false: - * struct {}; - * case true: - * Extension extensions<0..2^16-1>; - * }; - * } ServerHello; - * - * @param c the connection. - * @param record the record. - * @param length the length of the handshake message. - */ -tls.handleServerHello = function(c, record, length) { - var msg = tls.parseHelloMessage(c, record, length); - if(c.fail) { - return; - } - - // ensure server version is compatible - if(msg.version.minor <= c.version.minor) { - c.version.minor = msg.version.minor; - } else { - return c.error(c, { - message: 'Incompatible TLS version.', - send: true, - alert: { - level: tls.Alert.Level.fatal, - description: tls.Alert.Description.protocol_version - } - }); - } - - // indicate session version has been set - c.session.version = c.version; - - // get the session ID from the message - var sessionId = msg.session_id.bytes(); - - // if the session ID is not blank and matches the cached one, resume - // the session - if(sessionId.length > 0 && sessionId === c.session.id) { - // resuming session, expect a ChangeCipherSpec next - c.expect = SCC; - c.session.resuming = true; - - // get new server random - c.session.sp.server_random = msg.random.bytes(); - } else { - // not resuming, expect a server Certificate message next - c.expect = SCE; - c.session.resuming = false; - - // create new security parameters - tls.createSecurityParameters(c, msg); - } - - // set new session ID - c.session.id = sessionId; - - // continue - c.process(); -}; - -/** - * Called when a server receives a ClientHello record. - * - * When a ClientHello message will be sent: - * When a client first connects to a server it is required to send the - * client hello as its first message. The client can also send a client - * hello in response to a hello request or on its own initiative in order - * to renegotiate the security parameters in an existing connection. - * - * @param c the connection. - * @param record the record. - * @param length the length of the handshake message. - */ -tls.handleClientHello = function(c, record, length) { - var msg = tls.parseHelloMessage(c, record, length); - if(c.fail) { - return; - } - - // get the session ID from the message - var sessionId = msg.session_id.bytes(); - - // see if the given session ID is in the cache - var session = null; - if(c.sessionCache) { - session = c.sessionCache.getSession(sessionId); - if(session === null) { - // session ID not found - sessionId = ''; - } else if(session.version.major !== msg.version.major || - session.version.minor > msg.version.minor) { - // if session version is incompatible with client version, do not resume - session = null; - sessionId = ''; - } - } - - // no session found to resume, generate a new session ID - if(sessionId.length === 0) { - sessionId = forge.random.getBytes(32); - } - - // update session - c.session.id = sessionId; - c.session.clientHelloVersion = msg.version; - c.session.sp = {}; - if(session) { - // use version and security parameters from resumed session - c.version = c.session.version = session.version; - c.session.sp = session.sp; - } else { - // use highest compatible minor version - var version; - for(var i = 1; i < tls.SupportedVersions.length; ++i) { - version = tls.SupportedVersions[i]; - if(version.minor <= msg.version.minor) { - break; - } - } - c.version = {major: version.major, minor: version.minor}; - c.session.version = c.version; - } - - // if a session is set, resume it - if(session !== null) { - // resuming session, expect a ChangeCipherSpec next - c.expect = CCC; - c.session.resuming = true; - - // get new client random - c.session.sp.client_random = msg.random.bytes(); - } else { - // not resuming, expect a Certificate or ClientKeyExchange - c.expect = (c.verifyClient !== false) ? CCE : CKE; - c.session.resuming = false; - - // create new security parameters - tls.createSecurityParameters(c, msg); - } - - // connection now open - c.open = true; - - // queue server hello - tls.queue(c, tls.createRecord(c, { - type: tls.ContentType.handshake, - data: tls.createServerHello(c) - })); - - if(c.session.resuming) { - // queue change cipher spec message - tls.queue(c, tls.createRecord(c, { - type: tls.ContentType.change_cipher_spec, - data: tls.createChangeCipherSpec() - })); - - // create pending state - c.state.pending = tls.createConnectionState(c); - - // change current write state to pending write state - c.state.current.write = c.state.pending.write; - - // queue finished - tls.queue(c, tls.createRecord(c, { - type: tls.ContentType.handshake, - data: tls.createFinished(c) - })); - } else { - // queue server certificate - tls.queue(c, tls.createRecord(c, { - type: tls.ContentType.handshake, - data: tls.createCertificate(c) - })); - - if(!c.fail) { - // queue server key exchange - tls.queue(c, tls.createRecord(c, { - type: tls.ContentType.handshake, - data: tls.createServerKeyExchange(c) - })); - - // request client certificate if set - if(c.verifyClient !== false) { - // queue certificate request - tls.queue(c, tls.createRecord(c, { - type: tls.ContentType.handshake, - data: tls.createCertificateRequest(c) - })); - } - - // queue server hello done - tls.queue(c, tls.createRecord(c, { - type: tls.ContentType.handshake, - data: tls.createServerHelloDone(c) - })); - } - } - - // send records - tls.flush(c); - - // continue - c.process(); -}; - -/** - * Called when a client receives a Certificate record. - * - * When this message will be sent: - * The server must send a certificate whenever the agreed-upon key exchange - * method is not an anonymous one. This message will always immediately - * follow the server hello message. - * - * Meaning of this message: - * The certificate type must be appropriate for the selected cipher suite's - * key exchange algorithm, and is generally an X.509v3 certificate. It must - * contain a key which matches the key exchange method, as follows. Unless - * otherwise specified, the signing algorithm for the certificate must be - * the same as the algorithm for the certificate key. Unless otherwise - * specified, the public key may be of any length. - * - * opaque ASN.1Cert<1..2^24-1>; - * struct { - * ASN.1Cert certificate_list<1..2^24-1>; - * } Certificate; - * - * @param c the connection. - * @param record the record. - * @param length the length of the handshake message. - */ -tls.handleCertificate = function(c, record, length) { - // minimum of 3 bytes in message - if(length < 3) { - return c.error(c, { - message: 'Invalid Certificate message. Message too short.', - send: true, - alert: { - level: tls.Alert.Level.fatal, - description: tls.Alert.Description.illegal_parameter - } - }); - } - - var b = record.fragment; - var msg = { - certificate_list: readVector(b, 3) - }; - - /* The sender's certificate will be first in the list (chain), each - subsequent one that follows will certify the previous one, but root - certificates (self-signed) that specify the certificate authority may - be omitted under the assumption that clients must already possess it. */ - var cert, asn1; - var certs = []; - try { - while(msg.certificate_list.length() > 0) { - // each entry in msg.certificate_list is a vector with 3 len bytes - cert = readVector(msg.certificate_list, 3); - asn1 = forge.asn1.fromDer(cert); - cert = forge.pki.certificateFromAsn1(asn1, true); - certs.push(cert); - } - } catch(ex) { - return c.error(c, { - message: 'Could not parse certificate list.', - cause: ex, - send: true, - alert: { - level: tls.Alert.Level.fatal, - description: tls.Alert.Description.bad_certificate - } - }); - } - - // ensure at least 1 certificate was provided if in client-mode - // or if verifyClient was set to true to require a certificate - // (as opposed to 'optional') - var client = (c.entity === tls.ConnectionEnd.client); - if((client || c.verifyClient === true) && certs.length === 0) { - // error, no certificate - c.error(c, { - message: client ? - 'No server certificate provided.' : - 'No client certificate provided.', - send: true, - alert: { - level: tls.Alert.Level.fatal, - description: tls.Alert.Description.illegal_parameter - } - }); - } else if(certs.length === 0) { - // no certs to verify - // expect a ServerKeyExchange or ClientKeyExchange message next - c.expect = client ? SKE : CKE; - } else { - // save certificate in session - if(client) { - c.session.serverCertificate = certs[0]; - } else { - c.session.clientCertificate = certs[0]; - } - - if(tls.verifyCertificateChain(c, certs)) { - // expect a ServerKeyExchange or ClientKeyExchange message next - c.expect = client ? SKE : CKE; - } - } - - // continue - c.process(); -}; - -/** - * Called when a client receives a ServerKeyExchange record. - * - * When this message will be sent: - * This message will be sent immediately after the server certificate - * message (or the server hello message, if this is an anonymous - * negotiation). - * - * The server key exchange message is sent by the server only when the - * server certificate message (if sent) does not contain enough data to - * allow the client to exchange a premaster secret. - * - * Meaning of this message: - * This message conveys cryptographic information to allow the client to - * communicate the premaster secret: either an RSA public key to encrypt - * the premaster secret with, or a Diffie-Hellman public key with which the - * client can complete a key exchange (with the result being the premaster - * secret.) - * - * enum { - * dhe_dss, dhe_rsa, dh_anon, rsa, dh_dss, dh_rsa - * } KeyExchangeAlgorithm; - * - * struct { - * opaque dh_p<1..2^16-1>; - * opaque dh_g<1..2^16-1>; - * opaque dh_Ys<1..2^16-1>; - * } ServerDHParams; - * - * struct { - * select(KeyExchangeAlgorithm) { - * case dh_anon: - * ServerDHParams params; - * case dhe_dss: - * case dhe_rsa: - * ServerDHParams params; - * digitally-signed struct { - * opaque client_random[32]; - * opaque server_random[32]; - * ServerDHParams params; - * } signed_params; - * case rsa: - * case dh_dss: - * case dh_rsa: - * struct {}; - * }; - * } ServerKeyExchange; - * - * @param c the connection. - * @param record the record. - * @param length the length of the handshake message. - */ -tls.handleServerKeyExchange = function(c, record, length) { - // this implementation only supports RSA, no Diffie-Hellman support - // so any length > 0 is invalid - if(length > 0) { - return c.error(c, { - message: 'Invalid key parameters. Only RSA is supported.', - send: true, - alert: { - level: tls.Alert.Level.fatal, - description: tls.Alert.Description.unsupported_certificate - } - }); - } - - // expect an optional CertificateRequest message next - c.expect = SCR; - - // continue - c.process(); -}; - -/** - * Called when a client receives a ClientKeyExchange record. - * - * @param c the connection. - * @param record the record. - * @param length the length of the handshake message. - */ -tls.handleClientKeyExchange = function(c, record, length) { - // this implementation only supports RSA, no Diffie-Hellman support - // so any length < 48 is invalid - if(length < 48) { - return c.error(c, { - message: 'Invalid key parameters. Only RSA is supported.', - send: true, - alert: { - level: tls.Alert.Level.fatal, - description: tls.Alert.Description.unsupported_certificate - } - }); - } - - var b = record.fragment; - var msg = { - enc_pre_master_secret: readVector(b, 2).getBytes() - }; - - // do rsa decryption - var privateKey = null; - if(c.getPrivateKey) { - try { - privateKey = c.getPrivateKey(c, c.session.serverCertificate); - privateKey = forge.pki.privateKeyFromPem(privateKey); - } catch(ex) { - c.error(c, { - message: 'Could not get private key.', - cause: ex, - send: true, - alert: { - level: tls.Alert.Level.fatal, - description: tls.Alert.Description.internal_error - } - }); - } - } - - if(privateKey === null) { - return c.error(c, { - message: 'No private key set.', - send: true, - alert: { - level: tls.Alert.Level.fatal, - description: tls.Alert.Description.internal_error - } - }); - } - - try { - // decrypt 48-byte pre-master secret - var sp = c.session.sp; - sp.pre_master_secret = privateKey.decrypt(msg.enc_pre_master_secret); - - // ensure client hello version matches first 2 bytes - var version = c.session.clientHelloVersion; - if(version.major !== sp.pre_master_secret.charCodeAt(0) || - version.minor !== sp.pre_master_secret.charCodeAt(1)) { - // error, do not send alert (see BLEI attack below) - throw new Error('TLS version rollback attack detected.'); - } - } catch(ex) { - /* Note: Daniel Bleichenbacher [BLEI] can be used to attack a - TLS server which is using PKCS#1 encoded RSA, so instead of - failing here, we generate 48 random bytes and use that as - the pre-master secret. */ - sp.pre_master_secret = forge.random.getBytes(48); - } - - // expect a CertificateVerify message if a Certificate was received that - // does not have fixed Diffie-Hellman params, otherwise expect - // ChangeCipherSpec - c.expect = CCC; - if(c.session.clientCertificate !== null) { - // only RSA support, so expect CertificateVerify - // TODO: support Diffie-Hellman - c.expect = CCV; - } - - // continue - c.process(); -}; - -/** - * Called when a client receives a CertificateRequest record. - * - * When this message will be sent: - * A non-anonymous server can optionally request a certificate from the - * client, if appropriate for the selected cipher suite. This message, if - * sent, will immediately follow the Server Key Exchange message (if it is - * sent; otherwise, the Server Certificate message). - * - * enum { - * rsa_sign(1), dss_sign(2), rsa_fixed_dh(3), dss_fixed_dh(4), - * rsa_ephemeral_dh_RESERVED(5), dss_ephemeral_dh_RESERVED(6), - * fortezza_dms_RESERVED(20), (255) - * } ClientCertificateType; - * - * opaque DistinguishedName<1..2^16-1>; - * - * struct { - * ClientCertificateType certificate_types<1..2^8-1>; - * SignatureAndHashAlgorithm supported_signature_algorithms<2^16-1>; - * DistinguishedName certificate_authorities<0..2^16-1>; - * } CertificateRequest; - * - * @param c the connection. - * @param record the record. - * @param length the length of the handshake message. - */ -tls.handleCertificateRequest = function(c, record, length) { - // minimum of 3 bytes in message - if(length < 3) { - return c.error(c, { - message: 'Invalid CertificateRequest. Message too short.', - send: true, - alert: { - level: tls.Alert.Level.fatal, - description: tls.Alert.Description.illegal_parameter - } - }); - } - - // TODO: TLS 1.2+ has different format including - // SignatureAndHashAlgorithm after cert types - var b = record.fragment; - var msg = { - certificate_types: readVector(b, 1), - certificate_authorities: readVector(b, 2) - }; - - // save certificate request in session - c.session.certificateRequest = msg; - - // expect a ServerHelloDone message next - c.expect = SHD; - - // continue - c.process(); -}; - -/** - * Called when a server receives a CertificateVerify record. - * - * @param c the connection. - * @param record the record. - * @param length the length of the handshake message. - */ -tls.handleCertificateVerify = function(c, record, length) { - if(length < 2) { - return c.error(c, { - message: 'Invalid CertificateVerify. Message too short.', - send: true, - alert: { - level: tls.Alert.Level.fatal, - description: tls.Alert.Description.illegal_parameter - } - }); - } - - // rewind to get full bytes for message so it can be manually - // digested below (special case for CertificateVerify messages because - // they must be digested *after* handling as opposed to all others) - var b = record.fragment; - b.read -= 4; - var msgBytes = b.bytes(); - b.read += 4; - - var msg = { - signature: readVector(b, 2).getBytes() - }; - - // TODO: add support for DSA - - // generate data to verify - var verify = forge.util.createBuffer(); - verify.putBuffer(c.session.md5.digest()); - verify.putBuffer(c.session.sha1.digest()); - verify = verify.getBytes(); - - try { - var cert = c.session.clientCertificate; - /*b = forge.pki.rsa.decrypt( - msg.signature, cert.publicKey, true, verify.length); - if(b !== verify) {*/ - if(!cert.publicKey.verify(verify, msg.signature, 'NONE')) { - throw new Error('CertificateVerify signature does not match.'); - } - - // digest message now that it has been handled - c.session.md5.update(msgBytes); - c.session.sha1.update(msgBytes); - } catch(ex) { - return c.error(c, { - message: 'Bad signature in CertificateVerify.', - send: true, - alert: { - level: tls.Alert.Level.fatal, - description: tls.Alert.Description.handshake_failure - } - }); - } - - // expect ChangeCipherSpec - c.expect = CCC; - - // continue - c.process(); -}; - -/** - * Called when a client receives a ServerHelloDone record. - * - * When this message will be sent: - * The server hello done message is sent by the server to indicate the end - * of the server hello and associated messages. After sending this message - * the server will wait for a client response. - * - * Meaning of this message: - * This message means that the server is done sending messages to support - * the key exchange, and the client can proceed with its phase of the key - * exchange. - * - * Upon receipt of the server hello done message the client should verify - * that the server provided a valid certificate if required and check that - * the server hello parameters are acceptable. - * - * struct {} ServerHelloDone; - * - * @param c the connection. - * @param record the record. - * @param length the length of the handshake message. - */ -tls.handleServerHelloDone = function(c, record, length) { - // len must be 0 bytes - if(length > 0) { - return c.error(c, { - message: 'Invalid ServerHelloDone message. Invalid length.', - send: true, - alert: { - level: tls.Alert.Level.fatal, - description: tls.Alert.Description.record_overflow - } - }); - } - - if(c.serverCertificate === null) { - // no server certificate was provided - var error = { - message: 'No server certificate provided. Not enough security.', - send: true, - alert: { - level: tls.Alert.Level.fatal, - description: tls.Alert.Description.insufficient_security - } - }; - - // call application callback - var depth = 0; - var ret = c.verify(c, error.alert.description, depth, []); - if(ret !== true) { - // check for custom alert info - if(ret || ret === 0) { - // set custom message and alert description - if(typeof ret === 'object' && !forge.util.isArray(ret)) { - if(ret.message) { - error.message = ret.message; - } - if(ret.alert) { - error.alert.description = ret.alert; - } - } else if(typeof ret === 'number') { - // set custom alert description - error.alert.description = ret; - } - } - - // send error - return c.error(c, error); - } - } - - // create client certificate message if requested - if(c.session.certificateRequest !== null) { - record = tls.createRecord(c, { - type: tls.ContentType.handshake, - data: tls.createCertificate(c) - }); - tls.queue(c, record); - } - - // create client key exchange message - record = tls.createRecord(c, { - type: tls.ContentType.handshake, - data: tls.createClientKeyExchange(c) - }); - tls.queue(c, record); - - // expect no messages until the following callback has been called - c.expect = SER; - - // create callback to handle client signature (for client-certs) - var callback = function(c, signature) { - if(c.session.certificateRequest !== null && - c.session.clientCertificate !== null) { - // create certificate verify message - tls.queue(c, tls.createRecord(c, { - type: tls.ContentType.handshake, - data: tls.createCertificateVerify(c, signature) - })); - } - - // create change cipher spec message - tls.queue(c, tls.createRecord(c, { - type: tls.ContentType.change_cipher_spec, - data: tls.createChangeCipherSpec() - })); - - // create pending state - c.state.pending = tls.createConnectionState(c); - - // change current write state to pending write state - c.state.current.write = c.state.pending.write; - - // create finished message - tls.queue(c, tls.createRecord(c, { - type: tls.ContentType.handshake, - data: tls.createFinished(c) - })); - - // expect a server ChangeCipherSpec message next - c.expect = SCC; - - // send records - tls.flush(c); - - // continue - c.process(); - }; - - // if there is no certificate request or no client certificate, do - // callback immediately - if(c.session.certificateRequest === null || - c.session.clientCertificate === null) { - return callback(c, null); - } - - // otherwise get the client signature - tls.getClientSignature(c, callback); -}; - -/** - * Called when a ChangeCipherSpec record is received. - * - * @param c the connection. - * @param record the record. - */ -tls.handleChangeCipherSpec = function(c, record) { - if(record.fragment.getByte() !== 0x01) { - return c.error(c, { - message: 'Invalid ChangeCipherSpec message received.', - send: true, - alert: { - level: tls.Alert.Level.fatal, - description: tls.Alert.Description.illegal_parameter - } - }); - } - - // create pending state if: - // 1. Resuming session in client mode OR - // 2. NOT resuming session in server mode - var client = (c.entity === tls.ConnectionEnd.client); - if((c.session.resuming && client) || (!c.session.resuming && !client)) { - c.state.pending = tls.createConnectionState(c); - } - - // change current read state to pending read state - c.state.current.read = c.state.pending.read; - - // clear pending state if: - // 1. NOT resuming session in client mode OR - // 2. resuming a session in server mode - if((!c.session.resuming && client) || (c.session.resuming && !client)) { - c.state.pending = null; - } - - // expect a Finished record next - c.expect = client ? SFI : CFI; - - // continue - c.process(); -}; - -/** - * Called when a Finished record is received. - * - * When this message will be sent: - * A finished message is always sent immediately after a change - * cipher spec message to verify that the key exchange and - * authentication processes were successful. It is essential that a - * change cipher spec message be received between the other - * handshake messages and the Finished message. - * - * Meaning of this message: - * The finished message is the first protected with the just- - * negotiated algorithms, keys, and secrets. Recipients of finished - * messages must verify that the contents are correct. Once a side - * has sent its Finished message and received and validated the - * Finished message from its peer, it may begin to send and receive - * application data over the connection. - * - * struct { - * opaque verify_data[verify_data_length]; - * } Finished; - * - * verify_data - * PRF(master_secret, finished_label, Hash(handshake_messages)) - * [0..verify_data_length-1]; - * - * finished_label - * For Finished messages sent by the client, the string - * "client finished". For Finished messages sent by the server, the - * string "server finished". - * - * verify_data_length depends on the cipher suite. If it is not specified - * by the cipher suite, then it is 12. Versions of TLS < 1.2 always used - * 12 bytes. - * - * @param c the connection. - * @param record the record. - * @param length the length of the handshake message. - */ -tls.handleFinished = function(c, record, length) { - // rewind to get full bytes for message so it can be manually - // digested below (special case for Finished messages because they - // must be digested *after* handling as opposed to all others) - var b = record.fragment; - b.read -= 4; - var msgBytes = b.bytes(); - b.read += 4; - - // message contains only verify_data - var vd = record.fragment.getBytes(); - - // ensure verify data is correct - b = forge.util.createBuffer(); - b.putBuffer(c.session.md5.digest()); - b.putBuffer(c.session.sha1.digest()); - - // set label based on entity type - var client = (c.entity === tls.ConnectionEnd.client); - var label = client ? 'server finished' : 'client finished'; - - // TODO: determine prf function and verify length for TLS 1.2 - var sp = c.session.sp; - var vdl = 12; - var prf = prf_TLS1; - b = prf(sp.master_secret, label, b.getBytes(), vdl); - if(b.getBytes() !== vd) { - return c.error(c, { - message: 'Invalid verify_data in Finished message.', - send: true, - alert: { - level: tls.Alert.Level.fatal, - description: tls.Alert.Description.decrypt_error - } - }); - } - - // digest finished message now that it has been handled - c.session.md5.update(msgBytes); - c.session.sha1.update(msgBytes); - - // resuming session as client or NOT resuming session as server - if((c.session.resuming && client) || (!c.session.resuming && !client)) { - // create change cipher spec message - tls.queue(c, tls.createRecord(c, { - type: tls.ContentType.change_cipher_spec, - data: tls.createChangeCipherSpec() - })); - - // change current write state to pending write state, clear pending - c.state.current.write = c.state.pending.write; - c.state.pending = null; - - // create finished message - tls.queue(c, tls.createRecord(c, { - type: tls.ContentType.handshake, - data: tls.createFinished(c) - })); - } - - // expect application data next - c.expect = client ? SAD : CAD; - - // handshake complete - c.handshaking = false; - ++c.handshakes; - - // save access to peer certificate - c.peerCertificate = client ? - c.session.serverCertificate : c.session.clientCertificate; - - // send records - tls.flush(c); - - // now connected - c.isConnected = true; - c.connected(c); - - // continue - c.process(); -}; - -/** - * Called when an Alert record is received. - * - * @param c the connection. - * @param record the record. - */ -tls.handleAlert = function(c, record) { - // read alert - var b = record.fragment; - var alert = { - level: b.getByte(), - description: b.getByte() - }; - - // TODO: consider using a table? - // get appropriate message - var msg; - switch(alert.description) { - case tls.Alert.Description.close_notify: - msg = 'Connection closed.'; - break; - case tls.Alert.Description.unexpected_message: - msg = 'Unexpected message.'; - break; - case tls.Alert.Description.bad_record_mac: - msg = 'Bad record MAC.'; - break; - case tls.Alert.Description.decryption_failed: - msg = 'Decryption failed.'; - break; - case tls.Alert.Description.record_overflow: - msg = 'Record overflow.'; - break; - case tls.Alert.Description.decompression_failure: - msg = 'Decompression failed.'; - break; - case tls.Alert.Description.handshake_failure: - msg = 'Handshake failure.'; - break; - case tls.Alert.Description.bad_certificate: - msg = 'Bad certificate.'; - break; - case tls.Alert.Description.unsupported_certificate: - msg = 'Unsupported certificate.'; - break; - case tls.Alert.Description.certificate_revoked: - msg = 'Certificate revoked.'; - break; - case tls.Alert.Description.certificate_expired: - msg = 'Certificate expired.'; - break; - case tls.Alert.Description.certificate_unknown: - msg = 'Certificate unknown.'; - break; - case tls.Alert.Description.illegal_parameter: - msg = 'Illegal parameter.'; - break; - case tls.Alert.Description.unknown_ca: - msg = 'Unknown certificate authority.'; - break; - case tls.Alert.Description.access_denied: - msg = 'Access denied.'; - break; - case tls.Alert.Description.decode_error: - msg = 'Decode error.'; - break; - case tls.Alert.Description.decrypt_error: - msg = 'Decrypt error.'; - break; - case tls.Alert.Description.export_restriction: - msg = 'Export restriction.'; - break; - case tls.Alert.Description.protocol_version: - msg = 'Unsupported protocol version.'; - break; - case tls.Alert.Description.insufficient_security: - msg = 'Insufficient security.'; - break; - case tls.Alert.Description.internal_error: - msg = 'Internal error.'; - break; - case tls.Alert.Description.user_canceled: - msg = 'User canceled.'; - break; - case tls.Alert.Description.no_renegotiation: - msg = 'Renegotiation not supported.'; - break; - default: - msg = 'Unknown error.'; - break; - } - - // close connection on close_notify, not an error - if(alert.description === tls.Alert.Description.close_notify) { - return c.close(); - } - - // call error handler - c.error(c, { - message: msg, - send: false, - // origin is the opposite end - origin: (c.entity === tls.ConnectionEnd.client) ? 'server' : 'client', - alert: alert - }); - - // continue - c.process(); -}; - -/** - * Called when a Handshake record is received. - * - * @param c the connection. - * @param record the record. - */ -tls.handleHandshake = function(c, record) { - // get the handshake type and message length - var b = record.fragment; - var type = b.getByte(); - var length = b.getInt24(); - - // see if the record fragment doesn't yet contain the full message - if(length > b.length()) { - // cache the record, clear its fragment, and reset the buffer read - // pointer before the type and length were read - c.fragmented = record; - record.fragment = forge.util.createBuffer(); - b.read -= 4; - - // continue - return c.process(); - } - - // full message now available, clear cache, reset read pointer to - // before type and length - c.fragmented = null; - b.read -= 4; - - // save the handshake bytes for digestion after handler is found - // (include type and length of handshake msg) - var bytes = b.bytes(length + 4); - - // restore read pointer - b.read += 4; - - // handle expected message - if(type in hsTable[c.entity][c.expect]) { - // initialize server session - if(c.entity === tls.ConnectionEnd.server && !c.open && !c.fail) { - c.handshaking = true; - c.session = { - version: null, - extensions: { - server_name: { - serverNameList: [] - } - }, - cipherSuite: null, - compressionMethod: null, - serverCertificate: null, - clientCertificate: null, - md5: forge.md.md5.create(), - sha1: forge.md.sha1.create() - }; - } - - /* Update handshake messages digest. Finished and CertificateVerify - messages are not digested here. They can't be digested as part of - the verify_data that they contain. These messages are manually - digested in their handlers. HelloRequest messages are simply never - included in the handshake message digest according to spec. */ - if(type !== tls.HandshakeType.hello_request && - type !== tls.HandshakeType.certificate_verify && - type !== tls.HandshakeType.finished) { - c.session.md5.update(bytes); - c.session.sha1.update(bytes); - } - - // handle specific handshake type record - hsTable[c.entity][c.expect][type](c, record, length); - } else { - // unexpected record - tls.handleUnexpected(c, record); - } -}; - -/** - * Called when an ApplicationData record is received. - * - * @param c the connection. - * @param record the record. - */ -tls.handleApplicationData = function(c, record) { - // buffer data, notify that its ready - c.data.putBuffer(record.fragment); - c.dataReady(c); - - // continue - c.process(); -}; - -/** - * Called when a Heartbeat record is received. - * - * @param c the connection. - * @param record the record. - */ -tls.handleHeartbeat = function(c, record) { - // get the heartbeat type and payload - var b = record.fragment; - var type = b.getByte(); - var length = b.getInt16(); - var payload = b.getBytes(length); - - if(type === tls.HeartbeatMessageType.heartbeat_request) { - // discard request during handshake or if length is too large - if(c.handshaking || length > payload.length) { - // continue - return c.process(); - } - // retransmit payload - tls.queue(c, tls.createRecord(c, { - type: tls.ContentType.heartbeat, - data: tls.createHeartbeat( - tls.HeartbeatMessageType.heartbeat_response, payload) - })); - tls.flush(c); - } else if(type === tls.HeartbeatMessageType.heartbeat_response) { - // check payload against expected payload, discard heartbeat if no match - if(payload !== c.expectedHeartbeatPayload) { - // continue - return c.process(); - } - - // notify that a valid heartbeat was received - if(c.heartbeatReceived) { - c.heartbeatReceived(c, forge.util.createBuffer(payload)); - } - } - - // continue - c.process(); -}; - -/** - * The transistional state tables for receiving TLS records. It maps the - * current TLS engine state and a received record to a function to handle the - * record and update the state. - * - * For instance, if the current state is SHE, then the TLS engine is expecting - * a ServerHello record. Once a record is received, the handler function is - * looked up using the state SHE and the record's content type. - * - * The resulting function will either be an error handler or a record handler. - * The function will take whatever action is appropriate and update the state - * for the next record. - * - * The states are all based on possible server record types. Note that the - * client will never specifically expect to receive a HelloRequest or an alert - * from the server so there is no state that reflects this. These messages may - * occur at any time. - * - * There are two tables for mapping states because there is a second tier of - * types for handshake messages. Once a record with a content type of handshake - * is received, the handshake record handler will look up the handshake type in - * the secondary map to get its appropriate handler. - * - * Valid message orders are as follows: - * - * =======================FULL HANDSHAKE====================== - * Client Server - * - * ClientHello --------> - * ServerHello - * Certificate* - * ServerKeyExchange* - * CertificateRequest* - * <-------- ServerHelloDone - * Certificate* - * ClientKeyExchange - * CertificateVerify* - * [ChangeCipherSpec] - * Finished --------> - * [ChangeCipherSpec] - * <-------- Finished - * Application Data <-------> Application Data - * - * =====================SESSION RESUMPTION===================== - * Client Server - * - * ClientHello --------> - * ServerHello - * [ChangeCipherSpec] - * <-------- Finished - * [ChangeCipherSpec] - * Finished --------> - * Application Data <-------> Application Data - */ -// client expect states (indicate which records are expected to be received) -var SHE = 0; // rcv server hello -var SCE = 1; // rcv server certificate -var SKE = 2; // rcv server key exchange -var SCR = 3; // rcv certificate request -var SHD = 4; // rcv server hello done -var SCC = 5; // rcv change cipher spec -var SFI = 6; // rcv finished -var SAD = 7; // rcv application data -var SER = 8; // not expecting any messages at this point - -// server expect states -var CHE = 0; // rcv client hello -var CCE = 1; // rcv client certificate -var CKE = 2; // rcv client key exchange -var CCV = 3; // rcv certificate verify -var CCC = 4; // rcv change cipher spec -var CFI = 5; // rcv finished -var CAD = 6; // rcv application data -var CER = 7; // not expecting any messages at this point - -// map client current expect state and content type to function -var __ = tls.handleUnexpected; -var R0 = tls.handleChangeCipherSpec; -var R1 = tls.handleAlert; -var R2 = tls.handleHandshake; -var R3 = tls.handleApplicationData; -var R4 = tls.handleHeartbeat; -var ctTable = []; -ctTable[tls.ConnectionEnd.client] = [ -// CC,AL,HS,AD,HB -/*SHE*/[__,R1,R2,__,R4], -/*SCE*/[__,R1,R2,__,R4], -/*SKE*/[__,R1,R2,__,R4], -/*SCR*/[__,R1,R2,__,R4], -/*SHD*/[__,R1,R2,__,R4], -/*SCC*/[R0,R1,__,__,R4], -/*SFI*/[__,R1,R2,__,R4], -/*SAD*/[__,R1,R2,R3,R4], -/*SER*/[__,R1,R2,__,R4] -]; - -// map server current expect state and content type to function -ctTable[tls.ConnectionEnd.server] = [ -// CC,AL,HS,AD -/*CHE*/[__,R1,R2,__,R4], -/*CCE*/[__,R1,R2,__,R4], -/*CKE*/[__,R1,R2,__,R4], -/*CCV*/[__,R1,R2,__,R4], -/*CCC*/[R0,R1,__,__,R4], -/*CFI*/[__,R1,R2,__,R4], -/*CAD*/[__,R1,R2,R3,R4], -/*CER*/[__,R1,R2,__,R4] -]; - -// map client current expect state and handshake type to function -var H0 = tls.handleHelloRequest; -var H1 = tls.handleServerHello; -var H2 = tls.handleCertificate; -var H3 = tls.handleServerKeyExchange; -var H4 = tls.handleCertificateRequest; -var H5 = tls.handleServerHelloDone; -var H6 = tls.handleFinished; -var hsTable = []; -hsTable[tls.ConnectionEnd.client] = [ -// HR,01,SH,03,04,05,06,07,08,09,10,SC,SK,CR,HD,15,CK,17,18,19,FI -/*SHE*/[__,__,H1,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__], -/*SCE*/[H0,__,__,__,__,__,__,__,__,__,__,H2,H3,H4,H5,__,__,__,__,__,__], -/*SKE*/[H0,__,__,__,__,__,__,__,__,__,__,__,H3,H4,H5,__,__,__,__,__,__], -/*SCR*/[H0,__,__,__,__,__,__,__,__,__,__,__,__,H4,H5,__,__,__,__,__,__], -/*SHD*/[H0,__,__,__,__,__,__,__,__,__,__,__,__,__,H5,__,__,__,__,__,__], -/*SCC*/[H0,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__], -/*SFI*/[H0,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,H6], -/*SAD*/[H0,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__], -/*SER*/[H0,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__] -]; - -// map server current expect state and handshake type to function -// Note: CAD[CH] does not map to FB because renegotation is prohibited -var H7 = tls.handleClientHello; -var H8 = tls.handleClientKeyExchange; -var H9 = tls.handleCertificateVerify; -hsTable[tls.ConnectionEnd.server] = [ -// 01,CH,02,03,04,05,06,07,08,09,10,CC,12,13,14,CV,CK,17,18,19,FI -/*CHE*/[__,H7,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__], -/*CCE*/[__,__,__,__,__,__,__,__,__,__,__,H2,__,__,__,__,__,__,__,__,__], -/*CKE*/[__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,H8,__,__,__,__], -/*CCV*/[__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,H9,__,__,__,__,__], -/*CCC*/[__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__], -/*CFI*/[__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,H6], -/*CAD*/[__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__], -/*CER*/[__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__] -]; - -/** - * Generates the master_secret and keys using the given security parameters. - * - * The security parameters for a TLS connection state are defined as such: - * - * struct { - * ConnectionEnd entity; - * PRFAlgorithm prf_algorithm; - * BulkCipherAlgorithm bulk_cipher_algorithm; - * CipherType cipher_type; - * uint8 enc_key_length; - * uint8 block_length; - * uint8 fixed_iv_length; - * uint8 record_iv_length; - * MACAlgorithm mac_algorithm; - * uint8 mac_length; - * uint8 mac_key_length; - * CompressionMethod compression_algorithm; - * opaque master_secret[48]; - * opaque client_random[32]; - * opaque server_random[32]; - * } SecurityParameters; - * - * Note that this definition is from TLS 1.2. In TLS 1.0 some of these - * parameters are ignored because, for instance, the PRFAlgorithm is a - * builtin-fixed algorithm combining iterations of MD5 and SHA-1 in TLS 1.0. - * - * The Record Protocol requires an algorithm to generate keys required by the - * current connection state. - * - * The master secret is expanded into a sequence of secure bytes, which is then - * split to a client write MAC key, a server write MAC key, a client write - * encryption key, and a server write encryption key. In TLS 1.0 a client write - * IV and server write IV are also generated. Each of these is generated from - * the byte sequence in that order. Unused values are empty. In TLS 1.2, some - * AEAD ciphers may additionally require a client write IV and a server write - * IV (see Section 6.2.3.3). - * - * When keys, MAC keys, and IVs are generated, the master secret is used as an - * entropy source. - * - * To generate the key material, compute: - * - * master_secret = PRF(pre_master_secret, "master secret", - * ClientHello.random + ServerHello.random) - * - * key_block = PRF(SecurityParameters.master_secret, - * "key expansion", - * SecurityParameters.server_random + - * SecurityParameters.client_random); - * - * until enough output has been generated. Then, the key_block is - * partitioned as follows: - * - * client_write_MAC_key[SecurityParameters.mac_key_length] - * server_write_MAC_key[SecurityParameters.mac_key_length] - * client_write_key[SecurityParameters.enc_key_length] - * server_write_key[SecurityParameters.enc_key_length] - * client_write_IV[SecurityParameters.fixed_iv_length] - * server_write_IV[SecurityParameters.fixed_iv_length] - * - * In TLS 1.2, the client_write_IV and server_write_IV are only generated for - * implicit nonce techniques as described in Section 3.2.1 of [AEAD]. This - * implementation uses TLS 1.0 so IVs are generated. - * - * Implementation note: The currently defined cipher suite which requires the - * most material is AES_256_CBC_SHA256. It requires 2 x 32 byte keys and 2 x 32 - * byte MAC keys, for a total 128 bytes of key material. In TLS 1.0 it also - * requires 2 x 16 byte IVs, so it actually takes 160 bytes of key material. - * - * @param c the connection. - * @param sp the security parameters to use. - * - * @return the security keys. - */ -tls.generateKeys = function(c, sp) { - // TLS_RSA_WITH_AES_128_CBC_SHA (required to be compliant with TLS 1.2) & - // TLS_RSA_WITH_AES_256_CBC_SHA are the only cipher suites implemented - // at present - - // TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA is required to be compliant with - // TLS 1.0 but we don't care right now because AES is better and we have - // an implementation for it - - // TODO: TLS 1.2 implementation - /* - // determine the PRF - var prf; - switch(sp.prf_algorithm) { - case tls.PRFAlgorithm.tls_prf_sha256: - prf = prf_sha256; - break; - default: - // should never happen - throw new Error('Invalid PRF'); - } - */ - - // TLS 1.0/1.1 implementation - var prf = prf_TLS1; - - // concatenate server and client random - var random = sp.client_random + sp.server_random; - - // only create master secret if session is new - if(!c.session.resuming) { - // create master secret, clean up pre-master secret - sp.master_secret = prf( - sp.pre_master_secret, 'master secret', random, 48).bytes(); - sp.pre_master_secret = null; - } - - // generate the amount of key material needed - random = sp.server_random + sp.client_random; - var length = 2 * sp.mac_key_length + 2 * sp.enc_key_length; - - // include IV for TLS/1.0 - var tls10 = (c.version.major === tls.Versions.TLS_1_0.major && - c.version.minor === tls.Versions.TLS_1_0.minor); - if(tls10) { - length += 2 * sp.fixed_iv_length; - } - var km = prf(sp.master_secret, 'key expansion', random, length); - - // split the key material into the MAC and encryption keys - var rval = { - client_write_MAC_key: km.getBytes(sp.mac_key_length), - server_write_MAC_key: km.getBytes(sp.mac_key_length), - client_write_key: km.getBytes(sp.enc_key_length), - server_write_key: km.getBytes(sp.enc_key_length) - }; - - // include TLS 1.0 IVs - if(tls10) { - rval.client_write_IV = km.getBytes(sp.fixed_iv_length); - rval.server_write_IV = km.getBytes(sp.fixed_iv_length); - } - - return rval; -}; - -/** - * Creates a new initialized TLS connection state. A connection state has - * a read mode and a write mode. - * - * compression state: - * The current state of the compression algorithm. - * - * cipher state: - * The current state of the encryption algorithm. This will consist of the - * scheduled key for that connection. For stream ciphers, this will also - * contain whatever state information is necessary to allow the stream to - * continue to encrypt or decrypt data. - * - * MAC key: - * The MAC key for the connection. - * - * sequence number: - * Each connection state contains a sequence number, which is maintained - * separately for read and write states. The sequence number MUST be set to - * zero whenever a connection state is made the active state. Sequence - * numbers are of type uint64 and may not exceed 2^64-1. Sequence numbers do - * not wrap. If a TLS implementation would need to wrap a sequence number, - * it must renegotiate instead. A sequence number is incremented after each - * record: specifically, the first record transmitted under a particular - * connection state MUST use sequence number 0. - * - * @param c the connection. - * - * @return the new initialized TLS connection state. - */ -tls.createConnectionState = function(c) { - var client = (c.entity === tls.ConnectionEnd.client); - - var createMode = function() { - var mode = { - // two 32-bit numbers, first is most significant - sequenceNumber: [0, 0], - macKey: null, - macLength: 0, - macFunction: null, - cipherState: null, - cipherFunction: function(record) {return true;}, - compressionState: null, - compressFunction: function(record) {return true;}, - updateSequenceNumber: function() { - if(mode.sequenceNumber[1] === 0xFFFFFFFF) { - mode.sequenceNumber[1] = 0; - ++mode.sequenceNumber[0]; - } else { - ++mode.sequenceNumber[1]; - } - } - }; - return mode; - }; - var state = { - read: createMode(), - write: createMode() - }; - - // update function in read mode will decrypt then decompress a record - state.read.update = function(c, record) { - if(!state.read.cipherFunction(record, state.read)) { - c.error(c, { - message: 'Could not decrypt record or bad MAC.', - send: true, - alert: { - level: tls.Alert.Level.fatal, - // doesn't matter if decryption failed or MAC was - // invalid, return the same error so as not to reveal - // which one occurred - description: tls.Alert.Description.bad_record_mac - } - }); - } else if(!state.read.compressFunction(c, record, state.read)) { - c.error(c, { - message: 'Could not decompress record.', - send: true, - alert: { - level: tls.Alert.Level.fatal, - description: tls.Alert.Description.decompression_failure - } - }); - } - return !c.fail; - }; - - // update function in write mode will compress then encrypt a record - state.write.update = function(c, record) { - if(!state.write.compressFunction(c, record, state.write)) { - // error, but do not send alert since it would require - // compression as well - c.error(c, { - message: 'Could not compress record.', - send: false, - alert: { - level: tls.Alert.Level.fatal, - description: tls.Alert.Description.internal_error - } - }); - } else if(!state.write.cipherFunction(record, state.write)) { - // error, but do not send alert since it would require - // encryption as well - c.error(c, { - message: 'Could not encrypt record.', - send: false, - alert: { - level: tls.Alert.Level.fatal, - description: tls.Alert.Description.internal_error - } - }); - } - return !c.fail; - }; - - // handle security parameters - if(c.session) { - var sp = c.session.sp; - c.session.cipherSuite.initSecurityParameters(sp); - - // generate keys - sp.keys = tls.generateKeys(c, sp); - state.read.macKey = client ? - sp.keys.server_write_MAC_key : sp.keys.client_write_MAC_key; - state.write.macKey = client ? - sp.keys.client_write_MAC_key : sp.keys.server_write_MAC_key; - - // cipher suite setup - c.session.cipherSuite.initConnectionState(state, c, sp); - - // compression setup - switch(sp.compression_algorithm) { - case tls.CompressionMethod.none: - break; - case tls.CompressionMethod.deflate: - state.read.compressFunction = inflate; - state.write.compressFunction = deflate; - break; - default: - throw new Error('Unsupported compression algorithm.'); - } - } - - return state; -}; - -/** - * Creates a Random structure. - * - * struct { - * uint32 gmt_unix_time; - * opaque random_bytes[28]; - * } Random; - * - * gmt_unix_time: - * The current time and date in standard UNIX 32-bit format (seconds since - * the midnight starting Jan 1, 1970, UTC, ignoring leap seconds) according - * to the sender's internal clock. Clocks are not required to be set - * correctly by the basic TLS protocol; higher-level or application - * protocols may define additional requirements. Note that, for historical - * reasons, the data element is named using GMT, the predecessor of the - * current worldwide time base, UTC. - * random_bytes: - * 28 bytes generated by a secure random number generator. - * - * @return the Random structure as a byte array. - */ -tls.createRandom = function() { - // get UTC milliseconds - var d = new Date(); - var utc = +d + d.getTimezoneOffset() * 60000; - var rval = forge.util.createBuffer(); - rval.putInt32(utc); - rval.putBytes(forge.random.getBytes(28)); - return rval; -}; - -/** - * Creates a TLS record with the given type and data. - * - * @param c the connection. - * @param options: - * type: the record type. - * data: the plain text data in a byte buffer. - * - * @return the created record. - */ -tls.createRecord = function(c, options) { - if(!options.data) { - return null; - } - var record = { - type: options.type, - version: { - major: c.version.major, - minor: c.version.minor - }, - length: options.data.length(), - fragment: options.data - }; - return record; -}; - -/** - * Creates a TLS alert record. - * - * @param c the connection. - * @param alert: - * level: the TLS alert level. - * description: the TLS alert description. - * - * @return the created alert record. - */ -tls.createAlert = function(c, alert) { - var b = forge.util.createBuffer(); - b.putByte(alert.level); - b.putByte(alert.description); - return tls.createRecord(c, { - type: tls.ContentType.alert, - data: b - }); -}; - -/* The structure of a TLS handshake message. - * - * struct { - * HandshakeType msg_type; // handshake type - * uint24 length; // bytes in message - * select(HandshakeType) { - * case hello_request: HelloRequest; - * case client_hello: ClientHello; - * case server_hello: ServerHello; - * case certificate: Certificate; - * case server_key_exchange: ServerKeyExchange; - * case certificate_request: CertificateRequest; - * case server_hello_done: ServerHelloDone; - * case certificate_verify: CertificateVerify; - * case client_key_exchange: ClientKeyExchange; - * case finished: Finished; - * } body; - * } Handshake; - */ - -/** - * Creates a ClientHello message. - * - * opaque SessionID<0..32>; - * enum { null(0), deflate(1), (255) } CompressionMethod; - * uint8 CipherSuite[2]; - * - * struct { - * ProtocolVersion client_version; - * Random random; - * SessionID session_id; - * CipherSuite cipher_suites<2..2^16-2>; - * CompressionMethod compression_methods<1..2^8-1>; - * select(extensions_present) { - * case false: - * struct {}; - * case true: - * Extension extensions<0..2^16-1>; - * }; - * } ClientHello; - * - * The extension format for extended client hellos and server hellos is: - * - * struct { - * ExtensionType extension_type; - * opaque extension_data<0..2^16-1>; - * } Extension; - * - * Here: - * - * - "extension_type" identifies the particular extension type. - * - "extension_data" contains information specific to the particular - * extension type. - * - * The extension types defined in this document are: - * - * enum { - * server_name(0), max_fragment_length(1), - * client_certificate_url(2), trusted_ca_keys(3), - * truncated_hmac(4), status_request(5), (65535) - * } ExtensionType; - * - * @param c the connection. - * - * @return the ClientHello byte buffer. - */ -tls.createClientHello = function(c) { - // save hello version - c.session.clientHelloVersion = { - major: c.version.major, - minor: c.version.minor - }; - - // create supported cipher suites - var cipherSuites = forge.util.createBuffer(); - for(var i = 0; i < c.cipherSuites.length; ++i) { - var cs = c.cipherSuites[i]; - cipherSuites.putByte(cs.id[0]); - cipherSuites.putByte(cs.id[1]); - } - var cSuites = cipherSuites.length(); - - // create supported compression methods, null always supported, but - // also support deflate if connection has inflate and deflate methods - var compressionMethods = forge.util.createBuffer(); - compressionMethods.putByte(tls.CompressionMethod.none); - // FIXME: deflate support disabled until issues with raw deflate data - // without zlib headers are resolved - /* - if(c.inflate !== null && c.deflate !== null) { - compressionMethods.putByte(tls.CompressionMethod.deflate); - } - */ - var cMethods = compressionMethods.length(); - - // create TLS SNI (server name indication) extension if virtual host - // has been specified, see RFC 3546 - var extensions = forge.util.createBuffer(); - if(c.virtualHost) { - // create extension struct - var ext = forge.util.createBuffer(); - ext.putByte(0x00); // type server_name (ExtensionType is 2 bytes) - ext.putByte(0x00); - - /* In order to provide the server name, clients MAY include an - * extension of type "server_name" in the (extended) client hello. - * The "extension_data" field of this extension SHALL contain - * "ServerNameList" where: - * - * struct { - * NameType name_type; - * select(name_type) { - * case host_name: HostName; - * } name; - * } ServerName; - * - * enum { - * host_name(0), (255) - * } NameType; - * - * opaque HostName<1..2^16-1>; - * - * struct { - * ServerName server_name_list<1..2^16-1> - * } ServerNameList; - */ - var serverName = forge.util.createBuffer(); - serverName.putByte(0x00); // type host_name - writeVector(serverName, 2, forge.util.createBuffer(c.virtualHost)); - - // ServerNameList is in extension_data - var snList = forge.util.createBuffer(); - writeVector(snList, 2, serverName); - writeVector(ext, 2, snList); - extensions.putBuffer(ext); - } - var extLength = extensions.length(); - if(extLength > 0) { - // add extension vector length - extLength += 2; - } - - // determine length of the handshake message - // cipher suites and compression methods size will need to be - // updated if more get added to the list - var sessionId = c.session.id; - var length = - sessionId.length + 1 + // session ID vector - 2 + // version (major + minor) - 4 + 28 + // random time and random bytes - 2 + cSuites + // cipher suites vector - 1 + cMethods + // compression methods vector - extLength; // extensions vector - - // build record fragment - var rval = forge.util.createBuffer(); - rval.putByte(tls.HandshakeType.client_hello); - rval.putInt24(length); // handshake length - rval.putByte(c.version.major); // major version - rval.putByte(c.version.minor); // minor version - rval.putBytes(c.session.sp.client_random); // random time + bytes - writeVector(rval, 1, forge.util.createBuffer(sessionId)); - writeVector(rval, 2, cipherSuites); - writeVector(rval, 1, compressionMethods); - if(extLength > 0) { - writeVector(rval, 2, extensions); - } - return rval; -}; - -/** - * Creates a ServerHello message. - * - * @param c the connection. - * - * @return the ServerHello byte buffer. - */ -tls.createServerHello = function(c) { - // determine length of the handshake message - var sessionId = c.session.id; - var length = - sessionId.length + 1 + // session ID vector - 2 + // version (major + minor) - 4 + 28 + // random time and random bytes - 2 + // chosen cipher suite - 1; // chosen compression method - - // build record fragment - var rval = forge.util.createBuffer(); - rval.putByte(tls.HandshakeType.server_hello); - rval.putInt24(length); // handshake length - rval.putByte(c.version.major); // major version - rval.putByte(c.version.minor); // minor version - rval.putBytes(c.session.sp.server_random); // random time + bytes - writeVector(rval, 1, forge.util.createBuffer(sessionId)); - rval.putByte(c.session.cipherSuite.id[0]); - rval.putByte(c.session.cipherSuite.id[1]); - rval.putByte(c.session.compressionMethod); - return rval; -}; - -/** - * Creates a Certificate message. - * - * When this message will be sent: - * This is the first message the client can send after receiving a server - * hello done message and the first message the server can send after - * sending a ServerHello. This client message is only sent if the server - * requests a certificate. If no suitable certificate is available, the - * client should send a certificate message containing no certificates. If - * client authentication is required by the server for the handshake to - * continue, it may respond with a fatal handshake failure alert. - * - * opaque ASN.1Cert<1..2^24-1>; - * - * struct { - * ASN.1Cert certificate_list<0..2^24-1>; - * } Certificate; - * - * @param c the connection. - * - * @return the Certificate byte buffer. - */ -tls.createCertificate = function(c) { - // TODO: check certificate request to ensure types are supported - - // get a certificate (a certificate as a PEM string) - var client = (c.entity === tls.ConnectionEnd.client); - var cert = null; - if(c.getCertificate) { - var hint; - if(client) { - hint = c.session.certificateRequest; - } else { - hint = c.session.extensions.server_name.serverNameList; - } - cert = c.getCertificate(c, hint); - } - - // buffer to hold certificate list - var certList = forge.util.createBuffer(); - if(cert !== null) { - try { - // normalize cert to a chain of certificates - if(!forge.util.isArray(cert)) { - cert = [cert]; - } - var asn1 = null; - for(var i = 0; i < cert.length; ++i) { - var msg = forge.pem.decode(cert[i])[0]; - if(msg.type !== 'CERTIFICATE' && - msg.type !== 'X509 CERTIFICATE' && - msg.type !== 'TRUSTED CERTIFICATE') { - var error = new Error('Could not convert certificate from PEM; PEM ' + - 'header type is not "CERTIFICATE", "X509 CERTIFICATE", or ' + - '"TRUSTED CERTIFICATE".'); - error.headerType = msg.type; - throw error; - } - if(msg.procType && msg.procType.type === 'ENCRYPTED') { - throw new Error('Could not convert certificate from PEM; PEM is encrypted.'); - } - - var der = forge.util.createBuffer(msg.body); - if(asn1 === null) { - asn1 = forge.asn1.fromDer(der.bytes(), false); - } - - // certificate entry is itself a vector with 3 length bytes - var certBuffer = forge.util.createBuffer(); - writeVector(certBuffer, 3, der); - - // add cert vector to cert list vector - certList.putBuffer(certBuffer); - } - - // save certificate - cert = forge.pki.certificateFromAsn1(asn1); - if(client) { - c.session.clientCertificate = cert; - } else { - c.session.serverCertificate = cert; - } - } catch(ex) { - return c.error(c, { - message: 'Could not send certificate list.', - cause: ex, - send: true, - alert: { - level: tls.Alert.Level.fatal, - description: tls.Alert.Description.bad_certificate - } - }); - } - } - - // determine length of the handshake message - var length = 3 + certList.length(); // cert list vector - - // build record fragment - var rval = forge.util.createBuffer(); - rval.putByte(tls.HandshakeType.certificate); - rval.putInt24(length); - writeVector(rval, 3, certList); - return rval; -}; - -/** - * Creates a ClientKeyExchange message. - * - * When this message will be sent: - * This message is always sent by the client. It will immediately follow the - * client certificate message, if it is sent. Otherwise it will be the first - * message sent by the client after it receives the server hello done - * message. - * - * Meaning of this message: - * With this message, the premaster secret is set, either though direct - * transmission of the RSA-encrypted secret, or by the transmission of - * Diffie-Hellman parameters which will allow each side to agree upon the - * same premaster secret. When the key exchange method is DH_RSA or DH_DSS, - * client certification has been requested, and the client was able to - * respond with a certificate which contained a Diffie-Hellman public key - * whose parameters (group and generator) matched those specified by the - * server in its certificate, this message will not contain any data. - * - * Meaning of this message: - * If RSA is being used for key agreement and authentication, the client - * generates a 48-byte premaster secret, encrypts it using the public key - * from the server's certificate or the temporary RSA key provided in a - * server key exchange message, and sends the result in an encrypted - * premaster secret message. This structure is a variant of the client - * key exchange message, not a message in itself. - * - * struct { - * select(KeyExchangeAlgorithm) { - * case rsa: EncryptedPreMasterSecret; - * case diffie_hellman: ClientDiffieHellmanPublic; - * } exchange_keys; - * } ClientKeyExchange; - * - * struct { - * ProtocolVersion client_version; - * opaque random[46]; - * } PreMasterSecret; - * - * struct { - * public-key-encrypted PreMasterSecret pre_master_secret; - * } EncryptedPreMasterSecret; - * - * A public-key-encrypted element is encoded as a vector <0..2^16-1>. - * - * @param c the connection. - * - * @return the ClientKeyExchange byte buffer. - */ -tls.createClientKeyExchange = function(c) { - // create buffer to encrypt - var b = forge.util.createBuffer(); - - // add highest client-supported protocol to help server avoid version - // rollback attacks - b.putByte(c.session.clientHelloVersion.major); - b.putByte(c.session.clientHelloVersion.minor); - - // generate and add 46 random bytes - b.putBytes(forge.random.getBytes(46)); - - // save pre-master secret - var sp = c.session.sp; - sp.pre_master_secret = b.getBytes(); - - // RSA-encrypt the pre-master secret - var key = c.session.serverCertificate.publicKey; - b = key.encrypt(sp.pre_master_secret); - - /* Note: The encrypted pre-master secret will be stored in a - public-key-encrypted opaque vector that has the length prefixed using - 2 bytes, so include those 2 bytes in the handshake message length. This - is done as a minor optimization instead of calling writeVector(). */ - - // determine length of the handshake message - var length = b.length + 2; - - // build record fragment - var rval = forge.util.createBuffer(); - rval.putByte(tls.HandshakeType.client_key_exchange); - rval.putInt24(length); - // add vector length bytes - rval.putInt16(b.length); - rval.putBytes(b); - return rval; -}; - -/** - * Creates a ServerKeyExchange message. - * - * @param c the connection. - * - * @return the ServerKeyExchange byte buffer. - */ -tls.createServerKeyExchange = function(c) { - // this implementation only supports RSA, no Diffie-Hellman support, - // so this record is empty - - // determine length of the handshake message - var length = 0; - - // build record fragment - var rval = forge.util.createBuffer(); - if(length > 0) { - rval.putByte(tls.HandshakeType.server_key_exchange); - rval.putInt24(length); - } - return rval; -}; - -/** - * Gets the signed data used to verify a client-side certificate. See - * tls.createCertificateVerify() for details. - * - * @param c the connection. - * @param callback the callback to call once the signed data is ready. - */ -tls.getClientSignature = function(c, callback) { - // generate data to RSA encrypt - var b = forge.util.createBuffer(); - b.putBuffer(c.session.md5.digest()); - b.putBuffer(c.session.sha1.digest()); - b = b.getBytes(); - - // create default signing function as necessary - c.getSignature = c.getSignature || function(c, b, callback) { - // do rsa encryption, call callback - var privateKey = null; - if(c.getPrivateKey) { - try { - privateKey = c.getPrivateKey(c, c.session.clientCertificate); - privateKey = forge.pki.privateKeyFromPem(privateKey); - } catch(ex) { - c.error(c, { - message: 'Could not get private key.', - cause: ex, - send: true, - alert: { - level: tls.Alert.Level.fatal, - description: tls.Alert.Description.internal_error - } - }); - } - } - if(privateKey === null) { - c.error(c, { - message: 'No private key set.', - send: true, - alert: { - level: tls.Alert.Level.fatal, - description: tls.Alert.Description.internal_error - } - }); - } else { - b = privateKey.sign(b, null); - } - callback(c, b); - }; - - // get client signature - c.getSignature(c, b, callback); -}; - -/** - * Creates a CertificateVerify message. - * - * Meaning of this message: - * This structure conveys the client's Diffie-Hellman public value - * (Yc) if it was not already included in the client's certificate. - * The encoding used for Yc is determined by the enumerated - * PublicValueEncoding. This structure is a variant of the client - * key exchange message, not a message in itself. - * - * When this message will be sent: - * This message is used to provide explicit verification of a client - * certificate. This message is only sent following a client - * certificate that has signing capability (i.e. all certificates - * except those containing fixed Diffie-Hellman parameters). When - * sent, it will immediately follow the client key exchange message. - * - * struct { - * Signature signature; - * } CertificateVerify; - * - * CertificateVerify.signature.md5_hash - * MD5(handshake_messages); - * - * Certificate.signature.sha_hash - * SHA(handshake_messages); - * - * Here handshake_messages refers to all handshake messages sent or - * received starting at client hello up to but not including this - * message, including the type and length fields of the handshake - * messages. - * - * select(SignatureAlgorithm) { - * case anonymous: struct { }; - * case rsa: - * digitally-signed struct { - * opaque md5_hash[16]; - * opaque sha_hash[20]; - * }; - * case dsa: - * digitally-signed struct { - * opaque sha_hash[20]; - * }; - * } Signature; - * - * In digital signing, one-way hash functions are used as input for a - * signing algorithm. A digitally-signed element is encoded as an opaque - * vector <0..2^16-1>, where the length is specified by the signing - * algorithm and key. - * - * In RSA signing, a 36-byte structure of two hashes (one SHA and one - * MD5) is signed (encrypted with the private key). It is encoded with - * PKCS #1 block type 0 or type 1 as described in [PKCS1]. - * - * In DSS, the 20 bytes of the SHA hash are run directly through the - * Digital Signing Algorithm with no additional hashing. - * - * @param c the connection. - * @param signature the signature to include in the message. - * - * @return the CertificateVerify byte buffer. - */ -tls.createCertificateVerify = function(c, signature) { - /* Note: The signature will be stored in a "digitally-signed" opaque - vector that has the length prefixed using 2 bytes, so include those - 2 bytes in the handshake message length. This is done as a minor - optimization instead of calling writeVector(). */ - - // determine length of the handshake message - var length = signature.length + 2; - - // build record fragment - var rval = forge.util.createBuffer(); - rval.putByte(tls.HandshakeType.certificate_verify); - rval.putInt24(length); - // add vector length bytes - rval.putInt16(signature.length); - rval.putBytes(signature); - return rval; -}; - -/** - * Creates a CertificateRequest message. - * - * @param c the connection. - * - * @return the CertificateRequest byte buffer. - */ -tls.createCertificateRequest = function(c) { - // TODO: support other certificate types - var certTypes = forge.util.createBuffer(); - - // common RSA certificate type - certTypes.putByte(0x01); - - // add distinguished names from CA store - var cAs = forge.util.createBuffer(); - for(var key in c.caStore.certs) { - var cert = c.caStore.certs[key]; - var dn = forge.pki.distinguishedNameToAsn1(cert.subject); - var byteBuffer = forge.asn1.toDer(dn); - cAs.putInt16(byteBuffer.length()); - cAs.putBuffer(byteBuffer); - } - - // TODO: TLS 1.2+ has a different format - - // determine length of the handshake message - var length = - 1 + certTypes.length() + - 2 + cAs.length(); - - // build record fragment - var rval = forge.util.createBuffer(); - rval.putByte(tls.HandshakeType.certificate_request); - rval.putInt24(length); - writeVector(rval, 1, certTypes); - writeVector(rval, 2, cAs); - return rval; -}; - -/** - * Creates a ServerHelloDone message. - * - * @param c the connection. - * - * @return the ServerHelloDone byte buffer. - */ -tls.createServerHelloDone = function(c) { - // build record fragment - var rval = forge.util.createBuffer(); - rval.putByte(tls.HandshakeType.server_hello_done); - rval.putInt24(0); - return rval; -}; - -/** - * Creates a ChangeCipherSpec message. - * - * The change cipher spec protocol exists to signal transitions in - * ciphering strategies. The protocol consists of a single message, - * which is encrypted and compressed under the current (not the pending) - * connection state. The message consists of a single byte of value 1. - * - * struct { - * enum { change_cipher_spec(1), (255) } type; - * } ChangeCipherSpec; - * - * @return the ChangeCipherSpec byte buffer. - */ -tls.createChangeCipherSpec = function() { - var rval = forge.util.createBuffer(); - rval.putByte(0x01); - return rval; -}; - -/** - * Creates a Finished message. - * - * struct { - * opaque verify_data[12]; - * } Finished; - * - * verify_data - * PRF(master_secret, finished_label, MD5(handshake_messages) + - * SHA-1(handshake_messages)) [0..11]; - * - * finished_label - * For Finished messages sent by the client, the string "client - * finished". For Finished messages sent by the server, the - * string "server finished". - * - * handshake_messages - * All of the data from all handshake messages up to but not - * including this message. This is only data visible at the - * handshake layer and does not include record layer headers. - * This is the concatenation of all the Handshake structures as - * defined in 7.4 exchanged thus far. - * - * @param c the connection. - * - * @return the Finished byte buffer. - */ -tls.createFinished = function(c) { - // generate verify_data - var b = forge.util.createBuffer(); - b.putBuffer(c.session.md5.digest()); - b.putBuffer(c.session.sha1.digest()); - - // TODO: determine prf function and verify length for TLS 1.2 - var client = (c.entity === tls.ConnectionEnd.client); - var sp = c.session.sp; - var vdl = 12; - var prf = prf_TLS1; - var label = client ? 'client finished' : 'server finished'; - b = prf(sp.master_secret, label, b.getBytes(), vdl); - - // build record fragment - var rval = forge.util.createBuffer(); - rval.putByte(tls.HandshakeType.finished); - rval.putInt24(b.length()); - rval.putBuffer(b); - return rval; -}; - -/** - * Creates a HeartbeatMessage (See RFC 6520). - * - * struct { - * HeartbeatMessageType type; - * uint16 payload_length; - * opaque payload[HeartbeatMessage.payload_length]; - * opaque padding[padding_length]; - * } HeartbeatMessage; - * - * The total length of a HeartbeatMessage MUST NOT exceed 2^14 or - * max_fragment_length when negotiated as defined in [RFC6066]. - * - * type: The message type, either heartbeat_request or heartbeat_response. - * - * payload_length: The length of the payload. - * - * payload: The payload consists of arbitrary content. - * - * padding: The padding is random content that MUST be ignored by the - * receiver. The length of a HeartbeatMessage is TLSPlaintext.length - * for TLS and DTLSPlaintext.length for DTLS. Furthermore, the - * length of the type field is 1 byte, and the length of the - * payload_length is 2. Therefore, the padding_length is - * TLSPlaintext.length - payload_length - 3 for TLS and - * DTLSPlaintext.length - payload_length - 3 for DTLS. The - * padding_length MUST be at least 16. - * - * The sender of a HeartbeatMessage MUST use a random padding of at - * least 16 bytes. The padding of a received HeartbeatMessage message - * MUST be ignored. - * - * If the payload_length of a received HeartbeatMessage is too large, - * the received HeartbeatMessage MUST be discarded silently. - * - * @param c the connection. - * @param type the tls.HeartbeatMessageType. - * @param payload the heartbeat data to send as the payload. - * @param [payloadLength] the payload length to use, defaults to the - * actual payload length. - * - * @return the HeartbeatRequest byte buffer. - */ -tls.createHeartbeat = function(type, payload, payloadLength) { - if(typeof payloadLength === 'undefined') { - payloadLength = payload.length; - } - // build record fragment - var rval = forge.util.createBuffer(); - rval.putByte(type); // heartbeat message type - rval.putInt16(payloadLength); // payload length - rval.putBytes(payload); // payload - // padding - var plaintextLength = rval.length(); - var paddingLength = Math.max(16, plaintextLength - payloadLength - 3); - rval.putBytes(forge.random.getBytes(paddingLength)); - return rval; -}; - -/** - * Fragments, compresses, encrypts, and queues a record for delivery. - * - * @param c the connection. - * @param record the record to queue. - */ -tls.queue = function(c, record) { - // error during record creation - if(!record) { - return; - } - - if(record.fragment.length() === 0) { - if(record.type === tls.ContentType.handshake || - record.type === tls.ContentType.alert || - record.type === tls.ContentType.change_cipher_spec) { - // Empty handshake, alert of change cipher spec messages are not allowed per the TLS specification and should not be sent. - return; - } - } - - // if the record is a handshake record, update handshake hashes - if(record.type === tls.ContentType.handshake) { - var bytes = record.fragment.bytes(); - c.session.md5.update(bytes); - c.session.sha1.update(bytes); - bytes = null; - } - - // handle record fragmentation - var records; - if(record.fragment.length() <= tls.MaxFragment) { - records = [record]; - } else { - // fragment data as long as it is too long - records = []; - var data = record.fragment.bytes(); - while(data.length > tls.MaxFragment) { - records.push(tls.createRecord(c, { - type: record.type, - data: forge.util.createBuffer(data.slice(0, tls.MaxFragment)) - })); - data = data.slice(tls.MaxFragment); - } - // add last record - if(data.length > 0) { - records.push(tls.createRecord(c, { - type: record.type, - data: forge.util.createBuffer(data) - })); - } - } - - // compress and encrypt all fragmented records - for(var i = 0; i < records.length && !c.fail; ++i) { - // update the record using current write state - var rec = records[i]; - var s = c.state.current.write; - if(s.update(c, rec)) { - // store record - c.records.push(rec); - } - } -}; - -/** - * Flushes all queued records to the output buffer and calls the - * tlsDataReady() handler on the given connection. - * - * @param c the connection. - * - * @return true on success, false on failure. - */ -tls.flush = function(c) { - for(var i = 0; i < c.records.length; ++i) { - var record = c.records[i]; - - // add record header and fragment - c.tlsData.putByte(record.type); - c.tlsData.putByte(record.version.major); - c.tlsData.putByte(record.version.minor); - c.tlsData.putInt16(record.fragment.length()); - c.tlsData.putBuffer(c.records[i].fragment); - } - c.records = []; - return c.tlsDataReady(c); -}; - -/** - * Maps a pki.certificateError to a tls.Alert.Description. - * - * @param error the error to map. - * - * @return the alert description. - */ -var _certErrorToAlertDesc = function(error) { - switch(error) { - case true: - return true; - case forge.pki.certificateError.bad_certificate: - return tls.Alert.Description.bad_certificate; - case forge.pki.certificateError.unsupported_certificate: - return tls.Alert.Description.unsupported_certificate; - case forge.pki.certificateError.certificate_revoked: - return tls.Alert.Description.certificate_revoked; - case forge.pki.certificateError.certificate_expired: - return tls.Alert.Description.certificate_expired; - case forge.pki.certificateError.certificate_unknown: - return tls.Alert.Description.certificate_unknown; - case forge.pki.certificateError.unknown_ca: - return tls.Alert.Description.unknown_ca; - default: - return tls.Alert.Description.bad_certificate; - } -}; - -/** - * Maps a tls.Alert.Description to a pki.certificateError. - * - * @param desc the alert description. - * - * @return the certificate error. - */ -var _alertDescToCertError = function(desc) { - switch(desc) { - case true: - return true; - case tls.Alert.Description.bad_certificate: - return forge.pki.certificateError.bad_certificate; - case tls.Alert.Description.unsupported_certificate: - return forge.pki.certificateError.unsupported_certificate; - case tls.Alert.Description.certificate_revoked: - return forge.pki.certificateError.certificate_revoked; - case tls.Alert.Description.certificate_expired: - return forge.pki.certificateError.certificate_expired; - case tls.Alert.Description.certificate_unknown: - return forge.pki.certificateError.certificate_unknown; - case tls.Alert.Description.unknown_ca: - return forge.pki.certificateError.unknown_ca; - default: - return forge.pki.certificateError.bad_certificate; - } -}; - -/** - * Verifies a certificate chain against the given connection's - * Certificate Authority store. - * - * @param c the TLS connection. - * @param chain the certificate chain to verify, with the root or highest - * authority at the end. - * - * @return true if successful, false if not. - */ -tls.verifyCertificateChain = function(c, chain) { - try { - // Make a copy of c.verifyOptions so that we can modify options.verify - // without modifying c.verifyOptions. - var options = {}; - for (var key in c.verifyOptions) { - options[key] = c.verifyOptions[key]; - } - - options.verify = function(vfd, depth, chain) { - // convert pki.certificateError to tls alert description - var desc = _certErrorToAlertDesc(vfd); - - // call application callback - var ret = c.verify(c, vfd, depth, chain); - if(ret !== true) { - if(typeof ret === 'object' && !forge.util.isArray(ret)) { - // throw custom error - var error = new Error('The application rejected the certificate.'); - error.send = true; - error.alert = { - level: tls.Alert.Level.fatal, - description: tls.Alert.Description.bad_certificate - }; - if(ret.message) { - error.message = ret.message; - } - if(ret.alert) { - error.alert.description = ret.alert; - } - throw error; - } - - // convert tls alert description to pki.certificateError - if(ret !== vfd) { - ret = _alertDescToCertError(ret); - } - } - - return ret; - }; - - // verify chain - forge.pki.verifyCertificateChain(c.caStore, chain, options); - } catch(ex) { - // build tls error if not already customized - var err = ex; - if(typeof err !== 'object' || forge.util.isArray(err)) { - err = { - send: true, - alert: { - level: tls.Alert.Level.fatal, - description: _certErrorToAlertDesc(ex) - } - }; - } - if(!('send' in err)) { - err.send = true; - } - if(!('alert' in err)) { - err.alert = { - level: tls.Alert.Level.fatal, - description: _certErrorToAlertDesc(err.error) - }; - } - - // send error - c.error(c, err); - } - - return !c.fail; -}; - -/** - * Creates a new TLS session cache. - * - * @param cache optional map of session ID to cached session. - * @param capacity the maximum size for the cache (default: 100). - * - * @return the new TLS session cache. - */ -tls.createSessionCache = function(cache, capacity) { - var rval = null; - - // assume input is already a session cache object - if(cache && cache.getSession && cache.setSession && cache.order) { - rval = cache; - } else { - // create cache - rval = {}; - rval.cache = cache || {}; - rval.capacity = Math.max(capacity || 100, 1); - rval.order = []; - - // store order for sessions, delete session overflow - for(var key in cache) { - if(rval.order.length <= capacity) { - rval.order.push(key); - } else { - delete cache[key]; - } - } - - // get a session from a session ID (or get any session) - rval.getSession = function(sessionId) { - var session = null; - var key = null; - - // if session ID provided, use it - if(sessionId) { - key = forge.util.bytesToHex(sessionId); - } else if(rval.order.length > 0) { - // get first session from cache - key = rval.order[0]; - } - - if(key !== null && key in rval.cache) { - // get cached session and remove from cache - session = rval.cache[key]; - delete rval.cache[key]; - for(var i in rval.order) { - if(rval.order[i] === key) { - rval.order.splice(i, 1); - break; - } - } - } - - return session; - }; - - // set a session in the cache - rval.setSession = function(sessionId, session) { - // remove session from cache if at capacity - if(rval.order.length === rval.capacity) { - var key = rval.order.shift(); - delete rval.cache[key]; - } - // add session to cache - var key = forge.util.bytesToHex(sessionId); - rval.order.push(key); - rval.cache[key] = session; - }; - } - - return rval; -}; - -/** - * Creates a new TLS connection. - * - * See public createConnection() docs for more details. - * - * @param options the options for this connection. - * - * @return the new TLS connection. - */ -tls.createConnection = function(options) { - var caStore = null; - if(options.caStore) { - // if CA store is an array, convert it to a CA store object - if(forge.util.isArray(options.caStore)) { - caStore = forge.pki.createCaStore(options.caStore); - } else { - caStore = options.caStore; - } - } else { - // create empty CA store - caStore = forge.pki.createCaStore(); - } - - // setup default cipher suites - var cipherSuites = options.cipherSuites || null; - if(cipherSuites === null) { - cipherSuites = []; - for(var key in tls.CipherSuites) { - cipherSuites.push(tls.CipherSuites[key]); - } - } - - // set default entity - var entity = (options.server || false) ? - tls.ConnectionEnd.server : tls.ConnectionEnd.client; - - // create session cache if requested - var sessionCache = options.sessionCache ? - tls.createSessionCache(options.sessionCache) : null; - - // create TLS connection - var c = { - version: {major: tls.Version.major, minor: tls.Version.minor}, - entity: entity, - sessionId: options.sessionId, - caStore: caStore, - sessionCache: sessionCache, - cipherSuites: cipherSuites, - connected: options.connected, - virtualHost: options.virtualHost || null, - verifyClient: options.verifyClient || false, - verify: options.verify || function(cn, vfd, dpth, cts) {return vfd;}, - verifyOptions: options.verifyOptions || {}, - getCertificate: options.getCertificate || null, - getPrivateKey: options.getPrivateKey || null, - getSignature: options.getSignature || null, - input: forge.util.createBuffer(), - tlsData: forge.util.createBuffer(), - data: forge.util.createBuffer(), - tlsDataReady: options.tlsDataReady, - dataReady: options.dataReady, - heartbeatReceived: options.heartbeatReceived, - closed: options.closed, - error: function(c, ex) { - // set origin if not set - ex.origin = ex.origin || - ((c.entity === tls.ConnectionEnd.client) ? 'client' : 'server'); - - // send TLS alert - if(ex.send) { - tls.queue(c, tls.createAlert(c, ex.alert)); - tls.flush(c); - } - - // error is fatal by default - var fatal = (ex.fatal !== false); - if(fatal) { - // set fail flag - c.fail = true; - } - - // call error handler first - options.error(c, ex); - - if(fatal) { - // fatal error, close connection, do not clear fail - c.close(false); - } - }, - deflate: options.deflate || null, - inflate: options.inflate || null - }; - - /** - * Resets a closed TLS connection for reuse. Called in c.close(). - * - * @param clearFail true to clear the fail flag (default: true). - */ - c.reset = function(clearFail) { - c.version = {major: tls.Version.major, minor: tls.Version.minor}; - c.record = null; - c.session = null; - c.peerCertificate = null; - c.state = { - pending: null, - current: null - }; - c.expect = (c.entity === tls.ConnectionEnd.client) ? SHE : CHE; - c.fragmented = null; - c.records = []; - c.open = false; - c.handshakes = 0; - c.handshaking = false; - c.isConnected = false; - c.fail = !(clearFail || typeof(clearFail) === 'undefined'); - c.input.clear(); - c.tlsData.clear(); - c.data.clear(); - c.state.current = tls.createConnectionState(c); - }; - - // do initial reset of connection - c.reset(); - - /** - * Updates the current TLS engine state based on the given record. - * - * @param c the TLS connection. - * @param record the TLS record to act on. - */ - var _update = function(c, record) { - // get record handler (align type in table by subtracting lowest) - var aligned = record.type - tls.ContentType.change_cipher_spec; - var handlers = ctTable[c.entity][c.expect]; - if(aligned in handlers) { - handlers[aligned](c, record); - } else { - // unexpected record - tls.handleUnexpected(c, record); - } - }; - - /** - * Reads the record header and initializes the next record on the given - * connection. - * - * @param c the TLS connection with the next record. - * - * @return 0 if the input data could be processed, otherwise the - * number of bytes required for data to be processed. - */ - var _readRecordHeader = function(c) { - var rval = 0; - - // get input buffer and its length - var b = c.input; - var len = b.length(); - - // need at least 5 bytes to initialize a record - if(len < 5) { - rval = 5 - len; - } else { - // enough bytes for header - // initialize record - c.record = { - type: b.getByte(), - version: { - major: b.getByte(), - minor: b.getByte() - }, - length: b.getInt16(), - fragment: forge.util.createBuffer(), - ready: false - }; - - // check record version - var compatibleVersion = (c.record.version.major === c.version.major); - if(compatibleVersion && c.session && c.session.version) { - // session version already set, require same minor version - compatibleVersion = (c.record.version.minor === c.version.minor); - } - if(!compatibleVersion) { - c.error(c, { - message: 'Incompatible TLS version.', - send: true, - alert: { - level: tls.Alert.Level.fatal, - description: tls.Alert.Description.protocol_version - } - }); - } - } - - return rval; - }; - - /** - * Reads the next record's contents and appends its message to any - * previously fragmented message. - * - * @param c the TLS connection with the next record. - * - * @return 0 if the input data could be processed, otherwise the - * number of bytes required for data to be processed. - */ - var _readRecord = function(c) { - var rval = 0; - - // ensure there is enough input data to get the entire record - var b = c.input; - var len = b.length(); - if(len < c.record.length) { - // not enough data yet, return how much is required - rval = c.record.length - len; - } else { - // there is enough data to parse the pending record - // fill record fragment and compact input buffer - c.record.fragment.putBytes(b.getBytes(c.record.length)); - b.compact(); - - // update record using current read state - var s = c.state.current.read; - if(s.update(c, c.record)) { - // see if there is a previously fragmented message that the - // new record's message fragment should be appended to - if(c.fragmented !== null) { - // if the record type matches a previously fragmented - // record, append the record fragment to it - if(c.fragmented.type === c.record.type) { - // concatenate record fragments - c.fragmented.fragment.putBuffer(c.record.fragment); - c.record = c.fragmented; - } else { - // error, invalid fragmented record - c.error(c, { - message: 'Invalid fragmented record.', - send: true, - alert: { - level: tls.Alert.Level.fatal, - description: - tls.Alert.Description.unexpected_message - } - }); - } - } - - // record is now ready - c.record.ready = true; - } - } - - return rval; - }; - - /** - * Performs a handshake using the TLS Handshake Protocol, as a client. - * - * This method should only be called if the connection is in client mode. - * - * @param sessionId the session ID to use, null to start a new one. - */ - c.handshake = function(sessionId) { - // error to call this in non-client mode - if(c.entity !== tls.ConnectionEnd.client) { - // not fatal error - c.error(c, { - message: 'Cannot initiate handshake as a server.', - fatal: false - }); - } else if(c.handshaking) { - // handshake is already in progress, fail but not fatal error - c.error(c, { - message: 'Handshake already in progress.', - fatal: false - }); - } else { - // clear fail flag on reuse - if(c.fail && !c.open && c.handshakes === 0) { - c.fail = false; - } - - // now handshaking - c.handshaking = true; - - // default to blank (new session) - sessionId = sessionId || ''; - - // if a session ID was specified, try to find it in the cache - var session = null; - if(sessionId.length > 0) { - if(c.sessionCache) { - session = c.sessionCache.getSession(sessionId); - } - - // matching session not found in cache, clear session ID - if(session === null) { - sessionId = ''; - } - } - - // no session given, grab a session from the cache, if available - if(sessionId.length === 0 && c.sessionCache) { - session = c.sessionCache.getSession(); - if(session !== null) { - sessionId = session.id; - } - } - - // set up session - c.session = { - id: sessionId, - version: null, - cipherSuite: null, - compressionMethod: null, - serverCertificate: null, - certificateRequest: null, - clientCertificate: null, - sp: {}, - md5: forge.md.md5.create(), - sha1: forge.md.sha1.create() - }; - - // use existing session information - if(session) { - // only update version on connection, session version not yet set - c.version = session.version; - c.session.sp = session.sp; - } - - // generate new client random - c.session.sp.client_random = tls.createRandom().getBytes(); - - // connection now open - c.open = true; - - // send hello - tls.queue(c, tls.createRecord(c, { - type: tls.ContentType.handshake, - data: tls.createClientHello(c) - })); - tls.flush(c); - } - }; - - /** - * Called when TLS protocol data has been received from somewhere and should - * be processed by the TLS engine. - * - * @param data the TLS protocol data, as a string, to process. - * - * @return 0 if the data could be processed, otherwise the number of bytes - * required for data to be processed. - */ - c.process = function(data) { - var rval = 0; - - // buffer input data - if(data) { - c.input.putBytes(data); - } - - // process next record if no failure, process will be called after - // each record is handled (since handling can be asynchronous) - if(!c.fail) { - // reset record if ready and now empty - if(c.record !== null && - c.record.ready && c.record.fragment.isEmpty()) { - c.record = null; - } - - // if there is no pending record, try to read record header - if(c.record === null) { - rval = _readRecordHeader(c); - } - - // read the next record (if record not yet ready) - if(!c.fail && c.record !== null && !c.record.ready) { - rval = _readRecord(c); - } - - // record ready to be handled, update engine state - if(!c.fail && c.record !== null && c.record.ready) { - _update(c, c.record); - } - } - - return rval; - }; - - /** - * Requests that application data be packaged into a TLS record. The - * tlsDataReady handler will be called when the TLS record(s) have been - * prepared. - * - * @param data the application data, as a raw 'binary' encoded string, to - * be sent; to send utf-16/utf-8 string data, use the return value - * of util.encodeUtf8(str). - * - * @return true on success, false on failure. - */ - c.prepare = function(data) { - tls.queue(c, tls.createRecord(c, { - type: tls.ContentType.application_data, - data: forge.util.createBuffer(data) - })); - return tls.flush(c); - }; - - /** - * Requests that a heartbeat request be packaged into a TLS record for - * transmission. The tlsDataReady handler will be called when TLS record(s) - * have been prepared. - * - * When a heartbeat response has been received, the heartbeatReceived - * handler will be called with the matching payload. This handler can - * be used to clear a retransmission timer, etc. - * - * @param payload the heartbeat data to send as the payload in the message. - * @param [payloadLength] the payload length to use, defaults to the - * actual payload length. - * - * @return true on success, false on failure. - */ - c.prepareHeartbeatRequest = function(payload, payloadLength) { - if(payload instanceof forge.util.ByteBuffer) { - payload = payload.bytes(); - } - if(typeof payloadLength === 'undefined') { - payloadLength = payload.length; - } - c.expectedHeartbeatPayload = payload; - tls.queue(c, tls.createRecord(c, { - type: tls.ContentType.heartbeat, - data: tls.createHeartbeat( - tls.HeartbeatMessageType.heartbeat_request, payload, payloadLength) - })); - return tls.flush(c); - }; - - /** - * Closes the connection (sends a close_notify alert). - * - * @param clearFail true to clear the fail flag (default: true). - */ - c.close = function(clearFail) { - // save session if connection didn't fail - if(!c.fail && c.sessionCache && c.session) { - // only need to preserve session ID, version, and security params - var session = { - id: c.session.id, - version: c.session.version, - sp: c.session.sp - }; - session.sp.keys = null; - c.sessionCache.setSession(session.id, session); - } - - if(c.open) { - // connection no longer open, clear input - c.open = false; - c.input.clear(); - - // if connected or handshaking, send an alert - if(c.isConnected || c.handshaking) { - c.isConnected = c.handshaking = false; - - // send close_notify alert - tls.queue(c, tls.createAlert(c, { - level: tls.Alert.Level.warning, - description: tls.Alert.Description.close_notify - })); - tls.flush(c); - } - - // call handler - c.closed(c); - } - - // reset TLS connection, do not clear fail flag - c.reset(clearFail); - }; - - return c; -}; - -/* TLS API */ -module.exports = forge.tls = forge.tls || {}; - -// expose non-functions -for(var key in tls) { - if(typeof tls[key] !== 'function') { - forge.tls[key] = tls[key]; - } -} - -// expose prf_tls1 for testing -forge.tls.prf_tls1 = prf_TLS1; - -// expose sha1 hmac method -forge.tls.hmac_sha1 = hmac_sha1; - -// expose session cache creation -forge.tls.createSessionCache = tls.createSessionCache; - -/** - * Creates a new TLS connection. This does not make any assumptions about the - * transport layer that TLS is working on top of, ie: it does not assume there - * is a TCP/IP connection or establish one. A TLS connection is totally - * abstracted away from the layer is runs on top of, it merely establishes a - * secure channel between a client" and a "server". - * - * A TLS connection contains 4 connection states: pending read and write, and - * current read and write. - * - * At initialization, the current read and write states will be null. Only once - * the security parameters have been set and the keys have been generated can - * the pending states be converted into current states. Current states will be - * updated for each record processed. - * - * A custom certificate verify callback may be provided to check information - * like the common name on the server's certificate. It will be called for - * every certificate in the chain. It has the following signature: - * - * variable func(c, certs, index, preVerify) - * Where: - * c The TLS connection - * verified Set to true if certificate was verified, otherwise the alert - * tls.Alert.Description for why the certificate failed. - * depth The current index in the chain, where 0 is the server's cert. - * certs The certificate chain, *NOTE* if the server was anonymous then - * the chain will be empty. - * - * The function returns true on success and on failure either the appropriate - * tls.Alert.Description or an object with 'alert' set to the appropriate - * tls.Alert.Description and 'message' set to a custom error message. If true - * is not returned then the connection will abort using, in order of - * availability, first the returned alert description, second the preVerify - * alert description, and lastly the default 'bad_certificate'. - * - * There are three callbacks that can be used to make use of client-side - * certificates where each takes the TLS connection as the first parameter: - * - * getCertificate(conn, hint) - * The second parameter is a hint as to which certificate should be - * returned. If the connection entity is a client, then the hint will be - * the CertificateRequest message from the server that is part of the - * TLS protocol. If the connection entity is a server, then it will be - * the servername list provided via an SNI extension the ClientHello, if - * one was provided (empty array if not). The hint can be examined to - * determine which certificate to use (advanced). Most implementations - * will just return a certificate. The return value must be a - * PEM-formatted certificate or an array of PEM-formatted certificates - * that constitute a certificate chain, with the first in the array/chain - * being the client's certificate. - * getPrivateKey(conn, certificate) - * The second parameter is an forge.pki X.509 certificate object that - * is associated with the requested private key. The return value must - * be a PEM-formatted private key. - * getSignature(conn, bytes, callback) - * This callback can be used instead of getPrivateKey if the private key - * is not directly accessible in javascript or should not be. For - * instance, a secure external web service could provide the signature - * in exchange for appropriate credentials. The second parameter is a - * string of bytes to be signed that are part of the TLS protocol. These - * bytes are used to verify that the private key for the previously - * provided client-side certificate is accessible to the client. The - * callback is a function that takes 2 parameters, the TLS connection - * and the RSA encrypted (signed) bytes as a string. This callback must - * be called once the signature is ready. - * - * @param options the options for this connection: - * server: true if the connection is server-side, false for client. - * sessionId: a session ID to reuse, null for a new connection. - * caStore: an array of certificates to trust. - * sessionCache: a session cache to use. - * cipherSuites: an optional array of cipher suites to use, - * see tls.CipherSuites. - * connected: function(conn) called when the first handshake completes. - * virtualHost: the virtual server name to use in a TLS SNI extension. - * verifyClient: true to require a client certificate in server mode, - * 'optional' to request one, false not to (default: false). - * verify: a handler used to custom verify certificates in the chain. - * verifyOptions: an object with options for the certificate chain validation. - * See documentation of pki.verifyCertificateChain for possible options. - * verifyOptions.verify is ignored. If you wish to specify a verify handler - * use the verify key. - * getCertificate: an optional callback used to get a certificate or - * a chain of certificates (as an array). - * getPrivateKey: an optional callback used to get a private key. - * getSignature: an optional callback used to get a signature. - * tlsDataReady: function(conn) called when TLS protocol data has been - * prepared and is ready to be used (typically sent over a socket - * connection to its destination), read from conn.tlsData buffer. - * dataReady: function(conn) called when application data has - * been parsed from a TLS record and should be consumed by the - * application, read from conn.data buffer. - * closed: function(conn) called when the connection has been closed. - * error: function(conn, error) called when there was an error. - * deflate: function(inBytes) if provided, will deflate TLS records using - * the deflate algorithm if the server supports it. - * inflate: function(inBytes) if provided, will inflate TLS records using - * the deflate algorithm if the server supports it. - * - * @return the new TLS connection. - */ -forge.tls.createConnection = tls.createConnection; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/tlssocket.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/tlssocket.js deleted file mode 100644 index d09b6509..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/tlssocket.js +++ /dev/null @@ -1,249 +0,0 @@ -/** - * Socket wrapping functions for TLS. - * - * @author Dave Longley - * - * Copyright (c) 2009-2012 Digital Bazaar, Inc. - */ -var forge = require('./forge'); -require('./tls'); - -/** - * Wraps a forge.net socket with a TLS layer. - * - * @param options: - * sessionId: a session ID to reuse, null for a new connection if no session - * cache is provided or it is empty. - * caStore: an array of certificates to trust. - * sessionCache: a session cache to use. - * cipherSuites: an optional array of cipher suites to use, see - * tls.CipherSuites. - * socket: the socket to wrap. - * virtualHost: the virtual server name to use in a TLS SNI extension. - * verify: a handler used to custom verify certificates in the chain. - * getCertificate: an optional callback used to get a certificate. - * getPrivateKey: an optional callback used to get a private key. - * getSignature: an optional callback used to get a signature. - * deflate: function(inBytes) if provided, will deflate TLS records using - * the deflate algorithm if the server supports it. - * inflate: function(inBytes) if provided, will inflate TLS records using - * the deflate algorithm if the server supports it. - * - * @return the TLS-wrapped socket. - */ -forge.tls.wrapSocket = function(options) { - // get raw socket - var socket = options.socket; - - // create TLS socket - var tlsSocket = { - id: socket.id, - // set handlers - connected: socket.connected || function(e) {}, - closed: socket.closed || function(e) {}, - data: socket.data || function(e) {}, - error: socket.error || function(e) {} - }; - - // create TLS connection - var c = forge.tls.createConnection({ - server: false, - sessionId: options.sessionId || null, - caStore: options.caStore || [], - sessionCache: options.sessionCache || null, - cipherSuites: options.cipherSuites || null, - virtualHost: options.virtualHost, - verify: options.verify, - getCertificate: options.getCertificate, - getPrivateKey: options.getPrivateKey, - getSignature: options.getSignature, - deflate: options.deflate, - inflate: options.inflate, - connected: function(c) { - // first handshake complete, call handler - if(c.handshakes === 1) { - tlsSocket.connected({ - id: socket.id, - type: 'connect', - bytesAvailable: c.data.length() - }); - } - }, - tlsDataReady: function(c) { - // send TLS data over socket - return socket.send(c.tlsData.getBytes()); - }, - dataReady: function(c) { - // indicate application data is ready - tlsSocket.data({ - id: socket.id, - type: 'socketData', - bytesAvailable: c.data.length() - }); - }, - closed: function(c) { - // close socket - socket.close(); - }, - error: function(c, e) { - // send error, close socket - tlsSocket.error({ - id: socket.id, - type: 'tlsError', - message: e.message, - bytesAvailable: 0, - error: e - }); - socket.close(); - } - }); - - // handle doing handshake after connecting - socket.connected = function(e) { - c.handshake(options.sessionId); - }; - - // handle closing TLS connection - socket.closed = function(e) { - if(c.open && c.handshaking) { - // error - tlsSocket.error({ - id: socket.id, - type: 'ioError', - message: 'Connection closed during handshake.', - bytesAvailable: 0 - }); - } - c.close(); - - // call socket handler - tlsSocket.closed({ - id: socket.id, - type: 'close', - bytesAvailable: 0 - }); - }; - - // handle error on socket - socket.error = function(e) { - // error - tlsSocket.error({ - id: socket.id, - type: e.type, - message: e.message, - bytesAvailable: 0 - }); - c.close(); - }; - - // handle receiving raw TLS data from socket - var _requiredBytes = 0; - socket.data = function(e) { - // drop data if connection not open - if(!c.open) { - socket.receive(e.bytesAvailable); - } else { - // only receive if there are enough bytes available to - // process a record - if(e.bytesAvailable >= _requiredBytes) { - var count = Math.max(e.bytesAvailable, _requiredBytes); - var data = socket.receive(count); - if(data !== null) { - _requiredBytes = c.process(data); - } - } - } - }; - - /** - * Destroys this socket. - */ - tlsSocket.destroy = function() { - socket.destroy(); - }; - - /** - * Sets this socket's TLS session cache. This should be called before - * the socket is connected or after it is closed. - * - * The cache is an object mapping session IDs to internal opaque state. - * An application might need to change the cache used by a particular - * tlsSocket between connections if it accesses multiple TLS hosts. - * - * @param cache the session cache to use. - */ - tlsSocket.setSessionCache = function(cache) { - c.sessionCache = tls.createSessionCache(cache); - }; - - /** - * Connects this socket. - * - * @param options: - * host: the host to connect to. - * port: the port to connect to. - * policyPort: the policy port to use (if non-default), 0 to - * use the flash default. - * policyUrl: the policy file URL to use (instead of port). - */ - tlsSocket.connect = function(options) { - socket.connect(options); - }; - - /** - * Closes this socket. - */ - tlsSocket.close = function() { - c.close(); - }; - - /** - * Determines if the socket is connected or not. - * - * @return true if connected, false if not. - */ - tlsSocket.isConnected = function() { - return c.isConnected && socket.isConnected(); - }; - - /** - * Writes bytes to this socket. - * - * @param bytes the bytes (as a string) to write. - * - * @return true on success, false on failure. - */ - tlsSocket.send = function(bytes) { - return c.prepare(bytes); - }; - - /** - * Reads bytes from this socket (non-blocking). Fewer than the number of - * bytes requested may be read if enough bytes are not available. - * - * This method should be called from the data handler if there are enough - * bytes available. To see how many bytes are available, check the - * 'bytesAvailable' property on the event in the data handler or call the - * bytesAvailable() function on the socket. If the browser is msie, then the - * bytesAvailable() function should be used to avoid race conditions. - * Otherwise, using the property on the data handler's event may be quicker. - * - * @param count the maximum number of bytes to read. - * - * @return the bytes read (as a string) or null on error. - */ - tlsSocket.receive = function(count) { - return c.data.getBytes(count); - }; - - /** - * Gets the number of bytes available for receiving on the socket. - * - * @return the number of bytes available for receiving. - */ - tlsSocket.bytesAvailable = function() { - return c.data.length(); - }; - - return tlsSocket; -}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/util.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/util.js deleted file mode 100644 index aaede5ad..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/util.js +++ /dev/null @@ -1,2652 +0,0 @@ -/** - * Utility functions for web applications. - * - * @author Dave Longley - * - * Copyright (c) 2010-2018 Digital Bazaar, Inc. - */ -var forge = require('./forge'); -var baseN = require('./baseN'); - -/* Utilities API */ -var util = module.exports = forge.util = forge.util || {}; - -// define setImmediate and nextTick -(function() { - // use native nextTick (unless we're in webpack) - // webpack (or better node-libs-browser polyfill) sets process.browser. - // this way we can detect webpack properly - if(typeof process !== 'undefined' && process.nextTick && !process.browser) { - util.nextTick = process.nextTick; - if(typeof setImmediate === 'function') { - util.setImmediate = setImmediate; - } else { - // polyfill setImmediate with nextTick, older versions of node - // (those w/o setImmediate) won't totally starve IO - util.setImmediate = util.nextTick; - } - return; - } - - // polyfill nextTick with native setImmediate - if(typeof setImmediate === 'function') { - util.setImmediate = function() { return setImmediate.apply(undefined, arguments); }; - util.nextTick = function(callback) { - return setImmediate(callback); - }; - return; - } - - /* Note: A polyfill upgrade pattern is used here to allow combining - polyfills. For example, MutationObserver is fast, but blocks UI updates, - so it needs to allow UI updates periodically, so it falls back on - postMessage or setTimeout. */ - - // polyfill with setTimeout - util.setImmediate = function(callback) { - setTimeout(callback, 0); - }; - - // upgrade polyfill to use postMessage - if(typeof window !== 'undefined' && - typeof window.postMessage === 'function') { - var msg = 'forge.setImmediate'; - var callbacks = []; - util.setImmediate = function(callback) { - callbacks.push(callback); - // only send message when one hasn't been sent in - // the current turn of the event loop - if(callbacks.length === 1) { - window.postMessage(msg, '*'); - } - }; - function handler(event) { - if(event.source === window && event.data === msg) { - event.stopPropagation(); - var copy = callbacks.slice(); - callbacks.length = 0; - copy.forEach(function(callback) { - callback(); - }); - } - } - window.addEventListener('message', handler, true); - } - - // upgrade polyfill to use MutationObserver - if(typeof MutationObserver !== 'undefined') { - // polyfill with MutationObserver - var now = Date.now(); - var attr = true; - var div = document.createElement('div'); - var callbacks = []; - new MutationObserver(function() { - var copy = callbacks.slice(); - callbacks.length = 0; - copy.forEach(function(callback) { - callback(); - }); - }).observe(div, {attributes: true}); - var oldSetImmediate = util.setImmediate; - util.setImmediate = function(callback) { - if(Date.now() - now > 15) { - now = Date.now(); - oldSetImmediate(callback); - } else { - callbacks.push(callback); - // only trigger observer when it hasn't been triggered in - // the current turn of the event loop - if(callbacks.length === 1) { - div.setAttribute('a', attr = !attr); - } - } - }; - } - - util.nextTick = util.setImmediate; -})(); - -// check if running under Node.js -util.isNodejs = - typeof process !== 'undefined' && process.versions && process.versions.node; - - -// 'self' will also work in Web Workers (instance of WorkerGlobalScope) while -// it will point to `window` in the main thread. -// To remain compatible with older browsers, we fall back to 'window' if 'self' -// is not available. -util.globalScope = (function() { - if(util.isNodejs) { - return global; - } - - return typeof self === 'undefined' ? window : self; -})(); - -// define isArray -util.isArray = Array.isArray || function(x) { - return Object.prototype.toString.call(x) === '[object Array]'; -}; - -// define isArrayBuffer -util.isArrayBuffer = function(x) { - return typeof ArrayBuffer !== 'undefined' && x instanceof ArrayBuffer; -}; - -// define isArrayBufferView -util.isArrayBufferView = function(x) { - return x && util.isArrayBuffer(x.buffer) && x.byteLength !== undefined; -}; - -/** - * Ensure a bits param is 8, 16, 24, or 32. Used to validate input for - * algorithms where bit manipulation, JavaScript limitations, and/or algorithm - * design only allow for byte operations of a limited size. - * - * @param n number of bits. - * - * Throw Error if n invalid. - */ -function _checkBitsParam(n) { - if(!(n === 8 || n === 16 || n === 24 || n === 32)) { - throw new Error('Only 8, 16, 24, or 32 bits supported: ' + n); - } -} - -// TODO: set ByteBuffer to best available backing -util.ByteBuffer = ByteStringBuffer; - -/** Buffer w/BinaryString backing */ - -/** - * Constructor for a binary string backed byte buffer. - * - * @param [b] the bytes to wrap (either encoded as string, one byte per - * character, or as an ArrayBuffer or Typed Array). - */ -function ByteStringBuffer(b) { - // TODO: update to match DataBuffer API - - // the data in this buffer - this.data = ''; - // the pointer for reading from this buffer - this.read = 0; - - if(typeof b === 'string') { - this.data = b; - } else if(util.isArrayBuffer(b) || util.isArrayBufferView(b)) { - if(typeof Buffer !== 'undefined' && b instanceof Buffer) { - this.data = b.toString('binary'); - } else { - // convert native buffer to forge buffer - // FIXME: support native buffers internally instead - var arr = new Uint8Array(b); - try { - this.data = String.fromCharCode.apply(null, arr); - } catch(e) { - for(var i = 0; i < arr.length; ++i) { - this.putByte(arr[i]); - } - } - } - } else if(b instanceof ByteStringBuffer || - (typeof b === 'object' && typeof b.data === 'string' && - typeof b.read === 'number')) { - // copy existing buffer - this.data = b.data; - this.read = b.read; - } - - // used for v8 optimization - this._constructedStringLength = 0; -} -util.ByteStringBuffer = ByteStringBuffer; - -/* Note: This is an optimization for V8-based browsers. When V8 concatenates - a string, the strings are only joined logically using a "cons string" or - "constructed/concatenated string". These containers keep references to one - another and can result in very large memory usage. For example, if a 2MB - string is constructed by concatenating 4 bytes together at a time, the - memory usage will be ~44MB; so ~22x increase. The strings are only joined - together when an operation requiring their joining takes place, such as - substr(). This function is called when adding data to this buffer to ensure - these types of strings are periodically joined to reduce the memory - footprint. */ -var _MAX_CONSTRUCTED_STRING_LENGTH = 4096; -util.ByteStringBuffer.prototype._optimizeConstructedString = function(x) { - this._constructedStringLength += x; - if(this._constructedStringLength > _MAX_CONSTRUCTED_STRING_LENGTH) { - // this substr() should cause the constructed string to join - this.data.substr(0, 1); - this._constructedStringLength = 0; - } -}; - -/** - * Gets the number of bytes in this buffer. - * - * @return the number of bytes in this buffer. - */ -util.ByteStringBuffer.prototype.length = function() { - return this.data.length - this.read; -}; - -/** - * Gets whether or not this buffer is empty. - * - * @return true if this buffer is empty, false if not. - */ -util.ByteStringBuffer.prototype.isEmpty = function() { - return this.length() <= 0; -}; - -/** - * Puts a byte in this buffer. - * - * @param b the byte to put. - * - * @return this buffer. - */ -util.ByteStringBuffer.prototype.putByte = function(b) { - return this.putBytes(String.fromCharCode(b)); -}; - -/** - * Puts a byte in this buffer N times. - * - * @param b the byte to put. - * @param n the number of bytes of value b to put. - * - * @return this buffer. - */ -util.ByteStringBuffer.prototype.fillWithByte = function(b, n) { - b = String.fromCharCode(b); - var d = this.data; - while(n > 0) { - if(n & 1) { - d += b; - } - n >>>= 1; - if(n > 0) { - b += b; - } - } - this.data = d; - this._optimizeConstructedString(n); - return this; -}; - -/** - * Puts bytes in this buffer. - * - * @param bytes the bytes (as a binary encoded string) to put. - * - * @return this buffer. - */ -util.ByteStringBuffer.prototype.putBytes = function(bytes) { - this.data += bytes; - this._optimizeConstructedString(bytes.length); - return this; -}; - -/** - * Puts a UTF-16 encoded string into this buffer. - * - * @param str the string to put. - * - * @return this buffer. - */ -util.ByteStringBuffer.prototype.putString = function(str) { - return this.putBytes(util.encodeUtf8(str)); -}; - -/** - * Puts a 16-bit integer in this buffer in big-endian order. - * - * @param i the 16-bit integer. - * - * @return this buffer. - */ -util.ByteStringBuffer.prototype.putInt16 = function(i) { - return this.putBytes( - String.fromCharCode(i >> 8 & 0xFF) + - String.fromCharCode(i & 0xFF)); -}; - -/** - * Puts a 24-bit integer in this buffer in big-endian order. - * - * @param i the 24-bit integer. - * - * @return this buffer. - */ -util.ByteStringBuffer.prototype.putInt24 = function(i) { - return this.putBytes( - String.fromCharCode(i >> 16 & 0xFF) + - String.fromCharCode(i >> 8 & 0xFF) + - String.fromCharCode(i & 0xFF)); -}; - -/** - * Puts a 32-bit integer in this buffer in big-endian order. - * - * @param i the 32-bit integer. - * - * @return this buffer. - */ -util.ByteStringBuffer.prototype.putInt32 = function(i) { - return this.putBytes( - String.fromCharCode(i >> 24 & 0xFF) + - String.fromCharCode(i >> 16 & 0xFF) + - String.fromCharCode(i >> 8 & 0xFF) + - String.fromCharCode(i & 0xFF)); -}; - -/** - * Puts a 16-bit integer in this buffer in little-endian order. - * - * @param i the 16-bit integer. - * - * @return this buffer. - */ -util.ByteStringBuffer.prototype.putInt16Le = function(i) { - return this.putBytes( - String.fromCharCode(i & 0xFF) + - String.fromCharCode(i >> 8 & 0xFF)); -}; - -/** - * Puts a 24-bit integer in this buffer in little-endian order. - * - * @param i the 24-bit integer. - * - * @return this buffer. - */ -util.ByteStringBuffer.prototype.putInt24Le = function(i) { - return this.putBytes( - String.fromCharCode(i & 0xFF) + - String.fromCharCode(i >> 8 & 0xFF) + - String.fromCharCode(i >> 16 & 0xFF)); -}; - -/** - * Puts a 32-bit integer in this buffer in little-endian order. - * - * @param i the 32-bit integer. - * - * @return this buffer. - */ -util.ByteStringBuffer.prototype.putInt32Le = function(i) { - return this.putBytes( - String.fromCharCode(i & 0xFF) + - String.fromCharCode(i >> 8 & 0xFF) + - String.fromCharCode(i >> 16 & 0xFF) + - String.fromCharCode(i >> 24 & 0xFF)); -}; - -/** - * Puts an n-bit integer in this buffer in big-endian order. - * - * @param i the n-bit integer. - * @param n the number of bits in the integer (8, 16, 24, or 32). - * - * @return this buffer. - */ -util.ByteStringBuffer.prototype.putInt = function(i, n) { - _checkBitsParam(n); - var bytes = ''; - do { - n -= 8; - bytes += String.fromCharCode((i >> n) & 0xFF); - } while(n > 0); - return this.putBytes(bytes); -}; - -/** - * Puts a signed n-bit integer in this buffer in big-endian order. Two's - * complement representation is used. - * - * @param i the n-bit integer. - * @param n the number of bits in the integer (8, 16, 24, or 32). - * - * @return this buffer. - */ -util.ByteStringBuffer.prototype.putSignedInt = function(i, n) { - // putInt checks n - if(i < 0) { - i += 2 << (n - 1); - } - return this.putInt(i, n); -}; - -/** - * Puts the given buffer into this buffer. - * - * @param buffer the buffer to put into this one. - * - * @return this buffer. - */ -util.ByteStringBuffer.prototype.putBuffer = function(buffer) { - return this.putBytes(buffer.getBytes()); -}; - -/** - * Gets a byte from this buffer and advances the read pointer by 1. - * - * @return the byte. - */ -util.ByteStringBuffer.prototype.getByte = function() { - return this.data.charCodeAt(this.read++); -}; - -/** - * Gets a uint16 from this buffer in big-endian order and advances the read - * pointer by 2. - * - * @return the uint16. - */ -util.ByteStringBuffer.prototype.getInt16 = function() { - var rval = ( - this.data.charCodeAt(this.read) << 8 ^ - this.data.charCodeAt(this.read + 1)); - this.read += 2; - return rval; -}; - -/** - * Gets a uint24 from this buffer in big-endian order and advances the read - * pointer by 3. - * - * @return the uint24. - */ -util.ByteStringBuffer.prototype.getInt24 = function() { - var rval = ( - this.data.charCodeAt(this.read) << 16 ^ - this.data.charCodeAt(this.read + 1) << 8 ^ - this.data.charCodeAt(this.read + 2)); - this.read += 3; - return rval; -}; - -/** - * Gets a uint32 from this buffer in big-endian order and advances the read - * pointer by 4. - * - * @return the word. - */ -util.ByteStringBuffer.prototype.getInt32 = function() { - var rval = ( - this.data.charCodeAt(this.read) << 24 ^ - this.data.charCodeAt(this.read + 1) << 16 ^ - this.data.charCodeAt(this.read + 2) << 8 ^ - this.data.charCodeAt(this.read + 3)); - this.read += 4; - return rval; -}; - -/** - * Gets a uint16 from this buffer in little-endian order and advances the read - * pointer by 2. - * - * @return the uint16. - */ -util.ByteStringBuffer.prototype.getInt16Le = function() { - var rval = ( - this.data.charCodeAt(this.read) ^ - this.data.charCodeAt(this.read + 1) << 8); - this.read += 2; - return rval; -}; - -/** - * Gets a uint24 from this buffer in little-endian order and advances the read - * pointer by 3. - * - * @return the uint24. - */ -util.ByteStringBuffer.prototype.getInt24Le = function() { - var rval = ( - this.data.charCodeAt(this.read) ^ - this.data.charCodeAt(this.read + 1) << 8 ^ - this.data.charCodeAt(this.read + 2) << 16); - this.read += 3; - return rval; -}; - -/** - * Gets a uint32 from this buffer in little-endian order and advances the read - * pointer by 4. - * - * @return the word. - */ -util.ByteStringBuffer.prototype.getInt32Le = function() { - var rval = ( - this.data.charCodeAt(this.read) ^ - this.data.charCodeAt(this.read + 1) << 8 ^ - this.data.charCodeAt(this.read + 2) << 16 ^ - this.data.charCodeAt(this.read + 3) << 24); - this.read += 4; - return rval; -}; - -/** - * Gets an n-bit integer from this buffer in big-endian order and advances the - * read pointer by ceil(n/8). - * - * @param n the number of bits in the integer (8, 16, 24, or 32). - * - * @return the integer. - */ -util.ByteStringBuffer.prototype.getInt = function(n) { - _checkBitsParam(n); - var rval = 0; - do { - // TODO: Use (rval * 0x100) if adding support for 33 to 53 bits. - rval = (rval << 8) + this.data.charCodeAt(this.read++); - n -= 8; - } while(n > 0); - return rval; -}; - -/** - * Gets a signed n-bit integer from this buffer in big-endian order, using - * two's complement, and advances the read pointer by n/8. - * - * @param n the number of bits in the integer (8, 16, 24, or 32). - * - * @return the integer. - */ -util.ByteStringBuffer.prototype.getSignedInt = function(n) { - // getInt checks n - var x = this.getInt(n); - var max = 2 << (n - 2); - if(x >= max) { - x -= max << 1; - } - return x; -}; - -/** - * Reads bytes out as a binary encoded string and clears them from the - * buffer. Note that the resulting string is binary encoded (in node.js this - * encoding is referred to as `binary`, it is *not* `utf8`). - * - * @param count the number of bytes to read, undefined or null for all. - * - * @return a binary encoded string of bytes. - */ -util.ByteStringBuffer.prototype.getBytes = function(count) { - var rval; - if(count) { - // read count bytes - count = Math.min(this.length(), count); - rval = this.data.slice(this.read, this.read + count); - this.read += count; - } else if(count === 0) { - rval = ''; - } else { - // read all bytes, optimize to only copy when needed - rval = (this.read === 0) ? this.data : this.data.slice(this.read); - this.clear(); - } - return rval; -}; - -/** - * Gets a binary encoded string of the bytes from this buffer without - * modifying the read pointer. - * - * @param count the number of bytes to get, omit to get all. - * - * @return a string full of binary encoded characters. - */ -util.ByteStringBuffer.prototype.bytes = function(count) { - return (typeof(count) === 'undefined' ? - this.data.slice(this.read) : - this.data.slice(this.read, this.read + count)); -}; - -/** - * Gets a byte at the given index without modifying the read pointer. - * - * @param i the byte index. - * - * @return the byte. - */ -util.ByteStringBuffer.prototype.at = function(i) { - return this.data.charCodeAt(this.read + i); -}; - -/** - * Puts a byte at the given index without modifying the read pointer. - * - * @param i the byte index. - * @param b the byte to put. - * - * @return this buffer. - */ -util.ByteStringBuffer.prototype.setAt = function(i, b) { - this.data = this.data.substr(0, this.read + i) + - String.fromCharCode(b) + - this.data.substr(this.read + i + 1); - return this; -}; - -/** - * Gets the last byte without modifying the read pointer. - * - * @return the last byte. - */ -util.ByteStringBuffer.prototype.last = function() { - return this.data.charCodeAt(this.data.length - 1); -}; - -/** - * Creates a copy of this buffer. - * - * @return the copy. - */ -util.ByteStringBuffer.prototype.copy = function() { - var c = util.createBuffer(this.data); - c.read = this.read; - return c; -}; - -/** - * Compacts this buffer. - * - * @return this buffer. - */ -util.ByteStringBuffer.prototype.compact = function() { - if(this.read > 0) { - this.data = this.data.slice(this.read); - this.read = 0; - } - return this; -}; - -/** - * Clears this buffer. - * - * @return this buffer. - */ -util.ByteStringBuffer.prototype.clear = function() { - this.data = ''; - this.read = 0; - return this; -}; - -/** - * Shortens this buffer by triming bytes off of the end of this buffer. - * - * @param count the number of bytes to trim off. - * - * @return this buffer. - */ -util.ByteStringBuffer.prototype.truncate = function(count) { - var len = Math.max(0, this.length() - count); - this.data = this.data.substr(this.read, len); - this.read = 0; - return this; -}; - -/** - * Converts this buffer to a hexadecimal string. - * - * @return a hexadecimal string. - */ -util.ByteStringBuffer.prototype.toHex = function() { - var rval = ''; - for(var i = this.read; i < this.data.length; ++i) { - var b = this.data.charCodeAt(i); - if(b < 16) { - rval += '0'; - } - rval += b.toString(16); - } - return rval; -}; - -/** - * Converts this buffer to a UTF-16 string (standard JavaScript string). - * - * @return a UTF-16 string. - */ -util.ByteStringBuffer.prototype.toString = function() { - return util.decodeUtf8(this.bytes()); -}; - -/** End Buffer w/BinaryString backing */ - -/** Buffer w/UInt8Array backing */ - -/** - * FIXME: Experimental. Do not use yet. - * - * Constructor for an ArrayBuffer-backed byte buffer. - * - * The buffer may be constructed from a string, an ArrayBuffer, DataView, or a - * TypedArray. - * - * If a string is given, its encoding should be provided as an option, - * otherwise it will default to 'binary'. A 'binary' string is encoded such - * that each character is one byte in length and size. - * - * If an ArrayBuffer, DataView, or TypedArray is given, it will be used - * *directly* without any copying. Note that, if a write to the buffer requires - * more space, the buffer will allocate a new backing ArrayBuffer to - * accommodate. The starting read and write offsets for the buffer may be - * given as options. - * - * @param [b] the initial bytes for this buffer. - * @param options the options to use: - * [readOffset] the starting read offset to use (default: 0). - * [writeOffset] the starting write offset to use (default: the - * length of the first parameter). - * [growSize] the minimum amount, in bytes, to grow the buffer by to - * accommodate writes (default: 1024). - * [encoding] the encoding ('binary', 'utf8', 'utf16', 'hex') for the - * first parameter, if it is a string (default: 'binary'). - */ -function DataBuffer(b, options) { - // default options - options = options || {}; - - // pointers for read from/write to buffer - this.read = options.readOffset || 0; - this.growSize = options.growSize || 1024; - - var isArrayBuffer = util.isArrayBuffer(b); - var isArrayBufferView = util.isArrayBufferView(b); - if(isArrayBuffer || isArrayBufferView) { - // use ArrayBuffer directly - if(isArrayBuffer) { - this.data = new DataView(b); - } else { - // TODO: adjust read/write offset based on the type of view - // or specify that this must be done in the options ... that the - // offsets are byte-based - this.data = new DataView(b.buffer, b.byteOffset, b.byteLength); - } - this.write = ('writeOffset' in options ? - options.writeOffset : this.data.byteLength); - return; - } - - // initialize to empty array buffer and add any given bytes using putBytes - this.data = new DataView(new ArrayBuffer(0)); - this.write = 0; - - if(b !== null && b !== undefined) { - this.putBytes(b); - } - - if('writeOffset' in options) { - this.write = options.writeOffset; - } -} -util.DataBuffer = DataBuffer; - -/** - * Gets the number of bytes in this buffer. - * - * @return the number of bytes in this buffer. - */ -util.DataBuffer.prototype.length = function() { - return this.write - this.read; -}; - -/** - * Gets whether or not this buffer is empty. - * - * @return true if this buffer is empty, false if not. - */ -util.DataBuffer.prototype.isEmpty = function() { - return this.length() <= 0; -}; - -/** - * Ensures this buffer has enough empty space to accommodate the given number - * of bytes. An optional parameter may be given that indicates a minimum - * amount to grow the buffer if necessary. If the parameter is not given, - * the buffer will be grown by some previously-specified default amount - * or heuristic. - * - * @param amount the number of bytes to accommodate. - * @param [growSize] the minimum amount, in bytes, to grow the buffer by if - * necessary. - */ -util.DataBuffer.prototype.accommodate = function(amount, growSize) { - if(this.length() >= amount) { - return this; - } - growSize = Math.max(growSize || this.growSize, amount); - - // grow buffer - var src = new Uint8Array( - this.data.buffer, this.data.byteOffset, this.data.byteLength); - var dst = new Uint8Array(this.length() + growSize); - dst.set(src); - this.data = new DataView(dst.buffer); - - return this; -}; - -/** - * Puts a byte in this buffer. - * - * @param b the byte to put. - * - * @return this buffer. - */ -util.DataBuffer.prototype.putByte = function(b) { - this.accommodate(1); - this.data.setUint8(this.write++, b); - return this; -}; - -/** - * Puts a byte in this buffer N times. - * - * @param b the byte to put. - * @param n the number of bytes of value b to put. - * - * @return this buffer. - */ -util.DataBuffer.prototype.fillWithByte = function(b, n) { - this.accommodate(n); - for(var i = 0; i < n; ++i) { - this.data.setUint8(b); - } - return this; -}; - -/** - * Puts bytes in this buffer. The bytes may be given as a string, an - * ArrayBuffer, a DataView, or a TypedArray. - * - * @param bytes the bytes to put. - * @param [encoding] the encoding for the first parameter ('binary', 'utf8', - * 'utf16', 'hex'), if it is a string (default: 'binary'). - * - * @return this buffer. - */ -util.DataBuffer.prototype.putBytes = function(bytes, encoding) { - if(util.isArrayBufferView(bytes)) { - var src = new Uint8Array(bytes.buffer, bytes.byteOffset, bytes.byteLength); - var len = src.byteLength - src.byteOffset; - this.accommodate(len); - var dst = new Uint8Array(this.data.buffer, this.write); - dst.set(src); - this.write += len; - return this; - } - - if(util.isArrayBuffer(bytes)) { - var src = new Uint8Array(bytes); - this.accommodate(src.byteLength); - var dst = new Uint8Array(this.data.buffer); - dst.set(src, this.write); - this.write += src.byteLength; - return this; - } - - // bytes is a util.DataBuffer or equivalent - if(bytes instanceof util.DataBuffer || - (typeof bytes === 'object' && - typeof bytes.read === 'number' && typeof bytes.write === 'number' && - util.isArrayBufferView(bytes.data))) { - var src = new Uint8Array(bytes.data.byteLength, bytes.read, bytes.length()); - this.accommodate(src.byteLength); - var dst = new Uint8Array(bytes.data.byteLength, this.write); - dst.set(src); - this.write += src.byteLength; - return this; - } - - if(bytes instanceof util.ByteStringBuffer) { - // copy binary string and process as the same as a string parameter below - bytes = bytes.data; - encoding = 'binary'; - } - - // string conversion - encoding = encoding || 'binary'; - if(typeof bytes === 'string') { - var view; - - // decode from string - if(encoding === 'hex') { - this.accommodate(Math.ceil(bytes.length / 2)); - view = new Uint8Array(this.data.buffer, this.write); - this.write += util.binary.hex.decode(bytes, view, this.write); - return this; - } - if(encoding === 'base64') { - this.accommodate(Math.ceil(bytes.length / 4) * 3); - view = new Uint8Array(this.data.buffer, this.write); - this.write += util.binary.base64.decode(bytes, view, this.write); - return this; - } - - // encode text as UTF-8 bytes - if(encoding === 'utf8') { - // encode as UTF-8 then decode string as raw binary - bytes = util.encodeUtf8(bytes); - encoding = 'binary'; - } - - // decode string as raw binary - if(encoding === 'binary' || encoding === 'raw') { - // one byte per character - this.accommodate(bytes.length); - view = new Uint8Array(this.data.buffer, this.write); - this.write += util.binary.raw.decode(view); - return this; - } - - // encode text as UTF-16 bytes - if(encoding === 'utf16') { - // two bytes per character - this.accommodate(bytes.length * 2); - view = new Uint16Array(this.data.buffer, this.write); - this.write += util.text.utf16.encode(view); - return this; - } - - throw new Error('Invalid encoding: ' + encoding); - } - - throw Error('Invalid parameter: ' + bytes); -}; - -/** - * Puts the given buffer into this buffer. - * - * @param buffer the buffer to put into this one. - * - * @return this buffer. - */ -util.DataBuffer.prototype.putBuffer = function(buffer) { - this.putBytes(buffer); - buffer.clear(); - return this; -}; - -/** - * Puts a string into this buffer. - * - * @param str the string to put. - * @param [encoding] the encoding for the string (default: 'utf16'). - * - * @return this buffer. - */ -util.DataBuffer.prototype.putString = function(str) { - return this.putBytes(str, 'utf16'); -}; - -/** - * Puts a 16-bit integer in this buffer in big-endian order. - * - * @param i the 16-bit integer. - * - * @return this buffer. - */ -util.DataBuffer.prototype.putInt16 = function(i) { - this.accommodate(2); - this.data.setInt16(this.write, i); - this.write += 2; - return this; -}; - -/** - * Puts a 24-bit integer in this buffer in big-endian order. - * - * @param i the 24-bit integer. - * - * @return this buffer. - */ -util.DataBuffer.prototype.putInt24 = function(i) { - this.accommodate(3); - this.data.setInt16(this.write, i >> 8 & 0xFFFF); - this.data.setInt8(this.write, i >> 16 & 0xFF); - this.write += 3; - return this; -}; - -/** - * Puts a 32-bit integer in this buffer in big-endian order. - * - * @param i the 32-bit integer. - * - * @return this buffer. - */ -util.DataBuffer.prototype.putInt32 = function(i) { - this.accommodate(4); - this.data.setInt32(this.write, i); - this.write += 4; - return this; -}; - -/** - * Puts a 16-bit integer in this buffer in little-endian order. - * - * @param i the 16-bit integer. - * - * @return this buffer. - */ -util.DataBuffer.prototype.putInt16Le = function(i) { - this.accommodate(2); - this.data.setInt16(this.write, i, true); - this.write += 2; - return this; -}; - -/** - * Puts a 24-bit integer in this buffer in little-endian order. - * - * @param i the 24-bit integer. - * - * @return this buffer. - */ -util.DataBuffer.prototype.putInt24Le = function(i) { - this.accommodate(3); - this.data.setInt8(this.write, i >> 16 & 0xFF); - this.data.setInt16(this.write, i >> 8 & 0xFFFF, true); - this.write += 3; - return this; -}; - -/** - * Puts a 32-bit integer in this buffer in little-endian order. - * - * @param i the 32-bit integer. - * - * @return this buffer. - */ -util.DataBuffer.prototype.putInt32Le = function(i) { - this.accommodate(4); - this.data.setInt32(this.write, i, true); - this.write += 4; - return this; -}; - -/** - * Puts an n-bit integer in this buffer in big-endian order. - * - * @param i the n-bit integer. - * @param n the number of bits in the integer (8, 16, 24, or 32). - * - * @return this buffer. - */ -util.DataBuffer.prototype.putInt = function(i, n) { - _checkBitsParam(n); - this.accommodate(n / 8); - do { - n -= 8; - this.data.setInt8(this.write++, (i >> n) & 0xFF); - } while(n > 0); - return this; -}; - -/** - * Puts a signed n-bit integer in this buffer in big-endian order. Two's - * complement representation is used. - * - * @param i the n-bit integer. - * @param n the number of bits in the integer. - * - * @return this buffer. - */ -util.DataBuffer.prototype.putSignedInt = function(i, n) { - _checkBitsParam(n); - this.accommodate(n / 8); - if(i < 0) { - i += 2 << (n - 1); - } - return this.putInt(i, n); -}; - -/** - * Gets a byte from this buffer and advances the read pointer by 1. - * - * @return the byte. - */ -util.DataBuffer.prototype.getByte = function() { - return this.data.getInt8(this.read++); -}; - -/** - * Gets a uint16 from this buffer in big-endian order and advances the read - * pointer by 2. - * - * @return the uint16. - */ -util.DataBuffer.prototype.getInt16 = function() { - var rval = this.data.getInt16(this.read); - this.read += 2; - return rval; -}; - -/** - * Gets a uint24 from this buffer in big-endian order and advances the read - * pointer by 3. - * - * @return the uint24. - */ -util.DataBuffer.prototype.getInt24 = function() { - var rval = ( - this.data.getInt16(this.read) << 8 ^ - this.data.getInt8(this.read + 2)); - this.read += 3; - return rval; -}; - -/** - * Gets a uint32 from this buffer in big-endian order and advances the read - * pointer by 4. - * - * @return the word. - */ -util.DataBuffer.prototype.getInt32 = function() { - var rval = this.data.getInt32(this.read); - this.read += 4; - return rval; -}; - -/** - * Gets a uint16 from this buffer in little-endian order and advances the read - * pointer by 2. - * - * @return the uint16. - */ -util.DataBuffer.prototype.getInt16Le = function() { - var rval = this.data.getInt16(this.read, true); - this.read += 2; - return rval; -}; - -/** - * Gets a uint24 from this buffer in little-endian order and advances the read - * pointer by 3. - * - * @return the uint24. - */ -util.DataBuffer.prototype.getInt24Le = function() { - var rval = ( - this.data.getInt8(this.read) ^ - this.data.getInt16(this.read + 1, true) << 8); - this.read += 3; - return rval; -}; - -/** - * Gets a uint32 from this buffer in little-endian order and advances the read - * pointer by 4. - * - * @return the word. - */ -util.DataBuffer.prototype.getInt32Le = function() { - var rval = this.data.getInt32(this.read, true); - this.read += 4; - return rval; -}; - -/** - * Gets an n-bit integer from this buffer in big-endian order and advances the - * read pointer by n/8. - * - * @param n the number of bits in the integer (8, 16, 24, or 32). - * - * @return the integer. - */ -util.DataBuffer.prototype.getInt = function(n) { - _checkBitsParam(n); - var rval = 0; - do { - // TODO: Use (rval * 0x100) if adding support for 33 to 53 bits. - rval = (rval << 8) + this.data.getInt8(this.read++); - n -= 8; - } while(n > 0); - return rval; -}; - -/** - * Gets a signed n-bit integer from this buffer in big-endian order, using - * two's complement, and advances the read pointer by n/8. - * - * @param n the number of bits in the integer (8, 16, 24, or 32). - * - * @return the integer. - */ -util.DataBuffer.prototype.getSignedInt = function(n) { - // getInt checks n - var x = this.getInt(n); - var max = 2 << (n - 2); - if(x >= max) { - x -= max << 1; - } - return x; -}; - -/** - * Reads bytes out as a binary encoded string and clears them from the - * buffer. - * - * @param count the number of bytes to read, undefined or null for all. - * - * @return a binary encoded string of bytes. - */ -util.DataBuffer.prototype.getBytes = function(count) { - // TODO: deprecate this method, it is poorly named and - // this.toString('binary') replaces it - // add a toTypedArray()/toArrayBuffer() function - var rval; - if(count) { - // read count bytes - count = Math.min(this.length(), count); - rval = this.data.slice(this.read, this.read + count); - this.read += count; - } else if(count === 0) { - rval = ''; - } else { - // read all bytes, optimize to only copy when needed - rval = (this.read === 0) ? this.data : this.data.slice(this.read); - this.clear(); - } - return rval; -}; - -/** - * Gets a binary encoded string of the bytes from this buffer without - * modifying the read pointer. - * - * @param count the number of bytes to get, omit to get all. - * - * @return a string full of binary encoded characters. - */ -util.DataBuffer.prototype.bytes = function(count) { - // TODO: deprecate this method, it is poorly named, add "getString()" - return (typeof(count) === 'undefined' ? - this.data.slice(this.read) : - this.data.slice(this.read, this.read + count)); -}; - -/** - * Gets a byte at the given index without modifying the read pointer. - * - * @param i the byte index. - * - * @return the byte. - */ -util.DataBuffer.prototype.at = function(i) { - return this.data.getUint8(this.read + i); -}; - -/** - * Puts a byte at the given index without modifying the read pointer. - * - * @param i the byte index. - * @param b the byte to put. - * - * @return this buffer. - */ -util.DataBuffer.prototype.setAt = function(i, b) { - this.data.setUint8(i, b); - return this; -}; - -/** - * Gets the last byte without modifying the read pointer. - * - * @return the last byte. - */ -util.DataBuffer.prototype.last = function() { - return this.data.getUint8(this.write - 1); -}; - -/** - * Creates a copy of this buffer. - * - * @return the copy. - */ -util.DataBuffer.prototype.copy = function() { - return new util.DataBuffer(this); -}; - -/** - * Compacts this buffer. - * - * @return this buffer. - */ -util.DataBuffer.prototype.compact = function() { - if(this.read > 0) { - var src = new Uint8Array(this.data.buffer, this.read); - var dst = new Uint8Array(src.byteLength); - dst.set(src); - this.data = new DataView(dst); - this.write -= this.read; - this.read = 0; - } - return this; -}; - -/** - * Clears this buffer. - * - * @return this buffer. - */ -util.DataBuffer.prototype.clear = function() { - this.data = new DataView(new ArrayBuffer(0)); - this.read = this.write = 0; - return this; -}; - -/** - * Shortens this buffer by triming bytes off of the end of this buffer. - * - * @param count the number of bytes to trim off. - * - * @return this buffer. - */ -util.DataBuffer.prototype.truncate = function(count) { - this.write = Math.max(0, this.length() - count); - this.read = Math.min(this.read, this.write); - return this; -}; - -/** - * Converts this buffer to a hexadecimal string. - * - * @return a hexadecimal string. - */ -util.DataBuffer.prototype.toHex = function() { - var rval = ''; - for(var i = this.read; i < this.data.byteLength; ++i) { - var b = this.data.getUint8(i); - if(b < 16) { - rval += '0'; - } - rval += b.toString(16); - } - return rval; -}; - -/** - * Converts this buffer to a string, using the given encoding. If no - * encoding is given, 'utf8' (UTF-8) is used. - * - * @param [encoding] the encoding to use: 'binary', 'utf8', 'utf16', 'hex', - * 'base64' (default: 'utf8'). - * - * @return a string representation of the bytes in this buffer. - */ -util.DataBuffer.prototype.toString = function(encoding) { - var view = new Uint8Array(this.data, this.read, this.length()); - encoding = encoding || 'utf8'; - - // encode to string - if(encoding === 'binary' || encoding === 'raw') { - return util.binary.raw.encode(view); - } - if(encoding === 'hex') { - return util.binary.hex.encode(view); - } - if(encoding === 'base64') { - return util.binary.base64.encode(view); - } - - // decode to text - if(encoding === 'utf8') { - return util.text.utf8.decode(view); - } - if(encoding === 'utf16') { - return util.text.utf16.decode(view); - } - - throw new Error('Invalid encoding: ' + encoding); -}; - -/** End Buffer w/UInt8Array backing */ - -/** - * Creates a buffer that stores bytes. A value may be given to populate the - * buffer with data. This value can either be string of encoded bytes or a - * regular string of characters. When passing a string of binary encoded - * bytes, the encoding `raw` should be given. This is also the default. When - * passing a string of characters, the encoding `utf8` should be given. - * - * @param [input] a string with encoded bytes to store in the buffer. - * @param [encoding] (default: 'raw', other: 'utf8'). - */ -util.createBuffer = function(input, encoding) { - // TODO: deprecate, use new ByteBuffer() instead - encoding = encoding || 'raw'; - if(input !== undefined && encoding === 'utf8') { - input = util.encodeUtf8(input); - } - return new util.ByteBuffer(input); -}; - -/** - * Fills a string with a particular value. If you want the string to be a byte - * string, pass in String.fromCharCode(theByte). - * - * @param c the character to fill the string with, use String.fromCharCode - * to fill the string with a byte value. - * @param n the number of characters of value c to fill with. - * - * @return the filled string. - */ -util.fillString = function(c, n) { - var s = ''; - while(n > 0) { - if(n & 1) { - s += c; - } - n >>>= 1; - if(n > 0) { - c += c; - } - } - return s; -}; - -/** - * Performs a per byte XOR between two byte strings and returns the result as a - * string of bytes. - * - * @param s1 first string of bytes. - * @param s2 second string of bytes. - * @param n the number of bytes to XOR. - * - * @return the XOR'd result. - */ -util.xorBytes = function(s1, s2, n) { - var s3 = ''; - var b = ''; - var t = ''; - var i = 0; - var c = 0; - for(; n > 0; --n, ++i) { - b = s1.charCodeAt(i) ^ s2.charCodeAt(i); - if(c >= 10) { - s3 += t; - t = ''; - c = 0; - } - t += String.fromCharCode(b); - ++c; - } - s3 += t; - return s3; -}; - -/** - * Converts a hex string into a 'binary' encoded string of bytes. - * - * @param hex the hexadecimal string to convert. - * - * @return the binary-encoded string of bytes. - */ -util.hexToBytes = function(hex) { - // TODO: deprecate: "Deprecated. Use util.binary.hex.decode instead." - var rval = ''; - var i = 0; - if(hex.length & 1 == 1) { - // odd number of characters, convert first character alone - i = 1; - rval += String.fromCharCode(parseInt(hex[0], 16)); - } - // convert 2 characters (1 byte) at a time - for(; i < hex.length; i += 2) { - rval += String.fromCharCode(parseInt(hex.substr(i, 2), 16)); - } - return rval; -}; - -/** - * Converts a 'binary' encoded string of bytes to hex. - * - * @param bytes the byte string to convert. - * - * @return the string of hexadecimal characters. - */ -util.bytesToHex = function(bytes) { - // TODO: deprecate: "Deprecated. Use util.binary.hex.encode instead." - return util.createBuffer(bytes).toHex(); -}; - -/** - * Converts an 32-bit integer to 4-big-endian byte string. - * - * @param i the integer. - * - * @return the byte string. - */ -util.int32ToBytes = function(i) { - return ( - String.fromCharCode(i >> 24 & 0xFF) + - String.fromCharCode(i >> 16 & 0xFF) + - String.fromCharCode(i >> 8 & 0xFF) + - String.fromCharCode(i & 0xFF)); -}; - -// base64 characters, reverse mapping -var _base64 = - 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='; -var _base64Idx = [ -/*43 -43 = 0*/ -/*'+', 1, 2, 3,'/' */ - 62, -1, -1, -1, 63, - -/*'0','1','2','3','4','5','6','7','8','9' */ - 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, - -/*15, 16, 17,'=', 19, 20, 21 */ - -1, -1, -1, 64, -1, -1, -1, - -/*65 - 43 = 22*/ -/*'A','B','C','D','E','F','G','H','I','J','K','L','M', */ - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, - -/*'N','O','P','Q','R','S','T','U','V','W','X','Y','Z' */ - 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, - -/*91 - 43 = 48 */ -/*48, 49, 50, 51, 52, 53 */ - -1, -1, -1, -1, -1, -1, - -/*97 - 43 = 54*/ -/*'a','b','c','d','e','f','g','h','i','j','k','l','m' */ - 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, - -/*'n','o','p','q','r','s','t','u','v','w','x','y','z' */ - 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51 -]; - -// base58 characters (Bitcoin alphabet) -var _base58 = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'; - -/** - * Base64 encodes a 'binary' encoded string of bytes. - * - * @param input the binary encoded string of bytes to base64-encode. - * @param maxline the maximum number of encoded characters per line to use, - * defaults to none. - * - * @return the base64-encoded output. - */ -util.encode64 = function(input, maxline) { - // TODO: deprecate: "Deprecated. Use util.binary.base64.encode instead." - var line = ''; - var output = ''; - var chr1, chr2, chr3; - var i = 0; - while(i < input.length) { - chr1 = input.charCodeAt(i++); - chr2 = input.charCodeAt(i++); - chr3 = input.charCodeAt(i++); - - // encode 4 character group - line += _base64.charAt(chr1 >> 2); - line += _base64.charAt(((chr1 & 3) << 4) | (chr2 >> 4)); - if(isNaN(chr2)) { - line += '=='; - } else { - line += _base64.charAt(((chr2 & 15) << 2) | (chr3 >> 6)); - line += isNaN(chr3) ? '=' : _base64.charAt(chr3 & 63); - } - - if(maxline && line.length > maxline) { - output += line.substr(0, maxline) + '\r\n'; - line = line.substr(maxline); - } - } - output += line; - return output; -}; - -/** - * Base64 decodes a string into a 'binary' encoded string of bytes. - * - * @param input the base64-encoded input. - * - * @return the binary encoded string. - */ -util.decode64 = function(input) { - // TODO: deprecate: "Deprecated. Use util.binary.base64.decode instead." - - // remove all non-base64 characters - input = input.replace(/[^A-Za-z0-9\+\/\=]/g, ''); - - var output = ''; - var enc1, enc2, enc3, enc4; - var i = 0; - - while(i < input.length) { - enc1 = _base64Idx[input.charCodeAt(i++) - 43]; - enc2 = _base64Idx[input.charCodeAt(i++) - 43]; - enc3 = _base64Idx[input.charCodeAt(i++) - 43]; - enc4 = _base64Idx[input.charCodeAt(i++) - 43]; - - output += String.fromCharCode((enc1 << 2) | (enc2 >> 4)); - if(enc3 !== 64) { - // decoded at least 2 bytes - output += String.fromCharCode(((enc2 & 15) << 4) | (enc3 >> 2)); - if(enc4 !== 64) { - // decoded 3 bytes - output += String.fromCharCode(((enc3 & 3) << 6) | enc4); - } - } - } - - return output; -}; - -/** - * Encodes the given string of characters (a standard JavaScript - * string) as a binary encoded string where the bytes represent - * a UTF-8 encoded string of characters. Non-ASCII characters will be - * encoded as multiple bytes according to UTF-8. - * - * @param str a standard string of characters to encode. - * - * @return the binary encoded string. - */ -util.encodeUtf8 = function(str) { - return unescape(encodeURIComponent(str)); -}; - -/** - * Decodes a binary encoded string that contains bytes that - * represent a UTF-8 encoded string of characters -- into a - * string of characters (a standard JavaScript string). - * - * @param str the binary encoded string to decode. - * - * @return the resulting standard string of characters. - */ -util.decodeUtf8 = function(str) { - return decodeURIComponent(escape(str)); -}; - -// binary encoding/decoding tools -// FIXME: Experimental. Do not use yet. -util.binary = { - raw: {}, - hex: {}, - base64: {}, - base58: {}, - baseN : { - encode: baseN.encode, - decode: baseN.decode - } -}; - -/** - * Encodes a Uint8Array as a binary-encoded string. This encoding uses - * a value between 0 and 255 for each character. - * - * @param bytes the Uint8Array to encode. - * - * @return the binary-encoded string. - */ -util.binary.raw.encode = function(bytes) { - return String.fromCharCode.apply(null, bytes); -}; - -/** - * Decodes a binary-encoded string to a Uint8Array. This encoding uses - * a value between 0 and 255 for each character. - * - * @param str the binary-encoded string to decode. - * @param [output] an optional Uint8Array to write the output to; if it - * is too small, an exception will be thrown. - * @param [offset] the start offset for writing to the output (default: 0). - * - * @return the Uint8Array or the number of bytes written if output was given. - */ -util.binary.raw.decode = function(str, output, offset) { - var out = output; - if(!out) { - out = new Uint8Array(str.length); - } - offset = offset || 0; - var j = offset; - for(var i = 0; i < str.length; ++i) { - out[j++] = str.charCodeAt(i); - } - return output ? (j - offset) : out; -}; - -/** - * Encodes a 'binary' string, ArrayBuffer, DataView, TypedArray, or - * ByteBuffer as a string of hexadecimal characters. - * - * @param bytes the bytes to convert. - * - * @return the string of hexadecimal characters. - */ -util.binary.hex.encode = util.bytesToHex; - -/** - * Decodes a hex-encoded string to a Uint8Array. - * - * @param hex the hexadecimal string to convert. - * @param [output] an optional Uint8Array to write the output to; if it - * is too small, an exception will be thrown. - * @param [offset] the start offset for writing to the output (default: 0). - * - * @return the Uint8Array or the number of bytes written if output was given. - */ -util.binary.hex.decode = function(hex, output, offset) { - var out = output; - if(!out) { - out = new Uint8Array(Math.ceil(hex.length / 2)); - } - offset = offset || 0; - var i = 0, j = offset; - if(hex.length & 1) { - // odd number of characters, convert first character alone - i = 1; - out[j++] = parseInt(hex[0], 16); - } - // convert 2 characters (1 byte) at a time - for(; i < hex.length; i += 2) { - out[j++] = parseInt(hex.substr(i, 2), 16); - } - return output ? (j - offset) : out; -}; - -/** - * Base64-encodes a Uint8Array. - * - * @param input the Uint8Array to encode. - * @param maxline the maximum number of encoded characters per line to use, - * defaults to none. - * - * @return the base64-encoded output string. - */ -util.binary.base64.encode = function(input, maxline) { - var line = ''; - var output = ''; - var chr1, chr2, chr3; - var i = 0; - while(i < input.byteLength) { - chr1 = input[i++]; - chr2 = input[i++]; - chr3 = input[i++]; - - // encode 4 character group - line += _base64.charAt(chr1 >> 2); - line += _base64.charAt(((chr1 & 3) << 4) | (chr2 >> 4)); - if(isNaN(chr2)) { - line += '=='; - } else { - line += _base64.charAt(((chr2 & 15) << 2) | (chr3 >> 6)); - line += isNaN(chr3) ? '=' : _base64.charAt(chr3 & 63); - } - - if(maxline && line.length > maxline) { - output += line.substr(0, maxline) + '\r\n'; - line = line.substr(maxline); - } - } - output += line; - return output; -}; - -/** - * Decodes a base64-encoded string to a Uint8Array. - * - * @param input the base64-encoded input string. - * @param [output] an optional Uint8Array to write the output to; if it - * is too small, an exception will be thrown. - * @param [offset] the start offset for writing to the output (default: 0). - * - * @return the Uint8Array or the number of bytes written if output was given. - */ -util.binary.base64.decode = function(input, output, offset) { - var out = output; - if(!out) { - out = new Uint8Array(Math.ceil(input.length / 4) * 3); - } - - // remove all non-base64 characters - input = input.replace(/[^A-Za-z0-9\+\/\=]/g, ''); - - offset = offset || 0; - var enc1, enc2, enc3, enc4; - var i = 0, j = offset; - - while(i < input.length) { - enc1 = _base64Idx[input.charCodeAt(i++) - 43]; - enc2 = _base64Idx[input.charCodeAt(i++) - 43]; - enc3 = _base64Idx[input.charCodeAt(i++) - 43]; - enc4 = _base64Idx[input.charCodeAt(i++) - 43]; - - out[j++] = (enc1 << 2) | (enc2 >> 4); - if(enc3 !== 64) { - // decoded at least 2 bytes - out[j++] = ((enc2 & 15) << 4) | (enc3 >> 2); - if(enc4 !== 64) { - // decoded 3 bytes - out[j++] = ((enc3 & 3) << 6) | enc4; - } - } - } - - // make sure result is the exact decoded length - return output ? (j - offset) : out.subarray(0, j); -}; - -// add support for base58 encoding/decoding with Bitcoin alphabet -util.binary.base58.encode = function(input, maxline) { - return util.binary.baseN.encode(input, _base58, maxline); -}; -util.binary.base58.decode = function(input, maxline) { - return util.binary.baseN.decode(input, _base58, maxline); -}; - -// text encoding/decoding tools -// FIXME: Experimental. Do not use yet. -util.text = { - utf8: {}, - utf16: {} -}; - -/** - * Encodes the given string as UTF-8 in a Uint8Array. - * - * @param str the string to encode. - * @param [output] an optional Uint8Array to write the output to; if it - * is too small, an exception will be thrown. - * @param [offset] the start offset for writing to the output (default: 0). - * - * @return the Uint8Array or the number of bytes written if output was given. - */ -util.text.utf8.encode = function(str, output, offset) { - str = util.encodeUtf8(str); - var out = output; - if(!out) { - out = new Uint8Array(str.length); - } - offset = offset || 0; - var j = offset; - for(var i = 0; i < str.length; ++i) { - out[j++] = str.charCodeAt(i); - } - return output ? (j - offset) : out; -}; - -/** - * Decodes the UTF-8 contents from a Uint8Array. - * - * @param bytes the Uint8Array to decode. - * - * @return the resulting string. - */ -util.text.utf8.decode = function(bytes) { - return util.decodeUtf8(String.fromCharCode.apply(null, bytes)); -}; - -/** - * Encodes the given string as UTF-16 in a Uint8Array. - * - * @param str the string to encode. - * @param [output] an optional Uint8Array to write the output to; if it - * is too small, an exception will be thrown. - * @param [offset] the start offset for writing to the output (default: 0). - * - * @return the Uint8Array or the number of bytes written if output was given. - */ -util.text.utf16.encode = function(str, output, offset) { - var out = output; - if(!out) { - out = new Uint8Array(str.length * 2); - } - var view = new Uint16Array(out.buffer); - offset = offset || 0; - var j = offset; - var k = offset; - for(var i = 0; i < str.length; ++i) { - view[k++] = str.charCodeAt(i); - j += 2; - } - return output ? (j - offset) : out; -}; - -/** - * Decodes the UTF-16 contents from a Uint8Array. - * - * @param bytes the Uint8Array to decode. - * - * @return the resulting string. - */ -util.text.utf16.decode = function(bytes) { - return String.fromCharCode.apply(null, new Uint16Array(bytes.buffer)); -}; - -/** - * Deflates the given data using a flash interface. - * - * @param api the flash interface. - * @param bytes the data. - * @param raw true to return only raw deflate data, false to include zlib - * header and trailer. - * - * @return the deflated data as a string. - */ -util.deflate = function(api, bytes, raw) { - bytes = util.decode64(api.deflate(util.encode64(bytes)).rval); - - // strip zlib header and trailer if necessary - if(raw) { - // zlib header is 2 bytes (CMF,FLG) where FLG indicates that - // there is a 4-byte DICT (alder-32) block before the data if - // its 5th bit is set - var start = 2; - var flg = bytes.charCodeAt(1); - if(flg & 0x20) { - start = 6; - } - // zlib trailer is 4 bytes of adler-32 - bytes = bytes.substring(start, bytes.length - 4); - } - - return bytes; -}; - -/** - * Inflates the given data using a flash interface. - * - * @param api the flash interface. - * @param bytes the data. - * @param raw true if the incoming data has no zlib header or trailer and is - * raw DEFLATE data. - * - * @return the inflated data as a string, null on error. - */ -util.inflate = function(api, bytes, raw) { - // TODO: add zlib header and trailer if necessary/possible - var rval = api.inflate(util.encode64(bytes)).rval; - return (rval === null) ? null : util.decode64(rval); -}; - -/** - * Sets a storage object. - * - * @param api the storage interface. - * @param id the storage ID to use. - * @param obj the storage object, null to remove. - */ -var _setStorageObject = function(api, id, obj) { - if(!api) { - throw new Error('WebStorage not available.'); - } - - var rval; - if(obj === null) { - rval = api.removeItem(id); - } else { - // json-encode and base64-encode object - obj = util.encode64(JSON.stringify(obj)); - rval = api.setItem(id, obj); - } - - // handle potential flash error - if(typeof(rval) !== 'undefined' && rval.rval !== true) { - var error = new Error(rval.error.message); - error.id = rval.error.id; - error.name = rval.error.name; - throw error; - } -}; - -/** - * Gets a storage object. - * - * @param api the storage interface. - * @param id the storage ID to use. - * - * @return the storage object entry or null if none exists. - */ -var _getStorageObject = function(api, id) { - if(!api) { - throw new Error('WebStorage not available.'); - } - - // get the existing entry - var rval = api.getItem(id); - - /* Note: We check api.init because we can't do (api == localStorage) - on IE because of "Class doesn't support Automation" exception. Only - the flash api has an init method so this works too, but we need a - better solution in the future. */ - - // flash returns item wrapped in an object, handle special case - if(api.init) { - if(rval.rval === null) { - if(rval.error) { - var error = new Error(rval.error.message); - error.id = rval.error.id; - error.name = rval.error.name; - throw error; - } - // no error, but also no item - rval = null; - } else { - rval = rval.rval; - } - } - - // handle decoding - if(rval !== null) { - // base64-decode and json-decode data - rval = JSON.parse(util.decode64(rval)); - } - - return rval; -}; - -/** - * Stores an item in local storage. - * - * @param api the storage interface. - * @param id the storage ID to use. - * @param key the key for the item. - * @param data the data for the item (any javascript object/primitive). - */ -var _setItem = function(api, id, key, data) { - // get storage object - var obj = _getStorageObject(api, id); - if(obj === null) { - // create a new storage object - obj = {}; - } - // update key - obj[key] = data; - - // set storage object - _setStorageObject(api, id, obj); -}; - -/** - * Gets an item from local storage. - * - * @param api the storage interface. - * @param id the storage ID to use. - * @param key the key for the item. - * - * @return the item. - */ -var _getItem = function(api, id, key) { - // get storage object - var rval = _getStorageObject(api, id); - if(rval !== null) { - // return data at key - rval = (key in rval) ? rval[key] : null; - } - - return rval; -}; - -/** - * Removes an item from local storage. - * - * @param api the storage interface. - * @param id the storage ID to use. - * @param key the key for the item. - */ -var _removeItem = function(api, id, key) { - // get storage object - var obj = _getStorageObject(api, id); - if(obj !== null && key in obj) { - // remove key - delete obj[key]; - - // see if entry has no keys remaining - var empty = true; - for(var prop in obj) { - empty = false; - break; - } - if(empty) { - // remove entry entirely if no keys are left - obj = null; - } - - // set storage object - _setStorageObject(api, id, obj); - } -}; - -/** - * Clears the local disk storage identified by the given ID. - * - * @param api the storage interface. - * @param id the storage ID to use. - */ -var _clearItems = function(api, id) { - _setStorageObject(api, id, null); -}; - -/** - * Calls a storage function. - * - * @param func the function to call. - * @param args the arguments for the function. - * @param location the location argument. - * - * @return the return value from the function. - */ -var _callStorageFunction = function(func, args, location) { - var rval = null; - - // default storage types - if(typeof(location) === 'undefined') { - location = ['web', 'flash']; - } - - // apply storage types in order of preference - var type; - var done = false; - var exception = null; - for(var idx in location) { - type = location[idx]; - try { - if(type === 'flash' || type === 'both') { - if(args[0] === null) { - throw new Error('Flash local storage not available.'); - } - rval = func.apply(this, args); - done = (type === 'flash'); - } - if(type === 'web' || type === 'both') { - args[0] = localStorage; - rval = func.apply(this, args); - done = true; - } - } catch(ex) { - exception = ex; - } - if(done) { - break; - } - } - - if(!done) { - throw exception; - } - - return rval; -}; - -/** - * Stores an item on local disk. - * - * The available types of local storage include 'flash', 'web', and 'both'. - * - * The type 'flash' refers to flash local storage (SharedObject). In order - * to use flash local storage, the 'api' parameter must be valid. The type - * 'web' refers to WebStorage, if supported by the browser. The type 'both' - * refers to storing using both 'flash' and 'web', not just one or the - * other. - * - * The location array should list the storage types to use in order of - * preference: - * - * ['flash']: flash only storage - * ['web']: web only storage - * ['both']: try to store in both - * ['flash','web']: store in flash first, but if not available, 'web' - * ['web','flash']: store in web first, but if not available, 'flash' - * - * The location array defaults to: ['web', 'flash'] - * - * @param api the flash interface, null to use only WebStorage. - * @param id the storage ID to use. - * @param key the key for the item. - * @param data the data for the item (any javascript object/primitive). - * @param location an array with the preferred types of storage to use. - */ -util.setItem = function(api, id, key, data, location) { - _callStorageFunction(_setItem, arguments, location); -}; - -/** - * Gets an item on local disk. - * - * Set setItem() for details on storage types. - * - * @param api the flash interface, null to use only WebStorage. - * @param id the storage ID to use. - * @param key the key for the item. - * @param location an array with the preferred types of storage to use. - * - * @return the item. - */ -util.getItem = function(api, id, key, location) { - return _callStorageFunction(_getItem, arguments, location); -}; - -/** - * Removes an item on local disk. - * - * Set setItem() for details on storage types. - * - * @param api the flash interface. - * @param id the storage ID to use. - * @param key the key for the item. - * @param location an array with the preferred types of storage to use. - */ -util.removeItem = function(api, id, key, location) { - _callStorageFunction(_removeItem, arguments, location); -}; - -/** - * Clears the local disk storage identified by the given ID. - * - * Set setItem() for details on storage types. - * - * @param api the flash interface if flash is available. - * @param id the storage ID to use. - * @param location an array with the preferred types of storage to use. - */ -util.clearItems = function(api, id, location) { - _callStorageFunction(_clearItems, arguments, location); -}; - -/** - * Check if an object is empty. - * - * Taken from: - * http://stackoverflow.com/questions/679915/how-do-i-test-for-an-empty-javascript-object-from-json/679937#679937 - * - * @param object the object to check. - */ -util.isEmpty = function(obj) { - for(var prop in obj) { - if(obj.hasOwnProperty(prop)) { - return false; - } - } - return true; -}; - -/** - * Format with simple printf-style interpolation. - * - * %%: literal '%' - * %s,%o: convert next argument into a string. - * - * @param format the string to format. - * @param ... arguments to interpolate into the format string. - */ -util.format = function(format) { - var re = /%./g; - // current match - var match; - // current part - var part; - // current arg index - var argi = 0; - // collected parts to recombine later - var parts = []; - // last index found - var last = 0; - // loop while matches remain - while((match = re.exec(format))) { - part = format.substring(last, re.lastIndex - 2); - // don't add empty strings (ie, parts between %s%s) - if(part.length > 0) { - parts.push(part); - } - last = re.lastIndex; - // switch on % code - var code = match[0][1]; - switch(code) { - case 's': - case 'o': - // check if enough arguments were given - if(argi < arguments.length) { - parts.push(arguments[argi++ + 1]); - } else { - parts.push(''); - } - break; - // FIXME: do proper formating for numbers, etc - //case 'f': - //case 'd': - case '%': - parts.push('%'); - break; - default: - parts.push('<%' + code + '?>'); - } - } - // add trailing part of format string - parts.push(format.substring(last)); - return parts.join(''); -}; - -/** - * Formats a number. - * - * http://snipplr.com/view/5945/javascript-numberformat--ported-from-php/ - */ -util.formatNumber = function(number, decimals, dec_point, thousands_sep) { - // http://kevin.vanzonneveld.net - // + original by: Jonas Raoni Soares Silva (http://www.jsfromhell.com) - // + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) - // + bugfix by: Michael White (http://crestidg.com) - // + bugfix by: Benjamin Lupton - // + bugfix by: Allan Jensen (http://www.winternet.no) - // + revised by: Jonas Raoni Soares Silva (http://www.jsfromhell.com) - // * example 1: number_format(1234.5678, 2, '.', ''); - // * returns 1: 1234.57 - - var n = number, c = isNaN(decimals = Math.abs(decimals)) ? 2 : decimals; - var d = dec_point === undefined ? ',' : dec_point; - var t = thousands_sep === undefined ? - '.' : thousands_sep, s = n < 0 ? '-' : ''; - var i = parseInt((n = Math.abs(+n || 0).toFixed(c)), 10) + ''; - var j = (i.length > 3) ? i.length % 3 : 0; - return s + (j ? i.substr(0, j) + t : '') + - i.substr(j).replace(/(\d{3})(?=\d)/g, '$1' + t) + - (c ? d + Math.abs(n - i).toFixed(c).slice(2) : ''); -}; - -/** - * Formats a byte size. - * - * http://snipplr.com/view/5949/format-humanize-file-byte-size-presentation-in-javascript/ - */ -util.formatSize = function(size) { - if(size >= 1073741824) { - size = util.formatNumber(size / 1073741824, 2, '.', '') + ' GiB'; - } else if(size >= 1048576) { - size = util.formatNumber(size / 1048576, 2, '.', '') + ' MiB'; - } else if(size >= 1024) { - size = util.formatNumber(size / 1024, 0) + ' KiB'; - } else { - size = util.formatNumber(size, 0) + ' bytes'; - } - return size; -}; - -/** - * Converts an IPv4 or IPv6 string representation into bytes (in network order). - * - * @param ip the IPv4 or IPv6 address to convert. - * - * @return the 4-byte IPv6 or 16-byte IPv6 address or null if the address can't - * be parsed. - */ -util.bytesFromIP = function(ip) { - if(ip.indexOf('.') !== -1) { - return util.bytesFromIPv4(ip); - } - if(ip.indexOf(':') !== -1) { - return util.bytesFromIPv6(ip); - } - return null; -}; - -/** - * Converts an IPv4 string representation into bytes (in network order). - * - * @param ip the IPv4 address to convert. - * - * @return the 4-byte address or null if the address can't be parsed. - */ -util.bytesFromIPv4 = function(ip) { - ip = ip.split('.'); - if(ip.length !== 4) { - return null; - } - var b = util.createBuffer(); - for(var i = 0; i < ip.length; ++i) { - var num = parseInt(ip[i], 10); - if(isNaN(num)) { - return null; - } - b.putByte(num); - } - return b.getBytes(); -}; - -/** - * Converts an IPv6 string representation into bytes (in network order). - * - * @param ip the IPv6 address to convert. - * - * @return the 16-byte address or null if the address can't be parsed. - */ -util.bytesFromIPv6 = function(ip) { - var blanks = 0; - ip = ip.split(':').filter(function(e) { - if(e.length === 0) ++blanks; - return true; - }); - var zeros = (8 - ip.length + blanks) * 2; - var b = util.createBuffer(); - for(var i = 0; i < 8; ++i) { - if(!ip[i] || ip[i].length === 0) { - b.fillWithByte(0, zeros); - zeros = 0; - continue; - } - var bytes = util.hexToBytes(ip[i]); - if(bytes.length < 2) { - b.putByte(0); - } - b.putBytes(bytes); - } - return b.getBytes(); -}; - -/** - * Converts 4-bytes into an IPv4 string representation or 16-bytes into - * an IPv6 string representation. The bytes must be in network order. - * - * @param bytes the bytes to convert. - * - * @return the IPv4 or IPv6 string representation if 4 or 16 bytes, - * respectively, are given, otherwise null. - */ -util.bytesToIP = function(bytes) { - if(bytes.length === 4) { - return util.bytesToIPv4(bytes); - } - if(bytes.length === 16) { - return util.bytesToIPv6(bytes); - } - return null; -}; - -/** - * Converts 4-bytes into an IPv4 string representation. The bytes must be - * in network order. - * - * @param bytes the bytes to convert. - * - * @return the IPv4 string representation or null for an invalid # of bytes. - */ -util.bytesToIPv4 = function(bytes) { - if(bytes.length !== 4) { - return null; - } - var ip = []; - for(var i = 0; i < bytes.length; ++i) { - ip.push(bytes.charCodeAt(i)); - } - return ip.join('.'); -}; - -/** - * Converts 16-bytes into an IPv16 string representation. The bytes must be - * in network order. - * - * @param bytes the bytes to convert. - * - * @return the IPv16 string representation or null for an invalid # of bytes. - */ -util.bytesToIPv6 = function(bytes) { - if(bytes.length !== 16) { - return null; - } - var ip = []; - var zeroGroups = []; - var zeroMaxGroup = 0; - for(var i = 0; i < bytes.length; i += 2) { - var hex = util.bytesToHex(bytes[i] + bytes[i + 1]); - // canonicalize zero representation - while(hex[0] === '0' && hex !== '0') { - hex = hex.substr(1); - } - if(hex === '0') { - var last = zeroGroups[zeroGroups.length - 1]; - var idx = ip.length; - if(!last || idx !== last.end + 1) { - zeroGroups.push({start: idx, end: idx}); - } else { - last.end = idx; - if((last.end - last.start) > - (zeroGroups[zeroMaxGroup].end - zeroGroups[zeroMaxGroup].start)) { - zeroMaxGroup = zeroGroups.length - 1; - } - } - } - ip.push(hex); - } - if(zeroGroups.length > 0) { - var group = zeroGroups[zeroMaxGroup]; - // only shorten group of length > 0 - if(group.end - group.start > 0) { - ip.splice(group.start, group.end - group.start + 1, ''); - if(group.start === 0) { - ip.unshift(''); - } - if(group.end === 7) { - ip.push(''); - } - } - } - return ip.join(':'); -}; - -/** - * Estimates the number of processes that can be run concurrently. If - * creating Web Workers, keep in mind that the main JavaScript process needs - * its own core. - * - * @param options the options to use: - * update true to force an update (not use the cached value). - * @param callback(err, max) called once the operation completes. - */ -util.estimateCores = function(options, callback) { - if(typeof options === 'function') { - callback = options; - options = {}; - } - options = options || {}; - if('cores' in util && !options.update) { - return callback(null, util.cores); - } - if(typeof navigator !== 'undefined' && - 'hardwareConcurrency' in navigator && - navigator.hardwareConcurrency > 0) { - util.cores = navigator.hardwareConcurrency; - return callback(null, util.cores); - } - if(typeof Worker === 'undefined') { - // workers not available - util.cores = 1; - return callback(null, util.cores); - } - if(typeof Blob === 'undefined') { - // can't estimate, default to 2 - util.cores = 2; - return callback(null, util.cores); - } - - // create worker concurrency estimation code as blob - var blobUrl = URL.createObjectURL(new Blob(['(', - function() { - self.addEventListener('message', function(e) { - // run worker for 4 ms - var st = Date.now(); - var et = st + 4; - while(Date.now() < et); - self.postMessage({st: st, et: et}); - }); - }.toString(), - ')()'], {type: 'application/javascript'})); - - // take 5 samples using 16 workers - sample([], 5, 16); - - function sample(max, samples, numWorkers) { - if(samples === 0) { - // get overlap average - var avg = Math.floor(max.reduce(function(avg, x) { - return avg + x; - }, 0) / max.length); - util.cores = Math.max(1, avg); - URL.revokeObjectURL(blobUrl); - return callback(null, util.cores); - } - map(numWorkers, function(err, results) { - max.push(reduce(numWorkers, results)); - sample(max, samples - 1, numWorkers); - }); - } - - function map(numWorkers, callback) { - var workers = []; - var results = []; - for(var i = 0; i < numWorkers; ++i) { - var worker = new Worker(blobUrl); - worker.addEventListener('message', function(e) { - results.push(e.data); - if(results.length === numWorkers) { - for(var i = 0; i < numWorkers; ++i) { - workers[i].terminate(); - } - callback(null, results); - } - }); - workers.push(worker); - } - for(var i = 0; i < numWorkers; ++i) { - workers[i].postMessage(i); - } - } - - function reduce(numWorkers, results) { - // find overlapping time windows - var overlaps = []; - for(var n = 0; n < numWorkers; ++n) { - var r1 = results[n]; - var overlap = overlaps[n] = []; - for(var i = 0; i < numWorkers; ++i) { - if(n === i) { - continue; - } - var r2 = results[i]; - if((r1.st > r2.st && r1.st < r2.et) || - (r2.st > r1.st && r2.st < r1.et)) { - overlap.push(i); - } - } - } - // get maximum overlaps ... don't include overlapping worker itself - // as the main JS process was also being scheduled during the work and - // would have to be subtracted from the estimate anyway - return overlaps.reduce(function(max, overlap) { - return Math.max(max, overlap.length); - }, 0); - } -}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/x509.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/x509.js deleted file mode 100644 index 2877810c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/x509.js +++ /dev/null @@ -1,3242 +0,0 @@ -/** - * Javascript implementation of X.509 and related components (such as - * Certification Signing Requests) of a Public Key Infrastructure. - * - * @author Dave Longley - * - * Copyright (c) 2010-2014 Digital Bazaar, Inc. - * - * The ASN.1 representation of an X.509v3 certificate is as follows - * (see RFC 2459): - * - * Certificate ::= SEQUENCE { - * tbsCertificate TBSCertificate, - * signatureAlgorithm AlgorithmIdentifier, - * signatureValue BIT STRING - * } - * - * TBSCertificate ::= SEQUENCE { - * version [0] EXPLICIT Version DEFAULT v1, - * serialNumber CertificateSerialNumber, - * signature AlgorithmIdentifier, - * issuer Name, - * validity Validity, - * subject Name, - * subjectPublicKeyInfo SubjectPublicKeyInfo, - * issuerUniqueID [1] IMPLICIT UniqueIdentifier OPTIONAL, - * -- If present, version shall be v2 or v3 - * subjectUniqueID [2] IMPLICIT UniqueIdentifier OPTIONAL, - * -- If present, version shall be v2 or v3 - * extensions [3] EXPLICIT Extensions OPTIONAL - * -- If present, version shall be v3 - * } - * - * Version ::= INTEGER { v1(0), v2(1), v3(2) } - * - * CertificateSerialNumber ::= INTEGER - * - * Name ::= CHOICE { - * // only one possible choice for now - * RDNSequence - * } - * - * RDNSequence ::= SEQUENCE OF RelativeDistinguishedName - * - * RelativeDistinguishedName ::= SET OF AttributeTypeAndValue - * - * AttributeTypeAndValue ::= SEQUENCE { - * type AttributeType, - * value AttributeValue - * } - * AttributeType ::= OBJECT IDENTIFIER - * AttributeValue ::= ANY DEFINED BY AttributeType - * - * Validity ::= SEQUENCE { - * notBefore Time, - * notAfter Time - * } - * - * Time ::= CHOICE { - * utcTime UTCTime, - * generalTime GeneralizedTime - * } - * - * UniqueIdentifier ::= BIT STRING - * - * SubjectPublicKeyInfo ::= SEQUENCE { - * algorithm AlgorithmIdentifier, - * subjectPublicKey BIT STRING - * } - * - * Extensions ::= SEQUENCE SIZE (1..MAX) OF Extension - * - * Extension ::= SEQUENCE { - * extnID OBJECT IDENTIFIER, - * critical BOOLEAN DEFAULT FALSE, - * extnValue OCTET STRING - * } - * - * The only key algorithm currently supported for PKI is RSA. - * - * RSASSA-PSS signatures are described in RFC 3447 and RFC 4055. - * - * PKCS#10 v1.7 describes certificate signing requests: - * - * CertificationRequestInfo: - * - * CertificationRequestInfo ::= SEQUENCE { - * version INTEGER { v1(0) } (v1,...), - * subject Name, - * subjectPKInfo SubjectPublicKeyInfo{{ PKInfoAlgorithms }}, - * attributes [0] Attributes{{ CRIAttributes }} - * } - * - * Attributes { ATTRIBUTE:IOSet } ::= SET OF Attribute{{ IOSet }} - * - * CRIAttributes ATTRIBUTE ::= { - * ... -- add any locally defined attributes here -- } - * - * Attribute { ATTRIBUTE:IOSet } ::= SEQUENCE { - * type ATTRIBUTE.&id({IOSet}), - * values SET SIZE(1..MAX) OF ATTRIBUTE.&Type({IOSet}{@type}) - * } - * - * CertificationRequest ::= SEQUENCE { - * certificationRequestInfo CertificationRequestInfo, - * signatureAlgorithm AlgorithmIdentifier{{ SignatureAlgorithms }}, - * signature BIT STRING - * } - */ -var forge = require('./forge'); -require('./aes'); -require('./asn1'); -require('./des'); -require('./md'); -require('./mgf'); -require('./oids'); -require('./pem'); -require('./pss'); -require('./rsa'); -require('./util'); - -// shortcut for asn.1 API -var asn1 = forge.asn1; - -/* Public Key Infrastructure (PKI) implementation. */ -var pki = module.exports = forge.pki = forge.pki || {}; -var oids = pki.oids; - -// short name OID mappings -var _shortNames = {}; -_shortNames['CN'] = oids['commonName']; -_shortNames['commonName'] = 'CN'; -_shortNames['C'] = oids['countryName']; -_shortNames['countryName'] = 'C'; -_shortNames['L'] = oids['localityName']; -_shortNames['localityName'] = 'L'; -_shortNames['ST'] = oids['stateOrProvinceName']; -_shortNames['stateOrProvinceName'] = 'ST'; -_shortNames['O'] = oids['organizationName']; -_shortNames['organizationName'] = 'O'; -_shortNames['OU'] = oids['organizationalUnitName']; -_shortNames['organizationalUnitName'] = 'OU'; -_shortNames['E'] = oids['emailAddress']; -_shortNames['emailAddress'] = 'E'; - -// validator for an SubjectPublicKeyInfo structure -// Note: Currently only works with an RSA public key -var publicKeyValidator = forge.pki.rsa.publicKeyValidator; - -// validator for an X.509v3 certificate -var x509CertificateValidator = { - name: 'Certificate', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - value: [{ - name: 'Certificate.TBSCertificate', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - captureAsn1: 'tbsCertificate', - value: [{ - name: 'Certificate.TBSCertificate.version', - tagClass: asn1.Class.CONTEXT_SPECIFIC, - type: 0, - constructed: true, - optional: true, - value: [{ - name: 'Certificate.TBSCertificate.version.integer', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.INTEGER, - constructed: false, - capture: 'certVersion' - }] - }, { - name: 'Certificate.TBSCertificate.serialNumber', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.INTEGER, - constructed: false, - capture: 'certSerialNumber' - }, { - name: 'Certificate.TBSCertificate.signature', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - value: [{ - name: 'Certificate.TBSCertificate.signature.algorithm', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.OID, - constructed: false, - capture: 'certinfoSignatureOid' - }, { - name: 'Certificate.TBSCertificate.signature.parameters', - tagClass: asn1.Class.UNIVERSAL, - optional: true, - captureAsn1: 'certinfoSignatureParams' - }] - }, { - name: 'Certificate.TBSCertificate.issuer', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - captureAsn1: 'certIssuer' - }, { - name: 'Certificate.TBSCertificate.validity', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - // Note: UTC and generalized times may both appear so the capture - // names are based on their detected order, the names used below - // are only for the common case, which validity time really means - // "notBefore" and which means "notAfter" will be determined by order - value: [{ - // notBefore (Time) (UTC time case) - name: 'Certificate.TBSCertificate.validity.notBefore (utc)', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.UTCTIME, - constructed: false, - optional: true, - capture: 'certValidity1UTCTime' - }, { - // notBefore (Time) (generalized time case) - name: 'Certificate.TBSCertificate.validity.notBefore (generalized)', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.GENERALIZEDTIME, - constructed: false, - optional: true, - capture: 'certValidity2GeneralizedTime' - }, { - // notAfter (Time) (only UTC time is supported) - name: 'Certificate.TBSCertificate.validity.notAfter (utc)', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.UTCTIME, - constructed: false, - optional: true, - capture: 'certValidity3UTCTime' - }, { - // notAfter (Time) (only UTC time is supported) - name: 'Certificate.TBSCertificate.validity.notAfter (generalized)', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.GENERALIZEDTIME, - constructed: false, - optional: true, - capture: 'certValidity4GeneralizedTime' - }] - }, { - // Name (subject) (RDNSequence) - name: 'Certificate.TBSCertificate.subject', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - captureAsn1: 'certSubject' - }, - // SubjectPublicKeyInfo - publicKeyValidator, - { - // issuerUniqueID (optional) - name: 'Certificate.TBSCertificate.issuerUniqueID', - tagClass: asn1.Class.CONTEXT_SPECIFIC, - type: 1, - constructed: true, - optional: true, - value: [{ - name: 'Certificate.TBSCertificate.issuerUniqueID.id', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.BITSTRING, - constructed: false, - // TODO: support arbitrary bit length ids - captureBitStringValue: 'certIssuerUniqueId' - }] - }, { - // subjectUniqueID (optional) - name: 'Certificate.TBSCertificate.subjectUniqueID', - tagClass: asn1.Class.CONTEXT_SPECIFIC, - type: 2, - constructed: true, - optional: true, - value: [{ - name: 'Certificate.TBSCertificate.subjectUniqueID.id', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.BITSTRING, - constructed: false, - // TODO: support arbitrary bit length ids - captureBitStringValue: 'certSubjectUniqueId' - }] - }, { - // Extensions (optional) - name: 'Certificate.TBSCertificate.extensions', - tagClass: asn1.Class.CONTEXT_SPECIFIC, - type: 3, - constructed: true, - captureAsn1: 'certExtensions', - optional: true - }] - }, { - // AlgorithmIdentifier (signature algorithm) - name: 'Certificate.signatureAlgorithm', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - value: [{ - // algorithm - name: 'Certificate.signatureAlgorithm.algorithm', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.OID, - constructed: false, - capture: 'certSignatureOid' - }, { - name: 'Certificate.TBSCertificate.signature.parameters', - tagClass: asn1.Class.UNIVERSAL, - optional: true, - captureAsn1: 'certSignatureParams' - }] - }, { - // SignatureValue - name: 'Certificate.signatureValue', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.BITSTRING, - constructed: false, - captureBitStringValue: 'certSignature' - }] -}; - -var rsassaPssParameterValidator = { - name: 'rsapss', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - value: [{ - name: 'rsapss.hashAlgorithm', - tagClass: asn1.Class.CONTEXT_SPECIFIC, - type: 0, - constructed: true, - value: [{ - name: 'rsapss.hashAlgorithm.AlgorithmIdentifier', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Class.SEQUENCE, - constructed: true, - optional: true, - value: [{ - name: 'rsapss.hashAlgorithm.AlgorithmIdentifier.algorithm', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.OID, - constructed: false, - capture: 'hashOid' - /* parameter block omitted, for SHA1 NULL anyhow. */ - }] - }] - }, { - name: 'rsapss.maskGenAlgorithm', - tagClass: asn1.Class.CONTEXT_SPECIFIC, - type: 1, - constructed: true, - value: [{ - name: 'rsapss.maskGenAlgorithm.AlgorithmIdentifier', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Class.SEQUENCE, - constructed: true, - optional: true, - value: [{ - name: 'rsapss.maskGenAlgorithm.AlgorithmIdentifier.algorithm', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.OID, - constructed: false, - capture: 'maskGenOid' - }, { - name: 'rsapss.maskGenAlgorithm.AlgorithmIdentifier.params', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - value: [{ - name: 'rsapss.maskGenAlgorithm.AlgorithmIdentifier.params.algorithm', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.OID, - constructed: false, - capture: 'maskGenHashOid' - /* parameter block omitted, for SHA1 NULL anyhow. */ - }] - }] - }] - }, { - name: 'rsapss.saltLength', - tagClass: asn1.Class.CONTEXT_SPECIFIC, - type: 2, - optional: true, - value: [{ - name: 'rsapss.saltLength.saltLength', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Class.INTEGER, - constructed: false, - capture: 'saltLength' - }] - }, { - name: 'rsapss.trailerField', - tagClass: asn1.Class.CONTEXT_SPECIFIC, - type: 3, - optional: true, - value: [{ - name: 'rsapss.trailer.trailer', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Class.INTEGER, - constructed: false, - capture: 'trailer' - }] - }] -}; - -// validator for a CertificationRequestInfo structure -var certificationRequestInfoValidator = { - name: 'CertificationRequestInfo', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - captureAsn1: 'certificationRequestInfo', - value: [{ - name: 'CertificationRequestInfo.integer', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.INTEGER, - constructed: false, - capture: 'certificationRequestInfoVersion' - }, { - // Name (subject) (RDNSequence) - name: 'CertificationRequestInfo.subject', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - captureAsn1: 'certificationRequestInfoSubject' - }, - // SubjectPublicKeyInfo - publicKeyValidator, - { - name: 'CertificationRequestInfo.attributes', - tagClass: asn1.Class.CONTEXT_SPECIFIC, - type: 0, - constructed: true, - optional: true, - capture: 'certificationRequestInfoAttributes', - value: [{ - name: 'CertificationRequestInfo.attributes', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - value: [{ - name: 'CertificationRequestInfo.attributes.type', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.OID, - constructed: false - }, { - name: 'CertificationRequestInfo.attributes.value', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SET, - constructed: true - }] - }] - }] -}; - -// validator for a CertificationRequest structure -var certificationRequestValidator = { - name: 'CertificationRequest', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - captureAsn1: 'csr', - value: [ - certificationRequestInfoValidator, { - // AlgorithmIdentifier (signature algorithm) - name: 'CertificationRequest.signatureAlgorithm', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - value: [{ - // algorithm - name: 'CertificationRequest.signatureAlgorithm.algorithm', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.OID, - constructed: false, - capture: 'csrSignatureOid' - }, { - name: 'CertificationRequest.signatureAlgorithm.parameters', - tagClass: asn1.Class.UNIVERSAL, - optional: true, - captureAsn1: 'csrSignatureParams' - }] - }, { - // signature - name: 'CertificationRequest.signature', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.BITSTRING, - constructed: false, - captureBitStringValue: 'csrSignature' - } - ] -}; - -/** - * Converts an RDNSequence of ASN.1 DER-encoded RelativeDistinguishedName - * sets into an array with objects that have type and value properties. - * - * @param rdn the RDNSequence to convert. - * @param md a message digest to append type and value to if provided. - */ -pki.RDNAttributesAsArray = function(rdn, md) { - var rval = []; - - // each value in 'rdn' in is a SET of RelativeDistinguishedName - var set, attr, obj; - for(var si = 0; si < rdn.value.length; ++si) { - // get the RelativeDistinguishedName set - set = rdn.value[si]; - - // each value in the SET is an AttributeTypeAndValue sequence - // containing first a type (an OID) and second a value (defined by - // the OID) - for(var i = 0; i < set.value.length; ++i) { - obj = {}; - attr = set.value[i]; - obj.type = asn1.derToOid(attr.value[0].value); - obj.value = attr.value[1].value; - obj.valueTagClass = attr.value[1].type; - // if the OID is known, get its name and short name - if(obj.type in oids) { - obj.name = oids[obj.type]; - if(obj.name in _shortNames) { - obj.shortName = _shortNames[obj.name]; - } - } - if(md) { - md.update(obj.type); - md.update(obj.value); - } - rval.push(obj); - } - } - - return rval; -}; - -/** - * Converts ASN.1 CRIAttributes into an array with objects that have type and - * value properties. - * - * @param attributes the CRIAttributes to convert. - */ -pki.CRIAttributesAsArray = function(attributes) { - var rval = []; - - // each value in 'attributes' in is a SEQUENCE with an OID and a SET - for(var si = 0; si < attributes.length; ++si) { - // get the attribute sequence - var seq = attributes[si]; - - // each value in the SEQUENCE containing first a type (an OID) and - // second a set of values (defined by the OID) - var type = asn1.derToOid(seq.value[0].value); - var values = seq.value[1].value; - for(var vi = 0; vi < values.length; ++vi) { - var obj = {}; - obj.type = type; - obj.value = values[vi].value; - obj.valueTagClass = values[vi].type; - // if the OID is known, get its name and short name - if(obj.type in oids) { - obj.name = oids[obj.type]; - if(obj.name in _shortNames) { - obj.shortName = _shortNames[obj.name]; - } - } - // parse extensions - if(obj.type === oids.extensionRequest) { - obj.extensions = []; - for(var ei = 0; ei < obj.value.length; ++ei) { - obj.extensions.push(pki.certificateExtensionFromAsn1(obj.value[ei])); - } - } - rval.push(obj); - } - } - - return rval; -}; - -/** - * Gets an issuer or subject attribute from its name, type, or short name. - * - * @param obj the issuer or subject object. - * @param options a short name string or an object with: - * shortName the short name for the attribute. - * name the name for the attribute. - * type the type for the attribute. - * - * @return the attribute. - */ -function _getAttribute(obj, options) { - if(typeof options === 'string') { - options = {shortName: options}; - } - - var rval = null; - var attr; - for(var i = 0; rval === null && i < obj.attributes.length; ++i) { - attr = obj.attributes[i]; - if(options.type && options.type === attr.type) { - rval = attr; - } else if(options.name && options.name === attr.name) { - rval = attr; - } else if(options.shortName && options.shortName === attr.shortName) { - rval = attr; - } - } - return rval; -} - -/** - * Converts signature parameters from ASN.1 structure. - * - * Currently only RSASSA-PSS supported. The PKCS#1 v1.5 signature scheme had - * no parameters. - * - * RSASSA-PSS-params ::= SEQUENCE { - * hashAlgorithm [0] HashAlgorithm DEFAULT - * sha1Identifier, - * maskGenAlgorithm [1] MaskGenAlgorithm DEFAULT - * mgf1SHA1Identifier, - * saltLength [2] INTEGER DEFAULT 20, - * trailerField [3] INTEGER DEFAULT 1 - * } - * - * HashAlgorithm ::= AlgorithmIdentifier - * - * MaskGenAlgorithm ::= AlgorithmIdentifier - * - * AlgorithmIdentifer ::= SEQUENCE { - * algorithm OBJECT IDENTIFIER, - * parameters ANY DEFINED BY algorithm OPTIONAL - * } - * - * @param oid The OID specifying the signature algorithm - * @param obj The ASN.1 structure holding the parameters - * @param fillDefaults Whether to use return default values where omitted - * @return signature parameter object - */ -var _readSignatureParameters = function(oid, obj, fillDefaults) { - var params = {}; - - if(oid !== oids['RSASSA-PSS']) { - return params; - } - - if(fillDefaults) { - params = { - hash: { - algorithmOid: oids['sha1'] - }, - mgf: { - algorithmOid: oids['mgf1'], - hash: { - algorithmOid: oids['sha1'] - } - }, - saltLength: 20 - }; - } - - var capture = {}; - var errors = []; - if(!asn1.validate(obj, rsassaPssParameterValidator, capture, errors)) { - var error = new Error('Cannot read RSASSA-PSS parameter block.'); - error.errors = errors; - throw error; - } - - if(capture.hashOid !== undefined) { - params.hash = params.hash || {}; - params.hash.algorithmOid = asn1.derToOid(capture.hashOid); - } - - if(capture.maskGenOid !== undefined) { - params.mgf = params.mgf || {}; - params.mgf.algorithmOid = asn1.derToOid(capture.maskGenOid); - params.mgf.hash = params.mgf.hash || {}; - params.mgf.hash.algorithmOid = asn1.derToOid(capture.maskGenHashOid); - } - - if(capture.saltLength !== undefined) { - params.saltLength = capture.saltLength.charCodeAt(0); - } - - return params; -}; - -/** - * Create signature digest for OID. - * - * @param options - * signatureOid: the OID specifying the signature algorithm. - * type: a human readable type for error messages - * @return a created md instance. throws if unknown oid. - */ -var _createSignatureDigest = function(options) { - switch(oids[options.signatureOid]) { - case 'sha1WithRSAEncryption': - // deprecated alias - case 'sha1WithRSASignature': - return forge.md.sha1.create(); - case 'md5WithRSAEncryption': - return forge.md.md5.create(); - case 'sha256WithRSAEncryption': - return forge.md.sha256.create(); - case 'sha384WithRSAEncryption': - return forge.md.sha384.create(); - case 'sha512WithRSAEncryption': - return forge.md.sha512.create(); - case 'RSASSA-PSS': - return forge.md.sha256.create(); - default: - var error = new Error( - 'Could not compute ' + options.type + ' digest. ' + - 'Unknown signature OID.'); - error.signatureOid = options.signatureOid; - throw error; - } -}; - -/** - * Verify signature on certificate or CSR. - * - * @param options: - * certificate the certificate or CSR to verify. - * md the signature digest. - * signature the signature - * @return a created md instance. throws if unknown oid. - */ -var _verifySignature = function(options) { - var cert = options.certificate; - var scheme; - - switch(cert.signatureOid) { - case oids.sha1WithRSAEncryption: - // deprecated alias - case oids.sha1WithRSASignature: - /* use PKCS#1 v1.5 padding scheme */ - break; - case oids['RSASSA-PSS']: - var hash, mgf; - - /* initialize mgf */ - hash = oids[cert.signatureParameters.mgf.hash.algorithmOid]; - if(hash === undefined || forge.md[hash] === undefined) { - var error = new Error('Unsupported MGF hash function.'); - error.oid = cert.signatureParameters.mgf.hash.algorithmOid; - error.name = hash; - throw error; - } - - mgf = oids[cert.signatureParameters.mgf.algorithmOid]; - if(mgf === undefined || forge.mgf[mgf] === undefined) { - var error = new Error('Unsupported MGF function.'); - error.oid = cert.signatureParameters.mgf.algorithmOid; - error.name = mgf; - throw error; - } - - mgf = forge.mgf[mgf].create(forge.md[hash].create()); - - /* initialize hash function */ - hash = oids[cert.signatureParameters.hash.algorithmOid]; - if(hash === undefined || forge.md[hash] === undefined) { - var error = new Error('Unsupported RSASSA-PSS hash function.'); - error.oid = cert.signatureParameters.hash.algorithmOid; - error.name = hash; - throw error; - } - - scheme = forge.pss.create( - forge.md[hash].create(), mgf, cert.signatureParameters.saltLength - ); - break; - } - - // verify signature on cert using public key - return cert.publicKey.verify( - options.md.digest().getBytes(), options.signature, scheme - ); -}; - -/** - * Converts an X.509 certificate from PEM format. - * - * Note: If the certificate is to be verified then compute hash should - * be set to true. This will scan the TBSCertificate part of the ASN.1 - * object while it is converted so it doesn't need to be converted back - * to ASN.1-DER-encoding later. - * - * @param pem the PEM-formatted certificate. - * @param computeHash true to compute the hash for verification. - * @param strict true to be strict when checking ASN.1 value lengths, false to - * allow truncated values (default: true). - * - * @return the certificate. - */ -pki.certificateFromPem = function(pem, computeHash, strict) { - var msg = forge.pem.decode(pem)[0]; - - if(msg.type !== 'CERTIFICATE' && - msg.type !== 'X509 CERTIFICATE' && - msg.type !== 'TRUSTED CERTIFICATE') { - var error = new Error( - 'Could not convert certificate from PEM; PEM header type ' + - 'is not "CERTIFICATE", "X509 CERTIFICATE", or "TRUSTED CERTIFICATE".'); - error.headerType = msg.type; - throw error; - } - if(msg.procType && msg.procType.type === 'ENCRYPTED') { - throw new Error( - 'Could not convert certificate from PEM; PEM is encrypted.'); - } - - // convert DER to ASN.1 object - var obj = asn1.fromDer(msg.body, strict); - - return pki.certificateFromAsn1(obj, computeHash); -}; - -/** - * Converts an X.509 certificate to PEM format. - * - * @param cert the certificate. - * @param maxline the maximum characters per line, defaults to 64. - * - * @return the PEM-formatted certificate. - */ -pki.certificateToPem = function(cert, maxline) { - // convert to ASN.1, then DER, then PEM-encode - var msg = { - type: 'CERTIFICATE', - body: asn1.toDer(pki.certificateToAsn1(cert)).getBytes() - }; - return forge.pem.encode(msg, {maxline: maxline}); -}; - -/** - * Converts an RSA public key from PEM format. - * - * @param pem the PEM-formatted public key. - * - * @return the public key. - */ -pki.publicKeyFromPem = function(pem) { - var msg = forge.pem.decode(pem)[0]; - - if(msg.type !== 'PUBLIC KEY' && msg.type !== 'RSA PUBLIC KEY') { - var error = new Error('Could not convert public key from PEM; PEM header ' + - 'type is not "PUBLIC KEY" or "RSA PUBLIC KEY".'); - error.headerType = msg.type; - throw error; - } - if(msg.procType && msg.procType.type === 'ENCRYPTED') { - throw new Error('Could not convert public key from PEM; PEM is encrypted.'); - } - - // convert DER to ASN.1 object - var obj = asn1.fromDer(msg.body); - - return pki.publicKeyFromAsn1(obj); -}; - -/** - * Converts an RSA public key to PEM format (using a SubjectPublicKeyInfo). - * - * @param key the public key. - * @param maxline the maximum characters per line, defaults to 64. - * - * @return the PEM-formatted public key. - */ -pki.publicKeyToPem = function(key, maxline) { - // convert to ASN.1, then DER, then PEM-encode - var msg = { - type: 'PUBLIC KEY', - body: asn1.toDer(pki.publicKeyToAsn1(key)).getBytes() - }; - return forge.pem.encode(msg, {maxline: maxline}); -}; - -/** - * Converts an RSA public key to PEM format (using an RSAPublicKey). - * - * @param key the public key. - * @param maxline the maximum characters per line, defaults to 64. - * - * @return the PEM-formatted public key. - */ -pki.publicKeyToRSAPublicKeyPem = function(key, maxline) { - // convert to ASN.1, then DER, then PEM-encode - var msg = { - type: 'RSA PUBLIC KEY', - body: asn1.toDer(pki.publicKeyToRSAPublicKey(key)).getBytes() - }; - return forge.pem.encode(msg, {maxline: maxline}); -}; - -/** - * Gets a fingerprint for the given public key. - * - * @param options the options to use. - * [md] the message digest object to use (defaults to forge.md.sha1). - * [type] the type of fingerprint, such as 'RSAPublicKey', - * 'SubjectPublicKeyInfo' (defaults to 'RSAPublicKey'). - * [encoding] an alternative output encoding, such as 'hex' - * (defaults to none, outputs a byte buffer). - * [delimiter] the delimiter to use between bytes for 'hex' encoded - * output, eg: ':' (defaults to none). - * - * @return the fingerprint as a byte buffer or other encoding based on options. - */ -pki.getPublicKeyFingerprint = function(key, options) { - options = options || {}; - var md = options.md || forge.md.sha1.create(); - var type = options.type || 'RSAPublicKey'; - - var bytes; - switch(type) { - case 'RSAPublicKey': - bytes = asn1.toDer(pki.publicKeyToRSAPublicKey(key)).getBytes(); - break; - case 'SubjectPublicKeyInfo': - bytes = asn1.toDer(pki.publicKeyToAsn1(key)).getBytes(); - break; - default: - throw new Error('Unknown fingerprint type "' + options.type + '".'); - } - - // hash public key bytes - md.start(); - md.update(bytes); - var digest = md.digest(); - if(options.encoding === 'hex') { - var hex = digest.toHex(); - if(options.delimiter) { - return hex.match(/.{2}/g).join(options.delimiter); - } - return hex; - } else if(options.encoding === 'binary') { - return digest.getBytes(); - } else if(options.encoding) { - throw new Error('Unknown encoding "' + options.encoding + '".'); - } - return digest; -}; - -/** - * Converts a PKCS#10 certification request (CSR) from PEM format. - * - * Note: If the certification request is to be verified then compute hash - * should be set to true. This will scan the CertificationRequestInfo part of - * the ASN.1 object while it is converted so it doesn't need to be converted - * back to ASN.1-DER-encoding later. - * - * @param pem the PEM-formatted certificate. - * @param computeHash true to compute the hash for verification. - * @param strict true to be strict when checking ASN.1 value lengths, false to - * allow truncated values (default: true). - * - * @return the certification request (CSR). - */ -pki.certificationRequestFromPem = function(pem, computeHash, strict) { - var msg = forge.pem.decode(pem)[0]; - - if(msg.type !== 'CERTIFICATE REQUEST') { - var error = new Error('Could not convert certification request from PEM; ' + - 'PEM header type is not "CERTIFICATE REQUEST".'); - error.headerType = msg.type; - throw error; - } - if(msg.procType && msg.procType.type === 'ENCRYPTED') { - throw new Error('Could not convert certification request from PEM; ' + - 'PEM is encrypted.'); - } - - // convert DER to ASN.1 object - var obj = asn1.fromDer(msg.body, strict); - - return pki.certificationRequestFromAsn1(obj, computeHash); -}; - -/** - * Converts a PKCS#10 certification request (CSR) to PEM format. - * - * @param csr the certification request. - * @param maxline the maximum characters per line, defaults to 64. - * - * @return the PEM-formatted certification request. - */ -pki.certificationRequestToPem = function(csr, maxline) { - // convert to ASN.1, then DER, then PEM-encode - var msg = { - type: 'CERTIFICATE REQUEST', - body: asn1.toDer(pki.certificationRequestToAsn1(csr)).getBytes() - }; - return forge.pem.encode(msg, {maxline: maxline}); -}; - -/** - * Creates an empty X.509v3 RSA certificate. - * - * @return the certificate. - */ -pki.createCertificate = function() { - var cert = {}; - cert.version = 0x02; - cert.serialNumber = '00'; - cert.signatureOid = null; - cert.signature = null; - cert.siginfo = {}; - cert.siginfo.algorithmOid = null; - cert.validity = {}; - cert.validity.notBefore = new Date(); - cert.validity.notAfter = new Date(); - - cert.issuer = {}; - cert.issuer.getField = function(sn) { - return _getAttribute(cert.issuer, sn); - }; - cert.issuer.addField = function(attr) { - _fillMissingFields([attr]); - cert.issuer.attributes.push(attr); - }; - cert.issuer.attributes = []; - cert.issuer.hash = null; - - cert.subject = {}; - cert.subject.getField = function(sn) { - return _getAttribute(cert.subject, sn); - }; - cert.subject.addField = function(attr) { - _fillMissingFields([attr]); - cert.subject.attributes.push(attr); - }; - cert.subject.attributes = []; - cert.subject.hash = null; - - cert.extensions = []; - cert.publicKey = null; - cert.md = null; - - /** - * Sets the subject of this certificate. - * - * @param attrs the array of subject attributes to use. - * @param uniqueId an optional a unique ID to use. - */ - cert.setSubject = function(attrs, uniqueId) { - // set new attributes, clear hash - _fillMissingFields(attrs); - cert.subject.attributes = attrs; - delete cert.subject.uniqueId; - if(uniqueId) { - // TODO: support arbitrary bit length ids - cert.subject.uniqueId = uniqueId; - } - cert.subject.hash = null; - }; - - /** - * Sets the issuer of this certificate. - * - * @param attrs the array of issuer attributes to use. - * @param uniqueId an optional a unique ID to use. - */ - cert.setIssuer = function(attrs, uniqueId) { - // set new attributes, clear hash - _fillMissingFields(attrs); - cert.issuer.attributes = attrs; - delete cert.issuer.uniqueId; - if(uniqueId) { - // TODO: support arbitrary bit length ids - cert.issuer.uniqueId = uniqueId; - } - cert.issuer.hash = null; - }; - - /** - * Sets the extensions of this certificate. - * - * @param exts the array of extensions to use. - */ - cert.setExtensions = function(exts) { - for(var i = 0; i < exts.length; ++i) { - _fillMissingExtensionFields(exts[i], {cert: cert}); - } - // set new extensions - cert.extensions = exts; - }; - - /** - * Gets an extension by its name or id. - * - * @param options the name to use or an object with: - * name the name to use. - * id the id to use. - * - * @return the extension or null if not found. - */ - cert.getExtension = function(options) { - if(typeof options === 'string') { - options = {name: options}; - } - - var rval = null; - var ext; - for(var i = 0; rval === null && i < cert.extensions.length; ++i) { - ext = cert.extensions[i]; - if(options.id && ext.id === options.id) { - rval = ext; - } else if(options.name && ext.name === options.name) { - rval = ext; - } - } - return rval; - }; - - /** - * Signs this certificate using the given private key. - * - * @param key the private key to sign with. - * @param md the message digest object to use (defaults to forge.md.sha1). - */ - cert.sign = function(key, md) { - // TODO: get signature OID from private key - cert.md = md || forge.md.sha1.create(); - var algorithmOid = oids[cert.md.algorithm + 'WithRSAEncryption']; - if(!algorithmOid) { - var error = new Error('Could not compute certificate digest. ' + - 'Unknown message digest algorithm OID.'); - error.algorithm = cert.md.algorithm; - throw error; - } - cert.signatureOid = cert.siginfo.algorithmOid = algorithmOid; - - // get TBSCertificate, convert to DER - cert.tbsCertificate = pki.getTBSCertificate(cert); - var bytes = asn1.toDer(cert.tbsCertificate); - - // digest and sign - cert.md.update(bytes.getBytes()); - cert.signature = key.sign(cert.md); - }; - - /** - * Attempts verify the signature on the passed certificate using this - * certificate's public key. - * - * @param child the certificate to verify. - * - * @return true if verified, false if not. - */ - cert.verify = function(child) { - var rval = false; - - if(!cert.issued(child)) { - var issuer = child.issuer; - var subject = cert.subject; - var error = new Error( - 'The parent certificate did not issue the given child ' + - 'certificate; the child certificate\'s issuer does not match the ' + - 'parent\'s subject.'); - error.expectedIssuer = subject.attributes; - error.actualIssuer = issuer.attributes; - throw error; - } - - var md = child.md; - if(md === null) { - // create digest for OID signature types - md = _createSignatureDigest({ - signatureOid: child.signatureOid, - type: 'certificate' - }); - - // produce DER formatted TBSCertificate and digest it - var tbsCertificate = child.tbsCertificate || pki.getTBSCertificate(child); - var bytes = asn1.toDer(tbsCertificate); - md.update(bytes.getBytes()); - } - - if(md !== null) { - rval = _verifySignature({ - certificate: cert, md: md, signature: child.signature - }); - } - - return rval; - }; - - /** - * Returns true if this certificate's issuer matches the passed - * certificate's subject. Note that no signature check is performed. - * - * @param parent the certificate to check. - * - * @return true if this certificate's issuer matches the passed certificate's - * subject. - */ - cert.isIssuer = function(parent) { - var rval = false; - - var i = cert.issuer; - var s = parent.subject; - - // compare hashes if present - if(i.hash && s.hash) { - rval = (i.hash === s.hash); - } else if(i.attributes.length === s.attributes.length) { - // all attributes are the same so issuer matches subject - rval = true; - var iattr, sattr; - for(var n = 0; rval && n < i.attributes.length; ++n) { - iattr = i.attributes[n]; - sattr = s.attributes[n]; - if(iattr.type !== sattr.type || iattr.value !== sattr.value) { - // attribute mismatch - rval = false; - } - } - } - - return rval; - }; - - /** - * Returns true if this certificate's subject matches the issuer of the - * given certificate). Note that not signature check is performed. - * - * @param child the certificate to check. - * - * @return true if this certificate's subject matches the passed - * certificate's issuer. - */ - cert.issued = function(child) { - return child.isIssuer(cert); - }; - - /** - * Generates the subjectKeyIdentifier for this certificate as byte buffer. - * - * @return the subjectKeyIdentifier for this certificate as byte buffer. - */ - cert.generateSubjectKeyIdentifier = function() { - /* See: 4.2.1.2 section of the the RFC3280, keyIdentifier is either: - - (1) The keyIdentifier is composed of the 160-bit SHA-1 hash of the - value of the BIT STRING subjectPublicKey (excluding the tag, - length, and number of unused bits). - - (2) The keyIdentifier is composed of a four bit type field with - the value 0100 followed by the least significant 60 bits of the - SHA-1 hash of the value of the BIT STRING subjectPublicKey - (excluding the tag, length, and number of unused bit string bits). - */ - - // skipping the tag, length, and number of unused bits is the same - // as just using the RSAPublicKey (for RSA keys, which are the - // only ones supported) - return pki.getPublicKeyFingerprint(cert.publicKey, {type: 'RSAPublicKey'}); - }; - - /** - * Verifies the subjectKeyIdentifier extension value for this certificate - * against its public key. If no extension is found, false will be - * returned. - * - * @return true if verified, false if not. - */ - cert.verifySubjectKeyIdentifier = function() { - var oid = oids['subjectKeyIdentifier']; - for(var i = 0; i < cert.extensions.length; ++i) { - var ext = cert.extensions[i]; - if(ext.id === oid) { - var ski = cert.generateSubjectKeyIdentifier().getBytes(); - return (forge.util.hexToBytes(ext.subjectKeyIdentifier) === ski); - } - } - return false; - }; - - return cert; -}; - -/** - * Converts an X.509v3 RSA certificate from an ASN.1 object. - * - * Note: If the certificate is to be verified then compute hash should - * be set to true. There is currently no implementation for converting - * a certificate back to ASN.1 so the TBSCertificate part of the ASN.1 - * object needs to be scanned before the cert object is created. - * - * @param obj the asn1 representation of an X.509v3 RSA certificate. - * @param computeHash true to compute the hash for verification. - * - * @return the certificate. - */ -pki.certificateFromAsn1 = function(obj, computeHash) { - // validate certificate and capture data - var capture = {}; - var errors = []; - if(!asn1.validate(obj, x509CertificateValidator, capture, errors)) { - var error = new Error('Cannot read X.509 certificate. ' + - 'ASN.1 object is not an X509v3 Certificate.'); - error.errors = errors; - throw error; - } - - // get oid - var oid = asn1.derToOid(capture.publicKeyOid); - if(oid !== pki.oids.rsaEncryption) { - throw new Error('Cannot read public key. OID is not RSA.'); - } - - // create certificate - var cert = pki.createCertificate(); - cert.version = capture.certVersion ? - capture.certVersion.charCodeAt(0) : 0; - var serial = forge.util.createBuffer(capture.certSerialNumber); - cert.serialNumber = serial.toHex(); - cert.signatureOid = forge.asn1.derToOid(capture.certSignatureOid); - cert.signatureParameters = _readSignatureParameters( - cert.signatureOid, capture.certSignatureParams, true); - cert.siginfo.algorithmOid = forge.asn1.derToOid(capture.certinfoSignatureOid); - cert.siginfo.parameters = _readSignatureParameters(cert.siginfo.algorithmOid, - capture.certinfoSignatureParams, false); - cert.signature = capture.certSignature; - - var validity = []; - if(capture.certValidity1UTCTime !== undefined) { - validity.push(asn1.utcTimeToDate(capture.certValidity1UTCTime)); - } - if(capture.certValidity2GeneralizedTime !== undefined) { - validity.push(asn1.generalizedTimeToDate( - capture.certValidity2GeneralizedTime)); - } - if(capture.certValidity3UTCTime !== undefined) { - validity.push(asn1.utcTimeToDate(capture.certValidity3UTCTime)); - } - if(capture.certValidity4GeneralizedTime !== undefined) { - validity.push(asn1.generalizedTimeToDate( - capture.certValidity4GeneralizedTime)); - } - if(validity.length > 2) { - throw new Error('Cannot read notBefore/notAfter validity times; more ' + - 'than two times were provided in the certificate.'); - } - if(validity.length < 2) { - throw new Error('Cannot read notBefore/notAfter validity times; they ' + - 'were not provided as either UTCTime or GeneralizedTime.'); - } - cert.validity.notBefore = validity[0]; - cert.validity.notAfter = validity[1]; - - // keep TBSCertificate to preserve signature when exporting - cert.tbsCertificate = capture.tbsCertificate; - - if(computeHash) { - // create digest for OID signature type - cert.md = _createSignatureDigest({ - signatureOid: cert.signatureOid, - type: 'certificate' - }); - - // produce DER formatted TBSCertificate and digest it - var bytes = asn1.toDer(cert.tbsCertificate); - cert.md.update(bytes.getBytes()); - } - - // handle issuer, build issuer message digest - var imd = forge.md.sha1.create(); - var ibytes = asn1.toDer(capture.certIssuer); - imd.update(ibytes.getBytes()); - cert.issuer.getField = function(sn) { - return _getAttribute(cert.issuer, sn); - }; - cert.issuer.addField = function(attr) { - _fillMissingFields([attr]); - cert.issuer.attributes.push(attr); - }; - cert.issuer.attributes = pki.RDNAttributesAsArray(capture.certIssuer); - if(capture.certIssuerUniqueId) { - cert.issuer.uniqueId = capture.certIssuerUniqueId; - } - cert.issuer.hash = imd.digest().toHex(); - - // handle subject, build subject message digest - var smd = forge.md.sha1.create(); - var sbytes = asn1.toDer(capture.certSubject); - smd.update(sbytes.getBytes()); - cert.subject.getField = function(sn) { - return _getAttribute(cert.subject, sn); - }; - cert.subject.addField = function(attr) { - _fillMissingFields([attr]); - cert.subject.attributes.push(attr); - }; - cert.subject.attributes = pki.RDNAttributesAsArray(capture.certSubject); - if(capture.certSubjectUniqueId) { - cert.subject.uniqueId = capture.certSubjectUniqueId; - } - cert.subject.hash = smd.digest().toHex(); - - // handle extensions - if(capture.certExtensions) { - cert.extensions = pki.certificateExtensionsFromAsn1(capture.certExtensions); - } else { - cert.extensions = []; - } - - // convert RSA public key from ASN.1 - cert.publicKey = pki.publicKeyFromAsn1(capture.subjectPublicKeyInfo); - - return cert; -}; - -/** - * Converts an ASN.1 extensions object (with extension sequences as its - * values) into an array of extension objects with types and values. - * - * Supported extensions: - * - * id-ce-keyUsage OBJECT IDENTIFIER ::= { id-ce 15 } - * KeyUsage ::= BIT STRING { - * digitalSignature (0), - * nonRepudiation (1), - * keyEncipherment (2), - * dataEncipherment (3), - * keyAgreement (4), - * keyCertSign (5), - * cRLSign (6), - * encipherOnly (7), - * decipherOnly (8) - * } - * - * id-ce-basicConstraints OBJECT IDENTIFIER ::= { id-ce 19 } - * BasicConstraints ::= SEQUENCE { - * cA BOOLEAN DEFAULT FALSE, - * pathLenConstraint INTEGER (0..MAX) OPTIONAL - * } - * - * subjectAltName EXTENSION ::= { - * SYNTAX GeneralNames - * IDENTIFIED BY id-ce-subjectAltName - * } - * - * GeneralNames ::= SEQUENCE SIZE (1..MAX) OF GeneralName - * - * GeneralName ::= CHOICE { - * otherName [0] INSTANCE OF OTHER-NAME, - * rfc822Name [1] IA5String, - * dNSName [2] IA5String, - * x400Address [3] ORAddress, - * directoryName [4] Name, - * ediPartyName [5] EDIPartyName, - * uniformResourceIdentifier [6] IA5String, - * IPAddress [7] OCTET STRING, - * registeredID [8] OBJECT IDENTIFIER - * } - * - * OTHER-NAME ::= TYPE-IDENTIFIER - * - * EDIPartyName ::= SEQUENCE { - * nameAssigner [0] DirectoryString {ub-name} OPTIONAL, - * partyName [1] DirectoryString {ub-name} - * } - * - * @param exts the extensions ASN.1 with extension sequences to parse. - * - * @return the array. - */ -pki.certificateExtensionsFromAsn1 = function(exts) { - var rval = []; - for(var i = 0; i < exts.value.length; ++i) { - // get extension sequence - var extseq = exts.value[i]; - for(var ei = 0; ei < extseq.value.length; ++ei) { - rval.push(pki.certificateExtensionFromAsn1(extseq.value[ei])); - } - } - - return rval; -}; - -/** - * Parses a single certificate extension from ASN.1. - * - * @param ext the extension in ASN.1 format. - * - * @return the parsed extension as an object. - */ -pki.certificateExtensionFromAsn1 = function(ext) { - // an extension has: - // [0] extnID OBJECT IDENTIFIER - // [1] critical BOOLEAN DEFAULT FALSE - // [2] extnValue OCTET STRING - var e = {}; - e.id = asn1.derToOid(ext.value[0].value); - e.critical = false; - if(ext.value[1].type === asn1.Type.BOOLEAN) { - e.critical = (ext.value[1].value.charCodeAt(0) !== 0x00); - e.value = ext.value[2].value; - } else { - e.value = ext.value[1].value; - } - // if the oid is known, get its name - if(e.id in oids) { - e.name = oids[e.id]; - - // handle key usage - if(e.name === 'keyUsage') { - // get value as BIT STRING - var ev = asn1.fromDer(e.value); - var b2 = 0x00; - var b3 = 0x00; - if(ev.value.length > 1) { - // skip first byte, just indicates unused bits which - // will be padded with 0s anyway - // get bytes with flag bits - b2 = ev.value.charCodeAt(1); - b3 = ev.value.length > 2 ? ev.value.charCodeAt(2) : 0; - } - // set flags - e.digitalSignature = (b2 & 0x80) === 0x80; - e.nonRepudiation = (b2 & 0x40) === 0x40; - e.keyEncipherment = (b2 & 0x20) === 0x20; - e.dataEncipherment = (b2 & 0x10) === 0x10; - e.keyAgreement = (b2 & 0x08) === 0x08; - e.keyCertSign = (b2 & 0x04) === 0x04; - e.cRLSign = (b2 & 0x02) === 0x02; - e.encipherOnly = (b2 & 0x01) === 0x01; - e.decipherOnly = (b3 & 0x80) === 0x80; - } else if(e.name === 'basicConstraints') { - // handle basic constraints - // get value as SEQUENCE - var ev = asn1.fromDer(e.value); - // get cA BOOLEAN flag (defaults to false) - if(ev.value.length > 0 && ev.value[0].type === asn1.Type.BOOLEAN) { - e.cA = (ev.value[0].value.charCodeAt(0) !== 0x00); - } else { - e.cA = false; - } - // get path length constraint - var value = null; - if(ev.value.length > 0 && ev.value[0].type === asn1.Type.INTEGER) { - value = ev.value[0].value; - } else if(ev.value.length > 1) { - value = ev.value[1].value; - } - if(value !== null) { - e.pathLenConstraint = asn1.derToInteger(value); - } - } else if(e.name === 'extKeyUsage') { - // handle extKeyUsage - // value is a SEQUENCE of OIDs - var ev = asn1.fromDer(e.value); - for(var vi = 0; vi < ev.value.length; ++vi) { - var oid = asn1.derToOid(ev.value[vi].value); - if(oid in oids) { - e[oids[oid]] = true; - } else { - e[oid] = true; - } - } - } else if(e.name === 'nsCertType') { - // handle nsCertType - // get value as BIT STRING - var ev = asn1.fromDer(e.value); - var b2 = 0x00; - if(ev.value.length > 1) { - // skip first byte, just indicates unused bits which - // will be padded with 0s anyway - // get bytes with flag bits - b2 = ev.value.charCodeAt(1); - } - // set flags - e.client = (b2 & 0x80) === 0x80; - e.server = (b2 & 0x40) === 0x40; - e.email = (b2 & 0x20) === 0x20; - e.objsign = (b2 & 0x10) === 0x10; - e.reserved = (b2 & 0x08) === 0x08; - e.sslCA = (b2 & 0x04) === 0x04; - e.emailCA = (b2 & 0x02) === 0x02; - e.objCA = (b2 & 0x01) === 0x01; - } else if( - e.name === 'subjectAltName' || - e.name === 'issuerAltName') { - // handle subjectAltName/issuerAltName - e.altNames = []; - - // ev is a SYNTAX SEQUENCE - var gn; - var ev = asn1.fromDer(e.value); - for(var n = 0; n < ev.value.length; ++n) { - // get GeneralName - gn = ev.value[n]; - - var altName = { - type: gn.type, - value: gn.value - }; - e.altNames.push(altName); - - // Note: Support for types 1,2,6,7,8 - switch(gn.type) { - // rfc822Name - case 1: - // dNSName - case 2: - // uniformResourceIdentifier (URI) - case 6: - break; - // IPAddress - case 7: - // convert to IPv4/IPv6 string representation - altName.ip = forge.util.bytesToIP(gn.value); - break; - // registeredID - case 8: - altName.oid = asn1.derToOid(gn.value); - break; - default: - // unsupported - } - } - } else if(e.name === 'subjectKeyIdentifier') { - // value is an OCTETSTRING w/the hash of the key-type specific - // public key structure (eg: RSAPublicKey) - var ev = asn1.fromDer(e.value); - e.subjectKeyIdentifier = forge.util.bytesToHex(ev.value); - } - } - return e; -}; - -/** - * Converts a PKCS#10 certification request (CSR) from an ASN.1 object. - * - * Note: If the certification request is to be verified then compute hash - * should be set to true. There is currently no implementation for converting - * a certificate back to ASN.1 so the CertificationRequestInfo part of the - * ASN.1 object needs to be scanned before the csr object is created. - * - * @param obj the asn1 representation of a PKCS#10 certification request (CSR). - * @param computeHash true to compute the hash for verification. - * - * @return the certification request (CSR). - */ -pki.certificationRequestFromAsn1 = function(obj, computeHash) { - // validate certification request and capture data - var capture = {}; - var errors = []; - if(!asn1.validate(obj, certificationRequestValidator, capture, errors)) { - var error = new Error('Cannot read PKCS#10 certificate request. ' + - 'ASN.1 object is not a PKCS#10 CertificationRequest.'); - error.errors = errors; - throw error; - } - - // get oid - var oid = asn1.derToOid(capture.publicKeyOid); - if(oid !== pki.oids.rsaEncryption) { - throw new Error('Cannot read public key. OID is not RSA.'); - } - - // create certification request - var csr = pki.createCertificationRequest(); - csr.version = capture.csrVersion ? capture.csrVersion.charCodeAt(0) : 0; - csr.signatureOid = forge.asn1.derToOid(capture.csrSignatureOid); - csr.signatureParameters = _readSignatureParameters( - csr.signatureOid, capture.csrSignatureParams, true); - csr.siginfo.algorithmOid = forge.asn1.derToOid(capture.csrSignatureOid); - csr.siginfo.parameters = _readSignatureParameters( - csr.siginfo.algorithmOid, capture.csrSignatureParams, false); - csr.signature = capture.csrSignature; - - // keep CertificationRequestInfo to preserve signature when exporting - csr.certificationRequestInfo = capture.certificationRequestInfo; - - if(computeHash) { - // create digest for OID signature type - csr.md = _createSignatureDigest({ - signatureOid: csr.signatureOid, - type: 'certification request' - }); - - // produce DER formatted CertificationRequestInfo and digest it - var bytes = asn1.toDer(csr.certificationRequestInfo); - csr.md.update(bytes.getBytes()); - } - - // handle subject, build subject message digest - var smd = forge.md.sha1.create(); - csr.subject.getField = function(sn) { - return _getAttribute(csr.subject, sn); - }; - csr.subject.addField = function(attr) { - _fillMissingFields([attr]); - csr.subject.attributes.push(attr); - }; - csr.subject.attributes = pki.RDNAttributesAsArray( - capture.certificationRequestInfoSubject, smd); - csr.subject.hash = smd.digest().toHex(); - - // convert RSA public key from ASN.1 - csr.publicKey = pki.publicKeyFromAsn1(capture.subjectPublicKeyInfo); - - // convert attributes from ASN.1 - csr.getAttribute = function(sn) { - return _getAttribute(csr, sn); - }; - csr.addAttribute = function(attr) { - _fillMissingFields([attr]); - csr.attributes.push(attr); - }; - csr.attributes = pki.CRIAttributesAsArray( - capture.certificationRequestInfoAttributes || []); - - return csr; -}; - -/** - * Creates an empty certification request (a CSR or certificate signing - * request). Once created, its public key and attributes can be set and then - * it can be signed. - * - * @return the empty certification request. - */ -pki.createCertificationRequest = function() { - var csr = {}; - csr.version = 0x00; - csr.signatureOid = null; - csr.signature = null; - csr.siginfo = {}; - csr.siginfo.algorithmOid = null; - - csr.subject = {}; - csr.subject.getField = function(sn) { - return _getAttribute(csr.subject, sn); - }; - csr.subject.addField = function(attr) { - _fillMissingFields([attr]); - csr.subject.attributes.push(attr); - }; - csr.subject.attributes = []; - csr.subject.hash = null; - - csr.publicKey = null; - csr.attributes = []; - csr.getAttribute = function(sn) { - return _getAttribute(csr, sn); - }; - csr.addAttribute = function(attr) { - _fillMissingFields([attr]); - csr.attributes.push(attr); - }; - csr.md = null; - - /** - * Sets the subject of this certification request. - * - * @param attrs the array of subject attributes to use. - */ - csr.setSubject = function(attrs) { - // set new attributes - _fillMissingFields(attrs); - csr.subject.attributes = attrs; - csr.subject.hash = null; - }; - - /** - * Sets the attributes of this certification request. - * - * @param attrs the array of attributes to use. - */ - csr.setAttributes = function(attrs) { - // set new attributes - _fillMissingFields(attrs); - csr.attributes = attrs; - }; - - /** - * Signs this certification request using the given private key. - * - * @param key the private key to sign with. - * @param md the message digest object to use (defaults to forge.md.sha1). - */ - csr.sign = function(key, md) { - // TODO: get signature OID from private key - csr.md = md || forge.md.sha1.create(); - var algorithmOid = oids[csr.md.algorithm + 'WithRSAEncryption']; - if(!algorithmOid) { - var error = new Error('Could not compute certification request digest. ' + - 'Unknown message digest algorithm OID.'); - error.algorithm = csr.md.algorithm; - throw error; - } - csr.signatureOid = csr.siginfo.algorithmOid = algorithmOid; - - // get CertificationRequestInfo, convert to DER - csr.certificationRequestInfo = pki.getCertificationRequestInfo(csr); - var bytes = asn1.toDer(csr.certificationRequestInfo); - - // digest and sign - csr.md.update(bytes.getBytes()); - csr.signature = key.sign(csr.md); - }; - - /** - * Attempts verify the signature on the passed certification request using - * its public key. - * - * A CSR that has been exported to a file in PEM format can be verified using - * OpenSSL using this command: - * - * openssl req -in -verify -noout -text - * - * @return true if verified, false if not. - */ - csr.verify = function() { - var rval = false; - - var md = csr.md; - if(md === null) { - md = _createSignatureDigest({ - signatureOid: csr.signatureOid, - type: 'certification request' - }); - - // produce DER formatted CertificationRequestInfo and digest it - var cri = csr.certificationRequestInfo || - pki.getCertificationRequestInfo(csr); - var bytes = asn1.toDer(cri); - md.update(bytes.getBytes()); - } - - if(md !== null) { - rval = _verifySignature({ - certificate: csr, md: md, signature: csr.signature - }); - } - - return rval; - }; - - return csr; -}; - -/** - * Converts an X.509 subject or issuer to an ASN.1 RDNSequence. - * - * @param obj the subject or issuer (distinguished name). - * - * @return the ASN.1 RDNSequence. - */ -function _dnToAsn1(obj) { - // create an empty RDNSequence - var rval = asn1.create( - asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, []); - - // iterate over attributes - var attr, set; - var attrs = obj.attributes; - for(var i = 0; i < attrs.length; ++i) { - attr = attrs[i]; - var value = attr.value; - - // reuse tag class for attribute value if available - var valueTagClass = asn1.Type.PRINTABLESTRING; - if('valueTagClass' in attr) { - valueTagClass = attr.valueTagClass; - - if(valueTagClass === asn1.Type.UTF8) { - value = forge.util.encodeUtf8(value); - } - // FIXME: handle more encodings - } - - // create a RelativeDistinguishedName set - // each value in the set is an AttributeTypeAndValue first - // containing the type (an OID) and second the value - set = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SET, true, [ - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // AttributeType - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false, - asn1.oidToDer(attr.type).getBytes()), - // AttributeValue - asn1.create(asn1.Class.UNIVERSAL, valueTagClass, false, value) - ]) - ]); - rval.value.push(set); - } - - return rval; -} - -/** - * Gets all printable attributes (typically of an issuer or subject) in a - * simplified JSON format for display. - * - * @param attrs the attributes. - * - * @return the JSON for display. - */ -function _getAttributesAsJson(attrs) { - var rval = {}; - for(var i = 0; i < attrs.length; ++i) { - var attr = attrs[i]; - if(attr.shortName && ( - attr.valueTagClass === asn1.Type.UTF8 || - attr.valueTagClass === asn1.Type.PRINTABLESTRING || - attr.valueTagClass === asn1.Type.IA5STRING)) { - var value = attr.value; - if(attr.valueTagClass === asn1.Type.UTF8) { - value = forge.util.encodeUtf8(attr.value); - } - if(!(attr.shortName in rval)) { - rval[attr.shortName] = value; - } else if(forge.util.isArray(rval[attr.shortName])) { - rval[attr.shortName].push(value); - } else { - rval[attr.shortName] = [rval[attr.shortName], value]; - } - } - } - return rval; -} - -/** - * Fills in missing fields in attributes. - * - * @param attrs the attributes to fill missing fields in. - */ -function _fillMissingFields(attrs) { - var attr; - for(var i = 0; i < attrs.length; ++i) { - attr = attrs[i]; - - // populate missing name - if(typeof attr.name === 'undefined') { - if(attr.type && attr.type in pki.oids) { - attr.name = pki.oids[attr.type]; - } else if(attr.shortName && attr.shortName in _shortNames) { - attr.name = pki.oids[_shortNames[attr.shortName]]; - } - } - - // populate missing type (OID) - if(typeof attr.type === 'undefined') { - if(attr.name && attr.name in pki.oids) { - attr.type = pki.oids[attr.name]; - } else { - var error = new Error('Attribute type not specified.'); - error.attribute = attr; - throw error; - } - } - - // populate missing shortname - if(typeof attr.shortName === 'undefined') { - if(attr.name && attr.name in _shortNames) { - attr.shortName = _shortNames[attr.name]; - } - } - - // convert extensions to value - if(attr.type === oids.extensionRequest) { - attr.valueConstructed = true; - attr.valueTagClass = asn1.Type.SEQUENCE; - if(!attr.value && attr.extensions) { - attr.value = []; - for(var ei = 0; ei < attr.extensions.length; ++ei) { - attr.value.push(pki.certificateExtensionToAsn1( - _fillMissingExtensionFields(attr.extensions[ei]))); - } - } - } - - if(typeof attr.value === 'undefined') { - var error = new Error('Attribute value not specified.'); - error.attribute = attr; - throw error; - } - } -} - -/** - * Fills in missing fields in certificate extensions. - * - * @param e the extension. - * @param [options] the options to use. - * [cert] the certificate the extensions are for. - * - * @return the extension. - */ -function _fillMissingExtensionFields(e, options) { - options = options || {}; - - // populate missing name - if(typeof e.name === 'undefined') { - if(e.id && e.id in pki.oids) { - e.name = pki.oids[e.id]; - } - } - - // populate missing id - if(typeof e.id === 'undefined') { - if(e.name && e.name in pki.oids) { - e.id = pki.oids[e.name]; - } else { - var error = new Error('Extension ID not specified.'); - error.extension = e; - throw error; - } - } - - if(typeof e.value !== 'undefined') { - return e; - } - - // handle missing value: - - // value is a BIT STRING - if(e.name === 'keyUsage') { - // build flags - var unused = 0; - var b2 = 0x00; - var b3 = 0x00; - if(e.digitalSignature) { - b2 |= 0x80; - unused = 7; - } - if(e.nonRepudiation) { - b2 |= 0x40; - unused = 6; - } - if(e.keyEncipherment) { - b2 |= 0x20; - unused = 5; - } - if(e.dataEncipherment) { - b2 |= 0x10; - unused = 4; - } - if(e.keyAgreement) { - b2 |= 0x08; - unused = 3; - } - if(e.keyCertSign) { - b2 |= 0x04; - unused = 2; - } - if(e.cRLSign) { - b2 |= 0x02; - unused = 1; - } - if(e.encipherOnly) { - b2 |= 0x01; - unused = 0; - } - if(e.decipherOnly) { - b3 |= 0x80; - unused = 7; - } - - // create bit string - var value = String.fromCharCode(unused); - if(b3 !== 0) { - value += String.fromCharCode(b2) + String.fromCharCode(b3); - } else if(b2 !== 0) { - value += String.fromCharCode(b2); - } - e.value = asn1.create( - asn1.Class.UNIVERSAL, asn1.Type.BITSTRING, false, value); - } else if(e.name === 'basicConstraints') { - // basicConstraints is a SEQUENCE - e.value = asn1.create( - asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, []); - // cA BOOLEAN flag defaults to false - if(e.cA) { - e.value.value.push(asn1.create( - asn1.Class.UNIVERSAL, asn1.Type.BOOLEAN, false, - String.fromCharCode(0xFF))); - } - if('pathLenConstraint' in e) { - e.value.value.push(asn1.create( - asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, - asn1.integerToDer(e.pathLenConstraint).getBytes())); - } - } else if(e.name === 'extKeyUsage') { - // extKeyUsage is a SEQUENCE of OIDs - e.value = asn1.create( - asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, []); - var seq = e.value.value; - for(var key in e) { - if(e[key] !== true) { - continue; - } - // key is name in OID map - if(key in oids) { - seq.push(asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, - false, asn1.oidToDer(oids[key]).getBytes())); - } else if(key.indexOf('.') !== -1) { - // assume key is an OID - seq.push(asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, - false, asn1.oidToDer(key).getBytes())); - } - } - } else if(e.name === 'nsCertType') { - // nsCertType is a BIT STRING - // build flags - var unused = 0; - var b2 = 0x00; - - if(e.client) { - b2 |= 0x80; - unused = 7; - } - if(e.server) { - b2 |= 0x40; - unused = 6; - } - if(e.email) { - b2 |= 0x20; - unused = 5; - } - if(e.objsign) { - b2 |= 0x10; - unused = 4; - } - if(e.reserved) { - b2 |= 0x08; - unused = 3; - } - if(e.sslCA) { - b2 |= 0x04; - unused = 2; - } - if(e.emailCA) { - b2 |= 0x02; - unused = 1; - } - if(e.objCA) { - b2 |= 0x01; - unused = 0; - } - - // create bit string - var value = String.fromCharCode(unused); - if(b2 !== 0) { - value += String.fromCharCode(b2); - } - e.value = asn1.create( - asn1.Class.UNIVERSAL, asn1.Type.BITSTRING, false, value); - } else if(e.name === 'subjectAltName' || e.name === 'issuerAltName') { - // SYNTAX SEQUENCE - e.value = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, []); - - var altName; - for(var n = 0; n < e.altNames.length; ++n) { - altName = e.altNames[n]; - var value = altName.value; - // handle IP - if(altName.type === 7 && altName.ip) { - value = forge.util.bytesFromIP(altName.ip); - if(value === null) { - var error = new Error( - 'Extension "ip" value is not a valid IPv4 or IPv6 address.'); - error.extension = e; - throw error; - } - } else if(altName.type === 8) { - // handle OID - if(altName.oid) { - value = asn1.oidToDer(asn1.oidToDer(altName.oid)); - } else { - // deprecated ... convert value to OID - value = asn1.oidToDer(value); - } - } - e.value.value.push(asn1.create( - asn1.Class.CONTEXT_SPECIFIC, altName.type, false, - value)); - } - } else if(e.name === 'nsComment' && options.cert) { - // sanity check value is ASCII (req'd) and not too big - if(!(/^[\x00-\x7F]*$/.test(e.comment)) || - (e.comment.length < 1) || (e.comment.length > 128)) { - throw new Error('Invalid "nsComment" content.'); - } - // IA5STRING opaque comment - e.value = asn1.create( - asn1.Class.UNIVERSAL, asn1.Type.IA5STRING, false, e.comment); - } else if(e.name === 'subjectKeyIdentifier' && options.cert) { - var ski = options.cert.generateSubjectKeyIdentifier(); - e.subjectKeyIdentifier = ski.toHex(); - // OCTETSTRING w/digest - e.value = asn1.create( - asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false, ski.getBytes()); - } else if(e.name === 'authorityKeyIdentifier' && options.cert) { - // SYNTAX SEQUENCE - e.value = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, []); - var seq = e.value.value; - - if(e.keyIdentifier) { - var keyIdentifier = (e.keyIdentifier === true ? - options.cert.generateSubjectKeyIdentifier().getBytes() : - e.keyIdentifier); - seq.push( - asn1.create(asn1.Class.CONTEXT_SPECIFIC, 0, false, keyIdentifier)); - } - - if(e.authorityCertIssuer) { - var authorityCertIssuer = [ - asn1.create(asn1.Class.CONTEXT_SPECIFIC, 4, true, [ - _dnToAsn1(e.authorityCertIssuer === true ? - options.cert.issuer : e.authorityCertIssuer) - ]) - ]; - seq.push( - asn1.create(asn1.Class.CONTEXT_SPECIFIC, 1, true, authorityCertIssuer)); - } - - if(e.serialNumber) { - var serialNumber = forge.util.hexToBytes(e.serialNumber === true ? - options.cert.serialNumber : e.serialNumber); - seq.push( - asn1.create(asn1.Class.CONTEXT_SPECIFIC, 2, false, serialNumber)); - } - } else if(e.name === 'cRLDistributionPoints') { - e.value = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, []); - var seq = e.value.value; - - // Create sub SEQUENCE of DistributionPointName - var subSeq = asn1.create( - asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, []); - - // Create fullName CHOICE - var fullNameGeneralNames = asn1.create( - asn1.Class.CONTEXT_SPECIFIC, 0, true, []); - var altName; - for(var n = 0; n < e.altNames.length; ++n) { - altName = e.altNames[n]; - var value = altName.value; - // handle IP - if(altName.type === 7 && altName.ip) { - value = forge.util.bytesFromIP(altName.ip); - if(value === null) { - var error = new Error( - 'Extension "ip" value is not a valid IPv4 or IPv6 address.'); - error.extension = e; - throw error; - } - } else if(altName.type === 8) { - // handle OID - if(altName.oid) { - value = asn1.oidToDer(asn1.oidToDer(altName.oid)); - } else { - // deprecated ... convert value to OID - value = asn1.oidToDer(value); - } - } - fullNameGeneralNames.value.push(asn1.create( - asn1.Class.CONTEXT_SPECIFIC, altName.type, false, - value)); - } - - // Add to the parent SEQUENCE - subSeq.value.push(asn1.create( - asn1.Class.CONTEXT_SPECIFIC, 0, true, [fullNameGeneralNames])); - seq.push(subSeq); - } - - // ensure value has been defined by now - if(typeof e.value === 'undefined') { - var error = new Error('Extension value not specified.'); - error.extension = e; - throw error; - } - - return e; -} - -/** - * Convert signature parameters object to ASN.1 - * - * @param {String} oid Signature algorithm OID - * @param params The signature parametrs object - * @return ASN.1 object representing signature parameters - */ -function _signatureParametersToAsn1(oid, params) { - switch(oid) { - case oids['RSASSA-PSS']: - var parts = []; - - if(params.hash.algorithmOid !== undefined) { - parts.push(asn1.create(asn1.Class.CONTEXT_SPECIFIC, 0, true, [ - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false, - asn1.oidToDer(params.hash.algorithmOid).getBytes()), - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.NULL, false, '') - ]) - ])); - } - - if(params.mgf.algorithmOid !== undefined) { - parts.push(asn1.create(asn1.Class.CONTEXT_SPECIFIC, 1, true, [ - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false, - asn1.oidToDer(params.mgf.algorithmOid).getBytes()), - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false, - asn1.oidToDer(params.mgf.hash.algorithmOid).getBytes()), - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.NULL, false, '') - ]) - ]) - ])); - } - - if(params.saltLength !== undefined) { - parts.push(asn1.create(asn1.Class.CONTEXT_SPECIFIC, 2, true, [ - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, - asn1.integerToDer(params.saltLength).getBytes()) - ])); - } - - return asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, parts); - - default: - return asn1.create(asn1.Class.UNIVERSAL, asn1.Type.NULL, false, ''); - } -} - -/** - * Converts a certification request's attributes to an ASN.1 set of - * CRIAttributes. - * - * @param csr certification request. - * - * @return the ASN.1 set of CRIAttributes. - */ -function _CRIAttributesToAsn1(csr) { - // create an empty context-specific container - var rval = asn1.create(asn1.Class.CONTEXT_SPECIFIC, 0, true, []); - - // no attributes, return empty container - if(csr.attributes.length === 0) { - return rval; - } - - // each attribute has a sequence with a type and a set of values - var attrs = csr.attributes; - for(var i = 0; i < attrs.length; ++i) { - var attr = attrs[i]; - var value = attr.value; - - // reuse tag class for attribute value if available - var valueTagClass = asn1.Type.UTF8; - if('valueTagClass' in attr) { - valueTagClass = attr.valueTagClass; - } - if(valueTagClass === asn1.Type.UTF8) { - value = forge.util.encodeUtf8(value); - } - var valueConstructed = false; - if('valueConstructed' in attr) { - valueConstructed = attr.valueConstructed; - } - // FIXME: handle more encodings - - // create a RelativeDistinguishedName set - // each value in the set is an AttributeTypeAndValue first - // containing the type (an OID) and second the value - var seq = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // AttributeType - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false, - asn1.oidToDer(attr.type).getBytes()), - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SET, true, [ - // AttributeValue - asn1.create( - asn1.Class.UNIVERSAL, valueTagClass, valueConstructed, value) - ]) - ]); - rval.value.push(seq); - } - - return rval; -} - -var jan_1_1950 = new Date('1950-01-01T00:00:00Z'); -var jan_1_2050 = new Date('2050-01-01T00:00:00Z'); - -/** - * Converts a Date object to ASN.1 - * Handles the different format before and after 1st January 2050 - * - * @param date date object. - * - * @return the ASN.1 object representing the date. - */ -function _dateToAsn1(date) { - if(date >= jan_1_1950 && date < jan_1_2050) { - return asn1.create( - asn1.Class.UNIVERSAL, asn1.Type.UTCTIME, false, - asn1.dateToUtcTime(date)); - } else { - return asn1.create( - asn1.Class.UNIVERSAL, asn1.Type.GENERALIZEDTIME, false, - asn1.dateToGeneralizedTime(date)); - } -} - -/** - * Gets the ASN.1 TBSCertificate part of an X.509v3 certificate. - * - * @param cert the certificate. - * - * @return the asn1 TBSCertificate. - */ -pki.getTBSCertificate = function(cert) { - // TBSCertificate - var notBefore = _dateToAsn1(cert.validity.notBefore); - var notAfter = _dateToAsn1(cert.validity.notAfter); - var tbs = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // version - asn1.create(asn1.Class.CONTEXT_SPECIFIC, 0, true, [ - // integer - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, - asn1.integerToDer(cert.version).getBytes()) - ]), - // serialNumber - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, - forge.util.hexToBytes(cert.serialNumber)), - // signature - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // algorithm - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false, - asn1.oidToDer(cert.siginfo.algorithmOid).getBytes()), - // parameters - _signatureParametersToAsn1( - cert.siginfo.algorithmOid, cert.siginfo.parameters) - ]), - // issuer - _dnToAsn1(cert.issuer), - // validity - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - notBefore, - notAfter - ]), - // subject - _dnToAsn1(cert.subject), - // SubjectPublicKeyInfo - pki.publicKeyToAsn1(cert.publicKey) - ]); - - if(cert.issuer.uniqueId) { - // issuerUniqueID (optional) - tbs.value.push( - asn1.create(asn1.Class.CONTEXT_SPECIFIC, 1, true, [ - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.BITSTRING, false, - // TODO: support arbitrary bit length ids - String.fromCharCode(0x00) + - cert.issuer.uniqueId - ) - ]) - ); - } - if(cert.subject.uniqueId) { - // subjectUniqueID (optional) - tbs.value.push( - asn1.create(asn1.Class.CONTEXT_SPECIFIC, 2, true, [ - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.BITSTRING, false, - // TODO: support arbitrary bit length ids - String.fromCharCode(0x00) + - cert.subject.uniqueId - ) - ]) - ); - } - - if(cert.extensions.length > 0) { - // extensions (optional) - tbs.value.push(pki.certificateExtensionsToAsn1(cert.extensions)); - } - - return tbs; -}; - -/** - * Gets the ASN.1 CertificationRequestInfo part of a - * PKCS#10 CertificationRequest. - * - * @param csr the certification request. - * - * @return the asn1 CertificationRequestInfo. - */ -pki.getCertificationRequestInfo = function(csr) { - // CertificationRequestInfo - var cri = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // version - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, - asn1.integerToDer(csr.version).getBytes()), - // subject - _dnToAsn1(csr.subject), - // SubjectPublicKeyInfo - pki.publicKeyToAsn1(csr.publicKey), - // attributes - _CRIAttributesToAsn1(csr) - ]); - - return cri; -}; - -/** - * Converts a DistinguishedName (subject or issuer) to an ASN.1 object. - * - * @param dn the DistinguishedName. - * - * @return the asn1 representation of a DistinguishedName. - */ -pki.distinguishedNameToAsn1 = function(dn) { - return _dnToAsn1(dn); -}; - -/** - * Converts an X.509v3 RSA certificate to an ASN.1 object. - * - * @param cert the certificate. - * - * @return the asn1 representation of an X.509v3 RSA certificate. - */ -pki.certificateToAsn1 = function(cert) { - // prefer cached TBSCertificate over generating one - var tbsCertificate = cert.tbsCertificate || pki.getTBSCertificate(cert); - - // Certificate - return asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // TBSCertificate - tbsCertificate, - // AlgorithmIdentifier (signature algorithm) - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // algorithm - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false, - asn1.oidToDer(cert.signatureOid).getBytes()), - // parameters - _signatureParametersToAsn1(cert.signatureOid, cert.signatureParameters) - ]), - // SignatureValue - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.BITSTRING, false, - String.fromCharCode(0x00) + cert.signature) - ]); -}; - -/** - * Converts X.509v3 certificate extensions to ASN.1. - * - * @param exts the extensions to convert. - * - * @return the extensions in ASN.1 format. - */ -pki.certificateExtensionsToAsn1 = function(exts) { - // create top-level extension container - var rval = asn1.create(asn1.Class.CONTEXT_SPECIFIC, 3, true, []); - - // create extension sequence (stores a sequence for each extension) - var seq = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, []); - rval.value.push(seq); - - for(var i = 0; i < exts.length; ++i) { - seq.value.push(pki.certificateExtensionToAsn1(exts[i])); - } - - return rval; -}; - -/** - * Converts a single certificate extension to ASN.1. - * - * @param ext the extension to convert. - * - * @return the extension in ASN.1 format. - */ -pki.certificateExtensionToAsn1 = function(ext) { - // create a sequence for each extension - var extseq = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, []); - - // extnID (OID) - extseq.value.push(asn1.create( - asn1.Class.UNIVERSAL, asn1.Type.OID, false, - asn1.oidToDer(ext.id).getBytes())); - - // critical defaults to false - if(ext.critical) { - // critical BOOLEAN DEFAULT FALSE - extseq.value.push(asn1.create( - asn1.Class.UNIVERSAL, asn1.Type.BOOLEAN, false, - String.fromCharCode(0xFF))); - } - - var value = ext.value; - if(typeof ext.value !== 'string') { - // value is asn.1 - value = asn1.toDer(value).getBytes(); - } - - // extnValue (OCTET STRING) - extseq.value.push(asn1.create( - asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false, value)); - - return extseq; -}; - -/** - * Converts a PKCS#10 certification request to an ASN.1 object. - * - * @param csr the certification request. - * - * @return the asn1 representation of a certification request. - */ -pki.certificationRequestToAsn1 = function(csr) { - // prefer cached CertificationRequestInfo over generating one - var cri = csr.certificationRequestInfo || - pki.getCertificationRequestInfo(csr); - - // Certificate - return asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // CertificationRequestInfo - cri, - // AlgorithmIdentifier (signature algorithm) - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // algorithm - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false, - asn1.oidToDer(csr.signatureOid).getBytes()), - // parameters - _signatureParametersToAsn1(csr.signatureOid, csr.signatureParameters) - ]), - // signature - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.BITSTRING, false, - String.fromCharCode(0x00) + csr.signature) - ]); -}; - -/** - * Creates a CA store. - * - * @param certs an optional array of certificate objects or PEM-formatted - * certificate strings to add to the CA store. - * - * @return the CA store. - */ -pki.createCaStore = function(certs) { - // create CA store - var caStore = { - // stored certificates - certs: {} - }; - - /** - * Gets the certificate that issued the passed certificate or its - * 'parent'. - * - * @param cert the certificate to get the parent for. - * - * @return the parent certificate or null if none was found. - */ - caStore.getIssuer = function(cert) { - var rval = getBySubject(cert.issuer); - - // see if there are multiple matches - /*if(forge.util.isArray(rval)) { - // TODO: resolve multiple matches by checking - // authorityKey/subjectKey/issuerUniqueID/other identifiers, etc. - // FIXME: or alternatively do authority key mapping - // if possible (X.509v1 certs can't work?) - throw new Error('Resolving multiple issuer matches not implemented yet.'); - }*/ - - return rval; - }; - - /** - * Adds a trusted certificate to the store. - * - * @param cert the certificate to add as a trusted certificate (either a - * pki.certificate object or a PEM-formatted certificate). - */ - caStore.addCertificate = function(cert) { - // convert from pem if necessary - if(typeof cert === 'string') { - cert = forge.pki.certificateFromPem(cert); - } - - ensureSubjectHasHash(cert.subject); - - if(!caStore.hasCertificate(cert)) { // avoid duplicate certificates in store - if(cert.subject.hash in caStore.certs) { - // subject hash already exists, append to array - var tmp = caStore.certs[cert.subject.hash]; - if(!forge.util.isArray(tmp)) { - tmp = [tmp]; - } - tmp.push(cert); - caStore.certs[cert.subject.hash] = tmp; - } else { - caStore.certs[cert.subject.hash] = cert; - } - } - }; - - /** - * Checks to see if the given certificate is in the store. - * - * @param cert the certificate to check (either a pki.certificate or a - * PEM-formatted certificate). - * - * @return true if the certificate is in the store, false if not. - */ - caStore.hasCertificate = function(cert) { - // convert from pem if necessary - if(typeof cert === 'string') { - cert = forge.pki.certificateFromPem(cert); - } - - var match = getBySubject(cert.subject); - if(!match) { - return false; - } - if(!forge.util.isArray(match)) { - match = [match]; - } - // compare DER-encoding of certificates - var der1 = asn1.toDer(pki.certificateToAsn1(cert)).getBytes(); - for(var i = 0; i < match.length; ++i) { - var der2 = asn1.toDer(pki.certificateToAsn1(match[i])).getBytes(); - if(der1 === der2) { - return true; - } - } - return false; - }; - - /** - * Lists all of the certificates kept in the store. - * - * @return an array of all of the pki.certificate objects in the store. - */ - caStore.listAllCertificates = function() { - var certList = []; - - for(var hash in caStore.certs) { - if(caStore.certs.hasOwnProperty(hash)) { - var value = caStore.certs[hash]; - if(!forge.util.isArray(value)) { - certList.push(value); - } else { - for(var i = 0; i < value.length; ++i) { - certList.push(value[i]); - } - } - } - } - - return certList; - }; - - /** - * Removes a certificate from the store. - * - * @param cert the certificate to remove (either a pki.certificate or a - * PEM-formatted certificate). - * - * @return the certificate that was removed or null if the certificate - * wasn't in store. - */ - caStore.removeCertificate = function(cert) { - var result; - - // convert from pem if necessary - if(typeof cert === 'string') { - cert = forge.pki.certificateFromPem(cert); - } - ensureSubjectHasHash(cert.subject); - if(!caStore.hasCertificate(cert)) { - return null; - } - - var match = getBySubject(cert.subject); - - if(!forge.util.isArray(match)) { - result = caStore.certs[cert.subject.hash]; - delete caStore.certs[cert.subject.hash]; - return result; - } - - // compare DER-encoding of certificates - var der1 = asn1.toDer(pki.certificateToAsn1(cert)).getBytes(); - for(var i = 0; i < match.length; ++i) { - var der2 = asn1.toDer(pki.certificateToAsn1(match[i])).getBytes(); - if(der1 === der2) { - result = match[i]; - match.splice(i, 1); - } - } - if(match.length === 0) { - delete caStore.certs[cert.subject.hash]; - } - - return result; - }; - - function getBySubject(subject) { - ensureSubjectHasHash(subject); - return caStore.certs[subject.hash] || null; - } - - function ensureSubjectHasHash(subject) { - // produce subject hash if it doesn't exist - if(!subject.hash) { - var md = forge.md.sha1.create(); - subject.attributes = pki.RDNAttributesAsArray(_dnToAsn1(subject), md); - subject.hash = md.digest().toHex(); - } - } - - // auto-add passed in certs - if(certs) { - // parse PEM-formatted certificates as necessary - for(var i = 0; i < certs.length; ++i) { - var cert = certs[i]; - caStore.addCertificate(cert); - } - } - - return caStore; -}; - -/** - * Certificate verification errors, based on TLS. - */ -pki.certificateError = { - bad_certificate: 'forge.pki.BadCertificate', - unsupported_certificate: 'forge.pki.UnsupportedCertificate', - certificate_revoked: 'forge.pki.CertificateRevoked', - certificate_expired: 'forge.pki.CertificateExpired', - certificate_unknown: 'forge.pki.CertificateUnknown', - unknown_ca: 'forge.pki.UnknownCertificateAuthority' -}; - -/** - * Verifies a certificate chain against the given Certificate Authority store - * with an optional custom verify callback. - * - * @param caStore a certificate store to verify against. - * @param chain the certificate chain to verify, with the root or highest - * authority at the end (an array of certificates). - * @param options a callback to be called for every certificate in the chain or - * an object with: - * verify a callback to be called for every certificate in the - * chain - * validityCheckDate the date against which the certificate - * validity period should be checked. Pass null to not check - * the validity period. By default, the current date is used. - * - * The verify callback has the following signature: - * - * verified - Set to true if certificate was verified, otherwise the - * pki.certificateError for why the certificate failed. - * depth - The current index in the chain, where 0 is the end point's cert. - * certs - The certificate chain, *NOTE* an empty chain indicates an anonymous - * end point. - * - * The function returns true on success and on failure either the appropriate - * pki.certificateError or an object with 'error' set to the appropriate - * pki.certificateError and 'message' set to a custom error message. - * - * @return true if successful, error thrown if not. - */ -pki.verifyCertificateChain = function(caStore, chain, options) { - /* From: RFC3280 - Internet X.509 Public Key Infrastructure Certificate - Section 6: Certification Path Validation - See inline parentheticals related to this particular implementation. - - The primary goal of path validation is to verify the binding between - a subject distinguished name or a subject alternative name and subject - public key, as represented in the end entity certificate, based on the - public key of the trust anchor. This requires obtaining a sequence of - certificates that support that binding. That sequence should be provided - in the passed 'chain'. The trust anchor should be in the given CA - store. The 'end entity' certificate is the certificate provided by the - end point (typically a server) and is the first in the chain. - - To meet this goal, the path validation process verifies, among other - things, that a prospective certification path (a sequence of n - certificates or a 'chain') satisfies the following conditions: - - (a) for all x in {1, ..., n-1}, the subject of certificate x is - the issuer of certificate x+1; - - (b) certificate 1 is issued by the trust anchor; - - (c) certificate n is the certificate to be validated; and - - (d) for all x in {1, ..., n}, the certificate was valid at the - time in question. - - Note that here 'n' is index 0 in the chain and 1 is the last certificate - in the chain and it must be signed by a certificate in the connection's - CA store. - - The path validation process also determines the set of certificate - policies that are valid for this path, based on the certificate policies - extension, policy mapping extension, policy constraints extension, and - inhibit any-policy extension. - - Note: Policy mapping extension not supported (Not Required). - - Note: If the certificate has an unsupported critical extension, then it - must be rejected. - - Note: A certificate is self-issued if the DNs that appear in the subject - and issuer fields are identical and are not empty. - - The path validation algorithm assumes the following seven inputs are - provided to the path processing logic. What this specific implementation - will use is provided parenthetically: - - (a) a prospective certification path of length n (the 'chain') - (b) the current date/time: ('now'). - (c) user-initial-policy-set: A set of certificate policy identifiers - naming the policies that are acceptable to the certificate user. - The user-initial-policy-set contains the special value any-policy - if the user is not concerned about certificate policy - (Not implemented. Any policy is accepted). - (d) trust anchor information, describing a CA that serves as a trust - anchor for the certification path. The trust anchor information - includes: - - (1) the trusted issuer name, - (2) the trusted public key algorithm, - (3) the trusted public key, and - (4) optionally, the trusted public key parameters associated - with the public key. - - (Trust anchors are provided via certificates in the CA store). - - The trust anchor information may be provided to the path processing - procedure in the form of a self-signed certificate. The trusted anchor - information is trusted because it was delivered to the path processing - procedure by some trustworthy out-of-band procedure. If the trusted - public key algorithm requires parameters, then the parameters are - provided along with the trusted public key (No parameters used in this - implementation). - - (e) initial-policy-mapping-inhibit, which indicates if policy mapping is - allowed in the certification path. - (Not implemented, no policy checking) - - (f) initial-explicit-policy, which indicates if the path must be valid - for at least one of the certificate policies in the user-initial- - policy-set. - (Not implemented, no policy checking) - - (g) initial-any-policy-inhibit, which indicates whether the - anyPolicy OID should be processed if it is included in a - certificate. - (Not implemented, so any policy is valid provided that it is - not marked as critical) */ - - /* Basic Path Processing: - - For each certificate in the 'chain', the following is checked: - - 1. The certificate validity period includes the current time. - 2. The certificate was signed by its parent (where the parent is either - the next in the chain or from the CA store). Allow processing to - continue to the next step if no parent is found but the certificate is - in the CA store. - 3. TODO: The certificate has not been revoked. - 4. The certificate issuer name matches the parent's subject name. - 5. TODO: If the certificate is self-issued and not the final certificate - in the chain, skip this step, otherwise verify that the subject name - is within one of the permitted subtrees of X.500 distinguished names - and that each of the alternative names in the subjectAltName extension - (critical or non-critical) is within one of the permitted subtrees for - that name type. - 6. TODO: If the certificate is self-issued and not the final certificate - in the chain, skip this step, otherwise verify that the subject name - is not within one of the excluded subtrees for X.500 distinguished - names and none of the subjectAltName extension names are excluded for - that name type. - 7. The other steps in the algorithm for basic path processing involve - handling the policy extension which is not presently supported in this - implementation. Instead, if a critical policy extension is found, the - certificate is rejected as not supported. - 8. If the certificate is not the first or if its the only certificate in - the chain (having no parent from the CA store or is self-signed) and it - has a critical key usage extension, verify that the keyCertSign bit is - set. If the key usage extension exists, verify that the basic - constraints extension exists. If the basic constraints extension exists, - verify that the cA flag is set. If pathLenConstraint is set, ensure that - the number of certificates that precede in the chain (come earlier - in the chain as implemented below), excluding the very first in the - chain (typically the end-entity one), isn't greater than the - pathLenConstraint. This constraint limits the number of intermediate - CAs that may appear below a CA before only end-entity certificates - may be issued. */ - - // if a verify callback is passed as the third parameter, package it within - // the options object. This is to support a legacy function signature that - // expected the verify callback as the third parameter. - if(typeof options === 'function') { - options = {verify: options}; - } - options = options || {}; - - // copy cert chain references to another array to protect against changes - // in verify callback - chain = chain.slice(0); - var certs = chain.slice(0); - - var validityCheckDate = options.validityCheckDate; - // if no validityCheckDate is specified, default to the current date. Make - // sure to maintain the value null because it indicates that the validity - // period should not be checked. - if(typeof validityCheckDate === 'undefined') { - validityCheckDate = new Date(); - } - - // verify each cert in the chain using its parent, where the parent - // is either the next in the chain or from the CA store - var first = true; - var error = null; - var depth = 0; - do { - var cert = chain.shift(); - var parent = null; - var selfSigned = false; - - if(validityCheckDate) { - // 1. check valid time - if(validityCheckDate < cert.validity.notBefore || - validityCheckDate > cert.validity.notAfter) { - error = { - message: 'Certificate is not valid yet or has expired.', - error: pki.certificateError.certificate_expired, - notBefore: cert.validity.notBefore, - notAfter: cert.validity.notAfter, - // TODO: we might want to reconsider renaming 'now' to - // 'validityCheckDate' should this API be changed in the future. - now: validityCheckDate - }; - } - } - - // 2. verify with parent from chain or CA store - if(error === null) { - parent = chain[0] || caStore.getIssuer(cert); - if(parent === null) { - // check for self-signed cert - if(cert.isIssuer(cert)) { - selfSigned = true; - parent = cert; - } - } - - if(parent) { - // FIXME: current CA store implementation might have multiple - // certificates where the issuer can't be determined from the - // certificate (happens rarely with, eg: old certificates) so normalize - // by always putting parents into an array - // TODO: there's may be an extreme degenerate case currently uncovered - // where an old intermediate certificate seems to have a matching parent - // but none of the parents actually verify ... but the intermediate - // is in the CA and it should pass this check; needs investigation - var parents = parent; - if(!forge.util.isArray(parents)) { - parents = [parents]; - } - - // try to verify with each possible parent (typically only one) - var verified = false; - while(!verified && parents.length > 0) { - parent = parents.shift(); - try { - verified = parent.verify(cert); - } catch(ex) { - // failure to verify, don't care why, try next one - } - } - - if(!verified) { - error = { - message: 'Certificate signature is invalid.', - error: pki.certificateError.bad_certificate - }; - } - } - - if(error === null && (!parent || selfSigned) && - !caStore.hasCertificate(cert)) { - // no parent issuer and certificate itself is not trusted - error = { - message: 'Certificate is not trusted.', - error: pki.certificateError.unknown_ca - }; - } - } - - // TODO: 3. check revoked - - // 4. check for matching issuer/subject - if(error === null && parent && !cert.isIssuer(parent)) { - // parent is not issuer - error = { - message: 'Certificate issuer is invalid.', - error: pki.certificateError.bad_certificate - }; - } - - // 5. TODO: check names with permitted names tree - - // 6. TODO: check names against excluded names tree - - // 7. check for unsupported critical extensions - if(error === null) { - // supported extensions - var se = { - keyUsage: true, - basicConstraints: true - }; - for(var i = 0; error === null && i < cert.extensions.length; ++i) { - var ext = cert.extensions[i]; - if(ext.critical && !(ext.name in se)) { - error = { - message: - 'Certificate has an unsupported critical extension.', - error: pki.certificateError.unsupported_certificate - }; - } - } - } - - // 8. check for CA if cert is not first or is the only certificate - // remaining in chain with no parent or is self-signed - if(error === null && - (!first || (chain.length === 0 && (!parent || selfSigned)))) { - // first check keyUsage extension and then basic constraints - var bcExt = cert.getExtension('basicConstraints'); - var keyUsageExt = cert.getExtension('keyUsage'); - if(keyUsageExt !== null) { - // keyCertSign must be true and there must be a basic - // constraints extension - if(!keyUsageExt.keyCertSign || bcExt === null) { - // bad certificate - error = { - message: - 'Certificate keyUsage or basicConstraints conflict ' + - 'or indicate that the certificate is not a CA. ' + - 'If the certificate is the only one in the chain or ' + - 'isn\'t the first then the certificate must be a ' + - 'valid CA.', - error: pki.certificateError.bad_certificate - }; - } - } - // basic constraints cA flag must be set - if(error === null && bcExt !== null && !bcExt.cA) { - // bad certificate - error = { - message: - 'Certificate basicConstraints indicates the certificate ' + - 'is not a CA.', - error: pki.certificateError.bad_certificate - }; - } - // if error is not null and keyUsage is available, then we know it - // has keyCertSign and there is a basic constraints extension too, - // which means we can check pathLenConstraint (if it exists) - if(error === null && keyUsageExt !== null && - 'pathLenConstraint' in bcExt) { - // pathLen is the maximum # of intermediate CA certs that can be - // found between the current certificate and the end-entity (depth 0) - // certificate; this number does not include the end-entity (depth 0, - // last in the chain) even if it happens to be a CA certificate itself - var pathLen = depth - 1; - if(pathLen > bcExt.pathLenConstraint) { - // pathLenConstraint violated, bad certificate - error = { - message: - 'Certificate basicConstraints pathLenConstraint violated.', - error: pki.certificateError.bad_certificate - }; - } - } - } - - // call application callback - var vfd = (error === null) ? true : error.error; - var ret = options.verify ? options.verify(vfd, depth, certs) : vfd; - if(ret === true) { - // clear any set error - error = null; - } else { - // if passed basic tests, set default message and alert - if(vfd === true) { - error = { - message: 'The application rejected the certificate.', - error: pki.certificateError.bad_certificate - }; - } - - // check for custom error info - if(ret || ret === 0) { - // set custom message and error - if(typeof ret === 'object' && !forge.util.isArray(ret)) { - if(ret.message) { - error.message = ret.message; - } - if(ret.error) { - error.error = ret.error; - } - } else if(typeof ret === 'string') { - // set custom error - error.error = ret; - } - } - - // throw error - throw error; - } - - // no longer first cert in chain - first = false; - ++depth; - } while(chain.length > 0); - - return true; -}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/xhr.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/xhr.js deleted file mode 100644 index fa928352..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/lib/xhr.js +++ /dev/null @@ -1,738 +0,0 @@ -/** - * XmlHttpRequest implementation that uses TLS and flash SocketPool. - * - * @author Dave Longley - * - * Copyright (c) 2010-2013 Digital Bazaar, Inc. - */ -var forge = require('./forge'); -require('./socket'); -require('./http'); - -/* XHR API */ -var xhrApi = module.exports = forge.xhr = forge.xhr || {}; - -(function($) { - -// logging category -var cat = 'forge.xhr'; - -/* -XMLHttpRequest interface definition from: -http://www.w3.org/TR/XMLHttpRequest - -interface XMLHttpRequest { - // event handler - attribute EventListener onreadystatechange; - - // state - const unsigned short UNSENT = 0; - const unsigned short OPENED = 1; - const unsigned short HEADERS_RECEIVED = 2; - const unsigned short LOADING = 3; - const unsigned short DONE = 4; - readonly attribute unsigned short readyState; - - // request - void open(in DOMString method, in DOMString url); - void open(in DOMString method, in DOMString url, in boolean async); - void open(in DOMString method, in DOMString url, - in boolean async, in DOMString user); - void open(in DOMString method, in DOMString url, - in boolean async, in DOMString user, in DOMString password); - void setRequestHeader(in DOMString header, in DOMString value); - void send(); - void send(in DOMString data); - void send(in Document data); - void abort(); - - // response - DOMString getAllResponseHeaders(); - DOMString getResponseHeader(in DOMString header); - readonly attribute DOMString responseText; - readonly attribute Document responseXML; - readonly attribute unsigned short status; - readonly attribute DOMString statusText; -}; -*/ - -// readyStates -var UNSENT = 0; -var OPENED = 1; -var HEADERS_RECEIVED = 2; -var LOADING = 3; -var DONE = 4; - -// exceptions -var INVALID_STATE_ERR = 11; -var SYNTAX_ERR = 12; -var SECURITY_ERR = 18; -var NETWORK_ERR = 19; -var ABORT_ERR = 20; - -// private flash socket pool vars -var _sp = null; -var _policyPort = 0; -var _policyUrl = null; - -// default client (used if no special URL provided when creating an XHR) -var _client = null; - -// all clients including the default, key'd by full base url -// (multiple cross-domain http clients are permitted so there may be more -// than one client in this map) -// TODO: provide optional clean up API for non-default clients -var _clients = {}; - -// the default maximum number of concurrents connections per client -var _maxConnections = 10; - -var net = forge.net; -var http = forge.http; - -/** - * Initializes flash XHR support. - * - * @param options: - * url: the default base URL to connect to if xhr URLs are relative, - * ie: https://myserver.com. - * flashId: the dom ID of the flash SocketPool. - * policyPort: the port that provides the server's flash policy, 0 to use - * the flash default. - * policyUrl: the policy file URL to use instead of a policy port. - * msie: true if browser is internet explorer, false if not. - * connections: the maximum number of concurrent connections. - * caCerts: a list of PEM-formatted certificates to trust. - * cipherSuites: an optional array of cipher suites to use, - * see forge.tls.CipherSuites. - * verify: optional TLS certificate verify callback to use (see forge.tls - * for details). - * getCertificate: an optional callback used to get a client-side - * certificate (see forge.tls for details). - * getPrivateKey: an optional callback used to get a client-side private - * key (see forge.tls for details). - * getSignature: an optional callback used to get a client-side signature - * (see forge.tls for details). - * persistCookies: true to use persistent cookies via flash local storage, - * false to only keep cookies in javascript. - * primeTlsSockets: true to immediately connect TLS sockets on their - * creation so that they will cache TLS sessions for reuse. - */ -xhrApi.init = function(options) { - forge.log.debug(cat, 'initializing', options); - - // update default policy port and max connections - _policyPort = options.policyPort || _policyPort; - _policyUrl = options.policyUrl || _policyUrl; - _maxConnections = options.connections || _maxConnections; - - // create the flash socket pool - _sp = net.createSocketPool({ - flashId: options.flashId, - policyPort: _policyPort, - policyUrl: _policyUrl, - msie: options.msie || false - }); - - // create default http client - _client = http.createClient({ - url: options.url || ( - window.location.protocol + '//' + window.location.host), - socketPool: _sp, - policyPort: _policyPort, - policyUrl: _policyUrl, - connections: options.connections || _maxConnections, - caCerts: options.caCerts, - cipherSuites: options.cipherSuites, - persistCookies: options.persistCookies || true, - primeTlsSockets: options.primeTlsSockets || false, - verify: options.verify, - getCertificate: options.getCertificate, - getPrivateKey: options.getPrivateKey, - getSignature: options.getSignature - }); - _clients[_client.url.origin] = _client; - - forge.log.debug(cat, 'ready'); -}; - -/** - * Called to clean up the clients and socket pool. - */ -xhrApi.cleanup = function() { - // destroy all clients - for(var key in _clients) { - _clients[key].destroy(); - } - _clients = {}; - _client = null; - - // destroy socket pool - _sp.destroy(); - _sp = null; -}; - -/** - * Sets a cookie. - * - * @param cookie the cookie with parameters: - * name: the name of the cookie. - * value: the value of the cookie. - * comment: an optional comment string. - * maxAge: the age of the cookie in seconds relative to created time. - * secure: true if the cookie must be sent over a secure protocol. - * httpOnly: true to restrict access to the cookie from javascript - * (inaffective since the cookies are stored in javascript). - * path: the path for the cookie. - * domain: optional domain the cookie belongs to (must start with dot). - * version: optional version of the cookie. - * created: creation time, in UTC seconds, of the cookie. - */ -xhrApi.setCookie = function(cookie) { - // default cookie expiration to never - cookie.maxAge = cookie.maxAge || -1; - - // if the cookie's domain is set, use the appropriate client - if(cookie.domain) { - // add the cookies to the applicable domains - for(var key in _clients) { - var client = _clients[key]; - if(http.withinCookieDomain(client.url, cookie) && - client.secure === cookie.secure) { - client.setCookie(cookie); - } - } - } else { - // use the default domain - // FIXME: should a null domain cookie be added to all clients? should - // this be an option? - _client.setCookie(cookie); - } -}; - -/** - * Gets a cookie. - * - * @param name the name of the cookie. - * @param path an optional path for the cookie (if there are multiple cookies - * with the same name but different paths). - * @param domain an optional domain for the cookie (if not using the default - * domain). - * - * @return the cookie, cookies (if multiple matches), or null if not found. - */ -xhrApi.getCookie = function(name, path, domain) { - var rval = null; - - if(domain) { - // get the cookies from the applicable domains - for(var key in _clients) { - var client = _clients[key]; - if(http.withinCookieDomain(client.url, domain)) { - var cookie = client.getCookie(name, path); - if(cookie !== null) { - if(rval === null) { - rval = cookie; - } else if(!forge.util.isArray(rval)) { - rval = [rval, cookie]; - } else { - rval.push(cookie); - } - } - } - } - } else { - // get cookie from default domain - rval = _client.getCookie(name, path); - } - - return rval; -}; - -/** - * Removes a cookie. - * - * @param name the name of the cookie. - * @param path an optional path for the cookie (if there are multiple cookies - * with the same name but different paths). - * @param domain an optional domain for the cookie (if not using the default - * domain). - * - * @return true if a cookie was removed, false if not. - */ -xhrApi.removeCookie = function(name, path, domain) { - var rval = false; - - if(domain) { - // remove the cookies from the applicable domains - for(var key in _clients) { - var client = _clients[key]; - if(http.withinCookieDomain(client.url, domain)) { - if(client.removeCookie(name, path)) { - rval = true; - } - } - } - } else { - // remove cookie from default domain - rval = _client.removeCookie(name, path); - } - - return rval; -}; - -/** - * Creates a new XmlHttpRequest. By default the base URL, flash policy port, - * etc, will be used. However, an XHR can be created to point at another - * cross-domain URL. - * - * @param options: - * logWarningOnError: If true and an HTTP error status code is received then - * log a warning, otherwise log a verbose message. - * verbose: If true be very verbose in the output including the response - * event and response body, otherwise only include status, timing, and - * data size. - * logError: a multi-var log function for warnings that takes the log - * category as the first var. - * logWarning: a multi-var log function for warnings that takes the log - * category as the first var. - * logDebug: a multi-var log function for warnings that takes the log - * category as the first var. - * logVerbose: a multi-var log function for warnings that takes the log - * category as the first var. - * url: the default base URL to connect to if xhr URLs are relative, - * eg: https://myserver.com, and note that the following options will be - * ignored if the URL is absent or the same as the default base URL. - * policyPort: the port that provides the server's flash policy, 0 to use - * the flash default. - * policyUrl: the policy file URL to use instead of a policy port. - * connections: the maximum number of concurrent connections. - * caCerts: a list of PEM-formatted certificates to trust. - * cipherSuites: an optional array of cipher suites to use, see - * forge.tls.CipherSuites. - * verify: optional TLS certificate verify callback to use (see forge.tls - * for details). - * getCertificate: an optional callback used to get a client-side - * certificate. - * getPrivateKey: an optional callback used to get a client-side private key. - * getSignature: an optional callback used to get a client-side signature. - * persistCookies: true to use persistent cookies via flash local storage, - * false to only keep cookies in javascript. - * primeTlsSockets: true to immediately connect TLS sockets on their - * creation so that they will cache TLS sessions for reuse. - * - * @return the XmlHttpRequest. - */ -xhrApi.create = function(options) { - // set option defaults - options = $.extend({ - logWarningOnError: true, - verbose: false, - logError: function() {}, - logWarning: function() {}, - logDebug: function() {}, - logVerbose: function() {}, - url: null - }, options || {}); - - // private xhr state - var _state = { - // the http client to use - client: null, - // request storage - request: null, - // response storage - response: null, - // asynchronous, true if doing asynchronous communication - asynchronous: true, - // sendFlag, true if send has been called - sendFlag: false, - // errorFlag, true if a network error occurred - errorFlag: false - }; - - // private log functions - var _log = { - error: options.logError || forge.log.error, - warning: options.logWarning || forge.log.warning, - debug: options.logDebug || forge.log.debug, - verbose: options.logVerbose || forge.log.verbose - }; - - // create public xhr interface - var xhr = { - // an EventListener - onreadystatechange: null, - // readonly, the current readyState - readyState: UNSENT, - // a string with the response entity-body - responseText: '', - // a Document for response entity-bodies that are XML - responseXML: null, - // readonly, returns the HTTP status code (i.e. 404) - status: 0, - // readonly, returns the HTTP status message (i.e. 'Not Found') - statusText: '' - }; - - // determine which http client to use - if(options.url === null) { - // use default - _state.client = _client; - } else { - var url; - try { - url = new URL(options.url); - } catch(e) { - var error = new Error('Invalid url.'); - error.details = { - url: options.url - }; - } - - // find client - if(url.origin in _clients) { - // client found - _state.client = _clients[url.origin]; - } else { - // create client - _state.client = http.createClient({ - url: options.url, - socketPool: _sp, - policyPort: options.policyPort || _policyPort, - policyUrl: options.policyUrl || _policyUrl, - connections: options.connections || _maxConnections, - caCerts: options.caCerts, - cipherSuites: options.cipherSuites, - persistCookies: options.persistCookies || true, - primeTlsSockets: options.primeTlsSockets || false, - verify: options.verify, - getCertificate: options.getCertificate, - getPrivateKey: options.getPrivateKey, - getSignature: options.getSignature - }); - _clients[url.origin] = _state.client; - } - } - - /** - * Opens the request. This method will create the HTTP request to send. - * - * @param method the HTTP method (i.e. 'GET'). - * @param url the relative url (the HTTP request path). - * @param async always true, ignored. - * @param user always null, ignored. - * @param password always null, ignored. - */ - xhr.open = function(method, url, async, user, password) { - // 1. validate Document if one is associated - // TODO: not implemented (not used yet) - - // 2. validate method token - // 3. change method to uppercase if it matches a known - // method (here we just require it to be uppercase, and - // we do not allow the standard methods) - // 4. disallow CONNECT, TRACE, or TRACK with a security error - switch(method) { - case 'DELETE': - case 'GET': - case 'HEAD': - case 'OPTIONS': - case 'PATCH': - case 'POST': - case 'PUT': - // valid method - break; - case 'CONNECT': - case 'TRACE': - case 'TRACK': - throw new Error('CONNECT, TRACE and TRACK methods are disallowed'); - default: - throw new Error('Invalid method: ' + method); - } - - // TODO: other validation steps in algorithm are not implemented - - // 19. set send flag to false - // set response body to null - // empty list of request headers - // set request method to given method - // set request URL - // set username, password - // set asychronous flag - _state.sendFlag = false; - xhr.responseText = ''; - xhr.responseXML = null; - - // custom: reset status and statusText - xhr.status = 0; - xhr.statusText = ''; - - // create the HTTP request - _state.request = http.createRequest({ - method: method, - path: url - }); - - // 20. set state to OPENED - xhr.readyState = OPENED; - - // 21. dispatch onreadystatechange - if(xhr.onreadystatechange) { - xhr.onreadystatechange(); - } - }; - - /** - * Adds an HTTP header field to the request. - * - * @param header the name of the header field. - * @param value the value of the header field. - */ - xhr.setRequestHeader = function(header, value) { - // 1. if state is not OPENED or send flag is true, raise exception - if(xhr.readyState != OPENED || _state.sendFlag) { - throw new Error('XHR not open or sending'); - } - - // TODO: other validation steps in spec aren't implemented - - // set header - _state.request.setField(header, value); - }; - - /** - * Sends the request and any associated data. - * - * @param data a string or Document object to send, null to send no data. - */ - xhr.send = function(data) { - // 1. if state is not OPENED or 2. send flag is true, raise - // an invalid state exception - if(xhr.readyState != OPENED || _state.sendFlag) { - throw new Error('XHR not open or sending'); - } - - // 3. ignore data if method is GET or HEAD - if(data && - _state.request.method !== 'GET' && - _state.request.method !== 'HEAD') { - // handle non-IE case - if(typeof(XMLSerializer) !== 'undefined') { - if(data instanceof Document) { - var xs = new XMLSerializer(); - _state.request.body = xs.serializeToString(data); - } else { - _state.request.body = data; - } - } else { - // poorly implemented IE case - if(typeof(data.xml) !== 'undefined') { - _state.request.body = data.xml; - } else { - _state.request.body = data; - } - } - } - - // 4. release storage mutex (not used) - - // 5. set error flag to false - _state.errorFlag = false; - - // 6. if asynchronous is true (must be in this implementation) - - // 6.1 set send flag to true - _state.sendFlag = true; - - // 6.2 dispatch onreadystatechange - if(xhr.onreadystatechange) { - xhr.onreadystatechange(); - } - - // create send options - var options = {}; - options.request = _state.request; - options.headerReady = function(e) { - // make cookies available for ease of use/iteration - xhr.cookies = _state.client.cookies; - - // TODO: update document.cookie with any cookies where the - // script's domain matches - - // headers received - xhr.readyState = HEADERS_RECEIVED; - xhr.status = e.response.code; - xhr.statusText = e.response.message; - _state.response = e.response; - if(xhr.onreadystatechange) { - xhr.onreadystatechange(); - } - if(!_state.response.aborted) { - // now loading body - xhr.readyState = LOADING; - if(xhr.onreadystatechange) { - xhr.onreadystatechange(); - } - } - }; - options.bodyReady = function(e) { - xhr.readyState = DONE; - var ct = e.response.getField('Content-Type'); - // Note: this null/undefined check is done outside because IE - // dies otherwise on a "'null' is null" error - if(ct) { - if(ct.indexOf('text/xml') === 0 || - ct.indexOf('application/xml') === 0 || - ct.indexOf('+xml') !== -1) { - try { - var doc = new ActiveXObject('MicrosoftXMLDOM'); - doc.async = false; - doc.loadXML(e.response.body); - xhr.responseXML = doc; - } catch(ex) { - var parser = new DOMParser(); - xhr.responseXML = parser.parseFromString(ex.body, 'text/xml'); - } - } - } - - var length = 0; - if(e.response.body !== null) { - xhr.responseText = e.response.body; - length = e.response.body.length; - } - // build logging output - var req = _state.request; - var output = - req.method + ' ' + req.path + ' ' + - xhr.status + ' ' + xhr.statusText + ' ' + - length + 'B ' + - (e.request.connectTime + e.request.time + e.response.time) + - 'ms'; - var lFunc; - if(options.verbose) { - lFunc = (xhr.status >= 400 && options.logWarningOnError) ? - _log.warning : _log.verbose; - lFunc(cat, output, - e, e.response.body ? '\n' + e.response.body : '\nNo content'); - } else { - lFunc = (xhr.status >= 400 && options.logWarningOnError) ? - _log.warning : _log.debug; - lFunc(cat, output); - } - if(xhr.onreadystatechange) { - xhr.onreadystatechange(); - } - }; - options.error = function(e) { - var req = _state.request; - _log.error(cat, req.method + ' ' + req.path, e); - - // 1. set response body to null - xhr.responseText = ''; - xhr.responseXML = null; - - // 2. set error flag to true (and reset status) - _state.errorFlag = true; - xhr.status = 0; - xhr.statusText = ''; - - // 3. set state to done - xhr.readyState = DONE; - - // 4. asyc flag is always true, so dispatch onreadystatechange - if(xhr.onreadystatechange) { - xhr.onreadystatechange(); - } - }; - - // 7. send request - _state.client.send(options); - }; - - /** - * Aborts the request. - */ - xhr.abort = function() { - // 1. abort send - // 2. stop network activity - _state.request.abort(); - - // 3. set response to null - xhr.responseText = ''; - xhr.responseXML = null; - - // 4. set error flag to true (and reset status) - _state.errorFlag = true; - xhr.status = 0; - xhr.statusText = ''; - - // 5. clear user headers - _state.request = null; - _state.response = null; - - // 6. if state is DONE or UNSENT, or if OPENED and send flag is false - if(xhr.readyState === DONE || xhr.readyState === UNSENT || - (xhr.readyState === OPENED && !_state.sendFlag)) { - // 7. set ready state to unsent - xhr.readyState = UNSENT; - } else { - // 6.1 set state to DONE - xhr.readyState = DONE; - - // 6.2 set send flag to false - _state.sendFlag = false; - - // 6.3 dispatch onreadystatechange - if(xhr.onreadystatechange) { - xhr.onreadystatechange(); - } - - // 7. set state to UNSENT - xhr.readyState = UNSENT; - } - }; - - /** - * Gets all response headers as a string. - * - * @return the HTTP-encoded response header fields. - */ - xhr.getAllResponseHeaders = function() { - var rval = ''; - if(_state.response !== null) { - var fields = _state.response.fields; - $.each(fields, function(name, array) { - $.each(array, function(i, value) { - rval += name + ': ' + value + '\r\n'; - }); - }); - } - return rval; - }; - - /** - * Gets a single header field value or, if there are multiple - * fields with the same name, a comma-separated list of header - * values. - * - * @return the header field value(s) or null. - */ - xhr.getResponseHeader = function(header) { - var rval = null; - if(_state.response !== null) { - if(header in _state.response.fields) { - rval = _state.response.fields[header]; - if(forge.util.isArray(rval)) { - rval = rval.join(); - } - } - } - return rval; - }; - - return xhr; -}; - -})(jQuery); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/package.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/package.json deleted file mode 100644 index 1a63de15..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/node-forge/package.json +++ /dev/null @@ -1,123 +0,0 @@ -{ - "name": "node-forge", - "version": "1.3.1", - "description": "JavaScript implementations of network transports, cryptography, ciphers, PKI, message digests, and various utilities.", - "homepage": "https://github.com/digitalbazaar/forge", - "author": { - "name": "Digital Bazaar, Inc.", - "email": "support@digitalbazaar.com", - "url": "http://digitalbazaar.com/" - }, - "contributors": [ - "Dave Longley ", - "David I. Lehn ", - "Stefan Siegl ", - "Christoph Dorn " - ], - "devDependencies": { - "browserify": "^16.5.2", - "commander": "^2.20.0", - "cross-env": "^5.2.1", - "eslint": "^7.27.0", - "eslint-config-digitalbazaar": "^2.8.0", - "express": "^4.16.2", - "karma": "^4.4.1", - "karma-browserify": "^7.0.0", - "karma-chrome-launcher": "^3.1.0", - "karma-edge-launcher": "^0.4.2", - "karma-firefox-launcher": "^1.3.0", - "karma-ie-launcher": "^1.0.0", - "karma-mocha": "^1.3.0", - "karma-mocha-reporter": "^2.2.5", - "karma-safari-launcher": "^1.0.0", - "karma-sauce-launcher": "^2.0.2", - "karma-sourcemap-loader": "^0.3.8", - "karma-tap-reporter": "0.0.6", - "karma-webpack": "^4.0.2", - "mocha": "^5.2.0", - "mocha-lcov-reporter": "^1.2.0", - "nodejs-websocket": "^1.7.1", - "nyc": "^15.1.0", - "opts": "^1.2.7", - "webpack": "^4.44.1", - "webpack-cli": "^3.3.12", - "worker-loader": "^2.0.0" - }, - "repository": { - "type": "git", - "url": "https://github.com/digitalbazaar/forge" - }, - "bugs": { - "url": "https://github.com/digitalbazaar/forge/issues", - "email": "support@digitalbazaar.com" - }, - "license": "(BSD-3-Clause OR GPL-2.0)", - "main": "lib/index.js", - "files": [ - "lib/*.js", - "flash/swf/*.swf", - "dist/*.min.js", - "dist/*.min.js.map" - ], - "engines": { - "node": ">= 6.13.0" - }, - "keywords": [ - "aes", - "asn", - "asn.1", - "cbc", - "crypto", - "cryptography", - "csr", - "des", - "gcm", - "hmac", - "http", - "https", - "md5", - "network", - "pkcs", - "pki", - "prng", - "rc2", - "rsa", - "sha1", - "sha256", - "sha384", - "sha512", - "ssh", - "tls", - "x.509", - "x509" - ], - "scripts": { - "prepublish": "npm run build", - "build": "webpack", - "test-build": "webpack --config webpack-tests.config.js", - "test": "npm run test-node", - "test-node": "cross-env NODE_ENV=test mocha -t 30000 -R ${REPORTER:-spec} tests/unit/index.js", - "test-karma": "karma start", - "test-karma-sauce": "karma start karma-sauce.conf", - "test-server": "node tests/server.js", - "test-server-ws": "node tests/websockets/server-ws.js", - "test-server-webid": "node tests/websockets/server-webid.js", - "coverage": "rm -rf coverage && nyc --reporter=lcov --reporter=text-summary npm test", - "coverage-ci": "rm -rf coverage && nyc --reporter=lcovonly npm test", - "coverage-report": "nyc report", - "lint": "eslint *.js lib/*.js tests/*.js tests/**/*.js examples/*.js flash/*.js" - }, - "nyc": { - "exclude": [ - "tests" - ] - }, - "jspm": { - "format": "amd" - }, - "browser": { - "buffer": false, - "crypto": false, - "process": false - } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/object-hash/LICENSE b/packages/wyatt_notification_bloc/example/scripts/node_modules/object-hash/LICENSE deleted file mode 100644 index 6ea185fa..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/object-hash/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014 object-hash contributors - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/object-hash/dist/object_hash.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/object-hash/dist/object_hash.js deleted file mode 100644 index 2e584c57..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/object-hash/dist/object_hash.js +++ /dev/null @@ -1 +0,0 @@ -!function(e){var t;"object"==typeof exports?module.exports=e():"function"==typeof define&&define.amd?define(e):("undefined"!=typeof window?t=window:"undefined"!=typeof global?t=global:"undefined"!=typeof self&&(t=self),t.objectHash=e())}(function(){return function r(o,i,u){function s(n,e){if(!i[n]){if(!o[n]){var t="function"==typeof require&&require;if(!e&&t)return t(n,!0);if(a)return a(n,!0);throw new Error("Cannot find module '"+n+"'")}e=i[n]={exports:{}};o[n][0].call(e.exports,function(e){var t=o[n][1][e];return s(t||e)},e,e.exports,r,o,i,u)}return i[n].exports}for(var a="function"==typeof require&&require,e=0;e>16),s((65280&n)>>8),s(255&n);return 2==r?s(255&(n=f(e.charAt(t))<<2|f(e.charAt(t+1))>>4)):1==r&&(s((n=f(e.charAt(t))<<10|f(e.charAt(t+1))<<4|f(e.charAt(t+2))>>2)>>8&255),s(255&n)),o},e.fromByteArray=function(e){var t,n,r,o,i=e.length%3,u="";function s(e){return"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e)}for(t=0,r=e.length-i;t>18&63)+s(o>>12&63)+s(o>>6&63)+s(63&o);switch(i){case 1:u=(u+=s((n=e[e.length-1])>>2))+s(n<<4&63)+"==";break;case 2:u=(u=(u+=s((n=(e[e.length-2]<<8)+e[e.length-1])>>10))+s(n>>4&63))+s(n<<2&63)+"="}return u}}(void 0===f?this.base64js={}:f)}.call(this,e("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/base64-js/lib/b64.js","/node_modules/gulp-browserify/node_modules/base64-js/lib")},{buffer:3,lYpoI2:11}],3:[function(O,e,H){!function(e,n,f,r,h,p,g,y,w){var a=O("base64-js"),i=O("ieee754");function f(e,t,n){if(!(this instanceof f))return new f(e,t,n);var r,o,i,u,s=typeof e;if("base64"===t&&"string"==s)for(e=(u=e).trim?u.trim():u.replace(/^\s+|\s+$/g,"");e.length%4!=0;)e+="=";if("number"==s)r=j(e);else if("string"==s)r=f.byteLength(e,t);else{if("object"!=s)throw new Error("First argument needs to be a number, array or string.");r=j(e.length)}if(f._useTypedArrays?o=f._augment(new Uint8Array(r)):((o=this).length=r,o._isBuffer=!0),f._useTypedArrays&&"number"==typeof e.byteLength)o._set(e);else if(C(u=e)||f.isBuffer(u)||u&&"object"==typeof u&&"number"==typeof u.length)for(i=0;i>8,n=n%256,r.push(n),r.push(t);return r}(t),e,n,r)}function v(e,t,n){var r="";n=Math.min(e.length,n);for(var o=t;o>>0)):(t+1>>0),o}function _(e,t,n,r){if(r||(d("boolean"==typeof n,"missing or invalid endian"),d(null!=t,"missing offset"),d(t+1>>8*(r?i:1-i)}function l(e,t,n,r,o){o||(d(null!=t,"missing value"),d("boolean"==typeof r,"missing or invalid endian"),d(null!=n,"missing offset"),d(n+3>>8*(r?i:3-i)&255}function B(e,t,n,r,o){o||(d(null!=t,"missing value"),d("boolean"==typeof r,"missing or invalid endian"),d(null!=n,"missing offset"),d(n+1this.length&&(r=this.length);var o=(r=e.length-t=this.length))return this[e]},f.prototype.readUInt16LE=function(e,t){return o(this,e,!0,t)},f.prototype.readUInt16BE=function(e,t){return o(this,e,!1,t)},f.prototype.readUInt32LE=function(e,t){return u(this,e,!0,t)},f.prototype.readUInt32BE=function(e,t){return u(this,e,!1,t)},f.prototype.readInt8=function(e,t){if(t||(d(null!=e,"missing offset"),d(e=this.length))return 128&this[e]?-1*(255-this[e]+1):this[e]},f.prototype.readInt16LE=function(e,t){return _(this,e,!0,t)},f.prototype.readInt16BE=function(e,t){return _(this,e,!1,t)},f.prototype.readInt32LE=function(e,t){return E(this,e,!0,t)},f.prototype.readInt32BE=function(e,t){return E(this,e,!1,t)},f.prototype.readFloatLE=function(e,t){return I(this,e,!0,t)},f.prototype.readFloatBE=function(e,t){return I(this,e,!1,t)},f.prototype.readDoubleLE=function(e,t){return A(this,e,!0,t)},f.prototype.readDoubleBE=function(e,t){return A(this,e,!1,t)},f.prototype.writeUInt8=function(e,t,n){n||(d(null!=e,"missing value"),d(null!=t,"missing offset"),d(t=this.length||(this[t]=e)},f.prototype.writeUInt16LE=function(e,t,n){s(this,e,t,!0,n)},f.prototype.writeUInt16BE=function(e,t,n){s(this,e,t,!1,n)},f.prototype.writeUInt32LE=function(e,t,n){l(this,e,t,!0,n)},f.prototype.writeUInt32BE=function(e,t,n){l(this,e,t,!1,n)},f.prototype.writeInt8=function(e,t,n){n||(d(null!=e,"missing value"),d(null!=t,"missing offset"),d(t=this.length||(0<=e?this.writeUInt8(e,t,n):this.writeUInt8(255+e+1,t,n))},f.prototype.writeInt16LE=function(e,t,n){B(this,e,t,!0,n)},f.prototype.writeInt16BE=function(e,t,n){B(this,e,t,!1,n)},f.prototype.writeInt32LE=function(e,t,n){L(this,e,t,!0,n)},f.prototype.writeInt32BE=function(e,t,n){L(this,e,t,!1,n)},f.prototype.writeFloatLE=function(e,t,n){U(this,e,t,!0,n)},f.prototype.writeFloatBE=function(e,t,n){U(this,e,t,!1,n)},f.prototype.writeDoubleLE=function(e,t,n){x(this,e,t,!0,n)},f.prototype.writeDoubleBE=function(e,t,n){x(this,e,t,!1,n)},f.prototype.fill=function(e,t,n){if(t=t||0,n=n||this.length,d("number"==typeof(e="string"==typeof(e=e||0)?e.charCodeAt(0):e)&&!isNaN(e),"value is not a number"),d(t<=n,"end < start"),n!==t&&0!==this.length){d(0<=t&&t"},f.prototype.toArrayBuffer=function(){if("undefined"==typeof Uint8Array)throw new Error("Buffer.toArrayBuffer not supported in this browser");if(f._useTypedArrays)return new f(this).buffer;for(var e=new Uint8Array(this.length),t=0,n=e.length;t=t.length||o>=e.length);o++)t[o+n]=e[o];return o}function N(e){try{return decodeURIComponent(e)}catch(e){return String.fromCharCode(65533)}}function Y(e,t){d("number"==typeof e,"cannot write a non-number as a number"),d(0<=e,"specified a negative value for writing an unsigned value"),d(e<=t,"value is larger than maximum value for type"),d(Math.floor(e)===e,"value has a fractional component")}function F(e,t,n){d("number"==typeof e,"cannot write a non-number as a number"),d(e<=t,"value larger than maximum allowed value"),d(n<=e,"value smaller than minimum allowed value"),d(Math.floor(e)===e,"value has a fractional component")}function D(e,t,n){d("number"==typeof e,"cannot write a non-number as a number"),d(e<=t,"value larger than maximum allowed value"),d(n<=e,"value smaller than minimum allowed value")}function d(e,t){if(!e)throw new Error(t||"Failed assertion")}f._augment=function(e){return e._isBuffer=!0,e._get=e.get,e._set=e.set,e.get=t.get,e.set=t.set,e.write=t.write,e.toString=t.toString,e.toLocaleString=t.toString,e.toJSON=t.toJSON,e.copy=t.copy,e.slice=t.slice,e.readUInt8=t.readUInt8,e.readUInt16LE=t.readUInt16LE,e.readUInt16BE=t.readUInt16BE,e.readUInt32LE=t.readUInt32LE,e.readUInt32BE=t.readUInt32BE,e.readInt8=t.readInt8,e.readInt16LE=t.readInt16LE,e.readInt16BE=t.readInt16BE,e.readInt32LE=t.readInt32LE,e.readInt32BE=t.readInt32BE,e.readFloatLE=t.readFloatLE,e.readFloatBE=t.readFloatBE,e.readDoubleLE=t.readDoubleLE,e.readDoubleBE=t.readDoubleBE,e.writeUInt8=t.writeUInt8,e.writeUInt16LE=t.writeUInt16LE,e.writeUInt16BE=t.writeUInt16BE,e.writeUInt32LE=t.writeUInt32LE,e.writeUInt32BE=t.writeUInt32BE,e.writeInt8=t.writeInt8,e.writeInt16LE=t.writeInt16LE,e.writeInt16BE=t.writeInt16BE,e.writeInt32LE=t.writeInt32LE,e.writeInt32BE=t.writeInt32BE,e.writeFloatLE=t.writeFloatLE,e.writeFloatBE=t.writeFloatBE,e.writeDoubleLE=t.writeDoubleLE,e.writeDoubleBE=t.writeDoubleBE,e.fill=t.fill,e.inspect=t.inspect,e.toArrayBuffer=t.toArrayBuffer,e}}.call(this,O("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},O("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/buffer/index.js","/node_modules/gulp-browserify/node_modules/buffer")},{"base64-js":2,buffer:3,ieee754:10,lYpoI2:11}],4:[function(c,d,e){!function(e,t,a,n,r,o,i,u,s){var a=c("buffer").Buffer,f=4,l=new a(f);l.fill(0);d.exports={hash:function(e,t,n,r){for(var o=t(function(e,t){e.length%f!=0&&(n=e.length+(f-e.length%f),e=a.concat([e,l],n));for(var n,r=[],o=t?e.readInt32BE:e.readInt32LE,i=0;is?t=e(t):t.length>5]|=128<>>9<<4)]=t;for(var n=1732584193,r=-271733879,o=-1732584194,i=271733878,u=0;u>>32-o,n)}function c(e,t,n,r,o,i,u){return s(t&n|~t&r,e,t,o,i,u)}function d(e,t,n,r,o,i,u){return s(t&r|n&~r,e,t,o,i,u)}function h(e,t,n,r,o,i,u){return s(t^n^r,e,t,o,i,u)}function p(e,t,n,r,o,i,u){return s(n^(t|~r),e,t,o,i,u)}function g(e,t){var n=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(n>>16)<<16|65535&n}b.exports=function(e){return t.hash(e,n,16)}}.call(this,w("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},w("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/md5.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./helpers":4,buffer:3,lYpoI2:11}],7:[function(e,l,t){!function(e,t,n,r,o,i,u,s,f){var a;l.exports=a||function(e){for(var t,n=new Array(e),r=0;r>>((3&r)<<3)&255;return n}}.call(this,e("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/rng.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{buffer:3,lYpoI2:11}],8:[function(c,d,e){!function(e,t,n,r,o,s,a,f,l){var i=c("./helpers");function u(l,c){l[c>>5]|=128<<24-c%32,l[15+(c+64>>9<<4)]=c;for(var e,t,n,r=Array(80),o=1732584193,i=-271733879,u=-1732584194,s=271733878,d=-1009589776,h=0;h>16)+(t>>16)+(n>>16)<<16|65535&n}function v(e,t){return e<>>32-t}d.exports=function(e){return i.hash(e,u,20,!0)}}.call(this,c("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},c("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/sha.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./helpers":4,buffer:3,lYpoI2:11}],9:[function(c,d,e){!function(e,t,n,r,u,s,a,f,l){function b(e,t){var n=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(n>>16)<<16|65535&n}function o(e,l){var c,d=new Array(1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298),t=new Array(1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225),n=new Array(64);e[l>>5]|=128<<24-l%32,e[15+(l+64>>9<<4)]=l;for(var r,o,h=0;h>>t|e<<32-t},v=function(e,t){return e>>>t};d.exports=function(e){return i.hash(e,o,32,!0)}}.call(this,c("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},c("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/sha256.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./helpers":4,buffer:3,lYpoI2:11}],10:[function(e,t,f){!function(e,t,n,r,o,i,u,s,a){f.read=function(e,t,n,r,o){var i,u,l=8*o-r-1,c=(1<>1,s=-7,a=n?o-1:0,f=n?-1:1,o=e[t+a];for(a+=f,i=o&(1<<-s)-1,o>>=-s,s+=l;0>=-s,s+=r;0>1,d=23===r?Math.pow(2,-24)-Math.pow(2,-77):0,f=n?0:c-1,h=n?1:-1,c=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(i=isNaN(t)?1:0,o=s):(o=Math.floor(Math.log(t)/Math.LN2),t*(n=Math.pow(2,-o))<1&&(o--,n*=2),2<=(t+=1<=o+a?d/n:d*Math.pow(2,1-a))*n&&(o++,n/=2),s<=o+a?(i=0,o=s):1<=o+a?(i=(t*n-1)*Math.pow(2,r),o+=a):(i=t*Math.pow(2,a-1)*Math.pow(2,r),o=0));8<=r;e[l+f]=255&i,f+=h,i/=256,r-=8);for(o=o<", type, " -> ", "_" + type); - - return this['_' + type](value); - }, - _object: function(object) { - var pattern = (/\[object (.*)\]/i); - var objString = Object.prototype.toString.call(object); - var objType = pattern.exec(objString); - if (!objType) { // object type did not match [object ...] - objType = 'unknown:[' + objString + ']'; - } else { - objType = objType[1]; // take only the class name - } - - objType = objType.toLowerCase(); - - var objectNumber = null; - - if ((objectNumber = context.indexOf(object)) >= 0) { - return this.dispatch('[CIRCULAR:' + objectNumber + ']'); - } else { - context.push(object); - } - - if (typeof Buffer !== 'undefined' && Buffer.isBuffer && Buffer.isBuffer(object)) { - write('buffer:'); - return write(object); - } - - if(objType !== 'object' && objType !== 'function' && objType !== 'asyncfunction') { - if(this['_' + objType]) { - this['_' + objType](object); - } else if (options.ignoreUnknown) { - return write('[' + objType + ']'); - } else { - throw new Error('Unknown object type "' + objType + '"'); - } - }else{ - var keys = Object.keys(object); - if (options.unorderedObjects) { - keys = keys.sort(); - } - // Make sure to incorporate special properties, so - // Types with different prototypes will produce - // a different hash and objects derived from - // different functions (`new Foo`, `new Bar`) will - // produce different hashes. - // We never do this for native functions since some - // seem to break because of that. - if (options.respectType !== false && !isNativeFunction(object)) { - keys.splice(0, 0, 'prototype', '__proto__', 'constructor'); - } - - if (options.excludeKeys) { - keys = keys.filter(function(key) { return !options.excludeKeys(key); }); - } - - write('object:' + keys.length + ':'); - var self = this; - return keys.forEach(function(key){ - self.dispatch(key); - write(':'); - if(!options.excludeValues) { - self.dispatch(object[key]); - } - write(','); - }); - } - }, - _array: function(arr, unordered){ - unordered = typeof unordered !== 'undefined' ? unordered : - options.unorderedArrays !== false; // default to options.unorderedArrays - - var self = this; - write('array:' + arr.length + ':'); - if (!unordered || arr.length <= 1) { - return arr.forEach(function(entry) { - return self.dispatch(entry); - }); - } - - // the unordered case is a little more complicated: - // since there is no canonical ordering on objects, - // i.e. {a:1} < {a:2} and {a:1} > {a:2} are both false, - // we first serialize each entry using a PassThrough stream - // before sorting. - // also: we can’t use the same context array for all entries - // since the order of hashing should *not* matter. instead, - // we keep track of the additions to a copy of the context array - // and add all of them to the global context array when we’re done - var contextAdditions = []; - var entries = arr.map(function(entry) { - var strm = new PassThrough(); - var localContext = context.slice(); // make copy - var hasher = typeHasher(options, strm, localContext); - hasher.dispatch(entry); - // take only what was added to localContext and append it to contextAdditions - contextAdditions = contextAdditions.concat(localContext.slice(context.length)); - return strm.read().toString(); - }); - context = context.concat(contextAdditions); - entries.sort(); - return this._array(entries, false); - }, - _date: function(date){ - return write('date:' + date.toJSON()); - }, - _symbol: function(sym){ - return write('symbol:' + sym.toString()); - }, - _error: function(err){ - return write('error:' + err.toString()); - }, - _boolean: function(bool){ - return write('bool:' + bool.toString()); - }, - _string: function(string){ - write('string:' + string.length + ':'); - write(string.toString()); - }, - _function: function(fn){ - write('fn:'); - if (isNativeFunction(fn)) { - this.dispatch('[native]'); - } else { - this.dispatch(fn.toString()); - } - - if (options.respectFunctionNames !== false) { - // Make sure we can still distinguish native functions - // by their name, otherwise String and Function will - // have the same hash - this.dispatch("function-name:" + String(fn.name)); - } - - if (options.respectFunctionProperties) { - this._object(fn); - } - }, - _number: function(number){ - return write('number:' + number.toString()); - }, - _xml: function(xml){ - return write('xml:' + xml.toString()); - }, - _null: function() { - return write('Null'); - }, - _undefined: function() { - return write('Undefined'); - }, - _regexp: function(regex){ - return write('regex:' + regex.toString()); - }, - _uint8array: function(arr){ - write('uint8array:'); - return this.dispatch(Array.prototype.slice.call(arr)); - }, - _uint8clampedarray: function(arr){ - write('uint8clampedarray:'); - return this.dispatch(Array.prototype.slice.call(arr)); - }, - _int8array: function(arr){ - write('int8array:'); - return this.dispatch(Array.prototype.slice.call(arr)); - }, - _uint16array: function(arr){ - write('uint16array:'); - return this.dispatch(Array.prototype.slice.call(arr)); - }, - _int16array: function(arr){ - write('int16array:'); - return this.dispatch(Array.prototype.slice.call(arr)); - }, - _uint32array: function(arr){ - write('uint32array:'); - return this.dispatch(Array.prototype.slice.call(arr)); - }, - _int32array: function(arr){ - write('int32array:'); - return this.dispatch(Array.prototype.slice.call(arr)); - }, - _float32array: function(arr){ - write('float32array:'); - return this.dispatch(Array.prototype.slice.call(arr)); - }, - _float64array: function(arr){ - write('float64array:'); - return this.dispatch(Array.prototype.slice.call(arr)); - }, - _arraybuffer: function(arr){ - write('arraybuffer:'); - return this.dispatch(new Uint8Array(arr)); - }, - _url: function(url) { - return write('url:' + url.toString(), 'utf8'); - }, - _map: function(map) { - write('map:'); - var arr = Array.from(map); - return this._array(arr, options.unorderedSets !== false); - }, - _set: function(set) { - write('set:'); - var arr = Array.from(set); - return this._array(arr, options.unorderedSets !== false); - }, - _file: function(file) { - write('file:'); - return this.dispatch([file.name, file.size, file.type, file.lastModfied]); - }, - _blob: function() { - if (options.ignoreUnknown) { - return write('[blob]'); - } - - throw Error('Hashing Blob objects is currently not supported\n' + - '(see https://github.com/puleos/object-hash/issues/26)\n' + - 'Use "options.replacer" or "options.ignoreUnknown"\n'); - }, - _domwindow: function() { return write('domwindow'); }, - _bigint: function(number){ - return write('bigint:' + number.toString()); - }, - /* Node.js standard native objects */ - _process: function() { return write('process'); }, - _timer: function() { return write('timer'); }, - _pipe: function() { return write('pipe'); }, - _tcp: function() { return write('tcp'); }, - _udp: function() { return write('udp'); }, - _tty: function() { return write('tty'); }, - _statwatcher: function() { return write('statwatcher'); }, - _securecontext: function() { return write('securecontext'); }, - _connection: function() { return write('connection'); }, - _zlib: function() { return write('zlib'); }, - _context: function() { return write('context'); }, - _nodescript: function() { return write('nodescript'); }, - _httpparser: function() { return write('httpparser'); }, - _dataview: function() { return write('dataview'); }, - _signal: function() { return write('signal'); }, - _fsevent: function() { return write('fsevent'); }, - _tlswrap: function() { return write('tlswrap'); }, - }; -} - -// Mini-implementation of stream.PassThrough -// We are far from having need for the full implementation, and we can -// make assumptions like "many writes, then only one final read" -// and we can ignore encoding specifics -function PassThrough() { - return { - buf: '', - - write: function(b) { - this.buf += b; - }, - - end: function(b) { - this.buf += b; - }, - - read: function() { - return this.buf; - } - }; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/object-hash/package.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/object-hash/package.json deleted file mode 100644 index a72557f6..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/object-hash/package.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "name": "object-hash", - "version": "3.0.0", - "description": "Generate hashes from javascript objects in node and the browser.", - "homepage": "https://github.com/puleos/object-hash", - "repository": { - "type": "git", - "url": "https://github.com/puleos/object-hash" - }, - "keywords": [ - "object", - "hash", - "sha1", - "md5" - ], - "bugs": { - "url": "https://github.com/puleos/object-hash/issues" - }, - "scripts": { - "test": "node ./node_modules/.bin/mocha test", - "prepublish": "gulp dist" - }, - "author": "Scott Puleo ", - "files": [ - "index.js", - "dist/object_hash.js" - ], - "license": "MIT", - "devDependencies": { - "browserify": "^16.2.3", - "gulp": "^4.0.0", - "gulp-browserify": "^0.5.1", - "gulp-coveralls": "^0.1.4", - "gulp-exec": "^3.0.1", - "gulp-istanbul": "^1.1.3", - "gulp-jshint": "^2.0.0", - "gulp-mocha": "^5.0.0", - "gulp-rename": "^1.2.0", - "gulp-replace": "^1.0.0", - "gulp-uglify": "^3.0.0", - "jshint": "^2.8.0", - "jshint-stylish": "^2.1.0", - "karma": "^4.2.0", - "karma-chrome-launcher": "^2.2.0", - "karma-mocha": "^1.3.0", - "mocha": "^6.2.0" - }, - "engines": { - "node": ">= 6" - }, - "main": "./index.js", - "browser": "./dist/object_hash.js" -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/object-hash/readme.markdown b/packages/wyatt_notification_bloc/example/scripts/node_modules/object-hash/readme.markdown deleted file mode 100644 index c507cf8c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/object-hash/readme.markdown +++ /dev/null @@ -1,198 +0,0 @@ -# object-hash - -Generate hashes from objects and values in node and the browser. Uses node.js -crypto module for hashing. Supports SHA1 and many others (depending on the platform) -as well as custom streams (e.g. CRC32). - -[![NPM](https://nodei.co/npm/object-hash.png?downloads=true&downloadRank=true)](https://www.npmjs.com/package/object-hash) - -[![Travis CI](https://secure.travis-ci.org/puleos/object-hash.png?branch=master)](https://secure.travis-ci.org/puleos/object-hash?branch=master) -[![Coverage Status](https://coveralls.io/repos/puleos/object-hash/badge.svg?branch=master&service=github)](https://coveralls.io/github/puleos/object-hash?branch=master) - -* Hash values of any type. -* Supports a keys only option for grouping similar objects with different values. - -```js -var hash = require('object-hash'); - -hash({foo: 'bar'}) // => '67b69634f9880a282c14a0f0cb7ba20cf5d677e9' -hash([1, 2, 2.718, 3.14159]) // => '136b9b88375971dff9f1af09d7356e3e04281951' -``` - -## Versioning Disclaimer - -Starting with version `1.1.8` (released April 2017), new versions will consider -the exact returned hash part of the API contract, i.e. changes that will affect -hash values will be considered `semver-major`. Previous versions may violate -that expectation. - -For more information, see [this discussion](https://github.com/puleos/object-hash/issues/30). - -## hash(value, options) - -Generate a hash from any object or type. Defaults to sha1 with hex encoding. - -* `algorithm` hash algo to be used: 'sha1', 'md5', 'passthrough'. default: sha1 - * This supports the algorithms returned by `crypto.getHashes()`. Note that the default of SHA-1 is not considered secure, and a stronger algorithm should be used if a cryptographical hash is desired. - * This also supports the `passthrough` algorith, which will return the information that would otherwise have been hashed. -* `excludeValues` {true|false} hash object keys, values ignored. default: false -* `encoding` hash encoding, supports 'buffer', 'hex', 'binary', 'base64'. default: hex -* `ignoreUnknown` {true|*false} ignore unknown object types. default: false -* `replacer` optional function that replaces values before hashing. default: accept all values -* `respectFunctionProperties` {true|false} Whether properties on functions are considered when hashing. default: true -* `respectFunctionNames` {true|false} consider `name` property of functions for hashing. default: true -* `respectType` {true|false} Whether special type attributes (`.prototype`, `.__proto__`, `.constructor`) - are hashed. default: true -* `unorderedArrays` {true|false} Sort all arrays before hashing. Note that this affects *all* collections, - i.e. including typed arrays, Sets, Maps, etc. default: false -* `unorderedSets` {true|false} Sort `Set` and `Map` instances before hashing, i.e. make - `hash(new Set([1, 2])) == hash(new Set([2, 1]))` return `true`. default: true -* `unorderedObjects` {true|false} Sort objects before hashing, i.e. make `hash({ x: 1, y: 2 }) === hash({ y: 2, x: 1 })`. default: true -* `excludeKeys` optional function for excluding specific key(s) from hashing, if true is returned then exclude from hash. default: include all keys - -## hash.sha1(value) - -Hash using the sha1 algorithm. - -Note that SHA-1 is not considered secure, and a stronger algorithm should be used if a cryptographical hash is desired. - -*Sugar method, equivalent to* `hash(value, {algorithm: 'sha1'})` - -## hash.keys(value) - -Hash object keys using the sha1 algorithm, values ignored. - -*Sugar method, equivalent to* `hash(value, {excludeValues: true})` - -## hash.MD5(value) - -Hash using the md5 algorithm. - -Note that the MD5 algorithm is not considered secure, and a stronger algorithm should be used if a cryptographical hash is desired. - -*Sugar method, equivalent to* `hash(value, {algorithm: 'md5'})` - -## hash.keysMD5(value) - -Hash object keys using the md5 algorithm, values ignored. - -Note that the MD5 algorithm is not considered secure, and a stronger algorithm should be used if a cryptographical hash is desired. - -*Sugar method, equivalent to* `hash(value, {algorithm: 'md5', excludeValues: true})` - -## hash.writeToStream(value, [options,] stream) - -Write the information that would otherwise have been hashed to a stream, e.g.: - -```js -hash.writeToStream({foo: 'bar', a: 42}, {respectType: false}, process.stdout) -// => e.g. 'object:a:number:42foo:string:bar' -``` - -## Installation - -node: - -```js -npm install object-hash -``` - -browser: */dist/object_hash.js* - -```html - - - -``` - -## Example usage - -```js -var hash = require('object-hash'); - -var peter = { name: 'Peter', stapler: false, friends: ['Joanna', 'Michael', 'Samir'] }; -var michael = { name: 'Michael', stapler: false, friends: ['Peter', 'Samir'] }; -var bob = { name: 'Bob', stapler: true, friends: [] }; - -/*** - * sha1 hex encoding (default) - */ -hash(peter); -// 14fa461bf4b98155e82adc86532938553b4d33a9 -hash(michael); -// 4b2b30e27699979ce46714253bc2213010db039c -hash(bob); -// 38d96106bc8ef3d8bd369b99bb6972702c9826d5 - -/*** - * hash object keys, values ignored - */ -hash(peter, { excludeValues: true }); -// 48f370a772c7496f6c9d2e6d92e920c87dd00a5c -hash(michael, { excludeValues: true }); -// 48f370a772c7496f6c9d2e6d92e920c87dd00a5c -hash.keys(bob); -// 48f370a772c7496f6c9d2e6d92e920c87dd00a5c - -/*** - * hash object, ignore specific key(s) - */ -hash(peter, { excludeKeys: function(key) { - if ( key === 'friends') { - return true; - } - return false; - } -}); -// 66b7d7e64871aa9fda1bdc8e88a28df797648d80 - -/*** - * md5 base64 encoding - */ -hash(peter, { algorithm: 'md5', encoding: 'base64' }); -// 6rkWaaDiG3NynWw4svGH7g== -hash(michael, { algorithm: 'md5', encoding: 'base64' }); -// djXaWpuWVJeOF8Sb6SFFNg== -hash(bob, { algorithm: 'md5', encoding: 'base64' }); -// lFzkw/IJ8/12jZI0rQeS3w== -``` - -## Legacy Browser Support - -IE <= 8 and Opera <= 11 support dropped in version 0.3.0. If you require -legacy browser support you must either use an ES5 shim or use version 0.2.5 -of this module. - -## Development - -```sh-session -git clone https://github.com/puleos/object-hash -``` - -## Node Docker Wrapper - -If you want to stand this up in a docker container, you should take at look -at the [![node-object-hash](https://github.com/bean5/node-object-hash)](https://github.com/bean5/node-object-hash) project. - -### gulp tasks - -* `gulp watch` (default) watch files, test and lint on change/add -* `gulp test` unit tests -* `gulp karma` browser unit tests -* `gulp lint` jshint -* `gulp dist` create browser version in /dist - -## License - -MIT - -## Changelog - -### v2.0.0 - -Only Node.js versions `>= 6.0.0` are being tested in CI now. -No other breaking changes were introduced. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/once/LICENSE b/packages/wyatt_notification_bloc/example/scripts/node_modules/once/LICENSE deleted file mode 100644 index 19129e31..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/once/LICENSE +++ /dev/null @@ -1,15 +0,0 @@ -The ISC License - -Copyright (c) Isaac Z. Schlueter and Contributors - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR -IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/once/README.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/once/README.md deleted file mode 100644 index 1f1ffca9..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/once/README.md +++ /dev/null @@ -1,79 +0,0 @@ -# once - -Only call a function once. - -## usage - -```javascript -var once = require('once') - -function load (file, cb) { - cb = once(cb) - loader.load('file') - loader.once('load', cb) - loader.once('error', cb) -} -``` - -Or add to the Function.prototype in a responsible way: - -```javascript -// only has to be done once -require('once').proto() - -function load (file, cb) { - cb = cb.once() - loader.load('file') - loader.once('load', cb) - loader.once('error', cb) -} -``` - -Ironically, the prototype feature makes this module twice as -complicated as necessary. - -To check whether you function has been called, use `fn.called`. Once the -function is called for the first time the return value of the original -function is saved in `fn.value` and subsequent calls will continue to -return this value. - -```javascript -var once = require('once') - -function load (cb) { - cb = once(cb) - var stream = createStream() - stream.once('data', cb) - stream.once('end', function () { - if (!cb.called) cb(new Error('not found')) - }) -} -``` - -## `once.strict(func)` - -Throw an error if the function is called twice. - -Some functions are expected to be called only once. Using `once` for them would -potentially hide logical errors. - -In the example below, the `greet` function has to call the callback only once: - -```javascript -function greet (name, cb) { - // return is missing from the if statement - // when no name is passed, the callback is called twice - if (!name) cb('Hello anonymous') - cb('Hello ' + name) -} - -function log (msg) { - console.log(msg) -} - -// this will print 'Hello anonymous' but the logical error will be missed -greet(null, once(msg)) - -// once.strict will print 'Hello anonymous' and throw an error when the callback will be called the second time -greet(null, once.strict(msg)) -``` diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/once/once.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/once/once.js deleted file mode 100644 index 23540673..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/once/once.js +++ /dev/null @@ -1,42 +0,0 @@ -var wrappy = require('wrappy') -module.exports = wrappy(once) -module.exports.strict = wrappy(onceStrict) - -once.proto = once(function () { - Object.defineProperty(Function.prototype, 'once', { - value: function () { - return once(this) - }, - configurable: true - }) - - Object.defineProperty(Function.prototype, 'onceStrict', { - value: function () { - return onceStrict(this) - }, - configurable: true - }) -}) - -function once (fn) { - var f = function () { - if (f.called) return f.value - f.called = true - return f.value = fn.apply(this, arguments) - } - f.called = false - return f -} - -function onceStrict (fn) { - var f = function () { - if (f.called) - throw new Error(f.onceError) - f.called = true - return f.value = fn.apply(this, arguments) - } - var name = fn.name || 'Function wrapped with `once`' - f.onceError = name + " shouldn't be called more than once" - f.called = false - return f -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/once/package.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/once/package.json deleted file mode 100644 index 16815b2f..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/once/package.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "name": "once", - "version": "1.4.0", - "description": "Run a function exactly one time", - "main": "once.js", - "directories": { - "test": "test" - }, - "dependencies": { - "wrappy": "1" - }, - "devDependencies": { - "tap": "^7.0.1" - }, - "scripts": { - "test": "tap test/*.js" - }, - "files": [ - "once.js" - ], - "repository": { - "type": "git", - "url": "git://github.com/isaacs/once" - }, - "keywords": [ - "once", - "function", - "one", - "single" - ], - "author": "Isaac Z. Schlueter (http://blog.izs.me/)", - "license": "ISC" -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/optionator/CHANGELOG.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/optionator/CHANGELOG.md deleted file mode 100644 index ddaf0b5b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/optionator/CHANGELOG.md +++ /dev/null @@ -1,56 +0,0 @@ -# 0.8.3 -- changes dependency from `wordwrap` to `word-wrap` due to license issue -- update dependencies - -# 0.8.2 -- fix bug #18 - detect missing value when flag is last item -- update dependencies - -# 0.8.1 -- update `fast-levenshtein` dependency - -# 0.8.0 -- update `levn` dependency - supplying a float value to an option with type `Int` now throws an error, instead of silently converting to an `Int` - -# 0.7.1 -- fix bug with use of `defaults` and `concatRepeatedArrays` or `mergeRepeatedObjects` - -# 0.7.0 -- added `concatrepeatedarrays` option: `oneValuePerFlag`, only allows one array value per flag -- added `typeAliases` option -- added `parseArgv` which takes an array and parses with the first two items sliced off -- changed enum help style -- bug fixes (#12) -- use of `concatRepeatedArrays` and `mergeRepeatedObjects` at the top level is deprecated, use it as either a per-option option, or set them in the `defaults` object to set them for all objects - -# 0.6.0 -- added `defaults` lib-option flag, allowing one to set default properties for all options -- added `concatRepeatedArrays` and `mergeRepeatedObjects` as option level properties, allowing you to turn this feature on for specific options only - -# 0.5.0 -- `Boolean` flags with `default: 'true'`, and no short aliases, will by default show the `--no` version in help - -# 0.4.0 -- add `mergeRepeatedObjects` setting - -# 0.3.0 -- add `concatRepeatedArrays` setting -- add `overrideRequired` option setting -- use just Levenshtein string compare algo rather than Levenshtein Damerau to due dependency license issue - -# 0.2.2 -- bug fixes - -# 0.2.1 -- improved interpolation -- added changelog - -# 0.2.0 -- add dependency checks to options - added `dependsOn` as an option property -- add interpolation for `prepend` and `append` text with new `generateHelp` option, `interpolate` - -# 0.1.1 -- update dependencies - -# 0.1.0 -- initial release diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/optionator/LICENSE b/packages/wyatt_notification_bloc/example/scripts/node_modules/optionator/LICENSE deleted file mode 100644 index 525b1185..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/optionator/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -Copyright (c) George Zahariev - -Permission is hereby granted, free of charge, to any person -obtaining a copy of this software and associated documentation -files (the "Software"), to deal in the Software without -restriction, including without limitation the rights to use, -copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following -conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/optionator/README.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/optionator/README.md deleted file mode 100644 index 8e4ba424..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/optionator/README.md +++ /dev/null @@ -1,238 +0,0 @@ -# Optionator - - -Optionator is a JavaScript/Node.js option parsing and help generation library used by [eslint](http://eslint.org), [Grasp](http://graspjs.com), [LiveScript](http://livescript.net), [esmangle](https://github.com/estools/esmangle), [escodegen](https://github.com/estools/escodegen), and [many more](https://www.npmjs.com/browse/depended/optionator). - -For an online demo, check out the [Grasp online demo](http://www.graspjs.com/#demo). - -[About](#about) · [Usage](#usage) · [Settings Format](#settings-format) · [Argument Format](#argument-format) - -## Why? -The problem with other option parsers, such as `yargs` or `minimist`, is they just accept all input, valid or not. -With Optionator, if you mistype an option, it will give you an error (with a suggestion for what you meant). -If you give the wrong type of argument for an option, it will give you an error rather than supplying the wrong input to your application. - - $ cmd --halp - Invalid option '--halp' - perhaps you meant '--help'? - - $ cmd --count str - Invalid value for option 'count' - expected type Int, received value: str. - -Other helpful features include reformatting the help text based on the size of the console, so that it fits even if the console is narrow, and accepting not just an array (eg. process.argv), but a string or object as well, making things like testing much easier. - -## About -Optionator uses [type-check](https://github.com/gkz/type-check) and [levn](https://github.com/gkz/levn) behind the scenes to cast and verify input according the specified types. - -MIT license. Version 0.8.3 - - npm install optionator - -For updates on Optionator, [follow me on twitter](https://twitter.com/gkzahariev). - -Optionator is a Node.js module, but can be used in the browser as well if packed with webpack/browserify. - -## Usage -`require('optionator');` returns a function. It has one property, `VERSION`, the current version of the library as a string. This function is called with an object specifying your options and other information, see the [settings format section](#settings-format). This in turn returns an object with three properties, `parse`, `parseArgv`, `generateHelp`, and `generateHelpForOption`, which are all functions. - -```js -var optionator = require('optionator')({ - prepend: 'Usage: cmd [options]', - append: 'Version 1.0.0', - options: [{ - option: 'help', - alias: 'h', - type: 'Boolean', - description: 'displays help' - }, { - option: 'count', - alias: 'c', - type: 'Int', - description: 'number of things', - example: 'cmd --count 2' - }] -}); - -var options = optionator.parseArgv(process.argv); -if (options.help) { - console.log(optionator.generateHelp()); -} -... -``` - -### parse(input, parseOptions) -`parse` processes the `input` according to your settings, and returns an object with the results. - -##### arguments -* input - `[String] | Object | String` - the input you wish to parse -* parseOptions - `{slice: Int}` - all options optional - - `slice` specifies how much to slice away from the beginning if the input is an array or string - by default `0` for string, `2` for array (works with `process.argv`) - -##### returns -`Object` - the parsed options, each key is a camelCase version of the option name (specified in dash-case), and each value is the processed value for that option. Positional values are in an array under the `_` key. - -##### example -```js -parse(['node', 't.js', '--count', '2', 'positional']); // {count: 2, _: ['positional']} -parse('--count 2 positional'); // {count: 2, _: ['positional']} -parse({count: 2, _:['positional']}); // {count: 2, _: ['positional']} -``` - -### parseArgv(input) -`parseArgv` works exactly like `parse`, but only for array input and it slices off the first two elements. - -##### arguments -* input - `[String]` - the input you wish to parse - -##### returns -See "returns" section in "parse" - -##### example -```js -parseArgv(process.argv); -``` - -### generateHelp(helpOptions) -`generateHelp` produces help text based on your settings. - -##### arguments -* helpOptions - `{showHidden: Boolean, interpolate: Object}` - all options optional - - `showHidden` specifies whether to show options with `hidden: true` specified, by default it is `false` - - `interpolate` specify data to be interpolated in `prepend` and `append` text, `{{key}}` is the format - eg. `generateHelp({interpolate:{version: '0.4.2'}})`, will change this `append` text: `Version {{version}}` to `Version 0.4.2` - -##### returns -`String` - the generated help text - -##### example -```js -generateHelp(); /* -"Usage: cmd [options] positional - - -h, --help displays help - -c, --count Int number of things - -Version 1.0.0 -"*/ -``` - -### generateHelpForOption(optionName) -`generateHelpForOption` produces expanded help text for the specified with `optionName` option. If an `example` was specified for the option, it will be displayed, and if a `longDescription` was specified, it will display that instead of the `description`. - -##### arguments -* optionName - `String` - the name of the option to display - -##### returns -`String` - the generated help text for the option - -##### example -```js -generateHelpForOption('count'); /* -"-c, --count Int -description: number of things -example: cmd --count 2 -"*/ -``` - -## Settings Format -When your `require('optionator')`, you get a function that takes in a settings object. This object has the type: - - { - prepend: String, - append: String, - options: [{heading: String} | { - option: String, - alias: [String] | String, - type: String, - enum: [String], - default: String, - restPositional: Boolean, - required: Boolean, - overrideRequired: Boolean, - dependsOn: [String] | String, - concatRepeatedArrays: Boolean | (Boolean, Object), - mergeRepeatedObjects: Boolean, - description: String, - longDescription: String, - example: [String] | String - }], - helpStyle: { - aliasSeparator: String, - typeSeparator: String, - descriptionSeparator: String, - initialIndent: Int, - secondaryIndent: Int, - maxPadFactor: Number - }, - mutuallyExclusive: [[String | [String]]], - concatRepeatedArrays: Boolean | (Boolean, Object), // deprecated, set in defaults object - mergeRepeatedObjects: Boolean, // deprecated, set in defaults object - positionalAnywhere: Boolean, - typeAliases: Object, - defaults: Object - } - -All of the properties are optional (the `Maybe` has been excluded for brevities sake), except for having either `heading: String` or `option: String` in each object in the `options` array. - -### Top Level Properties -* `prepend` is an optional string to be placed before the options in the help text -* `append` is an optional string to be placed after the options in the help text -* `options` is a required array specifying your options and headings, the options and headings will be displayed in the order specified -* `helpStyle` is an optional object which enables you to change the default appearance of some aspects of the help text -* `mutuallyExclusive` is an optional array of arrays of either strings or arrays of strings. The top level array is a list of rules, each rule is a list of elements - each element can be either a string (the name of an option), or a list of strings (a group of option names) - there will be an error if more than one element is present -* `concatRepeatedArrays` see description under the "Option Properties" heading - use at the top level is deprecated, if you want to set this for all options, use the `defaults` property -* `mergeRepeatedObjects` see description under the "Option Properties" heading - use at the top level is deprecated, if you want to set this for all options, use the `defaults` property -* `positionalAnywhere` is an optional boolean (defaults to `true`) - when `true` it allows positional arguments anywhere, when `false`, all arguments after the first positional one are taken to be positional as well, even if they look like a flag. For example, with `positionalAnywhere: false`, the arguments `--flag --boom 12 --crack` would have two positional arguments: `12` and `--crack` -* `typeAliases` is an optional object, it allows you to set aliases for types, eg. `{Path: 'String'}` would allow you to use the type `Path` as an alias for the type `String` -* `defaults` is an optional object following the option properties format, which specifies default values for all options. A default will be overridden if manually set. For example, you can do `default: { type: "String" }` to set the default type of all options to `String`, and then override that default in an individual option by setting the `type` property - -#### Heading Properties -* `heading` a required string, the name of the heading - -#### Option Properties -* `option` the required name of the option - use dash-case, without the leading dashes -* `alias` is an optional string or array of strings which specify any aliases for the option -* `type` is a required string in the [type check](https://github.com/gkz/type-check) [format](https://github.com/gkz/type-check#type-format), this will be used to cast the inputted value and validate it -* `enum` is an optional array of strings, each string will be parsed by [levn](https://github.com/gkz/levn) - the argument value must be one of the resulting values - each potential value must validate against the specified `type` -* `default` is a optional string, which will be parsed by [levn](https://github.com/gkz/levn) and used as the default value if none is set - the value must validate against the specified `type` -* `restPositional` is an optional boolean - if set to `true`, everything after the option will be taken to be a positional argument, even if it looks like a named argument -* `required` is an optional boolean - if set to `true`, the option parsing will fail if the option is not defined -* `overrideRequired` is a optional boolean - if set to `true` and the option is used, and there is another option which is required but not set, it will override the need for the required option and there will be no error - this is useful if you have required options and want to use `--help` or `--version` flags -* `concatRepeatedArrays` is an optional boolean or tuple with boolean and options object (defaults to `false`) - when set to `true` and an option contains an array value and is repeated, the subsequent values for the flag will be appended rather than overwriting the original value - eg. option `g` of type `[String]`: `-g a -g b -g c,d` will result in `['a','b','c','d']` - - You can supply an options object by giving the following value: `[true, options]`. The one currently supported option is `oneValuePerFlag`, this only allows one array value per flag. This is useful if your potential values contain a comma. -* `mergeRepeatedObjects` is an optional boolean (defaults to `false`) - when set to `true` and an option contains an object value and is repeated, the subsequent values for the flag will be merged rather than overwriting the original value - eg. option `g` of type `Object`: `-g a:1 -g b:2 -g c:3,d:4` will result in `{a: 1, b: 2, c: 3, d: 4}` -* `dependsOn` is an optional string or array of strings - if simply a string (the name of another option), it will make sure that that other option is set, if an array of strings, depending on whether `'and'` or `'or'` is first, it will either check whether all (`['and', 'option-a', 'option-b']`), or at least one (`['or', 'option-a', 'option-b']`) other options are set -* `description` is an optional string, which will be displayed next to the option in the help text -* `longDescription` is an optional string, it will be displayed instead of the `description` when `generateHelpForOption` is used -* `example` is an optional string or array of strings with example(s) for the option - these will be displayed when `generateHelpForOption` is used - -#### Help Style Properties -* `aliasSeparator` is an optional string, separates multiple names from each other - default: ' ,' -* `typeSeparator` is an optional string, separates the type from the names - default: ' ' -* `descriptionSeparator` is an optional string , separates the description from the padded name and type - default: ' ' -* `initialIndent` is an optional int - the amount of indent for options - default: 2 -* `secondaryIndent` is an optional int - the amount of indent if wrapped fully (in addition to the initial indent) - default: 4 -* `maxPadFactor` is an optional number - affects the default level of padding for the names/type, it is multiplied by the average of the length of the names/type - default: 1.5 - -## Argument Format -At the highest level there are two types of arguments: named, and positional. - -Name arguments of any length are prefixed with `--` (eg. `--go`), and those of one character may be prefixed with either `--` or `-` (eg. `-g`). - -There are two types of named arguments: boolean flags (eg. `--problemo`, `-p`) which take no value and result in a `true` if they are present, the falsey `undefined` if they are not present, or `false` if present and explicitly prefixed with `no` (eg. `--no-problemo`). Named arguments with values (eg. `--tseries 800`, `-t 800`) are the other type. If the option has a type `Boolean` it will automatically be made into a boolean flag. Any other type results in a named argument that takes a value. - -For more information about how to properly set types to get the value you want, take a look at the [type check](https://github.com/gkz/type-check) and [levn](https://github.com/gkz/levn) pages. - -You can group single character arguments that use a single `-`, however all except the last must be boolean flags (which take no value). The last may be a boolean flag, or an argument which takes a value - eg. `-ba 2` is equivalent to `-b -a 2`. - -Positional arguments are all those values which do not fall under the above - they can be anywhere, not just at the end. For example, in `cmd -b one -a 2 two` where `b` is a boolean flag, and `a` has the type `Number`, there are two positional arguments, `one` and `two`. - -Everything after an `--` is positional, even if it looks like a named argument. - -You may optionally use `=` to separate option names from values, for example: `--count=2`. - -If you specify the option `NUM`, then any argument using a single `-` followed by a number will be valid and will set the value of `NUM`. Eg. `-2` will be parsed into `NUM: 2`. - -If duplicate named arguments are present, the last one will be taken. - -## Technical About -`optionator` is written in [LiveScript](http://livescript.net/) - a language that compiles to JavaScript. It uses [levn](https://github.com/gkz/levn) to cast arguments to their specified type, and uses [type-check](https://github.com/gkz/type-check) to validate values. It also uses the [prelude.ls](http://preludels.com/) library. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/optionator/lib/help.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/optionator/lib/help.js deleted file mode 100644 index 59e6f969..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/optionator/lib/help.js +++ /dev/null @@ -1,260 +0,0 @@ -// Generated by LiveScript 1.6.0 -(function(){ - var ref$, id, find, sort, min, max, map, unlines, nameToRaw, dasherize, naturalJoin, wordWrap, wordwrap, getPreText, setHelpStyleDefaults, generateHelpForOption, generateHelp; - ref$ = require('prelude-ls'), id = ref$.id, find = ref$.find, sort = ref$.sort, min = ref$.min, max = ref$.max, map = ref$.map, unlines = ref$.unlines; - ref$ = require('./util'), nameToRaw = ref$.nameToRaw, dasherize = ref$.dasherize, naturalJoin = ref$.naturalJoin; - wordWrap = require('word-wrap'); - wordwrap = function(a, b){ - var ref$, indent, width; - ref$ = b === undefined - ? ['', a - 1] - : [repeatString$(' ', a), b - a - 1], indent = ref$[0], width = ref$[1]; - return function(text){ - return wordWrap(text, { - indent: indent, - width: width, - trim: true - }); - }; - }; - getPreText = function(option, arg$, maxWidth){ - var mainName, shortNames, ref$, longNames, type, description, aliasSeparator, typeSeparator, initialIndent, names, namesString, namesStringLen, typeSeparatorString, typeSeparatorStringLen, wrap; - mainName = option.option, shortNames = (ref$ = option.shortNames) != null - ? ref$ - : [], longNames = (ref$ = option.longNames) != null - ? ref$ - : [], type = option.type, description = option.description; - aliasSeparator = arg$.aliasSeparator, typeSeparator = arg$.typeSeparator, initialIndent = arg$.initialIndent; - if (option.negateName) { - mainName = "no-" + mainName; - if (longNames) { - longNames = map(function(it){ - return "no-" + it; - }, longNames); - } - } - names = mainName.length === 1 - ? [mainName].concat(shortNames, longNames) - : shortNames.concat([mainName], longNames); - namesString = map(nameToRaw, names).join(aliasSeparator); - namesStringLen = namesString.length; - typeSeparatorString = mainName === 'NUM' ? '::' : typeSeparator; - typeSeparatorStringLen = typeSeparatorString.length; - if (maxWidth != null && !option.boolean && initialIndent + namesStringLen + typeSeparatorStringLen + type.length > maxWidth) { - wrap = wordwrap(initialIndent + namesStringLen + typeSeparatorStringLen, maxWidth); - return namesString + "" + typeSeparatorString + wrap(type).replace(/^\s+/, ''); - } else { - return namesString + "" + (option.boolean - ? '' - : typeSeparatorString + "" + type); - } - }; - setHelpStyleDefaults = function(helpStyle){ - helpStyle.aliasSeparator == null && (helpStyle.aliasSeparator = ', '); - helpStyle.typeSeparator == null && (helpStyle.typeSeparator = ' '); - helpStyle.descriptionSeparator == null && (helpStyle.descriptionSeparator = ' '); - helpStyle.initialIndent == null && (helpStyle.initialIndent = 2); - helpStyle.secondaryIndent == null && (helpStyle.secondaryIndent = 4); - helpStyle.maxPadFactor == null && (helpStyle.maxPadFactor = 1.5); - }; - generateHelpForOption = function(getOption, arg$){ - var stdout, helpStyle, ref$; - stdout = arg$.stdout, helpStyle = (ref$ = arg$.helpStyle) != null - ? ref$ - : {}; - setHelpStyleDefaults(helpStyle); - return function(optionName){ - var maxWidth, wrap, option, e, pre, defaultString, restPositionalString, description, fullDescription, that, preDescription, descriptionString, exampleString, examples, seperator; - maxWidth = stdout != null && stdout.isTTY ? stdout.columns - 1 : null; - wrap = maxWidth ? wordwrap(maxWidth) : id; - try { - option = getOption(dasherize(optionName)); - } catch (e$) { - e = e$; - return e.message; - } - pre = getPreText(option, helpStyle); - defaultString = option['default'] && !option.negateName ? "\ndefault: " + option['default'] : ''; - restPositionalString = option.restPositional ? 'Everything after this option is considered a positional argument, even if it looks like an option.' : ''; - description = option.longDescription || option.description && sentencize(option.description); - fullDescription = description && restPositionalString - ? description + " " + restPositionalString - : (that = description || restPositionalString) ? that : ''; - preDescription = 'description:'; - descriptionString = !fullDescription - ? '' - : maxWidth && fullDescription.length - 1 - preDescription.length > maxWidth - ? "\n" + preDescription + "\n" + wrap(fullDescription) - : "\n" + preDescription + " " + fullDescription; - exampleString = (that = option.example) ? (examples = [].concat(that), examples.length > 1 - ? "\nexamples:\n" + unlines(examples) - : "\nexample: " + examples[0]) : ''; - seperator = defaultString || descriptionString || exampleString ? "\n" + repeatString$('=', pre.length) : ''; - return pre + "" + seperator + defaultString + descriptionString + exampleString; - }; - }; - generateHelp = function(arg$){ - var options, prepend, append, helpStyle, ref$, stdout, aliasSeparator, typeSeparator, descriptionSeparator, maxPadFactor, initialIndent, secondaryIndent; - options = arg$.options, prepend = arg$.prepend, append = arg$.append, helpStyle = (ref$ = arg$.helpStyle) != null - ? ref$ - : {}, stdout = arg$.stdout; - setHelpStyleDefaults(helpStyle); - aliasSeparator = helpStyle.aliasSeparator, typeSeparator = helpStyle.typeSeparator, descriptionSeparator = helpStyle.descriptionSeparator, maxPadFactor = helpStyle.maxPadFactor, initialIndent = helpStyle.initialIndent, secondaryIndent = helpStyle.secondaryIndent; - return function(arg$){ - var ref$, showHidden, interpolate, maxWidth, output, out, data, optionCount, totalPreLen, preLens, i$, len$, item, that, pre, descParts, desc, preLen, sortedPreLens, maxPreLen, preLenMean, x, padAmount, descSepLen, fullWrapCount, partialWrapCount, descLen, totalLen, initialSpace, wrapAllFull, i, wrap; - ref$ = arg$ != null - ? arg$ - : {}, showHidden = ref$.showHidden, interpolate = ref$.interpolate; - maxWidth = stdout != null && stdout.isTTY ? stdout.columns - 1 : null; - output = []; - out = function(it){ - return output.push(it != null ? it : ''); - }; - if (prepend) { - out(interpolate ? interp(prepend, interpolate) : prepend); - out(); - } - data = []; - optionCount = 0; - totalPreLen = 0; - preLens = []; - for (i$ = 0, len$ = (ref$ = options).length; i$ < len$; ++i$) { - item = ref$[i$]; - if (showHidden || !item.hidden) { - if (that = item.heading) { - data.push({ - type: 'heading', - value: that - }); - } else { - pre = getPreText(item, helpStyle, maxWidth); - descParts = []; - if ((that = item.description) != null) { - descParts.push(that); - } - if (that = item['enum']) { - descParts.push("either: " + naturalJoin(that)); - } - if (item['default'] && !item.negateName) { - descParts.push("default: " + item['default']); - } - desc = descParts.join(' - '); - data.push({ - type: 'option', - pre: pre, - desc: desc, - descLen: desc.length - }); - preLen = pre.length; - optionCount++; - totalPreLen += preLen; - preLens.push(preLen); - } - } - } - sortedPreLens = sort(preLens); - maxPreLen = sortedPreLens[sortedPreLens.length - 1]; - preLenMean = initialIndent + totalPreLen / optionCount; - x = optionCount > 2 ? min(preLenMean * maxPadFactor, maxPreLen) : maxPreLen; - for (i$ = sortedPreLens.length - 1; i$ >= 0; --i$) { - preLen = sortedPreLens[i$]; - if (preLen <= x) { - padAmount = preLen; - break; - } - } - descSepLen = descriptionSeparator.length; - if (maxWidth != null) { - fullWrapCount = 0; - partialWrapCount = 0; - for (i$ = 0, len$ = data.length; i$ < len$; ++i$) { - item = data[i$]; - if (item.type === 'option') { - pre = item.pre, desc = item.desc, descLen = item.descLen; - if (descLen === 0) { - item.wrap = 'none'; - } else { - preLen = max(padAmount, pre.length) + initialIndent + descSepLen; - totalLen = preLen + descLen; - if (totalLen > maxWidth) { - if (descLen / 2.5 > maxWidth - preLen) { - fullWrapCount++; - item.wrap = 'full'; - } else { - partialWrapCount++; - item.wrap = 'partial'; - } - } else { - item.wrap = 'none'; - } - } - } - } - } - initialSpace = repeatString$(' ', initialIndent); - wrapAllFull = optionCount > 1 && fullWrapCount + partialWrapCount * 0.5 > optionCount * 0.5; - for (i$ = 0, len$ = data.length; i$ < len$; ++i$) { - i = i$; - item = data[i$]; - if (item.type === 'heading') { - if (i !== 0) { - out(); - } - out(item.value + ":"); - } else { - pre = item.pre, desc = item.desc, descLen = item.descLen, wrap = item.wrap; - if (maxWidth != null) { - if (wrapAllFull || wrap === 'full') { - wrap = wordwrap(initialIndent + secondaryIndent, maxWidth); - out(initialSpace + "" + pre + "\n" + wrap(desc)); - continue; - } else if (wrap === 'partial') { - wrap = wordwrap(initialIndent + descSepLen + max(padAmount, pre.length), maxWidth); - out(initialSpace + "" + pad(pre, padAmount) + descriptionSeparator + wrap(desc).replace(/^\s+/, '')); - continue; - } - } - if (descLen === 0) { - out(initialSpace + "" + pre); - } else { - out(initialSpace + "" + pad(pre, padAmount) + descriptionSeparator + desc); - } - } - } - if (append) { - out(); - out(interpolate ? interp(append, interpolate) : append); - } - return unlines(output); - }; - }; - function pad(str, num){ - var len, padAmount; - len = str.length; - padAmount = num - len; - return str + "" + repeatString$(' ', padAmount > 0 ? padAmount : 0); - } - function sentencize(str){ - var first, rest, period; - first = str.charAt(0).toUpperCase(); - rest = str.slice(1); - period = /[\.!\?]$/.test(str) ? '' : '.'; - return first + "" + rest + period; - } - function interp(string, object){ - return string.replace(/{{([a-zA-Z$_][a-zA-Z$_0-9]*)}}/g, function(arg$, key){ - var ref$; - return (ref$ = object[key]) != null - ? ref$ - : "{{" + key + "}}"; - }); - } - module.exports = { - generateHelp: generateHelp, - generateHelpForOption: generateHelpForOption - }; - function repeatString$(str, n){ - for (var r = ''; n > 0; (n >>= 1) && (str += str)) if (n & 1) r += str; - return r; - } -}).call(this); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/optionator/lib/index.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/optionator/lib/index.js deleted file mode 100644 index 7ce37b23..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/optionator/lib/index.js +++ /dev/null @@ -1,465 +0,0 @@ -// Generated by LiveScript 1.6.0 -(function(){ - var VERSION, ref$, id, map, compact, any, groupBy, partition, chars, isItNaN, keys, Obj, camelize, deepIs, closestString, nameToRaw, dasherize, naturalJoin, generateHelp, generateHelpForOption, parsedTypeCheck, parseType, parseLevn, camelizeKeys, parseString, main, toString$ = {}.toString, slice$ = [].slice, arrayFrom$ = Array.from || function(x){return slice$.call(x);}; - VERSION = '0.8.3'; - ref$ = require('prelude-ls'), id = ref$.id, map = ref$.map, compact = ref$.compact, any = ref$.any, groupBy = ref$.groupBy, partition = ref$.partition, chars = ref$.chars, isItNaN = ref$.isItNaN, keys = ref$.keys, Obj = ref$.Obj, camelize = ref$.camelize; - deepIs = require('deep-is'); - ref$ = require('./util'), closestString = ref$.closestString, nameToRaw = ref$.nameToRaw, dasherize = ref$.dasherize, naturalJoin = ref$.naturalJoin; - ref$ = require('./help'), generateHelp = ref$.generateHelp, generateHelpForOption = ref$.generateHelpForOption; - ref$ = require('type-check'), parsedTypeCheck = ref$.parsedTypeCheck, parseType = ref$.parseType; - parseLevn = require('levn').parsedTypeParse; - camelizeKeys = function(obj){ - var key, value, resultObj$ = {}; - for (key in obj) { - value = obj[key]; - resultObj$[camelize(key)] = value; - } - return resultObj$; - }; - parseString = function(string){ - var assignOpt, regex, replaceRegex, result; - assignOpt = '--?[a-zA-Z][-a-z-A-Z0-9]*='; - regex = RegExp('(?:' + assignOpt + ')?(?:\'(?:\\\\\'|[^\'])+\'|"(?:\\\\"|[^"])+")|[^\'"\\s]+', 'g'); - replaceRegex = RegExp('^(' + assignOpt + ')?[\'"]([\\s\\S]*)[\'"]$'); - result = map(function(it){ - return it.replace(replaceRegex, '$1$2'); - }, string.match(regex) || []); - return result; - }; - main = function(libOptions){ - var opts, defaults, required, traverse, getOption, parse; - opts = {}; - defaults = {}; - required = []; - if (toString$.call(libOptions.stdout).slice(8, -1) === 'Undefined') { - libOptions.stdout = process.stdout; - } - libOptions.positionalAnywhere == null && (libOptions.positionalAnywhere = true); - libOptions.typeAliases == null && (libOptions.typeAliases = {}); - libOptions.defaults == null && (libOptions.defaults = {}); - if (libOptions.concatRepeatedArrays != null) { - libOptions.defaults.concatRepeatedArrays = libOptions.concatRepeatedArrays; - } - if (libOptions.mergeRepeatedObjects != null) { - libOptions.defaults.mergeRepeatedObjects = libOptions.mergeRepeatedObjects; - } - traverse = function(options){ - var i$, len$, option, name, k, ref$, v, type, that, e, parsedPossibilities, parsedType, j$, len1$, possibility, rawDependsType, dependsOpts, dependsType, cra, alias, shortNames, longNames; - if (toString$.call(options).slice(8, -1) !== 'Array') { - throw new Error('No options defined.'); - } - for (i$ = 0, len$ = options.length; i$ < len$; ++i$) { - option = options[i$]; - if (option.heading == null) { - name = option.option; - if (opts[name] != null) { - throw new Error("Option '" + name + "' already defined."); - } - for (k in ref$ = libOptions.defaults) { - v = ref$[k]; - option[k] == null && (option[k] = v); - } - if (option.type === 'Boolean') { - option.boolean == null && (option.boolean = true); - } - if (option.parsedType == null) { - if (!option.type) { - throw new Error("No type defined for option '" + name + "'."); - } - try { - type = (that = libOptions.typeAliases[option.type]) != null - ? that - : option.type; - option.parsedType = parseType(type); - } catch (e$) { - e = e$; - throw new Error("Option '" + name + "': Error parsing type '" + option.type + "': " + e.message); - } - } - if (option['default']) { - try { - defaults[name] = parseLevn(option.parsedType, option['default']); - } catch (e$) { - e = e$; - throw new Error("Option '" + name + "': Error parsing default value '" + option['default'] + "' for type '" + option.type + "': " + e.message); - } - } - if (option['enum'] && !option.parsedPossiblities) { - parsedPossibilities = []; - parsedType = option.parsedType; - for (j$ = 0, len1$ = (ref$ = option['enum']).length; j$ < len1$; ++j$) { - possibility = ref$[j$]; - try { - parsedPossibilities.push(parseLevn(parsedType, possibility)); - } catch (e$) { - e = e$; - throw new Error("Option '" + name + "': Error parsing enum value '" + possibility + "' for type '" + option.type + "': " + e.message); - } - } - option.parsedPossibilities = parsedPossibilities; - } - if (that = option.dependsOn) { - if (that.length) { - ref$ = [].concat(option.dependsOn), rawDependsType = ref$[0], dependsOpts = slice$.call(ref$, 1); - dependsType = rawDependsType.toLowerCase(); - if (dependsOpts.length) { - if (dependsType === 'and' || dependsType === 'or') { - option.dependsOn = [dependsType].concat(arrayFrom$(dependsOpts)); - } else { - throw new Error("Option '" + name + "': If you have more than one dependency, you must specify either 'and' or 'or'"); - } - } else { - if ((ref$ = dependsType.toLowerCase()) === 'and' || ref$ === 'or') { - option.dependsOn = null; - } else { - option.dependsOn = ['and', rawDependsType]; - } - } - } else { - option.dependsOn = null; - } - } - if (option.required) { - required.push(name); - } - opts[name] = option; - if (option.concatRepeatedArrays != null) { - cra = option.concatRepeatedArrays; - if ('Boolean' === toString$.call(cra).slice(8, -1)) { - option.concatRepeatedArrays = [cra, {}]; - } else if (cra.length === 1) { - option.concatRepeatedArrays = [cra[0], {}]; - } else if (cra.length !== 2) { - throw new Error("Invalid setting for concatRepeatedArrays"); - } - } - if (option.alias || option.aliases) { - if (name === 'NUM') { - throw new Error("-NUM option can't have aliases."); - } - if (option.alias) { - option.aliases == null && (option.aliases = [].concat(option.alias)); - } - for (j$ = 0, len1$ = (ref$ = option.aliases).length; j$ < len1$; ++j$) { - alias = ref$[j$]; - if (opts[alias] != null) { - throw new Error("Option '" + alias + "' already defined."); - } - opts[alias] = option; - } - ref$ = partition(fn$, option.aliases), shortNames = ref$[0], longNames = ref$[1]; - option.shortNames == null && (option.shortNames = shortNames); - option.longNames == null && (option.longNames = longNames); - } - if ((!option.aliases || option.shortNames.length === 0) && option.type === 'Boolean' && option['default'] === 'true') { - option.negateName = true; - } - } - } - function fn$(it){ - return it.length === 1; - } - }; - traverse(libOptions.options); - getOption = function(name){ - var opt, possiblyMeant; - opt = opts[name]; - if (opt == null) { - possiblyMeant = closestString(keys(opts), name); - throw new Error("Invalid option '" + nameToRaw(name) + "'" + (possiblyMeant ? " - perhaps you meant '" + nameToRaw(possiblyMeant) + "'?" : '.')); - } - return opt; - }; - parse = function(input, arg$){ - var slice, obj, positional, restPositional, overrideRequired, prop, setValue, setDefaults, checkRequired, mutuallyExclusiveError, checkMutuallyExclusive, checkDependency, checkDependencies, checkProp, args, key, value, option, ref$, i$, len$, arg, that, result, short, argName, usingAssign, val, flags, len, j$, len1$, i, flag, opt, name, valPrime, negated, noedName; - slice = (arg$ != null - ? arg$ - : {}).slice; - obj = {}; - positional = []; - restPositional = false; - overrideRequired = false; - prop = null; - setValue = function(name, value){ - var opt, val, cra, e, currentType; - opt = getOption(name); - if (opt.boolean) { - val = value; - } else { - try { - cra = opt.concatRepeatedArrays; - if (cra != null && cra[0] && cra[1].oneValuePerFlag && opt.parsedType.length === 1 && opt.parsedType[0].structure === 'array') { - val = [parseLevn(opt.parsedType[0].of, value)]; - } else { - val = parseLevn(opt.parsedType, value); - } - } catch (e$) { - e = e$; - throw new Error("Invalid value for option '" + name + "' - expected type " + opt.type + ", received value: " + value + "."); - } - if (opt['enum'] && !any(function(it){ - return deepIs(it, val); - }, opt.parsedPossibilities)) { - throw new Error("Option " + name + ": '" + val + "' not one of " + naturalJoin(opt['enum']) + "."); - } - } - currentType = toString$.call(obj[name]).slice(8, -1); - if (obj[name] != null) { - if (opt.concatRepeatedArrays != null && opt.concatRepeatedArrays[0] && currentType === 'Array') { - obj[name] = obj[name].concat(val); - } else if (opt.mergeRepeatedObjects && currentType === 'Object') { - import$(obj[name], val); - } else { - obj[name] = val; - } - } else { - obj[name] = val; - } - if (opt.restPositional) { - restPositional = true; - } - if (opt.overrideRequired) { - overrideRequired = true; - } - }; - setDefaults = function(){ - var name, ref$, value; - for (name in ref$ = defaults) { - value = ref$[name]; - if (obj[name] == null) { - obj[name] = value; - } - } - }; - checkRequired = function(){ - var i$, ref$, len$, name; - if (overrideRequired) { - return; - } - for (i$ = 0, len$ = (ref$ = required).length; i$ < len$; ++i$) { - name = ref$[i$]; - if (!obj[name]) { - throw new Error("Option " + nameToRaw(name) + " is required."); - } - } - }; - mutuallyExclusiveError = function(first, second){ - throw new Error("The options " + nameToRaw(first) + " and " + nameToRaw(second) + " are mutually exclusive - you cannot use them at the same time."); - }; - checkMutuallyExclusive = function(){ - var rules, i$, len$, rule, present, j$, len1$, element, k$, len2$, opt; - rules = libOptions.mutuallyExclusive; - if (!rules) { - return; - } - for (i$ = 0, len$ = rules.length; i$ < len$; ++i$) { - rule = rules[i$]; - present = null; - for (j$ = 0, len1$ = rule.length; j$ < len1$; ++j$) { - element = rule[j$]; - if (toString$.call(element).slice(8, -1) === 'Array') { - for (k$ = 0, len2$ = element.length; k$ < len2$; ++k$) { - opt = element[k$]; - if (opt in obj) { - if (present != null) { - mutuallyExclusiveError(present, opt); - } else { - present = opt; - break; - } - } - } - } else { - if (element in obj) { - if (present != null) { - mutuallyExclusiveError(present, element); - } else { - present = element; - } - } - } - } - } - }; - checkDependency = function(option){ - var dependsOn, type, targetOptionNames, i$, len$, targetOptionName, targetOption; - dependsOn = option.dependsOn; - if (!dependsOn || option.dependenciesMet) { - return true; - } - type = dependsOn[0], targetOptionNames = slice$.call(dependsOn, 1); - for (i$ = 0, len$ = targetOptionNames.length; i$ < len$; ++i$) { - targetOptionName = targetOptionNames[i$]; - targetOption = obj[targetOptionName]; - if (targetOption && checkDependency(targetOption)) { - if (type === 'or') { - return true; - } - } else if (type === 'and') { - throw new Error("The option '" + option.option + "' did not have its dependencies met."); - } - } - if (type === 'and') { - return true; - } else { - throw new Error("The option '" + option.option + "' did not meet any of its dependencies."); - } - }; - checkDependencies = function(){ - var name; - for (name in obj) { - checkDependency(opts[name]); - } - }; - checkProp = function(){ - if (prop) { - throw new Error("Value for '" + prop + "' of type '" + getOption(prop).type + "' required."); - } - }; - switch (toString$.call(input).slice(8, -1)) { - case 'String': - args = parseString(input.slice(slice != null ? slice : 0)); - break; - case 'Array': - args = input.slice(slice != null ? slice : 2); - break; - case 'Object': - obj = {}; - for (key in input) { - value = input[key]; - if (key !== '_') { - option = getOption(dasherize(key)); - if (parsedTypeCheck(option.parsedType, value)) { - obj[option.option] = value; - } else { - throw new Error("Option '" + option.option + "': Invalid type for '" + value + "' - expected type '" + option.type + "'."); - } - } - } - checkMutuallyExclusive(); - checkDependencies(); - setDefaults(); - checkRequired(); - return ref$ = camelizeKeys(obj), ref$._ = input._ || [], ref$; - default: - throw new Error("Invalid argument to 'parse': " + input + "."); - } - for (i$ = 0, len$ = args.length; i$ < len$; ++i$) { - arg = args[i$]; - if (arg === '--') { - restPositional = true; - } else if (restPositional) { - positional.push(arg); - } else { - if (that = arg.match(/^(--?)([a-zA-Z][-a-zA-Z0-9]*)(=)?(.*)?$/)) { - result = that; - checkProp(); - short = result[1].length === 1; - argName = result[2]; - usingAssign = result[3] != null; - val = result[4]; - if (usingAssign && val == null) { - throw new Error("No value for '" + argName + "' specified."); - } - if (short) { - flags = chars(argName); - len = flags.length; - for (j$ = 0, len1$ = flags.length; j$ < len1$; ++j$) { - i = j$; - flag = flags[j$]; - opt = getOption(flag); - name = opt.option; - if (restPositional) { - positional.push(flag); - } else if (i === len - 1) { - if (usingAssign) { - valPrime = opt.boolean ? parseLevn([{ - type: 'Boolean' - }], val) : val; - setValue(name, valPrime); - } else if (opt.boolean) { - setValue(name, true); - } else { - prop = name; - } - } else if (opt.boolean) { - setValue(name, true); - } else { - throw new Error("Can't set argument '" + flag + "' when not last flag in a group of short flags."); - } - } - } else { - negated = false; - if (that = argName.match(/^no-(.+)$/)) { - negated = true; - noedName = that[1]; - opt = getOption(noedName); - } else { - opt = getOption(argName); - } - name = opt.option; - if (opt.boolean) { - valPrime = usingAssign ? parseLevn([{ - type: 'Boolean' - }], val) : true; - if (negated) { - setValue(name, !valPrime); - } else { - setValue(name, valPrime); - } - } else { - if (negated) { - throw new Error("Only use 'no-' prefix for Boolean options, not with '" + noedName + "'."); - } - if (usingAssign) { - setValue(name, val); - } else { - prop = name; - } - } - } - } else if (that = arg.match(/^-([0-9]+(?:\.[0-9]+)?)$/)) { - opt = opts.NUM; - if (!opt) { - throw new Error('No -NUM option defined.'); - } - setValue(opt.option, that[1]); - } else { - if (prop) { - setValue(prop, arg); - prop = null; - } else { - positional.push(arg); - if (!libOptions.positionalAnywhere) { - restPositional = true; - } - } - } - } - } - checkProp(); - checkMutuallyExclusive(); - checkDependencies(); - setDefaults(); - checkRequired(); - return ref$ = camelizeKeys(obj), ref$._ = positional, ref$; - }; - return { - parse: parse, - parseArgv: function(it){ - return parse(it, { - slice: 2 - }); - }, - generateHelp: generateHelp(libOptions), - generateHelpForOption: generateHelpForOption(getOption, libOptions) - }; - }; - main.VERSION = VERSION; - module.exports = main; - function import$(obj, src){ - var own = {}.hasOwnProperty; - for (var key in src) if (own.call(src, key)) obj[key] = src[key]; - return obj; - } -}).call(this); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/optionator/lib/util.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/optionator/lib/util.js deleted file mode 100644 index 5bc0cbb6..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/optionator/lib/util.js +++ /dev/null @@ -1,54 +0,0 @@ -// Generated by LiveScript 1.6.0 -(function(){ - var prelude, map, sortBy, fl, closestString, nameToRaw, dasherize, naturalJoin; - prelude = require('prelude-ls'), map = prelude.map, sortBy = prelude.sortBy; - fl = require('fast-levenshtein'); - closestString = function(possibilities, input){ - var distances, ref$, string, distance; - if (!possibilities.length) { - return; - } - distances = map(function(it){ - var ref$, longer, shorter; - ref$ = input.length > it.length - ? [input, it] - : [it, input], longer = ref$[0], shorter = ref$[1]; - return { - string: it, - distance: fl.get(longer, shorter) - }; - })( - possibilities); - ref$ = sortBy(function(it){ - return it.distance; - }, distances)[0], string = ref$.string, distance = ref$.distance; - return string; - }; - nameToRaw = function(name){ - if (name.length === 1 || name === 'NUM') { - return "-" + name; - } else { - return "--" + name; - } - }; - dasherize = function(string){ - if (/^[A-Z]/.test(string)) { - return string; - } else { - return prelude.dasherize(string); - } - }; - naturalJoin = function(array){ - if (array.length < 3) { - return array.join(' or '); - } else { - return array.slice(0, -1).join(', ') + ", or " + array[array.length - 1]; - } - }; - module.exports = { - closestString: closestString, - nameToRaw: nameToRaw, - dasherize: dasherize, - naturalJoin: naturalJoin - }; -}).call(this); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/optionator/package.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/optionator/package.json deleted file mode 100644 index fbeb2f9d..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/optionator/package.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "name": "optionator", - "version": "0.8.3", - "author": "George Zahariev ", - "description": "option parsing and help generation", - "homepage": "https://github.com/gkz/optionator", - "keywords": [ - "options", - "flags", - "option parsing", - "cli" - ], - "files": [ - "lib", - "README.md", - "LICENSE" - ], - "main": "./lib/", - "bugs": "https://github.com/gkz/optionator/issues", - "license": "MIT", - "engines": { - "node": ">= 0.8.0" - }, - "repository": { - "type": "git", - "url": "git://github.com/gkz/optionator.git" - }, - "scripts": { - "test": "make test" - }, - "dependencies": { - "prelude-ls": "~1.1.2", - "deep-is": "~0.1.3", - "word-wrap": "~1.2.3", - "type-check": "~0.3.2", - "levn": "~0.3.0", - "fast-levenshtein": "~2.0.6" - }, - "devDependencies": { - "livescript": "~1.6.0", - "mocha": "~6.2.2", - "istanbul": "~0.4.5" - } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/p-limit/index.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/p-limit/index.d.ts deleted file mode 100644 index f348d7f1..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/p-limit/index.d.ts +++ /dev/null @@ -1,42 +0,0 @@ -declare namespace pLimit { - interface Limit { - /** - The number of promises that are currently running. - */ - readonly activeCount: number; - - /** - The number of promises that are waiting to run (i.e. their internal `fn` was not called yet). - */ - readonly pendingCount: number; - - /** - Discard pending promises that are waiting to run. - - This might be useful if you want to teardown the queue at the end of your program's lifecycle or discard any function calls referencing an intermediary state of your app. - - Note: This does not cancel promises that are already running. - */ - clearQueue: () => void; - - /** - @param fn - Promise-returning/async function. - @param arguments - Any arguments to pass through to `fn`. Support for passing arguments on to the `fn` is provided in order to be able to avoid creating unnecessary closures. You probably don't need this optimization unless you're pushing a lot of functions. - @returns The promise returned by calling `fn(...arguments)`. - */ - ( - fn: (...arguments: Arguments) => PromiseLike | ReturnType, - ...arguments: Arguments - ): Promise; - } -} - -/** -Run multiple promise-returning & async functions with limited concurrency. - -@param concurrency - Concurrency limit. Minimum: `1`. -@returns A `limit` function. -*/ -declare function pLimit(concurrency: number): pLimit.Limit; - -export = pLimit; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/p-limit/index.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/p-limit/index.js deleted file mode 100644 index c2ae52d9..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/p-limit/index.js +++ /dev/null @@ -1,71 +0,0 @@ -'use strict'; -const Queue = require('yocto-queue'); - -const pLimit = concurrency => { - if (!((Number.isInteger(concurrency) || concurrency === Infinity) && concurrency > 0)) { - throw new TypeError('Expected `concurrency` to be a number from 1 and up'); - } - - const queue = new Queue(); - let activeCount = 0; - - const next = () => { - activeCount--; - - if (queue.size > 0) { - queue.dequeue()(); - } - }; - - const run = async (fn, resolve, ...args) => { - activeCount++; - - const result = (async () => fn(...args))(); - - resolve(result); - - try { - await result; - } catch {} - - next(); - }; - - const enqueue = (fn, resolve, ...args) => { - queue.enqueue(run.bind(null, fn, resolve, ...args)); - - (async () => { - // This function needs to wait until the next microtask before comparing - // `activeCount` to `concurrency`, because `activeCount` is updated asynchronously - // when the run function is dequeued and called. The comparison in the if-statement - // needs to happen asynchronously as well to get an up-to-date value for `activeCount`. - await Promise.resolve(); - - if (activeCount < concurrency && queue.size > 0) { - queue.dequeue()(); - } - })(); - }; - - const generator = (fn, ...args) => new Promise(resolve => { - enqueue(fn, resolve, ...args); - }); - - Object.defineProperties(generator, { - activeCount: { - get: () => activeCount - }, - pendingCount: { - get: () => queue.size - }, - clearQueue: { - value: () => { - queue.clear(); - } - } - }); - - return generator; -}; - -module.exports = pLimit; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/p-limit/license b/packages/wyatt_notification_bloc/example/scripts/node_modules/p-limit/license deleted file mode 100644 index fa7ceba3..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/p-limit/license +++ /dev/null @@ -1,9 +0,0 @@ -MIT License - -Copyright (c) Sindre Sorhus (https://sindresorhus.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/p-limit/package.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/p-limit/package.json deleted file mode 100644 index 76514736..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/p-limit/package.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "name": "p-limit", - "version": "3.1.0", - "description": "Run multiple promise-returning & async functions with limited concurrency", - "license": "MIT", - "repository": "sindresorhus/p-limit", - "funding": "https://github.com/sponsors/sindresorhus", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "https://sindresorhus.com" - }, - "engines": { - "node": ">=10" - }, - "scripts": { - "test": "xo && ava && tsd" - }, - "files": [ - "index.js", - "index.d.ts" - ], - "keywords": [ - "promise", - "limit", - "limited", - "concurrency", - "throttle", - "throat", - "rate", - "batch", - "ratelimit", - "task", - "queue", - "async", - "await", - "promises", - "bluebird" - ], - "dependencies": { - "yocto-queue": "^0.1.0" - }, - "devDependencies": { - "ava": "^2.4.0", - "delay": "^4.4.0", - "in-range": "^2.0.0", - "random-int": "^2.0.1", - "time-span": "^4.0.0", - "tsd": "^0.13.1", - "xo": "^0.35.0" - } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/p-limit/readme.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/p-limit/readme.md deleted file mode 100644 index b283c1e6..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/p-limit/readme.md +++ /dev/null @@ -1,101 +0,0 @@ -# p-limit - -> Run multiple promise-returning & async functions with limited concurrency - -## Install - -``` -$ npm install p-limit -``` - -## Usage - -```js -const pLimit = require('p-limit'); - -const limit = pLimit(1); - -const input = [ - limit(() => fetchSomething('foo')), - limit(() => fetchSomething('bar')), - limit(() => doSomething()) -]; - -(async () => { - // Only one promise is run at once - const result = await Promise.all(input); - console.log(result); -})(); -``` - -## API - -### pLimit(concurrency) - -Returns a `limit` function. - -#### concurrency - -Type: `number`\ -Minimum: `1`\ -Default: `Infinity` - -Concurrency limit. - -### limit(fn, ...args) - -Returns the promise returned by calling `fn(...args)`. - -#### fn - -Type: `Function` - -Promise-returning/async function. - -#### args - -Any arguments to pass through to `fn`. - -Support for passing arguments on to the `fn` is provided in order to be able to avoid creating unnecessary closures. You probably don't need this optimization unless you're pushing a *lot* of functions. - -### limit.activeCount - -The number of promises that are currently running. - -### limit.pendingCount - -The number of promises that are waiting to run (i.e. their internal `fn` was not called yet). - -### limit.clearQueue() - -Discard pending promises that are waiting to run. - -This might be useful if you want to teardown the queue at the end of your program's lifecycle or discard any function calls referencing an intermediary state of your app. - -Note: This does not cancel promises that are already running. - -## FAQ - -### How is this different from the [`p-queue`](https://github.com/sindresorhus/p-queue) package? - -This package is only about limiting the number of concurrent executions, while `p-queue` is a fully featured queue implementation with lots of different options, introspection, and ability to pause the queue. - -## Related - -- [p-queue](https://github.com/sindresorhus/p-queue) - Promise queue with concurrency control -- [p-throttle](https://github.com/sindresorhus/p-throttle) - Throttle promise-returning & async functions -- [p-debounce](https://github.com/sindresorhus/p-debounce) - Debounce promise-returning & async functions -- [p-all](https://github.com/sindresorhus/p-all) - Run promise-returning & async functions concurrently with optional limited concurrency -- [More…](https://github.com/sindresorhus/promise-fun) - ---- - -
    - - Get professional support for this package with a Tidelift subscription - -
    - - Tidelift helps make open source sustainable for maintainers while giving companies
    assurances about security, maintenance, and licensing for their dependencies. -
    -
    diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/path-is-absolute/index.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/path-is-absolute/index.js deleted file mode 100644 index 22aa6c35..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/path-is-absolute/index.js +++ /dev/null @@ -1,20 +0,0 @@ -'use strict'; - -function posix(path) { - return path.charAt(0) === '/'; -} - -function win32(path) { - // https://github.com/nodejs/node/blob/b3fcc245fb25539909ef1d5eaa01dbf92e168633/lib/path.js#L56 - var splitDeviceRe = /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/; - var result = splitDeviceRe.exec(path); - var device = result[1] || ''; - var isUnc = Boolean(device && device.charAt(1) !== ':'); - - // UNC paths are always absolute - return Boolean(result[2] || isUnc); -} - -module.exports = process.platform === 'win32' ? win32 : posix; -module.exports.posix = posix; -module.exports.win32 = win32; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/path-is-absolute/license b/packages/wyatt_notification_bloc/example/scripts/node_modules/path-is-absolute/license deleted file mode 100644 index 654d0bfe..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/path-is-absolute/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Sindre Sorhus (sindresorhus.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/path-is-absolute/package.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/path-is-absolute/package.json deleted file mode 100644 index 91196d5e..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/path-is-absolute/package.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "name": "path-is-absolute", - "version": "1.0.1", - "description": "Node.js 0.12 path.isAbsolute() ponyfill", - "license": "MIT", - "repository": "sindresorhus/path-is-absolute", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "engines": { - "node": ">=0.10.0" - }, - "scripts": { - "test": "xo && node test.js" - }, - "files": [ - "index.js" - ], - "keywords": [ - "path", - "paths", - "file", - "dir", - "absolute", - "isabsolute", - "is-absolute", - "built-in", - "util", - "utils", - "core", - "ponyfill", - "polyfill", - "shim", - "is", - "detect", - "check" - ], - "devDependencies": { - "xo": "^0.16.0" - } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/path-is-absolute/readme.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/path-is-absolute/readme.md deleted file mode 100644 index 8dbdf5fc..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/path-is-absolute/readme.md +++ /dev/null @@ -1,59 +0,0 @@ -# path-is-absolute [![Build Status](https://travis-ci.org/sindresorhus/path-is-absolute.svg?branch=master)](https://travis-ci.org/sindresorhus/path-is-absolute) - -> Node.js 0.12 [`path.isAbsolute()`](http://nodejs.org/api/path.html#path_path_isabsolute_path) [ponyfill](https://ponyfill.com) - - -## Install - -``` -$ npm install --save path-is-absolute -``` - - -## Usage - -```js -const pathIsAbsolute = require('path-is-absolute'); - -// Running on Linux -pathIsAbsolute('/home/foo'); -//=> true -pathIsAbsolute('C:/Users/foo'); -//=> false - -// Running on Windows -pathIsAbsolute('C:/Users/foo'); -//=> true -pathIsAbsolute('/home/foo'); -//=> false - -// Running on any OS -pathIsAbsolute.posix('/home/foo'); -//=> true -pathIsAbsolute.posix('C:/Users/foo'); -//=> false -pathIsAbsolute.win32('C:/Users/foo'); -//=> true -pathIsAbsolute.win32('/home/foo'); -//=> false -``` - - -## API - -See the [`path.isAbsolute()` docs](http://nodejs.org/api/path.html#path_path_isabsolute_path). - -### pathIsAbsolute(path) - -### pathIsAbsolute.posix(path) - -POSIX specific version. - -### pathIsAbsolute.win32(path) - -Windows specific version. - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/prelude-ls/CHANGELOG.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/prelude-ls/CHANGELOG.md deleted file mode 100644 index c2de12d5..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/prelude-ls/CHANGELOG.md +++ /dev/null @@ -1,99 +0,0 @@ -# 1.1.2 -- add `Func.memoize` -- fix `zip-all` and `zip-with-all` corner case (no input) -- build with LiveScript 1.4.0 - -# 1.1.1 -- curry `unique-by`, `minimum-by` - -# 1.1.0 -- added `List` functions: `maximum-by`, `minimum-by`, `unique-by` -- added `List` functions: `at`, `elem-index`, `elem-indices`, `find-index`, `find-indices` -- added `Str` functions: `capitalize`, `camelize`, `dasherize` -- added `Func` function: `over` - eg. ``same-length = (==) `over` (.length)`` -- exported `Str.repeat` through main `prelude` object -- fixed definition of `foldr` and `foldr1`, the new correct definition is backwards incompatible with the old, incorrect one -- fixed issue with `fix` -- improved code coverage - -# 1.0.3 -- build browser versions - -# 1.0.2 -- bug fix for `flatten` - slight change with bug fix, flattens arrays only, not array-like objects - -# 1.0.1 -- bug fixes for `drop-while` and `take-while` - -# 1.0.0 -* massive update - separated functions into separate modules -* functions do not accept multiple types anymore - use different versions in their respective modules in some cases (eg. `Obj.map`), or use `chars` or `values` in other cases to transform into a list -* objects are no longer transformed into functions, simply use `(obj.)` in LiveScript to do that -* browser version now using browserify - use `prelude = require('prelude-ls')` -* added `compact`, `split`, `flatten`, `difference`, `intersection`, `union`, `count-by`, `group-by`, `chars`, `unchars`, `apply` -* added `lists-to-obj` which takes a list of keys and list of values and zips them up into an object, and the converse `obj-to-lists` -* added `pairs-to-obj` which takes a list of pairs (2 element lists) and creates an object, and the converse `obj-to-pairs` -* removed `cons`, `append` - use the concat operator -* removed `compose` - use the compose operator -* removed `obj-to-func` - use partially applied access (eg. `(obj.)`) -* removed `length` - use `(.length)` -* `sort-by` renamed to `sort-with` -* added new `sort-by` -* removed `compare` - just use the new `sort-by` -* `break-it` renamed `break-list`, (`Str.break-str` for the string version) -* added `Str.repeat` which creates a new string by repeating the input n times -* `unfold` as alias to `unfoldr` is no longer used -* fixed up style and compiled with LiveScript 1.1.1 -* use Make instead of Slake -* greatly improved tests - -# 0.6.0 -* fixed various bugs -* added `fix`, a fixpoint (Y combinator) for anonymous recursive functions -* added `unfoldr` (alias `unfold`) -* calling `replicate` with a string now returns a list of strings -* removed `partial`, just use native partial application in LiveScript using the `_` placeholder, or currying -* added `sort`, `sortBy`, and `compare` - -# 0.5.0 -* removed `lookup` - use (.prop) -* removed `call` - use (.func arg1, arg2) -* removed `pluck` - use map (.prop), xs -* fixed buys wtih `head` and `last` -* added non-minifed browser version, as `prelude-browser.js` -* renamed `prelude-min.js` to `prelude-browser-min.js` -* renamed `zip` to `zipAll` -* renamed `zipWith` to `zipAllWith` -* added `zip`, a curried zip that takes only two arguments -* added `zipWith`, a curried zipWith that takes only two arguments - -# 0.4.0 -* added `parition` function -* added `curry` function -* removed `elem` function (use `in`) -* removed `notElem` function (use `not in`) - -# 0.3.0 -* added `listToObject` -* added `unique` -* added `objToFunc` -* added support for using strings in map and the like -* added support for using objects in map and the like -* added ability to use objects instead of functions in certain cases -* removed `error` (just use throw) -* added `tau` constant -* added `join` -* added `values` -* added `keys` -* added `partial` -* renamed `log` to `ln` -* added alias to `head`: `first` -* added `installPrelude` helper - -# 0.2.0 -* removed functions that simply warp operators as you can now use operators as functions in LiveScript -* `min/max` are now curried and take only 2 arguments -* added `call` - -# 0.1.0 -* initial public release diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/prelude-ls/LICENSE b/packages/wyatt_notification_bloc/example/scripts/node_modules/prelude-ls/LICENSE deleted file mode 100644 index 525b1185..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/prelude-ls/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -Copyright (c) George Zahariev - -Permission is hereby granted, free of charge, to any person -obtaining a copy of this software and associated documentation -files (the "Software"), to deal in the Software without -restriction, including without limitation the rights to use, -copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following -conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/prelude-ls/README.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/prelude-ls/README.md deleted file mode 100644 index fabc212e..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/prelude-ls/README.md +++ /dev/null @@ -1,15 +0,0 @@ -# prelude.ls [![Build Status](https://travis-ci.org/gkz/prelude-ls.png?branch=master)](https://travis-ci.org/gkz/prelude-ls) - -is a functionally oriented utility library. It is powerful and flexible. Almost all of its functions are curried. It is written in, and is the recommended base library for, LiveScript. - -See **[the prelude.ls site](http://preludels.com)** for examples, a reference, and more. - -You can install via npm `npm install prelude-ls` - -### Development - -`make test` to test - -`make build` to build `lib` from `src` - -`make build-browser` to build browser versions diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/prelude-ls/lib/Func.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/prelude-ls/lib/Func.js deleted file mode 100644 index b80c9b13..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/prelude-ls/lib/Func.js +++ /dev/null @@ -1,65 +0,0 @@ -// Generated by LiveScript 1.4.0 -var apply, curry, flip, fix, over, memoize, slice$ = [].slice, toString$ = {}.toString; -apply = curry$(function(f, list){ - return f.apply(null, list); -}); -curry = function(f){ - return curry$(f); -}; -flip = curry$(function(f, x, y){ - return f(y, x); -}); -fix = function(f){ - return function(g){ - return function(){ - return f(g(g)).apply(null, arguments); - }; - }(function(g){ - return function(){ - return f(g(g)).apply(null, arguments); - }; - }); -}; -over = curry$(function(f, g, x, y){ - return f(g(x), g(y)); -}); -memoize = function(f){ - var memo; - memo = {}; - return function(){ - var args, key, arg; - args = slice$.call(arguments); - key = (function(){ - var i$, ref$, len$, results$ = []; - for (i$ = 0, len$ = (ref$ = args).length; i$ < len$; ++i$) { - arg = ref$[i$]; - results$.push(arg + toString$.call(arg).slice(8, -1)); - } - return results$; - }()).join(''); - return memo[key] = key in memo - ? memo[key] - : f.apply(null, args); - }; -}; -module.exports = { - curry: curry, - flip: flip, - fix: fix, - apply: apply, - over: over, - memoize: memoize -}; -function curry$(f, bound){ - var context, - _curry = function(args) { - return f.length > 1 ? function(){ - var params = args ? args.concat() : []; - context = bound ? context || this : this; - return params.push.apply(params, arguments) < - f.length && arguments.length ? - _curry.call(context, params) : f.apply(context, params); - } : f; - }; - return _curry(); -} \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/prelude-ls/lib/List.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/prelude-ls/lib/List.js deleted file mode 100644 index 5790816b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/prelude-ls/lib/List.js +++ /dev/null @@ -1,686 +0,0 @@ -// Generated by LiveScript 1.4.0 -var each, map, compact, filter, reject, partition, find, head, first, tail, last, initial, empty, reverse, unique, uniqueBy, fold, foldl, fold1, foldl1, foldr, foldr1, unfoldr, concat, concatMap, flatten, difference, intersection, union, countBy, groupBy, andList, orList, any, all, sort, sortWith, sortBy, sum, product, mean, average, maximum, minimum, maximumBy, minimumBy, scan, scanl, scan1, scanl1, scanr, scanr1, slice, take, drop, splitAt, takeWhile, dropWhile, span, breakList, zip, zipWith, zipAll, zipAllWith, at, elemIndex, elemIndices, findIndex, findIndices, toString$ = {}.toString, slice$ = [].slice; -each = curry$(function(f, xs){ - var i$, len$, x; - for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) { - x = xs[i$]; - f(x); - } - return xs; -}); -map = curry$(function(f, xs){ - var i$, len$, x, results$ = []; - for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) { - x = xs[i$]; - results$.push(f(x)); - } - return results$; -}); -compact = function(xs){ - var i$, len$, x, results$ = []; - for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) { - x = xs[i$]; - if (x) { - results$.push(x); - } - } - return results$; -}; -filter = curry$(function(f, xs){ - var i$, len$, x, results$ = []; - for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) { - x = xs[i$]; - if (f(x)) { - results$.push(x); - } - } - return results$; -}); -reject = curry$(function(f, xs){ - var i$, len$, x, results$ = []; - for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) { - x = xs[i$]; - if (!f(x)) { - results$.push(x); - } - } - return results$; -}); -partition = curry$(function(f, xs){ - var passed, failed, i$, len$, x; - passed = []; - failed = []; - for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) { - x = xs[i$]; - (f(x) ? passed : failed).push(x); - } - return [passed, failed]; -}); -find = curry$(function(f, xs){ - var i$, len$, x; - for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) { - x = xs[i$]; - if (f(x)) { - return x; - } - } -}); -head = first = function(xs){ - return xs[0]; -}; -tail = function(xs){ - if (!xs.length) { - return; - } - return xs.slice(1); -}; -last = function(xs){ - return xs[xs.length - 1]; -}; -initial = function(xs){ - if (!xs.length) { - return; - } - return xs.slice(0, -1); -}; -empty = function(xs){ - return !xs.length; -}; -reverse = function(xs){ - return xs.concat().reverse(); -}; -unique = function(xs){ - var result, i$, len$, x; - result = []; - for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) { - x = xs[i$]; - if (!in$(x, result)) { - result.push(x); - } - } - return result; -}; -uniqueBy = curry$(function(f, xs){ - var seen, i$, len$, x, val, results$ = []; - seen = []; - for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) { - x = xs[i$]; - val = f(x); - if (in$(val, seen)) { - continue; - } - seen.push(val); - results$.push(x); - } - return results$; -}); -fold = foldl = curry$(function(f, memo, xs){ - var i$, len$, x; - for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) { - x = xs[i$]; - memo = f(memo, x); - } - return memo; -}); -fold1 = foldl1 = curry$(function(f, xs){ - return fold(f, xs[0], xs.slice(1)); -}); -foldr = curry$(function(f, memo, xs){ - var i$, x; - for (i$ = xs.length - 1; i$ >= 0; --i$) { - x = xs[i$]; - memo = f(x, memo); - } - return memo; -}); -foldr1 = curry$(function(f, xs){ - return foldr(f, xs[xs.length - 1], xs.slice(0, -1)); -}); -unfoldr = curry$(function(f, b){ - var result, x, that; - result = []; - x = b; - while ((that = f(x)) != null) { - result.push(that[0]); - x = that[1]; - } - return result; -}); -concat = function(xss){ - return [].concat.apply([], xss); -}; -concatMap = curry$(function(f, xs){ - var x; - return [].concat.apply([], (function(){ - var i$, ref$, len$, results$ = []; - for (i$ = 0, len$ = (ref$ = xs).length; i$ < len$; ++i$) { - x = ref$[i$]; - results$.push(f(x)); - } - return results$; - }())); -}); -flatten = function(xs){ - var x; - return [].concat.apply([], (function(){ - var i$, ref$, len$, results$ = []; - for (i$ = 0, len$ = (ref$ = xs).length; i$ < len$; ++i$) { - x = ref$[i$]; - if (toString$.call(x).slice(8, -1) === 'Array') { - results$.push(flatten(x)); - } else { - results$.push(x); - } - } - return results$; - }())); -}; -difference = function(xs){ - var yss, results, i$, len$, x, j$, len1$, ys; - yss = slice$.call(arguments, 1); - results = []; - outer: for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) { - x = xs[i$]; - for (j$ = 0, len1$ = yss.length; j$ < len1$; ++j$) { - ys = yss[j$]; - if (in$(x, ys)) { - continue outer; - } - } - results.push(x); - } - return results; -}; -intersection = function(xs){ - var yss, results, i$, len$, x, j$, len1$, ys; - yss = slice$.call(arguments, 1); - results = []; - outer: for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) { - x = xs[i$]; - for (j$ = 0, len1$ = yss.length; j$ < len1$; ++j$) { - ys = yss[j$]; - if (!in$(x, ys)) { - continue outer; - } - } - results.push(x); - } - return results; -}; -union = function(){ - var xss, results, i$, len$, xs, j$, len1$, x; - xss = slice$.call(arguments); - results = []; - for (i$ = 0, len$ = xss.length; i$ < len$; ++i$) { - xs = xss[i$]; - for (j$ = 0, len1$ = xs.length; j$ < len1$; ++j$) { - x = xs[j$]; - if (!in$(x, results)) { - results.push(x); - } - } - } - return results; -}; -countBy = curry$(function(f, xs){ - var results, i$, len$, x, key; - results = {}; - for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) { - x = xs[i$]; - key = f(x); - if (key in results) { - results[key] += 1; - } else { - results[key] = 1; - } - } - return results; -}); -groupBy = curry$(function(f, xs){ - var results, i$, len$, x, key; - results = {}; - for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) { - x = xs[i$]; - key = f(x); - if (key in results) { - results[key].push(x); - } else { - results[key] = [x]; - } - } - return results; -}); -andList = function(xs){ - var i$, len$, x; - for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) { - x = xs[i$]; - if (!x) { - return false; - } - } - return true; -}; -orList = function(xs){ - var i$, len$, x; - for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) { - x = xs[i$]; - if (x) { - return true; - } - } - return false; -}; -any = curry$(function(f, xs){ - var i$, len$, x; - for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) { - x = xs[i$]; - if (f(x)) { - return true; - } - } - return false; -}); -all = curry$(function(f, xs){ - var i$, len$, x; - for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) { - x = xs[i$]; - if (!f(x)) { - return false; - } - } - return true; -}); -sort = function(xs){ - return xs.concat().sort(function(x, y){ - if (x > y) { - return 1; - } else if (x < y) { - return -1; - } else { - return 0; - } - }); -}; -sortWith = curry$(function(f, xs){ - return xs.concat().sort(f); -}); -sortBy = curry$(function(f, xs){ - return xs.concat().sort(function(x, y){ - if (f(x) > f(y)) { - return 1; - } else if (f(x) < f(y)) { - return -1; - } else { - return 0; - } - }); -}); -sum = function(xs){ - var result, i$, len$, x; - result = 0; - for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) { - x = xs[i$]; - result += x; - } - return result; -}; -product = function(xs){ - var result, i$, len$, x; - result = 1; - for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) { - x = xs[i$]; - result *= x; - } - return result; -}; -mean = average = function(xs){ - var sum, i$, len$, x; - sum = 0; - for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) { - x = xs[i$]; - sum += x; - } - return sum / xs.length; -}; -maximum = function(xs){ - var max, i$, ref$, len$, x; - max = xs[0]; - for (i$ = 0, len$ = (ref$ = xs.slice(1)).length; i$ < len$; ++i$) { - x = ref$[i$]; - if (x > max) { - max = x; - } - } - return max; -}; -minimum = function(xs){ - var min, i$, ref$, len$, x; - min = xs[0]; - for (i$ = 0, len$ = (ref$ = xs.slice(1)).length; i$ < len$; ++i$) { - x = ref$[i$]; - if (x < min) { - min = x; - } - } - return min; -}; -maximumBy = curry$(function(f, xs){ - var max, i$, ref$, len$, x; - max = xs[0]; - for (i$ = 0, len$ = (ref$ = xs.slice(1)).length; i$ < len$; ++i$) { - x = ref$[i$]; - if (f(x) > f(max)) { - max = x; - } - } - return max; -}); -minimumBy = curry$(function(f, xs){ - var min, i$, ref$, len$, x; - min = xs[0]; - for (i$ = 0, len$ = (ref$ = xs.slice(1)).length; i$ < len$; ++i$) { - x = ref$[i$]; - if (f(x) < f(min)) { - min = x; - } - } - return min; -}); -scan = scanl = curry$(function(f, memo, xs){ - var last, x; - last = memo; - return [memo].concat((function(){ - var i$, ref$, len$, results$ = []; - for (i$ = 0, len$ = (ref$ = xs).length; i$ < len$; ++i$) { - x = ref$[i$]; - results$.push(last = f(last, x)); - } - return results$; - }())); -}); -scan1 = scanl1 = curry$(function(f, xs){ - if (!xs.length) { - return; - } - return scan(f, xs[0], xs.slice(1)); -}); -scanr = curry$(function(f, memo, xs){ - xs = xs.concat().reverse(); - return scan(f, memo, xs).reverse(); -}); -scanr1 = curry$(function(f, xs){ - if (!xs.length) { - return; - } - xs = xs.concat().reverse(); - return scan(f, xs[0], xs.slice(1)).reverse(); -}); -slice = curry$(function(x, y, xs){ - return xs.slice(x, y); -}); -take = curry$(function(n, xs){ - if (n <= 0) { - return xs.slice(0, 0); - } else { - return xs.slice(0, n); - } -}); -drop = curry$(function(n, xs){ - if (n <= 0) { - return xs; - } else { - return xs.slice(n); - } -}); -splitAt = curry$(function(n, xs){ - return [take(n, xs), drop(n, xs)]; -}); -takeWhile = curry$(function(p, xs){ - var len, i; - len = xs.length; - if (!len) { - return xs; - } - i = 0; - while (i < len && p(xs[i])) { - i += 1; - } - return xs.slice(0, i); -}); -dropWhile = curry$(function(p, xs){ - var len, i; - len = xs.length; - if (!len) { - return xs; - } - i = 0; - while (i < len && p(xs[i])) { - i += 1; - } - return xs.slice(i); -}); -span = curry$(function(p, xs){ - return [takeWhile(p, xs), dropWhile(p, xs)]; -}); -breakList = curry$(function(p, xs){ - return span(compose$(p, not$), xs); -}); -zip = curry$(function(xs, ys){ - var result, len, i$, len$, i, x; - result = []; - len = ys.length; - for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) { - i = i$; - x = xs[i$]; - if (i === len) { - break; - } - result.push([x, ys[i]]); - } - return result; -}); -zipWith = curry$(function(f, xs, ys){ - var result, len, i$, len$, i, x; - result = []; - len = ys.length; - for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) { - i = i$; - x = xs[i$]; - if (i === len) { - break; - } - result.push(f(x, ys[i])); - } - return result; -}); -zipAll = function(){ - var xss, minLength, i$, len$, xs, ref$, i, lresult$, j$, results$ = []; - xss = slice$.call(arguments); - minLength = undefined; - for (i$ = 0, len$ = xss.length; i$ < len$; ++i$) { - xs = xss[i$]; - minLength <= (ref$ = xs.length) || (minLength = ref$); - } - for (i$ = 0; i$ < minLength; ++i$) { - i = i$; - lresult$ = []; - for (j$ = 0, len$ = xss.length; j$ < len$; ++j$) { - xs = xss[j$]; - lresult$.push(xs[i]); - } - results$.push(lresult$); - } - return results$; -}; -zipAllWith = function(f){ - var xss, minLength, i$, len$, xs, ref$, i, results$ = []; - xss = slice$.call(arguments, 1); - minLength = undefined; - for (i$ = 0, len$ = xss.length; i$ < len$; ++i$) { - xs = xss[i$]; - minLength <= (ref$ = xs.length) || (minLength = ref$); - } - for (i$ = 0; i$ < minLength; ++i$) { - i = i$; - results$.push(f.apply(null, (fn$()))); - } - return results$; - function fn$(){ - var i$, ref$, len$, results$ = []; - for (i$ = 0, len$ = (ref$ = xss).length; i$ < len$; ++i$) { - xs = ref$[i$]; - results$.push(xs[i]); - } - return results$; - } -}; -at = curry$(function(n, xs){ - if (n < 0) { - return xs[xs.length + n]; - } else { - return xs[n]; - } -}); -elemIndex = curry$(function(el, xs){ - var i$, len$, i, x; - for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) { - i = i$; - x = xs[i$]; - if (x === el) { - return i; - } - } -}); -elemIndices = curry$(function(el, xs){ - var i$, len$, i, x, results$ = []; - for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) { - i = i$; - x = xs[i$]; - if (x === el) { - results$.push(i); - } - } - return results$; -}); -findIndex = curry$(function(f, xs){ - var i$, len$, i, x; - for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) { - i = i$; - x = xs[i$]; - if (f(x)) { - return i; - } - } -}); -findIndices = curry$(function(f, xs){ - var i$, len$, i, x, results$ = []; - for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) { - i = i$; - x = xs[i$]; - if (f(x)) { - results$.push(i); - } - } - return results$; -}); -module.exports = { - each: each, - map: map, - filter: filter, - compact: compact, - reject: reject, - partition: partition, - find: find, - head: head, - first: first, - tail: tail, - last: last, - initial: initial, - empty: empty, - reverse: reverse, - difference: difference, - intersection: intersection, - union: union, - countBy: countBy, - groupBy: groupBy, - fold: fold, - fold1: fold1, - foldl: foldl, - foldl1: foldl1, - foldr: foldr, - foldr1: foldr1, - unfoldr: unfoldr, - andList: andList, - orList: orList, - any: any, - all: all, - unique: unique, - uniqueBy: uniqueBy, - sort: sort, - sortWith: sortWith, - sortBy: sortBy, - sum: sum, - product: product, - mean: mean, - average: average, - concat: concat, - concatMap: concatMap, - flatten: flatten, - maximum: maximum, - minimum: minimum, - maximumBy: maximumBy, - minimumBy: minimumBy, - scan: scan, - scan1: scan1, - scanl: scanl, - scanl1: scanl1, - scanr: scanr, - scanr1: scanr1, - slice: slice, - take: take, - drop: drop, - splitAt: splitAt, - takeWhile: takeWhile, - dropWhile: dropWhile, - span: span, - breakList: breakList, - zip: zip, - zipWith: zipWith, - zipAll: zipAll, - zipAllWith: zipAllWith, - at: at, - elemIndex: elemIndex, - elemIndices: elemIndices, - findIndex: findIndex, - findIndices: findIndices -}; -function curry$(f, bound){ - var context, - _curry = function(args) { - return f.length > 1 ? function(){ - var params = args ? args.concat() : []; - context = bound ? context || this : this; - return params.push.apply(params, arguments) < - f.length && arguments.length ? - _curry.call(context, params) : f.apply(context, params); - } : f; - }; - return _curry(); -} -function in$(x, xs){ - var i = -1, l = xs.length >>> 0; - while (++i < l) if (x === xs[i]) return true; - return false; -} -function compose$() { - var functions = arguments; - return function() { - var i, result; - result = functions[0].apply(this, arguments); - for (i = 1; i < functions.length; ++i) { - result = functions[i](result); - } - return result; - }; -} -function not$(x){ return !x; } \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/prelude-ls/lib/Num.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/prelude-ls/lib/Num.js deleted file mode 100644 index 0e25be7b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/prelude-ls/lib/Num.js +++ /dev/null @@ -1,130 +0,0 @@ -// Generated by LiveScript 1.4.0 -var max, min, negate, abs, signum, quot, rem, div, mod, recip, pi, tau, exp, sqrt, ln, pow, sin, tan, cos, asin, acos, atan, atan2, truncate, round, ceiling, floor, isItNaN, even, odd, gcd, lcm; -max = curry$(function(x$, y$){ - return x$ > y$ ? x$ : y$; -}); -min = curry$(function(x$, y$){ - return x$ < y$ ? x$ : y$; -}); -negate = function(x){ - return -x; -}; -abs = Math.abs; -signum = function(x){ - if (x < 0) { - return -1; - } else if (x > 0) { - return 1; - } else { - return 0; - } -}; -quot = curry$(function(x, y){ - return ~~(x / y); -}); -rem = curry$(function(x$, y$){ - return x$ % y$; -}); -div = curry$(function(x, y){ - return Math.floor(x / y); -}); -mod = curry$(function(x$, y$){ - var ref$; - return (((x$) % (ref$ = y$) + ref$) % ref$); -}); -recip = (function(it){ - return 1 / it; -}); -pi = Math.PI; -tau = pi * 2; -exp = Math.exp; -sqrt = Math.sqrt; -ln = Math.log; -pow = curry$(function(x$, y$){ - return Math.pow(x$, y$); -}); -sin = Math.sin; -tan = Math.tan; -cos = Math.cos; -asin = Math.asin; -acos = Math.acos; -atan = Math.atan; -atan2 = curry$(function(x, y){ - return Math.atan2(x, y); -}); -truncate = function(x){ - return ~~x; -}; -round = Math.round; -ceiling = Math.ceil; -floor = Math.floor; -isItNaN = function(x){ - return x !== x; -}; -even = function(x){ - return x % 2 === 0; -}; -odd = function(x){ - return x % 2 !== 0; -}; -gcd = curry$(function(x, y){ - var z; - x = Math.abs(x); - y = Math.abs(y); - while (y !== 0) { - z = x % y; - x = y; - y = z; - } - return x; -}); -lcm = curry$(function(x, y){ - return Math.abs(Math.floor(x / gcd(x, y) * y)); -}); -module.exports = { - max: max, - min: min, - negate: negate, - abs: abs, - signum: signum, - quot: quot, - rem: rem, - div: div, - mod: mod, - recip: recip, - pi: pi, - tau: tau, - exp: exp, - sqrt: sqrt, - ln: ln, - pow: pow, - sin: sin, - tan: tan, - cos: cos, - acos: acos, - asin: asin, - atan: atan, - atan2: atan2, - truncate: truncate, - round: round, - ceiling: ceiling, - floor: floor, - isItNaN: isItNaN, - even: even, - odd: odd, - gcd: gcd, - lcm: lcm -}; -function curry$(f, bound){ - var context, - _curry = function(args) { - return f.length > 1 ? function(){ - var params = args ? args.concat() : []; - context = bound ? context || this : this; - return params.push.apply(params, arguments) < - f.length && arguments.length ? - _curry.call(context, params) : f.apply(context, params); - } : f; - }; - return _curry(); -} \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/prelude-ls/lib/Obj.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/prelude-ls/lib/Obj.js deleted file mode 100644 index f0a921ff..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/prelude-ls/lib/Obj.js +++ /dev/null @@ -1,154 +0,0 @@ -// Generated by LiveScript 1.4.0 -var values, keys, pairsToObj, objToPairs, listsToObj, objToLists, empty, each, map, compact, filter, reject, partition, find; -values = function(object){ - var i$, x, results$ = []; - for (i$ in object) { - x = object[i$]; - results$.push(x); - } - return results$; -}; -keys = function(object){ - var x, results$ = []; - for (x in object) { - results$.push(x); - } - return results$; -}; -pairsToObj = function(object){ - var i$, len$, x, resultObj$ = {}; - for (i$ = 0, len$ = object.length; i$ < len$; ++i$) { - x = object[i$]; - resultObj$[x[0]] = x[1]; - } - return resultObj$; -}; -objToPairs = function(object){ - var key, value, results$ = []; - for (key in object) { - value = object[key]; - results$.push([key, value]); - } - return results$; -}; -listsToObj = curry$(function(keys, values){ - var i$, len$, i, key, resultObj$ = {}; - for (i$ = 0, len$ = keys.length; i$ < len$; ++i$) { - i = i$; - key = keys[i$]; - resultObj$[key] = values[i]; - } - return resultObj$; -}); -objToLists = function(object){ - var keys, values, key, value; - keys = []; - values = []; - for (key in object) { - value = object[key]; - keys.push(key); - values.push(value); - } - return [keys, values]; -}; -empty = function(object){ - var x; - for (x in object) { - return false; - } - return true; -}; -each = curry$(function(f, object){ - var i$, x; - for (i$ in object) { - x = object[i$]; - f(x); - } - return object; -}); -map = curry$(function(f, object){ - var k, x, resultObj$ = {}; - for (k in object) { - x = object[k]; - resultObj$[k] = f(x); - } - return resultObj$; -}); -compact = function(object){ - var k, x, resultObj$ = {}; - for (k in object) { - x = object[k]; - if (x) { - resultObj$[k] = x; - } - } - return resultObj$; -}; -filter = curry$(function(f, object){ - var k, x, resultObj$ = {}; - for (k in object) { - x = object[k]; - if (f(x)) { - resultObj$[k] = x; - } - } - return resultObj$; -}); -reject = curry$(function(f, object){ - var k, x, resultObj$ = {}; - for (k in object) { - x = object[k]; - if (!f(x)) { - resultObj$[k] = x; - } - } - return resultObj$; -}); -partition = curry$(function(f, object){ - var passed, failed, k, x; - passed = {}; - failed = {}; - for (k in object) { - x = object[k]; - (f(x) ? passed : failed)[k] = x; - } - return [passed, failed]; -}); -find = curry$(function(f, object){ - var i$, x; - for (i$ in object) { - x = object[i$]; - if (f(x)) { - return x; - } - } -}); -module.exports = { - values: values, - keys: keys, - pairsToObj: pairsToObj, - objToPairs: objToPairs, - listsToObj: listsToObj, - objToLists: objToLists, - empty: empty, - each: each, - map: map, - filter: filter, - compact: compact, - reject: reject, - partition: partition, - find: find -}; -function curry$(f, bound){ - var context, - _curry = function(args) { - return f.length > 1 ? function(){ - var params = args ? args.concat() : []; - context = bound ? context || this : this; - return params.push.apply(params, arguments) < - f.length && arguments.length ? - _curry.call(context, params) : f.apply(context, params); - } : f; - }; - return _curry(); -} \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/prelude-ls/lib/Str.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/prelude-ls/lib/Str.js deleted file mode 100644 index eb9a1ac0..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/prelude-ls/lib/Str.js +++ /dev/null @@ -1,92 +0,0 @@ -// Generated by LiveScript 1.4.0 -var split, join, lines, unlines, words, unwords, chars, unchars, reverse, repeat, capitalize, camelize, dasherize; -split = curry$(function(sep, str){ - return str.split(sep); -}); -join = curry$(function(sep, xs){ - return xs.join(sep); -}); -lines = function(str){ - if (!str.length) { - return []; - } - return str.split('\n'); -}; -unlines = function(it){ - return it.join('\n'); -}; -words = function(str){ - if (!str.length) { - return []; - } - return str.split(/[ ]+/); -}; -unwords = function(it){ - return it.join(' '); -}; -chars = function(it){ - return it.split(''); -}; -unchars = function(it){ - return it.join(''); -}; -reverse = function(str){ - return str.split('').reverse().join(''); -}; -repeat = curry$(function(n, str){ - var result, i$; - result = ''; - for (i$ = 0; i$ < n; ++i$) { - result += str; - } - return result; -}); -capitalize = function(str){ - return str.charAt(0).toUpperCase() + str.slice(1); -}; -camelize = function(it){ - return it.replace(/[-_]+(.)?/g, function(arg$, c){ - return (c != null ? c : '').toUpperCase(); - }); -}; -dasherize = function(str){ - return str.replace(/([^-A-Z])([A-Z]+)/g, function(arg$, lower, upper){ - return lower + "-" + (upper.length > 1 - ? upper - : upper.toLowerCase()); - }).replace(/^([A-Z]+)/, function(arg$, upper){ - if (upper.length > 1) { - return upper + "-"; - } else { - return upper.toLowerCase(); - } - }); -}; -module.exports = { - split: split, - join: join, - lines: lines, - unlines: unlines, - words: words, - unwords: unwords, - chars: chars, - unchars: unchars, - reverse: reverse, - repeat: repeat, - capitalize: capitalize, - camelize: camelize, - dasherize: dasherize -}; -function curry$(f, bound){ - var context, - _curry = function(args) { - return f.length > 1 ? function(){ - var params = args ? args.concat() : []; - context = bound ? context || this : this; - return params.push.apply(params, arguments) < - f.length && arguments.length ? - _curry.call(context, params) : f.apply(context, params); - } : f; - }; - return _curry(); -} \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/prelude-ls/lib/index.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/prelude-ls/lib/index.js deleted file mode 100644 index 391cb2ee..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/prelude-ls/lib/index.js +++ /dev/null @@ -1,178 +0,0 @@ -// Generated by LiveScript 1.4.0 -var Func, List, Obj, Str, Num, id, isType, replicate, prelude, toString$ = {}.toString; -Func = require('./Func.js'); -List = require('./List.js'); -Obj = require('./Obj.js'); -Str = require('./Str.js'); -Num = require('./Num.js'); -id = function(x){ - return x; -}; -isType = curry$(function(type, x){ - return toString$.call(x).slice(8, -1) === type; -}); -replicate = curry$(function(n, x){ - var i$, results$ = []; - for (i$ = 0; i$ < n; ++i$) { - results$.push(x); - } - return results$; -}); -Str.empty = List.empty; -Str.slice = List.slice; -Str.take = List.take; -Str.drop = List.drop; -Str.splitAt = List.splitAt; -Str.takeWhile = List.takeWhile; -Str.dropWhile = List.dropWhile; -Str.span = List.span; -Str.breakStr = List.breakList; -prelude = { - Func: Func, - List: List, - Obj: Obj, - Str: Str, - Num: Num, - id: id, - isType: isType, - replicate: replicate -}; -prelude.each = List.each; -prelude.map = List.map; -prelude.filter = List.filter; -prelude.compact = List.compact; -prelude.reject = List.reject; -prelude.partition = List.partition; -prelude.find = List.find; -prelude.head = List.head; -prelude.first = List.first; -prelude.tail = List.tail; -prelude.last = List.last; -prelude.initial = List.initial; -prelude.empty = List.empty; -prelude.reverse = List.reverse; -prelude.difference = List.difference; -prelude.intersection = List.intersection; -prelude.union = List.union; -prelude.countBy = List.countBy; -prelude.groupBy = List.groupBy; -prelude.fold = List.fold; -prelude.foldl = List.foldl; -prelude.fold1 = List.fold1; -prelude.foldl1 = List.foldl1; -prelude.foldr = List.foldr; -prelude.foldr1 = List.foldr1; -prelude.unfoldr = List.unfoldr; -prelude.andList = List.andList; -prelude.orList = List.orList; -prelude.any = List.any; -prelude.all = List.all; -prelude.unique = List.unique; -prelude.uniqueBy = List.uniqueBy; -prelude.sort = List.sort; -prelude.sortWith = List.sortWith; -prelude.sortBy = List.sortBy; -prelude.sum = List.sum; -prelude.product = List.product; -prelude.mean = List.mean; -prelude.average = List.average; -prelude.concat = List.concat; -prelude.concatMap = List.concatMap; -prelude.flatten = List.flatten; -prelude.maximum = List.maximum; -prelude.minimum = List.minimum; -prelude.maximumBy = List.maximumBy; -prelude.minimumBy = List.minimumBy; -prelude.scan = List.scan; -prelude.scanl = List.scanl; -prelude.scan1 = List.scan1; -prelude.scanl1 = List.scanl1; -prelude.scanr = List.scanr; -prelude.scanr1 = List.scanr1; -prelude.slice = List.slice; -prelude.take = List.take; -prelude.drop = List.drop; -prelude.splitAt = List.splitAt; -prelude.takeWhile = List.takeWhile; -prelude.dropWhile = List.dropWhile; -prelude.span = List.span; -prelude.breakList = List.breakList; -prelude.zip = List.zip; -prelude.zipWith = List.zipWith; -prelude.zipAll = List.zipAll; -prelude.zipAllWith = List.zipAllWith; -prelude.at = List.at; -prelude.elemIndex = List.elemIndex; -prelude.elemIndices = List.elemIndices; -prelude.findIndex = List.findIndex; -prelude.findIndices = List.findIndices; -prelude.apply = Func.apply; -prelude.curry = Func.curry; -prelude.flip = Func.flip; -prelude.fix = Func.fix; -prelude.over = Func.over; -prelude.split = Str.split; -prelude.join = Str.join; -prelude.lines = Str.lines; -prelude.unlines = Str.unlines; -prelude.words = Str.words; -prelude.unwords = Str.unwords; -prelude.chars = Str.chars; -prelude.unchars = Str.unchars; -prelude.repeat = Str.repeat; -prelude.capitalize = Str.capitalize; -prelude.camelize = Str.camelize; -prelude.dasherize = Str.dasherize; -prelude.values = Obj.values; -prelude.keys = Obj.keys; -prelude.pairsToObj = Obj.pairsToObj; -prelude.objToPairs = Obj.objToPairs; -prelude.listsToObj = Obj.listsToObj; -prelude.objToLists = Obj.objToLists; -prelude.max = Num.max; -prelude.min = Num.min; -prelude.negate = Num.negate; -prelude.abs = Num.abs; -prelude.signum = Num.signum; -prelude.quot = Num.quot; -prelude.rem = Num.rem; -prelude.div = Num.div; -prelude.mod = Num.mod; -prelude.recip = Num.recip; -prelude.pi = Num.pi; -prelude.tau = Num.tau; -prelude.exp = Num.exp; -prelude.sqrt = Num.sqrt; -prelude.ln = Num.ln; -prelude.pow = Num.pow; -prelude.sin = Num.sin; -prelude.tan = Num.tan; -prelude.cos = Num.cos; -prelude.acos = Num.acos; -prelude.asin = Num.asin; -prelude.atan = Num.atan; -prelude.atan2 = Num.atan2; -prelude.truncate = Num.truncate; -prelude.round = Num.round; -prelude.ceiling = Num.ceiling; -prelude.floor = Num.floor; -prelude.isItNaN = Num.isItNaN; -prelude.even = Num.even; -prelude.odd = Num.odd; -prelude.gcd = Num.gcd; -prelude.lcm = Num.lcm; -prelude.VERSION = '1.1.2'; -module.exports = prelude; -function curry$(f, bound){ - var context, - _curry = function(args) { - return f.length > 1 ? function(){ - var params = args ? args.concat() : []; - context = bound ? context || this : this; - return params.push.apply(params, arguments) < - f.length && arguments.length ? - _curry.call(context, params) : f.apply(context, params); - } : f; - }; - return _curry(); -} \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/prelude-ls/package.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/prelude-ls/package.json deleted file mode 100644 index 5507d3c7..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/prelude-ls/package.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "name": "prelude-ls", - "version": "1.1.2", - "author": "George Zahariev ", - "description": "prelude.ls is a functionally oriented utility library. It is powerful and flexible. Almost all of its functions are curried. It is written in, and is the recommended base library for, LiveScript.", - "keywords": [ - "prelude", - "livescript", - "utility", - "ls", - "coffeescript", - "javascript", - "library", - "functional", - "array", - "list", - "object", - "string" - ], - "main": "lib/", - "files": [ - "lib/", - "README.md", - "LICENSE" - ], - "homepage": "http://preludels.com", - "bugs": "https://github.com/gkz/prelude-ls/issues", - "licenses": [ - { - "type": "MIT", - "url": "https://raw.github.com/gkz/prelude-ls/master/LICENSE" - } - ], - "engines": { - "node": ">= 0.8.0" - }, - "repository": { - "type": "git", - "url": "git://github.com/gkz/prelude-ls.git" - }, - "scripts": { - "test": "make test" - }, - "devDependencies": { - "livescript": "~1.4.0", - "uglify-js": "~2.4.12", - "mocha": "~2.2.4", - "istanbul": "~0.2.4", - "browserify": "~3.24.13", - "sinon": "~1.10.2" - } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/proto3-json-serializer/CHANGELOG.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/proto3-json-serializer/CHANGELOG.md deleted file mode 100644 index ee0d15d7..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/proto3-json-serializer/CHANGELOG.md +++ /dev/null @@ -1,119 +0,0 @@ -# Changelog - -## [1.1.0](https://github.com/googleapis/proto3-json-serializer-nodejs/compare/v1.0.3...v1.1.0) (2022-08-26) - - -### Features - -* option to serialize enum values as numbers ([#60](https://github.com/googleapis/proto3-json-serializer-nodejs/issues/60)) ([456b771](https://github.com/googleapis/proto3-json-serializer-nodejs/commit/456b771d5fef06d914c6e201fd9f17251e55d4d9)) - - -### Bug Fixes - -* remove pip install statements ([#1546](https://github.com/googleapis/proto3-json-serializer-nodejs/issues/1546)) ([#58](https://github.com/googleapis/proto3-json-serializer-nodejs/issues/58)) ([741d070](https://github.com/googleapis/proto3-json-serializer-nodejs/commit/741d0704f49332dd5d66206fcdf2111464fb8759)) - -## [1.0.3](https://github.com/googleapis/proto3-json-serializer-nodejs/compare/v1.0.2...v1.0.3) (2022-07-10) - - -### Bug Fixes - -* **deps:** update dependency protobufjs to v7 ([#56](https://github.com/googleapis/proto3-json-serializer-nodejs/issues/56)) ([038fea5](https://github.com/googleapis/proto3-json-serializer-nodejs/commit/038fea537c8809dc272c2352b832b5301c7b79d2)) - -## [1.0.2](https://github.com/googleapis/proto3-json-serializer-nodejs/compare/v1.0.1...v1.0.2) (2022-06-15) - - -### Bug Fixes - -* **deps:** update dependency google-proto-files to v3 ([#53](https://github.com/googleapis/proto3-json-serializer-nodejs/issues/53)) ([40fd527](https://github.com/googleapis/proto3-json-serializer-nodejs/commit/40fd527109838a21887f7a5058406244acabe938)) - -## [1.0.1](https://github.com/googleapis/proto3-json-serializer-nodejs/compare/v1.0.0...v1.0.1) (2022-06-03) - - -### Bug Fixes - -* **deps:** bump protobuf.js to ^6.11.3 ([#46](https://github.com/googleapis/proto3-json-serializer-nodejs/issues/46)) ([af8a14a](https://github.com/googleapis/proto3-json-serializer-nodejs/commit/af8a14a35c04cbef49bff806b7d906287d1d2c0d)) - -## [1.0.0](https://github.com/googleapis/proto3-json-serializer-nodejs/compare/v0.1.9...v1.0.0) (2022-05-12) - - -### ⚠ BREAKING CHANGES - -* make Node 12 minimum language version (#38) - -### Features - -* make Node 12 minimum language version ([#38](https://github.com/googleapis/proto3-json-serializer-nodejs/issues/38)) ([658d29e](https://github.com/googleapis/proto3-json-serializer-nodejs/commit/658d29e531c2d04d4007e5843aa62d9d8ee0dae8)) - -### [0.1.9](https://github.com/googleapis/proto3-json-serializer-nodejs/compare/v0.1.8...v0.1.9) (2022-05-11) - - -### Bug Fixes - -* do not use Node.js assert ([#37](https://github.com/googleapis/proto3-json-serializer-nodejs/issues/37)) ([dccfeca](https://github.com/googleapis/proto3-json-serializer-nodejs/commit/dccfeca6f3bbeec29d88319f375a734ec48aadf7)) - -### [0.1.8](https://github.com/googleapis/proto3-json-serializer-nodejs/compare/v0.1.7...v0.1.8) (2022-01-21) - - -### Bug Fixes - -* timestamp without millisecond ([#30](https://github.com/googleapis/proto3-json-serializer-nodejs/issues/30)) ([a55d0b6](https://github.com/googleapis/proto3-json-serializer-nodejs/commit/a55d0b6f98f6d1c8b7d971d0a583bbd82ea66983)) - -### [0.1.7](https://github.com/googleapis/proto3-json-serializer-nodejs/compare/v0.1.6...v0.1.7) (2022-01-14) - - -### Bug Fixes - -* keep nano second precision when maps between JSON and proto3 ([#28](https://github.com/googleapis/proto3-json-serializer-nodejs/issues/28)) ([eaa01ce](https://github.com/googleapis/proto3-json-serializer-nodejs/commit/eaa01ce92c4eefa816d1d6f8ef6ed11bd2a6364b)) - -### [0.1.6](https://www.github.com/googleapis/proto3-json-serializer-nodejs/compare/v0.1.5...v0.1.6) (2021-11-15) - - -### Bug Fixes - -* **deps:** protobufjs is a dependency for the types ([#23](https://www.github.com/googleapis/proto3-json-serializer-nodejs/issues/23)) ([06470c1](https://www.github.com/googleapis/proto3-json-serializer-nodejs/commit/06470c1df501439ec3f8bc546cd23d798604f3bd)) - -### [0.1.5](https://www.github.com/googleapis/proto3-json-serializer-nodejs/compare/v0.1.4...v0.1.5) (2021-10-26) - - -### Bug Fixes - -* JSON accept special string for NaN, Infinity ([#19](https://www.github.com/googleapis/proto3-json-serializer-nodejs/issues/19)) ([01a345b](https://www.github.com/googleapis/proto3-json-serializer-nodejs/commit/01a345b7b1d62ee65a8673737975980d274fa22a)) - -### [0.1.4](https://www.github.com/googleapis/proto3-json-serializer-nodejs/compare/v0.1.3...v0.1.4) (2021-09-20) - - -### Bug Fixes - -* do not emit empty lists to JSON ([#15](https://www.github.com/googleapis/proto3-json-serializer-nodejs/issues/15)) ([af9dfd6](https://www.github.com/googleapis/proto3-json-serializer-nodejs/commit/af9dfd65efb84cfb31af0faca805f53b0ffa9874)) - -### [0.1.3](https://www.github.com/googleapis/proto3-json-serializer-nodejs/compare/v0.1.2...v0.1.3) (2021-08-18) - - -### Bug Fixes - -* do not fail for unknown enum values ([#11](https://www.github.com/googleapis/proto3-json-serializer-nodejs/issues/11)) ([ff9f0f1](https://www.github.com/googleapis/proto3-json-serializer-nodejs/commit/ff9f0f1881b1aafacd693b4e24eaee9e56aff79c)) - -### [0.1.2](https://www.github.com/googleapis/proto3-json-serializer-nodejs/compare/v0.1.1...v0.1.2) (2021-08-17) - - -### Bug Fixes - -* use imported protobufjs in toproto3json.ts ([#9](https://www.github.com/googleapis/proto3-json-serializer-nodejs/issues/9)) ([f6c86c7](https://www.github.com/googleapis/proto3-json-serializer-nodejs/commit/f6c86c777d567d8430b09dea3282e52af24d890f)) - -### [0.1.1](https://www.github.com/googleapis/proto3-json-serializer-nodejs/compare/v0.1.0...v0.1.1) (2021-08-04) - - -### Bug Fixes - -* accept and return strings for int64 and uint64 ([#7](https://www.github.com/googleapis/proto3-json-serializer-nodejs/issues/7)) ([35689ec](https://www.github.com/googleapis/proto3-json-serializer-nodejs/commit/35689ecee55dbe6e4cf3327c535514d7fcb8332d)) - -## 0.1.0 (2021-08-03) - - -### ⚠ BREAKING CHANGES - -* proto3 JSON serializer and deserializer (#2) - -### Features - -* proto3 JSON serializer and deserializer ([#2](https://www.github.com/googleapis/proto3-json-serializer-nodejs/issues/2)) ([96255a7](https://www.github.com/googleapis/proto3-json-serializer-nodejs/commit/96255a77c7714f33cae547db9160615d7f80a233)) diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/proto3-json-serializer/LICENSE b/packages/wyatt_notification_bloc/example/scripts/node_modules/proto3-json-serializer/LICENSE deleted file mode 100644 index d6456956..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/proto3-json-serializer/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/proto3-json-serializer/README.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/proto3-json-serializer/README.md deleted file mode 100644 index 21544d0a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/proto3-json-serializer/README.md +++ /dev/null @@ -1,97 +0,0 @@ -# proto3 JSON serializer for TypeScript / JavaScript - -This library implements proto3 JSON serialization and deserialization for -[protobuf.js](https://www.npmjs.com/package/protobufjs) protobuf objects -according to the [spec](https://developers.google.com/protocol-buffers/docs/proto3#json). - -Note that the spec requires special representation of some `google.protobuf.*` types -(`Value`, `Struct`, `Timestamp`, `Duration`, etc.), so you cannot just use `.toObject()` -since the result won't be understood by protobuf in other languages. Hence this module. - -JavaScript: - -```js -const serializer = require('proto3-json-serializer'); -``` - -TypeScript: - -```ts -import * as serializer from 'proto3-json-serializer'; -``` - -## Serialization: protobuf.js object to proto3 JSON - -```js -const root = protobuf.loadSync('test.proto'); -const Type = root.lookupType('test.Message'); -const message = Type.fromObject({...}); - -const serialized = serializer.toProto3JSON(message); -``` - -Serialization works with any object created by calling `.create()`, `.decode()`, or `.fromObject()` -for a loaded protobuf type. It relies on the `$type` field so it will not work with a static object. - -## Deserialization: proto3 JSON to protobuf.js object - -To deserialize an object from proto3 JSON, we must know its type (as returned by `root.lookupType('...')`). -Pass this type as the first parameter to `.fromProto3JSON`: - -```js -const root = protobuf.loadSync('test.proto'); -const Type = root.lookupType('test.Message'); -const json = {...}; - -const deserialized = serializer.fromProto3JSON(Type, json); -``` - -## Complete example -```js -const assert = require('assert'); -const path = require('path'); -const protobuf = require('protobufjs'); -const serializer = require('proto3-json-serializer'); - -// We'll take sample protos from google-proto-files but the code will work with any protos -const protos = require('google-proto-files'); - -// Load some proto file -const rpcProtos = protos.getProtoPath('rpc'); -const root = protobuf.loadSync([ - path.join(rpcProtos, 'status.proto'), - path.join(rpcProtos, 'error_details.proto'), -]); -const Status = root.lookupType('google.rpc.Status'); - -// If you have a protobuf object that follows proto3 JSON syntax -// https://developers.google.com/protocol-buffers/docs/proto3#json -// (this is an example of google.rpc.Status message in JSON) -const json = { - code: 3, - message: 'Test error message', - details: [ - { - '@type': 'google.rpc.BadRequest', - fieldViolations: [ - { - field: 'field', - description: 'must not be null', - }, - ], - }, - ], -}; - -// You can deserialize it into a protobuf.js object: -const deserialized = serializer.fromProto3JSON(Status, json); -console.log(deserialized); - -// And serialize it back -const serialized = serializer.toProto3JSON(deserialized); -assert.deepStrictEqual(serialized, json); -``` - -## Disclaimer - -This is not an officially supported Google project. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/proto3-json-serializer/package.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/proto3-json-serializer/package.json deleted file mode 100644 index 6439cb8a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/proto3-json-serializer/package.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "name": "proto3-json-serializer", - "version": "1.1.0", - "repository": "googleapis/proto3-json-serializer-nodejs", - "description": "Support for proto3 JSON serialiazation/deserialization for protobuf.js", - "main": "build/src/index.js", - "types": "build/src/index.d.ts", - "files": [ - "build/src" - ], - "license": "Apache-2.0", - "keywords": [ - "protobufjs", - "protobuf.js", - "protobuf", - "proto3", - "json", - "serialization", - "deserialization" - ], - "scripts": { - "test": "c8 node_modules/mocha/bin/mocha build/test/unit", - "system-test": "mocha build/test/system", - "lint": "gts lint", - "clean": "gts clean", - "compile": "tsc", - "fix": "gts fix", - "prepare": "npm run compile", - "pretest": "npm run compile", - "posttest": "npm run lint", - "compile-test-protos": "cd test-fixtures/proto && pbjs -t json test.proto > test.json", - "docs": "jsdoc -c .jsdoc.js", - "docs-test": "linkinator docs", - "predocs-test": "npm run docs", - "samples-test": "cd samples/ && npm link ../ && npm test && cd ../", - "prelint": "cd samples && npm link ../ && npm install" - }, - "dependencies": { - "protobufjs": "^7.0.0" - }, - "devDependencies": { - "@types/mocha": "^9.0.0", - "@types/node": "^16.0.0", - "c8": "^7.7.3", - "google-proto-files": "^3.0.0", - "gts": "^3.1.0", - "jsdoc": "^3.6.7", - "jsdoc-fresh": "^2.0.0", - "jsdoc-region-tag": "^2.0.0", - "linkinator": "^4.0.0", - "mocha": "^9.2.2", - "pack-n-play": "^1.0.0-2", - "typescript": "^4.6.4" - }, - "engines": { - "node": ">=12.0.0" - } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/CHANGELOG.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/CHANGELOG.md deleted file mode 100644 index 0e218e6d..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/CHANGELOG.md +++ /dev/null @@ -1,48 +0,0 @@ -# Changelog - -## [1.0.2](https://github.com/protobufjs/protobuf.js/compare/protobufjs-cli-v1.0.1...protobufjs-cli-v1.0.2) (2022-09-09) - - -### Bug Fixes - -* add import long to the generated .d.ts ([#1802](https://github.com/protobufjs/protobuf.js/issues/1802)) ([7c27b5a](https://github.com/protobufjs/protobuf.js/commit/7c27b5ad5d161c9f3711aa053ca704f8e1224e90)) - -## [1.0.1](https://github.com/protobufjs/protobuf.js/compare/protobufjs-cli-v1.0.0...protobufjs-cli-v1.0.1) (2022-08-26) - - -### Bug Fixes - -* **deps:** update dependency glob to v8 ([#1750](https://github.com/protobufjs/protobuf.js/issues/1750)) ([8303a64](https://github.com/protobufjs/protobuf.js/commit/8303a648bc12dcea5aa8e7efa042de39011857f9)) -* remove unused `@types/long` ([#1785](https://github.com/protobufjs/protobuf.js/issues/1785)) ([0f4af83](https://github.com/protobufjs/protobuf.js/commit/0f4af83e4ed3cef1ec035c2833e0b06cab0bd87f)) -* **types:** update type deps ([#1776](https://github.com/protobufjs/protobuf.js/issues/1776)) ([d87978b](https://github.com/protobufjs/protobuf.js/commit/d87978b8eb2a176676c58379a89206b94a6d926a)) - -## [1.0.0](https://github.com/protobufjs/protobuf.js/compare/protobufjs-cli-v0.1.0...protobufjs-cli-v1.0.0) (2022-07-08) - - -### ⚠ BREAKING CHANGES - -* drop support for Node 4, 6, 8, 10 (#1764) -* move command line tool to a new package named protobufjs-cli (#1234) - -### Features - -* add --no-service option for pbjs static target ([#1577](https://github.com/protobufjs/protobuf.js/issues/1577)) ([d01394a](https://github.com/protobufjs/protobuf.js/commit/d01394a1463062824c066b653aad53c449752202)) -* add alt-comment CLI option ([#1692](https://github.com/protobufjs/protobuf.js/issues/1692)) ([7558ef0](https://github.com/protobufjs/protobuf.js/commit/7558ef0f93177978272f68f1710144a26b63e525)) -* add getTypeUrl method to generated code ([#1463](https://github.com/protobufjs/protobuf.js/issues/1463)) ([d13d5d5](https://github.com/protobufjs/protobuf.js/commit/d13d5d5688052e366aa2e9169f50dfca376b32cf)) -* add null-defaults option ([#1611](https://github.com/protobufjs/protobuf.js/issues/1611)) ([6e713ba](https://github.com/protobufjs/protobuf.js/commit/6e713baf54bd987ae52cbf92a4f2742c70201dc0)) -* add support for buffer configuration ([#1372](https://github.com/protobufjs/protobuf.js/issues/1372)) ([101aa1a](https://github.com/protobufjs/protobuf.js/commit/101aa1a4f148516fdc83a74f54a229f06e24a5de)) -* allow message.getTypeUrl provide custom typeUrlPrefix ([#1762](https://github.com/protobufjs/protobuf.js/issues/1762)) ([8aad1dd](https://github.com/protobufjs/protobuf.js/commit/8aad1dd994b1fc1f23bd71adf3a81b7a5616b210)) -* move command line tool to a new package named protobufjs-cli ([#1234](https://github.com/protobufjs/protobuf.js/issues/1234)) ([da34f43](https://github.com/protobufjs/protobuf.js/commit/da34f43ccd51ad97017e139f137521782f5ef119)) -* prepare initial publication of cli ([#1752](https://github.com/protobufjs/protobuf.js/issues/1752)) ([64811d5](https://github.com/protobufjs/protobuf.js/commit/64811d5878c31e4a86a39da5fec6aea35da22fcd)) -* proto3 optional support ([#1584](https://github.com/protobufjs/protobuf.js/issues/1584)) ([6c4d307](https://github.com/protobufjs/protobuf.js/commit/6c4d30716a9a756dcdc21d64f9c9d069315fc5b1)) -* update dependencies / general cleanup ([#1356](https://github.com/protobufjs/protobuf.js/issues/1356)) ([42f49b4](https://github.com/protobufjs/protobuf.js/commit/42f49b43f692c24c2bc1ae081b4d1ad9fa173cd7)) - - -### Bug Fixes - -* **deps:** patch minimatch vulnerability ([#1704](https://github.com/protobufjs/protobuf.js/issues/1704)) ([bac61b8](https://github.com/protobufjs/protobuf.js/commit/bac61b8c2757804bbb9c5fa0f8bc6a7bcf0bb374)) -* drop support for Node 4, 6, 8, 10 ([#1764](https://github.com/protobufjs/protobuf.js/issues/1764)) ([50370dd](https://github.com/protobufjs/protobuf.js/commit/50370dd7747a0986e83ddbe51c54b97033af5ead)) -* es6 export enum ([#1446](https://github.com/protobufjs/protobuf.js/issues/1446)) ([9f33784](https://github.com/protobufjs/protobuf.js/commit/9f33784350b1efc2e774bbfc087cbd2c47828748)) -* fromObject should not initialize oneof members ([#1597](https://github.com/protobufjs/protobuf.js/issues/1597)) ([90afe44](https://github.com/protobufjs/protobuf.js/commit/90afe4412de8070b0c0681e5905a6e0213072a85)) -* proper relative path to protobufjs in cli ([#1753](https://github.com/protobufjs/protobuf.js/issues/1753)) ([a1d6029](https://github.com/protobufjs/protobuf.js/commit/a1d60292ecb22fcf89c493c562ae07ab10ef49c9)) -* typo in pbjs help text ([#1552](https://github.com/protobufjs/protobuf.js/issues/1552)) ([7f46dbe](https://github.com/protobufjs/protobuf.js/commit/7f46dbeb538a6277035a896e1ab5e1a070e28681)) diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/LICENSE b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/LICENSE deleted file mode 100644 index e5f7a5c9..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/LICENSE +++ /dev/null @@ -1,33 +0,0 @@ -Copyright (c) 2016, Daniel Wirtz All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - -* Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -* Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -* Neither the name of its author, nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - ---- - -Code generated by the command line utilities is owned by the owner -of the input file used when generating it. This code is not -standalone and requires a support library to be linked with it. This -support library is itself covered by the above license. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/README.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/README.md deleted file mode 100644 index e7f18900..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/README.md +++ /dev/null @@ -1,173 +0,0 @@ -protobufjs-cli -============== -[![npm](https://img.shields.io/npm/v/protobufjs-cli.svg)](https://www.npmjs.com/package/protobufjs-cli) - -Command line interface (CLI) for [protobuf.js](https://github.com/dcodeIO/protobuf.js). - -This can be used to translate between file formats and to generate static code as well as TypeScript definitions. - -* [pbjs for JavaScript](#pbjs-for-javascript) -* [pbts for TypeScript](#pbts-for-typescript) -* [Reflection vs. static code](#reflection-vs-static-code) -* [Command line API](#command-line-api)
    - -### pbjs for JavaScript - -``` -Translates between file formats and generates static code. - - -t, --target Specifies the target format. Also accepts a path to require a custom target. - - json JSON representation - json-module JSON representation as a module - proto2 Protocol Buffers, Version 2 - proto3 Protocol Buffers, Version 3 - static Static code without reflection (non-functional on its own) - static-module Static code without reflection as a module - - -p, --path Adds a directory to the include path. - - -o, --out Saves to a file instead of writing to stdout. - - --sparse Exports only those types referenced from a main file (experimental). - - Module targets only: - - -w, --wrap Specifies the wrapper to use. Also accepts a path to require a custom wrapper. - - default Default wrapper supporting both CommonJS and AMD - commonjs CommonJS wrapper - amd AMD wrapper - es6 ES6 wrapper (implies --es6) - closure A closure adding to protobuf.roots where protobuf is a global - - -r, --root Specifies an alternative protobuf.roots name. - - -l, --lint Linter configuration. Defaults to protobuf.js-compatible rules: - - eslint-disable block-scoped-var, no-redeclare, no-control-regex, no-prototype-builtins - - --es6 Enables ES6 syntax (const/let instead of var) - - Proto sources only: - - --keep-case Keeps field casing instead of converting to camel case. - - Static targets only: - - --no-create Does not generate create functions used for reflection compatibility. - --no-encode Does not generate encode functions. - --no-decode Does not generate decode functions. - --no-verify Does not generate verify functions. - --no-convert Does not generate convert functions like from/toObject - --no-delimited Does not generate delimited encode/decode functions. - --no-beautify Does not beautify generated code. - --no-comments Does not output any JSDoc comments. - --no-service Does not output service classes. - - --force-long Enforces the use of 'Long' for s-/u-/int64 and s-/fixed64 fields. - --force-number Enforces the use of 'number' for s-/u-/int64 and s-/fixed64 fields. - --force-message Enforces the use of message instances instead of plain objects. - -usage: pbjs [options] file1.proto file2.json ... (or pipe) other | pbjs [options] - -``` - -For production environments it is recommended to bundle all your .proto files to a single .json file, which minimizes the number of network requests and avoids any parser overhead (hint: works with just the **light** library): - -``` -$> pbjs -t json file1.proto file2.proto > bundle.json -``` - -Now, either include this file in your final bundle: - -```js -var root = protobuf.Root.fromJSON(require("./bundle.json")); -``` - -or load it the usual way: - -```js -protobuf.load("bundle.json", function(err, root) { - ... -}); -``` - -Generated static code, on the other hand, works with just the **minimal** library. For example - -``` -$> pbjs -t static-module -w commonjs -o compiled.js file1.proto file2.proto -``` - -will generate static code for definitions within `file1.proto` and `file2.proto` to a CommonJS module `compiled.js`. - -**ProTip!** Documenting your .proto files with `/** ... */`-blocks or (trailing) `/// ...` lines translates to generated static code. - - -### pbts for TypeScript - -``` -Generates TypeScript definitions from annotated JavaScript files. - - -o, --out Saves to a file instead of writing to stdout. - - -g, --global Name of the global object in browser environments, if any. - - --no-comments Does not output any JSDoc comments. - - Internal flags: - - -n, --name Wraps everything in a module of the specified name. - - -m, --main Whether building the main library without any imports. - -usage: pbts [options] file1.js file2.js ... (or) other | pbts [options] - -``` - -Picking up on the example above, the following not only generates static code to a CommonJS module `compiled.js` but also its respective TypeScript definitions to `compiled.d.ts`: - -``` -$> pbjs -t static-module -w commonjs -o compiled.js file1.proto file2.proto -$> pbts -o compiled.d.ts compiled.js -``` - -Additionally, TypeScript definitions of static modules are compatible with their reflection-based counterparts (i.e. as exported by JSON modules), as long as the following conditions are met: - -1. Instead of using `new SomeMessage(...)`, always use `SomeMessage.create(...)` because reflection objects do not provide a constructor. -2. Types, services and enums must start with an uppercase letter to become available as properties of the reflected types as well (i.e. to be able to use `MyMessage.MyEnum` instead of `root.lookup("MyMessage.MyEnum")`). - -For example, the following generates a JSON module `bundle.js` and a `bundle.d.ts`, but no static code: - -``` -$> pbjs -t json-module -w commonjs -o bundle.js file1.proto file2.proto -$> pbjs -t static-module file1.proto file2.proto | pbts -o bundle.d.ts - -``` - -### Reflection vs. static code - -While using .proto files directly requires the full library respectively pure reflection/JSON the light library, pretty much all code but the relatively short descriptors is shared. - -Static code, on the other hand, requires just the minimal library, but generates additional source code without any reflection features. This also implies that there is a break-even point where statically generated code becomes larger than descriptor-based code once the amount of code generated exceeds the size of the full respectively light library. - -There is no significant difference performance-wise as the code generated statically is pretty much the same as generated at runtime and both are largely interchangeable as seen in the previous section. - -| Source | Library | Advantages | Tradeoffs -|--------|---------|------------|----------- -| .proto | full | Easily editable
    Interoperability with other libraries
    No compile step | Some parsing and possibly network overhead -| JSON | light | Easily editable
    No parsing overhead
    Single bundle (no network overhead) | protobuf.js specific
    Has a compile step -| static | minimal | Works where `eval` access is restricted
    Fully documented
    Small footprint for small protos | Can be hard to edit
    No reflection
    Has a compile step - -### Command line API - -Both utilities can be used programmatically by providing command line arguments and a callback to their respective `main` functions: - -```js -var pbjs = require("protobufjs-cli/pbjs"); // or require("protobufjs-cli").pbjs / .pbts - -pbjs.main([ "--target", "json-module", "path/to/myproto.proto" ], function(err, output) { - if (err) - throw err; - // do something with output -}); -``` - -**License:** [BSD 3-Clause License](https://opensource.org/licenses/BSD-3-Clause) diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/bin/pbjs b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/bin/pbjs deleted file mode 100755 index 9bfedb31..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/bin/pbjs +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/env node -var path = require("path"), - cli = require(path.join(__dirname, "..", "pbjs.js")); -var ret = cli.main(process.argv.slice(2)); -if (typeof ret === 'number') - process.exit(ret); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/bin/pbts b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/bin/pbts deleted file mode 100755 index 48d392c3..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/bin/pbts +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/env node -var path = require("path"), - cli = require(path.join(__dirname, "..", "pbts.js")); -var ret = cli.main(process.argv.slice(2)); -if (typeof ret === 'number') - process.exit(ret); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/index.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/index.d.ts deleted file mode 100644 index 09c20269..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import * as pbjs from "./pbjs.js"; -import * as pbts from "./pbts.js"; -export { pbjs, pbts }; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/index.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/index.js deleted file mode 100644 index c565aa6f..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/index.js +++ /dev/null @@ -1,3 +0,0 @@ -"use strict"; -exports.pbjs = require("./pbjs"); -exports.pbts = require("./pbts"); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/lib/tsd-jsdoc.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/lib/tsd-jsdoc.json deleted file mode 100644 index b5fe1d90..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/lib/tsd-jsdoc.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "tags": { - "allowUnknownTags": false - }, - "plugins": [ - "./tsd-jsdoc/plugin" - ], - "opts": { - "encoding" : "utf8", - "recurse" : true, - "lenient" : true, - "template" : "./tsd-jsdoc", - - "private" : false, - "comments" : true, - "destination" : false - } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/lib/tsd-jsdoc/LICENSE b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/lib/tsd-jsdoc/LICENSE deleted file mode 100644 index e5aebc9f..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/lib/tsd-jsdoc/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License - -Copyright (c) 2016 Chad Engler - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/lib/tsd-jsdoc/README.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/lib/tsd-jsdoc/README.md deleted file mode 100644 index beed748f..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/lib/tsd-jsdoc/README.md +++ /dev/null @@ -1,23 +0,0 @@ -protobuf.js fork of tsd-jsdoc -============================= - -This is a modified version of [tsd-jsdoc](https://github.com/englercj/tsd-jsdoc) v1.0.1 for use with protobuf.js, parked here so we can process issues and pull requests. The ultimate goal is to switch back to the a recent version of tsd-jsdoc once it meets our needs. - -Options -------- - -* **module: `string`**
    - Wraps everything in a module of the specified name. - -* **private: `boolean`**
    - Includes private members when set to `true`. - -* **comments: `boolean`**
    - Skips comments when explicitly set to `false`. - -* **destination: `string|boolean`**
    - Saves to the specified destination file or to console when set to `false`. - -Setting options on the command line ------------------------------------ -Providing `-q, --query ` on the command line will set respectively override existing options. Example: `-q module=protobufjs` diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/lib/tsd-jsdoc/plugin.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/lib/tsd-jsdoc/plugin.js deleted file mode 100644 index 1bf4f42f..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/lib/tsd-jsdoc/plugin.js +++ /dev/null @@ -1,21 +0,0 @@ -"use strict"; -exports.defineTags = function(dictionary) { - - dictionary.defineTag("template", { - mustHaveValue: true, - canHaveType: false, - canHaveName: false, - onTagged: function(doclet, tag) { - (doclet.templates || (doclet.templates = [])).push(tag.text); - } - }); - - dictionary.defineTag("tstype", { - mustHaveValue: true, - canHaveType: false, - canHaveName: false, - onTagged: function(doclet, tag) { - doclet.tsType = tag.text; - } - }); -}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/lib/tsd-jsdoc/publish.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/lib/tsd-jsdoc/publish.js deleted file mode 100644 index 3846a992..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/lib/tsd-jsdoc/publish.js +++ /dev/null @@ -1,705 +0,0 @@ -"use strict"; - -var fs = require("fs"); - -// output stream -var out = null; - -// documentation data -var data = null; - -// already handled objects, by name -var seen = {}; - -// indentation level -var indent = 0; - -// whether indent has been written for the current line yet -var indentWritten = false; - -// provided options -var options = {}; - -// queued interfaces -var queuedInterfaces = []; - -// whether writing the first line -var firstLine = true; - -// JSDoc hook -exports.publish = function publish(taffy, opts) { - options = opts || {}; - - // query overrides options - if (options.query) - Object.keys(options.query).forEach(function(key) { - if (key !== "query") - switch (options[key] = options.query[key]) { - case "true": - options[key] = true; - break; - case "false": - options[key] = false; - break; - case "null": - options[key] = null; - break; - } - }); - - // remove undocumented - taffy({ undocumented: true }).remove(); - taffy({ ignore: true }).remove(); - taffy({ inherited: true }).remove(); - - // remove private - if (!options.private) - taffy({ access: "private" }).remove(); - - // setup output - out = options.destination - ? fs.createWriteStream(options.destination) - : process.stdout; - - try { - // setup environment - data = taffy().get(); - indent = 0; - indentWritten = false; - firstLine = true; - - // wrap everything in a module if configured - if (options.module) { - writeln("export = ", options.module, ";"); - writeln(); - writeln("declare namespace ", options.module, " {"); - writeln(); - ++indent; - } - - // handle all - getChildrenOf(undefined).forEach(function(child) { - handleElement(child, null); - }); - - // process queued - while (queuedInterfaces.length) { - var element = queuedInterfaces.shift(); - begin(element); - writeInterface(element); - writeln(";"); - } - - // end wrap - if (options.module) { - --indent; - writeln("}"); - } - - // close file output - if (out !== process.stdout) - out.end(); - - } finally { - // gc environment objects - out = data = null; - seen = options = {}; - queuedInterfaces = []; - } -}; - -// -// Utility -// - -// writes one or multiple strings -function write() { - var s = Array.prototype.slice.call(arguments).join(""); - if (!indentWritten) { - for (var i = 0; i < indent; ++i) - s = " " + s; - indentWritten = true; - } - out.write(s); - firstLine = false; -} - -// writes zero or multiple strings, followed by a new line -function writeln() { - var s = Array.prototype.slice.call(arguments).join(""); - if (s.length) - write(s, "\n"); - else if (!firstLine) - out.write("\n"); - indentWritten = false; -} - -var keepTags = [ - "param", - "returns", - "throws", - "see" -]; - -// parses a comment into text and tags -function parseComment(comment) { - var lines = comment.replace(/^ *\/\*\* *|^ *\*\/| *\*\/ *$|^ *\* */mg, "").trim().split(/\r?\n|\r/g); // property.description has just "\r" ?! - var desc; - var text = []; - var tags = null; - for (var i = 0; i < lines.length; ++i) { - var match = /^@(\w+)\b/.exec(lines[i]); - if (match) { - if (!tags) { - tags = []; - desc = text; - } - text = []; - tags.push({ name: match[1], text: text }); - lines[i] = lines[i].substring(match[1].length + 1).trim(); - } - if (lines[i].length || text.length) - text.push(lines[i]); - } - return { - text: desc || text, - tags: tags || [] - }; -} - -// writes a comment -function writeComment(comment, otherwiseNewline) { - if (!comment || options.comments === false) { - if (otherwiseNewline) - writeln(); - return; - } - if (typeof comment !== "object") - comment = parseComment(comment); - comment.tags = comment.tags.filter(function(tag) { - return keepTags.indexOf(tag.name) > -1 && (tag.name !== "returns" || tag.text[0] !== "{undefined}"); - }); - writeln(); - if (!comment.tags.length && comment.text.length < 2) { - writeln("/** " + comment.text[0] + " */"); - return; - } - writeln("/**"); - comment.text.forEach(function(line) { - if (line.length) - writeln(" * ", line); - else - writeln(" *"); - }); - comment.tags.forEach(function(tag) { - var started = false; - if (tag.text.length) { - tag.text.forEach(function(line, i) { - if (i > 0) - write(" * "); - else if (tag.name !== "throws") - line = line.replace(/^\{[^\s]*} ?/, ""); - if (!line.length) - return; - if (!started) { - write(" * @", tag.name, " "); - started = true; - } - writeln(line); - }); - } - }); - writeln(" */"); -} - -// recursively replaces all occurencies of re's match -function replaceRecursive(name, re, fn) { - var found; - - function replacer() { - found = true; - return fn.apply(null, arguments); - } - - do { - found = false; - name = name.replace(re, replacer); - } while (found); - return name; -} - -// tests if an element is considered to be a class or class-like -function isClassLike(element) { - return isClass(element) || isInterface(element); -} - -// tests if an element is considered to be a class -function isClass(element) { - return element && element.kind === "class"; -} - -// tests if an element is considered to be an interface -function isInterface(element) { - return element && (element.kind === "interface" || element.kind === "mixin"); -} - -// tests if an element is considered to be a namespace -function isNamespace(element) { - return element && (element.kind === "namespace" || element.kind === "module"); -} - -// gets all children of the specified parent -function getChildrenOf(parent) { - var memberof = parent ? parent.longname : undefined; - return data.filter(function(element) { - return element.memberof === memberof; - }); -} - -// gets the literal type of an element -function getTypeOf(element) { - if (element.tsType) - return element.tsType.replace(/\r?\n|\r/g, "\n"); - var name = "any"; - var type = element.type; - if (type && type.names && type.names.length) { - if (type.names.length === 1) - name = element.type.names[0].trim(); - else - name = "(" + element.type.names.join("|") + ")"; - } else - return name; - - // Replace catchalls with any - name = name.replace(/\*|\bmixed\b/g, "any"); - - // Ensure upper case Object for map expressions below - name = name.replace(/\bobject\b/g, "Object"); - - // Correct Something. to Something - name = replaceRecursive(name, /\b(?!Object|Array)([\w$]+)\.<([^>]*)>/gi, function($0, $1, $2) { - return $1 + "<" + $2 + ">"; - }); - - // Replace Array. with string[] - name = replaceRecursive(name, /\bArray\.?<([^>]*)>/gi, function($0, $1) { - return $1 + "[]"; - }); - - // Replace Object. with { [k: string]: number } - name = replaceRecursive(name, /\bObject\.?<([^,]*), *([^>]*)>/gi, function($0, $1, $2) { - return "{ [k: " + $1 + "]: " + $2 + " }"; - }); - - // Replace functions (there are no signatures) with Function - name = name.replace(/\bfunction(?:\(\))?\b/g, "Function"); - - // Convert plain Object back to just object - name = name.replace(/\b(Object\b(?!\.))/g, function($0, $1) { - return $1.toLowerCase(); - }); - - return name; -} - -// begins writing the definition of the specified element -function begin(element, is_interface) { - if (!seen[element.longname]) { - if (isClass(element)) { - var comment = parseComment(element.comment); - var classdesc = comment.tags.find(function(tag) { return tag.name === "classdesc"; }); - if (classdesc) { - comment.text = classdesc.text; - comment.tags = []; - } - writeComment(comment, true); - } else - writeComment(element.comment, is_interface || isClassLike(element) || isNamespace(element) || element.isEnum || element.scope === "global"); - seen[element.longname] = element; - } else - writeln(); - // ????: something changed in JSDoc 3.6.0? so that @exports + @enum does - // no longer yield a 'global' scope, but is some sort of unscoped module - // element now. The additional condition added below works around this. - if ((element.scope === "global" || element.isEnum && element.scope === undefined) && !options.module) - write("export "); -} - -// writes the function signature describing element -function writeFunctionSignature(element, isConstructor, isTypeDef) { - write("("); - - var params = {}; - - // this type - if (element.this) - params["this"] = { - type: element.this.replace(/^{|}$/g, ""), - optional: false - }; - - // parameter types - if (element.params) - element.params.forEach(function(param) { - var path = param.name.split(/\./g); - if (path.length === 1) - params[param.name] = { - type: getTypeOf(param), - variable: param.variable === true, - optional: param.optional === true, - defaultValue: param.defaultvalue // Not used yet (TODO) - }; - else // Property syntax (TODO) - params[path[0]].type = "{ [k: string]: any }"; - }); - - var paramNames = Object.keys(params); - paramNames.forEach(function(name, i) { - var param = params[name]; - var type = param.type; - if (param.variable) { - name = "..." + name; - type = param.type.charAt(0) === "(" ? "any[]" : param.type + "[]"; - } - write(name, !param.variable && param.optional ? "?: " : ": ", type); - if (i < paramNames.length - 1) - write(", "); - }); - - write(")"); - - // return type - if (!isConstructor) { - write(isTypeDef ? " => " : ": "); - var typeName; - if (element.returns && element.returns.length && (typeName = getTypeOf(element.returns[0])) !== "undefined") - write(typeName); - else - write("void"); - } -} - -// writes (a typedef as) an interface -function writeInterface(element) { - write("interface ", element.name); - writeInterfaceBody(element); - writeln(); -} - -function writeInterfaceBody(element) { - writeln("{"); - ++indent; - if (element.tsType) - writeln(element.tsType.replace(/\r?\n|\r/g, "\n")); - else if (element.properties && element.properties.length) - element.properties.forEach(writeProperty); - --indent; - write("}"); -} - -function writeProperty(property, declare) { - writeComment(property.description); - if (declare) - write("let "); - write(property.name); - if (property.optional) - write("?"); - writeln(": ", getTypeOf(property), ";"); -} - -// -// Handlers -// - -// handles a single element of any understood type -function handleElement(element, parent) { - if (element.scope === "inner") - return false; - - if (element.optional !== true && element.type && element.type.names && element.type.names.length) { - for (var i = 0; i < element.type.names.length; i++) { - if (element.type.names[i].toLowerCase() === "undefined") { - // This element is actually optional. Set optional to true and - // remove the 'undefined' type - element.optional = true; - element.type.names.splice(i, 1); - i--; - } - } - } - - if (seen[element.longname]) - return true; - if (isClassLike(element)) - handleClass(element, parent); - else switch (element.kind) { - case "module": - if (element.isEnum) { - handleEnum(element, parent); - break; - } - // eslint-disable-line no-fallthrough - case "namespace": - handleNamespace(element, parent); - break; - case "constant": - case "member": - handleMember(element, parent); - break; - case "function": - handleFunction(element, parent); - break; - case "typedef": - handleTypeDef(element, parent); - break; - case "package": - break; - } - seen[element.longname] = element; - return true; -} - -// handles (just) a namespace -function handleNamespace(element/*, parent*/) { - var children = getChildrenOf(element); - if (!children.length) - return; - var first = true; - if (element.properties) - element.properties.forEach(function(property) { - if (!/^[$\w]+$/.test(property.name)) // incompatible in namespace - return; - if (first) { - begin(element); - writeln("namespace ", element.name, " {"); - ++indent; - first = false; - } - writeProperty(property, true); - }); - children.forEach(function(child) { - if (child.scope === "inner" || seen[child.longname]) - return; - if (first) { - begin(element); - writeln("namespace ", element.name, " {"); - ++indent; - first = false; - } - handleElement(child, element); - }); - if (!first) { - --indent; - writeln("}"); - } -} - -// a filter function to remove any module references -function notAModuleReference(ref) { - return ref.indexOf("module:") === -1; -} - -// handles a class or class-like -function handleClass(element, parent) { - var is_interface = isInterface(element); - begin(element, is_interface); - if (is_interface) - write("interface "); - else { - if (element.virtual) - write("abstract "); - write("class "); - } - write(element.name); - if (element.templates && element.templates.length) - write("<", element.templates.join(", "), ">"); - write(" "); - - // extended classes - if (element.augments) { - var augments = element.augments.filter(notAModuleReference); - if (augments.length) - write("extends ", augments[0], " "); - } - - // implemented interfaces - var impls = []; - if (element.implements) - Array.prototype.push.apply(impls, element.implements); - if (element.mixes) - Array.prototype.push.apply(impls, element.mixes); - impls = impls.filter(notAModuleReference); - if (impls.length) - write("implements ", impls.join(", "), " "); - - writeln("{"); - ++indent; - - if (element.tsType) - writeln(element.tsType.replace(/\r?\n|\r/g, "\n")); - - // constructor - if (!is_interface && !element.virtual) - handleFunction(element, parent, true); - - // properties - if (is_interface && element.properties) - element.properties.forEach(function(property) { - writeProperty(property); - }); - - // class-compatible members - var incompatible = []; - getChildrenOf(element).forEach(function(child) { - if (isClassLike(child) || child.kind === "module" || child.kind === "typedef" || child.isEnum) { - incompatible.push(child); - return; - } - handleElement(child, element); - }); - - --indent; - writeln("}"); - - // class-incompatible members - if (incompatible.length) { - writeln(); - if (element.scope === "global" && !options.module) - write("export "); - writeln("namespace ", element.name, " {"); - ++indent; - incompatible.forEach(function(child) { - handleElement(child, element); - }); - --indent; - writeln("}"); - } -} - -// handles an enum -function handleEnum(element) { - begin(element); - - var stringEnum = false; - element.properties.forEach(function(property) { - if (isNaN(property.defaultvalue)) { - stringEnum = true; - } - }); - if (stringEnum) { - writeln("type ", element.name, " ="); - ++indent; - element.properties.forEach(function(property, i) { - write(i === 0 ? "" : "| ", JSON.stringify(property.defaultvalue)); - }); - --indent; - writeln(";"); - } else { - writeln("enum ", element.name, " {"); - ++indent; - element.properties.forEach(function(property, i) { - write(property.name); - if (property.defaultvalue !== undefined) - write(" = ", JSON.stringify(property.defaultvalue)); - if (i < element.properties.length - 1) - writeln(","); - else - writeln(); - }); - --indent; - writeln("}"); - } -} - -// handles a namespace or class member -function handleMember(element, parent) { - if (element.isEnum) { - handleEnum(element); - return; - } - begin(element); - - var inClass = isClassLike(parent); - if (inClass) { - write(element.access || "public", " "); - if (element.scope === "static") - write("static "); - if (element.readonly) - write("readonly "); - } else - write(element.kind === "constant" ? "const " : "let "); - - write(element.name); - if (element.optional) - write("?"); - write(": "); - - if (element.type && element.type.names && /^Object\b/i.test(element.type.names[0]) && element.properties) { - writeln("{"); - ++indent; - element.properties.forEach(function(property, i) { - writeln(JSON.stringify(property.name), ": ", getTypeOf(property), i < element.properties.length - 1 ? "," : ""); - }); - --indent; - writeln("};"); - } else - writeln(getTypeOf(element), ";"); -} - -// handles a function or method -function handleFunction(element, parent, isConstructor) { - var insideClass = true; - if (isConstructor) { - writeComment(element.comment); - write("constructor"); - } else { - begin(element); - insideClass = isClassLike(parent); - if (insideClass) { - write(element.access || "public", " "); - if (element.scope === "static") - write("static "); - } else - write("function "); - write(element.name); - if (element.templates && element.templates.length) - write("<", element.templates.join(", "), ">"); - } - writeFunctionSignature(element, isConstructor, false); - writeln(";"); - if (!insideClass) - handleNamespace(element); -} - -// handles a type definition (not a real type) -function handleTypeDef(element, parent) { - if (isInterface(element)) { - if (isClassLike(parent)) - queuedInterfaces.push(element); - else { - begin(element); - writeInterface(element); - } - } else { - writeComment(element.comment, true); - write("type ", element.name); - if (element.templates && element.templates.length) - write("<", element.templates.join(", "), ">"); - write(" = "); - if (element.tsType) - write(element.tsType.replace(/\r?\n|\r/g, "\n")); - else { - var type = getTypeOf(element); - if (element.type && element.type.names.length === 1 && element.type.names[0] === "function") - writeFunctionSignature(element, false, true); - else if (type === "object") { - if (element.properties && element.properties.length) - writeInterfaceBody(element); - else - write("{}"); - } else - write(type); - } - writeln(";"); - } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/.bin/semver b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/.bin/semver deleted file mode 120000 index 5aaadf42..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/.bin/semver +++ /dev/null @@ -1 +0,0 @@ -../semver/bin/semver.js \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/LICENSE b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/LICENSE deleted file mode 100644 index 19129e31..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/LICENSE +++ /dev/null @@ -1,15 +0,0 @@ -The ISC License - -Copyright (c) Isaac Z. Schlueter and Contributors - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR -IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/README.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/README.md deleted file mode 100644 index df54e7a0..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/README.md +++ /dev/null @@ -1,568 +0,0 @@ -semver(1) -- The semantic versioner for npm -=========================================== - -## Install - -```bash -npm install semver -```` - -## Usage - -As a node module: - -```js -const semver = require('semver') - -semver.valid('1.2.3') // '1.2.3' -semver.valid('a.b.c') // null -semver.clean(' =v1.2.3 ') // '1.2.3' -semver.satisfies('1.2.3', '1.x || >=2.5.0 || 5.0.0 - 7.2.3') // true -semver.gt('1.2.3', '9.8.7') // false -semver.lt('1.2.3', '9.8.7') // true -semver.minVersion('>=1.0.0') // '1.0.0' -semver.valid(semver.coerce('v2')) // '2.0.0' -semver.valid(semver.coerce('42.6.7.9.3-alpha')) // '42.6.7' -``` - -You can also just load the module for the function that you care about, if -you'd like to minimize your footprint. - -```js -// load the whole API at once in a single object -const semver = require('semver') - -// or just load the bits you need -// all of them listed here, just pick and choose what you want - -// classes -const SemVer = require('semver/classes/semver') -const Comparator = require('semver/classes/comparator') -const Range = require('semver/classes/range') - -// functions for working with versions -const semverParse = require('semver/functions/parse') -const semverValid = require('semver/functions/valid') -const semverClean = require('semver/functions/clean') -const semverInc = require('semver/functions/inc') -const semverDiff = require('semver/functions/diff') -const semverMajor = require('semver/functions/major') -const semverMinor = require('semver/functions/minor') -const semverPatch = require('semver/functions/patch') -const semverPrerelease = require('semver/functions/prerelease') -const semverCompare = require('semver/functions/compare') -const semverRcompare = require('semver/functions/rcompare') -const semverCompareLoose = require('semver/functions/compare-loose') -const semverCompareBuild = require('semver/functions/compare-build') -const semverSort = require('semver/functions/sort') -const semverRsort = require('semver/functions/rsort') - -// low-level comparators between versions -const semverGt = require('semver/functions/gt') -const semverLt = require('semver/functions/lt') -const semverEq = require('semver/functions/eq') -const semverNeq = require('semver/functions/neq') -const semverGte = require('semver/functions/gte') -const semverLte = require('semver/functions/lte') -const semverCmp = require('semver/functions/cmp') -const semverCoerce = require('semver/functions/coerce') - -// working with ranges -const semverSatisfies = require('semver/functions/satisfies') -const semverMaxSatisfying = require('semver/ranges/max-satisfying') -const semverMinSatisfying = require('semver/ranges/min-satisfying') -const semverToComparators = require('semver/ranges/to-comparators') -const semverMinVersion = require('semver/ranges/min-version') -const semverValidRange = require('semver/ranges/valid') -const semverOutside = require('semver/ranges/outside') -const semverGtr = require('semver/ranges/gtr') -const semverLtr = require('semver/ranges/ltr') -const semverIntersects = require('semver/ranges/intersects') -const simplifyRange = require('semver/ranges/simplify') -const rangeSubset = require('semver/ranges/subset') -``` - -As a command-line utility: - -``` -$ semver -h - -A JavaScript implementation of the https://semver.org/ specification -Copyright Isaac Z. Schlueter - -Usage: semver [options] [ [...]] -Prints valid versions sorted by SemVer precedence - -Options: --r --range - Print versions that match the specified range. - --i --increment [] - Increment a version by the specified level. Level can - be one of: major, minor, patch, premajor, preminor, - prepatch, or prerelease. Default level is 'patch'. - Only one version may be specified. - ---preid - Identifier to be used to prefix premajor, preminor, - prepatch or prerelease version increments. - --l --loose - Interpret versions and ranges loosely - --p --include-prerelease - Always include prerelease versions in range matching - --c --coerce - Coerce a string into SemVer if possible - (does not imply --loose) - ---rtl - Coerce version strings right to left - ---ltr - Coerce version strings left to right (default) - -Program exits successfully if any valid version satisfies -all supplied ranges, and prints all satisfying versions. - -If no satisfying versions are found, then exits failure. - -Versions are printed in ascending order, so supplying -multiple versions to the utility will just sort them. -``` - -## Versions - -A "version" is described by the `v2.0.0` specification found at -. - -A leading `"="` or `"v"` character is stripped off and ignored. - -## Ranges - -A `version range` is a set of `comparators` which specify versions -that satisfy the range. - -A `comparator` is composed of an `operator` and a `version`. The set -of primitive `operators` is: - -* `<` Less than -* `<=` Less than or equal to -* `>` Greater than -* `>=` Greater than or equal to -* `=` Equal. If no operator is specified, then equality is assumed, - so this operator is optional, but MAY be included. - -For example, the comparator `>=1.2.7` would match the versions -`1.2.7`, `1.2.8`, `2.5.3`, and `1.3.9`, but not the versions `1.2.6` -or `1.1.0`. - -Comparators can be joined by whitespace to form a `comparator set`, -which is satisfied by the **intersection** of all of the comparators -it includes. - -A range is composed of one or more comparator sets, joined by `||`. A -version matches a range if and only if every comparator in at least -one of the `||`-separated comparator sets is satisfied by the version. - -For example, the range `>=1.2.7 <1.3.0` would match the versions -`1.2.7`, `1.2.8`, and `1.2.99`, but not the versions `1.2.6`, `1.3.0`, -or `1.1.0`. - -The range `1.2.7 || >=1.2.9 <2.0.0` would match the versions `1.2.7`, -`1.2.9`, and `1.4.6`, but not the versions `1.2.8` or `2.0.0`. - -### Prerelease Tags - -If a version has a prerelease tag (for example, `1.2.3-alpha.3`) then -it will only be allowed to satisfy comparator sets if at least one -comparator with the same `[major, minor, patch]` tuple also has a -prerelease tag. - -For example, the range `>1.2.3-alpha.3` would be allowed to match the -version `1.2.3-alpha.7`, but it would *not* be satisfied by -`3.4.5-alpha.9`, even though `3.4.5-alpha.9` is technically "greater -than" `1.2.3-alpha.3` according to the SemVer sort rules. The version -range only accepts prerelease tags on the `1.2.3` version. The -version `3.4.5` *would* satisfy the range, because it does not have a -prerelease flag, and `3.4.5` is greater than `1.2.3-alpha.7`. - -The purpose for this behavior is twofold. First, prerelease versions -frequently are updated very quickly, and contain many breaking changes -that are (by the author's design) not yet fit for public consumption. -Therefore, by default, they are excluded from range matching -semantics. - -Second, a user who has opted into using a prerelease version has -clearly indicated the intent to use *that specific* set of -alpha/beta/rc versions. By including a prerelease tag in the range, -the user is indicating that they are aware of the risk. However, it -is still not appropriate to assume that they have opted into taking a -similar risk on the *next* set of prerelease versions. - -Note that this behavior can be suppressed (treating all prerelease -versions as if they were normal versions, for the purpose of range -matching) by setting the `includePrerelease` flag on the options -object to any -[functions](https://github.com/npm/node-semver#functions) that do -range matching. - -#### Prerelease Identifiers - -The method `.inc` takes an additional `identifier` string argument that -will append the value of the string as a prerelease identifier: - -```javascript -semver.inc('1.2.3', 'prerelease', 'beta') -// '1.2.4-beta.0' -``` - -command-line example: - -```bash -$ semver 1.2.3 -i prerelease --preid beta -1.2.4-beta.0 -``` - -Which then can be used to increment further: - -```bash -$ semver 1.2.4-beta.0 -i prerelease -1.2.4-beta.1 -``` - -### Advanced Range Syntax - -Advanced range syntax desugars to primitive comparators in -deterministic ways. - -Advanced ranges may be combined in the same way as primitive -comparators using white space or `||`. - -#### Hyphen Ranges `X.Y.Z - A.B.C` - -Specifies an inclusive set. - -* `1.2.3 - 2.3.4` := `>=1.2.3 <=2.3.4` - -If a partial version is provided as the first version in the inclusive -range, then the missing pieces are replaced with zeroes. - -* `1.2 - 2.3.4` := `>=1.2.0 <=2.3.4` - -If a partial version is provided as the second version in the -inclusive range, then all versions that start with the supplied parts -of the tuple are accepted, but nothing that would be greater than the -provided tuple parts. - -* `1.2.3 - 2.3` := `>=1.2.3 <2.4.0-0` -* `1.2.3 - 2` := `>=1.2.3 <3.0.0-0` - -#### X-Ranges `1.2.x` `1.X` `1.2.*` `*` - -Any of `X`, `x`, or `*` may be used to "stand in" for one of the -numeric values in the `[major, minor, patch]` tuple. - -* `*` := `>=0.0.0` (Any non-prerelease version satisfies, unless - `includePrerelease` is specified, in which case any version at all - satisfies) -* `1.x` := `>=1.0.0 <2.0.0-0` (Matching major version) -* `1.2.x` := `>=1.2.0 <1.3.0-0` (Matching major and minor versions) - -A partial version range is treated as an X-Range, so the special -character is in fact optional. - -* `""` (empty string) := `*` := `>=0.0.0` -* `1` := `1.x.x` := `>=1.0.0 <2.0.0-0` -* `1.2` := `1.2.x` := `>=1.2.0 <1.3.0-0` - -#### Tilde Ranges `~1.2.3` `~1.2` `~1` - -Allows patch-level changes if a minor version is specified on the -comparator. Allows minor-level changes if not. - -* `~1.2.3` := `>=1.2.3 <1.(2+1).0` := `>=1.2.3 <1.3.0-0` -* `~1.2` := `>=1.2.0 <1.(2+1).0` := `>=1.2.0 <1.3.0-0` (Same as `1.2.x`) -* `~1` := `>=1.0.0 <(1+1).0.0` := `>=1.0.0 <2.0.0-0` (Same as `1.x`) -* `~0.2.3` := `>=0.2.3 <0.(2+1).0` := `>=0.2.3 <0.3.0-0` -* `~0.2` := `>=0.2.0 <0.(2+1).0` := `>=0.2.0 <0.3.0-0` (Same as `0.2.x`) -* `~0` := `>=0.0.0 <(0+1).0.0` := `>=0.0.0 <1.0.0-0` (Same as `0.x`) -* `~1.2.3-beta.2` := `>=1.2.3-beta.2 <1.3.0-0` Note that prereleases in - the `1.2.3` version will be allowed, if they are greater than or - equal to `beta.2`. So, `1.2.3-beta.4` would be allowed, but - `1.2.4-beta.2` would not, because it is a prerelease of a - different `[major, minor, patch]` tuple. - -#### Caret Ranges `^1.2.3` `^0.2.5` `^0.0.4` - -Allows changes that do not modify the left-most non-zero element in the -`[major, minor, patch]` tuple. In other words, this allows patch and -minor updates for versions `1.0.0` and above, patch updates for -versions `0.X >=0.1.0`, and *no* updates for versions `0.0.X`. - -Many authors treat a `0.x` version as if the `x` were the major -"breaking-change" indicator. - -Caret ranges are ideal when an author may make breaking changes -between `0.2.4` and `0.3.0` releases, which is a common practice. -However, it presumes that there will *not* be breaking changes between -`0.2.4` and `0.2.5`. It allows for changes that are presumed to be -additive (but non-breaking), according to commonly observed practices. - -* `^1.2.3` := `>=1.2.3 <2.0.0-0` -* `^0.2.3` := `>=0.2.3 <0.3.0-0` -* `^0.0.3` := `>=0.0.3 <0.0.4-0` -* `^1.2.3-beta.2` := `>=1.2.3-beta.2 <2.0.0-0` Note that prereleases in - the `1.2.3` version will be allowed, if they are greater than or - equal to `beta.2`. So, `1.2.3-beta.4` would be allowed, but - `1.2.4-beta.2` would not, because it is a prerelease of a - different `[major, minor, patch]` tuple. -* `^0.0.3-beta` := `>=0.0.3-beta <0.0.4-0` Note that prereleases in the - `0.0.3` version *only* will be allowed, if they are greater than or - equal to `beta`. So, `0.0.3-pr.2` would be allowed. - -When parsing caret ranges, a missing `patch` value desugars to the -number `0`, but will allow flexibility within that value, even if the -major and minor versions are both `0`. - -* `^1.2.x` := `>=1.2.0 <2.0.0-0` -* `^0.0.x` := `>=0.0.0 <0.1.0-0` -* `^0.0` := `>=0.0.0 <0.1.0-0` - -A missing `minor` and `patch` values will desugar to zero, but also -allow flexibility within those values, even if the major version is -zero. - -* `^1.x` := `>=1.0.0 <2.0.0-0` -* `^0.x` := `>=0.0.0 <1.0.0-0` - -### Range Grammar - -Putting all this together, here is a Backus-Naur grammar for ranges, -for the benefit of parser authors: - -```bnf -range-set ::= range ( logical-or range ) * -logical-or ::= ( ' ' ) * '||' ( ' ' ) * -range ::= hyphen | simple ( ' ' simple ) * | '' -hyphen ::= partial ' - ' partial -simple ::= primitive | partial | tilde | caret -primitive ::= ( '<' | '>' | '>=' | '<=' | '=' ) partial -partial ::= xr ( '.' xr ( '.' xr qualifier ? )? )? -xr ::= 'x' | 'X' | '*' | nr -nr ::= '0' | ['1'-'9'] ( ['0'-'9'] ) * -tilde ::= '~' partial -caret ::= '^' partial -qualifier ::= ( '-' pre )? ( '+' build )? -pre ::= parts -build ::= parts -parts ::= part ( '.' part ) * -part ::= nr | [-0-9A-Za-z]+ -``` - -## Functions - -All methods and classes take a final `options` object argument. All -options in this object are `false` by default. The options supported -are: - -- `loose` Be more forgiving about not-quite-valid semver strings. - (Any resulting output will always be 100% strict compliant, of - course.) For backwards compatibility reasons, if the `options` - argument is a boolean value instead of an object, it is interpreted - to be the `loose` param. -- `includePrerelease` Set to suppress the [default - behavior](https://github.com/npm/node-semver#prerelease-tags) of - excluding prerelease tagged versions from ranges unless they are - explicitly opted into. - -Strict-mode Comparators and Ranges will be strict about the SemVer -strings that they parse. - -* `valid(v)`: Return the parsed version, or null if it's not valid. -* `inc(v, release)`: Return the version incremented by the release - type (`major`, `premajor`, `minor`, `preminor`, `patch`, - `prepatch`, or `prerelease`), or null if it's not valid - * `premajor` in one call will bump the version up to the next major - version and down to a prerelease of that major version. - `preminor`, and `prepatch` work the same way. - * If called from a non-prerelease version, the `prerelease` will work the - same as `prepatch`. It increments the patch version, then makes a - prerelease. If the input version is already a prerelease it simply - increments it. -* `prerelease(v)`: Returns an array of prerelease components, or null - if none exist. Example: `prerelease('1.2.3-alpha.1') -> ['alpha', 1]` -* `major(v)`: Return the major version number. -* `minor(v)`: Return the minor version number. -* `patch(v)`: Return the patch version number. -* `intersects(r1, r2, loose)`: Return true if the two supplied ranges - or comparators intersect. -* `parse(v)`: Attempt to parse a string as a semantic version, returning either - a `SemVer` object or `null`. - -### Comparison - -* `gt(v1, v2)`: `v1 > v2` -* `gte(v1, v2)`: `v1 >= v2` -* `lt(v1, v2)`: `v1 < v2` -* `lte(v1, v2)`: `v1 <= v2` -* `eq(v1, v2)`: `v1 == v2` This is true if they're logically equivalent, - even if they're not the exact same string. You already know how to - compare strings. -* `neq(v1, v2)`: `v1 != v2` The opposite of `eq`. -* `cmp(v1, comparator, v2)`: Pass in a comparison string, and it'll call - the corresponding function above. `"==="` and `"!=="` do simple - string comparison, but are included for completeness. Throws if an - invalid comparison string is provided. -* `compare(v1, v2)`: Return `0` if `v1 == v2`, or `1` if `v1` is greater, or `-1` if - `v2` is greater. Sorts in ascending order if passed to `Array.sort()`. -* `rcompare(v1, v2)`: The reverse of compare. Sorts an array of versions - in descending order when passed to `Array.sort()`. -* `compareBuild(v1, v2)`: The same as `compare` but considers `build` when two versions - are equal. Sorts in ascending order if passed to `Array.sort()`. - `v2` is greater. Sorts in ascending order if passed to `Array.sort()`. -* `diff(v1, v2)`: Returns difference between two versions by the release type - (`major`, `premajor`, `minor`, `preminor`, `patch`, `prepatch`, or `prerelease`), - or null if the versions are the same. - -### Comparators - -* `intersects(comparator)`: Return true if the comparators intersect - -### Ranges - -* `validRange(range)`: Return the valid range or null if it's not valid -* `satisfies(version, range)`: Return true if the version satisfies the - range. -* `maxSatisfying(versions, range)`: Return the highest version in the list - that satisfies the range, or `null` if none of them do. -* `minSatisfying(versions, range)`: Return the lowest version in the list - that satisfies the range, or `null` if none of them do. -* `minVersion(range)`: Return the lowest version that can possibly match - the given range. -* `gtr(version, range)`: Return `true` if version is greater than all the - versions possible in the range. -* `ltr(version, range)`: Return `true` if version is less than all the - versions possible in the range. -* `outside(version, range, hilo)`: Return true if the version is outside - the bounds of the range in either the high or low direction. The - `hilo` argument must be either the string `'>'` or `'<'`. (This is - the function called by `gtr` and `ltr`.) -* `intersects(range)`: Return true if any of the ranges comparators intersect -* `simplifyRange(versions, range)`: Return a "simplified" range that - matches the same items in `versions` list as the range specified. Note - that it does *not* guarantee that it would match the same versions in all - cases, only for the set of versions provided. This is useful when - generating ranges by joining together multiple versions with `||` - programmatically, to provide the user with something a bit more - ergonomic. If the provided range is shorter in string-length than the - generated range, then that is returned. -* `subset(subRange, superRange)`: Return `true` if the `subRange` range is - entirely contained by the `superRange` range. - -Note that, since ranges may be non-contiguous, a version might not be -greater than a range, less than a range, *or* satisfy a range! For -example, the range `1.2 <1.2.9 || >2.0.0` would have a hole from `1.2.9` -until `2.0.0`, so the version `1.2.10` would not be greater than the -range (because `2.0.1` satisfies, which is higher), nor less than the -range (since `1.2.8` satisfies, which is lower), and it also does not -satisfy the range. - -If you want to know if a version satisfies or does not satisfy a -range, use the `satisfies(version, range)` function. - -### Coercion - -* `coerce(version, options)`: Coerces a string to semver if possible - -This aims to provide a very forgiving translation of a non-semver string to -semver. It looks for the first digit in a string, and consumes all -remaining characters which satisfy at least a partial semver (e.g., `1`, -`1.2`, `1.2.3`) up to the max permitted length (256 characters). Longer -versions are simply truncated (`4.6.3.9.2-alpha2` becomes `4.6.3`). All -surrounding text is simply ignored (`v3.4 replaces v3.3.1` becomes -`3.4.0`). Only text which lacks digits will fail coercion (`version one` -is not valid). The maximum length for any semver component considered for -coercion is 16 characters; longer components will be ignored -(`10000000000000000.4.7.4` becomes `4.7.4`). The maximum value for any -semver component is `Number.MAX_SAFE_INTEGER || (2**53 - 1)`; higher value -components are invalid (`9999999999999999.4.7.4` is likely invalid). - -If the `options.rtl` flag is set, then `coerce` will return the right-most -coercible tuple that does not share an ending index with a longer coercible -tuple. For example, `1.2.3.4` will return `2.3.4` in rtl mode, not -`4.0.0`. `1.2.3/4` will return `4.0.0`, because the `4` is not a part of -any other overlapping SemVer tuple. - -### Clean - -* `clean(version)`: Clean a string to be a valid semver if possible - -This will return a cleaned and trimmed semver version. If the provided -version is not valid a null will be returned. This does not work for -ranges. - -ex. -* `s.clean(' = v 2.1.5foo')`: `null` -* `s.clean(' = v 2.1.5foo', { loose: true })`: `'2.1.5-foo'` -* `s.clean(' = v 2.1.5-foo')`: `null` -* `s.clean(' = v 2.1.5-foo', { loose: true })`: `'2.1.5-foo'` -* `s.clean('=v2.1.5')`: `'2.1.5'` -* `s.clean(' =v2.1.5')`: `2.1.5` -* `s.clean(' 2.1.5 ')`: `'2.1.5'` -* `s.clean('~1.0.0')`: `null` - -## Exported Modules - - - -You may pull in just the part of this semver utility that you need, if you -are sensitive to packing and tree-shaking concerns. The main -`require('semver')` export uses getter functions to lazily load the parts -of the API that are used. - -The following modules are available: - -* `require('semver')` -* `require('semver/classes')` -* `require('semver/classes/comparator')` -* `require('semver/classes/range')` -* `require('semver/classes/semver')` -* `require('semver/functions/clean')` -* `require('semver/functions/cmp')` -* `require('semver/functions/coerce')` -* `require('semver/functions/compare')` -* `require('semver/functions/compare-build')` -* `require('semver/functions/compare-loose')` -* `require('semver/functions/diff')` -* `require('semver/functions/eq')` -* `require('semver/functions/gt')` -* `require('semver/functions/gte')` -* `require('semver/functions/inc')` -* `require('semver/functions/lt')` -* `require('semver/functions/lte')` -* `require('semver/functions/major')` -* `require('semver/functions/minor')` -* `require('semver/functions/neq')` -* `require('semver/functions/parse')` -* `require('semver/functions/patch')` -* `require('semver/functions/prerelease')` -* `require('semver/functions/rcompare')` -* `require('semver/functions/rsort')` -* `require('semver/functions/satisfies')` -* `require('semver/functions/sort')` -* `require('semver/functions/valid')` -* `require('semver/ranges/gtr')` -* `require('semver/ranges/intersects')` -* `require('semver/ranges/ltr')` -* `require('semver/ranges/max-satisfying')` -* `require('semver/ranges/min-satisfying')` -* `require('semver/ranges/min-version')` -* `require('semver/ranges/outside')` -* `require('semver/ranges/to-comparators')` -* `require('semver/ranges/valid')` diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/bin/semver.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/bin/semver.js deleted file mode 100755 index 8d1b5572..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/bin/semver.js +++ /dev/null @@ -1,183 +0,0 @@ -#!/usr/bin/env node -// Standalone semver comparison program. -// Exits successfully and prints matching version(s) if -// any supplied version is valid and passes all tests. - -const argv = process.argv.slice(2) - -let versions = [] - -const range = [] - -let inc = null - -const version = require('../package.json').version - -let loose = false - -let includePrerelease = false - -let coerce = false - -let rtl = false - -let identifier - -const semver = require('../') - -let reverse = false - -let options = {} - -const main = () => { - if (!argv.length) { - return help() - } - while (argv.length) { - let a = argv.shift() - const indexOfEqualSign = a.indexOf('=') - if (indexOfEqualSign !== -1) { - const value = a.slice(indexOfEqualSign + 1) - a = a.slice(0, indexOfEqualSign) - argv.unshift(value) - } - switch (a) { - case '-rv': case '-rev': case '--rev': case '--reverse': - reverse = true - break - case '-l': case '--loose': - loose = true - break - case '-p': case '--include-prerelease': - includePrerelease = true - break - case '-v': case '--version': - versions.push(argv.shift()) - break - case '-i': case '--inc': case '--increment': - switch (argv[0]) { - case 'major': case 'minor': case 'patch': case 'prerelease': - case 'premajor': case 'preminor': case 'prepatch': - inc = argv.shift() - break - default: - inc = 'patch' - break - } - break - case '--preid': - identifier = argv.shift() - break - case '-r': case '--range': - range.push(argv.shift()) - break - case '-c': case '--coerce': - coerce = true - break - case '--rtl': - rtl = true - break - case '--ltr': - rtl = false - break - case '-h': case '--help': case '-?': - return help() - default: - versions.push(a) - break - } - } - - options = { loose: loose, includePrerelease: includePrerelease, rtl: rtl } - - versions = versions.map((v) => { - return coerce ? (semver.coerce(v, options) || { version: v }).version : v - }).filter((v) => { - return semver.valid(v) - }) - if (!versions.length) { - return fail() - } - if (inc && (versions.length !== 1 || range.length)) { - return failInc() - } - - for (let i = 0, l = range.length; i < l; i++) { - versions = versions.filter((v) => { - return semver.satisfies(v, range[i], options) - }) - if (!versions.length) { - return fail() - } - } - return success(versions) -} - -const failInc = () => { - console.error('--inc can only be used on a single version with no range') - fail() -} - -const fail = () => process.exit(1) - -const success = () => { - const compare = reverse ? 'rcompare' : 'compare' - versions.sort((a, b) => { - return semver[compare](a, b, options) - }).map((v) => { - return semver.clean(v, options) - }).map((v) => { - return inc ? semver.inc(v, inc, options, identifier) : v - }).forEach((v, i, _) => { - console.log(v) - }) -} - -const help = () => console.log( -`SemVer ${version} - -A JavaScript implementation of the https://semver.org/ specification -Copyright Isaac Z. Schlueter - -Usage: semver [options] [ [...]] -Prints valid versions sorted by SemVer precedence - -Options: --r --range - Print versions that match the specified range. - --i --increment [] - Increment a version by the specified level. Level can - be one of: major, minor, patch, premajor, preminor, - prepatch, or prerelease. Default level is 'patch'. - Only one version may be specified. - ---preid - Identifier to be used to prefix premajor, preminor, - prepatch or prerelease version increments. - --l --loose - Interpret versions and ranges loosely - --p --include-prerelease - Always include prerelease versions in range matching - --c --coerce - Coerce a string into SemVer if possible - (does not imply --loose) - ---rtl - Coerce version strings right to left - ---ltr - Coerce version strings left to right (default) - -Program exits successfully if any valid version satisfies -all supplied ranges, and prints all satisfying versions. - -If no satisfying versions are found, then exits failure. - -Versions are printed in ascending order, so supplying -multiple versions to the utility will just sort them.`) - -main() diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/classes/comparator.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/classes/comparator.js deleted file mode 100644 index 62cd204d..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/classes/comparator.js +++ /dev/null @@ -1,136 +0,0 @@ -const ANY = Symbol('SemVer ANY') -// hoisted class for cyclic dependency -class Comparator { - static get ANY () { - return ANY - } - - constructor (comp, options) { - options = parseOptions(options) - - if (comp instanceof Comparator) { - if (comp.loose === !!options.loose) { - return comp - } else { - comp = comp.value - } - } - - debug('comparator', comp, options) - this.options = options - this.loose = !!options.loose - this.parse(comp) - - if (this.semver === ANY) { - this.value = '' - } else { - this.value = this.operator + this.semver.version - } - - debug('comp', this) - } - - parse (comp) { - const r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR] - const m = comp.match(r) - - if (!m) { - throw new TypeError(`Invalid comparator: ${comp}`) - } - - this.operator = m[1] !== undefined ? m[1] : '' - if (this.operator === '=') { - this.operator = '' - } - - // if it literally is just '>' or '' then allow anything. - if (!m[2]) { - this.semver = ANY - } else { - this.semver = new SemVer(m[2], this.options.loose) - } - } - - toString () { - return this.value - } - - test (version) { - debug('Comparator.test', version, this.options.loose) - - if (this.semver === ANY || version === ANY) { - return true - } - - if (typeof version === 'string') { - try { - version = new SemVer(version, this.options) - } catch (er) { - return false - } - } - - return cmp(version, this.operator, this.semver, this.options) - } - - intersects (comp, options) { - if (!(comp instanceof Comparator)) { - throw new TypeError('a Comparator is required') - } - - if (!options || typeof options !== 'object') { - options = { - loose: !!options, - includePrerelease: false, - } - } - - if (this.operator === '') { - if (this.value === '') { - return true - } - return new Range(comp.value, options).test(this.value) - } else if (comp.operator === '') { - if (comp.value === '') { - return true - } - return new Range(this.value, options).test(comp.semver) - } - - const sameDirectionIncreasing = - (this.operator === '>=' || this.operator === '>') && - (comp.operator === '>=' || comp.operator === '>') - const sameDirectionDecreasing = - (this.operator === '<=' || this.operator === '<') && - (comp.operator === '<=' || comp.operator === '<') - const sameSemVer = this.semver.version === comp.semver.version - const differentDirectionsInclusive = - (this.operator === '>=' || this.operator === '<=') && - (comp.operator === '>=' || comp.operator === '<=') - const oppositeDirectionsLessThan = - cmp(this.semver, '<', comp.semver, options) && - (this.operator === '>=' || this.operator === '>') && - (comp.operator === '<=' || comp.operator === '<') - const oppositeDirectionsGreaterThan = - cmp(this.semver, '>', comp.semver, options) && - (this.operator === '<=' || this.operator === '<') && - (comp.operator === '>=' || comp.operator === '>') - - return ( - sameDirectionIncreasing || - sameDirectionDecreasing || - (sameSemVer && differentDirectionsInclusive) || - oppositeDirectionsLessThan || - oppositeDirectionsGreaterThan - ) - } -} - -module.exports = Comparator - -const parseOptions = require('../internal/parse-options') -const { re, t } = require('../internal/re') -const cmp = require('../functions/cmp') -const debug = require('../internal/debug') -const SemVer = require('./semver') -const Range = require('./range') diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/classes/index.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/classes/index.js deleted file mode 100644 index 5e3f5c9b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/classes/index.js +++ /dev/null @@ -1,5 +0,0 @@ -module.exports = { - SemVer: require('./semver.js'), - Range: require('./range.js'), - Comparator: require('./comparator.js'), -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/classes/range.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/classes/range.js deleted file mode 100644 index a791d912..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/classes/range.js +++ /dev/null @@ -1,522 +0,0 @@ -// hoisted class for cyclic dependency -class Range { - constructor (range, options) { - options = parseOptions(options) - - if (range instanceof Range) { - if ( - range.loose === !!options.loose && - range.includePrerelease === !!options.includePrerelease - ) { - return range - } else { - return new Range(range.raw, options) - } - } - - if (range instanceof Comparator) { - // just put it in the set and return - this.raw = range.value - this.set = [[range]] - this.format() - return this - } - - this.options = options - this.loose = !!options.loose - this.includePrerelease = !!options.includePrerelease - - // First, split based on boolean or || - this.raw = range - this.set = range - .split('||') - // map the range to a 2d array of comparators - .map(r => this.parseRange(r.trim())) - // throw out any comparator lists that are empty - // this generally means that it was not a valid range, which is allowed - // in loose mode, but will still throw if the WHOLE range is invalid. - .filter(c => c.length) - - if (!this.set.length) { - throw new TypeError(`Invalid SemVer Range: ${range}`) - } - - // if we have any that are not the null set, throw out null sets. - if (this.set.length > 1) { - // keep the first one, in case they're all null sets - const first = this.set[0] - this.set = this.set.filter(c => !isNullSet(c[0])) - if (this.set.length === 0) { - this.set = [first] - } else if (this.set.length > 1) { - // if we have any that are *, then the range is just * - for (const c of this.set) { - if (c.length === 1 && isAny(c[0])) { - this.set = [c] - break - } - } - } - } - - this.format() - } - - format () { - this.range = this.set - .map((comps) => { - return comps.join(' ').trim() - }) - .join('||') - .trim() - return this.range - } - - toString () { - return this.range - } - - parseRange (range) { - range = range.trim() - - // memoize range parsing for performance. - // this is a very hot path, and fully deterministic. - const memoOpts = Object.keys(this.options).join(',') - const memoKey = `parseRange:${memoOpts}:${range}` - const cached = cache.get(memoKey) - if (cached) { - return cached - } - - const loose = this.options.loose - // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4` - const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE] - range = range.replace(hr, hyphenReplace(this.options.includePrerelease)) - debug('hyphen replace', range) - // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5` - range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace) - debug('comparator trim', range) - - // `~ 1.2.3` => `~1.2.3` - range = range.replace(re[t.TILDETRIM], tildeTrimReplace) - - // `^ 1.2.3` => `^1.2.3` - range = range.replace(re[t.CARETTRIM], caretTrimReplace) - - // normalize spaces - range = range.split(/\s+/).join(' ') - - // At this point, the range is completely trimmed and - // ready to be split into comparators. - - let rangeList = range - .split(' ') - .map(comp => parseComparator(comp, this.options)) - .join(' ') - .split(/\s+/) - // >=0.0.0 is equivalent to * - .map(comp => replaceGTE0(comp, this.options)) - - if (loose) { - // in loose mode, throw out any that are not valid comparators - rangeList = rangeList.filter(comp => { - debug('loose invalid filter', comp, this.options) - return !!comp.match(re[t.COMPARATORLOOSE]) - }) - } - debug('range list', rangeList) - - // if any comparators are the null set, then replace with JUST null set - // if more than one comparator, remove any * comparators - // also, don't include the same comparator more than once - const rangeMap = new Map() - const comparators = rangeList.map(comp => new Comparator(comp, this.options)) - for (const comp of comparators) { - if (isNullSet(comp)) { - return [comp] - } - rangeMap.set(comp.value, comp) - } - if (rangeMap.size > 1 && rangeMap.has('')) { - rangeMap.delete('') - } - - const result = [...rangeMap.values()] - cache.set(memoKey, result) - return result - } - - intersects (range, options) { - if (!(range instanceof Range)) { - throw new TypeError('a Range is required') - } - - return this.set.some((thisComparators) => { - return ( - isSatisfiable(thisComparators, options) && - range.set.some((rangeComparators) => { - return ( - isSatisfiable(rangeComparators, options) && - thisComparators.every((thisComparator) => { - return rangeComparators.every((rangeComparator) => { - return thisComparator.intersects(rangeComparator, options) - }) - }) - ) - }) - ) - }) - } - - // if ANY of the sets match ALL of its comparators, then pass - test (version) { - if (!version) { - return false - } - - if (typeof version === 'string') { - try { - version = new SemVer(version, this.options) - } catch (er) { - return false - } - } - - for (let i = 0; i < this.set.length; i++) { - if (testSet(this.set[i], version, this.options)) { - return true - } - } - return false - } -} -module.exports = Range - -const LRU = require('lru-cache') -const cache = new LRU({ max: 1000 }) - -const parseOptions = require('../internal/parse-options') -const Comparator = require('./comparator') -const debug = require('../internal/debug') -const SemVer = require('./semver') -const { - re, - t, - comparatorTrimReplace, - tildeTrimReplace, - caretTrimReplace, -} = require('../internal/re') - -const isNullSet = c => c.value === '<0.0.0-0' -const isAny = c => c.value === '' - -// take a set of comparators and determine whether there -// exists a version which can satisfy it -const isSatisfiable = (comparators, options) => { - let result = true - const remainingComparators = comparators.slice() - let testComparator = remainingComparators.pop() - - while (result && remainingComparators.length) { - result = remainingComparators.every((otherComparator) => { - return testComparator.intersects(otherComparator, options) - }) - - testComparator = remainingComparators.pop() - } - - return result -} - -// comprised of xranges, tildes, stars, and gtlt's at this point. -// already replaced the hyphen ranges -// turn into a set of JUST comparators. -const parseComparator = (comp, options) => { - debug('comp', comp, options) - comp = replaceCarets(comp, options) - debug('caret', comp) - comp = replaceTildes(comp, options) - debug('tildes', comp) - comp = replaceXRanges(comp, options) - debug('xrange', comp) - comp = replaceStars(comp, options) - debug('stars', comp) - return comp -} - -const isX = id => !id || id.toLowerCase() === 'x' || id === '*' - -// ~, ~> --> * (any, kinda silly) -// ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0-0 -// ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0-0 -// ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0-0 -// ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0-0 -// ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0-0 -// ~0.0.1 --> >=0.0.1 <0.1.0-0 -const replaceTildes = (comp, options) => - comp.trim().split(/\s+/).map((c) => { - return replaceTilde(c, options) - }).join(' ') - -const replaceTilde = (comp, options) => { - const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE] - return comp.replace(r, (_, M, m, p, pr) => { - debug('tilde', comp, _, M, m, p, pr) - let ret - - if (isX(M)) { - ret = '' - } else if (isX(m)) { - ret = `>=${M}.0.0 <${+M + 1}.0.0-0` - } else if (isX(p)) { - // ~1.2 == >=1.2.0 <1.3.0-0 - ret = `>=${M}.${m}.0 <${M}.${+m + 1}.0-0` - } else if (pr) { - debug('replaceTilde pr', pr) - ret = `>=${M}.${m}.${p}-${pr - } <${M}.${+m + 1}.0-0` - } else { - // ~1.2.3 == >=1.2.3 <1.3.0-0 - ret = `>=${M}.${m}.${p - } <${M}.${+m + 1}.0-0` - } - - debug('tilde return', ret) - return ret - }) -} - -// ^ --> * (any, kinda silly) -// ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0-0 -// ^2.0, ^2.0.x --> >=2.0.0 <3.0.0-0 -// ^1.2, ^1.2.x --> >=1.2.0 <2.0.0-0 -// ^1.2.3 --> >=1.2.3 <2.0.0-0 -// ^1.2.0 --> >=1.2.0 <2.0.0-0 -// ^0.0.1 --> >=0.0.1 <0.0.2-0 -// ^0.1.0 --> >=0.1.0 <0.2.0-0 -const replaceCarets = (comp, options) => - comp.trim().split(/\s+/).map((c) => { - return replaceCaret(c, options) - }).join(' ') - -const replaceCaret = (comp, options) => { - debug('caret', comp, options) - const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET] - const z = options.includePrerelease ? '-0' : '' - return comp.replace(r, (_, M, m, p, pr) => { - debug('caret', comp, _, M, m, p, pr) - let ret - - if (isX(M)) { - ret = '' - } else if (isX(m)) { - ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0` - } else if (isX(p)) { - if (M === '0') { - ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0` - } else { - ret = `>=${M}.${m}.0${z} <${+M + 1}.0.0-0` - } - } else if (pr) { - debug('replaceCaret pr', pr) - if (M === '0') { - if (m === '0') { - ret = `>=${M}.${m}.${p}-${pr - } <${M}.${m}.${+p + 1}-0` - } else { - ret = `>=${M}.${m}.${p}-${pr - } <${M}.${+m + 1}.0-0` - } - } else { - ret = `>=${M}.${m}.${p}-${pr - } <${+M + 1}.0.0-0` - } - } else { - debug('no pr') - if (M === '0') { - if (m === '0') { - ret = `>=${M}.${m}.${p - }${z} <${M}.${m}.${+p + 1}-0` - } else { - ret = `>=${M}.${m}.${p - }${z} <${M}.${+m + 1}.0-0` - } - } else { - ret = `>=${M}.${m}.${p - } <${+M + 1}.0.0-0` - } - } - - debug('caret return', ret) - return ret - }) -} - -const replaceXRanges = (comp, options) => { - debug('replaceXRanges', comp, options) - return comp.split(/\s+/).map((c) => { - return replaceXRange(c, options) - }).join(' ') -} - -const replaceXRange = (comp, options) => { - comp = comp.trim() - const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE] - return comp.replace(r, (ret, gtlt, M, m, p, pr) => { - debug('xRange', comp, ret, gtlt, M, m, p, pr) - const xM = isX(M) - const xm = xM || isX(m) - const xp = xm || isX(p) - const anyX = xp - - if (gtlt === '=' && anyX) { - gtlt = '' - } - - // if we're including prereleases in the match, then we need - // to fix this to -0, the lowest possible prerelease value - pr = options.includePrerelease ? '-0' : '' - - if (xM) { - if (gtlt === '>' || gtlt === '<') { - // nothing is allowed - ret = '<0.0.0-0' - } else { - // nothing is forbidden - ret = '*' - } - } else if (gtlt && anyX) { - // we know patch is an x, because we have any x at all. - // replace X with 0 - if (xm) { - m = 0 - } - p = 0 - - if (gtlt === '>') { - // >1 => >=2.0.0 - // >1.2 => >=1.3.0 - gtlt = '>=' - if (xm) { - M = +M + 1 - m = 0 - p = 0 - } else { - m = +m + 1 - p = 0 - } - } else if (gtlt === '<=') { - // <=0.7.x is actually <0.8.0, since any 0.7.x should - // pass. Similarly, <=7.x is actually <8.0.0, etc. - gtlt = '<' - if (xm) { - M = +M + 1 - } else { - m = +m + 1 - } - } - - if (gtlt === '<') { - pr = '-0' - } - - ret = `${gtlt + M}.${m}.${p}${pr}` - } else if (xm) { - ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0` - } else if (xp) { - ret = `>=${M}.${m}.0${pr - } <${M}.${+m + 1}.0-0` - } - - debug('xRange return', ret) - - return ret - }) -} - -// Because * is AND-ed with everything else in the comparator, -// and '' means "any version", just remove the *s entirely. -const replaceStars = (comp, options) => { - debug('replaceStars', comp, options) - // Looseness is ignored here. star is always as loose as it gets! - return comp.trim().replace(re[t.STAR], '') -} - -const replaceGTE0 = (comp, options) => { - debug('replaceGTE0', comp, options) - return comp.trim() - .replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], '') -} - -// This function is passed to string.replace(re[t.HYPHENRANGE]) -// M, m, patch, prerelease, build -// 1.2 - 3.4.5 => >=1.2.0 <=3.4.5 -// 1.2.3 - 3.4 => >=1.2.0 <3.5.0-0 Any 3.4.x will do -// 1.2 - 3.4 => >=1.2.0 <3.5.0-0 -const hyphenReplace = incPr => ($0, - from, fM, fm, fp, fpr, fb, - to, tM, tm, tp, tpr, tb) => { - if (isX(fM)) { - from = '' - } else if (isX(fm)) { - from = `>=${fM}.0.0${incPr ? '-0' : ''}` - } else if (isX(fp)) { - from = `>=${fM}.${fm}.0${incPr ? '-0' : ''}` - } else if (fpr) { - from = `>=${from}` - } else { - from = `>=${from}${incPr ? '-0' : ''}` - } - - if (isX(tM)) { - to = '' - } else if (isX(tm)) { - to = `<${+tM + 1}.0.0-0` - } else if (isX(tp)) { - to = `<${tM}.${+tm + 1}.0-0` - } else if (tpr) { - to = `<=${tM}.${tm}.${tp}-${tpr}` - } else if (incPr) { - to = `<${tM}.${tm}.${+tp + 1}-0` - } else { - to = `<=${to}` - } - - return (`${from} ${to}`).trim() -} - -const testSet = (set, version, options) => { - for (let i = 0; i < set.length; i++) { - if (!set[i].test(version)) { - return false - } - } - - if (version.prerelease.length && !options.includePrerelease) { - // Find the set of versions that are allowed to have prereleases - // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0 - // That should allow `1.2.3-pr.2` to pass. - // However, `1.2.4-alpha.notready` should NOT be allowed, - // even though it's within the range set by the comparators. - for (let i = 0; i < set.length; i++) { - debug(set[i].semver) - if (set[i].semver === Comparator.ANY) { - continue - } - - if (set[i].semver.prerelease.length > 0) { - const allowed = set[i].semver - if (allowed.major === version.major && - allowed.minor === version.minor && - allowed.patch === version.patch) { - return true - } - } - } - - // Version has a -pre, but it's not one of the ones we like. - return false - } - - return true -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/classes/semver.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/classes/semver.js deleted file mode 100644 index af629551..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/classes/semver.js +++ /dev/null @@ -1,287 +0,0 @@ -const debug = require('../internal/debug') -const { MAX_LENGTH, MAX_SAFE_INTEGER } = require('../internal/constants') -const { re, t } = require('../internal/re') - -const parseOptions = require('../internal/parse-options') -const { compareIdentifiers } = require('../internal/identifiers') -class SemVer { - constructor (version, options) { - options = parseOptions(options) - - if (version instanceof SemVer) { - if (version.loose === !!options.loose && - version.includePrerelease === !!options.includePrerelease) { - return version - } else { - version = version.version - } - } else if (typeof version !== 'string') { - throw new TypeError(`Invalid Version: ${version}`) - } - - if (version.length > MAX_LENGTH) { - throw new TypeError( - `version is longer than ${MAX_LENGTH} characters` - ) - } - - debug('SemVer', version, options) - this.options = options - this.loose = !!options.loose - // this isn't actually relevant for versions, but keep it so that we - // don't run into trouble passing this.options around. - this.includePrerelease = !!options.includePrerelease - - const m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]) - - if (!m) { - throw new TypeError(`Invalid Version: ${version}`) - } - - this.raw = version - - // these are actually numbers - this.major = +m[1] - this.minor = +m[2] - this.patch = +m[3] - - if (this.major > MAX_SAFE_INTEGER || this.major < 0) { - throw new TypeError('Invalid major version') - } - - if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) { - throw new TypeError('Invalid minor version') - } - - if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) { - throw new TypeError('Invalid patch version') - } - - // numberify any prerelease numeric ids - if (!m[4]) { - this.prerelease = [] - } else { - this.prerelease = m[4].split('.').map((id) => { - if (/^[0-9]+$/.test(id)) { - const num = +id - if (num >= 0 && num < MAX_SAFE_INTEGER) { - return num - } - } - return id - }) - } - - this.build = m[5] ? m[5].split('.') : [] - this.format() - } - - format () { - this.version = `${this.major}.${this.minor}.${this.patch}` - if (this.prerelease.length) { - this.version += `-${this.prerelease.join('.')}` - } - return this.version - } - - toString () { - return this.version - } - - compare (other) { - debug('SemVer.compare', this.version, this.options, other) - if (!(other instanceof SemVer)) { - if (typeof other === 'string' && other === this.version) { - return 0 - } - other = new SemVer(other, this.options) - } - - if (other.version === this.version) { - return 0 - } - - return this.compareMain(other) || this.comparePre(other) - } - - compareMain (other) { - if (!(other instanceof SemVer)) { - other = new SemVer(other, this.options) - } - - return ( - compareIdentifiers(this.major, other.major) || - compareIdentifiers(this.minor, other.minor) || - compareIdentifiers(this.patch, other.patch) - ) - } - - comparePre (other) { - if (!(other instanceof SemVer)) { - other = new SemVer(other, this.options) - } - - // NOT having a prerelease is > having one - if (this.prerelease.length && !other.prerelease.length) { - return -1 - } else if (!this.prerelease.length && other.prerelease.length) { - return 1 - } else if (!this.prerelease.length && !other.prerelease.length) { - return 0 - } - - let i = 0 - do { - const a = this.prerelease[i] - const b = other.prerelease[i] - debug('prerelease compare', i, a, b) - if (a === undefined && b === undefined) { - return 0 - } else if (b === undefined) { - return 1 - } else if (a === undefined) { - return -1 - } else if (a === b) { - continue - } else { - return compareIdentifiers(a, b) - } - } while (++i) - } - - compareBuild (other) { - if (!(other instanceof SemVer)) { - other = new SemVer(other, this.options) - } - - let i = 0 - do { - const a = this.build[i] - const b = other.build[i] - debug('prerelease compare', i, a, b) - if (a === undefined && b === undefined) { - return 0 - } else if (b === undefined) { - return 1 - } else if (a === undefined) { - return -1 - } else if (a === b) { - continue - } else { - return compareIdentifiers(a, b) - } - } while (++i) - } - - // preminor will bump the version up to the next minor release, and immediately - // down to pre-release. premajor and prepatch work the same way. - inc (release, identifier) { - switch (release) { - case 'premajor': - this.prerelease.length = 0 - this.patch = 0 - this.minor = 0 - this.major++ - this.inc('pre', identifier) - break - case 'preminor': - this.prerelease.length = 0 - this.patch = 0 - this.minor++ - this.inc('pre', identifier) - break - case 'prepatch': - // If this is already a prerelease, it will bump to the next version - // drop any prereleases that might already exist, since they are not - // relevant at this point. - this.prerelease.length = 0 - this.inc('patch', identifier) - this.inc('pre', identifier) - break - // If the input is a non-prerelease version, this acts the same as - // prepatch. - case 'prerelease': - if (this.prerelease.length === 0) { - this.inc('patch', identifier) - } - this.inc('pre', identifier) - break - - case 'major': - // If this is a pre-major version, bump up to the same major version. - // Otherwise increment major. - // 1.0.0-5 bumps to 1.0.0 - // 1.1.0 bumps to 2.0.0 - if ( - this.minor !== 0 || - this.patch !== 0 || - this.prerelease.length === 0 - ) { - this.major++ - } - this.minor = 0 - this.patch = 0 - this.prerelease = [] - break - case 'minor': - // If this is a pre-minor version, bump up to the same minor version. - // Otherwise increment minor. - // 1.2.0-5 bumps to 1.2.0 - // 1.2.1 bumps to 1.3.0 - if (this.patch !== 0 || this.prerelease.length === 0) { - this.minor++ - } - this.patch = 0 - this.prerelease = [] - break - case 'patch': - // If this is not a pre-release version, it will increment the patch. - // If it is a pre-release it will bump up to the same patch version. - // 1.2.0-5 patches to 1.2.0 - // 1.2.0 patches to 1.2.1 - if (this.prerelease.length === 0) { - this.patch++ - } - this.prerelease = [] - break - // This probably shouldn't be used publicly. - // 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction. - case 'pre': - if (this.prerelease.length === 0) { - this.prerelease = [0] - } else { - let i = this.prerelease.length - while (--i >= 0) { - if (typeof this.prerelease[i] === 'number') { - this.prerelease[i]++ - i = -2 - } - } - if (i === -1) { - // didn't increment anything - this.prerelease.push(0) - } - } - if (identifier) { - // 1.2.0-beta.1 bumps to 1.2.0-beta.2, - // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0 - if (compareIdentifiers(this.prerelease[0], identifier) === 0) { - if (isNaN(this.prerelease[1])) { - this.prerelease = [identifier, 0] - } - } else { - this.prerelease = [identifier, 0] - } - } - break - - default: - throw new Error(`invalid increment argument: ${release}`) - } - this.format() - this.raw = this.version - return this - } -} - -module.exports = SemVer diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/functions/clean.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/functions/clean.js deleted file mode 100644 index 811fe6b8..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/functions/clean.js +++ /dev/null @@ -1,6 +0,0 @@ -const parse = require('./parse') -const clean = (version, options) => { - const s = parse(version.trim().replace(/^[=v]+/, ''), options) - return s ? s.version : null -} -module.exports = clean diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/functions/cmp.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/functions/cmp.js deleted file mode 100644 index 40119094..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/functions/cmp.js +++ /dev/null @@ -1,52 +0,0 @@ -const eq = require('./eq') -const neq = require('./neq') -const gt = require('./gt') -const gte = require('./gte') -const lt = require('./lt') -const lte = require('./lte') - -const cmp = (a, op, b, loose) => { - switch (op) { - case '===': - if (typeof a === 'object') { - a = a.version - } - if (typeof b === 'object') { - b = b.version - } - return a === b - - case '!==': - if (typeof a === 'object') { - a = a.version - } - if (typeof b === 'object') { - b = b.version - } - return a !== b - - case '': - case '=': - case '==': - return eq(a, b, loose) - - case '!=': - return neq(a, b, loose) - - case '>': - return gt(a, b, loose) - - case '>=': - return gte(a, b, loose) - - case '<': - return lt(a, b, loose) - - case '<=': - return lte(a, b, loose) - - default: - throw new TypeError(`Invalid operator: ${op}`) - } -} -module.exports = cmp diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/functions/coerce.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/functions/coerce.js deleted file mode 100644 index 2e01452f..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/functions/coerce.js +++ /dev/null @@ -1,52 +0,0 @@ -const SemVer = require('../classes/semver') -const parse = require('./parse') -const { re, t } = require('../internal/re') - -const coerce = (version, options) => { - if (version instanceof SemVer) { - return version - } - - if (typeof version === 'number') { - version = String(version) - } - - if (typeof version !== 'string') { - return null - } - - options = options || {} - - let match = null - if (!options.rtl) { - match = version.match(re[t.COERCE]) - } else { - // Find the right-most coercible string that does not share - // a terminus with a more left-ward coercible string. - // Eg, '1.2.3.4' wants to coerce '2.3.4', not '3.4' or '4' - // - // Walk through the string checking with a /g regexp - // Manually set the index so as to pick up overlapping matches. - // Stop when we get a match that ends at the string end, since no - // coercible string can be more right-ward without the same terminus. - let next - while ((next = re[t.COERCERTL].exec(version)) && - (!match || match.index + match[0].length !== version.length) - ) { - if (!match || - next.index + next[0].length !== match.index + match[0].length) { - match = next - } - re[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length - } - // leave it in a clean state - re[t.COERCERTL].lastIndex = -1 - } - - if (match === null) { - return null - } - - return parse(`${match[2]}.${match[3] || '0'}.${match[4] || '0'}`, options) -} -module.exports = coerce diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/functions/compare-build.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/functions/compare-build.js deleted file mode 100644 index 9eb881be..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/functions/compare-build.js +++ /dev/null @@ -1,7 +0,0 @@ -const SemVer = require('../classes/semver') -const compareBuild = (a, b, loose) => { - const versionA = new SemVer(a, loose) - const versionB = new SemVer(b, loose) - return versionA.compare(versionB) || versionA.compareBuild(versionB) -} -module.exports = compareBuild diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/functions/compare-loose.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/functions/compare-loose.js deleted file mode 100644 index 4881fbe0..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/functions/compare-loose.js +++ /dev/null @@ -1,3 +0,0 @@ -const compare = require('./compare') -const compareLoose = (a, b) => compare(a, b, true) -module.exports = compareLoose diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/functions/compare.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/functions/compare.js deleted file mode 100644 index 748b7afa..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/functions/compare.js +++ /dev/null @@ -1,5 +0,0 @@ -const SemVer = require('../classes/semver') -const compare = (a, b, loose) => - new SemVer(a, loose).compare(new SemVer(b, loose)) - -module.exports = compare diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/functions/diff.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/functions/diff.js deleted file mode 100644 index 87200ef3..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/functions/diff.js +++ /dev/null @@ -1,23 +0,0 @@ -const parse = require('./parse') -const eq = require('./eq') - -const diff = (version1, version2) => { - if (eq(version1, version2)) { - return null - } else { - const v1 = parse(version1) - const v2 = parse(version2) - const hasPre = v1.prerelease.length || v2.prerelease.length - const prefix = hasPre ? 'pre' : '' - const defaultResult = hasPre ? 'prerelease' : '' - for (const key in v1) { - if (key === 'major' || key === 'minor' || key === 'patch') { - if (v1[key] !== v2[key]) { - return prefix + key - } - } - } - return defaultResult // may be undefined - } -} -module.exports = diff diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/functions/eq.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/functions/eq.js deleted file mode 100644 index 271fed97..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/functions/eq.js +++ /dev/null @@ -1,3 +0,0 @@ -const compare = require('./compare') -const eq = (a, b, loose) => compare(a, b, loose) === 0 -module.exports = eq diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/functions/gt.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/functions/gt.js deleted file mode 100644 index d9b2156d..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/functions/gt.js +++ /dev/null @@ -1,3 +0,0 @@ -const compare = require('./compare') -const gt = (a, b, loose) => compare(a, b, loose) > 0 -module.exports = gt diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/functions/gte.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/functions/gte.js deleted file mode 100644 index 5aeaa634..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/functions/gte.js +++ /dev/null @@ -1,3 +0,0 @@ -const compare = require('./compare') -const gte = (a, b, loose) => compare(a, b, loose) >= 0 -module.exports = gte diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/functions/inc.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/functions/inc.js deleted file mode 100644 index 62d1da2c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/functions/inc.js +++ /dev/null @@ -1,18 +0,0 @@ -const SemVer = require('../classes/semver') - -const inc = (version, release, options, identifier) => { - if (typeof (options) === 'string') { - identifier = options - options = undefined - } - - try { - return new SemVer( - version instanceof SemVer ? version.version : version, - options - ).inc(release, identifier).version - } catch (er) { - return null - } -} -module.exports = inc diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/functions/lt.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/functions/lt.js deleted file mode 100644 index b440ab7d..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/functions/lt.js +++ /dev/null @@ -1,3 +0,0 @@ -const compare = require('./compare') -const lt = (a, b, loose) => compare(a, b, loose) < 0 -module.exports = lt diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/functions/lte.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/functions/lte.js deleted file mode 100644 index 6dcc9565..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/functions/lte.js +++ /dev/null @@ -1,3 +0,0 @@ -const compare = require('./compare') -const lte = (a, b, loose) => compare(a, b, loose) <= 0 -module.exports = lte diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/functions/major.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/functions/major.js deleted file mode 100644 index 4283165e..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/functions/major.js +++ /dev/null @@ -1,3 +0,0 @@ -const SemVer = require('../classes/semver') -const major = (a, loose) => new SemVer(a, loose).major -module.exports = major diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/functions/minor.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/functions/minor.js deleted file mode 100644 index 57b3455f..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/functions/minor.js +++ /dev/null @@ -1,3 +0,0 @@ -const SemVer = require('../classes/semver') -const minor = (a, loose) => new SemVer(a, loose).minor -module.exports = minor diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/functions/neq.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/functions/neq.js deleted file mode 100644 index f944c015..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/functions/neq.js +++ /dev/null @@ -1,3 +0,0 @@ -const compare = require('./compare') -const neq = (a, b, loose) => compare(a, b, loose) !== 0 -module.exports = neq diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/functions/parse.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/functions/parse.js deleted file mode 100644 index a66663aa..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/functions/parse.js +++ /dev/null @@ -1,33 +0,0 @@ -const { MAX_LENGTH } = require('../internal/constants') -const { re, t } = require('../internal/re') -const SemVer = require('../classes/semver') - -const parseOptions = require('../internal/parse-options') -const parse = (version, options) => { - options = parseOptions(options) - - if (version instanceof SemVer) { - return version - } - - if (typeof version !== 'string') { - return null - } - - if (version.length > MAX_LENGTH) { - return null - } - - const r = options.loose ? re[t.LOOSE] : re[t.FULL] - if (!r.test(version)) { - return null - } - - try { - return new SemVer(version, options) - } catch (er) { - return null - } -} - -module.exports = parse diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/functions/patch.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/functions/patch.js deleted file mode 100644 index 63afca25..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/functions/patch.js +++ /dev/null @@ -1,3 +0,0 @@ -const SemVer = require('../classes/semver') -const patch = (a, loose) => new SemVer(a, loose).patch -module.exports = patch diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/functions/prerelease.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/functions/prerelease.js deleted file mode 100644 index 06aa1324..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/functions/prerelease.js +++ /dev/null @@ -1,6 +0,0 @@ -const parse = require('./parse') -const prerelease = (version, options) => { - const parsed = parse(version, options) - return (parsed && parsed.prerelease.length) ? parsed.prerelease : null -} -module.exports = prerelease diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/functions/rcompare.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/functions/rcompare.js deleted file mode 100644 index 0ac509e7..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/functions/rcompare.js +++ /dev/null @@ -1,3 +0,0 @@ -const compare = require('./compare') -const rcompare = (a, b, loose) => compare(b, a, loose) -module.exports = rcompare diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/functions/rsort.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/functions/rsort.js deleted file mode 100644 index 82404c5c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/functions/rsort.js +++ /dev/null @@ -1,3 +0,0 @@ -const compareBuild = require('./compare-build') -const rsort = (list, loose) => list.sort((a, b) => compareBuild(b, a, loose)) -module.exports = rsort diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/functions/satisfies.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/functions/satisfies.js deleted file mode 100644 index 50af1c19..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/functions/satisfies.js +++ /dev/null @@ -1,10 +0,0 @@ -const Range = require('../classes/range') -const satisfies = (version, range, options) => { - try { - range = new Range(range, options) - } catch (er) { - return false - } - return range.test(version) -} -module.exports = satisfies diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/functions/sort.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/functions/sort.js deleted file mode 100644 index 4d10917a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/functions/sort.js +++ /dev/null @@ -1,3 +0,0 @@ -const compareBuild = require('./compare-build') -const sort = (list, loose) => list.sort((a, b) => compareBuild(a, b, loose)) -module.exports = sort diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/functions/valid.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/functions/valid.js deleted file mode 100644 index f27bae10..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/functions/valid.js +++ /dev/null @@ -1,6 +0,0 @@ -const parse = require('./parse') -const valid = (version, options) => { - const v = parse(version, options) - return v ? v.version : null -} -module.exports = valid diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/index.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/index.js deleted file mode 100644 index 4a342c6a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/index.js +++ /dev/null @@ -1,88 +0,0 @@ -// just pre-load all the stuff that index.js lazily exports -const internalRe = require('./internal/re') -const constants = require('./internal/constants') -const SemVer = require('./classes/semver') -const identifiers = require('./internal/identifiers') -const parse = require('./functions/parse') -const valid = require('./functions/valid') -const clean = require('./functions/clean') -const inc = require('./functions/inc') -const diff = require('./functions/diff') -const major = require('./functions/major') -const minor = require('./functions/minor') -const patch = require('./functions/patch') -const prerelease = require('./functions/prerelease') -const compare = require('./functions/compare') -const rcompare = require('./functions/rcompare') -const compareLoose = require('./functions/compare-loose') -const compareBuild = require('./functions/compare-build') -const sort = require('./functions/sort') -const rsort = require('./functions/rsort') -const gt = require('./functions/gt') -const lt = require('./functions/lt') -const eq = require('./functions/eq') -const neq = require('./functions/neq') -const gte = require('./functions/gte') -const lte = require('./functions/lte') -const cmp = require('./functions/cmp') -const coerce = require('./functions/coerce') -const Comparator = require('./classes/comparator') -const Range = require('./classes/range') -const satisfies = require('./functions/satisfies') -const toComparators = require('./ranges/to-comparators') -const maxSatisfying = require('./ranges/max-satisfying') -const minSatisfying = require('./ranges/min-satisfying') -const minVersion = require('./ranges/min-version') -const validRange = require('./ranges/valid') -const outside = require('./ranges/outside') -const gtr = require('./ranges/gtr') -const ltr = require('./ranges/ltr') -const intersects = require('./ranges/intersects') -const simplifyRange = require('./ranges/simplify') -const subset = require('./ranges/subset') -module.exports = { - parse, - valid, - clean, - inc, - diff, - major, - minor, - patch, - prerelease, - compare, - rcompare, - compareLoose, - compareBuild, - sort, - rsort, - gt, - lt, - eq, - neq, - gte, - lte, - cmp, - coerce, - Comparator, - Range, - satisfies, - toComparators, - maxSatisfying, - minSatisfying, - minVersion, - validRange, - outside, - gtr, - ltr, - intersects, - simplifyRange, - subset, - SemVer, - re: internalRe.re, - src: internalRe.src, - tokens: internalRe.t, - SEMVER_SPEC_VERSION: constants.SEMVER_SPEC_VERSION, - compareIdentifiers: identifiers.compareIdentifiers, - rcompareIdentifiers: identifiers.rcompareIdentifiers, -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/internal/constants.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/internal/constants.js deleted file mode 100644 index 4f0de59b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/internal/constants.js +++ /dev/null @@ -1,17 +0,0 @@ -// Note: this is the semver.org version of the spec that it implements -// Not necessarily the package version of this code. -const SEMVER_SPEC_VERSION = '2.0.0' - -const MAX_LENGTH = 256 -const MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || -/* istanbul ignore next */ 9007199254740991 - -// Max safe segment length for coercion. -const MAX_SAFE_COMPONENT_LENGTH = 16 - -module.exports = { - SEMVER_SPEC_VERSION, - MAX_LENGTH, - MAX_SAFE_INTEGER, - MAX_SAFE_COMPONENT_LENGTH, -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/internal/debug.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/internal/debug.js deleted file mode 100644 index 1c00e136..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/internal/debug.js +++ /dev/null @@ -1,9 +0,0 @@ -const debug = ( - typeof process === 'object' && - process.env && - process.env.NODE_DEBUG && - /\bsemver\b/i.test(process.env.NODE_DEBUG) -) ? (...args) => console.error('SEMVER', ...args) - : () => {} - -module.exports = debug diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/internal/identifiers.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/internal/identifiers.js deleted file mode 100644 index e612d0a3..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/internal/identifiers.js +++ /dev/null @@ -1,23 +0,0 @@ -const numeric = /^[0-9]+$/ -const compareIdentifiers = (a, b) => { - const anum = numeric.test(a) - const bnum = numeric.test(b) - - if (anum && bnum) { - a = +a - b = +b - } - - return a === b ? 0 - : (anum && !bnum) ? -1 - : (bnum && !anum) ? 1 - : a < b ? -1 - : 1 -} - -const rcompareIdentifiers = (a, b) => compareIdentifiers(b, a) - -module.exports = { - compareIdentifiers, - rcompareIdentifiers, -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/internal/parse-options.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/internal/parse-options.js deleted file mode 100644 index bbd9ec77..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/internal/parse-options.js +++ /dev/null @@ -1,11 +0,0 @@ -// parse out just the options we care about so we always get a consistent -// obj with keys in a consistent order. -const opts = ['includePrerelease', 'loose', 'rtl'] -const parseOptions = options => - !options ? {} - : typeof options !== 'object' ? { loose: true } - : opts.filter(k => options[k]).reduce((o, k) => { - o[k] = true - return o - }, {}) -module.exports = parseOptions diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/internal/re.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/internal/re.js deleted file mode 100644 index ed88398a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/internal/re.js +++ /dev/null @@ -1,182 +0,0 @@ -const { MAX_SAFE_COMPONENT_LENGTH } = require('./constants') -const debug = require('./debug') -exports = module.exports = {} - -// The actual regexps go on exports.re -const re = exports.re = [] -const src = exports.src = [] -const t = exports.t = {} -let R = 0 - -const createToken = (name, value, isGlobal) => { - const index = R++ - debug(name, index, value) - t[name] = index - src[index] = value - re[index] = new RegExp(value, isGlobal ? 'g' : undefined) -} - -// The following Regular Expressions can be used for tokenizing, -// validating, and parsing SemVer version strings. - -// ## Numeric Identifier -// A single `0`, or a non-zero digit followed by zero or more digits. - -createToken('NUMERICIDENTIFIER', '0|[1-9]\\d*') -createToken('NUMERICIDENTIFIERLOOSE', '[0-9]+') - -// ## Non-numeric Identifier -// Zero or more digits, followed by a letter or hyphen, and then zero or -// more letters, digits, or hyphens. - -createToken('NONNUMERICIDENTIFIER', '\\d*[a-zA-Z-][a-zA-Z0-9-]*') - -// ## Main Version -// Three dot-separated numeric identifiers. - -createToken('MAINVERSION', `(${src[t.NUMERICIDENTIFIER]})\\.` + - `(${src[t.NUMERICIDENTIFIER]})\\.` + - `(${src[t.NUMERICIDENTIFIER]})`) - -createToken('MAINVERSIONLOOSE', `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.` + - `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.` + - `(${src[t.NUMERICIDENTIFIERLOOSE]})`) - -// ## Pre-release Version Identifier -// A numeric identifier, or a non-numeric identifier. - -createToken('PRERELEASEIDENTIFIER', `(?:${src[t.NUMERICIDENTIFIER] -}|${src[t.NONNUMERICIDENTIFIER]})`) - -createToken('PRERELEASEIDENTIFIERLOOSE', `(?:${src[t.NUMERICIDENTIFIERLOOSE] -}|${src[t.NONNUMERICIDENTIFIER]})`) - -// ## Pre-release Version -// Hyphen, followed by one or more dot-separated pre-release version -// identifiers. - -createToken('PRERELEASE', `(?:-(${src[t.PRERELEASEIDENTIFIER] -}(?:\\.${src[t.PRERELEASEIDENTIFIER]})*))`) - -createToken('PRERELEASELOOSE', `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE] -}(?:\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`) - -// ## Build Metadata Identifier -// Any combination of digits, letters, or hyphens. - -createToken('BUILDIDENTIFIER', '[0-9A-Za-z-]+') - -// ## Build Metadata -// Plus sign, followed by one or more period-separated build metadata -// identifiers. - -createToken('BUILD', `(?:\\+(${src[t.BUILDIDENTIFIER] -}(?:\\.${src[t.BUILDIDENTIFIER]})*))`) - -// ## Full Version String -// A main version, followed optionally by a pre-release version and -// build metadata. - -// Note that the only major, minor, patch, and pre-release sections of -// the version string are capturing groups. The build metadata is not a -// capturing group, because it should not ever be used in version -// comparison. - -createToken('FULLPLAIN', `v?${src[t.MAINVERSION] -}${src[t.PRERELEASE]}?${ - src[t.BUILD]}?`) - -createToken('FULL', `^${src[t.FULLPLAIN]}$`) - -// like full, but allows v1.2.3 and =1.2.3, which people do sometimes. -// also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty -// common in the npm registry. -createToken('LOOSEPLAIN', `[v=\\s]*${src[t.MAINVERSIONLOOSE] -}${src[t.PRERELEASELOOSE]}?${ - src[t.BUILD]}?`) - -createToken('LOOSE', `^${src[t.LOOSEPLAIN]}$`) - -createToken('GTLT', '((?:<|>)?=?)') - -// Something like "2.*" or "1.2.x". -// Note that "x.x" is a valid xRange identifer, meaning "any version" -// Only the first item is strictly required. -createToken('XRANGEIDENTIFIERLOOSE', `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`) -createToken('XRANGEIDENTIFIER', `${src[t.NUMERICIDENTIFIER]}|x|X|\\*`) - -createToken('XRANGEPLAIN', `[v=\\s]*(${src[t.XRANGEIDENTIFIER]})` + - `(?:\\.(${src[t.XRANGEIDENTIFIER]})` + - `(?:\\.(${src[t.XRANGEIDENTIFIER]})` + - `(?:${src[t.PRERELEASE]})?${ - src[t.BUILD]}?` + - `)?)?`) - -createToken('XRANGEPLAINLOOSE', `[v=\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})` + - `(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` + - `(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` + - `(?:${src[t.PRERELEASELOOSE]})?${ - src[t.BUILD]}?` + - `)?)?`) - -createToken('XRANGE', `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAIN]}$`) -createToken('XRANGELOOSE', `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAINLOOSE]}$`) - -// Coercion. -// Extract anything that could conceivably be a part of a valid semver -createToken('COERCE', `${'(^|[^\\d])' + - '(\\d{1,'}${MAX_SAFE_COMPONENT_LENGTH}})` + - `(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?` + - `(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?` + - `(?:$|[^\\d])`) -createToken('COERCERTL', src[t.COERCE], true) - -// Tilde ranges. -// Meaning is "reasonably at or greater than" -createToken('LONETILDE', '(?:~>?)') - -createToken('TILDETRIM', `(\\s*)${src[t.LONETILDE]}\\s+`, true) -exports.tildeTrimReplace = '$1~' - -createToken('TILDE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`) -createToken('TILDELOOSE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`) - -// Caret ranges. -// Meaning is "at least and backwards compatible with" -createToken('LONECARET', '(?:\\^)') - -createToken('CARETTRIM', `(\\s*)${src[t.LONECARET]}\\s+`, true) -exports.caretTrimReplace = '$1^' - -createToken('CARET', `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`) -createToken('CARETLOOSE', `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`) - -// A simple gt/lt/eq thing, or just "" to indicate "any version" -createToken('COMPARATORLOOSE', `^${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]})$|^$`) -createToken('COMPARATOR', `^${src[t.GTLT]}\\s*(${src[t.FULLPLAIN]})$|^$`) - -// An expression to strip any whitespace between the gtlt and the thing -// it modifies, so that `> 1.2.3` ==> `>1.2.3` -createToken('COMPARATORTRIM', `(\\s*)${src[t.GTLT] -}\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true) -exports.comparatorTrimReplace = '$1$2$3' - -// Something like `1.2.3 - 1.2.4` -// Note that these all use the loose form, because they'll be -// checked against either the strict or loose comparator form -// later. -createToken('HYPHENRANGE', `^\\s*(${src[t.XRANGEPLAIN]})` + - `\\s+-\\s+` + - `(${src[t.XRANGEPLAIN]})` + - `\\s*$`) - -createToken('HYPHENRANGELOOSE', `^\\s*(${src[t.XRANGEPLAINLOOSE]})` + - `\\s+-\\s+` + - `(${src[t.XRANGEPLAINLOOSE]})` + - `\\s*$`) - -// Star ranges basically just allow anything at all. -createToken('STAR', '(<|>)?=?\\s*\\*') -// >=0.0.0 is like a star -createToken('GTE0', '^\\s*>=\\s*0\\.0\\.0\\s*$') -createToken('GTE0PRE', '^\\s*>=\\s*0\\.0\\.0-0\\s*$') diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/package.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/package.json deleted file mode 100644 index 72d3f66e..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/package.json +++ /dev/null @@ -1,86 +0,0 @@ -{ - "name": "semver", - "version": "7.3.8", - "description": "The semantic version parser used by npm.", - "main": "index.js", - "scripts": { - "test": "tap", - "snap": "tap", - "lint": "eslint \"**/*.js\"", - "postlint": "template-oss-check", - "lintfix": "npm run lint -- --fix", - "posttest": "npm run lint", - "template-oss-apply": "template-oss-apply --force" - }, - "devDependencies": { - "@npmcli/eslint-config": "^3.0.1", - "@npmcli/template-oss": "4.4.4", - "tap": "^16.0.0" - }, - "license": "ISC", - "repository": { - "type": "git", - "url": "https://github.com/npm/node-semver.git" - }, - "bin": { - "semver": "bin/semver.js" - }, - "files": [ - "bin/", - "lib/", - "classes/", - "functions/", - "internal/", - "ranges/", - "index.js", - "preload.js", - "range.bnf" - ], - "tap": { - "check-coverage": true, - "coverage-map": "map.js", - "nyc-arg": [ - "--exclude", - "tap-snapshots/**" - ] - }, - "engines": { - "node": ">=10" - }, - "dependencies": { - "lru-cache": "^6.0.0" - }, - "author": "GitHub Inc.", - "templateOSS": { - "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "4.4.4", - "engines": ">=10", - "content": "./scripts", - "ciVersions": [ - "10.0.0", - "10.x", - "12.x", - "14.x", - "16.x", - "18.x" - ], - "distPaths": [ - "classes/", - "functions/", - "internal/", - "ranges/", - "index.js", - "preload.js", - "range.bnf" - ], - "allowPaths": [ - "/classes/", - "/functions/", - "/internal/", - "/ranges/", - "/index.js", - "/preload.js", - "/range.bnf" - ] - } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/preload.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/preload.js deleted file mode 100644 index 947cd4f7..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/preload.js +++ /dev/null @@ -1,2 +0,0 @@ -// XXX remove in v8 or beyond -module.exports = require('./index.js') diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/range.bnf b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/range.bnf deleted file mode 100644 index d4c6ae0d..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/range.bnf +++ /dev/null @@ -1,16 +0,0 @@ -range-set ::= range ( logical-or range ) * -logical-or ::= ( ' ' ) * '||' ( ' ' ) * -range ::= hyphen | simple ( ' ' simple ) * | '' -hyphen ::= partial ' - ' partial -simple ::= primitive | partial | tilde | caret -primitive ::= ( '<' | '>' | '>=' | '<=' | '=' ) partial -partial ::= xr ( '.' xr ( '.' xr qualifier ? )? )? -xr ::= 'x' | 'X' | '*' | nr -nr ::= '0' | [1-9] ( [0-9] ) * -tilde ::= '~' partial -caret ::= '^' partial -qualifier ::= ( '-' pre )? ( '+' build )? -pre ::= parts -build ::= parts -parts ::= part ( '.' part ) * -part ::= nr | [-0-9A-Za-z]+ diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/ranges/gtr.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/ranges/gtr.js deleted file mode 100644 index db7e3559..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/ranges/gtr.js +++ /dev/null @@ -1,4 +0,0 @@ -// Determine if version is greater than all the versions possible in the range. -const outside = require('./outside') -const gtr = (version, range, options) => outside(version, range, '>', options) -module.exports = gtr diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/ranges/intersects.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/ranges/intersects.js deleted file mode 100644 index 3d1a6f31..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/ranges/intersects.js +++ /dev/null @@ -1,7 +0,0 @@ -const Range = require('../classes/range') -const intersects = (r1, r2, options) => { - r1 = new Range(r1, options) - r2 = new Range(r2, options) - return r1.intersects(r2) -} -module.exports = intersects diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/ranges/ltr.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/ranges/ltr.js deleted file mode 100644 index 528a885e..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/ranges/ltr.js +++ /dev/null @@ -1,4 +0,0 @@ -const outside = require('./outside') -// Determine if version is less than all the versions possible in the range -const ltr = (version, range, options) => outside(version, range, '<', options) -module.exports = ltr diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/ranges/max-satisfying.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/ranges/max-satisfying.js deleted file mode 100644 index 6e3d993c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/ranges/max-satisfying.js +++ /dev/null @@ -1,25 +0,0 @@ -const SemVer = require('../classes/semver') -const Range = require('../classes/range') - -const maxSatisfying = (versions, range, options) => { - let max = null - let maxSV = null - let rangeObj = null - try { - rangeObj = new Range(range, options) - } catch (er) { - return null - } - versions.forEach((v) => { - if (rangeObj.test(v)) { - // satisfies(v, range, options) - if (!max || maxSV.compare(v) === -1) { - // compare(max, v, true) - max = v - maxSV = new SemVer(max, options) - } - } - }) - return max -} -module.exports = maxSatisfying diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/ranges/min-satisfying.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/ranges/min-satisfying.js deleted file mode 100644 index 9b60974e..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/ranges/min-satisfying.js +++ /dev/null @@ -1,24 +0,0 @@ -const SemVer = require('../classes/semver') -const Range = require('../classes/range') -const minSatisfying = (versions, range, options) => { - let min = null - let minSV = null - let rangeObj = null - try { - rangeObj = new Range(range, options) - } catch (er) { - return null - } - versions.forEach((v) => { - if (rangeObj.test(v)) { - // satisfies(v, range, options) - if (!min || minSV.compare(v) === 1) { - // compare(min, v, true) - min = v - minSV = new SemVer(min, options) - } - } - }) - return min -} -module.exports = minSatisfying diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/ranges/min-version.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/ranges/min-version.js deleted file mode 100644 index 350e1f78..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/ranges/min-version.js +++ /dev/null @@ -1,61 +0,0 @@ -const SemVer = require('../classes/semver') -const Range = require('../classes/range') -const gt = require('../functions/gt') - -const minVersion = (range, loose) => { - range = new Range(range, loose) - - let minver = new SemVer('0.0.0') - if (range.test(minver)) { - return minver - } - - minver = new SemVer('0.0.0-0') - if (range.test(minver)) { - return minver - } - - minver = null - for (let i = 0; i < range.set.length; ++i) { - const comparators = range.set[i] - - let setMin = null - comparators.forEach((comparator) => { - // Clone to avoid manipulating the comparator's semver object. - const compver = new SemVer(comparator.semver.version) - switch (comparator.operator) { - case '>': - if (compver.prerelease.length === 0) { - compver.patch++ - } else { - compver.prerelease.push(0) - } - compver.raw = compver.format() - /* fallthrough */ - case '': - case '>=': - if (!setMin || gt(compver, setMin)) { - setMin = compver - } - break - case '<': - case '<=': - /* Ignore maximum versions */ - break - /* istanbul ignore next */ - default: - throw new Error(`Unexpected operation: ${comparator.operator}`) - } - }) - if (setMin && (!minver || gt(minver, setMin))) { - minver = setMin - } - } - - if (minver && range.test(minver)) { - return minver - } - - return null -} -module.exports = minVersion diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/ranges/outside.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/ranges/outside.js deleted file mode 100644 index ae99b10a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/ranges/outside.js +++ /dev/null @@ -1,80 +0,0 @@ -const SemVer = require('../classes/semver') -const Comparator = require('../classes/comparator') -const { ANY } = Comparator -const Range = require('../classes/range') -const satisfies = require('../functions/satisfies') -const gt = require('../functions/gt') -const lt = require('../functions/lt') -const lte = require('../functions/lte') -const gte = require('../functions/gte') - -const outside = (version, range, hilo, options) => { - version = new SemVer(version, options) - range = new Range(range, options) - - let gtfn, ltefn, ltfn, comp, ecomp - switch (hilo) { - case '>': - gtfn = gt - ltefn = lte - ltfn = lt - comp = '>' - ecomp = '>=' - break - case '<': - gtfn = lt - ltefn = gte - ltfn = gt - comp = '<' - ecomp = '<=' - break - default: - throw new TypeError('Must provide a hilo val of "<" or ">"') - } - - // If it satisfies the range it is not outside - if (satisfies(version, range, options)) { - return false - } - - // From now on, variable terms are as if we're in "gtr" mode. - // but note that everything is flipped for the "ltr" function. - - for (let i = 0; i < range.set.length; ++i) { - const comparators = range.set[i] - - let high = null - let low = null - - comparators.forEach((comparator) => { - if (comparator.semver === ANY) { - comparator = new Comparator('>=0.0.0') - } - high = high || comparator - low = low || comparator - if (gtfn(comparator.semver, high.semver, options)) { - high = comparator - } else if (ltfn(comparator.semver, low.semver, options)) { - low = comparator - } - }) - - // If the edge version comparator has a operator then our version - // isn't outside it - if (high.operator === comp || high.operator === ecomp) { - return false - } - - // If the lowest version comparator has an operator and our version - // is less than it then it isn't higher than the range - if ((!low.operator || low.operator === comp) && - ltefn(version, low.semver)) { - return false - } else if (low.operator === ecomp && ltfn(version, low.semver)) { - return false - } - } - return true -} - -module.exports = outside diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/ranges/simplify.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/ranges/simplify.js deleted file mode 100644 index 618d5b62..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/ranges/simplify.js +++ /dev/null @@ -1,47 +0,0 @@ -// given a set of versions and a range, create a "simplified" range -// that includes the same versions that the original range does -// If the original range is shorter than the simplified one, return that. -const satisfies = require('../functions/satisfies.js') -const compare = require('../functions/compare.js') -module.exports = (versions, range, options) => { - const set = [] - let first = null - let prev = null - const v = versions.sort((a, b) => compare(a, b, options)) - for (const version of v) { - const included = satisfies(version, range, options) - if (included) { - prev = version - if (!first) { - first = version - } - } else { - if (prev) { - set.push([first, prev]) - } - prev = null - first = null - } - } - if (first) { - set.push([first, null]) - } - - const ranges = [] - for (const [min, max] of set) { - if (min === max) { - ranges.push(min) - } else if (!max && min === v[0]) { - ranges.push('*') - } else if (!max) { - ranges.push(`>=${min}`) - } else if (min === v[0]) { - ranges.push(`<=${max}`) - } else { - ranges.push(`${min} - ${max}`) - } - } - const simplified = ranges.join(' || ') - const original = typeof range.raw === 'string' ? range.raw : String(range) - return simplified.length < original.length ? simplified : range -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/ranges/subset.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/ranges/subset.js deleted file mode 100644 index e0dea43c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/ranges/subset.js +++ /dev/null @@ -1,244 +0,0 @@ -const Range = require('../classes/range.js') -const Comparator = require('../classes/comparator.js') -const { ANY } = Comparator -const satisfies = require('../functions/satisfies.js') -const compare = require('../functions/compare.js') - -// Complex range `r1 || r2 || ...` is a subset of `R1 || R2 || ...` iff: -// - Every simple range `r1, r2, ...` is a null set, OR -// - Every simple range `r1, r2, ...` which is not a null set is a subset of -// some `R1, R2, ...` -// -// Simple range `c1 c2 ...` is a subset of simple range `C1 C2 ...` iff: -// - If c is only the ANY comparator -// - If C is only the ANY comparator, return true -// - Else if in prerelease mode, return false -// - else replace c with `[>=0.0.0]` -// - If C is only the ANY comparator -// - if in prerelease mode, return true -// - else replace C with `[>=0.0.0]` -// - Let EQ be the set of = comparators in c -// - If EQ is more than one, return true (null set) -// - Let GT be the highest > or >= comparator in c -// - Let LT be the lowest < or <= comparator in c -// - If GT and LT, and GT.semver > LT.semver, return true (null set) -// - If any C is a = range, and GT or LT are set, return false -// - If EQ -// - If GT, and EQ does not satisfy GT, return true (null set) -// - If LT, and EQ does not satisfy LT, return true (null set) -// - If EQ satisfies every C, return true -// - Else return false -// - If GT -// - If GT.semver is lower than any > or >= comp in C, return false -// - If GT is >=, and GT.semver does not satisfy every C, return false -// - If GT.semver has a prerelease, and not in prerelease mode -// - If no C has a prerelease and the GT.semver tuple, return false -// - If LT -// - If LT.semver is greater than any < or <= comp in C, return false -// - If LT is <=, and LT.semver does not satisfy every C, return false -// - If GT.semver has a prerelease, and not in prerelease mode -// - If no C has a prerelease and the LT.semver tuple, return false -// - Else return true - -const subset = (sub, dom, options = {}) => { - if (sub === dom) { - return true - } - - sub = new Range(sub, options) - dom = new Range(dom, options) - let sawNonNull = false - - OUTER: for (const simpleSub of sub.set) { - for (const simpleDom of dom.set) { - const isSub = simpleSubset(simpleSub, simpleDom, options) - sawNonNull = sawNonNull || isSub !== null - if (isSub) { - continue OUTER - } - } - // the null set is a subset of everything, but null simple ranges in - // a complex range should be ignored. so if we saw a non-null range, - // then we know this isn't a subset, but if EVERY simple range was null, - // then it is a subset. - if (sawNonNull) { - return false - } - } - return true -} - -const simpleSubset = (sub, dom, options) => { - if (sub === dom) { - return true - } - - if (sub.length === 1 && sub[0].semver === ANY) { - if (dom.length === 1 && dom[0].semver === ANY) { - return true - } else if (options.includePrerelease) { - sub = [new Comparator('>=0.0.0-0')] - } else { - sub = [new Comparator('>=0.0.0')] - } - } - - if (dom.length === 1 && dom[0].semver === ANY) { - if (options.includePrerelease) { - return true - } else { - dom = [new Comparator('>=0.0.0')] - } - } - - const eqSet = new Set() - let gt, lt - for (const c of sub) { - if (c.operator === '>' || c.operator === '>=') { - gt = higherGT(gt, c, options) - } else if (c.operator === '<' || c.operator === '<=') { - lt = lowerLT(lt, c, options) - } else { - eqSet.add(c.semver) - } - } - - if (eqSet.size > 1) { - return null - } - - let gtltComp - if (gt && lt) { - gtltComp = compare(gt.semver, lt.semver, options) - if (gtltComp > 0) { - return null - } else if (gtltComp === 0 && (gt.operator !== '>=' || lt.operator !== '<=')) { - return null - } - } - - // will iterate one or zero times - for (const eq of eqSet) { - if (gt && !satisfies(eq, String(gt), options)) { - return null - } - - if (lt && !satisfies(eq, String(lt), options)) { - return null - } - - for (const c of dom) { - if (!satisfies(eq, String(c), options)) { - return false - } - } - - return true - } - - let higher, lower - let hasDomLT, hasDomGT - // if the subset has a prerelease, we need a comparator in the superset - // with the same tuple and a prerelease, or it's not a subset - let needDomLTPre = lt && - !options.includePrerelease && - lt.semver.prerelease.length ? lt.semver : false - let needDomGTPre = gt && - !options.includePrerelease && - gt.semver.prerelease.length ? gt.semver : false - // exception: <1.2.3-0 is the same as <1.2.3 - if (needDomLTPre && needDomLTPre.prerelease.length === 1 && - lt.operator === '<' && needDomLTPre.prerelease[0] === 0) { - needDomLTPre = false - } - - for (const c of dom) { - hasDomGT = hasDomGT || c.operator === '>' || c.operator === '>=' - hasDomLT = hasDomLT || c.operator === '<' || c.operator === '<=' - if (gt) { - if (needDomGTPre) { - if (c.semver.prerelease && c.semver.prerelease.length && - c.semver.major === needDomGTPre.major && - c.semver.minor === needDomGTPre.minor && - c.semver.patch === needDomGTPre.patch) { - needDomGTPre = false - } - } - if (c.operator === '>' || c.operator === '>=') { - higher = higherGT(gt, c, options) - if (higher === c && higher !== gt) { - return false - } - } else if (gt.operator === '>=' && !satisfies(gt.semver, String(c), options)) { - return false - } - } - if (lt) { - if (needDomLTPre) { - if (c.semver.prerelease && c.semver.prerelease.length && - c.semver.major === needDomLTPre.major && - c.semver.minor === needDomLTPre.minor && - c.semver.patch === needDomLTPre.patch) { - needDomLTPre = false - } - } - if (c.operator === '<' || c.operator === '<=') { - lower = lowerLT(lt, c, options) - if (lower === c && lower !== lt) { - return false - } - } else if (lt.operator === '<=' && !satisfies(lt.semver, String(c), options)) { - return false - } - } - if (!c.operator && (lt || gt) && gtltComp !== 0) { - return false - } - } - - // if there was a < or >, and nothing in the dom, then must be false - // UNLESS it was limited by another range in the other direction. - // Eg, >1.0.0 <1.0.1 is still a subset of <2.0.0 - if (gt && hasDomLT && !lt && gtltComp !== 0) { - return false - } - - if (lt && hasDomGT && !gt && gtltComp !== 0) { - return false - } - - // we needed a prerelease range in a specific tuple, but didn't get one - // then this isn't a subset. eg >=1.2.3-pre is not a subset of >=1.0.0, - // because it includes prereleases in the 1.2.3 tuple - if (needDomGTPre || needDomLTPre) { - return false - } - - return true -} - -// >=1.2.3 is lower than >1.2.3 -const higherGT = (a, b, options) => { - if (!a) { - return b - } - const comp = compare(a.semver, b.semver, options) - return comp > 0 ? a - : comp < 0 ? b - : b.operator === '>' && a.operator === '>=' ? b - : a -} - -// <=1.2.3 is higher than <1.2.3 -const lowerLT = (a, b, options) => { - if (!a) { - return b - } - const comp = compare(a.semver, b.semver, options) - return comp < 0 ? a - : comp > 0 ? b - : b.operator === '<' && a.operator === '<=' ? b - : a -} - -module.exports = subset diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/ranges/to-comparators.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/ranges/to-comparators.js deleted file mode 100644 index 6c8bc7e6..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/ranges/to-comparators.js +++ /dev/null @@ -1,8 +0,0 @@ -const Range = require('../classes/range') - -// Mostly just for testing and legacy API reasons -const toComparators = (range, options) => - new Range(range, options).set - .map(comp => comp.map(c => c.value).join(' ').trim().split(' ')) - -module.exports = toComparators diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/ranges/valid.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/ranges/valid.js deleted file mode 100644 index 365f3568..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/node_modules/semver/ranges/valid.js +++ /dev/null @@ -1,11 +0,0 @@ -const Range = require('../classes/range') -const validRange = (range, options) => { - try { - // Return '*' instead of '' so that truthiness works. - // This will throw if it's invalid anyway - return new Range(range, options).range || '*' - } catch (er) { - return null - } -} -module.exports = validRange diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/package.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/package.json deleted file mode 100644 index 29a0c104..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/package.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "name": "protobufjs-cli", - "description": "Translates between file formats and generates static code as well as TypeScript definitions.", - "version": "1.0.2", - "author": "Daniel Wirtz ", - "repository": { - "type": "git", - "url": "https://github.com/protobufjs/protobuf.js.git" - }, - "engines": { - "node": ">=12.0.0" - }, - "license": "BSD-3-Clause", - "main": "index.js", - "types": "index.d.ts", - "bin": { - "pbjs": "bin/pbjs", - "pbts": "bin/pbts" - }, - "peerDependencies": { - "protobufjs": "^7.0.0" - }, - "dependencies": { - "chalk": "^4.0.0", - "escodegen": "^1.13.0", - "espree": "^9.0.0", - "estraverse": "^5.1.0", - "glob": "^8.0.0", - "jsdoc": "^3.6.3", - "minimist": "^1.2.0", - "semver": "^7.1.2", - "tmp": "^0.2.1", - "uglify-js": "^3.7.7" - }, - "devDependencies": { - "protobufjs": "file:.." - } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/pbjs.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/pbjs.d.ts deleted file mode 100644 index ead1f3c5..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/pbjs.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -type pbjsCallback = (err: Error|null, output?: string) => void; - -/** - * Runs pbjs programmatically. - * @param {string[]} args Command line arguments - * @param {function(?Error, string=)} [callback] Optional completion callback - * @returns {number|undefined} Exit code, if known - */ -export function main(args: string[], callback?: pbjsCallback): number|undefined; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/pbjs.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/pbjs.js deleted file mode 100644 index 23750a4a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/pbjs.js +++ /dev/null @@ -1,335 +0,0 @@ -"use strict"; -var path = require("path"), - fs = require("fs"), - minimist = require("minimist"), - chalk = require("chalk"), - pkg = require("./package.json"), - util = require("./util"), - glob = require("glob"), - protobuf = require("protobufjs"); - -var targets = util.requireAll("./targets"); - -/** - * Runs pbjs programmatically. - * @param {string[]} args Command line arguments - * @param {function(?Error, string=)} [callback] Optional completion callback - * @returns {number|undefined} Exit code, if known - */ -exports.main = function main(args, callback) { - var lintDefault = "eslint-disable " + [ - "block-scoped-var", - "id-length", - "no-control-regex", - "no-magic-numbers", - "no-prototype-builtins", - "no-redeclare", - "no-shadow", - "no-var", - "sort-vars" - ].join(", "); - var argv = minimist(args, { - alias: { - target: "t", - out: "o", - path: "p", - wrap: "w", - root: "r", - lint: "l", - // backward compatibility: - "force-long": "strict-long", - "force-message": "strict-message" - }, - string: [ "target", "out", "path", "wrap", "dependency", "root", "lint" ], - boolean: [ "create", "encode", "decode", "verify", "convert", "delimited", "typeurl", "beautify", "comments", "service", "es6", "sparse", "keep-case", "alt-comment", "force-long", "force-number", "force-enum-string", "force-message", "null-defaults" ], - default: { - target: "json", - create: true, - encode: true, - decode: true, - verify: true, - convert: true, - delimited: true, - typeurl: true, - beautify: true, - comments: true, - service: true, - es6: null, - lint: lintDefault, - "keep-case": false, - "alt-comment": false, - "force-long": false, - "force-number": false, - "force-enum-string": false, - "force-message": false, - "null-defaults": false, - } - }); - - var target = targets[argv.target], - files = argv._, - paths = typeof argv.path === "string" ? [ argv.path ] : argv.path || []; - - // alias hyphen args in camel case - Object.keys(argv).forEach(function(key) { - var camelKey = key.replace(/-([a-z])/g, function($0, $1) { return $1.toUpperCase(); }); - if (camelKey !== key) - argv[camelKey] = argv[key]; - }); - - // protobuf.js package directory contains additional, otherwise non-bundled google types - paths.push(path.relative(process.cwd(), path.join(__dirname, "..")) || "."); - - if (!files.length) { - var descs = Object.keys(targets).filter(function(key) { return !targets[key].private; }).map(function(key) { - return " " + util.pad(key, 14, true) + targets[key].description; - }); - if (callback) - callback(Error("usage")); // eslint-disable-line callback-return - else - process.stderr.write([ - "protobuf.js v" + pkg.version + " CLI for JavaScript", - "", - chalk.bold.white("Translates between file formats and generates static code."), - "", - " -t, --target Specifies the target format. Also accepts a path to require a custom target.", - "", - descs.join("\n"), - "", - " -p, --path Adds a directory to the include path.", - "", - " -o, --out Saves to a file instead of writing to stdout.", - "", - " --sparse Exports only those types referenced from a main file (experimental).", - "", - chalk.bold.gray(" Module targets only:"), - "", - " -w, --wrap Specifies the wrapper to use. Also accepts a path to require a custom wrapper.", - "", - " default Default wrapper supporting both CommonJS and AMD", - " commonjs CommonJS wrapper", - " amd AMD wrapper", - " es6 ES6 wrapper (implies --es6)", - " closure A closure adding to protobuf.roots where protobuf is a global", - "", - " --dependency Specifies which version of protobuf to require. Accepts any valid module id", - "", - " -r, --root Specifies an alternative protobuf.roots name.", - "", - " -l, --lint Linter configuration. Defaults to protobuf.js-compatible rules:", - "", - " " + lintDefault, - "", - " --es6 Enables ES6 syntax (const/let instead of var)", - "", - chalk.bold.gray(" Proto sources only:"), - "", - " --keep-case Keeps field casing instead of converting to camel case.", - " --alt-comment Turns on an alternate comment parsing mode that preserves more comments.", - "", - chalk.bold.gray(" Static targets only:"), - "", - " --no-create Does not generate create functions used for reflection compatibility.", - " --no-encode Does not generate encode functions.", - " --no-decode Does not generate decode functions.", - " --no-verify Does not generate verify functions.", - " --no-convert Does not generate convert functions like from/toObject", - " --no-delimited Does not generate delimited encode/decode functions.", - " --no-typeurl Does not generate getTypeUrl function.", - " --no-beautify Does not beautify generated code.", - " --no-comments Does not output any JSDoc comments.", - " --no-service Does not output service classes.", - "", - " --force-long Enforces the use of 'Long' for s-/u-/int64 and s-/fixed64 fields.", - " --force-number Enforces the use of 'number' for s-/u-/int64 and s-/fixed64 fields.", - " --force-message Enforces the use of message instances instead of plain objects.", - "", - " --null-defaults Default value for optional fields is null instead of zero value.", - "", - "usage: " + chalk.bold.green("pbjs") + " [options] file1.proto file2.json ..." + chalk.gray(" (or pipe) ") + "other | " + chalk.bold.green("pbjs") + " [options] -", - "" - ].join("\n")); - return 1; - } - - if (typeof argv["strict-long"] === "boolean") - argv["force-long"] = argv["strict-long"]; - - // Resolve glob expressions - for (var i = 0; i < files.length;) { - if (glob.hasMagic(files[i])) { - var matches = glob.sync(files[i]); - Array.prototype.splice.apply(files, [i, 1].concat(matches)); - i += matches.length; - } else - ++i; - } - - // Require custom target - if (!target) - target = require(path.resolve(process.cwd(), argv.target)); - - var root = new protobuf.Root(); - - var mainFiles = []; - - // Search include paths when resolving imports - root.resolvePath = function pbjsResolvePath(origin, target) { - var normOrigin = protobuf.util.path.normalize(origin), - normTarget = protobuf.util.path.normalize(target); - if (!normOrigin) - mainFiles.push(normTarget); - - var resolved = protobuf.util.path.resolve(normOrigin, normTarget, true); - var idx = resolved.lastIndexOf("google/protobuf/"); - if (idx > -1) { - var altname = resolved.substring(idx); - if (altname in protobuf.common) - resolved = altname; - } - - if (fs.existsSync(resolved)) - return resolved; - - for (var i = 0; i < paths.length; ++i) { - var iresolved = protobuf.util.path.resolve(paths[i] + "/", target); - if (fs.existsSync(iresolved)) - return iresolved; - } - - return resolved; - }; - - // `--wrap es6` implies `--es6` but not the other way around. You can still use e.g. `--es6 --wrap commonjs` - if (argv.wrap === "es6") { - argv.es6 = true; - } - - var parseOptions = { - "keepCase": argv["keep-case"] || false, - "alternateCommentMode": argv["alt-comment"] || false, - }; - - // Read from stdin - if (files.length === 1 && files[0] === "-") { - var data = []; - process.stdin.on("data", function(chunk) { - data.push(chunk); - }); - process.stdin.on("end", function() { - var source = Buffer.concat(data).toString("utf8"); - try { - if (source.charAt(0) !== "{") { - protobuf.parse.filename = "-"; - protobuf.parse(source, root, parseOptions); - } else { - var json = JSON.parse(source); - root.setOptions(json.options).addJSON(json); - } - callTarget(); - } catch (err) { - if (callback) { - callback(err); - return; - } - throw err; - } - }); - - // Load from disk - } else { - try { - root.loadSync(files, parseOptions).resolveAll(); // sync is deterministic while async is not - if (argv.sparse) - sparsify(root); - callTarget(); - } catch (err) { - if (callback) { - callback(err); - return undefined; - } - throw err; - } - } - - function markReferenced(tobj) { - tobj.referenced = true; - // also mark a type's fields and oneofs - if (tobj.fieldsArray) - tobj.fieldsArray.forEach(function(fobj) { - fobj.referenced = true; - }); - if (tobj.oneofsArray) - tobj.oneofsArray.forEach(function(oobj) { - oobj.referenced = true; - }); - // also mark an extension field's extended type, but not its (other) fields - if (tobj.extensionField) - tobj.extensionField.parent.referenced = true; - } - - function sparsify(root) { - - // 1. mark directly or indirectly referenced objects - util.traverse(root, function(obj) { - if (!obj.filename) - return; - if (mainFiles.indexOf(obj.filename) > -1) - util.traverseResolved(obj, markReferenced); - }); - - // 2. empty unreferenced objects - util.traverse(root, function(obj) { - var parent = obj.parent; - if (!parent || obj.referenced) // root or referenced - return; - // remove unreferenced namespaces - if (obj instanceof protobuf.Namespace) { - var hasReferenced = false; - util.traverse(obj, function(iobj) { - if (iobj.referenced) - hasReferenced = true; - }); - if (hasReferenced) { // replace with plain namespace if a namespace subclass - if (obj instanceof protobuf.Type || obj instanceof protobuf.Service) { - var robj = new protobuf.Namespace(obj.name, obj.options); - robj.nested = obj.nested; - parent.add(robj); - } - } else // remove completely if nothing inside is referenced - parent.remove(obj); - - // remove everything else unreferenced - } else if (!(obj instanceof protobuf.Namespace)) - parent.remove(obj); - }); - - // 3. validate that everything is fine - root.resolveAll(); - } - - function callTarget() { - target(root, argv, function targetCallback(err, output) { - if (err) { - if (callback) - return callback(err); - throw err; - } - try { - if (argv.out) - fs.writeFileSync(argv.out, output, { encoding: "utf8" }); - else if (!callback) - process.stdout.write(output, "utf8"); - return callback - ? callback(null, output) - : undefined; - } catch (err) { - if (callback) - return callback(err); - throw err; - } - }); - } - - return undefined; -}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/pbts.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/pbts.d.ts deleted file mode 100644 index 35db28c0..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/pbts.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -type pbtsCallback = (err: Error|null, output?: string) => void; - -/** - * Runs pbts programmatically. - * @param {string[]} args Command line arguments - * @param {function(?Error, string=)} [callback] Optional completion callback - * @returns {number|undefined} Exit code, if known - */ -export function main(args: string[], callback?: pbtsCallback): number|undefined; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/pbts.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/pbts.js deleted file mode 100644 index ffaf0c6c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/pbts.js +++ /dev/null @@ -1,195 +0,0 @@ -"use strict"; -var child_process = require("child_process"), - path = require("path"), - fs = require("fs"), - pkg = require("./package.json"), - minimist = require("minimist"), - chalk = require("chalk"), - glob = require("glob"), - tmp = require("tmp"); - -/** - * Runs pbts programmatically. - * @param {string[]} args Command line arguments - * @param {function(?Error, string=)} [callback] Optional completion callback - * @returns {number|undefined} Exit code, if known - */ -exports.main = function(args, callback) { - var argv = minimist(args, { - alias: { - name: "n", - out : "o", - main: "m", - global: "g", - import: "i" - }, - string: [ "name", "out", "global", "import" ], - boolean: [ "comments", "main" ], - default: { - comments: true, - main: false - } - }); - - var files = argv._; - - if (!files.length) { - if (callback) - callback(Error("usage")); // eslint-disable-line callback-return - else - process.stderr.write([ - "protobuf.js v" + pkg.version + " CLI for TypeScript", - "", - chalk.bold.white("Generates TypeScript definitions from annotated JavaScript files."), - "", - " -o, --out Saves to a file instead of writing to stdout.", - "", - " -g, --global Name of the global object in browser environments, if any.", - "", - " -i, --import Comma delimited list of imports. Local names will equal camelCase of the basename.", - "", - " --no-comments Does not output any JSDoc comments.", - "", - chalk.bold.gray(" Internal flags:"), - "", - " -n, --name Wraps everything in a module of the specified name.", - "", - " -m, --main Whether building the main library without any imports.", - "", - "usage: " + chalk.bold.green("pbts") + " [options] file1.js file2.js ..." + chalk.bold.gray(" (or) ") + "other | " + chalk.bold.green("pbts") + " [options] -", - "" - ].join("\n")); - return 1; - } - - // Resolve glob expressions - for (var i = 0; i < files.length;) { - if (glob.hasMagic(files[i])) { - var matches = glob.sync(files[i]); - Array.prototype.splice.apply(files, [i, 1].concat(matches)); - i += matches.length; - } else - ++i; - } - - var cleanup = []; - - // Read from stdin (to a temporary file) - if (files.length === 1 && files[0] === "-") { - var data = []; - process.stdin.on("data", function(chunk) { - data.push(chunk); - }); - process.stdin.on("end", function() { - files[0] = tmp.tmpNameSync() + ".js"; - fs.writeFileSync(files[0], Buffer.concat(data)); - cleanup.push(files[0]); - callJsdoc(); - }); - - // Load from disk - } else { - callJsdoc(); - } - - function callJsdoc() { - - // There is no proper API for jsdoc, so this executes the CLI and pipes the output - var basedir = path.join(__dirname, "."); - var moduleName = argv.name || "null"; - var nodePath = process.execPath; - var cmd = "\"" + nodePath + "\" \"" + require.resolve("jsdoc/jsdoc.js") + "\" -c \"" + path.join(basedir, "lib", "tsd-jsdoc.json") + "\" -q \"module=" + encodeURIComponent(moduleName) + "&comments=" + Boolean(argv.comments) + "\" " + files.map(function(file) { return "\"" + file + "\""; }).join(" "); - var child = child_process.exec(cmd, { - cwd: process.cwd(), - argv0: "node", - stdio: "pipe", - maxBuffer: 1 << 24 // 16mb - }); - var out = []; - var ended = false; - var closed = false; - child.stdout.on("data", function(data) { - out.push(data); - }); - child.stdout.on("end", function() { - if (closed) finish(); - else ended = true; - }); - child.stderr.pipe(process.stderr); - child.on("close", function(code) { - // clean up temporary files, no matter what - try { cleanup.forEach(fs.unlinkSync); } catch(e) {/**/} cleanup = []; - - if (code) { - out = out.join("").replace(/\s*JSDoc \d+\.\d+\.\d+ [^$]+/, ""); - process.stderr.write(out); - var err = Error("code " + code); - if (callback) - return callback(err); - throw err; - } - - if (ended) return finish(); - closed = true; - return undefined; - }); - - function getImportName(importItem) { - return path.basename(importItem, ".js").replace(/([-_~.+]\w)/g, function(match) { - return match[1].toUpperCase(); - }); - } - - function finish() { - var output = []; - if (argv.main) - output.push( - "// DO NOT EDIT! This is a generated file. Edit the JSDoc in src/*.js instead and run 'npm run build:types'.", - "" - ); - if (argv.global) - output.push( - "export as namespace " + argv.global + ";", - "" - ); - - if (!argv.main) { - // Ensure we have a usable array of imports - var importArray = typeof argv.import === "string" ? argv.import.split(",") : argv.import || []; - - // Build an object of imports and paths - var imports = { - $protobuf: "protobufjs" - }; - importArray.forEach(function(importItem) { - imports[getImportName(importItem)] = importItem; - }); - - // Write out the imports - Object.keys(imports).forEach(function(key) { - output.push("import * as " + key + " from \"" + imports[key] + "\";"); - }); - - output.push("import Long = require(\"long\");"); - } - - output = output.join("\n") + "\n" + out.join(""); - - try { - if (argv.out) - fs.writeFileSync(argv.out, output, { encoding: "utf8" }); - else if (!callback) - process.stdout.write(output, "utf8"); - return callback - ? callback(null, output) - : undefined; - } catch (err) { - if (callback) - return callback(err); - throw err; - } - } - } - - return undefined; -}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/scripts/prepublish.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/scripts/prepublish.js deleted file mode 100644 index dc38f75c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/scripts/prepublish.js +++ /dev/null @@ -1,13 +0,0 @@ -"use strict"; - -var path = require("path"), - fs = require("fs"); - -// ensure LF on bin files -[ - path.join(__dirname, "..", "bin", "pbjs"), - path.join(__dirname, "..", "bin", "pbts") -] -.forEach(function(file) { - fs.writeFileSync(file, fs.readFileSync(file).toString("utf8").replace(/\r?\n/g, "\n"), "utf8"); -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/targets/json-module.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/targets/json-module.js deleted file mode 100644 index b879026c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/targets/json-module.js +++ /dev/null @@ -1,38 +0,0 @@ -"use strict"; -module.exports = json_module; - -var util = require("../util"); - -var protobuf = require("protobufjs"); - -json_module.description = "JSON representation as a module"; - -function jsonSafeProp(json) { - return json.replace(/^( +)"(\w+)":/mg, function($0, $1, $2) { - return protobuf.util.safeProp($2).charAt(0) === "." - ? $1 + $2 + ":" - : $0; - }); -} - -function json_module(root, options, callback) { - try { - var rootProp = protobuf.util.safeProp(options.root || "default"); - var output = [ - (options.es6 ? "const" : "var") + " $root = ($protobuf.roots" + rootProp + " || ($protobuf.roots" + rootProp + " = new $protobuf.Root()))\n" - ]; - if (root.options) { - var optionsJson = jsonSafeProp(JSON.stringify(root.options, null, 2)); - output.push(".setOptions(" + optionsJson + ")\n"); - } - var json = jsonSafeProp(JSON.stringify(root.nested, null, 2).trim()); - output.push(".addJSON(" + json + ");"); - output = util.wrap(output.join(""), protobuf.util.merge({ dependency: "protobufjs/light" }, options)); - process.nextTick(function() { - callback(null, output); - }); - } catch (e) { - return callback(e); - } - return undefined; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/targets/json.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/targets/json.js deleted file mode 100644 index 70253723..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/targets/json.js +++ /dev/null @@ -1,8 +0,0 @@ -"use strict"; -module.exports = json_target; - -json_target.description = "JSON representation"; - -function json_target(root, options, callback) { - callback(null, JSON.stringify(root, null, 2)); -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/targets/proto.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/targets/proto.js deleted file mode 100644 index 74abd5a1..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/targets/proto.js +++ /dev/null @@ -1,326 +0,0 @@ -"use strict"; -module.exports = proto_target; - -proto_target.private = true; - -var protobuf = require("protobufjs"); - -var Namespace = protobuf.Namespace, - Enum = protobuf.Enum, - Type = protobuf.Type, - Field = protobuf.Field, - OneOf = protobuf.OneOf, - Service = protobuf.Service, - Method = protobuf.Method, - types = protobuf.types, - util = protobuf.util; - -function underScore(str) { - return str.substring(0,1) - + str.substring(1) - .replace(/([A-Z])(?=[a-z]|$)/g, function($0, $1) { return "_" + $1.toLowerCase(); }); -} - -var out = []; -var indent = 0; -var first = false; -var syntax = 3; - -function proto_target(root, options, callback) { - if (options) { - switch (options.syntax) { - case undefined: - case "proto3": - case "3": - syntax = 3; - break; - case "proto2": - case "2": - syntax = 2; - break; - default: - return callback(Error("invalid syntax: " + options.syntax)); - } - } - indent = 0; - first = false; - try { - buildRoot(root); - return callback(null, out.join("\n")); - } catch (err) { - return callback(err); - } finally { - out = []; - syntax = 3; - } -} - -function push(line) { - if (line === "") - out.push(""); - else { - var ind = ""; - for (var i = 0; i < indent; ++i) - ind += " "; - out.push(ind + line); - } -} - -function escape(str) { - return str.replace(/[\\"']/g, "\\$&") - .replace(/\r/g, "\\r") - .replace(/\n/g, "\\n") - .replace(/\u0000/g, "\\0"); // eslint-disable-line no-control-regex -} - -function value(v) { - switch (typeof v) { - case "boolean": - return v ? "true" : "false"; - case "number": - return v.toString(); - default: - return "\"" + escape(String(v)) + "\""; - } -} - -function buildRoot(root) { - root.resolveAll(); - var pkg = []; - var ptr = root; - var repeat = true; - do { - var nested = ptr.nestedArray; - if (nested.length === 1 && nested[0] instanceof Namespace && !(nested[0] instanceof Type || nested[0] instanceof Service)) { - ptr = nested[0]; - if (ptr !== root) - pkg.push(ptr.name); - } else - repeat = false; - } while (repeat); - out.push("syntax = \"proto" + syntax + "\";"); - if (pkg.length) - out.push("", "package " + pkg.join(".") + ";"); - - buildOptions(ptr); - ptr.nestedArray.forEach(build); -} - -function build(object) { - if (object instanceof Enum) - buildEnum(object); - else if (object instanceof Type) - buildType(object); - else if (object instanceof Field) - buildField(object); - else if (object instanceof OneOf) - buildOneOf(object); - else if (object instanceof Service) - buildService(object); - else if (object instanceof Method) - buildMethod(object); - else - buildNamespace(object); -} - -function buildNamespace(namespace) { // just a namespace, not a type etc. - push(""); - push("message " + namespace.name + " {"); - ++indent; - buildOptions(namespace); - consolidateExtends(namespace.nestedArray).remaining.forEach(build); - --indent; - push("}"); -} - -function buildEnum(enm) { - push(""); - push("enum " + enm.name + " {"); - buildOptions(enm); - ++indent; first = true; - Object.keys(enm.values).forEach(function(name) { - var val = enm.values[name]; - if (first) { - push(""); - first = false; - } - push(name + " = " + val + ";"); - }); - --indent; first = false; - push("}"); -} - -function buildRanges(keyword, ranges) { - if (ranges && ranges.length) { - var parts = []; - ranges.forEach(function(range) { - if (typeof range === "string") - parts.push("\"" + escape(range) + "\""); - else if (range[0] === range[1]) - parts.push(range[0]); - else - parts.push(range[0] + " to " + (range[1] === 0x1FFFFFFF ? "max" : range[1])); - }); - push(""); - push(keyword + " " + parts.join(", ") + ";"); - } -} - -function buildType(type) { - if (type.group) - return; // built with the sister-field - push(""); - push("message " + type.name + " {"); - ++indent; - buildOptions(type); - type.oneofsArray.forEach(build); - first = true; - type.fieldsArray.forEach(build); - consolidateExtends(type.nestedArray).remaining.forEach(build); - buildRanges("extensions", type.extensions); - buildRanges("reserved", type.reserved); - --indent; - push("}"); -} - -function buildField(field, passExtend) { - if (field.partOf || field.declaringField || field.extend !== undefined && !passExtend) - return; - if (first) { - first = false; - push(""); - } - if (field.resolvedType && field.resolvedType.group) { - buildGroup(field); - return; - } - var sb = []; - if (field.map) - sb.push("map<" + field.keyType + ", " + field.type + ">"); - else if (field.repeated) - sb.push("repeated", field.type); - else if (syntax === 2 || field.parent.group) - sb.push(field.required ? "required" : "optional", field.type); - else - sb.push(field.type); - sb.push(underScore(field.name), "=", field.id); - var opts = buildFieldOptions(field); - if (opts) - sb.push(opts); - push(sb.join(" ") + ";"); -} - -function buildGroup(field) { - push(field.rule + " group " + field.resolvedType.name + " = " + field.id + " {"); - ++indent; - buildOptions(field.resolvedType); - first = true; - field.resolvedType.fieldsArray.forEach(function(field) { - buildField(field); - }); - --indent; - push("}"); -} - -function buildFieldOptions(field) { - var keys; - if (!field.options || !(keys = Object.keys(field.options)).length) - return null; - var sb = []; - keys.forEach(function(key) { - var val = field.options[key]; - var wireType = types.packed[field.resolvedType instanceof Enum ? "int32" : field.type]; - switch (key) { - case "packed": - val = Boolean(val); - // skip when not packable or syntax default - if (wireType === undefined || syntax === 3 === val) - return; - break; - case "default": - if (syntax === 3) - return; - // skip default (resolved) default values - if (field.long && !util.longNeq(field.defaultValue, types.defaults[field.type]) || !field.long && field.defaultValue === types.defaults[field.type]) - return; - // enum defaults specified as strings are type references and not enclosed in quotes - if (field.resolvedType instanceof Enum) - break; - // otherwise fallthrough - default: - val = value(val); - break; - } - sb.push(key + "=" + val); - }); - return sb.length - ? "[" + sb.join(", ") + "]" - : null; -} - -function consolidateExtends(nested) { - var ext = {}; - nested = nested.filter(function(obj) { - if (!(obj instanceof Field) || obj.extend === undefined) - return true; - (ext[obj.extend] || (ext[obj.extend] = [])).push(obj); - return false; - }); - Object.keys(ext).forEach(function(extend) { - push(""); - push("extend " + extend + " {"); - ++indent; first = true; - ext[extend].forEach(function(field) { - buildField(field, true); - }); - --indent; - push("}"); - }); - return { - remaining: nested - }; -} - -function buildOneOf(oneof) { - push(""); - push("oneof " + underScore(oneof.name) + " {"); - ++indent; first = true; - oneof.oneof.forEach(function(fieldName) { - var field = oneof.parent.get(fieldName); - if (first) { - first = false; - push(""); - } - var opts = buildFieldOptions(field); - push(field.type + " " + underScore(field.name) + " = " + field.id + (opts ? " " + opts : "") + ";"); - }); - --indent; - push("}"); -} - -function buildService(service) { - push("service " + service.name + " {"); - ++indent; - service.methodsArray.forEach(build); - consolidateExtends(service.nestedArray).remaining.forEach(build); - --indent; - push("}"); -} - -function buildMethod(method) { - push(method.type + " " + method.name + " (" + (method.requestStream ? "stream " : "") + method.requestType + ") returns (" + (method.responseStream ? "stream " : "") + method.responseType + ");"); -} - -function buildOptions(object) { - if (!object.options) - return; - first = true; - Object.keys(object.options).forEach(function(key) { - if (first) { - first = false; - push(""); - } - var val = object.options[key]; - push("option " + key + " = " + JSON.stringify(val) + ";"); - }); -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/targets/proto2.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/targets/proto2.js deleted file mode 100644 index b349f57e..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/targets/proto2.js +++ /dev/null @@ -1,10 +0,0 @@ -"use strict"; -module.exports = proto2_target; - -var protobuf = require("protobufjs"); - -proto2_target.description = "Protocol Buffers, Version 2"; - -function proto2_target(root, options, callback) { - require("./proto")(root, protobuf.util.merge(options, { syntax: "proto2" }), callback); -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/targets/proto3.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/targets/proto3.js deleted file mode 100644 index 397b5678..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/targets/proto3.js +++ /dev/null @@ -1,10 +0,0 @@ -"use strict"; -module.exports = proto3_target; - -var protobuf = require("protobufjs"); - -proto3_target.description = "Protocol Buffers, Version 3"; - -function proto3_target(root, options, callback) { - require("./proto")(root, protobuf.util.merge(options, { syntax: "proto3" }), callback); -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/targets/static-module.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/targets/static-module.js deleted file mode 100644 index 7d16c2f0..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/targets/static-module.js +++ /dev/null @@ -1,28 +0,0 @@ -"use strict"; -module.exports = static_module_target; - -// - The default wrapper supports AMD, CommonJS and the global scope (as window.root), in this order. -// - You can specify a custom wrapper with the --wrap argument. -// - CommonJS modules depend on the minimal build for reduced package size with browserify. -// - AMD and global scope depend on the full library for now. - -var util = require("../util"), - protobuf = require("protobufjs"); - -static_module_target.description = "Static code without reflection as a module"; - -function static_module_target(root, options, callback) { - require("./static")(root, options, function(err, output) { - if (err) { - callback(err); - return; - } - try { - output = util.wrap(output, protobuf.util.merge({ dependency: "protobufjs/minimal" }, options)); - } catch (e) { - callback(e); - return; - } - callback(null, output); - }); -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/targets/static.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/targets/static.js deleted file mode 100644 index c130d902..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/targets/static.js +++ /dev/null @@ -1,733 +0,0 @@ -"use strict"; -module.exports = static_target; - -var UglifyJS = require("uglify-js"), - espree = require("espree"), - escodegen = require("escodegen"), - estraverse = require("estraverse"), - protobuf = require("protobufjs"); - -var Type = protobuf.Type, - Service = protobuf.Service, - Enum = protobuf.Enum, - Namespace = protobuf.Namespace, - util = protobuf.util; - -var out = []; -var indent = 0; -var config = {}; - -static_target.description = "Static code without reflection (non-functional on its own)"; - -function static_target(root, options, callback) { - config = options; - try { - var aliases = []; - if (config.decode) - aliases.push("Reader"); - if (config.encode) - aliases.push("Writer"); - aliases.push("util"); - if (aliases.length) { - if (config.comments) - push("// Common aliases"); - push((config.es6 ? "const " : "var ") + aliases.map(function(name) { return "$" + name + " = $protobuf." + name; }).join(", ") + ";"); - push(""); - } - if (config.comments) { - if (root.comment) { - pushComment("@fileoverview " + root.comment); - push(""); - } - push("// Exported root namespace"); - } - var rootProp = util.safeProp(config.root || "default"); - push((config.es6 ? "const" : "var") + " $root = $protobuf.roots" + rootProp + " || ($protobuf.roots" + rootProp + " = {});"); - buildNamespace(null, root); - return callback(null, out.join("\n")); - } catch (err) { - return callback(err); - } finally { - out = []; - indent = 0; - config = {}; - } -} - -function push(line) { - if (line === "") - return out.push(""); - var ind = ""; - for (var i = 0; i < indent; ++i) - ind += " "; - return out.push(ind + line); -} - -function pushComment(lines) { - if (!config.comments) - return; - var split = []; - for (var i = 0; i < lines.length; ++i) - if (lines[i] != null && lines[i].substring(0, 8) !== "@exclude") - Array.prototype.push.apply(split, lines[i].split(/\r?\n/g)); - push("/**"); - split.forEach(function(line) { - if (line === null) - return; - push(" * " + line.replace(/\*\//g, "* /")); - }); - push(" */"); -} - -function exportName(object, asInterface) { - if (asInterface) { - if (object.__interfaceName) - return object.__interfaceName; - } else if (object.__exportName) - return object.__exportName; - var parts = object.fullName.substring(1).split("."), - i = 0; - while (i < parts.length) - parts[i] = escapeName(parts[i++]); - if (asInterface) - parts[i - 1] = "I" + parts[i - 1]; - return object[asInterface ? "__interfaceName" : "__exportName"] = parts.join("."); -} - -function escapeName(name) { - if (!name) - return "$root"; - return util.isReserved(name) ? name + "_" : name; -} - -function aOrAn(name) { - return ((/^[hH](?:ou|on|ei)/.test(name) || /^[aeiouAEIOU][a-z]/.test(name)) && !/^us/i.test(name) - ? "an " - : "a ") + name; -} - -function buildNamespace(ref, ns) { - if (!ns) - return; - - if (ns instanceof Service && !config.service) - return; - - if (ns.name !== "") { - push(""); - if (!ref && config.es6) - push("export const " + escapeName(ns.name) + " = " + escapeName(ref) + "." + escapeName(ns.name) + " = (() => {"); - else - push(escapeName(ref) + "." + escapeName(ns.name) + " = (function() {"); - ++indent; - } - - if (ns instanceof Type) { - buildType(undefined, ns); - } else if (ns instanceof Service) - buildService(undefined, ns); - else if (ns.name !== "") { - push(""); - pushComment([ - ns.comment || "Namespace " + ns.name + ".", - ns.parent instanceof protobuf.Root ? "@exports " + escapeName(ns.name) : "@memberof " + exportName(ns.parent), - "@namespace" - ]); - push((config.es6 ? "const" : "var") + " " + escapeName(ns.name) + " = {};"); - } - - ns.nestedArray.forEach(function(nested) { - if (nested instanceof Enum) - buildEnum(ns.name, nested); - else if (nested instanceof Namespace) - buildNamespace(ns.name, nested); - }); - if (ns.name !== "") { - push(""); - push("return " + escapeName(ns.name) + ";"); - --indent; - push("})();"); - } -} - -var reduceableBlockStatements = { - IfStatement: true, - ForStatement: true, - WhileStatement: true -}; - -var shortVars = { - "r": "reader", - "w": "writer", - "m": "message", - "t": "tag", - "l": "length", - "c": "end", "c2": "end2", - "k": "key", - "ks": "keys", "ks2": "keys2", - "e": "error", - "f": "impl", - "o": "options", - "d": "object", - "n": "long", - "p": "properties" -}; - -function beautifyCode(code) { - // Add semicolons - code = UglifyJS.minify(code, { - compress: false, - mangle: false, - output: { beautify: true } - }).code; - // Properly beautify - var ast = espree.parse(code); - estraverse.replace(ast, { - enter: function(node, parent) { - // rename short vars - if (node.type === "Identifier" && (parent.property !== node || parent.computed) && shortVars[node.name]) - return { - "type": "Identifier", - "name": shortVars[node.name] - }; - // replace var with let if es6 - if (config.es6 && node.type === "VariableDeclaration" && node.kind === "var") { - node.kind = "let"; - return undefined; - } - // remove braces around block statements with a single child - if (node.type === "BlockStatement" && reduceableBlockStatements[parent.type] && node.body.length === 1) - return node.body[0]; - return undefined; - } - }); - code = escodegen.generate(ast, { - format: { - newline: "\n", - quotes: "double" - } - }); - // Add id, wireType comments - if (config.comments) - code = code.replace(/\.uint32\((\d+)\)/g, function($0, $1) { - var id = $1 >>> 3, - wireType = $1 & 7; - return ".uint32(/* id " + id + ", wireType " + wireType + " =*/" + $1 + ")"; - }); - return code; -} - -var renameVars = { - "Writer": "$Writer", - "Reader": "$Reader", - "util": "$util" -}; - -function buildFunction(type, functionName, gen, scope) { - var code = gen.toString(functionName) - .replace(/((?!\.)types\[\d+])(\.values)/g, "$1"); // enums: use types[N] instead of reflected types[N].values - - var ast = espree.parse(code); - /* eslint-disable no-extra-parens */ - estraverse.replace(ast, { - enter: function(node, parent) { - // rename vars - if ( - node.type === "Identifier" && renameVars[node.name] - && ( - (parent.type === "MemberExpression" && parent.object === node) - || (parent.type === "BinaryExpression" && parent.right === node) - ) - ) - return { - "type": "Identifier", - "name": renameVars[node.name] - }; - // replace this.ctor with the actual ctor - if ( - node.type === "MemberExpression" - && node.object.type === "ThisExpression" - && node.property.type === "Identifier" && node.property.name === "ctor" - ) - return { - "type": "Identifier", - "name": "$root" + type.fullName - }; - // replace types[N] with the field's actual type - if ( - node.type === "MemberExpression" - && node.object.type === "Identifier" && node.object.name === "types" - && node.property.type === "Literal" - ) - return { - "type": "Identifier", - "name": "$root" + type.fieldsArray[node.property.value].resolvedType.fullName - }; - return undefined; - } - }); - /* eslint-enable no-extra-parens */ - code = escodegen.generate(ast, { - format: { - newline: "\n", - quotes: "double" - } - }); - - if (config.beautify) - code = beautifyCode(code); - - code = code.replace(/ {4}/g, "\t"); - - var hasScope = scope && Object.keys(scope).length, - isCtor = functionName === type.name; - - if (hasScope) // remove unused scope vars - Object.keys(scope).forEach(function(key) { - if (!new RegExp("\\b(" + key + ")\\b", "g").test(code)) - delete scope[key]; - }); - - var lines = code.split(/\n/g); - if (isCtor) // constructor - push(lines[0]); - else if (hasScope) // enclose in an iife - push(escapeName(type.name) + "." + escapeName(functionName) + " = (function(" + Object.keys(scope).map(escapeName).join(", ") + ") { return " + lines[0]); - else - push(escapeName(type.name) + "." + escapeName(functionName) + " = " + lines[0]); - lines.slice(1, lines.length - 1).forEach(function(line) { - var prev = indent; - var i = 0; - while (line.charAt(i++) === "\t") - ++indent; - push(line.trim()); - indent = prev; - }); - if (isCtor) - push("}"); - else if (hasScope) - push("};})(" + Object.keys(scope).map(function(key) { return scope[key]; }).join(", ") + ");"); - else - push("};"); -} - -function toJsType(field) { - var type; - - switch (field.type) { - case "double": - case "float": - case "int32": - case "uint32": - case "sint32": - case "fixed32": - case "sfixed32": - type = "number"; - break; - case "int64": - case "uint64": - case "sint64": - case "fixed64": - case "sfixed64": - type = config.forceLong ? "Long" : config.forceNumber ? "number" : "number|Long"; - break; - case "bool": - type = "boolean"; - break; - case "string": - type = "string"; - break; - case "bytes": - type = "Uint8Array"; - break; - default: - if (field.resolve().resolvedType) - type = exportName(field.resolvedType, !(field.resolvedType instanceof protobuf.Enum || config.forceMessage)); - else - type = "*"; // should not happen - break; - } - if (field.map) - return "Object."; - if (field.repeated) - return "Array.<" + type + ">"; - return type; -} - -function buildType(ref, type) { - - if (config.comments) { - var typeDef = [ - "Properties of " + aOrAn(type.name) + ".", - type.parent instanceof protobuf.Root ? "@exports " + escapeName("I" + type.name) : "@memberof " + exportName(type.parent), - "@interface " + escapeName("I" + type.name) - ]; - type.fieldsArray.forEach(function(field) { - var prop = util.safeProp(field.name); // either .name or ["name"] - prop = prop.substring(1, prop.charAt(0) === "[" ? prop.length - 1 : prop.length); - var jsType = toJsType(field); - if (field.optional) - jsType = jsType + "|null"; - typeDef.push("@property {" + jsType + "} " + (field.optional ? "[" + prop + "]" : prop) + " " + (field.comment || type.name + " " + field.name)); - }); - push(""); - pushComment(typeDef); - } - - // constructor - push(""); - pushComment([ - "Constructs a new " + type.name + ".", - type.parent instanceof protobuf.Root ? "@exports " + escapeName(type.name) : "@memberof " + exportName(type.parent), - "@classdesc " + (type.comment || "Represents " + aOrAn(type.name) + "."), - config.comments ? "@implements " + escapeName("I" + type.name) : null, - "@constructor", - "@param {" + exportName(type, true) + "=} [" + (config.beautify ? "properties" : "p") + "] Properties to set" - ]); - buildFunction(type, type.name, Type.generateConstructor(type)); - - // default values - var firstField = true; - type.fieldsArray.forEach(function(field) { - field.resolve(); - var prop = util.safeProp(field.name); - if (config.comments) { - push(""); - var jsType = toJsType(field); - if (field.optional && !field.map && !field.repeated && (field.resolvedType instanceof Type || config["null-defaults"]) || field.partOf) - jsType = jsType + "|null|undefined"; - pushComment([ - field.comment || type.name + " " + field.name + ".", - "@member {" + jsType + "} " + field.name, - "@memberof " + exportName(type), - "@instance" - ]); - } else if (firstField) { - push(""); - firstField = false; - } - if (field.repeated) - push(escapeName(type.name) + ".prototype" + prop + " = $util.emptyArray;"); // overwritten in constructor - else if (field.map) - push(escapeName(type.name) + ".prototype" + prop + " = $util.emptyObject;"); // overwritten in constructor - else if (field.partOf || field.optional && config["null-defaults"]) - push(escapeName(type.name) + ".prototype" + prop + " = null;"); // do not set default value for oneof members - else if (field.long) - push(escapeName(type.name) + ".prototype" + prop + " = $util.Long ? $util.Long.fromBits(" - + JSON.stringify(field.typeDefault.low) + "," - + JSON.stringify(field.typeDefault.high) + "," - + JSON.stringify(field.typeDefault.unsigned) - + ") : " + field.typeDefault.toNumber(field.type.charAt(0) === "u") + ";"); - else if (field.bytes) { - push(escapeName(type.name) + ".prototype" + prop + " = $util.newBuffer(" + JSON.stringify(Array.prototype.slice.call(field.typeDefault)) + ");"); - } else - push(escapeName(type.name) + ".prototype" + prop + " = " + JSON.stringify(field.typeDefault) + ";"); - }); - - // virtual oneof fields - var firstOneOf = true; - type.oneofsArray.forEach(function(oneof) { - if (firstOneOf) { - firstOneOf = false; - push(""); - if (config.comments) - push("// OneOf field names bound to virtual getters and setters"); - push((config.es6 ? "let" : "var") + " $oneOfFields;"); - } - oneof.resolve(); - push(""); - pushComment([ - oneof.comment || type.name + " " + oneof.name + ".", - "@member {" + oneof.oneof.map(JSON.stringify).join("|") + "|undefined} " + escapeName(oneof.name), - "@memberof " + exportName(type), - "@instance" - ]); - push("Object.defineProperty(" + escapeName(type.name) + ".prototype, " + JSON.stringify(oneof.name) +", {"); - ++indent; - push("get: $util.oneOfGetter($oneOfFields = [" + oneof.oneof.map(JSON.stringify).join(", ") + "]),"); - push("set: $util.oneOfSetter($oneOfFields)"); - --indent; - push("});"); - }); - - if (config.create) { - push(""); - pushComment([ - "Creates a new " + type.name + " instance using the specified properties.", - "@function create", - "@memberof " + exportName(type), - "@static", - "@param {" + exportName(type, true) + "=} [properties] Properties to set", - "@returns {" + exportName(type) + "} " + type.name + " instance" - ]); - push(escapeName(type.name) + ".create = function create(properties) {"); - ++indent; - push("return new " + escapeName(type.name) + "(properties);"); - --indent; - push("};"); - } - - if (config.encode) { - push(""); - pushComment([ - "Encodes the specified " + type.name + " message. Does not implicitly {@link " + exportName(type) + ".verify|verify} messages.", - "@function encode", - "@memberof " + exportName(type), - "@static", - "@param {" + exportName(type, !config.forceMessage) + "} " + (config.beautify ? "message" : "m") + " " + type.name + " message or plain object to encode", - "@param {$protobuf.Writer} [" + (config.beautify ? "writer" : "w") + "] Writer to encode to", - "@returns {$protobuf.Writer} Writer" - ]); - buildFunction(type, "encode", protobuf.encoder(type)); - - if (config.delimited) { - push(""); - pushComment([ - "Encodes the specified " + type.name + " message, length delimited. Does not implicitly {@link " + exportName(type) + ".verify|verify} messages.", - "@function encodeDelimited", - "@memberof " + exportName(type), - "@static", - "@param {" + exportName(type, !config.forceMessage) + "} message " + type.name + " message or plain object to encode", - "@param {$protobuf.Writer} [writer] Writer to encode to", - "@returns {$protobuf.Writer} Writer" - ]); - push(escapeName(type.name) + ".encodeDelimited = function encodeDelimited(message, writer) {"); - ++indent; - push("return this.encode(message, writer).ldelim();"); - --indent; - push("};"); - } - } - - if (config.decode) { - push(""); - pushComment([ - "Decodes " + aOrAn(type.name) + " message from the specified reader or buffer.", - "@function decode", - "@memberof " + exportName(type), - "@static", - "@param {$protobuf.Reader|Uint8Array} " + (config.beautify ? "reader" : "r") + " Reader or buffer to decode from", - "@param {number} [" + (config.beautify ? "length" : "l") + "] Message length if known beforehand", - "@returns {" + exportName(type) + "} " + type.name, - "@throws {Error} If the payload is not a reader or valid buffer", - "@throws {$protobuf.util.ProtocolError} If required fields are missing" - ]); - buildFunction(type, "decode", protobuf.decoder(type)); - - if (config.delimited) { - push(""); - pushComment([ - "Decodes " + aOrAn(type.name) + " message from the specified reader or buffer, length delimited.", - "@function decodeDelimited", - "@memberof " + exportName(type), - "@static", - "@param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from", - "@returns {" + exportName(type) + "} " + type.name, - "@throws {Error} If the payload is not a reader or valid buffer", - "@throws {$protobuf.util.ProtocolError} If required fields are missing" - ]); - push(escapeName(type.name) + ".decodeDelimited = function decodeDelimited(reader) {"); - ++indent; - push("if (!(reader instanceof $Reader))"); - ++indent; - push("reader = new $Reader(reader);"); - --indent; - push("return this.decode(reader, reader.uint32());"); - --indent; - push("};"); - } - } - - if (config.verify) { - push(""); - pushComment([ - "Verifies " + aOrAn(type.name) + " message.", - "@function verify", - "@memberof " + exportName(type), - "@static", - "@param {Object.} " + (config.beautify ? "message" : "m") + " Plain object to verify", - "@returns {string|null} `null` if valid, otherwise the reason why it is not" - ]); - buildFunction(type, "verify", protobuf.verifier(type)); - } - - if (config.convert) { - push(""); - pushComment([ - "Creates " + aOrAn(type.name) + " message from a plain object. Also converts values to their respective internal types.", - "@function fromObject", - "@memberof " + exportName(type), - "@static", - "@param {Object.} " + (config.beautify ? "object" : "d") + " Plain object", - "@returns {" + exportName(type) + "} " + type.name - ]); - buildFunction(type, "fromObject", protobuf.converter.fromObject(type)); - - push(""); - pushComment([ - "Creates a plain object from " + aOrAn(type.name) + " message. Also converts values to other types if specified.", - "@function toObject", - "@memberof " + exportName(type), - "@static", - "@param {" + exportName(type) + "} " + (config.beautify ? "message" : "m") + " " + type.name, - "@param {$protobuf.IConversionOptions} [" + (config.beautify ? "options" : "o") + "] Conversion options", - "@returns {Object.} Plain object" - ]); - buildFunction(type, "toObject", protobuf.converter.toObject(type)); - - push(""); - pushComment([ - "Converts this " + type.name + " to JSON.", - "@function toJSON", - "@memberof " + exportName(type), - "@instance", - "@returns {Object.} JSON object" - ]); - push(escapeName(type.name) + ".prototype.toJSON = function toJSON() {"); - ++indent; - push("return this.constructor.toObject(this, $protobuf.util.toJSONOptions);"); - --indent; - push("};"); - } - - if (config.typeurl) { - push(""); - pushComment([ - "Gets the default type url for " + type.name, - "@function getTypeUrl", - "@memberof " + exportName(type), - "@static", - "@param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")", - "@returns {string} The default type url" - ]); - push(escapeName(type.name) + ".getTypeUrl = function getTypeUrl(typeUrlPrefix) {"); - ++indent; - push("if (typeUrlPrefix === undefined) {"); - ++indent; - push("typeUrlPrefix = \"type.googleapis.com\";"); - --indent; - push("}"); - push("return typeUrlPrefix + \"/" + exportName(type) + "\";"); - --indent; - push("};"); - } -} - -function buildService(ref, service) { - - push(""); - pushComment([ - "Constructs a new " + service.name + " service.", - service.parent instanceof protobuf.Root ? "@exports " + escapeName(service.name) : "@memberof " + exportName(service.parent), - "@classdesc " + (service.comment || "Represents " + aOrAn(service.name)), - "@extends $protobuf.rpc.Service", - "@constructor", - "@param {$protobuf.RPCImpl} rpcImpl RPC implementation", - "@param {boolean} [requestDelimited=false] Whether requests are length-delimited", - "@param {boolean} [responseDelimited=false] Whether responses are length-delimited" - ]); - push("function " + escapeName(service.name) + "(rpcImpl, requestDelimited, responseDelimited) {"); - ++indent; - push("$protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited);"); - --indent; - push("}"); - push(""); - push("(" + escapeName(service.name) + ".prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = " + escapeName(service.name) + ";"); - - if (config.create) { - push(""); - pushComment([ - "Creates new " + service.name + " service using the specified rpc implementation.", - "@function create", - "@memberof " + exportName(service), - "@static", - "@param {$protobuf.RPCImpl} rpcImpl RPC implementation", - "@param {boolean} [requestDelimited=false] Whether requests are length-delimited", - "@param {boolean} [responseDelimited=false] Whether responses are length-delimited", - "@returns {" + escapeName(service.name) + "} RPC service. Useful where requests and/or responses are streamed." - ]); - push(escapeName(service.name) + ".create = function create(rpcImpl, requestDelimited, responseDelimited) {"); - ++indent; - push("return new this(rpcImpl, requestDelimited, responseDelimited);"); - --indent; - push("};"); - } - - service.methodsArray.forEach(function(method) { - method.resolve(); - var lcName = protobuf.util.lcFirst(method.name), - cbName = escapeName(method.name + "Callback"); - push(""); - pushComment([ - "Callback as used by {@link " + exportName(service) + "#" + escapeName(lcName) + "}.", - // This is a more specialized version of protobuf.rpc.ServiceCallback - "@memberof " + exportName(service), - "@typedef " + cbName, - "@type {function}", - "@param {Error|null} error Error, if any", - "@param {" + exportName(method.resolvedResponseType) + "} [response] " + method.resolvedResponseType.name - ]); - push(""); - pushComment([ - method.comment || "Calls " + method.name + ".", - "@function " + lcName, - "@memberof " + exportName(service), - "@instance", - "@param {" + exportName(method.resolvedRequestType, !config.forceMessage) + "} request " + method.resolvedRequestType.name + " message or plain object", - "@param {" + exportName(service) + "." + cbName + "} callback Node-style callback called with the error, if any, and " + method.resolvedResponseType.name, - "@returns {undefined}", - "@variation 1" - ]); - push("Object.defineProperty(" + escapeName(service.name) + ".prototype" + util.safeProp(lcName) + " = function " + escapeName(lcName) + "(request, callback) {"); - ++indent; - push("return this.rpcCall(" + escapeName(lcName) + ", $root." + exportName(method.resolvedRequestType) + ", $root." + exportName(method.resolvedResponseType) + ", request, callback);"); - --indent; - push("}, \"name\", { value: " + JSON.stringify(method.name) + " });"); - if (config.comments) - push(""); - pushComment([ - method.comment || "Calls " + method.name + ".", - "@function " + lcName, - "@memberof " + exportName(service), - "@instance", - "@param {" + exportName(method.resolvedRequestType, !config.forceMessage) + "} request " + method.resolvedRequestType.name + " message or plain object", - "@returns {Promise<" + exportName(method.resolvedResponseType) + ">} Promise", - "@variation 2" - ]); - }); -} - -function buildEnum(ref, enm) { - - push(""); - var comment = [ - enm.comment || enm.name + " enum.", - enm.parent instanceof protobuf.Root ? "@exports " + escapeName(enm.name) : "@name " + exportName(enm), - config.forceEnumString ? "@enum {string}" : "@enum {number}", - ]; - Object.keys(enm.values).forEach(function(key) { - var val = config.forceEnumString ? key : enm.values[key]; - comment.push((config.forceEnumString ? "@property {string} " : "@property {number} ") + key + "=" + val + " " + (enm.comments[key] || key + " value")); - }); - pushComment(comment); - if (!ref && config.es6) - push("export const " + escapeName(enm.name) + " = " + escapeName(ref) + "." + escapeName(enm.name) + " = (() => {"); - else - push(escapeName(ref) + "." + escapeName(enm.name) + " = (function() {"); - ++indent; - push((config.es6 ? "const" : "var") + " valuesById = {}, values = Object.create(valuesById);"); - var aliased = []; - Object.keys(enm.values).forEach(function(key) { - var valueId = enm.values[key]; - var val = config.forceEnumString ? JSON.stringify(key) : valueId; - if (aliased.indexOf(valueId) > -1) - push("values[" + JSON.stringify(key) + "] = " + val + ";"); - else { - push("values[valuesById[" + valueId + "] = " + JSON.stringify(key) + "] = " + val + ";"); - aliased.push(valueId); - } - }); - push("return values;"); - --indent; - push("})();"); -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/util.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/util.js deleted file mode 100644 index 93136228..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/util.js +++ /dev/null @@ -1,127 +0,0 @@ -"use strict"; -var fs = require("fs"), - path = require("path"), - protobuf = require("protobufjs"); - -function basenameCompare(a, b) { - var aa = String(a).replace(/\.\w+$/, "").split(/(-?\d*\.?\d+)/g), - bb = String(b).replace(/\.\w+$/, "").split(/(-?\d*\.?\d+)/g); - for (var i = 0, k = Math.min(aa.length, bb.length); i < k; i++) { - var x = parseFloat(aa[i]) || aa[i].toLowerCase(), - y = parseFloat(bb[i]) || bb[i].toLowerCase(); - if (x < y) - return -1; - if (x > y) - return 1; - } - return a.length < b.length ? -1 : 0; -} - -exports.requireAll = function requireAll(dirname) { - dirname = path.join(__dirname, dirname); - var files = fs.readdirSync(dirname).sort(basenameCompare), - all = {}; - files.forEach(function(file) { - var basename = path.basename(file, ".js"), - extname = path.extname(file); - if (extname === ".js") - all[basename] = require(path.join(dirname, file)); - }); - return all; -}; - -exports.traverse = function traverse(current, fn) { - fn(current); - if (current.fieldsArray) - current.fieldsArray.forEach(function(field) { - traverse(field, fn); - }); - if (current.oneofsArray) - current.oneofsArray.forEach(function(oneof) { - traverse(oneof, fn); - }); - if (current.methodsArray) - current.methodsArray.forEach(function(method) { - traverse(method, fn); - }); - if (current.nestedArray) - current.nestedArray.forEach(function(nested) { - traverse(nested, fn); - }); -}; - -exports.traverseResolved = function traverseResolved(current, fn) { - fn(current); - if (current.resolvedType) - traverseResolved(current.resolvedType, fn); - if (current.resolvedKeyType) - traverseResolved(current.resolvedKeyType, fn); - if (current.resolvedRequestType) - traverseResolved(current.resolvedRequestType, fn); - if (current.resolvedResponseType) - traverseResolved(current.resolvedResponseType, fn); -}; - -exports.inspect = function inspect(object, indent) { - if (!object) - return ""; - var chalk = require("chalk"); - var sb = []; - if (!indent) - indent = ""; - var ind = indent ? indent.substring(0, indent.length - 2) + "└ " : ""; - sb.push( - ind + chalk.bold(object.toString()) + (object.visible ? " (visible)" : ""), - indent + chalk.gray("parent: ") + object.parent - ); - if (object instanceof protobuf.Field) { - if (object.extend !== undefined) - sb.push(indent + chalk.gray("extend: ") + object.extend); - if (object.partOf) - sb.push(indent + chalk.gray("oneof : ") + object.oneof); - } - sb.push(""); - if (object.fieldsArray) - object.fieldsArray.forEach(function(field) { - sb.push(inspect(field, indent + " ")); - }); - if (object.oneofsArray) - object.oneofsArray.forEach(function(oneof) { - sb.push(inspect(oneof, indent + " ")); - }); - if (object.methodsArray) - object.methodsArray.forEach(function(service) { - sb.push(inspect(service, indent + " ")); - }); - if (object.nestedArray) - object.nestedArray.forEach(function(nested) { - sb.push(inspect(nested, indent + " ")); - }); - return sb.join("\n"); -}; - -exports.wrap = function(OUTPUT, options) { - var name = options.wrap || "default"; - var wrap; - try { - // try built-in wrappers first - wrap = fs.readFileSync(path.join(__dirname, "wrappers", name + ".js")).toString("utf8"); - } catch (e) { - // otherwise fetch the custom one - wrap = fs.readFileSync(path.resolve(process.cwd(), name)).toString("utf8"); - } - wrap = wrap.replace(/\$DEPENDENCY/g, JSON.stringify(options.dependency || "protobufjs")); - wrap = wrap.replace(/( *)\$OUTPUT;/, function($0, $1) { - return $1.length ? OUTPUT.replace(/^/mg, $1) : OUTPUT; - }); - if (options.lint !== "") - wrap = "/*" + options.lint + "*/\n" + wrap; - return wrap.replace(/\r?\n/g, "\n"); -}; - -exports.pad = function(str, len, l) { - while (str.length < len) - str = l ? str + " " : " " + str; - return str; -}; - diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/wrappers/amd.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/wrappers/amd.js deleted file mode 100644 index c43dd73c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/wrappers/amd.js +++ /dev/null @@ -1,7 +0,0 @@ -define([$DEPENDENCY], function($protobuf) { - "use strict"; - - $OUTPUT; - - return $root; -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/wrappers/closure.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/wrappers/closure.js deleted file mode 100644 index c94327c5..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/wrappers/closure.js +++ /dev/null @@ -1,7 +0,0 @@ -(function($protobuf) { - "use strict"; - - $OUTPUT; - - return $root; -})(protobuf); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/wrappers/commonjs.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/wrappers/commonjs.js deleted file mode 100644 index 6dc91684..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/wrappers/commonjs.js +++ /dev/null @@ -1,7 +0,0 @@ -"use strict"; - -var $protobuf = require($DEPENDENCY); - -$OUTPUT; - -module.exports = $root; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/wrappers/default.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/wrappers/default.js deleted file mode 100644 index 34b29ec7..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/wrappers/default.js +++ /dev/null @@ -1,15 +0,0 @@ -(function(global, factory) { /* global define, require, module */ - - /* AMD */ if (typeof define === 'function' && define.amd) - define([$DEPENDENCY], factory); - - /* CommonJS */ else if (typeof require === 'function' && typeof module === 'object' && module && module.exports) - module.exports = factory(require($DEPENDENCY)); - -})(this, function($protobuf) { - "use strict"; - - $OUTPUT; - - return $root; -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/wrappers/es6.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/wrappers/es6.js deleted file mode 100644 index 5bdc43c6..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs-cli/wrappers/es6.js +++ /dev/null @@ -1,5 +0,0 @@ -import * as $protobuf from $DEPENDENCY; - -$OUTPUT; - -export { $root as default }; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/LICENSE b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/LICENSE deleted file mode 100644 index 57b7e309..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/LICENSE +++ /dev/null @@ -1,39 +0,0 @@ -This license applies to all parts of protobuf.js except those files -either explicitly including or referencing a different license or -located in a directory containing a different LICENSE file. - ---- - -Copyright (c) 2016, Daniel Wirtz All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - -* Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -* Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -* Neither the name of its author, nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - ---- - -Code generated by the command line utilities is owned by the owner -of the input file used when generating it. This code is not -standalone and requires a support library to be linked with it. This -support library is itself covered by the above license. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/README.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/README.md deleted file mode 100644 index b88c0229..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/README.md +++ /dev/null @@ -1,740 +0,0 @@ -

    protobuf.js

    -

    donate ❤

    - -**Protocol Buffers** are a language-neutral, platform-neutral, extensible way of serializing structured data for use in communications protocols, data storage, and more, originally designed at Google ([see](https://developers.google.com/protocol-buffers/)). - -**protobuf.js** is a pure JavaScript implementation with [TypeScript](https://www.typescriptlang.org) support for [node.js](https://nodejs.org) and the browser. It's easy to use, blazingly fast and works out of the box with [.proto](https://developers.google.com/protocol-buffers/docs/proto) files! - -Contents --------- - -* [Installation](#installation)
    - How to include protobuf.js in your project. - -* [Usage](#usage)
    - A brief introduction to using the toolset. - - * [Valid Message](#valid-message) - * [Toolset](#toolset)
    - -* [Examples](#examples)
    - A few examples to get you started. - - * [Using .proto files](#using-proto-files) - * [Using JSON descriptors](#using-json-descriptors) - * [Using reflection only](#using-reflection-only) - * [Using custom classes](#using-custom-classes) - * [Using services](#using-services) - * [Usage with TypeScript](#usage-with-typescript)
    - -* [Additional documentation](#additional-documentation)
    - A list of available documentation resources. - -* [Performance](#performance)
    - A few internals and a benchmark on performance. - -* [Compatibility](#compatibility)
    - Notes on compatibility regarding browsers and optional libraries. - -* [Building](#building)
    - How to build the library and its components yourself. - -Installation ---------------- - -### node.js - -``` -$> npm install protobufjs [--save --save-prefix=~] -``` - -```js -var protobuf = require("protobufjs"); -``` - -The command line utility lives in the protobufjs-cli package and must be installed separately: - -``` -$> npm install protobufjs-cli [--save --save-prefix=~] -``` - -**Note** that this library's versioning scheme is not semver-compatible for historical reasons. For guaranteed backward compatibility, always depend on `~6.A.B` instead of `^6.A.B` (hence the `--save-prefix` above). - -### Browsers - -Development: - -``` - -``` - -Production: - -``` - -``` - -**Remember** to replace the version tag with the exact [release](https://github.com/protobufjs/protobuf.js/tags) your project depends upon. - -The library supports CommonJS and AMD loaders and also exports globally as `protobuf`. - -### Distributions - -Where bundle size is a factor, there are additional stripped-down versions of the [full library][dist-full] (~19kb gzipped) available that exclude certain functionality: - -* When working with JSON descriptors (i.e. generated by [pbjs](cli/README.md#pbjs-for-javascript)) and/or reflection only, see the [light library][dist-light] (~16kb gzipped) that excludes the parser. CommonJS entry point is: - - ```js - var protobuf = require("protobufjs/light"); - ``` - -* When working with statically generated code only, see the [minimal library][dist-minimal] (~6.5kb gzipped) that also excludes reflection. CommonJS entry point is: - - ```js - var protobuf = require("protobufjs/minimal"); - ``` - -| Distribution | Location -|------------|----------------------------------- -| Full | -| Light | -| Minimal | - -Usage ------ - -Because JavaScript is a dynamically typed language, protobuf.js introduces the concept of a **valid message** in order to provide the best possible [performance](#performance) (and, as a side product, proper typings): - -### Valid message - -> A valid message is an object (1) not missing any required fields and (2) exclusively composed of JS types understood by the wire format writer. - -There are two possible types of valid messages and the encoder is able to work with both of these for convenience: - -* **Message instances** (explicit instances of message classes with default values on their prototype) always (have to) satisfy the requirements of a valid message by design and -* **Plain JavaScript objects** that just so happen to be composed in a way satisfying the requirements of a valid message as well. - -In a nutshell, the wire format writer understands the following types: - -| Field type | Expected JS type (create, encode) | Conversion (fromObject) -|------------|-----------------------------------|------------------------ -| s-/u-/int32
    s-/fixed32 | `number` (32 bit integer) | value | 0 if signed
    `value >>> 0` if unsigned -| s-/u-/int64
    s-/fixed64 | `Long`-like (optimal)
    `number` (53 bit integer) | `Long.fromValue(value)` with long.js
    `parseInt(value, 10)` otherwise -| float
    double | `number` | `Number(value)` -| bool | `boolean` | `Boolean(value)` -| string | `string` | `String(value)` -| bytes | `Uint8Array` (optimal)
    `Buffer` (optimal under node)
    `Array.` (8 bit integers) | `base64.decode(value)` if a `string`
    `Object` with non-zero `.length` is assumed to be buffer-like -| enum | `number` (32 bit integer) | Looks up the numeric id if a `string` -| message | Valid message | `Message.fromObject(value)` - -* Explicit `undefined` and `null` are considered as not set if the field is optional. -* Repeated fields are `Array.`. -* Map fields are `Object.` with the key being the string representation of the respective value or an 8 characters long binary hash string for `Long`-likes. -* Types marked as *optimal* provide the best performance because no conversion step (i.e. number to low and high bits or base64 string to buffer) is required. - -### Toolset - -With that in mind and again for performance reasons, each message class provides a distinct set of methods with each method doing just one thing. This avoids unnecessary assertions / redundant operations where performance is a concern but also forces a user to perform verification (of plain JavaScript objects that *might* just so happen to be a valid message) explicitly where necessary - for example when dealing with user input. - -**Note** that `Message` below refers to any message class. - -* **Message.verify**(message: `Object`): `null|string`
    - verifies that a **plain JavaScript object** satisfies the requirements of a valid message and thus can be encoded without issues. Instead of throwing, it returns the error message as a string, if any. - - ```js - var payload = "invalid (not an object)"; - var err = AwesomeMessage.verify(payload); - if (err) - throw Error(err); - ``` - -* **Message.encode**(message: `Message|Object` [, writer: `Writer`]): `Writer`
    - encodes a **message instance** or valid **plain JavaScript object**. This method does not implicitly verify the message and it's up to the user to make sure that the payload is a valid message. - - ```js - var buffer = AwesomeMessage.encode(message).finish(); - ``` - -* **Message.encodeDelimited**(message: `Message|Object` [, writer: `Writer`]): `Writer`
    - works like `Message.encode` but additionally prepends the length of the message as a varint. - -* **Message.decode**(reader: `Reader|Uint8Array`): `Message`
    - decodes a buffer to a **message instance**. If required fields are missing, it throws a `util.ProtocolError` with an `instance` property set to the so far decoded message. If the wire format is invalid, it throws an `Error`. - - ```js - try { - var decodedMessage = AwesomeMessage.decode(buffer); - } catch (e) { - if (e instanceof protobuf.util.ProtocolError) { - // e.instance holds the so far decoded message with missing required fields - } else { - // wire format is invalid - } - } - ``` - -* **Message.decodeDelimited**(reader: `Reader|Uint8Array`): `Message`
    - works like `Message.decode` but additionally reads the length of the message prepended as a varint. - -* **Message.create**(properties: `Object`): `Message`
    - creates a new **message instance** from a set of properties that satisfy the requirements of a valid message. Where applicable, it is recommended to prefer `Message.create` over `Message.fromObject` because it doesn't perform possibly redundant conversion. - - ```js - var message = AwesomeMessage.create({ awesomeField: "AwesomeString" }); - ``` - -* **Message.fromObject**(object: `Object`): `Message`
    - converts any non-valid **plain JavaScript object** to a **message instance** using the conversion steps outlined within the table above. - - ```js - var message = AwesomeMessage.fromObject({ awesomeField: 42 }); - // converts awesomeField to a string - ``` - -* **Message.toObject**(message: `Message` [, options: `ConversionOptions`]): `Object`
    - converts a **message instance** to an arbitrary **plain JavaScript object** for interoperability with other libraries or storage. The resulting plain JavaScript object *might* still satisfy the requirements of a valid message depending on the actual conversion options specified, but most of the time it does not. - - ```js - var object = AwesomeMessage.toObject(message, { - enums: String, // enums as string names - longs: String, // longs as strings (requires long.js) - bytes: String, // bytes as base64 encoded strings - defaults: true, // includes default values - arrays: true, // populates empty arrays (repeated fields) even if defaults=false - objects: true, // populates empty objects (map fields) even if defaults=false - oneofs: true // includes virtual oneof fields set to the present field's name - }); - ``` - -For reference, the following diagram aims to display relationships between the different methods and the concept of a valid message: - -

    Toolset Diagram

    - -> In other words: `verify` indicates that calling `create` or `encode` directly on the plain object will [result in a valid message respectively] succeed. `fromObject`, on the other hand, does conversion from a broader range of plain objects to create valid messages. ([ref](https://github.com/dcodeIO/protobuf.js/issues/748#issuecomment-291925749)) - -Examples --------- - -### Using .proto files - -It is possible to load existing .proto files using the full library, which parses and compiles the definitions to ready to use (reflection-based) message classes: - -```protobuf -// awesome.proto -package awesomepackage; -syntax = "proto3"; - -message AwesomeMessage { - string awesome_field = 1; // becomes awesomeField -} -``` - -```js -protobuf.load("awesome.proto", function(err, root) { - if (err) - throw err; - - // Obtain a message type - var AwesomeMessage = root.lookupType("awesomepackage.AwesomeMessage"); - - // Exemplary payload - var payload = { awesomeField: "AwesomeString" }; - - // Verify the payload if necessary (i.e. when possibly incomplete or invalid) - var errMsg = AwesomeMessage.verify(payload); - if (errMsg) - throw Error(errMsg); - - // Create a new message - var message = AwesomeMessage.create(payload); // or use .fromObject if conversion is necessary - - // Encode a message to an Uint8Array (browser) or Buffer (node) - var buffer = AwesomeMessage.encode(message).finish(); - // ... do something with buffer - - // Decode an Uint8Array (browser) or Buffer (node) to a message - var message = AwesomeMessage.decode(buffer); - // ... do something with message - - // If the application uses length-delimited buffers, there is also encodeDelimited and decodeDelimited. - - // Maybe convert the message back to a plain object - var object = AwesomeMessage.toObject(message, { - longs: String, - enums: String, - bytes: String, - // see ConversionOptions - }); -}); -``` - -Additionally, promise syntax can be used by omitting the callback, if preferred: - -```js -protobuf.load("awesome.proto") - .then(function(root) { - ... - }); -``` - -### Using JSON descriptors - -The library utilizes JSON descriptors that are equivalent to a .proto definition. For example, the following is identical to the .proto definition seen above: - -```json -// awesome.json -{ - "nested": { - "awesomepackage": { - "nested": { - "AwesomeMessage": { - "fields": { - "awesomeField": { - "type": "string", - "id": 1 - } - } - } - } - } - } -} -``` - -JSON descriptors closely resemble the internal reflection structure: - -| Type (T) | Extends | Type-specific properties -|--------------------|--------------------|------------------------- -| *ReflectionObject* | | options -| *Namespace* | *ReflectionObject* | nested -| Root | *Namespace* | **nested** -| Type | *Namespace* | **fields** -| Enum | *ReflectionObject* | **values** -| Field | *ReflectionObject* | rule, **type**, **id** -| MapField | Field | **keyType** -| OneOf | *ReflectionObject* | **oneof** (array of field names) -| Service | *Namespace* | **methods** -| Method | *ReflectionObject* | type, **requestType**, **responseType**, requestStream, responseStream - -* **Bold properties** are required. *Italic types* are abstract. -* `T.fromJSON(name, json)` creates the respective reflection object from a JSON descriptor -* `T#toJSON()` creates a JSON descriptor from the respective reflection object (its name is used as the key within the parent) - -Exclusively using JSON descriptors instead of .proto files enables the use of just the light library (the parser isn't required in this case). - -A JSON descriptor can either be loaded the usual way: - -```js -protobuf.load("awesome.json", function(err, root) { - if (err) throw err; - - // Continue at "Obtain a message type" above -}); -``` - -Or it can be loaded inline: - -```js -var jsonDescriptor = require("./awesome.json"); // exemplary for node - -var root = protobuf.Root.fromJSON(jsonDescriptor); - -// Continue at "Obtain a message type" above -``` - -### Using reflection only - -Both the full and the light library include full reflection support. One could, for example, define the .proto definitions seen in the examples above using just reflection: - -```js -... -var Root = protobuf.Root, - Type = protobuf.Type, - Field = protobuf.Field; - -var AwesomeMessage = new Type("AwesomeMessage").add(new Field("awesomeField", 1, "string")); - -var root = new Root().define("awesomepackage").add(AwesomeMessage); - -// Continue at "Create a new message" above -... -``` - -Detailed information on the reflection structure is available within the [API documentation](#additional-documentation). - -### Using custom classes - -Message classes can also be extended with custom functionality and it is also possible to register a custom constructor with a reflected message type: - -```js -... - -// Define a custom constructor -function AwesomeMessage(properties) { - // custom initialization code - ... -} - -// Register the custom constructor with its reflected type (*) -root.lookupType("awesomepackage.AwesomeMessage").ctor = AwesomeMessage; - -// Define custom functionality -AwesomeMessage.customStaticMethod = function() { ... }; -AwesomeMessage.prototype.customInstanceMethod = function() { ... }; - -// Continue at "Create a new message" above -``` - -(*) Besides referencing its reflected type through `AwesomeMessage.$type` and `AwesomeMesage#$type`, the respective custom class is automatically populated with: - -* `AwesomeMessage.create` -* `AwesomeMessage.encode` and `AwesomeMessage.encodeDelimited` -* `AwesomeMessage.decode` and `AwesomeMessage.decodeDelimited` -* `AwesomeMessage.verify` -* `AwesomeMessage.fromObject`, `AwesomeMessage.toObject` and `AwesomeMessage#toJSON` - -Afterwards, decoded messages of this type are `instanceof AwesomeMessage`. - -Alternatively, it is also possible to reuse and extend the internal constructor if custom initialization code is not required: - -```js -... - -// Reuse the internal constructor -var AwesomeMessage = root.lookupType("awesomepackage.AwesomeMessage").ctor; - -// Define custom functionality -AwesomeMessage.customStaticMethod = function() { ... }; -AwesomeMessage.prototype.customInstanceMethod = function() { ... }; - -// Continue at "Create a new message" above -``` - -### Using services - -The library also supports consuming services but it doesn't make any assumptions about the actual transport channel. Instead, a user must provide a suitable RPC implementation, which is an asynchronous function that takes the reflected service method, the binary request and a node-style callback as its parameters: - -```js -function rpcImpl(method, requestData, callback) { - // perform the request using an HTTP request or a WebSocket for example - var responseData = ...; - // and call the callback with the binary response afterwards: - callback(null, responseData); -} -``` - -Below is a working example with a typescript implementation using grpc npm package. -```ts -const grpc = require('grpc') - -const Client = grpc.makeGenericClientConstructor({}) -const client = new Client( - grpcServerUrl, - grpc.credentials.createInsecure() -) - -const rpcImpl = function(method, requestData, callback) { - client.makeUnaryRequest( - method.name, - arg => arg, - arg => arg, - requestData, - callback - ) -} -``` - -Example: - -```protobuf -// greeter.proto -syntax = "proto3"; - -service Greeter { - rpc SayHello (HelloRequest) returns (HelloReply) {} -} - -message HelloRequest { - string name = 1; -} - -message HelloReply { - string message = 1; -} -``` - -```js -... -var Greeter = root.lookup("Greeter"); -var greeter = Greeter.create(/* see above */ rpcImpl, /* request delimited? */ false, /* response delimited? */ false); - -greeter.sayHello({ name: 'you' }, function(err, response) { - console.log('Greeting:', response.message); -}); -``` - -Services also support promises: - -```js -greeter.sayHello({ name: 'you' }) - .then(function(response) { - console.log('Greeting:', response.message); - }); -``` - -There is also an [example for streaming RPC](https://github.com/dcodeIO/protobuf.js/blob/master/examples/streaming-rpc.js). - -Note that the service API is meant for clients. Implementing a server-side endpoint pretty much always requires transport channel (i.e. http, websocket, etc.) specific code with the only common denominator being that it decodes and encodes messages. - -### Usage with TypeScript - -The library ships with its own [type definitions](https://github.com/dcodeIO/protobuf.js/blob/master/index.d.ts) and modern editors like [Visual Studio Code](https://code.visualstudio.com/) will automatically detect and use them for code completion. - -The npm package depends on [@types/node](https://www.npmjs.com/package/@types/node) because of `Buffer` and [@types/long](https://www.npmjs.com/package/@types/long) because of `Long`. If you are not building for node and/or not using long.js, it should be safe to exclude them manually. - -#### Using the JS API - -The API shown above works pretty much the same with TypeScript. However, because everything is typed, accessing fields on instances of dynamically generated message classes requires either using bracket-notation (i.e. `message["awesomeField"]`) or explicit casts. Alternatively, it is possible to use a [typings file generated for its static counterpart](#pbts-for-typescript). - -```ts -import { load } from "protobufjs"; // respectively "./node_modules/protobufjs" - -load("awesome.proto", function(err, root) { - if (err) - throw err; - - // example code - const AwesomeMessage = root.lookupType("awesomepackage.AwesomeMessage"); - - let message = AwesomeMessage.create({ awesomeField: "hello" }); - console.log(`message = ${JSON.stringify(message)}`); - - let buffer = AwesomeMessage.encode(message).finish(); - console.log(`buffer = ${Array.prototype.toString.call(buffer)}`); - - let decoded = AwesomeMessage.decode(buffer); - console.log(`decoded = ${JSON.stringify(decoded)}`); -}); -``` - -#### Using generated static code - -If you generated static code to `bundle.js` using the CLI and its type definitions to `bundle.d.ts`, then you can just do: - -```ts -import { AwesomeMessage } from "./bundle.js"; - -// example code -let message = AwesomeMessage.create({ awesomeField: "hello" }); -let buffer = AwesomeMessage.encode(message).finish(); -let decoded = AwesomeMessage.decode(buffer); -``` - -#### Using decorators - -The library also includes an early implementation of [decorators](https://www.typescriptlang.org/docs/handbook/decorators.html). - -**Note** that decorators are an experimental feature in TypeScript and that declaration order is important depending on the JS target. For example, `@Field.d(2, AwesomeArrayMessage)` requires that `AwesomeArrayMessage` has been defined earlier when targeting `ES5`. - -```ts -import { Message, Type, Field, OneOf } from "protobufjs/light"; // respectively "./node_modules/protobufjs/light.js" - -export class AwesomeSubMessage extends Message { - - @Field.d(1, "string") - public awesomeString: string; - -} - -export enum AwesomeEnum { - ONE = 1, - TWO = 2 -} - -@Type.d("SuperAwesomeMessage") -export class AwesomeMessage extends Message { - - @Field.d(1, "string", "optional", "awesome default string") - public awesomeField: string; - - @Field.d(2, AwesomeSubMessage) - public awesomeSubMessage: AwesomeSubMessage; - - @Field.d(3, AwesomeEnum, "optional", AwesomeEnum.ONE) - public awesomeEnum: AwesomeEnum; - - @OneOf.d("awesomeSubMessage", "awesomeEnum") - public which: string; - -} - -// example code -let message = new AwesomeMessage({ awesomeField: "hello" }); -let buffer = AwesomeMessage.encode(message).finish(); -let decoded = AwesomeMessage.decode(buffer); -``` - -Supported decorators are: - -* **Type.d(typeName?: `string`)**   *(optional)*
    - annotates a class as a protobuf message type. If `typeName` is not specified, the constructor's runtime function name is used for the reflected type. - -* **Field.d<T>(fieldId: `number`, fieldType: `string | Constructor`, fieldRule?: `"optional" | "required" | "repeated"`, defaultValue?: `T`)**
    - annotates a property as a protobuf field with the specified id and protobuf type. - -* **MapField.d<T extends { [key: string]: any }>(fieldId: `number`, fieldKeyType: `string`, fieldValueType. `string | Constructor<{}>`)**
    - annotates a property as a protobuf map field with the specified id, protobuf key and value type. - -* **OneOf.d<T extends string>(...fieldNames: `string[]`)**
    - annotates a property as a protobuf oneof covering the specified fields. - -Other notes: - -* Decorated types reside in `protobuf.roots["decorated"]` using a flat structure, so no duplicate names. -* Enums are copied to a reflected enum with a generic name on decorator evaluation because referenced enum objects have no runtime name the decorator could use. -* Default values must be specified as arguments to the decorator instead of using a property initializer for proper prototype behavior. -* Property names on decorated classes must not be renamed on compile time (i.e. by a minifier) because decorators just receive the original field name as a string. - -**ProTip!** Not as pretty, but you can [use decorators in plain JavaScript](https://github.com/dcodeIO/protobuf.js/blob/master/examples/js-decorators.js) as well. - -Additional documentation ------------------------- - -#### Protocol Buffers -* [Google's Developer Guide](https://developers.google.com/protocol-buffers/docs/overview) - -#### protobuf.js -* [API Documentation](https://protobufjs.github.io/protobuf.js) -* [CHANGELOG](https://github.com/dcodeIO/protobuf.js/blob/master/CHANGELOG.md) -* [Frequently asked questions](https://github.com/dcodeIO/protobuf.js/wiki) on our wiki - -#### Community -* [Questions and answers](http://stackoverflow.com/search?tab=newest&q=protobuf.js) on StackOverflow - -Performance ------------ -The package includes a benchmark that compares protobuf.js performance to native JSON (as far as this is possible) and [Google's JS implementation](https://github.com/google/protobuf/tree/master/js). On an i7-2600K running node 6.9.1 it yields: - -``` -benchmarking encoding performance ... - -protobuf.js (reflect) x 541,707 ops/sec ±1.13% (87 runs sampled) -protobuf.js (static) x 548,134 ops/sec ±1.38% (89 runs sampled) -JSON (string) x 318,076 ops/sec ±0.63% (93 runs sampled) -JSON (buffer) x 179,165 ops/sec ±2.26% (91 runs sampled) -google-protobuf x 74,406 ops/sec ±0.85% (86 runs sampled) - - protobuf.js (static) was fastest - protobuf.js (reflect) was 0.9% ops/sec slower (factor 1.0) - JSON (string) was 41.5% ops/sec slower (factor 1.7) - JSON (buffer) was 67.6% ops/sec slower (factor 3.1) - google-protobuf was 86.4% ops/sec slower (factor 7.3) - -benchmarking decoding performance ... - -protobuf.js (reflect) x 1,383,981 ops/sec ±0.88% (93 runs sampled) -protobuf.js (static) x 1,378,925 ops/sec ±0.81% (93 runs sampled) -JSON (string) x 302,444 ops/sec ±0.81% (93 runs sampled) -JSON (buffer) x 264,882 ops/sec ±0.81% (93 runs sampled) -google-protobuf x 179,180 ops/sec ±0.64% (94 runs sampled) - - protobuf.js (reflect) was fastest - protobuf.js (static) was 0.3% ops/sec slower (factor 1.0) - JSON (string) was 78.1% ops/sec slower (factor 4.6) - JSON (buffer) was 80.8% ops/sec slower (factor 5.2) - google-protobuf was 87.0% ops/sec slower (factor 7.7) - -benchmarking combined performance ... - -protobuf.js (reflect) x 275,900 ops/sec ±0.78% (90 runs sampled) -protobuf.js (static) x 290,096 ops/sec ±0.96% (90 runs sampled) -JSON (string) x 129,381 ops/sec ±0.77% (90 runs sampled) -JSON (buffer) x 91,051 ops/sec ±0.94% (90 runs sampled) -google-protobuf x 42,050 ops/sec ±0.85% (91 runs sampled) - - protobuf.js (static) was fastest - protobuf.js (reflect) was 4.7% ops/sec slower (factor 1.0) - JSON (string) was 55.3% ops/sec slower (factor 2.2) - JSON (buffer) was 68.6% ops/sec slower (factor 3.2) - google-protobuf was 85.5% ops/sec slower (factor 6.9) -``` - -These results are achieved by - -* generating type-specific encoders, decoders, verifiers and converters at runtime -* configuring the reader/writer interface according to the environment -* using node-specific functionality where beneficial and, of course -* avoiding unnecessary operations through splitting up [the toolset](#toolset). - -You can also run [the benchmark](https://github.com/dcodeIO/protobuf.js/blob/master/bench/index.js) ... - -``` -$> npm run bench -``` - -and [the profiler](https://github.com/dcodeIO/protobuf.js/blob/master/bench/prof.js) yourself (the latter requires a recent version of node): - -``` -$> npm run prof [iterations=10000000] -``` - -Note that as of this writing, the benchmark suite performs significantly slower on node 7.2.0 compared to 6.9.1 because moths. - -Compatibility -------------- - -* Works in all modern and not-so-modern browsers except IE8. -* Because the internals of this package do not rely on `google/protobuf/descriptor.proto`, options are parsed and presented literally. -* If typed arrays are not supported by the environment, plain arrays will be used instead. -* Support for pre-ES5 environments (except IE8) can be achieved by [using a polyfill](https://github.com/dcodeIO/protobuf.js/blob/master/scripts/polyfill.js). -* Support for [Content Security Policy](https://w3c.github.io/webappsec-csp/)-restricted environments (like Chrome extensions without [unsafe-eval](https://developer.chrome.com/extensions/contentSecurityPolicy#relaxing-eval)) can be achieved by generating and using static code instead. -* If a proper way to work with 64 bit values (uint64, int64 etc.) is required, just install [long.js](https://github.com/dcodeIO/long.js) alongside this library. All 64 bit numbers will then be returned as a `Long` instance instead of a possibly unsafe JavaScript number ([see](https://github.com/dcodeIO/long.js)). -* For descriptor.proto interoperability, see [ext/descriptor](https://github.com/dcodeIO/protobuf.js/tree/master/ext/descriptor) - -Building --------- - -To build the library or its components yourself, clone it from GitHub and install the development dependencies: - -``` -$> git clone https://github.com/dcodeIO/protobuf.js.git -$> cd protobuf.js -$> npm install -``` - -Building the respective development and production versions with their respective source maps to `dist/`: - -``` -$> npm run build -``` - -Building the documentation to `docs/`: - -``` -$> npm run docs -``` - -Building the TypeScript definition to `index.d.ts`: - -``` -$> npm run types -``` - -### Browserify integration - -By default, protobuf.js integrates into any browserify build-process without requiring any optional modules. Hence: - -* If int64 support is required, explicitly require the `long` module somewhere in your project as it will be excluded otherwise. This assumes that a global `require` function is present that protobuf.js can call to obtain the long module. - - If there is no global `require` function present after bundling, it's also possible to assign the long module programmatically: - - ```js - var Long = ...; - - protobuf.util.Long = Long; - protobuf.configure(); - ``` - -* If you have any special requirements, there is [the bundler](https://github.com/dcodeIO/protobuf.js/blob/master/scripts/bundle.js) for reference. - -**License:** [BSD 3-Clause License](https://opensource.org/licenses/BSD-3-Clause) diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/dist/light/protobuf.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/dist/light/protobuf.js deleted file mode 100644 index dc508bc4..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/dist/light/protobuf.js +++ /dev/null @@ -1,7369 +0,0 @@ -/*! - * protobuf.js v7.1.0 (c) 2016, daniel wirtz - * compiled thu, 22 sep 2022 17:16:10 utc - * licensed under the bsd-3-clause license - * see: https://github.com/dcodeio/protobuf.js for details - */ -(function(undefined){"use strict";(function prelude(modules, cache, entries) { - - // This is the prelude used to bundle protobuf.js for the browser. Wraps up the CommonJS - // sources through a conflict-free require shim and is again wrapped within an iife that - // provides a minification-friendly `undefined` var plus a global "use strict" directive - // so that minification can remove the directives of each module. - - function $require(name) { - var $module = cache[name]; - if (!$module) - modules[name][0].call($module = cache[name] = { exports: {} }, $require, $module, $module.exports); - return $module.exports; - } - - var protobuf = $require(entries[0]); - - // Expose globally - protobuf.util.global.protobuf = protobuf; - - // Be nice to AMD - if (typeof define === "function" && define.amd) - define(["long"], function(Long) { - if (Long && Long.isLong) { - protobuf.util.Long = Long; - protobuf.configure(); - } - return protobuf; - }); - - // Be nice to CommonJS - if (typeof module === "object" && module && module.exports) - module.exports = protobuf; - -})/* end of prelude */({1:[function(require,module,exports){ -"use strict"; -module.exports = asPromise; - -/** - * Callback as used by {@link util.asPromise}. - * @typedef asPromiseCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {...*} params Additional arguments - * @returns {undefined} - */ - -/** - * Returns a promise from a node-style callback function. - * @memberof util - * @param {asPromiseCallback} fn Function to call - * @param {*} ctx Function context - * @param {...*} params Function arguments - * @returns {Promise<*>} Promisified function - */ -function asPromise(fn, ctx/*, varargs */) { - var params = new Array(arguments.length - 1), - offset = 0, - index = 2, - pending = true; - while (index < arguments.length) - params[offset++] = arguments[index++]; - return new Promise(function executor(resolve, reject) { - params[offset] = function callback(err/*, varargs */) { - if (pending) { - pending = false; - if (err) - reject(err); - else { - var params = new Array(arguments.length - 1), - offset = 0; - while (offset < params.length) - params[offset++] = arguments[offset]; - resolve.apply(null, params); - } - } - }; - try { - fn.apply(ctx || null, params); - } catch (err) { - if (pending) { - pending = false; - reject(err); - } - } - }); -} - -},{}],2:[function(require,module,exports){ -"use strict"; - -/** - * A minimal base64 implementation for number arrays. - * @memberof util - * @namespace - */ -var base64 = exports; - -/** - * Calculates the byte length of a base64 encoded string. - * @param {string} string Base64 encoded string - * @returns {number} Byte length - */ -base64.length = function length(string) { - var p = string.length; - if (!p) - return 0; - var n = 0; - while (--p % 4 > 1 && string.charAt(p) === "=") - ++n; - return Math.ceil(string.length * 3) / 4 - n; -}; - -// Base64 encoding table -var b64 = new Array(64); - -// Base64 decoding table -var s64 = new Array(123); - -// 65..90, 97..122, 48..57, 43, 47 -for (var i = 0; i < 64;) - s64[b64[i] = i < 26 ? i + 65 : i < 52 ? i + 71 : i < 62 ? i - 4 : i - 59 | 43] = i++; - -/** - * Encodes a buffer to a base64 encoded string. - * @param {Uint8Array} buffer Source buffer - * @param {number} start Source start - * @param {number} end Source end - * @returns {string} Base64 encoded string - */ -base64.encode = function encode(buffer, start, end) { - var parts = null, - chunk = []; - var i = 0, // output index - j = 0, // goto index - t; // temporary - while (start < end) { - var b = buffer[start++]; - switch (j) { - case 0: - chunk[i++] = b64[b >> 2]; - t = (b & 3) << 4; - j = 1; - break; - case 1: - chunk[i++] = b64[t | b >> 4]; - t = (b & 15) << 2; - j = 2; - break; - case 2: - chunk[i++] = b64[t | b >> 6]; - chunk[i++] = b64[b & 63]; - j = 0; - break; - } - if (i > 8191) { - (parts || (parts = [])).push(String.fromCharCode.apply(String, chunk)); - i = 0; - } - } - if (j) { - chunk[i++] = b64[t]; - chunk[i++] = 61; - if (j === 1) - chunk[i++] = 61; - } - if (parts) { - if (i) - parts.push(String.fromCharCode.apply(String, chunk.slice(0, i))); - return parts.join(""); - } - return String.fromCharCode.apply(String, chunk.slice(0, i)); -}; - -var invalidEncoding = "invalid encoding"; - -/** - * Decodes a base64 encoded string to a buffer. - * @param {string} string Source string - * @param {Uint8Array} buffer Destination buffer - * @param {number} offset Destination offset - * @returns {number} Number of bytes written - * @throws {Error} If encoding is invalid - */ -base64.decode = function decode(string, buffer, offset) { - var start = offset; - var j = 0, // goto index - t; // temporary - for (var i = 0; i < string.length;) { - var c = string.charCodeAt(i++); - if (c === 61 && j > 1) - break; - if ((c = s64[c]) === undefined) - throw Error(invalidEncoding); - switch (j) { - case 0: - t = c; - j = 1; - break; - case 1: - buffer[offset++] = t << 2 | (c & 48) >> 4; - t = c; - j = 2; - break; - case 2: - buffer[offset++] = (t & 15) << 4 | (c & 60) >> 2; - t = c; - j = 3; - break; - case 3: - buffer[offset++] = (t & 3) << 6 | c; - j = 0; - break; - } - } - if (j === 1) - throw Error(invalidEncoding); - return offset - start; -}; - -/** - * Tests if the specified string appears to be base64 encoded. - * @param {string} string String to test - * @returns {boolean} `true` if probably base64 encoded, otherwise false - */ -base64.test = function test(string) { - return /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(string); -}; - -},{}],3:[function(require,module,exports){ -"use strict"; -module.exports = codegen; - -/** - * Begins generating a function. - * @memberof util - * @param {string[]} functionParams Function parameter names - * @param {string} [functionName] Function name if not anonymous - * @returns {Codegen} Appender that appends code to the function's body - */ -function codegen(functionParams, functionName) { - - /* istanbul ignore if */ - if (typeof functionParams === "string") { - functionName = functionParams; - functionParams = undefined; - } - - var body = []; - - /** - * Appends code to the function's body or finishes generation. - * @typedef Codegen - * @type {function} - * @param {string|Object.} [formatStringOrScope] Format string or, to finish the function, an object of additional scope variables, if any - * @param {...*} [formatParams] Format parameters - * @returns {Codegen|Function} Itself or the generated function if finished - * @throws {Error} If format parameter counts do not match - */ - - function Codegen(formatStringOrScope) { - // note that explicit array handling below makes this ~50% faster - - // finish the function - if (typeof formatStringOrScope !== "string") { - var source = toString(); - if (codegen.verbose) - console.log("codegen: " + source); // eslint-disable-line no-console - source = "return " + source; - if (formatStringOrScope) { - var scopeKeys = Object.keys(formatStringOrScope), - scopeParams = new Array(scopeKeys.length + 1), - scopeValues = new Array(scopeKeys.length), - scopeOffset = 0; - while (scopeOffset < scopeKeys.length) { - scopeParams[scopeOffset] = scopeKeys[scopeOffset]; - scopeValues[scopeOffset] = formatStringOrScope[scopeKeys[scopeOffset++]]; - } - scopeParams[scopeOffset] = source; - return Function.apply(null, scopeParams).apply(null, scopeValues); // eslint-disable-line no-new-func - } - return Function(source)(); // eslint-disable-line no-new-func - } - - // otherwise append to body - var formatParams = new Array(arguments.length - 1), - formatOffset = 0; - while (formatOffset < formatParams.length) - formatParams[formatOffset] = arguments[++formatOffset]; - formatOffset = 0; - formatStringOrScope = formatStringOrScope.replace(/%([%dfijs])/g, function replace($0, $1) { - var value = formatParams[formatOffset++]; - switch ($1) { - case "d": case "f": return String(Number(value)); - case "i": return String(Math.floor(value)); - case "j": return JSON.stringify(value); - case "s": return String(value); - } - return "%"; - }); - if (formatOffset !== formatParams.length) - throw Error("parameter count mismatch"); - body.push(formatStringOrScope); - return Codegen; - } - - function toString(functionNameOverride) { - return "function " + (functionNameOverride || functionName || "") + "(" + (functionParams && functionParams.join(",") || "") + "){\n " + body.join("\n ") + "\n}"; - } - - Codegen.toString = toString; - return Codegen; -} - -/** - * Begins generating a function. - * @memberof util - * @function codegen - * @param {string} [functionName] Function name if not anonymous - * @returns {Codegen} Appender that appends code to the function's body - * @variation 2 - */ - -/** - * When set to `true`, codegen will log generated code to console. Useful for debugging. - * @name util.codegen.verbose - * @type {boolean} - */ -codegen.verbose = false; - -},{}],4:[function(require,module,exports){ -"use strict"; -module.exports = EventEmitter; - -/** - * Constructs a new event emitter instance. - * @classdesc A minimal event emitter. - * @memberof util - * @constructor - */ -function EventEmitter() { - - /** - * Registered listeners. - * @type {Object.} - * @private - */ - this._listeners = {}; -} - -/** - * Registers an event listener. - * @param {string} evt Event name - * @param {function} fn Listener - * @param {*} [ctx] Listener context - * @returns {util.EventEmitter} `this` - */ -EventEmitter.prototype.on = function on(evt, fn, ctx) { - (this._listeners[evt] || (this._listeners[evt] = [])).push({ - fn : fn, - ctx : ctx || this - }); - return this; -}; - -/** - * Removes an event listener or any matching listeners if arguments are omitted. - * @param {string} [evt] Event name. Removes all listeners if omitted. - * @param {function} [fn] Listener to remove. Removes all listeners of `evt` if omitted. - * @returns {util.EventEmitter} `this` - */ -EventEmitter.prototype.off = function off(evt, fn) { - if (evt === undefined) - this._listeners = {}; - else { - if (fn === undefined) - this._listeners[evt] = []; - else { - var listeners = this._listeners[evt]; - for (var i = 0; i < listeners.length;) - if (listeners[i].fn === fn) - listeners.splice(i, 1); - else - ++i; - } - } - return this; -}; - -/** - * Emits an event by calling its listeners with the specified arguments. - * @param {string} evt Event name - * @param {...*} args Arguments - * @returns {util.EventEmitter} `this` - */ -EventEmitter.prototype.emit = function emit(evt) { - var listeners = this._listeners[evt]; - if (listeners) { - var args = [], - i = 1; - for (; i < arguments.length;) - args.push(arguments[i++]); - for (i = 0; i < listeners.length;) - listeners[i].fn.apply(listeners[i++].ctx, args); - } - return this; -}; - -},{}],5:[function(require,module,exports){ -"use strict"; -module.exports = fetch; - -var asPromise = require(1), - inquire = require(7); - -var fs = inquire("fs"); - -/** - * Node-style callback as used by {@link util.fetch}. - * @typedef FetchCallback - * @type {function} - * @param {?Error} error Error, if any, otherwise `null` - * @param {string} [contents] File contents, if there hasn't been an error - * @returns {undefined} - */ - -/** - * Options as used by {@link util.fetch}. - * @typedef FetchOptions - * @type {Object} - * @property {boolean} [binary=false] Whether expecting a binary response - * @property {boolean} [xhr=false] If `true`, forces the use of XMLHttpRequest - */ - -/** - * Fetches the contents of a file. - * @memberof util - * @param {string} filename File path or url - * @param {FetchOptions} options Fetch options - * @param {FetchCallback} callback Callback function - * @returns {undefined} - */ -function fetch(filename, options, callback) { - if (typeof options === "function") { - callback = options; - options = {}; - } else if (!options) - options = {}; - - if (!callback) - return asPromise(fetch, this, filename, options); // eslint-disable-line no-invalid-this - - // if a node-like filesystem is present, try it first but fall back to XHR if nothing is found. - if (!options.xhr && fs && fs.readFile) - return fs.readFile(filename, function fetchReadFileCallback(err, contents) { - return err && typeof XMLHttpRequest !== "undefined" - ? fetch.xhr(filename, options, callback) - : err - ? callback(err) - : callback(null, options.binary ? contents : contents.toString("utf8")); - }); - - // use the XHR version otherwise. - return fetch.xhr(filename, options, callback); -} - -/** - * Fetches the contents of a file. - * @name util.fetch - * @function - * @param {string} path File path or url - * @param {FetchCallback} callback Callback function - * @returns {undefined} - * @variation 2 - */ - -/** - * Fetches the contents of a file. - * @name util.fetch - * @function - * @param {string} path File path or url - * @param {FetchOptions} [options] Fetch options - * @returns {Promise} Promise - * @variation 3 - */ - -/**/ -fetch.xhr = function fetch_xhr(filename, options, callback) { - var xhr = new XMLHttpRequest(); - xhr.onreadystatechange /* works everywhere */ = function fetchOnReadyStateChange() { - - if (xhr.readyState !== 4) - return undefined; - - // local cors security errors return status 0 / empty string, too. afaik this cannot be - // reliably distinguished from an actually empty file for security reasons. feel free - // to send a pull request if you are aware of a solution. - if (xhr.status !== 0 && xhr.status !== 200) - return callback(Error("status " + xhr.status)); - - // if binary data is expected, make sure that some sort of array is returned, even if - // ArrayBuffers are not supported. the binary string fallback, however, is unsafe. - if (options.binary) { - var buffer = xhr.response; - if (!buffer) { - buffer = []; - for (var i = 0; i < xhr.responseText.length; ++i) - buffer.push(xhr.responseText.charCodeAt(i) & 255); - } - return callback(null, typeof Uint8Array !== "undefined" ? new Uint8Array(buffer) : buffer); - } - return callback(null, xhr.responseText); - }; - - if (options.binary) { - // ref: https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/Sending_and_Receiving_Binary_Data#Receiving_binary_data_in_older_browsers - if ("overrideMimeType" in xhr) - xhr.overrideMimeType("text/plain; charset=x-user-defined"); - xhr.responseType = "arraybuffer"; - } - - xhr.open("GET", filename); - xhr.send(); -}; - -},{"1":1,"7":7}],6:[function(require,module,exports){ -"use strict"; - -module.exports = factory(factory); - -/** - * Reads / writes floats / doubles from / to buffers. - * @name util.float - * @namespace - */ - -/** - * Writes a 32 bit float to a buffer using little endian byte order. - * @name util.float.writeFloatLE - * @function - * @param {number} val Value to write - * @param {Uint8Array} buf Target buffer - * @param {number} pos Target buffer offset - * @returns {undefined} - */ - -/** - * Writes a 32 bit float to a buffer using big endian byte order. - * @name util.float.writeFloatBE - * @function - * @param {number} val Value to write - * @param {Uint8Array} buf Target buffer - * @param {number} pos Target buffer offset - * @returns {undefined} - */ - -/** - * Reads a 32 bit float from a buffer using little endian byte order. - * @name util.float.readFloatLE - * @function - * @param {Uint8Array} buf Source buffer - * @param {number} pos Source buffer offset - * @returns {number} Value read - */ - -/** - * Reads a 32 bit float from a buffer using big endian byte order. - * @name util.float.readFloatBE - * @function - * @param {Uint8Array} buf Source buffer - * @param {number} pos Source buffer offset - * @returns {number} Value read - */ - -/** - * Writes a 64 bit double to a buffer using little endian byte order. - * @name util.float.writeDoubleLE - * @function - * @param {number} val Value to write - * @param {Uint8Array} buf Target buffer - * @param {number} pos Target buffer offset - * @returns {undefined} - */ - -/** - * Writes a 64 bit double to a buffer using big endian byte order. - * @name util.float.writeDoubleBE - * @function - * @param {number} val Value to write - * @param {Uint8Array} buf Target buffer - * @param {number} pos Target buffer offset - * @returns {undefined} - */ - -/** - * Reads a 64 bit double from a buffer using little endian byte order. - * @name util.float.readDoubleLE - * @function - * @param {Uint8Array} buf Source buffer - * @param {number} pos Source buffer offset - * @returns {number} Value read - */ - -/** - * Reads a 64 bit double from a buffer using big endian byte order. - * @name util.float.readDoubleBE - * @function - * @param {Uint8Array} buf Source buffer - * @param {number} pos Source buffer offset - * @returns {number} Value read - */ - -// Factory function for the purpose of node-based testing in modified global environments -function factory(exports) { - - // float: typed array - if (typeof Float32Array !== "undefined") (function() { - - var f32 = new Float32Array([ -0 ]), - f8b = new Uint8Array(f32.buffer), - le = f8b[3] === 128; - - function writeFloat_f32_cpy(val, buf, pos) { - f32[0] = val; - buf[pos ] = f8b[0]; - buf[pos + 1] = f8b[1]; - buf[pos + 2] = f8b[2]; - buf[pos + 3] = f8b[3]; - } - - function writeFloat_f32_rev(val, buf, pos) { - f32[0] = val; - buf[pos ] = f8b[3]; - buf[pos + 1] = f8b[2]; - buf[pos + 2] = f8b[1]; - buf[pos + 3] = f8b[0]; - } - - /* istanbul ignore next */ - exports.writeFloatLE = le ? writeFloat_f32_cpy : writeFloat_f32_rev; - /* istanbul ignore next */ - exports.writeFloatBE = le ? writeFloat_f32_rev : writeFloat_f32_cpy; - - function readFloat_f32_cpy(buf, pos) { - f8b[0] = buf[pos ]; - f8b[1] = buf[pos + 1]; - f8b[2] = buf[pos + 2]; - f8b[3] = buf[pos + 3]; - return f32[0]; - } - - function readFloat_f32_rev(buf, pos) { - f8b[3] = buf[pos ]; - f8b[2] = buf[pos + 1]; - f8b[1] = buf[pos + 2]; - f8b[0] = buf[pos + 3]; - return f32[0]; - } - - /* istanbul ignore next */ - exports.readFloatLE = le ? readFloat_f32_cpy : readFloat_f32_rev; - /* istanbul ignore next */ - exports.readFloatBE = le ? readFloat_f32_rev : readFloat_f32_cpy; - - // float: ieee754 - })(); else (function() { - - function writeFloat_ieee754(writeUint, val, buf, pos) { - var sign = val < 0 ? 1 : 0; - if (sign) - val = -val; - if (val === 0) - writeUint(1 / val > 0 ? /* positive */ 0 : /* negative 0 */ 2147483648, buf, pos); - else if (isNaN(val)) - writeUint(2143289344, buf, pos); - else if (val > 3.4028234663852886e+38) // +-Infinity - writeUint((sign << 31 | 2139095040) >>> 0, buf, pos); - else if (val < 1.1754943508222875e-38) // denormal - writeUint((sign << 31 | Math.round(val / 1.401298464324817e-45)) >>> 0, buf, pos); - else { - var exponent = Math.floor(Math.log(val) / Math.LN2), - mantissa = Math.round(val * Math.pow(2, -exponent) * 8388608) & 8388607; - writeUint((sign << 31 | exponent + 127 << 23 | mantissa) >>> 0, buf, pos); - } - } - - exports.writeFloatLE = writeFloat_ieee754.bind(null, writeUintLE); - exports.writeFloatBE = writeFloat_ieee754.bind(null, writeUintBE); - - function readFloat_ieee754(readUint, buf, pos) { - var uint = readUint(buf, pos), - sign = (uint >> 31) * 2 + 1, - exponent = uint >>> 23 & 255, - mantissa = uint & 8388607; - return exponent === 255 - ? mantissa - ? NaN - : sign * Infinity - : exponent === 0 // denormal - ? sign * 1.401298464324817e-45 * mantissa - : sign * Math.pow(2, exponent - 150) * (mantissa + 8388608); - } - - exports.readFloatLE = readFloat_ieee754.bind(null, readUintLE); - exports.readFloatBE = readFloat_ieee754.bind(null, readUintBE); - - })(); - - // double: typed array - if (typeof Float64Array !== "undefined") (function() { - - var f64 = new Float64Array([-0]), - f8b = new Uint8Array(f64.buffer), - le = f8b[7] === 128; - - function writeDouble_f64_cpy(val, buf, pos) { - f64[0] = val; - buf[pos ] = f8b[0]; - buf[pos + 1] = f8b[1]; - buf[pos + 2] = f8b[2]; - buf[pos + 3] = f8b[3]; - buf[pos + 4] = f8b[4]; - buf[pos + 5] = f8b[5]; - buf[pos + 6] = f8b[6]; - buf[pos + 7] = f8b[7]; - } - - function writeDouble_f64_rev(val, buf, pos) { - f64[0] = val; - buf[pos ] = f8b[7]; - buf[pos + 1] = f8b[6]; - buf[pos + 2] = f8b[5]; - buf[pos + 3] = f8b[4]; - buf[pos + 4] = f8b[3]; - buf[pos + 5] = f8b[2]; - buf[pos + 6] = f8b[1]; - buf[pos + 7] = f8b[0]; - } - - /* istanbul ignore next */ - exports.writeDoubleLE = le ? writeDouble_f64_cpy : writeDouble_f64_rev; - /* istanbul ignore next */ - exports.writeDoubleBE = le ? writeDouble_f64_rev : writeDouble_f64_cpy; - - function readDouble_f64_cpy(buf, pos) { - f8b[0] = buf[pos ]; - f8b[1] = buf[pos + 1]; - f8b[2] = buf[pos + 2]; - f8b[3] = buf[pos + 3]; - f8b[4] = buf[pos + 4]; - f8b[5] = buf[pos + 5]; - f8b[6] = buf[pos + 6]; - f8b[7] = buf[pos + 7]; - return f64[0]; - } - - function readDouble_f64_rev(buf, pos) { - f8b[7] = buf[pos ]; - f8b[6] = buf[pos + 1]; - f8b[5] = buf[pos + 2]; - f8b[4] = buf[pos + 3]; - f8b[3] = buf[pos + 4]; - f8b[2] = buf[pos + 5]; - f8b[1] = buf[pos + 6]; - f8b[0] = buf[pos + 7]; - return f64[0]; - } - - /* istanbul ignore next */ - exports.readDoubleLE = le ? readDouble_f64_cpy : readDouble_f64_rev; - /* istanbul ignore next */ - exports.readDoubleBE = le ? readDouble_f64_rev : readDouble_f64_cpy; - - // double: ieee754 - })(); else (function() { - - function writeDouble_ieee754(writeUint, off0, off1, val, buf, pos) { - var sign = val < 0 ? 1 : 0; - if (sign) - val = -val; - if (val === 0) { - writeUint(0, buf, pos + off0); - writeUint(1 / val > 0 ? /* positive */ 0 : /* negative 0 */ 2147483648, buf, pos + off1); - } else if (isNaN(val)) { - writeUint(0, buf, pos + off0); - writeUint(2146959360, buf, pos + off1); - } else if (val > 1.7976931348623157e+308) { // +-Infinity - writeUint(0, buf, pos + off0); - writeUint((sign << 31 | 2146435072) >>> 0, buf, pos + off1); - } else { - var mantissa; - if (val < 2.2250738585072014e-308) { // denormal - mantissa = val / 5e-324; - writeUint(mantissa >>> 0, buf, pos + off0); - writeUint((sign << 31 | mantissa / 4294967296) >>> 0, buf, pos + off1); - } else { - var exponent = Math.floor(Math.log(val) / Math.LN2); - if (exponent === 1024) - exponent = 1023; - mantissa = val * Math.pow(2, -exponent); - writeUint(mantissa * 4503599627370496 >>> 0, buf, pos + off0); - writeUint((sign << 31 | exponent + 1023 << 20 | mantissa * 1048576 & 1048575) >>> 0, buf, pos + off1); - } - } - } - - exports.writeDoubleLE = writeDouble_ieee754.bind(null, writeUintLE, 0, 4); - exports.writeDoubleBE = writeDouble_ieee754.bind(null, writeUintBE, 4, 0); - - function readDouble_ieee754(readUint, off0, off1, buf, pos) { - var lo = readUint(buf, pos + off0), - hi = readUint(buf, pos + off1); - var sign = (hi >> 31) * 2 + 1, - exponent = hi >>> 20 & 2047, - mantissa = 4294967296 * (hi & 1048575) + lo; - return exponent === 2047 - ? mantissa - ? NaN - : sign * Infinity - : exponent === 0 // denormal - ? sign * 5e-324 * mantissa - : sign * Math.pow(2, exponent - 1075) * (mantissa + 4503599627370496); - } - - exports.readDoubleLE = readDouble_ieee754.bind(null, readUintLE, 0, 4); - exports.readDoubleBE = readDouble_ieee754.bind(null, readUintBE, 4, 0); - - })(); - - return exports; -} - -// uint helpers - -function writeUintLE(val, buf, pos) { - buf[pos ] = val & 255; - buf[pos + 1] = val >>> 8 & 255; - buf[pos + 2] = val >>> 16 & 255; - buf[pos + 3] = val >>> 24; -} - -function writeUintBE(val, buf, pos) { - buf[pos ] = val >>> 24; - buf[pos + 1] = val >>> 16 & 255; - buf[pos + 2] = val >>> 8 & 255; - buf[pos + 3] = val & 255; -} - -function readUintLE(buf, pos) { - return (buf[pos ] - | buf[pos + 1] << 8 - | buf[pos + 2] << 16 - | buf[pos + 3] << 24) >>> 0; -} - -function readUintBE(buf, pos) { - return (buf[pos ] << 24 - | buf[pos + 1] << 16 - | buf[pos + 2] << 8 - | buf[pos + 3]) >>> 0; -} - -},{}],7:[function(require,module,exports){ -"use strict"; -module.exports = inquire; - -/** - * Requires a module only if available. - * @memberof util - * @param {string} moduleName Module to require - * @returns {?Object} Required module if available and not empty, otherwise `null` - */ -function inquire(moduleName) { - try { - var mod = eval("quire".replace(/^/,"re"))(moduleName); // eslint-disable-line no-eval - if (mod && (mod.length || Object.keys(mod).length)) - return mod; - } catch (e) {} // eslint-disable-line no-empty - return null; -} - -},{}],8:[function(require,module,exports){ -"use strict"; - -/** - * A minimal path module to resolve Unix, Windows and URL paths alike. - * @memberof util - * @namespace - */ -var path = exports; - -var isAbsolute = -/** - * Tests if the specified path is absolute. - * @param {string} path Path to test - * @returns {boolean} `true` if path is absolute - */ -path.isAbsolute = function isAbsolute(path) { - return /^(?:\/|\w+:)/.test(path); -}; - -var normalize = -/** - * Normalizes the specified path. - * @param {string} path Path to normalize - * @returns {string} Normalized path - */ -path.normalize = function normalize(path) { - path = path.replace(/\\/g, "/") - .replace(/\/{2,}/g, "/"); - var parts = path.split("/"), - absolute = isAbsolute(path), - prefix = ""; - if (absolute) - prefix = parts.shift() + "/"; - for (var i = 0; i < parts.length;) { - if (parts[i] === "..") { - if (i > 0 && parts[i - 1] !== "..") - parts.splice(--i, 2); - else if (absolute) - parts.splice(i, 1); - else - ++i; - } else if (parts[i] === ".") - parts.splice(i, 1); - else - ++i; - } - return prefix + parts.join("/"); -}; - -/** - * Resolves the specified include path against the specified origin path. - * @param {string} originPath Path to the origin file - * @param {string} includePath Include path relative to origin path - * @param {boolean} [alreadyNormalized=false] `true` if both paths are already known to be normalized - * @returns {string} Path to the include file - */ -path.resolve = function resolve(originPath, includePath, alreadyNormalized) { - if (!alreadyNormalized) - includePath = normalize(includePath); - if (isAbsolute(includePath)) - return includePath; - if (!alreadyNormalized) - originPath = normalize(originPath); - return (originPath = originPath.replace(/(?:\/|^)[^/]+$/, "")).length ? normalize(originPath + "/" + includePath) : includePath; -}; - -},{}],9:[function(require,module,exports){ -"use strict"; -module.exports = pool; - -/** - * An allocator as used by {@link util.pool}. - * @typedef PoolAllocator - * @type {function} - * @param {number} size Buffer size - * @returns {Uint8Array} Buffer - */ - -/** - * A slicer as used by {@link util.pool}. - * @typedef PoolSlicer - * @type {function} - * @param {number} start Start offset - * @param {number} end End offset - * @returns {Uint8Array} Buffer slice - * @this {Uint8Array} - */ - -/** - * A general purpose buffer pool. - * @memberof util - * @function - * @param {PoolAllocator} alloc Allocator - * @param {PoolSlicer} slice Slicer - * @param {number} [size=8192] Slab size - * @returns {PoolAllocator} Pooled allocator - */ -function pool(alloc, slice, size) { - var SIZE = size || 8192; - var MAX = SIZE >>> 1; - var slab = null; - var offset = SIZE; - return function pool_alloc(size) { - if (size < 1 || size > MAX) - return alloc(size); - if (offset + size > SIZE) { - slab = alloc(SIZE); - offset = 0; - } - var buf = slice.call(slab, offset, offset += size); - if (offset & 7) // align to 32 bit - offset = (offset | 7) + 1; - return buf; - }; -} - -},{}],10:[function(require,module,exports){ -"use strict"; - -/** - * A minimal UTF8 implementation for number arrays. - * @memberof util - * @namespace - */ -var utf8 = exports; - -/** - * Calculates the UTF8 byte length of a string. - * @param {string} string String - * @returns {number} Byte length - */ -utf8.length = function utf8_length(string) { - var len = 0, - c = 0; - for (var i = 0; i < string.length; ++i) { - c = string.charCodeAt(i); - if (c < 128) - len += 1; - else if (c < 2048) - len += 2; - else if ((c & 0xFC00) === 0xD800 && (string.charCodeAt(i + 1) & 0xFC00) === 0xDC00) { - ++i; - len += 4; - } else - len += 3; - } - return len; -}; - -/** - * Reads UTF8 bytes as a string. - * @param {Uint8Array} buffer Source buffer - * @param {number} start Source start - * @param {number} end Source end - * @returns {string} String read - */ -utf8.read = function utf8_read(buffer, start, end) { - var len = end - start; - if (len < 1) - return ""; - var parts = null, - chunk = [], - i = 0, // char offset - t; // temporary - while (start < end) { - t = buffer[start++]; - if (t < 128) - chunk[i++] = t; - else if (t > 191 && t < 224) - chunk[i++] = (t & 31) << 6 | buffer[start++] & 63; - else if (t > 239 && t < 365) { - t = ((t & 7) << 18 | (buffer[start++] & 63) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63) - 0x10000; - chunk[i++] = 0xD800 + (t >> 10); - chunk[i++] = 0xDC00 + (t & 1023); - } else - chunk[i++] = (t & 15) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63; - if (i > 8191) { - (parts || (parts = [])).push(String.fromCharCode.apply(String, chunk)); - i = 0; - } - } - if (parts) { - if (i) - parts.push(String.fromCharCode.apply(String, chunk.slice(0, i))); - return parts.join(""); - } - return String.fromCharCode.apply(String, chunk.slice(0, i)); -}; - -/** - * Writes a string as UTF8 bytes. - * @param {string} string Source string - * @param {Uint8Array} buffer Destination buffer - * @param {number} offset Destination offset - * @returns {number} Bytes written - */ -utf8.write = function utf8_write(string, buffer, offset) { - var start = offset, - c1, // character 1 - c2; // character 2 - for (var i = 0; i < string.length; ++i) { - c1 = string.charCodeAt(i); - if (c1 < 128) { - buffer[offset++] = c1; - } else if (c1 < 2048) { - buffer[offset++] = c1 >> 6 | 192; - buffer[offset++] = c1 & 63 | 128; - } else if ((c1 & 0xFC00) === 0xD800 && ((c2 = string.charCodeAt(i + 1)) & 0xFC00) === 0xDC00) { - c1 = 0x10000 + ((c1 & 0x03FF) << 10) + (c2 & 0x03FF); - ++i; - buffer[offset++] = c1 >> 18 | 240; - buffer[offset++] = c1 >> 12 & 63 | 128; - buffer[offset++] = c1 >> 6 & 63 | 128; - buffer[offset++] = c1 & 63 | 128; - } else { - buffer[offset++] = c1 >> 12 | 224; - buffer[offset++] = c1 >> 6 & 63 | 128; - buffer[offset++] = c1 & 63 | 128; - } - } - return offset - start; -}; - -},{}],11:[function(require,module,exports){ -"use strict"; -/** - * Runtime message from/to plain object converters. - * @namespace - */ -var converter = exports; - -var Enum = require(14), - util = require(33); - -/** - * Generates a partial value fromObject conveter. - * @param {Codegen} gen Codegen instance - * @param {Field} field Reflected field - * @param {number} fieldIndex Field index - * @param {string} prop Property reference - * @returns {Codegen} Codegen instance - * @ignore - */ -function genValuePartial_fromObject(gen, field, fieldIndex, prop) { - /* eslint-disable no-unexpected-multiline, block-scoped-var, no-redeclare */ - if (field.resolvedType) { - if (field.resolvedType instanceof Enum) { gen - ("switch(d%s){", prop); - for (var values = field.resolvedType.values, keys = Object.keys(values), i = 0; i < keys.length; ++i) { - // enum unknown values passthrough - if (values[keys[i]] === field.typeDefault) { gen - ("default:") - ("if(typeof(d%s)===\"number\"){m%s=d%s;break}", prop, prop, prop); - if (!field.repeated) gen // fallback to default value only for - // arrays, to avoid leaving holes. - ("break"); // for non-repeated fields, just ignore - } - gen - ("case%j:", keys[i]) - ("case %i:", values[keys[i]]) - ("m%s=%j", prop, values[keys[i]]) - ("break"); - } gen - ("}"); - } else gen - ("if(typeof d%s!==\"object\")", prop) - ("throw TypeError(%j)", field.fullName + ": object expected") - ("m%s=types[%i].fromObject(d%s)", prop, fieldIndex, prop); - } else { - var isUnsigned = false; - switch (field.type) { - case "double": - case "float": gen - ("m%s=Number(d%s)", prop, prop); // also catches "NaN", "Infinity" - break; - case "uint32": - case "fixed32": gen - ("m%s=d%s>>>0", prop, prop); - break; - case "int32": - case "sint32": - case "sfixed32": gen - ("m%s=d%s|0", prop, prop); - break; - case "uint64": - isUnsigned = true; - // eslint-disable-line no-fallthrough - case "int64": - case "sint64": - case "fixed64": - case "sfixed64": gen - ("if(util.Long)") - ("(m%s=util.Long.fromValue(d%s)).unsigned=%j", prop, prop, isUnsigned) - ("else if(typeof d%s===\"string\")", prop) - ("m%s=parseInt(d%s,10)", prop, prop) - ("else if(typeof d%s===\"number\")", prop) - ("m%s=d%s", prop, prop) - ("else if(typeof d%s===\"object\")", prop) - ("m%s=new util.LongBits(d%s.low>>>0,d%s.high>>>0).toNumber(%s)", prop, prop, prop, isUnsigned ? "true" : ""); - break; - case "bytes": gen - ("if(typeof d%s===\"string\")", prop) - ("util.base64.decode(d%s,m%s=util.newBuffer(util.base64.length(d%s)),0)", prop, prop, prop) - ("else if(d%s.length >= 0)", prop) - ("m%s=d%s", prop, prop); - break; - case "string": gen - ("m%s=String(d%s)", prop, prop); - break; - case "bool": gen - ("m%s=Boolean(d%s)", prop, prop); - break; - /* default: gen - ("m%s=d%s", prop, prop); - break; */ - } - } - return gen; - /* eslint-enable no-unexpected-multiline, block-scoped-var, no-redeclare */ -} - -/** - * Generates a plain object to runtime message converter specific to the specified message type. - * @param {Type} mtype Message type - * @returns {Codegen} Codegen instance - */ -converter.fromObject = function fromObject(mtype) { - /* eslint-disable no-unexpected-multiline, block-scoped-var, no-redeclare */ - var fields = mtype.fieldsArray; - var gen = util.codegen(["d"], mtype.name + "$fromObject") - ("if(d instanceof this.ctor)") - ("return d"); - if (!fields.length) return gen - ("return new this.ctor"); - gen - ("var m=new this.ctor"); - for (var i = 0; i < fields.length; ++i) { - var field = fields[i].resolve(), - prop = util.safeProp(field.name); - - // Map fields - if (field.map) { gen - ("if(d%s){", prop) - ("if(typeof d%s!==\"object\")", prop) - ("throw TypeError(%j)", field.fullName + ": object expected") - ("m%s={}", prop) - ("for(var ks=Object.keys(d%s),i=0;i>>0,m%s.high>>>0).toNumber(%s):m%s", prop, prop, prop, prop, isUnsigned ? "true": "", prop); - break; - case "bytes": gen - ("d%s=o.bytes===String?util.base64.encode(m%s,0,m%s.length):o.bytes===Array?Array.prototype.slice.call(m%s):m%s", prop, prop, prop, prop, prop); - break; - default: gen - ("d%s=m%s", prop, prop); - break; - } - } - return gen; - /* eslint-enable no-unexpected-multiline, block-scoped-var, no-redeclare */ -} - -/** - * Generates a runtime message to plain object converter specific to the specified message type. - * @param {Type} mtype Message type - * @returns {Codegen} Codegen instance - */ -converter.toObject = function toObject(mtype) { - /* eslint-disable no-unexpected-multiline, block-scoped-var, no-redeclare */ - var fields = mtype.fieldsArray.slice().sort(util.compareFieldsById); - if (!fields.length) - return util.codegen()("return {}"); - var gen = util.codegen(["m", "o"], mtype.name + "$toObject") - ("if(!o)") - ("o={}") - ("var d={}"); - - var repeatedFields = [], - mapFields = [], - normalFields = [], - i = 0; - for (; i < fields.length; ++i) - if (!fields[i].partOf) - ( fields[i].resolve().repeated ? repeatedFields - : fields[i].map ? mapFields - : normalFields).push(fields[i]); - - if (repeatedFields.length) { gen - ("if(o.arrays||o.defaults){"); - for (i = 0; i < repeatedFields.length; ++i) gen - ("d%s=[]", util.safeProp(repeatedFields[i].name)); - gen - ("}"); - } - - if (mapFields.length) { gen - ("if(o.objects||o.defaults){"); - for (i = 0; i < mapFields.length; ++i) gen - ("d%s={}", util.safeProp(mapFields[i].name)); - gen - ("}"); - } - - if (normalFields.length) { gen - ("if(o.defaults){"); - for (i = 0; i < normalFields.length; ++i) { - var field = normalFields[i], - prop = util.safeProp(field.name); - if (field.resolvedType instanceof Enum) gen - ("d%s=o.enums===String?%j:%j", prop, field.resolvedType.valuesById[field.typeDefault], field.typeDefault); - else if (field.long) gen - ("if(util.Long){") - ("var n=new util.Long(%i,%i,%j)", field.typeDefault.low, field.typeDefault.high, field.typeDefault.unsigned) - ("d%s=o.longs===String?n.toString():o.longs===Number?n.toNumber():n", prop) - ("}else") - ("d%s=o.longs===String?%j:%i", prop, field.typeDefault.toString(), field.typeDefault.toNumber()); - else if (field.bytes) { - var arrayDefault = "[" + Array.prototype.slice.call(field.typeDefault).join(",") + "]"; - gen - ("if(o.bytes===String)d%s=%j", prop, String.fromCharCode.apply(String, field.typeDefault)) - ("else{") - ("d%s=%s", prop, arrayDefault) - ("if(o.bytes!==Array)d%s=util.newBuffer(d%s)", prop, prop) - ("}"); - } else gen - ("d%s=%j", prop, field.typeDefault); // also messages (=null) - } gen - ("}"); - } - var hasKs2 = false; - for (i = 0; i < fields.length; ++i) { - var field = fields[i], - index = mtype._fieldsArray.indexOf(field), - prop = util.safeProp(field.name); - if (field.map) { - if (!hasKs2) { hasKs2 = true; gen - ("var ks2"); - } gen - ("if(m%s&&(ks2=Object.keys(m%s)).length){", prop, prop) - ("d%s={}", prop) - ("for(var j=0;j>>3){"); - - var i = 0; - for (; i < /* initializes */ mtype.fieldsArray.length; ++i) { - var field = mtype._fieldsArray[i].resolve(), - type = field.resolvedType instanceof Enum ? "int32" : field.type, - ref = "m" + util.safeProp(field.name); gen - ("case %i: {", field.id); - - // Map fields - if (field.map) { gen - ("if(%s===util.emptyObject)", ref) - ("%s={}", ref) - ("var c2 = r.uint32()+r.pos"); - - if (types.defaults[field.keyType] !== undefined) gen - ("k=%j", types.defaults[field.keyType]); - else gen - ("k=null"); - - if (types.defaults[type] !== undefined) gen - ("value=%j", types.defaults[type]); - else gen - ("value=null"); - - gen - ("while(r.pos>>3){") - ("case 1: k=r.%s(); break", field.keyType) - ("case 2:"); - - if (types.basic[type] === undefined) gen - ("value=types[%i].decode(r,r.uint32())", i); // can't be groups - else gen - ("value=r.%s()", type); - - gen - ("break") - ("default:") - ("r.skipType(tag2&7)") - ("break") - ("}") - ("}"); - - if (types.long[field.keyType] !== undefined) gen - ("%s[typeof k===\"object\"?util.longToHash(k):k]=value", ref); - else gen - ("%s[k]=value", ref); - - // Repeated fields - } else if (field.repeated) { gen - - ("if(!(%s&&%s.length))", ref, ref) - ("%s=[]", ref); - - // Packable (always check for forward and backward compatiblity) - if (types.packed[type] !== undefined) gen - ("if((t&7)===2){") - ("var c2=r.uint32()+r.pos") - ("while(r.pos>> 0, (field.id << 3 | 4) >>> 0) - : gen("types[%i].encode(%s,w.uint32(%i).fork()).ldelim()", fieldIndex, ref, (field.id << 3 | 2) >>> 0); -} - -/** - * Generates an encoder specific to the specified message type. - * @param {Type} mtype Message type - * @returns {Codegen} Codegen instance - */ -function encoder(mtype) { - /* eslint-disable no-unexpected-multiline, block-scoped-var, no-redeclare */ - var gen = util.codegen(["m", "w"], mtype.name + "$encode") - ("if(!w)") - ("w=Writer.create()"); - - var i, ref; - - // "when a message is serialized its known fields should be written sequentially by field number" - var fields = /* initializes */ mtype.fieldsArray.slice().sort(util.compareFieldsById); - - for (var i = 0; i < fields.length; ++i) { - var field = fields[i].resolve(), - index = mtype._fieldsArray.indexOf(field), - type = field.resolvedType instanceof Enum ? "int32" : field.type, - wireType = types.basic[type]; - ref = "m" + util.safeProp(field.name); - - // Map fields - if (field.map) { - gen - ("if(%s!=null&&Object.hasOwnProperty.call(m,%j)){", ref, field.name) // !== undefined && !== null - ("for(var ks=Object.keys(%s),i=0;i>> 0, 8 | types.mapKey[field.keyType], field.keyType); - if (wireType === undefined) gen - ("types[%i].encode(%s[ks[i]],w.uint32(18).fork()).ldelim().ldelim()", index, ref); // can't be groups - else gen - (".uint32(%i).%s(%s[ks[i]]).ldelim()", 16 | wireType, type, ref); - gen - ("}") - ("}"); - - // Repeated fields - } else if (field.repeated) { gen - ("if(%s!=null&&%s.length){", ref, ref); // !== undefined && !== null - - // Packed repeated - if (field.packed && types.packed[type] !== undefined) { gen - - ("w.uint32(%i).fork()", (field.id << 3 | 2) >>> 0) - ("for(var i=0;i<%s.length;++i)", ref) - ("w.%s(%s[i])", type, ref) - ("w.ldelim()"); - - // Non-packed - } else { gen - - ("for(var i=0;i<%s.length;++i)", ref); - if (wireType === undefined) - genTypePartial(gen, field, index, ref + "[i]"); - else gen - ("w.uint32(%i).%s(%s[i])", (field.id << 3 | wireType) >>> 0, type, ref); - - } gen - ("}"); - - // Non-repeated - } else { - if (field.optional) gen - ("if(%s!=null&&Object.hasOwnProperty.call(m,%j))", ref, field.name); // !== undefined && !== null - - if (wireType === undefined) - genTypePartial(gen, field, index, ref); - else gen - ("w.uint32(%i).%s(%s)", (field.id << 3 | wireType) >>> 0, type, ref); - - } - } - - return gen - ("return w"); - /* eslint-enable no-unexpected-multiline, block-scoped-var, no-redeclare */ -} - -},{"14":14,"32":32,"33":33}],14:[function(require,module,exports){ -"use strict"; -module.exports = Enum; - -// extends ReflectionObject -var ReflectionObject = require(22); -((Enum.prototype = Object.create(ReflectionObject.prototype)).constructor = Enum).className = "Enum"; - -var Namespace = require(21), - util = require(33); - -/** - * Constructs a new enum instance. - * @classdesc Reflected enum. - * @extends ReflectionObject - * @constructor - * @param {string} name Unique name within its namespace - * @param {Object.} [values] Enum values as an object, by name - * @param {Object.} [options] Declared options - * @param {string} [comment] The comment for this enum - * @param {Object.} [comments] The value comments for this enum - * @param {Object.>|undefined} [valuesOptions] The value options for this enum - */ -function Enum(name, values, options, comment, comments, valuesOptions) { - ReflectionObject.call(this, name, options); - - if (values && typeof values !== "object") - throw TypeError("values must be an object"); - - /** - * Enum values by id. - * @type {Object.} - */ - this.valuesById = {}; - - /** - * Enum values by name. - * @type {Object.} - */ - this.values = Object.create(this.valuesById); // toJSON, marker - - /** - * Enum comment text. - * @type {string|null} - */ - this.comment = comment; - - /** - * Value comment texts, if any. - * @type {Object.} - */ - this.comments = comments || {}; - - /** - * Values options, if any - * @type {Object>|undefined} - */ - this.valuesOptions = valuesOptions; - - /** - * Reserved ranges, if any. - * @type {Array.} - */ - this.reserved = undefined; // toJSON - - // Note that values inherit valuesById on their prototype which makes them a TypeScript- - // compatible enum. This is used by pbts to write actual enum definitions that work for - // static and reflection code alike instead of emitting generic object definitions. - - if (values) - for (var keys = Object.keys(values), i = 0; i < keys.length; ++i) - if (typeof values[keys[i]] === "number") // use forward entries only - this.valuesById[ this.values[keys[i]] = values[keys[i]] ] = keys[i]; -} - -/** - * Enum descriptor. - * @interface IEnum - * @property {Object.} values Enum values - * @property {Object.} [options] Enum options - */ - -/** - * Constructs an enum from an enum descriptor. - * @param {string} name Enum name - * @param {IEnum} json Enum descriptor - * @returns {Enum} Created enum - * @throws {TypeError} If arguments are invalid - */ -Enum.fromJSON = function fromJSON(name, json) { - var enm = new Enum(name, json.values, json.options, json.comment, json.comments); - enm.reserved = json.reserved; - return enm; -}; - -/** - * Converts this enum to an enum descriptor. - * @param {IToJSONOptions} [toJSONOptions] JSON conversion options - * @returns {IEnum} Enum descriptor - */ -Enum.prototype.toJSON = function toJSON(toJSONOptions) { - var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false; - return util.toObject([ - "options" , this.options, - "valuesOptions" , this.valuesOptions, - "values" , this.values, - "reserved" , this.reserved && this.reserved.length ? this.reserved : undefined, - "comment" , keepComments ? this.comment : undefined, - "comments" , keepComments ? this.comments : undefined - ]); -}; - -/** - * Adds a value to this enum. - * @param {string} name Value name - * @param {number} id Value id - * @param {string} [comment] Comment, if any - * @param {Object.|undefined} [options] Options, if any - * @returns {Enum} `this` - * @throws {TypeError} If arguments are invalid - * @throws {Error} If there is already a value with this name or id - */ -Enum.prototype.add = function add(name, id, comment, options) { - // utilized by the parser but not by .fromJSON - - if (!util.isString(name)) - throw TypeError("name must be a string"); - - if (!util.isInteger(id)) - throw TypeError("id must be an integer"); - - if (this.values[name] !== undefined) - throw Error("duplicate name '" + name + "' in " + this); - - if (this.isReservedId(id)) - throw Error("id " + id + " is reserved in " + this); - - if (this.isReservedName(name)) - throw Error("name '" + name + "' is reserved in " + this); - - if (this.valuesById[id] !== undefined) { - if (!(this.options && this.options.allow_alias)) - throw Error("duplicate id " + id + " in " + this); - this.values[name] = id; - } else - this.valuesById[this.values[name] = id] = name; - - if (options) { - if (this.valuesOptions === undefined) - this.valuesOptions = {}; - this.valuesOptions[name] = options || null; - } - - this.comments[name] = comment || null; - return this; -}; - -/** - * Removes a value from this enum - * @param {string} name Value name - * @returns {Enum} `this` - * @throws {TypeError} If arguments are invalid - * @throws {Error} If `name` is not a name of this enum - */ -Enum.prototype.remove = function remove(name) { - - if (!util.isString(name)) - throw TypeError("name must be a string"); - - var val = this.values[name]; - if (val == null) - throw Error("name '" + name + "' does not exist in " + this); - - delete this.valuesById[val]; - delete this.values[name]; - delete this.comments[name]; - if (this.valuesOptions) - delete this.valuesOptions[name]; - - return this; -}; - -/** - * Tests if the specified id is reserved. - * @param {number} id Id to test - * @returns {boolean} `true` if reserved, otherwise `false` - */ -Enum.prototype.isReservedId = function isReservedId(id) { - return Namespace.isReservedId(this.reserved, id); -}; - -/** - * Tests if the specified name is reserved. - * @param {string} name Name to test - * @returns {boolean} `true` if reserved, otherwise `false` - */ -Enum.prototype.isReservedName = function isReservedName(name) { - return Namespace.isReservedName(this.reserved, name); -}; - -},{"21":21,"22":22,"33":33}],15:[function(require,module,exports){ -"use strict"; -module.exports = Field; - -// extends ReflectionObject -var ReflectionObject = require(22); -((Field.prototype = Object.create(ReflectionObject.prototype)).constructor = Field).className = "Field"; - -var Enum = require(14), - types = require(32), - util = require(33); - -var Type; // cyclic - -var ruleRe = /^required|optional|repeated$/; - -/** - * Constructs a new message field instance. Note that {@link MapField|map fields} have their own class. - * @name Field - * @classdesc Reflected message field. - * @extends FieldBase - * @constructor - * @param {string} name Unique name within its namespace - * @param {number} id Unique id within its namespace - * @param {string} type Value type - * @param {string|Object.} [rule="optional"] Field rule - * @param {string|Object.} [extend] Extended type if different from parent - * @param {Object.} [options] Declared options - */ - -/** - * Constructs a field from a field descriptor. - * @param {string} name Field name - * @param {IField} json Field descriptor - * @returns {Field} Created field - * @throws {TypeError} If arguments are invalid - */ -Field.fromJSON = function fromJSON(name, json) { - return new Field(name, json.id, json.type, json.rule, json.extend, json.options, json.comment); -}; - -/** - * Not an actual constructor. Use {@link Field} instead. - * @classdesc Base class of all reflected message fields. This is not an actual class but here for the sake of having consistent type definitions. - * @exports FieldBase - * @extends ReflectionObject - * @constructor - * @param {string} name Unique name within its namespace - * @param {number} id Unique id within its namespace - * @param {string} type Value type - * @param {string|Object.} [rule="optional"] Field rule - * @param {string|Object.} [extend] Extended type if different from parent - * @param {Object.} [options] Declared options - * @param {string} [comment] Comment associated with this field - */ -function Field(name, id, type, rule, extend, options, comment) { - - if (util.isObject(rule)) { - comment = extend; - options = rule; - rule = extend = undefined; - } else if (util.isObject(extend)) { - comment = options; - options = extend; - extend = undefined; - } - - ReflectionObject.call(this, name, options); - - if (!util.isInteger(id) || id < 0) - throw TypeError("id must be a non-negative integer"); - - if (!util.isString(type)) - throw TypeError("type must be a string"); - - if (rule !== undefined && !ruleRe.test(rule = rule.toString().toLowerCase())) - throw TypeError("rule must be a string rule"); - - if (extend !== undefined && !util.isString(extend)) - throw TypeError("extend must be a string"); - - /** - * Field rule, if any. - * @type {string|undefined} - */ - if (rule === "proto3_optional") { - rule = "optional"; - } - this.rule = rule && rule !== "optional" ? rule : undefined; // toJSON - - /** - * Field type. - * @type {string} - */ - this.type = type; // toJSON - - /** - * Unique field id. - * @type {number} - */ - this.id = id; // toJSON, marker - - /** - * Extended type if different from parent. - * @type {string|undefined} - */ - this.extend = extend || undefined; // toJSON - - /** - * Whether this field is required. - * @type {boolean} - */ - this.required = rule === "required"; - - /** - * Whether this field is optional. - * @type {boolean} - */ - this.optional = !this.required; - - /** - * Whether this field is repeated. - * @type {boolean} - */ - this.repeated = rule === "repeated"; - - /** - * Whether this field is a map or not. - * @type {boolean} - */ - this.map = false; - - /** - * Message this field belongs to. - * @type {Type|null} - */ - this.message = null; - - /** - * OneOf this field belongs to, if any, - * @type {OneOf|null} - */ - this.partOf = null; - - /** - * The field type's default value. - * @type {*} - */ - this.typeDefault = null; - - /** - * The field's default value on prototypes. - * @type {*} - */ - this.defaultValue = null; - - /** - * Whether this field's value should be treated as a long. - * @type {boolean} - */ - this.long = util.Long ? types.long[type] !== undefined : /* istanbul ignore next */ false; - - /** - * Whether this field's value is a buffer. - * @type {boolean} - */ - this.bytes = type === "bytes"; - - /** - * Resolved type if not a basic type. - * @type {Type|Enum|null} - */ - this.resolvedType = null; - - /** - * Sister-field within the extended type if a declaring extension field. - * @type {Field|null} - */ - this.extensionField = null; - - /** - * Sister-field within the declaring namespace if an extended field. - * @type {Field|null} - */ - this.declaringField = null; - - /** - * Internally remembers whether this field is packed. - * @type {boolean|null} - * @private - */ - this._packed = null; - - /** - * Comment for this field. - * @type {string|null} - */ - this.comment = comment; -} - -/** - * Determines whether this field is packed. Only relevant when repeated and working with proto2. - * @name Field#packed - * @type {boolean} - * @readonly - */ -Object.defineProperty(Field.prototype, "packed", { - get: function() { - // defaults to packed=true if not explicity set to false - if (this._packed === null) - this._packed = this.getOption("packed") !== false; - return this._packed; - } -}); - -/** - * @override - */ -Field.prototype.setOption = function setOption(name, value, ifNotSet) { - if (name === "packed") // clear cached before setting - this._packed = null; - return ReflectionObject.prototype.setOption.call(this, name, value, ifNotSet); -}; - -/** - * Field descriptor. - * @interface IField - * @property {string} [rule="optional"] Field rule - * @property {string} type Field type - * @property {number} id Field id - * @property {Object.} [options] Field options - */ - -/** - * Extension field descriptor. - * @interface IExtensionField - * @extends IField - * @property {string} extend Extended type - */ - -/** - * Converts this field to a field descriptor. - * @param {IToJSONOptions} [toJSONOptions] JSON conversion options - * @returns {IField} Field descriptor - */ -Field.prototype.toJSON = function toJSON(toJSONOptions) { - var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false; - return util.toObject([ - "rule" , this.rule !== "optional" && this.rule || undefined, - "type" , this.type, - "id" , this.id, - "extend" , this.extend, - "options" , this.options, - "comment" , keepComments ? this.comment : undefined - ]); -}; - -/** - * Resolves this field's type references. - * @returns {Field} `this` - * @throws {Error} If any reference cannot be resolved - */ -Field.prototype.resolve = function resolve() { - - if (this.resolved) - return this; - - if ((this.typeDefault = types.defaults[this.type]) === undefined) { // if not a basic type, resolve it - this.resolvedType = (this.declaringField ? this.declaringField.parent : this.parent).lookupTypeOrEnum(this.type); - if (this.resolvedType instanceof Type) - this.typeDefault = null; - else // instanceof Enum - this.typeDefault = this.resolvedType.values[Object.keys(this.resolvedType.values)[0]]; // first defined - } else if (this.options && this.options.proto3_optional) { - // proto3 scalar value marked optional; should default to null - this.typeDefault = null; - } - - // use explicitly set default value if present - if (this.options && this.options["default"] != null) { - this.typeDefault = this.options["default"]; - if (this.resolvedType instanceof Enum && typeof this.typeDefault === "string") - this.typeDefault = this.resolvedType.values[this.typeDefault]; - } - - // remove unnecessary options - if (this.options) { - if (this.options.packed === true || this.options.packed !== undefined && this.resolvedType && !(this.resolvedType instanceof Enum)) - delete this.options.packed; - if (!Object.keys(this.options).length) - this.options = undefined; - } - - // convert to internal data type if necesssary - if (this.long) { - this.typeDefault = util.Long.fromNumber(this.typeDefault, this.type.charAt(0) === "u"); - - /* istanbul ignore else */ - if (Object.freeze) - Object.freeze(this.typeDefault); // long instances are meant to be immutable anyway (i.e. use small int cache that even requires it) - - } else if (this.bytes && typeof this.typeDefault === "string") { - var buf; - if (util.base64.test(this.typeDefault)) - util.base64.decode(this.typeDefault, buf = util.newBuffer(util.base64.length(this.typeDefault)), 0); - else - util.utf8.write(this.typeDefault, buf = util.newBuffer(util.utf8.length(this.typeDefault)), 0); - this.typeDefault = buf; - } - - // take special care of maps and repeated fields - if (this.map) - this.defaultValue = util.emptyObject; - else if (this.repeated) - this.defaultValue = util.emptyArray; - else - this.defaultValue = this.typeDefault; - - // ensure proper value on prototype - if (this.parent instanceof Type) - this.parent.ctor.prototype[this.name] = this.defaultValue; - - return ReflectionObject.prototype.resolve.call(this); -}; - -/** - * Decorator function as returned by {@link Field.d} and {@link MapField.d} (TypeScript). - * @typedef FieldDecorator - * @type {function} - * @param {Object} prototype Target prototype - * @param {string} fieldName Field name - * @returns {undefined} - */ - -/** - * Field decorator (TypeScript). - * @name Field.d - * @function - * @param {number} fieldId Field id - * @param {"double"|"float"|"int32"|"uint32"|"sint32"|"fixed32"|"sfixed32"|"int64"|"uint64"|"sint64"|"fixed64"|"sfixed64"|"string"|"bool"|"bytes"|Object} fieldType Field type - * @param {"optional"|"required"|"repeated"} [fieldRule="optional"] Field rule - * @param {T} [defaultValue] Default value - * @returns {FieldDecorator} Decorator function - * @template T extends number | number[] | Long | Long[] | string | string[] | boolean | boolean[] | Uint8Array | Uint8Array[] | Buffer | Buffer[] - */ -Field.d = function decorateField(fieldId, fieldType, fieldRule, defaultValue) { - - // submessage: decorate the submessage and use its name as the type - if (typeof fieldType === "function") - fieldType = util.decorateType(fieldType).name; - - // enum reference: create a reflected copy of the enum and keep reuseing it - else if (fieldType && typeof fieldType === "object") - fieldType = util.decorateEnum(fieldType).name; - - return function fieldDecorator(prototype, fieldName) { - util.decorateType(prototype.constructor) - .add(new Field(fieldName, fieldId, fieldType, fieldRule, { "default": defaultValue })); - }; -}; - -/** - * Field decorator (TypeScript). - * @name Field.d - * @function - * @param {number} fieldId Field id - * @param {Constructor|string} fieldType Field type - * @param {"optional"|"required"|"repeated"} [fieldRule="optional"] Field rule - * @returns {FieldDecorator} Decorator function - * @template T extends Message - * @variation 2 - */ -// like Field.d but without a default value - -// Sets up cyclic dependencies (called in index-light) -Field._configure = function configure(Type_) { - Type = Type_; -}; - -},{"14":14,"22":22,"32":32,"33":33}],16:[function(require,module,exports){ -"use strict"; -var protobuf = module.exports = require(17); - -protobuf.build = "light"; - -/** - * A node-style callback as used by {@link load} and {@link Root#load}. - * @typedef LoadCallback - * @type {function} - * @param {Error|null} error Error, if any, otherwise `null` - * @param {Root} [root] Root, if there hasn't been an error - * @returns {undefined} - */ - -/** - * Loads one or multiple .proto or preprocessed .json files into a common root namespace and calls the callback. - * @param {string|string[]} filename One or multiple files to load - * @param {Root} root Root namespace, defaults to create a new one if omitted. - * @param {LoadCallback} callback Callback function - * @returns {undefined} - * @see {@link Root#load} - */ -function load(filename, root, callback) { - if (typeof root === "function") { - callback = root; - root = new protobuf.Root(); - } else if (!root) - root = new protobuf.Root(); - return root.load(filename, callback); -} - -/** - * Loads one or multiple .proto or preprocessed .json files into a common root namespace and calls the callback. - * @name load - * @function - * @param {string|string[]} filename One or multiple files to load - * @param {LoadCallback} callback Callback function - * @returns {undefined} - * @see {@link Root#load} - * @variation 2 - */ -// function load(filename:string, callback:LoadCallback):undefined - -/** - * Loads one or multiple .proto or preprocessed .json files into a common root namespace and returns a promise. - * @name load - * @function - * @param {string|string[]} filename One or multiple files to load - * @param {Root} [root] Root namespace, defaults to create a new one if omitted. - * @returns {Promise} Promise - * @see {@link Root#load} - * @variation 3 - */ -// function load(filename:string, [root:Root]):Promise - -protobuf.load = load; - -/** - * Synchronously loads one or multiple .proto or preprocessed .json files into a common root namespace (node only). - * @param {string|string[]} filename One or multiple files to load - * @param {Root} [root] Root namespace, defaults to create a new one if omitted. - * @returns {Root} Root namespace - * @throws {Error} If synchronous fetching is not supported (i.e. in browsers) or if a file's syntax is invalid - * @see {@link Root#loadSync} - */ -function loadSync(filename, root) { - if (!root) - root = new protobuf.Root(); - return root.loadSync(filename); -} - -protobuf.loadSync = loadSync; - -// Serialization -protobuf.encoder = require(13); -protobuf.decoder = require(12); -protobuf.verifier = require(36); -protobuf.converter = require(11); - -// Reflection -protobuf.ReflectionObject = require(22); -protobuf.Namespace = require(21); -protobuf.Root = require(26); -protobuf.Enum = require(14); -protobuf.Type = require(31); -protobuf.Field = require(15); -protobuf.OneOf = require(23); -protobuf.MapField = require(18); -protobuf.Service = require(30); -protobuf.Method = require(20); - -// Runtime -protobuf.Message = require(19); -protobuf.wrappers = require(37); - -// Utility -protobuf.types = require(32); -protobuf.util = require(33); - -// Set up possibly cyclic reflection dependencies -protobuf.ReflectionObject._configure(protobuf.Root); -protobuf.Namespace._configure(protobuf.Type, protobuf.Service, protobuf.Enum); -protobuf.Root._configure(protobuf.Type); -protobuf.Field._configure(protobuf.Type); - -},{"11":11,"12":12,"13":13,"14":14,"15":15,"17":17,"18":18,"19":19,"20":20,"21":21,"22":22,"23":23,"26":26,"30":30,"31":31,"32":32,"33":33,"36":36,"37":37}],17:[function(require,module,exports){ -"use strict"; -var protobuf = exports; - -/** - * Build type, one of `"full"`, `"light"` or `"minimal"`. - * @name build - * @type {string} - * @const - */ -protobuf.build = "minimal"; - -// Serialization -protobuf.Writer = require(38); -protobuf.BufferWriter = require(39); -protobuf.Reader = require(24); -protobuf.BufferReader = require(25); - -// Utility -protobuf.util = require(35); -protobuf.rpc = require(28); -protobuf.roots = require(27); -protobuf.configure = configure; - -/* istanbul ignore next */ -/** - * Reconfigures the library according to the environment. - * @returns {undefined} - */ -function configure() { - protobuf.util._configure(); - protobuf.Writer._configure(protobuf.BufferWriter); - protobuf.Reader._configure(protobuf.BufferReader); -} - -// Set up buffer utility according to the environment -configure(); - -},{"24":24,"25":25,"27":27,"28":28,"35":35,"38":38,"39":39}],18:[function(require,module,exports){ -"use strict"; -module.exports = MapField; - -// extends Field -var Field = require(15); -((MapField.prototype = Object.create(Field.prototype)).constructor = MapField).className = "MapField"; - -var types = require(32), - util = require(33); - -/** - * Constructs a new map field instance. - * @classdesc Reflected map field. - * @extends FieldBase - * @constructor - * @param {string} name Unique name within its namespace - * @param {number} id Unique id within its namespace - * @param {string} keyType Key type - * @param {string} type Value type - * @param {Object.} [options] Declared options - * @param {string} [comment] Comment associated with this field - */ -function MapField(name, id, keyType, type, options, comment) { - Field.call(this, name, id, type, undefined, undefined, options, comment); - - /* istanbul ignore if */ - if (!util.isString(keyType)) - throw TypeError("keyType must be a string"); - - /** - * Key type. - * @type {string} - */ - this.keyType = keyType; // toJSON, marker - - /** - * Resolved key type if not a basic type. - * @type {ReflectionObject|null} - */ - this.resolvedKeyType = null; - - // Overrides Field#map - this.map = true; -} - -/** - * Map field descriptor. - * @interface IMapField - * @extends {IField} - * @property {string} keyType Key type - */ - -/** - * Extension map field descriptor. - * @interface IExtensionMapField - * @extends IMapField - * @property {string} extend Extended type - */ - -/** - * Constructs a map field from a map field descriptor. - * @param {string} name Field name - * @param {IMapField} json Map field descriptor - * @returns {MapField} Created map field - * @throws {TypeError} If arguments are invalid - */ -MapField.fromJSON = function fromJSON(name, json) { - return new MapField(name, json.id, json.keyType, json.type, json.options, json.comment); -}; - -/** - * Converts this map field to a map field descriptor. - * @param {IToJSONOptions} [toJSONOptions] JSON conversion options - * @returns {IMapField} Map field descriptor - */ -MapField.prototype.toJSON = function toJSON(toJSONOptions) { - var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false; - return util.toObject([ - "keyType" , this.keyType, - "type" , this.type, - "id" , this.id, - "extend" , this.extend, - "options" , this.options, - "comment" , keepComments ? this.comment : undefined - ]); -}; - -/** - * @override - */ -MapField.prototype.resolve = function resolve() { - if (this.resolved) - return this; - - // Besides a value type, map fields have a key type that may be "any scalar type except for floating point types and bytes" - if (types.mapKey[this.keyType] === undefined) - throw Error("invalid key type: " + this.keyType); - - return Field.prototype.resolve.call(this); -}; - -/** - * Map field decorator (TypeScript). - * @name MapField.d - * @function - * @param {number} fieldId Field id - * @param {"int32"|"uint32"|"sint32"|"fixed32"|"sfixed32"|"int64"|"uint64"|"sint64"|"fixed64"|"sfixed64"|"bool"|"string"} fieldKeyType Field key type - * @param {"double"|"float"|"int32"|"uint32"|"sint32"|"fixed32"|"sfixed32"|"int64"|"uint64"|"sint64"|"fixed64"|"sfixed64"|"bool"|"string"|"bytes"|Object|Constructor<{}>} fieldValueType Field value type - * @returns {FieldDecorator} Decorator function - * @template T extends { [key: string]: number | Long | string | boolean | Uint8Array | Buffer | number[] | Message<{}> } - */ -MapField.d = function decorateMapField(fieldId, fieldKeyType, fieldValueType) { - - // submessage value: decorate the submessage and use its name as the type - if (typeof fieldValueType === "function") - fieldValueType = util.decorateType(fieldValueType).name; - - // enum reference value: create a reflected copy of the enum and keep reuseing it - else if (fieldValueType && typeof fieldValueType === "object") - fieldValueType = util.decorateEnum(fieldValueType).name; - - return function mapFieldDecorator(prototype, fieldName) { - util.decorateType(prototype.constructor) - .add(new MapField(fieldName, fieldId, fieldKeyType, fieldValueType)); - }; -}; - -},{"15":15,"32":32,"33":33}],19:[function(require,module,exports){ -"use strict"; -module.exports = Message; - -var util = require(35); - -/** - * Constructs a new message instance. - * @classdesc Abstract runtime message. - * @constructor - * @param {Properties} [properties] Properties to set - * @template T extends object = object - */ -function Message(properties) { - // not used internally - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - this[keys[i]] = properties[keys[i]]; -} - -/** - * Reference to the reflected type. - * @name Message.$type - * @type {Type} - * @readonly - */ - -/** - * Reference to the reflected type. - * @name Message#$type - * @type {Type} - * @readonly - */ - -/*eslint-disable valid-jsdoc*/ - -/** - * Creates a new message of this type using the specified properties. - * @param {Object.} [properties] Properties to set - * @returns {Message} Message instance - * @template T extends Message - * @this Constructor - */ -Message.create = function create(properties) { - return this.$type.create(properties); -}; - -/** - * Encodes a message of this type. - * @param {T|Object.} message Message to encode - * @param {Writer} [writer] Writer to use - * @returns {Writer} Writer - * @template T extends Message - * @this Constructor - */ -Message.encode = function encode(message, writer) { - return this.$type.encode(message, writer); -}; - -/** - * Encodes a message of this type preceeded by its length as a varint. - * @param {T|Object.} message Message to encode - * @param {Writer} [writer] Writer to use - * @returns {Writer} Writer - * @template T extends Message - * @this Constructor - */ -Message.encodeDelimited = function encodeDelimited(message, writer) { - return this.$type.encodeDelimited(message, writer); -}; - -/** - * Decodes a message of this type. - * @name Message.decode - * @function - * @param {Reader|Uint8Array} reader Reader or buffer to decode - * @returns {T} Decoded message - * @template T extends Message - * @this Constructor - */ -Message.decode = function decode(reader) { - return this.$type.decode(reader); -}; - -/** - * Decodes a message of this type preceeded by its length as a varint. - * @name Message.decodeDelimited - * @function - * @param {Reader|Uint8Array} reader Reader or buffer to decode - * @returns {T} Decoded message - * @template T extends Message - * @this Constructor - */ -Message.decodeDelimited = function decodeDelimited(reader) { - return this.$type.decodeDelimited(reader); -}; - -/** - * Verifies a message of this type. - * @name Message.verify - * @function - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ -Message.verify = function verify(message) { - return this.$type.verify(message); -}; - -/** - * Creates a new message of this type from a plain object. Also converts values to their respective internal types. - * @param {Object.} object Plain object - * @returns {T} Message instance - * @template T extends Message - * @this Constructor - */ -Message.fromObject = function fromObject(object) { - return this.$type.fromObject(object); -}; - -/** - * Creates a plain object from a message of this type. Also converts values to other types if specified. - * @param {T} message Message instance - * @param {IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - * @template T extends Message - * @this Constructor - */ -Message.toObject = function toObject(message, options) { - return this.$type.toObject(message, options); -}; - -/** - * Converts this message to JSON. - * @returns {Object.} JSON object - */ -Message.prototype.toJSON = function toJSON() { - return this.$type.toObject(this, util.toJSONOptions); -}; - -/*eslint-enable valid-jsdoc*/ -},{"35":35}],20:[function(require,module,exports){ -"use strict"; -module.exports = Method; - -// extends ReflectionObject -var ReflectionObject = require(22); -((Method.prototype = Object.create(ReflectionObject.prototype)).constructor = Method).className = "Method"; - -var util = require(33); - -/** - * Constructs a new service method instance. - * @classdesc Reflected service method. - * @extends ReflectionObject - * @constructor - * @param {string} name Method name - * @param {string|undefined} type Method type, usually `"rpc"` - * @param {string} requestType Request message type - * @param {string} responseType Response message type - * @param {boolean|Object.} [requestStream] Whether the request is streamed - * @param {boolean|Object.} [responseStream] Whether the response is streamed - * @param {Object.} [options] Declared options - * @param {string} [comment] The comment for this method - * @param {Object.} [parsedOptions] Declared options, properly parsed into an object - */ -function Method(name, type, requestType, responseType, requestStream, responseStream, options, comment, parsedOptions) { - - /* istanbul ignore next */ - if (util.isObject(requestStream)) { - options = requestStream; - requestStream = responseStream = undefined; - } else if (util.isObject(responseStream)) { - options = responseStream; - responseStream = undefined; - } - - /* istanbul ignore if */ - if (!(type === undefined || util.isString(type))) - throw TypeError("type must be a string"); - - /* istanbul ignore if */ - if (!util.isString(requestType)) - throw TypeError("requestType must be a string"); - - /* istanbul ignore if */ - if (!util.isString(responseType)) - throw TypeError("responseType must be a string"); - - ReflectionObject.call(this, name, options); - - /** - * Method type. - * @type {string} - */ - this.type = type || "rpc"; // toJSON - - /** - * Request type. - * @type {string} - */ - this.requestType = requestType; // toJSON, marker - - /** - * Whether requests are streamed or not. - * @type {boolean|undefined} - */ - this.requestStream = requestStream ? true : undefined; // toJSON - - /** - * Response type. - * @type {string} - */ - this.responseType = responseType; // toJSON - - /** - * Whether responses are streamed or not. - * @type {boolean|undefined} - */ - this.responseStream = responseStream ? true : undefined; // toJSON - - /** - * Resolved request type. - * @type {Type|null} - */ - this.resolvedRequestType = null; - - /** - * Resolved response type. - * @type {Type|null} - */ - this.resolvedResponseType = null; - - /** - * Comment for this method - * @type {string|null} - */ - this.comment = comment; - - /** - * Options properly parsed into an object - */ - this.parsedOptions = parsedOptions; -} - -/** - * Method descriptor. - * @interface IMethod - * @property {string} [type="rpc"] Method type - * @property {string} requestType Request type - * @property {string} responseType Response type - * @property {boolean} [requestStream=false] Whether requests are streamed - * @property {boolean} [responseStream=false] Whether responses are streamed - * @property {Object.} [options] Method options - * @property {string} comment Method comments - * @property {Object.} [parsedOptions] Method options properly parsed into an object - */ - -/** - * Constructs a method from a method descriptor. - * @param {string} name Method name - * @param {IMethod} json Method descriptor - * @returns {Method} Created method - * @throws {TypeError} If arguments are invalid - */ -Method.fromJSON = function fromJSON(name, json) { - return new Method(name, json.type, json.requestType, json.responseType, json.requestStream, json.responseStream, json.options, json.comment, json.parsedOptions); -}; - -/** - * Converts this method to a method descriptor. - * @param {IToJSONOptions} [toJSONOptions] JSON conversion options - * @returns {IMethod} Method descriptor - */ -Method.prototype.toJSON = function toJSON(toJSONOptions) { - var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false; - return util.toObject([ - "type" , this.type !== "rpc" && /* istanbul ignore next */ this.type || undefined, - "requestType" , this.requestType, - "requestStream" , this.requestStream, - "responseType" , this.responseType, - "responseStream" , this.responseStream, - "options" , this.options, - "comment" , keepComments ? this.comment : undefined, - "parsedOptions" , this.parsedOptions, - ]); -}; - -/** - * @override - */ -Method.prototype.resolve = function resolve() { - - /* istanbul ignore if */ - if (this.resolved) - return this; - - this.resolvedRequestType = this.parent.lookupType(this.requestType); - this.resolvedResponseType = this.parent.lookupType(this.responseType); - - return ReflectionObject.prototype.resolve.call(this); -}; - -},{"22":22,"33":33}],21:[function(require,module,exports){ -"use strict"; -module.exports = Namespace; - -// extends ReflectionObject -var ReflectionObject = require(22); -((Namespace.prototype = Object.create(ReflectionObject.prototype)).constructor = Namespace).className = "Namespace"; - -var Field = require(15), - util = require(33), - OneOf = require(23); - -var Type, // cyclic - Service, - Enum; - -/** - * Constructs a new namespace instance. - * @name Namespace - * @classdesc Reflected namespace. - * @extends NamespaceBase - * @constructor - * @param {string} name Namespace name - * @param {Object.} [options] Declared options - */ - -/** - * Constructs a namespace from JSON. - * @memberof Namespace - * @function - * @param {string} name Namespace name - * @param {Object.} json JSON object - * @returns {Namespace} Created namespace - * @throws {TypeError} If arguments are invalid - */ -Namespace.fromJSON = function fromJSON(name, json) { - return new Namespace(name, json.options).addJSON(json.nested); -}; - -/** - * Converts an array of reflection objects to JSON. - * @memberof Namespace - * @param {ReflectionObject[]} array Object array - * @param {IToJSONOptions} [toJSONOptions] JSON conversion options - * @returns {Object.|undefined} JSON object or `undefined` when array is empty - */ -function arrayToJSON(array, toJSONOptions) { - if (!(array && array.length)) - return undefined; - var obj = {}; - for (var i = 0; i < array.length; ++i) - obj[array[i].name] = array[i].toJSON(toJSONOptions); - return obj; -} - -Namespace.arrayToJSON = arrayToJSON; - -/** - * Tests if the specified id is reserved. - * @param {Array.|undefined} reserved Array of reserved ranges and names - * @param {number} id Id to test - * @returns {boolean} `true` if reserved, otherwise `false` - */ -Namespace.isReservedId = function isReservedId(reserved, id) { - if (reserved) - for (var i = 0; i < reserved.length; ++i) - if (typeof reserved[i] !== "string" && reserved[i][0] <= id && reserved[i][1] > id) - return true; - return false; -}; - -/** - * Tests if the specified name is reserved. - * @param {Array.|undefined} reserved Array of reserved ranges and names - * @param {string} name Name to test - * @returns {boolean} `true` if reserved, otherwise `false` - */ -Namespace.isReservedName = function isReservedName(reserved, name) { - if (reserved) - for (var i = 0; i < reserved.length; ++i) - if (reserved[i] === name) - return true; - return false; -}; - -/** - * Not an actual constructor. Use {@link Namespace} instead. - * @classdesc Base class of all reflection objects containing nested objects. This is not an actual class but here for the sake of having consistent type definitions. - * @exports NamespaceBase - * @extends ReflectionObject - * @abstract - * @constructor - * @param {string} name Namespace name - * @param {Object.} [options] Declared options - * @see {@link Namespace} - */ -function Namespace(name, options) { - ReflectionObject.call(this, name, options); - - /** - * Nested objects by name. - * @type {Object.|undefined} - */ - this.nested = undefined; // toJSON - - /** - * Cached nested objects as an array. - * @type {ReflectionObject[]|null} - * @private - */ - this._nestedArray = null; -} - -function clearCache(namespace) { - namespace._nestedArray = null; - return namespace; -} - -/** - * Nested objects of this namespace as an array for iteration. - * @name NamespaceBase#nestedArray - * @type {ReflectionObject[]} - * @readonly - */ -Object.defineProperty(Namespace.prototype, "nestedArray", { - get: function() { - return this._nestedArray || (this._nestedArray = util.toArray(this.nested)); - } -}); - -/** - * Namespace descriptor. - * @interface INamespace - * @property {Object.} [options] Namespace options - * @property {Object.} [nested] Nested object descriptors - */ - -/** - * Any extension field descriptor. - * @typedef AnyExtensionField - * @type {IExtensionField|IExtensionMapField} - */ - -/** - * Any nested object descriptor. - * @typedef AnyNestedObject - * @type {IEnum|IType|IService|AnyExtensionField|INamespace|IOneOf} - */ - -/** - * Converts this namespace to a namespace descriptor. - * @param {IToJSONOptions} [toJSONOptions] JSON conversion options - * @returns {INamespace} Namespace descriptor - */ -Namespace.prototype.toJSON = function toJSON(toJSONOptions) { - return util.toObject([ - "options" , this.options, - "nested" , arrayToJSON(this.nestedArray, toJSONOptions) - ]); -}; - -/** - * Adds nested objects to this namespace from nested object descriptors. - * @param {Object.} nestedJson Any nested object descriptors - * @returns {Namespace} `this` - */ -Namespace.prototype.addJSON = function addJSON(nestedJson) { - var ns = this; - /* istanbul ignore else */ - if (nestedJson) { - for (var names = Object.keys(nestedJson), i = 0, nested; i < names.length; ++i) { - nested = nestedJson[names[i]]; - ns.add( // most to least likely - ( nested.fields !== undefined - ? Type.fromJSON - : nested.values !== undefined - ? Enum.fromJSON - : nested.methods !== undefined - ? Service.fromJSON - : nested.id !== undefined - ? Field.fromJSON - : Namespace.fromJSON )(names[i], nested) - ); - } - } - return this; -}; - -/** - * Gets the nested object of the specified name. - * @param {string} name Nested object name - * @returns {ReflectionObject|null} The reflection object or `null` if it doesn't exist - */ -Namespace.prototype.get = function get(name) { - return this.nested && this.nested[name] - || null; -}; - -/** - * Gets the values of the nested {@link Enum|enum} of the specified name. - * This methods differs from {@link Namespace#get|get} in that it returns an enum's values directly and throws instead of returning `null`. - * @param {string} name Nested enum name - * @returns {Object.} Enum values - * @throws {Error} If there is no such enum - */ -Namespace.prototype.getEnum = function getEnum(name) { - if (this.nested && this.nested[name] instanceof Enum) - return this.nested[name].values; - throw Error("no such enum: " + name); -}; - -/** - * Adds a nested object to this namespace. - * @param {ReflectionObject} object Nested object to add - * @returns {Namespace} `this` - * @throws {TypeError} If arguments are invalid - * @throws {Error} If there is already a nested object with this name - */ -Namespace.prototype.add = function add(object) { - - if (!(object instanceof Field && object.extend !== undefined || object instanceof Type || object instanceof OneOf || object instanceof Enum || object instanceof Service || object instanceof Namespace)) - throw TypeError("object must be a valid nested object"); - - if (!this.nested) - this.nested = {}; - else { - var prev = this.get(object.name); - if (prev) { - if (prev instanceof Namespace && object instanceof Namespace && !(prev instanceof Type || prev instanceof Service)) { - // replace plain namespace but keep existing nested elements and options - var nested = prev.nestedArray; - for (var i = 0; i < nested.length; ++i) - object.add(nested[i]); - this.remove(prev); - if (!this.nested) - this.nested = {}; - object.setOptions(prev.options, true); - - } else - throw Error("duplicate name '" + object.name + "' in " + this); - } - } - this.nested[object.name] = object; - object.onAdd(this); - return clearCache(this); -}; - -/** - * Removes a nested object from this namespace. - * @param {ReflectionObject} object Nested object to remove - * @returns {Namespace} `this` - * @throws {TypeError} If arguments are invalid - * @throws {Error} If `object` is not a member of this namespace - */ -Namespace.prototype.remove = function remove(object) { - - if (!(object instanceof ReflectionObject)) - throw TypeError("object must be a ReflectionObject"); - if (object.parent !== this) - throw Error(object + " is not a member of " + this); - - delete this.nested[object.name]; - if (!Object.keys(this.nested).length) - this.nested = undefined; - - object.onRemove(this); - return clearCache(this); -}; - -/** - * Defines additial namespaces within this one if not yet existing. - * @param {string|string[]} path Path to create - * @param {*} [json] Nested types to create from JSON - * @returns {Namespace} Pointer to the last namespace created or `this` if path is empty - */ -Namespace.prototype.define = function define(path, json) { - - if (util.isString(path)) - path = path.split("."); - else if (!Array.isArray(path)) - throw TypeError("illegal path"); - if (path && path.length && path[0] === "") - throw Error("path must be relative"); - - var ptr = this; - while (path.length > 0) { - var part = path.shift(); - if (ptr.nested && ptr.nested[part]) { - ptr = ptr.nested[part]; - if (!(ptr instanceof Namespace)) - throw Error("path conflicts with non-namespace objects"); - } else - ptr.add(ptr = new Namespace(part)); - } - if (json) - ptr.addJSON(json); - return ptr; -}; - -/** - * Resolves this namespace's and all its nested objects' type references. Useful to validate a reflection tree, but comes at a cost. - * @returns {Namespace} `this` - */ -Namespace.prototype.resolveAll = function resolveAll() { - var nested = this.nestedArray, i = 0; - while (i < nested.length) - if (nested[i] instanceof Namespace) - nested[i++].resolveAll(); - else - nested[i++].resolve(); - return this.resolve(); -}; - -/** - * Recursively looks up the reflection object matching the specified path in the scope of this namespace. - * @param {string|string[]} path Path to look up - * @param {*|Array.<*>} filterTypes Filter types, any combination of the constructors of `protobuf.Type`, `protobuf.Enum`, `protobuf.Service` etc. - * @param {boolean} [parentAlreadyChecked=false] If known, whether the parent has already been checked - * @returns {ReflectionObject|null} Looked up object or `null` if none could be found - */ -Namespace.prototype.lookup = function lookup(path, filterTypes, parentAlreadyChecked) { - - /* istanbul ignore next */ - if (typeof filterTypes === "boolean") { - parentAlreadyChecked = filterTypes; - filterTypes = undefined; - } else if (filterTypes && !Array.isArray(filterTypes)) - filterTypes = [ filterTypes ]; - - if (util.isString(path) && path.length) { - if (path === ".") - return this.root; - path = path.split("."); - } else if (!path.length) - return this; - - // Start at root if path is absolute - if (path[0] === "") - return this.root.lookup(path.slice(1), filterTypes); - - // Test if the first part matches any nested object, and if so, traverse if path contains more - var found = this.get(path[0]); - if (found) { - if (path.length === 1) { - if (!filterTypes || filterTypes.indexOf(found.constructor) > -1) - return found; - } else if (found instanceof Namespace && (found = found.lookup(path.slice(1), filterTypes, true))) - return found; - - // Otherwise try each nested namespace - } else - for (var i = 0; i < this.nestedArray.length; ++i) - if (this._nestedArray[i] instanceof Namespace && (found = this._nestedArray[i].lookup(path, filterTypes, true))) - return found; - - // If there hasn't been a match, try again at the parent - if (this.parent === null || parentAlreadyChecked) - return null; - return this.parent.lookup(path, filterTypes); -}; - -/** - * Looks up the reflection object at the specified path, relative to this namespace. - * @name NamespaceBase#lookup - * @function - * @param {string|string[]} path Path to look up - * @param {boolean} [parentAlreadyChecked=false] Whether the parent has already been checked - * @returns {ReflectionObject|null} Looked up object or `null` if none could be found - * @variation 2 - */ -// lookup(path: string, [parentAlreadyChecked: boolean]) - -/** - * Looks up the {@link Type|type} at the specified path, relative to this namespace. - * Besides its signature, this methods differs from {@link Namespace#lookup|lookup} in that it throws instead of returning `null`. - * @param {string|string[]} path Path to look up - * @returns {Type} Looked up type - * @throws {Error} If `path` does not point to a type - */ -Namespace.prototype.lookupType = function lookupType(path) { - var found = this.lookup(path, [ Type ]); - if (!found) - throw Error("no such type: " + path); - return found; -}; - -/** - * Looks up the values of the {@link Enum|enum} at the specified path, relative to this namespace. - * Besides its signature, this methods differs from {@link Namespace#lookup|lookup} in that it throws instead of returning `null`. - * @param {string|string[]} path Path to look up - * @returns {Enum} Looked up enum - * @throws {Error} If `path` does not point to an enum - */ -Namespace.prototype.lookupEnum = function lookupEnum(path) { - var found = this.lookup(path, [ Enum ]); - if (!found) - throw Error("no such Enum '" + path + "' in " + this); - return found; -}; - -/** - * Looks up the {@link Type|type} or {@link Enum|enum} at the specified path, relative to this namespace. - * Besides its signature, this methods differs from {@link Namespace#lookup|lookup} in that it throws instead of returning `null`. - * @param {string|string[]} path Path to look up - * @returns {Type} Looked up type or enum - * @throws {Error} If `path` does not point to a type or enum - */ -Namespace.prototype.lookupTypeOrEnum = function lookupTypeOrEnum(path) { - var found = this.lookup(path, [ Type, Enum ]); - if (!found) - throw Error("no such Type or Enum '" + path + "' in " + this); - return found; -}; - -/** - * Looks up the {@link Service|service} at the specified path, relative to this namespace. - * Besides its signature, this methods differs from {@link Namespace#lookup|lookup} in that it throws instead of returning `null`. - * @param {string|string[]} path Path to look up - * @returns {Service} Looked up service - * @throws {Error} If `path` does not point to a service - */ -Namespace.prototype.lookupService = function lookupService(path) { - var found = this.lookup(path, [ Service ]); - if (!found) - throw Error("no such Service '" + path + "' in " + this); - return found; -}; - -// Sets up cyclic dependencies (called in index-light) -Namespace._configure = function(Type_, Service_, Enum_) { - Type = Type_; - Service = Service_; - Enum = Enum_; -}; - -},{"15":15,"22":22,"23":23,"33":33}],22:[function(require,module,exports){ -"use strict"; -module.exports = ReflectionObject; - -ReflectionObject.className = "ReflectionObject"; - -var util = require(33); - -var Root; // cyclic - -/** - * Constructs a new reflection object instance. - * @classdesc Base class of all reflection objects. - * @constructor - * @param {string} name Object name - * @param {Object.} [options] Declared options - * @abstract - */ -function ReflectionObject(name, options) { - - if (!util.isString(name)) - throw TypeError("name must be a string"); - - if (options && !util.isObject(options)) - throw TypeError("options must be an object"); - - /** - * Options. - * @type {Object.|undefined} - */ - this.options = options; // toJSON - - /** - * Parsed Options. - * @type {Array.>|undefined} - */ - this.parsedOptions = null; - - /** - * Unique name within its namespace. - * @type {string} - */ - this.name = name; - - /** - * Parent namespace. - * @type {Namespace|null} - */ - this.parent = null; - - /** - * Whether already resolved or not. - * @type {boolean} - */ - this.resolved = false; - - /** - * Comment text, if any. - * @type {string|null} - */ - this.comment = null; - - /** - * Defining file name. - * @type {string|null} - */ - this.filename = null; -} - -Object.defineProperties(ReflectionObject.prototype, { - - /** - * Reference to the root namespace. - * @name ReflectionObject#root - * @type {Root} - * @readonly - */ - root: { - get: function() { - var ptr = this; - while (ptr.parent !== null) - ptr = ptr.parent; - return ptr; - } - }, - - /** - * Full name including leading dot. - * @name ReflectionObject#fullName - * @type {string} - * @readonly - */ - fullName: { - get: function() { - var path = [ this.name ], - ptr = this.parent; - while (ptr) { - path.unshift(ptr.name); - ptr = ptr.parent; - } - return path.join("."); - } - } -}); - -/** - * Converts this reflection object to its descriptor representation. - * @returns {Object.} Descriptor - * @abstract - */ -ReflectionObject.prototype.toJSON = /* istanbul ignore next */ function toJSON() { - throw Error(); // not implemented, shouldn't happen -}; - -/** - * Called when this object is added to a parent. - * @param {ReflectionObject} parent Parent added to - * @returns {undefined} - */ -ReflectionObject.prototype.onAdd = function onAdd(parent) { - if (this.parent && this.parent !== parent) - this.parent.remove(this); - this.parent = parent; - this.resolved = false; - var root = parent.root; - if (root instanceof Root) - root._handleAdd(this); -}; - -/** - * Called when this object is removed from a parent. - * @param {ReflectionObject} parent Parent removed from - * @returns {undefined} - */ -ReflectionObject.prototype.onRemove = function onRemove(parent) { - var root = parent.root; - if (root instanceof Root) - root._handleRemove(this); - this.parent = null; - this.resolved = false; -}; - -/** - * Resolves this objects type references. - * @returns {ReflectionObject} `this` - */ -ReflectionObject.prototype.resolve = function resolve() { - if (this.resolved) - return this; - if (this.root instanceof Root) - this.resolved = true; // only if part of a root - return this; -}; - -/** - * Gets an option value. - * @param {string} name Option name - * @returns {*} Option value or `undefined` if not set - */ -ReflectionObject.prototype.getOption = function getOption(name) { - if (this.options) - return this.options[name]; - return undefined; -}; - -/** - * Sets an option. - * @param {string} name Option name - * @param {*} value Option value - * @param {boolean} [ifNotSet] Sets the option only if it isn't currently set - * @returns {ReflectionObject} `this` - */ -ReflectionObject.prototype.setOption = function setOption(name, value, ifNotSet) { - if (!ifNotSet || !this.options || this.options[name] === undefined) - (this.options || (this.options = {}))[name] = value; - return this; -}; - -/** - * Sets a parsed option. - * @param {string} name parsed Option name - * @param {*} value Option value - * @param {string} propName dot '.' delimited full path of property within the option to set. if undefined\empty, will add a new option with that value - * @returns {ReflectionObject} `this` - */ -ReflectionObject.prototype.setParsedOption = function setParsedOption(name, value, propName) { - if (!this.parsedOptions) { - this.parsedOptions = []; - } - var parsedOptions = this.parsedOptions; - if (propName) { - // If setting a sub property of an option then try to merge it - // with an existing option - var opt = parsedOptions.find(function (opt) { - return Object.prototype.hasOwnProperty.call(opt, name); - }); - if (opt) { - // If we found an existing option - just merge the property value - var newValue = opt[name]; - util.setProperty(newValue, propName, value); - } else { - // otherwise, create a new option, set it's property and add it to the list - opt = {}; - opt[name] = util.setProperty({}, propName, value); - parsedOptions.push(opt); - } - } else { - // Always create a new option when setting the value of the option itself - var newOpt = {}; - newOpt[name] = value; - parsedOptions.push(newOpt); - } - return this; -}; - -/** - * Sets multiple options. - * @param {Object.} options Options to set - * @param {boolean} [ifNotSet] Sets an option only if it isn't currently set - * @returns {ReflectionObject} `this` - */ -ReflectionObject.prototype.setOptions = function setOptions(options, ifNotSet) { - if (options) - for (var keys = Object.keys(options), i = 0; i < keys.length; ++i) - this.setOption(keys[i], options[keys[i]], ifNotSet); - return this; -}; - -/** - * Converts this instance to its string representation. - * @returns {string} Class name[, space, full name] - */ -ReflectionObject.prototype.toString = function toString() { - var className = this.constructor.className, - fullName = this.fullName; - if (fullName.length) - return className + " " + fullName; - return className; -}; - -// Sets up cyclic dependencies (called in index-light) -ReflectionObject._configure = function(Root_) { - Root = Root_; -}; - -},{"33":33}],23:[function(require,module,exports){ -"use strict"; -module.exports = OneOf; - -// extends ReflectionObject -var ReflectionObject = require(22); -((OneOf.prototype = Object.create(ReflectionObject.prototype)).constructor = OneOf).className = "OneOf"; - -var Field = require(15), - util = require(33); - -/** - * Constructs a new oneof instance. - * @classdesc Reflected oneof. - * @extends ReflectionObject - * @constructor - * @param {string} name Oneof name - * @param {string[]|Object.} [fieldNames] Field names - * @param {Object.} [options] Declared options - * @param {string} [comment] Comment associated with this field - */ -function OneOf(name, fieldNames, options, comment) { - if (!Array.isArray(fieldNames)) { - options = fieldNames; - fieldNames = undefined; - } - ReflectionObject.call(this, name, options); - - /* istanbul ignore if */ - if (!(fieldNames === undefined || Array.isArray(fieldNames))) - throw TypeError("fieldNames must be an Array"); - - /** - * Field names that belong to this oneof. - * @type {string[]} - */ - this.oneof = fieldNames || []; // toJSON, marker - - /** - * Fields that belong to this oneof as an array for iteration. - * @type {Field[]} - * @readonly - */ - this.fieldsArray = []; // declared readonly for conformance, possibly not yet added to parent - - /** - * Comment for this field. - * @type {string|null} - */ - this.comment = comment; -} - -/** - * Oneof descriptor. - * @interface IOneOf - * @property {Array.} oneof Oneof field names - * @property {Object.} [options] Oneof options - */ - -/** - * Constructs a oneof from a oneof descriptor. - * @param {string} name Oneof name - * @param {IOneOf} json Oneof descriptor - * @returns {OneOf} Created oneof - * @throws {TypeError} If arguments are invalid - */ -OneOf.fromJSON = function fromJSON(name, json) { - return new OneOf(name, json.oneof, json.options, json.comment); -}; - -/** - * Converts this oneof to a oneof descriptor. - * @param {IToJSONOptions} [toJSONOptions] JSON conversion options - * @returns {IOneOf} Oneof descriptor - */ -OneOf.prototype.toJSON = function toJSON(toJSONOptions) { - var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false; - return util.toObject([ - "options" , this.options, - "oneof" , this.oneof, - "comment" , keepComments ? this.comment : undefined - ]); -}; - -/** - * Adds the fields of the specified oneof to the parent if not already done so. - * @param {OneOf} oneof The oneof - * @returns {undefined} - * @inner - * @ignore - */ -function addFieldsToParent(oneof) { - if (oneof.parent) - for (var i = 0; i < oneof.fieldsArray.length; ++i) - if (!oneof.fieldsArray[i].parent) - oneof.parent.add(oneof.fieldsArray[i]); -} - -/** - * Adds a field to this oneof and removes it from its current parent, if any. - * @param {Field} field Field to add - * @returns {OneOf} `this` - */ -OneOf.prototype.add = function add(field) { - - /* istanbul ignore if */ - if (!(field instanceof Field)) - throw TypeError("field must be a Field"); - - if (field.parent && field.parent !== this.parent) - field.parent.remove(field); - this.oneof.push(field.name); - this.fieldsArray.push(field); - field.partOf = this; // field.parent remains null - addFieldsToParent(this); - return this; -}; - -/** - * Removes a field from this oneof and puts it back to the oneof's parent. - * @param {Field} field Field to remove - * @returns {OneOf} `this` - */ -OneOf.prototype.remove = function remove(field) { - - /* istanbul ignore if */ - if (!(field instanceof Field)) - throw TypeError("field must be a Field"); - - var index = this.fieldsArray.indexOf(field); - - /* istanbul ignore if */ - if (index < 0) - throw Error(field + " is not a member of " + this); - - this.fieldsArray.splice(index, 1); - index = this.oneof.indexOf(field.name); - - /* istanbul ignore else */ - if (index > -1) // theoretical - this.oneof.splice(index, 1); - - field.partOf = null; - return this; -}; - -/** - * @override - */ -OneOf.prototype.onAdd = function onAdd(parent) { - ReflectionObject.prototype.onAdd.call(this, parent); - var self = this; - // Collect present fields - for (var i = 0; i < this.oneof.length; ++i) { - var field = parent.get(this.oneof[i]); - if (field && !field.partOf) { - field.partOf = self; - self.fieldsArray.push(field); - } - } - // Add not yet present fields - addFieldsToParent(this); -}; - -/** - * @override - */ -OneOf.prototype.onRemove = function onRemove(parent) { - for (var i = 0, field; i < this.fieldsArray.length; ++i) - if ((field = this.fieldsArray[i]).parent) - field.parent.remove(field); - ReflectionObject.prototype.onRemove.call(this, parent); -}; - -/** - * Decorator function as returned by {@link OneOf.d} (TypeScript). - * @typedef OneOfDecorator - * @type {function} - * @param {Object} prototype Target prototype - * @param {string} oneofName OneOf name - * @returns {undefined} - */ - -/** - * OneOf decorator (TypeScript). - * @function - * @param {...string} fieldNames Field names - * @returns {OneOfDecorator} Decorator function - * @template T extends string - */ -OneOf.d = function decorateOneOf() { - var fieldNames = new Array(arguments.length), - index = 0; - while (index < arguments.length) - fieldNames[index] = arguments[index++]; - return function oneOfDecorator(prototype, oneofName) { - util.decorateType(prototype.constructor) - .add(new OneOf(oneofName, fieldNames)); - Object.defineProperty(prototype, oneofName, { - get: util.oneOfGetter(fieldNames), - set: util.oneOfSetter(fieldNames) - }); - }; -}; - -},{"15":15,"22":22,"33":33}],24:[function(require,module,exports){ -"use strict"; -module.exports = Reader; - -var util = require(35); - -var BufferReader; // cyclic - -var LongBits = util.LongBits, - utf8 = util.utf8; - -/* istanbul ignore next */ -function indexOutOfRange(reader, writeLength) { - return RangeError("index out of range: " + reader.pos + " + " + (writeLength || 1) + " > " + reader.len); -} - -/** - * Constructs a new reader instance using the specified buffer. - * @classdesc Wire format reader using `Uint8Array` if available, otherwise `Array`. - * @constructor - * @param {Uint8Array} buffer Buffer to read from - */ -function Reader(buffer) { - - /** - * Read buffer. - * @type {Uint8Array} - */ - this.buf = buffer; - - /** - * Read buffer position. - * @type {number} - */ - this.pos = 0; - - /** - * Read buffer length. - * @type {number} - */ - this.len = buffer.length; -} - -var create_array = typeof Uint8Array !== "undefined" - ? function create_typed_array(buffer) { - if (buffer instanceof Uint8Array || Array.isArray(buffer)) - return new Reader(buffer); - throw Error("illegal buffer"); - } - /* istanbul ignore next */ - : function create_array(buffer) { - if (Array.isArray(buffer)) - return new Reader(buffer); - throw Error("illegal buffer"); - }; - -var create = function create() { - return util.Buffer - ? function create_buffer_setup(buffer) { - return (Reader.create = function create_buffer(buffer) { - return util.Buffer.isBuffer(buffer) - ? new BufferReader(buffer) - /* istanbul ignore next */ - : create_array(buffer); - })(buffer); - } - /* istanbul ignore next */ - : create_array; -}; - -/** - * Creates a new reader using the specified buffer. - * @function - * @param {Uint8Array|Buffer} buffer Buffer to read from - * @returns {Reader|BufferReader} A {@link BufferReader} if `buffer` is a Buffer, otherwise a {@link Reader} - * @throws {Error} If `buffer` is not a valid buffer - */ -Reader.create = create(); - -Reader.prototype._slice = util.Array.prototype.subarray || /* istanbul ignore next */ util.Array.prototype.slice; - -/** - * Reads a varint as an unsigned 32 bit value. - * @function - * @returns {number} Value read - */ -Reader.prototype.uint32 = (function read_uint32_setup() { - var value = 4294967295; // optimizer type-hint, tends to deopt otherwise (?!) - return function read_uint32() { - value = ( this.buf[this.pos] & 127 ) >>> 0; if (this.buf[this.pos++] < 128) return value; - value = (value | (this.buf[this.pos] & 127) << 7) >>> 0; if (this.buf[this.pos++] < 128) return value; - value = (value | (this.buf[this.pos] & 127) << 14) >>> 0; if (this.buf[this.pos++] < 128) return value; - value = (value | (this.buf[this.pos] & 127) << 21) >>> 0; if (this.buf[this.pos++] < 128) return value; - value = (value | (this.buf[this.pos] & 15) << 28) >>> 0; if (this.buf[this.pos++] < 128) return value; - - /* istanbul ignore if */ - if ((this.pos += 5) > this.len) { - this.pos = this.len; - throw indexOutOfRange(this, 10); - } - return value; - }; -})(); - -/** - * Reads a varint as a signed 32 bit value. - * @returns {number} Value read - */ -Reader.prototype.int32 = function read_int32() { - return this.uint32() | 0; -}; - -/** - * Reads a zig-zag encoded varint as a signed 32 bit value. - * @returns {number} Value read - */ -Reader.prototype.sint32 = function read_sint32() { - var value = this.uint32(); - return value >>> 1 ^ -(value & 1) | 0; -}; - -/* eslint-disable no-invalid-this */ - -function readLongVarint() { - // tends to deopt with local vars for octet etc. - var bits = new LongBits(0, 0); - var i = 0; - if (this.len - this.pos > 4) { // fast route (lo) - for (; i < 4; ++i) { - // 1st..4th - bits.lo = (bits.lo | (this.buf[this.pos] & 127) << i * 7) >>> 0; - if (this.buf[this.pos++] < 128) - return bits; - } - // 5th - bits.lo = (bits.lo | (this.buf[this.pos] & 127) << 28) >>> 0; - bits.hi = (bits.hi | (this.buf[this.pos] & 127) >> 4) >>> 0; - if (this.buf[this.pos++] < 128) - return bits; - i = 0; - } else { - for (; i < 3; ++i) { - /* istanbul ignore if */ - if (this.pos >= this.len) - throw indexOutOfRange(this); - // 1st..3th - bits.lo = (bits.lo | (this.buf[this.pos] & 127) << i * 7) >>> 0; - if (this.buf[this.pos++] < 128) - return bits; - } - // 4th - bits.lo = (bits.lo | (this.buf[this.pos++] & 127) << i * 7) >>> 0; - return bits; - } - if (this.len - this.pos > 4) { // fast route (hi) - for (; i < 5; ++i) { - // 6th..10th - bits.hi = (bits.hi | (this.buf[this.pos] & 127) << i * 7 + 3) >>> 0; - if (this.buf[this.pos++] < 128) - return bits; - } - } else { - for (; i < 5; ++i) { - /* istanbul ignore if */ - if (this.pos >= this.len) - throw indexOutOfRange(this); - // 6th..10th - bits.hi = (bits.hi | (this.buf[this.pos] & 127) << i * 7 + 3) >>> 0; - if (this.buf[this.pos++] < 128) - return bits; - } - } - /* istanbul ignore next */ - throw Error("invalid varint encoding"); -} - -/* eslint-enable no-invalid-this */ - -/** - * Reads a varint as a signed 64 bit value. - * @name Reader#int64 - * @function - * @returns {Long} Value read - */ - -/** - * Reads a varint as an unsigned 64 bit value. - * @name Reader#uint64 - * @function - * @returns {Long} Value read - */ - -/** - * Reads a zig-zag encoded varint as a signed 64 bit value. - * @name Reader#sint64 - * @function - * @returns {Long} Value read - */ - -/** - * Reads a varint as a boolean. - * @returns {boolean} Value read - */ -Reader.prototype.bool = function read_bool() { - return this.uint32() !== 0; -}; - -function readFixed32_end(buf, end) { // note that this uses `end`, not `pos` - return (buf[end - 4] - | buf[end - 3] << 8 - | buf[end - 2] << 16 - | buf[end - 1] << 24) >>> 0; -} - -/** - * Reads fixed 32 bits as an unsigned 32 bit integer. - * @returns {number} Value read - */ -Reader.prototype.fixed32 = function read_fixed32() { - - /* istanbul ignore if */ - if (this.pos + 4 > this.len) - throw indexOutOfRange(this, 4); - - return readFixed32_end(this.buf, this.pos += 4); -}; - -/** - * Reads fixed 32 bits as a signed 32 bit integer. - * @returns {number} Value read - */ -Reader.prototype.sfixed32 = function read_sfixed32() { - - /* istanbul ignore if */ - if (this.pos + 4 > this.len) - throw indexOutOfRange(this, 4); - - return readFixed32_end(this.buf, this.pos += 4) | 0; -}; - -/* eslint-disable no-invalid-this */ - -function readFixed64(/* this: Reader */) { - - /* istanbul ignore if */ - if (this.pos + 8 > this.len) - throw indexOutOfRange(this, 8); - - return new LongBits(readFixed32_end(this.buf, this.pos += 4), readFixed32_end(this.buf, this.pos += 4)); -} - -/* eslint-enable no-invalid-this */ - -/** - * Reads fixed 64 bits. - * @name Reader#fixed64 - * @function - * @returns {Long} Value read - */ - -/** - * Reads zig-zag encoded fixed 64 bits. - * @name Reader#sfixed64 - * @function - * @returns {Long} Value read - */ - -/** - * Reads a float (32 bit) as a number. - * @function - * @returns {number} Value read - */ -Reader.prototype.float = function read_float() { - - /* istanbul ignore if */ - if (this.pos + 4 > this.len) - throw indexOutOfRange(this, 4); - - var value = util.float.readFloatLE(this.buf, this.pos); - this.pos += 4; - return value; -}; - -/** - * Reads a double (64 bit float) as a number. - * @function - * @returns {number} Value read - */ -Reader.prototype.double = function read_double() { - - /* istanbul ignore if */ - if (this.pos + 8 > this.len) - throw indexOutOfRange(this, 4); - - var value = util.float.readDoubleLE(this.buf, this.pos); - this.pos += 8; - return value; -}; - -/** - * Reads a sequence of bytes preceeded by its length as a varint. - * @returns {Uint8Array} Value read - */ -Reader.prototype.bytes = function read_bytes() { - var length = this.uint32(), - start = this.pos, - end = this.pos + length; - - /* istanbul ignore if */ - if (end > this.len) - throw indexOutOfRange(this, length); - - this.pos += length; - if (Array.isArray(this.buf)) // plain array - return this.buf.slice(start, end); - return start === end // fix for IE 10/Win8 and others' subarray returning array of size 1 - ? new this.buf.constructor(0) - : this._slice.call(this.buf, start, end); -}; - -/** - * Reads a string preceeded by its byte length as a varint. - * @returns {string} Value read - */ -Reader.prototype.string = function read_string() { - var bytes = this.bytes(); - return utf8.read(bytes, 0, bytes.length); -}; - -/** - * Skips the specified number of bytes if specified, otherwise skips a varint. - * @param {number} [length] Length if known, otherwise a varint is assumed - * @returns {Reader} `this` - */ -Reader.prototype.skip = function skip(length) { - if (typeof length === "number") { - /* istanbul ignore if */ - if (this.pos + length > this.len) - throw indexOutOfRange(this, length); - this.pos += length; - } else { - do { - /* istanbul ignore if */ - if (this.pos >= this.len) - throw indexOutOfRange(this); - } while (this.buf[this.pos++] & 128); - } - return this; -}; - -/** - * Skips the next element of the specified wire type. - * @param {number} wireType Wire type received - * @returns {Reader} `this` - */ -Reader.prototype.skipType = function(wireType) { - switch (wireType) { - case 0: - this.skip(); - break; - case 1: - this.skip(8); - break; - case 2: - this.skip(this.uint32()); - break; - case 3: - while ((wireType = this.uint32() & 7) !== 4) { - this.skipType(wireType); - } - break; - case 5: - this.skip(4); - break; - - /* istanbul ignore next */ - default: - throw Error("invalid wire type " + wireType + " at offset " + this.pos); - } - return this; -}; - -Reader._configure = function(BufferReader_) { - BufferReader = BufferReader_; - Reader.create = create(); - BufferReader._configure(); - - var fn = util.Long ? "toLong" : /* istanbul ignore next */ "toNumber"; - util.merge(Reader.prototype, { - - int64: function read_int64() { - return readLongVarint.call(this)[fn](false); - }, - - uint64: function read_uint64() { - return readLongVarint.call(this)[fn](true); - }, - - sint64: function read_sint64() { - return readLongVarint.call(this).zzDecode()[fn](false); - }, - - fixed64: function read_fixed64() { - return readFixed64.call(this)[fn](true); - }, - - sfixed64: function read_sfixed64() { - return readFixed64.call(this)[fn](false); - } - - }); -}; - -},{"35":35}],25:[function(require,module,exports){ -"use strict"; -module.exports = BufferReader; - -// extends Reader -var Reader = require(24); -(BufferReader.prototype = Object.create(Reader.prototype)).constructor = BufferReader; - -var util = require(35); - -/** - * Constructs a new buffer reader instance. - * @classdesc Wire format reader using node buffers. - * @extends Reader - * @constructor - * @param {Buffer} buffer Buffer to read from - */ -function BufferReader(buffer) { - Reader.call(this, buffer); - - /** - * Read buffer. - * @name BufferReader#buf - * @type {Buffer} - */ -} - -BufferReader._configure = function () { - /* istanbul ignore else */ - if (util.Buffer) - BufferReader.prototype._slice = util.Buffer.prototype.slice; -}; - - -/** - * @override - */ -BufferReader.prototype.string = function read_string_buffer() { - var len = this.uint32(); // modifies pos - return this.buf.utf8Slice - ? this.buf.utf8Slice(this.pos, this.pos = Math.min(this.pos + len, this.len)) - : this.buf.toString("utf-8", this.pos, this.pos = Math.min(this.pos + len, this.len)); -}; - -/** - * Reads a sequence of bytes preceeded by its length as a varint. - * @name BufferReader#bytes - * @function - * @returns {Buffer} Value read - */ - -BufferReader._configure(); - -},{"24":24,"35":35}],26:[function(require,module,exports){ -"use strict"; -module.exports = Root; - -// extends Namespace -var Namespace = require(21); -((Root.prototype = Object.create(Namespace.prototype)).constructor = Root).className = "Root"; - -var Field = require(15), - Enum = require(14), - OneOf = require(23), - util = require(33); - -var Type, // cyclic - parse, // might be excluded - common; // " - -/** - * Constructs a new root namespace instance. - * @classdesc Root namespace wrapping all types, enums, services, sub-namespaces etc. that belong together. - * @extends NamespaceBase - * @constructor - * @param {Object.} [options] Top level options - */ -function Root(options) { - Namespace.call(this, "", options); - - /** - * Deferred extension fields. - * @type {Field[]} - */ - this.deferred = []; - - /** - * Resolved file names of loaded files. - * @type {string[]} - */ - this.files = []; -} - -/** - * Loads a namespace descriptor into a root namespace. - * @param {INamespace} json Nameespace descriptor - * @param {Root} [root] Root namespace, defaults to create a new one if omitted - * @returns {Root} Root namespace - */ -Root.fromJSON = function fromJSON(json, root) { - if (!root) - root = new Root(); - if (json.options) - root.setOptions(json.options); - return root.addJSON(json.nested); -}; - -/** - * Resolves the path of an imported file, relative to the importing origin. - * This method exists so you can override it with your own logic in case your imports are scattered over multiple directories. - * @function - * @param {string} origin The file name of the importing file - * @param {string} target The file name being imported - * @returns {string|null} Resolved path to `target` or `null` to skip the file - */ -Root.prototype.resolvePath = util.path.resolve; - -/** - * Fetch content from file path or url - * This method exists so you can override it with your own logic. - * @function - * @param {string} path File path or url - * @param {FetchCallback} callback Callback function - * @returns {undefined} - */ -Root.prototype.fetch = util.fetch; - -// A symbol-like function to safely signal synchronous loading -/* istanbul ignore next */ -function SYNC() {} // eslint-disable-line no-empty-function - -/** - * Loads one or multiple .proto or preprocessed .json files into this root namespace and calls the callback. - * @param {string|string[]} filename Names of one or multiple files to load - * @param {IParseOptions} options Parse options - * @param {LoadCallback} callback Callback function - * @returns {undefined} - */ -Root.prototype.load = function load(filename, options, callback) { - if (typeof options === "function") { - callback = options; - options = undefined; - } - var self = this; - if (!callback) - return util.asPromise(load, self, filename, options); - - var sync = callback === SYNC; // undocumented - - // Finishes loading by calling the callback (exactly once) - function finish(err, root) { - /* istanbul ignore if */ - if (!callback) - return; - var cb = callback; - callback = null; - if (sync) - throw err; - cb(err, root); - } - - // Bundled definition existence checking - function getBundledFileName(filename) { - var idx = filename.lastIndexOf("google/protobuf/"); - if (idx > -1) { - var altname = filename.substring(idx); - if (altname in common) return altname; - } - return null; - } - - // Processes a single file - function process(filename, source) { - try { - if (util.isString(source) && source.charAt(0) === "{") - source = JSON.parse(source); - if (!util.isString(source)) - self.setOptions(source.options).addJSON(source.nested); - else { - parse.filename = filename; - var parsed = parse(source, self, options), - resolved, - i = 0; - if (parsed.imports) - for (; i < parsed.imports.length; ++i) - if (resolved = getBundledFileName(parsed.imports[i]) || self.resolvePath(filename, parsed.imports[i])) - fetch(resolved); - if (parsed.weakImports) - for (i = 0; i < parsed.weakImports.length; ++i) - if (resolved = getBundledFileName(parsed.weakImports[i]) || self.resolvePath(filename, parsed.weakImports[i])) - fetch(resolved, true); - } - } catch (err) { - finish(err); - } - if (!sync && !queued) - finish(null, self); // only once anyway - } - - // Fetches a single file - function fetch(filename, weak) { - - // Skip if already loaded / attempted - if (self.files.indexOf(filename) > -1) - return; - self.files.push(filename); - - // Shortcut bundled definitions - if (filename in common) { - if (sync) - process(filename, common[filename]); - else { - ++queued; - setTimeout(function() { - --queued; - process(filename, common[filename]); - }); - } - return; - } - - // Otherwise fetch from disk or network - if (sync) { - var source; - try { - source = util.fs.readFileSync(filename).toString("utf8"); - } catch (err) { - if (!weak) - finish(err); - return; - } - process(filename, source); - } else { - ++queued; - self.fetch(filename, function(err, source) { - --queued; - /* istanbul ignore if */ - if (!callback) - return; // terminated meanwhile - if (err) { - /* istanbul ignore else */ - if (!weak) - finish(err); - else if (!queued) // can't be covered reliably - finish(null, self); - return; - } - process(filename, source); - }); - } - } - var queued = 0; - - // Assembling the root namespace doesn't require working type - // references anymore, so we can load everything in parallel - if (util.isString(filename)) - filename = [ filename ]; - for (var i = 0, resolved; i < filename.length; ++i) - if (resolved = self.resolvePath("", filename[i])) - fetch(resolved); - - if (sync) - return self; - if (!queued) - finish(null, self); - return undefined; -}; -// function load(filename:string, options:IParseOptions, callback:LoadCallback):undefined - -/** - * Loads one or multiple .proto or preprocessed .json files into this root namespace and calls the callback. - * @function Root#load - * @param {string|string[]} filename Names of one or multiple files to load - * @param {LoadCallback} callback Callback function - * @returns {undefined} - * @variation 2 - */ -// function load(filename:string, callback:LoadCallback):undefined - -/** - * Loads one or multiple .proto or preprocessed .json files into this root namespace and returns a promise. - * @function Root#load - * @param {string|string[]} filename Names of one or multiple files to load - * @param {IParseOptions} [options] Parse options. Defaults to {@link parse.defaults} when omitted. - * @returns {Promise} Promise - * @variation 3 - */ -// function load(filename:string, [options:IParseOptions]):Promise - -/** - * Synchronously loads one or multiple .proto or preprocessed .json files into this root namespace (node only). - * @function Root#loadSync - * @param {string|string[]} filename Names of one or multiple files to load - * @param {IParseOptions} [options] Parse options. Defaults to {@link parse.defaults} when omitted. - * @returns {Root} Root namespace - * @throws {Error} If synchronous fetching is not supported (i.e. in browsers) or if a file's syntax is invalid - */ -Root.prototype.loadSync = function loadSync(filename, options) { - if (!util.isNode) - throw Error("not supported"); - return this.load(filename, options, SYNC); -}; - -/** - * @override - */ -Root.prototype.resolveAll = function resolveAll() { - if (this.deferred.length) - throw Error("unresolvable extensions: " + this.deferred.map(function(field) { - return "'extend " + field.extend + "' in " + field.parent.fullName; - }).join(", ")); - return Namespace.prototype.resolveAll.call(this); -}; - -// only uppercased (and thus conflict-free) children are exposed, see below -var exposeRe = /^[A-Z]/; - -/** - * Handles a deferred declaring extension field by creating a sister field to represent it within its extended type. - * @param {Root} root Root instance - * @param {Field} field Declaring extension field witin the declaring type - * @returns {boolean} `true` if successfully added to the extended type, `false` otherwise - * @inner - * @ignore - */ -function tryHandleExtension(root, field) { - var extendedType = field.parent.lookup(field.extend); - if (extendedType) { - var sisterField = new Field(field.fullName, field.id, field.type, field.rule, undefined, field.options); - sisterField.declaringField = field; - field.extensionField = sisterField; - extendedType.add(sisterField); - return true; - } - return false; -} - -/** - * Called when any object is added to this root or its sub-namespaces. - * @param {ReflectionObject} object Object added - * @returns {undefined} - * @private - */ -Root.prototype._handleAdd = function _handleAdd(object) { - if (object instanceof Field) { - - if (/* an extension field (implies not part of a oneof) */ object.extend !== undefined && /* not already handled */ !object.extensionField) - if (!tryHandleExtension(this, object)) - this.deferred.push(object); - - } else if (object instanceof Enum) { - - if (exposeRe.test(object.name)) - object.parent[object.name] = object.values; // expose enum values as property of its parent - - } else if (!(object instanceof OneOf)) /* everything else is a namespace */ { - - if (object instanceof Type) // Try to handle any deferred extensions - for (var i = 0; i < this.deferred.length;) - if (tryHandleExtension(this, this.deferred[i])) - this.deferred.splice(i, 1); - else - ++i; - for (var j = 0; j < /* initializes */ object.nestedArray.length; ++j) // recurse into the namespace - this._handleAdd(object._nestedArray[j]); - if (exposeRe.test(object.name)) - object.parent[object.name] = object; // expose namespace as property of its parent - } - - // The above also adds uppercased (and thus conflict-free) nested types, services and enums as - // properties of namespaces just like static code does. This allows using a .d.ts generated for - // a static module with reflection-based solutions where the condition is met. -}; - -/** - * Called when any object is removed from this root or its sub-namespaces. - * @param {ReflectionObject} object Object removed - * @returns {undefined} - * @private - */ -Root.prototype._handleRemove = function _handleRemove(object) { - if (object instanceof Field) { - - if (/* an extension field */ object.extend !== undefined) { - if (/* already handled */ object.extensionField) { // remove its sister field - object.extensionField.parent.remove(object.extensionField); - object.extensionField = null; - } else { // cancel the extension - var index = this.deferred.indexOf(object); - /* istanbul ignore else */ - if (index > -1) - this.deferred.splice(index, 1); - } - } - - } else if (object instanceof Enum) { - - if (exposeRe.test(object.name)) - delete object.parent[object.name]; // unexpose enum values - - } else if (object instanceof Namespace) { - - for (var i = 0; i < /* initializes */ object.nestedArray.length; ++i) // recurse into the namespace - this._handleRemove(object._nestedArray[i]); - - if (exposeRe.test(object.name)) - delete object.parent[object.name]; // unexpose namespaces - - } -}; - -// Sets up cyclic dependencies (called in index-light) -Root._configure = function(Type_, parse_, common_) { - Type = Type_; - parse = parse_; - common = common_; -}; - -},{"14":14,"15":15,"21":21,"23":23,"33":33}],27:[function(require,module,exports){ -"use strict"; -module.exports = {}; - -/** - * Named roots. - * This is where pbjs stores generated structures (the option `-r, --root` specifies a name). - * Can also be used manually to make roots available across modules. - * @name roots - * @type {Object.} - * @example - * // pbjs -r myroot -o compiled.js ... - * - * // in another module: - * require("./compiled.js"); - * - * // in any subsequent module: - * var root = protobuf.roots["myroot"]; - */ - -},{}],28:[function(require,module,exports){ -"use strict"; - -/** - * Streaming RPC helpers. - * @namespace - */ -var rpc = exports; - -/** - * RPC implementation passed to {@link Service#create} performing a service request on network level, i.e. by utilizing http requests or websockets. - * @typedef RPCImpl - * @type {function} - * @param {Method|rpc.ServiceMethod,Message<{}>>} method Reflected or static method being called - * @param {Uint8Array} requestData Request data - * @param {RPCImplCallback} callback Callback function - * @returns {undefined} - * @example - * function rpcImpl(method, requestData, callback) { - * if (protobuf.util.lcFirst(method.name) !== "myMethod") // compatible with static code - * throw Error("no such method"); - * asynchronouslyObtainAResponse(requestData, function(err, responseData) { - * callback(err, responseData); - * }); - * } - */ - -/** - * Node-style callback as used by {@link RPCImpl}. - * @typedef RPCImplCallback - * @type {function} - * @param {Error|null} error Error, if any, otherwise `null` - * @param {Uint8Array|null} [response] Response data or `null` to signal end of stream, if there hasn't been an error - * @returns {undefined} - */ - -rpc.Service = require(29); - -},{"29":29}],29:[function(require,module,exports){ -"use strict"; -module.exports = Service; - -var util = require(35); - -// Extends EventEmitter -(Service.prototype = Object.create(util.EventEmitter.prototype)).constructor = Service; - -/** - * A service method callback as used by {@link rpc.ServiceMethod|ServiceMethod}. - * - * Differs from {@link RPCImplCallback} in that it is an actual callback of a service method which may not return `response = null`. - * @typedef rpc.ServiceMethodCallback - * @template TRes extends Message - * @type {function} - * @param {Error|null} error Error, if any - * @param {TRes} [response] Response message - * @returns {undefined} - */ - -/** - * A service method part of a {@link rpc.Service} as created by {@link Service.create}. - * @typedef rpc.ServiceMethod - * @template TReq extends Message - * @template TRes extends Message - * @type {function} - * @param {TReq|Properties} request Request message or plain object - * @param {rpc.ServiceMethodCallback} [callback] Node-style callback called with the error, if any, and the response message - * @returns {Promise>} Promise if `callback` has been omitted, otherwise `undefined` - */ - -/** - * Constructs a new RPC service instance. - * @classdesc An RPC service as returned by {@link Service#create}. - * @exports rpc.Service - * @extends util.EventEmitter - * @constructor - * @param {RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - */ -function Service(rpcImpl, requestDelimited, responseDelimited) { - - if (typeof rpcImpl !== "function") - throw TypeError("rpcImpl must be a function"); - - util.EventEmitter.call(this); - - /** - * RPC implementation. Becomes `null` once the service is ended. - * @type {RPCImpl|null} - */ - this.rpcImpl = rpcImpl; - - /** - * Whether requests are length-delimited. - * @type {boolean} - */ - this.requestDelimited = Boolean(requestDelimited); - - /** - * Whether responses are length-delimited. - * @type {boolean} - */ - this.responseDelimited = Boolean(responseDelimited); -} - -/** - * Calls a service method through {@link rpc.Service#rpcImpl|rpcImpl}. - * @param {Method|rpc.ServiceMethod} method Reflected or static method - * @param {Constructor} requestCtor Request constructor - * @param {Constructor} responseCtor Response constructor - * @param {TReq|Properties} request Request message or plain object - * @param {rpc.ServiceMethodCallback} callback Service callback - * @returns {undefined} - * @template TReq extends Message - * @template TRes extends Message - */ -Service.prototype.rpcCall = function rpcCall(method, requestCtor, responseCtor, request, callback) { - - if (!request) - throw TypeError("request must be specified"); - - var self = this; - if (!callback) - return util.asPromise(rpcCall, self, method, requestCtor, responseCtor, request); - - if (!self.rpcImpl) { - setTimeout(function() { callback(Error("already ended")); }, 0); - return undefined; - } - - try { - return self.rpcImpl( - method, - requestCtor[self.requestDelimited ? "encodeDelimited" : "encode"](request).finish(), - function rpcCallback(err, response) { - - if (err) { - self.emit("error", err, method); - return callback(err); - } - - if (response === null) { - self.end(/* endedByRPC */ true); - return undefined; - } - - if (!(response instanceof responseCtor)) { - try { - response = responseCtor[self.responseDelimited ? "decodeDelimited" : "decode"](response); - } catch (err) { - self.emit("error", err, method); - return callback(err); - } - } - - self.emit("data", response, method); - return callback(null, response); - } - ); - } catch (err) { - self.emit("error", err, method); - setTimeout(function() { callback(err); }, 0); - return undefined; - } -}; - -/** - * Ends this service and emits the `end` event. - * @param {boolean} [endedByRPC=false] Whether the service has been ended by the RPC implementation. - * @returns {rpc.Service} `this` - */ -Service.prototype.end = function end(endedByRPC) { - if (this.rpcImpl) { - if (!endedByRPC) // signal end to rpcImpl - this.rpcImpl(null, null, null); - this.rpcImpl = null; - this.emit("end").off(); - } - return this; -}; - -},{"35":35}],30:[function(require,module,exports){ -"use strict"; -module.exports = Service; - -// extends Namespace -var Namespace = require(21); -((Service.prototype = Object.create(Namespace.prototype)).constructor = Service).className = "Service"; - -var Method = require(20), - util = require(33), - rpc = require(28); - -/** - * Constructs a new service instance. - * @classdesc Reflected service. - * @extends NamespaceBase - * @constructor - * @param {string} name Service name - * @param {Object.} [options] Service options - * @throws {TypeError} If arguments are invalid - */ -function Service(name, options) { - Namespace.call(this, name, options); - - /** - * Service methods. - * @type {Object.} - */ - this.methods = {}; // toJSON, marker - - /** - * Cached methods as an array. - * @type {Method[]|null} - * @private - */ - this._methodsArray = null; -} - -/** - * Service descriptor. - * @interface IService - * @extends INamespace - * @property {Object.} methods Method descriptors - */ - -/** - * Constructs a service from a service descriptor. - * @param {string} name Service name - * @param {IService} json Service descriptor - * @returns {Service} Created service - * @throws {TypeError} If arguments are invalid - */ -Service.fromJSON = function fromJSON(name, json) { - var service = new Service(name, json.options); - /* istanbul ignore else */ - if (json.methods) - for (var names = Object.keys(json.methods), i = 0; i < names.length; ++i) - service.add(Method.fromJSON(names[i], json.methods[names[i]])); - if (json.nested) - service.addJSON(json.nested); - service.comment = json.comment; - return service; -}; - -/** - * Converts this service to a service descriptor. - * @param {IToJSONOptions} [toJSONOptions] JSON conversion options - * @returns {IService} Service descriptor - */ -Service.prototype.toJSON = function toJSON(toJSONOptions) { - var inherited = Namespace.prototype.toJSON.call(this, toJSONOptions); - var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false; - return util.toObject([ - "options" , inherited && inherited.options || undefined, - "methods" , Namespace.arrayToJSON(this.methodsArray, toJSONOptions) || /* istanbul ignore next */ {}, - "nested" , inherited && inherited.nested || undefined, - "comment" , keepComments ? this.comment : undefined - ]); -}; - -/** - * Methods of this service as an array for iteration. - * @name Service#methodsArray - * @type {Method[]} - * @readonly - */ -Object.defineProperty(Service.prototype, "methodsArray", { - get: function() { - return this._methodsArray || (this._methodsArray = util.toArray(this.methods)); - } -}); - -function clearCache(service) { - service._methodsArray = null; - return service; -} - -/** - * @override - */ -Service.prototype.get = function get(name) { - return this.methods[name] - || Namespace.prototype.get.call(this, name); -}; - -/** - * @override - */ -Service.prototype.resolveAll = function resolveAll() { - var methods = this.methodsArray; - for (var i = 0; i < methods.length; ++i) - methods[i].resolve(); - return Namespace.prototype.resolve.call(this); -}; - -/** - * @override - */ -Service.prototype.add = function add(object) { - - /* istanbul ignore if */ - if (this.get(object.name)) - throw Error("duplicate name '" + object.name + "' in " + this); - - if (object instanceof Method) { - this.methods[object.name] = object; - object.parent = this; - return clearCache(this); - } - return Namespace.prototype.add.call(this, object); -}; - -/** - * @override - */ -Service.prototype.remove = function remove(object) { - if (object instanceof Method) { - - /* istanbul ignore if */ - if (this.methods[object.name] !== object) - throw Error(object + " is not a member of " + this); - - delete this.methods[object.name]; - object.parent = null; - return clearCache(this); - } - return Namespace.prototype.remove.call(this, object); -}; - -/** - * Creates a runtime service using the specified rpc implementation. - * @param {RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - * @returns {rpc.Service} RPC service. Useful where requests and/or responses are streamed. - */ -Service.prototype.create = function create(rpcImpl, requestDelimited, responseDelimited) { - var rpcService = new rpc.Service(rpcImpl, requestDelimited, responseDelimited); - for (var i = 0, method; i < /* initializes */ this.methodsArray.length; ++i) { - var methodName = util.lcFirst((method = this._methodsArray[i]).resolve().name).replace(/[^$\w_]/g, ""); - rpcService[methodName] = util.codegen(["r","c"], util.isReserved(methodName) ? methodName + "_" : methodName)("return this.rpcCall(m,q,s,r,c)")({ - m: method, - q: method.resolvedRequestType.ctor, - s: method.resolvedResponseType.ctor - }); - } - return rpcService; -}; - -},{"20":20,"21":21,"28":28,"33":33}],31:[function(require,module,exports){ -"use strict"; -module.exports = Type; - -// extends Namespace -var Namespace = require(21); -((Type.prototype = Object.create(Namespace.prototype)).constructor = Type).className = "Type"; - -var Enum = require(14), - OneOf = require(23), - Field = require(15), - MapField = require(18), - Service = require(30), - Message = require(19), - Reader = require(24), - Writer = require(38), - util = require(33), - encoder = require(13), - decoder = require(12), - verifier = require(36), - converter = require(11), - wrappers = require(37); - -/** - * Constructs a new reflected message type instance. - * @classdesc Reflected message type. - * @extends NamespaceBase - * @constructor - * @param {string} name Message name - * @param {Object.} [options] Declared options - */ -function Type(name, options) { - Namespace.call(this, name, options); - - /** - * Message fields. - * @type {Object.} - */ - this.fields = {}; // toJSON, marker - - /** - * Oneofs declared within this namespace, if any. - * @type {Object.} - */ - this.oneofs = undefined; // toJSON - - /** - * Extension ranges, if any. - * @type {number[][]} - */ - this.extensions = undefined; // toJSON - - /** - * Reserved ranges, if any. - * @type {Array.} - */ - this.reserved = undefined; // toJSON - - /*? - * Whether this type is a legacy group. - * @type {boolean|undefined} - */ - this.group = undefined; // toJSON - - /** - * Cached fields by id. - * @type {Object.|null} - * @private - */ - this._fieldsById = null; - - /** - * Cached fields as an array. - * @type {Field[]|null} - * @private - */ - this._fieldsArray = null; - - /** - * Cached oneofs as an array. - * @type {OneOf[]|null} - * @private - */ - this._oneofsArray = null; - - /** - * Cached constructor. - * @type {Constructor<{}>} - * @private - */ - this._ctor = null; -} - -Object.defineProperties(Type.prototype, { - - /** - * Message fields by id. - * @name Type#fieldsById - * @type {Object.} - * @readonly - */ - fieldsById: { - get: function() { - - /* istanbul ignore if */ - if (this._fieldsById) - return this._fieldsById; - - this._fieldsById = {}; - for (var names = Object.keys(this.fields), i = 0; i < names.length; ++i) { - var field = this.fields[names[i]], - id = field.id; - - /* istanbul ignore if */ - if (this._fieldsById[id]) - throw Error("duplicate id " + id + " in " + this); - - this._fieldsById[id] = field; - } - return this._fieldsById; - } - }, - - /** - * Fields of this message as an array for iteration. - * @name Type#fieldsArray - * @type {Field[]} - * @readonly - */ - fieldsArray: { - get: function() { - return this._fieldsArray || (this._fieldsArray = util.toArray(this.fields)); - } - }, - - /** - * Oneofs of this message as an array for iteration. - * @name Type#oneofsArray - * @type {OneOf[]} - * @readonly - */ - oneofsArray: { - get: function() { - return this._oneofsArray || (this._oneofsArray = util.toArray(this.oneofs)); - } - }, - - /** - * The registered constructor, if any registered, otherwise a generic constructor. - * Assigning a function replaces the internal constructor. If the function does not extend {@link Message} yet, its prototype will be setup accordingly and static methods will be populated. If it already extends {@link Message}, it will just replace the internal constructor. - * @name Type#ctor - * @type {Constructor<{}>} - */ - ctor: { - get: function() { - return this._ctor || (this.ctor = Type.generateConstructor(this)()); - }, - set: function(ctor) { - - // Ensure proper prototype - var prototype = ctor.prototype; - if (!(prototype instanceof Message)) { - (ctor.prototype = new Message()).constructor = ctor; - util.merge(ctor.prototype, prototype); - } - - // Classes and messages reference their reflected type - ctor.$type = ctor.prototype.$type = this; - - // Mix in static methods - util.merge(ctor, Message, true); - - this._ctor = ctor; - - // Messages have non-enumerable default values on their prototype - var i = 0; - for (; i < /* initializes */ this.fieldsArray.length; ++i) - this._fieldsArray[i].resolve(); // ensures a proper value - - // Messages have non-enumerable getters and setters for each virtual oneof field - var ctorProperties = {}; - for (i = 0; i < /* initializes */ this.oneofsArray.length; ++i) - ctorProperties[this._oneofsArray[i].resolve().name] = { - get: util.oneOfGetter(this._oneofsArray[i].oneof), - set: util.oneOfSetter(this._oneofsArray[i].oneof) - }; - if (i) - Object.defineProperties(ctor.prototype, ctorProperties); - } - } -}); - -/** - * Generates a constructor function for the specified type. - * @param {Type} mtype Message type - * @returns {Codegen} Codegen instance - */ -Type.generateConstructor = function generateConstructor(mtype) { - /* eslint-disable no-unexpected-multiline */ - var gen = util.codegen(["p"], mtype.name); - // explicitly initialize mutable object/array fields so that these aren't just inherited from the prototype - for (var i = 0, field; i < mtype.fieldsArray.length; ++i) - if ((field = mtype._fieldsArray[i]).map) gen - ("this%s={}", util.safeProp(field.name)); - else if (field.repeated) gen - ("this%s=[]", util.safeProp(field.name)); - return gen - ("if(p)for(var ks=Object.keys(p),i=0;i} [oneofs] Oneof descriptors - * @property {Object.} fields Field descriptors - * @property {number[][]} [extensions] Extension ranges - * @property {number[][]} [reserved] Reserved ranges - * @property {boolean} [group=false] Whether a legacy group or not - */ - -/** - * Creates a message type from a message type descriptor. - * @param {string} name Message name - * @param {IType} json Message type descriptor - * @returns {Type} Created message type - */ -Type.fromJSON = function fromJSON(name, json) { - var type = new Type(name, json.options); - type.extensions = json.extensions; - type.reserved = json.reserved; - var names = Object.keys(json.fields), - i = 0; - for (; i < names.length; ++i) - type.add( - ( typeof json.fields[names[i]].keyType !== "undefined" - ? MapField.fromJSON - : Field.fromJSON )(names[i], json.fields[names[i]]) - ); - if (json.oneofs) - for (names = Object.keys(json.oneofs), i = 0; i < names.length; ++i) - type.add(OneOf.fromJSON(names[i], json.oneofs[names[i]])); - if (json.nested) - for (names = Object.keys(json.nested), i = 0; i < names.length; ++i) { - var nested = json.nested[names[i]]; - type.add( // most to least likely - ( nested.id !== undefined - ? Field.fromJSON - : nested.fields !== undefined - ? Type.fromJSON - : nested.values !== undefined - ? Enum.fromJSON - : nested.methods !== undefined - ? Service.fromJSON - : Namespace.fromJSON )(names[i], nested) - ); - } - if (json.extensions && json.extensions.length) - type.extensions = json.extensions; - if (json.reserved && json.reserved.length) - type.reserved = json.reserved; - if (json.group) - type.group = true; - if (json.comment) - type.comment = json.comment; - return type; -}; - -/** - * Converts this message type to a message type descriptor. - * @param {IToJSONOptions} [toJSONOptions] JSON conversion options - * @returns {IType} Message type descriptor - */ -Type.prototype.toJSON = function toJSON(toJSONOptions) { - var inherited = Namespace.prototype.toJSON.call(this, toJSONOptions); - var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false; - return util.toObject([ - "options" , inherited && inherited.options || undefined, - "oneofs" , Namespace.arrayToJSON(this.oneofsArray, toJSONOptions), - "fields" , Namespace.arrayToJSON(this.fieldsArray.filter(function(obj) { return !obj.declaringField; }), toJSONOptions) || {}, - "extensions" , this.extensions && this.extensions.length ? this.extensions : undefined, - "reserved" , this.reserved && this.reserved.length ? this.reserved : undefined, - "group" , this.group || undefined, - "nested" , inherited && inherited.nested || undefined, - "comment" , keepComments ? this.comment : undefined - ]); -}; - -/** - * @override - */ -Type.prototype.resolveAll = function resolveAll() { - var fields = this.fieldsArray, i = 0; - while (i < fields.length) - fields[i++].resolve(); - var oneofs = this.oneofsArray; i = 0; - while (i < oneofs.length) - oneofs[i++].resolve(); - return Namespace.prototype.resolveAll.call(this); -}; - -/** - * @override - */ -Type.prototype.get = function get(name) { - return this.fields[name] - || this.oneofs && this.oneofs[name] - || this.nested && this.nested[name] - || null; -}; - -/** - * Adds a nested object to this type. - * @param {ReflectionObject} object Nested object to add - * @returns {Type} `this` - * @throws {TypeError} If arguments are invalid - * @throws {Error} If there is already a nested object with this name or, if a field, when there is already a field with this id - */ -Type.prototype.add = function add(object) { - - if (this.get(object.name)) - throw Error("duplicate name '" + object.name + "' in " + this); - - if (object instanceof Field && object.extend === undefined) { - // NOTE: Extension fields aren't actual fields on the declaring type, but nested objects. - // The root object takes care of adding distinct sister-fields to the respective extended - // type instead. - - // avoids calling the getter if not absolutely necessary because it's called quite frequently - if (this._fieldsById ? /* istanbul ignore next */ this._fieldsById[object.id] : this.fieldsById[object.id]) - throw Error("duplicate id " + object.id + " in " + this); - if (this.isReservedId(object.id)) - throw Error("id " + object.id + " is reserved in " + this); - if (this.isReservedName(object.name)) - throw Error("name '" + object.name + "' is reserved in " + this); - - if (object.parent) - object.parent.remove(object); - this.fields[object.name] = object; - object.message = this; - object.onAdd(this); - return clearCache(this); - } - if (object instanceof OneOf) { - if (!this.oneofs) - this.oneofs = {}; - this.oneofs[object.name] = object; - object.onAdd(this); - return clearCache(this); - } - return Namespace.prototype.add.call(this, object); -}; - -/** - * Removes a nested object from this type. - * @param {ReflectionObject} object Nested object to remove - * @returns {Type} `this` - * @throws {TypeError} If arguments are invalid - * @throws {Error} If `object` is not a member of this type - */ -Type.prototype.remove = function remove(object) { - if (object instanceof Field && object.extend === undefined) { - // See Type#add for the reason why extension fields are excluded here. - - /* istanbul ignore if */ - if (!this.fields || this.fields[object.name] !== object) - throw Error(object + " is not a member of " + this); - - delete this.fields[object.name]; - object.parent = null; - object.onRemove(this); - return clearCache(this); - } - if (object instanceof OneOf) { - - /* istanbul ignore if */ - if (!this.oneofs || this.oneofs[object.name] !== object) - throw Error(object + " is not a member of " + this); - - delete this.oneofs[object.name]; - object.parent = null; - object.onRemove(this); - return clearCache(this); - } - return Namespace.prototype.remove.call(this, object); -}; - -/** - * Tests if the specified id is reserved. - * @param {number} id Id to test - * @returns {boolean} `true` if reserved, otherwise `false` - */ -Type.prototype.isReservedId = function isReservedId(id) { - return Namespace.isReservedId(this.reserved, id); -}; - -/** - * Tests if the specified name is reserved. - * @param {string} name Name to test - * @returns {boolean} `true` if reserved, otherwise `false` - */ -Type.prototype.isReservedName = function isReservedName(name) { - return Namespace.isReservedName(this.reserved, name); -}; - -/** - * Creates a new message of this type using the specified properties. - * @param {Object.} [properties] Properties to set - * @returns {Message<{}>} Message instance - */ -Type.prototype.create = function create(properties) { - return new this.ctor(properties); -}; - -/** - * Sets up {@link Type#encode|encode}, {@link Type#decode|decode} and {@link Type#verify|verify}. - * @returns {Type} `this` - */ -Type.prototype.setup = function setup() { - // Sets up everything at once so that the prototype chain does not have to be re-evaluated - // multiple times (V8, soft-deopt prototype-check). - - var fullName = this.fullName, - types = []; - for (var i = 0; i < /* initializes */ this.fieldsArray.length; ++i) - types.push(this._fieldsArray[i].resolve().resolvedType); - - // Replace setup methods with type-specific generated functions - this.encode = encoder(this)({ - Writer : Writer, - types : types, - util : util - }); - this.decode = decoder(this)({ - Reader : Reader, - types : types, - util : util - }); - this.verify = verifier(this)({ - types : types, - util : util - }); - this.fromObject = converter.fromObject(this)({ - types : types, - util : util - }); - this.toObject = converter.toObject(this)({ - types : types, - util : util - }); - - // Inject custom wrappers for common types - var wrapper = wrappers[fullName]; - if (wrapper) { - var originalThis = Object.create(this); - // if (wrapper.fromObject) { - originalThis.fromObject = this.fromObject; - this.fromObject = wrapper.fromObject.bind(originalThis); - // } - // if (wrapper.toObject) { - originalThis.toObject = this.toObject; - this.toObject = wrapper.toObject.bind(originalThis); - // } - } - - return this; -}; - -/** - * Encodes a message of this type. Does not implicitly {@link Type#verify|verify} messages. - * @param {Message<{}>|Object.} message Message instance or plain object - * @param {Writer} [writer] Writer to encode to - * @returns {Writer} writer - */ -Type.prototype.encode = function encode_setup(message, writer) { - return this.setup().encode(message, writer); // overrides this method -}; - -/** - * Encodes a message of this type preceeded by its byte length as a varint. Does not implicitly {@link Type#verify|verify} messages. - * @param {Message<{}>|Object.} message Message instance or plain object - * @param {Writer} [writer] Writer to encode to - * @returns {Writer} writer - */ -Type.prototype.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); -}; - -/** - * Decodes a message of this type. - * @param {Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Length of the message, if known beforehand - * @returns {Message<{}>} Decoded message - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {util.ProtocolError<{}>} If required fields are missing - */ -Type.prototype.decode = function decode_setup(reader, length) { - return this.setup().decode(reader, length); // overrides this method -}; - -/** - * Decodes a message of this type preceeded by its byte length as a varint. - * @param {Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {Message<{}>} Decoded message - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {util.ProtocolError} If required fields are missing - */ -Type.prototype.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof Reader)) - reader = Reader.create(reader); - return this.decode(reader, reader.uint32()); -}; - -/** - * Verifies that field values are valid and that required fields are present. - * @param {Object.} message Plain object to verify - * @returns {null|string} `null` if valid, otherwise the reason why it is not - */ -Type.prototype.verify = function verify_setup(message) { - return this.setup().verify(message); // overrides this method -}; - -/** - * Creates a new message of this type from a plain object. Also converts values to their respective internal types. - * @param {Object.} object Plain object to convert - * @returns {Message<{}>} Message instance - */ -Type.prototype.fromObject = function fromObject(object) { - return this.setup().fromObject(object); -}; - -/** - * Conversion options as used by {@link Type#toObject} and {@link Message.toObject}. - * @interface IConversionOptions - * @property {Function} [longs] Long conversion type. - * Valid values are `String` and `Number` (the global types). - * Defaults to copy the present value, which is a possibly unsafe number without and a {@link Long} with a long library. - * @property {Function} [enums] Enum value conversion type. - * Only valid value is `String` (the global type). - * Defaults to copy the present value, which is the numeric id. - * @property {Function} [bytes] Bytes value conversion type. - * Valid values are `Array` and (a base64 encoded) `String` (the global types). - * Defaults to copy the present value, which usually is a Buffer under node and an Uint8Array in the browser. - * @property {boolean} [defaults=false] Also sets default values on the resulting object - * @property {boolean} [arrays=false] Sets empty arrays for missing repeated fields even if `defaults=false` - * @property {boolean} [objects=false] Sets empty objects for missing map fields even if `defaults=false` - * @property {boolean} [oneofs=false] Includes virtual oneof properties set to the present field's name, if any - * @property {boolean} [json=false] Performs additional JSON compatibility conversions, i.e. NaN and Infinity to strings - */ - -/** - * Creates a plain object from a message of this type. Also converts values to other types if specified. - * @param {Message<{}>} message Message instance - * @param {IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ -Type.prototype.toObject = function toObject(message, options) { - return this.setup().toObject(message, options); -}; - -/** - * Decorator function as returned by {@link Type.d} (TypeScript). - * @typedef TypeDecorator - * @type {function} - * @param {Constructor} target Target constructor - * @returns {undefined} - * @template T extends Message - */ - -/** - * Type decorator (TypeScript). - * @param {string} [typeName] Type name, defaults to the constructor's name - * @returns {TypeDecorator} Decorator function - * @template T extends Message - */ -Type.d = function decorateType(typeName) { - return function typeDecorator(target) { - util.decorateType(target, typeName); - }; -}; - -},{"11":11,"12":12,"13":13,"14":14,"15":15,"18":18,"19":19,"21":21,"23":23,"24":24,"30":30,"33":33,"36":36,"37":37,"38":38}],32:[function(require,module,exports){ -"use strict"; - -/** - * Common type constants. - * @namespace - */ -var types = exports; - -var util = require(33); - -var s = [ - "double", // 0 - "float", // 1 - "int32", // 2 - "uint32", // 3 - "sint32", // 4 - "fixed32", // 5 - "sfixed32", // 6 - "int64", // 7 - "uint64", // 8 - "sint64", // 9 - "fixed64", // 10 - "sfixed64", // 11 - "bool", // 12 - "string", // 13 - "bytes" // 14 -]; - -function bake(values, offset) { - var i = 0, o = {}; - offset |= 0; - while (i < values.length) o[s[i + offset]] = values[i++]; - return o; -} - -/** - * Basic type wire types. - * @type {Object.} - * @const - * @property {number} double=1 Fixed64 wire type - * @property {number} float=5 Fixed32 wire type - * @property {number} int32=0 Varint wire type - * @property {number} uint32=0 Varint wire type - * @property {number} sint32=0 Varint wire type - * @property {number} fixed32=5 Fixed32 wire type - * @property {number} sfixed32=5 Fixed32 wire type - * @property {number} int64=0 Varint wire type - * @property {number} uint64=0 Varint wire type - * @property {number} sint64=0 Varint wire type - * @property {number} fixed64=1 Fixed64 wire type - * @property {number} sfixed64=1 Fixed64 wire type - * @property {number} bool=0 Varint wire type - * @property {number} string=2 Ldelim wire type - * @property {number} bytes=2 Ldelim wire type - */ -types.basic = bake([ - /* double */ 1, - /* float */ 5, - /* int32 */ 0, - /* uint32 */ 0, - /* sint32 */ 0, - /* fixed32 */ 5, - /* sfixed32 */ 5, - /* int64 */ 0, - /* uint64 */ 0, - /* sint64 */ 0, - /* fixed64 */ 1, - /* sfixed64 */ 1, - /* bool */ 0, - /* string */ 2, - /* bytes */ 2 -]); - -/** - * Basic type defaults. - * @type {Object.} - * @const - * @property {number} double=0 Double default - * @property {number} float=0 Float default - * @property {number} int32=0 Int32 default - * @property {number} uint32=0 Uint32 default - * @property {number} sint32=0 Sint32 default - * @property {number} fixed32=0 Fixed32 default - * @property {number} sfixed32=0 Sfixed32 default - * @property {number} int64=0 Int64 default - * @property {number} uint64=0 Uint64 default - * @property {number} sint64=0 Sint32 default - * @property {number} fixed64=0 Fixed64 default - * @property {number} sfixed64=0 Sfixed64 default - * @property {boolean} bool=false Bool default - * @property {string} string="" String default - * @property {Array.} bytes=Array(0) Bytes default - * @property {null} message=null Message default - */ -types.defaults = bake([ - /* double */ 0, - /* float */ 0, - /* int32 */ 0, - /* uint32 */ 0, - /* sint32 */ 0, - /* fixed32 */ 0, - /* sfixed32 */ 0, - /* int64 */ 0, - /* uint64 */ 0, - /* sint64 */ 0, - /* fixed64 */ 0, - /* sfixed64 */ 0, - /* bool */ false, - /* string */ "", - /* bytes */ util.emptyArray, - /* message */ null -]); - -/** - * Basic long type wire types. - * @type {Object.} - * @const - * @property {number} int64=0 Varint wire type - * @property {number} uint64=0 Varint wire type - * @property {number} sint64=0 Varint wire type - * @property {number} fixed64=1 Fixed64 wire type - * @property {number} sfixed64=1 Fixed64 wire type - */ -types.long = bake([ - /* int64 */ 0, - /* uint64 */ 0, - /* sint64 */ 0, - /* fixed64 */ 1, - /* sfixed64 */ 1 -], 7); - -/** - * Allowed types for map keys with their associated wire type. - * @type {Object.} - * @const - * @property {number} int32=0 Varint wire type - * @property {number} uint32=0 Varint wire type - * @property {number} sint32=0 Varint wire type - * @property {number} fixed32=5 Fixed32 wire type - * @property {number} sfixed32=5 Fixed32 wire type - * @property {number} int64=0 Varint wire type - * @property {number} uint64=0 Varint wire type - * @property {number} sint64=0 Varint wire type - * @property {number} fixed64=1 Fixed64 wire type - * @property {number} sfixed64=1 Fixed64 wire type - * @property {number} bool=0 Varint wire type - * @property {number} string=2 Ldelim wire type - */ -types.mapKey = bake([ - /* int32 */ 0, - /* uint32 */ 0, - /* sint32 */ 0, - /* fixed32 */ 5, - /* sfixed32 */ 5, - /* int64 */ 0, - /* uint64 */ 0, - /* sint64 */ 0, - /* fixed64 */ 1, - /* sfixed64 */ 1, - /* bool */ 0, - /* string */ 2 -], 2); - -/** - * Allowed types for packed repeated fields with their associated wire type. - * @type {Object.} - * @const - * @property {number} double=1 Fixed64 wire type - * @property {number} float=5 Fixed32 wire type - * @property {number} int32=0 Varint wire type - * @property {number} uint32=0 Varint wire type - * @property {number} sint32=0 Varint wire type - * @property {number} fixed32=5 Fixed32 wire type - * @property {number} sfixed32=5 Fixed32 wire type - * @property {number} int64=0 Varint wire type - * @property {number} uint64=0 Varint wire type - * @property {number} sint64=0 Varint wire type - * @property {number} fixed64=1 Fixed64 wire type - * @property {number} sfixed64=1 Fixed64 wire type - * @property {number} bool=0 Varint wire type - */ -types.packed = bake([ - /* double */ 1, - /* float */ 5, - /* int32 */ 0, - /* uint32 */ 0, - /* sint32 */ 0, - /* fixed32 */ 5, - /* sfixed32 */ 5, - /* int64 */ 0, - /* uint64 */ 0, - /* sint64 */ 0, - /* fixed64 */ 1, - /* sfixed64 */ 1, - /* bool */ 0 -]); - -},{"33":33}],33:[function(require,module,exports){ -"use strict"; - -/** - * Various utility functions. - * @namespace - */ -var util = module.exports = require(35); - -var roots = require(27); - -var Type, // cyclic - Enum; - -util.codegen = require(3); -util.fetch = require(5); -util.path = require(8); - -/** - * Node's fs module if available. - * @type {Object.} - */ -util.fs = util.inquire("fs"); - -/** - * Converts an object's values to an array. - * @param {Object.} object Object to convert - * @returns {Array.<*>} Converted array - */ -util.toArray = function toArray(object) { - if (object) { - var keys = Object.keys(object), - array = new Array(keys.length), - index = 0; - while (index < keys.length) - array[index] = object[keys[index++]]; - return array; - } - return []; -}; - -/** - * Converts an array of keys immediately followed by their respective value to an object, omitting undefined values. - * @param {Array.<*>} array Array to convert - * @returns {Object.} Converted object - */ -util.toObject = function toObject(array) { - var object = {}, - index = 0; - while (index < array.length) { - var key = array[index++], - val = array[index++]; - if (val !== undefined) - object[key] = val; - } - return object; -}; - -var safePropBackslashRe = /\\/g, - safePropQuoteRe = /"/g; - -/** - * Tests whether the specified name is a reserved word in JS. - * @param {string} name Name to test - * @returns {boolean} `true` if reserved, otherwise `false` - */ -util.isReserved = function isReserved(name) { - return /^(?:do|if|in|for|let|new|try|var|case|else|enum|eval|false|null|this|true|void|with|break|catch|class|const|super|throw|while|yield|delete|export|import|public|return|static|switch|typeof|default|extends|finally|package|private|continue|debugger|function|arguments|interface|protected|implements|instanceof)$/.test(name); -}; - -/** - * Returns a safe property accessor for the specified property name. - * @param {string} prop Property name - * @returns {string} Safe accessor - */ -util.safeProp = function safeProp(prop) { - if (!/^[$\w_]+$/.test(prop) || util.isReserved(prop)) - return "[\"" + prop.replace(safePropBackslashRe, "\\\\").replace(safePropQuoteRe, "\\\"") + "\"]"; - return "." + prop; -}; - -/** - * Converts the first character of a string to upper case. - * @param {string} str String to convert - * @returns {string} Converted string - */ -util.ucFirst = function ucFirst(str) { - return str.charAt(0).toUpperCase() + str.substring(1); -}; - -var camelCaseRe = /_([a-z])/g; - -/** - * Converts a string to camel case. - * @param {string} str String to convert - * @returns {string} Converted string - */ -util.camelCase = function camelCase(str) { - return str.substring(0, 1) - + str.substring(1) - .replace(camelCaseRe, function($0, $1) { return $1.toUpperCase(); }); -}; - -/** - * Compares reflected fields by id. - * @param {Field} a First field - * @param {Field} b Second field - * @returns {number} Comparison value - */ -util.compareFieldsById = function compareFieldsById(a, b) { - return a.id - b.id; -}; - -/** - * Decorator helper for types (TypeScript). - * @param {Constructor} ctor Constructor function - * @param {string} [typeName] Type name, defaults to the constructor's name - * @returns {Type} Reflected type - * @template T extends Message - * @property {Root} root Decorators root - */ -util.decorateType = function decorateType(ctor, typeName) { - - /* istanbul ignore if */ - if (ctor.$type) { - if (typeName && ctor.$type.name !== typeName) { - util.decorateRoot.remove(ctor.$type); - ctor.$type.name = typeName; - util.decorateRoot.add(ctor.$type); - } - return ctor.$type; - } - - /* istanbul ignore next */ - if (!Type) - Type = require(31); - - var type = new Type(typeName || ctor.name); - util.decorateRoot.add(type); - type.ctor = ctor; // sets up .encode, .decode etc. - Object.defineProperty(ctor, "$type", { value: type, enumerable: false }); - Object.defineProperty(ctor.prototype, "$type", { value: type, enumerable: false }); - return type; -}; - -var decorateEnumIndex = 0; - -/** - * Decorator helper for enums (TypeScript). - * @param {Object} object Enum object - * @returns {Enum} Reflected enum - */ -util.decorateEnum = function decorateEnum(object) { - - /* istanbul ignore if */ - if (object.$type) - return object.$type; - - /* istanbul ignore next */ - if (!Enum) - Enum = require(14); - - var enm = new Enum("Enum" + decorateEnumIndex++, object); - util.decorateRoot.add(enm); - Object.defineProperty(object, "$type", { value: enm, enumerable: false }); - return enm; -}; - - -/** - * Sets the value of a property by property path. If a value already exists, it is turned to an array - * @param {Object.} dst Destination object - * @param {string} path dot '.' delimited path of the property to set - * @param {Object} value the value to set - * @returns {Object.} Destination object - */ -util.setProperty = function setProperty(dst, path, value) { - function setProp(dst, path, value) { - var part = path.shift(); - if (part === "__proto__") { - return dst; - } - if (path.length > 0) { - dst[part] = setProp(dst[part] || {}, path, value); - } else { - var prevValue = dst[part]; - if (prevValue) - value = [].concat(prevValue).concat(value); - dst[part] = value; - } - return dst; - } - - if (typeof dst !== "object") - throw TypeError("dst must be an object"); - if (!path) - throw TypeError("path must be specified"); - - path = path.split("."); - return setProp(dst, path, value); -}; - -/** - * Decorator root (TypeScript). - * @name util.decorateRoot - * @type {Root} - * @readonly - */ -Object.defineProperty(util, "decorateRoot", { - get: function() { - return roots["decorated"] || (roots["decorated"] = new (require(26))()); - } -}); - -},{"14":14,"26":26,"27":27,"3":3,"31":31,"35":35,"5":5,"8":8}],34:[function(require,module,exports){ -"use strict"; -module.exports = LongBits; - -var util = require(35); - -/** - * Constructs new long bits. - * @classdesc Helper class for working with the low and high bits of a 64 bit value. - * @memberof util - * @constructor - * @param {number} lo Low 32 bits, unsigned - * @param {number} hi High 32 bits, unsigned - */ -function LongBits(lo, hi) { - - // note that the casts below are theoretically unnecessary as of today, but older statically - // generated converter code might still call the ctor with signed 32bits. kept for compat. - - /** - * Low bits. - * @type {number} - */ - this.lo = lo >>> 0; - - /** - * High bits. - * @type {number} - */ - this.hi = hi >>> 0; -} - -/** - * Zero bits. - * @memberof util.LongBits - * @type {util.LongBits} - */ -var zero = LongBits.zero = new LongBits(0, 0); - -zero.toNumber = function() { return 0; }; -zero.zzEncode = zero.zzDecode = function() { return this; }; -zero.length = function() { return 1; }; - -/** - * Zero hash. - * @memberof util.LongBits - * @type {string} - */ -var zeroHash = LongBits.zeroHash = "\0\0\0\0\0\0\0\0"; - -/** - * Constructs new long bits from the specified number. - * @param {number} value Value - * @returns {util.LongBits} Instance - */ -LongBits.fromNumber = function fromNumber(value) { - if (value === 0) - return zero; - var sign = value < 0; - if (sign) - value = -value; - var lo = value >>> 0, - hi = (value - lo) / 4294967296 >>> 0; - if (sign) { - hi = ~hi >>> 0; - lo = ~lo >>> 0; - if (++lo > 4294967295) { - lo = 0; - if (++hi > 4294967295) - hi = 0; - } - } - return new LongBits(lo, hi); -}; - -/** - * Constructs new long bits from a number, long or string. - * @param {Long|number|string} value Value - * @returns {util.LongBits} Instance - */ -LongBits.from = function from(value) { - if (typeof value === "number") - return LongBits.fromNumber(value); - if (util.isString(value)) { - /* istanbul ignore else */ - if (util.Long) - value = util.Long.fromString(value); - else - return LongBits.fromNumber(parseInt(value, 10)); - } - return value.low || value.high ? new LongBits(value.low >>> 0, value.high >>> 0) : zero; -}; - -/** - * Converts this long bits to a possibly unsafe JavaScript number. - * @param {boolean} [unsigned=false] Whether unsigned or not - * @returns {number} Possibly unsafe number - */ -LongBits.prototype.toNumber = function toNumber(unsigned) { - if (!unsigned && this.hi >>> 31) { - var lo = ~this.lo + 1 >>> 0, - hi = ~this.hi >>> 0; - if (!lo) - hi = hi + 1 >>> 0; - return -(lo + hi * 4294967296); - } - return this.lo + this.hi * 4294967296; -}; - -/** - * Converts this long bits to a long. - * @param {boolean} [unsigned=false] Whether unsigned or not - * @returns {Long} Long - */ -LongBits.prototype.toLong = function toLong(unsigned) { - return util.Long - ? new util.Long(this.lo | 0, this.hi | 0, Boolean(unsigned)) - /* istanbul ignore next */ - : { low: this.lo | 0, high: this.hi | 0, unsigned: Boolean(unsigned) }; -}; - -var charCodeAt = String.prototype.charCodeAt; - -/** - * Constructs new long bits from the specified 8 characters long hash. - * @param {string} hash Hash - * @returns {util.LongBits} Bits - */ -LongBits.fromHash = function fromHash(hash) { - if (hash === zeroHash) - return zero; - return new LongBits( - ( charCodeAt.call(hash, 0) - | charCodeAt.call(hash, 1) << 8 - | charCodeAt.call(hash, 2) << 16 - | charCodeAt.call(hash, 3) << 24) >>> 0 - , - ( charCodeAt.call(hash, 4) - | charCodeAt.call(hash, 5) << 8 - | charCodeAt.call(hash, 6) << 16 - | charCodeAt.call(hash, 7) << 24) >>> 0 - ); -}; - -/** - * Converts this long bits to a 8 characters long hash. - * @returns {string} Hash - */ -LongBits.prototype.toHash = function toHash() { - return String.fromCharCode( - this.lo & 255, - this.lo >>> 8 & 255, - this.lo >>> 16 & 255, - this.lo >>> 24 , - this.hi & 255, - this.hi >>> 8 & 255, - this.hi >>> 16 & 255, - this.hi >>> 24 - ); -}; - -/** - * Zig-zag encodes this long bits. - * @returns {util.LongBits} `this` - */ -LongBits.prototype.zzEncode = function zzEncode() { - var mask = this.hi >> 31; - this.hi = ((this.hi << 1 | this.lo >>> 31) ^ mask) >>> 0; - this.lo = ( this.lo << 1 ^ mask) >>> 0; - return this; -}; - -/** - * Zig-zag decodes this long bits. - * @returns {util.LongBits} `this` - */ -LongBits.prototype.zzDecode = function zzDecode() { - var mask = -(this.lo & 1); - this.lo = ((this.lo >>> 1 | this.hi << 31) ^ mask) >>> 0; - this.hi = ( this.hi >>> 1 ^ mask) >>> 0; - return this; -}; - -/** - * Calculates the length of this longbits when encoded as a varint. - * @returns {number} Length - */ -LongBits.prototype.length = function length() { - var part0 = this.lo, - part1 = (this.lo >>> 28 | this.hi << 4) >>> 0, - part2 = this.hi >>> 24; - return part2 === 0 - ? part1 === 0 - ? part0 < 16384 - ? part0 < 128 ? 1 : 2 - : part0 < 2097152 ? 3 : 4 - : part1 < 16384 - ? part1 < 128 ? 5 : 6 - : part1 < 2097152 ? 7 : 8 - : part2 < 128 ? 9 : 10; -}; - -},{"35":35}],35:[function(require,module,exports){ -"use strict"; -var util = exports; - -// used to return a Promise where callback is omitted -util.asPromise = require(1); - -// converts to / from base64 encoded strings -util.base64 = require(2); - -// base class of rpc.Service -util.EventEmitter = require(4); - -// float handling accross browsers -util.float = require(6); - -// requires modules optionally and hides the call from bundlers -util.inquire = require(7); - -// converts to / from utf8 encoded strings -util.utf8 = require(10); - -// provides a node-like buffer pool in the browser -util.pool = require(9); - -// utility to work with the low and high bits of a 64 bit value -util.LongBits = require(34); - -/** - * Whether running within node or not. - * @memberof util - * @type {boolean} - */ -util.isNode = Boolean(typeof global !== "undefined" - && global - && global.process - && global.process.versions - && global.process.versions.node); - -/** - * Global object reference. - * @memberof util - * @type {Object} - */ -util.global = util.isNode && global - || typeof window !== "undefined" && window - || typeof self !== "undefined" && self - || this; // eslint-disable-line no-invalid-this - -/** - * An immuable empty array. - * @memberof util - * @type {Array.<*>} - * @const - */ -util.emptyArray = Object.freeze ? Object.freeze([]) : /* istanbul ignore next */ []; // used on prototypes - -/** - * An immutable empty object. - * @type {Object} - * @const - */ -util.emptyObject = Object.freeze ? Object.freeze({}) : /* istanbul ignore next */ {}; // used on prototypes - -/** - * Tests if the specified value is an integer. - * @function - * @param {*} value Value to test - * @returns {boolean} `true` if the value is an integer - */ -util.isInteger = Number.isInteger || /* istanbul ignore next */ function isInteger(value) { - return typeof value === "number" && isFinite(value) && Math.floor(value) === value; -}; - -/** - * Tests if the specified value is a string. - * @param {*} value Value to test - * @returns {boolean} `true` if the value is a string - */ -util.isString = function isString(value) { - return typeof value === "string" || value instanceof String; -}; - -/** - * Tests if the specified value is a non-null object. - * @param {*} value Value to test - * @returns {boolean} `true` if the value is a non-null object - */ -util.isObject = function isObject(value) { - return value && typeof value === "object"; -}; - -/** - * Checks if a property on a message is considered to be present. - * This is an alias of {@link util.isSet}. - * @function - * @param {Object} obj Plain object or message instance - * @param {string} prop Property name - * @returns {boolean} `true` if considered to be present, otherwise `false` - */ -util.isset = - -/** - * Checks if a property on a message is considered to be present. - * @param {Object} obj Plain object or message instance - * @param {string} prop Property name - * @returns {boolean} `true` if considered to be present, otherwise `false` - */ -util.isSet = function isSet(obj, prop) { - var value = obj[prop]; - if (value != null && obj.hasOwnProperty(prop)) // eslint-disable-line eqeqeq, no-prototype-builtins - return typeof value !== "object" || (Array.isArray(value) ? value.length : Object.keys(value).length) > 0; - return false; -}; - -/** - * Any compatible Buffer instance. - * This is a minimal stand-alone definition of a Buffer instance. The actual type is that exported by node's typings. - * @interface Buffer - * @extends Uint8Array - */ - -/** - * Node's Buffer class if available. - * @type {Constructor} - */ -util.Buffer = (function() { - try { - var Buffer = util.inquire("buffer").Buffer; - // refuse to use non-node buffers if not explicitly assigned (perf reasons): - return Buffer.prototype.utf8Write ? Buffer : /* istanbul ignore next */ null; - } catch (e) { - /* istanbul ignore next */ - return null; - } -})(); - -// Internal alias of or polyfull for Buffer.from. -util._Buffer_from = null; - -// Internal alias of or polyfill for Buffer.allocUnsafe. -util._Buffer_allocUnsafe = null; - -/** - * Creates a new buffer of whatever type supported by the environment. - * @param {number|number[]} [sizeOrArray=0] Buffer size or number array - * @returns {Uint8Array|Buffer} Buffer - */ -util.newBuffer = function newBuffer(sizeOrArray) { - /* istanbul ignore next */ - return typeof sizeOrArray === "number" - ? util.Buffer - ? util._Buffer_allocUnsafe(sizeOrArray) - : new util.Array(sizeOrArray) - : util.Buffer - ? util._Buffer_from(sizeOrArray) - : typeof Uint8Array === "undefined" - ? sizeOrArray - : new Uint8Array(sizeOrArray); -}; - -/** - * Array implementation used in the browser. `Uint8Array` if supported, otherwise `Array`. - * @type {Constructor} - */ -util.Array = typeof Uint8Array !== "undefined" ? Uint8Array /* istanbul ignore next */ : Array; - -/** - * Any compatible Long instance. - * This is a minimal stand-alone definition of a Long instance. The actual type is that exported by long.js. - * @interface Long - * @property {number} low Low bits - * @property {number} high High bits - * @property {boolean} unsigned Whether unsigned or not - */ - -/** - * Long.js's Long class if available. - * @type {Constructor} - */ -util.Long = /* istanbul ignore next */ util.global.dcodeIO && /* istanbul ignore next */ util.global.dcodeIO.Long - || /* istanbul ignore next */ util.global.Long - || util.inquire("long"); - -/** - * Regular expression used to verify 2 bit (`bool`) map keys. - * @type {RegExp} - * @const - */ -util.key2Re = /^true|false|0|1$/; - -/** - * Regular expression used to verify 32 bit (`int32` etc.) map keys. - * @type {RegExp} - * @const - */ -util.key32Re = /^-?(?:0|[1-9][0-9]*)$/; - -/** - * Regular expression used to verify 64 bit (`int64` etc.) map keys. - * @type {RegExp} - * @const - */ -util.key64Re = /^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/; - -/** - * Converts a number or long to an 8 characters long hash string. - * @param {Long|number} value Value to convert - * @returns {string} Hash - */ -util.longToHash = function longToHash(value) { - return value - ? util.LongBits.from(value).toHash() - : util.LongBits.zeroHash; -}; - -/** - * Converts an 8 characters long hash string to a long or number. - * @param {string} hash Hash - * @param {boolean} [unsigned=false] Whether unsigned or not - * @returns {Long|number} Original value - */ -util.longFromHash = function longFromHash(hash, unsigned) { - var bits = util.LongBits.fromHash(hash); - if (util.Long) - return util.Long.fromBits(bits.lo, bits.hi, unsigned); - return bits.toNumber(Boolean(unsigned)); -}; - -/** - * Merges the properties of the source object into the destination object. - * @memberof util - * @param {Object.} dst Destination object - * @param {Object.} src Source object - * @param {boolean} [ifNotSet=false] Merges only if the key is not already set - * @returns {Object.} Destination object - */ -function merge(dst, src, ifNotSet) { // used by converters - for (var keys = Object.keys(src), i = 0; i < keys.length; ++i) - if (dst[keys[i]] === undefined || !ifNotSet) - dst[keys[i]] = src[keys[i]]; - return dst; -} - -util.merge = merge; - -/** - * Converts the first character of a string to lower case. - * @param {string} str String to convert - * @returns {string} Converted string - */ -util.lcFirst = function lcFirst(str) { - return str.charAt(0).toLowerCase() + str.substring(1); -}; - -/** - * Creates a custom error constructor. - * @memberof util - * @param {string} name Error name - * @returns {Constructor} Custom error constructor - */ -function newError(name) { - - function CustomError(message, properties) { - - if (!(this instanceof CustomError)) - return new CustomError(message, properties); - - // Error.call(this, message); - // ^ just returns a new error instance because the ctor can be called as a function - - Object.defineProperty(this, "message", { get: function() { return message; } }); - - /* istanbul ignore next */ - if (Error.captureStackTrace) // node - Error.captureStackTrace(this, CustomError); - else - Object.defineProperty(this, "stack", { value: new Error().stack || "" }); - - if (properties) - merge(this, properties); - } - - CustomError.prototype = Object.create(Error.prototype, { - constructor: { - value: CustomError, - writable: true, - enumerable: false, - configurable: true, - }, - name: { - get() { return name; }, - set: undefined, - enumerable: false, - // configurable: false would accurately preserve the behavior of - // the original, but I'm guessing that was not intentional. - // For an actual error subclass, this property would - // be configurable. - configurable: true, - }, - toString: { - value() { return this.name + ": " + this.message; }, - writable: true, - enumerable: false, - configurable: true, - }, - }); - - return CustomError; -} - -util.newError = newError; - -/** - * Constructs a new protocol error. - * @classdesc Error subclass indicating a protocol specifc error. - * @memberof util - * @extends Error - * @template T extends Message - * @constructor - * @param {string} message Error message - * @param {Object.} [properties] Additional properties - * @example - * try { - * MyMessage.decode(someBuffer); // throws if required fields are missing - * } catch (e) { - * if (e instanceof ProtocolError && e.instance) - * console.log("decoded so far: " + JSON.stringify(e.instance)); - * } - */ -util.ProtocolError = newError("ProtocolError"); - -/** - * So far decoded message instance. - * @name util.ProtocolError#instance - * @type {Message} - */ - -/** - * A OneOf getter as returned by {@link util.oneOfGetter}. - * @typedef OneOfGetter - * @type {function} - * @returns {string|undefined} Set field name, if any - */ - -/** - * Builds a getter for a oneof's present field name. - * @param {string[]} fieldNames Field names - * @returns {OneOfGetter} Unbound getter - */ -util.oneOfGetter = function getOneOf(fieldNames) { - var fieldMap = {}; - for (var i = 0; i < fieldNames.length; ++i) - fieldMap[fieldNames[i]] = 1; - - /** - * @returns {string|undefined} Set field name, if any - * @this Object - * @ignore - */ - return function() { // eslint-disable-line consistent-return - for (var keys = Object.keys(this), i = keys.length - 1; i > -1; --i) - if (fieldMap[keys[i]] === 1 && this[keys[i]] !== undefined && this[keys[i]] !== null) - return keys[i]; - }; -}; - -/** - * A OneOf setter as returned by {@link util.oneOfSetter}. - * @typedef OneOfSetter - * @type {function} - * @param {string|undefined} value Field name - * @returns {undefined} - */ - -/** - * Builds a setter for a oneof's present field name. - * @param {string[]} fieldNames Field names - * @returns {OneOfSetter} Unbound setter - */ -util.oneOfSetter = function setOneOf(fieldNames) { - - /** - * @param {string} name Field name - * @returns {undefined} - * @this Object - * @ignore - */ - return function(name) { - for (var i = 0; i < fieldNames.length; ++i) - if (fieldNames[i] !== name) - delete this[fieldNames[i]]; - }; -}; - -/** - * Default conversion options used for {@link Message#toJSON} implementations. - * - * These options are close to proto3's JSON mapping with the exception that internal types like Any are handled just like messages. More precisely: - * - * - Longs become strings - * - Enums become string keys - * - Bytes become base64 encoded strings - * - (Sub-)Messages become plain objects - * - Maps become plain objects with all string keys - * - Repeated fields become arrays - * - NaN and Infinity for float and double fields become strings - * - * @type {IConversionOptions} - * @see https://developers.google.com/protocol-buffers/docs/proto3?hl=en#json - */ -util.toJSONOptions = { - longs: String, - enums: String, - bytes: String, - json: true -}; - -// Sets up buffer utility according to the environment (called in index-minimal) -util._configure = function() { - var Buffer = util.Buffer; - /* istanbul ignore if */ - if (!Buffer) { - util._Buffer_from = util._Buffer_allocUnsafe = null; - return; - } - // because node 4.x buffers are incompatible & immutable - // see: https://github.com/dcodeIO/protobuf.js/pull/665 - util._Buffer_from = Buffer.from !== Uint8Array.from && Buffer.from || - /* istanbul ignore next */ - function Buffer_from(value, encoding) { - return new Buffer(value, encoding); - }; - util._Buffer_allocUnsafe = Buffer.allocUnsafe || - /* istanbul ignore next */ - function Buffer_allocUnsafe(size) { - return new Buffer(size); - }; -}; - -},{"1":1,"10":10,"2":2,"34":34,"4":4,"6":6,"7":7,"9":9}],36:[function(require,module,exports){ -"use strict"; -module.exports = verifier; - -var Enum = require(14), - util = require(33); - -function invalid(field, expected) { - return field.name + ": " + expected + (field.repeated && expected !== "array" ? "[]" : field.map && expected !== "object" ? "{k:"+field.keyType+"}" : "") + " expected"; -} - -/** - * Generates a partial value verifier. - * @param {Codegen} gen Codegen instance - * @param {Field} field Reflected field - * @param {number} fieldIndex Field index - * @param {string} ref Variable reference - * @returns {Codegen} Codegen instance - * @ignore - */ -function genVerifyValue(gen, field, fieldIndex, ref) { - /* eslint-disable no-unexpected-multiline */ - if (field.resolvedType) { - if (field.resolvedType instanceof Enum) { gen - ("switch(%s){", ref) - ("default:") - ("return%j", invalid(field, "enum value")); - for (var keys = Object.keys(field.resolvedType.values), j = 0; j < keys.length; ++j) gen - ("case %i:", field.resolvedType.values[keys[j]]); - gen - ("break") - ("}"); - } else { - gen - ("{") - ("var e=types[%i].verify(%s);", fieldIndex, ref) - ("if(e)") - ("return%j+e", field.name + ".") - ("}"); - } - } else { - switch (field.type) { - case "int32": - case "uint32": - case "sint32": - case "fixed32": - case "sfixed32": gen - ("if(!util.isInteger(%s))", ref) - ("return%j", invalid(field, "integer")); - break; - case "int64": - case "uint64": - case "sint64": - case "fixed64": - case "sfixed64": gen - ("if(!util.isInteger(%s)&&!(%s&&util.isInteger(%s.low)&&util.isInteger(%s.high)))", ref, ref, ref, ref) - ("return%j", invalid(field, "integer|Long")); - break; - case "float": - case "double": gen - ("if(typeof %s!==\"number\")", ref) - ("return%j", invalid(field, "number")); - break; - case "bool": gen - ("if(typeof %s!==\"boolean\")", ref) - ("return%j", invalid(field, "boolean")); - break; - case "string": gen - ("if(!util.isString(%s))", ref) - ("return%j", invalid(field, "string")); - break; - case "bytes": gen - ("if(!(%s&&typeof %s.length===\"number\"||util.isString(%s)))", ref, ref, ref) - ("return%j", invalid(field, "buffer")); - break; - } - } - return gen; - /* eslint-enable no-unexpected-multiline */ -} - -/** - * Generates a partial key verifier. - * @param {Codegen} gen Codegen instance - * @param {Field} field Reflected field - * @param {string} ref Variable reference - * @returns {Codegen} Codegen instance - * @ignore - */ -function genVerifyKey(gen, field, ref) { - /* eslint-disable no-unexpected-multiline */ - switch (field.keyType) { - case "int32": - case "uint32": - case "sint32": - case "fixed32": - case "sfixed32": gen - ("if(!util.key32Re.test(%s))", ref) - ("return%j", invalid(field, "integer key")); - break; - case "int64": - case "uint64": - case "sint64": - case "fixed64": - case "sfixed64": gen - ("if(!util.key64Re.test(%s))", ref) // see comment above: x is ok, d is not - ("return%j", invalid(field, "integer|Long key")); - break; - case "bool": gen - ("if(!util.key2Re.test(%s))", ref) - ("return%j", invalid(field, "boolean key")); - break; - } - return gen; - /* eslint-enable no-unexpected-multiline */ -} - -/** - * Generates a verifier specific to the specified message type. - * @param {Type} mtype Message type - * @returns {Codegen} Codegen instance - */ -function verifier(mtype) { - /* eslint-disable no-unexpected-multiline */ - - var gen = util.codegen(["m"], mtype.name + "$verify") - ("if(typeof m!==\"object\"||m===null)") - ("return%j", "object expected"); - var oneofs = mtype.oneofsArray, - seenFirstField = {}; - if (oneofs.length) gen - ("var p={}"); - - for (var i = 0; i < /* initializes */ mtype.fieldsArray.length; ++i) { - var field = mtype._fieldsArray[i].resolve(), - ref = "m" + util.safeProp(field.name); - - if (field.optional) gen - ("if(%s!=null&&m.hasOwnProperty(%j)){", ref, field.name); // !== undefined && !== null - - // map fields - if (field.map) { gen - ("if(!util.isObject(%s))", ref) - ("return%j", invalid(field, "object")) - ("var k=Object.keys(%s)", ref) - ("for(var i=0;i} - * @const - */ -var wrappers = exports; - -var Message = require(19); - -/** - * From object converter part of an {@link IWrapper}. - * @typedef WrapperFromObjectConverter - * @type {function} - * @param {Object.} object Plain object - * @returns {Message<{}>} Message instance - * @this Type - */ - -/** - * To object converter part of an {@link IWrapper}. - * @typedef WrapperToObjectConverter - * @type {function} - * @param {Message<{}>} message Message instance - * @param {IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - * @this Type - */ - -/** - * Common type wrapper part of {@link wrappers}. - * @interface IWrapper - * @property {WrapperFromObjectConverter} [fromObject] From object converter - * @property {WrapperToObjectConverter} [toObject] To object converter - */ - -// Custom wrapper for Any -wrappers[".google.protobuf.Any"] = { - - fromObject: function(object) { - - // unwrap value type if mapped - if (object && object["@type"]) { - // Only use fully qualified type name after the last '/' - var name = object["@type"].substring(object["@type"].lastIndexOf("/") + 1); - var type = this.lookup(name); - /* istanbul ignore else */ - if (type) { - // type_url does not accept leading "." - var type_url = object["@type"].charAt(0) === "." ? - object["@type"].slice(1) : object["@type"]; - // type_url prefix is optional, but path seperator is required - if (type_url.indexOf("/") === -1) { - type_url = "/" + type_url; - } - return this.create({ - type_url: type_url, - value: type.encode(type.fromObject(object)).finish() - }); - } - } - - return this.fromObject(object); - }, - - toObject: function(message, options) { - - // Default prefix - var googleApi = "type.googleapis.com/"; - var prefix = ""; - var name = ""; - - // decode value if requested and unmapped - if (options && options.json && message.type_url && message.value) { - // Only use fully qualified type name after the last '/' - name = message.type_url.substring(message.type_url.lastIndexOf("/") + 1); - // Separate the prefix used - prefix = message.type_url.substring(0, message.type_url.lastIndexOf("/") + 1); - var type = this.lookup(name); - /* istanbul ignore else */ - if (type) - message = type.decode(message.value); - } - - // wrap value if unmapped - if (!(message instanceof this.ctor) && message instanceof Message) { - var object = message.$type.toObject(message, options); - var messageName = message.$type.fullName[0] === "." ? - message.$type.fullName.slice(1) : message.$type.fullName; - // Default to type.googleapis.com prefix if no prefix is used - if (prefix === "") { - prefix = googleApi; - } - name = prefix + messageName; - object["@type"] = name; - return object; - } - - return this.toObject(message, options); - } -}; - -},{"19":19}],38:[function(require,module,exports){ -"use strict"; -module.exports = Writer; - -var util = require(35); - -var BufferWriter; // cyclic - -var LongBits = util.LongBits, - base64 = util.base64, - utf8 = util.utf8; - -/** - * Constructs a new writer operation instance. - * @classdesc Scheduled writer operation. - * @constructor - * @param {function(*, Uint8Array, number)} fn Function to call - * @param {number} len Value byte length - * @param {*} val Value to write - * @ignore - */ -function Op(fn, len, val) { - - /** - * Function to call. - * @type {function(Uint8Array, number, *)} - */ - this.fn = fn; - - /** - * Value byte length. - * @type {number} - */ - this.len = len; - - /** - * Next operation. - * @type {Writer.Op|undefined} - */ - this.next = undefined; - - /** - * Value to write. - * @type {*} - */ - this.val = val; // type varies -} - -/* istanbul ignore next */ -function noop() {} // eslint-disable-line no-empty-function - -/** - * Constructs a new writer state instance. - * @classdesc Copied writer state. - * @memberof Writer - * @constructor - * @param {Writer} writer Writer to copy state from - * @ignore - */ -function State(writer) { - - /** - * Current head. - * @type {Writer.Op} - */ - this.head = writer.head; - - /** - * Current tail. - * @type {Writer.Op} - */ - this.tail = writer.tail; - - /** - * Current buffer length. - * @type {number} - */ - this.len = writer.len; - - /** - * Next state. - * @type {State|null} - */ - this.next = writer.states; -} - -/** - * Constructs a new writer instance. - * @classdesc Wire format writer using `Uint8Array` if available, otherwise `Array`. - * @constructor - */ -function Writer() { - - /** - * Current length. - * @type {number} - */ - this.len = 0; - - /** - * Operations head. - * @type {Object} - */ - this.head = new Op(noop, 0, 0); - - /** - * Operations tail - * @type {Object} - */ - this.tail = this.head; - - /** - * Linked forked states. - * @type {Object|null} - */ - this.states = null; - - // When a value is written, the writer calculates its byte length and puts it into a linked - // list of operations to perform when finish() is called. This both allows us to allocate - // buffers of the exact required size and reduces the amount of work we have to do compared - // to first calculating over objects and then encoding over objects. In our case, the encoding - // part is just a linked list walk calling operations with already prepared values. -} - -var create = function create() { - return util.Buffer - ? function create_buffer_setup() { - return (Writer.create = function create_buffer() { - return new BufferWriter(); - })(); - } - /* istanbul ignore next */ - : function create_array() { - return new Writer(); - }; -}; - -/** - * Creates a new writer. - * @function - * @returns {BufferWriter|Writer} A {@link BufferWriter} when Buffers are supported, otherwise a {@link Writer} - */ -Writer.create = create(); - -/** - * Allocates a buffer of the specified size. - * @param {number} size Buffer size - * @returns {Uint8Array} Buffer - */ -Writer.alloc = function alloc(size) { - return new util.Array(size); -}; - -// Use Uint8Array buffer pool in the browser, just like node does with buffers -/* istanbul ignore else */ -if (util.Array !== Array) - Writer.alloc = util.pool(Writer.alloc, util.Array.prototype.subarray); - -/** - * Pushes a new operation to the queue. - * @param {function(Uint8Array, number, *)} fn Function to call - * @param {number} len Value byte length - * @param {number} val Value to write - * @returns {Writer} `this` - * @private - */ -Writer.prototype._push = function push(fn, len, val) { - this.tail = this.tail.next = new Op(fn, len, val); - this.len += len; - return this; -}; - -function writeByte(val, buf, pos) { - buf[pos] = val & 255; -} - -function writeVarint32(val, buf, pos) { - while (val > 127) { - buf[pos++] = val & 127 | 128; - val >>>= 7; - } - buf[pos] = val; -} - -/** - * Constructs a new varint writer operation instance. - * @classdesc Scheduled varint writer operation. - * @extends Op - * @constructor - * @param {number} len Value byte length - * @param {number} val Value to write - * @ignore - */ -function VarintOp(len, val) { - this.len = len; - this.next = undefined; - this.val = val; -} - -VarintOp.prototype = Object.create(Op.prototype); -VarintOp.prototype.fn = writeVarint32; - -/** - * Writes an unsigned 32 bit value as a varint. - * @param {number} value Value to write - * @returns {Writer} `this` - */ -Writer.prototype.uint32 = function write_uint32(value) { - // here, the call to this.push has been inlined and a varint specific Op subclass is used. - // uint32 is by far the most frequently used operation and benefits significantly from this. - this.len += (this.tail = this.tail.next = new VarintOp( - (value = value >>> 0) - < 128 ? 1 - : value < 16384 ? 2 - : value < 2097152 ? 3 - : value < 268435456 ? 4 - : 5, - value)).len; - return this; -}; - -/** - * Writes a signed 32 bit value as a varint. - * @function - * @param {number} value Value to write - * @returns {Writer} `this` - */ -Writer.prototype.int32 = function write_int32(value) { - return value < 0 - ? this._push(writeVarint64, 10, LongBits.fromNumber(value)) // 10 bytes per spec - : this.uint32(value); -}; - -/** - * Writes a 32 bit value as a varint, zig-zag encoded. - * @param {number} value Value to write - * @returns {Writer} `this` - */ -Writer.prototype.sint32 = function write_sint32(value) { - return this.uint32((value << 1 ^ value >> 31) >>> 0); -}; - -function writeVarint64(val, buf, pos) { - while (val.hi) { - buf[pos++] = val.lo & 127 | 128; - val.lo = (val.lo >>> 7 | val.hi << 25) >>> 0; - val.hi >>>= 7; - } - while (val.lo > 127) { - buf[pos++] = val.lo & 127 | 128; - val.lo = val.lo >>> 7; - } - buf[pos++] = val.lo; -} - -/** - * Writes an unsigned 64 bit value as a varint. - * @param {Long|number|string} value Value to write - * @returns {Writer} `this` - * @throws {TypeError} If `value` is a string and no long library is present. - */ -Writer.prototype.uint64 = function write_uint64(value) { - var bits = LongBits.from(value); - return this._push(writeVarint64, bits.length(), bits); -}; - -/** - * Writes a signed 64 bit value as a varint. - * @function - * @param {Long|number|string} value Value to write - * @returns {Writer} `this` - * @throws {TypeError} If `value` is a string and no long library is present. - */ -Writer.prototype.int64 = Writer.prototype.uint64; - -/** - * Writes a signed 64 bit value as a varint, zig-zag encoded. - * @param {Long|number|string} value Value to write - * @returns {Writer} `this` - * @throws {TypeError} If `value` is a string and no long library is present. - */ -Writer.prototype.sint64 = function write_sint64(value) { - var bits = LongBits.from(value).zzEncode(); - return this._push(writeVarint64, bits.length(), bits); -}; - -/** - * Writes a boolish value as a varint. - * @param {boolean} value Value to write - * @returns {Writer} `this` - */ -Writer.prototype.bool = function write_bool(value) { - return this._push(writeByte, 1, value ? 1 : 0); -}; - -function writeFixed32(val, buf, pos) { - buf[pos ] = val & 255; - buf[pos + 1] = val >>> 8 & 255; - buf[pos + 2] = val >>> 16 & 255; - buf[pos + 3] = val >>> 24; -} - -/** - * Writes an unsigned 32 bit value as fixed 32 bits. - * @param {number} value Value to write - * @returns {Writer} `this` - */ -Writer.prototype.fixed32 = function write_fixed32(value) { - return this._push(writeFixed32, 4, value >>> 0); -}; - -/** - * Writes a signed 32 bit value as fixed 32 bits. - * @function - * @param {number} value Value to write - * @returns {Writer} `this` - */ -Writer.prototype.sfixed32 = Writer.prototype.fixed32; - -/** - * Writes an unsigned 64 bit value as fixed 64 bits. - * @param {Long|number|string} value Value to write - * @returns {Writer} `this` - * @throws {TypeError} If `value` is a string and no long library is present. - */ -Writer.prototype.fixed64 = function write_fixed64(value) { - var bits = LongBits.from(value); - return this._push(writeFixed32, 4, bits.lo)._push(writeFixed32, 4, bits.hi); -}; - -/** - * Writes a signed 64 bit value as fixed 64 bits. - * @function - * @param {Long|number|string} value Value to write - * @returns {Writer} `this` - * @throws {TypeError} If `value` is a string and no long library is present. - */ -Writer.prototype.sfixed64 = Writer.prototype.fixed64; - -/** - * Writes a float (32 bit). - * @function - * @param {number} value Value to write - * @returns {Writer} `this` - */ -Writer.prototype.float = function write_float(value) { - return this._push(util.float.writeFloatLE, 4, value); -}; - -/** - * Writes a double (64 bit float). - * @function - * @param {number} value Value to write - * @returns {Writer} `this` - */ -Writer.prototype.double = function write_double(value) { - return this._push(util.float.writeDoubleLE, 8, value); -}; - -var writeBytes = util.Array.prototype.set - ? function writeBytes_set(val, buf, pos) { - buf.set(val, pos); // also works for plain array values - } - /* istanbul ignore next */ - : function writeBytes_for(val, buf, pos) { - for (var i = 0; i < val.length; ++i) - buf[pos + i] = val[i]; - }; - -/** - * Writes a sequence of bytes. - * @param {Uint8Array|string} value Buffer or base64 encoded string to write - * @returns {Writer} `this` - */ -Writer.prototype.bytes = function write_bytes(value) { - var len = value.length >>> 0; - if (!len) - return this._push(writeByte, 1, 0); - if (util.isString(value)) { - var buf = Writer.alloc(len = base64.length(value)); - base64.decode(value, buf, 0); - value = buf; - } - return this.uint32(len)._push(writeBytes, len, value); -}; - -/** - * Writes a string. - * @param {string} value Value to write - * @returns {Writer} `this` - */ -Writer.prototype.string = function write_string(value) { - var len = utf8.length(value); - return len - ? this.uint32(len)._push(utf8.write, len, value) - : this._push(writeByte, 1, 0); -}; - -/** - * Forks this writer's state by pushing it to a stack. - * Calling {@link Writer#reset|reset} or {@link Writer#ldelim|ldelim} resets the writer to the previous state. - * @returns {Writer} `this` - */ -Writer.prototype.fork = function fork() { - this.states = new State(this); - this.head = this.tail = new Op(noop, 0, 0); - this.len = 0; - return this; -}; - -/** - * Resets this instance to the last state. - * @returns {Writer} `this` - */ -Writer.prototype.reset = function reset() { - if (this.states) { - this.head = this.states.head; - this.tail = this.states.tail; - this.len = this.states.len; - this.states = this.states.next; - } else { - this.head = this.tail = new Op(noop, 0, 0); - this.len = 0; - } - return this; -}; - -/** - * Resets to the last state and appends the fork state's current write length as a varint followed by its operations. - * @returns {Writer} `this` - */ -Writer.prototype.ldelim = function ldelim() { - var head = this.head, - tail = this.tail, - len = this.len; - this.reset().uint32(len); - if (len) { - this.tail.next = head.next; // skip noop - this.tail = tail; - this.len += len; - } - return this; -}; - -/** - * Finishes the write operation. - * @returns {Uint8Array} Finished buffer - */ -Writer.prototype.finish = function finish() { - var head = this.head.next, // skip noop - buf = this.constructor.alloc(this.len), - pos = 0; - while (head) { - head.fn(head.val, buf, pos); - pos += head.len; - head = head.next; - } - // this.head = this.tail = null; - return buf; -}; - -Writer._configure = function(BufferWriter_) { - BufferWriter = BufferWriter_; - Writer.create = create(); - BufferWriter._configure(); -}; - -},{"35":35}],39:[function(require,module,exports){ -"use strict"; -module.exports = BufferWriter; - -// extends Writer -var Writer = require(38); -(BufferWriter.prototype = Object.create(Writer.prototype)).constructor = BufferWriter; - -var util = require(35); - -/** - * Constructs a new buffer writer instance. - * @classdesc Wire format writer using node buffers. - * @extends Writer - * @constructor - */ -function BufferWriter() { - Writer.call(this); -} - -BufferWriter._configure = function () { - /** - * Allocates a buffer of the specified size. - * @function - * @param {number} size Buffer size - * @returns {Buffer} Buffer - */ - BufferWriter.alloc = util._Buffer_allocUnsafe; - - BufferWriter.writeBytesBuffer = util.Buffer && util.Buffer.prototype instanceof Uint8Array && util.Buffer.prototype.set.name === "set" - ? function writeBytesBuffer_set(val, buf, pos) { - buf.set(val, pos); // faster than copy (requires node >= 4 where Buffers extend Uint8Array and set is properly inherited) - // also works for plain array values - } - /* istanbul ignore next */ - : function writeBytesBuffer_copy(val, buf, pos) { - if (val.copy) // Buffer values - val.copy(buf, pos, 0, val.length); - else for (var i = 0; i < val.length;) // plain array values - buf[pos++] = val[i++]; - }; -}; - - -/** - * @override - */ -BufferWriter.prototype.bytes = function write_bytes_buffer(value) { - if (util.isString(value)) - value = util._Buffer_from(value, "base64"); - var len = value.length >>> 0; - this.uint32(len); - if (len) - this._push(BufferWriter.writeBytesBuffer, len, value); - return this; -}; - -function writeStringBuffer(val, buf, pos) { - if (val.length < 40) // plain js is faster for short strings (probably due to redundant assertions) - util.utf8.write(val, buf, pos); - else if (buf.utf8Write) - buf.utf8Write(val, pos); - else - buf.write(val, pos); -} - -/** - * @override - */ -BufferWriter.prototype.string = function write_string_buffer(value) { - var len = util.Buffer.byteLength(value); - this.uint32(len); - if (len) - this._push(writeStringBuffer, len, value); - return this; -}; - - -/** - * Finishes the write operation. - * @name BufferWriter#finish - * @function - * @returns {Buffer} Finished buffer - */ - -BufferWriter._configure(); - -},{"35":35,"38":38}]},{},[16]) - -})(); -//# sourceMappingURL=protobuf.js.map diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/dist/light/protobuf.min.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/dist/light/protobuf.min.js deleted file mode 100644 index 5a0bcb64..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/dist/light/protobuf.min.js +++ /dev/null @@ -1,8 +0,0 @@ -/*! - * protobuf.js v7.1.0 (c) 2016, daniel wirtz - * compiled thu, 22 sep 2022 17:16:11 utc - * licensed under the bsd-3-clause license - * see: https://github.com/dcodeio/protobuf.js for details - */ -!function(g){"use strict";!function(r,e,t){var i=function t(i){var n=e[i];return n||r[i][0].call(n=e[i]={exports:{}},t,n,n.exports),n.exports}(t[0]);i.util.global.protobuf=i,"function"==typeof define&&define.amd&&define(["long"],function(t){return t&&t.isLong&&(i.util.Long=t,i.configure()),i}),"object"==typeof module&&module&&module.exports&&(module.exports=i)}({1:[function(t,i,n){i.exports=function(t,i){var n=Array(arguments.length-1),s=0,r=2,u=!0;for(;r>2],r=(3&h)<<4,o=1;break;case 1:s[u++]=f[r|h>>4],r=(15&h)<<2,o=2;break;case 2:s[u++]=f[r|h>>6],s[u++]=f[63&h],o=0}8191>4,r=o,s=2;break;case 2:i[n++]=(15&r)<<4|(60&o)>>2,r=o,s=3;break;case 3:i[n++]=(3&r)<<6|o,s=0}}if(1===s)throw Error(c);return n-e},n.test=function(t){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(t)}},{}],3:[function(t,i,n){function a(i,n){"string"==typeof i&&(n=i,i=g);var h=[];function f(t){if("string"!=typeof t){var i=c();if(a.verbose&&console.log("codegen: "+i),i="return "+i,t){for(var n=Object.keys(t),r=Array(n.length+1),e=Array(n.length),s=0;s>>0:i<11754943508222875e-54?(e<<31|Math.round(i/1401298464324817e-60))>>>0:(e<<31|127+(t=Math.floor(Math.log(i)/Math.LN2))<<23|8388607&Math.round(i*Math.pow(2,-t)*8388608))>>>0,n,r)}function n(t,i,n){t=t(i,n),i=2*(t>>31)+1,n=t>>>23&255,t&=8388607;return 255==n?t?NaN:1/0*i:0==n?1401298464324817e-60*i*t:i*Math.pow(2,n-150)*(8388608+t)}function r(t,i,n){o[0]=t,i[n]=h[0],i[n+1]=h[1],i[n+2]=h[2],i[n+3]=h[3]}function e(t,i,n){o[0]=t,i[n]=h[3],i[n+1]=h[2],i[n+2]=h[1],i[n+3]=h[0]}function s(t,i){return h[0]=t[i],h[1]=t[i+1],h[2]=t[i+2],h[3]=t[i+3],o[0]}function u(t,i){return h[3]=t[i],h[2]=t[i+1],h[1]=t[i+2],h[0]=t[i+3],o[0]}var o,h,f,c,a;function l(t,i,n,r,e,s){var u,o=r<0?1:0;0===(r=o?-r:r)?(t(0,e,s+i),t(0<1/r?0:2147483648,e,s+n)):isNaN(r)?(t(0,e,s+i),t(2146959360,e,s+n)):17976931348623157e292>>0,e,s+n)):r<22250738585072014e-324?(t((u=r/5e-324)>>>0,e,s+i),t((o<<31|u/4294967296)>>>0,e,s+n)):(t(4503599627370496*(u=r*Math.pow(2,-(r=1024===(r=Math.floor(Math.log(r)/Math.LN2))?1023:r)))>>>0,e,s+i),t((o<<31|r+1023<<20|1048576*u&1048575)>>>0,e,s+n))}function d(t,i,n,r,e){i=t(r,e+i),t=t(r,e+n),r=2*(t>>31)+1,e=t>>>20&2047,n=4294967296*(1048575&t)+i;return 2047==e?n?NaN:1/0*r:0==e?5e-324*r*n:r*Math.pow(2,e-1075)*(n+4503599627370496)}function v(t,i,n){f[0]=t,i[n]=c[0],i[n+1]=c[1],i[n+2]=c[2],i[n+3]=c[3],i[n+4]=c[4],i[n+5]=c[5],i[n+6]=c[6],i[n+7]=c[7]}function b(t,i,n){f[0]=t,i[n]=c[7],i[n+1]=c[6],i[n+2]=c[5],i[n+3]=c[4],i[n+4]=c[3],i[n+5]=c[2],i[n+6]=c[1],i[n+7]=c[0]}function p(t,i){return c[0]=t[i],c[1]=t[i+1],c[2]=t[i+2],c[3]=t[i+3],c[4]=t[i+4],c[5]=t[i+5],c[6]=t[i+6],c[7]=t[i+7],f[0]}function y(t,i){return c[7]=t[i],c[6]=t[i+1],c[5]=t[i+2],c[4]=t[i+3],c[3]=t[i+4],c[2]=t[i+5],c[1]=t[i+6],c[0]=t[i+7],f[0]}return"undefined"!=typeof Float32Array?(o=new Float32Array([-0]),h=new Uint8Array(o.buffer),a=128===h[3],t.writeFloatLE=a?r:e,t.writeFloatBE=a?e:r,t.readFloatLE=a?s:u,t.readFloatBE=a?u:s):(t.writeFloatLE=i.bind(null,m),t.writeFloatBE=i.bind(null,w),t.readFloatLE=n.bind(null,g),t.readFloatBE=n.bind(null,j)),"undefined"!=typeof Float64Array?(f=new Float64Array([-0]),c=new Uint8Array(f.buffer),a=128===c[7],t.writeDoubleLE=a?v:b,t.writeDoubleBE=a?b:v,t.readDoubleLE=a?p:y,t.readDoubleBE=a?y:p):(t.writeDoubleLE=l.bind(null,m,0,4),t.writeDoubleBE=l.bind(null,w,4,0),t.readDoubleLE=d.bind(null,g,0,4),t.readDoubleBE=d.bind(null,j,4,0)),t}function m(t,i,n){i[n]=255&t,i[n+1]=t>>>8&255,i[n+2]=t>>>16&255,i[n+3]=t>>>24}function w(t,i,n){i[n]=t>>>24,i[n+1]=t>>>16&255,i[n+2]=t>>>8&255,i[n+3]=255&t}function g(t,i){return(t[i]|t[i+1]<<8|t[i+2]<<16|t[i+3]<<24)>>>0}function j(t,i){return(t[i]<<24|t[i+1]<<16|t[i+2]<<8|t[i+3])>>>0}i.exports=r(r)},{}],7:[function(t,i,n){function r(t){try{var i=eval("require")(t);if(i&&(i.length||Object.keys(i).length))return i}catch(t){}return null}i.exports=r},{}],8:[function(t,i,n){var e=n.isAbsolute=function(t){return/^(?:\/|\w+:)/.test(t)},r=n.normalize=function(t){var i=(t=t.replace(/\\/g,"/").replace(/\/{2,}/g,"/")).split("/"),n=e(t),t="";n&&(t=i.shift()+"/");for(var r=0;r>>1,s=null,u=r;return function(t){if(t<1||e>10),s[u++]=56320+(1023&r)):s[u++]=(15&r)<<12|(63&t[i++])<<6|63&t[i++],8191>6|192:(55296==(64512&r)&&56320==(64512&(e=t.charCodeAt(u+1)))?(++u,i[n++]=(r=65536+((1023&r)<<10)+(1023&e))>>18|240,i[n++]=r>>12&63|128):i[n++]=r>>12|224,i[n++]=r>>6&63|128),i[n++]=63&r|128);return n-s}},{}],11:[function(t,i,n){var l=t(14),d=t(33);function u(t,i,n,r){if(i.resolvedType)if(i.resolvedType instanceof l){t("switch(d%s){",r);for(var e=i.resolvedType.values,s=Object.keys(e),u=0;u>>0",r,r);break;case"int32":case"sint32":case"sfixed32":t("m%s=d%s|0",r,r);break;case"uint64":o=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":t("if(util.Long)")("(m%s=util.Long.fromValue(d%s)).unsigned=%j",r,r,o)('else if(typeof d%s==="string")',r)("m%s=parseInt(d%s,10)",r,r)('else if(typeof d%s==="number")',r)("m%s=d%s",r,r)('else if(typeof d%s==="object")',r)("m%s=new util.LongBits(d%s.low>>>0,d%s.high>>>0).toNumber(%s)",r,r,r,o?"true":"");break;case"bytes":t('if(typeof d%s==="string")',r)("util.base64.decode(d%s,m%s=util.newBuffer(util.base64.length(d%s)),0)",r,r,r)("else if(d%s.length >= 0)",r)("m%s=d%s",r,r);break;case"string":t("m%s=String(d%s)",r,r);break;case"bool":t("m%s=Boolean(d%s)",r,r)}}return t}function v(t,i,n,r){if(i.resolvedType)i.resolvedType instanceof l?t("d%s=o.enums===String?(types[%i].values[m%s]===undefined?m%s:types[%i].values[m%s]):m%s",r,n,r,r,n,r,r):t("d%s=types[%i].toObject(m%s,o)",r,n,r);else{var e=!1;switch(i.type){case"double":case"float":t("d%s=o.json&&!isFinite(m%s)?String(m%s):m%s",r,r,r,r);break;case"uint64":e=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":t('if(typeof m%s==="number")',r)("d%s=o.longs===String?String(m%s):m%s",r,r,r)("else")("d%s=o.longs===String?util.Long.prototype.toString.call(m%s):o.longs===Number?new util.LongBits(m%s.low>>>0,m%s.high>>>0).toNumber(%s):m%s",r,r,r,r,e?"true":"",r);break;case"bytes":t("d%s=o.bytes===String?util.base64.encode(m%s,0,m%s.length):o.bytes===Array?Array.prototype.slice.call(m%s):m%s",r,r,r,r,r);break;default:t("d%s=m%s",r,r)}}return t}n.fromObject=function(t){var i=t.fieldsArray,n=d.codegen(["d"],t.name+"$fromObject")("if(d instanceof this.ctor)")("return d");if(!i.length)return n("return new this.ctor");n("var m=new this.ctor");for(var r=0;r>>3){");for(var n=0;n>>3){")("case 1: k=r.%s(); break",r.keyType)("case 2:"),h.basic[e]===g?i("value=types[%i].decode(r,r.uint32())",n):i("value=r.%s()",e),i("break")("default:")("r.skipType(tag2&7)")("break")("}")("}"),h.long[r.keyType]!==g?i('%s[typeof k==="object"?util.longToHash(k):k]=value',s):i("%s[k]=value",s)):r.repeated?(i("if(!(%s&&%s.length))",s,s)("%s=[]",s),h.packed[e]!==g&&i("if((t&7)===2){")("var c2=r.uint32()+r.pos")("while(r.pos>>0,8|c.mapKey[s.keyType],s.keyType),h===g?n("types[%i].encode(%s[ks[i]],w.uint32(18).fork()).ldelim().ldelim()",u,i):n(".uint32(%i).%s(%s[ks[i]]).ldelim()",16|h,o,i),n("}")("}")):s.repeated?(n("if(%s!=null&&%s.length){",i,i),s.packed&&c.packed[o]!==g?n("w.uint32(%i).fork()",(s.id<<3|2)>>>0)("for(var i=0;i<%s.length;++i)",i)("w.%s(%s[i])",o,i)("w.ldelim()"):(n("for(var i=0;i<%s.length;++i)",i),h===g?l(n,s,u,i+"[i]"):n("w.uint32(%i).%s(%s[i])",(s.id<<3|h)>>>0,o,i)),n("}")):(s.optional&&n("if(%s!=null&&Object.hasOwnProperty.call(m,%j))",i,s.name),h===g?l(n,s,u,i):n("w.uint32(%i).%s(%s)",(s.id<<3|h)>>>0,o,i))}return n("return w")};var f=t(14),c=t(32),a=t(33);function l(t,i,n,r){i.resolvedType.group?t("types[%i].encode(%s,w.uint32(%i)).uint32(%i)",n,r,(i.id<<3|3)>>>0,(i.id<<3|4)>>>0):t("types[%i].encode(%s,w.uint32(%i).fork()).ldelim()",n,r,(i.id<<3|2)>>>0)}},{14:14,32:32,33:33}],14:[function(t,i,n){i.exports=s;var h=t(22),r=(((s.prototype=Object.create(h.prototype)).constructor=s).className="Enum",t(21)),e=t(33);function s(t,i,n,r,e,s){if(h.call(this,t,n),i&&"object"!=typeof i)throw TypeError("values must be an object");if(this.valuesById={},this.values=Object.create(this.valuesById),this.comment=r,this.comments=e||{},this.valuesOptions=s,this.reserved=g,i)for(var u=Object.keys(i),o=0;oi)return!0;return!1},a.isReservedName=function(t,i){if(t)for(var n=0;n "+t.len)}function h(t){this.buf=t,this.pos=0,this.len=t.length}function f(){return e.Buffer?function(t){return(h.create=function(t){return e.Buffer.isBuffer(t)?new r(t):a(t)})(t)}:a}var c,a="undefined"!=typeof Uint8Array?function(t){if(t instanceof Uint8Array||Array.isArray(t))return new h(t);throw Error("illegal buffer")}:function(t){if(Array.isArray(t))return new h(t);throw Error("illegal buffer")};function l(){var t=new s(0,0),i=0;if(!(4=this.len)throw o(this);if(t.lo=(t.lo|(127&this.buf[this.pos])<<7*i)>>>0,this.buf[this.pos++]<128)return t}return t.lo=(t.lo|(127&this.buf[this.pos++])<<7*i)>>>0,t}for(;i<4;++i)if(t.lo=(t.lo|(127&this.buf[this.pos])<<7*i)>>>0,this.buf[this.pos++]<128)return t;if(t.lo=(t.lo|(127&this.buf[this.pos])<<28)>>>0,t.hi=(t.hi|(127&this.buf[this.pos])>>4)>>>0,this.buf[this.pos++]<128)return t;if(i=0,4>>0,this.buf[this.pos++]<128)return t}else for(;i<5;++i){if(this.pos>=this.len)throw o(this);if(t.hi=(t.hi|(127&this.buf[this.pos])<<7*i+3)>>>0,this.buf[this.pos++]<128)return t}throw Error("invalid varint encoding")}function d(t,i){return(t[i-4]|t[i-3]<<8|t[i-2]<<16|t[i-1]<<24)>>>0}function v(){if(this.pos+8>this.len)throw o(this,8);return new s(d(this.buf,this.pos+=4),d(this.buf,this.pos+=4))}h.create=f(),h.prototype.h=e.Array.prototype.subarray||e.Array.prototype.slice,h.prototype.uint32=(c=4294967295,function(){if(c=(127&this.buf[this.pos])>>>0,this.buf[this.pos++]<128||(c=(c|(127&this.buf[this.pos])<<7)>>>0,this.buf[this.pos++]<128||(c=(c|(127&this.buf[this.pos])<<14)>>>0,this.buf[this.pos++]<128||(c=(c|(127&this.buf[this.pos])<<21)>>>0,this.buf[this.pos++]<128||(c=(c|(15&this.buf[this.pos])<<28)>>>0,this.buf[this.pos++]<128||!((this.pos+=5)>this.len))))))return c;throw this.pos=this.len,o(this,10)}),h.prototype.int32=function(){return 0|this.uint32()},h.prototype.sint32=function(){var t=this.uint32();return t>>>1^-(1&t)|0},h.prototype.bool=function(){return 0!==this.uint32()},h.prototype.fixed32=function(){if(this.pos+4>this.len)throw o(this,4);return d(this.buf,this.pos+=4)},h.prototype.sfixed32=function(){if(this.pos+4>this.len)throw o(this,4);return 0|d(this.buf,this.pos+=4)},h.prototype.float=function(){if(this.pos+4>this.len)throw o(this,4);var t=e.float.readFloatLE(this.buf,this.pos);return this.pos+=4,t},h.prototype.double=function(){if(this.pos+8>this.len)throw o(this,4);var t=e.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,t},h.prototype.bytes=function(){var t=this.uint32(),i=this.pos,n=this.pos+t;if(n>this.len)throw o(this,t);return this.pos+=t,Array.isArray(this.buf)?this.buf.slice(i,n):i===n?new this.buf.constructor(0):this.h.call(this.buf,i,n)},h.prototype.string=function(){var t=this.bytes();return u.read(t,0,t.length)},h.prototype.skip=function(t){if("number"==typeof t){if(this.pos+t>this.len)throw o(this,t);this.pos+=t}else do{if(this.pos>=this.len)throw o(this)}while(128&this.buf[this.pos++]);return this},h.prototype.skipType=function(t){switch(t){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;4!=(t=7&this.uint32());)this.skipType(t);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+t+" at offset "+this.pos)}return this},h.r=function(t){r=t,h.create=f(),r.r();var i=e.Long?"toLong":"toNumber";e.merge(h.prototype,{int64:function(){return l.call(this)[i](!1)},uint64:function(){return l.call(this)[i](!0)},sint64:function(){return l.call(this).zzDecode()[i](!1)},fixed64:function(){return v.call(this)[i](!0)},sfixed64:function(){return v.call(this)[i](!1)}})}},{35:35}],25:[function(t,i,n){i.exports=s;var r=t(24),e=((s.prototype=Object.create(r.prototype)).constructor=s,t(35));function s(t){r.call(this,t)}s.r=function(){e.Buffer&&(s.prototype.h=e.Buffer.prototype.slice)},s.prototype.string=function(){var t=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+t,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+t,this.len))},s.r()},{24:24,35:35}],26:[function(t,i,n){i.exports=h;var r,d,v,e=t(21),s=(((h.prototype=Object.create(e.prototype)).constructor=h).className="Root",t(15)),u=t(14),o=t(23),b=t(33);function h(t){e.call(this,"",t),this.deferred=[],this.files=[]}function p(){}h.fromJSON=function(t,i){return i=i||new h,t.options&&i.setOptions(t.options),i.addJSON(t.nested)},h.prototype.resolvePath=b.path.resolve,h.prototype.fetch=b.fetch,h.prototype.load=function t(i,s,e){"function"==typeof s&&(e=s,s=g);var u=this;if(!e)return b.asPromise(t,u,i,s);var o=e===p;function h(t,i){if(e){var n=e;if(e=null,o)throw t;n(t,i)}}function f(t){var i=t.lastIndexOf("google/protobuf/");if(-1>>0,this.hi=i>>>0}var s=e.zero=new e(0,0),u=(s.toNumber=function(){return 0},s.zzEncode=s.zzDecode=function(){return this},s.length=function(){return 1},e.zeroHash="\0\0\0\0\0\0\0\0",e.fromNumber=function(t){var i,n;return 0===t?s:(n=(t=(i=t<0)?-t:t)>>>0,t=(t-n)/4294967296>>>0,i&&(t=~t>>>0,n=~n>>>0,4294967295<++n&&(n=0,4294967295<++t&&(t=0))),new e(n,t))},e.from=function(t){if("number"==typeof t)return e.fromNumber(t);if(r.isString(t)){if(!r.Long)return e.fromNumber(parseInt(t,10));t=r.Long.fromString(t)}return t.low||t.high?new e(t.low>>>0,t.high>>>0):s},e.prototype.toNumber=function(t){var i;return!t&&this.hi>>>31?(t=1+~this.lo>>>0,i=~this.hi>>>0,-(t+4294967296*(i=t?i:i+1>>>0))):this.lo+4294967296*this.hi},e.prototype.toLong=function(t){return r.Long?new r.Long(0|this.lo,0|this.hi,!!t):{low:0|this.lo,high:0|this.hi,unsigned:!!t}},String.prototype.charCodeAt);e.fromHash=function(t){return"\0\0\0\0\0\0\0\0"===t?s:new e((u.call(t,0)|u.call(t,1)<<8|u.call(t,2)<<16|u.call(t,3)<<24)>>>0,(u.call(t,4)|u.call(t,5)<<8|u.call(t,6)<<16|u.call(t,7)<<24)>>>0)},e.prototype.toHash=function(){return String.fromCharCode(255&this.lo,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,255&this.hi,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},e.prototype.zzEncode=function(){var t=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^t)>>>0,this.lo=(this.lo<<1^t)>>>0,this},e.prototype.zzDecode=function(){var t=-(1&this.lo);return this.lo=((this.lo>>>1|this.hi<<31)^t)>>>0,this.hi=(this.hi>>>1^t)>>>0,this},e.prototype.length=function(){var t=this.lo,i=(this.lo>>>28|this.hi<<4)>>>0,n=this.hi>>>24;return 0==n?0==i?t<16384?t<128?1:2:t<2097152?3:4:i<16384?i<128?5:6:i<2097152?7:8:n<128?9:10}},{35:35}],35:[function(t,i,n){var r=n;function e(t,i,n){for(var r=Object.keys(i),e=0;e>>7|t.hi<<25)>>>0,t.hi>>>=7;for(;127>>7;i[n++]=t.lo}function p(t,i,n){i[n]=255&t,i[n+1]=t>>>8&255,i[n+2]=t>>>16&255,i[n+3]=t>>>24}a.create=l(),a.alloc=function(t){return new e.Array(t)},e.Array!==Array&&(a.alloc=e.pool(a.alloc,e.Array.prototype.subarray)),a.prototype.p=function(t,i,n){return this.tail=this.tail.next=new h(t,i,n),this.len+=i,this},(v.prototype=Object.create(h.prototype)).fn=function(t,i,n){for(;127>>=7;i[n]=t},a.prototype.uint32=function(t){return this.len+=(this.tail=this.tail.next=new v((t>>>=0)<128?1:t<16384?2:t<2097152?3:t<268435456?4:5,t)).len,this},a.prototype.int32=function(t){return t<0?this.p(b,10,s.fromNumber(t)):this.uint32(t)},a.prototype.sint32=function(t){return this.uint32((t<<1^t>>31)>>>0)},a.prototype.int64=a.prototype.uint64=function(t){t=s.from(t);return this.p(b,t.length(),t)},a.prototype.sint64=function(t){t=s.from(t).zzEncode();return this.p(b,t.length(),t)},a.prototype.bool=function(t){return this.p(d,1,t?1:0)},a.prototype.sfixed32=a.prototype.fixed32=function(t){return this.p(p,4,t>>>0)},a.prototype.sfixed64=a.prototype.fixed64=function(t){t=s.from(t);return this.p(p,4,t.lo).p(p,4,t.hi)},a.prototype.float=function(t){return this.p(e.float.writeFloatLE,4,t)},a.prototype.double=function(t){return this.p(e.float.writeDoubleLE,8,t)};var y=e.Array.prototype.set?function(t,i,n){i.set(t,n)}:function(t,i,n){for(var r=0;r>>0;return n?(e.isString(t)&&(i=a.alloc(n=u.length(t)),u.decode(t,i,0),t=i),this.uint32(n).p(y,n,t)):this.p(d,1,0)},a.prototype.string=function(t){var i=o.length(t);return i?this.uint32(i).p(o.write,i,t):this.p(d,1,0)},a.prototype.fork=function(){return this.states=new c(this),this.head=this.tail=new h(f,0,0),this.len=0,this},a.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new h(f,0,0),this.len=0),this},a.prototype.ldelim=function(){var t=this.head,i=this.tail,n=this.len;return this.reset().uint32(n),n&&(this.tail.next=t.next,this.tail=i,this.len+=n),this},a.prototype.finish=function(){for(var t=this.head.next,i=this.constructor.alloc(this.len),n=0;t;)t.fn(t.val,i,n),n+=t.len,t=t.next;return i},a.r=function(t){r=t,a.create=l(),r.r()}},{35:35}],39:[function(t,i,n){i.exports=s;var r=t(38),e=((s.prototype=Object.create(r.prototype)).constructor=s,t(35));function s(){r.call(this)}function u(t,i,n){t.length<40?e.utf8.write(t,i,n):i.utf8Write?i.utf8Write(t,n):i.write(t,n)}s.r=function(){s.alloc=e.b,s.writeBytesBuffer=e.Buffer&&e.Buffer.prototype instanceof Uint8Array&&"set"===e.Buffer.prototype.set.name?function(t,i,n){i.set(t,n)}:function(t,i,n){if(t.copy)t.copy(i,n,0,t.length);else for(var r=0;r>>0;return this.uint32(i),i&&this.p(s.writeBytesBuffer,i,t),this},s.prototype.string=function(t){var i=e.Buffer.byteLength(t);return this.uint32(i),i&&this.p(u,i,t),this},s.r()},{35:35,38:38}]},{},[16])}(); -//# sourceMappingURL=protobuf.min.js.map diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/dist/minimal/protobuf.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/dist/minimal/protobuf.js deleted file mode 100644 index 87317869..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/dist/minimal/protobuf.js +++ /dev/null @@ -1,2731 +0,0 @@ -/*! - * protobuf.js v7.1.0 (c) 2016, daniel wirtz - * compiled thu, 22 sep 2022 17:16:10 utc - * licensed under the bsd-3-clause license - * see: https://github.com/dcodeio/protobuf.js for details - */ -(function(undefined){"use strict";(function prelude(modules, cache, entries) { - - // This is the prelude used to bundle protobuf.js for the browser. Wraps up the CommonJS - // sources through a conflict-free require shim and is again wrapped within an iife that - // provides a minification-friendly `undefined` var plus a global "use strict" directive - // so that minification can remove the directives of each module. - - function $require(name) { - var $module = cache[name]; - if (!$module) - modules[name][0].call($module = cache[name] = { exports: {} }, $require, $module, $module.exports); - return $module.exports; - } - - var protobuf = $require(entries[0]); - - // Expose globally - protobuf.util.global.protobuf = protobuf; - - // Be nice to AMD - if (typeof define === "function" && define.amd) - define(["long"], function(Long) { - if (Long && Long.isLong) { - protobuf.util.Long = Long; - protobuf.configure(); - } - return protobuf; - }); - - // Be nice to CommonJS - if (typeof module === "object" && module && module.exports) - module.exports = protobuf; - -})/* end of prelude */({1:[function(require,module,exports){ -"use strict"; -module.exports = asPromise; - -/** - * Callback as used by {@link util.asPromise}. - * @typedef asPromiseCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {...*} params Additional arguments - * @returns {undefined} - */ - -/** - * Returns a promise from a node-style callback function. - * @memberof util - * @param {asPromiseCallback} fn Function to call - * @param {*} ctx Function context - * @param {...*} params Function arguments - * @returns {Promise<*>} Promisified function - */ -function asPromise(fn, ctx/*, varargs */) { - var params = new Array(arguments.length - 1), - offset = 0, - index = 2, - pending = true; - while (index < arguments.length) - params[offset++] = arguments[index++]; - return new Promise(function executor(resolve, reject) { - params[offset] = function callback(err/*, varargs */) { - if (pending) { - pending = false; - if (err) - reject(err); - else { - var params = new Array(arguments.length - 1), - offset = 0; - while (offset < params.length) - params[offset++] = arguments[offset]; - resolve.apply(null, params); - } - } - }; - try { - fn.apply(ctx || null, params); - } catch (err) { - if (pending) { - pending = false; - reject(err); - } - } - }); -} - -},{}],2:[function(require,module,exports){ -"use strict"; - -/** - * A minimal base64 implementation for number arrays. - * @memberof util - * @namespace - */ -var base64 = exports; - -/** - * Calculates the byte length of a base64 encoded string. - * @param {string} string Base64 encoded string - * @returns {number} Byte length - */ -base64.length = function length(string) { - var p = string.length; - if (!p) - return 0; - var n = 0; - while (--p % 4 > 1 && string.charAt(p) === "=") - ++n; - return Math.ceil(string.length * 3) / 4 - n; -}; - -// Base64 encoding table -var b64 = new Array(64); - -// Base64 decoding table -var s64 = new Array(123); - -// 65..90, 97..122, 48..57, 43, 47 -for (var i = 0; i < 64;) - s64[b64[i] = i < 26 ? i + 65 : i < 52 ? i + 71 : i < 62 ? i - 4 : i - 59 | 43] = i++; - -/** - * Encodes a buffer to a base64 encoded string. - * @param {Uint8Array} buffer Source buffer - * @param {number} start Source start - * @param {number} end Source end - * @returns {string} Base64 encoded string - */ -base64.encode = function encode(buffer, start, end) { - var parts = null, - chunk = []; - var i = 0, // output index - j = 0, // goto index - t; // temporary - while (start < end) { - var b = buffer[start++]; - switch (j) { - case 0: - chunk[i++] = b64[b >> 2]; - t = (b & 3) << 4; - j = 1; - break; - case 1: - chunk[i++] = b64[t | b >> 4]; - t = (b & 15) << 2; - j = 2; - break; - case 2: - chunk[i++] = b64[t | b >> 6]; - chunk[i++] = b64[b & 63]; - j = 0; - break; - } - if (i > 8191) { - (parts || (parts = [])).push(String.fromCharCode.apply(String, chunk)); - i = 0; - } - } - if (j) { - chunk[i++] = b64[t]; - chunk[i++] = 61; - if (j === 1) - chunk[i++] = 61; - } - if (parts) { - if (i) - parts.push(String.fromCharCode.apply(String, chunk.slice(0, i))); - return parts.join(""); - } - return String.fromCharCode.apply(String, chunk.slice(0, i)); -}; - -var invalidEncoding = "invalid encoding"; - -/** - * Decodes a base64 encoded string to a buffer. - * @param {string} string Source string - * @param {Uint8Array} buffer Destination buffer - * @param {number} offset Destination offset - * @returns {number} Number of bytes written - * @throws {Error} If encoding is invalid - */ -base64.decode = function decode(string, buffer, offset) { - var start = offset; - var j = 0, // goto index - t; // temporary - for (var i = 0; i < string.length;) { - var c = string.charCodeAt(i++); - if (c === 61 && j > 1) - break; - if ((c = s64[c]) === undefined) - throw Error(invalidEncoding); - switch (j) { - case 0: - t = c; - j = 1; - break; - case 1: - buffer[offset++] = t << 2 | (c & 48) >> 4; - t = c; - j = 2; - break; - case 2: - buffer[offset++] = (t & 15) << 4 | (c & 60) >> 2; - t = c; - j = 3; - break; - case 3: - buffer[offset++] = (t & 3) << 6 | c; - j = 0; - break; - } - } - if (j === 1) - throw Error(invalidEncoding); - return offset - start; -}; - -/** - * Tests if the specified string appears to be base64 encoded. - * @param {string} string String to test - * @returns {boolean} `true` if probably base64 encoded, otherwise false - */ -base64.test = function test(string) { - return /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(string); -}; - -},{}],3:[function(require,module,exports){ -"use strict"; -module.exports = EventEmitter; - -/** - * Constructs a new event emitter instance. - * @classdesc A minimal event emitter. - * @memberof util - * @constructor - */ -function EventEmitter() { - - /** - * Registered listeners. - * @type {Object.} - * @private - */ - this._listeners = {}; -} - -/** - * Registers an event listener. - * @param {string} evt Event name - * @param {function} fn Listener - * @param {*} [ctx] Listener context - * @returns {util.EventEmitter} `this` - */ -EventEmitter.prototype.on = function on(evt, fn, ctx) { - (this._listeners[evt] || (this._listeners[evt] = [])).push({ - fn : fn, - ctx : ctx || this - }); - return this; -}; - -/** - * Removes an event listener or any matching listeners if arguments are omitted. - * @param {string} [evt] Event name. Removes all listeners if omitted. - * @param {function} [fn] Listener to remove. Removes all listeners of `evt` if omitted. - * @returns {util.EventEmitter} `this` - */ -EventEmitter.prototype.off = function off(evt, fn) { - if (evt === undefined) - this._listeners = {}; - else { - if (fn === undefined) - this._listeners[evt] = []; - else { - var listeners = this._listeners[evt]; - for (var i = 0; i < listeners.length;) - if (listeners[i].fn === fn) - listeners.splice(i, 1); - else - ++i; - } - } - return this; -}; - -/** - * Emits an event by calling its listeners with the specified arguments. - * @param {string} evt Event name - * @param {...*} args Arguments - * @returns {util.EventEmitter} `this` - */ -EventEmitter.prototype.emit = function emit(evt) { - var listeners = this._listeners[evt]; - if (listeners) { - var args = [], - i = 1; - for (; i < arguments.length;) - args.push(arguments[i++]); - for (i = 0; i < listeners.length;) - listeners[i].fn.apply(listeners[i++].ctx, args); - } - return this; -}; - -},{}],4:[function(require,module,exports){ -"use strict"; - -module.exports = factory(factory); - -/** - * Reads / writes floats / doubles from / to buffers. - * @name util.float - * @namespace - */ - -/** - * Writes a 32 bit float to a buffer using little endian byte order. - * @name util.float.writeFloatLE - * @function - * @param {number} val Value to write - * @param {Uint8Array} buf Target buffer - * @param {number} pos Target buffer offset - * @returns {undefined} - */ - -/** - * Writes a 32 bit float to a buffer using big endian byte order. - * @name util.float.writeFloatBE - * @function - * @param {number} val Value to write - * @param {Uint8Array} buf Target buffer - * @param {number} pos Target buffer offset - * @returns {undefined} - */ - -/** - * Reads a 32 bit float from a buffer using little endian byte order. - * @name util.float.readFloatLE - * @function - * @param {Uint8Array} buf Source buffer - * @param {number} pos Source buffer offset - * @returns {number} Value read - */ - -/** - * Reads a 32 bit float from a buffer using big endian byte order. - * @name util.float.readFloatBE - * @function - * @param {Uint8Array} buf Source buffer - * @param {number} pos Source buffer offset - * @returns {number} Value read - */ - -/** - * Writes a 64 bit double to a buffer using little endian byte order. - * @name util.float.writeDoubleLE - * @function - * @param {number} val Value to write - * @param {Uint8Array} buf Target buffer - * @param {number} pos Target buffer offset - * @returns {undefined} - */ - -/** - * Writes a 64 bit double to a buffer using big endian byte order. - * @name util.float.writeDoubleBE - * @function - * @param {number} val Value to write - * @param {Uint8Array} buf Target buffer - * @param {number} pos Target buffer offset - * @returns {undefined} - */ - -/** - * Reads a 64 bit double from a buffer using little endian byte order. - * @name util.float.readDoubleLE - * @function - * @param {Uint8Array} buf Source buffer - * @param {number} pos Source buffer offset - * @returns {number} Value read - */ - -/** - * Reads a 64 bit double from a buffer using big endian byte order. - * @name util.float.readDoubleBE - * @function - * @param {Uint8Array} buf Source buffer - * @param {number} pos Source buffer offset - * @returns {number} Value read - */ - -// Factory function for the purpose of node-based testing in modified global environments -function factory(exports) { - - // float: typed array - if (typeof Float32Array !== "undefined") (function() { - - var f32 = new Float32Array([ -0 ]), - f8b = new Uint8Array(f32.buffer), - le = f8b[3] === 128; - - function writeFloat_f32_cpy(val, buf, pos) { - f32[0] = val; - buf[pos ] = f8b[0]; - buf[pos + 1] = f8b[1]; - buf[pos + 2] = f8b[2]; - buf[pos + 3] = f8b[3]; - } - - function writeFloat_f32_rev(val, buf, pos) { - f32[0] = val; - buf[pos ] = f8b[3]; - buf[pos + 1] = f8b[2]; - buf[pos + 2] = f8b[1]; - buf[pos + 3] = f8b[0]; - } - - /* istanbul ignore next */ - exports.writeFloatLE = le ? writeFloat_f32_cpy : writeFloat_f32_rev; - /* istanbul ignore next */ - exports.writeFloatBE = le ? writeFloat_f32_rev : writeFloat_f32_cpy; - - function readFloat_f32_cpy(buf, pos) { - f8b[0] = buf[pos ]; - f8b[1] = buf[pos + 1]; - f8b[2] = buf[pos + 2]; - f8b[3] = buf[pos + 3]; - return f32[0]; - } - - function readFloat_f32_rev(buf, pos) { - f8b[3] = buf[pos ]; - f8b[2] = buf[pos + 1]; - f8b[1] = buf[pos + 2]; - f8b[0] = buf[pos + 3]; - return f32[0]; - } - - /* istanbul ignore next */ - exports.readFloatLE = le ? readFloat_f32_cpy : readFloat_f32_rev; - /* istanbul ignore next */ - exports.readFloatBE = le ? readFloat_f32_rev : readFloat_f32_cpy; - - // float: ieee754 - })(); else (function() { - - function writeFloat_ieee754(writeUint, val, buf, pos) { - var sign = val < 0 ? 1 : 0; - if (sign) - val = -val; - if (val === 0) - writeUint(1 / val > 0 ? /* positive */ 0 : /* negative 0 */ 2147483648, buf, pos); - else if (isNaN(val)) - writeUint(2143289344, buf, pos); - else if (val > 3.4028234663852886e+38) // +-Infinity - writeUint((sign << 31 | 2139095040) >>> 0, buf, pos); - else if (val < 1.1754943508222875e-38) // denormal - writeUint((sign << 31 | Math.round(val / 1.401298464324817e-45)) >>> 0, buf, pos); - else { - var exponent = Math.floor(Math.log(val) / Math.LN2), - mantissa = Math.round(val * Math.pow(2, -exponent) * 8388608) & 8388607; - writeUint((sign << 31 | exponent + 127 << 23 | mantissa) >>> 0, buf, pos); - } - } - - exports.writeFloatLE = writeFloat_ieee754.bind(null, writeUintLE); - exports.writeFloatBE = writeFloat_ieee754.bind(null, writeUintBE); - - function readFloat_ieee754(readUint, buf, pos) { - var uint = readUint(buf, pos), - sign = (uint >> 31) * 2 + 1, - exponent = uint >>> 23 & 255, - mantissa = uint & 8388607; - return exponent === 255 - ? mantissa - ? NaN - : sign * Infinity - : exponent === 0 // denormal - ? sign * 1.401298464324817e-45 * mantissa - : sign * Math.pow(2, exponent - 150) * (mantissa + 8388608); - } - - exports.readFloatLE = readFloat_ieee754.bind(null, readUintLE); - exports.readFloatBE = readFloat_ieee754.bind(null, readUintBE); - - })(); - - // double: typed array - if (typeof Float64Array !== "undefined") (function() { - - var f64 = new Float64Array([-0]), - f8b = new Uint8Array(f64.buffer), - le = f8b[7] === 128; - - function writeDouble_f64_cpy(val, buf, pos) { - f64[0] = val; - buf[pos ] = f8b[0]; - buf[pos + 1] = f8b[1]; - buf[pos + 2] = f8b[2]; - buf[pos + 3] = f8b[3]; - buf[pos + 4] = f8b[4]; - buf[pos + 5] = f8b[5]; - buf[pos + 6] = f8b[6]; - buf[pos + 7] = f8b[7]; - } - - function writeDouble_f64_rev(val, buf, pos) { - f64[0] = val; - buf[pos ] = f8b[7]; - buf[pos + 1] = f8b[6]; - buf[pos + 2] = f8b[5]; - buf[pos + 3] = f8b[4]; - buf[pos + 4] = f8b[3]; - buf[pos + 5] = f8b[2]; - buf[pos + 6] = f8b[1]; - buf[pos + 7] = f8b[0]; - } - - /* istanbul ignore next */ - exports.writeDoubleLE = le ? writeDouble_f64_cpy : writeDouble_f64_rev; - /* istanbul ignore next */ - exports.writeDoubleBE = le ? writeDouble_f64_rev : writeDouble_f64_cpy; - - function readDouble_f64_cpy(buf, pos) { - f8b[0] = buf[pos ]; - f8b[1] = buf[pos + 1]; - f8b[2] = buf[pos + 2]; - f8b[3] = buf[pos + 3]; - f8b[4] = buf[pos + 4]; - f8b[5] = buf[pos + 5]; - f8b[6] = buf[pos + 6]; - f8b[7] = buf[pos + 7]; - return f64[0]; - } - - function readDouble_f64_rev(buf, pos) { - f8b[7] = buf[pos ]; - f8b[6] = buf[pos + 1]; - f8b[5] = buf[pos + 2]; - f8b[4] = buf[pos + 3]; - f8b[3] = buf[pos + 4]; - f8b[2] = buf[pos + 5]; - f8b[1] = buf[pos + 6]; - f8b[0] = buf[pos + 7]; - return f64[0]; - } - - /* istanbul ignore next */ - exports.readDoubleLE = le ? readDouble_f64_cpy : readDouble_f64_rev; - /* istanbul ignore next */ - exports.readDoubleBE = le ? readDouble_f64_rev : readDouble_f64_cpy; - - // double: ieee754 - })(); else (function() { - - function writeDouble_ieee754(writeUint, off0, off1, val, buf, pos) { - var sign = val < 0 ? 1 : 0; - if (sign) - val = -val; - if (val === 0) { - writeUint(0, buf, pos + off0); - writeUint(1 / val > 0 ? /* positive */ 0 : /* negative 0 */ 2147483648, buf, pos + off1); - } else if (isNaN(val)) { - writeUint(0, buf, pos + off0); - writeUint(2146959360, buf, pos + off1); - } else if (val > 1.7976931348623157e+308) { // +-Infinity - writeUint(0, buf, pos + off0); - writeUint((sign << 31 | 2146435072) >>> 0, buf, pos + off1); - } else { - var mantissa; - if (val < 2.2250738585072014e-308) { // denormal - mantissa = val / 5e-324; - writeUint(mantissa >>> 0, buf, pos + off0); - writeUint((sign << 31 | mantissa / 4294967296) >>> 0, buf, pos + off1); - } else { - var exponent = Math.floor(Math.log(val) / Math.LN2); - if (exponent === 1024) - exponent = 1023; - mantissa = val * Math.pow(2, -exponent); - writeUint(mantissa * 4503599627370496 >>> 0, buf, pos + off0); - writeUint((sign << 31 | exponent + 1023 << 20 | mantissa * 1048576 & 1048575) >>> 0, buf, pos + off1); - } - } - } - - exports.writeDoubleLE = writeDouble_ieee754.bind(null, writeUintLE, 0, 4); - exports.writeDoubleBE = writeDouble_ieee754.bind(null, writeUintBE, 4, 0); - - function readDouble_ieee754(readUint, off0, off1, buf, pos) { - var lo = readUint(buf, pos + off0), - hi = readUint(buf, pos + off1); - var sign = (hi >> 31) * 2 + 1, - exponent = hi >>> 20 & 2047, - mantissa = 4294967296 * (hi & 1048575) + lo; - return exponent === 2047 - ? mantissa - ? NaN - : sign * Infinity - : exponent === 0 // denormal - ? sign * 5e-324 * mantissa - : sign * Math.pow(2, exponent - 1075) * (mantissa + 4503599627370496); - } - - exports.readDoubleLE = readDouble_ieee754.bind(null, readUintLE, 0, 4); - exports.readDoubleBE = readDouble_ieee754.bind(null, readUintBE, 4, 0); - - })(); - - return exports; -} - -// uint helpers - -function writeUintLE(val, buf, pos) { - buf[pos ] = val & 255; - buf[pos + 1] = val >>> 8 & 255; - buf[pos + 2] = val >>> 16 & 255; - buf[pos + 3] = val >>> 24; -} - -function writeUintBE(val, buf, pos) { - buf[pos ] = val >>> 24; - buf[pos + 1] = val >>> 16 & 255; - buf[pos + 2] = val >>> 8 & 255; - buf[pos + 3] = val & 255; -} - -function readUintLE(buf, pos) { - return (buf[pos ] - | buf[pos + 1] << 8 - | buf[pos + 2] << 16 - | buf[pos + 3] << 24) >>> 0; -} - -function readUintBE(buf, pos) { - return (buf[pos ] << 24 - | buf[pos + 1] << 16 - | buf[pos + 2] << 8 - | buf[pos + 3]) >>> 0; -} - -},{}],5:[function(require,module,exports){ -"use strict"; -module.exports = inquire; - -/** - * Requires a module only if available. - * @memberof util - * @param {string} moduleName Module to require - * @returns {?Object} Required module if available and not empty, otherwise `null` - */ -function inquire(moduleName) { - try { - var mod = eval("quire".replace(/^/,"re"))(moduleName); // eslint-disable-line no-eval - if (mod && (mod.length || Object.keys(mod).length)) - return mod; - } catch (e) {} // eslint-disable-line no-empty - return null; -} - -},{}],6:[function(require,module,exports){ -"use strict"; -module.exports = pool; - -/** - * An allocator as used by {@link util.pool}. - * @typedef PoolAllocator - * @type {function} - * @param {number} size Buffer size - * @returns {Uint8Array} Buffer - */ - -/** - * A slicer as used by {@link util.pool}. - * @typedef PoolSlicer - * @type {function} - * @param {number} start Start offset - * @param {number} end End offset - * @returns {Uint8Array} Buffer slice - * @this {Uint8Array} - */ - -/** - * A general purpose buffer pool. - * @memberof util - * @function - * @param {PoolAllocator} alloc Allocator - * @param {PoolSlicer} slice Slicer - * @param {number} [size=8192] Slab size - * @returns {PoolAllocator} Pooled allocator - */ -function pool(alloc, slice, size) { - var SIZE = size || 8192; - var MAX = SIZE >>> 1; - var slab = null; - var offset = SIZE; - return function pool_alloc(size) { - if (size < 1 || size > MAX) - return alloc(size); - if (offset + size > SIZE) { - slab = alloc(SIZE); - offset = 0; - } - var buf = slice.call(slab, offset, offset += size); - if (offset & 7) // align to 32 bit - offset = (offset | 7) + 1; - return buf; - }; -} - -},{}],7:[function(require,module,exports){ -"use strict"; - -/** - * A minimal UTF8 implementation for number arrays. - * @memberof util - * @namespace - */ -var utf8 = exports; - -/** - * Calculates the UTF8 byte length of a string. - * @param {string} string String - * @returns {number} Byte length - */ -utf8.length = function utf8_length(string) { - var len = 0, - c = 0; - for (var i = 0; i < string.length; ++i) { - c = string.charCodeAt(i); - if (c < 128) - len += 1; - else if (c < 2048) - len += 2; - else if ((c & 0xFC00) === 0xD800 && (string.charCodeAt(i + 1) & 0xFC00) === 0xDC00) { - ++i; - len += 4; - } else - len += 3; - } - return len; -}; - -/** - * Reads UTF8 bytes as a string. - * @param {Uint8Array} buffer Source buffer - * @param {number} start Source start - * @param {number} end Source end - * @returns {string} String read - */ -utf8.read = function utf8_read(buffer, start, end) { - var len = end - start; - if (len < 1) - return ""; - var parts = null, - chunk = [], - i = 0, // char offset - t; // temporary - while (start < end) { - t = buffer[start++]; - if (t < 128) - chunk[i++] = t; - else if (t > 191 && t < 224) - chunk[i++] = (t & 31) << 6 | buffer[start++] & 63; - else if (t > 239 && t < 365) { - t = ((t & 7) << 18 | (buffer[start++] & 63) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63) - 0x10000; - chunk[i++] = 0xD800 + (t >> 10); - chunk[i++] = 0xDC00 + (t & 1023); - } else - chunk[i++] = (t & 15) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63; - if (i > 8191) { - (parts || (parts = [])).push(String.fromCharCode.apply(String, chunk)); - i = 0; - } - } - if (parts) { - if (i) - parts.push(String.fromCharCode.apply(String, chunk.slice(0, i))); - return parts.join(""); - } - return String.fromCharCode.apply(String, chunk.slice(0, i)); -}; - -/** - * Writes a string as UTF8 bytes. - * @param {string} string Source string - * @param {Uint8Array} buffer Destination buffer - * @param {number} offset Destination offset - * @returns {number} Bytes written - */ -utf8.write = function utf8_write(string, buffer, offset) { - var start = offset, - c1, // character 1 - c2; // character 2 - for (var i = 0; i < string.length; ++i) { - c1 = string.charCodeAt(i); - if (c1 < 128) { - buffer[offset++] = c1; - } else if (c1 < 2048) { - buffer[offset++] = c1 >> 6 | 192; - buffer[offset++] = c1 & 63 | 128; - } else if ((c1 & 0xFC00) === 0xD800 && ((c2 = string.charCodeAt(i + 1)) & 0xFC00) === 0xDC00) { - c1 = 0x10000 + ((c1 & 0x03FF) << 10) + (c2 & 0x03FF); - ++i; - buffer[offset++] = c1 >> 18 | 240; - buffer[offset++] = c1 >> 12 & 63 | 128; - buffer[offset++] = c1 >> 6 & 63 | 128; - buffer[offset++] = c1 & 63 | 128; - } else { - buffer[offset++] = c1 >> 12 | 224; - buffer[offset++] = c1 >> 6 & 63 | 128; - buffer[offset++] = c1 & 63 | 128; - } - } - return offset - start; -}; - -},{}],8:[function(require,module,exports){ -"use strict"; -var protobuf = exports; - -/** - * Build type, one of `"full"`, `"light"` or `"minimal"`. - * @name build - * @type {string} - * @const - */ -protobuf.build = "minimal"; - -// Serialization -protobuf.Writer = require(16); -protobuf.BufferWriter = require(17); -protobuf.Reader = require(9); -protobuf.BufferReader = require(10); - -// Utility -protobuf.util = require(15); -protobuf.rpc = require(12); -protobuf.roots = require(11); -protobuf.configure = configure; - -/* istanbul ignore next */ -/** - * Reconfigures the library according to the environment. - * @returns {undefined} - */ -function configure() { - protobuf.util._configure(); - protobuf.Writer._configure(protobuf.BufferWriter); - protobuf.Reader._configure(protobuf.BufferReader); -} - -// Set up buffer utility according to the environment -configure(); - -},{"10":10,"11":11,"12":12,"15":15,"16":16,"17":17,"9":9}],9:[function(require,module,exports){ -"use strict"; -module.exports = Reader; - -var util = require(15); - -var BufferReader; // cyclic - -var LongBits = util.LongBits, - utf8 = util.utf8; - -/* istanbul ignore next */ -function indexOutOfRange(reader, writeLength) { - return RangeError("index out of range: " + reader.pos + " + " + (writeLength || 1) + " > " + reader.len); -} - -/** - * Constructs a new reader instance using the specified buffer. - * @classdesc Wire format reader using `Uint8Array` if available, otherwise `Array`. - * @constructor - * @param {Uint8Array} buffer Buffer to read from - */ -function Reader(buffer) { - - /** - * Read buffer. - * @type {Uint8Array} - */ - this.buf = buffer; - - /** - * Read buffer position. - * @type {number} - */ - this.pos = 0; - - /** - * Read buffer length. - * @type {number} - */ - this.len = buffer.length; -} - -var create_array = typeof Uint8Array !== "undefined" - ? function create_typed_array(buffer) { - if (buffer instanceof Uint8Array || Array.isArray(buffer)) - return new Reader(buffer); - throw Error("illegal buffer"); - } - /* istanbul ignore next */ - : function create_array(buffer) { - if (Array.isArray(buffer)) - return new Reader(buffer); - throw Error("illegal buffer"); - }; - -var create = function create() { - return util.Buffer - ? function create_buffer_setup(buffer) { - return (Reader.create = function create_buffer(buffer) { - return util.Buffer.isBuffer(buffer) - ? new BufferReader(buffer) - /* istanbul ignore next */ - : create_array(buffer); - })(buffer); - } - /* istanbul ignore next */ - : create_array; -}; - -/** - * Creates a new reader using the specified buffer. - * @function - * @param {Uint8Array|Buffer} buffer Buffer to read from - * @returns {Reader|BufferReader} A {@link BufferReader} if `buffer` is a Buffer, otherwise a {@link Reader} - * @throws {Error} If `buffer` is not a valid buffer - */ -Reader.create = create(); - -Reader.prototype._slice = util.Array.prototype.subarray || /* istanbul ignore next */ util.Array.prototype.slice; - -/** - * Reads a varint as an unsigned 32 bit value. - * @function - * @returns {number} Value read - */ -Reader.prototype.uint32 = (function read_uint32_setup() { - var value = 4294967295; // optimizer type-hint, tends to deopt otherwise (?!) - return function read_uint32() { - value = ( this.buf[this.pos] & 127 ) >>> 0; if (this.buf[this.pos++] < 128) return value; - value = (value | (this.buf[this.pos] & 127) << 7) >>> 0; if (this.buf[this.pos++] < 128) return value; - value = (value | (this.buf[this.pos] & 127) << 14) >>> 0; if (this.buf[this.pos++] < 128) return value; - value = (value | (this.buf[this.pos] & 127) << 21) >>> 0; if (this.buf[this.pos++] < 128) return value; - value = (value | (this.buf[this.pos] & 15) << 28) >>> 0; if (this.buf[this.pos++] < 128) return value; - - /* istanbul ignore if */ - if ((this.pos += 5) > this.len) { - this.pos = this.len; - throw indexOutOfRange(this, 10); - } - return value; - }; -})(); - -/** - * Reads a varint as a signed 32 bit value. - * @returns {number} Value read - */ -Reader.prototype.int32 = function read_int32() { - return this.uint32() | 0; -}; - -/** - * Reads a zig-zag encoded varint as a signed 32 bit value. - * @returns {number} Value read - */ -Reader.prototype.sint32 = function read_sint32() { - var value = this.uint32(); - return value >>> 1 ^ -(value & 1) | 0; -}; - -/* eslint-disable no-invalid-this */ - -function readLongVarint() { - // tends to deopt with local vars for octet etc. - var bits = new LongBits(0, 0); - var i = 0; - if (this.len - this.pos > 4) { // fast route (lo) - for (; i < 4; ++i) { - // 1st..4th - bits.lo = (bits.lo | (this.buf[this.pos] & 127) << i * 7) >>> 0; - if (this.buf[this.pos++] < 128) - return bits; - } - // 5th - bits.lo = (bits.lo | (this.buf[this.pos] & 127) << 28) >>> 0; - bits.hi = (bits.hi | (this.buf[this.pos] & 127) >> 4) >>> 0; - if (this.buf[this.pos++] < 128) - return bits; - i = 0; - } else { - for (; i < 3; ++i) { - /* istanbul ignore if */ - if (this.pos >= this.len) - throw indexOutOfRange(this); - // 1st..3th - bits.lo = (bits.lo | (this.buf[this.pos] & 127) << i * 7) >>> 0; - if (this.buf[this.pos++] < 128) - return bits; - } - // 4th - bits.lo = (bits.lo | (this.buf[this.pos++] & 127) << i * 7) >>> 0; - return bits; - } - if (this.len - this.pos > 4) { // fast route (hi) - for (; i < 5; ++i) { - // 6th..10th - bits.hi = (bits.hi | (this.buf[this.pos] & 127) << i * 7 + 3) >>> 0; - if (this.buf[this.pos++] < 128) - return bits; - } - } else { - for (; i < 5; ++i) { - /* istanbul ignore if */ - if (this.pos >= this.len) - throw indexOutOfRange(this); - // 6th..10th - bits.hi = (bits.hi | (this.buf[this.pos] & 127) << i * 7 + 3) >>> 0; - if (this.buf[this.pos++] < 128) - return bits; - } - } - /* istanbul ignore next */ - throw Error("invalid varint encoding"); -} - -/* eslint-enable no-invalid-this */ - -/** - * Reads a varint as a signed 64 bit value. - * @name Reader#int64 - * @function - * @returns {Long} Value read - */ - -/** - * Reads a varint as an unsigned 64 bit value. - * @name Reader#uint64 - * @function - * @returns {Long} Value read - */ - -/** - * Reads a zig-zag encoded varint as a signed 64 bit value. - * @name Reader#sint64 - * @function - * @returns {Long} Value read - */ - -/** - * Reads a varint as a boolean. - * @returns {boolean} Value read - */ -Reader.prototype.bool = function read_bool() { - return this.uint32() !== 0; -}; - -function readFixed32_end(buf, end) { // note that this uses `end`, not `pos` - return (buf[end - 4] - | buf[end - 3] << 8 - | buf[end - 2] << 16 - | buf[end - 1] << 24) >>> 0; -} - -/** - * Reads fixed 32 bits as an unsigned 32 bit integer. - * @returns {number} Value read - */ -Reader.prototype.fixed32 = function read_fixed32() { - - /* istanbul ignore if */ - if (this.pos + 4 > this.len) - throw indexOutOfRange(this, 4); - - return readFixed32_end(this.buf, this.pos += 4); -}; - -/** - * Reads fixed 32 bits as a signed 32 bit integer. - * @returns {number} Value read - */ -Reader.prototype.sfixed32 = function read_sfixed32() { - - /* istanbul ignore if */ - if (this.pos + 4 > this.len) - throw indexOutOfRange(this, 4); - - return readFixed32_end(this.buf, this.pos += 4) | 0; -}; - -/* eslint-disable no-invalid-this */ - -function readFixed64(/* this: Reader */) { - - /* istanbul ignore if */ - if (this.pos + 8 > this.len) - throw indexOutOfRange(this, 8); - - return new LongBits(readFixed32_end(this.buf, this.pos += 4), readFixed32_end(this.buf, this.pos += 4)); -} - -/* eslint-enable no-invalid-this */ - -/** - * Reads fixed 64 bits. - * @name Reader#fixed64 - * @function - * @returns {Long} Value read - */ - -/** - * Reads zig-zag encoded fixed 64 bits. - * @name Reader#sfixed64 - * @function - * @returns {Long} Value read - */ - -/** - * Reads a float (32 bit) as a number. - * @function - * @returns {number} Value read - */ -Reader.prototype.float = function read_float() { - - /* istanbul ignore if */ - if (this.pos + 4 > this.len) - throw indexOutOfRange(this, 4); - - var value = util.float.readFloatLE(this.buf, this.pos); - this.pos += 4; - return value; -}; - -/** - * Reads a double (64 bit float) as a number. - * @function - * @returns {number} Value read - */ -Reader.prototype.double = function read_double() { - - /* istanbul ignore if */ - if (this.pos + 8 > this.len) - throw indexOutOfRange(this, 4); - - var value = util.float.readDoubleLE(this.buf, this.pos); - this.pos += 8; - return value; -}; - -/** - * Reads a sequence of bytes preceeded by its length as a varint. - * @returns {Uint8Array} Value read - */ -Reader.prototype.bytes = function read_bytes() { - var length = this.uint32(), - start = this.pos, - end = this.pos + length; - - /* istanbul ignore if */ - if (end > this.len) - throw indexOutOfRange(this, length); - - this.pos += length; - if (Array.isArray(this.buf)) // plain array - return this.buf.slice(start, end); - return start === end // fix for IE 10/Win8 and others' subarray returning array of size 1 - ? new this.buf.constructor(0) - : this._slice.call(this.buf, start, end); -}; - -/** - * Reads a string preceeded by its byte length as a varint. - * @returns {string} Value read - */ -Reader.prototype.string = function read_string() { - var bytes = this.bytes(); - return utf8.read(bytes, 0, bytes.length); -}; - -/** - * Skips the specified number of bytes if specified, otherwise skips a varint. - * @param {number} [length] Length if known, otherwise a varint is assumed - * @returns {Reader} `this` - */ -Reader.prototype.skip = function skip(length) { - if (typeof length === "number") { - /* istanbul ignore if */ - if (this.pos + length > this.len) - throw indexOutOfRange(this, length); - this.pos += length; - } else { - do { - /* istanbul ignore if */ - if (this.pos >= this.len) - throw indexOutOfRange(this); - } while (this.buf[this.pos++] & 128); - } - return this; -}; - -/** - * Skips the next element of the specified wire type. - * @param {number} wireType Wire type received - * @returns {Reader} `this` - */ -Reader.prototype.skipType = function(wireType) { - switch (wireType) { - case 0: - this.skip(); - break; - case 1: - this.skip(8); - break; - case 2: - this.skip(this.uint32()); - break; - case 3: - while ((wireType = this.uint32() & 7) !== 4) { - this.skipType(wireType); - } - break; - case 5: - this.skip(4); - break; - - /* istanbul ignore next */ - default: - throw Error("invalid wire type " + wireType + " at offset " + this.pos); - } - return this; -}; - -Reader._configure = function(BufferReader_) { - BufferReader = BufferReader_; - Reader.create = create(); - BufferReader._configure(); - - var fn = util.Long ? "toLong" : /* istanbul ignore next */ "toNumber"; - util.merge(Reader.prototype, { - - int64: function read_int64() { - return readLongVarint.call(this)[fn](false); - }, - - uint64: function read_uint64() { - return readLongVarint.call(this)[fn](true); - }, - - sint64: function read_sint64() { - return readLongVarint.call(this).zzDecode()[fn](false); - }, - - fixed64: function read_fixed64() { - return readFixed64.call(this)[fn](true); - }, - - sfixed64: function read_sfixed64() { - return readFixed64.call(this)[fn](false); - } - - }); -}; - -},{"15":15}],10:[function(require,module,exports){ -"use strict"; -module.exports = BufferReader; - -// extends Reader -var Reader = require(9); -(BufferReader.prototype = Object.create(Reader.prototype)).constructor = BufferReader; - -var util = require(15); - -/** - * Constructs a new buffer reader instance. - * @classdesc Wire format reader using node buffers. - * @extends Reader - * @constructor - * @param {Buffer} buffer Buffer to read from - */ -function BufferReader(buffer) { - Reader.call(this, buffer); - - /** - * Read buffer. - * @name BufferReader#buf - * @type {Buffer} - */ -} - -BufferReader._configure = function () { - /* istanbul ignore else */ - if (util.Buffer) - BufferReader.prototype._slice = util.Buffer.prototype.slice; -}; - - -/** - * @override - */ -BufferReader.prototype.string = function read_string_buffer() { - var len = this.uint32(); // modifies pos - return this.buf.utf8Slice - ? this.buf.utf8Slice(this.pos, this.pos = Math.min(this.pos + len, this.len)) - : this.buf.toString("utf-8", this.pos, this.pos = Math.min(this.pos + len, this.len)); -}; - -/** - * Reads a sequence of bytes preceeded by its length as a varint. - * @name BufferReader#bytes - * @function - * @returns {Buffer} Value read - */ - -BufferReader._configure(); - -},{"15":15,"9":9}],11:[function(require,module,exports){ -"use strict"; -module.exports = {}; - -/** - * Named roots. - * This is where pbjs stores generated structures (the option `-r, --root` specifies a name). - * Can also be used manually to make roots available across modules. - * @name roots - * @type {Object.} - * @example - * // pbjs -r myroot -o compiled.js ... - * - * // in another module: - * require("./compiled.js"); - * - * // in any subsequent module: - * var root = protobuf.roots["myroot"]; - */ - -},{}],12:[function(require,module,exports){ -"use strict"; - -/** - * Streaming RPC helpers. - * @namespace - */ -var rpc = exports; - -/** - * RPC implementation passed to {@link Service#create} performing a service request on network level, i.e. by utilizing http requests or websockets. - * @typedef RPCImpl - * @type {function} - * @param {Method|rpc.ServiceMethod,Message<{}>>} method Reflected or static method being called - * @param {Uint8Array} requestData Request data - * @param {RPCImplCallback} callback Callback function - * @returns {undefined} - * @example - * function rpcImpl(method, requestData, callback) { - * if (protobuf.util.lcFirst(method.name) !== "myMethod") // compatible with static code - * throw Error("no such method"); - * asynchronouslyObtainAResponse(requestData, function(err, responseData) { - * callback(err, responseData); - * }); - * } - */ - -/** - * Node-style callback as used by {@link RPCImpl}. - * @typedef RPCImplCallback - * @type {function} - * @param {Error|null} error Error, if any, otherwise `null` - * @param {Uint8Array|null} [response] Response data or `null` to signal end of stream, if there hasn't been an error - * @returns {undefined} - */ - -rpc.Service = require(13); - -},{"13":13}],13:[function(require,module,exports){ -"use strict"; -module.exports = Service; - -var util = require(15); - -// Extends EventEmitter -(Service.prototype = Object.create(util.EventEmitter.prototype)).constructor = Service; - -/** - * A service method callback as used by {@link rpc.ServiceMethod|ServiceMethod}. - * - * Differs from {@link RPCImplCallback} in that it is an actual callback of a service method which may not return `response = null`. - * @typedef rpc.ServiceMethodCallback - * @template TRes extends Message - * @type {function} - * @param {Error|null} error Error, if any - * @param {TRes} [response] Response message - * @returns {undefined} - */ - -/** - * A service method part of a {@link rpc.Service} as created by {@link Service.create}. - * @typedef rpc.ServiceMethod - * @template TReq extends Message - * @template TRes extends Message - * @type {function} - * @param {TReq|Properties} request Request message or plain object - * @param {rpc.ServiceMethodCallback} [callback] Node-style callback called with the error, if any, and the response message - * @returns {Promise>} Promise if `callback` has been omitted, otherwise `undefined` - */ - -/** - * Constructs a new RPC service instance. - * @classdesc An RPC service as returned by {@link Service#create}. - * @exports rpc.Service - * @extends util.EventEmitter - * @constructor - * @param {RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - */ -function Service(rpcImpl, requestDelimited, responseDelimited) { - - if (typeof rpcImpl !== "function") - throw TypeError("rpcImpl must be a function"); - - util.EventEmitter.call(this); - - /** - * RPC implementation. Becomes `null` once the service is ended. - * @type {RPCImpl|null} - */ - this.rpcImpl = rpcImpl; - - /** - * Whether requests are length-delimited. - * @type {boolean} - */ - this.requestDelimited = Boolean(requestDelimited); - - /** - * Whether responses are length-delimited. - * @type {boolean} - */ - this.responseDelimited = Boolean(responseDelimited); -} - -/** - * Calls a service method through {@link rpc.Service#rpcImpl|rpcImpl}. - * @param {Method|rpc.ServiceMethod} method Reflected or static method - * @param {Constructor} requestCtor Request constructor - * @param {Constructor} responseCtor Response constructor - * @param {TReq|Properties} request Request message or plain object - * @param {rpc.ServiceMethodCallback} callback Service callback - * @returns {undefined} - * @template TReq extends Message - * @template TRes extends Message - */ -Service.prototype.rpcCall = function rpcCall(method, requestCtor, responseCtor, request, callback) { - - if (!request) - throw TypeError("request must be specified"); - - var self = this; - if (!callback) - return util.asPromise(rpcCall, self, method, requestCtor, responseCtor, request); - - if (!self.rpcImpl) { - setTimeout(function() { callback(Error("already ended")); }, 0); - return undefined; - } - - try { - return self.rpcImpl( - method, - requestCtor[self.requestDelimited ? "encodeDelimited" : "encode"](request).finish(), - function rpcCallback(err, response) { - - if (err) { - self.emit("error", err, method); - return callback(err); - } - - if (response === null) { - self.end(/* endedByRPC */ true); - return undefined; - } - - if (!(response instanceof responseCtor)) { - try { - response = responseCtor[self.responseDelimited ? "decodeDelimited" : "decode"](response); - } catch (err) { - self.emit("error", err, method); - return callback(err); - } - } - - self.emit("data", response, method); - return callback(null, response); - } - ); - } catch (err) { - self.emit("error", err, method); - setTimeout(function() { callback(err); }, 0); - return undefined; - } -}; - -/** - * Ends this service and emits the `end` event. - * @param {boolean} [endedByRPC=false] Whether the service has been ended by the RPC implementation. - * @returns {rpc.Service} `this` - */ -Service.prototype.end = function end(endedByRPC) { - if (this.rpcImpl) { - if (!endedByRPC) // signal end to rpcImpl - this.rpcImpl(null, null, null); - this.rpcImpl = null; - this.emit("end").off(); - } - return this; -}; - -},{"15":15}],14:[function(require,module,exports){ -"use strict"; -module.exports = LongBits; - -var util = require(15); - -/** - * Constructs new long bits. - * @classdesc Helper class for working with the low and high bits of a 64 bit value. - * @memberof util - * @constructor - * @param {number} lo Low 32 bits, unsigned - * @param {number} hi High 32 bits, unsigned - */ -function LongBits(lo, hi) { - - // note that the casts below are theoretically unnecessary as of today, but older statically - // generated converter code might still call the ctor with signed 32bits. kept for compat. - - /** - * Low bits. - * @type {number} - */ - this.lo = lo >>> 0; - - /** - * High bits. - * @type {number} - */ - this.hi = hi >>> 0; -} - -/** - * Zero bits. - * @memberof util.LongBits - * @type {util.LongBits} - */ -var zero = LongBits.zero = new LongBits(0, 0); - -zero.toNumber = function() { return 0; }; -zero.zzEncode = zero.zzDecode = function() { return this; }; -zero.length = function() { return 1; }; - -/** - * Zero hash. - * @memberof util.LongBits - * @type {string} - */ -var zeroHash = LongBits.zeroHash = "\0\0\0\0\0\0\0\0"; - -/** - * Constructs new long bits from the specified number. - * @param {number} value Value - * @returns {util.LongBits} Instance - */ -LongBits.fromNumber = function fromNumber(value) { - if (value === 0) - return zero; - var sign = value < 0; - if (sign) - value = -value; - var lo = value >>> 0, - hi = (value - lo) / 4294967296 >>> 0; - if (sign) { - hi = ~hi >>> 0; - lo = ~lo >>> 0; - if (++lo > 4294967295) { - lo = 0; - if (++hi > 4294967295) - hi = 0; - } - } - return new LongBits(lo, hi); -}; - -/** - * Constructs new long bits from a number, long or string. - * @param {Long|number|string} value Value - * @returns {util.LongBits} Instance - */ -LongBits.from = function from(value) { - if (typeof value === "number") - return LongBits.fromNumber(value); - if (util.isString(value)) { - /* istanbul ignore else */ - if (util.Long) - value = util.Long.fromString(value); - else - return LongBits.fromNumber(parseInt(value, 10)); - } - return value.low || value.high ? new LongBits(value.low >>> 0, value.high >>> 0) : zero; -}; - -/** - * Converts this long bits to a possibly unsafe JavaScript number. - * @param {boolean} [unsigned=false] Whether unsigned or not - * @returns {number} Possibly unsafe number - */ -LongBits.prototype.toNumber = function toNumber(unsigned) { - if (!unsigned && this.hi >>> 31) { - var lo = ~this.lo + 1 >>> 0, - hi = ~this.hi >>> 0; - if (!lo) - hi = hi + 1 >>> 0; - return -(lo + hi * 4294967296); - } - return this.lo + this.hi * 4294967296; -}; - -/** - * Converts this long bits to a long. - * @param {boolean} [unsigned=false] Whether unsigned or not - * @returns {Long} Long - */ -LongBits.prototype.toLong = function toLong(unsigned) { - return util.Long - ? new util.Long(this.lo | 0, this.hi | 0, Boolean(unsigned)) - /* istanbul ignore next */ - : { low: this.lo | 0, high: this.hi | 0, unsigned: Boolean(unsigned) }; -}; - -var charCodeAt = String.prototype.charCodeAt; - -/** - * Constructs new long bits from the specified 8 characters long hash. - * @param {string} hash Hash - * @returns {util.LongBits} Bits - */ -LongBits.fromHash = function fromHash(hash) { - if (hash === zeroHash) - return zero; - return new LongBits( - ( charCodeAt.call(hash, 0) - | charCodeAt.call(hash, 1) << 8 - | charCodeAt.call(hash, 2) << 16 - | charCodeAt.call(hash, 3) << 24) >>> 0 - , - ( charCodeAt.call(hash, 4) - | charCodeAt.call(hash, 5) << 8 - | charCodeAt.call(hash, 6) << 16 - | charCodeAt.call(hash, 7) << 24) >>> 0 - ); -}; - -/** - * Converts this long bits to a 8 characters long hash. - * @returns {string} Hash - */ -LongBits.prototype.toHash = function toHash() { - return String.fromCharCode( - this.lo & 255, - this.lo >>> 8 & 255, - this.lo >>> 16 & 255, - this.lo >>> 24 , - this.hi & 255, - this.hi >>> 8 & 255, - this.hi >>> 16 & 255, - this.hi >>> 24 - ); -}; - -/** - * Zig-zag encodes this long bits. - * @returns {util.LongBits} `this` - */ -LongBits.prototype.zzEncode = function zzEncode() { - var mask = this.hi >> 31; - this.hi = ((this.hi << 1 | this.lo >>> 31) ^ mask) >>> 0; - this.lo = ( this.lo << 1 ^ mask) >>> 0; - return this; -}; - -/** - * Zig-zag decodes this long bits. - * @returns {util.LongBits} `this` - */ -LongBits.prototype.zzDecode = function zzDecode() { - var mask = -(this.lo & 1); - this.lo = ((this.lo >>> 1 | this.hi << 31) ^ mask) >>> 0; - this.hi = ( this.hi >>> 1 ^ mask) >>> 0; - return this; -}; - -/** - * Calculates the length of this longbits when encoded as a varint. - * @returns {number} Length - */ -LongBits.prototype.length = function length() { - var part0 = this.lo, - part1 = (this.lo >>> 28 | this.hi << 4) >>> 0, - part2 = this.hi >>> 24; - return part2 === 0 - ? part1 === 0 - ? part0 < 16384 - ? part0 < 128 ? 1 : 2 - : part0 < 2097152 ? 3 : 4 - : part1 < 16384 - ? part1 < 128 ? 5 : 6 - : part1 < 2097152 ? 7 : 8 - : part2 < 128 ? 9 : 10; -}; - -},{"15":15}],15:[function(require,module,exports){ -"use strict"; -var util = exports; - -// used to return a Promise where callback is omitted -util.asPromise = require(1); - -// converts to / from base64 encoded strings -util.base64 = require(2); - -// base class of rpc.Service -util.EventEmitter = require(3); - -// float handling accross browsers -util.float = require(4); - -// requires modules optionally and hides the call from bundlers -util.inquire = require(5); - -// converts to / from utf8 encoded strings -util.utf8 = require(7); - -// provides a node-like buffer pool in the browser -util.pool = require(6); - -// utility to work with the low and high bits of a 64 bit value -util.LongBits = require(14); - -/** - * Whether running within node or not. - * @memberof util - * @type {boolean} - */ -util.isNode = Boolean(typeof global !== "undefined" - && global - && global.process - && global.process.versions - && global.process.versions.node); - -/** - * Global object reference. - * @memberof util - * @type {Object} - */ -util.global = util.isNode && global - || typeof window !== "undefined" && window - || typeof self !== "undefined" && self - || this; // eslint-disable-line no-invalid-this - -/** - * An immuable empty array. - * @memberof util - * @type {Array.<*>} - * @const - */ -util.emptyArray = Object.freeze ? Object.freeze([]) : /* istanbul ignore next */ []; // used on prototypes - -/** - * An immutable empty object. - * @type {Object} - * @const - */ -util.emptyObject = Object.freeze ? Object.freeze({}) : /* istanbul ignore next */ {}; // used on prototypes - -/** - * Tests if the specified value is an integer. - * @function - * @param {*} value Value to test - * @returns {boolean} `true` if the value is an integer - */ -util.isInteger = Number.isInteger || /* istanbul ignore next */ function isInteger(value) { - return typeof value === "number" && isFinite(value) && Math.floor(value) === value; -}; - -/** - * Tests if the specified value is a string. - * @param {*} value Value to test - * @returns {boolean} `true` if the value is a string - */ -util.isString = function isString(value) { - return typeof value === "string" || value instanceof String; -}; - -/** - * Tests if the specified value is a non-null object. - * @param {*} value Value to test - * @returns {boolean} `true` if the value is a non-null object - */ -util.isObject = function isObject(value) { - return value && typeof value === "object"; -}; - -/** - * Checks if a property on a message is considered to be present. - * This is an alias of {@link util.isSet}. - * @function - * @param {Object} obj Plain object or message instance - * @param {string} prop Property name - * @returns {boolean} `true` if considered to be present, otherwise `false` - */ -util.isset = - -/** - * Checks if a property on a message is considered to be present. - * @param {Object} obj Plain object or message instance - * @param {string} prop Property name - * @returns {boolean} `true` if considered to be present, otherwise `false` - */ -util.isSet = function isSet(obj, prop) { - var value = obj[prop]; - if (value != null && obj.hasOwnProperty(prop)) // eslint-disable-line eqeqeq, no-prototype-builtins - return typeof value !== "object" || (Array.isArray(value) ? value.length : Object.keys(value).length) > 0; - return false; -}; - -/** - * Any compatible Buffer instance. - * This is a minimal stand-alone definition of a Buffer instance. The actual type is that exported by node's typings. - * @interface Buffer - * @extends Uint8Array - */ - -/** - * Node's Buffer class if available. - * @type {Constructor} - */ -util.Buffer = (function() { - try { - var Buffer = util.inquire("buffer").Buffer; - // refuse to use non-node buffers if not explicitly assigned (perf reasons): - return Buffer.prototype.utf8Write ? Buffer : /* istanbul ignore next */ null; - } catch (e) { - /* istanbul ignore next */ - return null; - } -})(); - -// Internal alias of or polyfull for Buffer.from. -util._Buffer_from = null; - -// Internal alias of or polyfill for Buffer.allocUnsafe. -util._Buffer_allocUnsafe = null; - -/** - * Creates a new buffer of whatever type supported by the environment. - * @param {number|number[]} [sizeOrArray=0] Buffer size or number array - * @returns {Uint8Array|Buffer} Buffer - */ -util.newBuffer = function newBuffer(sizeOrArray) { - /* istanbul ignore next */ - return typeof sizeOrArray === "number" - ? util.Buffer - ? util._Buffer_allocUnsafe(sizeOrArray) - : new util.Array(sizeOrArray) - : util.Buffer - ? util._Buffer_from(sizeOrArray) - : typeof Uint8Array === "undefined" - ? sizeOrArray - : new Uint8Array(sizeOrArray); -}; - -/** - * Array implementation used in the browser. `Uint8Array` if supported, otherwise `Array`. - * @type {Constructor} - */ -util.Array = typeof Uint8Array !== "undefined" ? Uint8Array /* istanbul ignore next */ : Array; - -/** - * Any compatible Long instance. - * This is a minimal stand-alone definition of a Long instance. The actual type is that exported by long.js. - * @interface Long - * @property {number} low Low bits - * @property {number} high High bits - * @property {boolean} unsigned Whether unsigned or not - */ - -/** - * Long.js's Long class if available. - * @type {Constructor} - */ -util.Long = /* istanbul ignore next */ util.global.dcodeIO && /* istanbul ignore next */ util.global.dcodeIO.Long - || /* istanbul ignore next */ util.global.Long - || util.inquire("long"); - -/** - * Regular expression used to verify 2 bit (`bool`) map keys. - * @type {RegExp} - * @const - */ -util.key2Re = /^true|false|0|1$/; - -/** - * Regular expression used to verify 32 bit (`int32` etc.) map keys. - * @type {RegExp} - * @const - */ -util.key32Re = /^-?(?:0|[1-9][0-9]*)$/; - -/** - * Regular expression used to verify 64 bit (`int64` etc.) map keys. - * @type {RegExp} - * @const - */ -util.key64Re = /^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/; - -/** - * Converts a number or long to an 8 characters long hash string. - * @param {Long|number} value Value to convert - * @returns {string} Hash - */ -util.longToHash = function longToHash(value) { - return value - ? util.LongBits.from(value).toHash() - : util.LongBits.zeroHash; -}; - -/** - * Converts an 8 characters long hash string to a long or number. - * @param {string} hash Hash - * @param {boolean} [unsigned=false] Whether unsigned or not - * @returns {Long|number} Original value - */ -util.longFromHash = function longFromHash(hash, unsigned) { - var bits = util.LongBits.fromHash(hash); - if (util.Long) - return util.Long.fromBits(bits.lo, bits.hi, unsigned); - return bits.toNumber(Boolean(unsigned)); -}; - -/** - * Merges the properties of the source object into the destination object. - * @memberof util - * @param {Object.} dst Destination object - * @param {Object.} src Source object - * @param {boolean} [ifNotSet=false] Merges only if the key is not already set - * @returns {Object.} Destination object - */ -function merge(dst, src, ifNotSet) { // used by converters - for (var keys = Object.keys(src), i = 0; i < keys.length; ++i) - if (dst[keys[i]] === undefined || !ifNotSet) - dst[keys[i]] = src[keys[i]]; - return dst; -} - -util.merge = merge; - -/** - * Converts the first character of a string to lower case. - * @param {string} str String to convert - * @returns {string} Converted string - */ -util.lcFirst = function lcFirst(str) { - return str.charAt(0).toLowerCase() + str.substring(1); -}; - -/** - * Creates a custom error constructor. - * @memberof util - * @param {string} name Error name - * @returns {Constructor} Custom error constructor - */ -function newError(name) { - - function CustomError(message, properties) { - - if (!(this instanceof CustomError)) - return new CustomError(message, properties); - - // Error.call(this, message); - // ^ just returns a new error instance because the ctor can be called as a function - - Object.defineProperty(this, "message", { get: function() { return message; } }); - - /* istanbul ignore next */ - if (Error.captureStackTrace) // node - Error.captureStackTrace(this, CustomError); - else - Object.defineProperty(this, "stack", { value: new Error().stack || "" }); - - if (properties) - merge(this, properties); - } - - CustomError.prototype = Object.create(Error.prototype, { - constructor: { - value: CustomError, - writable: true, - enumerable: false, - configurable: true, - }, - name: { - get() { return name; }, - set: undefined, - enumerable: false, - // configurable: false would accurately preserve the behavior of - // the original, but I'm guessing that was not intentional. - // For an actual error subclass, this property would - // be configurable. - configurable: true, - }, - toString: { - value() { return this.name + ": " + this.message; }, - writable: true, - enumerable: false, - configurable: true, - }, - }); - - return CustomError; -} - -util.newError = newError; - -/** - * Constructs a new protocol error. - * @classdesc Error subclass indicating a protocol specifc error. - * @memberof util - * @extends Error - * @template T extends Message - * @constructor - * @param {string} message Error message - * @param {Object.} [properties] Additional properties - * @example - * try { - * MyMessage.decode(someBuffer); // throws if required fields are missing - * } catch (e) { - * if (e instanceof ProtocolError && e.instance) - * console.log("decoded so far: " + JSON.stringify(e.instance)); - * } - */ -util.ProtocolError = newError("ProtocolError"); - -/** - * So far decoded message instance. - * @name util.ProtocolError#instance - * @type {Message} - */ - -/** - * A OneOf getter as returned by {@link util.oneOfGetter}. - * @typedef OneOfGetter - * @type {function} - * @returns {string|undefined} Set field name, if any - */ - -/** - * Builds a getter for a oneof's present field name. - * @param {string[]} fieldNames Field names - * @returns {OneOfGetter} Unbound getter - */ -util.oneOfGetter = function getOneOf(fieldNames) { - var fieldMap = {}; - for (var i = 0; i < fieldNames.length; ++i) - fieldMap[fieldNames[i]] = 1; - - /** - * @returns {string|undefined} Set field name, if any - * @this Object - * @ignore - */ - return function() { // eslint-disable-line consistent-return - for (var keys = Object.keys(this), i = keys.length - 1; i > -1; --i) - if (fieldMap[keys[i]] === 1 && this[keys[i]] !== undefined && this[keys[i]] !== null) - return keys[i]; - }; -}; - -/** - * A OneOf setter as returned by {@link util.oneOfSetter}. - * @typedef OneOfSetter - * @type {function} - * @param {string|undefined} value Field name - * @returns {undefined} - */ - -/** - * Builds a setter for a oneof's present field name. - * @param {string[]} fieldNames Field names - * @returns {OneOfSetter} Unbound setter - */ -util.oneOfSetter = function setOneOf(fieldNames) { - - /** - * @param {string} name Field name - * @returns {undefined} - * @this Object - * @ignore - */ - return function(name) { - for (var i = 0; i < fieldNames.length; ++i) - if (fieldNames[i] !== name) - delete this[fieldNames[i]]; - }; -}; - -/** - * Default conversion options used for {@link Message#toJSON} implementations. - * - * These options are close to proto3's JSON mapping with the exception that internal types like Any are handled just like messages. More precisely: - * - * - Longs become strings - * - Enums become string keys - * - Bytes become base64 encoded strings - * - (Sub-)Messages become plain objects - * - Maps become plain objects with all string keys - * - Repeated fields become arrays - * - NaN and Infinity for float and double fields become strings - * - * @type {IConversionOptions} - * @see https://developers.google.com/protocol-buffers/docs/proto3?hl=en#json - */ -util.toJSONOptions = { - longs: String, - enums: String, - bytes: String, - json: true -}; - -// Sets up buffer utility according to the environment (called in index-minimal) -util._configure = function() { - var Buffer = util.Buffer; - /* istanbul ignore if */ - if (!Buffer) { - util._Buffer_from = util._Buffer_allocUnsafe = null; - return; - } - // because node 4.x buffers are incompatible & immutable - // see: https://github.com/dcodeIO/protobuf.js/pull/665 - util._Buffer_from = Buffer.from !== Uint8Array.from && Buffer.from || - /* istanbul ignore next */ - function Buffer_from(value, encoding) { - return new Buffer(value, encoding); - }; - util._Buffer_allocUnsafe = Buffer.allocUnsafe || - /* istanbul ignore next */ - function Buffer_allocUnsafe(size) { - return new Buffer(size); - }; -}; - -},{"1":1,"14":14,"2":2,"3":3,"4":4,"5":5,"6":6,"7":7}],16:[function(require,module,exports){ -"use strict"; -module.exports = Writer; - -var util = require(15); - -var BufferWriter; // cyclic - -var LongBits = util.LongBits, - base64 = util.base64, - utf8 = util.utf8; - -/** - * Constructs a new writer operation instance. - * @classdesc Scheduled writer operation. - * @constructor - * @param {function(*, Uint8Array, number)} fn Function to call - * @param {number} len Value byte length - * @param {*} val Value to write - * @ignore - */ -function Op(fn, len, val) { - - /** - * Function to call. - * @type {function(Uint8Array, number, *)} - */ - this.fn = fn; - - /** - * Value byte length. - * @type {number} - */ - this.len = len; - - /** - * Next operation. - * @type {Writer.Op|undefined} - */ - this.next = undefined; - - /** - * Value to write. - * @type {*} - */ - this.val = val; // type varies -} - -/* istanbul ignore next */ -function noop() {} // eslint-disable-line no-empty-function - -/** - * Constructs a new writer state instance. - * @classdesc Copied writer state. - * @memberof Writer - * @constructor - * @param {Writer} writer Writer to copy state from - * @ignore - */ -function State(writer) { - - /** - * Current head. - * @type {Writer.Op} - */ - this.head = writer.head; - - /** - * Current tail. - * @type {Writer.Op} - */ - this.tail = writer.tail; - - /** - * Current buffer length. - * @type {number} - */ - this.len = writer.len; - - /** - * Next state. - * @type {State|null} - */ - this.next = writer.states; -} - -/** - * Constructs a new writer instance. - * @classdesc Wire format writer using `Uint8Array` if available, otherwise `Array`. - * @constructor - */ -function Writer() { - - /** - * Current length. - * @type {number} - */ - this.len = 0; - - /** - * Operations head. - * @type {Object} - */ - this.head = new Op(noop, 0, 0); - - /** - * Operations tail - * @type {Object} - */ - this.tail = this.head; - - /** - * Linked forked states. - * @type {Object|null} - */ - this.states = null; - - // When a value is written, the writer calculates its byte length and puts it into a linked - // list of operations to perform when finish() is called. This both allows us to allocate - // buffers of the exact required size and reduces the amount of work we have to do compared - // to first calculating over objects and then encoding over objects. In our case, the encoding - // part is just a linked list walk calling operations with already prepared values. -} - -var create = function create() { - return util.Buffer - ? function create_buffer_setup() { - return (Writer.create = function create_buffer() { - return new BufferWriter(); - })(); - } - /* istanbul ignore next */ - : function create_array() { - return new Writer(); - }; -}; - -/** - * Creates a new writer. - * @function - * @returns {BufferWriter|Writer} A {@link BufferWriter} when Buffers are supported, otherwise a {@link Writer} - */ -Writer.create = create(); - -/** - * Allocates a buffer of the specified size. - * @param {number} size Buffer size - * @returns {Uint8Array} Buffer - */ -Writer.alloc = function alloc(size) { - return new util.Array(size); -}; - -// Use Uint8Array buffer pool in the browser, just like node does with buffers -/* istanbul ignore else */ -if (util.Array !== Array) - Writer.alloc = util.pool(Writer.alloc, util.Array.prototype.subarray); - -/** - * Pushes a new operation to the queue. - * @param {function(Uint8Array, number, *)} fn Function to call - * @param {number} len Value byte length - * @param {number} val Value to write - * @returns {Writer} `this` - * @private - */ -Writer.prototype._push = function push(fn, len, val) { - this.tail = this.tail.next = new Op(fn, len, val); - this.len += len; - return this; -}; - -function writeByte(val, buf, pos) { - buf[pos] = val & 255; -} - -function writeVarint32(val, buf, pos) { - while (val > 127) { - buf[pos++] = val & 127 | 128; - val >>>= 7; - } - buf[pos] = val; -} - -/** - * Constructs a new varint writer operation instance. - * @classdesc Scheduled varint writer operation. - * @extends Op - * @constructor - * @param {number} len Value byte length - * @param {number} val Value to write - * @ignore - */ -function VarintOp(len, val) { - this.len = len; - this.next = undefined; - this.val = val; -} - -VarintOp.prototype = Object.create(Op.prototype); -VarintOp.prototype.fn = writeVarint32; - -/** - * Writes an unsigned 32 bit value as a varint. - * @param {number} value Value to write - * @returns {Writer} `this` - */ -Writer.prototype.uint32 = function write_uint32(value) { - // here, the call to this.push has been inlined and a varint specific Op subclass is used. - // uint32 is by far the most frequently used operation and benefits significantly from this. - this.len += (this.tail = this.tail.next = new VarintOp( - (value = value >>> 0) - < 128 ? 1 - : value < 16384 ? 2 - : value < 2097152 ? 3 - : value < 268435456 ? 4 - : 5, - value)).len; - return this; -}; - -/** - * Writes a signed 32 bit value as a varint. - * @function - * @param {number} value Value to write - * @returns {Writer} `this` - */ -Writer.prototype.int32 = function write_int32(value) { - return value < 0 - ? this._push(writeVarint64, 10, LongBits.fromNumber(value)) // 10 bytes per spec - : this.uint32(value); -}; - -/** - * Writes a 32 bit value as a varint, zig-zag encoded. - * @param {number} value Value to write - * @returns {Writer} `this` - */ -Writer.prototype.sint32 = function write_sint32(value) { - return this.uint32((value << 1 ^ value >> 31) >>> 0); -}; - -function writeVarint64(val, buf, pos) { - while (val.hi) { - buf[pos++] = val.lo & 127 | 128; - val.lo = (val.lo >>> 7 | val.hi << 25) >>> 0; - val.hi >>>= 7; - } - while (val.lo > 127) { - buf[pos++] = val.lo & 127 | 128; - val.lo = val.lo >>> 7; - } - buf[pos++] = val.lo; -} - -/** - * Writes an unsigned 64 bit value as a varint. - * @param {Long|number|string} value Value to write - * @returns {Writer} `this` - * @throws {TypeError} If `value` is a string and no long library is present. - */ -Writer.prototype.uint64 = function write_uint64(value) { - var bits = LongBits.from(value); - return this._push(writeVarint64, bits.length(), bits); -}; - -/** - * Writes a signed 64 bit value as a varint. - * @function - * @param {Long|number|string} value Value to write - * @returns {Writer} `this` - * @throws {TypeError} If `value` is a string and no long library is present. - */ -Writer.prototype.int64 = Writer.prototype.uint64; - -/** - * Writes a signed 64 bit value as a varint, zig-zag encoded. - * @param {Long|number|string} value Value to write - * @returns {Writer} `this` - * @throws {TypeError} If `value` is a string and no long library is present. - */ -Writer.prototype.sint64 = function write_sint64(value) { - var bits = LongBits.from(value).zzEncode(); - return this._push(writeVarint64, bits.length(), bits); -}; - -/** - * Writes a boolish value as a varint. - * @param {boolean} value Value to write - * @returns {Writer} `this` - */ -Writer.prototype.bool = function write_bool(value) { - return this._push(writeByte, 1, value ? 1 : 0); -}; - -function writeFixed32(val, buf, pos) { - buf[pos ] = val & 255; - buf[pos + 1] = val >>> 8 & 255; - buf[pos + 2] = val >>> 16 & 255; - buf[pos + 3] = val >>> 24; -} - -/** - * Writes an unsigned 32 bit value as fixed 32 bits. - * @param {number} value Value to write - * @returns {Writer} `this` - */ -Writer.prototype.fixed32 = function write_fixed32(value) { - return this._push(writeFixed32, 4, value >>> 0); -}; - -/** - * Writes a signed 32 bit value as fixed 32 bits. - * @function - * @param {number} value Value to write - * @returns {Writer} `this` - */ -Writer.prototype.sfixed32 = Writer.prototype.fixed32; - -/** - * Writes an unsigned 64 bit value as fixed 64 bits. - * @param {Long|number|string} value Value to write - * @returns {Writer} `this` - * @throws {TypeError} If `value` is a string and no long library is present. - */ -Writer.prototype.fixed64 = function write_fixed64(value) { - var bits = LongBits.from(value); - return this._push(writeFixed32, 4, bits.lo)._push(writeFixed32, 4, bits.hi); -}; - -/** - * Writes a signed 64 bit value as fixed 64 bits. - * @function - * @param {Long|number|string} value Value to write - * @returns {Writer} `this` - * @throws {TypeError} If `value` is a string and no long library is present. - */ -Writer.prototype.sfixed64 = Writer.prototype.fixed64; - -/** - * Writes a float (32 bit). - * @function - * @param {number} value Value to write - * @returns {Writer} `this` - */ -Writer.prototype.float = function write_float(value) { - return this._push(util.float.writeFloatLE, 4, value); -}; - -/** - * Writes a double (64 bit float). - * @function - * @param {number} value Value to write - * @returns {Writer} `this` - */ -Writer.prototype.double = function write_double(value) { - return this._push(util.float.writeDoubleLE, 8, value); -}; - -var writeBytes = util.Array.prototype.set - ? function writeBytes_set(val, buf, pos) { - buf.set(val, pos); // also works for plain array values - } - /* istanbul ignore next */ - : function writeBytes_for(val, buf, pos) { - for (var i = 0; i < val.length; ++i) - buf[pos + i] = val[i]; - }; - -/** - * Writes a sequence of bytes. - * @param {Uint8Array|string} value Buffer or base64 encoded string to write - * @returns {Writer} `this` - */ -Writer.prototype.bytes = function write_bytes(value) { - var len = value.length >>> 0; - if (!len) - return this._push(writeByte, 1, 0); - if (util.isString(value)) { - var buf = Writer.alloc(len = base64.length(value)); - base64.decode(value, buf, 0); - value = buf; - } - return this.uint32(len)._push(writeBytes, len, value); -}; - -/** - * Writes a string. - * @param {string} value Value to write - * @returns {Writer} `this` - */ -Writer.prototype.string = function write_string(value) { - var len = utf8.length(value); - return len - ? this.uint32(len)._push(utf8.write, len, value) - : this._push(writeByte, 1, 0); -}; - -/** - * Forks this writer's state by pushing it to a stack. - * Calling {@link Writer#reset|reset} or {@link Writer#ldelim|ldelim} resets the writer to the previous state. - * @returns {Writer} `this` - */ -Writer.prototype.fork = function fork() { - this.states = new State(this); - this.head = this.tail = new Op(noop, 0, 0); - this.len = 0; - return this; -}; - -/** - * Resets this instance to the last state. - * @returns {Writer} `this` - */ -Writer.prototype.reset = function reset() { - if (this.states) { - this.head = this.states.head; - this.tail = this.states.tail; - this.len = this.states.len; - this.states = this.states.next; - } else { - this.head = this.tail = new Op(noop, 0, 0); - this.len = 0; - } - return this; -}; - -/** - * Resets to the last state and appends the fork state's current write length as a varint followed by its operations. - * @returns {Writer} `this` - */ -Writer.prototype.ldelim = function ldelim() { - var head = this.head, - tail = this.tail, - len = this.len; - this.reset().uint32(len); - if (len) { - this.tail.next = head.next; // skip noop - this.tail = tail; - this.len += len; - } - return this; -}; - -/** - * Finishes the write operation. - * @returns {Uint8Array} Finished buffer - */ -Writer.prototype.finish = function finish() { - var head = this.head.next, // skip noop - buf = this.constructor.alloc(this.len), - pos = 0; - while (head) { - head.fn(head.val, buf, pos); - pos += head.len; - head = head.next; - } - // this.head = this.tail = null; - return buf; -}; - -Writer._configure = function(BufferWriter_) { - BufferWriter = BufferWriter_; - Writer.create = create(); - BufferWriter._configure(); -}; - -},{"15":15}],17:[function(require,module,exports){ -"use strict"; -module.exports = BufferWriter; - -// extends Writer -var Writer = require(16); -(BufferWriter.prototype = Object.create(Writer.prototype)).constructor = BufferWriter; - -var util = require(15); - -/** - * Constructs a new buffer writer instance. - * @classdesc Wire format writer using node buffers. - * @extends Writer - * @constructor - */ -function BufferWriter() { - Writer.call(this); -} - -BufferWriter._configure = function () { - /** - * Allocates a buffer of the specified size. - * @function - * @param {number} size Buffer size - * @returns {Buffer} Buffer - */ - BufferWriter.alloc = util._Buffer_allocUnsafe; - - BufferWriter.writeBytesBuffer = util.Buffer && util.Buffer.prototype instanceof Uint8Array && util.Buffer.prototype.set.name === "set" - ? function writeBytesBuffer_set(val, buf, pos) { - buf.set(val, pos); // faster than copy (requires node >= 4 where Buffers extend Uint8Array and set is properly inherited) - // also works for plain array values - } - /* istanbul ignore next */ - : function writeBytesBuffer_copy(val, buf, pos) { - if (val.copy) // Buffer values - val.copy(buf, pos, 0, val.length); - else for (var i = 0; i < val.length;) // plain array values - buf[pos++] = val[i++]; - }; -}; - - -/** - * @override - */ -BufferWriter.prototype.bytes = function write_bytes_buffer(value) { - if (util.isString(value)) - value = util._Buffer_from(value, "base64"); - var len = value.length >>> 0; - this.uint32(len); - if (len) - this._push(BufferWriter.writeBytesBuffer, len, value); - return this; -}; - -function writeStringBuffer(val, buf, pos) { - if (val.length < 40) // plain js is faster for short strings (probably due to redundant assertions) - util.utf8.write(val, buf, pos); - else if (buf.utf8Write) - buf.utf8Write(val, pos); - else - buf.write(val, pos); -} - -/** - * @override - */ -BufferWriter.prototype.string = function write_string_buffer(value) { - var len = util.Buffer.byteLength(value); - this.uint32(len); - if (len) - this._push(writeStringBuffer, len, value); - return this; -}; - - -/** - * Finishes the write operation. - * @name BufferWriter#finish - * @function - * @returns {Buffer} Finished buffer - */ - -BufferWriter._configure(); - -},{"15":15,"16":16}]},{},[8]) - -})(); -//# sourceMappingURL=protobuf.js.map diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/dist/minimal/protobuf.min.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/dist/minimal/protobuf.min.js deleted file mode 100644 index 1d64defe..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/dist/minimal/protobuf.min.js +++ /dev/null @@ -1,8 +0,0 @@ -/*! - * protobuf.js v7.1.0 (c) 2016, daniel wirtz - * compiled thu, 22 sep 2022 17:16:11 utc - * licensed under the bsd-3-clause license - * see: https://github.com/dcodeio/protobuf.js for details - */ -!function(d){"use strict";!function(r,u,t){var n=function t(n){var i=u[n];return i||r[n][0].call(i=u[n]={exports:{}},t,i,i.exports),i.exports}(t[0]);n.util.global.protobuf=n,"function"==typeof define&&define.amd&&define(["long"],function(t){return t&&t.isLong&&(n.util.Long=t,n.configure()),n}),"object"==typeof module&&module&&module.exports&&(module.exports=n)}({1:[function(t,n,i){n.exports=function(t,n){var i=Array(arguments.length-1),e=0,r=2,s=!0;for(;r>2],r=(3&o)<<4,h=1;break;case 1:e[s++]=f[r|o>>4],r=(15&o)<<2,h=2;break;case 2:e[s++]=f[r|o>>6],e[s++]=f[63&o],h=0}8191>4,r=h,e=2;break;case 2:n[i++]=(15&r)<<4|(60&h)>>2,r=h,e=3;break;case 3:n[i++]=(3&r)<<6|h,e=0}}if(1===e)throw Error(c);return i-u},i.test=function(t){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(t)}},{}],3:[function(t,n,i){function r(){this.t={}}(n.exports=r).prototype.on=function(t,n,i){return(this.t[t]||(this.t[t]=[])).push({fn:n,ctx:i||this}),this},r.prototype.off=function(t,n){if(t===d)this.t={};else if(n===d)this.t[t]=[];else for(var i=this.t[t],r=0;r>>0:n<11754943508222875e-54?(u<<31|Math.round(n/1401298464324817e-60))>>>0:(u<<31|127+(t=Math.floor(Math.log(n)/Math.LN2))<<23|8388607&Math.round(n*Math.pow(2,-t)*8388608))>>>0,i,r)}function i(t,n,i){t=t(n,i),n=2*(t>>31)+1,i=t>>>23&255,t&=8388607;return 255==i?t?NaN:1/0*n:0==i?1401298464324817e-60*n*t:n*Math.pow(2,i-150)*(8388608+t)}function r(t,n,i){h[0]=t,n[i]=o[0],n[i+1]=o[1],n[i+2]=o[2],n[i+3]=o[3]}function u(t,n,i){h[0]=t,n[i]=o[3],n[i+1]=o[2],n[i+2]=o[1],n[i+3]=o[0]}function e(t,n){return o[0]=t[n],o[1]=t[n+1],o[2]=t[n+2],o[3]=t[n+3],h[0]}function s(t,n){return o[3]=t[n],o[2]=t[n+1],o[1]=t[n+2],o[0]=t[n+3],h[0]}var h,o,f,c,a;function l(t,n,i,r,u,e){var s,h=r<0?1:0;0===(r=h?-r:r)?(t(0,u,e+n),t(0<1/r?0:2147483648,u,e+i)):isNaN(r)?(t(0,u,e+n),t(2146959360,u,e+i)):17976931348623157e292>>0,u,e+i)):r<22250738585072014e-324?(t((s=r/5e-324)>>>0,u,e+n),t((h<<31|s/4294967296)>>>0,u,e+i)):(t(4503599627370496*(s=r*Math.pow(2,-(r=1024===(r=Math.floor(Math.log(r)/Math.LN2))?1023:r)))>>>0,u,e+n),t((h<<31|r+1023<<20|1048576*s&1048575)>>>0,u,e+i))}function v(t,n,i,r,u){n=t(r,u+n),t=t(r,u+i),r=2*(t>>31)+1,u=t>>>20&2047,i=4294967296*(1048575&t)+n;return 2047==u?i?NaN:1/0*r:0==u?5e-324*r*i:r*Math.pow(2,u-1075)*(i+4503599627370496)}function w(t,n,i){f[0]=t,n[i]=c[0],n[i+1]=c[1],n[i+2]=c[2],n[i+3]=c[3],n[i+4]=c[4],n[i+5]=c[5],n[i+6]=c[6],n[i+7]=c[7]}function b(t,n,i){f[0]=t,n[i]=c[7],n[i+1]=c[6],n[i+2]=c[5],n[i+3]=c[4],n[i+4]=c[3],n[i+5]=c[2],n[i+6]=c[1],n[i+7]=c[0]}function y(t,n){return c[0]=t[n],c[1]=t[n+1],c[2]=t[n+2],c[3]=t[n+3],c[4]=t[n+4],c[5]=t[n+5],c[6]=t[n+6],c[7]=t[n+7],f[0]}function g(t,n){return c[7]=t[n],c[6]=t[n+1],c[5]=t[n+2],c[4]=t[n+3],c[3]=t[n+4],c[2]=t[n+5],c[1]=t[n+6],c[0]=t[n+7],f[0]}return"undefined"!=typeof Float32Array?(h=new Float32Array([-0]),o=new Uint8Array(h.buffer),a=128===o[3],t.writeFloatLE=a?r:u,t.writeFloatBE=a?u:r,t.readFloatLE=a?e:s,t.readFloatBE=a?s:e):(t.writeFloatLE=n.bind(null,d),t.writeFloatBE=n.bind(null,A),t.readFloatLE=i.bind(null,p),t.readFloatBE=i.bind(null,m)),"undefined"!=typeof Float64Array?(f=new Float64Array([-0]),c=new Uint8Array(f.buffer),a=128===c[7],t.writeDoubleLE=a?w:b,t.writeDoubleBE=a?b:w,t.readDoubleLE=a?y:g,t.readDoubleBE=a?g:y):(t.writeDoubleLE=l.bind(null,d,0,4),t.writeDoubleBE=l.bind(null,A,4,0),t.readDoubleLE=v.bind(null,p,0,4),t.readDoubleBE=v.bind(null,m,4,0)),t}function d(t,n,i){n[i]=255&t,n[i+1]=t>>>8&255,n[i+2]=t>>>16&255,n[i+3]=t>>>24}function A(t,n,i){n[i]=t>>>24,n[i+1]=t>>>16&255,n[i+2]=t>>>8&255,n[i+3]=255&t}function p(t,n){return(t[n]|t[n+1]<<8|t[n+2]<<16|t[n+3]<<24)>>>0}function m(t,n){return(t[n]<<24|t[n+1]<<16|t[n+2]<<8|t[n+3])>>>0}n.exports=r(r)},{}],5:[function(t,n,i){function r(t){try{var n=eval("require")(t);if(n&&(n.length||Object.keys(n).length))return n}catch(t){}return null}n.exports=r},{}],6:[function(t,n,i){n.exports=function(n,i,t){var r=t||8192,u=r>>>1,e=null,s=r;return function(t){if(t<1||u>10),e[s++]=56320+(1023&r)):e[s++]=(15&r)<<12|(63&t[n++])<<6|63&t[n++],8191>6|192:(55296==(64512&r)&&56320==(64512&(u=t.charCodeAt(s+1)))?(++s,n[i++]=(r=65536+((1023&r)<<10)+(1023&u))>>18|240,n[i++]=r>>12&63|128):n[i++]=r>>12|224,n[i++]=r>>6&63|128),n[i++]=63&r|128);return i-e}},{}],8:[function(t,n,i){var r=i;function u(){r.util.n(),r.Writer.n(r.BufferWriter),r.Reader.n(r.BufferReader)}r.build="minimal",r.Writer=t(16),r.BufferWriter=t(17),r.Reader=t(9),r.BufferReader=t(10),r.util=t(15),r.rpc=t(12),r.roots=t(11),r.configure=u,u()},{10:10,11:11,12:12,15:15,16:16,17:17,9:9}],9:[function(t,n,i){n.exports=o;var r,u=t(15),e=u.LongBits,s=u.utf8;function h(t,n){return RangeError("index out of range: "+t.pos+" + "+(n||1)+" > "+t.len)}function o(t){this.buf=t,this.pos=0,this.len=t.length}function f(){return u.Buffer?function(t){return(o.create=function(t){return u.Buffer.isBuffer(t)?new r(t):a(t)})(t)}:a}var c,a="undefined"!=typeof Uint8Array?function(t){if(t instanceof Uint8Array||Array.isArray(t))return new o(t);throw Error("illegal buffer")}:function(t){if(Array.isArray(t))return new o(t);throw Error("illegal buffer")};function l(){var t=new e(0,0),n=0;if(!(4=this.len)throw h(this);if(t.lo=(t.lo|(127&this.buf[this.pos])<<7*n)>>>0,this.buf[this.pos++]<128)return t}return t.lo=(t.lo|(127&this.buf[this.pos++])<<7*n)>>>0,t}for(;n<4;++n)if(t.lo=(t.lo|(127&this.buf[this.pos])<<7*n)>>>0,this.buf[this.pos++]<128)return t;if(t.lo=(t.lo|(127&this.buf[this.pos])<<28)>>>0,t.hi=(t.hi|(127&this.buf[this.pos])>>4)>>>0,this.buf[this.pos++]<128)return t;if(n=0,4>>0,this.buf[this.pos++]<128)return t}else for(;n<5;++n){if(this.pos>=this.len)throw h(this);if(t.hi=(t.hi|(127&this.buf[this.pos])<<7*n+3)>>>0,this.buf[this.pos++]<128)return t}throw Error("invalid varint encoding")}function v(t,n){return(t[n-4]|t[n-3]<<8|t[n-2]<<16|t[n-1]<<24)>>>0}function w(){if(this.pos+8>this.len)throw h(this,8);return new e(v(this.buf,this.pos+=4),v(this.buf,this.pos+=4))}o.create=f(),o.prototype.i=u.Array.prototype.subarray||u.Array.prototype.slice,o.prototype.uint32=(c=4294967295,function(){if(c=(127&this.buf[this.pos])>>>0,this.buf[this.pos++]<128||(c=(c|(127&this.buf[this.pos])<<7)>>>0,this.buf[this.pos++]<128||(c=(c|(127&this.buf[this.pos])<<14)>>>0,this.buf[this.pos++]<128||(c=(c|(127&this.buf[this.pos])<<21)>>>0,this.buf[this.pos++]<128||(c=(c|(15&this.buf[this.pos])<<28)>>>0,this.buf[this.pos++]<128||!((this.pos+=5)>this.len))))))return c;throw this.pos=this.len,h(this,10)}),o.prototype.int32=function(){return 0|this.uint32()},o.prototype.sint32=function(){var t=this.uint32();return t>>>1^-(1&t)|0},o.prototype.bool=function(){return 0!==this.uint32()},o.prototype.fixed32=function(){if(this.pos+4>this.len)throw h(this,4);return v(this.buf,this.pos+=4)},o.prototype.sfixed32=function(){if(this.pos+4>this.len)throw h(this,4);return 0|v(this.buf,this.pos+=4)},o.prototype.float=function(){if(this.pos+4>this.len)throw h(this,4);var t=u.float.readFloatLE(this.buf,this.pos);return this.pos+=4,t},o.prototype.double=function(){if(this.pos+8>this.len)throw h(this,4);var t=u.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,t},o.prototype.bytes=function(){var t=this.uint32(),n=this.pos,i=this.pos+t;if(i>this.len)throw h(this,t);return this.pos+=t,Array.isArray(this.buf)?this.buf.slice(n,i):n===i?new this.buf.constructor(0):this.i.call(this.buf,n,i)},o.prototype.string=function(){var t=this.bytes();return s.read(t,0,t.length)},o.prototype.skip=function(t){if("number"==typeof t){if(this.pos+t>this.len)throw h(this,t);this.pos+=t}else do{if(this.pos>=this.len)throw h(this)}while(128&this.buf[this.pos++]);return this},o.prototype.skipType=function(t){switch(t){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;4!=(t=7&this.uint32());)this.skipType(t);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+t+" at offset "+this.pos)}return this},o.n=function(t){r=t,o.create=f(),r.n();var n=u.Long?"toLong":"toNumber";u.merge(o.prototype,{int64:function(){return l.call(this)[n](!1)},uint64:function(){return l.call(this)[n](!0)},sint64:function(){return l.call(this).zzDecode()[n](!1)},fixed64:function(){return w.call(this)[n](!0)},sfixed64:function(){return w.call(this)[n](!1)}})}},{15:15}],10:[function(t,n,i){n.exports=e;var r=t(9),u=((e.prototype=Object.create(r.prototype)).constructor=e,t(15));function e(t){r.call(this,t)}e.n=function(){u.Buffer&&(e.prototype.i=u.Buffer.prototype.slice)},e.prototype.string=function(){var t=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+t,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+t,this.len))},e.n()},{15:15,9:9}],11:[function(t,n,i){n.exports={}},{}],12:[function(t,n,i){i.Service=t(13)},{13:13}],13:[function(t,n,i){n.exports=r;var h=t(15);function r(t,n,i){if("function"!=typeof t)throw TypeError("rpcImpl must be a function");h.EventEmitter.call(this),this.rpcImpl=t,this.requestDelimited=!!n,this.responseDelimited=!!i}((r.prototype=Object.create(h.EventEmitter.prototype)).constructor=r).prototype.rpcCall=function t(i,n,r,u,e){if(!u)throw TypeError("request must be specified");var s=this;if(!e)return h.asPromise(t,s,i,n,r,u);if(!s.rpcImpl)return setTimeout(function(){e(Error("already ended"))},0),d;try{return s.rpcImpl(i,n[s.requestDelimited?"encodeDelimited":"encode"](u).finish(),function(t,n){if(t)return s.emit("error",t,i),e(t);if(null===n)return s.end(!0),d;if(!(n instanceof r))try{n=r[s.responseDelimited?"decodeDelimited":"decode"](n)}catch(t){return s.emit("error",t,i),e(t)}return s.emit("data",n,i),e(null,n)})}catch(t){return s.emit("error",t,i),setTimeout(function(){e(t)},0),d}},r.prototype.end=function(t){return this.rpcImpl&&(t||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}},{15:15}],14:[function(t,n,i){n.exports=u;var r=t(15);function u(t,n){this.lo=t>>>0,this.hi=n>>>0}var e=u.zero=new u(0,0),s=(e.toNumber=function(){return 0},e.zzEncode=e.zzDecode=function(){return this},e.length=function(){return 1},u.zeroHash="\0\0\0\0\0\0\0\0",u.fromNumber=function(t){var n,i;return 0===t?e:(i=(t=(n=t<0)?-t:t)>>>0,t=(t-i)/4294967296>>>0,n&&(t=~t>>>0,i=~i>>>0,4294967295<++i&&(i=0,4294967295<++t&&(t=0))),new u(i,t))},u.from=function(t){if("number"==typeof t)return u.fromNumber(t);if(r.isString(t)){if(!r.Long)return u.fromNumber(parseInt(t,10));t=r.Long.fromString(t)}return t.low||t.high?new u(t.low>>>0,t.high>>>0):e},u.prototype.toNumber=function(t){var n;return!t&&this.hi>>>31?(t=1+~this.lo>>>0,n=~this.hi>>>0,-(t+4294967296*(n=t?n:n+1>>>0))):this.lo+4294967296*this.hi},u.prototype.toLong=function(t){return r.Long?new r.Long(0|this.lo,0|this.hi,!!t):{low:0|this.lo,high:0|this.hi,unsigned:!!t}},String.prototype.charCodeAt);u.fromHash=function(t){return"\0\0\0\0\0\0\0\0"===t?e:new u((s.call(t,0)|s.call(t,1)<<8|s.call(t,2)<<16|s.call(t,3)<<24)>>>0,(s.call(t,4)|s.call(t,5)<<8|s.call(t,6)<<16|s.call(t,7)<<24)>>>0)},u.prototype.toHash=function(){return String.fromCharCode(255&this.lo,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,255&this.hi,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},u.prototype.zzEncode=function(){var t=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^t)>>>0,this.lo=(this.lo<<1^t)>>>0,this},u.prototype.zzDecode=function(){var t=-(1&this.lo);return this.lo=((this.lo>>>1|this.hi<<31)^t)>>>0,this.hi=(this.hi>>>1^t)>>>0,this},u.prototype.length=function(){var t=this.lo,n=(this.lo>>>28|this.hi<<4)>>>0,i=this.hi>>>24;return 0==i?0==n?t<16384?t<128?1:2:t<2097152?3:4:n<16384?n<128?5:6:n<2097152?7:8:i<128?9:10}},{15:15}],15:[function(t,n,i){var r=i;function u(t,n,i){for(var r=Object.keys(n),u=0;u>>7|t.hi<<25)>>>0,t.hi>>>=7;for(;127>>7;n[i++]=t.lo}function y(t,n,i){n[i]=255&t,n[i+1]=t>>>8&255,n[i+2]=t>>>16&255,n[i+3]=t>>>24}a.create=l(),a.alloc=function(t){return new u.Array(t)},u.Array!==Array&&(a.alloc=u.pool(a.alloc,u.Array.prototype.subarray)),a.prototype.e=function(t,n,i){return this.tail=this.tail.next=new o(t,n,i),this.len+=n,this},(w.prototype=Object.create(o.prototype)).fn=function(t,n,i){for(;127>>=7;n[i]=t},a.prototype.uint32=function(t){return this.len+=(this.tail=this.tail.next=new w((t>>>=0)<128?1:t<16384?2:t<2097152?3:t<268435456?4:5,t)).len,this},a.prototype.int32=function(t){return t<0?this.e(b,10,e.fromNumber(t)):this.uint32(t)},a.prototype.sint32=function(t){return this.uint32((t<<1^t>>31)>>>0)},a.prototype.int64=a.prototype.uint64=function(t){t=e.from(t);return this.e(b,t.length(),t)},a.prototype.sint64=function(t){t=e.from(t).zzEncode();return this.e(b,t.length(),t)},a.prototype.bool=function(t){return this.e(v,1,t?1:0)},a.prototype.sfixed32=a.prototype.fixed32=function(t){return this.e(y,4,t>>>0)},a.prototype.sfixed64=a.prototype.fixed64=function(t){t=e.from(t);return this.e(y,4,t.lo).e(y,4,t.hi)},a.prototype.float=function(t){return this.e(u.float.writeFloatLE,4,t)},a.prototype.double=function(t){return this.e(u.float.writeDoubleLE,8,t)};var g=u.Array.prototype.set?function(t,n,i){n.set(t,i)}:function(t,n,i){for(var r=0;r>>0;return i?(u.isString(t)&&(n=a.alloc(i=s.length(t)),s.decode(t,n,0),t=n),this.uint32(i).e(g,i,t)):this.e(v,1,0)},a.prototype.string=function(t){var n=h.length(t);return n?this.uint32(n).e(h.write,n,t):this.e(v,1,0)},a.prototype.fork=function(){return this.states=new c(this),this.head=this.tail=new o(f,0,0),this.len=0,this},a.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new o(f,0,0),this.len=0),this},a.prototype.ldelim=function(){var t=this.head,n=this.tail,i=this.len;return this.reset().uint32(i),i&&(this.tail.next=t.next,this.tail=n,this.len+=i),this},a.prototype.finish=function(){for(var t=this.head.next,n=this.constructor.alloc(this.len),i=0;t;)t.fn(t.val,n,i),i+=t.len,t=t.next;return n},a.n=function(t){r=t,a.create=l(),r.n()}},{15:15}],17:[function(t,n,i){n.exports=e;var r=t(16),u=((e.prototype=Object.create(r.prototype)).constructor=e,t(15));function e(){r.call(this)}function s(t,n,i){t.length<40?u.utf8.write(t,n,i):n.utf8Write?n.utf8Write(t,i):n.write(t,i)}e.n=function(){e.alloc=u.u,e.writeBytesBuffer=u.Buffer&&u.Buffer.prototype instanceof Uint8Array&&"set"===u.Buffer.prototype.set.name?function(t,n,i){n.set(t,i)}:function(t,n,i){if(t.copy)t.copy(n,i,0,t.length);else for(var r=0;r>>0;return this.uint32(n),n&&this.e(e.writeBytesBuffer,n,t),this},e.prototype.string=function(t){var n=u.Buffer.byteLength(t);return this.uint32(n),n&&this.e(s,n,t),this},e.n()},{15:15,16:16}]},{},[8])}(); -//# sourceMappingURL=protobuf.min.js.map diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/dist/protobuf.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/dist/protobuf.js deleted file mode 100644 index 4e7650ac..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/dist/protobuf.js +++ /dev/null @@ -1,9065 +0,0 @@ -/*! - * protobuf.js v7.1.0 (c) 2016, daniel wirtz - * compiled thu, 22 sep 2022 17:16:10 utc - * licensed under the bsd-3-clause license - * see: https://github.com/dcodeio/protobuf.js for details - */ -(function(undefined){"use strict";(function prelude(modules, cache, entries) { - - // This is the prelude used to bundle protobuf.js for the browser. Wraps up the CommonJS - // sources through a conflict-free require shim and is again wrapped within an iife that - // provides a minification-friendly `undefined` var plus a global "use strict" directive - // so that minification can remove the directives of each module. - - function $require(name) { - var $module = cache[name]; - if (!$module) - modules[name][0].call($module = cache[name] = { exports: {} }, $require, $module, $module.exports); - return $module.exports; - } - - var protobuf = $require(entries[0]); - - // Expose globally - protobuf.util.global.protobuf = protobuf; - - // Be nice to AMD - if (typeof define === "function" && define.amd) - define(["long"], function(Long) { - if (Long && Long.isLong) { - protobuf.util.Long = Long; - protobuf.configure(); - } - return protobuf; - }); - - // Be nice to CommonJS - if (typeof module === "object" && module && module.exports) - module.exports = protobuf; - -})/* end of prelude */({1:[function(require,module,exports){ -"use strict"; -module.exports = asPromise; - -/** - * Callback as used by {@link util.asPromise}. - * @typedef asPromiseCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {...*} params Additional arguments - * @returns {undefined} - */ - -/** - * Returns a promise from a node-style callback function. - * @memberof util - * @param {asPromiseCallback} fn Function to call - * @param {*} ctx Function context - * @param {...*} params Function arguments - * @returns {Promise<*>} Promisified function - */ -function asPromise(fn, ctx/*, varargs */) { - var params = new Array(arguments.length - 1), - offset = 0, - index = 2, - pending = true; - while (index < arguments.length) - params[offset++] = arguments[index++]; - return new Promise(function executor(resolve, reject) { - params[offset] = function callback(err/*, varargs */) { - if (pending) { - pending = false; - if (err) - reject(err); - else { - var params = new Array(arguments.length - 1), - offset = 0; - while (offset < params.length) - params[offset++] = arguments[offset]; - resolve.apply(null, params); - } - } - }; - try { - fn.apply(ctx || null, params); - } catch (err) { - if (pending) { - pending = false; - reject(err); - } - } - }); -} - -},{}],2:[function(require,module,exports){ -"use strict"; - -/** - * A minimal base64 implementation for number arrays. - * @memberof util - * @namespace - */ -var base64 = exports; - -/** - * Calculates the byte length of a base64 encoded string. - * @param {string} string Base64 encoded string - * @returns {number} Byte length - */ -base64.length = function length(string) { - var p = string.length; - if (!p) - return 0; - var n = 0; - while (--p % 4 > 1 && string.charAt(p) === "=") - ++n; - return Math.ceil(string.length * 3) / 4 - n; -}; - -// Base64 encoding table -var b64 = new Array(64); - -// Base64 decoding table -var s64 = new Array(123); - -// 65..90, 97..122, 48..57, 43, 47 -for (var i = 0; i < 64;) - s64[b64[i] = i < 26 ? i + 65 : i < 52 ? i + 71 : i < 62 ? i - 4 : i - 59 | 43] = i++; - -/** - * Encodes a buffer to a base64 encoded string. - * @param {Uint8Array} buffer Source buffer - * @param {number} start Source start - * @param {number} end Source end - * @returns {string} Base64 encoded string - */ -base64.encode = function encode(buffer, start, end) { - var parts = null, - chunk = []; - var i = 0, // output index - j = 0, // goto index - t; // temporary - while (start < end) { - var b = buffer[start++]; - switch (j) { - case 0: - chunk[i++] = b64[b >> 2]; - t = (b & 3) << 4; - j = 1; - break; - case 1: - chunk[i++] = b64[t | b >> 4]; - t = (b & 15) << 2; - j = 2; - break; - case 2: - chunk[i++] = b64[t | b >> 6]; - chunk[i++] = b64[b & 63]; - j = 0; - break; - } - if (i > 8191) { - (parts || (parts = [])).push(String.fromCharCode.apply(String, chunk)); - i = 0; - } - } - if (j) { - chunk[i++] = b64[t]; - chunk[i++] = 61; - if (j === 1) - chunk[i++] = 61; - } - if (parts) { - if (i) - parts.push(String.fromCharCode.apply(String, chunk.slice(0, i))); - return parts.join(""); - } - return String.fromCharCode.apply(String, chunk.slice(0, i)); -}; - -var invalidEncoding = "invalid encoding"; - -/** - * Decodes a base64 encoded string to a buffer. - * @param {string} string Source string - * @param {Uint8Array} buffer Destination buffer - * @param {number} offset Destination offset - * @returns {number} Number of bytes written - * @throws {Error} If encoding is invalid - */ -base64.decode = function decode(string, buffer, offset) { - var start = offset; - var j = 0, // goto index - t; // temporary - for (var i = 0; i < string.length;) { - var c = string.charCodeAt(i++); - if (c === 61 && j > 1) - break; - if ((c = s64[c]) === undefined) - throw Error(invalidEncoding); - switch (j) { - case 0: - t = c; - j = 1; - break; - case 1: - buffer[offset++] = t << 2 | (c & 48) >> 4; - t = c; - j = 2; - break; - case 2: - buffer[offset++] = (t & 15) << 4 | (c & 60) >> 2; - t = c; - j = 3; - break; - case 3: - buffer[offset++] = (t & 3) << 6 | c; - j = 0; - break; - } - } - if (j === 1) - throw Error(invalidEncoding); - return offset - start; -}; - -/** - * Tests if the specified string appears to be base64 encoded. - * @param {string} string String to test - * @returns {boolean} `true` if probably base64 encoded, otherwise false - */ -base64.test = function test(string) { - return /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(string); -}; - -},{}],3:[function(require,module,exports){ -"use strict"; -module.exports = codegen; - -/** - * Begins generating a function. - * @memberof util - * @param {string[]} functionParams Function parameter names - * @param {string} [functionName] Function name if not anonymous - * @returns {Codegen} Appender that appends code to the function's body - */ -function codegen(functionParams, functionName) { - - /* istanbul ignore if */ - if (typeof functionParams === "string") { - functionName = functionParams; - functionParams = undefined; - } - - var body = []; - - /** - * Appends code to the function's body or finishes generation. - * @typedef Codegen - * @type {function} - * @param {string|Object.} [formatStringOrScope] Format string or, to finish the function, an object of additional scope variables, if any - * @param {...*} [formatParams] Format parameters - * @returns {Codegen|Function} Itself or the generated function if finished - * @throws {Error} If format parameter counts do not match - */ - - function Codegen(formatStringOrScope) { - // note that explicit array handling below makes this ~50% faster - - // finish the function - if (typeof formatStringOrScope !== "string") { - var source = toString(); - if (codegen.verbose) - console.log("codegen: " + source); // eslint-disable-line no-console - source = "return " + source; - if (formatStringOrScope) { - var scopeKeys = Object.keys(formatStringOrScope), - scopeParams = new Array(scopeKeys.length + 1), - scopeValues = new Array(scopeKeys.length), - scopeOffset = 0; - while (scopeOffset < scopeKeys.length) { - scopeParams[scopeOffset] = scopeKeys[scopeOffset]; - scopeValues[scopeOffset] = formatStringOrScope[scopeKeys[scopeOffset++]]; - } - scopeParams[scopeOffset] = source; - return Function.apply(null, scopeParams).apply(null, scopeValues); // eslint-disable-line no-new-func - } - return Function(source)(); // eslint-disable-line no-new-func - } - - // otherwise append to body - var formatParams = new Array(arguments.length - 1), - formatOffset = 0; - while (formatOffset < formatParams.length) - formatParams[formatOffset] = arguments[++formatOffset]; - formatOffset = 0; - formatStringOrScope = formatStringOrScope.replace(/%([%dfijs])/g, function replace($0, $1) { - var value = formatParams[formatOffset++]; - switch ($1) { - case "d": case "f": return String(Number(value)); - case "i": return String(Math.floor(value)); - case "j": return JSON.stringify(value); - case "s": return String(value); - } - return "%"; - }); - if (formatOffset !== formatParams.length) - throw Error("parameter count mismatch"); - body.push(formatStringOrScope); - return Codegen; - } - - function toString(functionNameOverride) { - return "function " + (functionNameOverride || functionName || "") + "(" + (functionParams && functionParams.join(",") || "") + "){\n " + body.join("\n ") + "\n}"; - } - - Codegen.toString = toString; - return Codegen; -} - -/** - * Begins generating a function. - * @memberof util - * @function codegen - * @param {string} [functionName] Function name if not anonymous - * @returns {Codegen} Appender that appends code to the function's body - * @variation 2 - */ - -/** - * When set to `true`, codegen will log generated code to console. Useful for debugging. - * @name util.codegen.verbose - * @type {boolean} - */ -codegen.verbose = false; - -},{}],4:[function(require,module,exports){ -"use strict"; -module.exports = EventEmitter; - -/** - * Constructs a new event emitter instance. - * @classdesc A minimal event emitter. - * @memberof util - * @constructor - */ -function EventEmitter() { - - /** - * Registered listeners. - * @type {Object.} - * @private - */ - this._listeners = {}; -} - -/** - * Registers an event listener. - * @param {string} evt Event name - * @param {function} fn Listener - * @param {*} [ctx] Listener context - * @returns {util.EventEmitter} `this` - */ -EventEmitter.prototype.on = function on(evt, fn, ctx) { - (this._listeners[evt] || (this._listeners[evt] = [])).push({ - fn : fn, - ctx : ctx || this - }); - return this; -}; - -/** - * Removes an event listener or any matching listeners if arguments are omitted. - * @param {string} [evt] Event name. Removes all listeners if omitted. - * @param {function} [fn] Listener to remove. Removes all listeners of `evt` if omitted. - * @returns {util.EventEmitter} `this` - */ -EventEmitter.prototype.off = function off(evt, fn) { - if (evt === undefined) - this._listeners = {}; - else { - if (fn === undefined) - this._listeners[evt] = []; - else { - var listeners = this._listeners[evt]; - for (var i = 0; i < listeners.length;) - if (listeners[i].fn === fn) - listeners.splice(i, 1); - else - ++i; - } - } - return this; -}; - -/** - * Emits an event by calling its listeners with the specified arguments. - * @param {string} evt Event name - * @param {...*} args Arguments - * @returns {util.EventEmitter} `this` - */ -EventEmitter.prototype.emit = function emit(evt) { - var listeners = this._listeners[evt]; - if (listeners) { - var args = [], - i = 1; - for (; i < arguments.length;) - args.push(arguments[i++]); - for (i = 0; i < listeners.length;) - listeners[i].fn.apply(listeners[i++].ctx, args); - } - return this; -}; - -},{}],5:[function(require,module,exports){ -"use strict"; -module.exports = fetch; - -var asPromise = require(1), - inquire = require(7); - -var fs = inquire("fs"); - -/** - * Node-style callback as used by {@link util.fetch}. - * @typedef FetchCallback - * @type {function} - * @param {?Error} error Error, if any, otherwise `null` - * @param {string} [contents] File contents, if there hasn't been an error - * @returns {undefined} - */ - -/** - * Options as used by {@link util.fetch}. - * @typedef FetchOptions - * @type {Object} - * @property {boolean} [binary=false] Whether expecting a binary response - * @property {boolean} [xhr=false] If `true`, forces the use of XMLHttpRequest - */ - -/** - * Fetches the contents of a file. - * @memberof util - * @param {string} filename File path or url - * @param {FetchOptions} options Fetch options - * @param {FetchCallback} callback Callback function - * @returns {undefined} - */ -function fetch(filename, options, callback) { - if (typeof options === "function") { - callback = options; - options = {}; - } else if (!options) - options = {}; - - if (!callback) - return asPromise(fetch, this, filename, options); // eslint-disable-line no-invalid-this - - // if a node-like filesystem is present, try it first but fall back to XHR if nothing is found. - if (!options.xhr && fs && fs.readFile) - return fs.readFile(filename, function fetchReadFileCallback(err, contents) { - return err && typeof XMLHttpRequest !== "undefined" - ? fetch.xhr(filename, options, callback) - : err - ? callback(err) - : callback(null, options.binary ? contents : contents.toString("utf8")); - }); - - // use the XHR version otherwise. - return fetch.xhr(filename, options, callback); -} - -/** - * Fetches the contents of a file. - * @name util.fetch - * @function - * @param {string} path File path or url - * @param {FetchCallback} callback Callback function - * @returns {undefined} - * @variation 2 - */ - -/** - * Fetches the contents of a file. - * @name util.fetch - * @function - * @param {string} path File path or url - * @param {FetchOptions} [options] Fetch options - * @returns {Promise} Promise - * @variation 3 - */ - -/**/ -fetch.xhr = function fetch_xhr(filename, options, callback) { - var xhr = new XMLHttpRequest(); - xhr.onreadystatechange /* works everywhere */ = function fetchOnReadyStateChange() { - - if (xhr.readyState !== 4) - return undefined; - - // local cors security errors return status 0 / empty string, too. afaik this cannot be - // reliably distinguished from an actually empty file for security reasons. feel free - // to send a pull request if you are aware of a solution. - if (xhr.status !== 0 && xhr.status !== 200) - return callback(Error("status " + xhr.status)); - - // if binary data is expected, make sure that some sort of array is returned, even if - // ArrayBuffers are not supported. the binary string fallback, however, is unsafe. - if (options.binary) { - var buffer = xhr.response; - if (!buffer) { - buffer = []; - for (var i = 0; i < xhr.responseText.length; ++i) - buffer.push(xhr.responseText.charCodeAt(i) & 255); - } - return callback(null, typeof Uint8Array !== "undefined" ? new Uint8Array(buffer) : buffer); - } - return callback(null, xhr.responseText); - }; - - if (options.binary) { - // ref: https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/Sending_and_Receiving_Binary_Data#Receiving_binary_data_in_older_browsers - if ("overrideMimeType" in xhr) - xhr.overrideMimeType("text/plain; charset=x-user-defined"); - xhr.responseType = "arraybuffer"; - } - - xhr.open("GET", filename); - xhr.send(); -}; - -},{"1":1,"7":7}],6:[function(require,module,exports){ -"use strict"; - -module.exports = factory(factory); - -/** - * Reads / writes floats / doubles from / to buffers. - * @name util.float - * @namespace - */ - -/** - * Writes a 32 bit float to a buffer using little endian byte order. - * @name util.float.writeFloatLE - * @function - * @param {number} val Value to write - * @param {Uint8Array} buf Target buffer - * @param {number} pos Target buffer offset - * @returns {undefined} - */ - -/** - * Writes a 32 bit float to a buffer using big endian byte order. - * @name util.float.writeFloatBE - * @function - * @param {number} val Value to write - * @param {Uint8Array} buf Target buffer - * @param {number} pos Target buffer offset - * @returns {undefined} - */ - -/** - * Reads a 32 bit float from a buffer using little endian byte order. - * @name util.float.readFloatLE - * @function - * @param {Uint8Array} buf Source buffer - * @param {number} pos Source buffer offset - * @returns {number} Value read - */ - -/** - * Reads a 32 bit float from a buffer using big endian byte order. - * @name util.float.readFloatBE - * @function - * @param {Uint8Array} buf Source buffer - * @param {number} pos Source buffer offset - * @returns {number} Value read - */ - -/** - * Writes a 64 bit double to a buffer using little endian byte order. - * @name util.float.writeDoubleLE - * @function - * @param {number} val Value to write - * @param {Uint8Array} buf Target buffer - * @param {number} pos Target buffer offset - * @returns {undefined} - */ - -/** - * Writes a 64 bit double to a buffer using big endian byte order. - * @name util.float.writeDoubleBE - * @function - * @param {number} val Value to write - * @param {Uint8Array} buf Target buffer - * @param {number} pos Target buffer offset - * @returns {undefined} - */ - -/** - * Reads a 64 bit double from a buffer using little endian byte order. - * @name util.float.readDoubleLE - * @function - * @param {Uint8Array} buf Source buffer - * @param {number} pos Source buffer offset - * @returns {number} Value read - */ - -/** - * Reads a 64 bit double from a buffer using big endian byte order. - * @name util.float.readDoubleBE - * @function - * @param {Uint8Array} buf Source buffer - * @param {number} pos Source buffer offset - * @returns {number} Value read - */ - -// Factory function for the purpose of node-based testing in modified global environments -function factory(exports) { - - // float: typed array - if (typeof Float32Array !== "undefined") (function() { - - var f32 = new Float32Array([ -0 ]), - f8b = new Uint8Array(f32.buffer), - le = f8b[3] === 128; - - function writeFloat_f32_cpy(val, buf, pos) { - f32[0] = val; - buf[pos ] = f8b[0]; - buf[pos + 1] = f8b[1]; - buf[pos + 2] = f8b[2]; - buf[pos + 3] = f8b[3]; - } - - function writeFloat_f32_rev(val, buf, pos) { - f32[0] = val; - buf[pos ] = f8b[3]; - buf[pos + 1] = f8b[2]; - buf[pos + 2] = f8b[1]; - buf[pos + 3] = f8b[0]; - } - - /* istanbul ignore next */ - exports.writeFloatLE = le ? writeFloat_f32_cpy : writeFloat_f32_rev; - /* istanbul ignore next */ - exports.writeFloatBE = le ? writeFloat_f32_rev : writeFloat_f32_cpy; - - function readFloat_f32_cpy(buf, pos) { - f8b[0] = buf[pos ]; - f8b[1] = buf[pos + 1]; - f8b[2] = buf[pos + 2]; - f8b[3] = buf[pos + 3]; - return f32[0]; - } - - function readFloat_f32_rev(buf, pos) { - f8b[3] = buf[pos ]; - f8b[2] = buf[pos + 1]; - f8b[1] = buf[pos + 2]; - f8b[0] = buf[pos + 3]; - return f32[0]; - } - - /* istanbul ignore next */ - exports.readFloatLE = le ? readFloat_f32_cpy : readFloat_f32_rev; - /* istanbul ignore next */ - exports.readFloatBE = le ? readFloat_f32_rev : readFloat_f32_cpy; - - // float: ieee754 - })(); else (function() { - - function writeFloat_ieee754(writeUint, val, buf, pos) { - var sign = val < 0 ? 1 : 0; - if (sign) - val = -val; - if (val === 0) - writeUint(1 / val > 0 ? /* positive */ 0 : /* negative 0 */ 2147483648, buf, pos); - else if (isNaN(val)) - writeUint(2143289344, buf, pos); - else if (val > 3.4028234663852886e+38) // +-Infinity - writeUint((sign << 31 | 2139095040) >>> 0, buf, pos); - else if (val < 1.1754943508222875e-38) // denormal - writeUint((sign << 31 | Math.round(val / 1.401298464324817e-45)) >>> 0, buf, pos); - else { - var exponent = Math.floor(Math.log(val) / Math.LN2), - mantissa = Math.round(val * Math.pow(2, -exponent) * 8388608) & 8388607; - writeUint((sign << 31 | exponent + 127 << 23 | mantissa) >>> 0, buf, pos); - } - } - - exports.writeFloatLE = writeFloat_ieee754.bind(null, writeUintLE); - exports.writeFloatBE = writeFloat_ieee754.bind(null, writeUintBE); - - function readFloat_ieee754(readUint, buf, pos) { - var uint = readUint(buf, pos), - sign = (uint >> 31) * 2 + 1, - exponent = uint >>> 23 & 255, - mantissa = uint & 8388607; - return exponent === 255 - ? mantissa - ? NaN - : sign * Infinity - : exponent === 0 // denormal - ? sign * 1.401298464324817e-45 * mantissa - : sign * Math.pow(2, exponent - 150) * (mantissa + 8388608); - } - - exports.readFloatLE = readFloat_ieee754.bind(null, readUintLE); - exports.readFloatBE = readFloat_ieee754.bind(null, readUintBE); - - })(); - - // double: typed array - if (typeof Float64Array !== "undefined") (function() { - - var f64 = new Float64Array([-0]), - f8b = new Uint8Array(f64.buffer), - le = f8b[7] === 128; - - function writeDouble_f64_cpy(val, buf, pos) { - f64[0] = val; - buf[pos ] = f8b[0]; - buf[pos + 1] = f8b[1]; - buf[pos + 2] = f8b[2]; - buf[pos + 3] = f8b[3]; - buf[pos + 4] = f8b[4]; - buf[pos + 5] = f8b[5]; - buf[pos + 6] = f8b[6]; - buf[pos + 7] = f8b[7]; - } - - function writeDouble_f64_rev(val, buf, pos) { - f64[0] = val; - buf[pos ] = f8b[7]; - buf[pos + 1] = f8b[6]; - buf[pos + 2] = f8b[5]; - buf[pos + 3] = f8b[4]; - buf[pos + 4] = f8b[3]; - buf[pos + 5] = f8b[2]; - buf[pos + 6] = f8b[1]; - buf[pos + 7] = f8b[0]; - } - - /* istanbul ignore next */ - exports.writeDoubleLE = le ? writeDouble_f64_cpy : writeDouble_f64_rev; - /* istanbul ignore next */ - exports.writeDoubleBE = le ? writeDouble_f64_rev : writeDouble_f64_cpy; - - function readDouble_f64_cpy(buf, pos) { - f8b[0] = buf[pos ]; - f8b[1] = buf[pos + 1]; - f8b[2] = buf[pos + 2]; - f8b[3] = buf[pos + 3]; - f8b[4] = buf[pos + 4]; - f8b[5] = buf[pos + 5]; - f8b[6] = buf[pos + 6]; - f8b[7] = buf[pos + 7]; - return f64[0]; - } - - function readDouble_f64_rev(buf, pos) { - f8b[7] = buf[pos ]; - f8b[6] = buf[pos + 1]; - f8b[5] = buf[pos + 2]; - f8b[4] = buf[pos + 3]; - f8b[3] = buf[pos + 4]; - f8b[2] = buf[pos + 5]; - f8b[1] = buf[pos + 6]; - f8b[0] = buf[pos + 7]; - return f64[0]; - } - - /* istanbul ignore next */ - exports.readDoubleLE = le ? readDouble_f64_cpy : readDouble_f64_rev; - /* istanbul ignore next */ - exports.readDoubleBE = le ? readDouble_f64_rev : readDouble_f64_cpy; - - // double: ieee754 - })(); else (function() { - - function writeDouble_ieee754(writeUint, off0, off1, val, buf, pos) { - var sign = val < 0 ? 1 : 0; - if (sign) - val = -val; - if (val === 0) { - writeUint(0, buf, pos + off0); - writeUint(1 / val > 0 ? /* positive */ 0 : /* negative 0 */ 2147483648, buf, pos + off1); - } else if (isNaN(val)) { - writeUint(0, buf, pos + off0); - writeUint(2146959360, buf, pos + off1); - } else if (val > 1.7976931348623157e+308) { // +-Infinity - writeUint(0, buf, pos + off0); - writeUint((sign << 31 | 2146435072) >>> 0, buf, pos + off1); - } else { - var mantissa; - if (val < 2.2250738585072014e-308) { // denormal - mantissa = val / 5e-324; - writeUint(mantissa >>> 0, buf, pos + off0); - writeUint((sign << 31 | mantissa / 4294967296) >>> 0, buf, pos + off1); - } else { - var exponent = Math.floor(Math.log(val) / Math.LN2); - if (exponent === 1024) - exponent = 1023; - mantissa = val * Math.pow(2, -exponent); - writeUint(mantissa * 4503599627370496 >>> 0, buf, pos + off0); - writeUint((sign << 31 | exponent + 1023 << 20 | mantissa * 1048576 & 1048575) >>> 0, buf, pos + off1); - } - } - } - - exports.writeDoubleLE = writeDouble_ieee754.bind(null, writeUintLE, 0, 4); - exports.writeDoubleBE = writeDouble_ieee754.bind(null, writeUintBE, 4, 0); - - function readDouble_ieee754(readUint, off0, off1, buf, pos) { - var lo = readUint(buf, pos + off0), - hi = readUint(buf, pos + off1); - var sign = (hi >> 31) * 2 + 1, - exponent = hi >>> 20 & 2047, - mantissa = 4294967296 * (hi & 1048575) + lo; - return exponent === 2047 - ? mantissa - ? NaN - : sign * Infinity - : exponent === 0 // denormal - ? sign * 5e-324 * mantissa - : sign * Math.pow(2, exponent - 1075) * (mantissa + 4503599627370496); - } - - exports.readDoubleLE = readDouble_ieee754.bind(null, readUintLE, 0, 4); - exports.readDoubleBE = readDouble_ieee754.bind(null, readUintBE, 4, 0); - - })(); - - return exports; -} - -// uint helpers - -function writeUintLE(val, buf, pos) { - buf[pos ] = val & 255; - buf[pos + 1] = val >>> 8 & 255; - buf[pos + 2] = val >>> 16 & 255; - buf[pos + 3] = val >>> 24; -} - -function writeUintBE(val, buf, pos) { - buf[pos ] = val >>> 24; - buf[pos + 1] = val >>> 16 & 255; - buf[pos + 2] = val >>> 8 & 255; - buf[pos + 3] = val & 255; -} - -function readUintLE(buf, pos) { - return (buf[pos ] - | buf[pos + 1] << 8 - | buf[pos + 2] << 16 - | buf[pos + 3] << 24) >>> 0; -} - -function readUintBE(buf, pos) { - return (buf[pos ] << 24 - | buf[pos + 1] << 16 - | buf[pos + 2] << 8 - | buf[pos + 3]) >>> 0; -} - -},{}],7:[function(require,module,exports){ -"use strict"; -module.exports = inquire; - -/** - * Requires a module only if available. - * @memberof util - * @param {string} moduleName Module to require - * @returns {?Object} Required module if available and not empty, otherwise `null` - */ -function inquire(moduleName) { - try { - var mod = eval("quire".replace(/^/,"re"))(moduleName); // eslint-disable-line no-eval - if (mod && (mod.length || Object.keys(mod).length)) - return mod; - } catch (e) {} // eslint-disable-line no-empty - return null; -} - -},{}],8:[function(require,module,exports){ -"use strict"; - -/** - * A minimal path module to resolve Unix, Windows and URL paths alike. - * @memberof util - * @namespace - */ -var path = exports; - -var isAbsolute = -/** - * Tests if the specified path is absolute. - * @param {string} path Path to test - * @returns {boolean} `true` if path is absolute - */ -path.isAbsolute = function isAbsolute(path) { - return /^(?:\/|\w+:)/.test(path); -}; - -var normalize = -/** - * Normalizes the specified path. - * @param {string} path Path to normalize - * @returns {string} Normalized path - */ -path.normalize = function normalize(path) { - path = path.replace(/\\/g, "/") - .replace(/\/{2,}/g, "/"); - var parts = path.split("/"), - absolute = isAbsolute(path), - prefix = ""; - if (absolute) - prefix = parts.shift() + "/"; - for (var i = 0; i < parts.length;) { - if (parts[i] === "..") { - if (i > 0 && parts[i - 1] !== "..") - parts.splice(--i, 2); - else if (absolute) - parts.splice(i, 1); - else - ++i; - } else if (parts[i] === ".") - parts.splice(i, 1); - else - ++i; - } - return prefix + parts.join("/"); -}; - -/** - * Resolves the specified include path against the specified origin path. - * @param {string} originPath Path to the origin file - * @param {string} includePath Include path relative to origin path - * @param {boolean} [alreadyNormalized=false] `true` if both paths are already known to be normalized - * @returns {string} Path to the include file - */ -path.resolve = function resolve(originPath, includePath, alreadyNormalized) { - if (!alreadyNormalized) - includePath = normalize(includePath); - if (isAbsolute(includePath)) - return includePath; - if (!alreadyNormalized) - originPath = normalize(originPath); - return (originPath = originPath.replace(/(?:\/|^)[^/]+$/, "")).length ? normalize(originPath + "/" + includePath) : includePath; -}; - -},{}],9:[function(require,module,exports){ -"use strict"; -module.exports = pool; - -/** - * An allocator as used by {@link util.pool}. - * @typedef PoolAllocator - * @type {function} - * @param {number} size Buffer size - * @returns {Uint8Array} Buffer - */ - -/** - * A slicer as used by {@link util.pool}. - * @typedef PoolSlicer - * @type {function} - * @param {number} start Start offset - * @param {number} end End offset - * @returns {Uint8Array} Buffer slice - * @this {Uint8Array} - */ - -/** - * A general purpose buffer pool. - * @memberof util - * @function - * @param {PoolAllocator} alloc Allocator - * @param {PoolSlicer} slice Slicer - * @param {number} [size=8192] Slab size - * @returns {PoolAllocator} Pooled allocator - */ -function pool(alloc, slice, size) { - var SIZE = size || 8192; - var MAX = SIZE >>> 1; - var slab = null; - var offset = SIZE; - return function pool_alloc(size) { - if (size < 1 || size > MAX) - return alloc(size); - if (offset + size > SIZE) { - slab = alloc(SIZE); - offset = 0; - } - var buf = slice.call(slab, offset, offset += size); - if (offset & 7) // align to 32 bit - offset = (offset | 7) + 1; - return buf; - }; -} - -},{}],10:[function(require,module,exports){ -"use strict"; - -/** - * A minimal UTF8 implementation for number arrays. - * @memberof util - * @namespace - */ -var utf8 = exports; - -/** - * Calculates the UTF8 byte length of a string. - * @param {string} string String - * @returns {number} Byte length - */ -utf8.length = function utf8_length(string) { - var len = 0, - c = 0; - for (var i = 0; i < string.length; ++i) { - c = string.charCodeAt(i); - if (c < 128) - len += 1; - else if (c < 2048) - len += 2; - else if ((c & 0xFC00) === 0xD800 && (string.charCodeAt(i + 1) & 0xFC00) === 0xDC00) { - ++i; - len += 4; - } else - len += 3; - } - return len; -}; - -/** - * Reads UTF8 bytes as a string. - * @param {Uint8Array} buffer Source buffer - * @param {number} start Source start - * @param {number} end Source end - * @returns {string} String read - */ -utf8.read = function utf8_read(buffer, start, end) { - var len = end - start; - if (len < 1) - return ""; - var parts = null, - chunk = [], - i = 0, // char offset - t; // temporary - while (start < end) { - t = buffer[start++]; - if (t < 128) - chunk[i++] = t; - else if (t > 191 && t < 224) - chunk[i++] = (t & 31) << 6 | buffer[start++] & 63; - else if (t > 239 && t < 365) { - t = ((t & 7) << 18 | (buffer[start++] & 63) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63) - 0x10000; - chunk[i++] = 0xD800 + (t >> 10); - chunk[i++] = 0xDC00 + (t & 1023); - } else - chunk[i++] = (t & 15) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63; - if (i > 8191) { - (parts || (parts = [])).push(String.fromCharCode.apply(String, chunk)); - i = 0; - } - } - if (parts) { - if (i) - parts.push(String.fromCharCode.apply(String, chunk.slice(0, i))); - return parts.join(""); - } - return String.fromCharCode.apply(String, chunk.slice(0, i)); -}; - -/** - * Writes a string as UTF8 bytes. - * @param {string} string Source string - * @param {Uint8Array} buffer Destination buffer - * @param {number} offset Destination offset - * @returns {number} Bytes written - */ -utf8.write = function utf8_write(string, buffer, offset) { - var start = offset, - c1, // character 1 - c2; // character 2 - for (var i = 0; i < string.length; ++i) { - c1 = string.charCodeAt(i); - if (c1 < 128) { - buffer[offset++] = c1; - } else if (c1 < 2048) { - buffer[offset++] = c1 >> 6 | 192; - buffer[offset++] = c1 & 63 | 128; - } else if ((c1 & 0xFC00) === 0xD800 && ((c2 = string.charCodeAt(i + 1)) & 0xFC00) === 0xDC00) { - c1 = 0x10000 + ((c1 & 0x03FF) << 10) + (c2 & 0x03FF); - ++i; - buffer[offset++] = c1 >> 18 | 240; - buffer[offset++] = c1 >> 12 & 63 | 128; - buffer[offset++] = c1 >> 6 & 63 | 128; - buffer[offset++] = c1 & 63 | 128; - } else { - buffer[offset++] = c1 >> 12 | 224; - buffer[offset++] = c1 >> 6 & 63 | 128; - buffer[offset++] = c1 & 63 | 128; - } - } - return offset - start; -}; - -},{}],11:[function(require,module,exports){ -"use strict"; -module.exports = common; - -var commonRe = /\/|\./; - -/** - * Provides common type definitions. - * Can also be used to provide additional google types or your own custom types. - * @param {string} name Short name as in `google/protobuf/[name].proto` or full file name - * @param {Object.} json JSON definition within `google.protobuf` if a short name, otherwise the file's root definition - * @returns {undefined} - * @property {INamespace} google/protobuf/any.proto Any - * @property {INamespace} google/protobuf/duration.proto Duration - * @property {INamespace} google/protobuf/empty.proto Empty - * @property {INamespace} google/protobuf/field_mask.proto FieldMask - * @property {INamespace} google/protobuf/struct.proto Struct, Value, NullValue and ListValue - * @property {INamespace} google/protobuf/timestamp.proto Timestamp - * @property {INamespace} google/protobuf/wrappers.proto Wrappers - * @example - * // manually provides descriptor.proto (assumes google/protobuf/ namespace and .proto extension) - * protobuf.common("descriptor", descriptorJson); - * - * // manually provides a custom definition (uses my.foo namespace) - * protobuf.common("my/foo/bar.proto", myFooBarJson); - */ -function common(name, json) { - if (!commonRe.test(name)) { - name = "google/protobuf/" + name + ".proto"; - json = { nested: { google: { nested: { protobuf: { nested: json } } } } }; - } - common[name] = json; -} - -// Not provided because of limited use (feel free to discuss or to provide yourself): -// -// google/protobuf/descriptor.proto -// google/protobuf/source_context.proto -// google/protobuf/type.proto -// -// Stripped and pre-parsed versions of these non-bundled files are instead available as part of -// the repository or package within the google/protobuf directory. - -common("any", { - - /** - * Properties of a google.protobuf.Any message. - * @interface IAny - * @type {Object} - * @property {string} [typeUrl] - * @property {Uint8Array} [bytes] - * @memberof common - */ - Any: { - fields: { - type_url: { - type: "string", - id: 1 - }, - value: { - type: "bytes", - id: 2 - } - } - } -}); - -var timeType; - -common("duration", { - - /** - * Properties of a google.protobuf.Duration message. - * @interface IDuration - * @type {Object} - * @property {number|Long} [seconds] - * @property {number} [nanos] - * @memberof common - */ - Duration: timeType = { - fields: { - seconds: { - type: "int64", - id: 1 - }, - nanos: { - type: "int32", - id: 2 - } - } - } -}); - -common("timestamp", { - - /** - * Properties of a google.protobuf.Timestamp message. - * @interface ITimestamp - * @type {Object} - * @property {number|Long} [seconds] - * @property {number} [nanos] - * @memberof common - */ - Timestamp: timeType -}); - -common("empty", { - - /** - * Properties of a google.protobuf.Empty message. - * @interface IEmpty - * @memberof common - */ - Empty: { - fields: {} - } -}); - -common("struct", { - - /** - * Properties of a google.protobuf.Struct message. - * @interface IStruct - * @type {Object} - * @property {Object.} [fields] - * @memberof common - */ - Struct: { - fields: { - fields: { - keyType: "string", - type: "Value", - id: 1 - } - } - }, - - /** - * Properties of a google.protobuf.Value message. - * @interface IValue - * @type {Object} - * @property {string} [kind] - * @property {0} [nullValue] - * @property {number} [numberValue] - * @property {string} [stringValue] - * @property {boolean} [boolValue] - * @property {IStruct} [structValue] - * @property {IListValue} [listValue] - * @memberof common - */ - Value: { - oneofs: { - kind: { - oneof: [ - "nullValue", - "numberValue", - "stringValue", - "boolValue", - "structValue", - "listValue" - ] - } - }, - fields: { - nullValue: { - type: "NullValue", - id: 1 - }, - numberValue: { - type: "double", - id: 2 - }, - stringValue: { - type: "string", - id: 3 - }, - boolValue: { - type: "bool", - id: 4 - }, - structValue: { - type: "Struct", - id: 5 - }, - listValue: { - type: "ListValue", - id: 6 - } - } - }, - - NullValue: { - values: { - NULL_VALUE: 0 - } - }, - - /** - * Properties of a google.protobuf.ListValue message. - * @interface IListValue - * @type {Object} - * @property {Array.} [values] - * @memberof common - */ - ListValue: { - fields: { - values: { - rule: "repeated", - type: "Value", - id: 1 - } - } - } -}); - -common("wrappers", { - - /** - * Properties of a google.protobuf.DoubleValue message. - * @interface IDoubleValue - * @type {Object} - * @property {number} [value] - * @memberof common - */ - DoubleValue: { - fields: { - value: { - type: "double", - id: 1 - } - } - }, - - /** - * Properties of a google.protobuf.FloatValue message. - * @interface IFloatValue - * @type {Object} - * @property {number} [value] - * @memberof common - */ - FloatValue: { - fields: { - value: { - type: "float", - id: 1 - } - } - }, - - /** - * Properties of a google.protobuf.Int64Value message. - * @interface IInt64Value - * @type {Object} - * @property {number|Long} [value] - * @memberof common - */ - Int64Value: { - fields: { - value: { - type: "int64", - id: 1 - } - } - }, - - /** - * Properties of a google.protobuf.UInt64Value message. - * @interface IUInt64Value - * @type {Object} - * @property {number|Long} [value] - * @memberof common - */ - UInt64Value: { - fields: { - value: { - type: "uint64", - id: 1 - } - } - }, - - /** - * Properties of a google.protobuf.Int32Value message. - * @interface IInt32Value - * @type {Object} - * @property {number} [value] - * @memberof common - */ - Int32Value: { - fields: { - value: { - type: "int32", - id: 1 - } - } - }, - - /** - * Properties of a google.protobuf.UInt32Value message. - * @interface IUInt32Value - * @type {Object} - * @property {number} [value] - * @memberof common - */ - UInt32Value: { - fields: { - value: { - type: "uint32", - id: 1 - } - } - }, - - /** - * Properties of a google.protobuf.BoolValue message. - * @interface IBoolValue - * @type {Object} - * @property {boolean} [value] - * @memberof common - */ - BoolValue: { - fields: { - value: { - type: "bool", - id: 1 - } - } - }, - - /** - * Properties of a google.protobuf.StringValue message. - * @interface IStringValue - * @type {Object} - * @property {string} [value] - * @memberof common - */ - StringValue: { - fields: { - value: { - type: "string", - id: 1 - } - } - }, - - /** - * Properties of a google.protobuf.BytesValue message. - * @interface IBytesValue - * @type {Object} - * @property {Uint8Array} [value] - * @memberof common - */ - BytesValue: { - fields: { - value: { - type: "bytes", - id: 1 - } - } - } -}); - -common("field_mask", { - - /** - * Properties of a google.protobuf.FieldMask message. - * @interface IDoubleValue - * @type {Object} - * @property {number} [value] - * @memberof common - */ - FieldMask: { - fields: { - paths: { - rule: "repeated", - type: "string", - id: 1 - } - } - } -}); - -/** - * Gets the root definition of the specified common proto file. - * - * Bundled definitions are: - * - google/protobuf/any.proto - * - google/protobuf/duration.proto - * - google/protobuf/empty.proto - * - google/protobuf/field_mask.proto - * - google/protobuf/struct.proto - * - google/protobuf/timestamp.proto - * - google/protobuf/wrappers.proto - * - * @param {string} file Proto file name - * @returns {INamespace|null} Root definition or `null` if not defined - */ -common.get = function get(file) { - return common[file] || null; -}; - -},{}],12:[function(require,module,exports){ -"use strict"; -/** - * Runtime message from/to plain object converters. - * @namespace - */ -var converter = exports; - -var Enum = require(15), - util = require(37); - -/** - * Generates a partial value fromObject conveter. - * @param {Codegen} gen Codegen instance - * @param {Field} field Reflected field - * @param {number} fieldIndex Field index - * @param {string} prop Property reference - * @returns {Codegen} Codegen instance - * @ignore - */ -function genValuePartial_fromObject(gen, field, fieldIndex, prop) { - /* eslint-disable no-unexpected-multiline, block-scoped-var, no-redeclare */ - if (field.resolvedType) { - if (field.resolvedType instanceof Enum) { gen - ("switch(d%s){", prop); - for (var values = field.resolvedType.values, keys = Object.keys(values), i = 0; i < keys.length; ++i) { - // enum unknown values passthrough - if (values[keys[i]] === field.typeDefault) { gen - ("default:") - ("if(typeof(d%s)===\"number\"){m%s=d%s;break}", prop, prop, prop); - if (!field.repeated) gen // fallback to default value only for - // arrays, to avoid leaving holes. - ("break"); // for non-repeated fields, just ignore - } - gen - ("case%j:", keys[i]) - ("case %i:", values[keys[i]]) - ("m%s=%j", prop, values[keys[i]]) - ("break"); - } gen - ("}"); - } else gen - ("if(typeof d%s!==\"object\")", prop) - ("throw TypeError(%j)", field.fullName + ": object expected") - ("m%s=types[%i].fromObject(d%s)", prop, fieldIndex, prop); - } else { - var isUnsigned = false; - switch (field.type) { - case "double": - case "float": gen - ("m%s=Number(d%s)", prop, prop); // also catches "NaN", "Infinity" - break; - case "uint32": - case "fixed32": gen - ("m%s=d%s>>>0", prop, prop); - break; - case "int32": - case "sint32": - case "sfixed32": gen - ("m%s=d%s|0", prop, prop); - break; - case "uint64": - isUnsigned = true; - // eslint-disable-line no-fallthrough - case "int64": - case "sint64": - case "fixed64": - case "sfixed64": gen - ("if(util.Long)") - ("(m%s=util.Long.fromValue(d%s)).unsigned=%j", prop, prop, isUnsigned) - ("else if(typeof d%s===\"string\")", prop) - ("m%s=parseInt(d%s,10)", prop, prop) - ("else if(typeof d%s===\"number\")", prop) - ("m%s=d%s", prop, prop) - ("else if(typeof d%s===\"object\")", prop) - ("m%s=new util.LongBits(d%s.low>>>0,d%s.high>>>0).toNumber(%s)", prop, prop, prop, isUnsigned ? "true" : ""); - break; - case "bytes": gen - ("if(typeof d%s===\"string\")", prop) - ("util.base64.decode(d%s,m%s=util.newBuffer(util.base64.length(d%s)),0)", prop, prop, prop) - ("else if(d%s.length >= 0)", prop) - ("m%s=d%s", prop, prop); - break; - case "string": gen - ("m%s=String(d%s)", prop, prop); - break; - case "bool": gen - ("m%s=Boolean(d%s)", prop, prop); - break; - /* default: gen - ("m%s=d%s", prop, prop); - break; */ - } - } - return gen; - /* eslint-enable no-unexpected-multiline, block-scoped-var, no-redeclare */ -} - -/** - * Generates a plain object to runtime message converter specific to the specified message type. - * @param {Type} mtype Message type - * @returns {Codegen} Codegen instance - */ -converter.fromObject = function fromObject(mtype) { - /* eslint-disable no-unexpected-multiline, block-scoped-var, no-redeclare */ - var fields = mtype.fieldsArray; - var gen = util.codegen(["d"], mtype.name + "$fromObject") - ("if(d instanceof this.ctor)") - ("return d"); - if (!fields.length) return gen - ("return new this.ctor"); - gen - ("var m=new this.ctor"); - for (var i = 0; i < fields.length; ++i) { - var field = fields[i].resolve(), - prop = util.safeProp(field.name); - - // Map fields - if (field.map) { gen - ("if(d%s){", prop) - ("if(typeof d%s!==\"object\")", prop) - ("throw TypeError(%j)", field.fullName + ": object expected") - ("m%s={}", prop) - ("for(var ks=Object.keys(d%s),i=0;i>>0,m%s.high>>>0).toNumber(%s):m%s", prop, prop, prop, prop, isUnsigned ? "true": "", prop); - break; - case "bytes": gen - ("d%s=o.bytes===String?util.base64.encode(m%s,0,m%s.length):o.bytes===Array?Array.prototype.slice.call(m%s):m%s", prop, prop, prop, prop, prop); - break; - default: gen - ("d%s=m%s", prop, prop); - break; - } - } - return gen; - /* eslint-enable no-unexpected-multiline, block-scoped-var, no-redeclare */ -} - -/** - * Generates a runtime message to plain object converter specific to the specified message type. - * @param {Type} mtype Message type - * @returns {Codegen} Codegen instance - */ -converter.toObject = function toObject(mtype) { - /* eslint-disable no-unexpected-multiline, block-scoped-var, no-redeclare */ - var fields = mtype.fieldsArray.slice().sort(util.compareFieldsById); - if (!fields.length) - return util.codegen()("return {}"); - var gen = util.codegen(["m", "o"], mtype.name + "$toObject") - ("if(!o)") - ("o={}") - ("var d={}"); - - var repeatedFields = [], - mapFields = [], - normalFields = [], - i = 0; - for (; i < fields.length; ++i) - if (!fields[i].partOf) - ( fields[i].resolve().repeated ? repeatedFields - : fields[i].map ? mapFields - : normalFields).push(fields[i]); - - if (repeatedFields.length) { gen - ("if(o.arrays||o.defaults){"); - for (i = 0; i < repeatedFields.length; ++i) gen - ("d%s=[]", util.safeProp(repeatedFields[i].name)); - gen - ("}"); - } - - if (mapFields.length) { gen - ("if(o.objects||o.defaults){"); - for (i = 0; i < mapFields.length; ++i) gen - ("d%s={}", util.safeProp(mapFields[i].name)); - gen - ("}"); - } - - if (normalFields.length) { gen - ("if(o.defaults){"); - for (i = 0; i < normalFields.length; ++i) { - var field = normalFields[i], - prop = util.safeProp(field.name); - if (field.resolvedType instanceof Enum) gen - ("d%s=o.enums===String?%j:%j", prop, field.resolvedType.valuesById[field.typeDefault], field.typeDefault); - else if (field.long) gen - ("if(util.Long){") - ("var n=new util.Long(%i,%i,%j)", field.typeDefault.low, field.typeDefault.high, field.typeDefault.unsigned) - ("d%s=o.longs===String?n.toString():o.longs===Number?n.toNumber():n", prop) - ("}else") - ("d%s=o.longs===String?%j:%i", prop, field.typeDefault.toString(), field.typeDefault.toNumber()); - else if (field.bytes) { - var arrayDefault = "[" + Array.prototype.slice.call(field.typeDefault).join(",") + "]"; - gen - ("if(o.bytes===String)d%s=%j", prop, String.fromCharCode.apply(String, field.typeDefault)) - ("else{") - ("d%s=%s", prop, arrayDefault) - ("if(o.bytes!==Array)d%s=util.newBuffer(d%s)", prop, prop) - ("}"); - } else gen - ("d%s=%j", prop, field.typeDefault); // also messages (=null) - } gen - ("}"); - } - var hasKs2 = false; - for (i = 0; i < fields.length; ++i) { - var field = fields[i], - index = mtype._fieldsArray.indexOf(field), - prop = util.safeProp(field.name); - if (field.map) { - if (!hasKs2) { hasKs2 = true; gen - ("var ks2"); - } gen - ("if(m%s&&(ks2=Object.keys(m%s)).length){", prop, prop) - ("d%s={}", prop) - ("for(var j=0;j>>3){"); - - var i = 0; - for (; i < /* initializes */ mtype.fieldsArray.length; ++i) { - var field = mtype._fieldsArray[i].resolve(), - type = field.resolvedType instanceof Enum ? "int32" : field.type, - ref = "m" + util.safeProp(field.name); gen - ("case %i: {", field.id); - - // Map fields - if (field.map) { gen - ("if(%s===util.emptyObject)", ref) - ("%s={}", ref) - ("var c2 = r.uint32()+r.pos"); - - if (types.defaults[field.keyType] !== undefined) gen - ("k=%j", types.defaults[field.keyType]); - else gen - ("k=null"); - - if (types.defaults[type] !== undefined) gen - ("value=%j", types.defaults[type]); - else gen - ("value=null"); - - gen - ("while(r.pos>>3){") - ("case 1: k=r.%s(); break", field.keyType) - ("case 2:"); - - if (types.basic[type] === undefined) gen - ("value=types[%i].decode(r,r.uint32())", i); // can't be groups - else gen - ("value=r.%s()", type); - - gen - ("break") - ("default:") - ("r.skipType(tag2&7)") - ("break") - ("}") - ("}"); - - if (types.long[field.keyType] !== undefined) gen - ("%s[typeof k===\"object\"?util.longToHash(k):k]=value", ref); - else gen - ("%s[k]=value", ref); - - // Repeated fields - } else if (field.repeated) { gen - - ("if(!(%s&&%s.length))", ref, ref) - ("%s=[]", ref); - - // Packable (always check for forward and backward compatiblity) - if (types.packed[type] !== undefined) gen - ("if((t&7)===2){") - ("var c2=r.uint32()+r.pos") - ("while(r.pos>> 0, (field.id << 3 | 4) >>> 0) - : gen("types[%i].encode(%s,w.uint32(%i).fork()).ldelim()", fieldIndex, ref, (field.id << 3 | 2) >>> 0); -} - -/** - * Generates an encoder specific to the specified message type. - * @param {Type} mtype Message type - * @returns {Codegen} Codegen instance - */ -function encoder(mtype) { - /* eslint-disable no-unexpected-multiline, block-scoped-var, no-redeclare */ - var gen = util.codegen(["m", "w"], mtype.name + "$encode") - ("if(!w)") - ("w=Writer.create()"); - - var i, ref; - - // "when a message is serialized its known fields should be written sequentially by field number" - var fields = /* initializes */ mtype.fieldsArray.slice().sort(util.compareFieldsById); - - for (var i = 0; i < fields.length; ++i) { - var field = fields[i].resolve(), - index = mtype._fieldsArray.indexOf(field), - type = field.resolvedType instanceof Enum ? "int32" : field.type, - wireType = types.basic[type]; - ref = "m" + util.safeProp(field.name); - - // Map fields - if (field.map) { - gen - ("if(%s!=null&&Object.hasOwnProperty.call(m,%j)){", ref, field.name) // !== undefined && !== null - ("for(var ks=Object.keys(%s),i=0;i>> 0, 8 | types.mapKey[field.keyType], field.keyType); - if (wireType === undefined) gen - ("types[%i].encode(%s[ks[i]],w.uint32(18).fork()).ldelim().ldelim()", index, ref); // can't be groups - else gen - (".uint32(%i).%s(%s[ks[i]]).ldelim()", 16 | wireType, type, ref); - gen - ("}") - ("}"); - - // Repeated fields - } else if (field.repeated) { gen - ("if(%s!=null&&%s.length){", ref, ref); // !== undefined && !== null - - // Packed repeated - if (field.packed && types.packed[type] !== undefined) { gen - - ("w.uint32(%i).fork()", (field.id << 3 | 2) >>> 0) - ("for(var i=0;i<%s.length;++i)", ref) - ("w.%s(%s[i])", type, ref) - ("w.ldelim()"); - - // Non-packed - } else { gen - - ("for(var i=0;i<%s.length;++i)", ref); - if (wireType === undefined) - genTypePartial(gen, field, index, ref + "[i]"); - else gen - ("w.uint32(%i).%s(%s[i])", (field.id << 3 | wireType) >>> 0, type, ref); - - } gen - ("}"); - - // Non-repeated - } else { - if (field.optional) gen - ("if(%s!=null&&Object.hasOwnProperty.call(m,%j))", ref, field.name); // !== undefined && !== null - - if (wireType === undefined) - genTypePartial(gen, field, index, ref); - else gen - ("w.uint32(%i).%s(%s)", (field.id << 3 | wireType) >>> 0, type, ref); - - } - } - - return gen - ("return w"); - /* eslint-enable no-unexpected-multiline, block-scoped-var, no-redeclare */ -} - -},{"15":15,"36":36,"37":37}],15:[function(require,module,exports){ -"use strict"; -module.exports = Enum; - -// extends ReflectionObject -var ReflectionObject = require(24); -((Enum.prototype = Object.create(ReflectionObject.prototype)).constructor = Enum).className = "Enum"; - -var Namespace = require(23), - util = require(37); - -/** - * Constructs a new enum instance. - * @classdesc Reflected enum. - * @extends ReflectionObject - * @constructor - * @param {string} name Unique name within its namespace - * @param {Object.} [values] Enum values as an object, by name - * @param {Object.} [options] Declared options - * @param {string} [comment] The comment for this enum - * @param {Object.} [comments] The value comments for this enum - * @param {Object.>|undefined} [valuesOptions] The value options for this enum - */ -function Enum(name, values, options, comment, comments, valuesOptions) { - ReflectionObject.call(this, name, options); - - if (values && typeof values !== "object") - throw TypeError("values must be an object"); - - /** - * Enum values by id. - * @type {Object.} - */ - this.valuesById = {}; - - /** - * Enum values by name. - * @type {Object.} - */ - this.values = Object.create(this.valuesById); // toJSON, marker - - /** - * Enum comment text. - * @type {string|null} - */ - this.comment = comment; - - /** - * Value comment texts, if any. - * @type {Object.} - */ - this.comments = comments || {}; - - /** - * Values options, if any - * @type {Object>|undefined} - */ - this.valuesOptions = valuesOptions; - - /** - * Reserved ranges, if any. - * @type {Array.} - */ - this.reserved = undefined; // toJSON - - // Note that values inherit valuesById on their prototype which makes them a TypeScript- - // compatible enum. This is used by pbts to write actual enum definitions that work for - // static and reflection code alike instead of emitting generic object definitions. - - if (values) - for (var keys = Object.keys(values), i = 0; i < keys.length; ++i) - if (typeof values[keys[i]] === "number") // use forward entries only - this.valuesById[ this.values[keys[i]] = values[keys[i]] ] = keys[i]; -} - -/** - * Enum descriptor. - * @interface IEnum - * @property {Object.} values Enum values - * @property {Object.} [options] Enum options - */ - -/** - * Constructs an enum from an enum descriptor. - * @param {string} name Enum name - * @param {IEnum} json Enum descriptor - * @returns {Enum} Created enum - * @throws {TypeError} If arguments are invalid - */ -Enum.fromJSON = function fromJSON(name, json) { - var enm = new Enum(name, json.values, json.options, json.comment, json.comments); - enm.reserved = json.reserved; - return enm; -}; - -/** - * Converts this enum to an enum descriptor. - * @param {IToJSONOptions} [toJSONOptions] JSON conversion options - * @returns {IEnum} Enum descriptor - */ -Enum.prototype.toJSON = function toJSON(toJSONOptions) { - var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false; - return util.toObject([ - "options" , this.options, - "valuesOptions" , this.valuesOptions, - "values" , this.values, - "reserved" , this.reserved && this.reserved.length ? this.reserved : undefined, - "comment" , keepComments ? this.comment : undefined, - "comments" , keepComments ? this.comments : undefined - ]); -}; - -/** - * Adds a value to this enum. - * @param {string} name Value name - * @param {number} id Value id - * @param {string} [comment] Comment, if any - * @param {Object.|undefined} [options] Options, if any - * @returns {Enum} `this` - * @throws {TypeError} If arguments are invalid - * @throws {Error} If there is already a value with this name or id - */ -Enum.prototype.add = function add(name, id, comment, options) { - // utilized by the parser but not by .fromJSON - - if (!util.isString(name)) - throw TypeError("name must be a string"); - - if (!util.isInteger(id)) - throw TypeError("id must be an integer"); - - if (this.values[name] !== undefined) - throw Error("duplicate name '" + name + "' in " + this); - - if (this.isReservedId(id)) - throw Error("id " + id + " is reserved in " + this); - - if (this.isReservedName(name)) - throw Error("name '" + name + "' is reserved in " + this); - - if (this.valuesById[id] !== undefined) { - if (!(this.options && this.options.allow_alias)) - throw Error("duplicate id " + id + " in " + this); - this.values[name] = id; - } else - this.valuesById[this.values[name] = id] = name; - - if (options) { - if (this.valuesOptions === undefined) - this.valuesOptions = {}; - this.valuesOptions[name] = options || null; - } - - this.comments[name] = comment || null; - return this; -}; - -/** - * Removes a value from this enum - * @param {string} name Value name - * @returns {Enum} `this` - * @throws {TypeError} If arguments are invalid - * @throws {Error} If `name` is not a name of this enum - */ -Enum.prototype.remove = function remove(name) { - - if (!util.isString(name)) - throw TypeError("name must be a string"); - - var val = this.values[name]; - if (val == null) - throw Error("name '" + name + "' does not exist in " + this); - - delete this.valuesById[val]; - delete this.values[name]; - delete this.comments[name]; - if (this.valuesOptions) - delete this.valuesOptions[name]; - - return this; -}; - -/** - * Tests if the specified id is reserved. - * @param {number} id Id to test - * @returns {boolean} `true` if reserved, otherwise `false` - */ -Enum.prototype.isReservedId = function isReservedId(id) { - return Namespace.isReservedId(this.reserved, id); -}; - -/** - * Tests if the specified name is reserved. - * @param {string} name Name to test - * @returns {boolean} `true` if reserved, otherwise `false` - */ -Enum.prototype.isReservedName = function isReservedName(name) { - return Namespace.isReservedName(this.reserved, name); -}; - -},{"23":23,"24":24,"37":37}],16:[function(require,module,exports){ -"use strict"; -module.exports = Field; - -// extends ReflectionObject -var ReflectionObject = require(24); -((Field.prototype = Object.create(ReflectionObject.prototype)).constructor = Field).className = "Field"; - -var Enum = require(15), - types = require(36), - util = require(37); - -var Type; // cyclic - -var ruleRe = /^required|optional|repeated$/; - -/** - * Constructs a new message field instance. Note that {@link MapField|map fields} have their own class. - * @name Field - * @classdesc Reflected message field. - * @extends FieldBase - * @constructor - * @param {string} name Unique name within its namespace - * @param {number} id Unique id within its namespace - * @param {string} type Value type - * @param {string|Object.} [rule="optional"] Field rule - * @param {string|Object.} [extend] Extended type if different from parent - * @param {Object.} [options] Declared options - */ - -/** - * Constructs a field from a field descriptor. - * @param {string} name Field name - * @param {IField} json Field descriptor - * @returns {Field} Created field - * @throws {TypeError} If arguments are invalid - */ -Field.fromJSON = function fromJSON(name, json) { - return new Field(name, json.id, json.type, json.rule, json.extend, json.options, json.comment); -}; - -/** - * Not an actual constructor. Use {@link Field} instead. - * @classdesc Base class of all reflected message fields. This is not an actual class but here for the sake of having consistent type definitions. - * @exports FieldBase - * @extends ReflectionObject - * @constructor - * @param {string} name Unique name within its namespace - * @param {number} id Unique id within its namespace - * @param {string} type Value type - * @param {string|Object.} [rule="optional"] Field rule - * @param {string|Object.} [extend] Extended type if different from parent - * @param {Object.} [options] Declared options - * @param {string} [comment] Comment associated with this field - */ -function Field(name, id, type, rule, extend, options, comment) { - - if (util.isObject(rule)) { - comment = extend; - options = rule; - rule = extend = undefined; - } else if (util.isObject(extend)) { - comment = options; - options = extend; - extend = undefined; - } - - ReflectionObject.call(this, name, options); - - if (!util.isInteger(id) || id < 0) - throw TypeError("id must be a non-negative integer"); - - if (!util.isString(type)) - throw TypeError("type must be a string"); - - if (rule !== undefined && !ruleRe.test(rule = rule.toString().toLowerCase())) - throw TypeError("rule must be a string rule"); - - if (extend !== undefined && !util.isString(extend)) - throw TypeError("extend must be a string"); - - /** - * Field rule, if any. - * @type {string|undefined} - */ - if (rule === "proto3_optional") { - rule = "optional"; - } - this.rule = rule && rule !== "optional" ? rule : undefined; // toJSON - - /** - * Field type. - * @type {string} - */ - this.type = type; // toJSON - - /** - * Unique field id. - * @type {number} - */ - this.id = id; // toJSON, marker - - /** - * Extended type if different from parent. - * @type {string|undefined} - */ - this.extend = extend || undefined; // toJSON - - /** - * Whether this field is required. - * @type {boolean} - */ - this.required = rule === "required"; - - /** - * Whether this field is optional. - * @type {boolean} - */ - this.optional = !this.required; - - /** - * Whether this field is repeated. - * @type {boolean} - */ - this.repeated = rule === "repeated"; - - /** - * Whether this field is a map or not. - * @type {boolean} - */ - this.map = false; - - /** - * Message this field belongs to. - * @type {Type|null} - */ - this.message = null; - - /** - * OneOf this field belongs to, if any, - * @type {OneOf|null} - */ - this.partOf = null; - - /** - * The field type's default value. - * @type {*} - */ - this.typeDefault = null; - - /** - * The field's default value on prototypes. - * @type {*} - */ - this.defaultValue = null; - - /** - * Whether this field's value should be treated as a long. - * @type {boolean} - */ - this.long = util.Long ? types.long[type] !== undefined : /* istanbul ignore next */ false; - - /** - * Whether this field's value is a buffer. - * @type {boolean} - */ - this.bytes = type === "bytes"; - - /** - * Resolved type if not a basic type. - * @type {Type|Enum|null} - */ - this.resolvedType = null; - - /** - * Sister-field within the extended type if a declaring extension field. - * @type {Field|null} - */ - this.extensionField = null; - - /** - * Sister-field within the declaring namespace if an extended field. - * @type {Field|null} - */ - this.declaringField = null; - - /** - * Internally remembers whether this field is packed. - * @type {boolean|null} - * @private - */ - this._packed = null; - - /** - * Comment for this field. - * @type {string|null} - */ - this.comment = comment; -} - -/** - * Determines whether this field is packed. Only relevant when repeated and working with proto2. - * @name Field#packed - * @type {boolean} - * @readonly - */ -Object.defineProperty(Field.prototype, "packed", { - get: function() { - // defaults to packed=true if not explicity set to false - if (this._packed === null) - this._packed = this.getOption("packed") !== false; - return this._packed; - } -}); - -/** - * @override - */ -Field.prototype.setOption = function setOption(name, value, ifNotSet) { - if (name === "packed") // clear cached before setting - this._packed = null; - return ReflectionObject.prototype.setOption.call(this, name, value, ifNotSet); -}; - -/** - * Field descriptor. - * @interface IField - * @property {string} [rule="optional"] Field rule - * @property {string} type Field type - * @property {number} id Field id - * @property {Object.} [options] Field options - */ - -/** - * Extension field descriptor. - * @interface IExtensionField - * @extends IField - * @property {string} extend Extended type - */ - -/** - * Converts this field to a field descriptor. - * @param {IToJSONOptions} [toJSONOptions] JSON conversion options - * @returns {IField} Field descriptor - */ -Field.prototype.toJSON = function toJSON(toJSONOptions) { - var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false; - return util.toObject([ - "rule" , this.rule !== "optional" && this.rule || undefined, - "type" , this.type, - "id" , this.id, - "extend" , this.extend, - "options" , this.options, - "comment" , keepComments ? this.comment : undefined - ]); -}; - -/** - * Resolves this field's type references. - * @returns {Field} `this` - * @throws {Error} If any reference cannot be resolved - */ -Field.prototype.resolve = function resolve() { - - if (this.resolved) - return this; - - if ((this.typeDefault = types.defaults[this.type]) === undefined) { // if not a basic type, resolve it - this.resolvedType = (this.declaringField ? this.declaringField.parent : this.parent).lookupTypeOrEnum(this.type); - if (this.resolvedType instanceof Type) - this.typeDefault = null; - else // instanceof Enum - this.typeDefault = this.resolvedType.values[Object.keys(this.resolvedType.values)[0]]; // first defined - } else if (this.options && this.options.proto3_optional) { - // proto3 scalar value marked optional; should default to null - this.typeDefault = null; - } - - // use explicitly set default value if present - if (this.options && this.options["default"] != null) { - this.typeDefault = this.options["default"]; - if (this.resolvedType instanceof Enum && typeof this.typeDefault === "string") - this.typeDefault = this.resolvedType.values[this.typeDefault]; - } - - // remove unnecessary options - if (this.options) { - if (this.options.packed === true || this.options.packed !== undefined && this.resolvedType && !(this.resolvedType instanceof Enum)) - delete this.options.packed; - if (!Object.keys(this.options).length) - this.options = undefined; - } - - // convert to internal data type if necesssary - if (this.long) { - this.typeDefault = util.Long.fromNumber(this.typeDefault, this.type.charAt(0) === "u"); - - /* istanbul ignore else */ - if (Object.freeze) - Object.freeze(this.typeDefault); // long instances are meant to be immutable anyway (i.e. use small int cache that even requires it) - - } else if (this.bytes && typeof this.typeDefault === "string") { - var buf; - if (util.base64.test(this.typeDefault)) - util.base64.decode(this.typeDefault, buf = util.newBuffer(util.base64.length(this.typeDefault)), 0); - else - util.utf8.write(this.typeDefault, buf = util.newBuffer(util.utf8.length(this.typeDefault)), 0); - this.typeDefault = buf; - } - - // take special care of maps and repeated fields - if (this.map) - this.defaultValue = util.emptyObject; - else if (this.repeated) - this.defaultValue = util.emptyArray; - else - this.defaultValue = this.typeDefault; - - // ensure proper value on prototype - if (this.parent instanceof Type) - this.parent.ctor.prototype[this.name] = this.defaultValue; - - return ReflectionObject.prototype.resolve.call(this); -}; - -/** - * Decorator function as returned by {@link Field.d} and {@link MapField.d} (TypeScript). - * @typedef FieldDecorator - * @type {function} - * @param {Object} prototype Target prototype - * @param {string} fieldName Field name - * @returns {undefined} - */ - -/** - * Field decorator (TypeScript). - * @name Field.d - * @function - * @param {number} fieldId Field id - * @param {"double"|"float"|"int32"|"uint32"|"sint32"|"fixed32"|"sfixed32"|"int64"|"uint64"|"sint64"|"fixed64"|"sfixed64"|"string"|"bool"|"bytes"|Object} fieldType Field type - * @param {"optional"|"required"|"repeated"} [fieldRule="optional"] Field rule - * @param {T} [defaultValue] Default value - * @returns {FieldDecorator} Decorator function - * @template T extends number | number[] | Long | Long[] | string | string[] | boolean | boolean[] | Uint8Array | Uint8Array[] | Buffer | Buffer[] - */ -Field.d = function decorateField(fieldId, fieldType, fieldRule, defaultValue) { - - // submessage: decorate the submessage and use its name as the type - if (typeof fieldType === "function") - fieldType = util.decorateType(fieldType).name; - - // enum reference: create a reflected copy of the enum and keep reuseing it - else if (fieldType && typeof fieldType === "object") - fieldType = util.decorateEnum(fieldType).name; - - return function fieldDecorator(prototype, fieldName) { - util.decorateType(prototype.constructor) - .add(new Field(fieldName, fieldId, fieldType, fieldRule, { "default": defaultValue })); - }; -}; - -/** - * Field decorator (TypeScript). - * @name Field.d - * @function - * @param {number} fieldId Field id - * @param {Constructor|string} fieldType Field type - * @param {"optional"|"required"|"repeated"} [fieldRule="optional"] Field rule - * @returns {FieldDecorator} Decorator function - * @template T extends Message - * @variation 2 - */ -// like Field.d but without a default value - -// Sets up cyclic dependencies (called in index-light) -Field._configure = function configure(Type_) { - Type = Type_; -}; - -},{"15":15,"24":24,"36":36,"37":37}],17:[function(require,module,exports){ -"use strict"; -var protobuf = module.exports = require(18); - -protobuf.build = "light"; - -/** - * A node-style callback as used by {@link load} and {@link Root#load}. - * @typedef LoadCallback - * @type {function} - * @param {Error|null} error Error, if any, otherwise `null` - * @param {Root} [root] Root, if there hasn't been an error - * @returns {undefined} - */ - -/** - * Loads one or multiple .proto or preprocessed .json files into a common root namespace and calls the callback. - * @param {string|string[]} filename One or multiple files to load - * @param {Root} root Root namespace, defaults to create a new one if omitted. - * @param {LoadCallback} callback Callback function - * @returns {undefined} - * @see {@link Root#load} - */ -function load(filename, root, callback) { - if (typeof root === "function") { - callback = root; - root = new protobuf.Root(); - } else if (!root) - root = new protobuf.Root(); - return root.load(filename, callback); -} - -/** - * Loads one or multiple .proto or preprocessed .json files into a common root namespace and calls the callback. - * @name load - * @function - * @param {string|string[]} filename One or multiple files to load - * @param {LoadCallback} callback Callback function - * @returns {undefined} - * @see {@link Root#load} - * @variation 2 - */ -// function load(filename:string, callback:LoadCallback):undefined - -/** - * Loads one or multiple .proto or preprocessed .json files into a common root namespace and returns a promise. - * @name load - * @function - * @param {string|string[]} filename One or multiple files to load - * @param {Root} [root] Root namespace, defaults to create a new one if omitted. - * @returns {Promise} Promise - * @see {@link Root#load} - * @variation 3 - */ -// function load(filename:string, [root:Root]):Promise - -protobuf.load = load; - -/** - * Synchronously loads one or multiple .proto or preprocessed .json files into a common root namespace (node only). - * @param {string|string[]} filename One or multiple files to load - * @param {Root} [root] Root namespace, defaults to create a new one if omitted. - * @returns {Root} Root namespace - * @throws {Error} If synchronous fetching is not supported (i.e. in browsers) or if a file's syntax is invalid - * @see {@link Root#loadSync} - */ -function loadSync(filename, root) { - if (!root) - root = new protobuf.Root(); - return root.loadSync(filename); -} - -protobuf.loadSync = loadSync; - -// Serialization -protobuf.encoder = require(14); -protobuf.decoder = require(13); -protobuf.verifier = require(40); -protobuf.converter = require(12); - -// Reflection -protobuf.ReflectionObject = require(24); -protobuf.Namespace = require(23); -protobuf.Root = require(29); -protobuf.Enum = require(15); -protobuf.Type = require(35); -protobuf.Field = require(16); -protobuf.OneOf = require(25); -protobuf.MapField = require(20); -protobuf.Service = require(33); -protobuf.Method = require(22); - -// Runtime -protobuf.Message = require(21); -protobuf.wrappers = require(41); - -// Utility -protobuf.types = require(36); -protobuf.util = require(37); - -// Set up possibly cyclic reflection dependencies -protobuf.ReflectionObject._configure(protobuf.Root); -protobuf.Namespace._configure(protobuf.Type, protobuf.Service, protobuf.Enum); -protobuf.Root._configure(protobuf.Type); -protobuf.Field._configure(protobuf.Type); - -},{"12":12,"13":13,"14":14,"15":15,"16":16,"18":18,"20":20,"21":21,"22":22,"23":23,"24":24,"25":25,"29":29,"33":33,"35":35,"36":36,"37":37,"40":40,"41":41}],18:[function(require,module,exports){ -"use strict"; -var protobuf = exports; - -/** - * Build type, one of `"full"`, `"light"` or `"minimal"`. - * @name build - * @type {string} - * @const - */ -protobuf.build = "minimal"; - -// Serialization -protobuf.Writer = require(42); -protobuf.BufferWriter = require(43); -protobuf.Reader = require(27); -protobuf.BufferReader = require(28); - -// Utility -protobuf.util = require(39); -protobuf.rpc = require(31); -protobuf.roots = require(30); -protobuf.configure = configure; - -/* istanbul ignore next */ -/** - * Reconfigures the library according to the environment. - * @returns {undefined} - */ -function configure() { - protobuf.util._configure(); - protobuf.Writer._configure(protobuf.BufferWriter); - protobuf.Reader._configure(protobuf.BufferReader); -} - -// Set up buffer utility according to the environment -configure(); - -},{"27":27,"28":28,"30":30,"31":31,"39":39,"42":42,"43":43}],19:[function(require,module,exports){ -"use strict"; -var protobuf = module.exports = require(17); - -protobuf.build = "full"; - -// Parser -protobuf.tokenize = require(34); -protobuf.parse = require(26); -protobuf.common = require(11); - -// Configure parser -protobuf.Root._configure(protobuf.Type, protobuf.parse, protobuf.common); - -},{"11":11,"17":17,"26":26,"34":34}],20:[function(require,module,exports){ -"use strict"; -module.exports = MapField; - -// extends Field -var Field = require(16); -((MapField.prototype = Object.create(Field.prototype)).constructor = MapField).className = "MapField"; - -var types = require(36), - util = require(37); - -/** - * Constructs a new map field instance. - * @classdesc Reflected map field. - * @extends FieldBase - * @constructor - * @param {string} name Unique name within its namespace - * @param {number} id Unique id within its namespace - * @param {string} keyType Key type - * @param {string} type Value type - * @param {Object.} [options] Declared options - * @param {string} [comment] Comment associated with this field - */ -function MapField(name, id, keyType, type, options, comment) { - Field.call(this, name, id, type, undefined, undefined, options, comment); - - /* istanbul ignore if */ - if (!util.isString(keyType)) - throw TypeError("keyType must be a string"); - - /** - * Key type. - * @type {string} - */ - this.keyType = keyType; // toJSON, marker - - /** - * Resolved key type if not a basic type. - * @type {ReflectionObject|null} - */ - this.resolvedKeyType = null; - - // Overrides Field#map - this.map = true; -} - -/** - * Map field descriptor. - * @interface IMapField - * @extends {IField} - * @property {string} keyType Key type - */ - -/** - * Extension map field descriptor. - * @interface IExtensionMapField - * @extends IMapField - * @property {string} extend Extended type - */ - -/** - * Constructs a map field from a map field descriptor. - * @param {string} name Field name - * @param {IMapField} json Map field descriptor - * @returns {MapField} Created map field - * @throws {TypeError} If arguments are invalid - */ -MapField.fromJSON = function fromJSON(name, json) { - return new MapField(name, json.id, json.keyType, json.type, json.options, json.comment); -}; - -/** - * Converts this map field to a map field descriptor. - * @param {IToJSONOptions} [toJSONOptions] JSON conversion options - * @returns {IMapField} Map field descriptor - */ -MapField.prototype.toJSON = function toJSON(toJSONOptions) { - var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false; - return util.toObject([ - "keyType" , this.keyType, - "type" , this.type, - "id" , this.id, - "extend" , this.extend, - "options" , this.options, - "comment" , keepComments ? this.comment : undefined - ]); -}; - -/** - * @override - */ -MapField.prototype.resolve = function resolve() { - if (this.resolved) - return this; - - // Besides a value type, map fields have a key type that may be "any scalar type except for floating point types and bytes" - if (types.mapKey[this.keyType] === undefined) - throw Error("invalid key type: " + this.keyType); - - return Field.prototype.resolve.call(this); -}; - -/** - * Map field decorator (TypeScript). - * @name MapField.d - * @function - * @param {number} fieldId Field id - * @param {"int32"|"uint32"|"sint32"|"fixed32"|"sfixed32"|"int64"|"uint64"|"sint64"|"fixed64"|"sfixed64"|"bool"|"string"} fieldKeyType Field key type - * @param {"double"|"float"|"int32"|"uint32"|"sint32"|"fixed32"|"sfixed32"|"int64"|"uint64"|"sint64"|"fixed64"|"sfixed64"|"bool"|"string"|"bytes"|Object|Constructor<{}>} fieldValueType Field value type - * @returns {FieldDecorator} Decorator function - * @template T extends { [key: string]: number | Long | string | boolean | Uint8Array | Buffer | number[] | Message<{}> } - */ -MapField.d = function decorateMapField(fieldId, fieldKeyType, fieldValueType) { - - // submessage value: decorate the submessage and use its name as the type - if (typeof fieldValueType === "function") - fieldValueType = util.decorateType(fieldValueType).name; - - // enum reference value: create a reflected copy of the enum and keep reuseing it - else if (fieldValueType && typeof fieldValueType === "object") - fieldValueType = util.decorateEnum(fieldValueType).name; - - return function mapFieldDecorator(prototype, fieldName) { - util.decorateType(prototype.constructor) - .add(new MapField(fieldName, fieldId, fieldKeyType, fieldValueType)); - }; -}; - -},{"16":16,"36":36,"37":37}],21:[function(require,module,exports){ -"use strict"; -module.exports = Message; - -var util = require(39); - -/** - * Constructs a new message instance. - * @classdesc Abstract runtime message. - * @constructor - * @param {Properties} [properties] Properties to set - * @template T extends object = object - */ -function Message(properties) { - // not used internally - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - this[keys[i]] = properties[keys[i]]; -} - -/** - * Reference to the reflected type. - * @name Message.$type - * @type {Type} - * @readonly - */ - -/** - * Reference to the reflected type. - * @name Message#$type - * @type {Type} - * @readonly - */ - -/*eslint-disable valid-jsdoc*/ - -/** - * Creates a new message of this type using the specified properties. - * @param {Object.} [properties] Properties to set - * @returns {Message} Message instance - * @template T extends Message - * @this Constructor - */ -Message.create = function create(properties) { - return this.$type.create(properties); -}; - -/** - * Encodes a message of this type. - * @param {T|Object.} message Message to encode - * @param {Writer} [writer] Writer to use - * @returns {Writer} Writer - * @template T extends Message - * @this Constructor - */ -Message.encode = function encode(message, writer) { - return this.$type.encode(message, writer); -}; - -/** - * Encodes a message of this type preceeded by its length as a varint. - * @param {T|Object.} message Message to encode - * @param {Writer} [writer] Writer to use - * @returns {Writer} Writer - * @template T extends Message - * @this Constructor - */ -Message.encodeDelimited = function encodeDelimited(message, writer) { - return this.$type.encodeDelimited(message, writer); -}; - -/** - * Decodes a message of this type. - * @name Message.decode - * @function - * @param {Reader|Uint8Array} reader Reader or buffer to decode - * @returns {T} Decoded message - * @template T extends Message - * @this Constructor - */ -Message.decode = function decode(reader) { - return this.$type.decode(reader); -}; - -/** - * Decodes a message of this type preceeded by its length as a varint. - * @name Message.decodeDelimited - * @function - * @param {Reader|Uint8Array} reader Reader or buffer to decode - * @returns {T} Decoded message - * @template T extends Message - * @this Constructor - */ -Message.decodeDelimited = function decodeDelimited(reader) { - return this.$type.decodeDelimited(reader); -}; - -/** - * Verifies a message of this type. - * @name Message.verify - * @function - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ -Message.verify = function verify(message) { - return this.$type.verify(message); -}; - -/** - * Creates a new message of this type from a plain object. Also converts values to their respective internal types. - * @param {Object.} object Plain object - * @returns {T} Message instance - * @template T extends Message - * @this Constructor - */ -Message.fromObject = function fromObject(object) { - return this.$type.fromObject(object); -}; - -/** - * Creates a plain object from a message of this type. Also converts values to other types if specified. - * @param {T} message Message instance - * @param {IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - * @template T extends Message - * @this Constructor - */ -Message.toObject = function toObject(message, options) { - return this.$type.toObject(message, options); -}; - -/** - * Converts this message to JSON. - * @returns {Object.} JSON object - */ -Message.prototype.toJSON = function toJSON() { - return this.$type.toObject(this, util.toJSONOptions); -}; - -/*eslint-enable valid-jsdoc*/ -},{"39":39}],22:[function(require,module,exports){ -"use strict"; -module.exports = Method; - -// extends ReflectionObject -var ReflectionObject = require(24); -((Method.prototype = Object.create(ReflectionObject.prototype)).constructor = Method).className = "Method"; - -var util = require(37); - -/** - * Constructs a new service method instance. - * @classdesc Reflected service method. - * @extends ReflectionObject - * @constructor - * @param {string} name Method name - * @param {string|undefined} type Method type, usually `"rpc"` - * @param {string} requestType Request message type - * @param {string} responseType Response message type - * @param {boolean|Object.} [requestStream] Whether the request is streamed - * @param {boolean|Object.} [responseStream] Whether the response is streamed - * @param {Object.} [options] Declared options - * @param {string} [comment] The comment for this method - * @param {Object.} [parsedOptions] Declared options, properly parsed into an object - */ -function Method(name, type, requestType, responseType, requestStream, responseStream, options, comment, parsedOptions) { - - /* istanbul ignore next */ - if (util.isObject(requestStream)) { - options = requestStream; - requestStream = responseStream = undefined; - } else if (util.isObject(responseStream)) { - options = responseStream; - responseStream = undefined; - } - - /* istanbul ignore if */ - if (!(type === undefined || util.isString(type))) - throw TypeError("type must be a string"); - - /* istanbul ignore if */ - if (!util.isString(requestType)) - throw TypeError("requestType must be a string"); - - /* istanbul ignore if */ - if (!util.isString(responseType)) - throw TypeError("responseType must be a string"); - - ReflectionObject.call(this, name, options); - - /** - * Method type. - * @type {string} - */ - this.type = type || "rpc"; // toJSON - - /** - * Request type. - * @type {string} - */ - this.requestType = requestType; // toJSON, marker - - /** - * Whether requests are streamed or not. - * @type {boolean|undefined} - */ - this.requestStream = requestStream ? true : undefined; // toJSON - - /** - * Response type. - * @type {string} - */ - this.responseType = responseType; // toJSON - - /** - * Whether responses are streamed or not. - * @type {boolean|undefined} - */ - this.responseStream = responseStream ? true : undefined; // toJSON - - /** - * Resolved request type. - * @type {Type|null} - */ - this.resolvedRequestType = null; - - /** - * Resolved response type. - * @type {Type|null} - */ - this.resolvedResponseType = null; - - /** - * Comment for this method - * @type {string|null} - */ - this.comment = comment; - - /** - * Options properly parsed into an object - */ - this.parsedOptions = parsedOptions; -} - -/** - * Method descriptor. - * @interface IMethod - * @property {string} [type="rpc"] Method type - * @property {string} requestType Request type - * @property {string} responseType Response type - * @property {boolean} [requestStream=false] Whether requests are streamed - * @property {boolean} [responseStream=false] Whether responses are streamed - * @property {Object.} [options] Method options - * @property {string} comment Method comments - * @property {Object.} [parsedOptions] Method options properly parsed into an object - */ - -/** - * Constructs a method from a method descriptor. - * @param {string} name Method name - * @param {IMethod} json Method descriptor - * @returns {Method} Created method - * @throws {TypeError} If arguments are invalid - */ -Method.fromJSON = function fromJSON(name, json) { - return new Method(name, json.type, json.requestType, json.responseType, json.requestStream, json.responseStream, json.options, json.comment, json.parsedOptions); -}; - -/** - * Converts this method to a method descriptor. - * @param {IToJSONOptions} [toJSONOptions] JSON conversion options - * @returns {IMethod} Method descriptor - */ -Method.prototype.toJSON = function toJSON(toJSONOptions) { - var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false; - return util.toObject([ - "type" , this.type !== "rpc" && /* istanbul ignore next */ this.type || undefined, - "requestType" , this.requestType, - "requestStream" , this.requestStream, - "responseType" , this.responseType, - "responseStream" , this.responseStream, - "options" , this.options, - "comment" , keepComments ? this.comment : undefined, - "parsedOptions" , this.parsedOptions, - ]); -}; - -/** - * @override - */ -Method.prototype.resolve = function resolve() { - - /* istanbul ignore if */ - if (this.resolved) - return this; - - this.resolvedRequestType = this.parent.lookupType(this.requestType); - this.resolvedResponseType = this.parent.lookupType(this.responseType); - - return ReflectionObject.prototype.resolve.call(this); -}; - -},{"24":24,"37":37}],23:[function(require,module,exports){ -"use strict"; -module.exports = Namespace; - -// extends ReflectionObject -var ReflectionObject = require(24); -((Namespace.prototype = Object.create(ReflectionObject.prototype)).constructor = Namespace).className = "Namespace"; - -var Field = require(16), - util = require(37), - OneOf = require(25); - -var Type, // cyclic - Service, - Enum; - -/** - * Constructs a new namespace instance. - * @name Namespace - * @classdesc Reflected namespace. - * @extends NamespaceBase - * @constructor - * @param {string} name Namespace name - * @param {Object.} [options] Declared options - */ - -/** - * Constructs a namespace from JSON. - * @memberof Namespace - * @function - * @param {string} name Namespace name - * @param {Object.} json JSON object - * @returns {Namespace} Created namespace - * @throws {TypeError} If arguments are invalid - */ -Namespace.fromJSON = function fromJSON(name, json) { - return new Namespace(name, json.options).addJSON(json.nested); -}; - -/** - * Converts an array of reflection objects to JSON. - * @memberof Namespace - * @param {ReflectionObject[]} array Object array - * @param {IToJSONOptions} [toJSONOptions] JSON conversion options - * @returns {Object.|undefined} JSON object or `undefined` when array is empty - */ -function arrayToJSON(array, toJSONOptions) { - if (!(array && array.length)) - return undefined; - var obj = {}; - for (var i = 0; i < array.length; ++i) - obj[array[i].name] = array[i].toJSON(toJSONOptions); - return obj; -} - -Namespace.arrayToJSON = arrayToJSON; - -/** - * Tests if the specified id is reserved. - * @param {Array.|undefined} reserved Array of reserved ranges and names - * @param {number} id Id to test - * @returns {boolean} `true` if reserved, otherwise `false` - */ -Namespace.isReservedId = function isReservedId(reserved, id) { - if (reserved) - for (var i = 0; i < reserved.length; ++i) - if (typeof reserved[i] !== "string" && reserved[i][0] <= id && reserved[i][1] > id) - return true; - return false; -}; - -/** - * Tests if the specified name is reserved. - * @param {Array.|undefined} reserved Array of reserved ranges and names - * @param {string} name Name to test - * @returns {boolean} `true` if reserved, otherwise `false` - */ -Namespace.isReservedName = function isReservedName(reserved, name) { - if (reserved) - for (var i = 0; i < reserved.length; ++i) - if (reserved[i] === name) - return true; - return false; -}; - -/** - * Not an actual constructor. Use {@link Namespace} instead. - * @classdesc Base class of all reflection objects containing nested objects. This is not an actual class but here for the sake of having consistent type definitions. - * @exports NamespaceBase - * @extends ReflectionObject - * @abstract - * @constructor - * @param {string} name Namespace name - * @param {Object.} [options] Declared options - * @see {@link Namespace} - */ -function Namespace(name, options) { - ReflectionObject.call(this, name, options); - - /** - * Nested objects by name. - * @type {Object.|undefined} - */ - this.nested = undefined; // toJSON - - /** - * Cached nested objects as an array. - * @type {ReflectionObject[]|null} - * @private - */ - this._nestedArray = null; -} - -function clearCache(namespace) { - namespace._nestedArray = null; - return namespace; -} - -/** - * Nested objects of this namespace as an array for iteration. - * @name NamespaceBase#nestedArray - * @type {ReflectionObject[]} - * @readonly - */ -Object.defineProperty(Namespace.prototype, "nestedArray", { - get: function() { - return this._nestedArray || (this._nestedArray = util.toArray(this.nested)); - } -}); - -/** - * Namespace descriptor. - * @interface INamespace - * @property {Object.} [options] Namespace options - * @property {Object.} [nested] Nested object descriptors - */ - -/** - * Any extension field descriptor. - * @typedef AnyExtensionField - * @type {IExtensionField|IExtensionMapField} - */ - -/** - * Any nested object descriptor. - * @typedef AnyNestedObject - * @type {IEnum|IType|IService|AnyExtensionField|INamespace|IOneOf} - */ - -/** - * Converts this namespace to a namespace descriptor. - * @param {IToJSONOptions} [toJSONOptions] JSON conversion options - * @returns {INamespace} Namespace descriptor - */ -Namespace.prototype.toJSON = function toJSON(toJSONOptions) { - return util.toObject([ - "options" , this.options, - "nested" , arrayToJSON(this.nestedArray, toJSONOptions) - ]); -}; - -/** - * Adds nested objects to this namespace from nested object descriptors. - * @param {Object.} nestedJson Any nested object descriptors - * @returns {Namespace} `this` - */ -Namespace.prototype.addJSON = function addJSON(nestedJson) { - var ns = this; - /* istanbul ignore else */ - if (nestedJson) { - for (var names = Object.keys(nestedJson), i = 0, nested; i < names.length; ++i) { - nested = nestedJson[names[i]]; - ns.add( // most to least likely - ( nested.fields !== undefined - ? Type.fromJSON - : nested.values !== undefined - ? Enum.fromJSON - : nested.methods !== undefined - ? Service.fromJSON - : nested.id !== undefined - ? Field.fromJSON - : Namespace.fromJSON )(names[i], nested) - ); - } - } - return this; -}; - -/** - * Gets the nested object of the specified name. - * @param {string} name Nested object name - * @returns {ReflectionObject|null} The reflection object or `null` if it doesn't exist - */ -Namespace.prototype.get = function get(name) { - return this.nested && this.nested[name] - || null; -}; - -/** - * Gets the values of the nested {@link Enum|enum} of the specified name. - * This methods differs from {@link Namespace#get|get} in that it returns an enum's values directly and throws instead of returning `null`. - * @param {string} name Nested enum name - * @returns {Object.} Enum values - * @throws {Error} If there is no such enum - */ -Namespace.prototype.getEnum = function getEnum(name) { - if (this.nested && this.nested[name] instanceof Enum) - return this.nested[name].values; - throw Error("no such enum: " + name); -}; - -/** - * Adds a nested object to this namespace. - * @param {ReflectionObject} object Nested object to add - * @returns {Namespace} `this` - * @throws {TypeError} If arguments are invalid - * @throws {Error} If there is already a nested object with this name - */ -Namespace.prototype.add = function add(object) { - - if (!(object instanceof Field && object.extend !== undefined || object instanceof Type || object instanceof OneOf || object instanceof Enum || object instanceof Service || object instanceof Namespace)) - throw TypeError("object must be a valid nested object"); - - if (!this.nested) - this.nested = {}; - else { - var prev = this.get(object.name); - if (prev) { - if (prev instanceof Namespace && object instanceof Namespace && !(prev instanceof Type || prev instanceof Service)) { - // replace plain namespace but keep existing nested elements and options - var nested = prev.nestedArray; - for (var i = 0; i < nested.length; ++i) - object.add(nested[i]); - this.remove(prev); - if (!this.nested) - this.nested = {}; - object.setOptions(prev.options, true); - - } else - throw Error("duplicate name '" + object.name + "' in " + this); - } - } - this.nested[object.name] = object; - object.onAdd(this); - return clearCache(this); -}; - -/** - * Removes a nested object from this namespace. - * @param {ReflectionObject} object Nested object to remove - * @returns {Namespace} `this` - * @throws {TypeError} If arguments are invalid - * @throws {Error} If `object` is not a member of this namespace - */ -Namespace.prototype.remove = function remove(object) { - - if (!(object instanceof ReflectionObject)) - throw TypeError("object must be a ReflectionObject"); - if (object.parent !== this) - throw Error(object + " is not a member of " + this); - - delete this.nested[object.name]; - if (!Object.keys(this.nested).length) - this.nested = undefined; - - object.onRemove(this); - return clearCache(this); -}; - -/** - * Defines additial namespaces within this one if not yet existing. - * @param {string|string[]} path Path to create - * @param {*} [json] Nested types to create from JSON - * @returns {Namespace} Pointer to the last namespace created or `this` if path is empty - */ -Namespace.prototype.define = function define(path, json) { - - if (util.isString(path)) - path = path.split("."); - else if (!Array.isArray(path)) - throw TypeError("illegal path"); - if (path && path.length && path[0] === "") - throw Error("path must be relative"); - - var ptr = this; - while (path.length > 0) { - var part = path.shift(); - if (ptr.nested && ptr.nested[part]) { - ptr = ptr.nested[part]; - if (!(ptr instanceof Namespace)) - throw Error("path conflicts with non-namespace objects"); - } else - ptr.add(ptr = new Namespace(part)); - } - if (json) - ptr.addJSON(json); - return ptr; -}; - -/** - * Resolves this namespace's and all its nested objects' type references. Useful to validate a reflection tree, but comes at a cost. - * @returns {Namespace} `this` - */ -Namespace.prototype.resolveAll = function resolveAll() { - var nested = this.nestedArray, i = 0; - while (i < nested.length) - if (nested[i] instanceof Namespace) - nested[i++].resolveAll(); - else - nested[i++].resolve(); - return this.resolve(); -}; - -/** - * Recursively looks up the reflection object matching the specified path in the scope of this namespace. - * @param {string|string[]} path Path to look up - * @param {*|Array.<*>} filterTypes Filter types, any combination of the constructors of `protobuf.Type`, `protobuf.Enum`, `protobuf.Service` etc. - * @param {boolean} [parentAlreadyChecked=false] If known, whether the parent has already been checked - * @returns {ReflectionObject|null} Looked up object or `null` if none could be found - */ -Namespace.prototype.lookup = function lookup(path, filterTypes, parentAlreadyChecked) { - - /* istanbul ignore next */ - if (typeof filterTypes === "boolean") { - parentAlreadyChecked = filterTypes; - filterTypes = undefined; - } else if (filterTypes && !Array.isArray(filterTypes)) - filterTypes = [ filterTypes ]; - - if (util.isString(path) && path.length) { - if (path === ".") - return this.root; - path = path.split("."); - } else if (!path.length) - return this; - - // Start at root if path is absolute - if (path[0] === "") - return this.root.lookup(path.slice(1), filterTypes); - - // Test if the first part matches any nested object, and if so, traverse if path contains more - var found = this.get(path[0]); - if (found) { - if (path.length === 1) { - if (!filterTypes || filterTypes.indexOf(found.constructor) > -1) - return found; - } else if (found instanceof Namespace && (found = found.lookup(path.slice(1), filterTypes, true))) - return found; - - // Otherwise try each nested namespace - } else - for (var i = 0; i < this.nestedArray.length; ++i) - if (this._nestedArray[i] instanceof Namespace && (found = this._nestedArray[i].lookup(path, filterTypes, true))) - return found; - - // If there hasn't been a match, try again at the parent - if (this.parent === null || parentAlreadyChecked) - return null; - return this.parent.lookup(path, filterTypes); -}; - -/** - * Looks up the reflection object at the specified path, relative to this namespace. - * @name NamespaceBase#lookup - * @function - * @param {string|string[]} path Path to look up - * @param {boolean} [parentAlreadyChecked=false] Whether the parent has already been checked - * @returns {ReflectionObject|null} Looked up object or `null` if none could be found - * @variation 2 - */ -// lookup(path: string, [parentAlreadyChecked: boolean]) - -/** - * Looks up the {@link Type|type} at the specified path, relative to this namespace. - * Besides its signature, this methods differs from {@link Namespace#lookup|lookup} in that it throws instead of returning `null`. - * @param {string|string[]} path Path to look up - * @returns {Type} Looked up type - * @throws {Error} If `path` does not point to a type - */ -Namespace.prototype.lookupType = function lookupType(path) { - var found = this.lookup(path, [ Type ]); - if (!found) - throw Error("no such type: " + path); - return found; -}; - -/** - * Looks up the values of the {@link Enum|enum} at the specified path, relative to this namespace. - * Besides its signature, this methods differs from {@link Namespace#lookup|lookup} in that it throws instead of returning `null`. - * @param {string|string[]} path Path to look up - * @returns {Enum} Looked up enum - * @throws {Error} If `path` does not point to an enum - */ -Namespace.prototype.lookupEnum = function lookupEnum(path) { - var found = this.lookup(path, [ Enum ]); - if (!found) - throw Error("no such Enum '" + path + "' in " + this); - return found; -}; - -/** - * Looks up the {@link Type|type} or {@link Enum|enum} at the specified path, relative to this namespace. - * Besides its signature, this methods differs from {@link Namespace#lookup|lookup} in that it throws instead of returning `null`. - * @param {string|string[]} path Path to look up - * @returns {Type} Looked up type or enum - * @throws {Error} If `path` does not point to a type or enum - */ -Namespace.prototype.lookupTypeOrEnum = function lookupTypeOrEnum(path) { - var found = this.lookup(path, [ Type, Enum ]); - if (!found) - throw Error("no such Type or Enum '" + path + "' in " + this); - return found; -}; - -/** - * Looks up the {@link Service|service} at the specified path, relative to this namespace. - * Besides its signature, this methods differs from {@link Namespace#lookup|lookup} in that it throws instead of returning `null`. - * @param {string|string[]} path Path to look up - * @returns {Service} Looked up service - * @throws {Error} If `path` does not point to a service - */ -Namespace.prototype.lookupService = function lookupService(path) { - var found = this.lookup(path, [ Service ]); - if (!found) - throw Error("no such Service '" + path + "' in " + this); - return found; -}; - -// Sets up cyclic dependencies (called in index-light) -Namespace._configure = function(Type_, Service_, Enum_) { - Type = Type_; - Service = Service_; - Enum = Enum_; -}; - -},{"16":16,"24":24,"25":25,"37":37}],24:[function(require,module,exports){ -"use strict"; -module.exports = ReflectionObject; - -ReflectionObject.className = "ReflectionObject"; - -var util = require(37); - -var Root; // cyclic - -/** - * Constructs a new reflection object instance. - * @classdesc Base class of all reflection objects. - * @constructor - * @param {string} name Object name - * @param {Object.} [options] Declared options - * @abstract - */ -function ReflectionObject(name, options) { - - if (!util.isString(name)) - throw TypeError("name must be a string"); - - if (options && !util.isObject(options)) - throw TypeError("options must be an object"); - - /** - * Options. - * @type {Object.|undefined} - */ - this.options = options; // toJSON - - /** - * Parsed Options. - * @type {Array.>|undefined} - */ - this.parsedOptions = null; - - /** - * Unique name within its namespace. - * @type {string} - */ - this.name = name; - - /** - * Parent namespace. - * @type {Namespace|null} - */ - this.parent = null; - - /** - * Whether already resolved or not. - * @type {boolean} - */ - this.resolved = false; - - /** - * Comment text, if any. - * @type {string|null} - */ - this.comment = null; - - /** - * Defining file name. - * @type {string|null} - */ - this.filename = null; -} - -Object.defineProperties(ReflectionObject.prototype, { - - /** - * Reference to the root namespace. - * @name ReflectionObject#root - * @type {Root} - * @readonly - */ - root: { - get: function() { - var ptr = this; - while (ptr.parent !== null) - ptr = ptr.parent; - return ptr; - } - }, - - /** - * Full name including leading dot. - * @name ReflectionObject#fullName - * @type {string} - * @readonly - */ - fullName: { - get: function() { - var path = [ this.name ], - ptr = this.parent; - while (ptr) { - path.unshift(ptr.name); - ptr = ptr.parent; - } - return path.join("."); - } - } -}); - -/** - * Converts this reflection object to its descriptor representation. - * @returns {Object.} Descriptor - * @abstract - */ -ReflectionObject.prototype.toJSON = /* istanbul ignore next */ function toJSON() { - throw Error(); // not implemented, shouldn't happen -}; - -/** - * Called when this object is added to a parent. - * @param {ReflectionObject} parent Parent added to - * @returns {undefined} - */ -ReflectionObject.prototype.onAdd = function onAdd(parent) { - if (this.parent && this.parent !== parent) - this.parent.remove(this); - this.parent = parent; - this.resolved = false; - var root = parent.root; - if (root instanceof Root) - root._handleAdd(this); -}; - -/** - * Called when this object is removed from a parent. - * @param {ReflectionObject} parent Parent removed from - * @returns {undefined} - */ -ReflectionObject.prototype.onRemove = function onRemove(parent) { - var root = parent.root; - if (root instanceof Root) - root._handleRemove(this); - this.parent = null; - this.resolved = false; -}; - -/** - * Resolves this objects type references. - * @returns {ReflectionObject} `this` - */ -ReflectionObject.prototype.resolve = function resolve() { - if (this.resolved) - return this; - if (this.root instanceof Root) - this.resolved = true; // only if part of a root - return this; -}; - -/** - * Gets an option value. - * @param {string} name Option name - * @returns {*} Option value or `undefined` if not set - */ -ReflectionObject.prototype.getOption = function getOption(name) { - if (this.options) - return this.options[name]; - return undefined; -}; - -/** - * Sets an option. - * @param {string} name Option name - * @param {*} value Option value - * @param {boolean} [ifNotSet] Sets the option only if it isn't currently set - * @returns {ReflectionObject} `this` - */ -ReflectionObject.prototype.setOption = function setOption(name, value, ifNotSet) { - if (!ifNotSet || !this.options || this.options[name] === undefined) - (this.options || (this.options = {}))[name] = value; - return this; -}; - -/** - * Sets a parsed option. - * @param {string} name parsed Option name - * @param {*} value Option value - * @param {string} propName dot '.' delimited full path of property within the option to set. if undefined\empty, will add a new option with that value - * @returns {ReflectionObject} `this` - */ -ReflectionObject.prototype.setParsedOption = function setParsedOption(name, value, propName) { - if (!this.parsedOptions) { - this.parsedOptions = []; - } - var parsedOptions = this.parsedOptions; - if (propName) { - // If setting a sub property of an option then try to merge it - // with an existing option - var opt = parsedOptions.find(function (opt) { - return Object.prototype.hasOwnProperty.call(opt, name); - }); - if (opt) { - // If we found an existing option - just merge the property value - var newValue = opt[name]; - util.setProperty(newValue, propName, value); - } else { - // otherwise, create a new option, set it's property and add it to the list - opt = {}; - opt[name] = util.setProperty({}, propName, value); - parsedOptions.push(opt); - } - } else { - // Always create a new option when setting the value of the option itself - var newOpt = {}; - newOpt[name] = value; - parsedOptions.push(newOpt); - } - return this; -}; - -/** - * Sets multiple options. - * @param {Object.} options Options to set - * @param {boolean} [ifNotSet] Sets an option only if it isn't currently set - * @returns {ReflectionObject} `this` - */ -ReflectionObject.prototype.setOptions = function setOptions(options, ifNotSet) { - if (options) - for (var keys = Object.keys(options), i = 0; i < keys.length; ++i) - this.setOption(keys[i], options[keys[i]], ifNotSet); - return this; -}; - -/** - * Converts this instance to its string representation. - * @returns {string} Class name[, space, full name] - */ -ReflectionObject.prototype.toString = function toString() { - var className = this.constructor.className, - fullName = this.fullName; - if (fullName.length) - return className + " " + fullName; - return className; -}; - -// Sets up cyclic dependencies (called in index-light) -ReflectionObject._configure = function(Root_) { - Root = Root_; -}; - -},{"37":37}],25:[function(require,module,exports){ -"use strict"; -module.exports = OneOf; - -// extends ReflectionObject -var ReflectionObject = require(24); -((OneOf.prototype = Object.create(ReflectionObject.prototype)).constructor = OneOf).className = "OneOf"; - -var Field = require(16), - util = require(37); - -/** - * Constructs a new oneof instance. - * @classdesc Reflected oneof. - * @extends ReflectionObject - * @constructor - * @param {string} name Oneof name - * @param {string[]|Object.} [fieldNames] Field names - * @param {Object.} [options] Declared options - * @param {string} [comment] Comment associated with this field - */ -function OneOf(name, fieldNames, options, comment) { - if (!Array.isArray(fieldNames)) { - options = fieldNames; - fieldNames = undefined; - } - ReflectionObject.call(this, name, options); - - /* istanbul ignore if */ - if (!(fieldNames === undefined || Array.isArray(fieldNames))) - throw TypeError("fieldNames must be an Array"); - - /** - * Field names that belong to this oneof. - * @type {string[]} - */ - this.oneof = fieldNames || []; // toJSON, marker - - /** - * Fields that belong to this oneof as an array for iteration. - * @type {Field[]} - * @readonly - */ - this.fieldsArray = []; // declared readonly for conformance, possibly not yet added to parent - - /** - * Comment for this field. - * @type {string|null} - */ - this.comment = comment; -} - -/** - * Oneof descriptor. - * @interface IOneOf - * @property {Array.} oneof Oneof field names - * @property {Object.} [options] Oneof options - */ - -/** - * Constructs a oneof from a oneof descriptor. - * @param {string} name Oneof name - * @param {IOneOf} json Oneof descriptor - * @returns {OneOf} Created oneof - * @throws {TypeError} If arguments are invalid - */ -OneOf.fromJSON = function fromJSON(name, json) { - return new OneOf(name, json.oneof, json.options, json.comment); -}; - -/** - * Converts this oneof to a oneof descriptor. - * @param {IToJSONOptions} [toJSONOptions] JSON conversion options - * @returns {IOneOf} Oneof descriptor - */ -OneOf.prototype.toJSON = function toJSON(toJSONOptions) { - var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false; - return util.toObject([ - "options" , this.options, - "oneof" , this.oneof, - "comment" , keepComments ? this.comment : undefined - ]); -}; - -/** - * Adds the fields of the specified oneof to the parent if not already done so. - * @param {OneOf} oneof The oneof - * @returns {undefined} - * @inner - * @ignore - */ -function addFieldsToParent(oneof) { - if (oneof.parent) - for (var i = 0; i < oneof.fieldsArray.length; ++i) - if (!oneof.fieldsArray[i].parent) - oneof.parent.add(oneof.fieldsArray[i]); -} - -/** - * Adds a field to this oneof and removes it from its current parent, if any. - * @param {Field} field Field to add - * @returns {OneOf} `this` - */ -OneOf.prototype.add = function add(field) { - - /* istanbul ignore if */ - if (!(field instanceof Field)) - throw TypeError("field must be a Field"); - - if (field.parent && field.parent !== this.parent) - field.parent.remove(field); - this.oneof.push(field.name); - this.fieldsArray.push(field); - field.partOf = this; // field.parent remains null - addFieldsToParent(this); - return this; -}; - -/** - * Removes a field from this oneof and puts it back to the oneof's parent. - * @param {Field} field Field to remove - * @returns {OneOf} `this` - */ -OneOf.prototype.remove = function remove(field) { - - /* istanbul ignore if */ - if (!(field instanceof Field)) - throw TypeError("field must be a Field"); - - var index = this.fieldsArray.indexOf(field); - - /* istanbul ignore if */ - if (index < 0) - throw Error(field + " is not a member of " + this); - - this.fieldsArray.splice(index, 1); - index = this.oneof.indexOf(field.name); - - /* istanbul ignore else */ - if (index > -1) // theoretical - this.oneof.splice(index, 1); - - field.partOf = null; - return this; -}; - -/** - * @override - */ -OneOf.prototype.onAdd = function onAdd(parent) { - ReflectionObject.prototype.onAdd.call(this, parent); - var self = this; - // Collect present fields - for (var i = 0; i < this.oneof.length; ++i) { - var field = parent.get(this.oneof[i]); - if (field && !field.partOf) { - field.partOf = self; - self.fieldsArray.push(field); - } - } - // Add not yet present fields - addFieldsToParent(this); -}; - -/** - * @override - */ -OneOf.prototype.onRemove = function onRemove(parent) { - for (var i = 0, field; i < this.fieldsArray.length; ++i) - if ((field = this.fieldsArray[i]).parent) - field.parent.remove(field); - ReflectionObject.prototype.onRemove.call(this, parent); -}; - -/** - * Decorator function as returned by {@link OneOf.d} (TypeScript). - * @typedef OneOfDecorator - * @type {function} - * @param {Object} prototype Target prototype - * @param {string} oneofName OneOf name - * @returns {undefined} - */ - -/** - * OneOf decorator (TypeScript). - * @function - * @param {...string} fieldNames Field names - * @returns {OneOfDecorator} Decorator function - * @template T extends string - */ -OneOf.d = function decorateOneOf() { - var fieldNames = new Array(arguments.length), - index = 0; - while (index < arguments.length) - fieldNames[index] = arguments[index++]; - return function oneOfDecorator(prototype, oneofName) { - util.decorateType(prototype.constructor) - .add(new OneOf(oneofName, fieldNames)); - Object.defineProperty(prototype, oneofName, { - get: util.oneOfGetter(fieldNames), - set: util.oneOfSetter(fieldNames) - }); - }; -}; - -},{"16":16,"24":24,"37":37}],26:[function(require,module,exports){ -"use strict"; -module.exports = parse; - -parse.filename = null; -parse.defaults = { keepCase: false }; - -var tokenize = require(34), - Root = require(29), - Type = require(35), - Field = require(16), - MapField = require(20), - OneOf = require(25), - Enum = require(15), - Service = require(33), - Method = require(22), - types = require(36), - util = require(37); - -var base10Re = /^[1-9][0-9]*$/, - base10NegRe = /^-?[1-9][0-9]*$/, - base16Re = /^0[x][0-9a-fA-F]+$/, - base16NegRe = /^-?0[x][0-9a-fA-F]+$/, - base8Re = /^0[0-7]+$/, - base8NegRe = /^-?0[0-7]+$/, - numberRe = /^(?![eE])[0-9]*(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?$/, - nameRe = /^[a-zA-Z_][a-zA-Z_0-9]*$/, - typeRefRe = /^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)(?:\.[a-zA-Z_][a-zA-Z_0-9]*)*$/, - fqTypeRefRe = /^(?:\.[a-zA-Z_][a-zA-Z_0-9]*)+$/; - -/** - * Result object returned from {@link parse}. - * @interface IParserResult - * @property {string|undefined} package Package name, if declared - * @property {string[]|undefined} imports Imports, if any - * @property {string[]|undefined} weakImports Weak imports, if any - * @property {string|undefined} syntax Syntax, if specified (either `"proto2"` or `"proto3"`) - * @property {Root} root Populated root instance - */ - -/** - * Options modifying the behavior of {@link parse}. - * @interface IParseOptions - * @property {boolean} [keepCase=false] Keeps field casing instead of converting to camel case - * @property {boolean} [alternateCommentMode=false] Recognize double-slash comments in addition to doc-block comments. - * @property {boolean} [preferTrailingComment=false] Use trailing comment when both leading comment and trailing comment exist. - */ - -/** - * Options modifying the behavior of JSON serialization. - * @interface IToJSONOptions - * @property {boolean} [keepComments=false] Serializes comments. - */ - -/** - * Parses the given .proto source and returns an object with the parsed contents. - * @param {string} source Source contents - * @param {Root} root Root to populate - * @param {IParseOptions} [options] Parse options. Defaults to {@link parse.defaults} when omitted. - * @returns {IParserResult} Parser result - * @property {string} filename=null Currently processing file name for error reporting, if known - * @property {IParseOptions} defaults Default {@link IParseOptions} - */ -function parse(source, root, options) { - /* eslint-disable callback-return */ - if (!(root instanceof Root)) { - options = root; - root = new Root(); - } - if (!options) - options = parse.defaults; - - var preferTrailingComment = options.preferTrailingComment || false; - var tn = tokenize(source, options.alternateCommentMode || false), - next = tn.next, - push = tn.push, - peek = tn.peek, - skip = tn.skip, - cmnt = tn.cmnt; - - var head = true, - pkg, - imports, - weakImports, - syntax, - isProto3 = false; - - var ptr = root; - - var applyCase = options.keepCase ? function(name) { return name; } : util.camelCase; - - /* istanbul ignore next */ - function illegal(token, name, insideTryCatch) { - var filename = parse.filename; - if (!insideTryCatch) - parse.filename = null; - return Error("illegal " + (name || "token") + " '" + token + "' (" + (filename ? filename + ", " : "") + "line " + tn.line + ")"); - } - - function readString() { - var values = [], - token; - do { - /* istanbul ignore if */ - if ((token = next()) !== "\"" && token !== "'") - throw illegal(token); - - values.push(next()); - skip(token); - token = peek(); - } while (token === "\"" || token === "'"); - return values.join(""); - } - - function readValue(acceptTypeRef) { - var token = next(); - switch (token) { - case "'": - case "\"": - push(token); - return readString(); - case "true": case "TRUE": - return true; - case "false": case "FALSE": - return false; - } - try { - return parseNumber(token, /* insideTryCatch */ true); - } catch (e) { - - /* istanbul ignore else */ - if (acceptTypeRef && typeRefRe.test(token)) - return token; - - /* istanbul ignore next */ - throw illegal(token, "value"); - } - } - - function readRanges(target, acceptStrings) { - var token, start; - do { - if (acceptStrings && ((token = peek()) === "\"" || token === "'")) - target.push(readString()); - else - target.push([ start = parseId(next()), skip("to", true) ? parseId(next()) : start ]); - } while (skip(",", true)); - skip(";"); - } - - function parseNumber(token, insideTryCatch) { - var sign = 1; - if (token.charAt(0) === "-") { - sign = -1; - token = token.substring(1); - } - switch (token) { - case "inf": case "INF": case "Inf": - return sign * Infinity; - case "nan": case "NAN": case "Nan": case "NaN": - return NaN; - case "0": - return 0; - } - if (base10Re.test(token)) - return sign * parseInt(token, 10); - if (base16Re.test(token)) - return sign * parseInt(token, 16); - if (base8Re.test(token)) - return sign * parseInt(token, 8); - - /* istanbul ignore else */ - if (numberRe.test(token)) - return sign * parseFloat(token); - - /* istanbul ignore next */ - throw illegal(token, "number", insideTryCatch); - } - - function parseId(token, acceptNegative) { - switch (token) { - case "max": case "MAX": case "Max": - return 536870911; - case "0": - return 0; - } - - /* istanbul ignore if */ - if (!acceptNegative && token.charAt(0) === "-") - throw illegal(token, "id"); - - if (base10NegRe.test(token)) - return parseInt(token, 10); - if (base16NegRe.test(token)) - return parseInt(token, 16); - - /* istanbul ignore else */ - if (base8NegRe.test(token)) - return parseInt(token, 8); - - /* istanbul ignore next */ - throw illegal(token, "id"); - } - - function parsePackage() { - - /* istanbul ignore if */ - if (pkg !== undefined) - throw illegal("package"); - - pkg = next(); - - /* istanbul ignore if */ - if (!typeRefRe.test(pkg)) - throw illegal(pkg, "name"); - - ptr = ptr.define(pkg); - skip(";"); - } - - function parseImport() { - var token = peek(); - var whichImports; - switch (token) { - case "weak": - whichImports = weakImports || (weakImports = []); - next(); - break; - case "public": - next(); - // eslint-disable-line no-fallthrough - default: - whichImports = imports || (imports = []); - break; - } - token = readString(); - skip(";"); - whichImports.push(token); - } - - function parseSyntax() { - skip("="); - syntax = readString(); - isProto3 = syntax === "proto3"; - - /* istanbul ignore if */ - if (!isProto3 && syntax !== "proto2") - throw illegal(syntax, "syntax"); - - skip(";"); - } - - function parseCommon(parent, token) { - switch (token) { - - case "option": - parseOption(parent, token); - skip(";"); - return true; - - case "message": - parseType(parent, token); - return true; - - case "enum": - parseEnum(parent, token); - return true; - - case "service": - parseService(parent, token); - return true; - - case "extend": - parseExtension(parent, token); - return true; - } - return false; - } - - function ifBlock(obj, fnIf, fnElse) { - var trailingLine = tn.line; - if (obj) { - if(typeof obj.comment !== "string") { - obj.comment = cmnt(); // try block-type comment - } - obj.filename = parse.filename; - } - if (skip("{", true)) { - var token; - while ((token = next()) !== "}") - fnIf(token); - skip(";", true); - } else { - if (fnElse) - fnElse(); - skip(";"); - if (obj && (typeof obj.comment !== "string" || preferTrailingComment)) - obj.comment = cmnt(trailingLine) || obj.comment; // try line-type comment - } - } - - function parseType(parent, token) { - - /* istanbul ignore if */ - if (!nameRe.test(token = next())) - throw illegal(token, "type name"); - - var type = new Type(token); - ifBlock(type, function parseType_block(token) { - if (parseCommon(type, token)) - return; - - switch (token) { - - case "map": - parseMapField(type, token); - break; - - case "required": - case "repeated": - parseField(type, token); - break; - - case "optional": - /* istanbul ignore if */ - if (isProto3) { - parseField(type, "proto3_optional"); - } else { - parseField(type, "optional"); - } - break; - - case "oneof": - parseOneOf(type, token); - break; - - case "extensions": - readRanges(type.extensions || (type.extensions = [])); - break; - - case "reserved": - readRanges(type.reserved || (type.reserved = []), true); - break; - - default: - /* istanbul ignore if */ - if (!isProto3 || !typeRefRe.test(token)) - throw illegal(token); - - push(token); - parseField(type, "optional"); - break; - } - }); - parent.add(type); - } - - function parseField(parent, rule, extend) { - var type = next(); - if (type === "group") { - parseGroup(parent, rule); - return; - } - - /* istanbul ignore if */ - if (!typeRefRe.test(type)) - throw illegal(type, "type"); - - var name = next(); - - /* istanbul ignore if */ - if (!nameRe.test(name)) - throw illegal(name, "name"); - - name = applyCase(name); - skip("="); - - var field = new Field(name, parseId(next()), type, rule, extend); - ifBlock(field, function parseField_block(token) { - - /* istanbul ignore else */ - if (token === "option") { - parseOption(field, token); - skip(";"); - } else - throw illegal(token); - - }, function parseField_line() { - parseInlineOptions(field); - }); - - if (rule === "proto3_optional") { - // for proto3 optional fields, we create a single-member Oneof to mimic "optional" behavior - var oneof = new OneOf("_" + name); - field.setOption("proto3_optional", true); - oneof.add(field); - parent.add(oneof); - } else { - parent.add(field); - } - - // JSON defaults to packed=true if not set so we have to set packed=false explicity when - // parsing proto2 descriptors without the option, where applicable. This must be done for - // all known packable types and anything that could be an enum (= is not a basic type). - if (!isProto3 && field.repeated && (types.packed[type] !== undefined || types.basic[type] === undefined)) - field.setOption("packed", false, /* ifNotSet */ true); - } - - function parseGroup(parent, rule) { - var name = next(); - - /* istanbul ignore if */ - if (!nameRe.test(name)) - throw illegal(name, "name"); - - var fieldName = util.lcFirst(name); - if (name === fieldName) - name = util.ucFirst(name); - skip("="); - var id = parseId(next()); - var type = new Type(name); - type.group = true; - var field = new Field(fieldName, id, name, rule); - field.filename = parse.filename; - ifBlock(type, function parseGroup_block(token) { - switch (token) { - - case "option": - parseOption(type, token); - skip(";"); - break; - - case "required": - case "repeated": - parseField(type, token); - break; - - case "optional": - /* istanbul ignore if */ - if (isProto3) { - parseField(type, "proto3_optional"); - } else { - parseField(type, "optional"); - } - break; - - case "message": - parseType(type, token); - break; - - case "enum": - parseEnum(type, token); - break; - - /* istanbul ignore next */ - default: - throw illegal(token); // there are no groups with proto3 semantics - } - }); - parent.add(type) - .add(field); - } - - function parseMapField(parent) { - skip("<"); - var keyType = next(); - - /* istanbul ignore if */ - if (types.mapKey[keyType] === undefined) - throw illegal(keyType, "type"); - - skip(","); - var valueType = next(); - - /* istanbul ignore if */ - if (!typeRefRe.test(valueType)) - throw illegal(valueType, "type"); - - skip(">"); - var name = next(); - - /* istanbul ignore if */ - if (!nameRe.test(name)) - throw illegal(name, "name"); - - skip("="); - var field = new MapField(applyCase(name), parseId(next()), keyType, valueType); - ifBlock(field, function parseMapField_block(token) { - - /* istanbul ignore else */ - if (token === "option") { - parseOption(field, token); - skip(";"); - } else - throw illegal(token); - - }, function parseMapField_line() { - parseInlineOptions(field); - }); - parent.add(field); - } - - function parseOneOf(parent, token) { - - /* istanbul ignore if */ - if (!nameRe.test(token = next())) - throw illegal(token, "name"); - - var oneof = new OneOf(applyCase(token)); - ifBlock(oneof, function parseOneOf_block(token) { - if (token === "option") { - parseOption(oneof, token); - skip(";"); - } else { - push(token); - parseField(oneof, "optional"); - } - }); - parent.add(oneof); - } - - function parseEnum(parent, token) { - - /* istanbul ignore if */ - if (!nameRe.test(token = next())) - throw illegal(token, "name"); - - var enm = new Enum(token); - ifBlock(enm, function parseEnum_block(token) { - switch(token) { - case "option": - parseOption(enm, token); - skip(";"); - break; - - case "reserved": - readRanges(enm.reserved || (enm.reserved = []), true); - break; - - default: - parseEnumValue(enm, token); - } - }); - parent.add(enm); - } - - function parseEnumValue(parent, token) { - - /* istanbul ignore if */ - if (!nameRe.test(token)) - throw illegal(token, "name"); - - skip("="); - var value = parseId(next(), true), - dummy = { - options: undefined - }; - dummy.setOption = function(name, value) { - if (this.options === undefined) - this.options = {}; - this.options[name] = value; - }; - ifBlock(dummy, function parseEnumValue_block(token) { - - /* istanbul ignore else */ - if (token === "option") { - parseOption(dummy, token); // skip - skip(";"); - } else - throw illegal(token); - - }, function parseEnumValue_line() { - parseInlineOptions(dummy); // skip - }); - parent.add(token, value, dummy.comment, dummy.options); - } - - function parseOption(parent, token) { - var isCustom = skip("(", true); - - /* istanbul ignore if */ - if (!typeRefRe.test(token = next())) - throw illegal(token, "name"); - - var name = token; - var option = name; - var propName; - - if (isCustom) { - skip(")"); - name = "(" + name + ")"; - option = name; - token = peek(); - if (fqTypeRefRe.test(token)) { - propName = token.slice(1); //remove '.' before property name - name += token; - next(); - } - } - skip("="); - var optionValue = parseOptionValue(parent, name); - setParsedOption(parent, option, optionValue, propName); - } - - function parseOptionValue(parent, name) { - // { a: "foo" b { c: "bar" } } - if (skip("{", true)) { - var objectResult = {}; - - while (!skip("}", true)) { - /* istanbul ignore if */ - if (!nameRe.test(token = next())) { - throw illegal(token, "name"); - } - - var value; - var propName = token; - - skip(":", true); - - if (peek() === "{") - value = parseOptionValue(parent, name + "." + token); - else if (peek() === "[") { - // option (my_option) = { - // repeated_value: [ "foo", "bar" ] - // }; - value = []; - var lastValue; - if (skip("[", true)) { - do { - lastValue = readValue(true); - value.push(lastValue); - } while (skip(",", true)); - skip("]"); - if (typeof lastValue !== "undefined") { - setOption(parent, name + "." + token, lastValue); - } - } - } else { - value = readValue(true); - setOption(parent, name + "." + token, value); - } - - var prevValue = objectResult[propName]; - - if (prevValue) - value = [].concat(prevValue).concat(value); - - objectResult[propName] = value; - - // Semicolons and commas can be optional - skip(",", true); - skip(";", true); - } - - return objectResult; - } - - var simpleValue = readValue(true); - setOption(parent, name, simpleValue); - return simpleValue; - // Does not enforce a delimiter to be universal - } - - function setOption(parent, name, value) { - if (parent.setOption) - parent.setOption(name, value); - } - - function setParsedOption(parent, name, value, propName) { - if (parent.setParsedOption) - parent.setParsedOption(name, value, propName); - } - - function parseInlineOptions(parent) { - if (skip("[", true)) { - do { - parseOption(parent, "option"); - } while (skip(",", true)); - skip("]"); - } - return parent; - } - - function parseService(parent, token) { - - /* istanbul ignore if */ - if (!nameRe.test(token = next())) - throw illegal(token, "service name"); - - var service = new Service(token); - ifBlock(service, function parseService_block(token) { - if (parseCommon(service, token)) - return; - - /* istanbul ignore else */ - if (token === "rpc") - parseMethod(service, token); - else - throw illegal(token); - }); - parent.add(service); - } - - function parseMethod(parent, token) { - // Get the comment of the preceding line now (if one exists) in case the - // method is defined across multiple lines. - var commentText = cmnt(); - - var type = token; - - /* istanbul ignore if */ - if (!nameRe.test(token = next())) - throw illegal(token, "name"); - - var name = token, - requestType, requestStream, - responseType, responseStream; - - skip("("); - if (skip("stream", true)) - requestStream = true; - - /* istanbul ignore if */ - if (!typeRefRe.test(token = next())) - throw illegal(token); - - requestType = token; - skip(")"); skip("returns"); skip("("); - if (skip("stream", true)) - responseStream = true; - - /* istanbul ignore if */ - if (!typeRefRe.test(token = next())) - throw illegal(token); - - responseType = token; - skip(")"); - - var method = new Method(name, type, requestType, responseType, requestStream, responseStream); - method.comment = commentText; - ifBlock(method, function parseMethod_block(token) { - - /* istanbul ignore else */ - if (token === "option") { - parseOption(method, token); - skip(";"); - } else - throw illegal(token); - - }); - parent.add(method); - } - - function parseExtension(parent, token) { - - /* istanbul ignore if */ - if (!typeRefRe.test(token = next())) - throw illegal(token, "reference"); - - var reference = token; - ifBlock(null, function parseExtension_block(token) { - switch (token) { - - case "required": - case "repeated": - parseField(parent, token, reference); - break; - - case "optional": - /* istanbul ignore if */ - if (isProto3) { - parseField(parent, "proto3_optional", reference); - } else { - parseField(parent, "optional", reference); - } - break; - - default: - /* istanbul ignore if */ - if (!isProto3 || !typeRefRe.test(token)) - throw illegal(token); - push(token); - parseField(parent, "optional", reference); - break; - } - }); - } - - var token; - while ((token = next()) !== null) { - switch (token) { - - case "package": - - /* istanbul ignore if */ - if (!head) - throw illegal(token); - - parsePackage(); - break; - - case "import": - - /* istanbul ignore if */ - if (!head) - throw illegal(token); - - parseImport(); - break; - - case "syntax": - - /* istanbul ignore if */ - if (!head) - throw illegal(token); - - parseSyntax(); - break; - - case "option": - - parseOption(ptr, token); - skip(";"); - break; - - default: - - /* istanbul ignore else */ - if (parseCommon(ptr, token)) { - head = false; - continue; - } - - /* istanbul ignore next */ - throw illegal(token); - } - } - - parse.filename = null; - return { - "package" : pkg, - "imports" : imports, - weakImports : weakImports, - syntax : syntax, - root : root - }; -} - -/** - * Parses the given .proto source and returns an object with the parsed contents. - * @name parse - * @function - * @param {string} source Source contents - * @param {IParseOptions} [options] Parse options. Defaults to {@link parse.defaults} when omitted. - * @returns {IParserResult} Parser result - * @property {string} filename=null Currently processing file name for error reporting, if known - * @property {IParseOptions} defaults Default {@link IParseOptions} - * @variation 2 - */ - -},{"15":15,"16":16,"20":20,"22":22,"25":25,"29":29,"33":33,"34":34,"35":35,"36":36,"37":37}],27:[function(require,module,exports){ -"use strict"; -module.exports = Reader; - -var util = require(39); - -var BufferReader; // cyclic - -var LongBits = util.LongBits, - utf8 = util.utf8; - -/* istanbul ignore next */ -function indexOutOfRange(reader, writeLength) { - return RangeError("index out of range: " + reader.pos + " + " + (writeLength || 1) + " > " + reader.len); -} - -/** - * Constructs a new reader instance using the specified buffer. - * @classdesc Wire format reader using `Uint8Array` if available, otherwise `Array`. - * @constructor - * @param {Uint8Array} buffer Buffer to read from - */ -function Reader(buffer) { - - /** - * Read buffer. - * @type {Uint8Array} - */ - this.buf = buffer; - - /** - * Read buffer position. - * @type {number} - */ - this.pos = 0; - - /** - * Read buffer length. - * @type {number} - */ - this.len = buffer.length; -} - -var create_array = typeof Uint8Array !== "undefined" - ? function create_typed_array(buffer) { - if (buffer instanceof Uint8Array || Array.isArray(buffer)) - return new Reader(buffer); - throw Error("illegal buffer"); - } - /* istanbul ignore next */ - : function create_array(buffer) { - if (Array.isArray(buffer)) - return new Reader(buffer); - throw Error("illegal buffer"); - }; - -var create = function create() { - return util.Buffer - ? function create_buffer_setup(buffer) { - return (Reader.create = function create_buffer(buffer) { - return util.Buffer.isBuffer(buffer) - ? new BufferReader(buffer) - /* istanbul ignore next */ - : create_array(buffer); - })(buffer); - } - /* istanbul ignore next */ - : create_array; -}; - -/** - * Creates a new reader using the specified buffer. - * @function - * @param {Uint8Array|Buffer} buffer Buffer to read from - * @returns {Reader|BufferReader} A {@link BufferReader} if `buffer` is a Buffer, otherwise a {@link Reader} - * @throws {Error} If `buffer` is not a valid buffer - */ -Reader.create = create(); - -Reader.prototype._slice = util.Array.prototype.subarray || /* istanbul ignore next */ util.Array.prototype.slice; - -/** - * Reads a varint as an unsigned 32 bit value. - * @function - * @returns {number} Value read - */ -Reader.prototype.uint32 = (function read_uint32_setup() { - var value = 4294967295; // optimizer type-hint, tends to deopt otherwise (?!) - return function read_uint32() { - value = ( this.buf[this.pos] & 127 ) >>> 0; if (this.buf[this.pos++] < 128) return value; - value = (value | (this.buf[this.pos] & 127) << 7) >>> 0; if (this.buf[this.pos++] < 128) return value; - value = (value | (this.buf[this.pos] & 127) << 14) >>> 0; if (this.buf[this.pos++] < 128) return value; - value = (value | (this.buf[this.pos] & 127) << 21) >>> 0; if (this.buf[this.pos++] < 128) return value; - value = (value | (this.buf[this.pos] & 15) << 28) >>> 0; if (this.buf[this.pos++] < 128) return value; - - /* istanbul ignore if */ - if ((this.pos += 5) > this.len) { - this.pos = this.len; - throw indexOutOfRange(this, 10); - } - return value; - }; -})(); - -/** - * Reads a varint as a signed 32 bit value. - * @returns {number} Value read - */ -Reader.prototype.int32 = function read_int32() { - return this.uint32() | 0; -}; - -/** - * Reads a zig-zag encoded varint as a signed 32 bit value. - * @returns {number} Value read - */ -Reader.prototype.sint32 = function read_sint32() { - var value = this.uint32(); - return value >>> 1 ^ -(value & 1) | 0; -}; - -/* eslint-disable no-invalid-this */ - -function readLongVarint() { - // tends to deopt with local vars for octet etc. - var bits = new LongBits(0, 0); - var i = 0; - if (this.len - this.pos > 4) { // fast route (lo) - for (; i < 4; ++i) { - // 1st..4th - bits.lo = (bits.lo | (this.buf[this.pos] & 127) << i * 7) >>> 0; - if (this.buf[this.pos++] < 128) - return bits; - } - // 5th - bits.lo = (bits.lo | (this.buf[this.pos] & 127) << 28) >>> 0; - bits.hi = (bits.hi | (this.buf[this.pos] & 127) >> 4) >>> 0; - if (this.buf[this.pos++] < 128) - return bits; - i = 0; - } else { - for (; i < 3; ++i) { - /* istanbul ignore if */ - if (this.pos >= this.len) - throw indexOutOfRange(this); - // 1st..3th - bits.lo = (bits.lo | (this.buf[this.pos] & 127) << i * 7) >>> 0; - if (this.buf[this.pos++] < 128) - return bits; - } - // 4th - bits.lo = (bits.lo | (this.buf[this.pos++] & 127) << i * 7) >>> 0; - return bits; - } - if (this.len - this.pos > 4) { // fast route (hi) - for (; i < 5; ++i) { - // 6th..10th - bits.hi = (bits.hi | (this.buf[this.pos] & 127) << i * 7 + 3) >>> 0; - if (this.buf[this.pos++] < 128) - return bits; - } - } else { - for (; i < 5; ++i) { - /* istanbul ignore if */ - if (this.pos >= this.len) - throw indexOutOfRange(this); - // 6th..10th - bits.hi = (bits.hi | (this.buf[this.pos] & 127) << i * 7 + 3) >>> 0; - if (this.buf[this.pos++] < 128) - return bits; - } - } - /* istanbul ignore next */ - throw Error("invalid varint encoding"); -} - -/* eslint-enable no-invalid-this */ - -/** - * Reads a varint as a signed 64 bit value. - * @name Reader#int64 - * @function - * @returns {Long} Value read - */ - -/** - * Reads a varint as an unsigned 64 bit value. - * @name Reader#uint64 - * @function - * @returns {Long} Value read - */ - -/** - * Reads a zig-zag encoded varint as a signed 64 bit value. - * @name Reader#sint64 - * @function - * @returns {Long} Value read - */ - -/** - * Reads a varint as a boolean. - * @returns {boolean} Value read - */ -Reader.prototype.bool = function read_bool() { - return this.uint32() !== 0; -}; - -function readFixed32_end(buf, end) { // note that this uses `end`, not `pos` - return (buf[end - 4] - | buf[end - 3] << 8 - | buf[end - 2] << 16 - | buf[end - 1] << 24) >>> 0; -} - -/** - * Reads fixed 32 bits as an unsigned 32 bit integer. - * @returns {number} Value read - */ -Reader.prototype.fixed32 = function read_fixed32() { - - /* istanbul ignore if */ - if (this.pos + 4 > this.len) - throw indexOutOfRange(this, 4); - - return readFixed32_end(this.buf, this.pos += 4); -}; - -/** - * Reads fixed 32 bits as a signed 32 bit integer. - * @returns {number} Value read - */ -Reader.prototype.sfixed32 = function read_sfixed32() { - - /* istanbul ignore if */ - if (this.pos + 4 > this.len) - throw indexOutOfRange(this, 4); - - return readFixed32_end(this.buf, this.pos += 4) | 0; -}; - -/* eslint-disable no-invalid-this */ - -function readFixed64(/* this: Reader */) { - - /* istanbul ignore if */ - if (this.pos + 8 > this.len) - throw indexOutOfRange(this, 8); - - return new LongBits(readFixed32_end(this.buf, this.pos += 4), readFixed32_end(this.buf, this.pos += 4)); -} - -/* eslint-enable no-invalid-this */ - -/** - * Reads fixed 64 bits. - * @name Reader#fixed64 - * @function - * @returns {Long} Value read - */ - -/** - * Reads zig-zag encoded fixed 64 bits. - * @name Reader#sfixed64 - * @function - * @returns {Long} Value read - */ - -/** - * Reads a float (32 bit) as a number. - * @function - * @returns {number} Value read - */ -Reader.prototype.float = function read_float() { - - /* istanbul ignore if */ - if (this.pos + 4 > this.len) - throw indexOutOfRange(this, 4); - - var value = util.float.readFloatLE(this.buf, this.pos); - this.pos += 4; - return value; -}; - -/** - * Reads a double (64 bit float) as a number. - * @function - * @returns {number} Value read - */ -Reader.prototype.double = function read_double() { - - /* istanbul ignore if */ - if (this.pos + 8 > this.len) - throw indexOutOfRange(this, 4); - - var value = util.float.readDoubleLE(this.buf, this.pos); - this.pos += 8; - return value; -}; - -/** - * Reads a sequence of bytes preceeded by its length as a varint. - * @returns {Uint8Array} Value read - */ -Reader.prototype.bytes = function read_bytes() { - var length = this.uint32(), - start = this.pos, - end = this.pos + length; - - /* istanbul ignore if */ - if (end > this.len) - throw indexOutOfRange(this, length); - - this.pos += length; - if (Array.isArray(this.buf)) // plain array - return this.buf.slice(start, end); - return start === end // fix for IE 10/Win8 and others' subarray returning array of size 1 - ? new this.buf.constructor(0) - : this._slice.call(this.buf, start, end); -}; - -/** - * Reads a string preceeded by its byte length as a varint. - * @returns {string} Value read - */ -Reader.prototype.string = function read_string() { - var bytes = this.bytes(); - return utf8.read(bytes, 0, bytes.length); -}; - -/** - * Skips the specified number of bytes if specified, otherwise skips a varint. - * @param {number} [length] Length if known, otherwise a varint is assumed - * @returns {Reader} `this` - */ -Reader.prototype.skip = function skip(length) { - if (typeof length === "number") { - /* istanbul ignore if */ - if (this.pos + length > this.len) - throw indexOutOfRange(this, length); - this.pos += length; - } else { - do { - /* istanbul ignore if */ - if (this.pos >= this.len) - throw indexOutOfRange(this); - } while (this.buf[this.pos++] & 128); - } - return this; -}; - -/** - * Skips the next element of the specified wire type. - * @param {number} wireType Wire type received - * @returns {Reader} `this` - */ -Reader.prototype.skipType = function(wireType) { - switch (wireType) { - case 0: - this.skip(); - break; - case 1: - this.skip(8); - break; - case 2: - this.skip(this.uint32()); - break; - case 3: - while ((wireType = this.uint32() & 7) !== 4) { - this.skipType(wireType); - } - break; - case 5: - this.skip(4); - break; - - /* istanbul ignore next */ - default: - throw Error("invalid wire type " + wireType + " at offset " + this.pos); - } - return this; -}; - -Reader._configure = function(BufferReader_) { - BufferReader = BufferReader_; - Reader.create = create(); - BufferReader._configure(); - - var fn = util.Long ? "toLong" : /* istanbul ignore next */ "toNumber"; - util.merge(Reader.prototype, { - - int64: function read_int64() { - return readLongVarint.call(this)[fn](false); - }, - - uint64: function read_uint64() { - return readLongVarint.call(this)[fn](true); - }, - - sint64: function read_sint64() { - return readLongVarint.call(this).zzDecode()[fn](false); - }, - - fixed64: function read_fixed64() { - return readFixed64.call(this)[fn](true); - }, - - sfixed64: function read_sfixed64() { - return readFixed64.call(this)[fn](false); - } - - }); -}; - -},{"39":39}],28:[function(require,module,exports){ -"use strict"; -module.exports = BufferReader; - -// extends Reader -var Reader = require(27); -(BufferReader.prototype = Object.create(Reader.prototype)).constructor = BufferReader; - -var util = require(39); - -/** - * Constructs a new buffer reader instance. - * @classdesc Wire format reader using node buffers. - * @extends Reader - * @constructor - * @param {Buffer} buffer Buffer to read from - */ -function BufferReader(buffer) { - Reader.call(this, buffer); - - /** - * Read buffer. - * @name BufferReader#buf - * @type {Buffer} - */ -} - -BufferReader._configure = function () { - /* istanbul ignore else */ - if (util.Buffer) - BufferReader.prototype._slice = util.Buffer.prototype.slice; -}; - - -/** - * @override - */ -BufferReader.prototype.string = function read_string_buffer() { - var len = this.uint32(); // modifies pos - return this.buf.utf8Slice - ? this.buf.utf8Slice(this.pos, this.pos = Math.min(this.pos + len, this.len)) - : this.buf.toString("utf-8", this.pos, this.pos = Math.min(this.pos + len, this.len)); -}; - -/** - * Reads a sequence of bytes preceeded by its length as a varint. - * @name BufferReader#bytes - * @function - * @returns {Buffer} Value read - */ - -BufferReader._configure(); - -},{"27":27,"39":39}],29:[function(require,module,exports){ -"use strict"; -module.exports = Root; - -// extends Namespace -var Namespace = require(23); -((Root.prototype = Object.create(Namespace.prototype)).constructor = Root).className = "Root"; - -var Field = require(16), - Enum = require(15), - OneOf = require(25), - util = require(37); - -var Type, // cyclic - parse, // might be excluded - common; // " - -/** - * Constructs a new root namespace instance. - * @classdesc Root namespace wrapping all types, enums, services, sub-namespaces etc. that belong together. - * @extends NamespaceBase - * @constructor - * @param {Object.} [options] Top level options - */ -function Root(options) { - Namespace.call(this, "", options); - - /** - * Deferred extension fields. - * @type {Field[]} - */ - this.deferred = []; - - /** - * Resolved file names of loaded files. - * @type {string[]} - */ - this.files = []; -} - -/** - * Loads a namespace descriptor into a root namespace. - * @param {INamespace} json Nameespace descriptor - * @param {Root} [root] Root namespace, defaults to create a new one if omitted - * @returns {Root} Root namespace - */ -Root.fromJSON = function fromJSON(json, root) { - if (!root) - root = new Root(); - if (json.options) - root.setOptions(json.options); - return root.addJSON(json.nested); -}; - -/** - * Resolves the path of an imported file, relative to the importing origin. - * This method exists so you can override it with your own logic in case your imports are scattered over multiple directories. - * @function - * @param {string} origin The file name of the importing file - * @param {string} target The file name being imported - * @returns {string|null} Resolved path to `target` or `null` to skip the file - */ -Root.prototype.resolvePath = util.path.resolve; - -/** - * Fetch content from file path or url - * This method exists so you can override it with your own logic. - * @function - * @param {string} path File path or url - * @param {FetchCallback} callback Callback function - * @returns {undefined} - */ -Root.prototype.fetch = util.fetch; - -// A symbol-like function to safely signal synchronous loading -/* istanbul ignore next */ -function SYNC() {} // eslint-disable-line no-empty-function - -/** - * Loads one or multiple .proto or preprocessed .json files into this root namespace and calls the callback. - * @param {string|string[]} filename Names of one or multiple files to load - * @param {IParseOptions} options Parse options - * @param {LoadCallback} callback Callback function - * @returns {undefined} - */ -Root.prototype.load = function load(filename, options, callback) { - if (typeof options === "function") { - callback = options; - options = undefined; - } - var self = this; - if (!callback) - return util.asPromise(load, self, filename, options); - - var sync = callback === SYNC; // undocumented - - // Finishes loading by calling the callback (exactly once) - function finish(err, root) { - /* istanbul ignore if */ - if (!callback) - return; - var cb = callback; - callback = null; - if (sync) - throw err; - cb(err, root); - } - - // Bundled definition existence checking - function getBundledFileName(filename) { - var idx = filename.lastIndexOf("google/protobuf/"); - if (idx > -1) { - var altname = filename.substring(idx); - if (altname in common) return altname; - } - return null; - } - - // Processes a single file - function process(filename, source) { - try { - if (util.isString(source) && source.charAt(0) === "{") - source = JSON.parse(source); - if (!util.isString(source)) - self.setOptions(source.options).addJSON(source.nested); - else { - parse.filename = filename; - var parsed = parse(source, self, options), - resolved, - i = 0; - if (parsed.imports) - for (; i < parsed.imports.length; ++i) - if (resolved = getBundledFileName(parsed.imports[i]) || self.resolvePath(filename, parsed.imports[i])) - fetch(resolved); - if (parsed.weakImports) - for (i = 0; i < parsed.weakImports.length; ++i) - if (resolved = getBundledFileName(parsed.weakImports[i]) || self.resolvePath(filename, parsed.weakImports[i])) - fetch(resolved, true); - } - } catch (err) { - finish(err); - } - if (!sync && !queued) - finish(null, self); // only once anyway - } - - // Fetches a single file - function fetch(filename, weak) { - - // Skip if already loaded / attempted - if (self.files.indexOf(filename) > -1) - return; - self.files.push(filename); - - // Shortcut bundled definitions - if (filename in common) { - if (sync) - process(filename, common[filename]); - else { - ++queued; - setTimeout(function() { - --queued; - process(filename, common[filename]); - }); - } - return; - } - - // Otherwise fetch from disk or network - if (sync) { - var source; - try { - source = util.fs.readFileSync(filename).toString("utf8"); - } catch (err) { - if (!weak) - finish(err); - return; - } - process(filename, source); - } else { - ++queued; - self.fetch(filename, function(err, source) { - --queued; - /* istanbul ignore if */ - if (!callback) - return; // terminated meanwhile - if (err) { - /* istanbul ignore else */ - if (!weak) - finish(err); - else if (!queued) // can't be covered reliably - finish(null, self); - return; - } - process(filename, source); - }); - } - } - var queued = 0; - - // Assembling the root namespace doesn't require working type - // references anymore, so we can load everything in parallel - if (util.isString(filename)) - filename = [ filename ]; - for (var i = 0, resolved; i < filename.length; ++i) - if (resolved = self.resolvePath("", filename[i])) - fetch(resolved); - - if (sync) - return self; - if (!queued) - finish(null, self); - return undefined; -}; -// function load(filename:string, options:IParseOptions, callback:LoadCallback):undefined - -/** - * Loads one or multiple .proto or preprocessed .json files into this root namespace and calls the callback. - * @function Root#load - * @param {string|string[]} filename Names of one or multiple files to load - * @param {LoadCallback} callback Callback function - * @returns {undefined} - * @variation 2 - */ -// function load(filename:string, callback:LoadCallback):undefined - -/** - * Loads one or multiple .proto or preprocessed .json files into this root namespace and returns a promise. - * @function Root#load - * @param {string|string[]} filename Names of one or multiple files to load - * @param {IParseOptions} [options] Parse options. Defaults to {@link parse.defaults} when omitted. - * @returns {Promise} Promise - * @variation 3 - */ -// function load(filename:string, [options:IParseOptions]):Promise - -/** - * Synchronously loads one or multiple .proto or preprocessed .json files into this root namespace (node only). - * @function Root#loadSync - * @param {string|string[]} filename Names of one or multiple files to load - * @param {IParseOptions} [options] Parse options. Defaults to {@link parse.defaults} when omitted. - * @returns {Root} Root namespace - * @throws {Error} If synchronous fetching is not supported (i.e. in browsers) or if a file's syntax is invalid - */ -Root.prototype.loadSync = function loadSync(filename, options) { - if (!util.isNode) - throw Error("not supported"); - return this.load(filename, options, SYNC); -}; - -/** - * @override - */ -Root.prototype.resolveAll = function resolveAll() { - if (this.deferred.length) - throw Error("unresolvable extensions: " + this.deferred.map(function(field) { - return "'extend " + field.extend + "' in " + field.parent.fullName; - }).join(", ")); - return Namespace.prototype.resolveAll.call(this); -}; - -// only uppercased (and thus conflict-free) children are exposed, see below -var exposeRe = /^[A-Z]/; - -/** - * Handles a deferred declaring extension field by creating a sister field to represent it within its extended type. - * @param {Root} root Root instance - * @param {Field} field Declaring extension field witin the declaring type - * @returns {boolean} `true` if successfully added to the extended type, `false` otherwise - * @inner - * @ignore - */ -function tryHandleExtension(root, field) { - var extendedType = field.parent.lookup(field.extend); - if (extendedType) { - var sisterField = new Field(field.fullName, field.id, field.type, field.rule, undefined, field.options); - sisterField.declaringField = field; - field.extensionField = sisterField; - extendedType.add(sisterField); - return true; - } - return false; -} - -/** - * Called when any object is added to this root or its sub-namespaces. - * @param {ReflectionObject} object Object added - * @returns {undefined} - * @private - */ -Root.prototype._handleAdd = function _handleAdd(object) { - if (object instanceof Field) { - - if (/* an extension field (implies not part of a oneof) */ object.extend !== undefined && /* not already handled */ !object.extensionField) - if (!tryHandleExtension(this, object)) - this.deferred.push(object); - - } else if (object instanceof Enum) { - - if (exposeRe.test(object.name)) - object.parent[object.name] = object.values; // expose enum values as property of its parent - - } else if (!(object instanceof OneOf)) /* everything else is a namespace */ { - - if (object instanceof Type) // Try to handle any deferred extensions - for (var i = 0; i < this.deferred.length;) - if (tryHandleExtension(this, this.deferred[i])) - this.deferred.splice(i, 1); - else - ++i; - for (var j = 0; j < /* initializes */ object.nestedArray.length; ++j) // recurse into the namespace - this._handleAdd(object._nestedArray[j]); - if (exposeRe.test(object.name)) - object.parent[object.name] = object; // expose namespace as property of its parent - } - - // The above also adds uppercased (and thus conflict-free) nested types, services and enums as - // properties of namespaces just like static code does. This allows using a .d.ts generated for - // a static module with reflection-based solutions where the condition is met. -}; - -/** - * Called when any object is removed from this root or its sub-namespaces. - * @param {ReflectionObject} object Object removed - * @returns {undefined} - * @private - */ -Root.prototype._handleRemove = function _handleRemove(object) { - if (object instanceof Field) { - - if (/* an extension field */ object.extend !== undefined) { - if (/* already handled */ object.extensionField) { // remove its sister field - object.extensionField.parent.remove(object.extensionField); - object.extensionField = null; - } else { // cancel the extension - var index = this.deferred.indexOf(object); - /* istanbul ignore else */ - if (index > -1) - this.deferred.splice(index, 1); - } - } - - } else if (object instanceof Enum) { - - if (exposeRe.test(object.name)) - delete object.parent[object.name]; // unexpose enum values - - } else if (object instanceof Namespace) { - - for (var i = 0; i < /* initializes */ object.nestedArray.length; ++i) // recurse into the namespace - this._handleRemove(object._nestedArray[i]); - - if (exposeRe.test(object.name)) - delete object.parent[object.name]; // unexpose namespaces - - } -}; - -// Sets up cyclic dependencies (called in index-light) -Root._configure = function(Type_, parse_, common_) { - Type = Type_; - parse = parse_; - common = common_; -}; - -},{"15":15,"16":16,"23":23,"25":25,"37":37}],30:[function(require,module,exports){ -"use strict"; -module.exports = {}; - -/** - * Named roots. - * This is where pbjs stores generated structures (the option `-r, --root` specifies a name). - * Can also be used manually to make roots available across modules. - * @name roots - * @type {Object.} - * @example - * // pbjs -r myroot -o compiled.js ... - * - * // in another module: - * require("./compiled.js"); - * - * // in any subsequent module: - * var root = protobuf.roots["myroot"]; - */ - -},{}],31:[function(require,module,exports){ -"use strict"; - -/** - * Streaming RPC helpers. - * @namespace - */ -var rpc = exports; - -/** - * RPC implementation passed to {@link Service#create} performing a service request on network level, i.e. by utilizing http requests or websockets. - * @typedef RPCImpl - * @type {function} - * @param {Method|rpc.ServiceMethod,Message<{}>>} method Reflected or static method being called - * @param {Uint8Array} requestData Request data - * @param {RPCImplCallback} callback Callback function - * @returns {undefined} - * @example - * function rpcImpl(method, requestData, callback) { - * if (protobuf.util.lcFirst(method.name) !== "myMethod") // compatible with static code - * throw Error("no such method"); - * asynchronouslyObtainAResponse(requestData, function(err, responseData) { - * callback(err, responseData); - * }); - * } - */ - -/** - * Node-style callback as used by {@link RPCImpl}. - * @typedef RPCImplCallback - * @type {function} - * @param {Error|null} error Error, if any, otherwise `null` - * @param {Uint8Array|null} [response] Response data or `null` to signal end of stream, if there hasn't been an error - * @returns {undefined} - */ - -rpc.Service = require(32); - -},{"32":32}],32:[function(require,module,exports){ -"use strict"; -module.exports = Service; - -var util = require(39); - -// Extends EventEmitter -(Service.prototype = Object.create(util.EventEmitter.prototype)).constructor = Service; - -/** - * A service method callback as used by {@link rpc.ServiceMethod|ServiceMethod}. - * - * Differs from {@link RPCImplCallback} in that it is an actual callback of a service method which may not return `response = null`. - * @typedef rpc.ServiceMethodCallback - * @template TRes extends Message - * @type {function} - * @param {Error|null} error Error, if any - * @param {TRes} [response] Response message - * @returns {undefined} - */ - -/** - * A service method part of a {@link rpc.Service} as created by {@link Service.create}. - * @typedef rpc.ServiceMethod - * @template TReq extends Message - * @template TRes extends Message - * @type {function} - * @param {TReq|Properties} request Request message or plain object - * @param {rpc.ServiceMethodCallback} [callback] Node-style callback called with the error, if any, and the response message - * @returns {Promise>} Promise if `callback` has been omitted, otherwise `undefined` - */ - -/** - * Constructs a new RPC service instance. - * @classdesc An RPC service as returned by {@link Service#create}. - * @exports rpc.Service - * @extends util.EventEmitter - * @constructor - * @param {RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - */ -function Service(rpcImpl, requestDelimited, responseDelimited) { - - if (typeof rpcImpl !== "function") - throw TypeError("rpcImpl must be a function"); - - util.EventEmitter.call(this); - - /** - * RPC implementation. Becomes `null` once the service is ended. - * @type {RPCImpl|null} - */ - this.rpcImpl = rpcImpl; - - /** - * Whether requests are length-delimited. - * @type {boolean} - */ - this.requestDelimited = Boolean(requestDelimited); - - /** - * Whether responses are length-delimited. - * @type {boolean} - */ - this.responseDelimited = Boolean(responseDelimited); -} - -/** - * Calls a service method through {@link rpc.Service#rpcImpl|rpcImpl}. - * @param {Method|rpc.ServiceMethod} method Reflected or static method - * @param {Constructor} requestCtor Request constructor - * @param {Constructor} responseCtor Response constructor - * @param {TReq|Properties} request Request message or plain object - * @param {rpc.ServiceMethodCallback} callback Service callback - * @returns {undefined} - * @template TReq extends Message - * @template TRes extends Message - */ -Service.prototype.rpcCall = function rpcCall(method, requestCtor, responseCtor, request, callback) { - - if (!request) - throw TypeError("request must be specified"); - - var self = this; - if (!callback) - return util.asPromise(rpcCall, self, method, requestCtor, responseCtor, request); - - if (!self.rpcImpl) { - setTimeout(function() { callback(Error("already ended")); }, 0); - return undefined; - } - - try { - return self.rpcImpl( - method, - requestCtor[self.requestDelimited ? "encodeDelimited" : "encode"](request).finish(), - function rpcCallback(err, response) { - - if (err) { - self.emit("error", err, method); - return callback(err); - } - - if (response === null) { - self.end(/* endedByRPC */ true); - return undefined; - } - - if (!(response instanceof responseCtor)) { - try { - response = responseCtor[self.responseDelimited ? "decodeDelimited" : "decode"](response); - } catch (err) { - self.emit("error", err, method); - return callback(err); - } - } - - self.emit("data", response, method); - return callback(null, response); - } - ); - } catch (err) { - self.emit("error", err, method); - setTimeout(function() { callback(err); }, 0); - return undefined; - } -}; - -/** - * Ends this service and emits the `end` event. - * @param {boolean} [endedByRPC=false] Whether the service has been ended by the RPC implementation. - * @returns {rpc.Service} `this` - */ -Service.prototype.end = function end(endedByRPC) { - if (this.rpcImpl) { - if (!endedByRPC) // signal end to rpcImpl - this.rpcImpl(null, null, null); - this.rpcImpl = null; - this.emit("end").off(); - } - return this; -}; - -},{"39":39}],33:[function(require,module,exports){ -"use strict"; -module.exports = Service; - -// extends Namespace -var Namespace = require(23); -((Service.prototype = Object.create(Namespace.prototype)).constructor = Service).className = "Service"; - -var Method = require(22), - util = require(37), - rpc = require(31); - -/** - * Constructs a new service instance. - * @classdesc Reflected service. - * @extends NamespaceBase - * @constructor - * @param {string} name Service name - * @param {Object.} [options] Service options - * @throws {TypeError} If arguments are invalid - */ -function Service(name, options) { - Namespace.call(this, name, options); - - /** - * Service methods. - * @type {Object.} - */ - this.methods = {}; // toJSON, marker - - /** - * Cached methods as an array. - * @type {Method[]|null} - * @private - */ - this._methodsArray = null; -} - -/** - * Service descriptor. - * @interface IService - * @extends INamespace - * @property {Object.} methods Method descriptors - */ - -/** - * Constructs a service from a service descriptor. - * @param {string} name Service name - * @param {IService} json Service descriptor - * @returns {Service} Created service - * @throws {TypeError} If arguments are invalid - */ -Service.fromJSON = function fromJSON(name, json) { - var service = new Service(name, json.options); - /* istanbul ignore else */ - if (json.methods) - for (var names = Object.keys(json.methods), i = 0; i < names.length; ++i) - service.add(Method.fromJSON(names[i], json.methods[names[i]])); - if (json.nested) - service.addJSON(json.nested); - service.comment = json.comment; - return service; -}; - -/** - * Converts this service to a service descriptor. - * @param {IToJSONOptions} [toJSONOptions] JSON conversion options - * @returns {IService} Service descriptor - */ -Service.prototype.toJSON = function toJSON(toJSONOptions) { - var inherited = Namespace.prototype.toJSON.call(this, toJSONOptions); - var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false; - return util.toObject([ - "options" , inherited && inherited.options || undefined, - "methods" , Namespace.arrayToJSON(this.methodsArray, toJSONOptions) || /* istanbul ignore next */ {}, - "nested" , inherited && inherited.nested || undefined, - "comment" , keepComments ? this.comment : undefined - ]); -}; - -/** - * Methods of this service as an array for iteration. - * @name Service#methodsArray - * @type {Method[]} - * @readonly - */ -Object.defineProperty(Service.prototype, "methodsArray", { - get: function() { - return this._methodsArray || (this._methodsArray = util.toArray(this.methods)); - } -}); - -function clearCache(service) { - service._methodsArray = null; - return service; -} - -/** - * @override - */ -Service.prototype.get = function get(name) { - return this.methods[name] - || Namespace.prototype.get.call(this, name); -}; - -/** - * @override - */ -Service.prototype.resolveAll = function resolveAll() { - var methods = this.methodsArray; - for (var i = 0; i < methods.length; ++i) - methods[i].resolve(); - return Namespace.prototype.resolve.call(this); -}; - -/** - * @override - */ -Service.prototype.add = function add(object) { - - /* istanbul ignore if */ - if (this.get(object.name)) - throw Error("duplicate name '" + object.name + "' in " + this); - - if (object instanceof Method) { - this.methods[object.name] = object; - object.parent = this; - return clearCache(this); - } - return Namespace.prototype.add.call(this, object); -}; - -/** - * @override - */ -Service.prototype.remove = function remove(object) { - if (object instanceof Method) { - - /* istanbul ignore if */ - if (this.methods[object.name] !== object) - throw Error(object + " is not a member of " + this); - - delete this.methods[object.name]; - object.parent = null; - return clearCache(this); - } - return Namespace.prototype.remove.call(this, object); -}; - -/** - * Creates a runtime service using the specified rpc implementation. - * @param {RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - * @returns {rpc.Service} RPC service. Useful where requests and/or responses are streamed. - */ -Service.prototype.create = function create(rpcImpl, requestDelimited, responseDelimited) { - var rpcService = new rpc.Service(rpcImpl, requestDelimited, responseDelimited); - for (var i = 0, method; i < /* initializes */ this.methodsArray.length; ++i) { - var methodName = util.lcFirst((method = this._methodsArray[i]).resolve().name).replace(/[^$\w_]/g, ""); - rpcService[methodName] = util.codegen(["r","c"], util.isReserved(methodName) ? methodName + "_" : methodName)("return this.rpcCall(m,q,s,r,c)")({ - m: method, - q: method.resolvedRequestType.ctor, - s: method.resolvedResponseType.ctor - }); - } - return rpcService; -}; - -},{"22":22,"23":23,"31":31,"37":37}],34:[function(require,module,exports){ -"use strict"; -module.exports = tokenize; - -var delimRe = /[\s{}=;:[\],'"()<>]/g, - stringDoubleRe = /(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g, - stringSingleRe = /(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g; - -var setCommentRe = /^ *[*/]+ */, - setCommentAltRe = /^\s*\*?\/*/, - setCommentSplitRe = /\n/g, - whitespaceRe = /\s/, - unescapeRe = /\\(.?)/g; - -var unescapeMap = { - "0": "\0", - "r": "\r", - "n": "\n", - "t": "\t" -}; - -/** - * Unescapes a string. - * @param {string} str String to unescape - * @returns {string} Unescaped string - * @property {Object.} map Special characters map - * @memberof tokenize - */ -function unescape(str) { - return str.replace(unescapeRe, function($0, $1) { - switch ($1) { - case "\\": - case "": - return $1; - default: - return unescapeMap[$1] || ""; - } - }); -} - -tokenize.unescape = unescape; - -/** - * Gets the next token and advances. - * @typedef TokenizerHandleNext - * @type {function} - * @returns {string|null} Next token or `null` on eof - */ - -/** - * Peeks for the next token. - * @typedef TokenizerHandlePeek - * @type {function} - * @returns {string|null} Next token or `null` on eof - */ - -/** - * Pushes a token back to the stack. - * @typedef TokenizerHandlePush - * @type {function} - * @param {string} token Token - * @returns {undefined} - */ - -/** - * Skips the next token. - * @typedef TokenizerHandleSkip - * @type {function} - * @param {string} expected Expected token - * @param {boolean} [optional=false] If optional - * @returns {boolean} Whether the token matched - * @throws {Error} If the token didn't match and is not optional - */ - -/** - * Gets the comment on the previous line or, alternatively, the line comment on the specified line. - * @typedef TokenizerHandleCmnt - * @type {function} - * @param {number} [line] Line number - * @returns {string|null} Comment text or `null` if none - */ - -/** - * Handle object returned from {@link tokenize}. - * @interface ITokenizerHandle - * @property {TokenizerHandleNext} next Gets the next token and advances (`null` on eof) - * @property {TokenizerHandlePeek} peek Peeks for the next token (`null` on eof) - * @property {TokenizerHandlePush} push Pushes a token back to the stack - * @property {TokenizerHandleSkip} skip Skips a token, returns its presence and advances or, if non-optional and not present, throws - * @property {TokenizerHandleCmnt} cmnt Gets the comment on the previous line or the line comment on the specified line, if any - * @property {number} line Current line number - */ - -/** - * Tokenizes the given .proto source and returns an object with useful utility functions. - * @param {string} source Source contents - * @param {boolean} alternateCommentMode Whether we should activate alternate comment parsing mode. - * @returns {ITokenizerHandle} Tokenizer handle - */ -function tokenize(source, alternateCommentMode) { - /* eslint-disable callback-return */ - source = source.toString(); - - var offset = 0, - length = source.length, - line = 1, - lastCommentLine = 0, - comments = {}; - - var stack = []; - - var stringDelim = null; - - /* istanbul ignore next */ - /** - * Creates an error for illegal syntax. - * @param {string} subject Subject - * @returns {Error} Error created - * @inner - */ - function illegal(subject) { - return Error("illegal " + subject + " (line " + line + ")"); - } - - /** - * Reads a string till its end. - * @returns {string} String read - * @inner - */ - function readString() { - var re = stringDelim === "'" ? stringSingleRe : stringDoubleRe; - re.lastIndex = offset - 1; - var match = re.exec(source); - if (!match) - throw illegal("string"); - offset = re.lastIndex; - push(stringDelim); - stringDelim = null; - return unescape(match[1]); - } - - /** - * Gets the character at `pos` within the source. - * @param {number} pos Position - * @returns {string} Character - * @inner - */ - function charAt(pos) { - return source.charAt(pos); - } - - /** - * Sets the current comment text. - * @param {number} start Start offset - * @param {number} end End offset - * @param {boolean} isLeading set if a leading comment - * @returns {undefined} - * @inner - */ - function setComment(start, end, isLeading) { - var comment = { - type: source.charAt(start++), - lineEmpty: false, - leading: isLeading, - }; - var lookback; - if (alternateCommentMode) { - lookback = 2; // alternate comment parsing: "//" or "/*" - } else { - lookback = 3; // "///" or "/**" - } - var commentOffset = start - lookback, - c; - do { - if (--commentOffset < 0 || - (c = source.charAt(commentOffset)) === "\n") { - comment.lineEmpty = true; - break; - } - } while (c === " " || c === "\t"); - var lines = source - .substring(start, end) - .split(setCommentSplitRe); - for (var i = 0; i < lines.length; ++i) - lines[i] = lines[i] - .replace(alternateCommentMode ? setCommentAltRe : setCommentRe, "") - .trim(); - comment.text = lines - .join("\n") - .trim(); - - comments[line] = comment; - lastCommentLine = line; - } - - function isDoubleSlashCommentLine(startOffset) { - var endOffset = findEndOfLine(startOffset); - - // see if remaining line matches comment pattern - var lineText = source.substring(startOffset, endOffset); - // look for 1 or 2 slashes since startOffset would already point past - // the first slash that started the comment. - var isComment = /^\s*\/{1,2}/.test(lineText); - return isComment; - } - - function findEndOfLine(cursor) { - // find end of cursor's line - var endOffset = cursor; - while (endOffset < length && charAt(endOffset) !== "\n") { - endOffset++; - } - return endOffset; - } - - /** - * Obtains the next token. - * @returns {string|null} Next token or `null` on eof - * @inner - */ - function next() { - if (stack.length > 0) - return stack.shift(); - if (stringDelim) - return readString(); - var repeat, - prev, - curr, - start, - isDoc, - isLeadingComment = offset === 0; - do { - if (offset === length) - return null; - repeat = false; - while (whitespaceRe.test(curr = charAt(offset))) { - if (curr === "\n") { - isLeadingComment = true; - ++line; - } - if (++offset === length) - return null; - } - - if (charAt(offset) === "/") { - if (++offset === length) { - throw illegal("comment"); - } - if (charAt(offset) === "/") { // Line - if (!alternateCommentMode) { - // check for triple-slash comment - isDoc = charAt(start = offset + 1) === "/"; - - while (charAt(++offset) !== "\n") { - if (offset === length) { - return null; - } - } - ++offset; - if (isDoc) { - setComment(start, offset - 1, isLeadingComment); - // Trailing comment cannot not be multi-line, - // so leading comment state should be reset to handle potential next comments - isLeadingComment = true; - } - ++line; - repeat = true; - } else { - // check for double-slash comments, consolidating consecutive lines - start = offset; - isDoc = false; - if (isDoubleSlashCommentLine(offset)) { - isDoc = true; - do { - offset = findEndOfLine(offset); - if (offset === length) { - break; - } - offset++; - if (!isLeadingComment) { - // Trailing comment cannot not be multi-line - break; - } - } while (isDoubleSlashCommentLine(offset)); - } else { - offset = Math.min(length, findEndOfLine(offset) + 1); - } - if (isDoc) { - setComment(start, offset, isLeadingComment); - isLeadingComment = true; - } - line++; - repeat = true; - } - } else if ((curr = charAt(offset)) === "*") { /* Block */ - // check for /** (regular comment mode) or /* (alternate comment mode) - start = offset + 1; - isDoc = alternateCommentMode || charAt(start) === "*"; - do { - if (curr === "\n") { - ++line; - } - if (++offset === length) { - throw illegal("comment"); - } - prev = curr; - curr = charAt(offset); - } while (prev !== "*" || curr !== "/"); - ++offset; - if (isDoc) { - setComment(start, offset - 2, isLeadingComment); - isLeadingComment = true; - } - repeat = true; - } else { - return "/"; - } - } - } while (repeat); - - // offset !== length if we got here - - var end = offset; - delimRe.lastIndex = 0; - var delim = delimRe.test(charAt(end++)); - if (!delim) - while (end < length && !delimRe.test(charAt(end))) - ++end; - var token = source.substring(offset, offset = end); - if (token === "\"" || token === "'") - stringDelim = token; - return token; - } - - /** - * Pushes a token back to the stack. - * @param {string} token Token - * @returns {undefined} - * @inner - */ - function push(token) { - stack.push(token); - } - - /** - * Peeks for the next token. - * @returns {string|null} Token or `null` on eof - * @inner - */ - function peek() { - if (!stack.length) { - var token = next(); - if (token === null) - return null; - push(token); - } - return stack[0]; - } - - /** - * Skips a token. - * @param {string} expected Expected token - * @param {boolean} [optional=false] Whether the token is optional - * @returns {boolean} `true` when skipped, `false` if not - * @throws {Error} When a required token is not present - * @inner - */ - function skip(expected, optional) { - var actual = peek(), - equals = actual === expected; - if (equals) { - next(); - return true; - } - if (!optional) - throw illegal("token '" + actual + "', '" + expected + "' expected"); - return false; - } - - /** - * Gets a comment. - * @param {number} [trailingLine] Line number if looking for a trailing comment - * @returns {string|null} Comment text - * @inner - */ - function cmnt(trailingLine) { - var ret = null; - var comment; - if (trailingLine === undefined) { - comment = comments[line - 1]; - delete comments[line - 1]; - if (comment && (alternateCommentMode || comment.type === "*" || comment.lineEmpty)) { - ret = comment.leading ? comment.text : null; - } - } else { - /* istanbul ignore else */ - if (lastCommentLine < trailingLine) { - peek(); - } - comment = comments[trailingLine]; - delete comments[trailingLine]; - if (comment && !comment.lineEmpty && (alternateCommentMode || comment.type === "/")) { - ret = comment.leading ? null : comment.text; - } - } - return ret; - } - - return Object.defineProperty({ - next: next, - peek: peek, - push: push, - skip: skip, - cmnt: cmnt - }, "line", { - get: function() { return line; } - }); - /* eslint-enable callback-return */ -} - -},{}],35:[function(require,module,exports){ -"use strict"; -module.exports = Type; - -// extends Namespace -var Namespace = require(23); -((Type.prototype = Object.create(Namespace.prototype)).constructor = Type).className = "Type"; - -var Enum = require(15), - OneOf = require(25), - Field = require(16), - MapField = require(20), - Service = require(33), - Message = require(21), - Reader = require(27), - Writer = require(42), - util = require(37), - encoder = require(14), - decoder = require(13), - verifier = require(40), - converter = require(12), - wrappers = require(41); - -/** - * Constructs a new reflected message type instance. - * @classdesc Reflected message type. - * @extends NamespaceBase - * @constructor - * @param {string} name Message name - * @param {Object.} [options] Declared options - */ -function Type(name, options) { - Namespace.call(this, name, options); - - /** - * Message fields. - * @type {Object.} - */ - this.fields = {}; // toJSON, marker - - /** - * Oneofs declared within this namespace, if any. - * @type {Object.} - */ - this.oneofs = undefined; // toJSON - - /** - * Extension ranges, if any. - * @type {number[][]} - */ - this.extensions = undefined; // toJSON - - /** - * Reserved ranges, if any. - * @type {Array.} - */ - this.reserved = undefined; // toJSON - - /*? - * Whether this type is a legacy group. - * @type {boolean|undefined} - */ - this.group = undefined; // toJSON - - /** - * Cached fields by id. - * @type {Object.|null} - * @private - */ - this._fieldsById = null; - - /** - * Cached fields as an array. - * @type {Field[]|null} - * @private - */ - this._fieldsArray = null; - - /** - * Cached oneofs as an array. - * @type {OneOf[]|null} - * @private - */ - this._oneofsArray = null; - - /** - * Cached constructor. - * @type {Constructor<{}>} - * @private - */ - this._ctor = null; -} - -Object.defineProperties(Type.prototype, { - - /** - * Message fields by id. - * @name Type#fieldsById - * @type {Object.} - * @readonly - */ - fieldsById: { - get: function() { - - /* istanbul ignore if */ - if (this._fieldsById) - return this._fieldsById; - - this._fieldsById = {}; - for (var names = Object.keys(this.fields), i = 0; i < names.length; ++i) { - var field = this.fields[names[i]], - id = field.id; - - /* istanbul ignore if */ - if (this._fieldsById[id]) - throw Error("duplicate id " + id + " in " + this); - - this._fieldsById[id] = field; - } - return this._fieldsById; - } - }, - - /** - * Fields of this message as an array for iteration. - * @name Type#fieldsArray - * @type {Field[]} - * @readonly - */ - fieldsArray: { - get: function() { - return this._fieldsArray || (this._fieldsArray = util.toArray(this.fields)); - } - }, - - /** - * Oneofs of this message as an array for iteration. - * @name Type#oneofsArray - * @type {OneOf[]} - * @readonly - */ - oneofsArray: { - get: function() { - return this._oneofsArray || (this._oneofsArray = util.toArray(this.oneofs)); - } - }, - - /** - * The registered constructor, if any registered, otherwise a generic constructor. - * Assigning a function replaces the internal constructor. If the function does not extend {@link Message} yet, its prototype will be setup accordingly and static methods will be populated. If it already extends {@link Message}, it will just replace the internal constructor. - * @name Type#ctor - * @type {Constructor<{}>} - */ - ctor: { - get: function() { - return this._ctor || (this.ctor = Type.generateConstructor(this)()); - }, - set: function(ctor) { - - // Ensure proper prototype - var prototype = ctor.prototype; - if (!(prototype instanceof Message)) { - (ctor.prototype = new Message()).constructor = ctor; - util.merge(ctor.prototype, prototype); - } - - // Classes and messages reference their reflected type - ctor.$type = ctor.prototype.$type = this; - - // Mix in static methods - util.merge(ctor, Message, true); - - this._ctor = ctor; - - // Messages have non-enumerable default values on their prototype - var i = 0; - for (; i < /* initializes */ this.fieldsArray.length; ++i) - this._fieldsArray[i].resolve(); // ensures a proper value - - // Messages have non-enumerable getters and setters for each virtual oneof field - var ctorProperties = {}; - for (i = 0; i < /* initializes */ this.oneofsArray.length; ++i) - ctorProperties[this._oneofsArray[i].resolve().name] = { - get: util.oneOfGetter(this._oneofsArray[i].oneof), - set: util.oneOfSetter(this._oneofsArray[i].oneof) - }; - if (i) - Object.defineProperties(ctor.prototype, ctorProperties); - } - } -}); - -/** - * Generates a constructor function for the specified type. - * @param {Type} mtype Message type - * @returns {Codegen} Codegen instance - */ -Type.generateConstructor = function generateConstructor(mtype) { - /* eslint-disable no-unexpected-multiline */ - var gen = util.codegen(["p"], mtype.name); - // explicitly initialize mutable object/array fields so that these aren't just inherited from the prototype - for (var i = 0, field; i < mtype.fieldsArray.length; ++i) - if ((field = mtype._fieldsArray[i]).map) gen - ("this%s={}", util.safeProp(field.name)); - else if (field.repeated) gen - ("this%s=[]", util.safeProp(field.name)); - return gen - ("if(p)for(var ks=Object.keys(p),i=0;i} [oneofs] Oneof descriptors - * @property {Object.} fields Field descriptors - * @property {number[][]} [extensions] Extension ranges - * @property {number[][]} [reserved] Reserved ranges - * @property {boolean} [group=false] Whether a legacy group or not - */ - -/** - * Creates a message type from a message type descriptor. - * @param {string} name Message name - * @param {IType} json Message type descriptor - * @returns {Type} Created message type - */ -Type.fromJSON = function fromJSON(name, json) { - var type = new Type(name, json.options); - type.extensions = json.extensions; - type.reserved = json.reserved; - var names = Object.keys(json.fields), - i = 0; - for (; i < names.length; ++i) - type.add( - ( typeof json.fields[names[i]].keyType !== "undefined" - ? MapField.fromJSON - : Field.fromJSON )(names[i], json.fields[names[i]]) - ); - if (json.oneofs) - for (names = Object.keys(json.oneofs), i = 0; i < names.length; ++i) - type.add(OneOf.fromJSON(names[i], json.oneofs[names[i]])); - if (json.nested) - for (names = Object.keys(json.nested), i = 0; i < names.length; ++i) { - var nested = json.nested[names[i]]; - type.add( // most to least likely - ( nested.id !== undefined - ? Field.fromJSON - : nested.fields !== undefined - ? Type.fromJSON - : nested.values !== undefined - ? Enum.fromJSON - : nested.methods !== undefined - ? Service.fromJSON - : Namespace.fromJSON )(names[i], nested) - ); - } - if (json.extensions && json.extensions.length) - type.extensions = json.extensions; - if (json.reserved && json.reserved.length) - type.reserved = json.reserved; - if (json.group) - type.group = true; - if (json.comment) - type.comment = json.comment; - return type; -}; - -/** - * Converts this message type to a message type descriptor. - * @param {IToJSONOptions} [toJSONOptions] JSON conversion options - * @returns {IType} Message type descriptor - */ -Type.prototype.toJSON = function toJSON(toJSONOptions) { - var inherited = Namespace.prototype.toJSON.call(this, toJSONOptions); - var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false; - return util.toObject([ - "options" , inherited && inherited.options || undefined, - "oneofs" , Namespace.arrayToJSON(this.oneofsArray, toJSONOptions), - "fields" , Namespace.arrayToJSON(this.fieldsArray.filter(function(obj) { return !obj.declaringField; }), toJSONOptions) || {}, - "extensions" , this.extensions && this.extensions.length ? this.extensions : undefined, - "reserved" , this.reserved && this.reserved.length ? this.reserved : undefined, - "group" , this.group || undefined, - "nested" , inherited && inherited.nested || undefined, - "comment" , keepComments ? this.comment : undefined - ]); -}; - -/** - * @override - */ -Type.prototype.resolveAll = function resolveAll() { - var fields = this.fieldsArray, i = 0; - while (i < fields.length) - fields[i++].resolve(); - var oneofs = this.oneofsArray; i = 0; - while (i < oneofs.length) - oneofs[i++].resolve(); - return Namespace.prototype.resolveAll.call(this); -}; - -/** - * @override - */ -Type.prototype.get = function get(name) { - return this.fields[name] - || this.oneofs && this.oneofs[name] - || this.nested && this.nested[name] - || null; -}; - -/** - * Adds a nested object to this type. - * @param {ReflectionObject} object Nested object to add - * @returns {Type} `this` - * @throws {TypeError} If arguments are invalid - * @throws {Error} If there is already a nested object with this name or, if a field, when there is already a field with this id - */ -Type.prototype.add = function add(object) { - - if (this.get(object.name)) - throw Error("duplicate name '" + object.name + "' in " + this); - - if (object instanceof Field && object.extend === undefined) { - // NOTE: Extension fields aren't actual fields on the declaring type, but nested objects. - // The root object takes care of adding distinct sister-fields to the respective extended - // type instead. - - // avoids calling the getter if not absolutely necessary because it's called quite frequently - if (this._fieldsById ? /* istanbul ignore next */ this._fieldsById[object.id] : this.fieldsById[object.id]) - throw Error("duplicate id " + object.id + " in " + this); - if (this.isReservedId(object.id)) - throw Error("id " + object.id + " is reserved in " + this); - if (this.isReservedName(object.name)) - throw Error("name '" + object.name + "' is reserved in " + this); - - if (object.parent) - object.parent.remove(object); - this.fields[object.name] = object; - object.message = this; - object.onAdd(this); - return clearCache(this); - } - if (object instanceof OneOf) { - if (!this.oneofs) - this.oneofs = {}; - this.oneofs[object.name] = object; - object.onAdd(this); - return clearCache(this); - } - return Namespace.prototype.add.call(this, object); -}; - -/** - * Removes a nested object from this type. - * @param {ReflectionObject} object Nested object to remove - * @returns {Type} `this` - * @throws {TypeError} If arguments are invalid - * @throws {Error} If `object` is not a member of this type - */ -Type.prototype.remove = function remove(object) { - if (object instanceof Field && object.extend === undefined) { - // See Type#add for the reason why extension fields are excluded here. - - /* istanbul ignore if */ - if (!this.fields || this.fields[object.name] !== object) - throw Error(object + " is not a member of " + this); - - delete this.fields[object.name]; - object.parent = null; - object.onRemove(this); - return clearCache(this); - } - if (object instanceof OneOf) { - - /* istanbul ignore if */ - if (!this.oneofs || this.oneofs[object.name] !== object) - throw Error(object + " is not a member of " + this); - - delete this.oneofs[object.name]; - object.parent = null; - object.onRemove(this); - return clearCache(this); - } - return Namespace.prototype.remove.call(this, object); -}; - -/** - * Tests if the specified id is reserved. - * @param {number} id Id to test - * @returns {boolean} `true` if reserved, otherwise `false` - */ -Type.prototype.isReservedId = function isReservedId(id) { - return Namespace.isReservedId(this.reserved, id); -}; - -/** - * Tests if the specified name is reserved. - * @param {string} name Name to test - * @returns {boolean} `true` if reserved, otherwise `false` - */ -Type.prototype.isReservedName = function isReservedName(name) { - return Namespace.isReservedName(this.reserved, name); -}; - -/** - * Creates a new message of this type using the specified properties. - * @param {Object.} [properties] Properties to set - * @returns {Message<{}>} Message instance - */ -Type.prototype.create = function create(properties) { - return new this.ctor(properties); -}; - -/** - * Sets up {@link Type#encode|encode}, {@link Type#decode|decode} and {@link Type#verify|verify}. - * @returns {Type} `this` - */ -Type.prototype.setup = function setup() { - // Sets up everything at once so that the prototype chain does not have to be re-evaluated - // multiple times (V8, soft-deopt prototype-check). - - var fullName = this.fullName, - types = []; - for (var i = 0; i < /* initializes */ this.fieldsArray.length; ++i) - types.push(this._fieldsArray[i].resolve().resolvedType); - - // Replace setup methods with type-specific generated functions - this.encode = encoder(this)({ - Writer : Writer, - types : types, - util : util - }); - this.decode = decoder(this)({ - Reader : Reader, - types : types, - util : util - }); - this.verify = verifier(this)({ - types : types, - util : util - }); - this.fromObject = converter.fromObject(this)({ - types : types, - util : util - }); - this.toObject = converter.toObject(this)({ - types : types, - util : util - }); - - // Inject custom wrappers for common types - var wrapper = wrappers[fullName]; - if (wrapper) { - var originalThis = Object.create(this); - // if (wrapper.fromObject) { - originalThis.fromObject = this.fromObject; - this.fromObject = wrapper.fromObject.bind(originalThis); - // } - // if (wrapper.toObject) { - originalThis.toObject = this.toObject; - this.toObject = wrapper.toObject.bind(originalThis); - // } - } - - return this; -}; - -/** - * Encodes a message of this type. Does not implicitly {@link Type#verify|verify} messages. - * @param {Message<{}>|Object.} message Message instance or plain object - * @param {Writer} [writer] Writer to encode to - * @returns {Writer} writer - */ -Type.prototype.encode = function encode_setup(message, writer) { - return this.setup().encode(message, writer); // overrides this method -}; - -/** - * Encodes a message of this type preceeded by its byte length as a varint. Does not implicitly {@link Type#verify|verify} messages. - * @param {Message<{}>|Object.} message Message instance or plain object - * @param {Writer} [writer] Writer to encode to - * @returns {Writer} writer - */ -Type.prototype.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); -}; - -/** - * Decodes a message of this type. - * @param {Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Length of the message, if known beforehand - * @returns {Message<{}>} Decoded message - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {util.ProtocolError<{}>} If required fields are missing - */ -Type.prototype.decode = function decode_setup(reader, length) { - return this.setup().decode(reader, length); // overrides this method -}; - -/** - * Decodes a message of this type preceeded by its byte length as a varint. - * @param {Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {Message<{}>} Decoded message - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {util.ProtocolError} If required fields are missing - */ -Type.prototype.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof Reader)) - reader = Reader.create(reader); - return this.decode(reader, reader.uint32()); -}; - -/** - * Verifies that field values are valid and that required fields are present. - * @param {Object.} message Plain object to verify - * @returns {null|string} `null` if valid, otherwise the reason why it is not - */ -Type.prototype.verify = function verify_setup(message) { - return this.setup().verify(message); // overrides this method -}; - -/** - * Creates a new message of this type from a plain object. Also converts values to their respective internal types. - * @param {Object.} object Plain object to convert - * @returns {Message<{}>} Message instance - */ -Type.prototype.fromObject = function fromObject(object) { - return this.setup().fromObject(object); -}; - -/** - * Conversion options as used by {@link Type#toObject} and {@link Message.toObject}. - * @interface IConversionOptions - * @property {Function} [longs] Long conversion type. - * Valid values are `String` and `Number` (the global types). - * Defaults to copy the present value, which is a possibly unsafe number without and a {@link Long} with a long library. - * @property {Function} [enums] Enum value conversion type. - * Only valid value is `String` (the global type). - * Defaults to copy the present value, which is the numeric id. - * @property {Function} [bytes] Bytes value conversion type. - * Valid values are `Array` and (a base64 encoded) `String` (the global types). - * Defaults to copy the present value, which usually is a Buffer under node and an Uint8Array in the browser. - * @property {boolean} [defaults=false] Also sets default values on the resulting object - * @property {boolean} [arrays=false] Sets empty arrays for missing repeated fields even if `defaults=false` - * @property {boolean} [objects=false] Sets empty objects for missing map fields even if `defaults=false` - * @property {boolean} [oneofs=false] Includes virtual oneof properties set to the present field's name, if any - * @property {boolean} [json=false] Performs additional JSON compatibility conversions, i.e. NaN and Infinity to strings - */ - -/** - * Creates a plain object from a message of this type. Also converts values to other types if specified. - * @param {Message<{}>} message Message instance - * @param {IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ -Type.prototype.toObject = function toObject(message, options) { - return this.setup().toObject(message, options); -}; - -/** - * Decorator function as returned by {@link Type.d} (TypeScript). - * @typedef TypeDecorator - * @type {function} - * @param {Constructor} target Target constructor - * @returns {undefined} - * @template T extends Message - */ - -/** - * Type decorator (TypeScript). - * @param {string} [typeName] Type name, defaults to the constructor's name - * @returns {TypeDecorator} Decorator function - * @template T extends Message - */ -Type.d = function decorateType(typeName) { - return function typeDecorator(target) { - util.decorateType(target, typeName); - }; -}; - -},{"12":12,"13":13,"14":14,"15":15,"16":16,"20":20,"21":21,"23":23,"25":25,"27":27,"33":33,"37":37,"40":40,"41":41,"42":42}],36:[function(require,module,exports){ -"use strict"; - -/** - * Common type constants. - * @namespace - */ -var types = exports; - -var util = require(37); - -var s = [ - "double", // 0 - "float", // 1 - "int32", // 2 - "uint32", // 3 - "sint32", // 4 - "fixed32", // 5 - "sfixed32", // 6 - "int64", // 7 - "uint64", // 8 - "sint64", // 9 - "fixed64", // 10 - "sfixed64", // 11 - "bool", // 12 - "string", // 13 - "bytes" // 14 -]; - -function bake(values, offset) { - var i = 0, o = {}; - offset |= 0; - while (i < values.length) o[s[i + offset]] = values[i++]; - return o; -} - -/** - * Basic type wire types. - * @type {Object.} - * @const - * @property {number} double=1 Fixed64 wire type - * @property {number} float=5 Fixed32 wire type - * @property {number} int32=0 Varint wire type - * @property {number} uint32=0 Varint wire type - * @property {number} sint32=0 Varint wire type - * @property {number} fixed32=5 Fixed32 wire type - * @property {number} sfixed32=5 Fixed32 wire type - * @property {number} int64=0 Varint wire type - * @property {number} uint64=0 Varint wire type - * @property {number} sint64=0 Varint wire type - * @property {number} fixed64=1 Fixed64 wire type - * @property {number} sfixed64=1 Fixed64 wire type - * @property {number} bool=0 Varint wire type - * @property {number} string=2 Ldelim wire type - * @property {number} bytes=2 Ldelim wire type - */ -types.basic = bake([ - /* double */ 1, - /* float */ 5, - /* int32 */ 0, - /* uint32 */ 0, - /* sint32 */ 0, - /* fixed32 */ 5, - /* sfixed32 */ 5, - /* int64 */ 0, - /* uint64 */ 0, - /* sint64 */ 0, - /* fixed64 */ 1, - /* sfixed64 */ 1, - /* bool */ 0, - /* string */ 2, - /* bytes */ 2 -]); - -/** - * Basic type defaults. - * @type {Object.} - * @const - * @property {number} double=0 Double default - * @property {number} float=0 Float default - * @property {number} int32=0 Int32 default - * @property {number} uint32=0 Uint32 default - * @property {number} sint32=0 Sint32 default - * @property {number} fixed32=0 Fixed32 default - * @property {number} sfixed32=0 Sfixed32 default - * @property {number} int64=0 Int64 default - * @property {number} uint64=0 Uint64 default - * @property {number} sint64=0 Sint32 default - * @property {number} fixed64=0 Fixed64 default - * @property {number} sfixed64=0 Sfixed64 default - * @property {boolean} bool=false Bool default - * @property {string} string="" String default - * @property {Array.} bytes=Array(0) Bytes default - * @property {null} message=null Message default - */ -types.defaults = bake([ - /* double */ 0, - /* float */ 0, - /* int32 */ 0, - /* uint32 */ 0, - /* sint32 */ 0, - /* fixed32 */ 0, - /* sfixed32 */ 0, - /* int64 */ 0, - /* uint64 */ 0, - /* sint64 */ 0, - /* fixed64 */ 0, - /* sfixed64 */ 0, - /* bool */ false, - /* string */ "", - /* bytes */ util.emptyArray, - /* message */ null -]); - -/** - * Basic long type wire types. - * @type {Object.} - * @const - * @property {number} int64=0 Varint wire type - * @property {number} uint64=0 Varint wire type - * @property {number} sint64=0 Varint wire type - * @property {number} fixed64=1 Fixed64 wire type - * @property {number} sfixed64=1 Fixed64 wire type - */ -types.long = bake([ - /* int64 */ 0, - /* uint64 */ 0, - /* sint64 */ 0, - /* fixed64 */ 1, - /* sfixed64 */ 1 -], 7); - -/** - * Allowed types for map keys with their associated wire type. - * @type {Object.} - * @const - * @property {number} int32=0 Varint wire type - * @property {number} uint32=0 Varint wire type - * @property {number} sint32=0 Varint wire type - * @property {number} fixed32=5 Fixed32 wire type - * @property {number} sfixed32=5 Fixed32 wire type - * @property {number} int64=0 Varint wire type - * @property {number} uint64=0 Varint wire type - * @property {number} sint64=0 Varint wire type - * @property {number} fixed64=1 Fixed64 wire type - * @property {number} sfixed64=1 Fixed64 wire type - * @property {number} bool=0 Varint wire type - * @property {number} string=2 Ldelim wire type - */ -types.mapKey = bake([ - /* int32 */ 0, - /* uint32 */ 0, - /* sint32 */ 0, - /* fixed32 */ 5, - /* sfixed32 */ 5, - /* int64 */ 0, - /* uint64 */ 0, - /* sint64 */ 0, - /* fixed64 */ 1, - /* sfixed64 */ 1, - /* bool */ 0, - /* string */ 2 -], 2); - -/** - * Allowed types for packed repeated fields with their associated wire type. - * @type {Object.} - * @const - * @property {number} double=1 Fixed64 wire type - * @property {number} float=5 Fixed32 wire type - * @property {number} int32=0 Varint wire type - * @property {number} uint32=0 Varint wire type - * @property {number} sint32=0 Varint wire type - * @property {number} fixed32=5 Fixed32 wire type - * @property {number} sfixed32=5 Fixed32 wire type - * @property {number} int64=0 Varint wire type - * @property {number} uint64=0 Varint wire type - * @property {number} sint64=0 Varint wire type - * @property {number} fixed64=1 Fixed64 wire type - * @property {number} sfixed64=1 Fixed64 wire type - * @property {number} bool=0 Varint wire type - */ -types.packed = bake([ - /* double */ 1, - /* float */ 5, - /* int32 */ 0, - /* uint32 */ 0, - /* sint32 */ 0, - /* fixed32 */ 5, - /* sfixed32 */ 5, - /* int64 */ 0, - /* uint64 */ 0, - /* sint64 */ 0, - /* fixed64 */ 1, - /* sfixed64 */ 1, - /* bool */ 0 -]); - -},{"37":37}],37:[function(require,module,exports){ -"use strict"; - -/** - * Various utility functions. - * @namespace - */ -var util = module.exports = require(39); - -var roots = require(30); - -var Type, // cyclic - Enum; - -util.codegen = require(3); -util.fetch = require(5); -util.path = require(8); - -/** - * Node's fs module if available. - * @type {Object.} - */ -util.fs = util.inquire("fs"); - -/** - * Converts an object's values to an array. - * @param {Object.} object Object to convert - * @returns {Array.<*>} Converted array - */ -util.toArray = function toArray(object) { - if (object) { - var keys = Object.keys(object), - array = new Array(keys.length), - index = 0; - while (index < keys.length) - array[index] = object[keys[index++]]; - return array; - } - return []; -}; - -/** - * Converts an array of keys immediately followed by their respective value to an object, omitting undefined values. - * @param {Array.<*>} array Array to convert - * @returns {Object.} Converted object - */ -util.toObject = function toObject(array) { - var object = {}, - index = 0; - while (index < array.length) { - var key = array[index++], - val = array[index++]; - if (val !== undefined) - object[key] = val; - } - return object; -}; - -var safePropBackslashRe = /\\/g, - safePropQuoteRe = /"/g; - -/** - * Tests whether the specified name is a reserved word in JS. - * @param {string} name Name to test - * @returns {boolean} `true` if reserved, otherwise `false` - */ -util.isReserved = function isReserved(name) { - return /^(?:do|if|in|for|let|new|try|var|case|else|enum|eval|false|null|this|true|void|with|break|catch|class|const|super|throw|while|yield|delete|export|import|public|return|static|switch|typeof|default|extends|finally|package|private|continue|debugger|function|arguments|interface|protected|implements|instanceof)$/.test(name); -}; - -/** - * Returns a safe property accessor for the specified property name. - * @param {string} prop Property name - * @returns {string} Safe accessor - */ -util.safeProp = function safeProp(prop) { - if (!/^[$\w_]+$/.test(prop) || util.isReserved(prop)) - return "[\"" + prop.replace(safePropBackslashRe, "\\\\").replace(safePropQuoteRe, "\\\"") + "\"]"; - return "." + prop; -}; - -/** - * Converts the first character of a string to upper case. - * @param {string} str String to convert - * @returns {string} Converted string - */ -util.ucFirst = function ucFirst(str) { - return str.charAt(0).toUpperCase() + str.substring(1); -}; - -var camelCaseRe = /_([a-z])/g; - -/** - * Converts a string to camel case. - * @param {string} str String to convert - * @returns {string} Converted string - */ -util.camelCase = function camelCase(str) { - return str.substring(0, 1) - + str.substring(1) - .replace(camelCaseRe, function($0, $1) { return $1.toUpperCase(); }); -}; - -/** - * Compares reflected fields by id. - * @param {Field} a First field - * @param {Field} b Second field - * @returns {number} Comparison value - */ -util.compareFieldsById = function compareFieldsById(a, b) { - return a.id - b.id; -}; - -/** - * Decorator helper for types (TypeScript). - * @param {Constructor} ctor Constructor function - * @param {string} [typeName] Type name, defaults to the constructor's name - * @returns {Type} Reflected type - * @template T extends Message - * @property {Root} root Decorators root - */ -util.decorateType = function decorateType(ctor, typeName) { - - /* istanbul ignore if */ - if (ctor.$type) { - if (typeName && ctor.$type.name !== typeName) { - util.decorateRoot.remove(ctor.$type); - ctor.$type.name = typeName; - util.decorateRoot.add(ctor.$type); - } - return ctor.$type; - } - - /* istanbul ignore next */ - if (!Type) - Type = require(35); - - var type = new Type(typeName || ctor.name); - util.decorateRoot.add(type); - type.ctor = ctor; // sets up .encode, .decode etc. - Object.defineProperty(ctor, "$type", { value: type, enumerable: false }); - Object.defineProperty(ctor.prototype, "$type", { value: type, enumerable: false }); - return type; -}; - -var decorateEnumIndex = 0; - -/** - * Decorator helper for enums (TypeScript). - * @param {Object} object Enum object - * @returns {Enum} Reflected enum - */ -util.decorateEnum = function decorateEnum(object) { - - /* istanbul ignore if */ - if (object.$type) - return object.$type; - - /* istanbul ignore next */ - if (!Enum) - Enum = require(15); - - var enm = new Enum("Enum" + decorateEnumIndex++, object); - util.decorateRoot.add(enm); - Object.defineProperty(object, "$type", { value: enm, enumerable: false }); - return enm; -}; - - -/** - * Sets the value of a property by property path. If a value already exists, it is turned to an array - * @param {Object.} dst Destination object - * @param {string} path dot '.' delimited path of the property to set - * @param {Object} value the value to set - * @returns {Object.} Destination object - */ -util.setProperty = function setProperty(dst, path, value) { - function setProp(dst, path, value) { - var part = path.shift(); - if (part === "__proto__") { - return dst; - } - if (path.length > 0) { - dst[part] = setProp(dst[part] || {}, path, value); - } else { - var prevValue = dst[part]; - if (prevValue) - value = [].concat(prevValue).concat(value); - dst[part] = value; - } - return dst; - } - - if (typeof dst !== "object") - throw TypeError("dst must be an object"); - if (!path) - throw TypeError("path must be specified"); - - path = path.split("."); - return setProp(dst, path, value); -}; - -/** - * Decorator root (TypeScript). - * @name util.decorateRoot - * @type {Root} - * @readonly - */ -Object.defineProperty(util, "decorateRoot", { - get: function() { - return roots["decorated"] || (roots["decorated"] = new (require(29))()); - } -}); - -},{"15":15,"29":29,"3":3,"30":30,"35":35,"39":39,"5":5,"8":8}],38:[function(require,module,exports){ -"use strict"; -module.exports = LongBits; - -var util = require(39); - -/** - * Constructs new long bits. - * @classdesc Helper class for working with the low and high bits of a 64 bit value. - * @memberof util - * @constructor - * @param {number} lo Low 32 bits, unsigned - * @param {number} hi High 32 bits, unsigned - */ -function LongBits(lo, hi) { - - // note that the casts below are theoretically unnecessary as of today, but older statically - // generated converter code might still call the ctor with signed 32bits. kept for compat. - - /** - * Low bits. - * @type {number} - */ - this.lo = lo >>> 0; - - /** - * High bits. - * @type {number} - */ - this.hi = hi >>> 0; -} - -/** - * Zero bits. - * @memberof util.LongBits - * @type {util.LongBits} - */ -var zero = LongBits.zero = new LongBits(0, 0); - -zero.toNumber = function() { return 0; }; -zero.zzEncode = zero.zzDecode = function() { return this; }; -zero.length = function() { return 1; }; - -/** - * Zero hash. - * @memberof util.LongBits - * @type {string} - */ -var zeroHash = LongBits.zeroHash = "\0\0\0\0\0\0\0\0"; - -/** - * Constructs new long bits from the specified number. - * @param {number} value Value - * @returns {util.LongBits} Instance - */ -LongBits.fromNumber = function fromNumber(value) { - if (value === 0) - return zero; - var sign = value < 0; - if (sign) - value = -value; - var lo = value >>> 0, - hi = (value - lo) / 4294967296 >>> 0; - if (sign) { - hi = ~hi >>> 0; - lo = ~lo >>> 0; - if (++lo > 4294967295) { - lo = 0; - if (++hi > 4294967295) - hi = 0; - } - } - return new LongBits(lo, hi); -}; - -/** - * Constructs new long bits from a number, long or string. - * @param {Long|number|string} value Value - * @returns {util.LongBits} Instance - */ -LongBits.from = function from(value) { - if (typeof value === "number") - return LongBits.fromNumber(value); - if (util.isString(value)) { - /* istanbul ignore else */ - if (util.Long) - value = util.Long.fromString(value); - else - return LongBits.fromNumber(parseInt(value, 10)); - } - return value.low || value.high ? new LongBits(value.low >>> 0, value.high >>> 0) : zero; -}; - -/** - * Converts this long bits to a possibly unsafe JavaScript number. - * @param {boolean} [unsigned=false] Whether unsigned or not - * @returns {number} Possibly unsafe number - */ -LongBits.prototype.toNumber = function toNumber(unsigned) { - if (!unsigned && this.hi >>> 31) { - var lo = ~this.lo + 1 >>> 0, - hi = ~this.hi >>> 0; - if (!lo) - hi = hi + 1 >>> 0; - return -(lo + hi * 4294967296); - } - return this.lo + this.hi * 4294967296; -}; - -/** - * Converts this long bits to a long. - * @param {boolean} [unsigned=false] Whether unsigned or not - * @returns {Long} Long - */ -LongBits.prototype.toLong = function toLong(unsigned) { - return util.Long - ? new util.Long(this.lo | 0, this.hi | 0, Boolean(unsigned)) - /* istanbul ignore next */ - : { low: this.lo | 0, high: this.hi | 0, unsigned: Boolean(unsigned) }; -}; - -var charCodeAt = String.prototype.charCodeAt; - -/** - * Constructs new long bits from the specified 8 characters long hash. - * @param {string} hash Hash - * @returns {util.LongBits} Bits - */ -LongBits.fromHash = function fromHash(hash) { - if (hash === zeroHash) - return zero; - return new LongBits( - ( charCodeAt.call(hash, 0) - | charCodeAt.call(hash, 1) << 8 - | charCodeAt.call(hash, 2) << 16 - | charCodeAt.call(hash, 3) << 24) >>> 0 - , - ( charCodeAt.call(hash, 4) - | charCodeAt.call(hash, 5) << 8 - | charCodeAt.call(hash, 6) << 16 - | charCodeAt.call(hash, 7) << 24) >>> 0 - ); -}; - -/** - * Converts this long bits to a 8 characters long hash. - * @returns {string} Hash - */ -LongBits.prototype.toHash = function toHash() { - return String.fromCharCode( - this.lo & 255, - this.lo >>> 8 & 255, - this.lo >>> 16 & 255, - this.lo >>> 24 , - this.hi & 255, - this.hi >>> 8 & 255, - this.hi >>> 16 & 255, - this.hi >>> 24 - ); -}; - -/** - * Zig-zag encodes this long bits. - * @returns {util.LongBits} `this` - */ -LongBits.prototype.zzEncode = function zzEncode() { - var mask = this.hi >> 31; - this.hi = ((this.hi << 1 | this.lo >>> 31) ^ mask) >>> 0; - this.lo = ( this.lo << 1 ^ mask) >>> 0; - return this; -}; - -/** - * Zig-zag decodes this long bits. - * @returns {util.LongBits} `this` - */ -LongBits.prototype.zzDecode = function zzDecode() { - var mask = -(this.lo & 1); - this.lo = ((this.lo >>> 1 | this.hi << 31) ^ mask) >>> 0; - this.hi = ( this.hi >>> 1 ^ mask) >>> 0; - return this; -}; - -/** - * Calculates the length of this longbits when encoded as a varint. - * @returns {number} Length - */ -LongBits.prototype.length = function length() { - var part0 = this.lo, - part1 = (this.lo >>> 28 | this.hi << 4) >>> 0, - part2 = this.hi >>> 24; - return part2 === 0 - ? part1 === 0 - ? part0 < 16384 - ? part0 < 128 ? 1 : 2 - : part0 < 2097152 ? 3 : 4 - : part1 < 16384 - ? part1 < 128 ? 5 : 6 - : part1 < 2097152 ? 7 : 8 - : part2 < 128 ? 9 : 10; -}; - -},{"39":39}],39:[function(require,module,exports){ -"use strict"; -var util = exports; - -// used to return a Promise where callback is omitted -util.asPromise = require(1); - -// converts to / from base64 encoded strings -util.base64 = require(2); - -// base class of rpc.Service -util.EventEmitter = require(4); - -// float handling accross browsers -util.float = require(6); - -// requires modules optionally and hides the call from bundlers -util.inquire = require(7); - -// converts to / from utf8 encoded strings -util.utf8 = require(10); - -// provides a node-like buffer pool in the browser -util.pool = require(9); - -// utility to work with the low and high bits of a 64 bit value -util.LongBits = require(38); - -/** - * Whether running within node or not. - * @memberof util - * @type {boolean} - */ -util.isNode = Boolean(typeof global !== "undefined" - && global - && global.process - && global.process.versions - && global.process.versions.node); - -/** - * Global object reference. - * @memberof util - * @type {Object} - */ -util.global = util.isNode && global - || typeof window !== "undefined" && window - || typeof self !== "undefined" && self - || this; // eslint-disable-line no-invalid-this - -/** - * An immuable empty array. - * @memberof util - * @type {Array.<*>} - * @const - */ -util.emptyArray = Object.freeze ? Object.freeze([]) : /* istanbul ignore next */ []; // used on prototypes - -/** - * An immutable empty object. - * @type {Object} - * @const - */ -util.emptyObject = Object.freeze ? Object.freeze({}) : /* istanbul ignore next */ {}; // used on prototypes - -/** - * Tests if the specified value is an integer. - * @function - * @param {*} value Value to test - * @returns {boolean} `true` if the value is an integer - */ -util.isInteger = Number.isInteger || /* istanbul ignore next */ function isInteger(value) { - return typeof value === "number" && isFinite(value) && Math.floor(value) === value; -}; - -/** - * Tests if the specified value is a string. - * @param {*} value Value to test - * @returns {boolean} `true` if the value is a string - */ -util.isString = function isString(value) { - return typeof value === "string" || value instanceof String; -}; - -/** - * Tests if the specified value is a non-null object. - * @param {*} value Value to test - * @returns {boolean} `true` if the value is a non-null object - */ -util.isObject = function isObject(value) { - return value && typeof value === "object"; -}; - -/** - * Checks if a property on a message is considered to be present. - * This is an alias of {@link util.isSet}. - * @function - * @param {Object} obj Plain object or message instance - * @param {string} prop Property name - * @returns {boolean} `true` if considered to be present, otherwise `false` - */ -util.isset = - -/** - * Checks if a property on a message is considered to be present. - * @param {Object} obj Plain object or message instance - * @param {string} prop Property name - * @returns {boolean} `true` if considered to be present, otherwise `false` - */ -util.isSet = function isSet(obj, prop) { - var value = obj[prop]; - if (value != null && obj.hasOwnProperty(prop)) // eslint-disable-line eqeqeq, no-prototype-builtins - return typeof value !== "object" || (Array.isArray(value) ? value.length : Object.keys(value).length) > 0; - return false; -}; - -/** - * Any compatible Buffer instance. - * This is a minimal stand-alone definition of a Buffer instance. The actual type is that exported by node's typings. - * @interface Buffer - * @extends Uint8Array - */ - -/** - * Node's Buffer class if available. - * @type {Constructor} - */ -util.Buffer = (function() { - try { - var Buffer = util.inquire("buffer").Buffer; - // refuse to use non-node buffers if not explicitly assigned (perf reasons): - return Buffer.prototype.utf8Write ? Buffer : /* istanbul ignore next */ null; - } catch (e) { - /* istanbul ignore next */ - return null; - } -})(); - -// Internal alias of or polyfull for Buffer.from. -util._Buffer_from = null; - -// Internal alias of or polyfill for Buffer.allocUnsafe. -util._Buffer_allocUnsafe = null; - -/** - * Creates a new buffer of whatever type supported by the environment. - * @param {number|number[]} [sizeOrArray=0] Buffer size or number array - * @returns {Uint8Array|Buffer} Buffer - */ -util.newBuffer = function newBuffer(sizeOrArray) { - /* istanbul ignore next */ - return typeof sizeOrArray === "number" - ? util.Buffer - ? util._Buffer_allocUnsafe(sizeOrArray) - : new util.Array(sizeOrArray) - : util.Buffer - ? util._Buffer_from(sizeOrArray) - : typeof Uint8Array === "undefined" - ? sizeOrArray - : new Uint8Array(sizeOrArray); -}; - -/** - * Array implementation used in the browser. `Uint8Array` if supported, otherwise `Array`. - * @type {Constructor} - */ -util.Array = typeof Uint8Array !== "undefined" ? Uint8Array /* istanbul ignore next */ : Array; - -/** - * Any compatible Long instance. - * This is a minimal stand-alone definition of a Long instance. The actual type is that exported by long.js. - * @interface Long - * @property {number} low Low bits - * @property {number} high High bits - * @property {boolean} unsigned Whether unsigned or not - */ - -/** - * Long.js's Long class if available. - * @type {Constructor} - */ -util.Long = /* istanbul ignore next */ util.global.dcodeIO && /* istanbul ignore next */ util.global.dcodeIO.Long - || /* istanbul ignore next */ util.global.Long - || util.inquire("long"); - -/** - * Regular expression used to verify 2 bit (`bool`) map keys. - * @type {RegExp} - * @const - */ -util.key2Re = /^true|false|0|1$/; - -/** - * Regular expression used to verify 32 bit (`int32` etc.) map keys. - * @type {RegExp} - * @const - */ -util.key32Re = /^-?(?:0|[1-9][0-9]*)$/; - -/** - * Regular expression used to verify 64 bit (`int64` etc.) map keys. - * @type {RegExp} - * @const - */ -util.key64Re = /^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/; - -/** - * Converts a number or long to an 8 characters long hash string. - * @param {Long|number} value Value to convert - * @returns {string} Hash - */ -util.longToHash = function longToHash(value) { - return value - ? util.LongBits.from(value).toHash() - : util.LongBits.zeroHash; -}; - -/** - * Converts an 8 characters long hash string to a long or number. - * @param {string} hash Hash - * @param {boolean} [unsigned=false] Whether unsigned or not - * @returns {Long|number} Original value - */ -util.longFromHash = function longFromHash(hash, unsigned) { - var bits = util.LongBits.fromHash(hash); - if (util.Long) - return util.Long.fromBits(bits.lo, bits.hi, unsigned); - return bits.toNumber(Boolean(unsigned)); -}; - -/** - * Merges the properties of the source object into the destination object. - * @memberof util - * @param {Object.} dst Destination object - * @param {Object.} src Source object - * @param {boolean} [ifNotSet=false] Merges only if the key is not already set - * @returns {Object.} Destination object - */ -function merge(dst, src, ifNotSet) { // used by converters - for (var keys = Object.keys(src), i = 0; i < keys.length; ++i) - if (dst[keys[i]] === undefined || !ifNotSet) - dst[keys[i]] = src[keys[i]]; - return dst; -} - -util.merge = merge; - -/** - * Converts the first character of a string to lower case. - * @param {string} str String to convert - * @returns {string} Converted string - */ -util.lcFirst = function lcFirst(str) { - return str.charAt(0).toLowerCase() + str.substring(1); -}; - -/** - * Creates a custom error constructor. - * @memberof util - * @param {string} name Error name - * @returns {Constructor} Custom error constructor - */ -function newError(name) { - - function CustomError(message, properties) { - - if (!(this instanceof CustomError)) - return new CustomError(message, properties); - - // Error.call(this, message); - // ^ just returns a new error instance because the ctor can be called as a function - - Object.defineProperty(this, "message", { get: function() { return message; } }); - - /* istanbul ignore next */ - if (Error.captureStackTrace) // node - Error.captureStackTrace(this, CustomError); - else - Object.defineProperty(this, "stack", { value: new Error().stack || "" }); - - if (properties) - merge(this, properties); - } - - CustomError.prototype = Object.create(Error.prototype, { - constructor: { - value: CustomError, - writable: true, - enumerable: false, - configurable: true, - }, - name: { - get() { return name; }, - set: undefined, - enumerable: false, - // configurable: false would accurately preserve the behavior of - // the original, but I'm guessing that was not intentional. - // For an actual error subclass, this property would - // be configurable. - configurable: true, - }, - toString: { - value() { return this.name + ": " + this.message; }, - writable: true, - enumerable: false, - configurable: true, - }, - }); - - return CustomError; -} - -util.newError = newError; - -/** - * Constructs a new protocol error. - * @classdesc Error subclass indicating a protocol specifc error. - * @memberof util - * @extends Error - * @template T extends Message - * @constructor - * @param {string} message Error message - * @param {Object.} [properties] Additional properties - * @example - * try { - * MyMessage.decode(someBuffer); // throws if required fields are missing - * } catch (e) { - * if (e instanceof ProtocolError && e.instance) - * console.log("decoded so far: " + JSON.stringify(e.instance)); - * } - */ -util.ProtocolError = newError("ProtocolError"); - -/** - * So far decoded message instance. - * @name util.ProtocolError#instance - * @type {Message} - */ - -/** - * A OneOf getter as returned by {@link util.oneOfGetter}. - * @typedef OneOfGetter - * @type {function} - * @returns {string|undefined} Set field name, if any - */ - -/** - * Builds a getter for a oneof's present field name. - * @param {string[]} fieldNames Field names - * @returns {OneOfGetter} Unbound getter - */ -util.oneOfGetter = function getOneOf(fieldNames) { - var fieldMap = {}; - for (var i = 0; i < fieldNames.length; ++i) - fieldMap[fieldNames[i]] = 1; - - /** - * @returns {string|undefined} Set field name, if any - * @this Object - * @ignore - */ - return function() { // eslint-disable-line consistent-return - for (var keys = Object.keys(this), i = keys.length - 1; i > -1; --i) - if (fieldMap[keys[i]] === 1 && this[keys[i]] !== undefined && this[keys[i]] !== null) - return keys[i]; - }; -}; - -/** - * A OneOf setter as returned by {@link util.oneOfSetter}. - * @typedef OneOfSetter - * @type {function} - * @param {string|undefined} value Field name - * @returns {undefined} - */ - -/** - * Builds a setter for a oneof's present field name. - * @param {string[]} fieldNames Field names - * @returns {OneOfSetter} Unbound setter - */ -util.oneOfSetter = function setOneOf(fieldNames) { - - /** - * @param {string} name Field name - * @returns {undefined} - * @this Object - * @ignore - */ - return function(name) { - for (var i = 0; i < fieldNames.length; ++i) - if (fieldNames[i] !== name) - delete this[fieldNames[i]]; - }; -}; - -/** - * Default conversion options used for {@link Message#toJSON} implementations. - * - * These options are close to proto3's JSON mapping with the exception that internal types like Any are handled just like messages. More precisely: - * - * - Longs become strings - * - Enums become string keys - * - Bytes become base64 encoded strings - * - (Sub-)Messages become plain objects - * - Maps become plain objects with all string keys - * - Repeated fields become arrays - * - NaN and Infinity for float and double fields become strings - * - * @type {IConversionOptions} - * @see https://developers.google.com/protocol-buffers/docs/proto3?hl=en#json - */ -util.toJSONOptions = { - longs: String, - enums: String, - bytes: String, - json: true -}; - -// Sets up buffer utility according to the environment (called in index-minimal) -util._configure = function() { - var Buffer = util.Buffer; - /* istanbul ignore if */ - if (!Buffer) { - util._Buffer_from = util._Buffer_allocUnsafe = null; - return; - } - // because node 4.x buffers are incompatible & immutable - // see: https://github.com/dcodeIO/protobuf.js/pull/665 - util._Buffer_from = Buffer.from !== Uint8Array.from && Buffer.from || - /* istanbul ignore next */ - function Buffer_from(value, encoding) { - return new Buffer(value, encoding); - }; - util._Buffer_allocUnsafe = Buffer.allocUnsafe || - /* istanbul ignore next */ - function Buffer_allocUnsafe(size) { - return new Buffer(size); - }; -}; - -},{"1":1,"10":10,"2":2,"38":38,"4":4,"6":6,"7":7,"9":9}],40:[function(require,module,exports){ -"use strict"; -module.exports = verifier; - -var Enum = require(15), - util = require(37); - -function invalid(field, expected) { - return field.name + ": " + expected + (field.repeated && expected !== "array" ? "[]" : field.map && expected !== "object" ? "{k:"+field.keyType+"}" : "") + " expected"; -} - -/** - * Generates a partial value verifier. - * @param {Codegen} gen Codegen instance - * @param {Field} field Reflected field - * @param {number} fieldIndex Field index - * @param {string} ref Variable reference - * @returns {Codegen} Codegen instance - * @ignore - */ -function genVerifyValue(gen, field, fieldIndex, ref) { - /* eslint-disable no-unexpected-multiline */ - if (field.resolvedType) { - if (field.resolvedType instanceof Enum) { gen - ("switch(%s){", ref) - ("default:") - ("return%j", invalid(field, "enum value")); - for (var keys = Object.keys(field.resolvedType.values), j = 0; j < keys.length; ++j) gen - ("case %i:", field.resolvedType.values[keys[j]]); - gen - ("break") - ("}"); - } else { - gen - ("{") - ("var e=types[%i].verify(%s);", fieldIndex, ref) - ("if(e)") - ("return%j+e", field.name + ".") - ("}"); - } - } else { - switch (field.type) { - case "int32": - case "uint32": - case "sint32": - case "fixed32": - case "sfixed32": gen - ("if(!util.isInteger(%s))", ref) - ("return%j", invalid(field, "integer")); - break; - case "int64": - case "uint64": - case "sint64": - case "fixed64": - case "sfixed64": gen - ("if(!util.isInteger(%s)&&!(%s&&util.isInteger(%s.low)&&util.isInteger(%s.high)))", ref, ref, ref, ref) - ("return%j", invalid(field, "integer|Long")); - break; - case "float": - case "double": gen - ("if(typeof %s!==\"number\")", ref) - ("return%j", invalid(field, "number")); - break; - case "bool": gen - ("if(typeof %s!==\"boolean\")", ref) - ("return%j", invalid(field, "boolean")); - break; - case "string": gen - ("if(!util.isString(%s))", ref) - ("return%j", invalid(field, "string")); - break; - case "bytes": gen - ("if(!(%s&&typeof %s.length===\"number\"||util.isString(%s)))", ref, ref, ref) - ("return%j", invalid(field, "buffer")); - break; - } - } - return gen; - /* eslint-enable no-unexpected-multiline */ -} - -/** - * Generates a partial key verifier. - * @param {Codegen} gen Codegen instance - * @param {Field} field Reflected field - * @param {string} ref Variable reference - * @returns {Codegen} Codegen instance - * @ignore - */ -function genVerifyKey(gen, field, ref) { - /* eslint-disable no-unexpected-multiline */ - switch (field.keyType) { - case "int32": - case "uint32": - case "sint32": - case "fixed32": - case "sfixed32": gen - ("if(!util.key32Re.test(%s))", ref) - ("return%j", invalid(field, "integer key")); - break; - case "int64": - case "uint64": - case "sint64": - case "fixed64": - case "sfixed64": gen - ("if(!util.key64Re.test(%s))", ref) // see comment above: x is ok, d is not - ("return%j", invalid(field, "integer|Long key")); - break; - case "bool": gen - ("if(!util.key2Re.test(%s))", ref) - ("return%j", invalid(field, "boolean key")); - break; - } - return gen; - /* eslint-enable no-unexpected-multiline */ -} - -/** - * Generates a verifier specific to the specified message type. - * @param {Type} mtype Message type - * @returns {Codegen} Codegen instance - */ -function verifier(mtype) { - /* eslint-disable no-unexpected-multiline */ - - var gen = util.codegen(["m"], mtype.name + "$verify") - ("if(typeof m!==\"object\"||m===null)") - ("return%j", "object expected"); - var oneofs = mtype.oneofsArray, - seenFirstField = {}; - if (oneofs.length) gen - ("var p={}"); - - for (var i = 0; i < /* initializes */ mtype.fieldsArray.length; ++i) { - var field = mtype._fieldsArray[i].resolve(), - ref = "m" + util.safeProp(field.name); - - if (field.optional) gen - ("if(%s!=null&&m.hasOwnProperty(%j)){", ref, field.name); // !== undefined && !== null - - // map fields - if (field.map) { gen - ("if(!util.isObject(%s))", ref) - ("return%j", invalid(field, "object")) - ("var k=Object.keys(%s)", ref) - ("for(var i=0;i} - * @const - */ -var wrappers = exports; - -var Message = require(21); - -/** - * From object converter part of an {@link IWrapper}. - * @typedef WrapperFromObjectConverter - * @type {function} - * @param {Object.} object Plain object - * @returns {Message<{}>} Message instance - * @this Type - */ - -/** - * To object converter part of an {@link IWrapper}. - * @typedef WrapperToObjectConverter - * @type {function} - * @param {Message<{}>} message Message instance - * @param {IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - * @this Type - */ - -/** - * Common type wrapper part of {@link wrappers}. - * @interface IWrapper - * @property {WrapperFromObjectConverter} [fromObject] From object converter - * @property {WrapperToObjectConverter} [toObject] To object converter - */ - -// Custom wrapper for Any -wrappers[".google.protobuf.Any"] = { - - fromObject: function(object) { - - // unwrap value type if mapped - if (object && object["@type"]) { - // Only use fully qualified type name after the last '/' - var name = object["@type"].substring(object["@type"].lastIndexOf("/") + 1); - var type = this.lookup(name); - /* istanbul ignore else */ - if (type) { - // type_url does not accept leading "." - var type_url = object["@type"].charAt(0) === "." ? - object["@type"].slice(1) : object["@type"]; - // type_url prefix is optional, but path seperator is required - if (type_url.indexOf("/") === -1) { - type_url = "/" + type_url; - } - return this.create({ - type_url: type_url, - value: type.encode(type.fromObject(object)).finish() - }); - } - } - - return this.fromObject(object); - }, - - toObject: function(message, options) { - - // Default prefix - var googleApi = "type.googleapis.com/"; - var prefix = ""; - var name = ""; - - // decode value if requested and unmapped - if (options && options.json && message.type_url && message.value) { - // Only use fully qualified type name after the last '/' - name = message.type_url.substring(message.type_url.lastIndexOf("/") + 1); - // Separate the prefix used - prefix = message.type_url.substring(0, message.type_url.lastIndexOf("/") + 1); - var type = this.lookup(name); - /* istanbul ignore else */ - if (type) - message = type.decode(message.value); - } - - // wrap value if unmapped - if (!(message instanceof this.ctor) && message instanceof Message) { - var object = message.$type.toObject(message, options); - var messageName = message.$type.fullName[0] === "." ? - message.$type.fullName.slice(1) : message.$type.fullName; - // Default to type.googleapis.com prefix if no prefix is used - if (prefix === "") { - prefix = googleApi; - } - name = prefix + messageName; - object["@type"] = name; - return object; - } - - return this.toObject(message, options); - } -}; - -},{"21":21}],42:[function(require,module,exports){ -"use strict"; -module.exports = Writer; - -var util = require(39); - -var BufferWriter; // cyclic - -var LongBits = util.LongBits, - base64 = util.base64, - utf8 = util.utf8; - -/** - * Constructs a new writer operation instance. - * @classdesc Scheduled writer operation. - * @constructor - * @param {function(*, Uint8Array, number)} fn Function to call - * @param {number} len Value byte length - * @param {*} val Value to write - * @ignore - */ -function Op(fn, len, val) { - - /** - * Function to call. - * @type {function(Uint8Array, number, *)} - */ - this.fn = fn; - - /** - * Value byte length. - * @type {number} - */ - this.len = len; - - /** - * Next operation. - * @type {Writer.Op|undefined} - */ - this.next = undefined; - - /** - * Value to write. - * @type {*} - */ - this.val = val; // type varies -} - -/* istanbul ignore next */ -function noop() {} // eslint-disable-line no-empty-function - -/** - * Constructs a new writer state instance. - * @classdesc Copied writer state. - * @memberof Writer - * @constructor - * @param {Writer} writer Writer to copy state from - * @ignore - */ -function State(writer) { - - /** - * Current head. - * @type {Writer.Op} - */ - this.head = writer.head; - - /** - * Current tail. - * @type {Writer.Op} - */ - this.tail = writer.tail; - - /** - * Current buffer length. - * @type {number} - */ - this.len = writer.len; - - /** - * Next state. - * @type {State|null} - */ - this.next = writer.states; -} - -/** - * Constructs a new writer instance. - * @classdesc Wire format writer using `Uint8Array` if available, otherwise `Array`. - * @constructor - */ -function Writer() { - - /** - * Current length. - * @type {number} - */ - this.len = 0; - - /** - * Operations head. - * @type {Object} - */ - this.head = new Op(noop, 0, 0); - - /** - * Operations tail - * @type {Object} - */ - this.tail = this.head; - - /** - * Linked forked states. - * @type {Object|null} - */ - this.states = null; - - // When a value is written, the writer calculates its byte length and puts it into a linked - // list of operations to perform when finish() is called. This both allows us to allocate - // buffers of the exact required size and reduces the amount of work we have to do compared - // to first calculating over objects and then encoding over objects. In our case, the encoding - // part is just a linked list walk calling operations with already prepared values. -} - -var create = function create() { - return util.Buffer - ? function create_buffer_setup() { - return (Writer.create = function create_buffer() { - return new BufferWriter(); - })(); - } - /* istanbul ignore next */ - : function create_array() { - return new Writer(); - }; -}; - -/** - * Creates a new writer. - * @function - * @returns {BufferWriter|Writer} A {@link BufferWriter} when Buffers are supported, otherwise a {@link Writer} - */ -Writer.create = create(); - -/** - * Allocates a buffer of the specified size. - * @param {number} size Buffer size - * @returns {Uint8Array} Buffer - */ -Writer.alloc = function alloc(size) { - return new util.Array(size); -}; - -// Use Uint8Array buffer pool in the browser, just like node does with buffers -/* istanbul ignore else */ -if (util.Array !== Array) - Writer.alloc = util.pool(Writer.alloc, util.Array.prototype.subarray); - -/** - * Pushes a new operation to the queue. - * @param {function(Uint8Array, number, *)} fn Function to call - * @param {number} len Value byte length - * @param {number} val Value to write - * @returns {Writer} `this` - * @private - */ -Writer.prototype._push = function push(fn, len, val) { - this.tail = this.tail.next = new Op(fn, len, val); - this.len += len; - return this; -}; - -function writeByte(val, buf, pos) { - buf[pos] = val & 255; -} - -function writeVarint32(val, buf, pos) { - while (val > 127) { - buf[pos++] = val & 127 | 128; - val >>>= 7; - } - buf[pos] = val; -} - -/** - * Constructs a new varint writer operation instance. - * @classdesc Scheduled varint writer operation. - * @extends Op - * @constructor - * @param {number} len Value byte length - * @param {number} val Value to write - * @ignore - */ -function VarintOp(len, val) { - this.len = len; - this.next = undefined; - this.val = val; -} - -VarintOp.prototype = Object.create(Op.prototype); -VarintOp.prototype.fn = writeVarint32; - -/** - * Writes an unsigned 32 bit value as a varint. - * @param {number} value Value to write - * @returns {Writer} `this` - */ -Writer.prototype.uint32 = function write_uint32(value) { - // here, the call to this.push has been inlined and a varint specific Op subclass is used. - // uint32 is by far the most frequently used operation and benefits significantly from this. - this.len += (this.tail = this.tail.next = new VarintOp( - (value = value >>> 0) - < 128 ? 1 - : value < 16384 ? 2 - : value < 2097152 ? 3 - : value < 268435456 ? 4 - : 5, - value)).len; - return this; -}; - -/** - * Writes a signed 32 bit value as a varint. - * @function - * @param {number} value Value to write - * @returns {Writer} `this` - */ -Writer.prototype.int32 = function write_int32(value) { - return value < 0 - ? this._push(writeVarint64, 10, LongBits.fromNumber(value)) // 10 bytes per spec - : this.uint32(value); -}; - -/** - * Writes a 32 bit value as a varint, zig-zag encoded. - * @param {number} value Value to write - * @returns {Writer} `this` - */ -Writer.prototype.sint32 = function write_sint32(value) { - return this.uint32((value << 1 ^ value >> 31) >>> 0); -}; - -function writeVarint64(val, buf, pos) { - while (val.hi) { - buf[pos++] = val.lo & 127 | 128; - val.lo = (val.lo >>> 7 | val.hi << 25) >>> 0; - val.hi >>>= 7; - } - while (val.lo > 127) { - buf[pos++] = val.lo & 127 | 128; - val.lo = val.lo >>> 7; - } - buf[pos++] = val.lo; -} - -/** - * Writes an unsigned 64 bit value as a varint. - * @param {Long|number|string} value Value to write - * @returns {Writer} `this` - * @throws {TypeError} If `value` is a string and no long library is present. - */ -Writer.prototype.uint64 = function write_uint64(value) { - var bits = LongBits.from(value); - return this._push(writeVarint64, bits.length(), bits); -}; - -/** - * Writes a signed 64 bit value as a varint. - * @function - * @param {Long|number|string} value Value to write - * @returns {Writer} `this` - * @throws {TypeError} If `value` is a string and no long library is present. - */ -Writer.prototype.int64 = Writer.prototype.uint64; - -/** - * Writes a signed 64 bit value as a varint, zig-zag encoded. - * @param {Long|number|string} value Value to write - * @returns {Writer} `this` - * @throws {TypeError} If `value` is a string and no long library is present. - */ -Writer.prototype.sint64 = function write_sint64(value) { - var bits = LongBits.from(value).zzEncode(); - return this._push(writeVarint64, bits.length(), bits); -}; - -/** - * Writes a boolish value as a varint. - * @param {boolean} value Value to write - * @returns {Writer} `this` - */ -Writer.prototype.bool = function write_bool(value) { - return this._push(writeByte, 1, value ? 1 : 0); -}; - -function writeFixed32(val, buf, pos) { - buf[pos ] = val & 255; - buf[pos + 1] = val >>> 8 & 255; - buf[pos + 2] = val >>> 16 & 255; - buf[pos + 3] = val >>> 24; -} - -/** - * Writes an unsigned 32 bit value as fixed 32 bits. - * @param {number} value Value to write - * @returns {Writer} `this` - */ -Writer.prototype.fixed32 = function write_fixed32(value) { - return this._push(writeFixed32, 4, value >>> 0); -}; - -/** - * Writes a signed 32 bit value as fixed 32 bits. - * @function - * @param {number} value Value to write - * @returns {Writer} `this` - */ -Writer.prototype.sfixed32 = Writer.prototype.fixed32; - -/** - * Writes an unsigned 64 bit value as fixed 64 bits. - * @param {Long|number|string} value Value to write - * @returns {Writer} `this` - * @throws {TypeError} If `value` is a string and no long library is present. - */ -Writer.prototype.fixed64 = function write_fixed64(value) { - var bits = LongBits.from(value); - return this._push(writeFixed32, 4, bits.lo)._push(writeFixed32, 4, bits.hi); -}; - -/** - * Writes a signed 64 bit value as fixed 64 bits. - * @function - * @param {Long|number|string} value Value to write - * @returns {Writer} `this` - * @throws {TypeError} If `value` is a string and no long library is present. - */ -Writer.prototype.sfixed64 = Writer.prototype.fixed64; - -/** - * Writes a float (32 bit). - * @function - * @param {number} value Value to write - * @returns {Writer} `this` - */ -Writer.prototype.float = function write_float(value) { - return this._push(util.float.writeFloatLE, 4, value); -}; - -/** - * Writes a double (64 bit float). - * @function - * @param {number} value Value to write - * @returns {Writer} `this` - */ -Writer.prototype.double = function write_double(value) { - return this._push(util.float.writeDoubleLE, 8, value); -}; - -var writeBytes = util.Array.prototype.set - ? function writeBytes_set(val, buf, pos) { - buf.set(val, pos); // also works for plain array values - } - /* istanbul ignore next */ - : function writeBytes_for(val, buf, pos) { - for (var i = 0; i < val.length; ++i) - buf[pos + i] = val[i]; - }; - -/** - * Writes a sequence of bytes. - * @param {Uint8Array|string} value Buffer or base64 encoded string to write - * @returns {Writer} `this` - */ -Writer.prototype.bytes = function write_bytes(value) { - var len = value.length >>> 0; - if (!len) - return this._push(writeByte, 1, 0); - if (util.isString(value)) { - var buf = Writer.alloc(len = base64.length(value)); - base64.decode(value, buf, 0); - value = buf; - } - return this.uint32(len)._push(writeBytes, len, value); -}; - -/** - * Writes a string. - * @param {string} value Value to write - * @returns {Writer} `this` - */ -Writer.prototype.string = function write_string(value) { - var len = utf8.length(value); - return len - ? this.uint32(len)._push(utf8.write, len, value) - : this._push(writeByte, 1, 0); -}; - -/** - * Forks this writer's state by pushing it to a stack. - * Calling {@link Writer#reset|reset} or {@link Writer#ldelim|ldelim} resets the writer to the previous state. - * @returns {Writer} `this` - */ -Writer.prototype.fork = function fork() { - this.states = new State(this); - this.head = this.tail = new Op(noop, 0, 0); - this.len = 0; - return this; -}; - -/** - * Resets this instance to the last state. - * @returns {Writer} `this` - */ -Writer.prototype.reset = function reset() { - if (this.states) { - this.head = this.states.head; - this.tail = this.states.tail; - this.len = this.states.len; - this.states = this.states.next; - } else { - this.head = this.tail = new Op(noop, 0, 0); - this.len = 0; - } - return this; -}; - -/** - * Resets to the last state and appends the fork state's current write length as a varint followed by its operations. - * @returns {Writer} `this` - */ -Writer.prototype.ldelim = function ldelim() { - var head = this.head, - tail = this.tail, - len = this.len; - this.reset().uint32(len); - if (len) { - this.tail.next = head.next; // skip noop - this.tail = tail; - this.len += len; - } - return this; -}; - -/** - * Finishes the write operation. - * @returns {Uint8Array} Finished buffer - */ -Writer.prototype.finish = function finish() { - var head = this.head.next, // skip noop - buf = this.constructor.alloc(this.len), - pos = 0; - while (head) { - head.fn(head.val, buf, pos); - pos += head.len; - head = head.next; - } - // this.head = this.tail = null; - return buf; -}; - -Writer._configure = function(BufferWriter_) { - BufferWriter = BufferWriter_; - Writer.create = create(); - BufferWriter._configure(); -}; - -},{"39":39}],43:[function(require,module,exports){ -"use strict"; -module.exports = BufferWriter; - -// extends Writer -var Writer = require(42); -(BufferWriter.prototype = Object.create(Writer.prototype)).constructor = BufferWriter; - -var util = require(39); - -/** - * Constructs a new buffer writer instance. - * @classdesc Wire format writer using node buffers. - * @extends Writer - * @constructor - */ -function BufferWriter() { - Writer.call(this); -} - -BufferWriter._configure = function () { - /** - * Allocates a buffer of the specified size. - * @function - * @param {number} size Buffer size - * @returns {Buffer} Buffer - */ - BufferWriter.alloc = util._Buffer_allocUnsafe; - - BufferWriter.writeBytesBuffer = util.Buffer && util.Buffer.prototype instanceof Uint8Array && util.Buffer.prototype.set.name === "set" - ? function writeBytesBuffer_set(val, buf, pos) { - buf.set(val, pos); // faster than copy (requires node >= 4 where Buffers extend Uint8Array and set is properly inherited) - // also works for plain array values - } - /* istanbul ignore next */ - : function writeBytesBuffer_copy(val, buf, pos) { - if (val.copy) // Buffer values - val.copy(buf, pos, 0, val.length); - else for (var i = 0; i < val.length;) // plain array values - buf[pos++] = val[i++]; - }; -}; - - -/** - * @override - */ -BufferWriter.prototype.bytes = function write_bytes_buffer(value) { - if (util.isString(value)) - value = util._Buffer_from(value, "base64"); - var len = value.length >>> 0; - this.uint32(len); - if (len) - this._push(BufferWriter.writeBytesBuffer, len, value); - return this; -}; - -function writeStringBuffer(val, buf, pos) { - if (val.length < 40) // plain js is faster for short strings (probably due to redundant assertions) - util.utf8.write(val, buf, pos); - else if (buf.utf8Write) - buf.utf8Write(val, pos); - else - buf.write(val, pos); -} - -/** - * @override - */ -BufferWriter.prototype.string = function write_string_buffer(value) { - var len = util.Buffer.byteLength(value); - this.uint32(len); - if (len) - this._push(writeStringBuffer, len, value); - return this; -}; - - -/** - * Finishes the write operation. - * @name BufferWriter#finish - * @function - * @returns {Buffer} Finished buffer - */ - -BufferWriter._configure(); - -},{"39":39,"42":42}]},{},[19]) - -})(); -//# sourceMappingURL=protobuf.js.map diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/dist/protobuf.min.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/dist/protobuf.min.js deleted file mode 100644 index 2b867e82..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/dist/protobuf.min.js +++ /dev/null @@ -1,8 +0,0 @@ -/*! - * protobuf.js v7.1.0 (c) 2016, daniel wirtz - * compiled thu, 22 sep 2022 17:16:11 utc - * licensed under the bsd-3-clause license - * see: https://github.com/dcodeio/protobuf.js for details - */ -!function(nt){"use strict";!function(r,e,t){var i=function t(i){var n=e[i];return n||r[i][0].call(n=e[i]={exports:{}},t,n,n.exports),n.exports}(t[0]);i.util.global.protobuf=i,"function"==typeof define&&define.amd&&define(["long"],function(t){return t&&t.isLong&&(i.util.Long=t,i.configure()),i}),"object"==typeof module&&module&&module.exports&&(module.exports=i)}({1:[function(t,i,n){i.exports=function(t,i){var n=Array(arguments.length-1),s=0,r=2,o=!0;for(;r>2],r=(3&f)<<4,u=1;break;case 1:s[o++]=h[r|f>>4],r=(15&f)<<2,u=2;break;case 2:s[o++]=h[r|f>>6],s[o++]=h[63&f],u=0}8191>4,r=u,s=2;break;case 2:i[n++]=(15&r)<<4|(60&u)>>2,r=u,s=3;break;case 3:i[n++]=(3&r)<<6|u,s=0}}if(1===s)throw Error(a);return n-e},n.test=function(t){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(t)}},{}],3:[function(t,i,n){function c(i,n){"string"==typeof i&&(n=i,i=nt);var f=[];function h(t){if("string"!=typeof t){var i=a();if(c.verbose&&console.log("codegen: "+i),i="return "+i,t){for(var n=Object.keys(t),r=Array(n.length+1),e=Array(n.length),s=0;s>>0:i<11754943508222875e-54?(e<<31|Math.round(i/1401298464324817e-60))>>>0:(e<<31|127+(t=Math.floor(Math.log(i)/Math.LN2))<<23|8388607&Math.round(i*Math.pow(2,-t)*8388608))>>>0,n,r)}function n(t,i,n){t=t(i,n),i=2*(t>>31)+1,n=t>>>23&255,t&=8388607;return 255==n?t?NaN:1/0*i:0==n?1401298464324817e-60*i*t:i*Math.pow(2,n-150)*(8388608+t)}function r(t,i,n){u[0]=t,i[n]=f[0],i[n+1]=f[1],i[n+2]=f[2],i[n+3]=f[3]}function e(t,i,n){u[0]=t,i[n]=f[3],i[n+1]=f[2],i[n+2]=f[1],i[n+3]=f[0]}function s(t,i){return f[0]=t[i],f[1]=t[i+1],f[2]=t[i+2],f[3]=t[i+3],u[0]}function o(t,i){return f[3]=t[i],f[2]=t[i+1],f[1]=t[i+2],f[0]=t[i+3],u[0]}var u,f,h,a,c;function l(t,i,n,r,e,s){var o,u=r<0?1:0;0===(r=u?-r:r)?(t(0,e,s+i),t(0<1/r?0:2147483648,e,s+n)):isNaN(r)?(t(0,e,s+i),t(2146959360,e,s+n)):17976931348623157e292>>0,e,s+n)):r<22250738585072014e-324?(t((o=r/5e-324)>>>0,e,s+i),t((u<<31|o/4294967296)>>>0,e,s+n)):(t(4503599627370496*(o=r*Math.pow(2,-(r=1024===(r=Math.floor(Math.log(r)/Math.LN2))?1023:r)))>>>0,e,s+i),t((u<<31|r+1023<<20|1048576*o&1048575)>>>0,e,s+n))}function d(t,i,n,r,e){i=t(r,e+i),t=t(r,e+n),r=2*(t>>31)+1,e=t>>>20&2047,n=4294967296*(1048575&t)+i;return 2047==e?n?NaN:1/0*r:0==e?5e-324*r*n:r*Math.pow(2,e-1075)*(n+4503599627370496)}function p(t,i,n){h[0]=t,i[n]=a[0],i[n+1]=a[1],i[n+2]=a[2],i[n+3]=a[3],i[n+4]=a[4],i[n+5]=a[5],i[n+6]=a[6],i[n+7]=a[7]}function v(t,i,n){h[0]=t,i[n]=a[7],i[n+1]=a[6],i[n+2]=a[5],i[n+3]=a[4],i[n+4]=a[3],i[n+5]=a[2],i[n+6]=a[1],i[n+7]=a[0]}function b(t,i){return a[0]=t[i],a[1]=t[i+1],a[2]=t[i+2],a[3]=t[i+3],a[4]=t[i+4],a[5]=t[i+5],a[6]=t[i+6],a[7]=t[i+7],h[0]}function y(t,i){return a[7]=t[i],a[6]=t[i+1],a[5]=t[i+2],a[4]=t[i+3],a[3]=t[i+4],a[2]=t[i+5],a[1]=t[i+6],a[0]=t[i+7],h[0]}return"undefined"!=typeof Float32Array?(u=new Float32Array([-0]),f=new Uint8Array(u.buffer),c=128===f[3],t.writeFloatLE=c?r:e,t.writeFloatBE=c?e:r,t.readFloatLE=c?s:o,t.readFloatBE=c?o:s):(t.writeFloatLE=i.bind(null,w),t.writeFloatBE=i.bind(null,m),t.readFloatLE=n.bind(null,g),t.readFloatBE=n.bind(null,j)),"undefined"!=typeof Float64Array?(h=new Float64Array([-0]),a=new Uint8Array(h.buffer),c=128===a[7],t.writeDoubleLE=c?p:v,t.writeDoubleBE=c?v:p,t.readDoubleLE=c?b:y,t.readDoubleBE=c?y:b):(t.writeDoubleLE=l.bind(null,w,0,4),t.writeDoubleBE=l.bind(null,m,4,0),t.readDoubleLE=d.bind(null,g,0,4),t.readDoubleBE=d.bind(null,j,4,0)),t}function w(t,i,n){i[n]=255&t,i[n+1]=t>>>8&255,i[n+2]=t>>>16&255,i[n+3]=t>>>24}function m(t,i,n){i[n]=t>>>24,i[n+1]=t>>>16&255,i[n+2]=t>>>8&255,i[n+3]=255&t}function g(t,i){return(t[i]|t[i+1]<<8|t[i+2]<<16|t[i+3]<<24)>>>0}function j(t,i){return(t[i]<<24|t[i+1]<<16|t[i+2]<<8|t[i+3])>>>0}i.exports=r(r)},{}],7:[function(t,i,n){function r(t){try{var i=eval("require")(t);if(i&&(i.length||Object.keys(i).length))return i}catch(t){}return null}i.exports=r},{}],8:[function(t,i,n){var e=n.isAbsolute=function(t){return/^(?:\/|\w+:)/.test(t)},r=n.normalize=function(t){var i=(t=t.replace(/\\/g,"/").replace(/\/{2,}/g,"/")).split("/"),n=e(t),t="";n&&(t=i.shift()+"/");for(var r=0;r>>1,s=null,o=r;return function(t){if(t<1||e>10),s[o++]=56320+(1023&r)):s[o++]=(15&r)<<12|(63&t[i++])<<6|63&t[i++],8191>6|192:(55296==(64512&r)&&56320==(64512&(e=t.charCodeAt(o+1)))?(++o,i[n++]=(r=65536+((1023&r)<<10)+(1023&e))>>18|240,i[n++]=r>>12&63|128):i[n++]=r>>12|224,i[n++]=r>>6&63|128),i[n++]=63&r|128);return n-s}},{}],11:[function(t,i,n){i.exports=e;var r=/\/|\./;function e(t,i){r.test(t)||(t="google/protobuf/"+t+".proto",i={nested:{google:{nested:{protobuf:{nested:i}}}}}),e[t]=i}e("any",{Any:{fields:{type_url:{type:"string",id:1},value:{type:"bytes",id:2}}}}),e("duration",{Duration:i={fields:{seconds:{type:"int64",id:1},nanos:{type:"int32",id:2}}}}),e("timestamp",{Timestamp:i}),e("empty",{Empty:{fields:{}}}),e("struct",{Struct:{fields:{fields:{keyType:"string",type:"Value",id:1}}},Value:{oneofs:{kind:{oneof:["nullValue","numberValue","stringValue","boolValue","structValue","listValue"]}},fields:{nullValue:{type:"NullValue",id:1},numberValue:{type:"double",id:2},stringValue:{type:"string",id:3},boolValue:{type:"bool",id:4},structValue:{type:"Struct",id:5},listValue:{type:"ListValue",id:6}}},NullValue:{values:{NULL_VALUE:0}},ListValue:{fields:{values:{rule:"repeated",type:"Value",id:1}}}}),e("wrappers",{DoubleValue:{fields:{value:{type:"double",id:1}}},FloatValue:{fields:{value:{type:"float",id:1}}},Int64Value:{fields:{value:{type:"int64",id:1}}},UInt64Value:{fields:{value:{type:"uint64",id:1}}},Int32Value:{fields:{value:{type:"int32",id:1}}},UInt32Value:{fields:{value:{type:"uint32",id:1}}},BoolValue:{fields:{value:{type:"bool",id:1}}},StringValue:{fields:{value:{type:"string",id:1}}},BytesValue:{fields:{value:{type:"bytes",id:1}}}}),e("field_mask",{FieldMask:{fields:{paths:{rule:"repeated",type:"string",id:1}}}}),e.get=function(t){return e[t]||null}},{}],12:[function(t,i,n){var l=t(15),d=t(37);function o(t,i,n,r){if(i.resolvedType)if(i.resolvedType instanceof l){t("switch(d%s){",r);for(var e=i.resolvedType.values,s=Object.keys(e),o=0;o>>0",r,r);break;case"int32":case"sint32":case"sfixed32":t("m%s=d%s|0",r,r);break;case"uint64":u=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":t("if(util.Long)")("(m%s=util.Long.fromValue(d%s)).unsigned=%j",r,r,u)('else if(typeof d%s==="string")',r)("m%s=parseInt(d%s,10)",r,r)('else if(typeof d%s==="number")',r)("m%s=d%s",r,r)('else if(typeof d%s==="object")',r)("m%s=new util.LongBits(d%s.low>>>0,d%s.high>>>0).toNumber(%s)",r,r,r,u?"true":"");break;case"bytes":t('if(typeof d%s==="string")',r)("util.base64.decode(d%s,m%s=util.newBuffer(util.base64.length(d%s)),0)",r,r,r)("else if(d%s.length >= 0)",r)("m%s=d%s",r,r);break;case"string":t("m%s=String(d%s)",r,r);break;case"bool":t("m%s=Boolean(d%s)",r,r)}}return t}function p(t,i,n,r){if(i.resolvedType)i.resolvedType instanceof l?t("d%s=o.enums===String?(types[%i].values[m%s]===undefined?m%s:types[%i].values[m%s]):m%s",r,n,r,r,n,r,r):t("d%s=types[%i].toObject(m%s,o)",r,n,r);else{var e=!1;switch(i.type){case"double":case"float":t("d%s=o.json&&!isFinite(m%s)?String(m%s):m%s",r,r,r,r);break;case"uint64":e=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":t('if(typeof m%s==="number")',r)("d%s=o.longs===String?String(m%s):m%s",r,r,r)("else")("d%s=o.longs===String?util.Long.prototype.toString.call(m%s):o.longs===Number?new util.LongBits(m%s.low>>>0,m%s.high>>>0).toNumber(%s):m%s",r,r,r,r,e?"true":"",r);break;case"bytes":t("d%s=o.bytes===String?util.base64.encode(m%s,0,m%s.length):o.bytes===Array?Array.prototype.slice.call(m%s):m%s",r,r,r,r,r);break;default:t("d%s=m%s",r,r)}}return t}n.fromObject=function(t){var i=t.fieldsArray,n=d.codegen(["d"],t.name+"$fromObject")("if(d instanceof this.ctor)")("return d");if(!i.length)return n("return new this.ctor");n("var m=new this.ctor");for(var r=0;r>>3){");for(var n=0;n>>3){")("case 1: k=r.%s(); break",r.keyType)("case 2:"),f.basic[e]===nt?i("value=types[%i].decode(r,r.uint32())",n):i("value=r.%s()",e),i("break")("default:")("r.skipType(tag2&7)")("break")("}")("}"),f.long[r.keyType]!==nt?i('%s[typeof k==="object"?util.longToHash(k):k]=value',s):i("%s[k]=value",s)):r.repeated?(i("if(!(%s&&%s.length))",s,s)("%s=[]",s),f.packed[e]!==nt&&i("if((t&7)===2){")("var c2=r.uint32()+r.pos")("while(r.pos>>0,8|a.mapKey[s.keyType],s.keyType),f===nt?n("types[%i].encode(%s[ks[i]],w.uint32(18).fork()).ldelim().ldelim()",o,i):n(".uint32(%i).%s(%s[ks[i]]).ldelim()",16|f,u,i),n("}")("}")):s.repeated?(n("if(%s!=null&&%s.length){",i,i),s.packed&&a.packed[u]!==nt?n("w.uint32(%i).fork()",(s.id<<3|2)>>>0)("for(var i=0;i<%s.length;++i)",i)("w.%s(%s[i])",u,i)("w.ldelim()"):(n("for(var i=0;i<%s.length;++i)",i),f===nt?l(n,s,o,i+"[i]"):n("w.uint32(%i).%s(%s[i])",(s.id<<3|f)>>>0,u,i)),n("}")):(s.optional&&n("if(%s!=null&&Object.hasOwnProperty.call(m,%j))",i,s.name),f===nt?l(n,s,o,i):n("w.uint32(%i).%s(%s)",(s.id<<3|f)>>>0,u,i))}return n("return w")};var h=t(15),a=t(36),c=t(37);function l(t,i,n,r){i.resolvedType.group?t("types[%i].encode(%s,w.uint32(%i)).uint32(%i)",n,r,(i.id<<3|3)>>>0,(i.id<<3|4)>>>0):t("types[%i].encode(%s,w.uint32(%i).fork()).ldelim()",n,r,(i.id<<3|2)>>>0)}},{15:15,36:36,37:37}],15:[function(t,i,n){i.exports=s;var f=t(24),r=(((s.prototype=Object.create(f.prototype)).constructor=s).className="Enum",t(23)),e=t(37);function s(t,i,n,r,e,s){if(f.call(this,t,n),i&&"object"!=typeof i)throw TypeError("values must be an object");if(this.valuesById={},this.values=Object.create(this.valuesById),this.comment=r,this.comments=e||{},this.valuesOptions=s,this.reserved=nt,i)for(var o=Object.keys(i),u=0;ui)return!0;return!1},c.isReservedName=function(t,i){if(t)for(var n=0;n");var e=l();if(!Q.test(e))throw j(e,"name");v("=");var s=new q(g(e),A(l()),n,r);S(s,function(t){if("option"!==t)throw j(t);$(s,t),v(";")},function(){M(s)}),i.add(s);break;case"required":case"repeated":N(u,t);break;case"optional":N(u,w?"proto3_optional":"optional");break;case"oneof":e=u,n=t;if(!Q.test(n=l()))throw j(n,"name");var o=new R(g(n));S(o,function(t){"option"===t?($(o,t),v(";")):(d(t),N(o,"optional"))}),e.add(o);break;case"extensions":E(u.extensions||(u.extensions=[]));break;case"reserved":E(u.reserved||(u.reserved=[]),!0);break;default:if(!w||!Y.test(t))throw j(t);d(t),N(u,"optional")}}),t.add(u)}function N(t,i,n){var r=l();if("group"===r){var e,s,o=t,u=i,f=l();if(Q.test(f))return s=H.lcFirst(f),f===s&&(f=H.ucFirst(f)),v("="),h=A(l()),(e=new L(f)).group=!0,(s=new U(s,h,f,u)).filename=it.filename,S(e,function(t){switch(t){case"option":$(e,t),v(";");break;case"required":case"repeated":N(e,t);break;case"optional":N(e,w?"proto3_optional":"optional");break;case"message":T(e);break;case"enum":V(e);break;default:throw j(t)}}),void o.add(e).add(s);throw j(f,"name")}if(!Y.test(r))throw j(r,"type");var h=l();if(!Q.test(h))throw j(h,"name");h=g(h),v("=");var a=new U(h,A(l()),r,i,n);S(a,function(t){if("option"!==t)throw j(t);$(a,t),v(";")},function(){M(a)}),"proto3_optional"===i?(u=new R("_"+h),a.setOption("proto3_optional",!0),u.add(a),t.add(u)):t.add(a),w||!a.repeated||P.packed[r]===nt&&P.basic[r]!==nt||a.setOption("packed",!1,!0)}function V(t,i){if(!Q.test(i=l()))throw j(i,"name");var s=new z(i);S(s,function(t){switch(t){case"option":$(s,t),v(";");break;case"reserved":E(s.reserved||(s.reserved=[]),!0);break;default:var i=s,n=t;if(!Q.test(n))throw j(n,"name");v("=");var r=A(l(),!0),e={options:nt,setOption:function(t,i){this.options===nt&&(this.options={}),this.options[t]=i}};return S(e,function(t){if("option"!==t)throw j(t);$(e,t),v(";")},function(){M(e)}),void i.add(n,r,e.comment,e.options)}}),t.add(s)}function $(t,i){var n=v("(",!0);if(!Y.test(i=l()))throw j(i,"name");var r,e=i,s=e,n=(n&&(v(")"),s=e="("+e+")",i=p(),tt.test(i)&&(r=i.slice(1),e+=i,l())),v("="),function t(i,n){if(v("{",!0)){for(var r={};!v("}",!0);){if(!Q.test(h=l()))throw j(h,"name");var e,s,o=h;if(v(":",!0),"{"===p())e=t(i,n+"."+h);else if("["===p()){if(e=[],v("[",!0)){for(;s=O(!0),e.push(s),v(",",!0););v("]"),void 0!==s&&_(i,n+"."+h,s)}}else e=O(!0),_(i,n+"."+h,e);var u=r[o];u&&(e=[].concat(u).concat(e)),r[o]=e,v(",",!0),v(";",!0)}return r}var f=O(!0);_(i,n,f);return f}(t,e));i=s,e=n,s=r,(n=t).setParsedOption&&n.setParsedOption(i,e,s)}function _(t,i,n){t.setOption&&t.setOption(i,n)}function M(t){if(v("[",!0)){for(;$(t,"option"),v(",",!0););v("]")}}for(;null!==(h=l());)switch(h){case"package":if(!y)throw j(h);if(r!==nt)throw j("package");if(r=l(),!Y.test(r))throw j(r,"name");m=m.define(r),v(";");break;case"import":if(!y)throw j(h);switch(f=u=void 0,p()){case"weak":f=s=s||[],l();break;case"public":l();default:f=e=e||[]}u=k(),v(";"),f.push(u);break;case"syntax":if(!y)throw j(h);if(v("="),o=k(),!(w="proto3"===o)&&"proto2"!==o)throw j(o,"syntax");v(";");break;case"option":$(m,h),v(";");break;default:if(x(m,h)){y=!1;continue}throw j(h)}return it.filename=null,{package:r,imports:e,weakImports:s,syntax:o,root:i}}},{15:15,16:16,20:20,22:22,25:25,29:29,33:33,34:34,35:35,36:36,37:37}],27:[function(t,i,n){i.exports=f;var r,e=t(39),s=e.LongBits,o=e.utf8;function u(t,i){return RangeError("index out of range: "+t.pos+" + "+(i||1)+" > "+t.len)}function f(t){this.buf=t,this.pos=0,this.len=t.length}function h(){return e.Buffer?function(t){return(f.create=function(t){return e.Buffer.isBuffer(t)?new r(t):c(t)})(t)}:c}var a,c="undefined"!=typeof Uint8Array?function(t){if(t instanceof Uint8Array||Array.isArray(t))return new f(t);throw Error("illegal buffer")}:function(t){if(Array.isArray(t))return new f(t);throw Error("illegal buffer")};function l(){var t=new s(0,0),i=0;if(!(4=this.len)throw u(this);if(t.lo=(t.lo|(127&this.buf[this.pos])<<7*i)>>>0,this.buf[this.pos++]<128)return t}return t.lo=(t.lo|(127&this.buf[this.pos++])<<7*i)>>>0,t}for(;i<4;++i)if(t.lo=(t.lo|(127&this.buf[this.pos])<<7*i)>>>0,this.buf[this.pos++]<128)return t;if(t.lo=(t.lo|(127&this.buf[this.pos])<<28)>>>0,t.hi=(t.hi|(127&this.buf[this.pos])>>4)>>>0,this.buf[this.pos++]<128)return t;if(i=0,4>>0,this.buf[this.pos++]<128)return t}else for(;i<5;++i){if(this.pos>=this.len)throw u(this);if(t.hi=(t.hi|(127&this.buf[this.pos])<<7*i+3)>>>0,this.buf[this.pos++]<128)return t}throw Error("invalid varint encoding")}function d(t,i){return(t[i-4]|t[i-3]<<8|t[i-2]<<16|t[i-1]<<24)>>>0}function p(){if(this.pos+8>this.len)throw u(this,8);return new s(d(this.buf,this.pos+=4),d(this.buf,this.pos+=4))}f.create=h(),f.prototype.c=e.Array.prototype.subarray||e.Array.prototype.slice,f.prototype.uint32=(a=4294967295,function(){if(a=(127&this.buf[this.pos])>>>0,this.buf[this.pos++]<128||(a=(a|(127&this.buf[this.pos])<<7)>>>0,this.buf[this.pos++]<128||(a=(a|(127&this.buf[this.pos])<<14)>>>0,this.buf[this.pos++]<128||(a=(a|(127&this.buf[this.pos])<<21)>>>0,this.buf[this.pos++]<128||(a=(a|(15&this.buf[this.pos])<<28)>>>0,this.buf[this.pos++]<128||!((this.pos+=5)>this.len))))))return a;throw this.pos=this.len,u(this,10)}),f.prototype.int32=function(){return 0|this.uint32()},f.prototype.sint32=function(){var t=this.uint32();return t>>>1^-(1&t)|0},f.prototype.bool=function(){return 0!==this.uint32()},f.prototype.fixed32=function(){if(this.pos+4>this.len)throw u(this,4);return d(this.buf,this.pos+=4)},f.prototype.sfixed32=function(){if(this.pos+4>this.len)throw u(this,4);return 0|d(this.buf,this.pos+=4)},f.prototype.float=function(){if(this.pos+4>this.len)throw u(this,4);var t=e.float.readFloatLE(this.buf,this.pos);return this.pos+=4,t},f.prototype.double=function(){if(this.pos+8>this.len)throw u(this,4);var t=e.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,t},f.prototype.bytes=function(){var t=this.uint32(),i=this.pos,n=this.pos+t;if(n>this.len)throw u(this,t);return this.pos+=t,Array.isArray(this.buf)?this.buf.slice(i,n):i===n?new this.buf.constructor(0):this.c.call(this.buf,i,n)},f.prototype.string=function(){var t=this.bytes();return o.read(t,0,t.length)},f.prototype.skip=function(t){if("number"==typeof t){if(this.pos+t>this.len)throw u(this,t);this.pos+=t}else do{if(this.pos>=this.len)throw u(this)}while(128&this.buf[this.pos++]);return this},f.prototype.skipType=function(t){switch(t){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;4!=(t=7&this.uint32());)this.skipType(t);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+t+" at offset "+this.pos)}return this},f.u=function(t){r=t,f.create=h(),r.u();var i=e.Long?"toLong":"toNumber";e.merge(f.prototype,{int64:function(){return l.call(this)[i](!1)},uint64:function(){return l.call(this)[i](!0)},sint64:function(){return l.call(this).zzDecode()[i](!1)},fixed64:function(){return p.call(this)[i](!0)},sfixed64:function(){return p.call(this)[i](!1)}})}},{39:39}],28:[function(t,i,n){i.exports=s;var r=t(27),e=((s.prototype=Object.create(r.prototype)).constructor=s,t(39));function s(t){r.call(this,t)}s.u=function(){e.Buffer&&(s.prototype.c=e.Buffer.prototype.slice)},s.prototype.string=function(){var t=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+t,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+t,this.len))},s.u()},{27:27,39:39}],29:[function(t,i,n){i.exports=f;var r,d,p,e=t(23),s=(((f.prototype=Object.create(e.prototype)).constructor=f).className="Root",t(16)),o=t(15),u=t(25),v=t(37);function f(t){e.call(this,"",t),this.deferred=[],this.files=[]}function b(){}f.fromJSON=function(t,i){return i=i||new f,t.options&&i.setOptions(t.options),i.addJSON(t.nested)},f.prototype.resolvePath=v.path.resolve,f.prototype.fetch=v.fetch,f.prototype.load=function t(i,s,e){"function"==typeof s&&(e=s,s=nt);var o=this;if(!e)return v.asPromise(t,o,i,s);var u=e===b;function f(t,i){if(e){var n=e;if(e=null,u)throw t;n(t,i)}}function h(t){var i=t.lastIndexOf("google/protobuf/");if(-1]/g,E=/(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,A=/(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,x=/^ *[*/]+ */,S=/^\s*\*?\/*/,T=/\n/g,N=/\s/,r=/\\(.?)/g,e={0:"\0",r:"\r",n:"\n",t:"\t"};function V(t){return t.replace(r,function(t,i){switch(i){case"\\":case"":return i;default:return e[i]||""}})}function s(h,a){h=h.toString();var c=0,l=h.length,d=1,f=0,p={},v=[],b=null;function y(t){return Error("illegal "+t+" (line "+d+")")}function w(t){return h[0|t]||""}function m(t,i,n){var r,e={type:h[0|t++]||"",lineEmpty:!1,leading:n},n=a?2:3,s=t-n;do{if(--s<0||"\n"==(r=h[0|s]||"")){e.lineEmpty=!0;break}}while(" "===r||"\t"===r);for(var o=h.substring(t,i).split(T),u=0;u>>0,this.hi=i>>>0}var s=e.zero=new e(0,0),o=(s.toNumber=function(){return 0},s.zzEncode=s.zzDecode=function(){return this},s.length=function(){return 1},e.zeroHash="\0\0\0\0\0\0\0\0",e.fromNumber=function(t){var i,n;return 0===t?s:(n=(t=(i=t<0)?-t:t)>>>0,t=(t-n)/4294967296>>>0,i&&(t=~t>>>0,n=~n>>>0,4294967295<++n&&(n=0,4294967295<++t&&(t=0))),new e(n,t))},e.from=function(t){if("number"==typeof t)return e.fromNumber(t);if(r.isString(t)){if(!r.Long)return e.fromNumber(parseInt(t,10));t=r.Long.fromString(t)}return t.low||t.high?new e(t.low>>>0,t.high>>>0):s},e.prototype.toNumber=function(t){var i;return!t&&this.hi>>>31?(t=1+~this.lo>>>0,i=~this.hi>>>0,-(t+4294967296*(i=t?i:i+1>>>0))):this.lo+4294967296*this.hi},e.prototype.toLong=function(t){return r.Long?new r.Long(0|this.lo,0|this.hi,!!t):{low:0|this.lo,high:0|this.hi,unsigned:!!t}},String.prototype.charCodeAt);e.fromHash=function(t){return"\0\0\0\0\0\0\0\0"===t?s:new e((o.call(t,0)|o.call(t,1)<<8|o.call(t,2)<<16|o.call(t,3)<<24)>>>0,(o.call(t,4)|o.call(t,5)<<8|o.call(t,6)<<16|o.call(t,7)<<24)>>>0)},e.prototype.toHash=function(){return String.fromCharCode(255&this.lo,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,255&this.hi,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},e.prototype.zzEncode=function(){var t=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^t)>>>0,this.lo=(this.lo<<1^t)>>>0,this},e.prototype.zzDecode=function(){var t=-(1&this.lo);return this.lo=((this.lo>>>1|this.hi<<31)^t)>>>0,this.hi=(this.hi>>>1^t)>>>0,this},e.prototype.length=function(){var t=this.lo,i=(this.lo>>>28|this.hi<<4)>>>0,n=this.hi>>>24;return 0==n?0==i?t<16384?t<128?1:2:t<2097152?3:4:i<16384?i<128?5:6:i<2097152?7:8:n<128?9:10}},{39:39}],39:[function(t,i,n){var r=n;function e(t,i,n){for(var r=Object.keys(i),e=0;e>>7|t.hi<<25)>>>0,t.hi>>>=7;for(;127>>7;i[n++]=t.lo}function b(t,i,n){i[n]=255&t,i[n+1]=t>>>8&255,i[n+2]=t>>>16&255,i[n+3]=t>>>24}c.create=l(),c.alloc=function(t){return new e.Array(t)},e.Array!==Array&&(c.alloc=e.pool(c.alloc,e.Array.prototype.subarray)),c.prototype.g=function(t,i,n){return this.tail=this.tail.next=new f(t,i,n),this.len+=i,this},(p.prototype=Object.create(f.prototype)).fn=function(t,i,n){for(;127>>=7;i[n]=t},c.prototype.uint32=function(t){return this.len+=(this.tail=this.tail.next=new p((t>>>=0)<128?1:t<16384?2:t<2097152?3:t<268435456?4:5,t)).len,this},c.prototype.int32=function(t){return t<0?this.g(v,10,s.fromNumber(t)):this.uint32(t)},c.prototype.sint32=function(t){return this.uint32((t<<1^t>>31)>>>0)},c.prototype.int64=c.prototype.uint64=function(t){t=s.from(t);return this.g(v,t.length(),t)},c.prototype.sint64=function(t){t=s.from(t).zzEncode();return this.g(v,t.length(),t)},c.prototype.bool=function(t){return this.g(d,1,t?1:0)},c.prototype.sfixed32=c.prototype.fixed32=function(t){return this.g(b,4,t>>>0)},c.prototype.sfixed64=c.prototype.fixed64=function(t){t=s.from(t);return this.g(b,4,t.lo).g(b,4,t.hi)},c.prototype.float=function(t){return this.g(e.float.writeFloatLE,4,t)},c.prototype.double=function(t){return this.g(e.float.writeDoubleLE,8,t)};var y=e.Array.prototype.set?function(t,i,n){i.set(t,n)}:function(t,i,n){for(var r=0;r>>0;return n?(e.isString(t)&&(i=c.alloc(n=o.length(t)),o.decode(t,i,0),t=i),this.uint32(n).g(y,n,t)):this.g(d,1,0)},c.prototype.string=function(t){var i=u.length(t);return i?this.uint32(i).g(u.write,i,t):this.g(d,1,0)},c.prototype.fork=function(){return this.states=new a(this),this.head=this.tail=new f(h,0,0),this.len=0,this},c.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new f(h,0,0),this.len=0),this},c.prototype.ldelim=function(){var t=this.head,i=this.tail,n=this.len;return this.reset().uint32(n),n&&(this.tail.next=t.next,this.tail=i,this.len+=n),this},c.prototype.finish=function(){for(var t=this.head.next,i=this.constructor.alloc(this.len),n=0;t;)t.fn(t.val,i,n),n+=t.len,t=t.next;return i},c.u=function(t){r=t,c.create=l(),r.u()}},{39:39}],43:[function(t,i,n){i.exports=s;var r=t(42),e=((s.prototype=Object.create(r.prototype)).constructor=s,t(39));function s(){r.call(this)}function o(t,i,n){t.length<40?e.utf8.write(t,i,n):i.utf8Write?i.utf8Write(t,n):i.write(t,n)}s.u=function(){s.alloc=e.w,s.writeBytesBuffer=e.Buffer&&e.Buffer.prototype instanceof Uint8Array&&"set"===e.Buffer.prototype.set.name?function(t,i,n){i.set(t,n)}:function(t,i,n){if(t.copy)t.copy(i,n,0,t.length);else for(var r=0;r>>0;return this.uint32(i),i&&this.g(s.writeBytesBuffer,i,t),this},s.prototype.string=function(t){var i=e.Buffer.byteLength(t);return this.uint32(i),i&&this.g(o,i,t),this},s.u()},{39:39,42:42}]},{},[19])}(); -//# sourceMappingURL=protobuf.min.js.map diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/ext/debug/README.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/ext/debug/README.md deleted file mode 100644 index a48517e4..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/ext/debug/README.md +++ /dev/null @@ -1,4 +0,0 @@ -protobufjs/ext/debug -========================= - -Experimental debugging extension. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/ext/debug/index.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/ext/debug/index.js deleted file mode 100644 index 2b797664..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/ext/debug/index.js +++ /dev/null @@ -1,71 +0,0 @@ -"use strict"; -var protobuf = require("../.."); - -/** - * Debugging utility functions. Only present in debug builds. - * @namespace - */ -var debug = protobuf.debug = module.exports = {}; - -var codegen = protobuf.util.codegen; - -var debugFnRe = /function ([^(]+)\(([^)]*)\) {/g; - -// Counts number of calls to any generated function -function codegen_debug() { - codegen_debug.supported = codegen.supported; - codegen_debug.verbose = codegen.verbose; - var gen = codegen.apply(null, Array.prototype.slice.call(arguments)); - gen.str = (function(str) { return function str_debug() { - return str.apply(null, Array.prototype.slice.call(arguments)).replace(debugFnRe, "function $1($2) {\n\t$1.calls=($1.calls|0)+1"); - };})(gen.str); - return gen; -} - -/** - * Returns a list of unused types within the specified root. - * @param {NamespaceBase} ns Namespace to search - * @returns {Type[]} Unused types - */ -debug.unusedTypes = function unusedTypes(ns) { - - /* istanbul ignore if */ - if (!(ns instanceof protobuf.Namespace)) - throw TypeError("ns must be a Namespace"); - - /* istanbul ignore if */ - if (!ns.nested) - return []; - - var unused = []; - for (var names = Object.keys(ns.nested), i = 0; i < names.length; ++i) { - var nested = ns.nested[names[i]]; - if (nested instanceof protobuf.Type) { - var calls = (nested.encode.calls|0) - + (nested.decode.calls|0) - + (nested.verify.calls|0) - + (nested.toObject.calls|0) - + (nested.fromObject.calls|0); - if (!calls) - unused.push(nested); - } else if (nested instanceof protobuf.Namespace) - Array.prototype.push.apply(unused, unusedTypes(nested)); - } - return unused; -}; - -/** - * Enables debugging extensions. - * @returns {undefined} - */ -debug.enable = function enable() { - protobuf.util.codegen = codegen_debug; -}; - -/** - * Disables debugging extensions. - * @returns {undefined} - */ -debug.disable = function disable() { - protobuf.util.codegen = codegen; -}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/ext/descriptor/README.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/ext/descriptor/README.md deleted file mode 100644 index 3bc4c6c9..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/ext/descriptor/README.md +++ /dev/null @@ -1,72 +0,0 @@ -protobufjs/ext/descriptor -========================= - -Experimental extension for interoperability with [descriptor.proto](https://github.com/google/protobuf/blob/master/src/google/protobuf/descriptor.proto) types. - -Usage ------ - -```js -var protobuf = require("protobufjs"), // requires the full library - descriptor = require("protobufjs/ext/descriptor"); - -var root = ...; - -// convert any existing root instance to the corresponding descriptor type -var descriptorMsg = root.toDescriptor("proto2"); -// ^ returns a FileDescriptorSet message, see table below - -// encode to a descriptor buffer -var buffer = descriptor.FileDescriptorSet.encode(descriptorMsg).finish(); - -// decode from a descriptor buffer -var decodedDescriptor = descriptor.FileDescriptorSet.decode(buffer); - -// convert any existing descriptor to a root instance -root = protobuf.Root.fromDescriptor(decodedDescriptor); -// ^ expects a FileDescriptorSet message or buffer, see table below - -// and start all over again -``` - -API ---- - -The extension adds `.fromDescriptor(descriptor[, syntax])` and `#toDescriptor([syntax])` methods to reflection objects and exports the `.google.protobuf` namespace of the internally used `Root` instance containing the following types present in descriptor.proto: - -| Descriptor type | protobuf.js type | Remarks -|-------------------------------|------------------|--------- -| **FileDescriptorSet** | Root | -| FileDescriptorProto | | dependencies are not supported -| FileOptions | | -| FileOptionsOptimizeMode | | -| SourceCodeInfo | | not supported -| SourceCodeInfoLocation | | -| GeneratedCodeInfo | | not supported -| GeneratedCodeInfoAnnotation | | -| **DescriptorProto** | Type | -| MessageOptions | | -| DescriptorProtoExtensionRange | | -| DescriptorProtoReservedRange | | -| **FieldDescriptorProto** | Field | -| FieldDescriptorProtoLabel | | -| FieldDescriptorProtoType | | -| FieldOptions | | -| FieldOptionsCType | | -| FieldOptionsJSType | | -| **OneofDescriptorProto** | OneOf | -| OneofOptions | | -| **EnumDescriptorProto** | Enum | -| EnumOptions | | -| EnumValueDescriptorProto | | -| EnumValueOptions | | not supported -| **ServiceDescriptorProto** | Service | -| ServiceOptions | | -| **MethodDescriptorProto** | Method | -| MethodOptions | | -| UninterpretedOption | | not supported -| UninterpretedOptionNamePart | | - -Note that not all features of descriptor.proto translate perfectly to a protobuf.js root instance. A root instance has only limited knowlege of packages or individual files for example, which is then compensated by guessing and generating fictional file names. - -When using TypeScript, the respective interface types can be used to reference specific message instances (i.e. `protobuf.Message`). diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/ext/descriptor/index.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/ext/descriptor/index.d.ts deleted file mode 100644 index 1df2efcc..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/ext/descriptor/index.d.ts +++ /dev/null @@ -1,191 +0,0 @@ -import * as $protobuf from "../.."; -export const FileDescriptorSet: $protobuf.Type; - -export const FileDescriptorProto: $protobuf.Type; - -export const DescriptorProto: $protobuf.Type & { - ExtensionRange: $protobuf.Type, - ReservedRange: $protobuf.Type -}; - -export const FieldDescriptorProto: $protobuf.Type & { - Label: $protobuf.Enum, - Type: $protobuf.Enum -}; - -export const OneofDescriptorProto: $protobuf.Type; - -export const EnumDescriptorProto: $protobuf.Type; - -export const ServiceDescriptorProto: $protobuf.Type; - -export const EnumValueDescriptorProto: $protobuf.Type; - -export const MethodDescriptorProto: $protobuf.Type; - -export const FileOptions: $protobuf.Type & { - OptimizeMode: $protobuf.Enum -}; - -export const MessageOptions: $protobuf.Type; - -export const FieldOptions: $protobuf.Type & { - CType: $protobuf.Enum, - JSType: $protobuf.Enum -}; - -export const OneofOptions: $protobuf.Type; - -export const EnumOptions: $protobuf.Type; - -export const EnumValueOptions: $protobuf.Type; - -export const ServiceOptions: $protobuf.Type; - -export const MethodOptions: $protobuf.Type; - -export const UninterpretedOption: $protobuf.Type & { - NamePart: $protobuf.Type -}; - -export const SourceCodeInfo: $protobuf.Type & { - Location: $protobuf.Type -}; - -export const GeneratedCodeInfo: $protobuf.Type & { - Annotation: $protobuf.Type -}; - -export interface IFileDescriptorSet { - file: IFileDescriptorProto[]; -} - -export interface IFileDescriptorProto { - name?: string; - package?: string; - dependency?: any; - publicDependency?: any; - weakDependency?: any; - messageType?: IDescriptorProto[]; - enumType?: IEnumDescriptorProto[]; - service?: IServiceDescriptorProto[]; - extension?: IFieldDescriptorProto[]; - options?: IFileOptions; - sourceCodeInfo?: any; - syntax?: string; -} - -export interface IFileOptions { - javaPackage?: string; - javaOuterClassname?: string; - javaMultipleFiles?: boolean; - javaGenerateEqualsAndHash?: boolean; - javaStringCheckUtf8?: boolean; - optimizeFor?: IFileOptionsOptimizeMode; - goPackage?: string; - ccGenericServices?: boolean; - javaGenericServices?: boolean; - pyGenericServices?: boolean; - deprecated?: boolean; - ccEnableArenas?: boolean; - objcClassPrefix?: string; - csharpNamespace?: string; -} - -type IFileOptionsOptimizeMode = number; - -export interface IDescriptorProto { - name?: string; - field?: IFieldDescriptorProto[]; - extension?: IFieldDescriptorProto[]; - nestedType?: IDescriptorProto[]; - enumType?: IEnumDescriptorProto[]; - extensionRange?: IDescriptorProtoExtensionRange[]; - oneofDecl?: IOneofDescriptorProto[]; - options?: IMessageOptions; - reservedRange?: IDescriptorProtoReservedRange[]; - reservedName?: string[]; -} - -export interface IMessageOptions { - mapEntry?: boolean; -} - -export interface IDescriptorProtoExtensionRange { - start?: number; - end?: number; -} - -export interface IDescriptorProtoReservedRange { - start?: number; - end?: number; -} - -export interface IFieldDescriptorProto { - name?: string; - number?: number; - label?: IFieldDescriptorProtoLabel; - type?: IFieldDescriptorProtoType; - typeName?: string; - extendee?: string; - defaultValue?: string; - oneofIndex?: number; - jsonName?: any; - options?: IFieldOptions; -} - -type IFieldDescriptorProtoLabel = number; - -type IFieldDescriptorProtoType = number; - -export interface IFieldOptions { - packed?: boolean; - jstype?: IFieldOptionsJSType; -} - -type IFieldOptionsJSType = number; - -export interface IEnumDescriptorProto { - name?: string; - value?: IEnumValueDescriptorProto[]; - options?: IEnumOptions; -} - -export interface IEnumValueDescriptorProto { - name?: string; - number?: number; - options?: any; -} - -export interface IEnumOptions { - allowAlias?: boolean; - deprecated?: boolean; -} - -export interface IOneofDescriptorProto { - name?: string; - options?: any; -} - -export interface IServiceDescriptorProto { - name?: string; - method?: IMethodDescriptorProto[]; - options?: IServiceOptions; -} - -export interface IServiceOptions { - deprecated?: boolean; -} - -export interface IMethodDescriptorProto { - name?: string; - inputType?: string; - outputType?: string; - options?: IMethodOptions; - clientStreaming?: boolean; - serverStreaming?: boolean; -} - -export interface IMethodOptions { - deprecated?: boolean; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/ext/descriptor/index.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/ext/descriptor/index.js deleted file mode 100644 index 6aafd2ab..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/ext/descriptor/index.js +++ /dev/null @@ -1,1052 +0,0 @@ -"use strict"; -var $protobuf = require("../.."); -module.exports = exports = $protobuf.descriptor = $protobuf.Root.fromJSON(require("../../google/protobuf/descriptor.json")).lookup(".google.protobuf"); - -var Namespace = $protobuf.Namespace, - Root = $protobuf.Root, - Enum = $protobuf.Enum, - Type = $protobuf.Type, - Field = $protobuf.Field, - MapField = $protobuf.MapField, - OneOf = $protobuf.OneOf, - Service = $protobuf.Service, - Method = $protobuf.Method; - -// --- Root --- - -/** - * Properties of a FileDescriptorSet message. - * @interface IFileDescriptorSet - * @property {IFileDescriptorProto[]} file Files - */ - -/** - * Properties of a FileDescriptorProto message. - * @interface IFileDescriptorProto - * @property {string} [name] File name - * @property {string} [package] Package - * @property {*} [dependency] Not supported - * @property {*} [publicDependency] Not supported - * @property {*} [weakDependency] Not supported - * @property {IDescriptorProto[]} [messageType] Nested message types - * @property {IEnumDescriptorProto[]} [enumType] Nested enums - * @property {IServiceDescriptorProto[]} [service] Nested services - * @property {IFieldDescriptorProto[]} [extension] Nested extension fields - * @property {IFileOptions} [options] Options - * @property {*} [sourceCodeInfo] Not supported - * @property {string} [syntax="proto2"] Syntax - */ - -/** - * Properties of a FileOptions message. - * @interface IFileOptions - * @property {string} [javaPackage] - * @property {string} [javaOuterClassname] - * @property {boolean} [javaMultipleFiles] - * @property {boolean} [javaGenerateEqualsAndHash] - * @property {boolean} [javaStringCheckUtf8] - * @property {IFileOptionsOptimizeMode} [optimizeFor=1] - * @property {string} [goPackage] - * @property {boolean} [ccGenericServices] - * @property {boolean} [javaGenericServices] - * @property {boolean} [pyGenericServices] - * @property {boolean} [deprecated] - * @property {boolean} [ccEnableArenas] - * @property {string} [objcClassPrefix] - * @property {string} [csharpNamespace] - */ - -/** - * Values of he FileOptions.OptimizeMode enum. - * @typedef IFileOptionsOptimizeMode - * @type {number} - * @property {number} SPEED=1 - * @property {number} CODE_SIZE=2 - * @property {number} LITE_RUNTIME=3 - */ - -/** - * Creates a root from a descriptor set. - * @param {IFileDescriptorSet|Reader|Uint8Array} descriptor Descriptor - * @returns {Root} Root instance - */ -Root.fromDescriptor = function fromDescriptor(descriptor) { - - // Decode the descriptor message if specified as a buffer: - if (typeof descriptor.length === "number") - descriptor = exports.FileDescriptorSet.decode(descriptor); - - var root = new Root(); - - if (descriptor.file) { - var fileDescriptor, - filePackage; - for (var j = 0, i; j < descriptor.file.length; ++j) { - filePackage = root; - if ((fileDescriptor = descriptor.file[j])["package"] && fileDescriptor["package"].length) - filePackage = root.define(fileDescriptor["package"]); - if (fileDescriptor.name && fileDescriptor.name.length) - root.files.push(filePackage.filename = fileDescriptor.name); - if (fileDescriptor.messageType) - for (i = 0; i < fileDescriptor.messageType.length; ++i) - filePackage.add(Type.fromDescriptor(fileDescriptor.messageType[i], fileDescriptor.syntax)); - if (fileDescriptor.enumType) - for (i = 0; i < fileDescriptor.enumType.length; ++i) - filePackage.add(Enum.fromDescriptor(fileDescriptor.enumType[i])); - if (fileDescriptor.extension) - for (i = 0; i < fileDescriptor.extension.length; ++i) - filePackage.add(Field.fromDescriptor(fileDescriptor.extension[i])); - if (fileDescriptor.service) - for (i = 0; i < fileDescriptor.service.length; ++i) - filePackage.add(Service.fromDescriptor(fileDescriptor.service[i])); - var opts = fromDescriptorOptions(fileDescriptor.options, exports.FileOptions); - if (opts) { - var ks = Object.keys(opts); - for (i = 0; i < ks.length; ++i) - filePackage.setOption(ks[i], opts[ks[i]]); - } - } - } - - return root; -}; - -/** - * Converts a root to a descriptor set. - * @returns {Message} Descriptor - * @param {string} [syntax="proto2"] Syntax - */ -Root.prototype.toDescriptor = function toDescriptor(syntax) { - var set = exports.FileDescriptorSet.create(); - Root_toDescriptorRecursive(this, set.file, syntax); - return set; -}; - -// Traverses a namespace and assembles the descriptor set -function Root_toDescriptorRecursive(ns, files, syntax) { - - // Create a new file - var file = exports.FileDescriptorProto.create({ name: ns.filename || (ns.fullName.substring(1).replace(/\./g, "_") || "root") + ".proto" }); - if (syntax) - file.syntax = syntax; - if (!(ns instanceof Root)) - file["package"] = ns.fullName.substring(1); - - // Add nested types - for (var i = 0, nested; i < ns.nestedArray.length; ++i) - if ((nested = ns._nestedArray[i]) instanceof Type) - file.messageType.push(nested.toDescriptor(syntax)); - else if (nested instanceof Enum) - file.enumType.push(nested.toDescriptor()); - else if (nested instanceof Field) - file.extension.push(nested.toDescriptor(syntax)); - else if (nested instanceof Service) - file.service.push(nested.toDescriptor()); - else if (nested instanceof /* plain */ Namespace) - Root_toDescriptorRecursive(nested, files, syntax); // requires new file - - // Keep package-level options - file.options = toDescriptorOptions(ns.options, exports.FileOptions); - - // And keep the file only if there is at least one nested object - if (file.messageType.length + file.enumType.length + file.extension.length + file.service.length) - files.push(file); -} - -// --- Type --- - -/** - * Properties of a DescriptorProto message. - * @interface IDescriptorProto - * @property {string} [name] Message type name - * @property {IFieldDescriptorProto[]} [field] Fields - * @property {IFieldDescriptorProto[]} [extension] Extension fields - * @property {IDescriptorProto[]} [nestedType] Nested message types - * @property {IEnumDescriptorProto[]} [enumType] Nested enums - * @property {IDescriptorProtoExtensionRange[]} [extensionRange] Extension ranges - * @property {IOneofDescriptorProto[]} [oneofDecl] Oneofs - * @property {IMessageOptions} [options] Not supported - * @property {IDescriptorProtoReservedRange[]} [reservedRange] Reserved ranges - * @property {string[]} [reservedName] Reserved names - */ - -/** - * Properties of a MessageOptions message. - * @interface IMessageOptions - * @property {boolean} [mapEntry=false] Whether this message is a map entry - */ - -/** - * Properties of an ExtensionRange message. - * @interface IDescriptorProtoExtensionRange - * @property {number} [start] Start field id - * @property {number} [end] End field id - */ - -/** - * Properties of a ReservedRange message. - * @interface IDescriptorProtoReservedRange - * @property {number} [start] Start field id - * @property {number} [end] End field id - */ - -var unnamedMessageIndex = 0; - -/** - * Creates a type from a descriptor. - * @param {IDescriptorProto|Reader|Uint8Array} descriptor Descriptor - * @param {string} [syntax="proto2"] Syntax - * @returns {Type} Type instance - */ -Type.fromDescriptor = function fromDescriptor(descriptor, syntax) { - - // Decode the descriptor message if specified as a buffer: - if (typeof descriptor.length === "number") - descriptor = exports.DescriptorProto.decode(descriptor); - - // Create the message type - var type = new Type(descriptor.name.length ? descriptor.name : "Type" + unnamedMessageIndex++, fromDescriptorOptions(descriptor.options, exports.MessageOptions)), - i; - - /* Oneofs */ if (descriptor.oneofDecl) - for (i = 0; i < descriptor.oneofDecl.length; ++i) - type.add(OneOf.fromDescriptor(descriptor.oneofDecl[i])); - /* Fields */ if (descriptor.field) - for (i = 0; i < descriptor.field.length; ++i) { - var field = Field.fromDescriptor(descriptor.field[i], syntax); - type.add(field); - if (descriptor.field[i].hasOwnProperty("oneofIndex")) // eslint-disable-line no-prototype-builtins - type.oneofsArray[descriptor.field[i].oneofIndex].add(field); - } - /* Extension fields */ if (descriptor.extension) - for (i = 0; i < descriptor.extension.length; ++i) - type.add(Field.fromDescriptor(descriptor.extension[i], syntax)); - /* Nested types */ if (descriptor.nestedType) - for (i = 0; i < descriptor.nestedType.length; ++i) { - type.add(Type.fromDescriptor(descriptor.nestedType[i], syntax)); - if (descriptor.nestedType[i].options && descriptor.nestedType[i].options.mapEntry) - type.setOption("map_entry", true); - } - /* Nested enums */ if (descriptor.enumType) - for (i = 0; i < descriptor.enumType.length; ++i) - type.add(Enum.fromDescriptor(descriptor.enumType[i])); - /* Extension ranges */ if (descriptor.extensionRange && descriptor.extensionRange.length) { - type.extensions = []; - for (i = 0; i < descriptor.extensionRange.length; ++i) - type.extensions.push([ descriptor.extensionRange[i].start, descriptor.extensionRange[i].end ]); - } - /* Reserved... */ if (descriptor.reservedRange && descriptor.reservedRange.length || descriptor.reservedName && descriptor.reservedName.length) { - type.reserved = []; - /* Ranges */ if (descriptor.reservedRange) - for (i = 0; i < descriptor.reservedRange.length; ++i) - type.reserved.push([ descriptor.reservedRange[i].start, descriptor.reservedRange[i].end ]); - /* Names */ if (descriptor.reservedName) - for (i = 0; i < descriptor.reservedName.length; ++i) - type.reserved.push(descriptor.reservedName[i]); - } - - return type; -}; - -/** - * Converts a type to a descriptor. - * @returns {Message} Descriptor - * @param {string} [syntax="proto2"] Syntax - */ -Type.prototype.toDescriptor = function toDescriptor(syntax) { - var descriptor = exports.DescriptorProto.create({ name: this.name }), - i; - - /* Fields */ for (i = 0; i < this.fieldsArray.length; ++i) { - var fieldDescriptor; - descriptor.field.push(fieldDescriptor = this._fieldsArray[i].toDescriptor(syntax)); - if (this._fieldsArray[i] instanceof MapField) { // map fields are repeated FieldNameEntry - var keyType = toDescriptorType(this._fieldsArray[i].keyType, this._fieldsArray[i].resolvedKeyType), - valueType = toDescriptorType(this._fieldsArray[i].type, this._fieldsArray[i].resolvedType), - valueTypeName = valueType === /* type */ 11 || valueType === /* enum */ 14 - ? this._fieldsArray[i].resolvedType && shortname(this.parent, this._fieldsArray[i].resolvedType) || this._fieldsArray[i].type - : undefined; - descriptor.nestedType.push(exports.DescriptorProto.create({ - name: fieldDescriptor.typeName, - field: [ - exports.FieldDescriptorProto.create({ name: "key", number: 1, label: 1, type: keyType }), // can't reference a type or enum - exports.FieldDescriptorProto.create({ name: "value", number: 2, label: 1, type: valueType, typeName: valueTypeName }) - ], - options: exports.MessageOptions.create({ mapEntry: true }) - })); - } - } - /* Oneofs */ for (i = 0; i < this.oneofsArray.length; ++i) - descriptor.oneofDecl.push(this._oneofsArray[i].toDescriptor()); - /* Nested... */ for (i = 0; i < this.nestedArray.length; ++i) { - /* Extension fields */ if (this._nestedArray[i] instanceof Field) - descriptor.field.push(this._nestedArray[i].toDescriptor(syntax)); - /* Types */ else if (this._nestedArray[i] instanceof Type) - descriptor.nestedType.push(this._nestedArray[i].toDescriptor(syntax)); - /* Enums */ else if (this._nestedArray[i] instanceof Enum) - descriptor.enumType.push(this._nestedArray[i].toDescriptor()); - // plain nested namespaces become packages instead in Root#toDescriptor - } - /* Extension ranges */ if (this.extensions) - for (i = 0; i < this.extensions.length; ++i) - descriptor.extensionRange.push(exports.DescriptorProto.ExtensionRange.create({ start: this.extensions[i][0], end: this.extensions[i][1] })); - /* Reserved... */ if (this.reserved) - for (i = 0; i < this.reserved.length; ++i) - /* Names */ if (typeof this.reserved[i] === "string") - descriptor.reservedName.push(this.reserved[i]); - /* Ranges */ else - descriptor.reservedRange.push(exports.DescriptorProto.ReservedRange.create({ start: this.reserved[i][0], end: this.reserved[i][1] })); - - descriptor.options = toDescriptorOptions(this.options, exports.MessageOptions); - - return descriptor; -}; - -// --- Field --- - -/** - * Properties of a FieldDescriptorProto message. - * @interface IFieldDescriptorProto - * @property {string} [name] Field name - * @property {number} [number] Field id - * @property {IFieldDescriptorProtoLabel} [label] Field rule - * @property {IFieldDescriptorProtoType} [type] Field basic type - * @property {string} [typeName] Field type name - * @property {string} [extendee] Extended type name - * @property {string} [defaultValue] Literal default value - * @property {number} [oneofIndex] Oneof index if part of a oneof - * @property {*} [jsonName] Not supported - * @property {IFieldOptions} [options] Field options - */ - -/** - * Values of the FieldDescriptorProto.Label enum. - * @typedef IFieldDescriptorProtoLabel - * @type {number} - * @property {number} LABEL_OPTIONAL=1 - * @property {number} LABEL_REQUIRED=2 - * @property {number} LABEL_REPEATED=3 - */ - -/** - * Values of the FieldDescriptorProto.Type enum. - * @typedef IFieldDescriptorProtoType - * @type {number} - * @property {number} TYPE_DOUBLE=1 - * @property {number} TYPE_FLOAT=2 - * @property {number} TYPE_INT64=3 - * @property {number} TYPE_UINT64=4 - * @property {number} TYPE_INT32=5 - * @property {number} TYPE_FIXED64=6 - * @property {number} TYPE_FIXED32=7 - * @property {number} TYPE_BOOL=8 - * @property {number} TYPE_STRING=9 - * @property {number} TYPE_GROUP=10 - * @property {number} TYPE_MESSAGE=11 - * @property {number} TYPE_BYTES=12 - * @property {number} TYPE_UINT32=13 - * @property {number} TYPE_ENUM=14 - * @property {number} TYPE_SFIXED32=15 - * @property {number} TYPE_SFIXED64=16 - * @property {number} TYPE_SINT32=17 - * @property {number} TYPE_SINT64=18 - */ - -/** - * Properties of a FieldOptions message. - * @interface IFieldOptions - * @property {boolean} [packed] Whether packed or not (defaults to `false` for proto2 and `true` for proto3) - * @property {IFieldOptionsJSType} [jstype] JavaScript value type (not used by protobuf.js) - */ - -/** - * Values of the FieldOptions.JSType enum. - * @typedef IFieldOptionsJSType - * @type {number} - * @property {number} JS_NORMAL=0 - * @property {number} JS_STRING=1 - * @property {number} JS_NUMBER=2 - */ - -// copied here from parse.js -var numberRe = /^(?![eE])[0-9]*(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?$/; - -/** - * Creates a field from a descriptor. - * @param {IFieldDescriptorProto|Reader|Uint8Array} descriptor Descriptor - * @param {string} [syntax="proto2"] Syntax - * @returns {Field} Field instance - */ -Field.fromDescriptor = function fromDescriptor(descriptor, syntax) { - - // Decode the descriptor message if specified as a buffer: - if (typeof descriptor.length === "number") - descriptor = exports.DescriptorProto.decode(descriptor); - - if (typeof descriptor.number !== "number") - throw Error("missing field id"); - - // Rewire field type - var fieldType; - if (descriptor.typeName && descriptor.typeName.length) - fieldType = descriptor.typeName; - else - fieldType = fromDescriptorType(descriptor.type); - - // Rewire field rule - var fieldRule; - switch (descriptor.label) { - // 0 is reserved for errors - case 1: fieldRule = undefined; break; - case 2: fieldRule = "required"; break; - case 3: fieldRule = "repeated"; break; - default: throw Error("illegal label: " + descriptor.label); - } - - var extendee = descriptor.extendee; - if (descriptor.extendee !== undefined) { - extendee = extendee.length ? extendee : undefined; - } - var field = new Field( - descriptor.name.length ? descriptor.name : "field" + descriptor.number, - descriptor.number, - fieldType, - fieldRule, - extendee - ); - - field.options = fromDescriptorOptions(descriptor.options, exports.FieldOptions); - - if (descriptor.defaultValue && descriptor.defaultValue.length) { - var defaultValue = descriptor.defaultValue; - switch (defaultValue) { - case "true": case "TRUE": - defaultValue = true; - break; - case "false": case "FALSE": - defaultValue = false; - break; - default: - var match = numberRe.exec(defaultValue); - if (match) - defaultValue = parseInt(defaultValue); // eslint-disable-line radix - break; - } - field.setOption("default", defaultValue); - } - - if (packableDescriptorType(descriptor.type)) { - if (syntax === "proto3") { // defaults to packed=true (internal preset is packed=true) - if (descriptor.options && !descriptor.options.packed) - field.setOption("packed", false); - } else if (!(descriptor.options && descriptor.options.packed)) // defaults to packed=false - field.setOption("packed", false); - } - - return field; -}; - -/** - * Converts a field to a descriptor. - * @returns {Message} Descriptor - * @param {string} [syntax="proto2"] Syntax - */ -Field.prototype.toDescriptor = function toDescriptor(syntax) { - var descriptor = exports.FieldDescriptorProto.create({ name: this.name, number: this.id }); - - if (this.map) { - - descriptor.type = 11; // message - descriptor.typeName = $protobuf.util.ucFirst(this.name); // fieldName -> FieldNameEntry (built in Type#toDescriptor) - descriptor.label = 3; // repeated - - } else { - - // Rewire field type - switch (descriptor.type = toDescriptorType(this.type, this.resolve().resolvedType)) { - case 10: // group - case 11: // type - case 14: // enum - descriptor.typeName = this.resolvedType ? shortname(this.parent, this.resolvedType) : this.type; - break; - } - - // Rewire field rule - switch (this.rule) { - case "repeated": descriptor.label = 3; break; - case "required": descriptor.label = 2; break; - default: descriptor.label = 1; break; - } - - } - - // Handle extension field - descriptor.extendee = this.extensionField ? this.extensionField.parent.fullName : this.extend; - - // Handle part of oneof - if (this.partOf) - if ((descriptor.oneofIndex = this.parent.oneofsArray.indexOf(this.partOf)) < 0) - throw Error("missing oneof"); - - if (this.options) { - descriptor.options = toDescriptorOptions(this.options, exports.FieldOptions); - if (this.options["default"] != null) - descriptor.defaultValue = String(this.options["default"]); - } - - if (syntax === "proto3") { // defaults to packed=true - if (!this.packed) - (descriptor.options || (descriptor.options = exports.FieldOptions.create())).packed = false; - } else if (this.packed) // defaults to packed=false - (descriptor.options || (descriptor.options = exports.FieldOptions.create())).packed = true; - - return descriptor; -}; - -// --- Enum --- - -/** - * Properties of an EnumDescriptorProto message. - * @interface IEnumDescriptorProto - * @property {string} [name] Enum name - * @property {IEnumValueDescriptorProto[]} [value] Enum values - * @property {IEnumOptions} [options] Enum options - */ - -/** - * Properties of an EnumValueDescriptorProto message. - * @interface IEnumValueDescriptorProto - * @property {string} [name] Name - * @property {number} [number] Value - * @property {*} [options] Not supported - */ - -/** - * Properties of an EnumOptions message. - * @interface IEnumOptions - * @property {boolean} [allowAlias] Whether aliases are allowed - * @property {boolean} [deprecated] - */ - -var unnamedEnumIndex = 0; - -/** - * Creates an enum from a descriptor. - * @param {IEnumDescriptorProto|Reader|Uint8Array} descriptor Descriptor - * @returns {Enum} Enum instance - */ -Enum.fromDescriptor = function fromDescriptor(descriptor) { - - // Decode the descriptor message if specified as a buffer: - if (typeof descriptor.length === "number") - descriptor = exports.EnumDescriptorProto.decode(descriptor); - - // Construct values object - var values = {}; - if (descriptor.value) - for (var i = 0; i < descriptor.value.length; ++i) { - var name = descriptor.value[i].name, - value = descriptor.value[i].number || 0; - values[name && name.length ? name : "NAME" + value] = value; - } - - return new Enum( - descriptor.name && descriptor.name.length ? descriptor.name : "Enum" + unnamedEnumIndex++, - values, - fromDescriptorOptions(descriptor.options, exports.EnumOptions) - ); -}; - -/** - * Converts an enum to a descriptor. - * @returns {Message} Descriptor - */ -Enum.prototype.toDescriptor = function toDescriptor() { - - // Values - var values = []; - for (var i = 0, ks = Object.keys(this.values); i < ks.length; ++i) - values.push(exports.EnumValueDescriptorProto.create({ name: ks[i], number: this.values[ks[i]] })); - - return exports.EnumDescriptorProto.create({ - name: this.name, - value: values, - options: toDescriptorOptions(this.options, exports.EnumOptions) - }); -}; - -// --- OneOf --- - -/** - * Properties of a OneofDescriptorProto message. - * @interface IOneofDescriptorProto - * @property {string} [name] Oneof name - * @property {*} [options] Not supported - */ - -var unnamedOneofIndex = 0; - -/** - * Creates a oneof from a descriptor. - * @param {IOneofDescriptorProto|Reader|Uint8Array} descriptor Descriptor - * @returns {OneOf} OneOf instance - */ -OneOf.fromDescriptor = function fromDescriptor(descriptor) { - - // Decode the descriptor message if specified as a buffer: - if (typeof descriptor.length === "number") - descriptor = exports.OneofDescriptorProto.decode(descriptor); - - return new OneOf( - // unnamedOneOfIndex is global, not per type, because we have no ref to a type here - descriptor.name && descriptor.name.length ? descriptor.name : "oneof" + unnamedOneofIndex++ - // fromDescriptorOptions(descriptor.options, exports.OneofOptions) - only uninterpreted_option - ); -}; - -/** - * Converts a oneof to a descriptor. - * @returns {Message} Descriptor - */ -OneOf.prototype.toDescriptor = function toDescriptor() { - return exports.OneofDescriptorProto.create({ - name: this.name - // options: toDescriptorOptions(this.options, exports.OneofOptions) - only uninterpreted_option - }); -}; - -// --- Service --- - -/** - * Properties of a ServiceDescriptorProto message. - * @interface IServiceDescriptorProto - * @property {string} [name] Service name - * @property {IMethodDescriptorProto[]} [method] Methods - * @property {IServiceOptions} [options] Options - */ - -/** - * Properties of a ServiceOptions message. - * @interface IServiceOptions - * @property {boolean} [deprecated] - */ - -var unnamedServiceIndex = 0; - -/** - * Creates a service from a descriptor. - * @param {IServiceDescriptorProto|Reader|Uint8Array} descriptor Descriptor - * @returns {Service} Service instance - */ -Service.fromDescriptor = function fromDescriptor(descriptor) { - - // Decode the descriptor message if specified as a buffer: - if (typeof descriptor.length === "number") - descriptor = exports.ServiceDescriptorProto.decode(descriptor); - - var service = new Service(descriptor.name && descriptor.name.length ? descriptor.name : "Service" + unnamedServiceIndex++, fromDescriptorOptions(descriptor.options, exports.ServiceOptions)); - if (descriptor.method) - for (var i = 0; i < descriptor.method.length; ++i) - service.add(Method.fromDescriptor(descriptor.method[i])); - - return service; -}; - -/** - * Converts a service to a descriptor. - * @returns {Message} Descriptor - */ -Service.prototype.toDescriptor = function toDescriptor() { - - // Methods - var methods = []; - for (var i = 0; i < this.methodsArray.length; ++i) - methods.push(this._methodsArray[i].toDescriptor()); - - return exports.ServiceDescriptorProto.create({ - name: this.name, - method: methods, - options: toDescriptorOptions(this.options, exports.ServiceOptions) - }); -}; - -// --- Method --- - -/** - * Properties of a MethodDescriptorProto message. - * @interface IMethodDescriptorProto - * @property {string} [name] Method name - * @property {string} [inputType] Request type name - * @property {string} [outputType] Response type name - * @property {IMethodOptions} [options] Not supported - * @property {boolean} [clientStreaming=false] Whether requests are streamed - * @property {boolean} [serverStreaming=false] Whether responses are streamed - */ - -/** - * Properties of a MethodOptions message. - * @interface IMethodOptions - * @property {boolean} [deprecated] - */ - -var unnamedMethodIndex = 0; - -/** - * Creates a method from a descriptor. - * @param {IMethodDescriptorProto|Reader|Uint8Array} descriptor Descriptor - * @returns {Method} Reflected method instance - */ -Method.fromDescriptor = function fromDescriptor(descriptor) { - - // Decode the descriptor message if specified as a buffer: - if (typeof descriptor.length === "number") - descriptor = exports.MethodDescriptorProto.decode(descriptor); - - return new Method( - // unnamedMethodIndex is global, not per service, because we have no ref to a service here - descriptor.name && descriptor.name.length ? descriptor.name : "Method" + unnamedMethodIndex++, - "rpc", - descriptor.inputType, - descriptor.outputType, - Boolean(descriptor.clientStreaming), - Boolean(descriptor.serverStreaming), - fromDescriptorOptions(descriptor.options, exports.MethodOptions) - ); -}; - -/** - * Converts a method to a descriptor. - * @returns {Message} Descriptor - */ -Method.prototype.toDescriptor = function toDescriptor() { - return exports.MethodDescriptorProto.create({ - name: this.name, - inputType: this.resolvedRequestType ? this.resolvedRequestType.fullName : this.requestType, - outputType: this.resolvedResponseType ? this.resolvedResponseType.fullName : this.responseType, - clientStreaming: this.requestStream, - serverStreaming: this.responseStream, - options: toDescriptorOptions(this.options, exports.MethodOptions) - }); -}; - -// --- utility --- - -// Converts a descriptor type to a protobuf.js basic type -function fromDescriptorType(type) { - switch (type) { - // 0 is reserved for errors - case 1: return "double"; - case 2: return "float"; - case 3: return "int64"; - case 4: return "uint64"; - case 5: return "int32"; - case 6: return "fixed64"; - case 7: return "fixed32"; - case 8: return "bool"; - case 9: return "string"; - case 12: return "bytes"; - case 13: return "uint32"; - case 15: return "sfixed32"; - case 16: return "sfixed64"; - case 17: return "sint32"; - case 18: return "sint64"; - } - throw Error("illegal type: " + type); -} - -// Tests if a descriptor type is packable -function packableDescriptorType(type) { - switch (type) { - case 1: // double - case 2: // float - case 3: // int64 - case 4: // uint64 - case 5: // int32 - case 6: // fixed64 - case 7: // fixed32 - case 8: // bool - case 13: // uint32 - case 14: // enum (!) - case 15: // sfixed32 - case 16: // sfixed64 - case 17: // sint32 - case 18: // sint64 - return true; - } - return false; -} - -// Converts a protobuf.js basic type to a descriptor type -function toDescriptorType(type, resolvedType) { - switch (type) { - // 0 is reserved for errors - case "double": return 1; - case "float": return 2; - case "int64": return 3; - case "uint64": return 4; - case "int32": return 5; - case "fixed64": return 6; - case "fixed32": return 7; - case "bool": return 8; - case "string": return 9; - case "bytes": return 12; - case "uint32": return 13; - case "sfixed32": return 15; - case "sfixed64": return 16; - case "sint32": return 17; - case "sint64": return 18; - } - if (resolvedType instanceof Enum) - return 14; - if (resolvedType instanceof Type) - return resolvedType.group ? 10 : 11; - throw Error("illegal type: " + type); -} - -// Converts descriptor options to an options object -function fromDescriptorOptions(options, type) { - if (!options) - return undefined; - var out = []; - for (var i = 0, field, key, val; i < type.fieldsArray.length; ++i) - if ((key = (field = type._fieldsArray[i]).name) !== "uninterpretedOption") - if (options.hasOwnProperty(key)) { // eslint-disable-line no-prototype-builtins - val = options[key]; - if (field.resolvedType instanceof Enum && typeof val === "number" && field.resolvedType.valuesById[val] !== undefined) - val = field.resolvedType.valuesById[val]; - out.push(underScore(key), val); - } - return out.length ? $protobuf.util.toObject(out) : undefined; -} - -// Converts an options object to descriptor options -function toDescriptorOptions(options, type) { - if (!options) - return undefined; - var out = []; - for (var i = 0, ks = Object.keys(options), key, val; i < ks.length; ++i) { - val = options[key = ks[i]]; - if (key === "default") - continue; - var field = type.fields[key]; - if (!field && !(field = type.fields[key = $protobuf.util.camelCase(key)])) - continue; - out.push(key, val); - } - return out.length ? type.fromObject($protobuf.util.toObject(out)) : undefined; -} - -// Calculates the shortest relative path from `from` to `to`. -function shortname(from, to) { - var fromPath = from.fullName.split("."), - toPath = to.fullName.split("."), - i = 0, - j = 0, - k = toPath.length - 1; - if (!(from instanceof Root) && to instanceof Namespace) - while (i < fromPath.length && j < k && fromPath[i] === toPath[j]) { - var other = to.lookup(fromPath[i++], true); - if (other !== null && other !== to) - break; - ++j; - } - else - for (; i < fromPath.length && j < k && fromPath[i] === toPath[j]; ++i, ++j); - return toPath.slice(j).join("."); -} - -// copied here from cli/targets/proto.js -function underScore(str) { - return str.substring(0,1) - + str.substring(1) - .replace(/([A-Z])(?=[a-z]|$)/g, function($0, $1) { return "_" + $1.toLowerCase(); }); -} - -// --- exports --- - -/** - * Reflected file descriptor set. - * @name FileDescriptorSet - * @type {Type} - * @const - * @tstype $protobuf.Type - */ - -/** - * Reflected file descriptor proto. - * @name FileDescriptorProto - * @type {Type} - * @const - * @tstype $protobuf.Type - */ - -/** - * Reflected descriptor proto. - * @name DescriptorProto - * @type {Type} - * @property {Type} ExtensionRange - * @property {Type} ReservedRange - * @const - * @tstype $protobuf.Type & { - * ExtensionRange: $protobuf.Type, - * ReservedRange: $protobuf.Type - * } - */ - -/** - * Reflected field descriptor proto. - * @name FieldDescriptorProto - * @type {Type} - * @property {Enum} Label - * @property {Enum} Type - * @const - * @tstype $protobuf.Type & { - * Label: $protobuf.Enum, - * Type: $protobuf.Enum - * } - */ - -/** - * Reflected oneof descriptor proto. - * @name OneofDescriptorProto - * @type {Type} - * @const - * @tstype $protobuf.Type - */ - -/** - * Reflected enum descriptor proto. - * @name EnumDescriptorProto - * @type {Type} - * @const - * @tstype $protobuf.Type - */ - -/** - * Reflected service descriptor proto. - * @name ServiceDescriptorProto - * @type {Type} - * @const - * @tstype $protobuf.Type - */ - -/** - * Reflected enum value descriptor proto. - * @name EnumValueDescriptorProto - * @type {Type} - * @const - * @tstype $protobuf.Type - */ - -/** - * Reflected method descriptor proto. - * @name MethodDescriptorProto - * @type {Type} - * @const - * @tstype $protobuf.Type - */ - -/** - * Reflected file options. - * @name FileOptions - * @type {Type} - * @property {Enum} OptimizeMode - * @const - * @tstype $protobuf.Type & { - * OptimizeMode: $protobuf.Enum - * } - */ - -/** - * Reflected message options. - * @name MessageOptions - * @type {Type} - * @const - * @tstype $protobuf.Type - */ - -/** - * Reflected field options. - * @name FieldOptions - * @type {Type} - * @property {Enum} CType - * @property {Enum} JSType - * @const - * @tstype $protobuf.Type & { - * CType: $protobuf.Enum, - * JSType: $protobuf.Enum - * } - */ - -/** - * Reflected oneof options. - * @name OneofOptions - * @type {Type} - * @const - * @tstype $protobuf.Type - */ - -/** - * Reflected enum options. - * @name EnumOptions - * @type {Type} - * @const - * @tstype $protobuf.Type - */ - -/** - * Reflected enum value options. - * @name EnumValueOptions - * @type {Type} - * @const - * @tstype $protobuf.Type - */ - -/** - * Reflected service options. - * @name ServiceOptions - * @type {Type} - * @const - * @tstype $protobuf.Type - */ - -/** - * Reflected method options. - * @name MethodOptions - * @type {Type} - * @const - * @tstype $protobuf.Type - */ - -/** - * Reflected uninterpretet option. - * @name UninterpretedOption - * @type {Type} - * @property {Type} NamePart - * @const - * @tstype $protobuf.Type & { - * NamePart: $protobuf.Type - * } - */ - -/** - * Reflected source code info. - * @name SourceCodeInfo - * @type {Type} - * @property {Type} Location - * @const - * @tstype $protobuf.Type & { - * Location: $protobuf.Type - * } - */ - -/** - * Reflected generated code info. - * @name GeneratedCodeInfo - * @type {Type} - * @property {Type} Annotation - * @const - * @tstype $protobuf.Type & { - * Annotation: $protobuf.Type - * } - */ diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/ext/descriptor/test.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/ext/descriptor/test.js deleted file mode 100644 index ceb80f82..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/ext/descriptor/test.js +++ /dev/null @@ -1,54 +0,0 @@ -/*eslint-disable no-console*/ -"use strict"; -var protobuf = require("../../"), - descriptor = require("."); - -/* var proto = { - nested: { - Message: { - fields: { - foo: { - type: "string", - id: 1 - } - }, - nested: { - SubMessage: { - fields: {} - } - } - }, - Enum: { - values: { - ONE: 1, - TWO: 2 - } - } - } -}; */ - -// var root = protobuf.Root.fromJSON(proto).resolveAll(); -var root = protobuf.loadSync("tests/data/google/protobuf/descriptor.proto").resolveAll(); - -// console.log("Original proto", JSON.stringify(root, null, 2)); - -var msg = root.toDescriptor(); - -// console.log("\nDescriptor", JSON.stringify(msg.toObject(), null, 2)); - -var buf = descriptor.FileDescriptorSet.encode(msg).finish(); -var root2 = protobuf.Root.fromDescriptor(buf, "proto2").resolveAll(); - -// console.log("\nDecoded proto", JSON.stringify(root2, null, 2)); - -var diff = require("deep-diff").diff(root.toJSON(), root2.toJSON()); -if (diff) { - diff.forEach(function(diff) { - console.log(diff.kind + " @ " + diff.path.join(".")); - console.log("lhs:", typeof diff.lhs, diff.lhs); - console.log("rhs:", typeof diff.rhs, diff.rhs); - console.log(); - }); - process.exitCode = 1; -} else - console.log("no differences"); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/google/LICENSE b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/google/LICENSE deleted file mode 100644 index 868bd40d..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/google/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright 2014, Google Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/google/README.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/google/README.md deleted file mode 100644 index 09e3f230..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/google/README.md +++ /dev/null @@ -1 +0,0 @@ -This folder contains stripped and pre-parsed definitions of common Google types. These files are not used by protobuf.js directly but are here so you can use or include them where required. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/google/api/annotations.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/google/api/annotations.json deleted file mode 100644 index 3f13a733..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/google/api/annotations.json +++ /dev/null @@ -1,83 +0,0 @@ -{ - "nested": { - "google": { - "nested": { - "api": { - "nested": { - "http": { - "type": "HttpRule", - "id": 72295728, - "extend": "google.protobuf.MethodOptions" - }, - "HttpRule": { - "oneofs": { - "pattern": { - "oneof": [ - "get", - "put", - "post", - "delete", - "patch", - "custom" - ] - } - }, - "fields": { - "get": { - "type": "string", - "id": 2 - }, - "put": { - "type": "string", - "id": 3 - }, - "post": { - "type": "string", - "id": 4 - }, - "delete": { - "type": "string", - "id": 5 - }, - "patch": { - "type": "string", - "id": 6 - }, - "custom": { - "type": "CustomHttpPattern", - "id": 8 - }, - "selector": { - "type": "string", - "id": 1 - }, - "body": { - "type": "string", - "id": 7 - }, - "additionalBindings": { - "rule": "repeated", - "type": "HttpRule", - "id": 11 - } - } - } - } - }, - "protobuf": { - "nested": { - "MethodOptions": { - "fields": {}, - "extensions": [ - [ - 1000, - 536870911 - ] - ] - } - } - } - } - } - } -} \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/google/api/annotations.proto b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/google/api/annotations.proto deleted file mode 100644 index 63a8eefd..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/google/api/annotations.proto +++ /dev/null @@ -1,11 +0,0 @@ -syntax = "proto3"; - -package google.api; - -import "google/api/http.proto"; -import "google/protobuf/descriptor.proto"; - -extend google.protobuf.MethodOptions { - - HttpRule http = 72295728; -} \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/google/api/http.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/google/api/http.json deleted file mode 100644 index e3a0f4f9..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/google/api/http.json +++ /dev/null @@ -1,86 +0,0 @@ -{ - "nested": { - "google": { - "nested": { - "api": { - "nested": { - "Http": { - "fields": { - "rules": { - "rule": "repeated", - "type": "HttpRule", - "id": 1 - } - } - }, - "HttpRule": { - "oneofs": { - "pattern": { - "oneof": [ - "get", - "put", - "post", - "delete", - "patch", - "custom" - ] - } - }, - "fields": { - "get": { - "type": "string", - "id": 2 - }, - "put": { - "type": "string", - "id": 3 - }, - "post": { - "type": "string", - "id": 4 - }, - "delete": { - "type": "string", - "id": 5 - }, - "patch": { - "type": "string", - "id": 6 - }, - "custom": { - "type": "CustomHttpPattern", - "id": 8 - }, - "selector": { - "type": "string", - "id": 1 - }, - "body": { - "type": "string", - "id": 7 - }, - "additionalBindings": { - "rule": "repeated", - "type": "HttpRule", - "id": 11 - } - } - }, - "CustomHttpPattern": { - "fields": { - "kind": { - "type": "string", - "id": 1 - }, - "path": { - "type": "string", - "id": 2 - } - } - } - } - } - } - } - } -} \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/google/api/http.proto b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/google/api/http.proto deleted file mode 100644 index e9a7e9de..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/google/api/http.proto +++ /dev/null @@ -1,31 +0,0 @@ -syntax = "proto3"; - -package google.api; - -message Http { - - repeated HttpRule rules = 1; -} - -message HttpRule { - - oneof pattern { - - string get = 2; - string put = 3; - string post = 4; - string delete = 5; - string patch = 6; - CustomHttpPattern custom = 8; - } - - string selector = 1; - string body = 7; - repeated HttpRule additional_bindings = 11; -} - -message CustomHttpPattern { - - string kind = 1; - string path = 2; -} \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/google/protobuf/api.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/google/protobuf/api.json deleted file mode 100644 index 5460612f..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/google/protobuf/api.json +++ /dev/null @@ -1,118 +0,0 @@ -{ - "nested": { - "google": { - "nested": { - "protobuf": { - "nested": { - "Api": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "methods": { - "rule": "repeated", - "type": "Method", - "id": 2 - }, - "options": { - "rule": "repeated", - "type": "Option", - "id": 3 - }, - "version": { - "type": "string", - "id": 4 - }, - "sourceContext": { - "type": "SourceContext", - "id": 5 - }, - "mixins": { - "rule": "repeated", - "type": "Mixin", - "id": 6 - }, - "syntax": { - "type": "Syntax", - "id": 7 - } - } - }, - "Method": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "requestTypeUrl": { - "type": "string", - "id": 2 - }, - "requestStreaming": { - "type": "bool", - "id": 3 - }, - "responseTypeUrl": { - "type": "string", - "id": 4 - }, - "responseStreaming": { - "type": "bool", - "id": 5 - }, - "options": { - "rule": "repeated", - "type": "Option", - "id": 6 - }, - "syntax": { - "type": "Syntax", - "id": 7 - } - } - }, - "Mixin": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "root": { - "type": "string", - "id": 2 - } - } - }, - "SourceContext": { - "fields": { - "fileName": { - "type": "string", - "id": 1 - } - } - }, - "Option": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "value": { - "type": "Any", - "id": 2 - } - } - }, - "Syntax": { - "values": { - "SYNTAX_PROTO2": 0, - "SYNTAX_PROTO3": 1 - } - } - } - } - } - } - } -} \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/google/protobuf/api.proto b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/google/protobuf/api.proto deleted file mode 100644 index cf6ae3f3..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/google/protobuf/api.proto +++ /dev/null @@ -1,34 +0,0 @@ -syntax = "proto3"; - -package google.protobuf; - -import "google/protobuf/source_context.proto"; -import "google/protobuf/type.proto"; - -message Api { - - string name = 1; - repeated Method methods = 2; - repeated Option options = 3; - string version = 4; - SourceContext source_context = 5; - repeated Mixin mixins = 6; - Syntax syntax = 7; -} - -message Method { - - string name = 1; - string request_type_url = 2; - bool request_streaming = 3; - string response_type_url = 4; - bool response_streaming = 5; - repeated Option options = 6; - Syntax syntax = 7; -} - -message Mixin { - - string name = 1; - string root = 2; -} \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/google/protobuf/descriptor.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/google/protobuf/descriptor.json deleted file mode 100644 index f6c5c112..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/google/protobuf/descriptor.json +++ /dev/null @@ -1,739 +0,0 @@ -{ - "nested": { - "google": { - "nested": { - "protobuf": { - "nested": { - "FileDescriptorSet": { - "fields": { - "file": { - "rule": "repeated", - "type": "FileDescriptorProto", - "id": 1 - } - } - }, - "FileDescriptorProto": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "package": { - "type": "string", - "id": 2 - }, - "dependency": { - "rule": "repeated", - "type": "string", - "id": 3 - }, - "publicDependency": { - "rule": "repeated", - "type": "int32", - "id": 10, - "options": { - "packed": false - } - }, - "weakDependency": { - "rule": "repeated", - "type": "int32", - "id": 11, - "options": { - "packed": false - } - }, - "messageType": { - "rule": "repeated", - "type": "DescriptorProto", - "id": 4 - }, - "enumType": { - "rule": "repeated", - "type": "EnumDescriptorProto", - "id": 5 - }, - "service": { - "rule": "repeated", - "type": "ServiceDescriptorProto", - "id": 6 - }, - "extension": { - "rule": "repeated", - "type": "FieldDescriptorProto", - "id": 7 - }, - "options": { - "type": "FileOptions", - "id": 8 - }, - "sourceCodeInfo": { - "type": "SourceCodeInfo", - "id": 9 - }, - "syntax": { - "type": "string", - "id": 12 - } - } - }, - "DescriptorProto": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "field": { - "rule": "repeated", - "type": "FieldDescriptorProto", - "id": 2 - }, - "extension": { - "rule": "repeated", - "type": "FieldDescriptorProto", - "id": 6 - }, - "nestedType": { - "rule": "repeated", - "type": "DescriptorProto", - "id": 3 - }, - "enumType": { - "rule": "repeated", - "type": "EnumDescriptorProto", - "id": 4 - }, - "extensionRange": { - "rule": "repeated", - "type": "ExtensionRange", - "id": 5 - }, - "oneofDecl": { - "rule": "repeated", - "type": "OneofDescriptorProto", - "id": 8 - }, - "options": { - "type": "MessageOptions", - "id": 7 - }, - "reservedRange": { - "rule": "repeated", - "type": "ReservedRange", - "id": 9 - }, - "reservedName": { - "rule": "repeated", - "type": "string", - "id": 10 - } - }, - "nested": { - "ExtensionRange": { - "fields": { - "start": { - "type": "int32", - "id": 1 - }, - "end": { - "type": "int32", - "id": 2 - } - } - }, - "ReservedRange": { - "fields": { - "start": { - "type": "int32", - "id": 1 - }, - "end": { - "type": "int32", - "id": 2 - } - } - } - } - }, - "FieldDescriptorProto": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "number": { - "type": "int32", - "id": 3 - }, - "label": { - "type": "Label", - "id": 4 - }, - "type": { - "type": "Type", - "id": 5 - }, - "typeName": { - "type": "string", - "id": 6 - }, - "extendee": { - "type": "string", - "id": 2 - }, - "defaultValue": { - "type": "string", - "id": 7 - }, - "oneofIndex": { - "type": "int32", - "id": 9 - }, - "jsonName": { - "type": "string", - "id": 10 - }, - "options": { - "type": "FieldOptions", - "id": 8 - } - }, - "nested": { - "Type": { - "values": { - "TYPE_DOUBLE": 1, - "TYPE_FLOAT": 2, - "TYPE_INT64": 3, - "TYPE_UINT64": 4, - "TYPE_INT32": 5, - "TYPE_FIXED64": 6, - "TYPE_FIXED32": 7, - "TYPE_BOOL": 8, - "TYPE_STRING": 9, - "TYPE_GROUP": 10, - "TYPE_MESSAGE": 11, - "TYPE_BYTES": 12, - "TYPE_UINT32": 13, - "TYPE_ENUM": 14, - "TYPE_SFIXED32": 15, - "TYPE_SFIXED64": 16, - "TYPE_SINT32": 17, - "TYPE_SINT64": 18 - } - }, - "Label": { - "values": { - "LABEL_OPTIONAL": 1, - "LABEL_REQUIRED": 2, - "LABEL_REPEATED": 3 - } - } - } - }, - "OneofDescriptorProto": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "options": { - "type": "OneofOptions", - "id": 2 - } - } - }, - "EnumDescriptorProto": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "value": { - "rule": "repeated", - "type": "EnumValueDescriptorProto", - "id": 2 - }, - "options": { - "type": "EnumOptions", - "id": 3 - } - } - }, - "EnumValueDescriptorProto": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "number": { - "type": "int32", - "id": 2 - }, - "options": { - "type": "EnumValueOptions", - "id": 3 - } - } - }, - "ServiceDescriptorProto": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "method": { - "rule": "repeated", - "type": "MethodDescriptorProto", - "id": 2 - }, - "options": { - "type": "ServiceOptions", - "id": 3 - } - } - }, - "MethodDescriptorProto": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "inputType": { - "type": "string", - "id": 2 - }, - "outputType": { - "type": "string", - "id": 3 - }, - "options": { - "type": "MethodOptions", - "id": 4 - }, - "clientStreaming": { - "type": "bool", - "id": 5 - }, - "serverStreaming": { - "type": "bool", - "id": 6 - } - } - }, - "FileOptions": { - "fields": { - "javaPackage": { - "type": "string", - "id": 1 - }, - "javaOuterClassname": { - "type": "string", - "id": 8 - }, - "javaMultipleFiles": { - "type": "bool", - "id": 10 - }, - "javaGenerateEqualsAndHash": { - "type": "bool", - "id": 20, - "options": { - "deprecated": true - } - }, - "javaStringCheckUtf8": { - "type": "bool", - "id": 27 - }, - "optimizeFor": { - "type": "OptimizeMode", - "id": 9, - "options": { - "default": "SPEED" - } - }, - "goPackage": { - "type": "string", - "id": 11 - }, - "ccGenericServices": { - "type": "bool", - "id": 16 - }, - "javaGenericServices": { - "type": "bool", - "id": 17 - }, - "pyGenericServices": { - "type": "bool", - "id": 18 - }, - "deprecated": { - "type": "bool", - "id": 23 - }, - "ccEnableArenas": { - "type": "bool", - "id": 31 - }, - "objcClassPrefix": { - "type": "string", - "id": 36 - }, - "csharpNamespace": { - "type": "string", - "id": 37 - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ], - "reserved": [ - [ - 38, - 38 - ] - ], - "nested": { - "OptimizeMode": { - "values": { - "SPEED": 1, - "CODE_SIZE": 2, - "LITE_RUNTIME": 3 - } - } - } - }, - "MessageOptions": { - "fields": { - "messageSetWireFormat": { - "type": "bool", - "id": 1 - }, - "noStandardDescriptorAccessor": { - "type": "bool", - "id": 2 - }, - "deprecated": { - "type": "bool", - "id": 3 - }, - "mapEntry": { - "type": "bool", - "id": 7 - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ], - "reserved": [ - [ - 8, - 8 - ] - ] - }, - "FieldOptions": { - "fields": { - "ctype": { - "type": "CType", - "id": 1, - "options": { - "default": "STRING" - } - }, - "packed": { - "type": "bool", - "id": 2 - }, - "jstype": { - "type": "JSType", - "id": 6, - "options": { - "default": "JS_NORMAL" - } - }, - "lazy": { - "type": "bool", - "id": 5 - }, - "deprecated": { - "type": "bool", - "id": 3 - }, - "weak": { - "type": "bool", - "id": 10 - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ], - "reserved": [ - [ - 4, - 4 - ] - ], - "nested": { - "CType": { - "values": { - "STRING": 0, - "CORD": 1, - "STRING_PIECE": 2 - } - }, - "JSType": { - "values": { - "JS_NORMAL": 0, - "JS_STRING": 1, - "JS_NUMBER": 2 - } - } - } - }, - "OneofOptions": { - "fields": { - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ] - }, - "EnumOptions": { - "fields": { - "allowAlias": { - "type": "bool", - "id": 2 - }, - "deprecated": { - "type": "bool", - "id": 3 - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ] - }, - "EnumValueOptions": { - "fields": { - "deprecated": { - "type": "bool", - "id": 1 - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ] - }, - "ServiceOptions": { - "fields": { - "deprecated": { - "type": "bool", - "id": 33 - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ] - }, - "MethodOptions": { - "fields": { - "deprecated": { - "type": "bool", - "id": 33 - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ] - }, - "UninterpretedOption": { - "fields": { - "name": { - "rule": "repeated", - "type": "NamePart", - "id": 2 - }, - "identifierValue": { - "type": "string", - "id": 3 - }, - "positiveIntValue": { - "type": "uint64", - "id": 4 - }, - "negativeIntValue": { - "type": "int64", - "id": 5 - }, - "doubleValue": { - "type": "double", - "id": 6 - }, - "stringValue": { - "type": "bytes", - "id": 7 - }, - "aggregateValue": { - "type": "string", - "id": 8 - } - }, - "nested": { - "NamePart": { - "fields": { - "namePart": { - "rule": "required", - "type": "string", - "id": 1 - }, - "isExtension": { - "rule": "required", - "type": "bool", - "id": 2 - } - } - } - } - }, - "SourceCodeInfo": { - "fields": { - "location": { - "rule": "repeated", - "type": "Location", - "id": 1 - } - }, - "nested": { - "Location": { - "fields": { - "path": { - "rule": "repeated", - "type": "int32", - "id": 1 - }, - "span": { - "rule": "repeated", - "type": "int32", - "id": 2 - }, - "leadingComments": { - "type": "string", - "id": 3 - }, - "trailingComments": { - "type": "string", - "id": 4 - }, - "leadingDetachedComments": { - "rule": "repeated", - "type": "string", - "id": 6 - } - } - } - } - }, - "GeneratedCodeInfo": { - "fields": { - "annotation": { - "rule": "repeated", - "type": "Annotation", - "id": 1 - } - }, - "nested": { - "Annotation": { - "fields": { - "path": { - "rule": "repeated", - "type": "int32", - "id": 1 - }, - "sourceFile": { - "type": "string", - "id": 2 - }, - "begin": { - "type": "int32", - "id": 3 - }, - "end": { - "type": "int32", - "id": 4 - } - } - } - } - } - } - } - } - } - } -} \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/google/protobuf/descriptor.proto b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/google/protobuf/descriptor.proto deleted file mode 100644 index 32794926..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/google/protobuf/descriptor.proto +++ /dev/null @@ -1,286 +0,0 @@ -syntax = "proto2"; - -package google.protobuf; - -message FileDescriptorSet { - - repeated FileDescriptorProto file = 1; -} - -message FileDescriptorProto { - - optional string name = 1; - optional string package = 2; - repeated string dependency = 3; - repeated int32 public_dependency = 10; - repeated int32 weak_dependency = 11; - repeated DescriptorProto message_type = 4; - repeated EnumDescriptorProto enum_type = 5; - repeated ServiceDescriptorProto service = 6; - repeated FieldDescriptorProto extension = 7; - optional FileOptions options = 8; - optional SourceCodeInfo source_code_info = 9; - optional string syntax = 12; -} - -message DescriptorProto { - - optional string name = 1; - repeated FieldDescriptorProto field = 2; - repeated FieldDescriptorProto extension = 6; - repeated DescriptorProto nested_type = 3; - repeated EnumDescriptorProto enum_type = 4; - repeated ExtensionRange extension_range = 5; - repeated OneofDescriptorProto oneof_decl = 8; - optional MessageOptions options = 7; - repeated ReservedRange reserved_range = 9; - repeated string reserved_name = 10; - - message ExtensionRange { - - optional int32 start = 1; - optional int32 end = 2; - } - - message ReservedRange { - - optional int32 start = 1; - optional int32 end = 2; - } -} - -message FieldDescriptorProto { - - optional string name = 1; - optional int32 number = 3; - optional Label label = 4; - optional Type type = 5; - optional string type_name = 6; - optional string extendee = 2; - optional string default_value = 7; - optional int32 oneof_index = 9; - optional string json_name = 10; - optional FieldOptions options = 8; - - enum Type { - - TYPE_DOUBLE = 1; - TYPE_FLOAT = 2; - TYPE_INT64 = 3; - TYPE_UINT64 = 4; - TYPE_INT32 = 5; - TYPE_FIXED64 = 6; - TYPE_FIXED32 = 7; - TYPE_BOOL = 8; - TYPE_STRING = 9; - TYPE_GROUP = 10; - TYPE_MESSAGE = 11; - TYPE_BYTES = 12; - TYPE_UINT32 = 13; - TYPE_ENUM = 14; - TYPE_SFIXED32 = 15; - TYPE_SFIXED64 = 16; - TYPE_SINT32 = 17; - TYPE_SINT64 = 18; - } - - enum Label { - - LABEL_OPTIONAL = 1; - LABEL_REQUIRED = 2; - LABEL_REPEATED = 3; - } -} - -message OneofDescriptorProto { - - optional string name = 1; - optional OneofOptions options = 2; -} - -message EnumDescriptorProto { - - optional string name = 1; - repeated EnumValueDescriptorProto value = 2; - optional EnumOptions options = 3; -} - -message EnumValueDescriptorProto { - - optional string name = 1; - optional int32 number = 2; - optional EnumValueOptions options = 3; -} - -message ServiceDescriptorProto { - - optional string name = 1; - repeated MethodDescriptorProto method = 2; - optional ServiceOptions options = 3; -} - -message MethodDescriptorProto { - - optional string name = 1; - optional string input_type = 2; - optional string output_type = 3; - optional MethodOptions options = 4; - optional bool client_streaming = 5; - optional bool server_streaming = 6; -} - -message FileOptions { - - optional string java_package = 1; - optional string java_outer_classname = 8; - optional bool java_multiple_files = 10; - optional bool java_generate_equals_and_hash = 20 [deprecated=true]; - optional bool java_string_check_utf8 = 27; - optional OptimizeMode optimize_for = 9 [default=SPEED]; - optional string go_package = 11; - optional bool cc_generic_services = 16; - optional bool java_generic_services = 17; - optional bool py_generic_services = 18; - optional bool deprecated = 23; - optional bool cc_enable_arenas = 31; - optional string objc_class_prefix = 36; - optional string csharp_namespace = 37; - repeated UninterpretedOption uninterpreted_option = 999; - - enum OptimizeMode { - - SPEED = 1; - CODE_SIZE = 2; - LITE_RUNTIME = 3; - } - - extensions 1000 to max; - - reserved 38; -} - -message MessageOptions { - - optional bool message_set_wire_format = 1; - optional bool no_standard_descriptor_accessor = 2; - optional bool deprecated = 3; - optional bool map_entry = 7; - repeated UninterpretedOption uninterpreted_option = 999; - - extensions 1000 to max; - - reserved 8; -} - -message FieldOptions { - - optional CType ctype = 1 [default=STRING]; - optional bool packed = 2; - optional JSType jstype = 6 [default=JS_NORMAL]; - optional bool lazy = 5; - optional bool deprecated = 3; - optional bool weak = 10; - repeated UninterpretedOption uninterpreted_option = 999; - - enum CType { - - STRING = 0; - CORD = 1; - STRING_PIECE = 2; - } - - enum JSType { - - JS_NORMAL = 0; - JS_STRING = 1; - JS_NUMBER = 2; - } - - extensions 1000 to max; - - reserved 4; -} - -message OneofOptions { - - repeated UninterpretedOption uninterpreted_option = 999; - - extensions 1000 to max; -} - -message EnumOptions { - - optional bool allow_alias = 2; - optional bool deprecated = 3; - repeated UninterpretedOption uninterpreted_option = 999; - - extensions 1000 to max; -} - -message EnumValueOptions { - - optional bool deprecated = 1; - repeated UninterpretedOption uninterpreted_option = 999; - - extensions 1000 to max; -} - -message ServiceOptions { - - optional bool deprecated = 33; - repeated UninterpretedOption uninterpreted_option = 999; - - extensions 1000 to max; -} - -message MethodOptions { - - optional bool deprecated = 33; - repeated UninterpretedOption uninterpreted_option = 999; - - extensions 1000 to max; -} - -message UninterpretedOption { - - repeated NamePart name = 2; - optional string identifier_value = 3; - optional uint64 positive_int_value = 4; - optional int64 negative_int_value = 5; - optional double double_value = 6; - optional bytes string_value = 7; - optional string aggregate_value = 8; - - message NamePart { - - required string name_part = 1; - required bool is_extension = 2; - } -} - -message SourceCodeInfo { - - repeated Location location = 1; - - message Location { - - repeated int32 path = 1 [packed=true]; - repeated int32 span = 2 [packed=true]; - optional string leading_comments = 3; - optional string trailing_comments = 4; - repeated string leading_detached_comments = 6; - } -} - -message GeneratedCodeInfo { - - repeated Annotation annotation = 1; - - message Annotation { - - repeated int32 path = 1 [packed=true]; - optional string source_file = 2; - optional int32 begin = 3; - optional int32 end = 4; - } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/google/protobuf/source_context.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/google/protobuf/source_context.json deleted file mode 100644 index 51adb63d..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/google/protobuf/source_context.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "nested": { - "google": { - "nested": { - "protobuf": { - "nested": { - "SourceContext": { - "fields": { - "fileName": { - "type": "string", - "id": 1 - } - } - } - } - } - } - } - } -} \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/google/protobuf/source_context.proto b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/google/protobuf/source_context.proto deleted file mode 100644 index 584d36ce..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/google/protobuf/source_context.proto +++ /dev/null @@ -1,7 +0,0 @@ -syntax = "proto3"; - -package google.protobuf; - -message SourceContext { - string file_name = 1; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/google/protobuf/type.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/google/protobuf/type.json deleted file mode 100644 index fffa70d9..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/google/protobuf/type.json +++ /dev/null @@ -1,202 +0,0 @@ -{ - "nested": { - "google": { - "nested": { - "protobuf": { - "nested": { - "Type": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "fields": { - "rule": "repeated", - "type": "Field", - "id": 2 - }, - "oneofs": { - "rule": "repeated", - "type": "string", - "id": 3 - }, - "options": { - "rule": "repeated", - "type": "Option", - "id": 4 - }, - "sourceContext": { - "type": "SourceContext", - "id": 5 - }, - "syntax": { - "type": "Syntax", - "id": 6 - } - } - }, - "Field": { - "fields": { - "kind": { - "type": "Kind", - "id": 1 - }, - "cardinality": { - "type": "Cardinality", - "id": 2 - }, - "number": { - "type": "int32", - "id": 3 - }, - "name": { - "type": "string", - "id": 4 - }, - "typeUrl": { - "type": "string", - "id": 6 - }, - "oneofIndex": { - "type": "int32", - "id": 7 - }, - "packed": { - "type": "bool", - "id": 8 - }, - "options": { - "rule": "repeated", - "type": "Option", - "id": 9 - }, - "jsonName": { - "type": "string", - "id": 10 - }, - "defaultValue": { - "type": "string", - "id": 11 - } - }, - "nested": { - "Kind": { - "values": { - "TYPE_UNKNOWN": 0, - "TYPE_DOUBLE": 1, - "TYPE_FLOAT": 2, - "TYPE_INT64": 3, - "TYPE_UINT64": 4, - "TYPE_INT32": 5, - "TYPE_FIXED64": 6, - "TYPE_FIXED32": 7, - "TYPE_BOOL": 8, - "TYPE_STRING": 9, - "TYPE_GROUP": 10, - "TYPE_MESSAGE": 11, - "TYPE_BYTES": 12, - "TYPE_UINT32": 13, - "TYPE_ENUM": 14, - "TYPE_SFIXED32": 15, - "TYPE_SFIXED64": 16, - "TYPE_SINT32": 17, - "TYPE_SINT64": 18 - } - }, - "Cardinality": { - "values": { - "CARDINALITY_UNKNOWN": 0, - "CARDINALITY_OPTIONAL": 1, - "CARDINALITY_REQUIRED": 2, - "CARDINALITY_REPEATED": 3 - } - } - } - }, - "Enum": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "enumvalue": { - "rule": "repeated", - "type": "EnumValue", - "id": 2 - }, - "options": { - "rule": "repeated", - "type": "Option", - "id": 3 - }, - "sourceContext": { - "type": "SourceContext", - "id": 4 - }, - "syntax": { - "type": "Syntax", - "id": 5 - } - } - }, - "EnumValue": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "number": { - "type": "int32", - "id": 2 - }, - "options": { - "rule": "repeated", - "type": "Option", - "id": 3 - } - } - }, - "Option": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "value": { - "type": "Any", - "id": 2 - } - } - }, - "Syntax": { - "values": { - "SYNTAX_PROTO2": 0, - "SYNTAX_PROTO3": 1 - } - }, - "Any": { - "fields": { - "type_url": { - "type": "string", - "id": 1 - }, - "value": { - "type": "bytes", - "id": 2 - } - } - }, - "SourceContext": { - "fields": { - "fileName": { - "type": "string", - "id": 1 - } - } - } - } - } - } - } - } -} \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/google/protobuf/type.proto b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/google/protobuf/type.proto deleted file mode 100644 index 8ee445bf..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/google/protobuf/type.proto +++ /dev/null @@ -1,89 +0,0 @@ -syntax = "proto3"; - -package google.protobuf; - -import "google/protobuf/any.proto"; -import "google/protobuf/source_context.proto"; - -message Type { - - string name = 1; - repeated Field fields = 2; - repeated string oneofs = 3; - repeated Option options = 4; - SourceContext source_context = 5; - Syntax syntax = 6; -} - -message Field { - - Kind kind = 1; - Cardinality cardinality = 2; - int32 number = 3; - string name = 4; - string type_url = 6; - int32 oneof_index = 7; - bool packed = 8; - repeated Option options = 9; - string json_name = 10; - string default_value = 11; - - enum Kind { - - TYPE_UNKNOWN = 0; - TYPE_DOUBLE = 1; - TYPE_FLOAT = 2; - TYPE_INT64 = 3; - TYPE_UINT64 = 4; - TYPE_INT32 = 5; - TYPE_FIXED64 = 6; - TYPE_FIXED32 = 7; - TYPE_BOOL = 8; - TYPE_STRING = 9; - TYPE_GROUP = 10; - TYPE_MESSAGE = 11; - TYPE_BYTES = 12; - TYPE_UINT32 = 13; - TYPE_ENUM = 14; - TYPE_SFIXED32 = 15; - TYPE_SFIXED64 = 16; - TYPE_SINT32 = 17; - TYPE_SINT64 = 18; - } - - enum Cardinality { - - CARDINALITY_UNKNOWN = 0; - CARDINALITY_OPTIONAL = 1; - CARDINALITY_REQUIRED = 2; - CARDINALITY_REPEATED = 3; - } -} - -message Enum { - - string name = 1; - repeated EnumValue enumvalue = 2; - repeated Option options = 3; - SourceContext source_context = 4; - Syntax syntax = 5; -} - -message EnumValue { - - string name = 1; - int32 number = 2; - repeated Option options = 3; -} - -message Option { - - string name = 1; - Any value = 2; -} - -enum Syntax { - - SYNTAX_PROTO2 = 0; - SYNTAX_PROTO3 = 1; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/index.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/index.d.ts deleted file mode 100644 index 750ad2f7..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/index.d.ts +++ /dev/null @@ -1,2741 +0,0 @@ -// DO NOT EDIT! This is a generated file. Edit the JSDoc in src/*.js instead and run 'npm run build:types'. - -export as namespace protobuf; - -/** - * Provides common type definitions. - * Can also be used to provide additional google types or your own custom types. - * @param name Short name as in `google/protobuf/[name].proto` or full file name - * @param json JSON definition within `google.protobuf` if a short name, otherwise the file's root definition - */ -export function common(name: string, json: { [k: string]: any }): void; - -export namespace common { - - /** Properties of a google.protobuf.Any message. */ - interface IAny { - typeUrl?: string; - bytes?: Uint8Array; - } - - /** Properties of a google.protobuf.Duration message. */ - interface IDuration { - seconds?: (number|Long); - nanos?: number; - } - - /** Properties of a google.protobuf.Timestamp message. */ - interface ITimestamp { - seconds?: (number|Long); - nanos?: number; - } - - /** Properties of a google.protobuf.Empty message. */ - interface IEmpty { - } - - /** Properties of a google.protobuf.Struct message. */ - interface IStruct { - fields?: { [k: string]: IValue }; - } - - /** Properties of a google.protobuf.Value message. */ - interface IValue { - kind?: string; - nullValue?: 0; - numberValue?: number; - stringValue?: string; - boolValue?: boolean; - structValue?: IStruct; - listValue?: IListValue; - } - - /** Properties of a google.protobuf.ListValue message. */ - interface IListValue { - values?: IValue[]; - } - - /** Properties of a google.protobuf.DoubleValue message. */ - interface IDoubleValue { - value?: number; - } - - /** Properties of a google.protobuf.FloatValue message. */ - interface IFloatValue { - value?: number; - } - - /** Properties of a google.protobuf.Int64Value message. */ - interface IInt64Value { - value?: (number|Long); - } - - /** Properties of a google.protobuf.UInt64Value message. */ - interface IUInt64Value { - value?: (number|Long); - } - - /** Properties of a google.protobuf.Int32Value message. */ - interface IInt32Value { - value?: number; - } - - /** Properties of a google.protobuf.UInt32Value message. */ - interface IUInt32Value { - value?: number; - } - - /** Properties of a google.protobuf.BoolValue message. */ - interface IBoolValue { - value?: boolean; - } - - /** Properties of a google.protobuf.StringValue message. */ - interface IStringValue { - value?: string; - } - - /** Properties of a google.protobuf.BytesValue message. */ - interface IBytesValue { - value?: Uint8Array; - } - - /** - * Gets the root definition of the specified common proto file. - * - * Bundled definitions are: - * - google/protobuf/any.proto - * - google/protobuf/duration.proto - * - google/protobuf/empty.proto - * - google/protobuf/field_mask.proto - * - google/protobuf/struct.proto - * - google/protobuf/timestamp.proto - * - google/protobuf/wrappers.proto - * - * @param file Proto file name - * @returns Root definition or `null` if not defined - */ - function get(file: string): (INamespace|null); -} - -/** Runtime message from/to plain object converters. */ -export namespace converter { - - /** - * Generates a plain object to runtime message converter specific to the specified message type. - * @param mtype Message type - * @returns Codegen instance - */ - function fromObject(mtype: Type): Codegen; - - /** - * Generates a runtime message to plain object converter specific to the specified message type. - * @param mtype Message type - * @returns Codegen instance - */ - function toObject(mtype: Type): Codegen; -} - -/** - * Generates a decoder specific to the specified message type. - * @param mtype Message type - * @returns Codegen instance - */ -export function decoder(mtype: Type): Codegen; - -/** - * Generates an encoder specific to the specified message type. - * @param mtype Message type - * @returns Codegen instance - */ -export function encoder(mtype: Type): Codegen; - -/** Reflected enum. */ -export class Enum extends ReflectionObject { - - /** - * Constructs a new enum instance. - * @param name Unique name within its namespace - * @param [values] Enum values as an object, by name - * @param [options] Declared options - * @param [comment] The comment for this enum - * @param [comments] The value comments for this enum - * @param [valuesOptions] The value options for this enum - */ - constructor(name: string, values?: { [k: string]: number }, options?: { [k: string]: any }, comment?: string, comments?: { [k: string]: string }, valuesOptions?: ({ [k: string]: { [k: string]: any } }|undefined)); - - /** Enum values by id. */ - public valuesById: { [k: number]: string }; - - /** Enum values by name. */ - public values: { [k: string]: number }; - - /** Enum comment text. */ - public comment: (string|null); - - /** Value comment texts, if any. */ - public comments: { [k: string]: string }; - - /** Values options, if any */ - public valuesOptions?: { [k: string]: { [k: string]: any } }; - - /** Reserved ranges, if any. */ - public reserved: (number[]|string)[]; - - /** - * Constructs an enum from an enum descriptor. - * @param name Enum name - * @param json Enum descriptor - * @returns Created enum - * @throws {TypeError} If arguments are invalid - */ - public static fromJSON(name: string, json: IEnum): Enum; - - /** - * Converts this enum to an enum descriptor. - * @param [toJSONOptions] JSON conversion options - * @returns Enum descriptor - */ - public toJSON(toJSONOptions?: IToJSONOptions): IEnum; - - /** - * Adds a value to this enum. - * @param name Value name - * @param id Value id - * @param [comment] Comment, if any - * @param {Object.|undefined} [options] Options, if any - * @returns `this` - * @throws {TypeError} If arguments are invalid - * @throws {Error} If there is already a value with this name or id - */ - public add(name: string, id: number, comment?: string, options?: ({ [k: string]: any }|undefined)): Enum; - - /** - * Removes a value from this enum - * @param name Value name - * @returns `this` - * @throws {TypeError} If arguments are invalid - * @throws {Error} If `name` is not a name of this enum - */ - public remove(name: string): Enum; - - /** - * Tests if the specified id is reserved. - * @param id Id to test - * @returns `true` if reserved, otherwise `false` - */ - public isReservedId(id: number): boolean; - - /** - * Tests if the specified name is reserved. - * @param name Name to test - * @returns `true` if reserved, otherwise `false` - */ - public isReservedName(name: string): boolean; -} - -/** Enum descriptor. */ -export interface IEnum { - - /** Enum values */ - values: { [k: string]: number }; - - /** Enum options */ - options?: { [k: string]: any }; -} - -/** Reflected message field. */ -export class Field extends FieldBase { - - /** - * Constructs a new message field instance. Note that {@link MapField|map fields} have their own class. - * @param name Unique name within its namespace - * @param id Unique id within its namespace - * @param type Value type - * @param [rule="optional"] Field rule - * @param [extend] Extended type if different from parent - * @param [options] Declared options - */ - constructor(name: string, id: number, type: string, rule?: (string|{ [k: string]: any }), extend?: (string|{ [k: string]: any }), options?: { [k: string]: any }); - - /** - * Constructs a field from a field descriptor. - * @param name Field name - * @param json Field descriptor - * @returns Created field - * @throws {TypeError} If arguments are invalid - */ - public static fromJSON(name: string, json: IField): Field; - - /** Determines whether this field is packed. Only relevant when repeated and working with proto2. */ - public readonly packed: boolean; - - /** - * Field decorator (TypeScript). - * @param fieldId Field id - * @param fieldType Field type - * @param [fieldRule="optional"] Field rule - * @param [defaultValue] Default value - * @returns Decorator function - */ - public static d(fieldId: number, fieldType: ("double"|"float"|"int32"|"uint32"|"sint32"|"fixed32"|"sfixed32"|"int64"|"uint64"|"sint64"|"fixed64"|"sfixed64"|"string"|"bool"|"bytes"|object), fieldRule?: ("optional"|"required"|"repeated"), defaultValue?: T): FieldDecorator; - - /** - * Field decorator (TypeScript). - * @param fieldId Field id - * @param fieldType Field type - * @param [fieldRule="optional"] Field rule - * @returns Decorator function - */ - public static d>(fieldId: number, fieldType: (Constructor|string), fieldRule?: ("optional"|"required"|"repeated")): FieldDecorator; -} - -/** Base class of all reflected message fields. This is not an actual class but here for the sake of having consistent type definitions. */ -export class FieldBase extends ReflectionObject { - - /** - * Not an actual constructor. Use {@link Field} instead. - * @param name Unique name within its namespace - * @param id Unique id within its namespace - * @param type Value type - * @param [rule="optional"] Field rule - * @param [extend] Extended type if different from parent - * @param [options] Declared options - * @param [comment] Comment associated with this field - */ - constructor(name: string, id: number, type: string, rule?: (string|{ [k: string]: any }), extend?: (string|{ [k: string]: any }), options?: { [k: string]: any }, comment?: string); - - /** Field type. */ - public type: string; - - /** Unique field id. */ - public id: number; - - /** Extended type if different from parent. */ - public extend?: string; - - /** Whether this field is required. */ - public required: boolean; - - /** Whether this field is optional. */ - public optional: boolean; - - /** Whether this field is repeated. */ - public repeated: boolean; - - /** Whether this field is a map or not. */ - public map: boolean; - - /** Message this field belongs to. */ - public message: (Type|null); - - /** OneOf this field belongs to, if any, */ - public partOf: (OneOf|null); - - /** The field type's default value. */ - public typeDefault: any; - - /** The field's default value on prototypes. */ - public defaultValue: any; - - /** Whether this field's value should be treated as a long. */ - public long: boolean; - - /** Whether this field's value is a buffer. */ - public bytes: boolean; - - /** Resolved type if not a basic type. */ - public resolvedType: (Type|Enum|null); - - /** Sister-field within the extended type if a declaring extension field. */ - public extensionField: (Field|null); - - /** Sister-field within the declaring namespace if an extended field. */ - public declaringField: (Field|null); - - /** Comment for this field. */ - public comment: (string|null); - - /** - * Converts this field to a field descriptor. - * @param [toJSONOptions] JSON conversion options - * @returns Field descriptor - */ - public toJSON(toJSONOptions?: IToJSONOptions): IField; - - /** - * Resolves this field's type references. - * @returns `this` - * @throws {Error} If any reference cannot be resolved - */ - public resolve(): Field; -} - -/** Field descriptor. */ -export interface IField { - - /** Field rule */ - rule?: string; - - /** Field type */ - type: string; - - /** Field id */ - id: number; - - /** Field options */ - options?: { [k: string]: any }; -} - -/** Extension field descriptor. */ -export interface IExtensionField extends IField { - - /** Extended type */ - extend: string; -} - -/** - * Decorator function as returned by {@link Field.d} and {@link MapField.d} (TypeScript). - * @param prototype Target prototype - * @param fieldName Field name - */ -type FieldDecorator = (prototype: object, fieldName: string) => void; - -/** - * A node-style callback as used by {@link load} and {@link Root#load}. - * @param error Error, if any, otherwise `null` - * @param [root] Root, if there hasn't been an error - */ -type LoadCallback = (error: (Error|null), root?: Root) => void; - -/** - * Loads one or multiple .proto or preprocessed .json files into a common root namespace and calls the callback. - * @param filename One or multiple files to load - * @param root Root namespace, defaults to create a new one if omitted. - * @param callback Callback function - * @see {@link Root#load} - */ -export function load(filename: (string|string[]), root: Root, callback: LoadCallback): void; - -/** - * Loads one or multiple .proto or preprocessed .json files into a common root namespace and calls the callback. - * @param filename One or multiple files to load - * @param callback Callback function - * @see {@link Root#load} - */ -export function load(filename: (string|string[]), callback: LoadCallback): void; - -/** - * Loads one or multiple .proto or preprocessed .json files into a common root namespace and returns a promise. - * @param filename One or multiple files to load - * @param [root] Root namespace, defaults to create a new one if omitted. - * @returns Promise - * @see {@link Root#load} - */ -export function load(filename: (string|string[]), root?: Root): Promise; - -/** - * Synchronously loads one or multiple .proto or preprocessed .json files into a common root namespace (node only). - * @param filename One or multiple files to load - * @param [root] Root namespace, defaults to create a new one if omitted. - * @returns Root namespace - * @throws {Error} If synchronous fetching is not supported (i.e. in browsers) or if a file's syntax is invalid - * @see {@link Root#loadSync} - */ -export function loadSync(filename: (string|string[]), root?: Root): Root; - -/** Build type, one of `"full"`, `"light"` or `"minimal"`. */ -export const build: string; - -/** Reconfigures the library according to the environment. */ -export function configure(): void; - -/** Reflected map field. */ -export class MapField extends FieldBase { - - /** - * Constructs a new map field instance. - * @param name Unique name within its namespace - * @param id Unique id within its namespace - * @param keyType Key type - * @param type Value type - * @param [options] Declared options - * @param [comment] Comment associated with this field - */ - constructor(name: string, id: number, keyType: string, type: string, options?: { [k: string]: any }, comment?: string); - - /** Key type. */ - public keyType: string; - - /** Resolved key type if not a basic type. */ - public resolvedKeyType: (ReflectionObject|null); - - /** - * Constructs a map field from a map field descriptor. - * @param name Field name - * @param json Map field descriptor - * @returns Created map field - * @throws {TypeError} If arguments are invalid - */ - public static fromJSON(name: string, json: IMapField): MapField; - - /** - * Converts this map field to a map field descriptor. - * @param [toJSONOptions] JSON conversion options - * @returns Map field descriptor - */ - public toJSON(toJSONOptions?: IToJSONOptions): IMapField; - - /** - * Map field decorator (TypeScript). - * @param fieldId Field id - * @param fieldKeyType Field key type - * @param fieldValueType Field value type - * @returns Decorator function - */ - public static d }>(fieldId: number, fieldKeyType: ("int32"|"uint32"|"sint32"|"fixed32"|"sfixed32"|"int64"|"uint64"|"sint64"|"fixed64"|"sfixed64"|"bool"|"string"), fieldValueType: ("double"|"float"|"int32"|"uint32"|"sint32"|"fixed32"|"sfixed32"|"int64"|"uint64"|"sint64"|"fixed64"|"sfixed64"|"bool"|"string"|"bytes"|object|Constructor<{}>)): FieldDecorator; -} - -/** Map field descriptor. */ -export interface IMapField extends IField { - - /** Key type */ - keyType: string; -} - -/** Extension map field descriptor. */ -export interface IExtensionMapField extends IMapField { - - /** Extended type */ - extend: string; -} - -/** Abstract runtime message. */ -export class Message { - - /** - * Constructs a new message instance. - * @param [properties] Properties to set - */ - constructor(properties?: Properties); - - /** Reference to the reflected type. */ - public static readonly $type: Type; - - /** Reference to the reflected type. */ - public readonly $type: Type; - - /** - * Creates a new message of this type using the specified properties. - * @param [properties] Properties to set - * @returns Message instance - */ - public static create>(this: Constructor, properties?: { [k: string]: any }): Message; - - /** - * Encodes a message of this type. - * @param message Message to encode - * @param [writer] Writer to use - * @returns Writer - */ - public static encode>(this: Constructor, message: (T|{ [k: string]: any }), writer?: Writer): Writer; - - /** - * Encodes a message of this type preceeded by its length as a varint. - * @param message Message to encode - * @param [writer] Writer to use - * @returns Writer - */ - public static encodeDelimited>(this: Constructor, message: (T|{ [k: string]: any }), writer?: Writer): Writer; - - /** - * Decodes a message of this type. - * @param reader Reader or buffer to decode - * @returns Decoded message - */ - public static decode>(this: Constructor, reader: (Reader|Uint8Array)): T; - - /** - * Decodes a message of this type preceeded by its length as a varint. - * @param reader Reader or buffer to decode - * @returns Decoded message - */ - public static decodeDelimited>(this: Constructor, reader: (Reader|Uint8Array)): T; - - /** - * Verifies a message of this type. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a new message of this type from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Message instance - */ - public static fromObject>(this: Constructor, object: { [k: string]: any }): T; - - /** - * Creates a plain object from a message of this type. Also converts values to other types if specified. - * @param message Message instance - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject>(this: Constructor, message: T, options?: IConversionOptions): { [k: string]: any }; - - /** - * Converts this message to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; -} - -/** Reflected service method. */ -export class Method extends ReflectionObject { - - /** - * Constructs a new service method instance. - * @param name Method name - * @param type Method type, usually `"rpc"` - * @param requestType Request message type - * @param responseType Response message type - * @param [requestStream] Whether the request is streamed - * @param [responseStream] Whether the response is streamed - * @param [options] Declared options - * @param [comment] The comment for this method - * @param [parsedOptions] Declared options, properly parsed into an object - */ - constructor(name: string, type: (string|undefined), requestType: string, responseType: string, requestStream?: (boolean|{ [k: string]: any }), responseStream?: (boolean|{ [k: string]: any }), options?: { [k: string]: any }, comment?: string, parsedOptions?: { [k: string]: any }); - - /** Method type. */ - public type: string; - - /** Request type. */ - public requestType: string; - - /** Whether requests are streamed or not. */ - public requestStream?: boolean; - - /** Response type. */ - public responseType: string; - - /** Whether responses are streamed or not. */ - public responseStream?: boolean; - - /** Resolved request type. */ - public resolvedRequestType: (Type|null); - - /** Resolved response type. */ - public resolvedResponseType: (Type|null); - - /** Comment for this method */ - public comment: (string|null); - - /** Options properly parsed into an object */ - public parsedOptions: any; - - /** - * Constructs a method from a method descriptor. - * @param name Method name - * @param json Method descriptor - * @returns Created method - * @throws {TypeError} If arguments are invalid - */ - public static fromJSON(name: string, json: IMethod): Method; - - /** - * Converts this method to a method descriptor. - * @param [toJSONOptions] JSON conversion options - * @returns Method descriptor - */ - public toJSON(toJSONOptions?: IToJSONOptions): IMethod; -} - -/** Method descriptor. */ -export interface IMethod { - - /** Method type */ - type?: string; - - /** Request type */ - requestType: string; - - /** Response type */ - responseType: string; - - /** Whether requests are streamed */ - requestStream?: boolean; - - /** Whether responses are streamed */ - responseStream?: boolean; - - /** Method options */ - options?: { [k: string]: any }; - - /** Method comments */ - comment: string; - - /** Method options properly parsed into an object */ - parsedOptions?: { [k: string]: any }; -} - -/** Reflected namespace. */ -export class Namespace extends NamespaceBase { - - /** - * Constructs a new namespace instance. - * @param name Namespace name - * @param [options] Declared options - */ - constructor(name: string, options?: { [k: string]: any }); - - /** - * Constructs a namespace from JSON. - * @param name Namespace name - * @param json JSON object - * @returns Created namespace - * @throws {TypeError} If arguments are invalid - */ - public static fromJSON(name: string, json: { [k: string]: any }): Namespace; - - /** - * Converts an array of reflection objects to JSON. - * @param array Object array - * @param [toJSONOptions] JSON conversion options - * @returns JSON object or `undefined` when array is empty - */ - public static arrayToJSON(array: ReflectionObject[], toJSONOptions?: IToJSONOptions): ({ [k: string]: any }|undefined); - - /** - * Tests if the specified id is reserved. - * @param reserved Array of reserved ranges and names - * @param id Id to test - * @returns `true` if reserved, otherwise `false` - */ - public static isReservedId(reserved: ((number[]|string)[]|undefined), id: number): boolean; - - /** - * Tests if the specified name is reserved. - * @param reserved Array of reserved ranges and names - * @param name Name to test - * @returns `true` if reserved, otherwise `false` - */ - public static isReservedName(reserved: ((number[]|string)[]|undefined), name: string): boolean; -} - -/** Base class of all reflection objects containing nested objects. This is not an actual class but here for the sake of having consistent type definitions. */ -export abstract class NamespaceBase extends ReflectionObject { - - /** Nested objects by name. */ - public nested?: { [k: string]: ReflectionObject }; - - /** Nested objects of this namespace as an array for iteration. */ - public readonly nestedArray: ReflectionObject[]; - - /** - * Converts this namespace to a namespace descriptor. - * @param [toJSONOptions] JSON conversion options - * @returns Namespace descriptor - */ - public toJSON(toJSONOptions?: IToJSONOptions): INamespace; - - /** - * Adds nested objects to this namespace from nested object descriptors. - * @param nestedJson Any nested object descriptors - * @returns `this` - */ - public addJSON(nestedJson: { [k: string]: AnyNestedObject }): Namespace; - - /** - * Gets the nested object of the specified name. - * @param name Nested object name - * @returns The reflection object or `null` if it doesn't exist - */ - public get(name: string): (ReflectionObject|null); - - /** - * Gets the values of the nested {@link Enum|enum} of the specified name. - * This methods differs from {@link Namespace#get|get} in that it returns an enum's values directly and throws instead of returning `null`. - * @param name Nested enum name - * @returns Enum values - * @throws {Error} If there is no such enum - */ - public getEnum(name: string): { [k: string]: number }; - - /** - * Adds a nested object to this namespace. - * @param object Nested object to add - * @returns `this` - * @throws {TypeError} If arguments are invalid - * @throws {Error} If there is already a nested object with this name - */ - public add(object: ReflectionObject): Namespace; - - /** - * Removes a nested object from this namespace. - * @param object Nested object to remove - * @returns `this` - * @throws {TypeError} If arguments are invalid - * @throws {Error} If `object` is not a member of this namespace - */ - public remove(object: ReflectionObject): Namespace; - - /** - * Defines additial namespaces within this one if not yet existing. - * @param path Path to create - * @param [json] Nested types to create from JSON - * @returns Pointer to the last namespace created or `this` if path is empty - */ - public define(path: (string|string[]), json?: any): Namespace; - - /** - * Resolves this namespace's and all its nested objects' type references. Useful to validate a reflection tree, but comes at a cost. - * @returns `this` - */ - public resolveAll(): Namespace; - - /** - * Recursively looks up the reflection object matching the specified path in the scope of this namespace. - * @param path Path to look up - * @param filterTypes Filter types, any combination of the constructors of `protobuf.Type`, `protobuf.Enum`, `protobuf.Service` etc. - * @param [parentAlreadyChecked=false] If known, whether the parent has already been checked - * @returns Looked up object or `null` if none could be found - */ - public lookup(path: (string|string[]), filterTypes: (any|any[]), parentAlreadyChecked?: boolean): (ReflectionObject|null); - - /** - * Looks up the reflection object at the specified path, relative to this namespace. - * @param path Path to look up - * @param [parentAlreadyChecked=false] Whether the parent has already been checked - * @returns Looked up object or `null` if none could be found - */ - public lookup(path: (string|string[]), parentAlreadyChecked?: boolean): (ReflectionObject|null); - - /** - * Looks up the {@link Type|type} at the specified path, relative to this namespace. - * Besides its signature, this methods differs from {@link Namespace#lookup|lookup} in that it throws instead of returning `null`. - * @param path Path to look up - * @returns Looked up type - * @throws {Error} If `path` does not point to a type - */ - public lookupType(path: (string|string[])): Type; - - /** - * Looks up the values of the {@link Enum|enum} at the specified path, relative to this namespace. - * Besides its signature, this methods differs from {@link Namespace#lookup|lookup} in that it throws instead of returning `null`. - * @param path Path to look up - * @returns Looked up enum - * @throws {Error} If `path` does not point to an enum - */ - public lookupEnum(path: (string|string[])): Enum; - - /** - * Looks up the {@link Type|type} or {@link Enum|enum} at the specified path, relative to this namespace. - * Besides its signature, this methods differs from {@link Namespace#lookup|lookup} in that it throws instead of returning `null`. - * @param path Path to look up - * @returns Looked up type or enum - * @throws {Error} If `path` does not point to a type or enum - */ - public lookupTypeOrEnum(path: (string|string[])): Type; - - /** - * Looks up the {@link Service|service} at the specified path, relative to this namespace. - * Besides its signature, this methods differs from {@link Namespace#lookup|lookup} in that it throws instead of returning `null`. - * @param path Path to look up - * @returns Looked up service - * @throws {Error} If `path` does not point to a service - */ - public lookupService(path: (string|string[])): Service; -} - -/** Namespace descriptor. */ -export interface INamespace { - - /** Namespace options */ - options?: { [k: string]: any }; - - /** Nested object descriptors */ - nested?: { [k: string]: AnyNestedObject }; -} - -/** Any extension field descriptor. */ -type AnyExtensionField = (IExtensionField|IExtensionMapField); - -/** Any nested object descriptor. */ -type AnyNestedObject = (IEnum|IType|IService|AnyExtensionField|INamespace|IOneOf); - -/** Base class of all reflection objects. */ -export abstract class ReflectionObject { - - /** Options. */ - public options?: { [k: string]: any }; - - /** Parsed Options. */ - public parsedOptions?: { [k: string]: any[] }; - - /** Unique name within its namespace. */ - public name: string; - - /** Parent namespace. */ - public parent: (Namespace|null); - - /** Whether already resolved or not. */ - public resolved: boolean; - - /** Comment text, if any. */ - public comment: (string|null); - - /** Defining file name. */ - public filename: (string|null); - - /** Reference to the root namespace. */ - public readonly root: Root; - - /** Full name including leading dot. */ - public readonly fullName: string; - - /** - * Converts this reflection object to its descriptor representation. - * @returns Descriptor - */ - public toJSON(): { [k: string]: any }; - - /** - * Called when this object is added to a parent. - * @param parent Parent added to - */ - public onAdd(parent: ReflectionObject): void; - - /** - * Called when this object is removed from a parent. - * @param parent Parent removed from - */ - public onRemove(parent: ReflectionObject): void; - - /** - * Resolves this objects type references. - * @returns `this` - */ - public resolve(): ReflectionObject; - - /** - * Gets an option value. - * @param name Option name - * @returns Option value or `undefined` if not set - */ - public getOption(name: string): any; - - /** - * Sets an option. - * @param name Option name - * @param value Option value - * @param [ifNotSet] Sets the option only if it isn't currently set - * @returns `this` - */ - public setOption(name: string, value: any, ifNotSet?: boolean): ReflectionObject; - - /** - * Sets a parsed option. - * @param name parsed Option name - * @param value Option value - * @param propName dot '.' delimited full path of property within the option to set. if undefined\empty, will add a new option with that value - * @returns `this` - */ - public setParsedOption(name: string, value: any, propName: string): ReflectionObject; - - /** - * Sets multiple options. - * @param options Options to set - * @param [ifNotSet] Sets an option only if it isn't currently set - * @returns `this` - */ - public setOptions(options: { [k: string]: any }, ifNotSet?: boolean): ReflectionObject; - - /** - * Converts this instance to its string representation. - * @returns Class name[, space, full name] - */ - public toString(): string; -} - -/** Reflected oneof. */ -export class OneOf extends ReflectionObject { - - /** - * Constructs a new oneof instance. - * @param name Oneof name - * @param [fieldNames] Field names - * @param [options] Declared options - * @param [comment] Comment associated with this field - */ - constructor(name: string, fieldNames?: (string[]|{ [k: string]: any }), options?: { [k: string]: any }, comment?: string); - - /** Field names that belong to this oneof. */ - public oneof: string[]; - - /** Fields that belong to this oneof as an array for iteration. */ - public readonly fieldsArray: Field[]; - - /** Comment for this field. */ - public comment: (string|null); - - /** - * Constructs a oneof from a oneof descriptor. - * @param name Oneof name - * @param json Oneof descriptor - * @returns Created oneof - * @throws {TypeError} If arguments are invalid - */ - public static fromJSON(name: string, json: IOneOf): OneOf; - - /** - * Converts this oneof to a oneof descriptor. - * @param [toJSONOptions] JSON conversion options - * @returns Oneof descriptor - */ - public toJSON(toJSONOptions?: IToJSONOptions): IOneOf; - - /** - * Adds a field to this oneof and removes it from its current parent, if any. - * @param field Field to add - * @returns `this` - */ - public add(field: Field): OneOf; - - /** - * Removes a field from this oneof and puts it back to the oneof's parent. - * @param field Field to remove - * @returns `this` - */ - public remove(field: Field): OneOf; - - /** - * OneOf decorator (TypeScript). - * @param fieldNames Field names - * @returns Decorator function - */ - public static d(...fieldNames: string[]): OneOfDecorator; -} - -/** Oneof descriptor. */ -export interface IOneOf { - - /** Oneof field names */ - oneof: string[]; - - /** Oneof options */ - options?: { [k: string]: any }; -} - -/** - * Decorator function as returned by {@link OneOf.d} (TypeScript). - * @param prototype Target prototype - * @param oneofName OneOf name - */ -type OneOfDecorator = (prototype: object, oneofName: string) => void; - -/** - * Parses the given .proto source and returns an object with the parsed contents. - * @param source Source contents - * @param [options] Parse options. Defaults to {@link parse.defaults} when omitted. - * @returns Parser result - */ -export function parse(source: string, options?: IParseOptions): IParserResult; - -/** Result object returned from {@link parse}. */ -export interface IParserResult { - - /** Package name, if declared */ - package: (string|undefined); - - /** Imports, if any */ - imports: (string[]|undefined); - - /** Weak imports, if any */ - weakImports: (string[]|undefined); - - /** Syntax, if specified (either `"proto2"` or `"proto3"`) */ - syntax: (string|undefined); - - /** Populated root instance */ - root: Root; -} - -/** Options modifying the behavior of {@link parse}. */ -export interface IParseOptions { - - /** Keeps field casing instead of converting to camel case */ - keepCase?: boolean; - - /** Recognize double-slash comments in addition to doc-block comments. */ - alternateCommentMode?: boolean; - - /** Use trailing comment when both leading comment and trailing comment exist. */ - preferTrailingComment?: boolean; -} - -/** Options modifying the behavior of JSON serialization. */ -export interface IToJSONOptions { - - /** Serializes comments. */ - keepComments?: boolean; -} - -/** - * Parses the given .proto source and returns an object with the parsed contents. - * @param source Source contents - * @param root Root to populate - * @param [options] Parse options. Defaults to {@link parse.defaults} when omitted. - * @returns Parser result - */ -export function parse(source: string, root: Root, options?: IParseOptions): IParserResult; - -/** Wire format reader using `Uint8Array` if available, otherwise `Array`. */ -export class Reader { - - /** - * Constructs a new reader instance using the specified buffer. - * @param buffer Buffer to read from - */ - constructor(buffer: Uint8Array); - - /** Read buffer. */ - public buf: Uint8Array; - - /** Read buffer position. */ - public pos: number; - - /** Read buffer length. */ - public len: number; - - /** - * Creates a new reader using the specified buffer. - * @param buffer Buffer to read from - * @returns A {@link BufferReader} if `buffer` is a Buffer, otherwise a {@link Reader} - * @throws {Error} If `buffer` is not a valid buffer - */ - public static create(buffer: (Uint8Array|Buffer)): (Reader|BufferReader); - - /** - * Reads a varint as an unsigned 32 bit value. - * @returns Value read - */ - public uint32(): number; - - /** - * Reads a varint as a signed 32 bit value. - * @returns Value read - */ - public int32(): number; - - /** - * Reads a zig-zag encoded varint as a signed 32 bit value. - * @returns Value read - */ - public sint32(): number; - - /** - * Reads a varint as a signed 64 bit value. - * @returns Value read - */ - public int64(): Long; - - /** - * Reads a varint as an unsigned 64 bit value. - * @returns Value read - */ - public uint64(): Long; - - /** - * Reads a zig-zag encoded varint as a signed 64 bit value. - * @returns Value read - */ - public sint64(): Long; - - /** - * Reads a varint as a boolean. - * @returns Value read - */ - public bool(): boolean; - - /** - * Reads fixed 32 bits as an unsigned 32 bit integer. - * @returns Value read - */ - public fixed32(): number; - - /** - * Reads fixed 32 bits as a signed 32 bit integer. - * @returns Value read - */ - public sfixed32(): number; - - /** - * Reads fixed 64 bits. - * @returns Value read - */ - public fixed64(): Long; - - /** - * Reads zig-zag encoded fixed 64 bits. - * @returns Value read - */ - public sfixed64(): Long; - - /** - * Reads a float (32 bit) as a number. - * @returns Value read - */ - public float(): number; - - /** - * Reads a double (64 bit float) as a number. - * @returns Value read - */ - public double(): number; - - /** - * Reads a sequence of bytes preceeded by its length as a varint. - * @returns Value read - */ - public bytes(): Uint8Array; - - /** - * Reads a string preceeded by its byte length as a varint. - * @returns Value read - */ - public string(): string; - - /** - * Skips the specified number of bytes if specified, otherwise skips a varint. - * @param [length] Length if known, otherwise a varint is assumed - * @returns `this` - */ - public skip(length?: number): Reader; - - /** - * Skips the next element of the specified wire type. - * @param wireType Wire type received - * @returns `this` - */ - public skipType(wireType: number): Reader; -} - -/** Wire format reader using node buffers. */ -export class BufferReader extends Reader { - - /** - * Constructs a new buffer reader instance. - * @param buffer Buffer to read from - */ - constructor(buffer: Buffer); - - /** - * Reads a sequence of bytes preceeded by its length as a varint. - * @returns Value read - */ - public bytes(): Buffer; -} - -/** Root namespace wrapping all types, enums, services, sub-namespaces etc. that belong together. */ -export class Root extends NamespaceBase { - - /** - * Constructs a new root namespace instance. - * @param [options] Top level options - */ - constructor(options?: { [k: string]: any }); - - /** Deferred extension fields. */ - public deferred: Field[]; - - /** Resolved file names of loaded files. */ - public files: string[]; - - /** - * Loads a namespace descriptor into a root namespace. - * @param json Nameespace descriptor - * @param [root] Root namespace, defaults to create a new one if omitted - * @returns Root namespace - */ - public static fromJSON(json: INamespace, root?: Root): Root; - - /** - * Resolves the path of an imported file, relative to the importing origin. - * This method exists so you can override it with your own logic in case your imports are scattered over multiple directories. - * @param origin The file name of the importing file - * @param target The file name being imported - * @returns Resolved path to `target` or `null` to skip the file - */ - public resolvePath(origin: string, target: string): (string|null); - - /** - * Fetch content from file path or url - * This method exists so you can override it with your own logic. - * @param path File path or url - * @param callback Callback function - */ - public fetch(path: string, callback: FetchCallback): void; - - /** - * Loads one or multiple .proto or preprocessed .json files into this root namespace and calls the callback. - * @param filename Names of one or multiple files to load - * @param options Parse options - * @param callback Callback function - */ - public load(filename: (string|string[]), options: IParseOptions, callback: LoadCallback): void; - - /** - * Loads one or multiple .proto or preprocessed .json files into this root namespace and calls the callback. - * @param filename Names of one or multiple files to load - * @param callback Callback function - */ - public load(filename: (string|string[]), callback: LoadCallback): void; - - /** - * Loads one or multiple .proto or preprocessed .json files into this root namespace and returns a promise. - * @param filename Names of one or multiple files to load - * @param [options] Parse options. Defaults to {@link parse.defaults} when omitted. - * @returns Promise - */ - public load(filename: (string|string[]), options?: IParseOptions): Promise; - - /** - * Synchronously loads one or multiple .proto or preprocessed .json files into this root namespace (node only). - * @param filename Names of one or multiple files to load - * @param [options] Parse options. Defaults to {@link parse.defaults} when omitted. - * @returns Root namespace - * @throws {Error} If synchronous fetching is not supported (i.e. in browsers) or if a file's syntax is invalid - */ - public loadSync(filename: (string|string[]), options?: IParseOptions): Root; -} - -/** - * Named roots. - * This is where pbjs stores generated structures (the option `-r, --root` specifies a name). - * Can also be used manually to make roots available across modules. - */ -export let roots: { [k: string]: Root }; - -/** Streaming RPC helpers. */ -export namespace rpc { - - /** - * A service method callback as used by {@link rpc.ServiceMethod|ServiceMethod}. - * - * Differs from {@link RPCImplCallback} in that it is an actual callback of a service method which may not return `response = null`. - * @param error Error, if any - * @param [response] Response message - */ - type ServiceMethodCallback> = (error: (Error|null), response?: TRes) => void; - - /** - * A service method part of a {@link rpc.Service} as created by {@link Service.create}. - * @param request Request message or plain object - * @param [callback] Node-style callback called with the error, if any, and the response message - * @returns Promise if `callback` has been omitted, otherwise `undefined` - */ - type ServiceMethod, TRes extends Message> = (request: (TReq|Properties), callback?: rpc.ServiceMethodCallback) => Promise>; - - /** An RPC service as returned by {@link Service#create}. */ - class Service extends util.EventEmitter { - - /** - * Constructs a new RPC service instance. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - */ - constructor(rpcImpl: RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); - - /** RPC implementation. Becomes `null` once the service is ended. */ - public rpcImpl: (RPCImpl|null); - - /** Whether requests are length-delimited. */ - public requestDelimited: boolean; - - /** Whether responses are length-delimited. */ - public responseDelimited: boolean; - - /** - * Calls a service method through {@link rpc.Service#rpcImpl|rpcImpl}. - * @param method Reflected or static method - * @param requestCtor Request constructor - * @param responseCtor Response constructor - * @param request Request message or plain object - * @param callback Service callback - */ - public rpcCall, TRes extends Message>(method: (Method|rpc.ServiceMethod), requestCtor: Constructor, responseCtor: Constructor, request: (TReq|Properties), callback: rpc.ServiceMethodCallback): void; - - /** - * Ends this service and emits the `end` event. - * @param [endedByRPC=false] Whether the service has been ended by the RPC implementation. - * @returns `this` - */ - public end(endedByRPC?: boolean): rpc.Service; - } -} - -/** - * RPC implementation passed to {@link Service#create} performing a service request on network level, i.e. by utilizing http requests or websockets. - * @param method Reflected or static method being called - * @param requestData Request data - * @param callback Callback function - */ -type RPCImpl = (method: (Method|rpc.ServiceMethod, Message<{}>>), requestData: Uint8Array, callback: RPCImplCallback) => void; - -/** - * Node-style callback as used by {@link RPCImpl}. - * @param error Error, if any, otherwise `null` - * @param [response] Response data or `null` to signal end of stream, if there hasn't been an error - */ -type RPCImplCallback = (error: (Error|null), response?: (Uint8Array|null)) => void; - -/** Reflected service. */ -export class Service extends NamespaceBase { - - /** - * Constructs a new service instance. - * @param name Service name - * @param [options] Service options - * @throws {TypeError} If arguments are invalid - */ - constructor(name: string, options?: { [k: string]: any }); - - /** Service methods. */ - public methods: { [k: string]: Method }; - - /** - * Constructs a service from a service descriptor. - * @param name Service name - * @param json Service descriptor - * @returns Created service - * @throws {TypeError} If arguments are invalid - */ - public static fromJSON(name: string, json: IService): Service; - - /** - * Converts this service to a service descriptor. - * @param [toJSONOptions] JSON conversion options - * @returns Service descriptor - */ - public toJSON(toJSONOptions?: IToJSONOptions): IService; - - /** Methods of this service as an array for iteration. */ - public readonly methodsArray: Method[]; - - /** - * Creates a runtime service using the specified rpc implementation. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - * @returns RPC service. Useful where requests and/or responses are streamed. - */ - public create(rpcImpl: RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): rpc.Service; -} - -/** Service descriptor. */ -export interface IService extends INamespace { - - /** Method descriptors */ - methods: { [k: string]: IMethod }; -} - -/** - * Gets the next token and advances. - * @returns Next token or `null` on eof - */ -type TokenizerHandleNext = () => (string|null); - -/** - * Peeks for the next token. - * @returns Next token or `null` on eof - */ -type TokenizerHandlePeek = () => (string|null); - -/** - * Pushes a token back to the stack. - * @param token Token - */ -type TokenizerHandlePush = (token: string) => void; - -/** - * Skips the next token. - * @param expected Expected token - * @param [optional=false] If optional - * @returns Whether the token matched - * @throws {Error} If the token didn't match and is not optional - */ -type TokenizerHandleSkip = (expected: string, optional?: boolean) => boolean; - -/** - * Gets the comment on the previous line or, alternatively, the line comment on the specified line. - * @param [line] Line number - * @returns Comment text or `null` if none - */ -type TokenizerHandleCmnt = (line?: number) => (string|null); - -/** Handle object returned from {@link tokenize}. */ -export interface ITokenizerHandle { - - /** Gets the next token and advances (`null` on eof) */ - next: TokenizerHandleNext; - - /** Peeks for the next token (`null` on eof) */ - peek: TokenizerHandlePeek; - - /** Pushes a token back to the stack */ - push: TokenizerHandlePush; - - /** Skips a token, returns its presence and advances or, if non-optional and not present, throws */ - skip: TokenizerHandleSkip; - - /** Gets the comment on the previous line or the line comment on the specified line, if any */ - cmnt: TokenizerHandleCmnt; - - /** Current line number */ - line: number; -} - -/** - * Tokenizes the given .proto source and returns an object with useful utility functions. - * @param source Source contents - * @param alternateCommentMode Whether we should activate alternate comment parsing mode. - * @returns Tokenizer handle - */ -export function tokenize(source: string, alternateCommentMode: boolean): ITokenizerHandle; - -export namespace tokenize { - - /** - * Unescapes a string. - * @param str String to unescape - * @returns Unescaped string - */ - function unescape(str: string): string; -} - -/** Reflected message type. */ -export class Type extends NamespaceBase { - - /** - * Constructs a new reflected message type instance. - * @param name Message name - * @param [options] Declared options - */ - constructor(name: string, options?: { [k: string]: any }); - - /** Message fields. */ - public fields: { [k: string]: Field }; - - /** Oneofs declared within this namespace, if any. */ - public oneofs: { [k: string]: OneOf }; - - /** Extension ranges, if any. */ - public extensions: number[][]; - - /** Reserved ranges, if any. */ - public reserved: (number[]|string)[]; - - /** Message fields by id. */ - public readonly fieldsById: { [k: number]: Field }; - - /** Fields of this message as an array for iteration. */ - public readonly fieldsArray: Field[]; - - /** Oneofs of this message as an array for iteration. */ - public readonly oneofsArray: OneOf[]; - - /** - * The registered constructor, if any registered, otherwise a generic constructor. - * Assigning a function replaces the internal constructor. If the function does not extend {@link Message} yet, its prototype will be setup accordingly and static methods will be populated. If it already extends {@link Message}, it will just replace the internal constructor. - */ - public ctor: Constructor<{}>; - - /** - * Generates a constructor function for the specified type. - * @param mtype Message type - * @returns Codegen instance - */ - public static generateConstructor(mtype: Type): Codegen; - - /** - * Creates a message type from a message type descriptor. - * @param name Message name - * @param json Message type descriptor - * @returns Created message type - */ - public static fromJSON(name: string, json: IType): Type; - - /** - * Converts this message type to a message type descriptor. - * @param [toJSONOptions] JSON conversion options - * @returns Message type descriptor - */ - public toJSON(toJSONOptions?: IToJSONOptions): IType; - - /** - * Adds a nested object to this type. - * @param object Nested object to add - * @returns `this` - * @throws {TypeError} If arguments are invalid - * @throws {Error} If there is already a nested object with this name or, if a field, when there is already a field with this id - */ - public add(object: ReflectionObject): Type; - - /** - * Removes a nested object from this type. - * @param object Nested object to remove - * @returns `this` - * @throws {TypeError} If arguments are invalid - * @throws {Error} If `object` is not a member of this type - */ - public remove(object: ReflectionObject): Type; - - /** - * Tests if the specified id is reserved. - * @param id Id to test - * @returns `true` if reserved, otherwise `false` - */ - public isReservedId(id: number): boolean; - - /** - * Tests if the specified name is reserved. - * @param name Name to test - * @returns `true` if reserved, otherwise `false` - */ - public isReservedName(name: string): boolean; - - /** - * Creates a new message of this type using the specified properties. - * @param [properties] Properties to set - * @returns Message instance - */ - public create(properties?: { [k: string]: any }): Message<{}>; - - /** - * Sets up {@link Type#encode|encode}, {@link Type#decode|decode} and {@link Type#verify|verify}. - * @returns `this` - */ - public setup(): Type; - - /** - * Encodes a message of this type. Does not implicitly {@link Type#verify|verify} messages. - * @param message Message instance or plain object - * @param [writer] Writer to encode to - * @returns writer - */ - public encode(message: (Message<{}>|{ [k: string]: any }), writer?: Writer): Writer; - - /** - * Encodes a message of this type preceeded by its byte length as a varint. Does not implicitly {@link Type#verify|verify} messages. - * @param message Message instance or plain object - * @param [writer] Writer to encode to - * @returns writer - */ - public encodeDelimited(message: (Message<{}>|{ [k: string]: any }), writer?: Writer): Writer; - - /** - * Decodes a message of this type. - * @param reader Reader or buffer to decode from - * @param [length] Length of the message, if known beforehand - * @returns Decoded message - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {util.ProtocolError<{}>} If required fields are missing - */ - public decode(reader: (Reader|Uint8Array), length?: number): Message<{}>; - - /** - * Decodes a message of this type preceeded by its byte length as a varint. - * @param reader Reader or buffer to decode from - * @returns Decoded message - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {util.ProtocolError} If required fields are missing - */ - public decodeDelimited(reader: (Reader|Uint8Array)): Message<{}>; - - /** - * Verifies that field values are valid and that required fields are present. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public verify(message: { [k: string]: any }): (null|string); - - /** - * Creates a new message of this type from a plain object. Also converts values to their respective internal types. - * @param object Plain object to convert - * @returns Message instance - */ - public fromObject(object: { [k: string]: any }): Message<{}>; - - /** - * Creates a plain object from a message of this type. Also converts values to other types if specified. - * @param message Message instance - * @param [options] Conversion options - * @returns Plain object - */ - public toObject(message: Message<{}>, options?: IConversionOptions): { [k: string]: any }; - - /** - * Type decorator (TypeScript). - * @param [typeName] Type name, defaults to the constructor's name - * @returns Decorator function - */ - public static d>(typeName?: string): TypeDecorator; -} - -/** Message type descriptor. */ -export interface IType extends INamespace { - - /** Oneof descriptors */ - oneofs?: { [k: string]: IOneOf }; - - /** Field descriptors */ - fields: { [k: string]: IField }; - - /** Extension ranges */ - extensions?: number[][]; - - /** Reserved ranges */ - reserved?: number[][]; - - /** Whether a legacy group or not */ - group?: boolean; -} - -/** Conversion options as used by {@link Type#toObject} and {@link Message.toObject}. */ -export interface IConversionOptions { - - /** - * Long conversion type. - * Valid values are `String` and `Number` (the global types). - * Defaults to copy the present value, which is a possibly unsafe number without and a {@link Long} with a long library. - */ - longs?: Function; - - /** - * Enum value conversion type. - * Only valid value is `String` (the global type). - * Defaults to copy the present value, which is the numeric id. - */ - enums?: Function; - - /** - * Bytes value conversion type. - * Valid values are `Array` and (a base64 encoded) `String` (the global types). - * Defaults to copy the present value, which usually is a Buffer under node and an Uint8Array in the browser. - */ - bytes?: Function; - - /** Also sets default values on the resulting object */ - defaults?: boolean; - - /** Sets empty arrays for missing repeated fields even if `defaults=false` */ - arrays?: boolean; - - /** Sets empty objects for missing map fields even if `defaults=false` */ - objects?: boolean; - - /** Includes virtual oneof properties set to the present field's name, if any */ - oneofs?: boolean; - - /** Performs additional JSON compatibility conversions, i.e. NaN and Infinity to strings */ - json?: boolean; -} - -/** - * Decorator function as returned by {@link Type.d} (TypeScript). - * @param target Target constructor - */ -type TypeDecorator> = (target: Constructor) => void; - -/** Common type constants. */ -export namespace types { - - /** Basic type wire types. */ - const basic: { - "double": number, - "float": number, - "int32": number, - "uint32": number, - "sint32": number, - "fixed32": number, - "sfixed32": number, - "int64": number, - "uint64": number, - "sint64": number, - "fixed64": number, - "sfixed64": number, - "bool": number, - "string": number, - "bytes": number - }; - - /** Basic type defaults. */ - const defaults: { - "double": number, - "float": number, - "int32": number, - "uint32": number, - "sint32": number, - "fixed32": number, - "sfixed32": number, - "int64": number, - "uint64": number, - "sint64": number, - "fixed64": number, - "sfixed64": number, - "bool": boolean, - "string": string, - "bytes": number[], - "message": null - }; - - /** Basic long type wire types. */ - const long: { - "int64": number, - "uint64": number, - "sint64": number, - "fixed64": number, - "sfixed64": number - }; - - /** Allowed types for map keys with their associated wire type. */ - const mapKey: { - "int32": number, - "uint32": number, - "sint32": number, - "fixed32": number, - "sfixed32": number, - "int64": number, - "uint64": number, - "sint64": number, - "fixed64": number, - "sfixed64": number, - "bool": number, - "string": number - }; - - /** Allowed types for packed repeated fields with their associated wire type. */ - const packed: { - "double": number, - "float": number, - "int32": number, - "uint32": number, - "sint32": number, - "fixed32": number, - "sfixed32": number, - "int64": number, - "uint64": number, - "sint64": number, - "fixed64": number, - "sfixed64": number, - "bool": number - }; -} - -/** Constructor type. */ -export interface Constructor extends Function { - new(...params: any[]): T; prototype: T; -} - -/** Properties type. */ -type Properties = { [P in keyof T]?: T[P] }; - -/** - * Any compatible Buffer instance. - * This is a minimal stand-alone definition of a Buffer instance. The actual type is that exported by node's typings. - */ -export interface Buffer extends Uint8Array { -} - -/** - * Any compatible Long instance. - * This is a minimal stand-alone definition of a Long instance. The actual type is that exported by long.js. - */ -export interface Long { - - /** Low bits */ - low: number; - - /** High bits */ - high: number; - - /** Whether unsigned or not */ - unsigned: boolean; -} - -/** - * A OneOf getter as returned by {@link util.oneOfGetter}. - * @returns Set field name, if any - */ -type OneOfGetter = () => (string|undefined); - -/** - * A OneOf setter as returned by {@link util.oneOfSetter}. - * @param value Field name - */ -type OneOfSetter = (value: (string|undefined)) => void; - -/** Various utility functions. */ -export namespace util { - - /** Helper class for working with the low and high bits of a 64 bit value. */ - class LongBits { - - /** - * Constructs new long bits. - * @param lo Low 32 bits, unsigned - * @param hi High 32 bits, unsigned - */ - constructor(lo: number, hi: number); - - /** Low bits. */ - public lo: number; - - /** High bits. */ - public hi: number; - - /** Zero bits. */ - public static zero: util.LongBits; - - /** Zero hash. */ - public static zeroHash: string; - - /** - * Constructs new long bits from the specified number. - * @param value Value - * @returns Instance - */ - public static fromNumber(value: number): util.LongBits; - - /** - * Constructs new long bits from a number, long or string. - * @param value Value - * @returns Instance - */ - public static from(value: (Long|number|string)): util.LongBits; - - /** - * Converts this long bits to a possibly unsafe JavaScript number. - * @param [unsigned=false] Whether unsigned or not - * @returns Possibly unsafe number - */ - public toNumber(unsigned?: boolean): number; - - /** - * Converts this long bits to a long. - * @param [unsigned=false] Whether unsigned or not - * @returns Long - */ - public toLong(unsigned?: boolean): Long; - - /** - * Constructs new long bits from the specified 8 characters long hash. - * @param hash Hash - * @returns Bits - */ - public static fromHash(hash: string): util.LongBits; - - /** - * Converts this long bits to a 8 characters long hash. - * @returns Hash - */ - public toHash(): string; - - /** - * Zig-zag encodes this long bits. - * @returns `this` - */ - public zzEncode(): util.LongBits; - - /** - * Zig-zag decodes this long bits. - * @returns `this` - */ - public zzDecode(): util.LongBits; - - /** - * Calculates the length of this longbits when encoded as a varint. - * @returns Length - */ - public length(): number; - } - - /** Whether running within node or not. */ - let isNode: boolean; - - /** Global object reference. */ - let global: object; - - /** An immuable empty array. */ - const emptyArray: any[]; - - /** An immutable empty object. */ - const emptyObject: object; - - /** - * Tests if the specified value is an integer. - * @param value Value to test - * @returns `true` if the value is an integer - */ - function isInteger(value: any): boolean; - - /** - * Tests if the specified value is a string. - * @param value Value to test - * @returns `true` if the value is a string - */ - function isString(value: any): boolean; - - /** - * Tests if the specified value is a non-null object. - * @param value Value to test - * @returns `true` if the value is a non-null object - */ - function isObject(value: any): boolean; - - /** - * Checks if a property on a message is considered to be present. - * This is an alias of {@link util.isSet}. - * @param obj Plain object or message instance - * @param prop Property name - * @returns `true` if considered to be present, otherwise `false` - */ - function isset(obj: object, prop: string): boolean; - - /** - * Checks if a property on a message is considered to be present. - * @param obj Plain object or message instance - * @param prop Property name - * @returns `true` if considered to be present, otherwise `false` - */ - function isSet(obj: object, prop: string): boolean; - - /** Node's Buffer class if available. */ - let Buffer: Constructor; - - /** - * Creates a new buffer of whatever type supported by the environment. - * @param [sizeOrArray=0] Buffer size or number array - * @returns Buffer - */ - function newBuffer(sizeOrArray?: (number|number[])): (Uint8Array|Buffer); - - /** Array implementation used in the browser. `Uint8Array` if supported, otherwise `Array`. */ - let Array: Constructor; - - /** Long.js's Long class if available. */ - let Long: Constructor; - - /** Regular expression used to verify 2 bit (`bool`) map keys. */ - const key2Re: RegExp; - - /** Regular expression used to verify 32 bit (`int32` etc.) map keys. */ - const key32Re: RegExp; - - /** Regular expression used to verify 64 bit (`int64` etc.) map keys. */ - const key64Re: RegExp; - - /** - * Converts a number or long to an 8 characters long hash string. - * @param value Value to convert - * @returns Hash - */ - function longToHash(value: (Long|number)): string; - - /** - * Converts an 8 characters long hash string to a long or number. - * @param hash Hash - * @param [unsigned=false] Whether unsigned or not - * @returns Original value - */ - function longFromHash(hash: string, unsigned?: boolean): (Long|number); - - /** - * Merges the properties of the source object into the destination object. - * @param dst Destination object - * @param src Source object - * @param [ifNotSet=false] Merges only if the key is not already set - * @returns Destination object - */ - function merge(dst: { [k: string]: any }, src: { [k: string]: any }, ifNotSet?: boolean): { [k: string]: any }; - - /** - * Converts the first character of a string to lower case. - * @param str String to convert - * @returns Converted string - */ - function lcFirst(str: string): string; - - /** - * Creates a custom error constructor. - * @param name Error name - * @returns Custom error constructor - */ - function newError(name: string): Constructor; - - /** Error subclass indicating a protocol specifc error. */ - class ProtocolError> extends Error { - - /** - * Constructs a new protocol error. - * @param message Error message - * @param [properties] Additional properties - */ - constructor(message: string, properties?: { [k: string]: any }); - - /** So far decoded message instance. */ - public instance: Message; - } - - /** - * Builds a getter for a oneof's present field name. - * @param fieldNames Field names - * @returns Unbound getter - */ - function oneOfGetter(fieldNames: string[]): OneOfGetter; - - /** - * Builds a setter for a oneof's present field name. - * @param fieldNames Field names - * @returns Unbound setter - */ - function oneOfSetter(fieldNames: string[]): OneOfSetter; - - /** - * Default conversion options used for {@link Message#toJSON} implementations. - * - * These options are close to proto3's JSON mapping with the exception that internal types like Any are handled just like messages. More precisely: - * - * - Longs become strings - * - Enums become string keys - * - Bytes become base64 encoded strings - * - (Sub-)Messages become plain objects - * - Maps become plain objects with all string keys - * - Repeated fields become arrays - * - NaN and Infinity for float and double fields become strings - * - * @see https://developers.google.com/protocol-buffers/docs/proto3?hl=en#json - */ - let toJSONOptions: IConversionOptions; - - /** Node's fs module if available. */ - let fs: { [k: string]: any }; - - /** - * Converts an object's values to an array. - * @param object Object to convert - * @returns Converted array - */ - function toArray(object: { [k: string]: any }): any[]; - - /** - * Converts an array of keys immediately followed by their respective value to an object, omitting undefined values. - * @param array Array to convert - * @returns Converted object - */ - function toObject(array: any[]): { [k: string]: any }; - - /** - * Tests whether the specified name is a reserved word in JS. - * @param name Name to test - * @returns `true` if reserved, otherwise `false` - */ - function isReserved(name: string): boolean; - - /** - * Returns a safe property accessor for the specified property name. - * @param prop Property name - * @returns Safe accessor - */ - function safeProp(prop: string): string; - - /** - * Converts the first character of a string to upper case. - * @param str String to convert - * @returns Converted string - */ - function ucFirst(str: string): string; - - /** - * Converts a string to camel case. - * @param str String to convert - * @returns Converted string - */ - function camelCase(str: string): string; - - /** - * Compares reflected fields by id. - * @param a First field - * @param b Second field - * @returns Comparison value - */ - function compareFieldsById(a: Field, b: Field): number; - - /** - * Decorator helper for types (TypeScript). - * @param ctor Constructor function - * @param [typeName] Type name, defaults to the constructor's name - * @returns Reflected type - */ - function decorateType>(ctor: Constructor, typeName?: string): Type; - - /** - * Decorator helper for enums (TypeScript). - * @param object Enum object - * @returns Reflected enum - */ - function decorateEnum(object: object): Enum; - - /** - * Sets the value of a property by property path. If a value already exists, it is turned to an array - * @param dst Destination object - * @param path dot '.' delimited path of the property to set - * @param value the value to set - * @returns Destination object - */ - function setProperty(dst: { [k: string]: any }, path: string, value: object): { [k: string]: any }; - - /** Decorator root (TypeScript). */ - let decorateRoot: Root; - - /** - * Returns a promise from a node-style callback function. - * @param fn Function to call - * @param ctx Function context - * @param params Function arguments - * @returns Promisified function - */ - function asPromise(fn: asPromiseCallback, ctx: any, ...params: any[]): Promise; - - /** A minimal base64 implementation for number arrays. */ - namespace base64 { - - /** - * Calculates the byte length of a base64 encoded string. - * @param string Base64 encoded string - * @returns Byte length - */ - function length(string: string): number; - - /** - * Encodes a buffer to a base64 encoded string. - * @param buffer Source buffer - * @param start Source start - * @param end Source end - * @returns Base64 encoded string - */ - function encode(buffer: Uint8Array, start: number, end: number): string; - - /** - * Decodes a base64 encoded string to a buffer. - * @param string Source string - * @param buffer Destination buffer - * @param offset Destination offset - * @returns Number of bytes written - * @throws {Error} If encoding is invalid - */ - function decode(string: string, buffer: Uint8Array, offset: number): number; - - /** - * Tests if the specified string appears to be base64 encoded. - * @param string String to test - * @returns `true` if probably base64 encoded, otherwise false - */ - function test(string: string): boolean; - } - - /** - * Begins generating a function. - * @param functionParams Function parameter names - * @param [functionName] Function name if not anonymous - * @returns Appender that appends code to the function's body - */ - function codegen(functionParams: string[], functionName?: string): Codegen; - - namespace codegen { - - /** When set to `true`, codegen will log generated code to console. Useful for debugging. */ - let verbose: boolean; - } - - /** - * Begins generating a function. - * @param [functionName] Function name if not anonymous - * @returns Appender that appends code to the function's body - */ - function codegen(functionName?: string): Codegen; - - /** A minimal event emitter. */ - class EventEmitter { - - /** Constructs a new event emitter instance. */ - constructor(); - - /** - * Registers an event listener. - * @param evt Event name - * @param fn Listener - * @param [ctx] Listener context - * @returns `this` - */ - public on(evt: string, fn: EventEmitterListener, ctx?: any): this; - - /** - * Removes an event listener or any matching listeners if arguments are omitted. - * @param [evt] Event name. Removes all listeners if omitted. - * @param [fn] Listener to remove. Removes all listeners of `evt` if omitted. - * @returns `this` - */ - public off(evt?: string, fn?: EventEmitterListener): this; - - /** - * Emits an event by calling its listeners with the specified arguments. - * @param evt Event name - * @param args Arguments - * @returns `this` - */ - public emit(evt: string, ...args: any[]): this; - } - - /** Reads / writes floats / doubles from / to buffers. */ - namespace float { - - /** - * Writes a 32 bit float to a buffer using little endian byte order. - * @param val Value to write - * @param buf Target buffer - * @param pos Target buffer offset - */ - function writeFloatLE(val: number, buf: Uint8Array, pos: number): void; - - /** - * Writes a 32 bit float to a buffer using big endian byte order. - * @param val Value to write - * @param buf Target buffer - * @param pos Target buffer offset - */ - function writeFloatBE(val: number, buf: Uint8Array, pos: number): void; - - /** - * Reads a 32 bit float from a buffer using little endian byte order. - * @param buf Source buffer - * @param pos Source buffer offset - * @returns Value read - */ - function readFloatLE(buf: Uint8Array, pos: number): number; - - /** - * Reads a 32 bit float from a buffer using big endian byte order. - * @param buf Source buffer - * @param pos Source buffer offset - * @returns Value read - */ - function readFloatBE(buf: Uint8Array, pos: number): number; - - /** - * Writes a 64 bit double to a buffer using little endian byte order. - * @param val Value to write - * @param buf Target buffer - * @param pos Target buffer offset - */ - function writeDoubleLE(val: number, buf: Uint8Array, pos: number): void; - - /** - * Writes a 64 bit double to a buffer using big endian byte order. - * @param val Value to write - * @param buf Target buffer - * @param pos Target buffer offset - */ - function writeDoubleBE(val: number, buf: Uint8Array, pos: number): void; - - /** - * Reads a 64 bit double from a buffer using little endian byte order. - * @param buf Source buffer - * @param pos Source buffer offset - * @returns Value read - */ - function readDoubleLE(buf: Uint8Array, pos: number): number; - - /** - * Reads a 64 bit double from a buffer using big endian byte order. - * @param buf Source buffer - * @param pos Source buffer offset - * @returns Value read - */ - function readDoubleBE(buf: Uint8Array, pos: number): number; - } - - /** - * Fetches the contents of a file. - * @param filename File path or url - * @param options Fetch options - * @param callback Callback function - */ - function fetch(filename: string, options: IFetchOptions, callback: FetchCallback): void; - - /** - * Fetches the contents of a file. - * @param path File path or url - * @param callback Callback function - */ - function fetch(path: string, callback: FetchCallback): void; - - /** - * Fetches the contents of a file. - * @param path File path or url - * @param [options] Fetch options - * @returns Promise - */ - function fetch(path: string, options?: IFetchOptions): Promise<(string|Uint8Array)>; - - /** - * Requires a module only if available. - * @param moduleName Module to require - * @returns Required module if available and not empty, otherwise `null` - */ - function inquire(moduleName: string): object; - - /** A minimal path module to resolve Unix, Windows and URL paths alike. */ - namespace path { - - /** - * Tests if the specified path is absolute. - * @param path Path to test - * @returns `true` if path is absolute - */ - function isAbsolute(path: string): boolean; - - /** - * Normalizes the specified path. - * @param path Path to normalize - * @returns Normalized path - */ - function normalize(path: string): string; - - /** - * Resolves the specified include path against the specified origin path. - * @param originPath Path to the origin file - * @param includePath Include path relative to origin path - * @param [alreadyNormalized=false] `true` if both paths are already known to be normalized - * @returns Path to the include file - */ - function resolve(originPath: string, includePath: string, alreadyNormalized?: boolean): string; - } - - /** - * A general purpose buffer pool. - * @param alloc Allocator - * @param slice Slicer - * @param [size=8192] Slab size - * @returns Pooled allocator - */ - function pool(alloc: PoolAllocator, slice: PoolSlicer, size?: number): PoolAllocator; - - /** A minimal UTF8 implementation for number arrays. */ - namespace utf8 { - - /** - * Calculates the UTF8 byte length of a string. - * @param string String - * @returns Byte length - */ - function length(string: string): number; - - /** - * Reads UTF8 bytes as a string. - * @param buffer Source buffer - * @param start Source start - * @param end Source end - * @returns String read - */ - function read(buffer: Uint8Array, start: number, end: number): string; - - /** - * Writes a string as UTF8 bytes. - * @param string Source string - * @param buffer Destination buffer - * @param offset Destination offset - * @returns Bytes written - */ - function write(string: string, buffer: Uint8Array, offset: number): number; - } -} - -/** - * Generates a verifier specific to the specified message type. - * @param mtype Message type - * @returns Codegen instance - */ -export function verifier(mtype: Type): Codegen; - -/** Wrappers for common types. */ -export const wrappers: { [k: string]: IWrapper }; - -/** - * From object converter part of an {@link IWrapper}. - * @param object Plain object - * @returns Message instance - */ -type WrapperFromObjectConverter = (this: Type, object: { [k: string]: any }) => Message<{}>; - -/** - * To object converter part of an {@link IWrapper}. - * @param message Message instance - * @param [options] Conversion options - * @returns Plain object - */ -type WrapperToObjectConverter = (this: Type, message: Message<{}>, options?: IConversionOptions) => { [k: string]: any }; - -/** Common type wrapper part of {@link wrappers}. */ -export interface IWrapper { - - /** From object converter */ - fromObject?: WrapperFromObjectConverter; - - /** To object converter */ - toObject?: WrapperToObjectConverter; -} - -/** Wire format writer using `Uint8Array` if available, otherwise `Array`. */ -export class Writer { - - /** Constructs a new writer instance. */ - constructor(); - - /** Current length. */ - public len: number; - - /** Operations head. */ - public head: object; - - /** Operations tail */ - public tail: object; - - /** Linked forked states. */ - public states: (object|null); - - /** - * Creates a new writer. - * @returns A {@link BufferWriter} when Buffers are supported, otherwise a {@link Writer} - */ - public static create(): (BufferWriter|Writer); - - /** - * Allocates a buffer of the specified size. - * @param size Buffer size - * @returns Buffer - */ - public static alloc(size: number): Uint8Array; - - /** - * Writes an unsigned 32 bit value as a varint. - * @param value Value to write - * @returns `this` - */ - public uint32(value: number): Writer; - - /** - * Writes a signed 32 bit value as a varint. - * @param value Value to write - * @returns `this` - */ - public int32(value: number): Writer; - - /** - * Writes a 32 bit value as a varint, zig-zag encoded. - * @param value Value to write - * @returns `this` - */ - public sint32(value: number): Writer; - - /** - * Writes an unsigned 64 bit value as a varint. - * @param value Value to write - * @returns `this` - * @throws {TypeError} If `value` is a string and no long library is present. - */ - public uint64(value: (Long|number|string)): Writer; - - /** - * Writes a signed 64 bit value as a varint. - * @param value Value to write - * @returns `this` - * @throws {TypeError} If `value` is a string and no long library is present. - */ - public int64(value: (Long|number|string)): Writer; - - /** - * Writes a signed 64 bit value as a varint, zig-zag encoded. - * @param value Value to write - * @returns `this` - * @throws {TypeError} If `value` is a string and no long library is present. - */ - public sint64(value: (Long|number|string)): Writer; - - /** - * Writes a boolish value as a varint. - * @param value Value to write - * @returns `this` - */ - public bool(value: boolean): Writer; - - /** - * Writes an unsigned 32 bit value as fixed 32 bits. - * @param value Value to write - * @returns `this` - */ - public fixed32(value: number): Writer; - - /** - * Writes a signed 32 bit value as fixed 32 bits. - * @param value Value to write - * @returns `this` - */ - public sfixed32(value: number): Writer; - - /** - * Writes an unsigned 64 bit value as fixed 64 bits. - * @param value Value to write - * @returns `this` - * @throws {TypeError} If `value` is a string and no long library is present. - */ - public fixed64(value: (Long|number|string)): Writer; - - /** - * Writes a signed 64 bit value as fixed 64 bits. - * @param value Value to write - * @returns `this` - * @throws {TypeError} If `value` is a string and no long library is present. - */ - public sfixed64(value: (Long|number|string)): Writer; - - /** - * Writes a float (32 bit). - * @param value Value to write - * @returns `this` - */ - public float(value: number): Writer; - - /** - * Writes a double (64 bit float). - * @param value Value to write - * @returns `this` - */ - public double(value: number): Writer; - - /** - * Writes a sequence of bytes. - * @param value Buffer or base64 encoded string to write - * @returns `this` - */ - public bytes(value: (Uint8Array|string)): Writer; - - /** - * Writes a string. - * @param value Value to write - * @returns `this` - */ - public string(value: string): Writer; - - /** - * Forks this writer's state by pushing it to a stack. - * Calling {@link Writer#reset|reset} or {@link Writer#ldelim|ldelim} resets the writer to the previous state. - * @returns `this` - */ - public fork(): Writer; - - /** - * Resets this instance to the last state. - * @returns `this` - */ - public reset(): Writer; - - /** - * Resets to the last state and appends the fork state's current write length as a varint followed by its operations. - * @returns `this` - */ - public ldelim(): Writer; - - /** - * Finishes the write operation. - * @returns Finished buffer - */ - public finish(): Uint8Array; -} - -/** Wire format writer using node buffers. */ -export class BufferWriter extends Writer { - - /** Constructs a new buffer writer instance. */ - constructor(); - - /** - * Allocates a buffer of the specified size. - * @param size Buffer size - * @returns Buffer - */ - public static alloc(size: number): Buffer; - - /** - * Finishes the write operation. - * @returns Finished buffer - */ - public finish(): Buffer; -} - -/** - * Callback as used by {@link util.asPromise}. - * @param error Error, if any - * @param params Additional arguments - */ -type asPromiseCallback = (error: (Error|null), ...params: any[]) => void; - -/** - * Appends code to the function's body or finishes generation. - * @param [formatStringOrScope] Format string or, to finish the function, an object of additional scope variables, if any - * @param [formatParams] Format parameters - * @returns Itself or the generated function if finished - * @throws {Error} If format parameter counts do not match - */ -type Codegen = (formatStringOrScope?: (string|{ [k: string]: any }), ...formatParams: any[]) => (Codegen|Function); - -/** - * Event listener as used by {@link util.EventEmitter}. - * @param args Arguments - */ -type EventEmitterListener = (...args: any[]) => void; - -/** - * Node-style callback as used by {@link util.fetch}. - * @param error Error, if any, otherwise `null` - * @param [contents] File contents, if there hasn't been an error - */ -type FetchCallback = (error: Error, contents?: string) => void; - -/** Options as used by {@link util.fetch}. */ -export interface IFetchOptions { - - /** Whether expecting a binary response */ - binary?: boolean; - - /** If `true`, forces the use of XMLHttpRequest */ - xhr?: boolean; -} - -/** - * An allocator as used by {@link util.pool}. - * @param size Buffer size - * @returns Buffer - */ -type PoolAllocator = (size: number) => Uint8Array; - -/** - * A slicer as used by {@link util.pool}. - * @param start Start offset - * @param end End offset - * @returns Buffer slice - */ -type PoolSlicer = (this: Uint8Array, start: number, end: number) => Uint8Array; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/index.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/index.js deleted file mode 100644 index 042042ae..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/index.js +++ /dev/null @@ -1,4 +0,0 @@ -// full library entry point. - -"use strict"; -module.exports = require("./src/index"); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/light.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/light.d.ts deleted file mode 100644 index d83e7f99..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/light.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export as namespace protobuf; -export * from "./index"; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/light.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/light.js deleted file mode 100644 index 1209e64c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/light.js +++ /dev/null @@ -1,4 +0,0 @@ -// light library entry point. - -"use strict"; -module.exports = require("./src/index-light"); \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/minimal.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/minimal.d.ts deleted file mode 100644 index d83e7f99..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/minimal.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export as namespace protobuf; -export * from "./index"; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/minimal.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/minimal.js deleted file mode 100644 index 1f35ec99..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/minimal.js +++ /dev/null @@ -1,4 +0,0 @@ -// minimal library entry point. - -"use strict"; -module.exports = require("./src/index-minimal"); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/node_modules/long/LICENSE b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/node_modules/long/LICENSE deleted file mode 100644 index d6456956..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/node_modules/long/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/node_modules/long/README.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/node_modules/long/README.md deleted file mode 100644 index ab168f1c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/node_modules/long/README.md +++ /dev/null @@ -1,280 +0,0 @@ -long.js -======= - -A Long class for representing a 64 bit two's-complement integer value derived from the [Closure Library](https://github.com/google/closure-library) -for stand-alone use and extended with unsigned support. - -[![Build Status](https://img.shields.io/github/workflow/status/dcodeIO/long.js/Test/main?label=test&logo=github)](https://github.com/dcodeIO/long.js/actions?query=workflow%3ATest) [![Publish Status](https://img.shields.io/github/workflow/status/dcodeIO/long.js/Publish/main?label=publish&logo=github)](https://github.com/dcodeIO/long.js/actions?query=workflow%3APublish) [![npm](https://img.shields.io/npm/v/long.svg?label=npm&color=007acc&logo=npm)](https://www.npmjs.com/package/long) - -Background ----------- - -As of [ECMA-262 5th Edition](http://ecma262-5.com/ELS5_HTML.htm#Section_8.5), "all the positive and negative integers -whose magnitude is no greater than 253 are representable in the Number type", which is "representing the -doubleprecision 64-bit format IEEE 754 values as specified in the IEEE Standard for Binary Floating-Point Arithmetic". -The [maximum safe integer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER) -in JavaScript is 253-1. - -Example: 264-1 is 1844674407370955**1615** but in JavaScript it evaluates to 1844674407370955**2000**. - -Furthermore, bitwise operators in JavaScript "deal only with integers in the range −231 through -231−1, inclusive, or in the range 0 through 232−1, inclusive. These operators accept any value of -the Number type but first convert each such value to one of 232 integer values." - -In some use cases, however, it is required to be able to reliably work with and perform bitwise operations on the full -64 bits. This is where long.js comes into play. - -Usage ------ - -The package exports an ECMAScript module with an UMD fallback. - -``` -$> npm install long -``` - -```js -import Long from "long"; - -var value = new Long(0xFFFFFFFF, 0x7FFFFFFF); -console.log(value.toString()); -... -``` - -Note that mixing ESM and CommonJS is not recommended as it yields different classes, albeit with the same functionality. - -### Usage with a CDN - - * From GitHub via [jsDelivr](https://www.jsdelivr.com):
    - `https://cdn.jsdelivr.net/gh/dcodeIO/long.js@TAG/index.js` (ESM) - * From npm via [jsDelivr](https://www.jsdelivr.com):
    - `https://cdn.jsdelivr.net/npm/long@VERSION/index.js` (ESM)
    - `https://cdn.jsdelivr.net/npm/long@VERSION/umd/index.js` (UMD) - * From npm via [unpkg](https://unpkg.com):
    - `https://unpkg.com/long@VERSION/index.js` (ESM)
    - `https://unpkg.com/long@VERSION/umd/index.js` (UMD) - - Replace `TAG` respectively `VERSION` with a [specific version](https://github.com/dcodeIO/long.js/releases) or omit it (not recommended in production) to use main/latest. - -API ---- - -### Constructor - -* new **Long**(low: `number`, high?: `number`, unsigned?: `boolean`)
    - Constructs a 64 bit two's-complement integer, given its low and high 32 bit values as *signed* integers. See the from* functions below for more convenient ways of constructing Longs. - -### Fields - -* Long#**low**: `number`
    - The low 32 bits as a signed value. - -* Long#**high**: `number`
    - The high 32 bits as a signed value. - -* Long#**unsigned**: `boolean`
    - Whether unsigned or not. - -### Constants - -* Long.**ZERO**: `Long`
    - Signed zero. - -* Long.**ONE**: `Long`
    - Signed one. - -* Long.**NEG_ONE**: `Long`
    - Signed negative one. - -* Long.**UZERO**: `Long`
    - Unsigned zero. - -* Long.**UONE**: `Long`
    - Unsigned one. - -* Long.**MAX_VALUE**: `Long`
    - Maximum signed value. - -* Long.**MIN_VALUE**: `Long`
    - Minimum signed value. - -* Long.**MAX_UNSIGNED_VALUE**: `Long`
    - Maximum unsigned value. - -### Utility - -* Long.**isLong**(obj: `*`): `boolean`
    - Tests if the specified object is a Long. - -* Long.**fromBits**(lowBits: `number`, highBits: `number`, unsigned?: `boolean`): `Long`
    - Returns a Long representing the 64 bit integer that comes by concatenating the given low and high bits. Each is assumed to use 32 bits. - -* Long.**fromBytes**(bytes: `number[]`, unsigned?: `boolean`, le?: `boolean`): `Long`
    - Creates a Long from its byte representation. - -* Long.**fromBytesLE**(bytes: `number[]`, unsigned?: `boolean`): `Long`
    - Creates a Long from its little endian byte representation. - -* Long.**fromBytesBE**(bytes: `number[]`, unsigned?: `boolean`): `Long`
    - Creates a Long from its big endian byte representation. - -* Long.**fromInt**(value: `number`, unsigned?: `boolean`): `Long`
    - Returns a Long representing the given 32 bit integer value. - -* Long.**fromNumber**(value: `number`, unsigned?: `boolean`): `Long`
    - Returns a Long representing the given value, provided that it is a finite number. Otherwise, zero is returned. - -* Long.**fromString**(str: `string`, unsigned?: `boolean`, radix?: `number`)
    - Long.**fromString**(str: `string`, radix: `number`)
    - Returns a Long representation of the given string, written using the specified radix. - -* Long.**fromValue**(val: `*`, unsigned?: `boolean`): `Long`
    - Converts the specified value to a Long using the appropriate from* function for its type. - -### Methods - -* Long#**add**(addend: `Long | number | string`): `Long`
    - Returns the sum of this and the specified Long. - -* Long#**and**(other: `Long | number | string`): `Long`
    - Returns the bitwise AND of this Long and the specified. - -* Long#**compare**/**comp**(other: `Long | number | string`): `number`
    - Compares this Long's value with the specified's. Returns `0` if they are the same, `1` if the this is greater and `-1` if the given one is greater. - -* Long#**divide**/**div**(divisor: `Long | number | string`): `Long`
    - Returns this Long divided by the specified. - -* Long#**equals**/**eq**(other: `Long | number | string`): `boolean`
    - Tests if this Long's value equals the specified's. - -* Long#**getHighBits**(): `number`
    - Gets the high 32 bits as a signed integer. - -* Long#**getHighBitsUnsigned**(): `number`
    - Gets the high 32 bits as an unsigned integer. - -* Long#**getLowBits**(): `number`
    - Gets the low 32 bits as a signed integer. - -* Long#**getLowBitsUnsigned**(): `number`
    - Gets the low 32 bits as an unsigned integer. - -* Long#**getNumBitsAbs**(): `number`
    - Gets the number of bits needed to represent the absolute value of this Long. - -* Long#**greaterThan**/**gt**(other: `Long | number | string`): `boolean`
    - Tests if this Long's value is greater than the specified's. - -* Long#**greaterThanOrEqual**/**gte**/**ge**(other: `Long | number | string`): `boolean`
    - Tests if this Long's value is greater than or equal the specified's. - -* Long#**isEven**(): `boolean`
    - Tests if this Long's value is even. - -* Long#**isNegative**(): `boolean`
    - Tests if this Long's value is negative. - -* Long#**isOdd**(): `boolean`
    - Tests if this Long's value is odd. - -* Long#**isPositive**(): `boolean`
    - Tests if this Long's value is positive or zero. - -* Long#**isZero**/**eqz**(): `boolean`
    - Tests if this Long's value equals zero. - -* Long#**lessThan**/**lt**(other: `Long | number | string`): `boolean`
    - Tests if this Long's value is less than the specified's. - -* Long#**lessThanOrEqual**/**lte**/**le**(other: `Long | number | string`): `boolean`
    - Tests if this Long's value is less than or equal the specified's. - -* Long#**modulo**/**mod**/**rem**(divisor: `Long | number | string`): `Long`
    - Returns this Long modulo the specified. - -* Long#**multiply**/**mul**(multiplier: `Long | number | string`): `Long`
    - Returns the product of this and the specified Long. - -* Long#**negate**/**neg**(): `Long`
    - Negates this Long's value. - -* Long#**not**(): `Long`
    - Returns the bitwise NOT of this Long. - -* Long#**countLeadingZeros**/**clz**(): `number`
    - Returns count leading zeros of this Long. - -* Long#**countTrailingZeros**/**ctz**(): `number`
    - Returns count trailing zeros of this Long. - -* Long#**notEquals**/**neq**/**ne**(other: `Long | number | string`): `boolean`
    - Tests if this Long's value differs from the specified's. - -* Long#**or**(other: `Long | number | string`): `Long`
    - Returns the bitwise OR of this Long and the specified. - -* Long#**shiftLeft**/**shl**(numBits: `Long | number | string`): `Long`
    - Returns this Long with bits shifted to the left by the given amount. - -* Long#**shiftRight**/**shr**(numBits: `Long | number | string`): `Long`
    - Returns this Long with bits arithmetically shifted to the right by the given amount. - -* Long#**shiftRightUnsigned**/**shru**/**shr_u**(numBits: `Long | number | string`): `Long`
    - Returns this Long with bits logically shifted to the right by the given amount. - -* Long#**rotateLeft**/**rotl**(numBits: `Long | number | string`): `Long`
    - Returns this Long with bits rotated to the left by the given amount. - -* Long#**rotateRight**/**rotr**(numBits: `Long | number | string`): `Long`
    - Returns this Long with bits rotated to the right by the given amount. - -* Long#**subtract**/**sub**(subtrahend: `Long | number | string`): `Long`
    - Returns the difference of this and the specified Long. - -* Long#**toBytes**(le?: `boolean`): `number[]`
    - Converts this Long to its byte representation. - -* Long#**toBytesLE**(): `number[]`
    - Converts this Long to its little endian byte representation. - -* Long#**toBytesBE**(): `number[]`
    - Converts this Long to its big endian byte representation. - -* Long#**toInt**(): `number`
    - Converts the Long to a 32 bit integer, assuming it is a 32 bit integer. - -* Long#**toNumber**(): `number`
    - Converts the Long to a the nearest floating-point representation of this value (double, 53 bit mantissa). - -* Long#**toSigned**(): `Long`
    - Converts this Long to signed. - -* Long#**toString**(radix?: `number`): `string`
    - Converts the Long to a string written in the specified radix. - -* Long#**toUnsigned**(): `Long`
    - Converts this Long to unsigned. - -* Long#**xor**(other: `Long | number | string`): `Long`
    - Returns the bitwise XOR of this Long and the given one. - -WebAssembly support -------------------- - -[WebAssembly](http://webassembly.org) supports 64-bit integer arithmetic out of the box, hence a [tiny WebAssembly module](./wasm.wat) is used to compute operations like multiplication, division and remainder more efficiently (slow operations like division are around twice as fast), falling back to floating point based computations in JavaScript where WebAssembly is not yet supported, e.g., in older versions of node. - -Building --------- - -Building the UMD fallback: - -``` -$> npm run build -``` - -Running the [tests](./tests): - -``` -$> npm test -``` diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/node_modules/long/index.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/node_modules/long/index.d.ts deleted file mode 100644 index 5472d8ed..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/node_modules/long/index.d.ts +++ /dev/null @@ -1,446 +0,0 @@ -declare class Long { - /** - * Constructs a 64 bit two's-complement integer, given its low and high 32 bit values as signed integers. See the from* functions below for more convenient ways of constructing Longs. - */ - constructor(low: number, high?: number, unsigned?: boolean); - - /** - * Maximum unsigned value. - */ - static MAX_UNSIGNED_VALUE: Long; - - /** - * Maximum signed value. - */ - static MAX_VALUE: Long; - - /** - * Minimum signed value. - */ - static MIN_VALUE: Long; - - /** - * Signed negative one. - */ - static NEG_ONE: Long; - - /** - * Signed one. - */ - static ONE: Long; - - /** - * Unsigned one. - */ - static UONE: Long; - - /** - * Unsigned zero. - */ - static UZERO: Long; - - /** - * Signed zero - */ - static ZERO: Long; - - /** - * The high 32 bits as a signed value. - */ - high: number; - - /** - * The low 32 bits as a signed value. - */ - low: number; - - /** - * Whether unsigned or not. - */ - unsigned: boolean; - - /** - * Returns a Long representing the 64 bit integer that comes by concatenating the given low and high bits. Each is assumed to use 32 bits. - */ - static fromBits(lowBits: number, highBits: number, unsigned?: boolean): Long; - - /** - * Returns a Long representing the given 32 bit integer value. - */ - static fromInt(value: number, unsigned?: boolean): Long; - - /** - * Returns a Long representing the given value, provided that it is a finite number. Otherwise, zero is returned. - */ - static fromNumber(value: number, unsigned?: boolean): Long; - - /** - * Returns a Long representation of the given string, written using the specified radix. - */ - static fromString(str: string, unsigned?: boolean | number, radix?: number): Long; - - /** - * Creates a Long from its byte representation. - */ - static fromBytes(bytes: number[], unsigned?: boolean, le?: boolean): Long; - - /** - * Creates a Long from its little endian byte representation. - */ - static fromBytesLE(bytes: number[], unsigned?: boolean): Long; - - /** - * Creates a Long from its big endian byte representation. - */ - static fromBytesBE(bytes: number[], unsigned?: boolean): Long; - - /** - * Tests if the specified object is a Long. - */ - static isLong(obj: any): obj is Long; - - /** - * Converts the specified value to a Long. - */ - static fromValue(val: Long | number | string | { low: number, high: number, unsigned: boolean }, unsigned?: boolean): Long; - - /** - * Returns the sum of this and the specified Long. - */ - add(addend: number | Long | string): Long; - - /** - * Returns the bitwise AND of this Long and the specified. - */ - and(other: Long | number | string): Long; - - /** - * Compares this Long's value with the specified's. - */ - compare(other: Long | number | string): number; - - /** - * Compares this Long's value with the specified's. - */ - comp(other: Long | number | string): number; - - /** - * Returns this Long divided by the specified. - */ - divide(divisor: Long | number | string): Long; - - /** - * Returns this Long divided by the specified. - */ - div(divisor: Long | number | string): Long; - - /** - * Tests if this Long's value equals the specified's. - */ - equals(other: Long | number | string): boolean; - - /** - * Tests if this Long's value equals the specified's. - */ - eq(other: Long | number | string): boolean; - - /** - * Gets the high 32 bits as a signed integer. - */ - getHighBits(): number; - - /** - * Gets the high 32 bits as an unsigned integer. - */ - getHighBitsUnsigned(): number; - - /** - * Gets the low 32 bits as a signed integer. - */ - getLowBits(): number; - - /** - * Gets the low 32 bits as an unsigned integer. - */ - getLowBitsUnsigned(): number; - - /** - * Gets the number of bits needed to represent the absolute value of this Long. - */ - getNumBitsAbs(): number; - - /** - * Tests if this Long's value is greater than the specified's. - */ - greaterThan(other: Long | number | string): boolean; - - /** - * Tests if this Long's value is greater than the specified's. - */ - gt(other: Long | number | string): boolean; - - /** - * Tests if this Long's value is greater than or equal the specified's. - */ - greaterThanOrEqual(other: Long | number | string): boolean; - - /** - * Tests if this Long's value is greater than or equal the specified's. - */ - gte(other: Long | number | string): boolean; - - /** - * Tests if this Long's value is greater than or equal the specified's. - */ - ge(other: Long | number | string): boolean; - - /** - * Tests if this Long's value is even. - */ - isEven(): boolean; - - /** - * Tests if this Long's value is negative. - */ - isNegative(): boolean; - - /** - * Tests if this Long's value is odd. - */ - isOdd(): boolean; - - /** - * Tests if this Long's value is positive or zero. - */ - isPositive(): boolean; - - /** - * Tests if this Long's value equals zero. - */ - isZero(): boolean; - - /** - * Tests if this Long's value equals zero. - */ - eqz(): boolean; - - /** - * Tests if this Long's value is less than the specified's. - */ - lessThan(other: Long | number | string): boolean; - - /** - * Tests if this Long's value is less than the specified's. - */ - lt(other: Long | number | string): boolean; - - /** - * Tests if this Long's value is less than or equal the specified's. - */ - lessThanOrEqual(other: Long | number | string): boolean; - - /** - * Tests if this Long's value is less than or equal the specified's. - */ - lte(other: Long | number | string): boolean; - - /** - * Tests if this Long's value is less than or equal the specified's. - */ - le(other: Long | number | string): boolean; - - /** - * Returns this Long modulo the specified. - */ - modulo(other: Long | number | string): Long; - - /** - * Returns this Long modulo the specified. - */ - mod(other: Long | number | string): Long; - - /** - * Returns this Long modulo the specified. - */ - rem(other: Long | number | string): Long; - - /** - * Returns the product of this and the specified Long. - */ - multiply(multiplier: Long | number | string): Long; - - /** - * Returns the product of this and the specified Long. - */ - mul(multiplier: Long | number | string): Long; - - /** - * Negates this Long's value. - */ - negate(): Long; - - /** - * Negates this Long's value. - */ - neg(): Long; - - /** - * Returns the bitwise NOT of this Long. - */ - not(): Long; - - /** - * Returns count leading zeros of this Long. - */ - countLeadingZeros(): number; - - /** - * Returns count leading zeros of this Long. - */ - clz(): number; - - /** - * Returns count trailing zeros of this Long. - */ - countTrailingZeros(): number; - - /** - * Returns count trailing zeros of this Long. - */ - ctz(): number; - - /** - * Tests if this Long's value differs from the specified's. - */ - notEquals(other: Long | number | string): boolean; - - /** - * Tests if this Long's value differs from the specified's. - */ - neq(other: Long | number | string): boolean; - - /** - * Tests if this Long's value differs from the specified's. - */ - ne(other: Long | number | string): boolean; - - /** - * Returns the bitwise OR of this Long and the specified. - */ - or(other: Long | number | string): Long; - - /** - * Returns this Long with bits shifted to the left by the given amount. - */ - shiftLeft(numBits: number | Long): Long; - - /** - * Returns this Long with bits shifted to the left by the given amount. - */ - shl(numBits: number | Long): Long; - - /** - * Returns this Long with bits arithmetically shifted to the right by the given amount. - */ - shiftRight(numBits: number | Long): Long; - - /** - * Returns this Long with bits arithmetically shifted to the right by the given amount. - */ - shr(numBits: number | Long): Long; - - /** - * Returns this Long with bits logically shifted to the right by the given amount. - */ - shiftRightUnsigned(numBits: number | Long): Long; - - /** - * Returns this Long with bits logically shifted to the right by the given amount. - */ - shru(numBits: number | Long): Long; - - /** - * Returns this Long with bits logically shifted to the right by the given amount. - */ - shr_u(numBits: number | Long): Long; - - /** - * Returns this Long with bits rotated to the left by the given amount. - */ - rotateLeft(numBits: number | Long): Long; - - /** - * Returns this Long with bits rotated to the left by the given amount. - */ - rotl(numBits: number | Long): Long; - - /** - * Returns this Long with bits rotated to the right by the given amount. - */ - rotateRight(numBits: number | Long): Long; - - /** - * Returns this Long with bits rotated to the right by the given amount. - */ - rotr(numBits: number | Long): Long; - - /** - * Returns the difference of this and the specified Long. - */ - subtract(subtrahend: number | Long | string): Long; - - /** - * Returns the difference of this and the specified Long. - */ - sub(subtrahend: number | Long | string): Long; - - /** - * Converts the Long to a 32 bit integer, assuming it is a 32 bit integer. - */ - toInt(): number; - - /** - * Converts the Long to a the nearest floating-point representation of this value (double, 53 bit mantissa). - */ - toNumber(): number; - - /** - * Converts this Long to its byte representation. - */ - - toBytes(le?: boolean): number[]; - - /** - * Converts this Long to its little endian byte representation. - */ - - toBytesLE(): number[]; - - /** - * Converts this Long to its big endian byte representation. - */ - - toBytesBE(): number[]; - - /** - * Converts this Long to signed. - */ - toSigned(): Long; - - /** - * Converts the Long to a string written in the specified radix. - */ - toString(radix?: number): string; - - /** - * Converts this Long to unsigned. - */ - toUnsigned(): Long; - - /** - * Returns the bitwise XOR of this Long and the given one. - */ - xor(other: Long | number | string): Long; -} - -export = Long; // compatible with `import Long from "long"` diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/node_modules/long/index.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/node_modules/long/index.js deleted file mode 100644 index f04775e0..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/node_modules/long/index.js +++ /dev/null @@ -1,1467 +0,0 @@ -/** - * @license - * Copyright 2009 The Closure Library Authors - * Copyright 2020 Daniel Wirtz / The long.js Authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * SPDX-License-Identifier: Apache-2.0 - */ - -// WebAssembly optimizations to do native i64 multiplication and divide -var wasm = null; -try { - wasm = new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([ - 0, 97, 115, 109, 1, 0, 0, 0, 1, 13, 2, 96, 0, 1, 127, 96, 4, 127, 127, 127, 127, 1, 127, 3, 7, 6, 0, 1, 1, 1, 1, 1, 6, 6, 1, 127, 1, 65, 0, 11, 7, 50, 6, 3, 109, 117, 108, 0, 1, 5, 100, 105, 118, 95, 115, 0, 2, 5, 100, 105, 118, 95, 117, 0, 3, 5, 114, 101, 109, 95, 115, 0, 4, 5, 114, 101, 109, 95, 117, 0, 5, 8, 103, 101, 116, 95, 104, 105, 103, 104, 0, 0, 10, 191, 1, 6, 4, 0, 35, 0, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 126, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 127, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 128, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 129, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 130, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11 - ])), {}).exports; -} catch (e) { - // no wasm support :( -} - -/** - * Constructs a 64 bit two's-complement integer, given its low and high 32 bit values as *signed* integers. - * See the from* functions below for more convenient ways of constructing Longs. - * @exports Long - * @class A Long class for representing a 64 bit two's-complement integer value. - * @param {number} low The low (signed) 32 bits of the long - * @param {number} high The high (signed) 32 bits of the long - * @param {boolean=} unsigned Whether unsigned or not, defaults to signed - * @constructor - */ -function Long(low, high, unsigned) { - - /** - * The low 32 bits as a signed value. - * @type {number} - */ - this.low = low | 0; - - /** - * The high 32 bits as a signed value. - * @type {number} - */ - this.high = high | 0; - - /** - * Whether unsigned or not. - * @type {boolean} - */ - this.unsigned = !!unsigned; -} - -// The internal representation of a long is the two given signed, 32-bit values. -// We use 32-bit pieces because these are the size of integers on which -// Javascript performs bit-operations. For operations like addition and -// multiplication, we split each number into 16 bit pieces, which can easily be -// multiplied within Javascript's floating-point representation without overflow -// or change in sign. -// -// In the algorithms below, we frequently reduce the negative case to the -// positive case by negating the input(s) and then post-processing the result. -// Note that we must ALWAYS check specially whether those values are MIN_VALUE -// (-2^63) because -MIN_VALUE == MIN_VALUE (since 2^63 cannot be represented as -// a positive number, it overflows back into a negative). Not handling this -// case would often result in infinite recursion. -// -// Common constant values ZERO, ONE, NEG_ONE, etc. are defined below the from* -// methods on which they depend. - -/** - * An indicator used to reliably determine if an object is a Long or not. - * @type {boolean} - * @const - * @private - */ -Long.prototype.__isLong__; - -Object.defineProperty(Long.prototype, "__isLong__", { value: true }); - -/** - * @function - * @param {*} obj Object - * @returns {boolean} - * @inner - */ -function isLong(obj) { - return (obj && obj["__isLong__"]) === true; -} - -/** - * @function - * @param {*} value number - * @returns {number} - * @inner - */ -function ctz32(value) { - var c = Math.clz32(value & -value); - return value ? 31 - c : c; -} - -/** - * Tests if the specified object is a Long. - * @function - * @param {*} obj Object - * @returns {boolean} - */ -Long.isLong = isLong; - -/** - * A cache of the Long representations of small integer values. - * @type {!Object} - * @inner - */ -var INT_CACHE = {}; - -/** - * A cache of the Long representations of small unsigned integer values. - * @type {!Object} - * @inner - */ -var UINT_CACHE = {}; - -/** - * @param {number} value - * @param {boolean=} unsigned - * @returns {!Long} - * @inner - */ -function fromInt(value, unsigned) { - var obj, cachedObj, cache; - if (unsigned) { - value >>>= 0; - if (cache = (0 <= value && value < 256)) { - cachedObj = UINT_CACHE[value]; - if (cachedObj) - return cachedObj; - } - obj = fromBits(value, 0, true); - if (cache) - UINT_CACHE[value] = obj; - return obj; - } else { - value |= 0; - if (cache = (-128 <= value && value < 128)) { - cachedObj = INT_CACHE[value]; - if (cachedObj) - return cachedObj; - } - obj = fromBits(value, value < 0 ? -1 : 0, false); - if (cache) - INT_CACHE[value] = obj; - return obj; - } -} - -/** - * Returns a Long representing the given 32 bit integer value. - * @function - * @param {number} value The 32 bit integer in question - * @param {boolean=} unsigned Whether unsigned or not, defaults to signed - * @returns {!Long} The corresponding Long value - */ -Long.fromInt = fromInt; - -/** - * @param {number} value - * @param {boolean=} unsigned - * @returns {!Long} - * @inner - */ -function fromNumber(value, unsigned) { - if (isNaN(value)) - return unsigned ? UZERO : ZERO; - if (unsigned) { - if (value < 0) - return UZERO; - if (value >= TWO_PWR_64_DBL) - return MAX_UNSIGNED_VALUE; - } else { - if (value <= -TWO_PWR_63_DBL) - return MIN_VALUE; - if (value + 1 >= TWO_PWR_63_DBL) - return MAX_VALUE; - } - if (value < 0) - return fromNumber(-value, unsigned).neg(); - return fromBits((value % TWO_PWR_32_DBL) | 0, (value / TWO_PWR_32_DBL) | 0, unsigned); -} - -/** - * Returns a Long representing the given value, provided that it is a finite number. Otherwise, zero is returned. - * @function - * @param {number} value The number in question - * @param {boolean=} unsigned Whether unsigned or not, defaults to signed - * @returns {!Long} The corresponding Long value - */ -Long.fromNumber = fromNumber; - -/** - * @param {number} lowBits - * @param {number} highBits - * @param {boolean=} unsigned - * @returns {!Long} - * @inner - */ -function fromBits(lowBits, highBits, unsigned) { - return new Long(lowBits, highBits, unsigned); -} - -/** - * Returns a Long representing the 64 bit integer that comes by concatenating the given low and high bits. Each is - * assumed to use 32 bits. - * @function - * @param {number} lowBits The low 32 bits - * @param {number} highBits The high 32 bits - * @param {boolean=} unsigned Whether unsigned or not, defaults to signed - * @returns {!Long} The corresponding Long value - */ -Long.fromBits = fromBits; - -/** - * @function - * @param {number} base - * @param {number} exponent - * @returns {number} - * @inner - */ -var pow_dbl = Math.pow; // Used 4 times (4*8 to 15+4) - -/** - * @param {string} str - * @param {(boolean|number)=} unsigned - * @param {number=} radix - * @returns {!Long} - * @inner - */ -function fromString(str, unsigned, radix) { - if (str.length === 0) - throw Error('empty string'); - if (typeof unsigned === 'number') { - // For goog.math.long compatibility - radix = unsigned; - unsigned = false; - } else { - unsigned = !!unsigned; - } - if (str === "NaN" || str === "Infinity" || str === "+Infinity" || str === "-Infinity") - return unsigned ? UZERO : ZERO; - radix = radix || 10; - if (radix < 2 || 36 < radix) - throw RangeError('radix'); - - var p; - if ((p = str.indexOf('-')) > 0) - throw Error('interior hyphen'); - else if (p === 0) { - return fromString(str.substring(1), unsigned, radix).neg(); - } - - // Do several (8) digits each time through the loop, so as to - // minimize the calls to the very expensive emulated div. - var radixToPower = fromNumber(pow_dbl(radix, 8)); - - var result = ZERO; - for (var i = 0; i < str.length; i += 8) { - var size = Math.min(8, str.length - i), - value = parseInt(str.substring(i, i + size), radix); - if (size < 8) { - var power = fromNumber(pow_dbl(radix, size)); - result = result.mul(power).add(fromNumber(value)); - } else { - result = result.mul(radixToPower); - result = result.add(fromNumber(value)); - } - } - result.unsigned = unsigned; - return result; -} - -/** - * Returns a Long representation of the given string, written using the specified radix. - * @function - * @param {string} str The textual representation of the Long - * @param {(boolean|number)=} unsigned Whether unsigned or not, defaults to signed - * @param {number=} radix The radix in which the text is written (2-36), defaults to 10 - * @returns {!Long} The corresponding Long value - */ -Long.fromString = fromString; - -/** - * @function - * @param {!Long|number|string|!{low: number, high: number, unsigned: boolean}} val - * @param {boolean=} unsigned - * @returns {!Long} - * @inner - */ -function fromValue(val, unsigned) { - if (typeof val === 'number') - return fromNumber(val, unsigned); - if (typeof val === 'string') - return fromString(val, unsigned); - // Throws for non-objects, converts non-instanceof Long: - return fromBits(val.low, val.high, typeof unsigned === 'boolean' ? unsigned : val.unsigned); -} - -/** - * Converts the specified value to a Long using the appropriate from* function for its type. - * @function - * @param {!Long|number|string|!{low: number, high: number, unsigned: boolean}} val Value - * @param {boolean=} unsigned Whether unsigned or not, defaults to signed - * @returns {!Long} - */ -Long.fromValue = fromValue; - -// NOTE: the compiler should inline these constant values below and then remove these variables, so there should be -// no runtime penalty for these. - -/** - * @type {number} - * @const - * @inner - */ -var TWO_PWR_16_DBL = 1 << 16; - -/** - * @type {number} - * @const - * @inner - */ -var TWO_PWR_24_DBL = 1 << 24; - -/** - * @type {number} - * @const - * @inner - */ -var TWO_PWR_32_DBL = TWO_PWR_16_DBL * TWO_PWR_16_DBL; - -/** - * @type {number} - * @const - * @inner - */ -var TWO_PWR_64_DBL = TWO_PWR_32_DBL * TWO_PWR_32_DBL; - -/** - * @type {number} - * @const - * @inner - */ -var TWO_PWR_63_DBL = TWO_PWR_64_DBL / 2; - -/** - * @type {!Long} - * @const - * @inner - */ -var TWO_PWR_24 = fromInt(TWO_PWR_24_DBL); - -/** - * @type {!Long} - * @inner - */ -var ZERO = fromInt(0); - -/** - * Signed zero. - * @type {!Long} - */ -Long.ZERO = ZERO; - -/** - * @type {!Long} - * @inner - */ -var UZERO = fromInt(0, true); - -/** - * Unsigned zero. - * @type {!Long} - */ -Long.UZERO = UZERO; - -/** - * @type {!Long} - * @inner - */ -var ONE = fromInt(1); - -/** - * Signed one. - * @type {!Long} - */ -Long.ONE = ONE; - -/** - * @type {!Long} - * @inner - */ -var UONE = fromInt(1, true); - -/** - * Unsigned one. - * @type {!Long} - */ -Long.UONE = UONE; - -/** - * @type {!Long} - * @inner - */ -var NEG_ONE = fromInt(-1); - -/** - * Signed negative one. - * @type {!Long} - */ -Long.NEG_ONE = NEG_ONE; - -/** - * @type {!Long} - * @inner - */ -var MAX_VALUE = fromBits(0xFFFFFFFF | 0, 0x7FFFFFFF | 0, false); - -/** - * Maximum signed value. - * @type {!Long} - */ -Long.MAX_VALUE = MAX_VALUE; - -/** - * @type {!Long} - * @inner - */ -var MAX_UNSIGNED_VALUE = fromBits(0xFFFFFFFF | 0, 0xFFFFFFFF | 0, true); - -/** - * Maximum unsigned value. - * @type {!Long} - */ -Long.MAX_UNSIGNED_VALUE = MAX_UNSIGNED_VALUE; - -/** - * @type {!Long} - * @inner - */ -var MIN_VALUE = fromBits(0, 0x80000000 | 0, false); - -/** - * Minimum signed value. - * @type {!Long} - */ -Long.MIN_VALUE = MIN_VALUE; - -/** - * @alias Long.prototype - * @inner - */ -var LongPrototype = Long.prototype; - -/** - * Converts the Long to a 32 bit integer, assuming it is a 32 bit integer. - * @this {!Long} - * @returns {number} - */ -LongPrototype.toInt = function toInt() { - return this.unsigned ? this.low >>> 0 : this.low; -}; - -/** - * Converts the Long to a the nearest floating-point representation of this value (double, 53 bit mantissa). - * @this {!Long} - * @returns {number} - */ -LongPrototype.toNumber = function toNumber() { - if (this.unsigned) - return ((this.high >>> 0) * TWO_PWR_32_DBL) + (this.low >>> 0); - return this.high * TWO_PWR_32_DBL + (this.low >>> 0); -}; - -/** - * Converts the Long to a string written in the specified radix. - * @this {!Long} - * @param {number=} radix Radix (2-36), defaults to 10 - * @returns {string} - * @override - * @throws {RangeError} If `radix` is out of range - */ -LongPrototype.toString = function toString(radix) { - radix = radix || 10; - if (radix < 2 || 36 < radix) - throw RangeError('radix'); - if (this.isZero()) - return '0'; - if (this.isNegative()) { // Unsigned Longs are never negative - if (this.eq(MIN_VALUE)) { - // We need to change the Long value before it can be negated, so we remove - // the bottom-most digit in this base and then recurse to do the rest. - var radixLong = fromNumber(radix), - div = this.div(radixLong), - rem1 = div.mul(radixLong).sub(this); - return div.toString(radix) + rem1.toInt().toString(radix); - } else - return '-' + this.neg().toString(radix); - } - - // Do several (6) digits each time through the loop, so as to - // minimize the calls to the very expensive emulated div. - var radixToPower = fromNumber(pow_dbl(radix, 6), this.unsigned), - rem = this; - var result = ''; - while (true) { - var remDiv = rem.div(radixToPower), - intval = rem.sub(remDiv.mul(radixToPower)).toInt() >>> 0, - digits = intval.toString(radix); - rem = remDiv; - if (rem.isZero()) - return digits + result; - else { - while (digits.length < 6) - digits = '0' + digits; - result = '' + digits + result; - } - } -}; - -/** - * Gets the high 32 bits as a signed integer. - * @this {!Long} - * @returns {number} Signed high bits - */ -LongPrototype.getHighBits = function getHighBits() { - return this.high; -}; - -/** - * Gets the high 32 bits as an unsigned integer. - * @this {!Long} - * @returns {number} Unsigned high bits - */ -LongPrototype.getHighBitsUnsigned = function getHighBitsUnsigned() { - return this.high >>> 0; -}; - -/** - * Gets the low 32 bits as a signed integer. - * @this {!Long} - * @returns {number} Signed low bits - */ -LongPrototype.getLowBits = function getLowBits() { - return this.low; -}; - -/** - * Gets the low 32 bits as an unsigned integer. - * @this {!Long} - * @returns {number} Unsigned low bits - */ -LongPrototype.getLowBitsUnsigned = function getLowBitsUnsigned() { - return this.low >>> 0; -}; - -/** - * Gets the number of bits needed to represent the absolute value of this Long. - * @this {!Long} - * @returns {number} - */ -LongPrototype.getNumBitsAbs = function getNumBitsAbs() { - if (this.isNegative()) // Unsigned Longs are never negative - return this.eq(MIN_VALUE) ? 64 : this.neg().getNumBitsAbs(); - var val = this.high != 0 ? this.high : this.low; - for (var bit = 31; bit > 0; bit--) - if ((val & (1 << bit)) != 0) - break; - return this.high != 0 ? bit + 33 : bit + 1; -}; - -/** - * Tests if this Long's value equals zero. - * @this {!Long} - * @returns {boolean} - */ -LongPrototype.isZero = function isZero() { - return this.high === 0 && this.low === 0; -}; - -/** - * Tests if this Long's value equals zero. This is an alias of {@link Long#isZero}. - * @returns {boolean} - */ -LongPrototype.eqz = LongPrototype.isZero; - -/** - * Tests if this Long's value is negative. - * @this {!Long} - * @returns {boolean} - */ -LongPrototype.isNegative = function isNegative() { - return !this.unsigned && this.high < 0; -}; - -/** - * Tests if this Long's value is positive or zero. - * @this {!Long} - * @returns {boolean} - */ -LongPrototype.isPositive = function isPositive() { - return this.unsigned || this.high >= 0; -}; - -/** - * Tests if this Long's value is odd. - * @this {!Long} - * @returns {boolean} - */ -LongPrototype.isOdd = function isOdd() { - return (this.low & 1) === 1; -}; - -/** - * Tests if this Long's value is even. - * @this {!Long} - * @returns {boolean} - */ -LongPrototype.isEven = function isEven() { - return (this.low & 1) === 0; -}; - -/** - * Tests if this Long's value equals the specified's. - * @this {!Long} - * @param {!Long|number|string} other Other value - * @returns {boolean} - */ -LongPrototype.equals = function equals(other) { - if (!isLong(other)) - other = fromValue(other); - if (this.unsigned !== other.unsigned && (this.high >>> 31) === 1 && (other.high >>> 31) === 1) - return false; - return this.high === other.high && this.low === other.low; -}; - -/** - * Tests if this Long's value equals the specified's. This is an alias of {@link Long#equals}. - * @function - * @param {!Long|number|string} other Other value - * @returns {boolean} - */ -LongPrototype.eq = LongPrototype.equals; - -/** - * Tests if this Long's value differs from the specified's. - * @this {!Long} - * @param {!Long|number|string} other Other value - * @returns {boolean} - */ -LongPrototype.notEquals = function notEquals(other) { - return !this.eq(/* validates */ other); -}; - -/** - * Tests if this Long's value differs from the specified's. This is an alias of {@link Long#notEquals}. - * @function - * @param {!Long|number|string} other Other value - * @returns {boolean} - */ -LongPrototype.neq = LongPrototype.notEquals; - -/** - * Tests if this Long's value differs from the specified's. This is an alias of {@link Long#notEquals}. - * @function - * @param {!Long|number|string} other Other value - * @returns {boolean} - */ -LongPrototype.ne = LongPrototype.notEquals; - -/** - * Tests if this Long's value is less than the specified's. - * @this {!Long} - * @param {!Long|number|string} other Other value - * @returns {boolean} - */ -LongPrototype.lessThan = function lessThan(other) { - return this.comp(/* validates */ other) < 0; -}; - -/** - * Tests if this Long's value is less than the specified's. This is an alias of {@link Long#lessThan}. - * @function - * @param {!Long|number|string} other Other value - * @returns {boolean} - */ -LongPrototype.lt = LongPrototype.lessThan; - -/** - * Tests if this Long's value is less than or equal the specified's. - * @this {!Long} - * @param {!Long|number|string} other Other value - * @returns {boolean} - */ -LongPrototype.lessThanOrEqual = function lessThanOrEqual(other) { - return this.comp(/* validates */ other) <= 0; -}; - -/** - * Tests if this Long's value is less than or equal the specified's. This is an alias of {@link Long#lessThanOrEqual}. - * @function - * @param {!Long|number|string} other Other value - * @returns {boolean} - */ -LongPrototype.lte = LongPrototype.lessThanOrEqual; - -/** - * Tests if this Long's value is less than or equal the specified's. This is an alias of {@link Long#lessThanOrEqual}. - * @function - * @param {!Long|number|string} other Other value - * @returns {boolean} - */ -LongPrototype.le = LongPrototype.lessThanOrEqual; - -/** - * Tests if this Long's value is greater than the specified's. - * @this {!Long} - * @param {!Long|number|string} other Other value - * @returns {boolean} - */ -LongPrototype.greaterThan = function greaterThan(other) { - return this.comp(/* validates */ other) > 0; -}; - -/** - * Tests if this Long's value is greater than the specified's. This is an alias of {@link Long#greaterThan}. - * @function - * @param {!Long|number|string} other Other value - * @returns {boolean} - */ -LongPrototype.gt = LongPrototype.greaterThan; - -/** - * Tests if this Long's value is greater than or equal the specified's. - * @this {!Long} - * @param {!Long|number|string} other Other value - * @returns {boolean} - */ -LongPrototype.greaterThanOrEqual = function greaterThanOrEqual(other) { - return this.comp(/* validates */ other) >= 0; -}; - -/** - * Tests if this Long's value is greater than or equal the specified's. This is an alias of {@link Long#greaterThanOrEqual}. - * @function - * @param {!Long|number|string} other Other value - * @returns {boolean} - */ -LongPrototype.gte = LongPrototype.greaterThanOrEqual; - -/** - * Tests if this Long's value is greater than or equal the specified's. This is an alias of {@link Long#greaterThanOrEqual}. - * @function - * @param {!Long|number|string} other Other value - * @returns {boolean} - */ -LongPrototype.ge = LongPrototype.greaterThanOrEqual; - -/** - * Compares this Long's value with the specified's. - * @this {!Long} - * @param {!Long|number|string} other Other value - * @returns {number} 0 if they are the same, 1 if the this is greater and -1 - * if the given one is greater - */ -LongPrototype.compare = function compare(other) { - if (!isLong(other)) - other = fromValue(other); - if (this.eq(other)) - return 0; - var thisNeg = this.isNegative(), - otherNeg = other.isNegative(); - if (thisNeg && !otherNeg) - return -1; - if (!thisNeg && otherNeg) - return 1; - // At this point the sign bits are the same - if (!this.unsigned) - return this.sub(other).isNegative() ? -1 : 1; - // Both are positive if at least one is unsigned - return (other.high >>> 0) > (this.high >>> 0) || (other.high === this.high && (other.low >>> 0) > (this.low >>> 0)) ? -1 : 1; -}; - -/** - * Compares this Long's value with the specified's. This is an alias of {@link Long#compare}. - * @function - * @param {!Long|number|string} other Other value - * @returns {number} 0 if they are the same, 1 if the this is greater and -1 - * if the given one is greater - */ -LongPrototype.comp = LongPrototype.compare; - -/** - * Negates this Long's value. - * @this {!Long} - * @returns {!Long} Negated Long - */ -LongPrototype.negate = function negate() { - if (!this.unsigned && this.eq(MIN_VALUE)) - return MIN_VALUE; - return this.not().add(ONE); -}; - -/** - * Negates this Long's value. This is an alias of {@link Long#negate}. - * @function - * @returns {!Long} Negated Long - */ -LongPrototype.neg = LongPrototype.negate; - -/** - * Returns the sum of this and the specified Long. - * @this {!Long} - * @param {!Long|number|string} addend Addend - * @returns {!Long} Sum - */ -LongPrototype.add = function add(addend) { - if (!isLong(addend)) - addend = fromValue(addend); - - // Divide each number into 4 chunks of 16 bits, and then sum the chunks. - - var a48 = this.high >>> 16; - var a32 = this.high & 0xFFFF; - var a16 = this.low >>> 16; - var a00 = this.low & 0xFFFF; - - var b48 = addend.high >>> 16; - var b32 = addend.high & 0xFFFF; - var b16 = addend.low >>> 16; - var b00 = addend.low & 0xFFFF; - - var c48 = 0, c32 = 0, c16 = 0, c00 = 0; - c00 += a00 + b00; - c16 += c00 >>> 16; - c00 &= 0xFFFF; - c16 += a16 + b16; - c32 += c16 >>> 16; - c16 &= 0xFFFF; - c32 += a32 + b32; - c48 += c32 >>> 16; - c32 &= 0xFFFF; - c48 += a48 + b48; - c48 &= 0xFFFF; - return fromBits((c16 << 16) | c00, (c48 << 16) | c32, this.unsigned); -}; - -/** - * Returns the difference of this and the specified Long. - * @this {!Long} - * @param {!Long|number|string} subtrahend Subtrahend - * @returns {!Long} Difference - */ -LongPrototype.subtract = function subtract(subtrahend) { - if (!isLong(subtrahend)) - subtrahend = fromValue(subtrahend); - return this.add(subtrahend.neg()); -}; - -/** - * Returns the difference of this and the specified Long. This is an alias of {@link Long#subtract}. - * @function - * @param {!Long|number|string} subtrahend Subtrahend - * @returns {!Long} Difference - */ -LongPrototype.sub = LongPrototype.subtract; - -/** - * Returns the product of this and the specified Long. - * @this {!Long} - * @param {!Long|number|string} multiplier Multiplier - * @returns {!Long} Product - */ -LongPrototype.multiply = function multiply(multiplier) { - if (this.isZero()) - return this; - if (!isLong(multiplier)) - multiplier = fromValue(multiplier); - - // use wasm support if present - if (wasm) { - var low = wasm["mul"](this.low, - this.high, - multiplier.low, - multiplier.high); - return fromBits(low, wasm["get_high"](), this.unsigned); - } - - if (multiplier.isZero()) - return this.unsigned ? UZERO : ZERO; - if (this.eq(MIN_VALUE)) - return multiplier.isOdd() ? MIN_VALUE : ZERO; - if (multiplier.eq(MIN_VALUE)) - return this.isOdd() ? MIN_VALUE : ZERO; - - if (this.isNegative()) { - if (multiplier.isNegative()) - return this.neg().mul(multiplier.neg()); - else - return this.neg().mul(multiplier).neg(); - } else if (multiplier.isNegative()) - return this.mul(multiplier.neg()).neg(); - - // If both longs are small, use float multiplication - if (this.lt(TWO_PWR_24) && multiplier.lt(TWO_PWR_24)) - return fromNumber(this.toNumber() * multiplier.toNumber(), this.unsigned); - - // Divide each long into 4 chunks of 16 bits, and then add up 4x4 products. - // We can skip products that would overflow. - - var a48 = this.high >>> 16; - var a32 = this.high & 0xFFFF; - var a16 = this.low >>> 16; - var a00 = this.low & 0xFFFF; - - var b48 = multiplier.high >>> 16; - var b32 = multiplier.high & 0xFFFF; - var b16 = multiplier.low >>> 16; - var b00 = multiplier.low & 0xFFFF; - - var c48 = 0, c32 = 0, c16 = 0, c00 = 0; - c00 += a00 * b00; - c16 += c00 >>> 16; - c00 &= 0xFFFF; - c16 += a16 * b00; - c32 += c16 >>> 16; - c16 &= 0xFFFF; - c16 += a00 * b16; - c32 += c16 >>> 16; - c16 &= 0xFFFF; - c32 += a32 * b00; - c48 += c32 >>> 16; - c32 &= 0xFFFF; - c32 += a16 * b16; - c48 += c32 >>> 16; - c32 &= 0xFFFF; - c32 += a00 * b32; - c48 += c32 >>> 16; - c32 &= 0xFFFF; - c48 += a48 * b00 + a32 * b16 + a16 * b32 + a00 * b48; - c48 &= 0xFFFF; - return fromBits((c16 << 16) | c00, (c48 << 16) | c32, this.unsigned); -}; - -/** - * Returns the product of this and the specified Long. This is an alias of {@link Long#multiply}. - * @function - * @param {!Long|number|string} multiplier Multiplier - * @returns {!Long} Product - */ -LongPrototype.mul = LongPrototype.multiply; - -/** - * Returns this Long divided by the specified. The result is signed if this Long is signed or - * unsigned if this Long is unsigned. - * @this {!Long} - * @param {!Long|number|string} divisor Divisor - * @returns {!Long} Quotient - */ -LongPrototype.divide = function divide(divisor) { - if (!isLong(divisor)) - divisor = fromValue(divisor); - if (divisor.isZero()) - throw Error('division by zero'); - - // use wasm support if present - if (wasm) { - // guard against signed division overflow: the largest - // negative number / -1 would be 1 larger than the largest - // positive number, due to two's complement. - if (!this.unsigned && - this.high === -0x80000000 && - divisor.low === -1 && divisor.high === -1) { - // be consistent with non-wasm code path - return this; - } - var low = (this.unsigned ? wasm["div_u"] : wasm["div_s"])( - this.low, - this.high, - divisor.low, - divisor.high - ); - return fromBits(low, wasm["get_high"](), this.unsigned); - } - - if (this.isZero()) - return this.unsigned ? UZERO : ZERO; - var approx, rem, res; - if (!this.unsigned) { - // This section is only relevant for signed longs and is derived from the - // closure library as a whole. - if (this.eq(MIN_VALUE)) { - if (divisor.eq(ONE) || divisor.eq(NEG_ONE)) - return MIN_VALUE; // recall that -MIN_VALUE == MIN_VALUE - else if (divisor.eq(MIN_VALUE)) - return ONE; - else { - // At this point, we have |other| >= 2, so |this/other| < |MIN_VALUE|. - var halfThis = this.shr(1); - approx = halfThis.div(divisor).shl(1); - if (approx.eq(ZERO)) { - return divisor.isNegative() ? ONE : NEG_ONE; - } else { - rem = this.sub(divisor.mul(approx)); - res = approx.add(rem.div(divisor)); - return res; - } - } - } else if (divisor.eq(MIN_VALUE)) - return this.unsigned ? UZERO : ZERO; - if (this.isNegative()) { - if (divisor.isNegative()) - return this.neg().div(divisor.neg()); - return this.neg().div(divisor).neg(); - } else if (divisor.isNegative()) - return this.div(divisor.neg()).neg(); - res = ZERO; - } else { - // The algorithm below has not been made for unsigned longs. It's therefore - // required to take special care of the MSB prior to running it. - if (!divisor.unsigned) - divisor = divisor.toUnsigned(); - if (divisor.gt(this)) - return UZERO; - if (divisor.gt(this.shru(1))) // 15 >>> 1 = 7 ; with divisor = 8 ; true - return UONE; - res = UZERO; - } - - // Repeat the following until the remainder is less than other: find a - // floating-point that approximates remainder / other *from below*, add this - // into the result, and subtract it from the remainder. It is critical that - // the approximate value is less than or equal to the real value so that the - // remainder never becomes negative. - rem = this; - while (rem.gte(divisor)) { - // Approximate the result of division. This may be a little greater or - // smaller than the actual value. - approx = Math.max(1, Math.floor(rem.toNumber() / divisor.toNumber())); - - // We will tweak the approximate result by changing it in the 48-th digit or - // the smallest non-fractional digit, whichever is larger. - var log2 = Math.ceil(Math.log(approx) / Math.LN2), - delta = (log2 <= 48) ? 1 : pow_dbl(2, log2 - 48), - - // Decrease the approximation until it is smaller than the remainder. Note - // that if it is too large, the product overflows and is negative. - approxRes = fromNumber(approx), - approxRem = approxRes.mul(divisor); - while (approxRem.isNegative() || approxRem.gt(rem)) { - approx -= delta; - approxRes = fromNumber(approx, this.unsigned); - approxRem = approxRes.mul(divisor); - } - - // We know the answer can't be zero... and actually, zero would cause - // infinite recursion since we would make no progress. - if (approxRes.isZero()) - approxRes = ONE; - - res = res.add(approxRes); - rem = rem.sub(approxRem); - } - return res; -}; - -/** - * Returns this Long divided by the specified. This is an alias of {@link Long#divide}. - * @function - * @param {!Long|number|string} divisor Divisor - * @returns {!Long} Quotient - */ -LongPrototype.div = LongPrototype.divide; - -/** - * Returns this Long modulo the specified. - * @this {!Long} - * @param {!Long|number|string} divisor Divisor - * @returns {!Long} Remainder - */ -LongPrototype.modulo = function modulo(divisor) { - if (!isLong(divisor)) - divisor = fromValue(divisor); - - // use wasm support if present - if (wasm) { - var low = (this.unsigned ? wasm["rem_u"] : wasm["rem_s"])( - this.low, - this.high, - divisor.low, - divisor.high - ); - return fromBits(low, wasm["get_high"](), this.unsigned); - } - - return this.sub(this.div(divisor).mul(divisor)); -}; - -/** - * Returns this Long modulo the specified. This is an alias of {@link Long#modulo}. - * @function - * @param {!Long|number|string} divisor Divisor - * @returns {!Long} Remainder - */ -LongPrototype.mod = LongPrototype.modulo; - -/** - * Returns this Long modulo the specified. This is an alias of {@link Long#modulo}. - * @function - * @param {!Long|number|string} divisor Divisor - * @returns {!Long} Remainder - */ -LongPrototype.rem = LongPrototype.modulo; - -/** - * Returns the bitwise NOT of this Long. - * @this {!Long} - * @returns {!Long} - */ -LongPrototype.not = function not() { - return fromBits(~this.low, ~this.high, this.unsigned); -}; - -/** - * Returns count leading zeros of this Long. - * @this {!Long} - * @returns {!number} - */ -LongPrototype.countLeadingZeros = function countLeadingZeros() { - return this.high ? Math.clz32(this.high) : Math.clz32(this.low) + 32; -}; - -/** - * Returns count leading zeros. This is an alias of {@link Long#countLeadingZeros}. - * @function - * @param {!Long} - * @returns {!number} - */ -LongPrototype.clz = LongPrototype.countLeadingZeros; - -/** - * Returns count trailing zeros of this Long. - * @this {!Long} - * @returns {!number} - */ -LongPrototype.countTrailingZeros = function countTrailingZeros() { - return this.low ? ctz32(this.low) : ctz32(this.high) + 32; -}; - -/** - * Returns count trailing zeros. This is an alias of {@link Long#countTrailingZeros}. - * @function - * @param {!Long} - * @returns {!number} - */ -LongPrototype.ctz = LongPrototype.countTrailingZeros; - -/** - * Returns the bitwise AND of this Long and the specified. - * @this {!Long} - * @param {!Long|number|string} other Other Long - * @returns {!Long} - */ -LongPrototype.and = function and(other) { - if (!isLong(other)) - other = fromValue(other); - return fromBits(this.low & other.low, this.high & other.high, this.unsigned); -}; - -/** - * Returns the bitwise OR of this Long and the specified. - * @this {!Long} - * @param {!Long|number|string} other Other Long - * @returns {!Long} - */ -LongPrototype.or = function or(other) { - if (!isLong(other)) - other = fromValue(other); - return fromBits(this.low | other.low, this.high | other.high, this.unsigned); -}; - -/** - * Returns the bitwise XOR of this Long and the given one. - * @this {!Long} - * @param {!Long|number|string} other Other Long - * @returns {!Long} - */ -LongPrototype.xor = function xor(other) { - if (!isLong(other)) - other = fromValue(other); - return fromBits(this.low ^ other.low, this.high ^ other.high, this.unsigned); -}; - -/** - * Returns this Long with bits shifted to the left by the given amount. - * @this {!Long} - * @param {number|!Long} numBits Number of bits - * @returns {!Long} Shifted Long - */ -LongPrototype.shiftLeft = function shiftLeft(numBits) { - if (isLong(numBits)) - numBits = numBits.toInt(); - if ((numBits &= 63) === 0) - return this; - else if (numBits < 32) - return fromBits(this.low << numBits, (this.high << numBits) | (this.low >>> (32 - numBits)), this.unsigned); - else - return fromBits(0, this.low << (numBits - 32), this.unsigned); -}; - -/** - * Returns this Long with bits shifted to the left by the given amount. This is an alias of {@link Long#shiftLeft}. - * @function - * @param {number|!Long} numBits Number of bits - * @returns {!Long} Shifted Long - */ -LongPrototype.shl = LongPrototype.shiftLeft; - -/** - * Returns this Long with bits arithmetically shifted to the right by the given amount. - * @this {!Long} - * @param {number|!Long} numBits Number of bits - * @returns {!Long} Shifted Long - */ -LongPrototype.shiftRight = function shiftRight(numBits) { - if (isLong(numBits)) - numBits = numBits.toInt(); - if ((numBits &= 63) === 0) - return this; - else if (numBits < 32) - return fromBits((this.low >>> numBits) | (this.high << (32 - numBits)), this.high >> numBits, this.unsigned); - else - return fromBits(this.high >> (numBits - 32), this.high >= 0 ? 0 : -1, this.unsigned); -}; - -/** - * Returns this Long with bits arithmetically shifted to the right by the given amount. This is an alias of {@link Long#shiftRight}. - * @function - * @param {number|!Long} numBits Number of bits - * @returns {!Long} Shifted Long - */ -LongPrototype.shr = LongPrototype.shiftRight; - -/** - * Returns this Long with bits logically shifted to the right by the given amount. - * @this {!Long} - * @param {number|!Long} numBits Number of bits - * @returns {!Long} Shifted Long - */ -LongPrototype.shiftRightUnsigned = function shiftRightUnsigned(numBits) { - if (isLong(numBits)) numBits = numBits.toInt(); - if ((numBits &= 63) === 0) return this; - if (numBits < 32) return fromBits((this.low >>> numBits) | (this.high << (32 - numBits)), this.high >>> numBits, this.unsigned); - if (numBits === 32) return fromBits(this.high, 0, this.unsigned); - return fromBits(this.high >>> (numBits - 32), 0, this.unsigned); -}; - -/** - * Returns this Long with bits logically shifted to the right by the given amount. This is an alias of {@link Long#shiftRightUnsigned}. - * @function - * @param {number|!Long} numBits Number of bits - * @returns {!Long} Shifted Long - */ -LongPrototype.shru = LongPrototype.shiftRightUnsigned; - -/** - * Returns this Long with bits logically shifted to the right by the given amount. This is an alias of {@link Long#shiftRightUnsigned}. - * @function - * @param {number|!Long} numBits Number of bits - * @returns {!Long} Shifted Long - */ -LongPrototype.shr_u = LongPrototype.shiftRightUnsigned; - -/** - * Returns this Long with bits rotated to the left by the given amount. - * @this {!Long} - * @param {number|!Long} numBits Number of bits - * @returns {!Long} Rotated Long - */ -LongPrototype.rotateLeft = function rotateLeft(numBits) { - var b; - if (isLong(numBits)) numBits = numBits.toInt(); - if ((numBits &= 63) === 0) return this; - if (numBits === 32) return fromBits(this.high, this.low, this.unsigned); - if (numBits < 32) { - b = (32 - numBits); - return fromBits(((this.low << numBits) | (this.high >>> b)), ((this.high << numBits) | (this.low >>> b)), this.unsigned); - } - numBits -= 32; - b = (32 - numBits); - return fromBits(((this.high << numBits) | (this.low >>> b)), ((this.low << numBits) | (this.high >>> b)), this.unsigned); -} -/** - * Returns this Long with bits rotated to the left by the given amount. This is an alias of {@link Long#rotateLeft}. - * @function - * @param {number|!Long} numBits Number of bits - * @returns {!Long} Rotated Long - */ -LongPrototype.rotl = LongPrototype.rotateLeft; - -/** - * Returns this Long with bits rotated to the right by the given amount. - * @this {!Long} - * @param {number|!Long} numBits Number of bits - * @returns {!Long} Rotated Long - */ -LongPrototype.rotateRight = function rotateRight(numBits) { - var b; - if (isLong(numBits)) numBits = numBits.toInt(); - if ((numBits &= 63) === 0) return this; - if (numBits === 32) return fromBits(this.high, this.low, this.unsigned); - if (numBits < 32) { - b = (32 - numBits); - return fromBits(((this.high << b) | (this.low >>> numBits)), ((this.low << b) | (this.high >>> numBits)), this.unsigned); - } - numBits -= 32; - b = (32 - numBits); - return fromBits(((this.low << b) | (this.high >>> numBits)), ((this.high << b) | (this.low >>> numBits)), this.unsigned); -} -/** - * Returns this Long with bits rotated to the right by the given amount. This is an alias of {@link Long#rotateRight}. - * @function - * @param {number|!Long} numBits Number of bits - * @returns {!Long} Rotated Long - */ -LongPrototype.rotr = LongPrototype.rotateRight; - -/** - * Converts this Long to signed. - * @this {!Long} - * @returns {!Long} Signed long - */ -LongPrototype.toSigned = function toSigned() { - if (!this.unsigned) - return this; - return fromBits(this.low, this.high, false); -}; - -/** - * Converts this Long to unsigned. - * @this {!Long} - * @returns {!Long} Unsigned long - */ -LongPrototype.toUnsigned = function toUnsigned() { - if (this.unsigned) - return this; - return fromBits(this.low, this.high, true); -}; - -/** - * Converts this Long to its byte representation. - * @param {boolean=} le Whether little or big endian, defaults to big endian - * @this {!Long} - * @returns {!Array.} Byte representation - */ -LongPrototype.toBytes = function toBytes(le) { - return le ? this.toBytesLE() : this.toBytesBE(); -}; - -/** - * Converts this Long to its little endian byte representation. - * @this {!Long} - * @returns {!Array.} Little endian byte representation - */ -LongPrototype.toBytesLE = function toBytesLE() { - var hi = this.high, - lo = this.low; - return [ - lo & 0xff, - lo >>> 8 & 0xff, - lo >>> 16 & 0xff, - lo >>> 24, - hi & 0xff, - hi >>> 8 & 0xff, - hi >>> 16 & 0xff, - hi >>> 24 - ]; -}; - -/** - * Converts this Long to its big endian byte representation. - * @this {!Long} - * @returns {!Array.} Big endian byte representation - */ -LongPrototype.toBytesBE = function toBytesBE() { - var hi = this.high, - lo = this.low; - return [ - hi >>> 24, - hi >>> 16 & 0xff, - hi >>> 8 & 0xff, - hi & 0xff, - lo >>> 24, - lo >>> 16 & 0xff, - lo >>> 8 & 0xff, - lo & 0xff - ]; -}; - -/** - * Creates a Long from its byte representation. - * @param {!Array.} bytes Byte representation - * @param {boolean=} unsigned Whether unsigned or not, defaults to signed - * @param {boolean=} le Whether little or big endian, defaults to big endian - * @returns {Long} The corresponding Long value - */ -Long.fromBytes = function fromBytes(bytes, unsigned, le) { - return le ? Long.fromBytesLE(bytes, unsigned) : Long.fromBytesBE(bytes, unsigned); -}; - -/** - * Creates a Long from its little endian byte representation. - * @param {!Array.} bytes Little endian byte representation - * @param {boolean=} unsigned Whether unsigned or not, defaults to signed - * @returns {Long} The corresponding Long value - */ -Long.fromBytesLE = function fromBytesLE(bytes, unsigned) { - return new Long( - bytes[0] | - bytes[1] << 8 | - bytes[2] << 16 | - bytes[3] << 24, - bytes[4] | - bytes[5] << 8 | - bytes[6] << 16 | - bytes[7] << 24, - unsigned - ); -}; - -/** - * Creates a Long from its big endian byte representation. - * @param {!Array.} bytes Big endian byte representation - * @param {boolean=} unsigned Whether unsigned or not, defaults to signed - * @returns {Long} The corresponding Long value - */ -Long.fromBytesBE = function fromBytesBE(bytes, unsigned) { - return new Long( - bytes[4] << 24 | - bytes[5] << 16 | - bytes[6] << 8 | - bytes[7], - bytes[0] << 24 | - bytes[1] << 16 | - bytes[2] << 8 | - bytes[3], - unsigned - ); -}; - -export default Long; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/node_modules/long/package.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/node_modules/long/package.json deleted file mode 100644 index 03485640..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/node_modules/long/package.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "name": "long", - "version": "5.2.1", - "author": "Daniel Wirtz ", - "description": "A Long class for representing a 64-bit two's-complement integer value.", - "repository": { - "type": "git", - "url": "https://github.com/dcodeIO/long.js.git" - }, - "bugs": { - "url": "https://github.com/dcodeIO/long.js/issues" - }, - "keywords": [ - "math", - "long", - "int64" - ], - "license": "Apache-2.0", - "type": "module", - "main": "umd/index.js", - "types": "index.d.ts", - "exports": { - ".": { - "types": "./index.d.ts", - "import": "./index.js", - "require": "./umd/index.js" - } - }, - "scripts": { - "build": "esm2umd Long index.js > umd/index.js", - "test": "node tests" - }, - "files": [ - "index.js", - "index.d.ts", - "umd/index.js", - "umd/index.d.ts", - "umd/package.json", - "LICENSE", - "README.md" - ], - "devDependencies": { - "esm2umd": "^0.2.0" - } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/node_modules/long/umd/index.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/node_modules/long/umd/index.d.ts deleted file mode 100644 index c623535c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/node_modules/long/umd/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import Long from "../index.js"; -export = Long; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/node_modules/long/umd/index.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/node_modules/long/umd/index.js deleted file mode 100644 index 03c5988f..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/node_modules/long/umd/index.js +++ /dev/null @@ -1,1432 +0,0 @@ -// GENERATED FILE. DO NOT EDIT. -var Long = (function(exports) { - "use strict"; - - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.default = void 0; - - /** - * @license - * Copyright 2009 The Closure Library Authors - * Copyright 2020 Daniel Wirtz / The long.js Authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * SPDX-License-Identifier: Apache-2.0 - */ - // WebAssembly optimizations to do native i64 multiplication and divide - var wasm = null; - - try { - wasm = new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0, 97, 115, 109, 1, 0, 0, 0, 1, 13, 2, 96, 0, 1, 127, 96, 4, 127, 127, 127, 127, 1, 127, 3, 7, 6, 0, 1, 1, 1, 1, 1, 6, 6, 1, 127, 1, 65, 0, 11, 7, 50, 6, 3, 109, 117, 108, 0, 1, 5, 100, 105, 118, 95, 115, 0, 2, 5, 100, 105, 118, 95, 117, 0, 3, 5, 114, 101, 109, 95, 115, 0, 4, 5, 114, 101, 109, 95, 117, 0, 5, 8, 103, 101, 116, 95, 104, 105, 103, 104, 0, 0, 10, 191, 1, 6, 4, 0, 35, 0, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 126, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 127, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 128, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 129, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 130, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11])), {}).exports; - } catch (e) {// no wasm support :( - } - /** - * Constructs a 64 bit two's-complement integer, given its low and high 32 bit values as *signed* integers. - * See the from* functions below for more convenient ways of constructing Longs. - * @exports Long - * @class A Long class for representing a 64 bit two's-complement integer value. - * @param {number} low The low (signed) 32 bits of the long - * @param {number} high The high (signed) 32 bits of the long - * @param {boolean=} unsigned Whether unsigned or not, defaults to signed - * @constructor - */ - - - function Long(low, high, unsigned) { - /** - * The low 32 bits as a signed value. - * @type {number} - */ - this.low = low | 0; - /** - * The high 32 bits as a signed value. - * @type {number} - */ - - this.high = high | 0; - /** - * Whether unsigned or not. - * @type {boolean} - */ - - this.unsigned = !!unsigned; - } // The internal representation of a long is the two given signed, 32-bit values. - // We use 32-bit pieces because these are the size of integers on which - // Javascript performs bit-operations. For operations like addition and - // multiplication, we split each number into 16 bit pieces, which can easily be - // multiplied within Javascript's floating-point representation without overflow - // or change in sign. - // - // In the algorithms below, we frequently reduce the negative case to the - // positive case by negating the input(s) and then post-processing the result. - // Note that we must ALWAYS check specially whether those values are MIN_VALUE - // (-2^63) because -MIN_VALUE == MIN_VALUE (since 2^63 cannot be represented as - // a positive number, it overflows back into a negative). Not handling this - // case would often result in infinite recursion. - // - // Common constant values ZERO, ONE, NEG_ONE, etc. are defined below the from* - // methods on which they depend. - - /** - * An indicator used to reliably determine if an object is a Long or not. - * @type {boolean} - * @const - * @private - */ - - - Long.prototype.__isLong__; - Object.defineProperty(Long.prototype, "__isLong__", { - value: true - }); - /** - * @function - * @param {*} obj Object - * @returns {boolean} - * @inner - */ - - function isLong(obj) { - return (obj && obj["__isLong__"]) === true; - } - /** - * @function - * @param {*} value number - * @returns {number} - * @inner - */ - - - function ctz32(value) { - var c = Math.clz32(value & -value); - return value ? 31 - c : c; - } - /** - * Tests if the specified object is a Long. - * @function - * @param {*} obj Object - * @returns {boolean} - */ - - - Long.isLong = isLong; - /** - * A cache of the Long representations of small integer values. - * @type {!Object} - * @inner - */ - - var INT_CACHE = {}; - /** - * A cache of the Long representations of small unsigned integer values. - * @type {!Object} - * @inner - */ - - var UINT_CACHE = {}; - /** - * @param {number} value - * @param {boolean=} unsigned - * @returns {!Long} - * @inner - */ - - function fromInt(value, unsigned) { - var obj, cachedObj, cache; - - if (unsigned) { - value >>>= 0; - - if (cache = 0 <= value && value < 256) { - cachedObj = UINT_CACHE[value]; - if (cachedObj) return cachedObj; - } - - obj = fromBits(value, 0, true); - if (cache) UINT_CACHE[value] = obj; - return obj; - } else { - value |= 0; - - if (cache = -128 <= value && value < 128) { - cachedObj = INT_CACHE[value]; - if (cachedObj) return cachedObj; - } - - obj = fromBits(value, value < 0 ? -1 : 0, false); - if (cache) INT_CACHE[value] = obj; - return obj; - } - } - /** - * Returns a Long representing the given 32 bit integer value. - * @function - * @param {number} value The 32 bit integer in question - * @param {boolean=} unsigned Whether unsigned or not, defaults to signed - * @returns {!Long} The corresponding Long value - */ - - - Long.fromInt = fromInt; - /** - * @param {number} value - * @param {boolean=} unsigned - * @returns {!Long} - * @inner - */ - - function fromNumber(value, unsigned) { - if (isNaN(value)) return unsigned ? UZERO : ZERO; - - if (unsigned) { - if (value < 0) return UZERO; - if (value >= TWO_PWR_64_DBL) return MAX_UNSIGNED_VALUE; - } else { - if (value <= -TWO_PWR_63_DBL) return MIN_VALUE; - if (value + 1 >= TWO_PWR_63_DBL) return MAX_VALUE; - } - - if (value < 0) return fromNumber(-value, unsigned).neg(); - return fromBits(value % TWO_PWR_32_DBL | 0, value / TWO_PWR_32_DBL | 0, unsigned); - } - /** - * Returns a Long representing the given value, provided that it is a finite number. Otherwise, zero is returned. - * @function - * @param {number} value The number in question - * @param {boolean=} unsigned Whether unsigned or not, defaults to signed - * @returns {!Long} The corresponding Long value - */ - - - Long.fromNumber = fromNumber; - /** - * @param {number} lowBits - * @param {number} highBits - * @param {boolean=} unsigned - * @returns {!Long} - * @inner - */ - - function fromBits(lowBits, highBits, unsigned) { - return new Long(lowBits, highBits, unsigned); - } - /** - * Returns a Long representing the 64 bit integer that comes by concatenating the given low and high bits. Each is - * assumed to use 32 bits. - * @function - * @param {number} lowBits The low 32 bits - * @param {number} highBits The high 32 bits - * @param {boolean=} unsigned Whether unsigned or not, defaults to signed - * @returns {!Long} The corresponding Long value - */ - - - Long.fromBits = fromBits; - /** - * @function - * @param {number} base - * @param {number} exponent - * @returns {number} - * @inner - */ - - var pow_dbl = Math.pow; // Used 4 times (4*8 to 15+4) - - /** - * @param {string} str - * @param {(boolean|number)=} unsigned - * @param {number=} radix - * @returns {!Long} - * @inner - */ - - function fromString(str, unsigned, radix) { - if (str.length === 0) throw Error('empty string'); - - if (typeof unsigned === 'number') { - // For goog.math.long compatibility - radix = unsigned; - unsigned = false; - } else { - unsigned = !!unsigned; - } - - if (str === "NaN" || str === "Infinity" || str === "+Infinity" || str === "-Infinity") return unsigned ? UZERO : ZERO; - radix = radix || 10; - if (radix < 2 || 36 < radix) throw RangeError('radix'); - var p; - if ((p = str.indexOf('-')) > 0) throw Error('interior hyphen');else if (p === 0) { - return fromString(str.substring(1), unsigned, radix).neg(); - } // Do several (8) digits each time through the loop, so as to - // minimize the calls to the very expensive emulated div. - - var radixToPower = fromNumber(pow_dbl(radix, 8)); - var result = ZERO; - - for (var i = 0; i < str.length; i += 8) { - var size = Math.min(8, str.length - i), - value = parseInt(str.substring(i, i + size), radix); - - if (size < 8) { - var power = fromNumber(pow_dbl(radix, size)); - result = result.mul(power).add(fromNumber(value)); - } else { - result = result.mul(radixToPower); - result = result.add(fromNumber(value)); - } - } - - result.unsigned = unsigned; - return result; - } - /** - * Returns a Long representation of the given string, written using the specified radix. - * @function - * @param {string} str The textual representation of the Long - * @param {(boolean|number)=} unsigned Whether unsigned or not, defaults to signed - * @param {number=} radix The radix in which the text is written (2-36), defaults to 10 - * @returns {!Long} The corresponding Long value - */ - - - Long.fromString = fromString; - /** - * @function - * @param {!Long|number|string|!{low: number, high: number, unsigned: boolean}} val - * @param {boolean=} unsigned - * @returns {!Long} - * @inner - */ - - function fromValue(val, unsigned) { - if (typeof val === 'number') return fromNumber(val, unsigned); - if (typeof val === 'string') return fromString(val, unsigned); // Throws for non-objects, converts non-instanceof Long: - - return fromBits(val.low, val.high, typeof unsigned === 'boolean' ? unsigned : val.unsigned); - } - /** - * Converts the specified value to a Long using the appropriate from* function for its type. - * @function - * @param {!Long|number|string|!{low: number, high: number, unsigned: boolean}} val Value - * @param {boolean=} unsigned Whether unsigned or not, defaults to signed - * @returns {!Long} - */ - - - Long.fromValue = fromValue; // NOTE: the compiler should inline these constant values below and then remove these variables, so there should be - // no runtime penalty for these. - - /** - * @type {number} - * @const - * @inner - */ - - var TWO_PWR_16_DBL = 1 << 16; - /** - * @type {number} - * @const - * @inner - */ - - var TWO_PWR_24_DBL = 1 << 24; - /** - * @type {number} - * @const - * @inner - */ - - var TWO_PWR_32_DBL = TWO_PWR_16_DBL * TWO_PWR_16_DBL; - /** - * @type {number} - * @const - * @inner - */ - - var TWO_PWR_64_DBL = TWO_PWR_32_DBL * TWO_PWR_32_DBL; - /** - * @type {number} - * @const - * @inner - */ - - var TWO_PWR_63_DBL = TWO_PWR_64_DBL / 2; - /** - * @type {!Long} - * @const - * @inner - */ - - var TWO_PWR_24 = fromInt(TWO_PWR_24_DBL); - /** - * @type {!Long} - * @inner - */ - - var ZERO = fromInt(0); - /** - * Signed zero. - * @type {!Long} - */ - - Long.ZERO = ZERO; - /** - * @type {!Long} - * @inner - */ - - var UZERO = fromInt(0, true); - /** - * Unsigned zero. - * @type {!Long} - */ - - Long.UZERO = UZERO; - /** - * @type {!Long} - * @inner - */ - - var ONE = fromInt(1); - /** - * Signed one. - * @type {!Long} - */ - - Long.ONE = ONE; - /** - * @type {!Long} - * @inner - */ - - var UONE = fromInt(1, true); - /** - * Unsigned one. - * @type {!Long} - */ - - Long.UONE = UONE; - /** - * @type {!Long} - * @inner - */ - - var NEG_ONE = fromInt(-1); - /** - * Signed negative one. - * @type {!Long} - */ - - Long.NEG_ONE = NEG_ONE; - /** - * @type {!Long} - * @inner - */ - - var MAX_VALUE = fromBits(0xFFFFFFFF | 0, 0x7FFFFFFF | 0, false); - /** - * Maximum signed value. - * @type {!Long} - */ - - Long.MAX_VALUE = MAX_VALUE; - /** - * @type {!Long} - * @inner - */ - - var MAX_UNSIGNED_VALUE = fromBits(0xFFFFFFFF | 0, 0xFFFFFFFF | 0, true); - /** - * Maximum unsigned value. - * @type {!Long} - */ - - Long.MAX_UNSIGNED_VALUE = MAX_UNSIGNED_VALUE; - /** - * @type {!Long} - * @inner - */ - - var MIN_VALUE = fromBits(0, 0x80000000 | 0, false); - /** - * Minimum signed value. - * @type {!Long} - */ - - Long.MIN_VALUE = MIN_VALUE; - /** - * @alias Long.prototype - * @inner - */ - - var LongPrototype = Long.prototype; - /** - * Converts the Long to a 32 bit integer, assuming it is a 32 bit integer. - * @this {!Long} - * @returns {number} - */ - - LongPrototype.toInt = function toInt() { - return this.unsigned ? this.low >>> 0 : this.low; - }; - /** - * Converts the Long to a the nearest floating-point representation of this value (double, 53 bit mantissa). - * @this {!Long} - * @returns {number} - */ - - - LongPrototype.toNumber = function toNumber() { - if (this.unsigned) return (this.high >>> 0) * TWO_PWR_32_DBL + (this.low >>> 0); - return this.high * TWO_PWR_32_DBL + (this.low >>> 0); - }; - /** - * Converts the Long to a string written in the specified radix. - * @this {!Long} - * @param {number=} radix Radix (2-36), defaults to 10 - * @returns {string} - * @override - * @throws {RangeError} If `radix` is out of range - */ - - - LongPrototype.toString = function toString(radix) { - radix = radix || 10; - if (radix < 2 || 36 < radix) throw RangeError('radix'); - if (this.isZero()) return '0'; - - if (this.isNegative()) { - // Unsigned Longs are never negative - if (this.eq(MIN_VALUE)) { - // We need to change the Long value before it can be negated, so we remove - // the bottom-most digit in this base and then recurse to do the rest. - var radixLong = fromNumber(radix), - div = this.div(radixLong), - rem1 = div.mul(radixLong).sub(this); - return div.toString(radix) + rem1.toInt().toString(radix); - } else return '-' + this.neg().toString(radix); - } // Do several (6) digits each time through the loop, so as to - // minimize the calls to the very expensive emulated div. - - - var radixToPower = fromNumber(pow_dbl(radix, 6), this.unsigned), - rem = this; - var result = ''; - - while (true) { - var remDiv = rem.div(radixToPower), - intval = rem.sub(remDiv.mul(radixToPower)).toInt() >>> 0, - digits = intval.toString(radix); - rem = remDiv; - if (rem.isZero()) return digits + result;else { - while (digits.length < 6) digits = '0' + digits; - - result = '' + digits + result; - } - } - }; - /** - * Gets the high 32 bits as a signed integer. - * @this {!Long} - * @returns {number} Signed high bits - */ - - - LongPrototype.getHighBits = function getHighBits() { - return this.high; - }; - /** - * Gets the high 32 bits as an unsigned integer. - * @this {!Long} - * @returns {number} Unsigned high bits - */ - - - LongPrototype.getHighBitsUnsigned = function getHighBitsUnsigned() { - return this.high >>> 0; - }; - /** - * Gets the low 32 bits as a signed integer. - * @this {!Long} - * @returns {number} Signed low bits - */ - - - LongPrototype.getLowBits = function getLowBits() { - return this.low; - }; - /** - * Gets the low 32 bits as an unsigned integer. - * @this {!Long} - * @returns {number} Unsigned low bits - */ - - - LongPrototype.getLowBitsUnsigned = function getLowBitsUnsigned() { - return this.low >>> 0; - }; - /** - * Gets the number of bits needed to represent the absolute value of this Long. - * @this {!Long} - * @returns {number} - */ - - - LongPrototype.getNumBitsAbs = function getNumBitsAbs() { - if (this.isNegative()) // Unsigned Longs are never negative - return this.eq(MIN_VALUE) ? 64 : this.neg().getNumBitsAbs(); - var val = this.high != 0 ? this.high : this.low; - - for (var bit = 31; bit > 0; bit--) if ((val & 1 << bit) != 0) break; - - return this.high != 0 ? bit + 33 : bit + 1; - }; - /** - * Tests if this Long's value equals zero. - * @this {!Long} - * @returns {boolean} - */ - - - LongPrototype.isZero = function isZero() { - return this.high === 0 && this.low === 0; - }; - /** - * Tests if this Long's value equals zero. This is an alias of {@link Long#isZero}. - * @returns {boolean} - */ - - - LongPrototype.eqz = LongPrototype.isZero; - /** - * Tests if this Long's value is negative. - * @this {!Long} - * @returns {boolean} - */ - - LongPrototype.isNegative = function isNegative() { - return !this.unsigned && this.high < 0; - }; - /** - * Tests if this Long's value is positive or zero. - * @this {!Long} - * @returns {boolean} - */ - - - LongPrototype.isPositive = function isPositive() { - return this.unsigned || this.high >= 0; - }; - /** - * Tests if this Long's value is odd. - * @this {!Long} - * @returns {boolean} - */ - - - LongPrototype.isOdd = function isOdd() { - return (this.low & 1) === 1; - }; - /** - * Tests if this Long's value is even. - * @this {!Long} - * @returns {boolean} - */ - - - LongPrototype.isEven = function isEven() { - return (this.low & 1) === 0; - }; - /** - * Tests if this Long's value equals the specified's. - * @this {!Long} - * @param {!Long|number|string} other Other value - * @returns {boolean} - */ - - - LongPrototype.equals = function equals(other) { - if (!isLong(other)) other = fromValue(other); - if (this.unsigned !== other.unsigned && this.high >>> 31 === 1 && other.high >>> 31 === 1) return false; - return this.high === other.high && this.low === other.low; - }; - /** - * Tests if this Long's value equals the specified's. This is an alias of {@link Long#equals}. - * @function - * @param {!Long|number|string} other Other value - * @returns {boolean} - */ - - - LongPrototype.eq = LongPrototype.equals; - /** - * Tests if this Long's value differs from the specified's. - * @this {!Long} - * @param {!Long|number|string} other Other value - * @returns {boolean} - */ - - LongPrototype.notEquals = function notEquals(other) { - return !this.eq( - /* validates */ - other); - }; - /** - * Tests if this Long's value differs from the specified's. This is an alias of {@link Long#notEquals}. - * @function - * @param {!Long|number|string} other Other value - * @returns {boolean} - */ - - - LongPrototype.neq = LongPrototype.notEquals; - /** - * Tests if this Long's value differs from the specified's. This is an alias of {@link Long#notEquals}. - * @function - * @param {!Long|number|string} other Other value - * @returns {boolean} - */ - - LongPrototype.ne = LongPrototype.notEquals; - /** - * Tests if this Long's value is less than the specified's. - * @this {!Long} - * @param {!Long|number|string} other Other value - * @returns {boolean} - */ - - LongPrototype.lessThan = function lessThan(other) { - return this.comp( - /* validates */ - other) < 0; - }; - /** - * Tests if this Long's value is less than the specified's. This is an alias of {@link Long#lessThan}. - * @function - * @param {!Long|number|string} other Other value - * @returns {boolean} - */ - - - LongPrototype.lt = LongPrototype.lessThan; - /** - * Tests if this Long's value is less than or equal the specified's. - * @this {!Long} - * @param {!Long|number|string} other Other value - * @returns {boolean} - */ - - LongPrototype.lessThanOrEqual = function lessThanOrEqual(other) { - return this.comp( - /* validates */ - other) <= 0; - }; - /** - * Tests if this Long's value is less than or equal the specified's. This is an alias of {@link Long#lessThanOrEqual}. - * @function - * @param {!Long|number|string} other Other value - * @returns {boolean} - */ - - - LongPrototype.lte = LongPrototype.lessThanOrEqual; - /** - * Tests if this Long's value is less than or equal the specified's. This is an alias of {@link Long#lessThanOrEqual}. - * @function - * @param {!Long|number|string} other Other value - * @returns {boolean} - */ - - LongPrototype.le = LongPrototype.lessThanOrEqual; - /** - * Tests if this Long's value is greater than the specified's. - * @this {!Long} - * @param {!Long|number|string} other Other value - * @returns {boolean} - */ - - LongPrototype.greaterThan = function greaterThan(other) { - return this.comp( - /* validates */ - other) > 0; - }; - /** - * Tests if this Long's value is greater than the specified's. This is an alias of {@link Long#greaterThan}. - * @function - * @param {!Long|number|string} other Other value - * @returns {boolean} - */ - - - LongPrototype.gt = LongPrototype.greaterThan; - /** - * Tests if this Long's value is greater than or equal the specified's. - * @this {!Long} - * @param {!Long|number|string} other Other value - * @returns {boolean} - */ - - LongPrototype.greaterThanOrEqual = function greaterThanOrEqual(other) { - return this.comp( - /* validates */ - other) >= 0; - }; - /** - * Tests if this Long's value is greater than or equal the specified's. This is an alias of {@link Long#greaterThanOrEqual}. - * @function - * @param {!Long|number|string} other Other value - * @returns {boolean} - */ - - - LongPrototype.gte = LongPrototype.greaterThanOrEqual; - /** - * Tests if this Long's value is greater than or equal the specified's. This is an alias of {@link Long#greaterThanOrEqual}. - * @function - * @param {!Long|number|string} other Other value - * @returns {boolean} - */ - - LongPrototype.ge = LongPrototype.greaterThanOrEqual; - /** - * Compares this Long's value with the specified's. - * @this {!Long} - * @param {!Long|number|string} other Other value - * @returns {number} 0 if they are the same, 1 if the this is greater and -1 - * if the given one is greater - */ - - LongPrototype.compare = function compare(other) { - if (!isLong(other)) other = fromValue(other); - if (this.eq(other)) return 0; - var thisNeg = this.isNegative(), - otherNeg = other.isNegative(); - if (thisNeg && !otherNeg) return -1; - if (!thisNeg && otherNeg) return 1; // At this point the sign bits are the same - - if (!this.unsigned) return this.sub(other).isNegative() ? -1 : 1; // Both are positive if at least one is unsigned - - return other.high >>> 0 > this.high >>> 0 || other.high === this.high && other.low >>> 0 > this.low >>> 0 ? -1 : 1; - }; - /** - * Compares this Long's value with the specified's. This is an alias of {@link Long#compare}. - * @function - * @param {!Long|number|string} other Other value - * @returns {number} 0 if they are the same, 1 if the this is greater and -1 - * if the given one is greater - */ - - - LongPrototype.comp = LongPrototype.compare; - /** - * Negates this Long's value. - * @this {!Long} - * @returns {!Long} Negated Long - */ - - LongPrototype.negate = function negate() { - if (!this.unsigned && this.eq(MIN_VALUE)) return MIN_VALUE; - return this.not().add(ONE); - }; - /** - * Negates this Long's value. This is an alias of {@link Long#negate}. - * @function - * @returns {!Long} Negated Long - */ - - - LongPrototype.neg = LongPrototype.negate; - /** - * Returns the sum of this and the specified Long. - * @this {!Long} - * @param {!Long|number|string} addend Addend - * @returns {!Long} Sum - */ - - LongPrototype.add = function add(addend) { - if (!isLong(addend)) addend = fromValue(addend); // Divide each number into 4 chunks of 16 bits, and then sum the chunks. - - var a48 = this.high >>> 16; - var a32 = this.high & 0xFFFF; - var a16 = this.low >>> 16; - var a00 = this.low & 0xFFFF; - var b48 = addend.high >>> 16; - var b32 = addend.high & 0xFFFF; - var b16 = addend.low >>> 16; - var b00 = addend.low & 0xFFFF; - var c48 = 0, - c32 = 0, - c16 = 0, - c00 = 0; - c00 += a00 + b00; - c16 += c00 >>> 16; - c00 &= 0xFFFF; - c16 += a16 + b16; - c32 += c16 >>> 16; - c16 &= 0xFFFF; - c32 += a32 + b32; - c48 += c32 >>> 16; - c32 &= 0xFFFF; - c48 += a48 + b48; - c48 &= 0xFFFF; - return fromBits(c16 << 16 | c00, c48 << 16 | c32, this.unsigned); - }; - /** - * Returns the difference of this and the specified Long. - * @this {!Long} - * @param {!Long|number|string} subtrahend Subtrahend - * @returns {!Long} Difference - */ - - - LongPrototype.subtract = function subtract(subtrahend) { - if (!isLong(subtrahend)) subtrahend = fromValue(subtrahend); - return this.add(subtrahend.neg()); - }; - /** - * Returns the difference of this and the specified Long. This is an alias of {@link Long#subtract}. - * @function - * @param {!Long|number|string} subtrahend Subtrahend - * @returns {!Long} Difference - */ - - - LongPrototype.sub = LongPrototype.subtract; - /** - * Returns the product of this and the specified Long. - * @this {!Long} - * @param {!Long|number|string} multiplier Multiplier - * @returns {!Long} Product - */ - - LongPrototype.multiply = function multiply(multiplier) { - if (this.isZero()) return this; - if (!isLong(multiplier)) multiplier = fromValue(multiplier); // use wasm support if present - - if (wasm) { - var low = wasm["mul"](this.low, this.high, multiplier.low, multiplier.high); - return fromBits(low, wasm["get_high"](), this.unsigned); - } - - if (multiplier.isZero()) return this.unsigned ? UZERO : ZERO; - if (this.eq(MIN_VALUE)) return multiplier.isOdd() ? MIN_VALUE : ZERO; - if (multiplier.eq(MIN_VALUE)) return this.isOdd() ? MIN_VALUE : ZERO; - - if (this.isNegative()) { - if (multiplier.isNegative()) return this.neg().mul(multiplier.neg());else return this.neg().mul(multiplier).neg(); - } else if (multiplier.isNegative()) return this.mul(multiplier.neg()).neg(); // If both longs are small, use float multiplication - - - if (this.lt(TWO_PWR_24) && multiplier.lt(TWO_PWR_24)) return fromNumber(this.toNumber() * multiplier.toNumber(), this.unsigned); // Divide each long into 4 chunks of 16 bits, and then add up 4x4 products. - // We can skip products that would overflow. - - var a48 = this.high >>> 16; - var a32 = this.high & 0xFFFF; - var a16 = this.low >>> 16; - var a00 = this.low & 0xFFFF; - var b48 = multiplier.high >>> 16; - var b32 = multiplier.high & 0xFFFF; - var b16 = multiplier.low >>> 16; - var b00 = multiplier.low & 0xFFFF; - var c48 = 0, - c32 = 0, - c16 = 0, - c00 = 0; - c00 += a00 * b00; - c16 += c00 >>> 16; - c00 &= 0xFFFF; - c16 += a16 * b00; - c32 += c16 >>> 16; - c16 &= 0xFFFF; - c16 += a00 * b16; - c32 += c16 >>> 16; - c16 &= 0xFFFF; - c32 += a32 * b00; - c48 += c32 >>> 16; - c32 &= 0xFFFF; - c32 += a16 * b16; - c48 += c32 >>> 16; - c32 &= 0xFFFF; - c32 += a00 * b32; - c48 += c32 >>> 16; - c32 &= 0xFFFF; - c48 += a48 * b00 + a32 * b16 + a16 * b32 + a00 * b48; - c48 &= 0xFFFF; - return fromBits(c16 << 16 | c00, c48 << 16 | c32, this.unsigned); - }; - /** - * Returns the product of this and the specified Long. This is an alias of {@link Long#multiply}. - * @function - * @param {!Long|number|string} multiplier Multiplier - * @returns {!Long} Product - */ - - - LongPrototype.mul = LongPrototype.multiply; - /** - * Returns this Long divided by the specified. The result is signed if this Long is signed or - * unsigned if this Long is unsigned. - * @this {!Long} - * @param {!Long|number|string} divisor Divisor - * @returns {!Long} Quotient - */ - - LongPrototype.divide = function divide(divisor) { - if (!isLong(divisor)) divisor = fromValue(divisor); - if (divisor.isZero()) throw Error('division by zero'); // use wasm support if present - - if (wasm) { - // guard against signed division overflow: the largest - // negative number / -1 would be 1 larger than the largest - // positive number, due to two's complement. - if (!this.unsigned && this.high === -0x80000000 && divisor.low === -1 && divisor.high === -1) { - // be consistent with non-wasm code path - return this; - } - - var low = (this.unsigned ? wasm["div_u"] : wasm["div_s"])(this.low, this.high, divisor.low, divisor.high); - return fromBits(low, wasm["get_high"](), this.unsigned); - } - - if (this.isZero()) return this.unsigned ? UZERO : ZERO; - var approx, rem, res; - - if (!this.unsigned) { - // This section is only relevant for signed longs and is derived from the - // closure library as a whole. - if (this.eq(MIN_VALUE)) { - if (divisor.eq(ONE) || divisor.eq(NEG_ONE)) return MIN_VALUE; // recall that -MIN_VALUE == MIN_VALUE - else if (divisor.eq(MIN_VALUE)) return ONE;else { - // At this point, we have |other| >= 2, so |this/other| < |MIN_VALUE|. - var halfThis = this.shr(1); - approx = halfThis.div(divisor).shl(1); - - if (approx.eq(ZERO)) { - return divisor.isNegative() ? ONE : NEG_ONE; - } else { - rem = this.sub(divisor.mul(approx)); - res = approx.add(rem.div(divisor)); - return res; - } - } - } else if (divisor.eq(MIN_VALUE)) return this.unsigned ? UZERO : ZERO; - - if (this.isNegative()) { - if (divisor.isNegative()) return this.neg().div(divisor.neg()); - return this.neg().div(divisor).neg(); - } else if (divisor.isNegative()) return this.div(divisor.neg()).neg(); - - res = ZERO; - } else { - // The algorithm below has not been made for unsigned longs. It's therefore - // required to take special care of the MSB prior to running it. - if (!divisor.unsigned) divisor = divisor.toUnsigned(); - if (divisor.gt(this)) return UZERO; - if (divisor.gt(this.shru(1))) // 15 >>> 1 = 7 ; with divisor = 8 ; true - return UONE; - res = UZERO; - } // Repeat the following until the remainder is less than other: find a - // floating-point that approximates remainder / other *from below*, add this - // into the result, and subtract it from the remainder. It is critical that - // the approximate value is less than or equal to the real value so that the - // remainder never becomes negative. - - - rem = this; - - while (rem.gte(divisor)) { - // Approximate the result of division. This may be a little greater or - // smaller than the actual value. - approx = Math.max(1, Math.floor(rem.toNumber() / divisor.toNumber())); // We will tweak the approximate result by changing it in the 48-th digit or - // the smallest non-fractional digit, whichever is larger. - - var log2 = Math.ceil(Math.log(approx) / Math.LN2), - delta = log2 <= 48 ? 1 : pow_dbl(2, log2 - 48), - // Decrease the approximation until it is smaller than the remainder. Note - // that if it is too large, the product overflows and is negative. - approxRes = fromNumber(approx), - approxRem = approxRes.mul(divisor); - - while (approxRem.isNegative() || approxRem.gt(rem)) { - approx -= delta; - approxRes = fromNumber(approx, this.unsigned); - approxRem = approxRes.mul(divisor); - } // We know the answer can't be zero... and actually, zero would cause - // infinite recursion since we would make no progress. - - - if (approxRes.isZero()) approxRes = ONE; - res = res.add(approxRes); - rem = rem.sub(approxRem); - } - - return res; - }; - /** - * Returns this Long divided by the specified. This is an alias of {@link Long#divide}. - * @function - * @param {!Long|number|string} divisor Divisor - * @returns {!Long} Quotient - */ - - - LongPrototype.div = LongPrototype.divide; - /** - * Returns this Long modulo the specified. - * @this {!Long} - * @param {!Long|number|string} divisor Divisor - * @returns {!Long} Remainder - */ - - LongPrototype.modulo = function modulo(divisor) { - if (!isLong(divisor)) divisor = fromValue(divisor); // use wasm support if present - - if (wasm) { - var low = (this.unsigned ? wasm["rem_u"] : wasm["rem_s"])(this.low, this.high, divisor.low, divisor.high); - return fromBits(low, wasm["get_high"](), this.unsigned); - } - - return this.sub(this.div(divisor).mul(divisor)); - }; - /** - * Returns this Long modulo the specified. This is an alias of {@link Long#modulo}. - * @function - * @param {!Long|number|string} divisor Divisor - * @returns {!Long} Remainder - */ - - - LongPrototype.mod = LongPrototype.modulo; - /** - * Returns this Long modulo the specified. This is an alias of {@link Long#modulo}. - * @function - * @param {!Long|number|string} divisor Divisor - * @returns {!Long} Remainder - */ - - LongPrototype.rem = LongPrototype.modulo; - /** - * Returns the bitwise NOT of this Long. - * @this {!Long} - * @returns {!Long} - */ - - LongPrototype.not = function not() { - return fromBits(~this.low, ~this.high, this.unsigned); - }; - /** - * Returns count leading zeros of this Long. - * @this {!Long} - * @returns {!number} - */ - - - LongPrototype.countLeadingZeros = function countLeadingZeros() { - return this.high ? Math.clz32(this.high) : Math.clz32(this.low) + 32; - }; - /** - * Returns count leading zeros. This is an alias of {@link Long#countLeadingZeros}. - * @function - * @param {!Long} - * @returns {!number} - */ - - - LongPrototype.clz = LongPrototype.countLeadingZeros; - /** - * Returns count trailing zeros of this Long. - * @this {!Long} - * @returns {!number} - */ - - LongPrototype.countTrailingZeros = function countTrailingZeros() { - return this.low ? ctz32(this.low) : ctz32(this.high) + 32; - }; - /** - * Returns count trailing zeros. This is an alias of {@link Long#countTrailingZeros}. - * @function - * @param {!Long} - * @returns {!number} - */ - - - LongPrototype.ctz = LongPrototype.countTrailingZeros; - /** - * Returns the bitwise AND of this Long and the specified. - * @this {!Long} - * @param {!Long|number|string} other Other Long - * @returns {!Long} - */ - - LongPrototype.and = function and(other) { - if (!isLong(other)) other = fromValue(other); - return fromBits(this.low & other.low, this.high & other.high, this.unsigned); - }; - /** - * Returns the bitwise OR of this Long and the specified. - * @this {!Long} - * @param {!Long|number|string} other Other Long - * @returns {!Long} - */ - - - LongPrototype.or = function or(other) { - if (!isLong(other)) other = fromValue(other); - return fromBits(this.low | other.low, this.high | other.high, this.unsigned); - }; - /** - * Returns the bitwise XOR of this Long and the given one. - * @this {!Long} - * @param {!Long|number|string} other Other Long - * @returns {!Long} - */ - - - LongPrototype.xor = function xor(other) { - if (!isLong(other)) other = fromValue(other); - return fromBits(this.low ^ other.low, this.high ^ other.high, this.unsigned); - }; - /** - * Returns this Long with bits shifted to the left by the given amount. - * @this {!Long} - * @param {number|!Long} numBits Number of bits - * @returns {!Long} Shifted Long - */ - - - LongPrototype.shiftLeft = function shiftLeft(numBits) { - if (isLong(numBits)) numBits = numBits.toInt(); - if ((numBits &= 63) === 0) return this;else if (numBits < 32) return fromBits(this.low << numBits, this.high << numBits | this.low >>> 32 - numBits, this.unsigned);else return fromBits(0, this.low << numBits - 32, this.unsigned); - }; - /** - * Returns this Long with bits shifted to the left by the given amount. This is an alias of {@link Long#shiftLeft}. - * @function - * @param {number|!Long} numBits Number of bits - * @returns {!Long} Shifted Long - */ - - - LongPrototype.shl = LongPrototype.shiftLeft; - /** - * Returns this Long with bits arithmetically shifted to the right by the given amount. - * @this {!Long} - * @param {number|!Long} numBits Number of bits - * @returns {!Long} Shifted Long - */ - - LongPrototype.shiftRight = function shiftRight(numBits) { - if (isLong(numBits)) numBits = numBits.toInt(); - if ((numBits &= 63) === 0) return this;else if (numBits < 32) return fromBits(this.low >>> numBits | this.high << 32 - numBits, this.high >> numBits, this.unsigned);else return fromBits(this.high >> numBits - 32, this.high >= 0 ? 0 : -1, this.unsigned); - }; - /** - * Returns this Long with bits arithmetically shifted to the right by the given amount. This is an alias of {@link Long#shiftRight}. - * @function - * @param {number|!Long} numBits Number of bits - * @returns {!Long} Shifted Long - */ - - - LongPrototype.shr = LongPrototype.shiftRight; - /** - * Returns this Long with bits logically shifted to the right by the given amount. - * @this {!Long} - * @param {number|!Long} numBits Number of bits - * @returns {!Long} Shifted Long - */ - - LongPrototype.shiftRightUnsigned = function shiftRightUnsigned(numBits) { - if (isLong(numBits)) numBits = numBits.toInt(); - if ((numBits &= 63) === 0) return this; - if (numBits < 32) return fromBits(this.low >>> numBits | this.high << 32 - numBits, this.high >>> numBits, this.unsigned); - if (numBits === 32) return fromBits(this.high, 0, this.unsigned); - return fromBits(this.high >>> numBits - 32, 0, this.unsigned); - }; - /** - * Returns this Long with bits logically shifted to the right by the given amount. This is an alias of {@link Long#shiftRightUnsigned}. - * @function - * @param {number|!Long} numBits Number of bits - * @returns {!Long} Shifted Long - */ - - - LongPrototype.shru = LongPrototype.shiftRightUnsigned; - /** - * Returns this Long with bits logically shifted to the right by the given amount. This is an alias of {@link Long#shiftRightUnsigned}. - * @function - * @param {number|!Long} numBits Number of bits - * @returns {!Long} Shifted Long - */ - - LongPrototype.shr_u = LongPrototype.shiftRightUnsigned; - /** - * Returns this Long with bits rotated to the left by the given amount. - * @this {!Long} - * @param {number|!Long} numBits Number of bits - * @returns {!Long} Rotated Long - */ - - LongPrototype.rotateLeft = function rotateLeft(numBits) { - var b; - if (isLong(numBits)) numBits = numBits.toInt(); - if ((numBits &= 63) === 0) return this; - if (numBits === 32) return fromBits(this.high, this.low, this.unsigned); - - if (numBits < 32) { - b = 32 - numBits; - return fromBits(this.low << numBits | this.high >>> b, this.high << numBits | this.low >>> b, this.unsigned); - } - - numBits -= 32; - b = 32 - numBits; - return fromBits(this.high << numBits | this.low >>> b, this.low << numBits | this.high >>> b, this.unsigned); - }; - /** - * Returns this Long with bits rotated to the left by the given amount. This is an alias of {@link Long#rotateLeft}. - * @function - * @param {number|!Long} numBits Number of bits - * @returns {!Long} Rotated Long - */ - - - LongPrototype.rotl = LongPrototype.rotateLeft; - /** - * Returns this Long with bits rotated to the right by the given amount. - * @this {!Long} - * @param {number|!Long} numBits Number of bits - * @returns {!Long} Rotated Long - */ - - LongPrototype.rotateRight = function rotateRight(numBits) { - var b; - if (isLong(numBits)) numBits = numBits.toInt(); - if ((numBits &= 63) === 0) return this; - if (numBits === 32) return fromBits(this.high, this.low, this.unsigned); - - if (numBits < 32) { - b = 32 - numBits; - return fromBits(this.high << b | this.low >>> numBits, this.low << b | this.high >>> numBits, this.unsigned); - } - - numBits -= 32; - b = 32 - numBits; - return fromBits(this.low << b | this.high >>> numBits, this.high << b | this.low >>> numBits, this.unsigned); - }; - /** - * Returns this Long with bits rotated to the right by the given amount. This is an alias of {@link Long#rotateRight}. - * @function - * @param {number|!Long} numBits Number of bits - * @returns {!Long} Rotated Long - */ - - - LongPrototype.rotr = LongPrototype.rotateRight; - /** - * Converts this Long to signed. - * @this {!Long} - * @returns {!Long} Signed long - */ - - LongPrototype.toSigned = function toSigned() { - if (!this.unsigned) return this; - return fromBits(this.low, this.high, false); - }; - /** - * Converts this Long to unsigned. - * @this {!Long} - * @returns {!Long} Unsigned long - */ - - - LongPrototype.toUnsigned = function toUnsigned() { - if (this.unsigned) return this; - return fromBits(this.low, this.high, true); - }; - /** - * Converts this Long to its byte representation. - * @param {boolean=} le Whether little or big endian, defaults to big endian - * @this {!Long} - * @returns {!Array.} Byte representation - */ - - - LongPrototype.toBytes = function toBytes(le) { - return le ? this.toBytesLE() : this.toBytesBE(); - }; - /** - * Converts this Long to its little endian byte representation. - * @this {!Long} - * @returns {!Array.} Little endian byte representation - */ - - - LongPrototype.toBytesLE = function toBytesLE() { - var hi = this.high, - lo = this.low; - return [lo & 0xff, lo >>> 8 & 0xff, lo >>> 16 & 0xff, lo >>> 24, hi & 0xff, hi >>> 8 & 0xff, hi >>> 16 & 0xff, hi >>> 24]; - }; - /** - * Converts this Long to its big endian byte representation. - * @this {!Long} - * @returns {!Array.} Big endian byte representation - */ - - - LongPrototype.toBytesBE = function toBytesBE() { - var hi = this.high, - lo = this.low; - return [hi >>> 24, hi >>> 16 & 0xff, hi >>> 8 & 0xff, hi & 0xff, lo >>> 24, lo >>> 16 & 0xff, lo >>> 8 & 0xff, lo & 0xff]; - }; - /** - * Creates a Long from its byte representation. - * @param {!Array.} bytes Byte representation - * @param {boolean=} unsigned Whether unsigned or not, defaults to signed - * @param {boolean=} le Whether little or big endian, defaults to big endian - * @returns {Long} The corresponding Long value - */ - - - Long.fromBytes = function fromBytes(bytes, unsigned, le) { - return le ? Long.fromBytesLE(bytes, unsigned) : Long.fromBytesBE(bytes, unsigned); - }; - /** - * Creates a Long from its little endian byte representation. - * @param {!Array.} bytes Little endian byte representation - * @param {boolean=} unsigned Whether unsigned or not, defaults to signed - * @returns {Long} The corresponding Long value - */ - - - Long.fromBytesLE = function fromBytesLE(bytes, unsigned) { - return new Long(bytes[0] | bytes[1] << 8 | bytes[2] << 16 | bytes[3] << 24, bytes[4] | bytes[5] << 8 | bytes[6] << 16 | bytes[7] << 24, unsigned); - }; - /** - * Creates a Long from its big endian byte representation. - * @param {!Array.} bytes Big endian byte representation - * @param {boolean=} unsigned Whether unsigned or not, defaults to signed - * @returns {Long} The corresponding Long value - */ - - - Long.fromBytesBE = function fromBytesBE(bytes, unsigned) { - return new Long(bytes[4] << 24 | bytes[5] << 16 | bytes[6] << 8 | bytes[7], bytes[0] << 24 | bytes[1] << 16 | bytes[2] << 8 | bytes[3], unsigned); - }; - - var _default = Long; - exports.default = _default; - return "default" in exports ? exports.default : exports; -})({}); -if (typeof define === 'function' && define.amd) define([], function() { return Long; }); -else if (typeof module === 'object' && typeof exports==='object') module.exports = Long; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/node_modules/long/umd/package.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/node_modules/long/umd/package.json deleted file mode 100644 index 5bbefffb..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/node_modules/long/umd/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "type": "commonjs" -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/package.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/package.json deleted file mode 100644 index 86435700..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/package.json +++ /dev/null @@ -1,103 +0,0 @@ -{ - "name": "protobufjs", - "version": "7.1.2", - "versionScheme": "~", - "description": "Protocol Buffers for JavaScript (& TypeScript).", - "author": "Daniel Wirtz ", - "license": "BSD-3-Clause", - "repository": "protobufjs/protobuf.js", - "bugs": "https://github.com/protobufjs/protobuf.js/issues", - "homepage": "https://protobufjs.github.io/protobuf.js/", - "engines": { - "node": ">=12.0.0" - }, - "keywords": [ - "protobuf", - "protocol-buffers", - "serialization", - "typescript" - ], - "main": "index.js", - "types": "index.d.ts", - "scripts": { - "bench": "node bench", - "build": "npm run build:bundle && npm run build:types", - "build:bundle": "gulp --gulpfile scripts/gulpfile.js", - "build:types": "node cli/bin/pbts --main --global protobuf --out index.d.ts src/ lib/aspromise/index.js lib/base64/index.js lib/codegen/index.js lib/eventemitter/index.js lib/float/index.js lib/fetch/index.js lib/inquire/index.js lib/path/index.js lib/pool/index.js lib/utf8/index.js", - "changelog": "node scripts/changelog -w", - "coverage": "nyc tape -r ./lib/tape-adapter tests/*.js tests/node/*.js", - "docs": "jsdoc -c config/jsdoc.json -R README.md --verbose --pedantic", - "lint": "npm run lint:sources && npm run lint:types", - "lint:sources": "eslint \"**/*.js\" -c config/eslint.json", - "lint:types": "tslint \"**/*.d.ts\" -e \"**/node_modules/**\" -t stylish -c config/tslint.json", - "pages": "node scripts/pages", - "prepublish": "cd cli && npm install && cd .. && npm run build", - "postinstall": "node scripts/postinstall", - "prof": "node bench/prof", - "test": "npm run test:sources && npm run test:types", - "test:sources": "tape -r ./lib/tape-adapter tests/*.js tests/node/*.js", - "test:types": "tsc tests/comp_typescript.ts --lib es2015 --esModuleInterop --strictNullChecks --experimentalDecorators --emitDecoratorMetadata && tsc tests/data/test.js.ts --lib es2015 --esModuleInterop --noEmit --strictNullChecks && tsc tests/data/*.ts --lib es2015 --esModuleInterop --noEmit --strictNullChecks", - "make": "npm run lint:sources && npm run build && npm run lint:types && node ./scripts/gentests.js && npm test" - }, - "dependencies": { - "@protobufjs/aspromise": "^1.1.2", - "@protobufjs/base64": "^1.1.2", - "@protobufjs/codegen": "^2.0.4", - "@protobufjs/eventemitter": "^1.1.0", - "@protobufjs/fetch": "^1.1.0", - "@protobufjs/float": "^1.0.2", - "@protobufjs/inquire": "^1.1.0", - "@protobufjs/path": "^1.1.2", - "@protobufjs/pool": "^1.1.0", - "@protobufjs/utf8": "^1.1.0", - "@types/node": ">=13.7.0", - "long": "^5.0.0" - }, - "devDependencies": { - "benchmark": "^2.1.4", - "browserify": "^17.0.0", - "browserify-wrap": "^1.0.2", - "bundle-collapser": "^1.3.0", - "chalk": "^4.0.0", - "escodegen": "^1.13.0", - "eslint": "^8.15.0", - "espree": "^9.0.0", - "estraverse": "^5.1.0", - "gh-pages": "^4.0.0", - "git-raw-commits": "^2.0.3", - "git-semver-tags": "^4.0.0", - "google-protobuf": "^3.11.3", - "gulp": "^4.0.2", - "gulp-header": "^2.0.9", - "gulp-if": "^3.0.0", - "gulp-sourcemaps": "^3.0.0", - "gulp-uglify": "^3.0.2", - "jaguarjs-jsdoc": "github:dcodeIO/jaguarjs-jsdoc", - "jsdoc": "^3.6.3", - "minimist": "^1.2.0", - "nyc": "^15.0.0", - "reflect-metadata": "^0.1.13", - "tape": "^5.0.0", - "tslint": "^6.0.0", - "typescript": "^3.7.5", - "uglify-js": "^3.7.7", - "vinyl-buffer": "^1.0.1", - "vinyl-fs": "^3.0.3", - "vinyl-source-stream": "^2.0.0" - }, - "files": [ - "index.js", - "index.d.ts", - "light.d.ts", - "light.js", - "minimal.d.ts", - "minimal.js", - "package-lock.json", - "tsconfig.json", - "scripts/postinstall.js", - "dist/**", - "ext/**", - "google/**", - "src/**" - ] -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/scripts/postinstall.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/scripts/postinstall.js deleted file mode 100644 index bf4ff454..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/scripts/postinstall.js +++ /dev/null @@ -1,32 +0,0 @@ -"use strict"; - -var path = require("path"), - fs = require("fs"), - pkg = require(path.join(__dirname, "..", "package.json")); - -// check version scheme used by dependents -if (!pkg.versionScheme) - return; - -var warn = process.stderr.isTTY - ? "\x1b[30m\x1b[43mWARN\x1b[0m \x1b[35m" + path.basename(process.argv[1], ".js") + "\x1b[0m" - : "WARN " + path.basename(process.argv[1], ".js"); - -var basePkg; -try { - basePkg = JSON.parse(fs.readFileSync(path.join(__dirname, "..", "..", "package.json"))); -} catch (e) { - return; -} - -[ - "dependencies", - "devDependencies", - "optionalDependencies", - "peerDependencies" -] -.forEach(function(check) { - var version = basePkg && basePkg[check] && basePkg[check][pkg.name]; - if (typeof version === "string" && version.charAt(0) !== pkg.versionScheme) - process.stderr.write(pkg.name + " " + warn + " " + pkg.name + "@" + version + " is configured as a dependency of " + basePkg.name + ". use " + pkg.name + "@" + pkg.versionScheme + version.substring(1) + " instead for API compatibility.\n"); -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/src/common.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/src/common.js deleted file mode 100644 index 489ee1c6..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/src/common.js +++ /dev/null @@ -1,399 +0,0 @@ -"use strict"; -module.exports = common; - -var commonRe = /\/|\./; - -/** - * Provides common type definitions. - * Can also be used to provide additional google types or your own custom types. - * @param {string} name Short name as in `google/protobuf/[name].proto` or full file name - * @param {Object.} json JSON definition within `google.protobuf` if a short name, otherwise the file's root definition - * @returns {undefined} - * @property {INamespace} google/protobuf/any.proto Any - * @property {INamespace} google/protobuf/duration.proto Duration - * @property {INamespace} google/protobuf/empty.proto Empty - * @property {INamespace} google/protobuf/field_mask.proto FieldMask - * @property {INamespace} google/protobuf/struct.proto Struct, Value, NullValue and ListValue - * @property {INamespace} google/protobuf/timestamp.proto Timestamp - * @property {INamespace} google/protobuf/wrappers.proto Wrappers - * @example - * // manually provides descriptor.proto (assumes google/protobuf/ namespace and .proto extension) - * protobuf.common("descriptor", descriptorJson); - * - * // manually provides a custom definition (uses my.foo namespace) - * protobuf.common("my/foo/bar.proto", myFooBarJson); - */ -function common(name, json) { - if (!commonRe.test(name)) { - name = "google/protobuf/" + name + ".proto"; - json = { nested: { google: { nested: { protobuf: { nested: json } } } } }; - } - common[name] = json; -} - -// Not provided because of limited use (feel free to discuss or to provide yourself): -// -// google/protobuf/descriptor.proto -// google/protobuf/source_context.proto -// google/protobuf/type.proto -// -// Stripped and pre-parsed versions of these non-bundled files are instead available as part of -// the repository or package within the google/protobuf directory. - -common("any", { - - /** - * Properties of a google.protobuf.Any message. - * @interface IAny - * @type {Object} - * @property {string} [typeUrl] - * @property {Uint8Array} [bytes] - * @memberof common - */ - Any: { - fields: { - type_url: { - type: "string", - id: 1 - }, - value: { - type: "bytes", - id: 2 - } - } - } -}); - -var timeType; - -common("duration", { - - /** - * Properties of a google.protobuf.Duration message. - * @interface IDuration - * @type {Object} - * @property {number|Long} [seconds] - * @property {number} [nanos] - * @memberof common - */ - Duration: timeType = { - fields: { - seconds: { - type: "int64", - id: 1 - }, - nanos: { - type: "int32", - id: 2 - } - } - } -}); - -common("timestamp", { - - /** - * Properties of a google.protobuf.Timestamp message. - * @interface ITimestamp - * @type {Object} - * @property {number|Long} [seconds] - * @property {number} [nanos] - * @memberof common - */ - Timestamp: timeType -}); - -common("empty", { - - /** - * Properties of a google.protobuf.Empty message. - * @interface IEmpty - * @memberof common - */ - Empty: { - fields: {} - } -}); - -common("struct", { - - /** - * Properties of a google.protobuf.Struct message. - * @interface IStruct - * @type {Object} - * @property {Object.} [fields] - * @memberof common - */ - Struct: { - fields: { - fields: { - keyType: "string", - type: "Value", - id: 1 - } - } - }, - - /** - * Properties of a google.protobuf.Value message. - * @interface IValue - * @type {Object} - * @property {string} [kind] - * @property {0} [nullValue] - * @property {number} [numberValue] - * @property {string} [stringValue] - * @property {boolean} [boolValue] - * @property {IStruct} [structValue] - * @property {IListValue} [listValue] - * @memberof common - */ - Value: { - oneofs: { - kind: { - oneof: [ - "nullValue", - "numberValue", - "stringValue", - "boolValue", - "structValue", - "listValue" - ] - } - }, - fields: { - nullValue: { - type: "NullValue", - id: 1 - }, - numberValue: { - type: "double", - id: 2 - }, - stringValue: { - type: "string", - id: 3 - }, - boolValue: { - type: "bool", - id: 4 - }, - structValue: { - type: "Struct", - id: 5 - }, - listValue: { - type: "ListValue", - id: 6 - } - } - }, - - NullValue: { - values: { - NULL_VALUE: 0 - } - }, - - /** - * Properties of a google.protobuf.ListValue message. - * @interface IListValue - * @type {Object} - * @property {Array.} [values] - * @memberof common - */ - ListValue: { - fields: { - values: { - rule: "repeated", - type: "Value", - id: 1 - } - } - } -}); - -common("wrappers", { - - /** - * Properties of a google.protobuf.DoubleValue message. - * @interface IDoubleValue - * @type {Object} - * @property {number} [value] - * @memberof common - */ - DoubleValue: { - fields: { - value: { - type: "double", - id: 1 - } - } - }, - - /** - * Properties of a google.protobuf.FloatValue message. - * @interface IFloatValue - * @type {Object} - * @property {number} [value] - * @memberof common - */ - FloatValue: { - fields: { - value: { - type: "float", - id: 1 - } - } - }, - - /** - * Properties of a google.protobuf.Int64Value message. - * @interface IInt64Value - * @type {Object} - * @property {number|Long} [value] - * @memberof common - */ - Int64Value: { - fields: { - value: { - type: "int64", - id: 1 - } - } - }, - - /** - * Properties of a google.protobuf.UInt64Value message. - * @interface IUInt64Value - * @type {Object} - * @property {number|Long} [value] - * @memberof common - */ - UInt64Value: { - fields: { - value: { - type: "uint64", - id: 1 - } - } - }, - - /** - * Properties of a google.protobuf.Int32Value message. - * @interface IInt32Value - * @type {Object} - * @property {number} [value] - * @memberof common - */ - Int32Value: { - fields: { - value: { - type: "int32", - id: 1 - } - } - }, - - /** - * Properties of a google.protobuf.UInt32Value message. - * @interface IUInt32Value - * @type {Object} - * @property {number} [value] - * @memberof common - */ - UInt32Value: { - fields: { - value: { - type: "uint32", - id: 1 - } - } - }, - - /** - * Properties of a google.protobuf.BoolValue message. - * @interface IBoolValue - * @type {Object} - * @property {boolean} [value] - * @memberof common - */ - BoolValue: { - fields: { - value: { - type: "bool", - id: 1 - } - } - }, - - /** - * Properties of a google.protobuf.StringValue message. - * @interface IStringValue - * @type {Object} - * @property {string} [value] - * @memberof common - */ - StringValue: { - fields: { - value: { - type: "string", - id: 1 - } - } - }, - - /** - * Properties of a google.protobuf.BytesValue message. - * @interface IBytesValue - * @type {Object} - * @property {Uint8Array} [value] - * @memberof common - */ - BytesValue: { - fields: { - value: { - type: "bytes", - id: 1 - } - } - } -}); - -common("field_mask", { - - /** - * Properties of a google.protobuf.FieldMask message. - * @interface IDoubleValue - * @type {Object} - * @property {number} [value] - * @memberof common - */ - FieldMask: { - fields: { - paths: { - rule: "repeated", - type: "string", - id: 1 - } - } - } -}); - -/** - * Gets the root definition of the specified common proto file. - * - * Bundled definitions are: - * - google/protobuf/any.proto - * - google/protobuf/duration.proto - * - google/protobuf/empty.proto - * - google/protobuf/field_mask.proto - * - google/protobuf/struct.proto - * - google/protobuf/timestamp.proto - * - google/protobuf/wrappers.proto - * - * @param {string} file Proto file name - * @returns {INamespace|null} Root definition or `null` if not defined - */ -common.get = function get(file) { - return common[file] || null; -}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/src/converter.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/src/converter.js deleted file mode 100644 index c9e68b5b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/src/converter.js +++ /dev/null @@ -1,301 +0,0 @@ -"use strict"; -/** - * Runtime message from/to plain object converters. - * @namespace - */ -var converter = exports; - -var Enum = require("./enum"), - util = require("./util"); - -/** - * Generates a partial value fromObject conveter. - * @param {Codegen} gen Codegen instance - * @param {Field} field Reflected field - * @param {number} fieldIndex Field index - * @param {string} prop Property reference - * @returns {Codegen} Codegen instance - * @ignore - */ -function genValuePartial_fromObject(gen, field, fieldIndex, prop) { - var defaultAlreadyEmitted = false; - /* eslint-disable no-unexpected-multiline, block-scoped-var, no-redeclare */ - if (field.resolvedType) { - if (field.resolvedType instanceof Enum) { gen - ("switch(d%s){", prop); - for (var values = field.resolvedType.values, keys = Object.keys(values), i = 0; i < keys.length; ++i) { - // enum unknown values passthrough - if (values[keys[i]] === field.typeDefault && !defaultAlreadyEmitted) { gen - ("default:") - ("if(typeof(d%s)===\"number\"){m%s=d%s;break}", prop, prop, prop); - if (!field.repeated) gen // fallback to default value only for - // arrays, to avoid leaving holes. - ("break"); // for non-repeated fields, just ignore - defaultAlreadyEmitted = true; - } - gen - ("case%j:", keys[i]) - ("case %i:", values[keys[i]]) - ("m%s=%j", prop, values[keys[i]]) - ("break"); - } gen - ("}"); - } else gen - ("if(typeof d%s!==\"object\")", prop) - ("throw TypeError(%j)", field.fullName + ": object expected") - ("m%s=types[%i].fromObject(d%s)", prop, fieldIndex, prop); - } else { - var isUnsigned = false; - switch (field.type) { - case "double": - case "float": gen - ("m%s=Number(d%s)", prop, prop); // also catches "NaN", "Infinity" - break; - case "uint32": - case "fixed32": gen - ("m%s=d%s>>>0", prop, prop); - break; - case "int32": - case "sint32": - case "sfixed32": gen - ("m%s=d%s|0", prop, prop); - break; - case "uint64": - isUnsigned = true; - // eslint-disable-line no-fallthrough - case "int64": - case "sint64": - case "fixed64": - case "sfixed64": gen - ("if(util.Long)") - ("(m%s=util.Long.fromValue(d%s)).unsigned=%j", prop, prop, isUnsigned) - ("else if(typeof d%s===\"string\")", prop) - ("m%s=parseInt(d%s,10)", prop, prop) - ("else if(typeof d%s===\"number\")", prop) - ("m%s=d%s", prop, prop) - ("else if(typeof d%s===\"object\")", prop) - ("m%s=new util.LongBits(d%s.low>>>0,d%s.high>>>0).toNumber(%s)", prop, prop, prop, isUnsigned ? "true" : ""); - break; - case "bytes": gen - ("if(typeof d%s===\"string\")", prop) - ("util.base64.decode(d%s,m%s=util.newBuffer(util.base64.length(d%s)),0)", prop, prop, prop) - ("else if(d%s.length >= 0)", prop) - ("m%s=d%s", prop, prop); - break; - case "string": gen - ("m%s=String(d%s)", prop, prop); - break; - case "bool": gen - ("m%s=Boolean(d%s)", prop, prop); - break; - /* default: gen - ("m%s=d%s", prop, prop); - break; */ - } - } - return gen; - /* eslint-enable no-unexpected-multiline, block-scoped-var, no-redeclare */ -} - -/** - * Generates a plain object to runtime message converter specific to the specified message type. - * @param {Type} mtype Message type - * @returns {Codegen} Codegen instance - */ -converter.fromObject = function fromObject(mtype) { - /* eslint-disable no-unexpected-multiline, block-scoped-var, no-redeclare */ - var fields = mtype.fieldsArray; - var gen = util.codegen(["d"], mtype.name + "$fromObject") - ("if(d instanceof this.ctor)") - ("return d"); - if (!fields.length) return gen - ("return new this.ctor"); - gen - ("var m=new this.ctor"); - for (var i = 0; i < fields.length; ++i) { - var field = fields[i].resolve(), - prop = util.safeProp(field.name); - - // Map fields - if (field.map) { gen - ("if(d%s){", prop) - ("if(typeof d%s!==\"object\")", prop) - ("throw TypeError(%j)", field.fullName + ": object expected") - ("m%s={}", prop) - ("for(var ks=Object.keys(d%s),i=0;i>>0,m%s.high>>>0).toNumber(%s):m%s", prop, prop, prop, prop, isUnsigned ? "true": "", prop); - break; - case "bytes": gen - ("d%s=o.bytes===String?util.base64.encode(m%s,0,m%s.length):o.bytes===Array?Array.prototype.slice.call(m%s):m%s", prop, prop, prop, prop, prop); - break; - default: gen - ("d%s=m%s", prop, prop); - break; - } - } - return gen; - /* eslint-enable no-unexpected-multiline, block-scoped-var, no-redeclare */ -} - -/** - * Generates a runtime message to plain object converter specific to the specified message type. - * @param {Type} mtype Message type - * @returns {Codegen} Codegen instance - */ -converter.toObject = function toObject(mtype) { - /* eslint-disable no-unexpected-multiline, block-scoped-var, no-redeclare */ - var fields = mtype.fieldsArray.slice().sort(util.compareFieldsById); - if (!fields.length) - return util.codegen()("return {}"); - var gen = util.codegen(["m", "o"], mtype.name + "$toObject") - ("if(!o)") - ("o={}") - ("var d={}"); - - var repeatedFields = [], - mapFields = [], - normalFields = [], - i = 0; - for (; i < fields.length; ++i) - if (!fields[i].partOf) - ( fields[i].resolve().repeated ? repeatedFields - : fields[i].map ? mapFields - : normalFields).push(fields[i]); - - if (repeatedFields.length) { gen - ("if(o.arrays||o.defaults){"); - for (i = 0; i < repeatedFields.length; ++i) gen - ("d%s=[]", util.safeProp(repeatedFields[i].name)); - gen - ("}"); - } - - if (mapFields.length) { gen - ("if(o.objects||o.defaults){"); - for (i = 0; i < mapFields.length; ++i) gen - ("d%s={}", util.safeProp(mapFields[i].name)); - gen - ("}"); - } - - if (normalFields.length) { gen - ("if(o.defaults){"); - for (i = 0; i < normalFields.length; ++i) { - var field = normalFields[i], - prop = util.safeProp(field.name); - if (field.resolvedType instanceof Enum) gen - ("d%s=o.enums===String?%j:%j", prop, field.resolvedType.valuesById[field.typeDefault], field.typeDefault); - else if (field.long) gen - ("if(util.Long){") - ("var n=new util.Long(%i,%i,%j)", field.typeDefault.low, field.typeDefault.high, field.typeDefault.unsigned) - ("d%s=o.longs===String?n.toString():o.longs===Number?n.toNumber():n", prop) - ("}else") - ("d%s=o.longs===String?%j:%i", prop, field.typeDefault.toString(), field.typeDefault.toNumber()); - else if (field.bytes) { - var arrayDefault = "[" + Array.prototype.slice.call(field.typeDefault).join(",") + "]"; - gen - ("if(o.bytes===String)d%s=%j", prop, String.fromCharCode.apply(String, field.typeDefault)) - ("else{") - ("d%s=%s", prop, arrayDefault) - ("if(o.bytes!==Array)d%s=util.newBuffer(d%s)", prop, prop) - ("}"); - } else gen - ("d%s=%j", prop, field.typeDefault); // also messages (=null) - } gen - ("}"); - } - var hasKs2 = false; - for (i = 0; i < fields.length; ++i) { - var field = fields[i], - index = mtype._fieldsArray.indexOf(field), - prop = util.safeProp(field.name); - if (field.map) { - if (!hasKs2) { hasKs2 = true; gen - ("var ks2"); - } gen - ("if(m%s&&(ks2=Object.keys(m%s)).length){", prop, prop) - ("d%s={}", prop) - ("for(var j=0;j>>3){"); - - var i = 0; - for (; i < /* initializes */ mtype.fieldsArray.length; ++i) { - var field = mtype._fieldsArray[i].resolve(), - type = field.resolvedType instanceof Enum ? "int32" : field.type, - ref = "m" + util.safeProp(field.name); gen - ("case %i: {", field.id); - - // Map fields - if (field.map) { gen - ("if(%s===util.emptyObject)", ref) - ("%s={}", ref) - ("var c2 = r.uint32()+r.pos"); - - if (types.defaults[field.keyType] !== undefined) gen - ("k=%j", types.defaults[field.keyType]); - else gen - ("k=null"); - - if (types.defaults[type] !== undefined) gen - ("value=%j", types.defaults[type]); - else gen - ("value=null"); - - gen - ("while(r.pos>>3){") - ("case 1: k=r.%s(); break", field.keyType) - ("case 2:"); - - if (types.basic[type] === undefined) gen - ("value=types[%i].decode(r,r.uint32())", i); // can't be groups - else gen - ("value=r.%s()", type); - - gen - ("break") - ("default:") - ("r.skipType(tag2&7)") - ("break") - ("}") - ("}"); - - if (types.long[field.keyType] !== undefined) gen - ("%s[typeof k===\"object\"?util.longToHash(k):k]=value", ref); - else gen - ("%s[k]=value", ref); - - // Repeated fields - } else if (field.repeated) { gen - - ("if(!(%s&&%s.length))", ref, ref) - ("%s=[]", ref); - - // Packable (always check for forward and backward compatiblity) - if (types.packed[type] !== undefined) gen - ("if((t&7)===2){") - ("var c2=r.uint32()+r.pos") - ("while(r.pos>> 0, (field.id << 3 | 4) >>> 0) - : gen("types[%i].encode(%s,w.uint32(%i).fork()).ldelim()", fieldIndex, ref, (field.id << 3 | 2) >>> 0); -} - -/** - * Generates an encoder specific to the specified message type. - * @param {Type} mtype Message type - * @returns {Codegen} Codegen instance - */ -function encoder(mtype) { - /* eslint-disable no-unexpected-multiline, block-scoped-var, no-redeclare */ - var gen = util.codegen(["m", "w"], mtype.name + "$encode") - ("if(!w)") - ("w=Writer.create()"); - - var i, ref; - - // "when a message is serialized its known fields should be written sequentially by field number" - var fields = /* initializes */ mtype.fieldsArray.slice().sort(util.compareFieldsById); - - for (var i = 0; i < fields.length; ++i) { - var field = fields[i].resolve(), - index = mtype._fieldsArray.indexOf(field), - type = field.resolvedType instanceof Enum ? "int32" : field.type, - wireType = types.basic[type]; - ref = "m" + util.safeProp(field.name); - - // Map fields - if (field.map) { - gen - ("if(%s!=null&&Object.hasOwnProperty.call(m,%j)){", ref, field.name) // !== undefined && !== null - ("for(var ks=Object.keys(%s),i=0;i>> 0, 8 | types.mapKey[field.keyType], field.keyType); - if (wireType === undefined) gen - ("types[%i].encode(%s[ks[i]],w.uint32(18).fork()).ldelim().ldelim()", index, ref); // can't be groups - else gen - (".uint32(%i).%s(%s[ks[i]]).ldelim()", 16 | wireType, type, ref); - gen - ("}") - ("}"); - - // Repeated fields - } else if (field.repeated) { gen - ("if(%s!=null&&%s.length){", ref, ref); // !== undefined && !== null - - // Packed repeated - if (field.packed && types.packed[type] !== undefined) { gen - - ("w.uint32(%i).fork()", (field.id << 3 | 2) >>> 0) - ("for(var i=0;i<%s.length;++i)", ref) - ("w.%s(%s[i])", type, ref) - ("w.ldelim()"); - - // Non-packed - } else { gen - - ("for(var i=0;i<%s.length;++i)", ref); - if (wireType === undefined) - genTypePartial(gen, field, index, ref + "[i]"); - else gen - ("w.uint32(%i).%s(%s[i])", (field.id << 3 | wireType) >>> 0, type, ref); - - } gen - ("}"); - - // Non-repeated - } else { - if (field.optional) gen - ("if(%s!=null&&Object.hasOwnProperty.call(m,%j))", ref, field.name); // !== undefined && !== null - - if (wireType === undefined) - genTypePartial(gen, field, index, ref); - else gen - ("w.uint32(%i).%s(%s)", (field.id << 3 | wireType) >>> 0, type, ref); - - } - } - - return gen - ("return w"); - /* eslint-enable no-unexpected-multiline, block-scoped-var, no-redeclare */ -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/src/enum.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/src/enum.js deleted file mode 100644 index 1c016209..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/src/enum.js +++ /dev/null @@ -1,198 +0,0 @@ -"use strict"; -module.exports = Enum; - -// extends ReflectionObject -var ReflectionObject = require("./object"); -((Enum.prototype = Object.create(ReflectionObject.prototype)).constructor = Enum).className = "Enum"; - -var Namespace = require("./namespace"), - util = require("./util"); - -/** - * Constructs a new enum instance. - * @classdesc Reflected enum. - * @extends ReflectionObject - * @constructor - * @param {string} name Unique name within its namespace - * @param {Object.} [values] Enum values as an object, by name - * @param {Object.} [options] Declared options - * @param {string} [comment] The comment for this enum - * @param {Object.} [comments] The value comments for this enum - * @param {Object.>|undefined} [valuesOptions] The value options for this enum - */ -function Enum(name, values, options, comment, comments, valuesOptions) { - ReflectionObject.call(this, name, options); - - if (values && typeof values !== "object") - throw TypeError("values must be an object"); - - /** - * Enum values by id. - * @type {Object.} - */ - this.valuesById = {}; - - /** - * Enum values by name. - * @type {Object.} - */ - this.values = Object.create(this.valuesById); // toJSON, marker - - /** - * Enum comment text. - * @type {string|null} - */ - this.comment = comment; - - /** - * Value comment texts, if any. - * @type {Object.} - */ - this.comments = comments || {}; - - /** - * Values options, if any - * @type {Object>|undefined} - */ - this.valuesOptions = valuesOptions; - - /** - * Reserved ranges, if any. - * @type {Array.} - */ - this.reserved = undefined; // toJSON - - // Note that values inherit valuesById on their prototype which makes them a TypeScript- - // compatible enum. This is used by pbts to write actual enum definitions that work for - // static and reflection code alike instead of emitting generic object definitions. - - if (values) - for (var keys = Object.keys(values), i = 0; i < keys.length; ++i) - if (typeof values[keys[i]] === "number") // use forward entries only - this.valuesById[ this.values[keys[i]] = values[keys[i]] ] = keys[i]; -} - -/** - * Enum descriptor. - * @interface IEnum - * @property {Object.} values Enum values - * @property {Object.} [options] Enum options - */ - -/** - * Constructs an enum from an enum descriptor. - * @param {string} name Enum name - * @param {IEnum} json Enum descriptor - * @returns {Enum} Created enum - * @throws {TypeError} If arguments are invalid - */ -Enum.fromJSON = function fromJSON(name, json) { - var enm = new Enum(name, json.values, json.options, json.comment, json.comments); - enm.reserved = json.reserved; - return enm; -}; - -/** - * Converts this enum to an enum descriptor. - * @param {IToJSONOptions} [toJSONOptions] JSON conversion options - * @returns {IEnum} Enum descriptor - */ -Enum.prototype.toJSON = function toJSON(toJSONOptions) { - var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false; - return util.toObject([ - "options" , this.options, - "valuesOptions" , this.valuesOptions, - "values" , this.values, - "reserved" , this.reserved && this.reserved.length ? this.reserved : undefined, - "comment" , keepComments ? this.comment : undefined, - "comments" , keepComments ? this.comments : undefined - ]); -}; - -/** - * Adds a value to this enum. - * @param {string} name Value name - * @param {number} id Value id - * @param {string} [comment] Comment, if any - * @param {Object.|undefined} [options] Options, if any - * @returns {Enum} `this` - * @throws {TypeError} If arguments are invalid - * @throws {Error} If there is already a value with this name or id - */ -Enum.prototype.add = function add(name, id, comment, options) { - // utilized by the parser but not by .fromJSON - - if (!util.isString(name)) - throw TypeError("name must be a string"); - - if (!util.isInteger(id)) - throw TypeError("id must be an integer"); - - if (this.values[name] !== undefined) - throw Error("duplicate name '" + name + "' in " + this); - - if (this.isReservedId(id)) - throw Error("id " + id + " is reserved in " + this); - - if (this.isReservedName(name)) - throw Error("name '" + name + "' is reserved in " + this); - - if (this.valuesById[id] !== undefined) { - if (!(this.options && this.options.allow_alias)) - throw Error("duplicate id " + id + " in " + this); - this.values[name] = id; - } else - this.valuesById[this.values[name] = id] = name; - - if (options) { - if (this.valuesOptions === undefined) - this.valuesOptions = {}; - this.valuesOptions[name] = options || null; - } - - this.comments[name] = comment || null; - return this; -}; - -/** - * Removes a value from this enum - * @param {string} name Value name - * @returns {Enum} `this` - * @throws {TypeError} If arguments are invalid - * @throws {Error} If `name` is not a name of this enum - */ -Enum.prototype.remove = function remove(name) { - - if (!util.isString(name)) - throw TypeError("name must be a string"); - - var val = this.values[name]; - if (val == null) - throw Error("name '" + name + "' does not exist in " + this); - - delete this.valuesById[val]; - delete this.values[name]; - delete this.comments[name]; - if (this.valuesOptions) - delete this.valuesOptions[name]; - - return this; -}; - -/** - * Tests if the specified id is reserved. - * @param {number} id Id to test - * @returns {boolean} `true` if reserved, otherwise `false` - */ -Enum.prototype.isReservedId = function isReservedId(id) { - return Namespace.isReservedId(this.reserved, id); -}; - -/** - * Tests if the specified name is reserved. - * @param {string} name Name to test - * @returns {boolean} `true` if reserved, otherwise `false` - */ -Enum.prototype.isReservedName = function isReservedName(name) { - return Namespace.isReservedName(this.reserved, name); -}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/src/field.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/src/field.js deleted file mode 100644 index e0feb8b4..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/src/field.js +++ /dev/null @@ -1,377 +0,0 @@ -"use strict"; -module.exports = Field; - -// extends ReflectionObject -var ReflectionObject = require("./object"); -((Field.prototype = Object.create(ReflectionObject.prototype)).constructor = Field).className = "Field"; - -var Enum = require("./enum"), - types = require("./types"), - util = require("./util"); - -var Type; // cyclic - -var ruleRe = /^required|optional|repeated$/; - -/** - * Constructs a new message field instance. Note that {@link MapField|map fields} have their own class. - * @name Field - * @classdesc Reflected message field. - * @extends FieldBase - * @constructor - * @param {string} name Unique name within its namespace - * @param {number} id Unique id within its namespace - * @param {string} type Value type - * @param {string|Object.} [rule="optional"] Field rule - * @param {string|Object.} [extend] Extended type if different from parent - * @param {Object.} [options] Declared options - */ - -/** - * Constructs a field from a field descriptor. - * @param {string} name Field name - * @param {IField} json Field descriptor - * @returns {Field} Created field - * @throws {TypeError} If arguments are invalid - */ -Field.fromJSON = function fromJSON(name, json) { - return new Field(name, json.id, json.type, json.rule, json.extend, json.options, json.comment); -}; - -/** - * Not an actual constructor. Use {@link Field} instead. - * @classdesc Base class of all reflected message fields. This is not an actual class but here for the sake of having consistent type definitions. - * @exports FieldBase - * @extends ReflectionObject - * @constructor - * @param {string} name Unique name within its namespace - * @param {number} id Unique id within its namespace - * @param {string} type Value type - * @param {string|Object.} [rule="optional"] Field rule - * @param {string|Object.} [extend] Extended type if different from parent - * @param {Object.} [options] Declared options - * @param {string} [comment] Comment associated with this field - */ -function Field(name, id, type, rule, extend, options, comment) { - - if (util.isObject(rule)) { - comment = extend; - options = rule; - rule = extend = undefined; - } else if (util.isObject(extend)) { - comment = options; - options = extend; - extend = undefined; - } - - ReflectionObject.call(this, name, options); - - if (!util.isInteger(id) || id < 0) - throw TypeError("id must be a non-negative integer"); - - if (!util.isString(type)) - throw TypeError("type must be a string"); - - if (rule !== undefined && !ruleRe.test(rule = rule.toString().toLowerCase())) - throw TypeError("rule must be a string rule"); - - if (extend !== undefined && !util.isString(extend)) - throw TypeError("extend must be a string"); - - /** - * Field rule, if any. - * @type {string|undefined} - */ - if (rule === "proto3_optional") { - rule = "optional"; - } - this.rule = rule && rule !== "optional" ? rule : undefined; // toJSON - - /** - * Field type. - * @type {string} - */ - this.type = type; // toJSON - - /** - * Unique field id. - * @type {number} - */ - this.id = id; // toJSON, marker - - /** - * Extended type if different from parent. - * @type {string|undefined} - */ - this.extend = extend || undefined; // toJSON - - /** - * Whether this field is required. - * @type {boolean} - */ - this.required = rule === "required"; - - /** - * Whether this field is optional. - * @type {boolean} - */ - this.optional = !this.required; - - /** - * Whether this field is repeated. - * @type {boolean} - */ - this.repeated = rule === "repeated"; - - /** - * Whether this field is a map or not. - * @type {boolean} - */ - this.map = false; - - /** - * Message this field belongs to. - * @type {Type|null} - */ - this.message = null; - - /** - * OneOf this field belongs to, if any, - * @type {OneOf|null} - */ - this.partOf = null; - - /** - * The field type's default value. - * @type {*} - */ - this.typeDefault = null; - - /** - * The field's default value on prototypes. - * @type {*} - */ - this.defaultValue = null; - - /** - * Whether this field's value should be treated as a long. - * @type {boolean} - */ - this.long = util.Long ? types.long[type] !== undefined : /* istanbul ignore next */ false; - - /** - * Whether this field's value is a buffer. - * @type {boolean} - */ - this.bytes = type === "bytes"; - - /** - * Resolved type if not a basic type. - * @type {Type|Enum|null} - */ - this.resolvedType = null; - - /** - * Sister-field within the extended type if a declaring extension field. - * @type {Field|null} - */ - this.extensionField = null; - - /** - * Sister-field within the declaring namespace if an extended field. - * @type {Field|null} - */ - this.declaringField = null; - - /** - * Internally remembers whether this field is packed. - * @type {boolean|null} - * @private - */ - this._packed = null; - - /** - * Comment for this field. - * @type {string|null} - */ - this.comment = comment; -} - -/** - * Determines whether this field is packed. Only relevant when repeated and working with proto2. - * @name Field#packed - * @type {boolean} - * @readonly - */ -Object.defineProperty(Field.prototype, "packed", { - get: function() { - // defaults to packed=true if not explicity set to false - if (this._packed === null) - this._packed = this.getOption("packed") !== false; - return this._packed; - } -}); - -/** - * @override - */ -Field.prototype.setOption = function setOption(name, value, ifNotSet) { - if (name === "packed") // clear cached before setting - this._packed = null; - return ReflectionObject.prototype.setOption.call(this, name, value, ifNotSet); -}; - -/** - * Field descriptor. - * @interface IField - * @property {string} [rule="optional"] Field rule - * @property {string} type Field type - * @property {number} id Field id - * @property {Object.} [options] Field options - */ - -/** - * Extension field descriptor. - * @interface IExtensionField - * @extends IField - * @property {string} extend Extended type - */ - -/** - * Converts this field to a field descriptor. - * @param {IToJSONOptions} [toJSONOptions] JSON conversion options - * @returns {IField} Field descriptor - */ -Field.prototype.toJSON = function toJSON(toJSONOptions) { - var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false; - return util.toObject([ - "rule" , this.rule !== "optional" && this.rule || undefined, - "type" , this.type, - "id" , this.id, - "extend" , this.extend, - "options" , this.options, - "comment" , keepComments ? this.comment : undefined - ]); -}; - -/** - * Resolves this field's type references. - * @returns {Field} `this` - * @throws {Error} If any reference cannot be resolved - */ -Field.prototype.resolve = function resolve() { - - if (this.resolved) - return this; - - if ((this.typeDefault = types.defaults[this.type]) === undefined) { // if not a basic type, resolve it - this.resolvedType = (this.declaringField ? this.declaringField.parent : this.parent).lookupTypeOrEnum(this.type); - if (this.resolvedType instanceof Type) - this.typeDefault = null; - else // instanceof Enum - this.typeDefault = this.resolvedType.values[Object.keys(this.resolvedType.values)[0]]; // first defined - } else if (this.options && this.options.proto3_optional) { - // proto3 scalar value marked optional; should default to null - this.typeDefault = null; - } - - // use explicitly set default value if present - if (this.options && this.options["default"] != null) { - this.typeDefault = this.options["default"]; - if (this.resolvedType instanceof Enum && typeof this.typeDefault === "string") - this.typeDefault = this.resolvedType.values[this.typeDefault]; - } - - // remove unnecessary options - if (this.options) { - if (this.options.packed === true || this.options.packed !== undefined && this.resolvedType && !(this.resolvedType instanceof Enum)) - delete this.options.packed; - if (!Object.keys(this.options).length) - this.options = undefined; - } - - // convert to internal data type if necesssary - if (this.long) { - this.typeDefault = util.Long.fromNumber(this.typeDefault, this.type.charAt(0) === "u"); - - /* istanbul ignore else */ - if (Object.freeze) - Object.freeze(this.typeDefault); // long instances are meant to be immutable anyway (i.e. use small int cache that even requires it) - - } else if (this.bytes && typeof this.typeDefault === "string") { - var buf; - if (util.base64.test(this.typeDefault)) - util.base64.decode(this.typeDefault, buf = util.newBuffer(util.base64.length(this.typeDefault)), 0); - else - util.utf8.write(this.typeDefault, buf = util.newBuffer(util.utf8.length(this.typeDefault)), 0); - this.typeDefault = buf; - } - - // take special care of maps and repeated fields - if (this.map) - this.defaultValue = util.emptyObject; - else if (this.repeated) - this.defaultValue = util.emptyArray; - else - this.defaultValue = this.typeDefault; - - // ensure proper value on prototype - if (this.parent instanceof Type) - this.parent.ctor.prototype[this.name] = this.defaultValue; - - return ReflectionObject.prototype.resolve.call(this); -}; - -/** - * Decorator function as returned by {@link Field.d} and {@link MapField.d} (TypeScript). - * @typedef FieldDecorator - * @type {function} - * @param {Object} prototype Target prototype - * @param {string} fieldName Field name - * @returns {undefined} - */ - -/** - * Field decorator (TypeScript). - * @name Field.d - * @function - * @param {number} fieldId Field id - * @param {"double"|"float"|"int32"|"uint32"|"sint32"|"fixed32"|"sfixed32"|"int64"|"uint64"|"sint64"|"fixed64"|"sfixed64"|"string"|"bool"|"bytes"|Object} fieldType Field type - * @param {"optional"|"required"|"repeated"} [fieldRule="optional"] Field rule - * @param {T} [defaultValue] Default value - * @returns {FieldDecorator} Decorator function - * @template T extends number | number[] | Long | Long[] | string | string[] | boolean | boolean[] | Uint8Array | Uint8Array[] | Buffer | Buffer[] - */ -Field.d = function decorateField(fieldId, fieldType, fieldRule, defaultValue) { - - // submessage: decorate the submessage and use its name as the type - if (typeof fieldType === "function") - fieldType = util.decorateType(fieldType).name; - - // enum reference: create a reflected copy of the enum and keep reuseing it - else if (fieldType && typeof fieldType === "object") - fieldType = util.decorateEnum(fieldType).name; - - return function fieldDecorator(prototype, fieldName) { - util.decorateType(prototype.constructor) - .add(new Field(fieldName, fieldId, fieldType, fieldRule, { "default": defaultValue })); - }; -}; - -/** - * Field decorator (TypeScript). - * @name Field.d - * @function - * @param {number} fieldId Field id - * @param {Constructor|string} fieldType Field type - * @param {"optional"|"required"|"repeated"} [fieldRule="optional"] Field rule - * @returns {FieldDecorator} Decorator function - * @template T extends Message - * @variation 2 - */ -// like Field.d but without a default value - -// Sets up cyclic dependencies (called in index-light) -Field._configure = function configure(Type_) { - Type = Type_; -}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/src/index-light.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/src/index-light.js deleted file mode 100644 index 32c6a05c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/src/index-light.js +++ /dev/null @@ -1,104 +0,0 @@ -"use strict"; -var protobuf = module.exports = require("./index-minimal"); - -protobuf.build = "light"; - -/** - * A node-style callback as used by {@link load} and {@link Root#load}. - * @typedef LoadCallback - * @type {function} - * @param {Error|null} error Error, if any, otherwise `null` - * @param {Root} [root] Root, if there hasn't been an error - * @returns {undefined} - */ - -/** - * Loads one or multiple .proto or preprocessed .json files into a common root namespace and calls the callback. - * @param {string|string[]} filename One or multiple files to load - * @param {Root} root Root namespace, defaults to create a new one if omitted. - * @param {LoadCallback} callback Callback function - * @returns {undefined} - * @see {@link Root#load} - */ -function load(filename, root, callback) { - if (typeof root === "function") { - callback = root; - root = new protobuf.Root(); - } else if (!root) - root = new protobuf.Root(); - return root.load(filename, callback); -} - -/** - * Loads one or multiple .proto or preprocessed .json files into a common root namespace and calls the callback. - * @name load - * @function - * @param {string|string[]} filename One or multiple files to load - * @param {LoadCallback} callback Callback function - * @returns {undefined} - * @see {@link Root#load} - * @variation 2 - */ -// function load(filename:string, callback:LoadCallback):undefined - -/** - * Loads one or multiple .proto or preprocessed .json files into a common root namespace and returns a promise. - * @name load - * @function - * @param {string|string[]} filename One or multiple files to load - * @param {Root} [root] Root namespace, defaults to create a new one if omitted. - * @returns {Promise} Promise - * @see {@link Root#load} - * @variation 3 - */ -// function load(filename:string, [root:Root]):Promise - -protobuf.load = load; - -/** - * Synchronously loads one or multiple .proto or preprocessed .json files into a common root namespace (node only). - * @param {string|string[]} filename One or multiple files to load - * @param {Root} [root] Root namespace, defaults to create a new one if omitted. - * @returns {Root} Root namespace - * @throws {Error} If synchronous fetching is not supported (i.e. in browsers) or if a file's syntax is invalid - * @see {@link Root#loadSync} - */ -function loadSync(filename, root) { - if (!root) - root = new protobuf.Root(); - return root.loadSync(filename); -} - -protobuf.loadSync = loadSync; - -// Serialization -protobuf.encoder = require("./encoder"); -protobuf.decoder = require("./decoder"); -protobuf.verifier = require("./verifier"); -protobuf.converter = require("./converter"); - -// Reflection -protobuf.ReflectionObject = require("./object"); -protobuf.Namespace = require("./namespace"); -protobuf.Root = require("./root"); -protobuf.Enum = require("./enum"); -protobuf.Type = require("./type"); -protobuf.Field = require("./field"); -protobuf.OneOf = require("./oneof"); -protobuf.MapField = require("./mapfield"); -protobuf.Service = require("./service"); -protobuf.Method = require("./method"); - -// Runtime -protobuf.Message = require("./message"); -protobuf.wrappers = require("./wrappers"); - -// Utility -protobuf.types = require("./types"); -protobuf.util = require("./util"); - -// Set up possibly cyclic reflection dependencies -protobuf.ReflectionObject._configure(protobuf.Root); -protobuf.Namespace._configure(protobuf.Type, protobuf.Service, protobuf.Enum); -protobuf.Root._configure(protobuf.Type); -protobuf.Field._configure(protobuf.Type); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/src/index-minimal.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/src/index-minimal.js deleted file mode 100644 index 1f4aaea6..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/src/index-minimal.js +++ /dev/null @@ -1,36 +0,0 @@ -"use strict"; -var protobuf = exports; - -/** - * Build type, one of `"full"`, `"light"` or `"minimal"`. - * @name build - * @type {string} - * @const - */ -protobuf.build = "minimal"; - -// Serialization -protobuf.Writer = require("./writer"); -protobuf.BufferWriter = require("./writer_buffer"); -protobuf.Reader = require("./reader"); -protobuf.BufferReader = require("./reader_buffer"); - -// Utility -protobuf.util = require("./util/minimal"); -protobuf.rpc = require("./rpc"); -protobuf.roots = require("./roots"); -protobuf.configure = configure; - -/* istanbul ignore next */ -/** - * Reconfigures the library according to the environment. - * @returns {undefined} - */ -function configure() { - protobuf.util._configure(); - protobuf.Writer._configure(protobuf.BufferWriter); - protobuf.Reader._configure(protobuf.BufferReader); -} - -// Set up buffer utility according to the environment -configure(); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/src/index.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/src/index.js deleted file mode 100644 index 56bd3d5d..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/src/index.js +++ /dev/null @@ -1,12 +0,0 @@ -"use strict"; -var protobuf = module.exports = require("./index-light"); - -protobuf.build = "full"; - -// Parser -protobuf.tokenize = require("./tokenize"); -protobuf.parse = require("./parse"); -protobuf.common = require("./common"); - -// Configure parser -protobuf.Root._configure(protobuf.Type, protobuf.parse, protobuf.common); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/src/mapfield.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/src/mapfield.js deleted file mode 100644 index 67c70978..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/src/mapfield.js +++ /dev/null @@ -1,126 +0,0 @@ -"use strict"; -module.exports = MapField; - -// extends Field -var Field = require("./field"); -((MapField.prototype = Object.create(Field.prototype)).constructor = MapField).className = "MapField"; - -var types = require("./types"), - util = require("./util"); - -/** - * Constructs a new map field instance. - * @classdesc Reflected map field. - * @extends FieldBase - * @constructor - * @param {string} name Unique name within its namespace - * @param {number} id Unique id within its namespace - * @param {string} keyType Key type - * @param {string} type Value type - * @param {Object.} [options] Declared options - * @param {string} [comment] Comment associated with this field - */ -function MapField(name, id, keyType, type, options, comment) { - Field.call(this, name, id, type, undefined, undefined, options, comment); - - /* istanbul ignore if */ - if (!util.isString(keyType)) - throw TypeError("keyType must be a string"); - - /** - * Key type. - * @type {string} - */ - this.keyType = keyType; // toJSON, marker - - /** - * Resolved key type if not a basic type. - * @type {ReflectionObject|null} - */ - this.resolvedKeyType = null; - - // Overrides Field#map - this.map = true; -} - -/** - * Map field descriptor. - * @interface IMapField - * @extends {IField} - * @property {string} keyType Key type - */ - -/** - * Extension map field descriptor. - * @interface IExtensionMapField - * @extends IMapField - * @property {string} extend Extended type - */ - -/** - * Constructs a map field from a map field descriptor. - * @param {string} name Field name - * @param {IMapField} json Map field descriptor - * @returns {MapField} Created map field - * @throws {TypeError} If arguments are invalid - */ -MapField.fromJSON = function fromJSON(name, json) { - return new MapField(name, json.id, json.keyType, json.type, json.options, json.comment); -}; - -/** - * Converts this map field to a map field descriptor. - * @param {IToJSONOptions} [toJSONOptions] JSON conversion options - * @returns {IMapField} Map field descriptor - */ -MapField.prototype.toJSON = function toJSON(toJSONOptions) { - var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false; - return util.toObject([ - "keyType" , this.keyType, - "type" , this.type, - "id" , this.id, - "extend" , this.extend, - "options" , this.options, - "comment" , keepComments ? this.comment : undefined - ]); -}; - -/** - * @override - */ -MapField.prototype.resolve = function resolve() { - if (this.resolved) - return this; - - // Besides a value type, map fields have a key type that may be "any scalar type except for floating point types and bytes" - if (types.mapKey[this.keyType] === undefined) - throw Error("invalid key type: " + this.keyType); - - return Field.prototype.resolve.call(this); -}; - -/** - * Map field decorator (TypeScript). - * @name MapField.d - * @function - * @param {number} fieldId Field id - * @param {"int32"|"uint32"|"sint32"|"fixed32"|"sfixed32"|"int64"|"uint64"|"sint64"|"fixed64"|"sfixed64"|"bool"|"string"} fieldKeyType Field key type - * @param {"double"|"float"|"int32"|"uint32"|"sint32"|"fixed32"|"sfixed32"|"int64"|"uint64"|"sint64"|"fixed64"|"sfixed64"|"bool"|"string"|"bytes"|Object|Constructor<{}>} fieldValueType Field value type - * @returns {FieldDecorator} Decorator function - * @template T extends { [key: string]: number | Long | string | boolean | Uint8Array | Buffer | number[] | Message<{}> } - */ -MapField.d = function decorateMapField(fieldId, fieldKeyType, fieldValueType) { - - // submessage value: decorate the submessage and use its name as the type - if (typeof fieldValueType === "function") - fieldValueType = util.decorateType(fieldValueType).name; - - // enum reference value: create a reflected copy of the enum and keep reuseing it - else if (fieldValueType && typeof fieldValueType === "object") - fieldValueType = util.decorateEnum(fieldValueType).name; - - return function mapFieldDecorator(prototype, fieldName) { - util.decorateType(prototype.constructor) - .add(new MapField(fieldName, fieldId, fieldKeyType, fieldValueType)); - }; -}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/src/message.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/src/message.js deleted file mode 100644 index 3f94bf6a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/src/message.js +++ /dev/null @@ -1,139 +0,0 @@ -"use strict"; -module.exports = Message; - -var util = require("./util/minimal"); - -/** - * Constructs a new message instance. - * @classdesc Abstract runtime message. - * @constructor - * @param {Properties} [properties] Properties to set - * @template T extends object = object - */ -function Message(properties) { - // not used internally - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - this[keys[i]] = properties[keys[i]]; -} - -/** - * Reference to the reflected type. - * @name Message.$type - * @type {Type} - * @readonly - */ - -/** - * Reference to the reflected type. - * @name Message#$type - * @type {Type} - * @readonly - */ - -/*eslint-disable valid-jsdoc*/ - -/** - * Creates a new message of this type using the specified properties. - * @param {Object.} [properties] Properties to set - * @returns {Message} Message instance - * @template T extends Message - * @this Constructor - */ -Message.create = function create(properties) { - return this.$type.create(properties); -}; - -/** - * Encodes a message of this type. - * @param {T|Object.} message Message to encode - * @param {Writer} [writer] Writer to use - * @returns {Writer} Writer - * @template T extends Message - * @this Constructor - */ -Message.encode = function encode(message, writer) { - return this.$type.encode(message, writer); -}; - -/** - * Encodes a message of this type preceeded by its length as a varint. - * @param {T|Object.} message Message to encode - * @param {Writer} [writer] Writer to use - * @returns {Writer} Writer - * @template T extends Message - * @this Constructor - */ -Message.encodeDelimited = function encodeDelimited(message, writer) { - return this.$type.encodeDelimited(message, writer); -}; - -/** - * Decodes a message of this type. - * @name Message.decode - * @function - * @param {Reader|Uint8Array} reader Reader or buffer to decode - * @returns {T} Decoded message - * @template T extends Message - * @this Constructor - */ -Message.decode = function decode(reader) { - return this.$type.decode(reader); -}; - -/** - * Decodes a message of this type preceeded by its length as a varint. - * @name Message.decodeDelimited - * @function - * @param {Reader|Uint8Array} reader Reader or buffer to decode - * @returns {T} Decoded message - * @template T extends Message - * @this Constructor - */ -Message.decodeDelimited = function decodeDelimited(reader) { - return this.$type.decodeDelimited(reader); -}; - -/** - * Verifies a message of this type. - * @name Message.verify - * @function - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ -Message.verify = function verify(message) { - return this.$type.verify(message); -}; - -/** - * Creates a new message of this type from a plain object. Also converts values to their respective internal types. - * @param {Object.} object Plain object - * @returns {T} Message instance - * @template T extends Message - * @this Constructor - */ -Message.fromObject = function fromObject(object) { - return this.$type.fromObject(object); -}; - -/** - * Creates a plain object from a message of this type. Also converts values to other types if specified. - * @param {T} message Message instance - * @param {IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - * @template T extends Message - * @this Constructor - */ -Message.toObject = function toObject(message, options) { - return this.$type.toObject(message, options); -}; - -/** - * Converts this message to JSON. - * @returns {Object.} JSON object - */ -Message.prototype.toJSON = function toJSON() { - return this.$type.toObject(this, util.toJSONOptions); -}; - -/*eslint-enable valid-jsdoc*/ \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/src/method.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/src/method.js deleted file mode 100644 index 18a6ab2c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/src/method.js +++ /dev/null @@ -1,160 +0,0 @@ -"use strict"; -module.exports = Method; - -// extends ReflectionObject -var ReflectionObject = require("./object"); -((Method.prototype = Object.create(ReflectionObject.prototype)).constructor = Method).className = "Method"; - -var util = require("./util"); - -/** - * Constructs a new service method instance. - * @classdesc Reflected service method. - * @extends ReflectionObject - * @constructor - * @param {string} name Method name - * @param {string|undefined} type Method type, usually `"rpc"` - * @param {string} requestType Request message type - * @param {string} responseType Response message type - * @param {boolean|Object.} [requestStream] Whether the request is streamed - * @param {boolean|Object.} [responseStream] Whether the response is streamed - * @param {Object.} [options] Declared options - * @param {string} [comment] The comment for this method - * @param {Object.} [parsedOptions] Declared options, properly parsed into an object - */ -function Method(name, type, requestType, responseType, requestStream, responseStream, options, comment, parsedOptions) { - - /* istanbul ignore next */ - if (util.isObject(requestStream)) { - options = requestStream; - requestStream = responseStream = undefined; - } else if (util.isObject(responseStream)) { - options = responseStream; - responseStream = undefined; - } - - /* istanbul ignore if */ - if (!(type === undefined || util.isString(type))) - throw TypeError("type must be a string"); - - /* istanbul ignore if */ - if (!util.isString(requestType)) - throw TypeError("requestType must be a string"); - - /* istanbul ignore if */ - if (!util.isString(responseType)) - throw TypeError("responseType must be a string"); - - ReflectionObject.call(this, name, options); - - /** - * Method type. - * @type {string} - */ - this.type = type || "rpc"; // toJSON - - /** - * Request type. - * @type {string} - */ - this.requestType = requestType; // toJSON, marker - - /** - * Whether requests are streamed or not. - * @type {boolean|undefined} - */ - this.requestStream = requestStream ? true : undefined; // toJSON - - /** - * Response type. - * @type {string} - */ - this.responseType = responseType; // toJSON - - /** - * Whether responses are streamed or not. - * @type {boolean|undefined} - */ - this.responseStream = responseStream ? true : undefined; // toJSON - - /** - * Resolved request type. - * @type {Type|null} - */ - this.resolvedRequestType = null; - - /** - * Resolved response type. - * @type {Type|null} - */ - this.resolvedResponseType = null; - - /** - * Comment for this method - * @type {string|null} - */ - this.comment = comment; - - /** - * Options properly parsed into an object - */ - this.parsedOptions = parsedOptions; -} - -/** - * Method descriptor. - * @interface IMethod - * @property {string} [type="rpc"] Method type - * @property {string} requestType Request type - * @property {string} responseType Response type - * @property {boolean} [requestStream=false] Whether requests are streamed - * @property {boolean} [responseStream=false] Whether responses are streamed - * @property {Object.} [options] Method options - * @property {string} comment Method comments - * @property {Object.} [parsedOptions] Method options properly parsed into an object - */ - -/** - * Constructs a method from a method descriptor. - * @param {string} name Method name - * @param {IMethod} json Method descriptor - * @returns {Method} Created method - * @throws {TypeError} If arguments are invalid - */ -Method.fromJSON = function fromJSON(name, json) { - return new Method(name, json.type, json.requestType, json.responseType, json.requestStream, json.responseStream, json.options, json.comment, json.parsedOptions); -}; - -/** - * Converts this method to a method descriptor. - * @param {IToJSONOptions} [toJSONOptions] JSON conversion options - * @returns {IMethod} Method descriptor - */ -Method.prototype.toJSON = function toJSON(toJSONOptions) { - var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false; - return util.toObject([ - "type" , this.type !== "rpc" && /* istanbul ignore next */ this.type || undefined, - "requestType" , this.requestType, - "requestStream" , this.requestStream, - "responseType" , this.responseType, - "responseStream" , this.responseStream, - "options" , this.options, - "comment" , keepComments ? this.comment : undefined, - "parsedOptions" , this.parsedOptions, - ]); -}; - -/** - * @override - */ -Method.prototype.resolve = function resolve() { - - /* istanbul ignore if */ - if (this.resolved) - return this; - - this.resolvedRequestType = this.parent.lookupType(this.requestType); - this.resolvedResponseType = this.parent.lookupType(this.responseType); - - return ReflectionObject.prototype.resolve.call(this); -}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/src/namespace.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/src/namespace.js deleted file mode 100644 index 731afc75..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/src/namespace.js +++ /dev/null @@ -1,433 +0,0 @@ -"use strict"; -module.exports = Namespace; - -// extends ReflectionObject -var ReflectionObject = require("./object"); -((Namespace.prototype = Object.create(ReflectionObject.prototype)).constructor = Namespace).className = "Namespace"; - -var Field = require("./field"), - util = require("./util"), - OneOf = require("./oneof"); - -var Type, // cyclic - Service, - Enum; - -/** - * Constructs a new namespace instance. - * @name Namespace - * @classdesc Reflected namespace. - * @extends NamespaceBase - * @constructor - * @param {string} name Namespace name - * @param {Object.} [options] Declared options - */ - -/** - * Constructs a namespace from JSON. - * @memberof Namespace - * @function - * @param {string} name Namespace name - * @param {Object.} json JSON object - * @returns {Namespace} Created namespace - * @throws {TypeError} If arguments are invalid - */ -Namespace.fromJSON = function fromJSON(name, json) { - return new Namespace(name, json.options).addJSON(json.nested); -}; - -/** - * Converts an array of reflection objects to JSON. - * @memberof Namespace - * @param {ReflectionObject[]} array Object array - * @param {IToJSONOptions} [toJSONOptions] JSON conversion options - * @returns {Object.|undefined} JSON object or `undefined` when array is empty - */ -function arrayToJSON(array, toJSONOptions) { - if (!(array && array.length)) - return undefined; - var obj = {}; - for (var i = 0; i < array.length; ++i) - obj[array[i].name] = array[i].toJSON(toJSONOptions); - return obj; -} - -Namespace.arrayToJSON = arrayToJSON; - -/** - * Tests if the specified id is reserved. - * @param {Array.|undefined} reserved Array of reserved ranges and names - * @param {number} id Id to test - * @returns {boolean} `true` if reserved, otherwise `false` - */ -Namespace.isReservedId = function isReservedId(reserved, id) { - if (reserved) - for (var i = 0; i < reserved.length; ++i) - if (typeof reserved[i] !== "string" && reserved[i][0] <= id && reserved[i][1] > id) - return true; - return false; -}; - -/** - * Tests if the specified name is reserved. - * @param {Array.|undefined} reserved Array of reserved ranges and names - * @param {string} name Name to test - * @returns {boolean} `true` if reserved, otherwise `false` - */ -Namespace.isReservedName = function isReservedName(reserved, name) { - if (reserved) - for (var i = 0; i < reserved.length; ++i) - if (reserved[i] === name) - return true; - return false; -}; - -/** - * Not an actual constructor. Use {@link Namespace} instead. - * @classdesc Base class of all reflection objects containing nested objects. This is not an actual class but here for the sake of having consistent type definitions. - * @exports NamespaceBase - * @extends ReflectionObject - * @abstract - * @constructor - * @param {string} name Namespace name - * @param {Object.} [options] Declared options - * @see {@link Namespace} - */ -function Namespace(name, options) { - ReflectionObject.call(this, name, options); - - /** - * Nested objects by name. - * @type {Object.|undefined} - */ - this.nested = undefined; // toJSON - - /** - * Cached nested objects as an array. - * @type {ReflectionObject[]|null} - * @private - */ - this._nestedArray = null; -} - -function clearCache(namespace) { - namespace._nestedArray = null; - return namespace; -} - -/** - * Nested objects of this namespace as an array for iteration. - * @name NamespaceBase#nestedArray - * @type {ReflectionObject[]} - * @readonly - */ -Object.defineProperty(Namespace.prototype, "nestedArray", { - get: function() { - return this._nestedArray || (this._nestedArray = util.toArray(this.nested)); - } -}); - -/** - * Namespace descriptor. - * @interface INamespace - * @property {Object.} [options] Namespace options - * @property {Object.} [nested] Nested object descriptors - */ - -/** - * Any extension field descriptor. - * @typedef AnyExtensionField - * @type {IExtensionField|IExtensionMapField} - */ - -/** - * Any nested object descriptor. - * @typedef AnyNestedObject - * @type {IEnum|IType|IService|AnyExtensionField|INamespace|IOneOf} - */ - -/** - * Converts this namespace to a namespace descriptor. - * @param {IToJSONOptions} [toJSONOptions] JSON conversion options - * @returns {INamespace} Namespace descriptor - */ -Namespace.prototype.toJSON = function toJSON(toJSONOptions) { - return util.toObject([ - "options" , this.options, - "nested" , arrayToJSON(this.nestedArray, toJSONOptions) - ]); -}; - -/** - * Adds nested objects to this namespace from nested object descriptors. - * @param {Object.} nestedJson Any nested object descriptors - * @returns {Namespace} `this` - */ -Namespace.prototype.addJSON = function addJSON(nestedJson) { - var ns = this; - /* istanbul ignore else */ - if (nestedJson) { - for (var names = Object.keys(nestedJson), i = 0, nested; i < names.length; ++i) { - nested = nestedJson[names[i]]; - ns.add( // most to least likely - ( nested.fields !== undefined - ? Type.fromJSON - : nested.values !== undefined - ? Enum.fromJSON - : nested.methods !== undefined - ? Service.fromJSON - : nested.id !== undefined - ? Field.fromJSON - : Namespace.fromJSON )(names[i], nested) - ); - } - } - return this; -}; - -/** - * Gets the nested object of the specified name. - * @param {string} name Nested object name - * @returns {ReflectionObject|null} The reflection object or `null` if it doesn't exist - */ -Namespace.prototype.get = function get(name) { - return this.nested && this.nested[name] - || null; -}; - -/** - * Gets the values of the nested {@link Enum|enum} of the specified name. - * This methods differs from {@link Namespace#get|get} in that it returns an enum's values directly and throws instead of returning `null`. - * @param {string} name Nested enum name - * @returns {Object.} Enum values - * @throws {Error} If there is no such enum - */ -Namespace.prototype.getEnum = function getEnum(name) { - if (this.nested && this.nested[name] instanceof Enum) - return this.nested[name].values; - throw Error("no such enum: " + name); -}; - -/** - * Adds a nested object to this namespace. - * @param {ReflectionObject} object Nested object to add - * @returns {Namespace} `this` - * @throws {TypeError} If arguments are invalid - * @throws {Error} If there is already a nested object with this name - */ -Namespace.prototype.add = function add(object) { - - if (!(object instanceof Field && object.extend !== undefined || object instanceof Type || object instanceof OneOf || object instanceof Enum || object instanceof Service || object instanceof Namespace)) - throw TypeError("object must be a valid nested object"); - - if (!this.nested) - this.nested = {}; - else { - var prev = this.get(object.name); - if (prev) { - if (prev instanceof Namespace && object instanceof Namespace && !(prev instanceof Type || prev instanceof Service)) { - // replace plain namespace but keep existing nested elements and options - var nested = prev.nestedArray; - for (var i = 0; i < nested.length; ++i) - object.add(nested[i]); - this.remove(prev); - if (!this.nested) - this.nested = {}; - object.setOptions(prev.options, true); - - } else - throw Error("duplicate name '" + object.name + "' in " + this); - } - } - this.nested[object.name] = object; - object.onAdd(this); - return clearCache(this); -}; - -/** - * Removes a nested object from this namespace. - * @param {ReflectionObject} object Nested object to remove - * @returns {Namespace} `this` - * @throws {TypeError} If arguments are invalid - * @throws {Error} If `object` is not a member of this namespace - */ -Namespace.prototype.remove = function remove(object) { - - if (!(object instanceof ReflectionObject)) - throw TypeError("object must be a ReflectionObject"); - if (object.parent !== this) - throw Error(object + " is not a member of " + this); - - delete this.nested[object.name]; - if (!Object.keys(this.nested).length) - this.nested = undefined; - - object.onRemove(this); - return clearCache(this); -}; - -/** - * Defines additial namespaces within this one if not yet existing. - * @param {string|string[]} path Path to create - * @param {*} [json] Nested types to create from JSON - * @returns {Namespace} Pointer to the last namespace created or `this` if path is empty - */ -Namespace.prototype.define = function define(path, json) { - - if (util.isString(path)) - path = path.split("."); - else if (!Array.isArray(path)) - throw TypeError("illegal path"); - if (path && path.length && path[0] === "") - throw Error("path must be relative"); - - var ptr = this; - while (path.length > 0) { - var part = path.shift(); - if (ptr.nested && ptr.nested[part]) { - ptr = ptr.nested[part]; - if (!(ptr instanceof Namespace)) - throw Error("path conflicts with non-namespace objects"); - } else - ptr.add(ptr = new Namespace(part)); - } - if (json) - ptr.addJSON(json); - return ptr; -}; - -/** - * Resolves this namespace's and all its nested objects' type references. Useful to validate a reflection tree, but comes at a cost. - * @returns {Namespace} `this` - */ -Namespace.prototype.resolveAll = function resolveAll() { - var nested = this.nestedArray, i = 0; - while (i < nested.length) - if (nested[i] instanceof Namespace) - nested[i++].resolveAll(); - else - nested[i++].resolve(); - return this.resolve(); -}; - -/** - * Recursively looks up the reflection object matching the specified path in the scope of this namespace. - * @param {string|string[]} path Path to look up - * @param {*|Array.<*>} filterTypes Filter types, any combination of the constructors of `protobuf.Type`, `protobuf.Enum`, `protobuf.Service` etc. - * @param {boolean} [parentAlreadyChecked=false] If known, whether the parent has already been checked - * @returns {ReflectionObject|null} Looked up object or `null` if none could be found - */ -Namespace.prototype.lookup = function lookup(path, filterTypes, parentAlreadyChecked) { - - /* istanbul ignore next */ - if (typeof filterTypes === "boolean") { - parentAlreadyChecked = filterTypes; - filterTypes = undefined; - } else if (filterTypes && !Array.isArray(filterTypes)) - filterTypes = [ filterTypes ]; - - if (util.isString(path) && path.length) { - if (path === ".") - return this.root; - path = path.split("."); - } else if (!path.length) - return this; - - // Start at root if path is absolute - if (path[0] === "") - return this.root.lookup(path.slice(1), filterTypes); - - // Test if the first part matches any nested object, and if so, traverse if path contains more - var found = this.get(path[0]); - if (found) { - if (path.length === 1) { - if (!filterTypes || filterTypes.indexOf(found.constructor) > -1) - return found; - } else if (found instanceof Namespace && (found = found.lookup(path.slice(1), filterTypes, true))) - return found; - - // Otherwise try each nested namespace - } else - for (var i = 0; i < this.nestedArray.length; ++i) - if (this._nestedArray[i] instanceof Namespace && (found = this._nestedArray[i].lookup(path, filterTypes, true))) - return found; - - // If there hasn't been a match, try again at the parent - if (this.parent === null || parentAlreadyChecked) - return null; - return this.parent.lookup(path, filterTypes); -}; - -/** - * Looks up the reflection object at the specified path, relative to this namespace. - * @name NamespaceBase#lookup - * @function - * @param {string|string[]} path Path to look up - * @param {boolean} [parentAlreadyChecked=false] Whether the parent has already been checked - * @returns {ReflectionObject|null} Looked up object or `null` if none could be found - * @variation 2 - */ -// lookup(path: string, [parentAlreadyChecked: boolean]) - -/** - * Looks up the {@link Type|type} at the specified path, relative to this namespace. - * Besides its signature, this methods differs from {@link Namespace#lookup|lookup} in that it throws instead of returning `null`. - * @param {string|string[]} path Path to look up - * @returns {Type} Looked up type - * @throws {Error} If `path` does not point to a type - */ -Namespace.prototype.lookupType = function lookupType(path) { - var found = this.lookup(path, [ Type ]); - if (!found) - throw Error("no such type: " + path); - return found; -}; - -/** - * Looks up the values of the {@link Enum|enum} at the specified path, relative to this namespace. - * Besides its signature, this methods differs from {@link Namespace#lookup|lookup} in that it throws instead of returning `null`. - * @param {string|string[]} path Path to look up - * @returns {Enum} Looked up enum - * @throws {Error} If `path` does not point to an enum - */ -Namespace.prototype.lookupEnum = function lookupEnum(path) { - var found = this.lookup(path, [ Enum ]); - if (!found) - throw Error("no such Enum '" + path + "' in " + this); - return found; -}; - -/** - * Looks up the {@link Type|type} or {@link Enum|enum} at the specified path, relative to this namespace. - * Besides its signature, this methods differs from {@link Namespace#lookup|lookup} in that it throws instead of returning `null`. - * @param {string|string[]} path Path to look up - * @returns {Type} Looked up type or enum - * @throws {Error} If `path` does not point to a type or enum - */ -Namespace.prototype.lookupTypeOrEnum = function lookupTypeOrEnum(path) { - var found = this.lookup(path, [ Type, Enum ]); - if (!found) - throw Error("no such Type or Enum '" + path + "' in " + this); - return found; -}; - -/** - * Looks up the {@link Service|service} at the specified path, relative to this namespace. - * Besides its signature, this methods differs from {@link Namespace#lookup|lookup} in that it throws instead of returning `null`. - * @param {string|string[]} path Path to look up - * @returns {Service} Looked up service - * @throws {Error} If `path` does not point to a service - */ -Namespace.prototype.lookupService = function lookupService(path) { - var found = this.lookup(path, [ Service ]); - if (!found) - throw Error("no such Service '" + path + "' in " + this); - return found; -}; - -// Sets up cyclic dependencies (called in index-light) -Namespace._configure = function(Type_, Service_, Enum_) { - Type = Type_; - Service = Service_; - Enum = Enum_; -}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/src/object.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/src/object.js deleted file mode 100644 index bd04ceca..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/src/object.js +++ /dev/null @@ -1,243 +0,0 @@ -"use strict"; -module.exports = ReflectionObject; - -ReflectionObject.className = "ReflectionObject"; - -var util = require("./util"); - -var Root; // cyclic - -/** - * Constructs a new reflection object instance. - * @classdesc Base class of all reflection objects. - * @constructor - * @param {string} name Object name - * @param {Object.} [options] Declared options - * @abstract - */ -function ReflectionObject(name, options) { - - if (!util.isString(name)) - throw TypeError("name must be a string"); - - if (options && !util.isObject(options)) - throw TypeError("options must be an object"); - - /** - * Options. - * @type {Object.|undefined} - */ - this.options = options; // toJSON - - /** - * Parsed Options. - * @type {Array.>|undefined} - */ - this.parsedOptions = null; - - /** - * Unique name within its namespace. - * @type {string} - */ - this.name = name; - - /** - * Parent namespace. - * @type {Namespace|null} - */ - this.parent = null; - - /** - * Whether already resolved or not. - * @type {boolean} - */ - this.resolved = false; - - /** - * Comment text, if any. - * @type {string|null} - */ - this.comment = null; - - /** - * Defining file name. - * @type {string|null} - */ - this.filename = null; -} - -Object.defineProperties(ReflectionObject.prototype, { - - /** - * Reference to the root namespace. - * @name ReflectionObject#root - * @type {Root} - * @readonly - */ - root: { - get: function() { - var ptr = this; - while (ptr.parent !== null) - ptr = ptr.parent; - return ptr; - } - }, - - /** - * Full name including leading dot. - * @name ReflectionObject#fullName - * @type {string} - * @readonly - */ - fullName: { - get: function() { - var path = [ this.name ], - ptr = this.parent; - while (ptr) { - path.unshift(ptr.name); - ptr = ptr.parent; - } - return path.join("."); - } - } -}); - -/** - * Converts this reflection object to its descriptor representation. - * @returns {Object.} Descriptor - * @abstract - */ -ReflectionObject.prototype.toJSON = /* istanbul ignore next */ function toJSON() { - throw Error(); // not implemented, shouldn't happen -}; - -/** - * Called when this object is added to a parent. - * @param {ReflectionObject} parent Parent added to - * @returns {undefined} - */ -ReflectionObject.prototype.onAdd = function onAdd(parent) { - if (this.parent && this.parent !== parent) - this.parent.remove(this); - this.parent = parent; - this.resolved = false; - var root = parent.root; - if (root instanceof Root) - root._handleAdd(this); -}; - -/** - * Called when this object is removed from a parent. - * @param {ReflectionObject} parent Parent removed from - * @returns {undefined} - */ -ReflectionObject.prototype.onRemove = function onRemove(parent) { - var root = parent.root; - if (root instanceof Root) - root._handleRemove(this); - this.parent = null; - this.resolved = false; -}; - -/** - * Resolves this objects type references. - * @returns {ReflectionObject} `this` - */ -ReflectionObject.prototype.resolve = function resolve() { - if (this.resolved) - return this; - if (this.root instanceof Root) - this.resolved = true; // only if part of a root - return this; -}; - -/** - * Gets an option value. - * @param {string} name Option name - * @returns {*} Option value or `undefined` if not set - */ -ReflectionObject.prototype.getOption = function getOption(name) { - if (this.options) - return this.options[name]; - return undefined; -}; - -/** - * Sets an option. - * @param {string} name Option name - * @param {*} value Option value - * @param {boolean} [ifNotSet] Sets the option only if it isn't currently set - * @returns {ReflectionObject} `this` - */ -ReflectionObject.prototype.setOption = function setOption(name, value, ifNotSet) { - if (!ifNotSet || !this.options || this.options[name] === undefined) - (this.options || (this.options = {}))[name] = value; - return this; -}; - -/** - * Sets a parsed option. - * @param {string} name parsed Option name - * @param {*} value Option value - * @param {string} propName dot '.' delimited full path of property within the option to set. if undefined\empty, will add a new option with that value - * @returns {ReflectionObject} `this` - */ -ReflectionObject.prototype.setParsedOption = function setParsedOption(name, value, propName) { - if (!this.parsedOptions) { - this.parsedOptions = []; - } - var parsedOptions = this.parsedOptions; - if (propName) { - // If setting a sub property of an option then try to merge it - // with an existing option - var opt = parsedOptions.find(function (opt) { - return Object.prototype.hasOwnProperty.call(opt, name); - }); - if (opt) { - // If we found an existing option - just merge the property value - var newValue = opt[name]; - util.setProperty(newValue, propName, value); - } else { - // otherwise, create a new option, set it's property and add it to the list - opt = {}; - opt[name] = util.setProperty({}, propName, value); - parsedOptions.push(opt); - } - } else { - // Always create a new option when setting the value of the option itself - var newOpt = {}; - newOpt[name] = value; - parsedOptions.push(newOpt); - } - return this; -}; - -/** - * Sets multiple options. - * @param {Object.} options Options to set - * @param {boolean} [ifNotSet] Sets an option only if it isn't currently set - * @returns {ReflectionObject} `this` - */ -ReflectionObject.prototype.setOptions = function setOptions(options, ifNotSet) { - if (options) - for (var keys = Object.keys(options), i = 0; i < keys.length; ++i) - this.setOption(keys[i], options[keys[i]], ifNotSet); - return this; -}; - -/** - * Converts this instance to its string representation. - * @returns {string} Class name[, space, full name] - */ -ReflectionObject.prototype.toString = function toString() { - var className = this.constructor.className, - fullName = this.fullName; - if (fullName.length) - return className + " " + fullName; - return className; -}; - -// Sets up cyclic dependencies (called in index-light) -ReflectionObject._configure = function(Root_) { - Root = Root_; -}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/src/oneof.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/src/oneof.js deleted file mode 100644 index ba0e9027..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/src/oneof.js +++ /dev/null @@ -1,203 +0,0 @@ -"use strict"; -module.exports = OneOf; - -// extends ReflectionObject -var ReflectionObject = require("./object"); -((OneOf.prototype = Object.create(ReflectionObject.prototype)).constructor = OneOf).className = "OneOf"; - -var Field = require("./field"), - util = require("./util"); - -/** - * Constructs a new oneof instance. - * @classdesc Reflected oneof. - * @extends ReflectionObject - * @constructor - * @param {string} name Oneof name - * @param {string[]|Object.} [fieldNames] Field names - * @param {Object.} [options] Declared options - * @param {string} [comment] Comment associated with this field - */ -function OneOf(name, fieldNames, options, comment) { - if (!Array.isArray(fieldNames)) { - options = fieldNames; - fieldNames = undefined; - } - ReflectionObject.call(this, name, options); - - /* istanbul ignore if */ - if (!(fieldNames === undefined || Array.isArray(fieldNames))) - throw TypeError("fieldNames must be an Array"); - - /** - * Field names that belong to this oneof. - * @type {string[]} - */ - this.oneof = fieldNames || []; // toJSON, marker - - /** - * Fields that belong to this oneof as an array for iteration. - * @type {Field[]} - * @readonly - */ - this.fieldsArray = []; // declared readonly for conformance, possibly not yet added to parent - - /** - * Comment for this field. - * @type {string|null} - */ - this.comment = comment; -} - -/** - * Oneof descriptor. - * @interface IOneOf - * @property {Array.} oneof Oneof field names - * @property {Object.} [options] Oneof options - */ - -/** - * Constructs a oneof from a oneof descriptor. - * @param {string} name Oneof name - * @param {IOneOf} json Oneof descriptor - * @returns {OneOf} Created oneof - * @throws {TypeError} If arguments are invalid - */ -OneOf.fromJSON = function fromJSON(name, json) { - return new OneOf(name, json.oneof, json.options, json.comment); -}; - -/** - * Converts this oneof to a oneof descriptor. - * @param {IToJSONOptions} [toJSONOptions] JSON conversion options - * @returns {IOneOf} Oneof descriptor - */ -OneOf.prototype.toJSON = function toJSON(toJSONOptions) { - var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false; - return util.toObject([ - "options" , this.options, - "oneof" , this.oneof, - "comment" , keepComments ? this.comment : undefined - ]); -}; - -/** - * Adds the fields of the specified oneof to the parent if not already done so. - * @param {OneOf} oneof The oneof - * @returns {undefined} - * @inner - * @ignore - */ -function addFieldsToParent(oneof) { - if (oneof.parent) - for (var i = 0; i < oneof.fieldsArray.length; ++i) - if (!oneof.fieldsArray[i].parent) - oneof.parent.add(oneof.fieldsArray[i]); -} - -/** - * Adds a field to this oneof and removes it from its current parent, if any. - * @param {Field} field Field to add - * @returns {OneOf} `this` - */ -OneOf.prototype.add = function add(field) { - - /* istanbul ignore if */ - if (!(field instanceof Field)) - throw TypeError("field must be a Field"); - - if (field.parent && field.parent !== this.parent) - field.parent.remove(field); - this.oneof.push(field.name); - this.fieldsArray.push(field); - field.partOf = this; // field.parent remains null - addFieldsToParent(this); - return this; -}; - -/** - * Removes a field from this oneof and puts it back to the oneof's parent. - * @param {Field} field Field to remove - * @returns {OneOf} `this` - */ -OneOf.prototype.remove = function remove(field) { - - /* istanbul ignore if */ - if (!(field instanceof Field)) - throw TypeError("field must be a Field"); - - var index = this.fieldsArray.indexOf(field); - - /* istanbul ignore if */ - if (index < 0) - throw Error(field + " is not a member of " + this); - - this.fieldsArray.splice(index, 1); - index = this.oneof.indexOf(field.name); - - /* istanbul ignore else */ - if (index > -1) // theoretical - this.oneof.splice(index, 1); - - field.partOf = null; - return this; -}; - -/** - * @override - */ -OneOf.prototype.onAdd = function onAdd(parent) { - ReflectionObject.prototype.onAdd.call(this, parent); - var self = this; - // Collect present fields - for (var i = 0; i < this.oneof.length; ++i) { - var field = parent.get(this.oneof[i]); - if (field && !field.partOf) { - field.partOf = self; - self.fieldsArray.push(field); - } - } - // Add not yet present fields - addFieldsToParent(this); -}; - -/** - * @override - */ -OneOf.prototype.onRemove = function onRemove(parent) { - for (var i = 0, field; i < this.fieldsArray.length; ++i) - if ((field = this.fieldsArray[i]).parent) - field.parent.remove(field); - ReflectionObject.prototype.onRemove.call(this, parent); -}; - -/** - * Decorator function as returned by {@link OneOf.d} (TypeScript). - * @typedef OneOfDecorator - * @type {function} - * @param {Object} prototype Target prototype - * @param {string} oneofName OneOf name - * @returns {undefined} - */ - -/** - * OneOf decorator (TypeScript). - * @function - * @param {...string} fieldNames Field names - * @returns {OneOfDecorator} Decorator function - * @template T extends string - */ -OneOf.d = function decorateOneOf() { - var fieldNames = new Array(arguments.length), - index = 0; - while (index < arguments.length) - fieldNames[index] = arguments[index++]; - return function oneOfDecorator(prototype, oneofName) { - util.decorateType(prototype.constructor) - .add(new OneOf(oneofName, fieldNames)); - Object.defineProperty(prototype, oneofName, { - get: util.oneOfGetter(fieldNames), - set: util.oneOfSetter(fieldNames) - }); - }; -}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/src/parse.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/src/parse.js deleted file mode 100644 index be9dd5a2..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/src/parse.js +++ /dev/null @@ -1,859 +0,0 @@ -"use strict"; -module.exports = parse; - -parse.filename = null; -parse.defaults = { keepCase: false }; - -var tokenize = require("./tokenize"), - Root = require("./root"), - Type = require("./type"), - Field = require("./field"), - MapField = require("./mapfield"), - OneOf = require("./oneof"), - Enum = require("./enum"), - Service = require("./service"), - Method = require("./method"), - types = require("./types"), - util = require("./util"); - -var base10Re = /^[1-9][0-9]*$/, - base10NegRe = /^-?[1-9][0-9]*$/, - base16Re = /^0[x][0-9a-fA-F]+$/, - base16NegRe = /^-?0[x][0-9a-fA-F]+$/, - base8Re = /^0[0-7]+$/, - base8NegRe = /^-?0[0-7]+$/, - numberRe = /^(?![eE])[0-9]*(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?$/, - nameRe = /^[a-zA-Z_][a-zA-Z_0-9]*$/, - typeRefRe = /^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)(?:\.[a-zA-Z_][a-zA-Z_0-9]*)*$/, - fqTypeRefRe = /^(?:\.[a-zA-Z_][a-zA-Z_0-9]*)+$/; - -/** - * Result object returned from {@link parse}. - * @interface IParserResult - * @property {string|undefined} package Package name, if declared - * @property {string[]|undefined} imports Imports, if any - * @property {string[]|undefined} weakImports Weak imports, if any - * @property {string|undefined} syntax Syntax, if specified (either `"proto2"` or `"proto3"`) - * @property {Root} root Populated root instance - */ - -/** - * Options modifying the behavior of {@link parse}. - * @interface IParseOptions - * @property {boolean} [keepCase=false] Keeps field casing instead of converting to camel case - * @property {boolean} [alternateCommentMode=false] Recognize double-slash comments in addition to doc-block comments. - * @property {boolean} [preferTrailingComment=false] Use trailing comment when both leading comment and trailing comment exist. - */ - -/** - * Options modifying the behavior of JSON serialization. - * @interface IToJSONOptions - * @property {boolean} [keepComments=false] Serializes comments. - */ - -/** - * Parses the given .proto source and returns an object with the parsed contents. - * @param {string} source Source contents - * @param {Root} root Root to populate - * @param {IParseOptions} [options] Parse options. Defaults to {@link parse.defaults} when omitted. - * @returns {IParserResult} Parser result - * @property {string} filename=null Currently processing file name for error reporting, if known - * @property {IParseOptions} defaults Default {@link IParseOptions} - */ -function parse(source, root, options) { - /* eslint-disable callback-return */ - if (!(root instanceof Root)) { - options = root; - root = new Root(); - } - if (!options) - options = parse.defaults; - - var preferTrailingComment = options.preferTrailingComment || false; - var tn = tokenize(source, options.alternateCommentMode || false), - next = tn.next, - push = tn.push, - peek = tn.peek, - skip = tn.skip, - cmnt = tn.cmnt; - - var head = true, - pkg, - imports, - weakImports, - syntax, - isProto3 = false; - - var ptr = root; - - var applyCase = options.keepCase ? function(name) { return name; } : util.camelCase; - - /* istanbul ignore next */ - function illegal(token, name, insideTryCatch) { - var filename = parse.filename; - if (!insideTryCatch) - parse.filename = null; - return Error("illegal " + (name || "token") + " '" + token + "' (" + (filename ? filename + ", " : "") + "line " + tn.line + ")"); - } - - function readString() { - var values = [], - token; - do { - /* istanbul ignore if */ - if ((token = next()) !== "\"" && token !== "'") - throw illegal(token); - - values.push(next()); - skip(token); - token = peek(); - } while (token === "\"" || token === "'"); - return values.join(""); - } - - function readValue(acceptTypeRef) { - var token = next(); - switch (token) { - case "'": - case "\"": - push(token); - return readString(); - case "true": case "TRUE": - return true; - case "false": case "FALSE": - return false; - } - try { - return parseNumber(token, /* insideTryCatch */ true); - } catch (e) { - - /* istanbul ignore else */ - if (acceptTypeRef && typeRefRe.test(token)) - return token; - - /* istanbul ignore next */ - throw illegal(token, "value"); - } - } - - function readRanges(target, acceptStrings) { - var token, start; - do { - if (acceptStrings && ((token = peek()) === "\"" || token === "'")) - target.push(readString()); - else - target.push([ start = parseId(next()), skip("to", true) ? parseId(next()) : start ]); - } while (skip(",", true)); - skip(";"); - } - - function parseNumber(token, insideTryCatch) { - var sign = 1; - if (token.charAt(0) === "-") { - sign = -1; - token = token.substring(1); - } - switch (token) { - case "inf": case "INF": case "Inf": - return sign * Infinity; - case "nan": case "NAN": case "Nan": case "NaN": - return NaN; - case "0": - return 0; - } - if (base10Re.test(token)) - return sign * parseInt(token, 10); - if (base16Re.test(token)) - return sign * parseInt(token, 16); - if (base8Re.test(token)) - return sign * parseInt(token, 8); - - /* istanbul ignore else */ - if (numberRe.test(token)) - return sign * parseFloat(token); - - /* istanbul ignore next */ - throw illegal(token, "number", insideTryCatch); - } - - function parseId(token, acceptNegative) { - switch (token) { - case "max": case "MAX": case "Max": - return 536870911; - case "0": - return 0; - } - - /* istanbul ignore if */ - if (!acceptNegative && token.charAt(0) === "-") - throw illegal(token, "id"); - - if (base10NegRe.test(token)) - return parseInt(token, 10); - if (base16NegRe.test(token)) - return parseInt(token, 16); - - /* istanbul ignore else */ - if (base8NegRe.test(token)) - return parseInt(token, 8); - - /* istanbul ignore next */ - throw illegal(token, "id"); - } - - function parsePackage() { - - /* istanbul ignore if */ - if (pkg !== undefined) - throw illegal("package"); - - pkg = next(); - - /* istanbul ignore if */ - if (!typeRefRe.test(pkg)) - throw illegal(pkg, "name"); - - ptr = ptr.define(pkg); - skip(";"); - } - - function parseImport() { - var token = peek(); - var whichImports; - switch (token) { - case "weak": - whichImports = weakImports || (weakImports = []); - next(); - break; - case "public": - next(); - // eslint-disable-line no-fallthrough - default: - whichImports = imports || (imports = []); - break; - } - token = readString(); - skip(";"); - whichImports.push(token); - } - - function parseSyntax() { - skip("="); - syntax = readString(); - isProto3 = syntax === "proto3"; - - /* istanbul ignore if */ - if (!isProto3 && syntax !== "proto2") - throw illegal(syntax, "syntax"); - - skip(";"); - } - - function parseCommon(parent, token) { - switch (token) { - - case "option": - parseOption(parent, token); - skip(";"); - return true; - - case "message": - parseType(parent, token); - return true; - - case "enum": - parseEnum(parent, token); - return true; - - case "service": - parseService(parent, token); - return true; - - case "extend": - parseExtension(parent, token); - return true; - } - return false; - } - - function ifBlock(obj, fnIf, fnElse) { - var trailingLine = tn.line; - if (obj) { - if(typeof obj.comment !== "string") { - obj.comment = cmnt(); // try block-type comment - } - obj.filename = parse.filename; - } - if (skip("{", true)) { - var token; - while ((token = next()) !== "}") - fnIf(token); - skip(";", true); - } else { - if (fnElse) - fnElse(); - skip(";"); - if (obj && (typeof obj.comment !== "string" || preferTrailingComment)) - obj.comment = cmnt(trailingLine) || obj.comment; // try line-type comment - } - } - - function parseType(parent, token) { - - /* istanbul ignore if */ - if (!nameRe.test(token = next())) - throw illegal(token, "type name"); - - var type = new Type(token); - ifBlock(type, function parseType_block(token) { - if (parseCommon(type, token)) - return; - - switch (token) { - - case "map": - parseMapField(type, token); - break; - - case "required": - case "repeated": - parseField(type, token); - break; - - case "optional": - /* istanbul ignore if */ - if (isProto3) { - parseField(type, "proto3_optional"); - } else { - parseField(type, "optional"); - } - break; - - case "oneof": - parseOneOf(type, token); - break; - - case "extensions": - readRanges(type.extensions || (type.extensions = [])); - break; - - case "reserved": - readRanges(type.reserved || (type.reserved = []), true); - break; - - default: - /* istanbul ignore if */ - if (!isProto3 || !typeRefRe.test(token)) - throw illegal(token); - - push(token); - parseField(type, "optional"); - break; - } - }); - parent.add(type); - } - - function parseField(parent, rule, extend) { - var type = next(); - if (type === "group") { - parseGroup(parent, rule); - return; - } - - /* istanbul ignore if */ - if (!typeRefRe.test(type)) - throw illegal(type, "type"); - - var name = next(); - - /* istanbul ignore if */ - if (!nameRe.test(name)) - throw illegal(name, "name"); - - name = applyCase(name); - skip("="); - - var field = new Field(name, parseId(next()), type, rule, extend); - ifBlock(field, function parseField_block(token) { - - /* istanbul ignore else */ - if (token === "option") { - parseOption(field, token); - skip(";"); - } else - throw illegal(token); - - }, function parseField_line() { - parseInlineOptions(field); - }); - - if (rule === "proto3_optional") { - // for proto3 optional fields, we create a single-member Oneof to mimic "optional" behavior - var oneof = new OneOf("_" + name); - field.setOption("proto3_optional", true); - oneof.add(field); - parent.add(oneof); - } else { - parent.add(field); - } - - // JSON defaults to packed=true if not set so we have to set packed=false explicity when - // parsing proto2 descriptors without the option, where applicable. This must be done for - // all known packable types and anything that could be an enum (= is not a basic type). - if (!isProto3 && field.repeated && (types.packed[type] !== undefined || types.basic[type] === undefined)) - field.setOption("packed", false, /* ifNotSet */ true); - } - - function parseGroup(parent, rule) { - var name = next(); - - /* istanbul ignore if */ - if (!nameRe.test(name)) - throw illegal(name, "name"); - - var fieldName = util.lcFirst(name); - if (name === fieldName) - name = util.ucFirst(name); - skip("="); - var id = parseId(next()); - var type = new Type(name); - type.group = true; - var field = new Field(fieldName, id, name, rule); - field.filename = parse.filename; - ifBlock(type, function parseGroup_block(token) { - switch (token) { - - case "option": - parseOption(type, token); - skip(";"); - break; - - case "required": - case "repeated": - parseField(type, token); - break; - - case "optional": - /* istanbul ignore if */ - if (isProto3) { - parseField(type, "proto3_optional"); - } else { - parseField(type, "optional"); - } - break; - - case "message": - parseType(type, token); - break; - - case "enum": - parseEnum(type, token); - break; - - /* istanbul ignore next */ - default: - throw illegal(token); // there are no groups with proto3 semantics - } - }); - parent.add(type) - .add(field); - } - - function parseMapField(parent) { - skip("<"); - var keyType = next(); - - /* istanbul ignore if */ - if (types.mapKey[keyType] === undefined) - throw illegal(keyType, "type"); - - skip(","); - var valueType = next(); - - /* istanbul ignore if */ - if (!typeRefRe.test(valueType)) - throw illegal(valueType, "type"); - - skip(">"); - var name = next(); - - /* istanbul ignore if */ - if (!nameRe.test(name)) - throw illegal(name, "name"); - - skip("="); - var field = new MapField(applyCase(name), parseId(next()), keyType, valueType); - ifBlock(field, function parseMapField_block(token) { - - /* istanbul ignore else */ - if (token === "option") { - parseOption(field, token); - skip(";"); - } else - throw illegal(token); - - }, function parseMapField_line() { - parseInlineOptions(field); - }); - parent.add(field); - } - - function parseOneOf(parent, token) { - - /* istanbul ignore if */ - if (!nameRe.test(token = next())) - throw illegal(token, "name"); - - var oneof = new OneOf(applyCase(token)); - ifBlock(oneof, function parseOneOf_block(token) { - if (token === "option") { - parseOption(oneof, token); - skip(";"); - } else { - push(token); - parseField(oneof, "optional"); - } - }); - parent.add(oneof); - } - - function parseEnum(parent, token) { - - /* istanbul ignore if */ - if (!nameRe.test(token = next())) - throw illegal(token, "name"); - - var enm = new Enum(token); - ifBlock(enm, function parseEnum_block(token) { - switch(token) { - case "option": - parseOption(enm, token); - skip(";"); - break; - - case "reserved": - readRanges(enm.reserved || (enm.reserved = []), true); - break; - - default: - parseEnumValue(enm, token); - } - }); - parent.add(enm); - } - - function parseEnumValue(parent, token) { - - /* istanbul ignore if */ - if (!nameRe.test(token)) - throw illegal(token, "name"); - - skip("="); - var value = parseId(next(), true), - dummy = { - options: undefined - }; - dummy.setOption = function(name, value) { - if (this.options === undefined) - this.options = {}; - this.options[name] = value; - }; - ifBlock(dummy, function parseEnumValue_block(token) { - - /* istanbul ignore else */ - if (token === "option") { - parseOption(dummy, token); // skip - skip(";"); - } else - throw illegal(token); - - }, function parseEnumValue_line() { - parseInlineOptions(dummy); // skip - }); - parent.add(token, value, dummy.comment, dummy.options); - } - - function parseOption(parent, token) { - var isCustom = skip("(", true); - - /* istanbul ignore if */ - if (!typeRefRe.test(token = next())) - throw illegal(token, "name"); - - var name = token; - var option = name; - var propName; - - if (isCustom) { - skip(")"); - name = "(" + name + ")"; - option = name; - token = peek(); - if (fqTypeRefRe.test(token)) { - propName = token.slice(1); //remove '.' before property name - name += token; - next(); - } - } - skip("="); - var optionValue = parseOptionValue(parent, name); - setParsedOption(parent, option, optionValue, propName); - } - - function parseOptionValue(parent, name) { - // { a: "foo" b { c: "bar" } } - if (skip("{", true)) { - var objectResult = {}; - - while (!skip("}", true)) { - /* istanbul ignore if */ - if (!nameRe.test(token = next())) { - throw illegal(token, "name"); - } - - var value; - var propName = token; - - skip(":", true); - - if (peek() === "{") - value = parseOptionValue(parent, name + "." + token); - else if (peek() === "[") { - // option (my_option) = { - // repeated_value: [ "foo", "bar" ] - // }; - value = []; - var lastValue; - if (skip("[", true)) { - do { - lastValue = readValue(true); - value.push(lastValue); - } while (skip(",", true)); - skip("]"); - if (typeof lastValue !== "undefined") { - setOption(parent, name + "." + token, lastValue); - } - } - } else { - value = readValue(true); - setOption(parent, name + "." + token, value); - } - - var prevValue = objectResult[propName]; - - if (prevValue) - value = [].concat(prevValue).concat(value); - - objectResult[propName] = value; - - // Semicolons and commas can be optional - skip(",", true); - skip(";", true); - } - - return objectResult; - } - - var simpleValue = readValue(true); - setOption(parent, name, simpleValue); - return simpleValue; - // Does not enforce a delimiter to be universal - } - - function setOption(parent, name, value) { - if (parent.setOption) - parent.setOption(name, value); - } - - function setParsedOption(parent, name, value, propName) { - if (parent.setParsedOption) - parent.setParsedOption(name, value, propName); - } - - function parseInlineOptions(parent) { - if (skip("[", true)) { - do { - parseOption(parent, "option"); - } while (skip(",", true)); - skip("]"); - } - return parent; - } - - function parseService(parent, token) { - - /* istanbul ignore if */ - if (!nameRe.test(token = next())) - throw illegal(token, "service name"); - - var service = new Service(token); - ifBlock(service, function parseService_block(token) { - if (parseCommon(service, token)) - return; - - /* istanbul ignore else */ - if (token === "rpc") - parseMethod(service, token); - else - throw illegal(token); - }); - parent.add(service); - } - - function parseMethod(parent, token) { - // Get the comment of the preceding line now (if one exists) in case the - // method is defined across multiple lines. - var commentText = cmnt(); - - var type = token; - - /* istanbul ignore if */ - if (!nameRe.test(token = next())) - throw illegal(token, "name"); - - var name = token, - requestType, requestStream, - responseType, responseStream; - - skip("("); - if (skip("stream", true)) - requestStream = true; - - /* istanbul ignore if */ - if (!typeRefRe.test(token = next())) - throw illegal(token); - - requestType = token; - skip(")"); skip("returns"); skip("("); - if (skip("stream", true)) - responseStream = true; - - /* istanbul ignore if */ - if (!typeRefRe.test(token = next())) - throw illegal(token); - - responseType = token; - skip(")"); - - var method = new Method(name, type, requestType, responseType, requestStream, responseStream); - method.comment = commentText; - ifBlock(method, function parseMethod_block(token) { - - /* istanbul ignore else */ - if (token === "option") { - parseOption(method, token); - skip(";"); - } else - throw illegal(token); - - }); - parent.add(method); - } - - function parseExtension(parent, token) { - - /* istanbul ignore if */ - if (!typeRefRe.test(token = next())) - throw illegal(token, "reference"); - - var reference = token; - ifBlock(null, function parseExtension_block(token) { - switch (token) { - - case "required": - case "repeated": - parseField(parent, token, reference); - break; - - case "optional": - /* istanbul ignore if */ - if (isProto3) { - parseField(parent, "proto3_optional", reference); - } else { - parseField(parent, "optional", reference); - } - break; - - default: - /* istanbul ignore if */ - if (!isProto3 || !typeRefRe.test(token)) - throw illegal(token); - push(token); - parseField(parent, "optional", reference); - break; - } - }); - } - - var token; - while ((token = next()) !== null) { - switch (token) { - - case "package": - - /* istanbul ignore if */ - if (!head) - throw illegal(token); - - parsePackage(); - break; - - case "import": - - /* istanbul ignore if */ - if (!head) - throw illegal(token); - - parseImport(); - break; - - case "syntax": - - /* istanbul ignore if */ - if (!head) - throw illegal(token); - - parseSyntax(); - break; - - case "option": - - parseOption(ptr, token); - skip(";"); - break; - - default: - - /* istanbul ignore else */ - if (parseCommon(ptr, token)) { - head = false; - continue; - } - - /* istanbul ignore next */ - throw illegal(token); - } - } - - parse.filename = null; - return { - "package" : pkg, - "imports" : imports, - weakImports : weakImports, - syntax : syntax, - root : root - }; -} - -/** - * Parses the given .proto source and returns an object with the parsed contents. - * @name parse - * @function - * @param {string} source Source contents - * @param {IParseOptions} [options] Parse options. Defaults to {@link parse.defaults} when omitted. - * @returns {IParserResult} Parser result - * @property {string} filename=null Currently processing file name for error reporting, if known - * @property {IParseOptions} defaults Default {@link IParseOptions} - * @variation 2 - */ diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/src/reader.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/src/reader.js deleted file mode 100644 index 1b6ae13f..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/src/reader.js +++ /dev/null @@ -1,411 +0,0 @@ -"use strict"; -module.exports = Reader; - -var util = require("./util/minimal"); - -var BufferReader; // cyclic - -var LongBits = util.LongBits, - utf8 = util.utf8; - -/* istanbul ignore next */ -function indexOutOfRange(reader, writeLength) { - return RangeError("index out of range: " + reader.pos + " + " + (writeLength || 1) + " > " + reader.len); -} - -/** - * Constructs a new reader instance using the specified buffer. - * @classdesc Wire format reader using `Uint8Array` if available, otherwise `Array`. - * @constructor - * @param {Uint8Array} buffer Buffer to read from - */ -function Reader(buffer) { - - /** - * Read buffer. - * @type {Uint8Array} - */ - this.buf = buffer; - - /** - * Read buffer position. - * @type {number} - */ - this.pos = 0; - - /** - * Read buffer length. - * @type {number} - */ - this.len = buffer.length; -} - -var create_array = typeof Uint8Array !== "undefined" - ? function create_typed_array(buffer) { - if (buffer instanceof Uint8Array || Array.isArray(buffer)) - return new Reader(buffer); - throw Error("illegal buffer"); - } - /* istanbul ignore next */ - : function create_array(buffer) { - if (Array.isArray(buffer)) - return new Reader(buffer); - throw Error("illegal buffer"); - }; - -var create = function create() { - return util.Buffer - ? function create_buffer_setup(buffer) { - return (Reader.create = function create_buffer(buffer) { - return util.Buffer.isBuffer(buffer) - ? new BufferReader(buffer) - /* istanbul ignore next */ - : create_array(buffer); - })(buffer); - } - /* istanbul ignore next */ - : create_array; -}; - -/** - * Creates a new reader using the specified buffer. - * @function - * @param {Uint8Array|Buffer} buffer Buffer to read from - * @returns {Reader|BufferReader} A {@link BufferReader} if `buffer` is a Buffer, otherwise a {@link Reader} - * @throws {Error} If `buffer` is not a valid buffer - */ -Reader.create = create(); - -Reader.prototype._slice = util.Array.prototype.subarray || /* istanbul ignore next */ util.Array.prototype.slice; - -/** - * Reads a varint as an unsigned 32 bit value. - * @function - * @returns {number} Value read - */ -Reader.prototype.uint32 = (function read_uint32_setup() { - var value = 4294967295; // optimizer type-hint, tends to deopt otherwise (?!) - return function read_uint32() { - value = ( this.buf[this.pos] & 127 ) >>> 0; if (this.buf[this.pos++] < 128) return value; - value = (value | (this.buf[this.pos] & 127) << 7) >>> 0; if (this.buf[this.pos++] < 128) return value; - value = (value | (this.buf[this.pos] & 127) << 14) >>> 0; if (this.buf[this.pos++] < 128) return value; - value = (value | (this.buf[this.pos] & 127) << 21) >>> 0; if (this.buf[this.pos++] < 128) return value; - value = (value | (this.buf[this.pos] & 15) << 28) >>> 0; if (this.buf[this.pos++] < 128) return value; - - /* istanbul ignore if */ - if ((this.pos += 5) > this.len) { - this.pos = this.len; - throw indexOutOfRange(this, 10); - } - return value; - }; -})(); - -/** - * Reads a varint as a signed 32 bit value. - * @returns {number} Value read - */ -Reader.prototype.int32 = function read_int32() { - return this.uint32() | 0; -}; - -/** - * Reads a zig-zag encoded varint as a signed 32 bit value. - * @returns {number} Value read - */ -Reader.prototype.sint32 = function read_sint32() { - var value = this.uint32(); - return value >>> 1 ^ -(value & 1) | 0; -}; - -/* eslint-disable no-invalid-this */ - -function readLongVarint() { - // tends to deopt with local vars for octet etc. - var bits = new LongBits(0, 0); - var i = 0; - if (this.len - this.pos > 4) { // fast route (lo) - for (; i < 4; ++i) { - // 1st..4th - bits.lo = (bits.lo | (this.buf[this.pos] & 127) << i * 7) >>> 0; - if (this.buf[this.pos++] < 128) - return bits; - } - // 5th - bits.lo = (bits.lo | (this.buf[this.pos] & 127) << 28) >>> 0; - bits.hi = (bits.hi | (this.buf[this.pos] & 127) >> 4) >>> 0; - if (this.buf[this.pos++] < 128) - return bits; - i = 0; - } else { - for (; i < 3; ++i) { - /* istanbul ignore if */ - if (this.pos >= this.len) - throw indexOutOfRange(this); - // 1st..3th - bits.lo = (bits.lo | (this.buf[this.pos] & 127) << i * 7) >>> 0; - if (this.buf[this.pos++] < 128) - return bits; - } - // 4th - bits.lo = (bits.lo | (this.buf[this.pos++] & 127) << i * 7) >>> 0; - return bits; - } - if (this.len - this.pos > 4) { // fast route (hi) - for (; i < 5; ++i) { - // 6th..10th - bits.hi = (bits.hi | (this.buf[this.pos] & 127) << i * 7 + 3) >>> 0; - if (this.buf[this.pos++] < 128) - return bits; - } - } else { - for (; i < 5; ++i) { - /* istanbul ignore if */ - if (this.pos >= this.len) - throw indexOutOfRange(this); - // 6th..10th - bits.hi = (bits.hi | (this.buf[this.pos] & 127) << i * 7 + 3) >>> 0; - if (this.buf[this.pos++] < 128) - return bits; - } - } - /* istanbul ignore next */ - throw Error("invalid varint encoding"); -} - -/* eslint-enable no-invalid-this */ - -/** - * Reads a varint as a signed 64 bit value. - * @name Reader#int64 - * @function - * @returns {Long} Value read - */ - -/** - * Reads a varint as an unsigned 64 bit value. - * @name Reader#uint64 - * @function - * @returns {Long} Value read - */ - -/** - * Reads a zig-zag encoded varint as a signed 64 bit value. - * @name Reader#sint64 - * @function - * @returns {Long} Value read - */ - -/** - * Reads a varint as a boolean. - * @returns {boolean} Value read - */ -Reader.prototype.bool = function read_bool() { - return this.uint32() !== 0; -}; - -function readFixed32_end(buf, end) { // note that this uses `end`, not `pos` - return (buf[end - 4] - | buf[end - 3] << 8 - | buf[end - 2] << 16 - | buf[end - 1] << 24) >>> 0; -} - -/** - * Reads fixed 32 bits as an unsigned 32 bit integer. - * @returns {number} Value read - */ -Reader.prototype.fixed32 = function read_fixed32() { - - /* istanbul ignore if */ - if (this.pos + 4 > this.len) - throw indexOutOfRange(this, 4); - - return readFixed32_end(this.buf, this.pos += 4); -}; - -/** - * Reads fixed 32 bits as a signed 32 bit integer. - * @returns {number} Value read - */ -Reader.prototype.sfixed32 = function read_sfixed32() { - - /* istanbul ignore if */ - if (this.pos + 4 > this.len) - throw indexOutOfRange(this, 4); - - return readFixed32_end(this.buf, this.pos += 4) | 0; -}; - -/* eslint-disable no-invalid-this */ - -function readFixed64(/* this: Reader */) { - - /* istanbul ignore if */ - if (this.pos + 8 > this.len) - throw indexOutOfRange(this, 8); - - return new LongBits(readFixed32_end(this.buf, this.pos += 4), readFixed32_end(this.buf, this.pos += 4)); -} - -/* eslint-enable no-invalid-this */ - -/** - * Reads fixed 64 bits. - * @name Reader#fixed64 - * @function - * @returns {Long} Value read - */ - -/** - * Reads zig-zag encoded fixed 64 bits. - * @name Reader#sfixed64 - * @function - * @returns {Long} Value read - */ - -/** - * Reads a float (32 bit) as a number. - * @function - * @returns {number} Value read - */ -Reader.prototype.float = function read_float() { - - /* istanbul ignore if */ - if (this.pos + 4 > this.len) - throw indexOutOfRange(this, 4); - - var value = util.float.readFloatLE(this.buf, this.pos); - this.pos += 4; - return value; -}; - -/** - * Reads a double (64 bit float) as a number. - * @function - * @returns {number} Value read - */ -Reader.prototype.double = function read_double() { - - /* istanbul ignore if */ - if (this.pos + 8 > this.len) - throw indexOutOfRange(this, 4); - - var value = util.float.readDoubleLE(this.buf, this.pos); - this.pos += 8; - return value; -}; - -/** - * Reads a sequence of bytes preceeded by its length as a varint. - * @returns {Uint8Array} Value read - */ -Reader.prototype.bytes = function read_bytes() { - var length = this.uint32(), - start = this.pos, - end = this.pos + length; - - /* istanbul ignore if */ - if (end > this.len) - throw indexOutOfRange(this, length); - - this.pos += length; - if (Array.isArray(this.buf)) // plain array - return this.buf.slice(start, end); - return start === end // fix for IE 10/Win8 and others' subarray returning array of size 1 - ? new this.buf.constructor(0) - : this._slice.call(this.buf, start, end); -}; - -/** - * Reads a string preceeded by its byte length as a varint. - * @returns {string} Value read - */ -Reader.prototype.string = function read_string() { - var bytes = this.bytes(); - return utf8.read(bytes, 0, bytes.length); -}; - -/** - * Skips the specified number of bytes if specified, otherwise skips a varint. - * @param {number} [length] Length if known, otherwise a varint is assumed - * @returns {Reader} `this` - */ -Reader.prototype.skip = function skip(length) { - if (typeof length === "number") { - /* istanbul ignore if */ - if (this.pos + length > this.len) - throw indexOutOfRange(this, length); - this.pos += length; - } else { - do { - /* istanbul ignore if */ - if (this.pos >= this.len) - throw indexOutOfRange(this); - } while (this.buf[this.pos++] & 128); - } - return this; -}; - -/** - * Skips the next element of the specified wire type. - * @param {number} wireType Wire type received - * @returns {Reader} `this` - */ -Reader.prototype.skipType = function(wireType) { - switch (wireType) { - case 0: - this.skip(); - break; - case 1: - this.skip(8); - break; - case 2: - this.skip(this.uint32()); - break; - case 3: - while ((wireType = this.uint32() & 7) !== 4) { - this.skipType(wireType); - } - break; - case 5: - this.skip(4); - break; - - /* istanbul ignore next */ - default: - throw Error("invalid wire type " + wireType + " at offset " + this.pos); - } - return this; -}; - -Reader._configure = function(BufferReader_) { - BufferReader = BufferReader_; - Reader.create = create(); - BufferReader._configure(); - - var fn = util.Long ? "toLong" : /* istanbul ignore next */ "toNumber"; - util.merge(Reader.prototype, { - - int64: function read_int64() { - return readLongVarint.call(this)[fn](false); - }, - - uint64: function read_uint64() { - return readLongVarint.call(this)[fn](true); - }, - - sint64: function read_sint64() { - return readLongVarint.call(this).zzDecode()[fn](false); - }, - - fixed64: function read_fixed64() { - return readFixed64.call(this)[fn](true); - }, - - sfixed64: function read_sfixed64() { - return readFixed64.call(this)[fn](false); - } - - }); -}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/src/reader_buffer.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/src/reader_buffer.js deleted file mode 100644 index e5474241..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/src/reader_buffer.js +++ /dev/null @@ -1,51 +0,0 @@ -"use strict"; -module.exports = BufferReader; - -// extends Reader -var Reader = require("./reader"); -(BufferReader.prototype = Object.create(Reader.prototype)).constructor = BufferReader; - -var util = require("./util/minimal"); - -/** - * Constructs a new buffer reader instance. - * @classdesc Wire format reader using node buffers. - * @extends Reader - * @constructor - * @param {Buffer} buffer Buffer to read from - */ -function BufferReader(buffer) { - Reader.call(this, buffer); - - /** - * Read buffer. - * @name BufferReader#buf - * @type {Buffer} - */ -} - -BufferReader._configure = function () { - /* istanbul ignore else */ - if (util.Buffer) - BufferReader.prototype._slice = util.Buffer.prototype.slice; -}; - - -/** - * @override - */ -BufferReader.prototype.string = function read_string_buffer() { - var len = this.uint32(); // modifies pos - return this.buf.utf8Slice - ? this.buf.utf8Slice(this.pos, this.pos = Math.min(this.pos + len, this.len)) - : this.buf.toString("utf-8", this.pos, this.pos = Math.min(this.pos + len, this.len)); -}; - -/** - * Reads a sequence of bytes preceeded by its length as a varint. - * @name BufferReader#bytes - * @function - * @returns {Buffer} Value read - */ - -BufferReader._configure(); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/src/root.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/src/root.js deleted file mode 100644 index df6f11fa..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/src/root.js +++ /dev/null @@ -1,363 +0,0 @@ -"use strict"; -module.exports = Root; - -// extends Namespace -var Namespace = require("./namespace"); -((Root.prototype = Object.create(Namespace.prototype)).constructor = Root).className = "Root"; - -var Field = require("./field"), - Enum = require("./enum"), - OneOf = require("./oneof"), - util = require("./util"); - -var Type, // cyclic - parse, // might be excluded - common; // " - -/** - * Constructs a new root namespace instance. - * @classdesc Root namespace wrapping all types, enums, services, sub-namespaces etc. that belong together. - * @extends NamespaceBase - * @constructor - * @param {Object.} [options] Top level options - */ -function Root(options) { - Namespace.call(this, "", options); - - /** - * Deferred extension fields. - * @type {Field[]} - */ - this.deferred = []; - - /** - * Resolved file names of loaded files. - * @type {string[]} - */ - this.files = []; -} - -/** - * Loads a namespace descriptor into a root namespace. - * @param {INamespace} json Nameespace descriptor - * @param {Root} [root] Root namespace, defaults to create a new one if omitted - * @returns {Root} Root namespace - */ -Root.fromJSON = function fromJSON(json, root) { - if (!root) - root = new Root(); - if (json.options) - root.setOptions(json.options); - return root.addJSON(json.nested); -}; - -/** - * Resolves the path of an imported file, relative to the importing origin. - * This method exists so you can override it with your own logic in case your imports are scattered over multiple directories. - * @function - * @param {string} origin The file name of the importing file - * @param {string} target The file name being imported - * @returns {string|null} Resolved path to `target` or `null` to skip the file - */ -Root.prototype.resolvePath = util.path.resolve; - -/** - * Fetch content from file path or url - * This method exists so you can override it with your own logic. - * @function - * @param {string} path File path or url - * @param {FetchCallback} callback Callback function - * @returns {undefined} - */ -Root.prototype.fetch = util.fetch; - -// A symbol-like function to safely signal synchronous loading -/* istanbul ignore next */ -function SYNC() {} // eslint-disable-line no-empty-function - -/** - * Loads one or multiple .proto or preprocessed .json files into this root namespace and calls the callback. - * @param {string|string[]} filename Names of one or multiple files to load - * @param {IParseOptions} options Parse options - * @param {LoadCallback} callback Callback function - * @returns {undefined} - */ -Root.prototype.load = function load(filename, options, callback) { - if (typeof options === "function") { - callback = options; - options = undefined; - } - var self = this; - if (!callback) - return util.asPromise(load, self, filename, options); - - var sync = callback === SYNC; // undocumented - - // Finishes loading by calling the callback (exactly once) - function finish(err, root) { - /* istanbul ignore if */ - if (!callback) - return; - var cb = callback; - callback = null; - if (sync) - throw err; - cb(err, root); - } - - // Bundled definition existence checking - function getBundledFileName(filename) { - var idx = filename.lastIndexOf("google/protobuf/"); - if (idx > -1) { - var altname = filename.substring(idx); - if (altname in common) return altname; - } - return null; - } - - // Processes a single file - function process(filename, source) { - try { - if (util.isString(source) && source.charAt(0) === "{") - source = JSON.parse(source); - if (!util.isString(source)) - self.setOptions(source.options).addJSON(source.nested); - else { - parse.filename = filename; - var parsed = parse(source, self, options), - resolved, - i = 0; - if (parsed.imports) - for (; i < parsed.imports.length; ++i) - if (resolved = getBundledFileName(parsed.imports[i]) || self.resolvePath(filename, parsed.imports[i])) - fetch(resolved); - if (parsed.weakImports) - for (i = 0; i < parsed.weakImports.length; ++i) - if (resolved = getBundledFileName(parsed.weakImports[i]) || self.resolvePath(filename, parsed.weakImports[i])) - fetch(resolved, true); - } - } catch (err) { - finish(err); - } - if (!sync && !queued) - finish(null, self); // only once anyway - } - - // Fetches a single file - function fetch(filename, weak) { - - // Skip if already loaded / attempted - if (self.files.indexOf(filename) > -1) - return; - self.files.push(filename); - - // Shortcut bundled definitions - if (filename in common) { - if (sync) - process(filename, common[filename]); - else { - ++queued; - setTimeout(function() { - --queued; - process(filename, common[filename]); - }); - } - return; - } - - // Otherwise fetch from disk or network - if (sync) { - var source; - try { - source = util.fs.readFileSync(filename).toString("utf8"); - } catch (err) { - if (!weak) - finish(err); - return; - } - process(filename, source); - } else { - ++queued; - self.fetch(filename, function(err, source) { - --queued; - /* istanbul ignore if */ - if (!callback) - return; // terminated meanwhile - if (err) { - /* istanbul ignore else */ - if (!weak) - finish(err); - else if (!queued) // can't be covered reliably - finish(null, self); - return; - } - process(filename, source); - }); - } - } - var queued = 0; - - // Assembling the root namespace doesn't require working type - // references anymore, so we can load everything in parallel - if (util.isString(filename)) - filename = [ filename ]; - for (var i = 0, resolved; i < filename.length; ++i) - if (resolved = self.resolvePath("", filename[i])) - fetch(resolved); - - if (sync) - return self; - if (!queued) - finish(null, self); - return undefined; -}; -// function load(filename:string, options:IParseOptions, callback:LoadCallback):undefined - -/** - * Loads one or multiple .proto or preprocessed .json files into this root namespace and calls the callback. - * @function Root#load - * @param {string|string[]} filename Names of one or multiple files to load - * @param {LoadCallback} callback Callback function - * @returns {undefined} - * @variation 2 - */ -// function load(filename:string, callback:LoadCallback):undefined - -/** - * Loads one or multiple .proto or preprocessed .json files into this root namespace and returns a promise. - * @function Root#load - * @param {string|string[]} filename Names of one or multiple files to load - * @param {IParseOptions} [options] Parse options. Defaults to {@link parse.defaults} when omitted. - * @returns {Promise} Promise - * @variation 3 - */ -// function load(filename:string, [options:IParseOptions]):Promise - -/** - * Synchronously loads one or multiple .proto or preprocessed .json files into this root namespace (node only). - * @function Root#loadSync - * @param {string|string[]} filename Names of one or multiple files to load - * @param {IParseOptions} [options] Parse options. Defaults to {@link parse.defaults} when omitted. - * @returns {Root} Root namespace - * @throws {Error} If synchronous fetching is not supported (i.e. in browsers) or if a file's syntax is invalid - */ -Root.prototype.loadSync = function loadSync(filename, options) { - if (!util.isNode) - throw Error("not supported"); - return this.load(filename, options, SYNC); -}; - -/** - * @override - */ -Root.prototype.resolveAll = function resolveAll() { - if (this.deferred.length) - throw Error("unresolvable extensions: " + this.deferred.map(function(field) { - return "'extend " + field.extend + "' in " + field.parent.fullName; - }).join(", ")); - return Namespace.prototype.resolveAll.call(this); -}; - -// only uppercased (and thus conflict-free) children are exposed, see below -var exposeRe = /^[A-Z]/; - -/** - * Handles a deferred declaring extension field by creating a sister field to represent it within its extended type. - * @param {Root} root Root instance - * @param {Field} field Declaring extension field witin the declaring type - * @returns {boolean} `true` if successfully added to the extended type, `false` otherwise - * @inner - * @ignore - */ -function tryHandleExtension(root, field) { - var extendedType = field.parent.lookup(field.extend); - if (extendedType) { - var sisterField = new Field(field.fullName, field.id, field.type, field.rule, undefined, field.options); - sisterField.declaringField = field; - field.extensionField = sisterField; - extendedType.add(sisterField); - return true; - } - return false; -} - -/** - * Called when any object is added to this root or its sub-namespaces. - * @param {ReflectionObject} object Object added - * @returns {undefined} - * @private - */ -Root.prototype._handleAdd = function _handleAdd(object) { - if (object instanceof Field) { - - if (/* an extension field (implies not part of a oneof) */ object.extend !== undefined && /* not already handled */ !object.extensionField) - if (!tryHandleExtension(this, object)) - this.deferred.push(object); - - } else if (object instanceof Enum) { - - if (exposeRe.test(object.name)) - object.parent[object.name] = object.values; // expose enum values as property of its parent - - } else if (!(object instanceof OneOf)) /* everything else is a namespace */ { - - if (object instanceof Type) // Try to handle any deferred extensions - for (var i = 0; i < this.deferred.length;) - if (tryHandleExtension(this, this.deferred[i])) - this.deferred.splice(i, 1); - else - ++i; - for (var j = 0; j < /* initializes */ object.nestedArray.length; ++j) // recurse into the namespace - this._handleAdd(object._nestedArray[j]); - if (exposeRe.test(object.name)) - object.parent[object.name] = object; // expose namespace as property of its parent - } - - // The above also adds uppercased (and thus conflict-free) nested types, services and enums as - // properties of namespaces just like static code does. This allows using a .d.ts generated for - // a static module with reflection-based solutions where the condition is met. -}; - -/** - * Called when any object is removed from this root or its sub-namespaces. - * @param {ReflectionObject} object Object removed - * @returns {undefined} - * @private - */ -Root.prototype._handleRemove = function _handleRemove(object) { - if (object instanceof Field) { - - if (/* an extension field */ object.extend !== undefined) { - if (/* already handled */ object.extensionField) { // remove its sister field - object.extensionField.parent.remove(object.extensionField); - object.extensionField = null; - } else { // cancel the extension - var index = this.deferred.indexOf(object); - /* istanbul ignore else */ - if (index > -1) - this.deferred.splice(index, 1); - } - } - - } else if (object instanceof Enum) { - - if (exposeRe.test(object.name)) - delete object.parent[object.name]; // unexpose enum values - - } else if (object instanceof Namespace) { - - for (var i = 0; i < /* initializes */ object.nestedArray.length; ++i) // recurse into the namespace - this._handleRemove(object._nestedArray[i]); - - if (exposeRe.test(object.name)) - delete object.parent[object.name]; // unexpose namespaces - - } -}; - -// Sets up cyclic dependencies (called in index-light) -Root._configure = function(Type_, parse_, common_) { - Type = Type_; - parse = parse_; - common = common_; -}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/src/roots.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/src/roots.js deleted file mode 100644 index 1d93086d..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/src/roots.js +++ /dev/null @@ -1,18 +0,0 @@ -"use strict"; -module.exports = {}; - -/** - * Named roots. - * This is where pbjs stores generated structures (the option `-r, --root` specifies a name). - * Can also be used manually to make roots available across modules. - * @name roots - * @type {Object.} - * @example - * // pbjs -r myroot -o compiled.js ... - * - * // in another module: - * require("./compiled.js"); - * - * // in any subsequent module: - * var root = protobuf.roots["myroot"]; - */ diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/src/rpc.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/src/rpc.js deleted file mode 100644 index 894e5c7c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/src/rpc.js +++ /dev/null @@ -1,36 +0,0 @@ -"use strict"; - -/** - * Streaming RPC helpers. - * @namespace - */ -var rpc = exports; - -/** - * RPC implementation passed to {@link Service#create} performing a service request on network level, i.e. by utilizing http requests or websockets. - * @typedef RPCImpl - * @type {function} - * @param {Method|rpc.ServiceMethod,Message<{}>>} method Reflected or static method being called - * @param {Uint8Array} requestData Request data - * @param {RPCImplCallback} callback Callback function - * @returns {undefined} - * @example - * function rpcImpl(method, requestData, callback) { - * if (protobuf.util.lcFirst(method.name) !== "myMethod") // compatible with static code - * throw Error("no such method"); - * asynchronouslyObtainAResponse(requestData, function(err, responseData) { - * callback(err, responseData); - * }); - * } - */ - -/** - * Node-style callback as used by {@link RPCImpl}. - * @typedef RPCImplCallback - * @type {function} - * @param {Error|null} error Error, if any, otherwise `null` - * @param {Uint8Array|null} [response] Response data or `null` to signal end of stream, if there hasn't been an error - * @returns {undefined} - */ - -rpc.Service = require("./rpc/service"); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/src/rpc/service.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/src/rpc/service.js deleted file mode 100644 index 757f382e..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/src/rpc/service.js +++ /dev/null @@ -1,142 +0,0 @@ -"use strict"; -module.exports = Service; - -var util = require("../util/minimal"); - -// Extends EventEmitter -(Service.prototype = Object.create(util.EventEmitter.prototype)).constructor = Service; - -/** - * A service method callback as used by {@link rpc.ServiceMethod|ServiceMethod}. - * - * Differs from {@link RPCImplCallback} in that it is an actual callback of a service method which may not return `response = null`. - * @typedef rpc.ServiceMethodCallback - * @template TRes extends Message - * @type {function} - * @param {Error|null} error Error, if any - * @param {TRes} [response] Response message - * @returns {undefined} - */ - -/** - * A service method part of a {@link rpc.Service} as created by {@link Service.create}. - * @typedef rpc.ServiceMethod - * @template TReq extends Message - * @template TRes extends Message - * @type {function} - * @param {TReq|Properties} request Request message or plain object - * @param {rpc.ServiceMethodCallback} [callback] Node-style callback called with the error, if any, and the response message - * @returns {Promise>} Promise if `callback` has been omitted, otherwise `undefined` - */ - -/** - * Constructs a new RPC service instance. - * @classdesc An RPC service as returned by {@link Service#create}. - * @exports rpc.Service - * @extends util.EventEmitter - * @constructor - * @param {RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - */ -function Service(rpcImpl, requestDelimited, responseDelimited) { - - if (typeof rpcImpl !== "function") - throw TypeError("rpcImpl must be a function"); - - util.EventEmitter.call(this); - - /** - * RPC implementation. Becomes `null` once the service is ended. - * @type {RPCImpl|null} - */ - this.rpcImpl = rpcImpl; - - /** - * Whether requests are length-delimited. - * @type {boolean} - */ - this.requestDelimited = Boolean(requestDelimited); - - /** - * Whether responses are length-delimited. - * @type {boolean} - */ - this.responseDelimited = Boolean(responseDelimited); -} - -/** - * Calls a service method through {@link rpc.Service#rpcImpl|rpcImpl}. - * @param {Method|rpc.ServiceMethod} method Reflected or static method - * @param {Constructor} requestCtor Request constructor - * @param {Constructor} responseCtor Response constructor - * @param {TReq|Properties} request Request message or plain object - * @param {rpc.ServiceMethodCallback} callback Service callback - * @returns {undefined} - * @template TReq extends Message - * @template TRes extends Message - */ -Service.prototype.rpcCall = function rpcCall(method, requestCtor, responseCtor, request, callback) { - - if (!request) - throw TypeError("request must be specified"); - - var self = this; - if (!callback) - return util.asPromise(rpcCall, self, method, requestCtor, responseCtor, request); - - if (!self.rpcImpl) { - setTimeout(function() { callback(Error("already ended")); }, 0); - return undefined; - } - - try { - return self.rpcImpl( - method, - requestCtor[self.requestDelimited ? "encodeDelimited" : "encode"](request).finish(), - function rpcCallback(err, response) { - - if (err) { - self.emit("error", err, method); - return callback(err); - } - - if (response === null) { - self.end(/* endedByRPC */ true); - return undefined; - } - - if (!(response instanceof responseCtor)) { - try { - response = responseCtor[self.responseDelimited ? "decodeDelimited" : "decode"](response); - } catch (err) { - self.emit("error", err, method); - return callback(err); - } - } - - self.emit("data", response, method); - return callback(null, response); - } - ); - } catch (err) { - self.emit("error", err, method); - setTimeout(function() { callback(err); }, 0); - return undefined; - } -}; - -/** - * Ends this service and emits the `end` event. - * @param {boolean} [endedByRPC=false] Whether the service has been ended by the RPC implementation. - * @returns {rpc.Service} `this` - */ -Service.prototype.end = function end(endedByRPC) { - if (this.rpcImpl) { - if (!endedByRPC) // signal end to rpcImpl - this.rpcImpl(null, null, null); - this.rpcImpl = null; - this.emit("end").off(); - } - return this; -}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/src/service.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/src/service.js deleted file mode 100644 index bc2c3080..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/src/service.js +++ /dev/null @@ -1,167 +0,0 @@ -"use strict"; -module.exports = Service; - -// extends Namespace -var Namespace = require("./namespace"); -((Service.prototype = Object.create(Namespace.prototype)).constructor = Service).className = "Service"; - -var Method = require("./method"), - util = require("./util"), - rpc = require("./rpc"); - -/** - * Constructs a new service instance. - * @classdesc Reflected service. - * @extends NamespaceBase - * @constructor - * @param {string} name Service name - * @param {Object.} [options] Service options - * @throws {TypeError} If arguments are invalid - */ -function Service(name, options) { - Namespace.call(this, name, options); - - /** - * Service methods. - * @type {Object.} - */ - this.methods = {}; // toJSON, marker - - /** - * Cached methods as an array. - * @type {Method[]|null} - * @private - */ - this._methodsArray = null; -} - -/** - * Service descriptor. - * @interface IService - * @extends INamespace - * @property {Object.} methods Method descriptors - */ - -/** - * Constructs a service from a service descriptor. - * @param {string} name Service name - * @param {IService} json Service descriptor - * @returns {Service} Created service - * @throws {TypeError} If arguments are invalid - */ -Service.fromJSON = function fromJSON(name, json) { - var service = new Service(name, json.options); - /* istanbul ignore else */ - if (json.methods) - for (var names = Object.keys(json.methods), i = 0; i < names.length; ++i) - service.add(Method.fromJSON(names[i], json.methods[names[i]])); - if (json.nested) - service.addJSON(json.nested); - service.comment = json.comment; - return service; -}; - -/** - * Converts this service to a service descriptor. - * @param {IToJSONOptions} [toJSONOptions] JSON conversion options - * @returns {IService} Service descriptor - */ -Service.prototype.toJSON = function toJSON(toJSONOptions) { - var inherited = Namespace.prototype.toJSON.call(this, toJSONOptions); - var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false; - return util.toObject([ - "options" , inherited && inherited.options || undefined, - "methods" , Namespace.arrayToJSON(this.methodsArray, toJSONOptions) || /* istanbul ignore next */ {}, - "nested" , inherited && inherited.nested || undefined, - "comment" , keepComments ? this.comment : undefined - ]); -}; - -/** - * Methods of this service as an array for iteration. - * @name Service#methodsArray - * @type {Method[]} - * @readonly - */ -Object.defineProperty(Service.prototype, "methodsArray", { - get: function() { - return this._methodsArray || (this._methodsArray = util.toArray(this.methods)); - } -}); - -function clearCache(service) { - service._methodsArray = null; - return service; -} - -/** - * @override - */ -Service.prototype.get = function get(name) { - return this.methods[name] - || Namespace.prototype.get.call(this, name); -}; - -/** - * @override - */ -Service.prototype.resolveAll = function resolveAll() { - var methods = this.methodsArray; - for (var i = 0; i < methods.length; ++i) - methods[i].resolve(); - return Namespace.prototype.resolve.call(this); -}; - -/** - * @override - */ -Service.prototype.add = function add(object) { - - /* istanbul ignore if */ - if (this.get(object.name)) - throw Error("duplicate name '" + object.name + "' in " + this); - - if (object instanceof Method) { - this.methods[object.name] = object; - object.parent = this; - return clearCache(this); - } - return Namespace.prototype.add.call(this, object); -}; - -/** - * @override - */ -Service.prototype.remove = function remove(object) { - if (object instanceof Method) { - - /* istanbul ignore if */ - if (this.methods[object.name] !== object) - throw Error(object + " is not a member of " + this); - - delete this.methods[object.name]; - object.parent = null; - return clearCache(this); - } - return Namespace.prototype.remove.call(this, object); -}; - -/** - * Creates a runtime service using the specified rpc implementation. - * @param {RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - * @returns {rpc.Service} RPC service. Useful where requests and/or responses are streamed. - */ -Service.prototype.create = function create(rpcImpl, requestDelimited, responseDelimited) { - var rpcService = new rpc.Service(rpcImpl, requestDelimited, responseDelimited); - for (var i = 0, method; i < /* initializes */ this.methodsArray.length; ++i) { - var methodName = util.lcFirst((method = this._methodsArray[i]).resolve().name).replace(/[^$\w_]/g, ""); - rpcService[methodName] = util.codegen(["r","c"], util.isReserved(methodName) ? methodName + "_" : methodName)("return this.rpcCall(m,q,s,r,c)")({ - m: method, - q: method.resolvedRequestType.ctor, - s: method.resolvedResponseType.ctor - }); - } - return rpcService; -}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/src/tokenize.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/src/tokenize.js deleted file mode 100644 index bfb784bd..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/src/tokenize.js +++ /dev/null @@ -1,418 +0,0 @@ -"use strict"; -module.exports = tokenize; - -var delimRe = /[\s{}=;:[\],'"()<>]/g, - stringDoubleRe = /(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g, - stringSingleRe = /(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g; - -var setCommentRe = /^ *[*/]+ */, - setCommentAltRe = /^\s*\*?\/*/, - setCommentSplitRe = /\n/g, - whitespaceRe = /\s/, - unescapeRe = /\\(.?)/g; - -var unescapeMap = { - "0": "\0", - "r": "\r", - "n": "\n", - "t": "\t" -}; - -/** - * Unescapes a string. - * @param {string} str String to unescape - * @returns {string} Unescaped string - * @property {Object.} map Special characters map - * @memberof tokenize - */ -function unescape(str) { - return str.replace(unescapeRe, function($0, $1) { - switch ($1) { - case "\\": - case "": - return $1; - default: - return unescapeMap[$1] || ""; - } - }); -} - -tokenize.unescape = unescape; - -/** - * Gets the next token and advances. - * @typedef TokenizerHandleNext - * @type {function} - * @returns {string|null} Next token or `null` on eof - */ - -/** - * Peeks for the next token. - * @typedef TokenizerHandlePeek - * @type {function} - * @returns {string|null} Next token or `null` on eof - */ - -/** - * Pushes a token back to the stack. - * @typedef TokenizerHandlePush - * @type {function} - * @param {string} token Token - * @returns {undefined} - */ - -/** - * Skips the next token. - * @typedef TokenizerHandleSkip - * @type {function} - * @param {string} expected Expected token - * @param {boolean} [optional=false] If optional - * @returns {boolean} Whether the token matched - * @throws {Error} If the token didn't match and is not optional - */ - -/** - * Gets the comment on the previous line or, alternatively, the line comment on the specified line. - * @typedef TokenizerHandleCmnt - * @type {function} - * @param {number} [line] Line number - * @returns {string|null} Comment text or `null` if none - */ - -/** - * Handle object returned from {@link tokenize}. - * @interface ITokenizerHandle - * @property {TokenizerHandleNext} next Gets the next token and advances (`null` on eof) - * @property {TokenizerHandlePeek} peek Peeks for the next token (`null` on eof) - * @property {TokenizerHandlePush} push Pushes a token back to the stack - * @property {TokenizerHandleSkip} skip Skips a token, returns its presence and advances or, if non-optional and not present, throws - * @property {TokenizerHandleCmnt} cmnt Gets the comment on the previous line or the line comment on the specified line, if any - * @property {number} line Current line number - */ - -/** - * Tokenizes the given .proto source and returns an object with useful utility functions. - * @param {string} source Source contents - * @param {boolean} alternateCommentMode Whether we should activate alternate comment parsing mode. - * @returns {ITokenizerHandle} Tokenizer handle - */ -function tokenize(source, alternateCommentMode) { - /* eslint-disable callback-return */ - source = source.toString(); - - var offset = 0, - length = source.length, - line = 1, - lastCommentLine = 0, - comments = {}; - - var stack = []; - - var stringDelim = null; - - /* istanbul ignore next */ - /** - * Creates an error for illegal syntax. - * @param {string} subject Subject - * @returns {Error} Error created - * @inner - */ - function illegal(subject) { - return Error("illegal " + subject + " (line " + line + ")"); - } - - /** - * Reads a string till its end. - * @returns {string} String read - * @inner - */ - function readString() { - var re = stringDelim === "'" ? stringSingleRe : stringDoubleRe; - re.lastIndex = offset - 1; - var match = re.exec(source); - if (!match) - throw illegal("string"); - offset = re.lastIndex; - push(stringDelim); - stringDelim = null; - return unescape(match[1]); - } - - /** - * Gets the character at `pos` within the source. - * @param {number} pos Position - * @returns {string} Character - * @inner - */ - function charAt(pos) { - return source.charAt(pos); - } - - /** - * Sets the current comment text. - * @param {number} start Start offset - * @param {number} end End offset - * @param {boolean} isLeading set if a leading comment - * @returns {undefined} - * @inner - */ - function setComment(start, end, isLeading) { - var comment = { - type: source.charAt(start++), - lineEmpty: false, - leading: isLeading, - }; - var lookback; - if (alternateCommentMode) { - lookback = 2; // alternate comment parsing: "//" or "/*" - } else { - lookback = 3; // "///" or "/**" - } - var commentOffset = start - lookback, - c; - do { - if (--commentOffset < 0 || - (c = source.charAt(commentOffset)) === "\n") { - comment.lineEmpty = true; - break; - } - } while (c === " " || c === "\t"); - var lines = source - .substring(start, end) - .split(setCommentSplitRe); - for (var i = 0; i < lines.length; ++i) - lines[i] = lines[i] - .replace(alternateCommentMode ? setCommentAltRe : setCommentRe, "") - .trim(); - comment.text = lines - .join("\n") - .trim(); - - comments[line] = comment; - lastCommentLine = line; - } - - function isDoubleSlashCommentLine(startOffset) { - var endOffset = findEndOfLine(startOffset); - - // see if remaining line matches comment pattern - var lineText = source.substring(startOffset, endOffset); - // look for 1 or 2 slashes since startOffset would already point past - // the first slash that started the comment. - var isComment = /^\s*\/{1,2}/.test(lineText); - return isComment; - } - - function findEndOfLine(cursor) { - // find end of cursor's line - var endOffset = cursor; - while (endOffset < length && charAt(endOffset) !== "\n") { - endOffset++; - } - return endOffset; - } - - /** - * Obtains the next token. - * @returns {string|null} Next token or `null` on eof - * @inner - */ - function next() { - if (stack.length > 0) - return stack.shift(); - if (stringDelim) - return readString(); - var repeat, - prev, - curr, - start, - isDoc, - isLeadingComment = offset === 0; - do { - if (offset === length) - return null; - repeat = false; - while (whitespaceRe.test(curr = charAt(offset))) { - if (curr === "\n") { - isLeadingComment = true; - ++line; - } - if (++offset === length) - return null; - } - - if (charAt(offset) === "/") { - if (++offset === length) { - throw illegal("comment"); - } - if (charAt(offset) === "/") { // Line - if (!alternateCommentMode) { - // check for triple-slash comment - isDoc = charAt(start = offset + 1) === "/"; - - while (charAt(++offset) !== "\n") { - if (offset === length) { - return null; - } - } - ++offset; - if (isDoc) { - setComment(start, offset - 1, isLeadingComment); - // Trailing comment cannot not be multi-line, - // so leading comment state should be reset to handle potential next comments - isLeadingComment = true; - } - ++line; - repeat = true; - } else { - // check for double-slash comments, consolidating consecutive lines - start = offset; - isDoc = false; - if (isDoubleSlashCommentLine(offset)) { - isDoc = true; - do { - offset = findEndOfLine(offset); - if (offset === length) { - break; - } - offset++; - if (!isLeadingComment) { - // Trailing comment cannot not be multi-line - break; - } - } while (isDoubleSlashCommentLine(offset)); - } else { - offset = Math.min(length, findEndOfLine(offset) + 1); - } - if (isDoc) { - setComment(start, offset, isLeadingComment); - isLeadingComment = true; - } - line++; - repeat = true; - } - } else if ((curr = charAt(offset)) === "*") { /* Block */ - // check for /** (regular comment mode) or /* (alternate comment mode) - start = offset + 1; - isDoc = alternateCommentMode || charAt(start) === "*"; - do { - if (curr === "\n") { - ++line; - } - if (++offset === length) { - throw illegal("comment"); - } - prev = curr; - curr = charAt(offset); - } while (prev !== "*" || curr !== "/"); - ++offset; - if (isDoc) { - setComment(start, offset - 2, isLeadingComment); - isLeadingComment = true; - } - repeat = true; - } else { - return "/"; - } - } - } while (repeat); - - // offset !== length if we got here - - var end = offset; - delimRe.lastIndex = 0; - var delim = delimRe.test(charAt(end++)); - if (!delim) - while (end < length && !delimRe.test(charAt(end))) - ++end; - var token = source.substring(offset, offset = end); - if (token === "\"" || token === "'") - stringDelim = token; - return token; - } - - /** - * Pushes a token back to the stack. - * @param {string} token Token - * @returns {undefined} - * @inner - */ - function push(token) { - stack.push(token); - } - - /** - * Peeks for the next token. - * @returns {string|null} Token or `null` on eof - * @inner - */ - function peek() { - if (!stack.length) { - var token = next(); - if (token === null) - return null; - push(token); - } - return stack[0]; - } - - /** - * Skips a token. - * @param {string} expected Expected token - * @param {boolean} [optional=false] Whether the token is optional - * @returns {boolean} `true` when skipped, `false` if not - * @throws {Error} When a required token is not present - * @inner - */ - function skip(expected, optional) { - var actual = peek(), - equals = actual === expected; - if (equals) { - next(); - return true; - } - if (!optional) - throw illegal("token '" + actual + "', '" + expected + "' expected"); - return false; - } - - /** - * Gets a comment. - * @param {number} [trailingLine] Line number if looking for a trailing comment - * @returns {string|null} Comment text - * @inner - */ - function cmnt(trailingLine) { - var ret = null; - var comment; - if (trailingLine === undefined) { - comment = comments[line - 1]; - delete comments[line - 1]; - if (comment && (alternateCommentMode || comment.type === "*" || comment.lineEmpty)) { - ret = comment.leading ? comment.text : null; - } - } else { - /* istanbul ignore else */ - if (lastCommentLine < trailingLine) { - peek(); - } - comment = comments[trailingLine]; - delete comments[trailingLine]; - if (comment && !comment.lineEmpty && (alternateCommentMode || comment.type === "/")) { - ret = comment.leading ? null : comment.text; - } - } - return ret; - } - - return Object.defineProperty({ - next: next, - peek: peek, - push: push, - skip: skip, - cmnt: cmnt - }, "line", { - get: function() { return line; } - }); - /* eslint-enable callback-return */ -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/src/type.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/src/type.js deleted file mode 100644 index 2e7bda49..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/src/type.js +++ /dev/null @@ -1,589 +0,0 @@ -"use strict"; -module.exports = Type; - -// extends Namespace -var Namespace = require("./namespace"); -((Type.prototype = Object.create(Namespace.prototype)).constructor = Type).className = "Type"; - -var Enum = require("./enum"), - OneOf = require("./oneof"), - Field = require("./field"), - MapField = require("./mapfield"), - Service = require("./service"), - Message = require("./message"), - Reader = require("./reader"), - Writer = require("./writer"), - util = require("./util"), - encoder = require("./encoder"), - decoder = require("./decoder"), - verifier = require("./verifier"), - converter = require("./converter"), - wrappers = require("./wrappers"); - -/** - * Constructs a new reflected message type instance. - * @classdesc Reflected message type. - * @extends NamespaceBase - * @constructor - * @param {string} name Message name - * @param {Object.} [options] Declared options - */ -function Type(name, options) { - Namespace.call(this, name, options); - - /** - * Message fields. - * @type {Object.} - */ - this.fields = {}; // toJSON, marker - - /** - * Oneofs declared within this namespace, if any. - * @type {Object.} - */ - this.oneofs = undefined; // toJSON - - /** - * Extension ranges, if any. - * @type {number[][]} - */ - this.extensions = undefined; // toJSON - - /** - * Reserved ranges, if any. - * @type {Array.} - */ - this.reserved = undefined; // toJSON - - /*? - * Whether this type is a legacy group. - * @type {boolean|undefined} - */ - this.group = undefined; // toJSON - - /** - * Cached fields by id. - * @type {Object.|null} - * @private - */ - this._fieldsById = null; - - /** - * Cached fields as an array. - * @type {Field[]|null} - * @private - */ - this._fieldsArray = null; - - /** - * Cached oneofs as an array. - * @type {OneOf[]|null} - * @private - */ - this._oneofsArray = null; - - /** - * Cached constructor. - * @type {Constructor<{}>} - * @private - */ - this._ctor = null; -} - -Object.defineProperties(Type.prototype, { - - /** - * Message fields by id. - * @name Type#fieldsById - * @type {Object.} - * @readonly - */ - fieldsById: { - get: function() { - - /* istanbul ignore if */ - if (this._fieldsById) - return this._fieldsById; - - this._fieldsById = {}; - for (var names = Object.keys(this.fields), i = 0; i < names.length; ++i) { - var field = this.fields[names[i]], - id = field.id; - - /* istanbul ignore if */ - if (this._fieldsById[id]) - throw Error("duplicate id " + id + " in " + this); - - this._fieldsById[id] = field; - } - return this._fieldsById; - } - }, - - /** - * Fields of this message as an array for iteration. - * @name Type#fieldsArray - * @type {Field[]} - * @readonly - */ - fieldsArray: { - get: function() { - return this._fieldsArray || (this._fieldsArray = util.toArray(this.fields)); - } - }, - - /** - * Oneofs of this message as an array for iteration. - * @name Type#oneofsArray - * @type {OneOf[]} - * @readonly - */ - oneofsArray: { - get: function() { - return this._oneofsArray || (this._oneofsArray = util.toArray(this.oneofs)); - } - }, - - /** - * The registered constructor, if any registered, otherwise a generic constructor. - * Assigning a function replaces the internal constructor. If the function does not extend {@link Message} yet, its prototype will be setup accordingly and static methods will be populated. If it already extends {@link Message}, it will just replace the internal constructor. - * @name Type#ctor - * @type {Constructor<{}>} - */ - ctor: { - get: function() { - return this._ctor || (this.ctor = Type.generateConstructor(this)()); - }, - set: function(ctor) { - - // Ensure proper prototype - var prototype = ctor.prototype; - if (!(prototype instanceof Message)) { - (ctor.prototype = new Message()).constructor = ctor; - util.merge(ctor.prototype, prototype); - } - - // Classes and messages reference their reflected type - ctor.$type = ctor.prototype.$type = this; - - // Mix in static methods - util.merge(ctor, Message, true); - - this._ctor = ctor; - - // Messages have non-enumerable default values on their prototype - var i = 0; - for (; i < /* initializes */ this.fieldsArray.length; ++i) - this._fieldsArray[i].resolve(); // ensures a proper value - - // Messages have non-enumerable getters and setters for each virtual oneof field - var ctorProperties = {}; - for (i = 0; i < /* initializes */ this.oneofsArray.length; ++i) - ctorProperties[this._oneofsArray[i].resolve().name] = { - get: util.oneOfGetter(this._oneofsArray[i].oneof), - set: util.oneOfSetter(this._oneofsArray[i].oneof) - }; - if (i) - Object.defineProperties(ctor.prototype, ctorProperties); - } - } -}); - -/** - * Generates a constructor function for the specified type. - * @param {Type} mtype Message type - * @returns {Codegen} Codegen instance - */ -Type.generateConstructor = function generateConstructor(mtype) { - /* eslint-disable no-unexpected-multiline */ - var gen = util.codegen(["p"], mtype.name); - // explicitly initialize mutable object/array fields so that these aren't just inherited from the prototype - for (var i = 0, field; i < mtype.fieldsArray.length; ++i) - if ((field = mtype._fieldsArray[i]).map) gen - ("this%s={}", util.safeProp(field.name)); - else if (field.repeated) gen - ("this%s=[]", util.safeProp(field.name)); - return gen - ("if(p)for(var ks=Object.keys(p),i=0;i} [oneofs] Oneof descriptors - * @property {Object.} fields Field descriptors - * @property {number[][]} [extensions] Extension ranges - * @property {number[][]} [reserved] Reserved ranges - * @property {boolean} [group=false] Whether a legacy group or not - */ - -/** - * Creates a message type from a message type descriptor. - * @param {string} name Message name - * @param {IType} json Message type descriptor - * @returns {Type} Created message type - */ -Type.fromJSON = function fromJSON(name, json) { - var type = new Type(name, json.options); - type.extensions = json.extensions; - type.reserved = json.reserved; - var names = Object.keys(json.fields), - i = 0; - for (; i < names.length; ++i) - type.add( - ( typeof json.fields[names[i]].keyType !== "undefined" - ? MapField.fromJSON - : Field.fromJSON )(names[i], json.fields[names[i]]) - ); - if (json.oneofs) - for (names = Object.keys(json.oneofs), i = 0; i < names.length; ++i) - type.add(OneOf.fromJSON(names[i], json.oneofs[names[i]])); - if (json.nested) - for (names = Object.keys(json.nested), i = 0; i < names.length; ++i) { - var nested = json.nested[names[i]]; - type.add( // most to least likely - ( nested.id !== undefined - ? Field.fromJSON - : nested.fields !== undefined - ? Type.fromJSON - : nested.values !== undefined - ? Enum.fromJSON - : nested.methods !== undefined - ? Service.fromJSON - : Namespace.fromJSON )(names[i], nested) - ); - } - if (json.extensions && json.extensions.length) - type.extensions = json.extensions; - if (json.reserved && json.reserved.length) - type.reserved = json.reserved; - if (json.group) - type.group = true; - if (json.comment) - type.comment = json.comment; - return type; -}; - -/** - * Converts this message type to a message type descriptor. - * @param {IToJSONOptions} [toJSONOptions] JSON conversion options - * @returns {IType} Message type descriptor - */ -Type.prototype.toJSON = function toJSON(toJSONOptions) { - var inherited = Namespace.prototype.toJSON.call(this, toJSONOptions); - var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false; - return util.toObject([ - "options" , inherited && inherited.options || undefined, - "oneofs" , Namespace.arrayToJSON(this.oneofsArray, toJSONOptions), - "fields" , Namespace.arrayToJSON(this.fieldsArray.filter(function(obj) { return !obj.declaringField; }), toJSONOptions) || {}, - "extensions" , this.extensions && this.extensions.length ? this.extensions : undefined, - "reserved" , this.reserved && this.reserved.length ? this.reserved : undefined, - "group" , this.group || undefined, - "nested" , inherited && inherited.nested || undefined, - "comment" , keepComments ? this.comment : undefined - ]); -}; - -/** - * @override - */ -Type.prototype.resolveAll = function resolveAll() { - var fields = this.fieldsArray, i = 0; - while (i < fields.length) - fields[i++].resolve(); - var oneofs = this.oneofsArray; i = 0; - while (i < oneofs.length) - oneofs[i++].resolve(); - return Namespace.prototype.resolveAll.call(this); -}; - -/** - * @override - */ -Type.prototype.get = function get(name) { - return this.fields[name] - || this.oneofs && this.oneofs[name] - || this.nested && this.nested[name] - || null; -}; - -/** - * Adds a nested object to this type. - * @param {ReflectionObject} object Nested object to add - * @returns {Type} `this` - * @throws {TypeError} If arguments are invalid - * @throws {Error} If there is already a nested object with this name or, if a field, when there is already a field with this id - */ -Type.prototype.add = function add(object) { - - if (this.get(object.name)) - throw Error("duplicate name '" + object.name + "' in " + this); - - if (object instanceof Field && object.extend === undefined) { - // NOTE: Extension fields aren't actual fields on the declaring type, but nested objects. - // The root object takes care of adding distinct sister-fields to the respective extended - // type instead. - - // avoids calling the getter if not absolutely necessary because it's called quite frequently - if (this._fieldsById ? /* istanbul ignore next */ this._fieldsById[object.id] : this.fieldsById[object.id]) - throw Error("duplicate id " + object.id + " in " + this); - if (this.isReservedId(object.id)) - throw Error("id " + object.id + " is reserved in " + this); - if (this.isReservedName(object.name)) - throw Error("name '" + object.name + "' is reserved in " + this); - - if (object.parent) - object.parent.remove(object); - this.fields[object.name] = object; - object.message = this; - object.onAdd(this); - return clearCache(this); - } - if (object instanceof OneOf) { - if (!this.oneofs) - this.oneofs = {}; - this.oneofs[object.name] = object; - object.onAdd(this); - return clearCache(this); - } - return Namespace.prototype.add.call(this, object); -}; - -/** - * Removes a nested object from this type. - * @param {ReflectionObject} object Nested object to remove - * @returns {Type} `this` - * @throws {TypeError} If arguments are invalid - * @throws {Error} If `object` is not a member of this type - */ -Type.prototype.remove = function remove(object) { - if (object instanceof Field && object.extend === undefined) { - // See Type#add for the reason why extension fields are excluded here. - - /* istanbul ignore if */ - if (!this.fields || this.fields[object.name] !== object) - throw Error(object + " is not a member of " + this); - - delete this.fields[object.name]; - object.parent = null; - object.onRemove(this); - return clearCache(this); - } - if (object instanceof OneOf) { - - /* istanbul ignore if */ - if (!this.oneofs || this.oneofs[object.name] !== object) - throw Error(object + " is not a member of " + this); - - delete this.oneofs[object.name]; - object.parent = null; - object.onRemove(this); - return clearCache(this); - } - return Namespace.prototype.remove.call(this, object); -}; - -/** - * Tests if the specified id is reserved. - * @param {number} id Id to test - * @returns {boolean} `true` if reserved, otherwise `false` - */ -Type.prototype.isReservedId = function isReservedId(id) { - return Namespace.isReservedId(this.reserved, id); -}; - -/** - * Tests if the specified name is reserved. - * @param {string} name Name to test - * @returns {boolean} `true` if reserved, otherwise `false` - */ -Type.prototype.isReservedName = function isReservedName(name) { - return Namespace.isReservedName(this.reserved, name); -}; - -/** - * Creates a new message of this type using the specified properties. - * @param {Object.} [properties] Properties to set - * @returns {Message<{}>} Message instance - */ -Type.prototype.create = function create(properties) { - return new this.ctor(properties); -}; - -/** - * Sets up {@link Type#encode|encode}, {@link Type#decode|decode} and {@link Type#verify|verify}. - * @returns {Type} `this` - */ -Type.prototype.setup = function setup() { - // Sets up everything at once so that the prototype chain does not have to be re-evaluated - // multiple times (V8, soft-deopt prototype-check). - - var fullName = this.fullName, - types = []; - for (var i = 0; i < /* initializes */ this.fieldsArray.length; ++i) - types.push(this._fieldsArray[i].resolve().resolvedType); - - // Replace setup methods with type-specific generated functions - this.encode = encoder(this)({ - Writer : Writer, - types : types, - util : util - }); - this.decode = decoder(this)({ - Reader : Reader, - types : types, - util : util - }); - this.verify = verifier(this)({ - types : types, - util : util - }); - this.fromObject = converter.fromObject(this)({ - types : types, - util : util - }); - this.toObject = converter.toObject(this)({ - types : types, - util : util - }); - - // Inject custom wrappers for common types - var wrapper = wrappers[fullName]; - if (wrapper) { - var originalThis = Object.create(this); - // if (wrapper.fromObject) { - originalThis.fromObject = this.fromObject; - this.fromObject = wrapper.fromObject.bind(originalThis); - // } - // if (wrapper.toObject) { - originalThis.toObject = this.toObject; - this.toObject = wrapper.toObject.bind(originalThis); - // } - } - - return this; -}; - -/** - * Encodes a message of this type. Does not implicitly {@link Type#verify|verify} messages. - * @param {Message<{}>|Object.} message Message instance or plain object - * @param {Writer} [writer] Writer to encode to - * @returns {Writer} writer - */ -Type.prototype.encode = function encode_setup(message, writer) { - return this.setup().encode(message, writer); // overrides this method -}; - -/** - * Encodes a message of this type preceeded by its byte length as a varint. Does not implicitly {@link Type#verify|verify} messages. - * @param {Message<{}>|Object.} message Message instance or plain object - * @param {Writer} [writer] Writer to encode to - * @returns {Writer} writer - */ -Type.prototype.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); -}; - -/** - * Decodes a message of this type. - * @param {Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Length of the message, if known beforehand - * @returns {Message<{}>} Decoded message - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {util.ProtocolError<{}>} If required fields are missing - */ -Type.prototype.decode = function decode_setup(reader, length) { - return this.setup().decode(reader, length); // overrides this method -}; - -/** - * Decodes a message of this type preceeded by its byte length as a varint. - * @param {Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {Message<{}>} Decoded message - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {util.ProtocolError} If required fields are missing - */ -Type.prototype.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof Reader)) - reader = Reader.create(reader); - return this.decode(reader, reader.uint32()); -}; - -/** - * Verifies that field values are valid and that required fields are present. - * @param {Object.} message Plain object to verify - * @returns {null|string} `null` if valid, otherwise the reason why it is not - */ -Type.prototype.verify = function verify_setup(message) { - return this.setup().verify(message); // overrides this method -}; - -/** - * Creates a new message of this type from a plain object. Also converts values to their respective internal types. - * @param {Object.} object Plain object to convert - * @returns {Message<{}>} Message instance - */ -Type.prototype.fromObject = function fromObject(object) { - return this.setup().fromObject(object); -}; - -/** - * Conversion options as used by {@link Type#toObject} and {@link Message.toObject}. - * @interface IConversionOptions - * @property {Function} [longs] Long conversion type. - * Valid values are `String` and `Number` (the global types). - * Defaults to copy the present value, which is a possibly unsafe number without and a {@link Long} with a long library. - * @property {Function} [enums] Enum value conversion type. - * Only valid value is `String` (the global type). - * Defaults to copy the present value, which is the numeric id. - * @property {Function} [bytes] Bytes value conversion type. - * Valid values are `Array` and (a base64 encoded) `String` (the global types). - * Defaults to copy the present value, which usually is a Buffer under node and an Uint8Array in the browser. - * @property {boolean} [defaults=false] Also sets default values on the resulting object - * @property {boolean} [arrays=false] Sets empty arrays for missing repeated fields even if `defaults=false` - * @property {boolean} [objects=false] Sets empty objects for missing map fields even if `defaults=false` - * @property {boolean} [oneofs=false] Includes virtual oneof properties set to the present field's name, if any - * @property {boolean} [json=false] Performs additional JSON compatibility conversions, i.e. NaN and Infinity to strings - */ - -/** - * Creates a plain object from a message of this type. Also converts values to other types if specified. - * @param {Message<{}>} message Message instance - * @param {IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ -Type.prototype.toObject = function toObject(message, options) { - return this.setup().toObject(message, options); -}; - -/** - * Decorator function as returned by {@link Type.d} (TypeScript). - * @typedef TypeDecorator - * @type {function} - * @param {Constructor} target Target constructor - * @returns {undefined} - * @template T extends Message - */ - -/** - * Type decorator (TypeScript). - * @param {string} [typeName] Type name, defaults to the constructor's name - * @returns {TypeDecorator} Decorator function - * @template T extends Message - */ -Type.d = function decorateType(typeName) { - return function typeDecorator(target) { - util.decorateType(target, typeName); - }; -}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/src/types.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/src/types.js deleted file mode 100644 index 5fda19a6..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/src/types.js +++ /dev/null @@ -1,196 +0,0 @@ -"use strict"; - -/** - * Common type constants. - * @namespace - */ -var types = exports; - -var util = require("./util"); - -var s = [ - "double", // 0 - "float", // 1 - "int32", // 2 - "uint32", // 3 - "sint32", // 4 - "fixed32", // 5 - "sfixed32", // 6 - "int64", // 7 - "uint64", // 8 - "sint64", // 9 - "fixed64", // 10 - "sfixed64", // 11 - "bool", // 12 - "string", // 13 - "bytes" // 14 -]; - -function bake(values, offset) { - var i = 0, o = {}; - offset |= 0; - while (i < values.length) o[s[i + offset]] = values[i++]; - return o; -} - -/** - * Basic type wire types. - * @type {Object.} - * @const - * @property {number} double=1 Fixed64 wire type - * @property {number} float=5 Fixed32 wire type - * @property {number} int32=0 Varint wire type - * @property {number} uint32=0 Varint wire type - * @property {number} sint32=0 Varint wire type - * @property {number} fixed32=5 Fixed32 wire type - * @property {number} sfixed32=5 Fixed32 wire type - * @property {number} int64=0 Varint wire type - * @property {number} uint64=0 Varint wire type - * @property {number} sint64=0 Varint wire type - * @property {number} fixed64=1 Fixed64 wire type - * @property {number} sfixed64=1 Fixed64 wire type - * @property {number} bool=0 Varint wire type - * @property {number} string=2 Ldelim wire type - * @property {number} bytes=2 Ldelim wire type - */ -types.basic = bake([ - /* double */ 1, - /* float */ 5, - /* int32 */ 0, - /* uint32 */ 0, - /* sint32 */ 0, - /* fixed32 */ 5, - /* sfixed32 */ 5, - /* int64 */ 0, - /* uint64 */ 0, - /* sint64 */ 0, - /* fixed64 */ 1, - /* sfixed64 */ 1, - /* bool */ 0, - /* string */ 2, - /* bytes */ 2 -]); - -/** - * Basic type defaults. - * @type {Object.} - * @const - * @property {number} double=0 Double default - * @property {number} float=0 Float default - * @property {number} int32=0 Int32 default - * @property {number} uint32=0 Uint32 default - * @property {number} sint32=0 Sint32 default - * @property {number} fixed32=0 Fixed32 default - * @property {number} sfixed32=0 Sfixed32 default - * @property {number} int64=0 Int64 default - * @property {number} uint64=0 Uint64 default - * @property {number} sint64=0 Sint32 default - * @property {number} fixed64=0 Fixed64 default - * @property {number} sfixed64=0 Sfixed64 default - * @property {boolean} bool=false Bool default - * @property {string} string="" String default - * @property {Array.} bytes=Array(0) Bytes default - * @property {null} message=null Message default - */ -types.defaults = bake([ - /* double */ 0, - /* float */ 0, - /* int32 */ 0, - /* uint32 */ 0, - /* sint32 */ 0, - /* fixed32 */ 0, - /* sfixed32 */ 0, - /* int64 */ 0, - /* uint64 */ 0, - /* sint64 */ 0, - /* fixed64 */ 0, - /* sfixed64 */ 0, - /* bool */ false, - /* string */ "", - /* bytes */ util.emptyArray, - /* message */ null -]); - -/** - * Basic long type wire types. - * @type {Object.} - * @const - * @property {number} int64=0 Varint wire type - * @property {number} uint64=0 Varint wire type - * @property {number} sint64=0 Varint wire type - * @property {number} fixed64=1 Fixed64 wire type - * @property {number} sfixed64=1 Fixed64 wire type - */ -types.long = bake([ - /* int64 */ 0, - /* uint64 */ 0, - /* sint64 */ 0, - /* fixed64 */ 1, - /* sfixed64 */ 1 -], 7); - -/** - * Allowed types for map keys with their associated wire type. - * @type {Object.} - * @const - * @property {number} int32=0 Varint wire type - * @property {number} uint32=0 Varint wire type - * @property {number} sint32=0 Varint wire type - * @property {number} fixed32=5 Fixed32 wire type - * @property {number} sfixed32=5 Fixed32 wire type - * @property {number} int64=0 Varint wire type - * @property {number} uint64=0 Varint wire type - * @property {number} sint64=0 Varint wire type - * @property {number} fixed64=1 Fixed64 wire type - * @property {number} sfixed64=1 Fixed64 wire type - * @property {number} bool=0 Varint wire type - * @property {number} string=2 Ldelim wire type - */ -types.mapKey = bake([ - /* int32 */ 0, - /* uint32 */ 0, - /* sint32 */ 0, - /* fixed32 */ 5, - /* sfixed32 */ 5, - /* int64 */ 0, - /* uint64 */ 0, - /* sint64 */ 0, - /* fixed64 */ 1, - /* sfixed64 */ 1, - /* bool */ 0, - /* string */ 2 -], 2); - -/** - * Allowed types for packed repeated fields with their associated wire type. - * @type {Object.} - * @const - * @property {number} double=1 Fixed64 wire type - * @property {number} float=5 Fixed32 wire type - * @property {number} int32=0 Varint wire type - * @property {number} uint32=0 Varint wire type - * @property {number} sint32=0 Varint wire type - * @property {number} fixed32=5 Fixed32 wire type - * @property {number} sfixed32=5 Fixed32 wire type - * @property {number} int64=0 Varint wire type - * @property {number} uint64=0 Varint wire type - * @property {number} sint64=0 Varint wire type - * @property {number} fixed64=1 Fixed64 wire type - * @property {number} sfixed64=1 Fixed64 wire type - * @property {number} bool=0 Varint wire type - */ -types.packed = bake([ - /* double */ 1, - /* float */ 5, - /* int32 */ 0, - /* uint32 */ 0, - /* sint32 */ 0, - /* fixed32 */ 5, - /* sfixed32 */ 5, - /* int64 */ 0, - /* uint64 */ 0, - /* sint64 */ 0, - /* fixed64 */ 1, - /* sfixed64 */ 1, - /* bool */ 0 -]); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/src/typescript.jsdoc b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/src/typescript.jsdoc deleted file mode 100644 index 9a671016..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/src/typescript.jsdoc +++ /dev/null @@ -1,15 +0,0 @@ -/** - * Constructor type. - * @interface Constructor - * @extends Function - * @template T - * @tstype new(...params: any[]): T; prototype: T; - */ - -/** - * Properties type. - * @typedef Properties - * @template T - * @type {Object.} - * @tstype { [P in keyof T]?: T[P] } - */ diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/src/util.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/src/util.js deleted file mode 100644 index c39d33a6..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/src/util.js +++ /dev/null @@ -1,212 +0,0 @@ -"use strict"; - -/** - * Various utility functions. - * @namespace - */ -var util = module.exports = require("./util/minimal"); - -var roots = require("./roots"); - -var Type, // cyclic - Enum; - -util.codegen = require("@protobufjs/codegen"); -util.fetch = require("@protobufjs/fetch"); -util.path = require("@protobufjs/path"); - -/** - * Node's fs module if available. - * @type {Object.} - */ -util.fs = util.inquire("fs"); - -/** - * Converts an object's values to an array. - * @param {Object.} object Object to convert - * @returns {Array.<*>} Converted array - */ -util.toArray = function toArray(object) { - if (object) { - var keys = Object.keys(object), - array = new Array(keys.length), - index = 0; - while (index < keys.length) - array[index] = object[keys[index++]]; - return array; - } - return []; -}; - -/** - * Converts an array of keys immediately followed by their respective value to an object, omitting undefined values. - * @param {Array.<*>} array Array to convert - * @returns {Object.} Converted object - */ -util.toObject = function toObject(array) { - var object = {}, - index = 0; - while (index < array.length) { - var key = array[index++], - val = array[index++]; - if (val !== undefined) - object[key] = val; - } - return object; -}; - -var safePropBackslashRe = /\\/g, - safePropQuoteRe = /"/g; - -/** - * Tests whether the specified name is a reserved word in JS. - * @param {string} name Name to test - * @returns {boolean} `true` if reserved, otherwise `false` - */ -util.isReserved = function isReserved(name) { - return /^(?:do|if|in|for|let|new|try|var|case|else|enum|eval|false|null|this|true|void|with|break|catch|class|const|super|throw|while|yield|delete|export|import|public|return|static|switch|typeof|default|extends|finally|package|private|continue|debugger|function|arguments|interface|protected|implements|instanceof)$/.test(name); -}; - -/** - * Returns a safe property accessor for the specified property name. - * @param {string} prop Property name - * @returns {string} Safe accessor - */ -util.safeProp = function safeProp(prop) { - if (!/^[$\w_]+$/.test(prop) || util.isReserved(prop)) - return "[\"" + prop.replace(safePropBackslashRe, "\\\\").replace(safePropQuoteRe, "\\\"") + "\"]"; - return "." + prop; -}; - -/** - * Converts the first character of a string to upper case. - * @param {string} str String to convert - * @returns {string} Converted string - */ -util.ucFirst = function ucFirst(str) { - return str.charAt(0).toUpperCase() + str.substring(1); -}; - -var camelCaseRe = /_([a-z])/g; - -/** - * Converts a string to camel case. - * @param {string} str String to convert - * @returns {string} Converted string - */ -util.camelCase = function camelCase(str) { - return str.substring(0, 1) - + str.substring(1) - .replace(camelCaseRe, function($0, $1) { return $1.toUpperCase(); }); -}; - -/** - * Compares reflected fields by id. - * @param {Field} a First field - * @param {Field} b Second field - * @returns {number} Comparison value - */ -util.compareFieldsById = function compareFieldsById(a, b) { - return a.id - b.id; -}; - -/** - * Decorator helper for types (TypeScript). - * @param {Constructor} ctor Constructor function - * @param {string} [typeName] Type name, defaults to the constructor's name - * @returns {Type} Reflected type - * @template T extends Message - * @property {Root} root Decorators root - */ -util.decorateType = function decorateType(ctor, typeName) { - - /* istanbul ignore if */ - if (ctor.$type) { - if (typeName && ctor.$type.name !== typeName) { - util.decorateRoot.remove(ctor.$type); - ctor.$type.name = typeName; - util.decorateRoot.add(ctor.$type); - } - return ctor.$type; - } - - /* istanbul ignore next */ - if (!Type) - Type = require("./type"); - - var type = new Type(typeName || ctor.name); - util.decorateRoot.add(type); - type.ctor = ctor; // sets up .encode, .decode etc. - Object.defineProperty(ctor, "$type", { value: type, enumerable: false }); - Object.defineProperty(ctor.prototype, "$type", { value: type, enumerable: false }); - return type; -}; - -var decorateEnumIndex = 0; - -/** - * Decorator helper for enums (TypeScript). - * @param {Object} object Enum object - * @returns {Enum} Reflected enum - */ -util.decorateEnum = function decorateEnum(object) { - - /* istanbul ignore if */ - if (object.$type) - return object.$type; - - /* istanbul ignore next */ - if (!Enum) - Enum = require("./enum"); - - var enm = new Enum("Enum" + decorateEnumIndex++, object); - util.decorateRoot.add(enm); - Object.defineProperty(object, "$type", { value: enm, enumerable: false }); - return enm; -}; - - -/** - * Sets the value of a property by property path. If a value already exists, it is turned to an array - * @param {Object.} dst Destination object - * @param {string} path dot '.' delimited path of the property to set - * @param {Object} value the value to set - * @returns {Object.} Destination object - */ -util.setProperty = function setProperty(dst, path, value) { - function setProp(dst, path, value) { - var part = path.shift(); - if (part === "__proto__") { - return dst; - } - if (path.length > 0) { - dst[part] = setProp(dst[part] || {}, path, value); - } else { - var prevValue = dst[part]; - if (prevValue) - value = [].concat(prevValue).concat(value); - dst[part] = value; - } - return dst; - } - - if (typeof dst !== "object") - throw TypeError("dst must be an object"); - if (!path) - throw TypeError("path must be specified"); - - path = path.split("."); - return setProp(dst, path, value); -}; - -/** - * Decorator root (TypeScript). - * @name util.decorateRoot - * @type {Root} - * @readonly - */ -Object.defineProperty(util, "decorateRoot", { - get: function() { - return roots["decorated"] || (roots["decorated"] = new (require("./root"))()); - } -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/src/util/longbits.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/src/util/longbits.js deleted file mode 100644 index 11bfb1c0..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/src/util/longbits.js +++ /dev/null @@ -1,200 +0,0 @@ -"use strict"; -module.exports = LongBits; - -var util = require("../util/minimal"); - -/** - * Constructs new long bits. - * @classdesc Helper class for working with the low and high bits of a 64 bit value. - * @memberof util - * @constructor - * @param {number} lo Low 32 bits, unsigned - * @param {number} hi High 32 bits, unsigned - */ -function LongBits(lo, hi) { - - // note that the casts below are theoretically unnecessary as of today, but older statically - // generated converter code might still call the ctor with signed 32bits. kept for compat. - - /** - * Low bits. - * @type {number} - */ - this.lo = lo >>> 0; - - /** - * High bits. - * @type {number} - */ - this.hi = hi >>> 0; -} - -/** - * Zero bits. - * @memberof util.LongBits - * @type {util.LongBits} - */ -var zero = LongBits.zero = new LongBits(0, 0); - -zero.toNumber = function() { return 0; }; -zero.zzEncode = zero.zzDecode = function() { return this; }; -zero.length = function() { return 1; }; - -/** - * Zero hash. - * @memberof util.LongBits - * @type {string} - */ -var zeroHash = LongBits.zeroHash = "\0\0\0\0\0\0\0\0"; - -/** - * Constructs new long bits from the specified number. - * @param {number} value Value - * @returns {util.LongBits} Instance - */ -LongBits.fromNumber = function fromNumber(value) { - if (value === 0) - return zero; - var sign = value < 0; - if (sign) - value = -value; - var lo = value >>> 0, - hi = (value - lo) / 4294967296 >>> 0; - if (sign) { - hi = ~hi >>> 0; - lo = ~lo >>> 0; - if (++lo > 4294967295) { - lo = 0; - if (++hi > 4294967295) - hi = 0; - } - } - return new LongBits(lo, hi); -}; - -/** - * Constructs new long bits from a number, long or string. - * @param {Long|number|string} value Value - * @returns {util.LongBits} Instance - */ -LongBits.from = function from(value) { - if (typeof value === "number") - return LongBits.fromNumber(value); - if (util.isString(value)) { - /* istanbul ignore else */ - if (util.Long) - value = util.Long.fromString(value); - else - return LongBits.fromNumber(parseInt(value, 10)); - } - return value.low || value.high ? new LongBits(value.low >>> 0, value.high >>> 0) : zero; -}; - -/** - * Converts this long bits to a possibly unsafe JavaScript number. - * @param {boolean} [unsigned=false] Whether unsigned or not - * @returns {number} Possibly unsafe number - */ -LongBits.prototype.toNumber = function toNumber(unsigned) { - if (!unsigned && this.hi >>> 31) { - var lo = ~this.lo + 1 >>> 0, - hi = ~this.hi >>> 0; - if (!lo) - hi = hi + 1 >>> 0; - return -(lo + hi * 4294967296); - } - return this.lo + this.hi * 4294967296; -}; - -/** - * Converts this long bits to a long. - * @param {boolean} [unsigned=false] Whether unsigned or not - * @returns {Long} Long - */ -LongBits.prototype.toLong = function toLong(unsigned) { - return util.Long - ? new util.Long(this.lo | 0, this.hi | 0, Boolean(unsigned)) - /* istanbul ignore next */ - : { low: this.lo | 0, high: this.hi | 0, unsigned: Boolean(unsigned) }; -}; - -var charCodeAt = String.prototype.charCodeAt; - -/** - * Constructs new long bits from the specified 8 characters long hash. - * @param {string} hash Hash - * @returns {util.LongBits} Bits - */ -LongBits.fromHash = function fromHash(hash) { - if (hash === zeroHash) - return zero; - return new LongBits( - ( charCodeAt.call(hash, 0) - | charCodeAt.call(hash, 1) << 8 - | charCodeAt.call(hash, 2) << 16 - | charCodeAt.call(hash, 3) << 24) >>> 0 - , - ( charCodeAt.call(hash, 4) - | charCodeAt.call(hash, 5) << 8 - | charCodeAt.call(hash, 6) << 16 - | charCodeAt.call(hash, 7) << 24) >>> 0 - ); -}; - -/** - * Converts this long bits to a 8 characters long hash. - * @returns {string} Hash - */ -LongBits.prototype.toHash = function toHash() { - return String.fromCharCode( - this.lo & 255, - this.lo >>> 8 & 255, - this.lo >>> 16 & 255, - this.lo >>> 24 , - this.hi & 255, - this.hi >>> 8 & 255, - this.hi >>> 16 & 255, - this.hi >>> 24 - ); -}; - -/** - * Zig-zag encodes this long bits. - * @returns {util.LongBits} `this` - */ -LongBits.prototype.zzEncode = function zzEncode() { - var mask = this.hi >> 31; - this.hi = ((this.hi << 1 | this.lo >>> 31) ^ mask) >>> 0; - this.lo = ( this.lo << 1 ^ mask) >>> 0; - return this; -}; - -/** - * Zig-zag decodes this long bits. - * @returns {util.LongBits} `this` - */ -LongBits.prototype.zzDecode = function zzDecode() { - var mask = -(this.lo & 1); - this.lo = ((this.lo >>> 1 | this.hi << 31) ^ mask) >>> 0; - this.hi = ( this.hi >>> 1 ^ mask) >>> 0; - return this; -}; - -/** - * Calculates the length of this longbits when encoded as a varint. - * @returns {number} Length - */ -LongBits.prototype.length = function length() { - var part0 = this.lo, - part1 = (this.lo >>> 28 | this.hi << 4) >>> 0, - part2 = this.hi >>> 24; - return part2 === 0 - ? part1 === 0 - ? part0 < 16384 - ? part0 < 128 ? 1 : 2 - : part0 < 2097152 ? 3 : 4 - : part1 < 16384 - ? part1 < 128 ? 5 : 6 - : part1 < 2097152 ? 7 : 8 - : part2 < 128 ? 9 : 10; -}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/src/util/minimal.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/src/util/minimal.js deleted file mode 100644 index 35008ecc..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/src/util/minimal.js +++ /dev/null @@ -1,438 +0,0 @@ -"use strict"; -var util = exports; - -// used to return a Promise where callback is omitted -util.asPromise = require("@protobufjs/aspromise"); - -// converts to / from base64 encoded strings -util.base64 = require("@protobufjs/base64"); - -// base class of rpc.Service -util.EventEmitter = require("@protobufjs/eventemitter"); - -// float handling accross browsers -util.float = require("@protobufjs/float"); - -// requires modules optionally and hides the call from bundlers -util.inquire = require("@protobufjs/inquire"); - -// converts to / from utf8 encoded strings -util.utf8 = require("@protobufjs/utf8"); - -// provides a node-like buffer pool in the browser -util.pool = require("@protobufjs/pool"); - -// utility to work with the low and high bits of a 64 bit value -util.LongBits = require("./longbits"); - -/** - * Whether running within node or not. - * @memberof util - * @type {boolean} - */ -util.isNode = Boolean(typeof global !== "undefined" - && global - && global.process - && global.process.versions - && global.process.versions.node); - -/** - * Global object reference. - * @memberof util - * @type {Object} - */ -util.global = util.isNode && global - || typeof window !== "undefined" && window - || typeof self !== "undefined" && self - || this; // eslint-disable-line no-invalid-this - -/** - * An immuable empty array. - * @memberof util - * @type {Array.<*>} - * @const - */ -util.emptyArray = Object.freeze ? Object.freeze([]) : /* istanbul ignore next */ []; // used on prototypes - -/** - * An immutable empty object. - * @type {Object} - * @const - */ -util.emptyObject = Object.freeze ? Object.freeze({}) : /* istanbul ignore next */ {}; // used on prototypes - -/** - * Tests if the specified value is an integer. - * @function - * @param {*} value Value to test - * @returns {boolean} `true` if the value is an integer - */ -util.isInteger = Number.isInteger || /* istanbul ignore next */ function isInteger(value) { - return typeof value === "number" && isFinite(value) && Math.floor(value) === value; -}; - -/** - * Tests if the specified value is a string. - * @param {*} value Value to test - * @returns {boolean} `true` if the value is a string - */ -util.isString = function isString(value) { - return typeof value === "string" || value instanceof String; -}; - -/** - * Tests if the specified value is a non-null object. - * @param {*} value Value to test - * @returns {boolean} `true` if the value is a non-null object - */ -util.isObject = function isObject(value) { - return value && typeof value === "object"; -}; - -/** - * Checks if a property on a message is considered to be present. - * This is an alias of {@link util.isSet}. - * @function - * @param {Object} obj Plain object or message instance - * @param {string} prop Property name - * @returns {boolean} `true` if considered to be present, otherwise `false` - */ -util.isset = - -/** - * Checks if a property on a message is considered to be present. - * @param {Object} obj Plain object or message instance - * @param {string} prop Property name - * @returns {boolean} `true` if considered to be present, otherwise `false` - */ -util.isSet = function isSet(obj, prop) { - var value = obj[prop]; - if (value != null && obj.hasOwnProperty(prop)) // eslint-disable-line eqeqeq, no-prototype-builtins - return typeof value !== "object" || (Array.isArray(value) ? value.length : Object.keys(value).length) > 0; - return false; -}; - -/** - * Any compatible Buffer instance. - * This is a minimal stand-alone definition of a Buffer instance. The actual type is that exported by node's typings. - * @interface Buffer - * @extends Uint8Array - */ - -/** - * Node's Buffer class if available. - * @type {Constructor} - */ -util.Buffer = (function() { - try { - var Buffer = util.inquire("buffer").Buffer; - // refuse to use non-node buffers if not explicitly assigned (perf reasons): - return Buffer.prototype.utf8Write ? Buffer : /* istanbul ignore next */ null; - } catch (e) { - /* istanbul ignore next */ - return null; - } -})(); - -// Internal alias of or polyfull for Buffer.from. -util._Buffer_from = null; - -// Internal alias of or polyfill for Buffer.allocUnsafe. -util._Buffer_allocUnsafe = null; - -/** - * Creates a new buffer of whatever type supported by the environment. - * @param {number|number[]} [sizeOrArray=0] Buffer size or number array - * @returns {Uint8Array|Buffer} Buffer - */ -util.newBuffer = function newBuffer(sizeOrArray) { - /* istanbul ignore next */ - return typeof sizeOrArray === "number" - ? util.Buffer - ? util._Buffer_allocUnsafe(sizeOrArray) - : new util.Array(sizeOrArray) - : util.Buffer - ? util._Buffer_from(sizeOrArray) - : typeof Uint8Array === "undefined" - ? sizeOrArray - : new Uint8Array(sizeOrArray); -}; - -/** - * Array implementation used in the browser. `Uint8Array` if supported, otherwise `Array`. - * @type {Constructor} - */ -util.Array = typeof Uint8Array !== "undefined" ? Uint8Array /* istanbul ignore next */ : Array; - -/** - * Any compatible Long instance. - * This is a minimal stand-alone definition of a Long instance. The actual type is that exported by long.js. - * @interface Long - * @property {number} low Low bits - * @property {number} high High bits - * @property {boolean} unsigned Whether unsigned or not - */ - -/** - * Long.js's Long class if available. - * @type {Constructor} - */ -util.Long = /* istanbul ignore next */ util.global.dcodeIO && /* istanbul ignore next */ util.global.dcodeIO.Long - || /* istanbul ignore next */ util.global.Long - || util.inquire("long"); - -/** - * Regular expression used to verify 2 bit (`bool`) map keys. - * @type {RegExp} - * @const - */ -util.key2Re = /^true|false|0|1$/; - -/** - * Regular expression used to verify 32 bit (`int32` etc.) map keys. - * @type {RegExp} - * @const - */ -util.key32Re = /^-?(?:0|[1-9][0-9]*)$/; - -/** - * Regular expression used to verify 64 bit (`int64` etc.) map keys. - * @type {RegExp} - * @const - */ -util.key64Re = /^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/; - -/** - * Converts a number or long to an 8 characters long hash string. - * @param {Long|number} value Value to convert - * @returns {string} Hash - */ -util.longToHash = function longToHash(value) { - return value - ? util.LongBits.from(value).toHash() - : util.LongBits.zeroHash; -}; - -/** - * Converts an 8 characters long hash string to a long or number. - * @param {string} hash Hash - * @param {boolean} [unsigned=false] Whether unsigned or not - * @returns {Long|number} Original value - */ -util.longFromHash = function longFromHash(hash, unsigned) { - var bits = util.LongBits.fromHash(hash); - if (util.Long) - return util.Long.fromBits(bits.lo, bits.hi, unsigned); - return bits.toNumber(Boolean(unsigned)); -}; - -/** - * Merges the properties of the source object into the destination object. - * @memberof util - * @param {Object.} dst Destination object - * @param {Object.} src Source object - * @param {boolean} [ifNotSet=false] Merges only if the key is not already set - * @returns {Object.} Destination object - */ -function merge(dst, src, ifNotSet) { // used by converters - for (var keys = Object.keys(src), i = 0; i < keys.length; ++i) - if (dst[keys[i]] === undefined || !ifNotSet) - dst[keys[i]] = src[keys[i]]; - return dst; -} - -util.merge = merge; - -/** - * Converts the first character of a string to lower case. - * @param {string} str String to convert - * @returns {string} Converted string - */ -util.lcFirst = function lcFirst(str) { - return str.charAt(0).toLowerCase() + str.substring(1); -}; - -/** - * Creates a custom error constructor. - * @memberof util - * @param {string} name Error name - * @returns {Constructor} Custom error constructor - */ -function newError(name) { - - function CustomError(message, properties) { - - if (!(this instanceof CustomError)) - return new CustomError(message, properties); - - // Error.call(this, message); - // ^ just returns a new error instance because the ctor can be called as a function - - Object.defineProperty(this, "message", { get: function() { return message; } }); - - /* istanbul ignore next */ - if (Error.captureStackTrace) // node - Error.captureStackTrace(this, CustomError); - else - Object.defineProperty(this, "stack", { value: new Error().stack || "" }); - - if (properties) - merge(this, properties); - } - - CustomError.prototype = Object.create(Error.prototype, { - constructor: { - value: CustomError, - writable: true, - enumerable: false, - configurable: true, - }, - name: { - get() { return name; }, - set: undefined, - enumerable: false, - // configurable: false would accurately preserve the behavior of - // the original, but I'm guessing that was not intentional. - // For an actual error subclass, this property would - // be configurable. - configurable: true, - }, - toString: { - value() { return this.name + ": " + this.message; }, - writable: true, - enumerable: false, - configurable: true, - }, - }); - - return CustomError; -} - -util.newError = newError; - -/** - * Constructs a new protocol error. - * @classdesc Error subclass indicating a protocol specifc error. - * @memberof util - * @extends Error - * @template T extends Message - * @constructor - * @param {string} message Error message - * @param {Object.} [properties] Additional properties - * @example - * try { - * MyMessage.decode(someBuffer); // throws if required fields are missing - * } catch (e) { - * if (e instanceof ProtocolError && e.instance) - * console.log("decoded so far: " + JSON.stringify(e.instance)); - * } - */ -util.ProtocolError = newError("ProtocolError"); - -/** - * So far decoded message instance. - * @name util.ProtocolError#instance - * @type {Message} - */ - -/** - * A OneOf getter as returned by {@link util.oneOfGetter}. - * @typedef OneOfGetter - * @type {function} - * @returns {string|undefined} Set field name, if any - */ - -/** - * Builds a getter for a oneof's present field name. - * @param {string[]} fieldNames Field names - * @returns {OneOfGetter} Unbound getter - */ -util.oneOfGetter = function getOneOf(fieldNames) { - var fieldMap = {}; - for (var i = 0; i < fieldNames.length; ++i) - fieldMap[fieldNames[i]] = 1; - - /** - * @returns {string|undefined} Set field name, if any - * @this Object - * @ignore - */ - return function() { // eslint-disable-line consistent-return - for (var keys = Object.keys(this), i = keys.length - 1; i > -1; --i) - if (fieldMap[keys[i]] === 1 && this[keys[i]] !== undefined && this[keys[i]] !== null) - return keys[i]; - }; -}; - -/** - * A OneOf setter as returned by {@link util.oneOfSetter}. - * @typedef OneOfSetter - * @type {function} - * @param {string|undefined} value Field name - * @returns {undefined} - */ - -/** - * Builds a setter for a oneof's present field name. - * @param {string[]} fieldNames Field names - * @returns {OneOfSetter} Unbound setter - */ -util.oneOfSetter = function setOneOf(fieldNames) { - - /** - * @param {string} name Field name - * @returns {undefined} - * @this Object - * @ignore - */ - return function(name) { - for (var i = 0; i < fieldNames.length; ++i) - if (fieldNames[i] !== name) - delete this[fieldNames[i]]; - }; -}; - -/** - * Default conversion options used for {@link Message#toJSON} implementations. - * - * These options are close to proto3's JSON mapping with the exception that internal types like Any are handled just like messages. More precisely: - * - * - Longs become strings - * - Enums become string keys - * - Bytes become base64 encoded strings - * - (Sub-)Messages become plain objects - * - Maps become plain objects with all string keys - * - Repeated fields become arrays - * - NaN and Infinity for float and double fields become strings - * - * @type {IConversionOptions} - * @see https://developers.google.com/protocol-buffers/docs/proto3?hl=en#json - */ -util.toJSONOptions = { - longs: String, - enums: String, - bytes: String, - json: true -}; - -// Sets up buffer utility according to the environment (called in index-minimal) -util._configure = function() { - var Buffer = util.Buffer; - /* istanbul ignore if */ - if (!Buffer) { - util._Buffer_from = util._Buffer_allocUnsafe = null; - return; - } - // because node 4.x buffers are incompatible & immutable - // see: https://github.com/dcodeIO/protobuf.js/pull/665 - util._Buffer_from = Buffer.from !== Uint8Array.from && Buffer.from || - /* istanbul ignore next */ - function Buffer_from(value, encoding) { - return new Buffer(value, encoding); - }; - util._Buffer_allocUnsafe = Buffer.allocUnsafe || - /* istanbul ignore next */ - function Buffer_allocUnsafe(size) { - return new Buffer(size); - }; -}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/src/verifier.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/src/verifier.js deleted file mode 100644 index d58e27ab..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/src/verifier.js +++ /dev/null @@ -1,177 +0,0 @@ -"use strict"; -module.exports = verifier; - -var Enum = require("./enum"), - util = require("./util"); - -function invalid(field, expected) { - return field.name + ": " + expected + (field.repeated && expected !== "array" ? "[]" : field.map && expected !== "object" ? "{k:"+field.keyType+"}" : "") + " expected"; -} - -/** - * Generates a partial value verifier. - * @param {Codegen} gen Codegen instance - * @param {Field} field Reflected field - * @param {number} fieldIndex Field index - * @param {string} ref Variable reference - * @returns {Codegen} Codegen instance - * @ignore - */ -function genVerifyValue(gen, field, fieldIndex, ref) { - /* eslint-disable no-unexpected-multiline */ - if (field.resolvedType) { - if (field.resolvedType instanceof Enum) { gen - ("switch(%s){", ref) - ("default:") - ("return%j", invalid(field, "enum value")); - for (var keys = Object.keys(field.resolvedType.values), j = 0; j < keys.length; ++j) gen - ("case %i:", field.resolvedType.values[keys[j]]); - gen - ("break") - ("}"); - } else { - gen - ("{") - ("var e=types[%i].verify(%s);", fieldIndex, ref) - ("if(e)") - ("return%j+e", field.name + ".") - ("}"); - } - } else { - switch (field.type) { - case "int32": - case "uint32": - case "sint32": - case "fixed32": - case "sfixed32": gen - ("if(!util.isInteger(%s))", ref) - ("return%j", invalid(field, "integer")); - break; - case "int64": - case "uint64": - case "sint64": - case "fixed64": - case "sfixed64": gen - ("if(!util.isInteger(%s)&&!(%s&&util.isInteger(%s.low)&&util.isInteger(%s.high)))", ref, ref, ref, ref) - ("return%j", invalid(field, "integer|Long")); - break; - case "float": - case "double": gen - ("if(typeof %s!==\"number\")", ref) - ("return%j", invalid(field, "number")); - break; - case "bool": gen - ("if(typeof %s!==\"boolean\")", ref) - ("return%j", invalid(field, "boolean")); - break; - case "string": gen - ("if(!util.isString(%s))", ref) - ("return%j", invalid(field, "string")); - break; - case "bytes": gen - ("if(!(%s&&typeof %s.length===\"number\"||util.isString(%s)))", ref, ref, ref) - ("return%j", invalid(field, "buffer")); - break; - } - } - return gen; - /* eslint-enable no-unexpected-multiline */ -} - -/** - * Generates a partial key verifier. - * @param {Codegen} gen Codegen instance - * @param {Field} field Reflected field - * @param {string} ref Variable reference - * @returns {Codegen} Codegen instance - * @ignore - */ -function genVerifyKey(gen, field, ref) { - /* eslint-disable no-unexpected-multiline */ - switch (field.keyType) { - case "int32": - case "uint32": - case "sint32": - case "fixed32": - case "sfixed32": gen - ("if(!util.key32Re.test(%s))", ref) - ("return%j", invalid(field, "integer key")); - break; - case "int64": - case "uint64": - case "sint64": - case "fixed64": - case "sfixed64": gen - ("if(!util.key64Re.test(%s))", ref) // see comment above: x is ok, d is not - ("return%j", invalid(field, "integer|Long key")); - break; - case "bool": gen - ("if(!util.key2Re.test(%s))", ref) - ("return%j", invalid(field, "boolean key")); - break; - } - return gen; - /* eslint-enable no-unexpected-multiline */ -} - -/** - * Generates a verifier specific to the specified message type. - * @param {Type} mtype Message type - * @returns {Codegen} Codegen instance - */ -function verifier(mtype) { - /* eslint-disable no-unexpected-multiline */ - - var gen = util.codegen(["m"], mtype.name + "$verify") - ("if(typeof m!==\"object\"||m===null)") - ("return%j", "object expected"); - var oneofs = mtype.oneofsArray, - seenFirstField = {}; - if (oneofs.length) gen - ("var p={}"); - - for (var i = 0; i < /* initializes */ mtype.fieldsArray.length; ++i) { - var field = mtype._fieldsArray[i].resolve(), - ref = "m" + util.safeProp(field.name); - - if (field.optional) gen - ("if(%s!=null&&m.hasOwnProperty(%j)){", ref, field.name); // !== undefined && !== null - - // map fields - if (field.map) { gen - ("if(!util.isObject(%s))", ref) - ("return%j", invalid(field, "object")) - ("var k=Object.keys(%s)", ref) - ("for(var i=0;i} - * @const - */ -var wrappers = exports; - -var Message = require("./message"); - -/** - * From object converter part of an {@link IWrapper}. - * @typedef WrapperFromObjectConverter - * @type {function} - * @param {Object.} object Plain object - * @returns {Message<{}>} Message instance - * @this Type - */ - -/** - * To object converter part of an {@link IWrapper}. - * @typedef WrapperToObjectConverter - * @type {function} - * @param {Message<{}>} message Message instance - * @param {IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - * @this Type - */ - -/** - * Common type wrapper part of {@link wrappers}. - * @interface IWrapper - * @property {WrapperFromObjectConverter} [fromObject] From object converter - * @property {WrapperToObjectConverter} [toObject] To object converter - */ - -// Custom wrapper for Any -wrappers[".google.protobuf.Any"] = { - - fromObject: function(object) { - - // unwrap value type if mapped - if (object && object["@type"]) { - // Only use fully qualified type name after the last '/' - var name = object["@type"].substring(object["@type"].lastIndexOf("/") + 1); - var type = this.lookup(name); - /* istanbul ignore else */ - if (type) { - // type_url does not accept leading "." - var type_url = object["@type"].charAt(0) === "." ? - object["@type"].slice(1) : object["@type"]; - // type_url prefix is optional, but path seperator is required - if (type_url.indexOf("/") === -1) { - type_url = "/" + type_url; - } - return this.create({ - type_url: type_url, - value: type.encode(type.fromObject(object)).finish() - }); - } - } - - return this.fromObject(object); - }, - - toObject: function(message, options) { - - // Default prefix - var googleApi = "type.googleapis.com/"; - var prefix = ""; - var name = ""; - - // decode value if requested and unmapped - if (options && options.json && message.type_url && message.value) { - // Only use fully qualified type name after the last '/' - name = message.type_url.substring(message.type_url.lastIndexOf("/") + 1); - // Separate the prefix used - prefix = message.type_url.substring(0, message.type_url.lastIndexOf("/") + 1); - var type = this.lookup(name); - /* istanbul ignore else */ - if (type) - message = type.decode(message.value); - } - - // wrap value if unmapped - if (!(message instanceof this.ctor) && message instanceof Message) { - var object = message.$type.toObject(message, options); - var messageName = message.$type.fullName[0] === "." ? - message.$type.fullName.slice(1) : message.$type.fullName; - // Default to type.googleapis.com prefix if no prefix is used - if (prefix === "") { - prefix = googleApi; - } - name = prefix + messageName; - object["@type"] = name; - return object; - } - - return this.toObject(message, options); - } -}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/src/writer.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/src/writer.js deleted file mode 100644 index cc84a00e..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/src/writer.js +++ /dev/null @@ -1,465 +0,0 @@ -"use strict"; -module.exports = Writer; - -var util = require("./util/minimal"); - -var BufferWriter; // cyclic - -var LongBits = util.LongBits, - base64 = util.base64, - utf8 = util.utf8; - -/** - * Constructs a new writer operation instance. - * @classdesc Scheduled writer operation. - * @constructor - * @param {function(*, Uint8Array, number)} fn Function to call - * @param {number} len Value byte length - * @param {*} val Value to write - * @ignore - */ -function Op(fn, len, val) { - - /** - * Function to call. - * @type {function(Uint8Array, number, *)} - */ - this.fn = fn; - - /** - * Value byte length. - * @type {number} - */ - this.len = len; - - /** - * Next operation. - * @type {Writer.Op|undefined} - */ - this.next = undefined; - - /** - * Value to write. - * @type {*} - */ - this.val = val; // type varies -} - -/* istanbul ignore next */ -function noop() {} // eslint-disable-line no-empty-function - -/** - * Constructs a new writer state instance. - * @classdesc Copied writer state. - * @memberof Writer - * @constructor - * @param {Writer} writer Writer to copy state from - * @ignore - */ -function State(writer) { - - /** - * Current head. - * @type {Writer.Op} - */ - this.head = writer.head; - - /** - * Current tail. - * @type {Writer.Op} - */ - this.tail = writer.tail; - - /** - * Current buffer length. - * @type {number} - */ - this.len = writer.len; - - /** - * Next state. - * @type {State|null} - */ - this.next = writer.states; -} - -/** - * Constructs a new writer instance. - * @classdesc Wire format writer using `Uint8Array` if available, otherwise `Array`. - * @constructor - */ -function Writer() { - - /** - * Current length. - * @type {number} - */ - this.len = 0; - - /** - * Operations head. - * @type {Object} - */ - this.head = new Op(noop, 0, 0); - - /** - * Operations tail - * @type {Object} - */ - this.tail = this.head; - - /** - * Linked forked states. - * @type {Object|null} - */ - this.states = null; - - // When a value is written, the writer calculates its byte length and puts it into a linked - // list of operations to perform when finish() is called. This both allows us to allocate - // buffers of the exact required size and reduces the amount of work we have to do compared - // to first calculating over objects and then encoding over objects. In our case, the encoding - // part is just a linked list walk calling operations with already prepared values. -} - -var create = function create() { - return util.Buffer - ? function create_buffer_setup() { - return (Writer.create = function create_buffer() { - return new BufferWriter(); - })(); - } - /* istanbul ignore next */ - : function create_array() { - return new Writer(); - }; -}; - -/** - * Creates a new writer. - * @function - * @returns {BufferWriter|Writer} A {@link BufferWriter} when Buffers are supported, otherwise a {@link Writer} - */ -Writer.create = create(); - -/** - * Allocates a buffer of the specified size. - * @param {number} size Buffer size - * @returns {Uint8Array} Buffer - */ -Writer.alloc = function alloc(size) { - return new util.Array(size); -}; - -// Use Uint8Array buffer pool in the browser, just like node does with buffers -/* istanbul ignore else */ -if (util.Array !== Array) - Writer.alloc = util.pool(Writer.alloc, util.Array.prototype.subarray); - -/** - * Pushes a new operation to the queue. - * @param {function(Uint8Array, number, *)} fn Function to call - * @param {number} len Value byte length - * @param {number} val Value to write - * @returns {Writer} `this` - * @private - */ -Writer.prototype._push = function push(fn, len, val) { - this.tail = this.tail.next = new Op(fn, len, val); - this.len += len; - return this; -}; - -function writeByte(val, buf, pos) { - buf[pos] = val & 255; -} - -function writeVarint32(val, buf, pos) { - while (val > 127) { - buf[pos++] = val & 127 | 128; - val >>>= 7; - } - buf[pos] = val; -} - -/** - * Constructs a new varint writer operation instance. - * @classdesc Scheduled varint writer operation. - * @extends Op - * @constructor - * @param {number} len Value byte length - * @param {number} val Value to write - * @ignore - */ -function VarintOp(len, val) { - this.len = len; - this.next = undefined; - this.val = val; -} - -VarintOp.prototype = Object.create(Op.prototype); -VarintOp.prototype.fn = writeVarint32; - -/** - * Writes an unsigned 32 bit value as a varint. - * @param {number} value Value to write - * @returns {Writer} `this` - */ -Writer.prototype.uint32 = function write_uint32(value) { - // here, the call to this.push has been inlined and a varint specific Op subclass is used. - // uint32 is by far the most frequently used operation and benefits significantly from this. - this.len += (this.tail = this.tail.next = new VarintOp( - (value = value >>> 0) - < 128 ? 1 - : value < 16384 ? 2 - : value < 2097152 ? 3 - : value < 268435456 ? 4 - : 5, - value)).len; - return this; -}; - -/** - * Writes a signed 32 bit value as a varint. - * @function - * @param {number} value Value to write - * @returns {Writer} `this` - */ -Writer.prototype.int32 = function write_int32(value) { - return value < 0 - ? this._push(writeVarint64, 10, LongBits.fromNumber(value)) // 10 bytes per spec - : this.uint32(value); -}; - -/** - * Writes a 32 bit value as a varint, zig-zag encoded. - * @param {number} value Value to write - * @returns {Writer} `this` - */ -Writer.prototype.sint32 = function write_sint32(value) { - return this.uint32((value << 1 ^ value >> 31) >>> 0); -}; - -function writeVarint64(val, buf, pos) { - while (val.hi) { - buf[pos++] = val.lo & 127 | 128; - val.lo = (val.lo >>> 7 | val.hi << 25) >>> 0; - val.hi >>>= 7; - } - while (val.lo > 127) { - buf[pos++] = val.lo & 127 | 128; - val.lo = val.lo >>> 7; - } - buf[pos++] = val.lo; -} - -/** - * Writes an unsigned 64 bit value as a varint. - * @param {Long|number|string} value Value to write - * @returns {Writer} `this` - * @throws {TypeError} If `value` is a string and no long library is present. - */ -Writer.prototype.uint64 = function write_uint64(value) { - var bits = LongBits.from(value); - return this._push(writeVarint64, bits.length(), bits); -}; - -/** - * Writes a signed 64 bit value as a varint. - * @function - * @param {Long|number|string} value Value to write - * @returns {Writer} `this` - * @throws {TypeError} If `value` is a string and no long library is present. - */ -Writer.prototype.int64 = Writer.prototype.uint64; - -/** - * Writes a signed 64 bit value as a varint, zig-zag encoded. - * @param {Long|number|string} value Value to write - * @returns {Writer} `this` - * @throws {TypeError} If `value` is a string and no long library is present. - */ -Writer.prototype.sint64 = function write_sint64(value) { - var bits = LongBits.from(value).zzEncode(); - return this._push(writeVarint64, bits.length(), bits); -}; - -/** - * Writes a boolish value as a varint. - * @param {boolean} value Value to write - * @returns {Writer} `this` - */ -Writer.prototype.bool = function write_bool(value) { - return this._push(writeByte, 1, value ? 1 : 0); -}; - -function writeFixed32(val, buf, pos) { - buf[pos ] = val & 255; - buf[pos + 1] = val >>> 8 & 255; - buf[pos + 2] = val >>> 16 & 255; - buf[pos + 3] = val >>> 24; -} - -/** - * Writes an unsigned 32 bit value as fixed 32 bits. - * @param {number} value Value to write - * @returns {Writer} `this` - */ -Writer.prototype.fixed32 = function write_fixed32(value) { - return this._push(writeFixed32, 4, value >>> 0); -}; - -/** - * Writes a signed 32 bit value as fixed 32 bits. - * @function - * @param {number} value Value to write - * @returns {Writer} `this` - */ -Writer.prototype.sfixed32 = Writer.prototype.fixed32; - -/** - * Writes an unsigned 64 bit value as fixed 64 bits. - * @param {Long|number|string} value Value to write - * @returns {Writer} `this` - * @throws {TypeError} If `value` is a string and no long library is present. - */ -Writer.prototype.fixed64 = function write_fixed64(value) { - var bits = LongBits.from(value); - return this._push(writeFixed32, 4, bits.lo)._push(writeFixed32, 4, bits.hi); -}; - -/** - * Writes a signed 64 bit value as fixed 64 bits. - * @function - * @param {Long|number|string} value Value to write - * @returns {Writer} `this` - * @throws {TypeError} If `value` is a string and no long library is present. - */ -Writer.prototype.sfixed64 = Writer.prototype.fixed64; - -/** - * Writes a float (32 bit). - * @function - * @param {number} value Value to write - * @returns {Writer} `this` - */ -Writer.prototype.float = function write_float(value) { - return this._push(util.float.writeFloatLE, 4, value); -}; - -/** - * Writes a double (64 bit float). - * @function - * @param {number} value Value to write - * @returns {Writer} `this` - */ -Writer.prototype.double = function write_double(value) { - return this._push(util.float.writeDoubleLE, 8, value); -}; - -var writeBytes = util.Array.prototype.set - ? function writeBytes_set(val, buf, pos) { - buf.set(val, pos); // also works for plain array values - } - /* istanbul ignore next */ - : function writeBytes_for(val, buf, pos) { - for (var i = 0; i < val.length; ++i) - buf[pos + i] = val[i]; - }; - -/** - * Writes a sequence of bytes. - * @param {Uint8Array|string} value Buffer or base64 encoded string to write - * @returns {Writer} `this` - */ -Writer.prototype.bytes = function write_bytes(value) { - var len = value.length >>> 0; - if (!len) - return this._push(writeByte, 1, 0); - if (util.isString(value)) { - var buf = Writer.alloc(len = base64.length(value)); - base64.decode(value, buf, 0); - value = buf; - } - return this.uint32(len)._push(writeBytes, len, value); -}; - -/** - * Writes a string. - * @param {string} value Value to write - * @returns {Writer} `this` - */ -Writer.prototype.string = function write_string(value) { - var len = utf8.length(value); - return len - ? this.uint32(len)._push(utf8.write, len, value) - : this._push(writeByte, 1, 0); -}; - -/** - * Forks this writer's state by pushing it to a stack. - * Calling {@link Writer#reset|reset} or {@link Writer#ldelim|ldelim} resets the writer to the previous state. - * @returns {Writer} `this` - */ -Writer.prototype.fork = function fork() { - this.states = new State(this); - this.head = this.tail = new Op(noop, 0, 0); - this.len = 0; - return this; -}; - -/** - * Resets this instance to the last state. - * @returns {Writer} `this` - */ -Writer.prototype.reset = function reset() { - if (this.states) { - this.head = this.states.head; - this.tail = this.states.tail; - this.len = this.states.len; - this.states = this.states.next; - } else { - this.head = this.tail = new Op(noop, 0, 0); - this.len = 0; - } - return this; -}; - -/** - * Resets to the last state and appends the fork state's current write length as a varint followed by its operations. - * @returns {Writer} `this` - */ -Writer.prototype.ldelim = function ldelim() { - var head = this.head, - tail = this.tail, - len = this.len; - this.reset().uint32(len); - if (len) { - this.tail.next = head.next; // skip noop - this.tail = tail; - this.len += len; - } - return this; -}; - -/** - * Finishes the write operation. - * @returns {Uint8Array} Finished buffer - */ -Writer.prototype.finish = function finish() { - var head = this.head.next, // skip noop - buf = this.constructor.alloc(this.len), - pos = 0; - while (head) { - head.fn(head.val, buf, pos); - pos += head.len; - head = head.next; - } - // this.head = this.tail = null; - return buf; -}; - -Writer._configure = function(BufferWriter_) { - BufferWriter = BufferWriter_; - Writer.create = create(); - BufferWriter._configure(); -}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/src/writer_buffer.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/src/writer_buffer.js deleted file mode 100644 index 09a4a912..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/src/writer_buffer.js +++ /dev/null @@ -1,85 +0,0 @@ -"use strict"; -module.exports = BufferWriter; - -// extends Writer -var Writer = require("./writer"); -(BufferWriter.prototype = Object.create(Writer.prototype)).constructor = BufferWriter; - -var util = require("./util/minimal"); - -/** - * Constructs a new buffer writer instance. - * @classdesc Wire format writer using node buffers. - * @extends Writer - * @constructor - */ -function BufferWriter() { - Writer.call(this); -} - -BufferWriter._configure = function () { - /** - * Allocates a buffer of the specified size. - * @function - * @param {number} size Buffer size - * @returns {Buffer} Buffer - */ - BufferWriter.alloc = util._Buffer_allocUnsafe; - - BufferWriter.writeBytesBuffer = util.Buffer && util.Buffer.prototype instanceof Uint8Array && util.Buffer.prototype.set.name === "set" - ? function writeBytesBuffer_set(val, buf, pos) { - buf.set(val, pos); // faster than copy (requires node >= 4 where Buffers extend Uint8Array and set is properly inherited) - // also works for plain array values - } - /* istanbul ignore next */ - : function writeBytesBuffer_copy(val, buf, pos) { - if (val.copy) // Buffer values - val.copy(buf, pos, 0, val.length); - else for (var i = 0; i < val.length;) // plain array values - buf[pos++] = val[i++]; - }; -}; - - -/** - * @override - */ -BufferWriter.prototype.bytes = function write_bytes_buffer(value) { - if (util.isString(value)) - value = util._Buffer_from(value, "base64"); - var len = value.length >>> 0; - this.uint32(len); - if (len) - this._push(BufferWriter.writeBytesBuffer, len, value); - return this; -}; - -function writeStringBuffer(val, buf, pos) { - if (val.length < 40) // plain js is faster for short strings (probably due to redundant assertions) - util.utf8.write(val, buf, pos); - else if (buf.utf8Write) - buf.utf8Write(val, pos); - else - buf.write(val, pos); -} - -/** - * @override - */ -BufferWriter.prototype.string = function write_string_buffer(value) { - var len = util.Buffer.byteLength(value); - this.uint32(len); - if (len) - this._push(writeStringBuffer, len, value); - return this; -}; - - -/** - * Finishes the write operation. - * @name BufferWriter#finish - * @function - * @returns {Buffer} Finished buffer - */ - -BufferWriter._configure(); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/tsconfig.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/tsconfig.json deleted file mode 100644 index a0b3639c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/protobufjs/tsconfig.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "compilerOptions": { - "target": "ES5", - "experimentalDecorators": true, - "emitDecoratorMetadata": true, - "esModuleInterop": true, - } -} \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/pseudomap/LICENSE b/packages/wyatt_notification_bloc/example/scripts/node_modules/pseudomap/LICENSE deleted file mode 100644 index 19129e31..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/pseudomap/LICENSE +++ /dev/null @@ -1,15 +0,0 @@ -The ISC License - -Copyright (c) Isaac Z. Schlueter and Contributors - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR -IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/pseudomap/README.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/pseudomap/README.md deleted file mode 100644 index 778bf01d..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/pseudomap/README.md +++ /dev/null @@ -1,60 +0,0 @@ -# pseudomap - -A thing that is a lot like ES6 `Map`, but without iterators, for use -in environments where `for..of` syntax and `Map` are not available. - -If you need iterators, or just in general a more faithful polyfill to -ES6 Maps, check out [es6-map](http://npm.im/es6-map). - -If you are in an environment where `Map` is supported, then that will -be returned instead, unless `process.env.TEST_PSEUDOMAP` is set. - -You can use any value as keys, and any value as data. Setting again -with the identical key will overwrite the previous value. - -Internally, data is stored on an `Object.create(null)` style object. -The key is coerced to a string to generate the key on the internal -data-bag object. The original key used is stored along with the data. - -In the event of a stringified-key collision, a new key is generated by -appending an increasing number to the stringified-key until finding -either the intended key or an empty spot. - -Note that because object traversal order of plain objects is not -guaranteed to be identical to insertion order, the insertion order -guarantee of `Map.prototype.forEach` is not guaranteed in this -implementation. However, in all versions of Node.js and V8 where this -module works, `forEach` does traverse data in insertion order. - -## API - -Most of the [Map -API](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map), -with the following exceptions: - -1. A `Map` object is not an iterator. -2. `values`, `keys`, and `entries` methods are not implemented, - because they return iterators. -3. The argument to the constructor can be an Array of `[key, value]` - pairs, or a `Map` or `PseudoMap` object. But, since iterators - aren't used, passing any plain-old iterator won't initialize the - map properly. - -## USAGE - -Use just like a regular ES6 Map. - -```javascript -var PseudoMap = require('pseudomap') - -// optionally provide a pseudomap, or an array of [key,value] pairs -// as the argument to initialize the map with -var myMap = new PseudoMap() - -myMap.set(1, 'number 1') -myMap.set('1', 'string 1') -var akey = {} -var bkey = {} -myMap.set(akey, { some: 'data' }) -myMap.set(bkey, { some: 'other data' }) -``` diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/pseudomap/map.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/pseudomap/map.js deleted file mode 100644 index 7db15994..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/pseudomap/map.js +++ /dev/null @@ -1,9 +0,0 @@ -if (process.env.npm_package_name === 'pseudomap' && - process.env.npm_lifecycle_script === 'test') - process.env.TEST_PSEUDOMAP = 'true' - -if (typeof Map === 'function' && !process.env.TEST_PSEUDOMAP) { - module.exports = Map -} else { - module.exports = require('./pseudomap') -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/pseudomap/package.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/pseudomap/package.json deleted file mode 100644 index 4b02ab7c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/pseudomap/package.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "name": "pseudomap", - "version": "1.0.2", - "description": "A thing that is a lot like ES6 `Map`, but without iterators, for use in environments where `for..of` syntax and `Map` are not available.", - "main": "map.js", - "directories": { - "test": "test" - }, - "devDependencies": { - "tap": "^2.3.1" - }, - "scripts": { - "test": "tap test/*.js" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/isaacs/pseudomap.git" - }, - "author": "Isaac Z. Schlueter (http://blog.izs.me/)", - "license": "ISC", - "bugs": { - "url": "https://github.com/isaacs/pseudomap/issues" - }, - "homepage": "https://github.com/isaacs/pseudomap#readme" -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/pseudomap/pseudomap.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/pseudomap/pseudomap.js deleted file mode 100644 index 25a21d82..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/pseudomap/pseudomap.js +++ /dev/null @@ -1,113 +0,0 @@ -var hasOwnProperty = Object.prototype.hasOwnProperty - -module.exports = PseudoMap - -function PseudoMap (set) { - if (!(this instanceof PseudoMap)) // whyyyyyyy - throw new TypeError("Constructor PseudoMap requires 'new'") - - this.clear() - - if (set) { - if ((set instanceof PseudoMap) || - (typeof Map === 'function' && set instanceof Map)) - set.forEach(function (value, key) { - this.set(key, value) - }, this) - else if (Array.isArray(set)) - set.forEach(function (kv) { - this.set(kv[0], kv[1]) - }, this) - else - throw new TypeError('invalid argument') - } -} - -PseudoMap.prototype.forEach = function (fn, thisp) { - thisp = thisp || this - Object.keys(this._data).forEach(function (k) { - if (k !== 'size') - fn.call(thisp, this._data[k].value, this._data[k].key) - }, this) -} - -PseudoMap.prototype.has = function (k) { - return !!find(this._data, k) -} - -PseudoMap.prototype.get = function (k) { - var res = find(this._data, k) - return res && res.value -} - -PseudoMap.prototype.set = function (k, v) { - set(this._data, k, v) -} - -PseudoMap.prototype.delete = function (k) { - var res = find(this._data, k) - if (res) { - delete this._data[res._index] - this._data.size-- - } -} - -PseudoMap.prototype.clear = function () { - var data = Object.create(null) - data.size = 0 - - Object.defineProperty(this, '_data', { - value: data, - enumerable: false, - configurable: true, - writable: false - }) -} - -Object.defineProperty(PseudoMap.prototype, 'size', { - get: function () { - return this._data.size - }, - set: function (n) {}, - enumerable: true, - configurable: true -}) - -PseudoMap.prototype.values = -PseudoMap.prototype.keys = -PseudoMap.prototype.entries = function () { - throw new Error('iterators are not implemented in this version') -} - -// Either identical, or both NaN -function same (a, b) { - return a === b || a !== a && b !== b -} - -function Entry (k, v, i) { - this.key = k - this.value = v - this._index = i -} - -function find (data, k) { - for (var i = 0, s = '_' + k, key = s; - hasOwnProperty.call(data, key); - key = s + i++) { - if (same(data[key].key, k)) - return data[key] - } -} - -function set (data, k, v) { - for (var i = 0, s = '_' + k, key = s; - hasOwnProperty.call(data, key); - key = s + i++) { - if (same(data[key].key, k)) { - data[key].value = v - return - } - } - data.size++ - data[key] = new Entry(k, v, key) -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/pseudomap/test/basic.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/pseudomap/test/basic.js deleted file mode 100644 index 4378e454..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/pseudomap/test/basic.js +++ /dev/null @@ -1,86 +0,0 @@ -var t = require('tap') - -process.env.TEST_PSEUDOMAP = 'true' - -var PM = require('../') -runTests(PM) - -// if possible, verify that Map also behaves the same way -if (typeof Map === 'function') - runTests(Map) - - -function runTests (Map) { - t.throws(Map) - - var m = new Map() - - t.equal(m.size, 0) - - m.set(1, '1 string') - t.equal(m.get(1), '1 string') - t.equal(m.size, 1) - m.size = 1000 - t.equal(m.size, 1) - m.size = 0 - t.equal(m.size, 1) - - m = new Map([[1, 'number 1'], ['1', 'string 1']]) - t.equal(m.get(1), 'number 1') - t.equal(m.get('1'), 'string 1') - t.equal(m.size, 2) - - m = new Map(m) - t.equal(m.get(1), 'number 1') - t.equal(m.get('1'), 'string 1') - t.equal(m.size, 2) - - var akey = {} - var bkey = {} - m.set(akey, { some: 'data' }) - m.set(bkey, { some: 'other data' }) - t.same(m.get(akey), { some: 'data' }) - t.same(m.get(bkey), { some: 'other data' }) - t.equal(m.size, 4) - - var x = /x/ - var y = /x/ - m.set(x, 'x regex') - m.set(y, 'y regex') - t.equal(m.get(x), 'x regex') - m.set(x, 'x again') - t.equal(m.get(x), 'x again') - t.equal(m.size, 6) - - m.set(NaN, 'not a number') - t.equal(m.get(NaN), 'not a number') - m.set(NaN, 'it is a ' + typeof NaN) - t.equal(m.get(NaN), 'it is a number') - m.set('NaN', 'stringie nan') - t.equal(m.get(NaN), 'it is a number') - t.equal(m.get('NaN'), 'stringie nan') - t.equal(m.size, 8) - - m.delete(NaN) - t.equal(m.get(NaN), undefined) - t.equal(m.size, 7) - - var expect = [ - { value: 'number 1', key: 1 }, - { value: 'string 1', key: '1' }, - { value: { some: 'data' }, key: {} }, - { value: { some: 'other data' }, key: {} }, - { value: 'x again', key: /x/ }, - { value: 'y regex', key: /x/ }, - { value: 'stringie nan', key: 'NaN' } - ] - var actual = [] - - m.forEach(function (value, key) { - actual.push({ value: value, key: key }) - }) - t.same(actual, expect) - - m.clear() - t.equal(m.size, 0) -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/readable-stream/CONTRIBUTING.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/readable-stream/CONTRIBUTING.md deleted file mode 100644 index f478d58d..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/readable-stream/CONTRIBUTING.md +++ /dev/null @@ -1,38 +0,0 @@ -# Developer's Certificate of Origin 1.1 - -By making a contribution to this project, I certify that: - -* (a) The contribution was created in whole or in part by me and I - have the right to submit it under the open source license - indicated in the file; or - -* (b) The contribution is based upon previous work that, to the best - of my knowledge, is covered under an appropriate open source - license and I have the right under that license to submit that - work with modifications, whether created in whole or in part - by me, under the same open source license (unless I am - permitted to submit under a different license), as indicated - in the file; or - -* (c) The contribution was provided directly to me by some other - person who certified (a), (b) or (c) and I have not modified - it. - -* (d) I understand and agree that this project and the contribution - are public and that a record of the contribution (including all - personal information I submit with it, including my sign-off) is - maintained indefinitely and may be redistributed consistent with - this project or the open source license(s) involved. - -## Moderation Policy - -The [Node.js Moderation Policy] applies to this WG. - -## Code of Conduct - -The [Node.js Code of Conduct][] applies to this WG. - -[Node.js Code of Conduct]: -https://github.com/nodejs/node/blob/master/CODE_OF_CONDUCT.md -[Node.js Moderation Policy]: -https://github.com/nodejs/TSC/blob/master/Moderation-Policy.md diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/readable-stream/GOVERNANCE.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/readable-stream/GOVERNANCE.md deleted file mode 100644 index 16ffb93f..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/readable-stream/GOVERNANCE.md +++ /dev/null @@ -1,136 +0,0 @@ -### Streams Working Group - -The Node.js Streams is jointly governed by a Working Group -(WG) -that is responsible for high-level guidance of the project. - -The WG has final authority over this project including: - -* Technical direction -* Project governance and process (including this policy) -* Contribution policy -* GitHub repository hosting -* Conduct guidelines -* Maintaining the list of additional Collaborators - -For the current list of WG members, see the project -[README.md](./README.md#current-project-team-members). - -### Collaborators - -The readable-stream GitHub repository is -maintained by the WG and additional Collaborators who are added by the -WG on an ongoing basis. - -Individuals making significant and valuable contributions are made -Collaborators and given commit-access to the project. These -individuals are identified by the WG and their addition as -Collaborators is discussed during the WG meeting. - -_Note:_ If you make a significant contribution and are not considered -for commit-access log an issue or contact a WG member directly and it -will be brought up in the next WG meeting. - -Modifications of the contents of the readable-stream repository are -made on -a collaborative basis. Anybody with a GitHub account may propose a -modification via pull request and it will be considered by the project -Collaborators. All pull requests must be reviewed and accepted by a -Collaborator with sufficient expertise who is able to take full -responsibility for the change. In the case of pull requests proposed -by an existing Collaborator, an additional Collaborator is required -for sign-off. Consensus should be sought if additional Collaborators -participate and there is disagreement around a particular -modification. See _Consensus Seeking Process_ below for further detail -on the consensus model used for governance. - -Collaborators may opt to elevate significant or controversial -modifications, or modifications that have not found consensus to the -WG for discussion by assigning the ***WG-agenda*** tag to a pull -request or issue. The WG should serve as the final arbiter where -required. - -For the current list of Collaborators, see the project -[README.md](./README.md#members). - -### WG Membership - -WG seats are not time-limited. There is no fixed size of the WG. -However, the expected target is between 6 and 12, to ensure adequate -coverage of important areas of expertise, balanced with the ability to -make decisions efficiently. - -There is no specific set of requirements or qualifications for WG -membership beyond these rules. - -The WG may add additional members to the WG by unanimous consensus. - -A WG member may be removed from the WG by voluntary resignation, or by -unanimous consensus of all other WG members. - -Changes to WG membership should be posted in the agenda, and may be -suggested as any other agenda item (see "WG Meetings" below). - -If an addition or removal is proposed during a meeting, and the full -WG is not in attendance to participate, then the addition or removal -is added to the agenda for the subsequent meeting. This is to ensure -that all members are given the opportunity to participate in all -membership decisions. If a WG member is unable to attend a meeting -where a planned membership decision is being made, then their consent -is assumed. - -No more than 1/3 of the WG members may be affiliated with the same -employer. If removal or resignation of a WG member, or a change of -employment by a WG member, creates a situation where more than 1/3 of -the WG membership shares an employer, then the situation must be -immediately remedied by the resignation or removal of one or more WG -members affiliated with the over-represented employer(s). - -### WG Meetings - -The WG meets occasionally on a Google Hangout On Air. A designated moderator -approved by the WG runs the meeting. Each meeting should be -published to YouTube. - -Items are added to the WG agenda that are considered contentious or -are modifications of governance, contribution policy, WG membership, -or release process. - -The intention of the agenda is not to approve or review all patches; -that should happen continuously on GitHub and be handled by the larger -group of Collaborators. - -Any community member or contributor can ask that something be added to -the next meeting's agenda by logging a GitHub Issue. Any Collaborator, -WG member or the moderator can add the item to the agenda by adding -the ***WG-agenda*** tag to the issue. - -Prior to each WG meeting the moderator will share the Agenda with -members of the WG. WG members can add any items they like to the -agenda at the beginning of each meeting. The moderator and the WG -cannot veto or remove items. - -The WG may invite persons or representatives from certain projects to -participate in a non-voting capacity. - -The moderator is responsible for summarizing the discussion of each -agenda item and sends it as a pull request after the meeting. - -### Consensus Seeking Process - -The WG follows a -[Consensus -Seeking](http://en.wikipedia.org/wiki/Consensus-seeking_decision-making) -decision-making model. - -When an agenda item has appeared to reach a consensus the moderator -will ask "Does anyone object?" as a final call for dissent from the -consensus. - -If an agenda item cannot reach a consensus a WG member can call for -either a closing vote or a vote to table the issue to the next -meeting. The call for a vote must be seconded by a majority of the WG -or else the discussion will continue. Simple majority wins. - -Note that changes to WG membership require a majority consensus. See -"WG Membership" above. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/readable-stream/LICENSE b/packages/wyatt_notification_bloc/example/scripts/node_modules/readable-stream/LICENSE deleted file mode 100644 index 2873b3b2..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/readable-stream/LICENSE +++ /dev/null @@ -1,47 +0,0 @@ -Node.js is licensed for use as follows: - -""" -Copyright Node.js contributors. All rights reserved. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to -deal in the Software without restriction, including without limitation the -rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -sell copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -IN THE SOFTWARE. -""" - -This license applies to parts of Node.js originating from the -https://github.com/joyent/node repository: - -""" -Copyright Joyent, Inc. and other Node contributors. All rights reserved. -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to -deal in the Software without restriction, including without limitation the -rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -sell copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -IN THE SOFTWARE. -""" diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/readable-stream/README.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/readable-stream/README.md deleted file mode 100644 index 6f035ab1..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/readable-stream/README.md +++ /dev/null @@ -1,106 +0,0 @@ -# readable-stream - -***Node.js core streams for userland*** [![Build Status](https://travis-ci.com/nodejs/readable-stream.svg?branch=master)](https://travis-ci.com/nodejs/readable-stream) - - -[![NPM](https://nodei.co/npm/readable-stream.png?downloads=true&downloadRank=true)](https://nodei.co/npm/readable-stream/) -[![NPM](https://nodei.co/npm-dl/readable-stream.png?&months=6&height=3)](https://nodei.co/npm/readable-stream/) - - -[![Sauce Test Status](https://saucelabs.com/browser-matrix/readabe-stream.svg)](https://saucelabs.com/u/readabe-stream) - -```bash -npm install --save readable-stream -``` - -This package is a mirror of the streams implementations in Node.js. - -Full documentation may be found on the [Node.js website](https://nodejs.org/dist/v10.19.0/docs/api/stream.html). - -If you want to guarantee a stable streams base, regardless of what version of -Node you, or the users of your libraries are using, use **readable-stream** *only* and avoid the *"stream"* module in Node-core, for background see [this blogpost](http://r.va.gg/2014/06/why-i-dont-use-nodes-core-stream-module.html). - -As of version 2.0.0 **readable-stream** uses semantic versioning. - -## Version 3.x.x - -v3.x.x of `readable-stream` is a cut from Node 10. This version supports Node 6, 8, and 10, as well as evergreen browsers, IE 11 and latest Safari. The breaking changes introduced by v3 are composed by the combined breaking changes in [Node v9](https://nodejs.org/en/blog/release/v9.0.0/) and [Node v10](https://nodejs.org/en/blog/release/v10.0.0/), as follows: - -1. Error codes: https://github.com/nodejs/node/pull/13310, - https://github.com/nodejs/node/pull/13291, - https://github.com/nodejs/node/pull/16589, - https://github.com/nodejs/node/pull/15042, - https://github.com/nodejs/node/pull/15665, - https://github.com/nodejs/readable-stream/pull/344 -2. 'readable' have precedence over flowing - https://github.com/nodejs/node/pull/18994 -3. make virtual methods errors consistent - https://github.com/nodejs/node/pull/18813 -4. updated streams error handling - https://github.com/nodejs/node/pull/18438 -5. writable.end should return this. - https://github.com/nodejs/node/pull/18780 -6. readable continues to read when push('') - https://github.com/nodejs/node/pull/18211 -7. add custom inspect to BufferList - https://github.com/nodejs/node/pull/17907 -8. always defer 'readable' with nextTick - https://github.com/nodejs/node/pull/17979 - -## Version 2.x.x -v2.x.x of `readable-stream` is a cut of the stream module from Node 8 (there have been no semver-major changes from Node 4 to 8). This version supports all Node.js versions from 0.8, as well as evergreen browsers and IE 10 & 11. - -### Big Thanks - -Cross-browser Testing Platform and Open Source <3 Provided by [Sauce Labs][sauce] - -# Usage - -You can swap your `require('stream')` with `require('readable-stream')` -without any changes, if you are just using one of the main classes and -functions. - -```js -const { - Readable, - Writable, - Transform, - Duplex, - pipeline, - finished -} = require('readable-stream') -```` - -Note that `require('stream')` will return `Stream`, while -`require('readable-stream')` will return `Readable`. We discourage using -whatever is exported directly, but rather use one of the properties as -shown in the example above. - -# Streams Working Group - -`readable-stream` is maintained by the Streams Working Group, which -oversees the development and maintenance of the Streams API within -Node.js. The responsibilities of the Streams Working Group include: - -* Addressing stream issues on the Node.js issue tracker. -* Authoring and editing stream documentation within the Node.js project. -* Reviewing changes to stream subclasses within the Node.js project. -* Redirecting changes to streams from the Node.js project to this - project. -* Assisting in the implementation of stream providers within Node.js. -* Recommending versions of `readable-stream` to be included in Node.js. -* Messaging about the future of streams to give the community advance - notice of changes. - - -## Team Members - -* **Calvin Metcalf** ([@calvinmetcalf](https://github.com/calvinmetcalf)) <calvin.metcalf@gmail.com> - - Release GPG key: F3EF5F62A87FC27A22E643F714CE4FF5015AA242 -* **Mathias Buus** ([@mafintosh](https://github.com/mafintosh)) <mathiasbuus@gmail.com> -* **Matteo Collina** ([@mcollina](https://github.com/mcollina)) <matteo.collina@gmail.com> - - Release GPG key: 3ABC01543F22DD2239285CDD818674489FBC127E -* **Irina Shestak** ([@lrlna](https://github.com/lrlna)) <shestak.irina@gmail.com> -* **Yoshua Wyuts** ([@yoshuawuyts](https://github.com/yoshuawuyts)) <yoshuawuyts@gmail.com> - -[sauce]: https://saucelabs.com diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/readable-stream/errors-browser.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/readable-stream/errors-browser.js deleted file mode 100644 index fb8e73e1..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/readable-stream/errors-browser.js +++ /dev/null @@ -1,127 +0,0 @@ -'use strict'; - -function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; } - -var codes = {}; - -function createErrorType(code, message, Base) { - if (!Base) { - Base = Error; - } - - function getMessage(arg1, arg2, arg3) { - if (typeof message === 'string') { - return message; - } else { - return message(arg1, arg2, arg3); - } - } - - var NodeError = - /*#__PURE__*/ - function (_Base) { - _inheritsLoose(NodeError, _Base); - - function NodeError(arg1, arg2, arg3) { - return _Base.call(this, getMessage(arg1, arg2, arg3)) || this; - } - - return NodeError; - }(Base); - - NodeError.prototype.name = Base.name; - NodeError.prototype.code = code; - codes[code] = NodeError; -} // https://github.com/nodejs/node/blob/v10.8.0/lib/internal/errors.js - - -function oneOf(expected, thing) { - if (Array.isArray(expected)) { - var len = expected.length; - expected = expected.map(function (i) { - return String(i); - }); - - if (len > 2) { - return "one of ".concat(thing, " ").concat(expected.slice(0, len - 1).join(', '), ", or ") + expected[len - 1]; - } else if (len === 2) { - return "one of ".concat(thing, " ").concat(expected[0], " or ").concat(expected[1]); - } else { - return "of ".concat(thing, " ").concat(expected[0]); - } - } else { - return "of ".concat(thing, " ").concat(String(expected)); - } -} // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith - - -function startsWith(str, search, pos) { - return str.substr(!pos || pos < 0 ? 0 : +pos, search.length) === search; -} // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/endsWith - - -function endsWith(str, search, this_len) { - if (this_len === undefined || this_len > str.length) { - this_len = str.length; - } - - return str.substring(this_len - search.length, this_len) === search; -} // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes - - -function includes(str, search, start) { - if (typeof start !== 'number') { - start = 0; - } - - if (start + search.length > str.length) { - return false; - } else { - return str.indexOf(search, start) !== -1; - } -} - -createErrorType('ERR_INVALID_OPT_VALUE', function (name, value) { - return 'The value "' + value + '" is invalid for option "' + name + '"'; -}, TypeError); -createErrorType('ERR_INVALID_ARG_TYPE', function (name, expected, actual) { - // determiner: 'must be' or 'must not be' - var determiner; - - if (typeof expected === 'string' && startsWith(expected, 'not ')) { - determiner = 'must not be'; - expected = expected.replace(/^not /, ''); - } else { - determiner = 'must be'; - } - - var msg; - - if (endsWith(name, ' argument')) { - // For cases like 'first argument' - msg = "The ".concat(name, " ").concat(determiner, " ").concat(oneOf(expected, 'type')); - } else { - var type = includes(name, '.') ? 'property' : 'argument'; - msg = "The \"".concat(name, "\" ").concat(type, " ").concat(determiner, " ").concat(oneOf(expected, 'type')); - } - - msg += ". Received type ".concat(typeof actual); - return msg; -}, TypeError); -createErrorType('ERR_STREAM_PUSH_AFTER_EOF', 'stream.push() after EOF'); -createErrorType('ERR_METHOD_NOT_IMPLEMENTED', function (name) { - return 'The ' + name + ' method is not implemented'; -}); -createErrorType('ERR_STREAM_PREMATURE_CLOSE', 'Premature close'); -createErrorType('ERR_STREAM_DESTROYED', function (name) { - return 'Cannot call ' + name + ' after a stream was destroyed'; -}); -createErrorType('ERR_MULTIPLE_CALLBACK', 'Callback called multiple times'); -createErrorType('ERR_STREAM_CANNOT_PIPE', 'Cannot pipe, not readable'); -createErrorType('ERR_STREAM_WRITE_AFTER_END', 'write after end'); -createErrorType('ERR_STREAM_NULL_VALUES', 'May not write null values to stream', TypeError); -createErrorType('ERR_UNKNOWN_ENCODING', function (arg) { - return 'Unknown encoding: ' + arg; -}, TypeError); -createErrorType('ERR_STREAM_UNSHIFT_AFTER_END_EVENT', 'stream.unshift() after end event'); -module.exports.codes = codes; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/readable-stream/errors.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/readable-stream/errors.js deleted file mode 100644 index 8471526d..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/readable-stream/errors.js +++ /dev/null @@ -1,116 +0,0 @@ -'use strict'; - -const codes = {}; - -function createErrorType(code, message, Base) { - if (!Base) { - Base = Error - } - - function getMessage (arg1, arg2, arg3) { - if (typeof message === 'string') { - return message - } else { - return message(arg1, arg2, arg3) - } - } - - class NodeError extends Base { - constructor (arg1, arg2, arg3) { - super(getMessage(arg1, arg2, arg3)); - } - } - - NodeError.prototype.name = Base.name; - NodeError.prototype.code = code; - - codes[code] = NodeError; -} - -// https://github.com/nodejs/node/blob/v10.8.0/lib/internal/errors.js -function oneOf(expected, thing) { - if (Array.isArray(expected)) { - const len = expected.length; - expected = expected.map((i) => String(i)); - if (len > 2) { - return `one of ${thing} ${expected.slice(0, len - 1).join(', ')}, or ` + - expected[len - 1]; - } else if (len === 2) { - return `one of ${thing} ${expected[0]} or ${expected[1]}`; - } else { - return `of ${thing} ${expected[0]}`; - } - } else { - return `of ${thing} ${String(expected)}`; - } -} - -// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith -function startsWith(str, search, pos) { - return str.substr(!pos || pos < 0 ? 0 : +pos, search.length) === search; -} - -// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/endsWith -function endsWith(str, search, this_len) { - if (this_len === undefined || this_len > str.length) { - this_len = str.length; - } - return str.substring(this_len - search.length, this_len) === search; -} - -// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes -function includes(str, search, start) { - if (typeof start !== 'number') { - start = 0; - } - - if (start + search.length > str.length) { - return false; - } else { - return str.indexOf(search, start) !== -1; - } -} - -createErrorType('ERR_INVALID_OPT_VALUE', function (name, value) { - return 'The value "' + value + '" is invalid for option "' + name + '"' -}, TypeError); -createErrorType('ERR_INVALID_ARG_TYPE', function (name, expected, actual) { - // determiner: 'must be' or 'must not be' - let determiner; - if (typeof expected === 'string' && startsWith(expected, 'not ')) { - determiner = 'must not be'; - expected = expected.replace(/^not /, ''); - } else { - determiner = 'must be'; - } - - let msg; - if (endsWith(name, ' argument')) { - // For cases like 'first argument' - msg = `The ${name} ${determiner} ${oneOf(expected, 'type')}`; - } else { - const type = includes(name, '.') ? 'property' : 'argument'; - msg = `The "${name}" ${type} ${determiner} ${oneOf(expected, 'type')}`; - } - - msg += `. Received type ${typeof actual}`; - return msg; -}, TypeError); -createErrorType('ERR_STREAM_PUSH_AFTER_EOF', 'stream.push() after EOF'); -createErrorType('ERR_METHOD_NOT_IMPLEMENTED', function (name) { - return 'The ' + name + ' method is not implemented' -}); -createErrorType('ERR_STREAM_PREMATURE_CLOSE', 'Premature close'); -createErrorType('ERR_STREAM_DESTROYED', function (name) { - return 'Cannot call ' + name + ' after a stream was destroyed'; -}); -createErrorType('ERR_MULTIPLE_CALLBACK', 'Callback called multiple times'); -createErrorType('ERR_STREAM_CANNOT_PIPE', 'Cannot pipe, not readable'); -createErrorType('ERR_STREAM_WRITE_AFTER_END', 'write after end'); -createErrorType('ERR_STREAM_NULL_VALUES', 'May not write null values to stream', TypeError); -createErrorType('ERR_UNKNOWN_ENCODING', function (arg) { - return 'Unknown encoding: ' + arg -}, TypeError); -createErrorType('ERR_STREAM_UNSHIFT_AFTER_END_EVENT', 'stream.unshift() after end event'); - -module.exports.codes = codes; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/readable-stream/experimentalWarning.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/readable-stream/experimentalWarning.js deleted file mode 100644 index 78e84149..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/readable-stream/experimentalWarning.js +++ /dev/null @@ -1,17 +0,0 @@ -'use strict' - -var experimentalWarnings = new Set(); - -function emitExperimentalWarning(feature) { - if (experimentalWarnings.has(feature)) return; - var msg = feature + ' is an experimental feature. This feature could ' + - 'change at any time'; - experimentalWarnings.add(feature); - process.emitWarning(msg, 'ExperimentalWarning'); -} - -function noop() {} - -module.exports.emitExperimentalWarning = process.emitWarning - ? emitExperimentalWarning - : noop; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/readable-stream/lib/_stream_duplex.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/readable-stream/lib/_stream_duplex.js deleted file mode 100644 index 67525192..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/readable-stream/lib/_stream_duplex.js +++ /dev/null @@ -1,139 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. -// a duplex stream is just a stream that is both readable and writable. -// Since JS doesn't have multiple prototypal inheritance, this class -// prototypally inherits from Readable, and then parasitically from -// Writable. -'use strict'; -/**/ - -var objectKeys = Object.keys || function (obj) { - var keys = []; - - for (var key in obj) { - keys.push(key); - } - - return keys; -}; -/**/ - - -module.exports = Duplex; - -var Readable = require('./_stream_readable'); - -var Writable = require('./_stream_writable'); - -require('inherits')(Duplex, Readable); - -{ - // Allow the keys array to be GC'ed. - var keys = objectKeys(Writable.prototype); - - for (var v = 0; v < keys.length; v++) { - var method = keys[v]; - if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method]; - } -} - -function Duplex(options) { - if (!(this instanceof Duplex)) return new Duplex(options); - Readable.call(this, options); - Writable.call(this, options); - this.allowHalfOpen = true; - - if (options) { - if (options.readable === false) this.readable = false; - if (options.writable === false) this.writable = false; - - if (options.allowHalfOpen === false) { - this.allowHalfOpen = false; - this.once('end', onend); - } - } -} - -Object.defineProperty(Duplex.prototype, 'writableHighWaterMark', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - return this._writableState.highWaterMark; - } -}); -Object.defineProperty(Duplex.prototype, 'writableBuffer', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - return this._writableState && this._writableState.getBuffer(); - } -}); -Object.defineProperty(Duplex.prototype, 'writableLength', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - return this._writableState.length; - } -}); // the no-half-open enforcer - -function onend() { - // If the writable side ended, then we're ok. - if (this._writableState.ended) return; // no more data can be written. - // But allow more writes to happen in this tick. - - process.nextTick(onEndNT, this); -} - -function onEndNT(self) { - self.end(); -} - -Object.defineProperty(Duplex.prototype, 'destroyed', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - if (this._readableState === undefined || this._writableState === undefined) { - return false; - } - - return this._readableState.destroyed && this._writableState.destroyed; - }, - set: function set(value) { - // we ignore the value if the stream - // has not been initialized yet - if (this._readableState === undefined || this._writableState === undefined) { - return; - } // backward compatibility, the user is explicitly - // managing destroyed - - - this._readableState.destroyed = value; - this._writableState.destroyed = value; - } -}); \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/readable-stream/lib/_stream_passthrough.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/readable-stream/lib/_stream_passthrough.js deleted file mode 100644 index 32e7414c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/readable-stream/lib/_stream_passthrough.js +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. -// a passthrough stream. -// basically just the most minimal sort of Transform stream. -// Every written chunk gets output as-is. -'use strict'; - -module.exports = PassThrough; - -var Transform = require('./_stream_transform'); - -require('inherits')(PassThrough, Transform); - -function PassThrough(options) { - if (!(this instanceof PassThrough)) return new PassThrough(options); - Transform.call(this, options); -} - -PassThrough.prototype._transform = function (chunk, encoding, cb) { - cb(null, chunk); -}; \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/readable-stream/lib/_stream_readable.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/readable-stream/lib/_stream_readable.js deleted file mode 100644 index 192d4514..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/readable-stream/lib/_stream_readable.js +++ /dev/null @@ -1,1124 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. -'use strict'; - -module.exports = Readable; -/**/ - -var Duplex; -/**/ - -Readable.ReadableState = ReadableState; -/**/ - -var EE = require('events').EventEmitter; - -var EElistenerCount = function EElistenerCount(emitter, type) { - return emitter.listeners(type).length; -}; -/**/ - -/**/ - - -var Stream = require('./internal/streams/stream'); -/**/ - - -var Buffer = require('buffer').Buffer; - -var OurUint8Array = global.Uint8Array || function () {}; - -function _uint8ArrayToBuffer(chunk) { - return Buffer.from(chunk); -} - -function _isUint8Array(obj) { - return Buffer.isBuffer(obj) || obj instanceof OurUint8Array; -} -/**/ - - -var debugUtil = require('util'); - -var debug; - -if (debugUtil && debugUtil.debuglog) { - debug = debugUtil.debuglog('stream'); -} else { - debug = function debug() {}; -} -/**/ - - -var BufferList = require('./internal/streams/buffer_list'); - -var destroyImpl = require('./internal/streams/destroy'); - -var _require = require('./internal/streams/state'), - getHighWaterMark = _require.getHighWaterMark; - -var _require$codes = require('../errors').codes, - ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE, - ERR_STREAM_PUSH_AFTER_EOF = _require$codes.ERR_STREAM_PUSH_AFTER_EOF, - ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED, - ERR_STREAM_UNSHIFT_AFTER_END_EVENT = _require$codes.ERR_STREAM_UNSHIFT_AFTER_END_EVENT; // Lazy loaded to improve the startup performance. - - -var StringDecoder; -var createReadableStreamAsyncIterator; -var from; - -require('inherits')(Readable, Stream); - -var errorOrDestroy = destroyImpl.errorOrDestroy; -var kProxyEvents = ['error', 'close', 'destroy', 'pause', 'resume']; - -function prependListener(emitter, event, fn) { - // Sadly this is not cacheable as some libraries bundle their own - // event emitter implementation with them. - if (typeof emitter.prependListener === 'function') return emitter.prependListener(event, fn); // This is a hack to make sure that our error handler is attached before any - // userland ones. NEVER DO THIS. This is here only because this code needs - // to continue to work with older versions of Node.js that do not include - // the prependListener() method. The goal is to eventually remove this hack. - - if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);else if (Array.isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]]; -} - -function ReadableState(options, stream, isDuplex) { - Duplex = Duplex || require('./_stream_duplex'); - options = options || {}; // Duplex streams are both readable and writable, but share - // the same options object. - // However, some cases require setting options to different - // values for the readable and the writable sides of the duplex stream. - // These options can be provided separately as readableXXX and writableXXX. - - if (typeof isDuplex !== 'boolean') isDuplex = stream instanceof Duplex; // object stream flag. Used to make read(n) ignore n and to - // make all the buffer merging and length checks go away - - this.objectMode = !!options.objectMode; - if (isDuplex) this.objectMode = this.objectMode || !!options.readableObjectMode; // the point at which it stops calling _read() to fill the buffer - // Note: 0 is a valid value, means "don't call _read preemptively ever" - - this.highWaterMark = getHighWaterMark(this, options, 'readableHighWaterMark', isDuplex); // A linked list is used to store data chunks instead of an array because the - // linked list can remove elements from the beginning faster than - // array.shift() - - this.buffer = new BufferList(); - this.length = 0; - this.pipes = null; - this.pipesCount = 0; - this.flowing = null; - this.ended = false; - this.endEmitted = false; - this.reading = false; // a flag to be able to tell if the event 'readable'/'data' is emitted - // immediately, or on a later tick. We set this to true at first, because - // any actions that shouldn't happen until "later" should generally also - // not happen before the first read call. - - this.sync = true; // whenever we return null, then we set a flag to say - // that we're awaiting a 'readable' event emission. - - this.needReadable = false; - this.emittedReadable = false; - this.readableListening = false; - this.resumeScheduled = false; - this.paused = true; // Should close be emitted on destroy. Defaults to true. - - this.emitClose = options.emitClose !== false; // Should .destroy() be called after 'end' (and potentially 'finish') - - this.autoDestroy = !!options.autoDestroy; // has it been destroyed - - this.destroyed = false; // Crypto is kind of old and crusty. Historically, its default string - // encoding is 'binary' so we have to make this configurable. - // Everything else in the universe uses 'utf8', though. - - this.defaultEncoding = options.defaultEncoding || 'utf8'; // the number of writers that are awaiting a drain event in .pipe()s - - this.awaitDrain = 0; // if true, a maybeReadMore has been scheduled - - this.readingMore = false; - this.decoder = null; - this.encoding = null; - - if (options.encoding) { - if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder; - this.decoder = new StringDecoder(options.encoding); - this.encoding = options.encoding; - } -} - -function Readable(options) { - Duplex = Duplex || require('./_stream_duplex'); - if (!(this instanceof Readable)) return new Readable(options); // Checking for a Stream.Duplex instance is faster here instead of inside - // the ReadableState constructor, at least with V8 6.5 - - var isDuplex = this instanceof Duplex; - this._readableState = new ReadableState(options, this, isDuplex); // legacy - - this.readable = true; - - if (options) { - if (typeof options.read === 'function') this._read = options.read; - if (typeof options.destroy === 'function') this._destroy = options.destroy; - } - - Stream.call(this); -} - -Object.defineProperty(Readable.prototype, 'destroyed', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - if (this._readableState === undefined) { - return false; - } - - return this._readableState.destroyed; - }, - set: function set(value) { - // we ignore the value if the stream - // has not been initialized yet - if (!this._readableState) { - return; - } // backward compatibility, the user is explicitly - // managing destroyed - - - this._readableState.destroyed = value; - } -}); -Readable.prototype.destroy = destroyImpl.destroy; -Readable.prototype._undestroy = destroyImpl.undestroy; - -Readable.prototype._destroy = function (err, cb) { - cb(err); -}; // Manually shove something into the read() buffer. -// This returns true if the highWaterMark has not been hit yet, -// similar to how Writable.write() returns true if you should -// write() some more. - - -Readable.prototype.push = function (chunk, encoding) { - var state = this._readableState; - var skipChunkCheck; - - if (!state.objectMode) { - if (typeof chunk === 'string') { - encoding = encoding || state.defaultEncoding; - - if (encoding !== state.encoding) { - chunk = Buffer.from(chunk, encoding); - encoding = ''; - } - - skipChunkCheck = true; - } - } else { - skipChunkCheck = true; - } - - return readableAddChunk(this, chunk, encoding, false, skipChunkCheck); -}; // Unshift should *always* be something directly out of read() - - -Readable.prototype.unshift = function (chunk) { - return readableAddChunk(this, chunk, null, true, false); -}; - -function readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) { - debug('readableAddChunk', chunk); - var state = stream._readableState; - - if (chunk === null) { - state.reading = false; - onEofChunk(stream, state); - } else { - var er; - if (!skipChunkCheck) er = chunkInvalid(state, chunk); - - if (er) { - errorOrDestroy(stream, er); - } else if (state.objectMode || chunk && chunk.length > 0) { - if (typeof chunk !== 'string' && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer.prototype) { - chunk = _uint8ArrayToBuffer(chunk); - } - - if (addToFront) { - if (state.endEmitted) errorOrDestroy(stream, new ERR_STREAM_UNSHIFT_AFTER_END_EVENT());else addChunk(stream, state, chunk, true); - } else if (state.ended) { - errorOrDestroy(stream, new ERR_STREAM_PUSH_AFTER_EOF()); - } else if (state.destroyed) { - return false; - } else { - state.reading = false; - - if (state.decoder && !encoding) { - chunk = state.decoder.write(chunk); - if (state.objectMode || chunk.length !== 0) addChunk(stream, state, chunk, false);else maybeReadMore(stream, state); - } else { - addChunk(stream, state, chunk, false); - } - } - } else if (!addToFront) { - state.reading = false; - maybeReadMore(stream, state); - } - } // We can push more data if we are below the highWaterMark. - // Also, if we have no data yet, we can stand some more bytes. - // This is to work around cases where hwm=0, such as the repl. - - - return !state.ended && (state.length < state.highWaterMark || state.length === 0); -} - -function addChunk(stream, state, chunk, addToFront) { - if (state.flowing && state.length === 0 && !state.sync) { - state.awaitDrain = 0; - stream.emit('data', chunk); - } else { - // update the buffer info. - state.length += state.objectMode ? 1 : chunk.length; - if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk); - if (state.needReadable) emitReadable(stream); - } - - maybeReadMore(stream, state); -} - -function chunkInvalid(state, chunk) { - var er; - - if (!_isUint8Array(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) { - er = new ERR_INVALID_ARG_TYPE('chunk', ['string', 'Buffer', 'Uint8Array'], chunk); - } - - return er; -} - -Readable.prototype.isPaused = function () { - return this._readableState.flowing === false; -}; // backwards compatibility. - - -Readable.prototype.setEncoding = function (enc) { - if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder; - var decoder = new StringDecoder(enc); - this._readableState.decoder = decoder; // If setEncoding(null), decoder.encoding equals utf8 - - this._readableState.encoding = this._readableState.decoder.encoding; // Iterate over current buffer to convert already stored Buffers: - - var p = this._readableState.buffer.head; - var content = ''; - - while (p !== null) { - content += decoder.write(p.data); - p = p.next; - } - - this._readableState.buffer.clear(); - - if (content !== '') this._readableState.buffer.push(content); - this._readableState.length = content.length; - return this; -}; // Don't raise the hwm > 1GB - - -var MAX_HWM = 0x40000000; - -function computeNewHighWaterMark(n) { - if (n >= MAX_HWM) { - // TODO(ronag): Throw ERR_VALUE_OUT_OF_RANGE. - n = MAX_HWM; - } else { - // Get the next highest power of 2 to prevent increasing hwm excessively in - // tiny amounts - n--; - n |= n >>> 1; - n |= n >>> 2; - n |= n >>> 4; - n |= n >>> 8; - n |= n >>> 16; - n++; - } - - return n; -} // This function is designed to be inlinable, so please take care when making -// changes to the function body. - - -function howMuchToRead(n, state) { - if (n <= 0 || state.length === 0 && state.ended) return 0; - if (state.objectMode) return 1; - - if (n !== n) { - // Only flow one buffer at a time - if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length; - } // If we're asking for more than the current hwm, then raise the hwm. - - - if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n); - if (n <= state.length) return n; // Don't have enough - - if (!state.ended) { - state.needReadable = true; - return 0; - } - - return state.length; -} // you can override either this method, or the async _read(n) below. - - -Readable.prototype.read = function (n) { - debug('read', n); - n = parseInt(n, 10); - var state = this._readableState; - var nOrig = n; - if (n !== 0) state.emittedReadable = false; // if we're doing read(0) to trigger a readable event, but we - // already have a bunch of data in the buffer, then just trigger - // the 'readable' event and move on. - - if (n === 0 && state.needReadable && ((state.highWaterMark !== 0 ? state.length >= state.highWaterMark : state.length > 0) || state.ended)) { - debug('read: emitReadable', state.length, state.ended); - if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this); - return null; - } - - n = howMuchToRead(n, state); // if we've ended, and we're now clear, then finish it up. - - if (n === 0 && state.ended) { - if (state.length === 0) endReadable(this); - return null; - } // All the actual chunk generation logic needs to be - // *below* the call to _read. The reason is that in certain - // synthetic stream cases, such as passthrough streams, _read - // may be a completely synchronous operation which may change - // the state of the read buffer, providing enough data when - // before there was *not* enough. - // - // So, the steps are: - // 1. Figure out what the state of things will be after we do - // a read from the buffer. - // - // 2. If that resulting state will trigger a _read, then call _read. - // Note that this may be asynchronous, or synchronous. Yes, it is - // deeply ugly to write APIs this way, but that still doesn't mean - // that the Readable class should behave improperly, as streams are - // designed to be sync/async agnostic. - // Take note if the _read call is sync or async (ie, if the read call - // has returned yet), so that we know whether or not it's safe to emit - // 'readable' etc. - // - // 3. Actually pull the requested chunks out of the buffer and return. - // if we need a readable event, then we need to do some reading. - - - var doRead = state.needReadable; - debug('need readable', doRead); // if we currently have less than the highWaterMark, then also read some - - if (state.length === 0 || state.length - n < state.highWaterMark) { - doRead = true; - debug('length less than watermark', doRead); - } // however, if we've ended, then there's no point, and if we're already - // reading, then it's unnecessary. - - - if (state.ended || state.reading) { - doRead = false; - debug('reading or ended', doRead); - } else if (doRead) { - debug('do read'); - state.reading = true; - state.sync = true; // if the length is currently zero, then we *need* a readable event. - - if (state.length === 0) state.needReadable = true; // call internal read method - - this._read(state.highWaterMark); - - state.sync = false; // If _read pushed data synchronously, then `reading` will be false, - // and we need to re-evaluate how much data we can return to the user. - - if (!state.reading) n = howMuchToRead(nOrig, state); - } - - var ret; - if (n > 0) ret = fromList(n, state);else ret = null; - - if (ret === null) { - state.needReadable = state.length <= state.highWaterMark; - n = 0; - } else { - state.length -= n; - state.awaitDrain = 0; - } - - if (state.length === 0) { - // If we have nothing in the buffer, then we want to know - // as soon as we *do* get something into the buffer. - if (!state.ended) state.needReadable = true; // If we tried to read() past the EOF, then emit end on the next tick. - - if (nOrig !== n && state.ended) endReadable(this); - } - - if (ret !== null) this.emit('data', ret); - return ret; -}; - -function onEofChunk(stream, state) { - debug('onEofChunk'); - if (state.ended) return; - - if (state.decoder) { - var chunk = state.decoder.end(); - - if (chunk && chunk.length) { - state.buffer.push(chunk); - state.length += state.objectMode ? 1 : chunk.length; - } - } - - state.ended = true; - - if (state.sync) { - // if we are sync, wait until next tick to emit the data. - // Otherwise we risk emitting data in the flow() - // the readable code triggers during a read() call - emitReadable(stream); - } else { - // emit 'readable' now to make sure it gets picked up. - state.needReadable = false; - - if (!state.emittedReadable) { - state.emittedReadable = true; - emitReadable_(stream); - } - } -} // Don't emit readable right away in sync mode, because this can trigger -// another read() call => stack overflow. This way, it might trigger -// a nextTick recursion warning, but that's not so bad. - - -function emitReadable(stream) { - var state = stream._readableState; - debug('emitReadable', state.needReadable, state.emittedReadable); - state.needReadable = false; - - if (!state.emittedReadable) { - debug('emitReadable', state.flowing); - state.emittedReadable = true; - process.nextTick(emitReadable_, stream); - } -} - -function emitReadable_(stream) { - var state = stream._readableState; - debug('emitReadable_', state.destroyed, state.length, state.ended); - - if (!state.destroyed && (state.length || state.ended)) { - stream.emit('readable'); - state.emittedReadable = false; - } // The stream needs another readable event if - // 1. It is not flowing, as the flow mechanism will take - // care of it. - // 2. It is not ended. - // 3. It is below the highWaterMark, so we can schedule - // another readable later. - - - state.needReadable = !state.flowing && !state.ended && state.length <= state.highWaterMark; - flow(stream); -} // at this point, the user has presumably seen the 'readable' event, -// and called read() to consume some data. that may have triggered -// in turn another _read(n) call, in which case reading = true if -// it's in progress. -// However, if we're not ended, or reading, and the length < hwm, -// then go ahead and try to read some more preemptively. - - -function maybeReadMore(stream, state) { - if (!state.readingMore) { - state.readingMore = true; - process.nextTick(maybeReadMore_, stream, state); - } -} - -function maybeReadMore_(stream, state) { - // Attempt to read more data if we should. - // - // The conditions for reading more data are (one of): - // - Not enough data buffered (state.length < state.highWaterMark). The loop - // is responsible for filling the buffer with enough data if such data - // is available. If highWaterMark is 0 and we are not in the flowing mode - // we should _not_ attempt to buffer any extra data. We'll get more data - // when the stream consumer calls read() instead. - // - No data in the buffer, and the stream is in flowing mode. In this mode - // the loop below is responsible for ensuring read() is called. Failing to - // call read here would abort the flow and there's no other mechanism for - // continuing the flow if the stream consumer has just subscribed to the - // 'data' event. - // - // In addition to the above conditions to keep reading data, the following - // conditions prevent the data from being read: - // - The stream has ended (state.ended). - // - There is already a pending 'read' operation (state.reading). This is a - // case where the the stream has called the implementation defined _read() - // method, but they are processing the call asynchronously and have _not_ - // called push() with new data. In this case we skip performing more - // read()s. The execution ends in this method again after the _read() ends - // up calling push() with more data. - while (!state.reading && !state.ended && (state.length < state.highWaterMark || state.flowing && state.length === 0)) { - var len = state.length; - debug('maybeReadMore read 0'); - stream.read(0); - if (len === state.length) // didn't get any data, stop spinning. - break; - } - - state.readingMore = false; -} // abstract method. to be overridden in specific implementation classes. -// call cb(er, data) where data is <= n in length. -// for virtual (non-string, non-buffer) streams, "length" is somewhat -// arbitrary, and perhaps not very meaningful. - - -Readable.prototype._read = function (n) { - errorOrDestroy(this, new ERR_METHOD_NOT_IMPLEMENTED('_read()')); -}; - -Readable.prototype.pipe = function (dest, pipeOpts) { - var src = this; - var state = this._readableState; - - switch (state.pipesCount) { - case 0: - state.pipes = dest; - break; - - case 1: - state.pipes = [state.pipes, dest]; - break; - - default: - state.pipes.push(dest); - break; - } - - state.pipesCount += 1; - debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts); - var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr; - var endFn = doEnd ? onend : unpipe; - if (state.endEmitted) process.nextTick(endFn);else src.once('end', endFn); - dest.on('unpipe', onunpipe); - - function onunpipe(readable, unpipeInfo) { - debug('onunpipe'); - - if (readable === src) { - if (unpipeInfo && unpipeInfo.hasUnpiped === false) { - unpipeInfo.hasUnpiped = true; - cleanup(); - } - } - } - - function onend() { - debug('onend'); - dest.end(); - } // when the dest drains, it reduces the awaitDrain counter - // on the source. This would be more elegant with a .once() - // handler in flow(), but adding and removing repeatedly is - // too slow. - - - var ondrain = pipeOnDrain(src); - dest.on('drain', ondrain); - var cleanedUp = false; - - function cleanup() { - debug('cleanup'); // cleanup event handlers once the pipe is broken - - dest.removeListener('close', onclose); - dest.removeListener('finish', onfinish); - dest.removeListener('drain', ondrain); - dest.removeListener('error', onerror); - dest.removeListener('unpipe', onunpipe); - src.removeListener('end', onend); - src.removeListener('end', unpipe); - src.removeListener('data', ondata); - cleanedUp = true; // if the reader is waiting for a drain event from this - // specific writer, then it would cause it to never start - // flowing again. - // So, if this is awaiting a drain, then we just call it now. - // If we don't know, then assume that we are waiting for one. - - if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain(); - } - - src.on('data', ondata); - - function ondata(chunk) { - debug('ondata'); - var ret = dest.write(chunk); - debug('dest.write', ret); - - if (ret === false) { - // If the user unpiped during `dest.write()`, it is possible - // to get stuck in a permanently paused state if that write - // also returned false. - // => Check whether `dest` is still a piping destination. - if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) { - debug('false write response, pause', state.awaitDrain); - state.awaitDrain++; - } - - src.pause(); - } - } // if the dest has an error, then stop piping into it. - // however, don't suppress the throwing behavior for this. - - - function onerror(er) { - debug('onerror', er); - unpipe(); - dest.removeListener('error', onerror); - if (EElistenerCount(dest, 'error') === 0) errorOrDestroy(dest, er); - } // Make sure our error handler is attached before userland ones. - - - prependListener(dest, 'error', onerror); // Both close and finish should trigger unpipe, but only once. - - function onclose() { - dest.removeListener('finish', onfinish); - unpipe(); - } - - dest.once('close', onclose); - - function onfinish() { - debug('onfinish'); - dest.removeListener('close', onclose); - unpipe(); - } - - dest.once('finish', onfinish); - - function unpipe() { - debug('unpipe'); - src.unpipe(dest); - } // tell the dest that it's being piped to - - - dest.emit('pipe', src); // start the flow if it hasn't been started already. - - if (!state.flowing) { - debug('pipe resume'); - src.resume(); - } - - return dest; -}; - -function pipeOnDrain(src) { - return function pipeOnDrainFunctionResult() { - var state = src._readableState; - debug('pipeOnDrain', state.awaitDrain); - if (state.awaitDrain) state.awaitDrain--; - - if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) { - state.flowing = true; - flow(src); - } - }; -} - -Readable.prototype.unpipe = function (dest) { - var state = this._readableState; - var unpipeInfo = { - hasUnpiped: false - }; // if we're not piping anywhere, then do nothing. - - if (state.pipesCount === 0) return this; // just one destination. most common case. - - if (state.pipesCount === 1) { - // passed in one, but it's not the right one. - if (dest && dest !== state.pipes) return this; - if (!dest) dest = state.pipes; // got a match. - - state.pipes = null; - state.pipesCount = 0; - state.flowing = false; - if (dest) dest.emit('unpipe', this, unpipeInfo); - return this; - } // slow case. multiple pipe destinations. - - - if (!dest) { - // remove all. - var dests = state.pipes; - var len = state.pipesCount; - state.pipes = null; - state.pipesCount = 0; - state.flowing = false; - - for (var i = 0; i < len; i++) { - dests[i].emit('unpipe', this, { - hasUnpiped: false - }); - } - - return this; - } // try to find the right one. - - - var index = indexOf(state.pipes, dest); - if (index === -1) return this; - state.pipes.splice(index, 1); - state.pipesCount -= 1; - if (state.pipesCount === 1) state.pipes = state.pipes[0]; - dest.emit('unpipe', this, unpipeInfo); - return this; -}; // set up data events if they are asked for -// Ensure readable listeners eventually get something - - -Readable.prototype.on = function (ev, fn) { - var res = Stream.prototype.on.call(this, ev, fn); - var state = this._readableState; - - if (ev === 'data') { - // update readableListening so that resume() may be a no-op - // a few lines down. This is needed to support once('readable'). - state.readableListening = this.listenerCount('readable') > 0; // Try start flowing on next tick if stream isn't explicitly paused - - if (state.flowing !== false) this.resume(); - } else if (ev === 'readable') { - if (!state.endEmitted && !state.readableListening) { - state.readableListening = state.needReadable = true; - state.flowing = false; - state.emittedReadable = false; - debug('on readable', state.length, state.reading); - - if (state.length) { - emitReadable(this); - } else if (!state.reading) { - process.nextTick(nReadingNextTick, this); - } - } - } - - return res; -}; - -Readable.prototype.addListener = Readable.prototype.on; - -Readable.prototype.removeListener = function (ev, fn) { - var res = Stream.prototype.removeListener.call(this, ev, fn); - - if (ev === 'readable') { - // We need to check if there is someone still listening to - // readable and reset the state. However this needs to happen - // after readable has been emitted but before I/O (nextTick) to - // support once('readable', fn) cycles. This means that calling - // resume within the same tick will have no - // effect. - process.nextTick(updateReadableListening, this); - } - - return res; -}; - -Readable.prototype.removeAllListeners = function (ev) { - var res = Stream.prototype.removeAllListeners.apply(this, arguments); - - if (ev === 'readable' || ev === undefined) { - // We need to check if there is someone still listening to - // readable and reset the state. However this needs to happen - // after readable has been emitted but before I/O (nextTick) to - // support once('readable', fn) cycles. This means that calling - // resume within the same tick will have no - // effect. - process.nextTick(updateReadableListening, this); - } - - return res; -}; - -function updateReadableListening(self) { - var state = self._readableState; - state.readableListening = self.listenerCount('readable') > 0; - - if (state.resumeScheduled && !state.paused) { - // flowing needs to be set to true now, otherwise - // the upcoming resume will not flow. - state.flowing = true; // crude way to check if we should resume - } else if (self.listenerCount('data') > 0) { - self.resume(); - } -} - -function nReadingNextTick(self) { - debug('readable nexttick read 0'); - self.read(0); -} // pause() and resume() are remnants of the legacy readable stream API -// If the user uses them, then switch into old mode. - - -Readable.prototype.resume = function () { - var state = this._readableState; - - if (!state.flowing) { - debug('resume'); // we flow only if there is no one listening - // for readable, but we still have to call - // resume() - - state.flowing = !state.readableListening; - resume(this, state); - } - - state.paused = false; - return this; -}; - -function resume(stream, state) { - if (!state.resumeScheduled) { - state.resumeScheduled = true; - process.nextTick(resume_, stream, state); - } -} - -function resume_(stream, state) { - debug('resume', state.reading); - - if (!state.reading) { - stream.read(0); - } - - state.resumeScheduled = false; - stream.emit('resume'); - flow(stream); - if (state.flowing && !state.reading) stream.read(0); -} - -Readable.prototype.pause = function () { - debug('call pause flowing=%j', this._readableState.flowing); - - if (this._readableState.flowing !== false) { - debug('pause'); - this._readableState.flowing = false; - this.emit('pause'); - } - - this._readableState.paused = true; - return this; -}; - -function flow(stream) { - var state = stream._readableState; - debug('flow', state.flowing); - - while (state.flowing && stream.read() !== null) { - ; - } -} // wrap an old-style stream as the async data source. -// This is *not* part of the readable stream interface. -// It is an ugly unfortunate mess of history. - - -Readable.prototype.wrap = function (stream) { - var _this = this; - - var state = this._readableState; - var paused = false; - stream.on('end', function () { - debug('wrapped end'); - - if (state.decoder && !state.ended) { - var chunk = state.decoder.end(); - if (chunk && chunk.length) _this.push(chunk); - } - - _this.push(null); - }); - stream.on('data', function (chunk) { - debug('wrapped data'); - if (state.decoder) chunk = state.decoder.write(chunk); // don't skip over falsy values in objectMode - - if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return; - - var ret = _this.push(chunk); - - if (!ret) { - paused = true; - stream.pause(); - } - }); // proxy all the other methods. - // important when wrapping filters and duplexes. - - for (var i in stream) { - if (this[i] === undefined && typeof stream[i] === 'function') { - this[i] = function methodWrap(method) { - return function methodWrapReturnFunction() { - return stream[method].apply(stream, arguments); - }; - }(i); - } - } // proxy certain important events. - - - for (var n = 0; n < kProxyEvents.length; n++) { - stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n])); - } // when we try to consume some more bytes, simply unpause the - // underlying stream. - - - this._read = function (n) { - debug('wrapped _read', n); - - if (paused) { - paused = false; - stream.resume(); - } - }; - - return this; -}; - -if (typeof Symbol === 'function') { - Readable.prototype[Symbol.asyncIterator] = function () { - if (createReadableStreamAsyncIterator === undefined) { - createReadableStreamAsyncIterator = require('./internal/streams/async_iterator'); - } - - return createReadableStreamAsyncIterator(this); - }; -} - -Object.defineProperty(Readable.prototype, 'readableHighWaterMark', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - return this._readableState.highWaterMark; - } -}); -Object.defineProperty(Readable.prototype, 'readableBuffer', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - return this._readableState && this._readableState.buffer; - } -}); -Object.defineProperty(Readable.prototype, 'readableFlowing', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - return this._readableState.flowing; - }, - set: function set(state) { - if (this._readableState) { - this._readableState.flowing = state; - } - } -}); // exposed for testing purposes only. - -Readable._fromList = fromList; -Object.defineProperty(Readable.prototype, 'readableLength', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - return this._readableState.length; - } -}); // Pluck off n bytes from an array of buffers. -// Length is the combined lengths of all the buffers in the list. -// This function is designed to be inlinable, so please take care when making -// changes to the function body. - -function fromList(n, state) { - // nothing buffered - if (state.length === 0) return null; - var ret; - if (state.objectMode) ret = state.buffer.shift();else if (!n || n >= state.length) { - // read it all, truncate the list - if (state.decoder) ret = state.buffer.join('');else if (state.buffer.length === 1) ret = state.buffer.first();else ret = state.buffer.concat(state.length); - state.buffer.clear(); - } else { - // read part of list - ret = state.buffer.consume(n, state.decoder); - } - return ret; -} - -function endReadable(stream) { - var state = stream._readableState; - debug('endReadable', state.endEmitted); - - if (!state.endEmitted) { - state.ended = true; - process.nextTick(endReadableNT, state, stream); - } -} - -function endReadableNT(state, stream) { - debug('endReadableNT', state.endEmitted, state.length); // Check that we didn't get one last unshift. - - if (!state.endEmitted && state.length === 0) { - state.endEmitted = true; - stream.readable = false; - stream.emit('end'); - - if (state.autoDestroy) { - // In case of duplex streams we need a way to detect - // if the writable side is ready for autoDestroy as well - var wState = stream._writableState; - - if (!wState || wState.autoDestroy && wState.finished) { - stream.destroy(); - } - } - } -} - -if (typeof Symbol === 'function') { - Readable.from = function (iterable, opts) { - if (from === undefined) { - from = require('./internal/streams/from'); - } - - return from(Readable, iterable, opts); - }; -} - -function indexOf(xs, x) { - for (var i = 0, l = xs.length; i < l; i++) { - if (xs[i] === x) return i; - } - - return -1; -} \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/readable-stream/lib/_stream_transform.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/readable-stream/lib/_stream_transform.js deleted file mode 100644 index 41a738c4..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/readable-stream/lib/_stream_transform.js +++ /dev/null @@ -1,201 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. -// a transform stream is a readable/writable stream where you do -// something with the data. Sometimes it's called a "filter", -// but that's not a great name for it, since that implies a thing where -// some bits pass through, and others are simply ignored. (That would -// be a valid example of a transform, of course.) -// -// While the output is causally related to the input, it's not a -// necessarily symmetric or synchronous transformation. For example, -// a zlib stream might take multiple plain-text writes(), and then -// emit a single compressed chunk some time in the future. -// -// Here's how this works: -// -// The Transform stream has all the aspects of the readable and writable -// stream classes. When you write(chunk), that calls _write(chunk,cb) -// internally, and returns false if there's a lot of pending writes -// buffered up. When you call read(), that calls _read(n) until -// there's enough pending readable data buffered up. -// -// In a transform stream, the written data is placed in a buffer. When -// _read(n) is called, it transforms the queued up data, calling the -// buffered _write cb's as it consumes chunks. If consuming a single -// written chunk would result in multiple output chunks, then the first -// outputted bit calls the readcb, and subsequent chunks just go into -// the read buffer, and will cause it to emit 'readable' if necessary. -// -// This way, back-pressure is actually determined by the reading side, -// since _read has to be called to start processing a new chunk. However, -// a pathological inflate type of transform can cause excessive buffering -// here. For example, imagine a stream where every byte of input is -// interpreted as an integer from 0-255, and then results in that many -// bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in -// 1kb of data being output. In this case, you could write a very small -// amount of input, and end up with a very large amount of output. In -// such a pathological inflating mechanism, there'd be no way to tell -// the system to stop doing the transform. A single 4MB write could -// cause the system to run out of memory. -// -// However, even in such a pathological case, only a single written chunk -// would be consumed, and then the rest would wait (un-transformed) until -// the results of the previous transformed chunk were consumed. -'use strict'; - -module.exports = Transform; - -var _require$codes = require('../errors').codes, - ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED, - ERR_MULTIPLE_CALLBACK = _require$codes.ERR_MULTIPLE_CALLBACK, - ERR_TRANSFORM_ALREADY_TRANSFORMING = _require$codes.ERR_TRANSFORM_ALREADY_TRANSFORMING, - ERR_TRANSFORM_WITH_LENGTH_0 = _require$codes.ERR_TRANSFORM_WITH_LENGTH_0; - -var Duplex = require('./_stream_duplex'); - -require('inherits')(Transform, Duplex); - -function afterTransform(er, data) { - var ts = this._transformState; - ts.transforming = false; - var cb = ts.writecb; - - if (cb === null) { - return this.emit('error', new ERR_MULTIPLE_CALLBACK()); - } - - ts.writechunk = null; - ts.writecb = null; - if (data != null) // single equals check for both `null` and `undefined` - this.push(data); - cb(er); - var rs = this._readableState; - rs.reading = false; - - if (rs.needReadable || rs.length < rs.highWaterMark) { - this._read(rs.highWaterMark); - } -} - -function Transform(options) { - if (!(this instanceof Transform)) return new Transform(options); - Duplex.call(this, options); - this._transformState = { - afterTransform: afterTransform.bind(this), - needTransform: false, - transforming: false, - writecb: null, - writechunk: null, - writeencoding: null - }; // start out asking for a readable event once data is transformed. - - this._readableState.needReadable = true; // we have implemented the _read method, and done the other things - // that Readable wants before the first _read call, so unset the - // sync guard flag. - - this._readableState.sync = false; - - if (options) { - if (typeof options.transform === 'function') this._transform = options.transform; - if (typeof options.flush === 'function') this._flush = options.flush; - } // When the writable side finishes, then flush out anything remaining. - - - this.on('prefinish', prefinish); -} - -function prefinish() { - var _this = this; - - if (typeof this._flush === 'function' && !this._readableState.destroyed) { - this._flush(function (er, data) { - done(_this, er, data); - }); - } else { - done(this, null, null); - } -} - -Transform.prototype.push = function (chunk, encoding) { - this._transformState.needTransform = false; - return Duplex.prototype.push.call(this, chunk, encoding); -}; // This is the part where you do stuff! -// override this function in implementation classes. -// 'chunk' is an input chunk. -// -// Call `push(newChunk)` to pass along transformed output -// to the readable side. You may call 'push' zero or more times. -// -// Call `cb(err)` when you are done with this chunk. If you pass -// an error, then that'll put the hurt on the whole operation. If you -// never call cb(), then you'll never get another chunk. - - -Transform.prototype._transform = function (chunk, encoding, cb) { - cb(new ERR_METHOD_NOT_IMPLEMENTED('_transform()')); -}; - -Transform.prototype._write = function (chunk, encoding, cb) { - var ts = this._transformState; - ts.writecb = cb; - ts.writechunk = chunk; - ts.writeencoding = encoding; - - if (!ts.transforming) { - var rs = this._readableState; - if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark); - } -}; // Doesn't matter what the args are here. -// _transform does all the work. -// That we got here means that the readable side wants more data. - - -Transform.prototype._read = function (n) { - var ts = this._transformState; - - if (ts.writechunk !== null && !ts.transforming) { - ts.transforming = true; - - this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform); - } else { - // mark that we need a transform, so that any data that comes in - // will get processed, now that we've asked for it. - ts.needTransform = true; - } -}; - -Transform.prototype._destroy = function (err, cb) { - Duplex.prototype._destroy.call(this, err, function (err2) { - cb(err2); - }); -}; - -function done(stream, er, data) { - if (er) return stream.emit('error', er); - if (data != null) // single equals check for both `null` and `undefined` - stream.push(data); // TODO(BridgeAR): Write a test for these two error cases - // if there's nothing in the write buffer, then that means - // that nothing more will ever be provided - - if (stream._writableState.length) throw new ERR_TRANSFORM_WITH_LENGTH_0(); - if (stream._transformState.transforming) throw new ERR_TRANSFORM_ALREADY_TRANSFORMING(); - return stream.push(null); -} \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/readable-stream/lib/_stream_writable.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/readable-stream/lib/_stream_writable.js deleted file mode 100644 index a2634d7c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/readable-stream/lib/_stream_writable.js +++ /dev/null @@ -1,697 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. -// A bit simpler than readable streams. -// Implement an async ._write(chunk, encoding, cb), and it'll handle all -// the drain event emission and buffering. -'use strict'; - -module.exports = Writable; -/* */ - -function WriteReq(chunk, encoding, cb) { - this.chunk = chunk; - this.encoding = encoding; - this.callback = cb; - this.next = null; -} // It seems a linked list but it is not -// there will be only 2 of these for each stream - - -function CorkedRequest(state) { - var _this = this; - - this.next = null; - this.entry = null; - - this.finish = function () { - onCorkedFinish(_this, state); - }; -} -/* */ - -/**/ - - -var Duplex; -/**/ - -Writable.WritableState = WritableState; -/**/ - -var internalUtil = { - deprecate: require('util-deprecate') -}; -/**/ - -/**/ - -var Stream = require('./internal/streams/stream'); -/**/ - - -var Buffer = require('buffer').Buffer; - -var OurUint8Array = global.Uint8Array || function () {}; - -function _uint8ArrayToBuffer(chunk) { - return Buffer.from(chunk); -} - -function _isUint8Array(obj) { - return Buffer.isBuffer(obj) || obj instanceof OurUint8Array; -} - -var destroyImpl = require('./internal/streams/destroy'); - -var _require = require('./internal/streams/state'), - getHighWaterMark = _require.getHighWaterMark; - -var _require$codes = require('../errors').codes, - ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE, - ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED, - ERR_MULTIPLE_CALLBACK = _require$codes.ERR_MULTIPLE_CALLBACK, - ERR_STREAM_CANNOT_PIPE = _require$codes.ERR_STREAM_CANNOT_PIPE, - ERR_STREAM_DESTROYED = _require$codes.ERR_STREAM_DESTROYED, - ERR_STREAM_NULL_VALUES = _require$codes.ERR_STREAM_NULL_VALUES, - ERR_STREAM_WRITE_AFTER_END = _require$codes.ERR_STREAM_WRITE_AFTER_END, - ERR_UNKNOWN_ENCODING = _require$codes.ERR_UNKNOWN_ENCODING; - -var errorOrDestroy = destroyImpl.errorOrDestroy; - -require('inherits')(Writable, Stream); - -function nop() {} - -function WritableState(options, stream, isDuplex) { - Duplex = Duplex || require('./_stream_duplex'); - options = options || {}; // Duplex streams are both readable and writable, but share - // the same options object. - // However, some cases require setting options to different - // values for the readable and the writable sides of the duplex stream, - // e.g. options.readableObjectMode vs. options.writableObjectMode, etc. - - if (typeof isDuplex !== 'boolean') isDuplex = stream instanceof Duplex; // object stream flag to indicate whether or not this stream - // contains buffers or objects. - - this.objectMode = !!options.objectMode; - if (isDuplex) this.objectMode = this.objectMode || !!options.writableObjectMode; // the point at which write() starts returning false - // Note: 0 is a valid value, means that we always return false if - // the entire buffer is not flushed immediately on write() - - this.highWaterMark = getHighWaterMark(this, options, 'writableHighWaterMark', isDuplex); // if _final has been called - - this.finalCalled = false; // drain event flag. - - this.needDrain = false; // at the start of calling end() - - this.ending = false; // when end() has been called, and returned - - this.ended = false; // when 'finish' is emitted - - this.finished = false; // has it been destroyed - - this.destroyed = false; // should we decode strings into buffers before passing to _write? - // this is here so that some node-core streams can optimize string - // handling at a lower level. - - var noDecode = options.decodeStrings === false; - this.decodeStrings = !noDecode; // Crypto is kind of old and crusty. Historically, its default string - // encoding is 'binary' so we have to make this configurable. - // Everything else in the universe uses 'utf8', though. - - this.defaultEncoding = options.defaultEncoding || 'utf8'; // not an actual buffer we keep track of, but a measurement - // of how much we're waiting to get pushed to some underlying - // socket or file. - - this.length = 0; // a flag to see when we're in the middle of a write. - - this.writing = false; // when true all writes will be buffered until .uncork() call - - this.corked = 0; // a flag to be able to tell if the onwrite cb is called immediately, - // or on a later tick. We set this to true at first, because any - // actions that shouldn't happen until "later" should generally also - // not happen before the first write call. - - this.sync = true; // a flag to know if we're processing previously buffered items, which - // may call the _write() callback in the same tick, so that we don't - // end up in an overlapped onwrite situation. - - this.bufferProcessing = false; // the callback that's passed to _write(chunk,cb) - - this.onwrite = function (er) { - onwrite(stream, er); - }; // the callback that the user supplies to write(chunk,encoding,cb) - - - this.writecb = null; // the amount that is being written when _write is called. - - this.writelen = 0; - this.bufferedRequest = null; - this.lastBufferedRequest = null; // number of pending user-supplied write callbacks - // this must be 0 before 'finish' can be emitted - - this.pendingcb = 0; // emit prefinish if the only thing we're waiting for is _write cbs - // This is relevant for synchronous Transform streams - - this.prefinished = false; // True if the error was already emitted and should not be thrown again - - this.errorEmitted = false; // Should close be emitted on destroy. Defaults to true. - - this.emitClose = options.emitClose !== false; // Should .destroy() be called after 'finish' (and potentially 'end') - - this.autoDestroy = !!options.autoDestroy; // count buffered requests - - this.bufferedRequestCount = 0; // allocate the first CorkedRequest, there is always - // one allocated and free to use, and we maintain at most two - - this.corkedRequestsFree = new CorkedRequest(this); -} - -WritableState.prototype.getBuffer = function getBuffer() { - var current = this.bufferedRequest; - var out = []; - - while (current) { - out.push(current); - current = current.next; - } - - return out; -}; - -(function () { - try { - Object.defineProperty(WritableState.prototype, 'buffer', { - get: internalUtil.deprecate(function writableStateBufferGetter() { - return this.getBuffer(); - }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.', 'DEP0003') - }); - } catch (_) {} -})(); // Test _writableState for inheritance to account for Duplex streams, -// whose prototype chain only points to Readable. - - -var realHasInstance; - -if (typeof Symbol === 'function' && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === 'function') { - realHasInstance = Function.prototype[Symbol.hasInstance]; - Object.defineProperty(Writable, Symbol.hasInstance, { - value: function value(object) { - if (realHasInstance.call(this, object)) return true; - if (this !== Writable) return false; - return object && object._writableState instanceof WritableState; - } - }); -} else { - realHasInstance = function realHasInstance(object) { - return object instanceof this; - }; -} - -function Writable(options) { - Duplex = Duplex || require('./_stream_duplex'); // Writable ctor is applied to Duplexes, too. - // `realHasInstance` is necessary because using plain `instanceof` - // would return false, as no `_writableState` property is attached. - // Trying to use the custom `instanceof` for Writable here will also break the - // Node.js LazyTransform implementation, which has a non-trivial getter for - // `_writableState` that would lead to infinite recursion. - // Checking for a Stream.Duplex instance is faster here instead of inside - // the WritableState constructor, at least with V8 6.5 - - var isDuplex = this instanceof Duplex; - if (!isDuplex && !realHasInstance.call(Writable, this)) return new Writable(options); - this._writableState = new WritableState(options, this, isDuplex); // legacy. - - this.writable = true; - - if (options) { - if (typeof options.write === 'function') this._write = options.write; - if (typeof options.writev === 'function') this._writev = options.writev; - if (typeof options.destroy === 'function') this._destroy = options.destroy; - if (typeof options.final === 'function') this._final = options.final; - } - - Stream.call(this); -} // Otherwise people can pipe Writable streams, which is just wrong. - - -Writable.prototype.pipe = function () { - errorOrDestroy(this, new ERR_STREAM_CANNOT_PIPE()); -}; - -function writeAfterEnd(stream, cb) { - var er = new ERR_STREAM_WRITE_AFTER_END(); // TODO: defer error events consistently everywhere, not just the cb - - errorOrDestroy(stream, er); - process.nextTick(cb, er); -} // Checks that a user-supplied chunk is valid, especially for the particular -// mode the stream is in. Currently this means that `null` is never accepted -// and undefined/non-string values are only allowed in object mode. - - -function validChunk(stream, state, chunk, cb) { - var er; - - if (chunk === null) { - er = new ERR_STREAM_NULL_VALUES(); - } else if (typeof chunk !== 'string' && !state.objectMode) { - er = new ERR_INVALID_ARG_TYPE('chunk', ['string', 'Buffer'], chunk); - } - - if (er) { - errorOrDestroy(stream, er); - process.nextTick(cb, er); - return false; - } - - return true; -} - -Writable.prototype.write = function (chunk, encoding, cb) { - var state = this._writableState; - var ret = false; - - var isBuf = !state.objectMode && _isUint8Array(chunk); - - if (isBuf && !Buffer.isBuffer(chunk)) { - chunk = _uint8ArrayToBuffer(chunk); - } - - if (typeof encoding === 'function') { - cb = encoding; - encoding = null; - } - - if (isBuf) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding; - if (typeof cb !== 'function') cb = nop; - if (state.ending) writeAfterEnd(this, cb);else if (isBuf || validChunk(this, state, chunk, cb)) { - state.pendingcb++; - ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb); - } - return ret; -}; - -Writable.prototype.cork = function () { - this._writableState.corked++; -}; - -Writable.prototype.uncork = function () { - var state = this._writableState; - - if (state.corked) { - state.corked--; - if (!state.writing && !state.corked && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state); - } -}; - -Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) { - // node::ParseEncoding() requires lower case. - if (typeof encoding === 'string') encoding = encoding.toLowerCase(); - if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', 'raw'].indexOf((encoding + '').toLowerCase()) > -1)) throw new ERR_UNKNOWN_ENCODING(encoding); - this._writableState.defaultEncoding = encoding; - return this; -}; - -Object.defineProperty(Writable.prototype, 'writableBuffer', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - return this._writableState && this._writableState.getBuffer(); - } -}); - -function decodeChunk(state, chunk, encoding) { - if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') { - chunk = Buffer.from(chunk, encoding); - } - - return chunk; -} - -Object.defineProperty(Writable.prototype, 'writableHighWaterMark', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - return this._writableState.highWaterMark; - } -}); // if we're already writing something, then just put this -// in the queue, and wait our turn. Otherwise, call _write -// If we return false, then we need a drain event, so set that flag. - -function writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) { - if (!isBuf) { - var newChunk = decodeChunk(state, chunk, encoding); - - if (chunk !== newChunk) { - isBuf = true; - encoding = 'buffer'; - chunk = newChunk; - } - } - - var len = state.objectMode ? 1 : chunk.length; - state.length += len; - var ret = state.length < state.highWaterMark; // we must ensure that previous needDrain will not be reset to false. - - if (!ret) state.needDrain = true; - - if (state.writing || state.corked) { - var last = state.lastBufferedRequest; - state.lastBufferedRequest = { - chunk: chunk, - encoding: encoding, - isBuf: isBuf, - callback: cb, - next: null - }; - - if (last) { - last.next = state.lastBufferedRequest; - } else { - state.bufferedRequest = state.lastBufferedRequest; - } - - state.bufferedRequestCount += 1; - } else { - doWrite(stream, state, false, len, chunk, encoding, cb); - } - - return ret; -} - -function doWrite(stream, state, writev, len, chunk, encoding, cb) { - state.writelen = len; - state.writecb = cb; - state.writing = true; - state.sync = true; - if (state.destroyed) state.onwrite(new ERR_STREAM_DESTROYED('write'));else if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite); - state.sync = false; -} - -function onwriteError(stream, state, sync, er, cb) { - --state.pendingcb; - - if (sync) { - // defer the callback if we are being called synchronously - // to avoid piling up things on the stack - process.nextTick(cb, er); // this can emit finish, and it will always happen - // after error - - process.nextTick(finishMaybe, stream, state); - stream._writableState.errorEmitted = true; - errorOrDestroy(stream, er); - } else { - // the caller expect this to happen before if - // it is async - cb(er); - stream._writableState.errorEmitted = true; - errorOrDestroy(stream, er); // this can emit finish, but finish must - // always follow error - - finishMaybe(stream, state); - } -} - -function onwriteStateUpdate(state) { - state.writing = false; - state.writecb = null; - state.length -= state.writelen; - state.writelen = 0; -} - -function onwrite(stream, er) { - var state = stream._writableState; - var sync = state.sync; - var cb = state.writecb; - if (typeof cb !== 'function') throw new ERR_MULTIPLE_CALLBACK(); - onwriteStateUpdate(state); - if (er) onwriteError(stream, state, sync, er, cb);else { - // Check if we're actually ready to finish, but don't emit yet - var finished = needFinish(state) || stream.destroyed; - - if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) { - clearBuffer(stream, state); - } - - if (sync) { - process.nextTick(afterWrite, stream, state, finished, cb); - } else { - afterWrite(stream, state, finished, cb); - } - } -} - -function afterWrite(stream, state, finished, cb) { - if (!finished) onwriteDrain(stream, state); - state.pendingcb--; - cb(); - finishMaybe(stream, state); -} // Must force callback to be called on nextTick, so that we don't -// emit 'drain' before the write() consumer gets the 'false' return -// value, and has a chance to attach a 'drain' listener. - - -function onwriteDrain(stream, state) { - if (state.length === 0 && state.needDrain) { - state.needDrain = false; - stream.emit('drain'); - } -} // if there's something in the buffer waiting, then process it - - -function clearBuffer(stream, state) { - state.bufferProcessing = true; - var entry = state.bufferedRequest; - - if (stream._writev && entry && entry.next) { - // Fast case, write everything using _writev() - var l = state.bufferedRequestCount; - var buffer = new Array(l); - var holder = state.corkedRequestsFree; - holder.entry = entry; - var count = 0; - var allBuffers = true; - - while (entry) { - buffer[count] = entry; - if (!entry.isBuf) allBuffers = false; - entry = entry.next; - count += 1; - } - - buffer.allBuffers = allBuffers; - doWrite(stream, state, true, state.length, buffer, '', holder.finish); // doWrite is almost always async, defer these to save a bit of time - // as the hot path ends with doWrite - - state.pendingcb++; - state.lastBufferedRequest = null; - - if (holder.next) { - state.corkedRequestsFree = holder.next; - holder.next = null; - } else { - state.corkedRequestsFree = new CorkedRequest(state); - } - - state.bufferedRequestCount = 0; - } else { - // Slow case, write chunks one-by-one - while (entry) { - var chunk = entry.chunk; - var encoding = entry.encoding; - var cb = entry.callback; - var len = state.objectMode ? 1 : chunk.length; - doWrite(stream, state, false, len, chunk, encoding, cb); - entry = entry.next; - state.bufferedRequestCount--; // if we didn't call the onwrite immediately, then - // it means that we need to wait until it does. - // also, that means that the chunk and cb are currently - // being processed, so move the buffer counter past them. - - if (state.writing) { - break; - } - } - - if (entry === null) state.lastBufferedRequest = null; - } - - state.bufferedRequest = entry; - state.bufferProcessing = false; -} - -Writable.prototype._write = function (chunk, encoding, cb) { - cb(new ERR_METHOD_NOT_IMPLEMENTED('_write()')); -}; - -Writable.prototype._writev = null; - -Writable.prototype.end = function (chunk, encoding, cb) { - var state = this._writableState; - - if (typeof chunk === 'function') { - cb = chunk; - chunk = null; - encoding = null; - } else if (typeof encoding === 'function') { - cb = encoding; - encoding = null; - } - - if (chunk !== null && chunk !== undefined) this.write(chunk, encoding); // .end() fully uncorks - - if (state.corked) { - state.corked = 1; - this.uncork(); - } // ignore unnecessary end() calls. - - - if (!state.ending) endWritable(this, state, cb); - return this; -}; - -Object.defineProperty(Writable.prototype, 'writableLength', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - return this._writableState.length; - } -}); - -function needFinish(state) { - return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing; -} - -function callFinal(stream, state) { - stream._final(function (err) { - state.pendingcb--; - - if (err) { - errorOrDestroy(stream, err); - } - - state.prefinished = true; - stream.emit('prefinish'); - finishMaybe(stream, state); - }); -} - -function prefinish(stream, state) { - if (!state.prefinished && !state.finalCalled) { - if (typeof stream._final === 'function' && !state.destroyed) { - state.pendingcb++; - state.finalCalled = true; - process.nextTick(callFinal, stream, state); - } else { - state.prefinished = true; - stream.emit('prefinish'); - } - } -} - -function finishMaybe(stream, state) { - var need = needFinish(state); - - if (need) { - prefinish(stream, state); - - if (state.pendingcb === 0) { - state.finished = true; - stream.emit('finish'); - - if (state.autoDestroy) { - // In case of duplex streams we need a way to detect - // if the readable side is ready for autoDestroy as well - var rState = stream._readableState; - - if (!rState || rState.autoDestroy && rState.endEmitted) { - stream.destroy(); - } - } - } - } - - return need; -} - -function endWritable(stream, state, cb) { - state.ending = true; - finishMaybe(stream, state); - - if (cb) { - if (state.finished) process.nextTick(cb);else stream.once('finish', cb); - } - - state.ended = true; - stream.writable = false; -} - -function onCorkedFinish(corkReq, state, err) { - var entry = corkReq.entry; - corkReq.entry = null; - - while (entry) { - var cb = entry.callback; - state.pendingcb--; - cb(err); - entry = entry.next; - } // reuse the free corkReq. - - - state.corkedRequestsFree.next = corkReq; -} - -Object.defineProperty(Writable.prototype, 'destroyed', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - if (this._writableState === undefined) { - return false; - } - - return this._writableState.destroyed; - }, - set: function set(value) { - // we ignore the value if the stream - // has not been initialized yet - if (!this._writableState) { - return; - } // backward compatibility, the user is explicitly - // managing destroyed - - - this._writableState.destroyed = value; - } -}); -Writable.prototype.destroy = destroyImpl.destroy; -Writable.prototype._undestroy = destroyImpl.undestroy; - -Writable.prototype._destroy = function (err, cb) { - cb(err); -}; \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/readable-stream/lib/internal/streams/async_iterator.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/readable-stream/lib/internal/streams/async_iterator.js deleted file mode 100644 index 9fb615a2..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/readable-stream/lib/internal/streams/async_iterator.js +++ /dev/null @@ -1,207 +0,0 @@ -'use strict'; - -var _Object$setPrototypeO; - -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - -var finished = require('./end-of-stream'); - -var kLastResolve = Symbol('lastResolve'); -var kLastReject = Symbol('lastReject'); -var kError = Symbol('error'); -var kEnded = Symbol('ended'); -var kLastPromise = Symbol('lastPromise'); -var kHandlePromise = Symbol('handlePromise'); -var kStream = Symbol('stream'); - -function createIterResult(value, done) { - return { - value: value, - done: done - }; -} - -function readAndResolve(iter) { - var resolve = iter[kLastResolve]; - - if (resolve !== null) { - var data = iter[kStream].read(); // we defer if data is null - // we can be expecting either 'end' or - // 'error' - - if (data !== null) { - iter[kLastPromise] = null; - iter[kLastResolve] = null; - iter[kLastReject] = null; - resolve(createIterResult(data, false)); - } - } -} - -function onReadable(iter) { - // we wait for the next tick, because it might - // emit an error with process.nextTick - process.nextTick(readAndResolve, iter); -} - -function wrapForNext(lastPromise, iter) { - return function (resolve, reject) { - lastPromise.then(function () { - if (iter[kEnded]) { - resolve(createIterResult(undefined, true)); - return; - } - - iter[kHandlePromise](resolve, reject); - }, reject); - }; -} - -var AsyncIteratorPrototype = Object.getPrototypeOf(function () {}); -var ReadableStreamAsyncIteratorPrototype = Object.setPrototypeOf((_Object$setPrototypeO = { - get stream() { - return this[kStream]; - }, - - next: function next() { - var _this = this; - - // if we have detected an error in the meanwhile - // reject straight away - var error = this[kError]; - - if (error !== null) { - return Promise.reject(error); - } - - if (this[kEnded]) { - return Promise.resolve(createIterResult(undefined, true)); - } - - if (this[kStream].destroyed) { - // We need to defer via nextTick because if .destroy(err) is - // called, the error will be emitted via nextTick, and - // we cannot guarantee that there is no error lingering around - // waiting to be emitted. - return new Promise(function (resolve, reject) { - process.nextTick(function () { - if (_this[kError]) { - reject(_this[kError]); - } else { - resolve(createIterResult(undefined, true)); - } - }); - }); - } // if we have multiple next() calls - // we will wait for the previous Promise to finish - // this logic is optimized to support for await loops, - // where next() is only called once at a time - - - var lastPromise = this[kLastPromise]; - var promise; - - if (lastPromise) { - promise = new Promise(wrapForNext(lastPromise, this)); - } else { - // fast path needed to support multiple this.push() - // without triggering the next() queue - var data = this[kStream].read(); - - if (data !== null) { - return Promise.resolve(createIterResult(data, false)); - } - - promise = new Promise(this[kHandlePromise]); - } - - this[kLastPromise] = promise; - return promise; - } -}, _defineProperty(_Object$setPrototypeO, Symbol.asyncIterator, function () { - return this; -}), _defineProperty(_Object$setPrototypeO, "return", function _return() { - var _this2 = this; - - // destroy(err, cb) is a private API - // we can guarantee we have that here, because we control the - // Readable class this is attached to - return new Promise(function (resolve, reject) { - _this2[kStream].destroy(null, function (err) { - if (err) { - reject(err); - return; - } - - resolve(createIterResult(undefined, true)); - }); - }); -}), _Object$setPrototypeO), AsyncIteratorPrototype); - -var createReadableStreamAsyncIterator = function createReadableStreamAsyncIterator(stream) { - var _Object$create; - - var iterator = Object.create(ReadableStreamAsyncIteratorPrototype, (_Object$create = {}, _defineProperty(_Object$create, kStream, { - value: stream, - writable: true - }), _defineProperty(_Object$create, kLastResolve, { - value: null, - writable: true - }), _defineProperty(_Object$create, kLastReject, { - value: null, - writable: true - }), _defineProperty(_Object$create, kError, { - value: null, - writable: true - }), _defineProperty(_Object$create, kEnded, { - value: stream._readableState.endEmitted, - writable: true - }), _defineProperty(_Object$create, kHandlePromise, { - value: function value(resolve, reject) { - var data = iterator[kStream].read(); - - if (data) { - iterator[kLastPromise] = null; - iterator[kLastResolve] = null; - iterator[kLastReject] = null; - resolve(createIterResult(data, false)); - } else { - iterator[kLastResolve] = resolve; - iterator[kLastReject] = reject; - } - }, - writable: true - }), _Object$create)); - iterator[kLastPromise] = null; - finished(stream, function (err) { - if (err && err.code !== 'ERR_STREAM_PREMATURE_CLOSE') { - var reject = iterator[kLastReject]; // reject if we are waiting for data in the Promise - // returned by next() and store the error - - if (reject !== null) { - iterator[kLastPromise] = null; - iterator[kLastResolve] = null; - iterator[kLastReject] = null; - reject(err); - } - - iterator[kError] = err; - return; - } - - var resolve = iterator[kLastResolve]; - - if (resolve !== null) { - iterator[kLastPromise] = null; - iterator[kLastResolve] = null; - iterator[kLastReject] = null; - resolve(createIterResult(undefined, true)); - } - - iterator[kEnded] = true; - }); - stream.on('readable', onReadable.bind(null, iterator)); - return iterator; -}; - -module.exports = createReadableStreamAsyncIterator; \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/readable-stream/lib/internal/streams/buffer_list.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/readable-stream/lib/internal/streams/buffer_list.js deleted file mode 100644 index cdea425f..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/readable-stream/lib/internal/streams/buffer_list.js +++ /dev/null @@ -1,210 +0,0 @@ -'use strict'; - -function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } - -function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } - -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } - -function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } - -var _require = require('buffer'), - Buffer = _require.Buffer; - -var _require2 = require('util'), - inspect = _require2.inspect; - -var custom = inspect && inspect.custom || 'inspect'; - -function copyBuffer(src, target, offset) { - Buffer.prototype.copy.call(src, target, offset); -} - -module.exports = -/*#__PURE__*/ -function () { - function BufferList() { - _classCallCheck(this, BufferList); - - this.head = null; - this.tail = null; - this.length = 0; - } - - _createClass(BufferList, [{ - key: "push", - value: function push(v) { - var entry = { - data: v, - next: null - }; - if (this.length > 0) this.tail.next = entry;else this.head = entry; - this.tail = entry; - ++this.length; - } - }, { - key: "unshift", - value: function unshift(v) { - var entry = { - data: v, - next: this.head - }; - if (this.length === 0) this.tail = entry; - this.head = entry; - ++this.length; - } - }, { - key: "shift", - value: function shift() { - if (this.length === 0) return; - var ret = this.head.data; - if (this.length === 1) this.head = this.tail = null;else this.head = this.head.next; - --this.length; - return ret; - } - }, { - key: "clear", - value: function clear() { - this.head = this.tail = null; - this.length = 0; - } - }, { - key: "join", - value: function join(s) { - if (this.length === 0) return ''; - var p = this.head; - var ret = '' + p.data; - - while (p = p.next) { - ret += s + p.data; - } - - return ret; - } - }, { - key: "concat", - value: function concat(n) { - if (this.length === 0) return Buffer.alloc(0); - var ret = Buffer.allocUnsafe(n >>> 0); - var p = this.head; - var i = 0; - - while (p) { - copyBuffer(p.data, ret, i); - i += p.data.length; - p = p.next; - } - - return ret; - } // Consumes a specified amount of bytes or characters from the buffered data. - - }, { - key: "consume", - value: function consume(n, hasStrings) { - var ret; - - if (n < this.head.data.length) { - // `slice` is the same for buffers and strings. - ret = this.head.data.slice(0, n); - this.head.data = this.head.data.slice(n); - } else if (n === this.head.data.length) { - // First chunk is a perfect match. - ret = this.shift(); - } else { - // Result spans more than one buffer. - ret = hasStrings ? this._getString(n) : this._getBuffer(n); - } - - return ret; - } - }, { - key: "first", - value: function first() { - return this.head.data; - } // Consumes a specified amount of characters from the buffered data. - - }, { - key: "_getString", - value: function _getString(n) { - var p = this.head; - var c = 1; - var ret = p.data; - n -= ret.length; - - while (p = p.next) { - var str = p.data; - var nb = n > str.length ? str.length : n; - if (nb === str.length) ret += str;else ret += str.slice(0, n); - n -= nb; - - if (n === 0) { - if (nb === str.length) { - ++c; - if (p.next) this.head = p.next;else this.head = this.tail = null; - } else { - this.head = p; - p.data = str.slice(nb); - } - - break; - } - - ++c; - } - - this.length -= c; - return ret; - } // Consumes a specified amount of bytes from the buffered data. - - }, { - key: "_getBuffer", - value: function _getBuffer(n) { - var ret = Buffer.allocUnsafe(n); - var p = this.head; - var c = 1; - p.data.copy(ret); - n -= p.data.length; - - while (p = p.next) { - var buf = p.data; - var nb = n > buf.length ? buf.length : n; - buf.copy(ret, ret.length - n, 0, nb); - n -= nb; - - if (n === 0) { - if (nb === buf.length) { - ++c; - if (p.next) this.head = p.next;else this.head = this.tail = null; - } else { - this.head = p; - p.data = buf.slice(nb); - } - - break; - } - - ++c; - } - - this.length -= c; - return ret; - } // Make sure the linked list only shows the minimal necessary information. - - }, { - key: custom, - value: function value(_, options) { - return inspect(this, _objectSpread({}, options, { - // Only inspect one level. - depth: 0, - // It should not recurse. - customInspect: false - })); - } - }]); - - return BufferList; -}(); \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/readable-stream/lib/internal/streams/destroy.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/readable-stream/lib/internal/streams/destroy.js deleted file mode 100644 index 3268a16f..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/readable-stream/lib/internal/streams/destroy.js +++ /dev/null @@ -1,105 +0,0 @@ -'use strict'; // undocumented cb() API, needed for core, not for public API - -function destroy(err, cb) { - var _this = this; - - var readableDestroyed = this._readableState && this._readableState.destroyed; - var writableDestroyed = this._writableState && this._writableState.destroyed; - - if (readableDestroyed || writableDestroyed) { - if (cb) { - cb(err); - } else if (err) { - if (!this._writableState) { - process.nextTick(emitErrorNT, this, err); - } else if (!this._writableState.errorEmitted) { - this._writableState.errorEmitted = true; - process.nextTick(emitErrorNT, this, err); - } - } - - return this; - } // we set destroyed to true before firing error callbacks in order - // to make it re-entrance safe in case destroy() is called within callbacks - - - if (this._readableState) { - this._readableState.destroyed = true; - } // if this is a duplex stream mark the writable part as destroyed as well - - - if (this._writableState) { - this._writableState.destroyed = true; - } - - this._destroy(err || null, function (err) { - if (!cb && err) { - if (!_this._writableState) { - process.nextTick(emitErrorAndCloseNT, _this, err); - } else if (!_this._writableState.errorEmitted) { - _this._writableState.errorEmitted = true; - process.nextTick(emitErrorAndCloseNT, _this, err); - } else { - process.nextTick(emitCloseNT, _this); - } - } else if (cb) { - process.nextTick(emitCloseNT, _this); - cb(err); - } else { - process.nextTick(emitCloseNT, _this); - } - }); - - return this; -} - -function emitErrorAndCloseNT(self, err) { - emitErrorNT(self, err); - emitCloseNT(self); -} - -function emitCloseNT(self) { - if (self._writableState && !self._writableState.emitClose) return; - if (self._readableState && !self._readableState.emitClose) return; - self.emit('close'); -} - -function undestroy() { - if (this._readableState) { - this._readableState.destroyed = false; - this._readableState.reading = false; - this._readableState.ended = false; - this._readableState.endEmitted = false; - } - - if (this._writableState) { - this._writableState.destroyed = false; - this._writableState.ended = false; - this._writableState.ending = false; - this._writableState.finalCalled = false; - this._writableState.prefinished = false; - this._writableState.finished = false; - this._writableState.errorEmitted = false; - } -} - -function emitErrorNT(self, err) { - self.emit('error', err); -} - -function errorOrDestroy(stream, err) { - // We have tests that rely on errors being emitted - // in the same tick, so changing this is semver major. - // For now when you opt-in to autoDestroy we allow - // the error to be emitted nextTick. In a future - // semver major update we should change the default to this. - var rState = stream._readableState; - var wState = stream._writableState; - if (rState && rState.autoDestroy || wState && wState.autoDestroy) stream.destroy(err);else stream.emit('error', err); -} - -module.exports = { - destroy: destroy, - undestroy: undestroy, - errorOrDestroy: errorOrDestroy -}; \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/readable-stream/lib/internal/streams/end-of-stream.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/readable-stream/lib/internal/streams/end-of-stream.js deleted file mode 100644 index 831f286d..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/readable-stream/lib/internal/streams/end-of-stream.js +++ /dev/null @@ -1,104 +0,0 @@ -// Ported from https://github.com/mafintosh/end-of-stream with -// permission from the author, Mathias Buus (@mafintosh). -'use strict'; - -var ERR_STREAM_PREMATURE_CLOSE = require('../../../errors').codes.ERR_STREAM_PREMATURE_CLOSE; - -function once(callback) { - var called = false; - return function () { - if (called) return; - called = true; - - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - - callback.apply(this, args); - }; -} - -function noop() {} - -function isRequest(stream) { - return stream.setHeader && typeof stream.abort === 'function'; -} - -function eos(stream, opts, callback) { - if (typeof opts === 'function') return eos(stream, null, opts); - if (!opts) opts = {}; - callback = once(callback || noop); - var readable = opts.readable || opts.readable !== false && stream.readable; - var writable = opts.writable || opts.writable !== false && stream.writable; - - var onlegacyfinish = function onlegacyfinish() { - if (!stream.writable) onfinish(); - }; - - var writableEnded = stream._writableState && stream._writableState.finished; - - var onfinish = function onfinish() { - writable = false; - writableEnded = true; - if (!readable) callback.call(stream); - }; - - var readableEnded = stream._readableState && stream._readableState.endEmitted; - - var onend = function onend() { - readable = false; - readableEnded = true; - if (!writable) callback.call(stream); - }; - - var onerror = function onerror(err) { - callback.call(stream, err); - }; - - var onclose = function onclose() { - var err; - - if (readable && !readableEnded) { - if (!stream._readableState || !stream._readableState.ended) err = new ERR_STREAM_PREMATURE_CLOSE(); - return callback.call(stream, err); - } - - if (writable && !writableEnded) { - if (!stream._writableState || !stream._writableState.ended) err = new ERR_STREAM_PREMATURE_CLOSE(); - return callback.call(stream, err); - } - }; - - var onrequest = function onrequest() { - stream.req.on('finish', onfinish); - }; - - if (isRequest(stream)) { - stream.on('complete', onfinish); - stream.on('abort', onclose); - if (stream.req) onrequest();else stream.on('request', onrequest); - } else if (writable && !stream._writableState) { - // legacy streams - stream.on('end', onlegacyfinish); - stream.on('close', onlegacyfinish); - } - - stream.on('end', onend); - stream.on('finish', onfinish); - if (opts.error !== false) stream.on('error', onerror); - stream.on('close', onclose); - return function () { - stream.removeListener('complete', onfinish); - stream.removeListener('abort', onclose); - stream.removeListener('request', onrequest); - if (stream.req) stream.req.removeListener('finish', onfinish); - stream.removeListener('end', onlegacyfinish); - stream.removeListener('close', onlegacyfinish); - stream.removeListener('finish', onfinish); - stream.removeListener('end', onend); - stream.removeListener('error', onerror); - stream.removeListener('close', onclose); - }; -} - -module.exports = eos; \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/readable-stream/lib/internal/streams/from-browser.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/readable-stream/lib/internal/streams/from-browser.js deleted file mode 100644 index a4ce56f3..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/readable-stream/lib/internal/streams/from-browser.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function () { - throw new Error('Readable.from is not available in the browser') -}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/readable-stream/lib/internal/streams/from.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/readable-stream/lib/internal/streams/from.js deleted file mode 100644 index 6c412844..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/readable-stream/lib/internal/streams/from.js +++ /dev/null @@ -1,64 +0,0 @@ -'use strict'; - -function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } - -function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } - -function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } - -function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } - -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - -var ERR_INVALID_ARG_TYPE = require('../../../errors').codes.ERR_INVALID_ARG_TYPE; - -function from(Readable, iterable, opts) { - var iterator; - - if (iterable && typeof iterable.next === 'function') { - iterator = iterable; - } else if (iterable && iterable[Symbol.asyncIterator]) iterator = iterable[Symbol.asyncIterator]();else if (iterable && iterable[Symbol.iterator]) iterator = iterable[Symbol.iterator]();else throw new ERR_INVALID_ARG_TYPE('iterable', ['Iterable'], iterable); - - var readable = new Readable(_objectSpread({ - objectMode: true - }, opts)); // Reading boolean to protect against _read - // being called before last iteration completion. - - var reading = false; - - readable._read = function () { - if (!reading) { - reading = true; - next(); - } - }; - - function next() { - return _next2.apply(this, arguments); - } - - function _next2() { - _next2 = _asyncToGenerator(function* () { - try { - var _ref = yield iterator.next(), - value = _ref.value, - done = _ref.done; - - if (done) { - readable.push(null); - } else if (readable.push((yield value))) { - next(); - } else { - reading = false; - } - } catch (err) { - readable.destroy(err); - } - }); - return _next2.apply(this, arguments); - } - - return readable; -} - -module.exports = from; \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/readable-stream/lib/internal/streams/pipeline.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/readable-stream/lib/internal/streams/pipeline.js deleted file mode 100644 index 65899098..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/readable-stream/lib/internal/streams/pipeline.js +++ /dev/null @@ -1,97 +0,0 @@ -// Ported from https://github.com/mafintosh/pump with -// permission from the author, Mathias Buus (@mafintosh). -'use strict'; - -var eos; - -function once(callback) { - var called = false; - return function () { - if (called) return; - called = true; - callback.apply(void 0, arguments); - }; -} - -var _require$codes = require('../../../errors').codes, - ERR_MISSING_ARGS = _require$codes.ERR_MISSING_ARGS, - ERR_STREAM_DESTROYED = _require$codes.ERR_STREAM_DESTROYED; - -function noop(err) { - // Rethrow the error if it exists to avoid swallowing it - if (err) throw err; -} - -function isRequest(stream) { - return stream.setHeader && typeof stream.abort === 'function'; -} - -function destroyer(stream, reading, writing, callback) { - callback = once(callback); - var closed = false; - stream.on('close', function () { - closed = true; - }); - if (eos === undefined) eos = require('./end-of-stream'); - eos(stream, { - readable: reading, - writable: writing - }, function (err) { - if (err) return callback(err); - closed = true; - callback(); - }); - var destroyed = false; - return function (err) { - if (closed) return; - if (destroyed) return; - destroyed = true; // request.destroy just do .end - .abort is what we want - - if (isRequest(stream)) return stream.abort(); - if (typeof stream.destroy === 'function') return stream.destroy(); - callback(err || new ERR_STREAM_DESTROYED('pipe')); - }; -} - -function call(fn) { - fn(); -} - -function pipe(from, to) { - return from.pipe(to); -} - -function popCallback(streams) { - if (!streams.length) return noop; - if (typeof streams[streams.length - 1] !== 'function') return noop; - return streams.pop(); -} - -function pipeline() { - for (var _len = arguments.length, streams = new Array(_len), _key = 0; _key < _len; _key++) { - streams[_key] = arguments[_key]; - } - - var callback = popCallback(streams); - if (Array.isArray(streams[0])) streams = streams[0]; - - if (streams.length < 2) { - throw new ERR_MISSING_ARGS('streams'); - } - - var error; - var destroys = streams.map(function (stream, i) { - var reading = i < streams.length - 1; - var writing = i > 0; - return destroyer(stream, reading, writing, function (err) { - if (!error) error = err; - if (err) destroys.forEach(call); - if (reading) return; - destroys.forEach(call); - callback(error); - }); - }); - return streams.reduce(pipe); -} - -module.exports = pipeline; \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/readable-stream/lib/internal/streams/state.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/readable-stream/lib/internal/streams/state.js deleted file mode 100644 index 19887eb8..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/readable-stream/lib/internal/streams/state.js +++ /dev/null @@ -1,27 +0,0 @@ -'use strict'; - -var ERR_INVALID_OPT_VALUE = require('../../../errors').codes.ERR_INVALID_OPT_VALUE; - -function highWaterMarkFrom(options, isDuplex, duplexKey) { - return options.highWaterMark != null ? options.highWaterMark : isDuplex ? options[duplexKey] : null; -} - -function getHighWaterMark(state, options, duplexKey, isDuplex) { - var hwm = highWaterMarkFrom(options, isDuplex, duplexKey); - - if (hwm != null) { - if (!(isFinite(hwm) && Math.floor(hwm) === hwm) || hwm < 0) { - var name = isDuplex ? duplexKey : 'highWaterMark'; - throw new ERR_INVALID_OPT_VALUE(name, hwm); - } - - return Math.floor(hwm); - } // Default value - - - return state.objectMode ? 16 : 16 * 1024; -} - -module.exports = { - getHighWaterMark: getHighWaterMark -}; \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/readable-stream/lib/internal/streams/stream-browser.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/readable-stream/lib/internal/streams/stream-browser.js deleted file mode 100644 index 9332a3fd..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/readable-stream/lib/internal/streams/stream-browser.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('events').EventEmitter; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/readable-stream/lib/internal/streams/stream.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/readable-stream/lib/internal/streams/stream.js deleted file mode 100644 index ce2ad5b6..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/readable-stream/lib/internal/streams/stream.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('stream'); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/readable-stream/package.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/readable-stream/package.json deleted file mode 100644 index 0b0c4bd2..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/readable-stream/package.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "name": "readable-stream", - "version": "3.6.0", - "description": "Streams3, a user-land copy of the stream library from Node.js", - "main": "readable.js", - "engines": { - "node": ">= 6" - }, - "dependencies": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - }, - "devDependencies": { - "@babel/cli": "^7.2.0", - "@babel/core": "^7.2.0", - "@babel/polyfill": "^7.0.0", - "@babel/preset-env": "^7.2.0", - "airtap": "0.0.9", - "assert": "^1.4.0", - "bl": "^2.0.0", - "deep-strict-equal": "^0.2.0", - "events.once": "^2.0.2", - "glob": "^7.1.2", - "gunzip-maybe": "^1.4.1", - "hyperquest": "^2.1.3", - "lolex": "^2.6.0", - "nyc": "^11.0.0", - "pump": "^3.0.0", - "rimraf": "^2.6.2", - "tap": "^12.0.0", - "tape": "^4.9.0", - "tar-fs": "^1.16.2", - "util-promisify": "^2.1.0" - }, - "scripts": { - "test": "tap -J --no-esm test/parallel/*.js test/ours/*.js", - "ci": "TAP=1 tap --no-esm test/parallel/*.js test/ours/*.js | tee test.tap", - "test-browsers": "airtap --sauce-connect --loopback airtap.local -- test/browser.js", - "test-browser-local": "airtap --open --local -- test/browser.js", - "cover": "nyc npm test", - "report": "nyc report --reporter=lcov", - "update-browser-errors": "babel -o errors-browser.js errors.js" - }, - "repository": { - "type": "git", - "url": "git://github.com/nodejs/readable-stream" - }, - "keywords": [ - "readable", - "stream", - "pipe" - ], - "browser": { - "util": false, - "worker_threads": false, - "./errors": "./errors-browser.js", - "./readable.js": "./readable-browser.js", - "./lib/internal/streams/from.js": "./lib/internal/streams/from-browser.js", - "./lib/internal/streams/stream.js": "./lib/internal/streams/stream-browser.js" - }, - "nyc": { - "include": [ - "lib/**.js" - ] - }, - "license": "MIT" -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/readable-stream/readable-browser.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/readable-stream/readable-browser.js deleted file mode 100644 index adbf60de..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/readable-stream/readable-browser.js +++ /dev/null @@ -1,9 +0,0 @@ -exports = module.exports = require('./lib/_stream_readable.js'); -exports.Stream = exports; -exports.Readable = exports; -exports.Writable = require('./lib/_stream_writable.js'); -exports.Duplex = require('./lib/_stream_duplex.js'); -exports.Transform = require('./lib/_stream_transform.js'); -exports.PassThrough = require('./lib/_stream_passthrough.js'); -exports.finished = require('./lib/internal/streams/end-of-stream.js'); -exports.pipeline = require('./lib/internal/streams/pipeline.js'); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/readable-stream/readable.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/readable-stream/readable.js deleted file mode 100644 index 9e0ca120..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/readable-stream/readable.js +++ /dev/null @@ -1,16 +0,0 @@ -var Stream = require('stream'); -if (process.env.READABLE_STREAM === 'disable' && Stream) { - module.exports = Stream.Readable; - Object.assign(module.exports, Stream); - module.exports.Stream = Stream; -} else { - exports = module.exports = require('./lib/_stream_readable.js'); - exports.Stream = Stream || exports; - exports.Readable = exports; - exports.Writable = require('./lib/_stream_writable.js'); - exports.Duplex = require('./lib/_stream_duplex.js'); - exports.Transform = require('./lib/_stream_transform.js'); - exports.PassThrough = require('./lib/_stream_passthrough.js'); - exports.finished = require('./lib/internal/streams/end-of-stream.js'); - exports.pipeline = require('./lib/internal/streams/pipeline.js'); -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/require-directory/.jshintrc b/packages/wyatt_notification_bloc/example/scripts/node_modules/require-directory/.jshintrc deleted file mode 100644 index e14e4dcb..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/require-directory/.jshintrc +++ /dev/null @@ -1,67 +0,0 @@ -{ - "maxerr" : 50, - "bitwise" : true, - "camelcase" : true, - "curly" : true, - "eqeqeq" : true, - "forin" : true, - "immed" : true, - "indent" : 2, - "latedef" : true, - "newcap" : true, - "noarg" : true, - "noempty" : true, - "nonew" : true, - "plusplus" : true, - "quotmark" : true, - "undef" : true, - "unused" : true, - "strict" : true, - "trailing" : true, - "maxparams" : false, - "maxdepth" : false, - "maxstatements" : false, - "maxcomplexity" : false, - "maxlen" : false, - "asi" : false, - "boss" : false, - "debug" : false, - "eqnull" : true, - "es5" : false, - "esnext" : false, - "moz" : false, - "evil" : false, - "expr" : true, - "funcscope" : true, - "globalstrict" : true, - "iterator" : true, - "lastsemic" : false, - "laxbreak" : false, - "laxcomma" : false, - "loopfunc" : false, - "multistr" : false, - "proto" : false, - "scripturl" : false, - "smarttabs" : false, - "shadow" : false, - "sub" : false, - "supernew" : false, - "validthis" : false, - "browser" : true, - "couch" : false, - "devel" : true, - "dojo" : false, - "jquery" : false, - "mootools" : false, - "node" : true, - "nonstandard" : false, - "prototypejs" : false, - "rhino" : false, - "worker" : false, - "wsh" : false, - "yui" : false, - "nomen" : true, - "onevar" : true, - "passfail" : false, - "white" : true -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/require-directory/.npmignore b/packages/wyatt_notification_bloc/example/scripts/node_modules/require-directory/.npmignore deleted file mode 100644 index 47cf365a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/require-directory/.npmignore +++ /dev/null @@ -1 +0,0 @@ -test/** diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/require-directory/.travis.yml b/packages/wyatt_notification_bloc/example/scripts/node_modules/require-directory/.travis.yml deleted file mode 100644 index 20fd86b6..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/require-directory/.travis.yml +++ /dev/null @@ -1,3 +0,0 @@ -language: node_js -node_js: - - 0.10 diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/require-directory/LICENSE b/packages/wyatt_notification_bloc/example/scripts/node_modules/require-directory/LICENSE deleted file mode 100644 index a70f253a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/require-directory/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2011 Troy Goode - -Permission is hereby granted, free of charge, to any person obtaining a -copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/require-directory/README.markdown b/packages/wyatt_notification_bloc/example/scripts/node_modules/require-directory/README.markdown deleted file mode 100644 index 926a063e..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/require-directory/README.markdown +++ /dev/null @@ -1,184 +0,0 @@ -# require-directory - -Recursively iterates over specified directory, `require()`'ing each file, and returning a nested hash structure containing those modules. - -**[Follow me (@troygoode) on Twitter!](https://twitter.com/intent/user?screen_name=troygoode)** - -[![NPM](https://nodei.co/npm/require-directory.png?downloads=true&stars=true)](https://nodei.co/npm/require-directory/) - -[![build status](https://secure.travis-ci.org/troygoode/node-require-directory.png)](http://travis-ci.org/troygoode/node-require-directory) - -## How To Use - -### Installation (via [npm](https://npmjs.org/package/require-directory)) - -```bash -$ npm install require-directory -``` - -### Usage - -A common pattern in node.js is to include an index file which creates a hash of the files in its current directory. Given a directory structure like so: - -* app.js -* routes/ - * index.js - * home.js - * auth/ - * login.js - * logout.js - * register.js - -`routes/index.js` uses `require-directory` to build the hash (rather than doing so manually) like so: - -```javascript -var requireDirectory = require('require-directory'); -module.exports = requireDirectory(module); -``` - -`app.js` references `routes/index.js` like any other module, but it now has a hash/tree of the exports from the `./routes/` directory: - -```javascript -var routes = require('./routes'); - -// snip - -app.get('/', routes.home); -app.get('/register', routes.auth.register); -app.get('/login', routes.auth.login); -app.get('/logout', routes.auth.logout); -``` - -The `routes` variable above is the equivalent of this: - -```javascript -var routes = { - home: require('routes/home.js'), - auth: { - login: require('routes/auth/login.js'), - logout: require('routes/auth/logout.js'), - register: require('routes/auth/register.js') - } -}; -``` - -*Note that `routes.index` will be `undefined` as you would hope.* - -### Specifying Another Directory - -You can specify which directory you want to build a tree of (if it isn't the current directory for whatever reason) by passing it as the second parameter. Not specifying the path (`requireDirectory(module)`) is the equivelant of `requireDirectory(module, __dirname)`: - -```javascript -var requireDirectory = require('require-directory'); -module.exports = requireDirectory(module, './some/subdirectory'); -``` - -For example, in the [example in the Usage section](#usage) we could have avoided creating `routes/index.js` and instead changed the first lines of `app.js` to: - -```javascript -var requireDirectory = require('require-directory'); -var routes = requireDirectory(module, './routes'); -``` - -## Options - -You can pass an options hash to `require-directory` as the 2nd parameter (or 3rd if you're passing the path to another directory as the 2nd parameter already). Here are the available options: - -### Whitelisting - -Whitelisting (either via RegExp or function) allows you to specify that only certain files be loaded. - -```javascript -var requireDirectory = require('require-directory'), - whitelist = /onlyinclude.js$/, - hash = requireDirectory(module, {include: whitelist}); -``` - -```javascript -var requireDirectory = require('require-directory'), - check = function(path){ - if(/onlyinclude.js$/.test(path)){ - return true; // don't include - }else{ - return false; // go ahead and include - } - }, - hash = requireDirectory(module, {include: check}); -``` - -### Blacklisting - -Blacklisting (either via RegExp or function) allows you to specify that all but certain files should be loaded. - -```javascript -var requireDirectory = require('require-directory'), - blacklist = /dontinclude\.js$/, - hash = requireDirectory(module, {exclude: blacklist}); -``` - -```javascript -var requireDirectory = require('require-directory'), - check = function(path){ - if(/dontinclude\.js$/.test(path)){ - return false; // don't include - }else{ - return true; // go ahead and include - } - }, - hash = requireDirectory(module, {exclude: check}); -``` - -### Visiting Objects As They're Loaded - -`require-directory` takes a function as the `visit` option that will be called for each module that is added to module.exports. - -```javascript -var requireDirectory = require('require-directory'), - visitor = function(obj) { - console.log(obj); // will be called for every module that is loaded - }, - hash = requireDirectory(module, {visit: visitor}); -``` - -The visitor can also transform the objects by returning a value: - -```javascript -var requireDirectory = require('require-directory'), - visitor = function(obj) { - return obj(new Date()); - }, - hash = requireDirectory(module, {visit: visitor}); -``` - -### Renaming Keys - -```javascript -var requireDirectory = require('require-directory'), - renamer = function(name) { - return name.toUpperCase(); - }, - hash = requireDirectory(module, {rename: renamer}); -``` - -### No Recursion - -```javascript -var requireDirectory = require('require-directory'), - hash = requireDirectory(module, {recurse: false}); -``` - -## Run Unit Tests - -```bash -$ npm run lint -$ npm test -``` - -## License - -[MIT License](http://www.opensource.org/licenses/mit-license.php) - -## Author - -[Troy Goode](https://github.com/TroyGoode) ([troygoode@gmail.com](mailto:troygoode@gmail.com)) - diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/require-directory/index.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/require-directory/index.js deleted file mode 100644 index cd37da7e..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/require-directory/index.js +++ /dev/null @@ -1,86 +0,0 @@ -'use strict'; - -var fs = require('fs'), - join = require('path').join, - resolve = require('path').resolve, - dirname = require('path').dirname, - defaultOptions = { - extensions: ['js', 'json', 'coffee'], - recurse: true, - rename: function (name) { - return name; - }, - visit: function (obj) { - return obj; - } - }; - -function checkFileInclusion(path, filename, options) { - return ( - // verify file has valid extension - (new RegExp('\\.(' + options.extensions.join('|') + ')$', 'i').test(filename)) && - - // if options.include is a RegExp, evaluate it and make sure the path passes - !(options.include && options.include instanceof RegExp && !options.include.test(path)) && - - // if options.include is a function, evaluate it and make sure the path passes - !(options.include && typeof options.include === 'function' && !options.include(path, filename)) && - - // if options.exclude is a RegExp, evaluate it and make sure the path doesn't pass - !(options.exclude && options.exclude instanceof RegExp && options.exclude.test(path)) && - - // if options.exclude is a function, evaluate it and make sure the path doesn't pass - !(options.exclude && typeof options.exclude === 'function' && options.exclude(path, filename)) - ); -} - -function requireDirectory(m, path, options) { - var retval = {}; - - // path is optional - if (path && !options && typeof path !== 'string') { - options = path; - path = null; - } - - // default options - options = options || {}; - for (var prop in defaultOptions) { - if (typeof options[prop] === 'undefined') { - options[prop] = defaultOptions[prop]; - } - } - - // if no path was passed in, assume the equivelant of __dirname from caller - // otherwise, resolve path relative to the equivalent of __dirname - path = !path ? dirname(m.filename) : resolve(dirname(m.filename), path); - - // get the path of each file in specified directory, append to current tree node, recurse - fs.readdirSync(path).forEach(function (filename) { - var joined = join(path, filename), - files, - key, - obj; - - if (fs.statSync(joined).isDirectory() && options.recurse) { - // this node is a directory; recurse - files = requireDirectory(m, joined, options); - // exclude empty directories - if (Object.keys(files).length) { - retval[options.rename(filename, joined, filename)] = files; - } - } else { - if (joined !== m.filename && checkFileInclusion(joined, filename, options)) { - // hash node key shouldn't include file extension - key = filename.substring(0, filename.lastIndexOf('.')); - obj = m.require(joined); - retval[options.rename(key, joined, filename)] = options.visit(obj, joined, filename) || obj; - } - } - }); - - return retval; -} - -module.exports = requireDirectory; -module.exports.defaults = defaultOptions; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/require-directory/package.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/require-directory/package.json deleted file mode 100644 index 25ece4b3..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/require-directory/package.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "author": "Troy Goode (http://github.com/troygoode/)", - "name": "require-directory", - "version": "2.1.1", - "description": "Recursively iterates over specified directory, require()'ing each file, and returning a nested hash structure containing those modules.", - "keywords": [ - "require", - "directory", - "library", - "recursive" - ], - "homepage": "https://github.com/troygoode/node-require-directory/", - "main": "index.js", - "repository": { - "type": "git", - "url": "git://github.com/troygoode/node-require-directory.git" - }, - "contributors": [ - { - "name": "Troy Goode", - "email": "troygoode@gmail.com", - "web": "http://github.com/troygoode/" - } - ], - "license": "MIT", - "bugs": { - "url": "http://github.com/troygoode/node-require-directory/issues/" - }, - "engines": { - "node": ">=0.10.0" - }, - "devDependencies": { - "jshint": "^2.6.0", - "mocha": "^2.1.0" - }, - "scripts": { - "test": "mocha", - "lint": "jshint index.js test/test.js" - } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/requizzle/.editorconfig b/packages/wyatt_notification_bloc/example/scripts/node_modules/requizzle/.editorconfig deleted file mode 100644 index c035c9f2..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/requizzle/.editorconfig +++ /dev/null @@ -1,12 +0,0 @@ -[*] -charset = utf-8 -insert_final_newline = true -trim_trailing_whitespace = true - -[package.json] -indent_style = space -indent_size = 2 - -[{**/*.js,**/*.css,**/*.json}] -indent_style = space -indent_size = 4 diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/requizzle/.travis.yml b/packages/wyatt_notification_bloc/example/scripts/node_modules/requizzle/.travis.yml deleted file mode 100644 index b0dac3d0..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/requizzle/.travis.yml +++ /dev/null @@ -1,8 +0,0 @@ -language: node_js - -node_js: - - "8" - - "10" - - "12" - -install: npm install -g gulp; npm install diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/requizzle/LICENSE b/packages/wyatt_notification_bloc/example/scripts/node_modules/requizzle/LICENSE deleted file mode 100644 index 2e55e626..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/requizzle/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014 Google Inc. -Copyright (c) 2012-2013 Johannes Ewald - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/requizzle/README.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/requizzle/README.md deleted file mode 100644 index fecde199..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/requizzle/README.md +++ /dev/null @@ -1,171 +0,0 @@ -# Requizzle - -[![Build Status](https://travis-ci.com/hegemonic/requizzle.svg?branch=master)](https://travis-ci.com/hegemonic/requizzle) - -Swizzle a little something into your Node.js modules. - -## What's Requizzle? - -Requizzle provides a drop-in replacement for Node.js's `require()` function. -This replacement enables you to change a module's source code when Node.js loads -the module. - -You can use Requizzle in your test cases, or in production code if you like to -live dangerously. - -## How can I change a module with Requizzle? - -There are several different ways: - -### Look for modules in new places - -With Requizzle, you can add directories to the module lookup path, which forces -Node.js to search those directories for modules. This can be useful if: - -+ You're tired of writing code like `require('../../../../../lib/foo')`. -+ You want to expose your app's modules to external plugins. - -### Add code before or after the module's source code - -Tamper with modules to your heart's delight by adding arbitrary code before or -after the module's own source code. - -### Mess with child modules - -When you use Requizzle to require a module, you can force each child module's -`require` method to inherit your changes to the parent module. (By default, only -the parent module is changed.) - -## Will Requizzle break my dependencies? - -Probably not. It's true that Requizzle gives you plenty of new and exciting ways -to tamper with, and possibly break, your module dependencies. But Requizzle also -tries not to break anything on its own. In particular: - -+ **Requizzle preserves strict-mode declarations**. If a module starts with a -strict-mode declaration, Requizzle keeps it in place. Your changes will appear -after the strict-mode declaration. -+ **Requizzle leaves native modules alone**. If you use Requizzle to load one of -Node.js's built-in modules, such as `fs` or `path`, Requizzle won't mess with -it. - -## Usage - -The Requizzle module exports a single function, which returns a drop-in -replacement for `require()`. - -When you call the function, you must pass in an `options` object, which can -include any of these properties: - -+ `extras`: A pair of functions that return text to insert before or after the -module's source code. Each function accepts two parameters: `targetPath`, the -path to the required module, and `parentModule`, the `Module` object for the -module's parent. Each function must return a string. - + `extras.before`: A function that returns text to insert before the - module's source code. - + `extras.after`: A function that returns text to insert after the module's - source code. -+ `infect`: Determines whether child modules are infected with the same changes -as the parent module. Set to `true` to force child modules to inherit your -changes. Defaults to `false`. -+ `requirePaths`: Additional paths to search for required modules. For example, -if `requirePaths` is set to `['/usr/lib/junk/modules']`, and you save a -JavaScript module at `/usr/lib/junk/modules/mymodule.js`, you can require the -module as `mymodule`. - - You can provide an array of paths, which will be searched before the default - module paths, or an object with the following properties: - - + `requirePaths.before`: An array of paths to search before the default - module paths. - + `requirePaths.after`: An array of paths to search after the default module - paths. Use this property if you want the module to use its own local - dependencies when possible, then fall back to the additional paths if - necessary. - - By default, the require path is not changed. - -## Examples - -```js -const requizzle = require('requizzle'); - -// Say hello and goodbye to each module. -const logRequire = requizzle({ - extras: { - before: function(targetPath, parentModule) { - return 'console.log("Hello %s!", ' + targetPath + ');\n'; - }, - after: function(targetPath, parentModule) { - return 'console.log("Goodbye %s!", ' + targetPath + ');\n'; - } - } -}); -// Prints "Hello /path/to/mymodule.js!" and "Goodbye /path/to/mymodule.js!" -const myModule = logRequire('mymodule'); - -// Look for modules in the current module's `lib` directory, and force child -// modules to do the same. -const path = require('path'); -const extraPathRequire = requizzle({ - infect: true, - requirePaths: [path.join(__dirname, 'lib')] -}); -// If `foo` needs to require a module in `./lib`, it can use `require('bar')` -// instead of `require('./lib/bar')`. -const foo = extraPathRequire('./foo'); -``` - -## Troubleshooting - -Here are some problems you might run into when you use Requizzle, along with -solutions to each problem. If you run into any problems that aren't addressed -here, please file a new issue! - -### Requizzle slowed down my code! A lot! - -Requizzle adds minimal overhead to the module-loading process. However, your -code will run _much_ slower than usual if you do both of the following: - -+ Use Requizzle's `infect` option. -+ Require modules that have a lot of `require()` calls within the scope of -individual functions. - -If Requizzle seems to slow down your app, look for module calls that are within -function scope, then move them to each module's top-level scope. - -### Requizzle made my module do something weird! - -Do you have any -[circular dependencies](https://nodejs.org/api/modules.html#modules_cycles) in -the modules that aren't working? Circular dependencies can cause unusual -behavior with Requizzle, just as they can without Requizzle. Try breaking the -circular dependency. - -### Requizzle violates the [Law of Demeter](https://en.wikipedia.org/wiki/Law_of_Demeter)! It's an unnatural abomination! - -Fair enough. - -## Changelog - -+ 0.2.3 (July 2019): Updated dependencies. -+ 0.2.2 (May 2019): Fixed a compability issue with Node.js 12. -+ 0.2.1 (December 2014): The `requirePaths` option no longer inserts an extra -line break into the source file. -+ 0.2.0 (June 2014): The `requirePaths` option can now contain `before` and -`after` properties. Paths in the `before` property will be searched first; paths -in the `after` property will be searched last. -+ 0.1.1 (June 2014): If the `requirePaths` option is used, the module loader now -searches the extra paths first rather than last. -+ 0.1.0 (June 2014): Initial release. - -## Acknowledgements ## - -Requizzle is very loosely adapted from Johannes Ewald's -[rewire](https://github.com/jhnns/rewire) module, which is designed to modify a -module's behavior for unit testing. If Requizzle doesn't meet your needs, please -take a look at rewire! - -## License - -[MIT license](LICENSE). diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/requizzle/index.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/requizzle/index.js deleted file mode 100644 index f5b0ca36..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/requizzle/index.js +++ /dev/null @@ -1,28 +0,0 @@ -/* - Copyright (c) 2014 Google Inc. All rights reserved. - - Use of this source code is governed by the MIT License, available in this package's LICENSE file - or at http://opensource.org/licenses/MIT. - */ -const _ = require('lodash'); -const Requizzle = require('./lib/requizzle'); - -module.exports = function requizzle(options) { - let instance; - - if (!options || typeof options !== 'object') { - throw new TypeError('Requizzle\'s options parameter must be a non-null object.'); - } - options = _.clone(options); - options.parent = module.parent; - - return filepath => { - instance = instance || new Requizzle(options); - - return instance.requizzle(filepath); - }; -}; -module.exports.Requizzle = Requizzle; - -// force Node.js to reload this module each time it's required, so module.parent is always correct -delete require.cache[__filename]; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/requizzle/lib/loader.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/requizzle/lib/loader.js deleted file mode 100644 index 40c6c189..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/requizzle/lib/loader.js +++ /dev/null @@ -1,165 +0,0 @@ -/* - Copyright (c) 2014 Google Inc. All rights reserved. - Copyright (c) 2012-2013 Johannes Ewald. - - Use of this source code is governed by the MIT License, available in this package's LICENSE file - or at http://opensource.org/licenses/MIT. - */ -const _ = require('lodash'); -const fs = require('fs'); -const Module = require('module'); - -const originalWrapper = Module.wrapper.slice(0); -const requizzleWrappers = { - extras: require('./wrappers/extras'), - requirePaths: require('./wrappers/requirepaths'), - strict: require('./wrappers/strict') -}; - -function wrap(wrappers, script) { - return wrappers[0] + script + wrappers[1]; -} - -function replaceWrapper(wrapperObj) { - const joiner = '\n'; - const before = wrapperObj.before.join(joiner); - const after = wrapperObj.after.join(joiner); - const wrappers = [ - originalWrapper[0] + before, - after + originalWrapper[1] - ]; - - Module.wrap = wrap.bind(null, wrappers); -} - -function restoreWrapper() { - Module.wrap = wrap.bind(null, originalWrapper); -} - -function createModule(targetPath, parentModule, moduleCache) { - moduleCache[targetPath] = moduleCache[targetPath] || new Module(targetPath, parentModule); - - return moduleCache[targetPath]; -} - -/** - * Wrapper for `require()` to prevent the target module's dependencies from being swizzled. - * - * @param {!Module} targetModule - The module that is being swizzled. - * @param {!function} nodeRequire - The original `require()` method for the target module. - * @param {!string} filepath - The value passed to `require()`. - * @return {!Module} The requested module dependency. - */ -function requireProxy(targetModule, nodeRequire, filepath) { - restoreWrapper(); - targetModule.require = nodeRequire; - - return nodeRequire.call(targetModule, filepath); -} - -/** - * Wrapper for `require()` to swizzle the target module's dependencies, using the same settings as - * the target module. - * - * @param {!Module} targetModule - The module that is being swizzled. - * @param {!Object} opts - The Requizzle options object. - * @param {!string} filepath - The value passed to `require()`. - * @return {!Module} The requested module dependency. - */ -function infectProxy(targetModule, cache, opts, filepath) { - let moduleExports; - // loaded here to avoid circular dependencies - const Requizzle = require('./requizzle'); - let requizzle; - - opts = _.clone(opts); - opts.parent = targetModule; - requizzle = new Requizzle(opts, cache); - - moduleExports = requizzle.requizzle(filepath); - - return moduleExports; -} - -exports.load = function load(targetPath, parentModule, wrapper, cache, options) { - let nodeRequire; - let targetModule; - - // Handle circular requires, and avoid reloading modules unnecessarily - if (cache.module[targetPath]) { - return cache.module[targetPath]; - } - - targetModule = createModule(targetPath, parentModule, cache.module); - nodeRequire = targetModule.require; - - if (options.infect) { - targetModule.require = filepath => infectProxy(targetModule, cache, options, filepath); - } else { - targetModule.require = filepath => requireProxy(targetModule, nodeRequire, filepath); - } - - // update the wrapper before we load the target module - replaceWrapper(wrapper); - - targetModule.load(targetModule.id); - - // make sure the wrapper is restored even if the target module doesn't load any dependencies - restoreWrapper(); - - return targetModule; -}; - -/** - * Check whether the entire module includes a `'use strict'` declaration. - * - * @param {string} src - The source file to check. - * @return {boolean} Set to `true` if the module includes a `use strict` declaration. - */ -function detectStrictMode(src) { - return (/^\s*(?:["']use strict["'])[ \t]*(?:[\r\n]|;)/g).test(src); -} - -function loadSource(targetPath, sourceCache) { - if (sourceCache[targetPath] === undefined) { - sourceCache[targetPath] = fs.readFileSync(targetPath, 'utf8'); - } - - return sourceCache[targetPath]; -} - -exports.createWrapper = function createWrapper(targetPath, parentModule, cache, options) { - let src; - const wrapperObject = { - before: [], - after: [] - }; - - function add(wrapperFunctions, opts) { - const params = [targetPath, parentModule, opts]; - - ['before', 'after'].forEach(item => { - const result = wrapperFunctions[item].apply(null, params); - - if (result) { - wrapperObject[item].push(result); - } - }); - } - - // Preserve the module's `use strict` declaration if present - src = loadSource(targetPath, cache.source); - if (detectStrictMode(src) === true) { - add(requizzleWrappers.strict); - } - - if (options.requirePaths) { - add(requizzleWrappers.requirePaths, options.requirePaths); - } - - if (options.extras) { - add(requizzleWrappers.extras, options.extras); - } - - return wrapperObject; -}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/requizzle/lib/requizzle.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/requizzle/lib/requizzle.js deleted file mode 100644 index 71eeacc3..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/requizzle/lib/requizzle.js +++ /dev/null @@ -1,93 +0,0 @@ -/* - Copyright (c) 2014 Google Inc. All rights reserved. - Copyright (c) 2012-2013 Johannes Ewald. - - Use of this source code is governed by the MIT License, available in this package's LICENSE file - or at http://opensource.org/licenses/MIT. - */ -/** @module lib/requizzle */ - -const loader = require('./loader'); -const Module = require('module'); - -/** - * Function that returns text to swizzle into the module. - * - * @typedef module:lib/requizzle~wrapperFunction - * @type {function} - * @param {string} targetPath - The path to the target module. - * @param {string} parentModulePath - The path to the module that is requiring the target module. - * @return {string} The text to insert before or after the module's source code. - */ - -/** - * Options for the wrappers that will be swizzled into the target module. - * - * @typedef module:lib/requizzle~options - * @type {Object} - * @property {Object=} options.extras - Functions that generate text to swizzle into the target - * module. - * @property {module:lib/requizzle~wrapperFunction} options.extras.after - Function that returns - * text to insert after the module's source code. - * @property {module:lib/requizzle~wrapperFunction} options.extras.before - Function that returns - * text to insert before the module's source code. - * @property {(Array.|string)} options.requirePaths - Additional paths to search when - * resolving module paths in the target module. - */ - -function isNativeModule(targetPath, parentModule) { - const lookupPaths = Module._resolveLookupPaths(targetPath, parentModule, true); - - /* istanbul ignore next */ - return lookupPaths === null || - (lookupPaths.length === 2 && - lookupPaths[1].length === 0 && - lookupPaths[0] === targetPath); -} - -/** - * Create a `Requizzle` instance. If you provide options, Requizzle will default to those options - * when you call {@link Requizzle#requizzle}. - * - * @class - * @param {!module:lib/requizzle~options} options - Options for the wrappers that will be swizzled - * into the target module. - * @param {Object=} cache - For internal use. - */ -class Requizzle { - constructor(options, cache) { - this._options = options; - this._cache = cache || { - module: {}, - source: {} - }; - } - - /** - * Load the module, swizzling in the requested changes. - * - * @param {!string} targetPath - The path to the module that will be loaded. - * @return {Module} The swizzled module. - */ - requizzle(targetPath) { - const options = this._options; - const parentModule = options.parent; - let targetModule; - let wrapper; - - // Don't interfere with native modules - if (isNativeModule(targetPath, parentModule)) { - return require(targetPath); - } - - // Resolve the filename relative to the parent module - targetPath = Module._resolveFilename(targetPath, parentModule); - - wrapper = loader.createWrapper(targetPath, parentModule, this._cache, this._options); - targetModule = loader.load(targetPath, parentModule, wrapper, this._cache, this._options); - - return targetModule.exports; - } -} - -module.exports = Requizzle; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/requizzle/lib/wrappers/extras.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/requizzle/lib/wrappers/extras.js deleted file mode 100644 index e1c4eb16..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/requizzle/lib/wrappers/extras.js +++ /dev/null @@ -1,21 +0,0 @@ -/* - Copyright (c) 2014 Google Inc. All rights reserved. - - Use of this source code is governed by the MIT License, available in this package's LICENSE file - or at http://opensource.org/licenses/MIT. - */ -function callFunction(targetPath, parentModule, func) { - if (!func) { - return ''; - } - - return func(targetPath, parentModule); -} - -exports.before = function before(targetPath, parentModule, options) { - return callFunction(targetPath, parentModule, options.before); -}; - -exports.after = function after(targetPath, parentModule, options) { - return callFunction(targetPath, parentModule, options.after); -}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/requizzle/lib/wrappers/requirepaths.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/requizzle/lib/wrappers/requirepaths.js deleted file mode 100644 index fb62a25e..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/requizzle/lib/wrappers/requirepaths.js +++ /dev/null @@ -1,46 +0,0 @@ -/* - Copyright (c) 2014 Google Inc. All rights reserved. - - Use of this source code is governed by the MIT License, available in this package's LICENSE file - or at http://opensource.org/licenses/MIT. - */ -const path = require('path'); - -function resolvePaths({filepath}, paths) { - if (!paths) { - return []; - } - - return paths.slice(0).map(p => path.resolve(filepath, p)); -} - -function requirePaths(parentModule, opts) { - const result = { - before: [], - after: [] - }; - - if (!parentModule) { - return result; - } - - if (Array.isArray(opts)) { - result.before = resolvePaths(parentModule, opts); - } else { - result.before = resolvePaths(parentModule, opts.before); - result.after = resolvePaths(parentModule, opts.after); - } - - return result; -} - -exports.before = function before(targetPath, parentModule, opts) { - const resolvedPaths = requirePaths(parentModule, opts); - - return `module.paths = ${JSON.stringify(resolvedPaths.before)}.concat(module.paths)` + - `.concat(${JSON.stringify(resolvedPaths.after)}); `; -}; - -exports.after = function after() { - return ''; -}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/requizzle/lib/wrappers/strict.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/requizzle/lib/wrappers/strict.js deleted file mode 100644 index 9e98117d..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/requizzle/lib/wrappers/strict.js +++ /dev/null @@ -1,13 +0,0 @@ -/* - Copyright (c) 2014 Google Inc. All rights reserved. - - Use of this source code is governed by the MIT License, available in this package's LICENSE file - or at http://opensource.org/licenses/MIT. - */ -exports.before = function before() { - return '"use strict";'; -}; - -exports.after = function after() { - return ''; -}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/requizzle/package.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/requizzle/package.json deleted file mode 100644 index 685a7915..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/requizzle/package.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "name": "requizzle", - "version": "0.2.3", - "description": "Swizzle a little something into your require() calls.", - "main": "index.js", - "scripts": { - "test": "gulp test" - }, - "repository": { - "type": "git", - "url": "git://github.com/hegemonic/requizzle.git" - }, - "keywords": [ - "module", - "modules", - "require", - "inject", - "dependency", - "swizzle" - ], - "author": "Jeff Williams ", - "license": "MIT", - "bugs": { - "url": "https://github.com/hegemonic/requizzle/issues" - }, - "homepage": "https://github.com/hegemonic/requizzle", - "dependencies": { - "lodash": "^4.17.14" - }, - "devDependencies": { - "expectations": "^1.0.0", - "gulp": "^4.0.2", - "gulp-eslint": "^6.0.0", - "gulp-mocha": "^6.0.0" - } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/retry-request/CHANGELOG.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/retry-request/CHANGELOG.md deleted file mode 100644 index 0c86c527..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/retry-request/CHANGELOG.md +++ /dev/null @@ -1,49 +0,0 @@ -# Changelog - -## [5.0.2](https://github.com/googleapis/retry-request/compare/v5.0.1...v5.0.2) (2022-09-14) - - -### Bug Fixes - -* Delete second LICENSE ([#82](https://github.com/googleapis/retry-request/issues/82)) ([9dfaf18](https://github.com/googleapis/retry-request/commit/9dfaf1819b18b6d660924951b9cf1c509b6e9870)) -* Remove pip install statements ([#1546](https://github.com/googleapis/retry-request/issues/1546)) ([#79](https://github.com/googleapis/retry-request/issues/79)) ([cb4e15d](https://github.com/googleapis/retry-request/commit/cb4e15d6e8ae9d72855ed1071957afe9d301b12e)) - -## [5.0.1](https://github.com/googleapis/retry-request/compare/v5.0.0...v5.0.1) (2022-06-09) - - -### Bug Fixes - -* respect totalTimeout and do not retry if nextRetryDelay is <= 0 ([#38](https://github.com/googleapis/retry-request/issues/38)) ([9501a42](https://github.com/googleapis/retry-request/commit/9501a42d06a620282dcd2ff9990fd0b5033a990b)) - -## [5.0.0](https://github.com/googleapis/retry-request/compare/v4.2.2...v5.0.0) (2022-05-06) - - -### ⚠ BREAKING CHANGES - -* drop node 10 (#68) - -### Build System - -* drop node 10 ([#68](https://github.com/googleapis/retry-request/issues/68)) ([00ec90c](https://github.com/googleapis/retry-request/commit/00ec90c4d3cb29245ca746e0e133fcddc22d2251)) - -### [4.2.1](https://github.com/googleapis/retry-request/compare/v4.2.0...v4.2.1) (2022-04-12) - - -### Bug Fixes - -* add new retry options to types ([#36](https://github.com/googleapis/retry-request/issues/36)) ([3f10798](https://github.com/googleapis/retry-request/commit/3f10798f47c03b50f1ba352b04d09ea3d0458b9c)) -* use extend instead of object.assign ([#37](https://github.com/googleapis/retry-request/issues/37)) ([8c8dcdd](https://github.com/googleapis/retry-request/commit/8c8dcdd7d6262ce305c93fa4a8a7b2630e984824)) - -## [4.2.0](https://github.com/googleapis/retry-request/compare/v4.1.0...v4.2.0) (2022-04-06) - - -### Features - -* support enhanced retry settings ([#35](https://github.com/googleapis/retry-request/issues/35)) ([0184676](https://github.com/googleapis/retry-request/commit/0184676dee36596fb939fb4559af11d0a14f64bd)) - - -### Bug Fixes - -* add new retry options to types ([#36](https://github.com/googleapis/retry-request/issues/36)) ([3f10798](https://github.com/googleapis/retry-request/commit/3f10798f47c03b50f1ba352b04d09ea3d0458b9c)) -* correctly calculate retry attempt ([#33](https://github.com/googleapis/retry-request/issues/33)) ([4c852e2](https://github.com/googleapis/retry-request/commit/4c852e2ba22a7f75edfb3c905bd37a7e9913e67d)) -* use extend instead of object.assign ([#37](https://github.com/googleapis/retry-request/issues/37)) ([8c8dcdd](https://github.com/googleapis/retry-request/commit/8c8dcdd7d6262ce305c93fa4a8a7b2630e984824)) diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/retry-request/index.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/retry-request/index.d.ts deleted file mode 100644 index 3a399b92..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/retry-request/index.d.ts +++ /dev/null @@ -1,31 +0,0 @@ -declare module 'retry-request' { - // eslint-disable-next-line node/no-unpublished-import - import * as request from 'request'; - - namespace retryRequest { - function getNextRetryDelay(retryNumber: number): void; - interface Options { - objectMode?: boolean; - request?: typeof request; - retries?: number; - noResponseRetries?: number; - currentRetryAttempt?: number; - maxRetryDelay?: number; - retryDelayMultiplier?: number; - totalTimeout?: number; - shouldRetryFn?: (response: request.RequestResponse) => boolean; - } - } - - function retryRequest( - requestOpts: request.Options, - opts: retryRequest.Options, - callback?: request.RequestCallback - ): {abort: () => void}; - function retryRequest( - requestOpts: request.Options, - callback?: request.RequestCallback - ): {abort: () => void}; - - export = retryRequest; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/retry-request/index.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/retry-request/index.js deleted file mode 100644 index a2932987..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/retry-request/index.js +++ /dev/null @@ -1,273 +0,0 @@ -'use strict'; - -const {PassThrough} = require('stream'); -const debug = require('debug')('retry-request'); -const extend = require('extend'); - -const DEFAULTS = { - objectMode: false, - retries: 2, - - /* - The maximum time to delay in seconds. If retryDelayMultiplier results in a - delay greater than maxRetryDelay, retries should delay by maxRetryDelay - seconds instead. - */ - maxRetryDelay: 64, - - /* - The multiplier by which to increase the delay time between the completion of - failed requests, and the initiation of the subsequent retrying request. - */ - retryDelayMultiplier: 2, - - /* - The length of time to keep retrying in seconds. The last sleep period will - be shortened as necessary, so that the last retry runs at deadline (and not - considerably beyond it). The total time starting from when the initial - request is sent, after which an error will be returned, regardless of the - retrying attempts made meanwhile. - */ - totalTimeout: 600, - - noResponseRetries: 2, - currentRetryAttempt: 0, - shouldRetryFn: function (response) { - const retryRanges = [ - // https://en.wikipedia.org/wiki/List_of_HTTP_status_codes - // 1xx - Retry (Informational, request still processing) - // 2xx - Do not retry (Success) - // 3xx - Do not retry (Redirect) - // 4xx - Do not retry (Client errors) - // 429 - Retry ("Too Many Requests") - // 5xx - Retry (Server errors) - [100, 199], - [429, 429], - [500, 599], - ]; - - const statusCode = response.statusCode; - debug(`Response status: ${statusCode}`); - - let range; - while ((range = retryRanges.shift())) { - if (statusCode >= range[0] && statusCode <= range[1]) { - // Not a successful status or redirect. - return true; - } - } - }, -}; - -function retryRequest(requestOpts, opts, callback) { - const streamMode = typeof arguments[arguments.length - 1] !== 'function'; - - if (typeof opts === 'function') { - callback = opts; - } - - const manualCurrentRetryAttemptWasSet = - opts && typeof opts.currentRetryAttempt === 'number'; - opts = extend({}, DEFAULTS, opts); - - if (typeof opts.request === 'undefined') { - try { - // eslint-disable-next-line node/no-unpublished-require - opts.request = require('request'); - } catch (e) { - throw new Error('A request library must be provided to retry-request.'); - } - } - - let currentRetryAttempt = opts.currentRetryAttempt; - - let numNoResponseAttempts = 0; - let streamResponseHandled = false; - - let retryStream; - let requestStream; - let delayStream; - - let activeRequest; - const retryRequest = { - abort: function () { - if (activeRequest && activeRequest.abort) { - activeRequest.abort(); - } - }, - }; - - if (streamMode) { - retryStream = new PassThrough({objectMode: opts.objectMode}); - retryStream.abort = resetStreams; - } - - const timeOfFirstRequest = Date.now(); - if (currentRetryAttempt > 0) { - retryAfterDelay(currentRetryAttempt); - } else { - makeRequest(); - } - - if (streamMode) { - return retryStream; - } else { - return retryRequest; - } - - function resetStreams() { - delayStream = null; - - if (requestStream) { - requestStream.abort && requestStream.abort(); - requestStream.cancel && requestStream.cancel(); - - if (requestStream.destroy) { - requestStream.destroy(); - } else if (requestStream.end) { - requestStream.end(); - } - } - } - - function makeRequest() { - currentRetryAttempt++; - debug(`Current retry attempt: ${currentRetryAttempt}`); - - if (streamMode) { - streamResponseHandled = false; - - delayStream = new PassThrough({objectMode: opts.objectMode}); - requestStream = opts.request(requestOpts); - - setImmediate(() => { - retryStream.emit('request'); - }); - - requestStream - // gRPC via google-cloud-node can emit an `error` as well as a `response` - // Whichever it emits, we run with-- we can't run with both. That's what - // is up with the `streamResponseHandled` tracking. - .on('error', err => { - if (streamResponseHandled) { - return; - } - - streamResponseHandled = true; - onResponse(err); - }) - .on('response', (resp, body) => { - if (streamResponseHandled) { - return; - } - - streamResponseHandled = true; - onResponse(null, resp, body); - }) - .on('complete', retryStream.emit.bind(retryStream, 'complete')); - - requestStream.pipe(delayStream); - } else { - activeRequest = opts.request(requestOpts, onResponse); - } - } - - function retryAfterDelay(currentRetryAttempt) { - if (streamMode) { - resetStreams(); - } - - const nextRetryDelay = getNextRetryDelay({ - maxRetryDelay: opts.maxRetryDelay, - retryDelayMultiplier: opts.retryDelayMultiplier, - retryNumber: currentRetryAttempt, - timeOfFirstRequest, - totalTimeout: opts.totalTimeout, - }); - debug(`Next retry delay: ${nextRetryDelay}`); - - if (nextRetryDelay <= 0) { - numNoResponseAttempts = opts.noResponseRetries + 1; - return; - } - - setTimeout(makeRequest, nextRetryDelay); - } - - function onResponse(err, response, body) { - // An error such as DNS resolution. - if (err) { - numNoResponseAttempts++; - - if (numNoResponseAttempts <= opts.noResponseRetries) { - retryAfterDelay(numNoResponseAttempts); - } else { - if (streamMode) { - retryStream.emit('error', err); - retryStream.end(); - } else { - callback(err, response, body); - } - } - - return; - } - - // Send the response to see if we should try again. - // NOTE: "currentRetryAttempt" isn't accurate by default, as it counts - // the very first request sent as the first "retry". It is only accurate - // when a user provides their own "currentRetryAttempt" option at - // instantiation. - const adjustedCurrentRetryAttempt = manualCurrentRetryAttemptWasSet - ? currentRetryAttempt - : currentRetryAttempt - 1; - if ( - adjustedCurrentRetryAttempt < opts.retries && - opts.shouldRetryFn(response) - ) { - retryAfterDelay(currentRetryAttempt); - return; - } - - // No more attempts need to be made, just continue on. - if (streamMode) { - retryStream.emit('response', response); - delayStream.pipe(retryStream); - requestStream.on('error', err => { - retryStream.destroy(err); - }); - } else { - callback(err, response, body); - } - } -} - -module.exports = retryRequest; - -function getNextRetryDelay(config) { - const { - maxRetryDelay, - retryDelayMultiplier, - retryNumber, - timeOfFirstRequest, - totalTimeout, - } = config; - - const maxRetryDelayMs = maxRetryDelay * 1000; - const totalTimeoutMs = totalTimeout * 1000; - - const jitter = Math.floor(Math.random() * 1000); - const calculatedNextRetryDelay = - Math.pow(retryDelayMultiplier, retryNumber) * 1000 + jitter; - - const maxAllowableDelayMs = - totalTimeoutMs - (Date.now() - timeOfFirstRequest); - - return Math.min( - calculatedNextRetryDelay, - maxAllowableDelayMs, - maxRetryDelayMs - ); -} - -module.exports.getNextRetryDelay = getNextRetryDelay; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/retry-request/license b/packages/wyatt_notification_bloc/example/scripts/node_modules/retry-request/license deleted file mode 100644 index df6eeb55..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/retry-request/license +++ /dev/null @@ -1,20 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015 Stephen Sawchuk - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/retry-request/package.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/retry-request/package.json deleted file mode 100644 index 06f9814a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/retry-request/package.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "name": "retry-request", - "version": "5.0.2", - "description": "Retry a request.", - "main": "index.js", - "repository": "stephenplusplus/retry-request", - "scripts": { - "docs": "jsdoc -c .jsdoc.js", - "predocs-test": "npm run docs", - "docs-test": "linkinator docs", - "fix": "gts fix", - "lint": "gts check", - "test": "mocha --timeout 0", - "system-test": "" - }, - "files": [ - "index.js", - "index.d.ts", - "license" - ], - "types": "index.d.ts", - "keywords": [ - "request", - "retry", - "stream" - ], - "author": "Stephen Sawchuk ", - "license": "MIT", - "engines": { - "node": ">=12" - }, - "dependencies": { - "debug": "^4.1.1", - "extend": "^3.0.2" - }, - "devDependencies": { - "@types/request": "^2.48.8", - "async": "^3.0.1", - "gts": "^3.1.0", - "jsdoc": "^3.6.3", - "jsdoc-fresh": "^2.0.0", - "jsdoc-region-tag": "^2.0.0", - "linkinator": "^4.0.0", - "lodash.range": "^3.2.0", - "mocha": "^9.2.2", - "request": "^2.87.0", - "typescript": "^4.6.3" - } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/retry-request/readme.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/retry-request/readme.md deleted file mode 100644 index 8c5beda7..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/retry-request/readme.md +++ /dev/null @@ -1,199 +0,0 @@ -|![retry-request](logo.png) -|:-: -|Retry a [request][request] with built-in [exponential backoff](https://developers.google.com/analytics/devguides/reporting/core/v3/coreErrors#backoff). - -```sh -$ npm install --save request -$ npm install --save retry-request -``` -```js -var request = require('retry-request', { - request: require('request') -}); -``` - -It should work the same as `request` in both callback mode and stream mode. - -Note: This module only works when used as a readable stream, i.e. POST requests aren't supported ([#3](https://github.com/stephenplusplus/retry-request/issues/3)). - -## Do I need to install `request`? - -Yes! You must independently install `request` and provide it to this library: - -```js -var request = require('retry-request', { - request: require('request') -}); -``` - -*The code will actually look for the `request` module automatically to save you this step. But, being explicit like in the example is also welcome.* - -#### Callback - -`urlThatReturns503` will be requested 3 total times before giving up and executing the callback. - -```js -request(urlThatReturns503, function (err, resp, body) {}); -``` - -#### Stream - -`urlThatReturns503` will be requested 3 total times before giving up and emitting the `response` and `complete` event as usual. - -```js -request(urlThatReturns503) - .on('error', function () {}) - .on('response', function () {}) - .on('complete', function () {}); -``` - -## Can I monitor what retry-request is doing internally? - -Yes! This project uses [debug](https://www.npmjs.com/package/debug) to provide the current retry attempt, each response status, and the delay computed until the next retry attempt is made. To enable the debug mode, set the environment variable `DEBUG` to *retry-request*. - -(Thanks for the implementation, @yihaozhadan!) - -## request(requestOptions, [opts], [cb]) - -### requestOptions - -Passed directly to `request`. See the list of options supported: https://github.com/request/request/#requestoptions-callback. - -### opts *(optional)* - -#### `opts.noResponseRetries` - -Type: `Number` - -Default: `2` - -The number of times to retry after a response fails to come through, such as a DNS resolution error or a socket hangup. - -```js -var opts = { - noResponseRetries: 0 -}; - -request(url, opts, function (err, resp, body) { - // url was requested 1 time before giving up and - // executing this callback. -}); -``` - -#### `opts.objectMode` - -Type: `Boolean` - -Default: `false` - -Set to `true` if your custom `opts.request` function returns a stream in object mode. - -#### `opts.retries` - -Type: `Number` - -Default: `2` - -```js -var opts = { - retries: 4 -}; - -request(urlThatReturns503, opts, function (err, resp, body) { - // urlThatReturns503 was requested a total of 5 times - // before giving up and executing this callback. -}); -``` - -#### `opts.currentRetryAttempt` - -Type: `Number` - -Default: `0` - -```js -var opts = { - currentRetryAttempt: 1 -}; - -request(urlThatReturns503, opts, function (err, resp, body) { - // urlThatReturns503 was requested as if it already failed once. -}); -``` - -#### `opts.shouldRetryFn` - -Type: `Function` - -Default: Returns `true` if [http.incomingMessage](https://nodejs.org/api/http.html#http_http_incomingmessage).statusCode is < 200 or >= 400. - -```js -var opts = { - shouldRetryFn: function (incomingHttpMessage) { - return incomingHttpMessage.statusMessage !== 'OK'; - } -}; - -request(urlThatReturnsNonOKStatusMessage, opts, function (err, resp, body) { - // urlThatReturnsNonOKStatusMessage was requested a - // total of 3 times, each time using `opts.shouldRetryFn` - // to decide if it should continue before giving up and - // executing this callback. -}); -``` - -#### `opts.request` - -Type: `Function` - -Default: `try { require('request') }` - -If we cannot locate `request`, we will throw an error advising you to provide it explicitly. - -*NOTE: If you override the request function, and it returns a stream in object mode, be sure to set `opts.objectMode` to `true`.* - -```js -var originalRequest = require('request').defaults({ - pool: { - maxSockets: Infinity - } -}); - -var opts = { - request: originalRequest -}; - -request(urlThatReturns503, opts, function (err, resp, body) { - // Your provided `originalRequest` instance was used. -}); -``` - -#### `opts.maxRetryDelay` - -Type: `Number` - -Default: `64` - -The maximum time to delay in seconds. If retryDelayMultiplier results in a delay greater than maxRetryDelay, retries should delay by maxRetryDelay seconds instead. - -#### `opts.retryDelayMultiplier` - -Type: `Number` - -Default: `2` - -The multiplier by which to increase the delay time between the completion of failed requests, and the initiation of the subsequent retrying request. - -#### `opts.totalTimeout` - -Type: `Number` - -Default: `600` - -The length of time to keep retrying in seconds. The last sleep period will be shortened as necessary, so that the last retry runs at deadline (and not considerably beyond it). The total time starting from when the initial request is sent, after which an error will be returned, regardless of the retrying attempts made meanwhile. - -### cb *(optional)* - -Passed directly to `request`. See the callback section: https://github.com/request/request/#requestoptions-callback. - -[request]: https://github.com/request/request diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/retry/License b/packages/wyatt_notification_bloc/example/scripts/node_modules/retry/License deleted file mode 100644 index 0b58de37..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/retry/License +++ /dev/null @@ -1,21 +0,0 @@ -Copyright (c) 2011: -Tim Koschützki (tim@debuggable.com) -Felix Geisendörfer (felix@debuggable.com) - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/retry/README.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/retry/README.md deleted file mode 100644 index 6d541530..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/retry/README.md +++ /dev/null @@ -1,227 +0,0 @@ - -[![Build Status](https://secure.travis-ci.org/tim-kos/node-retry.svg?branch=master)](http://travis-ci.org/tim-kos/node-retry "Check this project's build status on TravisCI") -[![codecov](https://codecov.io/gh/tim-kos/node-retry/branch/master/graph/badge.svg)](https://codecov.io/gh/tim-kos/node-retry) - - -# retry - -Abstraction for exponential and custom retry strategies for failed operations. - -## Installation - - npm install retry - -## Current Status - -This module has been tested and is ready to be used. - -## Tutorial - -The example below will retry a potentially failing `dns.resolve` operation -`10` times using an exponential backoff strategy. With the default settings, this -means the last attempt is made after `17 minutes and 3 seconds`. - -``` javascript -var dns = require('dns'); -var retry = require('retry'); - -function faultTolerantResolve(address, cb) { - var operation = retry.operation(); - - operation.attempt(function(currentAttempt) { - dns.resolve(address, function(err, addresses) { - if (operation.retry(err)) { - return; - } - - cb(err ? operation.mainError() : null, addresses); - }); - }); -} - -faultTolerantResolve('nodejs.org', function(err, addresses) { - console.log(err, addresses); -}); -``` - -Of course you can also configure the factors that go into the exponential -backoff. See the API documentation below for all available settings. -currentAttempt is an int representing the number of attempts so far. - -``` javascript -var operation = retry.operation({ - retries: 5, - factor: 3, - minTimeout: 1 * 1000, - maxTimeout: 60 * 1000, - randomize: true, -}); -``` - -## API - -### retry.operation([options]) - -Creates a new `RetryOperation` object. `options` is the same as `retry.timeouts()`'s `options`, with three additions: - -* `forever`: Whether to retry forever, defaults to `false`. -* `unref`: Whether to [unref](https://nodejs.org/api/timers.html#timers_unref) the setTimeout's, defaults to `false`. -* `maxRetryTime`: The maximum time (in milliseconds) that the retried operation is allowed to run. Default is `Infinity`. - -### retry.timeouts([options]) - -Returns an array of timeouts. All time `options` and return values are in -milliseconds. If `options` is an array, a copy of that array is returned. - -`options` is a JS object that can contain any of the following keys: - -* `retries`: The maximum amount of times to retry the operation. Default is `10`. Seting this to `1` means `do it once, then retry it once`. -* `factor`: The exponential factor to use. Default is `2`. -* `minTimeout`: The number of milliseconds before starting the first retry. Default is `1000`. -* `maxTimeout`: The maximum number of milliseconds between two retries. Default is `Infinity`. -* `randomize`: Randomizes the timeouts by multiplying with a factor between `1` to `2`. Default is `false`. - -The formula used to calculate the individual timeouts is: - -``` -Math.min(random * minTimeout * Math.pow(factor, attempt), maxTimeout) -``` - -Have a look at [this article][article] for a better explanation of approach. - -If you want to tune your `factor` / `times` settings to attempt the last retry -after a certain amount of time, you can use wolfram alpha. For example in order -to tune for `10` attempts in `5 minutes`, you can use this equation: - -![screenshot](https://github.com/tim-kos/node-retry/raw/master/equation.gif) - -Explaining the various values from left to right: - -* `k = 0 ... 9`: The `retries` value (10) -* `1000`: The `minTimeout` value in ms (1000) -* `x^k`: No need to change this, `x` will be your resulting factor -* `5 * 60 * 1000`: The desired total amount of time for retrying in ms (5 minutes) - -To make this a little easier for you, use wolfram alpha to do the calculations: - - - -[article]: http://dthain.blogspot.com/2009/02/exponential-backoff-in-distributed.html - -### retry.createTimeout(attempt, opts) - -Returns a new `timeout` (integer in milliseconds) based on the given parameters. - -`attempt` is an integer representing for which retry the timeout should be calculated. If your retry operation was executed 4 times you had one attempt and 3 retries. If you then want to calculate a new timeout, you should set `attempt` to 4 (attempts are zero-indexed). - -`opts` can include `factor`, `minTimeout`, `randomize` (boolean) and `maxTimeout`. They are documented above. - -`retry.createTimeout()` is used internally by `retry.timeouts()` and is public for you to be able to create your own timeouts for reinserting an item, see [issue #13](https://github.com/tim-kos/node-retry/issues/13). - -### retry.wrap(obj, [options], [methodNames]) - -Wrap all functions of the `obj` with retry. Optionally you can pass operation options and -an array of method names which need to be wrapped. - -``` -retry.wrap(obj) - -retry.wrap(obj, ['method1', 'method2']) - -retry.wrap(obj, {retries: 3}) - -retry.wrap(obj, {retries: 3}, ['method1', 'method2']) -``` -The `options` object can take any options that the usual call to `retry.operation` can take. - -### new RetryOperation(timeouts, [options]) - -Creates a new `RetryOperation` where `timeouts` is an array where each value is -a timeout given in milliseconds. - -Available options: -* `forever`: Whether to retry forever, defaults to `false`. -* `unref`: Wether to [unref](https://nodejs.org/api/timers.html#timers_unref) the setTimeout's, defaults to `false`. - -If `forever` is true, the following changes happen: -* `RetryOperation.errors()` will only output an array of one item: the last error. -* `RetryOperation` will repeatedly use the `timeouts` array. Once all of its timeouts have been used up, it restarts with the first timeout, then uses the second and so on. - -#### retryOperation.errors() - -Returns an array of all errors that have been passed to `retryOperation.retry()` so far. The -returning array has the errors ordered chronologically based on when they were passed to -`retryOperation.retry()`, which means the first passed error is at index zero and the last is -at the last index. - -#### retryOperation.mainError() - -A reference to the error object that occured most frequently. Errors are -compared using the `error.message` property. - -If multiple error messages occured the same amount of time, the last error -object with that message is returned. - -If no errors occured so far, the value is `null`. - -#### retryOperation.attempt(fn, timeoutOps) - -Defines the function `fn` that is to be retried and executes it for the first -time right away. The `fn` function can receive an optional `currentAttempt` callback that represents the number of attempts to execute `fn` so far. - -Optionally defines `timeoutOps` which is an object having a property `timeout` in miliseconds and a property `cb` callback function. -Whenever your retry operation takes longer than `timeout` to execute, the timeout callback function `cb` is called. - - -#### retryOperation.try(fn) - -This is an alias for `retryOperation.attempt(fn)`. This is deprecated. Please use `retryOperation.attempt(fn)` instead. - -#### retryOperation.start(fn) - -This is an alias for `retryOperation.attempt(fn)`. This is deprecated. Please use `retryOperation.attempt(fn)` instead. - -#### retryOperation.retry(error) - -Returns `false` when no `error` value is given, or the maximum amount of retries -has been reached. - -Otherwise it returns `true`, and retries the operation after the timeout for -the current attempt number. - -#### retryOperation.stop() - -Allows you to stop the operation being retried. Useful for aborting the operation on a fatal error etc. - -#### retryOperation.reset() - -Resets the internal state of the operation object, so that you can call `attempt()` again as if this was a new operation object. - -#### retryOperation.attempts() - -Returns an int representing the number of attempts it took to call `fn` before it was successful. - -## License - -retry is licensed under the MIT license. - - -# Changelog - -0.10.0 Adding `stop` functionality, thanks to @maxnachlinger. - -0.9.0 Adding `unref` functionality, thanks to @satazor. - -0.8.0 Implementing retry.wrap. - -0.7.0 Some bug fixes and made retry.createTimeout() public. Fixed issues [#10](https://github.com/tim-kos/node-retry/issues/10), [#12](https://github.com/tim-kos/node-retry/issues/12), and [#13](https://github.com/tim-kos/node-retry/issues/13). - -0.6.0 Introduced optional timeOps parameter for the attempt() function which is an object having a property timeout in milliseconds and a property cb callback function. Whenever your retry operation takes longer than timeout to execute, the timeout callback function cb is called. - -0.5.0 Some minor refactoring. - -0.4.0 Changed retryOperation.try() to retryOperation.attempt(). Deprecated the aliases start() and try() for it. - -0.3.0 Added retryOperation.start() which is an alias for retryOperation.try(). - -0.2.0 Added attempts() function and parameter to retryOperation.try() representing the number of attempts it took to call fn(). diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/retry/example/dns.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/retry/example/dns.js deleted file mode 100644 index 446729b6..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/retry/example/dns.js +++ /dev/null @@ -1,31 +0,0 @@ -var dns = require('dns'); -var retry = require('../lib/retry'); - -function faultTolerantResolve(address, cb) { - var opts = { - retries: 2, - factor: 2, - minTimeout: 1 * 1000, - maxTimeout: 2 * 1000, - randomize: true - }; - var operation = retry.operation(opts); - - operation.attempt(function(currentAttempt) { - dns.resolve(address, function(err, addresses) { - if (operation.retry(err)) { - return; - } - - cb(operation.mainError(), operation.errors(), addresses); - }); - }); -} - -faultTolerantResolve('nodejs.org', function(err, errors, addresses) { - console.warn('err:'); - console.log(err); - - console.warn('addresses:'); - console.log(addresses); -}); \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/retry/example/stop.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/retry/example/stop.js deleted file mode 100644 index e1ceafee..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/retry/example/stop.js +++ /dev/null @@ -1,40 +0,0 @@ -var retry = require('../lib/retry'); - -function attemptAsyncOperation(someInput, cb) { - var opts = { - retries: 2, - factor: 2, - minTimeout: 1 * 1000, - maxTimeout: 2 * 1000, - randomize: true - }; - var operation = retry.operation(opts); - - operation.attempt(function(currentAttempt) { - failingAsyncOperation(someInput, function(err, result) { - - if (err && err.message === 'A fatal error') { - operation.stop(); - return cb(err); - } - - if (operation.retry(err)) { - return; - } - - cb(operation.mainError(), operation.errors(), result); - }); - }); -} - -attemptAsyncOperation('test input', function(err, errors, result) { - console.warn('err:'); - console.log(err); - - console.warn('result:'); - console.log(result); -}); - -function failingAsyncOperation(input, cb) { - return setImmediate(cb.bind(null, new Error('A fatal error'))); -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/retry/index.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/retry/index.js deleted file mode 100644 index ee62f3a1..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/retry/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./lib/retry'); \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/retry/lib/retry.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/retry/lib/retry.js deleted file mode 100644 index 5e85e791..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/retry/lib/retry.js +++ /dev/null @@ -1,100 +0,0 @@ -var RetryOperation = require('./retry_operation'); - -exports.operation = function(options) { - var timeouts = exports.timeouts(options); - return new RetryOperation(timeouts, { - forever: options && (options.forever || options.retries === Infinity), - unref: options && options.unref, - maxRetryTime: options && options.maxRetryTime - }); -}; - -exports.timeouts = function(options) { - if (options instanceof Array) { - return [].concat(options); - } - - var opts = { - retries: 10, - factor: 2, - minTimeout: 1 * 1000, - maxTimeout: Infinity, - randomize: false - }; - for (var key in options) { - opts[key] = options[key]; - } - - if (opts.minTimeout > opts.maxTimeout) { - throw new Error('minTimeout is greater than maxTimeout'); - } - - var timeouts = []; - for (var i = 0; i < opts.retries; i++) { - timeouts.push(this.createTimeout(i, opts)); - } - - if (options && options.forever && !timeouts.length) { - timeouts.push(this.createTimeout(i, opts)); - } - - // sort the array numerically ascending - timeouts.sort(function(a,b) { - return a - b; - }); - - return timeouts; -}; - -exports.createTimeout = function(attempt, opts) { - var random = (opts.randomize) - ? (Math.random() + 1) - : 1; - - var timeout = Math.round(random * Math.max(opts.minTimeout, 1) * Math.pow(opts.factor, attempt)); - timeout = Math.min(timeout, opts.maxTimeout); - - return timeout; -}; - -exports.wrap = function(obj, options, methods) { - if (options instanceof Array) { - methods = options; - options = null; - } - - if (!methods) { - methods = []; - for (var key in obj) { - if (typeof obj[key] === 'function') { - methods.push(key); - } - } - } - - for (var i = 0; i < methods.length; i++) { - var method = methods[i]; - var original = obj[method]; - - obj[method] = function retryWrapper(original) { - var op = exports.operation(options); - var args = Array.prototype.slice.call(arguments, 1); - var callback = args.pop(); - - args.push(function(err) { - if (op.retry(err)) { - return; - } - if (err) { - arguments[0] = op.mainError(); - } - callback.apply(this, arguments); - }); - - op.attempt(function() { - original.apply(obj, args); - }); - }.bind(obj, original); - obj[method].options = options; - } -}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/retry/lib/retry_operation.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/retry/lib/retry_operation.js deleted file mode 100644 index 105ce72b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/retry/lib/retry_operation.js +++ /dev/null @@ -1,162 +0,0 @@ -function RetryOperation(timeouts, options) { - // Compatibility for the old (timeouts, retryForever) signature - if (typeof options === 'boolean') { - options = { forever: options }; - } - - this._originalTimeouts = JSON.parse(JSON.stringify(timeouts)); - this._timeouts = timeouts; - this._options = options || {}; - this._maxRetryTime = options && options.maxRetryTime || Infinity; - this._fn = null; - this._errors = []; - this._attempts = 1; - this._operationTimeout = null; - this._operationTimeoutCb = null; - this._timeout = null; - this._operationStart = null; - this._timer = null; - - if (this._options.forever) { - this._cachedTimeouts = this._timeouts.slice(0); - } -} -module.exports = RetryOperation; - -RetryOperation.prototype.reset = function() { - this._attempts = 1; - this._timeouts = this._originalTimeouts.slice(0); -} - -RetryOperation.prototype.stop = function() { - if (this._timeout) { - clearTimeout(this._timeout); - } - if (this._timer) { - clearTimeout(this._timer); - } - - this._timeouts = []; - this._cachedTimeouts = null; -}; - -RetryOperation.prototype.retry = function(err) { - if (this._timeout) { - clearTimeout(this._timeout); - } - - if (!err) { - return false; - } - var currentTime = new Date().getTime(); - if (err && currentTime - this._operationStart >= this._maxRetryTime) { - this._errors.push(err); - this._errors.unshift(new Error('RetryOperation timeout occurred')); - return false; - } - - this._errors.push(err); - - var timeout = this._timeouts.shift(); - if (timeout === undefined) { - if (this._cachedTimeouts) { - // retry forever, only keep last error - this._errors.splice(0, this._errors.length - 1); - timeout = this._cachedTimeouts.slice(-1); - } else { - return false; - } - } - - var self = this; - this._timer = setTimeout(function() { - self._attempts++; - - if (self._operationTimeoutCb) { - self._timeout = setTimeout(function() { - self._operationTimeoutCb(self._attempts); - }, self._operationTimeout); - - if (self._options.unref) { - self._timeout.unref(); - } - } - - self._fn(self._attempts); - }, timeout); - - if (this._options.unref) { - this._timer.unref(); - } - - return true; -}; - -RetryOperation.prototype.attempt = function(fn, timeoutOps) { - this._fn = fn; - - if (timeoutOps) { - if (timeoutOps.timeout) { - this._operationTimeout = timeoutOps.timeout; - } - if (timeoutOps.cb) { - this._operationTimeoutCb = timeoutOps.cb; - } - } - - var self = this; - if (this._operationTimeoutCb) { - this._timeout = setTimeout(function() { - self._operationTimeoutCb(); - }, self._operationTimeout); - } - - this._operationStart = new Date().getTime(); - - this._fn(this._attempts); -}; - -RetryOperation.prototype.try = function(fn) { - console.log('Using RetryOperation.try() is deprecated'); - this.attempt(fn); -}; - -RetryOperation.prototype.start = function(fn) { - console.log('Using RetryOperation.start() is deprecated'); - this.attempt(fn); -}; - -RetryOperation.prototype.start = RetryOperation.prototype.try; - -RetryOperation.prototype.errors = function() { - return this._errors; -}; - -RetryOperation.prototype.attempts = function() { - return this._attempts; -}; - -RetryOperation.prototype.mainError = function() { - if (this._errors.length === 0) { - return null; - } - - var counts = {}; - var mainError = null; - var mainErrorCount = 0; - - for (var i = 0; i < this._errors.length; i++) { - var error = this._errors[i]; - var message = error.message; - var count = (counts[message] || 0) + 1; - - counts[message] = count; - - if (count >= mainErrorCount) { - mainError = error; - mainErrorCount = count; - } - } - - return mainError; -}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/retry/package.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/retry/package.json deleted file mode 100644 index 48f35e8c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/retry/package.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "author": "Tim Koschützki (http://debuggable.com/)", - "name": "retry", - "description": "Abstraction for exponential and custom retry strategies for failed operations.", - "license": "MIT", - "version": "0.13.1", - "homepage": "https://github.com/tim-kos/node-retry", - "repository": { - "type": "git", - "url": "git://github.com/tim-kos/node-retry.git" - }, - "files": [ - "lib", - "example" - ], - "directories": { - "lib": "./lib" - }, - "main": "index.js", - "engines": { - "node": ">= 4" - }, - "dependencies": {}, - "devDependencies": { - "fake": "0.2.0", - "istanbul": "^0.4.5", - "tape": "^4.8.0" - }, - "scripts": { - "test": "./node_modules/.bin/istanbul cover ./node_modules/tape/bin/tape ./test/integration/*.js", - "release:major": "env SEMANTIC=major npm run release", - "release:minor": "env SEMANTIC=minor npm run release", - "release:patch": "env SEMANTIC=patch npm run release", - "release": "npm version ${SEMANTIC:-patch} -m \"Release %s\" && git push && git push --tags && npm publish" - } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/rimraf/CHANGELOG.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/rimraf/CHANGELOG.md deleted file mode 100644 index f116f141..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/rimraf/CHANGELOG.md +++ /dev/null @@ -1,65 +0,0 @@ -# v3.0 - -- Add `--preserve-root` option to executable (default true) -- Drop support for Node.js below version 6 - -# v2.7 - -- Make `glob` an optional dependency - -# 2.6 - -- Retry on EBUSY on non-windows platforms as well -- Make `rimraf.sync` 10000% more reliable on Windows - -# 2.5 - -- Handle Windows EPERM when lstat-ing read-only dirs -- Add glob option to pass options to glob - -# 2.4 - -- Add EPERM to delay/retry loop -- Add `disableGlob` option - -# 2.3 - -- Make maxBusyTries and emfileWait configurable -- Handle weird SunOS unlink-dir issue -- Glob the CLI arg for better Windows support - -# 2.2 - -- Handle ENOENT properly on Windows -- Allow overriding fs methods -- Treat EPERM as indicative of non-empty dir -- Remove optional graceful-fs dep -- Consistently return null error instead of undefined on success -- win32: Treat ENOTEMPTY the same as EBUSY -- Add `rimraf` binary - -# 2.1 - -- Fix SunOS error code for a non-empty directory -- Try rmdir before readdir -- Treat EISDIR like EPERM -- Remove chmod -- Remove lstat polyfill, node 0.7 is not supported - -# 2.0 - -- Fix myGid call to check process.getgid -- Simplify the EBUSY backoff logic. -- Use fs.lstat in node >= 0.7.9 -- Remove gently option -- remove fiber implementation -- Delete files that are marked read-only - -# 1.0 - -- Allow ENOENT in sync method -- Throw when no callback is provided -- Make opts.gently an absolute path -- use 'stat' if 'lstat' is not available -- Consistent error naming, and rethrow non-ENOENT stat errors -- add fiber implementation diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/rimraf/LICENSE b/packages/wyatt_notification_bloc/example/scripts/node_modules/rimraf/LICENSE deleted file mode 100644 index 19129e31..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/rimraf/LICENSE +++ /dev/null @@ -1,15 +0,0 @@ -The ISC License - -Copyright (c) Isaac Z. Schlueter and Contributors - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR -IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/rimraf/README.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/rimraf/README.md deleted file mode 100644 index 423b8cf8..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/rimraf/README.md +++ /dev/null @@ -1,101 +0,0 @@ -[![Build Status](https://travis-ci.org/isaacs/rimraf.svg?branch=master)](https://travis-ci.org/isaacs/rimraf) [![Dependency Status](https://david-dm.org/isaacs/rimraf.svg)](https://david-dm.org/isaacs/rimraf) [![devDependency Status](https://david-dm.org/isaacs/rimraf/dev-status.svg)](https://david-dm.org/isaacs/rimraf#info=devDependencies) - -The [UNIX command](http://en.wikipedia.org/wiki/Rm_(Unix)) `rm -rf` for node. - -Install with `npm install rimraf`, or just drop rimraf.js somewhere. - -## API - -`rimraf(f, [opts], callback)` - -The first parameter will be interpreted as a globbing pattern for files. If you -want to disable globbing you can do so with `opts.disableGlob` (defaults to -`false`). This might be handy, for instance, if you have filenames that contain -globbing wildcard characters. - -The callback will be called with an error if there is one. Certain -errors are handled for you: - -* Windows: `EBUSY` and `ENOTEMPTY` - rimraf will back off a maximum of - `opts.maxBusyTries` times before giving up, adding 100ms of wait - between each attempt. The default `maxBusyTries` is 3. -* `ENOENT` - If the file doesn't exist, rimraf will return - successfully, since your desired outcome is already the case. -* `EMFILE` - Since `readdir` requires opening a file descriptor, it's - possible to hit `EMFILE` if too many file descriptors are in use. - In the sync case, there's nothing to be done for this. But in the - async case, rimraf will gradually back off with timeouts up to - `opts.emfileWait` ms, which defaults to 1000. - -## options - -* unlink, chmod, stat, lstat, rmdir, readdir, - unlinkSync, chmodSync, statSync, lstatSync, rmdirSync, readdirSync - - In order to use a custom file system library, you can override - specific fs functions on the options object. - - If any of these functions are present on the options object, then - the supplied function will be used instead of the default fs - method. - - Sync methods are only relevant for `rimraf.sync()`, of course. - - For example: - - ```javascript - var myCustomFS = require('some-custom-fs') - - rimraf('some-thing', myCustomFS, callback) - ``` - -* maxBusyTries - - If an `EBUSY`, `ENOTEMPTY`, or `EPERM` error code is encountered - on Windows systems, then rimraf will retry with a linear backoff - wait of 100ms longer on each try. The default maxBusyTries is 3. - - Only relevant for async usage. - -* emfileWait - - If an `EMFILE` error is encountered, then rimraf will retry - repeatedly with a linear backoff of 1ms longer on each try, until - the timeout counter hits this max. The default limit is 1000. - - If you repeatedly encounter `EMFILE` errors, then consider using - [graceful-fs](http://npm.im/graceful-fs) in your program. - - Only relevant for async usage. - -* glob - - Set to `false` to disable [glob](http://npm.im/glob) pattern - matching. - - Set to an object to pass options to the glob module. The default - glob options are `{ nosort: true, silent: true }`. - - Glob version 6 is used in this module. - - Relevant for both sync and async usage. - -* disableGlob - - Set to any non-falsey value to disable globbing entirely. - (Equivalent to setting `glob: false`.) - -## rimraf.sync - -It can remove stuff synchronously, too. But that's not so good. Use -the async API. It's better. - -## CLI - -If installed with `npm install rimraf -g` it can be used as a global -command `rimraf [ ...]` which is useful for cross platform support. - -## mkdirp - -If you need to create a directory recursively, check out -[mkdirp](https://github.com/substack/node-mkdirp). diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/rimraf/bin.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/rimraf/bin.js deleted file mode 100755 index 023814cc..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/rimraf/bin.js +++ /dev/null @@ -1,68 +0,0 @@ -#!/usr/bin/env node - -const rimraf = require('./') - -const path = require('path') - -const isRoot = arg => /^(\/|[a-zA-Z]:\\)$/.test(path.resolve(arg)) -const filterOutRoot = arg => { - const ok = preserveRoot === false || !isRoot(arg) - if (!ok) { - console.error(`refusing to remove ${arg}`) - console.error('Set --no-preserve-root to allow this') - } - return ok -} - -let help = false -let dashdash = false -let noglob = false -let preserveRoot = true -const args = process.argv.slice(2).filter(arg => { - if (dashdash) - return !!arg - else if (arg === '--') - dashdash = true - else if (arg === '--no-glob' || arg === '-G') - noglob = true - else if (arg === '--glob' || arg === '-g') - noglob = false - else if (arg.match(/^(-+|\/)(h(elp)?|\?)$/)) - help = true - else if (arg === '--preserve-root') - preserveRoot = true - else if (arg === '--no-preserve-root') - preserveRoot = false - else - return !!arg -}).filter(arg => !preserveRoot || filterOutRoot(arg)) - -const go = n => { - if (n >= args.length) - return - const options = noglob ? { glob: false } : {} - rimraf(args[n], options, er => { - if (er) - throw er - go(n+1) - }) -} - -if (help || args.length === 0) { - // If they didn't ask for help, then this is not a "success" - const log = help ? console.log : console.error - log('Usage: rimraf [ ...]') - log('') - log(' Deletes all files and folders at "path" recursively.') - log('') - log('Options:') - log('') - log(' -h, --help Display this usage info') - log(' -G, --no-glob Do not expand glob patterns in arguments') - log(' -g, --glob Expand glob patterns in arguments (default)') - log(' --preserve-root Do not remove \'/\' (default)') - log(' --no-preserve-root Do not treat \'/\' specially') - log(' -- Stop parsing flags') - process.exit(help ? 0 : 1) -} else - go(0) diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/rimraf/node_modules/brace-expansion/LICENSE b/packages/wyatt_notification_bloc/example/scripts/node_modules/rimraf/node_modules/brace-expansion/LICENSE deleted file mode 100644 index de322667..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/rimraf/node_modules/brace-expansion/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2013 Julian Gruber - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/rimraf/node_modules/brace-expansion/README.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/rimraf/node_modules/brace-expansion/README.md deleted file mode 100644 index 6b4e0e16..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/rimraf/node_modules/brace-expansion/README.md +++ /dev/null @@ -1,129 +0,0 @@ -# brace-expansion - -[Brace expansion](https://www.gnu.org/software/bash/manual/html_node/Brace-Expansion.html), -as known from sh/bash, in JavaScript. - -[![build status](https://secure.travis-ci.org/juliangruber/brace-expansion.svg)](http://travis-ci.org/juliangruber/brace-expansion) -[![downloads](https://img.shields.io/npm/dm/brace-expansion.svg)](https://www.npmjs.org/package/brace-expansion) -[![Greenkeeper badge](https://badges.greenkeeper.io/juliangruber/brace-expansion.svg)](https://greenkeeper.io/) - -[![testling badge](https://ci.testling.com/juliangruber/brace-expansion.png)](https://ci.testling.com/juliangruber/brace-expansion) - -## Example - -```js -var expand = require('brace-expansion'); - -expand('file-{a,b,c}.jpg') -// => ['file-a.jpg', 'file-b.jpg', 'file-c.jpg'] - -expand('-v{,,}') -// => ['-v', '-v', '-v'] - -expand('file{0..2}.jpg') -// => ['file0.jpg', 'file1.jpg', 'file2.jpg'] - -expand('file-{a..c}.jpg') -// => ['file-a.jpg', 'file-b.jpg', 'file-c.jpg'] - -expand('file{2..0}.jpg') -// => ['file2.jpg', 'file1.jpg', 'file0.jpg'] - -expand('file{0..4..2}.jpg') -// => ['file0.jpg', 'file2.jpg', 'file4.jpg'] - -expand('file-{a..e..2}.jpg') -// => ['file-a.jpg', 'file-c.jpg', 'file-e.jpg'] - -expand('file{00..10..5}.jpg') -// => ['file00.jpg', 'file05.jpg', 'file10.jpg'] - -expand('{{A..C},{a..c}}') -// => ['A', 'B', 'C', 'a', 'b', 'c'] - -expand('ppp{,config,oe{,conf}}') -// => ['ppp', 'pppconfig', 'pppoe', 'pppoeconf'] -``` - -## API - -```js -var expand = require('brace-expansion'); -``` - -### var expanded = expand(str) - -Return an array of all possible and valid expansions of `str`. If none are -found, `[str]` is returned. - -Valid expansions are: - -```js -/^(.*,)+(.+)?$/ -// {a,b,...} -``` - -A comma separated list of options, like `{a,b}` or `{a,{b,c}}` or `{,a,}`. - -```js -/^-?\d+\.\.-?\d+(\.\.-?\d+)?$/ -// {x..y[..incr]} -``` - -A numeric sequence from `x` to `y` inclusive, with optional increment. -If `x` or `y` start with a leading `0`, all the numbers will be padded -to have equal length. Negative numbers and backwards iteration work too. - -```js -/^-?\d+\.\.-?\d+(\.\.-?\d+)?$/ -// {x..y[..incr]} -``` - -An alphabetic sequence from `x` to `y` inclusive, with optional increment. -`x` and `y` must be exactly one character, and if given, `incr` must be a -number. - -For compatibility reasons, the string `${` is not eligible for brace expansion. - -## Installation - -With [npm](https://npmjs.org) do: - -```bash -npm install brace-expansion -``` - -## Contributors - -- [Julian Gruber](https://github.com/juliangruber) -- [Isaac Z. Schlueter](https://github.com/isaacs) - -## Sponsors - -This module is proudly supported by my [Sponsors](https://github.com/juliangruber/sponsors)! - -Do you want to support modules like this to improve their quality, stability and weigh in on new features? Then please consider donating to my [Patreon](https://www.patreon.com/juliangruber). Not sure how much of my modules you're using? Try [feross/thanks](https://github.com/feross/thanks)! - -## License - -(MIT) - -Copyright (c) 2013 Julian Gruber <julian@juliangruber.com> - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -of the Software, and to permit persons to whom the Software is furnished to do -so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/rimraf/node_modules/brace-expansion/index.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/rimraf/node_modules/brace-expansion/index.js deleted file mode 100644 index 0478be81..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/rimraf/node_modules/brace-expansion/index.js +++ /dev/null @@ -1,201 +0,0 @@ -var concatMap = require('concat-map'); -var balanced = require('balanced-match'); - -module.exports = expandTop; - -var escSlash = '\0SLASH'+Math.random()+'\0'; -var escOpen = '\0OPEN'+Math.random()+'\0'; -var escClose = '\0CLOSE'+Math.random()+'\0'; -var escComma = '\0COMMA'+Math.random()+'\0'; -var escPeriod = '\0PERIOD'+Math.random()+'\0'; - -function numeric(str) { - return parseInt(str, 10) == str - ? parseInt(str, 10) - : str.charCodeAt(0); -} - -function escapeBraces(str) { - return str.split('\\\\').join(escSlash) - .split('\\{').join(escOpen) - .split('\\}').join(escClose) - .split('\\,').join(escComma) - .split('\\.').join(escPeriod); -} - -function unescapeBraces(str) { - return str.split(escSlash).join('\\') - .split(escOpen).join('{') - .split(escClose).join('}') - .split(escComma).join(',') - .split(escPeriod).join('.'); -} - - -// Basically just str.split(","), but handling cases -// where we have nested braced sections, which should be -// treated as individual members, like {a,{b,c},d} -function parseCommaParts(str) { - if (!str) - return ['']; - - var parts = []; - var m = balanced('{', '}', str); - - if (!m) - return str.split(','); - - var pre = m.pre; - var body = m.body; - var post = m.post; - var p = pre.split(','); - - p[p.length-1] += '{' + body + '}'; - var postParts = parseCommaParts(post); - if (post.length) { - p[p.length-1] += postParts.shift(); - p.push.apply(p, postParts); - } - - parts.push.apply(parts, p); - - return parts; -} - -function expandTop(str) { - if (!str) - return []; - - // I don't know why Bash 4.3 does this, but it does. - // Anything starting with {} will have the first two bytes preserved - // but *only* at the top level, so {},a}b will not expand to anything, - // but a{},b}c will be expanded to [a}c,abc]. - // One could argue that this is a bug in Bash, but since the goal of - // this module is to match Bash's rules, we escape a leading {} - if (str.substr(0, 2) === '{}') { - str = '\\{\\}' + str.substr(2); - } - - return expand(escapeBraces(str), true).map(unescapeBraces); -} - -function identity(e) { - return e; -} - -function embrace(str) { - return '{' + str + '}'; -} -function isPadded(el) { - return /^-?0\d/.test(el); -} - -function lte(i, y) { - return i <= y; -} -function gte(i, y) { - return i >= y; -} - -function expand(str, isTop) { - var expansions = []; - - var m = balanced('{', '}', str); - if (!m || /\$$/.test(m.pre)) return [str]; - - var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body); - var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body); - var isSequence = isNumericSequence || isAlphaSequence; - var isOptions = m.body.indexOf(',') >= 0; - if (!isSequence && !isOptions) { - // {a},b} - if (m.post.match(/,.*\}/)) { - str = m.pre + '{' + m.body + escClose + m.post; - return expand(str); - } - return [str]; - } - - var n; - if (isSequence) { - n = m.body.split(/\.\./); - } else { - n = parseCommaParts(m.body); - if (n.length === 1) { - // x{{a,b}}y ==> x{a}y x{b}y - n = expand(n[0], false).map(embrace); - if (n.length === 1) { - var post = m.post.length - ? expand(m.post, false) - : ['']; - return post.map(function(p) { - return m.pre + n[0] + p; - }); - } - } - } - - // at this point, n is the parts, and we know it's not a comma set - // with a single entry. - - // no need to expand pre, since it is guaranteed to be free of brace-sets - var pre = m.pre; - var post = m.post.length - ? expand(m.post, false) - : ['']; - - var N; - - if (isSequence) { - var x = numeric(n[0]); - var y = numeric(n[1]); - var width = Math.max(n[0].length, n[1].length) - var incr = n.length == 3 - ? Math.abs(numeric(n[2])) - : 1; - var test = lte; - var reverse = y < x; - if (reverse) { - incr *= -1; - test = gte; - } - var pad = n.some(isPadded); - - N = []; - - for (var i = x; test(i, y); i += incr) { - var c; - if (isAlphaSequence) { - c = String.fromCharCode(i); - if (c === '\\') - c = ''; - } else { - c = String(i); - if (pad) { - var need = width - c.length; - if (need > 0) { - var z = new Array(need + 1).join('0'); - if (i < 0) - c = '-' + z + c.slice(1); - else - c = z + c; - } - } - } - N.push(c); - } - } else { - N = concatMap(n, function(el) { return expand(el, false) }); - } - - for (var j = 0; j < N.length; j++) { - for (var k = 0; k < post.length; k++) { - var expansion = pre + N[j] + post[k]; - if (!isTop || isSequence || expansion) - expansions.push(expansion); - } - } - - return expansions; -} - diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/rimraf/node_modules/brace-expansion/package.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/rimraf/node_modules/brace-expansion/package.json deleted file mode 100644 index a18faa8f..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/rimraf/node_modules/brace-expansion/package.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "name": "brace-expansion", - "description": "Brace expansion as known from sh/bash", - "version": "1.1.11", - "repository": { - "type": "git", - "url": "git://github.com/juliangruber/brace-expansion.git" - }, - "homepage": "https://github.com/juliangruber/brace-expansion", - "main": "index.js", - "scripts": { - "test": "tape test/*.js", - "gentest": "bash test/generate.sh", - "bench": "matcha test/perf/bench.js" - }, - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - }, - "devDependencies": { - "matcha": "^0.7.0", - "tape": "^4.6.0" - }, - "keywords": [], - "author": { - "name": "Julian Gruber", - "email": "mail@juliangruber.com", - "url": "http://juliangruber.com" - }, - "license": "MIT", - "testling": { - "files": "test/*.js", - "browsers": [ - "ie/8..latest", - "firefox/20..latest", - "firefox/nightly", - "chrome/25..latest", - "chrome/canary", - "opera/12..latest", - "opera/next", - "safari/5.1..latest", - "ipad/6.0..latest", - "iphone/6.0..latest", - "android-browser/4.2..latest" - ] - } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/rimraf/node_modules/glob/LICENSE b/packages/wyatt_notification_bloc/example/scripts/node_modules/rimraf/node_modules/glob/LICENSE deleted file mode 100644 index 42ca266d..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/rimraf/node_modules/glob/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The ISC License - -Copyright (c) Isaac Z. Schlueter and Contributors - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR -IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - -## Glob Logo - -Glob's logo created by Tanya Brassie , licensed -under a Creative Commons Attribution-ShareAlike 4.0 International License -https://creativecommons.org/licenses/by-sa/4.0/ diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/rimraf/node_modules/glob/README.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/rimraf/node_modules/glob/README.md deleted file mode 100644 index 83f0c83a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/rimraf/node_modules/glob/README.md +++ /dev/null @@ -1,378 +0,0 @@ -# Glob - -Match files using the patterns the shell uses, like stars and stuff. - -[![Build Status](https://travis-ci.org/isaacs/node-glob.svg?branch=master)](https://travis-ci.org/isaacs/node-glob/) [![Build Status](https://ci.appveyor.com/api/projects/status/kd7f3yftf7unxlsx?svg=true)](https://ci.appveyor.com/project/isaacs/node-glob) [![Coverage Status](https://coveralls.io/repos/isaacs/node-glob/badge.svg?branch=master&service=github)](https://coveralls.io/github/isaacs/node-glob?branch=master) - -This is a glob implementation in JavaScript. It uses the `minimatch` -library to do its matching. - -![a fun cartoon logo made of glob characters](logo/glob.png) - -## Usage - -Install with npm - -``` -npm i glob -``` - -```javascript -var glob = require("glob") - -// options is optional -glob("**/*.js", options, function (er, files) { - // files is an array of filenames. - // If the `nonull` option is set, and nothing - // was found, then files is ["**/*.js"] - // er is an error object or null. -}) -``` - -## Glob Primer - -"Globs" are the patterns you type when you do stuff like `ls *.js` on -the command line, or put `build/*` in a `.gitignore` file. - -Before parsing the path part patterns, braced sections are expanded -into a set. Braced sections start with `{` and end with `}`, with any -number of comma-delimited sections within. Braced sections may contain -slash characters, so `a{/b/c,bcd}` would expand into `a/b/c` and `abcd`. - -The following characters have special magic meaning when used in a -path portion: - -* `*` Matches 0 or more characters in a single path portion -* `?` Matches 1 character -* `[...]` Matches a range of characters, similar to a RegExp range. - If the first character of the range is `!` or `^` then it matches - any character not in the range. -* `!(pattern|pattern|pattern)` Matches anything that does not match - any of the patterns provided. -* `?(pattern|pattern|pattern)` Matches zero or one occurrence of the - patterns provided. -* `+(pattern|pattern|pattern)` Matches one or more occurrences of the - patterns provided. -* `*(a|b|c)` Matches zero or more occurrences of the patterns provided -* `@(pattern|pat*|pat?erN)` Matches exactly one of the patterns - provided -* `**` If a "globstar" is alone in a path portion, then it matches - zero or more directories and subdirectories searching for matches. - It does not crawl symlinked directories. - -### Dots - -If a file or directory path portion has a `.` as the first character, -then it will not match any glob pattern unless that pattern's -corresponding path part also has a `.` as its first character. - -For example, the pattern `a/.*/c` would match the file at `a/.b/c`. -However the pattern `a/*/c` would not, because `*` does not start with -a dot character. - -You can make glob treat dots as normal characters by setting -`dot:true` in the options. - -### Basename Matching - -If you set `matchBase:true` in the options, and the pattern has no -slashes in it, then it will seek for any file anywhere in the tree -with a matching basename. For example, `*.js` would match -`test/simple/basic.js`. - -### Empty Sets - -If no matching files are found, then an empty array is returned. This -differs from the shell, where the pattern itself is returned. For -example: - - $ echo a*s*d*f - a*s*d*f - -To get the bash-style behavior, set the `nonull:true` in the options. - -### See Also: - -* `man sh` -* `man bash` (Search for "Pattern Matching") -* `man 3 fnmatch` -* `man 5 gitignore` -* [minimatch documentation](https://github.com/isaacs/minimatch) - -## glob.hasMagic(pattern, [options]) - -Returns `true` if there are any special characters in the pattern, and -`false` otherwise. - -Note that the options affect the results. If `noext:true` is set in -the options object, then `+(a|b)` will not be considered a magic -pattern. If the pattern has a brace expansion, like `a/{b/c,x/y}` -then that is considered magical, unless `nobrace:true` is set in the -options. - -## glob(pattern, [options], cb) - -* `pattern` `{String}` Pattern to be matched -* `options` `{Object}` -* `cb` `{Function}` - * `err` `{Error | null}` - * `matches` `{Array}` filenames found matching the pattern - -Perform an asynchronous glob search. - -## glob.sync(pattern, [options]) - -* `pattern` `{String}` Pattern to be matched -* `options` `{Object}` -* return: `{Array}` filenames found matching the pattern - -Perform a synchronous glob search. - -## Class: glob.Glob - -Create a Glob object by instantiating the `glob.Glob` class. - -```javascript -var Glob = require("glob").Glob -var mg = new Glob(pattern, options, cb) -``` - -It's an EventEmitter, and starts walking the filesystem to find matches -immediately. - -### new glob.Glob(pattern, [options], [cb]) - -* `pattern` `{String}` pattern to search for -* `options` `{Object}` -* `cb` `{Function}` Called when an error occurs, or matches are found - * `err` `{Error | null}` - * `matches` `{Array}` filenames found matching the pattern - -Note that if the `sync` flag is set in the options, then matches will -be immediately available on the `g.found` member. - -### Properties - -* `minimatch` The minimatch object that the glob uses. -* `options` The options object passed in. -* `aborted` Boolean which is set to true when calling `abort()`. There - is no way at this time to continue a glob search after aborting, but - you can re-use the statCache to avoid having to duplicate syscalls. -* `cache` Convenience object. Each field has the following possible - values: - * `false` - Path does not exist - * `true` - Path exists - * `'FILE'` - Path exists, and is not a directory - * `'DIR'` - Path exists, and is a directory - * `[file, entries, ...]` - Path exists, is a directory, and the - array value is the results of `fs.readdir` -* `statCache` Cache of `fs.stat` results, to prevent statting the same - path multiple times. -* `symlinks` A record of which paths are symbolic links, which is - relevant in resolving `**` patterns. -* `realpathCache` An optional object which is passed to `fs.realpath` - to minimize unnecessary syscalls. It is stored on the instantiated - Glob object, and may be re-used. - -### Events - -* `end` When the matching is finished, this is emitted with all the - matches found. If the `nonull` option is set, and no match was found, - then the `matches` list contains the original pattern. The matches - are sorted, unless the `nosort` flag is set. -* `match` Every time a match is found, this is emitted with the specific - thing that matched. It is not deduplicated or resolved to a realpath. -* `error` Emitted when an unexpected error is encountered, or whenever - any fs error occurs if `options.strict` is set. -* `abort` When `abort()` is called, this event is raised. - -### Methods - -* `pause` Temporarily stop the search -* `resume` Resume the search -* `abort` Stop the search forever - -### Options - -All the options that can be passed to Minimatch can also be passed to -Glob to change pattern matching behavior. Also, some have been added, -or have glob-specific ramifications. - -All options are false by default, unless otherwise noted. - -All options are added to the Glob object, as well. - -If you are running many `glob` operations, you can pass a Glob object -as the `options` argument to a subsequent operation to shortcut some -`stat` and `readdir` calls. At the very least, you may pass in shared -`symlinks`, `statCache`, `realpathCache`, and `cache` options, so that -parallel glob operations will be sped up by sharing information about -the filesystem. - -* `cwd` The current working directory in which to search. Defaults - to `process.cwd()`. -* `root` The place where patterns starting with `/` will be mounted - onto. Defaults to `path.resolve(options.cwd, "/")` (`/` on Unix - systems, and `C:\` or some such on Windows.) -* `dot` Include `.dot` files in normal matches and `globstar` matches. - Note that an explicit dot in a portion of the pattern will always - match dot files. -* `nomount` By default, a pattern starting with a forward-slash will be - "mounted" onto the root setting, so that a valid filesystem path is - returned. Set this flag to disable that behavior. -* `mark` Add a `/` character to directory matches. Note that this - requires additional stat calls. -* `nosort` Don't sort the results. -* `stat` Set to true to stat *all* results. This reduces performance - somewhat, and is completely unnecessary, unless `readdir` is presumed - to be an untrustworthy indicator of file existence. -* `silent` When an unusual error is encountered when attempting to - read a directory, a warning will be printed to stderr. Set the - `silent` option to true to suppress these warnings. -* `strict` When an unusual error is encountered when attempting to - read a directory, the process will just continue on in search of - other matches. Set the `strict` option to raise an error in these - cases. -* `cache` See `cache` property above. Pass in a previously generated - cache object to save some fs calls. -* `statCache` A cache of results of filesystem information, to prevent - unnecessary stat calls. While it should not normally be necessary - to set this, you may pass the statCache from one glob() call to the - options object of another, if you know that the filesystem will not - change between calls. (See "Race Conditions" below.) -* `symlinks` A cache of known symbolic links. You may pass in a - previously generated `symlinks` object to save `lstat` calls when - resolving `**` matches. -* `sync` DEPRECATED: use `glob.sync(pattern, opts)` instead. -* `nounique` In some cases, brace-expanded patterns can result in the - same file showing up multiple times in the result set. By default, - this implementation prevents duplicates in the result set. Set this - flag to disable that behavior. -* `nonull` Set to never return an empty set, instead returning a set - containing the pattern itself. This is the default in glob(3). -* `debug` Set to enable debug logging in minimatch and glob. -* `nobrace` Do not expand `{a,b}` and `{1..3}` brace sets. -* `noglobstar` Do not match `**` against multiple filenames. (Ie, - treat it as a normal `*` instead.) -* `noext` Do not match `+(a|b)` "extglob" patterns. -* `nocase` Perform a case-insensitive match. Note: on - case-insensitive filesystems, non-magic patterns will match by - default, since `stat` and `readdir` will not raise errors. -* `matchBase` Perform a basename-only match if the pattern does not - contain any slash characters. That is, `*.js` would be treated as - equivalent to `**/*.js`, matching all js files in all directories. -* `nodir` Do not match directories, only files. (Note: to match - *only* directories, simply put a `/` at the end of the pattern.) -* `ignore` Add a pattern or an array of glob patterns to exclude matches. - Note: `ignore` patterns are *always* in `dot:true` mode, regardless - of any other settings. -* `follow` Follow symlinked directories when expanding `**` patterns. - Note that this can result in a lot of duplicate references in the - presence of cyclic links. -* `realpath` Set to true to call `fs.realpath` on all of the results. - In the case of a symlink that cannot be resolved, the full absolute - path to the matched entry is returned (though it will usually be a - broken symlink) -* `absolute` Set to true to always receive absolute paths for matched - files. Unlike `realpath`, this also affects the values returned in - the `match` event. -* `fs` File-system object with Node's `fs` API. By default, the built-in - `fs` module will be used. Set to a volume provided by a library like - `memfs` to avoid using the "real" file-system. - -## Comparisons to other fnmatch/glob implementations - -While strict compliance with the existing standards is a worthwhile -goal, some discrepancies exist between node-glob and other -implementations, and are intentional. - -The double-star character `**` is supported by default, unless the -`noglobstar` flag is set. This is supported in the manner of bsdglob -and bash 4.3, where `**` only has special significance if it is the only -thing in a path part. That is, `a/**/b` will match `a/x/y/b`, but -`a/**b` will not. - -Note that symlinked directories are not crawled as part of a `**`, -though their contents may match against subsequent portions of the -pattern. This prevents infinite loops and duplicates and the like. - -If an escaped pattern has no matches, and the `nonull` flag is set, -then glob returns the pattern as-provided, rather than -interpreting the character escapes. For example, -`glob.match([], "\\*a\\?")` will return `"\\*a\\?"` rather than -`"*a?"`. This is akin to setting the `nullglob` option in bash, except -that it does not resolve escaped pattern characters. - -If brace expansion is not disabled, then it is performed before any -other interpretation of the glob pattern. Thus, a pattern like -`+(a|{b),c)}`, which would not be valid in bash or zsh, is expanded -**first** into the set of `+(a|b)` and `+(a|c)`, and those patterns are -checked for validity. Since those two are valid, matching proceeds. - -### Comments and Negation - -Previously, this module let you mark a pattern as a "comment" if it -started with a `#` character, or a "negated" pattern if it started -with a `!` character. - -These options were deprecated in version 5, and removed in version 6. - -To specify things that should not match, use the `ignore` option. - -## Windows - -**Please only use forward-slashes in glob expressions.** - -Though windows uses either `/` or `\` as its path separator, only `/` -characters are used by this glob implementation. You must use -forward-slashes **only** in glob expressions. Back-slashes will always -be interpreted as escape characters, not path separators. - -Results from absolute patterns such as `/foo/*` are mounted onto the -root setting using `path.join`. On windows, this will by default result -in `/foo/*` matching `C:\foo\bar.txt`. - -## Race Conditions - -Glob searching, by its very nature, is susceptible to race conditions, -since it relies on directory walking and such. - -As a result, it is possible that a file that exists when glob looks for -it may have been deleted or modified by the time it returns the result. - -As part of its internal implementation, this program caches all stat -and readdir calls that it makes, in order to cut down on system -overhead. However, this also makes it even more susceptible to races, -especially if the cache or statCache objects are reused between glob -calls. - -Users are thus advised not to use a glob result as a guarantee of -filesystem state in the face of rapid changes. For the vast majority -of operations, this is never a problem. - -## Glob Logo -Glob's logo was created by [Tanya Brassie](http://tanyabrassie.com/). Logo files can be found [here](https://github.com/isaacs/node-glob/tree/master/logo). - -The logo is licensed under a [Creative Commons Attribution-ShareAlike 4.0 International License](https://creativecommons.org/licenses/by-sa/4.0/). - -## Contributing - -Any change to behavior (including bugfixes) must come with a test. - -Patches that fail tests or reduce performance will be rejected. - -``` -# to run tests -npm test - -# to re-generate test fixtures -npm run test-regen - -# to benchmark against bash/zsh -npm run bench - -# to profile javascript -npm run prof -``` - -![](oh-my-glob.gif) diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/rimraf/node_modules/glob/common.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/rimraf/node_modules/glob/common.js deleted file mode 100644 index 424c46e1..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/rimraf/node_modules/glob/common.js +++ /dev/null @@ -1,238 +0,0 @@ -exports.setopts = setopts -exports.ownProp = ownProp -exports.makeAbs = makeAbs -exports.finish = finish -exports.mark = mark -exports.isIgnored = isIgnored -exports.childrenIgnored = childrenIgnored - -function ownProp (obj, field) { - return Object.prototype.hasOwnProperty.call(obj, field) -} - -var fs = require("fs") -var path = require("path") -var minimatch = require("minimatch") -var isAbsolute = require("path-is-absolute") -var Minimatch = minimatch.Minimatch - -function alphasort (a, b) { - return a.localeCompare(b, 'en') -} - -function setupIgnores (self, options) { - self.ignore = options.ignore || [] - - if (!Array.isArray(self.ignore)) - self.ignore = [self.ignore] - - if (self.ignore.length) { - self.ignore = self.ignore.map(ignoreMap) - } -} - -// ignore patterns are always in dot:true mode. -function ignoreMap (pattern) { - var gmatcher = null - if (pattern.slice(-3) === '/**') { - var gpattern = pattern.replace(/(\/\*\*)+$/, '') - gmatcher = new Minimatch(gpattern, { dot: true }) - } - - return { - matcher: new Minimatch(pattern, { dot: true }), - gmatcher: gmatcher - } -} - -function setopts (self, pattern, options) { - if (!options) - options = {} - - // base-matching: just use globstar for that. - if (options.matchBase && -1 === pattern.indexOf("/")) { - if (options.noglobstar) { - throw new Error("base matching requires globstar") - } - pattern = "**/" + pattern - } - - self.silent = !!options.silent - self.pattern = pattern - self.strict = options.strict !== false - self.realpath = !!options.realpath - self.realpathCache = options.realpathCache || Object.create(null) - self.follow = !!options.follow - self.dot = !!options.dot - self.mark = !!options.mark - self.nodir = !!options.nodir - if (self.nodir) - self.mark = true - self.sync = !!options.sync - self.nounique = !!options.nounique - self.nonull = !!options.nonull - self.nosort = !!options.nosort - self.nocase = !!options.nocase - self.stat = !!options.stat - self.noprocess = !!options.noprocess - self.absolute = !!options.absolute - self.fs = options.fs || fs - - self.maxLength = options.maxLength || Infinity - self.cache = options.cache || Object.create(null) - self.statCache = options.statCache || Object.create(null) - self.symlinks = options.symlinks || Object.create(null) - - setupIgnores(self, options) - - self.changedCwd = false - var cwd = process.cwd() - if (!ownProp(options, "cwd")) - self.cwd = cwd - else { - self.cwd = path.resolve(options.cwd) - self.changedCwd = self.cwd !== cwd - } - - self.root = options.root || path.resolve(self.cwd, "/") - self.root = path.resolve(self.root) - if (process.platform === "win32") - self.root = self.root.replace(/\\/g, "/") - - // TODO: is an absolute `cwd` supposed to be resolved against `root`? - // e.g. { cwd: '/test', root: __dirname } === path.join(__dirname, '/test') - self.cwdAbs = isAbsolute(self.cwd) ? self.cwd : makeAbs(self, self.cwd) - if (process.platform === "win32") - self.cwdAbs = self.cwdAbs.replace(/\\/g, "/") - self.nomount = !!options.nomount - - // disable comments and negation in Minimatch. - // Note that they are not supported in Glob itself anyway. - options.nonegate = true - options.nocomment = true - // always treat \ in patterns as escapes, not path separators - options.allowWindowsEscape = false - - self.minimatch = new Minimatch(pattern, options) - self.options = self.minimatch.options -} - -function finish (self) { - var nou = self.nounique - var all = nou ? [] : Object.create(null) - - for (var i = 0, l = self.matches.length; i < l; i ++) { - var matches = self.matches[i] - if (!matches || Object.keys(matches).length === 0) { - if (self.nonull) { - // do like the shell, and spit out the literal glob - var literal = self.minimatch.globSet[i] - if (nou) - all.push(literal) - else - all[literal] = true - } - } else { - // had matches - var m = Object.keys(matches) - if (nou) - all.push.apply(all, m) - else - m.forEach(function (m) { - all[m] = true - }) - } - } - - if (!nou) - all = Object.keys(all) - - if (!self.nosort) - all = all.sort(alphasort) - - // at *some* point we statted all of these - if (self.mark) { - for (var i = 0; i < all.length; i++) { - all[i] = self._mark(all[i]) - } - if (self.nodir) { - all = all.filter(function (e) { - var notDir = !(/\/$/.test(e)) - var c = self.cache[e] || self.cache[makeAbs(self, e)] - if (notDir && c) - notDir = c !== 'DIR' && !Array.isArray(c) - return notDir - }) - } - } - - if (self.ignore.length) - all = all.filter(function(m) { - return !isIgnored(self, m) - }) - - self.found = all -} - -function mark (self, p) { - var abs = makeAbs(self, p) - var c = self.cache[abs] - var m = p - if (c) { - var isDir = c === 'DIR' || Array.isArray(c) - var slash = p.slice(-1) === '/' - - if (isDir && !slash) - m += '/' - else if (!isDir && slash) - m = m.slice(0, -1) - - if (m !== p) { - var mabs = makeAbs(self, m) - self.statCache[mabs] = self.statCache[abs] - self.cache[mabs] = self.cache[abs] - } - } - - return m -} - -// lotta situps... -function makeAbs (self, f) { - var abs = f - if (f.charAt(0) === '/') { - abs = path.join(self.root, f) - } else if (isAbsolute(f) || f === '') { - abs = f - } else if (self.changedCwd) { - abs = path.resolve(self.cwd, f) - } else { - abs = path.resolve(f) - } - - if (process.platform === 'win32') - abs = abs.replace(/\\/g, '/') - - return abs -} - - -// Return true, if pattern ends with globstar '**', for the accompanying parent directory. -// Ex:- If node_modules/** is the pattern, add 'node_modules' to ignore list along with it's contents -function isIgnored (self, path) { - if (!self.ignore.length) - return false - - return self.ignore.some(function(item) { - return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path)) - }) -} - -function childrenIgnored (self, path) { - if (!self.ignore.length) - return false - - return self.ignore.some(function(item) { - return !!(item.gmatcher && item.gmatcher.match(path)) - }) -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/rimraf/node_modules/glob/glob.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/rimraf/node_modules/glob/glob.js deleted file mode 100644 index 37a4d7e6..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/rimraf/node_modules/glob/glob.js +++ /dev/null @@ -1,790 +0,0 @@ -// Approach: -// -// 1. Get the minimatch set -// 2. For each pattern in the set, PROCESS(pattern, false) -// 3. Store matches per-set, then uniq them -// -// PROCESS(pattern, inGlobStar) -// Get the first [n] items from pattern that are all strings -// Join these together. This is PREFIX. -// If there is no more remaining, then stat(PREFIX) and -// add to matches if it succeeds. END. -// -// If inGlobStar and PREFIX is symlink and points to dir -// set ENTRIES = [] -// else readdir(PREFIX) as ENTRIES -// If fail, END -// -// with ENTRIES -// If pattern[n] is GLOBSTAR -// // handle the case where the globstar match is empty -// // by pruning it out, and testing the resulting pattern -// PROCESS(pattern[0..n] + pattern[n+1 .. $], false) -// // handle other cases. -// for ENTRY in ENTRIES (not dotfiles) -// // attach globstar + tail onto the entry -// // Mark that this entry is a globstar match -// PROCESS(pattern[0..n] + ENTRY + pattern[n .. $], true) -// -// else // not globstar -// for ENTRY in ENTRIES (not dotfiles, unless pattern[n] is dot) -// Test ENTRY against pattern[n] -// If fails, continue -// If passes, PROCESS(pattern[0..n] + item + pattern[n+1 .. $]) -// -// Caveat: -// Cache all stats and readdirs results to minimize syscall. Since all -// we ever care about is existence and directory-ness, we can just keep -// `true` for files, and [children,...] for directories, or `false` for -// things that don't exist. - -module.exports = glob - -var rp = require('fs.realpath') -var minimatch = require('minimatch') -var Minimatch = minimatch.Minimatch -var inherits = require('inherits') -var EE = require('events').EventEmitter -var path = require('path') -var assert = require('assert') -var isAbsolute = require('path-is-absolute') -var globSync = require('./sync.js') -var common = require('./common.js') -var setopts = common.setopts -var ownProp = common.ownProp -var inflight = require('inflight') -var util = require('util') -var childrenIgnored = common.childrenIgnored -var isIgnored = common.isIgnored - -var once = require('once') - -function glob (pattern, options, cb) { - if (typeof options === 'function') cb = options, options = {} - if (!options) options = {} - - if (options.sync) { - if (cb) - throw new TypeError('callback provided to sync glob') - return globSync(pattern, options) - } - - return new Glob(pattern, options, cb) -} - -glob.sync = globSync -var GlobSync = glob.GlobSync = globSync.GlobSync - -// old api surface -glob.glob = glob - -function extend (origin, add) { - if (add === null || typeof add !== 'object') { - return origin - } - - var keys = Object.keys(add) - var i = keys.length - while (i--) { - origin[keys[i]] = add[keys[i]] - } - return origin -} - -glob.hasMagic = function (pattern, options_) { - var options = extend({}, options_) - options.noprocess = true - - var g = new Glob(pattern, options) - var set = g.minimatch.set - - if (!pattern) - return false - - if (set.length > 1) - return true - - for (var j = 0; j < set[0].length; j++) { - if (typeof set[0][j] !== 'string') - return true - } - - return false -} - -glob.Glob = Glob -inherits(Glob, EE) -function Glob (pattern, options, cb) { - if (typeof options === 'function') { - cb = options - options = null - } - - if (options && options.sync) { - if (cb) - throw new TypeError('callback provided to sync glob') - return new GlobSync(pattern, options) - } - - if (!(this instanceof Glob)) - return new Glob(pattern, options, cb) - - setopts(this, pattern, options) - this._didRealPath = false - - // process each pattern in the minimatch set - var n = this.minimatch.set.length - - // The matches are stored as {: true,...} so that - // duplicates are automagically pruned. - // Later, we do an Object.keys() on these. - // Keep them as a list so we can fill in when nonull is set. - this.matches = new Array(n) - - if (typeof cb === 'function') { - cb = once(cb) - this.on('error', cb) - this.on('end', function (matches) { - cb(null, matches) - }) - } - - var self = this - this._processing = 0 - - this._emitQueue = [] - this._processQueue = [] - this.paused = false - - if (this.noprocess) - return this - - if (n === 0) - return done() - - var sync = true - for (var i = 0; i < n; i ++) { - this._process(this.minimatch.set[i], i, false, done) - } - sync = false - - function done () { - --self._processing - if (self._processing <= 0) { - if (sync) { - process.nextTick(function () { - self._finish() - }) - } else { - self._finish() - } - } - } -} - -Glob.prototype._finish = function () { - assert(this instanceof Glob) - if (this.aborted) - return - - if (this.realpath && !this._didRealpath) - return this._realpath() - - common.finish(this) - this.emit('end', this.found) -} - -Glob.prototype._realpath = function () { - if (this._didRealpath) - return - - this._didRealpath = true - - var n = this.matches.length - if (n === 0) - return this._finish() - - var self = this - for (var i = 0; i < this.matches.length; i++) - this._realpathSet(i, next) - - function next () { - if (--n === 0) - self._finish() - } -} - -Glob.prototype._realpathSet = function (index, cb) { - var matchset = this.matches[index] - if (!matchset) - return cb() - - var found = Object.keys(matchset) - var self = this - var n = found.length - - if (n === 0) - return cb() - - var set = this.matches[index] = Object.create(null) - found.forEach(function (p, i) { - // If there's a problem with the stat, then it means that - // one or more of the links in the realpath couldn't be - // resolved. just return the abs value in that case. - p = self._makeAbs(p) - rp.realpath(p, self.realpathCache, function (er, real) { - if (!er) - set[real] = true - else if (er.syscall === 'stat') - set[p] = true - else - self.emit('error', er) // srsly wtf right here - - if (--n === 0) { - self.matches[index] = set - cb() - } - }) - }) -} - -Glob.prototype._mark = function (p) { - return common.mark(this, p) -} - -Glob.prototype._makeAbs = function (f) { - return common.makeAbs(this, f) -} - -Glob.prototype.abort = function () { - this.aborted = true - this.emit('abort') -} - -Glob.prototype.pause = function () { - if (!this.paused) { - this.paused = true - this.emit('pause') - } -} - -Glob.prototype.resume = function () { - if (this.paused) { - this.emit('resume') - this.paused = false - if (this._emitQueue.length) { - var eq = this._emitQueue.slice(0) - this._emitQueue.length = 0 - for (var i = 0; i < eq.length; i ++) { - var e = eq[i] - this._emitMatch(e[0], e[1]) - } - } - if (this._processQueue.length) { - var pq = this._processQueue.slice(0) - this._processQueue.length = 0 - for (var i = 0; i < pq.length; i ++) { - var p = pq[i] - this._processing-- - this._process(p[0], p[1], p[2], p[3]) - } - } - } -} - -Glob.prototype._process = function (pattern, index, inGlobStar, cb) { - assert(this instanceof Glob) - assert(typeof cb === 'function') - - if (this.aborted) - return - - this._processing++ - if (this.paused) { - this._processQueue.push([pattern, index, inGlobStar, cb]) - return - } - - //console.error('PROCESS %d', this._processing, pattern) - - // Get the first [n] parts of pattern that are all strings. - var n = 0 - while (typeof pattern[n] === 'string') { - n ++ - } - // now n is the index of the first one that is *not* a string. - - // see if there's anything else - var prefix - switch (n) { - // if not, then this is rather simple - case pattern.length: - this._processSimple(pattern.join('/'), index, cb) - return - - case 0: - // pattern *starts* with some non-trivial item. - // going to readdir(cwd), but not include the prefix in matches. - prefix = null - break - - default: - // pattern has some string bits in the front. - // whatever it starts with, whether that's 'absolute' like /foo/bar, - // or 'relative' like '../baz' - prefix = pattern.slice(0, n).join('/') - break - } - - var remain = pattern.slice(n) - - // get the list of entries. - var read - if (prefix === null) - read = '.' - else if (isAbsolute(prefix) || - isAbsolute(pattern.map(function (p) { - return typeof p === 'string' ? p : '[*]' - }).join('/'))) { - if (!prefix || !isAbsolute(prefix)) - prefix = '/' + prefix - read = prefix - } else - read = prefix - - var abs = this._makeAbs(read) - - //if ignored, skip _processing - if (childrenIgnored(this, read)) - return cb() - - var isGlobStar = remain[0] === minimatch.GLOBSTAR - if (isGlobStar) - this._processGlobStar(prefix, read, abs, remain, index, inGlobStar, cb) - else - this._processReaddir(prefix, read, abs, remain, index, inGlobStar, cb) -} - -Glob.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar, cb) { - var self = this - this._readdir(abs, inGlobStar, function (er, entries) { - return self._processReaddir2(prefix, read, abs, remain, index, inGlobStar, entries, cb) - }) -} - -Glob.prototype._processReaddir2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) { - - // if the abs isn't a dir, then nothing can match! - if (!entries) - return cb() - - // It will only match dot entries if it starts with a dot, or if - // dot is set. Stuff like @(.foo|.bar) isn't allowed. - var pn = remain[0] - var negate = !!this.minimatch.negate - var rawGlob = pn._glob - var dotOk = this.dot || rawGlob.charAt(0) === '.' - - var matchedEntries = [] - for (var i = 0; i < entries.length; i++) { - var e = entries[i] - if (e.charAt(0) !== '.' || dotOk) { - var m - if (negate && !prefix) { - m = !e.match(pn) - } else { - m = e.match(pn) - } - if (m) - matchedEntries.push(e) - } - } - - //console.error('prd2', prefix, entries, remain[0]._glob, matchedEntries) - - var len = matchedEntries.length - // If there are no matched entries, then nothing matches. - if (len === 0) - return cb() - - // if this is the last remaining pattern bit, then no need for - // an additional stat *unless* the user has specified mark or - // stat explicitly. We know they exist, since readdir returned - // them. - - if (remain.length === 1 && !this.mark && !this.stat) { - if (!this.matches[index]) - this.matches[index] = Object.create(null) - - for (var i = 0; i < len; i ++) { - var e = matchedEntries[i] - if (prefix) { - if (prefix !== '/') - e = prefix + '/' + e - else - e = prefix + e - } - - if (e.charAt(0) === '/' && !this.nomount) { - e = path.join(this.root, e) - } - this._emitMatch(index, e) - } - // This was the last one, and no stats were needed - return cb() - } - - // now test all matched entries as stand-ins for that part - // of the pattern. - remain.shift() - for (var i = 0; i < len; i ++) { - var e = matchedEntries[i] - var newPattern - if (prefix) { - if (prefix !== '/') - e = prefix + '/' + e - else - e = prefix + e - } - this._process([e].concat(remain), index, inGlobStar, cb) - } - cb() -} - -Glob.prototype._emitMatch = function (index, e) { - if (this.aborted) - return - - if (isIgnored(this, e)) - return - - if (this.paused) { - this._emitQueue.push([index, e]) - return - } - - var abs = isAbsolute(e) ? e : this._makeAbs(e) - - if (this.mark) - e = this._mark(e) - - if (this.absolute) - e = abs - - if (this.matches[index][e]) - return - - if (this.nodir) { - var c = this.cache[abs] - if (c === 'DIR' || Array.isArray(c)) - return - } - - this.matches[index][e] = true - - var st = this.statCache[abs] - if (st) - this.emit('stat', e, st) - - this.emit('match', e) -} - -Glob.prototype._readdirInGlobStar = function (abs, cb) { - if (this.aborted) - return - - // follow all symlinked directories forever - // just proceed as if this is a non-globstar situation - if (this.follow) - return this._readdir(abs, false, cb) - - var lstatkey = 'lstat\0' + abs - var self = this - var lstatcb = inflight(lstatkey, lstatcb_) - - if (lstatcb) - self.fs.lstat(abs, lstatcb) - - function lstatcb_ (er, lstat) { - if (er && er.code === 'ENOENT') - return cb() - - var isSym = lstat && lstat.isSymbolicLink() - self.symlinks[abs] = isSym - - // If it's not a symlink or a dir, then it's definitely a regular file. - // don't bother doing a readdir in that case. - if (!isSym && lstat && !lstat.isDirectory()) { - self.cache[abs] = 'FILE' - cb() - } else - self._readdir(abs, false, cb) - } -} - -Glob.prototype._readdir = function (abs, inGlobStar, cb) { - if (this.aborted) - return - - cb = inflight('readdir\0'+abs+'\0'+inGlobStar, cb) - if (!cb) - return - - //console.error('RD %j %j', +inGlobStar, abs) - if (inGlobStar && !ownProp(this.symlinks, abs)) - return this._readdirInGlobStar(abs, cb) - - if (ownProp(this.cache, abs)) { - var c = this.cache[abs] - if (!c || c === 'FILE') - return cb() - - if (Array.isArray(c)) - return cb(null, c) - } - - var self = this - self.fs.readdir(abs, readdirCb(this, abs, cb)) -} - -function readdirCb (self, abs, cb) { - return function (er, entries) { - if (er) - self._readdirError(abs, er, cb) - else - self._readdirEntries(abs, entries, cb) - } -} - -Glob.prototype._readdirEntries = function (abs, entries, cb) { - if (this.aborted) - return - - // if we haven't asked to stat everything, then just - // assume that everything in there exists, so we can avoid - // having to stat it a second time. - if (!this.mark && !this.stat) { - for (var i = 0; i < entries.length; i ++) { - var e = entries[i] - if (abs === '/') - e = abs + e - else - e = abs + '/' + e - this.cache[e] = true - } - } - - this.cache[abs] = entries - return cb(null, entries) -} - -Glob.prototype._readdirError = function (f, er, cb) { - if (this.aborted) - return - - // handle errors, and cache the information - switch (er.code) { - case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205 - case 'ENOTDIR': // totally normal. means it *does* exist. - var abs = this._makeAbs(f) - this.cache[abs] = 'FILE' - if (abs === this.cwdAbs) { - var error = new Error(er.code + ' invalid cwd ' + this.cwd) - error.path = this.cwd - error.code = er.code - this.emit('error', error) - this.abort() - } - break - - case 'ENOENT': // not terribly unusual - case 'ELOOP': - case 'ENAMETOOLONG': - case 'UNKNOWN': - this.cache[this._makeAbs(f)] = false - break - - default: // some unusual error. Treat as failure. - this.cache[this._makeAbs(f)] = false - if (this.strict) { - this.emit('error', er) - // If the error is handled, then we abort - // if not, we threw out of here - this.abort() - } - if (!this.silent) - console.error('glob error', er) - break - } - - return cb() -} - -Glob.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar, cb) { - var self = this - this._readdir(abs, inGlobStar, function (er, entries) { - self._processGlobStar2(prefix, read, abs, remain, index, inGlobStar, entries, cb) - }) -} - - -Glob.prototype._processGlobStar2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) { - //console.error('pgs2', prefix, remain[0], entries) - - // no entries means not a dir, so it can never have matches - // foo.txt/** doesn't match foo.txt - if (!entries) - return cb() - - // test without the globstar, and with every child both below - // and replacing the globstar. - var remainWithoutGlobStar = remain.slice(1) - var gspref = prefix ? [ prefix ] : [] - var noGlobStar = gspref.concat(remainWithoutGlobStar) - - // the noGlobStar pattern exits the inGlobStar state - this._process(noGlobStar, index, false, cb) - - var isSym = this.symlinks[abs] - var len = entries.length - - // If it's a symlink, and we're in a globstar, then stop - if (isSym && inGlobStar) - return cb() - - for (var i = 0; i < len; i++) { - var e = entries[i] - if (e.charAt(0) === '.' && !this.dot) - continue - - // these two cases enter the inGlobStar state - var instead = gspref.concat(entries[i], remainWithoutGlobStar) - this._process(instead, index, true, cb) - - var below = gspref.concat(entries[i], remain) - this._process(below, index, true, cb) - } - - cb() -} - -Glob.prototype._processSimple = function (prefix, index, cb) { - // XXX review this. Shouldn't it be doing the mounting etc - // before doing stat? kinda weird? - var self = this - this._stat(prefix, function (er, exists) { - self._processSimple2(prefix, index, er, exists, cb) - }) -} -Glob.prototype._processSimple2 = function (prefix, index, er, exists, cb) { - - //console.error('ps2', prefix, exists) - - if (!this.matches[index]) - this.matches[index] = Object.create(null) - - // If it doesn't exist, then just mark the lack of results - if (!exists) - return cb() - - if (prefix && isAbsolute(prefix) && !this.nomount) { - var trail = /[\/\\]$/.test(prefix) - if (prefix.charAt(0) === '/') { - prefix = path.join(this.root, prefix) - } else { - prefix = path.resolve(this.root, prefix) - if (trail) - prefix += '/' - } - } - - if (process.platform === 'win32') - prefix = prefix.replace(/\\/g, '/') - - // Mark this as a match - this._emitMatch(index, prefix) - cb() -} - -// Returns either 'DIR', 'FILE', or false -Glob.prototype._stat = function (f, cb) { - var abs = this._makeAbs(f) - var needDir = f.slice(-1) === '/' - - if (f.length > this.maxLength) - return cb() - - if (!this.stat && ownProp(this.cache, abs)) { - var c = this.cache[abs] - - if (Array.isArray(c)) - c = 'DIR' - - // It exists, but maybe not how we need it - if (!needDir || c === 'DIR') - return cb(null, c) - - if (needDir && c === 'FILE') - return cb() - - // otherwise we have to stat, because maybe c=true - // if we know it exists, but not what it is. - } - - var exists - var stat = this.statCache[abs] - if (stat !== undefined) { - if (stat === false) - return cb(null, stat) - else { - var type = stat.isDirectory() ? 'DIR' : 'FILE' - if (needDir && type === 'FILE') - return cb() - else - return cb(null, type, stat) - } - } - - var self = this - var statcb = inflight('stat\0' + abs, lstatcb_) - if (statcb) - self.fs.lstat(abs, statcb) - - function lstatcb_ (er, lstat) { - if (lstat && lstat.isSymbolicLink()) { - // If it's a symlink, then treat it as the target, unless - // the target does not exist, then treat it as a file. - return self.fs.stat(abs, function (er, stat) { - if (er) - self._stat2(f, abs, null, lstat, cb) - else - self._stat2(f, abs, er, stat, cb) - }) - } else { - self._stat2(f, abs, er, lstat, cb) - } - } -} - -Glob.prototype._stat2 = function (f, abs, er, stat, cb) { - if (er && (er.code === 'ENOENT' || er.code === 'ENOTDIR')) { - this.statCache[abs] = false - return cb() - } - - var needDir = f.slice(-1) === '/' - this.statCache[abs] = stat - - if (abs.slice(-1) === '/' && stat && !stat.isDirectory()) - return cb(null, false, stat) - - var c = true - if (stat) - c = stat.isDirectory() ? 'DIR' : 'FILE' - this.cache[abs] = this.cache[abs] || c - - if (needDir && c === 'FILE') - return cb() - - return cb(null, c, stat) -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/rimraf/node_modules/glob/package.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/rimraf/node_modules/glob/package.json deleted file mode 100644 index 5940b649..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/rimraf/node_modules/glob/package.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "author": "Isaac Z. Schlueter (http://blog.izs.me/)", - "name": "glob", - "description": "a little globber", - "version": "7.2.3", - "publishConfig": { - "tag": "v7-legacy" - }, - "repository": { - "type": "git", - "url": "git://github.com/isaacs/node-glob.git" - }, - "main": "glob.js", - "files": [ - "glob.js", - "sync.js", - "common.js" - ], - "engines": { - "node": "*" - }, - "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.1.1", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - }, - "devDependencies": { - "memfs": "^3.2.0", - "mkdirp": "0", - "rimraf": "^2.2.8", - "tap": "^15.0.6", - "tick": "0.0.6" - }, - "tap": { - "before": "test/00-setup.js", - "after": "test/zz-cleanup.js", - "jobs": 1 - }, - "scripts": { - "prepublish": "npm run benchclean", - "profclean": "rm -f v8.log profile.txt", - "test": "tap", - "test-regen": "npm run profclean && TEST_REGEN=1 node test/00-setup.js", - "bench": "bash benchmark.sh", - "prof": "bash prof.sh && cat profile.txt", - "benchclean": "node benchclean.js" - }, - "license": "ISC", - "funding": { - "url": "https://github.com/sponsors/isaacs" - } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/rimraf/node_modules/glob/sync.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/rimraf/node_modules/glob/sync.js deleted file mode 100644 index 2c4f4801..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/rimraf/node_modules/glob/sync.js +++ /dev/null @@ -1,486 +0,0 @@ -module.exports = globSync -globSync.GlobSync = GlobSync - -var rp = require('fs.realpath') -var minimatch = require('minimatch') -var Minimatch = minimatch.Minimatch -var Glob = require('./glob.js').Glob -var util = require('util') -var path = require('path') -var assert = require('assert') -var isAbsolute = require('path-is-absolute') -var common = require('./common.js') -var setopts = common.setopts -var ownProp = common.ownProp -var childrenIgnored = common.childrenIgnored -var isIgnored = common.isIgnored - -function globSync (pattern, options) { - if (typeof options === 'function' || arguments.length === 3) - throw new TypeError('callback provided to sync glob\n'+ - 'See: https://github.com/isaacs/node-glob/issues/167') - - return new GlobSync(pattern, options).found -} - -function GlobSync (pattern, options) { - if (!pattern) - throw new Error('must provide pattern') - - if (typeof options === 'function' || arguments.length === 3) - throw new TypeError('callback provided to sync glob\n'+ - 'See: https://github.com/isaacs/node-glob/issues/167') - - if (!(this instanceof GlobSync)) - return new GlobSync(pattern, options) - - setopts(this, pattern, options) - - if (this.noprocess) - return this - - var n = this.minimatch.set.length - this.matches = new Array(n) - for (var i = 0; i < n; i ++) { - this._process(this.minimatch.set[i], i, false) - } - this._finish() -} - -GlobSync.prototype._finish = function () { - assert.ok(this instanceof GlobSync) - if (this.realpath) { - var self = this - this.matches.forEach(function (matchset, index) { - var set = self.matches[index] = Object.create(null) - for (var p in matchset) { - try { - p = self._makeAbs(p) - var real = rp.realpathSync(p, self.realpathCache) - set[real] = true - } catch (er) { - if (er.syscall === 'stat') - set[self._makeAbs(p)] = true - else - throw er - } - } - }) - } - common.finish(this) -} - - -GlobSync.prototype._process = function (pattern, index, inGlobStar) { - assert.ok(this instanceof GlobSync) - - // Get the first [n] parts of pattern that are all strings. - var n = 0 - while (typeof pattern[n] === 'string') { - n ++ - } - // now n is the index of the first one that is *not* a string. - - // See if there's anything else - var prefix - switch (n) { - // if not, then this is rather simple - case pattern.length: - this._processSimple(pattern.join('/'), index) - return - - case 0: - // pattern *starts* with some non-trivial item. - // going to readdir(cwd), but not include the prefix in matches. - prefix = null - break - - default: - // pattern has some string bits in the front. - // whatever it starts with, whether that's 'absolute' like /foo/bar, - // or 'relative' like '../baz' - prefix = pattern.slice(0, n).join('/') - break - } - - var remain = pattern.slice(n) - - // get the list of entries. - var read - if (prefix === null) - read = '.' - else if (isAbsolute(prefix) || - isAbsolute(pattern.map(function (p) { - return typeof p === 'string' ? p : '[*]' - }).join('/'))) { - if (!prefix || !isAbsolute(prefix)) - prefix = '/' + prefix - read = prefix - } else - read = prefix - - var abs = this._makeAbs(read) - - //if ignored, skip processing - if (childrenIgnored(this, read)) - return - - var isGlobStar = remain[0] === minimatch.GLOBSTAR - if (isGlobStar) - this._processGlobStar(prefix, read, abs, remain, index, inGlobStar) - else - this._processReaddir(prefix, read, abs, remain, index, inGlobStar) -} - - -GlobSync.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar) { - var entries = this._readdir(abs, inGlobStar) - - // if the abs isn't a dir, then nothing can match! - if (!entries) - return - - // It will only match dot entries if it starts with a dot, or if - // dot is set. Stuff like @(.foo|.bar) isn't allowed. - var pn = remain[0] - var negate = !!this.minimatch.negate - var rawGlob = pn._glob - var dotOk = this.dot || rawGlob.charAt(0) === '.' - - var matchedEntries = [] - for (var i = 0; i < entries.length; i++) { - var e = entries[i] - if (e.charAt(0) !== '.' || dotOk) { - var m - if (negate && !prefix) { - m = !e.match(pn) - } else { - m = e.match(pn) - } - if (m) - matchedEntries.push(e) - } - } - - var len = matchedEntries.length - // If there are no matched entries, then nothing matches. - if (len === 0) - return - - // if this is the last remaining pattern bit, then no need for - // an additional stat *unless* the user has specified mark or - // stat explicitly. We know they exist, since readdir returned - // them. - - if (remain.length === 1 && !this.mark && !this.stat) { - if (!this.matches[index]) - this.matches[index] = Object.create(null) - - for (var i = 0; i < len; i ++) { - var e = matchedEntries[i] - if (prefix) { - if (prefix.slice(-1) !== '/') - e = prefix + '/' + e - else - e = prefix + e - } - - if (e.charAt(0) === '/' && !this.nomount) { - e = path.join(this.root, e) - } - this._emitMatch(index, e) - } - // This was the last one, and no stats were needed - return - } - - // now test all matched entries as stand-ins for that part - // of the pattern. - remain.shift() - for (var i = 0; i < len; i ++) { - var e = matchedEntries[i] - var newPattern - if (prefix) - newPattern = [prefix, e] - else - newPattern = [e] - this._process(newPattern.concat(remain), index, inGlobStar) - } -} - - -GlobSync.prototype._emitMatch = function (index, e) { - if (isIgnored(this, e)) - return - - var abs = this._makeAbs(e) - - if (this.mark) - e = this._mark(e) - - if (this.absolute) { - e = abs - } - - if (this.matches[index][e]) - return - - if (this.nodir) { - var c = this.cache[abs] - if (c === 'DIR' || Array.isArray(c)) - return - } - - this.matches[index][e] = true - - if (this.stat) - this._stat(e) -} - - -GlobSync.prototype._readdirInGlobStar = function (abs) { - // follow all symlinked directories forever - // just proceed as if this is a non-globstar situation - if (this.follow) - return this._readdir(abs, false) - - var entries - var lstat - var stat - try { - lstat = this.fs.lstatSync(abs) - } catch (er) { - if (er.code === 'ENOENT') { - // lstat failed, doesn't exist - return null - } - } - - var isSym = lstat && lstat.isSymbolicLink() - this.symlinks[abs] = isSym - - // If it's not a symlink or a dir, then it's definitely a regular file. - // don't bother doing a readdir in that case. - if (!isSym && lstat && !lstat.isDirectory()) - this.cache[abs] = 'FILE' - else - entries = this._readdir(abs, false) - - return entries -} - -GlobSync.prototype._readdir = function (abs, inGlobStar) { - var entries - - if (inGlobStar && !ownProp(this.symlinks, abs)) - return this._readdirInGlobStar(abs) - - if (ownProp(this.cache, abs)) { - var c = this.cache[abs] - if (!c || c === 'FILE') - return null - - if (Array.isArray(c)) - return c - } - - try { - return this._readdirEntries(abs, this.fs.readdirSync(abs)) - } catch (er) { - this._readdirError(abs, er) - return null - } -} - -GlobSync.prototype._readdirEntries = function (abs, entries) { - // if we haven't asked to stat everything, then just - // assume that everything in there exists, so we can avoid - // having to stat it a second time. - if (!this.mark && !this.stat) { - for (var i = 0; i < entries.length; i ++) { - var e = entries[i] - if (abs === '/') - e = abs + e - else - e = abs + '/' + e - this.cache[e] = true - } - } - - this.cache[abs] = entries - - // mark and cache dir-ness - return entries -} - -GlobSync.prototype._readdirError = function (f, er) { - // handle errors, and cache the information - switch (er.code) { - case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205 - case 'ENOTDIR': // totally normal. means it *does* exist. - var abs = this._makeAbs(f) - this.cache[abs] = 'FILE' - if (abs === this.cwdAbs) { - var error = new Error(er.code + ' invalid cwd ' + this.cwd) - error.path = this.cwd - error.code = er.code - throw error - } - break - - case 'ENOENT': // not terribly unusual - case 'ELOOP': - case 'ENAMETOOLONG': - case 'UNKNOWN': - this.cache[this._makeAbs(f)] = false - break - - default: // some unusual error. Treat as failure. - this.cache[this._makeAbs(f)] = false - if (this.strict) - throw er - if (!this.silent) - console.error('glob error', er) - break - } -} - -GlobSync.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar) { - - var entries = this._readdir(abs, inGlobStar) - - // no entries means not a dir, so it can never have matches - // foo.txt/** doesn't match foo.txt - if (!entries) - return - - // test without the globstar, and with every child both below - // and replacing the globstar. - var remainWithoutGlobStar = remain.slice(1) - var gspref = prefix ? [ prefix ] : [] - var noGlobStar = gspref.concat(remainWithoutGlobStar) - - // the noGlobStar pattern exits the inGlobStar state - this._process(noGlobStar, index, false) - - var len = entries.length - var isSym = this.symlinks[abs] - - // If it's a symlink, and we're in a globstar, then stop - if (isSym && inGlobStar) - return - - for (var i = 0; i < len; i++) { - var e = entries[i] - if (e.charAt(0) === '.' && !this.dot) - continue - - // these two cases enter the inGlobStar state - var instead = gspref.concat(entries[i], remainWithoutGlobStar) - this._process(instead, index, true) - - var below = gspref.concat(entries[i], remain) - this._process(below, index, true) - } -} - -GlobSync.prototype._processSimple = function (prefix, index) { - // XXX review this. Shouldn't it be doing the mounting etc - // before doing stat? kinda weird? - var exists = this._stat(prefix) - - if (!this.matches[index]) - this.matches[index] = Object.create(null) - - // If it doesn't exist, then just mark the lack of results - if (!exists) - return - - if (prefix && isAbsolute(prefix) && !this.nomount) { - var trail = /[\/\\]$/.test(prefix) - if (prefix.charAt(0) === '/') { - prefix = path.join(this.root, prefix) - } else { - prefix = path.resolve(this.root, prefix) - if (trail) - prefix += '/' - } - } - - if (process.platform === 'win32') - prefix = prefix.replace(/\\/g, '/') - - // Mark this as a match - this._emitMatch(index, prefix) -} - -// Returns either 'DIR', 'FILE', or false -GlobSync.prototype._stat = function (f) { - var abs = this._makeAbs(f) - var needDir = f.slice(-1) === '/' - - if (f.length > this.maxLength) - return false - - if (!this.stat && ownProp(this.cache, abs)) { - var c = this.cache[abs] - - if (Array.isArray(c)) - c = 'DIR' - - // It exists, but maybe not how we need it - if (!needDir || c === 'DIR') - return c - - if (needDir && c === 'FILE') - return false - - // otherwise we have to stat, because maybe c=true - // if we know it exists, but not what it is. - } - - var exists - var stat = this.statCache[abs] - if (!stat) { - var lstat - try { - lstat = this.fs.lstatSync(abs) - } catch (er) { - if (er && (er.code === 'ENOENT' || er.code === 'ENOTDIR')) { - this.statCache[abs] = false - return false - } - } - - if (lstat && lstat.isSymbolicLink()) { - try { - stat = this.fs.statSync(abs) - } catch (er) { - stat = lstat - } - } else { - stat = lstat - } - } - - this.statCache[abs] = stat - - var c = true - if (stat) - c = stat.isDirectory() ? 'DIR' : 'FILE' - - this.cache[abs] = this.cache[abs] || c - - if (needDir && c === 'FILE') - return false - - return c -} - -GlobSync.prototype._mark = function (p) { - return common.mark(this, p) -} - -GlobSync.prototype._makeAbs = function (f) { - return common.makeAbs(this, f) -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/rimraf/node_modules/minimatch/LICENSE b/packages/wyatt_notification_bloc/example/scripts/node_modules/rimraf/node_modules/minimatch/LICENSE deleted file mode 100644 index 19129e31..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/rimraf/node_modules/minimatch/LICENSE +++ /dev/null @@ -1,15 +0,0 @@ -The ISC License - -Copyright (c) Isaac Z. Schlueter and Contributors - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR -IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/rimraf/node_modules/minimatch/README.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/rimraf/node_modules/minimatch/README.md deleted file mode 100644 index 33ede1d6..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/rimraf/node_modules/minimatch/README.md +++ /dev/null @@ -1,230 +0,0 @@ -# minimatch - -A minimal matching utility. - -[![Build Status](https://travis-ci.org/isaacs/minimatch.svg?branch=master)](http://travis-ci.org/isaacs/minimatch) - - -This is the matching library used internally by npm. - -It works by converting glob expressions into JavaScript `RegExp` -objects. - -## Usage - -```javascript -var minimatch = require("minimatch") - -minimatch("bar.foo", "*.foo") // true! -minimatch("bar.foo", "*.bar") // false! -minimatch("bar.foo", "*.+(bar|foo)", { debug: true }) // true, and noisy! -``` - -## Features - -Supports these glob features: - -* Brace Expansion -* Extended glob matching -* "Globstar" `**` matching - -See: - -* `man sh` -* `man bash` -* `man 3 fnmatch` -* `man 5 gitignore` - -## Minimatch Class - -Create a minimatch object by instantiating the `minimatch.Minimatch` class. - -```javascript -var Minimatch = require("minimatch").Minimatch -var mm = new Minimatch(pattern, options) -``` - -### Properties - -* `pattern` The original pattern the minimatch object represents. -* `options` The options supplied to the constructor. -* `set` A 2-dimensional array of regexp or string expressions. - Each row in the - array corresponds to a brace-expanded pattern. Each item in the row - corresponds to a single path-part. For example, the pattern - `{a,b/c}/d` would expand to a set of patterns like: - - [ [ a, d ] - , [ b, c, d ] ] - - If a portion of the pattern doesn't have any "magic" in it - (that is, it's something like `"foo"` rather than `fo*o?`), then it - will be left as a string rather than converted to a regular - expression. - -* `regexp` Created by the `makeRe` method. A single regular expression - expressing the entire pattern. This is useful in cases where you wish - to use the pattern somewhat like `fnmatch(3)` with `FNM_PATH` enabled. -* `negate` True if the pattern is negated. -* `comment` True if the pattern is a comment. -* `empty` True if the pattern is `""`. - -### Methods - -* `makeRe` Generate the `regexp` member if necessary, and return it. - Will return `false` if the pattern is invalid. -* `match(fname)` Return true if the filename matches the pattern, or - false otherwise. -* `matchOne(fileArray, patternArray, partial)` Take a `/`-split - filename, and match it against a single row in the `regExpSet`. This - method is mainly for internal use, but is exposed so that it can be - used by a glob-walker that needs to avoid excessive filesystem calls. - -All other methods are internal, and will be called as necessary. - -### minimatch(path, pattern, options) - -Main export. Tests a path against the pattern using the options. - -```javascript -var isJS = minimatch(file, "*.js", { matchBase: true }) -``` - -### minimatch.filter(pattern, options) - -Returns a function that tests its -supplied argument, suitable for use with `Array.filter`. Example: - -```javascript -var javascripts = fileList.filter(minimatch.filter("*.js", {matchBase: true})) -``` - -### minimatch.match(list, pattern, options) - -Match against the list of -files, in the style of fnmatch or glob. If nothing is matched, and -options.nonull is set, then return a list containing the pattern itself. - -```javascript -var javascripts = minimatch.match(fileList, "*.js", {matchBase: true})) -``` - -### minimatch.makeRe(pattern, options) - -Make a regular expression object from the pattern. - -## Options - -All options are `false` by default. - -### debug - -Dump a ton of stuff to stderr. - -### nobrace - -Do not expand `{a,b}` and `{1..3}` brace sets. - -### noglobstar - -Disable `**` matching against multiple folder names. - -### dot - -Allow patterns to match filenames starting with a period, even if -the pattern does not explicitly have a period in that spot. - -Note that by default, `a/**/b` will **not** match `a/.d/b`, unless `dot` -is set. - -### noext - -Disable "extglob" style patterns like `+(a|b)`. - -### nocase - -Perform a case-insensitive match. - -### nonull - -When a match is not found by `minimatch.match`, return a list containing -the pattern itself if this option is set. When not set, an empty list -is returned if there are no matches. - -### matchBase - -If set, then patterns without slashes will be matched -against the basename of the path if it contains slashes. For example, -`a?b` would match the path `/xyz/123/acb`, but not `/xyz/acb/123`. - -### nocomment - -Suppress the behavior of treating `#` at the start of a pattern as a -comment. - -### nonegate - -Suppress the behavior of treating a leading `!` character as negation. - -### flipNegate - -Returns from negate expressions the same as if they were not negated. -(Ie, true on a hit, false on a miss.) - -### partial - -Compare a partial path to a pattern. As long as the parts of the path that -are present are not contradicted by the pattern, it will be treated as a -match. This is useful in applications where you're walking through a -folder structure, and don't yet have the full path, but want to ensure that -you do not walk down paths that can never be a match. - -For example, - -```js -minimatch('/a/b', '/a/*/c/d', { partial: true }) // true, might be /a/b/c/d -minimatch('/a/b', '/**/d', { partial: true }) // true, might be /a/b/.../d -minimatch('/x/y/z', '/a/**/z', { partial: true }) // false, because x !== a -``` - -### allowWindowsEscape - -Windows path separator `\` is by default converted to `/`, which -prohibits the usage of `\` as a escape character. This flag skips that -behavior and allows using the escape character. - -## Comparisons to other fnmatch/glob implementations - -While strict compliance with the existing standards is a worthwhile -goal, some discrepancies exist between minimatch and other -implementations, and are intentional. - -If the pattern starts with a `!` character, then it is negated. Set the -`nonegate` flag to suppress this behavior, and treat leading `!` -characters normally. This is perhaps relevant if you wish to start the -pattern with a negative extglob pattern like `!(a|B)`. Multiple `!` -characters at the start of a pattern will negate the pattern multiple -times. - -If a pattern starts with `#`, then it is treated as a comment, and -will not match anything. Use `\#` to match a literal `#` at the -start of a line, or set the `nocomment` flag to suppress this behavior. - -The double-star character `**` is supported by default, unless the -`noglobstar` flag is set. This is supported in the manner of bsdglob -and bash 4.1, where `**` only has special significance if it is the only -thing in a path part. That is, `a/**/b` will match `a/x/y/b`, but -`a/**b` will not. - -If an escaped pattern has no matches, and the `nonull` flag is set, -then minimatch.match returns the pattern as-provided, rather than -interpreting the character escapes. For example, -`minimatch.match([], "\\*a\\?")` will return `"\\*a\\?"` rather than -`"*a?"`. This is akin to setting the `nullglob` option in bash, except -that it does not resolve escaped pattern characters. - -If brace expansion is not disabled, then it is performed before any -other interpretation of the glob pattern. Thus, a pattern like -`+(a|{b),c)}`, which would not be valid in bash or zsh, is expanded -**first** into the set of `+(a|b)` and `+(a|c)`, and those patterns are -checked for validity. Since those two are valid, matching proceeds. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/rimraf/node_modules/minimatch/minimatch.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/rimraf/node_modules/minimatch/minimatch.js deleted file mode 100644 index fda45ade..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/rimraf/node_modules/minimatch/minimatch.js +++ /dev/null @@ -1,947 +0,0 @@ -module.exports = minimatch -minimatch.Minimatch = Minimatch - -var path = (function () { try { return require('path') } catch (e) {}}()) || { - sep: '/' -} -minimatch.sep = path.sep - -var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {} -var expand = require('brace-expansion') - -var plTypes = { - '!': { open: '(?:(?!(?:', close: '))[^/]*?)'}, - '?': { open: '(?:', close: ')?' }, - '+': { open: '(?:', close: ')+' }, - '*': { open: '(?:', close: ')*' }, - '@': { open: '(?:', close: ')' } -} - -// any single thing other than / -// don't need to escape / when using new RegExp() -var qmark = '[^/]' - -// * => any number of characters -var star = qmark + '*?' - -// ** when dots are allowed. Anything goes, except .. and . -// not (^ or / followed by one or two dots followed by $ or /), -// followed by anything, any number of times. -var twoStarDot = '(?:(?!(?:\\\/|^)(?:\\.{1,2})($|\\\/)).)*?' - -// not a ^ or / followed by a dot, -// followed by anything, any number of times. -var twoStarNoDot = '(?:(?!(?:\\\/|^)\\.).)*?' - -// characters that need to be escaped in RegExp. -var reSpecials = charSet('().*{}+?[]^$\\!') - -// "abc" -> { a:true, b:true, c:true } -function charSet (s) { - return s.split('').reduce(function (set, c) { - set[c] = true - return set - }, {}) -} - -// normalizes slashes. -var slashSplit = /\/+/ - -minimatch.filter = filter -function filter (pattern, options) { - options = options || {} - return function (p, i, list) { - return minimatch(p, pattern, options) - } -} - -function ext (a, b) { - b = b || {} - var t = {} - Object.keys(a).forEach(function (k) { - t[k] = a[k] - }) - Object.keys(b).forEach(function (k) { - t[k] = b[k] - }) - return t -} - -minimatch.defaults = function (def) { - if (!def || typeof def !== 'object' || !Object.keys(def).length) { - return minimatch - } - - var orig = minimatch - - var m = function minimatch (p, pattern, options) { - return orig(p, pattern, ext(def, options)) - } - - m.Minimatch = function Minimatch (pattern, options) { - return new orig.Minimatch(pattern, ext(def, options)) - } - m.Minimatch.defaults = function defaults (options) { - return orig.defaults(ext(def, options)).Minimatch - } - - m.filter = function filter (pattern, options) { - return orig.filter(pattern, ext(def, options)) - } - - m.defaults = function defaults (options) { - return orig.defaults(ext(def, options)) - } - - m.makeRe = function makeRe (pattern, options) { - return orig.makeRe(pattern, ext(def, options)) - } - - m.braceExpand = function braceExpand (pattern, options) { - return orig.braceExpand(pattern, ext(def, options)) - } - - m.match = function (list, pattern, options) { - return orig.match(list, pattern, ext(def, options)) - } - - return m -} - -Minimatch.defaults = function (def) { - return minimatch.defaults(def).Minimatch -} - -function minimatch (p, pattern, options) { - assertValidPattern(pattern) - - if (!options) options = {} - - // shortcut: comments match nothing. - if (!options.nocomment && pattern.charAt(0) === '#') { - return false - } - - return new Minimatch(pattern, options).match(p) -} - -function Minimatch (pattern, options) { - if (!(this instanceof Minimatch)) { - return new Minimatch(pattern, options) - } - - assertValidPattern(pattern) - - if (!options) options = {} - - pattern = pattern.trim() - - // windows support: need to use /, not \ - if (!options.allowWindowsEscape && path.sep !== '/') { - pattern = pattern.split(path.sep).join('/') - } - - this.options = options - this.set = [] - this.pattern = pattern - this.regexp = null - this.negate = false - this.comment = false - this.empty = false - this.partial = !!options.partial - - // make the set of regexps etc. - this.make() -} - -Minimatch.prototype.debug = function () {} - -Minimatch.prototype.make = make -function make () { - var pattern = this.pattern - var options = this.options - - // empty patterns and comments match nothing. - if (!options.nocomment && pattern.charAt(0) === '#') { - this.comment = true - return - } - if (!pattern) { - this.empty = true - return - } - - // step 1: figure out negation, etc. - this.parseNegate() - - // step 2: expand braces - var set = this.globSet = this.braceExpand() - - if (options.debug) this.debug = function debug() { console.error.apply(console, arguments) } - - this.debug(this.pattern, set) - - // step 3: now we have a set, so turn each one into a series of path-portion - // matching patterns. - // These will be regexps, except in the case of "**", which is - // set to the GLOBSTAR object for globstar behavior, - // and will not contain any / characters - set = this.globParts = set.map(function (s) { - return s.split(slashSplit) - }) - - this.debug(this.pattern, set) - - // glob --> regexps - set = set.map(function (s, si, set) { - return s.map(this.parse, this) - }, this) - - this.debug(this.pattern, set) - - // filter out everything that didn't compile properly. - set = set.filter(function (s) { - return s.indexOf(false) === -1 - }) - - this.debug(this.pattern, set) - - this.set = set -} - -Minimatch.prototype.parseNegate = parseNegate -function parseNegate () { - var pattern = this.pattern - var negate = false - var options = this.options - var negateOffset = 0 - - if (options.nonegate) return - - for (var i = 0, l = pattern.length - ; i < l && pattern.charAt(i) === '!' - ; i++) { - negate = !negate - negateOffset++ - } - - if (negateOffset) this.pattern = pattern.substr(negateOffset) - this.negate = negate -} - -// Brace expansion: -// a{b,c}d -> abd acd -// a{b,}c -> abc ac -// a{0..3}d -> a0d a1d a2d a3d -// a{b,c{d,e}f}g -> abg acdfg acefg -// a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg -// -// Invalid sets are not expanded. -// a{2..}b -> a{2..}b -// a{b}c -> a{b}c -minimatch.braceExpand = function (pattern, options) { - return braceExpand(pattern, options) -} - -Minimatch.prototype.braceExpand = braceExpand - -function braceExpand (pattern, options) { - if (!options) { - if (this instanceof Minimatch) { - options = this.options - } else { - options = {} - } - } - - pattern = typeof pattern === 'undefined' - ? this.pattern : pattern - - assertValidPattern(pattern) - - // Thanks to Yeting Li for - // improving this regexp to avoid a ReDOS vulnerability. - if (options.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern)) { - // shortcut. no need to expand. - return [pattern] - } - - return expand(pattern) -} - -var MAX_PATTERN_LENGTH = 1024 * 64 -var assertValidPattern = function (pattern) { - if (typeof pattern !== 'string') { - throw new TypeError('invalid pattern') - } - - if (pattern.length > MAX_PATTERN_LENGTH) { - throw new TypeError('pattern is too long') - } -} - -// parse a component of the expanded set. -// At this point, no pattern may contain "/" in it -// so we're going to return a 2d array, where each entry is the full -// pattern, split on '/', and then turned into a regular expression. -// A regexp is made at the end which joins each array with an -// escaped /, and another full one which joins each regexp with |. -// -// Following the lead of Bash 4.1, note that "**" only has special meaning -// when it is the *only* thing in a path portion. Otherwise, any series -// of * is equivalent to a single *. Globstar behavior is enabled by -// default, and can be disabled by setting options.noglobstar. -Minimatch.prototype.parse = parse -var SUBPARSE = {} -function parse (pattern, isSub) { - assertValidPattern(pattern) - - var options = this.options - - // shortcuts - if (pattern === '**') { - if (!options.noglobstar) - return GLOBSTAR - else - pattern = '*' - } - if (pattern === '') return '' - - var re = '' - var hasMagic = !!options.nocase - var escaping = false - // ? => one single character - var patternListStack = [] - var negativeLists = [] - var stateChar - var inClass = false - var reClassStart = -1 - var classStart = -1 - // . and .. never match anything that doesn't start with ., - // even when options.dot is set. - var patternStart = pattern.charAt(0) === '.' ? '' // anything - // not (start or / followed by . or .. followed by / or end) - : options.dot ? '(?!(?:^|\\\/)\\.{1,2}(?:$|\\\/))' - : '(?!\\.)' - var self = this - - function clearStateChar () { - if (stateChar) { - // we had some state-tracking character - // that wasn't consumed by this pass. - switch (stateChar) { - case '*': - re += star - hasMagic = true - break - case '?': - re += qmark - hasMagic = true - break - default: - re += '\\' + stateChar - break - } - self.debug('clearStateChar %j %j', stateChar, re) - stateChar = false - } - } - - for (var i = 0, len = pattern.length, c - ; (i < len) && (c = pattern.charAt(i)) - ; i++) { - this.debug('%s\t%s %s %j', pattern, i, re, c) - - // skip over any that are escaped. - if (escaping && reSpecials[c]) { - re += '\\' + c - escaping = false - continue - } - - switch (c) { - /* istanbul ignore next */ - case '/': { - // completely not allowed, even escaped. - // Should already be path-split by now. - return false - } - - case '\\': - clearStateChar() - escaping = true - continue - - // the various stateChar values - // for the "extglob" stuff. - case '?': - case '*': - case '+': - case '@': - case '!': - this.debug('%s\t%s %s %j <-- stateChar', pattern, i, re, c) - - // all of those are literals inside a class, except that - // the glob [!a] means [^a] in regexp - if (inClass) { - this.debug(' in class') - if (c === '!' && i === classStart + 1) c = '^' - re += c - continue - } - - // if we already have a stateChar, then it means - // that there was something like ** or +? in there. - // Handle the stateChar, then proceed with this one. - self.debug('call clearStateChar %j', stateChar) - clearStateChar() - stateChar = c - // if extglob is disabled, then +(asdf|foo) isn't a thing. - // just clear the statechar *now*, rather than even diving into - // the patternList stuff. - if (options.noext) clearStateChar() - continue - - case '(': - if (inClass) { - re += '(' - continue - } - - if (!stateChar) { - re += '\\(' - continue - } - - patternListStack.push({ - type: stateChar, - start: i - 1, - reStart: re.length, - open: plTypes[stateChar].open, - close: plTypes[stateChar].close - }) - // negation is (?:(?!js)[^/]*) - re += stateChar === '!' ? '(?:(?!(?:' : '(?:' - this.debug('plType %j %j', stateChar, re) - stateChar = false - continue - - case ')': - if (inClass || !patternListStack.length) { - re += '\\)' - continue - } - - clearStateChar() - hasMagic = true - var pl = patternListStack.pop() - // negation is (?:(?!js)[^/]*) - // The others are (?:) - re += pl.close - if (pl.type === '!') { - negativeLists.push(pl) - } - pl.reEnd = re.length - continue - - case '|': - if (inClass || !patternListStack.length || escaping) { - re += '\\|' - escaping = false - continue - } - - clearStateChar() - re += '|' - continue - - // these are mostly the same in regexp and glob - case '[': - // swallow any state-tracking char before the [ - clearStateChar() - - if (inClass) { - re += '\\' + c - continue - } - - inClass = true - classStart = i - reClassStart = re.length - re += c - continue - - case ']': - // a right bracket shall lose its special - // meaning and represent itself in - // a bracket expression if it occurs - // first in the list. -- POSIX.2 2.8.3.2 - if (i === classStart + 1 || !inClass) { - re += '\\' + c - escaping = false - continue - } - - // handle the case where we left a class open. - // "[z-a]" is valid, equivalent to "\[z-a\]" - // split where the last [ was, make sure we don't have - // an invalid re. if so, re-walk the contents of the - // would-be class to re-translate any characters that - // were passed through as-is - // TODO: It would probably be faster to determine this - // without a try/catch and a new RegExp, but it's tricky - // to do safely. For now, this is safe and works. - var cs = pattern.substring(classStart + 1, i) - try { - RegExp('[' + cs + ']') - } catch (er) { - // not a valid class! - var sp = this.parse(cs, SUBPARSE) - re = re.substr(0, reClassStart) + '\\[' + sp[0] + '\\]' - hasMagic = hasMagic || sp[1] - inClass = false - continue - } - - // finish up the class. - hasMagic = true - inClass = false - re += c - continue - - default: - // swallow any state char that wasn't consumed - clearStateChar() - - if (escaping) { - // no need - escaping = false - } else if (reSpecials[c] - && !(c === '^' && inClass)) { - re += '\\' - } - - re += c - - } // switch - } // for - - // handle the case where we left a class open. - // "[abc" is valid, equivalent to "\[abc" - if (inClass) { - // split where the last [ was, and escape it - // this is a huge pita. We now have to re-walk - // the contents of the would-be class to re-translate - // any characters that were passed through as-is - cs = pattern.substr(classStart + 1) - sp = this.parse(cs, SUBPARSE) - re = re.substr(0, reClassStart) + '\\[' + sp[0] - hasMagic = hasMagic || sp[1] - } - - // handle the case where we had a +( thing at the *end* - // of the pattern. - // each pattern list stack adds 3 chars, and we need to go through - // and escape any | chars that were passed through as-is for the regexp. - // Go through and escape them, taking care not to double-escape any - // | chars that were already escaped. - for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) { - var tail = re.slice(pl.reStart + pl.open.length) - this.debug('setting tail', re, pl) - // maybe some even number of \, then maybe 1 \, followed by a | - tail = tail.replace(/((?:\\{2}){0,64})(\\?)\|/g, function (_, $1, $2) { - if (!$2) { - // the | isn't already escaped, so escape it. - $2 = '\\' - } - - // need to escape all those slashes *again*, without escaping the - // one that we need for escaping the | character. As it works out, - // escaping an even number of slashes can be done by simply repeating - // it exactly after itself. That's why this trick works. - // - // I am sorry that you have to see this. - return $1 + $1 + $2 + '|' - }) - - this.debug('tail=%j\n %s', tail, tail, pl, re) - var t = pl.type === '*' ? star - : pl.type === '?' ? qmark - : '\\' + pl.type - - hasMagic = true - re = re.slice(0, pl.reStart) + t + '\\(' + tail - } - - // handle trailing things that only matter at the very end. - clearStateChar() - if (escaping) { - // trailing \\ - re += '\\\\' - } - - // only need to apply the nodot start if the re starts with - // something that could conceivably capture a dot - var addPatternStart = false - switch (re.charAt(0)) { - case '[': case '.': case '(': addPatternStart = true - } - - // Hack to work around lack of negative lookbehind in JS - // A pattern like: *.!(x).!(y|z) needs to ensure that a name - // like 'a.xyz.yz' doesn't match. So, the first negative - // lookahead, has to look ALL the way ahead, to the end of - // the pattern. - for (var n = negativeLists.length - 1; n > -1; n--) { - var nl = negativeLists[n] - - var nlBefore = re.slice(0, nl.reStart) - var nlFirst = re.slice(nl.reStart, nl.reEnd - 8) - var nlLast = re.slice(nl.reEnd - 8, nl.reEnd) - var nlAfter = re.slice(nl.reEnd) - - nlLast += nlAfter - - // Handle nested stuff like *(*.js|!(*.json)), where open parens - // mean that we should *not* include the ) in the bit that is considered - // "after" the negated section. - var openParensBefore = nlBefore.split('(').length - 1 - var cleanAfter = nlAfter - for (i = 0; i < openParensBefore; i++) { - cleanAfter = cleanAfter.replace(/\)[+*?]?/, '') - } - nlAfter = cleanAfter - - var dollar = '' - if (nlAfter === '' && isSub !== SUBPARSE) { - dollar = '$' - } - var newRe = nlBefore + nlFirst + nlAfter + dollar + nlLast - re = newRe - } - - // if the re is not "" at this point, then we need to make sure - // it doesn't match against an empty path part. - // Otherwise a/* will match a/, which it should not. - if (re !== '' && hasMagic) { - re = '(?=.)' + re - } - - if (addPatternStart) { - re = patternStart + re - } - - // parsing just a piece of a larger pattern. - if (isSub === SUBPARSE) { - return [re, hasMagic] - } - - // skip the regexp for non-magical patterns - // unescape anything in it, though, so that it'll be - // an exact match against a file etc. - if (!hasMagic) { - return globUnescape(pattern) - } - - var flags = options.nocase ? 'i' : '' - try { - var regExp = new RegExp('^' + re + '$', flags) - } catch (er) /* istanbul ignore next - should be impossible */ { - // If it was an invalid regular expression, then it can't match - // anything. This trick looks for a character after the end of - // the string, which is of course impossible, except in multi-line - // mode, but it's not a /m regex. - return new RegExp('$.') - } - - regExp._glob = pattern - regExp._src = re - - return regExp -} - -minimatch.makeRe = function (pattern, options) { - return new Minimatch(pattern, options || {}).makeRe() -} - -Minimatch.prototype.makeRe = makeRe -function makeRe () { - if (this.regexp || this.regexp === false) return this.regexp - - // at this point, this.set is a 2d array of partial - // pattern strings, or "**". - // - // It's better to use .match(). This function shouldn't - // be used, really, but it's pretty convenient sometimes, - // when you just want to work with a regex. - var set = this.set - - if (!set.length) { - this.regexp = false - return this.regexp - } - var options = this.options - - var twoStar = options.noglobstar ? star - : options.dot ? twoStarDot - : twoStarNoDot - var flags = options.nocase ? 'i' : '' - - var re = set.map(function (pattern) { - return pattern.map(function (p) { - return (p === GLOBSTAR) ? twoStar - : (typeof p === 'string') ? regExpEscape(p) - : p._src - }).join('\\\/') - }).join('|') - - // must match entire pattern - // ending in a * or ** will make it less strict. - re = '^(?:' + re + ')$' - - // can match anything, as long as it's not this. - if (this.negate) re = '^(?!' + re + ').*$' - - try { - this.regexp = new RegExp(re, flags) - } catch (ex) /* istanbul ignore next - should be impossible */ { - this.regexp = false - } - return this.regexp -} - -minimatch.match = function (list, pattern, options) { - options = options || {} - var mm = new Minimatch(pattern, options) - list = list.filter(function (f) { - return mm.match(f) - }) - if (mm.options.nonull && !list.length) { - list.push(pattern) - } - return list -} - -Minimatch.prototype.match = function match (f, partial) { - if (typeof partial === 'undefined') partial = this.partial - this.debug('match', f, this.pattern) - // short-circuit in the case of busted things. - // comments, etc. - if (this.comment) return false - if (this.empty) return f === '' - - if (f === '/' && partial) return true - - var options = this.options - - // windows: need to use /, not \ - if (path.sep !== '/') { - f = f.split(path.sep).join('/') - } - - // treat the test path as a set of pathparts. - f = f.split(slashSplit) - this.debug(this.pattern, 'split', f) - - // just ONE of the pattern sets in this.set needs to match - // in order for it to be valid. If negating, then just one - // match means that we have failed. - // Either way, return on the first hit. - - var set = this.set - this.debug(this.pattern, 'set', set) - - // Find the basename of the path by looking for the last non-empty segment - var filename - var i - for (i = f.length - 1; i >= 0; i--) { - filename = f[i] - if (filename) break - } - - for (i = 0; i < set.length; i++) { - var pattern = set[i] - var file = f - if (options.matchBase && pattern.length === 1) { - file = [filename] - } - var hit = this.matchOne(file, pattern, partial) - if (hit) { - if (options.flipNegate) return true - return !this.negate - } - } - - // didn't get any hits. this is success if it's a negative - // pattern, failure otherwise. - if (options.flipNegate) return false - return this.negate -} - -// set partial to true to test if, for example, -// "/a/b" matches the start of "/*/b/*/d" -// Partial means, if you run out of file before you run -// out of pattern, then that's fine, as long as all -// the parts match. -Minimatch.prototype.matchOne = function (file, pattern, partial) { - var options = this.options - - this.debug('matchOne', - { 'this': this, file: file, pattern: pattern }) - - this.debug('matchOne', file.length, pattern.length) - - for (var fi = 0, - pi = 0, - fl = file.length, - pl = pattern.length - ; (fi < fl) && (pi < pl) - ; fi++, pi++) { - this.debug('matchOne loop') - var p = pattern[pi] - var f = file[fi] - - this.debug(pattern, p, f) - - // should be impossible. - // some invalid regexp stuff in the set. - /* istanbul ignore if */ - if (p === false) return false - - if (p === GLOBSTAR) { - this.debug('GLOBSTAR', [pattern, p, f]) - - // "**" - // a/**/b/**/c would match the following: - // a/b/x/y/z/c - // a/x/y/z/b/c - // a/b/x/b/x/c - // a/b/c - // To do this, take the rest of the pattern after - // the **, and see if it would match the file remainder. - // If so, return success. - // If not, the ** "swallows" a segment, and try again. - // This is recursively awful. - // - // a/**/b/**/c matching a/b/x/y/z/c - // - a matches a - // - doublestar - // - matchOne(b/x/y/z/c, b/**/c) - // - b matches b - // - doublestar - // - matchOne(x/y/z/c, c) -> no - // - matchOne(y/z/c, c) -> no - // - matchOne(z/c, c) -> no - // - matchOne(c, c) yes, hit - var fr = fi - var pr = pi + 1 - if (pr === pl) { - this.debug('** at the end') - // a ** at the end will just swallow the rest. - // We have found a match. - // however, it will not swallow /.x, unless - // options.dot is set. - // . and .. are *never* matched by **, for explosively - // exponential reasons. - for (; fi < fl; fi++) { - if (file[fi] === '.' || file[fi] === '..' || - (!options.dot && file[fi].charAt(0) === '.')) return false - } - return true - } - - // ok, let's see if we can swallow whatever we can. - while (fr < fl) { - var swallowee = file[fr] - - this.debug('\nglobstar while', file, fr, pattern, pr, swallowee) - - // XXX remove this slice. Just pass the start index. - if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) { - this.debug('globstar found match!', fr, fl, swallowee) - // found a match. - return true - } else { - // can't swallow "." or ".." ever. - // can only swallow ".foo" when explicitly asked. - if (swallowee === '.' || swallowee === '..' || - (!options.dot && swallowee.charAt(0) === '.')) { - this.debug('dot detected!', file, fr, pattern, pr) - break - } - - // ** swallows a segment, and continue. - this.debug('globstar swallow a segment, and continue') - fr++ - } - } - - // no match was found. - // However, in partial mode, we can't say this is necessarily over. - // If there's more *pattern* left, then - /* istanbul ignore if */ - if (partial) { - // ran out of file - this.debug('\n>>> no match, partial?', file, fr, pattern, pr) - if (fr === fl) return true - } - return false - } - - // something other than ** - // non-magic patterns just have to match exactly - // patterns with magic have been turned into regexps. - var hit - if (typeof p === 'string') { - hit = f === p - this.debug('string match', p, f, hit) - } else { - hit = f.match(p) - this.debug('pattern match', p, f, hit) - } - - if (!hit) return false - } - - // Note: ending in / means that we'll get a final "" - // at the end of the pattern. This can only match a - // corresponding "" at the end of the file. - // If the file ends in /, then it can only match a - // a pattern that ends in /, unless the pattern just - // doesn't have any more for it. But, a/b/ should *not* - // match "a/b/*", even though "" matches against the - // [^/]*? pattern, except in partial mode, where it might - // simply not be reached yet. - // However, a/b/ should still satisfy a/* - - // now either we fell off the end of the pattern, or we're done. - if (fi === fl && pi === pl) { - // ran out of pattern and filename at the same time. - // an exact hit! - return true - } else if (fi === fl) { - // ran out of file, but still had pattern left. - // this is ok if we're doing the match as part of - // a glob fs traversal. - return partial - } else /* istanbul ignore else */ if (pi === pl) { - // ran out of pattern, still have file left. - // this is only acceptable if we're on the very last - // empty segment of a file with a trailing slash. - // a/* should match a/b/ - return (fi === fl - 1) && (file[fi] === '') - } - - // should be unreachable. - /* istanbul ignore next */ - throw new Error('wtf?') -} - -// replace stuff like \* with * -function globUnescape (s) { - return s.replace(/\\(.)/g, '$1') -} - -function regExpEscape (s) { - return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&') -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/rimraf/node_modules/minimatch/package.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/rimraf/node_modules/minimatch/package.json deleted file mode 100644 index 566efdfe..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/rimraf/node_modules/minimatch/package.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "author": "Isaac Z. Schlueter (http://blog.izs.me)", - "name": "minimatch", - "description": "a glob matcher in javascript", - "version": "3.1.2", - "publishConfig": { - "tag": "v3-legacy" - }, - "repository": { - "type": "git", - "url": "git://github.com/isaacs/minimatch.git" - }, - "main": "minimatch.js", - "scripts": { - "test": "tap", - "preversion": "npm test", - "postversion": "npm publish", - "postpublish": "git push origin --all; git push origin --tags" - }, - "engines": { - "node": "*" - }, - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "devDependencies": { - "tap": "^15.1.6" - }, - "license": "ISC", - "files": [ - "minimatch.js" - ] -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/rimraf/package.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/rimraf/package.json deleted file mode 100644 index 1bf8d5e3..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/rimraf/package.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "name": "rimraf", - "version": "3.0.2", - "main": "rimraf.js", - "description": "A deep deletion module for node (like `rm -rf`)", - "author": "Isaac Z. Schlueter (http://blog.izs.me/)", - "license": "ISC", - "repository": "git://github.com/isaacs/rimraf.git", - "scripts": { - "preversion": "npm test", - "postversion": "npm publish", - "postpublish": "git push origin --follow-tags", - "test": "tap test/*.js" - }, - "bin": "./bin.js", - "dependencies": { - "glob": "^7.1.3" - }, - "files": [ - "LICENSE", - "README.md", - "bin.js", - "rimraf.js" - ], - "devDependencies": { - "mkdirp": "^0.5.1", - "tap": "^12.1.1" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/rimraf/rimraf.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/rimraf/rimraf.js deleted file mode 100644 index 34da4171..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/rimraf/rimraf.js +++ /dev/null @@ -1,360 +0,0 @@ -const assert = require("assert") -const path = require("path") -const fs = require("fs") -let glob = undefined -try { - glob = require("glob") -} catch (_err) { - // treat glob as optional. -} - -const defaultGlobOpts = { - nosort: true, - silent: true -} - -// for EMFILE handling -let timeout = 0 - -const isWindows = (process.platform === "win32") - -const defaults = options => { - const methods = [ - 'unlink', - 'chmod', - 'stat', - 'lstat', - 'rmdir', - 'readdir' - ] - methods.forEach(m => { - options[m] = options[m] || fs[m] - m = m + 'Sync' - options[m] = options[m] || fs[m] - }) - - options.maxBusyTries = options.maxBusyTries || 3 - options.emfileWait = options.emfileWait || 1000 - if (options.glob === false) { - options.disableGlob = true - } - if (options.disableGlob !== true && glob === undefined) { - throw Error('glob dependency not found, set `options.disableGlob = true` if intentional') - } - options.disableGlob = options.disableGlob || false - options.glob = options.glob || defaultGlobOpts -} - -const rimraf = (p, options, cb) => { - if (typeof options === 'function') { - cb = options - options = {} - } - - assert(p, 'rimraf: missing path') - assert.equal(typeof p, 'string', 'rimraf: path should be a string') - assert.equal(typeof cb, 'function', 'rimraf: callback function required') - assert(options, 'rimraf: invalid options argument provided') - assert.equal(typeof options, 'object', 'rimraf: options should be object') - - defaults(options) - - let busyTries = 0 - let errState = null - let n = 0 - - const next = (er) => { - errState = errState || er - if (--n === 0) - cb(errState) - } - - const afterGlob = (er, results) => { - if (er) - return cb(er) - - n = results.length - if (n === 0) - return cb() - - results.forEach(p => { - const CB = (er) => { - if (er) { - if ((er.code === "EBUSY" || er.code === "ENOTEMPTY" || er.code === "EPERM") && - busyTries < options.maxBusyTries) { - busyTries ++ - // try again, with the same exact callback as this one. - return setTimeout(() => rimraf_(p, options, CB), busyTries * 100) - } - - // this one won't happen if graceful-fs is used. - if (er.code === "EMFILE" && timeout < options.emfileWait) { - return setTimeout(() => rimraf_(p, options, CB), timeout ++) - } - - // already gone - if (er.code === "ENOENT") er = null - } - - timeout = 0 - next(er) - } - rimraf_(p, options, CB) - }) - } - - if (options.disableGlob || !glob.hasMagic(p)) - return afterGlob(null, [p]) - - options.lstat(p, (er, stat) => { - if (!er) - return afterGlob(null, [p]) - - glob(p, options.glob, afterGlob) - }) - -} - -// Two possible strategies. -// 1. Assume it's a file. unlink it, then do the dir stuff on EPERM or EISDIR -// 2. Assume it's a directory. readdir, then do the file stuff on ENOTDIR -// -// Both result in an extra syscall when you guess wrong. However, there -// are likely far more normal files in the world than directories. This -// is based on the assumption that a the average number of files per -// directory is >= 1. -// -// If anyone ever complains about this, then I guess the strategy could -// be made configurable somehow. But until then, YAGNI. -const rimraf_ = (p, options, cb) => { - assert(p) - assert(options) - assert(typeof cb === 'function') - - // sunos lets the root user unlink directories, which is... weird. - // so we have to lstat here and make sure it's not a dir. - options.lstat(p, (er, st) => { - if (er && er.code === "ENOENT") - return cb(null) - - // Windows can EPERM on stat. Life is suffering. - if (er && er.code === "EPERM" && isWindows) - fixWinEPERM(p, options, er, cb) - - if (st && st.isDirectory()) - return rmdir(p, options, er, cb) - - options.unlink(p, er => { - if (er) { - if (er.code === "ENOENT") - return cb(null) - if (er.code === "EPERM") - return (isWindows) - ? fixWinEPERM(p, options, er, cb) - : rmdir(p, options, er, cb) - if (er.code === "EISDIR") - return rmdir(p, options, er, cb) - } - return cb(er) - }) - }) -} - -const fixWinEPERM = (p, options, er, cb) => { - assert(p) - assert(options) - assert(typeof cb === 'function') - - options.chmod(p, 0o666, er2 => { - if (er2) - cb(er2.code === "ENOENT" ? null : er) - else - options.stat(p, (er3, stats) => { - if (er3) - cb(er3.code === "ENOENT" ? null : er) - else if (stats.isDirectory()) - rmdir(p, options, er, cb) - else - options.unlink(p, cb) - }) - }) -} - -const fixWinEPERMSync = (p, options, er) => { - assert(p) - assert(options) - - try { - options.chmodSync(p, 0o666) - } catch (er2) { - if (er2.code === "ENOENT") - return - else - throw er - } - - let stats - try { - stats = options.statSync(p) - } catch (er3) { - if (er3.code === "ENOENT") - return - else - throw er - } - - if (stats.isDirectory()) - rmdirSync(p, options, er) - else - options.unlinkSync(p) -} - -const rmdir = (p, options, originalEr, cb) => { - assert(p) - assert(options) - assert(typeof cb === 'function') - - // try to rmdir first, and only readdir on ENOTEMPTY or EEXIST (SunOS) - // if we guessed wrong, and it's not a directory, then - // raise the original error. - options.rmdir(p, er => { - if (er && (er.code === "ENOTEMPTY" || er.code === "EEXIST" || er.code === "EPERM")) - rmkids(p, options, cb) - else if (er && er.code === "ENOTDIR") - cb(originalEr) - else - cb(er) - }) -} - -const rmkids = (p, options, cb) => { - assert(p) - assert(options) - assert(typeof cb === 'function') - - options.readdir(p, (er, files) => { - if (er) - return cb(er) - let n = files.length - if (n === 0) - return options.rmdir(p, cb) - let errState - files.forEach(f => { - rimraf(path.join(p, f), options, er => { - if (errState) - return - if (er) - return cb(errState = er) - if (--n === 0) - options.rmdir(p, cb) - }) - }) - }) -} - -// this looks simpler, and is strictly *faster*, but will -// tie up the JavaScript thread and fail on excessively -// deep directory trees. -const rimrafSync = (p, options) => { - options = options || {} - defaults(options) - - assert(p, 'rimraf: missing path') - assert.equal(typeof p, 'string', 'rimraf: path should be a string') - assert(options, 'rimraf: missing options') - assert.equal(typeof options, 'object', 'rimraf: options should be object') - - let results - - if (options.disableGlob || !glob.hasMagic(p)) { - results = [p] - } else { - try { - options.lstatSync(p) - results = [p] - } catch (er) { - results = glob.sync(p, options.glob) - } - } - - if (!results.length) - return - - for (let i = 0; i < results.length; i++) { - const p = results[i] - - let st - try { - st = options.lstatSync(p) - } catch (er) { - if (er.code === "ENOENT") - return - - // Windows can EPERM on stat. Life is suffering. - if (er.code === "EPERM" && isWindows) - fixWinEPERMSync(p, options, er) - } - - try { - // sunos lets the root user unlink directories, which is... weird. - if (st && st.isDirectory()) - rmdirSync(p, options, null) - else - options.unlinkSync(p) - } catch (er) { - if (er.code === "ENOENT") - return - if (er.code === "EPERM") - return isWindows ? fixWinEPERMSync(p, options, er) : rmdirSync(p, options, er) - if (er.code !== "EISDIR") - throw er - - rmdirSync(p, options, er) - } - } -} - -const rmdirSync = (p, options, originalEr) => { - assert(p) - assert(options) - - try { - options.rmdirSync(p) - } catch (er) { - if (er.code === "ENOENT") - return - if (er.code === "ENOTDIR") - throw originalEr - if (er.code === "ENOTEMPTY" || er.code === "EEXIST" || er.code === "EPERM") - rmkidsSync(p, options) - } -} - -const rmkidsSync = (p, options) => { - assert(p) - assert(options) - options.readdirSync(p).forEach(f => rimrafSync(path.join(p, f), options)) - - // We only end up here once we got ENOTEMPTY at least once, and - // at this point, we are guaranteed to have removed all the kids. - // So, we know that it won't be ENOENT or ENOTDIR or anything else. - // try really hard to delete stuff on windows, because it has a - // PROFOUNDLY annoying habit of not closing handles promptly when - // files are deleted, resulting in spurious ENOTEMPTY errors. - const retries = isWindows ? 100 : 1 - let i = 0 - do { - let threw = true - try { - const ret = options.rmdirSync(p, options) - threw = false - return ret - } finally { - if (++i < retries && threw) - continue - } - } while (true) -} - -module.exports = rimraf -rimraf.sync = rimrafSync diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/safe-buffer/LICENSE b/packages/wyatt_notification_bloc/example/scripts/node_modules/safe-buffer/LICENSE deleted file mode 100644 index 0c068cee..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/safe-buffer/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Feross Aboukhadijeh - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/safe-buffer/README.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/safe-buffer/README.md deleted file mode 100644 index e9a81afd..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/safe-buffer/README.md +++ /dev/null @@ -1,584 +0,0 @@ -# safe-buffer [![travis][travis-image]][travis-url] [![npm][npm-image]][npm-url] [![downloads][downloads-image]][downloads-url] [![javascript style guide][standard-image]][standard-url] - -[travis-image]: https://img.shields.io/travis/feross/safe-buffer/master.svg -[travis-url]: https://travis-ci.org/feross/safe-buffer -[npm-image]: https://img.shields.io/npm/v/safe-buffer.svg -[npm-url]: https://npmjs.org/package/safe-buffer -[downloads-image]: https://img.shields.io/npm/dm/safe-buffer.svg -[downloads-url]: https://npmjs.org/package/safe-buffer -[standard-image]: https://img.shields.io/badge/code_style-standard-brightgreen.svg -[standard-url]: https://standardjs.com - -#### Safer Node.js Buffer API - -**Use the new Node.js Buffer APIs (`Buffer.from`, `Buffer.alloc`, -`Buffer.allocUnsafe`, `Buffer.allocUnsafeSlow`) in all versions of Node.js.** - -**Uses the built-in implementation when available.** - -## install - -``` -npm install safe-buffer -``` - -## usage - -The goal of this package is to provide a safe replacement for the node.js `Buffer`. - -It's a drop-in replacement for `Buffer`. You can use it by adding one `require` line to -the top of your node.js modules: - -```js -var Buffer = require('safe-buffer').Buffer - -// Existing buffer code will continue to work without issues: - -new Buffer('hey', 'utf8') -new Buffer([1, 2, 3], 'utf8') -new Buffer(obj) -new Buffer(16) // create an uninitialized buffer (potentially unsafe) - -// But you can use these new explicit APIs to make clear what you want: - -Buffer.from('hey', 'utf8') // convert from many types to a Buffer -Buffer.alloc(16) // create a zero-filled buffer (safe) -Buffer.allocUnsafe(16) // create an uninitialized buffer (potentially unsafe) -``` - -## api - -### Class Method: Buffer.from(array) - - -* `array` {Array} - -Allocates a new `Buffer` using an `array` of octets. - -```js -const buf = Buffer.from([0x62,0x75,0x66,0x66,0x65,0x72]); - // creates a new Buffer containing ASCII bytes - // ['b','u','f','f','e','r'] -``` - -A `TypeError` will be thrown if `array` is not an `Array`. - -### Class Method: Buffer.from(arrayBuffer[, byteOffset[, length]]) - - -* `arrayBuffer` {ArrayBuffer} The `.buffer` property of a `TypedArray` or - a `new ArrayBuffer()` -* `byteOffset` {Number} Default: `0` -* `length` {Number} Default: `arrayBuffer.length - byteOffset` - -When passed a reference to the `.buffer` property of a `TypedArray` instance, -the newly created `Buffer` will share the same allocated memory as the -TypedArray. - -```js -const arr = new Uint16Array(2); -arr[0] = 5000; -arr[1] = 4000; - -const buf = Buffer.from(arr.buffer); // shares the memory with arr; - -console.log(buf); - // Prints: - -// changing the TypedArray changes the Buffer also -arr[1] = 6000; - -console.log(buf); - // Prints: -``` - -The optional `byteOffset` and `length` arguments specify a memory range within -the `arrayBuffer` that will be shared by the `Buffer`. - -```js -const ab = new ArrayBuffer(10); -const buf = Buffer.from(ab, 0, 2); -console.log(buf.length); - // Prints: 2 -``` - -A `TypeError` will be thrown if `arrayBuffer` is not an `ArrayBuffer`. - -### Class Method: Buffer.from(buffer) - - -* `buffer` {Buffer} - -Copies the passed `buffer` data onto a new `Buffer` instance. - -```js -const buf1 = Buffer.from('buffer'); -const buf2 = Buffer.from(buf1); - -buf1[0] = 0x61; -console.log(buf1.toString()); - // 'auffer' -console.log(buf2.toString()); - // 'buffer' (copy is not changed) -``` - -A `TypeError` will be thrown if `buffer` is not a `Buffer`. - -### Class Method: Buffer.from(str[, encoding]) - - -* `str` {String} String to encode. -* `encoding` {String} Encoding to use, Default: `'utf8'` - -Creates a new `Buffer` containing the given JavaScript string `str`. If -provided, the `encoding` parameter identifies the character encoding. -If not provided, `encoding` defaults to `'utf8'`. - -```js -const buf1 = Buffer.from('this is a tést'); -console.log(buf1.toString()); - // prints: this is a tést -console.log(buf1.toString('ascii')); - // prints: this is a tC)st - -const buf2 = Buffer.from('7468697320697320612074c3a97374', 'hex'); -console.log(buf2.toString()); - // prints: this is a tést -``` - -A `TypeError` will be thrown if `str` is not a string. - -### Class Method: Buffer.alloc(size[, fill[, encoding]]) - - -* `size` {Number} -* `fill` {Value} Default: `undefined` -* `encoding` {String} Default: `utf8` - -Allocates a new `Buffer` of `size` bytes. If `fill` is `undefined`, the -`Buffer` will be *zero-filled*. - -```js -const buf = Buffer.alloc(5); -console.log(buf); - // -``` - -The `size` must be less than or equal to the value of -`require('buffer').kMaxLength` (on 64-bit architectures, `kMaxLength` is -`(2^31)-1`). Otherwise, a [`RangeError`][] is thrown. A zero-length Buffer will -be created if a `size` less than or equal to 0 is specified. - -If `fill` is specified, the allocated `Buffer` will be initialized by calling -`buf.fill(fill)`. See [`buf.fill()`][] for more information. - -```js -const buf = Buffer.alloc(5, 'a'); -console.log(buf); - // -``` - -If both `fill` and `encoding` are specified, the allocated `Buffer` will be -initialized by calling `buf.fill(fill, encoding)`. For example: - -```js -const buf = Buffer.alloc(11, 'aGVsbG8gd29ybGQ=', 'base64'); -console.log(buf); - // -``` - -Calling `Buffer.alloc(size)` can be significantly slower than the alternative -`Buffer.allocUnsafe(size)` but ensures that the newly created `Buffer` instance -contents will *never contain sensitive data*. - -A `TypeError` will be thrown if `size` is not a number. - -### Class Method: Buffer.allocUnsafe(size) - - -* `size` {Number} - -Allocates a new *non-zero-filled* `Buffer` of `size` bytes. The `size` must -be less than or equal to the value of `require('buffer').kMaxLength` (on 64-bit -architectures, `kMaxLength` is `(2^31)-1`). Otherwise, a [`RangeError`][] is -thrown. A zero-length Buffer will be created if a `size` less than or equal to -0 is specified. - -The underlying memory for `Buffer` instances created in this way is *not -initialized*. The contents of the newly created `Buffer` are unknown and -*may contain sensitive data*. Use [`buf.fill(0)`][] to initialize such -`Buffer` instances to zeroes. - -```js -const buf = Buffer.allocUnsafe(5); -console.log(buf); - // - // (octets will be different, every time) -buf.fill(0); -console.log(buf); - // -``` - -A `TypeError` will be thrown if `size` is not a number. - -Note that the `Buffer` module pre-allocates an internal `Buffer` instance of -size `Buffer.poolSize` that is used as a pool for the fast allocation of new -`Buffer` instances created using `Buffer.allocUnsafe(size)` (and the deprecated -`new Buffer(size)` constructor) only when `size` is less than or equal to -`Buffer.poolSize >> 1` (floor of `Buffer.poolSize` divided by two). The default -value of `Buffer.poolSize` is `8192` but can be modified. - -Use of this pre-allocated internal memory pool is a key difference between -calling `Buffer.alloc(size, fill)` vs. `Buffer.allocUnsafe(size).fill(fill)`. -Specifically, `Buffer.alloc(size, fill)` will *never* use the internal Buffer -pool, while `Buffer.allocUnsafe(size).fill(fill)` *will* use the internal -Buffer pool if `size` is less than or equal to half `Buffer.poolSize`. The -difference is subtle but can be important when an application requires the -additional performance that `Buffer.allocUnsafe(size)` provides. - -### Class Method: Buffer.allocUnsafeSlow(size) - - -* `size` {Number} - -Allocates a new *non-zero-filled* and non-pooled `Buffer` of `size` bytes. The -`size` must be less than or equal to the value of -`require('buffer').kMaxLength` (on 64-bit architectures, `kMaxLength` is -`(2^31)-1`). Otherwise, a [`RangeError`][] is thrown. A zero-length Buffer will -be created if a `size` less than or equal to 0 is specified. - -The underlying memory for `Buffer` instances created in this way is *not -initialized*. The contents of the newly created `Buffer` are unknown and -*may contain sensitive data*. Use [`buf.fill(0)`][] to initialize such -`Buffer` instances to zeroes. - -When using `Buffer.allocUnsafe()` to allocate new `Buffer` instances, -allocations under 4KB are, by default, sliced from a single pre-allocated -`Buffer`. This allows applications to avoid the garbage collection overhead of -creating many individually allocated Buffers. This approach improves both -performance and memory usage by eliminating the need to track and cleanup as -many `Persistent` objects. - -However, in the case where a developer may need to retain a small chunk of -memory from a pool for an indeterminate amount of time, it may be appropriate -to create an un-pooled Buffer instance using `Buffer.allocUnsafeSlow()` then -copy out the relevant bits. - -```js -// need to keep around a few small chunks of memory -const store = []; - -socket.on('readable', () => { - const data = socket.read(); - // allocate for retained data - const sb = Buffer.allocUnsafeSlow(10); - // copy the data into the new allocation - data.copy(sb, 0, 0, 10); - store.push(sb); -}); -``` - -Use of `Buffer.allocUnsafeSlow()` should be used only as a last resort *after* -a developer has observed undue memory retention in their applications. - -A `TypeError` will be thrown if `size` is not a number. - -### All the Rest - -The rest of the `Buffer` API is exactly the same as in node.js. -[See the docs](https://nodejs.org/api/buffer.html). - - -## Related links - -- [Node.js issue: Buffer(number) is unsafe](https://github.com/nodejs/node/issues/4660) -- [Node.js Enhancement Proposal: Buffer.from/Buffer.alloc/Buffer.zalloc/Buffer() soft-deprecate](https://github.com/nodejs/node-eps/pull/4) - -## Why is `Buffer` unsafe? - -Today, the node.js `Buffer` constructor is overloaded to handle many different argument -types like `String`, `Array`, `Object`, `TypedArrayView` (`Uint8Array`, etc.), -`ArrayBuffer`, and also `Number`. - -The API is optimized for convenience: you can throw any type at it, and it will try to do -what you want. - -Because the Buffer constructor is so powerful, you often see code like this: - -```js -// Convert UTF-8 strings to hex -function toHex (str) { - return new Buffer(str).toString('hex') -} -``` - -***But what happens if `toHex` is called with a `Number` argument?*** - -### Remote Memory Disclosure - -If an attacker can make your program call the `Buffer` constructor with a `Number` -argument, then they can make it allocate uninitialized memory from the node.js process. -This could potentially disclose TLS private keys, user data, or database passwords. - -When the `Buffer` constructor is passed a `Number` argument, it returns an -**UNINITIALIZED** block of memory of the specified `size`. When you create a `Buffer` like -this, you **MUST** overwrite the contents before returning it to the user. - -From the [node.js docs](https://nodejs.org/api/buffer.html#buffer_new_buffer_size): - -> `new Buffer(size)` -> -> - `size` Number -> -> The underlying memory for `Buffer` instances created in this way is not initialized. -> **The contents of a newly created `Buffer` are unknown and could contain sensitive -> data.** Use `buf.fill(0)` to initialize a Buffer to zeroes. - -(Emphasis our own.) - -Whenever the programmer intended to create an uninitialized `Buffer` you often see code -like this: - -```js -var buf = new Buffer(16) - -// Immediately overwrite the uninitialized buffer with data from another buffer -for (var i = 0; i < buf.length; i++) { - buf[i] = otherBuf[i] -} -``` - - -### Would this ever be a problem in real code? - -Yes. It's surprisingly common to forget to check the type of your variables in a -dynamically-typed language like JavaScript. - -Usually the consequences of assuming the wrong type is that your program crashes with an -uncaught exception. But the failure mode for forgetting to check the type of arguments to -the `Buffer` constructor is more catastrophic. - -Here's an example of a vulnerable service that takes a JSON payload and converts it to -hex: - -```js -// Take a JSON payload {str: "some string"} and convert it to hex -var server = http.createServer(function (req, res) { - var data = '' - req.setEncoding('utf8') - req.on('data', function (chunk) { - data += chunk - }) - req.on('end', function () { - var body = JSON.parse(data) - res.end(new Buffer(body.str).toString('hex')) - }) -}) - -server.listen(8080) -``` - -In this example, an http client just has to send: - -```json -{ - "str": 1000 -} -``` - -and it will get back 1,000 bytes of uninitialized memory from the server. - -This is a very serious bug. It's similar in severity to the -[the Heartbleed bug](http://heartbleed.com/) that allowed disclosure of OpenSSL process -memory by remote attackers. - - -### Which real-world packages were vulnerable? - -#### [`bittorrent-dht`](https://www.npmjs.com/package/bittorrent-dht) - -[Mathias Buus](https://github.com/mafintosh) and I -([Feross Aboukhadijeh](http://feross.org/)) found this issue in one of our own packages, -[`bittorrent-dht`](https://www.npmjs.com/package/bittorrent-dht). The bug would allow -anyone on the internet to send a series of messages to a user of `bittorrent-dht` and get -them to reveal 20 bytes at a time of uninitialized memory from the node.js process. - -Here's -[the commit](https://github.com/feross/bittorrent-dht/commit/6c7da04025d5633699800a99ec3fbadf70ad35b8) -that fixed it. We released a new fixed version, created a -[Node Security Project disclosure](https://nodesecurity.io/advisories/68), and deprecated all -vulnerable versions on npm so users will get a warning to upgrade to a newer version. - -#### [`ws`](https://www.npmjs.com/package/ws) - -That got us wondering if there were other vulnerable packages. Sure enough, within a short -period of time, we found the same issue in [`ws`](https://www.npmjs.com/package/ws), the -most popular WebSocket implementation in node.js. - -If certain APIs were called with `Number` parameters instead of `String` or `Buffer` as -expected, then uninitialized server memory would be disclosed to the remote peer. - -These were the vulnerable methods: - -```js -socket.send(number) -socket.ping(number) -socket.pong(number) -``` - -Here's a vulnerable socket server with some echo functionality: - -```js -server.on('connection', function (socket) { - socket.on('message', function (message) { - message = JSON.parse(message) - if (message.type === 'echo') { - socket.send(message.data) // send back the user's message - } - }) -}) -``` - -`socket.send(number)` called on the server, will disclose server memory. - -Here's [the release](https://github.com/websockets/ws/releases/tag/1.0.1) where the issue -was fixed, with a more detailed explanation. Props to -[Arnout Kazemier](https://github.com/3rd-Eden) for the quick fix. Here's the -[Node Security Project disclosure](https://nodesecurity.io/advisories/67). - - -### What's the solution? - -It's important that node.js offers a fast way to get memory otherwise performance-critical -applications would needlessly get a lot slower. - -But we need a better way to *signal our intent* as programmers. **When we want -uninitialized memory, we should request it explicitly.** - -Sensitive functionality should not be packed into a developer-friendly API that loosely -accepts many different types. This type of API encourages the lazy practice of passing -variables in without checking the type very carefully. - -#### A new API: `Buffer.allocUnsafe(number)` - -The functionality of creating buffers with uninitialized memory should be part of another -API. We propose `Buffer.allocUnsafe(number)`. This way, it's not part of an API that -frequently gets user input of all sorts of different types passed into it. - -```js -var buf = Buffer.allocUnsafe(16) // careful, uninitialized memory! - -// Immediately overwrite the uninitialized buffer with data from another buffer -for (var i = 0; i < buf.length; i++) { - buf[i] = otherBuf[i] -} -``` - - -### How do we fix node.js core? - -We sent [a PR to node.js core](https://github.com/nodejs/node/pull/4514) (merged as -`semver-major`) which defends against one case: - -```js -var str = 16 -new Buffer(str, 'utf8') -``` - -In this situation, it's implied that the programmer intended the first argument to be a -string, since they passed an encoding as a second argument. Today, node.js will allocate -uninitialized memory in the case of `new Buffer(number, encoding)`, which is probably not -what the programmer intended. - -But this is only a partial solution, since if the programmer does `new Buffer(variable)` -(without an `encoding` parameter) there's no way to know what they intended. If `variable` -is sometimes a number, then uninitialized memory will sometimes be returned. - -### What's the real long-term fix? - -We could deprecate and remove `new Buffer(number)` and use `Buffer.allocUnsafe(number)` when -we need uninitialized memory. But that would break 1000s of packages. - -~~We believe the best solution is to:~~ - -~~1. Change `new Buffer(number)` to return safe, zeroed-out memory~~ - -~~2. Create a new API for creating uninitialized Buffers. We propose: `Buffer.allocUnsafe(number)`~~ - -#### Update - -We now support adding three new APIs: - -- `Buffer.from(value)` - convert from any type to a buffer -- `Buffer.alloc(size)` - create a zero-filled buffer -- `Buffer.allocUnsafe(size)` - create an uninitialized buffer with given size - -This solves the core problem that affected `ws` and `bittorrent-dht` which is -`Buffer(variable)` getting tricked into taking a number argument. - -This way, existing code continues working and the impact on the npm ecosystem will be -minimal. Over time, npm maintainers can migrate performance-critical code to use -`Buffer.allocUnsafe(number)` instead of `new Buffer(number)`. - - -### Conclusion - -We think there's a serious design issue with the `Buffer` API as it exists today. It -promotes insecure software by putting high-risk functionality into a convenient API -with friendly "developer ergonomics". - -This wasn't merely a theoretical exercise because we found the issue in some of the -most popular npm packages. - -Fortunately, there's an easy fix that can be applied today. Use `safe-buffer` in place of -`buffer`. - -```js -var Buffer = require('safe-buffer').Buffer -``` - -Eventually, we hope that node.js core can switch to this new, safer behavior. We believe -the impact on the ecosystem would be minimal since it's not a breaking change. -Well-maintained, popular packages would be updated to use `Buffer.alloc` quickly, while -older, insecure packages would magically become safe from this attack vector. - - -## links - -- [Node.js PR: buffer: throw if both length and enc are passed](https://github.com/nodejs/node/pull/4514) -- [Node Security Project disclosure for `ws`](https://nodesecurity.io/advisories/67) -- [Node Security Project disclosure for`bittorrent-dht`](https://nodesecurity.io/advisories/68) - - -## credit - -The original issues in `bittorrent-dht` -([disclosure](https://nodesecurity.io/advisories/68)) and -`ws` ([disclosure](https://nodesecurity.io/advisories/67)) were discovered by -[Mathias Buus](https://github.com/mafintosh) and -[Feross Aboukhadijeh](http://feross.org/). - -Thanks to [Adam Baldwin](https://github.com/evilpacket) for helping disclose these issues -and for his work running the [Node Security Project](https://nodesecurity.io/). - -Thanks to [John Hiesey](https://github.com/jhiesey) for proofreading this README and -auditing the code. - - -## license - -MIT. Copyright (C) [Feross Aboukhadijeh](http://feross.org) diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/safe-buffer/index.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/safe-buffer/index.d.ts deleted file mode 100644 index e9fed809..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/safe-buffer/index.d.ts +++ /dev/null @@ -1,187 +0,0 @@ -declare module "safe-buffer" { - export class Buffer { - length: number - write(string: string, offset?: number, length?: number, encoding?: string): number; - toString(encoding?: string, start?: number, end?: number): string; - toJSON(): { type: 'Buffer', data: any[] }; - equals(otherBuffer: Buffer): boolean; - compare(otherBuffer: Buffer, targetStart?: number, targetEnd?: number, sourceStart?: number, sourceEnd?: number): number; - copy(targetBuffer: Buffer, targetStart?: number, sourceStart?: number, sourceEnd?: number): number; - slice(start?: number, end?: number): Buffer; - writeUIntLE(value: number, offset: number, byteLength: number, noAssert?: boolean): number; - writeUIntBE(value: number, offset: number, byteLength: number, noAssert?: boolean): number; - writeIntLE(value: number, offset: number, byteLength: number, noAssert?: boolean): number; - writeIntBE(value: number, offset: number, byteLength: number, noAssert?: boolean): number; - readUIntLE(offset: number, byteLength: number, noAssert?: boolean): number; - readUIntBE(offset: number, byteLength: number, noAssert?: boolean): number; - readIntLE(offset: number, byteLength: number, noAssert?: boolean): number; - readIntBE(offset: number, byteLength: number, noAssert?: boolean): number; - readUInt8(offset: number, noAssert?: boolean): number; - readUInt16LE(offset: number, noAssert?: boolean): number; - readUInt16BE(offset: number, noAssert?: boolean): number; - readUInt32LE(offset: number, noAssert?: boolean): number; - readUInt32BE(offset: number, noAssert?: boolean): number; - readInt8(offset: number, noAssert?: boolean): number; - readInt16LE(offset: number, noAssert?: boolean): number; - readInt16BE(offset: number, noAssert?: boolean): number; - readInt32LE(offset: number, noAssert?: boolean): number; - readInt32BE(offset: number, noAssert?: boolean): number; - readFloatLE(offset: number, noAssert?: boolean): number; - readFloatBE(offset: number, noAssert?: boolean): number; - readDoubleLE(offset: number, noAssert?: boolean): number; - readDoubleBE(offset: number, noAssert?: boolean): number; - swap16(): Buffer; - swap32(): Buffer; - swap64(): Buffer; - writeUInt8(value: number, offset: number, noAssert?: boolean): number; - writeUInt16LE(value: number, offset: number, noAssert?: boolean): number; - writeUInt16BE(value: number, offset: number, noAssert?: boolean): number; - writeUInt32LE(value: number, offset: number, noAssert?: boolean): number; - writeUInt32BE(value: number, offset: number, noAssert?: boolean): number; - writeInt8(value: number, offset: number, noAssert?: boolean): number; - writeInt16LE(value: number, offset: number, noAssert?: boolean): number; - writeInt16BE(value: number, offset: number, noAssert?: boolean): number; - writeInt32LE(value: number, offset: number, noAssert?: boolean): number; - writeInt32BE(value: number, offset: number, noAssert?: boolean): number; - writeFloatLE(value: number, offset: number, noAssert?: boolean): number; - writeFloatBE(value: number, offset: number, noAssert?: boolean): number; - writeDoubleLE(value: number, offset: number, noAssert?: boolean): number; - writeDoubleBE(value: number, offset: number, noAssert?: boolean): number; - fill(value: any, offset?: number, end?: number): this; - indexOf(value: string | number | Buffer, byteOffset?: number, encoding?: string): number; - lastIndexOf(value: string | number | Buffer, byteOffset?: number, encoding?: string): number; - includes(value: string | number | Buffer, byteOffset?: number, encoding?: string): boolean; - - /** - * Allocates a new buffer containing the given {str}. - * - * @param str String to store in buffer. - * @param encoding encoding to use, optional. Default is 'utf8' - */ - constructor (str: string, encoding?: string); - /** - * Allocates a new buffer of {size} octets. - * - * @param size count of octets to allocate. - */ - constructor (size: number); - /** - * Allocates a new buffer containing the given {array} of octets. - * - * @param array The octets to store. - */ - constructor (array: Uint8Array); - /** - * Produces a Buffer backed by the same allocated memory as - * the given {ArrayBuffer}. - * - * - * @param arrayBuffer The ArrayBuffer with which to share memory. - */ - constructor (arrayBuffer: ArrayBuffer); - /** - * Allocates a new buffer containing the given {array} of octets. - * - * @param array The octets to store. - */ - constructor (array: any[]); - /** - * Copies the passed {buffer} data onto a new {Buffer} instance. - * - * @param buffer The buffer to copy. - */ - constructor (buffer: Buffer); - prototype: Buffer; - /** - * Allocates a new Buffer using an {array} of octets. - * - * @param array - */ - static from(array: any[]): Buffer; - /** - * When passed a reference to the .buffer property of a TypedArray instance, - * the newly created Buffer will share the same allocated memory as the TypedArray. - * The optional {byteOffset} and {length} arguments specify a memory range - * within the {arrayBuffer} that will be shared by the Buffer. - * - * @param arrayBuffer The .buffer property of a TypedArray or a new ArrayBuffer() - * @param byteOffset - * @param length - */ - static from(arrayBuffer: ArrayBuffer, byteOffset?: number, length?: number): Buffer; - /** - * Copies the passed {buffer} data onto a new Buffer instance. - * - * @param buffer - */ - static from(buffer: Buffer): Buffer; - /** - * Creates a new Buffer containing the given JavaScript string {str}. - * If provided, the {encoding} parameter identifies the character encoding. - * If not provided, {encoding} defaults to 'utf8'. - * - * @param str - */ - static from(str: string, encoding?: string): Buffer; - /** - * Returns true if {obj} is a Buffer - * - * @param obj object to test. - */ - static isBuffer(obj: any): obj is Buffer; - /** - * Returns true if {encoding} is a valid encoding argument. - * Valid string encodings in Node 0.12: 'ascii'|'utf8'|'utf16le'|'ucs2'(alias of 'utf16le')|'base64'|'binary'(deprecated)|'hex' - * - * @param encoding string to test. - */ - static isEncoding(encoding: string): boolean; - /** - * Gives the actual byte length of a string. encoding defaults to 'utf8'. - * This is not the same as String.prototype.length since that returns the number of characters in a string. - * - * @param string string to test. - * @param encoding encoding used to evaluate (defaults to 'utf8') - */ - static byteLength(string: string, encoding?: string): number; - /** - * Returns a buffer which is the result of concatenating all the buffers in the list together. - * - * If the list has no items, or if the totalLength is 0, then it returns a zero-length buffer. - * If the list has exactly one item, then the first item of the list is returned. - * If the list has more than one item, then a new Buffer is created. - * - * @param list An array of Buffer objects to concatenate - * @param totalLength Total length of the buffers when concatenated. - * If totalLength is not provided, it is read from the buffers in the list. However, this adds an additional loop to the function, so it is faster to provide the length explicitly. - */ - static concat(list: Buffer[], totalLength?: number): Buffer; - /** - * The same as buf1.compare(buf2). - */ - static compare(buf1: Buffer, buf2: Buffer): number; - /** - * Allocates a new buffer of {size} octets. - * - * @param size count of octets to allocate. - * @param fill if specified, buffer will be initialized by calling buf.fill(fill). - * If parameter is omitted, buffer will be filled with zeros. - * @param encoding encoding used for call to buf.fill while initalizing - */ - static alloc(size: number, fill?: string | Buffer | number, encoding?: string): Buffer; - /** - * Allocates a new buffer of {size} octets, leaving memory not initialized, so the contents - * of the newly created Buffer are unknown and may contain sensitive data. - * - * @param size count of octets to allocate - */ - static allocUnsafe(size: number): Buffer; - /** - * Allocates a new non-pooled buffer of {size} octets, leaving memory not initialized, so the contents - * of the newly created Buffer are unknown and may contain sensitive data. - * - * @param size count of octets to allocate - */ - static allocUnsafeSlow(size: number): Buffer; - } -} \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/safe-buffer/index.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/safe-buffer/index.js deleted file mode 100644 index f8d3ec98..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/safe-buffer/index.js +++ /dev/null @@ -1,65 +0,0 @@ -/*! safe-buffer. MIT License. Feross Aboukhadijeh */ -/* eslint-disable node/no-deprecated-api */ -var buffer = require('buffer') -var Buffer = buffer.Buffer - -// alternative to using Object.keys for old browsers -function copyProps (src, dst) { - for (var key in src) { - dst[key] = src[key] - } -} -if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) { - module.exports = buffer -} else { - // Copy properties from require('buffer') - copyProps(buffer, exports) - exports.Buffer = SafeBuffer -} - -function SafeBuffer (arg, encodingOrOffset, length) { - return Buffer(arg, encodingOrOffset, length) -} - -SafeBuffer.prototype = Object.create(Buffer.prototype) - -// Copy static methods from Buffer -copyProps(Buffer, SafeBuffer) - -SafeBuffer.from = function (arg, encodingOrOffset, length) { - if (typeof arg === 'number') { - throw new TypeError('Argument must not be a number') - } - return Buffer(arg, encodingOrOffset, length) -} - -SafeBuffer.alloc = function (size, fill, encoding) { - if (typeof size !== 'number') { - throw new TypeError('Argument must be a number') - } - var buf = Buffer(size) - if (fill !== undefined) { - if (typeof encoding === 'string') { - buf.fill(fill, encoding) - } else { - buf.fill(fill) - } - } else { - buf.fill(0) - } - return buf -} - -SafeBuffer.allocUnsafe = function (size) { - if (typeof size !== 'number') { - throw new TypeError('Argument must be a number') - } - return Buffer(size) -} - -SafeBuffer.allocUnsafeSlow = function (size) { - if (typeof size !== 'number') { - throw new TypeError('Argument must be a number') - } - return buffer.SlowBuffer(size) -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/safe-buffer/package.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/safe-buffer/package.json deleted file mode 100644 index f2869e25..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/safe-buffer/package.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "name": "safe-buffer", - "description": "Safer Node.js Buffer API", - "version": "5.2.1", - "author": { - "name": "Feross Aboukhadijeh", - "email": "feross@feross.org", - "url": "https://feross.org" - }, - "bugs": { - "url": "https://github.com/feross/safe-buffer/issues" - }, - "devDependencies": { - "standard": "*", - "tape": "^5.0.0" - }, - "homepage": "https://github.com/feross/safe-buffer", - "keywords": [ - "buffer", - "buffer allocate", - "node security", - "safe", - "safe-buffer", - "security", - "uninitialized" - ], - "license": "MIT", - "main": "index.js", - "types": "index.d.ts", - "repository": { - "type": "git", - "url": "git://github.com/feross/safe-buffer.git" - }, - "scripts": { - "test": "standard && tape test/*.js" - }, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/semver/CHANGELOG.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/semver/CHANGELOG.md deleted file mode 100644 index 66304fdd..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/semver/CHANGELOG.md +++ /dev/null @@ -1,39 +0,0 @@ -# changes log - -## 5.7 - -* Add `minVersion` method - -## 5.6 - -* Move boolean `loose` param to an options object, with - backwards-compatibility protection. -* Add ability to opt out of special prerelease version handling with - the `includePrerelease` option flag. - -## 5.5 - -* Add version coercion capabilities - -## 5.4 - -* Add intersection checking - -## 5.3 - -* Add `minSatisfying` method - -## 5.2 - -* Add `prerelease(v)` that returns prerelease components - -## 5.1 - -* Add Backus-Naur for ranges -* Remove excessively cute inspection methods - -## 5.0 - -* Remove AMD/Browserified build artifacts -* Fix ltr and gtr when using the `*` range -* Fix for range `*` with a prerelease identifier diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/semver/LICENSE b/packages/wyatt_notification_bloc/example/scripts/node_modules/semver/LICENSE deleted file mode 100644 index 19129e31..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/semver/LICENSE +++ /dev/null @@ -1,15 +0,0 @@ -The ISC License - -Copyright (c) Isaac Z. Schlueter and Contributors - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR -IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/semver/README.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/semver/README.md deleted file mode 100644 index f8dfa5a0..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/semver/README.md +++ /dev/null @@ -1,412 +0,0 @@ -semver(1) -- The semantic versioner for npm -=========================================== - -## Install - -```bash -npm install --save semver -```` - -## Usage - -As a node module: - -```js -const semver = require('semver') - -semver.valid('1.2.3') // '1.2.3' -semver.valid('a.b.c') // null -semver.clean(' =v1.2.3 ') // '1.2.3' -semver.satisfies('1.2.3', '1.x || >=2.5.0 || 5.0.0 - 7.2.3') // true -semver.gt('1.2.3', '9.8.7') // false -semver.lt('1.2.3', '9.8.7') // true -semver.minVersion('>=1.0.0') // '1.0.0' -semver.valid(semver.coerce('v2')) // '2.0.0' -semver.valid(semver.coerce('42.6.7.9.3-alpha')) // '42.6.7' -``` - -As a command-line utility: - -``` -$ semver -h - -A JavaScript implementation of the https://semver.org/ specification -Copyright Isaac Z. Schlueter - -Usage: semver [options] [ [...]] -Prints valid versions sorted by SemVer precedence - -Options: --r --range - Print versions that match the specified range. - --i --increment [] - Increment a version by the specified level. Level can - be one of: major, minor, patch, premajor, preminor, - prepatch, or prerelease. Default level is 'patch'. - Only one version may be specified. - ---preid - Identifier to be used to prefix premajor, preminor, - prepatch or prerelease version increments. - --l --loose - Interpret versions and ranges loosely - --p --include-prerelease - Always include prerelease versions in range matching - --c --coerce - Coerce a string into SemVer if possible - (does not imply --loose) - -Program exits successfully if any valid version satisfies -all supplied ranges, and prints all satisfying versions. - -If no satisfying versions are found, then exits failure. - -Versions are printed in ascending order, so supplying -multiple versions to the utility will just sort them. -``` - -## Versions - -A "version" is described by the `v2.0.0` specification found at -. - -A leading `"="` or `"v"` character is stripped off and ignored. - -## Ranges - -A `version range` is a set of `comparators` which specify versions -that satisfy the range. - -A `comparator` is composed of an `operator` and a `version`. The set -of primitive `operators` is: - -* `<` Less than -* `<=` Less than or equal to -* `>` Greater than -* `>=` Greater than or equal to -* `=` Equal. If no operator is specified, then equality is assumed, - so this operator is optional, but MAY be included. - -For example, the comparator `>=1.2.7` would match the versions -`1.2.7`, `1.2.8`, `2.5.3`, and `1.3.9`, but not the versions `1.2.6` -or `1.1.0`. - -Comparators can be joined by whitespace to form a `comparator set`, -which is satisfied by the **intersection** of all of the comparators -it includes. - -A range is composed of one or more comparator sets, joined by `||`. A -version matches a range if and only if every comparator in at least -one of the `||`-separated comparator sets is satisfied by the version. - -For example, the range `>=1.2.7 <1.3.0` would match the versions -`1.2.7`, `1.2.8`, and `1.2.99`, but not the versions `1.2.6`, `1.3.0`, -or `1.1.0`. - -The range `1.2.7 || >=1.2.9 <2.0.0` would match the versions `1.2.7`, -`1.2.9`, and `1.4.6`, but not the versions `1.2.8` or `2.0.0`. - -### Prerelease Tags - -If a version has a prerelease tag (for example, `1.2.3-alpha.3`) then -it will only be allowed to satisfy comparator sets if at least one -comparator with the same `[major, minor, patch]` tuple also has a -prerelease tag. - -For example, the range `>1.2.3-alpha.3` would be allowed to match the -version `1.2.3-alpha.7`, but it would *not* be satisfied by -`3.4.5-alpha.9`, even though `3.4.5-alpha.9` is technically "greater -than" `1.2.3-alpha.3` according to the SemVer sort rules. The version -range only accepts prerelease tags on the `1.2.3` version. The -version `3.4.5` *would* satisfy the range, because it does not have a -prerelease flag, and `3.4.5` is greater than `1.2.3-alpha.7`. - -The purpose for this behavior is twofold. First, prerelease versions -frequently are updated very quickly, and contain many breaking changes -that are (by the author's design) not yet fit for public consumption. -Therefore, by default, they are excluded from range matching -semantics. - -Second, a user who has opted into using a prerelease version has -clearly indicated the intent to use *that specific* set of -alpha/beta/rc versions. By including a prerelease tag in the range, -the user is indicating that they are aware of the risk. However, it -is still not appropriate to assume that they have opted into taking a -similar risk on the *next* set of prerelease versions. - -Note that this behavior can be suppressed (treating all prerelease -versions as if they were normal versions, for the purpose of range -matching) by setting the `includePrerelease` flag on the options -object to any -[functions](https://github.com/npm/node-semver#functions) that do -range matching. - -#### Prerelease Identifiers - -The method `.inc` takes an additional `identifier` string argument that -will append the value of the string as a prerelease identifier: - -```javascript -semver.inc('1.2.3', 'prerelease', 'beta') -// '1.2.4-beta.0' -``` - -command-line example: - -```bash -$ semver 1.2.3 -i prerelease --preid beta -1.2.4-beta.0 -``` - -Which then can be used to increment further: - -```bash -$ semver 1.2.4-beta.0 -i prerelease -1.2.4-beta.1 -``` - -### Advanced Range Syntax - -Advanced range syntax desugars to primitive comparators in -deterministic ways. - -Advanced ranges may be combined in the same way as primitive -comparators using white space or `||`. - -#### Hyphen Ranges `X.Y.Z - A.B.C` - -Specifies an inclusive set. - -* `1.2.3 - 2.3.4` := `>=1.2.3 <=2.3.4` - -If a partial version is provided as the first version in the inclusive -range, then the missing pieces are replaced with zeroes. - -* `1.2 - 2.3.4` := `>=1.2.0 <=2.3.4` - -If a partial version is provided as the second version in the -inclusive range, then all versions that start with the supplied parts -of the tuple are accepted, but nothing that would be greater than the -provided tuple parts. - -* `1.2.3 - 2.3` := `>=1.2.3 <2.4.0` -* `1.2.3 - 2` := `>=1.2.3 <3.0.0` - -#### X-Ranges `1.2.x` `1.X` `1.2.*` `*` - -Any of `X`, `x`, or `*` may be used to "stand in" for one of the -numeric values in the `[major, minor, patch]` tuple. - -* `*` := `>=0.0.0` (Any version satisfies) -* `1.x` := `>=1.0.0 <2.0.0` (Matching major version) -* `1.2.x` := `>=1.2.0 <1.3.0` (Matching major and minor versions) - -A partial version range is treated as an X-Range, so the special -character is in fact optional. - -* `""` (empty string) := `*` := `>=0.0.0` -* `1` := `1.x.x` := `>=1.0.0 <2.0.0` -* `1.2` := `1.2.x` := `>=1.2.0 <1.3.0` - -#### Tilde Ranges `~1.2.3` `~1.2` `~1` - -Allows patch-level changes if a minor version is specified on the -comparator. Allows minor-level changes if not. - -* `~1.2.3` := `>=1.2.3 <1.(2+1).0` := `>=1.2.3 <1.3.0` -* `~1.2` := `>=1.2.0 <1.(2+1).0` := `>=1.2.0 <1.3.0` (Same as `1.2.x`) -* `~1` := `>=1.0.0 <(1+1).0.0` := `>=1.0.0 <2.0.0` (Same as `1.x`) -* `~0.2.3` := `>=0.2.3 <0.(2+1).0` := `>=0.2.3 <0.3.0` -* `~0.2` := `>=0.2.0 <0.(2+1).0` := `>=0.2.0 <0.3.0` (Same as `0.2.x`) -* `~0` := `>=0.0.0 <(0+1).0.0` := `>=0.0.0 <1.0.0` (Same as `0.x`) -* `~1.2.3-beta.2` := `>=1.2.3-beta.2 <1.3.0` Note that prereleases in - the `1.2.3` version will be allowed, if they are greater than or - equal to `beta.2`. So, `1.2.3-beta.4` would be allowed, but - `1.2.4-beta.2` would not, because it is a prerelease of a - different `[major, minor, patch]` tuple. - -#### Caret Ranges `^1.2.3` `^0.2.5` `^0.0.4` - -Allows changes that do not modify the left-most non-zero digit in the -`[major, minor, patch]` tuple. In other words, this allows patch and -minor updates for versions `1.0.0` and above, patch updates for -versions `0.X >=0.1.0`, and *no* updates for versions `0.0.X`. - -Many authors treat a `0.x` version as if the `x` were the major -"breaking-change" indicator. - -Caret ranges are ideal when an author may make breaking changes -between `0.2.4` and `0.3.0` releases, which is a common practice. -However, it presumes that there will *not* be breaking changes between -`0.2.4` and `0.2.5`. It allows for changes that are presumed to be -additive (but non-breaking), according to commonly observed practices. - -* `^1.2.3` := `>=1.2.3 <2.0.0` -* `^0.2.3` := `>=0.2.3 <0.3.0` -* `^0.0.3` := `>=0.0.3 <0.0.4` -* `^1.2.3-beta.2` := `>=1.2.3-beta.2 <2.0.0` Note that prereleases in - the `1.2.3` version will be allowed, if they are greater than or - equal to `beta.2`. So, `1.2.3-beta.4` would be allowed, but - `1.2.4-beta.2` would not, because it is a prerelease of a - different `[major, minor, patch]` tuple. -* `^0.0.3-beta` := `>=0.0.3-beta <0.0.4` Note that prereleases in the - `0.0.3` version *only* will be allowed, if they are greater than or - equal to `beta`. So, `0.0.3-pr.2` would be allowed. - -When parsing caret ranges, a missing `patch` value desugars to the -number `0`, but will allow flexibility within that value, even if the -major and minor versions are both `0`. - -* `^1.2.x` := `>=1.2.0 <2.0.0` -* `^0.0.x` := `>=0.0.0 <0.1.0` -* `^0.0` := `>=0.0.0 <0.1.0` - -A missing `minor` and `patch` values will desugar to zero, but also -allow flexibility within those values, even if the major version is -zero. - -* `^1.x` := `>=1.0.0 <2.0.0` -* `^0.x` := `>=0.0.0 <1.0.0` - -### Range Grammar - -Putting all this together, here is a Backus-Naur grammar for ranges, -for the benefit of parser authors: - -```bnf -range-set ::= range ( logical-or range ) * -logical-or ::= ( ' ' ) * '||' ( ' ' ) * -range ::= hyphen | simple ( ' ' simple ) * | '' -hyphen ::= partial ' - ' partial -simple ::= primitive | partial | tilde | caret -primitive ::= ( '<' | '>' | '>=' | '<=' | '=' ) partial -partial ::= xr ( '.' xr ( '.' xr qualifier ? )? )? -xr ::= 'x' | 'X' | '*' | nr -nr ::= '0' | ['1'-'9'] ( ['0'-'9'] ) * -tilde ::= '~' partial -caret ::= '^' partial -qualifier ::= ( '-' pre )? ( '+' build )? -pre ::= parts -build ::= parts -parts ::= part ( '.' part ) * -part ::= nr | [-0-9A-Za-z]+ -``` - -## Functions - -All methods and classes take a final `options` object argument. All -options in this object are `false` by default. The options supported -are: - -- `loose` Be more forgiving about not-quite-valid semver strings. - (Any resulting output will always be 100% strict compliant, of - course.) For backwards compatibility reasons, if the `options` - argument is a boolean value instead of an object, it is interpreted - to be the `loose` param. -- `includePrerelease` Set to suppress the [default - behavior](https://github.com/npm/node-semver#prerelease-tags) of - excluding prerelease tagged versions from ranges unless they are - explicitly opted into. - -Strict-mode Comparators and Ranges will be strict about the SemVer -strings that they parse. - -* `valid(v)`: Return the parsed version, or null if it's not valid. -* `inc(v, release)`: Return the version incremented by the release - type (`major`, `premajor`, `minor`, `preminor`, `patch`, - `prepatch`, or `prerelease`), or null if it's not valid - * `premajor` in one call will bump the version up to the next major - version and down to a prerelease of that major version. - `preminor`, and `prepatch` work the same way. - * If called from a non-prerelease version, the `prerelease` will work the - same as `prepatch`. It increments the patch version, then makes a - prerelease. If the input version is already a prerelease it simply - increments it. -* `prerelease(v)`: Returns an array of prerelease components, or null - if none exist. Example: `prerelease('1.2.3-alpha.1') -> ['alpha', 1]` -* `major(v)`: Return the major version number. -* `minor(v)`: Return the minor version number. -* `patch(v)`: Return the patch version number. -* `intersects(r1, r2, loose)`: Return true if the two supplied ranges - or comparators intersect. -* `parse(v)`: Attempt to parse a string as a semantic version, returning either - a `SemVer` object or `null`. - -### Comparison - -* `gt(v1, v2)`: `v1 > v2` -* `gte(v1, v2)`: `v1 >= v2` -* `lt(v1, v2)`: `v1 < v2` -* `lte(v1, v2)`: `v1 <= v2` -* `eq(v1, v2)`: `v1 == v2` This is true if they're logically equivalent, - even if they're not the exact same string. You already know how to - compare strings. -* `neq(v1, v2)`: `v1 != v2` The opposite of `eq`. -* `cmp(v1, comparator, v2)`: Pass in a comparison string, and it'll call - the corresponding function above. `"==="` and `"!=="` do simple - string comparison, but are included for completeness. Throws if an - invalid comparison string is provided. -* `compare(v1, v2)`: Return `0` if `v1 == v2`, or `1` if `v1` is greater, or `-1` if - `v2` is greater. Sorts in ascending order if passed to `Array.sort()`. -* `rcompare(v1, v2)`: The reverse of compare. Sorts an array of versions - in descending order when passed to `Array.sort()`. -* `diff(v1, v2)`: Returns difference between two versions by the release type - (`major`, `premajor`, `minor`, `preminor`, `patch`, `prepatch`, or `prerelease`), - or null if the versions are the same. - -### Comparators - -* `intersects(comparator)`: Return true if the comparators intersect - -### Ranges - -* `validRange(range)`: Return the valid range or null if it's not valid -* `satisfies(version, range)`: Return true if the version satisfies the - range. -* `maxSatisfying(versions, range)`: Return the highest version in the list - that satisfies the range, or `null` if none of them do. -* `minSatisfying(versions, range)`: Return the lowest version in the list - that satisfies the range, or `null` if none of them do. -* `minVersion(range)`: Return the lowest version that can possibly match - the given range. -* `gtr(version, range)`: Return `true` if version is greater than all the - versions possible in the range. -* `ltr(version, range)`: Return `true` if version is less than all the - versions possible in the range. -* `outside(version, range, hilo)`: Return true if the version is outside - the bounds of the range in either the high or low direction. The - `hilo` argument must be either the string `'>'` or `'<'`. (This is - the function called by `gtr` and `ltr`.) -* `intersects(range)`: Return true if any of the ranges comparators intersect - -Note that, since ranges may be non-contiguous, a version might not be -greater than a range, less than a range, *or* satisfy a range! For -example, the range `1.2 <1.2.9 || >2.0.0` would have a hole from `1.2.9` -until `2.0.0`, so the version `1.2.10` would not be greater than the -range (because `2.0.1` satisfies, which is higher), nor less than the -range (since `1.2.8` satisfies, which is lower), and it also does not -satisfy the range. - -If you want to know if a version satisfies or does not satisfy a -range, use the `satisfies(version, range)` function. - -### Coercion - -* `coerce(version)`: Coerces a string to semver if possible - -This aims to provide a very forgiving translation of a non-semver string to -semver. It looks for the first digit in a string, and consumes all -remaining characters which satisfy at least a partial semver (e.g., `1`, -`1.2`, `1.2.3`) up to the max permitted length (256 characters). Longer -versions are simply truncated (`4.6.3.9.2-alpha2` becomes `4.6.3`). All -surrounding text is simply ignored (`v3.4 replaces v3.3.1` becomes -`3.4.0`). Only text which lacks digits will fail coercion (`version one` -is not valid). The maximum length for any semver component considered for -coercion is 16 characters; longer components will be ignored -(`10000000000000000.4.7.4` becomes `4.7.4`). The maximum value for any -semver component is `Number.MAX_SAFE_INTEGER || (2**53 - 1)`; higher value -components are invalid (`9999999999999999.4.7.4` is likely invalid). diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/semver/bin/semver b/packages/wyatt_notification_bloc/example/scripts/node_modules/semver/bin/semver deleted file mode 100755 index 801e77f1..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/semver/bin/semver +++ /dev/null @@ -1,160 +0,0 @@ -#!/usr/bin/env node -// Standalone semver comparison program. -// Exits successfully and prints matching version(s) if -// any supplied version is valid and passes all tests. - -var argv = process.argv.slice(2) - -var versions = [] - -var range = [] - -var inc = null - -var version = require('../package.json').version - -var loose = false - -var includePrerelease = false - -var coerce = false - -var identifier - -var semver = require('../semver') - -var reverse = false - -var options = {} - -main() - -function main () { - if (!argv.length) return help() - while (argv.length) { - var a = argv.shift() - var indexOfEqualSign = a.indexOf('=') - if (indexOfEqualSign !== -1) { - a = a.slice(0, indexOfEqualSign) - argv.unshift(a.slice(indexOfEqualSign + 1)) - } - switch (a) { - case '-rv': case '-rev': case '--rev': case '--reverse': - reverse = true - break - case '-l': case '--loose': - loose = true - break - case '-p': case '--include-prerelease': - includePrerelease = true - break - case '-v': case '--version': - versions.push(argv.shift()) - break - case '-i': case '--inc': case '--increment': - switch (argv[0]) { - case 'major': case 'minor': case 'patch': case 'prerelease': - case 'premajor': case 'preminor': case 'prepatch': - inc = argv.shift() - break - default: - inc = 'patch' - break - } - break - case '--preid': - identifier = argv.shift() - break - case '-r': case '--range': - range.push(argv.shift()) - break - case '-c': case '--coerce': - coerce = true - break - case '-h': case '--help': case '-?': - return help() - default: - versions.push(a) - break - } - } - - var options = { loose: loose, includePrerelease: includePrerelease } - - versions = versions.map(function (v) { - return coerce ? (semver.coerce(v) || { version: v }).version : v - }).filter(function (v) { - return semver.valid(v) - }) - if (!versions.length) return fail() - if (inc && (versions.length !== 1 || range.length)) { return failInc() } - - for (var i = 0, l = range.length; i < l; i++) { - versions = versions.filter(function (v) { - return semver.satisfies(v, range[i], options) - }) - if (!versions.length) return fail() - } - return success(versions) -} - -function failInc () { - console.error('--inc can only be used on a single version with no range') - fail() -} - -function fail () { process.exit(1) } - -function success () { - var compare = reverse ? 'rcompare' : 'compare' - versions.sort(function (a, b) { - return semver[compare](a, b, options) - }).map(function (v) { - return semver.clean(v, options) - }).map(function (v) { - return inc ? semver.inc(v, inc, options, identifier) : v - }).forEach(function (v, i, _) { console.log(v) }) -} - -function help () { - console.log(['SemVer ' + version, - '', - 'A JavaScript implementation of the https://semver.org/ specification', - 'Copyright Isaac Z. Schlueter', - '', - 'Usage: semver [options] [ [...]]', - 'Prints valid versions sorted by SemVer precedence', - '', - 'Options:', - '-r --range ', - ' Print versions that match the specified range.', - '', - '-i --increment []', - ' Increment a version by the specified level. Level can', - ' be one of: major, minor, patch, premajor, preminor,', - " prepatch, or prerelease. Default level is 'patch'.", - ' Only one version may be specified.', - '', - '--preid ', - ' Identifier to be used to prefix premajor, preminor,', - ' prepatch or prerelease version increments.', - '', - '-l --loose', - ' Interpret versions and ranges loosely', - '', - '-p --include-prerelease', - ' Always include prerelease versions in range matching', - '', - '-c --coerce', - ' Coerce a string into SemVer if possible', - ' (does not imply --loose)', - '', - 'Program exits successfully if any valid version satisfies', - 'all supplied ranges, and prints all satisfying versions.', - '', - 'If no satisfying versions are found, then exits failure.', - '', - 'Versions are printed in ascending order, so supplying', - 'multiple versions to the utility will just sort them.' - ].join('\n')) -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/semver/package.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/semver/package.json deleted file mode 100644 index 69d2db16..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/semver/package.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "name": "semver", - "version": "5.7.1", - "description": "The semantic version parser used by npm.", - "main": "semver.js", - "scripts": { - "test": "tap", - "preversion": "npm test", - "postversion": "npm publish", - "postpublish": "git push origin --all; git push origin --tags" - }, - "devDependencies": { - "tap": "^13.0.0-rc.18" - }, - "license": "ISC", - "repository": "https://github.com/npm/node-semver", - "bin": { - "semver": "./bin/semver" - }, - "files": [ - "bin", - "range.bnf", - "semver.js" - ], - "tap": { - "check-coverage": true - } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/semver/range.bnf b/packages/wyatt_notification_bloc/example/scripts/node_modules/semver/range.bnf deleted file mode 100644 index d4c6ae0d..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/semver/range.bnf +++ /dev/null @@ -1,16 +0,0 @@ -range-set ::= range ( logical-or range ) * -logical-or ::= ( ' ' ) * '||' ( ' ' ) * -range ::= hyphen | simple ( ' ' simple ) * | '' -hyphen ::= partial ' - ' partial -simple ::= primitive | partial | tilde | caret -primitive ::= ( '<' | '>' | '>=' | '<=' | '=' ) partial -partial ::= xr ( '.' xr ( '.' xr qualifier ? )? )? -xr ::= 'x' | 'X' | '*' | nr -nr ::= '0' | [1-9] ( [0-9] ) * -tilde ::= '~' partial -caret ::= '^' partial -qualifier ::= ( '-' pre )? ( '+' build )? -pre ::= parts -build ::= parts -parts ::= part ( '.' part ) * -part ::= nr | [-0-9A-Za-z]+ diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/semver/semver.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/semver/semver.js deleted file mode 100644 index d315d5d6..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/semver/semver.js +++ /dev/null @@ -1,1483 +0,0 @@ -exports = module.exports = SemVer - -var debug -/* istanbul ignore next */ -if (typeof process === 'object' && - process.env && - process.env.NODE_DEBUG && - /\bsemver\b/i.test(process.env.NODE_DEBUG)) { - debug = function () { - var args = Array.prototype.slice.call(arguments, 0) - args.unshift('SEMVER') - console.log.apply(console, args) - } -} else { - debug = function () {} -} - -// Note: this is the semver.org version of the spec that it implements -// Not necessarily the package version of this code. -exports.SEMVER_SPEC_VERSION = '2.0.0' - -var MAX_LENGTH = 256 -var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || - /* istanbul ignore next */ 9007199254740991 - -// Max safe segment length for coercion. -var MAX_SAFE_COMPONENT_LENGTH = 16 - -// The actual regexps go on exports.re -var re = exports.re = [] -var src = exports.src = [] -var R = 0 - -// The following Regular Expressions can be used for tokenizing, -// validating, and parsing SemVer version strings. - -// ## Numeric Identifier -// A single `0`, or a non-zero digit followed by zero or more digits. - -var NUMERICIDENTIFIER = R++ -src[NUMERICIDENTIFIER] = '0|[1-9]\\d*' -var NUMERICIDENTIFIERLOOSE = R++ -src[NUMERICIDENTIFIERLOOSE] = '[0-9]+' - -// ## Non-numeric Identifier -// Zero or more digits, followed by a letter or hyphen, and then zero or -// more letters, digits, or hyphens. - -var NONNUMERICIDENTIFIER = R++ -src[NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-][a-zA-Z0-9-]*' - -// ## Main Version -// Three dot-separated numeric identifiers. - -var MAINVERSION = R++ -src[MAINVERSION] = '(' + src[NUMERICIDENTIFIER] + ')\\.' + - '(' + src[NUMERICIDENTIFIER] + ')\\.' + - '(' + src[NUMERICIDENTIFIER] + ')' - -var MAINVERSIONLOOSE = R++ -src[MAINVERSIONLOOSE] = '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' + - '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' + - '(' + src[NUMERICIDENTIFIERLOOSE] + ')' - -// ## Pre-release Version Identifier -// A numeric identifier, or a non-numeric identifier. - -var PRERELEASEIDENTIFIER = R++ -src[PRERELEASEIDENTIFIER] = '(?:' + src[NUMERICIDENTIFIER] + - '|' + src[NONNUMERICIDENTIFIER] + ')' - -var PRERELEASEIDENTIFIERLOOSE = R++ -src[PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[NUMERICIDENTIFIERLOOSE] + - '|' + src[NONNUMERICIDENTIFIER] + ')' - -// ## Pre-release Version -// Hyphen, followed by one or more dot-separated pre-release version -// identifiers. - -var PRERELEASE = R++ -src[PRERELEASE] = '(?:-(' + src[PRERELEASEIDENTIFIER] + - '(?:\\.' + src[PRERELEASEIDENTIFIER] + ')*))' - -var PRERELEASELOOSE = R++ -src[PRERELEASELOOSE] = '(?:-?(' + src[PRERELEASEIDENTIFIERLOOSE] + - '(?:\\.' + src[PRERELEASEIDENTIFIERLOOSE] + ')*))' - -// ## Build Metadata Identifier -// Any combination of digits, letters, or hyphens. - -var BUILDIDENTIFIER = R++ -src[BUILDIDENTIFIER] = '[0-9A-Za-z-]+' - -// ## Build Metadata -// Plus sign, followed by one or more period-separated build metadata -// identifiers. - -var BUILD = R++ -src[BUILD] = '(?:\\+(' + src[BUILDIDENTIFIER] + - '(?:\\.' + src[BUILDIDENTIFIER] + ')*))' - -// ## Full Version String -// A main version, followed optionally by a pre-release version and -// build metadata. - -// Note that the only major, minor, patch, and pre-release sections of -// the version string are capturing groups. The build metadata is not a -// capturing group, because it should not ever be used in version -// comparison. - -var FULL = R++ -var FULLPLAIN = 'v?' + src[MAINVERSION] + - src[PRERELEASE] + '?' + - src[BUILD] + '?' - -src[FULL] = '^' + FULLPLAIN + '$' - -// like full, but allows v1.2.3 and =1.2.3, which people do sometimes. -// also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty -// common in the npm registry. -var LOOSEPLAIN = '[v=\\s]*' + src[MAINVERSIONLOOSE] + - src[PRERELEASELOOSE] + '?' + - src[BUILD] + '?' - -var LOOSE = R++ -src[LOOSE] = '^' + LOOSEPLAIN + '$' - -var GTLT = R++ -src[GTLT] = '((?:<|>)?=?)' - -// Something like "2.*" or "1.2.x". -// Note that "x.x" is a valid xRange identifer, meaning "any version" -// Only the first item is strictly required. -var XRANGEIDENTIFIERLOOSE = R++ -src[XRANGEIDENTIFIERLOOSE] = src[NUMERICIDENTIFIERLOOSE] + '|x|X|\\*' -var XRANGEIDENTIFIER = R++ -src[XRANGEIDENTIFIER] = src[NUMERICIDENTIFIER] + '|x|X|\\*' - -var XRANGEPLAIN = R++ -src[XRANGEPLAIN] = '[v=\\s]*(' + src[XRANGEIDENTIFIER] + ')' + - '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' + - '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' + - '(?:' + src[PRERELEASE] + ')?' + - src[BUILD] + '?' + - ')?)?' - -var XRANGEPLAINLOOSE = R++ -src[XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[XRANGEIDENTIFIERLOOSE] + ')' + - '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' + - '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' + - '(?:' + src[PRERELEASELOOSE] + ')?' + - src[BUILD] + '?' + - ')?)?' - -var XRANGE = R++ -src[XRANGE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAIN] + '$' -var XRANGELOOSE = R++ -src[XRANGELOOSE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAINLOOSE] + '$' - -// Coercion. -// Extract anything that could conceivably be a part of a valid semver -var COERCE = R++ -src[COERCE] = '(?:^|[^\\d])' + - '(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '})' + - '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' + - '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' + - '(?:$|[^\\d])' - -// Tilde ranges. -// Meaning is "reasonably at or greater than" -var LONETILDE = R++ -src[LONETILDE] = '(?:~>?)' - -var TILDETRIM = R++ -src[TILDETRIM] = '(\\s*)' + src[LONETILDE] + '\\s+' -re[TILDETRIM] = new RegExp(src[TILDETRIM], 'g') -var tildeTrimReplace = '$1~' - -var TILDE = R++ -src[TILDE] = '^' + src[LONETILDE] + src[XRANGEPLAIN] + '$' -var TILDELOOSE = R++ -src[TILDELOOSE] = '^' + src[LONETILDE] + src[XRANGEPLAINLOOSE] + '$' - -// Caret ranges. -// Meaning is "at least and backwards compatible with" -var LONECARET = R++ -src[LONECARET] = '(?:\\^)' - -var CARETTRIM = R++ -src[CARETTRIM] = '(\\s*)' + src[LONECARET] + '\\s+' -re[CARETTRIM] = new RegExp(src[CARETTRIM], 'g') -var caretTrimReplace = '$1^' - -var CARET = R++ -src[CARET] = '^' + src[LONECARET] + src[XRANGEPLAIN] + '$' -var CARETLOOSE = R++ -src[CARETLOOSE] = '^' + src[LONECARET] + src[XRANGEPLAINLOOSE] + '$' - -// A simple gt/lt/eq thing, or just "" to indicate "any version" -var COMPARATORLOOSE = R++ -src[COMPARATORLOOSE] = '^' + src[GTLT] + '\\s*(' + LOOSEPLAIN + ')$|^$' -var COMPARATOR = R++ -src[COMPARATOR] = '^' + src[GTLT] + '\\s*(' + FULLPLAIN + ')$|^$' - -// An expression to strip any whitespace between the gtlt and the thing -// it modifies, so that `> 1.2.3` ==> `>1.2.3` -var COMPARATORTRIM = R++ -src[COMPARATORTRIM] = '(\\s*)' + src[GTLT] + - '\\s*(' + LOOSEPLAIN + '|' + src[XRANGEPLAIN] + ')' - -// this one has to use the /g flag -re[COMPARATORTRIM] = new RegExp(src[COMPARATORTRIM], 'g') -var comparatorTrimReplace = '$1$2$3' - -// Something like `1.2.3 - 1.2.4` -// Note that these all use the loose form, because they'll be -// checked against either the strict or loose comparator form -// later. -var HYPHENRANGE = R++ -src[HYPHENRANGE] = '^\\s*(' + src[XRANGEPLAIN] + ')' + - '\\s+-\\s+' + - '(' + src[XRANGEPLAIN] + ')' + - '\\s*$' - -var HYPHENRANGELOOSE = R++ -src[HYPHENRANGELOOSE] = '^\\s*(' + src[XRANGEPLAINLOOSE] + ')' + - '\\s+-\\s+' + - '(' + src[XRANGEPLAINLOOSE] + ')' + - '\\s*$' - -// Star ranges basically just allow anything at all. -var STAR = R++ -src[STAR] = '(<|>)?=?\\s*\\*' - -// Compile to actual regexp objects. -// All are flag-free, unless they were created above with a flag. -for (var i = 0; i < R; i++) { - debug(i, src[i]) - if (!re[i]) { - re[i] = new RegExp(src[i]) - } -} - -exports.parse = parse -function parse (version, options) { - if (!options || typeof options !== 'object') { - options = { - loose: !!options, - includePrerelease: false - } - } - - if (version instanceof SemVer) { - return version - } - - if (typeof version !== 'string') { - return null - } - - if (version.length > MAX_LENGTH) { - return null - } - - var r = options.loose ? re[LOOSE] : re[FULL] - if (!r.test(version)) { - return null - } - - try { - return new SemVer(version, options) - } catch (er) { - return null - } -} - -exports.valid = valid -function valid (version, options) { - var v = parse(version, options) - return v ? v.version : null -} - -exports.clean = clean -function clean (version, options) { - var s = parse(version.trim().replace(/^[=v]+/, ''), options) - return s ? s.version : null -} - -exports.SemVer = SemVer - -function SemVer (version, options) { - if (!options || typeof options !== 'object') { - options = { - loose: !!options, - includePrerelease: false - } - } - if (version instanceof SemVer) { - if (version.loose === options.loose) { - return version - } else { - version = version.version - } - } else if (typeof version !== 'string') { - throw new TypeError('Invalid Version: ' + version) - } - - if (version.length > MAX_LENGTH) { - throw new TypeError('version is longer than ' + MAX_LENGTH + ' characters') - } - - if (!(this instanceof SemVer)) { - return new SemVer(version, options) - } - - debug('SemVer', version, options) - this.options = options - this.loose = !!options.loose - - var m = version.trim().match(options.loose ? re[LOOSE] : re[FULL]) - - if (!m) { - throw new TypeError('Invalid Version: ' + version) - } - - this.raw = version - - // these are actually numbers - this.major = +m[1] - this.minor = +m[2] - this.patch = +m[3] - - if (this.major > MAX_SAFE_INTEGER || this.major < 0) { - throw new TypeError('Invalid major version') - } - - if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) { - throw new TypeError('Invalid minor version') - } - - if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) { - throw new TypeError('Invalid patch version') - } - - // numberify any prerelease numeric ids - if (!m[4]) { - this.prerelease = [] - } else { - this.prerelease = m[4].split('.').map(function (id) { - if (/^[0-9]+$/.test(id)) { - var num = +id - if (num >= 0 && num < MAX_SAFE_INTEGER) { - return num - } - } - return id - }) - } - - this.build = m[5] ? m[5].split('.') : [] - this.format() -} - -SemVer.prototype.format = function () { - this.version = this.major + '.' + this.minor + '.' + this.patch - if (this.prerelease.length) { - this.version += '-' + this.prerelease.join('.') - } - return this.version -} - -SemVer.prototype.toString = function () { - return this.version -} - -SemVer.prototype.compare = function (other) { - debug('SemVer.compare', this.version, this.options, other) - if (!(other instanceof SemVer)) { - other = new SemVer(other, this.options) - } - - return this.compareMain(other) || this.comparePre(other) -} - -SemVer.prototype.compareMain = function (other) { - if (!(other instanceof SemVer)) { - other = new SemVer(other, this.options) - } - - return compareIdentifiers(this.major, other.major) || - compareIdentifiers(this.minor, other.minor) || - compareIdentifiers(this.patch, other.patch) -} - -SemVer.prototype.comparePre = function (other) { - if (!(other instanceof SemVer)) { - other = new SemVer(other, this.options) - } - - // NOT having a prerelease is > having one - if (this.prerelease.length && !other.prerelease.length) { - return -1 - } else if (!this.prerelease.length && other.prerelease.length) { - return 1 - } else if (!this.prerelease.length && !other.prerelease.length) { - return 0 - } - - var i = 0 - do { - var a = this.prerelease[i] - var b = other.prerelease[i] - debug('prerelease compare', i, a, b) - if (a === undefined && b === undefined) { - return 0 - } else if (b === undefined) { - return 1 - } else if (a === undefined) { - return -1 - } else if (a === b) { - continue - } else { - return compareIdentifiers(a, b) - } - } while (++i) -} - -// preminor will bump the version up to the next minor release, and immediately -// down to pre-release. premajor and prepatch work the same way. -SemVer.prototype.inc = function (release, identifier) { - switch (release) { - case 'premajor': - this.prerelease.length = 0 - this.patch = 0 - this.minor = 0 - this.major++ - this.inc('pre', identifier) - break - case 'preminor': - this.prerelease.length = 0 - this.patch = 0 - this.minor++ - this.inc('pre', identifier) - break - case 'prepatch': - // If this is already a prerelease, it will bump to the next version - // drop any prereleases that might already exist, since they are not - // relevant at this point. - this.prerelease.length = 0 - this.inc('patch', identifier) - this.inc('pre', identifier) - break - // If the input is a non-prerelease version, this acts the same as - // prepatch. - case 'prerelease': - if (this.prerelease.length === 0) { - this.inc('patch', identifier) - } - this.inc('pre', identifier) - break - - case 'major': - // If this is a pre-major version, bump up to the same major version. - // Otherwise increment major. - // 1.0.0-5 bumps to 1.0.0 - // 1.1.0 bumps to 2.0.0 - if (this.minor !== 0 || - this.patch !== 0 || - this.prerelease.length === 0) { - this.major++ - } - this.minor = 0 - this.patch = 0 - this.prerelease = [] - break - case 'minor': - // If this is a pre-minor version, bump up to the same minor version. - // Otherwise increment minor. - // 1.2.0-5 bumps to 1.2.0 - // 1.2.1 bumps to 1.3.0 - if (this.patch !== 0 || this.prerelease.length === 0) { - this.minor++ - } - this.patch = 0 - this.prerelease = [] - break - case 'patch': - // If this is not a pre-release version, it will increment the patch. - // If it is a pre-release it will bump up to the same patch version. - // 1.2.0-5 patches to 1.2.0 - // 1.2.0 patches to 1.2.1 - if (this.prerelease.length === 0) { - this.patch++ - } - this.prerelease = [] - break - // This probably shouldn't be used publicly. - // 1.0.0 "pre" would become 1.0.0-0 which is the wrong direction. - case 'pre': - if (this.prerelease.length === 0) { - this.prerelease = [0] - } else { - var i = this.prerelease.length - while (--i >= 0) { - if (typeof this.prerelease[i] === 'number') { - this.prerelease[i]++ - i = -2 - } - } - if (i === -1) { - // didn't increment anything - this.prerelease.push(0) - } - } - if (identifier) { - // 1.2.0-beta.1 bumps to 1.2.0-beta.2, - // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0 - if (this.prerelease[0] === identifier) { - if (isNaN(this.prerelease[1])) { - this.prerelease = [identifier, 0] - } - } else { - this.prerelease = [identifier, 0] - } - } - break - - default: - throw new Error('invalid increment argument: ' + release) - } - this.format() - this.raw = this.version - return this -} - -exports.inc = inc -function inc (version, release, loose, identifier) { - if (typeof (loose) === 'string') { - identifier = loose - loose = undefined - } - - try { - return new SemVer(version, loose).inc(release, identifier).version - } catch (er) { - return null - } -} - -exports.diff = diff -function diff (version1, version2) { - if (eq(version1, version2)) { - return null - } else { - var v1 = parse(version1) - var v2 = parse(version2) - var prefix = '' - if (v1.prerelease.length || v2.prerelease.length) { - prefix = 'pre' - var defaultResult = 'prerelease' - } - for (var key in v1) { - if (key === 'major' || key === 'minor' || key === 'patch') { - if (v1[key] !== v2[key]) { - return prefix + key - } - } - } - return defaultResult // may be undefined - } -} - -exports.compareIdentifiers = compareIdentifiers - -var numeric = /^[0-9]+$/ -function compareIdentifiers (a, b) { - var anum = numeric.test(a) - var bnum = numeric.test(b) - - if (anum && bnum) { - a = +a - b = +b - } - - return a === b ? 0 - : (anum && !bnum) ? -1 - : (bnum && !anum) ? 1 - : a < b ? -1 - : 1 -} - -exports.rcompareIdentifiers = rcompareIdentifiers -function rcompareIdentifiers (a, b) { - return compareIdentifiers(b, a) -} - -exports.major = major -function major (a, loose) { - return new SemVer(a, loose).major -} - -exports.minor = minor -function minor (a, loose) { - return new SemVer(a, loose).minor -} - -exports.patch = patch -function patch (a, loose) { - return new SemVer(a, loose).patch -} - -exports.compare = compare -function compare (a, b, loose) { - return new SemVer(a, loose).compare(new SemVer(b, loose)) -} - -exports.compareLoose = compareLoose -function compareLoose (a, b) { - return compare(a, b, true) -} - -exports.rcompare = rcompare -function rcompare (a, b, loose) { - return compare(b, a, loose) -} - -exports.sort = sort -function sort (list, loose) { - return list.sort(function (a, b) { - return exports.compare(a, b, loose) - }) -} - -exports.rsort = rsort -function rsort (list, loose) { - return list.sort(function (a, b) { - return exports.rcompare(a, b, loose) - }) -} - -exports.gt = gt -function gt (a, b, loose) { - return compare(a, b, loose) > 0 -} - -exports.lt = lt -function lt (a, b, loose) { - return compare(a, b, loose) < 0 -} - -exports.eq = eq -function eq (a, b, loose) { - return compare(a, b, loose) === 0 -} - -exports.neq = neq -function neq (a, b, loose) { - return compare(a, b, loose) !== 0 -} - -exports.gte = gte -function gte (a, b, loose) { - return compare(a, b, loose) >= 0 -} - -exports.lte = lte -function lte (a, b, loose) { - return compare(a, b, loose) <= 0 -} - -exports.cmp = cmp -function cmp (a, op, b, loose) { - switch (op) { - case '===': - if (typeof a === 'object') - a = a.version - if (typeof b === 'object') - b = b.version - return a === b - - case '!==': - if (typeof a === 'object') - a = a.version - if (typeof b === 'object') - b = b.version - return a !== b - - case '': - case '=': - case '==': - return eq(a, b, loose) - - case '!=': - return neq(a, b, loose) - - case '>': - return gt(a, b, loose) - - case '>=': - return gte(a, b, loose) - - case '<': - return lt(a, b, loose) - - case '<=': - return lte(a, b, loose) - - default: - throw new TypeError('Invalid operator: ' + op) - } -} - -exports.Comparator = Comparator -function Comparator (comp, options) { - if (!options || typeof options !== 'object') { - options = { - loose: !!options, - includePrerelease: false - } - } - - if (comp instanceof Comparator) { - if (comp.loose === !!options.loose) { - return comp - } else { - comp = comp.value - } - } - - if (!(this instanceof Comparator)) { - return new Comparator(comp, options) - } - - debug('comparator', comp, options) - this.options = options - this.loose = !!options.loose - this.parse(comp) - - if (this.semver === ANY) { - this.value = '' - } else { - this.value = this.operator + this.semver.version - } - - debug('comp', this) -} - -var ANY = {} -Comparator.prototype.parse = function (comp) { - var r = this.options.loose ? re[COMPARATORLOOSE] : re[COMPARATOR] - var m = comp.match(r) - - if (!m) { - throw new TypeError('Invalid comparator: ' + comp) - } - - this.operator = m[1] - if (this.operator === '=') { - this.operator = '' - } - - // if it literally is just '>' or '' then allow anything. - if (!m[2]) { - this.semver = ANY - } else { - this.semver = new SemVer(m[2], this.options.loose) - } -} - -Comparator.prototype.toString = function () { - return this.value -} - -Comparator.prototype.test = function (version) { - debug('Comparator.test', version, this.options.loose) - - if (this.semver === ANY) { - return true - } - - if (typeof version === 'string') { - version = new SemVer(version, this.options) - } - - return cmp(version, this.operator, this.semver, this.options) -} - -Comparator.prototype.intersects = function (comp, options) { - if (!(comp instanceof Comparator)) { - throw new TypeError('a Comparator is required') - } - - if (!options || typeof options !== 'object') { - options = { - loose: !!options, - includePrerelease: false - } - } - - var rangeTmp - - if (this.operator === '') { - rangeTmp = new Range(comp.value, options) - return satisfies(this.value, rangeTmp, options) - } else if (comp.operator === '') { - rangeTmp = new Range(this.value, options) - return satisfies(comp.semver, rangeTmp, options) - } - - var sameDirectionIncreasing = - (this.operator === '>=' || this.operator === '>') && - (comp.operator === '>=' || comp.operator === '>') - var sameDirectionDecreasing = - (this.operator === '<=' || this.operator === '<') && - (comp.operator === '<=' || comp.operator === '<') - var sameSemVer = this.semver.version === comp.semver.version - var differentDirectionsInclusive = - (this.operator === '>=' || this.operator === '<=') && - (comp.operator === '>=' || comp.operator === '<=') - var oppositeDirectionsLessThan = - cmp(this.semver, '<', comp.semver, options) && - ((this.operator === '>=' || this.operator === '>') && - (comp.operator === '<=' || comp.operator === '<')) - var oppositeDirectionsGreaterThan = - cmp(this.semver, '>', comp.semver, options) && - ((this.operator === '<=' || this.operator === '<') && - (comp.operator === '>=' || comp.operator === '>')) - - return sameDirectionIncreasing || sameDirectionDecreasing || - (sameSemVer && differentDirectionsInclusive) || - oppositeDirectionsLessThan || oppositeDirectionsGreaterThan -} - -exports.Range = Range -function Range (range, options) { - if (!options || typeof options !== 'object') { - options = { - loose: !!options, - includePrerelease: false - } - } - - if (range instanceof Range) { - if (range.loose === !!options.loose && - range.includePrerelease === !!options.includePrerelease) { - return range - } else { - return new Range(range.raw, options) - } - } - - if (range instanceof Comparator) { - return new Range(range.value, options) - } - - if (!(this instanceof Range)) { - return new Range(range, options) - } - - this.options = options - this.loose = !!options.loose - this.includePrerelease = !!options.includePrerelease - - // First, split based on boolean or || - this.raw = range - this.set = range.split(/\s*\|\|\s*/).map(function (range) { - return this.parseRange(range.trim()) - }, this).filter(function (c) { - // throw out any that are not relevant for whatever reason - return c.length - }) - - if (!this.set.length) { - throw new TypeError('Invalid SemVer Range: ' + range) - } - - this.format() -} - -Range.prototype.format = function () { - this.range = this.set.map(function (comps) { - return comps.join(' ').trim() - }).join('||').trim() - return this.range -} - -Range.prototype.toString = function () { - return this.range -} - -Range.prototype.parseRange = function (range) { - var loose = this.options.loose - range = range.trim() - // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4` - var hr = loose ? re[HYPHENRANGELOOSE] : re[HYPHENRANGE] - range = range.replace(hr, hyphenReplace) - debug('hyphen replace', range) - // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5` - range = range.replace(re[COMPARATORTRIM], comparatorTrimReplace) - debug('comparator trim', range, re[COMPARATORTRIM]) - - // `~ 1.2.3` => `~1.2.3` - range = range.replace(re[TILDETRIM], tildeTrimReplace) - - // `^ 1.2.3` => `^1.2.3` - range = range.replace(re[CARETTRIM], caretTrimReplace) - - // normalize spaces - range = range.split(/\s+/).join(' ') - - // At this point, the range is completely trimmed and - // ready to be split into comparators. - - var compRe = loose ? re[COMPARATORLOOSE] : re[COMPARATOR] - var set = range.split(' ').map(function (comp) { - return parseComparator(comp, this.options) - }, this).join(' ').split(/\s+/) - if (this.options.loose) { - // in loose mode, throw out any that are not valid comparators - set = set.filter(function (comp) { - return !!comp.match(compRe) - }) - } - set = set.map(function (comp) { - return new Comparator(comp, this.options) - }, this) - - return set -} - -Range.prototype.intersects = function (range, options) { - if (!(range instanceof Range)) { - throw new TypeError('a Range is required') - } - - return this.set.some(function (thisComparators) { - return thisComparators.every(function (thisComparator) { - return range.set.some(function (rangeComparators) { - return rangeComparators.every(function (rangeComparator) { - return thisComparator.intersects(rangeComparator, options) - }) - }) - }) - }) -} - -// Mostly just for testing and legacy API reasons -exports.toComparators = toComparators -function toComparators (range, options) { - return new Range(range, options).set.map(function (comp) { - return comp.map(function (c) { - return c.value - }).join(' ').trim().split(' ') - }) -} - -// comprised of xranges, tildes, stars, and gtlt's at this point. -// already replaced the hyphen ranges -// turn into a set of JUST comparators. -function parseComparator (comp, options) { - debug('comp', comp, options) - comp = replaceCarets(comp, options) - debug('caret', comp) - comp = replaceTildes(comp, options) - debug('tildes', comp) - comp = replaceXRanges(comp, options) - debug('xrange', comp) - comp = replaceStars(comp, options) - debug('stars', comp) - return comp -} - -function isX (id) { - return !id || id.toLowerCase() === 'x' || id === '*' -} - -// ~, ~> --> * (any, kinda silly) -// ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0 -// ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0 -// ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0 -// ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0 -// ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0 -function replaceTildes (comp, options) { - return comp.trim().split(/\s+/).map(function (comp) { - return replaceTilde(comp, options) - }).join(' ') -} - -function replaceTilde (comp, options) { - var r = options.loose ? re[TILDELOOSE] : re[TILDE] - return comp.replace(r, function (_, M, m, p, pr) { - debug('tilde', comp, _, M, m, p, pr) - var ret - - if (isX(M)) { - ret = '' - } else if (isX(m)) { - ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0' - } else if (isX(p)) { - // ~1.2 == >=1.2.0 <1.3.0 - ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0' - } else if (pr) { - debug('replaceTilde pr', pr) - ret = '>=' + M + '.' + m + '.' + p + '-' + pr + - ' <' + M + '.' + (+m + 1) + '.0' - } else { - // ~1.2.3 == >=1.2.3 <1.3.0 - ret = '>=' + M + '.' + m + '.' + p + - ' <' + M + '.' + (+m + 1) + '.0' - } - - debug('tilde return', ret) - return ret - }) -} - -// ^ --> * (any, kinda silly) -// ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0 -// ^2.0, ^2.0.x --> >=2.0.0 <3.0.0 -// ^1.2, ^1.2.x --> >=1.2.0 <2.0.0 -// ^1.2.3 --> >=1.2.3 <2.0.0 -// ^1.2.0 --> >=1.2.0 <2.0.0 -function replaceCarets (comp, options) { - return comp.trim().split(/\s+/).map(function (comp) { - return replaceCaret(comp, options) - }).join(' ') -} - -function replaceCaret (comp, options) { - debug('caret', comp, options) - var r = options.loose ? re[CARETLOOSE] : re[CARET] - return comp.replace(r, function (_, M, m, p, pr) { - debug('caret', comp, _, M, m, p, pr) - var ret - - if (isX(M)) { - ret = '' - } else if (isX(m)) { - ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0' - } else if (isX(p)) { - if (M === '0') { - ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0' - } else { - ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0' - } - } else if (pr) { - debug('replaceCaret pr', pr) - if (M === '0') { - if (m === '0') { - ret = '>=' + M + '.' + m + '.' + p + '-' + pr + - ' <' + M + '.' + m + '.' + (+p + 1) - } else { - ret = '>=' + M + '.' + m + '.' + p + '-' + pr + - ' <' + M + '.' + (+m + 1) + '.0' - } - } else { - ret = '>=' + M + '.' + m + '.' + p + '-' + pr + - ' <' + (+M + 1) + '.0.0' - } - } else { - debug('no pr') - if (M === '0') { - if (m === '0') { - ret = '>=' + M + '.' + m + '.' + p + - ' <' + M + '.' + m + '.' + (+p + 1) - } else { - ret = '>=' + M + '.' + m + '.' + p + - ' <' + M + '.' + (+m + 1) + '.0' - } - } else { - ret = '>=' + M + '.' + m + '.' + p + - ' <' + (+M + 1) + '.0.0' - } - } - - debug('caret return', ret) - return ret - }) -} - -function replaceXRanges (comp, options) { - debug('replaceXRanges', comp, options) - return comp.split(/\s+/).map(function (comp) { - return replaceXRange(comp, options) - }).join(' ') -} - -function replaceXRange (comp, options) { - comp = comp.trim() - var r = options.loose ? re[XRANGELOOSE] : re[XRANGE] - return comp.replace(r, function (ret, gtlt, M, m, p, pr) { - debug('xRange', comp, ret, gtlt, M, m, p, pr) - var xM = isX(M) - var xm = xM || isX(m) - var xp = xm || isX(p) - var anyX = xp - - if (gtlt === '=' && anyX) { - gtlt = '' - } - - if (xM) { - if (gtlt === '>' || gtlt === '<') { - // nothing is allowed - ret = '<0.0.0' - } else { - // nothing is forbidden - ret = '*' - } - } else if (gtlt && anyX) { - // we know patch is an x, because we have any x at all. - // replace X with 0 - if (xm) { - m = 0 - } - p = 0 - - if (gtlt === '>') { - // >1 => >=2.0.0 - // >1.2 => >=1.3.0 - // >1.2.3 => >= 1.2.4 - gtlt = '>=' - if (xm) { - M = +M + 1 - m = 0 - p = 0 - } else { - m = +m + 1 - p = 0 - } - } else if (gtlt === '<=') { - // <=0.7.x is actually <0.8.0, since any 0.7.x should - // pass. Similarly, <=7.x is actually <8.0.0, etc. - gtlt = '<' - if (xm) { - M = +M + 1 - } else { - m = +m + 1 - } - } - - ret = gtlt + M + '.' + m + '.' + p - } else if (xm) { - ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0' - } else if (xp) { - ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0' - } - - debug('xRange return', ret) - - return ret - }) -} - -// Because * is AND-ed with everything else in the comparator, -// and '' means "any version", just remove the *s entirely. -function replaceStars (comp, options) { - debug('replaceStars', comp, options) - // Looseness is ignored here. star is always as loose as it gets! - return comp.trim().replace(re[STAR], '') -} - -// This function is passed to string.replace(re[HYPHENRANGE]) -// M, m, patch, prerelease, build -// 1.2 - 3.4.5 => >=1.2.0 <=3.4.5 -// 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do -// 1.2 - 3.4 => >=1.2.0 <3.5.0 -function hyphenReplace ($0, - from, fM, fm, fp, fpr, fb, - to, tM, tm, tp, tpr, tb) { - if (isX(fM)) { - from = '' - } else if (isX(fm)) { - from = '>=' + fM + '.0.0' - } else if (isX(fp)) { - from = '>=' + fM + '.' + fm + '.0' - } else { - from = '>=' + from - } - - if (isX(tM)) { - to = '' - } else if (isX(tm)) { - to = '<' + (+tM + 1) + '.0.0' - } else if (isX(tp)) { - to = '<' + tM + '.' + (+tm + 1) + '.0' - } else if (tpr) { - to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr - } else { - to = '<=' + to - } - - return (from + ' ' + to).trim() -} - -// if ANY of the sets match ALL of its comparators, then pass -Range.prototype.test = function (version) { - if (!version) { - return false - } - - if (typeof version === 'string') { - version = new SemVer(version, this.options) - } - - for (var i = 0; i < this.set.length; i++) { - if (testSet(this.set[i], version, this.options)) { - return true - } - } - return false -} - -function testSet (set, version, options) { - for (var i = 0; i < set.length; i++) { - if (!set[i].test(version)) { - return false - } - } - - if (version.prerelease.length && !options.includePrerelease) { - // Find the set of versions that are allowed to have prereleases - // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0 - // That should allow `1.2.3-pr.2` to pass. - // However, `1.2.4-alpha.notready` should NOT be allowed, - // even though it's within the range set by the comparators. - for (i = 0; i < set.length; i++) { - debug(set[i].semver) - if (set[i].semver === ANY) { - continue - } - - if (set[i].semver.prerelease.length > 0) { - var allowed = set[i].semver - if (allowed.major === version.major && - allowed.minor === version.minor && - allowed.patch === version.patch) { - return true - } - } - } - - // Version has a -pre, but it's not one of the ones we like. - return false - } - - return true -} - -exports.satisfies = satisfies -function satisfies (version, range, options) { - try { - range = new Range(range, options) - } catch (er) { - return false - } - return range.test(version) -} - -exports.maxSatisfying = maxSatisfying -function maxSatisfying (versions, range, options) { - var max = null - var maxSV = null - try { - var rangeObj = new Range(range, options) - } catch (er) { - return null - } - versions.forEach(function (v) { - if (rangeObj.test(v)) { - // satisfies(v, range, options) - if (!max || maxSV.compare(v) === -1) { - // compare(max, v, true) - max = v - maxSV = new SemVer(max, options) - } - } - }) - return max -} - -exports.minSatisfying = minSatisfying -function minSatisfying (versions, range, options) { - var min = null - var minSV = null - try { - var rangeObj = new Range(range, options) - } catch (er) { - return null - } - versions.forEach(function (v) { - if (rangeObj.test(v)) { - // satisfies(v, range, options) - if (!min || minSV.compare(v) === 1) { - // compare(min, v, true) - min = v - minSV = new SemVer(min, options) - } - } - }) - return min -} - -exports.minVersion = minVersion -function minVersion (range, loose) { - range = new Range(range, loose) - - var minver = new SemVer('0.0.0') - if (range.test(minver)) { - return minver - } - - minver = new SemVer('0.0.0-0') - if (range.test(minver)) { - return minver - } - - minver = null - for (var i = 0; i < range.set.length; ++i) { - var comparators = range.set[i] - - comparators.forEach(function (comparator) { - // Clone to avoid manipulating the comparator's semver object. - var compver = new SemVer(comparator.semver.version) - switch (comparator.operator) { - case '>': - if (compver.prerelease.length === 0) { - compver.patch++ - } else { - compver.prerelease.push(0) - } - compver.raw = compver.format() - /* fallthrough */ - case '': - case '>=': - if (!minver || gt(minver, compver)) { - minver = compver - } - break - case '<': - case '<=': - /* Ignore maximum versions */ - break - /* istanbul ignore next */ - default: - throw new Error('Unexpected operation: ' + comparator.operator) - } - }) - } - - if (minver && range.test(minver)) { - return minver - } - - return null -} - -exports.validRange = validRange -function validRange (range, options) { - try { - // Return '*' instead of '' so that truthiness works. - // This will throw if it's invalid anyway - return new Range(range, options).range || '*' - } catch (er) { - return null - } -} - -// Determine if version is less than all the versions possible in the range -exports.ltr = ltr -function ltr (version, range, options) { - return outside(version, range, '<', options) -} - -// Determine if version is greater than all the versions possible in the range. -exports.gtr = gtr -function gtr (version, range, options) { - return outside(version, range, '>', options) -} - -exports.outside = outside -function outside (version, range, hilo, options) { - version = new SemVer(version, options) - range = new Range(range, options) - - var gtfn, ltefn, ltfn, comp, ecomp - switch (hilo) { - case '>': - gtfn = gt - ltefn = lte - ltfn = lt - comp = '>' - ecomp = '>=' - break - case '<': - gtfn = lt - ltefn = gte - ltfn = gt - comp = '<' - ecomp = '<=' - break - default: - throw new TypeError('Must provide a hilo val of "<" or ">"') - } - - // If it satisifes the range it is not outside - if (satisfies(version, range, options)) { - return false - } - - // From now on, variable terms are as if we're in "gtr" mode. - // but note that everything is flipped for the "ltr" function. - - for (var i = 0; i < range.set.length; ++i) { - var comparators = range.set[i] - - var high = null - var low = null - - comparators.forEach(function (comparator) { - if (comparator.semver === ANY) { - comparator = new Comparator('>=0.0.0') - } - high = high || comparator - low = low || comparator - if (gtfn(comparator.semver, high.semver, options)) { - high = comparator - } else if (ltfn(comparator.semver, low.semver, options)) { - low = comparator - } - }) - - // If the edge version comparator has a operator then our version - // isn't outside it - if (high.operator === comp || high.operator === ecomp) { - return false - } - - // If the lowest version comparator has an operator and our version - // is less than it then it isn't higher than the range - if ((!low.operator || low.operator === comp) && - ltefn(version, low.semver)) { - return false - } else if (low.operator === ecomp && ltfn(version, low.semver)) { - return false - } - } - return true -} - -exports.prerelease = prerelease -function prerelease (version, options) { - var parsed = parse(version, options) - return (parsed && parsed.prerelease.length) ? parsed.prerelease : null -} - -exports.intersects = intersects -function intersects (r1, r2, options) { - r1 = new Range(r1, options) - r2 = new Range(r2, options) - return r1.intersects(r2) -} - -exports.coerce = coerce -function coerce (version) { - if (version instanceof SemVer) { - return version - } - - if (typeof version !== 'string') { - return null - } - - var match = version.match(re[COERCE]) - - if (match == null) { - return null - } - - return parse(match[1] + - '.' + (match[2] || '0') + - '.' + (match[3] || '0')) -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/source-map/CHANGELOG.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/source-map/CHANGELOG.md deleted file mode 100644 index 3a8c066c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/source-map/CHANGELOG.md +++ /dev/null @@ -1,301 +0,0 @@ -# Change Log - -## 0.5.6 - -* Fix for regression when people were using numbers as names in source maps. See - #236. - -## 0.5.5 - -* Fix "regression" of unsupported, implementation behavior that half the world - happens to have come to depend on. See #235. - -* Fix regression involving function hoisting in SpiderMonkey. See #233. - -## 0.5.4 - -* Large performance improvements to source-map serialization. See #228 and #229. - -## 0.5.3 - -* Do not include unnecessary distribution files. See - commit ef7006f8d1647e0a83fdc60f04f5a7ca54886f86. - -## 0.5.2 - -* Include browser distributions of the library in package.json's `files`. See - issue #212. - -## 0.5.1 - -* Fix latent bugs in IndexedSourceMapConsumer.prototype._parseMappings. See - ff05274becc9e6e1295ed60f3ea090d31d843379. - -## 0.5.0 - -* Node 0.8 is no longer supported. - -* Use webpack instead of dryice for bundling. - -* Big speedups serializing source maps. See pull request #203. - -* Fix a bug with `SourceMapConsumer.prototype.sourceContentFor` and sources that - explicitly start with the source root. See issue #199. - -## 0.4.4 - -* Fix an issue where using a `SourceMapGenerator` after having created a - `SourceMapConsumer` from it via `SourceMapConsumer.fromSourceMap` failed. See - issue #191. - -* Fix an issue with where `SourceMapGenerator` would mistakenly consider - different mappings as duplicates of each other and avoid generating them. See - issue #192. - -## 0.4.3 - -* A very large number of performance improvements, particularly when parsing - source maps. Collectively about 75% of time shaved off of the source map - parsing benchmark! - -* Fix a bug in `SourceMapConsumer.prototype.allGeneratedPositionsFor` and fuzzy - searching in the presence of a column option. See issue #177. - -* Fix a bug with joining a source and its source root when the source is above - the root. See issue #182. - -* Add the `SourceMapConsumer.prototype.hasContentsOfAllSources` method to - determine when all sources' contents are inlined into the source map. See - issue #190. - -## 0.4.2 - -* Add an `.npmignore` file so that the benchmarks aren't pulled down by - dependent projects. Issue #169. - -* Add an optional `column` argument to - `SourceMapConsumer.prototype.allGeneratedPositionsFor` and better handle lines - with no mappings. Issues #172 and #173. - -## 0.4.1 - -* Fix accidentally defining a global variable. #170. - -## 0.4.0 - -* The default direction for fuzzy searching was changed back to its original - direction. See #164. - -* There is now a `bias` option you can supply to `SourceMapConsumer` to control - the fuzzy searching direction. See #167. - -* About an 8% speed up in parsing source maps. See #159. - -* Added a benchmark for parsing and generating source maps. - -## 0.3.0 - -* Change the default direction that searching for positions fuzzes when there is - not an exact match. See #154. - -* Support for environments using json2.js for JSON serialization. See #156. - -## 0.2.0 - -* Support for consuming "indexed" source maps which do not have any remote - sections. See pull request #127. This introduces a minor backwards - incompatibility if you are monkey patching `SourceMapConsumer.prototype` - methods. - -## 0.1.43 - -* Performance improvements for `SourceMapGenerator` and `SourceNode`. See issue - #148 for some discussion and issues #150, #151, and #152 for implementations. - -## 0.1.42 - -* Fix an issue where `SourceNode`s from different versions of the source-map - library couldn't be used in conjunction with each other. See issue #142. - -## 0.1.41 - -* Fix a bug with getting the source content of relative sources with a "./" - prefix. See issue #145 and [Bug 1090768](bugzil.la/1090768). - -* Add the `SourceMapConsumer.prototype.computeColumnSpans` method to compute the - column span of each mapping. - -* Add the `SourceMapConsumer.prototype.allGeneratedPositionsFor` method to find - all generated positions associated with a given original source and line. - -## 0.1.40 - -* Performance improvements for parsing source maps in SourceMapConsumer. - -## 0.1.39 - -* Fix a bug where setting a source's contents to null before any source content - had been set before threw a TypeError. See issue #131. - -## 0.1.38 - -* Fix a bug where finding relative paths from an empty path were creating - absolute paths. See issue #129. - -## 0.1.37 - -* Fix a bug where if the source root was an empty string, relative source paths - would turn into absolute source paths. Issue #124. - -## 0.1.36 - -* Allow the `names` mapping property to be an empty string. Issue #121. - -## 0.1.35 - -* A third optional parameter was added to `SourceNode.fromStringWithSourceMap` - to specify a path that relative sources in the second parameter should be - relative to. Issue #105. - -* If no file property is given to a `SourceMapGenerator`, then the resulting - source map will no longer have a `null` file property. The property will - simply not exist. Issue #104. - -* Fixed a bug where consecutive newlines were ignored in `SourceNode`s. - Issue #116. - -## 0.1.34 - -* Make `SourceNode` work with windows style ("\r\n") newlines. Issue #103. - -* Fix bug involving source contents and the - `SourceMapGenerator.prototype.applySourceMap`. Issue #100. - -## 0.1.33 - -* Fix some edge cases surrounding path joining and URL resolution. - -* Add a third parameter for relative path to - `SourceMapGenerator.prototype.applySourceMap`. - -* Fix issues with mappings and EOLs. - -## 0.1.32 - -* Fixed a bug where SourceMapConsumer couldn't handle negative relative columns - (issue 92). - -* Fixed test runner to actually report number of failed tests as its process - exit code. - -* Fixed a typo when reporting bad mappings (issue 87). - -## 0.1.31 - -* Delay parsing the mappings in SourceMapConsumer until queried for a source - location. - -* Support Sass source maps (which at the time of writing deviate from the spec - in small ways) in SourceMapConsumer. - -## 0.1.30 - -* Do not join source root with a source, when the source is a data URI. - -* Extend the test runner to allow running single specific test files at a time. - -* Performance improvements in `SourceNode.prototype.walk` and - `SourceMapConsumer.prototype.eachMapping`. - -* Source map browser builds will now work inside Workers. - -* Better error messages when attempting to add an invalid mapping to a - `SourceMapGenerator`. - -## 0.1.29 - -* Allow duplicate entries in the `names` and `sources` arrays of source maps - (usually from TypeScript) we are parsing. Fixes github issue 72. - -## 0.1.28 - -* Skip duplicate mappings when creating source maps from SourceNode; github - issue 75. - -## 0.1.27 - -* Don't throw an error when the `file` property is missing in SourceMapConsumer, - we don't use it anyway. - -## 0.1.26 - -* Fix SourceNode.fromStringWithSourceMap for empty maps. Fixes github issue 70. - -## 0.1.25 - -* Make compatible with browserify - -## 0.1.24 - -* Fix issue with absolute paths and `file://` URIs. See - https://bugzilla.mozilla.org/show_bug.cgi?id=885597 - -## 0.1.23 - -* Fix issue with absolute paths and sourcesContent, github issue 64. - -## 0.1.22 - -* Ignore duplicate mappings in SourceMapGenerator. Fixes github issue 21. - -## 0.1.21 - -* Fixed handling of sources that start with a slash so that they are relative to - the source root's host. - -## 0.1.20 - -* Fixed github issue #43: absolute URLs aren't joined with the source root - anymore. - -## 0.1.19 - -* Using Travis CI to run tests. - -## 0.1.18 - -* Fixed a bug in the handling of sourceRoot. - -## 0.1.17 - -* Added SourceNode.fromStringWithSourceMap. - -## 0.1.16 - -* Added missing documentation. - -* Fixed the generating of empty mappings in SourceNode. - -## 0.1.15 - -* Added SourceMapGenerator.applySourceMap. - -## 0.1.14 - -* The sourceRoot is now handled consistently. - -## 0.1.13 - -* Added SourceMapGenerator.fromSourceMap. - -## 0.1.12 - -* SourceNode now generates empty mappings too. - -## 0.1.11 - -* Added name support to SourceNode. - -## 0.1.10 - -* Added sourcesContent support to the customer and generator. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/source-map/LICENSE b/packages/wyatt_notification_bloc/example/scripts/node_modules/source-map/LICENSE deleted file mode 100644 index ed1b7cf2..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/source-map/LICENSE +++ /dev/null @@ -1,28 +0,0 @@ - -Copyright (c) 2009-2011, Mozilla Foundation and contributors -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -* Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - -* Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -* Neither the names of the Mozilla Foundation nor the names of project - contributors may be used to endorse or promote products derived from this - software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/source-map/README.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/source-map/README.md deleted file mode 100644 index fea4beb1..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/source-map/README.md +++ /dev/null @@ -1,742 +0,0 @@ -# Source Map - -[![Build Status](https://travis-ci.org/mozilla/source-map.png?branch=master)](https://travis-ci.org/mozilla/source-map) - -[![NPM](https://nodei.co/npm/source-map.png?downloads=true&downloadRank=true)](https://www.npmjs.com/package/source-map) - -This is a library to generate and consume the source map format -[described here][format]. - -[format]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit - -## Use with Node - - $ npm install source-map - -## Use on the Web - - - --------------------------------------------------------------------------------- - - - - - -## Table of Contents - -- [Examples](#examples) - - [Consuming a source map](#consuming-a-source-map) - - [Generating a source map](#generating-a-source-map) - - [With SourceNode (high level API)](#with-sourcenode-high-level-api) - - [With SourceMapGenerator (low level API)](#with-sourcemapgenerator-low-level-api) -- [API](#api) - - [SourceMapConsumer](#sourcemapconsumer) - - [new SourceMapConsumer(rawSourceMap)](#new-sourcemapconsumerrawsourcemap) - - [SourceMapConsumer.prototype.computeColumnSpans()](#sourcemapconsumerprototypecomputecolumnspans) - - [SourceMapConsumer.prototype.originalPositionFor(generatedPosition)](#sourcemapconsumerprototypeoriginalpositionforgeneratedposition) - - [SourceMapConsumer.prototype.generatedPositionFor(originalPosition)](#sourcemapconsumerprototypegeneratedpositionfororiginalposition) - - [SourceMapConsumer.prototype.allGeneratedPositionsFor(originalPosition)](#sourcemapconsumerprototypeallgeneratedpositionsfororiginalposition) - - [SourceMapConsumer.prototype.hasContentsOfAllSources()](#sourcemapconsumerprototypehascontentsofallsources) - - [SourceMapConsumer.prototype.sourceContentFor(source[, returnNullOnMissing])](#sourcemapconsumerprototypesourcecontentforsource-returnnullonmissing) - - [SourceMapConsumer.prototype.eachMapping(callback, context, order)](#sourcemapconsumerprototypeeachmappingcallback-context-order) - - [SourceMapGenerator](#sourcemapgenerator) - - [new SourceMapGenerator([startOfSourceMap])](#new-sourcemapgeneratorstartofsourcemap) - - [SourceMapGenerator.fromSourceMap(sourceMapConsumer)](#sourcemapgeneratorfromsourcemapsourcemapconsumer) - - [SourceMapGenerator.prototype.addMapping(mapping)](#sourcemapgeneratorprototypeaddmappingmapping) - - [SourceMapGenerator.prototype.setSourceContent(sourceFile, sourceContent)](#sourcemapgeneratorprototypesetsourcecontentsourcefile-sourcecontent) - - [SourceMapGenerator.prototype.applySourceMap(sourceMapConsumer[, sourceFile[, sourceMapPath]])](#sourcemapgeneratorprototypeapplysourcemapsourcemapconsumer-sourcefile-sourcemappath) - - [SourceMapGenerator.prototype.toString()](#sourcemapgeneratorprototypetostring) - - [SourceNode](#sourcenode) - - [new SourceNode([line, column, source[, chunk[, name]]])](#new-sourcenodeline-column-source-chunk-name) - - [SourceNode.fromStringWithSourceMap(code, sourceMapConsumer[, relativePath])](#sourcenodefromstringwithsourcemapcode-sourcemapconsumer-relativepath) - - [SourceNode.prototype.add(chunk)](#sourcenodeprototypeaddchunk) - - [SourceNode.prototype.prepend(chunk)](#sourcenodeprototypeprependchunk) - - [SourceNode.prototype.setSourceContent(sourceFile, sourceContent)](#sourcenodeprototypesetsourcecontentsourcefile-sourcecontent) - - [SourceNode.prototype.walk(fn)](#sourcenodeprototypewalkfn) - - [SourceNode.prototype.walkSourceContents(fn)](#sourcenodeprototypewalksourcecontentsfn) - - [SourceNode.prototype.join(sep)](#sourcenodeprototypejoinsep) - - [SourceNode.prototype.replaceRight(pattern, replacement)](#sourcenodeprototypereplacerightpattern-replacement) - - [SourceNode.prototype.toString()](#sourcenodeprototypetostring) - - [SourceNode.prototype.toStringWithSourceMap([startOfSourceMap])](#sourcenodeprototypetostringwithsourcemapstartofsourcemap) - - - -## Examples - -### Consuming a source map - -```js -var rawSourceMap = { - version: 3, - file: 'min.js', - names: ['bar', 'baz', 'n'], - sources: ['one.js', 'two.js'], - sourceRoot: 'http://example.com/www/js/', - mappings: 'CAAC,IAAI,IAAM,SAAUA,GAClB,OAAOC,IAAID;CCDb,IAAI,IAAM,SAAUE,GAClB,OAAOA' -}; - -var smc = new SourceMapConsumer(rawSourceMap); - -console.log(smc.sources); -// [ 'http://example.com/www/js/one.js', -// 'http://example.com/www/js/two.js' ] - -console.log(smc.originalPositionFor({ - line: 2, - column: 28 -})); -// { source: 'http://example.com/www/js/two.js', -// line: 2, -// column: 10, -// name: 'n' } - -console.log(smc.generatedPositionFor({ - source: 'http://example.com/www/js/two.js', - line: 2, - column: 10 -})); -// { line: 2, column: 28 } - -smc.eachMapping(function (m) { - // ... -}); -``` - -### Generating a source map - -In depth guide: -[**Compiling to JavaScript, and Debugging with Source Maps**](https://hacks.mozilla.org/2013/05/compiling-to-javascript-and-debugging-with-source-maps/) - -#### With SourceNode (high level API) - -```js -function compile(ast) { - switch (ast.type) { - case 'BinaryExpression': - return new SourceNode( - ast.location.line, - ast.location.column, - ast.location.source, - [compile(ast.left), " + ", compile(ast.right)] - ); - case 'Literal': - return new SourceNode( - ast.location.line, - ast.location.column, - ast.location.source, - String(ast.value) - ); - // ... - default: - throw new Error("Bad AST"); - } -} - -var ast = parse("40 + 2", "add.js"); -console.log(compile(ast).toStringWithSourceMap({ - file: 'add.js' -})); -// { code: '40 + 2', -// map: [object SourceMapGenerator] } -``` - -#### With SourceMapGenerator (low level API) - -```js -var map = new SourceMapGenerator({ - file: "source-mapped.js" -}); - -map.addMapping({ - generated: { - line: 10, - column: 35 - }, - source: "foo.js", - original: { - line: 33, - column: 2 - }, - name: "christopher" -}); - -console.log(map.toString()); -// '{"version":3,"file":"source-mapped.js","sources":["foo.js"],"names":["christopher"],"mappings":";;;;;;;;;mCAgCEA"}' -``` - -## API - -Get a reference to the module: - -```js -// Node.js -var sourceMap = require('source-map'); - -// Browser builds -var sourceMap = window.sourceMap; - -// Inside Firefox -const sourceMap = require("devtools/toolkit/sourcemap/source-map.js"); -``` - -### SourceMapConsumer - -A SourceMapConsumer instance represents a parsed source map which we can query -for information about the original file positions by giving it a file position -in the generated source. - -#### new SourceMapConsumer(rawSourceMap) - -The only parameter is the raw source map (either as a string which can be -`JSON.parse`'d, or an object). According to the spec, source maps have the -following attributes: - -* `version`: Which version of the source map spec this map is following. - -* `sources`: An array of URLs to the original source files. - -* `names`: An array of identifiers which can be referenced by individual - mappings. - -* `sourceRoot`: Optional. The URL root from which all sources are relative. - -* `sourcesContent`: Optional. An array of contents of the original source files. - -* `mappings`: A string of base64 VLQs which contain the actual mappings. - -* `file`: Optional. The generated filename this source map is associated with. - -```js -var consumer = new sourceMap.SourceMapConsumer(rawSourceMapJsonData); -``` - -#### SourceMapConsumer.prototype.computeColumnSpans() - -Compute the last column for each generated mapping. The last column is -inclusive. - -```js -// Before: -consumer.allGeneratedPositionsFor({ line: 2, source: "foo.coffee" }) -// [ { line: 2, -// column: 1 }, -// { line: 2, -// column: 10 }, -// { line: 2, -// column: 20 } ] - -consumer.computeColumnSpans(); - -// After: -consumer.allGeneratedPositionsFor({ line: 2, source: "foo.coffee" }) -// [ { line: 2, -// column: 1, -// lastColumn: 9 }, -// { line: 2, -// column: 10, -// lastColumn: 19 }, -// { line: 2, -// column: 20, -// lastColumn: Infinity } ] - -``` - -#### SourceMapConsumer.prototype.originalPositionFor(generatedPosition) - -Returns the original source, line, and column information for the generated -source's line and column positions provided. The only argument is an object with -the following properties: - -* `line`: The line number in the generated source. Line numbers in - this library are 1-based (note that the underlying source map - specification uses 0-based line numbers -- this library handles the - translation). - -* `column`: The column number in the generated source. Column numbers - in this library are 0-based. - -* `bias`: Either `SourceMapConsumer.GREATEST_LOWER_BOUND` or - `SourceMapConsumer.LEAST_UPPER_BOUND`. Specifies whether to return the closest - element that is smaller than or greater than the one we are searching for, - respectively, if the exact element cannot be found. Defaults to - `SourceMapConsumer.GREATEST_LOWER_BOUND`. - -and an object is returned with the following properties: - -* `source`: The original source file, or null if this information is not - available. - -* `line`: The line number in the original source, or null if this information is - not available. The line number is 1-based. - -* `column`: The column number in the original source, or null if this - information is not available. The column number is 0-based. - -* `name`: The original identifier, or null if this information is not available. - -```js -consumer.originalPositionFor({ line: 2, column: 10 }) -// { source: 'foo.coffee', -// line: 2, -// column: 2, -// name: null } - -consumer.originalPositionFor({ line: 99999999999999999, column: 999999999999999 }) -// { source: null, -// line: null, -// column: null, -// name: null } -``` - -#### SourceMapConsumer.prototype.generatedPositionFor(originalPosition) - -Returns the generated line and column information for the original source, -line, and column positions provided. The only argument is an object with -the following properties: - -* `source`: The filename of the original source. - -* `line`: The line number in the original source. The line number is - 1-based. - -* `column`: The column number in the original source. The column - number is 0-based. - -and an object is returned with the following properties: - -* `line`: The line number in the generated source, or null. The line - number is 1-based. - -* `column`: The column number in the generated source, or null. The - column number is 0-based. - -```js -consumer.generatedPositionFor({ source: "example.js", line: 2, column: 10 }) -// { line: 1, -// column: 56 } -``` - -#### SourceMapConsumer.prototype.allGeneratedPositionsFor(originalPosition) - -Returns all generated line and column information for the original source, line, -and column provided. If no column is provided, returns all mappings -corresponding to a either the line we are searching for or the next closest line -that has any mappings. Otherwise, returns all mappings corresponding to the -given line and either the column we are searching for or the next closest column -that has any offsets. - -The only argument is an object with the following properties: - -* `source`: The filename of the original source. - -* `line`: The line number in the original source. The line number is - 1-based. - -* `column`: Optional. The column number in the original source. The - column number is 0-based. - -and an array of objects is returned, each with the following properties: - -* `line`: The line number in the generated source, or null. The line - number is 1-based. - -* `column`: The column number in the generated source, or null. The - column number is 0-based. - -```js -consumer.allGeneratedpositionsfor({ line: 2, source: "foo.coffee" }) -// [ { line: 2, -// column: 1 }, -// { line: 2, -// column: 10 }, -// { line: 2, -// column: 20 } ] -``` - -#### SourceMapConsumer.prototype.hasContentsOfAllSources() - -Return true if we have the embedded source content for every source listed in -the source map, false otherwise. - -In other words, if this method returns `true`, then -`consumer.sourceContentFor(s)` will succeed for every source `s` in -`consumer.sources`. - -```js -// ... -if (consumer.hasContentsOfAllSources()) { - consumerReadyCallback(consumer); -} else { - fetchSources(consumer, consumerReadyCallback); -} -// ... -``` - -#### SourceMapConsumer.prototype.sourceContentFor(source[, returnNullOnMissing]) - -Returns the original source content for the source provided. The only -argument is the URL of the original source file. - -If the source content for the given source is not found, then an error is -thrown. Optionally, pass `true` as the second param to have `null` returned -instead. - -```js -consumer.sources -// [ "my-cool-lib.clj" ] - -consumer.sourceContentFor("my-cool-lib.clj") -// "..." - -consumer.sourceContentFor("this is not in the source map"); -// Error: "this is not in the source map" is not in the source map - -consumer.sourceContentFor("this is not in the source map", true); -// null -``` - -#### SourceMapConsumer.prototype.eachMapping(callback, context, order) - -Iterate over each mapping between an original source/line/column and a -generated line/column in this source map. - -* `callback`: The function that is called with each mapping. Mappings have the - form `{ source, generatedLine, generatedColumn, originalLine, originalColumn, - name }` - -* `context`: Optional. If specified, this object will be the value of `this` - every time that `callback` is called. - -* `order`: Either `SourceMapConsumer.GENERATED_ORDER` or - `SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to iterate over - the mappings sorted by the generated file's line/column order or the - original's source/line/column order, respectively. Defaults to - `SourceMapConsumer.GENERATED_ORDER`. - -```js -consumer.eachMapping(function (m) { console.log(m); }) -// ... -// { source: 'illmatic.js', -// generatedLine: 1, -// generatedColumn: 0, -// originalLine: 1, -// originalColumn: 0, -// name: null } -// { source: 'illmatic.js', -// generatedLine: 2, -// generatedColumn: 0, -// originalLine: 2, -// originalColumn: 0, -// name: null } -// ... -``` -### SourceMapGenerator - -An instance of the SourceMapGenerator represents a source map which is being -built incrementally. - -#### new SourceMapGenerator([startOfSourceMap]) - -You may pass an object with the following properties: - -* `file`: The filename of the generated source that this source map is - associated with. - -* `sourceRoot`: A root for all relative URLs in this source map. - -* `skipValidation`: Optional. When `true`, disables validation of mappings as - they are added. This can improve performance but should be used with - discretion, as a last resort. Even then, one should avoid using this flag when - running tests, if possible. - -```js -var generator = new sourceMap.SourceMapGenerator({ - file: "my-generated-javascript-file.js", - sourceRoot: "http://example.com/app/js/" -}); -``` - -#### SourceMapGenerator.fromSourceMap(sourceMapConsumer) - -Creates a new `SourceMapGenerator` from an existing `SourceMapConsumer` instance. - -* `sourceMapConsumer` The SourceMap. - -```js -var generator = sourceMap.SourceMapGenerator.fromSourceMap(consumer); -``` - -#### SourceMapGenerator.prototype.addMapping(mapping) - -Add a single mapping from original source line and column to the generated -source's line and column for this source map being created. The mapping object -should have the following properties: - -* `generated`: An object with the generated line and column positions. - -* `original`: An object with the original line and column positions. - -* `source`: The original source file (relative to the sourceRoot). - -* `name`: An optional original token name for this mapping. - -```js -generator.addMapping({ - source: "module-one.scm", - original: { line: 128, column: 0 }, - generated: { line: 3, column: 456 } -}) -``` - -#### SourceMapGenerator.prototype.setSourceContent(sourceFile, sourceContent) - -Set the source content for an original source file. - -* `sourceFile` the URL of the original source file. - -* `sourceContent` the content of the source file. - -```js -generator.setSourceContent("module-one.scm", - fs.readFileSync("path/to/module-one.scm")) -``` - -#### SourceMapGenerator.prototype.applySourceMap(sourceMapConsumer[, sourceFile[, sourceMapPath]]) - -Applies a SourceMap for a source file to the SourceMap. -Each mapping to the supplied source file is rewritten using the -supplied SourceMap. Note: The resolution for the resulting mappings -is the minimum of this map and the supplied map. - -* `sourceMapConsumer`: The SourceMap to be applied. - -* `sourceFile`: Optional. The filename of the source file. - If omitted, sourceMapConsumer.file will be used, if it exists. - Otherwise an error will be thrown. - -* `sourceMapPath`: Optional. The dirname of the path to the SourceMap - to be applied. If relative, it is relative to the SourceMap. - - This parameter is needed when the two SourceMaps aren't in the same - directory, and the SourceMap to be applied contains relative source - paths. If so, those relative source paths need to be rewritten - relative to the SourceMap. - - If omitted, it is assumed that both SourceMaps are in the same directory, - thus not needing any rewriting. (Supplying `'.'` has the same effect.) - -#### SourceMapGenerator.prototype.toString() - -Renders the source map being generated to a string. - -```js -generator.toString() -// '{"version":3,"sources":["module-one.scm"],"names":[],"mappings":"...snip...","file":"my-generated-javascript-file.js","sourceRoot":"http://example.com/app/js/"}' -``` - -### SourceNode - -SourceNodes provide a way to abstract over interpolating and/or concatenating -snippets of generated JavaScript source code, while maintaining the line and -column information associated between those snippets and the original source -code. This is useful as the final intermediate representation a compiler might -use before outputting the generated JS and source map. - -#### new SourceNode([line, column, source[, chunk[, name]]]) - -* `line`: The original line number associated with this source node, or null if - it isn't associated with an original line. The line number is 1-based. - -* `column`: The original column number associated with this source node, or null - if it isn't associated with an original column. The column number - is 0-based. - -* `source`: The original source's filename; null if no filename is provided. - -* `chunk`: Optional. Is immediately passed to `SourceNode.prototype.add`, see - below. - -* `name`: Optional. The original identifier. - -```js -var node = new SourceNode(1, 2, "a.cpp", [ - new SourceNode(3, 4, "b.cpp", "extern int status;\n"), - new SourceNode(5, 6, "c.cpp", "std::string* make_string(size_t n);\n"), - new SourceNode(7, 8, "d.cpp", "int main(int argc, char** argv) {}\n"), -]); -``` - -#### SourceNode.fromStringWithSourceMap(code, sourceMapConsumer[, relativePath]) - -Creates a SourceNode from generated code and a SourceMapConsumer. - -* `code`: The generated code - -* `sourceMapConsumer` The SourceMap for the generated code - -* `relativePath` The optional path that relative sources in `sourceMapConsumer` - should be relative to. - -```js -var consumer = new SourceMapConsumer(fs.readFileSync("path/to/my-file.js.map", "utf8")); -var node = SourceNode.fromStringWithSourceMap(fs.readFileSync("path/to/my-file.js"), - consumer); -``` - -#### SourceNode.prototype.add(chunk) - -Add a chunk of generated JS to this source node. - -* `chunk`: A string snippet of generated JS code, another instance of - `SourceNode`, or an array where each member is one of those things. - -```js -node.add(" + "); -node.add(otherNode); -node.add([leftHandOperandNode, " + ", rightHandOperandNode]); -``` - -#### SourceNode.prototype.prepend(chunk) - -Prepend a chunk of generated JS to this source node. - -* `chunk`: A string snippet of generated JS code, another instance of - `SourceNode`, or an array where each member is one of those things. - -```js -node.prepend("/** Build Id: f783haef86324gf **/\n\n"); -``` - -#### SourceNode.prototype.setSourceContent(sourceFile, sourceContent) - -Set the source content for a source file. This will be added to the -`SourceMap` in the `sourcesContent` field. - -* `sourceFile`: The filename of the source file - -* `sourceContent`: The content of the source file - -```js -node.setSourceContent("module-one.scm", - fs.readFileSync("path/to/module-one.scm")) -``` - -#### SourceNode.prototype.walk(fn) - -Walk over the tree of JS snippets in this node and its children. The walking -function is called once for each snippet of JS and is passed that snippet and -the its original associated source's line/column location. - -* `fn`: The traversal function. - -```js -var node = new SourceNode(1, 2, "a.js", [ - new SourceNode(3, 4, "b.js", "uno"), - "dos", - [ - "tres", - new SourceNode(5, 6, "c.js", "quatro") - ] -]); - -node.walk(function (code, loc) { console.log("WALK:", code, loc); }) -// WALK: uno { source: 'b.js', line: 3, column: 4, name: null } -// WALK: dos { source: 'a.js', line: 1, column: 2, name: null } -// WALK: tres { source: 'a.js', line: 1, column: 2, name: null } -// WALK: quatro { source: 'c.js', line: 5, column: 6, name: null } -``` - -#### SourceNode.prototype.walkSourceContents(fn) - -Walk over the tree of SourceNodes. The walking function is called for each -source file content and is passed the filename and source content. - -* `fn`: The traversal function. - -```js -var a = new SourceNode(1, 2, "a.js", "generated from a"); -a.setSourceContent("a.js", "original a"); -var b = new SourceNode(1, 2, "b.js", "generated from b"); -b.setSourceContent("b.js", "original b"); -var c = new SourceNode(1, 2, "c.js", "generated from c"); -c.setSourceContent("c.js", "original c"); - -var node = new SourceNode(null, null, null, [a, b, c]); -node.walkSourceContents(function (source, contents) { console.log("WALK:", source, ":", contents); }) -// WALK: a.js : original a -// WALK: b.js : original b -// WALK: c.js : original c -``` - -#### SourceNode.prototype.join(sep) - -Like `Array.prototype.join` except for SourceNodes. Inserts the separator -between each of this source node's children. - -* `sep`: The separator. - -```js -var lhs = new SourceNode(1, 2, "a.rs", "my_copy"); -var operand = new SourceNode(3, 4, "a.rs", "="); -var rhs = new SourceNode(5, 6, "a.rs", "orig.clone()"); - -var node = new SourceNode(null, null, null, [ lhs, operand, rhs ]); -var joinedNode = node.join(" "); -``` - -#### SourceNode.prototype.replaceRight(pattern, replacement) - -Call `String.prototype.replace` on the very right-most source snippet. Useful -for trimming white space from the end of a source node, etc. - -* `pattern`: The pattern to replace. - -* `replacement`: The thing to replace the pattern with. - -```js -// Trim trailing white space. -node.replaceRight(/\s*$/, ""); -``` - -#### SourceNode.prototype.toString() - -Return the string representation of this source node. Walks over the tree and -concatenates all the various snippets together to one string. - -```js -var node = new SourceNode(1, 2, "a.js", [ - new SourceNode(3, 4, "b.js", "uno"), - "dos", - [ - "tres", - new SourceNode(5, 6, "c.js", "quatro") - ] -]); - -node.toString() -// 'unodostresquatro' -``` - -#### SourceNode.prototype.toStringWithSourceMap([startOfSourceMap]) - -Returns the string representation of this tree of source nodes, plus a -SourceMapGenerator which contains all the mappings between the generated and -original sources. - -The arguments are the same as those to `new SourceMapGenerator`. - -```js -var node = new SourceNode(1, 2, "a.js", [ - new SourceNode(3, 4, "b.js", "uno"), - "dos", - [ - "tres", - new SourceNode(5, 6, "c.js", "quatro") - ] -]); - -node.toStringWithSourceMap({ file: "my-output-file.js" }) -// { code: 'unodostresquatro', -// map: [object SourceMapGenerator] } -``` diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/source-map/dist/source-map.debug.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/source-map/dist/source-map.debug.js deleted file mode 100644 index aad0620d..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/source-map/dist/source-map.debug.js +++ /dev/null @@ -1,3234 +0,0 @@ -(function webpackUniversalModuleDefinition(root, factory) { - if(typeof exports === 'object' && typeof module === 'object') - module.exports = factory(); - else if(typeof define === 'function' && define.amd) - define([], factory); - else if(typeof exports === 'object') - exports["sourceMap"] = factory(); - else - root["sourceMap"] = factory(); -})(this, function() { -return /******/ (function(modules) { // webpackBootstrap -/******/ // The module cache -/******/ var installedModules = {}; -/******/ -/******/ // The require function -/******/ function __webpack_require__(moduleId) { -/******/ -/******/ // Check if module is in cache -/******/ if(installedModules[moduleId]) -/******/ return installedModules[moduleId].exports; -/******/ -/******/ // Create a new module (and put it into the cache) -/******/ var module = installedModules[moduleId] = { -/******/ exports: {}, -/******/ id: moduleId, -/******/ loaded: false -/******/ }; -/******/ -/******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); -/******/ -/******/ // Flag the module as loaded -/******/ module.loaded = true; -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/******/ -/******/ // expose the modules object (__webpack_modules__) -/******/ __webpack_require__.m = modules; -/******/ -/******/ // expose the module cache -/******/ __webpack_require__.c = installedModules; -/******/ -/******/ // __webpack_public_path__ -/******/ __webpack_require__.p = ""; -/******/ -/******/ // Load entry module and return exports -/******/ return __webpack_require__(0); -/******/ }) -/************************************************************************/ -/******/ ([ -/* 0 */ -/***/ (function(module, exports, __webpack_require__) { - - /* - * Copyright 2009-2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE.txt or: - * http://opensource.org/licenses/BSD-3-Clause - */ - exports.SourceMapGenerator = __webpack_require__(1).SourceMapGenerator; - exports.SourceMapConsumer = __webpack_require__(7).SourceMapConsumer; - exports.SourceNode = __webpack_require__(10).SourceNode; - - -/***/ }), -/* 1 */ -/***/ (function(module, exports, __webpack_require__) { - - /* -*- Mode: js; js-indent-level: 2; -*- */ - /* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - - var base64VLQ = __webpack_require__(2); - var util = __webpack_require__(4); - var ArraySet = __webpack_require__(5).ArraySet; - var MappingList = __webpack_require__(6).MappingList; - - /** - * An instance of the SourceMapGenerator represents a source map which is - * being built incrementally. You may pass an object with the following - * properties: - * - * - file: The filename of the generated source. - * - sourceRoot: A root for all relative URLs in this source map. - */ - function SourceMapGenerator(aArgs) { - if (!aArgs) { - aArgs = {}; - } - this._file = util.getArg(aArgs, 'file', null); - this._sourceRoot = util.getArg(aArgs, 'sourceRoot', null); - this._skipValidation = util.getArg(aArgs, 'skipValidation', false); - this._sources = new ArraySet(); - this._names = new ArraySet(); - this._mappings = new MappingList(); - this._sourcesContents = null; - } - - SourceMapGenerator.prototype._version = 3; - - /** - * Creates a new SourceMapGenerator based on a SourceMapConsumer - * - * @param aSourceMapConsumer The SourceMap. - */ - SourceMapGenerator.fromSourceMap = - function SourceMapGenerator_fromSourceMap(aSourceMapConsumer) { - var sourceRoot = aSourceMapConsumer.sourceRoot; - var generator = new SourceMapGenerator({ - file: aSourceMapConsumer.file, - sourceRoot: sourceRoot - }); - aSourceMapConsumer.eachMapping(function (mapping) { - var newMapping = { - generated: { - line: mapping.generatedLine, - column: mapping.generatedColumn - } - }; - - if (mapping.source != null) { - newMapping.source = mapping.source; - if (sourceRoot != null) { - newMapping.source = util.relative(sourceRoot, newMapping.source); - } - - newMapping.original = { - line: mapping.originalLine, - column: mapping.originalColumn - }; - - if (mapping.name != null) { - newMapping.name = mapping.name; - } - } - - generator.addMapping(newMapping); - }); - aSourceMapConsumer.sources.forEach(function (sourceFile) { - var sourceRelative = sourceFile; - if (sourceRoot !== null) { - sourceRelative = util.relative(sourceRoot, sourceFile); - } - - if (!generator._sources.has(sourceRelative)) { - generator._sources.add(sourceRelative); - } - - var content = aSourceMapConsumer.sourceContentFor(sourceFile); - if (content != null) { - generator.setSourceContent(sourceFile, content); - } - }); - return generator; - }; - - /** - * Add a single mapping from original source line and column to the generated - * source's line and column for this source map being created. The mapping - * object should have the following properties: - * - * - generated: An object with the generated line and column positions. - * - original: An object with the original line and column positions. - * - source: The original source file (relative to the sourceRoot). - * - name: An optional original token name for this mapping. - */ - SourceMapGenerator.prototype.addMapping = - function SourceMapGenerator_addMapping(aArgs) { - var generated = util.getArg(aArgs, 'generated'); - var original = util.getArg(aArgs, 'original', null); - var source = util.getArg(aArgs, 'source', null); - var name = util.getArg(aArgs, 'name', null); - - if (!this._skipValidation) { - this._validateMapping(generated, original, source, name); - } - - if (source != null) { - source = String(source); - if (!this._sources.has(source)) { - this._sources.add(source); - } - } - - if (name != null) { - name = String(name); - if (!this._names.has(name)) { - this._names.add(name); - } - } - - this._mappings.add({ - generatedLine: generated.line, - generatedColumn: generated.column, - originalLine: original != null && original.line, - originalColumn: original != null && original.column, - source: source, - name: name - }); - }; - - /** - * Set the source content for a source file. - */ - SourceMapGenerator.prototype.setSourceContent = - function SourceMapGenerator_setSourceContent(aSourceFile, aSourceContent) { - var source = aSourceFile; - if (this._sourceRoot != null) { - source = util.relative(this._sourceRoot, source); - } - - if (aSourceContent != null) { - // Add the source content to the _sourcesContents map. - // Create a new _sourcesContents map if the property is null. - if (!this._sourcesContents) { - this._sourcesContents = Object.create(null); - } - this._sourcesContents[util.toSetString(source)] = aSourceContent; - } else if (this._sourcesContents) { - // Remove the source file from the _sourcesContents map. - // If the _sourcesContents map is empty, set the property to null. - delete this._sourcesContents[util.toSetString(source)]; - if (Object.keys(this._sourcesContents).length === 0) { - this._sourcesContents = null; - } - } - }; - - /** - * Applies the mappings of a sub-source-map for a specific source file to the - * source map being generated. Each mapping to the supplied source file is - * rewritten using the supplied source map. Note: The resolution for the - * resulting mappings is the minimium of this map and the supplied map. - * - * @param aSourceMapConsumer The source map to be applied. - * @param aSourceFile Optional. The filename of the source file. - * If omitted, SourceMapConsumer's file property will be used. - * @param aSourceMapPath Optional. The dirname of the path to the source map - * to be applied. If relative, it is relative to the SourceMapConsumer. - * This parameter is needed when the two source maps aren't in the same - * directory, and the source map to be applied contains relative source - * paths. If so, those relative source paths need to be rewritten - * relative to the SourceMapGenerator. - */ - SourceMapGenerator.prototype.applySourceMap = - function SourceMapGenerator_applySourceMap(aSourceMapConsumer, aSourceFile, aSourceMapPath) { - var sourceFile = aSourceFile; - // If aSourceFile is omitted, we will use the file property of the SourceMap - if (aSourceFile == null) { - if (aSourceMapConsumer.file == null) { - throw new Error( - 'SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, ' + - 'or the source map\'s "file" property. Both were omitted.' - ); - } - sourceFile = aSourceMapConsumer.file; - } - var sourceRoot = this._sourceRoot; - // Make "sourceFile" relative if an absolute Url is passed. - if (sourceRoot != null) { - sourceFile = util.relative(sourceRoot, sourceFile); - } - // Applying the SourceMap can add and remove items from the sources and - // the names array. - var newSources = new ArraySet(); - var newNames = new ArraySet(); - - // Find mappings for the "sourceFile" - this._mappings.unsortedForEach(function (mapping) { - if (mapping.source === sourceFile && mapping.originalLine != null) { - // Check if it can be mapped by the source map, then update the mapping. - var original = aSourceMapConsumer.originalPositionFor({ - line: mapping.originalLine, - column: mapping.originalColumn - }); - if (original.source != null) { - // Copy mapping - mapping.source = original.source; - if (aSourceMapPath != null) { - mapping.source = util.join(aSourceMapPath, mapping.source) - } - if (sourceRoot != null) { - mapping.source = util.relative(sourceRoot, mapping.source); - } - mapping.originalLine = original.line; - mapping.originalColumn = original.column; - if (original.name != null) { - mapping.name = original.name; - } - } - } - - var source = mapping.source; - if (source != null && !newSources.has(source)) { - newSources.add(source); - } - - var name = mapping.name; - if (name != null && !newNames.has(name)) { - newNames.add(name); - } - - }, this); - this._sources = newSources; - this._names = newNames; - - // Copy sourcesContents of applied map. - aSourceMapConsumer.sources.forEach(function (sourceFile) { - var content = aSourceMapConsumer.sourceContentFor(sourceFile); - if (content != null) { - if (aSourceMapPath != null) { - sourceFile = util.join(aSourceMapPath, sourceFile); - } - if (sourceRoot != null) { - sourceFile = util.relative(sourceRoot, sourceFile); - } - this.setSourceContent(sourceFile, content); - } - }, this); - }; - - /** - * A mapping can have one of the three levels of data: - * - * 1. Just the generated position. - * 2. The Generated position, original position, and original source. - * 3. Generated and original position, original source, as well as a name - * token. - * - * To maintain consistency, we validate that any new mapping being added falls - * in to one of these categories. - */ - SourceMapGenerator.prototype._validateMapping = - function SourceMapGenerator_validateMapping(aGenerated, aOriginal, aSource, - aName) { - // When aOriginal is truthy but has empty values for .line and .column, - // it is most likely a programmer error. In this case we throw a very - // specific error message to try to guide them the right way. - // For example: https://github.com/Polymer/polymer-bundler/pull/519 - if (aOriginal && typeof aOriginal.line !== 'number' && typeof aOriginal.column !== 'number') { - throw new Error( - 'original.line and original.column are not numbers -- you probably meant to omit ' + - 'the original mapping entirely and only map the generated position. If so, pass ' + - 'null for the original mapping instead of an object with empty or null values.' - ); - } - - if (aGenerated && 'line' in aGenerated && 'column' in aGenerated - && aGenerated.line > 0 && aGenerated.column >= 0 - && !aOriginal && !aSource && !aName) { - // Case 1. - return; - } - else if (aGenerated && 'line' in aGenerated && 'column' in aGenerated - && aOriginal && 'line' in aOriginal && 'column' in aOriginal - && aGenerated.line > 0 && aGenerated.column >= 0 - && aOriginal.line > 0 && aOriginal.column >= 0 - && aSource) { - // Cases 2 and 3. - return; - } - else { - throw new Error('Invalid mapping: ' + JSON.stringify({ - generated: aGenerated, - source: aSource, - original: aOriginal, - name: aName - })); - } - }; - - /** - * Serialize the accumulated mappings in to the stream of base 64 VLQs - * specified by the source map format. - */ - SourceMapGenerator.prototype._serializeMappings = - function SourceMapGenerator_serializeMappings() { - var previousGeneratedColumn = 0; - var previousGeneratedLine = 1; - var previousOriginalColumn = 0; - var previousOriginalLine = 0; - var previousName = 0; - var previousSource = 0; - var result = ''; - var next; - var mapping; - var nameIdx; - var sourceIdx; - - var mappings = this._mappings.toArray(); - for (var i = 0, len = mappings.length; i < len; i++) { - mapping = mappings[i]; - next = '' - - if (mapping.generatedLine !== previousGeneratedLine) { - previousGeneratedColumn = 0; - while (mapping.generatedLine !== previousGeneratedLine) { - next += ';'; - previousGeneratedLine++; - } - } - else { - if (i > 0) { - if (!util.compareByGeneratedPositionsInflated(mapping, mappings[i - 1])) { - continue; - } - next += ','; - } - } - - next += base64VLQ.encode(mapping.generatedColumn - - previousGeneratedColumn); - previousGeneratedColumn = mapping.generatedColumn; - - if (mapping.source != null) { - sourceIdx = this._sources.indexOf(mapping.source); - next += base64VLQ.encode(sourceIdx - previousSource); - previousSource = sourceIdx; - - // lines are stored 0-based in SourceMap spec version 3 - next += base64VLQ.encode(mapping.originalLine - 1 - - previousOriginalLine); - previousOriginalLine = mapping.originalLine - 1; - - next += base64VLQ.encode(mapping.originalColumn - - previousOriginalColumn); - previousOriginalColumn = mapping.originalColumn; - - if (mapping.name != null) { - nameIdx = this._names.indexOf(mapping.name); - next += base64VLQ.encode(nameIdx - previousName); - previousName = nameIdx; - } - } - - result += next; - } - - return result; - }; - - SourceMapGenerator.prototype._generateSourcesContent = - function SourceMapGenerator_generateSourcesContent(aSources, aSourceRoot) { - return aSources.map(function (source) { - if (!this._sourcesContents) { - return null; - } - if (aSourceRoot != null) { - source = util.relative(aSourceRoot, source); - } - var key = util.toSetString(source); - return Object.prototype.hasOwnProperty.call(this._sourcesContents, key) - ? this._sourcesContents[key] - : null; - }, this); - }; - - /** - * Externalize the source map. - */ - SourceMapGenerator.prototype.toJSON = - function SourceMapGenerator_toJSON() { - var map = { - version: this._version, - sources: this._sources.toArray(), - names: this._names.toArray(), - mappings: this._serializeMappings() - }; - if (this._file != null) { - map.file = this._file; - } - if (this._sourceRoot != null) { - map.sourceRoot = this._sourceRoot; - } - if (this._sourcesContents) { - map.sourcesContent = this._generateSourcesContent(map.sources, map.sourceRoot); - } - - return map; - }; - - /** - * Render the source map being generated to a string. - */ - SourceMapGenerator.prototype.toString = - function SourceMapGenerator_toString() { - return JSON.stringify(this.toJSON()); - }; - - exports.SourceMapGenerator = SourceMapGenerator; - - -/***/ }), -/* 2 */ -/***/ (function(module, exports, __webpack_require__) { - - /* -*- Mode: js; js-indent-level: 2; -*- */ - /* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - * - * Based on the Base 64 VLQ implementation in Closure Compiler: - * https://code.google.com/p/closure-compiler/source/browse/trunk/src/com/google/debugging/sourcemap/Base64VLQ.java - * - * Copyright 2011 The Closure Compiler Authors. All rights reserved. - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - - var base64 = __webpack_require__(3); - - // A single base 64 digit can contain 6 bits of data. For the base 64 variable - // length quantities we use in the source map spec, the first bit is the sign, - // the next four bits are the actual value, and the 6th bit is the - // continuation bit. The continuation bit tells us whether there are more - // digits in this value following this digit. - // - // Continuation - // | Sign - // | | - // V V - // 101011 - - var VLQ_BASE_SHIFT = 5; - - // binary: 100000 - var VLQ_BASE = 1 << VLQ_BASE_SHIFT; - - // binary: 011111 - var VLQ_BASE_MASK = VLQ_BASE - 1; - - // binary: 100000 - var VLQ_CONTINUATION_BIT = VLQ_BASE; - - /** - * Converts from a two-complement value to a value where the sign bit is - * placed in the least significant bit. For example, as decimals: - * 1 becomes 2 (10 binary), -1 becomes 3 (11 binary) - * 2 becomes 4 (100 binary), -2 becomes 5 (101 binary) - */ - function toVLQSigned(aValue) { - return aValue < 0 - ? ((-aValue) << 1) + 1 - : (aValue << 1) + 0; - } - - /** - * Converts to a two-complement value from a value where the sign bit is - * placed in the least significant bit. For example, as decimals: - * 2 (10 binary) becomes 1, 3 (11 binary) becomes -1 - * 4 (100 binary) becomes 2, 5 (101 binary) becomes -2 - */ - function fromVLQSigned(aValue) { - var isNegative = (aValue & 1) === 1; - var shifted = aValue >> 1; - return isNegative - ? -shifted - : shifted; - } - - /** - * Returns the base 64 VLQ encoded value. - */ - exports.encode = function base64VLQ_encode(aValue) { - var encoded = ""; - var digit; - - var vlq = toVLQSigned(aValue); - - do { - digit = vlq & VLQ_BASE_MASK; - vlq >>>= VLQ_BASE_SHIFT; - if (vlq > 0) { - // There are still more digits in this value, so we must make sure the - // continuation bit is marked. - digit |= VLQ_CONTINUATION_BIT; - } - encoded += base64.encode(digit); - } while (vlq > 0); - - return encoded; - }; - - /** - * Decodes the next base 64 VLQ value from the given string and returns the - * value and the rest of the string via the out parameter. - */ - exports.decode = function base64VLQ_decode(aStr, aIndex, aOutParam) { - var strLen = aStr.length; - var result = 0; - var shift = 0; - var continuation, digit; - - do { - if (aIndex >= strLen) { - throw new Error("Expected more digits in base 64 VLQ value."); - } - - digit = base64.decode(aStr.charCodeAt(aIndex++)); - if (digit === -1) { - throw new Error("Invalid base64 digit: " + aStr.charAt(aIndex - 1)); - } - - continuation = !!(digit & VLQ_CONTINUATION_BIT); - digit &= VLQ_BASE_MASK; - result = result + (digit << shift); - shift += VLQ_BASE_SHIFT; - } while (continuation); - - aOutParam.value = fromVLQSigned(result); - aOutParam.rest = aIndex; - }; - - -/***/ }), -/* 3 */ -/***/ (function(module, exports) { - - /* -*- Mode: js; js-indent-level: 2; -*- */ - /* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - - var intToCharMap = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.split(''); - - /** - * Encode an integer in the range of 0 to 63 to a single base 64 digit. - */ - exports.encode = function (number) { - if (0 <= number && number < intToCharMap.length) { - return intToCharMap[number]; - } - throw new TypeError("Must be between 0 and 63: " + number); - }; - - /** - * Decode a single base 64 character code digit to an integer. Returns -1 on - * failure. - */ - exports.decode = function (charCode) { - var bigA = 65; // 'A' - var bigZ = 90; // 'Z' - - var littleA = 97; // 'a' - var littleZ = 122; // 'z' - - var zero = 48; // '0' - var nine = 57; // '9' - - var plus = 43; // '+' - var slash = 47; // '/' - - var littleOffset = 26; - var numberOffset = 52; - - // 0 - 25: ABCDEFGHIJKLMNOPQRSTUVWXYZ - if (bigA <= charCode && charCode <= bigZ) { - return (charCode - bigA); - } - - // 26 - 51: abcdefghijklmnopqrstuvwxyz - if (littleA <= charCode && charCode <= littleZ) { - return (charCode - littleA + littleOffset); - } - - // 52 - 61: 0123456789 - if (zero <= charCode && charCode <= nine) { - return (charCode - zero + numberOffset); - } - - // 62: + - if (charCode == plus) { - return 62; - } - - // 63: / - if (charCode == slash) { - return 63; - } - - // Invalid base64 digit. - return -1; - }; - - -/***/ }), -/* 4 */ -/***/ (function(module, exports) { - - /* -*- Mode: js; js-indent-level: 2; -*- */ - /* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - - /** - * This is a helper function for getting values from parameter/options - * objects. - * - * @param args The object we are extracting values from - * @param name The name of the property we are getting. - * @param defaultValue An optional value to return if the property is missing - * from the object. If this is not specified and the property is missing, an - * error will be thrown. - */ - function getArg(aArgs, aName, aDefaultValue) { - if (aName in aArgs) { - return aArgs[aName]; - } else if (arguments.length === 3) { - return aDefaultValue; - } else { - throw new Error('"' + aName + '" is a required argument.'); - } - } - exports.getArg = getArg; - - var urlRegexp = /^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/; - var dataUrlRegexp = /^data:.+\,.+$/; - - function urlParse(aUrl) { - var match = aUrl.match(urlRegexp); - if (!match) { - return null; - } - return { - scheme: match[1], - auth: match[2], - host: match[3], - port: match[4], - path: match[5] - }; - } - exports.urlParse = urlParse; - - function urlGenerate(aParsedUrl) { - var url = ''; - if (aParsedUrl.scheme) { - url += aParsedUrl.scheme + ':'; - } - url += '//'; - if (aParsedUrl.auth) { - url += aParsedUrl.auth + '@'; - } - if (aParsedUrl.host) { - url += aParsedUrl.host; - } - if (aParsedUrl.port) { - url += ":" + aParsedUrl.port - } - if (aParsedUrl.path) { - url += aParsedUrl.path; - } - return url; - } - exports.urlGenerate = urlGenerate; - - /** - * Normalizes a path, or the path portion of a URL: - * - * - Replaces consecutive slashes with one slash. - * - Removes unnecessary '.' parts. - * - Removes unnecessary '/..' parts. - * - * Based on code in the Node.js 'path' core module. - * - * @param aPath The path or url to normalize. - */ - function normalize(aPath) { - var path = aPath; - var url = urlParse(aPath); - if (url) { - if (!url.path) { - return aPath; - } - path = url.path; - } - var isAbsolute = exports.isAbsolute(path); - - var parts = path.split(/\/+/); - for (var part, up = 0, i = parts.length - 1; i >= 0; i--) { - part = parts[i]; - if (part === '.') { - parts.splice(i, 1); - } else if (part === '..') { - up++; - } else if (up > 0) { - if (part === '') { - // The first part is blank if the path is absolute. Trying to go - // above the root is a no-op. Therefore we can remove all '..' parts - // directly after the root. - parts.splice(i + 1, up); - up = 0; - } else { - parts.splice(i, 2); - up--; - } - } - } - path = parts.join('/'); - - if (path === '') { - path = isAbsolute ? '/' : '.'; - } - - if (url) { - url.path = path; - return urlGenerate(url); - } - return path; - } - exports.normalize = normalize; - - /** - * Joins two paths/URLs. - * - * @param aRoot The root path or URL. - * @param aPath The path or URL to be joined with the root. - * - * - If aPath is a URL or a data URI, aPath is returned, unless aPath is a - * scheme-relative URL: Then the scheme of aRoot, if any, is prepended - * first. - * - Otherwise aPath is a path. If aRoot is a URL, then its path portion - * is updated with the result and aRoot is returned. Otherwise the result - * is returned. - * - If aPath is absolute, the result is aPath. - * - Otherwise the two paths are joined with a slash. - * - Joining for example 'http://' and 'www.example.com' is also supported. - */ - function join(aRoot, aPath) { - if (aRoot === "") { - aRoot = "."; - } - if (aPath === "") { - aPath = "."; - } - var aPathUrl = urlParse(aPath); - var aRootUrl = urlParse(aRoot); - if (aRootUrl) { - aRoot = aRootUrl.path || '/'; - } - - // `join(foo, '//www.example.org')` - if (aPathUrl && !aPathUrl.scheme) { - if (aRootUrl) { - aPathUrl.scheme = aRootUrl.scheme; - } - return urlGenerate(aPathUrl); - } - - if (aPathUrl || aPath.match(dataUrlRegexp)) { - return aPath; - } - - // `join('http://', 'www.example.com')` - if (aRootUrl && !aRootUrl.host && !aRootUrl.path) { - aRootUrl.host = aPath; - return urlGenerate(aRootUrl); - } - - var joined = aPath.charAt(0) === '/' - ? aPath - : normalize(aRoot.replace(/\/+$/, '') + '/' + aPath); - - if (aRootUrl) { - aRootUrl.path = joined; - return urlGenerate(aRootUrl); - } - return joined; - } - exports.join = join; - - exports.isAbsolute = function (aPath) { - return aPath.charAt(0) === '/' || urlRegexp.test(aPath); - }; - - /** - * Make a path relative to a URL or another path. - * - * @param aRoot The root path or URL. - * @param aPath The path or URL to be made relative to aRoot. - */ - function relative(aRoot, aPath) { - if (aRoot === "") { - aRoot = "."; - } - - aRoot = aRoot.replace(/\/$/, ''); - - // It is possible for the path to be above the root. In this case, simply - // checking whether the root is a prefix of the path won't work. Instead, we - // need to remove components from the root one by one, until either we find - // a prefix that fits, or we run out of components to remove. - var level = 0; - while (aPath.indexOf(aRoot + '/') !== 0) { - var index = aRoot.lastIndexOf("/"); - if (index < 0) { - return aPath; - } - - // If the only part of the root that is left is the scheme (i.e. http://, - // file:///, etc.), one or more slashes (/), or simply nothing at all, we - // have exhausted all components, so the path is not relative to the root. - aRoot = aRoot.slice(0, index); - if (aRoot.match(/^([^\/]+:\/)?\/*$/)) { - return aPath; - } - - ++level; - } - - // Make sure we add a "../" for each component we removed from the root. - return Array(level + 1).join("../") + aPath.substr(aRoot.length + 1); - } - exports.relative = relative; - - var supportsNullProto = (function () { - var obj = Object.create(null); - return !('__proto__' in obj); - }()); - - function identity (s) { - return s; - } - - /** - * Because behavior goes wacky when you set `__proto__` on objects, we - * have to prefix all the strings in our set with an arbitrary character. - * - * See https://github.com/mozilla/source-map/pull/31 and - * https://github.com/mozilla/source-map/issues/30 - * - * @param String aStr - */ - function toSetString(aStr) { - if (isProtoString(aStr)) { - return '$' + aStr; - } - - return aStr; - } - exports.toSetString = supportsNullProto ? identity : toSetString; - - function fromSetString(aStr) { - if (isProtoString(aStr)) { - return aStr.slice(1); - } - - return aStr; - } - exports.fromSetString = supportsNullProto ? identity : fromSetString; - - function isProtoString(s) { - if (!s) { - return false; - } - - var length = s.length; - - if (length < 9 /* "__proto__".length */) { - return false; - } - - if (s.charCodeAt(length - 1) !== 95 /* '_' */ || - s.charCodeAt(length - 2) !== 95 /* '_' */ || - s.charCodeAt(length - 3) !== 111 /* 'o' */ || - s.charCodeAt(length - 4) !== 116 /* 't' */ || - s.charCodeAt(length - 5) !== 111 /* 'o' */ || - s.charCodeAt(length - 6) !== 114 /* 'r' */ || - s.charCodeAt(length - 7) !== 112 /* 'p' */ || - s.charCodeAt(length - 8) !== 95 /* '_' */ || - s.charCodeAt(length - 9) !== 95 /* '_' */) { - return false; - } - - for (var i = length - 10; i >= 0; i--) { - if (s.charCodeAt(i) !== 36 /* '$' */) { - return false; - } - } - - return true; - } - - /** - * Comparator between two mappings where the original positions are compared. - * - * Optionally pass in `true` as `onlyCompareGenerated` to consider two - * mappings with the same original source/line/column, but different generated - * line and column the same. Useful when searching for a mapping with a - * stubbed out mapping. - */ - function compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) { - var cmp = strcmp(mappingA.source, mappingB.source); - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.originalLine - mappingB.originalLine; - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.originalColumn - mappingB.originalColumn; - if (cmp !== 0 || onlyCompareOriginal) { - return cmp; - } - - cmp = mappingA.generatedColumn - mappingB.generatedColumn; - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.generatedLine - mappingB.generatedLine; - if (cmp !== 0) { - return cmp; - } - - return strcmp(mappingA.name, mappingB.name); - } - exports.compareByOriginalPositions = compareByOriginalPositions; - - /** - * Comparator between two mappings with deflated source and name indices where - * the generated positions are compared. - * - * Optionally pass in `true` as `onlyCompareGenerated` to consider two - * mappings with the same generated line and column, but different - * source/name/original line and column the same. Useful when searching for a - * mapping with a stubbed out mapping. - */ - function compareByGeneratedPositionsDeflated(mappingA, mappingB, onlyCompareGenerated) { - var cmp = mappingA.generatedLine - mappingB.generatedLine; - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.generatedColumn - mappingB.generatedColumn; - if (cmp !== 0 || onlyCompareGenerated) { - return cmp; - } - - cmp = strcmp(mappingA.source, mappingB.source); - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.originalLine - mappingB.originalLine; - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.originalColumn - mappingB.originalColumn; - if (cmp !== 0) { - return cmp; - } - - return strcmp(mappingA.name, mappingB.name); - } - exports.compareByGeneratedPositionsDeflated = compareByGeneratedPositionsDeflated; - - function strcmp(aStr1, aStr2) { - if (aStr1 === aStr2) { - return 0; - } - - if (aStr1 === null) { - return 1; // aStr2 !== null - } - - if (aStr2 === null) { - return -1; // aStr1 !== null - } - - if (aStr1 > aStr2) { - return 1; - } - - return -1; - } - - /** - * Comparator between two mappings with inflated source and name strings where - * the generated positions are compared. - */ - function compareByGeneratedPositionsInflated(mappingA, mappingB) { - var cmp = mappingA.generatedLine - mappingB.generatedLine; - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.generatedColumn - mappingB.generatedColumn; - if (cmp !== 0) { - return cmp; - } - - cmp = strcmp(mappingA.source, mappingB.source); - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.originalLine - mappingB.originalLine; - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.originalColumn - mappingB.originalColumn; - if (cmp !== 0) { - return cmp; - } - - return strcmp(mappingA.name, mappingB.name); - } - exports.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflated; - - /** - * Strip any JSON XSSI avoidance prefix from the string (as documented - * in the source maps specification), and then parse the string as - * JSON. - */ - function parseSourceMapInput(str) { - return JSON.parse(str.replace(/^\)]}'[^\n]*\n/, '')); - } - exports.parseSourceMapInput = parseSourceMapInput; - - /** - * Compute the URL of a source given the the source root, the source's - * URL, and the source map's URL. - */ - function computeSourceURL(sourceRoot, sourceURL, sourceMapURL) { - sourceURL = sourceURL || ''; - - if (sourceRoot) { - // This follows what Chrome does. - if (sourceRoot[sourceRoot.length - 1] !== '/' && sourceURL[0] !== '/') { - sourceRoot += '/'; - } - // The spec says: - // Line 4: An optional source root, useful for relocating source - // files on a server or removing repeated values in the - // “sources” entry. This value is prepended to the individual - // entries in the “source” field. - sourceURL = sourceRoot + sourceURL; - } - - // Historically, SourceMapConsumer did not take the sourceMapURL as - // a parameter. This mode is still somewhat supported, which is why - // this code block is conditional. However, it's preferable to pass - // the source map URL to SourceMapConsumer, so that this function - // can implement the source URL resolution algorithm as outlined in - // the spec. This block is basically the equivalent of: - // new URL(sourceURL, sourceMapURL).toString() - // ... except it avoids using URL, which wasn't available in the - // older releases of node still supported by this library. - // - // The spec says: - // If the sources are not absolute URLs after prepending of the - // “sourceRoot”, the sources are resolved relative to the - // SourceMap (like resolving script src in a html document). - if (sourceMapURL) { - var parsed = urlParse(sourceMapURL); - if (!parsed) { - throw new Error("sourceMapURL could not be parsed"); - } - if (parsed.path) { - // Strip the last path component, but keep the "/". - var index = parsed.path.lastIndexOf('/'); - if (index >= 0) { - parsed.path = parsed.path.substring(0, index + 1); - } - } - sourceURL = join(urlGenerate(parsed), sourceURL); - } - - return normalize(sourceURL); - } - exports.computeSourceURL = computeSourceURL; - - -/***/ }), -/* 5 */ -/***/ (function(module, exports, __webpack_require__) { - - /* -*- Mode: js; js-indent-level: 2; -*- */ - /* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - - var util = __webpack_require__(4); - var has = Object.prototype.hasOwnProperty; - var hasNativeMap = typeof Map !== "undefined"; - - /** - * A data structure which is a combination of an array and a set. Adding a new - * member is O(1), testing for membership is O(1), and finding the index of an - * element is O(1). Removing elements from the set is not supported. Only - * strings are supported for membership. - */ - function ArraySet() { - this._array = []; - this._set = hasNativeMap ? new Map() : Object.create(null); - } - - /** - * Static method for creating ArraySet instances from an existing array. - */ - ArraySet.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) { - var set = new ArraySet(); - for (var i = 0, len = aArray.length; i < len; i++) { - set.add(aArray[i], aAllowDuplicates); - } - return set; - }; - - /** - * Return how many unique items are in this ArraySet. If duplicates have been - * added, than those do not count towards the size. - * - * @returns Number - */ - ArraySet.prototype.size = function ArraySet_size() { - return hasNativeMap ? this._set.size : Object.getOwnPropertyNames(this._set).length; - }; - - /** - * Add the given string to this set. - * - * @param String aStr - */ - ArraySet.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) { - var sStr = hasNativeMap ? aStr : util.toSetString(aStr); - var isDuplicate = hasNativeMap ? this.has(aStr) : has.call(this._set, sStr); - var idx = this._array.length; - if (!isDuplicate || aAllowDuplicates) { - this._array.push(aStr); - } - if (!isDuplicate) { - if (hasNativeMap) { - this._set.set(aStr, idx); - } else { - this._set[sStr] = idx; - } - } - }; - - /** - * Is the given string a member of this set? - * - * @param String aStr - */ - ArraySet.prototype.has = function ArraySet_has(aStr) { - if (hasNativeMap) { - return this._set.has(aStr); - } else { - var sStr = util.toSetString(aStr); - return has.call(this._set, sStr); - } - }; - - /** - * What is the index of the given string in the array? - * - * @param String aStr - */ - ArraySet.prototype.indexOf = function ArraySet_indexOf(aStr) { - if (hasNativeMap) { - var idx = this._set.get(aStr); - if (idx >= 0) { - return idx; - } - } else { - var sStr = util.toSetString(aStr); - if (has.call(this._set, sStr)) { - return this._set[sStr]; - } - } - - throw new Error('"' + aStr + '" is not in the set.'); - }; - - /** - * What is the element at the given index? - * - * @param Number aIdx - */ - ArraySet.prototype.at = function ArraySet_at(aIdx) { - if (aIdx >= 0 && aIdx < this._array.length) { - return this._array[aIdx]; - } - throw new Error('No element indexed by ' + aIdx); - }; - - /** - * Returns the array representation of this set (which has the proper indices - * indicated by indexOf). Note that this is a copy of the internal array used - * for storing the members so that no one can mess with internal state. - */ - ArraySet.prototype.toArray = function ArraySet_toArray() { - return this._array.slice(); - }; - - exports.ArraySet = ArraySet; - - -/***/ }), -/* 6 */ -/***/ (function(module, exports, __webpack_require__) { - - /* -*- Mode: js; js-indent-level: 2; -*- */ - /* - * Copyright 2014 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - - var util = __webpack_require__(4); - - /** - * Determine whether mappingB is after mappingA with respect to generated - * position. - */ - function generatedPositionAfter(mappingA, mappingB) { - // Optimized for most common case - var lineA = mappingA.generatedLine; - var lineB = mappingB.generatedLine; - var columnA = mappingA.generatedColumn; - var columnB = mappingB.generatedColumn; - return lineB > lineA || lineB == lineA && columnB >= columnA || - util.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0; - } - - /** - * A data structure to provide a sorted view of accumulated mappings in a - * performance conscious manner. It trades a neglibable overhead in general - * case for a large speedup in case of mappings being added in order. - */ - function MappingList() { - this._array = []; - this._sorted = true; - // Serves as infimum - this._last = {generatedLine: -1, generatedColumn: 0}; - } - - /** - * Iterate through internal items. This method takes the same arguments that - * `Array.prototype.forEach` takes. - * - * NOTE: The order of the mappings is NOT guaranteed. - */ - MappingList.prototype.unsortedForEach = - function MappingList_forEach(aCallback, aThisArg) { - this._array.forEach(aCallback, aThisArg); - }; - - /** - * Add the given source mapping. - * - * @param Object aMapping - */ - MappingList.prototype.add = function MappingList_add(aMapping) { - if (generatedPositionAfter(this._last, aMapping)) { - this._last = aMapping; - this._array.push(aMapping); - } else { - this._sorted = false; - this._array.push(aMapping); - } - }; - - /** - * Returns the flat, sorted array of mappings. The mappings are sorted by - * generated position. - * - * WARNING: This method returns internal data without copying, for - * performance. The return value must NOT be mutated, and should be treated as - * an immutable borrow. If you want to take ownership, you must make your own - * copy. - */ - MappingList.prototype.toArray = function MappingList_toArray() { - if (!this._sorted) { - this._array.sort(util.compareByGeneratedPositionsInflated); - this._sorted = true; - } - return this._array; - }; - - exports.MappingList = MappingList; - - -/***/ }), -/* 7 */ -/***/ (function(module, exports, __webpack_require__) { - - /* -*- Mode: js; js-indent-level: 2; -*- */ - /* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - - var util = __webpack_require__(4); - var binarySearch = __webpack_require__(8); - var ArraySet = __webpack_require__(5).ArraySet; - var base64VLQ = __webpack_require__(2); - var quickSort = __webpack_require__(9).quickSort; - - function SourceMapConsumer(aSourceMap, aSourceMapURL) { - var sourceMap = aSourceMap; - if (typeof aSourceMap === 'string') { - sourceMap = util.parseSourceMapInput(aSourceMap); - } - - return sourceMap.sections != null - ? new IndexedSourceMapConsumer(sourceMap, aSourceMapURL) - : new BasicSourceMapConsumer(sourceMap, aSourceMapURL); - } - - SourceMapConsumer.fromSourceMap = function(aSourceMap, aSourceMapURL) { - return BasicSourceMapConsumer.fromSourceMap(aSourceMap, aSourceMapURL); - } - - /** - * The version of the source mapping spec that we are consuming. - */ - SourceMapConsumer.prototype._version = 3; - - // `__generatedMappings` and `__originalMappings` are arrays that hold the - // parsed mapping coordinates from the source map's "mappings" attribute. They - // are lazily instantiated, accessed via the `_generatedMappings` and - // `_originalMappings` getters respectively, and we only parse the mappings - // and create these arrays once queried for a source location. We jump through - // these hoops because there can be many thousands of mappings, and parsing - // them is expensive, so we only want to do it if we must. - // - // Each object in the arrays is of the form: - // - // { - // generatedLine: The line number in the generated code, - // generatedColumn: The column number in the generated code, - // source: The path to the original source file that generated this - // chunk of code, - // originalLine: The line number in the original source that - // corresponds to this chunk of generated code, - // originalColumn: The column number in the original source that - // corresponds to this chunk of generated code, - // name: The name of the original symbol which generated this chunk of - // code. - // } - // - // All properties except for `generatedLine` and `generatedColumn` can be - // `null`. - // - // `_generatedMappings` is ordered by the generated positions. - // - // `_originalMappings` is ordered by the original positions. - - SourceMapConsumer.prototype.__generatedMappings = null; - Object.defineProperty(SourceMapConsumer.prototype, '_generatedMappings', { - configurable: true, - enumerable: true, - get: function () { - if (!this.__generatedMappings) { - this._parseMappings(this._mappings, this.sourceRoot); - } - - return this.__generatedMappings; - } - }); - - SourceMapConsumer.prototype.__originalMappings = null; - Object.defineProperty(SourceMapConsumer.prototype, '_originalMappings', { - configurable: true, - enumerable: true, - get: function () { - if (!this.__originalMappings) { - this._parseMappings(this._mappings, this.sourceRoot); - } - - return this.__originalMappings; - } - }); - - SourceMapConsumer.prototype._charIsMappingSeparator = - function SourceMapConsumer_charIsMappingSeparator(aStr, index) { - var c = aStr.charAt(index); - return c === ";" || c === ","; - }; - - /** - * Parse the mappings in a string in to a data structure which we can easily - * query (the ordered arrays in the `this.__generatedMappings` and - * `this.__originalMappings` properties). - */ - SourceMapConsumer.prototype._parseMappings = - function SourceMapConsumer_parseMappings(aStr, aSourceRoot) { - throw new Error("Subclasses must implement _parseMappings"); - }; - - SourceMapConsumer.GENERATED_ORDER = 1; - SourceMapConsumer.ORIGINAL_ORDER = 2; - - SourceMapConsumer.GREATEST_LOWER_BOUND = 1; - SourceMapConsumer.LEAST_UPPER_BOUND = 2; - - /** - * Iterate over each mapping between an original source/line/column and a - * generated line/column in this source map. - * - * @param Function aCallback - * The function that is called with each mapping. - * @param Object aContext - * Optional. If specified, this object will be the value of `this` every - * time that `aCallback` is called. - * @param aOrder - * Either `SourceMapConsumer.GENERATED_ORDER` or - * `SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to - * iterate over the mappings sorted by the generated file's line/column - * order or the original's source/line/column order, respectively. Defaults to - * `SourceMapConsumer.GENERATED_ORDER`. - */ - SourceMapConsumer.prototype.eachMapping = - function SourceMapConsumer_eachMapping(aCallback, aContext, aOrder) { - var context = aContext || null; - var order = aOrder || SourceMapConsumer.GENERATED_ORDER; - - var mappings; - switch (order) { - case SourceMapConsumer.GENERATED_ORDER: - mappings = this._generatedMappings; - break; - case SourceMapConsumer.ORIGINAL_ORDER: - mappings = this._originalMappings; - break; - default: - throw new Error("Unknown order of iteration."); - } - - var sourceRoot = this.sourceRoot; - mappings.map(function (mapping) { - var source = mapping.source === null ? null : this._sources.at(mapping.source); - source = util.computeSourceURL(sourceRoot, source, this._sourceMapURL); - return { - source: source, - generatedLine: mapping.generatedLine, - generatedColumn: mapping.generatedColumn, - originalLine: mapping.originalLine, - originalColumn: mapping.originalColumn, - name: mapping.name === null ? null : this._names.at(mapping.name) - }; - }, this).forEach(aCallback, context); - }; - - /** - * Returns all generated line and column information for the original source, - * line, and column provided. If no column is provided, returns all mappings - * corresponding to a either the line we are searching for or the next - * closest line that has any mappings. Otherwise, returns all mappings - * corresponding to the given line and either the column we are searching for - * or the next closest column that has any offsets. - * - * The only argument is an object with the following properties: - * - * - source: The filename of the original source. - * - line: The line number in the original source. The line number is 1-based. - * - column: Optional. the column number in the original source. - * The column number is 0-based. - * - * and an array of objects is returned, each with the following properties: - * - * - line: The line number in the generated source, or null. The - * line number is 1-based. - * - column: The column number in the generated source, or null. - * The column number is 0-based. - */ - SourceMapConsumer.prototype.allGeneratedPositionsFor = - function SourceMapConsumer_allGeneratedPositionsFor(aArgs) { - var line = util.getArg(aArgs, 'line'); - - // When there is no exact match, BasicSourceMapConsumer.prototype._findMapping - // returns the index of the closest mapping less than the needle. By - // setting needle.originalColumn to 0, we thus find the last mapping for - // the given line, provided such a mapping exists. - var needle = { - source: util.getArg(aArgs, 'source'), - originalLine: line, - originalColumn: util.getArg(aArgs, 'column', 0) - }; - - needle.source = this._findSourceIndex(needle.source); - if (needle.source < 0) { - return []; - } - - var mappings = []; - - var index = this._findMapping(needle, - this._originalMappings, - "originalLine", - "originalColumn", - util.compareByOriginalPositions, - binarySearch.LEAST_UPPER_BOUND); - if (index >= 0) { - var mapping = this._originalMappings[index]; - - if (aArgs.column === undefined) { - var originalLine = mapping.originalLine; - - // Iterate until either we run out of mappings, or we run into - // a mapping for a different line than the one we found. Since - // mappings are sorted, this is guaranteed to find all mappings for - // the line we found. - while (mapping && mapping.originalLine === originalLine) { - mappings.push({ - line: util.getArg(mapping, 'generatedLine', null), - column: util.getArg(mapping, 'generatedColumn', null), - lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null) - }); - - mapping = this._originalMappings[++index]; - } - } else { - var originalColumn = mapping.originalColumn; - - // Iterate until either we run out of mappings, or we run into - // a mapping for a different line than the one we were searching for. - // Since mappings are sorted, this is guaranteed to find all mappings for - // the line we are searching for. - while (mapping && - mapping.originalLine === line && - mapping.originalColumn == originalColumn) { - mappings.push({ - line: util.getArg(mapping, 'generatedLine', null), - column: util.getArg(mapping, 'generatedColumn', null), - lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null) - }); - - mapping = this._originalMappings[++index]; - } - } - } - - return mappings; - }; - - exports.SourceMapConsumer = SourceMapConsumer; - - /** - * A BasicSourceMapConsumer instance represents a parsed source map which we can - * query for information about the original file positions by giving it a file - * position in the generated source. - * - * The first parameter is the raw source map (either as a JSON string, or - * already parsed to an object). According to the spec, source maps have the - * following attributes: - * - * - version: Which version of the source map spec this map is following. - * - sources: An array of URLs to the original source files. - * - names: An array of identifiers which can be referrenced by individual mappings. - * - sourceRoot: Optional. The URL root from which all sources are relative. - * - sourcesContent: Optional. An array of contents of the original source files. - * - mappings: A string of base64 VLQs which contain the actual mappings. - * - file: Optional. The generated file this source map is associated with. - * - * Here is an example source map, taken from the source map spec[0]: - * - * { - * version : 3, - * file: "out.js", - * sourceRoot : "", - * sources: ["foo.js", "bar.js"], - * names: ["src", "maps", "are", "fun"], - * mappings: "AA,AB;;ABCDE;" - * } - * - * The second parameter, if given, is a string whose value is the URL - * at which the source map was found. This URL is used to compute the - * sources array. - * - * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit?pli=1# - */ - function BasicSourceMapConsumer(aSourceMap, aSourceMapURL) { - var sourceMap = aSourceMap; - if (typeof aSourceMap === 'string') { - sourceMap = util.parseSourceMapInput(aSourceMap); - } - - var version = util.getArg(sourceMap, 'version'); - var sources = util.getArg(sourceMap, 'sources'); - // Sass 3.3 leaves out the 'names' array, so we deviate from the spec (which - // requires the array) to play nice here. - var names = util.getArg(sourceMap, 'names', []); - var sourceRoot = util.getArg(sourceMap, 'sourceRoot', null); - var sourcesContent = util.getArg(sourceMap, 'sourcesContent', null); - var mappings = util.getArg(sourceMap, 'mappings'); - var file = util.getArg(sourceMap, 'file', null); - - // Once again, Sass deviates from the spec and supplies the version as a - // string rather than a number, so we use loose equality checking here. - if (version != this._version) { - throw new Error('Unsupported version: ' + version); - } - - if (sourceRoot) { - sourceRoot = util.normalize(sourceRoot); - } - - sources = sources - .map(String) - // Some source maps produce relative source paths like "./foo.js" instead of - // "foo.js". Normalize these first so that future comparisons will succeed. - // See bugzil.la/1090768. - .map(util.normalize) - // Always ensure that absolute sources are internally stored relative to - // the source root, if the source root is absolute. Not doing this would - // be particularly problematic when the source root is a prefix of the - // source (valid, but why??). See github issue #199 and bugzil.la/1188982. - .map(function (source) { - return sourceRoot && util.isAbsolute(sourceRoot) && util.isAbsolute(source) - ? util.relative(sourceRoot, source) - : source; - }); - - // Pass `true` below to allow duplicate names and sources. While source maps - // are intended to be compressed and deduplicated, the TypeScript compiler - // sometimes generates source maps with duplicates in them. See Github issue - // #72 and bugzil.la/889492. - this._names = ArraySet.fromArray(names.map(String), true); - this._sources = ArraySet.fromArray(sources, true); - - this._absoluteSources = this._sources.toArray().map(function (s) { - return util.computeSourceURL(sourceRoot, s, aSourceMapURL); - }); - - this.sourceRoot = sourceRoot; - this.sourcesContent = sourcesContent; - this._mappings = mappings; - this._sourceMapURL = aSourceMapURL; - this.file = file; - } - - BasicSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype); - BasicSourceMapConsumer.prototype.consumer = SourceMapConsumer; - - /** - * Utility function to find the index of a source. Returns -1 if not - * found. - */ - BasicSourceMapConsumer.prototype._findSourceIndex = function(aSource) { - var relativeSource = aSource; - if (this.sourceRoot != null) { - relativeSource = util.relative(this.sourceRoot, relativeSource); - } - - if (this._sources.has(relativeSource)) { - return this._sources.indexOf(relativeSource); - } - - // Maybe aSource is an absolute URL as returned by |sources|. In - // this case we can't simply undo the transform. - var i; - for (i = 0; i < this._absoluteSources.length; ++i) { - if (this._absoluteSources[i] == aSource) { - return i; - } - } - - return -1; - }; - - /** - * Create a BasicSourceMapConsumer from a SourceMapGenerator. - * - * @param SourceMapGenerator aSourceMap - * The source map that will be consumed. - * @param String aSourceMapURL - * The URL at which the source map can be found (optional) - * @returns BasicSourceMapConsumer - */ - BasicSourceMapConsumer.fromSourceMap = - function SourceMapConsumer_fromSourceMap(aSourceMap, aSourceMapURL) { - var smc = Object.create(BasicSourceMapConsumer.prototype); - - var names = smc._names = ArraySet.fromArray(aSourceMap._names.toArray(), true); - var sources = smc._sources = ArraySet.fromArray(aSourceMap._sources.toArray(), true); - smc.sourceRoot = aSourceMap._sourceRoot; - smc.sourcesContent = aSourceMap._generateSourcesContent(smc._sources.toArray(), - smc.sourceRoot); - smc.file = aSourceMap._file; - smc._sourceMapURL = aSourceMapURL; - smc._absoluteSources = smc._sources.toArray().map(function (s) { - return util.computeSourceURL(smc.sourceRoot, s, aSourceMapURL); - }); - - // Because we are modifying the entries (by converting string sources and - // names to indices into the sources and names ArraySets), we have to make - // a copy of the entry or else bad things happen. Shared mutable state - // strikes again! See github issue #191. - - var generatedMappings = aSourceMap._mappings.toArray().slice(); - var destGeneratedMappings = smc.__generatedMappings = []; - var destOriginalMappings = smc.__originalMappings = []; - - for (var i = 0, length = generatedMappings.length; i < length; i++) { - var srcMapping = generatedMappings[i]; - var destMapping = new Mapping; - destMapping.generatedLine = srcMapping.generatedLine; - destMapping.generatedColumn = srcMapping.generatedColumn; - - if (srcMapping.source) { - destMapping.source = sources.indexOf(srcMapping.source); - destMapping.originalLine = srcMapping.originalLine; - destMapping.originalColumn = srcMapping.originalColumn; - - if (srcMapping.name) { - destMapping.name = names.indexOf(srcMapping.name); - } - - destOriginalMappings.push(destMapping); - } - - destGeneratedMappings.push(destMapping); - } - - quickSort(smc.__originalMappings, util.compareByOriginalPositions); - - return smc; - }; - - /** - * The version of the source mapping spec that we are consuming. - */ - BasicSourceMapConsumer.prototype._version = 3; - - /** - * The list of original sources. - */ - Object.defineProperty(BasicSourceMapConsumer.prototype, 'sources', { - get: function () { - return this._absoluteSources.slice(); - } - }); - - /** - * Provide the JIT with a nice shape / hidden class. - */ - function Mapping() { - this.generatedLine = 0; - this.generatedColumn = 0; - this.source = null; - this.originalLine = null; - this.originalColumn = null; - this.name = null; - } - - /** - * Parse the mappings in a string in to a data structure which we can easily - * query (the ordered arrays in the `this.__generatedMappings` and - * `this.__originalMappings` properties). - */ - BasicSourceMapConsumer.prototype._parseMappings = - function SourceMapConsumer_parseMappings(aStr, aSourceRoot) { - var generatedLine = 1; - var previousGeneratedColumn = 0; - var previousOriginalLine = 0; - var previousOriginalColumn = 0; - var previousSource = 0; - var previousName = 0; - var length = aStr.length; - var index = 0; - var cachedSegments = {}; - var temp = {}; - var originalMappings = []; - var generatedMappings = []; - var mapping, str, segment, end, value; - - while (index < length) { - if (aStr.charAt(index) === ';') { - generatedLine++; - index++; - previousGeneratedColumn = 0; - } - else if (aStr.charAt(index) === ',') { - index++; - } - else { - mapping = new Mapping(); - mapping.generatedLine = generatedLine; - - // Because each offset is encoded relative to the previous one, - // many segments often have the same encoding. We can exploit this - // fact by caching the parsed variable length fields of each segment, - // allowing us to avoid a second parse if we encounter the same - // segment again. - for (end = index; end < length; end++) { - if (this._charIsMappingSeparator(aStr, end)) { - break; - } - } - str = aStr.slice(index, end); - - segment = cachedSegments[str]; - if (segment) { - index += str.length; - } else { - segment = []; - while (index < end) { - base64VLQ.decode(aStr, index, temp); - value = temp.value; - index = temp.rest; - segment.push(value); - } - - if (segment.length === 2) { - throw new Error('Found a source, but no line and column'); - } - - if (segment.length === 3) { - throw new Error('Found a source and line, but no column'); - } - - cachedSegments[str] = segment; - } - - // Generated column. - mapping.generatedColumn = previousGeneratedColumn + segment[0]; - previousGeneratedColumn = mapping.generatedColumn; - - if (segment.length > 1) { - // Original source. - mapping.source = previousSource + segment[1]; - previousSource += segment[1]; - - // Original line. - mapping.originalLine = previousOriginalLine + segment[2]; - previousOriginalLine = mapping.originalLine; - // Lines are stored 0-based - mapping.originalLine += 1; - - // Original column. - mapping.originalColumn = previousOriginalColumn + segment[3]; - previousOriginalColumn = mapping.originalColumn; - - if (segment.length > 4) { - // Original name. - mapping.name = previousName + segment[4]; - previousName += segment[4]; - } - } - - generatedMappings.push(mapping); - if (typeof mapping.originalLine === 'number') { - originalMappings.push(mapping); - } - } - } - - quickSort(generatedMappings, util.compareByGeneratedPositionsDeflated); - this.__generatedMappings = generatedMappings; - - quickSort(originalMappings, util.compareByOriginalPositions); - this.__originalMappings = originalMappings; - }; - - /** - * Find the mapping that best matches the hypothetical "needle" mapping that - * we are searching for in the given "haystack" of mappings. - */ - BasicSourceMapConsumer.prototype._findMapping = - function SourceMapConsumer_findMapping(aNeedle, aMappings, aLineName, - aColumnName, aComparator, aBias) { - // To return the position we are searching for, we must first find the - // mapping for the given position and then return the opposite position it - // points to. Because the mappings are sorted, we can use binary search to - // find the best mapping. - - if (aNeedle[aLineName] <= 0) { - throw new TypeError('Line must be greater than or equal to 1, got ' - + aNeedle[aLineName]); - } - if (aNeedle[aColumnName] < 0) { - throw new TypeError('Column must be greater than or equal to 0, got ' - + aNeedle[aColumnName]); - } - - return binarySearch.search(aNeedle, aMappings, aComparator, aBias); - }; - - /** - * Compute the last column for each generated mapping. The last column is - * inclusive. - */ - BasicSourceMapConsumer.prototype.computeColumnSpans = - function SourceMapConsumer_computeColumnSpans() { - for (var index = 0; index < this._generatedMappings.length; ++index) { - var mapping = this._generatedMappings[index]; - - // Mappings do not contain a field for the last generated columnt. We - // can come up with an optimistic estimate, however, by assuming that - // mappings are contiguous (i.e. given two consecutive mappings, the - // first mapping ends where the second one starts). - if (index + 1 < this._generatedMappings.length) { - var nextMapping = this._generatedMappings[index + 1]; - - if (mapping.generatedLine === nextMapping.generatedLine) { - mapping.lastGeneratedColumn = nextMapping.generatedColumn - 1; - continue; - } - } - - // The last mapping for each line spans the entire line. - mapping.lastGeneratedColumn = Infinity; - } - }; - - /** - * Returns the original source, line, and column information for the generated - * source's line and column positions provided. The only argument is an object - * with the following properties: - * - * - line: The line number in the generated source. The line number - * is 1-based. - * - column: The column number in the generated source. The column - * number is 0-based. - * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or - * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the - * closest element that is smaller than or greater than the one we are - * searching for, respectively, if the exact element cannot be found. - * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'. - * - * and an object is returned with the following properties: - * - * - source: The original source file, or null. - * - line: The line number in the original source, or null. The - * line number is 1-based. - * - column: The column number in the original source, or null. The - * column number is 0-based. - * - name: The original identifier, or null. - */ - BasicSourceMapConsumer.prototype.originalPositionFor = - function SourceMapConsumer_originalPositionFor(aArgs) { - var needle = { - generatedLine: util.getArg(aArgs, 'line'), - generatedColumn: util.getArg(aArgs, 'column') - }; - - var index = this._findMapping( - needle, - this._generatedMappings, - "generatedLine", - "generatedColumn", - util.compareByGeneratedPositionsDeflated, - util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND) - ); - - if (index >= 0) { - var mapping = this._generatedMappings[index]; - - if (mapping.generatedLine === needle.generatedLine) { - var source = util.getArg(mapping, 'source', null); - if (source !== null) { - source = this._sources.at(source); - source = util.computeSourceURL(this.sourceRoot, source, this._sourceMapURL); - } - var name = util.getArg(mapping, 'name', null); - if (name !== null) { - name = this._names.at(name); - } - return { - source: source, - line: util.getArg(mapping, 'originalLine', null), - column: util.getArg(mapping, 'originalColumn', null), - name: name - }; - } - } - - return { - source: null, - line: null, - column: null, - name: null - }; - }; - - /** - * Return true if we have the source content for every source in the source - * map, false otherwise. - */ - BasicSourceMapConsumer.prototype.hasContentsOfAllSources = - function BasicSourceMapConsumer_hasContentsOfAllSources() { - if (!this.sourcesContent) { - return false; - } - return this.sourcesContent.length >= this._sources.size() && - !this.sourcesContent.some(function (sc) { return sc == null; }); - }; - - /** - * Returns the original source content. The only argument is the url of the - * original source file. Returns null if no original source content is - * available. - */ - BasicSourceMapConsumer.prototype.sourceContentFor = - function SourceMapConsumer_sourceContentFor(aSource, nullOnMissing) { - if (!this.sourcesContent) { - return null; - } - - var index = this._findSourceIndex(aSource); - if (index >= 0) { - return this.sourcesContent[index]; - } - - var relativeSource = aSource; - if (this.sourceRoot != null) { - relativeSource = util.relative(this.sourceRoot, relativeSource); - } - - var url; - if (this.sourceRoot != null - && (url = util.urlParse(this.sourceRoot))) { - // XXX: file:// URIs and absolute paths lead to unexpected behavior for - // many users. We can help them out when they expect file:// URIs to - // behave like it would if they were running a local HTTP server. See - // https://bugzilla.mozilla.org/show_bug.cgi?id=885597. - var fileUriAbsPath = relativeSource.replace(/^file:\/\//, ""); - if (url.scheme == "file" - && this._sources.has(fileUriAbsPath)) { - return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)] - } - - if ((!url.path || url.path == "/") - && this._sources.has("/" + relativeSource)) { - return this.sourcesContent[this._sources.indexOf("/" + relativeSource)]; - } - } - - // This function is used recursively from - // IndexedSourceMapConsumer.prototype.sourceContentFor. In that case, we - // don't want to throw if we can't find the source - we just want to - // return null, so we provide a flag to exit gracefully. - if (nullOnMissing) { - return null; - } - else { - throw new Error('"' + relativeSource + '" is not in the SourceMap.'); - } - }; - - /** - * Returns the generated line and column information for the original source, - * line, and column positions provided. The only argument is an object with - * the following properties: - * - * - source: The filename of the original source. - * - line: The line number in the original source. The line number - * is 1-based. - * - column: The column number in the original source. The column - * number is 0-based. - * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or - * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the - * closest element that is smaller than or greater than the one we are - * searching for, respectively, if the exact element cannot be found. - * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'. - * - * and an object is returned with the following properties: - * - * - line: The line number in the generated source, or null. The - * line number is 1-based. - * - column: The column number in the generated source, or null. - * The column number is 0-based. - */ - BasicSourceMapConsumer.prototype.generatedPositionFor = - function SourceMapConsumer_generatedPositionFor(aArgs) { - var source = util.getArg(aArgs, 'source'); - source = this._findSourceIndex(source); - if (source < 0) { - return { - line: null, - column: null, - lastColumn: null - }; - } - - var needle = { - source: source, - originalLine: util.getArg(aArgs, 'line'), - originalColumn: util.getArg(aArgs, 'column') - }; - - var index = this._findMapping( - needle, - this._originalMappings, - "originalLine", - "originalColumn", - util.compareByOriginalPositions, - util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND) - ); - - if (index >= 0) { - var mapping = this._originalMappings[index]; - - if (mapping.source === needle.source) { - return { - line: util.getArg(mapping, 'generatedLine', null), - column: util.getArg(mapping, 'generatedColumn', null), - lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null) - }; - } - } - - return { - line: null, - column: null, - lastColumn: null - }; - }; - - exports.BasicSourceMapConsumer = BasicSourceMapConsumer; - - /** - * An IndexedSourceMapConsumer instance represents a parsed source map which - * we can query for information. It differs from BasicSourceMapConsumer in - * that it takes "indexed" source maps (i.e. ones with a "sections" field) as - * input. - * - * The first parameter is a raw source map (either as a JSON string, or already - * parsed to an object). According to the spec for indexed source maps, they - * have the following attributes: - * - * - version: Which version of the source map spec this map is following. - * - file: Optional. The generated file this source map is associated with. - * - sections: A list of section definitions. - * - * Each value under the "sections" field has two fields: - * - offset: The offset into the original specified at which this section - * begins to apply, defined as an object with a "line" and "column" - * field. - * - map: A source map definition. This source map could also be indexed, - * but doesn't have to be. - * - * Instead of the "map" field, it's also possible to have a "url" field - * specifying a URL to retrieve a source map from, but that's currently - * unsupported. - * - * Here's an example source map, taken from the source map spec[0], but - * modified to omit a section which uses the "url" field. - * - * { - * version : 3, - * file: "app.js", - * sections: [{ - * offset: {line:100, column:10}, - * map: { - * version : 3, - * file: "section.js", - * sources: ["foo.js", "bar.js"], - * names: ["src", "maps", "are", "fun"], - * mappings: "AAAA,E;;ABCDE;" - * } - * }], - * } - * - * The second parameter, if given, is a string whose value is the URL - * at which the source map was found. This URL is used to compute the - * sources array. - * - * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit#heading=h.535es3xeprgt - */ - function IndexedSourceMapConsumer(aSourceMap, aSourceMapURL) { - var sourceMap = aSourceMap; - if (typeof aSourceMap === 'string') { - sourceMap = util.parseSourceMapInput(aSourceMap); - } - - var version = util.getArg(sourceMap, 'version'); - var sections = util.getArg(sourceMap, 'sections'); - - if (version != this._version) { - throw new Error('Unsupported version: ' + version); - } - - this._sources = new ArraySet(); - this._names = new ArraySet(); - - var lastOffset = { - line: -1, - column: 0 - }; - this._sections = sections.map(function (s) { - if (s.url) { - // The url field will require support for asynchronicity. - // See https://github.com/mozilla/source-map/issues/16 - throw new Error('Support for url field in sections not implemented.'); - } - var offset = util.getArg(s, 'offset'); - var offsetLine = util.getArg(offset, 'line'); - var offsetColumn = util.getArg(offset, 'column'); - - if (offsetLine < lastOffset.line || - (offsetLine === lastOffset.line && offsetColumn < lastOffset.column)) { - throw new Error('Section offsets must be ordered and non-overlapping.'); - } - lastOffset = offset; - - return { - generatedOffset: { - // The offset fields are 0-based, but we use 1-based indices when - // encoding/decoding from VLQ. - generatedLine: offsetLine + 1, - generatedColumn: offsetColumn + 1 - }, - consumer: new SourceMapConsumer(util.getArg(s, 'map'), aSourceMapURL) - } - }); - } - - IndexedSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype); - IndexedSourceMapConsumer.prototype.constructor = SourceMapConsumer; - - /** - * The version of the source mapping spec that we are consuming. - */ - IndexedSourceMapConsumer.prototype._version = 3; - - /** - * The list of original sources. - */ - Object.defineProperty(IndexedSourceMapConsumer.prototype, 'sources', { - get: function () { - var sources = []; - for (var i = 0; i < this._sections.length; i++) { - for (var j = 0; j < this._sections[i].consumer.sources.length; j++) { - sources.push(this._sections[i].consumer.sources[j]); - } - } - return sources; - } - }); - - /** - * Returns the original source, line, and column information for the generated - * source's line and column positions provided. The only argument is an object - * with the following properties: - * - * - line: The line number in the generated source. The line number - * is 1-based. - * - column: The column number in the generated source. The column - * number is 0-based. - * - * and an object is returned with the following properties: - * - * - source: The original source file, or null. - * - line: The line number in the original source, or null. The - * line number is 1-based. - * - column: The column number in the original source, or null. The - * column number is 0-based. - * - name: The original identifier, or null. - */ - IndexedSourceMapConsumer.prototype.originalPositionFor = - function IndexedSourceMapConsumer_originalPositionFor(aArgs) { - var needle = { - generatedLine: util.getArg(aArgs, 'line'), - generatedColumn: util.getArg(aArgs, 'column') - }; - - // Find the section containing the generated position we're trying to map - // to an original position. - var sectionIndex = binarySearch.search(needle, this._sections, - function(needle, section) { - var cmp = needle.generatedLine - section.generatedOffset.generatedLine; - if (cmp) { - return cmp; - } - - return (needle.generatedColumn - - section.generatedOffset.generatedColumn); - }); - var section = this._sections[sectionIndex]; - - if (!section) { - return { - source: null, - line: null, - column: null, - name: null - }; - } - - return section.consumer.originalPositionFor({ - line: needle.generatedLine - - (section.generatedOffset.generatedLine - 1), - column: needle.generatedColumn - - (section.generatedOffset.generatedLine === needle.generatedLine - ? section.generatedOffset.generatedColumn - 1 - : 0), - bias: aArgs.bias - }); - }; - - /** - * Return true if we have the source content for every source in the source - * map, false otherwise. - */ - IndexedSourceMapConsumer.prototype.hasContentsOfAllSources = - function IndexedSourceMapConsumer_hasContentsOfAllSources() { - return this._sections.every(function (s) { - return s.consumer.hasContentsOfAllSources(); - }); - }; - - /** - * Returns the original source content. The only argument is the url of the - * original source file. Returns null if no original source content is - * available. - */ - IndexedSourceMapConsumer.prototype.sourceContentFor = - function IndexedSourceMapConsumer_sourceContentFor(aSource, nullOnMissing) { - for (var i = 0; i < this._sections.length; i++) { - var section = this._sections[i]; - - var content = section.consumer.sourceContentFor(aSource, true); - if (content) { - return content; - } - } - if (nullOnMissing) { - return null; - } - else { - throw new Error('"' + aSource + '" is not in the SourceMap.'); - } - }; - - /** - * Returns the generated line and column information for the original source, - * line, and column positions provided. The only argument is an object with - * the following properties: - * - * - source: The filename of the original source. - * - line: The line number in the original source. The line number - * is 1-based. - * - column: The column number in the original source. The column - * number is 0-based. - * - * and an object is returned with the following properties: - * - * - line: The line number in the generated source, or null. The - * line number is 1-based. - * - column: The column number in the generated source, or null. - * The column number is 0-based. - */ - IndexedSourceMapConsumer.prototype.generatedPositionFor = - function IndexedSourceMapConsumer_generatedPositionFor(aArgs) { - for (var i = 0; i < this._sections.length; i++) { - var section = this._sections[i]; - - // Only consider this section if the requested source is in the list of - // sources of the consumer. - if (section.consumer._findSourceIndex(util.getArg(aArgs, 'source')) === -1) { - continue; - } - var generatedPosition = section.consumer.generatedPositionFor(aArgs); - if (generatedPosition) { - var ret = { - line: generatedPosition.line + - (section.generatedOffset.generatedLine - 1), - column: generatedPosition.column + - (section.generatedOffset.generatedLine === generatedPosition.line - ? section.generatedOffset.generatedColumn - 1 - : 0) - }; - return ret; - } - } - - return { - line: null, - column: null - }; - }; - - /** - * Parse the mappings in a string in to a data structure which we can easily - * query (the ordered arrays in the `this.__generatedMappings` and - * `this.__originalMappings` properties). - */ - IndexedSourceMapConsumer.prototype._parseMappings = - function IndexedSourceMapConsumer_parseMappings(aStr, aSourceRoot) { - this.__generatedMappings = []; - this.__originalMappings = []; - for (var i = 0; i < this._sections.length; i++) { - var section = this._sections[i]; - var sectionMappings = section.consumer._generatedMappings; - for (var j = 0; j < sectionMappings.length; j++) { - var mapping = sectionMappings[j]; - - var source = section.consumer._sources.at(mapping.source); - source = util.computeSourceURL(section.consumer.sourceRoot, source, this._sourceMapURL); - this._sources.add(source); - source = this._sources.indexOf(source); - - var name = null; - if (mapping.name) { - name = section.consumer._names.at(mapping.name); - this._names.add(name); - name = this._names.indexOf(name); - } - - // The mappings coming from the consumer for the section have - // generated positions relative to the start of the section, so we - // need to offset them to be relative to the start of the concatenated - // generated file. - var adjustedMapping = { - source: source, - generatedLine: mapping.generatedLine + - (section.generatedOffset.generatedLine - 1), - generatedColumn: mapping.generatedColumn + - (section.generatedOffset.generatedLine === mapping.generatedLine - ? section.generatedOffset.generatedColumn - 1 - : 0), - originalLine: mapping.originalLine, - originalColumn: mapping.originalColumn, - name: name - }; - - this.__generatedMappings.push(adjustedMapping); - if (typeof adjustedMapping.originalLine === 'number') { - this.__originalMappings.push(adjustedMapping); - } - } - } - - quickSort(this.__generatedMappings, util.compareByGeneratedPositionsDeflated); - quickSort(this.__originalMappings, util.compareByOriginalPositions); - }; - - exports.IndexedSourceMapConsumer = IndexedSourceMapConsumer; - - -/***/ }), -/* 8 */ -/***/ (function(module, exports) { - - /* -*- Mode: js; js-indent-level: 2; -*- */ - /* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - - exports.GREATEST_LOWER_BOUND = 1; - exports.LEAST_UPPER_BOUND = 2; - - /** - * Recursive implementation of binary search. - * - * @param aLow Indices here and lower do not contain the needle. - * @param aHigh Indices here and higher do not contain the needle. - * @param aNeedle The element being searched for. - * @param aHaystack The non-empty array being searched. - * @param aCompare Function which takes two elements and returns -1, 0, or 1. - * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or - * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the - * closest element that is smaller than or greater than the one we are - * searching for, respectively, if the exact element cannot be found. - */ - function recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare, aBias) { - // This function terminates when one of the following is true: - // - // 1. We find the exact element we are looking for. - // - // 2. We did not find the exact element, but we can return the index of - // the next-closest element. - // - // 3. We did not find the exact element, and there is no next-closest - // element than the one we are searching for, so we return -1. - var mid = Math.floor((aHigh - aLow) / 2) + aLow; - var cmp = aCompare(aNeedle, aHaystack[mid], true); - if (cmp === 0) { - // Found the element we are looking for. - return mid; - } - else if (cmp > 0) { - // Our needle is greater than aHaystack[mid]. - if (aHigh - mid > 1) { - // The element is in the upper half. - return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare, aBias); - } - - // The exact needle element was not found in this haystack. Determine if - // we are in termination case (3) or (2) and return the appropriate thing. - if (aBias == exports.LEAST_UPPER_BOUND) { - return aHigh < aHaystack.length ? aHigh : -1; - } else { - return mid; - } - } - else { - // Our needle is less than aHaystack[mid]. - if (mid - aLow > 1) { - // The element is in the lower half. - return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare, aBias); - } - - // we are in termination case (3) or (2) and return the appropriate thing. - if (aBias == exports.LEAST_UPPER_BOUND) { - return mid; - } else { - return aLow < 0 ? -1 : aLow; - } - } - } - - /** - * This is an implementation of binary search which will always try and return - * the index of the closest element if there is no exact hit. This is because - * mappings between original and generated line/col pairs are single points, - * and there is an implicit region between each of them, so a miss just means - * that you aren't on the very start of a region. - * - * @param aNeedle The element you are looking for. - * @param aHaystack The array that is being searched. - * @param aCompare A function which takes the needle and an element in the - * array and returns -1, 0, or 1 depending on whether the needle is less - * than, equal to, or greater than the element, respectively. - * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or - * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the - * closest element that is smaller than or greater than the one we are - * searching for, respectively, if the exact element cannot be found. - * Defaults to 'binarySearch.GREATEST_LOWER_BOUND'. - */ - exports.search = function search(aNeedle, aHaystack, aCompare, aBias) { - if (aHaystack.length === 0) { - return -1; - } - - var index = recursiveSearch(-1, aHaystack.length, aNeedle, aHaystack, - aCompare, aBias || exports.GREATEST_LOWER_BOUND); - if (index < 0) { - return -1; - } - - // We have found either the exact element, or the next-closest element than - // the one we are searching for. However, there may be more than one such - // element. Make sure we always return the smallest of these. - while (index - 1 >= 0) { - if (aCompare(aHaystack[index], aHaystack[index - 1], true) !== 0) { - break; - } - --index; - } - - return index; - }; - - -/***/ }), -/* 9 */ -/***/ (function(module, exports) { - - /* -*- Mode: js; js-indent-level: 2; -*- */ - /* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - - // It turns out that some (most?) JavaScript engines don't self-host - // `Array.prototype.sort`. This makes sense because C++ will likely remain - // faster than JS when doing raw CPU-intensive sorting. However, when using a - // custom comparator function, calling back and forth between the VM's C++ and - // JIT'd JS is rather slow *and* loses JIT type information, resulting in - // worse generated code for the comparator function than would be optimal. In - // fact, when sorting with a comparator, these costs outweigh the benefits of - // sorting in C++. By using our own JS-implemented Quick Sort (below), we get - // a ~3500ms mean speed-up in `bench/bench.html`. - - /** - * Swap the elements indexed by `x` and `y` in the array `ary`. - * - * @param {Array} ary - * The array. - * @param {Number} x - * The index of the first item. - * @param {Number} y - * The index of the second item. - */ - function swap(ary, x, y) { - var temp = ary[x]; - ary[x] = ary[y]; - ary[y] = temp; - } - - /** - * Returns a random integer within the range `low .. high` inclusive. - * - * @param {Number} low - * The lower bound on the range. - * @param {Number} high - * The upper bound on the range. - */ - function randomIntInRange(low, high) { - return Math.round(low + (Math.random() * (high - low))); - } - - /** - * The Quick Sort algorithm. - * - * @param {Array} ary - * An array to sort. - * @param {function} comparator - * Function to use to compare two items. - * @param {Number} p - * Start index of the array - * @param {Number} r - * End index of the array - */ - function doQuickSort(ary, comparator, p, r) { - // If our lower bound is less than our upper bound, we (1) partition the - // array into two pieces and (2) recurse on each half. If it is not, this is - // the empty array and our base case. - - if (p < r) { - // (1) Partitioning. - // - // The partitioning chooses a pivot between `p` and `r` and moves all - // elements that are less than or equal to the pivot to the before it, and - // all the elements that are greater than it after it. The effect is that - // once partition is done, the pivot is in the exact place it will be when - // the array is put in sorted order, and it will not need to be moved - // again. This runs in O(n) time. - - // Always choose a random pivot so that an input array which is reverse - // sorted does not cause O(n^2) running time. - var pivotIndex = randomIntInRange(p, r); - var i = p - 1; - - swap(ary, pivotIndex, r); - var pivot = ary[r]; - - // Immediately after `j` is incremented in this loop, the following hold - // true: - // - // * Every element in `ary[p .. i]` is less than or equal to the pivot. - // - // * Every element in `ary[i+1 .. j-1]` is greater than the pivot. - for (var j = p; j < r; j++) { - if (comparator(ary[j], pivot) <= 0) { - i += 1; - swap(ary, i, j); - } - } - - swap(ary, i + 1, j); - var q = i + 1; - - // (2) Recurse on each half. - - doQuickSort(ary, comparator, p, q - 1); - doQuickSort(ary, comparator, q + 1, r); - } - } - - /** - * Sort the given array in-place with the given comparator function. - * - * @param {Array} ary - * An array to sort. - * @param {function} comparator - * Function to use to compare two items. - */ - exports.quickSort = function (ary, comparator) { - doQuickSort(ary, comparator, 0, ary.length - 1); - }; - - -/***/ }), -/* 10 */ -/***/ (function(module, exports, __webpack_require__) { - - /* -*- Mode: js; js-indent-level: 2; -*- */ - /* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - - var SourceMapGenerator = __webpack_require__(1).SourceMapGenerator; - var util = __webpack_require__(4); - - // Matches a Windows-style `\r\n` newline or a `\n` newline used by all other - // operating systems these days (capturing the result). - var REGEX_NEWLINE = /(\r?\n)/; - - // Newline character code for charCodeAt() comparisons - var NEWLINE_CODE = 10; - - // Private symbol for identifying `SourceNode`s when multiple versions of - // the source-map library are loaded. This MUST NOT CHANGE across - // versions! - var isSourceNode = "$$$isSourceNode$$$"; - - /** - * SourceNodes provide a way to abstract over interpolating/concatenating - * snippets of generated JavaScript source code while maintaining the line and - * column information associated with the original source code. - * - * @param aLine The original line number. - * @param aColumn The original column number. - * @param aSource The original source's filename. - * @param aChunks Optional. An array of strings which are snippets of - * generated JS, or other SourceNodes. - * @param aName The original identifier. - */ - function SourceNode(aLine, aColumn, aSource, aChunks, aName) { - this.children = []; - this.sourceContents = {}; - this.line = aLine == null ? null : aLine; - this.column = aColumn == null ? null : aColumn; - this.source = aSource == null ? null : aSource; - this.name = aName == null ? null : aName; - this[isSourceNode] = true; - if (aChunks != null) this.add(aChunks); - } - - /** - * Creates a SourceNode from generated code and a SourceMapConsumer. - * - * @param aGeneratedCode The generated code - * @param aSourceMapConsumer The SourceMap for the generated code - * @param aRelativePath Optional. The path that relative sources in the - * SourceMapConsumer should be relative to. - */ - SourceNode.fromStringWithSourceMap = - function SourceNode_fromStringWithSourceMap(aGeneratedCode, aSourceMapConsumer, aRelativePath) { - // The SourceNode we want to fill with the generated code - // and the SourceMap - var node = new SourceNode(); - - // All even indices of this array are one line of the generated code, - // while all odd indices are the newlines between two adjacent lines - // (since `REGEX_NEWLINE` captures its match). - // Processed fragments are accessed by calling `shiftNextLine`. - var remainingLines = aGeneratedCode.split(REGEX_NEWLINE); - var remainingLinesIndex = 0; - var shiftNextLine = function() { - var lineContents = getNextLine(); - // The last line of a file might not have a newline. - var newLine = getNextLine() || ""; - return lineContents + newLine; - - function getNextLine() { - return remainingLinesIndex < remainingLines.length ? - remainingLines[remainingLinesIndex++] : undefined; - } - }; - - // We need to remember the position of "remainingLines" - var lastGeneratedLine = 1, lastGeneratedColumn = 0; - - // The generate SourceNodes we need a code range. - // To extract it current and last mapping is used. - // Here we store the last mapping. - var lastMapping = null; - - aSourceMapConsumer.eachMapping(function (mapping) { - if (lastMapping !== null) { - // We add the code from "lastMapping" to "mapping": - // First check if there is a new line in between. - if (lastGeneratedLine < mapping.generatedLine) { - // Associate first line with "lastMapping" - addMappingWithCode(lastMapping, shiftNextLine()); - lastGeneratedLine++; - lastGeneratedColumn = 0; - // The remaining code is added without mapping - } else { - // There is no new line in between. - // Associate the code between "lastGeneratedColumn" and - // "mapping.generatedColumn" with "lastMapping" - var nextLine = remainingLines[remainingLinesIndex] || ''; - var code = nextLine.substr(0, mapping.generatedColumn - - lastGeneratedColumn); - remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn - - lastGeneratedColumn); - lastGeneratedColumn = mapping.generatedColumn; - addMappingWithCode(lastMapping, code); - // No more remaining code, continue - lastMapping = mapping; - return; - } - } - // We add the generated code until the first mapping - // to the SourceNode without any mapping. - // Each line is added as separate string. - while (lastGeneratedLine < mapping.generatedLine) { - node.add(shiftNextLine()); - lastGeneratedLine++; - } - if (lastGeneratedColumn < mapping.generatedColumn) { - var nextLine = remainingLines[remainingLinesIndex] || ''; - node.add(nextLine.substr(0, mapping.generatedColumn)); - remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn); - lastGeneratedColumn = mapping.generatedColumn; - } - lastMapping = mapping; - }, this); - // We have processed all mappings. - if (remainingLinesIndex < remainingLines.length) { - if (lastMapping) { - // Associate the remaining code in the current line with "lastMapping" - addMappingWithCode(lastMapping, shiftNextLine()); - } - // and add the remaining lines without any mapping - node.add(remainingLines.splice(remainingLinesIndex).join("")); - } - - // Copy sourcesContent into SourceNode - aSourceMapConsumer.sources.forEach(function (sourceFile) { - var content = aSourceMapConsumer.sourceContentFor(sourceFile); - if (content != null) { - if (aRelativePath != null) { - sourceFile = util.join(aRelativePath, sourceFile); - } - node.setSourceContent(sourceFile, content); - } - }); - - return node; - - function addMappingWithCode(mapping, code) { - if (mapping === null || mapping.source === undefined) { - node.add(code); - } else { - var source = aRelativePath - ? util.join(aRelativePath, mapping.source) - : mapping.source; - node.add(new SourceNode(mapping.originalLine, - mapping.originalColumn, - source, - code, - mapping.name)); - } - } - }; - - /** - * Add a chunk of generated JS to this source node. - * - * @param aChunk A string snippet of generated JS code, another instance of - * SourceNode, or an array where each member is one of those things. - */ - SourceNode.prototype.add = function SourceNode_add(aChunk) { - if (Array.isArray(aChunk)) { - aChunk.forEach(function (chunk) { - this.add(chunk); - }, this); - } - else if (aChunk[isSourceNode] || typeof aChunk === "string") { - if (aChunk) { - this.children.push(aChunk); - } - } - else { - throw new TypeError( - "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk - ); - } - return this; - }; - - /** - * Add a chunk of generated JS to the beginning of this source node. - * - * @param aChunk A string snippet of generated JS code, another instance of - * SourceNode, or an array where each member is one of those things. - */ - SourceNode.prototype.prepend = function SourceNode_prepend(aChunk) { - if (Array.isArray(aChunk)) { - for (var i = aChunk.length-1; i >= 0; i--) { - this.prepend(aChunk[i]); - } - } - else if (aChunk[isSourceNode] || typeof aChunk === "string") { - this.children.unshift(aChunk); - } - else { - throw new TypeError( - "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk - ); - } - return this; - }; - - /** - * Walk over the tree of JS snippets in this node and its children. The - * walking function is called once for each snippet of JS and is passed that - * snippet and the its original associated source's line/column location. - * - * @param aFn The traversal function. - */ - SourceNode.prototype.walk = function SourceNode_walk(aFn) { - var chunk; - for (var i = 0, len = this.children.length; i < len; i++) { - chunk = this.children[i]; - if (chunk[isSourceNode]) { - chunk.walk(aFn); - } - else { - if (chunk !== '') { - aFn(chunk, { source: this.source, - line: this.line, - column: this.column, - name: this.name }); - } - } - } - }; - - /** - * Like `String.prototype.join` except for SourceNodes. Inserts `aStr` between - * each of `this.children`. - * - * @param aSep The separator. - */ - SourceNode.prototype.join = function SourceNode_join(aSep) { - var newChildren; - var i; - var len = this.children.length; - if (len > 0) { - newChildren = []; - for (i = 0; i < len-1; i++) { - newChildren.push(this.children[i]); - newChildren.push(aSep); - } - newChildren.push(this.children[i]); - this.children = newChildren; - } - return this; - }; - - /** - * Call String.prototype.replace on the very right-most source snippet. Useful - * for trimming whitespace from the end of a source node, etc. - * - * @param aPattern The pattern to replace. - * @param aReplacement The thing to replace the pattern with. - */ - SourceNode.prototype.replaceRight = function SourceNode_replaceRight(aPattern, aReplacement) { - var lastChild = this.children[this.children.length - 1]; - if (lastChild[isSourceNode]) { - lastChild.replaceRight(aPattern, aReplacement); - } - else if (typeof lastChild === 'string') { - this.children[this.children.length - 1] = lastChild.replace(aPattern, aReplacement); - } - else { - this.children.push(''.replace(aPattern, aReplacement)); - } - return this; - }; - - /** - * Set the source content for a source file. This will be added to the SourceMapGenerator - * in the sourcesContent field. - * - * @param aSourceFile The filename of the source file - * @param aSourceContent The content of the source file - */ - SourceNode.prototype.setSourceContent = - function SourceNode_setSourceContent(aSourceFile, aSourceContent) { - this.sourceContents[util.toSetString(aSourceFile)] = aSourceContent; - }; - - /** - * Walk over the tree of SourceNodes. The walking function is called for each - * source file content and is passed the filename and source content. - * - * @param aFn The traversal function. - */ - SourceNode.prototype.walkSourceContents = - function SourceNode_walkSourceContents(aFn) { - for (var i = 0, len = this.children.length; i < len; i++) { - if (this.children[i][isSourceNode]) { - this.children[i].walkSourceContents(aFn); - } - } - - var sources = Object.keys(this.sourceContents); - for (var i = 0, len = sources.length; i < len; i++) { - aFn(util.fromSetString(sources[i]), this.sourceContents[sources[i]]); - } - }; - - /** - * Return the string representation of this source node. Walks over the tree - * and concatenates all the various snippets together to one string. - */ - SourceNode.prototype.toString = function SourceNode_toString() { - var str = ""; - this.walk(function (chunk) { - str += chunk; - }); - return str; - }; - - /** - * Returns the string representation of this source node along with a source - * map. - */ - SourceNode.prototype.toStringWithSourceMap = function SourceNode_toStringWithSourceMap(aArgs) { - var generated = { - code: "", - line: 1, - column: 0 - }; - var map = new SourceMapGenerator(aArgs); - var sourceMappingActive = false; - var lastOriginalSource = null; - var lastOriginalLine = null; - var lastOriginalColumn = null; - var lastOriginalName = null; - this.walk(function (chunk, original) { - generated.code += chunk; - if (original.source !== null - && original.line !== null - && original.column !== null) { - if(lastOriginalSource !== original.source - || lastOriginalLine !== original.line - || lastOriginalColumn !== original.column - || lastOriginalName !== original.name) { - map.addMapping({ - source: original.source, - original: { - line: original.line, - column: original.column - }, - generated: { - line: generated.line, - column: generated.column - }, - name: original.name - }); - } - lastOriginalSource = original.source; - lastOriginalLine = original.line; - lastOriginalColumn = original.column; - lastOriginalName = original.name; - sourceMappingActive = true; - } else if (sourceMappingActive) { - map.addMapping({ - generated: { - line: generated.line, - column: generated.column - } - }); - lastOriginalSource = null; - sourceMappingActive = false; - } - for (var idx = 0, length = chunk.length; idx < length; idx++) { - if (chunk.charCodeAt(idx) === NEWLINE_CODE) { - generated.line++; - generated.column = 0; - // Mappings end at eol - if (idx + 1 === length) { - lastOriginalSource = null; - sourceMappingActive = false; - } else if (sourceMappingActive) { - map.addMapping({ - source: original.source, - original: { - line: original.line, - column: original.column - }, - generated: { - line: generated.line, - column: generated.column - }, - name: original.name - }); - } - } else { - generated.column++; - } - } - }); - this.walkSourceContents(function (sourceFile, sourceContent) { - map.setSourceContent(sourceFile, sourceContent); - }); - - return { code: generated.code, map: map }; - }; - - exports.SourceNode = SourceNode; - - -/***/ }) -/******/ ]) -}); -; -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vd2VicGFjay91bml2ZXJzYWxNb2R1bGVEZWZpbml0aW9uIiwid2VicGFjazovLy93ZWJwYWNrL2Jvb3RzdHJhcCAxNjI0YzcyOTliODg3ZjdiZGY2NCIsIndlYnBhY2s6Ly8vLi9zb3VyY2UtbWFwLmpzIiwid2VicGFjazovLy8uL2xpYi9zb3VyY2UtbWFwLWdlbmVyYXRvci5qcyIsIndlYnBhY2s6Ly8vLi9saWIvYmFzZTY0LXZscS5qcyIsIndlYnBhY2s6Ly8vLi9saWIvYmFzZTY0LmpzIiwid2VicGFjazovLy8uL2xpYi91dGlsLmpzIiwid2VicGFjazovLy8uL2xpYi9hcnJheS1zZXQuanMiLCJ3ZWJwYWNrOi8vLy4vbGliL21hcHBpbmctbGlzdC5qcyIsIndlYnBhY2s6Ly8vLi9saWIvc291cmNlLW1hcC1jb25zdW1lci5qcyIsIndlYnBhY2s6Ly8vLi9saWIvYmluYXJ5LXNlYXJjaC5qcyIsIndlYnBhY2s6Ly8vLi9saWIvcXVpY2stc29ydC5qcyIsIndlYnBhY2s6Ly8vLi9saWIvc291cmNlLW5vZGUuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsQ0FBQztBQUNELE87QUNWQTtBQUNBOztBQUVBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQSx1QkFBZTtBQUNmO0FBQ0E7QUFDQTs7QUFFQTtBQUNBOztBQUVBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBOzs7QUFHQTtBQUNBOztBQUVBO0FBQ0E7O0FBRUE7QUFDQTs7QUFFQTtBQUNBOzs7Ozs7O0FDdENBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Ozs7Ozs7QUNQQSxpQkFBZ0Isb0JBQW9CO0FBQ3BDO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsTUFBSztBQUNMO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQSxNQUFLO0FBQ0w7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQSxNQUFLO0FBQ0w7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLE1BQUs7QUFDTDs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSxNQUFLO0FBQ0w7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsVUFBUztBQUNUO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBOztBQUVBLE1BQUs7QUFDTDtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLE1BQUs7QUFDTDs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsUUFBTztBQUNQO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBLDJDQUEwQyxTQUFTO0FBQ25EO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0EscUJBQW9CO0FBQ3BCO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTs7QUFFQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsTUFBSztBQUNMOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTs7Ozs7OztBQ3hhQSxpQkFBZ0Isb0JBQW9CO0FBQ3BDO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSw0REFBMkQ7QUFDM0QscUJBQW9CO0FBQ3BCO0FBQ0E7QUFDQTtBQUNBOztBQUVBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7O0FBRUE7QUFDQTs7QUFFQTtBQUNBOztBQUVBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsSUFBRzs7QUFFSDtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLElBQUc7O0FBRUg7QUFDQTtBQUNBOzs7Ozs7O0FDM0lBLGlCQUFnQixvQkFBb0I7QUFDcEM7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLGlCQUFnQjtBQUNoQixpQkFBZ0I7O0FBRWhCLG9CQUFtQjtBQUNuQixxQkFBb0I7O0FBRXBCLGlCQUFnQjtBQUNoQixpQkFBZ0I7O0FBRWhCLGlCQUFnQjtBQUNoQixrQkFBaUI7O0FBRWpCO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBOzs7Ozs7O0FDbEVBLGlCQUFnQixvQkFBb0I7QUFDcEM7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLElBQUc7QUFDSDtBQUNBLElBQUc7QUFDSDtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBLCtDQUE4QyxRQUFRO0FBQ3REO0FBQ0E7QUFDQTtBQUNBLE1BQUs7QUFDTDtBQUNBLE1BQUs7QUFDTDtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSxRQUFPO0FBQ1A7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0EsRUFBQzs7QUFFRDtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTs7QUFFQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQSw0QkFBMkIsUUFBUTtBQUNuQztBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBLGNBQWE7QUFDYjs7QUFFQTtBQUNBLGVBQWM7QUFDZDs7QUFFQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLHVDQUFzQztBQUN0QztBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBOzs7Ozs7O0FDdmVBLGlCQUFnQixvQkFBb0I7QUFDcEM7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLHVDQUFzQyxTQUFTO0FBQy9DO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSxNQUFLO0FBQ0w7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLElBQUc7QUFDSDtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsSUFBRztBQUNIO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7Ozs7Ozs7QUN4SEEsaUJBQWdCLG9CQUFvQjtBQUNwQztBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLGlCQUFnQjtBQUNoQjs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSxJQUFHO0FBQ0g7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7Ozs7Ozs7QUM5RUEsaUJBQWdCLG9CQUFvQjtBQUNwQztBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQSxFQUFDOztBQUVEO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBLEVBQUM7O0FBRUQ7QUFDQTtBQUNBO0FBQ0Esb0JBQW1CO0FBQ25COztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBOztBQUVBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLE1BQUs7QUFDTDs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLFlBQVc7O0FBRVg7QUFDQTtBQUNBLFFBQU87QUFDUDs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsWUFBVzs7QUFFWDtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBOztBQUVBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsNEJBQTJCLE1BQU07QUFDakM7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSxNQUFLOztBQUVMO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0EsSUFBRzs7QUFFSDtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBLGNBQWEsa0NBQWtDO0FBQy9DO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLE1BQUs7O0FBRUw7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBOztBQUVBLHVEQUFzRCxZQUFZO0FBQ2xFO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBOztBQUVBO0FBQ0E7O0FBRUE7O0FBRUE7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLEVBQUM7O0FBRUQ7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0Esb0NBQW1DO0FBQ25DO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSwwQkFBeUIsY0FBYztBQUN2QztBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBLFVBQVM7QUFDVDtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBOztBQUVBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0Esd0JBQXVCLHdDQUF3QztBQUMvRDs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLGdEQUErQyxtQkFBbUIsRUFBRTtBQUNwRTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSxrQkFBaUIsb0JBQW9CO0FBQ3JDO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSw4QkFBNkIsTUFBTTtBQUNuQztBQUNBLFFBQU87QUFDUDtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsUUFBTztBQUNQO0FBQ0E7QUFDQSxJQUFHO0FBQ0g7O0FBRUE7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSxvQkFBbUIsMkJBQTJCO0FBQzlDLHNCQUFxQiwrQ0FBK0M7QUFDcEU7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLEVBQUM7O0FBRUQ7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0EsUUFBTztBQUNQOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLE1BQUs7QUFDTDs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsTUFBSztBQUNMOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0Esb0JBQW1CLDJCQUEyQjtBQUM5Qzs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLG9CQUFtQiwyQkFBMkI7QUFDOUM7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0Esb0JBQW1CLDJCQUEyQjtBQUM5QztBQUNBO0FBQ0Esc0JBQXFCLDRCQUE0QjtBQUNqRDs7QUFFQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTs7QUFFQTs7Ozs7OztBQ3huQ0EsaUJBQWdCLG9CQUFvQjtBQUNwQztBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLE1BQUs7QUFDTDtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0EsTUFBSztBQUNMO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7Ozs7Ozs7QUM5R0EsaUJBQWdCLG9CQUFvQjtBQUNwQztBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQSxZQUFXLE1BQU07QUFDakI7QUFDQSxZQUFXLE9BQU87QUFDbEI7QUFDQSxZQUFXLE9BQU87QUFDbEI7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0EsWUFBVyxPQUFPO0FBQ2xCO0FBQ0EsWUFBVyxPQUFPO0FBQ2xCO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0EsWUFBVyxNQUFNO0FBQ2pCO0FBQ0EsWUFBVyxTQUFTO0FBQ3BCO0FBQ0EsWUFBVyxPQUFPO0FBQ2xCO0FBQ0EsWUFBVyxPQUFPO0FBQ2xCO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSxvQkFBbUIsT0FBTztBQUMxQjtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7O0FBRUE7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0EsWUFBVyxNQUFNO0FBQ2pCO0FBQ0EsWUFBVyxTQUFTO0FBQ3BCO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Ozs7Ozs7QUNqSEEsaUJBQWdCLG9CQUFvQjtBQUNwQztBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBOztBQUVBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSxVQUFTO0FBQ1Q7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLE1BQUs7QUFDTDtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsTUFBSzs7QUFFTDs7QUFFQTtBQUNBO0FBQ0E7QUFDQSxRQUFPO0FBQ1A7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLE1BQUs7QUFDTDtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0Esa0NBQWlDLFFBQVE7QUFDekM7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsOENBQTZDLFNBQVM7QUFDdEQ7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EscUJBQW9CO0FBQ3BCO0FBQ0E7QUFDQSx1Q0FBc0M7QUFDdEM7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsZ0JBQWUsV0FBVztBQUMxQjtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsZ0RBQStDLFNBQVM7QUFDeEQ7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQSwwQ0FBeUMsU0FBUztBQUNsRDtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLElBQUc7QUFDSDtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLFlBQVc7QUFDWDtBQUNBO0FBQ0E7QUFDQSxZQUFXO0FBQ1g7QUFDQSxVQUFTO0FBQ1Q7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsTUFBSztBQUNMO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSxRQUFPO0FBQ1A7QUFDQTtBQUNBO0FBQ0EsNkNBQTRDLGNBQWM7QUFDMUQ7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSxVQUFTO0FBQ1Q7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLGNBQWE7QUFDYjtBQUNBO0FBQ0E7QUFDQSxjQUFhO0FBQ2I7QUFDQSxZQUFXO0FBQ1g7QUFDQSxRQUFPO0FBQ1A7QUFDQTtBQUNBO0FBQ0EsSUFBRztBQUNIO0FBQ0E7QUFDQSxJQUFHOztBQUVILFdBQVU7QUFDVjs7QUFFQSIsImZpbGUiOiJzb3VyY2UtbWFwLmRlYnVnLmpzIiwic291cmNlc0NvbnRlbnQiOlsiKGZ1bmN0aW9uIHdlYnBhY2tVbml2ZXJzYWxNb2R1bGVEZWZpbml0aW9uKHJvb3QsIGZhY3RvcnkpIHtcblx0aWYodHlwZW9mIGV4cG9ydHMgPT09ICdvYmplY3QnICYmIHR5cGVvZiBtb2R1bGUgPT09ICdvYmplY3QnKVxuXHRcdG1vZHVsZS5leHBvcnRzID0gZmFjdG9yeSgpO1xuXHRlbHNlIGlmKHR5cGVvZiBkZWZpbmUgPT09ICdmdW5jdGlvbicgJiYgZGVmaW5lLmFtZClcblx0XHRkZWZpbmUoW10sIGZhY3RvcnkpO1xuXHRlbHNlIGlmKHR5cGVvZiBleHBvcnRzID09PSAnb2JqZWN0Jylcblx0XHRleHBvcnRzW1wic291cmNlTWFwXCJdID0gZmFjdG9yeSgpO1xuXHRlbHNlXG5cdFx0cm9vdFtcInNvdXJjZU1hcFwiXSA9IGZhY3RvcnkoKTtcbn0pKHRoaXMsIGZ1bmN0aW9uKCkge1xucmV0dXJuIFxuXG5cbi8vIFdFQlBBQ0sgRk9PVEVSIC8vXG4vLyB3ZWJwYWNrL3VuaXZlcnNhbE1vZHVsZURlZmluaXRpb24iLCIgXHQvLyBUaGUgbW9kdWxlIGNhY2hlXG4gXHR2YXIgaW5zdGFsbGVkTW9kdWxlcyA9IHt9O1xuXG4gXHQvLyBUaGUgcmVxdWlyZSBmdW5jdGlvblxuIFx0ZnVuY3Rpb24gX193ZWJwYWNrX3JlcXVpcmVfXyhtb2R1bGVJZCkge1xuXG4gXHRcdC8vIENoZWNrIGlmIG1vZHVsZSBpcyBpbiBjYWNoZVxuIFx0XHRpZihpbnN0YWxsZWRNb2R1bGVzW21vZHVsZUlkXSlcbiBcdFx0XHRyZXR1cm4gaW5zdGFsbGVkTW9kdWxlc1ttb2R1bGVJZF0uZXhwb3J0cztcblxuIFx0XHQvLyBDcmVhdGUgYSBuZXcgbW9kdWxlIChhbmQgcHV0IGl0IGludG8gdGhlIGNhY2hlKVxuIFx0XHR2YXIgbW9kdWxlID0gaW5zdGFsbGVkTW9kdWxlc1ttb2R1bGVJZF0gPSB7XG4gXHRcdFx0ZXhwb3J0czoge30sXG4gXHRcdFx0aWQ6IG1vZHVsZUlkLFxuIFx0XHRcdGxvYWRlZDogZmFsc2VcbiBcdFx0fTtcblxuIFx0XHQvLyBFeGVjdXRlIHRoZSBtb2R1bGUgZnVuY3Rpb25cbiBcdFx0bW9kdWxlc1ttb2R1bGVJZF0uY2FsbChtb2R1bGUuZXhwb3J0cywgbW9kdWxlLCBtb2R1bGUuZXhwb3J0cywgX193ZWJwYWNrX3JlcXVpcmVfXyk7XG5cbiBcdFx0Ly8gRmxhZyB0aGUgbW9kdWxlIGFzIGxvYWRlZFxuIFx0XHRtb2R1bGUubG9hZGVkID0gdHJ1ZTtcblxuIFx0XHQvLyBSZXR1cm4gdGhlIGV4cG9ydHMgb2YgdGhlIG1vZHVsZVxuIFx0XHRyZXR1cm4gbW9kdWxlLmV4cG9ydHM7XG4gXHR9XG5cblxuIFx0Ly8gZXhwb3NlIHRoZSBtb2R1bGVzIG9iamVjdCAoX193ZWJwYWNrX21vZHVsZXNfXylcbiBcdF9fd2VicGFja19yZXF1aXJlX18ubSA9IG1vZHVsZXM7XG5cbiBcdC8vIGV4cG9zZSB0aGUgbW9kdWxlIGNhY2hlXG4gXHRfX3dlYnBhY2tfcmVxdWlyZV9fLmMgPSBpbnN0YWxsZWRNb2R1bGVzO1xuXG4gXHQvLyBfX3dlYnBhY2tfcHVibGljX3BhdGhfX1xuIFx0X193ZWJwYWNrX3JlcXVpcmVfXy5wID0gXCJcIjtcblxuIFx0Ly8gTG9hZCBlbnRyeSBtb2R1bGUgYW5kIHJldHVybiBleHBvcnRzXG4gXHRyZXR1cm4gX193ZWJwYWNrX3JlcXVpcmVfXygwKTtcblxuXG5cbi8vIFdFQlBBQ0sgRk9PVEVSIC8vXG4vLyB3ZWJwYWNrL2Jvb3RzdHJhcCAxNjI0YzcyOTliODg3ZjdiZGY2NCIsIi8qXG4gKiBDb3B5cmlnaHQgMjAwOS0yMDExIE1vemlsbGEgRm91bmRhdGlvbiBhbmQgY29udHJpYnV0b3JzXG4gKiBMaWNlbnNlZCB1bmRlciB0aGUgTmV3IEJTRCBsaWNlbnNlLiBTZWUgTElDRU5TRS50eHQgb3I6XG4gKiBodHRwOi8vb3BlbnNvdXJjZS5vcmcvbGljZW5zZXMvQlNELTMtQ2xhdXNlXG4gKi9cbmV4cG9ydHMuU291cmNlTWFwR2VuZXJhdG9yID0gcmVxdWlyZSgnLi9saWIvc291cmNlLW1hcC1nZW5lcmF0b3InKS5Tb3VyY2VNYXBHZW5lcmF0b3I7XG5leHBvcnRzLlNvdXJjZU1hcENvbnN1bWVyID0gcmVxdWlyZSgnLi9saWIvc291cmNlLW1hcC1jb25zdW1lcicpLlNvdXJjZU1hcENvbnN1bWVyO1xuZXhwb3J0cy5Tb3VyY2VOb2RlID0gcmVxdWlyZSgnLi9saWIvc291cmNlLW5vZGUnKS5Tb3VyY2VOb2RlO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9zb3VyY2UtbWFwLmpzXG4vLyBtb2R1bGUgaWQgPSAwXG4vLyBtb2R1bGUgY2h1bmtzID0gMCIsIi8qIC0qLSBNb2RlOiBqczsganMtaW5kZW50LWxldmVsOiAyOyAtKi0gKi9cbi8qXG4gKiBDb3B5cmlnaHQgMjAxMSBNb3ppbGxhIEZvdW5kYXRpb24gYW5kIGNvbnRyaWJ1dG9yc1xuICogTGljZW5zZWQgdW5kZXIgdGhlIE5ldyBCU0QgbGljZW5zZS4gU2VlIExJQ0VOU0Ugb3I6XG4gKiBodHRwOi8vb3BlbnNvdXJjZS5vcmcvbGljZW5zZXMvQlNELTMtQ2xhdXNlXG4gKi9cblxudmFyIGJhc2U2NFZMUSA9IHJlcXVpcmUoJy4vYmFzZTY0LXZscScpO1xudmFyIHV0aWwgPSByZXF1aXJlKCcuL3V0aWwnKTtcbnZhciBBcnJheVNldCA9IHJlcXVpcmUoJy4vYXJyYXktc2V0JykuQXJyYXlTZXQ7XG52YXIgTWFwcGluZ0xpc3QgPSByZXF1aXJlKCcuL21hcHBpbmctbGlzdCcpLk1hcHBpbmdMaXN0O1xuXG4vKipcbiAqIEFuIGluc3RhbmNlIG9mIHRoZSBTb3VyY2VNYXBHZW5lcmF0b3IgcmVwcmVzZW50cyBhIHNvdXJjZSBtYXAgd2hpY2ggaXNcbiAqIGJlaW5nIGJ1aWx0IGluY3JlbWVudGFsbHkuIFlvdSBtYXkgcGFzcyBhbiBvYmplY3Qgd2l0aCB0aGUgZm9sbG93aW5nXG4gKiBwcm9wZXJ0aWVzOlxuICpcbiAqICAgLSBmaWxlOiBUaGUgZmlsZW5hbWUgb2YgdGhlIGdlbmVyYXRlZCBzb3VyY2UuXG4gKiAgIC0gc291cmNlUm9vdDogQSByb290IGZvciBhbGwgcmVsYXRpdmUgVVJMcyBpbiB0aGlzIHNvdXJjZSBtYXAuXG4gKi9cbmZ1bmN0aW9uIFNvdXJjZU1hcEdlbmVyYXRvcihhQXJncykge1xuICBpZiAoIWFBcmdzKSB7XG4gICAgYUFyZ3MgPSB7fTtcbiAgfVxuICB0aGlzLl9maWxlID0gdXRpbC5nZXRBcmcoYUFyZ3MsICdmaWxlJywgbnVsbCk7XG4gIHRoaXMuX3NvdXJjZVJvb3QgPSB1dGlsLmdldEFyZyhhQXJncywgJ3NvdXJjZVJvb3QnLCBudWxsKTtcbiAgdGhpcy5fc2tpcFZhbGlkYXRpb24gPSB1dGlsLmdldEFyZyhhQXJncywgJ3NraXBWYWxpZGF0aW9uJywgZmFsc2UpO1xuICB0aGlzLl9zb3VyY2VzID0gbmV3IEFycmF5U2V0KCk7XG4gIHRoaXMuX25hbWVzID0gbmV3IEFycmF5U2V0KCk7XG4gIHRoaXMuX21hcHBpbmdzID0gbmV3IE1hcHBpbmdMaXN0KCk7XG4gIHRoaXMuX3NvdXJjZXNDb250ZW50cyA9IG51bGw7XG59XG5cblNvdXJjZU1hcEdlbmVyYXRvci5wcm90b3R5cGUuX3ZlcnNpb24gPSAzO1xuXG4vKipcbiAqIENyZWF0ZXMgYSBuZXcgU291cmNlTWFwR2VuZXJhdG9yIGJhc2VkIG9uIGEgU291cmNlTWFwQ29uc3VtZXJcbiAqXG4gKiBAcGFyYW0gYVNvdXJjZU1hcENvbnN1bWVyIFRoZSBTb3VyY2VNYXAuXG4gKi9cblNvdXJjZU1hcEdlbmVyYXRvci5mcm9tU291cmNlTWFwID1cbiAgZnVuY3Rpb24gU291cmNlTWFwR2VuZXJhdG9yX2Zyb21Tb3VyY2VNYXAoYVNvdXJjZU1hcENvbnN1bWVyKSB7XG4gICAgdmFyIHNvdXJjZVJvb3QgPSBhU291cmNlTWFwQ29uc3VtZXIuc291cmNlUm9vdDtcbiAgICB2YXIgZ2VuZXJhdG9yID0gbmV3IFNvdXJjZU1hcEdlbmVyYXRvcih7XG4gICAgICBmaWxlOiBhU291cmNlTWFwQ29uc3VtZXIuZmlsZSxcbiAgICAgIHNvdXJjZVJvb3Q6IHNvdXJjZVJvb3RcbiAgICB9KTtcbiAgICBhU291cmNlTWFwQ29uc3VtZXIuZWFjaE1hcHBpbmcoZnVuY3Rpb24gKG1hcHBpbmcpIHtcbiAgICAgIHZhciBuZXdNYXBwaW5nID0ge1xuICAgICAgICBnZW5lcmF0ZWQ6IHtcbiAgICAgICAgICBsaW5lOiBtYXBwaW5nLmdlbmVyYXRlZExpbmUsXG4gICAgICAgICAgY29sdW1uOiBtYXBwaW5nLmdlbmVyYXRlZENvbHVtblxuICAgICAgICB9XG4gICAgICB9O1xuXG4gICAgICBpZiAobWFwcGluZy5zb3VyY2UgIT0gbnVsbCkge1xuICAgICAgICBuZXdNYXBwaW5nLnNvdXJjZSA9IG1hcHBpbmcuc291cmNlO1xuICAgICAgICBpZiAoc291cmNlUm9vdCAhPSBudWxsKSB7XG4gICAgICAgICAgbmV3TWFwcGluZy5zb3VyY2UgPSB1dGlsLnJlbGF0aXZlKHNvdXJjZVJvb3QsIG5ld01hcHBpbmcuc291cmNlKTtcbiAgICAgICAgfVxuXG4gICAgICAgIG5ld01hcHBpbmcub3JpZ2luYWwgPSB7XG4gICAgICAgICAgbGluZTogbWFwcGluZy5vcmlnaW5hbExpbmUsXG4gICAgICAgICAgY29sdW1uOiBtYXBwaW5nLm9yaWdpbmFsQ29sdW1uXG4gICAgICAgIH07XG5cbiAgICAgICAgaWYgKG1hcHBpbmcubmFtZSAhPSBudWxsKSB7XG4gICAgICAgICAgbmV3TWFwcGluZy5uYW1lID0gbWFwcGluZy5uYW1lO1xuICAgICAgICB9XG4gICAgICB9XG5cbiAgICAgIGdlbmVyYXRvci5hZGRNYXBwaW5nKG5ld01hcHBpbmcpO1xuICAgIH0pO1xuICAgIGFTb3VyY2VNYXBDb25zdW1lci5zb3VyY2VzLmZvckVhY2goZnVuY3Rpb24gKHNvdXJjZUZpbGUpIHtcbiAgICAgIHZhciBzb3VyY2VSZWxhdGl2ZSA9IHNvdXJjZUZpbGU7XG4gICAgICBpZiAoc291cmNlUm9vdCAhPT0gbnVsbCkge1xuICAgICAgICBzb3VyY2VSZWxhdGl2ZSA9IHV0aWwucmVsYXRpdmUoc291cmNlUm9vdCwgc291cmNlRmlsZSk7XG4gICAgICB9XG5cbiAgICAgIGlmICghZ2VuZXJhdG9yLl9zb3VyY2VzLmhhcyhzb3VyY2VSZWxhdGl2ZSkpIHtcbiAgICAgICAgZ2VuZXJhdG9yLl9zb3VyY2VzLmFkZChzb3VyY2VSZWxhdGl2ZSk7XG4gICAgICB9XG5cbiAgICAgIHZhciBjb250ZW50ID0gYVNvdXJjZU1hcENvbnN1bWVyLnNvdXJjZUNvbnRlbnRGb3Ioc291cmNlRmlsZSk7XG4gICAgICBpZiAoY29udGVudCAhPSBudWxsKSB7XG4gICAgICAgIGdlbmVyYXRvci5zZXRTb3VyY2VDb250ZW50KHNvdXJjZUZpbGUsIGNvbnRlbnQpO1xuICAgICAgfVxuICAgIH0pO1xuICAgIHJldHVybiBnZW5lcmF0b3I7XG4gIH07XG5cbi8qKlxuICogQWRkIGEgc2luZ2xlIG1hcHBpbmcgZnJvbSBvcmlnaW5hbCBzb3VyY2UgbGluZSBhbmQgY29sdW1uIHRvIHRoZSBnZW5lcmF0ZWRcbiAqIHNvdXJjZSdzIGxpbmUgYW5kIGNvbHVtbiBmb3IgdGhpcyBzb3VyY2UgbWFwIGJlaW5nIGNyZWF0ZWQuIFRoZSBtYXBwaW5nXG4gKiBvYmplY3Qgc2hvdWxkIGhhdmUgdGhlIGZvbGxvd2luZyBwcm9wZXJ0aWVzOlxuICpcbiAqICAgLSBnZW5lcmF0ZWQ6IEFuIG9iamVjdCB3aXRoIHRoZSBnZW5lcmF0ZWQgbGluZSBhbmQgY29sdW1uIHBvc2l0aW9ucy5cbiAqICAgLSBvcmlnaW5hbDogQW4gb2JqZWN0IHdpdGggdGhlIG9yaWdpbmFsIGxpbmUgYW5kIGNvbHVtbiBwb3NpdGlvbnMuXG4gKiAgIC0gc291cmNlOiBUaGUgb3JpZ2luYWwgc291cmNlIGZpbGUgKHJlbGF0aXZlIHRvIHRoZSBzb3VyY2VSb290KS5cbiAqICAgLSBuYW1lOiBBbiBvcHRpb25hbCBvcmlnaW5hbCB0b2tlbiBuYW1lIGZvciB0aGlzIG1hcHBpbmcuXG4gKi9cblNvdXJjZU1hcEdlbmVyYXRvci5wcm90b3R5cGUuYWRkTWFwcGluZyA9XG4gIGZ1bmN0aW9uIFNvdXJjZU1hcEdlbmVyYXRvcl9hZGRNYXBwaW5nKGFBcmdzKSB7XG4gICAgdmFyIGdlbmVyYXRlZCA9IHV0aWwuZ2V0QXJnKGFBcmdzLCAnZ2VuZXJhdGVkJyk7XG4gICAgdmFyIG9yaWdpbmFsID0gdXRpbC5nZXRBcmcoYUFyZ3MsICdvcmlnaW5hbCcsIG51bGwpO1xuICAgIHZhciBzb3VyY2UgPSB1dGlsLmdldEFyZyhhQXJncywgJ3NvdXJjZScsIG51bGwpO1xuICAgIHZhciBuYW1lID0gdXRpbC5nZXRBcmcoYUFyZ3MsICduYW1lJywgbnVsbCk7XG5cbiAgICBpZiAoIXRoaXMuX3NraXBWYWxpZGF0aW9uKSB7XG4gICAgICB0aGlzLl92YWxpZGF0ZU1hcHBpbmcoZ2VuZXJhdGVkLCBvcmlnaW5hbCwgc291cmNlLCBuYW1lKTtcbiAgICB9XG5cbiAgICBpZiAoc291cmNlICE9IG51bGwpIHtcbiAgICAgIHNvdXJjZSA9IFN0cmluZyhzb3VyY2UpO1xuICAgICAgaWYgKCF0aGlzLl9zb3VyY2VzLmhhcyhzb3VyY2UpKSB7XG4gICAgICAgIHRoaXMuX3NvdXJjZXMuYWRkKHNvdXJjZSk7XG4gICAgICB9XG4gICAgfVxuXG4gICAgaWYgKG5hbWUgIT0gbnVsbCkge1xuICAgICAgbmFtZSA9IFN0cmluZyhuYW1lKTtcbiAgICAgIGlmICghdGhpcy5fbmFtZXMuaGFzKG5hbWUpKSB7XG4gICAgICAgIHRoaXMuX25hbWVzLmFkZChuYW1lKTtcbiAgICAgIH1cbiAgICB9XG5cbiAgICB0aGlzLl9tYXBwaW5ncy5hZGQoe1xuICAgICAgZ2VuZXJhdGVkTGluZTogZ2VuZXJhdGVkLmxpbmUsXG4gICAgICBnZW5lcmF0ZWRDb2x1bW46IGdlbmVyYXRlZC5jb2x1bW4sXG4gICAgICBvcmlnaW5hbExpbmU6IG9yaWdpbmFsICE9IG51bGwgJiYgb3JpZ2luYWwubGluZSxcbiAgICAgIG9yaWdpbmFsQ29sdW1uOiBvcmlnaW5hbCAhPSBudWxsICYmIG9yaWdpbmFsLmNvbHVtbixcbiAgICAgIHNvdXJjZTogc291cmNlLFxuICAgICAgbmFtZTogbmFtZVxuICAgIH0pO1xuICB9O1xuXG4vKipcbiAqIFNldCB0aGUgc291cmNlIGNvbnRlbnQgZm9yIGEgc291cmNlIGZpbGUuXG4gKi9cblNvdXJjZU1hcEdlbmVyYXRvci5wcm90b3R5cGUuc2V0U291cmNlQ29udGVudCA9XG4gIGZ1bmN0aW9uIFNvdXJjZU1hcEdlbmVyYXRvcl9zZXRTb3VyY2VDb250ZW50KGFTb3VyY2VGaWxlLCBhU291cmNlQ29udGVudCkge1xuICAgIHZhciBzb3VyY2UgPSBhU291cmNlRmlsZTtcbiAgICBpZiAodGhpcy5fc291cmNlUm9vdCAhPSBudWxsKSB7XG4gICAgICBzb3VyY2UgPSB1dGlsLnJlbGF0aXZlKHRoaXMuX3NvdXJjZVJvb3QsIHNvdXJjZSk7XG4gICAgfVxuXG4gICAgaWYgKGFTb3VyY2VDb250ZW50ICE9IG51bGwpIHtcbiAgICAgIC8vIEFkZCB0aGUgc291cmNlIGNvbnRlbnQgdG8gdGhlIF9zb3VyY2VzQ29udGVudHMgbWFwLlxuICAgICAgLy8gQ3JlYXRlIGEgbmV3IF9zb3VyY2VzQ29udGVudHMgbWFwIGlmIHRoZSBwcm9wZXJ0eSBpcyBudWxsLlxuICAgICAgaWYgKCF0aGlzLl9zb3VyY2VzQ29udGVudHMpIHtcbiAgICAgICAgdGhpcy5fc291cmNlc0NvbnRlbnRzID0gT2JqZWN0LmNyZWF0ZShudWxsKTtcbiAgICAgIH1cbiAgICAgIHRoaXMuX3NvdXJjZXNDb250ZW50c1t1dGlsLnRvU2V0U3RyaW5nKHNvdXJjZSldID0gYVNvdXJjZUNvbnRlbnQ7XG4gICAgfSBlbHNlIGlmICh0aGlzLl9zb3VyY2VzQ29udGVudHMpIHtcbiAgICAgIC8vIFJlbW92ZSB0aGUgc291cmNlIGZpbGUgZnJvbSB0aGUgX3NvdXJjZXNDb250ZW50cyBtYXAuXG4gICAgICAvLyBJZiB0aGUgX3NvdXJjZXNDb250ZW50cyBtYXAgaXMgZW1wdHksIHNldCB0aGUgcHJvcGVydHkgdG8gbnVsbC5cbiAgICAgIGRlbGV0ZSB0aGlzLl9zb3VyY2VzQ29udGVudHNbdXRpbC50b1NldFN0cmluZyhzb3VyY2UpXTtcbiAgICAgIGlmIChPYmplY3Qua2V5cyh0aGlzLl9zb3VyY2VzQ29udGVudHMpLmxlbmd0aCA9PT0gMCkge1xuICAgICAgICB0aGlzLl9zb3VyY2VzQ29udGVudHMgPSBudWxsO1xuICAgICAgfVxuICAgIH1cbiAgfTtcblxuLyoqXG4gKiBBcHBsaWVzIHRoZSBtYXBwaW5ncyBvZiBhIHN1Yi1zb3VyY2UtbWFwIGZvciBhIHNwZWNpZmljIHNvdXJjZSBmaWxlIHRvIHRoZVxuICogc291cmNlIG1hcCBiZWluZyBnZW5lcmF0ZWQuIEVhY2ggbWFwcGluZyB0byB0aGUgc3VwcGxpZWQgc291cmNlIGZpbGUgaXNcbiAqIHJld3JpdHRlbiB1c2luZyB0aGUgc3VwcGxpZWQgc291cmNlIG1hcC4gTm90ZTogVGhlIHJlc29sdXRpb24gZm9yIHRoZVxuICogcmVzdWx0aW5nIG1hcHBpbmdzIGlzIHRoZSBtaW5pbWl1bSBvZiB0aGlzIG1hcCBhbmQgdGhlIHN1cHBsaWVkIG1hcC5cbiAqXG4gKiBAcGFyYW0gYVNvdXJjZU1hcENvbnN1bWVyIFRoZSBzb3VyY2UgbWFwIHRvIGJlIGFwcGxpZWQuXG4gKiBAcGFyYW0gYVNvdXJjZUZpbGUgT3B0aW9uYWwuIFRoZSBmaWxlbmFtZSBvZiB0aGUgc291cmNlIGZpbGUuXG4gKiAgICAgICAgSWYgb21pdHRlZCwgU291cmNlTWFwQ29uc3VtZXIncyBmaWxlIHByb3BlcnR5IHdpbGwgYmUgdXNlZC5cbiAqIEBwYXJhbSBhU291cmNlTWFwUGF0aCBPcHRpb25hbC4gVGhlIGRpcm5hbWUgb2YgdGhlIHBhdGggdG8gdGhlIHNvdXJjZSBtYXBcbiAqICAgICAgICB0byBiZSBhcHBsaWVkLiBJZiByZWxhdGl2ZSwgaXQgaXMgcmVsYXRpdmUgdG8gdGhlIFNvdXJjZU1hcENvbnN1bWVyLlxuICogICAgICAgIFRoaXMgcGFyYW1ldGVyIGlzIG5lZWRlZCB3aGVuIHRoZSB0d28gc291cmNlIG1hcHMgYXJlbid0IGluIHRoZSBzYW1lXG4gKiAgICAgICAgZGlyZWN0b3J5LCBhbmQgdGhlIHNvdXJjZSBtYXAgdG8gYmUgYXBwbGllZCBjb250YWlucyByZWxhdGl2ZSBzb3VyY2VcbiAqICAgICAgICBwYXRocy4gSWYgc28sIHRob3NlIHJlbGF0aXZlIHNvdXJjZSBwYXRocyBuZWVkIHRvIGJlIHJld3JpdHRlblxuICogICAgICAgIHJlbGF0aXZlIHRvIHRoZSBTb3VyY2VNYXBHZW5lcmF0b3IuXG4gKi9cblNvdXJjZU1hcEdlbmVyYXRvci5wcm90b3R5cGUuYXBwbHlTb3VyY2VNYXAgPVxuICBmdW5jdGlvbiBTb3VyY2VNYXBHZW5lcmF0b3JfYXBwbHlTb3VyY2VNYXAoYVNvdXJjZU1hcENvbnN1bWVyLCBhU291cmNlRmlsZSwgYVNvdXJjZU1hcFBhdGgpIHtcbiAgICB2YXIgc291cmNlRmlsZSA9IGFTb3VyY2VGaWxlO1xuICAgIC8vIElmIGFTb3VyY2VGaWxlIGlzIG9taXR0ZWQsIHdlIHdpbGwgdXNlIHRoZSBmaWxlIHByb3BlcnR5IG9mIHRoZSBTb3VyY2VNYXBcbiAgICBpZiAoYVNvdXJjZUZpbGUgPT0gbnVsbCkge1xuICAgICAgaWYgKGFTb3VyY2VNYXBDb25zdW1lci5maWxlID09IG51bGwpIHtcbiAgICAgICAgdGhyb3cgbmV3IEVycm9yKFxuICAgICAgICAgICdTb3VyY2VNYXBHZW5lcmF0b3IucHJvdG90eXBlLmFwcGx5U291cmNlTWFwIHJlcXVpcmVzIGVpdGhlciBhbiBleHBsaWNpdCBzb3VyY2UgZmlsZSwgJyArXG4gICAgICAgICAgJ29yIHRoZSBzb3VyY2UgbWFwXFwncyBcImZpbGVcIiBwcm9wZXJ0eS4gQm90aCB3ZXJlIG9taXR0ZWQuJ1xuICAgICAgICApO1xuICAgICAgfVxuICAgICAgc291cmNlRmlsZSA9IGFTb3VyY2VNYXBDb25zdW1lci5maWxlO1xuICAgIH1cbiAgICB2YXIgc291cmNlUm9vdCA9IHRoaXMuX3NvdXJjZVJvb3Q7XG4gICAgLy8gTWFrZSBcInNvdXJjZUZpbGVcIiByZWxhdGl2ZSBpZiBhbiBhYnNvbHV0ZSBVcmwgaXMgcGFzc2VkLlxuICAgIGlmIChzb3VyY2VSb290ICE9IG51bGwpIHtcbiAgICAgIHNvdXJjZUZpbGUgPSB1dGlsLnJlbGF0aXZlKHNvdXJjZVJvb3QsIHNvdXJjZUZpbGUpO1xuICAgIH1cbiAgICAvLyBBcHBseWluZyB0aGUgU291cmNlTWFwIGNhbiBhZGQgYW5kIHJlbW92ZSBpdGVtcyBmcm9tIHRoZSBzb3VyY2VzIGFuZFxuICAgIC8vIHRoZSBuYW1lcyBhcnJheS5cbiAgICB2YXIgbmV3U291cmNlcyA9IG5ldyBBcnJheVNldCgpO1xuICAgIHZhciBuZXdOYW1lcyA9IG5ldyBBcnJheVNldCgpO1xuXG4gICAgLy8gRmluZCBtYXBwaW5ncyBmb3IgdGhlIFwic291cmNlRmlsZVwiXG4gICAgdGhpcy5fbWFwcGluZ3MudW5zb3J0ZWRGb3JFYWNoKGZ1bmN0aW9uIChtYXBwaW5nKSB7XG4gICAgICBpZiAobWFwcGluZy5zb3VyY2UgPT09IHNvdXJjZUZpbGUgJiYgbWFwcGluZy5vcmlnaW5hbExpbmUgIT0gbnVsbCkge1xuICAgICAgICAvLyBDaGVjayBpZiBpdCBjYW4gYmUgbWFwcGVkIGJ5IHRoZSBzb3VyY2UgbWFwLCB0aGVuIHVwZGF0ZSB0aGUgbWFwcGluZy5cbiAgICAgICAgdmFyIG9yaWdpbmFsID0gYVNvdXJjZU1hcENvbnN1bWVyLm9yaWdpbmFsUG9zaXRpb25Gb3Ioe1xuICAgICAgICAgIGxpbmU6IG1hcHBpbmcub3JpZ2luYWxMaW5lLFxuICAgICAgICAgIGNvbHVtbjogbWFwcGluZy5vcmlnaW5hbENvbHVtblxuICAgICAgICB9KTtcbiAgICAgICAgaWYgKG9yaWdpbmFsLnNvdXJjZSAhPSBudWxsKSB7XG4gICAgICAgICAgLy8gQ29weSBtYXBwaW5nXG4gICAgICAgICAgbWFwcGluZy5zb3VyY2UgPSBvcmlnaW5hbC5zb3VyY2U7XG4gICAgICAgICAgaWYgKGFTb3VyY2VNYXBQYXRoICE9IG51bGwpIHtcbiAgICAgICAgICAgIG1hcHBpbmcuc291cmNlID0gdXRpbC5qb2luKGFTb3VyY2VNYXBQYXRoLCBtYXBwaW5nLnNvdXJjZSlcbiAgICAgICAgICB9XG4gICAgICAgICAgaWYgKHNvdXJjZVJvb3QgIT0gbnVsbCkge1xuICAgICAgICAgICAgbWFwcGluZy5zb3VyY2UgPSB1dGlsLnJlbGF0aXZlKHNvdXJjZVJvb3QsIG1hcHBpbmcuc291cmNlKTtcbiAgICAgICAgICB9XG4gICAgICAgICAgbWFwcGluZy5vcmlnaW5hbExpbmUgPSBvcmlnaW5hbC5saW5lO1xuICAgICAgICAgIG1hcHBpbmcub3JpZ2luYWxDb2x1bW4gPSBvcmlnaW5hbC5jb2x1bW47XG4gICAgICAgICAgaWYgKG9yaWdpbmFsLm5hbWUgIT0gbnVsbCkge1xuICAgICAgICAgICAgbWFwcGluZy5uYW1lID0gb3JpZ2luYWwubmFtZTtcbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgIH1cblxuICAgICAgdmFyIHNvdXJjZSA9IG1hcHBpbmcuc291cmNlO1xuICAgICAgaWYgKHNvdXJjZSAhPSBudWxsICYmICFuZXdTb3VyY2VzLmhhcyhzb3VyY2UpKSB7XG4gICAgICAgIG5ld1NvdXJjZXMuYWRkKHNvdXJjZSk7XG4gICAgICB9XG5cbiAgICAgIHZhciBuYW1lID0gbWFwcGluZy5uYW1lO1xuICAgICAgaWYgKG5hbWUgIT0gbnVsbCAmJiAhbmV3TmFtZXMuaGFzKG5hbWUpKSB7XG4gICAgICAgIG5ld05hbWVzLmFkZChuYW1lKTtcbiAgICAgIH1cblxuICAgIH0sIHRoaXMpO1xuICAgIHRoaXMuX3NvdXJjZXMgPSBuZXdTb3VyY2VzO1xuICAgIHRoaXMuX25hbWVzID0gbmV3TmFtZXM7XG5cbiAgICAvLyBDb3B5IHNvdXJjZXNDb250ZW50cyBvZiBhcHBsaWVkIG1hcC5cbiAgICBhU291cmNlTWFwQ29uc3VtZXIuc291cmNlcy5mb3JFYWNoKGZ1bmN0aW9uIChzb3VyY2VGaWxlKSB7XG4gICAgICB2YXIgY29udGVudCA9IGFTb3VyY2VNYXBDb25zdW1lci5zb3VyY2VDb250ZW50Rm9yKHNvdXJjZUZpbGUpO1xuICAgICAgaWYgKGNvbnRlbnQgIT0gbnVsbCkge1xuICAgICAgICBpZiAoYVNvdXJjZU1hcFBhdGggIT0gbnVsbCkge1xuICAgICAgICAgIHNvdXJjZUZpbGUgPSB1dGlsLmpvaW4oYVNvdXJjZU1hcFBhdGgsIHNvdXJjZUZpbGUpO1xuICAgICAgICB9XG4gICAgICAgIGlmIChzb3VyY2VSb290ICE9IG51bGwpIHtcbiAgICAgICAgICBzb3VyY2VGaWxlID0gdXRpbC5yZWxhdGl2ZShzb3VyY2VSb290LCBzb3VyY2VGaWxlKTtcbiAgICAgICAgfVxuICAgICAgICB0aGlzLnNldFNvdXJjZUNvbnRlbnQoc291cmNlRmlsZSwgY29udGVudCk7XG4gICAgICB9XG4gICAgfSwgdGhpcyk7XG4gIH07XG5cbi8qKlxuICogQSBtYXBwaW5nIGNhbiBoYXZlIG9uZSBvZiB0aGUgdGhyZWUgbGV2ZWxzIG9mIGRhdGE6XG4gKlxuICogICAxLiBKdXN0IHRoZSBnZW5lcmF0ZWQgcG9zaXRpb24uXG4gKiAgIDIuIFRoZSBHZW5lcmF0ZWQgcG9zaXRpb24sIG9yaWdpbmFsIHBvc2l0aW9uLCBhbmQgb3JpZ2luYWwgc291cmNlLlxuICogICAzLiBHZW5lcmF0ZWQgYW5kIG9yaWdpbmFsIHBvc2l0aW9uLCBvcmlnaW5hbCBzb3VyY2UsIGFzIHdlbGwgYXMgYSBuYW1lXG4gKiAgICAgIHRva2VuLlxuICpcbiAqIFRvIG1haW50YWluIGNvbnNpc3RlbmN5LCB3ZSB2YWxpZGF0ZSB0aGF0IGFueSBuZXcgbWFwcGluZyBiZWluZyBhZGRlZCBmYWxsc1xuICogaW4gdG8gb25lIG9mIHRoZXNlIGNhdGVnb3JpZXMuXG4gKi9cblNvdXJjZU1hcEdlbmVyYXRvci5wcm90b3R5cGUuX3ZhbGlkYXRlTWFwcGluZyA9XG4gIGZ1bmN0aW9uIFNvdXJjZU1hcEdlbmVyYXRvcl92YWxpZGF0ZU1hcHBpbmcoYUdlbmVyYXRlZCwgYU9yaWdpbmFsLCBhU291cmNlLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFOYW1lKSB7XG4gICAgLy8gV2hlbiBhT3JpZ2luYWwgaXMgdHJ1dGh5IGJ1dCBoYXMgZW1wdHkgdmFsdWVzIGZvciAubGluZSBhbmQgLmNvbHVtbixcbiAgICAvLyBpdCBpcyBtb3N0IGxpa2VseSBhIHByb2dyYW1tZXIgZXJyb3IuIEluIHRoaXMgY2FzZSB3ZSB0aHJvdyBhIHZlcnlcbiAgICAvLyBzcGVjaWZpYyBlcnJvciBtZXNzYWdlIHRvIHRyeSB0byBndWlkZSB0aGVtIHRoZSByaWdodCB3YXkuXG4gICAgLy8gRm9yIGV4YW1wbGU6IGh0dHBzOi8vZ2l0aHViLmNvbS9Qb2x5bWVyL3BvbHltZXItYnVuZGxlci9wdWxsLzUxOVxuICAgIGlmIChhT3JpZ2luYWwgJiYgdHlwZW9mIGFPcmlnaW5hbC5saW5lICE9PSAnbnVtYmVyJyAmJiB0eXBlb2YgYU9yaWdpbmFsLmNvbHVtbiAhPT0gJ251bWJlcicpIHtcbiAgICAgICAgdGhyb3cgbmV3IEVycm9yKFxuICAgICAgICAgICAgJ29yaWdpbmFsLmxpbmUgYW5kIG9yaWdpbmFsLmNvbHVtbiBhcmUgbm90IG51bWJlcnMgLS0geW91IHByb2JhYmx5IG1lYW50IHRvIG9taXQgJyArXG4gICAgICAgICAgICAndGhlIG9yaWdpbmFsIG1hcHBpbmcgZW50aXJlbHkgYW5kIG9ubHkgbWFwIHRoZSBnZW5lcmF0ZWQgcG9zaXRpb24uIElmIHNvLCBwYXNzICcgK1xuICAgICAgICAgICAgJ251bGwgZm9yIHRoZSBvcmlnaW5hbCBtYXBwaW5nIGluc3RlYWQgb2YgYW4gb2JqZWN0IHdpdGggZW1wdHkgb3IgbnVsbCB2YWx1ZXMuJ1xuICAgICAgICApO1xuICAgIH1cblxuICAgIGlmIChhR2VuZXJhdGVkICYmICdsaW5lJyBpbiBhR2VuZXJhdGVkICYmICdjb2x1bW4nIGluIGFHZW5lcmF0ZWRcbiAgICAgICAgJiYgYUdlbmVyYXRlZC5saW5lID4gMCAmJiBhR2VuZXJhdGVkLmNvbHVtbiA+PSAwXG4gICAgICAgICYmICFhT3JpZ2luYWwgJiYgIWFTb3VyY2UgJiYgIWFOYW1lKSB7XG4gICAgICAvLyBDYXNlIDEuXG4gICAgICByZXR1cm47XG4gICAgfVxuICAgIGVsc2UgaWYgKGFHZW5lcmF0ZWQgJiYgJ2xpbmUnIGluIGFHZW5lcmF0ZWQgJiYgJ2NvbHVtbicgaW4gYUdlbmVyYXRlZFxuICAgICAgICAgICAgICYmIGFPcmlnaW5hbCAmJiAnbGluZScgaW4gYU9yaWdpbmFsICYmICdjb2x1bW4nIGluIGFPcmlnaW5hbFxuICAgICAgICAgICAgICYmIGFHZW5lcmF0ZWQubGluZSA+IDAgJiYgYUdlbmVyYXRlZC5jb2x1bW4gPj0gMFxuICAgICAgICAgICAgICYmIGFPcmlnaW5hbC5saW5lID4gMCAmJiBhT3JpZ2luYWwuY29sdW1uID49IDBcbiAgICAgICAgICAgICAmJiBhU291cmNlKSB7XG4gICAgICAvLyBDYXNlcyAyIGFuZCAzLlxuICAgICAgcmV0dXJuO1xuICAgIH1cbiAgICBlbHNlIHtcbiAgICAgIHRocm93IG5ldyBFcnJvcignSW52YWxpZCBtYXBwaW5nOiAnICsgSlNPTi5zdHJpbmdpZnkoe1xuICAgICAgICBnZW5lcmF0ZWQ6IGFHZW5lcmF0ZWQsXG4gICAgICAgIHNvdXJjZTogYVNvdXJjZSxcbiAgICAgICAgb3JpZ2luYWw6IGFPcmlnaW5hbCxcbiAgICAgICAgbmFtZTogYU5hbWVcbiAgICAgIH0pKTtcbiAgICB9XG4gIH07XG5cbi8qKlxuICogU2VyaWFsaXplIHRoZSBhY2N1bXVsYXRlZCBtYXBwaW5ncyBpbiB0byB0aGUgc3RyZWFtIG9mIGJhc2UgNjQgVkxRc1xuICogc3BlY2lmaWVkIGJ5IHRoZSBzb3VyY2UgbWFwIGZvcm1hdC5cbiAqL1xuU291cmNlTWFwR2VuZXJhdG9yLnByb3RvdHlwZS5fc2VyaWFsaXplTWFwcGluZ3MgPVxuICBmdW5jdGlvbiBTb3VyY2VNYXBHZW5lcmF0b3Jfc2VyaWFsaXplTWFwcGluZ3MoKSB7XG4gICAgdmFyIHByZXZpb3VzR2VuZXJhdGVkQ29sdW1uID0gMDtcbiAgICB2YXIgcHJldmlvdXNHZW5lcmF0ZWRMaW5lID0gMTtcbiAgICB2YXIgcHJldmlvdXNPcmlnaW5hbENvbHVtbiA9IDA7XG4gICAgdmFyIHByZXZpb3VzT3JpZ2luYWxMaW5lID0gMDtcbiAgICB2YXIgcHJldmlvdXNOYW1lID0gMDtcbiAgICB2YXIgcHJldmlvdXNTb3VyY2UgPSAwO1xuICAgIHZhciByZXN1bHQgPSAnJztcbiAgICB2YXIgbmV4dDtcbiAgICB2YXIgbWFwcGluZztcbiAgICB2YXIgbmFtZUlkeDtcbiAgICB2YXIgc291cmNlSWR4O1xuXG4gICAgdmFyIG1hcHBpbmdzID0gdGhpcy5fbWFwcGluZ3MudG9BcnJheSgpO1xuICAgIGZvciAodmFyIGkgPSAwLCBsZW4gPSBtYXBwaW5ncy5sZW5ndGg7IGkgPCBsZW47IGkrKykge1xuICAgICAgbWFwcGluZyA9IG1hcHBpbmdzW2ldO1xuICAgICAgbmV4dCA9ICcnXG5cbiAgICAgIGlmIChtYXBwaW5nLmdlbmVyYXRlZExpbmUgIT09IHByZXZpb3VzR2VuZXJhdGVkTGluZSkge1xuICAgICAgICBwcmV2aW91c0dlbmVyYXRlZENvbHVtbiA9IDA7XG4gICAgICAgIHdoaWxlIChtYXBwaW5nLmdlbmVyYXRlZExpbmUgIT09IHByZXZpb3VzR2VuZXJhdGVkTGluZSkge1xuICAgICAgICAgIG5leHQgKz0gJzsnO1xuICAgICAgICAgIHByZXZpb3VzR2VuZXJhdGVkTGluZSsrO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgICBlbHNlIHtcbiAgICAgICAgaWYgKGkgPiAwKSB7XG4gICAgICAgICAgaWYgKCF1dGlsLmNvbXBhcmVCeUdlbmVyYXRlZFBvc2l0aW9uc0luZmxhdGVkKG1hcHBpbmcsIG1hcHBpbmdzW2kgLSAxXSkpIHtcbiAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICAgIH1cbiAgICAgICAgICBuZXh0ICs9ICcsJztcbiAgICAgICAgfVxuICAgICAgfVxuXG4gICAgICBuZXh0ICs9IGJhc2U2NFZMUS5lbmNvZGUobWFwcGluZy5nZW5lcmF0ZWRDb2x1bW5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC0gcHJldmlvdXNHZW5lcmF0ZWRDb2x1bW4pO1xuICAgICAgcHJldmlvdXNHZW5lcmF0ZWRDb2x1bW4gPSBtYXBwaW5nLmdlbmVyYXRlZENvbHVtbjtcblxuICAgICAgaWYgKG1hcHBpbmcuc291cmNlICE9IG51bGwpIHtcbiAgICAgICAgc291cmNlSWR4ID0gdGhpcy5fc291cmNlcy5pbmRleE9mKG1hcHBpbmcuc291cmNlKTtcbiAgICAgICAgbmV4dCArPSBiYXNlNjRWTFEuZW5jb2RlKHNvdXJjZUlkeCAtIHByZXZpb3VzU291cmNlKTtcbiAgICAgICAgcHJldmlvdXNTb3VyY2UgPSBzb3VyY2VJZHg7XG5cbiAgICAgICAgLy8gbGluZXMgYXJlIHN0b3JlZCAwLWJhc2VkIGluIFNvdXJjZU1hcCBzcGVjIHZlcnNpb24gM1xuICAgICAgICBuZXh0ICs9IGJhc2U2NFZMUS5lbmNvZGUobWFwcGluZy5vcmlnaW5hbExpbmUgLSAxXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC0gcHJldmlvdXNPcmlnaW5hbExpbmUpO1xuICAgICAgICBwcmV2aW91c09yaWdpbmFsTGluZSA9IG1hcHBpbmcub3JpZ2luYWxMaW5lIC0gMTtcblxuICAgICAgICBuZXh0ICs9IGJhc2U2NFZMUS5lbmNvZGUobWFwcGluZy5vcmlnaW5hbENvbHVtblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtIHByZXZpb3VzT3JpZ2luYWxDb2x1bW4pO1xuICAgICAgICBwcmV2aW91c09yaWdpbmFsQ29sdW1uID0gbWFwcGluZy5vcmlnaW5hbENvbHVtbjtcblxuICAgICAgICBpZiAobWFwcGluZy5uYW1lICE9IG51bGwpIHtcbiAgICAgICAgICBuYW1lSWR4ID0gdGhpcy5fbmFtZXMuaW5kZXhPZihtYXBwaW5nLm5hbWUpO1xuICAgICAgICAgIG5leHQgKz0gYmFzZTY0VkxRLmVuY29kZShuYW1lSWR4IC0gcHJldmlvdXNOYW1lKTtcbiAgICAgICAgICBwcmV2aW91c05hbWUgPSBuYW1lSWR4O1xuICAgICAgICB9XG4gICAgICB9XG5cbiAgICAgIHJlc3VsdCArPSBuZXh0O1xuICAgIH1cblxuICAgIHJldHVybiByZXN1bHQ7XG4gIH07XG5cblNvdXJjZU1hcEdlbmVyYXRvci5wcm90b3R5cGUuX2dlbmVyYXRlU291cmNlc0NvbnRlbnQgPVxuICBmdW5jdGlvbiBTb3VyY2VNYXBHZW5lcmF0b3JfZ2VuZXJhdGVTb3VyY2VzQ29udGVudChhU291cmNlcywgYVNvdXJjZVJvb3QpIHtcbiAgICByZXR1cm4gYVNvdXJjZXMubWFwKGZ1bmN0aW9uIChzb3VyY2UpIHtcbiAgICAgIGlmICghdGhpcy5fc291cmNlc0NvbnRlbnRzKSB7XG4gICAgICAgIHJldHVybiBudWxsO1xuICAgICAgfVxuICAgICAgaWYgKGFTb3VyY2VSb290ICE9IG51bGwpIHtcbiAgICAgICAgc291cmNlID0gdXRpbC5yZWxhdGl2ZShhU291cmNlUm9vdCwgc291cmNlKTtcbiAgICAgIH1cbiAgICAgIHZhciBrZXkgPSB1dGlsLnRvU2V0U3RyaW5nKHNvdXJjZSk7XG4gICAgICByZXR1cm4gT2JqZWN0LnByb3RvdHlwZS5oYXNPd25Qcm9wZXJ0eS5jYWxsKHRoaXMuX3NvdXJjZXNDb250ZW50cywga2V5KVxuICAgICAgICA/IHRoaXMuX3NvdXJjZXNDb250ZW50c1trZXldXG4gICAgICAgIDogbnVsbDtcbiAgICB9LCB0aGlzKTtcbiAgfTtcblxuLyoqXG4gKiBFeHRlcm5hbGl6ZSB0aGUgc291cmNlIG1hcC5cbiAqL1xuU291cmNlTWFwR2VuZXJhdG9yLnByb3RvdHlwZS50b0pTT04gPVxuICBmdW5jdGlvbiBTb3VyY2VNYXBHZW5lcmF0b3JfdG9KU09OKCkge1xuICAgIHZhciBtYXAgPSB7XG4gICAgICB2ZXJzaW9uOiB0aGlzLl92ZXJzaW9uLFxuICAgICAgc291cmNlczogdGhpcy5fc291cmNlcy50b0FycmF5KCksXG4gICAgICBuYW1lczogdGhpcy5fbmFtZXMudG9BcnJheSgpLFxuICAgICAgbWFwcGluZ3M6IHRoaXMuX3NlcmlhbGl6ZU1hcHBpbmdzKClcbiAgICB9O1xuICAgIGlmICh0aGlzLl9maWxlICE9IG51bGwpIHtcbiAgICAgIG1hcC5maWxlID0gdGhpcy5fZmlsZTtcbiAgICB9XG4gICAgaWYgKHRoaXMuX3NvdXJjZVJvb3QgIT0gbnVsbCkge1xuICAgICAgbWFwLnNvdXJjZVJvb3QgPSB0aGlzLl9zb3VyY2VSb290O1xuICAgIH1cbiAgICBpZiAodGhpcy5fc291cmNlc0NvbnRlbnRzKSB7XG4gICAgICBtYXAuc291cmNlc0NvbnRlbnQgPSB0aGlzLl9nZW5lcmF0ZVNvdXJjZXNDb250ZW50KG1hcC5zb3VyY2VzLCBtYXAuc291cmNlUm9vdCk7XG4gICAgfVxuXG4gICAgcmV0dXJuIG1hcDtcbiAgfTtcblxuLyoqXG4gKiBSZW5kZXIgdGhlIHNvdXJjZSBtYXAgYmVpbmcgZ2VuZXJhdGVkIHRvIGEgc3RyaW5nLlxuICovXG5Tb3VyY2VNYXBHZW5lcmF0b3IucHJvdG90eXBlLnRvU3RyaW5nID1cbiAgZnVuY3Rpb24gU291cmNlTWFwR2VuZXJhdG9yX3RvU3RyaW5nKCkge1xuICAgIHJldHVybiBKU09OLnN0cmluZ2lmeSh0aGlzLnRvSlNPTigpKTtcbiAgfTtcblxuZXhwb3J0cy5Tb3VyY2VNYXBHZW5lcmF0b3IgPSBTb3VyY2VNYXBHZW5lcmF0b3I7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL2xpYi9zb3VyY2UtbWFwLWdlbmVyYXRvci5qc1xuLy8gbW9kdWxlIGlkID0gMVxuLy8gbW9kdWxlIGNodW5rcyA9IDAiLCIvKiAtKi0gTW9kZToganM7IGpzLWluZGVudC1sZXZlbDogMjsgLSotICovXG4vKlxuICogQ29weXJpZ2h0IDIwMTEgTW96aWxsYSBGb3VuZGF0aW9uIGFuZCBjb250cmlidXRvcnNcbiAqIExpY2Vuc2VkIHVuZGVyIHRoZSBOZXcgQlNEIGxpY2Vuc2UuIFNlZSBMSUNFTlNFIG9yOlxuICogaHR0cDovL29wZW5zb3VyY2Uub3JnL2xpY2Vuc2VzL0JTRC0zLUNsYXVzZVxuICpcbiAqIEJhc2VkIG9uIHRoZSBCYXNlIDY0IFZMUSBpbXBsZW1lbnRhdGlvbiBpbiBDbG9zdXJlIENvbXBpbGVyOlxuICogaHR0cHM6Ly9jb2RlLmdvb2dsZS5jb20vcC9jbG9zdXJlLWNvbXBpbGVyL3NvdXJjZS9icm93c2UvdHJ1bmsvc3JjL2NvbS9nb29nbGUvZGVidWdnaW5nL3NvdXJjZW1hcC9CYXNlNjRWTFEuamF2YVxuICpcbiAqIENvcHlyaWdodCAyMDExIFRoZSBDbG9zdXJlIENvbXBpbGVyIEF1dGhvcnMuIEFsbCByaWdodHMgcmVzZXJ2ZWQuXG4gKiBSZWRpc3RyaWJ1dGlvbiBhbmQgdXNlIGluIHNvdXJjZSBhbmQgYmluYXJ5IGZvcm1zLCB3aXRoIG9yIHdpdGhvdXRcbiAqIG1vZGlmaWNhdGlvbiwgYXJlIHBlcm1pdHRlZCBwcm92aWRlZCB0aGF0IHRoZSBmb2xsb3dpbmcgY29uZGl0aW9ucyBhcmVcbiAqIG1ldDpcbiAqXG4gKiAgKiBSZWRpc3RyaWJ1dGlvbnMgb2Ygc291cmNlIGNvZGUgbXVzdCByZXRhaW4gdGhlIGFib3ZlIGNvcHlyaWdodFxuICogICAgbm90aWNlLCB0aGlzIGxpc3Qgb2YgY29uZGl0aW9ucyBhbmQgdGhlIGZvbGxvd2luZyBkaXNjbGFpbWVyLlxuICogICogUmVkaXN0cmlidXRpb25zIGluIGJpbmFyeSBmb3JtIG11c3QgcmVwcm9kdWNlIHRoZSBhYm92ZVxuICogICAgY29weXJpZ2h0IG5vdGljZSwgdGhpcyBsaXN0IG9mIGNvbmRpdGlvbnMgYW5kIHRoZSBmb2xsb3dpbmdcbiAqICAgIGRpc2NsYWltZXIgaW4gdGhlIGRvY3VtZW50YXRpb24gYW5kL29yIG90aGVyIG1hdGVyaWFscyBwcm92aWRlZFxuICogICAgd2l0aCB0aGUgZGlzdHJpYnV0aW9uLlxuICogICogTmVpdGhlciB0aGUgbmFtZSBvZiBHb29nbGUgSW5jLiBub3IgdGhlIG5hbWVzIG9mIGl0c1xuICogICAgY29udHJpYnV0b3JzIG1heSBiZSB1c2VkIHRvIGVuZG9yc2Ugb3IgcHJvbW90ZSBwcm9kdWN0cyBkZXJpdmVkXG4gKiAgICBmcm9tIHRoaXMgc29mdHdhcmUgd2l0aG91dCBzcGVjaWZpYyBwcmlvciB3cml0dGVuIHBlcm1pc3Npb24uXG4gKlxuICogVEhJUyBTT0ZUV0FSRSBJUyBQUk9WSURFRCBCWSBUSEUgQ09QWVJJR0hUIEhPTERFUlMgQU5EIENPTlRSSUJVVE9SU1xuICogXCJBUyBJU1wiIEFORCBBTlkgRVhQUkVTUyBPUiBJTVBMSUVEIFdBUlJBTlRJRVMsIElOQ0xVRElORywgQlVUIE5PVFxuICogTElNSVRFRCBUTywgVEhFIElNUExJRUQgV0FSUkFOVElFUyBPRiBNRVJDSEFOVEFCSUxJVFkgQU5EIEZJVE5FU1MgRk9SXG4gKiBBIFBBUlRJQ1VMQVIgUFVSUE9TRSBBUkUgRElTQ0xBSU1FRC4gSU4gTk8gRVZFTlQgU0hBTEwgVEhFIENPUFlSSUdIVFxuICogT1dORVIgT1IgQ09OVFJJQlVUT1JTIEJFIExJQUJMRSBGT1IgQU5ZIERJUkVDVCwgSU5ESVJFQ1QsIElOQ0lERU5UQUwsXG4gKiBTUEVDSUFMLCBFWEVNUExBUlksIE9SIENPTlNFUVVFTlRJQUwgREFNQUdFUyAoSU5DTFVESU5HLCBCVVQgTk9UXG4gKiBMSU1JVEVEIFRPLCBQUk9DVVJFTUVOVCBPRiBTVUJTVElUVVRFIEdPT0RTIE9SIFNFUlZJQ0VTOyBMT1NTIE9GIFVTRSxcbiAqIERBVEEsIE9SIFBST0ZJVFM7IE9SIEJVU0lORVNTIElOVEVSUlVQVElPTikgSE9XRVZFUiBDQVVTRUQgQU5EIE9OIEFOWVxuICogVEhFT1JZIE9GIExJQUJJTElUWSwgV0hFVEhFUiBJTiBDT05UUkFDVCwgU1RSSUNUIExJQUJJTElUWSwgT1IgVE9SVFxuICogKElOQ0xVRElORyBORUdMSUdFTkNFIE9SIE9USEVSV0lTRSkgQVJJU0lORyBJTiBBTlkgV0FZIE9VVCBPRiBUSEUgVVNFXG4gKiBPRiBUSElTIFNPRlRXQVJFLCBFVkVOIElGIEFEVklTRUQgT0YgVEhFIFBPU1NJQklMSVRZIE9GIFNVQ0ggREFNQUdFLlxuICovXG5cbnZhciBiYXNlNjQgPSByZXF1aXJlKCcuL2Jhc2U2NCcpO1xuXG4vLyBBIHNpbmdsZSBiYXNlIDY0IGRpZ2l0IGNhbiBjb250YWluIDYgYml0cyBvZiBkYXRhLiBGb3IgdGhlIGJhc2UgNjQgdmFyaWFibGVcbi8vIGxlbmd0aCBxdWFudGl0aWVzIHdlIHVzZSBpbiB0aGUgc291cmNlIG1hcCBzcGVjLCB0aGUgZmlyc3QgYml0IGlzIHRoZSBzaWduLFxuLy8gdGhlIG5leHQgZm91ciBiaXRzIGFyZSB0aGUgYWN0dWFsIHZhbHVlLCBhbmQgdGhlIDZ0aCBiaXQgaXMgdGhlXG4vLyBjb250aW51YXRpb24gYml0LiBUaGUgY29udGludWF0aW9uIGJpdCB0ZWxscyB1cyB3aGV0aGVyIHRoZXJlIGFyZSBtb3JlXG4vLyBkaWdpdHMgaW4gdGhpcyB2YWx1ZSBmb2xsb3dpbmcgdGhpcyBkaWdpdC5cbi8vXG4vLyAgIENvbnRpbnVhdGlvblxuLy8gICB8ICAgIFNpZ25cbi8vICAgfCAgICB8XG4vLyAgIFYgICAgVlxuLy8gICAxMDEwMTFcblxudmFyIFZMUV9CQVNFX1NISUZUID0gNTtcblxuLy8gYmluYXJ5OiAxMDAwMDBcbnZhciBWTFFfQkFTRSA9IDEgPDwgVkxRX0JBU0VfU0hJRlQ7XG5cbi8vIGJpbmFyeTogMDExMTExXG52YXIgVkxRX0JBU0VfTUFTSyA9IFZMUV9CQVNFIC0gMTtcblxuLy8gYmluYXJ5OiAxMDAwMDBcbnZhciBWTFFfQ09OVElOVUFUSU9OX0JJVCA9IFZMUV9CQVNFO1xuXG4vKipcbiAqIENvbnZlcnRzIGZyb20gYSB0d28tY29tcGxlbWVudCB2YWx1ZSB0byBhIHZhbHVlIHdoZXJlIHRoZSBzaWduIGJpdCBpc1xuICogcGxhY2VkIGluIHRoZSBsZWFzdCBzaWduaWZpY2FudCBiaXQuICBGb3IgZXhhbXBsZSwgYXMgZGVjaW1hbHM6XG4gKiAgIDEgYmVjb21lcyAyICgxMCBiaW5hcnkpLCAtMSBiZWNvbWVzIDMgKDExIGJpbmFyeSlcbiAqICAgMiBiZWNvbWVzIDQgKDEwMCBiaW5hcnkpLCAtMiBiZWNvbWVzIDUgKDEwMSBiaW5hcnkpXG4gKi9cbmZ1bmN0aW9uIHRvVkxRU2lnbmVkKGFWYWx1ZSkge1xuICByZXR1cm4gYVZhbHVlIDwgMFxuICAgID8gKCgtYVZhbHVlKSA8PCAxKSArIDFcbiAgICA6IChhVmFsdWUgPDwgMSkgKyAwO1xufVxuXG4vKipcbiAqIENvbnZlcnRzIHRvIGEgdHdvLWNvbXBsZW1lbnQgdmFsdWUgZnJvbSBhIHZhbHVlIHdoZXJlIHRoZSBzaWduIGJpdCBpc1xuICogcGxhY2VkIGluIHRoZSBsZWFzdCBzaWduaWZpY2FudCBiaXQuICBGb3IgZXhhbXBsZSwgYXMgZGVjaW1hbHM6XG4gKiAgIDIgKDEwIGJpbmFyeSkgYmVjb21lcyAxLCAzICgxMSBiaW5hcnkpIGJlY29tZXMgLTFcbiAqICAgNCAoMTAwIGJpbmFyeSkgYmVjb21lcyAyLCA1ICgxMDEgYmluYXJ5KSBiZWNvbWVzIC0yXG4gKi9cbmZ1bmN0aW9uIGZyb21WTFFTaWduZWQoYVZhbHVlKSB7XG4gIHZhciBpc05lZ2F0aXZlID0gKGFWYWx1ZSAmIDEpID09PSAxO1xuICB2YXIgc2hpZnRlZCA9IGFWYWx1ZSA+PiAxO1xuICByZXR1cm4gaXNOZWdhdGl2ZVxuICAgID8gLXNoaWZ0ZWRcbiAgICA6IHNoaWZ0ZWQ7XG59XG5cbi8qKlxuICogUmV0dXJucyB0aGUgYmFzZSA2NCBWTFEgZW5jb2RlZCB2YWx1ZS5cbiAqL1xuZXhwb3J0cy5lbmNvZGUgPSBmdW5jdGlvbiBiYXNlNjRWTFFfZW5jb2RlKGFWYWx1ZSkge1xuICB2YXIgZW5jb2RlZCA9IFwiXCI7XG4gIHZhciBkaWdpdDtcblxuICB2YXIgdmxxID0gdG9WTFFTaWduZWQoYVZhbHVlKTtcblxuICBkbyB7XG4gICAgZGlnaXQgPSB2bHEgJiBWTFFfQkFTRV9NQVNLO1xuICAgIHZscSA+Pj49IFZMUV9CQVNFX1NISUZUO1xuICAgIGlmICh2bHEgPiAwKSB7XG4gICAgICAvLyBUaGVyZSBhcmUgc3RpbGwgbW9yZSBkaWdpdHMgaW4gdGhpcyB2YWx1ZSwgc28gd2UgbXVzdCBtYWtlIHN1cmUgdGhlXG4gICAgICAvLyBjb250aW51YXRpb24gYml0IGlzIG1hcmtlZC5cbiAgICAgIGRpZ2l0IHw9IFZMUV9DT05USU5VQVRJT05fQklUO1xuICAgIH1cbiAgICBlbmNvZGVkICs9IGJhc2U2NC5lbmNvZGUoZGlnaXQpO1xuICB9IHdoaWxlICh2bHEgPiAwKTtcblxuICByZXR1cm4gZW5jb2RlZDtcbn07XG5cbi8qKlxuICogRGVjb2RlcyB0aGUgbmV4dCBiYXNlIDY0IFZMUSB2YWx1ZSBmcm9tIHRoZSBnaXZlbiBzdHJpbmcgYW5kIHJldHVybnMgdGhlXG4gKiB2YWx1ZSBhbmQgdGhlIHJlc3Qgb2YgdGhlIHN0cmluZyB2aWEgdGhlIG91dCBwYXJhbWV0ZXIuXG4gKi9cbmV4cG9ydHMuZGVjb2RlID0gZnVuY3Rpb24gYmFzZTY0VkxRX2RlY29kZShhU3RyLCBhSW5kZXgsIGFPdXRQYXJhbSkge1xuICB2YXIgc3RyTGVuID0gYVN0ci5sZW5ndGg7XG4gIHZhciByZXN1bHQgPSAwO1xuICB2YXIgc2hpZnQgPSAwO1xuICB2YXIgY29udGludWF0aW9uLCBkaWdpdDtcblxuICBkbyB7XG4gICAgaWYgKGFJbmRleCA+PSBzdHJMZW4pIHtcbiAgICAgIHRocm93IG5ldyBFcnJvcihcIkV4cGVjdGVkIG1vcmUgZGlnaXRzIGluIGJhc2UgNjQgVkxRIHZhbHVlLlwiKTtcbiAgICB9XG5cbiAgICBkaWdpdCA9IGJhc2U2NC5kZWNvZGUoYVN0ci5jaGFyQ29kZUF0KGFJbmRleCsrKSk7XG4gICAgaWYgKGRpZ2l0ID09PSAtMSkge1xuICAgICAgdGhyb3cgbmV3IEVycm9yKFwiSW52YWxpZCBiYXNlNjQgZGlnaXQ6IFwiICsgYVN0ci5jaGFyQXQoYUluZGV4IC0gMSkpO1xuICAgIH1cblxuICAgIGNvbnRpbnVhdGlvbiA9ICEhKGRpZ2l0ICYgVkxRX0NPTlRJTlVBVElPTl9CSVQpO1xuICAgIGRpZ2l0ICY9IFZMUV9CQVNFX01BU0s7XG4gICAgcmVzdWx0ID0gcmVzdWx0ICsgKGRpZ2l0IDw8IHNoaWZ0KTtcbiAgICBzaGlmdCArPSBWTFFfQkFTRV9TSElGVDtcbiAgfSB3aGlsZSAoY29udGludWF0aW9uKTtcblxuICBhT3V0UGFyYW0udmFsdWUgPSBmcm9tVkxRU2lnbmVkKHJlc3VsdCk7XG4gIGFPdXRQYXJhbS5yZXN0ID0gYUluZGV4O1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbGliL2Jhc2U2NC12bHEuanNcbi8vIG1vZHVsZSBpZCA9IDJcbi8vIG1vZHVsZSBjaHVua3MgPSAwIiwiLyogLSotIE1vZGU6IGpzOyBqcy1pbmRlbnQtbGV2ZWw6IDI7IC0qLSAqL1xuLypcbiAqIENvcHlyaWdodCAyMDExIE1vemlsbGEgRm91bmRhdGlvbiBhbmQgY29udHJpYnV0b3JzXG4gKiBMaWNlbnNlZCB1bmRlciB0aGUgTmV3IEJTRCBsaWNlbnNlLiBTZWUgTElDRU5TRSBvcjpcbiAqIGh0dHA6Ly9vcGVuc291cmNlLm9yZy9saWNlbnNlcy9CU0QtMy1DbGF1c2VcbiAqL1xuXG52YXIgaW50VG9DaGFyTWFwID0gJ0FCQ0RFRkdISUpLTE1OT1BRUlNUVVZXWFlaYWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXowMTIzNDU2Nzg5Ky8nLnNwbGl0KCcnKTtcblxuLyoqXG4gKiBFbmNvZGUgYW4gaW50ZWdlciBpbiB0aGUgcmFuZ2Ugb2YgMCB0byA2MyB0byBhIHNpbmdsZSBiYXNlIDY0IGRpZ2l0LlxuICovXG5leHBvcnRzLmVuY29kZSA9IGZ1bmN0aW9uIChudW1iZXIpIHtcbiAgaWYgKDAgPD0gbnVtYmVyICYmIG51bWJlciA8IGludFRvQ2hhck1hcC5sZW5ndGgpIHtcbiAgICByZXR1cm4gaW50VG9DaGFyTWFwW251bWJlcl07XG4gIH1cbiAgdGhyb3cgbmV3IFR5cGVFcnJvcihcIk11c3QgYmUgYmV0d2VlbiAwIGFuZCA2MzogXCIgKyBudW1iZXIpO1xufTtcblxuLyoqXG4gKiBEZWNvZGUgYSBzaW5nbGUgYmFzZSA2NCBjaGFyYWN0ZXIgY29kZSBkaWdpdCB0byBhbiBpbnRlZ2VyLiBSZXR1cm5zIC0xIG9uXG4gKiBmYWlsdXJlLlxuICovXG5leHBvcnRzLmRlY29kZSA9IGZ1bmN0aW9uIChjaGFyQ29kZSkge1xuICB2YXIgYmlnQSA9IDY1OyAgICAgLy8gJ0EnXG4gIHZhciBiaWdaID0gOTA7ICAgICAvLyAnWidcblxuICB2YXIgbGl0dGxlQSA9IDk3OyAgLy8gJ2EnXG4gIHZhciBsaXR0bGVaID0gMTIyOyAvLyAneidcblxuICB2YXIgemVybyA9IDQ4OyAgICAgLy8gJzAnXG4gIHZhciBuaW5lID0gNTc7ICAgICAvLyAnOSdcblxuICB2YXIgcGx1cyA9IDQzOyAgICAgLy8gJysnXG4gIHZhciBzbGFzaCA9IDQ3OyAgICAvLyAnLydcblxuICB2YXIgbGl0dGxlT2Zmc2V0ID0gMjY7XG4gIHZhciBudW1iZXJPZmZzZXQgPSA1MjtcblxuICAvLyAwIC0gMjU6IEFCQ0RFRkdISUpLTE1OT1BRUlNUVVZXWFlaXG4gIGlmIChiaWdBIDw9IGNoYXJDb2RlICYmIGNoYXJDb2RlIDw9IGJpZ1opIHtcbiAgICByZXR1cm4gKGNoYXJDb2RlIC0gYmlnQSk7XG4gIH1cblxuICAvLyAyNiAtIDUxOiBhYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5elxuICBpZiAobGl0dGxlQSA8PSBjaGFyQ29kZSAmJiBjaGFyQ29kZSA8PSBsaXR0bGVaKSB7XG4gICAgcmV0dXJuIChjaGFyQ29kZSAtIGxpdHRsZUEgKyBsaXR0bGVPZmZzZXQpO1xuICB9XG5cbiAgLy8gNTIgLSA2MTogMDEyMzQ1Njc4OVxuICBpZiAoemVybyA8PSBjaGFyQ29kZSAmJiBjaGFyQ29kZSA8PSBuaW5lKSB7XG4gICAgcmV0dXJuIChjaGFyQ29kZSAtIHplcm8gKyBudW1iZXJPZmZzZXQpO1xuICB9XG5cbiAgLy8gNjI6ICtcbiAgaWYgKGNoYXJDb2RlID09IHBsdXMpIHtcbiAgICByZXR1cm4gNjI7XG4gIH1cblxuICAvLyA2MzogL1xuICBpZiAoY2hhckNvZGUgPT0gc2xhc2gpIHtcbiAgICByZXR1cm4gNjM7XG4gIH1cblxuICAvLyBJbnZhbGlkIGJhc2U2NCBkaWdpdC5cbiAgcmV0dXJuIC0xO1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbGliL2Jhc2U2NC5qc1xuLy8gbW9kdWxlIGlkID0gM1xuLy8gbW9kdWxlIGNodW5rcyA9IDAiLCIvKiAtKi0gTW9kZToganM7IGpzLWluZGVudC1sZXZlbDogMjsgLSotICovXG4vKlxuICogQ29weXJpZ2h0IDIwMTEgTW96aWxsYSBGb3VuZGF0aW9uIGFuZCBjb250cmlidXRvcnNcbiAqIExpY2Vuc2VkIHVuZGVyIHRoZSBOZXcgQlNEIGxpY2Vuc2UuIFNlZSBMSUNFTlNFIG9yOlxuICogaHR0cDovL29wZW5zb3VyY2Uub3JnL2xpY2Vuc2VzL0JTRC0zLUNsYXVzZVxuICovXG5cbi8qKlxuICogVGhpcyBpcyBhIGhlbHBlciBmdW5jdGlvbiBmb3IgZ2V0dGluZyB2YWx1ZXMgZnJvbSBwYXJhbWV0ZXIvb3B0aW9uc1xuICogb2JqZWN0cy5cbiAqXG4gKiBAcGFyYW0gYXJncyBUaGUgb2JqZWN0IHdlIGFyZSBleHRyYWN0aW5nIHZhbHVlcyBmcm9tXG4gKiBAcGFyYW0gbmFtZSBUaGUgbmFtZSBvZiB0aGUgcHJvcGVydHkgd2UgYXJlIGdldHRpbmcuXG4gKiBAcGFyYW0gZGVmYXVsdFZhbHVlIEFuIG9wdGlvbmFsIHZhbHVlIHRvIHJldHVybiBpZiB0aGUgcHJvcGVydHkgaXMgbWlzc2luZ1xuICogZnJvbSB0aGUgb2JqZWN0LiBJZiB0aGlzIGlzIG5vdCBzcGVjaWZpZWQgYW5kIHRoZSBwcm9wZXJ0eSBpcyBtaXNzaW5nLCBhblxuICogZXJyb3Igd2lsbCBiZSB0aHJvd24uXG4gKi9cbmZ1bmN0aW9uIGdldEFyZyhhQXJncywgYU5hbWUsIGFEZWZhdWx0VmFsdWUpIHtcbiAgaWYgKGFOYW1lIGluIGFBcmdzKSB7XG4gICAgcmV0dXJuIGFBcmdzW2FOYW1lXTtcbiAgfSBlbHNlIGlmIChhcmd1bWVudHMubGVuZ3RoID09PSAzKSB7XG4gICAgcmV0dXJuIGFEZWZhdWx0VmFsdWU7XG4gIH0gZWxzZSB7XG4gICAgdGhyb3cgbmV3IEVycm9yKCdcIicgKyBhTmFtZSArICdcIiBpcyBhIHJlcXVpcmVkIGFyZ3VtZW50LicpO1xuICB9XG59XG5leHBvcnRzLmdldEFyZyA9IGdldEFyZztcblxudmFyIHVybFJlZ2V4cCA9IC9eKD86KFtcXHcrXFwtLl0rKTopP1xcL1xcLyg/OihcXHcrOlxcdyspQCk/KFtcXHcuLV0qKSg/OjooXFxkKykpPyguKikkLztcbnZhciBkYXRhVXJsUmVnZXhwID0gL15kYXRhOi4rXFwsLiskLztcblxuZnVuY3Rpb24gdXJsUGFyc2UoYVVybCkge1xuICB2YXIgbWF0Y2ggPSBhVXJsLm1hdGNoKHVybFJlZ2V4cCk7XG4gIGlmICghbWF0Y2gpIHtcbiAgICByZXR1cm4gbnVsbDtcbiAgfVxuICByZXR1cm4ge1xuICAgIHNjaGVtZTogbWF0Y2hbMV0sXG4gICAgYXV0aDogbWF0Y2hbMl0sXG4gICAgaG9zdDogbWF0Y2hbM10sXG4gICAgcG9ydDogbWF0Y2hbNF0sXG4gICAgcGF0aDogbWF0Y2hbNV1cbiAgfTtcbn1cbmV4cG9ydHMudXJsUGFyc2UgPSB1cmxQYXJzZTtcblxuZnVuY3Rpb24gdXJsR2VuZXJhdGUoYVBhcnNlZFVybCkge1xuICB2YXIgdXJsID0gJyc7XG4gIGlmIChhUGFyc2VkVXJsLnNjaGVtZSkge1xuICAgIHVybCArPSBhUGFyc2VkVXJsLnNjaGVtZSArICc6JztcbiAgfVxuICB1cmwgKz0gJy8vJztcbiAgaWYgKGFQYXJzZWRVcmwuYXV0aCkge1xuICAgIHVybCArPSBhUGFyc2VkVXJsLmF1dGggKyAnQCc7XG4gIH1cbiAgaWYgKGFQYXJzZWRVcmwuaG9zdCkge1xuICAgIHVybCArPSBhUGFyc2VkVXJsLmhvc3Q7XG4gIH1cbiAgaWYgKGFQYXJzZWRVcmwucG9ydCkge1xuICAgIHVybCArPSBcIjpcIiArIGFQYXJzZWRVcmwucG9ydFxuICB9XG4gIGlmIChhUGFyc2VkVXJsLnBhdGgpIHtcbiAgICB1cmwgKz0gYVBhcnNlZFVybC5wYXRoO1xuICB9XG4gIHJldHVybiB1cmw7XG59XG5leHBvcnRzLnVybEdlbmVyYXRlID0gdXJsR2VuZXJhdGU7XG5cbi8qKlxuICogTm9ybWFsaXplcyBhIHBhdGgsIG9yIHRoZSBwYXRoIHBvcnRpb24gb2YgYSBVUkw6XG4gKlxuICogLSBSZXBsYWNlcyBjb25zZWN1dGl2ZSBzbGFzaGVzIHdpdGggb25lIHNsYXNoLlxuICogLSBSZW1vdmVzIHVubmVjZXNzYXJ5ICcuJyBwYXJ0cy5cbiAqIC0gUmVtb3ZlcyB1bm5lY2Vzc2FyeSAnPGRpcj4vLi4nIHBhcnRzLlxuICpcbiAqIEJhc2VkIG9uIGNvZGUgaW4gdGhlIE5vZGUuanMgJ3BhdGgnIGNvcmUgbW9kdWxlLlxuICpcbiAqIEBwYXJhbSBhUGF0aCBUaGUgcGF0aCBvciB1cmwgdG8gbm9ybWFsaXplLlxuICovXG5mdW5jdGlvbiBub3JtYWxpemUoYVBhdGgpIHtcbiAgdmFyIHBhdGggPSBhUGF0aDtcbiAgdmFyIHVybCA9IHVybFBhcnNlKGFQYXRoKTtcbiAgaWYgKHVybCkge1xuICAgIGlmICghdXJsLnBhdGgpIHtcbiAgICAgIHJldHVybiBhUGF0aDtcbiAgICB9XG4gICAgcGF0aCA9IHVybC5wYXRoO1xuICB9XG4gIHZhciBpc0Fic29sdXRlID0gZXhwb3J0cy5pc0Fic29sdXRlKHBhdGgpO1xuXG4gIHZhciBwYXJ0cyA9IHBhdGguc3BsaXQoL1xcLysvKTtcbiAgZm9yICh2YXIgcGFydCwgdXAgPSAwLCBpID0gcGFydHMubGVuZ3RoIC0gMTsgaSA+PSAwOyBpLS0pIHtcbiAgICBwYXJ0ID0gcGFydHNbaV07XG4gICAgaWYgKHBhcnQgPT09ICcuJykge1xuICAgICAgcGFydHMuc3BsaWNlKGksIDEpO1xuICAgIH0gZWxzZSBpZiAocGFydCA9PT0gJy4uJykge1xuICAgICAgdXArKztcbiAgICB9IGVsc2UgaWYgKHVwID4gMCkge1xuICAgICAgaWYgKHBhcnQgPT09ICcnKSB7XG4gICAgICAgIC8vIFRoZSBmaXJzdCBwYXJ0IGlzIGJsYW5rIGlmIHRoZSBwYXRoIGlzIGFic29sdXRlLiBUcnlpbmcgdG8gZ29cbiAgICAgICAgLy8gYWJvdmUgdGhlIHJvb3QgaXMgYSBuby1vcC4gVGhlcmVmb3JlIHdlIGNhbiByZW1vdmUgYWxsICcuLicgcGFydHNcbiAgICAgICAgLy8gZGlyZWN0bHkgYWZ0ZXIgdGhlIHJvb3QuXG4gICAgICAgIHBhcnRzLnNwbGljZShpICsgMSwgdXApO1xuICAgICAgICB1cCA9IDA7XG4gICAgICB9IGVsc2Uge1xuICAgICAgICBwYXJ0cy5zcGxpY2UoaSwgMik7XG4gICAgICAgIHVwLS07XG4gICAgICB9XG4gICAgfVxuICB9XG4gIHBhdGggPSBwYXJ0cy5qb2luKCcvJyk7XG5cbiAgaWYgKHBhdGggPT09ICcnKSB7XG4gICAgcGF0aCA9IGlzQWJzb2x1dGUgPyAnLycgOiAnLic7XG4gIH1cblxuICBpZiAodXJsKSB7XG4gICAgdXJsLnBhdGggPSBwYXRoO1xuICAgIHJldHVybiB1cmxHZW5lcmF0ZSh1cmwpO1xuICB9XG4gIHJldHVybiBwYXRoO1xufVxuZXhwb3J0cy5ub3JtYWxpemUgPSBub3JtYWxpemU7XG5cbi8qKlxuICogSm9pbnMgdHdvIHBhdGhzL1VSTHMuXG4gKlxuICogQHBhcmFtIGFSb290IFRoZSByb290IHBhdGggb3IgVVJMLlxuICogQHBhcmFtIGFQYXRoIFRoZSBwYXRoIG9yIFVSTCB0byBiZSBqb2luZWQgd2l0aCB0aGUgcm9vdC5cbiAqXG4gKiAtIElmIGFQYXRoIGlzIGEgVVJMIG9yIGEgZGF0YSBVUkksIGFQYXRoIGlzIHJldHVybmVkLCB1bmxlc3MgYVBhdGggaXMgYVxuICogICBzY2hlbWUtcmVsYXRpdmUgVVJMOiBUaGVuIHRoZSBzY2hlbWUgb2YgYVJvb3QsIGlmIGFueSwgaXMgcHJlcGVuZGVkXG4gKiAgIGZpcnN0LlxuICogLSBPdGhlcndpc2UgYVBhdGggaXMgYSBwYXRoLiBJZiBhUm9vdCBpcyBhIFVSTCwgdGhlbiBpdHMgcGF0aCBwb3J0aW9uXG4gKiAgIGlzIHVwZGF0ZWQgd2l0aCB0aGUgcmVzdWx0IGFuZCBhUm9vdCBpcyByZXR1cm5lZC4gT3RoZXJ3aXNlIHRoZSByZXN1bHRcbiAqICAgaXMgcmV0dXJuZWQuXG4gKiAgIC0gSWYgYVBhdGggaXMgYWJzb2x1dGUsIHRoZSByZXN1bHQgaXMgYVBhdGguXG4gKiAgIC0gT3RoZXJ3aXNlIHRoZSB0d28gcGF0aHMgYXJlIGpvaW5lZCB3aXRoIGEgc2xhc2guXG4gKiAtIEpvaW5pbmcgZm9yIGV4YW1wbGUgJ2h0dHA6Ly8nIGFuZCAnd3d3LmV4YW1wbGUuY29tJyBpcyBhbHNvIHN1cHBvcnRlZC5cbiAqL1xuZnVuY3Rpb24gam9pbihhUm9vdCwgYVBhdGgpIHtcbiAgaWYgKGFSb290ID09PSBcIlwiKSB7XG4gICAgYVJvb3QgPSBcIi5cIjtcbiAgfVxuICBpZiAoYVBhdGggPT09IFwiXCIpIHtcbiAgICBhUGF0aCA9IFwiLlwiO1xuICB9XG4gIHZhciBhUGF0aFVybCA9IHVybFBhcnNlKGFQYXRoKTtcbiAgdmFyIGFSb290VXJsID0gdXJsUGFyc2UoYVJvb3QpO1xuICBpZiAoYVJvb3RVcmwpIHtcbiAgICBhUm9vdCA9IGFSb290VXJsLnBhdGggfHwgJy8nO1xuICB9XG5cbiAgLy8gYGpvaW4oZm9vLCAnLy93d3cuZXhhbXBsZS5vcmcnKWBcbiAgaWYgKGFQYXRoVXJsICYmICFhUGF0aFVybC5zY2hlbWUpIHtcbiAgICBpZiAoYVJvb3RVcmwpIHtcbiAgICAgIGFQYXRoVXJsLnNjaGVtZSA9IGFSb290VXJsLnNjaGVtZTtcbiAgICB9XG4gICAgcmV0dXJuIHVybEdlbmVyYXRlKGFQYXRoVXJsKTtcbiAgfVxuXG4gIGlmIChhUGF0aFVybCB8fCBhUGF0aC5tYXRjaChkYXRhVXJsUmVnZXhwKSkge1xuICAgIHJldHVybiBhUGF0aDtcbiAgfVxuXG4gIC8vIGBqb2luKCdodHRwOi8vJywgJ3d3dy5leGFtcGxlLmNvbScpYFxuICBpZiAoYVJvb3RVcmwgJiYgIWFSb290VXJsLmhvc3QgJiYgIWFSb290VXJsLnBhdGgpIHtcbiAgICBhUm9vdFVybC5ob3N0ID0gYVBhdGg7XG4gICAgcmV0dXJuIHVybEdlbmVyYXRlKGFSb290VXJsKTtcbiAgfVxuXG4gIHZhciBqb2luZWQgPSBhUGF0aC5jaGFyQXQoMCkgPT09ICcvJ1xuICAgID8gYVBhdGhcbiAgICA6IG5vcm1hbGl6ZShhUm9vdC5yZXBsYWNlKC9cXC8rJC8sICcnKSArICcvJyArIGFQYXRoKTtcblxuICBpZiAoYVJvb3RVcmwpIHtcbiAgICBhUm9vdFVybC5wYXRoID0gam9pbmVkO1xuICAgIHJldHVybiB1cmxHZW5lcmF0ZShhUm9vdFVybCk7XG4gIH1cbiAgcmV0dXJuIGpvaW5lZDtcbn1cbmV4cG9ydHMuam9pbiA9IGpvaW47XG5cbmV4cG9ydHMuaXNBYnNvbHV0ZSA9IGZ1bmN0aW9uIChhUGF0aCkge1xuICByZXR1cm4gYVBhdGguY2hhckF0KDApID09PSAnLycgfHwgdXJsUmVnZXhwLnRlc3QoYVBhdGgpO1xufTtcblxuLyoqXG4gKiBNYWtlIGEgcGF0aCByZWxhdGl2ZSB0byBhIFVSTCBvciBhbm90aGVyIHBhdGguXG4gKlxuICogQHBhcmFtIGFSb290IFRoZSByb290IHBhdGggb3IgVVJMLlxuICogQHBhcmFtIGFQYXRoIFRoZSBwYXRoIG9yIFVSTCB0byBiZSBtYWRlIHJlbGF0aXZlIHRvIGFSb290LlxuICovXG5mdW5jdGlvbiByZWxhdGl2ZShhUm9vdCwgYVBhdGgpIHtcbiAgaWYgKGFSb290ID09PSBcIlwiKSB7XG4gICAgYVJvb3QgPSBcIi5cIjtcbiAgfVxuXG4gIGFSb290ID0gYVJvb3QucmVwbGFjZSgvXFwvJC8sICcnKTtcblxuICAvLyBJdCBpcyBwb3NzaWJsZSBmb3IgdGhlIHBhdGggdG8gYmUgYWJvdmUgdGhlIHJvb3QuIEluIHRoaXMgY2FzZSwgc2ltcGx5XG4gIC8vIGNoZWNraW5nIHdoZXRoZXIgdGhlIHJvb3QgaXMgYSBwcmVmaXggb2YgdGhlIHBhdGggd29uJ3Qgd29yay4gSW5zdGVhZCwgd2VcbiAgLy8gbmVlZCB0byByZW1vdmUgY29tcG9uZW50cyBmcm9tIHRoZSByb290IG9uZSBieSBvbmUsIHVudGlsIGVpdGhlciB3ZSBmaW5kXG4gIC8vIGEgcHJlZml4IHRoYXQgZml0cywgb3Igd2UgcnVuIG91dCBvZiBjb21wb25lbnRzIHRvIHJlbW92ZS5cbiAgdmFyIGxldmVsID0gMDtcbiAgd2hpbGUgKGFQYXRoLmluZGV4T2YoYVJvb3QgKyAnLycpICE9PSAwKSB7XG4gICAgdmFyIGluZGV4ID0gYVJvb3QubGFzdEluZGV4T2YoXCIvXCIpO1xuICAgIGlmIChpbmRleCA8IDApIHtcbiAgICAgIHJldHVybiBhUGF0aDtcbiAgICB9XG5cbiAgICAvLyBJZiB0aGUgb25seSBwYXJ0IG9mIHRoZSByb290IHRoYXQgaXMgbGVmdCBpcyB0aGUgc2NoZW1lIChpLmUuIGh0dHA6Ly8sXG4gICAgLy8gZmlsZTovLy8sIGV0Yy4pLCBvbmUgb3IgbW9yZSBzbGFzaGVzICgvKSwgb3Igc2ltcGx5IG5vdGhpbmcgYXQgYWxsLCB3ZVxuICAgIC8vIGhhdmUgZXhoYXVzdGVkIGFsbCBjb21wb25lbnRzLCBzbyB0aGUgcGF0aCBpcyBub3QgcmVsYXRpdmUgdG8gdGhlIHJvb3QuXG4gICAgYVJvb3QgPSBhUm9vdC5zbGljZSgwLCBpbmRleCk7XG4gICAgaWYgKGFSb290Lm1hdGNoKC9eKFteXFwvXSs6XFwvKT9cXC8qJC8pKSB7XG4gICAgICByZXR1cm4gYVBhdGg7XG4gICAgfVxuXG4gICAgKytsZXZlbDtcbiAgfVxuXG4gIC8vIE1ha2Ugc3VyZSB3ZSBhZGQgYSBcIi4uL1wiIGZvciBlYWNoIGNvbXBvbmVudCB3ZSByZW1vdmVkIGZyb20gdGhlIHJvb3QuXG4gIHJldHVybiBBcnJheShsZXZlbCArIDEpLmpvaW4oXCIuLi9cIikgKyBhUGF0aC5zdWJzdHIoYVJvb3QubGVuZ3RoICsgMSk7XG59XG5leHBvcnRzLnJlbGF0aXZlID0gcmVsYXRpdmU7XG5cbnZhciBzdXBwb3J0c051bGxQcm90byA9IChmdW5jdGlvbiAoKSB7XG4gIHZhciBvYmogPSBPYmplY3QuY3JlYXRlKG51bGwpO1xuICByZXR1cm4gISgnX19wcm90b19fJyBpbiBvYmopO1xufSgpKTtcblxuZnVuY3Rpb24gaWRlbnRpdHkgKHMpIHtcbiAgcmV0dXJuIHM7XG59XG5cbi8qKlxuICogQmVjYXVzZSBiZWhhdmlvciBnb2VzIHdhY2t5IHdoZW4geW91IHNldCBgX19wcm90b19fYCBvbiBvYmplY3RzLCB3ZVxuICogaGF2ZSB0byBwcmVmaXggYWxsIHRoZSBzdHJpbmdzIGluIG91ciBzZXQgd2l0aCBhbiBhcmJpdHJhcnkgY2hhcmFjdGVyLlxuICpcbiAqIFNlZSBodHRwczovL2dpdGh1Yi5jb20vbW96aWxsYS9zb3VyY2UtbWFwL3B1bGwvMzEgYW5kXG4gKiBodHRwczovL2dpdGh1Yi5jb20vbW96aWxsYS9zb3VyY2UtbWFwL2lzc3Vlcy8zMFxuICpcbiAqIEBwYXJhbSBTdHJpbmcgYVN0clxuICovXG5mdW5jdGlvbiB0b1NldFN0cmluZyhhU3RyKSB7XG4gIGlmIChpc1Byb3RvU3RyaW5nKGFTdHIpKSB7XG4gICAgcmV0dXJuICckJyArIGFTdHI7XG4gIH1cblxuICByZXR1cm4gYVN0cjtcbn1cbmV4cG9ydHMudG9TZXRTdHJpbmcgPSBzdXBwb3J0c051bGxQcm90byA/IGlkZW50aXR5IDogdG9TZXRTdHJpbmc7XG5cbmZ1bmN0aW9uIGZyb21TZXRTdHJpbmcoYVN0cikge1xuICBpZiAoaXNQcm90b1N0cmluZyhhU3RyKSkge1xuICAgIHJldHVybiBhU3RyLnNsaWNlKDEpO1xuICB9XG5cbiAgcmV0dXJuIGFTdHI7XG59XG5leHBvcnRzLmZyb21TZXRTdHJpbmcgPSBzdXBwb3J0c051bGxQcm90byA/IGlkZW50aXR5IDogZnJvbVNldFN0cmluZztcblxuZnVuY3Rpb24gaXNQcm90b1N0cmluZyhzKSB7XG4gIGlmICghcykge1xuICAgIHJldHVybiBmYWxzZTtcbiAgfVxuXG4gIHZhciBsZW5ndGggPSBzLmxlbmd0aDtcblxuICBpZiAobGVuZ3RoIDwgOSAvKiBcIl9fcHJvdG9fX1wiLmxlbmd0aCAqLykge1xuICAgIHJldHVybiBmYWxzZTtcbiAgfVxuXG4gIGlmIChzLmNoYXJDb2RlQXQobGVuZ3RoIC0gMSkgIT09IDk1ICAvKiAnXycgKi8gfHxcbiAgICAgIHMuY2hhckNvZGVBdChsZW5ndGggLSAyKSAhPT0gOTUgIC8qICdfJyAqLyB8fFxuICAgICAgcy5jaGFyQ29kZUF0KGxlbmd0aCAtIDMpICE9PSAxMTEgLyogJ28nICovIHx8XG4gICAgICBzLmNoYXJDb2RlQXQobGVuZ3RoIC0gNCkgIT09IDExNiAvKiAndCcgKi8gfHxcbiAgICAgIHMuY2hhckNvZGVBdChsZW5ndGggLSA1KSAhPT0gMTExIC8qICdvJyAqLyB8fFxuICAgICAgcy5jaGFyQ29kZUF0KGxlbmd0aCAtIDYpICE9PSAxMTQgLyogJ3InICovIHx8XG4gICAgICBzLmNoYXJDb2RlQXQobGVuZ3RoIC0gNykgIT09IDExMiAvKiAncCcgKi8gfHxcbiAgICAgIHMuY2hhckNvZGVBdChsZW5ndGggLSA4KSAhPT0gOTUgIC8qICdfJyAqLyB8fFxuICAgICAgcy5jaGFyQ29kZUF0KGxlbmd0aCAtIDkpICE9PSA5NSAgLyogJ18nICovKSB7XG4gICAgcmV0dXJuIGZhbHNlO1xuICB9XG5cbiAgZm9yICh2YXIgaSA9IGxlbmd0aCAtIDEwOyBpID49IDA7IGktLSkge1xuICAgIGlmIChzLmNoYXJDb2RlQXQoaSkgIT09IDM2IC8qICckJyAqLykge1xuICAgICAgcmV0dXJuIGZhbHNlO1xuICAgIH1cbiAgfVxuXG4gIHJldHVybiB0cnVlO1xufVxuXG4vKipcbiAqIENvbXBhcmF0b3IgYmV0d2VlbiB0d28gbWFwcGluZ3Mgd2hlcmUgdGhlIG9yaWdpbmFsIHBvc2l0aW9ucyBhcmUgY29tcGFyZWQuXG4gKlxuICogT3B0aW9uYWxseSBwYXNzIGluIGB0cnVlYCBhcyBgb25seUNvbXBhcmVHZW5lcmF0ZWRgIHRvIGNvbnNpZGVyIHR3b1xuICogbWFwcGluZ3Mgd2l0aCB0aGUgc2FtZSBvcmlnaW5hbCBzb3VyY2UvbGluZS9jb2x1bW4sIGJ1dCBkaWZmZXJlbnQgZ2VuZXJhdGVkXG4gKiBsaW5lIGFuZCBjb2x1bW4gdGhlIHNhbWUuIFVzZWZ1bCB3aGVuIHNlYXJjaGluZyBmb3IgYSBtYXBwaW5nIHdpdGggYVxuICogc3R1YmJlZCBvdXQgbWFwcGluZy5cbiAqL1xuZnVuY3Rpb24gY29tcGFyZUJ5T3JpZ2luYWxQb3NpdGlvbnMobWFwcGluZ0EsIG1hcHBpbmdCLCBvbmx5Q29tcGFyZU9yaWdpbmFsKSB7XG4gIHZhciBjbXAgPSBzdHJjbXAobWFwcGluZ0Euc291cmNlLCBtYXBwaW5nQi5zb3VyY2UpO1xuICBpZiAoY21wICE9PSAwKSB7XG4gICAgcmV0dXJuIGNtcDtcbiAgfVxuXG4gIGNtcCA9IG1hcHBpbmdBLm9yaWdpbmFsTGluZSAtIG1hcHBpbmdCLm9yaWdpbmFsTGluZTtcbiAgaWYgKGNtcCAhPT0gMCkge1xuICAgIHJldHVybiBjbXA7XG4gIH1cblxuICBjbXAgPSBtYXBwaW5nQS5vcmlnaW5hbENvbHVtbiAtIG1hcHBpbmdCLm9yaWdpbmFsQ29sdW1uO1xuICBpZiAoY21wICE9PSAwIHx8IG9ubHlDb21wYXJlT3JpZ2luYWwpIHtcbiAgICByZXR1cm4gY21wO1xuICB9XG5cbiAgY21wID0gbWFwcGluZ0EuZ2VuZXJhdGVkQ29sdW1uIC0gbWFwcGluZ0IuZ2VuZXJhdGVkQ29sdW1uO1xuICBpZiAoY21wICE9PSAwKSB7XG4gICAgcmV0dXJuIGNtcDtcbiAgfVxuXG4gIGNtcCA9IG1hcHBpbmdBLmdlbmVyYXRlZExpbmUgLSBtYXBwaW5nQi5nZW5lcmF0ZWRMaW5lO1xuICBpZiAoY21wICE9PSAwKSB7XG4gICAgcmV0dXJuIGNtcDtcbiAgfVxuXG4gIHJldHVybiBzdHJjbXAobWFwcGluZ0EubmFtZSwgbWFwcGluZ0IubmFtZSk7XG59XG5leHBvcnRzLmNvbXBhcmVCeU9yaWdpbmFsUG9zaXRpb25zID0gY29tcGFyZUJ5T3JpZ2luYWxQb3NpdGlvbnM7XG5cbi8qKlxuICogQ29tcGFyYXRvciBiZXR3ZWVuIHR3byBtYXBwaW5ncyB3aXRoIGRlZmxhdGVkIHNvdXJjZSBhbmQgbmFtZSBpbmRpY2VzIHdoZXJlXG4gKiB0aGUgZ2VuZXJhdGVkIHBvc2l0aW9ucyBhcmUgY29tcGFyZWQuXG4gKlxuICogT3B0aW9uYWxseSBwYXNzIGluIGB0cnVlYCBhcyBgb25seUNvbXBhcmVHZW5lcmF0ZWRgIHRvIGNvbnNpZGVyIHR3b1xuICogbWFwcGluZ3Mgd2l0aCB0aGUgc2FtZSBnZW5lcmF0ZWQgbGluZSBhbmQgY29sdW1uLCBidXQgZGlmZmVyZW50XG4gKiBzb3VyY2UvbmFtZS9vcmlnaW5hbCBsaW5lIGFuZCBjb2x1bW4gdGhlIHNhbWUuIFVzZWZ1bCB3aGVuIHNlYXJjaGluZyBmb3IgYVxuICogbWFwcGluZyB3aXRoIGEgc3R1YmJlZCBvdXQgbWFwcGluZy5cbiAqL1xuZnVuY3Rpb24gY29tcGFyZUJ5R2VuZXJhdGVkUG9zaXRpb25zRGVmbGF0ZWQobWFwcGluZ0EsIG1hcHBpbmdCLCBvbmx5Q29tcGFyZUdlbmVyYXRlZCkge1xuICB2YXIgY21wID0gbWFwcGluZ0EuZ2VuZXJhdGVkTGluZSAtIG1hcHBpbmdCLmdlbmVyYXRlZExpbmU7XG4gIGlmIChjbXAgIT09IDApIHtcbiAgICByZXR1cm4gY21wO1xuICB9XG5cbiAgY21wID0gbWFwcGluZ0EuZ2VuZXJhdGVkQ29sdW1uIC0gbWFwcGluZ0IuZ2VuZXJhdGVkQ29sdW1uO1xuICBpZiAoY21wICE9PSAwIHx8IG9ubHlDb21wYXJlR2VuZXJhdGVkKSB7XG4gICAgcmV0dXJuIGNtcDtcbiAgfVxuXG4gIGNtcCA9IHN0cmNtcChtYXBwaW5nQS5zb3VyY2UsIG1hcHBpbmdCLnNvdXJjZSk7XG4gIGlmIChjbXAgIT09IDApIHtcbiAgICByZXR1cm4gY21wO1xuICB9XG5cbiAgY21wID0gbWFwcGluZ0Eub3JpZ2luYWxMaW5lIC0gbWFwcGluZ0Iub3JpZ2luYWxMaW5lO1xuICBpZiAoY21wICE9PSAwKSB7XG4gICAgcmV0dXJuIGNtcDtcbiAgfVxuXG4gIGNtcCA9IG1hcHBpbmdBLm9yaWdpbmFsQ29sdW1uIC0gbWFwcGluZ0Iub3JpZ2luYWxDb2x1bW47XG4gIGlmIChjbXAgIT09IDApIHtcbiAgICByZXR1cm4gY21wO1xuICB9XG5cbiAgcmV0dXJuIHN0cmNtcChtYXBwaW5nQS5uYW1lLCBtYXBwaW5nQi5uYW1lKTtcbn1cbmV4cG9ydHMuY29tcGFyZUJ5R2VuZXJhdGVkUG9zaXRpb25zRGVmbGF0ZWQgPSBjb21wYXJlQnlHZW5lcmF0ZWRQb3NpdGlvbnNEZWZsYXRlZDtcblxuZnVuY3Rpb24gc3RyY21wKGFTdHIxLCBhU3RyMikge1xuICBpZiAoYVN0cjEgPT09IGFTdHIyKSB7XG4gICAgcmV0dXJuIDA7XG4gIH1cblxuICBpZiAoYVN0cjEgPT09IG51bGwpIHtcbiAgICByZXR1cm4gMTsgLy8gYVN0cjIgIT09IG51bGxcbiAgfVxuXG4gIGlmIChhU3RyMiA9PT0gbnVsbCkge1xuICAgIHJldHVybiAtMTsgLy8gYVN0cjEgIT09IG51bGxcbiAgfVxuXG4gIGlmIChhU3RyMSA+IGFTdHIyKSB7XG4gICAgcmV0dXJuIDE7XG4gIH1cblxuICByZXR1cm4gLTE7XG59XG5cbi8qKlxuICogQ29tcGFyYXRvciBiZXR3ZWVuIHR3byBtYXBwaW5ncyB3aXRoIGluZmxhdGVkIHNvdXJjZSBhbmQgbmFtZSBzdHJpbmdzIHdoZXJlXG4gKiB0aGUgZ2VuZXJhdGVkIHBvc2l0aW9ucyBhcmUgY29tcGFyZWQuXG4gKi9cbmZ1bmN0aW9uIGNvbXBhcmVCeUdlbmVyYXRlZFBvc2l0aW9uc0luZmxhdGVkKG1hcHBpbmdBLCBtYXBwaW5nQikge1xuICB2YXIgY21wID0gbWFwcGluZ0EuZ2VuZXJhdGVkTGluZSAtIG1hcHBpbmdCLmdlbmVyYXRlZExpbmU7XG4gIGlmIChjbXAgIT09IDApIHtcbiAgICByZXR1cm4gY21wO1xuICB9XG5cbiAgY21wID0gbWFwcGluZ0EuZ2VuZXJhdGVkQ29sdW1uIC0gbWFwcGluZ0IuZ2VuZXJhdGVkQ29sdW1uO1xuICBpZiAoY21wICE9PSAwKSB7XG4gICAgcmV0dXJuIGNtcDtcbiAgfVxuXG4gIGNtcCA9IHN0cmNtcChtYXBwaW5nQS5zb3VyY2UsIG1hcHBpbmdCLnNvdXJjZSk7XG4gIGlmIChjbXAgIT09IDApIHtcbiAgICByZXR1cm4gY21wO1xuICB9XG5cbiAgY21wID0gbWFwcGluZ0Eub3JpZ2luYWxMaW5lIC0gbWFwcGluZ0Iub3JpZ2luYWxMaW5lO1xuICBpZiAoY21wICE9PSAwKSB7XG4gICAgcmV0dXJuIGNtcDtcbiAgfVxuXG4gIGNtcCA9IG1hcHBpbmdBLm9yaWdpbmFsQ29sdW1uIC0gbWFwcGluZ0Iub3JpZ2luYWxDb2x1bW47XG4gIGlmIChjbXAgIT09IDApIHtcbiAgICByZXR1cm4gY21wO1xuICB9XG5cbiAgcmV0dXJuIHN0cmNtcChtYXBwaW5nQS5uYW1lLCBtYXBwaW5nQi5uYW1lKTtcbn1cbmV4cG9ydHMuY29tcGFyZUJ5R2VuZXJhdGVkUG9zaXRpb25zSW5mbGF0ZWQgPSBjb21wYXJlQnlHZW5lcmF0ZWRQb3NpdGlvbnNJbmZsYXRlZDtcblxuLyoqXG4gKiBTdHJpcCBhbnkgSlNPTiBYU1NJIGF2b2lkYW5jZSBwcmVmaXggZnJvbSB0aGUgc3RyaW5nIChhcyBkb2N1bWVudGVkXG4gKiBpbiB0aGUgc291cmNlIG1hcHMgc3BlY2lmaWNhdGlvbiksIGFuZCB0aGVuIHBhcnNlIHRoZSBzdHJpbmcgYXNcbiAqIEpTT04uXG4gKi9cbmZ1bmN0aW9uIHBhcnNlU291cmNlTWFwSW5wdXQoc3RyKSB7XG4gIHJldHVybiBKU09OLnBhcnNlKHN0ci5yZXBsYWNlKC9eXFwpXX0nW15cXG5dKlxcbi8sICcnKSk7XG59XG5leHBvcnRzLnBhcnNlU291cmNlTWFwSW5wdXQgPSBwYXJzZVNvdXJjZU1hcElucHV0O1xuXG4vKipcbiAqIENvbXB1dGUgdGhlIFVSTCBvZiBhIHNvdXJjZSBnaXZlbiB0aGUgdGhlIHNvdXJjZSByb290LCB0aGUgc291cmNlJ3NcbiAqIFVSTCwgYW5kIHRoZSBzb3VyY2UgbWFwJ3MgVVJMLlxuICovXG5mdW5jdGlvbiBjb21wdXRlU291cmNlVVJMKHNvdXJjZVJvb3QsIHNvdXJjZVVSTCwgc291cmNlTWFwVVJMKSB7XG4gIHNvdXJjZVVSTCA9IHNvdXJjZVVSTCB8fCAnJztcblxuICBpZiAoc291cmNlUm9vdCkge1xuICAgIC8vIFRoaXMgZm9sbG93cyB3aGF0IENocm9tZSBkb2VzLlxuICAgIGlmIChzb3VyY2VSb290W3NvdXJjZVJvb3QubGVuZ3RoIC0gMV0gIT09ICcvJyAmJiBzb3VyY2VVUkxbMF0gIT09ICcvJykge1xuICAgICAgc291cmNlUm9vdCArPSAnLyc7XG4gICAgfVxuICAgIC8vIFRoZSBzcGVjIHNheXM6XG4gICAgLy8gICBMaW5lIDQ6IEFuIG9wdGlvbmFsIHNvdXJjZSByb290LCB1c2VmdWwgZm9yIHJlbG9jYXRpbmcgc291cmNlXG4gICAgLy8gICBmaWxlcyBvbiBhIHNlcnZlciBvciByZW1vdmluZyByZXBlYXRlZCB2YWx1ZXMgaW4gdGhlXG4gICAgLy8gICDigJxzb3VyY2Vz4oCdIGVudHJ5LiAgVGhpcyB2YWx1ZSBpcyBwcmVwZW5kZWQgdG8gdGhlIGluZGl2aWR1YWxcbiAgICAvLyAgIGVudHJpZXMgaW4gdGhlIOKAnHNvdXJjZeKAnSBmaWVsZC5cbiAgICBzb3VyY2VVUkwgPSBzb3VyY2VSb290ICsgc291cmNlVVJMO1xuICB9XG5cbiAgLy8gSGlzdG9yaWNhbGx5LCBTb3VyY2VNYXBDb25zdW1lciBkaWQgbm90IHRha2UgdGhlIHNvdXJjZU1hcFVSTCBhc1xuICAvLyBhIHBhcmFtZXRlci4gIFRoaXMgbW9kZSBpcyBzdGlsbCBzb21ld2hhdCBzdXBwb3J0ZWQsIHdoaWNoIGlzIHdoeVxuICAvLyB0aGlzIGNvZGUgYmxvY2sgaXMgY29uZGl0aW9uYWwuICBIb3dldmVyLCBpdCdzIHByZWZlcmFibGUgdG8gcGFzc1xuICAvLyB0aGUgc291cmNlIG1hcCBVUkwgdG8gU291cmNlTWFwQ29uc3VtZXIsIHNvIHRoYXQgdGhpcyBmdW5jdGlvblxuICAvLyBjYW4gaW1wbGVtZW50IHRoZSBzb3VyY2UgVVJMIHJlc29sdXRpb24gYWxnb3JpdGhtIGFzIG91dGxpbmVkIGluXG4gIC8vIHRoZSBzcGVjLiAgVGhpcyBibG9jayBpcyBiYXNpY2FsbHkgdGhlIGVxdWl2YWxlbnQgb2Y6XG4gIC8vICAgIG5ldyBVUkwoc291cmNlVVJMLCBzb3VyY2VNYXBVUkwpLnRvU3RyaW5nKClcbiAgLy8gLi4uIGV4Y2VwdCBpdCBhdm9pZHMgdXNpbmcgVVJMLCB3aGljaCB3YXNuJ3QgYXZhaWxhYmxlIGluIHRoZVxuICAvLyBvbGRlciByZWxlYXNlcyBvZiBub2RlIHN0aWxsIHN1cHBvcnRlZCBieSB0aGlzIGxpYnJhcnkuXG4gIC8vXG4gIC8vIFRoZSBzcGVjIHNheXM6XG4gIC8vICAgSWYgdGhlIHNvdXJjZXMgYXJlIG5vdCBhYnNvbHV0ZSBVUkxzIGFmdGVyIHByZXBlbmRpbmcgb2YgdGhlXG4gIC8vICAg4oCcc291cmNlUm9vdOKAnSwgdGhlIHNvdXJjZXMgYXJlIHJlc29sdmVkIHJlbGF0aXZlIHRvIHRoZVxuICAvLyAgIFNvdXJjZU1hcCAobGlrZSByZXNvbHZpbmcgc2NyaXB0IHNyYyBpbiBhIGh0bWwgZG9jdW1lbnQpLlxuICBpZiAoc291cmNlTWFwVVJMKSB7XG4gICAgdmFyIHBhcnNlZCA9IHVybFBhcnNlKHNvdXJjZU1hcFVSTCk7XG4gICAgaWYgKCFwYXJzZWQpIHtcbiAgICAgIHRocm93IG5ldyBFcnJvcihcInNvdXJjZU1hcFVSTCBjb3VsZCBub3QgYmUgcGFyc2VkXCIpO1xuICAgIH1cbiAgICBpZiAocGFyc2VkLnBhdGgpIHtcbiAgICAgIC8vIFN0cmlwIHRoZSBsYXN0IHBhdGggY29tcG9uZW50LCBidXQga2VlcCB0aGUgXCIvXCIuXG4gICAgICB2YXIgaW5kZXggPSBwYXJzZWQucGF0aC5sYXN0SW5kZXhPZignLycpO1xuICAgICAgaWYgKGluZGV4ID49IDApIHtcbiAgICAgICAgcGFyc2VkLnBhdGggPSBwYXJzZWQucGF0aC5zdWJzdHJpbmcoMCwgaW5kZXggKyAxKTtcbiAgICAgIH1cbiAgICB9XG4gICAgc291cmNlVVJMID0gam9pbih1cmxHZW5lcmF0ZShwYXJzZWQpLCBzb3VyY2VVUkwpO1xuICB9XG5cbiAgcmV0dXJuIG5vcm1hbGl6ZShzb3VyY2VVUkwpO1xufVxuZXhwb3J0cy5jb21wdXRlU291cmNlVVJMID0gY29tcHV0ZVNvdXJjZVVSTDtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbGliL3V0aWwuanNcbi8vIG1vZHVsZSBpZCA9IDRcbi8vIG1vZHVsZSBjaHVua3MgPSAwIiwiLyogLSotIE1vZGU6IGpzOyBqcy1pbmRlbnQtbGV2ZWw6IDI7IC0qLSAqL1xuLypcbiAqIENvcHlyaWdodCAyMDExIE1vemlsbGEgRm91bmRhdGlvbiBhbmQgY29udHJpYnV0b3JzXG4gKiBMaWNlbnNlZCB1bmRlciB0aGUgTmV3IEJTRCBsaWNlbnNlLiBTZWUgTElDRU5TRSBvcjpcbiAqIGh0dHA6Ly9vcGVuc291cmNlLm9yZy9saWNlbnNlcy9CU0QtMy1DbGF1c2VcbiAqL1xuXG52YXIgdXRpbCA9IHJlcXVpcmUoJy4vdXRpbCcpO1xudmFyIGhhcyA9IE9iamVjdC5wcm90b3R5cGUuaGFzT3duUHJvcGVydHk7XG52YXIgaGFzTmF0aXZlTWFwID0gdHlwZW9mIE1hcCAhPT0gXCJ1bmRlZmluZWRcIjtcblxuLyoqXG4gKiBBIGRhdGEgc3RydWN0dXJlIHdoaWNoIGlzIGEgY29tYmluYXRpb24gb2YgYW4gYXJyYXkgYW5kIGEgc2V0LiBBZGRpbmcgYSBuZXdcbiAqIG1lbWJlciBpcyBPKDEpLCB0ZXN0aW5nIGZvciBtZW1iZXJzaGlwIGlzIE8oMSksIGFuZCBmaW5kaW5nIHRoZSBpbmRleCBvZiBhblxuICogZWxlbWVudCBpcyBPKDEpLiBSZW1vdmluZyBlbGVtZW50cyBmcm9tIHRoZSBzZXQgaXMgbm90IHN1cHBvcnRlZC4gT25seVxuICogc3RyaW5ncyBhcmUgc3VwcG9ydGVkIGZvciBtZW1iZXJzaGlwLlxuICovXG5mdW5jdGlvbiBBcnJheVNldCgpIHtcbiAgdGhpcy5fYXJyYXkgPSBbXTtcbiAgdGhpcy5fc2V0ID0gaGFzTmF0aXZlTWFwID8gbmV3IE1hcCgpIDogT2JqZWN0LmNyZWF0ZShudWxsKTtcbn1cblxuLyoqXG4gKiBTdGF0aWMgbWV0aG9kIGZvciBjcmVhdGluZyBBcnJheVNldCBpbnN0YW5jZXMgZnJvbSBhbiBleGlzdGluZyBhcnJheS5cbiAqL1xuQXJyYXlTZXQuZnJvbUFycmF5ID0gZnVuY3Rpb24gQXJyYXlTZXRfZnJvbUFycmF5KGFBcnJheSwgYUFsbG93RHVwbGljYXRlcykge1xuICB2YXIgc2V0ID0gbmV3IEFycmF5U2V0KCk7XG4gIGZvciAodmFyIGkgPSAwLCBsZW4gPSBhQXJyYXkubGVuZ3RoOyBpIDwgbGVuOyBpKyspIHtcbiAgICBzZXQuYWRkKGFBcnJheVtpXSwgYUFsbG93RHVwbGljYXRlcyk7XG4gIH1cbiAgcmV0dXJuIHNldDtcbn07XG5cbi8qKlxuICogUmV0dXJuIGhvdyBtYW55IHVuaXF1ZSBpdGVtcyBhcmUgaW4gdGhpcyBBcnJheVNldC4gSWYgZHVwbGljYXRlcyBoYXZlIGJlZW5cbiAqIGFkZGVkLCB0aGFuIHRob3NlIGRvIG5vdCBjb3VudCB0b3dhcmRzIHRoZSBzaXplLlxuICpcbiAqIEByZXR1cm5zIE51bWJlclxuICovXG5BcnJheVNldC5wcm90b3R5cGUuc2l6ZSA9IGZ1bmN0aW9uIEFycmF5U2V0X3NpemUoKSB7XG4gIHJldHVybiBoYXNOYXRpdmVNYXAgPyB0aGlzLl9zZXQuc2l6ZSA6IE9iamVjdC5nZXRPd25Qcm9wZXJ0eU5hbWVzKHRoaXMuX3NldCkubGVuZ3RoO1xufTtcblxuLyoqXG4gKiBBZGQgdGhlIGdpdmVuIHN0cmluZyB0byB0aGlzIHNldC5cbiAqXG4gKiBAcGFyYW0gU3RyaW5nIGFTdHJcbiAqL1xuQXJyYXlTZXQucHJvdG90eXBlLmFkZCA9IGZ1bmN0aW9uIEFycmF5U2V0X2FkZChhU3RyLCBhQWxsb3dEdXBsaWNhdGVzKSB7XG4gIHZhciBzU3RyID0gaGFzTmF0aXZlTWFwID8gYVN0ciA6IHV0aWwudG9TZXRTdHJpbmcoYVN0cik7XG4gIHZhciBpc0R1cGxpY2F0ZSA9IGhhc05hdGl2ZU1hcCA/IHRoaXMuaGFzKGFTdHIpIDogaGFzLmNhbGwodGhpcy5fc2V0LCBzU3RyKTtcbiAgdmFyIGlkeCA9IHRoaXMuX2FycmF5Lmxlbmd0aDtcbiAgaWYgKCFpc0R1cGxpY2F0ZSB8fCBhQWxsb3dEdXBsaWNhdGVzKSB7XG4gICAgdGhpcy5fYXJyYXkucHVzaChhU3RyKTtcbiAgfVxuICBpZiAoIWlzRHVwbGljYXRlKSB7XG4gICAgaWYgKGhhc05hdGl2ZU1hcCkge1xuICAgICAgdGhpcy5fc2V0LnNldChhU3RyLCBpZHgpO1xuICAgIH0gZWxzZSB7XG4gICAgICB0aGlzLl9zZXRbc1N0cl0gPSBpZHg7XG4gICAgfVxuICB9XG59O1xuXG4vKipcbiAqIElzIHRoZSBnaXZlbiBzdHJpbmcgYSBtZW1iZXIgb2YgdGhpcyBzZXQ/XG4gKlxuICogQHBhcmFtIFN0cmluZyBhU3RyXG4gKi9cbkFycmF5U2V0LnByb3RvdHlwZS5oYXMgPSBmdW5jdGlvbiBBcnJheVNldF9oYXMoYVN0cikge1xuICBpZiAoaGFzTmF0aXZlTWFwKSB7XG4gICAgcmV0dXJuIHRoaXMuX3NldC5oYXMoYVN0cik7XG4gIH0gZWxzZSB7XG4gICAgdmFyIHNTdHIgPSB1dGlsLnRvU2V0U3RyaW5nKGFTdHIpO1xuICAgIHJldHVybiBoYXMuY2FsbCh0aGlzLl9zZXQsIHNTdHIpO1xuICB9XG59O1xuXG4vKipcbiAqIFdoYXQgaXMgdGhlIGluZGV4IG9mIHRoZSBnaXZlbiBzdHJpbmcgaW4gdGhlIGFycmF5P1xuICpcbiAqIEBwYXJhbSBTdHJpbmcgYVN0clxuICovXG5BcnJheVNldC5wcm90b3R5cGUuaW5kZXhPZiA9IGZ1bmN0aW9uIEFycmF5U2V0X2luZGV4T2YoYVN0cikge1xuICBpZiAoaGFzTmF0aXZlTWFwKSB7XG4gICAgdmFyIGlkeCA9IHRoaXMuX3NldC5nZXQoYVN0cik7XG4gICAgaWYgKGlkeCA+PSAwKSB7XG4gICAgICAgIHJldHVybiBpZHg7XG4gICAgfVxuICB9IGVsc2Uge1xuICAgIHZhciBzU3RyID0gdXRpbC50b1NldFN0cmluZyhhU3RyKTtcbiAgICBpZiAoaGFzLmNhbGwodGhpcy5fc2V0LCBzU3RyKSkge1xuICAgICAgcmV0dXJuIHRoaXMuX3NldFtzU3RyXTtcbiAgICB9XG4gIH1cblxuICB0aHJvdyBuZXcgRXJyb3IoJ1wiJyArIGFTdHIgKyAnXCIgaXMgbm90IGluIHRoZSBzZXQuJyk7XG59O1xuXG4vKipcbiAqIFdoYXQgaXMgdGhlIGVsZW1lbnQgYXQgdGhlIGdpdmVuIGluZGV4P1xuICpcbiAqIEBwYXJhbSBOdW1iZXIgYUlkeFxuICovXG5BcnJheVNldC5wcm90b3R5cGUuYXQgPSBmdW5jdGlvbiBBcnJheVNldF9hdChhSWR4KSB7XG4gIGlmIChhSWR4ID49IDAgJiYgYUlkeCA8IHRoaXMuX2FycmF5Lmxlbmd0aCkge1xuICAgIHJldHVybiB0aGlzLl9hcnJheVthSWR4XTtcbiAgfVxuICB0aHJvdyBuZXcgRXJyb3IoJ05vIGVsZW1lbnQgaW5kZXhlZCBieSAnICsgYUlkeCk7XG59O1xuXG4vKipcbiAqIFJldHVybnMgdGhlIGFycmF5IHJlcHJlc2VudGF0aW9uIG9mIHRoaXMgc2V0ICh3aGljaCBoYXMgdGhlIHByb3BlciBpbmRpY2VzXG4gKiBpbmRpY2F0ZWQgYnkgaW5kZXhPZikuIE5vdGUgdGhhdCB0aGlzIGlzIGEgY29weSBvZiB0aGUgaW50ZXJuYWwgYXJyYXkgdXNlZFxuICogZm9yIHN0b3JpbmcgdGhlIG1lbWJlcnMgc28gdGhhdCBubyBvbmUgY2FuIG1lc3Mgd2l0aCBpbnRlcm5hbCBzdGF0ZS5cbiAqL1xuQXJyYXlTZXQucHJvdG90eXBlLnRvQXJyYXkgPSBmdW5jdGlvbiBBcnJheVNldF90b0FycmF5KCkge1xuICByZXR1cm4gdGhpcy5fYXJyYXkuc2xpY2UoKTtcbn07XG5cbmV4cG9ydHMuQXJyYXlTZXQgPSBBcnJheVNldDtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbGliL2FycmF5LXNldC5qc1xuLy8gbW9kdWxlIGlkID0gNVxuLy8gbW9kdWxlIGNodW5rcyA9IDAiLCIvKiAtKi0gTW9kZToganM7IGpzLWluZGVudC1sZXZlbDogMjsgLSotICovXG4vKlxuICogQ29weXJpZ2h0IDIwMTQgTW96aWxsYSBGb3VuZGF0aW9uIGFuZCBjb250cmlidXRvcnNcbiAqIExpY2Vuc2VkIHVuZGVyIHRoZSBOZXcgQlNEIGxpY2Vuc2UuIFNlZSBMSUNFTlNFIG9yOlxuICogaHR0cDovL29wZW5zb3VyY2Uub3JnL2xpY2Vuc2VzL0JTRC0zLUNsYXVzZVxuICovXG5cbnZhciB1dGlsID0gcmVxdWlyZSgnLi91dGlsJyk7XG5cbi8qKlxuICogRGV0ZXJtaW5lIHdoZXRoZXIgbWFwcGluZ0IgaXMgYWZ0ZXIgbWFwcGluZ0Egd2l0aCByZXNwZWN0IHRvIGdlbmVyYXRlZFxuICogcG9zaXRpb24uXG4gKi9cbmZ1bmN0aW9uIGdlbmVyYXRlZFBvc2l0aW9uQWZ0ZXIobWFwcGluZ0EsIG1hcHBpbmdCKSB7XG4gIC8vIE9wdGltaXplZCBmb3IgbW9zdCBjb21tb24gY2FzZVxuICB2YXIgbGluZUEgPSBtYXBwaW5nQS5nZW5lcmF0ZWRMaW5lO1xuICB2YXIgbGluZUIgPSBtYXBwaW5nQi5nZW5lcmF0ZWRMaW5lO1xuICB2YXIgY29sdW1uQSA9IG1hcHBpbmdBLmdlbmVyYXRlZENvbHVtbjtcbiAgdmFyIGNvbHVtbkIgPSBtYXBwaW5nQi5nZW5lcmF0ZWRDb2x1bW47XG4gIHJldHVybiBsaW5lQiA+IGxpbmVBIHx8IGxpbmVCID09IGxpbmVBICYmIGNvbHVtbkIgPj0gY29sdW1uQSB8fFxuICAgICAgICAgdXRpbC5jb21wYXJlQnlHZW5lcmF0ZWRQb3NpdGlvbnNJbmZsYXRlZChtYXBwaW5nQSwgbWFwcGluZ0IpIDw9IDA7XG59XG5cbi8qKlxuICogQSBkYXRhIHN0cnVjdHVyZSB0byBwcm92aWRlIGEgc29ydGVkIHZpZXcgb2YgYWNjdW11bGF0ZWQgbWFwcGluZ3MgaW4gYVxuICogcGVyZm9ybWFuY2UgY29uc2Npb3VzIG1hbm5lci4gSXQgdHJhZGVzIGEgbmVnbGliYWJsZSBvdmVyaGVhZCBpbiBnZW5lcmFsXG4gKiBjYXNlIGZvciBhIGxhcmdlIHNwZWVkdXAgaW4gY2FzZSBvZiBtYXBwaW5ncyBiZWluZyBhZGRlZCBpbiBvcmRlci5cbiAqL1xuZnVuY3Rpb24gTWFwcGluZ0xpc3QoKSB7XG4gIHRoaXMuX2FycmF5ID0gW107XG4gIHRoaXMuX3NvcnRlZCA9IHRydWU7XG4gIC8vIFNlcnZlcyBhcyBpbmZpbXVtXG4gIHRoaXMuX2xhc3QgPSB7Z2VuZXJhdGVkTGluZTogLTEsIGdlbmVyYXRlZENvbHVtbjogMH07XG59XG5cbi8qKlxuICogSXRlcmF0ZSB0aHJvdWdoIGludGVybmFsIGl0ZW1zLiBUaGlzIG1ldGhvZCB0YWtlcyB0aGUgc2FtZSBhcmd1bWVudHMgdGhhdFxuICogYEFycmF5LnByb3RvdHlwZS5mb3JFYWNoYCB0YWtlcy5cbiAqXG4gKiBOT1RFOiBUaGUgb3JkZXIgb2YgdGhlIG1hcHBpbmdzIGlzIE5PVCBndWFyYW50ZWVkLlxuICovXG5NYXBwaW5nTGlzdC5wcm90b3R5cGUudW5zb3J0ZWRGb3JFYWNoID1cbiAgZnVuY3Rpb24gTWFwcGluZ0xpc3RfZm9yRWFjaChhQ2FsbGJhY2ssIGFUaGlzQXJnKSB7XG4gICAgdGhpcy5fYXJyYXkuZm9yRWFjaChhQ2FsbGJhY2ssIGFUaGlzQXJnKTtcbiAgfTtcblxuLyoqXG4gKiBBZGQgdGhlIGdpdmVuIHNvdXJjZSBtYXBwaW5nLlxuICpcbiAqIEBwYXJhbSBPYmplY3QgYU1hcHBpbmdcbiAqL1xuTWFwcGluZ0xpc3QucHJvdG90eXBlLmFkZCA9IGZ1bmN0aW9uIE1hcHBpbmdMaXN0X2FkZChhTWFwcGluZykge1xuICBpZiAoZ2VuZXJhdGVkUG9zaXRpb25BZnRlcih0aGlzLl9sYXN0LCBhTWFwcGluZykpIHtcbiAgICB0aGlzLl9sYXN0ID0gYU1hcHBpbmc7XG4gICAgdGhpcy5fYXJyYXkucHVzaChhTWFwcGluZyk7XG4gIH0gZWxzZSB7XG4gICAgdGhpcy5fc29ydGVkID0gZmFsc2U7XG4gICAgdGhpcy5fYXJyYXkucHVzaChhTWFwcGluZyk7XG4gIH1cbn07XG5cbi8qKlxuICogUmV0dXJucyB0aGUgZmxhdCwgc29ydGVkIGFycmF5IG9mIG1hcHBpbmdzLiBUaGUgbWFwcGluZ3MgYXJlIHNvcnRlZCBieVxuICogZ2VuZXJhdGVkIHBvc2l0aW9uLlxuICpcbiAqIFdBUk5JTkc6IFRoaXMgbWV0aG9kIHJldHVybnMgaW50ZXJuYWwgZGF0YSB3aXRob3V0IGNvcHlpbmcsIGZvclxuICogcGVyZm9ybWFuY2UuIFRoZSByZXR1cm4gdmFsdWUgbXVzdCBOT1QgYmUgbXV0YXRlZCwgYW5kIHNob3VsZCBiZSB0cmVhdGVkIGFzXG4gKiBhbiBpbW11dGFibGUgYm9ycm93LiBJZiB5b3Ugd2FudCB0byB0YWtlIG93bmVyc2hpcCwgeW91IG11c3QgbWFrZSB5b3VyIG93blxuICogY29weS5cbiAqL1xuTWFwcGluZ0xpc3QucHJvdG90eXBlLnRvQXJyYXkgPSBmdW5jdGlvbiBNYXBwaW5nTGlzdF90b0FycmF5KCkge1xuICBpZiAoIXRoaXMuX3NvcnRlZCkge1xuICAgIHRoaXMuX2FycmF5LnNvcnQodXRpbC5jb21wYXJlQnlHZW5lcmF0ZWRQb3NpdGlvbnNJbmZsYXRlZCk7XG4gICAgdGhpcy5fc29ydGVkID0gdHJ1ZTtcbiAgfVxuICByZXR1cm4gdGhpcy5fYXJyYXk7XG59O1xuXG5leHBvcnRzLk1hcHBpbmdMaXN0ID0gTWFwcGluZ0xpc3Q7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL2xpYi9tYXBwaW5nLWxpc3QuanNcbi8vIG1vZHVsZSBpZCA9IDZcbi8vIG1vZHVsZSBjaHVua3MgPSAwIiwiLyogLSotIE1vZGU6IGpzOyBqcy1pbmRlbnQtbGV2ZWw6IDI7IC0qLSAqL1xuLypcbiAqIENvcHlyaWdodCAyMDExIE1vemlsbGEgRm91bmRhdGlvbiBhbmQgY29udHJpYnV0b3JzXG4gKiBMaWNlbnNlZCB1bmRlciB0aGUgTmV3IEJTRCBsaWNlbnNlLiBTZWUgTElDRU5TRSBvcjpcbiAqIGh0dHA6Ly9vcGVuc291cmNlLm9yZy9saWNlbnNlcy9CU0QtMy1DbGF1c2VcbiAqL1xuXG52YXIgdXRpbCA9IHJlcXVpcmUoJy4vdXRpbCcpO1xudmFyIGJpbmFyeVNlYXJjaCA9IHJlcXVpcmUoJy4vYmluYXJ5LXNlYXJjaCcpO1xudmFyIEFycmF5U2V0ID0gcmVxdWlyZSgnLi9hcnJheS1zZXQnKS5BcnJheVNldDtcbnZhciBiYXNlNjRWTFEgPSByZXF1aXJlKCcuL2Jhc2U2NC12bHEnKTtcbnZhciBxdWlja1NvcnQgPSByZXF1aXJlKCcuL3F1aWNrLXNvcnQnKS5xdWlja1NvcnQ7XG5cbmZ1bmN0aW9uIFNvdXJjZU1hcENvbnN1bWVyKGFTb3VyY2VNYXAsIGFTb3VyY2VNYXBVUkwpIHtcbiAgdmFyIHNvdXJjZU1hcCA9IGFTb3VyY2VNYXA7XG4gIGlmICh0eXBlb2YgYVNvdXJjZU1hcCA9PT0gJ3N0cmluZycpIHtcbiAgICBzb3VyY2VNYXAgPSB1dGlsLnBhcnNlU291cmNlTWFwSW5wdXQoYVNvdXJjZU1hcCk7XG4gIH1cblxuICByZXR1cm4gc291cmNlTWFwLnNlY3Rpb25zICE9IG51bGxcbiAgICA/IG5ldyBJbmRleGVkU291cmNlTWFwQ29uc3VtZXIoc291cmNlTWFwLCBhU291cmNlTWFwVVJMKVxuICAgIDogbmV3IEJhc2ljU291cmNlTWFwQ29uc3VtZXIoc291cmNlTWFwLCBhU291cmNlTWFwVVJMKTtcbn1cblxuU291cmNlTWFwQ29uc3VtZXIuZnJvbVNvdXJjZU1hcCA9IGZ1bmN0aW9uKGFTb3VyY2VNYXAsIGFTb3VyY2VNYXBVUkwpIHtcbiAgcmV0dXJuIEJhc2ljU291cmNlTWFwQ29uc3VtZXIuZnJvbVNvdXJjZU1hcChhU291cmNlTWFwLCBhU291cmNlTWFwVVJMKTtcbn1cblxuLyoqXG4gKiBUaGUgdmVyc2lvbiBvZiB0aGUgc291cmNlIG1hcHBpbmcgc3BlYyB0aGF0IHdlIGFyZSBjb25zdW1pbmcuXG4gKi9cblNvdXJjZU1hcENvbnN1bWVyLnByb3RvdHlwZS5fdmVyc2lvbiA9IDM7XG5cbi8vIGBfX2dlbmVyYXRlZE1hcHBpbmdzYCBhbmQgYF9fb3JpZ2luYWxNYXBwaW5nc2AgYXJlIGFycmF5cyB0aGF0IGhvbGQgdGhlXG4vLyBwYXJzZWQgbWFwcGluZyBjb29yZGluYXRlcyBmcm9tIHRoZSBzb3VyY2UgbWFwJ3MgXCJtYXBwaW5nc1wiIGF0dHJpYnV0ZS4gVGhleVxuLy8gYXJlIGxhemlseSBpbnN0YW50aWF0ZWQsIGFjY2Vzc2VkIHZpYSB0aGUgYF9nZW5lcmF0ZWRNYXBwaW5nc2AgYW5kXG4vLyBgX29yaWdpbmFsTWFwcGluZ3NgIGdldHRlcnMgcmVzcGVjdGl2ZWx5LCBhbmQgd2Ugb25seSBwYXJzZSB0aGUgbWFwcGluZ3Ncbi8vIGFuZCBjcmVhdGUgdGhlc2UgYXJyYXlzIG9uY2UgcXVlcmllZCBmb3IgYSBzb3VyY2UgbG9jYXRpb24uIFdlIGp1bXAgdGhyb3VnaFxuLy8gdGhlc2UgaG9vcHMgYmVjYXVzZSB0aGVyZSBjYW4gYmUgbWFueSB0aG91c2FuZHMgb2YgbWFwcGluZ3MsIGFuZCBwYXJzaW5nXG4vLyB0aGVtIGlzIGV4cGVuc2l2ZSwgc28gd2Ugb25seSB3YW50IHRvIGRvIGl0IGlmIHdlIG11c3QuXG4vL1xuLy8gRWFjaCBvYmplY3QgaW4gdGhlIGFycmF5cyBpcyBvZiB0aGUgZm9ybTpcbi8vXG4vLyAgICAge1xuLy8gICAgICAgZ2VuZXJhdGVkTGluZTogVGhlIGxpbmUgbnVtYmVyIGluIHRoZSBnZW5lcmF0ZWQgY29kZSxcbi8vICAgICAgIGdlbmVyYXRlZENvbHVtbjogVGhlIGNvbHVtbiBudW1iZXIgaW4gdGhlIGdlbmVyYXRlZCBjb2RlLFxuLy8gICAgICAgc291cmNlOiBUaGUgcGF0aCB0byB0aGUgb3JpZ2luYWwgc291cmNlIGZpbGUgdGhhdCBnZW5lcmF0ZWQgdGhpc1xuLy8gICAgICAgICAgICAgICBjaHVuayBvZiBjb2RlLFxuLy8gICAgICAgb3JpZ2luYWxMaW5lOiBUaGUgbGluZSBudW1iZXIgaW4gdGhlIG9yaWdpbmFsIHNvdXJjZSB0aGF0XG4vLyAgICAgICAgICAgICAgICAgICAgIGNvcnJlc3BvbmRzIHRvIHRoaXMgY2h1bmsgb2YgZ2VuZXJhdGVkIGNvZGUsXG4vLyAgICAgICBvcmlnaW5hbENvbHVtbjogVGhlIGNvbHVtbiBudW1iZXIgaW4gdGhlIG9yaWdpbmFsIHNvdXJjZSB0aGF0XG4vLyAgICAgICAgICAgICAgICAgICAgICAgY29ycmVzcG9uZHMgdG8gdGhpcyBjaHVuayBvZiBnZW5lcmF0ZWQgY29kZSxcbi8vICAgICAgIG5hbWU6IFRoZSBuYW1lIG9mIHRoZSBvcmlnaW5hbCBzeW1ib2wgd2hpY2ggZ2VuZXJhdGVkIHRoaXMgY2h1bmsgb2Zcbi8vICAgICAgICAgICAgIGNvZGUuXG4vLyAgICAgfVxuLy9cbi8vIEFsbCBwcm9wZXJ0aWVzIGV4Y2VwdCBmb3IgYGdlbmVyYXRlZExpbmVgIGFuZCBgZ2VuZXJhdGVkQ29sdW1uYCBjYW4gYmVcbi8vIGBudWxsYC5cbi8vXG4vLyBgX2dlbmVyYXRlZE1hcHBpbmdzYCBpcyBvcmRlcmVkIGJ5IHRoZSBnZW5lcmF0ZWQgcG9zaXRpb25zLlxuLy9cbi8vIGBfb3JpZ2luYWxNYXBwaW5nc2AgaXMgb3JkZXJlZCBieSB0aGUgb3JpZ2luYWwgcG9zaXRpb25zLlxuXG5Tb3VyY2VNYXBDb25zdW1lci5wcm90b3R5cGUuX19nZW5lcmF0ZWRNYXBwaW5ncyA9IG51bGw7XG5PYmplY3QuZGVmaW5lUHJvcGVydHkoU291cmNlTWFwQ29uc3VtZXIucHJvdG90eXBlLCAnX2dlbmVyYXRlZE1hcHBpbmdzJywge1xuICBjb25maWd1cmFibGU6IHRydWUsXG4gIGVudW1lcmFibGU6IHRydWUsXG4gIGdldDogZnVuY3Rpb24gKCkge1xuICAgIGlmICghdGhpcy5fX2dlbmVyYXRlZE1hcHBpbmdzKSB7XG4gICAgICB0aGlzLl9wYXJzZU1hcHBpbmdzKHRoaXMuX21hcHBpbmdzLCB0aGlzLnNvdXJjZVJvb3QpO1xuICAgIH1cblxuICAgIHJldHVybiB0aGlzLl9fZ2VuZXJhdGVkTWFwcGluZ3M7XG4gIH1cbn0pO1xuXG5Tb3VyY2VNYXBDb25zdW1lci5wcm90b3R5cGUuX19vcmlnaW5hbE1hcHBpbmdzID0gbnVsbDtcbk9iamVjdC5kZWZpbmVQcm9wZXJ0eShTb3VyY2VNYXBDb25zdW1lci5wcm90b3R5cGUsICdfb3JpZ2luYWxNYXBwaW5ncycsIHtcbiAgY29uZmlndXJhYmxlOiB0cnVlLFxuICBlbnVtZXJhYmxlOiB0cnVlLFxuICBnZXQ6IGZ1bmN0aW9uICgpIHtcbiAgICBpZiAoIXRoaXMuX19vcmlnaW5hbE1hcHBpbmdzKSB7XG4gICAgICB0aGlzLl9wYXJzZU1hcHBpbmdzKHRoaXMuX21hcHBpbmdzLCB0aGlzLnNvdXJjZVJvb3QpO1xuICAgIH1cblxuICAgIHJldHVybiB0aGlzLl9fb3JpZ2luYWxNYXBwaW5ncztcbiAgfVxufSk7XG5cblNvdXJjZU1hcENvbnN1bWVyLnByb3RvdHlwZS5fY2hhcklzTWFwcGluZ1NlcGFyYXRvciA9XG4gIGZ1bmN0aW9uIFNvdXJjZU1hcENvbnN1bWVyX2NoYXJJc01hcHBpbmdTZXBhcmF0b3IoYVN0ciwgaW5kZXgpIHtcbiAgICB2YXIgYyA9IGFTdHIuY2hhckF0KGluZGV4KTtcbiAgICByZXR1cm4gYyA9PT0gXCI7XCIgfHwgYyA9PT0gXCIsXCI7XG4gIH07XG5cbi8qKlxuICogUGFyc2UgdGhlIG1hcHBpbmdzIGluIGEgc3RyaW5nIGluIHRvIGEgZGF0YSBzdHJ1Y3R1cmUgd2hpY2ggd2UgY2FuIGVhc2lseVxuICogcXVlcnkgKHRoZSBvcmRlcmVkIGFycmF5cyBpbiB0aGUgYHRoaXMuX19nZW5lcmF0ZWRNYXBwaW5nc2AgYW5kXG4gKiBgdGhpcy5fX29yaWdpbmFsTWFwcGluZ3NgIHByb3BlcnRpZXMpLlxuICovXG5Tb3VyY2VNYXBDb25zdW1lci5wcm90b3R5cGUuX3BhcnNlTWFwcGluZ3MgPVxuICBmdW5jdGlvbiBTb3VyY2VNYXBDb25zdW1lcl9wYXJzZU1hcHBpbmdzKGFTdHIsIGFTb3VyY2VSb290KSB7XG4gICAgdGhyb3cgbmV3IEVycm9yKFwiU3ViY2xhc3NlcyBtdXN0IGltcGxlbWVudCBfcGFyc2VNYXBwaW5nc1wiKTtcbiAgfTtcblxuU291cmNlTWFwQ29uc3VtZXIuR0VORVJBVEVEX09SREVSID0gMTtcblNvdXJjZU1hcENvbnN1bWVyLk9SSUdJTkFMX09SREVSID0gMjtcblxuU291cmNlTWFwQ29uc3VtZXIuR1JFQVRFU1RfTE9XRVJfQk9VTkQgPSAxO1xuU291cmNlTWFwQ29uc3VtZXIuTEVBU1RfVVBQRVJfQk9VTkQgPSAyO1xuXG4vKipcbiAqIEl0ZXJhdGUgb3ZlciBlYWNoIG1hcHBpbmcgYmV0d2VlbiBhbiBvcmlnaW5hbCBzb3VyY2UvbGluZS9jb2x1bW4gYW5kIGFcbiAqIGdlbmVyYXRlZCBsaW5lL2NvbHVtbiBpbiB0aGlzIHNvdXJjZSBtYXAuXG4gKlxuICogQHBhcmFtIEZ1bmN0aW9uIGFDYWxsYmFja1xuICogICAgICAgIFRoZSBmdW5jdGlvbiB0aGF0IGlzIGNhbGxlZCB3aXRoIGVhY2ggbWFwcGluZy5cbiAqIEBwYXJhbSBPYmplY3QgYUNvbnRleHRcbiAqICAgICAgICBPcHRpb25hbC4gSWYgc3BlY2lmaWVkLCB0aGlzIG9iamVjdCB3aWxsIGJlIHRoZSB2YWx1ZSBvZiBgdGhpc2AgZXZlcnlcbiAqICAgICAgICB0aW1lIHRoYXQgYGFDYWxsYmFja2AgaXMgY2FsbGVkLlxuICogQHBhcmFtIGFPcmRlclxuICogICAgICAgIEVpdGhlciBgU291cmNlTWFwQ29uc3VtZXIuR0VORVJBVEVEX09SREVSYCBvclxuICogICAgICAgIGBTb3VyY2VNYXBDb25zdW1lci5PUklHSU5BTF9PUkRFUmAuIFNwZWNpZmllcyB3aGV0aGVyIHlvdSB3YW50IHRvXG4gKiAgICAgICAgaXRlcmF0ZSBvdmVyIHRoZSBtYXBwaW5ncyBzb3J0ZWQgYnkgdGhlIGdlbmVyYXRlZCBmaWxlJ3MgbGluZS9jb2x1bW5cbiAqICAgICAgICBvcmRlciBvciB0aGUgb3JpZ2luYWwncyBzb3VyY2UvbGluZS9jb2x1bW4gb3JkZXIsIHJlc3BlY3RpdmVseS4gRGVmYXVsdHMgdG9cbiAqICAgICAgICBgU291cmNlTWFwQ29uc3VtZXIuR0VORVJBVEVEX09SREVSYC5cbiAqL1xuU291cmNlTWFwQ29uc3VtZXIucHJvdG90eXBlLmVhY2hNYXBwaW5nID1cbiAgZnVuY3Rpb24gU291cmNlTWFwQ29uc3VtZXJfZWFjaE1hcHBpbmcoYUNhbGxiYWNrLCBhQ29udGV4dCwgYU9yZGVyKSB7XG4gICAgdmFyIGNvbnRleHQgPSBhQ29udGV4dCB8fCBudWxsO1xuICAgIHZhciBvcmRlciA9IGFPcmRlciB8fCBTb3VyY2VNYXBDb25zdW1lci5HRU5FUkFURURfT1JERVI7XG5cbiAgICB2YXIgbWFwcGluZ3M7XG4gICAgc3dpdGNoIChvcmRlcikge1xuICAgIGNhc2UgU291cmNlTWFwQ29uc3VtZXIuR0VORVJBVEVEX09SREVSOlxuICAgICAgbWFwcGluZ3MgPSB0aGlzLl9nZW5lcmF0ZWRNYXBwaW5ncztcbiAgICAgIGJyZWFrO1xuICAgIGNhc2UgU291cmNlTWFwQ29uc3VtZXIuT1JJR0lOQUxfT1JERVI6XG4gICAgICBtYXBwaW5ncyA9IHRoaXMuX29yaWdpbmFsTWFwcGluZ3M7XG4gICAgICBicmVhaztcbiAgICBkZWZhdWx0OlxuICAgICAgdGhyb3cgbmV3IEVycm9yKFwiVW5rbm93biBvcmRlciBvZiBpdGVyYXRpb24uXCIpO1xuICAgIH1cblxuICAgIHZhciBzb3VyY2VSb290ID0gdGhpcy5zb3VyY2VSb290O1xuICAgIG1hcHBpbmdzLm1hcChmdW5jdGlvbiAobWFwcGluZykge1xuICAgICAgdmFyIHNvdXJjZSA9IG1hcHBpbmcuc291cmNlID09PSBudWxsID8gbnVsbCA6IHRoaXMuX3NvdXJjZXMuYXQobWFwcGluZy5zb3VyY2UpO1xuICAgICAgc291cmNlID0gdXRpbC5jb21wdXRlU291cmNlVVJMKHNvdXJjZVJvb3QsIHNvdXJjZSwgdGhpcy5fc291cmNlTWFwVVJMKTtcbiAgICAgIHJldHVybiB7XG4gICAgICAgIHNvdXJjZTogc291cmNlLFxuICAgICAgICBnZW5lcmF0ZWRMaW5lOiBtYXBwaW5nLmdlbmVyYXRlZExpbmUsXG4gICAgICAgIGdlbmVyYXRlZENvbHVtbjogbWFwcGluZy5nZW5lcmF0ZWRDb2x1bW4sXG4gICAgICAgIG9yaWdpbmFsTGluZTogbWFwcGluZy5vcmlnaW5hbExpbmUsXG4gICAgICAgIG9yaWdpbmFsQ29sdW1uOiBtYXBwaW5nLm9yaWdpbmFsQ29sdW1uLFxuICAgICAgICBuYW1lOiBtYXBwaW5nLm5hbWUgPT09IG51bGwgPyBudWxsIDogdGhpcy5fbmFtZXMuYXQobWFwcGluZy5uYW1lKVxuICAgICAgfTtcbiAgICB9LCB0aGlzKS5mb3JFYWNoKGFDYWxsYmFjaywgY29udGV4dCk7XG4gIH07XG5cbi8qKlxuICogUmV0dXJucyBhbGwgZ2VuZXJhdGVkIGxpbmUgYW5kIGNvbHVtbiBpbmZvcm1hdGlvbiBmb3IgdGhlIG9yaWdpbmFsIHNvdXJjZSxcbiAqIGxpbmUsIGFuZCBjb2x1bW4gcHJvdmlkZWQuIElmIG5vIGNvbHVtbiBpcyBwcm92aWRlZCwgcmV0dXJucyBhbGwgbWFwcGluZ3NcbiAqIGNvcnJlc3BvbmRpbmcgdG8gYSBlaXRoZXIgdGhlIGxpbmUgd2UgYXJlIHNlYXJjaGluZyBmb3Igb3IgdGhlIG5leHRcbiAqIGNsb3Nlc3QgbGluZSB0aGF0IGhhcyBhbnkgbWFwcGluZ3MuIE90aGVyd2lzZSwgcmV0dXJucyBhbGwgbWFwcGluZ3NcbiAqIGNvcnJlc3BvbmRpbmcgdG8gdGhlIGdpdmVuIGxpbmUgYW5kIGVpdGhlciB0aGUgY29sdW1uIHdlIGFyZSBzZWFyY2hpbmcgZm9yXG4gKiBvciB0aGUgbmV4dCBjbG9zZXN0IGNvbHVtbiB0aGF0IGhhcyBhbnkgb2Zmc2V0cy5cbiAqXG4gKiBUaGUgb25seSBhcmd1bWVudCBpcyBhbiBvYmplY3Qgd2l0aCB0aGUgZm9sbG93aW5nIHByb3BlcnRpZXM6XG4gKlxuICogICAtIHNvdXJjZTogVGhlIGZpbGVuYW1lIG9mIHRoZSBvcmlnaW5hbCBzb3VyY2UuXG4gKiAgIC0gbGluZTogVGhlIGxpbmUgbnVtYmVyIGluIHRoZSBvcmlnaW5hbCBzb3VyY2UuICBUaGUgbGluZSBudW1iZXIgaXMgMS1iYXNlZC5cbiAqICAgLSBjb2x1bW46IE9wdGlvbmFsLiB0aGUgY29sdW1uIG51bWJlciBpbiB0aGUgb3JpZ2luYWwgc291cmNlLlxuICogICAgVGhlIGNvbHVtbiBudW1iZXIgaXMgMC1iYXNlZC5cbiAqXG4gKiBhbmQgYW4gYXJyYXkgb2Ygb2JqZWN0cyBpcyByZXR1cm5lZCwgZWFjaCB3aXRoIHRoZSBmb2xsb3dpbmcgcHJvcGVydGllczpcbiAqXG4gKiAgIC0gbGluZTogVGhlIGxpbmUgbnVtYmVyIGluIHRoZSBnZW5lcmF0ZWQgc291cmNlLCBvciBudWxsLiAgVGhlXG4gKiAgICBsaW5lIG51bWJlciBpcyAxLWJhc2VkLlxuICogICAtIGNvbHVtbjogVGhlIGNvbHVtbiBudW1iZXIgaW4gdGhlIGdlbmVyYXRlZCBzb3VyY2UsIG9yIG51bGwuXG4gKiAgICBUaGUgY29sdW1uIG51bWJlciBpcyAwLWJhc2VkLlxuICovXG5Tb3VyY2VNYXBDb25zdW1lci5wcm90b3R5cGUuYWxsR2VuZXJhdGVkUG9zaXRpb25zRm9yID1cbiAgZnVuY3Rpb24gU291cmNlTWFwQ29uc3VtZXJfYWxsR2VuZXJhdGVkUG9zaXRpb25zRm9yKGFBcmdzKSB7XG4gICAgdmFyIGxpbmUgPSB1dGlsLmdldEFyZyhhQXJncywgJ2xpbmUnKTtcblxuICAgIC8vIFdoZW4gdGhlcmUgaXMgbm8gZXhhY3QgbWF0Y2gsIEJhc2ljU291cmNlTWFwQ29uc3VtZXIucHJvdG90eXBlLl9maW5kTWFwcGluZ1xuICAgIC8vIHJldHVybnMgdGhlIGluZGV4IG9mIHRoZSBjbG9zZXN0IG1hcHBpbmcgbGVzcyB0aGFuIHRoZSBuZWVkbGUuIEJ5XG4gICAgLy8gc2V0dGluZyBuZWVkbGUub3JpZ2luYWxDb2x1bW4gdG8gMCwgd2UgdGh1cyBmaW5kIHRoZSBsYXN0IG1hcHBpbmcgZm9yXG4gICAgLy8gdGhlIGdpdmVuIGxpbmUsIHByb3ZpZGVkIHN1Y2ggYSBtYXBwaW5nIGV4aXN0cy5cbiAgICB2YXIgbmVlZGxlID0ge1xuICAgICAgc291cmNlOiB1dGlsLmdldEFyZyhhQXJncywgJ3NvdXJjZScpLFxuICAgICAgb3JpZ2luYWxMaW5lOiBsaW5lLFxuICAgICAgb3JpZ2luYWxDb2x1bW46IHV0aWwuZ2V0QXJnKGFBcmdzLCAnY29sdW1uJywgMClcbiAgICB9O1xuXG4gICAgbmVlZGxlLnNvdXJjZSA9IHRoaXMuX2ZpbmRTb3VyY2VJbmRleChuZWVkbGUuc291cmNlKTtcbiAgICBpZiAobmVlZGxlLnNvdXJjZSA8IDApIHtcbiAgICAgIHJldHVybiBbXTtcbiAgICB9XG5cbiAgICB2YXIgbWFwcGluZ3MgPSBbXTtcblxuICAgIHZhciBpbmRleCA9IHRoaXMuX2ZpbmRNYXBwaW5nKG5lZWRsZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLl9vcmlnaW5hbE1hcHBpbmdzLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwib3JpZ2luYWxMaW5lXCIsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXCJvcmlnaW5hbENvbHVtblwiLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHV0aWwuY29tcGFyZUJ5T3JpZ2luYWxQb3NpdGlvbnMsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYmluYXJ5U2VhcmNoLkxFQVNUX1VQUEVSX0JPVU5EKTtcbiAgICBpZiAoaW5kZXggPj0gMCkge1xuICAgICAgdmFyIG1hcHBpbmcgPSB0aGlzLl9vcmlnaW5hbE1hcHBpbmdzW2luZGV4XTtcblxuICAgICAgaWYgKGFBcmdzLmNvbHVtbiA9PT0gdW5kZWZpbmVkKSB7XG4gICAgICAgIHZhciBvcmlnaW5hbExpbmUgPSBtYXBwaW5nLm9yaWdpbmFsTGluZTtcblxuICAgICAgICAvLyBJdGVyYXRlIHVudGlsIGVpdGhlciB3ZSBydW4gb3V0IG9mIG1hcHBpbmdzLCBvciB3ZSBydW4gaW50b1xuICAgICAgICAvLyBhIG1hcHBpbmcgZm9yIGEgZGlmZmVyZW50IGxpbmUgdGhhbiB0aGUgb25lIHdlIGZvdW5kLiBTaW5jZVxuICAgICAgICAvLyBtYXBwaW5ncyBhcmUgc29ydGVkLCB0aGlzIGlzIGd1YXJhbnRlZWQgdG8gZmluZCBhbGwgbWFwcGluZ3MgZm9yXG4gICAgICAgIC8vIHRoZSBsaW5lIHdlIGZvdW5kLlxuICAgICAgICB3aGlsZSAobWFwcGluZyAmJiBtYXBwaW5nLm9yaWdpbmFsTGluZSA9PT0gb3JpZ2luYWxMaW5lKSB7XG4gICAgICAgICAgbWFwcGluZ3MucHVzaCh7XG4gICAgICAgICAgICBsaW5lOiB1dGlsLmdldEFyZyhtYXBwaW5nLCAnZ2VuZXJhdGVkTGluZScsIG51bGwpLFxuICAgICAgICAgICAgY29sdW1uOiB1dGlsLmdldEFyZyhtYXBwaW5nLCAnZ2VuZXJhdGVkQ29sdW1uJywgbnVsbCksXG4gICAgICAgICAgICBsYXN0Q29sdW1uOiB1dGlsLmdldEFyZyhtYXBwaW5nLCAnbGFzdEdlbmVyYXRlZENvbHVtbicsIG51bGwpXG4gICAgICAgICAgfSk7XG5cbiAgICAgICAgICBtYXBwaW5nID0gdGhpcy5fb3JpZ2luYWxNYXBwaW5nc1srK2luZGV4XTtcbiAgICAgICAgfVxuICAgICAgfSBlbHNlIHtcbiAgICAgICAgdmFyIG9yaWdpbmFsQ29sdW1uID0gbWFwcGluZy5vcmlnaW5hbENvbHVtbjtcblxuICAgICAgICAvLyBJdGVyYXRlIHVudGlsIGVpdGhlciB3ZSBydW4gb3V0IG9mIG1hcHBpbmdzLCBvciB3ZSBydW4gaW50b1xuICAgICAgICAvLyBhIG1hcHBpbmcgZm9yIGEgZGlmZmVyZW50IGxpbmUgdGhhbiB0aGUgb25lIHdlIHdlcmUgc2VhcmNoaW5nIGZvci5cbiAgICAgICAgLy8gU2luY2UgbWFwcGluZ3MgYXJlIHNvcnRlZCwgdGhpcyBpcyBndWFyYW50ZWVkIHRvIGZpbmQgYWxsIG1hcHBpbmdzIGZvclxuICAgICAgICAvLyB0aGUgbGluZSB3ZSBhcmUgc2VhcmNoaW5nIGZvci5cbiAgICAgICAgd2hpbGUgKG1hcHBpbmcgJiZcbiAgICAgICAgICAgICAgIG1hcHBpbmcub3JpZ2luYWxMaW5lID09PSBsaW5lICYmXG4gICAgICAgICAgICAgICBtYXBwaW5nLm9yaWdpbmFsQ29sdW1uID09IG9yaWdpbmFsQ29sdW1uKSB7XG4gICAgICAgICAgbWFwcGluZ3MucHVzaCh7XG4gICAgICAgICAgICBsaW5lOiB1dGlsLmdldEFyZyhtYXBwaW5nLCAnZ2VuZXJhdGVkTGluZScsIG51bGwpLFxuICAgICAgICAgICAgY29sdW1uOiB1dGlsLmdldEFyZyhtYXBwaW5nLCAnZ2VuZXJhdGVkQ29sdW1uJywgbnVsbCksXG4gICAgICAgICAgICBsYXN0Q29sdW1uOiB1dGlsLmdldEFyZyhtYXBwaW5nLCAnbGFzdEdlbmVyYXRlZENvbHVtbicsIG51bGwpXG4gICAgICAgICAgfSk7XG5cbiAgICAgICAgICBtYXBwaW5nID0gdGhpcy5fb3JpZ2luYWxNYXBwaW5nc1srK2luZGV4XTtcbiAgICAgICAgfVxuICAgICAgfVxuICAgIH1cblxuICAgIHJldHVybiBtYXBwaW5ncztcbiAgfTtcblxuZXhwb3J0cy5Tb3VyY2VNYXBDb25zdW1lciA9IFNvdXJjZU1hcENvbnN1bWVyO1xuXG4vKipcbiAqIEEgQmFzaWNTb3VyY2VNYXBDb25zdW1lciBpbnN0YW5jZSByZXByZXNlbnRzIGEgcGFyc2VkIHNvdXJjZSBtYXAgd2hpY2ggd2UgY2FuXG4gKiBxdWVyeSBmb3IgaW5mb3JtYXRpb24gYWJvdXQgdGhlIG9yaWdpbmFsIGZpbGUgcG9zaXRpb25zIGJ5IGdpdmluZyBpdCBhIGZpbGVcbiAqIHBvc2l0aW9uIGluIHRoZSBnZW5lcmF0ZWQgc291cmNlLlxuICpcbiAqIFRoZSBmaXJzdCBwYXJhbWV0ZXIgaXMgdGhlIHJhdyBzb3VyY2UgbWFwIChlaXRoZXIgYXMgYSBKU09OIHN0cmluZywgb3JcbiAqIGFscmVhZHkgcGFyc2VkIHRvIGFuIG9iamVjdCkuIEFjY29yZGluZyB0byB0aGUgc3BlYywgc291cmNlIG1hcHMgaGF2ZSB0aGVcbiAqIGZvbGxvd2luZyBhdHRyaWJ1dGVzOlxuICpcbiAqICAgLSB2ZXJzaW9uOiBXaGljaCB2ZXJzaW9uIG9mIHRoZSBzb3VyY2UgbWFwIHNwZWMgdGhpcyBtYXAgaXMgZm9sbG93aW5nLlxuICogICAtIHNvdXJjZXM6IEFuIGFycmF5IG9mIFVSTHMgdG8gdGhlIG9yaWdpbmFsIHNvdXJjZSBmaWxlcy5cbiAqICAgLSBuYW1lczogQW4gYXJyYXkgb2YgaWRlbnRpZmllcnMgd2hpY2ggY2FuIGJlIHJlZmVycmVuY2VkIGJ5IGluZGl2aWR1YWwgbWFwcGluZ3MuXG4gKiAgIC0gc291cmNlUm9vdDogT3B0aW9uYWwuIFRoZSBVUkwgcm9vdCBmcm9tIHdoaWNoIGFsbCBzb3VyY2VzIGFyZSByZWxhdGl2ZS5cbiAqICAgLSBzb3VyY2VzQ29udGVudDogT3B0aW9uYWwuIEFuIGFycmF5IG9mIGNvbnRlbnRzIG9mIHRoZSBvcmlnaW5hbCBzb3VyY2UgZmlsZXMuXG4gKiAgIC0gbWFwcGluZ3M6IEEgc3RyaW5nIG9mIGJhc2U2NCBWTFFzIHdoaWNoIGNvbnRhaW4gdGhlIGFjdHVhbCBtYXBwaW5ncy5cbiAqICAgLSBmaWxlOiBPcHRpb25hbC4gVGhlIGdlbmVyYXRlZCBmaWxlIHRoaXMgc291cmNlIG1hcCBpcyBhc3NvY2lhdGVkIHdpdGguXG4gKlxuICogSGVyZSBpcyBhbiBleGFtcGxlIHNvdXJjZSBtYXAsIHRha2VuIGZyb20gdGhlIHNvdXJjZSBtYXAgc3BlY1swXTpcbiAqXG4gKiAgICAge1xuICogICAgICAgdmVyc2lvbiA6IDMsXG4gKiAgICAgICBmaWxlOiBcIm91dC5qc1wiLFxuICogICAgICAgc291cmNlUm9vdCA6IFwiXCIsXG4gKiAgICAgICBzb3VyY2VzOiBbXCJmb28uanNcIiwgXCJiYXIuanNcIl0sXG4gKiAgICAgICBuYW1lczogW1wic3JjXCIsIFwibWFwc1wiLCBcImFyZVwiLCBcImZ1blwiXSxcbiAqICAgICAgIG1hcHBpbmdzOiBcIkFBLEFCOztBQkNERTtcIlxuICogICAgIH1cbiAqXG4gKiBUaGUgc2Vjb25kIHBhcmFtZXRlciwgaWYgZ2l2ZW4sIGlzIGEgc3RyaW5nIHdob3NlIHZhbHVlIGlzIHRoZSBVUkxcbiAqIGF0IHdoaWNoIHRoZSBzb3VyY2UgbWFwIHdhcyBmb3VuZC4gIFRoaXMgVVJMIGlzIHVzZWQgdG8gY29tcHV0ZSB0aGVcbiAqIHNvdXJjZXMgYXJyYXkuXG4gKlxuICogWzBdOiBodHRwczovL2RvY3MuZ29vZ2xlLmNvbS9kb2N1bWVudC9kLzFVMVJHQWVoUXdSeXBVVG92RjFLUmxwaU9GemUwYi1fMmdjNmZBSDBLWTBrL2VkaXQ/cGxpPTEjXG4gKi9cbmZ1bmN0aW9uIEJhc2ljU291cmNlTWFwQ29uc3VtZXIoYVNvdXJjZU1hcCwgYVNvdXJjZU1hcFVSTCkge1xuICB2YXIgc291cmNlTWFwID0gYVNvdXJjZU1hcDtcbiAgaWYgKHR5cGVvZiBhU291cmNlTWFwID09PSAnc3RyaW5nJykge1xuICAgIHNvdXJjZU1hcCA9IHV0aWwucGFyc2VTb3VyY2VNYXBJbnB1dChhU291cmNlTWFwKTtcbiAgfVxuXG4gIHZhciB2ZXJzaW9uID0gdXRpbC5nZXRBcmcoc291cmNlTWFwLCAndmVyc2lvbicpO1xuICB2YXIgc291cmNlcyA9IHV0aWwuZ2V0QXJnKHNvdXJjZU1hcCwgJ3NvdXJjZXMnKTtcbiAgLy8gU2FzcyAzLjMgbGVhdmVzIG91dCB0aGUgJ25hbWVzJyBhcnJheSwgc28gd2UgZGV2aWF0ZSBmcm9tIHRoZSBzcGVjICh3aGljaFxuICAvLyByZXF1aXJlcyB0aGUgYXJyYXkpIHRvIHBsYXkgbmljZSBoZXJlLlxuICB2YXIgbmFtZXMgPSB1dGlsLmdldEFyZyhzb3VyY2VNYXAsICduYW1lcycsIFtdKTtcbiAgdmFyIHNvdXJjZVJvb3QgPSB1dGlsLmdldEFyZyhzb3VyY2VNYXAsICdzb3VyY2VSb290JywgbnVsbCk7XG4gIHZhciBzb3VyY2VzQ29udGVudCA9IHV0aWwuZ2V0QXJnKHNvdXJjZU1hcCwgJ3NvdXJjZXNDb250ZW50JywgbnVsbCk7XG4gIHZhciBtYXBwaW5ncyA9IHV0aWwuZ2V0QXJnKHNvdXJjZU1hcCwgJ21hcHBpbmdzJyk7XG4gIHZhciBmaWxlID0gdXRpbC5nZXRBcmcoc291cmNlTWFwLCAnZmlsZScsIG51bGwpO1xuXG4gIC8vIE9uY2UgYWdhaW4sIFNhc3MgZGV2aWF0ZXMgZnJvbSB0aGUgc3BlYyBhbmQgc3VwcGxpZXMgdGhlIHZlcnNpb24gYXMgYVxuICAvLyBzdHJpbmcgcmF0aGVyIHRoYW4gYSBudW1iZXIsIHNvIHdlIHVzZSBsb29zZSBlcXVhbGl0eSBjaGVja2luZyBoZXJlLlxuICBpZiAodmVyc2lvbiAhPSB0aGlzLl92ZXJzaW9uKSB7XG4gICAgdGhyb3cgbmV3IEVycm9yKCdVbnN1cHBvcnRlZCB2ZXJzaW9uOiAnICsgdmVyc2lvbik7XG4gIH1cblxuICBpZiAoc291cmNlUm9vdCkge1xuICAgIHNvdXJjZVJvb3QgPSB1dGlsLm5vcm1hbGl6ZShzb3VyY2VSb290KTtcbiAgfVxuXG4gIHNvdXJjZXMgPSBzb3VyY2VzXG4gICAgLm1hcChTdHJpbmcpXG4gICAgLy8gU29tZSBzb3VyY2UgbWFwcyBwcm9kdWNlIHJlbGF0aXZlIHNvdXJjZSBwYXRocyBsaWtlIFwiLi9mb28uanNcIiBpbnN0ZWFkIG9mXG4gICAgLy8gXCJmb28uanNcIi4gIE5vcm1hbGl6ZSB0aGVzZSBmaXJzdCBzbyB0aGF0IGZ1dHVyZSBjb21wYXJpc29ucyB3aWxsIHN1Y2NlZWQuXG4gICAgLy8gU2VlIGJ1Z3ppbC5sYS8xMDkwNzY4LlxuICAgIC5tYXAodXRpbC5ub3JtYWxpemUpXG4gICAgLy8gQWx3YXlzIGVuc3VyZSB0aGF0IGFic29sdXRlIHNvdXJjZXMgYXJlIGludGVybmFsbHkgc3RvcmVkIHJlbGF0aXZlIHRvXG4gICAgLy8gdGhlIHNvdXJjZSByb290LCBpZiB0aGUgc291cmNlIHJvb3QgaXMgYWJzb2x1dGUuIE5vdCBkb2luZyB0aGlzIHdvdWxkXG4gICAgLy8gYmUgcGFydGljdWxhcmx5IHByb2JsZW1hdGljIHdoZW4gdGhlIHNvdXJjZSByb290IGlzIGEgcHJlZml4IG9mIHRoZVxuICAgIC8vIHNvdXJjZSAodmFsaWQsIGJ1dCB3aHk/PykuIFNlZSBnaXRodWIgaXNzdWUgIzE5OSBhbmQgYnVnemlsLmxhLzExODg5ODIuXG4gICAgLm1hcChmdW5jdGlvbiAoc291cmNlKSB7XG4gICAgICByZXR1cm4gc291cmNlUm9vdCAmJiB1dGlsLmlzQWJzb2x1dGUoc291cmNlUm9vdCkgJiYgdXRpbC5pc0Fic29sdXRlKHNvdXJjZSlcbiAgICAgICAgPyB1dGlsLnJlbGF0aXZlKHNvdXJjZVJvb3QsIHNvdXJjZSlcbiAgICAgICAgOiBzb3VyY2U7XG4gICAgfSk7XG5cbiAgLy8gUGFzcyBgdHJ1ZWAgYmVsb3cgdG8gYWxsb3cgZHVwbGljYXRlIG5hbWVzIGFuZCBzb3VyY2VzLiBXaGlsZSBzb3VyY2UgbWFwc1xuICAvLyBhcmUgaW50ZW5kZWQgdG8gYmUgY29tcHJlc3NlZCBhbmQgZGVkdXBsaWNhdGVkLCB0aGUgVHlwZVNjcmlwdCBjb21waWxlclxuICAvLyBzb21ldGltZXMgZ2VuZXJhdGVzIHNvdXJjZSBtYXBzIHdpdGggZHVwbGljYXRlcyBpbiB0aGVtLiBTZWUgR2l0aHViIGlzc3VlXG4gIC8vICM3MiBhbmQgYnVnemlsLmxhLzg4OTQ5Mi5cbiAgdGhpcy5fbmFtZXMgPSBBcnJheVNldC5mcm9tQXJyYXkobmFtZXMubWFwKFN0cmluZyksIHRydWUpO1xuICB0aGlzLl9zb3VyY2VzID0gQXJyYXlTZXQuZnJvbUFycmF5KHNvdXJjZXMsIHRydWUpO1xuXG4gIHRoaXMuX2Fic29sdXRlU291cmNlcyA9IHRoaXMuX3NvdXJjZXMudG9BcnJheSgpLm1hcChmdW5jdGlvbiAocykge1xuICAgIHJldHVybiB1dGlsLmNvbXB1dGVTb3VyY2VVUkwoc291cmNlUm9vdCwgcywgYVNvdXJjZU1hcFVSTCk7XG4gIH0pO1xuXG4gIHRoaXMuc291cmNlUm9vdCA9IHNvdXJjZVJvb3Q7XG4gIHRoaXMuc291cmNlc0NvbnRlbnQgPSBzb3VyY2VzQ29udGVudDtcbiAgdGhpcy5fbWFwcGluZ3MgPSBtYXBwaW5ncztcbiAgdGhpcy5fc291cmNlTWFwVVJMID0gYVNvdXJjZU1hcFVSTDtcbiAgdGhpcy5maWxlID0gZmlsZTtcbn1cblxuQmFzaWNTb3VyY2VNYXBDb25zdW1lci5wcm90b3R5cGUgPSBPYmplY3QuY3JlYXRlKFNvdXJjZU1hcENvbnN1bWVyLnByb3RvdHlwZSk7XG5CYXNpY1NvdXJjZU1hcENvbnN1bWVyLnByb3RvdHlwZS5jb25zdW1lciA9IFNvdXJjZU1hcENvbnN1bWVyO1xuXG4vKipcbiAqIFV0aWxpdHkgZnVuY3Rpb24gdG8gZmluZCB0aGUgaW5kZXggb2YgYSBzb3VyY2UuICBSZXR1cm5zIC0xIGlmIG5vdFxuICogZm91bmQuXG4gKi9cbkJhc2ljU291cmNlTWFwQ29uc3VtZXIucHJvdG90eXBlLl9maW5kU291cmNlSW5kZXggPSBmdW5jdGlvbihhU291cmNlKSB7XG4gIHZhciByZWxhdGl2ZVNvdXJjZSA9IGFTb3VyY2U7XG4gIGlmICh0aGlzLnNvdXJjZVJvb3QgIT0gbnVsbCkge1xuICAgIHJlbGF0aXZlU291cmNlID0gdXRpbC5yZWxhdGl2ZSh0aGlzLnNvdXJjZVJvb3QsIHJlbGF0aXZlU291cmNlKTtcbiAgfVxuXG4gIGlmICh0aGlzLl9zb3VyY2VzLmhhcyhyZWxhdGl2ZVNvdXJjZSkpIHtcbiAgICByZXR1cm4gdGhpcy5fc291cmNlcy5pbmRleE9mKHJlbGF0aXZlU291cmNlKTtcbiAgfVxuXG4gIC8vIE1heWJlIGFTb3VyY2UgaXMgYW4gYWJzb2x1dGUgVVJMIGFzIHJldHVybmVkIGJ5IHxzb3VyY2VzfC4gIEluXG4gIC8vIHRoaXMgY2FzZSB3ZSBjYW4ndCBzaW1wbHkgdW5kbyB0aGUgdHJhbnNmb3JtLlxuICB2YXIgaTtcbiAgZm9yIChpID0gMDsgaSA8IHRoaXMuX2Fic29sdXRlU291cmNlcy5sZW5ndGg7ICsraSkge1xuICAgIGlmICh0aGlzLl9hYnNvbHV0ZVNvdXJjZXNbaV0gPT0gYVNvdXJjZSkge1xuICAgICAgcmV0dXJuIGk7XG4gICAgfVxuICB9XG5cbiAgcmV0dXJuIC0xO1xufTtcblxuLyoqXG4gKiBDcmVhdGUgYSBCYXNpY1NvdXJjZU1hcENvbnN1bWVyIGZyb20gYSBTb3VyY2VNYXBHZW5lcmF0b3IuXG4gKlxuICogQHBhcmFtIFNvdXJjZU1hcEdlbmVyYXRvciBhU291cmNlTWFwXG4gKiAgICAgICAgVGhlIHNvdXJjZSBtYXAgdGhhdCB3aWxsIGJlIGNvbnN1bWVkLlxuICogQHBhcmFtIFN0cmluZyBhU291cmNlTWFwVVJMXG4gKiAgICAgICAgVGhlIFVSTCBhdCB3aGljaCB0aGUgc291cmNlIG1hcCBjYW4gYmUgZm91bmQgKG9wdGlvbmFsKVxuICogQHJldHVybnMgQmFzaWNTb3VyY2VNYXBDb25zdW1lclxuICovXG5CYXNpY1NvdXJjZU1hcENvbnN1bWVyLmZyb21Tb3VyY2VNYXAgPVxuICBmdW5jdGlvbiBTb3VyY2VNYXBDb25zdW1lcl9mcm9tU291cmNlTWFwKGFTb3VyY2VNYXAsIGFTb3VyY2VNYXBVUkwpIHtcbiAgICB2YXIgc21jID0gT2JqZWN0LmNyZWF0ZShCYXNpY1NvdXJjZU1hcENvbnN1bWVyLnByb3RvdHlwZSk7XG5cbiAgICB2YXIgbmFtZXMgPSBzbWMuX25hbWVzID0gQXJyYXlTZXQuZnJvbUFycmF5KGFTb3VyY2VNYXAuX25hbWVzLnRvQXJyYXkoKSwgdHJ1ZSk7XG4gICAgdmFyIHNvdXJjZXMgPSBzbWMuX3NvdXJjZXMgPSBBcnJheVNldC5mcm9tQXJyYXkoYVNvdXJjZU1hcC5fc291cmNlcy50b0FycmF5KCksIHRydWUpO1xuICAgIHNtYy5zb3VyY2VSb290ID0gYVNvdXJjZU1hcC5fc291cmNlUm9vdDtcbiAgICBzbWMuc291cmNlc0NvbnRlbnQgPSBhU291cmNlTWFwLl9nZW5lcmF0ZVNvdXJjZXNDb250ZW50KHNtYy5fc291cmNlcy50b0FycmF5KCksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzbWMuc291cmNlUm9vdCk7XG4gICAgc21jLmZpbGUgPSBhU291cmNlTWFwLl9maWxlO1xuICAgIHNtYy5fc291cmNlTWFwVVJMID0gYVNvdXJjZU1hcFVSTDtcbiAgICBzbWMuX2Fic29sdXRlU291cmNlcyA9IHNtYy5fc291cmNlcy50b0FycmF5KCkubWFwKGZ1bmN0aW9uIChzKSB7XG4gICAgICByZXR1cm4gdXRpbC5jb21wdXRlU291cmNlVVJMKHNtYy5zb3VyY2VSb290LCBzLCBhU291cmNlTWFwVVJMKTtcbiAgICB9KTtcblxuICAgIC8vIEJlY2F1c2Ugd2UgYXJlIG1vZGlmeWluZyB0aGUgZW50cmllcyAoYnkgY29udmVydGluZyBzdHJpbmcgc291cmNlcyBhbmRcbiAgICAvLyBuYW1lcyB0byBpbmRpY2VzIGludG8gdGhlIHNvdXJjZXMgYW5kIG5hbWVzIEFycmF5U2V0cyksIHdlIGhhdmUgdG8gbWFrZVxuICAgIC8vIGEgY29weSBvZiB0aGUgZW50cnkgb3IgZWxzZSBiYWQgdGhpbmdzIGhhcHBlbi4gU2hhcmVkIG11dGFibGUgc3RhdGVcbiAgICAvLyBzdHJpa2VzIGFnYWluISBTZWUgZ2l0aHViIGlzc3VlICMxOTEuXG5cbiAgICB2YXIgZ2VuZXJhdGVkTWFwcGluZ3MgPSBhU291cmNlTWFwLl9tYXBwaW5ncy50b0FycmF5KCkuc2xpY2UoKTtcbiAgICB2YXIgZGVzdEdlbmVyYXRlZE1hcHBpbmdzID0gc21jLl9fZ2VuZXJhdGVkTWFwcGluZ3MgPSBbXTtcbiAgICB2YXIgZGVzdE9yaWdpbmFsTWFwcGluZ3MgPSBzbWMuX19vcmlnaW5hbE1hcHBpbmdzID0gW107XG5cbiAgICBmb3IgKHZhciBpID0gMCwgbGVuZ3RoID0gZ2VuZXJhdGVkTWFwcGluZ3MubGVuZ3RoOyBpIDwgbGVuZ3RoOyBpKyspIHtcbiAgICAgIHZhciBzcmNNYXBwaW5nID0gZ2VuZXJhdGVkTWFwcGluZ3NbaV07XG4gICAgICB2YXIgZGVzdE1hcHBpbmcgPSBuZXcgTWFwcGluZztcbiAgICAgIGRlc3RNYXBwaW5nLmdlbmVyYXRlZExpbmUgPSBzcmNNYXBwaW5nLmdlbmVyYXRlZExpbmU7XG4gICAgICBkZXN0TWFwcGluZy5nZW5lcmF0ZWRDb2x1bW4gPSBzcmNNYXBwaW5nLmdlbmVyYXRlZENvbHVtbjtcblxuICAgICAgaWYgKHNyY01hcHBpbmcuc291cmNlKSB7XG4gICAgICAgIGRlc3RNYXBwaW5nLnNvdXJjZSA9IHNvdXJjZXMuaW5kZXhPZihzcmNNYXBwaW5nLnNvdXJjZSk7XG4gICAgICAgIGRlc3RNYXBwaW5nLm9yaWdpbmFsTGluZSA9IHNyY01hcHBpbmcub3JpZ2luYWxMaW5lO1xuICAgICAgICBkZXN0TWFwcGluZy5vcmlnaW5hbENvbHVtbiA9IHNyY01hcHBpbmcub3JpZ2luYWxDb2x1bW47XG5cbiAgICAgICAgaWYgKHNyY01hcHBpbmcubmFtZSkge1xuICAgICAgICAgIGRlc3RNYXBwaW5nLm5hbWUgPSBuYW1lcy5pbmRleE9mKHNyY01hcHBpbmcubmFtZSk7XG4gICAgICAgIH1cblxuICAgICAgICBkZXN0T3JpZ2luYWxNYXBwaW5ncy5wdXNoKGRlc3RNYXBwaW5nKTtcbiAgICAgIH1cblxuICAgICAgZGVzdEdlbmVyYXRlZE1hcHBpbmdzLnB1c2goZGVzdE1hcHBpbmcpO1xuICAgIH1cblxuICAgIHF1aWNrU29ydChzbWMuX19vcmlnaW5hbE1hcHBpbmdzLCB1dGlsLmNvbXBhcmVCeU9yaWdpbmFsUG9zaXRpb25zKTtcblxuICAgIHJldHVybiBzbWM7XG4gIH07XG5cbi8qKlxuICogVGhlIHZlcnNpb24gb2YgdGhlIHNvdXJjZSBtYXBwaW5nIHNwZWMgdGhhdCB3ZSBhcmUgY29uc3VtaW5nLlxuICovXG5CYXNpY1NvdXJjZU1hcENvbnN1bWVyLnByb3RvdHlwZS5fdmVyc2lvbiA9IDM7XG5cbi8qKlxuICogVGhlIGxpc3Qgb2Ygb3JpZ2luYWwgc291cmNlcy5cbiAqL1xuT2JqZWN0LmRlZmluZVByb3BlcnR5KEJhc2ljU291cmNlTWFwQ29uc3VtZXIucHJvdG90eXBlLCAnc291cmNlcycsIHtcbiAgZ2V0OiBmdW5jdGlvbiAoKSB7XG4gICAgcmV0dXJuIHRoaXMuX2Fic29sdXRlU291cmNlcy5zbGljZSgpO1xuICB9XG59KTtcblxuLyoqXG4gKiBQcm92aWRlIHRoZSBKSVQgd2l0aCBhIG5pY2Ugc2hhcGUgLyBoaWRkZW4gY2xhc3MuXG4gKi9cbmZ1bmN0aW9uIE1hcHBpbmcoKSB7XG4gIHRoaXMuZ2VuZXJhdGVkTGluZSA9IDA7XG4gIHRoaXMuZ2VuZXJhdGVkQ29sdW1uID0gMDtcbiAgdGhpcy5zb3VyY2UgPSBudWxsO1xuICB0aGlzLm9yaWdpbmFsTGluZSA9IG51bGw7XG4gIHRoaXMub3JpZ2luYWxDb2x1bW4gPSBudWxsO1xuICB0aGlzLm5hbWUgPSBudWxsO1xufVxuXG4vKipcbiAqIFBhcnNlIHRoZSBtYXBwaW5ncyBpbiBhIHN0cmluZyBpbiB0byBhIGRhdGEgc3RydWN0dXJlIHdoaWNoIHdlIGNhbiBlYXNpbHlcbiAqIHF1ZXJ5ICh0aGUgb3JkZXJlZCBhcnJheXMgaW4gdGhlIGB0aGlzLl9fZ2VuZXJhdGVkTWFwcGluZ3NgIGFuZFxuICogYHRoaXMuX19vcmlnaW5hbE1hcHBpbmdzYCBwcm9wZXJ0aWVzKS5cbiAqL1xuQmFzaWNTb3VyY2VNYXBDb25zdW1lci5wcm90b3R5cGUuX3BhcnNlTWFwcGluZ3MgPVxuICBmdW5jdGlvbiBTb3VyY2VNYXBDb25zdW1lcl9wYXJzZU1hcHBpbmdzKGFTdHIsIGFTb3VyY2VSb290KSB7XG4gICAgdmFyIGdlbmVyYXRlZExpbmUgPSAxO1xuICAgIHZhciBwcmV2aW91c0dlbmVyYXRlZENvbHVtbiA9IDA7XG4gICAgdmFyIHByZXZpb3VzT3JpZ2luYWxMaW5lID0gMDtcbiAgICB2YXIgcHJldmlvdXNPcmlnaW5hbENvbHVtbiA9IDA7XG4gICAgdmFyIHByZXZpb3VzU291cmNlID0gMDtcbiAgICB2YXIgcHJldmlvdXNOYW1lID0gMDtcbiAgICB2YXIgbGVuZ3RoID0gYVN0ci5sZW5ndGg7XG4gICAgdmFyIGluZGV4ID0gMDtcbiAgICB2YXIgY2FjaGVkU2VnbWVudHMgPSB7fTtcbiAgICB2YXIgdGVtcCA9IHt9O1xuICAgIHZhciBvcmlnaW5hbE1hcHBpbmdzID0gW107XG4gICAgdmFyIGdlbmVyYXRlZE1hcHBpbmdzID0gW107XG4gICAgdmFyIG1hcHBpbmcsIHN0ciwgc2VnbWVudCwgZW5kLCB2YWx1ZTtcblxuICAgIHdoaWxlIChpbmRleCA8IGxlbmd0aCkge1xuICAgICAgaWYgKGFTdHIuY2hhckF0KGluZGV4KSA9PT0gJzsnKSB7XG4gICAgICAgIGdlbmVyYXRlZExpbmUrKztcbiAgICAgICAgaW5kZXgrKztcbiAgICAgICAgcHJldmlvdXNHZW5lcmF0ZWRDb2x1bW4gPSAwO1xuICAgICAgfVxuICAgICAgZWxzZSBpZiAoYVN0ci5jaGFyQXQoaW5kZXgpID09PSAnLCcpIHtcbiAgICAgICAgaW5kZXgrKztcbiAgICAgIH1cbiAgICAgIGVsc2Uge1xuICAgICAgICBtYXBwaW5nID0gbmV3IE1hcHBpbmcoKTtcbiAgICAgICAgbWFwcGluZy5nZW5lcmF0ZWRMaW5lID0gZ2VuZXJhdGVkTGluZTtcblxuICAgICAgICAvLyBCZWNhdXNlIGVhY2ggb2Zmc2V0IGlzIGVuY29kZWQgcmVsYXRpdmUgdG8gdGhlIHByZXZpb3VzIG9uZSxcbiAgICAgICAgLy8gbWFueSBzZWdtZW50cyBvZnRlbiBoYXZlIHRoZSBzYW1lIGVuY29kaW5nLiBXZSBjYW4gZXhwbG9pdCB0aGlzXG4gICAgICAgIC8vIGZhY3QgYnkgY2FjaGluZyB0aGUgcGFyc2VkIHZhcmlhYmxlIGxlbmd0aCBmaWVsZHMgb2YgZWFjaCBzZWdtZW50LFxuICAgICAgICAvLyBhbGxvd2luZyB1cyB0byBhdm9pZCBhIHNlY29uZCBwYXJzZSBpZiB3ZSBlbmNvdW50ZXIgdGhlIHNhbWVcbiAgICAgICAgLy8gc2VnbWVudCBhZ2Fpbi5cbiAgICAgICAgZm9yIChlbmQgPSBpbmRleDsgZW5kIDwgbGVuZ3RoOyBlbmQrKykge1xuICAgICAgICAgIGlmICh0aGlzLl9jaGFySXNNYXBwaW5nU2VwYXJhdG9yKGFTdHIsIGVuZCkpIHtcbiAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBzdHIgPSBhU3RyLnNsaWNlKGluZGV4LCBlbmQpO1xuXG4gICAgICAgIHNlZ21lbnQgPSBjYWNoZWRTZWdtZW50c1tzdHJdO1xuICAgICAgICBpZiAoc2VnbWVudCkge1xuICAgICAgICAgIGluZGV4ICs9IHN0ci5sZW5ndGg7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgc2VnbWVudCA9IFtdO1xuICAgICAgICAgIHdoaWxlIChpbmRleCA8IGVuZCkge1xuICAgICAgICAgICAgYmFzZTY0VkxRLmRlY29kZShhU3RyLCBpbmRleCwgdGVtcCk7XG4gICAgICAgICAgICB2YWx1ZSA9IHRlbXAudmFsdWU7XG4gICAgICAgICAgICBpbmRleCA9IHRlbXAucmVzdDtcbiAgICAgICAgICAgIHNlZ21lbnQucHVzaCh2YWx1ZSk7XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgaWYgKHNlZ21lbnQubGVuZ3RoID09PSAyKSB7XG4gICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoJ0ZvdW5kIGEgc291cmNlLCBidXQgbm8gbGluZSBhbmQgY29sdW1uJyk7XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgaWYgKHNlZ21lbnQubGVuZ3RoID09PSAzKSB7XG4gICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoJ0ZvdW5kIGEgc291cmNlIGFuZCBsaW5lLCBidXQgbm8gY29sdW1uJyk7XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgY2FjaGVkU2VnbWVudHNbc3RyXSA9IHNlZ21lbnQ7XG4gICAgICAgIH1cblxuICAgICAgICAvLyBHZW5lcmF0ZWQgY29sdW1uLlxuICAgICAgICBtYXBwaW5nLmdlbmVyYXRlZENvbHVtbiA9IHByZXZpb3VzR2VuZXJhdGVkQ29sdW1uICsgc2VnbWVudFswXTtcbiAgICAgICAgcHJldmlvdXNHZW5lcmF0ZWRDb2x1bW4gPSBtYXBwaW5nLmdlbmVyYXRlZENvbHVtbjtcblxuICAgICAgICBpZiAoc2VnbWVudC5sZW5ndGggPiAxKSB7XG4gICAgICAgICAgLy8gT3JpZ2luYWwgc291cmNlLlxuICAgICAgICAgIG1hcHBpbmcuc291cmNlID0gcHJldmlvdXNTb3VyY2UgKyBzZWdtZW50WzFdO1xuICAgICAgICAgIHByZXZpb3VzU291cmNlICs9IHNlZ21lbnRbMV07XG5cbiAgICAgICAgICAvLyBPcmlnaW5hbCBsaW5lLlxuICAgICAgICAgIG1hcHBpbmcub3JpZ2luYWxMaW5lID0gcHJldmlvdXNPcmlnaW5hbExpbmUgKyBzZWdtZW50WzJdO1xuICAgICAgICAgIHByZXZpb3VzT3JpZ2luYWxMaW5lID0gbWFwcGluZy5vcmlnaW5hbExpbmU7XG4gICAgICAgICAgLy8gTGluZXMgYXJlIHN0b3JlZCAwLWJhc2VkXG4gICAgICAgICAgbWFwcGluZy5vcmlnaW5hbExpbmUgKz0gMTtcblxuICAgICAgICAgIC8vIE9yaWdpbmFsIGNvbHVtbi5cbiAgICAgICAgICBtYXBwaW5nLm9yaWdpbmFsQ29sdW1uID0gcHJldmlvdXNPcmlnaW5hbENvbHVtbiArIHNlZ21lbnRbM107XG4gICAgICAgICAgcHJldmlvdXNPcmlnaW5hbENvbHVtbiA9IG1hcHBpbmcub3JpZ2luYWxDb2x1bW47XG5cbiAgICAgICAgICBpZiAoc2VnbWVudC5sZW5ndGggPiA0KSB7XG4gICAgICAgICAgICAvLyBPcmlnaW5hbCBuYW1lLlxuICAgICAgICAgICAgbWFwcGluZy5uYW1lID0gcHJldmlvdXNOYW1lICsgc2VnbWVudFs0XTtcbiAgICAgICAgICAgIHByZXZpb3VzTmFtZSArPSBzZWdtZW50WzRdO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIGdlbmVyYXRlZE1hcHBpbmdzLnB1c2gobWFwcGluZyk7XG4gICAgICAgIGlmICh0eXBlb2YgbWFwcGluZy5vcmlnaW5hbExpbmUgPT09ICdudW1iZXInKSB7XG4gICAgICAgICAgb3JpZ2luYWxNYXBwaW5ncy5wdXNoKG1hcHBpbmcpO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgfVxuXG4gICAgcXVpY2tTb3J0KGdlbmVyYXRlZE1hcHBpbmdzLCB1dGlsLmNvbXBhcmVCeUdlbmVyYXRlZFBvc2l0aW9uc0RlZmxhdGVkKTtcbiAgICB0aGlzLl9fZ2VuZXJhdGVkTWFwcGluZ3MgPSBnZW5lcmF0ZWRNYXBwaW5ncztcblxuICAgIHF1aWNrU29ydChvcmlnaW5hbE1hcHBpbmdzLCB1dGlsLmNvbXBhcmVCeU9yaWdpbmFsUG9zaXRpb25zKTtcbiAgICB0aGlzLl9fb3JpZ2luYWxNYXBwaW5ncyA9IG9yaWdpbmFsTWFwcGluZ3M7XG4gIH07XG5cbi8qKlxuICogRmluZCB0aGUgbWFwcGluZyB0aGF0IGJlc3QgbWF0Y2hlcyB0aGUgaHlwb3RoZXRpY2FsIFwibmVlZGxlXCIgbWFwcGluZyB0aGF0XG4gKiB3ZSBhcmUgc2VhcmNoaW5nIGZvciBpbiB0aGUgZ2l2ZW4gXCJoYXlzdGFja1wiIG9mIG1hcHBpbmdzLlxuICovXG5CYXNpY1NvdXJjZU1hcENvbnN1bWVyLnByb3RvdHlwZS5fZmluZE1hcHBpbmcgPVxuICBmdW5jdGlvbiBTb3VyY2VNYXBDb25zdW1lcl9maW5kTWFwcGluZyhhTmVlZGxlLCBhTWFwcGluZ3MsIGFMaW5lTmFtZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYUNvbHVtbk5hbWUsIGFDb21wYXJhdG9yLCBhQmlhcykge1xuICAgIC8vIFRvIHJldHVybiB0aGUgcG9zaXRpb24gd2UgYXJlIHNlYXJjaGluZyBmb3IsIHdlIG11c3QgZmlyc3QgZmluZCB0aGVcbiAgICAvLyBtYXBwaW5nIGZvciB0aGUgZ2l2ZW4gcG9zaXRpb24gYW5kIHRoZW4gcmV0dXJuIHRoZSBvcHBvc2l0ZSBwb3NpdGlvbiBpdFxuICAgIC8vIHBvaW50cyB0by4gQmVjYXVzZSB0aGUgbWFwcGluZ3MgYXJlIHNvcnRlZCwgd2UgY2FuIHVzZSBiaW5hcnkgc2VhcmNoIHRvXG4gICAgLy8gZmluZCB0aGUgYmVzdCBtYXBwaW5nLlxuXG4gICAgaWYgKGFOZWVkbGVbYUxpbmVOYW1lXSA8PSAwKSB7XG4gICAgICB0aHJvdyBuZXcgVHlwZUVycm9yKCdMaW5lIG11c3QgYmUgZ3JlYXRlciB0aGFuIG9yIGVxdWFsIHRvIDEsIGdvdCAnXG4gICAgICAgICAgICAgICAgICAgICAgICAgICsgYU5lZWRsZVthTGluZU5hbWVdKTtcbiAgICB9XG4gICAgaWYgKGFOZWVkbGVbYUNvbHVtbk5hbWVdIDwgMCkge1xuICAgICAgdGhyb3cgbmV3IFR5cGVFcnJvcignQ29sdW1uIG11c3QgYmUgZ3JlYXRlciB0aGFuIG9yIGVxdWFsIHRvIDAsIGdvdCAnXG4gICAgICAgICAgICAgICAgICAgICAgICAgICsgYU5lZWRsZVthQ29sdW1uTmFtZV0pO1xuICAgIH1cblxuICAgIHJldHVybiBiaW5hcnlTZWFyY2guc2VhcmNoKGFOZWVkbGUsIGFNYXBwaW5ncywgYUNvbXBhcmF0b3IsIGFCaWFzKTtcbiAgfTtcblxuLyoqXG4gKiBDb21wdXRlIHRoZSBsYXN0IGNvbHVtbiBmb3IgZWFjaCBnZW5lcmF0ZWQgbWFwcGluZy4gVGhlIGxhc3QgY29sdW1uIGlzXG4gKiBpbmNsdXNpdmUuXG4gKi9cbkJhc2ljU291cmNlTWFwQ29uc3VtZXIucHJvdG90eXBlLmNvbXB1dGVDb2x1bW5TcGFucyA9XG4gIGZ1bmN0aW9uIFNvdXJjZU1hcENvbnN1bWVyX2NvbXB1dGVDb2x1bW5TcGFucygpIHtcbiAgICBmb3IgKHZhciBpbmRleCA9IDA7IGluZGV4IDwgdGhpcy5fZ2VuZXJhdGVkTWFwcGluZ3MubGVuZ3RoOyArK2luZGV4KSB7XG4gICAgICB2YXIgbWFwcGluZyA9IHRoaXMuX2dlbmVyYXRlZE1hcHBpbmdzW2luZGV4XTtcblxuICAgICAgLy8gTWFwcGluZ3MgZG8gbm90IGNvbnRhaW4gYSBmaWVsZCBmb3IgdGhlIGxhc3QgZ2VuZXJhdGVkIGNvbHVtbnQuIFdlXG4gICAgICAvLyBjYW4gY29tZSB1cCB3aXRoIGFuIG9wdGltaXN0aWMgZXN0aW1hdGUsIGhvd2V2ZXIsIGJ5IGFzc3VtaW5nIHRoYXRcbiAgICAgIC8vIG1hcHBpbmdzIGFyZSBjb250aWd1b3VzIChpLmUuIGdpdmVuIHR3byBjb25zZWN1dGl2ZSBtYXBwaW5ncywgdGhlXG4gICAgICAvLyBmaXJzdCBtYXBwaW5nIGVuZHMgd2hlcmUgdGhlIHNlY29uZCBvbmUgc3RhcnRzKS5cbiAgICAgIGlmIChpbmRleCArIDEgPCB0aGlzLl9nZW5lcmF0ZWRNYXBwaW5ncy5sZW5ndGgpIHtcbiAgICAgICAgdmFyIG5leHRNYXBwaW5nID0gdGhpcy5fZ2VuZXJhdGVkTWFwcGluZ3NbaW5kZXggKyAxXTtcblxuICAgICAgICBpZiAobWFwcGluZy5nZW5lcmF0ZWRMaW5lID09PSBuZXh0TWFwcGluZy5nZW5lcmF0ZWRMaW5lKSB7XG4gICAgICAgICAgbWFwcGluZy5sYXN0R2VuZXJhdGVkQ29sdW1uID0gbmV4dE1hcHBpbmcuZ2VuZXJhdGVkQ29sdW1uIC0gMTtcbiAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgfVxuICAgICAgfVxuXG4gICAgICAvLyBUaGUgbGFzdCBtYXBwaW5nIGZvciBlYWNoIGxpbmUgc3BhbnMgdGhlIGVudGlyZSBsaW5lLlxuICAgICAgbWFwcGluZy5sYXN0R2VuZXJhdGVkQ29sdW1uID0gSW5maW5pdHk7XG4gICAgfVxuICB9O1xuXG4vKipcbiAqIFJldHVybnMgdGhlIG9yaWdpbmFsIHNvdXJjZSwgbGluZSwgYW5kIGNvbHVtbiBpbmZvcm1hdGlvbiBmb3IgdGhlIGdlbmVyYXRlZFxuICogc291cmNlJ3MgbGluZSBhbmQgY29sdW1uIHBvc2l0aW9ucyBwcm92aWRlZC4gVGhlIG9ubHkgYXJndW1lbnQgaXMgYW4gb2JqZWN0XG4gKiB3aXRoIHRoZSBmb2xsb3dpbmcgcHJvcGVydGllczpcbiAqXG4gKiAgIC0gbGluZTogVGhlIGxpbmUgbnVtYmVyIGluIHRoZSBnZW5lcmF0ZWQgc291cmNlLiAgVGhlIGxpbmUgbnVtYmVyXG4gKiAgICAgaXMgMS1iYXNlZC5cbiAqICAgLSBjb2x1bW46IFRoZSBjb2x1bW4gbnVtYmVyIGluIHRoZSBnZW5lcmF0ZWQgc291cmNlLiAgVGhlIGNvbHVtblxuICogICAgIG51bWJlciBpcyAwLWJhc2VkLlxuICogICAtIGJpYXM6IEVpdGhlciAnU291cmNlTWFwQ29uc3VtZXIuR1JFQVRFU1RfTE9XRVJfQk9VTkQnIG9yXG4gKiAgICAgJ1NvdXJjZU1hcENvbnN1bWVyLkxFQVNUX1VQUEVSX0JPVU5EJy4gU3BlY2lmaWVzIHdoZXRoZXIgdG8gcmV0dXJuIHRoZVxuICogICAgIGNsb3Nlc3QgZWxlbWVudCB0aGF0IGlzIHNtYWxsZXIgdGhhbiBvciBncmVhdGVyIHRoYW4gdGhlIG9uZSB3ZSBhcmVcbiAqICAgICBzZWFyY2hpbmcgZm9yLCByZXNwZWN0aXZlbHksIGlmIHRoZSBleGFjdCBlbGVtZW50IGNhbm5vdCBiZSBmb3VuZC5cbiAqICAgICBEZWZhdWx0cyB0byAnU291cmNlTWFwQ29uc3VtZXIuR1JFQVRFU1RfTE9XRVJfQk9VTkQnLlxuICpcbiAqIGFuZCBhbiBvYmplY3QgaXMgcmV0dXJuZWQgd2l0aCB0aGUgZm9sbG93aW5nIHByb3BlcnRpZXM6XG4gKlxuICogICAtIHNvdXJjZTogVGhlIG9yaWdpbmFsIHNvdXJjZSBmaWxlLCBvciBudWxsLlxuICogICAtIGxpbmU6IFRoZSBsaW5lIG51bWJlciBpbiB0aGUgb3JpZ2luYWwgc291cmNlLCBvciBudWxsLiAgVGhlXG4gKiAgICAgbGluZSBudW1iZXIgaXMgMS1iYXNlZC5cbiAqICAgLSBjb2x1bW46IFRoZSBjb2x1bW4gbnVtYmVyIGluIHRoZSBvcmlnaW5hbCBzb3VyY2UsIG9yIG51bGwuICBUaGVcbiAqICAgICBjb2x1bW4gbnVtYmVyIGlzIDAtYmFzZWQuXG4gKiAgIC0gbmFtZTogVGhlIG9yaWdpbmFsIGlkZW50aWZpZXIsIG9yIG51bGwuXG4gKi9cbkJhc2ljU291cmNlTWFwQ29uc3VtZXIucHJvdG90eXBlLm9yaWdpbmFsUG9zaXRpb25Gb3IgPVxuICBmdW5jdGlvbiBTb3VyY2VNYXBDb25zdW1lcl9vcmlnaW5hbFBvc2l0aW9uRm9yKGFBcmdzKSB7XG4gICAgdmFyIG5lZWRsZSA9IHtcbiAgICAgIGdlbmVyYXRlZExpbmU6IHV0aWwuZ2V0QXJnKGFBcmdzLCAnbGluZScpLFxuICAgICAgZ2VuZXJhdGVkQ29sdW1uOiB1dGlsLmdldEFyZyhhQXJncywgJ2NvbHVtbicpXG4gICAgfTtcblxuICAgIHZhciBpbmRleCA9IHRoaXMuX2ZpbmRNYXBwaW5nKFxuICAgICAgbmVlZGxlLFxuICAgICAgdGhpcy5fZ2VuZXJhdGVkTWFwcGluZ3MsXG4gICAgICBcImdlbmVyYXRlZExpbmVcIixcbiAgICAgIFwiZ2VuZXJhdGVkQ29sdW1uXCIsXG4gICAgICB1dGlsLmNvbXBhcmVCeUdlbmVyYXRlZFBvc2l0aW9uc0RlZmxhdGVkLFxuICAgICAgdXRpbC5nZXRBcmcoYUFyZ3MsICdiaWFzJywgU291cmNlTWFwQ29uc3VtZXIuR1JFQVRFU1RfTE9XRVJfQk9VTkQpXG4gICAgKTtcblxuICAgIGlmIChpbmRleCA+PSAwKSB7XG4gICAgICB2YXIgbWFwcGluZyA9IHRoaXMuX2dlbmVyYXRlZE1hcHBpbmdzW2luZGV4XTtcblxuICAgICAgaWYgKG1hcHBpbmcuZ2VuZXJhdGVkTGluZSA9PT0gbmVlZGxlLmdlbmVyYXRlZExpbmUpIHtcbiAgICAgICAgdmFyIHNvdXJjZSA9IHV0aWwuZ2V0QXJnKG1hcHBpbmcsICdzb3VyY2UnLCBudWxsKTtcbiAgICAgICAgaWYgKHNvdXJjZSAhPT0gbnVsbCkge1xuICAgICAgICAgIHNvdXJjZSA9IHRoaXMuX3NvdXJjZXMuYXQoc291cmNlKTtcbiAgICAgICAgICBzb3VyY2UgPSB1dGlsLmNvbXB1dGVTb3VyY2VVUkwodGhpcy5zb3VyY2VSb290LCBzb3VyY2UsIHRoaXMuX3NvdXJjZU1hcFVSTCk7XG4gICAgICAgIH1cbiAgICAgICAgdmFyIG5hbWUgPSB1dGlsLmdldEFyZyhtYXBwaW5nLCAnbmFtZScsIG51bGwpO1xuICAgICAgICBpZiAobmFtZSAhPT0gbnVsbCkge1xuICAgICAgICAgIG5hbWUgPSB0aGlzLl9uYW1lcy5hdChuYW1lKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgIHNvdXJjZTogc291cmNlLFxuICAgICAgICAgIGxpbmU6IHV0aWwuZ2V0QXJnKG1hcHBpbmcsICdvcmlnaW5hbExpbmUnLCBudWxsKSxcbiAgICAgICAgICBjb2x1bW46IHV0aWwuZ2V0QXJnKG1hcHBpbmcsICdvcmlnaW5hbENvbHVtbicsIG51bGwpLFxuICAgICAgICAgIG5hbWU6IG5hbWVcbiAgICAgICAgfTtcbiAgICAgIH1cbiAgICB9XG5cbiAgICByZXR1cm4ge1xuICAgICAgc291cmNlOiBudWxsLFxuICAgICAgbGluZTogbnVsbCxcbiAgICAgIGNvbHVtbjogbnVsbCxcbiAgICAgIG5hbWU6IG51bGxcbiAgICB9O1xuICB9O1xuXG4vKipcbiAqIFJldHVybiB0cnVlIGlmIHdlIGhhdmUgdGhlIHNvdXJjZSBjb250ZW50IGZvciBldmVyeSBzb3VyY2UgaW4gdGhlIHNvdXJjZVxuICogbWFwLCBmYWxzZSBvdGhlcndpc2UuXG4gKi9cbkJhc2ljU291cmNlTWFwQ29uc3VtZXIucHJvdG90eXBlLmhhc0NvbnRlbnRzT2ZBbGxTb3VyY2VzID1cbiAgZnVuY3Rpb24gQmFzaWNTb3VyY2VNYXBDb25zdW1lcl9oYXNDb250ZW50c09mQWxsU291cmNlcygpIHtcbiAgICBpZiAoIXRoaXMuc291cmNlc0NvbnRlbnQpIHtcbiAgICAgIHJldHVybiBmYWxzZTtcbiAgICB9XG4gICAgcmV0dXJuIHRoaXMuc291cmNlc0NvbnRlbnQubGVuZ3RoID49IHRoaXMuX3NvdXJjZXMuc2l6ZSgpICYmXG4gICAgICAhdGhpcy5zb3VyY2VzQ29udGVudC5zb21lKGZ1bmN0aW9uIChzYykgeyByZXR1cm4gc2MgPT0gbnVsbDsgfSk7XG4gIH07XG5cbi8qKlxuICogUmV0dXJucyB0aGUgb3JpZ2luYWwgc291cmNlIGNvbnRlbnQuIFRoZSBvbmx5IGFyZ3VtZW50IGlzIHRoZSB1cmwgb2YgdGhlXG4gKiBvcmlnaW5hbCBzb3VyY2UgZmlsZS4gUmV0dXJucyBudWxsIGlmIG5vIG9yaWdpbmFsIHNvdXJjZSBjb250ZW50IGlzXG4gKiBhdmFpbGFibGUuXG4gKi9cbkJhc2ljU291cmNlTWFwQ29uc3VtZXIucHJvdG90eXBlLnNvdXJjZUNvbnRlbnRGb3IgPVxuICBmdW5jdGlvbiBTb3VyY2VNYXBDb25zdW1lcl9zb3VyY2VDb250ZW50Rm9yKGFTb3VyY2UsIG51bGxPbk1pc3NpbmcpIHtcbiAgICBpZiAoIXRoaXMuc291cmNlc0NvbnRlbnQpIHtcbiAgICAgIHJldHVybiBudWxsO1xuICAgIH1cblxuICAgIHZhciBpbmRleCA9IHRoaXMuX2ZpbmRTb3VyY2VJbmRleChhU291cmNlKTtcbiAgICBpZiAoaW5kZXggPj0gMCkge1xuICAgICAgcmV0dXJuIHRoaXMuc291cmNlc0NvbnRlbnRbaW5kZXhdO1xuICAgIH1cblxuICAgIHZhciByZWxhdGl2ZVNvdXJjZSA9IGFTb3VyY2U7XG4gICAgaWYgKHRoaXMuc291cmNlUm9vdCAhPSBudWxsKSB7XG4gICAgICByZWxhdGl2ZVNvdXJjZSA9IHV0aWwucmVsYXRpdmUodGhpcy5zb3VyY2VSb290LCByZWxhdGl2ZVNvdXJjZSk7XG4gICAgfVxuXG4gICAgdmFyIHVybDtcbiAgICBpZiAodGhpcy5zb3VyY2VSb290ICE9IG51bGxcbiAgICAgICAgJiYgKHVybCA9IHV0aWwudXJsUGFyc2UodGhpcy5zb3VyY2VSb290KSkpIHtcbiAgICAgIC8vIFhYWDogZmlsZTovLyBVUklzIGFuZCBhYnNvbHV0ZSBwYXRocyBsZWFkIHRvIHVuZXhwZWN0ZWQgYmVoYXZpb3IgZm9yXG4gICAgICAvLyBtYW55IHVzZXJzLiBXZSBjYW4gaGVscCB0aGVtIG91dCB3aGVuIHRoZXkgZXhwZWN0IGZpbGU6Ly8gVVJJcyB0b1xuICAgICAgLy8gYmVoYXZlIGxpa2UgaXQgd291bGQgaWYgdGhleSB3ZXJlIHJ1bm5pbmcgYSBsb2NhbCBIVFRQIHNlcnZlci4gU2VlXG4gICAgICAvLyBodHRwczovL2J1Z3ppbGxhLm1vemlsbGEub3JnL3Nob3dfYnVnLmNnaT9pZD04ODU1OTcuXG4gICAgICB2YXIgZmlsZVVyaUFic1BhdGggPSByZWxhdGl2ZVNvdXJjZS5yZXBsYWNlKC9eZmlsZTpcXC9cXC8vLCBcIlwiKTtcbiAgICAgIGlmICh1cmwuc2NoZW1lID09IFwiZmlsZVwiXG4gICAgICAgICAgJiYgdGhpcy5fc291cmNlcy5oYXMoZmlsZVVyaUFic1BhdGgpKSB7XG4gICAgICAgIHJldHVybiB0aGlzLnNvdXJjZXNDb250ZW50W3RoaXMuX3NvdXJjZXMuaW5kZXhPZihmaWxlVXJpQWJzUGF0aCldXG4gICAgICB9XG5cbiAgICAgIGlmICgoIXVybC5wYXRoIHx8IHVybC5wYXRoID09IFwiL1wiKVxuICAgICAgICAgICYmIHRoaXMuX3NvdXJjZXMuaGFzKFwiL1wiICsgcmVsYXRpdmVTb3VyY2UpKSB7XG4gICAgICAgIHJldHVybiB0aGlzLnNvdXJjZXNDb250ZW50W3RoaXMuX3NvdXJjZXMuaW5kZXhPZihcIi9cIiArIHJlbGF0aXZlU291cmNlKV07XG4gICAgICB9XG4gICAgfVxuXG4gICAgLy8gVGhpcyBmdW5jdGlvbiBpcyB1c2VkIHJlY3Vyc2l2ZWx5IGZyb21cbiAgICAvLyBJbmRleGVkU291cmNlTWFwQ29uc3VtZXIucHJvdG90eXBlLnNvdXJjZUNvbnRlbnRGb3IuIEluIHRoYXQgY2FzZSwgd2VcbiAgICAvLyBkb24ndCB3YW50IHRvIHRocm93IGlmIHdlIGNhbid0IGZpbmQgdGhlIHNvdXJjZSAtIHdlIGp1c3Qgd2FudCB0b1xuICAgIC8vIHJldHVybiBudWxsLCBzbyB3ZSBwcm92aWRlIGEgZmxhZyB0byBleGl0IGdyYWNlZnVsbHkuXG4gICAgaWYgKG51bGxPbk1pc3NpbmcpIHtcbiAgICAgIHJldHVybiBudWxsO1xuICAgIH1cbiAgICBlbHNlIHtcbiAgICAgIHRocm93IG5ldyBFcnJvcignXCInICsgcmVsYXRpdmVTb3VyY2UgKyAnXCIgaXMgbm90IGluIHRoZSBTb3VyY2VNYXAuJyk7XG4gICAgfVxuICB9O1xuXG4vKipcbiAqIFJldHVybnMgdGhlIGdlbmVyYXRlZCBsaW5lIGFuZCBjb2x1bW4gaW5mb3JtYXRpb24gZm9yIHRoZSBvcmlnaW5hbCBzb3VyY2UsXG4gKiBsaW5lLCBhbmQgY29sdW1uIHBvc2l0aW9ucyBwcm92aWRlZC4gVGhlIG9ubHkgYXJndW1lbnQgaXMgYW4gb2JqZWN0IHdpdGhcbiAqIHRoZSBmb2xsb3dpbmcgcHJvcGVydGllczpcbiAqXG4gKiAgIC0gc291cmNlOiBUaGUgZmlsZW5hbWUgb2YgdGhlIG9yaWdpbmFsIHNvdXJjZS5cbiAqICAgLSBsaW5lOiBUaGUgbGluZSBudW1iZXIgaW4gdGhlIG9yaWdpbmFsIHNvdXJjZS4gIFRoZSBsaW5lIG51bWJlclxuICogICAgIGlzIDEtYmFzZWQuXG4gKiAgIC0gY29sdW1uOiBUaGUgY29sdW1uIG51bWJlciBpbiB0aGUgb3JpZ2luYWwgc291cmNlLiAgVGhlIGNvbHVtblxuICogICAgIG51bWJlciBpcyAwLWJhc2VkLlxuICogICAtIGJpYXM6IEVpdGhlciAnU291cmNlTWFwQ29uc3VtZXIuR1JFQVRFU1RfTE9XRVJfQk9VTkQnIG9yXG4gKiAgICAgJ1NvdXJjZU1hcENvbnN1bWVyLkxFQVNUX1VQUEVSX0JPVU5EJy4gU3BlY2lmaWVzIHdoZXRoZXIgdG8gcmV0dXJuIHRoZVxuICogICAgIGNsb3Nlc3QgZWxlbWVudCB0aGF0IGlzIHNtYWxsZXIgdGhhbiBvciBncmVhdGVyIHRoYW4gdGhlIG9uZSB3ZSBhcmVcbiAqICAgICBzZWFyY2hpbmcgZm9yLCByZXNwZWN0aXZlbHksIGlmIHRoZSBleGFjdCBlbGVtZW50IGNhbm5vdCBiZSBmb3VuZC5cbiAqICAgICBEZWZhdWx0cyB0byAnU291cmNlTWFwQ29uc3VtZXIuR1JFQVRFU1RfTE9XRVJfQk9VTkQnLlxuICpcbiAqIGFuZCBhbiBvYmplY3QgaXMgcmV0dXJuZWQgd2l0aCB0aGUgZm9sbG93aW5nIHByb3BlcnRpZXM6XG4gKlxuICogICAtIGxpbmU6IFRoZSBsaW5lIG51bWJlciBpbiB0aGUgZ2VuZXJhdGVkIHNvdXJjZSwgb3IgbnVsbC4gIFRoZVxuICogICAgIGxpbmUgbnVtYmVyIGlzIDEtYmFzZWQuXG4gKiAgIC0gY29sdW1uOiBUaGUgY29sdW1uIG51bWJlciBpbiB0aGUgZ2VuZXJhdGVkIHNvdXJjZSwgb3IgbnVsbC5cbiAqICAgICBUaGUgY29sdW1uIG51bWJlciBpcyAwLWJhc2VkLlxuICovXG5CYXNpY1NvdXJjZU1hcENvbnN1bWVyLnByb3RvdHlwZS5nZW5lcmF0ZWRQb3NpdGlvbkZvciA9XG4gIGZ1bmN0aW9uIFNvdXJjZU1hcENvbnN1bWVyX2dlbmVyYXRlZFBvc2l0aW9uRm9yKGFBcmdzKSB7XG4gICAgdmFyIHNvdXJjZSA9IHV0aWwuZ2V0QXJnKGFBcmdzLCAnc291cmNlJyk7XG4gICAgc291cmNlID0gdGhpcy5fZmluZFNvdXJjZUluZGV4KHNvdXJjZSk7XG4gICAgaWYgKHNvdXJjZSA8IDApIHtcbiAgICAgIHJldHVybiB7XG4gICAgICAgIGxpbmU6IG51bGwsXG4gICAgICAgIGNvbHVtbjogbnVsbCxcbiAgICAgICAgbGFzdENvbHVtbjogbnVsbFxuICAgICAgfTtcbiAgICB9XG5cbiAgICB2YXIgbmVlZGxlID0ge1xuICAgICAgc291cmNlOiBzb3VyY2UsXG4gICAgICBvcmlnaW5hbExpbmU6IHV0aWwuZ2V0QXJnKGFBcmdzLCAnbGluZScpLFxuICAgICAgb3JpZ2luYWxDb2x1bW46IHV0aWwuZ2V0QXJnKGFBcmdzLCAnY29sdW1uJylcbiAgICB9O1xuXG4gICAgdmFyIGluZGV4ID0gdGhpcy5fZmluZE1hcHBpbmcoXG4gICAgICBuZWVkbGUsXG4gICAgICB0aGlzLl9vcmlnaW5hbE1hcHBpbmdzLFxuICAgICAgXCJvcmlnaW5hbExpbmVcIixcbiAgICAgIFwib3JpZ2luYWxDb2x1bW5cIixcbiAgICAgIHV0aWwuY29tcGFyZUJ5T3JpZ2luYWxQb3NpdGlvbnMsXG4gICAgICB1dGlsLmdldEFyZyhhQXJncywgJ2JpYXMnLCBTb3VyY2VNYXBDb25zdW1lci5HUkVBVEVTVF9MT1dFUl9CT1VORClcbiAgICApO1xuXG4gICAgaWYgKGluZGV4ID49IDApIHtcbiAgICAgIHZhciBtYXBwaW5nID0gdGhpcy5fb3JpZ2luYWxNYXBwaW5nc1tpbmRleF07XG5cbiAgICAgIGlmIChtYXBwaW5nLnNvdXJjZSA9PT0gbmVlZGxlLnNvdXJjZSkge1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgIGxpbmU6IHV0aWwuZ2V0QXJnKG1hcHBpbmcsICdnZW5lcmF0ZWRMaW5lJywgbnVsbCksXG4gICAgICAgICAgY29sdW1uOiB1dGlsLmdldEFyZyhtYXBwaW5nLCAnZ2VuZXJhdGVkQ29sdW1uJywgbnVsbCksXG4gICAgICAgICAgbGFzdENvbHVtbjogdXRpbC5nZXRBcmcobWFwcGluZywgJ2xhc3RHZW5lcmF0ZWRDb2x1bW4nLCBudWxsKVxuICAgICAgICB9O1xuICAgICAgfVxuICAgIH1cblxuICAgIHJldHVybiB7XG4gICAgICBsaW5lOiBudWxsLFxuICAgICAgY29sdW1uOiBudWxsLFxuICAgICAgbGFzdENvbHVtbjogbnVsbFxuICAgIH07XG4gIH07XG5cbmV4cG9ydHMuQmFzaWNTb3VyY2VNYXBDb25zdW1lciA9IEJhc2ljU291cmNlTWFwQ29uc3VtZXI7XG5cbi8qKlxuICogQW4gSW5kZXhlZFNvdXJjZU1hcENvbnN1bWVyIGluc3RhbmNlIHJlcHJlc2VudHMgYSBwYXJzZWQgc291cmNlIG1hcCB3aGljaFxuICogd2UgY2FuIHF1ZXJ5IGZvciBpbmZvcm1hdGlvbi4gSXQgZGlmZmVycyBmcm9tIEJhc2ljU291cmNlTWFwQ29uc3VtZXIgaW5cbiAqIHRoYXQgaXQgdGFrZXMgXCJpbmRleGVkXCIgc291cmNlIG1hcHMgKGkuZS4gb25lcyB3aXRoIGEgXCJzZWN0aW9uc1wiIGZpZWxkKSBhc1xuICogaW5wdXQuXG4gKlxuICogVGhlIGZpcnN0IHBhcmFtZXRlciBpcyBhIHJhdyBzb3VyY2UgbWFwIChlaXRoZXIgYXMgYSBKU09OIHN0cmluZywgb3IgYWxyZWFkeVxuICogcGFyc2VkIHRvIGFuIG9iamVjdCkuIEFjY29yZGluZyB0byB0aGUgc3BlYyBmb3IgaW5kZXhlZCBzb3VyY2UgbWFwcywgdGhleVxuICogaGF2ZSB0aGUgZm9sbG93aW5nIGF0dHJpYnV0ZXM6XG4gKlxuICogICAtIHZlcnNpb246IFdoaWNoIHZlcnNpb24gb2YgdGhlIHNvdXJjZSBtYXAgc3BlYyB0aGlzIG1hcCBpcyBmb2xsb3dpbmcuXG4gKiAgIC0gZmlsZTogT3B0aW9uYWwuIFRoZSBnZW5lcmF0ZWQgZmlsZSB0aGlzIHNvdXJjZSBtYXAgaXMgYXNzb2NpYXRlZCB3aXRoLlxuICogICAtIHNlY3Rpb25zOiBBIGxpc3Qgb2Ygc2VjdGlvbiBkZWZpbml0aW9ucy5cbiAqXG4gKiBFYWNoIHZhbHVlIHVuZGVyIHRoZSBcInNlY3Rpb25zXCIgZmllbGQgaGFzIHR3byBmaWVsZHM6XG4gKiAgIC0gb2Zmc2V0OiBUaGUgb2Zmc2V0IGludG8gdGhlIG9yaWdpbmFsIHNwZWNpZmllZCBhdCB3aGljaCB0aGlzIHNlY3Rpb25cbiAqICAgICAgIGJlZ2lucyB0byBhcHBseSwgZGVmaW5lZCBhcyBhbiBvYmplY3Qgd2l0aCBhIFwibGluZVwiIGFuZCBcImNvbHVtblwiXG4gKiAgICAgICBmaWVsZC5cbiAqICAgLSBtYXA6IEEgc291cmNlIG1hcCBkZWZpbml0aW9uLiBUaGlzIHNvdXJjZSBtYXAgY291bGQgYWxzbyBiZSBpbmRleGVkLFxuICogICAgICAgYnV0IGRvZXNuJ3QgaGF2ZSB0byBiZS5cbiAqXG4gKiBJbnN0ZWFkIG9mIHRoZSBcIm1hcFwiIGZpZWxkLCBpdCdzIGFsc28gcG9zc2libGUgdG8gaGF2ZSBhIFwidXJsXCIgZmllbGRcbiAqIHNwZWNpZnlpbmcgYSBVUkwgdG8gcmV0cmlldmUgYSBzb3VyY2UgbWFwIGZyb20sIGJ1dCB0aGF0J3MgY3VycmVudGx5XG4gKiB1bnN1cHBvcnRlZC5cbiAqXG4gKiBIZXJlJ3MgYW4gZXhhbXBsZSBzb3VyY2UgbWFwLCB0YWtlbiBmcm9tIHRoZSBzb3VyY2UgbWFwIHNwZWNbMF0sIGJ1dFxuICogbW9kaWZpZWQgdG8gb21pdCBhIHNlY3Rpb24gd2hpY2ggdXNlcyB0aGUgXCJ1cmxcIiBmaWVsZC5cbiAqXG4gKiAge1xuICogICAgdmVyc2lvbiA6IDMsXG4gKiAgICBmaWxlOiBcImFwcC5qc1wiLFxuICogICAgc2VjdGlvbnM6IFt7XG4gKiAgICAgIG9mZnNldDoge2xpbmU6MTAwLCBjb2x1bW46MTB9LFxuICogICAgICBtYXA6IHtcbiAqICAgICAgICB2ZXJzaW9uIDogMyxcbiAqICAgICAgICBmaWxlOiBcInNlY3Rpb24uanNcIixcbiAqICAgICAgICBzb3VyY2VzOiBbXCJmb28uanNcIiwgXCJiYXIuanNcIl0sXG4gKiAgICAgICAgbmFtZXM6IFtcInNyY1wiLCBcIm1hcHNcIiwgXCJhcmVcIiwgXCJmdW5cIl0sXG4gKiAgICAgICAgbWFwcGluZ3M6IFwiQUFBQSxFOztBQkNERTtcIlxuICogICAgICB9XG4gKiAgICB9XSxcbiAqICB9XG4gKlxuICogVGhlIHNlY29uZCBwYXJhbWV0ZXIsIGlmIGdpdmVuLCBpcyBhIHN0cmluZyB3aG9zZSB2YWx1ZSBpcyB0aGUgVVJMXG4gKiBhdCB3aGljaCB0aGUgc291cmNlIG1hcCB3YXMgZm91bmQuICBUaGlzIFVSTCBpcyB1c2VkIHRvIGNvbXB1dGUgdGhlXG4gKiBzb3VyY2VzIGFycmF5LlxuICpcbiAqIFswXTogaHR0cHM6Ly9kb2NzLmdvb2dsZS5jb20vZG9jdW1lbnQvZC8xVTFSR0FlaFF3UnlwVVRvdkYxS1JscGlPRnplMGItXzJnYzZmQUgwS1kway9lZGl0I2hlYWRpbmc9aC41MzVlczN4ZXByZ3RcbiAqL1xuZnVuY3Rpb24gSW5kZXhlZFNvdXJjZU1hcENvbnN1bWVyKGFTb3VyY2VNYXAsIGFTb3VyY2VNYXBVUkwpIHtcbiAgdmFyIHNvdXJjZU1hcCA9IGFTb3VyY2VNYXA7XG4gIGlmICh0eXBlb2YgYVNvdXJjZU1hcCA9PT0gJ3N0cmluZycpIHtcbiAgICBzb3VyY2VNYXAgPSB1dGlsLnBhcnNlU291cmNlTWFwSW5wdXQoYVNvdXJjZU1hcCk7XG4gIH1cblxuICB2YXIgdmVyc2lvbiA9IHV0aWwuZ2V0QXJnKHNvdXJjZU1hcCwgJ3ZlcnNpb24nKTtcbiAgdmFyIHNlY3Rpb25zID0gdXRpbC5nZXRBcmcoc291cmNlTWFwLCAnc2VjdGlvbnMnKTtcblxuICBpZiAodmVyc2lvbiAhPSB0aGlzLl92ZXJzaW9uKSB7XG4gICAgdGhyb3cgbmV3IEVycm9yKCdVbnN1cHBvcnRlZCB2ZXJzaW9uOiAnICsgdmVyc2lvbik7XG4gIH1cblxuICB0aGlzLl9zb3VyY2VzID0gbmV3IEFycmF5U2V0KCk7XG4gIHRoaXMuX25hbWVzID0gbmV3IEFycmF5U2V0KCk7XG5cbiAgdmFyIGxhc3RPZmZzZXQgPSB7XG4gICAgbGluZTogLTEsXG4gICAgY29sdW1uOiAwXG4gIH07XG4gIHRoaXMuX3NlY3Rpb25zID0gc2VjdGlvbnMubWFwKGZ1bmN0aW9uIChzKSB7XG4gICAgaWYgKHMudXJsKSB7XG4gICAgICAvLyBUaGUgdXJsIGZpZWxkIHdpbGwgcmVxdWlyZSBzdXBwb3J0IGZvciBhc3luY2hyb25pY2l0eS5cbiAgICAgIC8vIFNlZSBodHRwczovL2dpdGh1Yi5jb20vbW96aWxsYS9zb3VyY2UtbWFwL2lzc3Vlcy8xNlxuICAgICAgdGhyb3cgbmV3IEVycm9yKCdTdXBwb3J0IGZvciB1cmwgZmllbGQgaW4gc2VjdGlvbnMgbm90IGltcGxlbWVudGVkLicpO1xuICAgIH1cbiAgICB2YXIgb2Zmc2V0ID0gdXRpbC5nZXRBcmcocywgJ29mZnNldCcpO1xuICAgIHZhciBvZmZzZXRMaW5lID0gdXRpbC5nZXRBcmcob2Zmc2V0LCAnbGluZScpO1xuICAgIHZhciBvZmZzZXRDb2x1bW4gPSB1dGlsLmdldEFyZyhvZmZzZXQsICdjb2x1bW4nKTtcblxuICAgIGlmIChvZmZzZXRMaW5lIDwgbGFzdE9mZnNldC5saW5lIHx8XG4gICAgICAgIChvZmZzZXRMaW5lID09PSBsYXN0T2Zmc2V0LmxpbmUgJiYgb2Zmc2V0Q29sdW1uIDwgbGFzdE9mZnNldC5jb2x1bW4pKSB7XG4gICAgICB0aHJvdyBuZXcgRXJyb3IoJ1NlY3Rpb24gb2Zmc2V0cyBtdXN0IGJlIG9yZGVyZWQgYW5kIG5vbi1vdmVybGFwcGluZy4nKTtcbiAgICB9XG4gICAgbGFzdE9mZnNldCA9IG9mZnNldDtcblxuICAgIHJldHVybiB7XG4gICAgICBnZW5lcmF0ZWRPZmZzZXQ6IHtcbiAgICAgICAgLy8gVGhlIG9mZnNldCBmaWVsZHMgYXJlIDAtYmFzZWQsIGJ1dCB3ZSB1c2UgMS1iYXNlZCBpbmRpY2VzIHdoZW5cbiAgICAgICAgLy8gZW5jb2RpbmcvZGVjb2RpbmcgZnJvbSBWTFEuXG4gICAgICAgIGdlbmVyYXRlZExpbmU6IG9mZnNldExpbmUgKyAxLFxuICAgICAgICBnZW5lcmF0ZWRDb2x1bW46IG9mZnNldENvbHVtbiArIDFcbiAgICAgIH0sXG4gICAgICBjb25zdW1lcjogbmV3IFNvdXJjZU1hcENvbnN1bWVyKHV0aWwuZ2V0QXJnKHMsICdtYXAnKSwgYVNvdXJjZU1hcFVSTClcbiAgICB9XG4gIH0pO1xufVxuXG5JbmRleGVkU291cmNlTWFwQ29uc3VtZXIucHJvdG90eXBlID0gT2JqZWN0LmNyZWF0ZShTb3VyY2VNYXBDb25zdW1lci5wcm90b3R5cGUpO1xuSW5kZXhlZFNvdXJjZU1hcENvbnN1bWVyLnByb3RvdHlwZS5jb25zdHJ1Y3RvciA9IFNvdXJjZU1hcENvbnN1bWVyO1xuXG4vKipcbiAqIFRoZSB2ZXJzaW9uIG9mIHRoZSBzb3VyY2UgbWFwcGluZyBzcGVjIHRoYXQgd2UgYXJlIGNvbnN1bWluZy5cbiAqL1xuSW5kZXhlZFNvdXJjZU1hcENvbnN1bWVyLnByb3RvdHlwZS5fdmVyc2lvbiA9IDM7XG5cbi8qKlxuICogVGhlIGxpc3Qgb2Ygb3JpZ2luYWwgc291cmNlcy5cbiAqL1xuT2JqZWN0LmRlZmluZVByb3BlcnR5KEluZGV4ZWRTb3VyY2VNYXBDb25zdW1lci5wcm90b3R5cGUsICdzb3VyY2VzJywge1xuICBnZXQ6IGZ1bmN0aW9uICgpIHtcbiAgICB2YXIgc291cmNlcyA9IFtdO1xuICAgIGZvciAodmFyIGkgPSAwOyBpIDwgdGhpcy5fc2VjdGlvbnMubGVuZ3RoOyBpKyspIHtcbiAgICAgIGZvciAodmFyIGogPSAwOyBqIDwgdGhpcy5fc2VjdGlvbnNbaV0uY29uc3VtZXIuc291cmNlcy5sZW5ndGg7IGorKykge1xuICAgICAgICBzb3VyY2VzLnB1c2godGhpcy5fc2VjdGlvbnNbaV0uY29uc3VtZXIuc291cmNlc1tqXSk7XG4gICAgICB9XG4gICAgfVxuICAgIHJldHVybiBzb3VyY2VzO1xuICB9XG59KTtcblxuLyoqXG4gKiBSZXR1cm5zIHRoZSBvcmlnaW5hbCBzb3VyY2UsIGxpbmUsIGFuZCBjb2x1bW4gaW5mb3JtYXRpb24gZm9yIHRoZSBnZW5lcmF0ZWRcbiAqIHNvdXJjZSdzIGxpbmUgYW5kIGNvbHVtbiBwb3NpdGlvbnMgcHJvdmlkZWQuIFRoZSBvbmx5IGFyZ3VtZW50IGlzIGFuIG9iamVjdFxuICogd2l0aCB0aGUgZm9sbG93aW5nIHByb3BlcnRpZXM6XG4gKlxuICogICAtIGxpbmU6IFRoZSBsaW5lIG51bWJlciBpbiB0aGUgZ2VuZXJhdGVkIHNvdXJjZS4gIFRoZSBsaW5lIG51bWJlclxuICogICAgIGlzIDEtYmFzZWQuXG4gKiAgIC0gY29sdW1uOiBUaGUgY29sdW1uIG51bWJlciBpbiB0aGUgZ2VuZXJhdGVkIHNvdXJjZS4gIFRoZSBjb2x1bW5cbiAqICAgICBudW1iZXIgaXMgMC1iYXNlZC5cbiAqXG4gKiBhbmQgYW4gb2JqZWN0IGlzIHJldHVybmVkIHdpdGggdGhlIGZvbGxvd2luZyBwcm9wZXJ0aWVzOlxuICpcbiAqICAgLSBzb3VyY2U6IFRoZSBvcmlnaW5hbCBzb3VyY2UgZmlsZSwgb3IgbnVsbC5cbiAqICAgLSBsaW5lOiBUaGUgbGluZSBudW1iZXIgaW4gdGhlIG9yaWdpbmFsIHNvdXJjZSwgb3IgbnVsbC4gIFRoZVxuICogICAgIGxpbmUgbnVtYmVyIGlzIDEtYmFzZWQuXG4gKiAgIC0gY29sdW1uOiBUaGUgY29sdW1uIG51bWJlciBpbiB0aGUgb3JpZ2luYWwgc291cmNlLCBvciBudWxsLiAgVGhlXG4gKiAgICAgY29sdW1uIG51bWJlciBpcyAwLWJhc2VkLlxuICogICAtIG5hbWU6IFRoZSBvcmlnaW5hbCBpZGVudGlmaWVyLCBvciBudWxsLlxuICovXG5JbmRleGVkU291cmNlTWFwQ29uc3VtZXIucHJvdG90eXBlLm9yaWdpbmFsUG9zaXRpb25Gb3IgPVxuICBmdW5jdGlvbiBJbmRleGVkU291cmNlTWFwQ29uc3VtZXJfb3JpZ2luYWxQb3NpdGlvbkZvcihhQXJncykge1xuICAgIHZhciBuZWVkbGUgPSB7XG4gICAgICBnZW5lcmF0ZWRMaW5lOiB1dGlsLmdldEFyZyhhQXJncywgJ2xpbmUnKSxcbiAgICAgIGdlbmVyYXRlZENvbHVtbjogdXRpbC5nZXRBcmcoYUFyZ3MsICdjb2x1bW4nKVxuICAgIH07XG5cbiAgICAvLyBGaW5kIHRoZSBzZWN0aW9uIGNvbnRhaW5pbmcgdGhlIGdlbmVyYXRlZCBwb3NpdGlvbiB3ZSdyZSB0cnlpbmcgdG8gbWFwXG4gICAgLy8gdG8gYW4gb3JpZ2luYWwgcG9zaXRpb24uXG4gICAgdmFyIHNlY3Rpb25JbmRleCA9IGJpbmFyeVNlYXJjaC5zZWFyY2gobmVlZGxlLCB0aGlzLl9zZWN0aW9ucyxcbiAgICAgIGZ1bmN0aW9uKG5lZWRsZSwgc2VjdGlvbikge1xuICAgICAgICB2YXIgY21wID0gbmVlZGxlLmdlbmVyYXRlZExpbmUgLSBzZWN0aW9uLmdlbmVyYXRlZE9mZnNldC5nZW5lcmF0ZWRMaW5lO1xuICAgICAgICBpZiAoY21wKSB7XG4gICAgICAgICAgcmV0dXJuIGNtcDtcbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiAobmVlZGxlLmdlbmVyYXRlZENvbHVtbiAtXG4gICAgICAgICAgICAgICAgc2VjdGlvbi5nZW5lcmF0ZWRPZmZzZXQuZ2VuZXJhdGVkQ29sdW1uKTtcbiAgICAgIH0pO1xuICAgIHZhciBzZWN0aW9uID0gdGhpcy5fc2VjdGlvbnNbc2VjdGlvbkluZGV4XTtcblxuICAgIGlmICghc2VjdGlvbikge1xuICAgICAgcmV0dXJuIHtcbiAgICAgICAgc291cmNlOiBudWxsLFxuICAgICAgICBsaW5lOiBudWxsLFxuICAgICAgICBjb2x1bW46IG51bGwsXG4gICAgICAgIG5hbWU6IG51bGxcbiAgICAgIH07XG4gICAgfVxuXG4gICAgcmV0dXJuIHNlY3Rpb24uY29uc3VtZXIub3JpZ2luYWxQb3NpdGlvbkZvcih7XG4gICAgICBsaW5lOiBuZWVkbGUuZ2VuZXJhdGVkTGluZSAtXG4gICAgICAgIChzZWN0aW9uLmdlbmVyYXRlZE9mZnNldC5nZW5lcmF0ZWRMaW5lIC0gMSksXG4gICAgICBjb2x1bW46IG5lZWRsZS5nZW5lcmF0ZWRDb2x1bW4gLVxuICAgICAgICAoc2VjdGlvbi5nZW5lcmF0ZWRPZmZzZXQuZ2VuZXJhdGVkTGluZSA9PT0gbmVlZGxlLmdlbmVyYXRlZExpbmVcbiAgICAgICAgID8gc2VjdGlvbi5nZW5lcmF0ZWRPZmZzZXQuZ2VuZXJhdGVkQ29sdW1uIC0gMVxuICAgICAgICAgOiAwKSxcbiAgICAgIGJpYXM6IGFBcmdzLmJpYXNcbiAgICB9KTtcbiAgfTtcblxuLyoqXG4gKiBSZXR1cm4gdHJ1ZSBpZiB3ZSBoYXZlIHRoZSBzb3VyY2UgY29udGVudCBmb3IgZXZlcnkgc291cmNlIGluIHRoZSBzb3VyY2VcbiAqIG1hcCwgZmFsc2Ugb3RoZXJ3aXNlLlxuICovXG5JbmRleGVkU291cmNlTWFwQ29uc3VtZXIucHJvdG90eXBlLmhhc0NvbnRlbnRzT2ZBbGxTb3VyY2VzID1cbiAgZnVuY3Rpb24gSW5kZXhlZFNvdXJjZU1hcENvbnN1bWVyX2hhc0NvbnRlbnRzT2ZBbGxTb3VyY2VzKCkge1xuICAgIHJldHVybiB0aGlzLl9zZWN0aW9ucy5ldmVyeShmdW5jdGlvbiAocykge1xuICAgICAgcmV0dXJuIHMuY29uc3VtZXIuaGFzQ29udGVudHNPZkFsbFNvdXJjZXMoKTtcbiAgICB9KTtcbiAgfTtcblxuLyoqXG4gKiBSZXR1cm5zIHRoZSBvcmlnaW5hbCBzb3VyY2UgY29udGVudC4gVGhlIG9ubHkgYXJndW1lbnQgaXMgdGhlIHVybCBvZiB0aGVcbiAqIG9yaWdpbmFsIHNvdXJjZSBmaWxlLiBSZXR1cm5zIG51bGwgaWYgbm8gb3JpZ2luYWwgc291cmNlIGNvbnRlbnQgaXNcbiAqIGF2YWlsYWJsZS5cbiAqL1xuSW5kZXhlZFNvdXJjZU1hcENvbnN1bWVyLnByb3RvdHlwZS5zb3VyY2VDb250ZW50Rm9yID1cbiAgZnVuY3Rpb24gSW5kZXhlZFNvdXJjZU1hcENvbnN1bWVyX3NvdXJjZUNvbnRlbnRGb3IoYVNvdXJjZSwgbnVsbE9uTWlzc2luZykge1xuICAgIGZvciAodmFyIGkgPSAwOyBpIDwgdGhpcy5fc2VjdGlvbnMubGVuZ3RoOyBpKyspIHtcbiAgICAgIHZhciBzZWN0aW9uID0gdGhpcy5fc2VjdGlvbnNbaV07XG5cbiAgICAgIHZhciBjb250ZW50ID0gc2VjdGlvbi5jb25zdW1lci5zb3VyY2VDb250ZW50Rm9yKGFTb3VyY2UsIHRydWUpO1xuICAgICAgaWYgKGNvbnRlbnQpIHtcbiAgICAgICAgcmV0dXJuIGNvbnRlbnQ7XG4gICAgICB9XG4gICAgfVxuICAgIGlmIChudWxsT25NaXNzaW5nKSB7XG4gICAgICByZXR1cm4gbnVsbDtcbiAgICB9XG4gICAgZWxzZSB7XG4gICAgICB0aHJvdyBuZXcgRXJyb3IoJ1wiJyArIGFTb3VyY2UgKyAnXCIgaXMgbm90IGluIHRoZSBTb3VyY2VNYXAuJyk7XG4gICAgfVxuICB9O1xuXG4vKipcbiAqIFJldHVybnMgdGhlIGdlbmVyYXRlZCBsaW5lIGFuZCBjb2x1bW4gaW5mb3JtYXRpb24gZm9yIHRoZSBvcmlnaW5hbCBzb3VyY2UsXG4gKiBsaW5lLCBhbmQgY29sdW1uIHBvc2l0aW9ucyBwcm92aWRlZC4gVGhlIG9ubHkgYXJndW1lbnQgaXMgYW4gb2JqZWN0IHdpdGhcbiAqIHRoZSBmb2xsb3dpbmcgcHJvcGVydGllczpcbiAqXG4gKiAgIC0gc291cmNlOiBUaGUgZmlsZW5hbWUgb2YgdGhlIG9yaWdpbmFsIHNvdXJjZS5cbiAqICAgLSBsaW5lOiBUaGUgbGluZSBudW1iZXIgaW4gdGhlIG9yaWdpbmFsIHNvdXJjZS4gIFRoZSBsaW5lIG51bWJlclxuICogICAgIGlzIDEtYmFzZWQuXG4gKiAgIC0gY29sdW1uOiBUaGUgY29sdW1uIG51bWJlciBpbiB0aGUgb3JpZ2luYWwgc291cmNlLiAgVGhlIGNvbHVtblxuICogICAgIG51bWJlciBpcyAwLWJhc2VkLlxuICpcbiAqIGFuZCBhbiBvYmplY3QgaXMgcmV0dXJuZWQgd2l0aCB0aGUgZm9sbG93aW5nIHByb3BlcnRpZXM6XG4gKlxuICogICAtIGxpbmU6IFRoZSBsaW5lIG51bWJlciBpbiB0aGUgZ2VuZXJhdGVkIHNvdXJjZSwgb3IgbnVsbC4gIFRoZVxuICogICAgIGxpbmUgbnVtYmVyIGlzIDEtYmFzZWQuIFxuICogICAtIGNvbHVtbjogVGhlIGNvbHVtbiBudW1iZXIgaW4gdGhlIGdlbmVyYXRlZCBzb3VyY2UsIG9yIG51bGwuXG4gKiAgICAgVGhlIGNvbHVtbiBudW1iZXIgaXMgMC1iYXNlZC5cbiAqL1xuSW5kZXhlZFNvdXJjZU1hcENvbnN1bWVyLnByb3RvdHlwZS5nZW5lcmF0ZWRQb3NpdGlvbkZvciA9XG4gIGZ1bmN0aW9uIEluZGV4ZWRTb3VyY2VNYXBDb25zdW1lcl9nZW5lcmF0ZWRQb3NpdGlvbkZvcihhQXJncykge1xuICAgIGZvciAodmFyIGkgPSAwOyBpIDwgdGhpcy5fc2VjdGlvbnMubGVuZ3RoOyBpKyspIHtcbiAgICAgIHZhciBzZWN0aW9uID0gdGhpcy5fc2VjdGlvbnNbaV07XG5cbiAgICAgIC8vIE9ubHkgY29uc2lkZXIgdGhpcyBzZWN0aW9uIGlmIHRoZSByZXF1ZXN0ZWQgc291cmNlIGlzIGluIHRoZSBsaXN0IG9mXG4gICAgICAvLyBzb3VyY2VzIG9mIHRoZSBjb25zdW1lci5cbiAgICAgIGlmIChzZWN0aW9uLmNvbnN1bWVyLl9maW5kU291cmNlSW5kZXgodXRpbC5nZXRBcmcoYUFyZ3MsICdzb3VyY2UnKSkgPT09IC0xKSB7XG4gICAgICAgIGNvbnRpbnVlO1xuICAgICAgfVxuICAgICAgdmFyIGdlbmVyYXRlZFBvc2l0aW9uID0gc2VjdGlvbi5jb25zdW1lci5nZW5lcmF0ZWRQb3NpdGlvbkZvcihhQXJncyk7XG4gICAgICBpZiAoZ2VuZXJhdGVkUG9zaXRpb24pIHtcbiAgICAgICAgdmFyIHJldCA9IHtcbiAgICAgICAgICBsaW5lOiBnZW5lcmF0ZWRQb3NpdGlvbi5saW5lICtcbiAgICAgICAgICAgIChzZWN0aW9uLmdlbmVyYXRlZE9mZnNldC5nZW5lcmF0ZWRMaW5lIC0gMSksXG4gICAgICAgICAgY29sdW1uOiBnZW5lcmF0ZWRQb3NpdGlvbi5jb2x1bW4gK1xuICAgICAgICAgICAgKHNlY3Rpb24uZ2VuZXJhdGVkT2Zmc2V0LmdlbmVyYXRlZExpbmUgPT09IGdlbmVyYXRlZFBvc2l0aW9uLmxpbmVcbiAgICAgICAgICAgICA/IHNlY3Rpb24uZ2VuZXJhdGVkT2Zmc2V0LmdlbmVyYXRlZENvbHVtbiAtIDFcbiAgICAgICAgICAgICA6IDApXG4gICAgICAgIH07XG4gICAgICAgIHJldHVybiByZXQ7XG4gICAgICB9XG4gICAgfVxuXG4gICAgcmV0dXJuIHtcbiAgICAgIGxpbmU6IG51bGwsXG4gICAgICBjb2x1bW46IG51bGxcbiAgICB9O1xuICB9O1xuXG4vKipcbiAqIFBhcnNlIHRoZSBtYXBwaW5ncyBpbiBhIHN0cmluZyBpbiB0byBhIGRhdGEgc3RydWN0dXJlIHdoaWNoIHdlIGNhbiBlYXNpbHlcbiAqIHF1ZXJ5ICh0aGUgb3JkZXJlZCBhcnJheXMgaW4gdGhlIGB0aGlzLl9fZ2VuZXJhdGVkTWFwcGluZ3NgIGFuZFxuICogYHRoaXMuX19vcmlnaW5hbE1hcHBpbmdzYCBwcm9wZXJ0aWVzKS5cbiAqL1xuSW5kZXhlZFNvdXJjZU1hcENvbnN1bWVyLnByb3RvdHlwZS5fcGFyc2VNYXBwaW5ncyA9XG4gIGZ1bmN0aW9uIEluZGV4ZWRTb3VyY2VNYXBDb25zdW1lcl9wYXJzZU1hcHBpbmdzKGFTdHIsIGFTb3VyY2VSb290KSB7XG4gICAgdGhpcy5fX2dlbmVyYXRlZE1hcHBpbmdzID0gW107XG4gICAgdGhpcy5fX29yaWdpbmFsTWFwcGluZ3MgPSBbXTtcbiAgICBmb3IgKHZhciBpID0gMDsgaSA8IHRoaXMuX3NlY3Rpb25zLmxlbmd0aDsgaSsrKSB7XG4gICAgICB2YXIgc2VjdGlvbiA9IHRoaXMuX3NlY3Rpb25zW2ldO1xuICAgICAgdmFyIHNlY3Rpb25NYXBwaW5ncyA9IHNlY3Rpb24uY29uc3VtZXIuX2dlbmVyYXRlZE1hcHBpbmdzO1xuICAgICAgZm9yICh2YXIgaiA9IDA7IGogPCBzZWN0aW9uTWFwcGluZ3MubGVuZ3RoOyBqKyspIHtcbiAgICAgICAgdmFyIG1hcHBpbmcgPSBzZWN0aW9uTWFwcGluZ3Nbal07XG5cbiAgICAgICAgdmFyIHNvdXJjZSA9IHNlY3Rpb24uY29uc3VtZXIuX3NvdXJjZXMuYXQobWFwcGluZy5zb3VyY2UpO1xuICAgICAgICBzb3VyY2UgPSB1dGlsLmNvbXB1dGVTb3VyY2VVUkwoc2VjdGlvbi5jb25zdW1lci5zb3VyY2VSb290LCBzb3VyY2UsIHRoaXMuX3NvdXJjZU1hcFVSTCk7XG4gICAgICAgIHRoaXMuX3NvdXJjZXMuYWRkKHNvdXJjZSk7XG4gICAgICAgIHNvdXJjZSA9IHRoaXMuX3NvdXJjZXMuaW5kZXhPZihzb3VyY2UpO1xuXG4gICAgICAgIHZhciBuYW1lID0gbnVsbDtcbiAgICAgICAgaWYgKG1hcHBpbmcubmFtZSkge1xuICAgICAgICAgIG5hbWUgPSBzZWN0aW9uLmNvbnN1bWVyLl9uYW1lcy5hdChtYXBwaW5nLm5hbWUpO1xuICAgICAgICAgIHRoaXMuX25hbWVzLmFkZChuYW1lKTtcbiAgICAgICAgICBuYW1lID0gdGhpcy5fbmFtZXMuaW5kZXhPZihuYW1lKTtcbiAgICAgICAgfVxuXG4gICAgICAgIC8vIFRoZSBtYXBwaW5ncyBjb21pbmcgZnJvbSB0aGUgY29uc3VtZXIgZm9yIHRoZSBzZWN0aW9uIGhhdmVcbiAgICAgICAgLy8gZ2VuZXJhdGVkIHBvc2l0aW9ucyByZWxhdGl2ZSB0byB0aGUgc3RhcnQgb2YgdGhlIHNlY3Rpb24sIHNvIHdlXG4gICAgICAgIC8vIG5lZWQgdG8gb2Zmc2V0IHRoZW0gdG8gYmUgcmVsYXRpdmUgdG8gdGhlIHN0YXJ0IG9mIHRoZSBjb25jYXRlbmF0ZWRcbiAgICAgICAgLy8gZ2VuZXJhdGVkIGZpbGUuXG4gICAgICAgIHZhciBhZGp1c3RlZE1hcHBpbmcgPSB7XG4gICAgICAgICAgc291cmNlOiBzb3VyY2UsXG4gICAgICAgICAgZ2VuZXJhdGVkTGluZTogbWFwcGluZy5nZW5lcmF0ZWRMaW5lICtcbiAgICAgICAgICAgIChzZWN0aW9uLmdlbmVyYXRlZE9mZnNldC5nZW5lcmF0ZWRMaW5lIC0gMSksXG4gICAgICAgICAgZ2VuZXJhdGVkQ29sdW1uOiBtYXBwaW5nLmdlbmVyYXRlZENvbHVtbiArXG4gICAgICAgICAgICAoc2VjdGlvbi5nZW5lcmF0ZWRPZmZzZXQuZ2VuZXJhdGVkTGluZSA9PT0gbWFwcGluZy5nZW5lcmF0ZWRMaW5lXG4gICAgICAgICAgICA/IHNlY3Rpb24uZ2VuZXJhdGVkT2Zmc2V0LmdlbmVyYXRlZENvbHVtbiAtIDFcbiAgICAgICAgICAgIDogMCksXG4gICAgICAgICAgb3JpZ2luYWxMaW5lOiBtYXBwaW5nLm9yaWdpbmFsTGluZSxcbiAgICAgICAgICBvcmlnaW5hbENvbHVtbjogbWFwcGluZy5vcmlnaW5hbENvbHVtbixcbiAgICAgICAgICBuYW1lOiBuYW1lXG4gICAgICAgIH07XG5cbiAgICAgICAgdGhpcy5fX2dlbmVyYXRlZE1hcHBpbmdzLnB1c2goYWRqdXN0ZWRNYXBwaW5nKTtcbiAgICAgICAgaWYgKHR5cGVvZiBhZGp1c3RlZE1hcHBpbmcub3JpZ2luYWxMaW5lID09PSAnbnVtYmVyJykge1xuICAgICAgICAgIHRoaXMuX19vcmlnaW5hbE1hcHBpbmdzLnB1c2goYWRqdXN0ZWRNYXBwaW5nKTtcbiAgICAgICAgfVxuICAgICAgfVxuICAgIH1cblxuICAgIHF1aWNrU29ydCh0aGlzLl9fZ2VuZXJhdGVkTWFwcGluZ3MsIHV0aWwuY29tcGFyZUJ5R2VuZXJhdGVkUG9zaXRpb25zRGVmbGF0ZWQpO1xuICAgIHF1aWNrU29ydCh0aGlzLl9fb3JpZ2luYWxNYXBwaW5ncywgdXRpbC5jb21wYXJlQnlPcmlnaW5hbFBvc2l0aW9ucyk7XG4gIH07XG5cbmV4cG9ydHMuSW5kZXhlZFNvdXJjZU1hcENvbnN1bWVyID0gSW5kZXhlZFNvdXJjZU1hcENvbnN1bWVyO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9saWIvc291cmNlLW1hcC1jb25zdW1lci5qc1xuLy8gbW9kdWxlIGlkID0gN1xuLy8gbW9kdWxlIGNodW5rcyA9IDAiLCIvKiAtKi0gTW9kZToganM7IGpzLWluZGVudC1sZXZlbDogMjsgLSotICovXG4vKlxuICogQ29weXJpZ2h0IDIwMTEgTW96aWxsYSBGb3VuZGF0aW9uIGFuZCBjb250cmlidXRvcnNcbiAqIExpY2Vuc2VkIHVuZGVyIHRoZSBOZXcgQlNEIGxpY2Vuc2UuIFNlZSBMSUNFTlNFIG9yOlxuICogaHR0cDovL29wZW5zb3VyY2Uub3JnL2xpY2Vuc2VzL0JTRC0zLUNsYXVzZVxuICovXG5cbmV4cG9ydHMuR1JFQVRFU1RfTE9XRVJfQk9VTkQgPSAxO1xuZXhwb3J0cy5MRUFTVF9VUFBFUl9CT1VORCA9IDI7XG5cbi8qKlxuICogUmVjdXJzaXZlIGltcGxlbWVudGF0aW9uIG9mIGJpbmFyeSBzZWFyY2guXG4gKlxuICogQHBhcmFtIGFMb3cgSW5kaWNlcyBoZXJlIGFuZCBsb3dlciBkbyBub3QgY29udGFpbiB0aGUgbmVlZGxlLlxuICogQHBhcmFtIGFIaWdoIEluZGljZXMgaGVyZSBhbmQgaGlnaGVyIGRvIG5vdCBjb250YWluIHRoZSBuZWVkbGUuXG4gKiBAcGFyYW0gYU5lZWRsZSBUaGUgZWxlbWVudCBiZWluZyBzZWFyY2hlZCBmb3IuXG4gKiBAcGFyYW0gYUhheXN0YWNrIFRoZSBub24tZW1wdHkgYXJyYXkgYmVpbmcgc2VhcmNoZWQuXG4gKiBAcGFyYW0gYUNvbXBhcmUgRnVuY3Rpb24gd2hpY2ggdGFrZXMgdHdvIGVsZW1lbnRzIGFuZCByZXR1cm5zIC0xLCAwLCBvciAxLlxuICogQHBhcmFtIGFCaWFzIEVpdGhlciAnYmluYXJ5U2VhcmNoLkdSRUFURVNUX0xPV0VSX0JPVU5EJyBvclxuICogICAgICdiaW5hcnlTZWFyY2guTEVBU1RfVVBQRVJfQk9VTkQnLiBTcGVjaWZpZXMgd2hldGhlciB0byByZXR1cm4gdGhlXG4gKiAgICAgY2xvc2VzdCBlbGVtZW50IHRoYXQgaXMgc21hbGxlciB0aGFuIG9yIGdyZWF0ZXIgdGhhbiB0aGUgb25lIHdlIGFyZVxuICogICAgIHNlYXJjaGluZyBmb3IsIHJlc3BlY3RpdmVseSwgaWYgdGhlIGV4YWN0IGVsZW1lbnQgY2Fubm90IGJlIGZvdW5kLlxuICovXG5mdW5jdGlvbiByZWN1cnNpdmVTZWFyY2goYUxvdywgYUhpZ2gsIGFOZWVkbGUsIGFIYXlzdGFjaywgYUNvbXBhcmUsIGFCaWFzKSB7XG4gIC8vIFRoaXMgZnVuY3Rpb24gdGVybWluYXRlcyB3aGVuIG9uZSBvZiB0aGUgZm9sbG93aW5nIGlzIHRydWU6XG4gIC8vXG4gIC8vICAgMS4gV2UgZmluZCB0aGUgZXhhY3QgZWxlbWVudCB3ZSBhcmUgbG9va2luZyBmb3IuXG4gIC8vXG4gIC8vICAgMi4gV2UgZGlkIG5vdCBmaW5kIHRoZSBleGFjdCBlbGVtZW50LCBidXQgd2UgY2FuIHJldHVybiB0aGUgaW5kZXggb2ZcbiAgLy8gICAgICB0aGUgbmV4dC1jbG9zZXN0IGVsZW1lbnQuXG4gIC8vXG4gIC8vICAgMy4gV2UgZGlkIG5vdCBmaW5kIHRoZSBleGFjdCBlbGVtZW50LCBhbmQgdGhlcmUgaXMgbm8gbmV4dC1jbG9zZXN0XG4gIC8vICAgICAgZWxlbWVudCB0aGFuIHRoZSBvbmUgd2UgYXJlIHNlYXJjaGluZyBmb3IsIHNvIHdlIHJldHVybiAtMS5cbiAgdmFyIG1pZCA9IE1hdGguZmxvb3IoKGFIaWdoIC0gYUxvdykgLyAyKSArIGFMb3c7XG4gIHZhciBjbXAgPSBhQ29tcGFyZShhTmVlZGxlLCBhSGF5c3RhY2tbbWlkXSwgdHJ1ZSk7XG4gIGlmIChjbXAgPT09IDApIHtcbiAgICAvLyBGb3VuZCB0aGUgZWxlbWVudCB3ZSBhcmUgbG9va2luZyBmb3IuXG4gICAgcmV0dXJuIG1pZDtcbiAgfVxuICBlbHNlIGlmIChjbXAgPiAwKSB7XG4gICAgLy8gT3VyIG5lZWRsZSBpcyBncmVhdGVyIHRoYW4gYUhheXN0YWNrW21pZF0uXG4gICAgaWYgKGFIaWdoIC0gbWlkID4gMSkge1xuICAgICAgLy8gVGhlIGVsZW1lbnQgaXMgaW4gdGhlIHVwcGVyIGhhbGYuXG4gICAgICByZXR1cm4gcmVjdXJzaXZlU2VhcmNoKG1pZCwgYUhpZ2gsIGFOZWVkbGUsIGFIYXlzdGFjaywgYUNvbXBhcmUsIGFCaWFzKTtcbiAgICB9XG5cbiAgICAvLyBUaGUgZXhhY3QgbmVlZGxlIGVsZW1lbnQgd2FzIG5vdCBmb3VuZCBpbiB0aGlzIGhheXN0YWNrLiBEZXRlcm1pbmUgaWZcbiAgICAvLyB3ZSBhcmUgaW4gdGVybWluYXRpb24gY2FzZSAoMykgb3IgKDIpIGFuZCByZXR1cm4gdGhlIGFwcHJvcHJpYXRlIHRoaW5nLlxuICAgIGlmIChhQmlhcyA9PSBleHBvcnRzLkxFQVNUX1VQUEVSX0JPVU5EKSB7XG4gICAgICByZXR1cm4gYUhpZ2ggPCBhSGF5c3RhY2subGVuZ3RoID8gYUhpZ2ggOiAtMTtcbiAgICB9IGVsc2Uge1xuICAgICAgcmV0dXJuIG1pZDtcbiAgICB9XG4gIH1cbiAgZWxzZSB7XG4gICAgLy8gT3VyIG5lZWRsZSBpcyBsZXNzIHRoYW4gYUhheXN0YWNrW21pZF0uXG4gICAgaWYgKG1pZCAtIGFMb3cgPiAxKSB7XG4gICAgICAvLyBUaGUgZWxlbWVudCBpcyBpbiB0aGUgbG93ZXIgaGFsZi5cbiAgICAgIHJldHVybiByZWN1cnNpdmVTZWFyY2goYUxvdywgbWlkLCBhTmVlZGxlLCBhSGF5c3RhY2ssIGFDb21wYXJlLCBhQmlhcyk7XG4gICAgfVxuXG4gICAgLy8gd2UgYXJlIGluIHRlcm1pbmF0aW9uIGNhc2UgKDMpIG9yICgyKSBhbmQgcmV0dXJuIHRoZSBhcHByb3ByaWF0ZSB0aGluZy5cbiAgICBpZiAoYUJpYXMgPT0gZXhwb3J0cy5MRUFTVF9VUFBFUl9CT1VORCkge1xuICAgICAgcmV0dXJuIG1pZDtcbiAgICB9IGVsc2Uge1xuICAgICAgcmV0dXJuIGFMb3cgPCAwID8gLTEgOiBhTG93O1xuICAgIH1cbiAgfVxufVxuXG4vKipcbiAqIFRoaXMgaXMgYW4gaW1wbGVtZW50YXRpb24gb2YgYmluYXJ5IHNlYXJjaCB3aGljaCB3aWxsIGFsd2F5cyB0cnkgYW5kIHJldHVyblxuICogdGhlIGluZGV4IG9mIHRoZSBjbG9zZXN0IGVsZW1lbnQgaWYgdGhlcmUgaXMgbm8gZXhhY3QgaGl0LiBUaGlzIGlzIGJlY2F1c2VcbiAqIG1hcHBpbmdzIGJldHdlZW4gb3JpZ2luYWwgYW5kIGdlbmVyYXRlZCBsaW5lL2NvbCBwYWlycyBhcmUgc2luZ2xlIHBvaW50cyxcbiAqIGFuZCB0aGVyZSBpcyBhbiBpbXBsaWNpdCByZWdpb24gYmV0d2VlbiBlYWNoIG9mIHRoZW0sIHNvIGEgbWlzcyBqdXN0IG1lYW5zXG4gKiB0aGF0IHlvdSBhcmVuJ3Qgb24gdGhlIHZlcnkgc3RhcnQgb2YgYSByZWdpb24uXG4gKlxuICogQHBhcmFtIGFOZWVkbGUgVGhlIGVsZW1lbnQgeW91IGFyZSBsb29raW5nIGZvci5cbiAqIEBwYXJhbSBhSGF5c3RhY2sgVGhlIGFycmF5IHRoYXQgaXMgYmVpbmcgc2VhcmNoZWQuXG4gKiBAcGFyYW0gYUNvbXBhcmUgQSBmdW5jdGlvbiB3aGljaCB0YWtlcyB0aGUgbmVlZGxlIGFuZCBhbiBlbGVtZW50IGluIHRoZVxuICogICAgIGFycmF5IGFuZCByZXR1cm5zIC0xLCAwLCBvciAxIGRlcGVuZGluZyBvbiB3aGV0aGVyIHRoZSBuZWVkbGUgaXMgbGVzc1xuICogICAgIHRoYW4sIGVxdWFsIHRvLCBvciBncmVhdGVyIHRoYW4gdGhlIGVsZW1lbnQsIHJlc3BlY3RpdmVseS5cbiAqIEBwYXJhbSBhQmlhcyBFaXRoZXIgJ2JpbmFyeVNlYXJjaC5HUkVBVEVTVF9MT1dFUl9CT1VORCcgb3JcbiAqICAgICAnYmluYXJ5U2VhcmNoLkxFQVNUX1VQUEVSX0JPVU5EJy4gU3BlY2lmaWVzIHdoZXRoZXIgdG8gcmV0dXJuIHRoZVxuICogICAgIGNsb3Nlc3QgZWxlbWVudCB0aGF0IGlzIHNtYWxsZXIgdGhhbiBvciBncmVhdGVyIHRoYW4gdGhlIG9uZSB3ZSBhcmVcbiAqICAgICBzZWFyY2hpbmcgZm9yLCByZXNwZWN0aXZlbHksIGlmIHRoZSBleGFjdCBlbGVtZW50IGNhbm5vdCBiZSBmb3VuZC5cbiAqICAgICBEZWZhdWx0cyB0byAnYmluYXJ5U2VhcmNoLkdSRUFURVNUX0xPV0VSX0JPVU5EJy5cbiAqL1xuZXhwb3J0cy5zZWFyY2ggPSBmdW5jdGlvbiBzZWFyY2goYU5lZWRsZSwgYUhheXN0YWNrLCBhQ29tcGFyZSwgYUJpYXMpIHtcbiAgaWYgKGFIYXlzdGFjay5sZW5ndGggPT09IDApIHtcbiAgICByZXR1cm4gLTE7XG4gIH1cblxuICB2YXIgaW5kZXggPSByZWN1cnNpdmVTZWFyY2goLTEsIGFIYXlzdGFjay5sZW5ndGgsIGFOZWVkbGUsIGFIYXlzdGFjayxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFDb21wYXJlLCBhQmlhcyB8fCBleHBvcnRzLkdSRUFURVNUX0xPV0VSX0JPVU5EKTtcbiAgaWYgKGluZGV4IDwgMCkge1xuICAgIHJldHVybiAtMTtcbiAgfVxuXG4gIC8vIFdlIGhhdmUgZm91bmQgZWl0aGVyIHRoZSBleGFjdCBlbGVtZW50LCBvciB0aGUgbmV4dC1jbG9zZXN0IGVsZW1lbnQgdGhhblxuICAvLyB0aGUgb25lIHdlIGFyZSBzZWFyY2hpbmcgZm9yLiBIb3dldmVyLCB0aGVyZSBtYXkgYmUgbW9yZSB0aGFuIG9uZSBzdWNoXG4gIC8vIGVsZW1lbnQuIE1ha2Ugc3VyZSB3ZSBhbHdheXMgcmV0dXJuIHRoZSBzbWFsbGVzdCBvZiB0aGVzZS5cbiAgd2hpbGUgKGluZGV4IC0gMSA+PSAwKSB7XG4gICAgaWYgKGFDb21wYXJlKGFIYXlzdGFja1tpbmRleF0sIGFIYXlzdGFja1tpbmRleCAtIDFdLCB0cnVlKSAhPT0gMCkge1xuICAgICAgYnJlYWs7XG4gICAgfVxuICAgIC0taW5kZXg7XG4gIH1cblxuICByZXR1cm4gaW5kZXg7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9saWIvYmluYXJ5LXNlYXJjaC5qc1xuLy8gbW9kdWxlIGlkID0gOFxuLy8gbW9kdWxlIGNodW5rcyA9IDAiLCIvKiAtKi0gTW9kZToganM7IGpzLWluZGVudC1sZXZlbDogMjsgLSotICovXG4vKlxuICogQ29weXJpZ2h0IDIwMTEgTW96aWxsYSBGb3VuZGF0aW9uIGFuZCBjb250cmlidXRvcnNcbiAqIExpY2Vuc2VkIHVuZGVyIHRoZSBOZXcgQlNEIGxpY2Vuc2UuIFNlZSBMSUNFTlNFIG9yOlxuICogaHR0cDovL29wZW5zb3VyY2Uub3JnL2xpY2Vuc2VzL0JTRC0zLUNsYXVzZVxuICovXG5cbi8vIEl0IHR1cm5zIG91dCB0aGF0IHNvbWUgKG1vc3Q/KSBKYXZhU2NyaXB0IGVuZ2luZXMgZG9uJ3Qgc2VsZi1ob3N0XG4vLyBgQXJyYXkucHJvdG90eXBlLnNvcnRgLiBUaGlzIG1ha2VzIHNlbnNlIGJlY2F1c2UgQysrIHdpbGwgbGlrZWx5IHJlbWFpblxuLy8gZmFzdGVyIHRoYW4gSlMgd2hlbiBkb2luZyByYXcgQ1BVLWludGVuc2l2ZSBzb3J0aW5nLiBIb3dldmVyLCB3aGVuIHVzaW5nIGFcbi8vIGN1c3RvbSBjb21wYXJhdG9yIGZ1bmN0aW9uLCBjYWxsaW5nIGJhY2sgYW5kIGZvcnRoIGJldHdlZW4gdGhlIFZNJ3MgQysrIGFuZFxuLy8gSklUJ2QgSlMgaXMgcmF0aGVyIHNsb3cgKmFuZCogbG9zZXMgSklUIHR5cGUgaW5mb3JtYXRpb24sIHJlc3VsdGluZyBpblxuLy8gd29yc2UgZ2VuZXJhdGVkIGNvZGUgZm9yIHRoZSBjb21wYXJhdG9yIGZ1bmN0aW9uIHRoYW4gd291bGQgYmUgb3B0aW1hbC4gSW5cbi8vIGZhY3QsIHdoZW4gc29ydGluZyB3aXRoIGEgY29tcGFyYXRvciwgdGhlc2UgY29zdHMgb3V0d2VpZ2ggdGhlIGJlbmVmaXRzIG9mXG4vLyBzb3J0aW5nIGluIEMrKy4gQnkgdXNpbmcgb3VyIG93biBKUy1pbXBsZW1lbnRlZCBRdWljayBTb3J0IChiZWxvdyksIHdlIGdldFxuLy8gYSB+MzUwMG1zIG1lYW4gc3BlZWQtdXAgaW4gYGJlbmNoL2JlbmNoLmh0bWxgLlxuXG4vKipcbiAqIFN3YXAgdGhlIGVsZW1lbnRzIGluZGV4ZWQgYnkgYHhgIGFuZCBgeWAgaW4gdGhlIGFycmF5IGBhcnlgLlxuICpcbiAqIEBwYXJhbSB7QXJyYXl9IGFyeVxuICogICAgICAgIFRoZSBhcnJheS5cbiAqIEBwYXJhbSB7TnVtYmVyfSB4XG4gKiAgICAgICAgVGhlIGluZGV4IG9mIHRoZSBmaXJzdCBpdGVtLlxuICogQHBhcmFtIHtOdW1iZXJ9IHlcbiAqICAgICAgICBUaGUgaW5kZXggb2YgdGhlIHNlY29uZCBpdGVtLlxuICovXG5mdW5jdGlvbiBzd2FwKGFyeSwgeCwgeSkge1xuICB2YXIgdGVtcCA9IGFyeVt4XTtcbiAgYXJ5W3hdID0gYXJ5W3ldO1xuICBhcnlbeV0gPSB0ZW1wO1xufVxuXG4vKipcbiAqIFJldHVybnMgYSByYW5kb20gaW50ZWdlciB3aXRoaW4gdGhlIHJhbmdlIGBsb3cgLi4gaGlnaGAgaW5jbHVzaXZlLlxuICpcbiAqIEBwYXJhbSB7TnVtYmVyfSBsb3dcbiAqICAgICAgICBUaGUgbG93ZXIgYm91bmQgb24gdGhlIHJhbmdlLlxuICogQHBhcmFtIHtOdW1iZXJ9IGhpZ2hcbiAqICAgICAgICBUaGUgdXBwZXIgYm91bmQgb24gdGhlIHJhbmdlLlxuICovXG5mdW5jdGlvbiByYW5kb21JbnRJblJhbmdlKGxvdywgaGlnaCkge1xuICByZXR1cm4gTWF0aC5yb3VuZChsb3cgKyAoTWF0aC5yYW5kb20oKSAqIChoaWdoIC0gbG93KSkpO1xufVxuXG4vKipcbiAqIFRoZSBRdWljayBTb3J0IGFsZ29yaXRobS5cbiAqXG4gKiBAcGFyYW0ge0FycmF5fSBhcnlcbiAqICAgICAgICBBbiBhcnJheSB0byBzb3J0LlxuICogQHBhcmFtIHtmdW5jdGlvbn0gY29tcGFyYXRvclxuICogICAgICAgIEZ1bmN0aW9uIHRvIHVzZSB0byBjb21wYXJlIHR3byBpdGVtcy5cbiAqIEBwYXJhbSB7TnVtYmVyfSBwXG4gKiAgICAgICAgU3RhcnQgaW5kZXggb2YgdGhlIGFycmF5XG4gKiBAcGFyYW0ge051bWJlcn0gclxuICogICAgICAgIEVuZCBpbmRleCBvZiB0aGUgYXJyYXlcbiAqL1xuZnVuY3Rpb24gZG9RdWlja1NvcnQoYXJ5LCBjb21wYXJhdG9yLCBwLCByKSB7XG4gIC8vIElmIG91ciBsb3dlciBib3VuZCBpcyBsZXNzIHRoYW4gb3VyIHVwcGVyIGJvdW5kLCB3ZSAoMSkgcGFydGl0aW9uIHRoZVxuICAvLyBhcnJheSBpbnRvIHR3byBwaWVjZXMgYW5kICgyKSByZWN1cnNlIG9uIGVhY2ggaGFsZi4gSWYgaXQgaXMgbm90LCB0aGlzIGlzXG4gIC8vIHRoZSBlbXB0eSBhcnJheSBhbmQgb3VyIGJhc2UgY2FzZS5cblxuICBpZiAocCA8IHIpIHtcbiAgICAvLyAoMSkgUGFydGl0aW9uaW5nLlxuICAgIC8vXG4gICAgLy8gVGhlIHBhcnRpdGlvbmluZyBjaG9vc2VzIGEgcGl2b3QgYmV0d2VlbiBgcGAgYW5kIGByYCBhbmQgbW92ZXMgYWxsXG4gICAgLy8gZWxlbWVudHMgdGhhdCBhcmUgbGVzcyB0aGFuIG9yIGVxdWFsIHRvIHRoZSBwaXZvdCB0byB0aGUgYmVmb3JlIGl0LCBhbmRcbiAgICAvLyBhbGwgdGhlIGVsZW1lbnRzIHRoYXQgYXJlIGdyZWF0ZXIgdGhhbiBpdCBhZnRlciBpdC4gVGhlIGVmZmVjdCBpcyB0aGF0XG4gICAgLy8gb25jZSBwYXJ0aXRpb24gaXMgZG9uZSwgdGhlIHBpdm90IGlzIGluIHRoZSBleGFjdCBwbGFjZSBpdCB3aWxsIGJlIHdoZW5cbiAgICAvLyB0aGUgYXJyYXkgaXMgcHV0IGluIHNvcnRlZCBvcmRlciwgYW5kIGl0IHdpbGwgbm90IG5lZWQgdG8gYmUgbW92ZWRcbiAgICAvLyBhZ2Fpbi4gVGhpcyBydW5zIGluIE8obikgdGltZS5cblxuICAgIC8vIEFsd2F5cyBjaG9vc2UgYSByYW5kb20gcGl2b3Qgc28gdGhhdCBhbiBpbnB1dCBhcnJheSB3aGljaCBpcyByZXZlcnNlXG4gICAgLy8gc29ydGVkIGRvZXMgbm90IGNhdXNlIE8obl4yKSBydW5uaW5nIHRpbWUuXG4gICAgdmFyIHBpdm90SW5kZXggPSByYW5kb21JbnRJblJhbmdlKHAsIHIpO1xuICAgIHZhciBpID0gcCAtIDE7XG5cbiAgICBzd2FwKGFyeSwgcGl2b3RJbmRleCwgcik7XG4gICAgdmFyIHBpdm90ID0gYXJ5W3JdO1xuXG4gICAgLy8gSW1tZWRpYXRlbHkgYWZ0ZXIgYGpgIGlzIGluY3JlbWVudGVkIGluIHRoaXMgbG9vcCwgdGhlIGZvbGxvd2luZyBob2xkXG4gICAgLy8gdHJ1ZTpcbiAgICAvL1xuICAgIC8vICAgKiBFdmVyeSBlbGVtZW50IGluIGBhcnlbcCAuLiBpXWAgaXMgbGVzcyB0aGFuIG9yIGVxdWFsIHRvIHRoZSBwaXZvdC5cbiAgICAvL1xuICAgIC8vICAgKiBFdmVyeSBlbGVtZW50IGluIGBhcnlbaSsxIC4uIGotMV1gIGlzIGdyZWF0ZXIgdGhhbiB0aGUgcGl2b3QuXG4gICAgZm9yICh2YXIgaiA9IHA7IGogPCByOyBqKyspIHtcbiAgICAgIGlmIChjb21wYXJhdG9yKGFyeVtqXSwgcGl2b3QpIDw9IDApIHtcbiAgICAgICAgaSArPSAxO1xuICAgICAgICBzd2FwKGFyeSwgaSwgaik7XG4gICAgICB9XG4gICAgfVxuXG4gICAgc3dhcChhcnksIGkgKyAxLCBqKTtcbiAgICB2YXIgcSA9IGkgKyAxO1xuXG4gICAgLy8gKDIpIFJlY3Vyc2Ugb24gZWFjaCBoYWxmLlxuXG4gICAgZG9RdWlja1NvcnQoYXJ5LCBjb21wYXJhdG9yLCBwLCBxIC0gMSk7XG4gICAgZG9RdWlja1NvcnQoYXJ5LCBjb21wYXJhdG9yLCBxICsgMSwgcik7XG4gIH1cbn1cblxuLyoqXG4gKiBTb3J0IHRoZSBnaXZlbiBhcnJheSBpbi1wbGFjZSB3aXRoIHRoZSBnaXZlbiBjb21wYXJhdG9yIGZ1bmN0aW9uLlxuICpcbiAqIEBwYXJhbSB7QXJyYXl9IGFyeVxuICogICAgICAgIEFuIGFycmF5IHRvIHNvcnQuXG4gKiBAcGFyYW0ge2Z1bmN0aW9ufSBjb21wYXJhdG9yXG4gKiAgICAgICAgRnVuY3Rpb24gdG8gdXNlIHRvIGNvbXBhcmUgdHdvIGl0ZW1zLlxuICovXG5leHBvcnRzLnF1aWNrU29ydCA9IGZ1bmN0aW9uIChhcnksIGNvbXBhcmF0b3IpIHtcbiAgZG9RdWlja1NvcnQoYXJ5LCBjb21wYXJhdG9yLCAwLCBhcnkubGVuZ3RoIC0gMSk7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9saWIvcXVpY2stc29ydC5qc1xuLy8gbW9kdWxlIGlkID0gOVxuLy8gbW9kdWxlIGNodW5rcyA9IDAiLCIvKiAtKi0gTW9kZToganM7IGpzLWluZGVudC1sZXZlbDogMjsgLSotICovXG4vKlxuICogQ29weXJpZ2h0IDIwMTEgTW96aWxsYSBGb3VuZGF0aW9uIGFuZCBjb250cmlidXRvcnNcbiAqIExpY2Vuc2VkIHVuZGVyIHRoZSBOZXcgQlNEIGxpY2Vuc2UuIFNlZSBMSUNFTlNFIG9yOlxuICogaHR0cDovL29wZW5zb3VyY2Uub3JnL2xpY2Vuc2VzL0JTRC0zLUNsYXVzZVxuICovXG5cbnZhciBTb3VyY2VNYXBHZW5lcmF0b3IgPSByZXF1aXJlKCcuL3NvdXJjZS1tYXAtZ2VuZXJhdG9yJykuU291cmNlTWFwR2VuZXJhdG9yO1xudmFyIHV0aWwgPSByZXF1aXJlKCcuL3V0aWwnKTtcblxuLy8gTWF0Y2hlcyBhIFdpbmRvd3Mtc3R5bGUgYFxcclxcbmAgbmV3bGluZSBvciBhIGBcXG5gIG5ld2xpbmUgdXNlZCBieSBhbGwgb3RoZXJcbi8vIG9wZXJhdGluZyBzeXN0ZW1zIHRoZXNlIGRheXMgKGNhcHR1cmluZyB0aGUgcmVzdWx0KS5cbnZhciBSRUdFWF9ORVdMSU5FID0gLyhcXHI/XFxuKS87XG5cbi8vIE5ld2xpbmUgY2hhcmFjdGVyIGNvZGUgZm9yIGNoYXJDb2RlQXQoKSBjb21wYXJpc29uc1xudmFyIE5FV0xJTkVfQ09ERSA9IDEwO1xuXG4vLyBQcml2YXRlIHN5bWJvbCBmb3IgaWRlbnRpZnlpbmcgYFNvdXJjZU5vZGVgcyB3aGVuIG11bHRpcGxlIHZlcnNpb25zIG9mXG4vLyB0aGUgc291cmNlLW1hcCBsaWJyYXJ5IGFyZSBsb2FkZWQuIFRoaXMgTVVTVCBOT1QgQ0hBTkdFIGFjcm9zc1xuLy8gdmVyc2lvbnMhXG52YXIgaXNTb3VyY2VOb2RlID0gXCIkJCRpc1NvdXJjZU5vZGUkJCRcIjtcblxuLyoqXG4gKiBTb3VyY2VOb2RlcyBwcm92aWRlIGEgd2F5IHRvIGFic3RyYWN0IG92ZXIgaW50ZXJwb2xhdGluZy9jb25jYXRlbmF0aW5nXG4gKiBzbmlwcGV0cyBvZiBnZW5lcmF0ZWQgSmF2YVNjcmlwdCBzb3VyY2UgY29kZSB3aGlsZSBtYWludGFpbmluZyB0aGUgbGluZSBhbmRcbiAqIGNvbHVtbiBpbmZvcm1hdGlvbiBhc3NvY2lhdGVkIHdpdGggdGhlIG9yaWdpbmFsIHNvdXJjZSBjb2RlLlxuICpcbiAqIEBwYXJhbSBhTGluZSBUaGUgb3JpZ2luYWwgbGluZSBudW1iZXIuXG4gKiBAcGFyYW0gYUNvbHVtbiBUaGUgb3JpZ2luYWwgY29sdW1uIG51bWJlci5cbiAqIEBwYXJhbSBhU291cmNlIFRoZSBvcmlnaW5hbCBzb3VyY2UncyBmaWxlbmFtZS5cbiAqIEBwYXJhbSBhQ2h1bmtzIE9wdGlvbmFsLiBBbiBhcnJheSBvZiBzdHJpbmdzIHdoaWNoIGFyZSBzbmlwcGV0cyBvZlxuICogICAgICAgIGdlbmVyYXRlZCBKUywgb3Igb3RoZXIgU291cmNlTm9kZXMuXG4gKiBAcGFyYW0gYU5hbWUgVGhlIG9yaWdpbmFsIGlkZW50aWZpZXIuXG4gKi9cbmZ1bmN0aW9uIFNvdXJjZU5vZGUoYUxpbmUsIGFDb2x1bW4sIGFTb3VyY2UsIGFDaHVua3MsIGFOYW1lKSB7XG4gIHRoaXMuY2hpbGRyZW4gPSBbXTtcbiAgdGhpcy5zb3VyY2VDb250ZW50cyA9IHt9O1xuICB0aGlzLmxpbmUgPSBhTGluZSA9PSBudWxsID8gbnVsbCA6IGFMaW5lO1xuICB0aGlzLmNvbHVtbiA9IGFDb2x1bW4gPT0gbnVsbCA/IG51bGwgOiBhQ29sdW1uO1xuICB0aGlzLnNvdXJjZSA9IGFTb3VyY2UgPT0gbnVsbCA/IG51bGwgOiBhU291cmNlO1xuICB0aGlzLm5hbWUgPSBhTmFtZSA9PSBudWxsID8gbnVsbCA6IGFOYW1lO1xuICB0aGlzW2lzU291cmNlTm9kZV0gPSB0cnVlO1xuICBpZiAoYUNodW5rcyAhPSBudWxsKSB0aGlzLmFkZChhQ2h1bmtzKTtcbn1cblxuLyoqXG4gKiBDcmVhdGVzIGEgU291cmNlTm9kZSBmcm9tIGdlbmVyYXRlZCBjb2RlIGFuZCBhIFNvdXJjZU1hcENvbnN1bWVyLlxuICpcbiAqIEBwYXJhbSBhR2VuZXJhdGVkQ29kZSBUaGUgZ2VuZXJhdGVkIGNvZGVcbiAqIEBwYXJhbSBhU291cmNlTWFwQ29uc3VtZXIgVGhlIFNvdXJjZU1hcCBmb3IgdGhlIGdlbmVyYXRlZCBjb2RlXG4gKiBAcGFyYW0gYVJlbGF0aXZlUGF0aCBPcHRpb25hbC4gVGhlIHBhdGggdGhhdCByZWxhdGl2ZSBzb3VyY2VzIGluIHRoZVxuICogICAgICAgIFNvdXJjZU1hcENvbnN1bWVyIHNob3VsZCBiZSByZWxhdGl2ZSB0by5cbiAqL1xuU291cmNlTm9kZS5mcm9tU3RyaW5nV2l0aFNvdXJjZU1hcCA9XG4gIGZ1bmN0aW9uIFNvdXJjZU5vZGVfZnJvbVN0cmluZ1dpdGhTb3VyY2VNYXAoYUdlbmVyYXRlZENvZGUsIGFTb3VyY2VNYXBDb25zdW1lciwgYVJlbGF0aXZlUGF0aCkge1xuICAgIC8vIFRoZSBTb3VyY2VOb2RlIHdlIHdhbnQgdG8gZmlsbCB3aXRoIHRoZSBnZW5lcmF0ZWQgY29kZVxuICAgIC8vIGFuZCB0aGUgU291cmNlTWFwXG4gICAgdmFyIG5vZGUgPSBuZXcgU291cmNlTm9kZSgpO1xuXG4gICAgLy8gQWxsIGV2ZW4gaW5kaWNlcyBvZiB0aGlzIGFycmF5IGFyZSBvbmUgbGluZSBvZiB0aGUgZ2VuZXJhdGVkIGNvZGUsXG4gICAgLy8gd2hpbGUgYWxsIG9kZCBpbmRpY2VzIGFyZSB0aGUgbmV3bGluZXMgYmV0d2VlbiB0d28gYWRqYWNlbnQgbGluZXNcbiAgICAvLyAoc2luY2UgYFJFR0VYX05FV0xJTkVgIGNhcHR1cmVzIGl0cyBtYXRjaCkuXG4gICAgLy8gUHJvY2Vzc2VkIGZyYWdtZW50cyBhcmUgYWNjZXNzZWQgYnkgY2FsbGluZyBgc2hpZnROZXh0TGluZWAuXG4gICAgdmFyIHJlbWFpbmluZ0xpbmVzID0gYUdlbmVyYXRlZENvZGUuc3BsaXQoUkVHRVhfTkVXTElORSk7XG4gICAgdmFyIHJlbWFpbmluZ0xpbmVzSW5kZXggPSAwO1xuICAgIHZhciBzaGlmdE5leHRMaW5lID0gZnVuY3Rpb24oKSB7XG4gICAgICB2YXIgbGluZUNvbnRlbnRzID0gZ2V0TmV4dExpbmUoKTtcbiAgICAgIC8vIFRoZSBsYXN0IGxpbmUgb2YgYSBmaWxlIG1pZ2h0IG5vdCBoYXZlIGEgbmV3bGluZS5cbiAgICAgIHZhciBuZXdMaW5lID0gZ2V0TmV4dExpbmUoKSB8fCBcIlwiO1xuICAgICAgcmV0dXJuIGxpbmVDb250ZW50cyArIG5ld0xpbmU7XG5cbiAgICAgIGZ1bmN0aW9uIGdldE5leHRMaW5lKCkge1xuICAgICAgICByZXR1cm4gcmVtYWluaW5nTGluZXNJbmRleCA8IHJlbWFpbmluZ0xpbmVzLmxlbmd0aCA/XG4gICAgICAgICAgICByZW1haW5pbmdMaW5lc1tyZW1haW5pbmdMaW5lc0luZGV4KytdIDogdW5kZWZpbmVkO1xuICAgICAgfVxuICAgIH07XG5cbiAgICAvLyBXZSBuZWVkIHRvIHJlbWVtYmVyIHRoZSBwb3NpdGlvbiBvZiBcInJlbWFpbmluZ0xpbmVzXCJcbiAgICB2YXIgbGFzdEdlbmVyYXRlZExpbmUgPSAxLCBsYXN0R2VuZXJhdGVkQ29sdW1uID0gMDtcblxuICAgIC8vIFRoZSBnZW5lcmF0ZSBTb3VyY2VOb2RlcyB3ZSBuZWVkIGEgY29kZSByYW5nZS5cbiAgICAvLyBUbyBleHRyYWN0IGl0IGN1cnJlbnQgYW5kIGxhc3QgbWFwcGluZyBpcyB1c2VkLlxuICAgIC8vIEhlcmUgd2Ugc3RvcmUgdGhlIGxhc3QgbWFwcGluZy5cbiAgICB2YXIgbGFzdE1hcHBpbmcgPSBudWxsO1xuXG4gICAgYVNvdXJjZU1hcENvbnN1bWVyLmVhY2hNYXBwaW5nKGZ1bmN0aW9uIChtYXBwaW5nKSB7XG4gICAgICBpZiAobGFzdE1hcHBpbmcgIT09IG51bGwpIHtcbiAgICAgICAgLy8gV2UgYWRkIHRoZSBjb2RlIGZyb20gXCJsYXN0TWFwcGluZ1wiIHRvIFwibWFwcGluZ1wiOlxuICAgICAgICAvLyBGaXJzdCBjaGVjayBpZiB0aGVyZSBpcyBhIG5ldyBsaW5lIGluIGJldHdlZW4uXG4gICAgICAgIGlmIChsYXN0R2VuZXJhdGVkTGluZSA8IG1hcHBpbmcuZ2VuZXJhdGVkTGluZSkge1xuICAgICAgICAgIC8vIEFzc29jaWF0ZSBmaXJzdCBsaW5lIHdpdGggXCJsYXN0TWFwcGluZ1wiXG4gICAgICAgICAgYWRkTWFwcGluZ1dpdGhDb2RlKGxhc3RNYXBwaW5nLCBzaGlmdE5leHRMaW5lKCkpO1xuICAgICAgICAgIGxhc3RHZW5lcmF0ZWRMaW5lKys7XG4gICAgICAgICAgbGFzdEdlbmVyYXRlZENvbHVtbiA9IDA7XG4gICAgICAgICAgLy8gVGhlIHJlbWFpbmluZyBjb2RlIGlzIGFkZGVkIHdpdGhvdXQgbWFwcGluZ1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIC8vIFRoZXJlIGlzIG5vIG5ldyBsaW5lIGluIGJldHdlZW4uXG4gICAgICAgICAgLy8gQXNzb2NpYXRlIHRoZSBjb2RlIGJldHdlZW4gXCJsYXN0R2VuZXJhdGVkQ29sdW1uXCIgYW5kXG4gICAgICAgICAgLy8gXCJtYXBwaW5nLmdlbmVyYXRlZENvbHVtblwiIHdpdGggXCJsYXN0TWFwcGluZ1wiXG4gICAgICAgICAgdmFyIG5leHRMaW5lID0gcmVtYWluaW5nTGluZXNbcmVtYWluaW5nTGluZXNJbmRleF0gfHwgJyc7XG4gICAgICAgICAgdmFyIGNvZGUgPSBuZXh0TGluZS5zdWJzdHIoMCwgbWFwcGluZy5nZW5lcmF0ZWRDb2x1bW4gLVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxhc3RHZW5lcmF0ZWRDb2x1bW4pO1xuICAgICAgICAgIHJlbWFpbmluZ0xpbmVzW3JlbWFpbmluZ0xpbmVzSW5kZXhdID0gbmV4dExpbmUuc3Vic3RyKG1hcHBpbmcuZ2VuZXJhdGVkQ29sdW1uIC1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsYXN0R2VuZXJhdGVkQ29sdW1uKTtcbiAgICAgICAgICBsYXN0R2VuZXJhdGVkQ29sdW1uID0gbWFwcGluZy5nZW5lcmF0ZWRDb2x1bW47XG4gICAgICAgICAgYWRkTWFwcGluZ1dpdGhDb2RlKGxhc3RNYXBwaW5nLCBjb2RlKTtcbiAgICAgICAgICAvLyBObyBtb3JlIHJlbWFpbmluZyBjb2RlLCBjb250aW51ZVxuICAgICAgICAgIGxhc3RNYXBwaW5nID0gbWFwcGluZztcbiAgICAgICAgICByZXR1cm47XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICAgIC8vIFdlIGFkZCB0aGUgZ2VuZXJhdGVkIGNvZGUgdW50aWwgdGhlIGZpcnN0IG1hcHBpbmdcbiAgICAgIC8vIHRvIHRoZSBTb3VyY2VOb2RlIHdpdGhvdXQgYW55IG1hcHBpbmcuXG4gICAgICAvLyBFYWNoIGxpbmUgaXMgYWRkZWQgYXMgc2VwYXJhdGUgc3RyaW5nLlxuICAgICAgd2hpbGUgKGxhc3RHZW5lcmF0ZWRMaW5lIDwgbWFwcGluZy5nZW5lcmF0ZWRMaW5lKSB7XG4gICAgICAgIG5vZGUuYWRkKHNoaWZ0TmV4dExpbmUoKSk7XG4gICAgICAgIGxhc3RHZW5lcmF0ZWRMaW5lKys7XG4gICAgICB9XG4gICAgICBpZiAobGFzdEdlbmVyYXRlZENvbHVtbiA8IG1hcHBpbmcuZ2VuZXJhdGVkQ29sdW1uKSB7XG4gICAgICAgIHZhciBuZXh0TGluZSA9IHJlbWFpbmluZ0xpbmVzW3JlbWFpbmluZ0xpbmVzSW5kZXhdIHx8ICcnO1xuICAgICAgICBub2RlLmFkZChuZXh0TGluZS5zdWJzdHIoMCwgbWFwcGluZy5nZW5lcmF0ZWRDb2x1bW4pKTtcbiAgICAgICAgcmVtYWluaW5nTGluZXNbcmVtYWluaW5nTGluZXNJbmRleF0gPSBuZXh0TGluZS5zdWJzdHIobWFwcGluZy5nZW5lcmF0ZWRDb2x1bW4pO1xuICAgICAgICBsYXN0R2VuZXJhdGVkQ29sdW1uID0gbWFwcGluZy5nZW5lcmF0ZWRDb2x1bW47XG4gICAgICB9XG4gICAgICBsYXN0TWFwcGluZyA9IG1hcHBpbmc7XG4gICAgfSwgdGhpcyk7XG4gICAgLy8gV2UgaGF2ZSBwcm9jZXNzZWQgYWxsIG1hcHBpbmdzLlxuICAgIGlmIChyZW1haW5pbmdMaW5lc0luZGV4IDwgcmVtYWluaW5nTGluZXMubGVuZ3RoKSB7XG4gICAgICBpZiAobGFzdE1hcHBpbmcpIHtcbiAgICAgICAgLy8gQXNzb2NpYXRlIHRoZSByZW1haW5pbmcgY29kZSBpbiB0aGUgY3VycmVudCBsaW5lIHdpdGggXCJsYXN0TWFwcGluZ1wiXG4gICAgICAgIGFkZE1hcHBpbmdXaXRoQ29kZShsYXN0TWFwcGluZywgc2hpZnROZXh0TGluZSgpKTtcbiAgICAgIH1cbiAgICAgIC8vIGFuZCBhZGQgdGhlIHJlbWFpbmluZyBsaW5lcyB3aXRob3V0IGFueSBtYXBwaW5nXG4gICAgICBub2RlLmFkZChyZW1haW5pbmdMaW5lcy5zcGxpY2UocmVtYWluaW5nTGluZXNJbmRleCkuam9pbihcIlwiKSk7XG4gICAgfVxuXG4gICAgLy8gQ29weSBzb3VyY2VzQ29udGVudCBpbnRvIFNvdXJjZU5vZGVcbiAgICBhU291cmNlTWFwQ29uc3VtZXIuc291cmNlcy5mb3JFYWNoKGZ1bmN0aW9uIChzb3VyY2VGaWxlKSB7XG4gICAgICB2YXIgY29udGVudCA9IGFTb3VyY2VNYXBDb25zdW1lci5zb3VyY2VDb250ZW50Rm9yKHNvdXJjZUZpbGUpO1xuICAgICAgaWYgKGNvbnRlbnQgIT0gbnVsbCkge1xuICAgICAgICBpZiAoYVJlbGF0aXZlUGF0aCAhPSBudWxsKSB7XG4gICAgICAgICAgc291cmNlRmlsZSA9IHV0aWwuam9pbihhUmVsYXRpdmVQYXRoLCBzb3VyY2VGaWxlKTtcbiAgICAgICAgfVxuICAgICAgICBub2RlLnNldFNvdXJjZUNvbnRlbnQoc291cmNlRmlsZSwgY29udGVudCk7XG4gICAgICB9XG4gICAgfSk7XG5cbiAgICByZXR1cm4gbm9kZTtcblxuICAgIGZ1bmN0aW9uIGFkZE1hcHBpbmdXaXRoQ29kZShtYXBwaW5nLCBjb2RlKSB7XG4gICAgICBpZiAobWFwcGluZyA9PT0gbnVsbCB8fCBtYXBwaW5nLnNvdXJjZSA9PT0gdW5kZWZpbmVkKSB7XG4gICAgICAgIG5vZGUuYWRkKGNvZGUpO1xuICAgICAgfSBlbHNlIHtcbiAgICAgICAgdmFyIHNvdXJjZSA9IGFSZWxhdGl2ZVBhdGhcbiAgICAgICAgICA/IHV0aWwuam9pbihhUmVsYXRpdmVQYXRoLCBtYXBwaW5nLnNvdXJjZSlcbiAgICAgICAgICA6IG1hcHBpbmcuc291cmNlO1xuICAgICAgICBub2RlLmFkZChuZXcgU291cmNlTm9kZShtYXBwaW5nLm9yaWdpbmFsTGluZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWFwcGluZy5vcmlnaW5hbENvbHVtbixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc291cmNlLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2RlLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtYXBwaW5nLm5hbWUpKTtcbiAgICAgIH1cbiAgICB9XG4gIH07XG5cbi8qKlxuICogQWRkIGEgY2h1bmsgb2YgZ2VuZXJhdGVkIEpTIHRvIHRoaXMgc291cmNlIG5vZGUuXG4gKlxuICogQHBhcmFtIGFDaHVuayBBIHN0cmluZyBzbmlwcGV0IG9mIGdlbmVyYXRlZCBKUyBjb2RlLCBhbm90aGVyIGluc3RhbmNlIG9mXG4gKiAgICAgICAgU291cmNlTm9kZSwgb3IgYW4gYXJyYXkgd2hlcmUgZWFjaCBtZW1iZXIgaXMgb25lIG9mIHRob3NlIHRoaW5ncy5cbiAqL1xuU291cmNlTm9kZS5wcm90b3R5cGUuYWRkID0gZnVuY3Rpb24gU291cmNlTm9kZV9hZGQoYUNodW5rKSB7XG4gIGlmIChBcnJheS5pc0FycmF5KGFDaHVuaykpIHtcbiAgICBhQ2h1bmsuZm9yRWFjaChmdW5jdGlvbiAoY2h1bmspIHtcbiAgICAgIHRoaXMuYWRkKGNodW5rKTtcbiAgICB9LCB0aGlzKTtcbiAgfVxuICBlbHNlIGlmIChhQ2h1bmtbaXNTb3VyY2VOb2RlXSB8fCB0eXBlb2YgYUNodW5rID09PSBcInN0cmluZ1wiKSB7XG4gICAgaWYgKGFDaHVuaykge1xuICAgICAgdGhpcy5jaGlsZHJlbi5wdXNoKGFDaHVuayk7XG4gICAgfVxuICB9XG4gIGVsc2Uge1xuICAgIHRocm93IG5ldyBUeXBlRXJyb3IoXG4gICAgICBcIkV4cGVjdGVkIGEgU291cmNlTm9kZSwgc3RyaW5nLCBvciBhbiBhcnJheSBvZiBTb3VyY2VOb2RlcyBhbmQgc3RyaW5ncy4gR290IFwiICsgYUNodW5rXG4gICAgKTtcbiAgfVxuICByZXR1cm4gdGhpcztcbn07XG5cbi8qKlxuICogQWRkIGEgY2h1bmsgb2YgZ2VuZXJhdGVkIEpTIHRvIHRoZSBiZWdpbm5pbmcgb2YgdGhpcyBzb3VyY2Ugbm9kZS5cbiAqXG4gKiBAcGFyYW0gYUNodW5rIEEgc3RyaW5nIHNuaXBwZXQgb2YgZ2VuZXJhdGVkIEpTIGNvZGUsIGFub3RoZXIgaW5zdGFuY2Ugb2ZcbiAqICAgICAgICBTb3VyY2VOb2RlLCBvciBhbiBhcnJheSB3aGVyZSBlYWNoIG1lbWJlciBpcyBvbmUgb2YgdGhvc2UgdGhpbmdzLlxuICovXG5Tb3VyY2VOb2RlLnByb3RvdHlwZS5wcmVwZW5kID0gZnVuY3Rpb24gU291cmNlTm9kZV9wcmVwZW5kKGFDaHVuaykge1xuICBpZiAoQXJyYXkuaXNBcnJheShhQ2h1bmspKSB7XG4gICAgZm9yICh2YXIgaSA9IGFDaHVuay5sZW5ndGgtMTsgaSA+PSAwOyBpLS0pIHtcbiAgICAgIHRoaXMucHJlcGVuZChhQ2h1bmtbaV0pO1xuICAgIH1cbiAgfVxuICBlbHNlIGlmIChhQ2h1bmtbaXNTb3VyY2VOb2RlXSB8fCB0eXBlb2YgYUNodW5rID09PSBcInN0cmluZ1wiKSB7XG4gICAgdGhpcy5jaGlsZHJlbi51bnNoaWZ0KGFDaHVuayk7XG4gIH1cbiAgZWxzZSB7XG4gICAgdGhyb3cgbmV3IFR5cGVFcnJvcihcbiAgICAgIFwiRXhwZWN0ZWQgYSBTb3VyY2VOb2RlLCBzdHJpbmcsIG9yIGFuIGFycmF5IG9mIFNvdXJjZU5vZGVzIGFuZCBzdHJpbmdzLiBHb3QgXCIgKyBhQ2h1bmtcbiAgICApO1xuICB9XG4gIHJldHVybiB0aGlzO1xufTtcblxuLyoqXG4gKiBXYWxrIG92ZXIgdGhlIHRyZWUgb2YgSlMgc25pcHBldHMgaW4gdGhpcyBub2RlIGFuZCBpdHMgY2hpbGRyZW4uIFRoZVxuICogd2Fsa2luZyBmdW5jdGlvbiBpcyBjYWxsZWQgb25jZSBmb3IgZWFjaCBzbmlwcGV0IG9mIEpTIGFuZCBpcyBwYXNzZWQgdGhhdFxuICogc25pcHBldCBhbmQgdGhlIGl0cyBvcmlnaW5hbCBhc3NvY2lhdGVkIHNvdXJjZSdzIGxpbmUvY29sdW1uIGxvY2F0aW9uLlxuICpcbiAqIEBwYXJhbSBhRm4gVGhlIHRyYXZlcnNhbCBmdW5jdGlvbi5cbiAqL1xuU291cmNlTm9kZS5wcm90b3R5cGUud2FsayA9IGZ1bmN0aW9uIFNvdXJjZU5vZGVfd2FsayhhRm4pIHtcbiAgdmFyIGNodW5rO1xuICBmb3IgKHZhciBpID0gMCwgbGVuID0gdGhpcy5jaGlsZHJlbi5sZW5ndGg7IGkgPCBsZW47IGkrKykge1xuICAgIGNodW5rID0gdGhpcy5jaGlsZHJlbltpXTtcbiAgICBpZiAoY2h1bmtbaXNTb3VyY2VOb2RlXSkge1xuICAgICAgY2h1bmsud2FsayhhRm4pO1xuICAgIH1cbiAgICBlbHNlIHtcbiAgICAgIGlmIChjaHVuayAhPT0gJycpIHtcbiAgICAgICAgYUZuKGNodW5rLCB7IHNvdXJjZTogdGhpcy5zb3VyY2UsXG4gICAgICAgICAgICAgICAgICAgICBsaW5lOiB0aGlzLmxpbmUsXG4gICAgICAgICAgICAgICAgICAgICBjb2x1bW46IHRoaXMuY29sdW1uLFxuICAgICAgICAgICAgICAgICAgICAgbmFtZTogdGhpcy5uYW1lIH0pO1xuICAgICAgfVxuICAgIH1cbiAgfVxufTtcblxuLyoqXG4gKiBMaWtlIGBTdHJpbmcucHJvdG90eXBlLmpvaW5gIGV4Y2VwdCBmb3IgU291cmNlTm9kZXMuIEluc2VydHMgYGFTdHJgIGJldHdlZW5cbiAqIGVhY2ggb2YgYHRoaXMuY2hpbGRyZW5gLlxuICpcbiAqIEBwYXJhbSBhU2VwIFRoZSBzZXBhcmF0b3IuXG4gKi9cblNvdXJjZU5vZGUucHJvdG90eXBlLmpvaW4gPSBmdW5jdGlvbiBTb3VyY2VOb2RlX2pvaW4oYVNlcCkge1xuICB2YXIgbmV3Q2hpbGRyZW47XG4gIHZhciBpO1xuICB2YXIgbGVuID0gdGhpcy5jaGlsZHJlbi5sZW5ndGg7XG4gIGlmIChsZW4gPiAwKSB7XG4gICAgbmV3Q2hpbGRyZW4gPSBbXTtcbiAgICBmb3IgKGkgPSAwOyBpIDwgbGVuLTE7IGkrKykge1xuICAgICAgbmV3Q2hpbGRyZW4ucHVzaCh0aGlzLmNoaWxkcmVuW2ldKTtcbiAgICAgIG5ld0NoaWxkcmVuLnB1c2goYVNlcCk7XG4gICAgfVxuICAgIG5ld0NoaWxkcmVuLnB1c2godGhpcy5jaGlsZHJlbltpXSk7XG4gICAgdGhpcy5jaGlsZHJlbiA9IG5ld0NoaWxkcmVuO1xuICB9XG4gIHJldHVybiB0aGlzO1xufTtcblxuLyoqXG4gKiBDYWxsIFN0cmluZy5wcm90b3R5cGUucmVwbGFjZSBvbiB0aGUgdmVyeSByaWdodC1tb3N0IHNvdXJjZSBzbmlwcGV0LiBVc2VmdWxcbiAqIGZvciB0cmltbWluZyB3aGl0ZXNwYWNlIGZyb20gdGhlIGVuZCBvZiBhIHNvdXJjZSBub2RlLCBldGMuXG4gKlxuICogQHBhcmFtIGFQYXR0ZXJuIFRoZSBwYXR0ZXJuIHRvIHJlcGxhY2UuXG4gKiBAcGFyYW0gYVJlcGxhY2VtZW50IFRoZSB0aGluZyB0byByZXBsYWNlIHRoZSBwYXR0ZXJuIHdpdGguXG4gKi9cblNvdXJjZU5vZGUucHJvdG90eXBlLnJlcGxhY2VSaWdodCA9IGZ1bmN0aW9uIFNvdXJjZU5vZGVfcmVwbGFjZVJpZ2h0KGFQYXR0ZXJuLCBhUmVwbGFjZW1lbnQpIHtcbiAgdmFyIGxhc3RDaGlsZCA9IHRoaXMuY2hpbGRyZW5bdGhpcy5jaGlsZHJlbi5sZW5ndGggLSAxXTtcbiAgaWYgKGxhc3RDaGlsZFtpc1NvdXJjZU5vZGVdKSB7XG4gICAgbGFzdENoaWxkLnJlcGxhY2VSaWdodChhUGF0dGVybiwgYVJlcGxhY2VtZW50KTtcbiAgfVxuICBlbHNlIGlmICh0eXBlb2YgbGFzdENoaWxkID09PSAnc3RyaW5nJykge1xuICAgIHRoaXMuY2hpbGRyZW5bdGhpcy5jaGlsZHJlbi5sZW5ndGggLSAxXSA9IGxhc3RDaGlsZC5yZXBsYWNlKGFQYXR0ZXJuLCBhUmVwbGFjZW1lbnQpO1xuICB9XG4gIGVsc2Uge1xuICAgIHRoaXMuY2hpbGRyZW4ucHVzaCgnJy5yZXBsYWNlKGFQYXR0ZXJuLCBhUmVwbGFjZW1lbnQpKTtcbiAgfVxuICByZXR1cm4gdGhpcztcbn07XG5cbi8qKlxuICogU2V0IHRoZSBzb3VyY2UgY29udGVudCBmb3IgYSBzb3VyY2UgZmlsZS4gVGhpcyB3aWxsIGJlIGFkZGVkIHRvIHRoZSBTb3VyY2VNYXBHZW5lcmF0b3JcbiAqIGluIHRoZSBzb3VyY2VzQ29udGVudCBmaWVsZC5cbiAqXG4gKiBAcGFyYW0gYVNvdXJjZUZpbGUgVGhlIGZpbGVuYW1lIG9mIHRoZSBzb3VyY2UgZmlsZVxuICogQHBhcmFtIGFTb3VyY2VDb250ZW50IFRoZSBjb250ZW50IG9mIHRoZSBzb3VyY2UgZmlsZVxuICovXG5Tb3VyY2VOb2RlLnByb3RvdHlwZS5zZXRTb3VyY2VDb250ZW50ID1cbiAgZnVuY3Rpb24gU291cmNlTm9kZV9zZXRTb3VyY2VDb250ZW50KGFTb3VyY2VGaWxlLCBhU291cmNlQ29udGVudCkge1xuICAgIHRoaXMuc291cmNlQ29udGVudHNbdXRpbC50b1NldFN0cmluZyhhU291cmNlRmlsZSldID0gYVNvdXJjZUNvbnRlbnQ7XG4gIH07XG5cbi8qKlxuICogV2FsayBvdmVyIHRoZSB0cmVlIG9mIFNvdXJjZU5vZGVzLiBUaGUgd2Fsa2luZyBmdW5jdGlvbiBpcyBjYWxsZWQgZm9yIGVhY2hcbiAqIHNvdXJjZSBmaWxlIGNvbnRlbnQgYW5kIGlzIHBhc3NlZCB0aGUgZmlsZW5hbWUgYW5kIHNvdXJjZSBjb250ZW50LlxuICpcbiAqIEBwYXJhbSBhRm4gVGhlIHRyYXZlcnNhbCBmdW5jdGlvbi5cbiAqL1xuU291cmNlTm9kZS5wcm90b3R5cGUud2Fsa1NvdXJjZUNvbnRlbnRzID1cbiAgZnVuY3Rpb24gU291cmNlTm9kZV93YWxrU291cmNlQ29udGVudHMoYUZuKSB7XG4gICAgZm9yICh2YXIgaSA9IDAsIGxlbiA9IHRoaXMuY2hpbGRyZW4ubGVuZ3RoOyBpIDwgbGVuOyBpKyspIHtcbiAgICAgIGlmICh0aGlzLmNoaWxkcmVuW2ldW2lzU291cmNlTm9kZV0pIHtcbiAgICAgICAgdGhpcy5jaGlsZHJlbltpXS53YWxrU291cmNlQ29udGVudHMoYUZuKTtcbiAgICAgIH1cbiAgICB9XG5cbiAgICB2YXIgc291cmNlcyA9IE9iamVjdC5rZXlzKHRoaXMuc291cmNlQ29udGVudHMpO1xuICAgIGZvciAodmFyIGkgPSAwLCBsZW4gPSBzb3VyY2VzLmxlbmd0aDsgaSA8IGxlbjsgaSsrKSB7XG4gICAgICBhRm4odXRpbC5mcm9tU2V0U3RyaW5nKHNvdXJjZXNbaV0pLCB0aGlzLnNvdXJjZUNvbnRlbnRzW3NvdXJjZXNbaV1dKTtcbiAgICB9XG4gIH07XG5cbi8qKlxuICogUmV0dXJuIHRoZSBzdHJpbmcgcmVwcmVzZW50YXRpb24gb2YgdGhpcyBzb3VyY2Ugbm9kZS4gV2Fsa3Mgb3ZlciB0aGUgdHJlZVxuICogYW5kIGNvbmNhdGVuYXRlcyBhbGwgdGhlIHZhcmlvdXMgc25pcHBldHMgdG9nZXRoZXIgdG8gb25lIHN0cmluZy5cbiAqL1xuU291cmNlTm9kZS5wcm90b3R5cGUudG9TdHJpbmcgPSBmdW5jdGlvbiBTb3VyY2VOb2RlX3RvU3RyaW5nKCkge1xuICB2YXIgc3RyID0gXCJcIjtcbiAgdGhpcy53YWxrKGZ1bmN0aW9uIChjaHVuaykge1xuICAgIHN0ciArPSBjaHVuaztcbiAgfSk7XG4gIHJldHVybiBzdHI7XG59O1xuXG4vKipcbiAqIFJldHVybnMgdGhlIHN0cmluZyByZXByZXNlbnRhdGlvbiBvZiB0aGlzIHNvdXJjZSBub2RlIGFsb25nIHdpdGggYSBzb3VyY2VcbiAqIG1hcC5cbiAqL1xuU291cmNlTm9kZS5wcm90b3R5cGUudG9TdHJpbmdXaXRoU291cmNlTWFwID0gZnVuY3Rpb24gU291cmNlTm9kZV90b1N0cmluZ1dpdGhTb3VyY2VNYXAoYUFyZ3MpIHtcbiAgdmFyIGdlbmVyYXRlZCA9IHtcbiAgICBjb2RlOiBcIlwiLFxuICAgIGxpbmU6IDEsXG4gICAgY29sdW1uOiAwXG4gIH07XG4gIHZhciBtYXAgPSBuZXcgU291cmNlTWFwR2VuZXJhdG9yKGFBcmdzKTtcbiAgdmFyIHNvdXJjZU1hcHBpbmdBY3RpdmUgPSBmYWxzZTtcbiAgdmFyIGxhc3RPcmlnaW5hbFNvdXJjZSA9IG51bGw7XG4gIHZhciBsYXN0T3JpZ2luYWxMaW5lID0gbnVsbDtcbiAgdmFyIGxhc3RPcmlnaW5hbENvbHVtbiA9IG51bGw7XG4gIHZhciBsYXN0T3JpZ2luYWxOYW1lID0gbnVsbDtcbiAgdGhpcy53YWxrKGZ1bmN0aW9uIChjaHVuaywgb3JpZ2luYWwpIHtcbiAgICBnZW5lcmF0ZWQuY29kZSArPSBjaHVuaztcbiAgICBpZiAob3JpZ2luYWwuc291cmNlICE9PSBudWxsXG4gICAgICAgICYmIG9yaWdpbmFsLmxpbmUgIT09IG51bGxcbiAgICAgICAgJiYgb3JpZ2luYWwuY29sdW1uICE9PSBudWxsKSB7XG4gICAgICBpZihsYXN0T3JpZ2luYWxTb3VyY2UgIT09IG9yaWdpbmFsLnNvdXJjZVxuICAgICAgICAgfHwgbGFzdE9yaWdpbmFsTGluZSAhPT0gb3JpZ2luYWwubGluZVxuICAgICAgICAgfHwgbGFzdE9yaWdpbmFsQ29sdW1uICE9PSBvcmlnaW5hbC5jb2x1bW5cbiAgICAgICAgIHx8IGxhc3RPcmlnaW5hbE5hbWUgIT09IG9yaWdpbmFsLm5hbWUpIHtcbiAgICAgICAgbWFwLmFkZE1hcHBpbmcoe1xuICAgICAgICAgIHNvdXJjZTogb3JpZ2luYWwuc291cmNlLFxuICAgICAgICAgIG9yaWdpbmFsOiB7XG4gICAgICAgICAgICBsaW5lOiBvcmlnaW5hbC5saW5lLFxuICAgICAgICAgICAgY29sdW1uOiBvcmlnaW5hbC5jb2x1bW5cbiAgICAgICAgICB9LFxuICAgICAgICAgIGdlbmVyYXRlZDoge1xuICAgICAgICAgICAgbGluZTogZ2VuZXJhdGVkLmxpbmUsXG4gICAgICAgICAgICBjb2x1bW46IGdlbmVyYXRlZC5jb2x1bW5cbiAgICAgICAgICB9LFxuICAgICAgICAgIG5hbWU6IG9yaWdpbmFsLm5hbWVcbiAgICAgICAgfSk7XG4gICAgICB9XG4gICAgICBsYXN0T3JpZ2luYWxTb3VyY2UgPSBvcmlnaW5hbC5zb3VyY2U7XG4gICAgICBsYXN0T3JpZ2luYWxMaW5lID0gb3JpZ2luYWwubGluZTtcbiAgICAgIGxhc3RPcmlnaW5hbENvbHVtbiA9IG9yaWdpbmFsLmNvbHVtbjtcbiAgICAgIGxhc3RPcmlnaW5hbE5hbWUgPSBvcmlnaW5hbC5uYW1lO1xuICAgICAgc291cmNlTWFwcGluZ0FjdGl2ZSA9IHRydWU7XG4gICAgfSBlbHNlIGlmIChzb3VyY2VNYXBwaW5nQWN0aXZlKSB7XG4gICAgICBtYXAuYWRkTWFwcGluZyh7XG4gICAgICAgIGdlbmVyYXRlZDoge1xuICAgICAgICAgIGxpbmU6IGdlbmVyYXRlZC5saW5lLFxuICAgICAgICAgIGNvbHVtbjogZ2VuZXJhdGVkLmNvbHVtblxuICAgICAgICB9XG4gICAgICB9KTtcbiAgICAgIGxhc3RPcmlnaW5hbFNvdXJjZSA9IG51bGw7XG4gICAgICBzb3VyY2VNYXBwaW5nQWN0aXZlID0gZmFsc2U7XG4gICAgfVxuICAgIGZvciAodmFyIGlkeCA9IDAsIGxlbmd0aCA9IGNodW5rLmxlbmd0aDsgaWR4IDwgbGVuZ3RoOyBpZHgrKykge1xuICAgICAgaWYgKGNodW5rLmNoYXJDb2RlQXQoaWR4KSA9PT0gTkVXTElORV9DT0RFKSB7XG4gICAgICAgIGdlbmVyYXRlZC5saW5lKys7XG4gICAgICAgIGdlbmVyYXRlZC5jb2x1bW4gPSAwO1xuICAgICAgICAvLyBNYXBwaW5ncyBlbmQgYXQgZW9sXG4gICAgICAgIGlmIChpZHggKyAxID09PSBsZW5ndGgpIHtcbiAgICAgICAgICBsYXN0T3JpZ2luYWxTb3VyY2UgPSBudWxsO1xuICAgICAgICAgIHNvdXJjZU1hcHBpbmdBY3RpdmUgPSBmYWxzZTtcbiAgICAgICAgfSBlbHNlIGlmIChzb3VyY2VNYXBwaW5nQWN0aXZlKSB7XG4gICAgICAgICAgbWFwLmFkZE1hcHBpbmcoe1xuICAgICAgICAgICAgc291cmNlOiBvcmlnaW5hbC5zb3VyY2UsXG4gICAgICAgICAgICBvcmlnaW5hbDoge1xuICAgICAgICAgICAgICBsaW5lOiBvcmlnaW5hbC5saW5lLFxuICAgICAgICAgICAgICBjb2x1bW46IG9yaWdpbmFsLmNvbHVtblxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGdlbmVyYXRlZDoge1xuICAgICAgICAgICAgICBsaW5lOiBnZW5lcmF0ZWQubGluZSxcbiAgICAgICAgICAgICAgY29sdW1uOiBnZW5lcmF0ZWQuY29sdW1uXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgbmFtZTogb3JpZ2luYWwubmFtZVxuICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICB9IGVsc2Uge1xuICAgICAgICBnZW5lcmF0ZWQuY29sdW1uKys7XG4gICAgICB9XG4gICAgfVxuICB9KTtcbiAgdGhpcy53YWxrU291cmNlQ29udGVudHMoZnVuY3Rpb24gKHNvdXJjZUZpbGUsIHNvdXJjZUNvbnRlbnQpIHtcbiAgICBtYXAuc2V0U291cmNlQ29udGVudChzb3VyY2VGaWxlLCBzb3VyY2VDb250ZW50KTtcbiAgfSk7XG5cbiAgcmV0dXJuIHsgY29kZTogZ2VuZXJhdGVkLmNvZGUsIG1hcDogbWFwIH07XG59O1xuXG5leHBvcnRzLlNvdXJjZU5vZGUgPSBTb3VyY2VOb2RlO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9saWIvc291cmNlLW5vZGUuanNcbi8vIG1vZHVsZSBpZCA9IDEwXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJzb3VyY2VSb290IjoiIn0= \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/source-map/dist/source-map.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/source-map/dist/source-map.js deleted file mode 100644 index b4eb0874..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/source-map/dist/source-map.js +++ /dev/null @@ -1,3233 +0,0 @@ -(function webpackUniversalModuleDefinition(root, factory) { - if(typeof exports === 'object' && typeof module === 'object') - module.exports = factory(); - else if(typeof define === 'function' && define.amd) - define([], factory); - else if(typeof exports === 'object') - exports["sourceMap"] = factory(); - else - root["sourceMap"] = factory(); -})(this, function() { -return /******/ (function(modules) { // webpackBootstrap -/******/ // The module cache -/******/ var installedModules = {}; - -/******/ // The require function -/******/ function __webpack_require__(moduleId) { - -/******/ // Check if module is in cache -/******/ if(installedModules[moduleId]) -/******/ return installedModules[moduleId].exports; - -/******/ // Create a new module (and put it into the cache) -/******/ var module = installedModules[moduleId] = { -/******/ exports: {}, -/******/ id: moduleId, -/******/ loaded: false -/******/ }; - -/******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); - -/******/ // Flag the module as loaded -/******/ module.loaded = true; - -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } - - -/******/ // expose the modules object (__webpack_modules__) -/******/ __webpack_require__.m = modules; - -/******/ // expose the module cache -/******/ __webpack_require__.c = installedModules; - -/******/ // __webpack_public_path__ -/******/ __webpack_require__.p = ""; - -/******/ // Load entry module and return exports -/******/ return __webpack_require__(0); -/******/ }) -/************************************************************************/ -/******/ ([ -/* 0 */ -/***/ (function(module, exports, __webpack_require__) { - - /* - * Copyright 2009-2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE.txt or: - * http://opensource.org/licenses/BSD-3-Clause - */ - exports.SourceMapGenerator = __webpack_require__(1).SourceMapGenerator; - exports.SourceMapConsumer = __webpack_require__(7).SourceMapConsumer; - exports.SourceNode = __webpack_require__(10).SourceNode; - - -/***/ }), -/* 1 */ -/***/ (function(module, exports, __webpack_require__) { - - /* -*- Mode: js; js-indent-level: 2; -*- */ - /* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - - var base64VLQ = __webpack_require__(2); - var util = __webpack_require__(4); - var ArraySet = __webpack_require__(5).ArraySet; - var MappingList = __webpack_require__(6).MappingList; - - /** - * An instance of the SourceMapGenerator represents a source map which is - * being built incrementally. You may pass an object with the following - * properties: - * - * - file: The filename of the generated source. - * - sourceRoot: A root for all relative URLs in this source map. - */ - function SourceMapGenerator(aArgs) { - if (!aArgs) { - aArgs = {}; - } - this._file = util.getArg(aArgs, 'file', null); - this._sourceRoot = util.getArg(aArgs, 'sourceRoot', null); - this._skipValidation = util.getArg(aArgs, 'skipValidation', false); - this._sources = new ArraySet(); - this._names = new ArraySet(); - this._mappings = new MappingList(); - this._sourcesContents = null; - } - - SourceMapGenerator.prototype._version = 3; - - /** - * Creates a new SourceMapGenerator based on a SourceMapConsumer - * - * @param aSourceMapConsumer The SourceMap. - */ - SourceMapGenerator.fromSourceMap = - function SourceMapGenerator_fromSourceMap(aSourceMapConsumer) { - var sourceRoot = aSourceMapConsumer.sourceRoot; - var generator = new SourceMapGenerator({ - file: aSourceMapConsumer.file, - sourceRoot: sourceRoot - }); - aSourceMapConsumer.eachMapping(function (mapping) { - var newMapping = { - generated: { - line: mapping.generatedLine, - column: mapping.generatedColumn - } - }; - - if (mapping.source != null) { - newMapping.source = mapping.source; - if (sourceRoot != null) { - newMapping.source = util.relative(sourceRoot, newMapping.source); - } - - newMapping.original = { - line: mapping.originalLine, - column: mapping.originalColumn - }; - - if (mapping.name != null) { - newMapping.name = mapping.name; - } - } - - generator.addMapping(newMapping); - }); - aSourceMapConsumer.sources.forEach(function (sourceFile) { - var sourceRelative = sourceFile; - if (sourceRoot !== null) { - sourceRelative = util.relative(sourceRoot, sourceFile); - } - - if (!generator._sources.has(sourceRelative)) { - generator._sources.add(sourceRelative); - } - - var content = aSourceMapConsumer.sourceContentFor(sourceFile); - if (content != null) { - generator.setSourceContent(sourceFile, content); - } - }); - return generator; - }; - - /** - * Add a single mapping from original source line and column to the generated - * source's line and column for this source map being created. The mapping - * object should have the following properties: - * - * - generated: An object with the generated line and column positions. - * - original: An object with the original line and column positions. - * - source: The original source file (relative to the sourceRoot). - * - name: An optional original token name for this mapping. - */ - SourceMapGenerator.prototype.addMapping = - function SourceMapGenerator_addMapping(aArgs) { - var generated = util.getArg(aArgs, 'generated'); - var original = util.getArg(aArgs, 'original', null); - var source = util.getArg(aArgs, 'source', null); - var name = util.getArg(aArgs, 'name', null); - - if (!this._skipValidation) { - this._validateMapping(generated, original, source, name); - } - - if (source != null) { - source = String(source); - if (!this._sources.has(source)) { - this._sources.add(source); - } - } - - if (name != null) { - name = String(name); - if (!this._names.has(name)) { - this._names.add(name); - } - } - - this._mappings.add({ - generatedLine: generated.line, - generatedColumn: generated.column, - originalLine: original != null && original.line, - originalColumn: original != null && original.column, - source: source, - name: name - }); - }; - - /** - * Set the source content for a source file. - */ - SourceMapGenerator.prototype.setSourceContent = - function SourceMapGenerator_setSourceContent(aSourceFile, aSourceContent) { - var source = aSourceFile; - if (this._sourceRoot != null) { - source = util.relative(this._sourceRoot, source); - } - - if (aSourceContent != null) { - // Add the source content to the _sourcesContents map. - // Create a new _sourcesContents map if the property is null. - if (!this._sourcesContents) { - this._sourcesContents = Object.create(null); - } - this._sourcesContents[util.toSetString(source)] = aSourceContent; - } else if (this._sourcesContents) { - // Remove the source file from the _sourcesContents map. - // If the _sourcesContents map is empty, set the property to null. - delete this._sourcesContents[util.toSetString(source)]; - if (Object.keys(this._sourcesContents).length === 0) { - this._sourcesContents = null; - } - } - }; - - /** - * Applies the mappings of a sub-source-map for a specific source file to the - * source map being generated. Each mapping to the supplied source file is - * rewritten using the supplied source map. Note: The resolution for the - * resulting mappings is the minimium of this map and the supplied map. - * - * @param aSourceMapConsumer The source map to be applied. - * @param aSourceFile Optional. The filename of the source file. - * If omitted, SourceMapConsumer's file property will be used. - * @param aSourceMapPath Optional. The dirname of the path to the source map - * to be applied. If relative, it is relative to the SourceMapConsumer. - * This parameter is needed when the two source maps aren't in the same - * directory, and the source map to be applied contains relative source - * paths. If so, those relative source paths need to be rewritten - * relative to the SourceMapGenerator. - */ - SourceMapGenerator.prototype.applySourceMap = - function SourceMapGenerator_applySourceMap(aSourceMapConsumer, aSourceFile, aSourceMapPath) { - var sourceFile = aSourceFile; - // If aSourceFile is omitted, we will use the file property of the SourceMap - if (aSourceFile == null) { - if (aSourceMapConsumer.file == null) { - throw new Error( - 'SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, ' + - 'or the source map\'s "file" property. Both were omitted.' - ); - } - sourceFile = aSourceMapConsumer.file; - } - var sourceRoot = this._sourceRoot; - // Make "sourceFile" relative if an absolute Url is passed. - if (sourceRoot != null) { - sourceFile = util.relative(sourceRoot, sourceFile); - } - // Applying the SourceMap can add and remove items from the sources and - // the names array. - var newSources = new ArraySet(); - var newNames = new ArraySet(); - - // Find mappings for the "sourceFile" - this._mappings.unsortedForEach(function (mapping) { - if (mapping.source === sourceFile && mapping.originalLine != null) { - // Check if it can be mapped by the source map, then update the mapping. - var original = aSourceMapConsumer.originalPositionFor({ - line: mapping.originalLine, - column: mapping.originalColumn - }); - if (original.source != null) { - // Copy mapping - mapping.source = original.source; - if (aSourceMapPath != null) { - mapping.source = util.join(aSourceMapPath, mapping.source) - } - if (sourceRoot != null) { - mapping.source = util.relative(sourceRoot, mapping.source); - } - mapping.originalLine = original.line; - mapping.originalColumn = original.column; - if (original.name != null) { - mapping.name = original.name; - } - } - } - - var source = mapping.source; - if (source != null && !newSources.has(source)) { - newSources.add(source); - } - - var name = mapping.name; - if (name != null && !newNames.has(name)) { - newNames.add(name); - } - - }, this); - this._sources = newSources; - this._names = newNames; - - // Copy sourcesContents of applied map. - aSourceMapConsumer.sources.forEach(function (sourceFile) { - var content = aSourceMapConsumer.sourceContentFor(sourceFile); - if (content != null) { - if (aSourceMapPath != null) { - sourceFile = util.join(aSourceMapPath, sourceFile); - } - if (sourceRoot != null) { - sourceFile = util.relative(sourceRoot, sourceFile); - } - this.setSourceContent(sourceFile, content); - } - }, this); - }; - - /** - * A mapping can have one of the three levels of data: - * - * 1. Just the generated position. - * 2. The Generated position, original position, and original source. - * 3. Generated and original position, original source, as well as a name - * token. - * - * To maintain consistency, we validate that any new mapping being added falls - * in to one of these categories. - */ - SourceMapGenerator.prototype._validateMapping = - function SourceMapGenerator_validateMapping(aGenerated, aOriginal, aSource, - aName) { - // When aOriginal is truthy but has empty values for .line and .column, - // it is most likely a programmer error. In this case we throw a very - // specific error message to try to guide them the right way. - // For example: https://github.com/Polymer/polymer-bundler/pull/519 - if (aOriginal && typeof aOriginal.line !== 'number' && typeof aOriginal.column !== 'number') { - throw new Error( - 'original.line and original.column are not numbers -- you probably meant to omit ' + - 'the original mapping entirely and only map the generated position. If so, pass ' + - 'null for the original mapping instead of an object with empty or null values.' - ); - } - - if (aGenerated && 'line' in aGenerated && 'column' in aGenerated - && aGenerated.line > 0 && aGenerated.column >= 0 - && !aOriginal && !aSource && !aName) { - // Case 1. - return; - } - else if (aGenerated && 'line' in aGenerated && 'column' in aGenerated - && aOriginal && 'line' in aOriginal && 'column' in aOriginal - && aGenerated.line > 0 && aGenerated.column >= 0 - && aOriginal.line > 0 && aOriginal.column >= 0 - && aSource) { - // Cases 2 and 3. - return; - } - else { - throw new Error('Invalid mapping: ' + JSON.stringify({ - generated: aGenerated, - source: aSource, - original: aOriginal, - name: aName - })); - } - }; - - /** - * Serialize the accumulated mappings in to the stream of base 64 VLQs - * specified by the source map format. - */ - SourceMapGenerator.prototype._serializeMappings = - function SourceMapGenerator_serializeMappings() { - var previousGeneratedColumn = 0; - var previousGeneratedLine = 1; - var previousOriginalColumn = 0; - var previousOriginalLine = 0; - var previousName = 0; - var previousSource = 0; - var result = ''; - var next; - var mapping; - var nameIdx; - var sourceIdx; - - var mappings = this._mappings.toArray(); - for (var i = 0, len = mappings.length; i < len; i++) { - mapping = mappings[i]; - next = '' - - if (mapping.generatedLine !== previousGeneratedLine) { - previousGeneratedColumn = 0; - while (mapping.generatedLine !== previousGeneratedLine) { - next += ';'; - previousGeneratedLine++; - } - } - else { - if (i > 0) { - if (!util.compareByGeneratedPositionsInflated(mapping, mappings[i - 1])) { - continue; - } - next += ','; - } - } - - next += base64VLQ.encode(mapping.generatedColumn - - previousGeneratedColumn); - previousGeneratedColumn = mapping.generatedColumn; - - if (mapping.source != null) { - sourceIdx = this._sources.indexOf(mapping.source); - next += base64VLQ.encode(sourceIdx - previousSource); - previousSource = sourceIdx; - - // lines are stored 0-based in SourceMap spec version 3 - next += base64VLQ.encode(mapping.originalLine - 1 - - previousOriginalLine); - previousOriginalLine = mapping.originalLine - 1; - - next += base64VLQ.encode(mapping.originalColumn - - previousOriginalColumn); - previousOriginalColumn = mapping.originalColumn; - - if (mapping.name != null) { - nameIdx = this._names.indexOf(mapping.name); - next += base64VLQ.encode(nameIdx - previousName); - previousName = nameIdx; - } - } - - result += next; - } - - return result; - }; - - SourceMapGenerator.prototype._generateSourcesContent = - function SourceMapGenerator_generateSourcesContent(aSources, aSourceRoot) { - return aSources.map(function (source) { - if (!this._sourcesContents) { - return null; - } - if (aSourceRoot != null) { - source = util.relative(aSourceRoot, source); - } - var key = util.toSetString(source); - return Object.prototype.hasOwnProperty.call(this._sourcesContents, key) - ? this._sourcesContents[key] - : null; - }, this); - }; - - /** - * Externalize the source map. - */ - SourceMapGenerator.prototype.toJSON = - function SourceMapGenerator_toJSON() { - var map = { - version: this._version, - sources: this._sources.toArray(), - names: this._names.toArray(), - mappings: this._serializeMappings() - }; - if (this._file != null) { - map.file = this._file; - } - if (this._sourceRoot != null) { - map.sourceRoot = this._sourceRoot; - } - if (this._sourcesContents) { - map.sourcesContent = this._generateSourcesContent(map.sources, map.sourceRoot); - } - - return map; - }; - - /** - * Render the source map being generated to a string. - */ - SourceMapGenerator.prototype.toString = - function SourceMapGenerator_toString() { - return JSON.stringify(this.toJSON()); - }; - - exports.SourceMapGenerator = SourceMapGenerator; - - -/***/ }), -/* 2 */ -/***/ (function(module, exports, __webpack_require__) { - - /* -*- Mode: js; js-indent-level: 2; -*- */ - /* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - * - * Based on the Base 64 VLQ implementation in Closure Compiler: - * https://code.google.com/p/closure-compiler/source/browse/trunk/src/com/google/debugging/sourcemap/Base64VLQ.java - * - * Copyright 2011 The Closure Compiler Authors. All rights reserved. - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - - var base64 = __webpack_require__(3); - - // A single base 64 digit can contain 6 bits of data. For the base 64 variable - // length quantities we use in the source map spec, the first bit is the sign, - // the next four bits are the actual value, and the 6th bit is the - // continuation bit. The continuation bit tells us whether there are more - // digits in this value following this digit. - // - // Continuation - // | Sign - // | | - // V V - // 101011 - - var VLQ_BASE_SHIFT = 5; - - // binary: 100000 - var VLQ_BASE = 1 << VLQ_BASE_SHIFT; - - // binary: 011111 - var VLQ_BASE_MASK = VLQ_BASE - 1; - - // binary: 100000 - var VLQ_CONTINUATION_BIT = VLQ_BASE; - - /** - * Converts from a two-complement value to a value where the sign bit is - * placed in the least significant bit. For example, as decimals: - * 1 becomes 2 (10 binary), -1 becomes 3 (11 binary) - * 2 becomes 4 (100 binary), -2 becomes 5 (101 binary) - */ - function toVLQSigned(aValue) { - return aValue < 0 - ? ((-aValue) << 1) + 1 - : (aValue << 1) + 0; - } - - /** - * Converts to a two-complement value from a value where the sign bit is - * placed in the least significant bit. For example, as decimals: - * 2 (10 binary) becomes 1, 3 (11 binary) becomes -1 - * 4 (100 binary) becomes 2, 5 (101 binary) becomes -2 - */ - function fromVLQSigned(aValue) { - var isNegative = (aValue & 1) === 1; - var shifted = aValue >> 1; - return isNegative - ? -shifted - : shifted; - } - - /** - * Returns the base 64 VLQ encoded value. - */ - exports.encode = function base64VLQ_encode(aValue) { - var encoded = ""; - var digit; - - var vlq = toVLQSigned(aValue); - - do { - digit = vlq & VLQ_BASE_MASK; - vlq >>>= VLQ_BASE_SHIFT; - if (vlq > 0) { - // There are still more digits in this value, so we must make sure the - // continuation bit is marked. - digit |= VLQ_CONTINUATION_BIT; - } - encoded += base64.encode(digit); - } while (vlq > 0); - - return encoded; - }; - - /** - * Decodes the next base 64 VLQ value from the given string and returns the - * value and the rest of the string via the out parameter. - */ - exports.decode = function base64VLQ_decode(aStr, aIndex, aOutParam) { - var strLen = aStr.length; - var result = 0; - var shift = 0; - var continuation, digit; - - do { - if (aIndex >= strLen) { - throw new Error("Expected more digits in base 64 VLQ value."); - } - - digit = base64.decode(aStr.charCodeAt(aIndex++)); - if (digit === -1) { - throw new Error("Invalid base64 digit: " + aStr.charAt(aIndex - 1)); - } - - continuation = !!(digit & VLQ_CONTINUATION_BIT); - digit &= VLQ_BASE_MASK; - result = result + (digit << shift); - shift += VLQ_BASE_SHIFT; - } while (continuation); - - aOutParam.value = fromVLQSigned(result); - aOutParam.rest = aIndex; - }; - - -/***/ }), -/* 3 */ -/***/ (function(module, exports) { - - /* -*- Mode: js; js-indent-level: 2; -*- */ - /* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - - var intToCharMap = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.split(''); - - /** - * Encode an integer in the range of 0 to 63 to a single base 64 digit. - */ - exports.encode = function (number) { - if (0 <= number && number < intToCharMap.length) { - return intToCharMap[number]; - } - throw new TypeError("Must be between 0 and 63: " + number); - }; - - /** - * Decode a single base 64 character code digit to an integer. Returns -1 on - * failure. - */ - exports.decode = function (charCode) { - var bigA = 65; // 'A' - var bigZ = 90; // 'Z' - - var littleA = 97; // 'a' - var littleZ = 122; // 'z' - - var zero = 48; // '0' - var nine = 57; // '9' - - var plus = 43; // '+' - var slash = 47; // '/' - - var littleOffset = 26; - var numberOffset = 52; - - // 0 - 25: ABCDEFGHIJKLMNOPQRSTUVWXYZ - if (bigA <= charCode && charCode <= bigZ) { - return (charCode - bigA); - } - - // 26 - 51: abcdefghijklmnopqrstuvwxyz - if (littleA <= charCode && charCode <= littleZ) { - return (charCode - littleA + littleOffset); - } - - // 52 - 61: 0123456789 - if (zero <= charCode && charCode <= nine) { - return (charCode - zero + numberOffset); - } - - // 62: + - if (charCode == plus) { - return 62; - } - - // 63: / - if (charCode == slash) { - return 63; - } - - // Invalid base64 digit. - return -1; - }; - - -/***/ }), -/* 4 */ -/***/ (function(module, exports) { - - /* -*- Mode: js; js-indent-level: 2; -*- */ - /* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - - /** - * This is a helper function for getting values from parameter/options - * objects. - * - * @param args The object we are extracting values from - * @param name The name of the property we are getting. - * @param defaultValue An optional value to return if the property is missing - * from the object. If this is not specified and the property is missing, an - * error will be thrown. - */ - function getArg(aArgs, aName, aDefaultValue) { - if (aName in aArgs) { - return aArgs[aName]; - } else if (arguments.length === 3) { - return aDefaultValue; - } else { - throw new Error('"' + aName + '" is a required argument.'); - } - } - exports.getArg = getArg; - - var urlRegexp = /^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/; - var dataUrlRegexp = /^data:.+\,.+$/; - - function urlParse(aUrl) { - var match = aUrl.match(urlRegexp); - if (!match) { - return null; - } - return { - scheme: match[1], - auth: match[2], - host: match[3], - port: match[4], - path: match[5] - }; - } - exports.urlParse = urlParse; - - function urlGenerate(aParsedUrl) { - var url = ''; - if (aParsedUrl.scheme) { - url += aParsedUrl.scheme + ':'; - } - url += '//'; - if (aParsedUrl.auth) { - url += aParsedUrl.auth + '@'; - } - if (aParsedUrl.host) { - url += aParsedUrl.host; - } - if (aParsedUrl.port) { - url += ":" + aParsedUrl.port - } - if (aParsedUrl.path) { - url += aParsedUrl.path; - } - return url; - } - exports.urlGenerate = urlGenerate; - - /** - * Normalizes a path, or the path portion of a URL: - * - * - Replaces consecutive slashes with one slash. - * - Removes unnecessary '.' parts. - * - Removes unnecessary '/..' parts. - * - * Based on code in the Node.js 'path' core module. - * - * @param aPath The path or url to normalize. - */ - function normalize(aPath) { - var path = aPath; - var url = urlParse(aPath); - if (url) { - if (!url.path) { - return aPath; - } - path = url.path; - } - var isAbsolute = exports.isAbsolute(path); - - var parts = path.split(/\/+/); - for (var part, up = 0, i = parts.length - 1; i >= 0; i--) { - part = parts[i]; - if (part === '.') { - parts.splice(i, 1); - } else if (part === '..') { - up++; - } else if (up > 0) { - if (part === '') { - // The first part is blank if the path is absolute. Trying to go - // above the root is a no-op. Therefore we can remove all '..' parts - // directly after the root. - parts.splice(i + 1, up); - up = 0; - } else { - parts.splice(i, 2); - up--; - } - } - } - path = parts.join('/'); - - if (path === '') { - path = isAbsolute ? '/' : '.'; - } - - if (url) { - url.path = path; - return urlGenerate(url); - } - return path; - } - exports.normalize = normalize; - - /** - * Joins two paths/URLs. - * - * @param aRoot The root path or URL. - * @param aPath The path or URL to be joined with the root. - * - * - If aPath is a URL or a data URI, aPath is returned, unless aPath is a - * scheme-relative URL: Then the scheme of aRoot, if any, is prepended - * first. - * - Otherwise aPath is a path. If aRoot is a URL, then its path portion - * is updated with the result and aRoot is returned. Otherwise the result - * is returned. - * - If aPath is absolute, the result is aPath. - * - Otherwise the two paths are joined with a slash. - * - Joining for example 'http://' and 'www.example.com' is also supported. - */ - function join(aRoot, aPath) { - if (aRoot === "") { - aRoot = "."; - } - if (aPath === "") { - aPath = "."; - } - var aPathUrl = urlParse(aPath); - var aRootUrl = urlParse(aRoot); - if (aRootUrl) { - aRoot = aRootUrl.path || '/'; - } - - // `join(foo, '//www.example.org')` - if (aPathUrl && !aPathUrl.scheme) { - if (aRootUrl) { - aPathUrl.scheme = aRootUrl.scheme; - } - return urlGenerate(aPathUrl); - } - - if (aPathUrl || aPath.match(dataUrlRegexp)) { - return aPath; - } - - // `join('http://', 'www.example.com')` - if (aRootUrl && !aRootUrl.host && !aRootUrl.path) { - aRootUrl.host = aPath; - return urlGenerate(aRootUrl); - } - - var joined = aPath.charAt(0) === '/' - ? aPath - : normalize(aRoot.replace(/\/+$/, '') + '/' + aPath); - - if (aRootUrl) { - aRootUrl.path = joined; - return urlGenerate(aRootUrl); - } - return joined; - } - exports.join = join; - - exports.isAbsolute = function (aPath) { - return aPath.charAt(0) === '/' || urlRegexp.test(aPath); - }; - - /** - * Make a path relative to a URL or another path. - * - * @param aRoot The root path or URL. - * @param aPath The path or URL to be made relative to aRoot. - */ - function relative(aRoot, aPath) { - if (aRoot === "") { - aRoot = "."; - } - - aRoot = aRoot.replace(/\/$/, ''); - - // It is possible for the path to be above the root. In this case, simply - // checking whether the root is a prefix of the path won't work. Instead, we - // need to remove components from the root one by one, until either we find - // a prefix that fits, or we run out of components to remove. - var level = 0; - while (aPath.indexOf(aRoot + '/') !== 0) { - var index = aRoot.lastIndexOf("/"); - if (index < 0) { - return aPath; - } - - // If the only part of the root that is left is the scheme (i.e. http://, - // file:///, etc.), one or more slashes (/), or simply nothing at all, we - // have exhausted all components, so the path is not relative to the root. - aRoot = aRoot.slice(0, index); - if (aRoot.match(/^([^\/]+:\/)?\/*$/)) { - return aPath; - } - - ++level; - } - - // Make sure we add a "../" for each component we removed from the root. - return Array(level + 1).join("../") + aPath.substr(aRoot.length + 1); - } - exports.relative = relative; - - var supportsNullProto = (function () { - var obj = Object.create(null); - return !('__proto__' in obj); - }()); - - function identity (s) { - return s; - } - - /** - * Because behavior goes wacky when you set `__proto__` on objects, we - * have to prefix all the strings in our set with an arbitrary character. - * - * See https://github.com/mozilla/source-map/pull/31 and - * https://github.com/mozilla/source-map/issues/30 - * - * @param String aStr - */ - function toSetString(aStr) { - if (isProtoString(aStr)) { - return '$' + aStr; - } - - return aStr; - } - exports.toSetString = supportsNullProto ? identity : toSetString; - - function fromSetString(aStr) { - if (isProtoString(aStr)) { - return aStr.slice(1); - } - - return aStr; - } - exports.fromSetString = supportsNullProto ? identity : fromSetString; - - function isProtoString(s) { - if (!s) { - return false; - } - - var length = s.length; - - if (length < 9 /* "__proto__".length */) { - return false; - } - - if (s.charCodeAt(length - 1) !== 95 /* '_' */ || - s.charCodeAt(length - 2) !== 95 /* '_' */ || - s.charCodeAt(length - 3) !== 111 /* 'o' */ || - s.charCodeAt(length - 4) !== 116 /* 't' */ || - s.charCodeAt(length - 5) !== 111 /* 'o' */ || - s.charCodeAt(length - 6) !== 114 /* 'r' */ || - s.charCodeAt(length - 7) !== 112 /* 'p' */ || - s.charCodeAt(length - 8) !== 95 /* '_' */ || - s.charCodeAt(length - 9) !== 95 /* '_' */) { - return false; - } - - for (var i = length - 10; i >= 0; i--) { - if (s.charCodeAt(i) !== 36 /* '$' */) { - return false; - } - } - - return true; - } - - /** - * Comparator between two mappings where the original positions are compared. - * - * Optionally pass in `true` as `onlyCompareGenerated` to consider two - * mappings with the same original source/line/column, but different generated - * line and column the same. Useful when searching for a mapping with a - * stubbed out mapping. - */ - function compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) { - var cmp = strcmp(mappingA.source, mappingB.source); - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.originalLine - mappingB.originalLine; - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.originalColumn - mappingB.originalColumn; - if (cmp !== 0 || onlyCompareOriginal) { - return cmp; - } - - cmp = mappingA.generatedColumn - mappingB.generatedColumn; - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.generatedLine - mappingB.generatedLine; - if (cmp !== 0) { - return cmp; - } - - return strcmp(mappingA.name, mappingB.name); - } - exports.compareByOriginalPositions = compareByOriginalPositions; - - /** - * Comparator between two mappings with deflated source and name indices where - * the generated positions are compared. - * - * Optionally pass in `true` as `onlyCompareGenerated` to consider two - * mappings with the same generated line and column, but different - * source/name/original line and column the same. Useful when searching for a - * mapping with a stubbed out mapping. - */ - function compareByGeneratedPositionsDeflated(mappingA, mappingB, onlyCompareGenerated) { - var cmp = mappingA.generatedLine - mappingB.generatedLine; - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.generatedColumn - mappingB.generatedColumn; - if (cmp !== 0 || onlyCompareGenerated) { - return cmp; - } - - cmp = strcmp(mappingA.source, mappingB.source); - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.originalLine - mappingB.originalLine; - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.originalColumn - mappingB.originalColumn; - if (cmp !== 0) { - return cmp; - } - - return strcmp(mappingA.name, mappingB.name); - } - exports.compareByGeneratedPositionsDeflated = compareByGeneratedPositionsDeflated; - - function strcmp(aStr1, aStr2) { - if (aStr1 === aStr2) { - return 0; - } - - if (aStr1 === null) { - return 1; // aStr2 !== null - } - - if (aStr2 === null) { - return -1; // aStr1 !== null - } - - if (aStr1 > aStr2) { - return 1; - } - - return -1; - } - - /** - * Comparator between two mappings with inflated source and name strings where - * the generated positions are compared. - */ - function compareByGeneratedPositionsInflated(mappingA, mappingB) { - var cmp = mappingA.generatedLine - mappingB.generatedLine; - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.generatedColumn - mappingB.generatedColumn; - if (cmp !== 0) { - return cmp; - } - - cmp = strcmp(mappingA.source, mappingB.source); - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.originalLine - mappingB.originalLine; - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.originalColumn - mappingB.originalColumn; - if (cmp !== 0) { - return cmp; - } - - return strcmp(mappingA.name, mappingB.name); - } - exports.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflated; - - /** - * Strip any JSON XSSI avoidance prefix from the string (as documented - * in the source maps specification), and then parse the string as - * JSON. - */ - function parseSourceMapInput(str) { - return JSON.parse(str.replace(/^\)]}'[^\n]*\n/, '')); - } - exports.parseSourceMapInput = parseSourceMapInput; - - /** - * Compute the URL of a source given the the source root, the source's - * URL, and the source map's URL. - */ - function computeSourceURL(sourceRoot, sourceURL, sourceMapURL) { - sourceURL = sourceURL || ''; - - if (sourceRoot) { - // This follows what Chrome does. - if (sourceRoot[sourceRoot.length - 1] !== '/' && sourceURL[0] !== '/') { - sourceRoot += '/'; - } - // The spec says: - // Line 4: An optional source root, useful for relocating source - // files on a server or removing repeated values in the - // “sources” entry. This value is prepended to the individual - // entries in the “source” field. - sourceURL = sourceRoot + sourceURL; - } - - // Historically, SourceMapConsumer did not take the sourceMapURL as - // a parameter. This mode is still somewhat supported, which is why - // this code block is conditional. However, it's preferable to pass - // the source map URL to SourceMapConsumer, so that this function - // can implement the source URL resolution algorithm as outlined in - // the spec. This block is basically the equivalent of: - // new URL(sourceURL, sourceMapURL).toString() - // ... except it avoids using URL, which wasn't available in the - // older releases of node still supported by this library. - // - // The spec says: - // If the sources are not absolute URLs after prepending of the - // “sourceRoot”, the sources are resolved relative to the - // SourceMap (like resolving script src in a html document). - if (sourceMapURL) { - var parsed = urlParse(sourceMapURL); - if (!parsed) { - throw new Error("sourceMapURL could not be parsed"); - } - if (parsed.path) { - // Strip the last path component, but keep the "/". - var index = parsed.path.lastIndexOf('/'); - if (index >= 0) { - parsed.path = parsed.path.substring(0, index + 1); - } - } - sourceURL = join(urlGenerate(parsed), sourceURL); - } - - return normalize(sourceURL); - } - exports.computeSourceURL = computeSourceURL; - - -/***/ }), -/* 5 */ -/***/ (function(module, exports, __webpack_require__) { - - /* -*- Mode: js; js-indent-level: 2; -*- */ - /* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - - var util = __webpack_require__(4); - var has = Object.prototype.hasOwnProperty; - var hasNativeMap = typeof Map !== "undefined"; - - /** - * A data structure which is a combination of an array and a set. Adding a new - * member is O(1), testing for membership is O(1), and finding the index of an - * element is O(1). Removing elements from the set is not supported. Only - * strings are supported for membership. - */ - function ArraySet() { - this._array = []; - this._set = hasNativeMap ? new Map() : Object.create(null); - } - - /** - * Static method for creating ArraySet instances from an existing array. - */ - ArraySet.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) { - var set = new ArraySet(); - for (var i = 0, len = aArray.length; i < len; i++) { - set.add(aArray[i], aAllowDuplicates); - } - return set; - }; - - /** - * Return how many unique items are in this ArraySet. If duplicates have been - * added, than those do not count towards the size. - * - * @returns Number - */ - ArraySet.prototype.size = function ArraySet_size() { - return hasNativeMap ? this._set.size : Object.getOwnPropertyNames(this._set).length; - }; - - /** - * Add the given string to this set. - * - * @param String aStr - */ - ArraySet.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) { - var sStr = hasNativeMap ? aStr : util.toSetString(aStr); - var isDuplicate = hasNativeMap ? this.has(aStr) : has.call(this._set, sStr); - var idx = this._array.length; - if (!isDuplicate || aAllowDuplicates) { - this._array.push(aStr); - } - if (!isDuplicate) { - if (hasNativeMap) { - this._set.set(aStr, idx); - } else { - this._set[sStr] = idx; - } - } - }; - - /** - * Is the given string a member of this set? - * - * @param String aStr - */ - ArraySet.prototype.has = function ArraySet_has(aStr) { - if (hasNativeMap) { - return this._set.has(aStr); - } else { - var sStr = util.toSetString(aStr); - return has.call(this._set, sStr); - } - }; - - /** - * What is the index of the given string in the array? - * - * @param String aStr - */ - ArraySet.prototype.indexOf = function ArraySet_indexOf(aStr) { - if (hasNativeMap) { - var idx = this._set.get(aStr); - if (idx >= 0) { - return idx; - } - } else { - var sStr = util.toSetString(aStr); - if (has.call(this._set, sStr)) { - return this._set[sStr]; - } - } - - throw new Error('"' + aStr + '" is not in the set.'); - }; - - /** - * What is the element at the given index? - * - * @param Number aIdx - */ - ArraySet.prototype.at = function ArraySet_at(aIdx) { - if (aIdx >= 0 && aIdx < this._array.length) { - return this._array[aIdx]; - } - throw new Error('No element indexed by ' + aIdx); - }; - - /** - * Returns the array representation of this set (which has the proper indices - * indicated by indexOf). Note that this is a copy of the internal array used - * for storing the members so that no one can mess with internal state. - */ - ArraySet.prototype.toArray = function ArraySet_toArray() { - return this._array.slice(); - }; - - exports.ArraySet = ArraySet; - - -/***/ }), -/* 6 */ -/***/ (function(module, exports, __webpack_require__) { - - /* -*- Mode: js; js-indent-level: 2; -*- */ - /* - * Copyright 2014 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - - var util = __webpack_require__(4); - - /** - * Determine whether mappingB is after mappingA with respect to generated - * position. - */ - function generatedPositionAfter(mappingA, mappingB) { - // Optimized for most common case - var lineA = mappingA.generatedLine; - var lineB = mappingB.generatedLine; - var columnA = mappingA.generatedColumn; - var columnB = mappingB.generatedColumn; - return lineB > lineA || lineB == lineA && columnB >= columnA || - util.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0; - } - - /** - * A data structure to provide a sorted view of accumulated mappings in a - * performance conscious manner. It trades a neglibable overhead in general - * case for a large speedup in case of mappings being added in order. - */ - function MappingList() { - this._array = []; - this._sorted = true; - // Serves as infimum - this._last = {generatedLine: -1, generatedColumn: 0}; - } - - /** - * Iterate through internal items. This method takes the same arguments that - * `Array.prototype.forEach` takes. - * - * NOTE: The order of the mappings is NOT guaranteed. - */ - MappingList.prototype.unsortedForEach = - function MappingList_forEach(aCallback, aThisArg) { - this._array.forEach(aCallback, aThisArg); - }; - - /** - * Add the given source mapping. - * - * @param Object aMapping - */ - MappingList.prototype.add = function MappingList_add(aMapping) { - if (generatedPositionAfter(this._last, aMapping)) { - this._last = aMapping; - this._array.push(aMapping); - } else { - this._sorted = false; - this._array.push(aMapping); - } - }; - - /** - * Returns the flat, sorted array of mappings. The mappings are sorted by - * generated position. - * - * WARNING: This method returns internal data without copying, for - * performance. The return value must NOT be mutated, and should be treated as - * an immutable borrow. If you want to take ownership, you must make your own - * copy. - */ - MappingList.prototype.toArray = function MappingList_toArray() { - if (!this._sorted) { - this._array.sort(util.compareByGeneratedPositionsInflated); - this._sorted = true; - } - return this._array; - }; - - exports.MappingList = MappingList; - - -/***/ }), -/* 7 */ -/***/ (function(module, exports, __webpack_require__) { - - /* -*- Mode: js; js-indent-level: 2; -*- */ - /* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - - var util = __webpack_require__(4); - var binarySearch = __webpack_require__(8); - var ArraySet = __webpack_require__(5).ArraySet; - var base64VLQ = __webpack_require__(2); - var quickSort = __webpack_require__(9).quickSort; - - function SourceMapConsumer(aSourceMap, aSourceMapURL) { - var sourceMap = aSourceMap; - if (typeof aSourceMap === 'string') { - sourceMap = util.parseSourceMapInput(aSourceMap); - } - - return sourceMap.sections != null - ? new IndexedSourceMapConsumer(sourceMap, aSourceMapURL) - : new BasicSourceMapConsumer(sourceMap, aSourceMapURL); - } - - SourceMapConsumer.fromSourceMap = function(aSourceMap, aSourceMapURL) { - return BasicSourceMapConsumer.fromSourceMap(aSourceMap, aSourceMapURL); - } - - /** - * The version of the source mapping spec that we are consuming. - */ - SourceMapConsumer.prototype._version = 3; - - // `__generatedMappings` and `__originalMappings` are arrays that hold the - // parsed mapping coordinates from the source map's "mappings" attribute. They - // are lazily instantiated, accessed via the `_generatedMappings` and - // `_originalMappings` getters respectively, and we only parse the mappings - // and create these arrays once queried for a source location. We jump through - // these hoops because there can be many thousands of mappings, and parsing - // them is expensive, so we only want to do it if we must. - // - // Each object in the arrays is of the form: - // - // { - // generatedLine: The line number in the generated code, - // generatedColumn: The column number in the generated code, - // source: The path to the original source file that generated this - // chunk of code, - // originalLine: The line number in the original source that - // corresponds to this chunk of generated code, - // originalColumn: The column number in the original source that - // corresponds to this chunk of generated code, - // name: The name of the original symbol which generated this chunk of - // code. - // } - // - // All properties except for `generatedLine` and `generatedColumn` can be - // `null`. - // - // `_generatedMappings` is ordered by the generated positions. - // - // `_originalMappings` is ordered by the original positions. - - SourceMapConsumer.prototype.__generatedMappings = null; - Object.defineProperty(SourceMapConsumer.prototype, '_generatedMappings', { - configurable: true, - enumerable: true, - get: function () { - if (!this.__generatedMappings) { - this._parseMappings(this._mappings, this.sourceRoot); - } - - return this.__generatedMappings; - } - }); - - SourceMapConsumer.prototype.__originalMappings = null; - Object.defineProperty(SourceMapConsumer.prototype, '_originalMappings', { - configurable: true, - enumerable: true, - get: function () { - if (!this.__originalMappings) { - this._parseMappings(this._mappings, this.sourceRoot); - } - - return this.__originalMappings; - } - }); - - SourceMapConsumer.prototype._charIsMappingSeparator = - function SourceMapConsumer_charIsMappingSeparator(aStr, index) { - var c = aStr.charAt(index); - return c === ";" || c === ","; - }; - - /** - * Parse the mappings in a string in to a data structure which we can easily - * query (the ordered arrays in the `this.__generatedMappings` and - * `this.__originalMappings` properties). - */ - SourceMapConsumer.prototype._parseMappings = - function SourceMapConsumer_parseMappings(aStr, aSourceRoot) { - throw new Error("Subclasses must implement _parseMappings"); - }; - - SourceMapConsumer.GENERATED_ORDER = 1; - SourceMapConsumer.ORIGINAL_ORDER = 2; - - SourceMapConsumer.GREATEST_LOWER_BOUND = 1; - SourceMapConsumer.LEAST_UPPER_BOUND = 2; - - /** - * Iterate over each mapping between an original source/line/column and a - * generated line/column in this source map. - * - * @param Function aCallback - * The function that is called with each mapping. - * @param Object aContext - * Optional. If specified, this object will be the value of `this` every - * time that `aCallback` is called. - * @param aOrder - * Either `SourceMapConsumer.GENERATED_ORDER` or - * `SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to - * iterate over the mappings sorted by the generated file's line/column - * order or the original's source/line/column order, respectively. Defaults to - * `SourceMapConsumer.GENERATED_ORDER`. - */ - SourceMapConsumer.prototype.eachMapping = - function SourceMapConsumer_eachMapping(aCallback, aContext, aOrder) { - var context = aContext || null; - var order = aOrder || SourceMapConsumer.GENERATED_ORDER; - - var mappings; - switch (order) { - case SourceMapConsumer.GENERATED_ORDER: - mappings = this._generatedMappings; - break; - case SourceMapConsumer.ORIGINAL_ORDER: - mappings = this._originalMappings; - break; - default: - throw new Error("Unknown order of iteration."); - } - - var sourceRoot = this.sourceRoot; - mappings.map(function (mapping) { - var source = mapping.source === null ? null : this._sources.at(mapping.source); - source = util.computeSourceURL(sourceRoot, source, this._sourceMapURL); - return { - source: source, - generatedLine: mapping.generatedLine, - generatedColumn: mapping.generatedColumn, - originalLine: mapping.originalLine, - originalColumn: mapping.originalColumn, - name: mapping.name === null ? null : this._names.at(mapping.name) - }; - }, this).forEach(aCallback, context); - }; - - /** - * Returns all generated line and column information for the original source, - * line, and column provided. If no column is provided, returns all mappings - * corresponding to a either the line we are searching for or the next - * closest line that has any mappings. Otherwise, returns all mappings - * corresponding to the given line and either the column we are searching for - * or the next closest column that has any offsets. - * - * The only argument is an object with the following properties: - * - * - source: The filename of the original source. - * - line: The line number in the original source. The line number is 1-based. - * - column: Optional. the column number in the original source. - * The column number is 0-based. - * - * and an array of objects is returned, each with the following properties: - * - * - line: The line number in the generated source, or null. The - * line number is 1-based. - * - column: The column number in the generated source, or null. - * The column number is 0-based. - */ - SourceMapConsumer.prototype.allGeneratedPositionsFor = - function SourceMapConsumer_allGeneratedPositionsFor(aArgs) { - var line = util.getArg(aArgs, 'line'); - - // When there is no exact match, BasicSourceMapConsumer.prototype._findMapping - // returns the index of the closest mapping less than the needle. By - // setting needle.originalColumn to 0, we thus find the last mapping for - // the given line, provided such a mapping exists. - var needle = { - source: util.getArg(aArgs, 'source'), - originalLine: line, - originalColumn: util.getArg(aArgs, 'column', 0) - }; - - needle.source = this._findSourceIndex(needle.source); - if (needle.source < 0) { - return []; - } - - var mappings = []; - - var index = this._findMapping(needle, - this._originalMappings, - "originalLine", - "originalColumn", - util.compareByOriginalPositions, - binarySearch.LEAST_UPPER_BOUND); - if (index >= 0) { - var mapping = this._originalMappings[index]; - - if (aArgs.column === undefined) { - var originalLine = mapping.originalLine; - - // Iterate until either we run out of mappings, or we run into - // a mapping for a different line than the one we found. Since - // mappings are sorted, this is guaranteed to find all mappings for - // the line we found. - while (mapping && mapping.originalLine === originalLine) { - mappings.push({ - line: util.getArg(mapping, 'generatedLine', null), - column: util.getArg(mapping, 'generatedColumn', null), - lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null) - }); - - mapping = this._originalMappings[++index]; - } - } else { - var originalColumn = mapping.originalColumn; - - // Iterate until either we run out of mappings, or we run into - // a mapping for a different line than the one we were searching for. - // Since mappings are sorted, this is guaranteed to find all mappings for - // the line we are searching for. - while (mapping && - mapping.originalLine === line && - mapping.originalColumn == originalColumn) { - mappings.push({ - line: util.getArg(mapping, 'generatedLine', null), - column: util.getArg(mapping, 'generatedColumn', null), - lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null) - }); - - mapping = this._originalMappings[++index]; - } - } - } - - return mappings; - }; - - exports.SourceMapConsumer = SourceMapConsumer; - - /** - * A BasicSourceMapConsumer instance represents a parsed source map which we can - * query for information about the original file positions by giving it a file - * position in the generated source. - * - * The first parameter is the raw source map (either as a JSON string, or - * already parsed to an object). According to the spec, source maps have the - * following attributes: - * - * - version: Which version of the source map spec this map is following. - * - sources: An array of URLs to the original source files. - * - names: An array of identifiers which can be referrenced by individual mappings. - * - sourceRoot: Optional. The URL root from which all sources are relative. - * - sourcesContent: Optional. An array of contents of the original source files. - * - mappings: A string of base64 VLQs which contain the actual mappings. - * - file: Optional. The generated file this source map is associated with. - * - * Here is an example source map, taken from the source map spec[0]: - * - * { - * version : 3, - * file: "out.js", - * sourceRoot : "", - * sources: ["foo.js", "bar.js"], - * names: ["src", "maps", "are", "fun"], - * mappings: "AA,AB;;ABCDE;" - * } - * - * The second parameter, if given, is a string whose value is the URL - * at which the source map was found. This URL is used to compute the - * sources array. - * - * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit?pli=1# - */ - function BasicSourceMapConsumer(aSourceMap, aSourceMapURL) { - var sourceMap = aSourceMap; - if (typeof aSourceMap === 'string') { - sourceMap = util.parseSourceMapInput(aSourceMap); - } - - var version = util.getArg(sourceMap, 'version'); - var sources = util.getArg(sourceMap, 'sources'); - // Sass 3.3 leaves out the 'names' array, so we deviate from the spec (which - // requires the array) to play nice here. - var names = util.getArg(sourceMap, 'names', []); - var sourceRoot = util.getArg(sourceMap, 'sourceRoot', null); - var sourcesContent = util.getArg(sourceMap, 'sourcesContent', null); - var mappings = util.getArg(sourceMap, 'mappings'); - var file = util.getArg(sourceMap, 'file', null); - - // Once again, Sass deviates from the spec and supplies the version as a - // string rather than a number, so we use loose equality checking here. - if (version != this._version) { - throw new Error('Unsupported version: ' + version); - } - - if (sourceRoot) { - sourceRoot = util.normalize(sourceRoot); - } - - sources = sources - .map(String) - // Some source maps produce relative source paths like "./foo.js" instead of - // "foo.js". Normalize these first so that future comparisons will succeed. - // See bugzil.la/1090768. - .map(util.normalize) - // Always ensure that absolute sources are internally stored relative to - // the source root, if the source root is absolute. Not doing this would - // be particularly problematic when the source root is a prefix of the - // source (valid, but why??). See github issue #199 and bugzil.la/1188982. - .map(function (source) { - return sourceRoot && util.isAbsolute(sourceRoot) && util.isAbsolute(source) - ? util.relative(sourceRoot, source) - : source; - }); - - // Pass `true` below to allow duplicate names and sources. While source maps - // are intended to be compressed and deduplicated, the TypeScript compiler - // sometimes generates source maps with duplicates in them. See Github issue - // #72 and bugzil.la/889492. - this._names = ArraySet.fromArray(names.map(String), true); - this._sources = ArraySet.fromArray(sources, true); - - this._absoluteSources = this._sources.toArray().map(function (s) { - return util.computeSourceURL(sourceRoot, s, aSourceMapURL); - }); - - this.sourceRoot = sourceRoot; - this.sourcesContent = sourcesContent; - this._mappings = mappings; - this._sourceMapURL = aSourceMapURL; - this.file = file; - } - - BasicSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype); - BasicSourceMapConsumer.prototype.consumer = SourceMapConsumer; - - /** - * Utility function to find the index of a source. Returns -1 if not - * found. - */ - BasicSourceMapConsumer.prototype._findSourceIndex = function(aSource) { - var relativeSource = aSource; - if (this.sourceRoot != null) { - relativeSource = util.relative(this.sourceRoot, relativeSource); - } - - if (this._sources.has(relativeSource)) { - return this._sources.indexOf(relativeSource); - } - - // Maybe aSource is an absolute URL as returned by |sources|. In - // this case we can't simply undo the transform. - var i; - for (i = 0; i < this._absoluteSources.length; ++i) { - if (this._absoluteSources[i] == aSource) { - return i; - } - } - - return -1; - }; - - /** - * Create a BasicSourceMapConsumer from a SourceMapGenerator. - * - * @param SourceMapGenerator aSourceMap - * The source map that will be consumed. - * @param String aSourceMapURL - * The URL at which the source map can be found (optional) - * @returns BasicSourceMapConsumer - */ - BasicSourceMapConsumer.fromSourceMap = - function SourceMapConsumer_fromSourceMap(aSourceMap, aSourceMapURL) { - var smc = Object.create(BasicSourceMapConsumer.prototype); - - var names = smc._names = ArraySet.fromArray(aSourceMap._names.toArray(), true); - var sources = smc._sources = ArraySet.fromArray(aSourceMap._sources.toArray(), true); - smc.sourceRoot = aSourceMap._sourceRoot; - smc.sourcesContent = aSourceMap._generateSourcesContent(smc._sources.toArray(), - smc.sourceRoot); - smc.file = aSourceMap._file; - smc._sourceMapURL = aSourceMapURL; - smc._absoluteSources = smc._sources.toArray().map(function (s) { - return util.computeSourceURL(smc.sourceRoot, s, aSourceMapURL); - }); - - // Because we are modifying the entries (by converting string sources and - // names to indices into the sources and names ArraySets), we have to make - // a copy of the entry or else bad things happen. Shared mutable state - // strikes again! See github issue #191. - - var generatedMappings = aSourceMap._mappings.toArray().slice(); - var destGeneratedMappings = smc.__generatedMappings = []; - var destOriginalMappings = smc.__originalMappings = []; - - for (var i = 0, length = generatedMappings.length; i < length; i++) { - var srcMapping = generatedMappings[i]; - var destMapping = new Mapping; - destMapping.generatedLine = srcMapping.generatedLine; - destMapping.generatedColumn = srcMapping.generatedColumn; - - if (srcMapping.source) { - destMapping.source = sources.indexOf(srcMapping.source); - destMapping.originalLine = srcMapping.originalLine; - destMapping.originalColumn = srcMapping.originalColumn; - - if (srcMapping.name) { - destMapping.name = names.indexOf(srcMapping.name); - } - - destOriginalMappings.push(destMapping); - } - - destGeneratedMappings.push(destMapping); - } - - quickSort(smc.__originalMappings, util.compareByOriginalPositions); - - return smc; - }; - - /** - * The version of the source mapping spec that we are consuming. - */ - BasicSourceMapConsumer.prototype._version = 3; - - /** - * The list of original sources. - */ - Object.defineProperty(BasicSourceMapConsumer.prototype, 'sources', { - get: function () { - return this._absoluteSources.slice(); - } - }); - - /** - * Provide the JIT with a nice shape / hidden class. - */ - function Mapping() { - this.generatedLine = 0; - this.generatedColumn = 0; - this.source = null; - this.originalLine = null; - this.originalColumn = null; - this.name = null; - } - - /** - * Parse the mappings in a string in to a data structure which we can easily - * query (the ordered arrays in the `this.__generatedMappings` and - * `this.__originalMappings` properties). - */ - BasicSourceMapConsumer.prototype._parseMappings = - function SourceMapConsumer_parseMappings(aStr, aSourceRoot) { - var generatedLine = 1; - var previousGeneratedColumn = 0; - var previousOriginalLine = 0; - var previousOriginalColumn = 0; - var previousSource = 0; - var previousName = 0; - var length = aStr.length; - var index = 0; - var cachedSegments = {}; - var temp = {}; - var originalMappings = []; - var generatedMappings = []; - var mapping, str, segment, end, value; - - while (index < length) { - if (aStr.charAt(index) === ';') { - generatedLine++; - index++; - previousGeneratedColumn = 0; - } - else if (aStr.charAt(index) === ',') { - index++; - } - else { - mapping = new Mapping(); - mapping.generatedLine = generatedLine; - - // Because each offset is encoded relative to the previous one, - // many segments often have the same encoding. We can exploit this - // fact by caching the parsed variable length fields of each segment, - // allowing us to avoid a second parse if we encounter the same - // segment again. - for (end = index; end < length; end++) { - if (this._charIsMappingSeparator(aStr, end)) { - break; - } - } - str = aStr.slice(index, end); - - segment = cachedSegments[str]; - if (segment) { - index += str.length; - } else { - segment = []; - while (index < end) { - base64VLQ.decode(aStr, index, temp); - value = temp.value; - index = temp.rest; - segment.push(value); - } - - if (segment.length === 2) { - throw new Error('Found a source, but no line and column'); - } - - if (segment.length === 3) { - throw new Error('Found a source and line, but no column'); - } - - cachedSegments[str] = segment; - } - - // Generated column. - mapping.generatedColumn = previousGeneratedColumn + segment[0]; - previousGeneratedColumn = mapping.generatedColumn; - - if (segment.length > 1) { - // Original source. - mapping.source = previousSource + segment[1]; - previousSource += segment[1]; - - // Original line. - mapping.originalLine = previousOriginalLine + segment[2]; - previousOriginalLine = mapping.originalLine; - // Lines are stored 0-based - mapping.originalLine += 1; - - // Original column. - mapping.originalColumn = previousOriginalColumn + segment[3]; - previousOriginalColumn = mapping.originalColumn; - - if (segment.length > 4) { - // Original name. - mapping.name = previousName + segment[4]; - previousName += segment[4]; - } - } - - generatedMappings.push(mapping); - if (typeof mapping.originalLine === 'number') { - originalMappings.push(mapping); - } - } - } - - quickSort(generatedMappings, util.compareByGeneratedPositionsDeflated); - this.__generatedMappings = generatedMappings; - - quickSort(originalMappings, util.compareByOriginalPositions); - this.__originalMappings = originalMappings; - }; - - /** - * Find the mapping that best matches the hypothetical "needle" mapping that - * we are searching for in the given "haystack" of mappings. - */ - BasicSourceMapConsumer.prototype._findMapping = - function SourceMapConsumer_findMapping(aNeedle, aMappings, aLineName, - aColumnName, aComparator, aBias) { - // To return the position we are searching for, we must first find the - // mapping for the given position and then return the opposite position it - // points to. Because the mappings are sorted, we can use binary search to - // find the best mapping. - - if (aNeedle[aLineName] <= 0) { - throw new TypeError('Line must be greater than or equal to 1, got ' - + aNeedle[aLineName]); - } - if (aNeedle[aColumnName] < 0) { - throw new TypeError('Column must be greater than or equal to 0, got ' - + aNeedle[aColumnName]); - } - - return binarySearch.search(aNeedle, aMappings, aComparator, aBias); - }; - - /** - * Compute the last column for each generated mapping. The last column is - * inclusive. - */ - BasicSourceMapConsumer.prototype.computeColumnSpans = - function SourceMapConsumer_computeColumnSpans() { - for (var index = 0; index < this._generatedMappings.length; ++index) { - var mapping = this._generatedMappings[index]; - - // Mappings do not contain a field for the last generated columnt. We - // can come up with an optimistic estimate, however, by assuming that - // mappings are contiguous (i.e. given two consecutive mappings, the - // first mapping ends where the second one starts). - if (index + 1 < this._generatedMappings.length) { - var nextMapping = this._generatedMappings[index + 1]; - - if (mapping.generatedLine === nextMapping.generatedLine) { - mapping.lastGeneratedColumn = nextMapping.generatedColumn - 1; - continue; - } - } - - // The last mapping for each line spans the entire line. - mapping.lastGeneratedColumn = Infinity; - } - }; - - /** - * Returns the original source, line, and column information for the generated - * source's line and column positions provided. The only argument is an object - * with the following properties: - * - * - line: The line number in the generated source. The line number - * is 1-based. - * - column: The column number in the generated source. The column - * number is 0-based. - * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or - * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the - * closest element that is smaller than or greater than the one we are - * searching for, respectively, if the exact element cannot be found. - * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'. - * - * and an object is returned with the following properties: - * - * - source: The original source file, or null. - * - line: The line number in the original source, or null. The - * line number is 1-based. - * - column: The column number in the original source, or null. The - * column number is 0-based. - * - name: The original identifier, or null. - */ - BasicSourceMapConsumer.prototype.originalPositionFor = - function SourceMapConsumer_originalPositionFor(aArgs) { - var needle = { - generatedLine: util.getArg(aArgs, 'line'), - generatedColumn: util.getArg(aArgs, 'column') - }; - - var index = this._findMapping( - needle, - this._generatedMappings, - "generatedLine", - "generatedColumn", - util.compareByGeneratedPositionsDeflated, - util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND) - ); - - if (index >= 0) { - var mapping = this._generatedMappings[index]; - - if (mapping.generatedLine === needle.generatedLine) { - var source = util.getArg(mapping, 'source', null); - if (source !== null) { - source = this._sources.at(source); - source = util.computeSourceURL(this.sourceRoot, source, this._sourceMapURL); - } - var name = util.getArg(mapping, 'name', null); - if (name !== null) { - name = this._names.at(name); - } - return { - source: source, - line: util.getArg(mapping, 'originalLine', null), - column: util.getArg(mapping, 'originalColumn', null), - name: name - }; - } - } - - return { - source: null, - line: null, - column: null, - name: null - }; - }; - - /** - * Return true if we have the source content for every source in the source - * map, false otherwise. - */ - BasicSourceMapConsumer.prototype.hasContentsOfAllSources = - function BasicSourceMapConsumer_hasContentsOfAllSources() { - if (!this.sourcesContent) { - return false; - } - return this.sourcesContent.length >= this._sources.size() && - !this.sourcesContent.some(function (sc) { return sc == null; }); - }; - - /** - * Returns the original source content. The only argument is the url of the - * original source file. Returns null if no original source content is - * available. - */ - BasicSourceMapConsumer.prototype.sourceContentFor = - function SourceMapConsumer_sourceContentFor(aSource, nullOnMissing) { - if (!this.sourcesContent) { - return null; - } - - var index = this._findSourceIndex(aSource); - if (index >= 0) { - return this.sourcesContent[index]; - } - - var relativeSource = aSource; - if (this.sourceRoot != null) { - relativeSource = util.relative(this.sourceRoot, relativeSource); - } - - var url; - if (this.sourceRoot != null - && (url = util.urlParse(this.sourceRoot))) { - // XXX: file:// URIs and absolute paths lead to unexpected behavior for - // many users. We can help them out when they expect file:// URIs to - // behave like it would if they were running a local HTTP server. See - // https://bugzilla.mozilla.org/show_bug.cgi?id=885597. - var fileUriAbsPath = relativeSource.replace(/^file:\/\//, ""); - if (url.scheme == "file" - && this._sources.has(fileUriAbsPath)) { - return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)] - } - - if ((!url.path || url.path == "/") - && this._sources.has("/" + relativeSource)) { - return this.sourcesContent[this._sources.indexOf("/" + relativeSource)]; - } - } - - // This function is used recursively from - // IndexedSourceMapConsumer.prototype.sourceContentFor. In that case, we - // don't want to throw if we can't find the source - we just want to - // return null, so we provide a flag to exit gracefully. - if (nullOnMissing) { - return null; - } - else { - throw new Error('"' + relativeSource + '" is not in the SourceMap.'); - } - }; - - /** - * Returns the generated line and column information for the original source, - * line, and column positions provided. The only argument is an object with - * the following properties: - * - * - source: The filename of the original source. - * - line: The line number in the original source. The line number - * is 1-based. - * - column: The column number in the original source. The column - * number is 0-based. - * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or - * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the - * closest element that is smaller than or greater than the one we are - * searching for, respectively, if the exact element cannot be found. - * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'. - * - * and an object is returned with the following properties: - * - * - line: The line number in the generated source, or null. The - * line number is 1-based. - * - column: The column number in the generated source, or null. - * The column number is 0-based. - */ - BasicSourceMapConsumer.prototype.generatedPositionFor = - function SourceMapConsumer_generatedPositionFor(aArgs) { - var source = util.getArg(aArgs, 'source'); - source = this._findSourceIndex(source); - if (source < 0) { - return { - line: null, - column: null, - lastColumn: null - }; - } - - var needle = { - source: source, - originalLine: util.getArg(aArgs, 'line'), - originalColumn: util.getArg(aArgs, 'column') - }; - - var index = this._findMapping( - needle, - this._originalMappings, - "originalLine", - "originalColumn", - util.compareByOriginalPositions, - util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND) - ); - - if (index >= 0) { - var mapping = this._originalMappings[index]; - - if (mapping.source === needle.source) { - return { - line: util.getArg(mapping, 'generatedLine', null), - column: util.getArg(mapping, 'generatedColumn', null), - lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null) - }; - } - } - - return { - line: null, - column: null, - lastColumn: null - }; - }; - - exports.BasicSourceMapConsumer = BasicSourceMapConsumer; - - /** - * An IndexedSourceMapConsumer instance represents a parsed source map which - * we can query for information. It differs from BasicSourceMapConsumer in - * that it takes "indexed" source maps (i.e. ones with a "sections" field) as - * input. - * - * The first parameter is a raw source map (either as a JSON string, or already - * parsed to an object). According to the spec for indexed source maps, they - * have the following attributes: - * - * - version: Which version of the source map spec this map is following. - * - file: Optional. The generated file this source map is associated with. - * - sections: A list of section definitions. - * - * Each value under the "sections" field has two fields: - * - offset: The offset into the original specified at which this section - * begins to apply, defined as an object with a "line" and "column" - * field. - * - map: A source map definition. This source map could also be indexed, - * but doesn't have to be. - * - * Instead of the "map" field, it's also possible to have a "url" field - * specifying a URL to retrieve a source map from, but that's currently - * unsupported. - * - * Here's an example source map, taken from the source map spec[0], but - * modified to omit a section which uses the "url" field. - * - * { - * version : 3, - * file: "app.js", - * sections: [{ - * offset: {line:100, column:10}, - * map: { - * version : 3, - * file: "section.js", - * sources: ["foo.js", "bar.js"], - * names: ["src", "maps", "are", "fun"], - * mappings: "AAAA,E;;ABCDE;" - * } - * }], - * } - * - * The second parameter, if given, is a string whose value is the URL - * at which the source map was found. This URL is used to compute the - * sources array. - * - * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit#heading=h.535es3xeprgt - */ - function IndexedSourceMapConsumer(aSourceMap, aSourceMapURL) { - var sourceMap = aSourceMap; - if (typeof aSourceMap === 'string') { - sourceMap = util.parseSourceMapInput(aSourceMap); - } - - var version = util.getArg(sourceMap, 'version'); - var sections = util.getArg(sourceMap, 'sections'); - - if (version != this._version) { - throw new Error('Unsupported version: ' + version); - } - - this._sources = new ArraySet(); - this._names = new ArraySet(); - - var lastOffset = { - line: -1, - column: 0 - }; - this._sections = sections.map(function (s) { - if (s.url) { - // The url field will require support for asynchronicity. - // See https://github.com/mozilla/source-map/issues/16 - throw new Error('Support for url field in sections not implemented.'); - } - var offset = util.getArg(s, 'offset'); - var offsetLine = util.getArg(offset, 'line'); - var offsetColumn = util.getArg(offset, 'column'); - - if (offsetLine < lastOffset.line || - (offsetLine === lastOffset.line && offsetColumn < lastOffset.column)) { - throw new Error('Section offsets must be ordered and non-overlapping.'); - } - lastOffset = offset; - - return { - generatedOffset: { - // The offset fields are 0-based, but we use 1-based indices when - // encoding/decoding from VLQ. - generatedLine: offsetLine + 1, - generatedColumn: offsetColumn + 1 - }, - consumer: new SourceMapConsumer(util.getArg(s, 'map'), aSourceMapURL) - } - }); - } - - IndexedSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype); - IndexedSourceMapConsumer.prototype.constructor = SourceMapConsumer; - - /** - * The version of the source mapping spec that we are consuming. - */ - IndexedSourceMapConsumer.prototype._version = 3; - - /** - * The list of original sources. - */ - Object.defineProperty(IndexedSourceMapConsumer.prototype, 'sources', { - get: function () { - var sources = []; - for (var i = 0; i < this._sections.length; i++) { - for (var j = 0; j < this._sections[i].consumer.sources.length; j++) { - sources.push(this._sections[i].consumer.sources[j]); - } - } - return sources; - } - }); - - /** - * Returns the original source, line, and column information for the generated - * source's line and column positions provided. The only argument is an object - * with the following properties: - * - * - line: The line number in the generated source. The line number - * is 1-based. - * - column: The column number in the generated source. The column - * number is 0-based. - * - * and an object is returned with the following properties: - * - * - source: The original source file, or null. - * - line: The line number in the original source, or null. The - * line number is 1-based. - * - column: The column number in the original source, or null. The - * column number is 0-based. - * - name: The original identifier, or null. - */ - IndexedSourceMapConsumer.prototype.originalPositionFor = - function IndexedSourceMapConsumer_originalPositionFor(aArgs) { - var needle = { - generatedLine: util.getArg(aArgs, 'line'), - generatedColumn: util.getArg(aArgs, 'column') - }; - - // Find the section containing the generated position we're trying to map - // to an original position. - var sectionIndex = binarySearch.search(needle, this._sections, - function(needle, section) { - var cmp = needle.generatedLine - section.generatedOffset.generatedLine; - if (cmp) { - return cmp; - } - - return (needle.generatedColumn - - section.generatedOffset.generatedColumn); - }); - var section = this._sections[sectionIndex]; - - if (!section) { - return { - source: null, - line: null, - column: null, - name: null - }; - } - - return section.consumer.originalPositionFor({ - line: needle.generatedLine - - (section.generatedOffset.generatedLine - 1), - column: needle.generatedColumn - - (section.generatedOffset.generatedLine === needle.generatedLine - ? section.generatedOffset.generatedColumn - 1 - : 0), - bias: aArgs.bias - }); - }; - - /** - * Return true if we have the source content for every source in the source - * map, false otherwise. - */ - IndexedSourceMapConsumer.prototype.hasContentsOfAllSources = - function IndexedSourceMapConsumer_hasContentsOfAllSources() { - return this._sections.every(function (s) { - return s.consumer.hasContentsOfAllSources(); - }); - }; - - /** - * Returns the original source content. The only argument is the url of the - * original source file. Returns null if no original source content is - * available. - */ - IndexedSourceMapConsumer.prototype.sourceContentFor = - function IndexedSourceMapConsumer_sourceContentFor(aSource, nullOnMissing) { - for (var i = 0; i < this._sections.length; i++) { - var section = this._sections[i]; - - var content = section.consumer.sourceContentFor(aSource, true); - if (content) { - return content; - } - } - if (nullOnMissing) { - return null; - } - else { - throw new Error('"' + aSource + '" is not in the SourceMap.'); - } - }; - - /** - * Returns the generated line and column information for the original source, - * line, and column positions provided. The only argument is an object with - * the following properties: - * - * - source: The filename of the original source. - * - line: The line number in the original source. The line number - * is 1-based. - * - column: The column number in the original source. The column - * number is 0-based. - * - * and an object is returned with the following properties: - * - * - line: The line number in the generated source, or null. The - * line number is 1-based. - * - column: The column number in the generated source, or null. - * The column number is 0-based. - */ - IndexedSourceMapConsumer.prototype.generatedPositionFor = - function IndexedSourceMapConsumer_generatedPositionFor(aArgs) { - for (var i = 0; i < this._sections.length; i++) { - var section = this._sections[i]; - - // Only consider this section if the requested source is in the list of - // sources of the consumer. - if (section.consumer._findSourceIndex(util.getArg(aArgs, 'source')) === -1) { - continue; - } - var generatedPosition = section.consumer.generatedPositionFor(aArgs); - if (generatedPosition) { - var ret = { - line: generatedPosition.line + - (section.generatedOffset.generatedLine - 1), - column: generatedPosition.column + - (section.generatedOffset.generatedLine === generatedPosition.line - ? section.generatedOffset.generatedColumn - 1 - : 0) - }; - return ret; - } - } - - return { - line: null, - column: null - }; - }; - - /** - * Parse the mappings in a string in to a data structure which we can easily - * query (the ordered arrays in the `this.__generatedMappings` and - * `this.__originalMappings` properties). - */ - IndexedSourceMapConsumer.prototype._parseMappings = - function IndexedSourceMapConsumer_parseMappings(aStr, aSourceRoot) { - this.__generatedMappings = []; - this.__originalMappings = []; - for (var i = 0; i < this._sections.length; i++) { - var section = this._sections[i]; - var sectionMappings = section.consumer._generatedMappings; - for (var j = 0; j < sectionMappings.length; j++) { - var mapping = sectionMappings[j]; - - var source = section.consumer._sources.at(mapping.source); - source = util.computeSourceURL(section.consumer.sourceRoot, source, this._sourceMapURL); - this._sources.add(source); - source = this._sources.indexOf(source); - - var name = null; - if (mapping.name) { - name = section.consumer._names.at(mapping.name); - this._names.add(name); - name = this._names.indexOf(name); - } - - // The mappings coming from the consumer for the section have - // generated positions relative to the start of the section, so we - // need to offset them to be relative to the start of the concatenated - // generated file. - var adjustedMapping = { - source: source, - generatedLine: mapping.generatedLine + - (section.generatedOffset.generatedLine - 1), - generatedColumn: mapping.generatedColumn + - (section.generatedOffset.generatedLine === mapping.generatedLine - ? section.generatedOffset.generatedColumn - 1 - : 0), - originalLine: mapping.originalLine, - originalColumn: mapping.originalColumn, - name: name - }; - - this.__generatedMappings.push(adjustedMapping); - if (typeof adjustedMapping.originalLine === 'number') { - this.__originalMappings.push(adjustedMapping); - } - } - } - - quickSort(this.__generatedMappings, util.compareByGeneratedPositionsDeflated); - quickSort(this.__originalMappings, util.compareByOriginalPositions); - }; - - exports.IndexedSourceMapConsumer = IndexedSourceMapConsumer; - - -/***/ }), -/* 8 */ -/***/ (function(module, exports) { - - /* -*- Mode: js; js-indent-level: 2; -*- */ - /* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - - exports.GREATEST_LOWER_BOUND = 1; - exports.LEAST_UPPER_BOUND = 2; - - /** - * Recursive implementation of binary search. - * - * @param aLow Indices here and lower do not contain the needle. - * @param aHigh Indices here and higher do not contain the needle. - * @param aNeedle The element being searched for. - * @param aHaystack The non-empty array being searched. - * @param aCompare Function which takes two elements and returns -1, 0, or 1. - * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or - * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the - * closest element that is smaller than or greater than the one we are - * searching for, respectively, if the exact element cannot be found. - */ - function recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare, aBias) { - // This function terminates when one of the following is true: - // - // 1. We find the exact element we are looking for. - // - // 2. We did not find the exact element, but we can return the index of - // the next-closest element. - // - // 3. We did not find the exact element, and there is no next-closest - // element than the one we are searching for, so we return -1. - var mid = Math.floor((aHigh - aLow) / 2) + aLow; - var cmp = aCompare(aNeedle, aHaystack[mid], true); - if (cmp === 0) { - // Found the element we are looking for. - return mid; - } - else if (cmp > 0) { - // Our needle is greater than aHaystack[mid]. - if (aHigh - mid > 1) { - // The element is in the upper half. - return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare, aBias); - } - - // The exact needle element was not found in this haystack. Determine if - // we are in termination case (3) or (2) and return the appropriate thing. - if (aBias == exports.LEAST_UPPER_BOUND) { - return aHigh < aHaystack.length ? aHigh : -1; - } else { - return mid; - } - } - else { - // Our needle is less than aHaystack[mid]. - if (mid - aLow > 1) { - // The element is in the lower half. - return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare, aBias); - } - - // we are in termination case (3) or (2) and return the appropriate thing. - if (aBias == exports.LEAST_UPPER_BOUND) { - return mid; - } else { - return aLow < 0 ? -1 : aLow; - } - } - } - - /** - * This is an implementation of binary search which will always try and return - * the index of the closest element if there is no exact hit. This is because - * mappings between original and generated line/col pairs are single points, - * and there is an implicit region between each of them, so a miss just means - * that you aren't on the very start of a region. - * - * @param aNeedle The element you are looking for. - * @param aHaystack The array that is being searched. - * @param aCompare A function which takes the needle and an element in the - * array and returns -1, 0, or 1 depending on whether the needle is less - * than, equal to, or greater than the element, respectively. - * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or - * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the - * closest element that is smaller than or greater than the one we are - * searching for, respectively, if the exact element cannot be found. - * Defaults to 'binarySearch.GREATEST_LOWER_BOUND'. - */ - exports.search = function search(aNeedle, aHaystack, aCompare, aBias) { - if (aHaystack.length === 0) { - return -1; - } - - var index = recursiveSearch(-1, aHaystack.length, aNeedle, aHaystack, - aCompare, aBias || exports.GREATEST_LOWER_BOUND); - if (index < 0) { - return -1; - } - - // We have found either the exact element, or the next-closest element than - // the one we are searching for. However, there may be more than one such - // element. Make sure we always return the smallest of these. - while (index - 1 >= 0) { - if (aCompare(aHaystack[index], aHaystack[index - 1], true) !== 0) { - break; - } - --index; - } - - return index; - }; - - -/***/ }), -/* 9 */ -/***/ (function(module, exports) { - - /* -*- Mode: js; js-indent-level: 2; -*- */ - /* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - - // It turns out that some (most?) JavaScript engines don't self-host - // `Array.prototype.sort`. This makes sense because C++ will likely remain - // faster than JS when doing raw CPU-intensive sorting. However, when using a - // custom comparator function, calling back and forth between the VM's C++ and - // JIT'd JS is rather slow *and* loses JIT type information, resulting in - // worse generated code for the comparator function than would be optimal. In - // fact, when sorting with a comparator, these costs outweigh the benefits of - // sorting in C++. By using our own JS-implemented Quick Sort (below), we get - // a ~3500ms mean speed-up in `bench/bench.html`. - - /** - * Swap the elements indexed by `x` and `y` in the array `ary`. - * - * @param {Array} ary - * The array. - * @param {Number} x - * The index of the first item. - * @param {Number} y - * The index of the second item. - */ - function swap(ary, x, y) { - var temp = ary[x]; - ary[x] = ary[y]; - ary[y] = temp; - } - - /** - * Returns a random integer within the range `low .. high` inclusive. - * - * @param {Number} low - * The lower bound on the range. - * @param {Number} high - * The upper bound on the range. - */ - function randomIntInRange(low, high) { - return Math.round(low + (Math.random() * (high - low))); - } - - /** - * The Quick Sort algorithm. - * - * @param {Array} ary - * An array to sort. - * @param {function} comparator - * Function to use to compare two items. - * @param {Number} p - * Start index of the array - * @param {Number} r - * End index of the array - */ - function doQuickSort(ary, comparator, p, r) { - // If our lower bound is less than our upper bound, we (1) partition the - // array into two pieces and (2) recurse on each half. If it is not, this is - // the empty array and our base case. - - if (p < r) { - // (1) Partitioning. - // - // The partitioning chooses a pivot between `p` and `r` and moves all - // elements that are less than or equal to the pivot to the before it, and - // all the elements that are greater than it after it. The effect is that - // once partition is done, the pivot is in the exact place it will be when - // the array is put in sorted order, and it will not need to be moved - // again. This runs in O(n) time. - - // Always choose a random pivot so that an input array which is reverse - // sorted does not cause O(n^2) running time. - var pivotIndex = randomIntInRange(p, r); - var i = p - 1; - - swap(ary, pivotIndex, r); - var pivot = ary[r]; - - // Immediately after `j` is incremented in this loop, the following hold - // true: - // - // * Every element in `ary[p .. i]` is less than or equal to the pivot. - // - // * Every element in `ary[i+1 .. j-1]` is greater than the pivot. - for (var j = p; j < r; j++) { - if (comparator(ary[j], pivot) <= 0) { - i += 1; - swap(ary, i, j); - } - } - - swap(ary, i + 1, j); - var q = i + 1; - - // (2) Recurse on each half. - - doQuickSort(ary, comparator, p, q - 1); - doQuickSort(ary, comparator, q + 1, r); - } - } - - /** - * Sort the given array in-place with the given comparator function. - * - * @param {Array} ary - * An array to sort. - * @param {function} comparator - * Function to use to compare two items. - */ - exports.quickSort = function (ary, comparator) { - doQuickSort(ary, comparator, 0, ary.length - 1); - }; - - -/***/ }), -/* 10 */ -/***/ (function(module, exports, __webpack_require__) { - - /* -*- Mode: js; js-indent-level: 2; -*- */ - /* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - - var SourceMapGenerator = __webpack_require__(1).SourceMapGenerator; - var util = __webpack_require__(4); - - // Matches a Windows-style `\r\n` newline or a `\n` newline used by all other - // operating systems these days (capturing the result). - var REGEX_NEWLINE = /(\r?\n)/; - - // Newline character code for charCodeAt() comparisons - var NEWLINE_CODE = 10; - - // Private symbol for identifying `SourceNode`s when multiple versions of - // the source-map library are loaded. This MUST NOT CHANGE across - // versions! - var isSourceNode = "$$$isSourceNode$$$"; - - /** - * SourceNodes provide a way to abstract over interpolating/concatenating - * snippets of generated JavaScript source code while maintaining the line and - * column information associated with the original source code. - * - * @param aLine The original line number. - * @param aColumn The original column number. - * @param aSource The original source's filename. - * @param aChunks Optional. An array of strings which are snippets of - * generated JS, or other SourceNodes. - * @param aName The original identifier. - */ - function SourceNode(aLine, aColumn, aSource, aChunks, aName) { - this.children = []; - this.sourceContents = {}; - this.line = aLine == null ? null : aLine; - this.column = aColumn == null ? null : aColumn; - this.source = aSource == null ? null : aSource; - this.name = aName == null ? null : aName; - this[isSourceNode] = true; - if (aChunks != null) this.add(aChunks); - } - - /** - * Creates a SourceNode from generated code and a SourceMapConsumer. - * - * @param aGeneratedCode The generated code - * @param aSourceMapConsumer The SourceMap for the generated code - * @param aRelativePath Optional. The path that relative sources in the - * SourceMapConsumer should be relative to. - */ - SourceNode.fromStringWithSourceMap = - function SourceNode_fromStringWithSourceMap(aGeneratedCode, aSourceMapConsumer, aRelativePath) { - // The SourceNode we want to fill with the generated code - // and the SourceMap - var node = new SourceNode(); - - // All even indices of this array are one line of the generated code, - // while all odd indices are the newlines between two adjacent lines - // (since `REGEX_NEWLINE` captures its match). - // Processed fragments are accessed by calling `shiftNextLine`. - var remainingLines = aGeneratedCode.split(REGEX_NEWLINE); - var remainingLinesIndex = 0; - var shiftNextLine = function() { - var lineContents = getNextLine(); - // The last line of a file might not have a newline. - var newLine = getNextLine() || ""; - return lineContents + newLine; - - function getNextLine() { - return remainingLinesIndex < remainingLines.length ? - remainingLines[remainingLinesIndex++] : undefined; - } - }; - - // We need to remember the position of "remainingLines" - var lastGeneratedLine = 1, lastGeneratedColumn = 0; - - // The generate SourceNodes we need a code range. - // To extract it current and last mapping is used. - // Here we store the last mapping. - var lastMapping = null; - - aSourceMapConsumer.eachMapping(function (mapping) { - if (lastMapping !== null) { - // We add the code from "lastMapping" to "mapping": - // First check if there is a new line in between. - if (lastGeneratedLine < mapping.generatedLine) { - // Associate first line with "lastMapping" - addMappingWithCode(lastMapping, shiftNextLine()); - lastGeneratedLine++; - lastGeneratedColumn = 0; - // The remaining code is added without mapping - } else { - // There is no new line in between. - // Associate the code between "lastGeneratedColumn" and - // "mapping.generatedColumn" with "lastMapping" - var nextLine = remainingLines[remainingLinesIndex] || ''; - var code = nextLine.substr(0, mapping.generatedColumn - - lastGeneratedColumn); - remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn - - lastGeneratedColumn); - lastGeneratedColumn = mapping.generatedColumn; - addMappingWithCode(lastMapping, code); - // No more remaining code, continue - lastMapping = mapping; - return; - } - } - // We add the generated code until the first mapping - // to the SourceNode without any mapping. - // Each line is added as separate string. - while (lastGeneratedLine < mapping.generatedLine) { - node.add(shiftNextLine()); - lastGeneratedLine++; - } - if (lastGeneratedColumn < mapping.generatedColumn) { - var nextLine = remainingLines[remainingLinesIndex] || ''; - node.add(nextLine.substr(0, mapping.generatedColumn)); - remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn); - lastGeneratedColumn = mapping.generatedColumn; - } - lastMapping = mapping; - }, this); - // We have processed all mappings. - if (remainingLinesIndex < remainingLines.length) { - if (lastMapping) { - // Associate the remaining code in the current line with "lastMapping" - addMappingWithCode(lastMapping, shiftNextLine()); - } - // and add the remaining lines without any mapping - node.add(remainingLines.splice(remainingLinesIndex).join("")); - } - - // Copy sourcesContent into SourceNode - aSourceMapConsumer.sources.forEach(function (sourceFile) { - var content = aSourceMapConsumer.sourceContentFor(sourceFile); - if (content != null) { - if (aRelativePath != null) { - sourceFile = util.join(aRelativePath, sourceFile); - } - node.setSourceContent(sourceFile, content); - } - }); - - return node; - - function addMappingWithCode(mapping, code) { - if (mapping === null || mapping.source === undefined) { - node.add(code); - } else { - var source = aRelativePath - ? util.join(aRelativePath, mapping.source) - : mapping.source; - node.add(new SourceNode(mapping.originalLine, - mapping.originalColumn, - source, - code, - mapping.name)); - } - } - }; - - /** - * Add a chunk of generated JS to this source node. - * - * @param aChunk A string snippet of generated JS code, another instance of - * SourceNode, or an array where each member is one of those things. - */ - SourceNode.prototype.add = function SourceNode_add(aChunk) { - if (Array.isArray(aChunk)) { - aChunk.forEach(function (chunk) { - this.add(chunk); - }, this); - } - else if (aChunk[isSourceNode] || typeof aChunk === "string") { - if (aChunk) { - this.children.push(aChunk); - } - } - else { - throw new TypeError( - "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk - ); - } - return this; - }; - - /** - * Add a chunk of generated JS to the beginning of this source node. - * - * @param aChunk A string snippet of generated JS code, another instance of - * SourceNode, or an array where each member is one of those things. - */ - SourceNode.prototype.prepend = function SourceNode_prepend(aChunk) { - if (Array.isArray(aChunk)) { - for (var i = aChunk.length-1; i >= 0; i--) { - this.prepend(aChunk[i]); - } - } - else if (aChunk[isSourceNode] || typeof aChunk === "string") { - this.children.unshift(aChunk); - } - else { - throw new TypeError( - "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk - ); - } - return this; - }; - - /** - * Walk over the tree of JS snippets in this node and its children. The - * walking function is called once for each snippet of JS and is passed that - * snippet and the its original associated source's line/column location. - * - * @param aFn The traversal function. - */ - SourceNode.prototype.walk = function SourceNode_walk(aFn) { - var chunk; - for (var i = 0, len = this.children.length; i < len; i++) { - chunk = this.children[i]; - if (chunk[isSourceNode]) { - chunk.walk(aFn); - } - else { - if (chunk !== '') { - aFn(chunk, { source: this.source, - line: this.line, - column: this.column, - name: this.name }); - } - } - } - }; - - /** - * Like `String.prototype.join` except for SourceNodes. Inserts `aStr` between - * each of `this.children`. - * - * @param aSep The separator. - */ - SourceNode.prototype.join = function SourceNode_join(aSep) { - var newChildren; - var i; - var len = this.children.length; - if (len > 0) { - newChildren = []; - for (i = 0; i < len-1; i++) { - newChildren.push(this.children[i]); - newChildren.push(aSep); - } - newChildren.push(this.children[i]); - this.children = newChildren; - } - return this; - }; - - /** - * Call String.prototype.replace on the very right-most source snippet. Useful - * for trimming whitespace from the end of a source node, etc. - * - * @param aPattern The pattern to replace. - * @param aReplacement The thing to replace the pattern with. - */ - SourceNode.prototype.replaceRight = function SourceNode_replaceRight(aPattern, aReplacement) { - var lastChild = this.children[this.children.length - 1]; - if (lastChild[isSourceNode]) { - lastChild.replaceRight(aPattern, aReplacement); - } - else if (typeof lastChild === 'string') { - this.children[this.children.length - 1] = lastChild.replace(aPattern, aReplacement); - } - else { - this.children.push(''.replace(aPattern, aReplacement)); - } - return this; - }; - - /** - * Set the source content for a source file. This will be added to the SourceMapGenerator - * in the sourcesContent field. - * - * @param aSourceFile The filename of the source file - * @param aSourceContent The content of the source file - */ - SourceNode.prototype.setSourceContent = - function SourceNode_setSourceContent(aSourceFile, aSourceContent) { - this.sourceContents[util.toSetString(aSourceFile)] = aSourceContent; - }; - - /** - * Walk over the tree of SourceNodes. The walking function is called for each - * source file content and is passed the filename and source content. - * - * @param aFn The traversal function. - */ - SourceNode.prototype.walkSourceContents = - function SourceNode_walkSourceContents(aFn) { - for (var i = 0, len = this.children.length; i < len; i++) { - if (this.children[i][isSourceNode]) { - this.children[i].walkSourceContents(aFn); - } - } - - var sources = Object.keys(this.sourceContents); - for (var i = 0, len = sources.length; i < len; i++) { - aFn(util.fromSetString(sources[i]), this.sourceContents[sources[i]]); - } - }; - - /** - * Return the string representation of this source node. Walks over the tree - * and concatenates all the various snippets together to one string. - */ - SourceNode.prototype.toString = function SourceNode_toString() { - var str = ""; - this.walk(function (chunk) { - str += chunk; - }); - return str; - }; - - /** - * Returns the string representation of this source node along with a source - * map. - */ - SourceNode.prototype.toStringWithSourceMap = function SourceNode_toStringWithSourceMap(aArgs) { - var generated = { - code: "", - line: 1, - column: 0 - }; - var map = new SourceMapGenerator(aArgs); - var sourceMappingActive = false; - var lastOriginalSource = null; - var lastOriginalLine = null; - var lastOriginalColumn = null; - var lastOriginalName = null; - this.walk(function (chunk, original) { - generated.code += chunk; - if (original.source !== null - && original.line !== null - && original.column !== null) { - if(lastOriginalSource !== original.source - || lastOriginalLine !== original.line - || lastOriginalColumn !== original.column - || lastOriginalName !== original.name) { - map.addMapping({ - source: original.source, - original: { - line: original.line, - column: original.column - }, - generated: { - line: generated.line, - column: generated.column - }, - name: original.name - }); - } - lastOriginalSource = original.source; - lastOriginalLine = original.line; - lastOriginalColumn = original.column; - lastOriginalName = original.name; - sourceMappingActive = true; - } else if (sourceMappingActive) { - map.addMapping({ - generated: { - line: generated.line, - column: generated.column - } - }); - lastOriginalSource = null; - sourceMappingActive = false; - } - for (var idx = 0, length = chunk.length; idx < length; idx++) { - if (chunk.charCodeAt(idx) === NEWLINE_CODE) { - generated.line++; - generated.column = 0; - // Mappings end at eol - if (idx + 1 === length) { - lastOriginalSource = null; - sourceMappingActive = false; - } else if (sourceMappingActive) { - map.addMapping({ - source: original.source, - original: { - line: original.line, - column: original.column - }, - generated: { - line: generated.line, - column: generated.column - }, - name: original.name - }); - } - } else { - generated.column++; - } - } - }); - this.walkSourceContents(function (sourceFile, sourceContent) { - map.setSourceContent(sourceFile, sourceContent); - }); - - return { code: generated.code, map: map }; - }; - - exports.SourceNode = SourceNode; - - -/***/ }) -/******/ ]) -}); -; \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/source-map/dist/source-map.min.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/source-map/dist/source-map.min.js deleted file mode 100644 index c7c72dad..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/source-map/dist/source-map.min.js +++ /dev/null @@ -1,2 +0,0 @@ -!function(e,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?exports.sourceMap=n():e.sourceMap=n()}(this,function(){return function(e){function n(t){if(r[t])return r[t].exports;var o=r[t]={exports:{},id:t,loaded:!1};return e[t].call(o.exports,o,o.exports,n),o.loaded=!0,o.exports}var r={};return n.m=e,n.c=r,n.p="",n(0)}([function(e,n,r){n.SourceMapGenerator=r(1).SourceMapGenerator,n.SourceMapConsumer=r(7).SourceMapConsumer,n.SourceNode=r(10).SourceNode},function(e,n,r){function t(e){e||(e={}),this._file=i.getArg(e,"file",null),this._sourceRoot=i.getArg(e,"sourceRoot",null),this._skipValidation=i.getArg(e,"skipValidation",!1),this._sources=new s,this._names=new s,this._mappings=new a,this._sourcesContents=null}var o=r(2),i=r(4),s=r(5).ArraySet,a=r(6).MappingList;t.prototype._version=3,t.fromSourceMap=function(e){var n=e.sourceRoot,r=new t({file:e.file,sourceRoot:n});return e.eachMapping(function(e){var t={generated:{line:e.generatedLine,column:e.generatedColumn}};null!=e.source&&(t.source=e.source,null!=n&&(t.source=i.relative(n,t.source)),t.original={line:e.originalLine,column:e.originalColumn},null!=e.name&&(t.name=e.name)),r.addMapping(t)}),e.sources.forEach(function(t){var o=t;null!==n&&(o=i.relative(n,t)),r._sources.has(o)||r._sources.add(o);var s=e.sourceContentFor(t);null!=s&&r.setSourceContent(t,s)}),r},t.prototype.addMapping=function(e){var n=i.getArg(e,"generated"),r=i.getArg(e,"original",null),t=i.getArg(e,"source",null),o=i.getArg(e,"name",null);this._skipValidation||this._validateMapping(n,r,t,o),null!=t&&(t=String(t),this._sources.has(t)||this._sources.add(t)),null!=o&&(o=String(o),this._names.has(o)||this._names.add(o)),this._mappings.add({generatedLine:n.line,generatedColumn:n.column,originalLine:null!=r&&r.line,originalColumn:null!=r&&r.column,source:t,name:o})},t.prototype.setSourceContent=function(e,n){var r=e;null!=this._sourceRoot&&(r=i.relative(this._sourceRoot,r)),null!=n?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[i.toSetString(r)]=n):this._sourcesContents&&(delete this._sourcesContents[i.toSetString(r)],0===Object.keys(this._sourcesContents).length&&(this._sourcesContents=null))},t.prototype.applySourceMap=function(e,n,r){var t=n;if(null==n){if(null==e.file)throw new Error('SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map\'s "file" property. Both were omitted.');t=e.file}var o=this._sourceRoot;null!=o&&(t=i.relative(o,t));var a=new s,u=new s;this._mappings.unsortedForEach(function(n){if(n.source===t&&null!=n.originalLine){var s=e.originalPositionFor({line:n.originalLine,column:n.originalColumn});null!=s.source&&(n.source=s.source,null!=r&&(n.source=i.join(r,n.source)),null!=o&&(n.source=i.relative(o,n.source)),n.originalLine=s.line,n.originalColumn=s.column,null!=s.name&&(n.name=s.name))}var l=n.source;null==l||a.has(l)||a.add(l);var c=n.name;null==c||u.has(c)||u.add(c)},this),this._sources=a,this._names=u,e.sources.forEach(function(n){var t=e.sourceContentFor(n);null!=t&&(null!=r&&(n=i.join(r,n)),null!=o&&(n=i.relative(o,n)),this.setSourceContent(n,t))},this)},t.prototype._validateMapping=function(e,n,r,t){if(n&&"number"!=typeof n.line&&"number"!=typeof n.column)throw new Error("original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.");if((!(e&&"line"in e&&"column"in e&&e.line>0&&e.column>=0)||n||r||t)&&!(e&&"line"in e&&"column"in e&&n&&"line"in n&&"column"in n&&e.line>0&&e.column>=0&&n.line>0&&n.column>=0&&r))throw new Error("Invalid mapping: "+JSON.stringify({generated:e,source:r,original:n,name:t}))},t.prototype._serializeMappings=function(){for(var e,n,r,t,s=0,a=1,u=0,l=0,c=0,g=0,p="",h=this._mappings.toArray(),f=0,d=h.length;f0){if(!i.compareByGeneratedPositionsInflated(n,h[f-1]))continue;e+=","}e+=o.encode(n.generatedColumn-s),s=n.generatedColumn,null!=n.source&&(t=this._sources.indexOf(n.source),e+=o.encode(t-g),g=t,e+=o.encode(n.originalLine-1-l),l=n.originalLine-1,e+=o.encode(n.originalColumn-u),u=n.originalColumn,null!=n.name&&(r=this._names.indexOf(n.name),e+=o.encode(r-c),c=r)),p+=e}return p},t.prototype._generateSourcesContent=function(e,n){return e.map(function(e){if(!this._sourcesContents)return null;null!=n&&(e=i.relative(n,e));var r=i.toSetString(e);return Object.prototype.hasOwnProperty.call(this._sourcesContents,r)?this._sourcesContents[r]:null},this)},t.prototype.toJSON=function(){var e={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return null!=this._file&&(e.file=this._file),null!=this._sourceRoot&&(e.sourceRoot=this._sourceRoot),this._sourcesContents&&(e.sourcesContent=this._generateSourcesContent(e.sources,e.sourceRoot)),e},t.prototype.toString=function(){return JSON.stringify(this.toJSON())},n.SourceMapGenerator=t},function(e,n,r){function t(e){return e<0?(-e<<1)+1:(e<<1)+0}function o(e){var n=1===(1&e),r=e>>1;return n?-r:r}var i=r(3),s=5,a=1<>>=s,o>0&&(n|=l),r+=i.encode(n);while(o>0);return r},n.decode=function(e,n,r){var t,a,c=e.length,g=0,p=0;do{if(n>=c)throw new Error("Expected more digits in base 64 VLQ value.");if(a=i.decode(e.charCodeAt(n++)),a===-1)throw new Error("Invalid base64 digit: "+e.charAt(n-1));t=!!(a&l),a&=u,g+=a<=0;c--)s=u[c],"."===s?u.splice(c,1):".."===s?l++:l>0&&(""===s?(u.splice(c+1,l),l=0):(u.splice(c,2),l--));return r=u.join("/"),""===r&&(r=a?"/":"."),i?(i.path=r,o(i)):r}function s(e,n){""===e&&(e="."),""===n&&(n=".");var r=t(n),s=t(e);if(s&&(e=s.path||"/"),r&&!r.scheme)return s&&(r.scheme=s.scheme),o(r);if(r||n.match(y))return n;if(s&&!s.host&&!s.path)return s.host=n,o(s);var a="/"===n.charAt(0)?n:i(e.replace(/\/+$/,"")+"/"+n);return s?(s.path=a,o(s)):a}function a(e,n){""===e&&(e="."),e=e.replace(/\/$/,"");for(var r=0;0!==n.indexOf(e+"/");){var t=e.lastIndexOf("/");if(t<0)return n;if(e=e.slice(0,t),e.match(/^([^\/]+:\/)?\/*$/))return n;++r}return Array(r+1).join("../")+n.substr(e.length+1)}function u(e){return e}function l(e){return g(e)?"$"+e:e}function c(e){return g(e)?e.slice(1):e}function g(e){if(!e)return!1;var n=e.length;if(n<9)return!1;if(95!==e.charCodeAt(n-1)||95!==e.charCodeAt(n-2)||111!==e.charCodeAt(n-3)||116!==e.charCodeAt(n-4)||111!==e.charCodeAt(n-5)||114!==e.charCodeAt(n-6)||112!==e.charCodeAt(n-7)||95!==e.charCodeAt(n-8)||95!==e.charCodeAt(n-9))return!1;for(var r=n-10;r>=0;r--)if(36!==e.charCodeAt(r))return!1;return!0}function p(e,n,r){var t=f(e.source,n.source);return 0!==t?t:(t=e.originalLine-n.originalLine,0!==t?t:(t=e.originalColumn-n.originalColumn,0!==t||r?t:(t=e.generatedColumn-n.generatedColumn,0!==t?t:(t=e.generatedLine-n.generatedLine,0!==t?t:f(e.name,n.name)))))}function h(e,n,r){var t=e.generatedLine-n.generatedLine;return 0!==t?t:(t=e.generatedColumn-n.generatedColumn,0!==t||r?t:(t=f(e.source,n.source),0!==t?t:(t=e.originalLine-n.originalLine,0!==t?t:(t=e.originalColumn-n.originalColumn,0!==t?t:f(e.name,n.name)))))}function f(e,n){return e===n?0:null===e?1:null===n?-1:e>n?1:-1}function d(e,n){var r=e.generatedLine-n.generatedLine;return 0!==r?r:(r=e.generatedColumn-n.generatedColumn,0!==r?r:(r=f(e.source,n.source),0!==r?r:(r=e.originalLine-n.originalLine,0!==r?r:(r=e.originalColumn-n.originalColumn,0!==r?r:f(e.name,n.name)))))}function m(e){return JSON.parse(e.replace(/^\)]}'[^\n]*\n/,""))}function _(e,n,r){if(n=n||"",e&&("/"!==e[e.length-1]&&"/"!==n[0]&&(e+="/"),n=e+n),r){var a=t(r);if(!a)throw new Error("sourceMapURL could not be parsed");if(a.path){var u=a.path.lastIndexOf("/");u>=0&&(a.path=a.path.substring(0,u+1))}n=s(o(a),n)}return i(n)}n.getArg=r;var v=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,y=/^data:.+\,.+$/;n.urlParse=t,n.urlGenerate=o,n.normalize=i,n.join=s,n.isAbsolute=function(e){return"/"===e.charAt(0)||v.test(e)},n.relative=a;var C=function(){var e=Object.create(null);return!("__proto__"in e)}();n.toSetString=C?u:l,n.fromSetString=C?u:c,n.compareByOriginalPositions=p,n.compareByGeneratedPositionsDeflated=h,n.compareByGeneratedPositionsInflated=d,n.parseSourceMapInput=m,n.computeSourceURL=_},function(e,n,r){function t(){this._array=[],this._set=s?new Map:Object.create(null)}var o=r(4),i=Object.prototype.hasOwnProperty,s="undefined"!=typeof Map;t.fromArray=function(e,n){for(var r=new t,o=0,i=e.length;o=0)return n}else{var r=o.toSetString(e);if(i.call(this._set,r))return this._set[r]}throw new Error('"'+e+'" is not in the set.')},t.prototype.at=function(e){if(e>=0&&er||t==r&&s>=o||i.compareByGeneratedPositionsInflated(e,n)<=0}function o(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}var i=r(4);o.prototype.unsortedForEach=function(e,n){this._array.forEach(e,n)},o.prototype.add=function(e){t(this._last,e)?(this._last=e,this._array.push(e)):(this._sorted=!1,this._array.push(e))},o.prototype.toArray=function(){return this._sorted||(this._array.sort(i.compareByGeneratedPositionsInflated),this._sorted=!0),this._array},n.MappingList=o},function(e,n,r){function t(e,n){var r=e;return"string"==typeof e&&(r=a.parseSourceMapInput(e)),null!=r.sections?new s(r,n):new o(r,n)}function o(e,n){var r=e;"string"==typeof e&&(r=a.parseSourceMapInput(e));var t=a.getArg(r,"version"),o=a.getArg(r,"sources"),i=a.getArg(r,"names",[]),s=a.getArg(r,"sourceRoot",null),u=a.getArg(r,"sourcesContent",null),c=a.getArg(r,"mappings"),g=a.getArg(r,"file",null);if(t!=this._version)throw new Error("Unsupported version: "+t);s&&(s=a.normalize(s)),o=o.map(String).map(a.normalize).map(function(e){return s&&a.isAbsolute(s)&&a.isAbsolute(e)?a.relative(s,e):e}),this._names=l.fromArray(i.map(String),!0),this._sources=l.fromArray(o,!0),this._absoluteSources=this._sources.toArray().map(function(e){return a.computeSourceURL(s,e,n)}),this.sourceRoot=s,this.sourcesContent=u,this._mappings=c,this._sourceMapURL=n,this.file=g}function i(){this.generatedLine=0,this.generatedColumn=0,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null}function s(e,n){var r=e;"string"==typeof e&&(r=a.parseSourceMapInput(e));var o=a.getArg(r,"version"),i=a.getArg(r,"sections");if(o!=this._version)throw new Error("Unsupported version: "+o);this._sources=new l,this._names=new l;var s={line:-1,column:0};this._sections=i.map(function(e){if(e.url)throw new Error("Support for url field in sections not implemented.");var r=a.getArg(e,"offset"),o=a.getArg(r,"line"),i=a.getArg(r,"column");if(o=0){var i=this._originalMappings[o];if(void 0===e.column)for(var s=i.originalLine;i&&i.originalLine===s;)t.push({line:a.getArg(i,"generatedLine",null),column:a.getArg(i,"generatedColumn",null),lastColumn:a.getArg(i,"lastGeneratedColumn",null)}),i=this._originalMappings[++o];else for(var l=i.originalColumn;i&&i.originalLine===n&&i.originalColumn==l;)t.push({line:a.getArg(i,"generatedLine",null),column:a.getArg(i,"generatedColumn",null),lastColumn:a.getArg(i,"lastGeneratedColumn",null)}),i=this._originalMappings[++o]}return t},n.SourceMapConsumer=t,o.prototype=Object.create(t.prototype),o.prototype.consumer=t,o.prototype._findSourceIndex=function(e){var n=e;if(null!=this.sourceRoot&&(n=a.relative(this.sourceRoot,n)),this._sources.has(n))return this._sources.indexOf(n);var r;for(r=0;r1&&(r.source=d+o[1],d+=o[1],r.originalLine=h+o[2],h=r.originalLine,r.originalLine+=1,r.originalColumn=f+o[3],f=r.originalColumn,o.length>4&&(r.name=m+o[4],m+=o[4])),A.push(r),"number"==typeof r.originalLine&&S.push(r)}g(A,a.compareByGeneratedPositionsDeflated),this.__generatedMappings=A,g(S,a.compareByOriginalPositions),this.__originalMappings=S},o.prototype._findMapping=function(e,n,r,t,o,i){if(e[r]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+e[r]);if(e[t]<0)throw new TypeError("Column must be greater than or equal to 0, got "+e[t]);return u.search(e,n,o,i)},o.prototype.computeColumnSpans=function(){for(var e=0;e=0){var o=this._generatedMappings[r];if(o.generatedLine===n.generatedLine){var i=a.getArg(o,"source",null);null!==i&&(i=this._sources.at(i),i=a.computeSourceURL(this.sourceRoot,i,this._sourceMapURL));var s=a.getArg(o,"name",null);return null!==s&&(s=this._names.at(s)),{source:i,line:a.getArg(o,"originalLine",null),column:a.getArg(o,"originalColumn",null),name:s}}}return{source:null,line:null,column:null,name:null}},o.prototype.hasContentsOfAllSources=function(){return!!this.sourcesContent&&(this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(e){return null==e}))},o.prototype.sourceContentFor=function(e,n){if(!this.sourcesContent)return null;var r=this._findSourceIndex(e);if(r>=0)return this.sourcesContent[r];var t=e;null!=this.sourceRoot&&(t=a.relative(this.sourceRoot,t));var o;if(null!=this.sourceRoot&&(o=a.urlParse(this.sourceRoot))){var i=t.replace(/^file:\/\//,"");if("file"==o.scheme&&this._sources.has(i))return this.sourcesContent[this._sources.indexOf(i)];if((!o.path||"/"==o.path)&&this._sources.has("/"+t))return this.sourcesContent[this._sources.indexOf("/"+t)]}if(n)return null;throw new Error('"'+t+'" is not in the SourceMap.')},o.prototype.generatedPositionFor=function(e){var n=a.getArg(e,"source");if(n=this._findSourceIndex(n),n<0)return{line:null,column:null,lastColumn:null};var r={source:n,originalLine:a.getArg(e,"line"),originalColumn:a.getArg(e,"column")},o=this._findMapping(r,this._originalMappings,"originalLine","originalColumn",a.compareByOriginalPositions,a.getArg(e,"bias",t.GREATEST_LOWER_BOUND));if(o>=0){var i=this._originalMappings[o];if(i.source===r.source)return{line:a.getArg(i,"generatedLine",null),column:a.getArg(i,"generatedColumn",null),lastColumn:a.getArg(i,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}},n.BasicSourceMapConsumer=o,s.prototype=Object.create(t.prototype),s.prototype.constructor=t,s.prototype._version=3,Object.defineProperty(s.prototype,"sources",{get:function(){for(var e=[],n=0;n0?t-u>1?r(u,t,o,i,s,a):a==n.LEAST_UPPER_BOUND?t1?r(e,u,o,i,s,a):a==n.LEAST_UPPER_BOUND?u:e<0?-1:e}n.GREATEST_LOWER_BOUND=1,n.LEAST_UPPER_BOUND=2,n.search=function(e,t,o,i){if(0===t.length)return-1;var s=r(-1,t.length,e,t,o,i||n.GREATEST_LOWER_BOUND);if(s<0)return-1;for(;s-1>=0&&0===o(t[s],t[s-1],!0);)--s;return s}},function(e,n){function r(e,n,r){var t=e[n];e[n]=e[r],e[r]=t}function t(e,n){return Math.round(e+Math.random()*(n-e))}function o(e,n,i,s){if(i=0;n--)this.prepend(e[n]);else{if(!e[u]&&"string"!=typeof e)throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e);this.children.unshift(e)}return this},t.prototype.walk=function(e){for(var n,r=0,t=this.children.length;r0){for(n=[],r=0;r= 0) { - return idx; - } - } else { - var sStr = util.toSetString(aStr); - if (has.call(this._set, sStr)) { - return this._set[sStr]; - } - } - - throw new Error('"' + aStr + '" is not in the set.'); -}; - -/** - * What is the element at the given index? - * - * @param Number aIdx - */ -ArraySet.prototype.at = function ArraySet_at(aIdx) { - if (aIdx >= 0 && aIdx < this._array.length) { - return this._array[aIdx]; - } - throw new Error('No element indexed by ' + aIdx); -}; - -/** - * Returns the array representation of this set (which has the proper indices - * indicated by indexOf). Note that this is a copy of the internal array used - * for storing the members so that no one can mess with internal state. - */ -ArraySet.prototype.toArray = function ArraySet_toArray() { - return this._array.slice(); -}; - -exports.ArraySet = ArraySet; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/source-map/lib/base64-vlq.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/source-map/lib/base64-vlq.js deleted file mode 100644 index 612b4040..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/source-map/lib/base64-vlq.js +++ /dev/null @@ -1,140 +0,0 @@ -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - * - * Based on the Base 64 VLQ implementation in Closure Compiler: - * https://code.google.com/p/closure-compiler/source/browse/trunk/src/com/google/debugging/sourcemap/Base64VLQ.java - * - * Copyright 2011 The Closure Compiler Authors. All rights reserved. - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -var base64 = require('./base64'); - -// A single base 64 digit can contain 6 bits of data. For the base 64 variable -// length quantities we use in the source map spec, the first bit is the sign, -// the next four bits are the actual value, and the 6th bit is the -// continuation bit. The continuation bit tells us whether there are more -// digits in this value following this digit. -// -// Continuation -// | Sign -// | | -// V V -// 101011 - -var VLQ_BASE_SHIFT = 5; - -// binary: 100000 -var VLQ_BASE = 1 << VLQ_BASE_SHIFT; - -// binary: 011111 -var VLQ_BASE_MASK = VLQ_BASE - 1; - -// binary: 100000 -var VLQ_CONTINUATION_BIT = VLQ_BASE; - -/** - * Converts from a two-complement value to a value where the sign bit is - * placed in the least significant bit. For example, as decimals: - * 1 becomes 2 (10 binary), -1 becomes 3 (11 binary) - * 2 becomes 4 (100 binary), -2 becomes 5 (101 binary) - */ -function toVLQSigned(aValue) { - return aValue < 0 - ? ((-aValue) << 1) + 1 - : (aValue << 1) + 0; -} - -/** - * Converts to a two-complement value from a value where the sign bit is - * placed in the least significant bit. For example, as decimals: - * 2 (10 binary) becomes 1, 3 (11 binary) becomes -1 - * 4 (100 binary) becomes 2, 5 (101 binary) becomes -2 - */ -function fromVLQSigned(aValue) { - var isNegative = (aValue & 1) === 1; - var shifted = aValue >> 1; - return isNegative - ? -shifted - : shifted; -} - -/** - * Returns the base 64 VLQ encoded value. - */ -exports.encode = function base64VLQ_encode(aValue) { - var encoded = ""; - var digit; - - var vlq = toVLQSigned(aValue); - - do { - digit = vlq & VLQ_BASE_MASK; - vlq >>>= VLQ_BASE_SHIFT; - if (vlq > 0) { - // There are still more digits in this value, so we must make sure the - // continuation bit is marked. - digit |= VLQ_CONTINUATION_BIT; - } - encoded += base64.encode(digit); - } while (vlq > 0); - - return encoded; -}; - -/** - * Decodes the next base 64 VLQ value from the given string and returns the - * value and the rest of the string via the out parameter. - */ -exports.decode = function base64VLQ_decode(aStr, aIndex, aOutParam) { - var strLen = aStr.length; - var result = 0; - var shift = 0; - var continuation, digit; - - do { - if (aIndex >= strLen) { - throw new Error("Expected more digits in base 64 VLQ value."); - } - - digit = base64.decode(aStr.charCodeAt(aIndex++)); - if (digit === -1) { - throw new Error("Invalid base64 digit: " + aStr.charAt(aIndex - 1)); - } - - continuation = !!(digit & VLQ_CONTINUATION_BIT); - digit &= VLQ_BASE_MASK; - result = result + (digit << shift); - shift += VLQ_BASE_SHIFT; - } while (continuation); - - aOutParam.value = fromVLQSigned(result); - aOutParam.rest = aIndex; -}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/source-map/lib/base64.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/source-map/lib/base64.js deleted file mode 100644 index 8aa86b30..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/source-map/lib/base64.js +++ /dev/null @@ -1,67 +0,0 @@ -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - -var intToCharMap = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.split(''); - -/** - * Encode an integer in the range of 0 to 63 to a single base 64 digit. - */ -exports.encode = function (number) { - if (0 <= number && number < intToCharMap.length) { - return intToCharMap[number]; - } - throw new TypeError("Must be between 0 and 63: " + number); -}; - -/** - * Decode a single base 64 character code digit to an integer. Returns -1 on - * failure. - */ -exports.decode = function (charCode) { - var bigA = 65; // 'A' - var bigZ = 90; // 'Z' - - var littleA = 97; // 'a' - var littleZ = 122; // 'z' - - var zero = 48; // '0' - var nine = 57; // '9' - - var plus = 43; // '+' - var slash = 47; // '/' - - var littleOffset = 26; - var numberOffset = 52; - - // 0 - 25: ABCDEFGHIJKLMNOPQRSTUVWXYZ - if (bigA <= charCode && charCode <= bigZ) { - return (charCode - bigA); - } - - // 26 - 51: abcdefghijklmnopqrstuvwxyz - if (littleA <= charCode && charCode <= littleZ) { - return (charCode - littleA + littleOffset); - } - - // 52 - 61: 0123456789 - if (zero <= charCode && charCode <= nine) { - return (charCode - zero + numberOffset); - } - - // 62: + - if (charCode == plus) { - return 62; - } - - // 63: / - if (charCode == slash) { - return 63; - } - - // Invalid base64 digit. - return -1; -}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/source-map/lib/binary-search.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/source-map/lib/binary-search.js deleted file mode 100644 index 010ac941..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/source-map/lib/binary-search.js +++ /dev/null @@ -1,111 +0,0 @@ -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - -exports.GREATEST_LOWER_BOUND = 1; -exports.LEAST_UPPER_BOUND = 2; - -/** - * Recursive implementation of binary search. - * - * @param aLow Indices here and lower do not contain the needle. - * @param aHigh Indices here and higher do not contain the needle. - * @param aNeedle The element being searched for. - * @param aHaystack The non-empty array being searched. - * @param aCompare Function which takes two elements and returns -1, 0, or 1. - * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or - * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the - * closest element that is smaller than or greater than the one we are - * searching for, respectively, if the exact element cannot be found. - */ -function recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare, aBias) { - // This function terminates when one of the following is true: - // - // 1. We find the exact element we are looking for. - // - // 2. We did not find the exact element, but we can return the index of - // the next-closest element. - // - // 3. We did not find the exact element, and there is no next-closest - // element than the one we are searching for, so we return -1. - var mid = Math.floor((aHigh - aLow) / 2) + aLow; - var cmp = aCompare(aNeedle, aHaystack[mid], true); - if (cmp === 0) { - // Found the element we are looking for. - return mid; - } - else if (cmp > 0) { - // Our needle is greater than aHaystack[mid]. - if (aHigh - mid > 1) { - // The element is in the upper half. - return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare, aBias); - } - - // The exact needle element was not found in this haystack. Determine if - // we are in termination case (3) or (2) and return the appropriate thing. - if (aBias == exports.LEAST_UPPER_BOUND) { - return aHigh < aHaystack.length ? aHigh : -1; - } else { - return mid; - } - } - else { - // Our needle is less than aHaystack[mid]. - if (mid - aLow > 1) { - // The element is in the lower half. - return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare, aBias); - } - - // we are in termination case (3) or (2) and return the appropriate thing. - if (aBias == exports.LEAST_UPPER_BOUND) { - return mid; - } else { - return aLow < 0 ? -1 : aLow; - } - } -} - -/** - * This is an implementation of binary search which will always try and return - * the index of the closest element if there is no exact hit. This is because - * mappings between original and generated line/col pairs are single points, - * and there is an implicit region between each of them, so a miss just means - * that you aren't on the very start of a region. - * - * @param aNeedle The element you are looking for. - * @param aHaystack The array that is being searched. - * @param aCompare A function which takes the needle and an element in the - * array and returns -1, 0, or 1 depending on whether the needle is less - * than, equal to, or greater than the element, respectively. - * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or - * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the - * closest element that is smaller than or greater than the one we are - * searching for, respectively, if the exact element cannot be found. - * Defaults to 'binarySearch.GREATEST_LOWER_BOUND'. - */ -exports.search = function search(aNeedle, aHaystack, aCompare, aBias) { - if (aHaystack.length === 0) { - return -1; - } - - var index = recursiveSearch(-1, aHaystack.length, aNeedle, aHaystack, - aCompare, aBias || exports.GREATEST_LOWER_BOUND); - if (index < 0) { - return -1; - } - - // We have found either the exact element, or the next-closest element than - // the one we are searching for. However, there may be more than one such - // element. Make sure we always return the smallest of these. - while (index - 1 >= 0) { - if (aCompare(aHaystack[index], aHaystack[index - 1], true) !== 0) { - break; - } - --index; - } - - return index; -}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/source-map/lib/mapping-list.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/source-map/lib/mapping-list.js deleted file mode 100644 index 06d1274a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/source-map/lib/mapping-list.js +++ /dev/null @@ -1,79 +0,0 @@ -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2014 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - -var util = require('./util'); - -/** - * Determine whether mappingB is after mappingA with respect to generated - * position. - */ -function generatedPositionAfter(mappingA, mappingB) { - // Optimized for most common case - var lineA = mappingA.generatedLine; - var lineB = mappingB.generatedLine; - var columnA = mappingA.generatedColumn; - var columnB = mappingB.generatedColumn; - return lineB > lineA || lineB == lineA && columnB >= columnA || - util.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0; -} - -/** - * A data structure to provide a sorted view of accumulated mappings in a - * performance conscious manner. It trades a neglibable overhead in general - * case for a large speedup in case of mappings being added in order. - */ -function MappingList() { - this._array = []; - this._sorted = true; - // Serves as infimum - this._last = {generatedLine: -1, generatedColumn: 0}; -} - -/** - * Iterate through internal items. This method takes the same arguments that - * `Array.prototype.forEach` takes. - * - * NOTE: The order of the mappings is NOT guaranteed. - */ -MappingList.prototype.unsortedForEach = - function MappingList_forEach(aCallback, aThisArg) { - this._array.forEach(aCallback, aThisArg); - }; - -/** - * Add the given source mapping. - * - * @param Object aMapping - */ -MappingList.prototype.add = function MappingList_add(aMapping) { - if (generatedPositionAfter(this._last, aMapping)) { - this._last = aMapping; - this._array.push(aMapping); - } else { - this._sorted = false; - this._array.push(aMapping); - } -}; - -/** - * Returns the flat, sorted array of mappings. The mappings are sorted by - * generated position. - * - * WARNING: This method returns internal data without copying, for - * performance. The return value must NOT be mutated, and should be treated as - * an immutable borrow. If you want to take ownership, you must make your own - * copy. - */ -MappingList.prototype.toArray = function MappingList_toArray() { - if (!this._sorted) { - this._array.sort(util.compareByGeneratedPositionsInflated); - this._sorted = true; - } - return this._array; -}; - -exports.MappingList = MappingList; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/source-map/lib/quick-sort.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/source-map/lib/quick-sort.js deleted file mode 100644 index 6a7caadb..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/source-map/lib/quick-sort.js +++ /dev/null @@ -1,114 +0,0 @@ -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - -// It turns out that some (most?) JavaScript engines don't self-host -// `Array.prototype.sort`. This makes sense because C++ will likely remain -// faster than JS when doing raw CPU-intensive sorting. However, when using a -// custom comparator function, calling back and forth between the VM's C++ and -// JIT'd JS is rather slow *and* loses JIT type information, resulting in -// worse generated code for the comparator function than would be optimal. In -// fact, when sorting with a comparator, these costs outweigh the benefits of -// sorting in C++. By using our own JS-implemented Quick Sort (below), we get -// a ~3500ms mean speed-up in `bench/bench.html`. - -/** - * Swap the elements indexed by `x` and `y` in the array `ary`. - * - * @param {Array} ary - * The array. - * @param {Number} x - * The index of the first item. - * @param {Number} y - * The index of the second item. - */ -function swap(ary, x, y) { - var temp = ary[x]; - ary[x] = ary[y]; - ary[y] = temp; -} - -/** - * Returns a random integer within the range `low .. high` inclusive. - * - * @param {Number} low - * The lower bound on the range. - * @param {Number} high - * The upper bound on the range. - */ -function randomIntInRange(low, high) { - return Math.round(low + (Math.random() * (high - low))); -} - -/** - * The Quick Sort algorithm. - * - * @param {Array} ary - * An array to sort. - * @param {function} comparator - * Function to use to compare two items. - * @param {Number} p - * Start index of the array - * @param {Number} r - * End index of the array - */ -function doQuickSort(ary, comparator, p, r) { - // If our lower bound is less than our upper bound, we (1) partition the - // array into two pieces and (2) recurse on each half. If it is not, this is - // the empty array and our base case. - - if (p < r) { - // (1) Partitioning. - // - // The partitioning chooses a pivot between `p` and `r` and moves all - // elements that are less than or equal to the pivot to the before it, and - // all the elements that are greater than it after it. The effect is that - // once partition is done, the pivot is in the exact place it will be when - // the array is put in sorted order, and it will not need to be moved - // again. This runs in O(n) time. - - // Always choose a random pivot so that an input array which is reverse - // sorted does not cause O(n^2) running time. - var pivotIndex = randomIntInRange(p, r); - var i = p - 1; - - swap(ary, pivotIndex, r); - var pivot = ary[r]; - - // Immediately after `j` is incremented in this loop, the following hold - // true: - // - // * Every element in `ary[p .. i]` is less than or equal to the pivot. - // - // * Every element in `ary[i+1 .. j-1]` is greater than the pivot. - for (var j = p; j < r; j++) { - if (comparator(ary[j], pivot) <= 0) { - i += 1; - swap(ary, i, j); - } - } - - swap(ary, i + 1, j); - var q = i + 1; - - // (2) Recurse on each half. - - doQuickSort(ary, comparator, p, q - 1); - doQuickSort(ary, comparator, q + 1, r); - } -} - -/** - * Sort the given array in-place with the given comparator function. - * - * @param {Array} ary - * An array to sort. - * @param {function} comparator - * Function to use to compare two items. - */ -exports.quickSort = function (ary, comparator) { - doQuickSort(ary, comparator, 0, ary.length - 1); -}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/source-map/lib/source-map-consumer.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/source-map/lib/source-map-consumer.js deleted file mode 100644 index 7b99d1da..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/source-map/lib/source-map-consumer.js +++ /dev/null @@ -1,1145 +0,0 @@ -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - -var util = require('./util'); -var binarySearch = require('./binary-search'); -var ArraySet = require('./array-set').ArraySet; -var base64VLQ = require('./base64-vlq'); -var quickSort = require('./quick-sort').quickSort; - -function SourceMapConsumer(aSourceMap, aSourceMapURL) { - var sourceMap = aSourceMap; - if (typeof aSourceMap === 'string') { - sourceMap = util.parseSourceMapInput(aSourceMap); - } - - return sourceMap.sections != null - ? new IndexedSourceMapConsumer(sourceMap, aSourceMapURL) - : new BasicSourceMapConsumer(sourceMap, aSourceMapURL); -} - -SourceMapConsumer.fromSourceMap = function(aSourceMap, aSourceMapURL) { - return BasicSourceMapConsumer.fromSourceMap(aSourceMap, aSourceMapURL); -} - -/** - * The version of the source mapping spec that we are consuming. - */ -SourceMapConsumer.prototype._version = 3; - -// `__generatedMappings` and `__originalMappings` are arrays that hold the -// parsed mapping coordinates from the source map's "mappings" attribute. They -// are lazily instantiated, accessed via the `_generatedMappings` and -// `_originalMappings` getters respectively, and we only parse the mappings -// and create these arrays once queried for a source location. We jump through -// these hoops because there can be many thousands of mappings, and parsing -// them is expensive, so we only want to do it if we must. -// -// Each object in the arrays is of the form: -// -// { -// generatedLine: The line number in the generated code, -// generatedColumn: The column number in the generated code, -// source: The path to the original source file that generated this -// chunk of code, -// originalLine: The line number in the original source that -// corresponds to this chunk of generated code, -// originalColumn: The column number in the original source that -// corresponds to this chunk of generated code, -// name: The name of the original symbol which generated this chunk of -// code. -// } -// -// All properties except for `generatedLine` and `generatedColumn` can be -// `null`. -// -// `_generatedMappings` is ordered by the generated positions. -// -// `_originalMappings` is ordered by the original positions. - -SourceMapConsumer.prototype.__generatedMappings = null; -Object.defineProperty(SourceMapConsumer.prototype, '_generatedMappings', { - configurable: true, - enumerable: true, - get: function () { - if (!this.__generatedMappings) { - this._parseMappings(this._mappings, this.sourceRoot); - } - - return this.__generatedMappings; - } -}); - -SourceMapConsumer.prototype.__originalMappings = null; -Object.defineProperty(SourceMapConsumer.prototype, '_originalMappings', { - configurable: true, - enumerable: true, - get: function () { - if (!this.__originalMappings) { - this._parseMappings(this._mappings, this.sourceRoot); - } - - return this.__originalMappings; - } -}); - -SourceMapConsumer.prototype._charIsMappingSeparator = - function SourceMapConsumer_charIsMappingSeparator(aStr, index) { - var c = aStr.charAt(index); - return c === ";" || c === ","; - }; - -/** - * Parse the mappings in a string in to a data structure which we can easily - * query (the ordered arrays in the `this.__generatedMappings` and - * `this.__originalMappings` properties). - */ -SourceMapConsumer.prototype._parseMappings = - function SourceMapConsumer_parseMappings(aStr, aSourceRoot) { - throw new Error("Subclasses must implement _parseMappings"); - }; - -SourceMapConsumer.GENERATED_ORDER = 1; -SourceMapConsumer.ORIGINAL_ORDER = 2; - -SourceMapConsumer.GREATEST_LOWER_BOUND = 1; -SourceMapConsumer.LEAST_UPPER_BOUND = 2; - -/** - * Iterate over each mapping between an original source/line/column and a - * generated line/column in this source map. - * - * @param Function aCallback - * The function that is called with each mapping. - * @param Object aContext - * Optional. If specified, this object will be the value of `this` every - * time that `aCallback` is called. - * @param aOrder - * Either `SourceMapConsumer.GENERATED_ORDER` or - * `SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to - * iterate over the mappings sorted by the generated file's line/column - * order or the original's source/line/column order, respectively. Defaults to - * `SourceMapConsumer.GENERATED_ORDER`. - */ -SourceMapConsumer.prototype.eachMapping = - function SourceMapConsumer_eachMapping(aCallback, aContext, aOrder) { - var context = aContext || null; - var order = aOrder || SourceMapConsumer.GENERATED_ORDER; - - var mappings; - switch (order) { - case SourceMapConsumer.GENERATED_ORDER: - mappings = this._generatedMappings; - break; - case SourceMapConsumer.ORIGINAL_ORDER: - mappings = this._originalMappings; - break; - default: - throw new Error("Unknown order of iteration."); - } - - var sourceRoot = this.sourceRoot; - mappings.map(function (mapping) { - var source = mapping.source === null ? null : this._sources.at(mapping.source); - source = util.computeSourceURL(sourceRoot, source, this._sourceMapURL); - return { - source: source, - generatedLine: mapping.generatedLine, - generatedColumn: mapping.generatedColumn, - originalLine: mapping.originalLine, - originalColumn: mapping.originalColumn, - name: mapping.name === null ? null : this._names.at(mapping.name) - }; - }, this).forEach(aCallback, context); - }; - -/** - * Returns all generated line and column information for the original source, - * line, and column provided. If no column is provided, returns all mappings - * corresponding to a either the line we are searching for or the next - * closest line that has any mappings. Otherwise, returns all mappings - * corresponding to the given line and either the column we are searching for - * or the next closest column that has any offsets. - * - * The only argument is an object with the following properties: - * - * - source: The filename of the original source. - * - line: The line number in the original source. The line number is 1-based. - * - column: Optional. the column number in the original source. - * The column number is 0-based. - * - * and an array of objects is returned, each with the following properties: - * - * - line: The line number in the generated source, or null. The - * line number is 1-based. - * - column: The column number in the generated source, or null. - * The column number is 0-based. - */ -SourceMapConsumer.prototype.allGeneratedPositionsFor = - function SourceMapConsumer_allGeneratedPositionsFor(aArgs) { - var line = util.getArg(aArgs, 'line'); - - // When there is no exact match, BasicSourceMapConsumer.prototype._findMapping - // returns the index of the closest mapping less than the needle. By - // setting needle.originalColumn to 0, we thus find the last mapping for - // the given line, provided such a mapping exists. - var needle = { - source: util.getArg(aArgs, 'source'), - originalLine: line, - originalColumn: util.getArg(aArgs, 'column', 0) - }; - - needle.source = this._findSourceIndex(needle.source); - if (needle.source < 0) { - return []; - } - - var mappings = []; - - var index = this._findMapping(needle, - this._originalMappings, - "originalLine", - "originalColumn", - util.compareByOriginalPositions, - binarySearch.LEAST_UPPER_BOUND); - if (index >= 0) { - var mapping = this._originalMappings[index]; - - if (aArgs.column === undefined) { - var originalLine = mapping.originalLine; - - // Iterate until either we run out of mappings, or we run into - // a mapping for a different line than the one we found. Since - // mappings are sorted, this is guaranteed to find all mappings for - // the line we found. - while (mapping && mapping.originalLine === originalLine) { - mappings.push({ - line: util.getArg(mapping, 'generatedLine', null), - column: util.getArg(mapping, 'generatedColumn', null), - lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null) - }); - - mapping = this._originalMappings[++index]; - } - } else { - var originalColumn = mapping.originalColumn; - - // Iterate until either we run out of mappings, or we run into - // a mapping for a different line than the one we were searching for. - // Since mappings are sorted, this is guaranteed to find all mappings for - // the line we are searching for. - while (mapping && - mapping.originalLine === line && - mapping.originalColumn == originalColumn) { - mappings.push({ - line: util.getArg(mapping, 'generatedLine', null), - column: util.getArg(mapping, 'generatedColumn', null), - lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null) - }); - - mapping = this._originalMappings[++index]; - } - } - } - - return mappings; - }; - -exports.SourceMapConsumer = SourceMapConsumer; - -/** - * A BasicSourceMapConsumer instance represents a parsed source map which we can - * query for information about the original file positions by giving it a file - * position in the generated source. - * - * The first parameter is the raw source map (either as a JSON string, or - * already parsed to an object). According to the spec, source maps have the - * following attributes: - * - * - version: Which version of the source map spec this map is following. - * - sources: An array of URLs to the original source files. - * - names: An array of identifiers which can be referrenced by individual mappings. - * - sourceRoot: Optional. The URL root from which all sources are relative. - * - sourcesContent: Optional. An array of contents of the original source files. - * - mappings: A string of base64 VLQs which contain the actual mappings. - * - file: Optional. The generated file this source map is associated with. - * - * Here is an example source map, taken from the source map spec[0]: - * - * { - * version : 3, - * file: "out.js", - * sourceRoot : "", - * sources: ["foo.js", "bar.js"], - * names: ["src", "maps", "are", "fun"], - * mappings: "AA,AB;;ABCDE;" - * } - * - * The second parameter, if given, is a string whose value is the URL - * at which the source map was found. This URL is used to compute the - * sources array. - * - * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit?pli=1# - */ -function BasicSourceMapConsumer(aSourceMap, aSourceMapURL) { - var sourceMap = aSourceMap; - if (typeof aSourceMap === 'string') { - sourceMap = util.parseSourceMapInput(aSourceMap); - } - - var version = util.getArg(sourceMap, 'version'); - var sources = util.getArg(sourceMap, 'sources'); - // Sass 3.3 leaves out the 'names' array, so we deviate from the spec (which - // requires the array) to play nice here. - var names = util.getArg(sourceMap, 'names', []); - var sourceRoot = util.getArg(sourceMap, 'sourceRoot', null); - var sourcesContent = util.getArg(sourceMap, 'sourcesContent', null); - var mappings = util.getArg(sourceMap, 'mappings'); - var file = util.getArg(sourceMap, 'file', null); - - // Once again, Sass deviates from the spec and supplies the version as a - // string rather than a number, so we use loose equality checking here. - if (version != this._version) { - throw new Error('Unsupported version: ' + version); - } - - if (sourceRoot) { - sourceRoot = util.normalize(sourceRoot); - } - - sources = sources - .map(String) - // Some source maps produce relative source paths like "./foo.js" instead of - // "foo.js". Normalize these first so that future comparisons will succeed. - // See bugzil.la/1090768. - .map(util.normalize) - // Always ensure that absolute sources are internally stored relative to - // the source root, if the source root is absolute. Not doing this would - // be particularly problematic when the source root is a prefix of the - // source (valid, but why??). See github issue #199 and bugzil.la/1188982. - .map(function (source) { - return sourceRoot && util.isAbsolute(sourceRoot) && util.isAbsolute(source) - ? util.relative(sourceRoot, source) - : source; - }); - - // Pass `true` below to allow duplicate names and sources. While source maps - // are intended to be compressed and deduplicated, the TypeScript compiler - // sometimes generates source maps with duplicates in them. See Github issue - // #72 and bugzil.la/889492. - this._names = ArraySet.fromArray(names.map(String), true); - this._sources = ArraySet.fromArray(sources, true); - - this._absoluteSources = this._sources.toArray().map(function (s) { - return util.computeSourceURL(sourceRoot, s, aSourceMapURL); - }); - - this.sourceRoot = sourceRoot; - this.sourcesContent = sourcesContent; - this._mappings = mappings; - this._sourceMapURL = aSourceMapURL; - this.file = file; -} - -BasicSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype); -BasicSourceMapConsumer.prototype.consumer = SourceMapConsumer; - -/** - * Utility function to find the index of a source. Returns -1 if not - * found. - */ -BasicSourceMapConsumer.prototype._findSourceIndex = function(aSource) { - var relativeSource = aSource; - if (this.sourceRoot != null) { - relativeSource = util.relative(this.sourceRoot, relativeSource); - } - - if (this._sources.has(relativeSource)) { - return this._sources.indexOf(relativeSource); - } - - // Maybe aSource is an absolute URL as returned by |sources|. In - // this case we can't simply undo the transform. - var i; - for (i = 0; i < this._absoluteSources.length; ++i) { - if (this._absoluteSources[i] == aSource) { - return i; - } - } - - return -1; -}; - -/** - * Create a BasicSourceMapConsumer from a SourceMapGenerator. - * - * @param SourceMapGenerator aSourceMap - * The source map that will be consumed. - * @param String aSourceMapURL - * The URL at which the source map can be found (optional) - * @returns BasicSourceMapConsumer - */ -BasicSourceMapConsumer.fromSourceMap = - function SourceMapConsumer_fromSourceMap(aSourceMap, aSourceMapURL) { - var smc = Object.create(BasicSourceMapConsumer.prototype); - - var names = smc._names = ArraySet.fromArray(aSourceMap._names.toArray(), true); - var sources = smc._sources = ArraySet.fromArray(aSourceMap._sources.toArray(), true); - smc.sourceRoot = aSourceMap._sourceRoot; - smc.sourcesContent = aSourceMap._generateSourcesContent(smc._sources.toArray(), - smc.sourceRoot); - smc.file = aSourceMap._file; - smc._sourceMapURL = aSourceMapURL; - smc._absoluteSources = smc._sources.toArray().map(function (s) { - return util.computeSourceURL(smc.sourceRoot, s, aSourceMapURL); - }); - - // Because we are modifying the entries (by converting string sources and - // names to indices into the sources and names ArraySets), we have to make - // a copy of the entry or else bad things happen. Shared mutable state - // strikes again! See github issue #191. - - var generatedMappings = aSourceMap._mappings.toArray().slice(); - var destGeneratedMappings = smc.__generatedMappings = []; - var destOriginalMappings = smc.__originalMappings = []; - - for (var i = 0, length = generatedMappings.length; i < length; i++) { - var srcMapping = generatedMappings[i]; - var destMapping = new Mapping; - destMapping.generatedLine = srcMapping.generatedLine; - destMapping.generatedColumn = srcMapping.generatedColumn; - - if (srcMapping.source) { - destMapping.source = sources.indexOf(srcMapping.source); - destMapping.originalLine = srcMapping.originalLine; - destMapping.originalColumn = srcMapping.originalColumn; - - if (srcMapping.name) { - destMapping.name = names.indexOf(srcMapping.name); - } - - destOriginalMappings.push(destMapping); - } - - destGeneratedMappings.push(destMapping); - } - - quickSort(smc.__originalMappings, util.compareByOriginalPositions); - - return smc; - }; - -/** - * The version of the source mapping spec that we are consuming. - */ -BasicSourceMapConsumer.prototype._version = 3; - -/** - * The list of original sources. - */ -Object.defineProperty(BasicSourceMapConsumer.prototype, 'sources', { - get: function () { - return this._absoluteSources.slice(); - } -}); - -/** - * Provide the JIT with a nice shape / hidden class. - */ -function Mapping() { - this.generatedLine = 0; - this.generatedColumn = 0; - this.source = null; - this.originalLine = null; - this.originalColumn = null; - this.name = null; -} - -/** - * Parse the mappings in a string in to a data structure which we can easily - * query (the ordered arrays in the `this.__generatedMappings` and - * `this.__originalMappings` properties). - */ -BasicSourceMapConsumer.prototype._parseMappings = - function SourceMapConsumer_parseMappings(aStr, aSourceRoot) { - var generatedLine = 1; - var previousGeneratedColumn = 0; - var previousOriginalLine = 0; - var previousOriginalColumn = 0; - var previousSource = 0; - var previousName = 0; - var length = aStr.length; - var index = 0; - var cachedSegments = {}; - var temp = {}; - var originalMappings = []; - var generatedMappings = []; - var mapping, str, segment, end, value; - - while (index < length) { - if (aStr.charAt(index) === ';') { - generatedLine++; - index++; - previousGeneratedColumn = 0; - } - else if (aStr.charAt(index) === ',') { - index++; - } - else { - mapping = new Mapping(); - mapping.generatedLine = generatedLine; - - // Because each offset is encoded relative to the previous one, - // many segments often have the same encoding. We can exploit this - // fact by caching the parsed variable length fields of each segment, - // allowing us to avoid a second parse if we encounter the same - // segment again. - for (end = index; end < length; end++) { - if (this._charIsMappingSeparator(aStr, end)) { - break; - } - } - str = aStr.slice(index, end); - - segment = cachedSegments[str]; - if (segment) { - index += str.length; - } else { - segment = []; - while (index < end) { - base64VLQ.decode(aStr, index, temp); - value = temp.value; - index = temp.rest; - segment.push(value); - } - - if (segment.length === 2) { - throw new Error('Found a source, but no line and column'); - } - - if (segment.length === 3) { - throw new Error('Found a source and line, but no column'); - } - - cachedSegments[str] = segment; - } - - // Generated column. - mapping.generatedColumn = previousGeneratedColumn + segment[0]; - previousGeneratedColumn = mapping.generatedColumn; - - if (segment.length > 1) { - // Original source. - mapping.source = previousSource + segment[1]; - previousSource += segment[1]; - - // Original line. - mapping.originalLine = previousOriginalLine + segment[2]; - previousOriginalLine = mapping.originalLine; - // Lines are stored 0-based - mapping.originalLine += 1; - - // Original column. - mapping.originalColumn = previousOriginalColumn + segment[3]; - previousOriginalColumn = mapping.originalColumn; - - if (segment.length > 4) { - // Original name. - mapping.name = previousName + segment[4]; - previousName += segment[4]; - } - } - - generatedMappings.push(mapping); - if (typeof mapping.originalLine === 'number') { - originalMappings.push(mapping); - } - } - } - - quickSort(generatedMappings, util.compareByGeneratedPositionsDeflated); - this.__generatedMappings = generatedMappings; - - quickSort(originalMappings, util.compareByOriginalPositions); - this.__originalMappings = originalMappings; - }; - -/** - * Find the mapping that best matches the hypothetical "needle" mapping that - * we are searching for in the given "haystack" of mappings. - */ -BasicSourceMapConsumer.prototype._findMapping = - function SourceMapConsumer_findMapping(aNeedle, aMappings, aLineName, - aColumnName, aComparator, aBias) { - // To return the position we are searching for, we must first find the - // mapping for the given position and then return the opposite position it - // points to. Because the mappings are sorted, we can use binary search to - // find the best mapping. - - if (aNeedle[aLineName] <= 0) { - throw new TypeError('Line must be greater than or equal to 1, got ' - + aNeedle[aLineName]); - } - if (aNeedle[aColumnName] < 0) { - throw new TypeError('Column must be greater than or equal to 0, got ' - + aNeedle[aColumnName]); - } - - return binarySearch.search(aNeedle, aMappings, aComparator, aBias); - }; - -/** - * Compute the last column for each generated mapping. The last column is - * inclusive. - */ -BasicSourceMapConsumer.prototype.computeColumnSpans = - function SourceMapConsumer_computeColumnSpans() { - for (var index = 0; index < this._generatedMappings.length; ++index) { - var mapping = this._generatedMappings[index]; - - // Mappings do not contain a field for the last generated columnt. We - // can come up with an optimistic estimate, however, by assuming that - // mappings are contiguous (i.e. given two consecutive mappings, the - // first mapping ends where the second one starts). - if (index + 1 < this._generatedMappings.length) { - var nextMapping = this._generatedMappings[index + 1]; - - if (mapping.generatedLine === nextMapping.generatedLine) { - mapping.lastGeneratedColumn = nextMapping.generatedColumn - 1; - continue; - } - } - - // The last mapping for each line spans the entire line. - mapping.lastGeneratedColumn = Infinity; - } - }; - -/** - * Returns the original source, line, and column information for the generated - * source's line and column positions provided. The only argument is an object - * with the following properties: - * - * - line: The line number in the generated source. The line number - * is 1-based. - * - column: The column number in the generated source. The column - * number is 0-based. - * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or - * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the - * closest element that is smaller than or greater than the one we are - * searching for, respectively, if the exact element cannot be found. - * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'. - * - * and an object is returned with the following properties: - * - * - source: The original source file, or null. - * - line: The line number in the original source, or null. The - * line number is 1-based. - * - column: The column number in the original source, or null. The - * column number is 0-based. - * - name: The original identifier, or null. - */ -BasicSourceMapConsumer.prototype.originalPositionFor = - function SourceMapConsumer_originalPositionFor(aArgs) { - var needle = { - generatedLine: util.getArg(aArgs, 'line'), - generatedColumn: util.getArg(aArgs, 'column') - }; - - var index = this._findMapping( - needle, - this._generatedMappings, - "generatedLine", - "generatedColumn", - util.compareByGeneratedPositionsDeflated, - util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND) - ); - - if (index >= 0) { - var mapping = this._generatedMappings[index]; - - if (mapping.generatedLine === needle.generatedLine) { - var source = util.getArg(mapping, 'source', null); - if (source !== null) { - source = this._sources.at(source); - source = util.computeSourceURL(this.sourceRoot, source, this._sourceMapURL); - } - var name = util.getArg(mapping, 'name', null); - if (name !== null) { - name = this._names.at(name); - } - return { - source: source, - line: util.getArg(mapping, 'originalLine', null), - column: util.getArg(mapping, 'originalColumn', null), - name: name - }; - } - } - - return { - source: null, - line: null, - column: null, - name: null - }; - }; - -/** - * Return true if we have the source content for every source in the source - * map, false otherwise. - */ -BasicSourceMapConsumer.prototype.hasContentsOfAllSources = - function BasicSourceMapConsumer_hasContentsOfAllSources() { - if (!this.sourcesContent) { - return false; - } - return this.sourcesContent.length >= this._sources.size() && - !this.sourcesContent.some(function (sc) { return sc == null; }); - }; - -/** - * Returns the original source content. The only argument is the url of the - * original source file. Returns null if no original source content is - * available. - */ -BasicSourceMapConsumer.prototype.sourceContentFor = - function SourceMapConsumer_sourceContentFor(aSource, nullOnMissing) { - if (!this.sourcesContent) { - return null; - } - - var index = this._findSourceIndex(aSource); - if (index >= 0) { - return this.sourcesContent[index]; - } - - var relativeSource = aSource; - if (this.sourceRoot != null) { - relativeSource = util.relative(this.sourceRoot, relativeSource); - } - - var url; - if (this.sourceRoot != null - && (url = util.urlParse(this.sourceRoot))) { - // XXX: file:// URIs and absolute paths lead to unexpected behavior for - // many users. We can help them out when they expect file:// URIs to - // behave like it would if they were running a local HTTP server. See - // https://bugzilla.mozilla.org/show_bug.cgi?id=885597. - var fileUriAbsPath = relativeSource.replace(/^file:\/\//, ""); - if (url.scheme == "file" - && this._sources.has(fileUriAbsPath)) { - return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)] - } - - if ((!url.path || url.path == "/") - && this._sources.has("/" + relativeSource)) { - return this.sourcesContent[this._sources.indexOf("/" + relativeSource)]; - } - } - - // This function is used recursively from - // IndexedSourceMapConsumer.prototype.sourceContentFor. In that case, we - // don't want to throw if we can't find the source - we just want to - // return null, so we provide a flag to exit gracefully. - if (nullOnMissing) { - return null; - } - else { - throw new Error('"' + relativeSource + '" is not in the SourceMap.'); - } - }; - -/** - * Returns the generated line and column information for the original source, - * line, and column positions provided. The only argument is an object with - * the following properties: - * - * - source: The filename of the original source. - * - line: The line number in the original source. The line number - * is 1-based. - * - column: The column number in the original source. The column - * number is 0-based. - * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or - * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the - * closest element that is smaller than or greater than the one we are - * searching for, respectively, if the exact element cannot be found. - * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'. - * - * and an object is returned with the following properties: - * - * - line: The line number in the generated source, or null. The - * line number is 1-based. - * - column: The column number in the generated source, or null. - * The column number is 0-based. - */ -BasicSourceMapConsumer.prototype.generatedPositionFor = - function SourceMapConsumer_generatedPositionFor(aArgs) { - var source = util.getArg(aArgs, 'source'); - source = this._findSourceIndex(source); - if (source < 0) { - return { - line: null, - column: null, - lastColumn: null - }; - } - - var needle = { - source: source, - originalLine: util.getArg(aArgs, 'line'), - originalColumn: util.getArg(aArgs, 'column') - }; - - var index = this._findMapping( - needle, - this._originalMappings, - "originalLine", - "originalColumn", - util.compareByOriginalPositions, - util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND) - ); - - if (index >= 0) { - var mapping = this._originalMappings[index]; - - if (mapping.source === needle.source) { - return { - line: util.getArg(mapping, 'generatedLine', null), - column: util.getArg(mapping, 'generatedColumn', null), - lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null) - }; - } - } - - return { - line: null, - column: null, - lastColumn: null - }; - }; - -exports.BasicSourceMapConsumer = BasicSourceMapConsumer; - -/** - * An IndexedSourceMapConsumer instance represents a parsed source map which - * we can query for information. It differs from BasicSourceMapConsumer in - * that it takes "indexed" source maps (i.e. ones with a "sections" field) as - * input. - * - * The first parameter is a raw source map (either as a JSON string, or already - * parsed to an object). According to the spec for indexed source maps, they - * have the following attributes: - * - * - version: Which version of the source map spec this map is following. - * - file: Optional. The generated file this source map is associated with. - * - sections: A list of section definitions. - * - * Each value under the "sections" field has two fields: - * - offset: The offset into the original specified at which this section - * begins to apply, defined as an object with a "line" and "column" - * field. - * - map: A source map definition. This source map could also be indexed, - * but doesn't have to be. - * - * Instead of the "map" field, it's also possible to have a "url" field - * specifying a URL to retrieve a source map from, but that's currently - * unsupported. - * - * Here's an example source map, taken from the source map spec[0], but - * modified to omit a section which uses the "url" field. - * - * { - * version : 3, - * file: "app.js", - * sections: [{ - * offset: {line:100, column:10}, - * map: { - * version : 3, - * file: "section.js", - * sources: ["foo.js", "bar.js"], - * names: ["src", "maps", "are", "fun"], - * mappings: "AAAA,E;;ABCDE;" - * } - * }], - * } - * - * The second parameter, if given, is a string whose value is the URL - * at which the source map was found. This URL is used to compute the - * sources array. - * - * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit#heading=h.535es3xeprgt - */ -function IndexedSourceMapConsumer(aSourceMap, aSourceMapURL) { - var sourceMap = aSourceMap; - if (typeof aSourceMap === 'string') { - sourceMap = util.parseSourceMapInput(aSourceMap); - } - - var version = util.getArg(sourceMap, 'version'); - var sections = util.getArg(sourceMap, 'sections'); - - if (version != this._version) { - throw new Error('Unsupported version: ' + version); - } - - this._sources = new ArraySet(); - this._names = new ArraySet(); - - var lastOffset = { - line: -1, - column: 0 - }; - this._sections = sections.map(function (s) { - if (s.url) { - // The url field will require support for asynchronicity. - // See https://github.com/mozilla/source-map/issues/16 - throw new Error('Support for url field in sections not implemented.'); - } - var offset = util.getArg(s, 'offset'); - var offsetLine = util.getArg(offset, 'line'); - var offsetColumn = util.getArg(offset, 'column'); - - if (offsetLine < lastOffset.line || - (offsetLine === lastOffset.line && offsetColumn < lastOffset.column)) { - throw new Error('Section offsets must be ordered and non-overlapping.'); - } - lastOffset = offset; - - return { - generatedOffset: { - // The offset fields are 0-based, but we use 1-based indices when - // encoding/decoding from VLQ. - generatedLine: offsetLine + 1, - generatedColumn: offsetColumn + 1 - }, - consumer: new SourceMapConsumer(util.getArg(s, 'map'), aSourceMapURL) - } - }); -} - -IndexedSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype); -IndexedSourceMapConsumer.prototype.constructor = SourceMapConsumer; - -/** - * The version of the source mapping spec that we are consuming. - */ -IndexedSourceMapConsumer.prototype._version = 3; - -/** - * The list of original sources. - */ -Object.defineProperty(IndexedSourceMapConsumer.prototype, 'sources', { - get: function () { - var sources = []; - for (var i = 0; i < this._sections.length; i++) { - for (var j = 0; j < this._sections[i].consumer.sources.length; j++) { - sources.push(this._sections[i].consumer.sources[j]); - } - } - return sources; - } -}); - -/** - * Returns the original source, line, and column information for the generated - * source's line and column positions provided. The only argument is an object - * with the following properties: - * - * - line: The line number in the generated source. The line number - * is 1-based. - * - column: The column number in the generated source. The column - * number is 0-based. - * - * and an object is returned with the following properties: - * - * - source: The original source file, or null. - * - line: The line number in the original source, or null. The - * line number is 1-based. - * - column: The column number in the original source, or null. The - * column number is 0-based. - * - name: The original identifier, or null. - */ -IndexedSourceMapConsumer.prototype.originalPositionFor = - function IndexedSourceMapConsumer_originalPositionFor(aArgs) { - var needle = { - generatedLine: util.getArg(aArgs, 'line'), - generatedColumn: util.getArg(aArgs, 'column') - }; - - // Find the section containing the generated position we're trying to map - // to an original position. - var sectionIndex = binarySearch.search(needle, this._sections, - function(needle, section) { - var cmp = needle.generatedLine - section.generatedOffset.generatedLine; - if (cmp) { - return cmp; - } - - return (needle.generatedColumn - - section.generatedOffset.generatedColumn); - }); - var section = this._sections[sectionIndex]; - - if (!section) { - return { - source: null, - line: null, - column: null, - name: null - }; - } - - return section.consumer.originalPositionFor({ - line: needle.generatedLine - - (section.generatedOffset.generatedLine - 1), - column: needle.generatedColumn - - (section.generatedOffset.generatedLine === needle.generatedLine - ? section.generatedOffset.generatedColumn - 1 - : 0), - bias: aArgs.bias - }); - }; - -/** - * Return true if we have the source content for every source in the source - * map, false otherwise. - */ -IndexedSourceMapConsumer.prototype.hasContentsOfAllSources = - function IndexedSourceMapConsumer_hasContentsOfAllSources() { - return this._sections.every(function (s) { - return s.consumer.hasContentsOfAllSources(); - }); - }; - -/** - * Returns the original source content. The only argument is the url of the - * original source file. Returns null if no original source content is - * available. - */ -IndexedSourceMapConsumer.prototype.sourceContentFor = - function IndexedSourceMapConsumer_sourceContentFor(aSource, nullOnMissing) { - for (var i = 0; i < this._sections.length; i++) { - var section = this._sections[i]; - - var content = section.consumer.sourceContentFor(aSource, true); - if (content) { - return content; - } - } - if (nullOnMissing) { - return null; - } - else { - throw new Error('"' + aSource + '" is not in the SourceMap.'); - } - }; - -/** - * Returns the generated line and column information for the original source, - * line, and column positions provided. The only argument is an object with - * the following properties: - * - * - source: The filename of the original source. - * - line: The line number in the original source. The line number - * is 1-based. - * - column: The column number in the original source. The column - * number is 0-based. - * - * and an object is returned with the following properties: - * - * - line: The line number in the generated source, or null. The - * line number is 1-based. - * - column: The column number in the generated source, or null. - * The column number is 0-based. - */ -IndexedSourceMapConsumer.prototype.generatedPositionFor = - function IndexedSourceMapConsumer_generatedPositionFor(aArgs) { - for (var i = 0; i < this._sections.length; i++) { - var section = this._sections[i]; - - // Only consider this section if the requested source is in the list of - // sources of the consumer. - if (section.consumer._findSourceIndex(util.getArg(aArgs, 'source')) === -1) { - continue; - } - var generatedPosition = section.consumer.generatedPositionFor(aArgs); - if (generatedPosition) { - var ret = { - line: generatedPosition.line + - (section.generatedOffset.generatedLine - 1), - column: generatedPosition.column + - (section.generatedOffset.generatedLine === generatedPosition.line - ? section.generatedOffset.generatedColumn - 1 - : 0) - }; - return ret; - } - } - - return { - line: null, - column: null - }; - }; - -/** - * Parse the mappings in a string in to a data structure which we can easily - * query (the ordered arrays in the `this.__generatedMappings` and - * `this.__originalMappings` properties). - */ -IndexedSourceMapConsumer.prototype._parseMappings = - function IndexedSourceMapConsumer_parseMappings(aStr, aSourceRoot) { - this.__generatedMappings = []; - this.__originalMappings = []; - for (var i = 0; i < this._sections.length; i++) { - var section = this._sections[i]; - var sectionMappings = section.consumer._generatedMappings; - for (var j = 0; j < sectionMappings.length; j++) { - var mapping = sectionMappings[j]; - - var source = section.consumer._sources.at(mapping.source); - source = util.computeSourceURL(section.consumer.sourceRoot, source, this._sourceMapURL); - this._sources.add(source); - source = this._sources.indexOf(source); - - var name = null; - if (mapping.name) { - name = section.consumer._names.at(mapping.name); - this._names.add(name); - name = this._names.indexOf(name); - } - - // The mappings coming from the consumer for the section have - // generated positions relative to the start of the section, so we - // need to offset them to be relative to the start of the concatenated - // generated file. - var adjustedMapping = { - source: source, - generatedLine: mapping.generatedLine + - (section.generatedOffset.generatedLine - 1), - generatedColumn: mapping.generatedColumn + - (section.generatedOffset.generatedLine === mapping.generatedLine - ? section.generatedOffset.generatedColumn - 1 - : 0), - originalLine: mapping.originalLine, - originalColumn: mapping.originalColumn, - name: name - }; - - this.__generatedMappings.push(adjustedMapping); - if (typeof adjustedMapping.originalLine === 'number') { - this.__originalMappings.push(adjustedMapping); - } - } - } - - quickSort(this.__generatedMappings, util.compareByGeneratedPositionsDeflated); - quickSort(this.__originalMappings, util.compareByOriginalPositions); - }; - -exports.IndexedSourceMapConsumer = IndexedSourceMapConsumer; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/source-map/lib/source-map-generator.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/source-map/lib/source-map-generator.js deleted file mode 100644 index 508bcfbb..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/source-map/lib/source-map-generator.js +++ /dev/null @@ -1,425 +0,0 @@ -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - -var base64VLQ = require('./base64-vlq'); -var util = require('./util'); -var ArraySet = require('./array-set').ArraySet; -var MappingList = require('./mapping-list').MappingList; - -/** - * An instance of the SourceMapGenerator represents a source map which is - * being built incrementally. You may pass an object with the following - * properties: - * - * - file: The filename of the generated source. - * - sourceRoot: A root for all relative URLs in this source map. - */ -function SourceMapGenerator(aArgs) { - if (!aArgs) { - aArgs = {}; - } - this._file = util.getArg(aArgs, 'file', null); - this._sourceRoot = util.getArg(aArgs, 'sourceRoot', null); - this._skipValidation = util.getArg(aArgs, 'skipValidation', false); - this._sources = new ArraySet(); - this._names = new ArraySet(); - this._mappings = new MappingList(); - this._sourcesContents = null; -} - -SourceMapGenerator.prototype._version = 3; - -/** - * Creates a new SourceMapGenerator based on a SourceMapConsumer - * - * @param aSourceMapConsumer The SourceMap. - */ -SourceMapGenerator.fromSourceMap = - function SourceMapGenerator_fromSourceMap(aSourceMapConsumer) { - var sourceRoot = aSourceMapConsumer.sourceRoot; - var generator = new SourceMapGenerator({ - file: aSourceMapConsumer.file, - sourceRoot: sourceRoot - }); - aSourceMapConsumer.eachMapping(function (mapping) { - var newMapping = { - generated: { - line: mapping.generatedLine, - column: mapping.generatedColumn - } - }; - - if (mapping.source != null) { - newMapping.source = mapping.source; - if (sourceRoot != null) { - newMapping.source = util.relative(sourceRoot, newMapping.source); - } - - newMapping.original = { - line: mapping.originalLine, - column: mapping.originalColumn - }; - - if (mapping.name != null) { - newMapping.name = mapping.name; - } - } - - generator.addMapping(newMapping); - }); - aSourceMapConsumer.sources.forEach(function (sourceFile) { - var sourceRelative = sourceFile; - if (sourceRoot !== null) { - sourceRelative = util.relative(sourceRoot, sourceFile); - } - - if (!generator._sources.has(sourceRelative)) { - generator._sources.add(sourceRelative); - } - - var content = aSourceMapConsumer.sourceContentFor(sourceFile); - if (content != null) { - generator.setSourceContent(sourceFile, content); - } - }); - return generator; - }; - -/** - * Add a single mapping from original source line and column to the generated - * source's line and column for this source map being created. The mapping - * object should have the following properties: - * - * - generated: An object with the generated line and column positions. - * - original: An object with the original line and column positions. - * - source: The original source file (relative to the sourceRoot). - * - name: An optional original token name for this mapping. - */ -SourceMapGenerator.prototype.addMapping = - function SourceMapGenerator_addMapping(aArgs) { - var generated = util.getArg(aArgs, 'generated'); - var original = util.getArg(aArgs, 'original', null); - var source = util.getArg(aArgs, 'source', null); - var name = util.getArg(aArgs, 'name', null); - - if (!this._skipValidation) { - this._validateMapping(generated, original, source, name); - } - - if (source != null) { - source = String(source); - if (!this._sources.has(source)) { - this._sources.add(source); - } - } - - if (name != null) { - name = String(name); - if (!this._names.has(name)) { - this._names.add(name); - } - } - - this._mappings.add({ - generatedLine: generated.line, - generatedColumn: generated.column, - originalLine: original != null && original.line, - originalColumn: original != null && original.column, - source: source, - name: name - }); - }; - -/** - * Set the source content for a source file. - */ -SourceMapGenerator.prototype.setSourceContent = - function SourceMapGenerator_setSourceContent(aSourceFile, aSourceContent) { - var source = aSourceFile; - if (this._sourceRoot != null) { - source = util.relative(this._sourceRoot, source); - } - - if (aSourceContent != null) { - // Add the source content to the _sourcesContents map. - // Create a new _sourcesContents map if the property is null. - if (!this._sourcesContents) { - this._sourcesContents = Object.create(null); - } - this._sourcesContents[util.toSetString(source)] = aSourceContent; - } else if (this._sourcesContents) { - // Remove the source file from the _sourcesContents map. - // If the _sourcesContents map is empty, set the property to null. - delete this._sourcesContents[util.toSetString(source)]; - if (Object.keys(this._sourcesContents).length === 0) { - this._sourcesContents = null; - } - } - }; - -/** - * Applies the mappings of a sub-source-map for a specific source file to the - * source map being generated. Each mapping to the supplied source file is - * rewritten using the supplied source map. Note: The resolution for the - * resulting mappings is the minimium of this map and the supplied map. - * - * @param aSourceMapConsumer The source map to be applied. - * @param aSourceFile Optional. The filename of the source file. - * If omitted, SourceMapConsumer's file property will be used. - * @param aSourceMapPath Optional. The dirname of the path to the source map - * to be applied. If relative, it is relative to the SourceMapConsumer. - * This parameter is needed when the two source maps aren't in the same - * directory, and the source map to be applied contains relative source - * paths. If so, those relative source paths need to be rewritten - * relative to the SourceMapGenerator. - */ -SourceMapGenerator.prototype.applySourceMap = - function SourceMapGenerator_applySourceMap(aSourceMapConsumer, aSourceFile, aSourceMapPath) { - var sourceFile = aSourceFile; - // If aSourceFile is omitted, we will use the file property of the SourceMap - if (aSourceFile == null) { - if (aSourceMapConsumer.file == null) { - throw new Error( - 'SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, ' + - 'or the source map\'s "file" property. Both were omitted.' - ); - } - sourceFile = aSourceMapConsumer.file; - } - var sourceRoot = this._sourceRoot; - // Make "sourceFile" relative if an absolute Url is passed. - if (sourceRoot != null) { - sourceFile = util.relative(sourceRoot, sourceFile); - } - // Applying the SourceMap can add and remove items from the sources and - // the names array. - var newSources = new ArraySet(); - var newNames = new ArraySet(); - - // Find mappings for the "sourceFile" - this._mappings.unsortedForEach(function (mapping) { - if (mapping.source === sourceFile && mapping.originalLine != null) { - // Check if it can be mapped by the source map, then update the mapping. - var original = aSourceMapConsumer.originalPositionFor({ - line: mapping.originalLine, - column: mapping.originalColumn - }); - if (original.source != null) { - // Copy mapping - mapping.source = original.source; - if (aSourceMapPath != null) { - mapping.source = util.join(aSourceMapPath, mapping.source) - } - if (sourceRoot != null) { - mapping.source = util.relative(sourceRoot, mapping.source); - } - mapping.originalLine = original.line; - mapping.originalColumn = original.column; - if (original.name != null) { - mapping.name = original.name; - } - } - } - - var source = mapping.source; - if (source != null && !newSources.has(source)) { - newSources.add(source); - } - - var name = mapping.name; - if (name != null && !newNames.has(name)) { - newNames.add(name); - } - - }, this); - this._sources = newSources; - this._names = newNames; - - // Copy sourcesContents of applied map. - aSourceMapConsumer.sources.forEach(function (sourceFile) { - var content = aSourceMapConsumer.sourceContentFor(sourceFile); - if (content != null) { - if (aSourceMapPath != null) { - sourceFile = util.join(aSourceMapPath, sourceFile); - } - if (sourceRoot != null) { - sourceFile = util.relative(sourceRoot, sourceFile); - } - this.setSourceContent(sourceFile, content); - } - }, this); - }; - -/** - * A mapping can have one of the three levels of data: - * - * 1. Just the generated position. - * 2. The Generated position, original position, and original source. - * 3. Generated and original position, original source, as well as a name - * token. - * - * To maintain consistency, we validate that any new mapping being added falls - * in to one of these categories. - */ -SourceMapGenerator.prototype._validateMapping = - function SourceMapGenerator_validateMapping(aGenerated, aOriginal, aSource, - aName) { - // When aOriginal is truthy but has empty values for .line and .column, - // it is most likely a programmer error. In this case we throw a very - // specific error message to try to guide them the right way. - // For example: https://github.com/Polymer/polymer-bundler/pull/519 - if (aOriginal && typeof aOriginal.line !== 'number' && typeof aOriginal.column !== 'number') { - throw new Error( - 'original.line and original.column are not numbers -- you probably meant to omit ' + - 'the original mapping entirely and only map the generated position. If so, pass ' + - 'null for the original mapping instead of an object with empty or null values.' - ); - } - - if (aGenerated && 'line' in aGenerated && 'column' in aGenerated - && aGenerated.line > 0 && aGenerated.column >= 0 - && !aOriginal && !aSource && !aName) { - // Case 1. - return; - } - else if (aGenerated && 'line' in aGenerated && 'column' in aGenerated - && aOriginal && 'line' in aOriginal && 'column' in aOriginal - && aGenerated.line > 0 && aGenerated.column >= 0 - && aOriginal.line > 0 && aOriginal.column >= 0 - && aSource) { - // Cases 2 and 3. - return; - } - else { - throw new Error('Invalid mapping: ' + JSON.stringify({ - generated: aGenerated, - source: aSource, - original: aOriginal, - name: aName - })); - } - }; - -/** - * Serialize the accumulated mappings in to the stream of base 64 VLQs - * specified by the source map format. - */ -SourceMapGenerator.prototype._serializeMappings = - function SourceMapGenerator_serializeMappings() { - var previousGeneratedColumn = 0; - var previousGeneratedLine = 1; - var previousOriginalColumn = 0; - var previousOriginalLine = 0; - var previousName = 0; - var previousSource = 0; - var result = ''; - var next; - var mapping; - var nameIdx; - var sourceIdx; - - var mappings = this._mappings.toArray(); - for (var i = 0, len = mappings.length; i < len; i++) { - mapping = mappings[i]; - next = '' - - if (mapping.generatedLine !== previousGeneratedLine) { - previousGeneratedColumn = 0; - while (mapping.generatedLine !== previousGeneratedLine) { - next += ';'; - previousGeneratedLine++; - } - } - else { - if (i > 0) { - if (!util.compareByGeneratedPositionsInflated(mapping, mappings[i - 1])) { - continue; - } - next += ','; - } - } - - next += base64VLQ.encode(mapping.generatedColumn - - previousGeneratedColumn); - previousGeneratedColumn = mapping.generatedColumn; - - if (mapping.source != null) { - sourceIdx = this._sources.indexOf(mapping.source); - next += base64VLQ.encode(sourceIdx - previousSource); - previousSource = sourceIdx; - - // lines are stored 0-based in SourceMap spec version 3 - next += base64VLQ.encode(mapping.originalLine - 1 - - previousOriginalLine); - previousOriginalLine = mapping.originalLine - 1; - - next += base64VLQ.encode(mapping.originalColumn - - previousOriginalColumn); - previousOriginalColumn = mapping.originalColumn; - - if (mapping.name != null) { - nameIdx = this._names.indexOf(mapping.name); - next += base64VLQ.encode(nameIdx - previousName); - previousName = nameIdx; - } - } - - result += next; - } - - return result; - }; - -SourceMapGenerator.prototype._generateSourcesContent = - function SourceMapGenerator_generateSourcesContent(aSources, aSourceRoot) { - return aSources.map(function (source) { - if (!this._sourcesContents) { - return null; - } - if (aSourceRoot != null) { - source = util.relative(aSourceRoot, source); - } - var key = util.toSetString(source); - return Object.prototype.hasOwnProperty.call(this._sourcesContents, key) - ? this._sourcesContents[key] - : null; - }, this); - }; - -/** - * Externalize the source map. - */ -SourceMapGenerator.prototype.toJSON = - function SourceMapGenerator_toJSON() { - var map = { - version: this._version, - sources: this._sources.toArray(), - names: this._names.toArray(), - mappings: this._serializeMappings() - }; - if (this._file != null) { - map.file = this._file; - } - if (this._sourceRoot != null) { - map.sourceRoot = this._sourceRoot; - } - if (this._sourcesContents) { - map.sourcesContent = this._generateSourcesContent(map.sources, map.sourceRoot); - } - - return map; - }; - -/** - * Render the source map being generated to a string. - */ -SourceMapGenerator.prototype.toString = - function SourceMapGenerator_toString() { - return JSON.stringify(this.toJSON()); - }; - -exports.SourceMapGenerator = SourceMapGenerator; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/source-map/lib/source-node.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/source-map/lib/source-node.js deleted file mode 100644 index 8bcdbe38..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/source-map/lib/source-node.js +++ /dev/null @@ -1,413 +0,0 @@ -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - -var SourceMapGenerator = require('./source-map-generator').SourceMapGenerator; -var util = require('./util'); - -// Matches a Windows-style `\r\n` newline or a `\n` newline used by all other -// operating systems these days (capturing the result). -var REGEX_NEWLINE = /(\r?\n)/; - -// Newline character code for charCodeAt() comparisons -var NEWLINE_CODE = 10; - -// Private symbol for identifying `SourceNode`s when multiple versions of -// the source-map library are loaded. This MUST NOT CHANGE across -// versions! -var isSourceNode = "$$$isSourceNode$$$"; - -/** - * SourceNodes provide a way to abstract over interpolating/concatenating - * snippets of generated JavaScript source code while maintaining the line and - * column information associated with the original source code. - * - * @param aLine The original line number. - * @param aColumn The original column number. - * @param aSource The original source's filename. - * @param aChunks Optional. An array of strings which are snippets of - * generated JS, or other SourceNodes. - * @param aName The original identifier. - */ -function SourceNode(aLine, aColumn, aSource, aChunks, aName) { - this.children = []; - this.sourceContents = {}; - this.line = aLine == null ? null : aLine; - this.column = aColumn == null ? null : aColumn; - this.source = aSource == null ? null : aSource; - this.name = aName == null ? null : aName; - this[isSourceNode] = true; - if (aChunks != null) this.add(aChunks); -} - -/** - * Creates a SourceNode from generated code and a SourceMapConsumer. - * - * @param aGeneratedCode The generated code - * @param aSourceMapConsumer The SourceMap for the generated code - * @param aRelativePath Optional. The path that relative sources in the - * SourceMapConsumer should be relative to. - */ -SourceNode.fromStringWithSourceMap = - function SourceNode_fromStringWithSourceMap(aGeneratedCode, aSourceMapConsumer, aRelativePath) { - // The SourceNode we want to fill with the generated code - // and the SourceMap - var node = new SourceNode(); - - // All even indices of this array are one line of the generated code, - // while all odd indices are the newlines between two adjacent lines - // (since `REGEX_NEWLINE` captures its match). - // Processed fragments are accessed by calling `shiftNextLine`. - var remainingLines = aGeneratedCode.split(REGEX_NEWLINE); - var remainingLinesIndex = 0; - var shiftNextLine = function() { - var lineContents = getNextLine(); - // The last line of a file might not have a newline. - var newLine = getNextLine() || ""; - return lineContents + newLine; - - function getNextLine() { - return remainingLinesIndex < remainingLines.length ? - remainingLines[remainingLinesIndex++] : undefined; - } - }; - - // We need to remember the position of "remainingLines" - var lastGeneratedLine = 1, lastGeneratedColumn = 0; - - // The generate SourceNodes we need a code range. - // To extract it current and last mapping is used. - // Here we store the last mapping. - var lastMapping = null; - - aSourceMapConsumer.eachMapping(function (mapping) { - if (lastMapping !== null) { - // We add the code from "lastMapping" to "mapping": - // First check if there is a new line in between. - if (lastGeneratedLine < mapping.generatedLine) { - // Associate first line with "lastMapping" - addMappingWithCode(lastMapping, shiftNextLine()); - lastGeneratedLine++; - lastGeneratedColumn = 0; - // The remaining code is added without mapping - } else { - // There is no new line in between. - // Associate the code between "lastGeneratedColumn" and - // "mapping.generatedColumn" with "lastMapping" - var nextLine = remainingLines[remainingLinesIndex] || ''; - var code = nextLine.substr(0, mapping.generatedColumn - - lastGeneratedColumn); - remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn - - lastGeneratedColumn); - lastGeneratedColumn = mapping.generatedColumn; - addMappingWithCode(lastMapping, code); - // No more remaining code, continue - lastMapping = mapping; - return; - } - } - // We add the generated code until the first mapping - // to the SourceNode without any mapping. - // Each line is added as separate string. - while (lastGeneratedLine < mapping.generatedLine) { - node.add(shiftNextLine()); - lastGeneratedLine++; - } - if (lastGeneratedColumn < mapping.generatedColumn) { - var nextLine = remainingLines[remainingLinesIndex] || ''; - node.add(nextLine.substr(0, mapping.generatedColumn)); - remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn); - lastGeneratedColumn = mapping.generatedColumn; - } - lastMapping = mapping; - }, this); - // We have processed all mappings. - if (remainingLinesIndex < remainingLines.length) { - if (lastMapping) { - // Associate the remaining code in the current line with "lastMapping" - addMappingWithCode(lastMapping, shiftNextLine()); - } - // and add the remaining lines without any mapping - node.add(remainingLines.splice(remainingLinesIndex).join("")); - } - - // Copy sourcesContent into SourceNode - aSourceMapConsumer.sources.forEach(function (sourceFile) { - var content = aSourceMapConsumer.sourceContentFor(sourceFile); - if (content != null) { - if (aRelativePath != null) { - sourceFile = util.join(aRelativePath, sourceFile); - } - node.setSourceContent(sourceFile, content); - } - }); - - return node; - - function addMappingWithCode(mapping, code) { - if (mapping === null || mapping.source === undefined) { - node.add(code); - } else { - var source = aRelativePath - ? util.join(aRelativePath, mapping.source) - : mapping.source; - node.add(new SourceNode(mapping.originalLine, - mapping.originalColumn, - source, - code, - mapping.name)); - } - } - }; - -/** - * Add a chunk of generated JS to this source node. - * - * @param aChunk A string snippet of generated JS code, another instance of - * SourceNode, or an array where each member is one of those things. - */ -SourceNode.prototype.add = function SourceNode_add(aChunk) { - if (Array.isArray(aChunk)) { - aChunk.forEach(function (chunk) { - this.add(chunk); - }, this); - } - else if (aChunk[isSourceNode] || typeof aChunk === "string") { - if (aChunk) { - this.children.push(aChunk); - } - } - else { - throw new TypeError( - "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk - ); - } - return this; -}; - -/** - * Add a chunk of generated JS to the beginning of this source node. - * - * @param aChunk A string snippet of generated JS code, another instance of - * SourceNode, or an array where each member is one of those things. - */ -SourceNode.prototype.prepend = function SourceNode_prepend(aChunk) { - if (Array.isArray(aChunk)) { - for (var i = aChunk.length-1; i >= 0; i--) { - this.prepend(aChunk[i]); - } - } - else if (aChunk[isSourceNode] || typeof aChunk === "string") { - this.children.unshift(aChunk); - } - else { - throw new TypeError( - "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk - ); - } - return this; -}; - -/** - * Walk over the tree of JS snippets in this node and its children. The - * walking function is called once for each snippet of JS and is passed that - * snippet and the its original associated source's line/column location. - * - * @param aFn The traversal function. - */ -SourceNode.prototype.walk = function SourceNode_walk(aFn) { - var chunk; - for (var i = 0, len = this.children.length; i < len; i++) { - chunk = this.children[i]; - if (chunk[isSourceNode]) { - chunk.walk(aFn); - } - else { - if (chunk !== '') { - aFn(chunk, { source: this.source, - line: this.line, - column: this.column, - name: this.name }); - } - } - } -}; - -/** - * Like `String.prototype.join` except for SourceNodes. Inserts `aStr` between - * each of `this.children`. - * - * @param aSep The separator. - */ -SourceNode.prototype.join = function SourceNode_join(aSep) { - var newChildren; - var i; - var len = this.children.length; - if (len > 0) { - newChildren = []; - for (i = 0; i < len-1; i++) { - newChildren.push(this.children[i]); - newChildren.push(aSep); - } - newChildren.push(this.children[i]); - this.children = newChildren; - } - return this; -}; - -/** - * Call String.prototype.replace on the very right-most source snippet. Useful - * for trimming whitespace from the end of a source node, etc. - * - * @param aPattern The pattern to replace. - * @param aReplacement The thing to replace the pattern with. - */ -SourceNode.prototype.replaceRight = function SourceNode_replaceRight(aPattern, aReplacement) { - var lastChild = this.children[this.children.length - 1]; - if (lastChild[isSourceNode]) { - lastChild.replaceRight(aPattern, aReplacement); - } - else if (typeof lastChild === 'string') { - this.children[this.children.length - 1] = lastChild.replace(aPattern, aReplacement); - } - else { - this.children.push(''.replace(aPattern, aReplacement)); - } - return this; -}; - -/** - * Set the source content for a source file. This will be added to the SourceMapGenerator - * in the sourcesContent field. - * - * @param aSourceFile The filename of the source file - * @param aSourceContent The content of the source file - */ -SourceNode.prototype.setSourceContent = - function SourceNode_setSourceContent(aSourceFile, aSourceContent) { - this.sourceContents[util.toSetString(aSourceFile)] = aSourceContent; - }; - -/** - * Walk over the tree of SourceNodes. The walking function is called for each - * source file content and is passed the filename and source content. - * - * @param aFn The traversal function. - */ -SourceNode.prototype.walkSourceContents = - function SourceNode_walkSourceContents(aFn) { - for (var i = 0, len = this.children.length; i < len; i++) { - if (this.children[i][isSourceNode]) { - this.children[i].walkSourceContents(aFn); - } - } - - var sources = Object.keys(this.sourceContents); - for (var i = 0, len = sources.length; i < len; i++) { - aFn(util.fromSetString(sources[i]), this.sourceContents[sources[i]]); - } - }; - -/** - * Return the string representation of this source node. Walks over the tree - * and concatenates all the various snippets together to one string. - */ -SourceNode.prototype.toString = function SourceNode_toString() { - var str = ""; - this.walk(function (chunk) { - str += chunk; - }); - return str; -}; - -/** - * Returns the string representation of this source node along with a source - * map. - */ -SourceNode.prototype.toStringWithSourceMap = function SourceNode_toStringWithSourceMap(aArgs) { - var generated = { - code: "", - line: 1, - column: 0 - }; - var map = new SourceMapGenerator(aArgs); - var sourceMappingActive = false; - var lastOriginalSource = null; - var lastOriginalLine = null; - var lastOriginalColumn = null; - var lastOriginalName = null; - this.walk(function (chunk, original) { - generated.code += chunk; - if (original.source !== null - && original.line !== null - && original.column !== null) { - if(lastOriginalSource !== original.source - || lastOriginalLine !== original.line - || lastOriginalColumn !== original.column - || lastOriginalName !== original.name) { - map.addMapping({ - source: original.source, - original: { - line: original.line, - column: original.column - }, - generated: { - line: generated.line, - column: generated.column - }, - name: original.name - }); - } - lastOriginalSource = original.source; - lastOriginalLine = original.line; - lastOriginalColumn = original.column; - lastOriginalName = original.name; - sourceMappingActive = true; - } else if (sourceMappingActive) { - map.addMapping({ - generated: { - line: generated.line, - column: generated.column - } - }); - lastOriginalSource = null; - sourceMappingActive = false; - } - for (var idx = 0, length = chunk.length; idx < length; idx++) { - if (chunk.charCodeAt(idx) === NEWLINE_CODE) { - generated.line++; - generated.column = 0; - // Mappings end at eol - if (idx + 1 === length) { - lastOriginalSource = null; - sourceMappingActive = false; - } else if (sourceMappingActive) { - map.addMapping({ - source: original.source, - original: { - line: original.line, - column: original.column - }, - generated: { - line: generated.line, - column: generated.column - }, - name: original.name - }); - } - } else { - generated.column++; - } - } - }); - this.walkSourceContents(function (sourceFile, sourceContent) { - map.setSourceContent(sourceFile, sourceContent); - }); - - return { code: generated.code, map: map }; -}; - -exports.SourceNode = SourceNode; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/source-map/lib/util.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/source-map/lib/util.js deleted file mode 100644 index 3ca92e56..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/source-map/lib/util.js +++ /dev/null @@ -1,488 +0,0 @@ -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - -/** - * This is a helper function for getting values from parameter/options - * objects. - * - * @param args The object we are extracting values from - * @param name The name of the property we are getting. - * @param defaultValue An optional value to return if the property is missing - * from the object. If this is not specified and the property is missing, an - * error will be thrown. - */ -function getArg(aArgs, aName, aDefaultValue) { - if (aName in aArgs) { - return aArgs[aName]; - } else if (arguments.length === 3) { - return aDefaultValue; - } else { - throw new Error('"' + aName + '" is a required argument.'); - } -} -exports.getArg = getArg; - -var urlRegexp = /^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/; -var dataUrlRegexp = /^data:.+\,.+$/; - -function urlParse(aUrl) { - var match = aUrl.match(urlRegexp); - if (!match) { - return null; - } - return { - scheme: match[1], - auth: match[2], - host: match[3], - port: match[4], - path: match[5] - }; -} -exports.urlParse = urlParse; - -function urlGenerate(aParsedUrl) { - var url = ''; - if (aParsedUrl.scheme) { - url += aParsedUrl.scheme + ':'; - } - url += '//'; - if (aParsedUrl.auth) { - url += aParsedUrl.auth + '@'; - } - if (aParsedUrl.host) { - url += aParsedUrl.host; - } - if (aParsedUrl.port) { - url += ":" + aParsedUrl.port - } - if (aParsedUrl.path) { - url += aParsedUrl.path; - } - return url; -} -exports.urlGenerate = urlGenerate; - -/** - * Normalizes a path, or the path portion of a URL: - * - * - Replaces consecutive slashes with one slash. - * - Removes unnecessary '.' parts. - * - Removes unnecessary '/..' parts. - * - * Based on code in the Node.js 'path' core module. - * - * @param aPath The path or url to normalize. - */ -function normalize(aPath) { - var path = aPath; - var url = urlParse(aPath); - if (url) { - if (!url.path) { - return aPath; - } - path = url.path; - } - var isAbsolute = exports.isAbsolute(path); - - var parts = path.split(/\/+/); - for (var part, up = 0, i = parts.length - 1; i >= 0; i--) { - part = parts[i]; - if (part === '.') { - parts.splice(i, 1); - } else if (part === '..') { - up++; - } else if (up > 0) { - if (part === '') { - // The first part is blank if the path is absolute. Trying to go - // above the root is a no-op. Therefore we can remove all '..' parts - // directly after the root. - parts.splice(i + 1, up); - up = 0; - } else { - parts.splice(i, 2); - up--; - } - } - } - path = parts.join('/'); - - if (path === '') { - path = isAbsolute ? '/' : '.'; - } - - if (url) { - url.path = path; - return urlGenerate(url); - } - return path; -} -exports.normalize = normalize; - -/** - * Joins two paths/URLs. - * - * @param aRoot The root path or URL. - * @param aPath The path or URL to be joined with the root. - * - * - If aPath is a URL or a data URI, aPath is returned, unless aPath is a - * scheme-relative URL: Then the scheme of aRoot, if any, is prepended - * first. - * - Otherwise aPath is a path. If aRoot is a URL, then its path portion - * is updated with the result and aRoot is returned. Otherwise the result - * is returned. - * - If aPath is absolute, the result is aPath. - * - Otherwise the two paths are joined with a slash. - * - Joining for example 'http://' and 'www.example.com' is also supported. - */ -function join(aRoot, aPath) { - if (aRoot === "") { - aRoot = "."; - } - if (aPath === "") { - aPath = "."; - } - var aPathUrl = urlParse(aPath); - var aRootUrl = urlParse(aRoot); - if (aRootUrl) { - aRoot = aRootUrl.path || '/'; - } - - // `join(foo, '//www.example.org')` - if (aPathUrl && !aPathUrl.scheme) { - if (aRootUrl) { - aPathUrl.scheme = aRootUrl.scheme; - } - return urlGenerate(aPathUrl); - } - - if (aPathUrl || aPath.match(dataUrlRegexp)) { - return aPath; - } - - // `join('http://', 'www.example.com')` - if (aRootUrl && !aRootUrl.host && !aRootUrl.path) { - aRootUrl.host = aPath; - return urlGenerate(aRootUrl); - } - - var joined = aPath.charAt(0) === '/' - ? aPath - : normalize(aRoot.replace(/\/+$/, '') + '/' + aPath); - - if (aRootUrl) { - aRootUrl.path = joined; - return urlGenerate(aRootUrl); - } - return joined; -} -exports.join = join; - -exports.isAbsolute = function (aPath) { - return aPath.charAt(0) === '/' || urlRegexp.test(aPath); -}; - -/** - * Make a path relative to a URL or another path. - * - * @param aRoot The root path or URL. - * @param aPath The path or URL to be made relative to aRoot. - */ -function relative(aRoot, aPath) { - if (aRoot === "") { - aRoot = "."; - } - - aRoot = aRoot.replace(/\/$/, ''); - - // It is possible for the path to be above the root. In this case, simply - // checking whether the root is a prefix of the path won't work. Instead, we - // need to remove components from the root one by one, until either we find - // a prefix that fits, or we run out of components to remove. - var level = 0; - while (aPath.indexOf(aRoot + '/') !== 0) { - var index = aRoot.lastIndexOf("/"); - if (index < 0) { - return aPath; - } - - // If the only part of the root that is left is the scheme (i.e. http://, - // file:///, etc.), one or more slashes (/), or simply nothing at all, we - // have exhausted all components, so the path is not relative to the root. - aRoot = aRoot.slice(0, index); - if (aRoot.match(/^([^\/]+:\/)?\/*$/)) { - return aPath; - } - - ++level; - } - - // Make sure we add a "../" for each component we removed from the root. - return Array(level + 1).join("../") + aPath.substr(aRoot.length + 1); -} -exports.relative = relative; - -var supportsNullProto = (function () { - var obj = Object.create(null); - return !('__proto__' in obj); -}()); - -function identity (s) { - return s; -} - -/** - * Because behavior goes wacky when you set `__proto__` on objects, we - * have to prefix all the strings in our set with an arbitrary character. - * - * See https://github.com/mozilla/source-map/pull/31 and - * https://github.com/mozilla/source-map/issues/30 - * - * @param String aStr - */ -function toSetString(aStr) { - if (isProtoString(aStr)) { - return '$' + aStr; - } - - return aStr; -} -exports.toSetString = supportsNullProto ? identity : toSetString; - -function fromSetString(aStr) { - if (isProtoString(aStr)) { - return aStr.slice(1); - } - - return aStr; -} -exports.fromSetString = supportsNullProto ? identity : fromSetString; - -function isProtoString(s) { - if (!s) { - return false; - } - - var length = s.length; - - if (length < 9 /* "__proto__".length */) { - return false; - } - - if (s.charCodeAt(length - 1) !== 95 /* '_' */ || - s.charCodeAt(length - 2) !== 95 /* '_' */ || - s.charCodeAt(length - 3) !== 111 /* 'o' */ || - s.charCodeAt(length - 4) !== 116 /* 't' */ || - s.charCodeAt(length - 5) !== 111 /* 'o' */ || - s.charCodeAt(length - 6) !== 114 /* 'r' */ || - s.charCodeAt(length - 7) !== 112 /* 'p' */ || - s.charCodeAt(length - 8) !== 95 /* '_' */ || - s.charCodeAt(length - 9) !== 95 /* '_' */) { - return false; - } - - for (var i = length - 10; i >= 0; i--) { - if (s.charCodeAt(i) !== 36 /* '$' */) { - return false; - } - } - - return true; -} - -/** - * Comparator between two mappings where the original positions are compared. - * - * Optionally pass in `true` as `onlyCompareGenerated` to consider two - * mappings with the same original source/line/column, but different generated - * line and column the same. Useful when searching for a mapping with a - * stubbed out mapping. - */ -function compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) { - var cmp = strcmp(mappingA.source, mappingB.source); - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.originalLine - mappingB.originalLine; - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.originalColumn - mappingB.originalColumn; - if (cmp !== 0 || onlyCompareOriginal) { - return cmp; - } - - cmp = mappingA.generatedColumn - mappingB.generatedColumn; - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.generatedLine - mappingB.generatedLine; - if (cmp !== 0) { - return cmp; - } - - return strcmp(mappingA.name, mappingB.name); -} -exports.compareByOriginalPositions = compareByOriginalPositions; - -/** - * Comparator between two mappings with deflated source and name indices where - * the generated positions are compared. - * - * Optionally pass in `true` as `onlyCompareGenerated` to consider two - * mappings with the same generated line and column, but different - * source/name/original line and column the same. Useful when searching for a - * mapping with a stubbed out mapping. - */ -function compareByGeneratedPositionsDeflated(mappingA, mappingB, onlyCompareGenerated) { - var cmp = mappingA.generatedLine - mappingB.generatedLine; - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.generatedColumn - mappingB.generatedColumn; - if (cmp !== 0 || onlyCompareGenerated) { - return cmp; - } - - cmp = strcmp(mappingA.source, mappingB.source); - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.originalLine - mappingB.originalLine; - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.originalColumn - mappingB.originalColumn; - if (cmp !== 0) { - return cmp; - } - - return strcmp(mappingA.name, mappingB.name); -} -exports.compareByGeneratedPositionsDeflated = compareByGeneratedPositionsDeflated; - -function strcmp(aStr1, aStr2) { - if (aStr1 === aStr2) { - return 0; - } - - if (aStr1 === null) { - return 1; // aStr2 !== null - } - - if (aStr2 === null) { - return -1; // aStr1 !== null - } - - if (aStr1 > aStr2) { - return 1; - } - - return -1; -} - -/** - * Comparator between two mappings with inflated source and name strings where - * the generated positions are compared. - */ -function compareByGeneratedPositionsInflated(mappingA, mappingB) { - var cmp = mappingA.generatedLine - mappingB.generatedLine; - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.generatedColumn - mappingB.generatedColumn; - if (cmp !== 0) { - return cmp; - } - - cmp = strcmp(mappingA.source, mappingB.source); - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.originalLine - mappingB.originalLine; - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.originalColumn - mappingB.originalColumn; - if (cmp !== 0) { - return cmp; - } - - return strcmp(mappingA.name, mappingB.name); -} -exports.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflated; - -/** - * Strip any JSON XSSI avoidance prefix from the string (as documented - * in the source maps specification), and then parse the string as - * JSON. - */ -function parseSourceMapInput(str) { - return JSON.parse(str.replace(/^\)]}'[^\n]*\n/, '')); -} -exports.parseSourceMapInput = parseSourceMapInput; - -/** - * Compute the URL of a source given the the source root, the source's - * URL, and the source map's URL. - */ -function computeSourceURL(sourceRoot, sourceURL, sourceMapURL) { - sourceURL = sourceURL || ''; - - if (sourceRoot) { - // This follows what Chrome does. - if (sourceRoot[sourceRoot.length - 1] !== '/' && sourceURL[0] !== '/') { - sourceRoot += '/'; - } - // The spec says: - // Line 4: An optional source root, useful for relocating source - // files on a server or removing repeated values in the - // “sources” entry. This value is prepended to the individual - // entries in the “source” field. - sourceURL = sourceRoot + sourceURL; - } - - // Historically, SourceMapConsumer did not take the sourceMapURL as - // a parameter. This mode is still somewhat supported, which is why - // this code block is conditional. However, it's preferable to pass - // the source map URL to SourceMapConsumer, so that this function - // can implement the source URL resolution algorithm as outlined in - // the spec. This block is basically the equivalent of: - // new URL(sourceURL, sourceMapURL).toString() - // ... except it avoids using URL, which wasn't available in the - // older releases of node still supported by this library. - // - // The spec says: - // If the sources are not absolute URLs after prepending of the - // “sourceRoot”, the sources are resolved relative to the - // SourceMap (like resolving script src in a html document). - if (sourceMapURL) { - var parsed = urlParse(sourceMapURL); - if (!parsed) { - throw new Error("sourceMapURL could not be parsed"); - } - if (parsed.path) { - // Strip the last path component, but keep the "/". - var index = parsed.path.lastIndexOf('/'); - if (index >= 0) { - parsed.path = parsed.path.substring(0, index + 1); - } - } - sourceURL = join(urlGenerate(parsed), sourceURL); - } - - return normalize(sourceURL); -} -exports.computeSourceURL = computeSourceURL; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/source-map/package.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/source-map/package.json deleted file mode 100644 index 24663417..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/source-map/package.json +++ /dev/null @@ -1,73 +0,0 @@ -{ - "name": "source-map", - "description": "Generates and consumes source maps", - "version": "0.6.1", - "homepage": "https://github.com/mozilla/source-map", - "author": "Nick Fitzgerald ", - "contributors": [ - "Tobias Koppers ", - "Duncan Beevers ", - "Stephen Crane ", - "Ryan Seddon ", - "Miles Elam ", - "Mihai Bazon ", - "Michael Ficarra ", - "Todd Wolfson ", - "Alexander Solovyov ", - "Felix Gnass ", - "Conrad Irwin ", - "usrbincc ", - "David Glasser ", - "Chase Douglas ", - "Evan Wallace ", - "Heather Arthur ", - "Hugh Kennedy ", - "David Glasser ", - "Simon Lydell ", - "Jmeas Smith ", - "Michael Z Goddard ", - "azu ", - "John Gozde ", - "Adam Kirkton ", - "Chris Montgomery ", - "J. Ryan Stinnett ", - "Jack Herrington ", - "Chris Truter ", - "Daniel Espeset ", - "Jamie Wong ", - "Eddy Bruël ", - "Hawken Rives ", - "Gilad Peleg ", - "djchie ", - "Gary Ye ", - "Nicolas Lalevée " - ], - "repository": { - "type": "git", - "url": "http://github.com/mozilla/source-map.git" - }, - "main": "./source-map.js", - "files": [ - "source-map.js", - "source-map.d.ts", - "lib/", - "dist/source-map.debug.js", - "dist/source-map.js", - "dist/source-map.min.js", - "dist/source-map.min.js.map" - ], - "engines": { - "node": ">=0.10.0" - }, - "license": "BSD-3-Clause", - "scripts": { - "test": "npm run build && node test/run-tests.js", - "build": "webpack --color", - "toc": "doctoc --title '## Table of Contents' README.md && doctoc --title '## Table of Contents' CONTRIBUTING.md" - }, - "devDependencies": { - "doctoc": "^0.15.0", - "webpack": "^1.12.0" - }, - "typings": "source-map" -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/source-map/source-map.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/source-map/source-map.d.ts deleted file mode 100644 index 8f972b0c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/source-map/source-map.d.ts +++ /dev/null @@ -1,98 +0,0 @@ -export interface StartOfSourceMap { - file?: string; - sourceRoot?: string; -} - -export interface RawSourceMap extends StartOfSourceMap { - version: string; - sources: string[]; - names: string[]; - sourcesContent?: string[]; - mappings: string; -} - -export interface Position { - line: number; - column: number; -} - -export interface LineRange extends Position { - lastColumn: number; -} - -export interface FindPosition extends Position { - // SourceMapConsumer.GREATEST_LOWER_BOUND or SourceMapConsumer.LEAST_UPPER_BOUND - bias?: number; -} - -export interface SourceFindPosition extends FindPosition { - source: string; -} - -export interface MappedPosition extends Position { - source: string; - name?: string; -} - -export interface MappingItem { - source: string; - generatedLine: number; - generatedColumn: number; - originalLine: number; - originalColumn: number; - name: string; -} - -export class SourceMapConsumer { - static GENERATED_ORDER: number; - static ORIGINAL_ORDER: number; - - static GREATEST_LOWER_BOUND: number; - static LEAST_UPPER_BOUND: number; - - constructor(rawSourceMap: RawSourceMap); - computeColumnSpans(): void; - originalPositionFor(generatedPosition: FindPosition): MappedPosition; - generatedPositionFor(originalPosition: SourceFindPosition): LineRange; - allGeneratedPositionsFor(originalPosition: MappedPosition): Position[]; - hasContentsOfAllSources(): boolean; - sourceContentFor(source: string, returnNullOnMissing?: boolean): string; - eachMapping(callback: (mapping: MappingItem) => void, context?: any, order?: number): void; -} - -export interface Mapping { - generated: Position; - original: Position; - source: string; - name?: string; -} - -export class SourceMapGenerator { - constructor(startOfSourceMap?: StartOfSourceMap); - static fromSourceMap(sourceMapConsumer: SourceMapConsumer): SourceMapGenerator; - addMapping(mapping: Mapping): void; - setSourceContent(sourceFile: string, sourceContent: string): void; - applySourceMap(sourceMapConsumer: SourceMapConsumer, sourceFile?: string, sourceMapPath?: string): void; - toString(): string; -} - -export interface CodeWithSourceMap { - code: string; - map: SourceMapGenerator; -} - -export class SourceNode { - constructor(); - constructor(line: number, column: number, source: string); - constructor(line: number, column: number, source: string, chunk?: string, name?: string); - static fromStringWithSourceMap(code: string, sourceMapConsumer: SourceMapConsumer, relativePath?: string): SourceNode; - add(chunk: string): void; - prepend(chunk: string): void; - setSourceContent(sourceFile: string, sourceContent: string): void; - walk(fn: (chunk: string, mapping: MappedPosition) => void): void; - walkSourceContents(fn: (file: string, content: string) => void): void; - join(sep: string): SourceNode; - replaceRight(pattern: string, replacement: string): SourceNode; - toString(): string; - toStringWithSourceMap(startOfSourceMap?: StartOfSourceMap): CodeWithSourceMap; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/source-map/source-map.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/source-map/source-map.js deleted file mode 100644 index bc88fe82..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/source-map/source-map.js +++ /dev/null @@ -1,8 +0,0 @@ -/* - * Copyright 2009-2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE.txt or: - * http://opensource.org/licenses/BSD-3-Clause - */ -exports.SourceMapGenerator = require('./lib/source-map-generator').SourceMapGenerator; -exports.SourceMapConsumer = require('./lib/source-map-consumer').SourceMapConsumer; -exports.SourceNode = require('./lib/source-node').SourceNode; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/stream-events/index.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/stream-events/index.d.ts deleted file mode 100644 index 56ed748c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/stream-events/index.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { Stream } from "stream"; -declare function StreamEvents(stream: StreamType) - : StreamType; -declare namespace StreamEvents { } -export = StreamEvents diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/stream-events/index.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/stream-events/index.js deleted file mode 100644 index 28d50a6a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/stream-events/index.js +++ /dev/null @@ -1,30 +0,0 @@ -'use strict'; - -var stubs = require('stubs') - -/* - * StreamEvents can be used 2 ways: - * - * 1: - * function MyStream() { - * require('stream-events').call(this) - * } - * - * 2: - * require('stream-events')(myStream) - */ -function StreamEvents(stream) { - stream = stream || this - - var cfg = { - callthrough: true, - calls: 1 - } - - stubs(stream, '_read', cfg, stream.emit.bind(stream, 'reading')) - stubs(stream, '_write', cfg, stream.emit.bind(stream, 'writing')) - - return stream -} - -module.exports = StreamEvents diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/stream-events/package.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/stream-events/package.json deleted file mode 100644 index bd6c778c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/stream-events/package.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "name": "stream-events", - "version": "1.0.5", - "description": "Get an event when you're being sent data or asked for it.", - "main": "index.js", - "types": "index.d.ts", - "files": [ - "index.js", - "index.d.ts" - ], - "scripts": { - "test": "node ./test" - }, - "repository": { - "type": "git", - "url": "https://github.com/stephenplusplus/stream-events" - }, - "keywords": [ - "stream", - "events", - "read", - "write", - "duplexify", - "lazy-stream" - ], - "author": "Stephen Sawchuk", - "license": "MIT", - "bugs": { - "url": "https://github.com/stephenplusplus/stream-events/issues" - }, - "homepage": "https://github.com/stephenplusplus/stream-events", - "devDependencies": { - "duplexify": "^3.2.0" - }, - "dependencies": { - "stubs": "^3.0.0" - } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/stream-events/readme.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/stream-events/readme.md deleted file mode 100644 index 695a7ce1..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/stream-events/readme.md +++ /dev/null @@ -1,64 +0,0 @@ -# stream-events - -> Get an event when you're being sent data or asked for it. - -## About - -This is just a simple thing that tells you when `_read` and `_write` have been called, saving you the trouble of writing this yourself. You receive two events `reading` and `writing`-- no magic is performed. - -This works well with [duplexify](https://github.com/mafintosh/duplexify) or lazy streams, so you can wait until you know you're being used as a stream to do something asynchronous, such as fetching an API token. - - -## Use -```sh -$ npm install --save stream-events -``` -```js -var stream = require('stream') -var streamEvents = require('stream-events') -var util = require('util') - -function MyStream() { - stream.Duplex.call(this) - streamEvents.call(this) -} -util.inherits(MyStream, stream.Duplex) - -MyStream.prototype._read = function(chunk) { - console.log('_read called as usual') - this.push(new Buffer(chunk)) - this.push(null) -} - -MyStream.prototype._write = function() { - console.log('_write called as usual') -} - -var stream = new MyStream - -stream.on('reading', function() { - console.log('stream is being asked for data') -}) - -stream.on('writing', function() { - console.log('stream is being sent data') -}) - -stream.pipe(stream) -``` - -### Using with Duplexify -```js -var duplexify = require('duplexify') -var streamEvents = require('stream-events') -var fs = require('fs') - -var dup = streamEvents(duplexify()) - -dup.on('writing', function() { - // do something async - dup.setWritable(/*writable stream*/) -}) - -fs.createReadStream('file').pipe(dup) -``` \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/stream-shift/.travis.yml b/packages/wyatt_notification_bloc/example/scripts/node_modules/stream-shift/.travis.yml deleted file mode 100644 index ecd4193f..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/stream-shift/.travis.yml +++ /dev/null @@ -1,6 +0,0 @@ -language: node_js -node_js: - - "0.10" - - "0.12" - - "4" - - "6" diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/stream-shift/LICENSE b/packages/wyatt_notification_bloc/example/scripts/node_modules/stream-shift/LICENSE deleted file mode 100644 index bae9da7b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/stream-shift/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2016 Mathias Buus - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/stream-shift/README.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/stream-shift/README.md deleted file mode 100644 index d9cc2d94..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/stream-shift/README.md +++ /dev/null @@ -1,25 +0,0 @@ -# stream-shift - -Returns the next buffer/object in a stream's readable queue - -``` -npm install stream-shift -``` - -[![build status](http://img.shields.io/travis/mafintosh/stream-shift.svg?style=flat)](http://travis-ci.org/mafintosh/stream-shift) - -## Usage - -``` js -var shift = require('stream-shift') - -console.log(shift(someStream)) // first item in its buffer -``` - -## Credit - -Thanks [@dignifiedquire](https://github.com/dignifiedquire) for making this work on node 6 - -## License - -MIT diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/stream-shift/index.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/stream-shift/index.js deleted file mode 100644 index 33cc4d74..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/stream-shift/index.js +++ /dev/null @@ -1,20 +0,0 @@ -module.exports = shift - -function shift (stream) { - var rs = stream._readableState - if (!rs) return null - return (rs.objectMode || typeof stream._duplexState === 'number') ? stream.read() : stream.read(getStateLength(rs)) -} - -function getStateLength (state) { - if (state.buffer.length) { - // Since node 6.3.0 state.buffer is a BufferList not an array - if (state.buffer.head) { - return state.buffer.head.data.length - } - - return state.buffer[0].length - } - - return state.length -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/stream-shift/package.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/stream-shift/package.json deleted file mode 100644 index fe7347a0..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/stream-shift/package.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "name": "stream-shift", - "version": "1.0.1", - "description": "Returns the next buffer/object in a stream's readable queue", - "main": "index.js", - "dependencies": {}, - "devDependencies": { - "standard": "^7.1.2", - "tape": "^4.6.0", - "through2": "^2.0.1" - }, - "scripts": { - "test": "standard && tape test.js" - }, - "repository": { - "type": "git", - "url": "https://github.com/mafintosh/stream-shift.git" - }, - "author": "Mathias Buus (@mafintosh)", - "license": "MIT", - "bugs": { - "url": "https://github.com/mafintosh/stream-shift/issues" - }, - "homepage": "https://github.com/mafintosh/stream-shift" -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/stream-shift/test.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/stream-shift/test.js deleted file mode 100644 index c0222c37..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/stream-shift/test.js +++ /dev/null @@ -1,48 +0,0 @@ -var tape = require('tape') -var through = require('through2') -var stream = require('stream') -var shift = require('./') - -tape('shifts next', function (t) { - var passthrough = through() - - passthrough.write('hello') - passthrough.write('world') - - t.same(shift(passthrough), Buffer('hello')) - t.same(shift(passthrough), Buffer('world')) - t.end() -}) - -tape('shifts next with core', function (t) { - var passthrough = stream.PassThrough() - - passthrough.write('hello') - passthrough.write('world') - - t.same(shift(passthrough), Buffer('hello')) - t.same(shift(passthrough), Buffer('world')) - t.end() -}) - -tape('shifts next with object mode', function (t) { - var passthrough = through({objectMode: true}) - - passthrough.write({hello: 1}) - passthrough.write({world: 1}) - - t.same(shift(passthrough), {hello: 1}) - t.same(shift(passthrough), {world: 1}) - t.end() -}) - -tape('shifts next with object mode with core', function (t) { - var passthrough = stream.PassThrough({objectMode: true}) - - passthrough.write({hello: 1}) - passthrough.write({world: 1}) - - t.same(shift(passthrough), {hello: 1}) - t.same(shift(passthrough), {world: 1}) - t.end() -}) diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/string-width/index.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/string-width/index.d.ts deleted file mode 100644 index 12b53097..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/string-width/index.d.ts +++ /dev/null @@ -1,29 +0,0 @@ -declare const stringWidth: { - /** - Get the visual width of a string - the number of columns required to display it. - - Some Unicode characters are [fullwidth](https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms) and use double the normal width. [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) are stripped and doesn't affect the width. - - @example - ``` - import stringWidth = require('string-width'); - - stringWidth('a'); - //=> 1 - - stringWidth('古'); - //=> 2 - - stringWidth('\u001B[1m古\u001B[22m'); - //=> 2 - ``` - */ - (string: string): number; - - // TODO: remove this in the next major version, refactor the whole definition to: - // declare function stringWidth(string: string): number; - // export = stringWidth; - default: typeof stringWidth; -} - -export = stringWidth; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/string-width/index.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/string-width/index.js deleted file mode 100644 index f4d261a9..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/string-width/index.js +++ /dev/null @@ -1,47 +0,0 @@ -'use strict'; -const stripAnsi = require('strip-ansi'); -const isFullwidthCodePoint = require('is-fullwidth-code-point'); -const emojiRegex = require('emoji-regex'); - -const stringWidth = string => { - if (typeof string !== 'string' || string.length === 0) { - return 0; - } - - string = stripAnsi(string); - - if (string.length === 0) { - return 0; - } - - string = string.replace(emojiRegex(), ' '); - - let width = 0; - - for (let i = 0; i < string.length; i++) { - const code = string.codePointAt(i); - - // Ignore control characters - if (code <= 0x1F || (code >= 0x7F && code <= 0x9F)) { - continue; - } - - // Ignore combining characters - if (code >= 0x300 && code <= 0x36F) { - continue; - } - - // Surrogates - if (code > 0xFFFF) { - i++; - } - - width += isFullwidthCodePoint(code) ? 2 : 1; - } - - return width; -}; - -module.exports = stringWidth; -// TODO: remove this in the next major version -module.exports.default = stringWidth; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/string-width/license b/packages/wyatt_notification_bloc/example/scripts/node_modules/string-width/license deleted file mode 100644 index e7af2f77..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/string-width/license +++ /dev/null @@ -1,9 +0,0 @@ -MIT License - -Copyright (c) Sindre Sorhus (sindresorhus.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/string-width/package.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/string-width/package.json deleted file mode 100644 index 28ba7b4c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/string-width/package.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "name": "string-width", - "version": "4.2.3", - "description": "Get the visual width of a string - the number of columns required to display it", - "license": "MIT", - "repository": "sindresorhus/string-width", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "engines": { - "node": ">=8" - }, - "scripts": { - "test": "xo && ava && tsd" - }, - "files": [ - "index.js", - "index.d.ts" - ], - "keywords": [ - "string", - "character", - "unicode", - "width", - "visual", - "column", - "columns", - "fullwidth", - "full-width", - "full", - "ansi", - "escape", - "codes", - "cli", - "command-line", - "terminal", - "console", - "cjk", - "chinese", - "japanese", - "korean", - "fixed-width" - ], - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "devDependencies": { - "ava": "^1.4.1", - "tsd": "^0.7.1", - "xo": "^0.24.0" - } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/string-width/readme.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/string-width/readme.md deleted file mode 100644 index bdd31412..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/string-width/readme.md +++ /dev/null @@ -1,50 +0,0 @@ -# string-width - -> Get the visual width of a string - the number of columns required to display it - -Some Unicode characters are [fullwidth](https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms) and use double the normal width. [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) are stripped and doesn't affect the width. - -Useful to be able to measure the actual width of command-line output. - - -## Install - -``` -$ npm install string-width -``` - - -## Usage - -```js -const stringWidth = require('string-width'); - -stringWidth('a'); -//=> 1 - -stringWidth('古'); -//=> 2 - -stringWidth('\u001B[1m古\u001B[22m'); -//=> 2 -``` - - -## Related - -- [string-width-cli](https://github.com/sindresorhus/string-width-cli) - CLI for this module -- [string-length](https://github.com/sindresorhus/string-length) - Get the real length of a string -- [widest-line](https://github.com/sindresorhus/widest-line) - Get the visual width of the widest line in a string - - ---- - -
    - - Get professional support for this package with a Tidelift subscription - -
    - - Tidelift helps make open source sustainable for maintainers while giving companies
    assurances about security, maintenance, and licensing for their dependencies. -
    -
    diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/string_decoder/LICENSE b/packages/wyatt_notification_bloc/example/scripts/node_modules/string_decoder/LICENSE deleted file mode 100644 index 778edb20..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/string_decoder/LICENSE +++ /dev/null @@ -1,48 +0,0 @@ -Node.js is licensed for use as follows: - -""" -Copyright Node.js contributors. All rights reserved. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to -deal in the Software without restriction, including without limitation the -rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -sell copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -IN THE SOFTWARE. -""" - -This license applies to parts of Node.js originating from the -https://github.com/joyent/node repository: - -""" -Copyright Joyent, Inc. and other Node contributors. All rights reserved. -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to -deal in the Software without restriction, including without limitation the -rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -sell copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -IN THE SOFTWARE. -""" - diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/string_decoder/README.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/string_decoder/README.md deleted file mode 100644 index 5fd58315..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/string_decoder/README.md +++ /dev/null @@ -1,47 +0,0 @@ -# string_decoder - -***Node-core v8.9.4 string_decoder for userland*** - - -[![NPM](https://nodei.co/npm/string_decoder.png?downloads=true&downloadRank=true)](https://nodei.co/npm/string_decoder/) -[![NPM](https://nodei.co/npm-dl/string_decoder.png?&months=6&height=3)](https://nodei.co/npm/string_decoder/) - - -```bash -npm install --save string_decoder -``` - -***Node-core string_decoder for userland*** - -This package is a mirror of the string_decoder implementation in Node-core. - -Full documentation may be found on the [Node.js website](https://nodejs.org/dist/v8.9.4/docs/api/). - -As of version 1.0.0 **string_decoder** uses semantic versioning. - -## Previous versions - -Previous version numbers match the versions found in Node core, e.g. 0.10.24 matches Node 0.10.24, likewise 0.11.10 matches Node 0.11.10. - -## Update - -The *build/* directory contains a build script that will scrape the source from the [nodejs/node](https://github.com/nodejs/node) repo given a specific Node version. - -## Streams Working Group - -`string_decoder` is maintained by the Streams Working Group, which -oversees the development and maintenance of the Streams API within -Node.js. The responsibilities of the Streams Working Group include: - -* Addressing stream issues on the Node.js issue tracker. -* Authoring and editing stream documentation within the Node.js project. -* Reviewing changes to stream subclasses within the Node.js project. -* Redirecting changes to streams from the Node.js project to this - project. -* Assisting in the implementation of stream providers within Node.js. -* Recommending versions of `readable-stream` to be included in Node.js. -* Messaging about the future of streams to give the community advance - notice of changes. - -See [readable-stream](https://github.com/nodejs/readable-stream) for -more details. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/string_decoder/lib/string_decoder.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/string_decoder/lib/string_decoder.js deleted file mode 100644 index 2e89e63f..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/string_decoder/lib/string_decoder.js +++ /dev/null @@ -1,296 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - -'use strict'; - -/**/ - -var Buffer = require('safe-buffer').Buffer; -/**/ - -var isEncoding = Buffer.isEncoding || function (encoding) { - encoding = '' + encoding; - switch (encoding && encoding.toLowerCase()) { - case 'hex':case 'utf8':case 'utf-8':case 'ascii':case 'binary':case 'base64':case 'ucs2':case 'ucs-2':case 'utf16le':case 'utf-16le':case 'raw': - return true; - default: - return false; - } -}; - -function _normalizeEncoding(enc) { - if (!enc) return 'utf8'; - var retried; - while (true) { - switch (enc) { - case 'utf8': - case 'utf-8': - return 'utf8'; - case 'ucs2': - case 'ucs-2': - case 'utf16le': - case 'utf-16le': - return 'utf16le'; - case 'latin1': - case 'binary': - return 'latin1'; - case 'base64': - case 'ascii': - case 'hex': - return enc; - default: - if (retried) return; // undefined - enc = ('' + enc).toLowerCase(); - retried = true; - } - } -}; - -// Do not cache `Buffer.isEncoding` when checking encoding names as some -// modules monkey-patch it to support additional encodings -function normalizeEncoding(enc) { - var nenc = _normalizeEncoding(enc); - if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc); - return nenc || enc; -} - -// StringDecoder provides an interface for efficiently splitting a series of -// buffers into a series of JS strings without breaking apart multi-byte -// characters. -exports.StringDecoder = StringDecoder; -function StringDecoder(encoding) { - this.encoding = normalizeEncoding(encoding); - var nb; - switch (this.encoding) { - case 'utf16le': - this.text = utf16Text; - this.end = utf16End; - nb = 4; - break; - case 'utf8': - this.fillLast = utf8FillLast; - nb = 4; - break; - case 'base64': - this.text = base64Text; - this.end = base64End; - nb = 3; - break; - default: - this.write = simpleWrite; - this.end = simpleEnd; - return; - } - this.lastNeed = 0; - this.lastTotal = 0; - this.lastChar = Buffer.allocUnsafe(nb); -} - -StringDecoder.prototype.write = function (buf) { - if (buf.length === 0) return ''; - var r; - var i; - if (this.lastNeed) { - r = this.fillLast(buf); - if (r === undefined) return ''; - i = this.lastNeed; - this.lastNeed = 0; - } else { - i = 0; - } - if (i < buf.length) return r ? r + this.text(buf, i) : this.text(buf, i); - return r || ''; -}; - -StringDecoder.prototype.end = utf8End; - -// Returns only complete characters in a Buffer -StringDecoder.prototype.text = utf8Text; - -// Attempts to complete a partial non-UTF-8 character using bytes from a Buffer -StringDecoder.prototype.fillLast = function (buf) { - if (this.lastNeed <= buf.length) { - buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed); - return this.lastChar.toString(this.encoding, 0, this.lastTotal); - } - buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, buf.length); - this.lastNeed -= buf.length; -}; - -// Checks the type of a UTF-8 byte, whether it's ASCII, a leading byte, or a -// continuation byte. If an invalid byte is detected, -2 is returned. -function utf8CheckByte(byte) { - if (byte <= 0x7F) return 0;else if (byte >> 5 === 0x06) return 2;else if (byte >> 4 === 0x0E) return 3;else if (byte >> 3 === 0x1E) return 4; - return byte >> 6 === 0x02 ? -1 : -2; -} - -// Checks at most 3 bytes at the end of a Buffer in order to detect an -// incomplete multi-byte UTF-8 character. The total number of bytes (2, 3, or 4) -// needed to complete the UTF-8 character (if applicable) are returned. -function utf8CheckIncomplete(self, buf, i) { - var j = buf.length - 1; - if (j < i) return 0; - var nb = utf8CheckByte(buf[j]); - if (nb >= 0) { - if (nb > 0) self.lastNeed = nb - 1; - return nb; - } - if (--j < i || nb === -2) return 0; - nb = utf8CheckByte(buf[j]); - if (nb >= 0) { - if (nb > 0) self.lastNeed = nb - 2; - return nb; - } - if (--j < i || nb === -2) return 0; - nb = utf8CheckByte(buf[j]); - if (nb >= 0) { - if (nb > 0) { - if (nb === 2) nb = 0;else self.lastNeed = nb - 3; - } - return nb; - } - return 0; -} - -// Validates as many continuation bytes for a multi-byte UTF-8 character as -// needed or are available. If we see a non-continuation byte where we expect -// one, we "replace" the validated continuation bytes we've seen so far with -// a single UTF-8 replacement character ('\ufffd'), to match v8's UTF-8 decoding -// behavior. The continuation byte check is included three times in the case -// where all of the continuation bytes for a character exist in the same buffer. -// It is also done this way as a slight performance increase instead of using a -// loop. -function utf8CheckExtraBytes(self, buf, p) { - if ((buf[0] & 0xC0) !== 0x80) { - self.lastNeed = 0; - return '\ufffd'; - } - if (self.lastNeed > 1 && buf.length > 1) { - if ((buf[1] & 0xC0) !== 0x80) { - self.lastNeed = 1; - return '\ufffd'; - } - if (self.lastNeed > 2 && buf.length > 2) { - if ((buf[2] & 0xC0) !== 0x80) { - self.lastNeed = 2; - return '\ufffd'; - } - } - } -} - -// Attempts to complete a multi-byte UTF-8 character using bytes from a Buffer. -function utf8FillLast(buf) { - var p = this.lastTotal - this.lastNeed; - var r = utf8CheckExtraBytes(this, buf, p); - if (r !== undefined) return r; - if (this.lastNeed <= buf.length) { - buf.copy(this.lastChar, p, 0, this.lastNeed); - return this.lastChar.toString(this.encoding, 0, this.lastTotal); - } - buf.copy(this.lastChar, p, 0, buf.length); - this.lastNeed -= buf.length; -} - -// Returns all complete UTF-8 characters in a Buffer. If the Buffer ended on a -// partial character, the character's bytes are buffered until the required -// number of bytes are available. -function utf8Text(buf, i) { - var total = utf8CheckIncomplete(this, buf, i); - if (!this.lastNeed) return buf.toString('utf8', i); - this.lastTotal = total; - var end = buf.length - (total - this.lastNeed); - buf.copy(this.lastChar, 0, end); - return buf.toString('utf8', i, end); -} - -// For UTF-8, a replacement character is added when ending on a partial -// character. -function utf8End(buf) { - var r = buf && buf.length ? this.write(buf) : ''; - if (this.lastNeed) return r + '\ufffd'; - return r; -} - -// UTF-16LE typically needs two bytes per character, but even if we have an even -// number of bytes available, we need to check if we end on a leading/high -// surrogate. In that case, we need to wait for the next two bytes in order to -// decode the last character properly. -function utf16Text(buf, i) { - if ((buf.length - i) % 2 === 0) { - var r = buf.toString('utf16le', i); - if (r) { - var c = r.charCodeAt(r.length - 1); - if (c >= 0xD800 && c <= 0xDBFF) { - this.lastNeed = 2; - this.lastTotal = 4; - this.lastChar[0] = buf[buf.length - 2]; - this.lastChar[1] = buf[buf.length - 1]; - return r.slice(0, -1); - } - } - return r; - } - this.lastNeed = 1; - this.lastTotal = 2; - this.lastChar[0] = buf[buf.length - 1]; - return buf.toString('utf16le', i, buf.length - 1); -} - -// For UTF-16LE we do not explicitly append special replacement characters if we -// end on a partial character, we simply let v8 handle that. -function utf16End(buf) { - var r = buf && buf.length ? this.write(buf) : ''; - if (this.lastNeed) { - var end = this.lastTotal - this.lastNeed; - return r + this.lastChar.toString('utf16le', 0, end); - } - return r; -} - -function base64Text(buf, i) { - var n = (buf.length - i) % 3; - if (n === 0) return buf.toString('base64', i); - this.lastNeed = 3 - n; - this.lastTotal = 3; - if (n === 1) { - this.lastChar[0] = buf[buf.length - 1]; - } else { - this.lastChar[0] = buf[buf.length - 2]; - this.lastChar[1] = buf[buf.length - 1]; - } - return buf.toString('base64', i, buf.length - n); -} - -function base64End(buf) { - var r = buf && buf.length ? this.write(buf) : ''; - if (this.lastNeed) return r + this.lastChar.toString('base64', 0, 3 - this.lastNeed); - return r; -} - -// Pass bytes on through for single-byte encodings (e.g. ascii, latin1, hex) -function simpleWrite(buf) { - return buf.toString(this.encoding); -} - -function simpleEnd(buf) { - return buf && buf.length ? this.write(buf) : ''; -} \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/string_decoder/package.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/string_decoder/package.json deleted file mode 100644 index b2bb1411..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/string_decoder/package.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "name": "string_decoder", - "version": "1.3.0", - "description": "The string_decoder module from Node core", - "main": "lib/string_decoder.js", - "files": [ - "lib" - ], - "dependencies": { - "safe-buffer": "~5.2.0" - }, - "devDependencies": { - "babel-polyfill": "^6.23.0", - "core-util-is": "^1.0.2", - "inherits": "^2.0.3", - "tap": "~0.4.8" - }, - "scripts": { - "test": "tap test/parallel/*.js && node test/verify-dependencies", - "ci": "tap test/parallel/*.js test/ours/*.js --tap | tee test.tap && node test/verify-dependencies.js" - }, - "repository": { - "type": "git", - "url": "git://github.com/nodejs/string_decoder.git" - }, - "homepage": "https://github.com/nodejs/string_decoder", - "keywords": [ - "string", - "decoder", - "browser", - "browserify" - ], - "license": "MIT" -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/strip-ansi/index.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/strip-ansi/index.d.ts deleted file mode 100644 index 907fccc2..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/strip-ansi/index.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** -Strip [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) from a string. - -@example -``` -import stripAnsi = require('strip-ansi'); - -stripAnsi('\u001B[4mUnicorn\u001B[0m'); -//=> 'Unicorn' - -stripAnsi('\u001B]8;;https://github.com\u0007Click\u001B]8;;\u0007'); -//=> 'Click' -``` -*/ -declare function stripAnsi(string: string): string; - -export = stripAnsi; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/strip-ansi/index.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/strip-ansi/index.js deleted file mode 100644 index 9a593dfc..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/strip-ansi/index.js +++ /dev/null @@ -1,4 +0,0 @@ -'use strict'; -const ansiRegex = require('ansi-regex'); - -module.exports = string => typeof string === 'string' ? string.replace(ansiRegex(), '') : string; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/strip-ansi/license b/packages/wyatt_notification_bloc/example/scripts/node_modules/strip-ansi/license deleted file mode 100644 index e7af2f77..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/strip-ansi/license +++ /dev/null @@ -1,9 +0,0 @@ -MIT License - -Copyright (c) Sindre Sorhus (sindresorhus.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/strip-ansi/package.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/strip-ansi/package.json deleted file mode 100644 index 1a41108d..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/strip-ansi/package.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "name": "strip-ansi", - "version": "6.0.1", - "description": "Strip ANSI escape codes from a string", - "license": "MIT", - "repository": "chalk/strip-ansi", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "engines": { - "node": ">=8" - }, - "scripts": { - "test": "xo && ava && tsd" - }, - "files": [ - "index.js", - "index.d.ts" - ], - "keywords": [ - "strip", - "trim", - "remove", - "ansi", - "styles", - "color", - "colour", - "colors", - "terminal", - "console", - "string", - "tty", - "escape", - "formatting", - "rgb", - "256", - "shell", - "xterm", - "log", - "logging", - "command-line", - "text" - ], - "dependencies": { - "ansi-regex": "^5.0.1" - }, - "devDependencies": { - "ava": "^2.4.0", - "tsd": "^0.10.0", - "xo": "^0.25.3" - } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/strip-ansi/readme.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/strip-ansi/readme.md deleted file mode 100644 index 7c4b56d4..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/strip-ansi/readme.md +++ /dev/null @@ -1,46 +0,0 @@ -# strip-ansi [![Build Status](https://travis-ci.org/chalk/strip-ansi.svg?branch=master)](https://travis-ci.org/chalk/strip-ansi) - -> Strip [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) from a string - - -## Install - -``` -$ npm install strip-ansi -``` - - -## Usage - -```js -const stripAnsi = require('strip-ansi'); - -stripAnsi('\u001B[4mUnicorn\u001B[0m'); -//=> 'Unicorn' - -stripAnsi('\u001B]8;;https://github.com\u0007Click\u001B]8;;\u0007'); -//=> 'Click' -``` - - -## strip-ansi for enterprise - -Available as part of the Tidelift Subscription. - -The maintainers of strip-ansi and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-strip-ansi?utm_source=npm-strip-ansi&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) - - -## Related - -- [strip-ansi-cli](https://github.com/chalk/strip-ansi-cli) - CLI for this module -- [strip-ansi-stream](https://github.com/chalk/strip-ansi-stream) - Streaming version of this module -- [has-ansi](https://github.com/chalk/has-ansi) - Check if a string has ANSI escape codes -- [ansi-regex](https://github.com/chalk/ansi-regex) - Regular expression for matching ANSI escape codes -- [chalk](https://github.com/chalk/chalk) - Terminal string styling done right - - -## Maintainers - -- [Sindre Sorhus](https://github.com/sindresorhus) -- [Josh Junon](https://github.com/qix-) - diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/strip-json-comments/index.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/strip-json-comments/index.d.ts deleted file mode 100644 index 28ba3c8a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/strip-json-comments/index.d.ts +++ /dev/null @@ -1,36 +0,0 @@ -declare namespace stripJsonComments { - interface Options { - /** - Replace comments with whitespace instead of stripping them entirely. - - @default true - */ - readonly whitespace?: boolean; - } -} - -/** -Strip comments from JSON. Lets you use comments in your JSON files! - -It will replace single-line comments `//` and multi-line comments `/**\/` with whitespace. This allows JSON error positions to remain as close as possible to the original source. - -@param jsonString - Accepts a string with JSON. -@returns A JSON string without comments. - -@example -``` -const json = `{ - // Rainbows - "unicorn": "cake" -}`; - -JSON.parse(stripJsonComments(json)); -//=> {unicorn: 'cake'} -``` -*/ -declare function stripJsonComments( - jsonString: string, - options?: stripJsonComments.Options -): string; - -export = stripJsonComments; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/strip-json-comments/index.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/strip-json-comments/index.js deleted file mode 100644 index bb00b38b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/strip-json-comments/index.js +++ /dev/null @@ -1,77 +0,0 @@ -'use strict'; -const singleComment = Symbol('singleComment'); -const multiComment = Symbol('multiComment'); -const stripWithoutWhitespace = () => ''; -const stripWithWhitespace = (string, start, end) => string.slice(start, end).replace(/\S/g, ' '); - -const isEscaped = (jsonString, quotePosition) => { - let index = quotePosition - 1; - let backslashCount = 0; - - while (jsonString[index] === '\\') { - index -= 1; - backslashCount += 1; - } - - return Boolean(backslashCount % 2); -}; - -module.exports = (jsonString, options = {}) => { - if (typeof jsonString !== 'string') { - throw new TypeError(`Expected argument \`jsonString\` to be a \`string\`, got \`${typeof jsonString}\``); - } - - const strip = options.whitespace === false ? stripWithoutWhitespace : stripWithWhitespace; - - let insideString = false; - let insideComment = false; - let offset = 0; - let result = ''; - - for (let i = 0; i < jsonString.length; i++) { - const currentCharacter = jsonString[i]; - const nextCharacter = jsonString[i + 1]; - - if (!insideComment && currentCharacter === '"') { - const escaped = isEscaped(jsonString, i); - if (!escaped) { - insideString = !insideString; - } - } - - if (insideString) { - continue; - } - - if (!insideComment && currentCharacter + nextCharacter === '//') { - result += jsonString.slice(offset, i); - offset = i; - insideComment = singleComment; - i++; - } else if (insideComment === singleComment && currentCharacter + nextCharacter === '\r\n') { - i++; - insideComment = false; - result += strip(jsonString, offset, i); - offset = i; - continue; - } else if (insideComment === singleComment && currentCharacter === '\n') { - insideComment = false; - result += strip(jsonString, offset, i); - offset = i; - } else if (!insideComment && currentCharacter + nextCharacter === '/*') { - result += jsonString.slice(offset, i); - offset = i; - insideComment = multiComment; - i++; - continue; - } else if (insideComment === multiComment && currentCharacter + nextCharacter === '*/') { - i++; - insideComment = false; - result += strip(jsonString, offset, i + 1); - offset = i + 1; - continue; - } - } - - return result + (insideComment ? strip(jsonString.slice(offset)) : jsonString.slice(offset)); -}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/strip-json-comments/license b/packages/wyatt_notification_bloc/example/scripts/node_modules/strip-json-comments/license deleted file mode 100644 index fa7ceba3..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/strip-json-comments/license +++ /dev/null @@ -1,9 +0,0 @@ -MIT License - -Copyright (c) Sindre Sorhus (https://sindresorhus.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/strip-json-comments/package.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/strip-json-comments/package.json deleted file mode 100644 index ce7875aa..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/strip-json-comments/package.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "name": "strip-json-comments", - "version": "3.1.1", - "description": "Strip comments from JSON. Lets you use comments in your JSON files!", - "license": "MIT", - "repository": "sindresorhus/strip-json-comments", - "funding": "https://github.com/sponsors/sindresorhus", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "https://sindresorhus.com" - }, - "engines": { - "node": ">=8" - }, - "scripts": { - "test": "xo && ava && tsd", - "bench": "matcha benchmark.js" - }, - "files": [ - "index.js", - "index.d.ts" - ], - "keywords": [ - "json", - "strip", - "comments", - "remove", - "delete", - "trim", - "multiline", - "parse", - "config", - "configuration", - "settings", - "util", - "env", - "environment", - "jsonc" - ], - "devDependencies": { - "ava": "^1.4.1", - "matcha": "^0.7.0", - "tsd": "^0.7.2", - "xo": "^0.24.0" - } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/strip-json-comments/readme.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/strip-json-comments/readme.md deleted file mode 100644 index cc542e50..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/strip-json-comments/readme.md +++ /dev/null @@ -1,78 +0,0 @@ -# strip-json-comments [![Build Status](https://travis-ci.com/sindresorhus/strip-json-comments.svg?branch=master)](https://travis-ci.com/github/sindresorhus/strip-json-comments) - -> Strip comments from JSON. Lets you use comments in your JSON files! - -This is now possible: - -```js -{ - // Rainbows - "unicorn": /* ❤ */ "cake" -} -``` - -It will replace single-line comments `//` and multi-line comments `/**/` with whitespace. This allows JSON error positions to remain as close as possible to the original source. - -Also available as a [Gulp](https://github.com/sindresorhus/gulp-strip-json-comments)/[Grunt](https://github.com/sindresorhus/grunt-strip-json-comments)/[Broccoli](https://github.com/sindresorhus/broccoli-strip-json-comments) plugin. - -## Install - -``` -$ npm install strip-json-comments -``` - -## Usage - -```js -const json = `{ - // Rainbows - "unicorn": /* ❤ */ "cake" -}`; - -JSON.parse(stripJsonComments(json)); -//=> {unicorn: 'cake'} -``` - -## API - -### stripJsonComments(jsonString, options?) - -#### jsonString - -Type: `string` - -Accepts a string with JSON and returns a string without comments. - -#### options - -Type: `object` - -##### whitespace - -Type: `boolean`\ -Default: `true` - -Replace comments with whitespace instead of stripping them entirely. - -## Benchmark - -``` -$ npm run bench -``` - -## Related - -- [strip-json-comments-cli](https://github.com/sindresorhus/strip-json-comments-cli) - CLI for this module -- [strip-css-comments](https://github.com/sindresorhus/strip-css-comments) - Strip comments from CSS - ---- - -
    - - Get professional support for this package with a Tidelift subscription - -
    - - Tidelift helps make open source sustainable for maintainers while giving companies
    assurances about security, maintenance, and licensing for their dependencies. -
    -
    diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/stubs/index.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/stubs/index.js deleted file mode 100644 index 252f34f1..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/stubs/index.js +++ /dev/null @@ -1,35 +0,0 @@ -'use strict' - -module.exports = function stubs(obj, method, cfg, stub) { - if (!obj || !method || !obj[method]) - throw new Error('You must provide an object and a key for an existing method') - - if (!stub) { - stub = cfg - cfg = {} - } - - stub = stub || function() {} - - cfg.callthrough = cfg.callthrough || false - cfg.calls = cfg.calls || 0 - - var norevert = cfg.calls === 0 - - var cached = obj[method].bind(obj) - - obj[method] = function() { - var args = [].slice.call(arguments) - var returnVal - - if (cfg.callthrough) - returnVal = cached.apply(obj, args) - - returnVal = stub.apply(obj, args) || returnVal - - if (!norevert && --cfg.calls === 0) - obj[method] = cached - - return returnVal - } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/stubs/package.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/stubs/package.json deleted file mode 100644 index 7ced3ab3..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/stubs/package.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "name": "stubs", - "version": "3.0.0", - "description": "Easy method stubber.", - "main": "index.js", - "scripts": { - "test": "node ./test" - }, - "repository": { - "type": "git", - "url": "https://github.com/stephenplusplus/stubs" - }, - "keywords": [ - "stubs" - ], - "author": "Stephen Sawchuk", - "license": "MIT", - "bugs": { - "url": "https://github.com/stephenplusplus/stubs/issues" - }, - "homepage": "https://github.com/stephenplusplus/stubs", - "devDependencies": { - "tess": "^1.0.0" - } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/stubs/readme.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/stubs/readme.md deleted file mode 100644 index ed076284..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/stubs/readme.md +++ /dev/null @@ -1,73 +0,0 @@ -# stubs - -> It's a simple stubber. - -## About - -For when you don't want to write the same thing over and over to cache a method and call an override, then revert it, and blah blah. - - -## Use -```sh -$ npm install --save-dev stubs -``` -```js -var mylib = require('./lib/index.js') -var stubs = require('stubs') - -// make it a noop -stubs(mylib, 'create') - -// stub it out -stubs(mylib, 'create', function() { - // calls this instead -}) - -// stub it out, but call the original first -stubs(mylib, 'create', { callthrough: true }, function() { - // call original method, then call this -}) - -// use the stub for a while, then revert -stubs(mylib, 'create', { calls: 3 }, function() { - // call this 3 times, then use the original method -}) -``` - - -## API - -### stubs(object, method[[, opts], stub]) - -#### object -- Type: Object - -#### method -- Type: String - -Name of the method to stub. - -#### opts -- (optional) -- Type: Object - -##### opts.callthrough -- (optional) -- Type: Boolean -- Default: `false` - -Call the original method as well as the stub (if a stub is provided). - -##### opts.calls -- (optional) -- Type: Number -- Default: `0` (never revert) - -Number of calls to allow the stub to receive until reverting to the original. - -#### stub -- (optional) -- Type: Function -- Default: `function() {}` - -This method is called in place of the original method. If `opts.callthrough` is `true`, this method is called *after* the original method is called as well. \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/stubs/test.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/stubs/test.js deleted file mode 100644 index cae408e2..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/stubs/test.js +++ /dev/null @@ -1,172 +0,0 @@ -'use strict' - -var assert = require('assert') -var stubs = require('./') -var tess = require('tess') - -tess('init', function(it) { - it('is a function', function() { - assert.equal(typeof stubs, 'function') - }) - - it('throws without obj || method', function() { - assert.throws(function() { - stubs() - }, /must provide/) - - assert.throws(function() { - stubs({}) - }, /must provide/) - }) -}) - -tess('stubs', function(it) { - it('stubs a method with a noop', function() { - var originalCalled = false - - var obj = {} - obj.method = function() { - originalCalled = true - } - - stubs(obj, 'method') - - obj.method() - - assert(!originalCalled) - }) - - it('accepts an override', function() { - var originalCalled = false - - var obj = {} - obj.method = function() { - originalCalled = true - } - - var replacementCalled = false - stubs(obj, 'method', function() { - replacementCalled = true - }) - - obj.method() - assert(!originalCalled) - assert(replacementCalled) - }) - - it('returns value of overridden method call', function() { - var overriddenUniqueVal = {} - - var obj = {} - obj.method = function() {} - - stubs(obj, 'method', { callthrough: true }, function() { - return overriddenUniqueVal - }) - - assert.strictEqual(obj.method(), overriddenUniqueVal) - }) - - it('calls through to original method', function() { - var originalCalled = false - - var obj = {} - obj.method = function() { - originalCalled = true - } - - var replacementCalled = false - stubs(obj, 'method', { callthrough: true }, function() { - replacementCalled = true - }) - - obj.method() - assert(originalCalled) - assert(replacementCalled) - }) - - it('returns value of original method call', function() { - var uniqueVal = Date.now() - - var obj = {} - obj.method = function() { - return uniqueVal - } - - stubs(obj, 'method', { callthrough: true }, function() {}) - - assert.equal(obj.method(), uniqueVal) - }) - - it('returns calls override and returns original value', function() { - var uniqueVal = {} - var overrideWasCalled = false - - var obj = {} - obj.method = function() { - return uniqueVal - } - - stubs(obj, 'method', { callthrough: true }, function() { - // does not return anything - overrideWasCalled = true - }) - - assert.strictEqual(obj.method(), uniqueVal) - assert.strictEqual(overrideWasCalled, true) - }) - - it('returns value of overridden method call', function() { - var uniqueVal = {} - var overriddenUniqueVal = {} - - var obj = {} - obj.method = function() { - return uniqueVal - } - - stubs(obj, 'method', { callthrough: true }, function() { - return overriddenUniqueVal - }) - - assert.strictEqual(obj.method(), overriddenUniqueVal) - }) - - it('stops calling stub after n calls', function() { - var timesToCall = 5 - var timesCalled = 0 - - var obj = {} - obj.method = function() { - assert.equal(timesCalled, timesToCall) - } - - stubs(obj, 'method', { calls: timesToCall }, function() { - timesCalled++ - }) - - obj.method() // 1 (stub) - obj.method() // 2 (stub) - obj.method() // 3 (stub) - obj.method() // 4 (stub) - obj.method() // 5 (stub) - obj.method() // 6 (original) - }) - - it('calls stub in original context of obj', function() { - var secret = 'brownies' - - function Class() { - this.method = function() {} - this.secret = secret - } - - var cl = new Class() - - stubs(cl, 'method', function() { - assert.equal(this.secret, secret) - }) - - cl.method() - }) -}) diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/supports-color/browser.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/supports-color/browser.js deleted file mode 100644 index 62afa3a7..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/supports-color/browser.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; -module.exports = { - stdout: false, - stderr: false -}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/supports-color/index.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/supports-color/index.js deleted file mode 100644 index 6fada390..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/supports-color/index.js +++ /dev/null @@ -1,135 +0,0 @@ -'use strict'; -const os = require('os'); -const tty = require('tty'); -const hasFlag = require('has-flag'); - -const {env} = process; - -let forceColor; -if (hasFlag('no-color') || - hasFlag('no-colors') || - hasFlag('color=false') || - hasFlag('color=never')) { - forceColor = 0; -} else if (hasFlag('color') || - hasFlag('colors') || - hasFlag('color=true') || - hasFlag('color=always')) { - forceColor = 1; -} - -if ('FORCE_COLOR' in env) { - if (env.FORCE_COLOR === 'true') { - forceColor = 1; - } else if (env.FORCE_COLOR === 'false') { - forceColor = 0; - } else { - forceColor = env.FORCE_COLOR.length === 0 ? 1 : Math.min(parseInt(env.FORCE_COLOR, 10), 3); - } -} - -function translateLevel(level) { - if (level === 0) { - return false; - } - - return { - level, - hasBasic: true, - has256: level >= 2, - has16m: level >= 3 - }; -} - -function supportsColor(haveStream, streamIsTTY) { - if (forceColor === 0) { - return 0; - } - - if (hasFlag('color=16m') || - hasFlag('color=full') || - hasFlag('color=truecolor')) { - return 3; - } - - if (hasFlag('color=256')) { - return 2; - } - - if (haveStream && !streamIsTTY && forceColor === undefined) { - return 0; - } - - const min = forceColor || 0; - - if (env.TERM === 'dumb') { - return min; - } - - if (process.platform === 'win32') { - // Windows 10 build 10586 is the first Windows release that supports 256 colors. - // Windows 10 build 14931 is the first release that supports 16m/TrueColor. - const osRelease = os.release().split('.'); - if ( - Number(osRelease[0]) >= 10 && - Number(osRelease[2]) >= 10586 - ) { - return Number(osRelease[2]) >= 14931 ? 3 : 2; - } - - return 1; - } - - if ('CI' in env) { - if (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI', 'GITHUB_ACTIONS', 'BUILDKITE'].some(sign => sign in env) || env.CI_NAME === 'codeship') { - return 1; - } - - return min; - } - - if ('TEAMCITY_VERSION' in env) { - return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0; - } - - if (env.COLORTERM === 'truecolor') { - return 3; - } - - if ('TERM_PROGRAM' in env) { - const version = parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10); - - switch (env.TERM_PROGRAM) { - case 'iTerm.app': - return version >= 3 ? 3 : 2; - case 'Apple_Terminal': - return 2; - // No default - } - } - - if (/-256(color)?$/i.test(env.TERM)) { - return 2; - } - - if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) { - return 1; - } - - if ('COLORTERM' in env) { - return 1; - } - - return min; -} - -function getSupportLevel(stream) { - const level = supportsColor(stream, stream && stream.isTTY); - return translateLevel(level); -} - -module.exports = { - supportsColor: getSupportLevel, - stdout: translateLevel(supportsColor(true, tty.isatty(1))), - stderr: translateLevel(supportsColor(true, tty.isatty(2))) -}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/supports-color/license b/packages/wyatt_notification_bloc/example/scripts/node_modules/supports-color/license deleted file mode 100644 index e7af2f77..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/supports-color/license +++ /dev/null @@ -1,9 +0,0 @@ -MIT License - -Copyright (c) Sindre Sorhus (sindresorhus.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/supports-color/package.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/supports-color/package.json deleted file mode 100644 index f7182edc..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/supports-color/package.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "name": "supports-color", - "version": "7.2.0", - "description": "Detect whether a terminal supports color", - "license": "MIT", - "repository": "chalk/supports-color", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "engines": { - "node": ">=8" - }, - "scripts": { - "test": "xo && ava" - }, - "files": [ - "index.js", - "browser.js" - ], - "keywords": [ - "color", - "colour", - "colors", - "terminal", - "console", - "cli", - "ansi", - "styles", - "tty", - "rgb", - "256", - "shell", - "xterm", - "command-line", - "support", - "supports", - "capability", - "detect", - "truecolor", - "16m" - ], - "dependencies": { - "has-flag": "^4.0.0" - }, - "devDependencies": { - "ava": "^1.4.1", - "import-fresh": "^3.0.0", - "xo": "^0.24.0" - }, - "browser": "browser.js" -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/supports-color/readme.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/supports-color/readme.md deleted file mode 100644 index 36542285..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/supports-color/readme.md +++ /dev/null @@ -1,76 +0,0 @@ -# supports-color [![Build Status](https://travis-ci.org/chalk/supports-color.svg?branch=master)](https://travis-ci.org/chalk/supports-color) - -> Detect whether a terminal supports color - - -## Install - -``` -$ npm install supports-color -``` - - -## Usage - -```js -const supportsColor = require('supports-color'); - -if (supportsColor.stdout) { - console.log('Terminal stdout supports color'); -} - -if (supportsColor.stdout.has256) { - console.log('Terminal stdout supports 256 colors'); -} - -if (supportsColor.stderr.has16m) { - console.log('Terminal stderr supports 16 million colors (truecolor)'); -} -``` - - -## API - -Returns an `Object` with a `stdout` and `stderr` property for testing either streams. Each property is an `Object`, or `false` if color is not supported. - -The `stdout`/`stderr` objects specifies a level of support for color through a `.level` property and a corresponding flag: - -- `.level = 1` and `.hasBasic = true`: Basic color support (16 colors) -- `.level = 2` and `.has256 = true`: 256 color support -- `.level = 3` and `.has16m = true`: Truecolor support (16 million colors) - - -## Info - -It obeys the `--color` and `--no-color` CLI flags. - -For situations where using `--color` is not possible, use the environment variable `FORCE_COLOR=1` (level 1), `FORCE_COLOR=2` (level 2), or `FORCE_COLOR=3` (level 3) to forcefully enable color, or `FORCE_COLOR=0` to forcefully disable. The use of `FORCE_COLOR` overrides all other color support checks. - -Explicit 256/Truecolor mode can be enabled using the `--color=256` and `--color=16m` flags, respectively. - - -## Related - -- [supports-color-cli](https://github.com/chalk/supports-color-cli) - CLI for this module -- [chalk](https://github.com/chalk/chalk) - Terminal string styling done right - - -## Maintainers - -- [Sindre Sorhus](https://github.com/sindresorhus) -- [Josh Junon](https://github.com/qix-) - - ---- - -
    - - Get professional support for this package with a Tidelift subscription - -
    - - Tidelift helps make open source sustainable for maintainers while giving companies
    assurances about security, maintenance, and licensing for their dependencies. -
    -
    - ---- diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/taffydb/package.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/taffydb/package.json deleted file mode 100644 index 29e0b9c5..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/taffydb/package.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "author": { - "name": "Ian Smith" - }, - "contributors": [ - { - "name": "Ian Smith" - }, - { - "name": "Todd Chambery", - "email": "todd.chambery@gmail.com" - }, - { - "name": "Daniel Ruf", - "email": "kontakt@daniel-ruf.de" - }, - { - "name": "Michael Mikowski", - "email": "mmikowski@snaplogic.com" - }, - { - "name": "Matthew Chase Whittemore", - "email": "mcwhittemore@gmail.com" - } - ], - "name": "taffydb", - "main": "./taffy", - "description": "TaffyDB is an opensouce library that brings database features into your JavaScript applications.", - "version": "2.6.2", - "homepage": "http://taffydb.com/", - "repository": { - "type": "git", - "url": "git://github.com/typicaljoe/taffydb.git" - }, - "dependencies": {}, - "devDependencies": {}, - "maintainers": [ - { - "name": "chambery", - "email": "todd.chambery@gmail.com" - }, - { - "name": "mcwhittemore", - "email": "mcwhittemore@gmail.com" - } - ] -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/taffydb/taffy-test.html b/packages/wyatt_notification_bloc/example/scripts/node_modules/taffydb/taffy-test.html deleted file mode 100644 index c4df78b4..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/taffydb/taffy-test.html +++ /dev/null @@ -1,84 +0,0 @@ - - - - - taffy test - - - - - - -
    -Please open your javascript console to see test results -
    - - - - diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/taffydb/taffy.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/taffydb/taffy.js deleted file mode 100644 index b7ad88cd..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/taffydb/taffy.js +++ /dev/null @@ -1,1973 +0,0 @@ -/* - - Software License Agreement (BSD License) - http://taffydb.com - Copyright (c) - All rights reserved. - - - Redistribution and use of this software in source and binary forms, with or without modification, are permitted provided that the following condition is met: - - * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - */ - -/*jslint browser : true, continue : true, - devel : true, indent : 2, maxerr : 500, - newcap : true, nomen : true, plusplus : true, - regexp : true, sloppy : true, vars : false, - white : true -*/ - -// BUILD 193d48d, modified by mmikowski to pass jslint - -// Setup TAFFY name space to return an object with methods -var TAFFY, exports, T; -(function () { - 'use strict'; - var - typeList, makeTest, idx, typeKey, - version, TC, idpad, cmax, - API, protectJSON, each, eachin, - isIndexable, returnFilter, runFilters, - numcharsplit, orderByCol, run - ; - - - if ( ! TAFFY ){ - // TC = Counter for Taffy DBs on page, used for unique IDs - // cmax = size of charnumarray conversion cache - // idpad = zeros to pad record IDs with - version = '2.6.2'; // proposed mmikowski 2012-08-06 - TC = 1; - idpad = '000000'; - cmax = 1000; - API = {}; - - protectJSON = function ( t ) { - // **************************************** - // * - // * Takes: a variable - // * Returns: the variable if object/array or the parsed variable if JSON - // * - // **************************************** - if ( TAFFY.isArray( t ) || TAFFY.isObject( t ) ){ - return t; - } - else { - return JSON.parse( t ); - } - }; - - each = function ( a, fun, u ) { - var r, i, x, y; - // **************************************** - // * - // * Takes: - // * a = an object/value or an array of objects/values - // * f = a function - // * u = optional flag to describe how to handle undefined values - // in array of values. True: pass them to the functions, - // False: skip. Default False; - // * Purpose: Used to loop over arrays - // * - // **************************************** - if ( a && ((T.isArray( a ) && a.length === 1) || (!T.isArray( a ))) ){ - fun( (T.isArray( a )) ? a[0] : a, 0 ); - } - else { - for ( r, i, x = 0, a = (T.isArray( a )) ? a : [a], y = a.length; - x < y; x++ ) - { - i = a[x]; - if ( !T.isUndefined( i ) || (u || false) ){ - r = fun( i, x ); - if ( r === T.EXIT ){ - break; - } - - } - } - } - }; - - eachin = function ( o, fun ) { - // **************************************** - // * - // * Takes: - // * o = an object - // * f = a function - // * Purpose: Used to loop over objects - // * - // **************************************** - var x = 0, r, i; - - for ( i in o ){ - if ( o.hasOwnProperty( i ) ){ - r = fun( o[i], i, x++ ); - if ( r === T.EXIT ){ - break; - } - } - } - - }; - - API.extend = function ( m, f ) { - // **************************************** - // * - // * Takes: method name, function - // * Purpose: Add a custom method to the API - // * - // **************************************** - API[m] = function () { - return f.apply( this, arguments ); - }; - }; - - isIndexable = function ( f ) { - var i; - // Check to see if record ID - if ( T.isString( f ) && /[t][0-9]*[r][0-9]*/i.test( f ) ){ - return true; - } - // Check to see if record - if ( T.isObject( f ) && f.___id && f.___s ){ - return true; - } - - // Check to see if array of indexes - if ( T.isArray( f ) ){ - i = true; - each( f, function ( r ) { - if ( !isIndexable( r ) ){ - i = false; - - return TAFFY.EXIT; - } - }); - return i; - } - - return false; - }; - - runFilters = function ( r, filter ) { - // **************************************** - // * - // * Takes: takes a record and a collection of filters - // * Returns: true if the record matches, false otherwise - // **************************************** - var match = true; - - - each( filter, function ( mf ) { - switch ( T.typeOf( mf ) ){ - case 'function': - // run function - if ( !mf.apply( r ) ){ - match = false; - return TAFFY.EXIT; - } - break; - case 'array': - // loop array and treat like a SQL or - match = (mf.length === 1) ? (runFilters( r, mf[0] )) : - (mf.length === 2) ? (runFilters( r, mf[0] ) || - runFilters( r, mf[1] )) : - (mf.length === 3) ? (runFilters( r, mf[0] ) || - runFilters( r, mf[1] ) || runFilters( r, mf[2] )) : - (mf.length === 4) ? (runFilters( r, mf[0] ) || - runFilters( r, mf[1] ) || runFilters( r, mf[2] ) || - runFilters( r, mf[3] )) : false; - if ( mf.length > 4 ){ - each( mf, function ( f ) { - if ( runFilters( r, f ) ){ - match = true; - } - }); - } - break; - } - }); - - return match; - }; - - returnFilter = function ( f ) { - // **************************************** - // * - // * Takes: filter object - // * Returns: a filter function - // * Purpose: Take a filter object and return a function that can be used to compare - // * a TaffyDB record to see if the record matches a query - // **************************************** - var nf = []; - if ( T.isString( f ) && /[t][0-9]*[r][0-9]*/i.test( f ) ){ - f = { ___id : f }; - } - if ( T.isArray( f ) ){ - // if we are working with an array - - each( f, function ( r ) { - // loop the array and return a filter func for each value - nf.push( returnFilter( r ) ); - }); - // now build a func to loop over the filters and return true if ANY of the filters match - // This handles logical OR expressions - f = function () { - var that = this, match = false; - each( nf, function ( f ) { - if ( runFilters( that, f ) ){ - match = true; - } - }); - return match; - }; - return f; - - } - // if we are dealing with an Object - if ( T.isObject( f ) ){ - if ( T.isObject( f ) && f.___id && f.___s ){ - f = { ___id : f.___id }; - } - - // Loop over each value on the object to prep match type and match value - eachin( f, function ( v, i ) { - - // default match type to IS/Equals - if ( !T.isObject( v ) ){ - v = { - 'is' : v - }; - } - // loop over each value on the value object - if any - eachin( v, function ( mtest, s ) { - // s = match type, e.g. is, hasAll, like, etc - var c = [], looper; - - // function to loop and apply filter - looper = (s === 'hasAll') ? - function ( mtest, func ) { - func( mtest ); - } : each; - - // loop over each test - looper( mtest, function ( mtest ) { - - // su = match success - // f = match false - var su = true, f = false, matchFunc; - - - // push a function onto the filter collection to do the matching - matchFunc = function () { - - // get the value from the record - var - mvalue = this[i], - eqeq = '==', - bangeq = '!=', - eqeqeq = '===', - lt = '<', - gt = '>', - lteq = '<=', - gteq = '>=', - bangeqeq = '!==', - r - ; - - - if ( (s.indexOf( '!' ) === 0) && s !== bangeq && - s !== bangeqeq ) - { - // if the filter name starts with ! as in '!is' then reverse the match logic and remove the ! - su = false; - s = s.substring( 1, s.length ); - } - // get the match results based on the s/match type - /*jslint eqeq : true */ - r = ( - (s === 'regex') ? (mtest.test( mvalue )) : (s === 'lt' || s === lt) - ? (mvalue < mtest) : (s === 'gt' || s === gt) - ? (mvalue > mtest) : (s === 'lte' || s === lteq) - ? (mvalue <= mtest) : (s === 'gte' || s === gteq) - ? (mvalue >= mtest) : (s === 'left') - ? (mvalue.indexOf( mtest ) === 0) : (s === 'leftnocase') - ? (mvalue.toLowerCase().indexOf( mtest.toLowerCase() ) - === 0) : (s === 'right') - ? (mvalue.substring( (mvalue.length - mtest.length) ) - === mtest) : (s === 'rightnocase') - ? (mvalue.toLowerCase().substring( - (mvalue.length - mtest.length) ) === mtest.toLowerCase()) - : (s === 'like') - ? (mvalue.indexOf( mtest ) >= 0) : (s === 'likenocase') - ? (mvalue.toLowerCase().indexOf(mtest.toLowerCase()) >= 0) - : (s === eqeqeq || s === 'is') - ? (mvalue === mtest) : (s === eqeq) - ? (mvalue == mtest) : (s === bangeqeq) - ? (mvalue !== mtest) : (s === bangeq) - ? (mvalue != mtest) : (s === 'isnocase') - ? (mvalue.toLowerCase - ? mvalue.toLowerCase() === mtest.toLowerCase() - : mvalue === mtest) : (s === 'has') - ? (T.has( mvalue, mtest )) : (s === 'hasall') - ? (T.hasAll( mvalue, mtest )) : ( - s.indexOf( 'is' ) === -1 - && !TAFFY.isNull( mvalue ) - && !TAFFY.isUndefined( mvalue ) - && !TAFFY.isObject( mtest ) - && !TAFFY.isArray( mtest ) - ) - ? (mtest === mvalue[s]) - : (T[s] && T.isFunction( T[s] ) - && s.indexOf( 'is' ) === 0) - ? T[s]( mvalue ) === mtest - : (T[s] && T.isFunction( T[s] )) - ? T[s]( mvalue, mtest ) : (false) - ); - /*jslint eqeq : false */ - r = (r && !su) ? false : (!r && !su) ? true : r; - - return r; - }; - c.push( matchFunc ); - - }); - // if only one filter in the collection push it onto the filter list without the array - if ( c.length === 1 ){ - - nf.push( c[0] ); - } - else { - // else build a function to loop over all the filters and return true only if ALL match - // this is a logical AND - nf.push( function () { - var that = this, match = false; - each( c, function ( f ) { - if ( f.apply( that ) ){ - match = true; - } - }); - return match; - }); - } - }); - }); - // finally return a single function that wraps all the other functions and will run a query - // where all functions have to return true for a record to appear in a query result - f = function () { - var that = this, match = true; - // faster if less than 4 functions - match = (nf.length === 1 && !nf[0].apply( that )) ? false : - (nf.length === 2 && - (!nf[0].apply( that ) || !nf[1].apply( that ))) ? false : - (nf.length === 3 && - (!nf[0].apply( that ) || !nf[1].apply( that ) || - !nf[2].apply( that ))) ? false : - (nf.length === 4 && - (!nf[0].apply( that ) || !nf[1].apply( that ) || - !nf[2].apply( that ) || !nf[3].apply( that ))) ? false - : true; - if ( nf.length > 4 ){ - each( nf, function ( f ) { - if ( !runFilters( that, f ) ){ - match = false; - } - }); - } - return match; - }; - return f; - } - - // if function - if ( T.isFunction( f ) ){ - return f; - } - }; - - orderByCol = function ( ar, o ) { - // **************************************** - // * - // * Takes: takes an array and a sort object - // * Returns: the array sorted - // * Purpose: Accept filters such as "[col], [col2]" or "[col] desc" and sort on those columns - // * - // **************************************** - - var sortFunc = function ( a, b ) { - // function to pass to the native array.sort to sort an array - var r = 0; - - T.each( o, function ( sd ) { - // loop over the sort instructions - // get the column name - var o, col, dir, c, d; - o = sd.split( ' ' ); - col = o[0]; - - // get the direction - dir = (o.length === 1) ? "logical" : o[1]; - - - if ( dir === 'logical' ){ - // if dir is logical than grab the charnum arrays for the two values we are looking at - c = numcharsplit( a[col] ); - d = numcharsplit( b[col] ); - // loop over the charnumarrays until one value is higher than the other - T.each( (c.length <= d.length) ? c : d, function ( x, i ) { - if ( c[i] < d[i] ){ - r = -1; - return TAFFY.EXIT; - } - else if ( c[i] > d[i] ){ - r = 1; - return TAFFY.EXIT; - } - } ); - } - else if ( dir === 'logicaldesc' ){ - // if logicaldesc than grab the charnum arrays for the two values we are looking at - c = numcharsplit( a[col] ); - d = numcharsplit( b[col] ); - // loop over the charnumarrays until one value is lower than the other - T.each( (c.length <= d.length) ? c : d, function ( x, i ) { - if ( c[i] > d[i] ){ - r = -1; - return TAFFY.EXIT; - } - else if ( c[i] < d[i] ){ - r = 1; - return TAFFY.EXIT; - } - } ); - } - else if ( dir === 'asec' && a[col] < b[col] ){ - // if asec - default - check to see which is higher - r = -1; - return T.EXIT; - } - else if ( dir === 'asec' && a[col] > b[col] ){ - // if asec - default - check to see which is higher - r = 1; - return T.EXIT; - } - else if ( dir === 'desc' && a[col] > b[col] ){ - // if desc check to see which is lower - r = -1; - return T.EXIT; - - } - else if ( dir === 'desc' && a[col] < b[col] ){ - // if desc check to see which is lower - r = 1; - return T.EXIT; - - } - // if r is still 0 and we are doing a logical sort than look to see if one array is longer than the other - if ( r === 0 && dir === 'logical' && c.length < d.length ){ - r = -1; - } - else if ( r === 0 && dir === 'logical' && c.length > d.length ){ - r = 1; - } - else if ( r === 0 && dir === 'logicaldesc' && c.length > d.length ){ - r = -1; - } - else if ( r === 0 && dir === 'logicaldesc' && c.length < d.length ){ - r = 1; - } - - if ( r !== 0 ){ - return T.EXIT; - } - - - } ); - return r; - }; - // call the sort function and return the newly sorted array - return (ar && ar.push) ? ar.sort( sortFunc ) : ar; - - - }; - - // **************************************** - // * - // * Takes: a string containing numbers and letters and turn it into an array - // * Returns: return an array of numbers and letters - // * Purpose: Used for logical sorting. String Example: 12ABC results: [12,'ABC'] - // **************************************** - (function () { - // creates a cache for numchar conversions - var cache = {}, cachcounter = 0; - // creates the numcharsplit function - numcharsplit = function ( thing ) { - // if over 1000 items exist in the cache, clear it and start over - if ( cachcounter > cmax ){ - cache = {}; - cachcounter = 0; - } - - // if a cache can be found for a numchar then return its array value - return cache['_' + thing] || (function () { - // otherwise do the conversion - // make sure it is a string and setup so other variables - var nthing = String( thing ), - na = [], - rv = '_', - rt = '', - x, xx, c; - - // loop over the string char by char - for ( x = 0, xx = nthing.length; x < xx; x++ ){ - // take the char at each location - c = nthing.charCodeAt( x ); - // check to see if it is a valid number char and append it to the array. - // if last char was a string push the string to the charnum array - if ( ( c >= 48 && c <= 57 ) || c === 46 ){ - if ( rt !== 'n' ){ - rt = 'n'; - na.push( rv.toLowerCase() ); - rv = ''; - } - rv = rv + nthing.charAt( x ); - } - else { - // check to see if it is a valid string char and append to string - // if last char was a number push the whole number to the charnum array - if ( rt !== 's' ){ - rt = 's'; - na.push( parseFloat( rv ) ); - rv = ''; - } - rv = rv + nthing.charAt( x ); - } - } - // once done, push the last value to the charnum array and remove the first uneeded item - na.push( (rt === 'n') ? parseFloat( rv ) : rv.toLowerCase() ); - na.shift(); - // add to cache - cache['_' + thing] = na; - cachcounter++; - // return charnum array - return na; - }()); - }; - }()); - - // **************************************** - // * - // * Runs a query - // **************************************** - - - run = function () { - this.context( { - results : this.getDBI().query( this.context() ) - }); - - }; - - API.extend( 'filter', function () { - // **************************************** - // * - // * Takes: takes unlimited filter objects as arguments - // * Returns: method collection - // * Purpose: Take filters as objects and cache functions for later lookup when a query is run - // **************************************** - var - nc = TAFFY.mergeObj( this.context(), { run : null } ), - nq = [] - ; - each( nc.q, function ( v ) { - nq.push( v ); - }); - nc.q = nq; - // Hadnle passing of ___ID or a record on lookup. - each( arguments, function ( f ) { - nc.q.push( returnFilter( f ) ); - nc.filterRaw.push( f ); - }); - - return this.getroot( nc ); - }); - - API.extend( 'order', function ( o ) { - // **************************************** - // * - // * Purpose: takes a string and creates an array of order instructions to be used with a query - // **************************************** - - o = o.split( ',' ); - var x = [], nc; - - each( o, function ( r ) { - x.push( r.replace( /^\s*/, '' ).replace( /\s*$/, '' ) ); - }); - - nc = TAFFY.mergeObj( this.context(), {sort : null} ); - nc.order = x; - - return this.getroot( nc ); - }); - - API.extend( 'limit', function ( n ) { - // **************************************** - // * - // * Purpose: takes a limit number to limit the number of rows returned by a query. Will update the results - // * of a query - // **************************************** - var nc = TAFFY.mergeObj( this.context(), {}), - limitedresults - ; - - nc.limit = n; - - if ( nc.run && nc.sort ){ - limitedresults = []; - each( nc.results, function ( i, x ) { - if ( (x + 1) > n ){ - return TAFFY.EXIT; - } - limitedresults.push( i ); - }); - nc.results = limitedresults; - } - - return this.getroot( nc ); - }); - - API.extend( 'start', function ( n ) { - // **************************************** - // * - // * Purpose: takes a limit number to limit the number of rows returned by a query. Will update the results - // * of a query - // **************************************** - var nc = TAFFY.mergeObj( this.context(), {} ), - limitedresults - ; - - nc.start = n; - - if ( nc.run && nc.sort && !nc.limit ){ - limitedresults = []; - each( nc.results, function ( i, x ) { - if ( (x + 1) > n ){ - limitedresults.push( i ); - } - }); - nc.results = limitedresults; - } - else { - nc = TAFFY.mergeObj( this.context(), {run : null, start : n} ); - } - - return this.getroot( nc ); - }); - - API.extend( 'update', function ( arg0, arg1, arg2 ) { - // **************************************** - // * - // * Takes: a object and passes it off DBI update method for all matched records - // **************************************** - var runEvent = true, o = {}, args = arguments, that; - if ( TAFFY.isString( arg0 ) && - (arguments.length === 2 || arguments.length === 3) ) - { - o[arg0] = arg1; - if ( arguments.length === 3 ){ - runEvent = arg2; - } - } - else { - o = arg0; - if ( args.length === 2 ){ - runEvent = arg1; - } - } - - that = this; - run.call( this ); - each( this.context().results, function ( r ) { - var c = o; - if ( TAFFY.isFunction( c ) ){ - c = c.apply( TAFFY.mergeObj( r, {} ) ); - } - else { - if ( T.isFunction( c ) ){ - c = c( TAFFY.mergeObj( r, {} ) ); - } - } - if ( TAFFY.isObject( c ) ){ - that.getDBI().update( r.___id, c, runEvent ); - } - }); - if ( this.context().results.length ){ - this.context( { run : null }); - } - return this; - }); - API.extend( 'remove', function ( runEvent ) { - // **************************************** - // * - // * Purpose: removes records from the DB via the remove and removeCommit DBI methods - // **************************************** - var that = this, c = 0; - run.call( this ); - each( this.context().results, function ( r ) { - that.getDBI().remove( r.___id ); - c++; - }); - if ( this.context().results.length ){ - this.context( { - run : null - }); - that.getDBI().removeCommit( runEvent ); - } - - return c; - }); - - - API.extend( 'count', function () { - // **************************************** - // * - // * Returns: The length of a query result - // **************************************** - run.call( this ); - return this.context().results.length; - }); - - API.extend( 'callback', function ( f, delay ) { - // **************************************** - // * - // * Returns null; - // * Runs a function on return of run.call - // **************************************** - if ( f ){ - var that = this; - setTimeout( function () { - run.call( that ); - f.call( that.getroot( that.context() ) ); - }, delay || 0 ); - } - - - return null; - }); - - API.extend( 'get', function () { - // **************************************** - // * - // * Returns: An array of all matching records - // **************************************** - run.call( this ); - return this.context().results; - }); - - API.extend( 'stringify', function () { - // **************************************** - // * - // * Returns: An JSON string of all matching records - // **************************************** - return JSON.stringify( this.get() ); - }); - API.extend( 'first', function () { - // **************************************** - // * - // * Returns: The first matching record - // **************************************** - run.call( this ); - return this.context().results[0] || false; - }); - API.extend( 'last', function () { - // **************************************** - // * - // * Returns: The last matching record - // **************************************** - run.call( this ); - return this.context().results[this.context().results.length - 1] || - false; - }); - - - API.extend( 'sum', function () { - // **************************************** - // * - // * Takes: column to sum up - // * Returns: Sums the values of a column - // **************************************** - var total = 0, that = this; - run.call( that ); - each( arguments, function ( c ) { - each( that.context().results, function ( r ) { - total = total + r[c]; - }); - }); - return total; - }); - - API.extend( 'min', function ( c ) { - // **************************************** - // * - // * Takes: column to find min - // * Returns: the lowest value - // **************************************** - var lowest = null; - run.call( this ); - each( this.context().results, function ( r ) { - if ( lowest === null || r[c] < lowest ){ - lowest = r[c]; - } - }); - return lowest; - }); - - // Taffy innerJoin Extension (OCD edition) - // ======================================= - // - // How to Use - // ********** - // - // left_table.innerJoin( right_table, condition1 <,... conditionN> ) - // - // A condition can take one of 2 forms: - // - // 1. An ARRAY with 2 or 3 values: - // A column name from the left table, an optional comparison string, - // and column name from the right table. The condition passes if the test - // indicated is true. If the condition string is omitted, '===' is assumed. - // EXAMPLES: [ 'last_used_time', '>=', 'current_use_time' ], [ 'user_id','id' ] - // - // 2. A FUNCTION: - // The function receives a left table row and right table row during the - // cartesian join. If the function returns true for the rows considered, - // the merged row is included in the result set. - // EXAMPLE: function (l,r){ return l.name === r.label; } - // - // Conditions are considered in the order they are presented. Therefore the best - // performance is realized when the least expensive and highest prune-rate - // conditions are placed first, since if they return false Taffy skips any - // further condition tests. - // - // Other notes - // *********** - // - // This code passes jslint with the exception of 2 warnings about - // the '==' and '!=' lines. We can't do anything about that short of - // deleting the lines. - // - // Credits - // ******* - // - // Heavily based upon the work of Ian Toltz. - // Revisions to API by Michael Mikowski. - // Code convention per standards in http://manning.com/mikowski - (function () { - var innerJoinFunction = (function () { - var fnCompareList, fnCombineRow, fnMain; - - fnCompareList = function ( left_row, right_row, arg_list ) { - var data_lt, data_rt, op_code, error; - - if ( arg_list.length === 2 ){ - data_lt = left_row[arg_list[0]]; - op_code = '==='; - data_rt = right_row[arg_list[1]]; - } - else { - data_lt = left_row[arg_list[0]]; - op_code = arg_list[1]; - data_rt = right_row[arg_list[2]]; - } - - /*jslint eqeq : true */ - switch ( op_code ){ - case '===' : - return data_lt === data_rt; - case '!==' : - return data_lt !== data_rt; - case '<' : - return data_lt < data_rt; - case '>' : - return data_lt > data_rt; - case '<=' : - return data_lt <= data_rt; - case '>=' : - return data_lt >= data_rt; - case '==' : - return data_lt == data_rt; - case '!=' : - return data_lt != data_rt; - default : - throw String( op_code ) + ' is not supported'; - } - // 'jslint eqeq : false' here results in - // "Unreachable '/*jslint' after 'return'". - // We don't need it though, as the rule exception - // is discarded at the end of this functional scope - }; - - fnCombineRow = function ( left_row, right_row ) { - var out_map = {}, i, prefix; - - for ( i in left_row ){ - if ( left_row.hasOwnProperty( i ) ){ - out_map[i] = left_row[i]; - } - } - for ( i in right_row ){ - if ( right_row.hasOwnProperty( i ) && i !== '___id' && - i !== '___s' ) - { - prefix = !TAFFY.isUndefined( out_map[i] ) ? 'right_' : ''; - out_map[prefix + String( i ) ] = right_row[i]; - } - } - return out_map; - }; - - fnMain = function ( table ) { - var - right_table, i, - arg_list = arguments, - arg_length = arg_list.length, - result_list = [] - ; - - if ( typeof table.filter !== 'function' ){ - if ( table.TAFFY ){ right_table = table(); } - else { - throw 'TAFFY DB or result not supplied'; - } - } - else { right_table = table; } - - this.context( { - results : this.getDBI().query( this.context() ) - } ); - - TAFFY.each( this.context().results, function ( left_row ) { - right_table.each( function ( right_row ) { - var arg_data, is_ok = true; - CONDITION: - for ( i = 1; i < arg_length; i++ ){ - arg_data = arg_list[i]; - if ( typeof arg_data === 'function' ){ - is_ok = arg_data( left_row, right_row ); - } - else if ( typeof arg_data === 'object' && arg_data.length ){ - is_ok = fnCompareList( left_row, right_row, arg_data ); - } - else { - is_ok = false; - } - - if ( !is_ok ){ break CONDITION; } // short circuit - } - - if ( is_ok ){ - result_list.push( fnCombineRow( left_row, right_row ) ); - } - } ); - } ); - return TAFFY( result_list )(); - }; - - return fnMain; - }()); - - API.extend( 'join', innerJoinFunction ); - }()); - - API.extend( 'max', function ( c ) { - // **************************************** - // * - // * Takes: column to find max - // * Returns: the highest value - // **************************************** - var highest = null; - run.call( this ); - each( this.context().results, function ( r ) { - if ( highest === null || r[c] > highest ){ - highest = r[c]; - } - }); - return highest; - }); - - API.extend( 'select', function () { - // **************************************** - // * - // * Takes: columns to select values into an array - // * Returns: array of values - // * Note if more than one column is given an array of arrays is returned - // **************************************** - - var ra = [], args = arguments; - run.call( this ); - if ( arguments.length === 1 ){ - - each( this.context().results, function ( r ) { - - ra.push( r[args[0]] ); - }); - } - else { - each( this.context().results, function ( r ) { - var row = []; - each( args, function ( c ) { - row.push( r[c] ); - }); - ra.push( row ); - }); - } - return ra; - }); - API.extend( 'distinct', function () { - // **************************************** - // * - // * Takes: columns to select unique alues into an array - // * Returns: array of values - // * Note if more than one column is given an array of arrays is returned - // **************************************** - var ra = [], args = arguments; - run.call( this ); - if ( arguments.length === 1 ){ - - each( this.context().results, function ( r ) { - var v = r[args[0]], dup = false; - each( ra, function ( d ) { - if ( v === d ){ - dup = true; - return TAFFY.EXIT; - } - }); - if ( !dup ){ - ra.push( v ); - } - }); - } - else { - each( this.context().results, function ( r ) { - var row = [], dup = false; - each( args, function ( c ) { - row.push( r[c] ); - }); - each( ra, function ( d ) { - var ldup = true; - each( args, function ( c, i ) { - if ( row[i] !== d[i] ){ - ldup = false; - return TAFFY.EXIT; - } - }); - if ( ldup ){ - dup = true; - return TAFFY.EXIT; - } - }); - if ( !dup ){ - ra.push( row ); - } - }); - } - return ra; - }); - API.extend( 'supplant', function ( template, returnarray ) { - // **************************************** - // * - // * Takes: a string template formated with key to be replaced with values from the rows, flag to determine if we want array of strings - // * Returns: array of values or a string - // **************************************** - var ra = []; - run.call( this ); - each( this.context().results, function ( r ) { - // TODO: The curly braces used to be unescaped - ra.push( template.replace( /\{([^\{\}]*)\}/g, function ( a, b ) { - var v = r[b]; - return typeof v === 'string' || typeof v === 'number' ? v : a; - } ) ); - }); - return (!returnarray) ? ra.join( "" ) : ra; - }); - - - API.extend( 'each', function ( m ) { - // **************************************** - // * - // * Takes: a function - // * Purpose: loops over every matching record and applies the function - // **************************************** - run.call( this ); - each( this.context().results, m ); - return this; - }); - API.extend( 'map', function ( m ) { - // **************************************** - // * - // * Takes: a function - // * Purpose: loops over every matching record and applies the function, returing the results in an array - // **************************************** - var ra = []; - run.call( this ); - each( this.context().results, function ( r ) { - ra.push( m( r ) ); - }); - return ra; - }); - - - - T = function ( d ) { - // **************************************** - // * - // * T is the main TAFFY object - // * Takes: an array of objects or JSON - // * Returns a new TAFFYDB - // **************************************** - var TOb = [], - ID = {}, - RC = 1, - settings = { - template : false, - onInsert : false, - onUpdate : false, - onRemove : false, - onDBChange : false, - storageName : false, - forcePropertyCase : null, - cacheSize : 100, - name : '' - }, - dm = new Date(), - CacheCount = 0, - CacheClear = 0, - Cache = {}, - DBI, runIndexes, root - ; - // **************************************** - // * - // * TOb = this database - // * ID = collection of the record IDs and locations within the DB, used for fast lookups - // * RC = record counter, used for creating IDs - // * settings.template = the template to merge all new records with - // * settings.onInsert = event given a copy of the newly inserted record - // * settings.onUpdate = event given the original record, the changes, and the new record - // * settings.onRemove = event given the removed record - // * settings.forcePropertyCase = on insert force the proprty case to be lower or upper. default lower, null/undefined will leave case as is - // * dm = the modify date of the database, used for query caching - // **************************************** - - - runIndexes = function ( indexes ) { - // **************************************** - // * - // * Takes: a collection of indexes - // * Returns: collection with records matching indexed filters - // **************************************** - - var records = [], UniqueEnforce = false; - - if ( indexes.length === 0 ){ - return TOb; - } - - each( indexes, function ( f ) { - // Check to see if record ID - if ( T.isString( f ) && /[t][0-9]*[r][0-9]*/i.test( f ) && - TOb[ID[f]] ) - { - records.push( TOb[ID[f]] ); - UniqueEnforce = true; - } - // Check to see if record - if ( T.isObject( f ) && f.___id && f.___s && - TOb[ID[f.___id]] ) - { - records.push( TOb[ID[f.___id]] ); - UniqueEnforce = true; - } - // Check to see if array of indexes - if ( T.isArray( f ) ){ - each( f, function ( r ) { - each( runIndexes( r ), function ( rr ) { - records.push( rr ); - }); - - }); - } - }); - if ( UniqueEnforce && records.length > 1 ){ - records = []; - } - - return records; - }; - - DBI = { - // **************************************** - // * - // * The DBI is the internal DataBase Interface that interacts with the data - // **************************************** - dm : function ( nd ) { - // **************************************** - // * - // * Takes: an optional new modify date - // * Purpose: used to get and set the DB modify date - // **************************************** - if ( nd ){ - dm = nd; - Cache = {}; - CacheCount = 0; - CacheClear = 0; - } - if ( settings.onDBChange ){ - setTimeout( function () { - settings.onDBChange.call( TOb ); - }, 0 ); - } - if ( settings.storageName ){ - setTimeout( function () { - localStorage.setItem( 'taffy_' + settings.storageName, - JSON.stringify( TOb ) ); - }); - } - return dm; - }, - insert : function ( i, runEvent ) { - // **************************************** - // * - // * Takes: a new record to insert - // * Purpose: merge the object with the template, add an ID, insert into DB, call insert event - // **************************************** - var columns = [], - records = [], - input = protectJSON( i ) - ; - each( input, function ( v, i ) { - var nv, o; - if ( T.isArray( v ) && i === 0 ){ - each( v, function ( av ) { - - columns.push( (settings.forcePropertyCase === 'lower') - ? av.toLowerCase() - : (settings.forcePropertyCase === 'upper') - ? av.toUpperCase() : av ); - }); - return true; - } - else if ( T.isArray( v ) ){ - nv = {}; - each( v, function ( av, ai ) { - nv[columns[ai]] = av; - }); - v = nv; - - } - else if ( T.isObject( v ) && settings.forcePropertyCase ){ - o = {}; - - eachin( v, function ( av, ai ) { - o[(settings.forcePropertyCase === 'lower') ? ai.toLowerCase() - : (settings.forcePropertyCase === 'upper') - ? ai.toUpperCase() : ai] = v[ai]; - }); - v = o; - } - - RC++; - v.___id = 'T' + String( idpad + TC ).slice( -6 ) + 'R' + - String( idpad + RC ).slice( -6 ); - v.___s = true; - records.push( v.___id ); - if ( settings.template ){ - v = T.mergeObj( settings.template, v ); - } - TOb.push( v ); - - ID[v.___id] = TOb.length - 1; - if ( settings.onInsert && - (runEvent || TAFFY.isUndefined( runEvent )) ) - { - settings.onInsert.call( v ); - } - DBI.dm( new Date() ); - }); - return root( records ); - }, - sort : function ( o ) { - // **************************************** - // * - // * Purpose: Change the sort order of the DB itself and reset the ID bucket - // **************************************** - TOb = orderByCol( TOb, o.split( ',' ) ); - ID = {}; - each( TOb, function ( r, i ) { - ID[r.___id] = i; - }); - DBI.dm( new Date() ); - return true; - }, - update : function ( id, changes, runEvent ) { - // **************************************** - // * - // * Takes: the ID of record being changed and the changes - // * Purpose: Update a record and change some or all values, call the on update method - // **************************************** - - var nc = {}, or, nr, tc, hasChange; - if ( settings.forcePropertyCase ){ - eachin( changes, function ( v, p ) { - nc[(settings.forcePropertyCase === 'lower') ? p.toLowerCase() - : (settings.forcePropertyCase === 'upper') ? p.toUpperCase() - : p] = v; - }); - changes = nc; - } - - or = TOb[ID[id]]; - nr = T.mergeObj( or, changes ); - - tc = {}; - hasChange = false; - eachin( nr, function ( v, i ) { - if ( TAFFY.isUndefined( or[i] ) || or[i] !== v ){ - tc[i] = v; - hasChange = true; - } - }); - if ( hasChange ){ - if ( settings.onUpdate && - (runEvent || TAFFY.isUndefined( runEvent )) ) - { - settings.onUpdate.call( nr, TOb[ID[id]], tc ); - } - TOb[ID[id]] = nr; - DBI.dm( new Date() ); - } - }, - remove : function ( id ) { - // **************************************** - // * - // * Takes: the ID of record to be removed - // * Purpose: remove a record, changes its ___s value to false - // **************************************** - TOb[ID[id]].___s = false; - }, - removeCommit : function ( runEvent ) { - var x; - // **************************************** - // * - // * - // * Purpose: loop over all records and remove records with ___s = false, call onRemove event, clear ID - // **************************************** - for ( x = TOb.length - 1; x > -1; x-- ){ - - if ( !TOb[x].___s ){ - if ( settings.onRemove && - (runEvent || TAFFY.isUndefined( runEvent )) ) - { - settings.onRemove.call( TOb[x] ); - } - ID[TOb[x].___id] = undefined; - TOb.splice( x, 1 ); - } - } - ID = {}; - each( TOb, function ( r, i ) { - ID[r.___id] = i; - }); - DBI.dm( new Date() ); - }, - query : function ( context ) { - // **************************************** - // * - // * Takes: the context object for a query and either returns a cache result or a new query result - // **************************************** - var returnq, cid, results, indexed, limitq, ni; - - if ( settings.cacheSize ) { - cid = ''; - each( context.filterRaw, function ( r ) { - if ( T.isFunction( r ) ){ - cid = 'nocache'; - return TAFFY.EXIT; - } - }); - if ( cid === '' ){ - cid = JSON.stringify( T.mergeObj( context, - {q : false, run : false, sort : false} ) ); - } - } - // Run a new query if there are no results or the run date has been cleared - if ( !context.results || !context.run || - (context.run && DBI.dm() > context.run) ) - { - results = []; - - // check Cache - - if ( settings.cacheSize && Cache[cid] ){ - - Cache[cid].i = CacheCount++; - return Cache[cid].results; - } - else { - // if no filter, return DB - if ( context.q.length === 0 && context.index.length === 0 ){ - each( TOb, function ( r ) { - results.push( r ); - }); - returnq = results; - } - else { - // use indexes - - indexed = runIndexes( context.index ); - - // run filters - each( indexed, function ( r ) { - // Run filter to see if record matches query - if ( context.q.length === 0 || runFilters( r, context.q ) ){ - results.push( r ); - } - }); - - returnq = results; - } - } - - - } - else { - // If query exists and run has not been cleared return the cache results - returnq = context.results; - } - // If a custom order array exists and the run has been clear or the sort has been cleared - if ( context.order.length > 0 && (!context.run || !context.sort) ){ - // order the results - returnq = orderByCol( returnq, context.order ); - } - - // If a limit on the number of results exists and it is less than the returned results, limit results - if ( returnq.length && - ((context.limit && context.limit < returnq.length) || - context.start) - ) { - limitq = []; - each( returnq, function ( r, i ) { - if ( !context.start || - (context.start && (i + 1) >= context.start) ) - { - if ( context.limit ){ - ni = (context.start) ? (i + 1) - context.start : i; - if ( ni < context.limit ){ - limitq.push( r ); - } - else if ( ni > context.limit ){ - return TAFFY.EXIT; - } - } - else { - limitq.push( r ); - } - } - }); - returnq = limitq; - } - - // update cache - if ( settings.cacheSize && cid !== 'nocache' ){ - CacheClear++; - - setTimeout( function () { - var bCounter, nc; - if ( CacheClear >= settings.cacheSize * 2 ){ - CacheClear = 0; - bCounter = CacheCount - settings.cacheSize; - nc = {}; - eachin( function ( r, k ) { - if ( r.i >= bCounter ){ - nc[k] = r; - } - }); - Cache = nc; - } - }, 0 ); - - Cache[cid] = { i : CacheCount++, results : returnq }; - } - return returnq; - } - }; - - - root = function () { - var iAPI, context; - // **************************************** - // * - // * The root function that gets returned when a new DB is created - // * Takes: unlimited filter arguments and creates filters to be run when a query is called - // **************************************** - // **************************************** - // * - // * iAPI is the the method collection valiable when a query has been started by calling dbname - // * Certain methods are or are not avaliable once you have started a query such as insert -- you can only insert into root - // **************************************** - iAPI = TAFFY.mergeObj( TAFFY.mergeObj( API, { insert : undefined } ), - { getDBI : function () { return DBI; }, - getroot : function ( c ) { return root.call( c ); }, - context : function ( n ) { - // **************************************** - // * - // * The context contains all the information to manage a query including filters, limits, and sorts - // **************************************** - if ( n ){ - context = TAFFY.mergeObj( context, - n.hasOwnProperty('results') - ? TAFFY.mergeObj( n, { run : new Date(), sort: new Date() }) - : n - ); - } - return context; - }, - extend : undefined - }); - - context = (this && this.q) ? this : { - limit : false, - start : false, - q : [], - filterRaw : [], - index : [], - order : [], - results : false, - run : null, - sort : null, - settings : settings - }; - // **************************************** - // * - // * Call the query method to setup a new query - // **************************************** - each( arguments, function ( f ) { - - if ( isIndexable( f ) ){ - context.index.push( f ); - } - else { - context.q.push( returnFilter( f ) ); - } - context.filterRaw.push( f ); - }); - - - return iAPI; - }; - - // **************************************** - // * - // * If new records have been passed on creation of the DB either as JSON or as an array/object, insert them - // **************************************** - TC++; - if ( d ){ - DBI.insert( d ); - } - - - root.insert = DBI.insert; - - root.merge = function ( i, key, runEvent ) { - var - search = {}, - finalSearch = [], - obj = {} - ; - - runEvent = runEvent || false; - key = key || 'id'; - - each( i, function ( o ) { - var existingObject; - search[key] = o[key]; - finalSearch.push( o[key] ); - existingObject = root( search ).first(); - if ( existingObject ){ - DBI.update( existingObject.___id, o, runEvent ); - } - else { - DBI.insert( o, runEvent ); - } - }); - - obj[key] = finalSearch; - return root( obj ); - }; - - root.TAFFY = true; - root.sort = DBI.sort; - // **************************************** - // * - // * These are the methods that can be accessed on off the root DB function. Example dbname.insert; - // **************************************** - root.settings = function ( n ) { - // **************************************** - // * - // * Getting and setting for this DB's settings/events - // **************************************** - if ( n ){ - settings = TAFFY.mergeObj( settings, n ); - if ( n.template ){ - - root().update( n.template ); - } - } - return settings; - }; - - // **************************************** - // * - // * These are the methods that can be accessed on off the root DB function. Example dbname.insert; - // **************************************** - root.store = function ( n ) { - // **************************************** - // * - // * Setup localstorage for this DB on a given name - // * Pull data into the DB as needed - // **************************************** - var r = false, i; - if ( localStorage ){ - if ( n ){ - i = localStorage.getItem( 'taffy_' + n ); - if ( i && i.length > 0 ){ - root.insert( i ); - r = true; - } - if ( TOb.length > 0 ){ - setTimeout( function () { - localStorage.setItem( 'taffy_' + settings.storageName, - JSON.stringify( TOb ) ); - }); - } - } - root.settings( {storageName : n} ); - } - return root; - }; - - // **************************************** - // * - // * Return root on DB creation and start having fun - // **************************************** - return root; - }; - // **************************************** - // * - // * Sets the global TAFFY object - // **************************************** - TAFFY = T; - - - // **************************************** - // * - // * Create public each method - // * - // **************************************** - T.each = each; - - // **************************************** - // * - // * Create public eachin method - // * - // **************************************** - T.eachin = eachin; - // **************************************** - // * - // * Create public extend method - // * Add a custom method to the API - // * - // **************************************** - T.extend = API.extend; - - - // **************************************** - // * - // * Creates TAFFY.EXIT value that can be returned to stop an each loop - // * - // **************************************** - TAFFY.EXIT = 'TAFFYEXIT'; - - // **************************************** - // * - // * Create public utility mergeObj method - // * Return a new object where items from obj2 - // * have replaced or been added to the items in - // * obj1 - // * Purpose: Used to combine objs - // * - // **************************************** - TAFFY.mergeObj = function ( ob1, ob2 ) { - var c = {}; - eachin( ob1, function ( v, n ) { c[n] = ob1[n]; }); - eachin( ob2, function ( v, n ) { c[n] = ob2[n]; }); - return c; - }; - - - // **************************************** - // * - // * Create public utility has method - // * Returns true if a complex object, array - // * or taffy collection contains the material - // * provided in the second argument - // * Purpose: Used to comare objects - // * - // **************************************** - TAFFY.has = function ( var1, var2 ) { - - var re = true, n; - - if ( (var1.TAFFY) ){ - re = var1( var2 ); - if ( re.length > 0 ){ - return true; - } - else { - return false; - } - } - else { - - switch ( T.typeOf( var1 ) ){ - case 'object': - if ( T.isObject( var2 ) ){ - eachin( var2, function ( v, n ) { - if ( re === true && !T.isUndefined( var1[n] ) && - var1.hasOwnProperty( n ) ) - { - re = T.has( var1[n], var2[n] ); - } - else { - re = false; - return TAFFY.EXIT; - } - }); - } - else if ( T.isArray( var2 ) ){ - each( var2, function ( v, n ) { - re = T.has( var1, var2[n] ); - if ( re ){ - return TAFFY.EXIT; - } - }); - } - else if ( T.isString( var2 ) ){ - if ( !TAFFY.isUndefined( var1[var2] ) ){ - return true; - } - else { - return false; - } - } - return re; - case 'array': - if ( T.isObject( var2 ) ){ - each( var1, function ( v, i ) { - re = T.has( var1[i], var2 ); - if ( re === true ){ - return TAFFY.EXIT; - } - }); - } - else if ( T.isArray( var2 ) ){ - each( var2, function ( v2, i2 ) { - each( var1, function ( v1, i1 ) { - re = T.has( var1[i1], var2[i2] ); - if ( re === true ){ - return TAFFY.EXIT; - } - }); - if ( re === true ){ - return TAFFY.EXIT; - } - }); - } - else if ( T.isString( var2 ) || T.isNumber( var2 ) ){ - for ( n = 0; n < var1.length; n++ ){ - re = T.has( var1[n], var2 ); - if ( re ){ - return true; - } - } - } - return re; - case 'string': - if ( T.isString( var2 ) && var2 === var1 ){ - return true; - } - break; - default: - if ( T.typeOf( var1 ) === T.typeOf( var2 ) && var1 === var2 ){ - return true; - } - break; - } - } - return false; - }; - - // **************************************** - // * - // * Create public utility hasAll method - // * Returns true if a complex object, array - // * or taffy collection contains the material - // * provided in the call - for arrays it must - // * contain all the material in each array item - // * Purpose: Used to comare objects - // * - // **************************************** - TAFFY.hasAll = function ( var1, var2 ) { - - var T = TAFFY, ar; - if ( T.isArray( var2 ) ){ - ar = true; - each( var2, function ( v ) { - ar = T.has( var1, v ); - if ( ar === false ){ - return TAFFY.EXIT; - } - }); - return ar; - } - else { - return T.has( var1, var2 ); - } - }; - - - // **************************************** - // * - // * typeOf Fixed in JavaScript as public utility - // * - // **************************************** - TAFFY.typeOf = function ( v ) { - var s = typeof v; - if ( s === 'object' ){ - if ( v ){ - if ( typeof v.length === 'number' && - !(v.propertyIsEnumerable( 'length' )) ) - { - s = 'array'; - } - } - else { - s = 'null'; - } - } - return s; - }; - - // **************************************** - // * - // * Create public utility getObjectKeys method - // * Returns an array of an objects keys - // * Purpose: Used to get the keys for an object - // * - // **************************************** - TAFFY.getObjectKeys = function ( ob ) { - var kA = []; - eachin( ob, function ( n, h ) { - kA.push( h ); - }); - kA.sort(); - return kA; - }; - - // **************************************** - // * - // * Create public utility isSameArray - // * Returns an array of an objects keys - // * Purpose: Used to get the keys for an object - // * - // **************************************** - TAFFY.isSameArray = function ( ar1, ar2 ) { - return (TAFFY.isArray( ar1 ) && TAFFY.isArray( ar2 ) && - ar1.join( ',' ) === ar2.join( ',' )) ? true : false; - }; - - // **************************************** - // * - // * Create public utility isSameObject method - // * Returns true if objects contain the same - // * material or false if they do not - // * Purpose: Used to comare objects - // * - // **************************************** - TAFFY.isSameObject = function ( ob1, ob2 ) { - var T = TAFFY, rv = true; - - if ( T.isObject( ob1 ) && T.isObject( ob2 ) ){ - if ( T.isSameArray( T.getObjectKeys( ob1 ), - T.getObjectKeys( ob2 ) ) ) - { - eachin( ob1, function ( v, n ) { - if ( ! ( (T.isObject( ob1[n] ) && T.isObject( ob2[n] ) && - T.isSameObject( ob1[n], ob2[n] )) || - (T.isArray( ob1[n] ) && T.isArray( ob2[n] ) && - T.isSameArray( ob1[n], ob2[n] )) || (ob1[n] === ob2[n]) ) - ) { - rv = false; - return TAFFY.EXIT; - } - }); - } - else { - rv = false; - } - } - else { - rv = false; - } - return rv; - }; - - // **************************************** - // * - // * Create public utility is[DataType] methods - // * Return true if obj is datatype, false otherwise - // * Purpose: Used to determine if arguments are of certain data type - // * - // * mmikowski 2012-08-06 refactored to make much less "magical": - // * fewer closures and passes jslint - // * - // **************************************** - - typeList = [ - 'String', 'Number', 'Object', 'Array', - 'Boolean', 'Null', 'Function', 'Undefined' - ]; - - makeTest = function ( thisKey ) { - return function ( data ) { - return TAFFY.typeOf( data ) === thisKey.toLowerCase() ? true : false; - }; - }; - - for ( idx = 0; idx < typeList.length; idx++ ){ - typeKey = typeList[idx]; - TAFFY['is' + typeKey] = makeTest( typeKey ); - } - } -}()); - -if ( typeof(exports) === 'object' ){ - exports.taffy = TAFFY; -} - diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/teeny-request/CHANGELOG.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/teeny-request/CHANGELOG.md deleted file mode 100644 index 682b3f20..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/teeny-request/CHANGELOG.md +++ /dev/null @@ -1,235 +0,0 @@ -# Changelog - -## [8.0.2](https://github.com/googleapis/teeny-request/compare/v8.0.1...v8.0.2) (2022-09-09) - - -### Bug Fixes - -* **deps:** Update dependency uuid to v9 ([#292](https://github.com/googleapis/teeny-request/issues/292)) ([f9fa756](https://github.com/googleapis/teeny-request/commit/f9fa75647913e2be10a48635168b11520d70982f)) - -## [8.0.1](https://github.com/googleapis/teeny-request/compare/v8.0.0...v8.0.1) (2022-08-23) - - -### Bug Fixes - -* remove pip install statements ([#1546](https://github.com/googleapis/teeny-request/issues/1546)) ([#290](https://github.com/googleapis/teeny-request/issues/290)) ([94e7a86](https://github.com/googleapis/teeny-request/commit/94e7a86f13ab380399049e110c648cd381fb1e00)) - -## [8.0.0](https://github.com/googleapis/teeny-request/compare/v7.2.0...v8.0.0) (2022-05-09) - - -### ⚠ BREAKING CHANGES - -* drop node 10, update typescript to 4.6.3 (#279) - -### Build System - -* drop node 10, update typescript to 4.6.3 ([#279](https://github.com/googleapis/teeny-request/issues/279)) ([6f12739](https://github.com/googleapis/teeny-request/commit/6f1273993ae667078abae41a8029833749a25e6a)) - -## [7.2.0](https://github.com/googleapis/teeny-request/compare/v7.1.3...v7.2.0) (2022-03-31) - - -### Features - -* Add support for `NO_PROXY` ([#272](https://github.com/googleapis/teeny-request/issues/272)) ([b02b6e5](https://github.com/googleapis/teeny-request/commit/b02b6e515575814bbef7360586d07030b445705d)) - -### [7.1.3](https://www.github.com/googleapis/teeny-request/compare/v7.1.2...v7.1.3) (2021-09-24) - - -### Bug Fixes - -* **deps:** update dependency http-proxy-agent to v5 ([#253](https://www.github.com/googleapis/teeny-request/issues/253)) ([c84dff4](https://www.github.com/googleapis/teeny-request/commit/c84dff45e4a0e71fc5205838dae51f57f3139c06)) - -### [7.1.2](https://www.github.com/googleapis/teeny-request/compare/v7.1.1...v7.1.2) (2021-09-10) - - -### Bug Fixes - -* **build:** set default branch to main ([#247](https://www.github.com/googleapis/teeny-request/issues/247)) ([db3126d](https://www.github.com/googleapis/teeny-request/commit/db3126df77bc7e6cebb7d092001bbd3a444207d6)) - -### [7.1.1](https://www.github.com/googleapis/teeny-request/compare/v7.1.0...v7.1.1) (2021-06-30) - - -### Bug Fixes - -* throw error if missing uri or url ([#239](https://www.github.com/googleapis/teeny-request/issues/239)) ([4d770e3](https://www.github.com/googleapis/teeny-request/commit/4d770e3b89254c4cec30c422cdcdad257500c9cc)) - -## [7.1.0](https://www.github.com/googleapis/teeny-request/compare/v7.0.1...v7.1.0) (2021-05-19) - - -### Features - -* add `gcf-owl-bot[bot]` to `ignoreAuthors` ([#224](https://www.github.com/googleapis/teeny-request/issues/224)) ([3e7424f](https://www.github.com/googleapis/teeny-request/commit/3e7424fb63f0c0dca3606d6e1fc2f294f9d86ba5)) - - -### Bug Fixes - -* Buffer is allow as body without encoding to string ([#223](https://www.github.com/googleapis/teeny-request/issues/223)) ([d9bcdc3](https://www.github.com/googleapis/teeny-request/commit/d9bcdc36a60074fd78718ea8f7c4745d640e3b4f)) - -### [7.0.1](https://www.github.com/googleapis/teeny-request/compare/v7.0.0...v7.0.1) (2020-09-29) - - -### Bug Fixes - -* **deps:** update node-fetch to 2.6.1 ([#200](https://www.github.com/googleapis/teeny-request/issues/200)) ([8958a78](https://www.github.com/googleapis/teeny-request/commit/8958a78b117e5610f3ccf121ba1d650dbe9739f8)) - -## [7.0.0](https://www.github.com/googleapis/teeny-request/compare/v6.0.3...v7.0.0) (2020-06-01) - - -### ⚠ BREAKING CHANGES - -* dropping support for Node.js 8.x - -### Features - -* pass agent options when using agent pool config ([#149](https://www.github.com/googleapis/teeny-request/issues/149)) ([38ece79](https://www.github.com/googleapis/teeny-request/commit/38ece79151b667ec1a72ec50b1c7a58258924794)) -* warn on too many concurrent requests ([#165](https://www.github.com/googleapis/teeny-request/issues/165)) ([88ff2d0](https://www.github.com/googleapis/teeny-request/commit/88ff2d0d8e0fc25a4219ef5625b8de353ed4aa29)) - - -### Bug Fixes - -* apache license URL ([#468](https://www.github.com/googleapis/teeny-request/issues/468)) ([#156](https://www.github.com/googleapis/teeny-request/issues/156)) ([01ac7bd](https://www.github.com/googleapis/teeny-request/commit/01ac7bd01e870796fd15355e079649633d5d5983)) -* update template files for Node.js libraries ([#152](https://www.github.com/googleapis/teeny-request/issues/152)) ([89833c3](https://www.github.com/googleapis/teeny-request/commit/89833c3c3e8afea04c85a60811f122c5a6d37e48)) -* **deps:** update dependency uuid to v8 ([#164](https://www.github.com/googleapis/teeny-request/issues/164)) ([2ab8155](https://www.github.com/googleapis/teeny-request/commit/2ab81550aeb8ca914516ff4ac20ebbb7b3d73fa5)) - - -### Build System - -* drop support for node.js 8.x ([#159](https://www.github.com/googleapis/teeny-request/issues/159)) ([d87aa73](https://www.github.com/googleapis/teeny-request/commit/d87aa73d3fafbdc013b03b7629a41decda6da98a)) - -### [6.0.3](https://www.github.com/googleapis/teeny-request/compare/v6.0.2...v6.0.3) (2020-03-06) - - -### Bug Fixes - -* **deps:** update dependency uuid to v7 ([#134](https://www.github.com/googleapis/teeny-request/issues/134)) ([97817bf](https://www.github.com/googleapis/teeny-request/commit/97817bfb12396f620b2e280dcdc8965c4815abb5)) - -### [6.0.2](https://www.github.com/googleapis/teeny-request/compare/v6.0.1...v6.0.2) (2020-02-10) - - -### Bug Fixes - -* **deps:** update dependency https-proxy-agent to v5 ([#128](https://www.github.com/googleapis/teeny-request/issues/128)) ([5dcef3f](https://www.github.com/googleapis/teeny-request/commit/5dcef3f5883b24a1092def38004074d04e37e241)) - -### [6.0.1](https://www.github.com/googleapis/teeny-request/compare/v6.0.0...v6.0.1) (2020-01-24) - - -### Bug Fixes - -* **deps:** update dependency http-proxy-agent to v4 ([#121](https://www.github.com/googleapis/teeny-request/issues/121)) ([7caabcf](https://www.github.com/googleapis/teeny-request/commit/7caabcf154d8cf0848e443ce2cd4fbfae913ca41)) - -## [6.0.0](https://www.github.com/googleapis/teeny-request/compare/v5.3.3...v6.0.0) (2020-01-11) - - -### ⚠ BREAKING CHANGES - -* remove console log and throw instead (#107) - -### Bug Fixes - -* remove console log and throw instead ([#107](https://www.github.com/googleapis/teeny-request/issues/107)) ([965beaa](https://www.github.com/googleapis/teeny-request/commit/965beaae17f0273992c9856ebf79b6f1befc59fe)) - -### [5.3.3](https://www.github.com/googleapis/teeny-request/compare/v5.3.2...v5.3.3) (2019-12-15) - - -### Bug Fixes - -* **deps:** update dependency http-proxy-agent to v3 ([#104](https://www.github.com/googleapis/teeny-request/issues/104)) ([35a47d8](https://www.github.com/googleapis/teeny-request/commit/35a47d83adf92b16eab3fce52deae0e3c1353aa6)) -* **deps:** update dependency https-proxy-agent to v4 ([#105](https://www.github.com/googleapis/teeny-request/issues/105)) ([26b67af](https://www.github.com/googleapis/teeny-request/commit/26b67afcb084ce1b99a62ecc55050d6f8f8aaee4)) -* **docs:** add jsdoc-region-tag plugin ([#98](https://www.github.com/googleapis/teeny-request/issues/98)) ([8f3c35a](https://www.github.com/googleapis/teeny-request/commit/8f3c35aee711a1262ffa7c058eb1b9f18204b80e)) - -### [5.3.2](https://www.github.com/googleapis/teeny-request/compare/v5.3.1...v5.3.2) (2019-12-05) - - -### Bug Fixes - -* **deps:** pin TypeScript below 3.7.0 ([#102](https://www.github.com/googleapis/teeny-request/issues/102)) ([c0b81e6](https://www.github.com/googleapis/teeny-request/commit/c0b81e6e7c1bb7e4a3e823c2e41692bc8ede0218)) - -### [5.3.1](https://www.github.com/googleapis/teeny-request/compare/v5.3.0...v5.3.1) (2019-10-29) - - -### Bug Fixes - -* correctly set compress/gzip option when false ([#95](https://www.github.com/googleapis/teeny-request/issues/95)) ([72ef307](https://www.github.com/googleapis/teeny-request/commit/72ef307364de542af3ef8581572b1897fca2bcf4)) - -## [5.3.0](https://www.github.com/googleapis/teeny-request/compare/v5.2.1...v5.3.0) (2019-10-09) - - -### Bug Fixes - -* **deps:** update dependency https-proxy-agent to v3 ([#89](https://www.github.com/googleapis/teeny-request/issues/89)) ([dfd52cc](https://www.github.com/googleapis/teeny-request/commit/dfd52cc)) - - -### Features - -* agent pooling ([#86](https://www.github.com/googleapis/teeny-request/issues/86)) ([b182f51](https://www.github.com/googleapis/teeny-request/commit/b182f51)) - -### [5.2.1](https://www.github.com/googleapis/teeny-request/compare/v5.2.0...v5.2.1) (2019-08-14) - - -### Bug Fixes - -* **types:** make types less strict for method ([#76](https://www.github.com/googleapis/teeny-request/issues/76)) ([9f07e98](https://www.github.com/googleapis/teeny-request/commit/9f07e98)) - -## [5.2.0](https://www.github.com/googleapis/teeny-request/compare/v5.1.3...v5.2.0) (2019-08-13) - - -### Bug Fixes - -* if scheme is http:// use an HTTP agent ([#75](https://www.github.com/googleapis/teeny-request/issues/75)) ([abdf846](https://www.github.com/googleapis/teeny-request/commit/abdf846)) -* remove unused logging ([#71](https://www.github.com/googleapis/teeny-request/issues/71)) ([4cb4967](https://www.github.com/googleapis/teeny-request/commit/4cb4967)) -* undefined headers breaks compatibility with auth ([#66](https://www.github.com/googleapis/teeny-request/issues/66)) ([12901a0](https://www.github.com/googleapis/teeny-request/commit/12901a0)) - - -### Features - -* support lazy-reading from response stream ([#74](https://www.github.com/googleapis/teeny-request/issues/74)) ([f6db420](https://www.github.com/googleapis/teeny-request/commit/f6db420)) -* support reading from the request stream ([#67](https://www.github.com/googleapis/teeny-request/issues/67)) ([ae23054](https://www.github.com/googleapis/teeny-request/commit/ae23054)) - - -### Reverts - -* do not pipe fetch response into user stream ([#72](https://www.github.com/googleapis/teeny-request/issues/72)) ([6ec812e](https://www.github.com/googleapis/teeny-request/commit/6ec812e)) - -### [5.1.3](https://www.github.com/googleapis/teeny-request/compare/v5.1.2...v5.1.3) (2019-08-06) - - -### Bug Fixes - -* duplex stream does not implement methods like _read ([#64](https://www.github.com/googleapis/teeny-request/issues/64)) ([22ee26c](https://www.github.com/googleapis/teeny-request/commit/22ee26c)) - -### [5.1.2](https://www.github.com/googleapis/teeny-request/compare/v5.1.1...v5.1.2) (2019-08-06) - - -### Bug Fixes - -* **types:** expand method and header types ([#61](https://www.github.com/googleapis/teeny-request/issues/61)) ([c04d2f1](https://www.github.com/googleapis/teeny-request/commit/c04d2f1)) - -### [5.1.1](https://www.github.com/googleapis/teeny-request/compare/v5.1.0...v5.1.1) (2019-07-23) - - -### Bug Fixes - -* support lowercase proxy env vars ([#56](https://www.github.com/googleapis/teeny-request/issues/56)) ([0b3e433](https://www.github.com/googleapis/teeny-request/commit/0b3e433)) - -## [5.1.0](https://www.github.com/googleapis/teeny-request/compare/v5.0.0...v5.1.0) (2019-07-19) - - -### Features - -* support forever option ([#54](https://www.github.com/googleapis/teeny-request/issues/54)) ([746d70e](https://www.github.com/googleapis/teeny-request/commit/746d70e)) - -## [5.0.0](https://www.github.com/googleapis/teeny-request/compare/v4.0.0...v5.0.0) (2019-07-15) - - -### ⚠ BREAKING CHANGES - -* this is our first release since moving into googleapis org; in the theme of "better safe than sorry" we're releasing as 5.0.0. - -### Bug Fixes - -* export types independent of @types/request ([#44](https://www.github.com/googleapis/teeny-request/issues/44)) ([fbe2b77](https://www.github.com/googleapis/teeny-request/commit/fbe2b77)) - - -### Reverts - -* revert 4.0.0 release in favor of 5.0.0 release ([#52](https://www.github.com/googleapis/teeny-request/issues/52)) ([f24499e](https://www.github.com/googleapis/teeny-request/commit/f24499e)) diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/teeny-request/LICENSE b/packages/wyatt_notification_bloc/example/scripts/node_modules/teeny-request/LICENSE deleted file mode 100644 index d6456956..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/teeny-request/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/teeny-request/README.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/teeny-request/README.md deleted file mode 100644 index f2b72fb6..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/teeny-request/README.md +++ /dev/null @@ -1,95 +0,0 @@ -[![Build Status](https://travis-ci.org/googleapis/teeny-request.svg?branch=master)](https://travis-ci.org/googleapis/teeny-request) - -# teeny-request - -Like `request`, but much smaller - and with less options. Uses `node-fetch` under the hood. -Pop it in where you would use `request`. Improves load and parse time of modules. - -```js -const request = require('teeny-request').teenyRequest; - -request({uri: 'http://ip.jsontest.com/'}, function (error, response, body) { - console.log('error:', error); // Print the error if one occurred - console.log('statusCode:', response && response.statusCode); // Print the response status code if a response was received - console.log('body:', body); // Print the JSON. -}); -``` - -For TypeScript, you can use `@types/request`. - -```ts -import {teenyRequest as request} from 'teeny-request'; -import r as * from 'request'; // Only for type declarations - -request({uri: 'http://ip.jsontest.com/'}, (error: any, response: r.Response, body: any) => { - console.log('error:', error); // Print the error if one occurred - console.log('statusCode:', response && response.statusCode); // Print the response status code if a response was received - console.log('body:', body); // Print the JSON. -}); -``` - - - -## teenyRequest(options, callback) - -Options are limited to the following - -* uri -* method, default GET -* headers -* json -* qs -* useQuerystring -* timeout in ms -* gzip -* proxy - -```ts -request({uri:'http://service.com/upload', method:'POST', json: {key:'value'}}, function(err,httpResponse,body){ /* ... */ }) -``` - -The callback argument gets 3 arguments: - - * An error when applicable (usually from http.ClientRequest object) - * A response object with statusCode, a statusMessage, and a body - * The third is the response body (JSON object) - -## defaults(options) - -Set default options for every `teenyRequest` call. - -```ts -let defaultRequest = teenyRequest.defaults({timeout: 60000}); - defaultRequest({uri: 'http://ip.jsontest.com/'}, function (error, response, body) { - assert.ifError(error); - assert.strictEqual(response.statusCode, 200); - console.log(body.ip); - assert.notEqual(body.ip, null); - - done(); - }); -``` - -## Proxy environment variables -If environment variables `HTTP_PROXY`, `HTTPS_PROXY`, or `NO_PROXY` are set, they are respected. - -## Building with Webpack 4+ -Since 4.0.0, Webpack uses `javascript/esm` for `.mjs` files which handles ESM more strictly compared to `javascript/auto`. If you get the error `Can't import the named export 'PassThrough' from non EcmaScript module`, please add the following to your Webpack config: - -```js -{ - test: /\.mjs$/, - type: 'javascript/auto', -}, -``` - -## Motivation -`request` has a ton of options and features and is accordingly large. Requiring a module incurs load and parse time. For -`request`, that is around 600ms. - -![Load time of request measured with require-so-slow](https://user-images.githubusercontent.com/101553/44694187-20357700-aa3a-11e8-9116-b8ae794cbc27.png) - -`teeny-request` doesn't have any of the bells and whistles that `request` has, but is so much faster to load. If startup time is an issue and you don't need much beyond a basic GET and POST, you can use `teeny-request`. - -## Thanks -Special thanks to [billyjacobson](https://github.com/billyjacobson) for suggesting the name. Please report all bugs to them. Just kidding. Please open issues. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/teeny-request/package.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/teeny-request/package.json deleted file mode 100644 index b9605c3a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/teeny-request/package.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "name": "teeny-request", - "version": "8.0.2", - "description": "Like request, but smaller.", - "main": "./build/src/index.js", - "types": "./build/src/index.d.ts", - "engines": { - "node": ">=12" - }, - "scripts": { - "test": "c8 mocha build/test", - "compile": "tsc -p .", - "pretest": "npm run compile", - "lint": "gts check", - "clean": "gts clean", - "fix": "gts fix", - "prepare": "npm run compile", - "docs": "compodoc src/", - "predocs-test": "npm run docs", - "docs-test": "linkinator docs", - "samples-test": "echo no sample tests!", - "system-test": "echo no system tests!", - "precompile": "gts clean" - }, - "files": [ - "build/src" - ], - "repository": "googleapis/teeny-request", - "keywords": [ - "request", - "node-fetch", - "fetch" - ], - "author": "fhinkel", - "license": "Apache-2.0", - "bugs": { - "url": "https://github.com/googleapis/teeny-request/issues" - }, - "homepage": "https://github.com/googleapis/teeny-request#readme", - "dependencies": { - "http-proxy-agent": "^5.0.0", - "https-proxy-agent": "^5.0.0", - "node-fetch": "^2.6.1", - "stream-events": "^1.0.5", - "uuid": "^9.0.0" - }, - "devDependencies": { - "@compodoc/compodoc": "^1.1.9", - "@types/mocha": "^9.1.1", - "@types/node-fetch": "^2.5.7", - "@types/sinon": "^10.0.0", - "@types/uuid": "^8.0.0", - "c8": "^7.0.0", - "codecov": "^3.1.0", - "gts": "^3.1.0", - "linkinator": "^4.0.0", - "mocha": "^10.0.0", - "nock": "^13.0.0", - "typescript": "^4.6.3", - "sinon": "^14.0.0" - }, - "nyc": { - "exclude": [ - "build/test" - ] - } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/text-decoding/CHANGELOG.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/text-decoding/CHANGELOG.md deleted file mode 100644 index fede3336..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/text-decoding/CHANGELOG.md +++ /dev/null @@ -1,10 +0,0 @@ -## 2 July 2019 - -### [1.0.0](https://github.com/idiocc/text-decoding/compare/v0.0.0-pre...v1.0.0) - -- [package] Publish `v1` of the package. - -### 0.0.0-pre - -- Create `text-decoding` with _[`My New Package`](https://mnpjs.org)_ -- [repository]: `src`, [`test`](https://contexttesting.com), [`documentary`](https://readme.page) & [`types`](https://typedef.page). \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/text-decoding/LICENSE b/packages/wyatt_notification_bloc/example/scripts/node_modules/text-decoding/LICENSE deleted file mode 100644 index 833d3776..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/text-decoding/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -MIT License - -Copyright (c) 2019 Art Deco Code Limited - - + ES6 code with ECMA modules - + Zoroaster spec and mask tests - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - -Original Work by Joshua Bell and contributors -Dual License: Unlicense/Apache 2.0 License \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/text-decoding/README.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/text-decoding/README.md deleted file mode 100644 index e62073b4..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/text-decoding/README.md +++ /dev/null @@ -1,179 +0,0 @@ -# text-decoding - -[![npm version](https://badge.fury.io/js/text-decoding.svg)](https://npmjs.org/package/text-decoding) - -`text-decoding` is a fork of [Polyfill for the Encoding Living Standard's API](https://github.com/inexorabletash/text-encoding) (`text-encoding`) For Node.JS. - -This is a polyfill for the [Encoding Living Standard](https://encoding.spec.whatwg.org/) API for the Web, allowing encoding and decoding of textual data to and from Typed Array buffers for binary data in JavaScript. - -By default it adheres to the spec and does not support encoding to legacy encodings, only decoding. It is also implemented to match the specification's algorithms, rather than for performance. - -```sh -yarn add text-decoding -``` - -## Table Of Contents - -- [Table Of Contents](#table-of-contents) -- [API](#api) -- [`class TextDecoder`](#class-textdecoder) -- [`class TextEncoder`](#class-textencoder) -- [`const EncodingIndexes`](#const-encodingindexes) -- [`getEncoding(label: string): { name: string, labels: Array }`](#getencodinglabel-string--name-string-labels-arraystring-) -- [Encodings](#encodings) -- [Copyright](#copyright) - -

    - -## API - -The package is available by importing its named classes and functions: - -```js -import { TextEncoder, TextDecoder, EncodingIndexes, getEncoding } from 'text-decoding' -``` - -

    - -## `class TextDecoder` - -Decodes a Uint8Array into a string. - - - - - -
    SourceOutput
    - -```js -import { TextDecoder } from 'text-decoding' - -const decoded = new TextDecoder('utf-8') - .decode(new Uint8Array([ - 0x7A, 0xC2, 0xA2, 0xE6, 0xB0, 0xB4, 0xF0, - 0x9D, 0x84, 0x9E, 0xF4, 0x8F, 0xBF, 0xBD, - ])) -console.log(decoded) -``` - - -``` -z¢水𝄞􏿽 -``` -
    - -

    - -## `class TextEncoder` - -Encodes a string into `Uint8Array` for the given encoding. - -As required by the specification, only encoding to utf-8 is supported. If you want to try it out, you can force a non-standard behavior by passing the `NONSTANDARD_allowLegacyEncoding` option to _TextEncoder_ and a label. For example: - -```js -import { TextEncoder } from 'text-decoding' - -const uint8array = new TextEncoder( - 'windows-1252', { NONSTANDARD_allowLegacyEncoding: true }) - .encode('hello world') - -console.log(uint8array) -``` -```js -Uint8Array [ 104, 101, 108, 108, 111, 32, 119, 111, 114, 108, 100 ] -``` - -

    - -## `const EncodingIndexes` - -This is [a map of indexes](src/encoding-indexes.js) used for encoding. - -

    - -## `getEncoding(`
      `label: string,`
    `): { name: string, labels: Array }` - -Returns the normalised name of the encoding and its associated labels. - - - - - -
    SourceOutput
    - -```js -import { getEncoding } from 'text-decoding' - -const encoding = getEncoding('ascii') -console.log(encoding) -``` - - -```js -{ labels: - [ 'ansi_x3.4-1968', - 'ascii', - 'cp1252', - 'cp819', - 'csisolatin1', - 'ibm819', - 'iso-8859-1', - 'iso-ir-100', - 'iso8859-1', - 'iso88591', - 'iso_8859-1', - 'iso_8859-1:1987', - 'l1', - 'latin1', - 'us-ascii', - 'windows-1252', - 'x-cp1252' ], - name: 'windows-1252' } -``` -
    - -

    - - -## Encodings - -All encodings from the Encoding specification are supported: - -utf-8 ibm866 iso-8859-2 iso-8859-3 iso-8859-4 iso-8859-5 iso-8859-6 iso-8859-7 iso-8859-8 iso-8859-8-i iso-8859-10 iso-8859-13 iso-8859-14 iso-8859-15 iso-8859-16 koi8-r koi8-u macintosh windows-874 windows-1250 windows-1251 windows-1252 windows-1253 windows-1254 windows-1255 windows-1256 windows-1257 windows-1258 x-mac-cyrillic gb18030 hz-gb-2312 big5 euc-jp iso-2022-jp shift_jis euc-kr replacement utf-16be utf-16le x-user-defined - -(Some encodings may be supported under other names, e.g. ascii, iso-8859-1, etc. See [Encoding](https://encoding.spec.whatwg.org/) for additional labels for each encoding.) - -

    - -## Copyright - -Original Work By [Joshua Bell](https://github.com/inexorabletash/text-encoding) under dual Unlicense/Apache-2.0 license. - -> The encoding indexes, algorithms, and many comments in the code derive from the Encoding Standard https://encoding.spec.whatwg.org/ - ---- - - - - - - - - - -
    - - Art Deco - - © Art Deco for Idio 2019 - - Idio - - - - Tech Nation Visa - - Tech Nation Visa Sucks
    - -

    \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/text-decoding/package.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/text-decoding/package.json deleted file mode 100644 index 02ec55fd..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/text-decoding/package.json +++ /dev/null @@ -1,66 +0,0 @@ -{ - "name": "text-decoding", - "version": "1.0.0", - "description": "[fork] TextEncoder and TextDecoder (Polyfill for the Encoding Living Standard's API) For Node.JS.", - "main": "build/index.js", - "module": "src/index.js", - "scripts": { - "t": "zoroaster -a", - "test": "yarn t test/spec test/mask", - "spec": "yarn t test/spec", - "mask": "yarn t test/mask", - "test-build": "ALAMODE_ENV=test-build yarn test", - "lint": "eslint .", - "doc": "NODE_DEBUG=doc doc -o README.md", - "b": "alamode src -o build -s", - "d": "yarn-s d1 externs", - "d1": "typal types/index.js src -c -t types/index.xml", - "externs": "typal types/externs.js", - "build": "yarn-s d b doc", - "e": "alanode" - }, - "files": [ - "build", - "src", - "types/externs.js" - ], - "externs": "types/externs.js", - "repository": { - "type": "git", - "url": "git://github.com/idiocc/text-decoding.git" - }, - "keywords": [ - "text-encoding", - "encoding", - "text-decoding", - "TextEncoder", - "TextDecoder", - "decoding", - "ascii", - "windows-1252", - "big5", - "euc-jp", - "euc-kr", - "gb18030", - "iso-20220jp", - "shift-jis", - "single-byte", - "utf8", - "utf16", - "x-user-defined", - "unicode" - ], - "author": "Anton ", - "license": "MIT", - "bugs": { - "url": "https://github.com/idiocc/text-decoding/issues" - }, - "homepage": "https://github.com/idiocc/text-decoding#readme", - "devDependencies": { - "alamode": "^2.3.4", - "documentary": "^1.27.4", - "eslint-config-artdeco": "1.0.1", - "yarn-s": "1.1.0", - "zoroaster": "^4.1.1-alpha" - } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/text-decoding/src/encoding-indexes.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/text-decoding/src/encoding-indexes.js deleted file mode 100644 index 9a246fc1..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/text-decoding/src/encoding-indexes.js +++ /dev/null @@ -1,37 +0,0 @@ -const Indexes = { - 'big5': [null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,17392,19506,17923,17830,17784,160359,19831,17843,162993,19682,163013,15253,18230,18244,19527,19520,148159,144919,160594,159371,159954,19543,172881,18255,17882,19589,162924,19719,19108,18081,158499,29221,154196,137827,146950,147297,26189,22267,null,32149,22813,166841,15860,38708,162799,23515,138590,23204,13861,171696,23249,23479,23804,26478,34195,170309,29793,29853,14453,138579,145054,155681,16108,153822,15093,31484,40855,147809,166157,143850,133770,143966,17162,33924,40854,37935,18736,34323,22678,38730,37400,31184,31282,26208,27177,34973,29772,31685,26498,31276,21071,36934,13542,29636,155065,29894,40903,22451,18735,21580,16689,145038,22552,31346,162661,35727,18094,159368,16769,155033,31662,140476,40904,140481,140489,140492,40905,34052,144827,16564,40906,17633,175615,25281,28782,40907,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,12736,12737,12738,12739,12740,131340,12741,131281,131277,12742,12743,131275,139240,12744,131274,12745,12746,12747,12748,131342,12749,12750,256,193,461,192,274,201,282,200,332,211,465,210,null,7870,null,7872,202,257,225,462,224,593,275,233,283,232,299,237,464,236,333,243,466,242,363,250,468,249,470,472,474,476,252,null,7871,null,7873,234,609,9178,9179,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,172969,135493,null,25866,null,null,20029,28381,40270,37343,null,null,161589,25745,20250,20264,20392,20822,20852,20892,20964,21153,21160,21307,21326,21457,21464,22242,22768,22788,22791,22834,22836,23398,23454,23455,23706,24198,24635,25993,26622,26628,26725,27982,28860,30005,32420,32428,32442,32455,32463,32479,32518,32567,33402,33487,33647,35270,35774,35810,36710,36711,36718,29713,31996,32205,26950,31433,21031,null,null,null,null,37260,30904,37214,32956,null,36107,33014,133607,null,null,32927,40647,19661,40393,40460,19518,171510,159758,40458,172339,13761,null,28314,33342,29977,null,18705,39532,39567,40857,31111,164972,138698,132560,142054,20004,20097,20096,20103,20159,20203,20279,13388,20413,15944,20483,20616,13437,13459,13477,20870,22789,20955,20988,20997,20105,21113,21136,21287,13767,21417,13649,21424,13651,21442,21539,13677,13682,13953,21651,21667,21684,21689,21712,21743,21784,21795,21800,13720,21823,13733,13759,21975,13765,163204,21797,null,134210,134421,151851,21904,142534,14828,131905,36422,150968,169189,16467,164030,30586,142392,14900,18389,164189,158194,151018,25821,134524,135092,134357,135412,25741,36478,134806,134155,135012,142505,164438,148691,null,134470,170573,164073,18420,151207,142530,39602,14951,169460,16365,13574,152263,169940,161992,142660,40302,38933,null,17369,155813,25780,21731,142668,142282,135287,14843,135279,157402,157462,162208,25834,151634,134211,36456,139681,166732,132913,null,18443,131497,16378,22643,142733,null,148936,132348,155799,134988,134550,21881,16571,17338,null,19124,141926,135325,33194,39157,134556,25465,14846,141173,36288,22177,25724,15939,null,173569,134665,142031,142537,null,135368,145858,14738,14854,164507,13688,155209,139463,22098,134961,142514,169760,13500,27709,151099,null,null,161140,142987,139784,173659,167117,134778,134196,157724,32659,135375,141315,141625,13819,152035,134796,135053,134826,16275,134960,134471,135503,134732,null,134827,134057,134472,135360,135485,16377,140950,25650,135085,144372,161337,142286,134526,134527,142417,142421,14872,134808,135367,134958,173618,158544,167122,167321,167114,38314,21708,33476,21945,null,171715,39974,39606,161630,142830,28992,33133,33004,23580,157042,33076,14231,21343,164029,37302,134906,134671,134775,134907,13789,151019,13833,134358,22191,141237,135369,134672,134776,135288,135496,164359,136277,134777,151120,142756,23124,135197,135198,135413,135414,22428,134673,161428,164557,135093,134779,151934,14083,135094,135552,152280,172733,149978,137274,147831,164476,22681,21096,13850,153405,31666,23400,18432,19244,40743,18919,39967,39821,154484,143677,22011,13810,22153,20008,22786,138177,194680,38737,131206,20059,20155,13630,23587,24401,24516,14586,25164,25909,27514,27701,27706,28780,29227,20012,29357,149737,32594,31035,31993,32595,156266,13505,null,156491,32770,32896,157202,158033,21341,34916,35265,161970,35744,36125,38021,38264,38271,38376,167439,38886,39029,39118,39134,39267,170000,40060,40479,40644,27503,63751,20023,131207,38429,25143,38050,null,20539,28158,171123,40870,15817,34959,147790,28791,23797,19232,152013,13657,154928,24866,166450,36775,37366,29073,26393,29626,144001,172295,15499,137600,19216,30948,29698,20910,165647,16393,27235,172730,16931,34319,133743,31274,170311,166634,38741,28749,21284,139390,37876,30425,166371,40871,30685,20131,20464,20668,20015,20247,40872,21556,32139,22674,22736,138678,24210,24217,24514,141074,25995,144377,26905,27203,146531,27903,null,29184,148741,29580,16091,150035,23317,29881,35715,154788,153237,31379,31724,31939,32364,33528,34199,40873,34960,40874,36537,40875,36815,34143,39392,37409,40876,167353,136255,16497,17058,23066,null,null,null,39016,26475,17014,22333,null,34262,149883,33471,160013,19585,159092,23931,158485,159678,40877,40878,23446,40879,26343,32347,28247,31178,15752,17603,143958,141206,17306,17718,null,23765,146202,35577,23672,15634,144721,23928,40882,29015,17752,147692,138787,19575,14712,13386,131492,158785,35532,20404,131641,22975,33132,38998,170234,24379,134047,null,139713,166253,16642,18107,168057,16135,40883,172469,16632,14294,18167,158790,16764,165554,160767,17773,14548,152730,17761,17691,19849,19579,19830,17898,16328,150287,13921,17630,17597,16877,23870,23880,23894,15868,14351,23972,23993,14368,14392,24130,24253,24357,24451,14600,14612,14655,14669,24791,24893,23781,14729,25015,25017,25039,14776,25132,25232,25317,25368,14840,22193,14851,25570,25595,25607,25690,14923,25792,23829,22049,40863,14999,25990,15037,26111,26195,15090,26258,15138,26390,15170,26532,26624,15192,26698,26756,15218,15217,15227,26889,26947,29276,26980,27039,27013,15292,27094,15325,27237,27252,27249,27266,15340,27289,15346,27307,27317,27348,27382,27521,27585,27626,27765,27818,15563,27906,27910,27942,28033,15599,28068,28081,28181,28184,28201,28294,166336,28347,28386,28378,40831,28392,28393,28452,28468,15686,147265,28545,28606,15722,15733,29111,23705,15754,28716,15761,28752,28756,28783,28799,28809,131877,17345,13809,134872,147159,22462,159443,28990,153568,13902,27042,166889,23412,31305,153825,169177,31333,31357,154028,31419,31408,31426,31427,29137,156813,16842,31450,31453,31466,16879,21682,154625,31499,31573,31529,152334,154878,31650,31599,33692,154548,158847,31696,33825,31634,31672,154912,15789,154725,33938,31738,31750,31797,154817,31812,31875,149634,31910,26237,148856,31945,31943,31974,31860,31987,31989,31950,32359,17693,159300,32093,159446,29837,32137,32171,28981,32179,32210,147543,155689,32228,15635,32245,137209,32229,164717,32285,155937,155994,32366,32402,17195,37996,32295,32576,32577,32583,31030,156368,39393,32663,156497,32675,136801,131176,17756,145254,17667,164666,32762,156809,32773,32776,32797,32808,32815,172167,158915,32827,32828,32865,141076,18825,157222,146915,157416,26405,32935,166472,33031,33050,22704,141046,27775,156824,151480,25831,136330,33304,137310,27219,150117,150165,17530,33321,133901,158290,146814,20473,136445,34018,33634,158474,149927,144688,137075,146936,33450,26907,194964,16859,34123,33488,33562,134678,137140,14017,143741,144730,33403,33506,33560,147083,159139,158469,158615,144846,15807,33565,21996,33669,17675,159141,33708,33729,33747,13438,159444,27223,34138,13462,159298,143087,33880,154596,33905,15827,17636,27303,33866,146613,31064,33960,158614,159351,159299,34014,33807,33681,17568,33939,34020,154769,16960,154816,17731,34100,23282,159385,17703,34163,17686,26559,34326,165413,165435,34241,159880,34306,136578,159949,194994,17770,34344,13896,137378,21495,160666,34430,34673,172280,34798,142375,34737,34778,34831,22113,34412,26710,17935,34885,34886,161248,146873,161252,34910,34972,18011,34996,34997,25537,35013,30583,161551,35207,35210,35238,35241,35239,35260,166437,35303,162084,162493,35484,30611,37374,35472,162393,31465,162618,147343,18195,162616,29052,35596,35615,152624,152933,35647,35660,35661,35497,150138,35728,35739,35503,136927,17941,34895,35995,163156,163215,195028,14117,163155,36054,163224,163261,36114,36099,137488,36059,28764,36113,150729,16080,36215,36265,163842,135188,149898,15228,164284,160012,31463,36525,36534,36547,37588,36633,36653,164709,164882,36773,37635,172703,133712,36787,18730,166366,165181,146875,24312,143970,36857,172052,165564,165121,140069,14720,159447,36919,165180,162494,36961,165228,165387,37032,165651,37060,165606,37038,37117,37223,15088,37289,37316,31916,166195,138889,37390,27807,37441,37474,153017,37561,166598,146587,166668,153051,134449,37676,37739,166625,166891,28815,23235,166626,166629,18789,37444,166892,166969,166911,37747,37979,36540,38277,38310,37926,38304,28662,17081,140922,165592,135804,146990,18911,27676,38523,38550,16748,38563,159445,25050,38582,30965,166624,38589,21452,18849,158904,131700,156688,168111,168165,150225,137493,144138,38705,34370,38710,18959,17725,17797,150249,28789,23361,38683,38748,168405,38743,23370,168427,38751,37925,20688,143543,143548,38793,38815,38833,38846,38848,38866,38880,152684,38894,29724,169011,38911,38901,168989,162170,19153,38964,38963,38987,39014,15118,160117,15697,132656,147804,153350,39114,39095,39112,39111,19199,159015,136915,21936,39137,39142,39148,37752,39225,150057,19314,170071,170245,39413,39436,39483,39440,39512,153381,14020,168113,170965,39648,39650,170757,39668,19470,39700,39725,165376,20532,39732,158120,14531,143485,39760,39744,171326,23109,137315,39822,148043,39938,39935,39948,171624,40404,171959,172434,172459,172257,172323,172511,40318,40323,172340,40462,26760,40388,139611,172435,172576,137531,172595,40249,172217,172724,40592,40597,40606,40610,19764,40618,40623,148324,40641,15200,14821,15645,20274,14270,166955,40706,40712,19350,37924,159138,40727,40726,40761,22175,22154,40773,39352,168075,38898,33919,40802,40809,31452,40846,29206,19390,149877,149947,29047,150008,148296,150097,29598,166874,137466,31135,166270,167478,37737,37875,166468,37612,37761,37835,166252,148665,29207,16107,30578,31299,28880,148595,148472,29054,137199,28835,137406,144793,16071,137349,152623,137208,14114,136955,137273,14049,137076,137425,155467,14115,136896,22363,150053,136190,135848,136134,136374,34051,145062,34051,33877,149908,160101,146993,152924,147195,159826,17652,145134,170397,159526,26617,14131,15381,15847,22636,137506,26640,16471,145215,147681,147595,147727,158753,21707,22174,157361,22162,135135,134056,134669,37830,166675,37788,20216,20779,14361,148534,20156,132197,131967,20299,20362,153169,23144,131499,132043,14745,131850,132116,13365,20265,131776,167603,131701,35546,131596,20120,20685,20749,20386,20227,150030,147082,20290,20526,20588,20609,20428,20453,20568,20732,20825,20827,20829,20830,28278,144789,147001,147135,28018,137348,147081,20904,20931,132576,17629,132259,132242,132241,36218,166556,132878,21081,21156,133235,21217,37742,18042,29068,148364,134176,149932,135396,27089,134685,29817,16094,29849,29716,29782,29592,19342,150204,147597,21456,13700,29199,147657,21940,131909,21709,134086,22301,37469,38644,37734,22493,22413,22399,13886,22731,23193,166470,136954,137071,136976,23084,22968,37519,23166,23247,23058,153926,137715,137313,148117,14069,27909,29763,23073,155267,23169,166871,132115,37856,29836,135939,28933,18802,37896,166395,37821,14240,23582,23710,24158,24136,137622,137596,146158,24269,23375,137475,137476,14081,137376,14045,136958,14035,33066,166471,138682,144498,166312,24332,24334,137511,137131,23147,137019,23364,34324,161277,34912,24702,141408,140843,24539,16056,140719,140734,168072,159603,25024,131134,131142,140827,24985,24984,24693,142491,142599,149204,168269,25713,149093,142186,14889,142114,144464,170218,142968,25399,173147,25782,25393,25553,149987,142695,25252,142497,25659,25963,26994,15348,143502,144045,149897,144043,21773,144096,137433,169023,26318,144009,143795,15072,16784,152964,166690,152975,136956,152923,152613,30958,143619,137258,143924,13412,143887,143746,148169,26254,159012,26219,19347,26160,161904,138731,26211,144082,144097,26142,153714,14545,145466,145340,15257,145314,144382,29904,15254,26511,149034,26806,26654,15300,27326,14435,145365,148615,27187,27218,27337,27397,137490,25873,26776,27212,15319,27258,27479,147392,146586,37792,37618,166890,166603,37513,163870,166364,37991,28069,28427,149996,28007,147327,15759,28164,147516,23101,28170,22599,27940,30786,28987,148250,148086,28913,29264,29319,29332,149391,149285,20857,150180,132587,29818,147192,144991,150090,149783,155617,16134,16049,150239,166947,147253,24743,16115,29900,29756,37767,29751,17567,159210,17745,30083,16227,150745,150790,16216,30037,30323,173510,15129,29800,166604,149931,149902,15099,15821,150094,16127,149957,149747,37370,22322,37698,166627,137316,20703,152097,152039,30584,143922,30478,30479,30587,149143,145281,14942,149744,29752,29851,16063,150202,150215,16584,150166,156078,37639,152961,30750,30861,30856,30930,29648,31065,161601,153315,16654,31131,33942,31141,27181,147194,31290,31220,16750,136934,16690,37429,31217,134476,149900,131737,146874,137070,13719,21867,13680,13994,131540,134157,31458,23129,141045,154287,154268,23053,131675,30960,23082,154566,31486,16889,31837,31853,16913,154547,155324,155302,31949,150009,137136,31886,31868,31918,27314,32220,32263,32211,32590,156257,155996,162632,32151,155266,17002,158581,133398,26582,131150,144847,22468,156690,156664,149858,32733,31527,133164,154345,154947,31500,155150,39398,34373,39523,27164,144447,14818,150007,157101,39455,157088,33920,160039,158929,17642,33079,17410,32966,33033,33090,157620,39107,158274,33378,33381,158289,33875,159143,34320,160283,23174,16767,137280,23339,137377,23268,137432,34464,195004,146831,34861,160802,23042,34926,20293,34951,35007,35046,35173,35149,153219,35156,161669,161668,166901,166873,166812,166393,16045,33955,18165,18127,14322,35389,35356,169032,24397,37419,148100,26068,28969,28868,137285,40301,35999,36073,163292,22938,30659,23024,17262,14036,36394,36519,150537,36656,36682,17140,27736,28603,140065,18587,28537,28299,137178,39913,14005,149807,37051,37015,21873,18694,37307,37892,166475,16482,166652,37927,166941,166971,34021,35371,38297,38311,38295,38294,167220,29765,16066,149759,150082,148458,16103,143909,38543,167655,167526,167525,16076,149997,150136,147438,29714,29803,16124,38721,168112,26695,18973,168083,153567,38749,37736,166281,166950,166703,156606,37562,23313,35689,18748,29689,147995,38811,38769,39224,134950,24001,166853,150194,38943,169178,37622,169431,37349,17600,166736,150119,166756,39132,166469,16128,37418,18725,33812,39227,39245,162566,15869,39323,19311,39338,39516,166757,153800,27279,39457,23294,39471,170225,19344,170312,39356,19389,19351,37757,22642,135938,22562,149944,136424,30788,141087,146872,26821,15741,37976,14631,24912,141185,141675,24839,40015,40019,40059,39989,39952,39807,39887,171565,39839,172533,172286,40225,19630,147716,40472,19632,40204,172468,172269,172275,170287,40357,33981,159250,159711,158594,34300,17715,159140,159364,159216,33824,34286,159232,145367,155748,31202,144796,144960,18733,149982,15714,37851,37566,37704,131775,30905,37495,37965,20452,13376,36964,152925,30781,30804,30902,30795,137047,143817,149825,13978,20338,28634,28633,28702,28702,21524,147893,22459,22771,22410,40214,22487,28980,13487,147884,29163,158784,151447,23336,137141,166473,24844,23246,23051,17084,148616,14124,19323,166396,37819,37816,137430,134941,33906,158912,136211,148218,142374,148417,22932,146871,157505,32168,155995,155812,149945,149899,166394,37605,29666,16105,29876,166755,137375,16097,150195,27352,29683,29691,16086,150078,150164,137177,150118,132007,136228,149989,29768,149782,28837,149878,37508,29670,37727,132350,37681,166606,166422,37766,166887,153045,18741,166530,29035,149827,134399,22180,132634,134123,134328,21762,31172,137210,32254,136898,150096,137298,17710,37889,14090,166592,149933,22960,137407,137347,160900,23201,14050,146779,14000,37471,23161,166529,137314,37748,15565,133812,19094,14730,20724,15721,15692,136092,29045,17147,164376,28175,168164,17643,27991,163407,28775,27823,15574,147437,146989,28162,28428,15727,132085,30033,14012,13512,18048,16090,18545,22980,37486,18750,36673,166940,158656,22546,22472,14038,136274,28926,148322,150129,143331,135856,140221,26809,26983,136088,144613,162804,145119,166531,145366,144378,150687,27162,145069,158903,33854,17631,17614,159014,159057,158850,159710,28439,160009,33597,137018,33773,158848,159827,137179,22921,23170,137139,23137,23153,137477,147964,14125,23023,137020,14023,29070,37776,26266,148133,23150,23083,148115,27179,147193,161590,148571,148170,28957,148057,166369,20400,159016,23746,148686,163405,148413,27148,148054,135940,28838,28979,148457,15781,27871,194597,150095,32357,23019,23855,15859,24412,150109,137183,32164,33830,21637,146170,144128,131604,22398,133333,132633,16357,139166,172726,28675,168283,23920,29583,31955,166489,168992,20424,32743,29389,29456,162548,29496,29497,153334,29505,29512,16041,162584,36972,29173,149746,29665,33270,16074,30476,16081,27810,22269,29721,29726,29727,16098,16112,16116,16122,29907,16142,16211,30018,30061,30066,30093,16252,30152,30172,16320,30285,16343,30324,16348,30330,151388,29064,22051,35200,22633,16413,30531,16441,26465,16453,13787,30616,16490,16495,23646,30654,30667,22770,30744,28857,30748,16552,30777,30791,30801,30822,33864,152885,31027,26627,31026,16643,16649,31121,31129,36795,31238,36796,16743,31377,16818,31420,33401,16836,31439,31451,16847,20001,31586,31596,31611,31762,31771,16992,17018,31867,31900,17036,31928,17044,31981,36755,28864,134351,32207,32212,32208,32253,32686,32692,29343,17303,32800,32805,31545,32814,32817,32852,15820,22452,28832,32951,33001,17389,33036,29482,33038,33042,30048,33044,17409,15161,33110,33113,33114,17427,22586,33148,33156,17445,33171,17453,33189,22511,33217,33252,33364,17551,33446,33398,33482,33496,33535,17584,33623,38505,27018,33797,28917,33892,24803,33928,17668,33982,34017,34040,34064,34104,34130,17723,34159,34160,34272,17783,34418,34450,34482,34543,38469,34699,17926,17943,34990,35071,35108,35143,35217,162151,35369,35384,35476,35508,35921,36052,36082,36124,18328,22623,36291,18413,20206,36410,21976,22356,36465,22005,36528,18487,36558,36578,36580,36589,36594,36791,36801,36810,36812,36915,39364,18605,39136,37395,18718,37416,37464,37483,37553,37550,37567,37603,37611,37619,37620,37629,37699,37764,37805,18757,18769,40639,37911,21249,37917,37933,37950,18794,37972,38009,38189,38306,18855,38388,38451,18917,26528,18980,38720,18997,38834,38850,22100,19172,24808,39097,19225,39153,22596,39182,39193,20916,39196,39223,39234,39261,39266,19312,39365,19357,39484,39695,31363,39785,39809,39901,39921,39924,19565,39968,14191,138178,40265,39994,40702,22096,40339,40381,40384,40444,38134,36790,40571,40620,40625,40637,40646,38108,40674,40689,40696,31432,40772,131220,131767,132000,26906,38083,22956,132311,22592,38081,14265,132565,132629,132726,136890,22359,29043,133826,133837,134079,21610,194619,134091,21662,134139,134203,134227,134245,134268,24807,134285,22138,134325,134365,134381,134511,134578,134600,26965,39983,34725,134660,134670,134871,135056,134957,134771,23584,135100,24075,135260,135247,135286,26398,135291,135304,135318,13895,135359,135379,135471,135483,21348,33965,135907,136053,135990,35713,136567,136729,137155,137159,20088,28859,137261,137578,137773,137797,138282,138352,138412,138952,25283,138965,139029,29080,26709,139333,27113,14024,139900,140247,140282,141098,141425,141647,33533,141671,141715,142037,35237,142056,36768,142094,38840,142143,38983,39613,142412,null,142472,142519,154600,142600,142610,142775,142741,142914,143220,143308,143411,143462,144159,144350,24497,26184,26303,162425,144743,144883,29185,149946,30679,144922,145174,32391,131910,22709,26382,26904,146087,161367,155618,146961,147129,161278,139418,18640,19128,147737,166554,148206,148237,147515,148276,148374,150085,132554,20946,132625,22943,138920,15294,146687,148484,148694,22408,149108,14747,149295,165352,170441,14178,139715,35678,166734,39382,149522,149755,150037,29193,150208,134264,22885,151205,151430,132985,36570,151596,21135,22335,29041,152217,152601,147274,150183,21948,152646,152686,158546,37332,13427,152895,161330,152926,18200,152930,152934,153543,149823,153693,20582,13563,144332,24798,153859,18300,166216,154286,154505,154630,138640,22433,29009,28598,155906,162834,36950,156082,151450,35682,156674,156746,23899,158711,36662,156804,137500,35562,150006,156808,147439,156946,19392,157119,157365,141083,37989,153569,24981,23079,194765,20411,22201,148769,157436,20074,149812,38486,28047,158909,13848,35191,157593,157806,156689,157790,29151,157895,31554,168128,133649,157990,37124,158009,31301,40432,158202,39462,158253,13919,156777,131105,31107,158260,158555,23852,144665,33743,158621,18128,158884,30011,34917,159150,22710,14108,140685,159819,160205,15444,160384,160389,37505,139642,160395,37680,160486,149968,27705,38047,160848,134904,34855,35061,141606,164979,137137,28344,150058,137248,14756,14009,23568,31203,17727,26294,171181,170148,35139,161740,161880,22230,16607,136714,14753,145199,164072,136133,29101,33638,162269,168360,23143,19639,159919,166315,162301,162314,162571,163174,147834,31555,31102,163849,28597,172767,27139,164632,21410,159239,37823,26678,38749,164207,163875,158133,136173,143919,163912,23941,166960,163971,22293,38947,166217,23979,149896,26046,27093,21458,150181,147329,15377,26422,163984,164084,164142,139169,164175,164233,164271,164378,164614,164655,164746,13770,164968,165546,18682,25574,166230,30728,37461,166328,17394,166375,17375,166376,166726,166868,23032,166921,36619,167877,168172,31569,168208,168252,15863,168286,150218,36816,29327,22155,169191,169449,169392,169400,169778,170193,170313,170346,170435,170536,170766,171354,171419,32415,171768,171811,19620,38215,172691,29090,172799,19857,36882,173515,19868,134300,36798,21953,36794,140464,36793,150163,17673,32383,28502,27313,20202,13540,166700,161949,14138,36480,137205,163876,166764,166809,162366,157359,15851,161365,146615,153141,153942,20122,155265,156248,22207,134765,36366,23405,147080,150686,25566,25296,137206,137339,25904,22061,154698,21530,152337,15814,171416,19581,22050,22046,32585,155352,22901,146752,34672,19996,135146,134473,145082,33047,40286,36120,30267,40005,30286,30649,37701,21554,33096,33527,22053,33074,33816,32957,21994,31074,22083,21526,134813,13774,22021,22001,26353,164578,13869,30004,22000,21946,21655,21874,134209,134294,24272,151880,134774,142434,134818,40619,32090,21982,135285,25245,38765,21652,36045,29174,37238,25596,25529,25598,21865,142147,40050,143027,20890,13535,134567,20903,21581,21790,21779,30310,36397,157834,30129,32950,34820,34694,35015,33206,33820,135361,17644,29444,149254,23440,33547,157843,22139,141044,163119,147875,163187,159440,160438,37232,135641,37384,146684,173737,134828,134905,29286,138402,18254,151490,163833,135147,16634,40029,25887,142752,18675,149472,171388,135148,134666,24674,161187,135149,null,155720,135559,29091,32398,40272,19994,19972,13687,23309,27826,21351,13996,14812,21373,13989,149016,22682,150382,33325,21579,22442,154261,133497,null,14930,140389,29556,171692,19721,39917,146686,171824,19547,151465,169374,171998,33884,146870,160434,157619,145184,25390,32037,147191,146988,14890,36872,21196,15988,13946,17897,132238,30272,23280,134838,30842,163630,22695,16575,22140,39819,23924,30292,173108,40581,19681,30201,14331,24857,143578,148466,null,22109,135849,22439,149859,171526,21044,159918,13741,27722,40316,31830,39737,22494,137068,23635,25811,169168,156469,160100,34477,134440,159010,150242,134513,null,20990,139023,23950,38659,138705,40577,36940,31519,39682,23761,31651,25192,25397,39679,31695,39722,31870,39726,31810,31878,39957,31740,39689,40727,39963,149822,40794,21875,23491,20477,40600,20466,21088,15878,21201,22375,20566,22967,24082,38856,40363,36700,21609,38836,39232,38842,21292,24880,26924,21466,39946,40194,19515,38465,27008,20646,30022,137069,39386,21107,null,37209,38529,37212,null,37201,167575,25471,159011,27338,22033,37262,30074,25221,132092,29519,31856,154657,146685,null,149785,30422,39837,20010,134356,33726,34882,null,23626,27072,20717,22394,21023,24053,20174,27697,131570,20281,21660,21722,21146,36226,13822,24332,13811,null,27474,37244,40869,39831,38958,39092,39610,40616,40580,29050,31508,null,27642,34840,32632,null,22048,173642,36471,40787,null,36308,36431,40476,36353,25218,164733,36392,36469,31443,150135,31294,30936,27882,35431,30215,166490,40742,27854,34774,30147,172722,30803,194624,36108,29410,29553,35629,29442,29937,36075,150203,34351,24506,34976,17591,null,137275,159237,null,35454,140571,null,24829,30311,39639,40260,37742,39823,34805,null,34831,36087,29484,38689,39856,13782,29362,19463,31825,39242,155993,24921,19460,40598,24957,null,22367,24943,25254,25145,25294,14940,25058,21418,144373,25444,26626,13778,23895,166850,36826,167481,null,20697,138566,30982,21298,38456,134971,16485,null,30718,null,31938,155418,31962,31277,32870,32867,32077,29957,29938,35220,33306,26380,32866,160902,32859,29936,33027,30500,35209,157644,30035,159441,34729,34766,33224,34700,35401,36013,35651,30507,29944,34010,13877,27058,36262,null,35241,29800,28089,34753,147473,29927,15835,29046,24740,24988,15569,29026,24695,null,32625,166701,29264,24809,19326,21024,15384,146631,155351,161366,152881,137540,135934,170243,159196,159917,23745,156077,166415,145015,131310,157766,151310,17762,23327,156492,40784,40614,156267,12288,65292,12289,12290,65294,8231,65307,65306,65311,65281,65072,8230,8229,65104,65105,65106,183,65108,65109,65110,65111,65372,8211,65073,8212,65075,9588,65076,65103,65288,65289,65077,65078,65371,65373,65079,65080,12308,12309,65081,65082,12304,12305,65083,65084,12298,12299,65085,65086,12296,12297,65087,65088,12300,12301,65089,65090,12302,12303,65091,65092,65113,65114,65115,65116,65117,65118,8216,8217,8220,8221,12317,12318,8245,8242,65283,65286,65290,8251,167,12291,9675,9679,9651,9650,9678,9734,9733,9671,9670,9633,9632,9661,9660,12963,8453,175,65507,65343,717,65097,65098,65101,65102,65099,65100,65119,65120,65121,65291,65293,215,247,177,8730,65308,65310,65309,8806,8807,8800,8734,8786,8801,65122,65123,65124,65125,65126,65374,8745,8746,8869,8736,8735,8895,13266,13265,8747,8750,8757,8756,9792,9794,8853,8857,8593,8595,8592,8594,8598,8599,8601,8600,8741,8739,65295,65340,8725,65128,65284,65509,12306,65504,65505,65285,65312,8451,8457,65129,65130,65131,13269,13212,13213,13214,13262,13217,13198,13199,13252,176,20825,20827,20830,20829,20833,20835,21991,29929,31950,9601,9602,9603,9604,9605,9606,9607,9608,9615,9614,9613,9612,9611,9610,9609,9532,9524,9516,9508,9500,9620,9472,9474,9621,9484,9488,9492,9496,9581,9582,9584,9583,9552,9566,9578,9569,9698,9699,9701,9700,9585,9586,9587,65296,65297,65298,65299,65300,65301,65302,65303,65304,65305,8544,8545,8546,8547,8548,8549,8550,8551,8552,8553,12321,12322,12323,12324,12325,12326,12327,12328,12329,21313,21316,21317,65313,65314,65315,65316,65317,65318,65319,65320,65321,65322,65323,65324,65325,65326,65327,65328,65329,65330,65331,65332,65333,65334,65335,65336,65337,65338,65345,65346,65347,65348,65349,65350,65351,65352,65353,65354,65355,65356,65357,65358,65359,65360,65361,65362,65363,65364,65365,65366,65367,65368,65369,65370,913,914,915,916,917,918,919,920,921,922,923,924,925,926,927,928,929,931,932,933,934,935,936,937,945,946,947,948,949,950,951,952,953,954,955,956,957,958,959,960,961,963,964,965,966,967,968,969,12549,12550,12551,12552,12553,12554,12555,12556,12557,12558,12559,12560,12561,12562,12563,12564,12565,12566,12567,12568,12569,12570,12571,12572,12573,12574,12575,12576,12577,12578,12579,12580,12581,12582,12583,12584,12585,729,713,714,711,715,9216,9217,9218,9219,9220,9221,9222,9223,9224,9225,9226,9227,9228,9229,9230,9231,9232,9233,9234,9235,9236,9237,9238,9239,9240,9241,9242,9243,9244,9245,9246,9247,9249,8364,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,19968,20057,19969,19971,20035,20061,20102,20108,20154,20799,20837,20843,20960,20992,20993,21147,21269,21313,21340,21448,19977,19979,19976,19978,20011,20024,20961,20037,20040,20063,20062,20110,20129,20800,20995,21242,21315,21449,21475,22303,22763,22805,22823,22899,23376,23377,23379,23544,23567,23586,23608,23665,24029,24037,24049,24050,24051,24062,24178,24318,24331,24339,25165,19985,19984,19981,20013,20016,20025,20043,23609,20104,20113,20117,20114,20116,20130,20161,20160,20163,20166,20167,20173,20170,20171,20164,20803,20801,20839,20845,20846,20844,20887,20982,20998,20999,21000,21243,21246,21247,21270,21305,21320,21319,21317,21342,21380,21451,21450,21453,22764,22825,22827,22826,22829,23380,23569,23588,23610,23663,24052,24187,24319,24340,24341,24515,25096,25142,25163,25166,25903,25991,26007,26020,26041,26085,26352,26376,26408,27424,27490,27513,27595,27604,27611,27663,27700,28779,29226,29238,29243,29255,29273,29275,29356,29579,19993,19990,19989,19988,19992,20027,20045,20047,20046,20197,20184,20180,20181,20182,20183,20195,20196,20185,20190,20805,20804,20873,20874,20908,20985,20986,20984,21002,21152,21151,21253,21254,21271,21277,20191,21322,21321,21345,21344,21359,21358,21435,21487,21476,21491,21484,21486,21481,21480,21500,21496,21493,21483,21478,21482,21490,21489,21488,21477,21485,21499,22235,22234,22806,22830,22833,22900,22902,23381,23427,23612,24040,24039,24038,24066,24067,24179,24188,24321,24344,24343,24517,25098,25171,25172,25170,25169,26021,26086,26414,26412,26410,26411,26413,27491,27597,27665,27664,27704,27713,27712,27710,29359,29572,29577,29916,29926,29976,29983,29992,29993,30000,30001,30002,30003,30091,30333,30382,30399,30446,30683,30690,30707,31034,31166,31348,31435,19998,19999,20050,20051,20073,20121,20132,20134,20133,20223,20233,20249,20234,20245,20237,20240,20241,20239,20210,20214,20219,20208,20211,20221,20225,20235,20809,20807,20806,20808,20840,20849,20877,20912,21015,21009,21010,21006,21014,21155,21256,21281,21280,21360,21361,21513,21519,21516,21514,21520,21505,21515,21508,21521,21517,21512,21507,21518,21510,21522,22240,22238,22237,22323,22320,22312,22317,22316,22319,22313,22809,22810,22839,22840,22916,22904,22915,22909,22905,22914,22913,23383,23384,23431,23432,23429,23433,23546,23574,23673,24030,24070,24182,24180,24335,24347,24537,24534,25102,25100,25101,25104,25187,25179,25176,25910,26089,26088,26092,26093,26354,26355,26377,26429,26420,26417,26421,27425,27492,27515,27670,27741,27735,27737,27743,27744,27728,27733,27745,27739,27725,27726,28784,29279,29277,30334,31481,31859,31992,32566,32650,32701,32769,32771,32780,32786,32819,32895,32905,32907,32908,33251,33258,33267,33276,33292,33307,33311,33390,33394,33406,34411,34880,34892,34915,35199,38433,20018,20136,20301,20303,20295,20311,20318,20276,20315,20309,20272,20304,20305,20285,20282,20280,20291,20308,20284,20294,20323,20316,20320,20271,20302,20278,20313,20317,20296,20314,20812,20811,20813,20853,20918,20919,21029,21028,21033,21034,21032,21163,21161,21162,21164,21283,21363,21365,21533,21549,21534,21566,21542,21582,21543,21574,21571,21555,21576,21570,21531,21545,21578,21561,21563,21560,21550,21557,21558,21536,21564,21568,21553,21547,21535,21548,22250,22256,22244,22251,22346,22353,22336,22349,22343,22350,22334,22352,22351,22331,22767,22846,22941,22930,22952,22942,22947,22937,22934,22925,22948,22931,22922,22949,23389,23388,23386,23387,23436,23435,23439,23596,23616,23617,23615,23614,23696,23697,23700,23692,24043,24076,24207,24199,24202,24311,24324,24351,24420,24418,24439,24441,24536,24524,24535,24525,24561,24555,24568,24554,25106,25105,25220,25239,25238,25216,25206,25225,25197,25226,25212,25214,25209,25203,25234,25199,25240,25198,25237,25235,25233,25222,25913,25915,25912,26097,26356,26463,26446,26447,26448,26449,26460,26454,26462,26441,26438,26464,26451,26455,27493,27599,27714,27742,27801,27777,27784,27785,27781,27803,27754,27770,27792,27760,27788,27752,27798,27794,27773,27779,27762,27774,27764,27782,27766,27789,27796,27800,27778,28790,28796,28797,28792,29282,29281,29280,29380,29378,29590,29996,29995,30007,30008,30338,30447,30691,31169,31168,31167,31350,31995,32597,32918,32915,32925,32920,32923,32922,32946,33391,33426,33419,33421,35211,35282,35328,35895,35910,35925,35997,36196,36208,36275,36523,36554,36763,36784,36802,36806,36805,36804,24033,37009,37026,37034,37030,37027,37193,37318,37324,38450,38446,38449,38442,38444,20006,20054,20083,20107,20123,20126,20139,20140,20335,20381,20365,20339,20351,20332,20379,20363,20358,20355,20336,20341,20360,20329,20347,20374,20350,20367,20369,20346,20820,20818,20821,20841,20855,20854,20856,20925,20989,21051,21048,21047,21050,21040,21038,21046,21057,21182,21179,21330,21332,21331,21329,21350,21367,21368,21369,21462,21460,21463,21619,21621,21654,21624,21653,21632,21627,21623,21636,21650,21638,21628,21648,21617,21622,21644,21658,21602,21608,21643,21629,21646,22266,22403,22391,22378,22377,22369,22374,22372,22396,22812,22857,22855,22856,22852,22868,22974,22971,22996,22969,22958,22993,22982,22992,22989,22987,22995,22986,22959,22963,22994,22981,23391,23396,23395,23447,23450,23448,23452,23449,23451,23578,23624,23621,23622,23735,23713,23736,23721,23723,23729,23731,24088,24090,24086,24085,24091,24081,24184,24218,24215,24220,24213,24214,24310,24358,24359,24361,24448,24449,24447,24444,24541,24544,24573,24565,24575,24591,24596,24623,24629,24598,24618,24597,24609,24615,24617,24619,24603,25110,25109,25151,25150,25152,25215,25289,25292,25284,25279,25282,25273,25298,25307,25259,25299,25300,25291,25288,25256,25277,25276,25296,25305,25287,25293,25269,25306,25265,25304,25302,25303,25286,25260,25294,25918,26023,26044,26106,26132,26131,26124,26118,26114,26126,26112,26127,26133,26122,26119,26381,26379,26477,26507,26517,26481,26524,26483,26487,26503,26525,26519,26479,26480,26495,26505,26494,26512,26485,26522,26515,26492,26474,26482,27427,27494,27495,27519,27667,27675,27875,27880,27891,27825,27852,27877,27827,27837,27838,27836,27874,27819,27861,27859,27832,27844,27833,27841,27822,27863,27845,27889,27839,27835,27873,27867,27850,27820,27887,27868,27862,27872,28821,28814,28818,28810,28825,29228,29229,29240,29256,29287,29289,29376,29390,29401,29399,29392,29609,29608,29599,29611,29605,30013,30109,30105,30106,30340,30402,30450,30452,30693,30717,31038,31040,31041,31177,31176,31354,31353,31482,31998,32596,32652,32651,32773,32954,32933,32930,32945,32929,32939,32937,32948,32938,32943,33253,33278,33293,33459,33437,33433,33453,33469,33439,33465,33457,33452,33445,33455,33464,33443,33456,33470,33463,34382,34417,21021,34920,36555,36814,36820,36817,37045,37048,37041,37046,37319,37329,38263,38272,38428,38464,38463,38459,38468,38466,38585,38632,38738,38750,20127,20141,20142,20449,20405,20399,20415,20448,20433,20431,20445,20419,20406,20440,20447,20426,20439,20398,20432,20420,20418,20442,20430,20446,20407,20823,20882,20881,20896,21070,21059,21066,21069,21068,21067,21063,21191,21193,21187,21185,21261,21335,21371,21402,21467,21676,21696,21672,21710,21705,21688,21670,21683,21703,21698,21693,21674,21697,21700,21704,21679,21675,21681,21691,21673,21671,21695,22271,22402,22411,22432,22435,22434,22478,22446,22419,22869,22865,22863,22862,22864,23004,23000,23039,23011,23016,23043,23013,23018,23002,23014,23041,23035,23401,23459,23462,23460,23458,23461,23553,23630,23631,23629,23627,23769,23762,24055,24093,24101,24095,24189,24224,24230,24314,24328,24365,24421,24456,24453,24458,24459,24455,24460,24457,24594,24605,24608,24613,24590,24616,24653,24688,24680,24674,24646,24643,24684,24683,24682,24676,25153,25308,25366,25353,25340,25325,25345,25326,25341,25351,25329,25335,25327,25324,25342,25332,25361,25346,25919,25925,26027,26045,26082,26149,26157,26144,26151,26159,26143,26152,26161,26148,26359,26623,26579,26609,26580,26576,26604,26550,26543,26613,26601,26607,26564,26577,26548,26586,26597,26552,26575,26590,26611,26544,26585,26594,26589,26578,27498,27523,27526,27573,27602,27607,27679,27849,27915,27954,27946,27969,27941,27916,27953,27934,27927,27963,27965,27966,27958,27931,27893,27961,27943,27960,27945,27950,27957,27918,27947,28843,28858,28851,28844,28847,28845,28856,28846,28836,29232,29298,29295,29300,29417,29408,29409,29623,29642,29627,29618,29645,29632,29619,29978,29997,30031,30028,30030,30027,30123,30116,30117,30114,30115,30328,30342,30343,30344,30408,30406,30403,30405,30465,30457,30456,30473,30475,30462,30460,30471,30684,30722,30740,30732,30733,31046,31049,31048,31047,31161,31162,31185,31186,31179,31359,31361,31487,31485,31869,32002,32005,32000,32009,32007,32004,32006,32568,32654,32703,32772,32784,32781,32785,32822,32982,32997,32986,32963,32964,32972,32993,32987,32974,32990,32996,32989,33268,33314,33511,33539,33541,33507,33499,33510,33540,33509,33538,33545,33490,33495,33521,33537,33500,33492,33489,33502,33491,33503,33519,33542,34384,34425,34427,34426,34893,34923,35201,35284,35336,35330,35331,35998,36000,36212,36211,36276,36557,36556,36848,36838,36834,36842,36837,36845,36843,36836,36840,37066,37070,37057,37059,37195,37194,37325,38274,38480,38475,38476,38477,38754,38761,38859,38893,38899,38913,39080,39131,39135,39318,39321,20056,20147,20492,20493,20515,20463,20518,20517,20472,20521,20502,20486,20540,20511,20506,20498,20497,20474,20480,20500,20520,20465,20513,20491,20505,20504,20467,20462,20525,20522,20478,20523,20489,20860,20900,20901,20898,20941,20940,20934,20939,21078,21084,21076,21083,21085,21290,21375,21407,21405,21471,21736,21776,21761,21815,21756,21733,21746,21766,21754,21780,21737,21741,21729,21769,21742,21738,21734,21799,21767,21757,21775,22275,22276,22466,22484,22475,22467,22537,22799,22871,22872,22874,23057,23064,23068,23071,23067,23059,23020,23072,23075,23081,23077,23052,23049,23403,23640,23472,23475,23478,23476,23470,23477,23481,23480,23556,23633,23637,23632,23789,23805,23803,23786,23784,23792,23798,23809,23796,24046,24109,24107,24235,24237,24231,24369,24466,24465,24464,24665,24675,24677,24656,24661,24685,24681,24687,24708,24735,24730,24717,24724,24716,24709,24726,25159,25331,25352,25343,25422,25406,25391,25429,25410,25414,25423,25417,25402,25424,25405,25386,25387,25384,25421,25420,25928,25929,26009,26049,26053,26178,26185,26191,26179,26194,26188,26181,26177,26360,26388,26389,26391,26657,26680,26696,26694,26707,26681,26690,26708,26665,26803,26647,26700,26705,26685,26612,26704,26688,26684,26691,26666,26693,26643,26648,26689,27530,27529,27575,27683,27687,27688,27686,27684,27888,28010,28053,28040,28039,28006,28024,28023,27993,28051,28012,28041,28014,27994,28020,28009,28044,28042,28025,28037,28005,28052,28874,28888,28900,28889,28872,28879,29241,29305,29436,29433,29437,29432,29431,29574,29677,29705,29678,29664,29674,29662,30036,30045,30044,30042,30041,30142,30149,30151,30130,30131,30141,30140,30137,30146,30136,30347,30384,30410,30413,30414,30505,30495,30496,30504,30697,30768,30759,30776,30749,30772,30775,30757,30765,30752,30751,30770,31061,31056,31072,31071,31062,31070,31069,31063,31066,31204,31203,31207,31199,31206,31209,31192,31364,31368,31449,31494,31505,31881,32033,32023,32011,32010,32032,32034,32020,32016,32021,32026,32028,32013,32025,32027,32570,32607,32660,32709,32705,32774,32792,32789,32793,32791,32829,32831,33009,33026,33008,33029,33005,33012,33030,33016,33011,33032,33021,33034,33020,33007,33261,33260,33280,33296,33322,33323,33320,33324,33467,33579,33618,33620,33610,33592,33616,33609,33589,33588,33615,33586,33593,33590,33559,33600,33585,33576,33603,34388,34442,34474,34451,34468,34473,34444,34467,34460,34928,34935,34945,34946,34941,34937,35352,35344,35342,35340,35349,35338,35351,35347,35350,35343,35345,35912,35962,35961,36001,36002,36215,36524,36562,36564,36559,36785,36865,36870,36855,36864,36858,36852,36867,36861,36869,36856,37013,37089,37085,37090,37202,37197,37196,37336,37341,37335,37340,37337,38275,38498,38499,38497,38491,38493,38500,38488,38494,38587,39138,39340,39592,39640,39717,39730,39740,20094,20602,20605,20572,20551,20547,20556,20570,20553,20581,20598,20558,20565,20597,20596,20599,20559,20495,20591,20589,20828,20885,20976,21098,21103,21202,21209,21208,21205,21264,21263,21273,21311,21312,21310,21443,26364,21830,21866,21862,21828,21854,21857,21827,21834,21809,21846,21839,21845,21807,21860,21816,21806,21852,21804,21859,21811,21825,21847,22280,22283,22281,22495,22533,22538,22534,22496,22500,22522,22530,22581,22519,22521,22816,22882,23094,23105,23113,23142,23146,23104,23100,23138,23130,23110,23114,23408,23495,23493,23492,23490,23487,23494,23561,23560,23559,23648,23644,23645,23815,23814,23822,23835,23830,23842,23825,23849,23828,23833,23844,23847,23831,24034,24120,24118,24115,24119,24247,24248,24246,24245,24254,24373,24375,24407,24428,24425,24427,24471,24473,24478,24472,24481,24480,24476,24703,24739,24713,24736,24744,24779,24756,24806,24765,24773,24763,24757,24796,24764,24792,24789,24774,24799,24760,24794,24775,25114,25115,25160,25504,25511,25458,25494,25506,25509,25463,25447,25496,25514,25457,25513,25481,25475,25499,25451,25512,25476,25480,25497,25505,25516,25490,25487,25472,25467,25449,25448,25466,25949,25942,25937,25945,25943,21855,25935,25944,25941,25940,26012,26011,26028,26063,26059,26060,26062,26205,26202,26212,26216,26214,26206,26361,21207,26395,26753,26799,26786,26771,26805,26751,26742,26801,26791,26775,26800,26755,26820,26797,26758,26757,26772,26781,26792,26783,26785,26754,27442,27578,27627,27628,27691,28046,28092,28147,28121,28082,28129,28108,28132,28155,28154,28165,28103,28107,28079,28113,28078,28126,28153,28088,28151,28149,28101,28114,28186,28085,28122,28139,28120,28138,28145,28142,28136,28102,28100,28074,28140,28095,28134,28921,28937,28938,28925,28911,29245,29309,29313,29468,29467,29462,29459,29465,29575,29701,29706,29699,29702,29694,29709,29920,29942,29943,29980,29986,30053,30054,30050,30064,30095,30164,30165,30133,30154,30157,30350,30420,30418,30427,30519,30526,30524,30518,30520,30522,30827,30787,30798,31077,31080,31085,31227,31378,31381,31520,31528,31515,31532,31526,31513,31518,31534,31890,31895,31893,32070,32067,32113,32046,32057,32060,32064,32048,32051,32068,32047,32066,32050,32049,32573,32670,32666,32716,32718,32722,32796,32842,32838,33071,33046,33059,33067,33065,33072,33060,33282,33333,33335,33334,33337,33678,33694,33688,33656,33698,33686,33725,33707,33682,33674,33683,33673,33696,33655,33659,33660,33670,33703,34389,24426,34503,34496,34486,34500,34485,34502,34507,34481,34479,34505,34899,34974,34952,34987,34962,34966,34957,34955,35219,35215,35370,35357,35363,35365,35377,35373,35359,35355,35362,35913,35930,36009,36012,36011,36008,36010,36007,36199,36198,36286,36282,36571,36575,36889,36877,36890,36887,36899,36895,36893,36880,36885,36894,36896,36879,36898,36886,36891,36884,37096,37101,37117,37207,37326,37365,37350,37347,37351,37357,37353,38281,38506,38517,38515,38520,38512,38516,38518,38519,38508,38592,38634,38633,31456,31455,38914,38915,39770,40165,40565,40575,40613,40635,20642,20621,20613,20633,20625,20608,20630,20632,20634,26368,20977,21106,21108,21109,21097,21214,21213,21211,21338,21413,21883,21888,21927,21884,21898,21917,21912,21890,21916,21930,21908,21895,21899,21891,21939,21934,21919,21822,21938,21914,21947,21932,21937,21886,21897,21931,21913,22285,22575,22570,22580,22564,22576,22577,22561,22557,22560,22777,22778,22880,23159,23194,23167,23186,23195,23207,23411,23409,23506,23500,23507,23504,23562,23563,23601,23884,23888,23860,23879,24061,24133,24125,24128,24131,24190,24266,24257,24258,24260,24380,24429,24489,24490,24488,24785,24801,24754,24758,24800,24860,24867,24826,24853,24816,24827,24820,24936,24817,24846,24822,24841,24832,24850,25119,25161,25507,25484,25551,25536,25577,25545,25542,25549,25554,25571,25552,25569,25558,25581,25582,25462,25588,25578,25563,25682,25562,25593,25950,25958,25954,25955,26001,26000,26031,26222,26224,26228,26230,26223,26257,26234,26238,26231,26366,26367,26399,26397,26874,26837,26848,26840,26839,26885,26847,26869,26862,26855,26873,26834,26866,26851,26827,26829,26893,26898,26894,26825,26842,26990,26875,27454,27450,27453,27544,27542,27580,27631,27694,27695,27692,28207,28216,28244,28193,28210,28263,28234,28192,28197,28195,28187,28251,28248,28196,28246,28270,28205,28198,28271,28212,28237,28218,28204,28227,28189,28222,28363,28297,28185,28238,28259,28228,28274,28265,28255,28953,28954,28966,28976,28961,28982,29038,28956,29260,29316,29312,29494,29477,29492,29481,29754,29738,29747,29730,29733,29749,29750,29748,29743,29723,29734,29736,29989,29990,30059,30058,30178,30171,30179,30169,30168,30174,30176,30331,30332,30358,30355,30388,30428,30543,30701,30813,30828,30831,31245,31240,31243,31237,31232,31384,31383,31382,31461,31459,31561,31574,31558,31568,31570,31572,31565,31563,31567,31569,31903,31909,32094,32080,32104,32085,32043,32110,32114,32097,32102,32098,32112,32115,21892,32724,32725,32779,32850,32901,33109,33108,33099,33105,33102,33081,33094,33086,33100,33107,33140,33298,33308,33769,33795,33784,33805,33760,33733,33803,33729,33775,33777,33780,33879,33802,33776,33804,33740,33789,33778,33738,33848,33806,33796,33756,33799,33748,33759,34395,34527,34521,34541,34516,34523,34532,34512,34526,34903,35009,35010,34993,35203,35222,35387,35424,35413,35422,35388,35393,35412,35419,35408,35398,35380,35386,35382,35414,35937,35970,36015,36028,36019,36029,36033,36027,36032,36020,36023,36022,36031,36024,36234,36229,36225,36302,36317,36299,36314,36305,36300,36315,36294,36603,36600,36604,36764,36910,36917,36913,36920,36914,36918,37122,37109,37129,37118,37219,37221,37327,37396,37397,37411,37385,37406,37389,37392,37383,37393,38292,38287,38283,38289,38291,38290,38286,38538,38542,38539,38525,38533,38534,38541,38514,38532,38593,38597,38596,38598,38599,38639,38642,38860,38917,38918,38920,39143,39146,39151,39145,39154,39149,39342,39341,40643,40653,40657,20098,20653,20661,20658,20659,20677,20670,20652,20663,20667,20655,20679,21119,21111,21117,21215,21222,21220,21218,21219,21295,21983,21992,21971,21990,21966,21980,21959,21969,21987,21988,21999,21978,21985,21957,21958,21989,21961,22290,22291,22622,22609,22616,22615,22618,22612,22635,22604,22637,22602,22626,22610,22603,22887,23233,23241,23244,23230,23229,23228,23219,23234,23218,23913,23919,24140,24185,24265,24264,24338,24409,24492,24494,24858,24847,24904,24863,24819,24859,24825,24833,24840,24910,24908,24900,24909,24894,24884,24871,24845,24838,24887,25121,25122,25619,25662,25630,25642,25645,25661,25644,25615,25628,25620,25613,25654,25622,25623,25606,25964,26015,26032,26263,26249,26247,26248,26262,26244,26264,26253,26371,27028,26989,26970,26999,26976,26964,26997,26928,27010,26954,26984,26987,26974,26963,27001,27014,26973,26979,26971,27463,27506,27584,27583,27603,27645,28322,28335,28371,28342,28354,28304,28317,28359,28357,28325,28312,28348,28346,28331,28369,28310,28316,28356,28372,28330,28327,28340,29006,29017,29033,29028,29001,29031,29020,29036,29030,29004,29029,29022,28998,29032,29014,29242,29266,29495,29509,29503,29502,29807,29786,29781,29791,29790,29761,29759,29785,29787,29788,30070,30072,30208,30192,30209,30194,30193,30202,30207,30196,30195,30430,30431,30555,30571,30566,30558,30563,30585,30570,30572,30556,30565,30568,30562,30702,30862,30896,30871,30872,30860,30857,30844,30865,30867,30847,31098,31103,31105,33836,31165,31260,31258,31264,31252,31263,31262,31391,31392,31607,31680,31584,31598,31591,31921,31923,31925,32147,32121,32145,32129,32143,32091,32622,32617,32618,32626,32681,32680,32676,32854,32856,32902,32900,33137,33136,33144,33125,33134,33139,33131,33145,33146,33126,33285,33351,33922,33911,33853,33841,33909,33894,33899,33865,33900,33883,33852,33845,33889,33891,33897,33901,33862,34398,34396,34399,34553,34579,34568,34567,34560,34558,34555,34562,34563,34566,34570,34905,35039,35028,35033,35036,35032,35037,35041,35018,35029,35026,35228,35299,35435,35442,35443,35430,35433,35440,35463,35452,35427,35488,35441,35461,35437,35426,35438,35436,35449,35451,35390,35432,35938,35978,35977,36042,36039,36040,36036,36018,36035,36034,36037,36321,36319,36328,36335,36339,36346,36330,36324,36326,36530,36611,36617,36606,36618,36767,36786,36939,36938,36947,36930,36948,36924,36949,36944,36935,36943,36942,36941,36945,36926,36929,37138,37143,37228,37226,37225,37321,37431,37463,37432,37437,37440,37438,37467,37451,37476,37457,37428,37449,37453,37445,37433,37439,37466,38296,38552,38548,38549,38605,38603,38601,38602,38647,38651,38649,38646,38742,38772,38774,38928,38929,38931,38922,38930,38924,39164,39156,39165,39166,39347,39345,39348,39649,40169,40578,40718,40723,40736,20711,20718,20709,20694,20717,20698,20693,20687,20689,20721,20686,20713,20834,20979,21123,21122,21297,21421,22014,22016,22043,22039,22013,22036,22022,22025,22029,22030,22007,22038,22047,22024,22032,22006,22296,22294,22645,22654,22659,22675,22666,22649,22661,22653,22781,22821,22818,22820,22890,22889,23265,23270,23273,23255,23254,23256,23267,23413,23518,23527,23521,23525,23526,23528,23522,23524,23519,23565,23650,23940,23943,24155,24163,24149,24151,24148,24275,24278,24330,24390,24432,24505,24903,24895,24907,24951,24930,24931,24927,24922,24920,24949,25130,25735,25688,25684,25764,25720,25695,25722,25681,25703,25652,25709,25723,25970,26017,26071,26070,26274,26280,26269,27036,27048,27029,27073,27054,27091,27083,27035,27063,27067,27051,27060,27088,27085,27053,27084,27046,27075,27043,27465,27468,27699,28467,28436,28414,28435,28404,28457,28478,28448,28460,28431,28418,28450,28415,28399,28422,28465,28472,28466,28451,28437,28459,28463,28552,28458,28396,28417,28402,28364,28407,29076,29081,29053,29066,29060,29074,29246,29330,29334,29508,29520,29796,29795,29802,29808,29805,29956,30097,30247,30221,30219,30217,30227,30433,30435,30596,30589,30591,30561,30913,30879,30887,30899,30889,30883,31118,31119,31117,31278,31281,31402,31401,31469,31471,31649,31637,31627,31605,31639,31645,31636,31631,31672,31623,31620,31929,31933,31934,32187,32176,32156,32189,32190,32160,32202,32180,32178,32177,32186,32162,32191,32181,32184,32173,32210,32199,32172,32624,32736,32737,32735,32862,32858,32903,33104,33152,33167,33160,33162,33151,33154,33255,33274,33287,33300,33310,33355,33993,33983,33990,33988,33945,33950,33970,33948,33995,33976,33984,34003,33936,33980,34001,33994,34623,34588,34619,34594,34597,34612,34584,34645,34615,34601,35059,35074,35060,35065,35064,35069,35048,35098,35055,35494,35468,35486,35491,35469,35489,35475,35492,35498,35493,35496,35480,35473,35482,35495,35946,35981,35980,36051,36049,36050,36203,36249,36245,36348,36628,36626,36629,36627,36771,36960,36952,36956,36963,36953,36958,36962,36957,36955,37145,37144,37150,37237,37240,37239,37236,37496,37504,37509,37528,37526,37499,37523,37532,37544,37500,37521,38305,38312,38313,38307,38309,38308,38553,38556,38555,38604,38610,38656,38780,38789,38902,38935,38936,39087,39089,39171,39173,39180,39177,39361,39599,39600,39654,39745,39746,40180,40182,40179,40636,40763,40778,20740,20736,20731,20725,20729,20738,20744,20745,20741,20956,21127,21128,21129,21133,21130,21232,21426,22062,22075,22073,22066,22079,22068,22057,22099,22094,22103,22132,22070,22063,22064,22656,22687,22686,22707,22684,22702,22697,22694,22893,23305,23291,23307,23285,23308,23304,23534,23532,23529,23531,23652,23653,23965,23956,24162,24159,24161,24290,24282,24287,24285,24291,24288,24392,24433,24503,24501,24950,24935,24942,24925,24917,24962,24956,24944,24939,24958,24999,24976,25003,24974,25004,24986,24996,24980,25006,25134,25705,25711,25721,25758,25778,25736,25744,25776,25765,25747,25749,25769,25746,25774,25773,25771,25754,25772,25753,25762,25779,25973,25975,25976,26286,26283,26292,26289,27171,27167,27112,27137,27166,27161,27133,27169,27155,27146,27123,27138,27141,27117,27153,27472,27470,27556,27589,27590,28479,28540,28548,28497,28518,28500,28550,28525,28507,28536,28526,28558,28538,28528,28516,28567,28504,28373,28527,28512,28511,29087,29100,29105,29096,29270,29339,29518,29527,29801,29835,29827,29822,29824,30079,30240,30249,30239,30244,30246,30241,30242,30362,30394,30436,30606,30599,30604,30609,30603,30923,30917,30906,30922,30910,30933,30908,30928,31295,31292,31296,31293,31287,31291,31407,31406,31661,31665,31684,31668,31686,31687,31681,31648,31692,31946,32224,32244,32239,32251,32216,32236,32221,32232,32227,32218,32222,32233,32158,32217,32242,32249,32629,32631,32687,32745,32806,33179,33180,33181,33184,33178,33176,34071,34109,34074,34030,34092,34093,34067,34065,34083,34081,34068,34028,34085,34047,34054,34690,34676,34678,34656,34662,34680,34664,34649,34647,34636,34643,34907,34909,35088,35079,35090,35091,35093,35082,35516,35538,35527,35524,35477,35531,35576,35506,35529,35522,35519,35504,35542,35533,35510,35513,35547,35916,35918,35948,36064,36062,36070,36068,36076,36077,36066,36067,36060,36074,36065,36205,36255,36259,36395,36368,36381,36386,36367,36393,36383,36385,36382,36538,36637,36635,36639,36649,36646,36650,36636,36638,36645,36969,36974,36968,36973,36983,37168,37165,37159,37169,37255,37257,37259,37251,37573,37563,37559,37610,37548,37604,37569,37555,37564,37586,37575,37616,37554,38317,38321,38660,38662,38663,38665,38752,38797,38795,38799,38945,38955,38940,39091,39178,39187,39186,39192,39389,39376,39391,39387,39377,39381,39378,39385,39607,39662,39663,39719,39749,39748,39799,39791,40198,40201,40195,40617,40638,40654,22696,40786,20754,20760,20756,20752,20757,20864,20906,20957,21137,21139,21235,22105,22123,22137,22121,22116,22136,22122,22120,22117,22129,22127,22124,22114,22134,22721,22718,22727,22725,22894,23325,23348,23416,23536,23566,24394,25010,24977,25001,24970,25037,25014,25022,25034,25032,25136,25797,25793,25803,25787,25788,25818,25796,25799,25794,25805,25791,25810,25812,25790,25972,26310,26313,26297,26308,26311,26296,27197,27192,27194,27225,27243,27224,27193,27204,27234,27233,27211,27207,27189,27231,27208,27481,27511,27653,28610,28593,28577,28611,28580,28609,28583,28595,28608,28601,28598,28582,28576,28596,29118,29129,29136,29138,29128,29141,29113,29134,29145,29148,29123,29124,29544,29852,29859,29848,29855,29854,29922,29964,29965,30260,30264,30266,30439,30437,30624,30622,30623,30629,30952,30938,30956,30951,31142,31309,31310,31302,31308,31307,31418,31705,31761,31689,31716,31707,31713,31721,31718,31957,31958,32266,32273,32264,32283,32291,32286,32285,32265,32272,32633,32690,32752,32753,32750,32808,33203,33193,33192,33275,33288,33368,33369,34122,34137,34120,34152,34153,34115,34121,34157,34154,34142,34691,34719,34718,34722,34701,34913,35114,35122,35109,35115,35105,35242,35238,35558,35578,35563,35569,35584,35548,35559,35566,35582,35585,35586,35575,35565,35571,35574,35580,35947,35949,35987,36084,36420,36401,36404,36418,36409,36405,36667,36655,36664,36659,36776,36774,36981,36980,36984,36978,36988,36986,37172,37266,37664,37686,37624,37683,37679,37666,37628,37675,37636,37658,37648,37670,37665,37653,37678,37657,38331,38567,38568,38570,38613,38670,38673,38678,38669,38675,38671,38747,38748,38758,38808,38960,38968,38971,38967,38957,38969,38948,39184,39208,39198,39195,39201,39194,39405,39394,39409,39608,39612,39675,39661,39720,39825,40213,40227,40230,40232,40210,40219,40664,40660,40845,40860,20778,20767,20769,20786,21237,22158,22144,22160,22149,22151,22159,22741,22739,22737,22734,23344,23338,23332,23418,23607,23656,23996,23994,23997,23992,24171,24396,24509,25033,25026,25031,25062,25035,25138,25140,25806,25802,25816,25824,25840,25830,25836,25841,25826,25837,25986,25987,26329,26326,27264,27284,27268,27298,27292,27355,27299,27262,27287,27280,27296,27484,27566,27610,27656,28632,28657,28639,28640,28635,28644,28651,28655,28544,28652,28641,28649,28629,28654,28656,29159,29151,29166,29158,29157,29165,29164,29172,29152,29237,29254,29552,29554,29865,29872,29862,29864,30278,30274,30284,30442,30643,30634,30640,30636,30631,30637,30703,30967,30970,30964,30959,30977,31143,31146,31319,31423,31751,31757,31742,31735,31756,31712,31968,31964,31966,31970,31967,31961,31965,32302,32318,32326,32311,32306,32323,32299,32317,32305,32325,32321,32308,32313,32328,32309,32319,32303,32580,32755,32764,32881,32882,32880,32879,32883,33222,33219,33210,33218,33216,33215,33213,33225,33214,33256,33289,33393,34218,34180,34174,34204,34193,34196,34223,34203,34183,34216,34186,34407,34752,34769,34739,34770,34758,34731,34747,34746,34760,34763,35131,35126,35140,35128,35133,35244,35598,35607,35609,35611,35594,35616,35613,35588,35600,35905,35903,35955,36090,36093,36092,36088,36091,36264,36425,36427,36424,36426,36676,36670,36674,36677,36671,36991,36989,36996,36993,36994,36992,37177,37283,37278,37276,37709,37762,37672,37749,37706,37733,37707,37656,37758,37740,37723,37744,37722,37716,38346,38347,38348,38344,38342,38577,38584,38614,38684,38686,38816,38867,38982,39094,39221,39425,39423,39854,39851,39850,39853,40251,40255,40587,40655,40670,40668,40669,40667,40766,40779,21474,22165,22190,22745,22744,23352,24413,25059,25139,25844,25842,25854,25862,25850,25851,25847,26039,26332,26406,27315,27308,27331,27323,27320,27330,27310,27311,27487,27512,27567,28681,28683,28670,28678,28666,28689,28687,29179,29180,29182,29176,29559,29557,29863,29887,29973,30294,30296,30290,30653,30655,30651,30652,30990,31150,31329,31330,31328,31428,31429,31787,31783,31786,31774,31779,31777,31975,32340,32341,32350,32346,32353,32338,32345,32584,32761,32763,32887,32886,33229,33231,33290,34255,34217,34253,34256,34249,34224,34234,34233,34214,34799,34796,34802,34784,35206,35250,35316,35624,35641,35628,35627,35920,36101,36441,36451,36454,36452,36447,36437,36544,36681,36685,36999,36995,37000,37291,37292,37328,37780,37770,37782,37794,37811,37806,37804,37808,37784,37786,37783,38356,38358,38352,38357,38626,38620,38617,38619,38622,38692,38819,38822,38829,38905,38989,38991,38988,38990,38995,39098,39230,39231,39229,39214,39333,39438,39617,39683,39686,39759,39758,39757,39882,39881,39933,39880,39872,40273,40285,40288,40672,40725,40748,20787,22181,22750,22751,22754,23541,40848,24300,25074,25079,25078,25077,25856,25871,26336,26333,27365,27357,27354,27347,28699,28703,28712,28698,28701,28693,28696,29190,29197,29272,29346,29560,29562,29885,29898,29923,30087,30086,30303,30305,30663,31001,31153,31339,31337,31806,31807,31800,31805,31799,31808,32363,32365,32377,32361,32362,32645,32371,32694,32697,32696,33240,34281,34269,34282,34261,34276,34277,34295,34811,34821,34829,34809,34814,35168,35167,35158,35166,35649,35676,35672,35657,35674,35662,35663,35654,35673,36104,36106,36476,36466,36487,36470,36460,36474,36468,36692,36686,36781,37002,37003,37297,37294,37857,37841,37855,37827,37832,37852,37853,37846,37858,37837,37848,37860,37847,37864,38364,38580,38627,38698,38695,38753,38876,38907,39006,39000,39003,39100,39237,39241,39446,39449,39693,39912,39911,39894,39899,40329,40289,40306,40298,40300,40594,40599,40595,40628,21240,22184,22199,22198,22196,22204,22756,23360,23363,23421,23542,24009,25080,25082,25880,25876,25881,26342,26407,27372,28734,28720,28722,29200,29563,29903,30306,30309,31014,31018,31020,31019,31431,31478,31820,31811,31821,31983,31984,36782,32381,32380,32386,32588,32768,33242,33382,34299,34297,34321,34298,34310,34315,34311,34314,34836,34837,35172,35258,35320,35696,35692,35686,35695,35679,35691,36111,36109,36489,36481,36485,36482,37300,37323,37912,37891,37885,38369,38704,39108,39250,39249,39336,39467,39472,39479,39477,39955,39949,40569,40629,40680,40751,40799,40803,40801,20791,20792,22209,22208,22210,22804,23660,24013,25084,25086,25885,25884,26005,26345,27387,27396,27386,27570,28748,29211,29351,29910,29908,30313,30675,31824,32399,32396,32700,34327,34349,34330,34851,34850,34849,34847,35178,35180,35261,35700,35703,35709,36115,36490,36493,36491,36703,36783,37306,37934,37939,37941,37946,37944,37938,37931,38370,38712,38713,38706,38911,39015,39013,39255,39493,39491,39488,39486,39631,39764,39761,39981,39973,40367,40372,40386,40376,40605,40687,40729,40796,40806,40807,20796,20795,22216,22218,22217,23423,24020,24018,24398,25087,25892,27402,27489,28753,28760,29568,29924,30090,30318,30316,31155,31840,31839,32894,32893,33247,35186,35183,35324,35712,36118,36119,36497,36499,36705,37192,37956,37969,37970,38717,38718,38851,38849,39019,39253,39509,39501,39634,39706,40009,39985,39998,39995,40403,40407,40756,40812,40810,40852,22220,24022,25088,25891,25899,25898,26348,27408,29914,31434,31844,31843,31845,32403,32406,32404,33250,34360,34367,34865,35722,37008,37007,37987,37984,37988,38760,39023,39260,39514,39515,39511,39635,39636,39633,40020,40023,40022,40421,40607,40692,22225,22761,25900,28766,30321,30322,30679,32592,32648,34870,34873,34914,35731,35730,35734,33399,36123,37312,37994,38722,38728,38724,38854,39024,39519,39714,39768,40031,40441,40442,40572,40573,40711,40823,40818,24307,27414,28771,31852,31854,34875,35264,36513,37313,38002,38000,39025,39262,39638,39715,40652,28772,30682,35738,38007,38857,39522,39525,32412,35740,36522,37317,38013,38014,38012,40055,40056,40695,35924,38015,40474,29224,39530,39729,40475,40478,31858,9312,9313,9314,9315,9316,9317,9318,9319,9320,9321,9332,9333,9334,9335,9336,9337,9338,9339,9340,9341,8560,8561,8562,8563,8564,8565,8566,8567,8568,8569,20022,20031,20101,20128,20866,20886,20907,21241,21304,21353,21430,22794,23424,24027,12083,24191,24308,24400,24417,25908,26080,30098,30326,36789,38582,168,710,12541,12542,12445,12446,12291,20189,12293,12294,12295,12540,65339,65341,10045,12353,12354,12355,12356,12357,12358,12359,12360,12361,12362,12363,12364,12365,12366,12367,12368,12369,12370,12371,12372,12373,12374,12375,12376,12377,12378,12379,12380,12381,12382,12383,12384,12385,12386,12387,12388,12389,12390,12391,12392,12393,12394,12395,12396,12397,12398,12399,12400,12401,12402,12403,12404,12405,12406,12407,12408,12409,12410,12411,12412,12413,12414,12415,12416,12417,12418,12419,12420,12421,12422,12423,12424,12425,12426,12427,12428,12429,12430,12431,12432,12433,12434,12435,12449,12450,12451,12452,12453,12454,12455,12456,12457,12458,12459,12460,12461,12462,12463,12464,12465,12466,12467,12468,12469,12470,12471,12472,12473,12474,12475,12476,12477,12478,12479,12480,12481,12482,12483,12484,12485,12486,12487,12488,12489,12490,12491,12492,12493,12494,12495,12496,12497,12498,12499,12500,12501,12502,12503,12504,12505,12506,12507,12508,12509,12510,12511,12512,12513,12514,12515,12516,12517,12518,12519,12520,12521,12522,12523,12524,12525,12526,12527,12528,12529,12530,12531,12532,12533,12534,1040,1041,1042,1043,1044,1045,1025,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,1072,1073,1074,1075,1076,1077,1105,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,1103,8679,8632,8633,12751,131276,20058,131210,20994,17553,40880,20872,40881,161287,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,65506,65508,65287,65282,12849,8470,8481,12443,12444,11904,11908,11910,11911,11912,11914,11916,11917,11925,11932,11933,11941,11943,11946,11948,11950,11958,11964,11966,11974,11978,11980,11981,11983,11990,11991,11998,12003,null,null,null,643,592,603,596,629,339,248,331,650,618,20034,20060,20981,21274,21378,19975,19980,20039,20109,22231,64012,23662,24435,19983,20871,19982,20014,20115,20162,20169,20168,20888,21244,21356,21433,22304,22787,22828,23568,24063,26081,27571,27596,27668,29247,20017,20028,20200,20188,20201,20193,20189,20186,21004,21276,21324,22306,22307,22807,22831,23425,23428,23570,23611,23668,23667,24068,24192,24194,24521,25097,25168,27669,27702,27715,27711,27707,29358,29360,29578,31160,32906,38430,20238,20248,20268,20213,20244,20209,20224,20215,20232,20253,20226,20229,20258,20243,20228,20212,20242,20913,21011,21001,21008,21158,21282,21279,21325,21386,21511,22241,22239,22318,22314,22324,22844,22912,22908,22917,22907,22910,22903,22911,23382,23573,23589,23676,23674,23675,23678,24031,24181,24196,24322,24346,24436,24533,24532,24527,25180,25182,25188,25185,25190,25186,25177,25184,25178,25189,26095,26094,26430,26425,26424,26427,26426,26431,26428,26419,27672,27718,27730,27740,27727,27722,27732,27723,27724,28785,29278,29364,29365,29582,29994,30335,31349,32593,33400,33404,33408,33405,33407,34381,35198,37017,37015,37016,37019,37012,38434,38436,38432,38435,20310,20283,20322,20297,20307,20324,20286,20327,20306,20319,20289,20312,20269,20275,20287,20321,20879,20921,21020,21022,21025,21165,21166,21257,21347,21362,21390,21391,21552,21559,21546,21588,21573,21529,21532,21541,21528,21565,21583,21569,21544,21540,21575,22254,22247,22245,22337,22341,22348,22345,22347,22354,22790,22848,22950,22936,22944,22935,22926,22946,22928,22927,22951,22945,23438,23442,23592,23594,23693,23695,23688,23691,23689,23698,23690,23686,23699,23701,24032,24074,24078,24203,24201,24204,24200,24205,24325,24349,24440,24438,24530,24529,24528,24557,24552,24558,24563,24545,24548,24547,24570,24559,24567,24571,24576,24564,25146,25219,25228,25230,25231,25236,25223,25201,25211,25210,25200,25217,25224,25207,25213,25202,25204,25911,26096,26100,26099,26098,26101,26437,26439,26457,26453,26444,26440,26461,26445,26458,26443,27600,27673,27674,27768,27751,27755,27780,27787,27791,27761,27759,27753,27802,27757,27783,27797,27804,27750,27763,27749,27771,27790,28788,28794,29283,29375,29373,29379,29382,29377,29370,29381,29589,29591,29587,29588,29586,30010,30009,30100,30101,30337,31037,32820,32917,32921,32912,32914,32924,33424,33423,33413,33422,33425,33427,33418,33411,33412,35960,36809,36799,37023,37025,37029,37022,37031,37024,38448,38440,38447,38445,20019,20376,20348,20357,20349,20352,20359,20342,20340,20361,20356,20343,20300,20375,20330,20378,20345,20353,20344,20368,20380,20372,20382,20370,20354,20373,20331,20334,20894,20924,20926,21045,21042,21043,21062,21041,21180,21258,21259,21308,21394,21396,21639,21631,21633,21649,21634,21640,21611,21626,21630,21605,21612,21620,21606,21645,21615,21601,21600,21656,21603,21607,21604,22263,22265,22383,22386,22381,22379,22385,22384,22390,22400,22389,22395,22387,22388,22370,22376,22397,22796,22853,22965,22970,22991,22990,22962,22988,22977,22966,22972,22979,22998,22961,22973,22976,22984,22964,22983,23394,23397,23443,23445,23620,23623,23726,23716,23712,23733,23727,23720,23724,23711,23715,23725,23714,23722,23719,23709,23717,23734,23728,23718,24087,24084,24089,24360,24354,24355,24356,24404,24450,24446,24445,24542,24549,24621,24614,24601,24626,24587,24628,24586,24599,24627,24602,24606,24620,24610,24589,24592,24622,24595,24593,24588,24585,24604,25108,25149,25261,25268,25297,25278,25258,25270,25290,25262,25267,25263,25275,25257,25264,25272,25917,26024,26043,26121,26108,26116,26130,26120,26107,26115,26123,26125,26117,26109,26129,26128,26358,26378,26501,26476,26510,26514,26486,26491,26520,26502,26500,26484,26509,26508,26490,26527,26513,26521,26499,26493,26497,26488,26489,26516,27429,27520,27518,27614,27677,27795,27884,27883,27886,27865,27830,27860,27821,27879,27831,27856,27842,27834,27843,27846,27885,27890,27858,27869,27828,27786,27805,27776,27870,27840,27952,27853,27847,27824,27897,27855,27881,27857,28820,28824,28805,28819,28806,28804,28817,28822,28802,28826,28803,29290,29398,29387,29400,29385,29404,29394,29396,29402,29388,29393,29604,29601,29613,29606,29602,29600,29612,29597,29917,29928,30015,30016,30014,30092,30104,30383,30451,30449,30448,30453,30712,30716,30713,30715,30714,30711,31042,31039,31173,31352,31355,31483,31861,31997,32821,32911,32942,32931,32952,32949,32941,33312,33440,33472,33451,33434,33432,33435,33461,33447,33454,33468,33438,33466,33460,33448,33441,33449,33474,33444,33475,33462,33442,34416,34415,34413,34414,35926,36818,36811,36819,36813,36822,36821,36823,37042,37044,37039,37043,37040,38457,38461,38460,38458,38467,20429,20421,20435,20402,20425,20427,20417,20436,20444,20441,20411,20403,20443,20423,20438,20410,20416,20409,20460,21060,21065,21184,21186,21309,21372,21399,21398,21401,21400,21690,21665,21677,21669,21711,21699,33549,21687,21678,21718,21686,21701,21702,21664,21616,21692,21666,21694,21618,21726,21680,22453,22430,22431,22436,22412,22423,22429,22427,22420,22424,22415,22425,22437,22426,22421,22772,22797,22867,23009,23006,23022,23040,23025,23005,23034,23037,23036,23030,23012,23026,23031,23003,23017,23027,23029,23008,23038,23028,23021,23464,23628,23760,23768,23756,23767,23755,23771,23774,23770,23753,23751,23754,23766,23763,23764,23759,23752,23750,23758,23775,23800,24057,24097,24098,24099,24096,24100,24240,24228,24226,24219,24227,24229,24327,24366,24406,24454,24631,24633,24660,24690,24670,24645,24659,24647,24649,24667,24652,24640,24642,24671,24612,24644,24664,24678,24686,25154,25155,25295,25357,25355,25333,25358,25347,25323,25337,25359,25356,25336,25334,25344,25363,25364,25338,25365,25339,25328,25921,25923,26026,26047,26166,26145,26162,26165,26140,26150,26146,26163,26155,26170,26141,26164,26169,26158,26383,26384,26561,26610,26568,26554,26588,26555,26616,26584,26560,26551,26565,26603,26596,26591,26549,26573,26547,26615,26614,26606,26595,26562,26553,26574,26599,26608,26546,26620,26566,26605,26572,26542,26598,26587,26618,26569,26570,26563,26602,26571,27432,27522,27524,27574,27606,27608,27616,27680,27681,27944,27956,27949,27935,27964,27967,27922,27914,27866,27955,27908,27929,27962,27930,27921,27904,27933,27970,27905,27928,27959,27907,27919,27968,27911,27936,27948,27912,27938,27913,27920,28855,28831,28862,28849,28848,28833,28852,28853,28841,29249,29257,29258,29292,29296,29299,29294,29386,29412,29416,29419,29407,29418,29414,29411,29573,29644,29634,29640,29637,29625,29622,29621,29620,29675,29631,29639,29630,29635,29638,29624,29643,29932,29934,29998,30023,30024,30119,30122,30329,30404,30472,30467,30468,30469,30474,30455,30459,30458,30695,30696,30726,30737,30738,30725,30736,30735,30734,30729,30723,30739,31050,31052,31051,31045,31044,31189,31181,31183,31190,31182,31360,31358,31441,31488,31489,31866,31864,31865,31871,31872,31873,32003,32008,32001,32600,32657,32653,32702,32775,32782,32783,32788,32823,32984,32967,32992,32977,32968,32962,32976,32965,32995,32985,32988,32970,32981,32969,32975,32983,32998,32973,33279,33313,33428,33497,33534,33529,33543,33512,33536,33493,33594,33515,33494,33524,33516,33505,33522,33525,33548,33531,33526,33520,33514,33508,33504,33530,33523,33517,34423,34420,34428,34419,34881,34894,34919,34922,34921,35283,35332,35335,36210,36835,36833,36846,36832,37105,37053,37055,37077,37061,37054,37063,37067,37064,37332,37331,38484,38479,38481,38483,38474,38478,20510,20485,20487,20499,20514,20528,20507,20469,20468,20531,20535,20524,20470,20471,20503,20508,20512,20519,20533,20527,20529,20494,20826,20884,20883,20938,20932,20933,20936,20942,21089,21082,21074,21086,21087,21077,21090,21197,21262,21406,21798,21730,21783,21778,21735,21747,21732,21786,21759,21764,21768,21739,21777,21765,21745,21770,21755,21751,21752,21728,21774,21763,21771,22273,22274,22476,22578,22485,22482,22458,22470,22461,22460,22456,22454,22463,22471,22480,22457,22465,22798,22858,23065,23062,23085,23086,23061,23055,23063,23050,23070,23091,23404,23463,23469,23468,23555,23638,23636,23788,23807,23790,23793,23799,23808,23801,24105,24104,24232,24238,24234,24236,24371,24368,24423,24669,24666,24679,24641,24738,24712,24704,24722,24705,24733,24707,24725,24731,24727,24711,24732,24718,25113,25158,25330,25360,25430,25388,25412,25413,25398,25411,25572,25401,25419,25418,25404,25385,25409,25396,25432,25428,25433,25389,25415,25395,25434,25425,25400,25431,25408,25416,25930,25926,26054,26051,26052,26050,26186,26207,26183,26193,26386,26387,26655,26650,26697,26674,26675,26683,26699,26703,26646,26673,26652,26677,26667,26669,26671,26702,26692,26676,26653,26642,26644,26662,26664,26670,26701,26682,26661,26656,27436,27439,27437,27441,27444,27501,32898,27528,27622,27620,27624,27619,27618,27623,27685,28026,28003,28004,28022,27917,28001,28050,27992,28002,28013,28015,28049,28045,28143,28031,28038,27998,28007,28000,28055,28016,28028,27999,28034,28056,27951,28008,28043,28030,28032,28036,27926,28035,28027,28029,28021,28048,28892,28883,28881,28893,28875,32569,28898,28887,28882,28894,28896,28884,28877,28869,28870,28871,28890,28878,28897,29250,29304,29303,29302,29440,29434,29428,29438,29430,29427,29435,29441,29651,29657,29669,29654,29628,29671,29667,29673,29660,29650,29659,29652,29661,29658,29655,29656,29672,29918,29919,29940,29941,29985,30043,30047,30128,30145,30139,30148,30144,30143,30134,30138,30346,30409,30493,30491,30480,30483,30482,30499,30481,30485,30489,30490,30498,30503,30755,30764,30754,30773,30767,30760,30766,30763,30753,30761,30771,30762,30769,31060,31067,31055,31068,31059,31058,31057,31211,31212,31200,31214,31213,31210,31196,31198,31197,31366,31369,31365,31371,31372,31370,31367,31448,31504,31492,31507,31493,31503,31496,31498,31502,31497,31506,31876,31889,31882,31884,31880,31885,31877,32030,32029,32017,32014,32024,32022,32019,32031,32018,32015,32012,32604,32609,32606,32608,32605,32603,32662,32658,32707,32706,32704,32790,32830,32825,33018,33010,33017,33013,33025,33019,33024,33281,33327,33317,33587,33581,33604,33561,33617,33573,33622,33599,33601,33574,33564,33570,33602,33614,33563,33578,33544,33596,33613,33558,33572,33568,33591,33583,33577,33607,33605,33612,33619,33566,33580,33611,33575,33608,34387,34386,34466,34472,34454,34445,34449,34462,34439,34455,34438,34443,34458,34437,34469,34457,34465,34471,34453,34456,34446,34461,34448,34452,34883,34884,34925,34933,34934,34930,34944,34929,34943,34927,34947,34942,34932,34940,35346,35911,35927,35963,36004,36003,36214,36216,36277,36279,36278,36561,36563,36862,36853,36866,36863,36859,36868,36860,36854,37078,37088,37081,37082,37091,37087,37093,37080,37083,37079,37084,37092,37200,37198,37199,37333,37346,37338,38492,38495,38588,39139,39647,39727,20095,20592,20586,20577,20574,20576,20563,20555,20573,20594,20552,20557,20545,20571,20554,20578,20501,20549,20575,20585,20587,20579,20580,20550,20544,20590,20595,20567,20561,20944,21099,21101,21100,21102,21206,21203,21293,21404,21877,21878,21820,21837,21840,21812,21802,21841,21858,21814,21813,21808,21842,21829,21772,21810,21861,21838,21817,21832,21805,21819,21824,21835,22282,22279,22523,22548,22498,22518,22492,22516,22528,22509,22525,22536,22520,22539,22515,22479,22535,22510,22499,22514,22501,22508,22497,22542,22524,22544,22503,22529,22540,22513,22505,22512,22541,22532,22876,23136,23128,23125,23143,23134,23096,23093,23149,23120,23135,23141,23148,23123,23140,23127,23107,23133,23122,23108,23131,23112,23182,23102,23117,23097,23116,23152,23145,23111,23121,23126,23106,23132,23410,23406,23489,23488,23641,23838,23819,23837,23834,23840,23820,23848,23821,23846,23845,23823,23856,23826,23843,23839,23854,24126,24116,24241,24244,24249,24242,24243,24374,24376,24475,24470,24479,24714,24720,24710,24766,24752,24762,24787,24788,24783,24804,24793,24797,24776,24753,24795,24759,24778,24767,24771,24781,24768,25394,25445,25482,25474,25469,25533,25502,25517,25501,25495,25515,25486,25455,25479,25488,25454,25519,25461,25500,25453,25518,25468,25508,25403,25503,25464,25477,25473,25489,25485,25456,25939,26061,26213,26209,26203,26201,26204,26210,26392,26745,26759,26768,26780,26733,26734,26798,26795,26966,26735,26787,26796,26793,26741,26740,26802,26767,26743,26770,26748,26731,26738,26794,26752,26737,26750,26779,26774,26763,26784,26761,26788,26744,26747,26769,26764,26762,26749,27446,27443,27447,27448,27537,27535,27533,27534,27532,27690,28096,28075,28084,28083,28276,28076,28137,28130,28087,28150,28116,28160,28104,28128,28127,28118,28094,28133,28124,28125,28123,28148,28106,28093,28141,28144,28090,28117,28098,28111,28105,28112,28146,28115,28157,28119,28109,28131,28091,28922,28941,28919,28951,28916,28940,28912,28932,28915,28944,28924,28927,28934,28947,28928,28920,28918,28939,28930,28942,29310,29307,29308,29311,29469,29463,29447,29457,29464,29450,29448,29439,29455,29470,29576,29686,29688,29685,29700,29697,29693,29703,29696,29690,29692,29695,29708,29707,29684,29704,30052,30051,30158,30162,30159,30155,30156,30161,30160,30351,30345,30419,30521,30511,30509,30513,30514,30516,30515,30525,30501,30523,30517,30792,30802,30793,30797,30794,30796,30758,30789,30800,31076,31079,31081,31082,31075,31083,31073,31163,31226,31224,31222,31223,31375,31380,31376,31541,31559,31540,31525,31536,31522,31524,31539,31512,31530,31517,31537,31531,31533,31535,31538,31544,31514,31523,31892,31896,31894,31907,32053,32061,32056,32054,32058,32069,32044,32041,32065,32071,32062,32063,32074,32059,32040,32611,32661,32668,32669,32667,32714,32715,32717,32720,32721,32711,32719,32713,32799,32798,32795,32839,32835,32840,33048,33061,33049,33051,33069,33055,33068,33054,33057,33045,33063,33053,33058,33297,33336,33331,33338,33332,33330,33396,33680,33699,33704,33677,33658,33651,33700,33652,33679,33665,33685,33689,33653,33684,33705,33661,33667,33676,33693,33691,33706,33675,33662,33701,33711,33672,33687,33712,33663,33702,33671,33710,33654,33690,34393,34390,34495,34487,34498,34497,34501,34490,34480,34504,34489,34483,34488,34508,34484,34491,34492,34499,34493,34494,34898,34953,34965,34984,34978,34986,34970,34961,34977,34975,34968,34983,34969,34971,34967,34980,34988,34956,34963,34958,35202,35286,35289,35285,35376,35367,35372,35358,35897,35899,35932,35933,35965,36005,36221,36219,36217,36284,36290,36281,36287,36289,36568,36574,36573,36572,36567,36576,36577,36900,36875,36881,36892,36876,36897,37103,37098,37104,37108,37106,37107,37076,37099,37100,37097,37206,37208,37210,37203,37205,37356,37364,37361,37363,37368,37348,37369,37354,37355,37367,37352,37358,38266,38278,38280,38524,38509,38507,38513,38511,38591,38762,38916,39141,39319,20635,20629,20628,20638,20619,20643,20611,20620,20622,20637,20584,20636,20626,20610,20615,20831,20948,21266,21265,21412,21415,21905,21928,21925,21933,21879,22085,21922,21907,21896,21903,21941,21889,21923,21906,21924,21885,21900,21926,21887,21909,21921,21902,22284,22569,22583,22553,22558,22567,22563,22568,22517,22600,22565,22556,22555,22579,22591,22582,22574,22585,22584,22573,22572,22587,22881,23215,23188,23199,23162,23202,23198,23160,23206,23164,23205,23212,23189,23214,23095,23172,23178,23191,23171,23179,23209,23163,23165,23180,23196,23183,23187,23197,23530,23501,23499,23508,23505,23498,23502,23564,23600,23863,23875,23915,23873,23883,23871,23861,23889,23886,23893,23859,23866,23890,23869,23857,23897,23874,23865,23881,23864,23868,23858,23862,23872,23877,24132,24129,24408,24486,24485,24491,24777,24761,24780,24802,24782,24772,24852,24818,24842,24854,24837,24821,24851,24824,24828,24830,24769,24835,24856,24861,24848,24831,24836,24843,25162,25492,25521,25520,25550,25573,25576,25583,25539,25757,25587,25546,25568,25590,25557,25586,25589,25697,25567,25534,25565,25564,25540,25560,25555,25538,25543,25548,25547,25544,25584,25559,25561,25906,25959,25962,25956,25948,25960,25957,25996,26013,26014,26030,26064,26066,26236,26220,26235,26240,26225,26233,26218,26226,26369,26892,26835,26884,26844,26922,26860,26858,26865,26895,26838,26871,26859,26852,26870,26899,26896,26867,26849,26887,26828,26888,26992,26804,26897,26863,26822,26900,26872,26832,26877,26876,26856,26891,26890,26903,26830,26824,26845,26846,26854,26868,26833,26886,26836,26857,26901,26917,26823,27449,27451,27455,27452,27540,27543,27545,27541,27581,27632,27634,27635,27696,28156,28230,28231,28191,28233,28296,28220,28221,28229,28258,28203,28223,28225,28253,28275,28188,28211,28235,28224,28241,28219,28163,28206,28254,28264,28252,28257,28209,28200,28256,28273,28267,28217,28194,28208,28243,28261,28199,28280,28260,28279,28245,28281,28242,28262,28213,28214,28250,28960,28958,28975,28923,28974,28977,28963,28965,28962,28978,28959,28968,28986,28955,29259,29274,29320,29321,29318,29317,29323,29458,29451,29488,29474,29489,29491,29479,29490,29485,29478,29475,29493,29452,29742,29740,29744,29739,29718,29722,29729,29741,29745,29732,29731,29725,29737,29728,29746,29947,29999,30063,30060,30183,30170,30177,30182,30173,30175,30180,30167,30357,30354,30426,30534,30535,30532,30541,30533,30538,30542,30539,30540,30686,30700,30816,30820,30821,30812,30829,30833,30826,30830,30832,30825,30824,30814,30818,31092,31091,31090,31088,31234,31242,31235,31244,31236,31385,31462,31460,31562,31547,31556,31560,31564,31566,31552,31576,31557,31906,31902,31912,31905,32088,32111,32099,32083,32086,32103,32106,32079,32109,32092,32107,32082,32084,32105,32081,32095,32078,32574,32575,32613,32614,32674,32672,32673,32727,32849,32847,32848,33022,32980,33091,33098,33106,33103,33095,33085,33101,33082,33254,33262,33271,33272,33273,33284,33340,33341,33343,33397,33595,33743,33785,33827,33728,33768,33810,33767,33764,33788,33782,33808,33734,33736,33771,33763,33727,33793,33757,33765,33752,33791,33761,33739,33742,33750,33781,33737,33801,33807,33758,33809,33798,33730,33779,33749,33786,33735,33745,33770,33811,33731,33772,33774,33732,33787,33751,33762,33819,33755,33790,34520,34530,34534,34515,34531,34522,34538,34525,34539,34524,34540,34537,34519,34536,34513,34888,34902,34901,35002,35031,35001,35000,35008,35006,34998,35004,34999,35005,34994,35073,35017,35221,35224,35223,35293,35290,35291,35406,35405,35385,35417,35392,35415,35416,35396,35397,35410,35400,35409,35402,35404,35407,35935,35969,35968,36026,36030,36016,36025,36021,36228,36224,36233,36312,36307,36301,36295,36310,36316,36303,36309,36313,36296,36311,36293,36591,36599,36602,36601,36582,36590,36581,36597,36583,36584,36598,36587,36593,36588,36596,36585,36909,36916,36911,37126,37164,37124,37119,37116,37128,37113,37115,37121,37120,37127,37125,37123,37217,37220,37215,37218,37216,37377,37386,37413,37379,37402,37414,37391,37388,37376,37394,37375,37373,37382,37380,37415,37378,37404,37412,37401,37399,37381,37398,38267,38285,38284,38288,38535,38526,38536,38537,38531,38528,38594,38600,38595,38641,38640,38764,38768,38766,38919,39081,39147,40166,40697,20099,20100,20150,20669,20671,20678,20654,20676,20682,20660,20680,20674,20656,20673,20666,20657,20683,20681,20662,20664,20951,21114,21112,21115,21116,21955,21979,21964,21968,21963,21962,21981,21952,21972,21956,21993,21951,21970,21901,21967,21973,21986,21974,21960,22002,21965,21977,21954,22292,22611,22632,22628,22607,22605,22601,22639,22613,22606,22621,22617,22629,22619,22589,22627,22641,22780,23239,23236,23243,23226,23224,23217,23221,23216,23231,23240,23227,23238,23223,23232,23242,23220,23222,23245,23225,23184,23510,23512,23513,23583,23603,23921,23907,23882,23909,23922,23916,23902,23912,23911,23906,24048,24143,24142,24138,24141,24139,24261,24268,24262,24267,24263,24384,24495,24493,24823,24905,24906,24875,24901,24886,24882,24878,24902,24879,24911,24873,24896,25120,37224,25123,25125,25124,25541,25585,25579,25616,25618,25609,25632,25636,25651,25667,25631,25621,25624,25657,25655,25634,25635,25612,25638,25648,25640,25665,25653,25647,25610,25626,25664,25637,25639,25611,25575,25627,25646,25633,25614,25967,26002,26067,26246,26252,26261,26256,26251,26250,26265,26260,26232,26400,26982,26975,26936,26958,26978,26993,26943,26949,26986,26937,26946,26967,26969,27002,26952,26953,26933,26988,26931,26941,26981,26864,27000,26932,26985,26944,26991,26948,26998,26968,26945,26996,26956,26939,26955,26935,26972,26959,26961,26930,26962,26927,27003,26940,27462,27461,27459,27458,27464,27457,27547,64013,27643,27644,27641,27639,27640,28315,28374,28360,28303,28352,28319,28307,28308,28320,28337,28345,28358,28370,28349,28353,28318,28361,28343,28336,28365,28326,28367,28338,28350,28355,28380,28376,28313,28306,28302,28301,28324,28321,28351,28339,28368,28362,28311,28334,28323,28999,29012,29010,29027,29024,28993,29021,29026,29042,29048,29034,29025,28994,29016,28995,29003,29040,29023,29008,29011,28996,29005,29018,29263,29325,29324,29329,29328,29326,29500,29506,29499,29498,29504,29514,29513,29764,29770,29771,29778,29777,29783,29760,29775,29776,29774,29762,29766,29773,29780,29921,29951,29950,29949,29981,30073,30071,27011,30191,30223,30211,30199,30206,30204,30201,30200,30224,30203,30198,30189,30197,30205,30361,30389,30429,30549,30559,30560,30546,30550,30554,30569,30567,30548,30553,30573,30688,30855,30874,30868,30863,30852,30869,30853,30854,30881,30851,30841,30873,30848,30870,30843,31100,31106,31101,31097,31249,31256,31257,31250,31255,31253,31266,31251,31259,31248,31395,31394,31390,31467,31590,31588,31597,31604,31593,31602,31589,31603,31601,31600,31585,31608,31606,31587,31922,31924,31919,32136,32134,32128,32141,32127,32133,32122,32142,32123,32131,32124,32140,32148,32132,32125,32146,32621,32619,32615,32616,32620,32678,32677,32679,32731,32732,32801,33124,33120,33143,33116,33129,33115,33122,33138,26401,33118,33142,33127,33135,33092,33121,33309,33353,33348,33344,33346,33349,34033,33855,33878,33910,33913,33935,33933,33893,33873,33856,33926,33895,33840,33869,33917,33882,33881,33908,33907,33885,34055,33886,33847,33850,33844,33914,33859,33912,33842,33861,33833,33753,33867,33839,33858,33837,33887,33904,33849,33870,33868,33874,33903,33989,33934,33851,33863,33846,33843,33896,33918,33860,33835,33888,33876,33902,33872,34571,34564,34551,34572,34554,34518,34549,34637,34552,34574,34569,34561,34550,34573,34565,35030,35019,35021,35022,35038,35035,35034,35020,35024,35205,35227,35295,35301,35300,35297,35296,35298,35292,35302,35446,35462,35455,35425,35391,35447,35458,35460,35445,35459,35457,35444,35450,35900,35915,35914,35941,35940,35942,35974,35972,35973,36044,36200,36201,36241,36236,36238,36239,36237,36243,36244,36240,36242,36336,36320,36332,36337,36334,36304,36329,36323,36322,36327,36338,36331,36340,36614,36607,36609,36608,36613,36615,36616,36610,36619,36946,36927,36932,36937,36925,37136,37133,37135,37137,37142,37140,37131,37134,37230,37231,37448,37458,37424,37434,37478,37427,37477,37470,37507,37422,37450,37446,37485,37484,37455,37472,37479,37487,37430,37473,37488,37425,37460,37475,37456,37490,37454,37459,37452,37462,37426,38303,38300,38302,38299,38546,38547,38545,38551,38606,38650,38653,38648,38645,38771,38775,38776,38770,38927,38925,38926,39084,39158,39161,39343,39346,39344,39349,39597,39595,39771,40170,40173,40167,40576,40701,20710,20692,20695,20712,20723,20699,20714,20701,20708,20691,20716,20720,20719,20707,20704,20952,21120,21121,21225,21227,21296,21420,22055,22037,22028,22034,22012,22031,22044,22017,22035,22018,22010,22045,22020,22015,22009,22665,22652,22672,22680,22662,22657,22655,22644,22667,22650,22663,22673,22670,22646,22658,22664,22651,22676,22671,22782,22891,23260,23278,23269,23253,23274,23258,23277,23275,23283,23266,23264,23259,23276,23262,23261,23257,23272,23263,23415,23520,23523,23651,23938,23936,23933,23942,23930,23937,23927,23946,23945,23944,23934,23932,23949,23929,23935,24152,24153,24147,24280,24273,24279,24270,24284,24277,24281,24274,24276,24388,24387,24431,24502,24876,24872,24897,24926,24945,24947,24914,24915,24946,24940,24960,24948,24916,24954,24923,24933,24891,24938,24929,24918,25129,25127,25131,25643,25677,25691,25693,25716,25718,25714,25715,25725,25717,25702,25766,25678,25730,25694,25692,25675,25683,25696,25680,25727,25663,25708,25707,25689,25701,25719,25971,26016,26273,26272,26271,26373,26372,26402,27057,27062,27081,27040,27086,27030,27056,27052,27068,27025,27033,27022,27047,27021,27049,27070,27055,27071,27076,27069,27044,27092,27065,27082,27034,27087,27059,27027,27050,27041,27038,27097,27031,27024,27074,27061,27045,27078,27466,27469,27467,27550,27551,27552,27587,27588,27646,28366,28405,28401,28419,28453,28408,28471,28411,28462,28425,28494,28441,28442,28455,28440,28475,28434,28397,28426,28470,28531,28409,28398,28461,28480,28464,28476,28469,28395,28423,28430,28483,28421,28413,28406,28473,28444,28412,28474,28447,28429,28446,28424,28449,29063,29072,29065,29056,29061,29058,29071,29051,29062,29057,29079,29252,29267,29335,29333,29331,29507,29517,29521,29516,29794,29811,29809,29813,29810,29799,29806,29952,29954,29955,30077,30096,30230,30216,30220,30229,30225,30218,30228,30392,30593,30588,30597,30594,30574,30592,30575,30590,30595,30898,30890,30900,30893,30888,30846,30891,30878,30885,30880,30892,30882,30884,31128,31114,31115,31126,31125,31124,31123,31127,31112,31122,31120,31275,31306,31280,31279,31272,31270,31400,31403,31404,31470,31624,31644,31626,31633,31632,31638,31629,31628,31643,31630,31621,31640,21124,31641,31652,31618,31931,31935,31932,31930,32167,32183,32194,32163,32170,32193,32192,32197,32157,32206,32196,32198,32203,32204,32175,32185,32150,32188,32159,32166,32174,32169,32161,32201,32627,32738,32739,32741,32734,32804,32861,32860,33161,33158,33155,33159,33165,33164,33163,33301,33943,33956,33953,33951,33978,33998,33986,33964,33966,33963,33977,33972,33985,33997,33962,33946,33969,34000,33949,33959,33979,33954,33940,33991,33996,33947,33961,33967,33960,34006,33944,33974,33999,33952,34007,34004,34002,34011,33968,33937,34401,34611,34595,34600,34667,34624,34606,34590,34593,34585,34587,34627,34604,34625,34622,34630,34592,34610,34602,34605,34620,34578,34618,34609,34613,34626,34598,34599,34616,34596,34586,34608,34577,35063,35047,35057,35058,35066,35070,35054,35068,35062,35067,35056,35052,35051,35229,35233,35231,35230,35305,35307,35304,35499,35481,35467,35474,35471,35478,35901,35944,35945,36053,36047,36055,36246,36361,36354,36351,36365,36349,36362,36355,36359,36358,36357,36350,36352,36356,36624,36625,36622,36621,37155,37148,37152,37154,37151,37149,37146,37156,37153,37147,37242,37234,37241,37235,37541,37540,37494,37531,37498,37536,37524,37546,37517,37542,37530,37547,37497,37527,37503,37539,37614,37518,37506,37525,37538,37501,37512,37537,37514,37510,37516,37529,37543,37502,37511,37545,37533,37515,37421,38558,38561,38655,38744,38781,38778,38782,38787,38784,38786,38779,38788,38785,38783,38862,38861,38934,39085,39086,39170,39168,39175,39325,39324,39363,39353,39355,39354,39362,39357,39367,39601,39651,39655,39742,39743,39776,39777,39775,40177,40178,40181,40615,20735,20739,20784,20728,20742,20743,20726,20734,20747,20748,20733,20746,21131,21132,21233,21231,22088,22082,22092,22069,22081,22090,22089,22086,22104,22106,22080,22067,22077,22060,22078,22072,22058,22074,22298,22699,22685,22705,22688,22691,22703,22700,22693,22689,22783,23295,23284,23293,23287,23286,23299,23288,23298,23289,23297,23303,23301,23311,23655,23961,23959,23967,23954,23970,23955,23957,23968,23964,23969,23962,23966,24169,24157,24160,24156,32243,24283,24286,24289,24393,24498,24971,24963,24953,25009,25008,24994,24969,24987,24979,25007,25005,24991,24978,25002,24993,24973,24934,25011,25133,25710,25712,25750,25760,25733,25751,25756,25743,25739,25738,25740,25763,25759,25704,25777,25752,25974,25978,25977,25979,26034,26035,26293,26288,26281,26290,26295,26282,26287,27136,27142,27159,27109,27128,27157,27121,27108,27168,27135,27116,27106,27163,27165,27134,27175,27122,27118,27156,27127,27111,27200,27144,27110,27131,27149,27132,27115,27145,27140,27160,27173,27151,27126,27174,27143,27124,27158,27473,27557,27555,27554,27558,27649,27648,27647,27650,28481,28454,28542,28551,28614,28562,28557,28553,28556,28514,28495,28549,28506,28566,28534,28524,28546,28501,28530,28498,28496,28503,28564,28563,28509,28416,28513,28523,28541,28519,28560,28499,28555,28521,28543,28565,28515,28535,28522,28539,29106,29103,29083,29104,29088,29082,29097,29109,29085,29093,29086,29092,29089,29098,29084,29095,29107,29336,29338,29528,29522,29534,29535,29536,29533,29531,29537,29530,29529,29538,29831,29833,29834,29830,29825,29821,29829,29832,29820,29817,29960,29959,30078,30245,30238,30233,30237,30236,30243,30234,30248,30235,30364,30365,30366,30363,30605,30607,30601,30600,30925,30907,30927,30924,30929,30926,30932,30920,30915,30916,30921,31130,31137,31136,31132,31138,31131,27510,31289,31410,31412,31411,31671,31691,31678,31660,31694,31663,31673,31690,31669,31941,31944,31948,31947,32247,32219,32234,32231,32215,32225,32259,32250,32230,32246,32241,32240,32238,32223,32630,32684,32688,32685,32749,32747,32746,32748,32742,32744,32868,32871,33187,33183,33182,33173,33186,33177,33175,33302,33359,33363,33362,33360,33358,33361,34084,34107,34063,34048,34089,34062,34057,34061,34079,34058,34087,34076,34043,34091,34042,34056,34060,34036,34090,34034,34069,34039,34027,34035,34044,34066,34026,34025,34070,34046,34088,34077,34094,34050,34045,34078,34038,34097,34086,34023,34024,34032,34031,34041,34072,34080,34096,34059,34073,34095,34402,34646,34659,34660,34679,34785,34675,34648,34644,34651,34642,34657,34650,34641,34654,34669,34666,34640,34638,34655,34653,34671,34668,34682,34670,34652,34661,34639,34683,34677,34658,34663,34665,34906,35077,35084,35092,35083,35095,35096,35097,35078,35094,35089,35086,35081,35234,35236,35235,35309,35312,35308,35535,35526,35512,35539,35537,35540,35541,35515,35543,35518,35520,35525,35544,35523,35514,35517,35545,35902,35917,35983,36069,36063,36057,36072,36058,36061,36071,36256,36252,36257,36251,36384,36387,36389,36388,36398,36373,36379,36374,36369,36377,36390,36391,36372,36370,36376,36371,36380,36375,36378,36652,36644,36632,36634,36640,36643,36630,36631,36979,36976,36975,36967,36971,37167,37163,37161,37162,37170,37158,37166,37253,37254,37258,37249,37250,37252,37248,37584,37571,37572,37568,37593,37558,37583,37617,37599,37592,37609,37591,37597,37580,37615,37570,37608,37578,37576,37582,37606,37581,37589,37577,37600,37598,37607,37585,37587,37557,37601,37574,37556,38268,38316,38315,38318,38320,38564,38562,38611,38661,38664,38658,38746,38794,38798,38792,38864,38863,38942,38941,38950,38953,38952,38944,38939,38951,39090,39176,39162,39185,39188,39190,39191,39189,39388,39373,39375,39379,39380,39374,39369,39382,39384,39371,39383,39372,39603,39660,39659,39667,39666,39665,39750,39747,39783,39796,39793,39782,39798,39797,39792,39784,39780,39788,40188,40186,40189,40191,40183,40199,40192,40185,40187,40200,40197,40196,40579,40659,40719,40720,20764,20755,20759,20762,20753,20958,21300,21473,22128,22112,22126,22131,22118,22115,22125,22130,22110,22135,22300,22299,22728,22717,22729,22719,22714,22722,22716,22726,23319,23321,23323,23329,23316,23315,23312,23318,23336,23322,23328,23326,23535,23980,23985,23977,23975,23989,23984,23982,23978,23976,23986,23981,23983,23988,24167,24168,24166,24175,24297,24295,24294,24296,24293,24395,24508,24989,25000,24982,25029,25012,25030,25025,25036,25018,25023,25016,24972,25815,25814,25808,25807,25801,25789,25737,25795,25819,25843,25817,25907,25983,25980,26018,26312,26302,26304,26314,26315,26319,26301,26299,26298,26316,26403,27188,27238,27209,27239,27186,27240,27198,27229,27245,27254,27227,27217,27176,27226,27195,27199,27201,27242,27236,27216,27215,27220,27247,27241,27232,27196,27230,27222,27221,27213,27214,27206,27477,27476,27478,27559,27562,27563,27592,27591,27652,27651,27654,28589,28619,28579,28615,28604,28622,28616,28510,28612,28605,28574,28618,28584,28676,28581,28590,28602,28588,28586,28623,28607,28600,28578,28617,28587,28621,28591,28594,28592,29125,29122,29119,29112,29142,29120,29121,29131,29140,29130,29127,29135,29117,29144,29116,29126,29146,29147,29341,29342,29545,29542,29543,29548,29541,29547,29546,29823,29850,29856,29844,29842,29845,29857,29963,30080,30255,30253,30257,30269,30259,30268,30261,30258,30256,30395,30438,30618,30621,30625,30620,30619,30626,30627,30613,30617,30615,30941,30953,30949,30954,30942,30947,30939,30945,30946,30957,30943,30944,31140,31300,31304,31303,31414,31416,31413,31409,31415,31710,31715,31719,31709,31701,31717,31706,31720,31737,31700,31722,31714,31708,31723,31704,31711,31954,31956,31959,31952,31953,32274,32289,32279,32268,32287,32288,32275,32270,32284,32277,32282,32290,32267,32271,32278,32269,32276,32293,32292,32579,32635,32636,32634,32689,32751,32810,32809,32876,33201,33190,33198,33209,33205,33195,33200,33196,33204,33202,33207,33191,33266,33365,33366,33367,34134,34117,34155,34125,34131,34145,34136,34112,34118,34148,34113,34146,34116,34129,34119,34147,34110,34139,34161,34126,34158,34165,34133,34151,34144,34188,34150,34141,34132,34149,34156,34403,34405,34404,34715,34703,34711,34707,34706,34696,34689,34710,34712,34681,34695,34723,34693,34704,34705,34717,34692,34708,34716,34714,34697,35102,35110,35120,35117,35118,35111,35121,35106,35113,35107,35119,35116,35103,35313,35552,35554,35570,35572,35573,35549,35604,35556,35551,35568,35528,35550,35553,35560,35583,35567,35579,35985,35986,35984,36085,36078,36081,36080,36083,36204,36206,36261,36263,36403,36414,36408,36416,36421,36406,36412,36413,36417,36400,36415,36541,36662,36654,36661,36658,36665,36663,36660,36982,36985,36987,36998,37114,37171,37173,37174,37267,37264,37265,37261,37263,37671,37662,37640,37663,37638,37647,37754,37688,37692,37659,37667,37650,37633,37702,37677,37646,37645,37579,37661,37626,37669,37651,37625,37623,37684,37634,37668,37631,37673,37689,37685,37674,37652,37644,37643,37630,37641,37632,37627,37654,38332,38349,38334,38329,38330,38326,38335,38325,38333,38569,38612,38667,38674,38672,38809,38807,38804,38896,38904,38965,38959,38962,39204,39199,39207,39209,39326,39406,39404,39397,39396,39408,39395,39402,39401,39399,39609,39615,39604,39611,39670,39674,39673,39671,39731,39808,39813,39815,39804,39806,39803,39810,39827,39826,39824,39802,39829,39805,39816,40229,40215,40224,40222,40212,40233,40221,40216,40226,40208,40217,40223,40584,40582,40583,40622,40621,40661,40662,40698,40722,40765,20774,20773,20770,20772,20768,20777,21236,22163,22156,22157,22150,22148,22147,22142,22146,22143,22145,22742,22740,22735,22738,23341,23333,23346,23331,23340,23335,23334,23343,23342,23419,23537,23538,23991,24172,24170,24510,24507,25027,25013,25020,25063,25056,25061,25060,25064,25054,25839,25833,25827,25835,25828,25832,25985,25984,26038,26074,26322,27277,27286,27265,27301,27273,27295,27291,27297,27294,27271,27283,27278,27285,27267,27304,27300,27281,27263,27302,27290,27269,27276,27282,27483,27565,27657,28620,28585,28660,28628,28643,28636,28653,28647,28646,28638,28658,28637,28642,28648,29153,29169,29160,29170,29156,29168,29154,29555,29550,29551,29847,29874,29867,29840,29866,29869,29873,29861,29871,29968,29969,29970,29967,30084,30275,30280,30281,30279,30372,30441,30645,30635,30642,30647,30646,30644,30641,30632,30704,30963,30973,30978,30971,30972,30962,30981,30969,30974,30980,31147,31144,31324,31323,31318,31320,31316,31322,31422,31424,31425,31749,31759,31730,31744,31743,31739,31758,31732,31755,31731,31746,31753,31747,31745,31736,31741,31750,31728,31729,31760,31754,31976,32301,32316,32322,32307,38984,32312,32298,32329,32320,32327,32297,32332,32304,32315,32310,32324,32314,32581,32639,32638,32637,32756,32754,32812,33211,33220,33228,33226,33221,33223,33212,33257,33371,33370,33372,34179,34176,34191,34215,34197,34208,34187,34211,34171,34212,34202,34206,34167,34172,34185,34209,34170,34168,34135,34190,34198,34182,34189,34201,34205,34177,34210,34178,34184,34181,34169,34166,34200,34192,34207,34408,34750,34730,34733,34757,34736,34732,34745,34741,34748,34734,34761,34755,34754,34764,34743,34735,34756,34762,34740,34742,34751,34744,34749,34782,34738,35125,35123,35132,35134,35137,35154,35127,35138,35245,35247,35246,35314,35315,35614,35608,35606,35601,35589,35595,35618,35599,35602,35605,35591,35597,35592,35590,35612,35603,35610,35919,35952,35954,35953,35951,35989,35988,36089,36207,36430,36429,36435,36432,36428,36423,36675,36672,36997,36990,37176,37274,37282,37275,37273,37279,37281,37277,37280,37793,37763,37807,37732,37718,37703,37756,37720,37724,37750,37705,37712,37713,37728,37741,37775,37708,37738,37753,37719,37717,37714,37711,37745,37751,37755,37729,37726,37731,37735,37760,37710,37721,38343,38336,38345,38339,38341,38327,38574,38576,38572,38688,38687,38680,38685,38681,38810,38817,38812,38814,38813,38869,38868,38897,38977,38980,38986,38985,38981,38979,39205,39211,39212,39210,39219,39218,39215,39213,39217,39216,39320,39331,39329,39426,39418,39412,39415,39417,39416,39414,39419,39421,39422,39420,39427,39614,39678,39677,39681,39676,39752,39834,39848,39838,39835,39846,39841,39845,39844,39814,39842,39840,39855,40243,40257,40295,40246,40238,40239,40241,40248,40240,40261,40258,40259,40254,40247,40256,40253,32757,40237,40586,40585,40589,40624,40648,40666,40699,40703,40740,40739,40738,40788,40864,20785,20781,20782,22168,22172,22167,22170,22173,22169,22896,23356,23657,23658,24000,24173,24174,25048,25055,25069,25070,25073,25066,25072,25067,25046,25065,25855,25860,25853,25848,25857,25859,25852,26004,26075,26330,26331,26328,27333,27321,27325,27361,27334,27322,27318,27319,27335,27316,27309,27486,27593,27659,28679,28684,28685,28673,28677,28692,28686,28671,28672,28667,28710,28668,28663,28682,29185,29183,29177,29187,29181,29558,29880,29888,29877,29889,29886,29878,29883,29890,29972,29971,30300,30308,30297,30288,30291,30295,30298,30374,30397,30444,30658,30650,30975,30988,30995,30996,30985,30992,30994,30993,31149,31148,31327,31772,31785,31769,31776,31775,31789,31773,31782,31784,31778,31781,31792,32348,32336,32342,32355,32344,32354,32351,32337,32352,32343,32339,32693,32691,32759,32760,32885,33233,33234,33232,33375,33374,34228,34246,34240,34243,34242,34227,34229,34237,34247,34244,34239,34251,34254,34248,34245,34225,34230,34258,34340,34232,34231,34238,34409,34791,34790,34786,34779,34795,34794,34789,34783,34803,34788,34772,34780,34771,34797,34776,34787,34724,34775,34777,34817,34804,34792,34781,35155,35147,35151,35148,35142,35152,35153,35145,35626,35623,35619,35635,35632,35637,35655,35631,35644,35646,35633,35621,35639,35622,35638,35630,35620,35643,35645,35642,35906,35957,35993,35992,35991,36094,36100,36098,36096,36444,36450,36448,36439,36438,36446,36453,36455,36443,36442,36449,36445,36457,36436,36678,36679,36680,36683,37160,37178,37179,37182,37288,37285,37287,37295,37290,37813,37772,37778,37815,37787,37789,37769,37799,37774,37802,37790,37798,37781,37768,37785,37791,37773,37809,37777,37810,37796,37800,37812,37795,37797,38354,38355,38353,38579,38615,38618,24002,38623,38616,38621,38691,38690,38693,38828,38830,38824,38827,38820,38826,38818,38821,38871,38873,38870,38872,38906,38992,38993,38994,39096,39233,39228,39226,39439,39435,39433,39437,39428,39441,39434,39429,39431,39430,39616,39644,39688,39684,39685,39721,39733,39754,39756,39755,39879,39878,39875,39871,39873,39861,39864,39891,39862,39876,39865,39869,40284,40275,40271,40266,40283,40267,40281,40278,40268,40279,40274,40276,40287,40280,40282,40590,40588,40671,40705,40704,40726,40741,40747,40746,40745,40744,40780,40789,20788,20789,21142,21239,21428,22187,22189,22182,22183,22186,22188,22746,22749,22747,22802,23357,23358,23359,24003,24176,24511,25083,25863,25872,25869,25865,25868,25870,25988,26078,26077,26334,27367,27360,27340,27345,27353,27339,27359,27356,27344,27371,27343,27341,27358,27488,27568,27660,28697,28711,28704,28694,28715,28705,28706,28707,28713,28695,28708,28700,28714,29196,29194,29191,29186,29189,29349,29350,29348,29347,29345,29899,29893,29879,29891,29974,30304,30665,30666,30660,30705,31005,31003,31009,31004,30999,31006,31152,31335,31336,31795,31804,31801,31788,31803,31980,31978,32374,32373,32376,32368,32375,32367,32378,32370,32372,32360,32587,32586,32643,32646,32695,32765,32766,32888,33239,33237,33380,33377,33379,34283,34289,34285,34265,34273,34280,34266,34263,34284,34290,34296,34264,34271,34275,34268,34257,34288,34278,34287,34270,34274,34816,34810,34819,34806,34807,34825,34828,34827,34822,34812,34824,34815,34826,34818,35170,35162,35163,35159,35169,35164,35160,35165,35161,35208,35255,35254,35318,35664,35656,35658,35648,35667,35670,35668,35659,35669,35665,35650,35666,35671,35907,35959,35958,35994,36102,36103,36105,36268,36266,36269,36267,36461,36472,36467,36458,36463,36475,36546,36690,36689,36687,36688,36691,36788,37184,37183,37296,37293,37854,37831,37839,37826,37850,37840,37881,37868,37836,37849,37801,37862,37834,37844,37870,37859,37845,37828,37838,37824,37842,37863,38269,38362,38363,38625,38697,38699,38700,38696,38694,38835,38839,38838,38877,38878,38879,39004,39001,39005,38999,39103,39101,39099,39102,39240,39239,39235,39334,39335,39450,39445,39461,39453,39460,39451,39458,39456,39463,39459,39454,39452,39444,39618,39691,39690,39694,39692,39735,39914,39915,39904,39902,39908,39910,39906,39920,39892,39895,39916,39900,39897,39909,39893,39905,39898,40311,40321,40330,40324,40328,40305,40320,40312,40326,40331,40332,40317,40299,40308,40309,40304,40297,40325,40307,40315,40322,40303,40313,40319,40327,40296,40596,40593,40640,40700,40749,40768,40769,40781,40790,40791,40792,21303,22194,22197,22195,22755,23365,24006,24007,24302,24303,24512,24513,25081,25879,25878,25877,25875,26079,26344,26339,26340,27379,27376,27370,27368,27385,27377,27374,27375,28732,28725,28719,28727,28724,28721,28738,28728,28735,28730,28729,28736,28731,28723,28737,29203,29204,29352,29565,29564,29882,30379,30378,30398,30445,30668,30670,30671,30669,30706,31013,31011,31015,31016,31012,31017,31154,31342,31340,31341,31479,31817,31816,31818,31815,31813,31982,32379,32382,32385,32384,32698,32767,32889,33243,33241,33291,33384,33385,34338,34303,34305,34302,34331,34304,34294,34308,34313,34309,34316,34301,34841,34832,34833,34839,34835,34838,35171,35174,35257,35319,35680,35690,35677,35688,35683,35685,35687,35693,36270,36486,36488,36484,36697,36694,36695,36693,36696,36698,37005,37187,37185,37303,37301,37298,37299,37899,37907,37883,37920,37903,37908,37886,37909,37904,37928,37913,37901,37877,37888,37879,37895,37902,37910,37906,37882,37897,37880,37898,37887,37884,37900,37878,37905,37894,38366,38368,38367,38702,38703,38841,38843,38909,38910,39008,39010,39011,39007,39105,39106,39248,39246,39257,39244,39243,39251,39474,39476,39473,39468,39466,39478,39465,39470,39480,39469,39623,39626,39622,39696,39698,39697,39947,39944,39927,39941,39954,39928,40000,39943,39950,39942,39959,39956,39945,40351,40345,40356,40349,40338,40344,40336,40347,40352,40340,40348,40362,40343,40353,40346,40354,40360,40350,40355,40383,40361,40342,40358,40359,40601,40603,40602,40677,40676,40679,40678,40752,40750,40795,40800,40798,40797,40793,40849,20794,20793,21144,21143,22211,22205,22206,23368,23367,24011,24015,24305,25085,25883,27394,27388,27395,27384,27392,28739,28740,28746,28744,28745,28741,28742,29213,29210,29209,29566,29975,30314,30672,31021,31025,31023,31828,31827,31986,32394,32391,32392,32395,32390,32397,32589,32699,32816,33245,34328,34346,34342,34335,34339,34332,34329,34343,34350,34337,34336,34345,34334,34341,34857,34845,34843,34848,34852,34844,34859,34890,35181,35177,35182,35179,35322,35705,35704,35653,35706,35707,36112,36116,36271,36494,36492,36702,36699,36701,37190,37188,37189,37305,37951,37947,37942,37929,37949,37948,37936,37945,37930,37943,37932,37952,37937,38373,38372,38371,38709,38714,38847,38881,39012,39113,39110,39104,39256,39254,39481,39485,39494,39492,39490,39489,39482,39487,39629,39701,39703,39704,39702,39738,39762,39979,39965,39964,39980,39971,39976,39977,39972,39969,40375,40374,40380,40385,40391,40394,40399,40382,40389,40387,40379,40373,40398,40377,40378,40364,40392,40369,40365,40396,40371,40397,40370,40570,40604,40683,40686,40685,40731,40728,40730,40753,40782,40805,40804,40850,20153,22214,22213,22219,22897,23371,23372,24021,24017,24306,25889,25888,25894,25890,27403,27400,27401,27661,28757,28758,28759,28754,29214,29215,29353,29567,29912,29909,29913,29911,30317,30381,31029,31156,31344,31345,31831,31836,31833,31835,31834,31988,31985,32401,32591,32647,33246,33387,34356,34357,34355,34348,34354,34358,34860,34856,34854,34858,34853,35185,35263,35262,35323,35710,35716,35714,35718,35717,35711,36117,36501,36500,36506,36498,36496,36502,36503,36704,36706,37191,37964,37968,37962,37963,37967,37959,37957,37960,37961,37958,38719,38883,39018,39017,39115,39252,39259,39502,39507,39508,39500,39503,39496,39498,39497,39506,39504,39632,39705,39723,39739,39766,39765,40006,40008,39999,40004,39993,39987,40001,39996,39991,39988,39986,39997,39990,40411,40402,40414,40410,40395,40400,40412,40401,40415,40425,40409,40408,40406,40437,40405,40413,40630,40688,40757,40755,40754,40770,40811,40853,40866,20797,21145,22760,22759,22898,23373,24024,34863,24399,25089,25091,25092,25897,25893,26006,26347,27409,27410,27407,27594,28763,28762,29218,29570,29569,29571,30320,30676,31847,31846,32405,33388,34362,34368,34361,34364,34353,34363,34366,34864,34866,34862,34867,35190,35188,35187,35326,35724,35726,35723,35720,35909,36121,36504,36708,36707,37308,37986,37973,37981,37975,37982,38852,38853,38912,39510,39513,39710,39711,39712,40018,40024,40016,40010,40013,40011,40021,40025,40012,40014,40443,40439,40431,40419,40427,40440,40420,40438,40417,40430,40422,40434,40432,40418,40428,40436,40435,40424,40429,40642,40656,40690,40691,40710,40732,40760,40759,40758,40771,40783,40817,40816,40814,40815,22227,22221,23374,23661,25901,26349,26350,27411,28767,28769,28765,28768,29219,29915,29925,30677,31032,31159,31158,31850,32407,32649,33389,34371,34872,34871,34869,34891,35732,35733,36510,36511,36512,36509,37310,37309,37314,37995,37992,37993,38629,38726,38723,38727,38855,38885,39518,39637,39769,40035,40039,40038,40034,40030,40032,40450,40446,40455,40451,40454,40453,40448,40449,40457,40447,40445,40452,40608,40734,40774,40820,40821,40822,22228,25902,26040,27416,27417,27415,27418,28770,29222,29354,30680,30681,31033,31849,31851,31990,32410,32408,32411,32409,33248,33249,34374,34375,34376,35193,35194,35196,35195,35327,35736,35737,36517,36516,36515,37998,37997,37999,38001,38003,38729,39026,39263,40040,40046,40045,40459,40461,40464,40463,40466,40465,40609,40693,40713,40775,40824,40827,40826,40825,22302,28774,31855,34876,36274,36518,37315,38004,38008,38006,38005,39520,40052,40051,40049,40053,40468,40467,40694,40714,40868,28776,28773,31991,34410,34878,34877,34879,35742,35996,36521,36553,38731,39027,39028,39116,39265,39339,39524,39526,39527,39716,40469,40471,40776,25095,27422,29223,34380,36520,38018,38016,38017,39529,39528,39726,40473,29225,34379,35743,38019,40057,40631,30325,39531,40058,40477,28777,28778,40612,40830,40777,40856,30849,37561,35023,22715,24658,31911,23290,9556,9574,9559,9568,9580,9571,9562,9577,9565,9554,9572,9557,9566,9578,9569,9560,9575,9563,9555,9573,9558,9567,9579,9570,9561,9576,9564,9553,9552,9581,9582,9584,9583,65517,132423,37595,132575,147397,34124,17077,29679,20917,13897,149826,166372,37700,137691,33518,146632,30780,26436,25311,149811,166314,131744,158643,135941,20395,140525,20488,159017,162436,144896,150193,140563,20521,131966,24484,131968,131911,28379,132127,20605,20737,13434,20750,39020,14147,33814,149924,132231,20832,144308,20842,134143,139516,131813,140592,132494,143923,137603,23426,34685,132531,146585,20914,20920,40244,20937,20943,20945,15580,20947,150182,20915,20962,21314,20973,33741,26942,145197,24443,21003,21030,21052,21173,21079,21140,21177,21189,31765,34114,21216,34317,158483,21253,166622,21833,28377,147328,133460,147436,21299,21316,134114,27851,136998,26651,29653,24650,16042,14540,136936,29149,17570,21357,21364,165547,21374,21375,136598,136723,30694,21395,166555,21408,21419,21422,29607,153458,16217,29596,21441,21445,27721,20041,22526,21465,15019,134031,21472,147435,142755,21494,134263,21523,28793,21803,26199,27995,21613,158547,134516,21853,21647,21668,18342,136973,134877,15796,134477,166332,140952,21831,19693,21551,29719,21894,21929,22021,137431,147514,17746,148533,26291,135348,22071,26317,144010,26276,26285,22093,22095,30961,22257,38791,21502,22272,22255,22253,166758,13859,135759,22342,147877,27758,28811,22338,14001,158846,22502,136214,22531,136276,148323,22566,150517,22620,22698,13665,22752,22748,135740,22779,23551,22339,172368,148088,37843,13729,22815,26790,14019,28249,136766,23076,21843,136850,34053,22985,134478,158849,159018,137180,23001,137211,137138,159142,28017,137256,136917,23033,159301,23211,23139,14054,149929,23159,14088,23190,29797,23251,159649,140628,15749,137489,14130,136888,24195,21200,23414,25992,23420,162318,16388,18525,131588,23509,24928,137780,154060,132517,23539,23453,19728,23557,138052,23571,29646,23572,138405,158504,23625,18653,23685,23785,23791,23947,138745,138807,23824,23832,23878,138916,23738,24023,33532,14381,149761,139337,139635,33415,14390,15298,24110,27274,24181,24186,148668,134355,21414,20151,24272,21416,137073,24073,24308,164994,24313,24315,14496,24316,26686,37915,24333,131521,194708,15070,18606,135994,24378,157832,140240,24408,140401,24419,38845,159342,24434,37696,166454,24487,23990,15711,152144,139114,159992,140904,37334,131742,166441,24625,26245,137335,14691,15815,13881,22416,141236,31089,15936,24734,24740,24755,149890,149903,162387,29860,20705,23200,24932,33828,24898,194726,159442,24961,20980,132694,24967,23466,147383,141407,25043,166813,170333,25040,14642,141696,141505,24611,24924,25886,25483,131352,25285,137072,25301,142861,25452,149983,14871,25656,25592,136078,137212,25744,28554,142902,38932,147596,153373,25825,25829,38011,14950,25658,14935,25933,28438,150056,150051,25989,25965,25951,143486,26037,149824,19255,26065,16600,137257,26080,26083,24543,144384,26136,143863,143864,26180,143780,143781,26187,134773,26215,152038,26227,26228,138813,143921,165364,143816,152339,30661,141559,39332,26370,148380,150049,15147,27130,145346,26462,26471,26466,147917,168173,26583,17641,26658,28240,37436,26625,144358,159136,26717,144495,27105,27147,166623,26995,26819,144845,26881,26880,15666,14849,144956,15232,26540,26977,166474,17148,26934,27032,15265,132041,33635,20624,27129,144985,139562,27205,145155,27293,15347,26545,27336,168348,15373,27421,133411,24798,27445,27508,141261,28341,146139,132021,137560,14144,21537,146266,27617,147196,27612,27703,140427,149745,158545,27738,33318,27769,146876,17605,146877,147876,149772,149760,146633,14053,15595,134450,39811,143865,140433,32655,26679,159013,159137,159211,28054,27996,28284,28420,149887,147589,159346,34099,159604,20935,27804,28189,33838,166689,28207,146991,29779,147330,31180,28239,23185,143435,28664,14093,28573,146992,28410,136343,147517,17749,37872,28484,28508,15694,28532,168304,15675,28575,147780,28627,147601,147797,147513,147440,147380,147775,20959,147798,147799,147776,156125,28747,28798,28839,28801,28876,28885,28886,28895,16644,15848,29108,29078,148087,28971,28997,23176,29002,29038,23708,148325,29007,37730,148161,28972,148570,150055,150050,29114,166888,28861,29198,37954,29205,22801,37955,29220,37697,153093,29230,29248,149876,26813,29269,29271,15957,143428,26637,28477,29314,29482,29483,149539,165931,18669,165892,29480,29486,29647,29610,134202,158254,29641,29769,147938,136935,150052,26147,14021,149943,149901,150011,29687,29717,26883,150054,29753,132547,16087,29788,141485,29792,167602,29767,29668,29814,33721,29804,14128,29812,37873,27180,29826,18771,150156,147807,150137,166799,23366,166915,137374,29896,137608,29966,29929,29982,167641,137803,23511,167596,37765,30029,30026,30055,30062,151426,16132,150803,30094,29789,30110,30132,30210,30252,30289,30287,30319,30326,156661,30352,33263,14328,157969,157966,30369,30373,30391,30412,159647,33890,151709,151933,138780,30494,30502,30528,25775,152096,30552,144044,30639,166244,166248,136897,30708,30729,136054,150034,26826,30895,30919,30931,38565,31022,153056,30935,31028,30897,161292,36792,34948,166699,155779,140828,31110,35072,26882,31104,153687,31133,162617,31036,31145,28202,160038,16040,31174,168205,31188], - 'euc-kr': [44034,44035,44037,44038,44043,44044,44045,44046,44047,44056,44062,44063,44065,44066,44067,44069,44070,44071,44072,44073,44074,44075,44078,44082,44083,44084,null,null,null,null,null,null,44085,44086,44087,44090,44091,44093,44094,44095,44097,44098,44099,44100,44101,44102,44103,44104,44105,44106,44108,44110,44111,44112,44113,44114,44115,44117,null,null,null,null,null,null,44118,44119,44121,44122,44123,44125,44126,44127,44128,44129,44130,44131,44132,44133,44134,44135,44136,44137,44138,44139,44140,44141,44142,44143,44146,44147,44149,44150,44153,44155,44156,44157,44158,44159,44162,44167,44168,44173,44174,44175,44177,44178,44179,44181,44182,44183,44184,44185,44186,44187,44190,44194,44195,44196,44197,44198,44199,44203,44205,44206,44209,44210,44211,44212,44213,44214,44215,44218,44222,44223,44224,44226,44227,44229,44230,44231,44233,44234,44235,44237,44238,44239,44240,44241,44242,44243,44244,44246,44248,44249,44250,44251,44252,44253,44254,44255,44258,44259,44261,44262,44265,44267,44269,44270,44274,44276,44279,44280,44281,44282,44283,44286,44287,44289,44290,44291,44293,44295,44296,44297,44298,44299,44302,44304,44306,44307,44308,44309,44310,44311,44313,44314,44315,44317,44318,44319,44321,44322,44323,44324,44325,44326,44327,44328,44330,44331,44334,44335,44336,44337,44338,44339,null,null,null,null,null,null,44342,44343,44345,44346,44347,44349,44350,44351,44352,44353,44354,44355,44358,44360,44362,44363,44364,44365,44366,44367,44369,44370,44371,44373,44374,44375,null,null,null,null,null,null,44377,44378,44379,44380,44381,44382,44383,44384,44386,44388,44389,44390,44391,44392,44393,44394,44395,44398,44399,44401,44402,44407,44408,44409,44410,44414,44416,44419,44420,44421,44422,44423,44426,44427,44429,44430,44431,44433,44434,44435,44436,44437,44438,44439,44440,44441,44442,44443,44446,44447,44448,44449,44450,44451,44453,44454,44455,44456,44457,44458,44459,44460,44461,44462,44463,44464,44465,44466,44467,44468,44469,44470,44472,44473,44474,44475,44476,44477,44478,44479,44482,44483,44485,44486,44487,44489,44490,44491,44492,44493,44494,44495,44498,44500,44501,44502,44503,44504,44505,44506,44507,44509,44510,44511,44513,44514,44515,44517,44518,44519,44520,44521,44522,44523,44524,44525,44526,44527,44528,44529,44530,44531,44532,44533,44534,44535,44538,44539,44541,44542,44546,44547,44548,44549,44550,44551,44554,44556,44558,44559,44560,44561,44562,44563,44565,44566,44567,44568,44569,44570,44571,44572,null,null,null,null,null,null,44573,44574,44575,44576,44577,44578,44579,44580,44581,44582,44583,44584,44585,44586,44587,44588,44589,44590,44591,44594,44595,44597,44598,44601,44603,44604,null,null,null,null,null,null,44605,44606,44607,44610,44612,44615,44616,44617,44619,44623,44625,44626,44627,44629,44631,44632,44633,44634,44635,44638,44642,44643,44644,44646,44647,44650,44651,44653,44654,44655,44657,44658,44659,44660,44661,44662,44663,44666,44670,44671,44672,44673,44674,44675,44678,44679,44680,44681,44682,44683,44685,44686,44687,44688,44689,44690,44691,44692,44693,44694,44695,44696,44697,44698,44699,44700,44701,44702,44703,44704,44705,44706,44707,44708,44709,44710,44711,44712,44713,44714,44715,44716,44717,44718,44719,44720,44721,44722,44723,44724,44725,44726,44727,44728,44729,44730,44731,44735,44737,44738,44739,44741,44742,44743,44744,44745,44746,44747,44750,44754,44755,44756,44757,44758,44759,44762,44763,44765,44766,44767,44768,44769,44770,44771,44772,44773,44774,44775,44777,44778,44780,44782,44783,44784,44785,44786,44787,44789,44790,44791,44793,44794,44795,44797,44798,44799,44800,44801,44802,44803,44804,44805,null,null,null,null,null,null,44806,44809,44810,44811,44812,44814,44815,44817,44818,44819,44820,44821,44822,44823,44824,44825,44826,44827,44828,44829,44830,44831,44832,44833,44834,44835,null,null,null,null,null,null,44836,44837,44838,44839,44840,44841,44842,44843,44846,44847,44849,44851,44853,44854,44855,44856,44857,44858,44859,44862,44864,44868,44869,44870,44871,44874,44875,44876,44877,44878,44879,44881,44882,44883,44884,44885,44886,44887,44888,44889,44890,44891,44894,44895,44896,44897,44898,44899,44902,44903,44904,44905,44906,44907,44908,44909,44910,44911,44912,44913,44914,44915,44916,44917,44918,44919,44920,44922,44923,44924,44925,44926,44927,44929,44930,44931,44933,44934,44935,44937,44938,44939,44940,44941,44942,44943,44946,44947,44948,44950,44951,44952,44953,44954,44955,44957,44958,44959,44960,44961,44962,44963,44964,44965,44966,44967,44968,44969,44970,44971,44972,44973,44974,44975,44976,44977,44978,44979,44980,44981,44982,44983,44986,44987,44989,44990,44991,44993,44994,44995,44996,44997,44998,45002,45004,45007,45008,45009,45010,45011,45013,45014,45015,45016,45017,45018,45019,45021,45022,45023,45024,45025,null,null,null,null,null,null,45026,45027,45028,45029,45030,45031,45034,45035,45036,45037,45038,45039,45042,45043,45045,45046,45047,45049,45050,45051,45052,45053,45054,45055,45058,45059,null,null,null,null,null,null,45061,45062,45063,45064,45065,45066,45067,45069,45070,45071,45073,45074,45075,45077,45078,45079,45080,45081,45082,45083,45086,45087,45088,45089,45090,45091,45092,45093,45094,45095,45097,45098,45099,45100,45101,45102,45103,45104,45105,45106,45107,45108,45109,45110,45111,45112,45113,45114,45115,45116,45117,45118,45119,45120,45121,45122,45123,45126,45127,45129,45131,45133,45135,45136,45137,45138,45142,45144,45146,45147,45148,45150,45151,45152,45153,45154,45155,45156,45157,45158,45159,45160,45161,45162,45163,45164,45165,45166,45167,45168,45169,45170,45171,45172,45173,45174,45175,45176,45177,45178,45179,45182,45183,45185,45186,45187,45189,45190,45191,45192,45193,45194,45195,45198,45200,45202,45203,45204,45205,45206,45207,45211,45213,45214,45219,45220,45221,45222,45223,45226,45232,45234,45238,45239,45241,45242,45243,45245,45246,45247,45248,45249,45250,45251,45254,45258,45259,45260,45261,45262,45263,45266,null,null,null,null,null,null,45267,45269,45270,45271,45273,45274,45275,45276,45277,45278,45279,45281,45282,45283,45284,45286,45287,45288,45289,45290,45291,45292,45293,45294,45295,45296,null,null,null,null,null,null,45297,45298,45299,45300,45301,45302,45303,45304,45305,45306,45307,45308,45309,45310,45311,45312,45313,45314,45315,45316,45317,45318,45319,45322,45325,45326,45327,45329,45332,45333,45334,45335,45338,45342,45343,45344,45345,45346,45350,45351,45353,45354,45355,45357,45358,45359,45360,45361,45362,45363,45366,45370,45371,45372,45373,45374,45375,45378,45379,45381,45382,45383,45385,45386,45387,45388,45389,45390,45391,45394,45395,45398,45399,45401,45402,45403,45405,45406,45407,45409,45410,45411,45412,45413,45414,45415,45416,45417,45418,45419,45420,45421,45422,45423,45424,45425,45426,45427,45428,45429,45430,45431,45434,45435,45437,45438,45439,45441,45443,45444,45445,45446,45447,45450,45452,45454,45455,45456,45457,45461,45462,45463,45465,45466,45467,45469,45470,45471,45472,45473,45474,45475,45476,45477,45478,45479,45481,45482,45483,45484,45485,45486,45487,45488,45489,45490,45491,45492,45493,45494,45495,45496,null,null,null,null,null,null,45497,45498,45499,45500,45501,45502,45503,45504,45505,45506,45507,45508,45509,45510,45511,45512,45513,45514,45515,45517,45518,45519,45521,45522,45523,45525,null,null,null,null,null,null,45526,45527,45528,45529,45530,45531,45534,45536,45537,45538,45539,45540,45541,45542,45543,45546,45547,45549,45550,45551,45553,45554,45555,45556,45557,45558,45559,45560,45562,45564,45566,45567,45568,45569,45570,45571,45574,45575,45577,45578,45581,45582,45583,45584,45585,45586,45587,45590,45592,45594,45595,45596,45597,45598,45599,45601,45602,45603,45604,45605,45606,45607,45608,45609,45610,45611,45612,45613,45614,45615,45616,45617,45618,45619,45621,45622,45623,45624,45625,45626,45627,45629,45630,45631,45632,45633,45634,45635,45636,45637,45638,45639,45640,45641,45642,45643,45644,45645,45646,45647,45648,45649,45650,45651,45652,45653,45654,45655,45657,45658,45659,45661,45662,45663,45665,45666,45667,45668,45669,45670,45671,45674,45675,45676,45677,45678,45679,45680,45681,45682,45683,45686,45687,45688,45689,45690,45691,45693,45694,45695,45696,45697,45698,45699,45702,45703,45704,45706,45707,45708,45709,45710,null,null,null,null,null,null,45711,45714,45715,45717,45718,45719,45723,45724,45725,45726,45727,45730,45732,45735,45736,45737,45739,45741,45742,45743,45745,45746,45747,45749,45750,45751,null,null,null,null,null,null,45752,45753,45754,45755,45756,45757,45758,45759,45760,45761,45762,45763,45764,45765,45766,45767,45770,45771,45773,45774,45775,45777,45779,45780,45781,45782,45783,45786,45788,45790,45791,45792,45793,45795,45799,45801,45802,45808,45809,45810,45814,45820,45821,45822,45826,45827,45829,45830,45831,45833,45834,45835,45836,45837,45838,45839,45842,45846,45847,45848,45849,45850,45851,45853,45854,45855,45856,45857,45858,45859,45860,45861,45862,45863,45864,45865,45866,45867,45868,45869,45870,45871,45872,45873,45874,45875,45876,45877,45878,45879,45880,45881,45882,45883,45884,45885,45886,45887,45888,45889,45890,45891,45892,45893,45894,45895,45896,45897,45898,45899,45900,45901,45902,45903,45904,45905,45906,45907,45911,45913,45914,45917,45920,45921,45922,45923,45926,45928,45930,45932,45933,45935,45938,45939,45941,45942,45943,45945,45946,45947,45948,45949,45950,45951,45954,45958,45959,45960,45961,45962,45963,45965,null,null,null,null,null,null,45966,45967,45969,45970,45971,45973,45974,45975,45976,45977,45978,45979,45980,45981,45982,45983,45986,45987,45988,45989,45990,45991,45993,45994,45995,45997,null,null,null,null,null,null,45998,45999,46000,46001,46002,46003,46004,46005,46006,46007,46008,46009,46010,46011,46012,46013,46014,46015,46016,46017,46018,46019,46022,46023,46025,46026,46029,46031,46033,46034,46035,46038,46040,46042,46044,46046,46047,46049,46050,46051,46053,46054,46055,46057,46058,46059,46060,46061,46062,46063,46064,46065,46066,46067,46068,46069,46070,46071,46072,46073,46074,46075,46077,46078,46079,46080,46081,46082,46083,46084,46085,46086,46087,46088,46089,46090,46091,46092,46093,46094,46095,46097,46098,46099,46100,46101,46102,46103,46105,46106,46107,46109,46110,46111,46113,46114,46115,46116,46117,46118,46119,46122,46124,46125,46126,46127,46128,46129,46130,46131,46133,46134,46135,46136,46137,46138,46139,46140,46141,46142,46143,46144,46145,46146,46147,46148,46149,46150,46151,46152,46153,46154,46155,46156,46157,46158,46159,46162,46163,46165,46166,46167,46169,46170,46171,46172,46173,46174,46175,46178,46180,46182,null,null,null,null,null,null,46183,46184,46185,46186,46187,46189,46190,46191,46192,46193,46194,46195,46196,46197,46198,46199,46200,46201,46202,46203,46204,46205,46206,46207,46209,46210,null,null,null,null,null,null,46211,46212,46213,46214,46215,46217,46218,46219,46220,46221,46222,46223,46224,46225,46226,46227,46228,46229,46230,46231,46232,46233,46234,46235,46236,46238,46239,46240,46241,46242,46243,46245,46246,46247,46249,46250,46251,46253,46254,46255,46256,46257,46258,46259,46260,46262,46264,46266,46267,46268,46269,46270,46271,46273,46274,46275,46277,46278,46279,46281,46282,46283,46284,46285,46286,46287,46289,46290,46291,46292,46294,46295,46296,46297,46298,46299,46302,46303,46305,46306,46309,46311,46312,46313,46314,46315,46318,46320,46322,46323,46324,46325,46326,46327,46329,46330,46331,46332,46333,46334,46335,46336,46337,46338,46339,46340,46341,46342,46343,46344,46345,46346,46347,46348,46349,46350,46351,46352,46353,46354,46355,46358,46359,46361,46362,46365,46366,46367,46368,46369,46370,46371,46374,46379,46380,46381,46382,46383,46386,46387,46389,46390,46391,46393,46394,46395,46396,46397,46398,46399,46402,46406,null,null,null,null,null,null,46407,46408,46409,46410,46414,46415,46417,46418,46419,46421,46422,46423,46424,46425,46426,46427,46430,46434,46435,46436,46437,46438,46439,46440,46441,46442,null,null,null,null,null,null,46443,46444,46445,46446,46447,46448,46449,46450,46451,46452,46453,46454,46455,46456,46457,46458,46459,46460,46461,46462,46463,46464,46465,46466,46467,46468,46469,46470,46471,46472,46473,46474,46475,46476,46477,46478,46479,46480,46481,46482,46483,46484,46485,46486,46487,46488,46489,46490,46491,46492,46493,46494,46495,46498,46499,46501,46502,46503,46505,46508,46509,46510,46511,46514,46518,46519,46520,46521,46522,46526,46527,46529,46530,46531,46533,46534,46535,46536,46537,46538,46539,46542,46546,46547,46548,46549,46550,46551,46553,46554,46555,46556,46557,46558,46559,46560,46561,46562,46563,46564,46565,46566,46567,46568,46569,46570,46571,46573,46574,46575,46576,46577,46578,46579,46580,46581,46582,46583,46584,46585,46586,46587,46588,46589,46590,46591,46592,46593,46594,46595,46596,46597,46598,46599,46600,46601,46602,46603,46604,46605,46606,46607,46610,46611,46613,46614,46615,46617,46618,46619,46620,46621,null,null,null,null,null,null,46622,46623,46624,46625,46626,46627,46628,46630,46631,46632,46633,46634,46635,46637,46638,46639,46640,46641,46642,46643,46645,46646,46647,46648,46649,46650,null,null,null,null,null,null,46651,46652,46653,46654,46655,46656,46657,46658,46659,46660,46661,46662,46663,46665,46666,46667,46668,46669,46670,46671,46672,46673,46674,46675,46676,46677,46678,46679,46680,46681,46682,46683,46684,46685,46686,46687,46688,46689,46690,46691,46693,46694,46695,46697,46698,46699,46700,46701,46702,46703,46704,46705,46706,46707,46708,46709,46710,46711,46712,46713,46714,46715,46716,46717,46718,46719,46720,46721,46722,46723,46724,46725,46726,46727,46728,46729,46730,46731,46732,46733,46734,46735,46736,46737,46738,46739,46740,46741,46742,46743,46744,46745,46746,46747,46750,46751,46753,46754,46755,46757,46758,46759,46760,46761,46762,46765,46766,46767,46768,46770,46771,46772,46773,46774,46775,46776,46777,46778,46779,46780,46781,46782,46783,46784,46785,46786,46787,46788,46789,46790,46791,46792,46793,46794,46795,46796,46797,46798,46799,46800,46801,46802,46803,46805,46806,46807,46808,46809,46810,46811,46812,46813,null,null,null,null,null,null,46814,46815,46816,46817,46818,46819,46820,46821,46822,46823,46824,46825,46826,46827,46828,46829,46830,46831,46833,46834,46835,46837,46838,46839,46841,46842,null,null,null,null,null,null,46843,46844,46845,46846,46847,46850,46851,46852,46854,46855,46856,46857,46858,46859,46860,46861,46862,46863,46864,46865,46866,46867,46868,46869,46870,46871,46872,46873,46874,46875,46876,46877,46878,46879,46880,46881,46882,46883,46884,46885,46886,46887,46890,46891,46893,46894,46897,46898,46899,46900,46901,46902,46903,46906,46908,46909,46910,46911,46912,46913,46914,46915,46917,46918,46919,46921,46922,46923,46925,46926,46927,46928,46929,46930,46931,46934,46935,46936,46937,46938,46939,46940,46941,46942,46943,46945,46946,46947,46949,46950,46951,46953,46954,46955,46956,46957,46958,46959,46962,46964,46966,46967,46968,46969,46970,46971,46974,46975,46977,46978,46979,46981,46982,46983,46984,46985,46986,46987,46990,46995,46996,46997,47002,47003,47005,47006,47007,47009,47010,47011,47012,47013,47014,47015,47018,47022,47023,47024,47025,47026,47027,47030,47031,47033,47034,47035,47036,47037,47038,47039,47040,47041,null,null,null,null,null,null,47042,47043,47044,47045,47046,47048,47050,47051,47052,47053,47054,47055,47056,47057,47058,47059,47060,47061,47062,47063,47064,47065,47066,47067,47068,47069,null,null,null,null,null,null,47070,47071,47072,47073,47074,47075,47076,47077,47078,47079,47080,47081,47082,47083,47086,47087,47089,47090,47091,47093,47094,47095,47096,47097,47098,47099,47102,47106,47107,47108,47109,47110,47114,47115,47117,47118,47119,47121,47122,47123,47124,47125,47126,47127,47130,47132,47134,47135,47136,47137,47138,47139,47142,47143,47145,47146,47147,47149,47150,47151,47152,47153,47154,47155,47158,47162,47163,47164,47165,47166,47167,47169,47170,47171,47173,47174,47175,47176,47177,47178,47179,47180,47181,47182,47183,47184,47186,47188,47189,47190,47191,47192,47193,47194,47195,47198,47199,47201,47202,47203,47205,47206,47207,47208,47209,47210,47211,47214,47216,47218,47219,47220,47221,47222,47223,47225,47226,47227,47229,47230,47231,47232,47233,47234,47235,47236,47237,47238,47239,47240,47241,47242,47243,47244,47246,47247,47248,47249,47250,47251,47252,47253,47254,47255,47256,47257,47258,47259,47260,47261,47262,47263,null,null,null,null,null,null,47264,47265,47266,47267,47268,47269,47270,47271,47273,47274,47275,47276,47277,47278,47279,47281,47282,47283,47285,47286,47287,47289,47290,47291,47292,47293,null,null,null,null,null,null,47294,47295,47298,47300,47302,47303,47304,47305,47306,47307,47309,47310,47311,47313,47314,47315,47317,47318,47319,47320,47321,47322,47323,47324,47326,47328,47330,47331,47332,47333,47334,47335,47338,47339,47341,47342,47343,47345,47346,47347,47348,47349,47350,47351,47354,47356,47358,47359,47360,47361,47362,47363,47365,47366,47367,47368,47369,47370,47371,47372,47373,47374,47375,47376,47377,47378,47379,47380,47381,47382,47383,47385,47386,47387,47388,47389,47390,47391,47393,47394,47395,47396,47397,47398,47399,47400,47401,47402,47403,47404,47405,47406,47407,47408,47409,47410,47411,47412,47413,47414,47415,47416,47417,47418,47419,47422,47423,47425,47426,47427,47429,47430,47431,47432,47433,47434,47435,47437,47438,47440,47442,47443,47444,47445,47446,47447,47450,47451,47453,47454,47455,47457,47458,47459,47460,47461,47462,47463,47466,47468,47470,47471,47472,47473,47474,47475,47478,47479,47481,47482,47483,47485,null,null,null,null,null,null,47486,47487,47488,47489,47490,47491,47494,47496,47499,47500,47503,47504,47505,47506,47507,47508,47509,47510,47511,47512,47513,47514,47515,47516,47517,47518,null,null,null,null,null,null,47519,47520,47521,47522,47523,47524,47525,47526,47527,47528,47529,47530,47531,47534,47535,47537,47538,47539,47541,47542,47543,47544,47545,47546,47547,47550,47552,47554,47555,47556,47557,47558,47559,47562,47563,47565,47571,47572,47573,47574,47575,47578,47580,47583,47584,47586,47590,47591,47593,47594,47595,47597,47598,47599,47600,47601,47602,47603,47606,47611,47612,47613,47614,47615,47618,47619,47620,47621,47622,47623,47625,47626,47627,47628,47629,47630,47631,47632,47633,47634,47635,47636,47638,47639,47640,47641,47642,47643,47644,47645,47646,47647,47648,47649,47650,47651,47652,47653,47654,47655,47656,47657,47658,47659,47660,47661,47662,47663,47664,47665,47666,47667,47668,47669,47670,47671,47674,47675,47677,47678,47679,47681,47683,47684,47685,47686,47687,47690,47692,47695,47696,47697,47698,47702,47703,47705,47706,47707,47709,47710,47711,47712,47713,47714,47715,47718,47722,47723,47724,47725,47726,47727,null,null,null,null,null,null,47730,47731,47733,47734,47735,47737,47738,47739,47740,47741,47742,47743,47744,47745,47746,47750,47752,47753,47754,47755,47757,47758,47759,47760,47761,47762,null,null,null,null,null,null,47763,47764,47765,47766,47767,47768,47769,47770,47771,47772,47773,47774,47775,47776,47777,47778,47779,47780,47781,47782,47783,47786,47789,47790,47791,47793,47795,47796,47797,47798,47799,47802,47804,47806,47807,47808,47809,47810,47811,47813,47814,47815,47817,47818,47819,47820,47821,47822,47823,47824,47825,47826,47827,47828,47829,47830,47831,47834,47835,47836,47837,47838,47839,47840,47841,47842,47843,47844,47845,47846,47847,47848,47849,47850,47851,47852,47853,47854,47855,47856,47857,47858,47859,47860,47861,47862,47863,47864,47865,47866,47867,47869,47870,47871,47873,47874,47875,47877,47878,47879,47880,47881,47882,47883,47884,47886,47888,47890,47891,47892,47893,47894,47895,47897,47898,47899,47901,47902,47903,47905,47906,47907,47908,47909,47910,47911,47912,47914,47916,47917,47918,47919,47920,47921,47922,47923,47927,47929,47930,47935,47936,47937,47938,47939,47942,47944,47946,47947,47948,47950,47953,47954,null,null,null,null,null,null,47955,47957,47958,47959,47961,47962,47963,47964,47965,47966,47967,47968,47970,47972,47973,47974,47975,47976,47977,47978,47979,47981,47982,47983,47984,47985,null,null,null,null,null,null,47986,47987,47988,47989,47990,47991,47992,47993,47994,47995,47996,47997,47998,47999,48000,48001,48002,48003,48004,48005,48006,48007,48009,48010,48011,48013,48014,48015,48017,48018,48019,48020,48021,48022,48023,48024,48025,48026,48027,48028,48029,48030,48031,48032,48033,48034,48035,48037,48038,48039,48041,48042,48043,48045,48046,48047,48048,48049,48050,48051,48053,48054,48056,48057,48058,48059,48060,48061,48062,48063,48065,48066,48067,48069,48070,48071,48073,48074,48075,48076,48077,48078,48079,48081,48082,48084,48085,48086,48087,48088,48089,48090,48091,48092,48093,48094,48095,48096,48097,48098,48099,48100,48101,48102,48103,48104,48105,48106,48107,48108,48109,48110,48111,48112,48113,48114,48115,48116,48117,48118,48119,48122,48123,48125,48126,48129,48131,48132,48133,48134,48135,48138,48142,48144,48146,48147,48153,48154,48160,48161,48162,48163,48166,48168,48170,48171,48172,48174,48175,48178,48179,48181,null,null,null,null,null,null,48182,48183,48185,48186,48187,48188,48189,48190,48191,48194,48198,48199,48200,48202,48203,48206,48207,48209,48210,48211,48212,48213,48214,48215,48216,48217,null,null,null,null,null,null,48218,48219,48220,48222,48223,48224,48225,48226,48227,48228,48229,48230,48231,48232,48233,48234,48235,48236,48237,48238,48239,48240,48241,48242,48243,48244,48245,48246,48247,48248,48249,48250,48251,48252,48253,48254,48255,48256,48257,48258,48259,48262,48263,48265,48266,48269,48271,48272,48273,48274,48275,48278,48280,48283,48284,48285,48286,48287,48290,48291,48293,48294,48297,48298,48299,48300,48301,48302,48303,48306,48310,48311,48312,48313,48314,48315,48318,48319,48321,48322,48323,48325,48326,48327,48328,48329,48330,48331,48332,48334,48338,48339,48340,48342,48343,48345,48346,48347,48349,48350,48351,48352,48353,48354,48355,48356,48357,48358,48359,48360,48361,48362,48363,48364,48365,48366,48367,48368,48369,48370,48371,48375,48377,48378,48379,48381,48382,48383,48384,48385,48386,48387,48390,48392,48394,48395,48396,48397,48398,48399,48401,48402,48403,48405,48406,48407,48408,48409,48410,48411,48412,48413,null,null,null,null,null,null,48414,48415,48416,48417,48418,48419,48421,48422,48423,48424,48425,48426,48427,48429,48430,48431,48432,48433,48434,48435,48436,48437,48438,48439,48440,48441,null,null,null,null,null,null,48442,48443,48444,48445,48446,48447,48449,48450,48451,48452,48453,48454,48455,48458,48459,48461,48462,48463,48465,48466,48467,48468,48469,48470,48471,48474,48475,48476,48477,48478,48479,48480,48481,48482,48483,48485,48486,48487,48489,48490,48491,48492,48493,48494,48495,48496,48497,48498,48499,48500,48501,48502,48503,48504,48505,48506,48507,48508,48509,48510,48511,48514,48515,48517,48518,48523,48524,48525,48526,48527,48530,48532,48534,48535,48536,48539,48541,48542,48543,48544,48545,48546,48547,48549,48550,48551,48552,48553,48554,48555,48556,48557,48558,48559,48561,48562,48563,48564,48565,48566,48567,48569,48570,48571,48572,48573,48574,48575,48576,48577,48578,48579,48580,48581,48582,48583,48584,48585,48586,48587,48588,48589,48590,48591,48592,48593,48594,48595,48598,48599,48601,48602,48603,48605,48606,48607,48608,48609,48610,48611,48612,48613,48614,48615,48616,48618,48619,48620,48621,48622,48623,48625,null,null,null,null,null,null,48626,48627,48629,48630,48631,48633,48634,48635,48636,48637,48638,48639,48641,48642,48644,48646,48647,48648,48649,48650,48651,48654,48655,48657,48658,48659,null,null,null,null,null,null,48661,48662,48663,48664,48665,48666,48667,48670,48672,48673,48674,48675,48676,48677,48678,48679,48680,48681,48682,48683,48684,48685,48686,48687,48688,48689,48690,48691,48692,48693,48694,48695,48696,48697,48698,48699,48700,48701,48702,48703,48704,48705,48706,48707,48710,48711,48713,48714,48715,48717,48719,48720,48721,48722,48723,48726,48728,48732,48733,48734,48735,48738,48739,48741,48742,48743,48745,48747,48748,48749,48750,48751,48754,48758,48759,48760,48761,48762,48766,48767,48769,48770,48771,48773,48774,48775,48776,48777,48778,48779,48782,48786,48787,48788,48789,48790,48791,48794,48795,48796,48797,48798,48799,48800,48801,48802,48803,48804,48805,48806,48807,48809,48810,48811,48812,48813,48814,48815,48816,48817,48818,48819,48820,48821,48822,48823,48824,48825,48826,48827,48828,48829,48830,48831,48832,48833,48834,48835,48836,48837,48838,48839,48840,48841,48842,48843,48844,48845,48846,48847,48850,48851,null,null,null,null,null,null,48853,48854,48857,48858,48859,48860,48861,48862,48863,48865,48866,48870,48871,48872,48873,48874,48875,48877,48878,48879,48880,48881,48882,48883,48884,48885,null,null,null,null,null,null,48886,48887,48888,48889,48890,48891,48892,48893,48894,48895,48896,48898,48899,48900,48901,48902,48903,48906,48907,48908,48909,48910,48911,48912,48913,48914,48915,48916,48917,48918,48919,48922,48926,48927,48928,48929,48930,48931,48932,48933,48934,48935,48936,48937,48938,48939,48940,48941,48942,48943,48944,48945,48946,48947,48948,48949,48950,48951,48952,48953,48954,48955,48956,48957,48958,48959,48962,48963,48965,48966,48967,48969,48970,48971,48972,48973,48974,48975,48978,48979,48980,48982,48983,48984,48985,48986,48987,48988,48989,48990,48991,48992,48993,48994,48995,48996,48997,48998,48999,49000,49001,49002,49003,49004,49005,49006,49007,49008,49009,49010,49011,49012,49013,49014,49015,49016,49017,49018,49019,49020,49021,49022,49023,49024,49025,49026,49027,49028,49029,49030,49031,49032,49033,49034,49035,49036,49037,49038,49039,49040,49041,49042,49043,49045,49046,49047,49048,49049,49050,49051,49052,49053,null,null,null,null,null,null,49054,49055,49056,49057,49058,49059,49060,49061,49062,49063,49064,49065,49066,49067,49068,49069,49070,49071,49073,49074,49075,49076,49077,49078,49079,49080,null,null,null,null,null,null,49081,49082,49083,49084,49085,49086,49087,49088,49089,49090,49091,49092,49094,49095,49096,49097,49098,49099,49102,49103,49105,49106,49107,49109,49110,49111,49112,49113,49114,49115,49117,49118,49120,49122,49123,49124,49125,49126,49127,49128,49129,49130,49131,49132,49133,49134,49135,49136,49137,49138,49139,49140,49141,49142,49143,49144,49145,49146,49147,49148,49149,49150,49151,49152,49153,49154,49155,49156,49157,49158,49159,49160,49161,49162,49163,49164,49165,49166,49167,49168,49169,49170,49171,49172,49173,49174,49175,49176,49177,49178,49179,49180,49181,49182,49183,49184,49185,49186,49187,49188,49189,49190,49191,49192,49193,49194,49195,49196,49197,49198,49199,49200,49201,49202,49203,49204,49205,49206,49207,49208,49209,49210,49211,49213,49214,49215,49216,49217,49218,49219,49220,49221,49222,49223,49224,49225,49226,49227,49228,49229,49230,49231,49232,49234,49235,49236,49237,49238,49239,49241,49242,49243,null,null,null,null,null,null,49245,49246,49247,49249,49250,49251,49252,49253,49254,49255,49258,49259,49260,49261,49262,49263,49264,49265,49266,49267,49268,49269,49270,49271,49272,49273,null,null,null,null,null,null,49274,49275,49276,49277,49278,49279,49280,49281,49282,49283,49284,49285,49286,49287,49288,49289,49290,49291,49292,49293,49294,49295,49298,49299,49301,49302,49303,49305,49306,49307,49308,49309,49310,49311,49314,49316,49318,49319,49320,49321,49322,49323,49326,49329,49330,49335,49336,49337,49338,49339,49342,49346,49347,49348,49350,49351,49354,49355,49357,49358,49359,49361,49362,49363,49364,49365,49366,49367,49370,49374,49375,49376,49377,49378,49379,49382,49383,49385,49386,49387,49389,49390,49391,49392,49393,49394,49395,49398,49400,49402,49403,49404,49405,49406,49407,49409,49410,49411,49413,49414,49415,49417,49418,49419,49420,49421,49422,49423,49425,49426,49427,49428,49430,49431,49432,49433,49434,49435,49441,49442,49445,49448,49449,49450,49451,49454,49458,49459,49460,49461,49463,49466,49467,49469,49470,49471,49473,49474,49475,49476,49477,49478,49479,49482,49486,49487,49488,49489,49490,49491,49494,49495,null,null,null,null,null,null,49497,49498,49499,49501,49502,49503,49504,49505,49506,49507,49510,49514,49515,49516,49517,49518,49519,49521,49522,49523,49525,49526,49527,49529,49530,49531,null,null,null,null,null,null,49532,49533,49534,49535,49536,49537,49538,49539,49540,49542,49543,49544,49545,49546,49547,49551,49553,49554,49555,49557,49559,49560,49561,49562,49563,49566,49568,49570,49571,49572,49574,49575,49578,49579,49581,49582,49583,49585,49586,49587,49588,49589,49590,49591,49592,49593,49594,49595,49596,49598,49599,49600,49601,49602,49603,49605,49606,49607,49609,49610,49611,49613,49614,49615,49616,49617,49618,49619,49621,49622,49625,49626,49627,49628,49629,49630,49631,49633,49634,49635,49637,49638,49639,49641,49642,49643,49644,49645,49646,49647,49650,49652,49653,49654,49655,49656,49657,49658,49659,49662,49663,49665,49666,49667,49669,49670,49671,49672,49673,49674,49675,49678,49680,49682,49683,49684,49685,49686,49687,49690,49691,49693,49694,49697,49698,49699,49700,49701,49702,49703,49706,49708,49710,49712,49715,49717,49718,49719,49720,49721,49722,49723,49724,49725,49726,49727,49728,49729,49730,49731,49732,49733,null,null,null,null,null,null,49734,49735,49737,49738,49739,49740,49741,49742,49743,49746,49747,49749,49750,49751,49753,49754,49755,49756,49757,49758,49759,49761,49762,49763,49764,49766,null,null,null,null,null,null,49767,49768,49769,49770,49771,49774,49775,49777,49778,49779,49781,49782,49783,49784,49785,49786,49787,49790,49792,49794,49795,49796,49797,49798,49799,49802,49803,49804,49805,49806,49807,49809,49810,49811,49812,49813,49814,49815,49817,49818,49820,49822,49823,49824,49825,49826,49827,49830,49831,49833,49834,49835,49838,49839,49840,49841,49842,49843,49846,49848,49850,49851,49852,49853,49854,49855,49856,49857,49858,49859,49860,49861,49862,49863,49864,49865,49866,49867,49868,49869,49870,49871,49872,49873,49874,49875,49876,49877,49878,49879,49880,49881,49882,49883,49886,49887,49889,49890,49893,49894,49895,49896,49897,49898,49902,49904,49906,49907,49908,49909,49911,49914,49917,49918,49919,49921,49922,49923,49924,49925,49926,49927,49930,49931,49934,49935,49936,49937,49938,49942,49943,49945,49946,49947,49949,49950,49951,49952,49953,49954,49955,49958,49959,49962,49963,49964,49965,49966,49967,49968,49969,49970,null,null,null,null,null,null,49971,49972,49973,49974,49975,49976,49977,49978,49979,49980,49981,49982,49983,49984,49985,49986,49987,49988,49990,49991,49992,49993,49994,49995,49996,49997,null,null,null,null,null,null,49998,49999,50000,50001,50002,50003,50004,50005,50006,50007,50008,50009,50010,50011,50012,50013,50014,50015,50016,50017,50018,50019,50020,50021,50022,50023,50026,50027,50029,50030,50031,50033,50035,50036,50037,50038,50039,50042,50043,50046,50047,50048,50049,50050,50051,50053,50054,50055,50057,50058,50059,50061,50062,50063,50064,50065,50066,50067,50068,50069,50070,50071,50072,50073,50074,50075,50076,50077,50078,50079,50080,50081,50082,50083,50084,50085,50086,50087,50088,50089,50090,50091,50092,50093,50094,50095,50096,50097,50098,50099,50100,50101,50102,50103,50104,50105,50106,50107,50108,50109,50110,50111,50113,50114,50115,50116,50117,50118,50119,50120,50121,50122,50123,50124,50125,50126,50127,50128,50129,50130,50131,50132,50133,50134,50135,50138,50139,50141,50142,50145,50147,50148,50149,50150,50151,50154,50155,50156,50158,50159,50160,50161,50162,50163,50166,50167,50169,50170,50171,50172,50173,50174,null,null,null,null,null,null,50175,50176,50177,50178,50179,50180,50181,50182,50183,50185,50186,50187,50188,50189,50190,50191,50193,50194,50195,50196,50197,50198,50199,50200,50201,50202,null,null,null,null,null,null,50203,50204,50205,50206,50207,50208,50209,50210,50211,50213,50214,50215,50216,50217,50218,50219,50221,50222,50223,50225,50226,50227,50229,50230,50231,50232,50233,50234,50235,50238,50239,50240,50241,50242,50243,50244,50245,50246,50247,50249,50250,50251,50252,50253,50254,50255,50256,50257,50258,50259,50260,50261,50262,50263,50264,50265,50266,50267,50268,50269,50270,50271,50272,50273,50274,50275,50278,50279,50281,50282,50283,50285,50286,50287,50288,50289,50290,50291,50294,50295,50296,50298,50299,50300,50301,50302,50303,50305,50306,50307,50308,50309,50310,50311,50312,50313,50314,50315,50316,50317,50318,50319,50320,50321,50322,50323,50325,50326,50327,50328,50329,50330,50331,50333,50334,50335,50336,50337,50338,50339,50340,50341,50342,50343,50344,50345,50346,50347,50348,50349,50350,50351,50352,50353,50354,50355,50356,50357,50358,50359,50361,50362,50363,50365,50366,50367,50368,50369,50370,50371,50372,50373,null,null,null,null,null,null,50374,50375,50376,50377,50378,50379,50380,50381,50382,50383,50384,50385,50386,50387,50388,50389,50390,50391,50392,50393,50394,50395,50396,50397,50398,50399,null,null,null,null,null,null,50400,50401,50402,50403,50404,50405,50406,50407,50408,50410,50411,50412,50413,50414,50415,50418,50419,50421,50422,50423,50425,50427,50428,50429,50430,50434,50435,50436,50437,50438,50439,50440,50441,50442,50443,50445,50446,50447,50449,50450,50451,50453,50454,50455,50456,50457,50458,50459,50461,50462,50463,50464,50465,50466,50467,50468,50469,50470,50471,50474,50475,50477,50478,50479,50481,50482,50483,50484,50485,50486,50487,50490,50492,50494,50495,50496,50497,50498,50499,50502,50503,50507,50511,50512,50513,50514,50518,50522,50523,50524,50527,50530,50531,50533,50534,50535,50537,50538,50539,50540,50541,50542,50543,50546,50550,50551,50552,50553,50554,50555,50558,50559,50561,50562,50563,50565,50566,50568,50569,50570,50571,50574,50576,50578,50579,50580,50582,50585,50586,50587,50589,50590,50591,50593,50594,50595,50596,50597,50598,50599,50600,50602,50603,50604,50605,50606,50607,50608,50609,50610,50611,50614,null,null,null,null,null,null,50615,50618,50623,50624,50625,50626,50627,50635,50637,50639,50642,50643,50645,50646,50647,50649,50650,50651,50652,50653,50654,50655,50658,50660,50662,50663,null,null,null,null,null,null,50664,50665,50666,50667,50671,50673,50674,50675,50677,50680,50681,50682,50683,50690,50691,50692,50697,50698,50699,50701,50702,50703,50705,50706,50707,50708,50709,50710,50711,50714,50717,50718,50719,50720,50721,50722,50723,50726,50727,50729,50730,50731,50735,50737,50738,50742,50744,50746,50748,50749,50750,50751,50754,50755,50757,50758,50759,50761,50762,50763,50764,50765,50766,50767,50770,50774,50775,50776,50777,50778,50779,50782,50783,50785,50786,50787,50788,50789,50790,50791,50792,50793,50794,50795,50797,50798,50800,50802,50803,50804,50805,50806,50807,50810,50811,50813,50814,50815,50817,50818,50819,50820,50821,50822,50823,50826,50828,50830,50831,50832,50833,50834,50835,50838,50839,50841,50842,50843,50845,50846,50847,50848,50849,50850,50851,50854,50856,50858,50859,50860,50861,50862,50863,50866,50867,50869,50870,50871,50875,50876,50877,50878,50879,50882,50884,50886,50887,50888,50889,50890,50891,50894,null,null,null,null,null,null,50895,50897,50898,50899,50901,50902,50903,50904,50905,50906,50907,50910,50911,50914,50915,50916,50917,50918,50919,50922,50923,50925,50926,50927,50929,50930,null,null,null,null,null,null,50931,50932,50933,50934,50935,50938,50939,50940,50942,50943,50944,50945,50946,50947,50950,50951,50953,50954,50955,50957,50958,50959,50960,50961,50962,50963,50966,50968,50970,50971,50972,50973,50974,50975,50978,50979,50981,50982,50983,50985,50986,50987,50988,50989,50990,50991,50994,50996,50998,51000,51001,51002,51003,51006,51007,51009,51010,51011,51013,51014,51015,51016,51017,51019,51022,51024,51033,51034,51035,51037,51038,51039,51041,51042,51043,51044,51045,51046,51047,51049,51050,51052,51053,51054,51055,51056,51057,51058,51059,51062,51063,51065,51066,51067,51071,51072,51073,51074,51078,51083,51084,51085,51087,51090,51091,51093,51097,51099,51100,51101,51102,51103,51106,51111,51112,51113,51114,51115,51118,51119,51121,51122,51123,51125,51126,51127,51128,51129,51130,51131,51134,51138,51139,51140,51141,51142,51143,51146,51147,51149,51151,51153,51154,51155,51156,51157,51158,51159,51161,51162,51163,51164,null,null,null,null,null,null,51166,51167,51168,51169,51170,51171,51173,51174,51175,51177,51178,51179,51181,51182,51183,51184,51185,51186,51187,51188,51189,51190,51191,51192,51193,51194,null,null,null,null,null,null,51195,51196,51197,51198,51199,51202,51203,51205,51206,51207,51209,51211,51212,51213,51214,51215,51218,51220,51223,51224,51225,51226,51227,51230,51231,51233,51234,51235,51237,51238,51239,51240,51241,51242,51243,51246,51248,51250,51251,51252,51253,51254,51255,51257,51258,51259,51261,51262,51263,51265,51266,51267,51268,51269,51270,51271,51274,51275,51278,51279,51280,51281,51282,51283,51285,51286,51287,51288,51289,51290,51291,51292,51293,51294,51295,51296,51297,51298,51299,51300,51301,51302,51303,51304,51305,51306,51307,51308,51309,51310,51311,51314,51315,51317,51318,51319,51321,51323,51324,51325,51326,51327,51330,51332,51336,51337,51338,51342,51343,51344,51345,51346,51347,51349,51350,51351,51352,51353,51354,51355,51356,51358,51360,51362,51363,51364,51365,51366,51367,51369,51370,51371,51372,51373,51374,51375,51376,51377,51378,51379,51380,51381,51382,51383,51384,51385,51386,51387,51390,51391,51392,51393,null,null,null,null,null,null,51394,51395,51397,51398,51399,51401,51402,51403,51405,51406,51407,51408,51409,51410,51411,51414,51416,51418,51419,51420,51421,51422,51423,51426,51427,51429,null,null,null,null,null,null,51430,51431,51432,51433,51434,51435,51436,51437,51438,51439,51440,51441,51442,51443,51444,51446,51447,51448,51449,51450,51451,51454,51455,51457,51458,51459,51463,51464,51465,51466,51467,51470,12288,12289,12290,183,8229,8230,168,12291,173,8213,8741,65340,8764,8216,8217,8220,8221,12308,12309,12296,12297,12298,12299,12300,12301,12302,12303,12304,12305,177,215,247,8800,8804,8805,8734,8756,176,8242,8243,8451,8491,65504,65505,65509,9794,9792,8736,8869,8978,8706,8711,8801,8786,167,8251,9734,9733,9675,9679,9678,9671,9670,9633,9632,9651,9650,9661,9660,8594,8592,8593,8595,8596,12307,8810,8811,8730,8765,8733,8757,8747,8748,8712,8715,8838,8839,8834,8835,8746,8745,8743,8744,65506,51472,51474,51475,51476,51477,51478,51479,51481,51482,51483,51484,51485,51486,51487,51488,51489,51490,51491,51492,51493,51494,51495,51496,51497,51498,51499,null,null,null,null,null,null,51501,51502,51503,51504,51505,51506,51507,51509,51510,51511,51512,51513,51514,51515,51516,51517,51518,51519,51520,51521,51522,51523,51524,51525,51526,51527,null,null,null,null,null,null,51528,51529,51530,51531,51532,51533,51534,51535,51538,51539,51541,51542,51543,51545,51546,51547,51548,51549,51550,51551,51554,51556,51557,51558,51559,51560,51561,51562,51563,51565,51566,51567,8658,8660,8704,8707,180,65374,711,728,733,730,729,184,731,161,191,720,8750,8721,8719,164,8457,8240,9665,9664,9655,9654,9828,9824,9825,9829,9831,9827,8857,9672,9635,9680,9681,9618,9636,9637,9640,9639,9638,9641,9832,9743,9742,9756,9758,182,8224,8225,8597,8599,8601,8598,8600,9837,9833,9834,9836,12927,12828,8470,13255,8482,13250,13272,8481,8364,174,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,51569,51570,51571,51573,51574,51575,51576,51577,51578,51579,51581,51582,51583,51584,51585,51586,51587,51588,51589,51590,51591,51594,51595,51597,51598,51599,null,null,null,null,null,null,51601,51602,51603,51604,51605,51606,51607,51610,51612,51614,51615,51616,51617,51618,51619,51620,51621,51622,51623,51624,51625,51626,51627,51628,51629,51630,null,null,null,null,null,null,51631,51632,51633,51634,51635,51636,51637,51638,51639,51640,51641,51642,51643,51644,51645,51646,51647,51650,51651,51653,51654,51657,51659,51660,51661,51662,51663,51666,51668,51671,51672,51675,65281,65282,65283,65284,65285,65286,65287,65288,65289,65290,65291,65292,65293,65294,65295,65296,65297,65298,65299,65300,65301,65302,65303,65304,65305,65306,65307,65308,65309,65310,65311,65312,65313,65314,65315,65316,65317,65318,65319,65320,65321,65322,65323,65324,65325,65326,65327,65328,65329,65330,65331,65332,65333,65334,65335,65336,65337,65338,65339,65510,65341,65342,65343,65344,65345,65346,65347,65348,65349,65350,65351,65352,65353,65354,65355,65356,65357,65358,65359,65360,65361,65362,65363,65364,65365,65366,65367,65368,65369,65370,65371,65372,65373,65507,51678,51679,51681,51683,51685,51686,51688,51689,51690,51691,51694,51698,51699,51700,51701,51702,51703,51706,51707,51709,51710,51711,51713,51714,51715,51716,null,null,null,null,null,null,51717,51718,51719,51722,51726,51727,51728,51729,51730,51731,51733,51734,51735,51737,51738,51739,51740,51741,51742,51743,51744,51745,51746,51747,51748,51749,null,null,null,null,null,null,51750,51751,51752,51754,51755,51756,51757,51758,51759,51760,51761,51762,51763,51764,51765,51766,51767,51768,51769,51770,51771,51772,51773,51774,51775,51776,51777,51778,51779,51780,51781,51782,12593,12594,12595,12596,12597,12598,12599,12600,12601,12602,12603,12604,12605,12606,12607,12608,12609,12610,12611,12612,12613,12614,12615,12616,12617,12618,12619,12620,12621,12622,12623,12624,12625,12626,12627,12628,12629,12630,12631,12632,12633,12634,12635,12636,12637,12638,12639,12640,12641,12642,12643,12644,12645,12646,12647,12648,12649,12650,12651,12652,12653,12654,12655,12656,12657,12658,12659,12660,12661,12662,12663,12664,12665,12666,12667,12668,12669,12670,12671,12672,12673,12674,12675,12676,12677,12678,12679,12680,12681,12682,12683,12684,12685,12686,51783,51784,51785,51786,51787,51790,51791,51793,51794,51795,51797,51798,51799,51800,51801,51802,51803,51806,51810,51811,51812,51813,51814,51815,51817,51818,null,null,null,null,null,null,51819,51820,51821,51822,51823,51824,51825,51826,51827,51828,51829,51830,51831,51832,51833,51834,51835,51836,51838,51839,51840,51841,51842,51843,51845,51846,null,null,null,null,null,null,51847,51848,51849,51850,51851,51852,51853,51854,51855,51856,51857,51858,51859,51860,51861,51862,51863,51865,51866,51867,51868,51869,51870,51871,51872,51873,51874,51875,51876,51877,51878,51879,8560,8561,8562,8563,8564,8565,8566,8567,8568,8569,null,null,null,null,null,8544,8545,8546,8547,8548,8549,8550,8551,8552,8553,null,null,null,null,null,null,null,913,914,915,916,917,918,919,920,921,922,923,924,925,926,927,928,929,931,932,933,934,935,936,937,null,null,null,null,null,null,null,null,945,946,947,948,949,950,951,952,953,954,955,956,957,958,959,960,961,963,964,965,966,967,968,969,null,null,null,null,null,null,51880,51881,51882,51883,51884,51885,51886,51887,51888,51889,51890,51891,51892,51893,51894,51895,51896,51897,51898,51899,51902,51903,51905,51906,51907,51909,null,null,null,null,null,null,51910,51911,51912,51913,51914,51915,51918,51920,51922,51924,51925,51926,51927,51930,51931,51932,51933,51934,51935,51937,51938,51939,51940,51941,51942,51943,null,null,null,null,null,null,51944,51945,51946,51947,51949,51950,51951,51952,51953,51954,51955,51957,51958,51959,51960,51961,51962,51963,51964,51965,51966,51967,51968,51969,51970,51971,51972,51973,51974,51975,51977,51978,9472,9474,9484,9488,9496,9492,9500,9516,9508,9524,9532,9473,9475,9487,9491,9499,9495,9507,9523,9515,9531,9547,9504,9519,9512,9527,9535,9501,9520,9509,9528,9538,9490,9489,9498,9497,9494,9493,9486,9485,9502,9503,9505,9506,9510,9511,9513,9514,9517,9518,9521,9522,9525,9526,9529,9530,9533,9534,9536,9537,9539,9540,9541,9542,9543,9544,9545,9546,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,51979,51980,51981,51982,51983,51985,51986,51987,51989,51990,51991,51993,51994,51995,51996,51997,51998,51999,52002,52003,52004,52005,52006,52007,52008,52009,null,null,null,null,null,null,52010,52011,52012,52013,52014,52015,52016,52017,52018,52019,52020,52021,52022,52023,52024,52025,52026,52027,52028,52029,52030,52031,52032,52034,52035,52036,null,null,null,null,null,null,52037,52038,52039,52042,52043,52045,52046,52047,52049,52050,52051,52052,52053,52054,52055,52058,52059,52060,52062,52063,52064,52065,52066,52067,52069,52070,52071,52072,52073,52074,52075,52076,13205,13206,13207,8467,13208,13252,13219,13220,13221,13222,13209,13210,13211,13212,13213,13214,13215,13216,13217,13218,13258,13197,13198,13199,13263,13192,13193,13256,13223,13224,13232,13233,13234,13235,13236,13237,13238,13239,13240,13241,13184,13185,13186,13187,13188,13242,13243,13244,13245,13246,13247,13200,13201,13202,13203,13204,8486,13248,13249,13194,13195,13196,13270,13253,13229,13230,13231,13275,13225,13226,13227,13228,13277,13264,13267,13251,13257,13276,13254,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,52077,52078,52079,52080,52081,52082,52083,52084,52085,52086,52087,52090,52091,52092,52093,52094,52095,52096,52097,52098,52099,52100,52101,52102,52103,52104,null,null,null,null,null,null,52105,52106,52107,52108,52109,52110,52111,52112,52113,52114,52115,52116,52117,52118,52119,52120,52121,52122,52123,52125,52126,52127,52128,52129,52130,52131,null,null,null,null,null,null,52132,52133,52134,52135,52136,52137,52138,52139,52140,52141,52142,52143,52144,52145,52146,52147,52148,52149,52150,52151,52153,52154,52155,52156,52157,52158,52159,52160,52161,52162,52163,52164,198,208,170,294,null,306,null,319,321,216,338,186,222,358,330,null,12896,12897,12898,12899,12900,12901,12902,12903,12904,12905,12906,12907,12908,12909,12910,12911,12912,12913,12914,12915,12916,12917,12918,12919,12920,12921,12922,12923,9424,9425,9426,9427,9428,9429,9430,9431,9432,9433,9434,9435,9436,9437,9438,9439,9440,9441,9442,9443,9444,9445,9446,9447,9448,9449,9312,9313,9314,9315,9316,9317,9318,9319,9320,9321,9322,9323,9324,9325,9326,189,8531,8532,188,190,8539,8540,8541,8542,52165,52166,52167,52168,52169,52170,52171,52172,52173,52174,52175,52176,52177,52178,52179,52181,52182,52183,52184,52185,52186,52187,52188,52189,52190,52191,null,null,null,null,null,null,52192,52193,52194,52195,52197,52198,52200,52202,52203,52204,52205,52206,52207,52208,52209,52210,52211,52212,52213,52214,52215,52216,52217,52218,52219,52220,null,null,null,null,null,null,52221,52222,52223,52224,52225,52226,52227,52228,52229,52230,52231,52232,52233,52234,52235,52238,52239,52241,52242,52243,52245,52246,52247,52248,52249,52250,52251,52254,52255,52256,52259,52260,230,273,240,295,305,307,312,320,322,248,339,223,254,359,331,329,12800,12801,12802,12803,12804,12805,12806,12807,12808,12809,12810,12811,12812,12813,12814,12815,12816,12817,12818,12819,12820,12821,12822,12823,12824,12825,12826,12827,9372,9373,9374,9375,9376,9377,9378,9379,9380,9381,9382,9383,9384,9385,9386,9387,9388,9389,9390,9391,9392,9393,9394,9395,9396,9397,9332,9333,9334,9335,9336,9337,9338,9339,9340,9341,9342,9343,9344,9345,9346,185,178,179,8308,8319,8321,8322,8323,8324,52261,52262,52266,52267,52269,52271,52273,52274,52275,52276,52277,52278,52279,52282,52287,52288,52289,52290,52291,52294,52295,52297,52298,52299,52301,52302,null,null,null,null,null,null,52303,52304,52305,52306,52307,52310,52314,52315,52316,52317,52318,52319,52321,52322,52323,52325,52327,52329,52330,52331,52332,52333,52334,52335,52337,52338,null,null,null,null,null,null,52339,52340,52342,52343,52344,52345,52346,52347,52348,52349,52350,52351,52352,52353,52354,52355,52356,52357,52358,52359,52360,52361,52362,52363,52364,52365,52366,52367,52368,52369,52370,52371,12353,12354,12355,12356,12357,12358,12359,12360,12361,12362,12363,12364,12365,12366,12367,12368,12369,12370,12371,12372,12373,12374,12375,12376,12377,12378,12379,12380,12381,12382,12383,12384,12385,12386,12387,12388,12389,12390,12391,12392,12393,12394,12395,12396,12397,12398,12399,12400,12401,12402,12403,12404,12405,12406,12407,12408,12409,12410,12411,12412,12413,12414,12415,12416,12417,12418,12419,12420,12421,12422,12423,12424,12425,12426,12427,12428,12429,12430,12431,12432,12433,12434,12435,null,null,null,null,null,null,null,null,null,null,null,52372,52373,52374,52375,52378,52379,52381,52382,52383,52385,52386,52387,52388,52389,52390,52391,52394,52398,52399,52400,52401,52402,52403,52406,52407,52409,null,null,null,null,null,null,52410,52411,52413,52414,52415,52416,52417,52418,52419,52422,52424,52426,52427,52428,52429,52430,52431,52433,52434,52435,52437,52438,52439,52440,52441,52442,null,null,null,null,null,null,52443,52444,52445,52446,52447,52448,52449,52450,52451,52453,52454,52455,52456,52457,52458,52459,52461,52462,52463,52465,52466,52467,52468,52469,52470,52471,52472,52473,52474,52475,52476,52477,12449,12450,12451,12452,12453,12454,12455,12456,12457,12458,12459,12460,12461,12462,12463,12464,12465,12466,12467,12468,12469,12470,12471,12472,12473,12474,12475,12476,12477,12478,12479,12480,12481,12482,12483,12484,12485,12486,12487,12488,12489,12490,12491,12492,12493,12494,12495,12496,12497,12498,12499,12500,12501,12502,12503,12504,12505,12506,12507,12508,12509,12510,12511,12512,12513,12514,12515,12516,12517,12518,12519,12520,12521,12522,12523,12524,12525,12526,12527,12528,12529,12530,12531,12532,12533,12534,null,null,null,null,null,null,null,null,52478,52479,52480,52482,52483,52484,52485,52486,52487,52490,52491,52493,52494,52495,52497,52498,52499,52500,52501,52502,52503,52506,52508,52510,52511,52512,null,null,null,null,null,null,52513,52514,52515,52517,52518,52519,52521,52522,52523,52525,52526,52527,52528,52529,52530,52531,52532,52533,52534,52535,52536,52538,52539,52540,52541,52542,null,null,null,null,null,null,52543,52544,52545,52546,52547,52548,52549,52550,52551,52552,52553,52554,52555,52556,52557,52558,52559,52560,52561,52562,52563,52564,52565,52566,52567,52568,52569,52570,52571,52573,52574,52575,1040,1041,1042,1043,1044,1045,1025,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,1072,1073,1074,1075,1076,1077,1105,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,1103,null,null,null,null,null,null,null,null,null,null,null,null,null,52577,52578,52579,52581,52582,52583,52584,52585,52586,52587,52590,52592,52594,52595,52596,52597,52598,52599,52601,52602,52603,52604,52605,52606,52607,52608,null,null,null,null,null,null,52609,52610,52611,52612,52613,52614,52615,52617,52618,52619,52620,52621,52622,52623,52624,52625,52626,52627,52630,52631,52633,52634,52635,52637,52638,52639,null,null,null,null,null,null,52640,52641,52642,52643,52646,52648,52650,52651,52652,52653,52654,52655,52657,52658,52659,52660,52661,52662,52663,52664,52665,52666,52667,52668,52669,52670,52671,52672,52673,52674,52675,52677,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,52678,52679,52680,52681,52682,52683,52685,52686,52687,52689,52690,52691,52692,52693,52694,52695,52696,52697,52698,52699,52700,52701,52702,52703,52704,52705,null,null,null,null,null,null,52706,52707,52708,52709,52710,52711,52713,52714,52715,52717,52718,52719,52721,52722,52723,52724,52725,52726,52727,52730,52732,52734,52735,52736,52737,52738,null,null,null,null,null,null,52739,52741,52742,52743,52745,52746,52747,52749,52750,52751,52752,52753,52754,52755,52757,52758,52759,52760,52762,52763,52764,52765,52766,52767,52770,52771,52773,52774,52775,52777,52778,52779,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,52780,52781,52782,52783,52786,52788,52790,52791,52792,52793,52794,52795,52796,52797,52798,52799,52800,52801,52802,52803,52804,52805,52806,52807,52808,52809,null,null,null,null,null,null,52810,52811,52812,52813,52814,52815,52816,52817,52818,52819,52820,52821,52822,52823,52826,52827,52829,52830,52834,52835,52836,52837,52838,52839,52842,52844,null,null,null,null,null,null,52846,52847,52848,52849,52850,52851,52854,52855,52857,52858,52859,52861,52862,52863,52864,52865,52866,52867,52870,52872,52874,52875,52876,52877,52878,52879,52882,52883,52885,52886,52887,52889,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,52890,52891,52892,52893,52894,52895,52898,52902,52903,52904,52905,52906,52907,52910,52911,52912,52913,52914,52915,52916,52917,52918,52919,52920,52921,52922,null,null,null,null,null,null,52923,52924,52925,52926,52927,52928,52930,52931,52932,52933,52934,52935,52936,52937,52938,52939,52940,52941,52942,52943,52944,52945,52946,52947,52948,52949,null,null,null,null,null,null,52950,52951,52952,52953,52954,52955,52956,52957,52958,52959,52960,52961,52962,52963,52966,52967,52969,52970,52973,52974,52975,52976,52977,52978,52979,52982,52986,52987,52988,52989,52990,52991,44032,44033,44036,44039,44040,44041,44042,44048,44049,44050,44051,44052,44053,44054,44055,44057,44058,44059,44060,44061,44064,44068,44076,44077,44079,44080,44081,44088,44089,44092,44096,44107,44109,44116,44120,44124,44144,44145,44148,44151,44152,44154,44160,44161,44163,44164,44165,44166,44169,44170,44171,44172,44176,44180,44188,44189,44191,44192,44193,44200,44201,44202,44204,44207,44208,44216,44217,44219,44220,44221,44225,44228,44232,44236,44245,44247,44256,44257,44260,44263,44264,44266,44268,44271,44272,44273,44275,44277,44278,44284,44285,44288,44292,44294,52994,52995,52997,52998,52999,53001,53002,53003,53004,53005,53006,53007,53010,53012,53014,53015,53016,53017,53018,53019,53021,53022,53023,53025,53026,53027,null,null,null,null,null,null,53029,53030,53031,53032,53033,53034,53035,53038,53042,53043,53044,53045,53046,53047,53049,53050,53051,53052,53053,53054,53055,53056,53057,53058,53059,53060,null,null,null,null,null,null,53061,53062,53063,53064,53065,53066,53067,53068,53069,53070,53071,53072,53073,53074,53075,53078,53079,53081,53082,53083,53085,53086,53087,53088,53089,53090,53091,53094,53096,53098,53099,53100,44300,44301,44303,44305,44312,44316,44320,44329,44332,44333,44340,44341,44344,44348,44356,44357,44359,44361,44368,44372,44376,44385,44387,44396,44397,44400,44403,44404,44405,44406,44411,44412,44413,44415,44417,44418,44424,44425,44428,44432,44444,44445,44452,44471,44480,44481,44484,44488,44496,44497,44499,44508,44512,44516,44536,44537,44540,44543,44544,44545,44552,44553,44555,44557,44564,44592,44593,44596,44599,44600,44602,44608,44609,44611,44613,44614,44618,44620,44621,44622,44624,44628,44630,44636,44637,44639,44640,44641,44645,44648,44649,44652,44656,44664,53101,53102,53103,53106,53107,53109,53110,53111,53113,53114,53115,53116,53117,53118,53119,53121,53122,53123,53124,53126,53127,53128,53129,53130,53131,53133,null,null,null,null,null,null,53134,53135,53136,53137,53138,53139,53140,53141,53142,53143,53144,53145,53146,53147,53148,53149,53150,53151,53152,53154,53155,53156,53157,53158,53159,53161,null,null,null,null,null,null,53162,53163,53164,53165,53166,53167,53169,53170,53171,53172,53173,53174,53175,53176,53177,53178,53179,53180,53181,53182,53183,53184,53185,53186,53187,53189,53190,53191,53192,53193,53194,53195,44665,44667,44668,44669,44676,44677,44684,44732,44733,44734,44736,44740,44748,44749,44751,44752,44753,44760,44761,44764,44776,44779,44781,44788,44792,44796,44807,44808,44813,44816,44844,44845,44848,44850,44852,44860,44861,44863,44865,44866,44867,44872,44873,44880,44892,44893,44900,44901,44921,44928,44932,44936,44944,44945,44949,44956,44984,44985,44988,44992,44999,45000,45001,45003,45005,45006,45012,45020,45032,45033,45040,45041,45044,45048,45056,45057,45060,45068,45072,45076,45084,45085,45096,45124,45125,45128,45130,45132,45134,45139,45140,45141,45143,45145,53196,53197,53198,53199,53200,53201,53202,53203,53204,53205,53206,53207,53208,53209,53210,53211,53212,53213,53214,53215,53218,53219,53221,53222,53223,53225,null,null,null,null,null,null,53226,53227,53228,53229,53230,53231,53234,53236,53238,53239,53240,53241,53242,53243,53245,53246,53247,53249,53250,53251,53253,53254,53255,53256,53257,53258,null,null,null,null,null,null,53259,53260,53261,53262,53263,53264,53266,53267,53268,53269,53270,53271,53273,53274,53275,53276,53277,53278,53279,53280,53281,53282,53283,53284,53285,53286,53287,53288,53289,53290,53291,53292,45149,45180,45181,45184,45188,45196,45197,45199,45201,45208,45209,45210,45212,45215,45216,45217,45218,45224,45225,45227,45228,45229,45230,45231,45233,45235,45236,45237,45240,45244,45252,45253,45255,45256,45257,45264,45265,45268,45272,45280,45285,45320,45321,45323,45324,45328,45330,45331,45336,45337,45339,45340,45341,45347,45348,45349,45352,45356,45364,45365,45367,45368,45369,45376,45377,45380,45384,45392,45393,45396,45397,45400,45404,45408,45432,45433,45436,45440,45442,45448,45449,45451,45453,45458,45459,45460,45464,45468,45480,45516,45520,45524,45532,45533,53294,53295,53296,53297,53298,53299,53302,53303,53305,53306,53307,53309,53310,53311,53312,53313,53314,53315,53318,53320,53322,53323,53324,53325,53326,53327,null,null,null,null,null,null,53329,53330,53331,53333,53334,53335,53337,53338,53339,53340,53341,53342,53343,53345,53346,53347,53348,53349,53350,53351,53352,53353,53354,53355,53358,53359,null,null,null,null,null,null,53361,53362,53363,53365,53366,53367,53368,53369,53370,53371,53374,53375,53376,53378,53379,53380,53381,53382,53383,53384,53385,53386,53387,53388,53389,53390,53391,53392,53393,53394,53395,53396,45535,45544,45545,45548,45552,45561,45563,45565,45572,45573,45576,45579,45580,45588,45589,45591,45593,45600,45620,45628,45656,45660,45664,45672,45673,45684,45685,45692,45700,45701,45705,45712,45713,45716,45720,45721,45722,45728,45729,45731,45733,45734,45738,45740,45744,45748,45768,45769,45772,45776,45778,45784,45785,45787,45789,45794,45796,45797,45798,45800,45803,45804,45805,45806,45807,45811,45812,45813,45815,45816,45817,45818,45819,45823,45824,45825,45828,45832,45840,45841,45843,45844,45845,45852,45908,45909,45910,45912,45915,45916,45918,45919,45924,45925,53397,53398,53399,53400,53401,53402,53403,53404,53405,53406,53407,53408,53409,53410,53411,53414,53415,53417,53418,53419,53421,53422,53423,53424,53425,53426,null,null,null,null,null,null,53427,53430,53432,53434,53435,53436,53437,53438,53439,53442,53443,53445,53446,53447,53450,53451,53452,53453,53454,53455,53458,53462,53463,53464,53465,53466,null,null,null,null,null,null,53467,53470,53471,53473,53474,53475,53477,53478,53479,53480,53481,53482,53483,53486,53490,53491,53492,53493,53494,53495,53497,53498,53499,53500,53501,53502,53503,53504,53505,53506,53507,53508,45927,45929,45931,45934,45936,45937,45940,45944,45952,45953,45955,45956,45957,45964,45968,45972,45984,45985,45992,45996,46020,46021,46024,46027,46028,46030,46032,46036,46037,46039,46041,46043,46045,46048,46052,46056,46076,46096,46104,46108,46112,46120,46121,46123,46132,46160,46161,46164,46168,46176,46177,46179,46181,46188,46208,46216,46237,46244,46248,46252,46261,46263,46265,46272,46276,46280,46288,46293,46300,46301,46304,46307,46308,46310,46316,46317,46319,46321,46328,46356,46357,46360,46363,46364,46372,46373,46375,46376,46377,46378,46384,46385,46388,46392,53509,53510,53511,53512,53513,53514,53515,53516,53518,53519,53520,53521,53522,53523,53524,53525,53526,53527,53528,53529,53530,53531,53532,53533,53534,53535,null,null,null,null,null,null,53536,53537,53538,53539,53540,53541,53542,53543,53544,53545,53546,53547,53548,53549,53550,53551,53554,53555,53557,53558,53559,53561,53563,53564,53565,53566,null,null,null,null,null,null,53567,53570,53574,53575,53576,53577,53578,53579,53582,53583,53585,53586,53587,53589,53590,53591,53592,53593,53594,53595,53598,53600,53602,53603,53604,53605,53606,53607,53609,53610,53611,53613,46400,46401,46403,46404,46405,46411,46412,46413,46416,46420,46428,46429,46431,46432,46433,46496,46497,46500,46504,46506,46507,46512,46513,46515,46516,46517,46523,46524,46525,46528,46532,46540,46541,46543,46544,46545,46552,46572,46608,46609,46612,46616,46629,46636,46644,46664,46692,46696,46748,46749,46752,46756,46763,46764,46769,46804,46832,46836,46840,46848,46849,46853,46888,46889,46892,46895,46896,46904,46905,46907,46916,46920,46924,46932,46933,46944,46948,46952,46960,46961,46963,46965,46972,46973,46976,46980,46988,46989,46991,46992,46993,46994,46998,46999,53614,53615,53616,53617,53618,53619,53620,53621,53622,53623,53624,53625,53626,53627,53629,53630,53631,53632,53633,53634,53635,53637,53638,53639,53641,53642,null,null,null,null,null,null,53643,53644,53645,53646,53647,53648,53649,53650,53651,53652,53653,53654,53655,53656,53657,53658,53659,53660,53661,53662,53663,53666,53667,53669,53670,53671,null,null,null,null,null,null,53673,53674,53675,53676,53677,53678,53679,53682,53684,53686,53687,53688,53689,53691,53693,53694,53695,53697,53698,53699,53700,53701,53702,53703,53704,53705,53706,53707,53708,53709,53710,53711,47000,47001,47004,47008,47016,47017,47019,47020,47021,47028,47029,47032,47047,47049,47084,47085,47088,47092,47100,47101,47103,47104,47105,47111,47112,47113,47116,47120,47128,47129,47131,47133,47140,47141,47144,47148,47156,47157,47159,47160,47161,47168,47172,47185,47187,47196,47197,47200,47204,47212,47213,47215,47217,47224,47228,47245,47272,47280,47284,47288,47296,47297,47299,47301,47308,47312,47316,47325,47327,47329,47336,47337,47340,47344,47352,47353,47355,47357,47364,47384,47392,47420,47421,47424,47428,47436,47439,47441,47448,47449,47452,47456,47464,47465,53712,53713,53714,53715,53716,53717,53718,53719,53721,53722,53723,53724,53725,53726,53727,53728,53729,53730,53731,53732,53733,53734,53735,53736,53737,53738,null,null,null,null,null,null,53739,53740,53741,53742,53743,53744,53745,53746,53747,53749,53750,53751,53753,53754,53755,53756,53757,53758,53759,53760,53761,53762,53763,53764,53765,53766,null,null,null,null,null,null,53768,53770,53771,53772,53773,53774,53775,53777,53778,53779,53780,53781,53782,53783,53784,53785,53786,53787,53788,53789,53790,53791,53792,53793,53794,53795,53796,53797,53798,53799,53800,53801,47467,47469,47476,47477,47480,47484,47492,47493,47495,47497,47498,47501,47502,47532,47533,47536,47540,47548,47549,47551,47553,47560,47561,47564,47566,47567,47568,47569,47570,47576,47577,47579,47581,47582,47585,47587,47588,47589,47592,47596,47604,47605,47607,47608,47609,47610,47616,47617,47624,47637,47672,47673,47676,47680,47682,47688,47689,47691,47693,47694,47699,47700,47701,47704,47708,47716,47717,47719,47720,47721,47728,47729,47732,47736,47747,47748,47749,47751,47756,47784,47785,47787,47788,47792,47794,47800,47801,47803,47805,47812,47816,47832,47833,47868,53802,53803,53806,53807,53809,53810,53811,53813,53814,53815,53816,53817,53818,53819,53822,53824,53826,53827,53828,53829,53830,53831,53833,53834,53835,53836,null,null,null,null,null,null,53837,53838,53839,53840,53841,53842,53843,53844,53845,53846,53847,53848,53849,53850,53851,53853,53854,53855,53856,53857,53858,53859,53861,53862,53863,53864,null,null,null,null,null,null,53865,53866,53867,53868,53869,53870,53871,53872,53873,53874,53875,53876,53877,53878,53879,53880,53881,53882,53883,53884,53885,53886,53887,53890,53891,53893,53894,53895,53897,53898,53899,53900,47872,47876,47885,47887,47889,47896,47900,47904,47913,47915,47924,47925,47926,47928,47931,47932,47933,47934,47940,47941,47943,47945,47949,47951,47952,47956,47960,47969,47971,47980,48008,48012,48016,48036,48040,48044,48052,48055,48064,48068,48072,48080,48083,48120,48121,48124,48127,48128,48130,48136,48137,48139,48140,48141,48143,48145,48148,48149,48150,48151,48152,48155,48156,48157,48158,48159,48164,48165,48167,48169,48173,48176,48177,48180,48184,48192,48193,48195,48196,48197,48201,48204,48205,48208,48221,48260,48261,48264,48267,48268,48270,48276,48277,48279,53901,53902,53903,53906,53907,53908,53910,53911,53912,53913,53914,53915,53917,53918,53919,53921,53922,53923,53925,53926,53927,53928,53929,53930,53931,53933,null,null,null,null,null,null,53934,53935,53936,53938,53939,53940,53941,53942,53943,53946,53947,53949,53950,53953,53955,53956,53957,53958,53959,53962,53964,53965,53966,53967,53968,53969,null,null,null,null,null,null,53970,53971,53973,53974,53975,53977,53978,53979,53981,53982,53983,53984,53985,53986,53987,53990,53991,53992,53993,53994,53995,53996,53997,53998,53999,54002,54003,54005,54006,54007,54009,54010,48281,48282,48288,48289,48292,48295,48296,48304,48305,48307,48308,48309,48316,48317,48320,48324,48333,48335,48336,48337,48341,48344,48348,48372,48373,48374,48376,48380,48388,48389,48391,48393,48400,48404,48420,48428,48448,48456,48457,48460,48464,48472,48473,48484,48488,48512,48513,48516,48519,48520,48521,48522,48528,48529,48531,48533,48537,48538,48540,48548,48560,48568,48596,48597,48600,48604,48617,48624,48628,48632,48640,48643,48645,48652,48653,48656,48660,48668,48669,48671,48708,48709,48712,48716,48718,48724,48725,48727,48729,48730,48731,48736,48737,48740,54011,54012,54013,54014,54015,54018,54020,54022,54023,54024,54025,54026,54027,54031,54033,54034,54035,54037,54039,54040,54041,54042,54043,54046,54050,54051,null,null,null,null,null,null,54052,54054,54055,54058,54059,54061,54062,54063,54065,54066,54067,54068,54069,54070,54071,54074,54078,54079,54080,54081,54082,54083,54086,54087,54088,54089,null,null,null,null,null,null,54090,54091,54092,54093,54094,54095,54096,54097,54098,54099,54100,54101,54102,54103,54104,54105,54106,54107,54108,54109,54110,54111,54112,54113,54114,54115,54116,54117,54118,54119,54120,54121,48744,48746,48752,48753,48755,48756,48757,48763,48764,48765,48768,48772,48780,48781,48783,48784,48785,48792,48793,48808,48848,48849,48852,48855,48856,48864,48867,48868,48869,48876,48897,48904,48905,48920,48921,48923,48924,48925,48960,48961,48964,48968,48976,48977,48981,49044,49072,49093,49100,49101,49104,49108,49116,49119,49121,49212,49233,49240,49244,49248,49256,49257,49296,49297,49300,49304,49312,49313,49315,49317,49324,49325,49327,49328,49331,49332,49333,49334,49340,49341,49343,49344,49345,49349,49352,49353,49356,49360,49368,49369,49371,49372,49373,49380,54122,54123,54124,54125,54126,54127,54128,54129,54130,54131,54132,54133,54134,54135,54136,54137,54138,54139,54142,54143,54145,54146,54147,54149,54150,54151,null,null,null,null,null,null,54152,54153,54154,54155,54158,54162,54163,54164,54165,54166,54167,54170,54171,54173,54174,54175,54177,54178,54179,54180,54181,54182,54183,54186,54188,54190,null,null,null,null,null,null,54191,54192,54193,54194,54195,54197,54198,54199,54201,54202,54203,54205,54206,54207,54208,54209,54210,54211,54214,54215,54218,54219,54220,54221,54222,54223,54225,54226,54227,54228,54229,54230,49381,49384,49388,49396,49397,49399,49401,49408,49412,49416,49424,49429,49436,49437,49438,49439,49440,49443,49444,49446,49447,49452,49453,49455,49456,49457,49462,49464,49465,49468,49472,49480,49481,49483,49484,49485,49492,49493,49496,49500,49508,49509,49511,49512,49513,49520,49524,49528,49541,49548,49549,49550,49552,49556,49558,49564,49565,49567,49569,49573,49576,49577,49580,49584,49597,49604,49608,49612,49620,49623,49624,49632,49636,49640,49648,49649,49651,49660,49661,49664,49668,49676,49677,49679,49681,49688,49689,49692,49695,49696,49704,49705,49707,49709,54231,54233,54234,54235,54236,54237,54238,54239,54240,54242,54244,54245,54246,54247,54248,54249,54250,54251,54254,54255,54257,54258,54259,54261,54262,54263,null,null,null,null,null,null,54264,54265,54266,54267,54270,54272,54274,54275,54276,54277,54278,54279,54281,54282,54283,54284,54285,54286,54287,54288,54289,54290,54291,54292,54293,54294,null,null,null,null,null,null,54295,54296,54297,54298,54299,54300,54302,54303,54304,54305,54306,54307,54308,54309,54310,54311,54312,54313,54314,54315,54316,54317,54318,54319,54320,54321,54322,54323,54324,54325,54326,54327,49711,49713,49714,49716,49736,49744,49745,49748,49752,49760,49765,49772,49773,49776,49780,49788,49789,49791,49793,49800,49801,49808,49816,49819,49821,49828,49829,49832,49836,49837,49844,49845,49847,49849,49884,49885,49888,49891,49892,49899,49900,49901,49903,49905,49910,49912,49913,49915,49916,49920,49928,49929,49932,49933,49939,49940,49941,49944,49948,49956,49957,49960,49961,49989,50024,50025,50028,50032,50034,50040,50041,50044,50045,50052,50056,50060,50112,50136,50137,50140,50143,50144,50146,50152,50153,50157,50164,50165,50168,50184,50192,50212,50220,50224,54328,54329,54330,54331,54332,54333,54334,54335,54337,54338,54339,54341,54342,54343,54344,54345,54346,54347,54348,54349,54350,54351,54352,54353,54354,54355,null,null,null,null,null,null,54356,54357,54358,54359,54360,54361,54362,54363,54365,54366,54367,54369,54370,54371,54373,54374,54375,54376,54377,54378,54379,54380,54382,54384,54385,54386,null,null,null,null,null,null,54387,54388,54389,54390,54391,54394,54395,54397,54398,54401,54403,54404,54405,54406,54407,54410,54412,54414,54415,54416,54417,54418,54419,54421,54422,54423,54424,54425,54426,54427,54428,54429,50228,50236,50237,50248,50276,50277,50280,50284,50292,50293,50297,50304,50324,50332,50360,50364,50409,50416,50417,50420,50424,50426,50431,50432,50433,50444,50448,50452,50460,50472,50473,50476,50480,50488,50489,50491,50493,50500,50501,50504,50505,50506,50508,50509,50510,50515,50516,50517,50519,50520,50521,50525,50526,50528,50529,50532,50536,50544,50545,50547,50548,50549,50556,50557,50560,50564,50567,50572,50573,50575,50577,50581,50583,50584,50588,50592,50601,50612,50613,50616,50617,50619,50620,50621,50622,50628,50629,50630,50631,50632,50633,50634,50636,50638,54430,54431,54432,54433,54434,54435,54436,54437,54438,54439,54440,54442,54443,54444,54445,54446,54447,54448,54449,54450,54451,54452,54453,54454,54455,54456,null,null,null,null,null,null,54457,54458,54459,54460,54461,54462,54463,54464,54465,54466,54467,54468,54469,54470,54471,54472,54473,54474,54475,54477,54478,54479,54481,54482,54483,54485,null,null,null,null,null,null,54486,54487,54488,54489,54490,54491,54493,54494,54496,54497,54498,54499,54500,54501,54502,54503,54505,54506,54507,54509,54510,54511,54513,54514,54515,54516,54517,54518,54519,54521,54522,54524,50640,50641,50644,50648,50656,50657,50659,50661,50668,50669,50670,50672,50676,50678,50679,50684,50685,50686,50687,50688,50689,50693,50694,50695,50696,50700,50704,50712,50713,50715,50716,50724,50725,50728,50732,50733,50734,50736,50739,50740,50741,50743,50745,50747,50752,50753,50756,50760,50768,50769,50771,50772,50773,50780,50781,50784,50796,50799,50801,50808,50809,50812,50816,50824,50825,50827,50829,50836,50837,50840,50844,50852,50853,50855,50857,50864,50865,50868,50872,50873,50874,50880,50881,50883,50885,50892,50893,50896,50900,50908,50909,50912,50913,50920,54526,54527,54528,54529,54530,54531,54533,54534,54535,54537,54538,54539,54541,54542,54543,54544,54545,54546,54547,54550,54552,54553,54554,54555,54556,54557,null,null,null,null,null,null,54558,54559,54560,54561,54562,54563,54564,54565,54566,54567,54568,54569,54570,54571,54572,54573,54574,54575,54576,54577,54578,54579,54580,54581,54582,54583,null,null,null,null,null,null,54584,54585,54586,54587,54590,54591,54593,54594,54595,54597,54598,54599,54600,54601,54602,54603,54606,54608,54610,54611,54612,54613,54614,54615,54618,54619,54621,54622,54623,54625,54626,54627,50921,50924,50928,50936,50937,50941,50948,50949,50952,50956,50964,50965,50967,50969,50976,50977,50980,50984,50992,50993,50995,50997,50999,51004,51005,51008,51012,51018,51020,51021,51023,51025,51026,51027,51028,51029,51030,51031,51032,51036,51040,51048,51051,51060,51061,51064,51068,51069,51070,51075,51076,51077,51079,51080,51081,51082,51086,51088,51089,51092,51094,51095,51096,51098,51104,51105,51107,51108,51109,51110,51116,51117,51120,51124,51132,51133,51135,51136,51137,51144,51145,51148,51150,51152,51160,51165,51172,51176,51180,51200,51201,51204,51208,51210,54628,54630,54631,54634,54636,54638,54639,54640,54641,54642,54643,54646,54647,54649,54650,54651,54653,54654,54655,54656,54657,54658,54659,54662,54666,54667,null,null,null,null,null,null,54668,54669,54670,54671,54673,54674,54675,54676,54677,54678,54679,54680,54681,54682,54683,54684,54685,54686,54687,54688,54689,54690,54691,54692,54694,54695,null,null,null,null,null,null,54696,54697,54698,54699,54700,54701,54702,54703,54704,54705,54706,54707,54708,54709,54710,54711,54712,54713,54714,54715,54716,54717,54718,54719,54720,54721,54722,54723,54724,54725,54726,54727,51216,51217,51219,51221,51222,51228,51229,51232,51236,51244,51245,51247,51249,51256,51260,51264,51272,51273,51276,51277,51284,51312,51313,51316,51320,51322,51328,51329,51331,51333,51334,51335,51339,51340,51341,51348,51357,51359,51361,51368,51388,51389,51396,51400,51404,51412,51413,51415,51417,51424,51425,51428,51445,51452,51453,51456,51460,51461,51462,51468,51469,51471,51473,51480,51500,51508,51536,51537,51540,51544,51552,51553,51555,51564,51568,51572,51580,51592,51593,51596,51600,51608,51609,51611,51613,51648,51649,51652,51655,51656,51658,51664,51665,51667,54730,54731,54733,54734,54735,54737,54739,54740,54741,54742,54743,54746,54748,54750,54751,54752,54753,54754,54755,54758,54759,54761,54762,54763,54765,54766,null,null,null,null,null,null,54767,54768,54769,54770,54771,54774,54776,54778,54779,54780,54781,54782,54783,54786,54787,54789,54790,54791,54793,54794,54795,54796,54797,54798,54799,54802,null,null,null,null,null,null,54806,54807,54808,54809,54810,54811,54813,54814,54815,54817,54818,54819,54821,54822,54823,54824,54825,54826,54827,54828,54830,54831,54832,54833,54834,54835,54836,54837,54838,54839,54842,54843,51669,51670,51673,51674,51676,51677,51680,51682,51684,51687,51692,51693,51695,51696,51697,51704,51705,51708,51712,51720,51721,51723,51724,51725,51732,51736,51753,51788,51789,51792,51796,51804,51805,51807,51808,51809,51816,51837,51844,51864,51900,51901,51904,51908,51916,51917,51919,51921,51923,51928,51929,51936,51948,51956,51976,51984,51988,51992,52000,52001,52033,52040,52041,52044,52048,52056,52057,52061,52068,52088,52089,52124,52152,52180,52196,52199,52201,52236,52237,52240,52244,52252,52253,52257,52258,52263,52264,52265,52268,52270,52272,52280,52281,52283,54845,54846,54847,54849,54850,54851,54852,54854,54855,54858,54860,54862,54863,54864,54866,54867,54870,54871,54873,54874,54875,54877,54878,54879,54880,54881,null,null,null,null,null,null,54882,54883,54884,54885,54886,54888,54890,54891,54892,54893,54894,54895,54898,54899,54901,54902,54903,54904,54905,54906,54907,54908,54909,54910,54911,54912,null,null,null,null,null,null,54913,54914,54916,54918,54919,54920,54921,54922,54923,54926,54927,54929,54930,54931,54933,54934,54935,54936,54937,54938,54939,54940,54942,54944,54946,54947,54948,54949,54950,54951,54953,54954,52284,52285,52286,52292,52293,52296,52300,52308,52309,52311,52312,52313,52320,52324,52326,52328,52336,52341,52376,52377,52380,52384,52392,52393,52395,52396,52397,52404,52405,52408,52412,52420,52421,52423,52425,52432,52436,52452,52460,52464,52481,52488,52489,52492,52496,52504,52505,52507,52509,52516,52520,52524,52537,52572,52576,52580,52588,52589,52591,52593,52600,52616,52628,52629,52632,52636,52644,52645,52647,52649,52656,52676,52684,52688,52712,52716,52720,52728,52729,52731,52733,52740,52744,52748,52756,52761,52768,52769,52772,52776,52784,52785,52787,52789,54955,54957,54958,54959,54961,54962,54963,54964,54965,54966,54967,54968,54970,54972,54973,54974,54975,54976,54977,54978,54979,54982,54983,54985,54986,54987,null,null,null,null,null,null,54989,54990,54991,54992,54994,54995,54997,54998,55000,55002,55003,55004,55005,55006,55007,55009,55010,55011,55013,55014,55015,55017,55018,55019,55020,55021,null,null,null,null,null,null,55022,55023,55025,55026,55027,55028,55030,55031,55032,55033,55034,55035,55038,55039,55041,55042,55043,55045,55046,55047,55048,55049,55050,55051,55052,55053,55054,55055,55056,55058,55059,55060,52824,52825,52828,52831,52832,52833,52840,52841,52843,52845,52852,52853,52856,52860,52868,52869,52871,52873,52880,52881,52884,52888,52896,52897,52899,52900,52901,52908,52909,52929,52964,52965,52968,52971,52972,52980,52981,52983,52984,52985,52992,52993,52996,53000,53008,53009,53011,53013,53020,53024,53028,53036,53037,53039,53040,53041,53048,53076,53077,53080,53084,53092,53093,53095,53097,53104,53105,53108,53112,53120,53125,53132,53153,53160,53168,53188,53216,53217,53220,53224,53232,53233,53235,53237,53244,53248,53252,53265,53272,53293,53300,53301,53304,53308,55061,55062,55063,55066,55067,55069,55070,55071,55073,55074,55075,55076,55077,55078,55079,55082,55084,55086,55087,55088,55089,55090,55091,55094,55095,55097,null,null,null,null,null,null,55098,55099,55101,55102,55103,55104,55105,55106,55107,55109,55110,55112,55114,55115,55116,55117,55118,55119,55122,55123,55125,55130,55131,55132,55133,55134,null,null,null,null,null,null,55135,55138,55140,55142,55143,55144,55146,55147,55149,55150,55151,55153,55154,55155,55157,55158,55159,55160,55161,55162,55163,55166,55167,55168,55170,55171,55172,55173,55174,55175,55178,55179,53316,53317,53319,53321,53328,53332,53336,53344,53356,53357,53360,53364,53372,53373,53377,53412,53413,53416,53420,53428,53429,53431,53433,53440,53441,53444,53448,53449,53456,53457,53459,53460,53461,53468,53469,53472,53476,53484,53485,53487,53488,53489,53496,53517,53552,53553,53556,53560,53562,53568,53569,53571,53572,53573,53580,53581,53584,53588,53596,53597,53599,53601,53608,53612,53628,53636,53640,53664,53665,53668,53672,53680,53681,53683,53685,53690,53692,53696,53720,53748,53752,53767,53769,53776,53804,53805,53808,53812,53820,53821,53823,53825,53832,53852,55181,55182,55183,55185,55186,55187,55188,55189,55190,55191,55194,55196,55198,55199,55200,55201,55202,55203,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,53860,53888,53889,53892,53896,53904,53905,53909,53916,53920,53924,53932,53937,53944,53945,53948,53951,53952,53954,53960,53961,53963,53972,53976,53980,53988,53989,54000,54001,54004,54008,54016,54017,54019,54021,54028,54029,54030,54032,54036,54038,54044,54045,54047,54048,54049,54053,54056,54057,54060,54064,54072,54073,54075,54076,54077,54084,54085,54140,54141,54144,54148,54156,54157,54159,54160,54161,54168,54169,54172,54176,54184,54185,54187,54189,54196,54200,54204,54212,54213,54216,54217,54224,54232,54241,54243,54252,54253,54256,54260,54268,54269,54271,54273,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,54280,54301,54336,54340,54364,54368,54372,54381,54383,54392,54393,54396,54399,54400,54402,54408,54409,54411,54413,54420,54441,54476,54480,54484,54492,54495,54504,54508,54512,54520,54523,54525,54532,54536,54540,54548,54549,54551,54588,54589,54592,54596,54604,54605,54607,54609,54616,54617,54620,54624,54629,54632,54633,54635,54637,54644,54645,54648,54652,54660,54661,54663,54664,54665,54672,54693,54728,54729,54732,54736,54738,54744,54745,54747,54749,54756,54757,54760,54764,54772,54773,54775,54777,54784,54785,54788,54792,54800,54801,54803,54804,54805,54812,54816,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,54820,54829,54840,54841,54844,54848,54853,54856,54857,54859,54861,54865,54868,54869,54872,54876,54887,54889,54896,54897,54900,54915,54917,54924,54925,54928,54932,54941,54943,54945,54952,54956,54960,54969,54971,54980,54981,54984,54988,54993,54996,54999,55001,55008,55012,55016,55024,55029,55036,55037,55040,55044,55057,55064,55065,55068,55072,55080,55081,55083,55085,55092,55093,55096,55100,55108,55111,55113,55120,55121,55124,55126,55127,55128,55129,55136,55137,55139,55141,55145,55148,55152,55156,55164,55165,55169,55176,55177,55180,55184,55192,55193,55195,55197,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,20285,20339,20551,20729,21152,21487,21621,21733,22025,23233,23478,26247,26550,26551,26607,27468,29634,30146,31292,33499,33540,34903,34952,35382,36040,36303,36603,36838,39381,21051,21364,21508,24682,24932,27580,29647,33050,35258,35282,38307,20355,21002,22718,22904,23014,24178,24185,25031,25536,26438,26604,26751,28567,30286,30475,30965,31240,31487,31777,32925,33390,33393,35563,38291,20075,21917,26359,28212,30883,31469,33883,35088,34638,38824,21208,22350,22570,23884,24863,25022,25121,25954,26577,27204,28187,29976,30131,30435,30640,32058,37039,37969,37970,40853,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,21283,23724,30002,32987,37440,38296,21083,22536,23004,23713,23831,24247,24378,24394,24951,27743,30074,30086,31968,32115,32177,32652,33108,33313,34193,35137,35611,37628,38477,40007,20171,20215,20491,20977,22607,24887,24894,24936,25913,27114,28433,30117,30342,30422,31623,33445,33995,63744,37799,38283,21888,23458,22353,63745,31923,32697,37301,20520,21435,23621,24040,25298,25454,25818,25831,28192,28844,31067,36317,36382,63746,36989,37445,37624,20094,20214,20581,24062,24314,24838,26967,33137,34388,36423,37749,39467,20062,20625,26480,26688,20745,21133,21138,27298,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,30652,37392,40660,21163,24623,36850,20552,25001,25581,25802,26684,27268,28608,33160,35233,38548,22533,29309,29356,29956,32121,32365,32937,35211,35700,36963,40273,25225,27770,28500,32080,32570,35363,20860,24906,31645,35609,37463,37772,20140,20435,20510,20670,20742,21185,21197,21375,22384,22659,24218,24465,24950,25004,25806,25964,26223,26299,26356,26775,28039,28805,28913,29855,29861,29898,30169,30828,30956,31455,31478,32069,32147,32789,32831,33051,33686,35686,36629,36885,37857,38915,38968,39514,39912,20418,21843,22586,22865,23395,23622,24760,25106,26690,26800,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,26856,28330,30028,30328,30926,31293,31995,32363,32380,35336,35489,35903,38542,40388,21476,21481,21578,21617,22266,22993,23396,23611,24235,25335,25911,25925,25970,26272,26543,27073,27837,30204,30352,30590,31295,32660,32771,32929,33167,33510,33533,33776,34241,34865,34996,35493,63747,36764,37678,38599,39015,39640,40723,21741,26011,26354,26767,31296,35895,40288,22256,22372,23825,26118,26801,26829,28414,29736,34974,39908,27752,63748,39592,20379,20844,20849,21151,23380,24037,24656,24685,25329,25511,25915,29657,31354,34467,36002,38799,20018,23521,25096,26524,29916,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,31185,33747,35463,35506,36328,36942,37707,38982,24275,27112,34303,37101,63749,20896,23448,23532,24931,26874,27454,28748,29743,29912,31649,32592,33733,35264,36011,38364,39208,21038,24669,25324,36866,20362,20809,21281,22745,24291,26336,27960,28826,29378,29654,31568,33009,37979,21350,25499,32619,20054,20608,22602,22750,24618,24871,25296,27088,39745,23439,32024,32945,36703,20132,20689,21676,21932,23308,23968,24039,25898,25934,26657,27211,29409,30350,30703,32094,32761,33184,34126,34527,36611,36686,37066,39171,39509,39851,19992,20037,20061,20167,20465,20855,21246,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,21312,21475,21477,21646,22036,22389,22434,23495,23943,24272,25084,25304,25937,26552,26601,27083,27472,27590,27628,27714,28317,28792,29399,29590,29699,30655,30697,31350,32127,32777,33276,33285,33290,33503,34914,35635,36092,36544,36881,37041,37476,37558,39378,39493,40169,40407,40860,22283,23616,33738,38816,38827,40628,21531,31384,32676,35033,36557,37089,22528,23624,25496,31391,23470,24339,31353,31406,33422,36524,20518,21048,21240,21367,22280,25331,25458,27402,28099,30519,21413,29527,34152,36470,38357,26426,27331,28528,35437,36556,39243,63750,26231,27512,36020,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,39740,63751,21483,22317,22862,25542,27131,29674,30789,31418,31429,31998,33909,35215,36211,36917,38312,21243,22343,30023,31584,33740,37406,63752,27224,20811,21067,21127,25119,26840,26997,38553,20677,21156,21220,25027,26020,26681,27135,29822,31563,33465,33771,35250,35641,36817,39241,63753,20170,22935,25810,26129,27278,29748,31105,31165,33449,34942,34943,35167,63754,37670,20235,21450,24613,25201,27762,32026,32102,20120,20834,30684,32943,20225,20238,20854,20864,21980,22120,22331,22522,22524,22804,22855,22931,23492,23696,23822,24049,24190,24524,25216,26071,26083,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,26398,26399,26462,26827,26820,27231,27450,27683,27773,27778,28103,29592,29734,29738,29826,29859,30072,30079,30849,30959,31041,31047,31048,31098,31637,32000,32186,32648,32774,32813,32908,35352,35663,35912,36215,37665,37668,39138,39249,39438,39439,39525,40594,32202,20342,21513,25326,26708,37329,21931,20794,63755,63756,23068,25062,63757,25295,25343,63758,63759,63760,63761,63762,63763,37027,63764,63765,63766,63767,63768,35582,63769,63770,63771,63772,26262,63773,29014,63774,63775,38627,63776,25423,25466,21335,63777,26511,26976,28275,63778,30007,63779,63780,63781,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,32013,63782,63783,34930,22218,23064,63784,63785,63786,63787,63788,20035,63789,20839,22856,26608,32784,63790,22899,24180,25754,31178,24565,24684,25288,25467,23527,23511,21162,63791,22900,24361,24594,63792,63793,63794,29785,63795,63796,63797,63798,63799,63800,39377,63801,63802,63803,63804,63805,63806,63807,63808,63809,63810,63811,28611,63812,63813,33215,36786,24817,63814,63815,33126,63816,63817,23615,63818,63819,63820,63821,63822,63823,63824,63825,23273,35365,26491,32016,63826,63827,63828,63829,63830,63831,33021,63832,63833,23612,27877,21311,28346,22810,33590,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,20025,20150,20294,21934,22296,22727,24406,26039,26086,27264,27573,28237,30701,31471,31774,32222,34507,34962,37170,37723,25787,28606,29562,30136,36948,21846,22349,25018,25812,26311,28129,28251,28525,28601,30192,32835,33213,34113,35203,35527,35674,37663,27795,30035,31572,36367,36957,21776,22530,22616,24162,25095,25758,26848,30070,31958,34739,40680,20195,22408,22382,22823,23565,23729,24118,24453,25140,25825,29619,33274,34955,36024,38538,40667,23429,24503,24755,20498,20992,21040,22294,22581,22615,23566,23648,23798,23947,24230,24466,24764,25361,25481,25623,26691,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,26873,27330,28120,28193,28372,28644,29182,30428,30585,31153,31291,33796,35241,36077,36339,36424,36867,36884,36947,37117,37709,38518,38876,27602,28678,29272,29346,29544,30563,31167,31716,32411,35712,22697,24775,25958,26109,26302,27788,28958,29129,35930,38931,20077,31361,20189,20908,20941,21205,21516,24999,26481,26704,26847,27934,28540,30140,30643,31461,33012,33891,37509,20828,26007,26460,26515,30168,31431,33651,63834,35910,36887,38957,23663,33216,33434,36929,36975,37389,24471,23965,27225,29128,30331,31561,34276,35588,37159,39472,21895,25078,63835,30313,32645,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,34367,34746,35064,37007,63836,27931,28889,29662,32097,33853,63837,37226,39409,63838,20098,21365,27396,27410,28734,29211,34349,40478,21068,36771,23888,25829,25900,27414,28651,31811,32412,34253,35172,35261,25289,33240,34847,24266,26391,28010,29436,29701,29807,34690,37086,20358,23821,24480,33802,20919,25504,30053,20142,20486,20841,20937,26753,27153,31918,31921,31975,33391,35538,36635,37327,20406,20791,21237,21570,24300,24942,25150,26053,27354,28670,31018,34268,34851,38317,39522,39530,40599,40654,21147,26310,27511,28701,31019,36706,38722,24976,25088,25891,28451,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,29001,29833,32244,32879,34030,36646,36899,37706,20925,21015,21155,27916,28872,35010,24265,25986,27566,28610,31806,29557,20196,20278,22265,63839,23738,23994,24604,29618,31533,32666,32718,32838,36894,37428,38646,38728,38936,40801,20363,28583,31150,37300,38583,21214,63840,25736,25796,27347,28510,28696,29200,30439,32769,34310,34396,36335,36613,38706,39791,40442,40565,30860,31103,32160,33737,37636,40575,40595,35542,22751,24324,26407,28711,29903,31840,32894,20769,28712,29282,30922,36034,36058,36084,38647,20102,20698,23534,24278,26009,29134,30274,30637,32842,34044,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,36988,39719,40845,22744,23105,23650,27155,28122,28431,30267,32047,32311,34078,35128,37860,38475,21129,26066,26611,27060,27969,28316,28687,29705,29792,30041,30244,30827,35628,39006,20845,25134,38520,20374,20523,23833,28138,32184,36650,24459,24900,26647,63841,38534,21202,32907,20956,20940,26974,31260,32190,33777,38517,20442,21033,21400,21519,21774,23653,24743,26446,26792,28012,29313,29432,29702,29827,63842,30178,31852,32633,32696,33673,35023,35041,37324,37328,38626,39881,21533,28542,29136,29848,34298,36522,38563,40023,40607,26519,28107,29747,33256,38678,30764,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,31435,31520,31890,25705,29802,30194,30908,30952,39340,39764,40635,23518,24149,28448,33180,33707,37000,19975,21325,23081,24018,24398,24930,25405,26217,26364,28415,28459,28771,30622,33836,34067,34875,36627,39237,39995,21788,25273,26411,27819,33545,35178,38778,20129,22916,24536,24537,26395,32178,32596,33426,33579,33725,36638,37017,22475,22969,23186,23504,26151,26522,26757,27599,29028,32629,36023,36067,36993,39749,33032,35978,38476,39488,40613,23391,27667,29467,30450,30431,33804,20906,35219,20813,20885,21193,26825,27796,30468,30496,32191,32236,38754,40629,28357,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,34065,20901,21517,21629,26126,26269,26919,28319,30399,30609,33559,33986,34719,37225,37528,40180,34946,20398,20882,21215,22982,24125,24917,25720,25721,26286,26576,27169,27597,27611,29279,29281,29761,30520,30683,32791,33468,33541,35584,35624,35980,26408,27792,29287,30446,30566,31302,40361,27519,27794,22818,26406,33945,21359,22675,22937,24287,25551,26164,26483,28218,29483,31447,33495,37672,21209,24043,25006,25035,25098,25287,25771,26080,26969,27494,27595,28961,29687,30045,32326,33310,33538,34154,35491,36031,38695,40289,22696,40664,20497,21006,21563,21839,25991,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,27766,32010,32011,32862,34442,38272,38639,21247,27797,29289,21619,23194,23614,23883,24396,24494,26410,26806,26979,28220,28228,30473,31859,32654,34183,35598,36855,38753,40692,23735,24758,24845,25003,25935,26107,26108,27665,27887,29599,29641,32225,38292,23494,34588,35600,21085,21338,25293,25615,25778,26420,27192,27850,29632,29854,31636,31893,32283,33162,33334,34180,36843,38649,39361,20276,21322,21453,21467,25292,25644,25856,26001,27075,27886,28504,29677,30036,30242,30436,30460,30928,30971,31020,32070,33324,34784,36820,38930,39151,21187,25300,25765,28196,28497,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,30332,36299,37297,37474,39662,39747,20515,20621,22346,22952,23592,24135,24439,25151,25918,26041,26049,26121,26507,27036,28354,30917,32033,32938,33152,33323,33459,33953,34444,35370,35607,37030,38450,40848,20493,20467,63843,22521,24472,25308,25490,26479,28227,28953,30403,32972,32986,35060,35061,35097,36064,36649,37197,38506,20271,20336,24091,26575,26658,30333,30334,39748,24161,27146,29033,29140,30058,63844,32321,34115,34281,39132,20240,31567,32624,38309,20961,24070,26805,27710,27726,27867,29359,31684,33539,27861,29754,20731,21128,22721,25816,27287,29863,30294,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,30887,34327,38370,38713,63845,21342,24321,35722,36776,36783,37002,21029,30629,40009,40712,19993,20482,20853,23643,24183,26142,26170,26564,26821,28851,29953,30149,31177,31453,36647,39200,39432,20445,22561,22577,23542,26222,27493,27921,28282,28541,29668,29995,33769,35036,35091,35676,36628,20239,20693,21264,21340,23443,24489,26381,31119,33145,33583,34068,35079,35206,36665,36667,39333,39954,26412,20086,20472,22857,23553,23791,23792,25447,26834,28925,29090,29739,32299,34028,34562,36898,37586,40179,19981,20184,20463,20613,21078,21103,21542,21648,22496,22827,23142,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,23386,23413,23500,24220,63846,25206,25975,26023,28014,28325,29238,31526,31807,32566,33104,33105,33178,33344,33433,33705,35331,36000,36070,36091,36212,36282,37096,37340,38428,38468,39385,40167,21271,20998,21545,22132,22707,22868,22894,24575,24996,25198,26128,27774,28954,30406,31881,31966,32027,33452,36033,38640,63847,20315,24343,24447,25282,23849,26379,26842,30844,32323,40300,19989,20633,21269,21290,21329,22915,23138,24199,24754,24970,25161,25209,26000,26503,27047,27604,27606,27607,27608,27832,63848,29749,30202,30738,30865,31189,31192,31875,32203,32737,32933,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,33086,33218,33778,34586,35048,35513,35692,36027,37145,38750,39131,40763,22188,23338,24428,25996,27315,27567,27996,28657,28693,29277,29613,36007,36051,38971,24977,27703,32856,39425,20045,20107,20123,20181,20282,20284,20351,20447,20735,21490,21496,21766,21987,22235,22763,22882,23057,23531,23546,23556,24051,24107,24473,24605,25448,26012,26031,26614,26619,26797,27515,27801,27863,28195,28681,29509,30722,31038,31040,31072,31169,31721,32023,32114,32902,33293,33678,34001,34503,35039,35408,35422,35613,36060,36198,36781,37034,39164,39391,40605,21066,63849,26388,63850,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,20632,21034,23665,25955,27733,29642,29987,30109,31639,33948,37240,38704,20087,25746,27578,29022,34217,19977,63851,26441,26862,28183,33439,34072,34923,25591,28545,37394,39087,19978,20663,20687,20767,21830,21930,22039,23360,23577,23776,24120,24202,24224,24258,24819,26705,27233,28248,29245,29248,29376,30456,31077,31665,32724,35059,35316,35443,35937,36062,38684,22622,29885,36093,21959,63852,31329,32034,33394,29298,29983,29989,63853,31513,22661,22779,23996,24207,24246,24464,24661,25234,25471,25933,26257,26329,26360,26646,26866,29312,29790,31598,32110,32214,32626,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,32997,33298,34223,35199,35475,36893,37604,40653,40736,22805,22893,24109,24796,26132,26227,26512,27728,28101,28511,30707,30889,33990,37323,37675,20185,20682,20808,21892,23307,23459,25159,25982,26059,28210,29053,29697,29764,29831,29887,30316,31146,32218,32341,32680,33146,33203,33337,34330,34796,35445,36323,36984,37521,37925,39245,39854,21352,23633,26964,27844,27945,28203,33292,34203,35131,35373,35498,38634,40807,21089,26297,27570,32406,34814,36109,38275,38493,25885,28041,29166,63854,22478,22995,23468,24615,24826,25104,26143,26207,29481,29689,30427,30465,31596,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,32854,32882,33125,35488,37266,19990,21218,27506,27927,31237,31545,32048,63855,36016,21484,22063,22609,23477,23567,23569,24034,25152,25475,25620,26157,26803,27836,28040,28335,28703,28836,29138,29990,30095,30094,30233,31505,31712,31787,32032,32057,34092,34157,34311,35380,36877,36961,37045,37559,38902,39479,20439,23660,26463,28049,31903,32396,35606,36118,36895,23403,24061,25613,33984,36956,39137,29575,23435,24730,26494,28126,35359,35494,36865,38924,21047,63856,28753,30862,37782,34928,37335,20462,21463,22013,22234,22402,22781,23234,23432,23723,23744,24101,24833,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,25101,25163,25480,25628,25910,25976,27193,27530,27700,27929,28465,29159,29417,29560,29703,29874,30246,30561,31168,31319,31466,31929,32143,32172,32353,32670,33065,33585,33936,34010,34282,34966,35504,35728,36664,36930,36995,37228,37526,37561,38539,38567,38568,38614,38656,38920,39318,39635,39706,21460,22654,22809,23408,23487,28113,28506,29087,29729,29881,32901,33789,24033,24455,24490,24642,26092,26642,26991,27219,27529,27957,28147,29667,30462,30636,31565,32020,33059,33308,33600,34036,34147,35426,35524,37255,37662,38918,39348,25100,34899,36848,37477,23815,23847,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,23913,29791,33181,34664,28629,25342,32722,35126,35186,19998,20056,20711,21213,21319,25215,26119,32361,34821,38494,20365,21273,22070,22987,23204,23608,23630,23629,24066,24337,24643,26045,26159,26178,26558,26612,29468,30690,31034,32709,33940,33997,35222,35430,35433,35553,35925,35962,22516,23508,24335,24687,25325,26893,27542,28252,29060,31698,34645,35672,36606,39135,39166,20280,20353,20449,21627,23072,23480,24892,26032,26216,29180,30003,31070,32051,33102,33251,33688,34218,34254,34563,35338,36523,36763,63857,36805,22833,23460,23526,24713,23529,23563,24515,27777,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,63858,28145,28683,29978,33455,35574,20160,21313,63859,38617,27663,20126,20420,20818,21854,23077,23784,25105,29273,33469,33706,34558,34905,35357,38463,38597,39187,40201,40285,22538,23731,23997,24132,24801,24853,25569,27138,28197,37122,37716,38990,39952,40823,23433,23736,25353,26191,26696,30524,38593,38797,38996,39839,26017,35585,36555,38332,21813,23721,24022,24245,26263,30284,33780,38343,22739,25276,29390,40232,20208,22830,24591,26171,27523,31207,40230,21395,21696,22467,23830,24859,26326,28079,30861,33406,38552,38724,21380,25212,25494,28082,32266,33099,38989,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,27387,32588,40367,40474,20063,20539,20918,22812,24825,25590,26928,29242,32822,63860,37326,24369,63861,63862,32004,33509,33903,33979,34277,36493,63863,20335,63864,63865,22756,23363,24665,25562,25880,25965,26264,63866,26954,27171,27915,28673,29036,30162,30221,31155,31344,63867,32650,63868,35140,63869,35731,37312,38525,63870,39178,22276,24481,26044,28417,30208,31142,35486,39341,39770,40812,20740,25014,25233,27277,33222,20547,22576,24422,28937,35328,35578,23420,34326,20474,20796,22196,22852,25513,28153,23978,26989,20870,20104,20313,63871,63872,63873,22914,63874,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,63875,27487,27741,63876,29877,30998,63877,33287,33349,33593,36671,36701,63878,39192,63879,63880,63881,20134,63882,22495,24441,26131,63883,63884,30123,32377,35695,63885,36870,39515,22181,22567,23032,23071,23476,63886,24310,63887,63888,25424,25403,63889,26941,27783,27839,28046,28051,28149,28436,63890,28895,28982,29017,63891,29123,29141,63892,30799,30831,63893,31605,32227,63894,32303,63895,34893,36575,63896,63897,63898,37467,63899,40182,63900,63901,63902,24709,28037,63903,29105,63904,63905,38321,21421,63906,63907,63908,26579,63909,28814,28976,29744,33398,33490,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,63910,38331,39653,40573,26308,63911,29121,33865,63912,63913,22603,63914,63915,23992,24433,63916,26144,26254,27001,27054,27704,27891,28214,28481,28634,28699,28719,29008,29151,29552,63917,29787,63918,29908,30408,31310,32403,63919,63920,33521,35424,36814,63921,37704,63922,38681,63923,63924,20034,20522,63925,21000,21473,26355,27757,28618,29450,30591,31330,33454,34269,34306,63926,35028,35427,35709,35947,63927,37555,63928,38675,38928,20116,20237,20425,20658,21320,21566,21555,21978,22626,22714,22887,23067,23524,24735,63929,25034,25942,26111,26212,26791,27738,28595,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,28879,29100,29522,31613,34568,35492,39986,40711,23627,27779,29508,29577,37434,28331,29797,30239,31337,32277,34314,20800,22725,25793,29934,29973,30320,32705,37013,38605,39252,28198,29926,31401,31402,33253,34521,34680,35355,23113,23436,23451,26785,26880,28003,29609,29715,29740,30871,32233,32747,33048,33109,33694,35916,38446,38929,26352,24448,26106,26505,27754,29579,20525,23043,27498,30702,22806,23916,24013,29477,30031,63930,63931,20709,20985,22575,22829,22934,23002,23525,63932,63933,23970,25303,25622,25747,25854,63934,26332,63935,27208,63936,29183,29796,63937,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,31368,31407,32327,32350,32768,33136,63938,34799,35201,35616,36953,63939,36992,39250,24958,27442,28020,32287,35109,36785,20433,20653,20887,21191,22471,22665,23481,24248,24898,27029,28044,28263,28342,29076,29794,29992,29996,32883,33592,33993,36362,37780,37854,63940,20110,20305,20598,20778,21448,21451,21491,23431,23507,23588,24858,24962,26100,29275,29591,29760,30402,31056,31121,31161,32006,32701,33419,34261,34398,36802,36935,37109,37354,38533,38632,38633,21206,24423,26093,26161,26671,29020,31286,37057,38922,20113,63941,27218,27550,28560,29065,32792,33464,34131,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,36939,38549,38642,38907,34074,39729,20112,29066,38596,20803,21407,21729,22291,22290,22435,23195,23236,23491,24616,24895,25588,27781,27961,28274,28304,29232,29503,29783,33489,34945,36677,36960,63942,38498,39000,40219,26376,36234,37470,20301,20553,20702,21361,22285,22996,23041,23561,24944,26256,28205,29234,29771,32239,32963,33806,33894,34111,34655,34907,35096,35586,36949,38859,39759,20083,20369,20754,20842,63943,21807,21929,23418,23461,24188,24189,24254,24736,24799,24840,24841,25540,25912,26377,63944,26580,26586,63945,26977,26978,27833,27943,63946,28216,63947,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,28641,29494,29495,63948,29788,30001,63949,30290,63950,63951,32173,33278,33848,35029,35480,35547,35565,36400,36418,36938,36926,36986,37193,37321,37742,63952,63953,22537,63954,27603,32905,32946,63955,63956,20801,22891,23609,63957,63958,28516,29607,32996,36103,63959,37399,38287,63960,63961,63962,63963,32895,25102,28700,32104,34701,63964,22432,24681,24903,27575,35518,37504,38577,20057,21535,28139,34093,38512,38899,39150,25558,27875,37009,20957,25033,33210,40441,20381,20506,20736,23452,24847,25087,25836,26885,27589,30097,30691,32681,33380,34191,34811,34915,35516,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,35696,37291,20108,20197,20234,63965,63966,22839,23016,63967,24050,24347,24411,24609,63968,63969,63970,63971,29246,29669,63972,30064,30157,63973,31227,63974,32780,32819,32900,33505,33617,63975,63976,36029,36019,36999,63977,63978,39156,39180,63979,63980,28727,30410,32714,32716,32764,35610,20154,20161,20995,21360,63981,21693,22240,23035,23493,24341,24525,28270,63982,63983,32106,33589,63984,34451,35469,63985,38765,38775,63986,63987,19968,20314,20350,22777,26085,28322,36920,37808,39353,20219,22764,22922,23001,24641,63988,63989,31252,63990,33615,36035,20837,21316,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,63991,63992,63993,20173,21097,23381,33471,20180,21050,21672,22985,23039,23376,23383,23388,24675,24904,28363,28825,29038,29574,29943,30133,30913,32043,32773,33258,33576,34071,34249,35566,36039,38604,20316,21242,22204,26027,26152,28796,28856,29237,32189,33421,37196,38592,40306,23409,26855,27544,28538,30430,23697,26283,28507,31668,31786,34870,38620,19976,20183,21280,22580,22715,22767,22892,23559,24115,24196,24373,25484,26290,26454,27167,27299,27404,28479,29254,63994,29520,29835,31456,31911,33144,33247,33255,33674,33900,34083,34196,34255,35037,36115,37292,38263,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,38556,20877,21705,22312,23472,25165,26448,26685,26771,28221,28371,28797,32289,35009,36001,36617,40779,40782,29229,31631,35533,37658,20295,20302,20786,21632,22992,24213,25269,26485,26990,27159,27822,28186,29401,29482,30141,31672,32053,33511,33785,33879,34295,35419,36015,36487,36889,37048,38606,40799,21219,21514,23265,23490,25688,25973,28404,29380,63995,30340,31309,31515,31821,32318,32735,33659,35627,36042,36196,36321,36447,36842,36857,36969,37841,20291,20346,20659,20840,20856,21069,21098,22625,22652,22880,23560,23637,24283,24731,25136,26643,27583,27656,28593,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,29006,29728,30000,30008,30033,30322,31564,31627,31661,31686,32399,35438,36670,36681,37439,37523,37666,37931,38651,39002,39019,39198,20999,25130,25240,27993,30308,31434,31680,32118,21344,23742,24215,28472,28857,31896,38673,39822,40670,25509,25722,34678,19969,20117,20141,20572,20597,21576,22979,23450,24128,24237,24311,24449,24773,25402,25919,25972,26060,26230,26232,26622,26984,27273,27491,27712,28096,28136,28191,28254,28702,28833,29582,29693,30010,30555,30855,31118,31243,31357,31934,32142,33351,35330,35562,35998,37165,37194,37336,37478,37580,37664,38662,38742,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,38748,38914,40718,21046,21137,21884,22564,24093,24351,24716,25552,26799,28639,31085,31532,33229,34234,35069,35576,36420,37261,38500,38555,38717,38988,40778,20430,20806,20939,21161,22066,24340,24427,25514,25805,26089,26177,26362,26361,26397,26781,26839,27133,28437,28526,29031,29157,29226,29866,30522,31062,31066,31199,31264,31381,31895,31967,32068,32368,32903,34299,34468,35412,35519,36249,36481,36896,36973,37347,38459,38613,40165,26063,31751,36275,37827,23384,23562,21330,25305,29469,20519,23447,24478,24752,24939,26837,28121,29742,31278,32066,32156,32305,33131,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,36394,36405,37758,37912,20304,22352,24038,24231,25387,32618,20027,20303,20367,20570,23005,32964,21610,21608,22014,22863,23449,24030,24282,26205,26417,26609,26666,27880,27954,28234,28557,28855,29664,30087,31820,32002,32044,32162,33311,34523,35387,35461,36208,36490,36659,36913,37198,37202,37956,39376,31481,31909,20426,20737,20934,22472,23535,23803,26201,27197,27994,28310,28652,28940,30063,31459,34850,36897,36981,38603,39423,33537,20013,20210,34886,37325,21373,27355,26987,27713,33914,22686,24974,26366,25327,28893,29969,30151,32338,33976,35657,36104,20043,21482,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,21675,22320,22336,24535,25345,25351,25711,25903,26088,26234,26525,26547,27490,27744,27802,28460,30693,30757,31049,31063,32025,32930,33026,33267,33437,33463,34584,35468,63996,36100,36286,36978,30452,31257,31287,32340,32887,21767,21972,22645,25391,25634,26185,26187,26733,27035,27524,27941,28337,29645,29800,29857,30043,30137,30433,30494,30603,31206,32265,32285,33275,34095,34967,35386,36049,36587,36784,36914,37805,38499,38515,38663,20356,21489,23018,23241,24089,26702,29894,30142,31209,31378,33187,34541,36074,36300,36845,26015,26389,63997,22519,28503,32221,36655,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,37878,38598,24501,25074,28548,19988,20376,20511,21449,21983,23919,24046,27425,27492,30923,31642,63998,36425,36554,36974,25417,25662,30528,31364,37679,38015,40810,25776,28591,29158,29864,29914,31428,31762,32386,31922,32408,35738,36106,38013,39184,39244,21049,23519,25830,26413,32046,20717,21443,22649,24920,24921,25082,26028,31449,35730,35734,20489,20513,21109,21809,23100,24288,24432,24884,25950,26124,26166,26274,27085,28356,28466,29462,30241,31379,33081,33369,33750,33980,20661,22512,23488,23528,24425,25505,30758,32181,33756,34081,37319,37365,20874,26613,31574,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,36012,20932,22971,24765,34389,20508,63999,21076,23610,24957,25114,25299,25842,26021,28364,30240,33034,36448,38495,38587,20191,21315,21912,22825,24029,25797,27849,28154,29588,31359,33307,34214,36068,36368,36983,37351,38369,38433,38854,20984,21746,21894,24505,25764,28552,32180,36639,36685,37941,20681,23574,27838,28155,29979,30651,31805,31844,35449,35522,22558,22974,24086,25463,29266,30090,30571,35548,36028,36626,24307,26228,28152,32893,33729,35531,38737,39894,64000,21059,26367,28053,28399,32224,35558,36910,36958,39636,21021,21119,21736,24980,25220,25307,26786,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,26898,26970,27189,28818,28966,30813,30977,30990,31186,31245,32918,33400,33493,33609,34121,35970,36229,37218,37259,37294,20419,22225,29165,30679,34560,35320,23544,24534,26449,37032,21474,22618,23541,24740,24961,25696,32317,32880,34085,37507,25774,20652,23828,26368,22684,25277,25512,26894,27000,27166,28267,30394,31179,33467,33833,35535,36264,36861,37138,37195,37276,37648,37656,37786,38619,39478,39949,19985,30044,31069,31482,31569,31689,32302,33988,36441,36468,36600,36880,26149,26943,29763,20986,26414,40668,20805,24544,27798,34802,34909,34935,24756,33205,33795,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,36101,21462,21561,22068,23094,23601,28810,32736,32858,33030,33261,36259,37257,39519,40434,20596,20164,21408,24827,28204,23652,20360,20516,21988,23769,24159,24677,26772,27835,28100,29118,30164,30196,30305,31258,31305,32199,32251,32622,33268,34473,36636,38601,39347,40786,21063,21189,39149,35242,19971,26578,28422,20405,23522,26517,27784,28024,29723,30759,37341,37756,34756,31204,31281,24555,20182,21668,21822,22702,22949,24816,25171,25302,26422,26965,33333,38464,39345,39389,20524,21331,21828,22396,64001,25176,64002,25826,26219,26589,28609,28655,29730,29752,35351,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,37944,21585,22022,22374,24392,24986,27470,28760,28845,32187,35477,22890,33067,25506,30472,32829,36010,22612,25645,27067,23445,24081,28271,64003,34153,20812,21488,22826,24608,24907,27526,27760,27888,31518,32974,33492,36294,37040,39089,64004,25799,28580,25745,25860,20814,21520,22303,35342,24927,26742,64005,30171,31570,32113,36890,22534,27084,33151,35114,36864,38969,20600,22871,22956,25237,36879,39722,24925,29305,38358,22369,23110,24052,25226,25773,25850,26487,27874,27966,29228,29750,30772,32631,33453,36315,38935,21028,22338,26495,29256,29923,36009,36774,37393,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,38442,20843,21485,25420,20329,21764,24726,25943,27803,28031,29260,29437,31255,35207,35997,24429,28558,28921,33192,24846,20415,20559,25153,29255,31687,32232,32745,36941,38829,39449,36022,22378,24179,26544,33805,35413,21536,23318,24163,24290,24330,25987,32954,34109,38281,38491,20296,21253,21261,21263,21638,21754,22275,24067,24598,25243,25265,25429,64006,27873,28006,30129,30770,32990,33071,33502,33889,33970,34957,35090,36875,37610,39165,39825,24133,26292,26333,28689,29190,64007,20469,21117,24426,24915,26451,27161,28418,29922,31080,34920,35961,39111,39108,39491,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,21697,31263,26963,35575,35914,39080,39342,24444,25259,30130,30382,34987,36991,38466,21305,24380,24517,27852,29644,30050,30091,31558,33534,39325,20047,36924,19979,20309,21414,22799,24264,26160,27827,29781,33655,34662,36032,36944,38686,39957,22737,23416,34384,35604,40372,23506,24680,24717,26097,27735,28450,28579,28698,32597,32752,38289,38290,38480,38867,21106,36676,20989,21547,21688,21859,21898,27323,28085,32216,33382,37532,38519,40569,21512,21704,30418,34532,38308,38356,38492,20130,20233,23022,23270,24055,24658,25239,26477,26689,27782,28207,32568,32923,33322,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,64008,64009,38917,20133,20565,21683,22419,22874,23401,23475,25032,26999,28023,28707,34809,35299,35442,35559,36994,39405,39608,21182,26680,20502,24184,26447,33607,34892,20139,21521,22190,29670,37141,38911,39177,39255,39321,22099,22687,34395,35377,25010,27382,29563,36562,27463,38570,39511,22869,29184,36203,38761,20436,23796,24358,25080,26203,27883,28843,29572,29625,29694,30505,30541,32067,32098,32291,33335,34898,64010,36066,37449,39023,23377,31348,34880,38913,23244,20448,21332,22846,23805,25406,28025,29433,33029,33031,33698,37583,38960,20136,20804,21009,22411,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,24418,27842,28366,28677,28752,28847,29074,29673,29801,33610,34722,34913,36872,37026,37795,39336,20846,24407,24800,24935,26291,34137,36426,37295,38795,20046,20114,21628,22741,22778,22909,23733,24359,25142,25160,26122,26215,27627,28009,28111,28246,28408,28564,28640,28649,28765,29392,29733,29786,29920,30355,31068,31946,32286,32993,33446,33899,33983,34382,34399,34676,35703,35946,37804,38912,39013,24785,25110,37239,23130,26127,28151,28222,29759,39746,24573,24794,31503,21700,24344,27742,27859,27946,28888,32005,34425,35340,40251,21270,21644,23301,27194,28779,30069,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,31117,31166,33457,33775,35441,35649,36008,38772,64011,25844,25899,30906,30907,31339,20024,21914,22864,23462,24187,24739,25563,27489,26213,26707,28185,29029,29872,32008,36996,39529,39973,27963,28369,29502,35905,38346,20976,24140,24488,24653,24822,24880,24908,26179,26180,27045,27841,28255,28361,28514,29004,29852,30343,31681,31783,33618,34647,36945,38541,40643,21295,22238,24315,24458,24674,24724,25079,26214,26371,27292,28142,28590,28784,29546,32362,33214,33588,34516,35496,36036,21123,29554,23446,27243,37892,21742,22150,23389,25928,25989,26313,26783,28045,28102,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,29243,32948,37237,39501,20399,20505,21402,21518,21564,21897,21957,24127,24460,26429,29030,29661,36869,21211,21235,22628,22734,28932,29071,29179,34224,35347,26248,34216,21927,26244,29002,33841,21321,21913,27585,24409,24509,25582,26249,28999,35569,36637,40638,20241,25658,28875,30054,34407,24676,35662,40440,20807,20982,21256,27958,33016,40657,26133,27427,28824,30165,21507,23673,32007,35350,27424,27453,27462,21560,24688,27965,32725,33288,20694,20958,21916,22123,22221,23020,23305,24076,24985,24984,25137,26206,26342,29081,29113,29114,29351,31143,31232,32690,35440,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null], - 'gb18030': [19970,19972,19973,19974,19983,19986,19991,19999,20000,20001,20003,20006,20009,20014,20015,20017,20019,20021,20023,20028,20032,20033,20034,20036,20038,20042,20049,20053,20055,20058,20059,20066,20067,20068,20069,20071,20072,20074,20075,20076,20077,20078,20079,20082,20084,20085,20086,20087,20088,20089,20090,20091,20092,20093,20095,20096,20097,20098,20099,20100,20101,20103,20106,20112,20118,20119,20121,20124,20125,20126,20131,20138,20143,20144,20145,20148,20150,20151,20152,20153,20156,20157,20158,20168,20172,20175,20176,20178,20186,20187,20188,20192,20194,20198,20199,20201,20205,20206,20207,20209,20212,20216,20217,20218,20220,20222,20224,20226,20227,20228,20229,20230,20231,20232,20235,20236,20242,20243,20244,20245,20246,20252,20253,20257,20259,20264,20265,20268,20269,20270,20273,20275,20277,20279,20281,20283,20286,20287,20288,20289,20290,20292,20293,20295,20296,20297,20298,20299,20300,20306,20308,20310,20321,20322,20326,20328,20330,20331,20333,20334,20337,20338,20341,20343,20344,20345,20346,20349,20352,20353,20354,20357,20358,20359,20362,20364,20366,20368,20370,20371,20373,20374,20376,20377,20378,20380,20382,20383,20385,20386,20388,20395,20397,20400,20401,20402,20403,20404,20406,20407,20408,20409,20410,20411,20412,20413,20414,20416,20417,20418,20422,20423,20424,20425,20427,20428,20429,20434,20435,20436,20437,20438,20441,20443,20448,20450,20452,20453,20455,20459,20460,20464,20466,20468,20469,20470,20471,20473,20475,20476,20477,20479,20480,20481,20482,20483,20484,20485,20486,20487,20488,20489,20490,20491,20494,20496,20497,20499,20501,20502,20503,20507,20509,20510,20512,20514,20515,20516,20519,20523,20527,20528,20529,20530,20531,20532,20533,20534,20535,20536,20537,20539,20541,20543,20544,20545,20546,20548,20549,20550,20553,20554,20555,20557,20560,20561,20562,20563,20564,20566,20567,20568,20569,20571,20573,20574,20575,20576,20577,20578,20579,20580,20582,20583,20584,20585,20586,20587,20589,20590,20591,20592,20593,20594,20595,20596,20597,20600,20601,20602,20604,20605,20609,20610,20611,20612,20614,20615,20617,20618,20619,20620,20622,20623,20624,20625,20626,20627,20628,20629,20630,20631,20632,20633,20634,20635,20636,20637,20638,20639,20640,20641,20642,20644,20646,20650,20651,20653,20654,20655,20656,20657,20659,20660,20661,20662,20663,20664,20665,20668,20669,20670,20671,20672,20673,20674,20675,20676,20677,20678,20679,20680,20681,20682,20683,20684,20685,20686,20688,20689,20690,20691,20692,20693,20695,20696,20697,20699,20700,20701,20702,20703,20704,20705,20706,20707,20708,20709,20712,20713,20714,20715,20719,20720,20721,20722,20724,20726,20727,20728,20729,20730,20732,20733,20734,20735,20736,20737,20738,20739,20740,20741,20744,20745,20746,20748,20749,20750,20751,20752,20753,20755,20756,20757,20758,20759,20760,20761,20762,20763,20764,20765,20766,20767,20768,20770,20771,20772,20773,20774,20775,20776,20777,20778,20779,20780,20781,20782,20783,20784,20785,20786,20787,20788,20789,20790,20791,20792,20793,20794,20795,20796,20797,20798,20802,20807,20810,20812,20814,20815,20816,20818,20819,20823,20824,20825,20827,20829,20830,20831,20832,20833,20835,20836,20838,20839,20841,20842,20847,20850,20858,20862,20863,20867,20868,20870,20871,20874,20875,20878,20879,20880,20881,20883,20884,20888,20890,20893,20894,20895,20897,20899,20902,20903,20904,20905,20906,20909,20910,20916,20920,20921,20922,20926,20927,20929,20930,20931,20933,20936,20938,20941,20942,20944,20946,20947,20948,20949,20950,20951,20952,20953,20954,20956,20958,20959,20962,20963,20965,20966,20967,20968,20969,20970,20972,20974,20977,20978,20980,20983,20990,20996,20997,21001,21003,21004,21007,21008,21011,21012,21013,21020,21022,21023,21025,21026,21027,21029,21030,21031,21034,21036,21039,21041,21042,21044,21045,21052,21054,21060,21061,21062,21063,21064,21065,21067,21070,21071,21074,21075,21077,21079,21080,21081,21082,21083,21085,21087,21088,21090,21091,21092,21094,21096,21099,21100,21101,21102,21104,21105,21107,21108,21109,21110,21111,21112,21113,21114,21115,21116,21118,21120,21123,21124,21125,21126,21127,21129,21130,21131,21132,21133,21134,21135,21137,21138,21140,21141,21142,21143,21144,21145,21146,21148,21156,21157,21158,21159,21166,21167,21168,21172,21173,21174,21175,21176,21177,21178,21179,21180,21181,21184,21185,21186,21188,21189,21190,21192,21194,21196,21197,21198,21199,21201,21203,21204,21205,21207,21209,21210,21211,21212,21213,21214,21216,21217,21218,21219,21221,21222,21223,21224,21225,21226,21227,21228,21229,21230,21231,21233,21234,21235,21236,21237,21238,21239,21240,21243,21244,21245,21249,21250,21251,21252,21255,21257,21258,21259,21260,21262,21265,21266,21267,21268,21272,21275,21276,21278,21279,21282,21284,21285,21287,21288,21289,21291,21292,21293,21295,21296,21297,21298,21299,21300,21301,21302,21303,21304,21308,21309,21312,21314,21316,21318,21323,21324,21325,21328,21332,21336,21337,21339,21341,21349,21352,21354,21356,21357,21362,21366,21369,21371,21372,21373,21374,21376,21377,21379,21383,21384,21386,21390,21391,21392,21393,21394,21395,21396,21398,21399,21401,21403,21404,21406,21408,21409,21412,21415,21418,21419,21420,21421,21423,21424,21425,21426,21427,21428,21429,21431,21432,21433,21434,21436,21437,21438,21440,21443,21444,21445,21446,21447,21454,21455,21456,21458,21459,21461,21466,21468,21469,21470,21473,21474,21479,21492,21498,21502,21503,21504,21506,21509,21511,21515,21524,21528,21529,21530,21532,21538,21540,21541,21546,21552,21555,21558,21559,21562,21565,21567,21569,21570,21572,21573,21575,21577,21580,21581,21582,21583,21585,21594,21597,21598,21599,21600,21601,21603,21605,21607,21609,21610,21611,21612,21613,21614,21615,21616,21620,21625,21626,21630,21631,21633,21635,21637,21639,21640,21641,21642,21645,21649,21651,21655,21656,21660,21662,21663,21664,21665,21666,21669,21678,21680,21682,21685,21686,21687,21689,21690,21692,21694,21699,21701,21706,21707,21718,21720,21723,21728,21729,21730,21731,21732,21739,21740,21743,21744,21745,21748,21749,21750,21751,21752,21753,21755,21758,21760,21762,21763,21764,21765,21768,21770,21771,21772,21773,21774,21778,21779,21781,21782,21783,21784,21785,21786,21788,21789,21790,21791,21793,21797,21798,21800,21801,21803,21805,21810,21812,21813,21814,21816,21817,21818,21819,21821,21824,21826,21829,21831,21832,21835,21836,21837,21838,21839,21841,21842,21843,21844,21847,21848,21849,21850,21851,21853,21854,21855,21856,21858,21859,21864,21865,21867,21871,21872,21873,21874,21875,21876,21881,21882,21885,21887,21893,21894,21900,21901,21902,21904,21906,21907,21909,21910,21911,21914,21915,21918,21920,21921,21922,21923,21924,21925,21926,21928,21929,21930,21931,21932,21933,21934,21935,21936,21938,21940,21942,21944,21946,21948,21951,21952,21953,21954,21955,21958,21959,21960,21962,21963,21966,21967,21968,21973,21975,21976,21977,21978,21979,21982,21984,21986,21991,21993,21997,21998,22000,22001,22004,22006,22008,22009,22010,22011,22012,22015,22018,22019,22020,22021,22022,22023,22026,22027,22029,22032,22033,22034,22035,22036,22037,22038,22039,22041,22042,22044,22045,22048,22049,22050,22053,22054,22056,22057,22058,22059,22062,22063,22064,22067,22069,22071,22072,22074,22076,22077,22078,22080,22081,22082,22083,22084,22085,22086,22087,22088,22089,22090,22091,22095,22096,22097,22098,22099,22101,22102,22106,22107,22109,22110,22111,22112,22113,22115,22117,22118,22119,22125,22126,22127,22128,22130,22131,22132,22133,22135,22136,22137,22138,22141,22142,22143,22144,22145,22146,22147,22148,22151,22152,22153,22154,22155,22156,22157,22160,22161,22162,22164,22165,22166,22167,22168,22169,22170,22171,22172,22173,22174,22175,22176,22177,22178,22180,22181,22182,22183,22184,22185,22186,22187,22188,22189,22190,22192,22193,22194,22195,22196,22197,22198,22200,22201,22202,22203,22205,22206,22207,22208,22209,22210,22211,22212,22213,22214,22215,22216,22217,22219,22220,22221,22222,22223,22224,22225,22226,22227,22229,22230,22232,22233,22236,22243,22245,22246,22247,22248,22249,22250,22252,22254,22255,22258,22259,22262,22263,22264,22267,22268,22272,22273,22274,22277,22279,22283,22284,22285,22286,22287,22288,22289,22290,22291,22292,22293,22294,22295,22296,22297,22298,22299,22301,22302,22304,22305,22306,22308,22309,22310,22311,22315,22321,22322,22324,22325,22326,22327,22328,22332,22333,22335,22337,22339,22340,22341,22342,22344,22345,22347,22354,22355,22356,22357,22358,22360,22361,22370,22371,22373,22375,22380,22382,22384,22385,22386,22388,22389,22392,22393,22394,22397,22398,22399,22400,22401,22407,22408,22409,22410,22413,22414,22415,22416,22417,22420,22421,22422,22423,22424,22425,22426,22428,22429,22430,22431,22437,22440,22442,22444,22447,22448,22449,22451,22453,22454,22455,22457,22458,22459,22460,22461,22462,22463,22464,22465,22468,22469,22470,22471,22472,22473,22474,22476,22477,22480,22481,22483,22486,22487,22491,22492,22494,22497,22498,22499,22501,22502,22503,22504,22505,22506,22507,22508,22510,22512,22513,22514,22515,22517,22518,22519,22523,22524,22526,22527,22529,22531,22532,22533,22536,22537,22538,22540,22542,22543,22544,22546,22547,22548,22550,22551,22552,22554,22555,22556,22557,22559,22562,22563,22565,22566,22567,22568,22569,22571,22572,22573,22574,22575,22577,22578,22579,22580,22582,22583,22584,22585,22586,22587,22588,22589,22590,22591,22592,22593,22594,22595,22597,22598,22599,22600,22601,22602,22603,22606,22607,22608,22610,22611,22613,22614,22615,22617,22618,22619,22620,22621,22623,22624,22625,22626,22627,22628,22630,22631,22632,22633,22634,22637,22638,22639,22640,22641,22642,22643,22644,22645,22646,22647,22648,22649,22650,22651,22652,22653,22655,22658,22660,22662,22663,22664,22666,22667,22668,22669,22670,22671,22672,22673,22676,22677,22678,22679,22680,22683,22684,22685,22688,22689,22690,22691,22692,22693,22694,22695,22698,22699,22700,22701,22702,22703,22704,22705,22706,22707,22708,22709,22710,22711,22712,22713,22714,22715,22717,22718,22719,22720,22722,22723,22724,22726,22727,22728,22729,22730,22731,22732,22733,22734,22735,22736,22738,22739,22740,22742,22743,22744,22745,22746,22747,22748,22749,22750,22751,22752,22753,22754,22755,22757,22758,22759,22760,22761,22762,22765,22767,22769,22770,22772,22773,22775,22776,22778,22779,22780,22781,22782,22783,22784,22785,22787,22789,22790,22792,22793,22794,22795,22796,22798,22800,22801,22802,22803,22807,22808,22811,22813,22814,22816,22817,22818,22819,22822,22824,22828,22832,22834,22835,22837,22838,22843,22845,22846,22847,22848,22851,22853,22854,22858,22860,22861,22864,22866,22867,22873,22875,22876,22877,22878,22879,22881,22883,22884,22886,22887,22888,22889,22890,22891,22892,22893,22894,22895,22896,22897,22898,22901,22903,22906,22907,22908,22910,22911,22912,22917,22921,22923,22924,22926,22927,22928,22929,22932,22933,22936,22938,22939,22940,22941,22943,22944,22945,22946,22950,22951,22956,22957,22960,22961,22963,22964,22965,22966,22967,22968,22970,22972,22973,22975,22976,22977,22978,22979,22980,22981,22983,22984,22985,22988,22989,22990,22991,22997,22998,23001,23003,23006,23007,23008,23009,23010,23012,23014,23015,23017,23018,23019,23021,23022,23023,23024,23025,23026,23027,23028,23029,23030,23031,23032,23034,23036,23037,23038,23040,23042,23050,23051,23053,23054,23055,23056,23058,23060,23061,23062,23063,23065,23066,23067,23069,23070,23073,23074,23076,23078,23079,23080,23082,23083,23084,23085,23086,23087,23088,23091,23093,23095,23096,23097,23098,23099,23101,23102,23103,23105,23106,23107,23108,23109,23111,23112,23115,23116,23117,23118,23119,23120,23121,23122,23123,23124,23126,23127,23128,23129,23131,23132,23133,23134,23135,23136,23137,23139,23140,23141,23142,23144,23145,23147,23148,23149,23150,23151,23152,23153,23154,23155,23160,23161,23163,23164,23165,23166,23168,23169,23170,23171,23172,23173,23174,23175,23176,23177,23178,23179,23180,23181,23182,23183,23184,23185,23187,23188,23189,23190,23191,23192,23193,23196,23197,23198,23199,23200,23201,23202,23203,23204,23205,23206,23207,23208,23209,23211,23212,23213,23214,23215,23216,23217,23220,23222,23223,23225,23226,23227,23228,23229,23231,23232,23235,23236,23237,23238,23239,23240,23242,23243,23245,23246,23247,23248,23249,23251,23253,23255,23257,23258,23259,23261,23262,23263,23266,23268,23269,23271,23272,23274,23276,23277,23278,23279,23280,23282,23283,23284,23285,23286,23287,23288,23289,23290,23291,23292,23293,23294,23295,23296,23297,23298,23299,23300,23301,23302,23303,23304,23306,23307,23308,23309,23310,23311,23312,23313,23314,23315,23316,23317,23320,23321,23322,23323,23324,23325,23326,23327,23328,23329,23330,23331,23332,23333,23334,23335,23336,23337,23338,23339,23340,23341,23342,23343,23344,23345,23347,23349,23350,23352,23353,23354,23355,23356,23357,23358,23359,23361,23362,23363,23364,23365,23366,23367,23368,23369,23370,23371,23372,23373,23374,23375,23378,23382,23390,23392,23393,23399,23400,23403,23405,23406,23407,23410,23412,23414,23415,23416,23417,23419,23420,23422,23423,23426,23430,23434,23437,23438,23440,23441,23442,23444,23446,23455,23463,23464,23465,23468,23469,23470,23471,23473,23474,23479,23482,23483,23484,23488,23489,23491,23496,23497,23498,23499,23501,23502,23503,23505,23508,23509,23510,23511,23512,23513,23514,23515,23516,23520,23522,23523,23526,23527,23529,23530,23531,23532,23533,23535,23537,23538,23539,23540,23541,23542,23543,23549,23550,23552,23554,23555,23557,23559,23560,23563,23564,23565,23566,23568,23570,23571,23575,23577,23579,23582,23583,23584,23585,23587,23590,23592,23593,23594,23595,23597,23598,23599,23600,23602,23603,23605,23606,23607,23619,23620,23622,23623,23628,23629,23634,23635,23636,23638,23639,23640,23642,23643,23644,23645,23647,23650,23652,23655,23656,23657,23658,23659,23660,23661,23664,23666,23667,23668,23669,23670,23671,23672,23675,23676,23677,23678,23680,23683,23684,23685,23686,23687,23689,23690,23691,23694,23695,23698,23699,23701,23709,23710,23711,23712,23713,23716,23717,23718,23719,23720,23722,23726,23727,23728,23730,23732,23734,23737,23738,23739,23740,23742,23744,23746,23747,23749,23750,23751,23752,23753,23754,23756,23757,23758,23759,23760,23761,23763,23764,23765,23766,23767,23768,23770,23771,23772,23773,23774,23775,23776,23778,23779,23783,23785,23787,23788,23790,23791,23793,23794,23795,23796,23797,23798,23799,23800,23801,23802,23804,23805,23806,23807,23808,23809,23812,23813,23816,23817,23818,23819,23820,23821,23823,23824,23825,23826,23827,23829,23831,23832,23833,23834,23836,23837,23839,23840,23841,23842,23843,23845,23848,23850,23851,23852,23855,23856,23857,23858,23859,23861,23862,23863,23864,23865,23866,23867,23868,23871,23872,23873,23874,23875,23876,23877,23878,23880,23881,23885,23886,23887,23888,23889,23890,23891,23892,23893,23894,23895,23897,23898,23900,23902,23903,23904,23905,23906,23907,23908,23909,23910,23911,23912,23914,23917,23918,23920,23921,23922,23923,23925,23926,23927,23928,23929,23930,23931,23932,23933,23934,23935,23936,23937,23939,23940,23941,23942,23943,23944,23945,23946,23947,23948,23949,23950,23951,23952,23953,23954,23955,23956,23957,23958,23959,23960,23962,23963,23964,23966,23967,23968,23969,23970,23971,23972,23973,23974,23975,23976,23977,23978,23979,23980,23981,23982,23983,23984,23985,23986,23987,23988,23989,23990,23992,23993,23994,23995,23996,23997,23998,23999,24000,24001,24002,24003,24004,24006,24007,24008,24009,24010,24011,24012,24014,24015,24016,24017,24018,24019,24020,24021,24022,24023,24024,24025,24026,24028,24031,24032,24035,24036,24042,24044,24045,24048,24053,24054,24056,24057,24058,24059,24060,24063,24064,24068,24071,24073,24074,24075,24077,24078,24082,24083,24087,24094,24095,24096,24097,24098,24099,24100,24101,24104,24105,24106,24107,24108,24111,24112,24114,24115,24116,24117,24118,24121,24122,24126,24127,24128,24129,24131,24134,24135,24136,24137,24138,24139,24141,24142,24143,24144,24145,24146,24147,24150,24151,24152,24153,24154,24156,24157,24159,24160,24163,24164,24165,24166,24167,24168,24169,24170,24171,24172,24173,24174,24175,24176,24177,24181,24183,24185,24190,24193,24194,24195,24197,24200,24201,24204,24205,24206,24210,24216,24219,24221,24225,24226,24227,24228,24232,24233,24234,24235,24236,24238,24239,24240,24241,24242,24244,24250,24251,24252,24253,24255,24256,24257,24258,24259,24260,24261,24262,24263,24264,24267,24268,24269,24270,24271,24272,24276,24277,24279,24280,24281,24282,24284,24285,24286,24287,24288,24289,24290,24291,24292,24293,24294,24295,24297,24299,24300,24301,24302,24303,24304,24305,24306,24307,24309,24312,24313,24315,24316,24317,24325,24326,24327,24329,24332,24333,24334,24336,24338,24340,24342,24345,24346,24348,24349,24350,24353,24354,24355,24356,24360,24363,24364,24366,24368,24370,24371,24372,24373,24374,24375,24376,24379,24381,24382,24383,24385,24386,24387,24388,24389,24390,24391,24392,24393,24394,24395,24396,24397,24398,24399,24401,24404,24409,24410,24411,24412,24414,24415,24416,24419,24421,24423,24424,24427,24430,24431,24434,24436,24437,24438,24440,24442,24445,24446,24447,24451,24454,24461,24462,24463,24465,24467,24468,24470,24474,24475,24477,24478,24479,24480,24482,24483,24484,24485,24486,24487,24489,24491,24492,24495,24496,24497,24498,24499,24500,24502,24504,24505,24506,24507,24510,24511,24512,24513,24514,24519,24520,24522,24523,24526,24531,24532,24533,24538,24539,24540,24542,24543,24546,24547,24549,24550,24552,24553,24556,24559,24560,24562,24563,24564,24566,24567,24569,24570,24572,24583,24584,24585,24587,24588,24592,24593,24595,24599,24600,24602,24606,24607,24610,24611,24612,24620,24621,24622,24624,24625,24626,24627,24628,24630,24631,24632,24633,24634,24637,24638,24640,24644,24645,24646,24647,24648,24649,24650,24652,24654,24655,24657,24659,24660,24662,24663,24664,24667,24668,24670,24671,24672,24673,24677,24678,24686,24689,24690,24692,24693,24695,24702,24704,24705,24706,24709,24710,24711,24712,24714,24715,24718,24719,24720,24721,24723,24725,24727,24728,24729,24732,24734,24737,24738,24740,24741,24743,24745,24746,24750,24752,24755,24757,24758,24759,24761,24762,24765,24766,24767,24768,24769,24770,24771,24772,24775,24776,24777,24780,24781,24782,24783,24784,24786,24787,24788,24790,24791,24793,24795,24798,24801,24802,24803,24804,24805,24810,24817,24818,24821,24823,24824,24827,24828,24829,24830,24831,24834,24835,24836,24837,24839,24842,24843,24844,24848,24849,24850,24851,24852,24854,24855,24856,24857,24859,24860,24861,24862,24865,24866,24869,24872,24873,24874,24876,24877,24878,24879,24880,24881,24882,24883,24884,24885,24886,24887,24888,24889,24890,24891,24892,24893,24894,24896,24897,24898,24899,24900,24901,24902,24903,24905,24907,24909,24911,24912,24914,24915,24916,24918,24919,24920,24921,24922,24923,24924,24926,24927,24928,24929,24931,24932,24933,24934,24937,24938,24939,24940,24941,24942,24943,24945,24946,24947,24948,24950,24952,24953,24954,24955,24956,24957,24958,24959,24960,24961,24962,24963,24964,24965,24966,24967,24968,24969,24970,24972,24973,24975,24976,24977,24978,24979,24981,24982,24983,24984,24985,24986,24987,24988,24990,24991,24992,24993,24994,24995,24996,24997,24998,25002,25003,25005,25006,25007,25008,25009,25010,25011,25012,25013,25014,25016,25017,25018,25019,25020,25021,25023,25024,25025,25027,25028,25029,25030,25031,25033,25036,25037,25038,25039,25040,25043,25045,25046,25047,25048,25049,25050,25051,25052,25053,25054,25055,25056,25057,25058,25059,25060,25061,25063,25064,25065,25066,25067,25068,25069,25070,25071,25072,25073,25074,25075,25076,25078,25079,25080,25081,25082,25083,25084,25085,25086,25088,25089,25090,25091,25092,25093,25095,25097,25107,25108,25113,25116,25117,25118,25120,25123,25126,25127,25128,25129,25131,25133,25135,25136,25137,25138,25141,25142,25144,25145,25146,25147,25148,25154,25156,25157,25158,25162,25167,25168,25173,25174,25175,25177,25178,25180,25181,25182,25183,25184,25185,25186,25188,25189,25192,25201,25202,25204,25205,25207,25208,25210,25211,25213,25217,25218,25219,25221,25222,25223,25224,25227,25228,25229,25230,25231,25232,25236,25241,25244,25245,25246,25251,25254,25255,25257,25258,25261,25262,25263,25264,25266,25267,25268,25270,25271,25272,25274,25278,25280,25281,25283,25291,25295,25297,25301,25309,25310,25312,25313,25316,25322,25323,25328,25330,25333,25336,25337,25338,25339,25344,25347,25348,25349,25350,25354,25355,25356,25357,25359,25360,25362,25363,25364,25365,25367,25368,25369,25372,25382,25383,25385,25388,25389,25390,25392,25393,25395,25396,25397,25398,25399,25400,25403,25404,25406,25407,25408,25409,25412,25415,25416,25418,25425,25426,25427,25428,25430,25431,25432,25433,25434,25435,25436,25437,25440,25444,25445,25446,25448,25450,25451,25452,25455,25456,25458,25459,25460,25461,25464,25465,25468,25469,25470,25471,25473,25475,25476,25477,25478,25483,25485,25489,25491,25492,25493,25495,25497,25498,25499,25500,25501,25502,25503,25505,25508,25510,25515,25519,25521,25522,25525,25526,25529,25531,25533,25535,25536,25537,25538,25539,25541,25543,25544,25546,25547,25548,25553,25555,25556,25557,25559,25560,25561,25562,25563,25564,25565,25567,25570,25572,25573,25574,25575,25576,25579,25580,25582,25583,25584,25585,25587,25589,25591,25593,25594,25595,25596,25598,25603,25604,25606,25607,25608,25609,25610,25613,25614,25617,25618,25621,25622,25623,25624,25625,25626,25629,25631,25634,25635,25636,25637,25639,25640,25641,25643,25646,25647,25648,25649,25650,25651,25653,25654,25655,25656,25657,25659,25660,25662,25664,25666,25667,25673,25675,25676,25677,25678,25679,25680,25681,25683,25685,25686,25687,25689,25690,25691,25692,25693,25695,25696,25697,25698,25699,25700,25701,25702,25704,25706,25707,25708,25710,25711,25712,25713,25714,25715,25716,25717,25718,25719,25723,25724,25725,25726,25727,25728,25729,25731,25734,25736,25737,25738,25739,25740,25741,25742,25743,25744,25747,25748,25751,25752,25754,25755,25756,25757,25759,25760,25761,25762,25763,25765,25766,25767,25768,25770,25771,25775,25777,25778,25779,25780,25782,25785,25787,25789,25790,25791,25793,25795,25796,25798,25799,25800,25801,25802,25803,25804,25807,25809,25811,25812,25813,25814,25817,25818,25819,25820,25821,25823,25824,25825,25827,25829,25831,25832,25833,25834,25835,25836,25837,25838,25839,25840,25841,25842,25843,25844,25845,25846,25847,25848,25849,25850,25851,25852,25853,25854,25855,25857,25858,25859,25860,25861,25862,25863,25864,25866,25867,25868,25869,25870,25871,25872,25873,25875,25876,25877,25878,25879,25881,25882,25883,25884,25885,25886,25887,25888,25889,25890,25891,25892,25894,25895,25896,25897,25898,25900,25901,25904,25905,25906,25907,25911,25914,25916,25917,25920,25921,25922,25923,25924,25926,25927,25930,25931,25933,25934,25936,25938,25939,25940,25943,25944,25946,25948,25951,25952,25953,25956,25957,25959,25960,25961,25962,25965,25966,25967,25969,25971,25973,25974,25976,25977,25978,25979,25980,25981,25982,25983,25984,25985,25986,25987,25988,25989,25990,25992,25993,25994,25997,25998,25999,26002,26004,26005,26006,26008,26010,26013,26014,26016,26018,26019,26022,26024,26026,26028,26030,26033,26034,26035,26036,26037,26038,26039,26040,26042,26043,26046,26047,26048,26050,26055,26056,26057,26058,26061,26064,26065,26067,26068,26069,26072,26073,26074,26075,26076,26077,26078,26079,26081,26083,26084,26090,26091,26098,26099,26100,26101,26104,26105,26107,26108,26109,26110,26111,26113,26116,26117,26119,26120,26121,26123,26125,26128,26129,26130,26134,26135,26136,26138,26139,26140,26142,26145,26146,26147,26148,26150,26153,26154,26155,26156,26158,26160,26162,26163,26167,26168,26169,26170,26171,26173,26175,26176,26178,26180,26181,26182,26183,26184,26185,26186,26189,26190,26192,26193,26200,26201,26203,26204,26205,26206,26208,26210,26211,26213,26215,26217,26218,26219,26220,26221,26225,26226,26227,26229,26232,26233,26235,26236,26237,26239,26240,26241,26243,26245,26246,26248,26249,26250,26251,26253,26254,26255,26256,26258,26259,26260,26261,26264,26265,26266,26267,26268,26270,26271,26272,26273,26274,26275,26276,26277,26278,26281,26282,26283,26284,26285,26287,26288,26289,26290,26291,26293,26294,26295,26296,26298,26299,26300,26301,26303,26304,26305,26306,26307,26308,26309,26310,26311,26312,26313,26314,26315,26316,26317,26318,26319,26320,26321,26322,26323,26324,26325,26326,26327,26328,26330,26334,26335,26336,26337,26338,26339,26340,26341,26343,26344,26346,26347,26348,26349,26350,26351,26353,26357,26358,26360,26362,26363,26365,26369,26370,26371,26372,26373,26374,26375,26380,26382,26383,26385,26386,26387,26390,26392,26393,26394,26396,26398,26400,26401,26402,26403,26404,26405,26407,26409,26414,26416,26418,26419,26422,26423,26424,26425,26427,26428,26430,26431,26433,26436,26437,26439,26442,26443,26445,26450,26452,26453,26455,26456,26457,26458,26459,26461,26466,26467,26468,26470,26471,26475,26476,26478,26481,26484,26486,26488,26489,26490,26491,26493,26496,26498,26499,26501,26502,26504,26506,26508,26509,26510,26511,26513,26514,26515,26516,26518,26521,26523,26527,26528,26529,26532,26534,26537,26540,26542,26545,26546,26548,26553,26554,26555,26556,26557,26558,26559,26560,26562,26565,26566,26567,26568,26569,26570,26571,26572,26573,26574,26581,26582,26583,26587,26591,26593,26595,26596,26598,26599,26600,26602,26603,26605,26606,26610,26613,26614,26615,26616,26617,26618,26619,26620,26622,26625,26626,26627,26628,26630,26637,26640,26642,26644,26645,26648,26649,26650,26651,26652,26654,26655,26656,26658,26659,26660,26661,26662,26663,26664,26667,26668,26669,26670,26671,26672,26673,26676,26677,26678,26682,26683,26687,26695,26699,26701,26703,26706,26710,26711,26712,26713,26714,26715,26716,26717,26718,26719,26730,26732,26733,26734,26735,26736,26737,26738,26739,26741,26744,26745,26746,26747,26748,26749,26750,26751,26752,26754,26756,26759,26760,26761,26762,26763,26764,26765,26766,26768,26769,26770,26772,26773,26774,26776,26777,26778,26779,26780,26781,26782,26783,26784,26785,26787,26788,26789,26793,26794,26795,26796,26798,26801,26802,26804,26806,26807,26808,26809,26810,26811,26812,26813,26814,26815,26817,26819,26820,26821,26822,26823,26824,26826,26828,26830,26831,26832,26833,26835,26836,26838,26839,26841,26843,26844,26845,26846,26847,26849,26850,26852,26853,26854,26855,26856,26857,26858,26859,26860,26861,26863,26866,26867,26868,26870,26871,26872,26875,26877,26878,26879,26880,26882,26883,26884,26886,26887,26888,26889,26890,26892,26895,26897,26899,26900,26901,26902,26903,26904,26905,26906,26907,26908,26909,26910,26913,26914,26915,26917,26918,26919,26920,26921,26922,26923,26924,26926,26927,26929,26930,26931,26933,26934,26935,26936,26938,26939,26940,26942,26944,26945,26947,26948,26949,26950,26951,26952,26953,26954,26955,26956,26957,26958,26959,26960,26961,26962,26963,26965,26966,26968,26969,26971,26972,26975,26977,26978,26980,26981,26983,26984,26985,26986,26988,26989,26991,26992,26994,26995,26996,26997,26998,27002,27003,27005,27006,27007,27009,27011,27013,27018,27019,27020,27022,27023,27024,27025,27026,27027,27030,27031,27033,27034,27037,27038,27039,27040,27041,27042,27043,27044,27045,27046,27049,27050,27052,27054,27055,27056,27058,27059,27061,27062,27064,27065,27066,27068,27069,27070,27071,27072,27074,27075,27076,27077,27078,27079,27080,27081,27083,27085,27087,27089,27090,27091,27093,27094,27095,27096,27097,27098,27100,27101,27102,27105,27106,27107,27108,27109,27110,27111,27112,27113,27114,27115,27116,27118,27119,27120,27121,27123,27124,27125,27126,27127,27128,27129,27130,27131,27132,27134,27136,27137,27138,27139,27140,27141,27142,27143,27144,27145,27147,27148,27149,27150,27151,27152,27153,27154,27155,27156,27157,27158,27161,27162,27163,27164,27165,27166,27168,27170,27171,27172,27173,27174,27175,27177,27179,27180,27181,27182,27184,27186,27187,27188,27190,27191,27192,27193,27194,27195,27196,27199,27200,27201,27202,27203,27205,27206,27208,27209,27210,27211,27212,27213,27214,27215,27217,27218,27219,27220,27221,27222,27223,27226,27228,27229,27230,27231,27232,27234,27235,27236,27238,27239,27240,27241,27242,27243,27244,27245,27246,27247,27248,27250,27251,27252,27253,27254,27255,27256,27258,27259,27261,27262,27263,27265,27266,27267,27269,27270,27271,27272,27273,27274,27275,27276,27277,27279,27282,27283,27284,27285,27286,27288,27289,27290,27291,27292,27293,27294,27295,27297,27298,27299,27300,27301,27302,27303,27304,27306,27309,27310,27311,27312,27313,27314,27315,27316,27317,27318,27319,27320,27321,27322,27323,27324,27325,27326,27327,27328,27329,27330,27331,27332,27333,27334,27335,27336,27337,27338,27339,27340,27341,27342,27343,27344,27345,27346,27347,27348,27349,27350,27351,27352,27353,27354,27355,27356,27357,27358,27359,27360,27361,27362,27363,27364,27365,27366,27367,27368,27369,27370,27371,27372,27373,27374,27375,27376,27377,27378,27379,27380,27381,27382,27383,27384,27385,27386,27387,27388,27389,27390,27391,27392,27393,27394,27395,27396,27397,27398,27399,27400,27401,27402,27403,27404,27405,27406,27407,27408,27409,27410,27411,27412,27413,27414,27415,27416,27417,27418,27419,27420,27421,27422,27423,27429,27430,27432,27433,27434,27435,27436,27437,27438,27439,27440,27441,27443,27444,27445,27446,27448,27451,27452,27453,27455,27456,27457,27458,27460,27461,27464,27466,27467,27469,27470,27471,27472,27473,27474,27475,27476,27477,27478,27479,27480,27482,27483,27484,27485,27486,27487,27488,27489,27496,27497,27499,27500,27501,27502,27503,27504,27505,27506,27507,27508,27509,27510,27511,27512,27514,27517,27518,27519,27520,27525,27528,27532,27534,27535,27536,27537,27540,27541,27543,27544,27545,27548,27549,27550,27551,27552,27554,27555,27556,27557,27558,27559,27560,27561,27563,27564,27565,27566,27567,27568,27569,27570,27574,27576,27577,27578,27579,27580,27581,27582,27584,27587,27588,27590,27591,27592,27593,27594,27596,27598,27600,27601,27608,27610,27612,27613,27614,27615,27616,27618,27619,27620,27621,27622,27623,27624,27625,27628,27629,27630,27632,27633,27634,27636,27638,27639,27640,27642,27643,27644,27646,27647,27648,27649,27650,27651,27652,27656,27657,27658,27659,27660,27662,27666,27671,27676,27677,27678,27680,27683,27685,27691,27692,27693,27697,27699,27702,27703,27705,27706,27707,27708,27710,27711,27715,27716,27717,27720,27723,27724,27725,27726,27727,27729,27730,27731,27734,27736,27737,27738,27746,27747,27749,27750,27751,27755,27756,27757,27758,27759,27761,27763,27765,27767,27768,27770,27771,27772,27775,27776,27780,27783,27786,27787,27789,27790,27793,27794,27797,27798,27799,27800,27802,27804,27805,27806,27808,27810,27816,27820,27823,27824,27828,27829,27830,27831,27834,27840,27841,27842,27843,27846,27847,27848,27851,27853,27854,27855,27857,27858,27864,27865,27866,27868,27869,27871,27876,27878,27879,27881,27884,27885,27890,27892,27897,27903,27904,27906,27907,27909,27910,27912,27913,27914,27917,27919,27920,27921,27923,27924,27925,27926,27928,27932,27933,27935,27936,27937,27938,27939,27940,27942,27944,27945,27948,27949,27951,27952,27956,27958,27959,27960,27962,27967,27968,27970,27972,27977,27980,27984,27989,27990,27991,27992,27995,27997,27999,28001,28002,28004,28005,28007,28008,28011,28012,28013,28016,28017,28018,28019,28021,28022,28025,28026,28027,28029,28030,28031,28032,28033,28035,28036,28038,28039,28042,28043,28045,28047,28048,28050,28054,28055,28056,28057,28058,28060,28066,28069,28076,28077,28080,28081,28083,28084,28086,28087,28089,28090,28091,28092,28093,28094,28097,28098,28099,28104,28105,28106,28109,28110,28111,28112,28114,28115,28116,28117,28119,28122,28123,28124,28127,28130,28131,28133,28135,28136,28137,28138,28141,28143,28144,28146,28148,28149,28150,28152,28154,28157,28158,28159,28160,28161,28162,28163,28164,28166,28167,28168,28169,28171,28175,28178,28179,28181,28184,28185,28187,28188,28190,28191,28194,28198,28199,28200,28202,28204,28206,28208,28209,28211,28213,28214,28215,28217,28219,28220,28221,28222,28223,28224,28225,28226,28229,28230,28231,28232,28233,28234,28235,28236,28239,28240,28241,28242,28245,28247,28249,28250,28252,28253,28254,28256,28257,28258,28259,28260,28261,28262,28263,28264,28265,28266,28268,28269,28271,28272,28273,28274,28275,28276,28277,28278,28279,28280,28281,28282,28283,28284,28285,28288,28289,28290,28292,28295,28296,28298,28299,28300,28301,28302,28305,28306,28307,28308,28309,28310,28311,28313,28314,28315,28317,28318,28320,28321,28323,28324,28326,28328,28329,28331,28332,28333,28334,28336,28339,28341,28344,28345,28348,28350,28351,28352,28355,28356,28357,28358,28360,28361,28362,28364,28365,28366,28368,28370,28374,28376,28377,28379,28380,28381,28387,28391,28394,28395,28396,28397,28398,28399,28400,28401,28402,28403,28405,28406,28407,28408,28410,28411,28412,28413,28414,28415,28416,28417,28419,28420,28421,28423,28424,28426,28427,28428,28429,28430,28432,28433,28434,28438,28439,28440,28441,28442,28443,28444,28445,28446,28447,28449,28450,28451,28453,28454,28455,28456,28460,28462,28464,28466,28468,28469,28471,28472,28473,28474,28475,28476,28477,28479,28480,28481,28482,28483,28484,28485,28488,28489,28490,28492,28494,28495,28496,28497,28498,28499,28500,28501,28502,28503,28505,28506,28507,28509,28511,28512,28513,28515,28516,28517,28519,28520,28521,28522,28523,28524,28527,28528,28529,28531,28533,28534,28535,28537,28539,28541,28542,28543,28544,28545,28546,28547,28549,28550,28551,28554,28555,28559,28560,28561,28562,28563,28564,28565,28566,28567,28568,28569,28570,28571,28573,28574,28575,28576,28578,28579,28580,28581,28582,28584,28585,28586,28587,28588,28589,28590,28591,28592,28593,28594,28596,28597,28599,28600,28602,28603,28604,28605,28606,28607,28609,28611,28612,28613,28614,28615,28616,28618,28619,28620,28621,28622,28623,28624,28627,28628,28629,28630,28631,28632,28633,28634,28635,28636,28637,28639,28642,28643,28644,28645,28646,28647,28648,28649,28650,28651,28652,28653,28656,28657,28658,28659,28660,28661,28662,28663,28664,28665,28666,28667,28668,28669,28670,28671,28672,28673,28674,28675,28676,28677,28678,28679,28680,28681,28682,28683,28684,28685,28686,28687,28688,28690,28691,28692,28693,28694,28695,28696,28697,28700,28701,28702,28703,28704,28705,28706,28708,28709,28710,28711,28712,28713,28714,28715,28716,28717,28718,28719,28720,28721,28722,28723,28724,28726,28727,28728,28730,28731,28732,28733,28734,28735,28736,28737,28738,28739,28740,28741,28742,28743,28744,28745,28746,28747,28749,28750,28752,28753,28754,28755,28756,28757,28758,28759,28760,28761,28762,28763,28764,28765,28767,28768,28769,28770,28771,28772,28773,28774,28775,28776,28777,28778,28782,28785,28786,28787,28788,28791,28793,28794,28795,28797,28801,28802,28803,28804,28806,28807,28808,28811,28812,28813,28815,28816,28817,28819,28823,28824,28826,28827,28830,28831,28832,28833,28834,28835,28836,28837,28838,28839,28840,28841,28842,28848,28850,28852,28853,28854,28858,28862,28863,28868,28869,28870,28871,28873,28875,28876,28877,28878,28879,28880,28881,28882,28883,28884,28885,28886,28887,28890,28892,28893,28894,28896,28897,28898,28899,28901,28906,28910,28912,28913,28914,28915,28916,28917,28918,28920,28922,28923,28924,28926,28927,28928,28929,28930,28931,28932,28933,28934,28935,28936,28939,28940,28941,28942,28943,28945,28946,28948,28951,28955,28956,28957,28958,28959,28960,28961,28962,28963,28964,28965,28967,28968,28969,28970,28971,28972,28973,28974,28978,28979,28980,28981,28983,28984,28985,28986,28987,28988,28989,28990,28991,28992,28993,28994,28995,28996,28998,28999,29000,29001,29003,29005,29007,29008,29009,29010,29011,29012,29013,29014,29015,29016,29017,29018,29019,29021,29023,29024,29025,29026,29027,29029,29033,29034,29035,29036,29037,29039,29040,29041,29044,29045,29046,29047,29049,29051,29052,29054,29055,29056,29057,29058,29059,29061,29062,29063,29064,29065,29067,29068,29069,29070,29072,29073,29074,29075,29077,29078,29079,29082,29083,29084,29085,29086,29089,29090,29091,29092,29093,29094,29095,29097,29098,29099,29101,29102,29103,29104,29105,29106,29108,29110,29111,29112,29114,29115,29116,29117,29118,29119,29120,29121,29122,29124,29125,29126,29127,29128,29129,29130,29131,29132,29133,29135,29136,29137,29138,29139,29142,29143,29144,29145,29146,29147,29148,29149,29150,29151,29153,29154,29155,29156,29158,29160,29161,29162,29163,29164,29165,29167,29168,29169,29170,29171,29172,29173,29174,29175,29176,29178,29179,29180,29181,29182,29183,29184,29185,29186,29187,29188,29189,29191,29192,29193,29194,29195,29196,29197,29198,29199,29200,29201,29202,29203,29204,29205,29206,29207,29208,29209,29210,29211,29212,29214,29215,29216,29217,29218,29219,29220,29221,29222,29223,29225,29227,29229,29230,29231,29234,29235,29236,29242,29244,29246,29248,29249,29250,29251,29252,29253,29254,29257,29258,29259,29262,29263,29264,29265,29267,29268,29269,29271,29272,29274,29276,29278,29280,29283,29284,29285,29288,29290,29291,29292,29293,29296,29297,29299,29300,29302,29303,29304,29307,29308,29309,29314,29315,29317,29318,29319,29320,29321,29324,29326,29328,29329,29331,29332,29333,29334,29335,29336,29337,29338,29339,29340,29341,29342,29344,29345,29346,29347,29348,29349,29350,29351,29352,29353,29354,29355,29358,29361,29362,29363,29365,29370,29371,29372,29373,29374,29375,29376,29381,29382,29383,29385,29386,29387,29388,29391,29393,29395,29396,29397,29398,29400,29402,29403,58566,58567,58568,58569,58570,58571,58572,58573,58574,58575,58576,58577,58578,58579,58580,58581,58582,58583,58584,58585,58586,58587,58588,58589,58590,58591,58592,58593,58594,58595,58596,58597,58598,58599,58600,58601,58602,58603,58604,58605,58606,58607,58608,58609,58610,58611,58612,58613,58614,58615,58616,58617,58618,58619,58620,58621,58622,58623,58624,58625,58626,58627,58628,58629,58630,58631,58632,58633,58634,58635,58636,58637,58638,58639,58640,58641,58642,58643,58644,58645,58646,58647,58648,58649,58650,58651,58652,58653,58654,58655,58656,58657,58658,58659,58660,58661,12288,12289,12290,183,713,711,168,12291,12293,8212,65374,8214,8230,8216,8217,8220,8221,12308,12309,12296,12297,12298,12299,12300,12301,12302,12303,12310,12311,12304,12305,177,215,247,8758,8743,8744,8721,8719,8746,8745,8712,8759,8730,8869,8741,8736,8978,8857,8747,8750,8801,8780,8776,8765,8733,8800,8814,8815,8804,8805,8734,8757,8756,9794,9792,176,8242,8243,8451,65284,164,65504,65505,8240,167,8470,9734,9733,9675,9679,9678,9671,9670,9633,9632,9651,9650,8251,8594,8592,8593,8595,12307,58662,58663,58664,58665,58666,58667,58668,58669,58670,58671,58672,58673,58674,58675,58676,58677,58678,58679,58680,58681,58682,58683,58684,58685,58686,58687,58688,58689,58690,58691,58692,58693,58694,58695,58696,58697,58698,58699,58700,58701,58702,58703,58704,58705,58706,58707,58708,58709,58710,58711,58712,58713,58714,58715,58716,58717,58718,58719,58720,58721,58722,58723,58724,58725,58726,58727,58728,58729,58730,58731,58732,58733,58734,58735,58736,58737,58738,58739,58740,58741,58742,58743,58744,58745,58746,58747,58748,58749,58750,58751,58752,58753,58754,58755,58756,58757,8560,8561,8562,8563,8564,8565,8566,8567,8568,8569,59238,59239,59240,59241,59242,59243,9352,9353,9354,9355,9356,9357,9358,9359,9360,9361,9362,9363,9364,9365,9366,9367,9368,9369,9370,9371,9332,9333,9334,9335,9336,9337,9338,9339,9340,9341,9342,9343,9344,9345,9346,9347,9348,9349,9350,9351,9312,9313,9314,9315,9316,9317,9318,9319,9320,9321,8364,59245,12832,12833,12834,12835,12836,12837,12838,12839,12840,12841,59246,59247,8544,8545,8546,8547,8548,8549,8550,8551,8552,8553,8554,8555,59248,59249,58758,58759,58760,58761,58762,58763,58764,58765,58766,58767,58768,58769,58770,58771,58772,58773,58774,58775,58776,58777,58778,58779,58780,58781,58782,58783,58784,58785,58786,58787,58788,58789,58790,58791,58792,58793,58794,58795,58796,58797,58798,58799,58800,58801,58802,58803,58804,58805,58806,58807,58808,58809,58810,58811,58812,58813,58814,58815,58816,58817,58818,58819,58820,58821,58822,58823,58824,58825,58826,58827,58828,58829,58830,58831,58832,58833,58834,58835,58836,58837,58838,58839,58840,58841,58842,58843,58844,58845,58846,58847,58848,58849,58850,58851,58852,12288,65281,65282,65283,65509,65285,65286,65287,65288,65289,65290,65291,65292,65293,65294,65295,65296,65297,65298,65299,65300,65301,65302,65303,65304,65305,65306,65307,65308,65309,65310,65311,65312,65313,65314,65315,65316,65317,65318,65319,65320,65321,65322,65323,65324,65325,65326,65327,65328,65329,65330,65331,65332,65333,65334,65335,65336,65337,65338,65339,65340,65341,65342,65343,65344,65345,65346,65347,65348,65349,65350,65351,65352,65353,65354,65355,65356,65357,65358,65359,65360,65361,65362,65363,65364,65365,65366,65367,65368,65369,65370,65371,65372,65373,65507,58854,58855,58856,58857,58858,58859,58860,58861,58862,58863,58864,58865,58866,58867,58868,58869,58870,58871,58872,58873,58874,58875,58876,58877,58878,58879,58880,58881,58882,58883,58884,58885,58886,58887,58888,58889,58890,58891,58892,58893,58894,58895,58896,58897,58898,58899,58900,58901,58902,58903,58904,58905,58906,58907,58908,58909,58910,58911,58912,58913,58914,58915,58916,58917,58918,58919,58920,58921,58922,58923,58924,58925,58926,58927,58928,58929,58930,58931,58932,58933,58934,58935,58936,58937,58938,58939,58940,58941,58942,58943,58944,58945,58946,58947,58948,58949,12353,12354,12355,12356,12357,12358,12359,12360,12361,12362,12363,12364,12365,12366,12367,12368,12369,12370,12371,12372,12373,12374,12375,12376,12377,12378,12379,12380,12381,12382,12383,12384,12385,12386,12387,12388,12389,12390,12391,12392,12393,12394,12395,12396,12397,12398,12399,12400,12401,12402,12403,12404,12405,12406,12407,12408,12409,12410,12411,12412,12413,12414,12415,12416,12417,12418,12419,12420,12421,12422,12423,12424,12425,12426,12427,12428,12429,12430,12431,12432,12433,12434,12435,59250,59251,59252,59253,59254,59255,59256,59257,59258,59259,59260,58950,58951,58952,58953,58954,58955,58956,58957,58958,58959,58960,58961,58962,58963,58964,58965,58966,58967,58968,58969,58970,58971,58972,58973,58974,58975,58976,58977,58978,58979,58980,58981,58982,58983,58984,58985,58986,58987,58988,58989,58990,58991,58992,58993,58994,58995,58996,58997,58998,58999,59000,59001,59002,59003,59004,59005,59006,59007,59008,59009,59010,59011,59012,59013,59014,59015,59016,59017,59018,59019,59020,59021,59022,59023,59024,59025,59026,59027,59028,59029,59030,59031,59032,59033,59034,59035,59036,59037,59038,59039,59040,59041,59042,59043,59044,59045,12449,12450,12451,12452,12453,12454,12455,12456,12457,12458,12459,12460,12461,12462,12463,12464,12465,12466,12467,12468,12469,12470,12471,12472,12473,12474,12475,12476,12477,12478,12479,12480,12481,12482,12483,12484,12485,12486,12487,12488,12489,12490,12491,12492,12493,12494,12495,12496,12497,12498,12499,12500,12501,12502,12503,12504,12505,12506,12507,12508,12509,12510,12511,12512,12513,12514,12515,12516,12517,12518,12519,12520,12521,12522,12523,12524,12525,12526,12527,12528,12529,12530,12531,12532,12533,12534,59261,59262,59263,59264,59265,59266,59267,59268,59046,59047,59048,59049,59050,59051,59052,59053,59054,59055,59056,59057,59058,59059,59060,59061,59062,59063,59064,59065,59066,59067,59068,59069,59070,59071,59072,59073,59074,59075,59076,59077,59078,59079,59080,59081,59082,59083,59084,59085,59086,59087,59088,59089,59090,59091,59092,59093,59094,59095,59096,59097,59098,59099,59100,59101,59102,59103,59104,59105,59106,59107,59108,59109,59110,59111,59112,59113,59114,59115,59116,59117,59118,59119,59120,59121,59122,59123,59124,59125,59126,59127,59128,59129,59130,59131,59132,59133,59134,59135,59136,59137,59138,59139,59140,59141,913,914,915,916,917,918,919,920,921,922,923,924,925,926,927,928,929,931,932,933,934,935,936,937,59269,59270,59271,59272,59273,59274,59275,59276,945,946,947,948,949,950,951,952,953,954,955,956,957,958,959,960,961,963,964,965,966,967,968,969,59277,59278,59279,59280,59281,59282,59283,65077,65078,65081,65082,65087,65088,65085,65086,65089,65090,65091,65092,59284,59285,65083,65084,65079,65080,65073,59286,65075,65076,59287,59288,59289,59290,59291,59292,59293,59294,59295,59142,59143,59144,59145,59146,59147,59148,59149,59150,59151,59152,59153,59154,59155,59156,59157,59158,59159,59160,59161,59162,59163,59164,59165,59166,59167,59168,59169,59170,59171,59172,59173,59174,59175,59176,59177,59178,59179,59180,59181,59182,59183,59184,59185,59186,59187,59188,59189,59190,59191,59192,59193,59194,59195,59196,59197,59198,59199,59200,59201,59202,59203,59204,59205,59206,59207,59208,59209,59210,59211,59212,59213,59214,59215,59216,59217,59218,59219,59220,59221,59222,59223,59224,59225,59226,59227,59228,59229,59230,59231,59232,59233,59234,59235,59236,59237,1040,1041,1042,1043,1044,1045,1025,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,59296,59297,59298,59299,59300,59301,59302,59303,59304,59305,59306,59307,59308,59309,59310,1072,1073,1074,1075,1076,1077,1105,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,1103,59311,59312,59313,59314,59315,59316,59317,59318,59319,59320,59321,59322,59323,714,715,729,8211,8213,8229,8245,8453,8457,8598,8599,8600,8601,8725,8735,8739,8786,8806,8807,8895,9552,9553,9554,9555,9556,9557,9558,9559,9560,9561,9562,9563,9564,9565,9566,9567,9568,9569,9570,9571,9572,9573,9574,9575,9576,9577,9578,9579,9580,9581,9582,9583,9584,9585,9586,9587,9601,9602,9603,9604,9605,9606,9607,9608,9609,9610,9611,9612,9613,9614,9615,9619,9620,9621,9660,9661,9698,9699,9700,9701,9737,8853,12306,12317,12318,59324,59325,59326,59327,59328,59329,59330,59331,59332,59333,59334,257,225,462,224,275,233,283,232,299,237,464,236,333,243,466,242,363,250,468,249,470,472,474,476,252,234,593,7743,324,328,505,609,59337,59338,59339,59340,12549,12550,12551,12552,12553,12554,12555,12556,12557,12558,12559,12560,12561,12562,12563,12564,12565,12566,12567,12568,12569,12570,12571,12572,12573,12574,12575,12576,12577,12578,12579,12580,12581,12582,12583,12584,12585,59341,59342,59343,59344,59345,59346,59347,59348,59349,59350,59351,59352,59353,59354,59355,59356,59357,59358,59359,59360,59361,12321,12322,12323,12324,12325,12326,12327,12328,12329,12963,13198,13199,13212,13213,13214,13217,13252,13262,13265,13266,13269,65072,65506,65508,59362,8481,12849,59363,8208,59364,59365,59366,12540,12443,12444,12541,12542,12294,12445,12446,65097,65098,65099,65100,65101,65102,65103,65104,65105,65106,65108,65109,65110,65111,65113,65114,65115,65116,65117,65118,65119,65120,65121,65122,65123,65124,65125,65126,65128,65129,65130,65131,12350,12272,12273,12274,12275,12276,12277,12278,12279,12280,12281,12282,12283,12295,59380,59381,59382,59383,59384,59385,59386,59387,59388,59389,59390,59391,59392,9472,9473,9474,9475,9476,9477,9478,9479,9480,9481,9482,9483,9484,9485,9486,9487,9488,9489,9490,9491,9492,9493,9494,9495,9496,9497,9498,9499,9500,9501,9502,9503,9504,9505,9506,9507,9508,9509,9510,9511,9512,9513,9514,9515,9516,9517,9518,9519,9520,9521,9522,9523,9524,9525,9526,9527,9528,9529,9530,9531,9532,9533,9534,9535,9536,9537,9538,9539,9540,9541,9542,9543,9544,9545,9546,9547,59393,59394,59395,59396,59397,59398,59399,59400,59401,59402,59403,59404,59405,59406,59407,29404,29405,29407,29410,29411,29412,29413,29414,29415,29418,29419,29429,29430,29433,29437,29438,29439,29440,29442,29444,29445,29446,29447,29448,29449,29451,29452,29453,29455,29456,29457,29458,29460,29464,29465,29466,29471,29472,29475,29476,29478,29479,29480,29485,29487,29488,29490,29491,29493,29494,29498,29499,29500,29501,29504,29505,29506,29507,29508,29509,29510,29511,29512,29513,29514,29515,29516,29518,29519,29521,29523,29524,29525,29526,29528,29529,29530,29531,29532,29533,29534,29535,29537,29538,29539,29540,29541,29542,29543,29544,29545,29546,29547,29550,29552,29553,57344,57345,57346,57347,57348,57349,57350,57351,57352,57353,57354,57355,57356,57357,57358,57359,57360,57361,57362,57363,57364,57365,57366,57367,57368,57369,57370,57371,57372,57373,57374,57375,57376,57377,57378,57379,57380,57381,57382,57383,57384,57385,57386,57387,57388,57389,57390,57391,57392,57393,57394,57395,57396,57397,57398,57399,57400,57401,57402,57403,57404,57405,57406,57407,57408,57409,57410,57411,57412,57413,57414,57415,57416,57417,57418,57419,57420,57421,57422,57423,57424,57425,57426,57427,57428,57429,57430,57431,57432,57433,57434,57435,57436,57437,29554,29555,29556,29557,29558,29559,29560,29561,29562,29563,29564,29565,29567,29568,29569,29570,29571,29573,29574,29576,29578,29580,29581,29583,29584,29586,29587,29588,29589,29591,29592,29593,29594,29596,29597,29598,29600,29601,29603,29604,29605,29606,29607,29608,29610,29612,29613,29617,29620,29621,29622,29624,29625,29628,29629,29630,29631,29633,29635,29636,29637,29638,29639,29643,29644,29646,29650,29651,29652,29653,29654,29655,29656,29658,29659,29660,29661,29663,29665,29666,29667,29668,29670,29672,29674,29675,29676,29678,29679,29680,29681,29683,29684,29685,29686,29687,57438,57439,57440,57441,57442,57443,57444,57445,57446,57447,57448,57449,57450,57451,57452,57453,57454,57455,57456,57457,57458,57459,57460,57461,57462,57463,57464,57465,57466,57467,57468,57469,57470,57471,57472,57473,57474,57475,57476,57477,57478,57479,57480,57481,57482,57483,57484,57485,57486,57487,57488,57489,57490,57491,57492,57493,57494,57495,57496,57497,57498,57499,57500,57501,57502,57503,57504,57505,57506,57507,57508,57509,57510,57511,57512,57513,57514,57515,57516,57517,57518,57519,57520,57521,57522,57523,57524,57525,57526,57527,57528,57529,57530,57531,29688,29689,29690,29691,29692,29693,29694,29695,29696,29697,29698,29700,29703,29704,29707,29708,29709,29710,29713,29714,29715,29716,29717,29718,29719,29720,29721,29724,29725,29726,29727,29728,29729,29731,29732,29735,29737,29739,29741,29743,29745,29746,29751,29752,29753,29754,29755,29757,29758,29759,29760,29762,29763,29764,29765,29766,29767,29768,29769,29770,29771,29772,29773,29774,29775,29776,29777,29778,29779,29780,29782,29784,29789,29792,29793,29794,29795,29796,29797,29798,29799,29800,29801,29802,29803,29804,29806,29807,29809,29810,29811,29812,29813,29816,29817,29818,57532,57533,57534,57535,57536,57537,57538,57539,57540,57541,57542,57543,57544,57545,57546,57547,57548,57549,57550,57551,57552,57553,57554,57555,57556,57557,57558,57559,57560,57561,57562,57563,57564,57565,57566,57567,57568,57569,57570,57571,57572,57573,57574,57575,57576,57577,57578,57579,57580,57581,57582,57583,57584,57585,57586,57587,57588,57589,57590,57591,57592,57593,57594,57595,57596,57597,57598,57599,57600,57601,57602,57603,57604,57605,57606,57607,57608,57609,57610,57611,57612,57613,57614,57615,57616,57617,57618,57619,57620,57621,57622,57623,57624,57625,29819,29820,29821,29823,29826,29828,29829,29830,29832,29833,29834,29836,29837,29839,29841,29842,29843,29844,29845,29846,29847,29848,29849,29850,29851,29853,29855,29856,29857,29858,29859,29860,29861,29862,29866,29867,29868,29869,29870,29871,29872,29873,29874,29875,29876,29877,29878,29879,29880,29881,29883,29884,29885,29886,29887,29888,29889,29890,29891,29892,29893,29894,29895,29896,29897,29898,29899,29900,29901,29902,29903,29904,29905,29907,29908,29909,29910,29911,29912,29913,29914,29915,29917,29919,29921,29925,29927,29928,29929,29930,29931,29932,29933,29936,29937,29938,57626,57627,57628,57629,57630,57631,57632,57633,57634,57635,57636,57637,57638,57639,57640,57641,57642,57643,57644,57645,57646,57647,57648,57649,57650,57651,57652,57653,57654,57655,57656,57657,57658,57659,57660,57661,57662,57663,57664,57665,57666,57667,57668,57669,57670,57671,57672,57673,57674,57675,57676,57677,57678,57679,57680,57681,57682,57683,57684,57685,57686,57687,57688,57689,57690,57691,57692,57693,57694,57695,57696,57697,57698,57699,57700,57701,57702,57703,57704,57705,57706,57707,57708,57709,57710,57711,57712,57713,57714,57715,57716,57717,57718,57719,29939,29941,29944,29945,29946,29947,29948,29949,29950,29952,29953,29954,29955,29957,29958,29959,29960,29961,29962,29963,29964,29966,29968,29970,29972,29973,29974,29975,29979,29981,29982,29984,29985,29986,29987,29988,29990,29991,29994,29998,30004,30006,30009,30012,30013,30015,30017,30018,30019,30020,30022,30023,30025,30026,30029,30032,30033,30034,30035,30037,30038,30039,30040,30045,30046,30047,30048,30049,30050,30051,30052,30055,30056,30057,30059,30060,30061,30062,30063,30064,30065,30067,30069,30070,30071,30074,30075,30076,30077,30078,30080,30081,30082,30084,30085,30087,57720,57721,57722,57723,57724,57725,57726,57727,57728,57729,57730,57731,57732,57733,57734,57735,57736,57737,57738,57739,57740,57741,57742,57743,57744,57745,57746,57747,57748,57749,57750,57751,57752,57753,57754,57755,57756,57757,57758,57759,57760,57761,57762,57763,57764,57765,57766,57767,57768,57769,57770,57771,57772,57773,57774,57775,57776,57777,57778,57779,57780,57781,57782,57783,57784,57785,57786,57787,57788,57789,57790,57791,57792,57793,57794,57795,57796,57797,57798,57799,57800,57801,57802,57803,57804,57805,57806,57807,57808,57809,57810,57811,57812,57813,30088,30089,30090,30092,30093,30094,30096,30099,30101,30104,30107,30108,30110,30114,30118,30119,30120,30121,30122,30125,30134,30135,30138,30139,30143,30144,30145,30150,30155,30156,30158,30159,30160,30161,30163,30167,30169,30170,30172,30173,30175,30176,30177,30181,30185,30188,30189,30190,30191,30194,30195,30197,30198,30199,30200,30202,30203,30205,30206,30210,30212,30214,30215,30216,30217,30219,30221,30222,30223,30225,30226,30227,30228,30230,30234,30236,30237,30238,30241,30243,30247,30248,30252,30254,30255,30257,30258,30262,30263,30265,30266,30267,30269,30273,30274,30276,57814,57815,57816,57817,57818,57819,57820,57821,57822,57823,57824,57825,57826,57827,57828,57829,57830,57831,57832,57833,57834,57835,57836,57837,57838,57839,57840,57841,57842,57843,57844,57845,57846,57847,57848,57849,57850,57851,57852,57853,57854,57855,57856,57857,57858,57859,57860,57861,57862,57863,57864,57865,57866,57867,57868,57869,57870,57871,57872,57873,57874,57875,57876,57877,57878,57879,57880,57881,57882,57883,57884,57885,57886,57887,57888,57889,57890,57891,57892,57893,57894,57895,57896,57897,57898,57899,57900,57901,57902,57903,57904,57905,57906,57907,30277,30278,30279,30280,30281,30282,30283,30286,30287,30288,30289,30290,30291,30293,30295,30296,30297,30298,30299,30301,30303,30304,30305,30306,30308,30309,30310,30311,30312,30313,30314,30316,30317,30318,30320,30321,30322,30323,30324,30325,30326,30327,30329,30330,30332,30335,30336,30337,30339,30341,30345,30346,30348,30349,30351,30352,30354,30356,30357,30359,30360,30362,30363,30364,30365,30366,30367,30368,30369,30370,30371,30373,30374,30375,30376,30377,30378,30379,30380,30381,30383,30384,30387,30389,30390,30391,30392,30393,30394,30395,30396,30397,30398,30400,30401,30403,21834,38463,22467,25384,21710,21769,21696,30353,30284,34108,30702,33406,30861,29233,38552,38797,27688,23433,20474,25353,26263,23736,33018,26696,32942,26114,30414,20985,25942,29100,32753,34948,20658,22885,25034,28595,33453,25420,25170,21485,21543,31494,20843,30116,24052,25300,36299,38774,25226,32793,22365,38712,32610,29240,30333,26575,30334,25670,20336,36133,25308,31255,26001,29677,25644,25203,33324,39041,26495,29256,25198,25292,20276,29923,21322,21150,32458,37030,24110,26758,27036,33152,32465,26834,30917,34444,38225,20621,35876,33502,32990,21253,35090,21093,30404,30407,30409,30411,30412,30419,30421,30425,30426,30428,30429,30430,30432,30433,30434,30435,30436,30438,30439,30440,30441,30442,30443,30444,30445,30448,30451,30453,30454,30455,30458,30459,30461,30463,30464,30466,30467,30469,30470,30474,30476,30478,30479,30480,30481,30482,30483,30484,30485,30486,30487,30488,30491,30492,30493,30494,30497,30499,30500,30501,30503,30506,30507,30508,30510,30512,30513,30514,30515,30516,30521,30523,30525,30526,30527,30530,30532,30533,30534,30536,30537,30538,30539,30540,30541,30542,30543,30546,30547,30548,30549,30550,30551,30552,30553,30556,34180,38649,20445,22561,39281,23453,25265,25253,26292,35961,40077,29190,26479,30865,24754,21329,21271,36744,32972,36125,38049,20493,29384,22791,24811,28953,34987,22868,33519,26412,31528,23849,32503,29997,27893,36454,36856,36924,40763,27604,37145,31508,24444,30887,34006,34109,27605,27609,27606,24065,24199,30201,38381,25949,24330,24517,36767,22721,33218,36991,38491,38829,36793,32534,36140,25153,20415,21464,21342,36776,36777,36779,36941,26631,24426,33176,34920,40150,24971,21035,30250,24428,25996,28626,28392,23486,25672,20853,20912,26564,19993,31177,39292,28851,30557,30558,30559,30560,30564,30567,30569,30570,30573,30574,30575,30576,30577,30578,30579,30580,30581,30582,30583,30584,30586,30587,30588,30593,30594,30595,30598,30599,30600,30601,30602,30603,30607,30608,30611,30612,30613,30614,30615,30616,30617,30618,30619,30620,30621,30622,30625,30627,30628,30630,30632,30635,30637,30638,30639,30641,30642,30644,30646,30647,30648,30649,30650,30652,30654,30656,30657,30658,30659,30660,30661,30662,30663,30664,30665,30666,30667,30668,30670,30671,30672,30673,30674,30675,30676,30677,30678,30680,30681,30682,30685,30686,30687,30688,30689,30692,30149,24182,29627,33760,25773,25320,38069,27874,21338,21187,25615,38082,31636,20271,24091,33334,33046,33162,28196,27850,39539,25429,21340,21754,34917,22496,19981,24067,27493,31807,37096,24598,25830,29468,35009,26448,25165,36130,30572,36393,37319,24425,33756,34081,39184,21442,34453,27531,24813,24808,28799,33485,33329,20179,27815,34255,25805,31961,27133,26361,33609,21397,31574,20391,20876,27979,23618,36461,25554,21449,33580,33590,26597,30900,25661,23519,23700,24046,35815,25286,26612,35962,25600,25530,34633,39307,35863,32544,38130,20135,38416,39076,26124,29462,30694,30696,30698,30703,30704,30705,30706,30708,30709,30711,30713,30714,30715,30716,30723,30724,30725,30726,30727,30728,30730,30731,30734,30735,30736,30739,30741,30745,30747,30750,30752,30753,30754,30756,30760,30762,30763,30766,30767,30769,30770,30771,30773,30774,30781,30783,30785,30786,30787,30788,30790,30792,30793,30794,30795,30797,30799,30801,30803,30804,30808,30809,30810,30811,30812,30814,30815,30816,30817,30818,30819,30820,30821,30822,30823,30824,30825,30831,30832,30833,30834,30835,30836,30837,30838,30840,30841,30842,30843,30845,30846,30847,30848,30849,30850,30851,22330,23581,24120,38271,20607,32928,21378,25950,30021,21809,20513,36229,25220,38046,26397,22066,28526,24034,21557,28818,36710,25199,25764,25507,24443,28552,37108,33251,36784,23576,26216,24561,27785,38472,36225,34924,25745,31216,22478,27225,25104,21576,20056,31243,24809,28548,35802,25215,36894,39563,31204,21507,30196,25345,21273,27744,36831,24347,39536,32827,40831,20360,23610,36196,32709,26021,28861,20805,20914,34411,23815,23456,25277,37228,30068,36364,31264,24833,31609,20167,32504,30597,19985,33261,21021,20986,27249,21416,36487,38148,38607,28353,38500,26970,30852,30853,30854,30856,30858,30859,30863,30864,30866,30868,30869,30870,30873,30877,30878,30880,30882,30884,30886,30888,30889,30890,30891,30892,30893,30894,30895,30901,30902,30903,30904,30906,30907,30908,30909,30911,30912,30914,30915,30916,30918,30919,30920,30924,30925,30926,30927,30929,30930,30931,30934,30935,30936,30938,30939,30940,30941,30942,30943,30944,30945,30946,30947,30948,30949,30950,30951,30953,30954,30955,30957,30958,30959,30960,30961,30963,30965,30966,30968,30969,30971,30972,30973,30974,30975,30976,30978,30979,30980,30982,30983,30984,30985,30986,30987,30988,30784,20648,30679,25616,35302,22788,25571,24029,31359,26941,20256,33337,21912,20018,30126,31383,24162,24202,38383,21019,21561,28810,25462,38180,22402,26149,26943,37255,21767,28147,32431,34850,25139,32496,30133,33576,30913,38604,36766,24904,29943,35789,27492,21050,36176,27425,32874,33905,22257,21254,20174,19995,20945,31895,37259,31751,20419,36479,31713,31388,25703,23828,20652,33030,30209,31929,28140,32736,26449,23384,23544,30923,25774,25619,25514,25387,38169,25645,36798,31572,30249,25171,22823,21574,27513,20643,25140,24102,27526,20195,36151,34955,24453,36910,30989,30990,30991,30992,30993,30994,30996,30997,30998,30999,31000,31001,31002,31003,31004,31005,31007,31008,31009,31010,31011,31013,31014,31015,31016,31017,31018,31019,31020,31021,31022,31023,31024,31025,31026,31027,31029,31030,31031,31032,31033,31037,31039,31042,31043,31044,31045,31047,31050,31051,31052,31053,31054,31055,31056,31057,31058,31060,31061,31064,31065,31073,31075,31076,31078,31081,31082,31083,31084,31086,31088,31089,31090,31091,31092,31093,31094,31097,31099,31100,31101,31102,31103,31106,31107,31110,31111,31112,31113,31115,31116,31117,31118,31120,31121,31122,24608,32829,25285,20025,21333,37112,25528,32966,26086,27694,20294,24814,28129,35806,24377,34507,24403,25377,20826,33633,26723,20992,25443,36424,20498,23707,31095,23548,21040,31291,24764,36947,30423,24503,24471,30340,36460,28783,30331,31561,30634,20979,37011,22564,20302,28404,36842,25932,31515,29380,28068,32735,23265,25269,24213,22320,33922,31532,24093,24351,36882,32532,39072,25474,28359,30872,28857,20856,38747,22443,30005,20291,30008,24215,24806,22880,28096,27583,30857,21500,38613,20939,20993,25481,21514,38035,35843,36300,29241,30879,34678,36845,35853,21472,31123,31124,31125,31126,31127,31128,31129,31131,31132,31133,31134,31135,31136,31137,31138,31139,31140,31141,31142,31144,31145,31146,31147,31148,31149,31150,31151,31152,31153,31154,31156,31157,31158,31159,31160,31164,31167,31170,31172,31173,31175,31176,31178,31180,31182,31183,31184,31187,31188,31190,31191,31193,31194,31195,31196,31197,31198,31200,31201,31202,31205,31208,31210,31212,31214,31217,31218,31219,31220,31221,31222,31223,31225,31226,31228,31230,31231,31233,31236,31237,31239,31240,31241,31242,31244,31247,31248,31249,31250,31251,31253,31254,31256,31257,31259,31260,19969,30447,21486,38025,39030,40718,38189,23450,35746,20002,19996,20908,33891,25026,21160,26635,20375,24683,20923,27934,20828,25238,26007,38497,35910,36887,30168,37117,30563,27602,29322,29420,35835,22581,30585,36172,26460,38208,32922,24230,28193,22930,31471,30701,38203,27573,26029,32526,22534,20817,38431,23545,22697,21544,36466,25958,39039,22244,38045,30462,36929,25479,21702,22810,22842,22427,36530,26421,36346,33333,21057,24816,22549,34558,23784,40517,20420,39069,35769,23077,24694,21380,25212,36943,37122,39295,24681,32780,20799,32819,23572,39285,27953,20108,31261,31263,31265,31266,31268,31269,31270,31271,31272,31273,31274,31275,31276,31277,31278,31279,31280,31281,31282,31284,31285,31286,31288,31290,31294,31296,31297,31298,31299,31300,31301,31303,31304,31305,31306,31307,31308,31309,31310,31311,31312,31314,31315,31316,31317,31318,31320,31321,31322,31323,31324,31325,31326,31327,31328,31329,31330,31331,31332,31333,31334,31335,31336,31337,31338,31339,31340,31341,31342,31343,31345,31346,31347,31349,31355,31356,31357,31358,31362,31365,31367,31369,31370,31371,31372,31374,31375,31376,31379,31380,31385,31386,31387,31390,31393,31394,36144,21457,32602,31567,20240,20047,38400,27861,29648,34281,24070,30058,32763,27146,30718,38034,32321,20961,28902,21453,36820,33539,36137,29359,39277,27867,22346,33459,26041,32938,25151,38450,22952,20223,35775,32442,25918,33778,38750,21857,39134,32933,21290,35837,21536,32954,24223,27832,36153,33452,37210,21545,27675,20998,32439,22367,28954,27774,31881,22859,20221,24575,24868,31914,20016,23553,26539,34562,23792,38155,39118,30127,28925,36898,20911,32541,35773,22857,20964,20315,21542,22827,25975,32932,23413,25206,25282,36752,24133,27679,31526,20239,20440,26381,31395,31396,31399,31401,31402,31403,31406,31407,31408,31409,31410,31412,31413,31414,31415,31416,31417,31418,31419,31420,31421,31422,31424,31425,31426,31427,31428,31429,31430,31431,31432,31433,31434,31436,31437,31438,31439,31440,31441,31442,31443,31444,31445,31447,31448,31450,31451,31452,31453,31457,31458,31460,31463,31464,31465,31466,31467,31468,31470,31472,31473,31474,31475,31476,31477,31478,31479,31480,31483,31484,31486,31488,31489,31490,31493,31495,31497,31500,31501,31502,31504,31506,31507,31510,31511,31512,31514,31516,31517,31519,31521,31522,31523,31527,31529,31533,28014,28074,31119,34993,24343,29995,25242,36741,20463,37340,26023,33071,33105,24220,33104,36212,21103,35206,36171,22797,20613,20184,38428,29238,33145,36127,23500,35747,38468,22919,32538,21648,22134,22030,35813,25913,27010,38041,30422,28297,24178,29976,26438,26577,31487,32925,36214,24863,31174,25954,36195,20872,21018,38050,32568,32923,32434,23703,28207,26464,31705,30347,39640,33167,32660,31957,25630,38224,31295,21578,21733,27468,25601,25096,40509,33011,30105,21106,38761,33883,26684,34532,38401,38548,38124,20010,21508,32473,26681,36319,32789,26356,24218,32697,31535,31536,31538,31540,31541,31542,31543,31545,31547,31549,31551,31552,31553,31554,31555,31556,31558,31560,31562,31565,31566,31571,31573,31575,31577,31580,31582,31583,31585,31587,31588,31589,31590,31591,31592,31593,31594,31595,31596,31597,31599,31600,31603,31604,31606,31608,31610,31612,31613,31615,31617,31618,31619,31620,31622,31623,31624,31625,31626,31627,31628,31630,31631,31633,31634,31635,31638,31640,31641,31642,31643,31646,31647,31648,31651,31652,31653,31662,31663,31664,31666,31667,31669,31670,31671,31673,31674,31675,31676,31677,31678,31679,31680,31682,31683,31684,22466,32831,26775,24037,25915,21151,24685,40858,20379,36524,20844,23467,24339,24041,27742,25329,36129,20849,38057,21246,27807,33503,29399,22434,26500,36141,22815,36764,33735,21653,31629,20272,27837,23396,22993,40723,21476,34506,39592,35895,32929,25925,39038,22266,38599,21038,29916,21072,23521,25346,35074,20054,25296,24618,26874,20851,23448,20896,35266,31649,39302,32592,24815,28748,36143,20809,24191,36891,29808,35268,22317,30789,24402,40863,38394,36712,39740,35809,30328,26690,26588,36330,36149,21053,36746,28378,26829,38149,37101,22269,26524,35065,36807,21704,31685,31688,31689,31690,31691,31693,31694,31695,31696,31698,31700,31701,31702,31703,31704,31707,31708,31710,31711,31712,31714,31715,31716,31719,31720,31721,31723,31724,31725,31727,31728,31730,31731,31732,31733,31734,31736,31737,31738,31739,31741,31743,31744,31745,31746,31747,31748,31749,31750,31752,31753,31754,31757,31758,31760,31761,31762,31763,31764,31765,31767,31768,31769,31770,31771,31772,31773,31774,31776,31777,31778,31779,31780,31781,31784,31785,31787,31788,31789,31790,31791,31792,31793,31794,31795,31796,31797,31798,31799,31801,31802,31803,31804,31805,31806,31810,39608,23401,28023,27686,20133,23475,39559,37219,25000,37039,38889,21547,28085,23506,20989,21898,32597,32752,25788,25421,26097,25022,24717,28938,27735,27721,22831,26477,33322,22741,22158,35946,27627,37085,22909,32791,21495,28009,21621,21917,33655,33743,26680,31166,21644,20309,21512,30418,35977,38402,27827,28088,36203,35088,40548,36154,22079,40657,30165,24456,29408,24680,21756,20136,27178,34913,24658,36720,21700,28888,34425,40511,27946,23439,24344,32418,21897,20399,29492,21564,21402,20505,21518,21628,20046,24573,29786,22774,33899,32993,34676,29392,31946,28246,31811,31812,31813,31814,31815,31816,31817,31818,31819,31820,31822,31823,31824,31825,31826,31827,31828,31829,31830,31831,31832,31833,31834,31835,31836,31837,31838,31839,31840,31841,31842,31843,31844,31845,31846,31847,31848,31849,31850,31851,31852,31853,31854,31855,31856,31857,31858,31861,31862,31863,31864,31865,31866,31870,31871,31872,31873,31874,31875,31876,31877,31878,31879,31880,31882,31883,31884,31885,31886,31887,31888,31891,31892,31894,31897,31898,31899,31904,31905,31907,31910,31911,31912,31913,31915,31916,31917,31919,31920,31924,31925,31926,31927,31928,31930,31931,24359,34382,21804,25252,20114,27818,25143,33457,21719,21326,29502,28369,30011,21010,21270,35805,27088,24458,24576,28142,22351,27426,29615,26707,36824,32531,25442,24739,21796,30186,35938,28949,28067,23462,24187,33618,24908,40644,30970,34647,31783,30343,20976,24822,29004,26179,24140,24653,35854,28784,25381,36745,24509,24674,34516,22238,27585,24724,24935,21321,24800,26214,36159,31229,20250,28905,27719,35763,35826,32472,33636,26127,23130,39746,27985,28151,35905,27963,20249,28779,33719,25110,24785,38669,36135,31096,20987,22334,22522,26426,30072,31293,31215,31637,31935,31936,31938,31939,31940,31942,31945,31947,31950,31951,31952,31953,31954,31955,31956,31960,31962,31963,31965,31966,31969,31970,31971,31972,31973,31974,31975,31977,31978,31979,31980,31981,31982,31984,31985,31986,31987,31988,31989,31990,31991,31993,31994,31996,31997,31998,31999,32000,32001,32002,32003,32004,32005,32006,32007,32008,32009,32011,32012,32013,32014,32015,32016,32017,32018,32019,32020,32021,32022,32023,32024,32025,32026,32027,32028,32029,32030,32031,32033,32035,32036,32037,32038,32040,32041,32042,32044,32045,32046,32048,32049,32050,32051,32052,32053,32054,32908,39269,36857,28608,35749,40481,23020,32489,32521,21513,26497,26840,36753,31821,38598,21450,24613,30142,27762,21363,23241,32423,25380,20960,33034,24049,34015,25216,20864,23395,20238,31085,21058,24760,27982,23492,23490,35745,35760,26082,24524,38469,22931,32487,32426,22025,26551,22841,20339,23478,21152,33626,39050,36158,30002,38078,20551,31292,20215,26550,39550,23233,27516,30417,22362,23574,31546,38388,29006,20860,32937,33392,22904,32516,33575,26816,26604,30897,30839,25315,25441,31616,20461,21098,20943,33616,27099,37492,36341,36145,35265,38190,31661,20214,32055,32056,32057,32058,32059,32060,32061,32062,32063,32064,32065,32066,32067,32068,32069,32070,32071,32072,32073,32074,32075,32076,32077,32078,32079,32080,32081,32082,32083,32084,32085,32086,32087,32088,32089,32090,32091,32092,32093,32094,32095,32096,32097,32098,32099,32100,32101,32102,32103,32104,32105,32106,32107,32108,32109,32111,32112,32113,32114,32115,32116,32117,32118,32120,32121,32122,32123,32124,32125,32126,32127,32128,32129,32130,32131,32132,32133,32134,32135,32136,32137,32138,32139,32140,32141,32142,32143,32144,32145,32146,32147,32148,32149,32150,32151,32152,20581,33328,21073,39279,28176,28293,28071,24314,20725,23004,23558,27974,27743,30086,33931,26728,22870,35762,21280,37233,38477,34121,26898,30977,28966,33014,20132,37066,27975,39556,23047,22204,25605,38128,30699,20389,33050,29409,35282,39290,32564,32478,21119,25945,37237,36735,36739,21483,31382,25581,25509,30342,31224,34903,38454,25130,21163,33410,26708,26480,25463,30571,31469,27905,32467,35299,22992,25106,34249,33445,30028,20511,20171,30117,35819,23626,24062,31563,26020,37329,20170,27941,35167,32039,38182,20165,35880,36827,38771,26187,31105,36817,28908,28024,32153,32154,32155,32156,32157,32158,32159,32160,32161,32162,32163,32164,32165,32167,32168,32169,32170,32171,32172,32173,32175,32176,32177,32178,32179,32180,32181,32182,32183,32184,32185,32186,32187,32188,32189,32190,32191,32192,32193,32194,32195,32196,32197,32198,32199,32200,32201,32202,32203,32204,32205,32206,32207,32208,32209,32210,32211,32212,32213,32214,32215,32216,32217,32218,32219,32220,32221,32222,32223,32224,32225,32226,32227,32228,32229,32230,32231,32232,32233,32234,32235,32236,32237,32238,32239,32240,32241,32242,32243,32244,32245,32246,32247,32248,32249,32250,23613,21170,33606,20834,33550,30555,26230,40120,20140,24778,31934,31923,32463,20117,35686,26223,39048,38745,22659,25964,38236,24452,30153,38742,31455,31454,20928,28847,31384,25578,31350,32416,29590,38893,20037,28792,20061,37202,21417,25937,26087,33276,33285,21646,23601,30106,38816,25304,29401,30141,23621,39545,33738,23616,21632,30697,20030,27822,32858,25298,25454,24040,20855,36317,36382,38191,20465,21477,24807,28844,21095,25424,40515,23071,20518,30519,21367,32482,25733,25899,25225,25496,20500,29237,35273,20915,35776,32477,22343,33740,38055,20891,21531,23803,32251,32252,32253,32254,32255,32256,32257,32258,32259,32260,32261,32262,32263,32264,32265,32266,32267,32268,32269,32270,32271,32272,32273,32274,32275,32276,32277,32278,32279,32280,32281,32282,32283,32284,32285,32286,32287,32288,32289,32290,32291,32292,32293,32294,32295,32296,32297,32298,32299,32300,32301,32302,32303,32304,32305,32306,32307,32308,32309,32310,32311,32312,32313,32314,32316,32317,32318,32319,32320,32322,32323,32324,32325,32326,32328,32329,32330,32331,32332,32333,32334,32335,32336,32337,32338,32339,32340,32341,32342,32343,32344,32345,32346,32347,32348,32349,20426,31459,27994,37089,39567,21888,21654,21345,21679,24320,25577,26999,20975,24936,21002,22570,21208,22350,30733,30475,24247,24951,31968,25179,25239,20130,28821,32771,25335,28900,38752,22391,33499,26607,26869,30933,39063,31185,22771,21683,21487,28212,20811,21051,23458,35838,32943,21827,22438,24691,22353,21549,31354,24656,23380,25511,25248,21475,25187,23495,26543,21741,31391,33510,37239,24211,35044,22840,22446,25358,36328,33007,22359,31607,20393,24555,23485,27454,21281,31568,29378,26694,30719,30518,26103,20917,20111,30420,23743,31397,33909,22862,39745,20608,32350,32351,32352,32353,32354,32355,32356,32357,32358,32359,32360,32361,32362,32363,32364,32365,32366,32367,32368,32369,32370,32371,32372,32373,32374,32375,32376,32377,32378,32379,32380,32381,32382,32383,32384,32385,32387,32388,32389,32390,32391,32392,32393,32394,32395,32396,32397,32398,32399,32400,32401,32402,32403,32404,32405,32406,32407,32408,32409,32410,32412,32413,32414,32430,32436,32443,32444,32470,32484,32492,32505,32522,32528,32542,32567,32569,32571,32572,32573,32574,32575,32576,32577,32579,32582,32583,32584,32585,32586,32587,32588,32589,32590,32591,32594,32595,39304,24871,28291,22372,26118,25414,22256,25324,25193,24275,38420,22403,25289,21895,34593,33098,36771,21862,33713,26469,36182,34013,23146,26639,25318,31726,38417,20848,28572,35888,25597,35272,25042,32518,28866,28389,29701,27028,29436,24266,37070,26391,28010,25438,21171,29282,32769,20332,23013,37226,28889,28061,21202,20048,38647,38253,34174,30922,32047,20769,22418,25794,32907,31867,27882,26865,26974,20919,21400,26792,29313,40654,31729,29432,31163,28435,29702,26446,37324,40100,31036,33673,33620,21519,26647,20029,21385,21169,30782,21382,21033,20616,20363,20432,32598,32601,32603,32604,32605,32606,32608,32611,32612,32613,32614,32615,32619,32620,32621,32623,32624,32627,32629,32630,32631,32632,32634,32635,32636,32637,32639,32640,32642,32643,32644,32645,32646,32647,32648,32649,32651,32653,32655,32656,32657,32658,32659,32661,32662,32663,32664,32665,32667,32668,32672,32674,32675,32677,32678,32680,32681,32682,32683,32684,32685,32686,32689,32691,32692,32693,32694,32695,32698,32699,32702,32704,32706,32707,32708,32710,32711,32712,32713,32715,32717,32719,32720,32721,32722,32723,32726,32727,32729,32730,32731,32732,32733,32734,32738,32739,30178,31435,31890,27813,38582,21147,29827,21737,20457,32852,33714,36830,38256,24265,24604,28063,24088,25947,33080,38142,24651,28860,32451,31918,20937,26753,31921,33391,20004,36742,37327,26238,20142,35845,25769,32842,20698,30103,29134,23525,36797,28518,20102,25730,38243,24278,26009,21015,35010,28872,21155,29454,29747,26519,30967,38678,20020,37051,40158,28107,20955,36161,21533,25294,29618,33777,38646,40836,38083,20278,32666,20940,28789,38517,23725,39046,21478,20196,28316,29705,27060,30827,39311,30041,21016,30244,27969,26611,20845,40857,32843,21657,31548,31423,32740,32743,32744,32746,32747,32748,32749,32751,32754,32756,32757,32758,32759,32760,32761,32762,32765,32766,32767,32770,32775,32776,32777,32778,32782,32783,32785,32787,32794,32795,32797,32798,32799,32801,32803,32804,32811,32812,32813,32814,32815,32816,32818,32820,32825,32826,32828,32830,32832,32833,32836,32837,32839,32840,32841,32846,32847,32848,32849,32851,32853,32854,32855,32857,32859,32860,32861,32862,32863,32864,32865,32866,32867,32868,32869,32870,32871,32872,32875,32876,32877,32878,32879,32880,32882,32883,32884,32885,32886,32887,32888,32889,32890,32891,32892,32893,38534,22404,25314,38471,27004,23044,25602,31699,28431,38475,33446,21346,39045,24208,28809,25523,21348,34383,40065,40595,30860,38706,36335,36162,40575,28510,31108,24405,38470,25134,39540,21525,38109,20387,26053,23653,23649,32533,34385,27695,24459,29575,28388,32511,23782,25371,23402,28390,21365,20081,25504,30053,25249,36718,20262,20177,27814,32438,35770,33821,34746,32599,36923,38179,31657,39585,35064,33853,27931,39558,32476,22920,40635,29595,30721,34434,39532,39554,22043,21527,22475,20080,40614,21334,36808,33033,30610,39314,34542,28385,34067,26364,24930,28459,32894,32897,32898,32901,32904,32906,32909,32910,32911,32912,32913,32914,32916,32917,32919,32921,32926,32931,32934,32935,32936,32940,32944,32947,32949,32950,32952,32953,32955,32965,32967,32968,32969,32970,32971,32975,32976,32977,32978,32979,32980,32981,32984,32991,32992,32994,32995,32998,33006,33013,33015,33017,33019,33022,33023,33024,33025,33027,33028,33029,33031,33032,33035,33036,33045,33047,33049,33051,33052,33053,33055,33056,33057,33058,33059,33060,33061,33062,33063,33064,33065,33066,33067,33069,33070,33072,33075,33076,33077,33079,33081,33082,33083,33084,33085,33087,35881,33426,33579,30450,27667,24537,33725,29483,33541,38170,27611,30683,38086,21359,33538,20882,24125,35980,36152,20040,29611,26522,26757,37238,38665,29028,27809,30473,23186,38209,27599,32654,26151,23504,22969,23194,38376,38391,20204,33804,33945,27308,30431,38192,29467,26790,23391,30511,37274,38753,31964,36855,35868,24357,31859,31192,35269,27852,34588,23494,24130,26825,30496,32501,20885,20813,21193,23081,32517,38754,33495,25551,30596,34256,31186,28218,24217,22937,34065,28781,27665,25279,30399,25935,24751,38397,26126,34719,40483,38125,21517,21629,35884,25720,33088,33089,33090,33091,33092,33093,33095,33097,33101,33102,33103,33106,33110,33111,33112,33115,33116,33117,33118,33119,33121,33122,33123,33124,33126,33128,33130,33131,33132,33135,33138,33139,33141,33142,33143,33144,33153,33155,33156,33157,33158,33159,33161,33163,33164,33165,33166,33168,33170,33171,33172,33173,33174,33175,33177,33178,33182,33183,33184,33185,33186,33188,33189,33191,33193,33195,33196,33197,33198,33199,33200,33201,33202,33204,33205,33206,33207,33208,33209,33212,33213,33214,33215,33220,33221,33223,33224,33225,33227,33229,33230,33231,33232,33233,33234,33235,25721,34321,27169,33180,30952,25705,39764,25273,26411,33707,22696,40664,27819,28448,23518,38476,35851,29279,26576,25287,29281,20137,22982,27597,22675,26286,24149,21215,24917,26408,30446,30566,29287,31302,25343,21738,21584,38048,37027,23068,32435,27670,20035,22902,32784,22856,21335,30007,38590,22218,25376,33041,24700,38393,28118,21602,39297,20869,23273,33021,22958,38675,20522,27877,23612,25311,20320,21311,33147,36870,28346,34091,25288,24180,30910,25781,25467,24565,23064,37247,40479,23615,25423,32834,23421,21870,38218,38221,28037,24744,26592,29406,20957,23425,33236,33237,33238,33239,33240,33241,33242,33243,33244,33245,33246,33247,33248,33249,33250,33252,33253,33254,33256,33257,33259,33262,33263,33264,33265,33266,33269,33270,33271,33272,33273,33274,33277,33279,33283,33287,33288,33289,33290,33291,33294,33295,33297,33299,33301,33302,33303,33304,33305,33306,33309,33312,33316,33317,33318,33319,33321,33326,33330,33338,33340,33341,33343,33344,33345,33346,33347,33349,33350,33352,33354,33356,33357,33358,33360,33361,33362,33363,33364,33365,33366,33367,33369,33371,33372,33373,33374,33376,33377,33378,33379,33380,33381,33382,33383,33385,25319,27870,29275,25197,38062,32445,33043,27987,20892,24324,22900,21162,24594,22899,26262,34384,30111,25386,25062,31983,35834,21734,27431,40485,27572,34261,21589,20598,27812,21866,36276,29228,24085,24597,29750,25293,25490,29260,24472,28227,27966,25856,28504,30424,30928,30460,30036,21028,21467,20051,24222,26049,32810,32982,25243,21638,21032,28846,34957,36305,27873,21624,32986,22521,35060,36180,38506,37197,20329,27803,21943,30406,30768,25256,28921,28558,24429,34028,26842,30844,31735,33192,26379,40527,25447,30896,22383,30738,38713,25209,25259,21128,29749,27607,33386,33387,33388,33389,33393,33397,33398,33399,33400,33403,33404,33408,33409,33411,33413,33414,33415,33417,33420,33424,33427,33428,33429,33430,33434,33435,33438,33440,33442,33443,33447,33458,33461,33462,33466,33467,33468,33471,33472,33474,33475,33477,33478,33481,33488,33494,33497,33498,33501,33506,33511,33512,33513,33514,33516,33517,33518,33520,33522,33523,33525,33526,33528,33530,33532,33533,33534,33535,33536,33546,33547,33549,33552,33554,33555,33558,33560,33561,33565,33566,33567,33568,33569,33570,33571,33572,33573,33574,33577,33578,33582,33584,33586,33591,33595,33597,21860,33086,30130,30382,21305,30174,20731,23617,35692,31687,20559,29255,39575,39128,28418,29922,31080,25735,30629,25340,39057,36139,21697,32856,20050,22378,33529,33805,24179,20973,29942,35780,23631,22369,27900,39047,23110,30772,39748,36843,31893,21078,25169,38138,20166,33670,33889,33769,33970,22484,26420,22275,26222,28006,35889,26333,28689,26399,27450,26646,25114,22971,19971,20932,28422,26578,27791,20854,26827,22855,27495,30054,23822,33040,40784,26071,31048,31041,39569,36215,23682,20062,20225,21551,22865,30732,22120,27668,36804,24323,27773,27875,35755,25488,33598,33599,33601,33602,33604,33605,33608,33610,33611,33612,33613,33614,33619,33621,33622,33623,33624,33625,33629,33634,33648,33649,33650,33651,33652,33653,33654,33657,33658,33662,33663,33664,33665,33666,33667,33668,33671,33672,33674,33675,33676,33677,33679,33680,33681,33684,33685,33686,33687,33689,33690,33693,33695,33697,33698,33699,33700,33701,33702,33703,33708,33709,33710,33711,33717,33723,33726,33727,33730,33731,33732,33734,33736,33737,33739,33741,33742,33744,33745,33746,33747,33749,33751,33753,33754,33755,33758,33762,33763,33764,33766,33767,33768,33771,33772,33773,24688,27965,29301,25190,38030,38085,21315,36801,31614,20191,35878,20094,40660,38065,38067,21069,28508,36963,27973,35892,22545,23884,27424,27465,26538,21595,33108,32652,22681,34103,24378,25250,27207,38201,25970,24708,26725,30631,20052,20392,24039,38808,25772,32728,23789,20431,31373,20999,33540,19988,24623,31363,38054,20405,20146,31206,29748,21220,33465,25810,31165,23517,27777,38738,36731,27682,20542,21375,28165,25806,26228,27696,24773,39031,35831,24198,29756,31351,31179,19992,37041,29699,27714,22234,37195,27845,36235,21306,34502,26354,36527,23624,39537,28192,33774,33775,33779,33780,33781,33782,33783,33786,33787,33788,33790,33791,33792,33794,33797,33799,33800,33801,33802,33808,33810,33811,33812,33813,33814,33815,33817,33818,33819,33822,33823,33824,33825,33826,33827,33833,33834,33835,33836,33837,33838,33839,33840,33842,33843,33844,33845,33846,33847,33849,33850,33851,33854,33855,33856,33857,33858,33859,33860,33861,33863,33864,33865,33866,33867,33868,33869,33870,33871,33872,33874,33875,33876,33877,33878,33880,33885,33886,33887,33888,33890,33892,33893,33894,33895,33896,33898,33902,33903,33904,33906,33908,33911,33913,33915,33916,21462,23094,40843,36259,21435,22280,39079,26435,37275,27849,20840,30154,25331,29356,21048,21149,32570,28820,30264,21364,40522,27063,30830,38592,35033,32676,28982,29123,20873,26579,29924,22756,25880,22199,35753,39286,25200,32469,24825,28909,22764,20161,20154,24525,38887,20219,35748,20995,22922,32427,25172,20173,26085,25102,33592,33993,33635,34701,29076,28342,23481,32466,20887,25545,26580,32905,33593,34837,20754,23418,22914,36785,20083,27741,20837,35109,36719,38446,34122,29790,38160,38384,28070,33509,24369,25746,27922,33832,33134,40131,22622,36187,19977,21441,33917,33918,33919,33920,33921,33923,33924,33925,33926,33930,33933,33935,33936,33937,33938,33939,33940,33941,33942,33944,33946,33947,33949,33950,33951,33952,33954,33955,33956,33957,33958,33959,33960,33961,33962,33963,33964,33965,33966,33968,33969,33971,33973,33974,33975,33979,33980,33982,33984,33986,33987,33989,33990,33991,33992,33995,33996,33998,33999,34002,34004,34005,34007,34008,34009,34010,34011,34012,34014,34017,34018,34020,34023,34024,34025,34026,34027,34029,34030,34031,34033,34034,34035,34036,34037,34038,34039,34040,34041,34042,34043,34045,34046,34048,34049,34050,20254,25955,26705,21971,20007,25620,39578,25195,23234,29791,33394,28073,26862,20711,33678,30722,26432,21049,27801,32433,20667,21861,29022,31579,26194,29642,33515,26441,23665,21024,29053,34923,38378,38485,25797,36193,33203,21892,27733,25159,32558,22674,20260,21830,36175,26188,19978,23578,35059,26786,25422,31245,28903,33421,21242,38902,23569,21736,37045,32461,22882,36170,34503,33292,33293,36198,25668,23556,24913,28041,31038,35774,30775,30003,21627,20280,36523,28145,23072,32453,31070,27784,23457,23158,29978,32958,24910,28183,22768,29983,29989,29298,21319,32499,34051,34052,34053,34054,34055,34056,34057,34058,34059,34061,34062,34063,34064,34066,34068,34069,34070,34072,34073,34075,34076,34077,34078,34080,34082,34083,34084,34085,34086,34087,34088,34089,34090,34093,34094,34095,34096,34097,34098,34099,34100,34101,34102,34110,34111,34112,34113,34114,34116,34117,34118,34119,34123,34124,34125,34126,34127,34128,34129,34130,34131,34132,34133,34135,34136,34138,34139,34140,34141,34143,34144,34145,34146,34147,34149,34150,34151,34153,34154,34155,34156,34157,34158,34159,34160,34161,34163,34165,34166,34167,34168,34172,34173,34175,34176,34177,30465,30427,21097,32988,22307,24072,22833,29422,26045,28287,35799,23608,34417,21313,30707,25342,26102,20160,39135,34432,23454,35782,21490,30690,20351,23630,39542,22987,24335,31034,22763,19990,26623,20107,25325,35475,36893,21183,26159,21980,22124,36866,20181,20365,37322,39280,27663,24066,24643,23460,35270,35797,25910,25163,39318,23432,23551,25480,21806,21463,30246,20861,34092,26530,26803,27530,25234,36755,21460,33298,28113,30095,20070,36174,23408,29087,34223,26257,26329,32626,34560,40653,40736,23646,26415,36848,26641,26463,25101,31446,22661,24246,25968,28465,34178,34179,34182,34184,34185,34186,34187,34188,34189,34190,34192,34193,34194,34195,34196,34197,34198,34199,34200,34201,34202,34205,34206,34207,34208,34209,34210,34211,34213,34214,34215,34217,34219,34220,34221,34225,34226,34227,34228,34229,34230,34232,34234,34235,34236,34237,34238,34239,34240,34242,34243,34244,34245,34246,34247,34248,34250,34251,34252,34253,34254,34257,34258,34260,34262,34263,34264,34265,34266,34267,34269,34270,34271,34272,34273,34274,34275,34277,34278,34279,34280,34282,34283,34284,34285,34286,34287,34288,34289,34290,34291,34292,34293,34294,34295,34296,24661,21047,32781,25684,34928,29993,24069,26643,25332,38684,21452,29245,35841,27700,30561,31246,21550,30636,39034,33308,35828,30805,26388,28865,26031,25749,22070,24605,31169,21496,19997,27515,32902,23546,21987,22235,20282,20284,39282,24051,26494,32824,24578,39042,36865,23435,35772,35829,25628,33368,25822,22013,33487,37221,20439,32032,36895,31903,20723,22609,28335,23487,35785,32899,37240,33948,31639,34429,38539,38543,32485,39635,30862,23681,31319,36930,38567,31071,23385,25439,31499,34001,26797,21766,32553,29712,32034,38145,25152,22604,20182,23427,22905,22612,34297,34298,34300,34301,34302,34304,34305,34306,34307,34308,34310,34311,34312,34313,34314,34315,34316,34317,34318,34319,34320,34322,34323,34324,34325,34327,34328,34329,34330,34331,34332,34333,34334,34335,34336,34337,34338,34339,34340,34341,34342,34344,34346,34347,34348,34349,34350,34351,34352,34353,34354,34355,34356,34357,34358,34359,34361,34362,34363,34365,34366,34367,34368,34369,34370,34371,34372,34373,34374,34375,34376,34377,34378,34379,34380,34386,34387,34389,34390,34391,34392,34393,34395,34396,34397,34399,34400,34401,34403,34404,34405,34406,34407,34408,34409,34410,29549,25374,36427,36367,32974,33492,25260,21488,27888,37214,22826,24577,27760,22349,25674,36138,30251,28393,22363,27264,30192,28525,35885,35848,22374,27631,34962,30899,25506,21497,28845,27748,22616,25642,22530,26848,33179,21776,31958,20504,36538,28108,36255,28907,25487,28059,28372,32486,33796,26691,36867,28120,38518,35752,22871,29305,34276,33150,30140,35466,26799,21076,36386,38161,25552,39064,36420,21884,20307,26367,22159,24789,28053,21059,23625,22825,28155,22635,30000,29980,24684,33300,33094,25361,26465,36834,30522,36339,36148,38081,24086,21381,21548,28867,34413,34415,34416,34418,34419,34420,34421,34422,34423,34424,34435,34436,34437,34438,34439,34440,34441,34446,34447,34448,34449,34450,34452,34454,34455,34456,34457,34458,34459,34462,34463,34464,34465,34466,34469,34470,34475,34477,34478,34482,34483,34487,34488,34489,34491,34492,34493,34494,34495,34497,34498,34499,34501,34504,34508,34509,34514,34515,34517,34518,34519,34522,34524,34525,34528,34529,34530,34531,34533,34534,34535,34536,34538,34539,34540,34543,34549,34550,34551,34554,34555,34556,34557,34559,34561,34564,34565,34566,34571,34572,34574,34575,34576,34577,34580,34582,27712,24311,20572,20141,24237,25402,33351,36890,26704,37230,30643,21516,38108,24420,31461,26742,25413,31570,32479,30171,20599,25237,22836,36879,20984,31171,31361,22270,24466,36884,28034,23648,22303,21520,20820,28237,22242,25512,39059,33151,34581,35114,36864,21534,23663,33216,25302,25176,33073,40501,38464,39534,39548,26925,22949,25299,21822,25366,21703,34521,27964,23043,29926,34972,27498,22806,35916,24367,28286,29609,39037,20024,28919,23436,30871,25405,26202,30358,24779,23451,23113,19975,33109,27754,29579,20129,26505,32593,24448,26106,26395,24536,22916,23041,34585,34587,34589,34591,34592,34596,34598,34599,34600,34602,34603,34604,34605,34607,34608,34610,34611,34613,34614,34616,34617,34618,34620,34621,34624,34625,34626,34627,34628,34629,34630,34634,34635,34637,34639,34640,34641,34642,34644,34645,34646,34648,34650,34651,34652,34653,34654,34655,34657,34658,34662,34663,34664,34665,34666,34667,34668,34669,34671,34673,34674,34675,34677,34679,34680,34681,34682,34687,34688,34689,34692,34694,34695,34697,34698,34700,34702,34703,34704,34705,34706,34708,34709,34710,34712,34713,34714,34715,34716,34717,34718,34720,34721,34722,34723,34724,24013,24494,21361,38886,36829,26693,22260,21807,24799,20026,28493,32500,33479,33806,22996,20255,20266,23614,32428,26410,34074,21619,30031,32963,21890,39759,20301,28205,35859,23561,24944,21355,30239,28201,34442,25991,38395,32441,21563,31283,32010,38382,21985,32705,29934,25373,34583,28065,31389,25105,26017,21351,25569,27779,24043,21596,38056,20044,27745,35820,23627,26080,33436,26791,21566,21556,27595,27494,20116,25410,21320,33310,20237,20398,22366,25098,38654,26212,29289,21247,21153,24735,35823,26132,29081,26512,35199,30802,30717,26224,22075,21560,38177,29306,34725,34726,34727,34729,34730,34734,34736,34737,34738,34740,34742,34743,34744,34745,34747,34748,34750,34751,34753,34754,34755,34756,34757,34759,34760,34761,34764,34765,34766,34767,34768,34772,34773,34774,34775,34776,34777,34778,34780,34781,34782,34783,34785,34786,34787,34788,34790,34791,34792,34793,34795,34796,34797,34799,34800,34801,34802,34803,34804,34805,34806,34807,34808,34810,34811,34812,34813,34815,34816,34817,34818,34820,34821,34822,34823,34824,34825,34827,34828,34829,34830,34831,34832,34833,34834,34836,34839,34840,34841,34842,34844,34845,34846,34847,34848,34851,31232,24687,24076,24713,33181,22805,24796,29060,28911,28330,27728,29312,27268,34989,24109,20064,23219,21916,38115,27927,31995,38553,25103,32454,30606,34430,21283,38686,36758,26247,23777,20384,29421,19979,21414,22799,21523,25472,38184,20808,20185,40092,32420,21688,36132,34900,33335,38386,28046,24358,23244,26174,38505,29616,29486,21439,33146,39301,32673,23466,38519,38480,32447,30456,21410,38262,39321,31665,35140,28248,20065,32724,31077,35814,24819,21709,20139,39033,24055,27233,20687,21521,35937,33831,30813,38660,21066,21742,22179,38144,28040,23477,28102,26195,34852,34853,34854,34855,34856,34857,34858,34859,34860,34861,34862,34863,34864,34865,34867,34868,34869,34870,34871,34872,34874,34875,34877,34878,34879,34881,34882,34883,34886,34887,34888,34889,34890,34891,34894,34895,34896,34897,34898,34899,34901,34902,34904,34906,34907,34908,34909,34910,34911,34912,34918,34919,34922,34925,34927,34929,34931,34932,34933,34934,34936,34937,34938,34939,34940,34944,34947,34950,34951,34953,34954,34956,34958,34959,34960,34961,34963,34964,34965,34967,34968,34969,34970,34971,34973,34974,34975,34976,34977,34979,34981,34982,34983,34984,34985,34986,23567,23389,26657,32918,21880,31505,25928,26964,20123,27463,34638,38795,21327,25375,25658,37034,26012,32961,35856,20889,26800,21368,34809,25032,27844,27899,35874,23633,34218,33455,38156,27427,36763,26032,24571,24515,20449,34885,26143,33125,29481,24826,20852,21009,22411,24418,37026,34892,37266,24184,26447,24615,22995,20804,20982,33016,21256,27769,38596,29066,20241,20462,32670,26429,21957,38152,31168,34966,32483,22687,25100,38656,34394,22040,39035,24464,35768,33988,37207,21465,26093,24207,30044,24676,32110,23167,32490,32493,36713,21927,23459,24748,26059,29572,34988,34990,34991,34992,34994,34995,34996,34997,34998,35000,35001,35002,35003,35005,35006,35007,35008,35011,35012,35015,35016,35018,35019,35020,35021,35023,35024,35025,35027,35030,35031,35034,35035,35036,35037,35038,35040,35041,35046,35047,35049,35050,35051,35052,35053,35054,35055,35058,35061,35062,35063,35066,35067,35069,35071,35072,35073,35075,35076,35077,35078,35079,35080,35081,35083,35084,35085,35086,35087,35089,35092,35093,35094,35095,35096,35100,35101,35102,35103,35104,35106,35107,35108,35110,35111,35112,35113,35116,35117,35118,35119,35121,35122,35123,35125,35127,36873,30307,30505,32474,38772,34203,23398,31348,38634,34880,21195,29071,24490,26092,35810,23547,39535,24033,27529,27739,35757,35759,36874,36805,21387,25276,40486,40493,21568,20011,33469,29273,34460,23830,34905,28079,38597,21713,20122,35766,28937,21693,38409,28895,28153,30416,20005,30740,34578,23721,24310,35328,39068,38414,28814,27839,22852,25513,30524,34893,28436,33395,22576,29141,21388,30746,38593,21761,24422,28976,23476,35866,39564,27523,22830,40495,31207,26472,25196,20335,30113,32650,27915,38451,27687,20208,30162,20859,26679,28478,36992,33136,22934,29814,35128,35129,35130,35131,35132,35133,35134,35135,35136,35138,35139,35141,35142,35143,35144,35145,35146,35147,35148,35149,35150,35151,35152,35153,35154,35155,35156,35157,35158,35159,35160,35161,35162,35163,35164,35165,35168,35169,35170,35171,35172,35173,35175,35176,35177,35178,35179,35180,35181,35182,35183,35184,35185,35186,35187,35188,35189,35190,35191,35192,35193,35194,35196,35197,35198,35200,35202,35204,35205,35207,35208,35209,35210,35211,35212,35213,35214,35215,35216,35217,35218,35219,35220,35221,35222,35223,35224,35225,35226,35227,35228,35229,35230,35231,35232,35233,25671,23591,36965,31377,35875,23002,21676,33280,33647,35201,32768,26928,22094,32822,29239,37326,20918,20063,39029,25494,19994,21494,26355,33099,22812,28082,19968,22777,21307,25558,38129,20381,20234,34915,39056,22839,36951,31227,20202,33008,30097,27778,23452,23016,24413,26885,34433,20506,24050,20057,30691,20197,33402,25233,26131,37009,23673,20159,24441,33222,36920,32900,30123,20134,35028,24847,27589,24518,20041,30410,28322,35811,35758,35850,35793,24322,32764,32716,32462,33589,33643,22240,27575,38899,38452,23035,21535,38134,28139,23493,39278,23609,24341,38544,35234,35235,35236,35237,35238,35239,35240,35241,35242,35243,35244,35245,35246,35247,35248,35249,35250,35251,35252,35253,35254,35255,35256,35257,35258,35259,35260,35261,35262,35263,35264,35267,35277,35283,35284,35285,35287,35288,35289,35291,35293,35295,35296,35297,35298,35300,35303,35304,35305,35306,35308,35309,35310,35312,35313,35314,35316,35317,35318,35319,35320,35321,35322,35323,35324,35325,35326,35327,35329,35330,35331,35332,35333,35334,35336,35337,35338,35339,35340,35341,35342,35343,35344,35345,35346,35347,35348,35349,35350,35351,35352,35353,35354,35355,35356,35357,21360,33521,27185,23156,40560,24212,32552,33721,33828,33829,33639,34631,36814,36194,30408,24433,39062,30828,26144,21727,25317,20323,33219,30152,24248,38605,36362,34553,21647,27891,28044,27704,24703,21191,29992,24189,20248,24736,24551,23588,30001,37038,38080,29369,27833,28216,37193,26377,21451,21491,20305,37321,35825,21448,24188,36802,28132,20110,30402,27014,34398,24858,33286,20313,20446,36926,40060,24841,28189,28180,38533,20104,23089,38632,19982,23679,31161,23431,35821,32701,29577,22495,33419,37057,21505,36935,21947,23786,24481,24840,27442,29425,32946,35465,35358,35359,35360,35361,35362,35363,35364,35365,35366,35367,35368,35369,35370,35371,35372,35373,35374,35375,35376,35377,35378,35379,35380,35381,35382,35383,35384,35385,35386,35387,35388,35389,35391,35392,35393,35394,35395,35396,35397,35398,35399,35401,35402,35403,35404,35405,35406,35407,35408,35409,35410,35411,35412,35413,35414,35415,35416,35417,35418,35419,35420,35421,35422,35423,35424,35425,35426,35427,35428,35429,35430,35431,35432,35433,35434,35435,35436,35437,35438,35439,35440,35441,35442,35443,35444,35445,35446,35447,35448,35450,35451,35452,35453,35454,35455,35456,28020,23507,35029,39044,35947,39533,40499,28170,20900,20803,22435,34945,21407,25588,36757,22253,21592,22278,29503,28304,32536,36828,33489,24895,24616,38498,26352,32422,36234,36291,38053,23731,31908,26376,24742,38405,32792,20113,37095,21248,38504,20801,36816,34164,37213,26197,38901,23381,21277,30776,26434,26685,21705,28798,23472,36733,20877,22312,21681,25874,26242,36190,36163,33039,33900,36973,31967,20991,34299,26531,26089,28577,34468,36481,22122,36896,30338,28790,29157,36131,25321,21017,27901,36156,24590,22686,24974,26366,36192,25166,21939,28195,26413,36711,35457,35458,35459,35460,35461,35462,35463,35464,35467,35468,35469,35470,35471,35472,35473,35474,35476,35477,35478,35479,35480,35481,35482,35483,35484,35485,35486,35487,35488,35489,35490,35491,35492,35493,35494,35495,35496,35497,35498,35499,35500,35501,35502,35503,35504,35505,35506,35507,35508,35509,35510,35511,35512,35513,35514,35515,35516,35517,35518,35519,35520,35521,35522,35523,35524,35525,35526,35527,35528,35529,35530,35531,35532,35533,35534,35535,35536,35537,35538,35539,35540,35541,35542,35543,35544,35545,35546,35547,35548,35549,35550,35551,35552,35553,35554,35555,38113,38392,30504,26629,27048,21643,20045,28856,35784,25688,25995,23429,31364,20538,23528,30651,27617,35449,31896,27838,30415,26025,36759,23853,23637,34360,26632,21344,25112,31449,28251,32509,27167,31456,24432,28467,24352,25484,28072,26454,19976,24080,36134,20183,32960,30260,38556,25307,26157,25214,27836,36213,29031,32617,20806,32903,21484,36974,25240,21746,34544,36761,32773,38167,34071,36825,27993,29645,26015,30495,29956,30759,33275,36126,38024,20390,26517,30137,35786,38663,25391,38215,38453,33976,25379,30529,24449,29424,20105,24596,25972,25327,27491,25919,35556,35557,35558,35559,35560,35561,35562,35563,35564,35565,35566,35567,35568,35569,35570,35571,35572,35573,35574,35575,35576,35577,35578,35579,35580,35581,35582,35583,35584,35585,35586,35587,35588,35589,35590,35592,35593,35594,35595,35596,35597,35598,35599,35600,35601,35602,35603,35604,35605,35606,35607,35608,35609,35610,35611,35612,35613,35614,35615,35616,35617,35618,35619,35620,35621,35623,35624,35625,35626,35627,35628,35629,35630,35631,35632,35633,35634,35635,35636,35637,35638,35639,35640,35641,35642,35643,35644,35645,35646,35647,35648,35649,35650,35651,35652,35653,24103,30151,37073,35777,33437,26525,25903,21553,34584,30693,32930,33026,27713,20043,32455,32844,30452,26893,27542,25191,20540,20356,22336,25351,27490,36286,21482,26088,32440,24535,25370,25527,33267,33268,32622,24092,23769,21046,26234,31209,31258,36136,28825,30164,28382,27835,31378,20013,30405,24544,38047,34935,32456,31181,32959,37325,20210,20247,33311,21608,24030,27954,35788,31909,36724,32920,24090,21650,30385,23449,26172,39588,29664,26666,34523,26417,29482,35832,35803,36880,31481,28891,29038,25284,30633,22065,20027,33879,26609,21161,34496,36142,38136,31569,35654,35655,35656,35657,35658,35659,35660,35661,35662,35663,35664,35665,35666,35667,35668,35669,35670,35671,35672,35673,35674,35675,35676,35677,35678,35679,35680,35681,35682,35683,35684,35685,35687,35688,35689,35690,35691,35693,35694,35695,35696,35697,35698,35699,35700,35701,35702,35703,35704,35705,35706,35707,35708,35709,35710,35711,35712,35713,35714,35715,35716,35717,35718,35719,35720,35721,35722,35723,35724,35725,35726,35727,35728,35729,35730,35731,35732,35733,35734,35735,35736,35737,35738,35739,35740,35741,35742,35743,35756,35761,35771,35783,35792,35818,35849,35870,20303,27880,31069,39547,25235,29226,25341,19987,30742,36716,25776,36186,31686,26729,24196,35013,22918,25758,22766,29366,26894,38181,36861,36184,22368,32512,35846,20934,25417,25305,21331,26700,29730,33537,37196,21828,30528,28796,27978,20857,21672,36164,23039,28363,28100,23388,32043,20180,31869,28371,23376,33258,28173,23383,39683,26837,36394,23447,32508,24635,32437,37049,36208,22863,25549,31199,36275,21330,26063,31062,35781,38459,32452,38075,32386,22068,37257,26368,32618,23562,36981,26152,24038,20304,26590,20570,20316,22352,24231,59408,59409,59410,59411,59412,35896,35897,35898,35899,35900,35901,35902,35903,35904,35906,35907,35908,35909,35912,35914,35915,35917,35918,35919,35920,35921,35922,35923,35924,35926,35927,35928,35929,35931,35932,35933,35934,35935,35936,35939,35940,35941,35942,35943,35944,35945,35948,35949,35950,35951,35952,35953,35954,35956,35957,35958,35959,35963,35964,35965,35966,35967,35968,35969,35971,35972,35974,35975,35976,35979,35981,35982,35983,35984,35985,35986,35987,35989,35990,35991,35993,35994,35995,35996,35997,35998,35999,36000,36001,36002,36003,36004,36005,36006,36007,36008,36009,36010,36011,36012,36013,20109,19980,20800,19984,24319,21317,19989,20120,19998,39730,23404,22121,20008,31162,20031,21269,20039,22829,29243,21358,27664,22239,32996,39319,27603,30590,40727,20022,20127,40720,20060,20073,20115,33416,23387,21868,22031,20164,21389,21405,21411,21413,21422,38757,36189,21274,21493,21286,21294,21310,36188,21350,21347,20994,21000,21006,21037,21043,21055,21056,21068,21086,21089,21084,33967,21117,21122,21121,21136,21139,20866,32596,20155,20163,20169,20162,20200,20193,20203,20190,20251,20211,20258,20324,20213,20261,20263,20233,20267,20318,20327,25912,20314,20317,36014,36015,36016,36017,36018,36019,36020,36021,36022,36023,36024,36025,36026,36027,36028,36029,36030,36031,36032,36033,36034,36035,36036,36037,36038,36039,36040,36041,36042,36043,36044,36045,36046,36047,36048,36049,36050,36051,36052,36053,36054,36055,36056,36057,36058,36059,36060,36061,36062,36063,36064,36065,36066,36067,36068,36069,36070,36071,36072,36073,36074,36075,36076,36077,36078,36079,36080,36081,36082,36083,36084,36085,36086,36087,36088,36089,36090,36091,36092,36093,36094,36095,36096,36097,36098,36099,36100,36101,36102,36103,36104,36105,36106,36107,36108,36109,20319,20311,20274,20285,20342,20340,20369,20361,20355,20367,20350,20347,20394,20348,20396,20372,20454,20456,20458,20421,20442,20451,20444,20433,20447,20472,20521,20556,20467,20524,20495,20526,20525,20478,20508,20492,20517,20520,20606,20547,20565,20552,20558,20588,20603,20645,20647,20649,20666,20694,20742,20717,20716,20710,20718,20743,20747,20189,27709,20312,20325,20430,40864,27718,31860,20846,24061,40649,39320,20865,22804,21241,21261,35335,21264,20971,22809,20821,20128,20822,20147,34926,34980,20149,33044,35026,31104,23348,34819,32696,20907,20913,20925,20924,36110,36111,36112,36113,36114,36115,36116,36117,36118,36119,36120,36121,36122,36123,36124,36128,36177,36178,36183,36191,36197,36200,36201,36202,36204,36206,36207,36209,36210,36216,36217,36218,36219,36220,36221,36222,36223,36224,36226,36227,36230,36231,36232,36233,36236,36237,36238,36239,36240,36242,36243,36245,36246,36247,36248,36249,36250,36251,36252,36253,36254,36256,36257,36258,36260,36261,36262,36263,36264,36265,36266,36267,36268,36269,36270,36271,36272,36274,36278,36279,36281,36283,36285,36288,36289,36290,36293,36295,36296,36297,36298,36301,36304,36306,36307,36308,20935,20886,20898,20901,35744,35750,35751,35754,35764,35765,35767,35778,35779,35787,35791,35790,35794,35795,35796,35798,35800,35801,35804,35807,35808,35812,35816,35817,35822,35824,35827,35830,35833,35836,35839,35840,35842,35844,35847,35852,35855,35857,35858,35860,35861,35862,35865,35867,35864,35869,35871,35872,35873,35877,35879,35882,35883,35886,35887,35890,35891,35893,35894,21353,21370,38429,38434,38433,38449,38442,38461,38460,38466,38473,38484,38495,38503,38508,38514,38516,38536,38541,38551,38576,37015,37019,37021,37017,37036,37025,37044,37043,37046,37050,36309,36312,36313,36316,36320,36321,36322,36325,36326,36327,36329,36333,36334,36336,36337,36338,36340,36342,36348,36350,36351,36352,36353,36354,36355,36356,36358,36359,36360,36363,36365,36366,36368,36369,36370,36371,36373,36374,36375,36376,36377,36378,36379,36380,36384,36385,36388,36389,36390,36391,36392,36395,36397,36400,36402,36403,36404,36406,36407,36408,36411,36412,36414,36415,36419,36421,36422,36428,36429,36430,36431,36432,36435,36436,36437,36438,36439,36440,36442,36443,36444,36445,36446,36447,36448,36449,36450,36451,36452,36453,36455,36456,36458,36459,36462,36465,37048,37040,37071,37061,37054,37072,37060,37063,37075,37094,37090,37084,37079,37083,37099,37103,37118,37124,37154,37150,37155,37169,37167,37177,37187,37190,21005,22850,21154,21164,21165,21182,21759,21200,21206,21232,21471,29166,30669,24308,20981,20988,39727,21430,24321,30042,24047,22348,22441,22433,22654,22716,22725,22737,22313,22316,22314,22323,22329,22318,22319,22364,22331,22338,22377,22405,22379,22406,22396,22395,22376,22381,22390,22387,22445,22436,22412,22450,22479,22439,22452,22419,22432,22485,22488,22490,22489,22482,22456,22516,22511,22520,22500,22493,36467,36469,36471,36472,36473,36474,36475,36477,36478,36480,36482,36483,36484,36486,36488,36489,36490,36491,36492,36493,36494,36497,36498,36499,36501,36502,36503,36504,36505,36506,36507,36509,36511,36512,36513,36514,36515,36516,36517,36518,36519,36520,36521,36522,36525,36526,36528,36529,36531,36532,36533,36534,36535,36536,36537,36539,36540,36541,36542,36543,36544,36545,36546,36547,36548,36549,36550,36551,36552,36553,36554,36555,36556,36557,36559,36560,36561,36562,36563,36564,36565,36566,36567,36568,36569,36570,36571,36572,36573,36574,36575,36576,36577,36578,36579,36580,22539,22541,22525,22509,22528,22558,22553,22596,22560,22629,22636,22657,22665,22682,22656,39336,40729,25087,33401,33405,33407,33423,33418,33448,33412,33422,33425,33431,33433,33451,33464,33470,33456,33480,33482,33507,33432,33463,33454,33483,33484,33473,33449,33460,33441,33450,33439,33476,33486,33444,33505,33545,33527,33508,33551,33543,33500,33524,33490,33496,33548,33531,33491,33553,33562,33542,33556,33557,33504,33493,33564,33617,33627,33628,33544,33682,33596,33588,33585,33691,33630,33583,33615,33607,33603,33631,33600,33559,33632,33581,33594,33587,33638,33637,36581,36582,36583,36584,36585,36586,36587,36588,36589,36590,36591,36592,36593,36594,36595,36596,36597,36598,36599,36600,36601,36602,36603,36604,36605,36606,36607,36608,36609,36610,36611,36612,36613,36614,36615,36616,36617,36618,36619,36620,36621,36622,36623,36624,36625,36626,36627,36628,36629,36630,36631,36632,36633,36634,36635,36636,36637,36638,36639,36640,36641,36642,36643,36644,36645,36646,36647,36648,36649,36650,36651,36652,36653,36654,36655,36656,36657,36658,36659,36660,36661,36662,36663,36664,36665,36666,36667,36668,36669,36670,36671,36672,36673,36674,36675,36676,33640,33563,33641,33644,33642,33645,33646,33712,33656,33715,33716,33696,33706,33683,33692,33669,33660,33718,33705,33661,33720,33659,33688,33694,33704,33722,33724,33729,33793,33765,33752,22535,33816,33803,33757,33789,33750,33820,33848,33809,33798,33748,33759,33807,33795,33784,33785,33770,33733,33728,33830,33776,33761,33884,33873,33882,33881,33907,33927,33928,33914,33929,33912,33852,33862,33897,33910,33932,33934,33841,33901,33985,33997,34000,34022,33981,34003,33994,33983,33978,34016,33953,33977,33972,33943,34021,34019,34060,29965,34104,34032,34105,34079,34106,36677,36678,36679,36680,36681,36682,36683,36684,36685,36686,36687,36688,36689,36690,36691,36692,36693,36694,36695,36696,36697,36698,36699,36700,36701,36702,36703,36704,36705,36706,36707,36708,36709,36714,36736,36748,36754,36765,36768,36769,36770,36772,36773,36774,36775,36778,36780,36781,36782,36783,36786,36787,36788,36789,36791,36792,36794,36795,36796,36799,36800,36803,36806,36809,36810,36811,36812,36813,36815,36818,36822,36823,36826,36832,36833,36835,36839,36844,36847,36849,36850,36852,36853,36854,36858,36859,36860,36862,36863,36871,36872,36876,36878,36883,36885,36888,34134,34107,34047,34044,34137,34120,34152,34148,34142,34170,30626,34115,34162,34171,34212,34216,34183,34191,34169,34222,34204,34181,34233,34231,34224,34259,34241,34268,34303,34343,34309,34345,34326,34364,24318,24328,22844,22849,32823,22869,22874,22872,21263,23586,23589,23596,23604,25164,25194,25247,25275,25290,25306,25303,25326,25378,25334,25401,25419,25411,25517,25590,25457,25466,25486,25524,25453,25516,25482,25449,25518,25532,25586,25592,25568,25599,25540,25566,25550,25682,25542,25534,25669,25665,25611,25627,25632,25612,25638,25633,25694,25732,25709,25750,36889,36892,36899,36900,36901,36903,36904,36905,36906,36907,36908,36912,36913,36914,36915,36916,36919,36921,36922,36925,36927,36928,36931,36933,36934,36936,36937,36938,36939,36940,36942,36948,36949,36950,36953,36954,36956,36957,36958,36959,36960,36961,36964,36966,36967,36969,36970,36971,36972,36975,36976,36977,36978,36979,36982,36983,36984,36985,36986,36987,36988,36990,36993,36996,36997,36998,36999,37001,37002,37004,37005,37006,37007,37008,37010,37012,37014,37016,37018,37020,37022,37023,37024,37028,37029,37031,37032,37033,37035,37037,37042,37047,37052,37053,37055,37056,25722,25783,25784,25753,25786,25792,25808,25815,25828,25826,25865,25893,25902,24331,24530,29977,24337,21343,21489,21501,21481,21480,21499,21522,21526,21510,21579,21586,21587,21588,21590,21571,21537,21591,21593,21539,21554,21634,21652,21623,21617,21604,21658,21659,21636,21622,21606,21661,21712,21677,21698,21684,21714,21671,21670,21715,21716,21618,21667,21717,21691,21695,21708,21721,21722,21724,21673,21674,21668,21725,21711,21726,21787,21735,21792,21757,21780,21747,21794,21795,21775,21777,21799,21802,21863,21903,21941,21833,21869,21825,21845,21823,21840,21820,37058,37059,37062,37064,37065,37067,37068,37069,37074,37076,37077,37078,37080,37081,37082,37086,37087,37088,37091,37092,37093,37097,37098,37100,37102,37104,37105,37106,37107,37109,37110,37111,37113,37114,37115,37116,37119,37120,37121,37123,37125,37126,37127,37128,37129,37130,37131,37132,37133,37134,37135,37136,37137,37138,37139,37140,37141,37142,37143,37144,37146,37147,37148,37149,37151,37152,37153,37156,37157,37158,37159,37160,37161,37162,37163,37164,37165,37166,37168,37170,37171,37172,37173,37174,37175,37176,37178,37179,37180,37181,37182,37183,37184,37185,37186,37188,21815,21846,21877,21878,21879,21811,21808,21852,21899,21970,21891,21937,21945,21896,21889,21919,21886,21974,21905,21883,21983,21949,21950,21908,21913,21994,22007,21961,22047,21969,21995,21996,21972,21990,21981,21956,21999,21989,22002,22003,21964,21965,21992,22005,21988,36756,22046,22024,22028,22017,22052,22051,22014,22016,22055,22061,22104,22073,22103,22060,22093,22114,22105,22108,22092,22100,22150,22116,22129,22123,22139,22140,22149,22163,22191,22228,22231,22237,22241,22261,22251,22265,22271,22276,22282,22281,22300,24079,24089,24084,24081,24113,24123,24124,37189,37191,37192,37201,37203,37204,37205,37206,37208,37209,37211,37212,37215,37216,37222,37223,37224,37227,37229,37235,37242,37243,37244,37248,37249,37250,37251,37252,37254,37256,37258,37262,37263,37267,37268,37269,37270,37271,37272,37273,37276,37277,37278,37279,37280,37281,37284,37285,37286,37287,37288,37289,37291,37292,37296,37297,37298,37299,37302,37303,37304,37305,37307,37308,37309,37310,37311,37312,37313,37314,37315,37316,37317,37318,37320,37323,37328,37330,37331,37332,37333,37334,37335,37336,37337,37338,37339,37341,37342,37343,37344,37345,37346,37347,37348,37349,24119,24132,24148,24155,24158,24161,23692,23674,23693,23696,23702,23688,23704,23705,23697,23706,23708,23733,23714,23741,23724,23723,23729,23715,23745,23735,23748,23762,23780,23755,23781,23810,23811,23847,23846,23854,23844,23838,23814,23835,23896,23870,23860,23869,23916,23899,23919,23901,23915,23883,23882,23913,23924,23938,23961,23965,35955,23991,24005,24435,24439,24450,24455,24457,24460,24469,24473,24476,24488,24493,24501,24508,34914,24417,29357,29360,29364,29367,29368,29379,29377,29390,29389,29394,29416,29423,29417,29426,29428,29431,29441,29427,29443,29434,37350,37351,37352,37353,37354,37355,37356,37357,37358,37359,37360,37361,37362,37363,37364,37365,37366,37367,37368,37369,37370,37371,37372,37373,37374,37375,37376,37377,37378,37379,37380,37381,37382,37383,37384,37385,37386,37387,37388,37389,37390,37391,37392,37393,37394,37395,37396,37397,37398,37399,37400,37401,37402,37403,37404,37405,37406,37407,37408,37409,37410,37411,37412,37413,37414,37415,37416,37417,37418,37419,37420,37421,37422,37423,37424,37425,37426,37427,37428,37429,37430,37431,37432,37433,37434,37435,37436,37437,37438,37439,37440,37441,37442,37443,37444,37445,29435,29463,29459,29473,29450,29470,29469,29461,29474,29497,29477,29484,29496,29489,29520,29517,29527,29536,29548,29551,29566,33307,22821,39143,22820,22786,39267,39271,39272,39273,39274,39275,39276,39284,39287,39293,39296,39300,39303,39306,39309,39312,39313,39315,39316,39317,24192,24209,24203,24214,24229,24224,24249,24245,24254,24243,36179,24274,24273,24283,24296,24298,33210,24516,24521,24534,24527,24579,24558,24580,24545,24548,24574,24581,24582,24554,24557,24568,24601,24629,24614,24603,24591,24589,24617,24619,24586,24639,24609,24696,24697,24699,24698,24642,37446,37447,37448,37449,37450,37451,37452,37453,37454,37455,37456,37457,37458,37459,37460,37461,37462,37463,37464,37465,37466,37467,37468,37469,37470,37471,37472,37473,37474,37475,37476,37477,37478,37479,37480,37481,37482,37483,37484,37485,37486,37487,37488,37489,37490,37491,37493,37494,37495,37496,37497,37498,37499,37500,37501,37502,37503,37504,37505,37506,37507,37508,37509,37510,37511,37512,37513,37514,37515,37516,37517,37519,37520,37521,37522,37523,37524,37525,37526,37527,37528,37529,37530,37531,37532,37533,37534,37535,37536,37537,37538,37539,37540,37541,37542,37543,24682,24701,24726,24730,24749,24733,24707,24722,24716,24731,24812,24763,24753,24797,24792,24774,24794,24756,24864,24870,24853,24867,24820,24832,24846,24875,24906,24949,25004,24980,24999,25015,25044,25077,24541,38579,38377,38379,38385,38387,38389,38390,38396,38398,38403,38404,38406,38408,38410,38411,38412,38413,38415,38418,38421,38422,38423,38425,38426,20012,29247,25109,27701,27732,27740,27722,27811,27781,27792,27796,27788,27752,27753,27764,27766,27782,27817,27856,27860,27821,27895,27896,27889,27863,27826,27872,27862,27898,27883,27886,27825,27859,27887,27902,37544,37545,37546,37547,37548,37549,37551,37552,37553,37554,37555,37556,37557,37558,37559,37560,37561,37562,37563,37564,37565,37566,37567,37568,37569,37570,37571,37572,37573,37574,37575,37577,37578,37579,37580,37581,37582,37583,37584,37585,37586,37587,37588,37589,37590,37591,37592,37593,37594,37595,37596,37597,37598,37599,37600,37601,37602,37603,37604,37605,37606,37607,37608,37609,37610,37611,37612,37613,37614,37615,37616,37617,37618,37619,37620,37621,37622,37623,37624,37625,37626,37627,37628,37629,37630,37631,37632,37633,37634,37635,37636,37637,37638,37639,37640,37641,27961,27943,27916,27971,27976,27911,27908,27929,27918,27947,27981,27950,27957,27930,27983,27986,27988,27955,28049,28015,28062,28064,27998,28051,28052,27996,28000,28028,28003,28186,28103,28101,28126,28174,28095,28128,28177,28134,28125,28121,28182,28075,28172,28078,28203,28270,28238,28267,28338,28255,28294,28243,28244,28210,28197,28228,28383,28337,28312,28384,28461,28386,28325,28327,28349,28347,28343,28375,28340,28367,28303,28354,28319,28514,28486,28487,28452,28437,28409,28463,28470,28491,28532,28458,28425,28457,28553,28557,28556,28536,28530,28540,28538,28625,37642,37643,37644,37645,37646,37647,37648,37649,37650,37651,37652,37653,37654,37655,37656,37657,37658,37659,37660,37661,37662,37663,37664,37665,37666,37667,37668,37669,37670,37671,37672,37673,37674,37675,37676,37677,37678,37679,37680,37681,37682,37683,37684,37685,37686,37687,37688,37689,37690,37691,37692,37693,37695,37696,37697,37698,37699,37700,37701,37702,37703,37704,37705,37706,37707,37708,37709,37710,37711,37712,37713,37714,37715,37716,37717,37718,37719,37720,37721,37722,37723,37724,37725,37726,37727,37728,37729,37730,37731,37732,37733,37734,37735,37736,37737,37739,28617,28583,28601,28598,28610,28641,28654,28638,28640,28655,28698,28707,28699,28729,28725,28751,28766,23424,23428,23445,23443,23461,23480,29999,39582,25652,23524,23534,35120,23536,36423,35591,36790,36819,36821,36837,36846,36836,36841,36838,36851,36840,36869,36868,36875,36902,36881,36877,36886,36897,36917,36918,36909,36911,36932,36945,36946,36944,36968,36952,36962,36955,26297,36980,36989,36994,37000,36995,37003,24400,24407,24406,24408,23611,21675,23632,23641,23409,23651,23654,32700,24362,24361,24365,33396,24380,39739,23662,22913,22915,22925,22953,22954,22947,37740,37741,37742,37743,37744,37745,37746,37747,37748,37749,37750,37751,37752,37753,37754,37755,37756,37757,37758,37759,37760,37761,37762,37763,37764,37765,37766,37767,37768,37769,37770,37771,37772,37773,37774,37776,37777,37778,37779,37780,37781,37782,37783,37784,37785,37786,37787,37788,37789,37790,37791,37792,37793,37794,37795,37796,37797,37798,37799,37800,37801,37802,37803,37804,37805,37806,37807,37808,37809,37810,37811,37812,37813,37814,37815,37816,37817,37818,37819,37820,37821,37822,37823,37824,37825,37826,37827,37828,37829,37830,37831,37832,37833,37835,37836,37837,22935,22986,22955,22942,22948,22994,22962,22959,22999,22974,23045,23046,23005,23048,23011,23000,23033,23052,23049,23090,23092,23057,23075,23059,23104,23143,23114,23125,23100,23138,23157,33004,23210,23195,23159,23162,23230,23275,23218,23250,23252,23224,23264,23267,23281,23254,23270,23256,23260,23305,23319,23318,23346,23351,23360,23573,23580,23386,23397,23411,23377,23379,23394,39541,39543,39544,39546,39551,39549,39552,39553,39557,39560,39562,39568,39570,39571,39574,39576,39579,39580,39581,39583,39584,39586,39587,39589,39591,32415,32417,32419,32421,32424,32425,37838,37839,37840,37841,37842,37843,37844,37845,37847,37848,37849,37850,37851,37852,37853,37854,37855,37856,37857,37858,37859,37860,37861,37862,37863,37864,37865,37866,37867,37868,37869,37870,37871,37872,37873,37874,37875,37876,37877,37878,37879,37880,37881,37882,37883,37884,37885,37886,37887,37888,37889,37890,37891,37892,37893,37894,37895,37896,37897,37898,37899,37900,37901,37902,37903,37904,37905,37906,37907,37908,37909,37910,37911,37912,37913,37914,37915,37916,37917,37918,37919,37920,37921,37922,37923,37924,37925,37926,37927,37928,37929,37930,37931,37932,37933,37934,32429,32432,32446,32448,32449,32450,32457,32459,32460,32464,32468,32471,32475,32480,32481,32488,32491,32494,32495,32497,32498,32525,32502,32506,32507,32510,32513,32514,32515,32519,32520,32523,32524,32527,32529,32530,32535,32537,32540,32539,32543,32545,32546,32547,32548,32549,32550,32551,32554,32555,32556,32557,32559,32560,32561,32562,32563,32565,24186,30079,24027,30014,37013,29582,29585,29614,29602,29599,29647,29634,29649,29623,29619,29632,29641,29640,29669,29657,39036,29706,29673,29671,29662,29626,29682,29711,29738,29787,29734,29733,29736,29744,29742,29740,37935,37936,37937,37938,37939,37940,37941,37942,37943,37944,37945,37946,37947,37948,37949,37951,37952,37953,37954,37955,37956,37957,37958,37959,37960,37961,37962,37963,37964,37965,37966,37967,37968,37969,37970,37971,37972,37973,37974,37975,37976,37977,37978,37979,37980,37981,37982,37983,37984,37985,37986,37987,37988,37989,37990,37991,37992,37993,37994,37996,37997,37998,37999,38000,38001,38002,38003,38004,38005,38006,38007,38008,38009,38010,38011,38012,38013,38014,38015,38016,38017,38018,38019,38020,38033,38038,38040,38087,38095,38099,38100,38106,38118,38139,38172,38176,29723,29722,29761,29788,29783,29781,29785,29815,29805,29822,29852,29838,29824,29825,29831,29835,29854,29864,29865,29840,29863,29906,29882,38890,38891,38892,26444,26451,26462,26440,26473,26533,26503,26474,26483,26520,26535,26485,26536,26526,26541,26507,26487,26492,26608,26633,26584,26634,26601,26544,26636,26585,26549,26586,26547,26589,26624,26563,26552,26594,26638,26561,26621,26674,26675,26720,26721,26702,26722,26692,26724,26755,26653,26709,26726,26689,26727,26688,26686,26698,26697,26665,26805,26767,26740,26743,26771,26731,26818,26990,26876,26911,26912,26873,38183,38195,38205,38211,38216,38219,38229,38234,38240,38254,38260,38261,38263,38264,38265,38266,38267,38268,38269,38270,38272,38273,38274,38275,38276,38277,38278,38279,38280,38281,38282,38283,38284,38285,38286,38287,38288,38289,38290,38291,38292,38293,38294,38295,38296,38297,38298,38299,38300,38301,38302,38303,38304,38305,38306,38307,38308,38309,38310,38311,38312,38313,38314,38315,38316,38317,38318,38319,38320,38321,38322,38323,38324,38325,38326,38327,38328,38329,38330,38331,38332,38333,38334,38335,38336,38337,38338,38339,38340,38341,38342,38343,38344,38345,38346,38347,26916,26864,26891,26881,26967,26851,26896,26993,26937,26976,26946,26973,27012,26987,27008,27032,27000,26932,27084,27015,27016,27086,27017,26982,26979,27001,27035,27047,27067,27051,27053,27092,27057,27073,27082,27103,27029,27104,27021,27135,27183,27117,27159,27160,27237,27122,27204,27198,27296,27216,27227,27189,27278,27257,27197,27176,27224,27260,27281,27280,27305,27287,27307,29495,29522,27521,27522,27527,27524,27538,27539,27533,27546,27547,27553,27562,36715,36717,36721,36722,36723,36725,36726,36728,36727,36729,36730,36732,36734,36737,36738,36740,36743,36747,38348,38349,38350,38351,38352,38353,38354,38355,38356,38357,38358,38359,38360,38361,38362,38363,38364,38365,38366,38367,38368,38369,38370,38371,38372,38373,38374,38375,38380,38399,38407,38419,38424,38427,38430,38432,38435,38436,38437,38438,38439,38440,38441,38443,38444,38445,38447,38448,38455,38456,38457,38458,38462,38465,38467,38474,38478,38479,38481,38482,38483,38486,38487,38488,38489,38490,38492,38493,38494,38496,38499,38501,38502,38507,38509,38510,38511,38512,38513,38515,38520,38521,38522,38523,38524,38525,38526,38527,38528,38529,38530,38531,38532,38535,38537,38538,36749,36750,36751,36760,36762,36558,25099,25111,25115,25119,25122,25121,25125,25124,25132,33255,29935,29940,29951,29967,29969,29971,25908,26094,26095,26096,26122,26137,26482,26115,26133,26112,28805,26359,26141,26164,26161,26166,26165,32774,26207,26196,26177,26191,26198,26209,26199,26231,26244,26252,26279,26269,26302,26331,26332,26342,26345,36146,36147,36150,36155,36157,36160,36165,36166,36168,36169,36167,36173,36181,36185,35271,35274,35275,35276,35278,35279,35280,35281,29294,29343,29277,29286,29295,29310,29311,29316,29323,29325,29327,29330,25352,25394,25520,38540,38542,38545,38546,38547,38549,38550,38554,38555,38557,38558,38559,38560,38561,38562,38563,38564,38565,38566,38568,38569,38570,38571,38572,38573,38574,38575,38577,38578,38580,38581,38583,38584,38586,38587,38591,38594,38595,38600,38602,38603,38608,38609,38611,38612,38614,38615,38616,38617,38618,38619,38620,38621,38622,38623,38625,38626,38627,38628,38629,38630,38631,38635,38636,38637,38638,38640,38641,38642,38644,38645,38648,38650,38651,38652,38653,38655,38658,38659,38661,38666,38667,38668,38672,38673,38674,38676,38677,38679,38680,38681,38682,38683,38685,38687,38688,25663,25816,32772,27626,27635,27645,27637,27641,27653,27655,27654,27661,27669,27672,27673,27674,27681,27689,27684,27690,27698,25909,25941,25963,29261,29266,29270,29232,34402,21014,32927,32924,32915,32956,26378,32957,32945,32939,32941,32948,32951,32999,33000,33001,33002,32987,32962,32964,32985,32973,32983,26384,32989,33003,33009,33012,33005,33037,33038,33010,33020,26389,33042,35930,33078,33054,33068,33048,33074,33096,33100,33107,33140,33113,33114,33137,33120,33129,33148,33149,33133,33127,22605,23221,33160,33154,33169,28373,33187,33194,33228,26406,33226,33211,38689,38690,38691,38692,38693,38694,38695,38696,38697,38699,38700,38702,38703,38705,38707,38708,38709,38710,38711,38714,38715,38716,38717,38719,38720,38721,38722,38723,38724,38725,38726,38727,38728,38729,38730,38731,38732,38733,38734,38735,38736,38737,38740,38741,38743,38744,38746,38748,38749,38751,38755,38756,38758,38759,38760,38762,38763,38764,38765,38766,38767,38768,38769,38770,38773,38775,38776,38777,38778,38779,38781,38782,38783,38784,38785,38786,38787,38788,38790,38791,38792,38793,38794,38796,38798,38799,38800,38803,38805,38806,38807,38809,38810,38811,38812,38813,33217,33190,27428,27447,27449,27459,27462,27481,39121,39122,39123,39125,39129,39130,27571,24384,27586,35315,26000,40785,26003,26044,26054,26052,26051,26060,26062,26066,26070,28800,28828,28822,28829,28859,28864,28855,28843,28849,28904,28874,28944,28947,28950,28975,28977,29043,29020,29032,28997,29042,29002,29048,29050,29080,29107,29109,29096,29088,29152,29140,29159,29177,29213,29224,28780,28952,29030,29113,25150,25149,25155,25160,25161,31035,31040,31046,31049,31067,31068,31059,31066,31074,31063,31072,31087,31079,31098,31109,31114,31130,31143,31155,24529,24528,38814,38815,38817,38818,38820,38821,38822,38823,38824,38825,38826,38828,38830,38832,38833,38835,38837,38838,38839,38840,38841,38842,38843,38844,38845,38846,38847,38848,38849,38850,38851,38852,38853,38854,38855,38856,38857,38858,38859,38860,38861,38862,38863,38864,38865,38866,38867,38868,38869,38870,38871,38872,38873,38874,38875,38876,38877,38878,38879,38880,38881,38882,38883,38884,38885,38888,38894,38895,38896,38897,38898,38900,38903,38904,38905,38906,38907,38908,38909,38910,38911,38912,38913,38914,38915,38916,38917,38918,38919,38920,38921,38922,38923,38924,38925,38926,24636,24669,24666,24679,24641,24665,24675,24747,24838,24845,24925,25001,24989,25035,25041,25094,32896,32895,27795,27894,28156,30710,30712,30720,30729,30743,30744,30737,26027,30765,30748,30749,30777,30778,30779,30751,30780,30757,30764,30755,30761,30798,30829,30806,30807,30758,30800,30791,30796,30826,30875,30867,30874,30855,30876,30881,30883,30898,30905,30885,30932,30937,30921,30956,30962,30981,30964,30995,31012,31006,31028,40859,40697,40699,40700,30449,30468,30477,30457,30471,30472,30490,30498,30489,30509,30502,30517,30520,30544,30545,30535,30531,30554,30568,38927,38928,38929,38930,38931,38932,38933,38934,38935,38936,38937,38938,38939,38940,38941,38942,38943,38944,38945,38946,38947,38948,38949,38950,38951,38952,38953,38954,38955,38956,38957,38958,38959,38960,38961,38962,38963,38964,38965,38966,38967,38968,38969,38970,38971,38972,38973,38974,38975,38976,38977,38978,38979,38980,38981,38982,38983,38984,38985,38986,38987,38988,38989,38990,38991,38992,38993,38994,38995,38996,38997,38998,38999,39000,39001,39002,39003,39004,39005,39006,39007,39008,39009,39010,39011,39012,39013,39014,39015,39016,39017,39018,39019,39020,39021,39022,30562,30565,30591,30605,30589,30592,30604,30609,30623,30624,30640,30645,30653,30010,30016,30030,30027,30024,30043,30066,30073,30083,32600,32609,32607,35400,32616,32628,32625,32633,32641,32638,30413,30437,34866,38021,38022,38023,38027,38026,38028,38029,38031,38032,38036,38039,38037,38042,38043,38044,38051,38052,38059,38058,38061,38060,38063,38064,38066,38068,38070,38071,38072,38073,38074,38076,38077,38079,38084,38088,38089,38090,38091,38092,38093,38094,38096,38097,38098,38101,38102,38103,38105,38104,38107,38110,38111,38112,38114,38116,38117,38119,38120,38122,39023,39024,39025,39026,39027,39028,39051,39054,39058,39061,39065,39075,39080,39081,39082,39083,39084,39085,39086,39087,39088,39089,39090,39091,39092,39093,39094,39095,39096,39097,39098,39099,39100,39101,39102,39103,39104,39105,39106,39107,39108,39109,39110,39111,39112,39113,39114,39115,39116,39117,39119,39120,39124,39126,39127,39131,39132,39133,39136,39137,39138,39139,39140,39141,39142,39145,39146,39147,39148,39149,39150,39151,39152,39153,39154,39155,39156,39157,39158,39159,39160,39161,39162,39163,39164,39165,39166,39167,39168,39169,39170,39171,39172,39173,39174,39175,38121,38123,38126,38127,38131,38132,38133,38135,38137,38140,38141,38143,38147,38146,38150,38151,38153,38154,38157,38158,38159,38162,38163,38164,38165,38166,38168,38171,38173,38174,38175,38178,38186,38187,38185,38188,38193,38194,38196,38198,38199,38200,38204,38206,38207,38210,38197,38212,38213,38214,38217,38220,38222,38223,38226,38227,38228,38230,38231,38232,38233,38235,38238,38239,38237,38241,38242,38244,38245,38246,38247,38248,38249,38250,38251,38252,38255,38257,38258,38259,38202,30695,30700,38601,31189,31213,31203,31211,31238,23879,31235,31234,31262,31252,39176,39177,39178,39179,39180,39182,39183,39185,39186,39187,39188,39189,39190,39191,39192,39193,39194,39195,39196,39197,39198,39199,39200,39201,39202,39203,39204,39205,39206,39207,39208,39209,39210,39211,39212,39213,39215,39216,39217,39218,39219,39220,39221,39222,39223,39224,39225,39226,39227,39228,39229,39230,39231,39232,39233,39234,39235,39236,39237,39238,39239,39240,39241,39242,39243,39244,39245,39246,39247,39248,39249,39250,39251,39254,39255,39256,39257,39258,39259,39260,39261,39262,39263,39264,39265,39266,39268,39270,39283,39288,39289,39291,39294,39298,39299,39305,31289,31287,31313,40655,39333,31344,30344,30350,30355,30361,30372,29918,29920,29996,40480,40482,40488,40489,40490,40491,40492,40498,40497,40502,40504,40503,40505,40506,40510,40513,40514,40516,40518,40519,40520,40521,40523,40524,40526,40529,40533,40535,40538,40539,40540,40542,40547,40550,40551,40552,40553,40554,40555,40556,40561,40557,40563,30098,30100,30102,30112,30109,30124,30115,30131,30132,30136,30148,30129,30128,30147,30146,30166,30157,30179,30184,30182,30180,30187,30183,30211,30193,30204,30207,30224,30208,30213,30220,30231,30218,30245,30232,30229,30233,39308,39310,39322,39323,39324,39325,39326,39327,39328,39329,39330,39331,39332,39334,39335,39337,39338,39339,39340,39341,39342,39343,39344,39345,39346,39347,39348,39349,39350,39351,39352,39353,39354,39355,39356,39357,39358,39359,39360,39361,39362,39363,39364,39365,39366,39367,39368,39369,39370,39371,39372,39373,39374,39375,39376,39377,39378,39379,39380,39381,39382,39383,39384,39385,39386,39387,39388,39389,39390,39391,39392,39393,39394,39395,39396,39397,39398,39399,39400,39401,39402,39403,39404,39405,39406,39407,39408,39409,39410,39411,39412,39413,39414,39415,39416,39417,30235,30268,30242,30240,30272,30253,30256,30271,30261,30275,30270,30259,30285,30302,30292,30300,30294,30315,30319,32714,31462,31352,31353,31360,31366,31368,31381,31398,31392,31404,31400,31405,31411,34916,34921,34930,34941,34943,34946,34978,35014,34999,35004,35017,35042,35022,35043,35045,35057,35098,35068,35048,35070,35056,35105,35097,35091,35099,35082,35124,35115,35126,35137,35174,35195,30091,32997,30386,30388,30684,32786,32788,32790,32796,32800,32802,32805,32806,32807,32809,32808,32817,32779,32821,32835,32838,32845,32850,32873,32881,35203,39032,39040,39043,39418,39419,39420,39421,39422,39423,39424,39425,39426,39427,39428,39429,39430,39431,39432,39433,39434,39435,39436,39437,39438,39439,39440,39441,39442,39443,39444,39445,39446,39447,39448,39449,39450,39451,39452,39453,39454,39455,39456,39457,39458,39459,39460,39461,39462,39463,39464,39465,39466,39467,39468,39469,39470,39471,39472,39473,39474,39475,39476,39477,39478,39479,39480,39481,39482,39483,39484,39485,39486,39487,39488,39489,39490,39491,39492,39493,39494,39495,39496,39497,39498,39499,39500,39501,39502,39503,39504,39505,39506,39507,39508,39509,39510,39511,39512,39513,39049,39052,39053,39055,39060,39066,39067,39070,39071,39073,39074,39077,39078,34381,34388,34412,34414,34431,34426,34428,34427,34472,34445,34443,34476,34461,34471,34467,34474,34451,34473,34486,34500,34485,34510,34480,34490,34481,34479,34505,34511,34484,34537,34545,34546,34541,34547,34512,34579,34526,34548,34527,34520,34513,34563,34567,34552,34568,34570,34573,34569,34595,34619,34590,34597,34606,34586,34622,34632,34612,34609,34601,34615,34623,34690,34594,34685,34686,34683,34656,34672,34636,34670,34699,34643,34659,34684,34660,34649,34661,34707,34735,34728,34770,39514,39515,39516,39517,39518,39519,39520,39521,39522,39523,39524,39525,39526,39527,39528,39529,39530,39531,39538,39555,39561,39565,39566,39572,39573,39577,39590,39593,39594,39595,39596,39597,39598,39599,39602,39603,39604,39605,39609,39611,39613,39614,39615,39619,39620,39622,39623,39624,39625,39626,39629,39630,39631,39632,39634,39636,39637,39638,39639,39641,39642,39643,39644,39645,39646,39648,39650,39651,39652,39653,39655,39656,39657,39658,39660,39662,39664,39665,39666,39667,39668,39669,39670,39671,39672,39674,39676,39677,39678,39679,39680,39681,39682,39684,39685,39686,34758,34696,34693,34733,34711,34691,34731,34789,34732,34741,34739,34763,34771,34749,34769,34752,34762,34779,34794,34784,34798,34838,34835,34814,34826,34843,34849,34873,34876,32566,32578,32580,32581,33296,31482,31485,31496,31491,31492,31509,31498,31531,31503,31559,31544,31530,31513,31534,31537,31520,31525,31524,31539,31550,31518,31576,31578,31557,31605,31564,31581,31584,31598,31611,31586,31602,31601,31632,31654,31655,31672,31660,31645,31656,31621,31658,31644,31650,31659,31668,31697,31681,31692,31709,31706,31717,31718,31722,31756,31742,31740,31759,31766,31755,39687,39689,39690,39691,39692,39693,39694,39696,39697,39698,39700,39701,39702,39703,39704,39705,39706,39707,39708,39709,39710,39712,39713,39714,39716,39717,39718,39719,39720,39721,39722,39723,39724,39725,39726,39728,39729,39731,39732,39733,39734,39735,39736,39737,39738,39741,39742,39743,39744,39750,39754,39755,39756,39758,39760,39762,39763,39765,39766,39767,39768,39769,39770,39771,39772,39773,39774,39775,39776,39777,39778,39779,39780,39781,39782,39783,39784,39785,39786,39787,39788,39789,39790,39791,39792,39793,39794,39795,39796,39797,39798,39799,39800,39801,39802,39803,31775,31786,31782,31800,31809,31808,33278,33281,33282,33284,33260,34884,33313,33314,33315,33325,33327,33320,33323,33336,33339,33331,33332,33342,33348,33353,33355,33359,33370,33375,33384,34942,34949,34952,35032,35039,35166,32669,32671,32679,32687,32688,32690,31868,25929,31889,31901,31900,31902,31906,31922,31932,31933,31937,31943,31948,31949,31944,31941,31959,31976,33390,26280,32703,32718,32725,32741,32737,32742,32745,32750,32755,31992,32119,32166,32174,32327,32411,40632,40628,36211,36228,36244,36241,36273,36199,36205,35911,35913,37194,37200,37198,37199,37220,39804,39805,39806,39807,39808,39809,39810,39811,39812,39813,39814,39815,39816,39817,39818,39819,39820,39821,39822,39823,39824,39825,39826,39827,39828,39829,39830,39831,39832,39833,39834,39835,39836,39837,39838,39839,39840,39841,39842,39843,39844,39845,39846,39847,39848,39849,39850,39851,39852,39853,39854,39855,39856,39857,39858,39859,39860,39861,39862,39863,39864,39865,39866,39867,39868,39869,39870,39871,39872,39873,39874,39875,39876,39877,39878,39879,39880,39881,39882,39883,39884,39885,39886,39887,39888,39889,39890,39891,39892,39893,39894,39895,39896,39897,39898,39899,37218,37217,37232,37225,37231,37245,37246,37234,37236,37241,37260,37253,37264,37261,37265,37282,37283,37290,37293,37294,37295,37301,37300,37306,35925,40574,36280,36331,36357,36441,36457,36277,36287,36284,36282,36292,36310,36311,36314,36318,36302,36303,36315,36294,36332,36343,36344,36323,36345,36347,36324,36361,36349,36372,36381,36383,36396,36398,36387,36399,36410,36416,36409,36405,36413,36401,36425,36417,36418,36433,36434,36426,36464,36470,36476,36463,36468,36485,36495,36500,36496,36508,36510,35960,35970,35978,35973,35992,35988,26011,35286,35294,35290,35292,39900,39901,39902,39903,39904,39905,39906,39907,39908,39909,39910,39911,39912,39913,39914,39915,39916,39917,39918,39919,39920,39921,39922,39923,39924,39925,39926,39927,39928,39929,39930,39931,39932,39933,39934,39935,39936,39937,39938,39939,39940,39941,39942,39943,39944,39945,39946,39947,39948,39949,39950,39951,39952,39953,39954,39955,39956,39957,39958,39959,39960,39961,39962,39963,39964,39965,39966,39967,39968,39969,39970,39971,39972,39973,39974,39975,39976,39977,39978,39979,39980,39981,39982,39983,39984,39985,39986,39987,39988,39989,39990,39991,39992,39993,39994,39995,35301,35307,35311,35390,35622,38739,38633,38643,38639,38662,38657,38664,38671,38670,38698,38701,38704,38718,40832,40835,40837,40838,40839,40840,40841,40842,40844,40702,40715,40717,38585,38588,38589,38606,38610,30655,38624,37518,37550,37576,37694,37738,37834,37775,37950,37995,40063,40066,40069,40070,40071,40072,31267,40075,40078,40080,40081,40082,40084,40085,40090,40091,40094,40095,40096,40097,40098,40099,40101,40102,40103,40104,40105,40107,40109,40110,40112,40113,40114,40115,40116,40117,40118,40119,40122,40123,40124,40125,40132,40133,40134,40135,40138,40139,39996,39997,39998,39999,40000,40001,40002,40003,40004,40005,40006,40007,40008,40009,40010,40011,40012,40013,40014,40015,40016,40017,40018,40019,40020,40021,40022,40023,40024,40025,40026,40027,40028,40029,40030,40031,40032,40033,40034,40035,40036,40037,40038,40039,40040,40041,40042,40043,40044,40045,40046,40047,40048,40049,40050,40051,40052,40053,40054,40055,40056,40057,40058,40059,40061,40062,40064,40067,40068,40073,40074,40076,40079,40083,40086,40087,40088,40089,40093,40106,40108,40111,40121,40126,40127,40128,40129,40130,40136,40137,40145,40146,40154,40155,40160,40161,40140,40141,40142,40143,40144,40147,40148,40149,40151,40152,40153,40156,40157,40159,40162,38780,38789,38801,38802,38804,38831,38827,38819,38834,38836,39601,39600,39607,40536,39606,39610,39612,39617,39616,39621,39618,39627,39628,39633,39749,39747,39751,39753,39752,39757,39761,39144,39181,39214,39253,39252,39647,39649,39654,39663,39659,39675,39661,39673,39688,39695,39699,39711,39715,40637,40638,32315,40578,40583,40584,40587,40594,37846,40605,40607,40667,40668,40669,40672,40671,40674,40681,40679,40677,40682,40687,40738,40748,40751,40761,40759,40765,40766,40772,40163,40164,40165,40166,40167,40168,40169,40170,40171,40172,40173,40174,40175,40176,40177,40178,40179,40180,40181,40182,40183,40184,40185,40186,40187,40188,40189,40190,40191,40192,40193,40194,40195,40196,40197,40198,40199,40200,40201,40202,40203,40204,40205,40206,40207,40208,40209,40210,40211,40212,40213,40214,40215,40216,40217,40218,40219,40220,40221,40222,40223,40224,40225,40226,40227,40228,40229,40230,40231,40232,40233,40234,40235,40236,40237,40238,40239,40240,40241,40242,40243,40244,40245,40246,40247,40248,40249,40250,40251,40252,40253,40254,40255,40256,40257,40258,57908,57909,57910,57911,57912,57913,57914,57915,57916,57917,57918,57919,57920,57921,57922,57923,57924,57925,57926,57927,57928,57929,57930,57931,57932,57933,57934,57935,57936,57937,57938,57939,57940,57941,57942,57943,57944,57945,57946,57947,57948,57949,57950,57951,57952,57953,57954,57955,57956,57957,57958,57959,57960,57961,57962,57963,57964,57965,57966,57967,57968,57969,57970,57971,57972,57973,57974,57975,57976,57977,57978,57979,57980,57981,57982,57983,57984,57985,57986,57987,57988,57989,57990,57991,57992,57993,57994,57995,57996,57997,57998,57999,58000,58001,40259,40260,40261,40262,40263,40264,40265,40266,40267,40268,40269,40270,40271,40272,40273,40274,40275,40276,40277,40278,40279,40280,40281,40282,40283,40284,40285,40286,40287,40288,40289,40290,40291,40292,40293,40294,40295,40296,40297,40298,40299,40300,40301,40302,40303,40304,40305,40306,40307,40308,40309,40310,40311,40312,40313,40314,40315,40316,40317,40318,40319,40320,40321,40322,40323,40324,40325,40326,40327,40328,40329,40330,40331,40332,40333,40334,40335,40336,40337,40338,40339,40340,40341,40342,40343,40344,40345,40346,40347,40348,40349,40350,40351,40352,40353,40354,58002,58003,58004,58005,58006,58007,58008,58009,58010,58011,58012,58013,58014,58015,58016,58017,58018,58019,58020,58021,58022,58023,58024,58025,58026,58027,58028,58029,58030,58031,58032,58033,58034,58035,58036,58037,58038,58039,58040,58041,58042,58043,58044,58045,58046,58047,58048,58049,58050,58051,58052,58053,58054,58055,58056,58057,58058,58059,58060,58061,58062,58063,58064,58065,58066,58067,58068,58069,58070,58071,58072,58073,58074,58075,58076,58077,58078,58079,58080,58081,58082,58083,58084,58085,58086,58087,58088,58089,58090,58091,58092,58093,58094,58095,40355,40356,40357,40358,40359,40360,40361,40362,40363,40364,40365,40366,40367,40368,40369,40370,40371,40372,40373,40374,40375,40376,40377,40378,40379,40380,40381,40382,40383,40384,40385,40386,40387,40388,40389,40390,40391,40392,40393,40394,40395,40396,40397,40398,40399,40400,40401,40402,40403,40404,40405,40406,40407,40408,40409,40410,40411,40412,40413,40414,40415,40416,40417,40418,40419,40420,40421,40422,40423,40424,40425,40426,40427,40428,40429,40430,40431,40432,40433,40434,40435,40436,40437,40438,40439,40440,40441,40442,40443,40444,40445,40446,40447,40448,40449,40450,58096,58097,58098,58099,58100,58101,58102,58103,58104,58105,58106,58107,58108,58109,58110,58111,58112,58113,58114,58115,58116,58117,58118,58119,58120,58121,58122,58123,58124,58125,58126,58127,58128,58129,58130,58131,58132,58133,58134,58135,58136,58137,58138,58139,58140,58141,58142,58143,58144,58145,58146,58147,58148,58149,58150,58151,58152,58153,58154,58155,58156,58157,58158,58159,58160,58161,58162,58163,58164,58165,58166,58167,58168,58169,58170,58171,58172,58173,58174,58175,58176,58177,58178,58179,58180,58181,58182,58183,58184,58185,58186,58187,58188,58189,40451,40452,40453,40454,40455,40456,40457,40458,40459,40460,40461,40462,40463,40464,40465,40466,40467,40468,40469,40470,40471,40472,40473,40474,40475,40476,40477,40478,40484,40487,40494,40496,40500,40507,40508,40512,40525,40528,40530,40531,40532,40534,40537,40541,40543,40544,40545,40546,40549,40558,40559,40562,40564,40565,40566,40567,40568,40569,40570,40571,40572,40573,40576,40577,40579,40580,40581,40582,40585,40586,40588,40589,40590,40591,40592,40593,40596,40597,40598,40599,40600,40601,40602,40603,40604,40606,40608,40609,40610,40611,40612,40613,40615,40616,40617,40618,58190,58191,58192,58193,58194,58195,58196,58197,58198,58199,58200,58201,58202,58203,58204,58205,58206,58207,58208,58209,58210,58211,58212,58213,58214,58215,58216,58217,58218,58219,58220,58221,58222,58223,58224,58225,58226,58227,58228,58229,58230,58231,58232,58233,58234,58235,58236,58237,58238,58239,58240,58241,58242,58243,58244,58245,58246,58247,58248,58249,58250,58251,58252,58253,58254,58255,58256,58257,58258,58259,58260,58261,58262,58263,58264,58265,58266,58267,58268,58269,58270,58271,58272,58273,58274,58275,58276,58277,58278,58279,58280,58281,58282,58283,40619,40620,40621,40622,40623,40624,40625,40626,40627,40629,40630,40631,40633,40634,40636,40639,40640,40641,40642,40643,40645,40646,40647,40648,40650,40651,40652,40656,40658,40659,40661,40662,40663,40665,40666,40670,40673,40675,40676,40678,40680,40683,40684,40685,40686,40688,40689,40690,40691,40692,40693,40694,40695,40696,40698,40701,40703,40704,40705,40706,40707,40708,40709,40710,40711,40712,40713,40714,40716,40719,40721,40722,40724,40725,40726,40728,40730,40731,40732,40733,40734,40735,40737,40739,40740,40741,40742,40743,40744,40745,40746,40747,40749,40750,40752,40753,58284,58285,58286,58287,58288,58289,58290,58291,58292,58293,58294,58295,58296,58297,58298,58299,58300,58301,58302,58303,58304,58305,58306,58307,58308,58309,58310,58311,58312,58313,58314,58315,58316,58317,58318,58319,58320,58321,58322,58323,58324,58325,58326,58327,58328,58329,58330,58331,58332,58333,58334,58335,58336,58337,58338,58339,58340,58341,58342,58343,58344,58345,58346,58347,58348,58349,58350,58351,58352,58353,58354,58355,58356,58357,58358,58359,58360,58361,58362,58363,58364,58365,58366,58367,58368,58369,58370,58371,58372,58373,58374,58375,58376,58377,40754,40755,40756,40757,40758,40760,40762,40764,40767,40768,40769,40770,40771,40773,40774,40775,40776,40777,40778,40779,40780,40781,40782,40783,40786,40787,40788,40789,40790,40791,40792,40793,40794,40795,40796,40797,40798,40799,40800,40801,40802,40803,40804,40805,40806,40807,40808,40809,40810,40811,40812,40813,40814,40815,40816,40817,40818,40819,40820,40821,40822,40823,40824,40825,40826,40827,40828,40829,40830,40833,40834,40845,40846,40847,40848,40849,40850,40851,40852,40853,40854,40855,40856,40860,40861,40862,40865,40866,40867,40868,40869,63788,63865,63893,63975,63985,58378,58379,58380,58381,58382,58383,58384,58385,58386,58387,58388,58389,58390,58391,58392,58393,58394,58395,58396,58397,58398,58399,58400,58401,58402,58403,58404,58405,58406,58407,58408,58409,58410,58411,58412,58413,58414,58415,58416,58417,58418,58419,58420,58421,58422,58423,58424,58425,58426,58427,58428,58429,58430,58431,58432,58433,58434,58435,58436,58437,58438,58439,58440,58441,58442,58443,58444,58445,58446,58447,58448,58449,58450,58451,58452,58453,58454,58455,58456,58457,58458,58459,58460,58461,58462,58463,58464,58465,58466,58467,58468,58469,58470,58471,64012,64013,64014,64015,64017,64019,64020,64024,64031,64032,64033,64035,64036,64039,64040,64041,11905,59414,59415,59416,11908,13427,13383,11912,11915,59422,13726,13850,13838,11916,11927,14702,14616,59430,14799,14815,14963,14800,59435,59436,15182,15470,15584,11943,59441,59442,11946,16470,16735,11950,17207,11955,11958,11959,59451,17329,17324,11963,17373,17622,18017,17996,59459,18211,18217,18300,18317,11978,18759,18810,18813,18818,18819,18821,18822,18847,18843,18871,18870,59476,59477,19619,19615,19616,19617,19575,19618,19731,19732,19733,19734,19735,19736,19737,19886,59492,58472,58473,58474,58475,58476,58477,58478,58479,58480,58481,58482,58483,58484,58485,58486,58487,58488,58489,58490,58491,58492,58493,58494,58495,58496,58497,58498,58499,58500,58501,58502,58503,58504,58505,58506,58507,58508,58509,58510,58511,58512,58513,58514,58515,58516,58517,58518,58519,58520,58521,58522,58523,58524,58525,58526,58527,58528,58529,58530,58531,58532,58533,58534,58535,58536,58537,58538,58539,58540,58541,58542,58543,58544,58545,58546,58547,58548,58549,58550,58551,58552,58553,58554,58555,58556,58557,58558,58559,58560,58561,58562,58563,58564,58565], - 'gb18030-ranges': [[0,128],[36,165],[38,169],[45,178],[50,184],[81,216],[89,226],[95,235],[96,238],[100,244],[103,248],[104,251],[105,253],[109,258],[126,276],[133,284],[148,300],[172,325],[175,329],[179,334],[208,364],[306,463],[307,465],[308,467],[309,469],[310,471],[311,473],[312,475],[313,477],[341,506],[428,594],[443,610],[544,712],[545,716],[558,730],[741,930],[742,938],[749,962],[750,970],[805,1026],[819,1104],[820,1106],[7922,8209],[7924,8215],[7925,8218],[7927,8222],[7934,8231],[7943,8241],[7944,8244],[7945,8246],[7950,8252],[8062,8365],[8148,8452],[8149,8454],[8152,8458],[8164,8471],[8174,8482],[8236,8556],[8240,8570],[8262,8596],[8264,8602],[8374,8713],[8380,8720],[8381,8722],[8384,8726],[8388,8731],[8390,8737],[8392,8740],[8393,8742],[8394,8748],[8396,8751],[8401,8760],[8406,8766],[8416,8777],[8419,8781],[8424,8787],[8437,8802],[8439,8808],[8445,8816],[8482,8854],[8485,8858],[8496,8870],[8521,8896],[8603,8979],[8936,9322],[8946,9372],[9046,9548],[9050,9588],[9063,9616],[9066,9622],[9076,9634],[9092,9652],[9100,9662],[9108,9672],[9111,9676],[9113,9680],[9131,9702],[9162,9735],[9164,9738],[9218,9793],[9219,9795],[11329,11906],[11331,11909],[11334,11913],[11336,11917],[11346,11928],[11361,11944],[11363,11947],[11366,11951],[11370,11956],[11372,11960],[11375,11964],[11389,11979],[11682,12284],[11686,12292],[11687,12312],[11692,12319],[11694,12330],[11714,12351],[11716,12436],[11723,12447],[11725,12535],[11730,12543],[11736,12586],[11982,12842],[11989,12850],[12102,12964],[12336,13200],[12348,13215],[12350,13218],[12384,13253],[12393,13263],[12395,13267],[12397,13270],[12510,13384],[12553,13428],[12851,13727],[12962,13839],[12973,13851],[13738,14617],[13823,14703],[13919,14801],[13933,14816],[14080,14964],[14298,15183],[14585,15471],[14698,15585],[15583,16471],[15847,16736],[16318,17208],[16434,17325],[16438,17330],[16481,17374],[16729,17623],[17102,17997],[17122,18018],[17315,18212],[17320,18218],[17402,18301],[17418,18318],[17859,18760],[17909,18811],[17911,18814],[17915,18820],[17916,18823],[17936,18844],[17939,18848],[17961,18872],[18664,19576],[18703,19620],[18814,19738],[18962,19887],[19043,40870],[33469,59244],[33470,59336],[33471,59367],[33484,59413],[33485,59417],[33490,59423],[33497,59431],[33501,59437],[33505,59443],[33513,59452],[33520,59460],[33536,59478],[33550,59493],[37845,63789],[37921,63866],[37948,63894],[38029,63976],[38038,63986],[38064,64016],[38065,64018],[38066,64021],[38069,64025],[38075,64034],[38076,64037],[38078,64042],[39108,65074],[39109,65093],[39113,65107],[39114,65112],[39115,65127],[39116,65132],[39265,65375],[39394,65510],[189000,65536]], - 'jis0208': [12288,12289,12290,65292,65294,12539,65306,65307,65311,65281,12443,12444,180,65344,168,65342,65507,65343,12541,12542,12445,12446,12291,20189,12293,12294,12295,12540,8213,8208,65295,65340,65374,8741,65372,8230,8229,8216,8217,8220,8221,65288,65289,12308,12309,65339,65341,65371,65373,12296,12297,12298,12299,12300,12301,12302,12303,12304,12305,65291,65293,177,215,247,65309,8800,65308,65310,8806,8807,8734,8756,9794,9792,176,8242,8243,8451,65509,65284,65504,65505,65285,65283,65286,65290,65312,167,9734,9733,9675,9679,9678,9671,9670,9633,9632,9651,9650,9661,9660,8251,12306,8594,8592,8593,8595,12307,null,null,null,null,null,null,null,null,null,null,null,8712,8715,8838,8839,8834,8835,8746,8745,null,null,null,null,null,null,null,null,8743,8744,65506,8658,8660,8704,8707,null,null,null,null,null,null,null,null,null,null,null,8736,8869,8978,8706,8711,8801,8786,8810,8811,8730,8765,8733,8757,8747,8748,null,null,null,null,null,null,null,8491,8240,9839,9837,9834,8224,8225,182,null,null,null,null,9711,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,65296,65297,65298,65299,65300,65301,65302,65303,65304,65305,null,null,null,null,null,null,null,65313,65314,65315,65316,65317,65318,65319,65320,65321,65322,65323,65324,65325,65326,65327,65328,65329,65330,65331,65332,65333,65334,65335,65336,65337,65338,null,null,null,null,null,null,65345,65346,65347,65348,65349,65350,65351,65352,65353,65354,65355,65356,65357,65358,65359,65360,65361,65362,65363,65364,65365,65366,65367,65368,65369,65370,null,null,null,null,12353,12354,12355,12356,12357,12358,12359,12360,12361,12362,12363,12364,12365,12366,12367,12368,12369,12370,12371,12372,12373,12374,12375,12376,12377,12378,12379,12380,12381,12382,12383,12384,12385,12386,12387,12388,12389,12390,12391,12392,12393,12394,12395,12396,12397,12398,12399,12400,12401,12402,12403,12404,12405,12406,12407,12408,12409,12410,12411,12412,12413,12414,12415,12416,12417,12418,12419,12420,12421,12422,12423,12424,12425,12426,12427,12428,12429,12430,12431,12432,12433,12434,12435,null,null,null,null,null,null,null,null,null,null,null,12449,12450,12451,12452,12453,12454,12455,12456,12457,12458,12459,12460,12461,12462,12463,12464,12465,12466,12467,12468,12469,12470,12471,12472,12473,12474,12475,12476,12477,12478,12479,12480,12481,12482,12483,12484,12485,12486,12487,12488,12489,12490,12491,12492,12493,12494,12495,12496,12497,12498,12499,12500,12501,12502,12503,12504,12505,12506,12507,12508,12509,12510,12511,12512,12513,12514,12515,12516,12517,12518,12519,12520,12521,12522,12523,12524,12525,12526,12527,12528,12529,12530,12531,12532,12533,12534,null,null,null,null,null,null,null,null,913,914,915,916,917,918,919,920,921,922,923,924,925,926,927,928,929,931,932,933,934,935,936,937,null,null,null,null,null,null,null,null,945,946,947,948,949,950,951,952,953,954,955,956,957,958,959,960,961,963,964,965,966,967,968,969,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,1040,1041,1042,1043,1044,1045,1025,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,1072,1073,1074,1075,1076,1077,1105,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,1103,null,null,null,null,null,null,null,null,null,null,null,null,null,9472,9474,9484,9488,9496,9492,9500,9516,9508,9524,9532,9473,9475,9487,9491,9499,9495,9507,9523,9515,9531,9547,9504,9519,9512,9527,9535,9501,9520,9509,9528,9538,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,9312,9313,9314,9315,9316,9317,9318,9319,9320,9321,9322,9323,9324,9325,9326,9327,9328,9329,9330,9331,8544,8545,8546,8547,8548,8549,8550,8551,8552,8553,null,13129,13076,13090,13133,13080,13095,13059,13110,13137,13143,13069,13094,13091,13099,13130,13115,13212,13213,13214,13198,13199,13252,13217,null,null,null,null,null,null,null,null,13179,12317,12319,8470,13261,8481,12964,12965,12966,12967,12968,12849,12850,12857,13182,13181,13180,8786,8801,8747,8750,8721,8730,8869,8736,8735,8895,8757,8745,8746,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,20124,21782,23043,38463,21696,24859,25384,23030,36898,33909,33564,31312,24746,25569,28197,26093,33894,33446,39925,26771,22311,26017,25201,23451,22992,34427,39156,32098,32190,39822,25110,31903,34999,23433,24245,25353,26263,26696,38343,38797,26447,20197,20234,20301,20381,20553,22258,22839,22996,23041,23561,24799,24847,24944,26131,26885,28858,30031,30064,31227,32173,32239,32963,33806,34915,35586,36949,36986,21307,20117,20133,22495,32946,37057,30959,19968,22769,28322,36920,31282,33576,33419,39983,20801,21360,21693,21729,22240,23035,24341,39154,28139,32996,34093,38498,38512,38560,38907,21515,21491,23431,28879,32701,36802,38632,21359,40284,31418,19985,30867,33276,28198,22040,21764,27421,34074,39995,23013,21417,28006,29916,38287,22082,20113,36939,38642,33615,39180,21473,21942,23344,24433,26144,26355,26628,27704,27891,27945,29787,30408,31310,38964,33521,34907,35424,37613,28082,30123,30410,39365,24742,35585,36234,38322,27022,21421,20870,22290,22576,22852,23476,24310,24616,25513,25588,27839,28436,28814,28948,29017,29141,29503,32257,33398,33489,34199,36960,37467,40219,22633,26044,27738,29989,20985,22830,22885,24448,24540,25276,26106,27178,27431,27572,29579,32705,35158,40236,40206,40644,23713,27798,33659,20740,23627,25014,33222,26742,29281,20057,20474,21368,24681,28201,31311,38899,19979,21270,20206,20309,20285,20385,20339,21152,21487,22025,22799,23233,23478,23521,31185,26247,26524,26550,27468,27827,28779,29634,31117,31166,31292,31623,33457,33499,33540,33655,33775,33747,34662,35506,22057,36008,36838,36942,38686,34442,20420,23784,25105,29273,30011,33253,33469,34558,36032,38597,39187,39381,20171,20250,35299,22238,22602,22730,24315,24555,24618,24724,24674,25040,25106,25296,25913,39745,26214,26800,28023,28784,30028,30342,32117,33445,34809,38283,38542,35997,20977,21182,22806,21683,23475,23830,24936,27010,28079,30861,33995,34903,35442,37799,39608,28012,39336,34521,22435,26623,34510,37390,21123,22151,21508,24275,25313,25785,26684,26680,27579,29554,30906,31339,35226,35282,36203,36611,37101,38307,38548,38761,23398,23731,27005,38989,38990,25499,31520,27179,27263,26806,39949,28511,21106,21917,24688,25324,27963,28167,28369,33883,35088,36676,19988,39993,21494,26907,27194,38788,26666,20828,31427,33970,37340,37772,22107,40232,26658,33541,33841,31909,21000,33477,29926,20094,20355,20896,23506,21002,21208,21223,24059,21914,22570,23014,23436,23448,23515,24178,24185,24739,24863,24931,25022,25563,25954,26577,26707,26874,27454,27475,27735,28450,28567,28485,29872,29976,30435,30475,31487,31649,31777,32233,32566,32752,32925,33382,33694,35251,35532,36011,36996,37969,38291,38289,38306,38501,38867,39208,33304,20024,21547,23736,24012,29609,30284,30524,23721,32747,36107,38593,38929,38996,39000,20225,20238,21361,21916,22120,22522,22855,23305,23492,23696,24076,24190,24524,25582,26426,26071,26082,26399,26827,26820,27231,24112,27589,27671,27773,30079,31048,23395,31232,32000,24509,35215,35352,36020,36215,36556,36637,39138,39438,39740,20096,20605,20736,22931,23452,25135,25216,25836,27450,29344,30097,31047,32681,34811,35516,35696,25516,33738,38816,21513,21507,21931,26708,27224,35440,30759,26485,40653,21364,23458,33050,34384,36870,19992,20037,20167,20241,21450,21560,23470,24339,24613,25937,26429,27714,27762,27875,28792,29699,31350,31406,31496,32026,31998,32102,26087,29275,21435,23621,24040,25298,25312,25369,28192,34394,35377,36317,37624,28417,31142,39770,20136,20139,20140,20379,20384,20689,20807,31478,20849,20982,21332,21281,21375,21483,21932,22659,23777,24375,24394,24623,24656,24685,25375,25945,27211,27841,29378,29421,30703,33016,33029,33288,34126,37111,37857,38911,39255,39514,20208,20957,23597,26241,26989,23616,26354,26997,29577,26704,31873,20677,21220,22343,24062,37670,26020,27427,27453,29748,31105,31165,31563,32202,33465,33740,34943,35167,35641,36817,37329,21535,37504,20061,20534,21477,21306,29399,29590,30697,33510,36527,39366,39368,39378,20855,24858,34398,21936,31354,20598,23507,36935,38533,20018,27355,37351,23633,23624,25496,31391,27795,38772,36705,31402,29066,38536,31874,26647,32368,26705,37740,21234,21531,34219,35347,32676,36557,37089,21350,34952,31041,20418,20670,21009,20804,21843,22317,29674,22411,22865,24418,24452,24693,24950,24935,25001,25522,25658,25964,26223,26690,28179,30054,31293,31995,32076,32153,32331,32619,33550,33610,34509,35336,35427,35686,36605,38938,40335,33464,36814,39912,21127,25119,25731,28608,38553,26689,20625,27424,27770,28500,31348,32080,34880,35363,26376,20214,20537,20518,20581,20860,21048,21091,21927,22287,22533,23244,24314,25010,25080,25331,25458,26908,27177,29309,29356,29486,30740,30831,32121,30476,32937,35211,35609,36066,36562,36963,37749,38522,38997,39443,40568,20803,21407,21427,24187,24358,28187,28304,29572,29694,32067,33335,35328,35578,38480,20046,20491,21476,21628,22266,22993,23396,24049,24235,24359,25144,25925,26543,28246,29392,31946,34996,32929,32993,33776,34382,35463,36328,37431,38599,39015,40723,20116,20114,20237,21320,21577,21566,23087,24460,24481,24735,26791,27278,29786,30849,35486,35492,35703,37264,20062,39881,20132,20348,20399,20505,20502,20809,20844,21151,21177,21246,21402,21475,21521,21518,21897,22353,22434,22909,23380,23389,23439,24037,24039,24055,24184,24195,24218,24247,24344,24658,24908,25239,25304,25511,25915,26114,26179,26356,26477,26657,26775,27083,27743,27946,28009,28207,28317,30002,30343,30828,31295,31968,32005,32024,32094,32177,32789,32771,32943,32945,33108,33167,33322,33618,34892,34913,35611,36002,36092,37066,37237,37489,30783,37628,38308,38477,38917,39321,39640,40251,21083,21163,21495,21512,22741,25335,28640,35946,36703,40633,20811,21051,21578,22269,31296,37239,40288,40658,29508,28425,33136,29969,24573,24794,39592,29403,36796,27492,38915,20170,22256,22372,22718,23130,24680,25031,26127,26118,26681,26801,28151,30165,32058,33390,39746,20123,20304,21449,21766,23919,24038,24046,26619,27801,29811,30722,35408,37782,35039,22352,24231,25387,20661,20652,20877,26368,21705,22622,22971,23472,24425,25165,25505,26685,27507,28168,28797,37319,29312,30741,30758,31085,25998,32048,33756,35009,36617,38555,21092,22312,26448,32618,36001,20916,22338,38442,22586,27018,32948,21682,23822,22524,30869,40442,20316,21066,21643,25662,26152,26388,26613,31364,31574,32034,37679,26716,39853,31545,21273,20874,21047,23519,25334,25774,25830,26413,27578,34217,38609,30352,39894,25420,37638,39851,30399,26194,19977,20632,21442,23665,24808,25746,25955,26719,29158,29642,29987,31639,32386,34453,35715,36059,37240,39184,26028,26283,27531,20181,20180,20282,20351,21050,21496,21490,21987,22235,22763,22987,22985,23039,23376,23629,24066,24107,24535,24605,25351,25903,23388,26031,26045,26088,26525,27490,27515,27663,29509,31049,31169,31992,32025,32043,32930,33026,33267,35222,35422,35433,35430,35468,35566,36039,36060,38604,39164,27503,20107,20284,20365,20816,23383,23546,24904,25345,26178,27425,28363,27835,29246,29885,30164,30913,31034,32780,32819,33258,33940,36766,27728,40575,24335,35672,40235,31482,36600,23437,38635,19971,21489,22519,22833,23241,23460,24713,28287,28422,30142,36074,23455,34048,31712,20594,26612,33437,23649,34122,32286,33294,20889,23556,25448,36198,26012,29038,31038,32023,32773,35613,36554,36974,34503,37034,20511,21242,23610,26451,28796,29237,37196,37320,37675,33509,23490,24369,24825,20027,21462,23432,25163,26417,27530,29417,29664,31278,33131,36259,37202,39318,20754,21463,21610,23551,25480,27193,32172,38656,22234,21454,21608,23447,23601,24030,20462,24833,25342,27954,31168,31179,32066,32333,32722,33261,33311,33936,34886,35186,35728,36468,36655,36913,37195,37228,38598,37276,20160,20303,20805,21313,24467,25102,26580,27713,28171,29539,32294,37325,37507,21460,22809,23487,28113,31069,32302,31899,22654,29087,20986,34899,36848,20426,23803,26149,30636,31459,33308,39423,20934,24490,26092,26991,27529,28147,28310,28516,30462,32020,24033,36981,37255,38918,20966,21021,25152,26257,26329,28186,24246,32210,32626,26360,34223,34295,35576,21161,21465,22899,24207,24464,24661,37604,38500,20663,20767,21213,21280,21319,21484,21736,21830,21809,22039,22888,22974,23100,23477,23558,23567,23569,23578,24196,24202,24288,24432,25215,25220,25307,25484,25463,26119,26124,26157,26230,26494,26786,27167,27189,27836,28040,28169,28248,28988,28966,29031,30151,30465,30813,30977,31077,31216,31456,31505,31911,32057,32918,33750,33931,34121,34909,35059,35359,35388,35412,35443,35937,36062,37284,37478,37758,37912,38556,38808,19978,19976,19998,20055,20887,21104,22478,22580,22732,23330,24120,24773,25854,26465,26454,27972,29366,30067,31331,33976,35698,37304,37664,22065,22516,39166,25325,26893,27542,29165,32340,32887,33394,35302,39135,34645,36785,23611,20280,20449,20405,21767,23072,23517,23529,24515,24910,25391,26032,26187,26862,27035,28024,28145,30003,30137,30495,31070,31206,32051,33251,33455,34218,35242,35386,36523,36763,36914,37341,38663,20154,20161,20995,22645,22764,23563,29978,23613,33102,35338,36805,38499,38765,31525,35535,38920,37218,22259,21416,36887,21561,22402,24101,25512,27700,28810,30561,31883,32736,34928,36930,37204,37648,37656,38543,29790,39620,23815,23913,25968,26530,36264,38619,25454,26441,26905,33733,38935,38592,35070,28548,25722,23544,19990,28716,30045,26159,20932,21046,21218,22995,24449,24615,25104,25919,25972,26143,26228,26866,26646,27491,28165,29298,29983,30427,31934,32854,22768,35069,35199,35488,35475,35531,36893,37266,38738,38745,25993,31246,33030,38587,24109,24796,25114,26021,26132,26512,30707,31309,31821,32318,33034,36012,36196,36321,36447,30889,20999,25305,25509,25666,25240,35373,31363,31680,35500,38634,32118,33292,34633,20185,20808,21315,21344,23459,23554,23574,24029,25126,25159,25776,26643,26676,27849,27973,27927,26579,28508,29006,29053,26059,31359,31661,32218,32330,32680,33146,33307,33337,34214,35438,36046,36341,36984,36983,37549,37521,38275,39854,21069,21892,28472,28982,20840,31109,32341,33203,31950,22092,22609,23720,25514,26366,26365,26970,29401,30095,30094,30990,31062,31199,31895,32032,32068,34311,35380,38459,36961,40736,20711,21109,21452,21474,20489,21930,22766,22863,29245,23435,23652,21277,24803,24819,25436,25475,25407,25531,25805,26089,26361,24035,27085,27133,28437,29157,20105,30185,30456,31379,31967,32207,32156,32865,33609,33624,33900,33980,34299,35013,36208,36865,36973,37783,38684,39442,20687,22679,24974,33235,34101,36104,36896,20419,20596,21063,21363,24687,25417,26463,28204,36275,36895,20439,23646,36042,26063,32154,21330,34966,20854,25539,23384,23403,23562,25613,26449,36956,20182,22810,22826,27760,35409,21822,22549,22949,24816,25171,26561,33333,26965,38464,39364,39464,20307,22534,23550,32784,23729,24111,24453,24608,24907,25140,26367,27888,28382,32974,33151,33492,34955,36024,36864,36910,38538,40667,39899,20195,21488,22823,31532,37261,38988,40441,28381,28711,21331,21828,23429,25176,25246,25299,27810,28655,29730,35351,37944,28609,35582,33592,20967,34552,21482,21481,20294,36948,36784,22890,33073,24061,31466,36799,26842,35895,29432,40008,27197,35504,20025,21336,22022,22374,25285,25506,26086,27470,28129,28251,28845,30701,31471,31658,32187,32829,32966,34507,35477,37723,22243,22727,24382,26029,26262,27264,27573,30007,35527,20516,30693,22320,24347,24677,26234,27744,30196,31258,32622,33268,34584,36933,39347,31689,30044,31481,31569,33988,36880,31209,31378,33590,23265,30528,20013,20210,23449,24544,25277,26172,26609,27880,34411,34935,35387,37198,37619,39376,27159,28710,29482,33511,33879,36015,19969,20806,20939,21899,23541,24086,24115,24193,24340,24373,24427,24500,25074,25361,26274,26397,28526,29266,30010,30522,32884,33081,33144,34678,35519,35548,36229,36339,37530,38263,38914,40165,21189,25431,30452,26389,27784,29645,36035,37806,38515,27941,22684,26894,27084,36861,37786,30171,36890,22618,26626,25524,27131,20291,28460,26584,36795,34086,32180,37716,26943,28528,22378,22775,23340,32044,29226,21514,37347,40372,20141,20302,20572,20597,21059,35998,21576,22564,23450,24093,24213,24237,24311,24351,24716,25269,25402,25552,26799,27712,30855,31118,31243,32224,33351,35330,35558,36420,36883,37048,37165,37336,40718,27877,25688,25826,25973,28404,30340,31515,36969,37841,28346,21746,24505,25764,36685,36845,37444,20856,22635,22825,23637,24215,28155,32399,29980,36028,36578,39003,28857,20253,27583,28593,30000,38651,20814,21520,22581,22615,22956,23648,24466,26007,26460,28193,30331,33759,36077,36884,37117,37709,30757,30778,21162,24230,22303,22900,24594,20498,20826,20908,20941,20992,21776,22612,22616,22871,23445,23798,23947,24764,25237,25645,26481,26691,26812,26847,30423,28120,28271,28059,28783,29128,24403,30168,31095,31561,31572,31570,31958,32113,21040,33891,34153,34276,35342,35588,35910,36367,36867,36879,37913,38518,38957,39472,38360,20685,21205,21516,22530,23566,24999,25758,27934,30643,31461,33012,33796,36947,37509,23776,40199,21311,24471,24499,28060,29305,30563,31167,31716,27602,29420,35501,26627,27233,20984,31361,26932,23626,40182,33515,23493,37193,28702,22136,23663,24775,25958,27788,35930,36929,38931,21585,26311,37389,22856,37027,20869,20045,20970,34201,35598,28760,25466,37707,26978,39348,32260,30071,21335,26976,36575,38627,27741,20108,23612,24336,36841,21250,36049,32905,34425,24319,26085,20083,20837,22914,23615,38894,20219,22922,24525,35469,28641,31152,31074,23527,33905,29483,29105,24180,24565,25467,25754,29123,31896,20035,24316,20043,22492,22178,24745,28611,32013,33021,33075,33215,36786,35223,34468,24052,25226,25773,35207,26487,27874,27966,29750,30772,23110,32629,33453,39340,20467,24259,25309,25490,25943,26479,30403,29260,32972,32954,36649,37197,20493,22521,23186,26757,26995,29028,29437,36023,22770,36064,38506,36889,34687,31204,30695,33833,20271,21093,21338,25293,26575,27850,30333,31636,31893,33334,34180,36843,26333,28448,29190,32283,33707,39361,40614,20989,31665,30834,31672,32903,31560,27368,24161,32908,30033,30048,20843,37474,28300,30330,37271,39658,20240,32624,25244,31567,38309,40169,22138,22617,34532,38588,20276,21028,21322,21453,21467,24070,25644,26001,26495,27710,27726,29256,29359,29677,30036,32321,33324,34281,36009,31684,37318,29033,38930,39151,25405,26217,30058,30436,30928,34115,34542,21290,21329,21542,22915,24199,24444,24754,25161,25209,25259,26000,27604,27852,30130,30382,30865,31192,32203,32631,32933,34987,35513,36027,36991,38750,39131,27147,31800,20633,23614,24494,26503,27608,29749,30473,32654,40763,26570,31255,21305,30091,39661,24422,33181,33777,32920,24380,24517,30050,31558,36924,26727,23019,23195,32016,30334,35628,20469,24426,27161,27703,28418,29922,31080,34920,35413,35961,24287,25551,30149,31186,33495,37672,37618,33948,34541,39981,21697,24428,25996,27996,28693,36007,36051,38971,25935,29942,19981,20184,22496,22827,23142,23500,20904,24067,24220,24598,25206,25975,26023,26222,28014,29238,31526,33104,33178,33433,35676,36000,36070,36212,38428,38468,20398,25771,27494,33310,33889,34154,37096,23553,26963,39080,33914,34135,20239,21103,24489,24133,26381,31119,33145,35079,35206,28149,24343,25173,27832,20175,29289,39826,20998,21563,22132,22707,24996,25198,28954,22894,31881,31966,32027,38640,25991,32862,19993,20341,20853,22592,24163,24179,24330,26564,20006,34109,38281,38491,31859,38913,20731,22721,30294,30887,21029,30629,34065,31622,20559,22793,29255,31687,32232,36794,36820,36941,20415,21193,23081,24321,38829,20445,33303,37610,22275,25429,27497,29995,35036,36628,31298,21215,22675,24917,25098,26286,27597,31807,33769,20515,20472,21253,21574,22577,22857,23453,23792,23791,23849,24214,25265,25447,25918,26041,26379,27861,27873,28921,30770,32299,32990,33459,33804,34028,34562,35090,35370,35914,37030,37586,39165,40179,40300,20047,20129,20621,21078,22346,22952,24125,24536,24537,25151,26292,26395,26576,26834,20882,32033,32938,33192,35584,35980,36031,37502,38450,21536,38956,21271,20693,21340,22696,25778,26420,29287,30566,31302,37350,21187,27809,27526,22528,24140,22868,26412,32763,20961,30406,25705,30952,39764,40635,22475,22969,26151,26522,27598,21737,27097,24149,33180,26517,39850,26622,40018,26717,20134,20451,21448,25273,26411,27819,36804,20397,32365,40639,19975,24930,28288,28459,34067,21619,26410,39749,24051,31637,23724,23494,34588,28234,34001,31252,33032,22937,31885,27665,30496,21209,22818,28961,29279,30683,38695,40289,26891,23167,23064,20901,21517,21629,26126,30431,36855,37528,40180,23018,29277,28357,20813,26825,32191,32236,38754,40634,25720,27169,33538,22916,23391,27611,29467,30450,32178,32791,33945,20786,26408,40665,30446,26466,21247,39173,23588,25147,31870,36016,21839,24758,32011,38272,21249,20063,20918,22812,29242,32822,37326,24357,30690,21380,24441,32004,34220,35379,36493,38742,26611,34222,37971,24841,24840,27833,30290,35565,36664,21807,20305,20778,21191,21451,23461,24189,24736,24962,25558,26377,26586,28263,28044,29494,29495,30001,31056,35029,35480,36938,37009,37109,38596,34701,22805,20104,20313,19982,35465,36671,38928,20653,24188,22934,23481,24248,25562,25594,25793,26332,26954,27096,27915,28342,29076,29992,31407,32650,32768,33865,33993,35201,35617,36362,36965,38525,39178,24958,25233,27442,27779,28020,32716,32764,28096,32645,34746,35064,26469,33713,38972,38647,27931,32097,33853,37226,20081,21365,23888,27396,28651,34253,34349,35239,21033,21519,23653,26446,26792,29702,29827,30178,35023,35041,37324,38626,38520,24459,29575,31435,33870,25504,30053,21129,27969,28316,29705,30041,30827,31890,38534,31452,40845,20406,24942,26053,34396,20102,20142,20698,20001,20940,23534,26009,26753,28092,29471,30274,30637,31260,31975,33391,35538,36988,37327,38517,38936,21147,32209,20523,21400,26519,28107,29136,29747,33256,36650,38563,40023,40607,29792,22593,28057,32047,39006,20196,20278,20363,20919,21169,23994,24604,29618,31036,33491,37428,38583,38646,38666,40599,40802,26278,27508,21015,21155,28872,35010,24265,24651,24976,28451,29001,31806,32244,32879,34030,36899,37676,21570,39791,27347,28809,36034,36335,38706,21172,23105,24266,24324,26391,27004,27028,28010,28431,29282,29436,31725,32769,32894,34635,37070,20845,40595,31108,32907,37682,35542,20525,21644,35441,27498,36036,33031,24785,26528,40434,20121,20120,39952,35435,34241,34152,26880,28286,30871,33109,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,24332,19984,19989,20010,20017,20022,20028,20031,20034,20054,20056,20098,20101,35947,20106,33298,24333,20110,20126,20127,20128,20130,20144,20147,20150,20174,20173,20164,20166,20162,20183,20190,20205,20191,20215,20233,20314,20272,20315,20317,20311,20295,20342,20360,20367,20376,20347,20329,20336,20369,20335,20358,20374,20760,20436,20447,20430,20440,20443,20433,20442,20432,20452,20453,20506,20520,20500,20522,20517,20485,20252,20470,20513,20521,20524,20478,20463,20497,20486,20547,20551,26371,20565,20560,20552,20570,20566,20588,20600,20608,20634,20613,20660,20658,20681,20682,20659,20674,20694,20702,20709,20717,20707,20718,20729,20725,20745,20737,20738,20758,20757,20756,20762,20769,20794,20791,20796,20795,20799,20800,20818,20812,20820,20834,31480,20841,20842,20846,20864,20866,22232,20876,20873,20879,20881,20883,20885,20886,20900,20902,20898,20905,20906,20907,20915,20913,20914,20912,20917,20925,20933,20937,20955,20960,34389,20969,20973,20976,20981,20990,20996,21003,21012,21006,21031,21034,21038,21043,21049,21071,21060,21067,21068,21086,21076,21098,21108,21097,21107,21119,21117,21133,21140,21138,21105,21128,21137,36776,36775,21164,21165,21180,21173,21185,21197,21207,21214,21219,21222,39149,21216,21235,21237,21240,21241,21254,21256,30008,21261,21264,21263,21269,21274,21283,21295,21297,21299,21304,21312,21318,21317,19991,21321,21325,20950,21342,21353,21358,22808,21371,21367,21378,21398,21408,21414,21413,21422,21424,21430,21443,31762,38617,21471,26364,29166,21486,21480,21485,21498,21505,21565,21568,21548,21549,21564,21550,21558,21545,21533,21582,21647,21621,21646,21599,21617,21623,21616,21650,21627,21632,21622,21636,21648,21638,21703,21666,21688,21669,21676,21700,21704,21672,21675,21698,21668,21694,21692,21720,21733,21734,21775,21780,21757,21742,21741,21754,21730,21817,21824,21859,21836,21806,21852,21829,21846,21847,21816,21811,21853,21913,21888,21679,21898,21919,21883,21886,21912,21918,21934,21884,21891,21929,21895,21928,21978,21957,21983,21956,21980,21988,21972,22036,22007,22038,22014,22013,22043,22009,22094,22096,29151,22068,22070,22066,22072,22123,22116,22063,22124,22122,22150,22144,22154,22176,22164,22159,22181,22190,22198,22196,22210,22204,22209,22211,22208,22216,22222,22225,22227,22231,22254,22265,22272,22271,22276,22281,22280,22283,22285,22291,22296,22294,21959,22300,22310,22327,22328,22350,22331,22336,22351,22377,22464,22408,22369,22399,22409,22419,22432,22451,22436,22442,22448,22467,22470,22484,22482,22483,22538,22486,22499,22539,22553,22557,22642,22561,22626,22603,22640,27584,22610,22589,22649,22661,22713,22687,22699,22714,22750,22715,22712,22702,22725,22739,22737,22743,22745,22744,22757,22748,22756,22751,22767,22778,22777,22779,22780,22781,22786,22794,22800,22811,26790,22821,22828,22829,22834,22840,22846,31442,22869,22864,22862,22874,22872,22882,22880,22887,22892,22889,22904,22913,22941,20318,20395,22947,22962,22982,23016,23004,22925,23001,23002,23077,23071,23057,23068,23049,23066,23104,23148,23113,23093,23094,23138,23146,23194,23228,23230,23243,23234,23229,23267,23255,23270,23273,23254,23290,23291,23308,23307,23318,23346,23248,23338,23350,23358,23363,23365,23360,23377,23381,23386,23387,23397,23401,23408,23411,23413,23416,25992,23418,23424,23427,23462,23480,23491,23495,23497,23508,23504,23524,23526,23522,23518,23525,23531,23536,23542,23539,23557,23559,23560,23565,23571,23584,23586,23592,23608,23609,23617,23622,23630,23635,23632,23631,23409,23660,23662,20066,23670,23673,23692,23697,23700,22939,23723,23739,23734,23740,23735,23749,23742,23751,23769,23785,23805,23802,23789,23948,23786,23819,23829,23831,23900,23839,23835,23825,23828,23842,23834,23833,23832,23884,23890,23886,23883,23916,23923,23926,23943,23940,23938,23970,23965,23980,23982,23997,23952,23991,23996,24009,24013,24019,24018,24022,24027,24043,24050,24053,24075,24090,24089,24081,24091,24118,24119,24132,24131,24128,24142,24151,24148,24159,24162,24164,24135,24181,24182,24186,40636,24191,24224,24257,24258,24264,24272,24271,24278,24291,24285,24282,24283,24290,24289,24296,24297,24300,24305,24307,24304,24308,24312,24318,24323,24329,24413,24412,24331,24337,24342,24361,24365,24376,24385,24392,24396,24398,24367,24401,24406,24407,24409,24417,24429,24435,24439,24451,24450,24447,24458,24456,24465,24455,24478,24473,24472,24480,24488,24493,24508,24534,24571,24548,24568,24561,24541,24755,24575,24609,24672,24601,24592,24617,24590,24625,24603,24597,24619,24614,24591,24634,24666,24641,24682,24695,24671,24650,24646,24653,24675,24643,24676,24642,24684,24683,24665,24705,24717,24807,24707,24730,24708,24731,24726,24727,24722,24743,24715,24801,24760,24800,24787,24756,24560,24765,24774,24757,24792,24909,24853,24838,24822,24823,24832,24820,24826,24835,24865,24827,24817,24845,24846,24903,24894,24872,24871,24906,24895,24892,24876,24884,24893,24898,24900,24947,24951,24920,24921,24922,24939,24948,24943,24933,24945,24927,24925,24915,24949,24985,24982,24967,25004,24980,24986,24970,24977,25003,25006,25036,25034,25033,25079,25032,25027,25030,25018,25035,32633,25037,25062,25059,25078,25082,25076,25087,25085,25084,25086,25088,25096,25097,25101,25100,25108,25115,25118,25121,25130,25134,25136,25138,25139,25153,25166,25182,25187,25179,25184,25192,25212,25218,25225,25214,25234,25235,25238,25300,25219,25236,25303,25297,25275,25295,25343,25286,25812,25288,25308,25292,25290,25282,25287,25243,25289,25356,25326,25329,25383,25346,25352,25327,25333,25424,25406,25421,25628,25423,25494,25486,25472,25515,25462,25507,25487,25481,25503,25525,25451,25449,25534,25577,25536,25542,25571,25545,25554,25590,25540,25622,25652,25606,25619,25638,25654,25885,25623,25640,25615,25703,25711,25718,25678,25898,25749,25747,25765,25769,25736,25788,25818,25810,25797,25799,25787,25816,25794,25841,25831,33289,25824,25825,25260,25827,25839,25900,25846,25844,25842,25850,25856,25853,25880,25884,25861,25892,25891,25899,25908,25909,25911,25910,25912,30027,25928,25942,25941,25933,25944,25950,25949,25970,25976,25986,25987,35722,26011,26015,26027,26039,26051,26054,26049,26052,26060,26066,26075,26073,26080,26081,26097,26482,26122,26115,26107,26483,26165,26166,26164,26140,26191,26180,26185,26177,26206,26205,26212,26215,26216,26207,26210,26224,26243,26248,26254,26249,26244,26264,26269,26305,26297,26313,26302,26300,26308,26296,26326,26330,26336,26175,26342,26345,26352,26357,26359,26383,26390,26398,26406,26407,38712,26414,26431,26422,26433,26424,26423,26438,26462,26464,26457,26467,26468,26505,26480,26537,26492,26474,26508,26507,26534,26529,26501,26551,26607,26548,26604,26547,26601,26552,26596,26590,26589,26594,26606,26553,26574,26566,26599,27292,26654,26694,26665,26688,26701,26674,26702,26803,26667,26713,26723,26743,26751,26783,26767,26797,26772,26781,26779,26755,27310,26809,26740,26805,26784,26810,26895,26765,26750,26881,26826,26888,26840,26914,26918,26849,26892,26829,26836,26855,26837,26934,26898,26884,26839,26851,26917,26873,26848,26863,26920,26922,26906,26915,26913,26822,27001,26999,26972,27000,26987,26964,27006,26990,26937,26996,26941,26969,26928,26977,26974,26973,27009,26986,27058,27054,27088,27071,27073,27091,27070,27086,23528,27082,27101,27067,27075,27047,27182,27025,27040,27036,27029,27060,27102,27112,27138,27163,27135,27402,27129,27122,27111,27141,27057,27166,27117,27156,27115,27146,27154,27329,27171,27155,27204,27148,27250,27190,27256,27207,27234,27225,27238,27208,27192,27170,27280,27277,27296,27268,27298,27299,27287,34327,27323,27331,27330,27320,27315,27308,27358,27345,27359,27306,27354,27370,27387,27397,34326,27386,27410,27414,39729,27423,27448,27447,30428,27449,39150,27463,27459,27465,27472,27481,27476,27483,27487,27489,27512,27513,27519,27520,27524,27523,27533,27544,27541,27550,27556,27562,27563,27567,27570,27569,27571,27575,27580,27590,27595,27603,27615,27628,27627,27635,27631,40638,27656,27667,27668,27675,27684,27683,27742,27733,27746,27754,27778,27789,27802,27777,27803,27774,27752,27763,27794,27792,27844,27889,27859,27837,27863,27845,27869,27822,27825,27838,27834,27867,27887,27865,27882,27935,34893,27958,27947,27965,27960,27929,27957,27955,27922,27916,28003,28051,28004,27994,28025,27993,28046,28053,28644,28037,28153,28181,28170,28085,28103,28134,28088,28102,28140,28126,28108,28136,28114,28101,28154,28121,28132,28117,28138,28142,28205,28270,28206,28185,28274,28255,28222,28195,28267,28203,28278,28237,28191,28227,28218,28238,28196,28415,28189,28216,28290,28330,28312,28361,28343,28371,28349,28335,28356,28338,28372,28373,28303,28325,28354,28319,28481,28433,28748,28396,28408,28414,28479,28402,28465,28399,28466,28364,28478,28435,28407,28550,28538,28536,28545,28544,28527,28507,28659,28525,28546,28540,28504,28558,28561,28610,28518,28595,28579,28577,28580,28601,28614,28586,28639,28629,28652,28628,28632,28657,28654,28635,28681,28683,28666,28689,28673,28687,28670,28699,28698,28532,28701,28696,28703,28720,28734,28722,28753,28771,28825,28818,28847,28913,28844,28856,28851,28846,28895,28875,28893,28889,28937,28925,28956,28953,29029,29013,29064,29030,29026,29004,29014,29036,29071,29179,29060,29077,29096,29100,29143,29113,29118,29138,29129,29140,29134,29152,29164,29159,29173,29180,29177,29183,29197,29200,29211,29224,29229,29228,29232,29234,29243,29244,29247,29248,29254,29259,29272,29300,29310,29314,29313,29319,29330,29334,29346,29351,29369,29362,29379,29382,29380,29390,29394,29410,29408,29409,29433,29431,20495,29463,29450,29468,29462,29469,29492,29487,29481,29477,29502,29518,29519,40664,29527,29546,29544,29552,29560,29557,29563,29562,29640,29619,29646,29627,29632,29669,29678,29662,29858,29701,29807,29733,29688,29746,29754,29781,29759,29791,29785,29761,29788,29801,29808,29795,29802,29814,29822,29835,29854,29863,29898,29903,29908,29681,29920,29923,29927,29929,29934,29938,29936,29937,29944,29943,29956,29955,29957,29964,29966,29965,29973,29971,29982,29990,29996,30012,30020,30029,30026,30025,30043,30022,30042,30057,30052,30055,30059,30061,30072,30070,30086,30087,30068,30090,30089,30082,30100,30106,30109,30117,30115,30146,30131,30147,30133,30141,30136,30140,30129,30157,30154,30162,30169,30179,30174,30206,30207,30204,30209,30192,30202,30194,30195,30219,30221,30217,30239,30247,30240,30241,30242,30244,30260,30256,30267,30279,30280,30278,30300,30296,30305,30306,30312,30313,30314,30311,30316,30320,30322,30326,30328,30332,30336,30339,30344,30347,30350,30358,30355,30361,30362,30384,30388,30392,30393,30394,30402,30413,30422,30418,30430,30433,30437,30439,30442,34351,30459,30472,30471,30468,30505,30500,30494,30501,30502,30491,30519,30520,30535,30554,30568,30571,30555,30565,30591,30590,30585,30606,30603,30609,30624,30622,30640,30646,30649,30655,30652,30653,30651,30663,30669,30679,30682,30684,30691,30702,30716,30732,30738,31014,30752,31018,30789,30862,30836,30854,30844,30874,30860,30883,30901,30890,30895,30929,30918,30923,30932,30910,30908,30917,30922,30956,30951,30938,30973,30964,30983,30994,30993,31001,31020,31019,31040,31072,31063,31071,31066,31061,31059,31098,31103,31114,31133,31143,40779,31146,31150,31155,31161,31162,31177,31189,31207,31212,31201,31203,31240,31245,31256,31257,31264,31263,31104,31281,31291,31294,31287,31299,31319,31305,31329,31330,31337,40861,31344,31353,31357,31368,31383,31381,31384,31382,31401,31432,31408,31414,31429,31428,31423,36995,31431,31434,31437,31439,31445,31443,31449,31450,31453,31457,31458,31462,31469,31472,31490,31503,31498,31494,31539,31512,31513,31518,31541,31528,31542,31568,31610,31492,31565,31499,31564,31557,31605,31589,31604,31591,31600,31601,31596,31598,31645,31640,31647,31629,31644,31642,31627,31634,31631,31581,31641,31691,31681,31692,31695,31668,31686,31709,31721,31761,31764,31718,31717,31840,31744,31751,31763,31731,31735,31767,31757,31734,31779,31783,31786,31775,31799,31787,31805,31820,31811,31828,31823,31808,31824,31832,31839,31844,31830,31845,31852,31861,31875,31888,31908,31917,31906,31915,31905,31912,31923,31922,31921,31918,31929,31933,31936,31941,31938,31960,31954,31964,31970,39739,31983,31986,31988,31990,31994,32006,32002,32028,32021,32010,32069,32075,32046,32050,32063,32053,32070,32115,32086,32078,32114,32104,32110,32079,32099,32147,32137,32091,32143,32125,32155,32186,32174,32163,32181,32199,32189,32171,32317,32162,32175,32220,32184,32159,32176,32216,32221,32228,32222,32251,32242,32225,32261,32266,32291,32289,32274,32305,32287,32265,32267,32290,32326,32358,32315,32309,32313,32323,32311,32306,32314,32359,32349,32342,32350,32345,32346,32377,32362,32361,32380,32379,32387,32213,32381,36782,32383,32392,32393,32396,32402,32400,32403,32404,32406,32398,32411,32412,32568,32570,32581,32588,32589,32590,32592,32593,32597,32596,32600,32607,32608,32616,32617,32615,32632,32642,32646,32643,32648,32647,32652,32660,32670,32669,32666,32675,32687,32690,32697,32686,32694,32696,35697,32709,32710,32714,32725,32724,32737,32742,32745,32755,32761,39132,32774,32772,32779,32786,32792,32793,32796,32801,32808,32831,32827,32842,32838,32850,32856,32858,32863,32866,32872,32883,32882,32880,32886,32889,32893,32895,32900,32902,32901,32923,32915,32922,32941,20880,32940,32987,32997,32985,32989,32964,32986,32982,33033,33007,33009,33051,33065,33059,33071,33099,38539,33094,33086,33107,33105,33020,33137,33134,33125,33126,33140,33155,33160,33162,33152,33154,33184,33173,33188,33187,33119,33171,33193,33200,33205,33214,33208,33213,33216,33218,33210,33225,33229,33233,33241,33240,33224,33242,33247,33248,33255,33274,33275,33278,33281,33282,33285,33287,33290,33293,33296,33302,33321,33323,33336,33331,33344,33369,33368,33373,33370,33375,33380,33378,33384,33386,33387,33326,33393,33399,33400,33406,33421,33426,33451,33439,33467,33452,33505,33507,33503,33490,33524,33523,33530,33683,33539,33531,33529,33502,33542,33500,33545,33497,33589,33588,33558,33586,33585,33600,33593,33616,33605,33583,33579,33559,33560,33669,33690,33706,33695,33698,33686,33571,33678,33671,33674,33660,33717,33651,33653,33696,33673,33704,33780,33811,33771,33742,33789,33795,33752,33803,33729,33783,33799,33760,33778,33805,33826,33824,33725,33848,34054,33787,33901,33834,33852,34138,33924,33911,33899,33965,33902,33922,33897,33862,33836,33903,33913,33845,33994,33890,33977,33983,33951,34009,33997,33979,34010,34000,33985,33990,34006,33953,34081,34047,34036,34071,34072,34092,34079,34069,34068,34044,34112,34147,34136,34120,34113,34306,34123,34133,34176,34212,34184,34193,34186,34216,34157,34196,34203,34282,34183,34204,34167,34174,34192,34249,34234,34255,34233,34256,34261,34269,34277,34268,34297,34314,34323,34315,34302,34298,34310,34338,34330,34352,34367,34381,20053,34388,34399,34407,34417,34451,34467,34473,34474,34443,34444,34486,34479,34500,34502,34480,34505,34851,34475,34516,34526,34537,34540,34527,34523,34543,34578,34566,34568,34560,34563,34555,34577,34569,34573,34553,34570,34612,34623,34615,34619,34597,34601,34586,34656,34655,34680,34636,34638,34676,34647,34664,34670,34649,34643,34659,34666,34821,34722,34719,34690,34735,34763,34749,34752,34768,38614,34731,34756,34739,34759,34758,34747,34799,34802,34784,34831,34829,34814,34806,34807,34830,34770,34833,34838,34837,34850,34849,34865,34870,34873,34855,34875,34884,34882,34898,34905,34910,34914,34923,34945,34942,34974,34933,34941,34997,34930,34946,34967,34962,34990,34969,34978,34957,34980,34992,35007,34993,35011,35012,35028,35032,35033,35037,35065,35074,35068,35060,35048,35058,35076,35084,35082,35091,35139,35102,35109,35114,35115,35137,35140,35131,35126,35128,35148,35101,35168,35166,35174,35172,35181,35178,35183,35188,35191,35198,35203,35208,35210,35219,35224,35233,35241,35238,35244,35247,35250,35258,35261,35263,35264,35290,35292,35293,35303,35316,35320,35331,35350,35344,35340,35355,35357,35365,35382,35393,35419,35410,35398,35400,35452,35437,35436,35426,35461,35458,35460,35496,35489,35473,35493,35494,35482,35491,35524,35533,35522,35546,35563,35571,35559,35556,35569,35604,35552,35554,35575,35550,35547,35596,35591,35610,35553,35606,35600,35607,35616,35635,38827,35622,35627,35646,35624,35649,35660,35663,35662,35657,35670,35675,35674,35691,35679,35692,35695,35700,35709,35712,35724,35726,35730,35731,35734,35737,35738,35898,35905,35903,35912,35916,35918,35920,35925,35938,35948,35960,35962,35970,35977,35973,35978,35981,35982,35988,35964,35992,25117,36013,36010,36029,36018,36019,36014,36022,36040,36033,36068,36067,36058,36093,36090,36091,36100,36101,36106,36103,36111,36109,36112,40782,36115,36045,36116,36118,36199,36205,36209,36211,36225,36249,36290,36286,36282,36303,36314,36310,36300,36315,36299,36330,36331,36319,36323,36348,36360,36361,36351,36381,36382,36368,36383,36418,36405,36400,36404,36426,36423,36425,36428,36432,36424,36441,36452,36448,36394,36451,36437,36470,36466,36476,36481,36487,36485,36484,36491,36490,36499,36497,36500,36505,36522,36513,36524,36528,36550,36529,36542,36549,36552,36555,36571,36579,36604,36603,36587,36606,36618,36613,36629,36626,36633,36627,36636,36639,36635,36620,36646,36659,36667,36665,36677,36674,36670,36684,36681,36678,36686,36695,36700,36706,36707,36708,36764,36767,36771,36781,36783,36791,36826,36837,36834,36842,36847,36999,36852,36869,36857,36858,36881,36885,36897,36877,36894,36886,36875,36903,36918,36917,36921,36856,36943,36944,36945,36946,36878,36937,36926,36950,36952,36958,36968,36975,36982,38568,36978,36994,36989,36993,36992,37002,37001,37007,37032,37039,37041,37045,37090,37092,25160,37083,37122,37138,37145,37170,37168,37194,37206,37208,37219,37221,37225,37235,37234,37259,37257,37250,37282,37291,37295,37290,37301,37300,37306,37312,37313,37321,37323,37328,37334,37343,37345,37339,37372,37365,37366,37406,37375,37396,37420,37397,37393,37470,37463,37445,37449,37476,37448,37525,37439,37451,37456,37532,37526,37523,37531,37466,37583,37561,37559,37609,37647,37626,37700,37678,37657,37666,37658,37667,37690,37685,37691,37724,37728,37756,37742,37718,37808,37804,37805,37780,37817,37846,37847,37864,37861,37848,37827,37853,37840,37832,37860,37914,37908,37907,37891,37895,37904,37942,37931,37941,37921,37946,37953,37970,37956,37979,37984,37986,37982,37994,37417,38000,38005,38007,38013,37978,38012,38014,38017,38015,38274,38279,38282,38292,38294,38296,38297,38304,38312,38311,38317,38332,38331,38329,38334,38346,28662,38339,38349,38348,38357,38356,38358,38364,38369,38373,38370,38433,38440,38446,38447,38466,38476,38479,38475,38519,38492,38494,38493,38495,38502,38514,38508,38541,38552,38549,38551,38570,38567,38577,38578,38576,38580,38582,38584,38585,38606,38603,38601,38605,35149,38620,38669,38613,38649,38660,38662,38664,38675,38670,38673,38671,38678,38681,38692,38698,38704,38713,38717,38718,38724,38726,38728,38722,38729,38748,38752,38756,38758,38760,21202,38763,38769,38777,38789,38780,38785,38778,38790,38795,38799,38800,38812,38824,38822,38819,38835,38836,38851,38854,38856,38859,38876,38893,40783,38898,31455,38902,38901,38927,38924,38968,38948,38945,38967,38973,38982,38991,38987,39019,39023,39024,39025,39028,39027,39082,39087,39089,39094,39108,39107,39110,39145,39147,39171,39177,39186,39188,39192,39201,39197,39198,39204,39200,39212,39214,39229,39230,39234,39241,39237,39248,39243,39249,39250,39244,39253,39319,39320,39333,39341,39342,39356,39391,39387,39389,39384,39377,39405,39406,39409,39410,39419,39416,39425,39439,39429,39394,39449,39467,39479,39493,39490,39488,39491,39486,39509,39501,39515,39511,39519,39522,39525,39524,39529,39531,39530,39597,39600,39612,39616,39631,39633,39635,39636,39646,39647,39650,39651,39654,39663,39659,39662,39668,39665,39671,39675,39686,39704,39706,39711,39714,39715,39717,39719,39720,39721,39722,39726,39727,39730,39748,39747,39759,39757,39758,39761,39768,39796,39827,39811,39825,39830,39831,39839,39840,39848,39860,39872,39882,39865,39878,39887,39889,39890,39907,39906,39908,39892,39905,39994,39922,39921,39920,39957,39956,39945,39955,39948,39942,39944,39954,39946,39940,39982,39963,39973,39972,39969,39984,40007,39986,40006,39998,40026,40032,40039,40054,40056,40167,40172,40176,40201,40200,40171,40195,40198,40234,40230,40367,40227,40223,40260,40213,40210,40257,40255,40254,40262,40264,40285,40286,40292,40273,40272,40281,40306,40329,40327,40363,40303,40314,40346,40356,40361,40370,40388,40385,40379,40376,40378,40390,40399,40386,40409,40403,40440,40422,40429,40431,40445,40474,40475,40478,40565,40569,40573,40577,40584,40587,40588,40594,40597,40593,40605,40613,40617,40632,40618,40621,38753,40652,40654,40655,40656,40660,40668,40670,40669,40672,40677,40680,40687,40692,40694,40695,40697,40699,40700,40701,40711,40712,30391,40725,40737,40748,40766,40778,40786,40788,40803,40799,40800,40801,40806,40807,40812,40810,40823,40818,40822,40853,40860,40864,22575,27079,36953,29796,20956,29081,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,32394,35100,37704,37512,34012,20425,28859,26161,26824,37625,26363,24389,20008,20193,20220,20224,20227,20281,20310,20370,20362,20378,20372,20429,20544,20514,20479,20510,20550,20592,20546,20628,20724,20696,20810,20836,20893,20926,20972,21013,21148,21158,21184,21211,21248,21255,21284,21362,21395,21426,21469,64014,21660,21642,21673,21759,21894,22361,22373,22444,22472,22471,64015,64016,22686,22706,22795,22867,22875,22877,22883,22948,22970,23382,23488,29999,23512,23532,23582,23718,23738,23797,23847,23891,64017,23874,23917,23992,23993,24016,24353,24372,24423,24503,24542,24669,24709,24714,24798,24789,24864,24818,24849,24887,24880,24984,25107,25254,25589,25696,25757,25806,25934,26112,26133,26171,26121,26158,26142,26148,26213,26199,26201,64018,26227,26265,26272,26290,26303,26362,26382,63785,26470,26555,26706,26560,26625,26692,26831,64019,26984,64020,27032,27106,27184,27243,27206,27251,27262,27362,27364,27606,27711,27740,27782,27759,27866,27908,28039,28015,28054,28076,28111,28152,28146,28156,28217,28252,28199,28220,28351,28552,28597,28661,28677,28679,28712,28805,28843,28943,28932,29020,28998,28999,64021,29121,29182,29361,29374,29476,64022,29559,29629,29641,29654,29667,29650,29703,29685,29734,29738,29737,29742,29794,29833,29855,29953,30063,30338,30364,30366,30363,30374,64023,30534,21167,30753,30798,30820,30842,31024,64024,64025,64026,31124,64027,31131,31441,31463,64028,31467,31646,64029,32072,32092,32183,32160,32214,32338,32583,32673,64030,33537,33634,33663,33735,33782,33864,33972,34131,34137,34155,64031,34224,64032,64033,34823,35061,35346,35383,35449,35495,35518,35551,64034,35574,35667,35711,36080,36084,36114,36214,64035,36559,64036,64037,36967,37086,64038,37141,37159,37338,37335,37342,37357,37358,37348,37349,37382,37392,37386,37434,37440,37436,37454,37465,37457,37433,37479,37543,37495,37496,37607,37591,37593,37584,64039,37589,37600,37587,37669,37665,37627,64040,37662,37631,37661,37634,37744,37719,37796,37830,37854,37880,37937,37957,37960,38290,63964,64041,38557,38575,38707,38715,38723,38733,38735,38737,38741,38999,39013,64042,64043,39207,64044,39326,39502,39641,39644,39797,39794,39823,39857,39867,39936,40304,40299,64045,40473,40657,null,null,8560,8561,8562,8563,8564,8565,8566,8567,8568,8569,65506,65508,65287,65282,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,8560,8561,8562,8563,8564,8565,8566,8567,8568,8569,8544,8545,8546,8547,8548,8549,8550,8551,8552,8553,65506,65508,65287,65282,12849,8470,8481,8757,32394,35100,37704,37512,34012,20425,28859,26161,26824,37625,26363,24389,20008,20193,20220,20224,20227,20281,20310,20370,20362,20378,20372,20429,20544,20514,20479,20510,20550,20592,20546,20628,20724,20696,20810,20836,20893,20926,20972,21013,21148,21158,21184,21211,21248,21255,21284,21362,21395,21426,21469,64014,21660,21642,21673,21759,21894,22361,22373,22444,22472,22471,64015,64016,22686,22706,22795,22867,22875,22877,22883,22948,22970,23382,23488,29999,23512,23532,23582,23718,23738,23797,23847,23891,64017,23874,23917,23992,23993,24016,24353,24372,24423,24503,24542,24669,24709,24714,24798,24789,24864,24818,24849,24887,24880,24984,25107,25254,25589,25696,25757,25806,25934,26112,26133,26171,26121,26158,26142,26148,26213,26199,26201,64018,26227,26265,26272,26290,26303,26362,26382,63785,26470,26555,26706,26560,26625,26692,26831,64019,26984,64020,27032,27106,27184,27243,27206,27251,27262,27362,27364,27606,27711,27740,27782,27759,27866,27908,28039,28015,28054,28076,28111,28152,28146,28156,28217,28252,28199,28220,28351,28552,28597,28661,28677,28679,28712,28805,28843,28943,28932,29020,28998,28999,64021,29121,29182,29361,29374,29476,64022,29559,29629,29641,29654,29667,29650,29703,29685,29734,29738,29737,29742,29794,29833,29855,29953,30063,30338,30364,30366,30363,30374,64023,30534,21167,30753,30798,30820,30842,31024,64024,64025,64026,31124,64027,31131,31441,31463,64028,31467,31646,64029,32072,32092,32183,32160,32214,32338,32583,32673,64030,33537,33634,33663,33735,33782,33864,33972,34131,34137,34155,64031,34224,64032,64033,34823,35061,35346,35383,35449,35495,35518,35551,64034,35574,35667,35711,36080,36084,36114,36214,64035,36559,64036,64037,36967,37086,64038,37141,37159,37338,37335,37342,37357,37358,37348,37349,37382,37392,37386,37434,37440,37436,37454,37465,37457,37433,37479,37543,37495,37496,37607,37591,37593,37584,64039,37589,37600,37587,37669,37665,37627,64040,37662,37631,37661,37634,37744,37719,37796,37830,37854,37880,37937,37957,37960,38290,63964,64041,38557,38575,38707,38715,38723,38733,38735,38737,38741,38999,39013,64042,64043,39207,64044,39326,39502,39641,39644,39797,39794,39823,39857,39867,39936,40304,40299,64045,40473,40657,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null], - 'jis0212': [null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,728,711,184,729,733,175,731,730,65374,900,901,null,null,null,null,null,null,null,null,161,166,191,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,186,170,169,174,8482,164,8470,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,902,904,905,906,938,null,908,null,910,939,null,911,null,null,null,null,940,941,942,943,970,912,972,962,973,971,944,974,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,1026,1027,1028,1029,1030,1031,1032,1033,1034,1035,1036,1038,1039,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,1106,1107,1108,1109,1110,1111,1112,1113,1114,1115,1116,1118,1119,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,198,272,null,294,null,306,null,321,319,null,330,216,338,null,358,222,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,230,273,240,295,305,307,312,322,320,329,331,248,339,223,359,254,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,193,192,196,194,258,461,256,260,197,195,262,264,268,199,266,270,201,200,203,202,282,278,274,280,null,284,286,290,288,292,205,204,207,206,463,304,298,302,296,308,310,313,317,315,323,327,325,209,211,210,214,212,465,336,332,213,340,344,342,346,348,352,350,356,354,218,217,220,219,364,467,368,362,370,366,360,471,475,473,469,372,221,376,374,377,381,379,null,null,null,null,null,null,null,225,224,228,226,259,462,257,261,229,227,263,265,269,231,267,271,233,232,235,234,283,279,275,281,501,285,287,null,289,293,237,236,239,238,464,null,299,303,297,309,311,314,318,316,324,328,326,241,243,242,246,244,466,337,333,245,341,345,343,347,349,353,351,357,355,250,249,252,251,365,468,369,363,371,367,361,472,476,474,470,373,253,255,375,378,382,380,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,19970,19972,19973,19980,19986,19999,20003,20004,20008,20011,20014,20015,20016,20021,20032,20033,20036,20039,20049,20058,20060,20067,20072,20073,20084,20085,20089,20095,20109,20118,20119,20125,20143,20153,20163,20176,20186,20187,20192,20193,20194,20200,20207,20209,20211,20213,20221,20222,20223,20224,20226,20227,20232,20235,20236,20242,20245,20246,20247,20249,20270,20273,20320,20275,20277,20279,20281,20283,20286,20288,20290,20296,20297,20299,20300,20306,20308,20310,20312,20319,20323,20330,20332,20334,20337,20343,20344,20345,20346,20349,20350,20353,20354,20356,20357,20361,20362,20364,20366,20368,20370,20371,20372,20375,20377,20378,20382,20383,20402,20407,20409,20411,20412,20413,20414,20416,20417,20421,20422,20424,20425,20427,20428,20429,20431,20434,20444,20448,20450,20464,20466,20476,20477,20479,20480,20481,20484,20487,20490,20492,20494,20496,20499,20503,20504,20507,20508,20509,20510,20514,20519,20526,20528,20530,20531,20533,20544,20545,20546,20549,20550,20554,20556,20558,20561,20562,20563,20567,20569,20575,20576,20578,20579,20582,20583,20586,20589,20592,20593,20539,20609,20611,20612,20614,20618,20622,20623,20624,20626,20627,20628,20630,20635,20636,20638,20639,20640,20641,20642,20650,20655,20656,20665,20666,20669,20672,20675,20676,20679,20684,20686,20688,20691,20692,20696,20700,20701,20703,20706,20708,20710,20712,20713,20719,20721,20726,20730,20734,20739,20742,20743,20744,20747,20748,20749,20750,20722,20752,20759,20761,20763,20764,20765,20766,20771,20775,20776,20780,20781,20783,20785,20787,20788,20789,20792,20793,20802,20810,20815,20819,20821,20823,20824,20831,20836,20838,20862,20867,20868,20875,20878,20888,20893,20897,20899,20909,20920,20922,20924,20926,20927,20930,20936,20943,20945,20946,20947,20949,20952,20958,20962,20965,20974,20978,20979,20980,20983,20993,20994,20997,21010,21011,21013,21014,21016,21026,21032,21041,21042,21045,21052,21061,21065,21077,21079,21080,21082,21084,21087,21088,21089,21094,21102,21111,21112,21113,21120,21122,21125,21130,21132,21139,21141,21142,21143,21144,21146,21148,21156,21157,21158,21159,21167,21168,21174,21175,21176,21178,21179,21181,21184,21188,21190,21192,21196,21199,21201,21204,21206,21211,21212,21217,21221,21224,21225,21226,21228,21232,21233,21236,21238,21239,21248,21251,21258,21259,21260,21265,21267,21272,21275,21276,21278,21279,21285,21287,21288,21289,21291,21292,21293,21296,21298,21301,21308,21309,21310,21314,21324,21323,21337,21339,21345,21347,21349,21356,21357,21362,21369,21374,21379,21383,21384,21390,21395,21396,21401,21405,21409,21412,21418,21419,21423,21426,21428,21429,21431,21432,21434,21437,21440,21445,21455,21458,21459,21461,21466,21469,21470,21472,21478,21479,21493,21506,21523,21530,21537,21543,21544,21546,21551,21553,21556,21557,21571,21572,21575,21581,21583,21598,21602,21604,21606,21607,21609,21611,21613,21614,21620,21631,21633,21635,21637,21640,21641,21645,21649,21653,21654,21660,21663,21665,21670,21671,21673,21674,21677,21678,21681,21687,21689,21690,21691,21695,21702,21706,21709,21710,21728,21738,21740,21743,21750,21756,21758,21759,21760,21761,21765,21768,21769,21772,21773,21774,21781,21802,21803,21810,21813,21814,21819,21820,21821,21825,21831,21833,21834,21837,21840,21841,21848,21850,21851,21854,21856,21857,21860,21862,21887,21889,21890,21894,21896,21902,21903,21905,21906,21907,21908,21911,21923,21924,21933,21938,21951,21953,21955,21958,21961,21963,21964,21966,21969,21970,21971,21975,21976,21979,21982,21986,21993,22006,22015,22021,22024,22026,22029,22030,22031,22032,22033,22034,22041,22060,22064,22067,22069,22071,22073,22075,22076,22077,22079,22080,22081,22083,22084,22086,22089,22091,22093,22095,22100,22110,22112,22113,22114,22115,22118,22121,22125,22127,22129,22130,22133,22148,22149,22152,22155,22156,22165,22169,22170,22173,22174,22175,22182,22183,22184,22185,22187,22188,22189,22193,22195,22199,22206,22213,22217,22218,22219,22223,22224,22220,22221,22233,22236,22237,22239,22241,22244,22245,22246,22247,22248,22257,22251,22253,22262,22263,22273,22274,22279,22282,22284,22289,22293,22298,22299,22301,22304,22306,22307,22308,22309,22313,22314,22316,22318,22319,22323,22324,22333,22334,22335,22341,22342,22348,22349,22354,22370,22373,22375,22376,22379,22381,22382,22383,22384,22385,22387,22388,22389,22391,22393,22394,22395,22396,22398,22401,22403,22412,22420,22423,22425,22426,22428,22429,22430,22431,22433,22421,22439,22440,22441,22444,22456,22461,22471,22472,22476,22479,22485,22493,22494,22500,22502,22503,22505,22509,22512,22517,22518,22520,22525,22526,22527,22531,22532,22536,22537,22497,22540,22541,22555,22558,22559,22560,22566,22567,22573,22578,22585,22591,22601,22604,22605,22607,22608,22613,22623,22625,22628,22631,22632,22648,22652,22655,22656,22657,22663,22664,22665,22666,22668,22669,22671,22672,22676,22678,22685,22688,22689,22690,22694,22697,22705,22706,22724,22716,22722,22728,22733,22734,22736,22738,22740,22742,22746,22749,22753,22754,22761,22771,22789,22790,22795,22796,22802,22803,22804,34369,22813,22817,22819,22820,22824,22831,22832,22835,22837,22838,22847,22851,22854,22866,22867,22873,22875,22877,22878,22879,22881,22883,22891,22893,22895,22898,22901,22902,22905,22907,22908,22923,22924,22926,22930,22933,22935,22943,22948,22951,22957,22958,22959,22960,22963,22967,22970,22972,22977,22979,22980,22984,22986,22989,22994,23005,23006,23007,23011,23012,23015,23022,23023,23025,23026,23028,23031,23040,23044,23052,23053,23054,23058,23059,23070,23075,23076,23079,23080,23082,23085,23088,23108,23109,23111,23112,23116,23120,23125,23134,23139,23141,23143,23149,23159,23162,23163,23166,23179,23184,23187,23190,23193,23196,23198,23199,23200,23202,23207,23212,23217,23218,23219,23221,23224,23226,23227,23231,23236,23238,23240,23247,23258,23260,23264,23269,23274,23278,23285,23286,23293,23296,23297,23304,23319,23348,23321,23323,23325,23329,23333,23341,23352,23361,23371,23372,23378,23382,23390,23400,23406,23407,23420,23421,23422,23423,23425,23428,23430,23434,23438,23440,23441,23443,23444,23446,23464,23465,23468,23469,23471,23473,23474,23479,23482,23484,23488,23489,23501,23503,23510,23511,23512,23513,23514,23520,23535,23537,23540,23549,23564,23575,23582,23583,23587,23590,23593,23595,23596,23598,23600,23602,23605,23606,23641,23642,23644,23650,23651,23655,23656,23657,23661,23664,23668,23669,23674,23675,23676,23677,23687,23688,23690,23695,23698,23709,23711,23712,23714,23715,23718,23722,23730,23732,23733,23738,23753,23755,23762,23773,23767,23790,23793,23794,23796,23809,23814,23821,23826,23851,23843,23844,23846,23847,23857,23860,23865,23869,23871,23874,23875,23878,23880,23893,23889,23897,23882,23903,23904,23905,23906,23908,23914,23917,23920,23929,23930,23934,23935,23937,23939,23944,23946,23954,23955,23956,23957,23961,23963,23967,23968,23975,23979,23984,23988,23992,23993,24003,24007,24011,24016,24014,24024,24025,24032,24036,24041,24056,24057,24064,24071,24077,24082,24084,24085,24088,24095,24096,24110,24104,24114,24117,24126,24139,24144,24137,24145,24150,24152,24155,24156,24158,24168,24170,24171,24172,24173,24174,24176,24192,24203,24206,24226,24228,24229,24232,24234,24236,24241,24243,24253,24254,24255,24262,24268,24267,24270,24273,24274,24276,24277,24284,24286,24293,24299,24322,24326,24327,24328,24334,24345,24348,24349,24353,24354,24355,24356,24360,24363,24364,24366,24368,24372,24374,24379,24381,24383,24384,24388,24389,24391,24397,24400,24404,24408,24411,24416,24419,24420,24423,24431,24434,24436,24437,24440,24442,24445,24446,24457,24461,24463,24470,24476,24477,24482,24487,24491,24484,24492,24495,24496,24497,24504,24516,24519,24520,24521,24523,24528,24529,24530,24531,24532,24542,24545,24546,24552,24553,24554,24556,24557,24558,24559,24562,24563,24566,24570,24572,24583,24586,24589,24595,24596,24599,24600,24602,24607,24612,24621,24627,24629,24640,24647,24648,24649,24652,24657,24660,24662,24663,24669,24673,24679,24689,24702,24703,24706,24710,24712,24714,24718,24721,24723,24725,24728,24733,24734,24738,24740,24741,24744,24752,24753,24759,24763,24766,24770,24772,24776,24777,24778,24779,24782,24783,24788,24789,24793,24795,24797,24798,24802,24805,24818,24821,24824,24828,24829,24834,24839,24842,24844,24848,24849,24850,24851,24852,24854,24855,24857,24860,24862,24866,24874,24875,24880,24881,24885,24886,24887,24889,24897,24901,24902,24905,24926,24928,24940,24946,24952,24955,24956,24959,24960,24961,24963,24964,24971,24973,24978,24979,24983,24984,24988,24989,24991,24992,24997,25000,25002,25005,25016,25017,25020,25024,25025,25026,25038,25039,25045,25052,25053,25054,25055,25057,25058,25063,25065,25061,25068,25069,25071,25089,25091,25092,25095,25107,25109,25116,25120,25122,25123,25127,25129,25131,25145,25149,25154,25155,25156,25158,25164,25168,25169,25170,25172,25174,25178,25180,25188,25197,25199,25203,25210,25213,25229,25230,25231,25232,25254,25256,25267,25270,25271,25274,25278,25279,25284,25294,25301,25302,25306,25322,25330,25332,25340,25341,25347,25348,25354,25355,25357,25360,25363,25366,25368,25385,25386,25389,25397,25398,25401,25404,25409,25410,25411,25412,25414,25418,25419,25422,25426,25427,25428,25432,25435,25445,25446,25452,25453,25457,25460,25461,25464,25468,25469,25471,25474,25476,25479,25482,25488,25492,25493,25497,25498,25502,25508,25510,25517,25518,25519,25533,25537,25541,25544,25550,25553,25555,25556,25557,25564,25568,25573,25578,25580,25586,25587,25589,25592,25593,25609,25610,25616,25618,25620,25624,25630,25632,25634,25636,25637,25641,25642,25647,25648,25653,25661,25663,25675,25679,25681,25682,25683,25684,25690,25691,25692,25693,25695,25696,25697,25699,25709,25715,25716,25723,25725,25733,25735,25743,25744,25745,25752,25753,25755,25757,25759,25761,25763,25766,25768,25772,25779,25789,25790,25791,25796,25801,25802,25803,25804,25806,25808,25809,25813,25815,25828,25829,25833,25834,25837,25840,25845,25847,25851,25855,25857,25860,25864,25865,25866,25871,25875,25876,25878,25881,25883,25886,25887,25890,25894,25897,25902,25905,25914,25916,25917,25923,25927,25929,25936,25938,25940,25951,25952,25959,25963,25978,25981,25985,25989,25994,26002,26005,26008,26013,26016,26019,26022,26030,26034,26035,26036,26047,26050,26056,26057,26062,26064,26068,26070,26072,26079,26096,26098,26100,26101,26105,26110,26111,26112,26116,26120,26121,26125,26129,26130,26133,26134,26141,26142,26145,26146,26147,26148,26150,26153,26154,26155,26156,26158,26160,26161,26163,26169,26167,26176,26181,26182,26186,26188,26193,26190,26199,26200,26201,26203,26204,26208,26209,26363,26218,26219,26220,26238,26227,26229,26239,26231,26232,26233,26235,26240,26236,26251,26252,26253,26256,26258,26265,26266,26267,26268,26271,26272,26276,26285,26289,26290,26293,26299,26303,26304,26306,26307,26312,26316,26318,26319,26324,26331,26335,26344,26347,26348,26350,26362,26373,26375,26382,26387,26393,26396,26400,26402,26419,26430,26437,26439,26440,26444,26452,26453,26461,26470,26476,26478,26484,26486,26491,26497,26500,26510,26511,26513,26515,26518,26520,26521,26523,26544,26545,26546,26549,26555,26556,26557,26617,26560,26562,26563,26565,26568,26569,26578,26583,26585,26588,26593,26598,26608,26610,26614,26615,26706,26644,26649,26653,26655,26664,26663,26668,26669,26671,26672,26673,26675,26683,26687,26692,26693,26698,26700,26709,26711,26712,26715,26731,26734,26735,26736,26737,26738,26741,26745,26746,26747,26748,26754,26756,26758,26760,26774,26776,26778,26780,26785,26787,26789,26793,26794,26798,26802,26811,26821,26824,26828,26831,26832,26833,26835,26838,26841,26844,26845,26853,26856,26858,26859,26860,26861,26864,26865,26869,26870,26875,26876,26877,26886,26889,26890,26896,26897,26899,26902,26903,26929,26931,26933,26936,26939,26946,26949,26953,26958,26967,26971,26979,26980,26981,26982,26984,26985,26988,26992,26993,26994,27002,27003,27007,27008,27021,27026,27030,27032,27041,27045,27046,27048,27051,27053,27055,27063,27064,27066,27068,27077,27080,27089,27094,27095,27106,27109,27118,27119,27121,27123,27125,27134,27136,27137,27139,27151,27153,27157,27162,27165,27168,27172,27176,27184,27186,27188,27191,27195,27198,27199,27205,27206,27209,27210,27214,27216,27217,27218,27221,27222,27227,27236,27239,27242,27249,27251,27262,27265,27267,27270,27271,27273,27275,27281,27291,27293,27294,27295,27301,27307,27311,27312,27313,27316,27325,27326,27327,27334,27337,27336,27340,27344,27348,27349,27350,27356,27357,27364,27367,27372,27376,27377,27378,27388,27389,27394,27395,27398,27399,27401,27407,27408,27409,27415,27419,27422,27428,27432,27435,27436,27439,27445,27446,27451,27455,27462,27466,27469,27474,27478,27480,27485,27488,27495,27499,27502,27504,27509,27517,27518,27522,27525,27543,27547,27551,27552,27554,27555,27560,27561,27564,27565,27566,27568,27576,27577,27581,27582,27587,27588,27593,27596,27606,27610,27617,27619,27622,27623,27630,27633,27639,27641,27647,27650,27652,27653,27657,27661,27662,27664,27666,27673,27679,27686,27687,27688,27692,27694,27699,27701,27702,27706,27707,27711,27722,27723,27725,27727,27730,27732,27737,27739,27740,27755,27757,27759,27764,27766,27768,27769,27771,27781,27782,27783,27785,27796,27797,27799,27800,27804,27807,27824,27826,27828,27842,27846,27853,27855,27856,27857,27858,27860,27862,27866,27868,27872,27879,27881,27883,27884,27886,27890,27892,27908,27911,27914,27918,27919,27921,27923,27930,27942,27943,27944,27751,27950,27951,27953,27961,27964,27967,27991,27998,27999,28001,28005,28007,28015,28016,28028,28034,28039,28049,28050,28052,28054,28055,28056,28074,28076,28084,28087,28089,28093,28095,28100,28104,28106,28110,28111,28118,28123,28125,28127,28128,28130,28133,28137,28143,28144,28148,28150,28156,28160,28164,28190,28194,28199,28210,28214,28217,28219,28220,28228,28229,28232,28233,28235,28239,28241,28242,28243,28244,28247,28252,28253,28254,28258,28259,28264,28275,28283,28285,28301,28307,28313,28320,28327,28333,28334,28337,28339,28347,28351,28352,28353,28355,28359,28360,28362,28365,28366,28367,28395,28397,28398,28409,28411,28413,28420,28424,28426,28428,28429,28438,28440,28442,28443,28454,28457,28458,28463,28464,28467,28470,28475,28476,28461,28495,28497,28498,28499,28503,28505,28506,28509,28510,28513,28514,28520,28524,28541,28542,28547,28551,28552,28555,28556,28557,28560,28562,28563,28564,28566,28570,28575,28576,28581,28582,28583,28584,28590,28591,28592,28597,28598,28604,28613,28615,28616,28618,28634,28638,28648,28649,28656,28661,28665,28668,28669,28672,28677,28678,28679,28685,28695,28704,28707,28719,28724,28727,28729,28732,28739,28740,28744,28745,28746,28747,28756,28757,28765,28766,28750,28772,28773,28780,28782,28789,28790,28798,28801,28805,28806,28820,28821,28822,28823,28824,28827,28836,28843,28848,28849,28852,28855,28874,28881,28883,28884,28885,28886,28888,28892,28900,28922,28931,28932,28933,28934,28935,28939,28940,28943,28958,28960,28971,28973,28975,28976,28977,28984,28993,28997,28998,28999,29002,29003,29008,29010,29015,29018,29020,29022,29024,29032,29049,29056,29061,29063,29068,29074,29082,29083,29088,29090,29103,29104,29106,29107,29114,29119,29120,29121,29124,29131,29132,29139,29142,29145,29146,29148,29176,29182,29184,29191,29192,29193,29203,29207,29210,29213,29215,29220,29227,29231,29236,29240,29241,29249,29250,29251,29253,29262,29263,29264,29267,29269,29270,29274,29276,29278,29280,29283,29288,29291,29294,29295,29297,29303,29304,29307,29308,29311,29316,29321,29325,29326,29331,29339,29352,29357,29358,29361,29364,29374,29377,29383,29385,29388,29397,29398,29400,29407,29413,29427,29428,29434,29435,29438,29442,29444,29445,29447,29451,29453,29458,29459,29464,29465,29470,29474,29476,29479,29480,29484,29489,29490,29493,29498,29499,29501,29507,29517,29520,29522,29526,29528,29533,29534,29535,29536,29542,29543,29545,29547,29548,29550,29551,29553,29559,29561,29564,29568,29569,29571,29573,29574,29582,29584,29587,29589,29591,29592,29596,29598,29599,29600,29602,29605,29606,29610,29611,29613,29621,29623,29625,29628,29629,29631,29637,29638,29641,29643,29644,29647,29650,29651,29654,29657,29661,29665,29667,29670,29671,29673,29684,29685,29687,29689,29690,29691,29693,29695,29696,29697,29700,29703,29706,29713,29722,29723,29732,29734,29736,29737,29738,29739,29740,29741,29742,29743,29744,29745,29753,29760,29763,29764,29766,29767,29771,29773,29777,29778,29783,29789,29794,29798,29799,29800,29803,29805,29806,29809,29810,29824,29825,29829,29830,29831,29833,29839,29840,29841,29842,29848,29849,29850,29852,29855,29856,29857,29859,29862,29864,29865,29866,29867,29870,29871,29873,29874,29877,29881,29883,29887,29896,29897,29900,29904,29907,29912,29914,29915,29918,29919,29924,29928,29930,29931,29935,29940,29946,29947,29948,29951,29958,29970,29974,29975,29984,29985,29988,29991,29993,29994,29999,30006,30009,30013,30014,30015,30016,30019,30023,30024,30030,30032,30034,30039,30046,30047,30049,30063,30065,30073,30074,30075,30076,30077,30078,30081,30085,30096,30098,30099,30101,30105,30108,30114,30116,30132,30138,30143,30144,30145,30148,30150,30156,30158,30159,30167,30172,30175,30176,30177,30180,30183,30188,30190,30191,30193,30201,30208,30210,30211,30212,30215,30216,30218,30220,30223,30226,30227,30229,30230,30233,30235,30236,30237,30238,30243,30245,30246,30249,30253,30258,30259,30261,30264,30265,30266,30268,30282,30272,30273,30275,30276,30277,30281,30283,30293,30297,30303,30308,30309,30317,30318,30319,30321,30324,30337,30341,30348,30349,30357,30363,30364,30365,30367,30368,30370,30371,30372,30373,30374,30375,30376,30378,30381,30397,30401,30405,30409,30411,30412,30414,30420,30425,30432,30438,30440,30444,30448,30449,30454,30457,30460,30464,30470,30474,30478,30482,30484,30485,30487,30489,30490,30492,30498,30504,30509,30510,30511,30516,30517,30518,30521,30525,30526,30530,30533,30534,30538,30541,30542,30543,30546,30550,30551,30556,30558,30559,30560,30562,30564,30567,30570,30572,30576,30578,30579,30580,30586,30589,30592,30596,30604,30605,30612,30613,30614,30618,30623,30626,30631,30634,30638,30639,30641,30645,30654,30659,30665,30673,30674,30677,30681,30686,30687,30688,30692,30694,30698,30700,30704,30705,30708,30712,30715,30725,30726,30729,30733,30734,30737,30749,30753,30754,30755,30765,30766,30768,30773,30775,30787,30788,30791,30792,30796,30798,30802,30812,30814,30816,30817,30819,30820,30824,30826,30830,30842,30846,30858,30863,30868,30872,30881,30877,30878,30879,30884,30888,30892,30893,30896,30897,30898,30899,30907,30909,30911,30919,30920,30921,30924,30926,30930,30931,30933,30934,30948,30939,30943,30944,30945,30950,30954,30962,30963,30976,30966,30967,30970,30971,30975,30982,30988,30992,31002,31004,31006,31007,31008,31013,31015,31017,31021,31025,31028,31029,31035,31037,31039,31044,31045,31046,31050,31051,31055,31057,31060,31064,31067,31068,31079,31081,31083,31090,31097,31099,31100,31102,31115,31116,31121,31123,31124,31125,31126,31128,31131,31132,31137,31144,31145,31147,31151,31153,31156,31160,31163,31170,31172,31175,31176,31178,31183,31188,31190,31194,31197,31198,31200,31202,31205,31210,31211,31213,31217,31224,31228,31234,31235,31239,31241,31242,31244,31249,31253,31259,31262,31265,31271,31275,31277,31279,31280,31284,31285,31288,31289,31290,31300,31301,31303,31304,31308,31317,31318,31321,31324,31325,31327,31328,31333,31335,31338,31341,31349,31352,31358,31360,31362,31365,31366,31370,31371,31376,31377,31380,31390,31392,31395,31404,31411,31413,31417,31419,31420,31430,31433,31436,31438,31441,31451,31464,31465,31467,31468,31473,31476,31483,31485,31486,31495,31508,31519,31523,31527,31529,31530,31531,31533,31534,31535,31536,31537,31540,31549,31551,31552,31553,31559,31566,31573,31584,31588,31590,31593,31594,31597,31599,31602,31603,31607,31620,31625,31630,31632,31633,31638,31643,31646,31648,31653,31660,31663,31664,31666,31669,31670,31674,31675,31676,31677,31682,31685,31688,31690,31700,31702,31703,31705,31706,31707,31720,31722,31730,31732,31733,31736,31737,31738,31740,31742,31745,31746,31747,31748,31750,31753,31755,31756,31758,31759,31769,31771,31776,31781,31782,31784,31788,31793,31795,31796,31798,31801,31802,31814,31818,31829,31825,31826,31827,31833,31834,31835,31836,31837,31838,31841,31843,31847,31849,31853,31854,31856,31858,31865,31868,31869,31878,31879,31887,31892,31902,31904,31910,31920,31926,31927,31930,31931,31932,31935,31940,31943,31944,31945,31949,31951,31955,31956,31957,31959,31961,31962,31965,31974,31977,31979,31989,32003,32007,32008,32009,32015,32017,32018,32019,32022,32029,32030,32035,32038,32042,32045,32049,32060,32061,32062,32064,32065,32071,32072,32077,32081,32083,32087,32089,32090,32092,32093,32101,32103,32106,32112,32120,32122,32123,32127,32129,32130,32131,32133,32134,32136,32139,32140,32141,32145,32150,32151,32157,32158,32166,32167,32170,32179,32182,32183,32185,32194,32195,32196,32197,32198,32204,32205,32206,32215,32217,32256,32226,32229,32230,32234,32235,32237,32241,32245,32246,32249,32250,32264,32272,32273,32277,32279,32284,32285,32288,32295,32296,32300,32301,32303,32307,32310,32319,32324,32325,32327,32334,32336,32338,32344,32351,32353,32354,32357,32363,32366,32367,32371,32376,32382,32385,32390,32391,32394,32397,32401,32405,32408,32410,32413,32414,32572,32571,32573,32574,32575,32579,32580,32583,32591,32594,32595,32603,32604,32605,32609,32611,32612,32613,32614,32621,32625,32637,32638,32639,32640,32651,32653,32655,32656,32657,32662,32663,32668,32673,32674,32678,32682,32685,32692,32700,32703,32704,32707,32712,32718,32719,32731,32735,32739,32741,32744,32748,32750,32751,32754,32762,32765,32766,32767,32775,32776,32778,32781,32782,32783,32785,32787,32788,32790,32797,32798,32799,32800,32804,32806,32812,32814,32816,32820,32821,32823,32825,32826,32828,32830,32832,32836,32864,32868,32870,32877,32881,32885,32897,32904,32910,32924,32926,32934,32935,32939,32952,32953,32968,32973,32975,32978,32980,32981,32983,32984,32992,33005,33006,33008,33010,33011,33014,33017,33018,33022,33027,33035,33046,33047,33048,33052,33054,33056,33060,33063,33068,33072,33077,33082,33084,33093,33095,33098,33100,33106,33111,33120,33121,33127,33128,33129,33133,33135,33143,33153,33168,33156,33157,33158,33163,33166,33174,33176,33179,33182,33186,33198,33202,33204,33211,33227,33219,33221,33226,33230,33231,33237,33239,33243,33245,33246,33249,33252,33259,33260,33264,33265,33266,33269,33270,33272,33273,33277,33279,33280,33283,33295,33299,33300,33305,33306,33309,33313,33314,33320,33330,33332,33338,33347,33348,33349,33350,33355,33358,33359,33361,33366,33372,33376,33379,33383,33389,33396,33403,33405,33407,33408,33409,33411,33412,33415,33417,33418,33422,33425,33428,33430,33432,33434,33435,33440,33441,33443,33444,33447,33448,33449,33450,33454,33456,33458,33460,33463,33466,33468,33470,33471,33478,33488,33493,33498,33504,33506,33508,33512,33514,33517,33519,33526,33527,33533,33534,33536,33537,33543,33544,33546,33547,33620,33563,33565,33566,33567,33569,33570,33580,33581,33582,33584,33587,33591,33594,33596,33597,33602,33603,33604,33607,33613,33614,33617,33621,33622,33623,33648,33656,33661,33663,33664,33666,33668,33670,33677,33682,33684,33685,33688,33689,33691,33692,33693,33702,33703,33705,33708,33726,33727,33728,33735,33737,33743,33744,33745,33748,33757,33619,33768,33770,33782,33784,33785,33788,33793,33798,33802,33807,33809,33813,33817,33709,33839,33849,33861,33863,33864,33866,33869,33871,33873,33874,33878,33880,33881,33882,33884,33888,33892,33893,33895,33898,33904,33907,33908,33910,33912,33916,33917,33921,33925,33938,33939,33941,33950,33958,33960,33961,33962,33967,33969,33972,33978,33981,33982,33984,33986,33991,33992,33996,33999,34003,34012,34023,34026,34031,34032,34033,34034,34039,34098,34042,34043,34045,34050,34051,34055,34060,34062,34064,34076,34078,34082,34083,34084,34085,34087,34090,34091,34095,34099,34100,34102,34111,34118,34127,34128,34129,34130,34131,34134,34137,34140,34141,34142,34143,34144,34145,34146,34148,34155,34159,34169,34170,34171,34173,34175,34177,34181,34182,34185,34187,34188,34191,34195,34200,34205,34207,34208,34210,34213,34215,34228,34230,34231,34232,34236,34237,34238,34239,34242,34247,34250,34251,34254,34221,34264,34266,34271,34272,34278,34280,34285,34291,34294,34300,34303,34304,34308,34309,34317,34318,34320,34321,34322,34328,34329,34331,34334,34337,34343,34345,34358,34360,34362,34364,34365,34368,34370,34374,34386,34387,34390,34391,34392,34393,34397,34400,34401,34402,34403,34404,34409,34412,34415,34421,34422,34423,34426,34445,34449,34454,34456,34458,34460,34465,34470,34471,34472,34477,34481,34483,34484,34485,34487,34488,34489,34495,34496,34497,34499,34501,34513,34514,34517,34519,34522,34524,34528,34531,34533,34535,34440,34554,34556,34557,34564,34565,34567,34571,34574,34575,34576,34579,34580,34585,34590,34591,34593,34595,34600,34606,34607,34609,34610,34617,34618,34620,34621,34622,34624,34627,34629,34637,34648,34653,34657,34660,34661,34671,34673,34674,34683,34691,34692,34693,34694,34695,34696,34697,34699,34700,34704,34707,34709,34711,34712,34713,34718,34720,34723,34727,34732,34733,34734,34737,34741,34750,34751,34753,34760,34761,34762,34766,34773,34774,34777,34778,34780,34783,34786,34787,34788,34794,34795,34797,34801,34803,34808,34810,34815,34817,34819,34822,34825,34826,34827,34832,34841,34834,34835,34836,34840,34842,34843,34844,34846,34847,34856,34861,34862,34864,34866,34869,34874,34876,34881,34883,34885,34888,34889,34890,34891,34894,34897,34901,34902,34904,34906,34908,34911,34912,34916,34921,34929,34937,34939,34944,34968,34970,34971,34972,34975,34976,34984,34986,35002,35005,35006,35008,35018,35019,35020,35021,35022,35025,35026,35027,35035,35038,35047,35055,35056,35057,35061,35063,35073,35078,35085,35086,35087,35093,35094,35096,35097,35098,35100,35104,35110,35111,35112,35120,35121,35122,35125,35129,35130,35134,35136,35138,35141,35142,35145,35151,35154,35159,35162,35163,35164,35169,35170,35171,35179,35182,35184,35187,35189,35194,35195,35196,35197,35209,35213,35216,35220,35221,35227,35228,35231,35232,35237,35248,35252,35253,35254,35255,35260,35284,35285,35286,35287,35288,35301,35305,35307,35309,35313,35315,35318,35321,35325,35327,35332,35333,35335,35343,35345,35346,35348,35349,35358,35360,35362,35364,35366,35371,35372,35375,35381,35383,35389,35390,35392,35395,35397,35399,35401,35405,35406,35411,35414,35415,35416,35420,35421,35425,35429,35431,35445,35446,35447,35449,35450,35451,35454,35455,35456,35459,35462,35467,35471,35472,35474,35478,35479,35481,35487,35495,35497,35502,35503,35507,35510,35511,35515,35518,35523,35526,35528,35529,35530,35537,35539,35540,35541,35543,35549,35551,35564,35568,35572,35573,35574,35580,35583,35589,35590,35595,35601,35612,35614,35615,35594,35629,35632,35639,35644,35650,35651,35652,35653,35654,35656,35666,35667,35668,35673,35661,35678,35683,35693,35702,35704,35705,35708,35710,35713,35716,35717,35723,35725,35727,35732,35733,35740,35742,35743,35896,35897,35901,35902,35909,35911,35913,35915,35919,35921,35923,35924,35927,35928,35931,35933,35929,35939,35940,35942,35944,35945,35949,35955,35957,35958,35963,35966,35974,35975,35979,35984,35986,35987,35993,35995,35996,36004,36025,36026,36037,36038,36041,36043,36047,36054,36053,36057,36061,36065,36072,36076,36079,36080,36082,36085,36087,36088,36094,36095,36097,36099,36105,36114,36119,36123,36197,36201,36204,36206,36223,36226,36228,36232,36237,36240,36241,36245,36254,36255,36256,36262,36267,36268,36271,36274,36277,36279,36281,36283,36288,36293,36294,36295,36296,36298,36302,36305,36308,36309,36311,36313,36324,36325,36327,36332,36336,36284,36337,36338,36340,36349,36353,36356,36357,36358,36363,36369,36372,36374,36384,36385,36386,36387,36390,36391,36401,36403,36406,36407,36408,36409,36413,36416,36417,36427,36429,36430,36431,36436,36443,36444,36445,36446,36449,36450,36457,36460,36461,36463,36464,36465,36473,36474,36475,36482,36483,36489,36496,36498,36501,36506,36507,36509,36510,36514,36519,36521,36525,36526,36531,36533,36538,36539,36544,36545,36547,36548,36551,36559,36561,36564,36572,36584,36590,36592,36593,36599,36601,36602,36589,36608,36610,36615,36616,36623,36624,36630,36631,36632,36638,36640,36641,36643,36645,36647,36648,36652,36653,36654,36660,36661,36662,36663,36666,36672,36673,36675,36679,36687,36689,36690,36691,36692,36693,36696,36701,36702,36709,36765,36768,36769,36772,36773,36774,36789,36790,36792,36798,36800,36801,36806,36810,36811,36813,36816,36818,36819,36821,36832,36835,36836,36840,36846,36849,36853,36854,36859,36862,36866,36868,36872,36876,36888,36891,36904,36905,36911,36906,36908,36909,36915,36916,36919,36927,36931,36932,36940,36955,36957,36962,36966,36967,36972,36976,36980,36985,36997,37000,37003,37004,37006,37008,37013,37015,37016,37017,37019,37024,37025,37026,37029,37040,37042,37043,37044,37046,37053,37068,37054,37059,37060,37061,37063,37064,37077,37079,37080,37081,37084,37085,37087,37093,37074,37110,37099,37103,37104,37108,37118,37119,37120,37124,37125,37126,37128,37133,37136,37140,37142,37143,37144,37146,37148,37150,37152,37157,37154,37155,37159,37161,37166,37167,37169,37172,37174,37175,37177,37178,37180,37181,37187,37191,37192,37199,37203,37207,37209,37210,37211,37217,37220,37223,37229,37236,37241,37242,37243,37249,37251,37253,37254,37258,37262,37265,37267,37268,37269,37272,37278,37281,37286,37288,37292,37293,37294,37296,37297,37298,37299,37302,37307,37308,37309,37311,37314,37315,37317,37331,37332,37335,37337,37338,37342,37348,37349,37353,37354,37356,37357,37358,37359,37360,37361,37367,37369,37371,37373,37376,37377,37380,37381,37382,37383,37385,37386,37388,37392,37394,37395,37398,37400,37404,37405,37411,37412,37413,37414,37416,37422,37423,37424,37427,37429,37430,37432,37433,37434,37436,37438,37440,37442,37443,37446,37447,37450,37453,37454,37455,37457,37464,37465,37468,37469,37472,37473,37477,37479,37480,37481,37486,37487,37488,37493,37494,37495,37496,37497,37499,37500,37501,37503,37512,37513,37514,37517,37518,37522,37527,37529,37535,37536,37540,37541,37543,37544,37547,37551,37554,37558,37560,37562,37563,37564,37565,37567,37568,37569,37570,37571,37573,37574,37575,37576,37579,37580,37581,37582,37584,37587,37589,37591,37592,37593,37596,37597,37599,37600,37601,37603,37605,37607,37608,37612,37614,37616,37625,37627,37631,37632,37634,37640,37645,37649,37652,37653,37660,37661,37662,37663,37665,37668,37669,37671,37673,37674,37683,37684,37686,37687,37703,37704,37705,37712,37713,37714,37717,37719,37720,37722,37726,37732,37733,37735,37737,37738,37741,37743,37744,37745,37747,37748,37750,37754,37757,37759,37760,37761,37762,37768,37770,37771,37773,37775,37778,37781,37784,37787,37790,37793,37795,37796,37798,37800,37803,37812,37813,37814,37818,37801,37825,37828,37829,37830,37831,37833,37834,37835,37836,37837,37843,37849,37852,37854,37855,37858,37862,37863,37881,37879,37880,37882,37883,37885,37889,37890,37892,37896,37897,37901,37902,37903,37909,37910,37911,37919,37934,37935,37937,37938,37939,37940,37947,37951,37949,37955,37957,37960,37962,37964,37973,37977,37980,37983,37985,37987,37992,37995,37997,37998,37999,38001,38002,38020,38019,38264,38265,38270,38276,38280,38284,38285,38286,38301,38302,38303,38305,38310,38313,38315,38316,38324,38326,38330,38333,38335,38342,38344,38345,38347,38352,38353,38354,38355,38361,38362,38365,38366,38367,38368,38372,38374,38429,38430,38434,38436,38437,38438,38444,38449,38451,38455,38456,38457,38458,38460,38461,38465,38482,38484,38486,38487,38488,38497,38510,38516,38523,38524,38526,38527,38529,38530,38531,38532,38537,38545,38550,38554,38557,38559,38564,38565,38566,38569,38574,38575,38579,38586,38602,38610,23986,38616,38618,38621,38622,38623,38633,38639,38641,38650,38658,38659,38661,38665,38682,38683,38685,38689,38690,38691,38696,38705,38707,38721,38723,38730,38734,38735,38741,38743,38744,38746,38747,38755,38759,38762,38766,38771,38774,38775,38776,38779,38781,38783,38784,38793,38805,38806,38807,38809,38810,38814,38815,38818,38828,38830,38833,38834,38837,38838,38840,38841,38842,38844,38846,38847,38849,38852,38853,38855,38857,38858,38860,38861,38862,38864,38865,38868,38871,38872,38873,38877,38878,38880,38875,38881,38884,38895,38897,38900,38903,38904,38906,38919,38922,38937,38925,38926,38932,38934,38940,38942,38944,38947,38950,38955,38958,38959,38960,38962,38963,38965,38949,38974,38980,38983,38986,38993,38994,38995,38998,38999,39001,39002,39010,39011,39013,39014,39018,39020,39083,39085,39086,39088,39092,39095,39096,39098,39099,39103,39106,39109,39112,39116,39137,39139,39141,39142,39143,39146,39155,39158,39170,39175,39176,39185,39189,39190,39191,39194,39195,39196,39199,39202,39206,39207,39211,39217,39218,39219,39220,39221,39225,39226,39227,39228,39232,39233,39238,39239,39240,39245,39246,39252,39256,39257,39259,39260,39262,39263,39264,39323,39325,39327,39334,39344,39345,39346,39349,39353,39354,39357,39359,39363,39369,39379,39380,39385,39386,39388,39390,39399,39402,39403,39404,39408,39412,39413,39417,39421,39422,39426,39427,39428,39435,39436,39440,39441,39446,39454,39456,39458,39459,39460,39463,39469,39470,39475,39477,39478,39480,39495,39489,39492,39498,39499,39500,39502,39505,39508,39510,39517,39594,39596,39598,39599,39602,39604,39605,39606,39609,39611,39614,39615,39617,39619,39622,39624,39630,39632,39634,39637,39638,39639,39643,39644,39648,39652,39653,39655,39657,39660,39666,39667,39669,39673,39674,39677,39679,39680,39681,39682,39683,39684,39685,39688,39689,39691,39692,39693,39694,39696,39698,39702,39705,39707,39708,39712,39718,39723,39725,39731,39732,39733,39735,39737,39738,39741,39752,39755,39756,39765,39766,39767,39771,39774,39777,39779,39781,39782,39784,39786,39787,39788,39789,39790,39795,39797,39799,39800,39801,39807,39808,39812,39813,39814,39815,39817,39818,39819,39821,39823,39824,39828,39834,39837,39838,39846,39847,39849,39852,39856,39857,39858,39863,39864,39867,39868,39870,39871,39873,39879,39880,39886,39888,39895,39896,39901,39903,39909,39911,39914,39915,39919,39923,39927,39928,39929,39930,39933,39935,39936,39938,39947,39951,39953,39958,39960,39961,39962,39964,39966,39970,39971,39974,39975,39976,39977,39978,39985,39989,39990,39991,39997,40001,40003,40004,40005,40009,40010,40014,40015,40016,40019,40020,40022,40024,40027,40029,40030,40031,40035,40041,40042,40028,40043,40040,40046,40048,40050,40053,40055,40059,40166,40178,40183,40185,40203,40194,40209,40215,40216,40220,40221,40222,40239,40240,40242,40243,40244,40250,40252,40261,40253,40258,40259,40263,40266,40275,40276,40287,40291,40290,40293,40297,40298,40299,40304,40310,40311,40315,40316,40318,40323,40324,40326,40330,40333,40334,40338,40339,40341,40342,40343,40344,40353,40362,40364,40366,40369,40373,40377,40380,40383,40387,40391,40393,40394,40404,40405,40406,40407,40410,40414,40415,40416,40421,40423,40425,40427,40430,40432,40435,40436,40446,40458,40450,40455,40462,40464,40465,40466,40469,40470,40473,40476,40477,40570,40571,40572,40576,40578,40579,40580,40581,40583,40590,40591,40598,40600,40603,40606,40612,40616,40620,40622,40623,40624,40627,40628,40629,40646,40648,40651,40661,40671,40676,40679,40684,40685,40686,40688,40689,40690,40693,40696,40703,40706,40707,40713,40719,40720,40721,40722,40724,40726,40727,40729,40730,40731,40735,40738,40742,40746,40747,40751,40753,40754,40756,40759,40761,40762,40764,40765,40767,40769,40771,40772,40773,40774,40775,40787,40789,40790,40791,40792,40794,40797,40798,40808,40809,40813,40814,40815,40816,40817,40819,40821,40826,40829,40847,40848,40849,40850,40852,40854,40855,40862,40865,40866,40867,40869,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null], - 'ibm866': [1040,1041,1042,1043,1044,1045,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,1072,1073,1074,1075,1076,1077,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,9617,9618,9619,9474,9508,9569,9570,9558,9557,9571,9553,9559,9565,9564,9563,9488,9492,9524,9516,9500,9472,9532,9566,9567,9562,9556,9577,9574,9568,9552,9580,9575,9576,9572,9573,9561,9560,9554,9555,9579,9578,9496,9484,9608,9604,9612,9616,9600,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,1103,1025,1105,1028,1108,1031,1111,1038,1118,176,8729,183,8730,8470,164,9632,160], - 'iso-8859-2': [128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,260,728,321,164,317,346,167,168,352,350,356,377,173,381,379,176,261,731,322,180,318,347,711,184,353,351,357,378,733,382,380,340,193,194,258,196,313,262,199,268,201,280,203,282,205,206,270,272,323,327,211,212,336,214,215,344,366,218,368,220,221,354,223,341,225,226,259,228,314,263,231,269,233,281,235,283,237,238,271,273,324,328,243,244,337,246,247,345,367,250,369,252,253,355,729], - 'iso-8859-3': [128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,294,728,163,164,null,292,167,168,304,350,286,308,173,null,379,176,295,178,179,180,181,293,183,184,305,351,287,309,189,null,380,192,193,194,null,196,266,264,199,200,201,202,203,204,205,206,207,null,209,210,211,212,288,214,215,284,217,218,219,220,364,348,223,224,225,226,null,228,267,265,231,232,233,234,235,236,237,238,239,null,241,242,243,244,289,246,247,285,249,250,251,252,365,349,729], - 'iso-8859-4': [128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,260,312,342,164,296,315,167,168,352,274,290,358,173,381,175,176,261,731,343,180,297,316,711,184,353,275,291,359,330,382,331,256,193,194,195,196,197,198,302,268,201,280,203,278,205,206,298,272,325,332,310,212,213,214,215,216,370,218,219,220,360,362,223,257,225,226,227,228,229,230,303,269,233,281,235,279,237,238,299,273,326,333,311,244,245,246,247,248,371,250,251,252,361,363,729], - 'iso-8859-5': [128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,1025,1026,1027,1028,1029,1030,1031,1032,1033,1034,1035,1036,173,1038,1039,1040,1041,1042,1043,1044,1045,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,1072,1073,1074,1075,1076,1077,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,1103,8470,1105,1106,1107,1108,1109,1110,1111,1112,1113,1114,1115,1116,167,1118,1119], - 'iso-8859-6': [128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,null,null,null,164,null,null,null,null,null,null,null,1548,173,null,null,null,null,null,null,null,null,null,null,null,null,null,1563,null,null,null,1567,null,1569,1570,1571,1572,1573,1574,1575,1576,1577,1578,1579,1580,1581,1582,1583,1584,1585,1586,1587,1588,1589,1590,1591,1592,1593,1594,null,null,null,null,null,1600,1601,1602,1603,1604,1605,1606,1607,1608,1609,1610,1611,1612,1613,1614,1615,1616,1617,1618,null,null,null,null,null,null,null,null,null,null,null,null,null], - 'iso-8859-7': [128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,8216,8217,163,8364,8367,166,167,168,169,890,171,172,173,null,8213,176,177,178,179,900,901,902,183,904,905,906,187,908,189,910,911,912,913,914,915,916,917,918,919,920,921,922,923,924,925,926,927,928,929,null,931,932,933,934,935,936,937,938,939,940,941,942,943,944,945,946,947,948,949,950,951,952,953,954,955,956,957,958,959,960,961,962,963,964,965,966,967,968,969,970,971,972,973,974,null], - 'iso-8859-8': [128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,null,162,163,164,165,166,167,168,169,215,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,247,187,188,189,190,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,8215,1488,1489,1490,1491,1492,1493,1494,1495,1496,1497,1498,1499,1500,1501,1502,1503,1504,1505,1506,1507,1508,1509,1510,1511,1512,1513,1514,null,null,8206,8207,null], - 'iso-8859-10': [128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,260,274,290,298,296,310,167,315,272,352,358,381,173,362,330,176,261,275,291,299,297,311,183,316,273,353,359,382,8213,363,331,256,193,194,195,196,197,198,302,268,201,280,203,278,205,206,207,208,325,332,211,212,213,214,360,216,370,218,219,220,221,222,223,257,225,226,227,228,229,230,303,269,233,281,235,279,237,238,239,240,326,333,243,244,245,246,361,248,371,250,251,252,253,254,312], - 'iso-8859-13': [128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,8221,162,163,164,8222,166,167,216,169,342,171,172,173,174,198,176,177,178,179,8220,181,182,183,248,185,343,187,188,189,190,230,260,302,256,262,196,197,280,274,268,201,377,278,290,310,298,315,352,323,325,211,332,213,214,215,370,321,346,362,220,379,381,223,261,303,257,263,228,229,281,275,269,233,378,279,291,311,299,316,353,324,326,243,333,245,246,247,371,322,347,363,252,380,382,8217], - 'iso-8859-14': [128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,7682,7683,163,266,267,7690,167,7808,169,7810,7691,7922,173,174,376,7710,7711,288,289,7744,7745,182,7766,7809,7767,7811,7776,7923,7812,7813,7777,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,372,209,210,211,212,213,214,7786,216,217,218,219,220,221,374,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,373,241,242,243,244,245,246,7787,248,249,250,251,252,253,375,255], - 'iso-8859-15': [128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,8364,165,352,167,353,169,170,171,172,173,174,175,176,177,178,179,381,181,182,183,382,185,186,187,338,339,376,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255], - 'iso-8859-16': [128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,260,261,321,8364,8222,352,167,353,169,536,171,377,173,378,379,176,177,268,322,381,8221,182,183,382,269,537,187,338,339,376,380,192,193,194,258,196,262,198,199,200,201,202,203,204,205,206,207,272,323,210,211,212,336,214,346,368,217,218,219,220,280,538,223,224,225,226,259,228,263,230,231,232,233,234,235,236,237,238,239,273,324,242,243,244,337,246,347,369,249,250,251,252,281,539,255], - 'koi8-r': [9472,9474,9484,9488,9492,9496,9500,9508,9516,9524,9532,9600,9604,9608,9612,9616,9617,9618,9619,8992,9632,8729,8730,8776,8804,8805,160,8993,176,178,183,247,9552,9553,9554,1105,9555,9556,9557,9558,9559,9560,9561,9562,9563,9564,9565,9566,9567,9568,9569,1025,9570,9571,9572,9573,9574,9575,9576,9577,9578,9579,9580,169,1102,1072,1073,1094,1076,1077,1092,1075,1093,1080,1081,1082,1083,1084,1085,1086,1087,1103,1088,1089,1090,1091,1078,1074,1100,1099,1079,1096,1101,1097,1095,1098,1070,1040,1041,1062,1044,1045,1060,1043,1061,1048,1049,1050,1051,1052,1053,1054,1055,1071,1056,1057,1058,1059,1046,1042,1068,1067,1047,1064,1069,1065,1063,1066], - 'koi8-u': [9472,9474,9484,9488,9492,9496,9500,9508,9516,9524,9532,9600,9604,9608,9612,9616,9617,9618,9619,8992,9632,8729,8730,8776,8804,8805,160,8993,176,178,183,247,9552,9553,9554,1105,1108,9556,1110,1111,9559,9560,9561,9562,9563,1169,1118,9566,9567,9568,9569,1025,1028,9571,1030,1031,9574,9575,9576,9577,9578,1168,1038,169,1102,1072,1073,1094,1076,1077,1092,1075,1093,1080,1081,1082,1083,1084,1085,1086,1087,1103,1088,1089,1090,1091,1078,1074,1100,1099,1079,1096,1101,1097,1095,1098,1070,1040,1041,1062,1044,1045,1060,1043,1061,1048,1049,1050,1051,1052,1053,1054,1055,1071,1056,1057,1058,1059,1046,1042,1068,1067,1047,1064,1069,1065,1063,1066], - 'macintosh': [196,197,199,201,209,214,220,225,224,226,228,227,229,231,233,232,234,235,237,236,238,239,241,243,242,244,246,245,250,249,251,252,8224,176,162,163,167,8226,182,223,174,169,8482,180,168,8800,198,216,8734,177,8804,8805,165,181,8706,8721,8719,960,8747,170,186,937,230,248,191,161,172,8730,402,8776,8710,171,187,8230,160,192,195,213,338,339,8211,8212,8220,8221,8216,8217,247,9674,255,376,8260,8364,8249,8250,64257,64258,8225,183,8218,8222,8240,194,202,193,203,200,205,206,207,204,211,212,63743,210,218,219,217,305,710,732,175,728,729,730,184,733,731,711], - 'windows-874': [8364,129,130,131,132,8230,134,135,136,137,138,139,140,141,142,143,144,8216,8217,8220,8221,8226,8211,8212,152,153,154,155,156,157,158,159,160,3585,3586,3587,3588,3589,3590,3591,3592,3593,3594,3595,3596,3597,3598,3599,3600,3601,3602,3603,3604,3605,3606,3607,3608,3609,3610,3611,3612,3613,3614,3615,3616,3617,3618,3619,3620,3621,3622,3623,3624,3625,3626,3627,3628,3629,3630,3631,3632,3633,3634,3635,3636,3637,3638,3639,3640,3641,3642,null,null,null,null,3647,3648,3649,3650,3651,3652,3653,3654,3655,3656,3657,3658,3659,3660,3661,3662,3663,3664,3665,3666,3667,3668,3669,3670,3671,3672,3673,3674,3675,null,null,null,null], - 'windows-1250': [8364,129,8218,131,8222,8230,8224,8225,136,8240,352,8249,346,356,381,377,144,8216,8217,8220,8221,8226,8211,8212,152,8482,353,8250,347,357,382,378,160,711,728,321,164,260,166,167,168,169,350,171,172,173,174,379,176,177,731,322,180,181,182,183,184,261,351,187,317,733,318,380,340,193,194,258,196,313,262,199,268,201,280,203,282,205,206,270,272,323,327,211,212,336,214,215,344,366,218,368,220,221,354,223,341,225,226,259,228,314,263,231,269,233,281,235,283,237,238,271,273,324,328,243,244,337,246,247,345,367,250,369,252,253,355,729], - 'windows-1251': [1026,1027,8218,1107,8222,8230,8224,8225,8364,8240,1033,8249,1034,1036,1035,1039,1106,8216,8217,8220,8221,8226,8211,8212,152,8482,1113,8250,1114,1116,1115,1119,160,1038,1118,1032,164,1168,166,167,1025,169,1028,171,172,173,174,1031,176,177,1030,1110,1169,181,182,183,1105,8470,1108,187,1112,1029,1109,1111,1040,1041,1042,1043,1044,1045,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,1072,1073,1074,1075,1076,1077,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,1103], - 'windows-1252': [8364,129,8218,402,8222,8230,8224,8225,710,8240,352,8249,338,141,381,143,144,8216,8217,8220,8221,8226,8211,8212,732,8482,353,8250,339,157,382,376,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255], - 'windows-1253': [8364,129,8218,402,8222,8230,8224,8225,136,8240,138,8249,140,141,142,143,144,8216,8217,8220,8221,8226,8211,8212,152,8482,154,8250,156,157,158,159,160,901,902,163,164,165,166,167,168,169,null,171,172,173,174,8213,176,177,178,179,900,181,182,183,904,905,906,187,908,189,910,911,912,913,914,915,916,917,918,919,920,921,922,923,924,925,926,927,928,929,null,931,932,933,934,935,936,937,938,939,940,941,942,943,944,945,946,947,948,949,950,951,952,953,954,955,956,957,958,959,960,961,962,963,964,965,966,967,968,969,970,971,972,973,974,null], - 'windows-1254': [8364,129,8218,402,8222,8230,8224,8225,710,8240,352,8249,338,141,142,143,144,8216,8217,8220,8221,8226,8211,8212,732,8482,353,8250,339,157,158,376,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,286,209,210,211,212,213,214,215,216,217,218,219,220,304,350,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,287,241,242,243,244,245,246,247,248,249,250,251,252,305,351,255], - 'windows-1255': [8364,129,8218,402,8222,8230,8224,8225,710,8240,138,8249,140,141,142,143,144,8216,8217,8220,8221,8226,8211,8212,732,8482,154,8250,156,157,158,159,160,161,162,163,8362,165,166,167,168,169,215,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,247,187,188,189,190,191,1456,1457,1458,1459,1460,1461,1462,1463,1464,1465,1466,1467,1468,1469,1470,1471,1472,1473,1474,1475,1520,1521,1522,1523,1524,null,null,null,null,null,null,null,1488,1489,1490,1491,1492,1493,1494,1495,1496,1497,1498,1499,1500,1501,1502,1503,1504,1505,1506,1507,1508,1509,1510,1511,1512,1513,1514,null,null,8206,8207,null], - 'windows-1256': [8364,1662,8218,402,8222,8230,8224,8225,710,8240,1657,8249,338,1670,1688,1672,1711,8216,8217,8220,8221,8226,8211,8212,1705,8482,1681,8250,339,8204,8205,1722,160,1548,162,163,164,165,166,167,168,169,1726,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,1563,187,188,189,190,1567,1729,1569,1570,1571,1572,1573,1574,1575,1576,1577,1578,1579,1580,1581,1582,1583,1584,1585,1586,1587,1588,1589,1590,215,1591,1592,1593,1594,1600,1601,1602,1603,224,1604,226,1605,1606,1607,1608,231,232,233,234,235,1609,1610,238,239,1611,1612,1613,1614,244,1615,1616,247,1617,249,1618,251,252,8206,8207,1746], - 'windows-1257': [8364,129,8218,131,8222,8230,8224,8225,136,8240,138,8249,140,168,711,184,144,8216,8217,8220,8221,8226,8211,8212,152,8482,154,8250,156,175,731,159,160,null,162,163,164,null,166,167,216,169,342,171,172,173,174,198,176,177,178,179,180,181,182,183,248,185,343,187,188,189,190,230,260,302,256,262,196,197,280,274,268,201,377,278,290,310,298,315,352,323,325,211,332,213,214,215,370,321,346,362,220,379,381,223,261,303,257,263,228,229,281,275,269,233,378,279,291,311,299,316,353,324,326,243,333,245,246,247,371,322,347,363,252,380,382,729], - 'windows-1258': [8364,129,8218,402,8222,8230,8224,8225,710,8240,138,8249,338,141,142,143,144,8216,8217,8220,8221,8226,8211,8212,732,8482,154,8250,339,157,158,376,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,258,196,197,198,199,200,201,202,203,768,205,206,207,272,209,777,211,212,416,214,215,216,217,218,219,220,431,771,223,224,225,226,259,228,229,230,231,232,233,234,235,769,237,238,239,273,241,803,243,244,417,246,247,248,249,250,251,252,432,8363,255], - 'x-mac-cyrillic': [1040,1041,1042,1043,1044,1045,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,8224,176,1168,163,167,8226,182,1030,174,169,8482,1026,1106,8800,1027,1107,8734,177,8804,8805,1110,181,1169,1032,1028,1108,1031,1111,1033,1113,1034,1114,1112,1029,172,8730,402,8776,8710,171,187,8230,160,1035,1115,1036,1116,1109,8211,8212,8220,8221,8216,8217,247,8222,1038,1118,1039,1119,8470,1025,1105,1103,1072,1073,1074,1075,1076,1077,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,8364] -} - -export default Indexes \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/text-decoding/src/encodings.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/text-decoding/src/encodings.js deleted file mode 100644 index 87754066..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/text-decoding/src/encodings.js +++ /dev/null @@ -1,460 +0,0 @@ -/** - * Encodings table: https://encoding.spec.whatwg.org/encodings.json - */ -const encodings = [ - { - encodings: [ - { - labels: [ - "unicode-1-1-utf-8", - "utf-8", - "utf8", - ], - name: "UTF-8", - }, - ], - heading: "The Encoding", - }, - { - encodings: [ - { - labels: [ - "866", - "cp866", - "csibm866", - "ibm866", - ], - name: "IBM866", - }, - { - labels: [ - "csisolatin2", - "iso-8859-2", - "iso-ir-101", - "iso8859-2", - "iso88592", - "iso_8859-2", - "iso_8859-2:1987", - "l2", - "latin2", - ], - name: "ISO-8859-2", - }, - { - labels: [ - "csisolatin3", - "iso-8859-3", - "iso-ir-109", - "iso8859-3", - "iso88593", - "iso_8859-3", - "iso_8859-3:1988", - "l3", - "latin3", - ], - name: "ISO-8859-3", - }, - { - labels: [ - "csisolatin4", - "iso-8859-4", - "iso-ir-110", - "iso8859-4", - "iso88594", - "iso_8859-4", - "iso_8859-4:1988", - "l4", - "latin4", - ], - name: "ISO-8859-4", - }, - { - labels: [ - "csisolatincyrillic", - "cyrillic", - "iso-8859-5", - "iso-ir-144", - "iso8859-5", - "iso88595", - "iso_8859-5", - "iso_8859-5:1988", - ], - name: "ISO-8859-5", - }, - { - labels: [ - "arabic", - "asmo-708", - "csiso88596e", - "csiso88596i", - "csisolatinarabic", - "ecma-114", - "iso-8859-6", - "iso-8859-6-e", - "iso-8859-6-i", - "iso-ir-127", - "iso8859-6", - "iso88596", - "iso_8859-6", - "iso_8859-6:1987", - ], - name: "ISO-8859-6", - }, - { - labels: [ - "csisolatingreek", - "ecma-118", - "elot_928", - "greek", - "greek8", - "iso-8859-7", - "iso-ir-126", - "iso8859-7", - "iso88597", - "iso_8859-7", - "iso_8859-7:1987", - "sun_eu_greek", - ], - name: "ISO-8859-7", - }, - { - labels: [ - "csiso88598e", - "csisolatinhebrew", - "hebrew", - "iso-8859-8", - "iso-8859-8-e", - "iso-ir-138", - "iso8859-8", - "iso88598", - "iso_8859-8", - "iso_8859-8:1988", - "visual", - ], - name: "ISO-8859-8", - }, - { - labels: [ - "csiso88598i", - "iso-8859-8-i", - "logical", - ], - name: "ISO-8859-8-I", - }, - { - labels: [ - "csisolatin6", - "iso-8859-10", - "iso-ir-157", - "iso8859-10", - "iso885910", - "l6", - "latin6", - ], - name: "ISO-8859-10", - }, - { - labels: [ - "iso-8859-13", - "iso8859-13", - "iso885913", - ], - name: "ISO-8859-13", - }, - { - labels: [ - "iso-8859-14", - "iso8859-14", - "iso885914", - ], - name: "ISO-8859-14", - }, - { - labels: [ - "csisolatin9", - "iso-8859-15", - "iso8859-15", - "iso885915", - "iso_8859-15", - "l9", - ], - name: "ISO-8859-15", - }, - { - labels: [ - "iso-8859-16", - ], - name: "ISO-8859-16", - }, - { - labels: [ - "cskoi8r", - "koi", - "koi8", - "koi8-r", - "koi8_r", - ], - name: "KOI8-R", - }, - { - labels: [ - "koi8-ru", - "koi8-u", - ], - name: "KOI8-U", - }, - { - labels: [ - "csmacintosh", - "mac", - "macintosh", - "x-mac-roman", - ], - name: "macintosh", - }, - { - labels: [ - "dos-874", - "iso-8859-11", - "iso8859-11", - "iso885911", - "tis-620", - "windows-874", - ], - name: "windows-874", - }, - { - labels: [ - "cp1250", - "windows-1250", - "x-cp1250", - ], - name: "windows-1250", - }, - { - labels: [ - "cp1251", - "windows-1251", - "x-cp1251", - ], - name: "windows-1251", - }, - { - labels: [ - "ansi_x3.4-1968", - "ascii", - "cp1252", - "cp819", - "csisolatin1", - "ibm819", - "iso-8859-1", - "iso-ir-100", - "iso8859-1", - "iso88591", - "iso_8859-1", - "iso_8859-1:1987", - "l1", - "latin1", - "us-ascii", - "windows-1252", - "x-cp1252", - ], - name: "windows-1252", - }, - { - labels: [ - "cp1253", - "windows-1253", - "x-cp1253", - ], - name: "windows-1253", - }, - { - labels: [ - "cp1254", - "csisolatin5", - "iso-8859-9", - "iso-ir-148", - "iso8859-9", - "iso88599", - "iso_8859-9", - "iso_8859-9:1989", - "l5", - "latin5", - "windows-1254", - "x-cp1254", - ], - name: "windows-1254", - }, - { - labels: [ - "cp1255", - "windows-1255", - "x-cp1255", - ], - name: "windows-1255", - }, - { - labels: [ - "cp1256", - "windows-1256", - "x-cp1256", - ], - name: "windows-1256", - }, - { - labels: [ - "cp1257", - "windows-1257", - "x-cp1257", - ], - name: "windows-1257", - }, - { - labels: [ - "cp1258", - "windows-1258", - "x-cp1258", - ], - name: "windows-1258", - }, - { - labels: [ - "x-mac-cyrillic", - "x-mac-ukrainian", - ], - name: "x-mac-cyrillic", - }, - ], - heading: "Legacy single-byte encodings", - }, - { - encodings: [ - { - labels: [ - "chinese", - "csgb2312", - "csiso58gb231280", - "gb2312", - "gb_2312", - "gb_2312-80", - "gbk", - "iso-ir-58", - "x-gbk", - ], - name: "GBK", - }, - { - labels: [ - "gb18030", - ], - name: "gb18030", - }, - ], - heading: "Legacy multi-byte Chinese (simplified) encodings", - }, - { - encodings: [ - { - labels: [ - "big5", - "big5-hkscs", - "cn-big5", - "csbig5", - "x-x-big5", - ], - name: "Big5", - }, - ], - heading: "Legacy multi-byte Chinese (traditional) encodings", - }, - { - encodings: [ - { - labels: [ - "cseucpkdfmtjapanese", - "euc-jp", - "x-euc-jp", - ], - name: "EUC-JP", - }, - { - labels: [ - "csiso2022jp", - "iso-2022-jp", - ], - name: "ISO-2022-JP", - }, - { - labels: [ - "csshiftjis", - "ms932", - "ms_kanji", - "shift-jis", - "shift_jis", - "sjis", - "windows-31j", - "x-sjis", - ], - name: "Shift_JIS", - }, - ], - heading: "Legacy multi-byte Japanese encodings", - }, - { - encodings: [ - { - labels: [ - "cseuckr", - "csksc56011987", - "euc-kr", - "iso-ir-149", - "korean", - "ks_c_5601-1987", - "ks_c_5601-1989", - "ksc5601", - "ksc_5601", - "windows-949", - ], - name: "EUC-KR", - }, - ], - heading: "Legacy multi-byte Korean encodings", - }, - { - encodings: [ - { - labels: [ - "csiso2022kr", - "hz-gb-2312", - "iso-2022-cn", - "iso-2022-cn-ext", - "iso-2022-kr", - ], - name: "replacement", - }, - { - labels: [ - "utf-16be", - ], - name: "UTF-16BE", - }, - { - labels: [ - "utf-16", - "utf-16le", - ], - name: "UTF-16LE", - }, - { - labels: [ - "x-user-defined", - ], - name: "x-user-defined", - }, - ], - heading: "Legacy miscellaneous encodings", - }, -] - -export default encodings \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/text-decoding/src/implementations/big5.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/text-decoding/src/implementations/big5.js deleted file mode 100644 index f321f7bc..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/text-decoding/src/implementations/big5.js +++ /dev/null @@ -1,154 +0,0 @@ -import { inRange, decoderError, encoderError, isASCIICodePoint, - end_of_stream, finished, isASCIIByte, floor } from '../utils' -import index, { indexBig5PointerFor, indexCodePointFor } from '../indexes' - -// -// 12. Legacy multi-byte Chinese (traditional) encodings -// - -// 12.1 Big5 - -// 12.1.1 Big5 decoder -/** - * @implements {Decoder} - */ -export class Big5Decoder { - constructor(options) { - const { fatal } = options - this.fatal = fatal - // Big5's decoder has an associated Big5 lead (initially 0x00). - this.Big5_lead = 0x00 - } - /** - * @param {Stream} stream The stream of bytes being decoded. - * @param {number} bite The next byte read from the stream. - */ - handler(stream, bite) { - // 1. If byte is end-of-stream and Big5 lead is not 0x00, set - // Big5 lead to 0x00 and return error. - if (bite === end_of_stream && this.Big5_lead !== 0x00) { - this.Big5_lead = 0x00 - return decoderError(this.fatal) - } - - // 2. If byte is end-of-stream and Big5 lead is 0x00, return - // finished. - if (bite === end_of_stream && this.Big5_lead === 0x00) - return finished - - // 3. If Big5 lead is not 0x00, let lead be Big5 lead, let - // pointer be null, set Big5 lead to 0x00, and then run these - // substeps: - if (this.Big5_lead !== 0x00) { - const lead = this.Big5_lead - let pointer = null - this.Big5_lead = 0x00 - - // 1. Let offset be 0x40 if byte is less than 0x7F and 0x62 - // otherwise. - const offset = bite < 0x7F ? 0x40 : 0x62 - - // 2. If byte is in the range 0x40 to 0x7E, inclusive, or 0xA1 - // to 0xFE, inclusive, set pointer to (lead − 0x81) × 157 + - // (byte − offset). - if (inRange(bite, 0x40, 0x7E) || inRange(bite, 0xA1, 0xFE)) - pointer = (lead - 0x81) * 157 + (bite - offset) - - // 3. If there is a row in the table below whose first column - // is pointer, return the two code points listed in its second - // column - // Pointer | Code points - // --------+-------------- - // 1133 | U+00CA U+0304 - // 1135 | U+00CA U+030C - // 1164 | U+00EA U+0304 - // 1166 | U+00EA U+030C - switch (pointer) { - case 1133: return [0x00CA, 0x0304] - case 1135: return [0x00CA, 0x030C] - case 1164: return [0x00EA, 0x0304] - case 1166: return [0x00EA, 0x030C] - } - - // 4. Let code point be null if pointer is null and the index - // code point for pointer in index Big5 otherwise. - const code_point = (pointer === null) ? null : - indexCodePointFor(pointer, index('big5')) - - // 5. If code point is null and byte is an ASCII byte, prepend - // byte to stream. - if (code_point === null && isASCIIByte(bite)) - stream.prepend(bite) - - // 6. If code point is null, return error. - if (code_point === null) - return decoderError(this.fatal) - - // 7. Return a code point whose value is code point. - return code_point - } - - // 4. If byte is an ASCII byte, return a code point whose value - // is byte. - if (isASCIIByte(bite)) - return bite - - // 5. If byte is in the range 0x81 to 0xFE, inclusive, set Big5 - // lead to byte and return continue. - if (inRange(bite, 0x81, 0xFE)) { - this.Big5_lead = bite - return null - } - - // 6. Return error. - return decoderError(this.fatal) - } -} - - -// 12.1.2 Big5 encoder -/** - * @implements {Encoder} - */ -export class Big5Encoder { - constructor() { - /** - * @param {Stream} stream Input stream. - * @param {number} code_point Next code point read from the stream. - */ - this.handler = function(stream, code_point) { - // 1. If code point is end-of-stream, return finished. - if (code_point === end_of_stream) - return finished - - // 2. If code point is an ASCII code point, return a byte whose - // value is code point. - if (isASCIICodePoint(code_point)) - return code_point - - // 3. Let pointer be the index Big5 pointer for code point. - const pointer = indexBig5PointerFor(code_point) - - // 4. If pointer is null, return error with code point. - if (pointer === null) - return encoderError(code_point) - - // 5. Let lead be floor(pointer / 157) + 0x81. - const lead = floor(pointer / 157) + 0x81 - - // 6. If lead is less than 0xA1, return error with code point. - if (lead < 0xA1) - return encoderError(code_point) - - // 7. Let trail be pointer % 157. - const trail = pointer % 157 - - // 8. Let offset be 0x40 if trail is less than 0x3F and 0x62 - // otherwise. - const offset = trail < 0x3F ? 0x40 : 0x62 - - // Return two bytes whose values are lead and trail + offset. - return [lead, trail + offset] - } - } -} \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/text-decoding/src/implementations/euc-jp.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/text-decoding/src/implementations/euc-jp.js deleted file mode 100644 index a1064b0c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/text-decoding/src/implementations/euc-jp.js +++ /dev/null @@ -1,166 +0,0 @@ -import { inRange, decoderError, encoderError, isASCIICodePoint, - end_of_stream, finished, isASCIIByte, floor } from '../utils' -import index, { indexCodePointFor, indexPointerFor } from '../indexes' - -// -// 13. Legacy multi-byte Japanese encodings -// - -// 13.1 euc-jp - -// 13.1.1 euc-jp decoder -/** - * @implements {Decoder} - */ -export class EUCJPDecoder { - constructor(options) { - const { fatal } = options - this.fatal = fatal - - // euc-jp's decoder has an associated euc-jp jis0212 flag - // (initially unset) and euc-jp lead (initially 0x00). - this.eucjp_jis0212_flag = false - this.eucjp_lead = 0x00 - } - - /** - * @param {Stream} stream The stream of bytes being decoded. - * @param {number} bite The next byte read from the stream. - */ - handler(stream, bite) { - // 1. If byte is end-of-stream and euc-jp lead is not 0x00, set - // euc-jp lead to 0x00, and return error. - if (bite === end_of_stream && this.eucjp_lead !== 0x00) { - this.eucjp_lead = 0x00 - return decoderError(this.fatal) - } - - // 2. If byte is end-of-stream and euc-jp lead is 0x00, return - // finished. - if (bite === end_of_stream && this.eucjp_lead === 0x00) - return finished - - // 3. If euc-jp lead is 0x8E and byte is in the range 0xA1 to - // 0xDF, inclusive, set euc-jp lead to 0x00 and return a code - // point whose value is 0xFF61 − 0xA1 + byte. - if (this.eucjp_lead === 0x8E && inRange(bite, 0xA1, 0xDF)) { - this.eucjp_lead = 0x00 - return 0xFF61 - 0xA1 + bite - } - - // 4. If euc-jp lead is 0x8F and byte is in the range 0xA1 to - // 0xFE, inclusive, set the euc-jp jis0212 flag, set euc-jp lead - // to byte, and return continue. - if (this.eucjp_lead === 0x8F && inRange(bite, 0xA1, 0xFE)) { - this.eucjp_jis0212_flag = true - this.eucjp_lead = bite - return null - } - - // 5. If euc-jp lead is not 0x00, let lead be euc-jp lead, set - // euc-jp lead to 0x00, and run these substeps: - if (this.eucjp_lead !== 0x00) { - const lead = this.eucjp_lead - this.eucjp_lead = 0x00 - - // 1. Let code point be null. - let code_point = null - - // 2. If lead and byte are both in the range 0xA1 to 0xFE, - // inclusive, set code point to the index code point for (lead - // − 0xA1) × 94 + byte − 0xA1 in index jis0208 if the euc-jp - // jis0212 flag is unset and in index jis0212 otherwise. - if (inRange(lead, 0xA1, 0xFE) && inRange(bite, 0xA1, 0xFE)) { - code_point = indexCodePointFor( - (lead - 0xA1) * 94 + (bite - 0xA1), - index(!this.eucjp_jis0212_flag ? 'jis0208' : 'jis0212')) - } - - // 3. Unset the euc-jp jis0212 flag. - this.eucjp_jis0212_flag = false - - // 4. If byte is not in the range 0xA1 to 0xFE, inclusive, - // prepend byte to stream. - if (!inRange(bite, 0xA1, 0xFE)) - stream.prepend(bite) - - // 5. If code point is null, return error. - if (code_point === null) - return decoderError(this.fatal) - - // 6. Return a code point whose value is code point. - return code_point - } - - // 6. If byte is an ASCII byte, return a code point whose value - // is byte. - if (isASCIIByte(bite)) - return bite - - // 7. If byte is 0x8E, 0x8F, or in the range 0xA1 to 0xFE, - // inclusive, set euc-jp lead to byte and return continue. - if (bite === 0x8E || bite === 0x8F || inRange(bite, 0xA1, 0xFE)) { - this.eucjp_lead = bite - return null - } - - // 8. Return error. - return decoderError(this.fatal) - } -} - -// 13.1.2 euc-jp encoder -/** - * @implements {Encoder} - */ -export class EUCJPEncoder { - /** - * @param {Stream} stream Input stream. - * @param {number} code_point Next code point read from the stream. - */ - handler(stream, code_point) { - // 1. If code point is end-of-stream, return finished. - if (code_point === end_of_stream) - return finished - - // 2. If code point is an ASCII code point, return a byte whose - // value is code point. - if (isASCIICodePoint(code_point)) - return code_point - - // 3. If code point is U+00A5, return byte 0x5C. - if (code_point === 0x00A5) - return 0x5C - - // 4. If code point is U+203E, return byte 0x7E. - if (code_point === 0x203E) - return 0x7E - - // 5. If code point is in the range U+FF61 to U+FF9F, inclusive, - // return two bytes whose values are 0x8E and code point − - // 0xFF61 + 0xA1. - if (inRange(code_point, 0xFF61, 0xFF9F)) - return [0x8E, code_point - 0xFF61 + 0xA1] - - // 6. If code point is U+2212, set it to U+FF0D. - if (code_point === 0x2212) - code_point = 0xFF0D - - // 7. Let pointer be the index pointer for code point in index - // jis0208. - const pointer = indexPointerFor(code_point, index('jis0208')) - - // 8. If pointer is null, return error with code point. - if (pointer === null) - return encoderError(code_point) - - // 9. Let lead be floor(pointer / 94) + 0xA1. - const lead = floor(pointer / 94) + 0xA1 - - // 10. Let trail be pointer % 94 + 0xA1. - const trail = pointer % 94 + 0xA1 - - // 11. Return two bytes whose values are lead and trail. - return [lead, trail] - } -} \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/text-decoding/src/implementations/euc-kr.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/text-decoding/src/implementations/euc-kr.js deleted file mode 100644 index b7739c13..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/text-decoding/src/implementations/euc-kr.js +++ /dev/null @@ -1,124 +0,0 @@ -import { inRange, decoderError, encoderError, isASCIICodePoint, - end_of_stream, finished, isASCIIByte, floor } from '../utils' -import index, { indexCodePointFor, indexPointerFor } from '../indexes' - -// -// 14. Legacy multi-byte Korean encodings -// - -// 14.1 euc-kr - -// 14.1.1 euc-kr decoder -/** - * @implements {Decoder} - */ -export class EUCKRDecoder { - constructor(options) { - const { fatal } = options - this.fatal = fatal - // euc-kr's decoder has an associated euc-kr lead (initially 0x00). - this.euckr_lead = 0x00 - } - /** - * @param {Stream} stream The stream of bytes being decoded. - * @param {number} bite The next byte read from the stream. - */ - handler(stream, bite) { - // 1. If byte is end-of-stream and euc-kr lead is not 0x00, set - // euc-kr lead to 0x00 and return error. - if (bite === end_of_stream && this.euckr_lead !== 0) { - this.euckr_lead = 0x00 - return decoderError(this.fatal) - } - - // 2. If byte is end-of-stream and euc-kr lead is 0x00, return - // finished. - if (bite === end_of_stream && this.euckr_lead === 0) - return finished - - // 3. If euc-kr lead is not 0x00, let lead be euc-kr lead, let - // pointer be null, set euc-kr lead to 0x00, and then run these - // substeps: - if (this.euckr_lead !== 0x00) { - const lead = this.euckr_lead - let pointer = null - this.euckr_lead = 0x00 - - // 1. If byte is in the range 0x41 to 0xFE, inclusive, set - // pointer to (lead − 0x81) × 190 + (byte − 0x41). - if (inRange(bite, 0x41, 0xFE)) - pointer = (lead - 0x81) * 190 + (bite - 0x41) - - // 2. Let code point be null, if pointer is null, and the - // index code point for pointer in index euc-kr otherwise. - const code_point = (pointer === null) - ? null : indexCodePointFor(pointer, index('euc-kr')) - - // 3. If code point is null and byte is an ASCII byte, prepend - // byte to stream. - if (pointer === null && isASCIIByte(bite)) - stream.prepend(bite) - - // 4. If code point is null, return error. - if (code_point === null) - return decoderError(this.fatal) - - // 5. Return a code point whose value is code point. - return code_point - } - - // 4. If byte is an ASCII byte, return a code point whose value - // is byte. - if (isASCIIByte(bite)) - return bite - - // 5. If byte is in the range 0x81 to 0xFE, inclusive, set - // euc-kr lead to byte and return continue. - if (inRange(bite, 0x81, 0xFE)) { - this.euckr_lead = bite - return null - } - - // 6. Return error. - return decoderError(this.fatal) - } -} - -// 14.1.2 euc-kr encoder -/** - * @implements {Encoder} - */ -export class EUCKREncoder { - /** - * @param {Stream} stream Input stream. - * @param {number} code_point Next code point read from the stream. - * @return {(number|!Array.)} Byte(s) to emit. - */ - handler(stream, code_point) { - // 1. If code point is end-of-stream, return finished. - if (code_point === end_of_stream) - return finished - - // 2. If code point is an ASCII code point, return a byte whose - // value is code point. - if (isASCIICodePoint(code_point)) - return code_point - - // 3. Let pointer be the index pointer for code point in index - // euc-kr. - const pointer = indexPointerFor(code_point, index('euc-kr')) - - // 4. If pointer is null, return error with code point. - if (pointer === null) - return encoderError(code_point) - - // 5. Let lead be floor(pointer / 190) + 0x81. - const lead = floor(pointer / 190) + 0x81 - - // 6. Let trail be pointer % 190 + 0x41. - const trail = (pointer % 190) + 0x41 - - // 7. Return two bytes whose values are lead and trail. - return [lead, trail] - } -} \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/text-decoding/src/implementations/gb18030.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/text-decoding/src/implementations/gb18030.js deleted file mode 100644 index 4153a99d..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/text-decoding/src/implementations/gb18030.js +++ /dev/null @@ -1,251 +0,0 @@ -import { inRange, decoderError, encoderError, isASCIICodePoint, - end_of_stream, finished, isASCIIByte, floor } from '../utils' -import index, { - indexGB18030RangesCodePointFor, indexGB18030RangesPointerFor, - indexCodePointFor, indexPointerFor } from '../indexes' - -// 11.2 gb18030 - -// 11.2.1 gb18030 decoder -/** - * @constructor - * @implements {Decoder} - * @param {{fatal: boolean}} options - */ -export class GB18030Decoder { - constructor(options) { - const { fatal } = options - this.fatal = fatal - // gb18030's decoder has an associated gb18030 first, gb18030 - // second, and gb18030 third (all initially 0x00). - this.gb18030_first = 0x00 - this.gb18030_second = 0x00, - this.gb18030_third = 0x00 - } - /** - * @param {Stream} stream The stream of bytes being decoded. - * @param {number} bite The next byte read from the stream. - * @return The next code point(s) decoded, or null if not enough data exists in the input stream to decode a complete code point. - */ - handler(stream, bite) { - // 1. If byte is end-of-stream and gb18030 first, gb18030 - // second, and gb18030 third are 0x00, return finished. - if (bite === end_of_stream && this.gb18030_first === 0x00 && - this.gb18030_second === 0x00 && this.gb18030_third === 0x00) { - return finished - } - // 2. If byte is end-of-stream, and gb18030 first, gb18030 - // second, or gb18030 third is not 0x00, set gb18030 first, - // gb18030 second, and gb18030 third to 0x00, and return error. - if (bite === end_of_stream && - (this.gb18030_first !== 0x00 || this.gb18030_second !== 0x00 || - this.gb18030_third !== 0x00)) { - this.gb18030_first = 0x00 - this.gb18030_second = 0x00 - this.gb18030_third = 0x00 - decoderError(this.fatal) - } - var code_point - // 3. If gb18030 third is not 0x00, run these substeps: - if (this.gb18030_third !== 0x00) { - // 1. Let code point be null. - code_point = null - // 2. If byte is in the range 0x30 to 0x39, inclusive, set - // code point to the index gb18030 ranges code point for - // (((gb18030 first − 0x81) × 10 + gb18030 second − 0x30) × - // 126 + gb18030 third − 0x81) × 10 + byte − 0x30. - if (inRange(bite, 0x30, 0x39)) { - code_point = indexGB18030RangesCodePointFor( - (((this.gb18030_first - 0x81) * 10 + this.gb18030_second - 0x30) * 126 + - this.gb18030_third - 0x81) * 10 + bite - 0x30) - } - - // 3. Let buffer be a byte sequence consisting of gb18030 - // second, gb18030 third, and byte, in order. - var buffer = [this.gb18030_second, this.gb18030_third, bite] - - // 4. Set gb18030 first, gb18030 second, and gb18030 third to - // 0x00. - this.gb18030_first = 0x00 - this.gb18030_second = 0x00 - this.gb18030_third = 0x00 - - // 5. If code point is null, prepend buffer to stream and - // return error. - if (code_point === null) { - stream.prepend(buffer) - return decoderError(this.fatal) - } - - // 6. Return a code point whose value is code point. - return code_point - } - - // 4. If gb18030 second is not 0x00, run these substeps: - if (this.gb18030_second !== 0x00) { - // 1. If byte is in the range 0x81 to 0xFE, inclusive, set - // gb18030 third to byte and return continue. - if (inRange(bite, 0x81, 0xFE)) { - this.gb18030_third = bite - return null - } - - // 2. Prepend gb18030 second followed by byte to stream, set - // gb18030 first and gb18030 second to 0x00, and return error. - stream.prepend([this.gb18030_second, bite]) - this.gb18030_first = 0x00 - this.gb18030_second = 0x00 - return decoderError(this.fatal) - } - - // 5. If gb18030 first is not 0x00, run these substeps: - if (this.gb18030_first !== 0x00) { - // 1. If byte is in the range 0x30 to 0x39, inclusive, set - // gb18030 second to byte and return continue. - if (inRange(bite, 0x30, 0x39)) { - this.gb18030_second = bite - return null - } - - // 2. Let lead be gb18030 first, let pointer be null, and set - // gb18030 first to 0x00. - var lead = this.gb18030_first - var pointer = null - this.gb18030_first = 0x00 - - // 3. Let offset be 0x40 if byte is less than 0x7F and 0x41 - // otherwise. - var offset = bite < 0x7F ? 0x40 : 0x41 - - // 4. If byte is in the range 0x40 to 0x7E, inclusive, or 0x80 - // to 0xFE, inclusive, set pointer to (lead − 0x81) × 190 + - // (byte − offset). - if (inRange(bite, 0x40, 0x7E) || inRange(bite, 0x80, 0xFE)) - pointer = (lead - 0x81) * 190 + (bite - offset) - - // 5. Let code point be null if pointer is null and the index - // code point for pointer in index gb18030 otherwise. - code_point = pointer === null ? null : - indexCodePointFor(pointer, index('gb18030')) - - // 6. If code point is null and byte is an ASCII byte, prepend - // byte to stream. - if (code_point === null && isASCIIByte(bite)) - stream.prepend(bite) - - // 7. If code point is null, return error. - if (code_point === null) - return decoderError(this.fatal) - - // 8. Return a code point whose value is code point. - return code_point - } - - // 6. If byte is an ASCII byte, return a code point whose value - // is byte. - if (isASCIIByte(bite)) - return bite - - // 7. If byte is 0x80, return code point U+20AC. - if (bite === 0x80) - return 0x20AC - - // 8. If byte is in the range 0x81 to 0xFE, inclusive, set - // gb18030 first to byte and return continue. - if (inRange(bite, 0x81, 0xFE)) { - this.gb18030_first = bite - return null - } - - // 9. Return error. - return decoderError(this.fatal) - } -} - -// 11.2.2 gb18030 encoder -/** - * @implements {Encoder} - */ -export class GB18030Encoder { - /** - * @param {Stream} stream Input stream. - * @param {number} code_point Next code point read from the stream. - * @return Byte(s) to emit. - */ - handler(stream, code_point) { - // 1. If code point is end-of-stream, return finished. - if (code_point === end_of_stream) - return finished - - // 2. If code point is an ASCII code point, return a byte whose - // value is code point. - if (isASCIICodePoint(code_point)) - return code_point - - // 3. If code point is U+E5E5, return error with code point. - if (code_point === 0xE5E5) - return encoderError(code_point) - - // 4. If the gbk flag is set and code point is U+20AC, return - // byte 0x80. - if (this.gbk_flag && code_point === 0x20AC) - return 0x80 - - // 5. Let pointer be the index pointer for code point in index - // gb18030. - var pointer = indexPointerFor(code_point, index('gb18030')) - - // 6. If pointer is not null, run these substeps: - if (pointer !== null) { - // 1. Let lead be floor(pointer / 190) + 0x81. - var lead = floor(pointer / 190) + 0x81 - - // 2. Let trail be pointer % 190. - var trail = pointer % 190 - - // 3. Let offset be 0x40 if trail is less than 0x3F and 0x41 otherwise. - var offset = trail < 0x3F ? 0x40 : 0x41 - - // 4. Return two bytes whose values are lead and trail + offset. - return [lead, trail + offset] - } - - // 7. If gbk flag is set, return error with code point. - if (this.gbk_flag) - return encoderError(code_point) - - // 8. Set pointer to the index gb18030 ranges pointer for code - // point. - pointer = indexGB18030RangesPointerFor(code_point) - - // 9. Let byte1 be floor(pointer / 10 / 126 / 10). - var byte1 = floor(pointer / 10 / 126 / 10) - - // 10. Set pointer to pointer − byte1 × 10 × 126 × 10. - pointer = pointer - byte1 * 10 * 126 * 10 - - // 11. Let byte2 be floor(pointer / 10 / 126). - var byte2 = floor(pointer / 10 / 126) - - // 12. Set pointer to pointer − byte2 × 10 × 126. - pointer = pointer - byte2 * 10 * 126 - - // 13. Let byte3 be floor(pointer / 10). - var byte3 = floor(pointer / 10) - - // 14. Let byte4 be pointer − byte3 × 10. - var byte4 = pointer - byte3 * 10 - - // 15. Return four bytes whose values are byte1 + 0x81, byte2 + - // 0x30, byte3 + 0x81, byte4 + 0x30. - return [byte1 + 0x81, - byte2 + 0x30, - byte3 + 0x81, - byte4 + 0x30] - } - - constructor(options = {}, gbk_flag = false) { - // gb18030's decoder has an associated gbk flag (initially unset). - this.gbk_flag = gbk_flag - } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/text-decoding/src/implementations/iso-2022-jp.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/text-decoding/src/implementations/iso-2022-jp.js deleted file mode 100644 index 7a960d5f..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/text-decoding/src/implementations/iso-2022-jp.js +++ /dev/null @@ -1,441 +0,0 @@ -import { inRange, decoderError, encoderError, isASCIICodePoint, - end_of_stream, finished, floor } from '../utils' -import index, { indexCodePointFor, indexPointerFor } from '../indexes' - -// 13.2 iso-2022-jp - -// 13.2.1 iso-2022-jp decoder -/** - * @implements {Decoder} - */ -export class ISO2022JPDecoder { - constructor(options) { - const { fatal } = options - this.fatal = fatal - /** @enum */ - this.states = { - ASCII: 0, - Roman: 1, - Katakana: 2, - LeadByte: 3, - TrailByte: 4, - EscapeStart: 5, - Escape: 6, - } - // iso-2022-jp's decoder has an associated iso-2022-jp decoder - // state (initially ASCII), iso-2022-jp decoder output state - // (initially ASCII), iso-2022-jp lead (initially 0x00), and - // iso-2022-jp output flag (initially unset). - this.iso2022jp_decoder_state = this.states.ASCII - this.iso2022jp_decoder_output_state = this.states.ASCII, - this.iso2022jp_lead = 0x00 - this.iso2022jp_output_flag = false - } - /** - * @param {Stream} stream The stream of bytes being decoded. - * @param {number} bite The next byte read from the stream. - */ - handler(stream, bite) { - // switching on iso-2022-jp decoder state: - switch (this.iso2022jp_decoder_state) { - default: - case this.states.ASCII: - // ASCII - // Based on byte: - - // 0x1B - if (bite === 0x1B) { - // Set iso-2022-jp decoder state to escape start and return - // continue. - this.iso2022jp_decoder_state = this.states.EscapeStart - return null - } - - // 0x00 to 0x7F, excluding 0x0E, 0x0F, and 0x1B - if (inRange(bite, 0x00, 0x7F) && bite !== 0x0E - && bite !== 0x0F && bite !== 0x1B) { - // Unset the iso-2022-jp output flag and return a code point - // whose value is byte. - this.iso2022jp_output_flag = false - return bite - } - - // end-of-stream - if (bite === end_of_stream) { - // Return finished. - return finished - } - - // Otherwise - // Unset the iso-2022-jp output flag and return error. - this.iso2022jp_output_flag = false - return decoderError(this.fatal) - - case this.states.Roman: - // Roman - // Based on byte: - - // 0x1B - if (bite === 0x1B) { - // Set iso-2022-jp decoder state to escape start and return - // continue. - this.iso2022jp_decoder_state = this.states.EscapeStart - return null - } - - // 0x5C - if (bite === 0x5C) { - // Unset the iso-2022-jp output flag and return code point - // U+00A5. - this.iso2022jp_output_flag = false - return 0x00A5 - } - - // 0x7E - if (bite === 0x7E) { - // Unset the iso-2022-jp output flag and return code point - // U+203E. - this.iso2022jp_output_flag = false - return 0x203E - } - - // 0x00 to 0x7F, excluding 0x0E, 0x0F, 0x1B, 0x5C, and 0x7E - if (inRange(bite, 0x00, 0x7F) && bite !== 0x0E && bite !== 0x0F - && bite !== 0x1B && bite !== 0x5C && bite !== 0x7E) { - // Unset the iso-2022-jp output flag and return a code point - // whose value is byte. - this.iso2022jp_output_flag = false - return bite - } - - // end-of-stream - if (bite === end_of_stream) { - // Return finished. - return finished - } - - // Otherwise - // Unset the iso-2022-jp output flag and return error. - this.iso2022jp_output_flag = false - return decoderError(this.fatal) - - case this.states.Katakana: - // Katakana - // Based on byte: - - // 0x1B - if (bite === 0x1B) { - // Set iso-2022-jp decoder state to escape start and return - // continue. - this.iso2022jp_decoder_state = this.states.EscapeStart - return null - } - - // 0x21 to 0x5F - if (inRange(bite, 0x21, 0x5F)) { - // Unset the iso-2022-jp output flag and return a code point - // whose value is 0xFF61 − 0x21 + byte. - this.iso2022jp_output_flag = false - return 0xFF61 - 0x21 + bite - } - - // end-of-stream - if (bite === end_of_stream) { - // Return finished. - return finished - } - - // Otherwise - // Unset the iso-2022-jp output flag and return error. - this.iso2022jp_output_flag = false - return decoderError(this.fatal) - - case this.states.LeadByte: - // Lead byte - // Based on byte: - - // 0x1B - if (bite === 0x1B) { - // Set iso-2022-jp decoder state to escape start and return - // continue. - this.iso2022jp_decoder_state = this.states.EscapeStart - return null - } - - // 0x21 to 0x7E - if (inRange(bite, 0x21, 0x7E)) { - // Unset the iso-2022-jp output flag, set iso-2022-jp lead - // to byte, iso-2022-jp decoder state to trail byte, and - // return continue. - this.iso2022jp_output_flag = false - this.iso2022jp_lead = bite - this.iso2022jp_decoder_state = this.states.TrailByte - return null - } - - // end-of-stream - if (bite === end_of_stream) { - // Return finished. - return finished - } - - // Otherwise - // Unset the iso-2022-jp output flag and return error. - this.iso2022jp_output_flag = false - return decoderError(this.fatal) - - case this.states.TrailByte: - // Trail byte - // Based on byte: - - // 0x1B - if (bite === 0x1B) { - // Set iso-2022-jp decoder state to escape start and return - // continue. - this.iso2022jp_decoder_state = this.states.EscapeStart - return decoderError(this.fatal) - } - - // 0x21 to 0x7E - if (inRange(bite, 0x21, 0x7E)) { - // 1. Set the iso-2022-jp decoder state to lead byte. - this.iso2022jp_decoder_state = this.states.LeadByte - - // 2. Let pointer be (iso-2022-jp lead − 0x21) × 94 + byte − 0x21. - const pointer = (this.iso2022jp_lead - 0x21) * 94 + bite - 0x21 - - // 3. Let code point be the index code point for pointer in - // index jis0208. - const code_point = indexCodePointFor(pointer, index('jis0208')) - - // 4. If code point is null, return error. - if (code_point === null) - return decoderError(this.fatal) - - // 5. Return a code point whose value is code point. - return code_point - } - - // end-of-stream - if (bite === end_of_stream) { - // Set the iso-2022-jp decoder state to lead byte, prepend - // byte to stream, and return error. - this.iso2022jp_decoder_state = this.states.LeadByte - stream.prepend(bite) - return decoderError(this.fatal) - } - - // Otherwise - // Set iso-2022-jp decoder state to lead byte and return - // error. - this.iso2022jp_decoder_state = this.states.LeadByte - return decoderError(this.fatal) - - case this.states.EscapeStart: - // Escape start - - // 1. If byte is either 0x24 or 0x28, set iso-2022-jp lead to - // byte, iso-2022-jp decoder state to escape, and return - // continue. - if (bite === 0x24 || bite === 0x28) { - this.iso2022jp_lead = bite - this.iso2022jp_decoder_state = this.states.Escape - return null - } - - // 2. Prepend byte to stream. - stream.prepend(bite) - - // 3. Unset the iso-2022-jp output flag, set iso-2022-jp - // decoder state to iso-2022-jp decoder output state, and - // return error. - this.iso2022jp_output_flag = false - this.iso2022jp_decoder_state = this.iso2022jp_decoder_output_state - return decoderError(this.fatal) - - case this.states.Escape: { - // Escape - - // 1. Let lead be iso-2022-jp lead and set iso-2022-jp lead to - // 0x00. - const lead = this.iso2022jp_lead - this.iso2022jp_lead = 0x00 - - // 2. Let state be null. - let state = null - - // 3. If lead is 0x28 and byte is 0x42, set state to ASCII. - if (lead === 0x28 && bite === 0x42) - state = this.states.ASCII - - // 4. If lead is 0x28 and byte is 0x4A, set state to Roman. - if (lead === 0x28 && bite === 0x4A) - state = this.states.Roman - - // 5. If lead is 0x28 and byte is 0x49, set state to Katakana. - if (lead === 0x28 && bite === 0x49) - state = this.states.Katakana - - // 6. If lead is 0x24 and byte is either 0x40 or 0x42, set - // state to lead byte. - if (lead === 0x24 && (bite === 0x40 || bite === 0x42)) - state = this.states.LeadByte - - // 7. If state is non-null, run these substeps: - if (state !== null) { - // 1. Set iso-2022-jp decoder state and iso-2022-jp decoder - // output state to this.states. - this.iso2022jp_decoder_state = this.iso2022jp_decoder_state = state - - // 2. Let output flag be the iso-2022-jp output flag. - const output_flag = this.iso2022jp_output_flag - - // 3. Set the iso-2022-jp output flag. - this.iso2022jp_output_flag = true - - // 4. Return continue, if output flag is unset, and error - // otherwise. - return !output_flag ? null : decoderError(this.fatal) - } - - // 8. Prepend lead and byte to stream. - stream.prepend([lead, bite]) - - // 9. Unset the iso-2022-jp output flag, set iso-2022-jp - // decoder state to iso-2022-jp decoder output state and - // return error. - this.iso2022jp_output_flag = false - this.iso2022jp_decoder_state = this.iso2022jp_decoder_output_state - return decoderError(this.fatal) - } - } - } -} - -// 13.2.2 iso-2022-jp encoder -/** - * @implements {Encoder} - */ -export class ISO2022JPEncoder { - constructor() { - // iso-2022-jp's encoder has an associated iso-2022-jp encoder - // state which is one of ASCII, Roman, and jis0208 (initially - // ASCII). - /** @enum */ - this.states = { - ASCII: 0, - Roman: 1, - jis0208: 2, - } - this.iso2022jp_state = this.states.ASCII - } - /** - * @param {Stream} stream Input stream. - * @param {number} code_point Next code point read from the stream. - */ - handler(stream, code_point) { - // 1. If code point is end-of-stream and iso-2022-jp encoder - // state is not ASCII, prepend code point to stream, set - // iso-2022-jp encoder state to ASCII, and return three bytes - // 0x1B 0x28 0x42. - if (code_point === end_of_stream && - this.iso2022jp_state !== this.states.ASCII) { - stream.prepend(code_point) - this.iso2022jp_state = this.states.ASCII - return [0x1B, 0x28, 0x42] - } - - // 2. If code point is end-of-stream and iso-2022-jp encoder - // state is ASCII, return finished. - if (code_point === end_of_stream && this.iso2022jp_state === this.states.ASCII) - return finished - - // 3. If ISO-2022-JP encoder state is ASCII or Roman, and code - // point is U+000E, U+000F, or U+001B, return error with U+FFFD. - if ((this.iso2022jp_state === this.states.ASCII || - this.iso2022jp_state === this.states.Roman) && - (code_point === 0x000E || code_point === 0x000F || - code_point === 0x001B)) { - return encoderError(0xFFFD) - } - - // 4. If iso-2022-jp encoder state is ASCII and code point is an - // ASCII code point, return a byte whose value is code point. - if (this.iso2022jp_state === this.states.ASCII && - isASCIICodePoint(code_point)) - return code_point - - // 5. If iso-2022-jp encoder state is Roman and code point is an - // ASCII code point, excluding U+005C and U+007E, or is U+00A5 - // or U+203E, run these substeps: - if (this.iso2022jp_state === this.states.Roman && - ((isASCIICodePoint(code_point) && - code_point !== 0x005C && code_point !== 0x007E) || - (code_point == 0x00A5 || code_point == 0x203E))) { - // 1. If code point is an ASCII code point, return a byte - // whose value is code point. - if (isASCIICodePoint(code_point)) - return code_point - - // 2. If code point is U+00A5, return byte 0x5C. - if (code_point === 0x00A5) - return 0x5C - - // 3. If code point is U+203E, return byte 0x7E. - if (code_point === 0x203E) - return 0x7E - } - - // 6. If code point is an ASCII code point, and iso-2022-jp - // encoder state is not ASCII, prepend code point to stream, set - // iso-2022-jp encoder state to ASCII, and return three bytes - // 0x1B 0x28 0x42. - if (isASCIICodePoint(code_point) && - this.iso2022jp_state !== this.states.ASCII) { - stream.prepend(code_point) - this.iso2022jp_state = this.states.ASCII - return [0x1B, 0x28, 0x42] - } - - // 7. If code point is either U+00A5 or U+203E, and iso-2022-jp - // encoder state is not Roman, prepend code point to stream, set - // iso-2022-jp encoder state to Roman, and return three bytes - // 0x1B 0x28 0x4A. - if ((code_point === 0x00A5 || code_point === 0x203E) && - this.iso2022jp_state !== this.states.Roman) { - stream.prepend(code_point) - this.iso2022jp_state = this.states.Roman - return [0x1B, 0x28, 0x4A] - } - - // 8. If code point is U+2212, set it to U+FF0D. - if (code_point === 0x2212) - code_point = 0xFF0D - - // 9. Let pointer be the index pointer for code point in index - // jis0208. - const pointer = indexPointerFor(code_point, index('jis0208')) - - // 10. If pointer is null, return error with code point. - if (pointer === null) - return encoderError(code_point) - - // 11. If iso-2022-jp encoder state is not jis0208, prepend code - // point to stream, set iso-2022-jp encoder state to jis0208, - // and return three bytes 0x1B 0x24 0x42. - if (this.iso2022jp_state !== this.states.jis0208) { - stream.prepend(code_point) - this.iso2022jp_state = this.states.jis0208 - return [0x1B, 0x24, 0x42] - } - - // 12. Let lead be floor(pointer / 94) + 0x21. - const lead = floor(pointer / 94) + 0x21 - - // 13. Let trail be pointer % 94 + 0x21. - const trail = pointer % 94 + 0x21 - - // 14. Return two bytes whose values are lead and trail. - return [lead, trail] - } -} \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/text-decoding/src/implementations/shift-jis.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/text-decoding/src/implementations/shift-jis.js deleted file mode 100644 index daff389f..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/text-decoding/src/implementations/shift-jis.js +++ /dev/null @@ -1,170 +0,0 @@ -import { inRange, decoderError, encoderError, floor, isASCIICodePoint, isASCIIByte, - end_of_stream, finished } from '../utils' -import index, { indexCodePointFor, indexShiftJISPointerFor } from '../indexes' - - -// 13.3 Shift_JIS - -// 13.3.1 Shift_JIS decoder -/** - * @constructor - * @implements {Decoder} - * @param {{fatal: boolean}} options - */ -export class ShiftJISDecoder { - constructor(options) { - const { fatal } = options - this.fatal = fatal - // Shift_JIS's decoder has an associated Shift_JIS lead (initially - // 0x00). - this.Shift_JIS_lead = 0x00 - } - /** - * @param {Stream} stream The stream of bytes being decoded. - * @param {number} bite The next byte read from the stream. - */ - handler(stream, bite) { - // 1. If byte is end-of-stream and Shift_JIS lead is not 0x00, - // set Shift_JIS lead to 0x00 and return error. - if (bite === end_of_stream && this.Shift_JIS_lead !== 0x00) { - this.Shift_JIS_lead = 0x00 - return decoderError(this.fatal) - } - - // 2. If byte is end-of-stream and Shift_JIS lead is 0x00, - // return finished. - if (bite === end_of_stream && this.Shift_JIS_lead === 0x00) - return finished - - // 3. If Shift_JIS lead is not 0x00, let lead be Shift_JIS lead, - // let pointer be null, set Shift_JIS lead to 0x00, and then run - // these substeps: - if (this.Shift_JIS_lead !== 0x00) { - var lead = this.Shift_JIS_lead - var pointer = null - this.Shift_JIS_lead = 0x00 - - // 1. Let offset be 0x40, if byte is less than 0x7F, and 0x41 - // otherwise. - var offset = (bite < 0x7F) ? 0x40 : 0x41 - - // 2. Let lead offset be 0x81, if lead is less than 0xA0, and - // 0xC1 otherwise. - var lead_offset = (lead < 0xA0) ? 0x81 : 0xC1 - - // 3. If byte is in the range 0x40 to 0x7E, inclusive, or 0x80 - // to 0xFC, inclusive, set pointer to (lead − lead offset) × - // 188 + byte − offset. - if (inRange(bite, 0x40, 0x7E) || inRange(bite, 0x80, 0xFC)) - pointer = (lead - lead_offset) * 188 + bite - offset - - // 4. If pointer is in the range 8836 to 10715, inclusive, - // return a code point whose value is 0xE000 − 8836 + pointer. - if (inRange(pointer, 8836, 10715)) - return 0xE000 - 8836 + pointer - - // 5. Let code point be null, if pointer is null, and the - // index code point for pointer in index jis0208 otherwise. - var code_point = (pointer === null) ? null : - indexCodePointFor(pointer, index('jis0208')) - - // 6. If code point is null and byte is an ASCII byte, prepend - // byte to stream. - if (code_point === null && isASCIIByte(bite)) - stream.prepend(bite) - - // 7. If code point is null, return error. - if (code_point === null) - return decoderError(this.fatal) - - // 8. Return a code point whose value is code point. - return code_point - } - - // 4. If byte is an ASCII byte or 0x80, return a code point - // whose value is byte. - if (isASCIIByte(bite) || bite === 0x80) - return bite - - // 5. If byte is in the range 0xA1 to 0xDF, inclusive, return a - // code point whose value is 0xFF61 − 0xA1 + byte. - if (inRange(bite, 0xA1, 0xDF)) - return 0xFF61 - 0xA1 + bite - - // 6. If byte is in the range 0x81 to 0x9F, inclusive, or 0xE0 - // to 0xFC, inclusive, set Shift_JIS lead to byte and return - // continue. - if (inRange(bite, 0x81, 0x9F) || inRange(bite, 0xE0, 0xFC)) { - this.Shift_JIS_lead = bite - return null - } - - // 7. Return error. - return decoderError(this.fatal) - } -} - -// 13.3.2 Shift_JIS encoder -/** - * @constructor - * @implements {Encoder} - * @param {{fatal: boolean}} options - */ -export class ShiftJISEncoder { - /** - * @param {Stream} stream Input stream. - * @param {number} code_point Next code point read from the stream. - */ - handler(stream, code_point) { - // 1. If code point is end-of-stream, return finished. - if (code_point === end_of_stream) - return finished - - // 2. If code point is an ASCII code point or U+0080, return a - // byte whose value is code point. - if (isASCIICodePoint(code_point) || code_point === 0x0080) - return code_point - - // 3. If code point is U+00A5, return byte 0x5C. - if (code_point === 0x00A5) - return 0x5C - - // 4. If code point is U+203E, return byte 0x7E. - if (code_point === 0x203E) - return 0x7E - - // 5. If code point is in the range U+FF61 to U+FF9F, inclusive, - // return a byte whose value is code point − 0xFF61 + 0xA1. - if (inRange(code_point, 0xFF61, 0xFF9F)) - return code_point - 0xFF61 + 0xA1 - - // 6. If code point is U+2212, set it to U+FF0D. - if (code_point === 0x2212) - code_point = 0xFF0D - - // 7. Let pointer be the index Shift_JIS pointer for code point. - var pointer = indexShiftJISPointerFor(code_point) - - // 8. If pointer is null, return error with code point. - if (pointer === null) - return encoderError(code_point) - - // 9. Let lead be floor(pointer / 188). - var lead = floor(pointer / 188) - - // 10. Let lead offset be 0x81, if lead is less than 0x1F, and - // 0xC1 otherwise. - var lead_offset = (lead < 0x1F) ? 0x81 : 0xC1 - - // 11. Let trail be pointer % 188. - var trail = pointer % 188 - - // 12. Let offset be 0x40, if trail is less than 0x3F, and 0x41 - // otherwise. - var offset = (trail < 0x3F) ? 0x40 : 0x41 - - // 13. Return two bytes whose values are lead + lead offset and - // trail + offset. - return [lead + lead_offset, trail + offset] - } -} \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/text-decoding/src/implementations/single-byte.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/text-decoding/src/implementations/single-byte.js deleted file mode 100644 index 9d0c0378..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/text-decoding/src/implementations/single-byte.js +++ /dev/null @@ -1,86 +0,0 @@ -import { end_of_stream, finished, isASCIIByte, decoderError, encoderError, isASCIICodePoint } from '../utils' -import { indexPointerFor } from '../indexes' - -// -// 10. Legacy single-byte encodings -// - -// 10.1 single-byte decoder -/** - * @implements {Decoder} - */ -export class SingleByteDecoder { - /** - * @param {!Array.} index The encoding index. - * @param {{fatal: boolean}} options - */ - constructor(index, options) { - const { fatal } = options - this.fatal = fatal - this.index = index - } - /** - * @param {Stream} stream The stream of bytes being decoded. - * @param {number} bite The next byte read from the stream. - */ - handler(stream, bite) { - // 1. If byte is end-of-stream, return finished. - if (bite === end_of_stream) - return finished - - // 2. If byte is an ASCII byte, return a code point whose value - // is byte. - if (isASCIIByte(bite)) - return bite - - // 3. Let code point be the index code point for byte − 0x80 in - // index single-byte. - var code_point = this.index[bite - 0x80] - - // 4. If code point is null, return error. - if (code_point === null) - return decoderError(this.fatal) - - // 5. Return a code point whose value is code point. - return code_point - } -} - -// 10.2 single-byte encoder -/** - * @implements {Encoder} - */ -export class SingleByteEncoder { - /** - * @param {!Array.} index The encoding index. - */ - constructor(index) { - this.index = index - } - /** - * @param {Stream} stream Input stream. - * @param {number} code_point Next code point read from the stream. - * @return {(number|!Array.)} Byte(s) to emit. - */ - handler(stream, code_point) { - // 1. If code point is end-of-stream, return finished. - if (code_point === end_of_stream) - return finished - - // 2. If code point is an ASCII code point, return a byte whose - // value is code point. - if (isASCIICodePoint(code_point)) - return code_point - - // 3. Let pointer be the index pointer for code point in index - // single-byte. - const pointer = indexPointerFor(code_point, this.index) - - // 4. If pointer is null, return error with code point. - if (pointer === null) - encoderError(code_point) - - // 5. Return a byte whose value is pointer + 0x80. - return pointer + 0x80 - } -} \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/text-decoding/src/implementations/utf16.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/text-decoding/src/implementations/utf16.js deleted file mode 100644 index a31e1c87..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/text-decoding/src/implementations/utf16.js +++ /dev/null @@ -1,139 +0,0 @@ -import { inRange, decoderError, end_of_stream, finished, convertCodeUnitToBytes } from '../utils' - -// 15.2.1 shared utf-16 decoder - -/** - * @implements {Decoder} - */ -export class UTF16Decoder { - /** - * @param {boolean} utf16_be True if big-endian, false if little-endian. - * @param {{fatal: boolean}} options - */ - constructor(utf16_be, options) { - const { fatal } = options - this.utf16_be = utf16_be - this.fatal = fatal - this.utf16_lead_byte = null - this.utf16_lead_surrogate = null - } - /** - * @param {Stream} stream The stream of bytes being decoded. - * @param {number} bite The next byte read from the stream. - */ - handler(stream, bite) { - // 1. If byte is end-of-stream and either utf-16 lead byte or - // utf-16 lead surrogate is not null, set utf-16 lead byte and - // utf-16 lead surrogate to null, and return error. - if (bite === end_of_stream && (this.utf16_lead_byte !== null || - this.utf16_lead_surrogate !== null)) { - return decoderError(this.fatal) - } - - // 2. If byte is end-of-stream and utf-16 lead byte and utf-16 - // lead surrogate are null, return finished. - if (bite === end_of_stream && this.utf16_lead_byte === null && - this.utf16_lead_surrogate === null) { - return finished - } - - // 3. If utf-16 lead byte is null, set utf-16 lead byte to byte - // and return continue. - if (this.utf16_lead_byte === null) { - this.utf16_lead_byte = bite - return null - } - - // 4. Let code unit be the result of: - let code_unit - if (this.utf16_be) { - // utf-16be decoder flag is set - // (utf-16 lead byte << 8) + byte. - code_unit = (this.utf16_lead_byte << 8) + bite - } else { - // utf-16be decoder flag is unset - // (byte << 8) + utf-16 lead byte. - code_unit = (bite << 8) + this.utf16_lead_byte - } - // Then set utf-16 lead byte to null. - this.utf16_lead_byte = null - - // 5. If utf-16 lead surrogate is not null, let lead surrogate - // be utf-16 lead surrogate, set utf-16 lead surrogate to null, - // and then run these substeps: - if (this.utf16_lead_surrogate !== null) { - const lead_surrogate = this.utf16_lead_surrogate - this.utf16_lead_surrogate = null - - // 1. If code unit is in the range U+DC00 to U+DFFF, - // inclusive, return a code point whose value is 0x10000 + - // ((lead surrogate − 0xD800) << 10) + (code unit − 0xDC00). - if (inRange(code_unit, 0xDC00, 0xDFFF)) { - return 0x10000 + (lead_surrogate - 0xD800) * 0x400 + - (code_unit - 0xDC00) - } - - // 2. Prepend the sequence resulting of converting code unit - // to bytes using utf-16be decoder flag to stream and return - // error. - stream.prepend(convertCodeUnitToBytes(code_unit, this.utf16_be)) - return decoderError(this.fatal) - } - - // 6. If code unit is in the range U+D800 to U+DBFF, inclusive, - // set utf-16 lead surrogate to code unit and return continue. - if (inRange(code_unit, 0xD800, 0xDBFF)) { - this.utf16_lead_surrogate = code_unit - return null - } - - // 7. If code unit is in the range U+DC00 to U+DFFF, inclusive, - // return error. - if (inRange(code_unit, 0xDC00, 0xDFFF)) - return decoderError(this.fatal) - - // 8. Return code point code unit. - return code_unit - } -} - -// 15.2.2 shared utf-16 encoder -/** - * @implements {Encoder} - */ -export class UTF16Encoder { - /** - * @param {boolean} [utf16_be] True if big-endian, false if little-endian. - */ - constructor(utf16_be = false) { - this.utf16_be = utf16_be - } - /** - * @param {Stream} stream Input stream. - * @param {number} code_point Next code point read from the stream. - */ - handler(stream, code_point) { - // 1. If code point is end-of-stream, return finished. - if (code_point === end_of_stream) - return finished - - // 2. If code point is in the range U+0000 to U+FFFF, inclusive, - // return the sequence resulting of converting code point to - // bytes using utf-16be encoder flag. - if (inRange(code_point, 0x0000, 0xFFFF)) - return convertCodeUnitToBytes(code_point, this.utf16_be) - - // 3. Let lead be ((code point − 0x10000) >> 10) + 0xD800, - // converted to bytes using utf-16be encoder flag. - const lead = convertCodeUnitToBytes( - ((code_point - 0x10000) >> 10) + 0xD800, this.utf16_be) - - // 4. Let trail be ((code point − 0x10000) & 0x3FF) + 0xDC00, - // converted to bytes using utf-16be encoder flag. - const trail = convertCodeUnitToBytes( - ((code_point - 0x10000) & 0x3FF) + 0xDC00, this.utf16_be) - - // 5. Return a byte sequence of lead followed by trail. - return lead.concat(trail) - } -} \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/text-decoding/src/implementations/utf8.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/text-decoding/src/implementations/utf8.js deleted file mode 100644 index 9e673961..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/text-decoding/src/implementations/utf8.js +++ /dev/null @@ -1,208 +0,0 @@ -import { inRange, decoderError, isASCIICodePoint, - end_of_stream, finished } from '../utils' - -/** - * @implements {Decoder} - */ -export class UTF8Decoder { - /** - * @param {{fatal: boolean}} options - */ - constructor(options) { - const { fatal } = options - - // utf-8's decoder's has an associated utf-8 code point, utf-8 - // bytes seen, and utf-8 bytes needed (all initially 0), a utf-8 - // lower boundary (initially 0x80), and a utf-8 upper boundary - // (initially 0xBF). - let /** @type {number} */ utf8_code_point = 0, - /** @type {number} */ utf8_bytes_seen = 0, - /** @type {number} */ utf8_bytes_needed = 0, - /** @type {number} */ utf8_lower_boundary = 0x80, - /** @type {number} */ utf8_upper_boundary = 0xBF - - /** - * @param {Stream} stream The stream of bytes being decoded. - * @param {number} bite The next byte read from the stream. - * @return {?(number|!Array.)} The next code point(s) - * decoded, or null if not enough data exists in the input - * stream to decode a complete code point. - */ - this.handler = function(stream, bite) { - // 1. If byte is end-of-stream and utf-8 bytes needed is not 0, - // set utf-8 bytes needed to 0 and return error. - if (bite === end_of_stream && utf8_bytes_needed !== 0) { - utf8_bytes_needed = 0 - return decoderError(fatal) - } - - // 2. If byte is end-of-stream, return finished. - if (bite === end_of_stream) - return finished - - // 3. If utf-8 bytes needed is 0, based on byte: - if (utf8_bytes_needed === 0) { - // 0x00 to 0x7F - if (inRange(bite, 0x00, 0x7F)) { - // Return a code point whose value is byte. - return bite - } - - // 0xC2 to 0xDF - else if (inRange(bite, 0xC2, 0xDF)) { - // 1. Set utf-8 bytes needed to 1. - utf8_bytes_needed = 1 - - // 2. Set UTF-8 code point to byte & 0x1F. - utf8_code_point = bite & 0x1F - } - - // 0xE0 to 0xEF - else if (inRange(bite, 0xE0, 0xEF)) { - // 1. If byte is 0xE0, set utf-8 lower boundary to 0xA0. - if (bite === 0xE0) - utf8_lower_boundary = 0xA0 - // 2. If byte is 0xED, set utf-8 upper boundary to 0x9F. - if (bite === 0xED) - utf8_upper_boundary = 0x9F - // 3. Set utf-8 bytes needed to 2. - utf8_bytes_needed = 2 - // 4. Set UTF-8 code point to byte & 0xF. - utf8_code_point = bite & 0xF - } - - // 0xF0 to 0xF4 - else if (inRange(bite, 0xF0, 0xF4)) { - // 1. If byte is 0xF0, set utf-8 lower boundary to 0x90. - if (bite === 0xF0) - utf8_lower_boundary = 0x90 - // 2. If byte is 0xF4, set utf-8 upper boundary to 0x8F. - if (bite === 0xF4) - utf8_upper_boundary = 0x8F - // 3. Set utf-8 bytes needed to 3. - utf8_bytes_needed = 3 - // 4. Set UTF-8 code point to byte & 0x7. - utf8_code_point = bite & 0x7 - } - - // Otherwise - else { - // Return error. - return decoderError(fatal) - } - - // Return continue. - return null - } - - // 4. If byte is not in the range utf-8 lower boundary to utf-8 - // upper boundary, inclusive, run these substeps: - if (!inRange(bite, utf8_lower_boundary, utf8_upper_boundary)) { - // 1. Set utf-8 code point, utf-8 bytes needed, and utf-8 - // bytes seen to 0, set utf-8 lower boundary to 0x80, and set - // utf-8 upper boundary to 0xBF. - utf8_code_point = utf8_bytes_needed = utf8_bytes_seen = 0 - utf8_lower_boundary = 0x80 - utf8_upper_boundary = 0xBF - - // 2. Prepend byte to stream. - stream.prepend(bite) - - // 3. Return error. - return decoderError(fatal) - } - - // 5. Set utf-8 lower boundary to 0x80 and utf-8 upper boundary - // to 0xBF. - utf8_lower_boundary = 0x80 - utf8_upper_boundary = 0xBF - - // 6. Set UTF-8 code point to (UTF-8 code point << 6) | (byte & - // 0x3F) - utf8_code_point = (utf8_code_point << 6) | (bite & 0x3F) - - // 7. Increase utf-8 bytes seen by one. - utf8_bytes_seen += 1 - - // 8. If utf-8 bytes seen is not equal to utf-8 bytes needed, - // continue. - if (utf8_bytes_seen !== utf8_bytes_needed) - return null - - // 9. Let code point be utf-8 code point. - var code_point = utf8_code_point - - // 10. Set utf-8 code point, utf-8 bytes needed, and utf-8 bytes - // seen to 0. - utf8_code_point = utf8_bytes_needed = utf8_bytes_seen = 0 - - // 11. Return a code point whose value is code point. - return code_point - } - } -} - -// 9.1.2 utf-8 encoder - -/** - * @implements {Encoder} - */ -export class UTF8Encoder { - constructor() { - /** - * @param {Stream} stream Input stream. - * @param {number} code_point Next code point read from the stream. - * @return {(number|!Array.)} Byte(s) to emit. - */ - this.handler = function(stream, code_point) { - // 1. If code point is end-of-stream, return finished. - if (code_point === end_of_stream) - return finished - - // 2. If code point is an ASCII code point, return a byte whose - // value is code point. - if (isASCIICodePoint(code_point)) - return code_point - - // 3. Set count and offset based on the range code point is in: - var count, offset - // U+0080 to U+07FF, inclusive: - if (inRange(code_point, 0x0080, 0x07FF)) { - // 1 and 0xC0 - count = 1 - offset = 0xC0 - } - // U+0800 to U+FFFF, inclusive: - else if (inRange(code_point, 0x0800, 0xFFFF)) { - // 2 and 0xE0 - count = 2 - offset = 0xE0 - } - // U+10000 to U+10FFFF, inclusive: - else if (inRange(code_point, 0x10000, 0x10FFFF)) { - // 3 and 0xF0 - count = 3 - offset = 0xF0 - } - - // 4. Let bytes be a byte sequence whose first byte is (code - // point >> (6 × count)) + offset. - var bytes = [(code_point >> (6 * count)) + offset] - - // 5. Run these substeps while count is greater than 0: - while (count > 0) { - // 1. Set temp to code point >> (6 × (count − 1)). - var temp = code_point >> (6 * (count - 1)) - - // 2. Append to bytes 0x80 | (temp & 0x3F). - bytes.push(0x80 | (temp & 0x3F)) - - // 3. Decrease count by one. - count -= 1 - } - - // 6. Return bytes bytes, in order. - return bytes - } - } -} \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/text-decoding/src/implementations/x-user-defined.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/text-decoding/src/implementations/x-user-defined.js deleted file mode 100644 index 21d6fb8d..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/text-decoding/src/implementations/x-user-defined.js +++ /dev/null @@ -1,56 +0,0 @@ -import { inRange, encoderError, end_of_stream, finished, isASCIIByte, isASCIICodePoint } from '../utils' - -// 15.5 x-user-defined - -// 15.5.1 x-user-defined decoder -/** - * @implements {Decoder} - */ -export class XUserDefinedDecoder { - /** - * @param {Stream} stream The stream of bytes being decoded. - * @param {number} bite The next byte read from the stream. - */ - handler(stream, bite) { - // 1. If byte is end-of-stream, return finished. - if (bite === end_of_stream) - return finished - - // 2. If byte is an ASCII byte, return a code point whose value - // is byte. - if (isASCIIByte(bite)) - return bite - - // 3. Return a code point whose value is 0xF780 + byte − 0x80. - return 0xF780 + bite - 0x80 - } -} - -// 15.5.2 x-user-defined encoder -/** - * @implements {Encoder} - */ -export class XUserDefinedEncoder { - /** - * @param {Stream} stream Input stream. - * @param {number} code_point Next code point read from the stream. - */ - handler(stream, code_point) { - // 1.If code point is end-of-stream, return finished. - if (code_point === end_of_stream) - return finished - - // 2. If code point is an ASCII code point, return a byte whose - // value is code point. - if (isASCIICodePoint(code_point)) - return code_point - - // 3. If code point is in the range U+F780 to U+F7FF, inclusive, - // return a byte whose value is code point − 0xF780 + 0x80. - if (inRange(code_point, 0xF780, 0xF7FF)) - return code_point - 0xF780 + 0x80 - - // 4. Return error with code point. - return encoderError(code_point) - } -} \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/text-decoding/src/index.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/text-decoding/src/index.js deleted file mode 100644 index d58a6a2d..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/text-decoding/src/index.js +++ /dev/null @@ -1,11 +0,0 @@ -import TextEncoder from './lib/TextEncoder' -import TextDecoder from './lib/TextDecoder' -import EncodingIndexes from './encoding-indexes' -import { getEncoding } from './lib' - -// -// Implementation of Encoding specification -// https://encoding.spec.whatwg.org/ -// - -export { TextEncoder, TextDecoder, EncodingIndexes, getEncoding } \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/text-decoding/src/indexes.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/text-decoding/src/indexes.js deleted file mode 100644 index 6d3cc324..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/text-decoding/src/indexes.js +++ /dev/null @@ -1,153 +0,0 @@ -import { inRange } from './utils' -import Indexes from './encoding-indexes' - -// -// 6. Indexes -// - -/** - * @param {number} pointer The |pointer| to search for. - * @param {(!Array.|undefined)} index The |index| to search within. - * @return {?number} The code point corresponding to |pointer| in |index|, - * or null if |code point| is not in |index|. - */ -export function indexCodePointFor(pointer, i) { - if (!i) return null - return i[pointer] || null -} - -/** - * @param {number} code_point The |code point| to search for. - * @param {!Array.} i The |index| to search within. - * @return {?number} The first pointer corresponding to |code point| in - * |index|, or null if |code point| is not in |index|. - */ -export function indexPointerFor(code_point, i) { - var pointer = i.indexOf(code_point) - return pointer === -1 ? null : pointer -} - -/** - * @param {string} name Name of the index. - */ -export default function index(name) { - return Indexes[name] -} - -/** - * @param {number} pointer The |pointer| to search for in the gb18030 index. - * @return The code point corresponding to |pointer| in |index|, - * or null if |code point| is not in the gb18030 index. - */ -export function indexGB18030RangesCodePointFor(pointer) { - // 1. If pointer is greater than 39419 and less than 189000, or - // pointer is greater than 1237575, return null. - if ((pointer > 39419 && pointer < 189000) || (pointer > 1237575)) - return null - - // 2. If pointer is 7457, return code point U+E7C7. - if (pointer === 7457) return 0xE7C7 - - // 3. Let offset be the last pointer in index gb18030 ranges that - // is equal to or less than pointer and let code point offset be - // its corresponding code point. - var offset = 0 - var code_point_offset = 0 - var idx = index('gb18030-ranges') - var i - for (i = 0; i < idx.length; ++i) { - /** @type {!Array.} */ - var entry = idx[i] - if (entry[0] <= pointer) { - offset = entry[0] - code_point_offset = entry[1] - } else { - break - } - } - - // 4. Return a code point whose value is code point offset + - // pointer − offset. - return code_point_offset + pointer - offset -} - -/** - * @param {number} code_point The |code point| to locate in the gb18030 index. - * @return {number} The first pointer corresponding to |code point| in the - * gb18030 index. - */ -export function indexGB18030RangesPointerFor(code_point) { - // 1. If code point is U+E7C7, return pointer 7457. - if (code_point === 0xE7C7) return 7457 - - // 2. Let offset be the last code point in index gb18030 ranges - // that is equal to or less than code point and let pointer offset - // be its corresponding pointer. - var offset = 0 - var pointer_offset = 0 - var idx = index('gb18030-ranges') - var i - for (i = 0; i < idx.length; ++i) { - /** @type {!Array.} */ - var entry = idx[i] - if (entry[1] <= code_point) { - offset = entry[1] - pointer_offset = entry[0] - } else { - break - } - } - - // 3. Return a pointer whose value is pointer offset + code point - // − offset. - return pointer_offset + code_point - offset -} - -/** - * @param {number} code_point The |code_point| to search for in the Shift_JIS - * index. - * @return {?number} The code point corresponding to |pointer| in |index|, - * or null if |code point| is not in the Shift_JIS index. - */ -export function indexShiftJISPointerFor(code_point) { - // 1. Let index be index jis0208 excluding all entries whose - // pointer is in the range 8272 to 8835, inclusive. - shift_jis_index = shift_jis_index || - index('jis0208').map((cp, pointer) => { - return inRange(pointer, 8272, 8835) ? null : cp - }) - const index_ = shift_jis_index - - // 2. Return the index pointer for code point in index. - return index_.indexOf(code_point) -} -var shift_jis_index - -/** - * @param {number} code_point The |code_point| to search for in the big5 - * index. - * @return {?number} The code point corresponding to |pointer| in |index|, - * or null if |code point| is not in the big5 index. - */ -export function indexBig5PointerFor(code_point) { - // 1. Let index be index Big5 excluding all entries whose pointer - big5_index_no_hkscs = big5_index_no_hkscs || - index('big5').map((cp, pointer) => { - return (pointer < (0xA1 - 0x81) * 157) ? null : cp - }) - var index_ = big5_index_no_hkscs - - // 2. If code point is U+2550, U+255E, U+2561, U+256A, U+5341, or - // U+5345, return the last pointer corresponding to code point in - // index. - if (code_point === 0x2550 || code_point === 0x255E || - code_point === 0x2561 || code_point === 0x256A || - code_point === 0x5341 || code_point === 0x5345) { - return index_.lastIndexOf(code_point) - } - - // 3. Return the index pointer for code point in index. - return indexPointerFor(code_point, index_) -} - -var big5_index_no_hkscs \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/text-decoding/src/lib/TextDecoder.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/text-decoding/src/lib/TextDecoder.js deleted file mode 100644 index bfff67f7..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/text-decoding/src/lib/TextDecoder.js +++ /dev/null @@ -1,189 +0,0 @@ -import Stream, { DEFAULT_ENCODING, getEncoding } from './' -import { end_of_stream, finished, codePointsToString } from '../utils' -import { decoders } from '../table' - -// 8.1 Interface TextDecoder - -export default class TextDecoder { - /** - * @param {string=} label The label of the encoding; defaults to 'utf-8'. - * @param {Object=} options - */ - constructor(label = DEFAULT_ENCODING, options = {}) { - // A TextDecoder object has an associated encoding, decoder, - // stream, ignore BOM flag (initially unset), BOM seen flag - // (initially unset), error mode (initially replacement), and do - // not flush flag (initially unset). - - /** @private */ - this._encoding = null - /** @private @type {?Decoder} */ - this._decoder = null - /** @private @type {boolean} */ - this._ignoreBOM = false - /** @private @type {boolean} */ - this._BOMseen = false - /** @private @type {string} */ - this._error_mode = 'replacement' - /** @private @type {boolean} */ - this._do_not_flush = false - - - // 1. Let encoding be the result of getting an encoding from - // label. - const encoding = getEncoding(label) - - // 2. If encoding is failure or replacement, throw a RangeError. - if (encoding === null || encoding.name == 'replacement') - throw RangeError('Unknown encoding: ' + label) - if (!decoders[encoding.name]) { - throw Error('Decoder not present.' + - ' Did you forget to include encoding-indexes.js first?') - } - - // 4. Set dec's encoding to encoding. - this._encoding = encoding - - // 5. If options's fatal member is true, set dec's error mode to - // fatal. - if (options['fatal']) - this._error_mode = 'fatal' - - // 6. If options's ignoreBOM member is true, set dec's ignore BOM - // flag. - if (options['ignoreBOM']) - this._ignoreBOM = true - } - - get encoding() { - return this._encoding.name.toLowerCase() - } - get fatal() { - return this._error_mode === 'fatal' - } - get ignoreBOM() { - return this._ignoreBOM - } - /** - * @param {BufferSource=} input The buffer of bytes to decode. - * @param {Object=} options - * @return The decoded string. - */ - decode(input, options = {}) { - let bytes - if (typeof input === 'object' && input instanceof ArrayBuffer) { - bytes = new Uint8Array(input) - } else if (typeof input === 'object' && 'buffer' in input && - input.buffer instanceof ArrayBuffer) { - bytes = new Uint8Array(input.buffer, - input.byteOffset, - input.byteLength) - } else { - bytes = new Uint8Array(0) - } - - // 1. If the do not flush flag is unset, set decoder to a new - // encoding's decoder, set stream to a new stream, and unset the - // BOM seen flag. - if (!this._do_not_flush) { - this._decoder = decoders[this._encoding.name]({ - fatal: this._error_mode === 'fatal' }) - this._BOMseen = false - } - - // 2. If options's stream is true, set the do not flush flag, and - // unset the do not flush flag otherwise. - this._do_not_flush = Boolean(options['stream']) - - // 3. If input is given, push a copy of input to stream. - // TODO: Align with spec algorithm - maintain stream on instance. - const input_stream = new Stream(bytes) - - // 4. Let output be a new stream. - const output = [] - - /** @type {?(number|!Array.)} */ - let result - - // 5. While true: - while (true) { - // 1. Let token be the result of reading from stream. - const token = input_stream.read() - - // 2. If token is end-of-stream and the do not flush flag is - // set, return output, serialized. - // TODO: Align with spec algorithm. - if (token === end_of_stream) - break - - // 3. Otherwise, run these subsubsteps: - - // 1. Let result be the result of processing token for decoder, - // stream, output, and error mode. - result = this._decoder.handler(input_stream, token) - - // 2. If result is finished, return output, serialized. - if (result === finished) - break - - if (result !== null) { - if (Array.isArray(result)) - output.push.apply(output, /**@type {!Array.}*/(result)) - else - output.push(result) - } - - // 3. Otherwise, if result is error, throw a TypeError. - // (Thrown in handler) - - // 4. Otherwise, do nothing. - } - // TODO: Align with spec algorithm. - if (!this._do_not_flush) { - do { - result = this._decoder.handler(input_stream, input_stream.read()) - if (result === finished) - break - if (result === null) - continue - if (Array.isArray(result)) - output.push.apply(output, /**@type {!Array.}*/(result)) - else - output.push(result) - } while (!input_stream.endOfStream()) - this._decoder = null - } - - return this.serializeStream(output) - } - // A TextDecoder object also has an associated serialize stream - // algorithm... - /** - * @param {!Array.} stream - */ - serializeStream(stream) { - // 1. Let token be the result of reading from stream. - // (Done in-place on array, rather than as a stream) - - // 2. If encoding is UTF-8, UTF-16BE, or UTF-16LE, and ignore - // BOM flag and BOM seen flag are unset, run these subsubsteps: - if (['UTF-8', 'UTF-16LE', 'UTF-16BE'].includes(this._encoding.name) && - !this._ignoreBOM && !this._BOMseen) { - if (stream.length > 0 && stream[0] === 0xFEFF) { - // 1. If token is U+FEFF, set BOM seen flag. - this._BOMseen = true - stream.shift() - } else if (stream.length > 0) { - // 2. Otherwise, if token is not end-of-stream, set BOM seen - // flag and append token to stream. - this._BOMseen = true - } else { - // 3. Otherwise, if token is not end-of-stream, append token - // to output. - // (no-op) - } - } - // 4. Otherwise, return output. - return codePointsToString(stream) - } -} \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/text-decoding/src/lib/TextEncoder.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/text-decoding/src/lib/TextEncoder.js deleted file mode 100644 index d30b4ab4..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/text-decoding/src/lib/TextEncoder.js +++ /dev/null @@ -1,106 +0,0 @@ -import Stream, { DEFAULT_ENCODING, getEncoding } from './' -import { end_of_stream, finished, stringToCodePoints } from '../utils' -import { encoders } from '../table' - -// 8.2 Interface TextEncoder - -export default class TextEncoder { - /** - * @param {string=} label The label of the encoding. NONSTANDARD. - * @param {Object=} [options] NONSTANDARD. - */ - constructor(label, options = {}) { - // A TextEncoder object has an associated encoding and encoder. - - /** @private */ - this._encoding = null - /** @private @type {?Encoder} */ - this._encoder = null - - // Non-standard - /** @private @type {boolean} */ - this._do_not_flush = false - /** @private @type {string} */ - this._fatal = options['fatal'] ? 'fatal' : 'replacement' - - // 2. Set enc's encoding to UTF-8's encoder. - if (options['NONSTANDARD_allowLegacyEncoding']) { - // NONSTANDARD behavior. - label = label !== undefined ? String(label) : DEFAULT_ENCODING - var encoding = getEncoding(label) - if (encoding === null || encoding.name === 'replacement') - throw RangeError('Unknown encoding: ' + label) - if (!encoders[encoding.name]) { - throw Error('Encoder not present.' + - ' Did you forget to include encoding-indexes.js first?') - } - this._encoding = encoding - } else { - // Standard behavior. - this._encoding = getEncoding('utf-8') - - if (label !== undefined && 'console' in global) { - console.warn('TextEncoder constructor called with encoding label, ' - + 'which is ignored.') - } - } - } - get encoding() { - return this._encoding.name.toLowerCase() - } - /** - * @param {string=} opt_string The string to encode. - * @param {Object=} options - */ - encode(opt_string = '', options = {}) { - // NOTE: This option is nonstandard. None of the encodings - // permitted for encoding (i.e. UTF-8, UTF-16) are stateful when - // the input is a USVString so streaming is not necessary. - if (!this._do_not_flush) - this._encoder = encoders[this._encoding.name]({ - fatal: this._fatal === 'fatal' }) - this._do_not_flush = Boolean(options['stream']) - - // 1. Convert input to a stream. - const input = new Stream(stringToCodePoints(opt_string)) - - // 2. Let output be a new stream - const output = [] - - /** @type {?(number|!Array.)} */ - var result - // 3. While true, run these substeps: - while (true) { - // 1. Let token be the result of reading from input. - var token = input.read() - if (token === end_of_stream) - break - // 2. Let result be the result of processing token for encoder, - // input, output. - result = this._encoder.handler(input, token) - if (result === finished) - break - if (Array.isArray(result)) - output.push.apply(output, /**@type {!Array.}*/(result)) - else - output.push(result) - } - // TODO: Align with spec algorithm. - if (!this._do_not_flush) { - while (true) { - result = this._encoder.handler(input, input.read()) - if (result === finished) - break - if (Array.isArray(result)) - output.push.apply(output, /**@type {!Array.}*/(result)) - else - output.push(result) - } - this._encoder = null - } - // 3. If result is finished, convert output into a byte sequence, - // and then return a Uint8Array object wrapping an ArrayBuffer - // containing output. - return new Uint8Array(output) - } -} \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/text-decoding/src/lib/index.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/text-decoding/src/lib/index.js deleted file mode 100644 index 265995c5..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/text-decoding/src/lib/index.js +++ /dev/null @@ -1,118 +0,0 @@ -import { end_of_stream } from '../utils' -import { label_to_encoding } from '../table' - -export default class Stream { - /** - * A stream represents an ordered sequence of tokens. - * @param {!(Array.|Uint8Array)} tokens Array of tokens that provide - * the stream. - */ - constructor(tokens) { - this.tokens = [...tokens] - // Reversed as push/pop is more efficient than shift/unshift. - this.tokens.reverse() - } - /** - * @returns True if end-of-stream has been hit. - */ - endOfStream() { - return !this.tokens.length - } - /** - * When a token is read from a stream, the first token in the - * stream must be returned and subsequently removed, and - * end-of-stream must be returned otherwise. - * - * @return Get the next token from the stream, or end_of_stream. - */ - read() { - if (!this.tokens.length) - return end_of_stream - return this.tokens.pop() - } - /** - * When one or more tokens are prepended to a stream, those tokens - * must be inserted, in given order, before the first token in the - * stream. - * - * @param {(number|!Array.)} token The token(s) to prepend to the - * stream. - */ - prepend(token) { - if (Array.isArray(token)) { - var tokens = /**@type {!Array.}*/(token) - while (tokens.length) - this.tokens.push(tokens.pop()) - } else { - this.tokens.push(token) - } - } - /** - * When one or more tokens are pushed to a stream, those tokens - * must be inserted, in given order, after the last token in the - * stream. - * - * @param {(number|!Array.)} token The tokens(s) to push to the - * stream. - */ - push(token) { - if (Array.isArray(token)) { - const tokens = /**@type {!Array.}*/(token) - while (tokens.length) - this.tokens.unshift(tokens.shift()) - } else { - this.tokens.unshift(token) - } - } -} - -export const DEFAULT_ENCODING = 'utf-8' - - -/** - * Returns the encoding for the label. - * @param {string} label The encoding label. - */ -export function getEncoding(label) { - // 1. Remove any leading and trailing ASCII whitespace from label. - label = String(label).trim().toLowerCase() - - // 2. If label is an ASCII case-insensitive match for any of the - // labels listed in the table below, return the corresponding - // encoding, and failure otherwise. - if (Object.prototype.hasOwnProperty.call(label_to_encoding, label)) { - return label_to_encoding[label] - } - return null -} - - -// -// 5. Encodings -// - -// 5.1 Encoders and decoders - -// /** @interface */ -// function Decoder() {} -// Decoder.prototype = { -// /** -// * @param {Stream} stream The stream of bytes being decoded. -// * @param {number} bite The next byte read from the stream. -// * @return {?(number|!Array.)} The next code point(s) -// * decoded, or null if not enough data exists in the input -// * stream to decode a complete code point, or |finished|. -// */ -// handler: function(stream, bite) {}, -// } - -// /** @interface */ -// function Encoder() {} -// Encoder.prototype = { -// /** -// * @param {Stream} stream The stream of code points being encoded. -// * @param {number} code_point Next code point read from the stream. -// * @return {(number|!Array.)} Byte(s) to emit, or |finished|. -// */ -// handler: function(stream, code_point) {}, -// } \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/text-decoding/src/table.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/text-decoding/src/table.js deleted file mode 100644 index 82607e15..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/text-decoding/src/table.js +++ /dev/null @@ -1,119 +0,0 @@ -import Encodings from './encodings' -import { UTF8Decoder, UTF8Encoder } from './implementations/utf8' -import { UTF16Decoder, UTF16Encoder } from './implementations/utf16' -import { GB18030Decoder, GB18030Encoder } from './implementations/gb18030' -import { Big5Decoder, Big5Encoder } from './implementations/big5' -import { EUCJPDecoder, EUCJPEncoder } from './implementations/euc-jp' -import { EUCKRDecoder, EUCKREncoder } from './implementations/euc-kr' -import { ISO2022JPDecoder, ISO2022JPEncoder } from './implementations/iso-2022-jp' -import { XUserDefinedDecoder, XUserDefinedEncoder } from './implementations/x-user-defined' -import { ShiftJISDecoder, ShiftJISEncoder } from './implementations/shift-jis' -import { SingleByteDecoder, SingleByteEncoder } from './implementations/single-byte' -import index from './indexes'; - -// 5.2 Names and labels - -// TODO: Define @typedef for Encoding: {name:string,labels:Array.} -// https://github.com/google/closure-compiler/issues/247 - - -// Label to encoding registry. -/** @type {Object.}>} */ -export const label_to_encoding = {} -Encodings.forEach(({ encodings }) => { - encodings.forEach((encoding) => { - encoding.labels.forEach((label) => { - label_to_encoding[label] = encoding - }) - }) -}) - -// Registry of of encoder/decoder factories, by encoding name. -export const encoders = { - 'UTF-8'() { // 9.1 utf-8 - return new UTF8Encoder() - }, - 'GBK'(options) { // 11.1.2 gbk encoder; - // gbk's encoder is gb18030's encoder with its gbk flag set. - return new GB18030Encoder(options, true) - }, - 'gb18030'() { - return new GB18030Encoder() - }, - 'Big5'() { - return new Big5Encoder() - }, - 'EUC-JP'() { - return new EUCJPEncoder() - }, - 'EUC-KR'() { - return new EUCKREncoder() - }, - 'ISO-2022-JP'() { - return new ISO2022JPEncoder() - }, - 'UTF-16BE'() { // 15.3 utf-16be - return new UTF16Encoder(true) - }, - 'UTF-16LE'() { // 15.4 utf-16le - return new UTF16Encoder() - }, - 'x-user-defined'() { - return new XUserDefinedEncoder() - }, - 'Shift_JIS'() { - return new ShiftJISEncoder() - }, -} - -/** @type {Object.} */ -export const decoders = { - 'UTF-8'(options) { // 9.1.1 utf-8 decoder - return new UTF8Decoder(options) - }, - 'GBK'(options) { // 11.1.1 gbk decoder; gbk's decoder is gb18030's decoder. - return new GB18030Decoder(options) - }, - 'gb18030'(options) { - return new GB18030Decoder(options) - }, - 'Big5'(options) { - return new Big5Decoder(options) - }, - 'EUC-JP'(options) { - return new EUCJPDecoder(options) - }, - 'EUC-KR'(options) { - return new EUCKRDecoder(options) - }, - 'ISO-2022-JP'(options) { - return new ISO2022JPDecoder(options) - }, - 'UTF-16BE'(options) { // 15.3.1 utf-16be decoder - return new UTF16Decoder(true, options) - }, - 'UTF-16LE'(options) { // 15.4.1 utf-16le decoder - return new UTF16Decoder(false, options) - }, - 'x-user-defined'() { - return new XUserDefinedDecoder() - }, - 'Shift_JIS'(options) { - return new ShiftJISDecoder(options) - }, -} - -Encodings.forEach(({ heading, encodings }) => { - if (heading != 'Legacy single-byte encodings') - return - encodings.forEach((encoding) => { - const name = encoding.name - const idx = index(name.toLowerCase()) - decoders[name] = (options) => { - return new SingleByteDecoder(idx, options) - } - encoders[name] = (options) => { - return new SingleByteEncoder(idx, options) - } - }) -}) \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/text-decoding/src/utils.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/text-decoding/src/utils.js deleted file mode 100644 index f7bb771e..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/text-decoding/src/utils.js +++ /dev/null @@ -1,180 +0,0 @@ -// -// Utilities -// -/** - * @param {number} a The number to test. - * @param {number} min The minimum value in the range, inclusive. - * @param {number} max The maximum value in the range, inclusive. - * @return {boolean} True if a >= min and a <= max. - */ -export function inRange(a, min, max) { - return min <= a && a <= max -} - -export const floor = Math.floor - -/** - * @param {string} string Input string of UTF-16 code units. - * @return {!Array.} Code points. - */ -export function stringToCodePoints(string) { - // https://heycam.github.io/webidl/#dfn-obtain-unicode - - // 1. Let S be the DOMString value. - var s = String(string) - - // 2. Let n be the length of S. - var n = s.length - - // 3. Initialize i to 0. - var i = 0 - - // 4. Initialize U to be an empty sequence of Unicode characters. - var u = [] - - // 5. While i < n: - while (i < n) { - // 1. Let c be the code unit in S at index i. - var c = s.charCodeAt(i) - - // 2. Depending on the value of c: - - // c < 0xD800 or c > 0xDFFF - if (c < 0xD800 || c > 0xDFFF) { - // Append to U the Unicode character with code point c. - u.push(c) - } - - // 0xDC00 ≤ c ≤ 0xDFFF - else if (0xDC00 <= c && c <= 0xDFFF) { - // Append to U a U+FFFD REPLACEMENT CHARACTER. - u.push(0xFFFD) - } - - // 0xD800 ≤ c ≤ 0xDBFF - else if (0xD800 <= c && c <= 0xDBFF) { - // 1. If i = n−1, then append to U a U+FFFD REPLACEMENT - // CHARACTER. - if (i === n - 1) { - u.push(0xFFFD) - } - // 2. Otherwise, i < n−1: - else { - // 1. Let d be the code unit in S at index i+1. - var d = s.charCodeAt(i + 1) - - // 2. If 0xDC00 ≤ d ≤ 0xDFFF, then: - if (0xDC00 <= d && d <= 0xDFFF) { - // 1. Let a be c & 0x3FF. - var a = c & 0x3FF - - // 2. Let b be d & 0x3FF. - var b = d & 0x3FF - - // 3. Append to U the Unicode character with code point - // 2^16+2^10*a+b. - u.push(0x10000 + (a << 10) + b) - - // 4. Set i to i+1. - i += 1 - } - - // 3. Otherwise, d < 0xDC00 or d > 0xDFFF. Append to U a - // U+FFFD REPLACEMENT CHARACTER. - else { - u.push(0xFFFD) - } - } - } - - // 3. Set i to i+1. - i += 1 - } - - // 6. Return U. - return u -} - -/** - * @param {!Array.} code_points Array of code points. - * @return {string} string String of UTF-16 code units. - */ -export function codePointsToString(code_points) { - var s = '' - for (var i = 0; i < code_points.length; ++i) { - var cp = code_points[i] - if (cp <= 0xFFFF) { - s += String.fromCharCode(cp) - } else { - cp -= 0x10000 - s += String.fromCharCode((cp >> 10) + 0xD800, - (cp & 0x3FF) + 0xDC00) - } - } - return s -} - -/** - * @param {boolean} fatal If true, decoding errors raise an exception. - * @param {number=} opt_code_point Override the standard fallback code point. - * @return The code point to insert on a decoding error. - */ -export function decoderError(fatal, opt_code_point) { - if (fatal) - throw TypeError('Decoder error') - return opt_code_point || 0xFFFD -} - -/** - * @param {number} code_point The code point that could not be encoded. - * @return {number} Always throws, no value is actually returned. - */ -export function encoderError(code_point) { - throw TypeError('The code point ' + code_point + ' could not be encoded.') -} - -/** - * @param {number} code_unit - * @param {boolean} utf16be - */ -export function convertCodeUnitToBytes(code_unit, utf16be) { - // 1. Let byte1 be code unit >> 8. - const byte1 = code_unit >> 8 - - // 2. Let byte2 be code unit & 0x00FF. - const byte2 = code_unit & 0x00FF - - // 3. Then return the bytes in order: - // utf-16be flag is set: byte1, then byte2. - if (utf16be) - return [byte1, byte2] - // utf-16be flag is unset: byte2, then byte1. - return [byte2, byte1] -} - - -// -// 4. Terminology -// - -/** - * An ASCII byte is a byte in the range 0x00 to 0x7F, inclusive. - * @param {number} a The number to test. - * @return {boolean} True if a is in the range 0x00 to 0x7F, inclusive. - */ -export function isASCIIByte(a) { - return 0x00 <= a && a <= 0x7F -} - -/** - * An ASCII code point is a code point in the range U+0000 to - * U+007F, inclusive. - */ -export const isASCIICodePoint = isASCIIByte - -/** - * End-of-stream is a special token that signifies no more tokens are in the stream. - */ -export const end_of_stream = -1 - -export const finished = -1 \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/text-decoding/types/externs.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/text-decoding/types/externs.js deleted file mode 100644 index d749d863..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/text-decoding/types/externs.js +++ /dev/null @@ -1,32 +0,0 @@ -/* typal types/index.xml externs */ -/** @const */ -var _textDecoding = {} -/** - * Options for the program. - * @typedef {{ shouldRun: (boolean|undefined), text: string }} - */ -_textDecoding.Config - -/** @interface */ -function Decoder() {} -Decoder.prototype = { - /** - * @param {Stream} stream The stream of bytes being decoded. - * @param {number} bite The next byte read from the stream. - * @return {?(number|!Array.)} The next code point(s) - * decoded, or null if not enough data exists in the input - * stream to decode a complete code point, or |finished|. - */ - handler: function(stream, bite) {}, -} - -/** @interface */ -function Encoder() {} -Encoder.prototype = { - /** - * @param {Stream} stream The stream of code points being encoded. - * @param {number} code_point Next code point read from the stream. - * @return {(number|!Array.)} Byte(s) to emit, or |finished|. - */ - handler: function(stream, code_point) {}, -} \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/tmp/CHANGELOG.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/tmp/CHANGELOG.md deleted file mode 100644 index 0aa54882..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/tmp/CHANGELOG.md +++ /dev/null @@ -1,288 +0,0 @@ - - -## v0.2.1 (2020-04-28) - -#### :rocket: Enhancement -* [#252](https://github.com/raszi/node-tmp/pull/252) Closes [#250](https://github.com/raszi/node-tmp/issues/250): introduce tmpdir option for overriding the system tmp dir ([@silkentrance](https://github.com/silkentrance)) - -#### :house: Internal -* [#253](https://github.com/raszi/node-tmp/pull/253) Closes [#191](https://github.com/raszi/node-tmp/issues/191): generate changelog from pull requests using lerna-changelog ([@silkentrance](https://github.com/silkentrance)) - -#### Committers: 1 -- Carsten Klein ([@silkentrance](https://github.com/silkentrance)) - - -## v0.2.0 (2020-04-25) - -#### :rocket: Enhancement -* [#234](https://github.com/raszi/node-tmp/pull/234) feat: stabilize tmp for v0.2.0 release ([@silkentrance](https://github.com/silkentrance)) - -#### :bug: Bug Fix -* [#231](https://github.com/raszi/node-tmp/pull/231) Closes [#230](https://github.com/raszi/node-tmp/issues/230): regression after fix for #197 ([@silkentrance](https://github.com/silkentrance)) -* [#220](https://github.com/raszi/node-tmp/pull/220) Closes [#197](https://github.com/raszi/node-tmp/issues/197): return sync callback when using the sync interface, otherwise return the async callback ([@silkentrance](https://github.com/silkentrance)) -* [#193](https://github.com/raszi/node-tmp/pull/193) Closes [#192](https://github.com/raszi/node-tmp/issues/192): tmp must not exit the process on its own ([@silkentrance](https://github.com/silkentrance)) - -#### :memo: Documentation -* [#221](https://github.com/raszi/node-tmp/pull/221) Gh 206 document name option ([@silkentrance](https://github.com/silkentrance)) - -#### :house: Internal -* [#226](https://github.com/raszi/node-tmp/pull/226) Closes [#212](https://github.com/raszi/node-tmp/issues/212): enable direct name option test ([@silkentrance](https://github.com/silkentrance)) -* [#225](https://github.com/raszi/node-tmp/pull/225) Closes [#211](https://github.com/raszi/node-tmp/issues/211): existing tests must clean up after themselves ([@silkentrance](https://github.com/silkentrance)) -* [#224](https://github.com/raszi/node-tmp/pull/224) Closes [#217](https://github.com/raszi/node-tmp/issues/217): name tests must use tmpName ([@silkentrance](https://github.com/silkentrance)) -* [#223](https://github.com/raszi/node-tmp/pull/223) Closes [#214](https://github.com/raszi/node-tmp/issues/214): refactor tests and lib ([@silkentrance](https://github.com/silkentrance)) -* [#198](https://github.com/raszi/node-tmp/pull/198) Update dependencies to latest versions ([@matsev](https://github.com/matsev)) - -#### Committers: 2 -- Carsten Klein ([@silkentrance](https://github.com/silkentrance)) -- Mattias Severson ([@matsev](https://github.com/matsev)) - - -## v0.1.0 (2019-03-20) - -#### :rocket: Enhancement -* [#177](https://github.com/raszi/node-tmp/pull/177) fix: fail early if there is no tmp dir specified ([@silkentrance](https://github.com/silkentrance)) -* [#159](https://github.com/raszi/node-tmp/pull/159) Closes [#121](https://github.com/raszi/node-tmp/issues/121) ([@silkentrance](https://github.com/silkentrance)) -* [#161](https://github.com/raszi/node-tmp/pull/161) Closes [#155](https://github.com/raszi/node-tmp/issues/155) ([@silkentrance](https://github.com/silkentrance)) -* [#166](https://github.com/raszi/node-tmp/pull/166) fix: avoid relying on Node’s internals ([@addaleax](https://github.com/addaleax)) -* [#144](https://github.com/raszi/node-tmp/pull/144) prepend opts.dir || tmpDir to template if no path is given ([@silkentrance](https://github.com/silkentrance)) - -#### :bug: Bug Fix -* [#183](https://github.com/raszi/node-tmp/pull/183) Closes [#182](https://github.com/raszi/node-tmp/issues/182) fileSync takes empty string postfix option ([@gutte](https://github.com/gutte)) -* [#130](https://github.com/raszi/node-tmp/pull/130) Closes [#129](https://github.com/raszi/node-tmp/issues/129) install process listeners safely ([@silkentrance](https://github.com/silkentrance)) - -#### :memo: Documentation -* [#188](https://github.com/raszi/node-tmp/pull/188) HOTCloses [#187](https://github.com/raszi/node-tmp/issues/187): restore behaviour for #182 ([@silkentrance](https://github.com/silkentrance)) -* [#180](https://github.com/raszi/node-tmp/pull/180) fix gh-179: template no longer accepts arbitrary paths ([@silkentrance](https://github.com/silkentrance)) -* [#175](https://github.com/raszi/node-tmp/pull/175) docs: add `unsafeCleanup` option to jsdoc ([@kerimdzhanov](https://github.com/kerimdzhanov)) -* [#151](https://github.com/raszi/node-tmp/pull/151) docs: fix link to tmp-promise ([@silkentrance](https://github.com/silkentrance)) - -#### :house: Internal -* [#184](https://github.com/raszi/node-tmp/pull/184) test: add missing tests for #182 ([@silkentrance](https://github.com/silkentrance)) -* [#171](https://github.com/raszi/node-tmp/pull/171) chore: drop old NodeJS support ([@poppinlp](https://github.com/poppinlp)) -* [#170](https://github.com/raszi/node-tmp/pull/170) chore: update dependencies ([@raszi](https://github.com/raszi)) -* [#165](https://github.com/raszi/node-tmp/pull/165) test: add missing tests ([@raszi](https://github.com/raszi)) -* [#163](https://github.com/raszi/node-tmp/pull/163) chore: add lint npm task ([@raszi](https://github.com/raszi)) -* [#107](https://github.com/raszi/node-tmp/pull/107) chore: add coverage report ([@raszi](https://github.com/raszi)) -* [#141](https://github.com/raszi/node-tmp/pull/141) test: refactor tests for mocha ([@silkentrance](https://github.com/silkentrance)) -* [#154](https://github.com/raszi/node-tmp/pull/154) chore: change Travis configuration ([@raszi](https://github.com/raszi)) -* [#152](https://github.com/raszi/node-tmp/pull/152) fix: drop Node v0.6.0 ([@raszi](https://github.com/raszi)) - -#### Committers: 6 -- Anna Henningsen ([@addaleax](https://github.com/addaleax)) -- Carsten Klein ([@silkentrance](https://github.com/silkentrance)) -- Dan Kerimdzhanov ([@kerimdzhanov](https://github.com/kerimdzhanov)) -- Gustav Klingstedt ([@gutte](https://github.com/gutte)) -- KARASZI István ([@raszi](https://github.com/raszi)) -- PoppinL ([@poppinlp](https://github.com/poppinlp)) - - -## v0.0.33 (2017-08-12) - -#### :rocket: Enhancement -* [#147](https://github.com/raszi/node-tmp/pull/147) fix: with name option try at most once to get a unique tmp name ([@silkentrance](https://github.com/silkentrance)) - -#### :bug: Bug Fix -* [#149](https://github.com/raszi/node-tmp/pull/149) fix(fileSync): must honor detachDescriptor and discardDescriptor options ([@silkentrance](https://github.com/silkentrance)) -* [#119](https://github.com/raszi/node-tmp/pull/119) Closes [#115](https://github.com/raszi/node-tmp/issues/115) ([@silkentrance](https://github.com/silkentrance)) - -#### :memo: Documentation -* [#128](https://github.com/raszi/node-tmp/pull/128) Closes [#127](https://github.com/raszi/node-tmp/issues/127) add reference to tmp-promise ([@silkentrance](https://github.com/silkentrance)) - -#### :house: Internal -* [#135](https://github.com/raszi/node-tmp/pull/135) Closes [#133](https://github.com/raszi/node-tmp/issues/133), #134 ([@silkentrance](https://github.com/silkentrance)) -* [#123](https://github.com/raszi/node-tmp/pull/123) docs: update tmp.js MIT license header to 2017 ([@madnight](https://github.com/madnight)) -* [#122](https://github.com/raszi/node-tmp/pull/122) chore: add issue template ([@silkentrance](https://github.com/silkentrance)) - -#### Committers: 2 -- Carsten Klein ([@silkentrance](https://github.com/silkentrance)) -- Fabian Beuke ([@madnight](https://github.com/madnight)) - - -## v0.0.32 (2017-03-24) - -#### :memo: Documentation -* [#106](https://github.com/raszi/node-tmp/pull/106) doc: add proper JSDoc documentation ([@raszi](https://github.com/raszi)) - -#### :house: Internal -* [#111](https://github.com/raszi/node-tmp/pull/111) test: add Windows tests ([@binki](https://github.com/binki)) -* [#110](https://github.com/raszi/node-tmp/pull/110) chore: add AppVeyor ([@binki](https://github.com/binki)) -* [#105](https://github.com/raszi/node-tmp/pull/105) chore: use const where possible ([@raszi](https://github.com/raszi)) -* [#104](https://github.com/raszi/node-tmp/pull/104) style: fix various style issues ([@raszi](https://github.com/raszi)) - -#### Committers: 2 -- KARASZI István ([@raszi](https://github.com/raszi)) -- Nathan Phillip Brink ([@binki](https://github.com/binki)) - - -## v0.0.31 (2016-11-21) - -#### :rocket: Enhancement -* [#99](https://github.com/raszi/node-tmp/pull/99) feat: add next callback functionality ([@silkentrance](https://github.com/silkentrance)) -* [#94](https://github.com/raszi/node-tmp/pull/94) feat: add options to control descriptor management ([@pabigot](https://github.com/pabigot)) - -#### :house: Internal -* [#101](https://github.com/raszi/node-tmp/pull/101) fix: Include files in the package.json ([@raszi](https://github.com/raszi)) - -#### Committers: 3 -- Carsten Klein ([@silkentrance](https://github.com/silkentrance)) -- KARASZI István ([@raszi](https://github.com/raszi)) -- Peter A. Bigot ([@pabigot](https://github.com/pabigot)) - - -## v0.0.30 (2016-11-01) - -#### :bug: Bug Fix -* [#96](https://github.com/raszi/node-tmp/pull/96) fix: constants for Node 6 ([@jnj16180340](https://github.com/jnj16180340)) -* [#98](https://github.com/raszi/node-tmp/pull/98) fix: garbage collector ([@Ari-H](https://github.com/Ari-H)) - -#### Committers: 2 -- Nate Johnson ([@jnj16180340](https://github.com/jnj16180340)) -- [@Ari-H](https://github.com/Ari-H) - - -## v0.0.29 (2016-09-18) - -#### :rocket: Enhancement -* [#87](https://github.com/raszi/node-tmp/pull/87) fix: replace calls to deprecated fs API functions ([@OlliV](https://github.com/OlliV)) - -#### :bug: Bug Fix -* [#70](https://github.com/raszi/node-tmp/pull/70) fix: prune `_removeObjects` correctly ([@joliss](https://github.com/joliss)) -* [#71](https://github.com/raszi/node-tmp/pull/71) Fix typo ([@gcampax](https://github.com/gcampax)) - -#### :memo: Documentation -* [#77](https://github.com/raszi/node-tmp/pull/77) docs: change mkstemps to mkstemp ([@thefourtheye](https://github.com/thefourtheye)) - -#### :house: Internal -* [#92](https://github.com/raszi/node-tmp/pull/92) chore: add Travis CI support for Node 6 ([@amilajack](https://github.com/amilajack)) -* [#79](https://github.com/raszi/node-tmp/pull/79) fix: remove unneeded require statement ([@whmountains](https://github.com/whmountains)) - -#### Committers: 6 -- Amila Welihinda ([@amilajack](https://github.com/amilajack)) -- Caleb Whiting ([@whmountains](https://github.com/whmountains)) -- Giovanni Campagna ([@gcampax](https://github.com/gcampax)) -- Jo Liss ([@joliss](https://github.com/joliss)) -- Olli Vanhoja ([@OlliV](https://github.com/OlliV)) -- Sakthipriyan Vairamani ([@thefourtheye](https://github.com/thefourtheye)) - - -## v0.0.28 (2015-09-27) - -#### :bug: Bug Fix -* [#63](https://github.com/raszi/node-tmp/pull/63) fix: delete for _rmdirRecursiveSync ([@voltrevo](https://github.com/voltrevo)) - -#### :memo: Documentation -* [#64](https://github.com/raszi/node-tmp/pull/64) docs: fix typo in the README ([@JTKnox91](https://github.com/JTKnox91)) - -#### :house: Internal -* [#67](https://github.com/raszi/node-tmp/pull/67) test: add node v4.0 v4.1 to travis config ([@raszi](https://github.com/raszi)) -* [#66](https://github.com/raszi/node-tmp/pull/66) chore(deps): update deps ([@raszi](https://github.com/raszi)) - -#### Committers: 3 -- Andrew Morris ([@voltrevo](https://github.com/voltrevo)) -- John T. Knox ([@JTKnox91](https://github.com/JTKnox91)) -- KARASZI István ([@raszi](https://github.com/raszi)) - - -## v0.0.27 (2015-08-15) - -#### :bug: Bug Fix -* [#60](https://github.com/raszi/node-tmp/pull/60) fix: unlinking when the file has been already removed ([@silkentrance](https://github.com/silkentrance)) - -#### :memo: Documentation -* [#55](https://github.com/raszi/node-tmp/pull/55) docs(README): update README ([@raszi](https://github.com/raszi)) - -#### :house: Internal -* [#56](https://github.com/raszi/node-tmp/pull/56) style(jshint): fix JSHint error ([@raszi](https://github.com/raszi)) -* [#53](https://github.com/raszi/node-tmp/pull/53) chore: update license attribute ([@pdehaan](https://github.com/pdehaan)) - -#### Committers: 3 -- Carsten Klein ([@silkentrance](https://github.com/silkentrance)) -- KARASZI István ([@raszi](https://github.com/raszi)) -- Peter deHaan ([@pdehaan](https://github.com/pdehaan)) - - -## v0.0.26 (2015-05-12) - -#### :rocket: Enhancement -* [#40](https://github.com/raszi/node-tmp/pull/40) Fix for #39 ([@silkentrance](https://github.com/silkentrance)) -* [#42](https://github.com/raszi/node-tmp/pull/42) Fix for #17 ([@silkentrance](https://github.com/silkentrance)) -* [#41](https://github.com/raszi/node-tmp/pull/41) Fix for #37 ([@silkentrance](https://github.com/silkentrance)) -* [#32](https://github.com/raszi/node-tmp/pull/32) add ability to customize file/dir names ([@shime](https://github.com/shime)) -* [#29](https://github.com/raszi/node-tmp/pull/29) tmp.file have responsibility to close file, not only unlink file ([@vhain](https://github.com/vhain)) - -#### :bug: Bug Fix -* [#51](https://github.com/raszi/node-tmp/pull/51) fix(windows): fix tempDir on windows ([@raszi](https://github.com/raszi)) -* [#49](https://github.com/raszi/node-tmp/pull/49) remove object from _removeObjects if cleanup fn is called Closes [#48](https://github.com/raszi/node-tmp/issues/48) ([@bmeck](https://github.com/bmeck)) - -#### :memo: Documentation -* [#45](https://github.com/raszi/node-tmp/pull/45) Fix for #44 ([@silkentrance](https://github.com/silkentrance)) - -#### :house: Internal -* [#34](https://github.com/raszi/node-tmp/pull/34) Create LICENSE ([@ScottWeinstein](https://github.com/ScottWeinstein)) - -#### Committers: 6 -- Bradley Farias ([@bmeck](https://github.com/bmeck)) -- Carsten Klein ([@silkentrance](https://github.com/silkentrance)) -- Hrvoje Šimić ([@shime](https://github.com/shime)) -- Juwan Yoo ([@vhain](https://github.com/vhain)) -- KARASZI István ([@raszi](https://github.com/raszi)) -- Scott Weinstein ([@ScottWeinstein](https://github.com/ScottWeinstein)) - - -## v0.0.24 (2014-07-11) - -#### :rocket: Enhancement -* [#25](https://github.com/raszi/node-tmp/pull/25) Added removeCallback passing ([@foxel](https://github.com/foxel)) - -#### Committers: 1 -- Andrey Kupreychik ([@foxel](https://github.com/foxel)) - - -## v0.0.23 (2013-12-03) - -#### :rocket: Enhancement -* [#21](https://github.com/raszi/node-tmp/pull/21) If we are not on node 0.8, don't register an uncaughtException handler ([@wibblymat](https://github.com/wibblymat)) - -#### Committers: 1 -- Mat Scales ([@wibblymat](https://github.com/wibblymat)) - - -## v0.0.22 (2013-11-29) - -#### :rocket: Enhancement -* [#19](https://github.com/raszi/node-tmp/pull/19) Rethrow only on node v0.8. ([@mcollina](https://github.com/mcollina)) - -#### Committers: 1 -- Matteo Collina ([@mcollina](https://github.com/mcollina)) - - -## v0.0.21 (2013-08-07) - -#### :bug: Bug Fix -* [#16](https://github.com/raszi/node-tmp/pull/16) Fix bug where we delete contents of symlinks ([@lightsofapollo](https://github.com/lightsofapollo)) - -#### Committers: 1 -- James Lal ([@lightsofapollo](https://github.com/lightsofapollo)) - - -## v0.0.17 (2013-04-09) - -#### :rocket: Enhancement -* [#9](https://github.com/raszi/node-tmp/pull/9) add recursive remove option ([@oscar-broman](https://github.com/oscar-broman)) - -#### Committers: 1 -- [@oscar-broman](https://github.com/oscar-broman) - - -## v0.0.14 (2012-08-26) - -#### :rocket: Enhancement -* [#5](https://github.com/raszi/node-tmp/pull/5) Export _getTmpName for temporary file name creation ([@joscha](https://github.com/joscha)) - -#### Committers: 1 -- Joscha Feth ([@joscha](https://github.com/joscha)) - - -## Previous Releases < v0.0.14 - -- no information available diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/tmp/LICENSE b/packages/wyatt_notification_bloc/example/scripts/node_modules/tmp/LICENSE deleted file mode 100644 index 72418bd9..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/tmp/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014 KARASZI István - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/tmp/README.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/tmp/README.md deleted file mode 100644 index bb20fb7b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/tmp/README.md +++ /dev/null @@ -1,365 +0,0 @@ -# Tmp - -A simple temporary file and directory creator for [node.js.][1] - -[![Build Status](https://travis-ci.org/raszi/node-tmp.svg?branch=master)](https://travis-ci.org/raszi/node-tmp) -[![Dependencies](https://david-dm.org/raszi/node-tmp.svg)](https://david-dm.org/raszi/node-tmp) -[![npm version](https://badge.fury.io/js/tmp.svg)](https://badge.fury.io/js/tmp) -[![API documented](https://img.shields.io/badge/API-documented-brightgreen.svg)](https://raszi.github.io/node-tmp/) -[![Known Vulnerabilities](https://snyk.io/test/npm/tmp/badge.svg)](https://snyk.io/test/npm/tmp) - -## About - -This is a [widely used library][2] to create temporary files and directories -in a [node.js][1] environment. - -Tmp offers both an asynchronous and a synchronous API. For all API calls, all -the parameters are optional. There also exists a promisified version of the -API, see [tmp-promise][5]. - -Tmp uses crypto for determining random file names, or, when using templates, -a six letter random identifier. And just in case that you do not have that much -entropy left on your system, Tmp will fall back to pseudo random numbers. - -You can set whether you want to remove the temporary file on process exit or -not. - -If you do not want to store your temporary directories and files in the -standard OS temporary directory, then you are free to override that as well. - -## An Important Note on Compatibility - -See the [CHANGELOG](./CHANGELOG.md) for more information. - -### Version 0.1.0 - -Since version 0.1.0, all support for node versions < 0.10.0 has been dropped. - -Most importantly, any support for earlier versions of node-tmp was also dropped. - -If you still require node versions < 0.10.0, then you must limit your node-tmp -dependency to versions below 0.1.0. - -### Version 0.0.33 - -Since version 0.0.33, all support for node versions < 0.8 has been dropped. - -If you still require node version 0.8, then you must limit your node-tmp -dependency to version 0.0.33. - -For node versions < 0.8 you must limit your node-tmp dependency to -versions < 0.0.33. - -## How to install - -```bash -npm install tmp -``` - -## Usage - -Please also check [API docs][4]. - -### Asynchronous file creation - -Simple temporary file creation, the file will be closed and unlinked on process exit. - -```javascript -const tmp = require('tmp'); - -tmp.file(function _tempFileCreated(err, path, fd, cleanupCallback) { - if (err) throw err; - - console.log('File: ', path); - console.log('Filedescriptor: ', fd); - - // If we don't need the file anymore we could manually call the cleanupCallback - // But that is not necessary if we didn't pass the keep option because the library - // will clean after itself. - cleanupCallback(); -}); -``` - -### Synchronous file creation - -A synchronous version of the above. - -```javascript -const tmp = require('tmp'); - -const tmpobj = tmp.fileSync(); -console.log('File: ', tmpobj.name); -console.log('Filedescriptor: ', tmpobj.fd); - -// If we don't need the file anymore we could manually call the removeCallback -// But that is not necessary if we didn't pass the keep option because the library -// will clean after itself. -tmpobj.removeCallback(); -``` - -Note that this might throw an exception if either the maximum limit of retries -for creating a temporary name fails, or, in case that you do not have the permission -to write to the directory where the temporary file should be created in. - -### Asynchronous directory creation - -Simple temporary directory creation, it will be removed on process exit. - -If the directory still contains items on process exit, then it won't be removed. - -```javascript -const tmp = require('tmp'); - -tmp.dir(function _tempDirCreated(err, path, cleanupCallback) { - if (err) throw err; - - console.log('Dir: ', path); - - // Manual cleanup - cleanupCallback(); -}); -``` - -If you want to cleanup the directory even when there are entries in it, then -you can pass the `unsafeCleanup` option when creating it. - -### Synchronous directory creation - -A synchronous version of the above. - -```javascript -const tmp = require('tmp'); - -const tmpobj = tmp.dirSync(); -console.log('Dir: ', tmpobj.name); -// Manual cleanup -tmpobj.removeCallback(); -``` - -Note that this might throw an exception if either the maximum limit of retries -for creating a temporary name fails, or, in case that you do not have the permission -to write to the directory where the temporary directory should be created in. - -### Asynchronous filename generation - -It is possible with this library to generate a unique filename in the specified -directory. - -```javascript -const tmp = require('tmp'); - -tmp.tmpName(function _tempNameGenerated(err, path) { - if (err) throw err; - - console.log('Created temporary filename: ', path); -}); -``` - -### Synchronous filename generation - -A synchronous version of the above. - -```javascript -const tmp = require('tmp'); - -const name = tmp.tmpNameSync(); -console.log('Created temporary filename: ', name); -``` - -## Advanced usage - -### Asynchronous file creation - -Creates a file with mode `0644`, prefix will be `prefix-` and postfix will be `.txt`. - -```javascript -const tmp = require('tmp'); - -tmp.file({ mode: 0o644, prefix: 'prefix-', postfix: '.txt' }, function _tempFileCreated(err, path, fd) { - if (err) throw err; - - console.log('File: ', path); - console.log('Filedescriptor: ', fd); -}); -``` - -### Synchronous file creation - -A synchronous version of the above. - -```javascript -const tmp = require('tmp'); - -const tmpobj = tmp.fileSync({ mode: 0o644, prefix: 'prefix-', postfix: '.txt' }); -console.log('File: ', tmpobj.name); -console.log('Filedescriptor: ', tmpobj.fd); -``` - -### Controlling the Descriptor - -As a side effect of creating a unique file `tmp` gets a file descriptor that is -returned to the user as the `fd` parameter. The descriptor may be used by the -application and is closed when the `removeCallback` is invoked. - -In some use cases the application does not need the descriptor, needs to close it -without removing the file, or needs to remove the file without closing the -descriptor. Two options control how the descriptor is managed: - -* `discardDescriptor` - if `true` causes `tmp` to close the descriptor after the file - is created. In this case the `fd` parameter is undefined. -* `detachDescriptor` - if `true` causes `tmp` to return the descriptor in the `fd` - parameter, but it is the application's responsibility to close it when it is no - longer needed. - -```javascript -const tmp = require('tmp'); - -tmp.file({ discardDescriptor: true }, function _tempFileCreated(err, path, fd, cleanupCallback) { - if (err) throw err; - // fd will be undefined, allowing application to use fs.createReadStream(path) - // without holding an unused descriptor open. -}); -``` - -```javascript -const tmp = require('tmp'); - -tmp.file({ detachDescriptor: true }, function _tempFileCreated(err, path, fd, cleanupCallback) { - if (err) throw err; - - cleanupCallback(); - // Application can store data through fd here; the space used will automatically - // be reclaimed by the operating system when the descriptor is closed or program - // terminates. -}); -``` - -### Asynchronous directory creation - -Creates a directory with mode `0755`, prefix will be `myTmpDir_`. - -```javascript -const tmp = require('tmp'); - -tmp.dir({ mode: 0o750, prefix: 'myTmpDir_' }, function _tempDirCreated(err, path) { - if (err) throw err; - - console.log('Dir: ', path); -}); -``` - -### Synchronous directory creation - -Again, a synchronous version of the above. - -```javascript -const tmp = require('tmp'); - -const tmpobj = tmp.dirSync({ mode: 0750, prefix: 'myTmpDir_' }); -console.log('Dir: ', tmpobj.name); -``` - -### mkstemp like, asynchronously - -Creates a new temporary directory with mode `0700` and filename like `/tmp/tmp-nk2J1u`. - -IMPORTANT NOTE: template no longer accepts a path. Use the dir option instead if you -require tmp to create your temporary filesystem object in a different place than the -default `tmp.tmpdir`. - -```javascript -const tmp = require('tmp'); - -tmp.dir({ template: 'tmp-XXXXXX' }, function _tempDirCreated(err, path) { - if (err) throw err; - - console.log('Dir: ', path); -}); -``` - -### mkstemp like, synchronously - -This will behave similarly to the asynchronous version. - -```javascript -const tmp = require('tmp'); - -const tmpobj = tmp.dirSync({ template: 'tmp-XXXXXX' }); -console.log('Dir: ', tmpobj.name); -``` - -### Asynchronous filename generation - -Using `tmpName()` you can create temporary file names asynchronously. -The function accepts all standard options, e.g. `prefix`, `postfix`, `dir`, and so on. - -You can also leave out the options altogether and just call the function with a callback as first parameter. - -```javascript -const tmp = require('tmp'); - -const options = {}; - -tmp.tmpName(options, function _tempNameGenerated(err, path) { - if (err) throw err; - - console.log('Created temporary filename: ', path); -}); -``` - -### Synchronous filename generation - -The `tmpNameSync()` function works similarly to `tmpName()`. -Again, you can leave out the options altogether and just invoke the function without any parameters. - -```javascript -const tmp = require('tmp'); -const options = {}; -const tmpname = tmp.tmpNameSync(options); -console.log('Created temporary filename: ', tmpname); -``` - -## Graceful cleanup - -If graceful cleanup is set, tmp will remove all controlled temporary objects on process exit, otherwise the -temporary objects will remain in place, waiting to be cleaned up on system restart or otherwise scheduled temporary -object removal. - -To enforce this, you can call the `setGracefulCleanup()` method: - -```javascript -const tmp = require('tmp'); - -tmp.setGracefulCleanup(); -``` - -## Options - -All options are optional :) - - * `name`: a fixed name that overrides random name generation, the name must be relative and must not contain path segments - * `mode`: the file mode to create with, falls back to `0o600` on file creation and `0o700` on directory creation - * `prefix`: the optional prefix, defaults to `tmp` - * `postfix`: the optional postfix - * `template`: [`mkstemp`][3] like filename template, no default, can be either an absolute or a relative path that resolves - to a relative path of the system's default temporary directory, must include `XXXXXX` once for random name generation, e.g. - 'foo/bar/XXXXXX'. Absolute paths are also fine as long as they are relative to os.tmpdir(). - Any directories along the so specified path must exist, otherwise a ENOENT error will be thrown upon access, - as tmp will not check the availability of the path, nor will it establish the requested path for you. - * `dir`: the optional temporary directory that must be relative to the system's default temporary directory. - absolute paths are fine as long as they point to a location under the system's default temporary directory. - Any directories along the so specified path must exist, otherwise a ENOENT error will be thrown upon access, - as tmp will not check the availability of the path, nor will it establish the requested path for you. - * `tmpdir`: allows you to override the system's root tmp directory - * `tries`: how many times should the function try to get a unique filename before giving up, default `3` - * `keep`: signals that the temporary file or directory should not be deleted on exit, default is `false` - * In order to clean up, you will have to call the provided `cleanupCallback` function manually. - * `unsafeCleanup`: recursively removes the created temporary directory, even when it's not empty. default is `false` - * `detachDescriptor`: detaches the file descriptor, caller is responsible for closing the file, tmp will no longer try closing the file during garbage collection - * `discardDescriptor`: discards the file descriptor (closes file, fd is -1), tmp will no longer try closing the file during garbage collection - -[1]: http://nodejs.org/ -[2]: https://www.npmjs.com/browse/depended/tmp -[3]: http://www.kernel.org/doc/man-pages/online/pages/man3/mkstemp.3.html -[4]: https://raszi.github.io/node-tmp/ -[5]: https://github.com/benjamingr/tmp-promise diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/tmp/lib/tmp.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/tmp/lib/tmp.js deleted file mode 100644 index b41c29d4..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/tmp/lib/tmp.js +++ /dev/null @@ -1,780 +0,0 @@ -/*! - * Tmp - * - * Copyright (c) 2011-2017 KARASZI Istvan - * - * MIT Licensed - */ - -/* - * Module dependencies. - */ -const fs = require('fs'); -const os = require('os'); -const path = require('path'); -const crypto = require('crypto'); -const _c = { fs: fs.constants, os: os.constants }; -const rimraf = require('rimraf'); - -/* - * The working inner variables. - */ -const - // the random characters to choose from - RANDOM_CHARS = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz', - - TEMPLATE_PATTERN = /XXXXXX/, - - DEFAULT_TRIES = 3, - - CREATE_FLAGS = (_c.O_CREAT || _c.fs.O_CREAT) | (_c.O_EXCL || _c.fs.O_EXCL) | (_c.O_RDWR || _c.fs.O_RDWR), - - // constants are off on the windows platform and will not match the actual errno codes - IS_WIN32 = os.platform() === 'win32', - EBADF = _c.EBADF || _c.os.errno.EBADF, - ENOENT = _c.ENOENT || _c.os.errno.ENOENT, - - DIR_MODE = 0o700 /* 448 */, - FILE_MODE = 0o600 /* 384 */, - - EXIT = 'exit', - - // this will hold the objects need to be removed on exit - _removeObjects = [], - - // API change in fs.rmdirSync leads to error when passing in a second parameter, e.g. the callback - FN_RMDIR_SYNC = fs.rmdirSync.bind(fs), - FN_RIMRAF_SYNC = rimraf.sync; - -let - _gracefulCleanup = false; - -/** - * Gets a temporary file name. - * - * @param {(Options|tmpNameCallback)} options options or callback - * @param {?tmpNameCallback} callback the callback function - */ -function tmpName(options, callback) { - const - args = _parseArguments(options, callback), - opts = args[0], - cb = args[1]; - - try { - _assertAndSanitizeOptions(opts); - } catch (err) { - return cb(err); - } - - let tries = opts.tries; - (function _getUniqueName() { - try { - const name = _generateTmpName(opts); - - // check whether the path exists then retry if needed - fs.stat(name, function (err) { - /* istanbul ignore else */ - if (!err) { - /* istanbul ignore else */ - if (tries-- > 0) return _getUniqueName(); - - return cb(new Error('Could not get a unique tmp filename, max tries reached ' + name)); - } - - cb(null, name); - }); - } catch (err) { - cb(err); - } - }()); -} - -/** - * Synchronous version of tmpName. - * - * @param {Object} options - * @returns {string} the generated random name - * @throws {Error} if the options are invalid or could not generate a filename - */ -function tmpNameSync(options) { - const - args = _parseArguments(options), - opts = args[0]; - - _assertAndSanitizeOptions(opts); - - let tries = opts.tries; - do { - const name = _generateTmpName(opts); - try { - fs.statSync(name); - } catch (e) { - return name; - } - } while (tries-- > 0); - - throw new Error('Could not get a unique tmp filename, max tries reached'); -} - -/** - * Creates and opens a temporary file. - * - * @param {(Options|null|undefined|fileCallback)} options the config options or the callback function or null or undefined - * @param {?fileCallback} callback - */ -function file(options, callback) { - const - args = _parseArguments(options, callback), - opts = args[0], - cb = args[1]; - - // gets a temporary filename - tmpName(opts, function _tmpNameCreated(err, name) { - /* istanbul ignore else */ - if (err) return cb(err); - - // create and open the file - fs.open(name, CREATE_FLAGS, opts.mode || FILE_MODE, function _fileCreated(err, fd) { - /* istanbu ignore else */ - if (err) return cb(err); - - if (opts.discardDescriptor) { - return fs.close(fd, function _discardCallback(possibleErr) { - // the chance of getting an error on close here is rather low and might occur in the most edgiest cases only - return cb(possibleErr, name, undefined, _prepareTmpFileRemoveCallback(name, -1, opts, false)); - }); - } else { - // detachDescriptor passes the descriptor whereas discardDescriptor closes it, either way, we no longer care - // about the descriptor - const discardOrDetachDescriptor = opts.discardDescriptor || opts.detachDescriptor; - cb(null, name, fd, _prepareTmpFileRemoveCallback(name, discardOrDetachDescriptor ? -1 : fd, opts, false)); - } - }); - }); -} - -/** - * Synchronous version of file. - * - * @param {Options} options - * @returns {FileSyncObject} object consists of name, fd and removeCallback - * @throws {Error} if cannot create a file - */ -function fileSync(options) { - const - args = _parseArguments(options), - opts = args[0]; - - const discardOrDetachDescriptor = opts.discardDescriptor || opts.detachDescriptor; - const name = tmpNameSync(opts); - var fd = fs.openSync(name, CREATE_FLAGS, opts.mode || FILE_MODE); - /* istanbul ignore else */ - if (opts.discardDescriptor) { - fs.closeSync(fd); - fd = undefined; - } - - return { - name: name, - fd: fd, - removeCallback: _prepareTmpFileRemoveCallback(name, discardOrDetachDescriptor ? -1 : fd, opts, true) - }; -} - -/** - * Creates a temporary directory. - * - * @param {(Options|dirCallback)} options the options or the callback function - * @param {?dirCallback} callback - */ -function dir(options, callback) { - const - args = _parseArguments(options, callback), - opts = args[0], - cb = args[1]; - - // gets a temporary filename - tmpName(opts, function _tmpNameCreated(err, name) { - /* istanbul ignore else */ - if (err) return cb(err); - - // create the directory - fs.mkdir(name, opts.mode || DIR_MODE, function _dirCreated(err) { - /* istanbul ignore else */ - if (err) return cb(err); - - cb(null, name, _prepareTmpDirRemoveCallback(name, opts, false)); - }); - }); -} - -/** - * Synchronous version of dir. - * - * @param {Options} options - * @returns {DirSyncObject} object consists of name and removeCallback - * @throws {Error} if it cannot create a directory - */ -function dirSync(options) { - const - args = _parseArguments(options), - opts = args[0]; - - const name = tmpNameSync(opts); - fs.mkdirSync(name, opts.mode || DIR_MODE); - - return { - name: name, - removeCallback: _prepareTmpDirRemoveCallback(name, opts, true) - }; -} - -/** - * Removes files asynchronously. - * - * @param {Object} fdPath - * @param {Function} next - * @private - */ -function _removeFileAsync(fdPath, next) { - const _handler = function (err) { - if (err && !_isENOENT(err)) { - // reraise any unanticipated error - return next(err); - } - next(); - }; - - if (0 <= fdPath[0]) - fs.close(fdPath[0], function () { - fs.unlink(fdPath[1], _handler); - }); - else fs.unlink(fdPath[1], _handler); -} - -/** - * Removes files synchronously. - * - * @param {Object} fdPath - * @private - */ -function _removeFileSync(fdPath) { - let rethrownException = null; - try { - if (0 <= fdPath[0]) fs.closeSync(fdPath[0]); - } catch (e) { - // reraise any unanticipated error - if (!_isEBADF(e) && !_isENOENT(e)) throw e; - } finally { - try { - fs.unlinkSync(fdPath[1]); - } - catch (e) { - // reraise any unanticipated error - if (!_isENOENT(e)) rethrownException = e; - } - } - if (rethrownException !== null) { - throw rethrownException; - } -} - -/** - * Prepares the callback for removal of the temporary file. - * - * Returns either a sync callback or a async callback depending on whether - * fileSync or file was called, which is expressed by the sync parameter. - * - * @param {string} name the path of the file - * @param {number} fd file descriptor - * @param {Object} opts - * @param {boolean} sync - * @returns {fileCallback | fileCallbackSync} - * @private - */ -function _prepareTmpFileRemoveCallback(name, fd, opts, sync) { - const removeCallbackSync = _prepareRemoveCallback(_removeFileSync, [fd, name], sync); - const removeCallback = _prepareRemoveCallback(_removeFileAsync, [fd, name], sync, removeCallbackSync); - - if (!opts.keep) _removeObjects.unshift(removeCallbackSync); - - return sync ? removeCallbackSync : removeCallback; -} - -/** - * Prepares the callback for removal of the temporary directory. - * - * Returns either a sync callback or a async callback depending on whether - * tmpFileSync or tmpFile was called, which is expressed by the sync parameter. - * - * @param {string} name - * @param {Object} opts - * @param {boolean} sync - * @returns {Function} the callback - * @private - */ -function _prepareTmpDirRemoveCallback(name, opts, sync) { - const removeFunction = opts.unsafeCleanup ? rimraf : fs.rmdir.bind(fs); - const removeFunctionSync = opts.unsafeCleanup ? FN_RIMRAF_SYNC : FN_RMDIR_SYNC; - const removeCallbackSync = _prepareRemoveCallback(removeFunctionSync, name, sync); - const removeCallback = _prepareRemoveCallback(removeFunction, name, sync, removeCallbackSync); - if (!opts.keep) _removeObjects.unshift(removeCallbackSync); - - return sync ? removeCallbackSync : removeCallback; -} - -/** - * Creates a guarded function wrapping the removeFunction call. - * - * The cleanup callback is save to be called multiple times. - * Subsequent invocations will be ignored. - * - * @param {Function} removeFunction - * @param {string} fileOrDirName - * @param {boolean} sync - * @param {cleanupCallbackSync?} cleanupCallbackSync - * @returns {cleanupCallback | cleanupCallbackSync} - * @private - */ -function _prepareRemoveCallback(removeFunction, fileOrDirName, sync, cleanupCallbackSync) { - let called = false; - - // if sync is true, the next parameter will be ignored - return function _cleanupCallback(next) { - - /* istanbul ignore else */ - if (!called) { - // remove cleanupCallback from cache - const toRemove = cleanupCallbackSync || _cleanupCallback; - const index = _removeObjects.indexOf(toRemove); - /* istanbul ignore else */ - if (index >= 0) _removeObjects.splice(index, 1); - - called = true; - if (sync || removeFunction === FN_RMDIR_SYNC || removeFunction === FN_RIMRAF_SYNC) { - return removeFunction(fileOrDirName); - } else { - return removeFunction(fileOrDirName, next || function() {}); - } - } - }; -} - -/** - * The garbage collector. - * - * @private - */ -function _garbageCollector() { - /* istanbul ignore else */ - if (!_gracefulCleanup) return; - - // the function being called removes itself from _removeObjects, - // loop until _removeObjects is empty - while (_removeObjects.length) { - try { - _removeObjects[0](); - } catch (e) { - // already removed? - } - } -} - -/** - * Random name generator based on crypto. - * Adapted from http://blog.tompawlak.org/how-to-generate-random-values-nodejs-javascript - * - * @param {number} howMany - * @returns {string} the generated random name - * @private - */ -function _randomChars(howMany) { - let - value = [], - rnd = null; - - // make sure that we do not fail because we ran out of entropy - try { - rnd = crypto.randomBytes(howMany); - } catch (e) { - rnd = crypto.pseudoRandomBytes(howMany); - } - - for (var i = 0; i < howMany; i++) { - value.push(RANDOM_CHARS[rnd[i] % RANDOM_CHARS.length]); - } - - return value.join(''); -} - -/** - * Helper which determines whether a string s is blank, that is undefined, or empty or null. - * - * @private - * @param {string} s - * @returns {Boolean} true whether the string s is blank, false otherwise - */ -function _isBlank(s) { - return s === null || _isUndefined(s) || !s.trim(); -} - -/** - * Checks whether the `obj` parameter is defined or not. - * - * @param {Object} obj - * @returns {boolean} true if the object is undefined - * @private - */ -function _isUndefined(obj) { - return typeof obj === 'undefined'; -} - -/** - * Parses the function arguments. - * - * This function helps to have optional arguments. - * - * @param {(Options|null|undefined|Function)} options - * @param {?Function} callback - * @returns {Array} parsed arguments - * @private - */ -function _parseArguments(options, callback) { - /* istanbul ignore else */ - if (typeof options === 'function') { - return [{}, options]; - } - - /* istanbul ignore else */ - if (_isUndefined(options)) { - return [{}, callback]; - } - - // copy options so we do not leak the changes we make internally - const actualOptions = {}; - for (const key of Object.getOwnPropertyNames(options)) { - actualOptions[key] = options[key]; - } - - return [actualOptions, callback]; -} - -/** - * Generates a new temporary name. - * - * @param {Object} opts - * @returns {string} the new random name according to opts - * @private - */ -function _generateTmpName(opts) { - - const tmpDir = opts.tmpdir; - - /* istanbul ignore else */ - if (!_isUndefined(opts.name)) - return path.join(tmpDir, opts.dir, opts.name); - - /* istanbul ignore else */ - if (!_isUndefined(opts.template)) - return path.join(tmpDir, opts.dir, opts.template).replace(TEMPLATE_PATTERN, _randomChars(6)); - - // prefix and postfix - const name = [ - opts.prefix ? opts.prefix : 'tmp', - '-', - process.pid, - '-', - _randomChars(12), - opts.postfix ? '-' + opts.postfix : '' - ].join(''); - - return path.join(tmpDir, opts.dir, name); -} - -/** - * Asserts whether the specified options are valid, also sanitizes options and provides sane defaults for missing - * options. - * - * @param {Options} options - * @private - */ -function _assertAndSanitizeOptions(options) { - - options.tmpdir = _getTmpDir(options); - - const tmpDir = options.tmpdir; - - /* istanbul ignore else */ - if (!_isUndefined(options.name)) - _assertIsRelative(options.name, 'name', tmpDir); - /* istanbul ignore else */ - if (!_isUndefined(options.dir)) - _assertIsRelative(options.dir, 'dir', tmpDir); - /* istanbul ignore else */ - if (!_isUndefined(options.template)) { - _assertIsRelative(options.template, 'template', tmpDir); - if (!options.template.match(TEMPLATE_PATTERN)) - throw new Error(`Invalid template, found "${options.template}".`); - } - /* istanbul ignore else */ - if (!_isUndefined(options.tries) && isNaN(options.tries) || options.tries < 0) - throw new Error(`Invalid tries, found "${options.tries}".`); - - // if a name was specified we will try once - options.tries = _isUndefined(options.name) ? options.tries || DEFAULT_TRIES : 1; - options.keep = !!options.keep; - options.detachDescriptor = !!options.detachDescriptor; - options.discardDescriptor = !!options.discardDescriptor; - options.unsafeCleanup = !!options.unsafeCleanup; - - // sanitize dir, also keep (multiple) blanks if the user, purportedly sane, requests us to - options.dir = _isUndefined(options.dir) ? '' : path.relative(tmpDir, _resolvePath(options.dir, tmpDir)); - options.template = _isUndefined(options.template) ? undefined : path.relative(tmpDir, _resolvePath(options.template, tmpDir)); - // sanitize further if template is relative to options.dir - options.template = _isBlank(options.template) ? undefined : path.relative(options.dir, options.template); - - // for completeness' sake only, also keep (multiple) blanks if the user, purportedly sane, requests us to - options.name = _isUndefined(options.name) ? undefined : _sanitizeName(options.name); - options.prefix = _isUndefined(options.prefix) ? '' : options.prefix; - options.postfix = _isUndefined(options.postfix) ? '' : options.postfix; -} - -/** - * Resolve the specified path name in respect to tmpDir. - * - * The specified name might include relative path components, e.g. ../ - * so we need to resolve in order to be sure that is is located inside tmpDir - * - * @param name - * @param tmpDir - * @returns {string} - * @private - */ -function _resolvePath(name, tmpDir) { - const sanitizedName = _sanitizeName(name); - if (sanitizedName.startsWith(tmpDir)) { - return path.resolve(sanitizedName); - } else { - return path.resolve(path.join(tmpDir, sanitizedName)); - } -} - -/** - * Sanitize the specified path name by removing all quote characters. - * - * @param name - * @returns {string} - * @private - */ -function _sanitizeName(name) { - if (_isBlank(name)) { - return name; - } - return name.replace(/["']/g, ''); -} - -/** - * Asserts whether specified name is relative to the specified tmpDir. - * - * @param {string} name - * @param {string} option - * @param {string} tmpDir - * @throws {Error} - * @private - */ -function _assertIsRelative(name, option, tmpDir) { - if (option === 'name') { - // assert that name is not absolute and does not contain a path - if (path.isAbsolute(name)) - throw new Error(`${option} option must not contain an absolute path, found "${name}".`); - // must not fail on valid . or .. or similar such constructs - let basename = path.basename(name); - if (basename === '..' || basename === '.' || basename !== name) - throw new Error(`${option} option must not contain a path, found "${name}".`); - } - else { // if (option === 'dir' || option === 'template') { - // assert that dir or template are relative to tmpDir - if (path.isAbsolute(name) && !name.startsWith(tmpDir)) { - throw new Error(`${option} option must be relative to "${tmpDir}", found "${name}".`); - } - let resolvedPath = _resolvePath(name, tmpDir); - if (!resolvedPath.startsWith(tmpDir)) - throw new Error(`${option} option must be relative to "${tmpDir}", found "${resolvedPath}".`); - } -} - -/** - * Helper for testing against EBADF to compensate changes made to Node 7.x under Windows. - * - * @private - */ -function _isEBADF(error) { - return _isExpectedError(error, -EBADF, 'EBADF'); -} - -/** - * Helper for testing against ENOENT to compensate changes made to Node 7.x under Windows. - * - * @private - */ -function _isENOENT(error) { - return _isExpectedError(error, -ENOENT, 'ENOENT'); -} - -/** - * Helper to determine whether the expected error code matches the actual code and errno, - * which will differ between the supported node versions. - * - * - Node >= 7.0: - * error.code {string} - * error.errno {number} any numerical value will be negated - * - * CAVEAT - * - * On windows, the errno for EBADF is -4083 but os.constants.errno.EBADF is different and we must assume that ENOENT - * is no different here. - * - * @param {SystemError} error - * @param {number} errno - * @param {string} code - * @private - */ -function _isExpectedError(error, errno, code) { - return IS_WIN32 ? error.code === code : error.code === code && error.errno === errno; -} - -/** - * Sets the graceful cleanup. - * - * If graceful cleanup is set, tmp will remove all controlled temporary objects on process exit, otherwise the - * temporary objects will remain in place, waiting to be cleaned up on system restart or otherwise scheduled temporary - * object removals. - */ -function setGracefulCleanup() { - _gracefulCleanup = true; -} - -/** - * Returns the currently configured tmp dir from os.tmpdir(). - * - * @private - * @param {?Options} options - * @returns {string} the currently configured tmp dir - */ -function _getTmpDir(options) { - return path.resolve(_sanitizeName(options && options.tmpdir || os.tmpdir())); -} - -// Install process exit listener -process.addListener(EXIT, _garbageCollector); - -/** - * Configuration options. - * - * @typedef {Object} Options - * @property {?boolean} keep the temporary object (file or dir) will not be garbage collected - * @property {?number} tries the number of tries before give up the name generation - * @property (?int) mode the access mode, defaults are 0o700 for directories and 0o600 for files - * @property {?string} template the "mkstemp" like filename template - * @property {?string} name fixed name relative to tmpdir or the specified dir option - * @property {?string} dir tmp directory relative to the root tmp directory in use - * @property {?string} prefix prefix for the generated name - * @property {?string} postfix postfix for the generated name - * @property {?string} tmpdir the root tmp directory which overrides the os tmpdir - * @property {?boolean} unsafeCleanup recursively removes the created temporary directory, even when it's not empty - * @property {?boolean} detachDescriptor detaches the file descriptor, caller is responsible for closing the file, tmp will no longer try closing the file during garbage collection - * @property {?boolean} discardDescriptor discards the file descriptor (closes file, fd is -1), tmp will no longer try closing the file during garbage collection - */ - -/** - * @typedef {Object} FileSyncObject - * @property {string} name the name of the file - * @property {string} fd the file descriptor or -1 if the fd has been discarded - * @property {fileCallback} removeCallback the callback function to remove the file - */ - -/** - * @typedef {Object} DirSyncObject - * @property {string} name the name of the directory - * @property {fileCallback} removeCallback the callback function to remove the directory - */ - -/** - * @callback tmpNameCallback - * @param {?Error} err the error object if anything goes wrong - * @param {string} name the temporary file name - */ - -/** - * @callback fileCallback - * @param {?Error} err the error object if anything goes wrong - * @param {string} name the temporary file name - * @param {number} fd the file descriptor or -1 if the fd had been discarded - * @param {cleanupCallback} fn the cleanup callback function - */ - -/** - * @callback fileCallbackSync - * @param {?Error} err the error object if anything goes wrong - * @param {string} name the temporary file name - * @param {number} fd the file descriptor or -1 if the fd had been discarded - * @param {cleanupCallbackSync} fn the cleanup callback function - */ - -/** - * @callback dirCallback - * @param {?Error} err the error object if anything goes wrong - * @param {string} name the temporary file name - * @param {cleanupCallback} fn the cleanup callback function - */ - -/** - * @callback dirCallbackSync - * @param {?Error} err the error object if anything goes wrong - * @param {string} name the temporary file name - * @param {cleanupCallbackSync} fn the cleanup callback function - */ - -/** - * Removes the temporary created file or directory. - * - * @callback cleanupCallback - * @param {simpleCallback} [next] function to call whenever the tmp object needs to be removed - */ - -/** - * Removes the temporary created file or directory. - * - * @callback cleanupCallbackSync - */ - -/** - * Callback function for function composition. - * @see {@link https://github.com/raszi/node-tmp/issues/57|raszi/node-tmp#57} - * - * @callback simpleCallback - */ - -// exporting all the needed methods - -// evaluate _getTmpDir() lazily, mainly for simplifying testing but it also will -// allow users to reconfigure the temporary directory -Object.defineProperty(module.exports, 'tmpdir', { - enumerable: true, - configurable: false, - get: function () { - return _getTmpDir(); - } -}); - -module.exports.dir = dir; -module.exports.dirSync = dirSync; - -module.exports.file = file; -module.exports.fileSync = fileSync; - -module.exports.tmpName = tmpName; -module.exports.tmpNameSync = tmpNameSync; - -module.exports.setGracefulCleanup = setGracefulCleanup; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/tmp/package.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/tmp/package.json deleted file mode 100644 index d98a9108..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/tmp/package.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "name": "tmp", - "version": "0.2.1", - "description": "Temporary file and directory creator", - "author": "KARASZI István (http://raszi.hu/)", - "contributors": [ - "Carsten Klein (https://github.com/silkentrance)" - ], - "keywords": [ - "temporary", - "tmp", - "temp", - "tempdir", - "tempfile", - "tmpdir", - "tmpfile" - ], - "license": "MIT", - "repository": "https://github.com/raszi/node-tmp.git", - "homepage": "http://github.com/raszi/node-tmp", - "bugs": { - "url": "http://github.com/raszi/node-tmp/issues" - }, - "engines": { - "node": ">=8.17.0" - }, - "dependencies": { - "rimraf": "^3.0.0" - }, - "devDependencies": { - "eslint": "^6.3.0", - "eslint-plugin-mocha": "^6.1.1", - "istanbul": "^0.4.5", - "lerna-changelog": "^1.0.1", - "mocha": "^6.2.0" - }, - "main": "lib/tmp.js", - "files": [ - "lib/" - ], - "changelog": { - "labels": { - "breaking": ":boom: Breaking Change", - "enhancement": ":rocket: Enhancement", - "bug": ":bug: Bug Fix", - "documentation": ":memo: Documentation", - "internal": ":house: Internal" - }, - "cacheDir": ".changelog" - }, - "scripts": { - "changelog": "lerna-changelog", - "lint": "eslint lib --env mocha test", - "clean": "rm -Rf ./coverage", - "test": "npm run clean && istanbul cover ./node_modules/mocha/bin/_mocha --report none --print none --dir ./coverage/json -u exports -R test/*-test.js && istanbul report --root ./coverage/json html && istanbul report text-summary", - "doc": "jsdoc -c .jsdoc.json" - } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/tr46/.npmignore b/packages/wyatt_notification_bloc/example/scripts/node_modules/tr46/.npmignore deleted file mode 100644 index 96e9161f..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/tr46/.npmignore +++ /dev/null @@ -1,4 +0,0 @@ -scripts/ -test/ - -!lib/mapping_table.json diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/tr46/index.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/tr46/index.js deleted file mode 100644 index 9ce12ca2..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/tr46/index.js +++ /dev/null @@ -1,193 +0,0 @@ -"use strict"; - -var punycode = require("punycode"); -var mappingTable = require("./lib/mappingTable.json"); - -var PROCESSING_OPTIONS = { - TRANSITIONAL: 0, - NONTRANSITIONAL: 1 -}; - -function normalize(str) { // fix bug in v8 - return str.split('\u0000').map(function (s) { return s.normalize('NFC'); }).join('\u0000'); -} - -function findStatus(val) { - var start = 0; - var end = mappingTable.length - 1; - - while (start <= end) { - var mid = Math.floor((start + end) / 2); - - var target = mappingTable[mid]; - if (target[0][0] <= val && target[0][1] >= val) { - return target; - } else if (target[0][0] > val) { - end = mid - 1; - } else { - start = mid + 1; - } - } - - return null; -} - -var regexAstralSymbols = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g; - -function countSymbols(string) { - return string - // replace every surrogate pair with a BMP symbol - .replace(regexAstralSymbols, '_') - // then get the length - .length; -} - -function mapChars(domain_name, useSTD3, processing_option) { - var hasError = false; - var processed = ""; - - var len = countSymbols(domain_name); - for (var i = 0; i < len; ++i) { - var codePoint = domain_name.codePointAt(i); - var status = findStatus(codePoint); - - switch (status[1]) { - case "disallowed": - hasError = true; - processed += String.fromCodePoint(codePoint); - break; - case "ignored": - break; - case "mapped": - processed += String.fromCodePoint.apply(String, status[2]); - break; - case "deviation": - if (processing_option === PROCESSING_OPTIONS.TRANSITIONAL) { - processed += String.fromCodePoint.apply(String, status[2]); - } else { - processed += String.fromCodePoint(codePoint); - } - break; - case "valid": - processed += String.fromCodePoint(codePoint); - break; - case "disallowed_STD3_mapped": - if (useSTD3) { - hasError = true; - processed += String.fromCodePoint(codePoint); - } else { - processed += String.fromCodePoint.apply(String, status[2]); - } - break; - case "disallowed_STD3_valid": - if (useSTD3) { - hasError = true; - } - - processed += String.fromCodePoint(codePoint); - break; - } - } - - return { - string: processed, - error: hasError - }; -} - -var combiningMarksRegex = /[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08E4-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C03\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D01-\u0D03\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u18A9\u1920-\u192B\u1930-\u193B\u19B0-\u19C0\u19C8\u19C9\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF8\u1CF9\u1DC0-\u1DF5\u1DFC-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C4\uA8E0-\uA8F1\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2D]|\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD804[\uDC00-\uDC02\uDC38-\uDC46\uDC7F-\uDC82\uDCB0-\uDCBA\uDD00-\uDD02\uDD27-\uDD34\uDD73\uDD80-\uDD82\uDDB3-\uDDC0\uDE2C-\uDE37\uDEDF-\uDEEA\uDF01-\uDF03\uDF3C\uDF3E-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF57\uDF62\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDCB0-\uDCC3\uDDAF-\uDDB5\uDDB8-\uDDC0\uDE30-\uDE40\uDEAB-\uDEB7]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF51-\uDF7E\uDF8F-\uDF92]|\uD82F[\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD83A[\uDCD0-\uDCD6]|\uDB40[\uDD00-\uDDEF]/; - -function validateLabel(label, processing_option) { - if (label.substr(0, 4) === "xn--") { - label = punycode.toUnicode(label); - processing_option = PROCESSING_OPTIONS.NONTRANSITIONAL; - } - - var error = false; - - if (normalize(label) !== label || - (label[3] === "-" && label[4] === "-") || - label[0] === "-" || label[label.length - 1] === "-" || - label.indexOf(".") !== -1 || - label.search(combiningMarksRegex) === 0) { - error = true; - } - - var len = countSymbols(label); - for (var i = 0; i < len; ++i) { - var status = findStatus(label.codePointAt(i)); - if ((processing === PROCESSING_OPTIONS.TRANSITIONAL && status[1] !== "valid") || - (processing === PROCESSING_OPTIONS.NONTRANSITIONAL && - status[1] !== "valid" && status[1] !== "deviation")) { - error = true; - break; - } - } - - return { - label: label, - error: error - }; -} - -function processing(domain_name, useSTD3, processing_option) { - var result = mapChars(domain_name, useSTD3, processing_option); - result.string = normalize(result.string); - - var labels = result.string.split("."); - for (var i = 0; i < labels.length; ++i) { - try { - var validation = validateLabel(labels[i]); - labels[i] = validation.label; - result.error = result.error || validation.error; - } catch(e) { - result.error = true; - } - } - - return { - string: labels.join("."), - error: result.error - }; -} - -module.exports.toASCII = function(domain_name, useSTD3, processing_option, verifyDnsLength) { - var result = processing(domain_name, useSTD3, processing_option); - var labels = result.string.split("."); - labels = labels.map(function(l) { - try { - return punycode.toASCII(l); - } catch(e) { - result.error = true; - return l; - } - }); - - if (verifyDnsLength) { - var total = labels.slice(0, labels.length - 1).join(".").length; - if (total.length > 253 || total.length === 0) { - result.error = true; - } - - for (var i=0; i < labels.length; ++i) { - if (labels.length > 63 || labels.length === 0) { - result.error = true; - break; - } - } - } - - if (result.error) return null; - return labels.join("."); -}; - -module.exports.toUnicode = function(domain_name, useSTD3) { - var result = processing(domain_name, useSTD3, PROCESSING_OPTIONS.NONTRANSITIONAL); - - return { - domain: result.string, - error: result.error - }; -}; - -module.exports.PROCESSING_OPTIONS = PROCESSING_OPTIONS; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/tr46/lib/.gitkeep b/packages/wyatt_notification_bloc/example/scripts/node_modules/tr46/lib/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/tr46/lib/mappingTable.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/tr46/lib/mappingTable.json deleted file mode 100644 index 89cf19a7..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/tr46/lib/mappingTable.json +++ /dev/null @@ -1 +0,0 @@ -[[[0,44],"disallowed_STD3_valid"],[[45,46],"valid"],[[47,47],"disallowed_STD3_valid"],[[48,57],"valid"],[[58,64],"disallowed_STD3_valid"],[[65,65],"mapped",[97]],[[66,66],"mapped",[98]],[[67,67],"mapped",[99]],[[68,68],"mapped",[100]],[[69,69],"mapped",[101]],[[70,70],"mapped",[102]],[[71,71],"mapped",[103]],[[72,72],"mapped",[104]],[[73,73],"mapped",[105]],[[74,74],"mapped",[106]],[[75,75],"mapped",[107]],[[76,76],"mapped",[108]],[[77,77],"mapped",[109]],[[78,78],"mapped",[110]],[[79,79],"mapped",[111]],[[80,80],"mapped",[112]],[[81,81],"mapped",[113]],[[82,82],"mapped",[114]],[[83,83],"mapped",[115]],[[84,84],"mapped",[116]],[[85,85],"mapped",[117]],[[86,86],"mapped",[118]],[[87,87],"mapped",[119]],[[88,88],"mapped",[120]],[[89,89],"mapped",[121]],[[90,90],"mapped",[122]],[[91,96],"disallowed_STD3_valid"],[[97,122],"valid"],[[123,127],"disallowed_STD3_valid"],[[128,159],"disallowed"],[[160,160],"disallowed_STD3_mapped",[32]],[[161,167],"valid",[],"NV8"],[[168,168],"disallowed_STD3_mapped",[32,776]],[[169,169],"valid",[],"NV8"],[[170,170],"mapped",[97]],[[171,172],"valid",[],"NV8"],[[173,173],"ignored"],[[174,174],"valid",[],"NV8"],[[175,175],"disallowed_STD3_mapped",[32,772]],[[176,177],"valid",[],"NV8"],[[178,178],"mapped",[50]],[[179,179],"mapped",[51]],[[180,180],"disallowed_STD3_mapped",[32,769]],[[181,181],"mapped",[956]],[[182,182],"valid",[],"NV8"],[[183,183],"valid"],[[184,184],"disallowed_STD3_mapped",[32,807]],[[185,185],"mapped",[49]],[[186,186],"mapped",[111]],[[187,187],"valid",[],"NV8"],[[188,188],"mapped",[49,8260,52]],[[189,189],"mapped",[49,8260,50]],[[190,190],"mapped",[51,8260,52]],[[191,191],"valid",[],"NV8"],[[192,192],"mapped",[224]],[[193,193],"mapped",[225]],[[194,194],"mapped",[226]],[[195,195],"mapped",[227]],[[196,196],"mapped",[228]],[[197,197],"mapped",[229]],[[198,198],"mapped",[230]],[[199,199],"mapped",[231]],[[200,200],"mapped",[232]],[[201,201],"mapped",[233]],[[202,202],"mapped",[234]],[[203,203],"mapped",[235]],[[204,204],"mapped",[236]],[[205,205],"mapped",[237]],[[206,206],"mapped",[238]],[[207,207],"mapped",[239]],[[208,208],"mapped",[240]],[[209,209],"mapped",[241]],[[210,210],"mapped",[242]],[[211,211],"mapped",[243]],[[212,212],"mapped",[244]],[[213,213],"mapped",[245]],[[214,214],"mapped",[246]],[[215,215],"valid",[],"NV8"],[[216,216],"mapped",[248]],[[217,217],"mapped",[249]],[[218,218],"mapped",[250]],[[219,219],"mapped",[251]],[[220,220],"mapped",[252]],[[221,221],"mapped",[253]],[[222,222],"mapped",[254]],[[223,223],"deviation",[115,115]],[[224,246],"valid"],[[247,247],"valid",[],"NV8"],[[248,255],"valid"],[[256,256],"mapped",[257]],[[257,257],"valid"],[[258,258],"mapped",[259]],[[259,259],"valid"],[[260,260],"mapped",[261]],[[261,261],"valid"],[[262,262],"mapped",[263]],[[263,263],"valid"],[[264,264],"mapped",[265]],[[265,265],"valid"],[[266,266],"mapped",[267]],[[267,267],"valid"],[[268,268],"mapped",[269]],[[269,269],"valid"],[[270,270],"mapped",[271]],[[271,271],"valid"],[[272,272],"mapped",[273]],[[273,273],"valid"],[[274,274],"mapped",[275]],[[275,275],"valid"],[[276,276],"mapped",[277]],[[277,277],"valid"],[[278,278],"mapped",[279]],[[279,279],"valid"],[[280,280],"mapped",[281]],[[281,281],"valid"],[[282,282],"mapped",[283]],[[283,283],"valid"],[[284,284],"mapped",[285]],[[285,285],"valid"],[[286,286],"mapped",[287]],[[287,287],"valid"],[[288,288],"mapped",[289]],[[289,289],"valid"],[[290,290],"mapped",[291]],[[291,291],"valid"],[[292,292],"mapped",[293]],[[293,293],"valid"],[[294,294],"mapped",[295]],[[295,295],"valid"],[[296,296],"mapped",[297]],[[297,297],"valid"],[[298,298],"mapped",[299]],[[299,299],"valid"],[[300,300],"mapped",[301]],[[301,301],"valid"],[[302,302],"mapped",[303]],[[303,303],"valid"],[[304,304],"mapped",[105,775]],[[305,305],"valid"],[[306,307],"mapped",[105,106]],[[308,308],"mapped",[309]],[[309,309],"valid"],[[310,310],"mapped",[311]],[[311,312],"valid"],[[313,313],"mapped",[314]],[[314,314],"valid"],[[315,315],"mapped",[316]],[[316,316],"valid"],[[317,317],"mapped",[318]],[[318,318],"valid"],[[319,320],"mapped",[108,183]],[[321,321],"mapped",[322]],[[322,322],"valid"],[[323,323],"mapped",[324]],[[324,324],"valid"],[[325,325],"mapped",[326]],[[326,326],"valid"],[[327,327],"mapped",[328]],[[328,328],"valid"],[[329,329],"mapped",[700,110]],[[330,330],"mapped",[331]],[[331,331],"valid"],[[332,332],"mapped",[333]],[[333,333],"valid"],[[334,334],"mapped",[335]],[[335,335],"valid"],[[336,336],"mapped",[337]],[[337,337],"valid"],[[338,338],"mapped",[339]],[[339,339],"valid"],[[340,340],"mapped",[341]],[[341,341],"valid"],[[342,342],"mapped",[343]],[[343,343],"valid"],[[344,344],"mapped",[345]],[[345,345],"valid"],[[346,346],"mapped",[347]],[[347,347],"valid"],[[348,348],"mapped",[349]],[[349,349],"valid"],[[350,350],"mapped",[351]],[[351,351],"valid"],[[352,352],"mapped",[353]],[[353,353],"valid"],[[354,354],"mapped",[355]],[[355,355],"valid"],[[356,356],"mapped",[357]],[[357,357],"valid"],[[358,358],"mapped",[359]],[[359,359],"valid"],[[360,360],"mapped",[361]],[[361,361],"valid"],[[362,362],"mapped",[363]],[[363,363],"valid"],[[364,364],"mapped",[365]],[[365,365],"valid"],[[366,366],"mapped",[367]],[[367,367],"valid"],[[368,368],"mapped",[369]],[[369,369],"valid"],[[370,370],"mapped",[371]],[[371,371],"valid"],[[372,372],"mapped",[373]],[[373,373],"valid"],[[374,374],"mapped",[375]],[[375,375],"valid"],[[376,376],"mapped",[255]],[[377,377],"mapped",[378]],[[378,378],"valid"],[[379,379],"mapped",[380]],[[380,380],"valid"],[[381,381],"mapped",[382]],[[382,382],"valid"],[[383,383],"mapped",[115]],[[384,384],"valid"],[[385,385],"mapped",[595]],[[386,386],"mapped",[387]],[[387,387],"valid"],[[388,388],"mapped",[389]],[[389,389],"valid"],[[390,390],"mapped",[596]],[[391,391],"mapped",[392]],[[392,392],"valid"],[[393,393],"mapped",[598]],[[394,394],"mapped",[599]],[[395,395],"mapped",[396]],[[396,397],"valid"],[[398,398],"mapped",[477]],[[399,399],"mapped",[601]],[[400,400],"mapped",[603]],[[401,401],"mapped",[402]],[[402,402],"valid"],[[403,403],"mapped",[608]],[[404,404],"mapped",[611]],[[405,405],"valid"],[[406,406],"mapped",[617]],[[407,407],"mapped",[616]],[[408,408],"mapped",[409]],[[409,411],"valid"],[[412,412],"mapped",[623]],[[413,413],"mapped",[626]],[[414,414],"valid"],[[415,415],"mapped",[629]],[[416,416],"mapped",[417]],[[417,417],"valid"],[[418,418],"mapped",[419]],[[419,419],"valid"],[[420,420],"mapped",[421]],[[421,421],"valid"],[[422,422],"mapped",[640]],[[423,423],"mapped",[424]],[[424,424],"valid"],[[425,425],"mapped",[643]],[[426,427],"valid"],[[428,428],"mapped",[429]],[[429,429],"valid"],[[430,430],"mapped",[648]],[[431,431],"mapped",[432]],[[432,432],"valid"],[[433,433],"mapped",[650]],[[434,434],"mapped",[651]],[[435,435],"mapped",[436]],[[436,436],"valid"],[[437,437],"mapped",[438]],[[438,438],"valid"],[[439,439],"mapped",[658]],[[440,440],"mapped",[441]],[[441,443],"valid"],[[444,444],"mapped",[445]],[[445,451],"valid"],[[452,454],"mapped",[100,382]],[[455,457],"mapped",[108,106]],[[458,460],"mapped",[110,106]],[[461,461],"mapped",[462]],[[462,462],"valid"],[[463,463],"mapped",[464]],[[464,464],"valid"],[[465,465],"mapped",[466]],[[466,466],"valid"],[[467,467],"mapped",[468]],[[468,468],"valid"],[[469,469],"mapped",[470]],[[470,470],"valid"],[[471,471],"mapped",[472]],[[472,472],"valid"],[[473,473],"mapped",[474]],[[474,474],"valid"],[[475,475],"mapped",[476]],[[476,477],"valid"],[[478,478],"mapped",[479]],[[479,479],"valid"],[[480,480],"mapped",[481]],[[481,481],"valid"],[[482,482],"mapped",[483]],[[483,483],"valid"],[[484,484],"mapped",[485]],[[485,485],"valid"],[[486,486],"mapped",[487]],[[487,487],"valid"],[[488,488],"mapped",[489]],[[489,489],"valid"],[[490,490],"mapped",[491]],[[491,491],"valid"],[[492,492],"mapped",[493]],[[493,493],"valid"],[[494,494],"mapped",[495]],[[495,496],"valid"],[[497,499],"mapped",[100,122]],[[500,500],"mapped",[501]],[[501,501],"valid"],[[502,502],"mapped",[405]],[[503,503],"mapped",[447]],[[504,504],"mapped",[505]],[[505,505],"valid"],[[506,506],"mapped",[507]],[[507,507],"valid"],[[508,508],"mapped",[509]],[[509,509],"valid"],[[510,510],"mapped",[511]],[[511,511],"valid"],[[512,512],"mapped",[513]],[[513,513],"valid"],[[514,514],"mapped",[515]],[[515,515],"valid"],[[516,516],"mapped",[517]],[[517,517],"valid"],[[518,518],"mapped",[519]],[[519,519],"valid"],[[520,520],"mapped",[521]],[[521,521],"valid"],[[522,522],"mapped",[523]],[[523,523],"valid"],[[524,524],"mapped",[525]],[[525,525],"valid"],[[526,526],"mapped",[527]],[[527,527],"valid"],[[528,528],"mapped",[529]],[[529,529],"valid"],[[530,530],"mapped",[531]],[[531,531],"valid"],[[532,532],"mapped",[533]],[[533,533],"valid"],[[534,534],"mapped",[535]],[[535,535],"valid"],[[536,536],"mapped",[537]],[[537,537],"valid"],[[538,538],"mapped",[539]],[[539,539],"valid"],[[540,540],"mapped",[541]],[[541,541],"valid"],[[542,542],"mapped",[543]],[[543,543],"valid"],[[544,544],"mapped",[414]],[[545,545],"valid"],[[546,546],"mapped",[547]],[[547,547],"valid"],[[548,548],"mapped",[549]],[[549,549],"valid"],[[550,550],"mapped",[551]],[[551,551],"valid"],[[552,552],"mapped",[553]],[[553,553],"valid"],[[554,554],"mapped",[555]],[[555,555],"valid"],[[556,556],"mapped",[557]],[[557,557],"valid"],[[558,558],"mapped",[559]],[[559,559],"valid"],[[560,560],"mapped",[561]],[[561,561],"valid"],[[562,562],"mapped",[563]],[[563,563],"valid"],[[564,566],"valid"],[[567,569],"valid"],[[570,570],"mapped",[11365]],[[571,571],"mapped",[572]],[[572,572],"valid"],[[573,573],"mapped",[410]],[[574,574],"mapped",[11366]],[[575,576],"valid"],[[577,577],"mapped",[578]],[[578,578],"valid"],[[579,579],"mapped",[384]],[[580,580],"mapped",[649]],[[581,581],"mapped",[652]],[[582,582],"mapped",[583]],[[583,583],"valid"],[[584,584],"mapped",[585]],[[585,585],"valid"],[[586,586],"mapped",[587]],[[587,587],"valid"],[[588,588],"mapped",[589]],[[589,589],"valid"],[[590,590],"mapped",[591]],[[591,591],"valid"],[[592,680],"valid"],[[681,685],"valid"],[[686,687],"valid"],[[688,688],"mapped",[104]],[[689,689],"mapped",[614]],[[690,690],"mapped",[106]],[[691,691],"mapped",[114]],[[692,692],"mapped",[633]],[[693,693],"mapped",[635]],[[694,694],"mapped",[641]],[[695,695],"mapped",[119]],[[696,696],"mapped",[121]],[[697,705],"valid"],[[706,709],"valid",[],"NV8"],[[710,721],"valid"],[[722,727],"valid",[],"NV8"],[[728,728],"disallowed_STD3_mapped",[32,774]],[[729,729],"disallowed_STD3_mapped",[32,775]],[[730,730],"disallowed_STD3_mapped",[32,778]],[[731,731],"disallowed_STD3_mapped",[32,808]],[[732,732],"disallowed_STD3_mapped",[32,771]],[[733,733],"disallowed_STD3_mapped",[32,779]],[[734,734],"valid",[],"NV8"],[[735,735],"valid",[],"NV8"],[[736,736],"mapped",[611]],[[737,737],"mapped",[108]],[[738,738],"mapped",[115]],[[739,739],"mapped",[120]],[[740,740],"mapped",[661]],[[741,745],"valid",[],"NV8"],[[746,747],"valid",[],"NV8"],[[748,748],"valid"],[[749,749],"valid",[],"NV8"],[[750,750],"valid"],[[751,767],"valid",[],"NV8"],[[768,831],"valid"],[[832,832],"mapped",[768]],[[833,833],"mapped",[769]],[[834,834],"valid"],[[835,835],"mapped",[787]],[[836,836],"mapped",[776,769]],[[837,837],"mapped",[953]],[[838,846],"valid"],[[847,847],"ignored"],[[848,855],"valid"],[[856,860],"valid"],[[861,863],"valid"],[[864,865],"valid"],[[866,866],"valid"],[[867,879],"valid"],[[880,880],"mapped",[881]],[[881,881],"valid"],[[882,882],"mapped",[883]],[[883,883],"valid"],[[884,884],"mapped",[697]],[[885,885],"valid"],[[886,886],"mapped",[887]],[[887,887],"valid"],[[888,889],"disallowed"],[[890,890],"disallowed_STD3_mapped",[32,953]],[[891,893],"valid"],[[894,894],"disallowed_STD3_mapped",[59]],[[895,895],"mapped",[1011]],[[896,899],"disallowed"],[[900,900],"disallowed_STD3_mapped",[32,769]],[[901,901],"disallowed_STD3_mapped",[32,776,769]],[[902,902],"mapped",[940]],[[903,903],"mapped",[183]],[[904,904],"mapped",[941]],[[905,905],"mapped",[942]],[[906,906],"mapped",[943]],[[907,907],"disallowed"],[[908,908],"mapped",[972]],[[909,909],"disallowed"],[[910,910],"mapped",[973]],[[911,911],"mapped",[974]],[[912,912],"valid"],[[913,913],"mapped",[945]],[[914,914],"mapped",[946]],[[915,915],"mapped",[947]],[[916,916],"mapped",[948]],[[917,917],"mapped",[949]],[[918,918],"mapped",[950]],[[919,919],"mapped",[951]],[[920,920],"mapped",[952]],[[921,921],"mapped",[953]],[[922,922],"mapped",[954]],[[923,923],"mapped",[955]],[[924,924],"mapped",[956]],[[925,925],"mapped",[957]],[[926,926],"mapped",[958]],[[927,927],"mapped",[959]],[[928,928],"mapped",[960]],[[929,929],"mapped",[961]],[[930,930],"disallowed"],[[931,931],"mapped",[963]],[[932,932],"mapped",[964]],[[933,933],"mapped",[965]],[[934,934],"mapped",[966]],[[935,935],"mapped",[967]],[[936,936],"mapped",[968]],[[937,937],"mapped",[969]],[[938,938],"mapped",[970]],[[939,939],"mapped",[971]],[[940,961],"valid"],[[962,962],"deviation",[963]],[[963,974],"valid"],[[975,975],"mapped",[983]],[[976,976],"mapped",[946]],[[977,977],"mapped",[952]],[[978,978],"mapped",[965]],[[979,979],"mapped",[973]],[[980,980],"mapped",[971]],[[981,981],"mapped",[966]],[[982,982],"mapped",[960]],[[983,983],"valid"],[[984,984],"mapped",[985]],[[985,985],"valid"],[[986,986],"mapped",[987]],[[987,987],"valid"],[[988,988],"mapped",[989]],[[989,989],"valid"],[[990,990],"mapped",[991]],[[991,991],"valid"],[[992,992],"mapped",[993]],[[993,993],"valid"],[[994,994],"mapped",[995]],[[995,995],"valid"],[[996,996],"mapped",[997]],[[997,997],"valid"],[[998,998],"mapped",[999]],[[999,999],"valid"],[[1000,1000],"mapped",[1001]],[[1001,1001],"valid"],[[1002,1002],"mapped",[1003]],[[1003,1003],"valid"],[[1004,1004],"mapped",[1005]],[[1005,1005],"valid"],[[1006,1006],"mapped",[1007]],[[1007,1007],"valid"],[[1008,1008],"mapped",[954]],[[1009,1009],"mapped",[961]],[[1010,1010],"mapped",[963]],[[1011,1011],"valid"],[[1012,1012],"mapped",[952]],[[1013,1013],"mapped",[949]],[[1014,1014],"valid",[],"NV8"],[[1015,1015],"mapped",[1016]],[[1016,1016],"valid"],[[1017,1017],"mapped",[963]],[[1018,1018],"mapped",[1019]],[[1019,1019],"valid"],[[1020,1020],"valid"],[[1021,1021],"mapped",[891]],[[1022,1022],"mapped",[892]],[[1023,1023],"mapped",[893]],[[1024,1024],"mapped",[1104]],[[1025,1025],"mapped",[1105]],[[1026,1026],"mapped",[1106]],[[1027,1027],"mapped",[1107]],[[1028,1028],"mapped",[1108]],[[1029,1029],"mapped",[1109]],[[1030,1030],"mapped",[1110]],[[1031,1031],"mapped",[1111]],[[1032,1032],"mapped",[1112]],[[1033,1033],"mapped",[1113]],[[1034,1034],"mapped",[1114]],[[1035,1035],"mapped",[1115]],[[1036,1036],"mapped",[1116]],[[1037,1037],"mapped",[1117]],[[1038,1038],"mapped",[1118]],[[1039,1039],"mapped",[1119]],[[1040,1040],"mapped",[1072]],[[1041,1041],"mapped",[1073]],[[1042,1042],"mapped",[1074]],[[1043,1043],"mapped",[1075]],[[1044,1044],"mapped",[1076]],[[1045,1045],"mapped",[1077]],[[1046,1046],"mapped",[1078]],[[1047,1047],"mapped",[1079]],[[1048,1048],"mapped",[1080]],[[1049,1049],"mapped",[1081]],[[1050,1050],"mapped",[1082]],[[1051,1051],"mapped",[1083]],[[1052,1052],"mapped",[1084]],[[1053,1053],"mapped",[1085]],[[1054,1054],"mapped",[1086]],[[1055,1055],"mapped",[1087]],[[1056,1056],"mapped",[1088]],[[1057,1057],"mapped",[1089]],[[1058,1058],"mapped",[1090]],[[1059,1059],"mapped",[1091]],[[1060,1060],"mapped",[1092]],[[1061,1061],"mapped",[1093]],[[1062,1062],"mapped",[1094]],[[1063,1063],"mapped",[1095]],[[1064,1064],"mapped",[1096]],[[1065,1065],"mapped",[1097]],[[1066,1066],"mapped",[1098]],[[1067,1067],"mapped",[1099]],[[1068,1068],"mapped",[1100]],[[1069,1069],"mapped",[1101]],[[1070,1070],"mapped",[1102]],[[1071,1071],"mapped",[1103]],[[1072,1103],"valid"],[[1104,1104],"valid"],[[1105,1116],"valid"],[[1117,1117],"valid"],[[1118,1119],"valid"],[[1120,1120],"mapped",[1121]],[[1121,1121],"valid"],[[1122,1122],"mapped",[1123]],[[1123,1123],"valid"],[[1124,1124],"mapped",[1125]],[[1125,1125],"valid"],[[1126,1126],"mapped",[1127]],[[1127,1127],"valid"],[[1128,1128],"mapped",[1129]],[[1129,1129],"valid"],[[1130,1130],"mapped",[1131]],[[1131,1131],"valid"],[[1132,1132],"mapped",[1133]],[[1133,1133],"valid"],[[1134,1134],"mapped",[1135]],[[1135,1135],"valid"],[[1136,1136],"mapped",[1137]],[[1137,1137],"valid"],[[1138,1138],"mapped",[1139]],[[1139,1139],"valid"],[[1140,1140],"mapped",[1141]],[[1141,1141],"valid"],[[1142,1142],"mapped",[1143]],[[1143,1143],"valid"],[[1144,1144],"mapped",[1145]],[[1145,1145],"valid"],[[1146,1146],"mapped",[1147]],[[1147,1147],"valid"],[[1148,1148],"mapped",[1149]],[[1149,1149],"valid"],[[1150,1150],"mapped",[1151]],[[1151,1151],"valid"],[[1152,1152],"mapped",[1153]],[[1153,1153],"valid"],[[1154,1154],"valid",[],"NV8"],[[1155,1158],"valid"],[[1159,1159],"valid"],[[1160,1161],"valid",[],"NV8"],[[1162,1162],"mapped",[1163]],[[1163,1163],"valid"],[[1164,1164],"mapped",[1165]],[[1165,1165],"valid"],[[1166,1166],"mapped",[1167]],[[1167,1167],"valid"],[[1168,1168],"mapped",[1169]],[[1169,1169],"valid"],[[1170,1170],"mapped",[1171]],[[1171,1171],"valid"],[[1172,1172],"mapped",[1173]],[[1173,1173],"valid"],[[1174,1174],"mapped",[1175]],[[1175,1175],"valid"],[[1176,1176],"mapped",[1177]],[[1177,1177],"valid"],[[1178,1178],"mapped",[1179]],[[1179,1179],"valid"],[[1180,1180],"mapped",[1181]],[[1181,1181],"valid"],[[1182,1182],"mapped",[1183]],[[1183,1183],"valid"],[[1184,1184],"mapped",[1185]],[[1185,1185],"valid"],[[1186,1186],"mapped",[1187]],[[1187,1187],"valid"],[[1188,1188],"mapped",[1189]],[[1189,1189],"valid"],[[1190,1190],"mapped",[1191]],[[1191,1191],"valid"],[[1192,1192],"mapped",[1193]],[[1193,1193],"valid"],[[1194,1194],"mapped",[1195]],[[1195,1195],"valid"],[[1196,1196],"mapped",[1197]],[[1197,1197],"valid"],[[1198,1198],"mapped",[1199]],[[1199,1199],"valid"],[[1200,1200],"mapped",[1201]],[[1201,1201],"valid"],[[1202,1202],"mapped",[1203]],[[1203,1203],"valid"],[[1204,1204],"mapped",[1205]],[[1205,1205],"valid"],[[1206,1206],"mapped",[1207]],[[1207,1207],"valid"],[[1208,1208],"mapped",[1209]],[[1209,1209],"valid"],[[1210,1210],"mapped",[1211]],[[1211,1211],"valid"],[[1212,1212],"mapped",[1213]],[[1213,1213],"valid"],[[1214,1214],"mapped",[1215]],[[1215,1215],"valid"],[[1216,1216],"disallowed"],[[1217,1217],"mapped",[1218]],[[1218,1218],"valid"],[[1219,1219],"mapped",[1220]],[[1220,1220],"valid"],[[1221,1221],"mapped",[1222]],[[1222,1222],"valid"],[[1223,1223],"mapped",[1224]],[[1224,1224],"valid"],[[1225,1225],"mapped",[1226]],[[1226,1226],"valid"],[[1227,1227],"mapped",[1228]],[[1228,1228],"valid"],[[1229,1229],"mapped",[1230]],[[1230,1230],"valid"],[[1231,1231],"valid"],[[1232,1232],"mapped",[1233]],[[1233,1233],"valid"],[[1234,1234],"mapped",[1235]],[[1235,1235],"valid"],[[1236,1236],"mapped",[1237]],[[1237,1237],"valid"],[[1238,1238],"mapped",[1239]],[[1239,1239],"valid"],[[1240,1240],"mapped",[1241]],[[1241,1241],"valid"],[[1242,1242],"mapped",[1243]],[[1243,1243],"valid"],[[1244,1244],"mapped",[1245]],[[1245,1245],"valid"],[[1246,1246],"mapped",[1247]],[[1247,1247],"valid"],[[1248,1248],"mapped",[1249]],[[1249,1249],"valid"],[[1250,1250],"mapped",[1251]],[[1251,1251],"valid"],[[1252,1252],"mapped",[1253]],[[1253,1253],"valid"],[[1254,1254],"mapped",[1255]],[[1255,1255],"valid"],[[1256,1256],"mapped",[1257]],[[1257,1257],"valid"],[[1258,1258],"mapped",[1259]],[[1259,1259],"valid"],[[1260,1260],"mapped",[1261]],[[1261,1261],"valid"],[[1262,1262],"mapped",[1263]],[[1263,1263],"valid"],[[1264,1264],"mapped",[1265]],[[1265,1265],"valid"],[[1266,1266],"mapped",[1267]],[[1267,1267],"valid"],[[1268,1268],"mapped",[1269]],[[1269,1269],"valid"],[[1270,1270],"mapped",[1271]],[[1271,1271],"valid"],[[1272,1272],"mapped",[1273]],[[1273,1273],"valid"],[[1274,1274],"mapped",[1275]],[[1275,1275],"valid"],[[1276,1276],"mapped",[1277]],[[1277,1277],"valid"],[[1278,1278],"mapped",[1279]],[[1279,1279],"valid"],[[1280,1280],"mapped",[1281]],[[1281,1281],"valid"],[[1282,1282],"mapped",[1283]],[[1283,1283],"valid"],[[1284,1284],"mapped",[1285]],[[1285,1285],"valid"],[[1286,1286],"mapped",[1287]],[[1287,1287],"valid"],[[1288,1288],"mapped",[1289]],[[1289,1289],"valid"],[[1290,1290],"mapped",[1291]],[[1291,1291],"valid"],[[1292,1292],"mapped",[1293]],[[1293,1293],"valid"],[[1294,1294],"mapped",[1295]],[[1295,1295],"valid"],[[1296,1296],"mapped",[1297]],[[1297,1297],"valid"],[[1298,1298],"mapped",[1299]],[[1299,1299],"valid"],[[1300,1300],"mapped",[1301]],[[1301,1301],"valid"],[[1302,1302],"mapped",[1303]],[[1303,1303],"valid"],[[1304,1304],"mapped",[1305]],[[1305,1305],"valid"],[[1306,1306],"mapped",[1307]],[[1307,1307],"valid"],[[1308,1308],"mapped",[1309]],[[1309,1309],"valid"],[[1310,1310],"mapped",[1311]],[[1311,1311],"valid"],[[1312,1312],"mapped",[1313]],[[1313,1313],"valid"],[[1314,1314],"mapped",[1315]],[[1315,1315],"valid"],[[1316,1316],"mapped",[1317]],[[1317,1317],"valid"],[[1318,1318],"mapped",[1319]],[[1319,1319],"valid"],[[1320,1320],"mapped",[1321]],[[1321,1321],"valid"],[[1322,1322],"mapped",[1323]],[[1323,1323],"valid"],[[1324,1324],"mapped",[1325]],[[1325,1325],"valid"],[[1326,1326],"mapped",[1327]],[[1327,1327],"valid"],[[1328,1328],"disallowed"],[[1329,1329],"mapped",[1377]],[[1330,1330],"mapped",[1378]],[[1331,1331],"mapped",[1379]],[[1332,1332],"mapped",[1380]],[[1333,1333],"mapped",[1381]],[[1334,1334],"mapped",[1382]],[[1335,1335],"mapped",[1383]],[[1336,1336],"mapped",[1384]],[[1337,1337],"mapped",[1385]],[[1338,1338],"mapped",[1386]],[[1339,1339],"mapped",[1387]],[[1340,1340],"mapped",[1388]],[[1341,1341],"mapped",[1389]],[[1342,1342],"mapped",[1390]],[[1343,1343],"mapped",[1391]],[[1344,1344],"mapped",[1392]],[[1345,1345],"mapped",[1393]],[[1346,1346],"mapped",[1394]],[[1347,1347],"mapped",[1395]],[[1348,1348],"mapped",[1396]],[[1349,1349],"mapped",[1397]],[[1350,1350],"mapped",[1398]],[[1351,1351],"mapped",[1399]],[[1352,1352],"mapped",[1400]],[[1353,1353],"mapped",[1401]],[[1354,1354],"mapped",[1402]],[[1355,1355],"mapped",[1403]],[[1356,1356],"mapped",[1404]],[[1357,1357],"mapped",[1405]],[[1358,1358],"mapped",[1406]],[[1359,1359],"mapped",[1407]],[[1360,1360],"mapped",[1408]],[[1361,1361],"mapped",[1409]],[[1362,1362],"mapped",[1410]],[[1363,1363],"mapped",[1411]],[[1364,1364],"mapped",[1412]],[[1365,1365],"mapped",[1413]],[[1366,1366],"mapped",[1414]],[[1367,1368],"disallowed"],[[1369,1369],"valid"],[[1370,1375],"valid",[],"NV8"],[[1376,1376],"disallowed"],[[1377,1414],"valid"],[[1415,1415],"mapped",[1381,1410]],[[1416,1416],"disallowed"],[[1417,1417],"valid",[],"NV8"],[[1418,1418],"valid",[],"NV8"],[[1419,1420],"disallowed"],[[1421,1422],"valid",[],"NV8"],[[1423,1423],"valid",[],"NV8"],[[1424,1424],"disallowed"],[[1425,1441],"valid"],[[1442,1442],"valid"],[[1443,1455],"valid"],[[1456,1465],"valid"],[[1466,1466],"valid"],[[1467,1469],"valid"],[[1470,1470],"valid",[],"NV8"],[[1471,1471],"valid"],[[1472,1472],"valid",[],"NV8"],[[1473,1474],"valid"],[[1475,1475],"valid",[],"NV8"],[[1476,1476],"valid"],[[1477,1477],"valid"],[[1478,1478],"valid",[],"NV8"],[[1479,1479],"valid"],[[1480,1487],"disallowed"],[[1488,1514],"valid"],[[1515,1519],"disallowed"],[[1520,1524],"valid"],[[1525,1535],"disallowed"],[[1536,1539],"disallowed"],[[1540,1540],"disallowed"],[[1541,1541],"disallowed"],[[1542,1546],"valid",[],"NV8"],[[1547,1547],"valid",[],"NV8"],[[1548,1548],"valid",[],"NV8"],[[1549,1551],"valid",[],"NV8"],[[1552,1557],"valid"],[[1558,1562],"valid"],[[1563,1563],"valid",[],"NV8"],[[1564,1564],"disallowed"],[[1565,1565],"disallowed"],[[1566,1566],"valid",[],"NV8"],[[1567,1567],"valid",[],"NV8"],[[1568,1568],"valid"],[[1569,1594],"valid"],[[1595,1599],"valid"],[[1600,1600],"valid",[],"NV8"],[[1601,1618],"valid"],[[1619,1621],"valid"],[[1622,1624],"valid"],[[1625,1630],"valid"],[[1631,1631],"valid"],[[1632,1641],"valid"],[[1642,1645],"valid",[],"NV8"],[[1646,1647],"valid"],[[1648,1652],"valid"],[[1653,1653],"mapped",[1575,1652]],[[1654,1654],"mapped",[1608,1652]],[[1655,1655],"mapped",[1735,1652]],[[1656,1656],"mapped",[1610,1652]],[[1657,1719],"valid"],[[1720,1721],"valid"],[[1722,1726],"valid"],[[1727,1727],"valid"],[[1728,1742],"valid"],[[1743,1743],"valid"],[[1744,1747],"valid"],[[1748,1748],"valid",[],"NV8"],[[1749,1756],"valid"],[[1757,1757],"disallowed"],[[1758,1758],"valid",[],"NV8"],[[1759,1768],"valid"],[[1769,1769],"valid",[],"NV8"],[[1770,1773],"valid"],[[1774,1775],"valid"],[[1776,1785],"valid"],[[1786,1790],"valid"],[[1791,1791],"valid"],[[1792,1805],"valid",[],"NV8"],[[1806,1806],"disallowed"],[[1807,1807],"disallowed"],[[1808,1836],"valid"],[[1837,1839],"valid"],[[1840,1866],"valid"],[[1867,1868],"disallowed"],[[1869,1871],"valid"],[[1872,1901],"valid"],[[1902,1919],"valid"],[[1920,1968],"valid"],[[1969,1969],"valid"],[[1970,1983],"disallowed"],[[1984,2037],"valid"],[[2038,2042],"valid",[],"NV8"],[[2043,2047],"disallowed"],[[2048,2093],"valid"],[[2094,2095],"disallowed"],[[2096,2110],"valid",[],"NV8"],[[2111,2111],"disallowed"],[[2112,2139],"valid"],[[2140,2141],"disallowed"],[[2142,2142],"valid",[],"NV8"],[[2143,2207],"disallowed"],[[2208,2208],"valid"],[[2209,2209],"valid"],[[2210,2220],"valid"],[[2221,2226],"valid"],[[2227,2228],"valid"],[[2229,2274],"disallowed"],[[2275,2275],"valid"],[[2276,2302],"valid"],[[2303,2303],"valid"],[[2304,2304],"valid"],[[2305,2307],"valid"],[[2308,2308],"valid"],[[2309,2361],"valid"],[[2362,2363],"valid"],[[2364,2381],"valid"],[[2382,2382],"valid"],[[2383,2383],"valid"],[[2384,2388],"valid"],[[2389,2389],"valid"],[[2390,2391],"valid"],[[2392,2392],"mapped",[2325,2364]],[[2393,2393],"mapped",[2326,2364]],[[2394,2394],"mapped",[2327,2364]],[[2395,2395],"mapped",[2332,2364]],[[2396,2396],"mapped",[2337,2364]],[[2397,2397],"mapped",[2338,2364]],[[2398,2398],"mapped",[2347,2364]],[[2399,2399],"mapped",[2351,2364]],[[2400,2403],"valid"],[[2404,2405],"valid",[],"NV8"],[[2406,2415],"valid"],[[2416,2416],"valid",[],"NV8"],[[2417,2418],"valid"],[[2419,2423],"valid"],[[2424,2424],"valid"],[[2425,2426],"valid"],[[2427,2428],"valid"],[[2429,2429],"valid"],[[2430,2431],"valid"],[[2432,2432],"valid"],[[2433,2435],"valid"],[[2436,2436],"disallowed"],[[2437,2444],"valid"],[[2445,2446],"disallowed"],[[2447,2448],"valid"],[[2449,2450],"disallowed"],[[2451,2472],"valid"],[[2473,2473],"disallowed"],[[2474,2480],"valid"],[[2481,2481],"disallowed"],[[2482,2482],"valid"],[[2483,2485],"disallowed"],[[2486,2489],"valid"],[[2490,2491],"disallowed"],[[2492,2492],"valid"],[[2493,2493],"valid"],[[2494,2500],"valid"],[[2501,2502],"disallowed"],[[2503,2504],"valid"],[[2505,2506],"disallowed"],[[2507,2509],"valid"],[[2510,2510],"valid"],[[2511,2518],"disallowed"],[[2519,2519],"valid"],[[2520,2523],"disallowed"],[[2524,2524],"mapped",[2465,2492]],[[2525,2525],"mapped",[2466,2492]],[[2526,2526],"disallowed"],[[2527,2527],"mapped",[2479,2492]],[[2528,2531],"valid"],[[2532,2533],"disallowed"],[[2534,2545],"valid"],[[2546,2554],"valid",[],"NV8"],[[2555,2555],"valid",[],"NV8"],[[2556,2560],"disallowed"],[[2561,2561],"valid"],[[2562,2562],"valid"],[[2563,2563],"valid"],[[2564,2564],"disallowed"],[[2565,2570],"valid"],[[2571,2574],"disallowed"],[[2575,2576],"valid"],[[2577,2578],"disallowed"],[[2579,2600],"valid"],[[2601,2601],"disallowed"],[[2602,2608],"valid"],[[2609,2609],"disallowed"],[[2610,2610],"valid"],[[2611,2611],"mapped",[2610,2620]],[[2612,2612],"disallowed"],[[2613,2613],"valid"],[[2614,2614],"mapped",[2616,2620]],[[2615,2615],"disallowed"],[[2616,2617],"valid"],[[2618,2619],"disallowed"],[[2620,2620],"valid"],[[2621,2621],"disallowed"],[[2622,2626],"valid"],[[2627,2630],"disallowed"],[[2631,2632],"valid"],[[2633,2634],"disallowed"],[[2635,2637],"valid"],[[2638,2640],"disallowed"],[[2641,2641],"valid"],[[2642,2648],"disallowed"],[[2649,2649],"mapped",[2582,2620]],[[2650,2650],"mapped",[2583,2620]],[[2651,2651],"mapped",[2588,2620]],[[2652,2652],"valid"],[[2653,2653],"disallowed"],[[2654,2654],"mapped",[2603,2620]],[[2655,2661],"disallowed"],[[2662,2676],"valid"],[[2677,2677],"valid"],[[2678,2688],"disallowed"],[[2689,2691],"valid"],[[2692,2692],"disallowed"],[[2693,2699],"valid"],[[2700,2700],"valid"],[[2701,2701],"valid"],[[2702,2702],"disallowed"],[[2703,2705],"valid"],[[2706,2706],"disallowed"],[[2707,2728],"valid"],[[2729,2729],"disallowed"],[[2730,2736],"valid"],[[2737,2737],"disallowed"],[[2738,2739],"valid"],[[2740,2740],"disallowed"],[[2741,2745],"valid"],[[2746,2747],"disallowed"],[[2748,2757],"valid"],[[2758,2758],"disallowed"],[[2759,2761],"valid"],[[2762,2762],"disallowed"],[[2763,2765],"valid"],[[2766,2767],"disallowed"],[[2768,2768],"valid"],[[2769,2783],"disallowed"],[[2784,2784],"valid"],[[2785,2787],"valid"],[[2788,2789],"disallowed"],[[2790,2799],"valid"],[[2800,2800],"valid",[],"NV8"],[[2801,2801],"valid",[],"NV8"],[[2802,2808],"disallowed"],[[2809,2809],"valid"],[[2810,2816],"disallowed"],[[2817,2819],"valid"],[[2820,2820],"disallowed"],[[2821,2828],"valid"],[[2829,2830],"disallowed"],[[2831,2832],"valid"],[[2833,2834],"disallowed"],[[2835,2856],"valid"],[[2857,2857],"disallowed"],[[2858,2864],"valid"],[[2865,2865],"disallowed"],[[2866,2867],"valid"],[[2868,2868],"disallowed"],[[2869,2869],"valid"],[[2870,2873],"valid"],[[2874,2875],"disallowed"],[[2876,2883],"valid"],[[2884,2884],"valid"],[[2885,2886],"disallowed"],[[2887,2888],"valid"],[[2889,2890],"disallowed"],[[2891,2893],"valid"],[[2894,2901],"disallowed"],[[2902,2903],"valid"],[[2904,2907],"disallowed"],[[2908,2908],"mapped",[2849,2876]],[[2909,2909],"mapped",[2850,2876]],[[2910,2910],"disallowed"],[[2911,2913],"valid"],[[2914,2915],"valid"],[[2916,2917],"disallowed"],[[2918,2927],"valid"],[[2928,2928],"valid",[],"NV8"],[[2929,2929],"valid"],[[2930,2935],"valid",[],"NV8"],[[2936,2945],"disallowed"],[[2946,2947],"valid"],[[2948,2948],"disallowed"],[[2949,2954],"valid"],[[2955,2957],"disallowed"],[[2958,2960],"valid"],[[2961,2961],"disallowed"],[[2962,2965],"valid"],[[2966,2968],"disallowed"],[[2969,2970],"valid"],[[2971,2971],"disallowed"],[[2972,2972],"valid"],[[2973,2973],"disallowed"],[[2974,2975],"valid"],[[2976,2978],"disallowed"],[[2979,2980],"valid"],[[2981,2983],"disallowed"],[[2984,2986],"valid"],[[2987,2989],"disallowed"],[[2990,2997],"valid"],[[2998,2998],"valid"],[[2999,3001],"valid"],[[3002,3005],"disallowed"],[[3006,3010],"valid"],[[3011,3013],"disallowed"],[[3014,3016],"valid"],[[3017,3017],"disallowed"],[[3018,3021],"valid"],[[3022,3023],"disallowed"],[[3024,3024],"valid"],[[3025,3030],"disallowed"],[[3031,3031],"valid"],[[3032,3045],"disallowed"],[[3046,3046],"valid"],[[3047,3055],"valid"],[[3056,3058],"valid",[],"NV8"],[[3059,3066],"valid",[],"NV8"],[[3067,3071],"disallowed"],[[3072,3072],"valid"],[[3073,3075],"valid"],[[3076,3076],"disallowed"],[[3077,3084],"valid"],[[3085,3085],"disallowed"],[[3086,3088],"valid"],[[3089,3089],"disallowed"],[[3090,3112],"valid"],[[3113,3113],"disallowed"],[[3114,3123],"valid"],[[3124,3124],"valid"],[[3125,3129],"valid"],[[3130,3132],"disallowed"],[[3133,3133],"valid"],[[3134,3140],"valid"],[[3141,3141],"disallowed"],[[3142,3144],"valid"],[[3145,3145],"disallowed"],[[3146,3149],"valid"],[[3150,3156],"disallowed"],[[3157,3158],"valid"],[[3159,3159],"disallowed"],[[3160,3161],"valid"],[[3162,3162],"valid"],[[3163,3167],"disallowed"],[[3168,3169],"valid"],[[3170,3171],"valid"],[[3172,3173],"disallowed"],[[3174,3183],"valid"],[[3184,3191],"disallowed"],[[3192,3199],"valid",[],"NV8"],[[3200,3200],"disallowed"],[[3201,3201],"valid"],[[3202,3203],"valid"],[[3204,3204],"disallowed"],[[3205,3212],"valid"],[[3213,3213],"disallowed"],[[3214,3216],"valid"],[[3217,3217],"disallowed"],[[3218,3240],"valid"],[[3241,3241],"disallowed"],[[3242,3251],"valid"],[[3252,3252],"disallowed"],[[3253,3257],"valid"],[[3258,3259],"disallowed"],[[3260,3261],"valid"],[[3262,3268],"valid"],[[3269,3269],"disallowed"],[[3270,3272],"valid"],[[3273,3273],"disallowed"],[[3274,3277],"valid"],[[3278,3284],"disallowed"],[[3285,3286],"valid"],[[3287,3293],"disallowed"],[[3294,3294],"valid"],[[3295,3295],"disallowed"],[[3296,3297],"valid"],[[3298,3299],"valid"],[[3300,3301],"disallowed"],[[3302,3311],"valid"],[[3312,3312],"disallowed"],[[3313,3314],"valid"],[[3315,3328],"disallowed"],[[3329,3329],"valid"],[[3330,3331],"valid"],[[3332,3332],"disallowed"],[[3333,3340],"valid"],[[3341,3341],"disallowed"],[[3342,3344],"valid"],[[3345,3345],"disallowed"],[[3346,3368],"valid"],[[3369,3369],"valid"],[[3370,3385],"valid"],[[3386,3386],"valid"],[[3387,3388],"disallowed"],[[3389,3389],"valid"],[[3390,3395],"valid"],[[3396,3396],"valid"],[[3397,3397],"disallowed"],[[3398,3400],"valid"],[[3401,3401],"disallowed"],[[3402,3405],"valid"],[[3406,3406],"valid"],[[3407,3414],"disallowed"],[[3415,3415],"valid"],[[3416,3422],"disallowed"],[[3423,3423],"valid"],[[3424,3425],"valid"],[[3426,3427],"valid"],[[3428,3429],"disallowed"],[[3430,3439],"valid"],[[3440,3445],"valid",[],"NV8"],[[3446,3448],"disallowed"],[[3449,3449],"valid",[],"NV8"],[[3450,3455],"valid"],[[3456,3457],"disallowed"],[[3458,3459],"valid"],[[3460,3460],"disallowed"],[[3461,3478],"valid"],[[3479,3481],"disallowed"],[[3482,3505],"valid"],[[3506,3506],"disallowed"],[[3507,3515],"valid"],[[3516,3516],"disallowed"],[[3517,3517],"valid"],[[3518,3519],"disallowed"],[[3520,3526],"valid"],[[3527,3529],"disallowed"],[[3530,3530],"valid"],[[3531,3534],"disallowed"],[[3535,3540],"valid"],[[3541,3541],"disallowed"],[[3542,3542],"valid"],[[3543,3543],"disallowed"],[[3544,3551],"valid"],[[3552,3557],"disallowed"],[[3558,3567],"valid"],[[3568,3569],"disallowed"],[[3570,3571],"valid"],[[3572,3572],"valid",[],"NV8"],[[3573,3584],"disallowed"],[[3585,3634],"valid"],[[3635,3635],"mapped",[3661,3634]],[[3636,3642],"valid"],[[3643,3646],"disallowed"],[[3647,3647],"valid",[],"NV8"],[[3648,3662],"valid"],[[3663,3663],"valid",[],"NV8"],[[3664,3673],"valid"],[[3674,3675],"valid",[],"NV8"],[[3676,3712],"disallowed"],[[3713,3714],"valid"],[[3715,3715],"disallowed"],[[3716,3716],"valid"],[[3717,3718],"disallowed"],[[3719,3720],"valid"],[[3721,3721],"disallowed"],[[3722,3722],"valid"],[[3723,3724],"disallowed"],[[3725,3725],"valid"],[[3726,3731],"disallowed"],[[3732,3735],"valid"],[[3736,3736],"disallowed"],[[3737,3743],"valid"],[[3744,3744],"disallowed"],[[3745,3747],"valid"],[[3748,3748],"disallowed"],[[3749,3749],"valid"],[[3750,3750],"disallowed"],[[3751,3751],"valid"],[[3752,3753],"disallowed"],[[3754,3755],"valid"],[[3756,3756],"disallowed"],[[3757,3762],"valid"],[[3763,3763],"mapped",[3789,3762]],[[3764,3769],"valid"],[[3770,3770],"disallowed"],[[3771,3773],"valid"],[[3774,3775],"disallowed"],[[3776,3780],"valid"],[[3781,3781],"disallowed"],[[3782,3782],"valid"],[[3783,3783],"disallowed"],[[3784,3789],"valid"],[[3790,3791],"disallowed"],[[3792,3801],"valid"],[[3802,3803],"disallowed"],[[3804,3804],"mapped",[3755,3737]],[[3805,3805],"mapped",[3755,3745]],[[3806,3807],"valid"],[[3808,3839],"disallowed"],[[3840,3840],"valid"],[[3841,3850],"valid",[],"NV8"],[[3851,3851],"valid"],[[3852,3852],"mapped",[3851]],[[3853,3863],"valid",[],"NV8"],[[3864,3865],"valid"],[[3866,3871],"valid",[],"NV8"],[[3872,3881],"valid"],[[3882,3892],"valid",[],"NV8"],[[3893,3893],"valid"],[[3894,3894],"valid",[],"NV8"],[[3895,3895],"valid"],[[3896,3896],"valid",[],"NV8"],[[3897,3897],"valid"],[[3898,3901],"valid",[],"NV8"],[[3902,3906],"valid"],[[3907,3907],"mapped",[3906,4023]],[[3908,3911],"valid"],[[3912,3912],"disallowed"],[[3913,3916],"valid"],[[3917,3917],"mapped",[3916,4023]],[[3918,3921],"valid"],[[3922,3922],"mapped",[3921,4023]],[[3923,3926],"valid"],[[3927,3927],"mapped",[3926,4023]],[[3928,3931],"valid"],[[3932,3932],"mapped",[3931,4023]],[[3933,3944],"valid"],[[3945,3945],"mapped",[3904,4021]],[[3946,3946],"valid"],[[3947,3948],"valid"],[[3949,3952],"disallowed"],[[3953,3954],"valid"],[[3955,3955],"mapped",[3953,3954]],[[3956,3956],"valid"],[[3957,3957],"mapped",[3953,3956]],[[3958,3958],"mapped",[4018,3968]],[[3959,3959],"mapped",[4018,3953,3968]],[[3960,3960],"mapped",[4019,3968]],[[3961,3961],"mapped",[4019,3953,3968]],[[3962,3968],"valid"],[[3969,3969],"mapped",[3953,3968]],[[3970,3972],"valid"],[[3973,3973],"valid",[],"NV8"],[[3974,3979],"valid"],[[3980,3983],"valid"],[[3984,3986],"valid"],[[3987,3987],"mapped",[3986,4023]],[[3988,3989],"valid"],[[3990,3990],"valid"],[[3991,3991],"valid"],[[3992,3992],"disallowed"],[[3993,3996],"valid"],[[3997,3997],"mapped",[3996,4023]],[[3998,4001],"valid"],[[4002,4002],"mapped",[4001,4023]],[[4003,4006],"valid"],[[4007,4007],"mapped",[4006,4023]],[[4008,4011],"valid"],[[4012,4012],"mapped",[4011,4023]],[[4013,4013],"valid"],[[4014,4016],"valid"],[[4017,4023],"valid"],[[4024,4024],"valid"],[[4025,4025],"mapped",[3984,4021]],[[4026,4028],"valid"],[[4029,4029],"disallowed"],[[4030,4037],"valid",[],"NV8"],[[4038,4038],"valid"],[[4039,4044],"valid",[],"NV8"],[[4045,4045],"disallowed"],[[4046,4046],"valid",[],"NV8"],[[4047,4047],"valid",[],"NV8"],[[4048,4049],"valid",[],"NV8"],[[4050,4052],"valid",[],"NV8"],[[4053,4056],"valid",[],"NV8"],[[4057,4058],"valid",[],"NV8"],[[4059,4095],"disallowed"],[[4096,4129],"valid"],[[4130,4130],"valid"],[[4131,4135],"valid"],[[4136,4136],"valid"],[[4137,4138],"valid"],[[4139,4139],"valid"],[[4140,4146],"valid"],[[4147,4149],"valid"],[[4150,4153],"valid"],[[4154,4159],"valid"],[[4160,4169],"valid"],[[4170,4175],"valid",[],"NV8"],[[4176,4185],"valid"],[[4186,4249],"valid"],[[4250,4253],"valid"],[[4254,4255],"valid",[],"NV8"],[[4256,4293],"disallowed"],[[4294,4294],"disallowed"],[[4295,4295],"mapped",[11559]],[[4296,4300],"disallowed"],[[4301,4301],"mapped",[11565]],[[4302,4303],"disallowed"],[[4304,4342],"valid"],[[4343,4344],"valid"],[[4345,4346],"valid"],[[4347,4347],"valid",[],"NV8"],[[4348,4348],"mapped",[4316]],[[4349,4351],"valid"],[[4352,4441],"valid",[],"NV8"],[[4442,4446],"valid",[],"NV8"],[[4447,4448],"disallowed"],[[4449,4514],"valid",[],"NV8"],[[4515,4519],"valid",[],"NV8"],[[4520,4601],"valid",[],"NV8"],[[4602,4607],"valid",[],"NV8"],[[4608,4614],"valid"],[[4615,4615],"valid"],[[4616,4678],"valid"],[[4679,4679],"valid"],[[4680,4680],"valid"],[[4681,4681],"disallowed"],[[4682,4685],"valid"],[[4686,4687],"disallowed"],[[4688,4694],"valid"],[[4695,4695],"disallowed"],[[4696,4696],"valid"],[[4697,4697],"disallowed"],[[4698,4701],"valid"],[[4702,4703],"disallowed"],[[4704,4742],"valid"],[[4743,4743],"valid"],[[4744,4744],"valid"],[[4745,4745],"disallowed"],[[4746,4749],"valid"],[[4750,4751],"disallowed"],[[4752,4782],"valid"],[[4783,4783],"valid"],[[4784,4784],"valid"],[[4785,4785],"disallowed"],[[4786,4789],"valid"],[[4790,4791],"disallowed"],[[4792,4798],"valid"],[[4799,4799],"disallowed"],[[4800,4800],"valid"],[[4801,4801],"disallowed"],[[4802,4805],"valid"],[[4806,4807],"disallowed"],[[4808,4814],"valid"],[[4815,4815],"valid"],[[4816,4822],"valid"],[[4823,4823],"disallowed"],[[4824,4846],"valid"],[[4847,4847],"valid"],[[4848,4878],"valid"],[[4879,4879],"valid"],[[4880,4880],"valid"],[[4881,4881],"disallowed"],[[4882,4885],"valid"],[[4886,4887],"disallowed"],[[4888,4894],"valid"],[[4895,4895],"valid"],[[4896,4934],"valid"],[[4935,4935],"valid"],[[4936,4954],"valid"],[[4955,4956],"disallowed"],[[4957,4958],"valid"],[[4959,4959],"valid"],[[4960,4960],"valid",[],"NV8"],[[4961,4988],"valid",[],"NV8"],[[4989,4991],"disallowed"],[[4992,5007],"valid"],[[5008,5017],"valid",[],"NV8"],[[5018,5023],"disallowed"],[[5024,5108],"valid"],[[5109,5109],"valid"],[[5110,5111],"disallowed"],[[5112,5112],"mapped",[5104]],[[5113,5113],"mapped",[5105]],[[5114,5114],"mapped",[5106]],[[5115,5115],"mapped",[5107]],[[5116,5116],"mapped",[5108]],[[5117,5117],"mapped",[5109]],[[5118,5119],"disallowed"],[[5120,5120],"valid",[],"NV8"],[[5121,5740],"valid"],[[5741,5742],"valid",[],"NV8"],[[5743,5750],"valid"],[[5751,5759],"valid"],[[5760,5760],"disallowed"],[[5761,5786],"valid"],[[5787,5788],"valid",[],"NV8"],[[5789,5791],"disallowed"],[[5792,5866],"valid"],[[5867,5872],"valid",[],"NV8"],[[5873,5880],"valid"],[[5881,5887],"disallowed"],[[5888,5900],"valid"],[[5901,5901],"disallowed"],[[5902,5908],"valid"],[[5909,5919],"disallowed"],[[5920,5940],"valid"],[[5941,5942],"valid",[],"NV8"],[[5943,5951],"disallowed"],[[5952,5971],"valid"],[[5972,5983],"disallowed"],[[5984,5996],"valid"],[[5997,5997],"disallowed"],[[5998,6000],"valid"],[[6001,6001],"disallowed"],[[6002,6003],"valid"],[[6004,6015],"disallowed"],[[6016,6067],"valid"],[[6068,6069],"disallowed"],[[6070,6099],"valid"],[[6100,6102],"valid",[],"NV8"],[[6103,6103],"valid"],[[6104,6107],"valid",[],"NV8"],[[6108,6108],"valid"],[[6109,6109],"valid"],[[6110,6111],"disallowed"],[[6112,6121],"valid"],[[6122,6127],"disallowed"],[[6128,6137],"valid",[],"NV8"],[[6138,6143],"disallowed"],[[6144,6149],"valid",[],"NV8"],[[6150,6150],"disallowed"],[[6151,6154],"valid",[],"NV8"],[[6155,6157],"ignored"],[[6158,6158],"disallowed"],[[6159,6159],"disallowed"],[[6160,6169],"valid"],[[6170,6175],"disallowed"],[[6176,6263],"valid"],[[6264,6271],"disallowed"],[[6272,6313],"valid"],[[6314,6314],"valid"],[[6315,6319],"disallowed"],[[6320,6389],"valid"],[[6390,6399],"disallowed"],[[6400,6428],"valid"],[[6429,6430],"valid"],[[6431,6431],"disallowed"],[[6432,6443],"valid"],[[6444,6447],"disallowed"],[[6448,6459],"valid"],[[6460,6463],"disallowed"],[[6464,6464],"valid",[],"NV8"],[[6465,6467],"disallowed"],[[6468,6469],"valid",[],"NV8"],[[6470,6509],"valid"],[[6510,6511],"disallowed"],[[6512,6516],"valid"],[[6517,6527],"disallowed"],[[6528,6569],"valid"],[[6570,6571],"valid"],[[6572,6575],"disallowed"],[[6576,6601],"valid"],[[6602,6607],"disallowed"],[[6608,6617],"valid"],[[6618,6618],"valid",[],"XV8"],[[6619,6621],"disallowed"],[[6622,6623],"valid",[],"NV8"],[[6624,6655],"valid",[],"NV8"],[[6656,6683],"valid"],[[6684,6685],"disallowed"],[[6686,6687],"valid",[],"NV8"],[[6688,6750],"valid"],[[6751,6751],"disallowed"],[[6752,6780],"valid"],[[6781,6782],"disallowed"],[[6783,6793],"valid"],[[6794,6799],"disallowed"],[[6800,6809],"valid"],[[6810,6815],"disallowed"],[[6816,6822],"valid",[],"NV8"],[[6823,6823],"valid"],[[6824,6829],"valid",[],"NV8"],[[6830,6831],"disallowed"],[[6832,6845],"valid"],[[6846,6846],"valid",[],"NV8"],[[6847,6911],"disallowed"],[[6912,6987],"valid"],[[6988,6991],"disallowed"],[[6992,7001],"valid"],[[7002,7018],"valid",[],"NV8"],[[7019,7027],"valid"],[[7028,7036],"valid",[],"NV8"],[[7037,7039],"disallowed"],[[7040,7082],"valid"],[[7083,7085],"valid"],[[7086,7097],"valid"],[[7098,7103],"valid"],[[7104,7155],"valid"],[[7156,7163],"disallowed"],[[7164,7167],"valid",[],"NV8"],[[7168,7223],"valid"],[[7224,7226],"disallowed"],[[7227,7231],"valid",[],"NV8"],[[7232,7241],"valid"],[[7242,7244],"disallowed"],[[7245,7293],"valid"],[[7294,7295],"valid",[],"NV8"],[[7296,7359],"disallowed"],[[7360,7367],"valid",[],"NV8"],[[7368,7375],"disallowed"],[[7376,7378],"valid"],[[7379,7379],"valid",[],"NV8"],[[7380,7410],"valid"],[[7411,7414],"valid"],[[7415,7415],"disallowed"],[[7416,7417],"valid"],[[7418,7423],"disallowed"],[[7424,7467],"valid"],[[7468,7468],"mapped",[97]],[[7469,7469],"mapped",[230]],[[7470,7470],"mapped",[98]],[[7471,7471],"valid"],[[7472,7472],"mapped",[100]],[[7473,7473],"mapped",[101]],[[7474,7474],"mapped",[477]],[[7475,7475],"mapped",[103]],[[7476,7476],"mapped",[104]],[[7477,7477],"mapped",[105]],[[7478,7478],"mapped",[106]],[[7479,7479],"mapped",[107]],[[7480,7480],"mapped",[108]],[[7481,7481],"mapped",[109]],[[7482,7482],"mapped",[110]],[[7483,7483],"valid"],[[7484,7484],"mapped",[111]],[[7485,7485],"mapped",[547]],[[7486,7486],"mapped",[112]],[[7487,7487],"mapped",[114]],[[7488,7488],"mapped",[116]],[[7489,7489],"mapped",[117]],[[7490,7490],"mapped",[119]],[[7491,7491],"mapped",[97]],[[7492,7492],"mapped",[592]],[[7493,7493],"mapped",[593]],[[7494,7494],"mapped",[7426]],[[7495,7495],"mapped",[98]],[[7496,7496],"mapped",[100]],[[7497,7497],"mapped",[101]],[[7498,7498],"mapped",[601]],[[7499,7499],"mapped",[603]],[[7500,7500],"mapped",[604]],[[7501,7501],"mapped",[103]],[[7502,7502],"valid"],[[7503,7503],"mapped",[107]],[[7504,7504],"mapped",[109]],[[7505,7505],"mapped",[331]],[[7506,7506],"mapped",[111]],[[7507,7507],"mapped",[596]],[[7508,7508],"mapped",[7446]],[[7509,7509],"mapped",[7447]],[[7510,7510],"mapped",[112]],[[7511,7511],"mapped",[116]],[[7512,7512],"mapped",[117]],[[7513,7513],"mapped",[7453]],[[7514,7514],"mapped",[623]],[[7515,7515],"mapped",[118]],[[7516,7516],"mapped",[7461]],[[7517,7517],"mapped",[946]],[[7518,7518],"mapped",[947]],[[7519,7519],"mapped",[948]],[[7520,7520],"mapped",[966]],[[7521,7521],"mapped",[967]],[[7522,7522],"mapped",[105]],[[7523,7523],"mapped",[114]],[[7524,7524],"mapped",[117]],[[7525,7525],"mapped",[118]],[[7526,7526],"mapped",[946]],[[7527,7527],"mapped",[947]],[[7528,7528],"mapped",[961]],[[7529,7529],"mapped",[966]],[[7530,7530],"mapped",[967]],[[7531,7531],"valid"],[[7532,7543],"valid"],[[7544,7544],"mapped",[1085]],[[7545,7578],"valid"],[[7579,7579],"mapped",[594]],[[7580,7580],"mapped",[99]],[[7581,7581],"mapped",[597]],[[7582,7582],"mapped",[240]],[[7583,7583],"mapped",[604]],[[7584,7584],"mapped",[102]],[[7585,7585],"mapped",[607]],[[7586,7586],"mapped",[609]],[[7587,7587],"mapped",[613]],[[7588,7588],"mapped",[616]],[[7589,7589],"mapped",[617]],[[7590,7590],"mapped",[618]],[[7591,7591],"mapped",[7547]],[[7592,7592],"mapped",[669]],[[7593,7593],"mapped",[621]],[[7594,7594],"mapped",[7557]],[[7595,7595],"mapped",[671]],[[7596,7596],"mapped",[625]],[[7597,7597],"mapped",[624]],[[7598,7598],"mapped",[626]],[[7599,7599],"mapped",[627]],[[7600,7600],"mapped",[628]],[[7601,7601],"mapped",[629]],[[7602,7602],"mapped",[632]],[[7603,7603],"mapped",[642]],[[7604,7604],"mapped",[643]],[[7605,7605],"mapped",[427]],[[7606,7606],"mapped",[649]],[[7607,7607],"mapped",[650]],[[7608,7608],"mapped",[7452]],[[7609,7609],"mapped",[651]],[[7610,7610],"mapped",[652]],[[7611,7611],"mapped",[122]],[[7612,7612],"mapped",[656]],[[7613,7613],"mapped",[657]],[[7614,7614],"mapped",[658]],[[7615,7615],"mapped",[952]],[[7616,7619],"valid"],[[7620,7626],"valid"],[[7627,7654],"valid"],[[7655,7669],"valid"],[[7670,7675],"disallowed"],[[7676,7676],"valid"],[[7677,7677],"valid"],[[7678,7679],"valid"],[[7680,7680],"mapped",[7681]],[[7681,7681],"valid"],[[7682,7682],"mapped",[7683]],[[7683,7683],"valid"],[[7684,7684],"mapped",[7685]],[[7685,7685],"valid"],[[7686,7686],"mapped",[7687]],[[7687,7687],"valid"],[[7688,7688],"mapped",[7689]],[[7689,7689],"valid"],[[7690,7690],"mapped",[7691]],[[7691,7691],"valid"],[[7692,7692],"mapped",[7693]],[[7693,7693],"valid"],[[7694,7694],"mapped",[7695]],[[7695,7695],"valid"],[[7696,7696],"mapped",[7697]],[[7697,7697],"valid"],[[7698,7698],"mapped",[7699]],[[7699,7699],"valid"],[[7700,7700],"mapped",[7701]],[[7701,7701],"valid"],[[7702,7702],"mapped",[7703]],[[7703,7703],"valid"],[[7704,7704],"mapped",[7705]],[[7705,7705],"valid"],[[7706,7706],"mapped",[7707]],[[7707,7707],"valid"],[[7708,7708],"mapped",[7709]],[[7709,7709],"valid"],[[7710,7710],"mapped",[7711]],[[7711,7711],"valid"],[[7712,7712],"mapped",[7713]],[[7713,7713],"valid"],[[7714,7714],"mapped",[7715]],[[7715,7715],"valid"],[[7716,7716],"mapped",[7717]],[[7717,7717],"valid"],[[7718,7718],"mapped",[7719]],[[7719,7719],"valid"],[[7720,7720],"mapped",[7721]],[[7721,7721],"valid"],[[7722,7722],"mapped",[7723]],[[7723,7723],"valid"],[[7724,7724],"mapped",[7725]],[[7725,7725],"valid"],[[7726,7726],"mapped",[7727]],[[7727,7727],"valid"],[[7728,7728],"mapped",[7729]],[[7729,7729],"valid"],[[7730,7730],"mapped",[7731]],[[7731,7731],"valid"],[[7732,7732],"mapped",[7733]],[[7733,7733],"valid"],[[7734,7734],"mapped",[7735]],[[7735,7735],"valid"],[[7736,7736],"mapped",[7737]],[[7737,7737],"valid"],[[7738,7738],"mapped",[7739]],[[7739,7739],"valid"],[[7740,7740],"mapped",[7741]],[[7741,7741],"valid"],[[7742,7742],"mapped",[7743]],[[7743,7743],"valid"],[[7744,7744],"mapped",[7745]],[[7745,7745],"valid"],[[7746,7746],"mapped",[7747]],[[7747,7747],"valid"],[[7748,7748],"mapped",[7749]],[[7749,7749],"valid"],[[7750,7750],"mapped",[7751]],[[7751,7751],"valid"],[[7752,7752],"mapped",[7753]],[[7753,7753],"valid"],[[7754,7754],"mapped",[7755]],[[7755,7755],"valid"],[[7756,7756],"mapped",[7757]],[[7757,7757],"valid"],[[7758,7758],"mapped",[7759]],[[7759,7759],"valid"],[[7760,7760],"mapped",[7761]],[[7761,7761],"valid"],[[7762,7762],"mapped",[7763]],[[7763,7763],"valid"],[[7764,7764],"mapped",[7765]],[[7765,7765],"valid"],[[7766,7766],"mapped",[7767]],[[7767,7767],"valid"],[[7768,7768],"mapped",[7769]],[[7769,7769],"valid"],[[7770,7770],"mapped",[7771]],[[7771,7771],"valid"],[[7772,7772],"mapped",[7773]],[[7773,7773],"valid"],[[7774,7774],"mapped",[7775]],[[7775,7775],"valid"],[[7776,7776],"mapped",[7777]],[[7777,7777],"valid"],[[7778,7778],"mapped",[7779]],[[7779,7779],"valid"],[[7780,7780],"mapped",[7781]],[[7781,7781],"valid"],[[7782,7782],"mapped",[7783]],[[7783,7783],"valid"],[[7784,7784],"mapped",[7785]],[[7785,7785],"valid"],[[7786,7786],"mapped",[7787]],[[7787,7787],"valid"],[[7788,7788],"mapped",[7789]],[[7789,7789],"valid"],[[7790,7790],"mapped",[7791]],[[7791,7791],"valid"],[[7792,7792],"mapped",[7793]],[[7793,7793],"valid"],[[7794,7794],"mapped",[7795]],[[7795,7795],"valid"],[[7796,7796],"mapped",[7797]],[[7797,7797],"valid"],[[7798,7798],"mapped",[7799]],[[7799,7799],"valid"],[[7800,7800],"mapped",[7801]],[[7801,7801],"valid"],[[7802,7802],"mapped",[7803]],[[7803,7803],"valid"],[[7804,7804],"mapped",[7805]],[[7805,7805],"valid"],[[7806,7806],"mapped",[7807]],[[7807,7807],"valid"],[[7808,7808],"mapped",[7809]],[[7809,7809],"valid"],[[7810,7810],"mapped",[7811]],[[7811,7811],"valid"],[[7812,7812],"mapped",[7813]],[[7813,7813],"valid"],[[7814,7814],"mapped",[7815]],[[7815,7815],"valid"],[[7816,7816],"mapped",[7817]],[[7817,7817],"valid"],[[7818,7818],"mapped",[7819]],[[7819,7819],"valid"],[[7820,7820],"mapped",[7821]],[[7821,7821],"valid"],[[7822,7822],"mapped",[7823]],[[7823,7823],"valid"],[[7824,7824],"mapped",[7825]],[[7825,7825],"valid"],[[7826,7826],"mapped",[7827]],[[7827,7827],"valid"],[[7828,7828],"mapped",[7829]],[[7829,7833],"valid"],[[7834,7834],"mapped",[97,702]],[[7835,7835],"mapped",[7777]],[[7836,7837],"valid"],[[7838,7838],"mapped",[115,115]],[[7839,7839],"valid"],[[7840,7840],"mapped",[7841]],[[7841,7841],"valid"],[[7842,7842],"mapped",[7843]],[[7843,7843],"valid"],[[7844,7844],"mapped",[7845]],[[7845,7845],"valid"],[[7846,7846],"mapped",[7847]],[[7847,7847],"valid"],[[7848,7848],"mapped",[7849]],[[7849,7849],"valid"],[[7850,7850],"mapped",[7851]],[[7851,7851],"valid"],[[7852,7852],"mapped",[7853]],[[7853,7853],"valid"],[[7854,7854],"mapped",[7855]],[[7855,7855],"valid"],[[7856,7856],"mapped",[7857]],[[7857,7857],"valid"],[[7858,7858],"mapped",[7859]],[[7859,7859],"valid"],[[7860,7860],"mapped",[7861]],[[7861,7861],"valid"],[[7862,7862],"mapped",[7863]],[[7863,7863],"valid"],[[7864,7864],"mapped",[7865]],[[7865,7865],"valid"],[[7866,7866],"mapped",[7867]],[[7867,7867],"valid"],[[7868,7868],"mapped",[7869]],[[7869,7869],"valid"],[[7870,7870],"mapped",[7871]],[[7871,7871],"valid"],[[7872,7872],"mapped",[7873]],[[7873,7873],"valid"],[[7874,7874],"mapped",[7875]],[[7875,7875],"valid"],[[7876,7876],"mapped",[7877]],[[7877,7877],"valid"],[[7878,7878],"mapped",[7879]],[[7879,7879],"valid"],[[7880,7880],"mapped",[7881]],[[7881,7881],"valid"],[[7882,7882],"mapped",[7883]],[[7883,7883],"valid"],[[7884,7884],"mapped",[7885]],[[7885,7885],"valid"],[[7886,7886],"mapped",[7887]],[[7887,7887],"valid"],[[7888,7888],"mapped",[7889]],[[7889,7889],"valid"],[[7890,7890],"mapped",[7891]],[[7891,7891],"valid"],[[7892,7892],"mapped",[7893]],[[7893,7893],"valid"],[[7894,7894],"mapped",[7895]],[[7895,7895],"valid"],[[7896,7896],"mapped",[7897]],[[7897,7897],"valid"],[[7898,7898],"mapped",[7899]],[[7899,7899],"valid"],[[7900,7900],"mapped",[7901]],[[7901,7901],"valid"],[[7902,7902],"mapped",[7903]],[[7903,7903],"valid"],[[7904,7904],"mapped",[7905]],[[7905,7905],"valid"],[[7906,7906],"mapped",[7907]],[[7907,7907],"valid"],[[7908,7908],"mapped",[7909]],[[7909,7909],"valid"],[[7910,7910],"mapped",[7911]],[[7911,7911],"valid"],[[7912,7912],"mapped",[7913]],[[7913,7913],"valid"],[[7914,7914],"mapped",[7915]],[[7915,7915],"valid"],[[7916,7916],"mapped",[7917]],[[7917,7917],"valid"],[[7918,7918],"mapped",[7919]],[[7919,7919],"valid"],[[7920,7920],"mapped",[7921]],[[7921,7921],"valid"],[[7922,7922],"mapped",[7923]],[[7923,7923],"valid"],[[7924,7924],"mapped",[7925]],[[7925,7925],"valid"],[[7926,7926],"mapped",[7927]],[[7927,7927],"valid"],[[7928,7928],"mapped",[7929]],[[7929,7929],"valid"],[[7930,7930],"mapped",[7931]],[[7931,7931],"valid"],[[7932,7932],"mapped",[7933]],[[7933,7933],"valid"],[[7934,7934],"mapped",[7935]],[[7935,7935],"valid"],[[7936,7943],"valid"],[[7944,7944],"mapped",[7936]],[[7945,7945],"mapped",[7937]],[[7946,7946],"mapped",[7938]],[[7947,7947],"mapped",[7939]],[[7948,7948],"mapped",[7940]],[[7949,7949],"mapped",[7941]],[[7950,7950],"mapped",[7942]],[[7951,7951],"mapped",[7943]],[[7952,7957],"valid"],[[7958,7959],"disallowed"],[[7960,7960],"mapped",[7952]],[[7961,7961],"mapped",[7953]],[[7962,7962],"mapped",[7954]],[[7963,7963],"mapped",[7955]],[[7964,7964],"mapped",[7956]],[[7965,7965],"mapped",[7957]],[[7966,7967],"disallowed"],[[7968,7975],"valid"],[[7976,7976],"mapped",[7968]],[[7977,7977],"mapped",[7969]],[[7978,7978],"mapped",[7970]],[[7979,7979],"mapped",[7971]],[[7980,7980],"mapped",[7972]],[[7981,7981],"mapped",[7973]],[[7982,7982],"mapped",[7974]],[[7983,7983],"mapped",[7975]],[[7984,7991],"valid"],[[7992,7992],"mapped",[7984]],[[7993,7993],"mapped",[7985]],[[7994,7994],"mapped",[7986]],[[7995,7995],"mapped",[7987]],[[7996,7996],"mapped",[7988]],[[7997,7997],"mapped",[7989]],[[7998,7998],"mapped",[7990]],[[7999,7999],"mapped",[7991]],[[8000,8005],"valid"],[[8006,8007],"disallowed"],[[8008,8008],"mapped",[8000]],[[8009,8009],"mapped",[8001]],[[8010,8010],"mapped",[8002]],[[8011,8011],"mapped",[8003]],[[8012,8012],"mapped",[8004]],[[8013,8013],"mapped",[8005]],[[8014,8015],"disallowed"],[[8016,8023],"valid"],[[8024,8024],"disallowed"],[[8025,8025],"mapped",[8017]],[[8026,8026],"disallowed"],[[8027,8027],"mapped",[8019]],[[8028,8028],"disallowed"],[[8029,8029],"mapped",[8021]],[[8030,8030],"disallowed"],[[8031,8031],"mapped",[8023]],[[8032,8039],"valid"],[[8040,8040],"mapped",[8032]],[[8041,8041],"mapped",[8033]],[[8042,8042],"mapped",[8034]],[[8043,8043],"mapped",[8035]],[[8044,8044],"mapped",[8036]],[[8045,8045],"mapped",[8037]],[[8046,8046],"mapped",[8038]],[[8047,8047],"mapped",[8039]],[[8048,8048],"valid"],[[8049,8049],"mapped",[940]],[[8050,8050],"valid"],[[8051,8051],"mapped",[941]],[[8052,8052],"valid"],[[8053,8053],"mapped",[942]],[[8054,8054],"valid"],[[8055,8055],"mapped",[943]],[[8056,8056],"valid"],[[8057,8057],"mapped",[972]],[[8058,8058],"valid"],[[8059,8059],"mapped",[973]],[[8060,8060],"valid"],[[8061,8061],"mapped",[974]],[[8062,8063],"disallowed"],[[8064,8064],"mapped",[7936,953]],[[8065,8065],"mapped",[7937,953]],[[8066,8066],"mapped",[7938,953]],[[8067,8067],"mapped",[7939,953]],[[8068,8068],"mapped",[7940,953]],[[8069,8069],"mapped",[7941,953]],[[8070,8070],"mapped",[7942,953]],[[8071,8071],"mapped",[7943,953]],[[8072,8072],"mapped",[7936,953]],[[8073,8073],"mapped",[7937,953]],[[8074,8074],"mapped",[7938,953]],[[8075,8075],"mapped",[7939,953]],[[8076,8076],"mapped",[7940,953]],[[8077,8077],"mapped",[7941,953]],[[8078,8078],"mapped",[7942,953]],[[8079,8079],"mapped",[7943,953]],[[8080,8080],"mapped",[7968,953]],[[8081,8081],"mapped",[7969,953]],[[8082,8082],"mapped",[7970,953]],[[8083,8083],"mapped",[7971,953]],[[8084,8084],"mapped",[7972,953]],[[8085,8085],"mapped",[7973,953]],[[8086,8086],"mapped",[7974,953]],[[8087,8087],"mapped",[7975,953]],[[8088,8088],"mapped",[7968,953]],[[8089,8089],"mapped",[7969,953]],[[8090,8090],"mapped",[7970,953]],[[8091,8091],"mapped",[7971,953]],[[8092,8092],"mapped",[7972,953]],[[8093,8093],"mapped",[7973,953]],[[8094,8094],"mapped",[7974,953]],[[8095,8095],"mapped",[7975,953]],[[8096,8096],"mapped",[8032,953]],[[8097,8097],"mapped",[8033,953]],[[8098,8098],"mapped",[8034,953]],[[8099,8099],"mapped",[8035,953]],[[8100,8100],"mapped",[8036,953]],[[8101,8101],"mapped",[8037,953]],[[8102,8102],"mapped",[8038,953]],[[8103,8103],"mapped",[8039,953]],[[8104,8104],"mapped",[8032,953]],[[8105,8105],"mapped",[8033,953]],[[8106,8106],"mapped",[8034,953]],[[8107,8107],"mapped",[8035,953]],[[8108,8108],"mapped",[8036,953]],[[8109,8109],"mapped",[8037,953]],[[8110,8110],"mapped",[8038,953]],[[8111,8111],"mapped",[8039,953]],[[8112,8113],"valid"],[[8114,8114],"mapped",[8048,953]],[[8115,8115],"mapped",[945,953]],[[8116,8116],"mapped",[940,953]],[[8117,8117],"disallowed"],[[8118,8118],"valid"],[[8119,8119],"mapped",[8118,953]],[[8120,8120],"mapped",[8112]],[[8121,8121],"mapped",[8113]],[[8122,8122],"mapped",[8048]],[[8123,8123],"mapped",[940]],[[8124,8124],"mapped",[945,953]],[[8125,8125],"disallowed_STD3_mapped",[32,787]],[[8126,8126],"mapped",[953]],[[8127,8127],"disallowed_STD3_mapped",[32,787]],[[8128,8128],"disallowed_STD3_mapped",[32,834]],[[8129,8129],"disallowed_STD3_mapped",[32,776,834]],[[8130,8130],"mapped",[8052,953]],[[8131,8131],"mapped",[951,953]],[[8132,8132],"mapped",[942,953]],[[8133,8133],"disallowed"],[[8134,8134],"valid"],[[8135,8135],"mapped",[8134,953]],[[8136,8136],"mapped",[8050]],[[8137,8137],"mapped",[941]],[[8138,8138],"mapped",[8052]],[[8139,8139],"mapped",[942]],[[8140,8140],"mapped",[951,953]],[[8141,8141],"disallowed_STD3_mapped",[32,787,768]],[[8142,8142],"disallowed_STD3_mapped",[32,787,769]],[[8143,8143],"disallowed_STD3_mapped",[32,787,834]],[[8144,8146],"valid"],[[8147,8147],"mapped",[912]],[[8148,8149],"disallowed"],[[8150,8151],"valid"],[[8152,8152],"mapped",[8144]],[[8153,8153],"mapped",[8145]],[[8154,8154],"mapped",[8054]],[[8155,8155],"mapped",[943]],[[8156,8156],"disallowed"],[[8157,8157],"disallowed_STD3_mapped",[32,788,768]],[[8158,8158],"disallowed_STD3_mapped",[32,788,769]],[[8159,8159],"disallowed_STD3_mapped",[32,788,834]],[[8160,8162],"valid"],[[8163,8163],"mapped",[944]],[[8164,8167],"valid"],[[8168,8168],"mapped",[8160]],[[8169,8169],"mapped",[8161]],[[8170,8170],"mapped",[8058]],[[8171,8171],"mapped",[973]],[[8172,8172],"mapped",[8165]],[[8173,8173],"disallowed_STD3_mapped",[32,776,768]],[[8174,8174],"disallowed_STD3_mapped",[32,776,769]],[[8175,8175],"disallowed_STD3_mapped",[96]],[[8176,8177],"disallowed"],[[8178,8178],"mapped",[8060,953]],[[8179,8179],"mapped",[969,953]],[[8180,8180],"mapped",[974,953]],[[8181,8181],"disallowed"],[[8182,8182],"valid"],[[8183,8183],"mapped",[8182,953]],[[8184,8184],"mapped",[8056]],[[8185,8185],"mapped",[972]],[[8186,8186],"mapped",[8060]],[[8187,8187],"mapped",[974]],[[8188,8188],"mapped",[969,953]],[[8189,8189],"disallowed_STD3_mapped",[32,769]],[[8190,8190],"disallowed_STD3_mapped",[32,788]],[[8191,8191],"disallowed"],[[8192,8202],"disallowed_STD3_mapped",[32]],[[8203,8203],"ignored"],[[8204,8205],"deviation",[]],[[8206,8207],"disallowed"],[[8208,8208],"valid",[],"NV8"],[[8209,8209],"mapped",[8208]],[[8210,8214],"valid",[],"NV8"],[[8215,8215],"disallowed_STD3_mapped",[32,819]],[[8216,8227],"valid",[],"NV8"],[[8228,8230],"disallowed"],[[8231,8231],"valid",[],"NV8"],[[8232,8238],"disallowed"],[[8239,8239],"disallowed_STD3_mapped",[32]],[[8240,8242],"valid",[],"NV8"],[[8243,8243],"mapped",[8242,8242]],[[8244,8244],"mapped",[8242,8242,8242]],[[8245,8245],"valid",[],"NV8"],[[8246,8246],"mapped",[8245,8245]],[[8247,8247],"mapped",[8245,8245,8245]],[[8248,8251],"valid",[],"NV8"],[[8252,8252],"disallowed_STD3_mapped",[33,33]],[[8253,8253],"valid",[],"NV8"],[[8254,8254],"disallowed_STD3_mapped",[32,773]],[[8255,8262],"valid",[],"NV8"],[[8263,8263],"disallowed_STD3_mapped",[63,63]],[[8264,8264],"disallowed_STD3_mapped",[63,33]],[[8265,8265],"disallowed_STD3_mapped",[33,63]],[[8266,8269],"valid",[],"NV8"],[[8270,8274],"valid",[],"NV8"],[[8275,8276],"valid",[],"NV8"],[[8277,8278],"valid",[],"NV8"],[[8279,8279],"mapped",[8242,8242,8242,8242]],[[8280,8286],"valid",[],"NV8"],[[8287,8287],"disallowed_STD3_mapped",[32]],[[8288,8288],"ignored"],[[8289,8291],"disallowed"],[[8292,8292],"ignored"],[[8293,8293],"disallowed"],[[8294,8297],"disallowed"],[[8298,8303],"disallowed"],[[8304,8304],"mapped",[48]],[[8305,8305],"mapped",[105]],[[8306,8307],"disallowed"],[[8308,8308],"mapped",[52]],[[8309,8309],"mapped",[53]],[[8310,8310],"mapped",[54]],[[8311,8311],"mapped",[55]],[[8312,8312],"mapped",[56]],[[8313,8313],"mapped",[57]],[[8314,8314],"disallowed_STD3_mapped",[43]],[[8315,8315],"mapped",[8722]],[[8316,8316],"disallowed_STD3_mapped",[61]],[[8317,8317],"disallowed_STD3_mapped",[40]],[[8318,8318],"disallowed_STD3_mapped",[41]],[[8319,8319],"mapped",[110]],[[8320,8320],"mapped",[48]],[[8321,8321],"mapped",[49]],[[8322,8322],"mapped",[50]],[[8323,8323],"mapped",[51]],[[8324,8324],"mapped",[52]],[[8325,8325],"mapped",[53]],[[8326,8326],"mapped",[54]],[[8327,8327],"mapped",[55]],[[8328,8328],"mapped",[56]],[[8329,8329],"mapped",[57]],[[8330,8330],"disallowed_STD3_mapped",[43]],[[8331,8331],"mapped",[8722]],[[8332,8332],"disallowed_STD3_mapped",[61]],[[8333,8333],"disallowed_STD3_mapped",[40]],[[8334,8334],"disallowed_STD3_mapped",[41]],[[8335,8335],"disallowed"],[[8336,8336],"mapped",[97]],[[8337,8337],"mapped",[101]],[[8338,8338],"mapped",[111]],[[8339,8339],"mapped",[120]],[[8340,8340],"mapped",[601]],[[8341,8341],"mapped",[104]],[[8342,8342],"mapped",[107]],[[8343,8343],"mapped",[108]],[[8344,8344],"mapped",[109]],[[8345,8345],"mapped",[110]],[[8346,8346],"mapped",[112]],[[8347,8347],"mapped",[115]],[[8348,8348],"mapped",[116]],[[8349,8351],"disallowed"],[[8352,8359],"valid",[],"NV8"],[[8360,8360],"mapped",[114,115]],[[8361,8362],"valid",[],"NV8"],[[8363,8363],"valid",[],"NV8"],[[8364,8364],"valid",[],"NV8"],[[8365,8367],"valid",[],"NV8"],[[8368,8369],"valid",[],"NV8"],[[8370,8373],"valid",[],"NV8"],[[8374,8376],"valid",[],"NV8"],[[8377,8377],"valid",[],"NV8"],[[8378,8378],"valid",[],"NV8"],[[8379,8381],"valid",[],"NV8"],[[8382,8382],"valid",[],"NV8"],[[8383,8399],"disallowed"],[[8400,8417],"valid",[],"NV8"],[[8418,8419],"valid",[],"NV8"],[[8420,8426],"valid",[],"NV8"],[[8427,8427],"valid",[],"NV8"],[[8428,8431],"valid",[],"NV8"],[[8432,8432],"valid",[],"NV8"],[[8433,8447],"disallowed"],[[8448,8448],"disallowed_STD3_mapped",[97,47,99]],[[8449,8449],"disallowed_STD3_mapped",[97,47,115]],[[8450,8450],"mapped",[99]],[[8451,8451],"mapped",[176,99]],[[8452,8452],"valid",[],"NV8"],[[8453,8453],"disallowed_STD3_mapped",[99,47,111]],[[8454,8454],"disallowed_STD3_mapped",[99,47,117]],[[8455,8455],"mapped",[603]],[[8456,8456],"valid",[],"NV8"],[[8457,8457],"mapped",[176,102]],[[8458,8458],"mapped",[103]],[[8459,8462],"mapped",[104]],[[8463,8463],"mapped",[295]],[[8464,8465],"mapped",[105]],[[8466,8467],"mapped",[108]],[[8468,8468],"valid",[],"NV8"],[[8469,8469],"mapped",[110]],[[8470,8470],"mapped",[110,111]],[[8471,8472],"valid",[],"NV8"],[[8473,8473],"mapped",[112]],[[8474,8474],"mapped",[113]],[[8475,8477],"mapped",[114]],[[8478,8479],"valid",[],"NV8"],[[8480,8480],"mapped",[115,109]],[[8481,8481],"mapped",[116,101,108]],[[8482,8482],"mapped",[116,109]],[[8483,8483],"valid",[],"NV8"],[[8484,8484],"mapped",[122]],[[8485,8485],"valid",[],"NV8"],[[8486,8486],"mapped",[969]],[[8487,8487],"valid",[],"NV8"],[[8488,8488],"mapped",[122]],[[8489,8489],"valid",[],"NV8"],[[8490,8490],"mapped",[107]],[[8491,8491],"mapped",[229]],[[8492,8492],"mapped",[98]],[[8493,8493],"mapped",[99]],[[8494,8494],"valid",[],"NV8"],[[8495,8496],"mapped",[101]],[[8497,8497],"mapped",[102]],[[8498,8498],"disallowed"],[[8499,8499],"mapped",[109]],[[8500,8500],"mapped",[111]],[[8501,8501],"mapped",[1488]],[[8502,8502],"mapped",[1489]],[[8503,8503],"mapped",[1490]],[[8504,8504],"mapped",[1491]],[[8505,8505],"mapped",[105]],[[8506,8506],"valid",[],"NV8"],[[8507,8507],"mapped",[102,97,120]],[[8508,8508],"mapped",[960]],[[8509,8510],"mapped",[947]],[[8511,8511],"mapped",[960]],[[8512,8512],"mapped",[8721]],[[8513,8516],"valid",[],"NV8"],[[8517,8518],"mapped",[100]],[[8519,8519],"mapped",[101]],[[8520,8520],"mapped",[105]],[[8521,8521],"mapped",[106]],[[8522,8523],"valid",[],"NV8"],[[8524,8524],"valid",[],"NV8"],[[8525,8525],"valid",[],"NV8"],[[8526,8526],"valid"],[[8527,8527],"valid",[],"NV8"],[[8528,8528],"mapped",[49,8260,55]],[[8529,8529],"mapped",[49,8260,57]],[[8530,8530],"mapped",[49,8260,49,48]],[[8531,8531],"mapped",[49,8260,51]],[[8532,8532],"mapped",[50,8260,51]],[[8533,8533],"mapped",[49,8260,53]],[[8534,8534],"mapped",[50,8260,53]],[[8535,8535],"mapped",[51,8260,53]],[[8536,8536],"mapped",[52,8260,53]],[[8537,8537],"mapped",[49,8260,54]],[[8538,8538],"mapped",[53,8260,54]],[[8539,8539],"mapped",[49,8260,56]],[[8540,8540],"mapped",[51,8260,56]],[[8541,8541],"mapped",[53,8260,56]],[[8542,8542],"mapped",[55,8260,56]],[[8543,8543],"mapped",[49,8260]],[[8544,8544],"mapped",[105]],[[8545,8545],"mapped",[105,105]],[[8546,8546],"mapped",[105,105,105]],[[8547,8547],"mapped",[105,118]],[[8548,8548],"mapped",[118]],[[8549,8549],"mapped",[118,105]],[[8550,8550],"mapped",[118,105,105]],[[8551,8551],"mapped",[118,105,105,105]],[[8552,8552],"mapped",[105,120]],[[8553,8553],"mapped",[120]],[[8554,8554],"mapped",[120,105]],[[8555,8555],"mapped",[120,105,105]],[[8556,8556],"mapped",[108]],[[8557,8557],"mapped",[99]],[[8558,8558],"mapped",[100]],[[8559,8559],"mapped",[109]],[[8560,8560],"mapped",[105]],[[8561,8561],"mapped",[105,105]],[[8562,8562],"mapped",[105,105,105]],[[8563,8563],"mapped",[105,118]],[[8564,8564],"mapped",[118]],[[8565,8565],"mapped",[118,105]],[[8566,8566],"mapped",[118,105,105]],[[8567,8567],"mapped",[118,105,105,105]],[[8568,8568],"mapped",[105,120]],[[8569,8569],"mapped",[120]],[[8570,8570],"mapped",[120,105]],[[8571,8571],"mapped",[120,105,105]],[[8572,8572],"mapped",[108]],[[8573,8573],"mapped",[99]],[[8574,8574],"mapped",[100]],[[8575,8575],"mapped",[109]],[[8576,8578],"valid",[],"NV8"],[[8579,8579],"disallowed"],[[8580,8580],"valid"],[[8581,8584],"valid",[],"NV8"],[[8585,8585],"mapped",[48,8260,51]],[[8586,8587],"valid",[],"NV8"],[[8588,8591],"disallowed"],[[8592,8682],"valid",[],"NV8"],[[8683,8691],"valid",[],"NV8"],[[8692,8703],"valid",[],"NV8"],[[8704,8747],"valid",[],"NV8"],[[8748,8748],"mapped",[8747,8747]],[[8749,8749],"mapped",[8747,8747,8747]],[[8750,8750],"valid",[],"NV8"],[[8751,8751],"mapped",[8750,8750]],[[8752,8752],"mapped",[8750,8750,8750]],[[8753,8799],"valid",[],"NV8"],[[8800,8800],"disallowed_STD3_valid"],[[8801,8813],"valid",[],"NV8"],[[8814,8815],"disallowed_STD3_valid"],[[8816,8945],"valid",[],"NV8"],[[8946,8959],"valid",[],"NV8"],[[8960,8960],"valid",[],"NV8"],[[8961,8961],"valid",[],"NV8"],[[8962,9000],"valid",[],"NV8"],[[9001,9001],"mapped",[12296]],[[9002,9002],"mapped",[12297]],[[9003,9082],"valid",[],"NV8"],[[9083,9083],"valid",[],"NV8"],[[9084,9084],"valid",[],"NV8"],[[9085,9114],"valid",[],"NV8"],[[9115,9166],"valid",[],"NV8"],[[9167,9168],"valid",[],"NV8"],[[9169,9179],"valid",[],"NV8"],[[9180,9191],"valid",[],"NV8"],[[9192,9192],"valid",[],"NV8"],[[9193,9203],"valid",[],"NV8"],[[9204,9210],"valid",[],"NV8"],[[9211,9215],"disallowed"],[[9216,9252],"valid",[],"NV8"],[[9253,9254],"valid",[],"NV8"],[[9255,9279],"disallowed"],[[9280,9290],"valid",[],"NV8"],[[9291,9311],"disallowed"],[[9312,9312],"mapped",[49]],[[9313,9313],"mapped",[50]],[[9314,9314],"mapped",[51]],[[9315,9315],"mapped",[52]],[[9316,9316],"mapped",[53]],[[9317,9317],"mapped",[54]],[[9318,9318],"mapped",[55]],[[9319,9319],"mapped",[56]],[[9320,9320],"mapped",[57]],[[9321,9321],"mapped",[49,48]],[[9322,9322],"mapped",[49,49]],[[9323,9323],"mapped",[49,50]],[[9324,9324],"mapped",[49,51]],[[9325,9325],"mapped",[49,52]],[[9326,9326],"mapped",[49,53]],[[9327,9327],"mapped",[49,54]],[[9328,9328],"mapped",[49,55]],[[9329,9329],"mapped",[49,56]],[[9330,9330],"mapped",[49,57]],[[9331,9331],"mapped",[50,48]],[[9332,9332],"disallowed_STD3_mapped",[40,49,41]],[[9333,9333],"disallowed_STD3_mapped",[40,50,41]],[[9334,9334],"disallowed_STD3_mapped",[40,51,41]],[[9335,9335],"disallowed_STD3_mapped",[40,52,41]],[[9336,9336],"disallowed_STD3_mapped",[40,53,41]],[[9337,9337],"disallowed_STD3_mapped",[40,54,41]],[[9338,9338],"disallowed_STD3_mapped",[40,55,41]],[[9339,9339],"disallowed_STD3_mapped",[40,56,41]],[[9340,9340],"disallowed_STD3_mapped",[40,57,41]],[[9341,9341],"disallowed_STD3_mapped",[40,49,48,41]],[[9342,9342],"disallowed_STD3_mapped",[40,49,49,41]],[[9343,9343],"disallowed_STD3_mapped",[40,49,50,41]],[[9344,9344],"disallowed_STD3_mapped",[40,49,51,41]],[[9345,9345],"disallowed_STD3_mapped",[40,49,52,41]],[[9346,9346],"disallowed_STD3_mapped",[40,49,53,41]],[[9347,9347],"disallowed_STD3_mapped",[40,49,54,41]],[[9348,9348],"disallowed_STD3_mapped",[40,49,55,41]],[[9349,9349],"disallowed_STD3_mapped",[40,49,56,41]],[[9350,9350],"disallowed_STD3_mapped",[40,49,57,41]],[[9351,9351],"disallowed_STD3_mapped",[40,50,48,41]],[[9352,9371],"disallowed"],[[9372,9372],"disallowed_STD3_mapped",[40,97,41]],[[9373,9373],"disallowed_STD3_mapped",[40,98,41]],[[9374,9374],"disallowed_STD3_mapped",[40,99,41]],[[9375,9375],"disallowed_STD3_mapped",[40,100,41]],[[9376,9376],"disallowed_STD3_mapped",[40,101,41]],[[9377,9377],"disallowed_STD3_mapped",[40,102,41]],[[9378,9378],"disallowed_STD3_mapped",[40,103,41]],[[9379,9379],"disallowed_STD3_mapped",[40,104,41]],[[9380,9380],"disallowed_STD3_mapped",[40,105,41]],[[9381,9381],"disallowed_STD3_mapped",[40,106,41]],[[9382,9382],"disallowed_STD3_mapped",[40,107,41]],[[9383,9383],"disallowed_STD3_mapped",[40,108,41]],[[9384,9384],"disallowed_STD3_mapped",[40,109,41]],[[9385,9385],"disallowed_STD3_mapped",[40,110,41]],[[9386,9386],"disallowed_STD3_mapped",[40,111,41]],[[9387,9387],"disallowed_STD3_mapped",[40,112,41]],[[9388,9388],"disallowed_STD3_mapped",[40,113,41]],[[9389,9389],"disallowed_STD3_mapped",[40,114,41]],[[9390,9390],"disallowed_STD3_mapped",[40,115,41]],[[9391,9391],"disallowed_STD3_mapped",[40,116,41]],[[9392,9392],"disallowed_STD3_mapped",[40,117,41]],[[9393,9393],"disallowed_STD3_mapped",[40,118,41]],[[9394,9394],"disallowed_STD3_mapped",[40,119,41]],[[9395,9395],"disallowed_STD3_mapped",[40,120,41]],[[9396,9396],"disallowed_STD3_mapped",[40,121,41]],[[9397,9397],"disallowed_STD3_mapped",[40,122,41]],[[9398,9398],"mapped",[97]],[[9399,9399],"mapped",[98]],[[9400,9400],"mapped",[99]],[[9401,9401],"mapped",[100]],[[9402,9402],"mapped",[101]],[[9403,9403],"mapped",[102]],[[9404,9404],"mapped",[103]],[[9405,9405],"mapped",[104]],[[9406,9406],"mapped",[105]],[[9407,9407],"mapped",[106]],[[9408,9408],"mapped",[107]],[[9409,9409],"mapped",[108]],[[9410,9410],"mapped",[109]],[[9411,9411],"mapped",[110]],[[9412,9412],"mapped",[111]],[[9413,9413],"mapped",[112]],[[9414,9414],"mapped",[113]],[[9415,9415],"mapped",[114]],[[9416,9416],"mapped",[115]],[[9417,9417],"mapped",[116]],[[9418,9418],"mapped",[117]],[[9419,9419],"mapped",[118]],[[9420,9420],"mapped",[119]],[[9421,9421],"mapped",[120]],[[9422,9422],"mapped",[121]],[[9423,9423],"mapped",[122]],[[9424,9424],"mapped",[97]],[[9425,9425],"mapped",[98]],[[9426,9426],"mapped",[99]],[[9427,9427],"mapped",[100]],[[9428,9428],"mapped",[101]],[[9429,9429],"mapped",[102]],[[9430,9430],"mapped",[103]],[[9431,9431],"mapped",[104]],[[9432,9432],"mapped",[105]],[[9433,9433],"mapped",[106]],[[9434,9434],"mapped",[107]],[[9435,9435],"mapped",[108]],[[9436,9436],"mapped",[109]],[[9437,9437],"mapped",[110]],[[9438,9438],"mapped",[111]],[[9439,9439],"mapped",[112]],[[9440,9440],"mapped",[113]],[[9441,9441],"mapped",[114]],[[9442,9442],"mapped",[115]],[[9443,9443],"mapped",[116]],[[9444,9444],"mapped",[117]],[[9445,9445],"mapped",[118]],[[9446,9446],"mapped",[119]],[[9447,9447],"mapped",[120]],[[9448,9448],"mapped",[121]],[[9449,9449],"mapped",[122]],[[9450,9450],"mapped",[48]],[[9451,9470],"valid",[],"NV8"],[[9471,9471],"valid",[],"NV8"],[[9472,9621],"valid",[],"NV8"],[[9622,9631],"valid",[],"NV8"],[[9632,9711],"valid",[],"NV8"],[[9712,9719],"valid",[],"NV8"],[[9720,9727],"valid",[],"NV8"],[[9728,9747],"valid",[],"NV8"],[[9748,9749],"valid",[],"NV8"],[[9750,9751],"valid",[],"NV8"],[[9752,9752],"valid",[],"NV8"],[[9753,9753],"valid",[],"NV8"],[[9754,9839],"valid",[],"NV8"],[[9840,9841],"valid",[],"NV8"],[[9842,9853],"valid",[],"NV8"],[[9854,9855],"valid",[],"NV8"],[[9856,9865],"valid",[],"NV8"],[[9866,9873],"valid",[],"NV8"],[[9874,9884],"valid",[],"NV8"],[[9885,9885],"valid",[],"NV8"],[[9886,9887],"valid",[],"NV8"],[[9888,9889],"valid",[],"NV8"],[[9890,9905],"valid",[],"NV8"],[[9906,9906],"valid",[],"NV8"],[[9907,9916],"valid",[],"NV8"],[[9917,9919],"valid",[],"NV8"],[[9920,9923],"valid",[],"NV8"],[[9924,9933],"valid",[],"NV8"],[[9934,9934],"valid",[],"NV8"],[[9935,9953],"valid",[],"NV8"],[[9954,9954],"valid",[],"NV8"],[[9955,9955],"valid",[],"NV8"],[[9956,9959],"valid",[],"NV8"],[[9960,9983],"valid",[],"NV8"],[[9984,9984],"valid",[],"NV8"],[[9985,9988],"valid",[],"NV8"],[[9989,9989],"valid",[],"NV8"],[[9990,9993],"valid",[],"NV8"],[[9994,9995],"valid",[],"NV8"],[[9996,10023],"valid",[],"NV8"],[[10024,10024],"valid",[],"NV8"],[[10025,10059],"valid",[],"NV8"],[[10060,10060],"valid",[],"NV8"],[[10061,10061],"valid",[],"NV8"],[[10062,10062],"valid",[],"NV8"],[[10063,10066],"valid",[],"NV8"],[[10067,10069],"valid",[],"NV8"],[[10070,10070],"valid",[],"NV8"],[[10071,10071],"valid",[],"NV8"],[[10072,10078],"valid",[],"NV8"],[[10079,10080],"valid",[],"NV8"],[[10081,10087],"valid",[],"NV8"],[[10088,10101],"valid",[],"NV8"],[[10102,10132],"valid",[],"NV8"],[[10133,10135],"valid",[],"NV8"],[[10136,10159],"valid",[],"NV8"],[[10160,10160],"valid",[],"NV8"],[[10161,10174],"valid",[],"NV8"],[[10175,10175],"valid",[],"NV8"],[[10176,10182],"valid",[],"NV8"],[[10183,10186],"valid",[],"NV8"],[[10187,10187],"valid",[],"NV8"],[[10188,10188],"valid",[],"NV8"],[[10189,10189],"valid",[],"NV8"],[[10190,10191],"valid",[],"NV8"],[[10192,10219],"valid",[],"NV8"],[[10220,10223],"valid",[],"NV8"],[[10224,10239],"valid",[],"NV8"],[[10240,10495],"valid",[],"NV8"],[[10496,10763],"valid",[],"NV8"],[[10764,10764],"mapped",[8747,8747,8747,8747]],[[10765,10867],"valid",[],"NV8"],[[10868,10868],"disallowed_STD3_mapped",[58,58,61]],[[10869,10869],"disallowed_STD3_mapped",[61,61]],[[10870,10870],"disallowed_STD3_mapped",[61,61,61]],[[10871,10971],"valid",[],"NV8"],[[10972,10972],"mapped",[10973,824]],[[10973,11007],"valid",[],"NV8"],[[11008,11021],"valid",[],"NV8"],[[11022,11027],"valid",[],"NV8"],[[11028,11034],"valid",[],"NV8"],[[11035,11039],"valid",[],"NV8"],[[11040,11043],"valid",[],"NV8"],[[11044,11084],"valid",[],"NV8"],[[11085,11087],"valid",[],"NV8"],[[11088,11092],"valid",[],"NV8"],[[11093,11097],"valid",[],"NV8"],[[11098,11123],"valid",[],"NV8"],[[11124,11125],"disallowed"],[[11126,11157],"valid",[],"NV8"],[[11158,11159],"disallowed"],[[11160,11193],"valid",[],"NV8"],[[11194,11196],"disallowed"],[[11197,11208],"valid",[],"NV8"],[[11209,11209],"disallowed"],[[11210,11217],"valid",[],"NV8"],[[11218,11243],"disallowed"],[[11244,11247],"valid",[],"NV8"],[[11248,11263],"disallowed"],[[11264,11264],"mapped",[11312]],[[11265,11265],"mapped",[11313]],[[11266,11266],"mapped",[11314]],[[11267,11267],"mapped",[11315]],[[11268,11268],"mapped",[11316]],[[11269,11269],"mapped",[11317]],[[11270,11270],"mapped",[11318]],[[11271,11271],"mapped",[11319]],[[11272,11272],"mapped",[11320]],[[11273,11273],"mapped",[11321]],[[11274,11274],"mapped",[11322]],[[11275,11275],"mapped",[11323]],[[11276,11276],"mapped",[11324]],[[11277,11277],"mapped",[11325]],[[11278,11278],"mapped",[11326]],[[11279,11279],"mapped",[11327]],[[11280,11280],"mapped",[11328]],[[11281,11281],"mapped",[11329]],[[11282,11282],"mapped",[11330]],[[11283,11283],"mapped",[11331]],[[11284,11284],"mapped",[11332]],[[11285,11285],"mapped",[11333]],[[11286,11286],"mapped",[11334]],[[11287,11287],"mapped",[11335]],[[11288,11288],"mapped",[11336]],[[11289,11289],"mapped",[11337]],[[11290,11290],"mapped",[11338]],[[11291,11291],"mapped",[11339]],[[11292,11292],"mapped",[11340]],[[11293,11293],"mapped",[11341]],[[11294,11294],"mapped",[11342]],[[11295,11295],"mapped",[11343]],[[11296,11296],"mapped",[11344]],[[11297,11297],"mapped",[11345]],[[11298,11298],"mapped",[11346]],[[11299,11299],"mapped",[11347]],[[11300,11300],"mapped",[11348]],[[11301,11301],"mapped",[11349]],[[11302,11302],"mapped",[11350]],[[11303,11303],"mapped",[11351]],[[11304,11304],"mapped",[11352]],[[11305,11305],"mapped",[11353]],[[11306,11306],"mapped",[11354]],[[11307,11307],"mapped",[11355]],[[11308,11308],"mapped",[11356]],[[11309,11309],"mapped",[11357]],[[11310,11310],"mapped",[11358]],[[11311,11311],"disallowed"],[[11312,11358],"valid"],[[11359,11359],"disallowed"],[[11360,11360],"mapped",[11361]],[[11361,11361],"valid"],[[11362,11362],"mapped",[619]],[[11363,11363],"mapped",[7549]],[[11364,11364],"mapped",[637]],[[11365,11366],"valid"],[[11367,11367],"mapped",[11368]],[[11368,11368],"valid"],[[11369,11369],"mapped",[11370]],[[11370,11370],"valid"],[[11371,11371],"mapped",[11372]],[[11372,11372],"valid"],[[11373,11373],"mapped",[593]],[[11374,11374],"mapped",[625]],[[11375,11375],"mapped",[592]],[[11376,11376],"mapped",[594]],[[11377,11377],"valid"],[[11378,11378],"mapped",[11379]],[[11379,11379],"valid"],[[11380,11380],"valid"],[[11381,11381],"mapped",[11382]],[[11382,11383],"valid"],[[11384,11387],"valid"],[[11388,11388],"mapped",[106]],[[11389,11389],"mapped",[118]],[[11390,11390],"mapped",[575]],[[11391,11391],"mapped",[576]],[[11392,11392],"mapped",[11393]],[[11393,11393],"valid"],[[11394,11394],"mapped",[11395]],[[11395,11395],"valid"],[[11396,11396],"mapped",[11397]],[[11397,11397],"valid"],[[11398,11398],"mapped",[11399]],[[11399,11399],"valid"],[[11400,11400],"mapped",[11401]],[[11401,11401],"valid"],[[11402,11402],"mapped",[11403]],[[11403,11403],"valid"],[[11404,11404],"mapped",[11405]],[[11405,11405],"valid"],[[11406,11406],"mapped",[11407]],[[11407,11407],"valid"],[[11408,11408],"mapped",[11409]],[[11409,11409],"valid"],[[11410,11410],"mapped",[11411]],[[11411,11411],"valid"],[[11412,11412],"mapped",[11413]],[[11413,11413],"valid"],[[11414,11414],"mapped",[11415]],[[11415,11415],"valid"],[[11416,11416],"mapped",[11417]],[[11417,11417],"valid"],[[11418,11418],"mapped",[11419]],[[11419,11419],"valid"],[[11420,11420],"mapped",[11421]],[[11421,11421],"valid"],[[11422,11422],"mapped",[11423]],[[11423,11423],"valid"],[[11424,11424],"mapped",[11425]],[[11425,11425],"valid"],[[11426,11426],"mapped",[11427]],[[11427,11427],"valid"],[[11428,11428],"mapped",[11429]],[[11429,11429],"valid"],[[11430,11430],"mapped",[11431]],[[11431,11431],"valid"],[[11432,11432],"mapped",[11433]],[[11433,11433],"valid"],[[11434,11434],"mapped",[11435]],[[11435,11435],"valid"],[[11436,11436],"mapped",[11437]],[[11437,11437],"valid"],[[11438,11438],"mapped",[11439]],[[11439,11439],"valid"],[[11440,11440],"mapped",[11441]],[[11441,11441],"valid"],[[11442,11442],"mapped",[11443]],[[11443,11443],"valid"],[[11444,11444],"mapped",[11445]],[[11445,11445],"valid"],[[11446,11446],"mapped",[11447]],[[11447,11447],"valid"],[[11448,11448],"mapped",[11449]],[[11449,11449],"valid"],[[11450,11450],"mapped",[11451]],[[11451,11451],"valid"],[[11452,11452],"mapped",[11453]],[[11453,11453],"valid"],[[11454,11454],"mapped",[11455]],[[11455,11455],"valid"],[[11456,11456],"mapped",[11457]],[[11457,11457],"valid"],[[11458,11458],"mapped",[11459]],[[11459,11459],"valid"],[[11460,11460],"mapped",[11461]],[[11461,11461],"valid"],[[11462,11462],"mapped",[11463]],[[11463,11463],"valid"],[[11464,11464],"mapped",[11465]],[[11465,11465],"valid"],[[11466,11466],"mapped",[11467]],[[11467,11467],"valid"],[[11468,11468],"mapped",[11469]],[[11469,11469],"valid"],[[11470,11470],"mapped",[11471]],[[11471,11471],"valid"],[[11472,11472],"mapped",[11473]],[[11473,11473],"valid"],[[11474,11474],"mapped",[11475]],[[11475,11475],"valid"],[[11476,11476],"mapped",[11477]],[[11477,11477],"valid"],[[11478,11478],"mapped",[11479]],[[11479,11479],"valid"],[[11480,11480],"mapped",[11481]],[[11481,11481],"valid"],[[11482,11482],"mapped",[11483]],[[11483,11483],"valid"],[[11484,11484],"mapped",[11485]],[[11485,11485],"valid"],[[11486,11486],"mapped",[11487]],[[11487,11487],"valid"],[[11488,11488],"mapped",[11489]],[[11489,11489],"valid"],[[11490,11490],"mapped",[11491]],[[11491,11492],"valid"],[[11493,11498],"valid",[],"NV8"],[[11499,11499],"mapped",[11500]],[[11500,11500],"valid"],[[11501,11501],"mapped",[11502]],[[11502,11505],"valid"],[[11506,11506],"mapped",[11507]],[[11507,11507],"valid"],[[11508,11512],"disallowed"],[[11513,11519],"valid",[],"NV8"],[[11520,11557],"valid"],[[11558,11558],"disallowed"],[[11559,11559],"valid"],[[11560,11564],"disallowed"],[[11565,11565],"valid"],[[11566,11567],"disallowed"],[[11568,11621],"valid"],[[11622,11623],"valid"],[[11624,11630],"disallowed"],[[11631,11631],"mapped",[11617]],[[11632,11632],"valid",[],"NV8"],[[11633,11646],"disallowed"],[[11647,11647],"valid"],[[11648,11670],"valid"],[[11671,11679],"disallowed"],[[11680,11686],"valid"],[[11687,11687],"disallowed"],[[11688,11694],"valid"],[[11695,11695],"disallowed"],[[11696,11702],"valid"],[[11703,11703],"disallowed"],[[11704,11710],"valid"],[[11711,11711],"disallowed"],[[11712,11718],"valid"],[[11719,11719],"disallowed"],[[11720,11726],"valid"],[[11727,11727],"disallowed"],[[11728,11734],"valid"],[[11735,11735],"disallowed"],[[11736,11742],"valid"],[[11743,11743],"disallowed"],[[11744,11775],"valid"],[[11776,11799],"valid",[],"NV8"],[[11800,11803],"valid",[],"NV8"],[[11804,11805],"valid",[],"NV8"],[[11806,11822],"valid",[],"NV8"],[[11823,11823],"valid"],[[11824,11824],"valid",[],"NV8"],[[11825,11825],"valid",[],"NV8"],[[11826,11835],"valid",[],"NV8"],[[11836,11842],"valid",[],"NV8"],[[11843,11903],"disallowed"],[[11904,11929],"valid",[],"NV8"],[[11930,11930],"disallowed"],[[11931,11934],"valid",[],"NV8"],[[11935,11935],"mapped",[27597]],[[11936,12018],"valid",[],"NV8"],[[12019,12019],"mapped",[40863]],[[12020,12031],"disallowed"],[[12032,12032],"mapped",[19968]],[[12033,12033],"mapped",[20008]],[[12034,12034],"mapped",[20022]],[[12035,12035],"mapped",[20031]],[[12036,12036],"mapped",[20057]],[[12037,12037],"mapped",[20101]],[[12038,12038],"mapped",[20108]],[[12039,12039],"mapped",[20128]],[[12040,12040],"mapped",[20154]],[[12041,12041],"mapped",[20799]],[[12042,12042],"mapped",[20837]],[[12043,12043],"mapped",[20843]],[[12044,12044],"mapped",[20866]],[[12045,12045],"mapped",[20886]],[[12046,12046],"mapped",[20907]],[[12047,12047],"mapped",[20960]],[[12048,12048],"mapped",[20981]],[[12049,12049],"mapped",[20992]],[[12050,12050],"mapped",[21147]],[[12051,12051],"mapped",[21241]],[[12052,12052],"mapped",[21269]],[[12053,12053],"mapped",[21274]],[[12054,12054],"mapped",[21304]],[[12055,12055],"mapped",[21313]],[[12056,12056],"mapped",[21340]],[[12057,12057],"mapped",[21353]],[[12058,12058],"mapped",[21378]],[[12059,12059],"mapped",[21430]],[[12060,12060],"mapped",[21448]],[[12061,12061],"mapped",[21475]],[[12062,12062],"mapped",[22231]],[[12063,12063],"mapped",[22303]],[[12064,12064],"mapped",[22763]],[[12065,12065],"mapped",[22786]],[[12066,12066],"mapped",[22794]],[[12067,12067],"mapped",[22805]],[[12068,12068],"mapped",[22823]],[[12069,12069],"mapped",[22899]],[[12070,12070],"mapped",[23376]],[[12071,12071],"mapped",[23424]],[[12072,12072],"mapped",[23544]],[[12073,12073],"mapped",[23567]],[[12074,12074],"mapped",[23586]],[[12075,12075],"mapped",[23608]],[[12076,12076],"mapped",[23662]],[[12077,12077],"mapped",[23665]],[[12078,12078],"mapped",[24027]],[[12079,12079],"mapped",[24037]],[[12080,12080],"mapped",[24049]],[[12081,12081],"mapped",[24062]],[[12082,12082],"mapped",[24178]],[[12083,12083],"mapped",[24186]],[[12084,12084],"mapped",[24191]],[[12085,12085],"mapped",[24308]],[[12086,12086],"mapped",[24318]],[[12087,12087],"mapped",[24331]],[[12088,12088],"mapped",[24339]],[[12089,12089],"mapped",[24400]],[[12090,12090],"mapped",[24417]],[[12091,12091],"mapped",[24435]],[[12092,12092],"mapped",[24515]],[[12093,12093],"mapped",[25096]],[[12094,12094],"mapped",[25142]],[[12095,12095],"mapped",[25163]],[[12096,12096],"mapped",[25903]],[[12097,12097],"mapped",[25908]],[[12098,12098],"mapped",[25991]],[[12099,12099],"mapped",[26007]],[[12100,12100],"mapped",[26020]],[[12101,12101],"mapped",[26041]],[[12102,12102],"mapped",[26080]],[[12103,12103],"mapped",[26085]],[[12104,12104],"mapped",[26352]],[[12105,12105],"mapped",[26376]],[[12106,12106],"mapped",[26408]],[[12107,12107],"mapped",[27424]],[[12108,12108],"mapped",[27490]],[[12109,12109],"mapped",[27513]],[[12110,12110],"mapped",[27571]],[[12111,12111],"mapped",[27595]],[[12112,12112],"mapped",[27604]],[[12113,12113],"mapped",[27611]],[[12114,12114],"mapped",[27663]],[[12115,12115],"mapped",[27668]],[[12116,12116],"mapped",[27700]],[[12117,12117],"mapped",[28779]],[[12118,12118],"mapped",[29226]],[[12119,12119],"mapped",[29238]],[[12120,12120],"mapped",[29243]],[[12121,12121],"mapped",[29247]],[[12122,12122],"mapped",[29255]],[[12123,12123],"mapped",[29273]],[[12124,12124],"mapped",[29275]],[[12125,12125],"mapped",[29356]],[[12126,12126],"mapped",[29572]],[[12127,12127],"mapped",[29577]],[[12128,12128],"mapped",[29916]],[[12129,12129],"mapped",[29926]],[[12130,12130],"mapped",[29976]],[[12131,12131],"mapped",[29983]],[[12132,12132],"mapped",[29992]],[[12133,12133],"mapped",[30000]],[[12134,12134],"mapped",[30091]],[[12135,12135],"mapped",[30098]],[[12136,12136],"mapped",[30326]],[[12137,12137],"mapped",[30333]],[[12138,12138],"mapped",[30382]],[[12139,12139],"mapped",[30399]],[[12140,12140],"mapped",[30446]],[[12141,12141],"mapped",[30683]],[[12142,12142],"mapped",[30690]],[[12143,12143],"mapped",[30707]],[[12144,12144],"mapped",[31034]],[[12145,12145],"mapped",[31160]],[[12146,12146],"mapped",[31166]],[[12147,12147],"mapped",[31348]],[[12148,12148],"mapped",[31435]],[[12149,12149],"mapped",[31481]],[[12150,12150],"mapped",[31859]],[[12151,12151],"mapped",[31992]],[[12152,12152],"mapped",[32566]],[[12153,12153],"mapped",[32593]],[[12154,12154],"mapped",[32650]],[[12155,12155],"mapped",[32701]],[[12156,12156],"mapped",[32769]],[[12157,12157],"mapped",[32780]],[[12158,12158],"mapped",[32786]],[[12159,12159],"mapped",[32819]],[[12160,12160],"mapped",[32895]],[[12161,12161],"mapped",[32905]],[[12162,12162],"mapped",[33251]],[[12163,12163],"mapped",[33258]],[[12164,12164],"mapped",[33267]],[[12165,12165],"mapped",[33276]],[[12166,12166],"mapped",[33292]],[[12167,12167],"mapped",[33307]],[[12168,12168],"mapped",[33311]],[[12169,12169],"mapped",[33390]],[[12170,12170],"mapped",[33394]],[[12171,12171],"mapped",[33400]],[[12172,12172],"mapped",[34381]],[[12173,12173],"mapped",[34411]],[[12174,12174],"mapped",[34880]],[[12175,12175],"mapped",[34892]],[[12176,12176],"mapped",[34915]],[[12177,12177],"mapped",[35198]],[[12178,12178],"mapped",[35211]],[[12179,12179],"mapped",[35282]],[[12180,12180],"mapped",[35328]],[[12181,12181],"mapped",[35895]],[[12182,12182],"mapped",[35910]],[[12183,12183],"mapped",[35925]],[[12184,12184],"mapped",[35960]],[[12185,12185],"mapped",[35997]],[[12186,12186],"mapped",[36196]],[[12187,12187],"mapped",[36208]],[[12188,12188],"mapped",[36275]],[[12189,12189],"mapped",[36523]],[[12190,12190],"mapped",[36554]],[[12191,12191],"mapped",[36763]],[[12192,12192],"mapped",[36784]],[[12193,12193],"mapped",[36789]],[[12194,12194],"mapped",[37009]],[[12195,12195],"mapped",[37193]],[[12196,12196],"mapped",[37318]],[[12197,12197],"mapped",[37324]],[[12198,12198],"mapped",[37329]],[[12199,12199],"mapped",[38263]],[[12200,12200],"mapped",[38272]],[[12201,12201],"mapped",[38428]],[[12202,12202],"mapped",[38582]],[[12203,12203],"mapped",[38585]],[[12204,12204],"mapped",[38632]],[[12205,12205],"mapped",[38737]],[[12206,12206],"mapped",[38750]],[[12207,12207],"mapped",[38754]],[[12208,12208],"mapped",[38761]],[[12209,12209],"mapped",[38859]],[[12210,12210],"mapped",[38893]],[[12211,12211],"mapped",[38899]],[[12212,12212],"mapped",[38913]],[[12213,12213],"mapped",[39080]],[[12214,12214],"mapped",[39131]],[[12215,12215],"mapped",[39135]],[[12216,12216],"mapped",[39318]],[[12217,12217],"mapped",[39321]],[[12218,12218],"mapped",[39340]],[[12219,12219],"mapped",[39592]],[[12220,12220],"mapped",[39640]],[[12221,12221],"mapped",[39647]],[[12222,12222],"mapped",[39717]],[[12223,12223],"mapped",[39727]],[[12224,12224],"mapped",[39730]],[[12225,12225],"mapped",[39740]],[[12226,12226],"mapped",[39770]],[[12227,12227],"mapped",[40165]],[[12228,12228],"mapped",[40565]],[[12229,12229],"mapped",[40575]],[[12230,12230],"mapped",[40613]],[[12231,12231],"mapped",[40635]],[[12232,12232],"mapped",[40643]],[[12233,12233],"mapped",[40653]],[[12234,12234],"mapped",[40657]],[[12235,12235],"mapped",[40697]],[[12236,12236],"mapped",[40701]],[[12237,12237],"mapped",[40718]],[[12238,12238],"mapped",[40723]],[[12239,12239],"mapped",[40736]],[[12240,12240],"mapped",[40763]],[[12241,12241],"mapped",[40778]],[[12242,12242],"mapped",[40786]],[[12243,12243],"mapped",[40845]],[[12244,12244],"mapped",[40860]],[[12245,12245],"mapped",[40864]],[[12246,12271],"disallowed"],[[12272,12283],"disallowed"],[[12284,12287],"disallowed"],[[12288,12288],"disallowed_STD3_mapped",[32]],[[12289,12289],"valid",[],"NV8"],[[12290,12290],"mapped",[46]],[[12291,12292],"valid",[],"NV8"],[[12293,12295],"valid"],[[12296,12329],"valid",[],"NV8"],[[12330,12333],"valid"],[[12334,12341],"valid",[],"NV8"],[[12342,12342],"mapped",[12306]],[[12343,12343],"valid",[],"NV8"],[[12344,12344],"mapped",[21313]],[[12345,12345],"mapped",[21316]],[[12346,12346],"mapped",[21317]],[[12347,12347],"valid",[],"NV8"],[[12348,12348],"valid"],[[12349,12349],"valid",[],"NV8"],[[12350,12350],"valid",[],"NV8"],[[12351,12351],"valid",[],"NV8"],[[12352,12352],"disallowed"],[[12353,12436],"valid"],[[12437,12438],"valid"],[[12439,12440],"disallowed"],[[12441,12442],"valid"],[[12443,12443],"disallowed_STD3_mapped",[32,12441]],[[12444,12444],"disallowed_STD3_mapped",[32,12442]],[[12445,12446],"valid"],[[12447,12447],"mapped",[12424,12426]],[[12448,12448],"valid",[],"NV8"],[[12449,12542],"valid"],[[12543,12543],"mapped",[12467,12488]],[[12544,12548],"disallowed"],[[12549,12588],"valid"],[[12589,12589],"valid"],[[12590,12592],"disallowed"],[[12593,12593],"mapped",[4352]],[[12594,12594],"mapped",[4353]],[[12595,12595],"mapped",[4522]],[[12596,12596],"mapped",[4354]],[[12597,12597],"mapped",[4524]],[[12598,12598],"mapped",[4525]],[[12599,12599],"mapped",[4355]],[[12600,12600],"mapped",[4356]],[[12601,12601],"mapped",[4357]],[[12602,12602],"mapped",[4528]],[[12603,12603],"mapped",[4529]],[[12604,12604],"mapped",[4530]],[[12605,12605],"mapped",[4531]],[[12606,12606],"mapped",[4532]],[[12607,12607],"mapped",[4533]],[[12608,12608],"mapped",[4378]],[[12609,12609],"mapped",[4358]],[[12610,12610],"mapped",[4359]],[[12611,12611],"mapped",[4360]],[[12612,12612],"mapped",[4385]],[[12613,12613],"mapped",[4361]],[[12614,12614],"mapped",[4362]],[[12615,12615],"mapped",[4363]],[[12616,12616],"mapped",[4364]],[[12617,12617],"mapped",[4365]],[[12618,12618],"mapped",[4366]],[[12619,12619],"mapped",[4367]],[[12620,12620],"mapped",[4368]],[[12621,12621],"mapped",[4369]],[[12622,12622],"mapped",[4370]],[[12623,12623],"mapped",[4449]],[[12624,12624],"mapped",[4450]],[[12625,12625],"mapped",[4451]],[[12626,12626],"mapped",[4452]],[[12627,12627],"mapped",[4453]],[[12628,12628],"mapped",[4454]],[[12629,12629],"mapped",[4455]],[[12630,12630],"mapped",[4456]],[[12631,12631],"mapped",[4457]],[[12632,12632],"mapped",[4458]],[[12633,12633],"mapped",[4459]],[[12634,12634],"mapped",[4460]],[[12635,12635],"mapped",[4461]],[[12636,12636],"mapped",[4462]],[[12637,12637],"mapped",[4463]],[[12638,12638],"mapped",[4464]],[[12639,12639],"mapped",[4465]],[[12640,12640],"mapped",[4466]],[[12641,12641],"mapped",[4467]],[[12642,12642],"mapped",[4468]],[[12643,12643],"mapped",[4469]],[[12644,12644],"disallowed"],[[12645,12645],"mapped",[4372]],[[12646,12646],"mapped",[4373]],[[12647,12647],"mapped",[4551]],[[12648,12648],"mapped",[4552]],[[12649,12649],"mapped",[4556]],[[12650,12650],"mapped",[4558]],[[12651,12651],"mapped",[4563]],[[12652,12652],"mapped",[4567]],[[12653,12653],"mapped",[4569]],[[12654,12654],"mapped",[4380]],[[12655,12655],"mapped",[4573]],[[12656,12656],"mapped",[4575]],[[12657,12657],"mapped",[4381]],[[12658,12658],"mapped",[4382]],[[12659,12659],"mapped",[4384]],[[12660,12660],"mapped",[4386]],[[12661,12661],"mapped",[4387]],[[12662,12662],"mapped",[4391]],[[12663,12663],"mapped",[4393]],[[12664,12664],"mapped",[4395]],[[12665,12665],"mapped",[4396]],[[12666,12666],"mapped",[4397]],[[12667,12667],"mapped",[4398]],[[12668,12668],"mapped",[4399]],[[12669,12669],"mapped",[4402]],[[12670,12670],"mapped",[4406]],[[12671,12671],"mapped",[4416]],[[12672,12672],"mapped",[4423]],[[12673,12673],"mapped",[4428]],[[12674,12674],"mapped",[4593]],[[12675,12675],"mapped",[4594]],[[12676,12676],"mapped",[4439]],[[12677,12677],"mapped",[4440]],[[12678,12678],"mapped",[4441]],[[12679,12679],"mapped",[4484]],[[12680,12680],"mapped",[4485]],[[12681,12681],"mapped",[4488]],[[12682,12682],"mapped",[4497]],[[12683,12683],"mapped",[4498]],[[12684,12684],"mapped",[4500]],[[12685,12685],"mapped",[4510]],[[12686,12686],"mapped",[4513]],[[12687,12687],"disallowed"],[[12688,12689],"valid",[],"NV8"],[[12690,12690],"mapped",[19968]],[[12691,12691],"mapped",[20108]],[[12692,12692],"mapped",[19977]],[[12693,12693],"mapped",[22235]],[[12694,12694],"mapped",[19978]],[[12695,12695],"mapped",[20013]],[[12696,12696],"mapped",[19979]],[[12697,12697],"mapped",[30002]],[[12698,12698],"mapped",[20057]],[[12699,12699],"mapped",[19993]],[[12700,12700],"mapped",[19969]],[[12701,12701],"mapped",[22825]],[[12702,12702],"mapped",[22320]],[[12703,12703],"mapped",[20154]],[[12704,12727],"valid"],[[12728,12730],"valid"],[[12731,12735],"disallowed"],[[12736,12751],"valid",[],"NV8"],[[12752,12771],"valid",[],"NV8"],[[12772,12783],"disallowed"],[[12784,12799],"valid"],[[12800,12800],"disallowed_STD3_mapped",[40,4352,41]],[[12801,12801],"disallowed_STD3_mapped",[40,4354,41]],[[12802,12802],"disallowed_STD3_mapped",[40,4355,41]],[[12803,12803],"disallowed_STD3_mapped",[40,4357,41]],[[12804,12804],"disallowed_STD3_mapped",[40,4358,41]],[[12805,12805],"disallowed_STD3_mapped",[40,4359,41]],[[12806,12806],"disallowed_STD3_mapped",[40,4361,41]],[[12807,12807],"disallowed_STD3_mapped",[40,4363,41]],[[12808,12808],"disallowed_STD3_mapped",[40,4364,41]],[[12809,12809],"disallowed_STD3_mapped",[40,4366,41]],[[12810,12810],"disallowed_STD3_mapped",[40,4367,41]],[[12811,12811],"disallowed_STD3_mapped",[40,4368,41]],[[12812,12812],"disallowed_STD3_mapped",[40,4369,41]],[[12813,12813],"disallowed_STD3_mapped",[40,4370,41]],[[12814,12814],"disallowed_STD3_mapped",[40,44032,41]],[[12815,12815],"disallowed_STD3_mapped",[40,45208,41]],[[12816,12816],"disallowed_STD3_mapped",[40,45796,41]],[[12817,12817],"disallowed_STD3_mapped",[40,46972,41]],[[12818,12818],"disallowed_STD3_mapped",[40,47560,41]],[[12819,12819],"disallowed_STD3_mapped",[40,48148,41]],[[12820,12820],"disallowed_STD3_mapped",[40,49324,41]],[[12821,12821],"disallowed_STD3_mapped",[40,50500,41]],[[12822,12822],"disallowed_STD3_mapped",[40,51088,41]],[[12823,12823],"disallowed_STD3_mapped",[40,52264,41]],[[12824,12824],"disallowed_STD3_mapped",[40,52852,41]],[[12825,12825],"disallowed_STD3_mapped",[40,53440,41]],[[12826,12826],"disallowed_STD3_mapped",[40,54028,41]],[[12827,12827],"disallowed_STD3_mapped",[40,54616,41]],[[12828,12828],"disallowed_STD3_mapped",[40,51452,41]],[[12829,12829],"disallowed_STD3_mapped",[40,50724,51204,41]],[[12830,12830],"disallowed_STD3_mapped",[40,50724,54980,41]],[[12831,12831],"disallowed"],[[12832,12832],"disallowed_STD3_mapped",[40,19968,41]],[[12833,12833],"disallowed_STD3_mapped",[40,20108,41]],[[12834,12834],"disallowed_STD3_mapped",[40,19977,41]],[[12835,12835],"disallowed_STD3_mapped",[40,22235,41]],[[12836,12836],"disallowed_STD3_mapped",[40,20116,41]],[[12837,12837],"disallowed_STD3_mapped",[40,20845,41]],[[12838,12838],"disallowed_STD3_mapped",[40,19971,41]],[[12839,12839],"disallowed_STD3_mapped",[40,20843,41]],[[12840,12840],"disallowed_STD3_mapped",[40,20061,41]],[[12841,12841],"disallowed_STD3_mapped",[40,21313,41]],[[12842,12842],"disallowed_STD3_mapped",[40,26376,41]],[[12843,12843],"disallowed_STD3_mapped",[40,28779,41]],[[12844,12844],"disallowed_STD3_mapped",[40,27700,41]],[[12845,12845],"disallowed_STD3_mapped",[40,26408,41]],[[12846,12846],"disallowed_STD3_mapped",[40,37329,41]],[[12847,12847],"disallowed_STD3_mapped",[40,22303,41]],[[12848,12848],"disallowed_STD3_mapped",[40,26085,41]],[[12849,12849],"disallowed_STD3_mapped",[40,26666,41]],[[12850,12850],"disallowed_STD3_mapped",[40,26377,41]],[[12851,12851],"disallowed_STD3_mapped",[40,31038,41]],[[12852,12852],"disallowed_STD3_mapped",[40,21517,41]],[[12853,12853],"disallowed_STD3_mapped",[40,29305,41]],[[12854,12854],"disallowed_STD3_mapped",[40,36001,41]],[[12855,12855],"disallowed_STD3_mapped",[40,31069,41]],[[12856,12856],"disallowed_STD3_mapped",[40,21172,41]],[[12857,12857],"disallowed_STD3_mapped",[40,20195,41]],[[12858,12858],"disallowed_STD3_mapped",[40,21628,41]],[[12859,12859],"disallowed_STD3_mapped",[40,23398,41]],[[12860,12860],"disallowed_STD3_mapped",[40,30435,41]],[[12861,12861],"disallowed_STD3_mapped",[40,20225,41]],[[12862,12862],"disallowed_STD3_mapped",[40,36039,41]],[[12863,12863],"disallowed_STD3_mapped",[40,21332,41]],[[12864,12864],"disallowed_STD3_mapped",[40,31085,41]],[[12865,12865],"disallowed_STD3_mapped",[40,20241,41]],[[12866,12866],"disallowed_STD3_mapped",[40,33258,41]],[[12867,12867],"disallowed_STD3_mapped",[40,33267,41]],[[12868,12868],"mapped",[21839]],[[12869,12869],"mapped",[24188]],[[12870,12870],"mapped",[25991]],[[12871,12871],"mapped",[31631]],[[12872,12879],"valid",[],"NV8"],[[12880,12880],"mapped",[112,116,101]],[[12881,12881],"mapped",[50,49]],[[12882,12882],"mapped",[50,50]],[[12883,12883],"mapped",[50,51]],[[12884,12884],"mapped",[50,52]],[[12885,12885],"mapped",[50,53]],[[12886,12886],"mapped",[50,54]],[[12887,12887],"mapped",[50,55]],[[12888,12888],"mapped",[50,56]],[[12889,12889],"mapped",[50,57]],[[12890,12890],"mapped",[51,48]],[[12891,12891],"mapped",[51,49]],[[12892,12892],"mapped",[51,50]],[[12893,12893],"mapped",[51,51]],[[12894,12894],"mapped",[51,52]],[[12895,12895],"mapped",[51,53]],[[12896,12896],"mapped",[4352]],[[12897,12897],"mapped",[4354]],[[12898,12898],"mapped",[4355]],[[12899,12899],"mapped",[4357]],[[12900,12900],"mapped",[4358]],[[12901,12901],"mapped",[4359]],[[12902,12902],"mapped",[4361]],[[12903,12903],"mapped",[4363]],[[12904,12904],"mapped",[4364]],[[12905,12905],"mapped",[4366]],[[12906,12906],"mapped",[4367]],[[12907,12907],"mapped",[4368]],[[12908,12908],"mapped",[4369]],[[12909,12909],"mapped",[4370]],[[12910,12910],"mapped",[44032]],[[12911,12911],"mapped",[45208]],[[12912,12912],"mapped",[45796]],[[12913,12913],"mapped",[46972]],[[12914,12914],"mapped",[47560]],[[12915,12915],"mapped",[48148]],[[12916,12916],"mapped",[49324]],[[12917,12917],"mapped",[50500]],[[12918,12918],"mapped",[51088]],[[12919,12919],"mapped",[52264]],[[12920,12920],"mapped",[52852]],[[12921,12921],"mapped",[53440]],[[12922,12922],"mapped",[54028]],[[12923,12923],"mapped",[54616]],[[12924,12924],"mapped",[52280,44256]],[[12925,12925],"mapped",[51452,51032]],[[12926,12926],"mapped",[50864]],[[12927,12927],"valid",[],"NV8"],[[12928,12928],"mapped",[19968]],[[12929,12929],"mapped",[20108]],[[12930,12930],"mapped",[19977]],[[12931,12931],"mapped",[22235]],[[12932,12932],"mapped",[20116]],[[12933,12933],"mapped",[20845]],[[12934,12934],"mapped",[19971]],[[12935,12935],"mapped",[20843]],[[12936,12936],"mapped",[20061]],[[12937,12937],"mapped",[21313]],[[12938,12938],"mapped",[26376]],[[12939,12939],"mapped",[28779]],[[12940,12940],"mapped",[27700]],[[12941,12941],"mapped",[26408]],[[12942,12942],"mapped",[37329]],[[12943,12943],"mapped",[22303]],[[12944,12944],"mapped",[26085]],[[12945,12945],"mapped",[26666]],[[12946,12946],"mapped",[26377]],[[12947,12947],"mapped",[31038]],[[12948,12948],"mapped",[21517]],[[12949,12949],"mapped",[29305]],[[12950,12950],"mapped",[36001]],[[12951,12951],"mapped",[31069]],[[12952,12952],"mapped",[21172]],[[12953,12953],"mapped",[31192]],[[12954,12954],"mapped",[30007]],[[12955,12955],"mapped",[22899]],[[12956,12956],"mapped",[36969]],[[12957,12957],"mapped",[20778]],[[12958,12958],"mapped",[21360]],[[12959,12959],"mapped",[27880]],[[12960,12960],"mapped",[38917]],[[12961,12961],"mapped",[20241]],[[12962,12962],"mapped",[20889]],[[12963,12963],"mapped",[27491]],[[12964,12964],"mapped",[19978]],[[12965,12965],"mapped",[20013]],[[12966,12966],"mapped",[19979]],[[12967,12967],"mapped",[24038]],[[12968,12968],"mapped",[21491]],[[12969,12969],"mapped",[21307]],[[12970,12970],"mapped",[23447]],[[12971,12971],"mapped",[23398]],[[12972,12972],"mapped",[30435]],[[12973,12973],"mapped",[20225]],[[12974,12974],"mapped",[36039]],[[12975,12975],"mapped",[21332]],[[12976,12976],"mapped",[22812]],[[12977,12977],"mapped",[51,54]],[[12978,12978],"mapped",[51,55]],[[12979,12979],"mapped",[51,56]],[[12980,12980],"mapped",[51,57]],[[12981,12981],"mapped",[52,48]],[[12982,12982],"mapped",[52,49]],[[12983,12983],"mapped",[52,50]],[[12984,12984],"mapped",[52,51]],[[12985,12985],"mapped",[52,52]],[[12986,12986],"mapped",[52,53]],[[12987,12987],"mapped",[52,54]],[[12988,12988],"mapped",[52,55]],[[12989,12989],"mapped",[52,56]],[[12990,12990],"mapped",[52,57]],[[12991,12991],"mapped",[53,48]],[[12992,12992],"mapped",[49,26376]],[[12993,12993],"mapped",[50,26376]],[[12994,12994],"mapped",[51,26376]],[[12995,12995],"mapped",[52,26376]],[[12996,12996],"mapped",[53,26376]],[[12997,12997],"mapped",[54,26376]],[[12998,12998],"mapped",[55,26376]],[[12999,12999],"mapped",[56,26376]],[[13000,13000],"mapped",[57,26376]],[[13001,13001],"mapped",[49,48,26376]],[[13002,13002],"mapped",[49,49,26376]],[[13003,13003],"mapped",[49,50,26376]],[[13004,13004],"mapped",[104,103]],[[13005,13005],"mapped",[101,114,103]],[[13006,13006],"mapped",[101,118]],[[13007,13007],"mapped",[108,116,100]],[[13008,13008],"mapped",[12450]],[[13009,13009],"mapped",[12452]],[[13010,13010],"mapped",[12454]],[[13011,13011],"mapped",[12456]],[[13012,13012],"mapped",[12458]],[[13013,13013],"mapped",[12459]],[[13014,13014],"mapped",[12461]],[[13015,13015],"mapped",[12463]],[[13016,13016],"mapped",[12465]],[[13017,13017],"mapped",[12467]],[[13018,13018],"mapped",[12469]],[[13019,13019],"mapped",[12471]],[[13020,13020],"mapped",[12473]],[[13021,13021],"mapped",[12475]],[[13022,13022],"mapped",[12477]],[[13023,13023],"mapped",[12479]],[[13024,13024],"mapped",[12481]],[[13025,13025],"mapped",[12484]],[[13026,13026],"mapped",[12486]],[[13027,13027],"mapped",[12488]],[[13028,13028],"mapped",[12490]],[[13029,13029],"mapped",[12491]],[[13030,13030],"mapped",[12492]],[[13031,13031],"mapped",[12493]],[[13032,13032],"mapped",[12494]],[[13033,13033],"mapped",[12495]],[[13034,13034],"mapped",[12498]],[[13035,13035],"mapped",[12501]],[[13036,13036],"mapped",[12504]],[[13037,13037],"mapped",[12507]],[[13038,13038],"mapped",[12510]],[[13039,13039],"mapped",[12511]],[[13040,13040],"mapped",[12512]],[[13041,13041],"mapped",[12513]],[[13042,13042],"mapped",[12514]],[[13043,13043],"mapped",[12516]],[[13044,13044],"mapped",[12518]],[[13045,13045],"mapped",[12520]],[[13046,13046],"mapped",[12521]],[[13047,13047],"mapped",[12522]],[[13048,13048],"mapped",[12523]],[[13049,13049],"mapped",[12524]],[[13050,13050],"mapped",[12525]],[[13051,13051],"mapped",[12527]],[[13052,13052],"mapped",[12528]],[[13053,13053],"mapped",[12529]],[[13054,13054],"mapped",[12530]],[[13055,13055],"disallowed"],[[13056,13056],"mapped",[12450,12497,12540,12488]],[[13057,13057],"mapped",[12450,12523,12501,12449]],[[13058,13058],"mapped",[12450,12531,12506,12450]],[[13059,13059],"mapped",[12450,12540,12523]],[[13060,13060],"mapped",[12452,12491,12531,12464]],[[13061,13061],"mapped",[12452,12531,12481]],[[13062,13062],"mapped",[12454,12457,12531]],[[13063,13063],"mapped",[12456,12473,12463,12540,12489]],[[13064,13064],"mapped",[12456,12540,12459,12540]],[[13065,13065],"mapped",[12458,12531,12473]],[[13066,13066],"mapped",[12458,12540,12512]],[[13067,13067],"mapped",[12459,12452,12522]],[[13068,13068],"mapped",[12459,12521,12483,12488]],[[13069,13069],"mapped",[12459,12525,12522,12540]],[[13070,13070],"mapped",[12460,12525,12531]],[[13071,13071],"mapped",[12460,12531,12510]],[[13072,13072],"mapped",[12462,12460]],[[13073,13073],"mapped",[12462,12491,12540]],[[13074,13074],"mapped",[12461,12517,12522,12540]],[[13075,13075],"mapped",[12462,12523,12480,12540]],[[13076,13076],"mapped",[12461,12525]],[[13077,13077],"mapped",[12461,12525,12464,12521,12512]],[[13078,13078],"mapped",[12461,12525,12513,12540,12488,12523]],[[13079,13079],"mapped",[12461,12525,12527,12483,12488]],[[13080,13080],"mapped",[12464,12521,12512]],[[13081,13081],"mapped",[12464,12521,12512,12488,12531]],[[13082,13082],"mapped",[12463,12523,12476,12452,12525]],[[13083,13083],"mapped",[12463,12525,12540,12493]],[[13084,13084],"mapped",[12465,12540,12473]],[[13085,13085],"mapped",[12467,12523,12490]],[[13086,13086],"mapped",[12467,12540,12509]],[[13087,13087],"mapped",[12469,12452,12463,12523]],[[13088,13088],"mapped",[12469,12531,12481,12540,12512]],[[13089,13089],"mapped",[12471,12522,12531,12464]],[[13090,13090],"mapped",[12475,12531,12481]],[[13091,13091],"mapped",[12475,12531,12488]],[[13092,13092],"mapped",[12480,12540,12473]],[[13093,13093],"mapped",[12487,12471]],[[13094,13094],"mapped",[12489,12523]],[[13095,13095],"mapped",[12488,12531]],[[13096,13096],"mapped",[12490,12494]],[[13097,13097],"mapped",[12494,12483,12488]],[[13098,13098],"mapped",[12495,12452,12484]],[[13099,13099],"mapped",[12497,12540,12475,12531,12488]],[[13100,13100],"mapped",[12497,12540,12484]],[[13101,13101],"mapped",[12496,12540,12524,12523]],[[13102,13102],"mapped",[12500,12450,12473,12488,12523]],[[13103,13103],"mapped",[12500,12463,12523]],[[13104,13104],"mapped",[12500,12467]],[[13105,13105],"mapped",[12499,12523]],[[13106,13106],"mapped",[12501,12449,12521,12483,12489]],[[13107,13107],"mapped",[12501,12451,12540,12488]],[[13108,13108],"mapped",[12502,12483,12471,12455,12523]],[[13109,13109],"mapped",[12501,12521,12531]],[[13110,13110],"mapped",[12504,12463,12479,12540,12523]],[[13111,13111],"mapped",[12506,12477]],[[13112,13112],"mapped",[12506,12491,12498]],[[13113,13113],"mapped",[12504,12523,12484]],[[13114,13114],"mapped",[12506,12531,12473]],[[13115,13115],"mapped",[12506,12540,12472]],[[13116,13116],"mapped",[12505,12540,12479]],[[13117,13117],"mapped",[12509,12452,12531,12488]],[[13118,13118],"mapped",[12508,12523,12488]],[[13119,13119],"mapped",[12507,12531]],[[13120,13120],"mapped",[12509,12531,12489]],[[13121,13121],"mapped",[12507,12540,12523]],[[13122,13122],"mapped",[12507,12540,12531]],[[13123,13123],"mapped",[12510,12452,12463,12525]],[[13124,13124],"mapped",[12510,12452,12523]],[[13125,13125],"mapped",[12510,12483,12495]],[[13126,13126],"mapped",[12510,12523,12463]],[[13127,13127],"mapped",[12510,12531,12471,12519,12531]],[[13128,13128],"mapped",[12511,12463,12525,12531]],[[13129,13129],"mapped",[12511,12522]],[[13130,13130],"mapped",[12511,12522,12496,12540,12523]],[[13131,13131],"mapped",[12513,12460]],[[13132,13132],"mapped",[12513,12460,12488,12531]],[[13133,13133],"mapped",[12513,12540,12488,12523]],[[13134,13134],"mapped",[12516,12540,12489]],[[13135,13135],"mapped",[12516,12540,12523]],[[13136,13136],"mapped",[12518,12450,12531]],[[13137,13137],"mapped",[12522,12483,12488,12523]],[[13138,13138],"mapped",[12522,12521]],[[13139,13139],"mapped",[12523,12500,12540]],[[13140,13140],"mapped",[12523,12540,12502,12523]],[[13141,13141],"mapped",[12524,12512]],[[13142,13142],"mapped",[12524,12531,12488,12466,12531]],[[13143,13143],"mapped",[12527,12483,12488]],[[13144,13144],"mapped",[48,28857]],[[13145,13145],"mapped",[49,28857]],[[13146,13146],"mapped",[50,28857]],[[13147,13147],"mapped",[51,28857]],[[13148,13148],"mapped",[52,28857]],[[13149,13149],"mapped",[53,28857]],[[13150,13150],"mapped",[54,28857]],[[13151,13151],"mapped",[55,28857]],[[13152,13152],"mapped",[56,28857]],[[13153,13153],"mapped",[57,28857]],[[13154,13154],"mapped",[49,48,28857]],[[13155,13155],"mapped",[49,49,28857]],[[13156,13156],"mapped",[49,50,28857]],[[13157,13157],"mapped",[49,51,28857]],[[13158,13158],"mapped",[49,52,28857]],[[13159,13159],"mapped",[49,53,28857]],[[13160,13160],"mapped",[49,54,28857]],[[13161,13161],"mapped",[49,55,28857]],[[13162,13162],"mapped",[49,56,28857]],[[13163,13163],"mapped",[49,57,28857]],[[13164,13164],"mapped",[50,48,28857]],[[13165,13165],"mapped",[50,49,28857]],[[13166,13166],"mapped",[50,50,28857]],[[13167,13167],"mapped",[50,51,28857]],[[13168,13168],"mapped",[50,52,28857]],[[13169,13169],"mapped",[104,112,97]],[[13170,13170],"mapped",[100,97]],[[13171,13171],"mapped",[97,117]],[[13172,13172],"mapped",[98,97,114]],[[13173,13173],"mapped",[111,118]],[[13174,13174],"mapped",[112,99]],[[13175,13175],"mapped",[100,109]],[[13176,13176],"mapped",[100,109,50]],[[13177,13177],"mapped",[100,109,51]],[[13178,13178],"mapped",[105,117]],[[13179,13179],"mapped",[24179,25104]],[[13180,13180],"mapped",[26157,21644]],[[13181,13181],"mapped",[22823,27491]],[[13182,13182],"mapped",[26126,27835]],[[13183,13183],"mapped",[26666,24335,20250,31038]],[[13184,13184],"mapped",[112,97]],[[13185,13185],"mapped",[110,97]],[[13186,13186],"mapped",[956,97]],[[13187,13187],"mapped",[109,97]],[[13188,13188],"mapped",[107,97]],[[13189,13189],"mapped",[107,98]],[[13190,13190],"mapped",[109,98]],[[13191,13191],"mapped",[103,98]],[[13192,13192],"mapped",[99,97,108]],[[13193,13193],"mapped",[107,99,97,108]],[[13194,13194],"mapped",[112,102]],[[13195,13195],"mapped",[110,102]],[[13196,13196],"mapped",[956,102]],[[13197,13197],"mapped",[956,103]],[[13198,13198],"mapped",[109,103]],[[13199,13199],"mapped",[107,103]],[[13200,13200],"mapped",[104,122]],[[13201,13201],"mapped",[107,104,122]],[[13202,13202],"mapped",[109,104,122]],[[13203,13203],"mapped",[103,104,122]],[[13204,13204],"mapped",[116,104,122]],[[13205,13205],"mapped",[956,108]],[[13206,13206],"mapped",[109,108]],[[13207,13207],"mapped",[100,108]],[[13208,13208],"mapped",[107,108]],[[13209,13209],"mapped",[102,109]],[[13210,13210],"mapped",[110,109]],[[13211,13211],"mapped",[956,109]],[[13212,13212],"mapped",[109,109]],[[13213,13213],"mapped",[99,109]],[[13214,13214],"mapped",[107,109]],[[13215,13215],"mapped",[109,109,50]],[[13216,13216],"mapped",[99,109,50]],[[13217,13217],"mapped",[109,50]],[[13218,13218],"mapped",[107,109,50]],[[13219,13219],"mapped",[109,109,51]],[[13220,13220],"mapped",[99,109,51]],[[13221,13221],"mapped",[109,51]],[[13222,13222],"mapped",[107,109,51]],[[13223,13223],"mapped",[109,8725,115]],[[13224,13224],"mapped",[109,8725,115,50]],[[13225,13225],"mapped",[112,97]],[[13226,13226],"mapped",[107,112,97]],[[13227,13227],"mapped",[109,112,97]],[[13228,13228],"mapped",[103,112,97]],[[13229,13229],"mapped",[114,97,100]],[[13230,13230],"mapped",[114,97,100,8725,115]],[[13231,13231],"mapped",[114,97,100,8725,115,50]],[[13232,13232],"mapped",[112,115]],[[13233,13233],"mapped",[110,115]],[[13234,13234],"mapped",[956,115]],[[13235,13235],"mapped",[109,115]],[[13236,13236],"mapped",[112,118]],[[13237,13237],"mapped",[110,118]],[[13238,13238],"mapped",[956,118]],[[13239,13239],"mapped",[109,118]],[[13240,13240],"mapped",[107,118]],[[13241,13241],"mapped",[109,118]],[[13242,13242],"mapped",[112,119]],[[13243,13243],"mapped",[110,119]],[[13244,13244],"mapped",[956,119]],[[13245,13245],"mapped",[109,119]],[[13246,13246],"mapped",[107,119]],[[13247,13247],"mapped",[109,119]],[[13248,13248],"mapped",[107,969]],[[13249,13249],"mapped",[109,969]],[[13250,13250],"disallowed"],[[13251,13251],"mapped",[98,113]],[[13252,13252],"mapped",[99,99]],[[13253,13253],"mapped",[99,100]],[[13254,13254],"mapped",[99,8725,107,103]],[[13255,13255],"disallowed"],[[13256,13256],"mapped",[100,98]],[[13257,13257],"mapped",[103,121]],[[13258,13258],"mapped",[104,97]],[[13259,13259],"mapped",[104,112]],[[13260,13260],"mapped",[105,110]],[[13261,13261],"mapped",[107,107]],[[13262,13262],"mapped",[107,109]],[[13263,13263],"mapped",[107,116]],[[13264,13264],"mapped",[108,109]],[[13265,13265],"mapped",[108,110]],[[13266,13266],"mapped",[108,111,103]],[[13267,13267],"mapped",[108,120]],[[13268,13268],"mapped",[109,98]],[[13269,13269],"mapped",[109,105,108]],[[13270,13270],"mapped",[109,111,108]],[[13271,13271],"mapped",[112,104]],[[13272,13272],"disallowed"],[[13273,13273],"mapped",[112,112,109]],[[13274,13274],"mapped",[112,114]],[[13275,13275],"mapped",[115,114]],[[13276,13276],"mapped",[115,118]],[[13277,13277],"mapped",[119,98]],[[13278,13278],"mapped",[118,8725,109]],[[13279,13279],"mapped",[97,8725,109]],[[13280,13280],"mapped",[49,26085]],[[13281,13281],"mapped",[50,26085]],[[13282,13282],"mapped",[51,26085]],[[13283,13283],"mapped",[52,26085]],[[13284,13284],"mapped",[53,26085]],[[13285,13285],"mapped",[54,26085]],[[13286,13286],"mapped",[55,26085]],[[13287,13287],"mapped",[56,26085]],[[13288,13288],"mapped",[57,26085]],[[13289,13289],"mapped",[49,48,26085]],[[13290,13290],"mapped",[49,49,26085]],[[13291,13291],"mapped",[49,50,26085]],[[13292,13292],"mapped",[49,51,26085]],[[13293,13293],"mapped",[49,52,26085]],[[13294,13294],"mapped",[49,53,26085]],[[13295,13295],"mapped",[49,54,26085]],[[13296,13296],"mapped",[49,55,26085]],[[13297,13297],"mapped",[49,56,26085]],[[13298,13298],"mapped",[49,57,26085]],[[13299,13299],"mapped",[50,48,26085]],[[13300,13300],"mapped",[50,49,26085]],[[13301,13301],"mapped",[50,50,26085]],[[13302,13302],"mapped",[50,51,26085]],[[13303,13303],"mapped",[50,52,26085]],[[13304,13304],"mapped",[50,53,26085]],[[13305,13305],"mapped",[50,54,26085]],[[13306,13306],"mapped",[50,55,26085]],[[13307,13307],"mapped",[50,56,26085]],[[13308,13308],"mapped",[50,57,26085]],[[13309,13309],"mapped",[51,48,26085]],[[13310,13310],"mapped",[51,49,26085]],[[13311,13311],"mapped",[103,97,108]],[[13312,19893],"valid"],[[19894,19903],"disallowed"],[[19904,19967],"valid",[],"NV8"],[[19968,40869],"valid"],[[40870,40891],"valid"],[[40892,40899],"valid"],[[40900,40907],"valid"],[[40908,40908],"valid"],[[40909,40917],"valid"],[[40918,40959],"disallowed"],[[40960,42124],"valid"],[[42125,42127],"disallowed"],[[42128,42145],"valid",[],"NV8"],[[42146,42147],"valid",[],"NV8"],[[42148,42163],"valid",[],"NV8"],[[42164,42164],"valid",[],"NV8"],[[42165,42176],"valid",[],"NV8"],[[42177,42177],"valid",[],"NV8"],[[42178,42180],"valid",[],"NV8"],[[42181,42181],"valid",[],"NV8"],[[42182,42182],"valid",[],"NV8"],[[42183,42191],"disallowed"],[[42192,42237],"valid"],[[42238,42239],"valid",[],"NV8"],[[42240,42508],"valid"],[[42509,42511],"valid",[],"NV8"],[[42512,42539],"valid"],[[42540,42559],"disallowed"],[[42560,42560],"mapped",[42561]],[[42561,42561],"valid"],[[42562,42562],"mapped",[42563]],[[42563,42563],"valid"],[[42564,42564],"mapped",[42565]],[[42565,42565],"valid"],[[42566,42566],"mapped",[42567]],[[42567,42567],"valid"],[[42568,42568],"mapped",[42569]],[[42569,42569],"valid"],[[42570,42570],"mapped",[42571]],[[42571,42571],"valid"],[[42572,42572],"mapped",[42573]],[[42573,42573],"valid"],[[42574,42574],"mapped",[42575]],[[42575,42575],"valid"],[[42576,42576],"mapped",[42577]],[[42577,42577],"valid"],[[42578,42578],"mapped",[42579]],[[42579,42579],"valid"],[[42580,42580],"mapped",[42581]],[[42581,42581],"valid"],[[42582,42582],"mapped",[42583]],[[42583,42583],"valid"],[[42584,42584],"mapped",[42585]],[[42585,42585],"valid"],[[42586,42586],"mapped",[42587]],[[42587,42587],"valid"],[[42588,42588],"mapped",[42589]],[[42589,42589],"valid"],[[42590,42590],"mapped",[42591]],[[42591,42591],"valid"],[[42592,42592],"mapped",[42593]],[[42593,42593],"valid"],[[42594,42594],"mapped",[42595]],[[42595,42595],"valid"],[[42596,42596],"mapped",[42597]],[[42597,42597],"valid"],[[42598,42598],"mapped",[42599]],[[42599,42599],"valid"],[[42600,42600],"mapped",[42601]],[[42601,42601],"valid"],[[42602,42602],"mapped",[42603]],[[42603,42603],"valid"],[[42604,42604],"mapped",[42605]],[[42605,42607],"valid"],[[42608,42611],"valid",[],"NV8"],[[42612,42619],"valid"],[[42620,42621],"valid"],[[42622,42622],"valid",[],"NV8"],[[42623,42623],"valid"],[[42624,42624],"mapped",[42625]],[[42625,42625],"valid"],[[42626,42626],"mapped",[42627]],[[42627,42627],"valid"],[[42628,42628],"mapped",[42629]],[[42629,42629],"valid"],[[42630,42630],"mapped",[42631]],[[42631,42631],"valid"],[[42632,42632],"mapped",[42633]],[[42633,42633],"valid"],[[42634,42634],"mapped",[42635]],[[42635,42635],"valid"],[[42636,42636],"mapped",[42637]],[[42637,42637],"valid"],[[42638,42638],"mapped",[42639]],[[42639,42639],"valid"],[[42640,42640],"mapped",[42641]],[[42641,42641],"valid"],[[42642,42642],"mapped",[42643]],[[42643,42643],"valid"],[[42644,42644],"mapped",[42645]],[[42645,42645],"valid"],[[42646,42646],"mapped",[42647]],[[42647,42647],"valid"],[[42648,42648],"mapped",[42649]],[[42649,42649],"valid"],[[42650,42650],"mapped",[42651]],[[42651,42651],"valid"],[[42652,42652],"mapped",[1098]],[[42653,42653],"mapped",[1100]],[[42654,42654],"valid"],[[42655,42655],"valid"],[[42656,42725],"valid"],[[42726,42735],"valid",[],"NV8"],[[42736,42737],"valid"],[[42738,42743],"valid",[],"NV8"],[[42744,42751],"disallowed"],[[42752,42774],"valid",[],"NV8"],[[42775,42778],"valid"],[[42779,42783],"valid"],[[42784,42785],"valid",[],"NV8"],[[42786,42786],"mapped",[42787]],[[42787,42787],"valid"],[[42788,42788],"mapped",[42789]],[[42789,42789],"valid"],[[42790,42790],"mapped",[42791]],[[42791,42791],"valid"],[[42792,42792],"mapped",[42793]],[[42793,42793],"valid"],[[42794,42794],"mapped",[42795]],[[42795,42795],"valid"],[[42796,42796],"mapped",[42797]],[[42797,42797],"valid"],[[42798,42798],"mapped",[42799]],[[42799,42801],"valid"],[[42802,42802],"mapped",[42803]],[[42803,42803],"valid"],[[42804,42804],"mapped",[42805]],[[42805,42805],"valid"],[[42806,42806],"mapped",[42807]],[[42807,42807],"valid"],[[42808,42808],"mapped",[42809]],[[42809,42809],"valid"],[[42810,42810],"mapped",[42811]],[[42811,42811],"valid"],[[42812,42812],"mapped",[42813]],[[42813,42813],"valid"],[[42814,42814],"mapped",[42815]],[[42815,42815],"valid"],[[42816,42816],"mapped",[42817]],[[42817,42817],"valid"],[[42818,42818],"mapped",[42819]],[[42819,42819],"valid"],[[42820,42820],"mapped",[42821]],[[42821,42821],"valid"],[[42822,42822],"mapped",[42823]],[[42823,42823],"valid"],[[42824,42824],"mapped",[42825]],[[42825,42825],"valid"],[[42826,42826],"mapped",[42827]],[[42827,42827],"valid"],[[42828,42828],"mapped",[42829]],[[42829,42829],"valid"],[[42830,42830],"mapped",[42831]],[[42831,42831],"valid"],[[42832,42832],"mapped",[42833]],[[42833,42833],"valid"],[[42834,42834],"mapped",[42835]],[[42835,42835],"valid"],[[42836,42836],"mapped",[42837]],[[42837,42837],"valid"],[[42838,42838],"mapped",[42839]],[[42839,42839],"valid"],[[42840,42840],"mapped",[42841]],[[42841,42841],"valid"],[[42842,42842],"mapped",[42843]],[[42843,42843],"valid"],[[42844,42844],"mapped",[42845]],[[42845,42845],"valid"],[[42846,42846],"mapped",[42847]],[[42847,42847],"valid"],[[42848,42848],"mapped",[42849]],[[42849,42849],"valid"],[[42850,42850],"mapped",[42851]],[[42851,42851],"valid"],[[42852,42852],"mapped",[42853]],[[42853,42853],"valid"],[[42854,42854],"mapped",[42855]],[[42855,42855],"valid"],[[42856,42856],"mapped",[42857]],[[42857,42857],"valid"],[[42858,42858],"mapped",[42859]],[[42859,42859],"valid"],[[42860,42860],"mapped",[42861]],[[42861,42861],"valid"],[[42862,42862],"mapped",[42863]],[[42863,42863],"valid"],[[42864,42864],"mapped",[42863]],[[42865,42872],"valid"],[[42873,42873],"mapped",[42874]],[[42874,42874],"valid"],[[42875,42875],"mapped",[42876]],[[42876,42876],"valid"],[[42877,42877],"mapped",[7545]],[[42878,42878],"mapped",[42879]],[[42879,42879],"valid"],[[42880,42880],"mapped",[42881]],[[42881,42881],"valid"],[[42882,42882],"mapped",[42883]],[[42883,42883],"valid"],[[42884,42884],"mapped",[42885]],[[42885,42885],"valid"],[[42886,42886],"mapped",[42887]],[[42887,42888],"valid"],[[42889,42890],"valid",[],"NV8"],[[42891,42891],"mapped",[42892]],[[42892,42892],"valid"],[[42893,42893],"mapped",[613]],[[42894,42894],"valid"],[[42895,42895],"valid"],[[42896,42896],"mapped",[42897]],[[42897,42897],"valid"],[[42898,42898],"mapped",[42899]],[[42899,42899],"valid"],[[42900,42901],"valid"],[[42902,42902],"mapped",[42903]],[[42903,42903],"valid"],[[42904,42904],"mapped",[42905]],[[42905,42905],"valid"],[[42906,42906],"mapped",[42907]],[[42907,42907],"valid"],[[42908,42908],"mapped",[42909]],[[42909,42909],"valid"],[[42910,42910],"mapped",[42911]],[[42911,42911],"valid"],[[42912,42912],"mapped",[42913]],[[42913,42913],"valid"],[[42914,42914],"mapped",[42915]],[[42915,42915],"valid"],[[42916,42916],"mapped",[42917]],[[42917,42917],"valid"],[[42918,42918],"mapped",[42919]],[[42919,42919],"valid"],[[42920,42920],"mapped",[42921]],[[42921,42921],"valid"],[[42922,42922],"mapped",[614]],[[42923,42923],"mapped",[604]],[[42924,42924],"mapped",[609]],[[42925,42925],"mapped",[620]],[[42926,42927],"disallowed"],[[42928,42928],"mapped",[670]],[[42929,42929],"mapped",[647]],[[42930,42930],"mapped",[669]],[[42931,42931],"mapped",[43859]],[[42932,42932],"mapped",[42933]],[[42933,42933],"valid"],[[42934,42934],"mapped",[42935]],[[42935,42935],"valid"],[[42936,42998],"disallowed"],[[42999,42999],"valid"],[[43000,43000],"mapped",[295]],[[43001,43001],"mapped",[339]],[[43002,43002],"valid"],[[43003,43007],"valid"],[[43008,43047],"valid"],[[43048,43051],"valid",[],"NV8"],[[43052,43055],"disallowed"],[[43056,43065],"valid",[],"NV8"],[[43066,43071],"disallowed"],[[43072,43123],"valid"],[[43124,43127],"valid",[],"NV8"],[[43128,43135],"disallowed"],[[43136,43204],"valid"],[[43205,43213],"disallowed"],[[43214,43215],"valid",[],"NV8"],[[43216,43225],"valid"],[[43226,43231],"disallowed"],[[43232,43255],"valid"],[[43256,43258],"valid",[],"NV8"],[[43259,43259],"valid"],[[43260,43260],"valid",[],"NV8"],[[43261,43261],"valid"],[[43262,43263],"disallowed"],[[43264,43309],"valid"],[[43310,43311],"valid",[],"NV8"],[[43312,43347],"valid"],[[43348,43358],"disallowed"],[[43359,43359],"valid",[],"NV8"],[[43360,43388],"valid",[],"NV8"],[[43389,43391],"disallowed"],[[43392,43456],"valid"],[[43457,43469],"valid",[],"NV8"],[[43470,43470],"disallowed"],[[43471,43481],"valid"],[[43482,43485],"disallowed"],[[43486,43487],"valid",[],"NV8"],[[43488,43518],"valid"],[[43519,43519],"disallowed"],[[43520,43574],"valid"],[[43575,43583],"disallowed"],[[43584,43597],"valid"],[[43598,43599],"disallowed"],[[43600,43609],"valid"],[[43610,43611],"disallowed"],[[43612,43615],"valid",[],"NV8"],[[43616,43638],"valid"],[[43639,43641],"valid",[],"NV8"],[[43642,43643],"valid"],[[43644,43647],"valid"],[[43648,43714],"valid"],[[43715,43738],"disallowed"],[[43739,43741],"valid"],[[43742,43743],"valid",[],"NV8"],[[43744,43759],"valid"],[[43760,43761],"valid",[],"NV8"],[[43762,43766],"valid"],[[43767,43776],"disallowed"],[[43777,43782],"valid"],[[43783,43784],"disallowed"],[[43785,43790],"valid"],[[43791,43792],"disallowed"],[[43793,43798],"valid"],[[43799,43807],"disallowed"],[[43808,43814],"valid"],[[43815,43815],"disallowed"],[[43816,43822],"valid"],[[43823,43823],"disallowed"],[[43824,43866],"valid"],[[43867,43867],"valid",[],"NV8"],[[43868,43868],"mapped",[42791]],[[43869,43869],"mapped",[43831]],[[43870,43870],"mapped",[619]],[[43871,43871],"mapped",[43858]],[[43872,43875],"valid"],[[43876,43877],"valid"],[[43878,43887],"disallowed"],[[43888,43888],"mapped",[5024]],[[43889,43889],"mapped",[5025]],[[43890,43890],"mapped",[5026]],[[43891,43891],"mapped",[5027]],[[43892,43892],"mapped",[5028]],[[43893,43893],"mapped",[5029]],[[43894,43894],"mapped",[5030]],[[43895,43895],"mapped",[5031]],[[43896,43896],"mapped",[5032]],[[43897,43897],"mapped",[5033]],[[43898,43898],"mapped",[5034]],[[43899,43899],"mapped",[5035]],[[43900,43900],"mapped",[5036]],[[43901,43901],"mapped",[5037]],[[43902,43902],"mapped",[5038]],[[43903,43903],"mapped",[5039]],[[43904,43904],"mapped",[5040]],[[43905,43905],"mapped",[5041]],[[43906,43906],"mapped",[5042]],[[43907,43907],"mapped",[5043]],[[43908,43908],"mapped",[5044]],[[43909,43909],"mapped",[5045]],[[43910,43910],"mapped",[5046]],[[43911,43911],"mapped",[5047]],[[43912,43912],"mapped",[5048]],[[43913,43913],"mapped",[5049]],[[43914,43914],"mapped",[5050]],[[43915,43915],"mapped",[5051]],[[43916,43916],"mapped",[5052]],[[43917,43917],"mapped",[5053]],[[43918,43918],"mapped",[5054]],[[43919,43919],"mapped",[5055]],[[43920,43920],"mapped",[5056]],[[43921,43921],"mapped",[5057]],[[43922,43922],"mapped",[5058]],[[43923,43923],"mapped",[5059]],[[43924,43924],"mapped",[5060]],[[43925,43925],"mapped",[5061]],[[43926,43926],"mapped",[5062]],[[43927,43927],"mapped",[5063]],[[43928,43928],"mapped",[5064]],[[43929,43929],"mapped",[5065]],[[43930,43930],"mapped",[5066]],[[43931,43931],"mapped",[5067]],[[43932,43932],"mapped",[5068]],[[43933,43933],"mapped",[5069]],[[43934,43934],"mapped",[5070]],[[43935,43935],"mapped",[5071]],[[43936,43936],"mapped",[5072]],[[43937,43937],"mapped",[5073]],[[43938,43938],"mapped",[5074]],[[43939,43939],"mapped",[5075]],[[43940,43940],"mapped",[5076]],[[43941,43941],"mapped",[5077]],[[43942,43942],"mapped",[5078]],[[43943,43943],"mapped",[5079]],[[43944,43944],"mapped",[5080]],[[43945,43945],"mapped",[5081]],[[43946,43946],"mapped",[5082]],[[43947,43947],"mapped",[5083]],[[43948,43948],"mapped",[5084]],[[43949,43949],"mapped",[5085]],[[43950,43950],"mapped",[5086]],[[43951,43951],"mapped",[5087]],[[43952,43952],"mapped",[5088]],[[43953,43953],"mapped",[5089]],[[43954,43954],"mapped",[5090]],[[43955,43955],"mapped",[5091]],[[43956,43956],"mapped",[5092]],[[43957,43957],"mapped",[5093]],[[43958,43958],"mapped",[5094]],[[43959,43959],"mapped",[5095]],[[43960,43960],"mapped",[5096]],[[43961,43961],"mapped",[5097]],[[43962,43962],"mapped",[5098]],[[43963,43963],"mapped",[5099]],[[43964,43964],"mapped",[5100]],[[43965,43965],"mapped",[5101]],[[43966,43966],"mapped",[5102]],[[43967,43967],"mapped",[5103]],[[43968,44010],"valid"],[[44011,44011],"valid",[],"NV8"],[[44012,44013],"valid"],[[44014,44015],"disallowed"],[[44016,44025],"valid"],[[44026,44031],"disallowed"],[[44032,55203],"valid"],[[55204,55215],"disallowed"],[[55216,55238],"valid",[],"NV8"],[[55239,55242],"disallowed"],[[55243,55291],"valid",[],"NV8"],[[55292,55295],"disallowed"],[[55296,57343],"disallowed"],[[57344,63743],"disallowed"],[[63744,63744],"mapped",[35912]],[[63745,63745],"mapped",[26356]],[[63746,63746],"mapped",[36554]],[[63747,63747],"mapped",[36040]],[[63748,63748],"mapped",[28369]],[[63749,63749],"mapped",[20018]],[[63750,63750],"mapped",[21477]],[[63751,63752],"mapped",[40860]],[[63753,63753],"mapped",[22865]],[[63754,63754],"mapped",[37329]],[[63755,63755],"mapped",[21895]],[[63756,63756],"mapped",[22856]],[[63757,63757],"mapped",[25078]],[[63758,63758],"mapped",[30313]],[[63759,63759],"mapped",[32645]],[[63760,63760],"mapped",[34367]],[[63761,63761],"mapped",[34746]],[[63762,63762],"mapped",[35064]],[[63763,63763],"mapped",[37007]],[[63764,63764],"mapped",[27138]],[[63765,63765],"mapped",[27931]],[[63766,63766],"mapped",[28889]],[[63767,63767],"mapped",[29662]],[[63768,63768],"mapped",[33853]],[[63769,63769],"mapped",[37226]],[[63770,63770],"mapped",[39409]],[[63771,63771],"mapped",[20098]],[[63772,63772],"mapped",[21365]],[[63773,63773],"mapped",[27396]],[[63774,63774],"mapped",[29211]],[[63775,63775],"mapped",[34349]],[[63776,63776],"mapped",[40478]],[[63777,63777],"mapped",[23888]],[[63778,63778],"mapped",[28651]],[[63779,63779],"mapped",[34253]],[[63780,63780],"mapped",[35172]],[[63781,63781],"mapped",[25289]],[[63782,63782],"mapped",[33240]],[[63783,63783],"mapped",[34847]],[[63784,63784],"mapped",[24266]],[[63785,63785],"mapped",[26391]],[[63786,63786],"mapped",[28010]],[[63787,63787],"mapped",[29436]],[[63788,63788],"mapped",[37070]],[[63789,63789],"mapped",[20358]],[[63790,63790],"mapped",[20919]],[[63791,63791],"mapped",[21214]],[[63792,63792],"mapped",[25796]],[[63793,63793],"mapped",[27347]],[[63794,63794],"mapped",[29200]],[[63795,63795],"mapped",[30439]],[[63796,63796],"mapped",[32769]],[[63797,63797],"mapped",[34310]],[[63798,63798],"mapped",[34396]],[[63799,63799],"mapped",[36335]],[[63800,63800],"mapped",[38706]],[[63801,63801],"mapped",[39791]],[[63802,63802],"mapped",[40442]],[[63803,63803],"mapped",[30860]],[[63804,63804],"mapped",[31103]],[[63805,63805],"mapped",[32160]],[[63806,63806],"mapped",[33737]],[[63807,63807],"mapped",[37636]],[[63808,63808],"mapped",[40575]],[[63809,63809],"mapped",[35542]],[[63810,63810],"mapped",[22751]],[[63811,63811],"mapped",[24324]],[[63812,63812],"mapped",[31840]],[[63813,63813],"mapped",[32894]],[[63814,63814],"mapped",[29282]],[[63815,63815],"mapped",[30922]],[[63816,63816],"mapped",[36034]],[[63817,63817],"mapped",[38647]],[[63818,63818],"mapped",[22744]],[[63819,63819],"mapped",[23650]],[[63820,63820],"mapped",[27155]],[[63821,63821],"mapped",[28122]],[[63822,63822],"mapped",[28431]],[[63823,63823],"mapped",[32047]],[[63824,63824],"mapped",[32311]],[[63825,63825],"mapped",[38475]],[[63826,63826],"mapped",[21202]],[[63827,63827],"mapped",[32907]],[[63828,63828],"mapped",[20956]],[[63829,63829],"mapped",[20940]],[[63830,63830],"mapped",[31260]],[[63831,63831],"mapped",[32190]],[[63832,63832],"mapped",[33777]],[[63833,63833],"mapped",[38517]],[[63834,63834],"mapped",[35712]],[[63835,63835],"mapped",[25295]],[[63836,63836],"mapped",[27138]],[[63837,63837],"mapped",[35582]],[[63838,63838],"mapped",[20025]],[[63839,63839],"mapped",[23527]],[[63840,63840],"mapped",[24594]],[[63841,63841],"mapped",[29575]],[[63842,63842],"mapped",[30064]],[[63843,63843],"mapped",[21271]],[[63844,63844],"mapped",[30971]],[[63845,63845],"mapped",[20415]],[[63846,63846],"mapped",[24489]],[[63847,63847],"mapped",[19981]],[[63848,63848],"mapped",[27852]],[[63849,63849],"mapped",[25976]],[[63850,63850],"mapped",[32034]],[[63851,63851],"mapped",[21443]],[[63852,63852],"mapped",[22622]],[[63853,63853],"mapped",[30465]],[[63854,63854],"mapped",[33865]],[[63855,63855],"mapped",[35498]],[[63856,63856],"mapped",[27578]],[[63857,63857],"mapped",[36784]],[[63858,63858],"mapped",[27784]],[[63859,63859],"mapped",[25342]],[[63860,63860],"mapped",[33509]],[[63861,63861],"mapped",[25504]],[[63862,63862],"mapped",[30053]],[[63863,63863],"mapped",[20142]],[[63864,63864],"mapped",[20841]],[[63865,63865],"mapped",[20937]],[[63866,63866],"mapped",[26753]],[[63867,63867],"mapped",[31975]],[[63868,63868],"mapped",[33391]],[[63869,63869],"mapped",[35538]],[[63870,63870],"mapped",[37327]],[[63871,63871],"mapped",[21237]],[[63872,63872],"mapped",[21570]],[[63873,63873],"mapped",[22899]],[[63874,63874],"mapped",[24300]],[[63875,63875],"mapped",[26053]],[[63876,63876],"mapped",[28670]],[[63877,63877],"mapped",[31018]],[[63878,63878],"mapped",[38317]],[[63879,63879],"mapped",[39530]],[[63880,63880],"mapped",[40599]],[[63881,63881],"mapped",[40654]],[[63882,63882],"mapped",[21147]],[[63883,63883],"mapped",[26310]],[[63884,63884],"mapped",[27511]],[[63885,63885],"mapped",[36706]],[[63886,63886],"mapped",[24180]],[[63887,63887],"mapped",[24976]],[[63888,63888],"mapped",[25088]],[[63889,63889],"mapped",[25754]],[[63890,63890],"mapped",[28451]],[[63891,63891],"mapped",[29001]],[[63892,63892],"mapped",[29833]],[[63893,63893],"mapped",[31178]],[[63894,63894],"mapped",[32244]],[[63895,63895],"mapped",[32879]],[[63896,63896],"mapped",[36646]],[[63897,63897],"mapped",[34030]],[[63898,63898],"mapped",[36899]],[[63899,63899],"mapped",[37706]],[[63900,63900],"mapped",[21015]],[[63901,63901],"mapped",[21155]],[[63902,63902],"mapped",[21693]],[[63903,63903],"mapped",[28872]],[[63904,63904],"mapped",[35010]],[[63905,63905],"mapped",[35498]],[[63906,63906],"mapped",[24265]],[[63907,63907],"mapped",[24565]],[[63908,63908],"mapped",[25467]],[[63909,63909],"mapped",[27566]],[[63910,63910],"mapped",[31806]],[[63911,63911],"mapped",[29557]],[[63912,63912],"mapped",[20196]],[[63913,63913],"mapped",[22265]],[[63914,63914],"mapped",[23527]],[[63915,63915],"mapped",[23994]],[[63916,63916],"mapped",[24604]],[[63917,63917],"mapped",[29618]],[[63918,63918],"mapped",[29801]],[[63919,63919],"mapped",[32666]],[[63920,63920],"mapped",[32838]],[[63921,63921],"mapped",[37428]],[[63922,63922],"mapped",[38646]],[[63923,63923],"mapped",[38728]],[[63924,63924],"mapped",[38936]],[[63925,63925],"mapped",[20363]],[[63926,63926],"mapped",[31150]],[[63927,63927],"mapped",[37300]],[[63928,63928],"mapped",[38584]],[[63929,63929],"mapped",[24801]],[[63930,63930],"mapped",[20102]],[[63931,63931],"mapped",[20698]],[[63932,63932],"mapped",[23534]],[[63933,63933],"mapped",[23615]],[[63934,63934],"mapped",[26009]],[[63935,63935],"mapped",[27138]],[[63936,63936],"mapped",[29134]],[[63937,63937],"mapped",[30274]],[[63938,63938],"mapped",[34044]],[[63939,63939],"mapped",[36988]],[[63940,63940],"mapped",[40845]],[[63941,63941],"mapped",[26248]],[[63942,63942],"mapped",[38446]],[[63943,63943],"mapped",[21129]],[[63944,63944],"mapped",[26491]],[[63945,63945],"mapped",[26611]],[[63946,63946],"mapped",[27969]],[[63947,63947],"mapped",[28316]],[[63948,63948],"mapped",[29705]],[[63949,63949],"mapped",[30041]],[[63950,63950],"mapped",[30827]],[[63951,63951],"mapped",[32016]],[[63952,63952],"mapped",[39006]],[[63953,63953],"mapped",[20845]],[[63954,63954],"mapped",[25134]],[[63955,63955],"mapped",[38520]],[[63956,63956],"mapped",[20523]],[[63957,63957],"mapped",[23833]],[[63958,63958],"mapped",[28138]],[[63959,63959],"mapped",[36650]],[[63960,63960],"mapped",[24459]],[[63961,63961],"mapped",[24900]],[[63962,63962],"mapped",[26647]],[[63963,63963],"mapped",[29575]],[[63964,63964],"mapped",[38534]],[[63965,63965],"mapped",[21033]],[[63966,63966],"mapped",[21519]],[[63967,63967],"mapped",[23653]],[[63968,63968],"mapped",[26131]],[[63969,63969],"mapped",[26446]],[[63970,63970],"mapped",[26792]],[[63971,63971],"mapped",[27877]],[[63972,63972],"mapped",[29702]],[[63973,63973],"mapped",[30178]],[[63974,63974],"mapped",[32633]],[[63975,63975],"mapped",[35023]],[[63976,63976],"mapped",[35041]],[[63977,63977],"mapped",[37324]],[[63978,63978],"mapped",[38626]],[[63979,63979],"mapped",[21311]],[[63980,63980],"mapped",[28346]],[[63981,63981],"mapped",[21533]],[[63982,63982],"mapped",[29136]],[[63983,63983],"mapped",[29848]],[[63984,63984],"mapped",[34298]],[[63985,63985],"mapped",[38563]],[[63986,63986],"mapped",[40023]],[[63987,63987],"mapped",[40607]],[[63988,63988],"mapped",[26519]],[[63989,63989],"mapped",[28107]],[[63990,63990],"mapped",[33256]],[[63991,63991],"mapped",[31435]],[[63992,63992],"mapped",[31520]],[[63993,63993],"mapped",[31890]],[[63994,63994],"mapped",[29376]],[[63995,63995],"mapped",[28825]],[[63996,63996],"mapped",[35672]],[[63997,63997],"mapped",[20160]],[[63998,63998],"mapped",[33590]],[[63999,63999],"mapped",[21050]],[[64000,64000],"mapped",[20999]],[[64001,64001],"mapped",[24230]],[[64002,64002],"mapped",[25299]],[[64003,64003],"mapped",[31958]],[[64004,64004],"mapped",[23429]],[[64005,64005],"mapped",[27934]],[[64006,64006],"mapped",[26292]],[[64007,64007],"mapped",[36667]],[[64008,64008],"mapped",[34892]],[[64009,64009],"mapped",[38477]],[[64010,64010],"mapped",[35211]],[[64011,64011],"mapped",[24275]],[[64012,64012],"mapped",[20800]],[[64013,64013],"mapped",[21952]],[[64014,64015],"valid"],[[64016,64016],"mapped",[22618]],[[64017,64017],"valid"],[[64018,64018],"mapped",[26228]],[[64019,64020],"valid"],[[64021,64021],"mapped",[20958]],[[64022,64022],"mapped",[29482]],[[64023,64023],"mapped",[30410]],[[64024,64024],"mapped",[31036]],[[64025,64025],"mapped",[31070]],[[64026,64026],"mapped",[31077]],[[64027,64027],"mapped",[31119]],[[64028,64028],"mapped",[38742]],[[64029,64029],"mapped",[31934]],[[64030,64030],"mapped",[32701]],[[64031,64031],"valid"],[[64032,64032],"mapped",[34322]],[[64033,64033],"valid"],[[64034,64034],"mapped",[35576]],[[64035,64036],"valid"],[[64037,64037],"mapped",[36920]],[[64038,64038],"mapped",[37117]],[[64039,64041],"valid"],[[64042,64042],"mapped",[39151]],[[64043,64043],"mapped",[39164]],[[64044,64044],"mapped",[39208]],[[64045,64045],"mapped",[40372]],[[64046,64046],"mapped",[37086]],[[64047,64047],"mapped",[38583]],[[64048,64048],"mapped",[20398]],[[64049,64049],"mapped",[20711]],[[64050,64050],"mapped",[20813]],[[64051,64051],"mapped",[21193]],[[64052,64052],"mapped",[21220]],[[64053,64053],"mapped",[21329]],[[64054,64054],"mapped",[21917]],[[64055,64055],"mapped",[22022]],[[64056,64056],"mapped",[22120]],[[64057,64057],"mapped",[22592]],[[64058,64058],"mapped",[22696]],[[64059,64059],"mapped",[23652]],[[64060,64060],"mapped",[23662]],[[64061,64061],"mapped",[24724]],[[64062,64062],"mapped",[24936]],[[64063,64063],"mapped",[24974]],[[64064,64064],"mapped",[25074]],[[64065,64065],"mapped",[25935]],[[64066,64066],"mapped",[26082]],[[64067,64067],"mapped",[26257]],[[64068,64068],"mapped",[26757]],[[64069,64069],"mapped",[28023]],[[64070,64070],"mapped",[28186]],[[64071,64071],"mapped",[28450]],[[64072,64072],"mapped",[29038]],[[64073,64073],"mapped",[29227]],[[64074,64074],"mapped",[29730]],[[64075,64075],"mapped",[30865]],[[64076,64076],"mapped",[31038]],[[64077,64077],"mapped",[31049]],[[64078,64078],"mapped",[31048]],[[64079,64079],"mapped",[31056]],[[64080,64080],"mapped",[31062]],[[64081,64081],"mapped",[31069]],[[64082,64082],"mapped",[31117]],[[64083,64083],"mapped",[31118]],[[64084,64084],"mapped",[31296]],[[64085,64085],"mapped",[31361]],[[64086,64086],"mapped",[31680]],[[64087,64087],"mapped",[32244]],[[64088,64088],"mapped",[32265]],[[64089,64089],"mapped",[32321]],[[64090,64090],"mapped",[32626]],[[64091,64091],"mapped",[32773]],[[64092,64092],"mapped",[33261]],[[64093,64094],"mapped",[33401]],[[64095,64095],"mapped",[33879]],[[64096,64096],"mapped",[35088]],[[64097,64097],"mapped",[35222]],[[64098,64098],"mapped",[35585]],[[64099,64099],"mapped",[35641]],[[64100,64100],"mapped",[36051]],[[64101,64101],"mapped",[36104]],[[64102,64102],"mapped",[36790]],[[64103,64103],"mapped",[36920]],[[64104,64104],"mapped",[38627]],[[64105,64105],"mapped",[38911]],[[64106,64106],"mapped",[38971]],[[64107,64107],"mapped",[24693]],[[64108,64108],"mapped",[148206]],[[64109,64109],"mapped",[33304]],[[64110,64111],"disallowed"],[[64112,64112],"mapped",[20006]],[[64113,64113],"mapped",[20917]],[[64114,64114],"mapped",[20840]],[[64115,64115],"mapped",[20352]],[[64116,64116],"mapped",[20805]],[[64117,64117],"mapped",[20864]],[[64118,64118],"mapped",[21191]],[[64119,64119],"mapped",[21242]],[[64120,64120],"mapped",[21917]],[[64121,64121],"mapped",[21845]],[[64122,64122],"mapped",[21913]],[[64123,64123],"mapped",[21986]],[[64124,64124],"mapped",[22618]],[[64125,64125],"mapped",[22707]],[[64126,64126],"mapped",[22852]],[[64127,64127],"mapped",[22868]],[[64128,64128],"mapped",[23138]],[[64129,64129],"mapped",[23336]],[[64130,64130],"mapped",[24274]],[[64131,64131],"mapped",[24281]],[[64132,64132],"mapped",[24425]],[[64133,64133],"mapped",[24493]],[[64134,64134],"mapped",[24792]],[[64135,64135],"mapped",[24910]],[[64136,64136],"mapped",[24840]],[[64137,64137],"mapped",[24974]],[[64138,64138],"mapped",[24928]],[[64139,64139],"mapped",[25074]],[[64140,64140],"mapped",[25140]],[[64141,64141],"mapped",[25540]],[[64142,64142],"mapped",[25628]],[[64143,64143],"mapped",[25682]],[[64144,64144],"mapped",[25942]],[[64145,64145],"mapped",[26228]],[[64146,64146],"mapped",[26391]],[[64147,64147],"mapped",[26395]],[[64148,64148],"mapped",[26454]],[[64149,64149],"mapped",[27513]],[[64150,64150],"mapped",[27578]],[[64151,64151],"mapped",[27969]],[[64152,64152],"mapped",[28379]],[[64153,64153],"mapped",[28363]],[[64154,64154],"mapped",[28450]],[[64155,64155],"mapped",[28702]],[[64156,64156],"mapped",[29038]],[[64157,64157],"mapped",[30631]],[[64158,64158],"mapped",[29237]],[[64159,64159],"mapped",[29359]],[[64160,64160],"mapped",[29482]],[[64161,64161],"mapped",[29809]],[[64162,64162],"mapped",[29958]],[[64163,64163],"mapped",[30011]],[[64164,64164],"mapped",[30237]],[[64165,64165],"mapped",[30239]],[[64166,64166],"mapped",[30410]],[[64167,64167],"mapped",[30427]],[[64168,64168],"mapped",[30452]],[[64169,64169],"mapped",[30538]],[[64170,64170],"mapped",[30528]],[[64171,64171],"mapped",[30924]],[[64172,64172],"mapped",[31409]],[[64173,64173],"mapped",[31680]],[[64174,64174],"mapped",[31867]],[[64175,64175],"mapped",[32091]],[[64176,64176],"mapped",[32244]],[[64177,64177],"mapped",[32574]],[[64178,64178],"mapped",[32773]],[[64179,64179],"mapped",[33618]],[[64180,64180],"mapped",[33775]],[[64181,64181],"mapped",[34681]],[[64182,64182],"mapped",[35137]],[[64183,64183],"mapped",[35206]],[[64184,64184],"mapped",[35222]],[[64185,64185],"mapped",[35519]],[[64186,64186],"mapped",[35576]],[[64187,64187],"mapped",[35531]],[[64188,64188],"mapped",[35585]],[[64189,64189],"mapped",[35582]],[[64190,64190],"mapped",[35565]],[[64191,64191],"mapped",[35641]],[[64192,64192],"mapped",[35722]],[[64193,64193],"mapped",[36104]],[[64194,64194],"mapped",[36664]],[[64195,64195],"mapped",[36978]],[[64196,64196],"mapped",[37273]],[[64197,64197],"mapped",[37494]],[[64198,64198],"mapped",[38524]],[[64199,64199],"mapped",[38627]],[[64200,64200],"mapped",[38742]],[[64201,64201],"mapped",[38875]],[[64202,64202],"mapped",[38911]],[[64203,64203],"mapped",[38923]],[[64204,64204],"mapped",[38971]],[[64205,64205],"mapped",[39698]],[[64206,64206],"mapped",[40860]],[[64207,64207],"mapped",[141386]],[[64208,64208],"mapped",[141380]],[[64209,64209],"mapped",[144341]],[[64210,64210],"mapped",[15261]],[[64211,64211],"mapped",[16408]],[[64212,64212],"mapped",[16441]],[[64213,64213],"mapped",[152137]],[[64214,64214],"mapped",[154832]],[[64215,64215],"mapped",[163539]],[[64216,64216],"mapped",[40771]],[[64217,64217],"mapped",[40846]],[[64218,64255],"disallowed"],[[64256,64256],"mapped",[102,102]],[[64257,64257],"mapped",[102,105]],[[64258,64258],"mapped",[102,108]],[[64259,64259],"mapped",[102,102,105]],[[64260,64260],"mapped",[102,102,108]],[[64261,64262],"mapped",[115,116]],[[64263,64274],"disallowed"],[[64275,64275],"mapped",[1396,1398]],[[64276,64276],"mapped",[1396,1381]],[[64277,64277],"mapped",[1396,1387]],[[64278,64278],"mapped",[1406,1398]],[[64279,64279],"mapped",[1396,1389]],[[64280,64284],"disallowed"],[[64285,64285],"mapped",[1497,1460]],[[64286,64286],"valid"],[[64287,64287],"mapped",[1522,1463]],[[64288,64288],"mapped",[1506]],[[64289,64289],"mapped",[1488]],[[64290,64290],"mapped",[1491]],[[64291,64291],"mapped",[1492]],[[64292,64292],"mapped",[1499]],[[64293,64293],"mapped",[1500]],[[64294,64294],"mapped",[1501]],[[64295,64295],"mapped",[1512]],[[64296,64296],"mapped",[1514]],[[64297,64297],"disallowed_STD3_mapped",[43]],[[64298,64298],"mapped",[1513,1473]],[[64299,64299],"mapped",[1513,1474]],[[64300,64300],"mapped",[1513,1468,1473]],[[64301,64301],"mapped",[1513,1468,1474]],[[64302,64302],"mapped",[1488,1463]],[[64303,64303],"mapped",[1488,1464]],[[64304,64304],"mapped",[1488,1468]],[[64305,64305],"mapped",[1489,1468]],[[64306,64306],"mapped",[1490,1468]],[[64307,64307],"mapped",[1491,1468]],[[64308,64308],"mapped",[1492,1468]],[[64309,64309],"mapped",[1493,1468]],[[64310,64310],"mapped",[1494,1468]],[[64311,64311],"disallowed"],[[64312,64312],"mapped",[1496,1468]],[[64313,64313],"mapped",[1497,1468]],[[64314,64314],"mapped",[1498,1468]],[[64315,64315],"mapped",[1499,1468]],[[64316,64316],"mapped",[1500,1468]],[[64317,64317],"disallowed"],[[64318,64318],"mapped",[1502,1468]],[[64319,64319],"disallowed"],[[64320,64320],"mapped",[1504,1468]],[[64321,64321],"mapped",[1505,1468]],[[64322,64322],"disallowed"],[[64323,64323],"mapped",[1507,1468]],[[64324,64324],"mapped",[1508,1468]],[[64325,64325],"disallowed"],[[64326,64326],"mapped",[1510,1468]],[[64327,64327],"mapped",[1511,1468]],[[64328,64328],"mapped",[1512,1468]],[[64329,64329],"mapped",[1513,1468]],[[64330,64330],"mapped",[1514,1468]],[[64331,64331],"mapped",[1493,1465]],[[64332,64332],"mapped",[1489,1471]],[[64333,64333],"mapped",[1499,1471]],[[64334,64334],"mapped",[1508,1471]],[[64335,64335],"mapped",[1488,1500]],[[64336,64337],"mapped",[1649]],[[64338,64341],"mapped",[1659]],[[64342,64345],"mapped",[1662]],[[64346,64349],"mapped",[1664]],[[64350,64353],"mapped",[1658]],[[64354,64357],"mapped",[1663]],[[64358,64361],"mapped",[1657]],[[64362,64365],"mapped",[1700]],[[64366,64369],"mapped",[1702]],[[64370,64373],"mapped",[1668]],[[64374,64377],"mapped",[1667]],[[64378,64381],"mapped",[1670]],[[64382,64385],"mapped",[1671]],[[64386,64387],"mapped",[1677]],[[64388,64389],"mapped",[1676]],[[64390,64391],"mapped",[1678]],[[64392,64393],"mapped",[1672]],[[64394,64395],"mapped",[1688]],[[64396,64397],"mapped",[1681]],[[64398,64401],"mapped",[1705]],[[64402,64405],"mapped",[1711]],[[64406,64409],"mapped",[1715]],[[64410,64413],"mapped",[1713]],[[64414,64415],"mapped",[1722]],[[64416,64419],"mapped",[1723]],[[64420,64421],"mapped",[1728]],[[64422,64425],"mapped",[1729]],[[64426,64429],"mapped",[1726]],[[64430,64431],"mapped",[1746]],[[64432,64433],"mapped",[1747]],[[64434,64449],"valid",[],"NV8"],[[64450,64466],"disallowed"],[[64467,64470],"mapped",[1709]],[[64471,64472],"mapped",[1735]],[[64473,64474],"mapped",[1734]],[[64475,64476],"mapped",[1736]],[[64477,64477],"mapped",[1735,1652]],[[64478,64479],"mapped",[1739]],[[64480,64481],"mapped",[1733]],[[64482,64483],"mapped",[1737]],[[64484,64487],"mapped",[1744]],[[64488,64489],"mapped",[1609]],[[64490,64491],"mapped",[1574,1575]],[[64492,64493],"mapped",[1574,1749]],[[64494,64495],"mapped",[1574,1608]],[[64496,64497],"mapped",[1574,1735]],[[64498,64499],"mapped",[1574,1734]],[[64500,64501],"mapped",[1574,1736]],[[64502,64504],"mapped",[1574,1744]],[[64505,64507],"mapped",[1574,1609]],[[64508,64511],"mapped",[1740]],[[64512,64512],"mapped",[1574,1580]],[[64513,64513],"mapped",[1574,1581]],[[64514,64514],"mapped",[1574,1605]],[[64515,64515],"mapped",[1574,1609]],[[64516,64516],"mapped",[1574,1610]],[[64517,64517],"mapped",[1576,1580]],[[64518,64518],"mapped",[1576,1581]],[[64519,64519],"mapped",[1576,1582]],[[64520,64520],"mapped",[1576,1605]],[[64521,64521],"mapped",[1576,1609]],[[64522,64522],"mapped",[1576,1610]],[[64523,64523],"mapped",[1578,1580]],[[64524,64524],"mapped",[1578,1581]],[[64525,64525],"mapped",[1578,1582]],[[64526,64526],"mapped",[1578,1605]],[[64527,64527],"mapped",[1578,1609]],[[64528,64528],"mapped",[1578,1610]],[[64529,64529],"mapped",[1579,1580]],[[64530,64530],"mapped",[1579,1605]],[[64531,64531],"mapped",[1579,1609]],[[64532,64532],"mapped",[1579,1610]],[[64533,64533],"mapped",[1580,1581]],[[64534,64534],"mapped",[1580,1605]],[[64535,64535],"mapped",[1581,1580]],[[64536,64536],"mapped",[1581,1605]],[[64537,64537],"mapped",[1582,1580]],[[64538,64538],"mapped",[1582,1581]],[[64539,64539],"mapped",[1582,1605]],[[64540,64540],"mapped",[1587,1580]],[[64541,64541],"mapped",[1587,1581]],[[64542,64542],"mapped",[1587,1582]],[[64543,64543],"mapped",[1587,1605]],[[64544,64544],"mapped",[1589,1581]],[[64545,64545],"mapped",[1589,1605]],[[64546,64546],"mapped",[1590,1580]],[[64547,64547],"mapped",[1590,1581]],[[64548,64548],"mapped",[1590,1582]],[[64549,64549],"mapped",[1590,1605]],[[64550,64550],"mapped",[1591,1581]],[[64551,64551],"mapped",[1591,1605]],[[64552,64552],"mapped",[1592,1605]],[[64553,64553],"mapped",[1593,1580]],[[64554,64554],"mapped",[1593,1605]],[[64555,64555],"mapped",[1594,1580]],[[64556,64556],"mapped",[1594,1605]],[[64557,64557],"mapped",[1601,1580]],[[64558,64558],"mapped",[1601,1581]],[[64559,64559],"mapped",[1601,1582]],[[64560,64560],"mapped",[1601,1605]],[[64561,64561],"mapped",[1601,1609]],[[64562,64562],"mapped",[1601,1610]],[[64563,64563],"mapped",[1602,1581]],[[64564,64564],"mapped",[1602,1605]],[[64565,64565],"mapped",[1602,1609]],[[64566,64566],"mapped",[1602,1610]],[[64567,64567],"mapped",[1603,1575]],[[64568,64568],"mapped",[1603,1580]],[[64569,64569],"mapped",[1603,1581]],[[64570,64570],"mapped",[1603,1582]],[[64571,64571],"mapped",[1603,1604]],[[64572,64572],"mapped",[1603,1605]],[[64573,64573],"mapped",[1603,1609]],[[64574,64574],"mapped",[1603,1610]],[[64575,64575],"mapped",[1604,1580]],[[64576,64576],"mapped",[1604,1581]],[[64577,64577],"mapped",[1604,1582]],[[64578,64578],"mapped",[1604,1605]],[[64579,64579],"mapped",[1604,1609]],[[64580,64580],"mapped",[1604,1610]],[[64581,64581],"mapped",[1605,1580]],[[64582,64582],"mapped",[1605,1581]],[[64583,64583],"mapped",[1605,1582]],[[64584,64584],"mapped",[1605,1605]],[[64585,64585],"mapped",[1605,1609]],[[64586,64586],"mapped",[1605,1610]],[[64587,64587],"mapped",[1606,1580]],[[64588,64588],"mapped",[1606,1581]],[[64589,64589],"mapped",[1606,1582]],[[64590,64590],"mapped",[1606,1605]],[[64591,64591],"mapped",[1606,1609]],[[64592,64592],"mapped",[1606,1610]],[[64593,64593],"mapped",[1607,1580]],[[64594,64594],"mapped",[1607,1605]],[[64595,64595],"mapped",[1607,1609]],[[64596,64596],"mapped",[1607,1610]],[[64597,64597],"mapped",[1610,1580]],[[64598,64598],"mapped",[1610,1581]],[[64599,64599],"mapped",[1610,1582]],[[64600,64600],"mapped",[1610,1605]],[[64601,64601],"mapped",[1610,1609]],[[64602,64602],"mapped",[1610,1610]],[[64603,64603],"mapped",[1584,1648]],[[64604,64604],"mapped",[1585,1648]],[[64605,64605],"mapped",[1609,1648]],[[64606,64606],"disallowed_STD3_mapped",[32,1612,1617]],[[64607,64607],"disallowed_STD3_mapped",[32,1613,1617]],[[64608,64608],"disallowed_STD3_mapped",[32,1614,1617]],[[64609,64609],"disallowed_STD3_mapped",[32,1615,1617]],[[64610,64610],"disallowed_STD3_mapped",[32,1616,1617]],[[64611,64611],"disallowed_STD3_mapped",[32,1617,1648]],[[64612,64612],"mapped",[1574,1585]],[[64613,64613],"mapped",[1574,1586]],[[64614,64614],"mapped",[1574,1605]],[[64615,64615],"mapped",[1574,1606]],[[64616,64616],"mapped",[1574,1609]],[[64617,64617],"mapped",[1574,1610]],[[64618,64618],"mapped",[1576,1585]],[[64619,64619],"mapped",[1576,1586]],[[64620,64620],"mapped",[1576,1605]],[[64621,64621],"mapped",[1576,1606]],[[64622,64622],"mapped",[1576,1609]],[[64623,64623],"mapped",[1576,1610]],[[64624,64624],"mapped",[1578,1585]],[[64625,64625],"mapped",[1578,1586]],[[64626,64626],"mapped",[1578,1605]],[[64627,64627],"mapped",[1578,1606]],[[64628,64628],"mapped",[1578,1609]],[[64629,64629],"mapped",[1578,1610]],[[64630,64630],"mapped",[1579,1585]],[[64631,64631],"mapped",[1579,1586]],[[64632,64632],"mapped",[1579,1605]],[[64633,64633],"mapped",[1579,1606]],[[64634,64634],"mapped",[1579,1609]],[[64635,64635],"mapped",[1579,1610]],[[64636,64636],"mapped",[1601,1609]],[[64637,64637],"mapped",[1601,1610]],[[64638,64638],"mapped",[1602,1609]],[[64639,64639],"mapped",[1602,1610]],[[64640,64640],"mapped",[1603,1575]],[[64641,64641],"mapped",[1603,1604]],[[64642,64642],"mapped",[1603,1605]],[[64643,64643],"mapped",[1603,1609]],[[64644,64644],"mapped",[1603,1610]],[[64645,64645],"mapped",[1604,1605]],[[64646,64646],"mapped",[1604,1609]],[[64647,64647],"mapped",[1604,1610]],[[64648,64648],"mapped",[1605,1575]],[[64649,64649],"mapped",[1605,1605]],[[64650,64650],"mapped",[1606,1585]],[[64651,64651],"mapped",[1606,1586]],[[64652,64652],"mapped",[1606,1605]],[[64653,64653],"mapped",[1606,1606]],[[64654,64654],"mapped",[1606,1609]],[[64655,64655],"mapped",[1606,1610]],[[64656,64656],"mapped",[1609,1648]],[[64657,64657],"mapped",[1610,1585]],[[64658,64658],"mapped",[1610,1586]],[[64659,64659],"mapped",[1610,1605]],[[64660,64660],"mapped",[1610,1606]],[[64661,64661],"mapped",[1610,1609]],[[64662,64662],"mapped",[1610,1610]],[[64663,64663],"mapped",[1574,1580]],[[64664,64664],"mapped",[1574,1581]],[[64665,64665],"mapped",[1574,1582]],[[64666,64666],"mapped",[1574,1605]],[[64667,64667],"mapped",[1574,1607]],[[64668,64668],"mapped",[1576,1580]],[[64669,64669],"mapped",[1576,1581]],[[64670,64670],"mapped",[1576,1582]],[[64671,64671],"mapped",[1576,1605]],[[64672,64672],"mapped",[1576,1607]],[[64673,64673],"mapped",[1578,1580]],[[64674,64674],"mapped",[1578,1581]],[[64675,64675],"mapped",[1578,1582]],[[64676,64676],"mapped",[1578,1605]],[[64677,64677],"mapped",[1578,1607]],[[64678,64678],"mapped",[1579,1605]],[[64679,64679],"mapped",[1580,1581]],[[64680,64680],"mapped",[1580,1605]],[[64681,64681],"mapped",[1581,1580]],[[64682,64682],"mapped",[1581,1605]],[[64683,64683],"mapped",[1582,1580]],[[64684,64684],"mapped",[1582,1605]],[[64685,64685],"mapped",[1587,1580]],[[64686,64686],"mapped",[1587,1581]],[[64687,64687],"mapped",[1587,1582]],[[64688,64688],"mapped",[1587,1605]],[[64689,64689],"mapped",[1589,1581]],[[64690,64690],"mapped",[1589,1582]],[[64691,64691],"mapped",[1589,1605]],[[64692,64692],"mapped",[1590,1580]],[[64693,64693],"mapped",[1590,1581]],[[64694,64694],"mapped",[1590,1582]],[[64695,64695],"mapped",[1590,1605]],[[64696,64696],"mapped",[1591,1581]],[[64697,64697],"mapped",[1592,1605]],[[64698,64698],"mapped",[1593,1580]],[[64699,64699],"mapped",[1593,1605]],[[64700,64700],"mapped",[1594,1580]],[[64701,64701],"mapped",[1594,1605]],[[64702,64702],"mapped",[1601,1580]],[[64703,64703],"mapped",[1601,1581]],[[64704,64704],"mapped",[1601,1582]],[[64705,64705],"mapped",[1601,1605]],[[64706,64706],"mapped",[1602,1581]],[[64707,64707],"mapped",[1602,1605]],[[64708,64708],"mapped",[1603,1580]],[[64709,64709],"mapped",[1603,1581]],[[64710,64710],"mapped",[1603,1582]],[[64711,64711],"mapped",[1603,1604]],[[64712,64712],"mapped",[1603,1605]],[[64713,64713],"mapped",[1604,1580]],[[64714,64714],"mapped",[1604,1581]],[[64715,64715],"mapped",[1604,1582]],[[64716,64716],"mapped",[1604,1605]],[[64717,64717],"mapped",[1604,1607]],[[64718,64718],"mapped",[1605,1580]],[[64719,64719],"mapped",[1605,1581]],[[64720,64720],"mapped",[1605,1582]],[[64721,64721],"mapped",[1605,1605]],[[64722,64722],"mapped",[1606,1580]],[[64723,64723],"mapped",[1606,1581]],[[64724,64724],"mapped",[1606,1582]],[[64725,64725],"mapped",[1606,1605]],[[64726,64726],"mapped",[1606,1607]],[[64727,64727],"mapped",[1607,1580]],[[64728,64728],"mapped",[1607,1605]],[[64729,64729],"mapped",[1607,1648]],[[64730,64730],"mapped",[1610,1580]],[[64731,64731],"mapped",[1610,1581]],[[64732,64732],"mapped",[1610,1582]],[[64733,64733],"mapped",[1610,1605]],[[64734,64734],"mapped",[1610,1607]],[[64735,64735],"mapped",[1574,1605]],[[64736,64736],"mapped",[1574,1607]],[[64737,64737],"mapped",[1576,1605]],[[64738,64738],"mapped",[1576,1607]],[[64739,64739],"mapped",[1578,1605]],[[64740,64740],"mapped",[1578,1607]],[[64741,64741],"mapped",[1579,1605]],[[64742,64742],"mapped",[1579,1607]],[[64743,64743],"mapped",[1587,1605]],[[64744,64744],"mapped",[1587,1607]],[[64745,64745],"mapped",[1588,1605]],[[64746,64746],"mapped",[1588,1607]],[[64747,64747],"mapped",[1603,1604]],[[64748,64748],"mapped",[1603,1605]],[[64749,64749],"mapped",[1604,1605]],[[64750,64750],"mapped",[1606,1605]],[[64751,64751],"mapped",[1606,1607]],[[64752,64752],"mapped",[1610,1605]],[[64753,64753],"mapped",[1610,1607]],[[64754,64754],"mapped",[1600,1614,1617]],[[64755,64755],"mapped",[1600,1615,1617]],[[64756,64756],"mapped",[1600,1616,1617]],[[64757,64757],"mapped",[1591,1609]],[[64758,64758],"mapped",[1591,1610]],[[64759,64759],"mapped",[1593,1609]],[[64760,64760],"mapped",[1593,1610]],[[64761,64761],"mapped",[1594,1609]],[[64762,64762],"mapped",[1594,1610]],[[64763,64763],"mapped",[1587,1609]],[[64764,64764],"mapped",[1587,1610]],[[64765,64765],"mapped",[1588,1609]],[[64766,64766],"mapped",[1588,1610]],[[64767,64767],"mapped",[1581,1609]],[[64768,64768],"mapped",[1581,1610]],[[64769,64769],"mapped",[1580,1609]],[[64770,64770],"mapped",[1580,1610]],[[64771,64771],"mapped",[1582,1609]],[[64772,64772],"mapped",[1582,1610]],[[64773,64773],"mapped",[1589,1609]],[[64774,64774],"mapped",[1589,1610]],[[64775,64775],"mapped",[1590,1609]],[[64776,64776],"mapped",[1590,1610]],[[64777,64777],"mapped",[1588,1580]],[[64778,64778],"mapped",[1588,1581]],[[64779,64779],"mapped",[1588,1582]],[[64780,64780],"mapped",[1588,1605]],[[64781,64781],"mapped",[1588,1585]],[[64782,64782],"mapped",[1587,1585]],[[64783,64783],"mapped",[1589,1585]],[[64784,64784],"mapped",[1590,1585]],[[64785,64785],"mapped",[1591,1609]],[[64786,64786],"mapped",[1591,1610]],[[64787,64787],"mapped",[1593,1609]],[[64788,64788],"mapped",[1593,1610]],[[64789,64789],"mapped",[1594,1609]],[[64790,64790],"mapped",[1594,1610]],[[64791,64791],"mapped",[1587,1609]],[[64792,64792],"mapped",[1587,1610]],[[64793,64793],"mapped",[1588,1609]],[[64794,64794],"mapped",[1588,1610]],[[64795,64795],"mapped",[1581,1609]],[[64796,64796],"mapped",[1581,1610]],[[64797,64797],"mapped",[1580,1609]],[[64798,64798],"mapped",[1580,1610]],[[64799,64799],"mapped",[1582,1609]],[[64800,64800],"mapped",[1582,1610]],[[64801,64801],"mapped",[1589,1609]],[[64802,64802],"mapped",[1589,1610]],[[64803,64803],"mapped",[1590,1609]],[[64804,64804],"mapped",[1590,1610]],[[64805,64805],"mapped",[1588,1580]],[[64806,64806],"mapped",[1588,1581]],[[64807,64807],"mapped",[1588,1582]],[[64808,64808],"mapped",[1588,1605]],[[64809,64809],"mapped",[1588,1585]],[[64810,64810],"mapped",[1587,1585]],[[64811,64811],"mapped",[1589,1585]],[[64812,64812],"mapped",[1590,1585]],[[64813,64813],"mapped",[1588,1580]],[[64814,64814],"mapped",[1588,1581]],[[64815,64815],"mapped",[1588,1582]],[[64816,64816],"mapped",[1588,1605]],[[64817,64817],"mapped",[1587,1607]],[[64818,64818],"mapped",[1588,1607]],[[64819,64819],"mapped",[1591,1605]],[[64820,64820],"mapped",[1587,1580]],[[64821,64821],"mapped",[1587,1581]],[[64822,64822],"mapped",[1587,1582]],[[64823,64823],"mapped",[1588,1580]],[[64824,64824],"mapped",[1588,1581]],[[64825,64825],"mapped",[1588,1582]],[[64826,64826],"mapped",[1591,1605]],[[64827,64827],"mapped",[1592,1605]],[[64828,64829],"mapped",[1575,1611]],[[64830,64831],"valid",[],"NV8"],[[64832,64847],"disallowed"],[[64848,64848],"mapped",[1578,1580,1605]],[[64849,64850],"mapped",[1578,1581,1580]],[[64851,64851],"mapped",[1578,1581,1605]],[[64852,64852],"mapped",[1578,1582,1605]],[[64853,64853],"mapped",[1578,1605,1580]],[[64854,64854],"mapped",[1578,1605,1581]],[[64855,64855],"mapped",[1578,1605,1582]],[[64856,64857],"mapped",[1580,1605,1581]],[[64858,64858],"mapped",[1581,1605,1610]],[[64859,64859],"mapped",[1581,1605,1609]],[[64860,64860],"mapped",[1587,1581,1580]],[[64861,64861],"mapped",[1587,1580,1581]],[[64862,64862],"mapped",[1587,1580,1609]],[[64863,64864],"mapped",[1587,1605,1581]],[[64865,64865],"mapped",[1587,1605,1580]],[[64866,64867],"mapped",[1587,1605,1605]],[[64868,64869],"mapped",[1589,1581,1581]],[[64870,64870],"mapped",[1589,1605,1605]],[[64871,64872],"mapped",[1588,1581,1605]],[[64873,64873],"mapped",[1588,1580,1610]],[[64874,64875],"mapped",[1588,1605,1582]],[[64876,64877],"mapped",[1588,1605,1605]],[[64878,64878],"mapped",[1590,1581,1609]],[[64879,64880],"mapped",[1590,1582,1605]],[[64881,64882],"mapped",[1591,1605,1581]],[[64883,64883],"mapped",[1591,1605,1605]],[[64884,64884],"mapped",[1591,1605,1610]],[[64885,64885],"mapped",[1593,1580,1605]],[[64886,64887],"mapped",[1593,1605,1605]],[[64888,64888],"mapped",[1593,1605,1609]],[[64889,64889],"mapped",[1594,1605,1605]],[[64890,64890],"mapped",[1594,1605,1610]],[[64891,64891],"mapped",[1594,1605,1609]],[[64892,64893],"mapped",[1601,1582,1605]],[[64894,64894],"mapped",[1602,1605,1581]],[[64895,64895],"mapped",[1602,1605,1605]],[[64896,64896],"mapped",[1604,1581,1605]],[[64897,64897],"mapped",[1604,1581,1610]],[[64898,64898],"mapped",[1604,1581,1609]],[[64899,64900],"mapped",[1604,1580,1580]],[[64901,64902],"mapped",[1604,1582,1605]],[[64903,64904],"mapped",[1604,1605,1581]],[[64905,64905],"mapped",[1605,1581,1580]],[[64906,64906],"mapped",[1605,1581,1605]],[[64907,64907],"mapped",[1605,1581,1610]],[[64908,64908],"mapped",[1605,1580,1581]],[[64909,64909],"mapped",[1605,1580,1605]],[[64910,64910],"mapped",[1605,1582,1580]],[[64911,64911],"mapped",[1605,1582,1605]],[[64912,64913],"disallowed"],[[64914,64914],"mapped",[1605,1580,1582]],[[64915,64915],"mapped",[1607,1605,1580]],[[64916,64916],"mapped",[1607,1605,1605]],[[64917,64917],"mapped",[1606,1581,1605]],[[64918,64918],"mapped",[1606,1581,1609]],[[64919,64920],"mapped",[1606,1580,1605]],[[64921,64921],"mapped",[1606,1580,1609]],[[64922,64922],"mapped",[1606,1605,1610]],[[64923,64923],"mapped",[1606,1605,1609]],[[64924,64925],"mapped",[1610,1605,1605]],[[64926,64926],"mapped",[1576,1582,1610]],[[64927,64927],"mapped",[1578,1580,1610]],[[64928,64928],"mapped",[1578,1580,1609]],[[64929,64929],"mapped",[1578,1582,1610]],[[64930,64930],"mapped",[1578,1582,1609]],[[64931,64931],"mapped",[1578,1605,1610]],[[64932,64932],"mapped",[1578,1605,1609]],[[64933,64933],"mapped",[1580,1605,1610]],[[64934,64934],"mapped",[1580,1581,1609]],[[64935,64935],"mapped",[1580,1605,1609]],[[64936,64936],"mapped",[1587,1582,1609]],[[64937,64937],"mapped",[1589,1581,1610]],[[64938,64938],"mapped",[1588,1581,1610]],[[64939,64939],"mapped",[1590,1581,1610]],[[64940,64940],"mapped",[1604,1580,1610]],[[64941,64941],"mapped",[1604,1605,1610]],[[64942,64942],"mapped",[1610,1581,1610]],[[64943,64943],"mapped",[1610,1580,1610]],[[64944,64944],"mapped",[1610,1605,1610]],[[64945,64945],"mapped",[1605,1605,1610]],[[64946,64946],"mapped",[1602,1605,1610]],[[64947,64947],"mapped",[1606,1581,1610]],[[64948,64948],"mapped",[1602,1605,1581]],[[64949,64949],"mapped",[1604,1581,1605]],[[64950,64950],"mapped",[1593,1605,1610]],[[64951,64951],"mapped",[1603,1605,1610]],[[64952,64952],"mapped",[1606,1580,1581]],[[64953,64953],"mapped",[1605,1582,1610]],[[64954,64954],"mapped",[1604,1580,1605]],[[64955,64955],"mapped",[1603,1605,1605]],[[64956,64956],"mapped",[1604,1580,1605]],[[64957,64957],"mapped",[1606,1580,1581]],[[64958,64958],"mapped",[1580,1581,1610]],[[64959,64959],"mapped",[1581,1580,1610]],[[64960,64960],"mapped",[1605,1580,1610]],[[64961,64961],"mapped",[1601,1605,1610]],[[64962,64962],"mapped",[1576,1581,1610]],[[64963,64963],"mapped",[1603,1605,1605]],[[64964,64964],"mapped",[1593,1580,1605]],[[64965,64965],"mapped",[1589,1605,1605]],[[64966,64966],"mapped",[1587,1582,1610]],[[64967,64967],"mapped",[1606,1580,1610]],[[64968,64975],"disallowed"],[[64976,65007],"disallowed"],[[65008,65008],"mapped",[1589,1604,1746]],[[65009,65009],"mapped",[1602,1604,1746]],[[65010,65010],"mapped",[1575,1604,1604,1607]],[[65011,65011],"mapped",[1575,1603,1576,1585]],[[65012,65012],"mapped",[1605,1581,1605,1583]],[[65013,65013],"mapped",[1589,1604,1593,1605]],[[65014,65014],"mapped",[1585,1587,1608,1604]],[[65015,65015],"mapped",[1593,1604,1610,1607]],[[65016,65016],"mapped",[1608,1587,1604,1605]],[[65017,65017],"mapped",[1589,1604,1609]],[[65018,65018],"disallowed_STD3_mapped",[1589,1604,1609,32,1575,1604,1604,1607,32,1593,1604,1610,1607,32,1608,1587,1604,1605]],[[65019,65019],"disallowed_STD3_mapped",[1580,1604,32,1580,1604,1575,1604,1607]],[[65020,65020],"mapped",[1585,1740,1575,1604]],[[65021,65021],"valid",[],"NV8"],[[65022,65023],"disallowed"],[[65024,65039],"ignored"],[[65040,65040],"disallowed_STD3_mapped",[44]],[[65041,65041],"mapped",[12289]],[[65042,65042],"disallowed"],[[65043,65043],"disallowed_STD3_mapped",[58]],[[65044,65044],"disallowed_STD3_mapped",[59]],[[65045,65045],"disallowed_STD3_mapped",[33]],[[65046,65046],"disallowed_STD3_mapped",[63]],[[65047,65047],"mapped",[12310]],[[65048,65048],"mapped",[12311]],[[65049,65049],"disallowed"],[[65050,65055],"disallowed"],[[65056,65059],"valid"],[[65060,65062],"valid"],[[65063,65069],"valid"],[[65070,65071],"valid"],[[65072,65072],"disallowed"],[[65073,65073],"mapped",[8212]],[[65074,65074],"mapped",[8211]],[[65075,65076],"disallowed_STD3_mapped",[95]],[[65077,65077],"disallowed_STD3_mapped",[40]],[[65078,65078],"disallowed_STD3_mapped",[41]],[[65079,65079],"disallowed_STD3_mapped",[123]],[[65080,65080],"disallowed_STD3_mapped",[125]],[[65081,65081],"mapped",[12308]],[[65082,65082],"mapped",[12309]],[[65083,65083],"mapped",[12304]],[[65084,65084],"mapped",[12305]],[[65085,65085],"mapped",[12298]],[[65086,65086],"mapped",[12299]],[[65087,65087],"mapped",[12296]],[[65088,65088],"mapped",[12297]],[[65089,65089],"mapped",[12300]],[[65090,65090],"mapped",[12301]],[[65091,65091],"mapped",[12302]],[[65092,65092],"mapped",[12303]],[[65093,65094],"valid",[],"NV8"],[[65095,65095],"disallowed_STD3_mapped",[91]],[[65096,65096],"disallowed_STD3_mapped",[93]],[[65097,65100],"disallowed_STD3_mapped",[32,773]],[[65101,65103],"disallowed_STD3_mapped",[95]],[[65104,65104],"disallowed_STD3_mapped",[44]],[[65105,65105],"mapped",[12289]],[[65106,65106],"disallowed"],[[65107,65107],"disallowed"],[[65108,65108],"disallowed_STD3_mapped",[59]],[[65109,65109],"disallowed_STD3_mapped",[58]],[[65110,65110],"disallowed_STD3_mapped",[63]],[[65111,65111],"disallowed_STD3_mapped",[33]],[[65112,65112],"mapped",[8212]],[[65113,65113],"disallowed_STD3_mapped",[40]],[[65114,65114],"disallowed_STD3_mapped",[41]],[[65115,65115],"disallowed_STD3_mapped",[123]],[[65116,65116],"disallowed_STD3_mapped",[125]],[[65117,65117],"mapped",[12308]],[[65118,65118],"mapped",[12309]],[[65119,65119],"disallowed_STD3_mapped",[35]],[[65120,65120],"disallowed_STD3_mapped",[38]],[[65121,65121],"disallowed_STD3_mapped",[42]],[[65122,65122],"disallowed_STD3_mapped",[43]],[[65123,65123],"mapped",[45]],[[65124,65124],"disallowed_STD3_mapped",[60]],[[65125,65125],"disallowed_STD3_mapped",[62]],[[65126,65126],"disallowed_STD3_mapped",[61]],[[65127,65127],"disallowed"],[[65128,65128],"disallowed_STD3_mapped",[92]],[[65129,65129],"disallowed_STD3_mapped",[36]],[[65130,65130],"disallowed_STD3_mapped",[37]],[[65131,65131],"disallowed_STD3_mapped",[64]],[[65132,65135],"disallowed"],[[65136,65136],"disallowed_STD3_mapped",[32,1611]],[[65137,65137],"mapped",[1600,1611]],[[65138,65138],"disallowed_STD3_mapped",[32,1612]],[[65139,65139],"valid"],[[65140,65140],"disallowed_STD3_mapped",[32,1613]],[[65141,65141],"disallowed"],[[65142,65142],"disallowed_STD3_mapped",[32,1614]],[[65143,65143],"mapped",[1600,1614]],[[65144,65144],"disallowed_STD3_mapped",[32,1615]],[[65145,65145],"mapped",[1600,1615]],[[65146,65146],"disallowed_STD3_mapped",[32,1616]],[[65147,65147],"mapped",[1600,1616]],[[65148,65148],"disallowed_STD3_mapped",[32,1617]],[[65149,65149],"mapped",[1600,1617]],[[65150,65150],"disallowed_STD3_mapped",[32,1618]],[[65151,65151],"mapped",[1600,1618]],[[65152,65152],"mapped",[1569]],[[65153,65154],"mapped",[1570]],[[65155,65156],"mapped",[1571]],[[65157,65158],"mapped",[1572]],[[65159,65160],"mapped",[1573]],[[65161,65164],"mapped",[1574]],[[65165,65166],"mapped",[1575]],[[65167,65170],"mapped",[1576]],[[65171,65172],"mapped",[1577]],[[65173,65176],"mapped",[1578]],[[65177,65180],"mapped",[1579]],[[65181,65184],"mapped",[1580]],[[65185,65188],"mapped",[1581]],[[65189,65192],"mapped",[1582]],[[65193,65194],"mapped",[1583]],[[65195,65196],"mapped",[1584]],[[65197,65198],"mapped",[1585]],[[65199,65200],"mapped",[1586]],[[65201,65204],"mapped",[1587]],[[65205,65208],"mapped",[1588]],[[65209,65212],"mapped",[1589]],[[65213,65216],"mapped",[1590]],[[65217,65220],"mapped",[1591]],[[65221,65224],"mapped",[1592]],[[65225,65228],"mapped",[1593]],[[65229,65232],"mapped",[1594]],[[65233,65236],"mapped",[1601]],[[65237,65240],"mapped",[1602]],[[65241,65244],"mapped",[1603]],[[65245,65248],"mapped",[1604]],[[65249,65252],"mapped",[1605]],[[65253,65256],"mapped",[1606]],[[65257,65260],"mapped",[1607]],[[65261,65262],"mapped",[1608]],[[65263,65264],"mapped",[1609]],[[65265,65268],"mapped",[1610]],[[65269,65270],"mapped",[1604,1570]],[[65271,65272],"mapped",[1604,1571]],[[65273,65274],"mapped",[1604,1573]],[[65275,65276],"mapped",[1604,1575]],[[65277,65278],"disallowed"],[[65279,65279],"ignored"],[[65280,65280],"disallowed"],[[65281,65281],"disallowed_STD3_mapped",[33]],[[65282,65282],"disallowed_STD3_mapped",[34]],[[65283,65283],"disallowed_STD3_mapped",[35]],[[65284,65284],"disallowed_STD3_mapped",[36]],[[65285,65285],"disallowed_STD3_mapped",[37]],[[65286,65286],"disallowed_STD3_mapped",[38]],[[65287,65287],"disallowed_STD3_mapped",[39]],[[65288,65288],"disallowed_STD3_mapped",[40]],[[65289,65289],"disallowed_STD3_mapped",[41]],[[65290,65290],"disallowed_STD3_mapped",[42]],[[65291,65291],"disallowed_STD3_mapped",[43]],[[65292,65292],"disallowed_STD3_mapped",[44]],[[65293,65293],"mapped",[45]],[[65294,65294],"mapped",[46]],[[65295,65295],"disallowed_STD3_mapped",[47]],[[65296,65296],"mapped",[48]],[[65297,65297],"mapped",[49]],[[65298,65298],"mapped",[50]],[[65299,65299],"mapped",[51]],[[65300,65300],"mapped",[52]],[[65301,65301],"mapped",[53]],[[65302,65302],"mapped",[54]],[[65303,65303],"mapped",[55]],[[65304,65304],"mapped",[56]],[[65305,65305],"mapped",[57]],[[65306,65306],"disallowed_STD3_mapped",[58]],[[65307,65307],"disallowed_STD3_mapped",[59]],[[65308,65308],"disallowed_STD3_mapped",[60]],[[65309,65309],"disallowed_STD3_mapped",[61]],[[65310,65310],"disallowed_STD3_mapped",[62]],[[65311,65311],"disallowed_STD3_mapped",[63]],[[65312,65312],"disallowed_STD3_mapped",[64]],[[65313,65313],"mapped",[97]],[[65314,65314],"mapped",[98]],[[65315,65315],"mapped",[99]],[[65316,65316],"mapped",[100]],[[65317,65317],"mapped",[101]],[[65318,65318],"mapped",[102]],[[65319,65319],"mapped",[103]],[[65320,65320],"mapped",[104]],[[65321,65321],"mapped",[105]],[[65322,65322],"mapped",[106]],[[65323,65323],"mapped",[107]],[[65324,65324],"mapped",[108]],[[65325,65325],"mapped",[109]],[[65326,65326],"mapped",[110]],[[65327,65327],"mapped",[111]],[[65328,65328],"mapped",[112]],[[65329,65329],"mapped",[113]],[[65330,65330],"mapped",[114]],[[65331,65331],"mapped",[115]],[[65332,65332],"mapped",[116]],[[65333,65333],"mapped",[117]],[[65334,65334],"mapped",[118]],[[65335,65335],"mapped",[119]],[[65336,65336],"mapped",[120]],[[65337,65337],"mapped",[121]],[[65338,65338],"mapped",[122]],[[65339,65339],"disallowed_STD3_mapped",[91]],[[65340,65340],"disallowed_STD3_mapped",[92]],[[65341,65341],"disallowed_STD3_mapped",[93]],[[65342,65342],"disallowed_STD3_mapped",[94]],[[65343,65343],"disallowed_STD3_mapped",[95]],[[65344,65344],"disallowed_STD3_mapped",[96]],[[65345,65345],"mapped",[97]],[[65346,65346],"mapped",[98]],[[65347,65347],"mapped",[99]],[[65348,65348],"mapped",[100]],[[65349,65349],"mapped",[101]],[[65350,65350],"mapped",[102]],[[65351,65351],"mapped",[103]],[[65352,65352],"mapped",[104]],[[65353,65353],"mapped",[105]],[[65354,65354],"mapped",[106]],[[65355,65355],"mapped",[107]],[[65356,65356],"mapped",[108]],[[65357,65357],"mapped",[109]],[[65358,65358],"mapped",[110]],[[65359,65359],"mapped",[111]],[[65360,65360],"mapped",[112]],[[65361,65361],"mapped",[113]],[[65362,65362],"mapped",[114]],[[65363,65363],"mapped",[115]],[[65364,65364],"mapped",[116]],[[65365,65365],"mapped",[117]],[[65366,65366],"mapped",[118]],[[65367,65367],"mapped",[119]],[[65368,65368],"mapped",[120]],[[65369,65369],"mapped",[121]],[[65370,65370],"mapped",[122]],[[65371,65371],"disallowed_STD3_mapped",[123]],[[65372,65372],"disallowed_STD3_mapped",[124]],[[65373,65373],"disallowed_STD3_mapped",[125]],[[65374,65374],"disallowed_STD3_mapped",[126]],[[65375,65375],"mapped",[10629]],[[65376,65376],"mapped",[10630]],[[65377,65377],"mapped",[46]],[[65378,65378],"mapped",[12300]],[[65379,65379],"mapped",[12301]],[[65380,65380],"mapped",[12289]],[[65381,65381],"mapped",[12539]],[[65382,65382],"mapped",[12530]],[[65383,65383],"mapped",[12449]],[[65384,65384],"mapped",[12451]],[[65385,65385],"mapped",[12453]],[[65386,65386],"mapped",[12455]],[[65387,65387],"mapped",[12457]],[[65388,65388],"mapped",[12515]],[[65389,65389],"mapped",[12517]],[[65390,65390],"mapped",[12519]],[[65391,65391],"mapped",[12483]],[[65392,65392],"mapped",[12540]],[[65393,65393],"mapped",[12450]],[[65394,65394],"mapped",[12452]],[[65395,65395],"mapped",[12454]],[[65396,65396],"mapped",[12456]],[[65397,65397],"mapped",[12458]],[[65398,65398],"mapped",[12459]],[[65399,65399],"mapped",[12461]],[[65400,65400],"mapped",[12463]],[[65401,65401],"mapped",[12465]],[[65402,65402],"mapped",[12467]],[[65403,65403],"mapped",[12469]],[[65404,65404],"mapped",[12471]],[[65405,65405],"mapped",[12473]],[[65406,65406],"mapped",[12475]],[[65407,65407],"mapped",[12477]],[[65408,65408],"mapped",[12479]],[[65409,65409],"mapped",[12481]],[[65410,65410],"mapped",[12484]],[[65411,65411],"mapped",[12486]],[[65412,65412],"mapped",[12488]],[[65413,65413],"mapped",[12490]],[[65414,65414],"mapped",[12491]],[[65415,65415],"mapped",[12492]],[[65416,65416],"mapped",[12493]],[[65417,65417],"mapped",[12494]],[[65418,65418],"mapped",[12495]],[[65419,65419],"mapped",[12498]],[[65420,65420],"mapped",[12501]],[[65421,65421],"mapped",[12504]],[[65422,65422],"mapped",[12507]],[[65423,65423],"mapped",[12510]],[[65424,65424],"mapped",[12511]],[[65425,65425],"mapped",[12512]],[[65426,65426],"mapped",[12513]],[[65427,65427],"mapped",[12514]],[[65428,65428],"mapped",[12516]],[[65429,65429],"mapped",[12518]],[[65430,65430],"mapped",[12520]],[[65431,65431],"mapped",[12521]],[[65432,65432],"mapped",[12522]],[[65433,65433],"mapped",[12523]],[[65434,65434],"mapped",[12524]],[[65435,65435],"mapped",[12525]],[[65436,65436],"mapped",[12527]],[[65437,65437],"mapped",[12531]],[[65438,65438],"mapped",[12441]],[[65439,65439],"mapped",[12442]],[[65440,65440],"disallowed"],[[65441,65441],"mapped",[4352]],[[65442,65442],"mapped",[4353]],[[65443,65443],"mapped",[4522]],[[65444,65444],"mapped",[4354]],[[65445,65445],"mapped",[4524]],[[65446,65446],"mapped",[4525]],[[65447,65447],"mapped",[4355]],[[65448,65448],"mapped",[4356]],[[65449,65449],"mapped",[4357]],[[65450,65450],"mapped",[4528]],[[65451,65451],"mapped",[4529]],[[65452,65452],"mapped",[4530]],[[65453,65453],"mapped",[4531]],[[65454,65454],"mapped",[4532]],[[65455,65455],"mapped",[4533]],[[65456,65456],"mapped",[4378]],[[65457,65457],"mapped",[4358]],[[65458,65458],"mapped",[4359]],[[65459,65459],"mapped",[4360]],[[65460,65460],"mapped",[4385]],[[65461,65461],"mapped",[4361]],[[65462,65462],"mapped",[4362]],[[65463,65463],"mapped",[4363]],[[65464,65464],"mapped",[4364]],[[65465,65465],"mapped",[4365]],[[65466,65466],"mapped",[4366]],[[65467,65467],"mapped",[4367]],[[65468,65468],"mapped",[4368]],[[65469,65469],"mapped",[4369]],[[65470,65470],"mapped",[4370]],[[65471,65473],"disallowed"],[[65474,65474],"mapped",[4449]],[[65475,65475],"mapped",[4450]],[[65476,65476],"mapped",[4451]],[[65477,65477],"mapped",[4452]],[[65478,65478],"mapped",[4453]],[[65479,65479],"mapped",[4454]],[[65480,65481],"disallowed"],[[65482,65482],"mapped",[4455]],[[65483,65483],"mapped",[4456]],[[65484,65484],"mapped",[4457]],[[65485,65485],"mapped",[4458]],[[65486,65486],"mapped",[4459]],[[65487,65487],"mapped",[4460]],[[65488,65489],"disallowed"],[[65490,65490],"mapped",[4461]],[[65491,65491],"mapped",[4462]],[[65492,65492],"mapped",[4463]],[[65493,65493],"mapped",[4464]],[[65494,65494],"mapped",[4465]],[[65495,65495],"mapped",[4466]],[[65496,65497],"disallowed"],[[65498,65498],"mapped",[4467]],[[65499,65499],"mapped",[4468]],[[65500,65500],"mapped",[4469]],[[65501,65503],"disallowed"],[[65504,65504],"mapped",[162]],[[65505,65505],"mapped",[163]],[[65506,65506],"mapped",[172]],[[65507,65507],"disallowed_STD3_mapped",[32,772]],[[65508,65508],"mapped",[166]],[[65509,65509],"mapped",[165]],[[65510,65510],"mapped",[8361]],[[65511,65511],"disallowed"],[[65512,65512],"mapped",[9474]],[[65513,65513],"mapped",[8592]],[[65514,65514],"mapped",[8593]],[[65515,65515],"mapped",[8594]],[[65516,65516],"mapped",[8595]],[[65517,65517],"mapped",[9632]],[[65518,65518],"mapped",[9675]],[[65519,65528],"disallowed"],[[65529,65531],"disallowed"],[[65532,65532],"disallowed"],[[65533,65533],"disallowed"],[[65534,65535],"disallowed"],[[65536,65547],"valid"],[[65548,65548],"disallowed"],[[65549,65574],"valid"],[[65575,65575],"disallowed"],[[65576,65594],"valid"],[[65595,65595],"disallowed"],[[65596,65597],"valid"],[[65598,65598],"disallowed"],[[65599,65613],"valid"],[[65614,65615],"disallowed"],[[65616,65629],"valid"],[[65630,65663],"disallowed"],[[65664,65786],"valid"],[[65787,65791],"disallowed"],[[65792,65794],"valid",[],"NV8"],[[65795,65798],"disallowed"],[[65799,65843],"valid",[],"NV8"],[[65844,65846],"disallowed"],[[65847,65855],"valid",[],"NV8"],[[65856,65930],"valid",[],"NV8"],[[65931,65932],"valid",[],"NV8"],[[65933,65935],"disallowed"],[[65936,65947],"valid",[],"NV8"],[[65948,65951],"disallowed"],[[65952,65952],"valid",[],"NV8"],[[65953,65999],"disallowed"],[[66000,66044],"valid",[],"NV8"],[[66045,66045],"valid"],[[66046,66175],"disallowed"],[[66176,66204],"valid"],[[66205,66207],"disallowed"],[[66208,66256],"valid"],[[66257,66271],"disallowed"],[[66272,66272],"valid"],[[66273,66299],"valid",[],"NV8"],[[66300,66303],"disallowed"],[[66304,66334],"valid"],[[66335,66335],"valid"],[[66336,66339],"valid",[],"NV8"],[[66340,66351],"disallowed"],[[66352,66368],"valid"],[[66369,66369],"valid",[],"NV8"],[[66370,66377],"valid"],[[66378,66378],"valid",[],"NV8"],[[66379,66383],"disallowed"],[[66384,66426],"valid"],[[66427,66431],"disallowed"],[[66432,66461],"valid"],[[66462,66462],"disallowed"],[[66463,66463],"valid",[],"NV8"],[[66464,66499],"valid"],[[66500,66503],"disallowed"],[[66504,66511],"valid"],[[66512,66517],"valid",[],"NV8"],[[66518,66559],"disallowed"],[[66560,66560],"mapped",[66600]],[[66561,66561],"mapped",[66601]],[[66562,66562],"mapped",[66602]],[[66563,66563],"mapped",[66603]],[[66564,66564],"mapped",[66604]],[[66565,66565],"mapped",[66605]],[[66566,66566],"mapped",[66606]],[[66567,66567],"mapped",[66607]],[[66568,66568],"mapped",[66608]],[[66569,66569],"mapped",[66609]],[[66570,66570],"mapped",[66610]],[[66571,66571],"mapped",[66611]],[[66572,66572],"mapped",[66612]],[[66573,66573],"mapped",[66613]],[[66574,66574],"mapped",[66614]],[[66575,66575],"mapped",[66615]],[[66576,66576],"mapped",[66616]],[[66577,66577],"mapped",[66617]],[[66578,66578],"mapped",[66618]],[[66579,66579],"mapped",[66619]],[[66580,66580],"mapped",[66620]],[[66581,66581],"mapped",[66621]],[[66582,66582],"mapped",[66622]],[[66583,66583],"mapped",[66623]],[[66584,66584],"mapped",[66624]],[[66585,66585],"mapped",[66625]],[[66586,66586],"mapped",[66626]],[[66587,66587],"mapped",[66627]],[[66588,66588],"mapped",[66628]],[[66589,66589],"mapped",[66629]],[[66590,66590],"mapped",[66630]],[[66591,66591],"mapped",[66631]],[[66592,66592],"mapped",[66632]],[[66593,66593],"mapped",[66633]],[[66594,66594],"mapped",[66634]],[[66595,66595],"mapped",[66635]],[[66596,66596],"mapped",[66636]],[[66597,66597],"mapped",[66637]],[[66598,66598],"mapped",[66638]],[[66599,66599],"mapped",[66639]],[[66600,66637],"valid"],[[66638,66717],"valid"],[[66718,66719],"disallowed"],[[66720,66729],"valid"],[[66730,66815],"disallowed"],[[66816,66855],"valid"],[[66856,66863],"disallowed"],[[66864,66915],"valid"],[[66916,66926],"disallowed"],[[66927,66927],"valid",[],"NV8"],[[66928,67071],"disallowed"],[[67072,67382],"valid"],[[67383,67391],"disallowed"],[[67392,67413],"valid"],[[67414,67423],"disallowed"],[[67424,67431],"valid"],[[67432,67583],"disallowed"],[[67584,67589],"valid"],[[67590,67591],"disallowed"],[[67592,67592],"valid"],[[67593,67593],"disallowed"],[[67594,67637],"valid"],[[67638,67638],"disallowed"],[[67639,67640],"valid"],[[67641,67643],"disallowed"],[[67644,67644],"valid"],[[67645,67646],"disallowed"],[[67647,67647],"valid"],[[67648,67669],"valid"],[[67670,67670],"disallowed"],[[67671,67679],"valid",[],"NV8"],[[67680,67702],"valid"],[[67703,67711],"valid",[],"NV8"],[[67712,67742],"valid"],[[67743,67750],"disallowed"],[[67751,67759],"valid",[],"NV8"],[[67760,67807],"disallowed"],[[67808,67826],"valid"],[[67827,67827],"disallowed"],[[67828,67829],"valid"],[[67830,67834],"disallowed"],[[67835,67839],"valid",[],"NV8"],[[67840,67861],"valid"],[[67862,67865],"valid",[],"NV8"],[[67866,67867],"valid",[],"NV8"],[[67868,67870],"disallowed"],[[67871,67871],"valid",[],"NV8"],[[67872,67897],"valid"],[[67898,67902],"disallowed"],[[67903,67903],"valid",[],"NV8"],[[67904,67967],"disallowed"],[[67968,68023],"valid"],[[68024,68027],"disallowed"],[[68028,68029],"valid",[],"NV8"],[[68030,68031],"valid"],[[68032,68047],"valid",[],"NV8"],[[68048,68049],"disallowed"],[[68050,68095],"valid",[],"NV8"],[[68096,68099],"valid"],[[68100,68100],"disallowed"],[[68101,68102],"valid"],[[68103,68107],"disallowed"],[[68108,68115],"valid"],[[68116,68116],"disallowed"],[[68117,68119],"valid"],[[68120,68120],"disallowed"],[[68121,68147],"valid"],[[68148,68151],"disallowed"],[[68152,68154],"valid"],[[68155,68158],"disallowed"],[[68159,68159],"valid"],[[68160,68167],"valid",[],"NV8"],[[68168,68175],"disallowed"],[[68176,68184],"valid",[],"NV8"],[[68185,68191],"disallowed"],[[68192,68220],"valid"],[[68221,68223],"valid",[],"NV8"],[[68224,68252],"valid"],[[68253,68255],"valid",[],"NV8"],[[68256,68287],"disallowed"],[[68288,68295],"valid"],[[68296,68296],"valid",[],"NV8"],[[68297,68326],"valid"],[[68327,68330],"disallowed"],[[68331,68342],"valid",[],"NV8"],[[68343,68351],"disallowed"],[[68352,68405],"valid"],[[68406,68408],"disallowed"],[[68409,68415],"valid",[],"NV8"],[[68416,68437],"valid"],[[68438,68439],"disallowed"],[[68440,68447],"valid",[],"NV8"],[[68448,68466],"valid"],[[68467,68471],"disallowed"],[[68472,68479],"valid",[],"NV8"],[[68480,68497],"valid"],[[68498,68504],"disallowed"],[[68505,68508],"valid",[],"NV8"],[[68509,68520],"disallowed"],[[68521,68527],"valid",[],"NV8"],[[68528,68607],"disallowed"],[[68608,68680],"valid"],[[68681,68735],"disallowed"],[[68736,68736],"mapped",[68800]],[[68737,68737],"mapped",[68801]],[[68738,68738],"mapped",[68802]],[[68739,68739],"mapped",[68803]],[[68740,68740],"mapped",[68804]],[[68741,68741],"mapped",[68805]],[[68742,68742],"mapped",[68806]],[[68743,68743],"mapped",[68807]],[[68744,68744],"mapped",[68808]],[[68745,68745],"mapped",[68809]],[[68746,68746],"mapped",[68810]],[[68747,68747],"mapped",[68811]],[[68748,68748],"mapped",[68812]],[[68749,68749],"mapped",[68813]],[[68750,68750],"mapped",[68814]],[[68751,68751],"mapped",[68815]],[[68752,68752],"mapped",[68816]],[[68753,68753],"mapped",[68817]],[[68754,68754],"mapped",[68818]],[[68755,68755],"mapped",[68819]],[[68756,68756],"mapped",[68820]],[[68757,68757],"mapped",[68821]],[[68758,68758],"mapped",[68822]],[[68759,68759],"mapped",[68823]],[[68760,68760],"mapped",[68824]],[[68761,68761],"mapped",[68825]],[[68762,68762],"mapped",[68826]],[[68763,68763],"mapped",[68827]],[[68764,68764],"mapped",[68828]],[[68765,68765],"mapped",[68829]],[[68766,68766],"mapped",[68830]],[[68767,68767],"mapped",[68831]],[[68768,68768],"mapped",[68832]],[[68769,68769],"mapped",[68833]],[[68770,68770],"mapped",[68834]],[[68771,68771],"mapped",[68835]],[[68772,68772],"mapped",[68836]],[[68773,68773],"mapped",[68837]],[[68774,68774],"mapped",[68838]],[[68775,68775],"mapped",[68839]],[[68776,68776],"mapped",[68840]],[[68777,68777],"mapped",[68841]],[[68778,68778],"mapped",[68842]],[[68779,68779],"mapped",[68843]],[[68780,68780],"mapped",[68844]],[[68781,68781],"mapped",[68845]],[[68782,68782],"mapped",[68846]],[[68783,68783],"mapped",[68847]],[[68784,68784],"mapped",[68848]],[[68785,68785],"mapped",[68849]],[[68786,68786],"mapped",[68850]],[[68787,68799],"disallowed"],[[68800,68850],"valid"],[[68851,68857],"disallowed"],[[68858,68863],"valid",[],"NV8"],[[68864,69215],"disallowed"],[[69216,69246],"valid",[],"NV8"],[[69247,69631],"disallowed"],[[69632,69702],"valid"],[[69703,69709],"valid",[],"NV8"],[[69710,69713],"disallowed"],[[69714,69733],"valid",[],"NV8"],[[69734,69743],"valid"],[[69744,69758],"disallowed"],[[69759,69759],"valid"],[[69760,69818],"valid"],[[69819,69820],"valid",[],"NV8"],[[69821,69821],"disallowed"],[[69822,69825],"valid",[],"NV8"],[[69826,69839],"disallowed"],[[69840,69864],"valid"],[[69865,69871],"disallowed"],[[69872,69881],"valid"],[[69882,69887],"disallowed"],[[69888,69940],"valid"],[[69941,69941],"disallowed"],[[69942,69951],"valid"],[[69952,69955],"valid",[],"NV8"],[[69956,69967],"disallowed"],[[69968,70003],"valid"],[[70004,70005],"valid",[],"NV8"],[[70006,70006],"valid"],[[70007,70015],"disallowed"],[[70016,70084],"valid"],[[70085,70088],"valid",[],"NV8"],[[70089,70089],"valid",[],"NV8"],[[70090,70092],"valid"],[[70093,70093],"valid",[],"NV8"],[[70094,70095],"disallowed"],[[70096,70105],"valid"],[[70106,70106],"valid"],[[70107,70107],"valid",[],"NV8"],[[70108,70108],"valid"],[[70109,70111],"valid",[],"NV8"],[[70112,70112],"disallowed"],[[70113,70132],"valid",[],"NV8"],[[70133,70143],"disallowed"],[[70144,70161],"valid"],[[70162,70162],"disallowed"],[[70163,70199],"valid"],[[70200,70205],"valid",[],"NV8"],[[70206,70271],"disallowed"],[[70272,70278],"valid"],[[70279,70279],"disallowed"],[[70280,70280],"valid"],[[70281,70281],"disallowed"],[[70282,70285],"valid"],[[70286,70286],"disallowed"],[[70287,70301],"valid"],[[70302,70302],"disallowed"],[[70303,70312],"valid"],[[70313,70313],"valid",[],"NV8"],[[70314,70319],"disallowed"],[[70320,70378],"valid"],[[70379,70383],"disallowed"],[[70384,70393],"valid"],[[70394,70399],"disallowed"],[[70400,70400],"valid"],[[70401,70403],"valid"],[[70404,70404],"disallowed"],[[70405,70412],"valid"],[[70413,70414],"disallowed"],[[70415,70416],"valid"],[[70417,70418],"disallowed"],[[70419,70440],"valid"],[[70441,70441],"disallowed"],[[70442,70448],"valid"],[[70449,70449],"disallowed"],[[70450,70451],"valid"],[[70452,70452],"disallowed"],[[70453,70457],"valid"],[[70458,70459],"disallowed"],[[70460,70468],"valid"],[[70469,70470],"disallowed"],[[70471,70472],"valid"],[[70473,70474],"disallowed"],[[70475,70477],"valid"],[[70478,70479],"disallowed"],[[70480,70480],"valid"],[[70481,70486],"disallowed"],[[70487,70487],"valid"],[[70488,70492],"disallowed"],[[70493,70499],"valid"],[[70500,70501],"disallowed"],[[70502,70508],"valid"],[[70509,70511],"disallowed"],[[70512,70516],"valid"],[[70517,70783],"disallowed"],[[70784,70853],"valid"],[[70854,70854],"valid",[],"NV8"],[[70855,70855],"valid"],[[70856,70863],"disallowed"],[[70864,70873],"valid"],[[70874,71039],"disallowed"],[[71040,71093],"valid"],[[71094,71095],"disallowed"],[[71096,71104],"valid"],[[71105,71113],"valid",[],"NV8"],[[71114,71127],"valid",[],"NV8"],[[71128,71133],"valid"],[[71134,71167],"disallowed"],[[71168,71232],"valid"],[[71233,71235],"valid",[],"NV8"],[[71236,71236],"valid"],[[71237,71247],"disallowed"],[[71248,71257],"valid"],[[71258,71295],"disallowed"],[[71296,71351],"valid"],[[71352,71359],"disallowed"],[[71360,71369],"valid"],[[71370,71423],"disallowed"],[[71424,71449],"valid"],[[71450,71452],"disallowed"],[[71453,71467],"valid"],[[71468,71471],"disallowed"],[[71472,71481],"valid"],[[71482,71487],"valid",[],"NV8"],[[71488,71839],"disallowed"],[[71840,71840],"mapped",[71872]],[[71841,71841],"mapped",[71873]],[[71842,71842],"mapped",[71874]],[[71843,71843],"mapped",[71875]],[[71844,71844],"mapped",[71876]],[[71845,71845],"mapped",[71877]],[[71846,71846],"mapped",[71878]],[[71847,71847],"mapped",[71879]],[[71848,71848],"mapped",[71880]],[[71849,71849],"mapped",[71881]],[[71850,71850],"mapped",[71882]],[[71851,71851],"mapped",[71883]],[[71852,71852],"mapped",[71884]],[[71853,71853],"mapped",[71885]],[[71854,71854],"mapped",[71886]],[[71855,71855],"mapped",[71887]],[[71856,71856],"mapped",[71888]],[[71857,71857],"mapped",[71889]],[[71858,71858],"mapped",[71890]],[[71859,71859],"mapped",[71891]],[[71860,71860],"mapped",[71892]],[[71861,71861],"mapped",[71893]],[[71862,71862],"mapped",[71894]],[[71863,71863],"mapped",[71895]],[[71864,71864],"mapped",[71896]],[[71865,71865],"mapped",[71897]],[[71866,71866],"mapped",[71898]],[[71867,71867],"mapped",[71899]],[[71868,71868],"mapped",[71900]],[[71869,71869],"mapped",[71901]],[[71870,71870],"mapped",[71902]],[[71871,71871],"mapped",[71903]],[[71872,71913],"valid"],[[71914,71922],"valid",[],"NV8"],[[71923,71934],"disallowed"],[[71935,71935],"valid"],[[71936,72383],"disallowed"],[[72384,72440],"valid"],[[72441,73727],"disallowed"],[[73728,74606],"valid"],[[74607,74648],"valid"],[[74649,74649],"valid"],[[74650,74751],"disallowed"],[[74752,74850],"valid",[],"NV8"],[[74851,74862],"valid",[],"NV8"],[[74863,74863],"disallowed"],[[74864,74867],"valid",[],"NV8"],[[74868,74868],"valid",[],"NV8"],[[74869,74879],"disallowed"],[[74880,75075],"valid"],[[75076,77823],"disallowed"],[[77824,78894],"valid"],[[78895,82943],"disallowed"],[[82944,83526],"valid"],[[83527,92159],"disallowed"],[[92160,92728],"valid"],[[92729,92735],"disallowed"],[[92736,92766],"valid"],[[92767,92767],"disallowed"],[[92768,92777],"valid"],[[92778,92781],"disallowed"],[[92782,92783],"valid",[],"NV8"],[[92784,92879],"disallowed"],[[92880,92909],"valid"],[[92910,92911],"disallowed"],[[92912,92916],"valid"],[[92917,92917],"valid",[],"NV8"],[[92918,92927],"disallowed"],[[92928,92982],"valid"],[[92983,92991],"valid",[],"NV8"],[[92992,92995],"valid"],[[92996,92997],"valid",[],"NV8"],[[92998,93007],"disallowed"],[[93008,93017],"valid"],[[93018,93018],"disallowed"],[[93019,93025],"valid",[],"NV8"],[[93026,93026],"disallowed"],[[93027,93047],"valid"],[[93048,93052],"disallowed"],[[93053,93071],"valid"],[[93072,93951],"disallowed"],[[93952,94020],"valid"],[[94021,94031],"disallowed"],[[94032,94078],"valid"],[[94079,94094],"disallowed"],[[94095,94111],"valid"],[[94112,110591],"disallowed"],[[110592,110593],"valid"],[[110594,113663],"disallowed"],[[113664,113770],"valid"],[[113771,113775],"disallowed"],[[113776,113788],"valid"],[[113789,113791],"disallowed"],[[113792,113800],"valid"],[[113801,113807],"disallowed"],[[113808,113817],"valid"],[[113818,113819],"disallowed"],[[113820,113820],"valid",[],"NV8"],[[113821,113822],"valid"],[[113823,113823],"valid",[],"NV8"],[[113824,113827],"ignored"],[[113828,118783],"disallowed"],[[118784,119029],"valid",[],"NV8"],[[119030,119039],"disallowed"],[[119040,119078],"valid",[],"NV8"],[[119079,119080],"disallowed"],[[119081,119081],"valid",[],"NV8"],[[119082,119133],"valid",[],"NV8"],[[119134,119134],"mapped",[119127,119141]],[[119135,119135],"mapped",[119128,119141]],[[119136,119136],"mapped",[119128,119141,119150]],[[119137,119137],"mapped",[119128,119141,119151]],[[119138,119138],"mapped",[119128,119141,119152]],[[119139,119139],"mapped",[119128,119141,119153]],[[119140,119140],"mapped",[119128,119141,119154]],[[119141,119154],"valid",[],"NV8"],[[119155,119162],"disallowed"],[[119163,119226],"valid",[],"NV8"],[[119227,119227],"mapped",[119225,119141]],[[119228,119228],"mapped",[119226,119141]],[[119229,119229],"mapped",[119225,119141,119150]],[[119230,119230],"mapped",[119226,119141,119150]],[[119231,119231],"mapped",[119225,119141,119151]],[[119232,119232],"mapped",[119226,119141,119151]],[[119233,119261],"valid",[],"NV8"],[[119262,119272],"valid",[],"NV8"],[[119273,119295],"disallowed"],[[119296,119365],"valid",[],"NV8"],[[119366,119551],"disallowed"],[[119552,119638],"valid",[],"NV8"],[[119639,119647],"disallowed"],[[119648,119665],"valid",[],"NV8"],[[119666,119807],"disallowed"],[[119808,119808],"mapped",[97]],[[119809,119809],"mapped",[98]],[[119810,119810],"mapped",[99]],[[119811,119811],"mapped",[100]],[[119812,119812],"mapped",[101]],[[119813,119813],"mapped",[102]],[[119814,119814],"mapped",[103]],[[119815,119815],"mapped",[104]],[[119816,119816],"mapped",[105]],[[119817,119817],"mapped",[106]],[[119818,119818],"mapped",[107]],[[119819,119819],"mapped",[108]],[[119820,119820],"mapped",[109]],[[119821,119821],"mapped",[110]],[[119822,119822],"mapped",[111]],[[119823,119823],"mapped",[112]],[[119824,119824],"mapped",[113]],[[119825,119825],"mapped",[114]],[[119826,119826],"mapped",[115]],[[119827,119827],"mapped",[116]],[[119828,119828],"mapped",[117]],[[119829,119829],"mapped",[118]],[[119830,119830],"mapped",[119]],[[119831,119831],"mapped",[120]],[[119832,119832],"mapped",[121]],[[119833,119833],"mapped",[122]],[[119834,119834],"mapped",[97]],[[119835,119835],"mapped",[98]],[[119836,119836],"mapped",[99]],[[119837,119837],"mapped",[100]],[[119838,119838],"mapped",[101]],[[119839,119839],"mapped",[102]],[[119840,119840],"mapped",[103]],[[119841,119841],"mapped",[104]],[[119842,119842],"mapped",[105]],[[119843,119843],"mapped",[106]],[[119844,119844],"mapped",[107]],[[119845,119845],"mapped",[108]],[[119846,119846],"mapped",[109]],[[119847,119847],"mapped",[110]],[[119848,119848],"mapped",[111]],[[119849,119849],"mapped",[112]],[[119850,119850],"mapped",[113]],[[119851,119851],"mapped",[114]],[[119852,119852],"mapped",[115]],[[119853,119853],"mapped",[116]],[[119854,119854],"mapped",[117]],[[119855,119855],"mapped",[118]],[[119856,119856],"mapped",[119]],[[119857,119857],"mapped",[120]],[[119858,119858],"mapped",[121]],[[119859,119859],"mapped",[122]],[[119860,119860],"mapped",[97]],[[119861,119861],"mapped",[98]],[[119862,119862],"mapped",[99]],[[119863,119863],"mapped",[100]],[[119864,119864],"mapped",[101]],[[119865,119865],"mapped",[102]],[[119866,119866],"mapped",[103]],[[119867,119867],"mapped",[104]],[[119868,119868],"mapped",[105]],[[119869,119869],"mapped",[106]],[[119870,119870],"mapped",[107]],[[119871,119871],"mapped",[108]],[[119872,119872],"mapped",[109]],[[119873,119873],"mapped",[110]],[[119874,119874],"mapped",[111]],[[119875,119875],"mapped",[112]],[[119876,119876],"mapped",[113]],[[119877,119877],"mapped",[114]],[[119878,119878],"mapped",[115]],[[119879,119879],"mapped",[116]],[[119880,119880],"mapped",[117]],[[119881,119881],"mapped",[118]],[[119882,119882],"mapped",[119]],[[119883,119883],"mapped",[120]],[[119884,119884],"mapped",[121]],[[119885,119885],"mapped",[122]],[[119886,119886],"mapped",[97]],[[119887,119887],"mapped",[98]],[[119888,119888],"mapped",[99]],[[119889,119889],"mapped",[100]],[[119890,119890],"mapped",[101]],[[119891,119891],"mapped",[102]],[[119892,119892],"mapped",[103]],[[119893,119893],"disallowed"],[[119894,119894],"mapped",[105]],[[119895,119895],"mapped",[106]],[[119896,119896],"mapped",[107]],[[119897,119897],"mapped",[108]],[[119898,119898],"mapped",[109]],[[119899,119899],"mapped",[110]],[[119900,119900],"mapped",[111]],[[119901,119901],"mapped",[112]],[[119902,119902],"mapped",[113]],[[119903,119903],"mapped",[114]],[[119904,119904],"mapped",[115]],[[119905,119905],"mapped",[116]],[[119906,119906],"mapped",[117]],[[119907,119907],"mapped",[118]],[[119908,119908],"mapped",[119]],[[119909,119909],"mapped",[120]],[[119910,119910],"mapped",[121]],[[119911,119911],"mapped",[122]],[[119912,119912],"mapped",[97]],[[119913,119913],"mapped",[98]],[[119914,119914],"mapped",[99]],[[119915,119915],"mapped",[100]],[[119916,119916],"mapped",[101]],[[119917,119917],"mapped",[102]],[[119918,119918],"mapped",[103]],[[119919,119919],"mapped",[104]],[[119920,119920],"mapped",[105]],[[119921,119921],"mapped",[106]],[[119922,119922],"mapped",[107]],[[119923,119923],"mapped",[108]],[[119924,119924],"mapped",[109]],[[119925,119925],"mapped",[110]],[[119926,119926],"mapped",[111]],[[119927,119927],"mapped",[112]],[[119928,119928],"mapped",[113]],[[119929,119929],"mapped",[114]],[[119930,119930],"mapped",[115]],[[119931,119931],"mapped",[116]],[[119932,119932],"mapped",[117]],[[119933,119933],"mapped",[118]],[[119934,119934],"mapped",[119]],[[119935,119935],"mapped",[120]],[[119936,119936],"mapped",[121]],[[119937,119937],"mapped",[122]],[[119938,119938],"mapped",[97]],[[119939,119939],"mapped",[98]],[[119940,119940],"mapped",[99]],[[119941,119941],"mapped",[100]],[[119942,119942],"mapped",[101]],[[119943,119943],"mapped",[102]],[[119944,119944],"mapped",[103]],[[119945,119945],"mapped",[104]],[[119946,119946],"mapped",[105]],[[119947,119947],"mapped",[106]],[[119948,119948],"mapped",[107]],[[119949,119949],"mapped",[108]],[[119950,119950],"mapped",[109]],[[119951,119951],"mapped",[110]],[[119952,119952],"mapped",[111]],[[119953,119953],"mapped",[112]],[[119954,119954],"mapped",[113]],[[119955,119955],"mapped",[114]],[[119956,119956],"mapped",[115]],[[119957,119957],"mapped",[116]],[[119958,119958],"mapped",[117]],[[119959,119959],"mapped",[118]],[[119960,119960],"mapped",[119]],[[119961,119961],"mapped",[120]],[[119962,119962],"mapped",[121]],[[119963,119963],"mapped",[122]],[[119964,119964],"mapped",[97]],[[119965,119965],"disallowed"],[[119966,119966],"mapped",[99]],[[119967,119967],"mapped",[100]],[[119968,119969],"disallowed"],[[119970,119970],"mapped",[103]],[[119971,119972],"disallowed"],[[119973,119973],"mapped",[106]],[[119974,119974],"mapped",[107]],[[119975,119976],"disallowed"],[[119977,119977],"mapped",[110]],[[119978,119978],"mapped",[111]],[[119979,119979],"mapped",[112]],[[119980,119980],"mapped",[113]],[[119981,119981],"disallowed"],[[119982,119982],"mapped",[115]],[[119983,119983],"mapped",[116]],[[119984,119984],"mapped",[117]],[[119985,119985],"mapped",[118]],[[119986,119986],"mapped",[119]],[[119987,119987],"mapped",[120]],[[119988,119988],"mapped",[121]],[[119989,119989],"mapped",[122]],[[119990,119990],"mapped",[97]],[[119991,119991],"mapped",[98]],[[119992,119992],"mapped",[99]],[[119993,119993],"mapped",[100]],[[119994,119994],"disallowed"],[[119995,119995],"mapped",[102]],[[119996,119996],"disallowed"],[[119997,119997],"mapped",[104]],[[119998,119998],"mapped",[105]],[[119999,119999],"mapped",[106]],[[120000,120000],"mapped",[107]],[[120001,120001],"mapped",[108]],[[120002,120002],"mapped",[109]],[[120003,120003],"mapped",[110]],[[120004,120004],"disallowed"],[[120005,120005],"mapped",[112]],[[120006,120006],"mapped",[113]],[[120007,120007],"mapped",[114]],[[120008,120008],"mapped",[115]],[[120009,120009],"mapped",[116]],[[120010,120010],"mapped",[117]],[[120011,120011],"mapped",[118]],[[120012,120012],"mapped",[119]],[[120013,120013],"mapped",[120]],[[120014,120014],"mapped",[121]],[[120015,120015],"mapped",[122]],[[120016,120016],"mapped",[97]],[[120017,120017],"mapped",[98]],[[120018,120018],"mapped",[99]],[[120019,120019],"mapped",[100]],[[120020,120020],"mapped",[101]],[[120021,120021],"mapped",[102]],[[120022,120022],"mapped",[103]],[[120023,120023],"mapped",[104]],[[120024,120024],"mapped",[105]],[[120025,120025],"mapped",[106]],[[120026,120026],"mapped",[107]],[[120027,120027],"mapped",[108]],[[120028,120028],"mapped",[109]],[[120029,120029],"mapped",[110]],[[120030,120030],"mapped",[111]],[[120031,120031],"mapped",[112]],[[120032,120032],"mapped",[113]],[[120033,120033],"mapped",[114]],[[120034,120034],"mapped",[115]],[[120035,120035],"mapped",[116]],[[120036,120036],"mapped",[117]],[[120037,120037],"mapped",[118]],[[120038,120038],"mapped",[119]],[[120039,120039],"mapped",[120]],[[120040,120040],"mapped",[121]],[[120041,120041],"mapped",[122]],[[120042,120042],"mapped",[97]],[[120043,120043],"mapped",[98]],[[120044,120044],"mapped",[99]],[[120045,120045],"mapped",[100]],[[120046,120046],"mapped",[101]],[[120047,120047],"mapped",[102]],[[120048,120048],"mapped",[103]],[[120049,120049],"mapped",[104]],[[120050,120050],"mapped",[105]],[[120051,120051],"mapped",[106]],[[120052,120052],"mapped",[107]],[[120053,120053],"mapped",[108]],[[120054,120054],"mapped",[109]],[[120055,120055],"mapped",[110]],[[120056,120056],"mapped",[111]],[[120057,120057],"mapped",[112]],[[120058,120058],"mapped",[113]],[[120059,120059],"mapped",[114]],[[120060,120060],"mapped",[115]],[[120061,120061],"mapped",[116]],[[120062,120062],"mapped",[117]],[[120063,120063],"mapped",[118]],[[120064,120064],"mapped",[119]],[[120065,120065],"mapped",[120]],[[120066,120066],"mapped",[121]],[[120067,120067],"mapped",[122]],[[120068,120068],"mapped",[97]],[[120069,120069],"mapped",[98]],[[120070,120070],"disallowed"],[[120071,120071],"mapped",[100]],[[120072,120072],"mapped",[101]],[[120073,120073],"mapped",[102]],[[120074,120074],"mapped",[103]],[[120075,120076],"disallowed"],[[120077,120077],"mapped",[106]],[[120078,120078],"mapped",[107]],[[120079,120079],"mapped",[108]],[[120080,120080],"mapped",[109]],[[120081,120081],"mapped",[110]],[[120082,120082],"mapped",[111]],[[120083,120083],"mapped",[112]],[[120084,120084],"mapped",[113]],[[120085,120085],"disallowed"],[[120086,120086],"mapped",[115]],[[120087,120087],"mapped",[116]],[[120088,120088],"mapped",[117]],[[120089,120089],"mapped",[118]],[[120090,120090],"mapped",[119]],[[120091,120091],"mapped",[120]],[[120092,120092],"mapped",[121]],[[120093,120093],"disallowed"],[[120094,120094],"mapped",[97]],[[120095,120095],"mapped",[98]],[[120096,120096],"mapped",[99]],[[120097,120097],"mapped",[100]],[[120098,120098],"mapped",[101]],[[120099,120099],"mapped",[102]],[[120100,120100],"mapped",[103]],[[120101,120101],"mapped",[104]],[[120102,120102],"mapped",[105]],[[120103,120103],"mapped",[106]],[[120104,120104],"mapped",[107]],[[120105,120105],"mapped",[108]],[[120106,120106],"mapped",[109]],[[120107,120107],"mapped",[110]],[[120108,120108],"mapped",[111]],[[120109,120109],"mapped",[112]],[[120110,120110],"mapped",[113]],[[120111,120111],"mapped",[114]],[[120112,120112],"mapped",[115]],[[120113,120113],"mapped",[116]],[[120114,120114],"mapped",[117]],[[120115,120115],"mapped",[118]],[[120116,120116],"mapped",[119]],[[120117,120117],"mapped",[120]],[[120118,120118],"mapped",[121]],[[120119,120119],"mapped",[122]],[[120120,120120],"mapped",[97]],[[120121,120121],"mapped",[98]],[[120122,120122],"disallowed"],[[120123,120123],"mapped",[100]],[[120124,120124],"mapped",[101]],[[120125,120125],"mapped",[102]],[[120126,120126],"mapped",[103]],[[120127,120127],"disallowed"],[[120128,120128],"mapped",[105]],[[120129,120129],"mapped",[106]],[[120130,120130],"mapped",[107]],[[120131,120131],"mapped",[108]],[[120132,120132],"mapped",[109]],[[120133,120133],"disallowed"],[[120134,120134],"mapped",[111]],[[120135,120137],"disallowed"],[[120138,120138],"mapped",[115]],[[120139,120139],"mapped",[116]],[[120140,120140],"mapped",[117]],[[120141,120141],"mapped",[118]],[[120142,120142],"mapped",[119]],[[120143,120143],"mapped",[120]],[[120144,120144],"mapped",[121]],[[120145,120145],"disallowed"],[[120146,120146],"mapped",[97]],[[120147,120147],"mapped",[98]],[[120148,120148],"mapped",[99]],[[120149,120149],"mapped",[100]],[[120150,120150],"mapped",[101]],[[120151,120151],"mapped",[102]],[[120152,120152],"mapped",[103]],[[120153,120153],"mapped",[104]],[[120154,120154],"mapped",[105]],[[120155,120155],"mapped",[106]],[[120156,120156],"mapped",[107]],[[120157,120157],"mapped",[108]],[[120158,120158],"mapped",[109]],[[120159,120159],"mapped",[110]],[[120160,120160],"mapped",[111]],[[120161,120161],"mapped",[112]],[[120162,120162],"mapped",[113]],[[120163,120163],"mapped",[114]],[[120164,120164],"mapped",[115]],[[120165,120165],"mapped",[116]],[[120166,120166],"mapped",[117]],[[120167,120167],"mapped",[118]],[[120168,120168],"mapped",[119]],[[120169,120169],"mapped",[120]],[[120170,120170],"mapped",[121]],[[120171,120171],"mapped",[122]],[[120172,120172],"mapped",[97]],[[120173,120173],"mapped",[98]],[[120174,120174],"mapped",[99]],[[120175,120175],"mapped",[100]],[[120176,120176],"mapped",[101]],[[120177,120177],"mapped",[102]],[[120178,120178],"mapped",[103]],[[120179,120179],"mapped",[104]],[[120180,120180],"mapped",[105]],[[120181,120181],"mapped",[106]],[[120182,120182],"mapped",[107]],[[120183,120183],"mapped",[108]],[[120184,120184],"mapped",[109]],[[120185,120185],"mapped",[110]],[[120186,120186],"mapped",[111]],[[120187,120187],"mapped",[112]],[[120188,120188],"mapped",[113]],[[120189,120189],"mapped",[114]],[[120190,120190],"mapped",[115]],[[120191,120191],"mapped",[116]],[[120192,120192],"mapped",[117]],[[120193,120193],"mapped",[118]],[[120194,120194],"mapped",[119]],[[120195,120195],"mapped",[120]],[[120196,120196],"mapped",[121]],[[120197,120197],"mapped",[122]],[[120198,120198],"mapped",[97]],[[120199,120199],"mapped",[98]],[[120200,120200],"mapped",[99]],[[120201,120201],"mapped",[100]],[[120202,120202],"mapped",[101]],[[120203,120203],"mapped",[102]],[[120204,120204],"mapped",[103]],[[120205,120205],"mapped",[104]],[[120206,120206],"mapped",[105]],[[120207,120207],"mapped",[106]],[[120208,120208],"mapped",[107]],[[120209,120209],"mapped",[108]],[[120210,120210],"mapped",[109]],[[120211,120211],"mapped",[110]],[[120212,120212],"mapped",[111]],[[120213,120213],"mapped",[112]],[[120214,120214],"mapped",[113]],[[120215,120215],"mapped",[114]],[[120216,120216],"mapped",[115]],[[120217,120217],"mapped",[116]],[[120218,120218],"mapped",[117]],[[120219,120219],"mapped",[118]],[[120220,120220],"mapped",[119]],[[120221,120221],"mapped",[120]],[[120222,120222],"mapped",[121]],[[120223,120223],"mapped",[122]],[[120224,120224],"mapped",[97]],[[120225,120225],"mapped",[98]],[[120226,120226],"mapped",[99]],[[120227,120227],"mapped",[100]],[[120228,120228],"mapped",[101]],[[120229,120229],"mapped",[102]],[[120230,120230],"mapped",[103]],[[120231,120231],"mapped",[104]],[[120232,120232],"mapped",[105]],[[120233,120233],"mapped",[106]],[[120234,120234],"mapped",[107]],[[120235,120235],"mapped",[108]],[[120236,120236],"mapped",[109]],[[120237,120237],"mapped",[110]],[[120238,120238],"mapped",[111]],[[120239,120239],"mapped",[112]],[[120240,120240],"mapped",[113]],[[120241,120241],"mapped",[114]],[[120242,120242],"mapped",[115]],[[120243,120243],"mapped",[116]],[[120244,120244],"mapped",[117]],[[120245,120245],"mapped",[118]],[[120246,120246],"mapped",[119]],[[120247,120247],"mapped",[120]],[[120248,120248],"mapped",[121]],[[120249,120249],"mapped",[122]],[[120250,120250],"mapped",[97]],[[120251,120251],"mapped",[98]],[[120252,120252],"mapped",[99]],[[120253,120253],"mapped",[100]],[[120254,120254],"mapped",[101]],[[120255,120255],"mapped",[102]],[[120256,120256],"mapped",[103]],[[120257,120257],"mapped",[104]],[[120258,120258],"mapped",[105]],[[120259,120259],"mapped",[106]],[[120260,120260],"mapped",[107]],[[120261,120261],"mapped",[108]],[[120262,120262],"mapped",[109]],[[120263,120263],"mapped",[110]],[[120264,120264],"mapped",[111]],[[120265,120265],"mapped",[112]],[[120266,120266],"mapped",[113]],[[120267,120267],"mapped",[114]],[[120268,120268],"mapped",[115]],[[120269,120269],"mapped",[116]],[[120270,120270],"mapped",[117]],[[120271,120271],"mapped",[118]],[[120272,120272],"mapped",[119]],[[120273,120273],"mapped",[120]],[[120274,120274],"mapped",[121]],[[120275,120275],"mapped",[122]],[[120276,120276],"mapped",[97]],[[120277,120277],"mapped",[98]],[[120278,120278],"mapped",[99]],[[120279,120279],"mapped",[100]],[[120280,120280],"mapped",[101]],[[120281,120281],"mapped",[102]],[[120282,120282],"mapped",[103]],[[120283,120283],"mapped",[104]],[[120284,120284],"mapped",[105]],[[120285,120285],"mapped",[106]],[[120286,120286],"mapped",[107]],[[120287,120287],"mapped",[108]],[[120288,120288],"mapped",[109]],[[120289,120289],"mapped",[110]],[[120290,120290],"mapped",[111]],[[120291,120291],"mapped",[112]],[[120292,120292],"mapped",[113]],[[120293,120293],"mapped",[114]],[[120294,120294],"mapped",[115]],[[120295,120295],"mapped",[116]],[[120296,120296],"mapped",[117]],[[120297,120297],"mapped",[118]],[[120298,120298],"mapped",[119]],[[120299,120299],"mapped",[120]],[[120300,120300],"mapped",[121]],[[120301,120301],"mapped",[122]],[[120302,120302],"mapped",[97]],[[120303,120303],"mapped",[98]],[[120304,120304],"mapped",[99]],[[120305,120305],"mapped",[100]],[[120306,120306],"mapped",[101]],[[120307,120307],"mapped",[102]],[[120308,120308],"mapped",[103]],[[120309,120309],"mapped",[104]],[[120310,120310],"mapped",[105]],[[120311,120311],"mapped",[106]],[[120312,120312],"mapped",[107]],[[120313,120313],"mapped",[108]],[[120314,120314],"mapped",[109]],[[120315,120315],"mapped",[110]],[[120316,120316],"mapped",[111]],[[120317,120317],"mapped",[112]],[[120318,120318],"mapped",[113]],[[120319,120319],"mapped",[114]],[[120320,120320],"mapped",[115]],[[120321,120321],"mapped",[116]],[[120322,120322],"mapped",[117]],[[120323,120323],"mapped",[118]],[[120324,120324],"mapped",[119]],[[120325,120325],"mapped",[120]],[[120326,120326],"mapped",[121]],[[120327,120327],"mapped",[122]],[[120328,120328],"mapped",[97]],[[120329,120329],"mapped",[98]],[[120330,120330],"mapped",[99]],[[120331,120331],"mapped",[100]],[[120332,120332],"mapped",[101]],[[120333,120333],"mapped",[102]],[[120334,120334],"mapped",[103]],[[120335,120335],"mapped",[104]],[[120336,120336],"mapped",[105]],[[120337,120337],"mapped",[106]],[[120338,120338],"mapped",[107]],[[120339,120339],"mapped",[108]],[[120340,120340],"mapped",[109]],[[120341,120341],"mapped",[110]],[[120342,120342],"mapped",[111]],[[120343,120343],"mapped",[112]],[[120344,120344],"mapped",[113]],[[120345,120345],"mapped",[114]],[[120346,120346],"mapped",[115]],[[120347,120347],"mapped",[116]],[[120348,120348],"mapped",[117]],[[120349,120349],"mapped",[118]],[[120350,120350],"mapped",[119]],[[120351,120351],"mapped",[120]],[[120352,120352],"mapped",[121]],[[120353,120353],"mapped",[122]],[[120354,120354],"mapped",[97]],[[120355,120355],"mapped",[98]],[[120356,120356],"mapped",[99]],[[120357,120357],"mapped",[100]],[[120358,120358],"mapped",[101]],[[120359,120359],"mapped",[102]],[[120360,120360],"mapped",[103]],[[120361,120361],"mapped",[104]],[[120362,120362],"mapped",[105]],[[120363,120363],"mapped",[106]],[[120364,120364],"mapped",[107]],[[120365,120365],"mapped",[108]],[[120366,120366],"mapped",[109]],[[120367,120367],"mapped",[110]],[[120368,120368],"mapped",[111]],[[120369,120369],"mapped",[112]],[[120370,120370],"mapped",[113]],[[120371,120371],"mapped",[114]],[[120372,120372],"mapped",[115]],[[120373,120373],"mapped",[116]],[[120374,120374],"mapped",[117]],[[120375,120375],"mapped",[118]],[[120376,120376],"mapped",[119]],[[120377,120377],"mapped",[120]],[[120378,120378],"mapped",[121]],[[120379,120379],"mapped",[122]],[[120380,120380],"mapped",[97]],[[120381,120381],"mapped",[98]],[[120382,120382],"mapped",[99]],[[120383,120383],"mapped",[100]],[[120384,120384],"mapped",[101]],[[120385,120385],"mapped",[102]],[[120386,120386],"mapped",[103]],[[120387,120387],"mapped",[104]],[[120388,120388],"mapped",[105]],[[120389,120389],"mapped",[106]],[[120390,120390],"mapped",[107]],[[120391,120391],"mapped",[108]],[[120392,120392],"mapped",[109]],[[120393,120393],"mapped",[110]],[[120394,120394],"mapped",[111]],[[120395,120395],"mapped",[112]],[[120396,120396],"mapped",[113]],[[120397,120397],"mapped",[114]],[[120398,120398],"mapped",[115]],[[120399,120399],"mapped",[116]],[[120400,120400],"mapped",[117]],[[120401,120401],"mapped",[118]],[[120402,120402],"mapped",[119]],[[120403,120403],"mapped",[120]],[[120404,120404],"mapped",[121]],[[120405,120405],"mapped",[122]],[[120406,120406],"mapped",[97]],[[120407,120407],"mapped",[98]],[[120408,120408],"mapped",[99]],[[120409,120409],"mapped",[100]],[[120410,120410],"mapped",[101]],[[120411,120411],"mapped",[102]],[[120412,120412],"mapped",[103]],[[120413,120413],"mapped",[104]],[[120414,120414],"mapped",[105]],[[120415,120415],"mapped",[106]],[[120416,120416],"mapped",[107]],[[120417,120417],"mapped",[108]],[[120418,120418],"mapped",[109]],[[120419,120419],"mapped",[110]],[[120420,120420],"mapped",[111]],[[120421,120421],"mapped",[112]],[[120422,120422],"mapped",[113]],[[120423,120423],"mapped",[114]],[[120424,120424],"mapped",[115]],[[120425,120425],"mapped",[116]],[[120426,120426],"mapped",[117]],[[120427,120427],"mapped",[118]],[[120428,120428],"mapped",[119]],[[120429,120429],"mapped",[120]],[[120430,120430],"mapped",[121]],[[120431,120431],"mapped",[122]],[[120432,120432],"mapped",[97]],[[120433,120433],"mapped",[98]],[[120434,120434],"mapped",[99]],[[120435,120435],"mapped",[100]],[[120436,120436],"mapped",[101]],[[120437,120437],"mapped",[102]],[[120438,120438],"mapped",[103]],[[120439,120439],"mapped",[104]],[[120440,120440],"mapped",[105]],[[120441,120441],"mapped",[106]],[[120442,120442],"mapped",[107]],[[120443,120443],"mapped",[108]],[[120444,120444],"mapped",[109]],[[120445,120445],"mapped",[110]],[[120446,120446],"mapped",[111]],[[120447,120447],"mapped",[112]],[[120448,120448],"mapped",[113]],[[120449,120449],"mapped",[114]],[[120450,120450],"mapped",[115]],[[120451,120451],"mapped",[116]],[[120452,120452],"mapped",[117]],[[120453,120453],"mapped",[118]],[[120454,120454],"mapped",[119]],[[120455,120455],"mapped",[120]],[[120456,120456],"mapped",[121]],[[120457,120457],"mapped",[122]],[[120458,120458],"mapped",[97]],[[120459,120459],"mapped",[98]],[[120460,120460],"mapped",[99]],[[120461,120461],"mapped",[100]],[[120462,120462],"mapped",[101]],[[120463,120463],"mapped",[102]],[[120464,120464],"mapped",[103]],[[120465,120465],"mapped",[104]],[[120466,120466],"mapped",[105]],[[120467,120467],"mapped",[106]],[[120468,120468],"mapped",[107]],[[120469,120469],"mapped",[108]],[[120470,120470],"mapped",[109]],[[120471,120471],"mapped",[110]],[[120472,120472],"mapped",[111]],[[120473,120473],"mapped",[112]],[[120474,120474],"mapped",[113]],[[120475,120475],"mapped",[114]],[[120476,120476],"mapped",[115]],[[120477,120477],"mapped",[116]],[[120478,120478],"mapped",[117]],[[120479,120479],"mapped",[118]],[[120480,120480],"mapped",[119]],[[120481,120481],"mapped",[120]],[[120482,120482],"mapped",[121]],[[120483,120483],"mapped",[122]],[[120484,120484],"mapped",[305]],[[120485,120485],"mapped",[567]],[[120486,120487],"disallowed"],[[120488,120488],"mapped",[945]],[[120489,120489],"mapped",[946]],[[120490,120490],"mapped",[947]],[[120491,120491],"mapped",[948]],[[120492,120492],"mapped",[949]],[[120493,120493],"mapped",[950]],[[120494,120494],"mapped",[951]],[[120495,120495],"mapped",[952]],[[120496,120496],"mapped",[953]],[[120497,120497],"mapped",[954]],[[120498,120498],"mapped",[955]],[[120499,120499],"mapped",[956]],[[120500,120500],"mapped",[957]],[[120501,120501],"mapped",[958]],[[120502,120502],"mapped",[959]],[[120503,120503],"mapped",[960]],[[120504,120504],"mapped",[961]],[[120505,120505],"mapped",[952]],[[120506,120506],"mapped",[963]],[[120507,120507],"mapped",[964]],[[120508,120508],"mapped",[965]],[[120509,120509],"mapped",[966]],[[120510,120510],"mapped",[967]],[[120511,120511],"mapped",[968]],[[120512,120512],"mapped",[969]],[[120513,120513],"mapped",[8711]],[[120514,120514],"mapped",[945]],[[120515,120515],"mapped",[946]],[[120516,120516],"mapped",[947]],[[120517,120517],"mapped",[948]],[[120518,120518],"mapped",[949]],[[120519,120519],"mapped",[950]],[[120520,120520],"mapped",[951]],[[120521,120521],"mapped",[952]],[[120522,120522],"mapped",[953]],[[120523,120523],"mapped",[954]],[[120524,120524],"mapped",[955]],[[120525,120525],"mapped",[956]],[[120526,120526],"mapped",[957]],[[120527,120527],"mapped",[958]],[[120528,120528],"mapped",[959]],[[120529,120529],"mapped",[960]],[[120530,120530],"mapped",[961]],[[120531,120532],"mapped",[963]],[[120533,120533],"mapped",[964]],[[120534,120534],"mapped",[965]],[[120535,120535],"mapped",[966]],[[120536,120536],"mapped",[967]],[[120537,120537],"mapped",[968]],[[120538,120538],"mapped",[969]],[[120539,120539],"mapped",[8706]],[[120540,120540],"mapped",[949]],[[120541,120541],"mapped",[952]],[[120542,120542],"mapped",[954]],[[120543,120543],"mapped",[966]],[[120544,120544],"mapped",[961]],[[120545,120545],"mapped",[960]],[[120546,120546],"mapped",[945]],[[120547,120547],"mapped",[946]],[[120548,120548],"mapped",[947]],[[120549,120549],"mapped",[948]],[[120550,120550],"mapped",[949]],[[120551,120551],"mapped",[950]],[[120552,120552],"mapped",[951]],[[120553,120553],"mapped",[952]],[[120554,120554],"mapped",[953]],[[120555,120555],"mapped",[954]],[[120556,120556],"mapped",[955]],[[120557,120557],"mapped",[956]],[[120558,120558],"mapped",[957]],[[120559,120559],"mapped",[958]],[[120560,120560],"mapped",[959]],[[120561,120561],"mapped",[960]],[[120562,120562],"mapped",[961]],[[120563,120563],"mapped",[952]],[[120564,120564],"mapped",[963]],[[120565,120565],"mapped",[964]],[[120566,120566],"mapped",[965]],[[120567,120567],"mapped",[966]],[[120568,120568],"mapped",[967]],[[120569,120569],"mapped",[968]],[[120570,120570],"mapped",[969]],[[120571,120571],"mapped",[8711]],[[120572,120572],"mapped",[945]],[[120573,120573],"mapped",[946]],[[120574,120574],"mapped",[947]],[[120575,120575],"mapped",[948]],[[120576,120576],"mapped",[949]],[[120577,120577],"mapped",[950]],[[120578,120578],"mapped",[951]],[[120579,120579],"mapped",[952]],[[120580,120580],"mapped",[953]],[[120581,120581],"mapped",[954]],[[120582,120582],"mapped",[955]],[[120583,120583],"mapped",[956]],[[120584,120584],"mapped",[957]],[[120585,120585],"mapped",[958]],[[120586,120586],"mapped",[959]],[[120587,120587],"mapped",[960]],[[120588,120588],"mapped",[961]],[[120589,120590],"mapped",[963]],[[120591,120591],"mapped",[964]],[[120592,120592],"mapped",[965]],[[120593,120593],"mapped",[966]],[[120594,120594],"mapped",[967]],[[120595,120595],"mapped",[968]],[[120596,120596],"mapped",[969]],[[120597,120597],"mapped",[8706]],[[120598,120598],"mapped",[949]],[[120599,120599],"mapped",[952]],[[120600,120600],"mapped",[954]],[[120601,120601],"mapped",[966]],[[120602,120602],"mapped",[961]],[[120603,120603],"mapped",[960]],[[120604,120604],"mapped",[945]],[[120605,120605],"mapped",[946]],[[120606,120606],"mapped",[947]],[[120607,120607],"mapped",[948]],[[120608,120608],"mapped",[949]],[[120609,120609],"mapped",[950]],[[120610,120610],"mapped",[951]],[[120611,120611],"mapped",[952]],[[120612,120612],"mapped",[953]],[[120613,120613],"mapped",[954]],[[120614,120614],"mapped",[955]],[[120615,120615],"mapped",[956]],[[120616,120616],"mapped",[957]],[[120617,120617],"mapped",[958]],[[120618,120618],"mapped",[959]],[[120619,120619],"mapped",[960]],[[120620,120620],"mapped",[961]],[[120621,120621],"mapped",[952]],[[120622,120622],"mapped",[963]],[[120623,120623],"mapped",[964]],[[120624,120624],"mapped",[965]],[[120625,120625],"mapped",[966]],[[120626,120626],"mapped",[967]],[[120627,120627],"mapped",[968]],[[120628,120628],"mapped",[969]],[[120629,120629],"mapped",[8711]],[[120630,120630],"mapped",[945]],[[120631,120631],"mapped",[946]],[[120632,120632],"mapped",[947]],[[120633,120633],"mapped",[948]],[[120634,120634],"mapped",[949]],[[120635,120635],"mapped",[950]],[[120636,120636],"mapped",[951]],[[120637,120637],"mapped",[952]],[[120638,120638],"mapped",[953]],[[120639,120639],"mapped",[954]],[[120640,120640],"mapped",[955]],[[120641,120641],"mapped",[956]],[[120642,120642],"mapped",[957]],[[120643,120643],"mapped",[958]],[[120644,120644],"mapped",[959]],[[120645,120645],"mapped",[960]],[[120646,120646],"mapped",[961]],[[120647,120648],"mapped",[963]],[[120649,120649],"mapped",[964]],[[120650,120650],"mapped",[965]],[[120651,120651],"mapped",[966]],[[120652,120652],"mapped",[967]],[[120653,120653],"mapped",[968]],[[120654,120654],"mapped",[969]],[[120655,120655],"mapped",[8706]],[[120656,120656],"mapped",[949]],[[120657,120657],"mapped",[952]],[[120658,120658],"mapped",[954]],[[120659,120659],"mapped",[966]],[[120660,120660],"mapped",[961]],[[120661,120661],"mapped",[960]],[[120662,120662],"mapped",[945]],[[120663,120663],"mapped",[946]],[[120664,120664],"mapped",[947]],[[120665,120665],"mapped",[948]],[[120666,120666],"mapped",[949]],[[120667,120667],"mapped",[950]],[[120668,120668],"mapped",[951]],[[120669,120669],"mapped",[952]],[[120670,120670],"mapped",[953]],[[120671,120671],"mapped",[954]],[[120672,120672],"mapped",[955]],[[120673,120673],"mapped",[956]],[[120674,120674],"mapped",[957]],[[120675,120675],"mapped",[958]],[[120676,120676],"mapped",[959]],[[120677,120677],"mapped",[960]],[[120678,120678],"mapped",[961]],[[120679,120679],"mapped",[952]],[[120680,120680],"mapped",[963]],[[120681,120681],"mapped",[964]],[[120682,120682],"mapped",[965]],[[120683,120683],"mapped",[966]],[[120684,120684],"mapped",[967]],[[120685,120685],"mapped",[968]],[[120686,120686],"mapped",[969]],[[120687,120687],"mapped",[8711]],[[120688,120688],"mapped",[945]],[[120689,120689],"mapped",[946]],[[120690,120690],"mapped",[947]],[[120691,120691],"mapped",[948]],[[120692,120692],"mapped",[949]],[[120693,120693],"mapped",[950]],[[120694,120694],"mapped",[951]],[[120695,120695],"mapped",[952]],[[120696,120696],"mapped",[953]],[[120697,120697],"mapped",[954]],[[120698,120698],"mapped",[955]],[[120699,120699],"mapped",[956]],[[120700,120700],"mapped",[957]],[[120701,120701],"mapped",[958]],[[120702,120702],"mapped",[959]],[[120703,120703],"mapped",[960]],[[120704,120704],"mapped",[961]],[[120705,120706],"mapped",[963]],[[120707,120707],"mapped",[964]],[[120708,120708],"mapped",[965]],[[120709,120709],"mapped",[966]],[[120710,120710],"mapped",[967]],[[120711,120711],"mapped",[968]],[[120712,120712],"mapped",[969]],[[120713,120713],"mapped",[8706]],[[120714,120714],"mapped",[949]],[[120715,120715],"mapped",[952]],[[120716,120716],"mapped",[954]],[[120717,120717],"mapped",[966]],[[120718,120718],"mapped",[961]],[[120719,120719],"mapped",[960]],[[120720,120720],"mapped",[945]],[[120721,120721],"mapped",[946]],[[120722,120722],"mapped",[947]],[[120723,120723],"mapped",[948]],[[120724,120724],"mapped",[949]],[[120725,120725],"mapped",[950]],[[120726,120726],"mapped",[951]],[[120727,120727],"mapped",[952]],[[120728,120728],"mapped",[953]],[[120729,120729],"mapped",[954]],[[120730,120730],"mapped",[955]],[[120731,120731],"mapped",[956]],[[120732,120732],"mapped",[957]],[[120733,120733],"mapped",[958]],[[120734,120734],"mapped",[959]],[[120735,120735],"mapped",[960]],[[120736,120736],"mapped",[961]],[[120737,120737],"mapped",[952]],[[120738,120738],"mapped",[963]],[[120739,120739],"mapped",[964]],[[120740,120740],"mapped",[965]],[[120741,120741],"mapped",[966]],[[120742,120742],"mapped",[967]],[[120743,120743],"mapped",[968]],[[120744,120744],"mapped",[969]],[[120745,120745],"mapped",[8711]],[[120746,120746],"mapped",[945]],[[120747,120747],"mapped",[946]],[[120748,120748],"mapped",[947]],[[120749,120749],"mapped",[948]],[[120750,120750],"mapped",[949]],[[120751,120751],"mapped",[950]],[[120752,120752],"mapped",[951]],[[120753,120753],"mapped",[952]],[[120754,120754],"mapped",[953]],[[120755,120755],"mapped",[954]],[[120756,120756],"mapped",[955]],[[120757,120757],"mapped",[956]],[[120758,120758],"mapped",[957]],[[120759,120759],"mapped",[958]],[[120760,120760],"mapped",[959]],[[120761,120761],"mapped",[960]],[[120762,120762],"mapped",[961]],[[120763,120764],"mapped",[963]],[[120765,120765],"mapped",[964]],[[120766,120766],"mapped",[965]],[[120767,120767],"mapped",[966]],[[120768,120768],"mapped",[967]],[[120769,120769],"mapped",[968]],[[120770,120770],"mapped",[969]],[[120771,120771],"mapped",[8706]],[[120772,120772],"mapped",[949]],[[120773,120773],"mapped",[952]],[[120774,120774],"mapped",[954]],[[120775,120775],"mapped",[966]],[[120776,120776],"mapped",[961]],[[120777,120777],"mapped",[960]],[[120778,120779],"mapped",[989]],[[120780,120781],"disallowed"],[[120782,120782],"mapped",[48]],[[120783,120783],"mapped",[49]],[[120784,120784],"mapped",[50]],[[120785,120785],"mapped",[51]],[[120786,120786],"mapped",[52]],[[120787,120787],"mapped",[53]],[[120788,120788],"mapped",[54]],[[120789,120789],"mapped",[55]],[[120790,120790],"mapped",[56]],[[120791,120791],"mapped",[57]],[[120792,120792],"mapped",[48]],[[120793,120793],"mapped",[49]],[[120794,120794],"mapped",[50]],[[120795,120795],"mapped",[51]],[[120796,120796],"mapped",[52]],[[120797,120797],"mapped",[53]],[[120798,120798],"mapped",[54]],[[120799,120799],"mapped",[55]],[[120800,120800],"mapped",[56]],[[120801,120801],"mapped",[57]],[[120802,120802],"mapped",[48]],[[120803,120803],"mapped",[49]],[[120804,120804],"mapped",[50]],[[120805,120805],"mapped",[51]],[[120806,120806],"mapped",[52]],[[120807,120807],"mapped",[53]],[[120808,120808],"mapped",[54]],[[120809,120809],"mapped",[55]],[[120810,120810],"mapped",[56]],[[120811,120811],"mapped",[57]],[[120812,120812],"mapped",[48]],[[120813,120813],"mapped",[49]],[[120814,120814],"mapped",[50]],[[120815,120815],"mapped",[51]],[[120816,120816],"mapped",[52]],[[120817,120817],"mapped",[53]],[[120818,120818],"mapped",[54]],[[120819,120819],"mapped",[55]],[[120820,120820],"mapped",[56]],[[120821,120821],"mapped",[57]],[[120822,120822],"mapped",[48]],[[120823,120823],"mapped",[49]],[[120824,120824],"mapped",[50]],[[120825,120825],"mapped",[51]],[[120826,120826],"mapped",[52]],[[120827,120827],"mapped",[53]],[[120828,120828],"mapped",[54]],[[120829,120829],"mapped",[55]],[[120830,120830],"mapped",[56]],[[120831,120831],"mapped",[57]],[[120832,121343],"valid",[],"NV8"],[[121344,121398],"valid"],[[121399,121402],"valid",[],"NV8"],[[121403,121452],"valid"],[[121453,121460],"valid",[],"NV8"],[[121461,121461],"valid"],[[121462,121475],"valid",[],"NV8"],[[121476,121476],"valid"],[[121477,121483],"valid",[],"NV8"],[[121484,121498],"disallowed"],[[121499,121503],"valid"],[[121504,121504],"disallowed"],[[121505,121519],"valid"],[[121520,124927],"disallowed"],[[124928,125124],"valid"],[[125125,125126],"disallowed"],[[125127,125135],"valid",[],"NV8"],[[125136,125142],"valid"],[[125143,126463],"disallowed"],[[126464,126464],"mapped",[1575]],[[126465,126465],"mapped",[1576]],[[126466,126466],"mapped",[1580]],[[126467,126467],"mapped",[1583]],[[126468,126468],"disallowed"],[[126469,126469],"mapped",[1608]],[[126470,126470],"mapped",[1586]],[[126471,126471],"mapped",[1581]],[[126472,126472],"mapped",[1591]],[[126473,126473],"mapped",[1610]],[[126474,126474],"mapped",[1603]],[[126475,126475],"mapped",[1604]],[[126476,126476],"mapped",[1605]],[[126477,126477],"mapped",[1606]],[[126478,126478],"mapped",[1587]],[[126479,126479],"mapped",[1593]],[[126480,126480],"mapped",[1601]],[[126481,126481],"mapped",[1589]],[[126482,126482],"mapped",[1602]],[[126483,126483],"mapped",[1585]],[[126484,126484],"mapped",[1588]],[[126485,126485],"mapped",[1578]],[[126486,126486],"mapped",[1579]],[[126487,126487],"mapped",[1582]],[[126488,126488],"mapped",[1584]],[[126489,126489],"mapped",[1590]],[[126490,126490],"mapped",[1592]],[[126491,126491],"mapped",[1594]],[[126492,126492],"mapped",[1646]],[[126493,126493],"mapped",[1722]],[[126494,126494],"mapped",[1697]],[[126495,126495],"mapped",[1647]],[[126496,126496],"disallowed"],[[126497,126497],"mapped",[1576]],[[126498,126498],"mapped",[1580]],[[126499,126499],"disallowed"],[[126500,126500],"mapped",[1607]],[[126501,126502],"disallowed"],[[126503,126503],"mapped",[1581]],[[126504,126504],"disallowed"],[[126505,126505],"mapped",[1610]],[[126506,126506],"mapped",[1603]],[[126507,126507],"mapped",[1604]],[[126508,126508],"mapped",[1605]],[[126509,126509],"mapped",[1606]],[[126510,126510],"mapped",[1587]],[[126511,126511],"mapped",[1593]],[[126512,126512],"mapped",[1601]],[[126513,126513],"mapped",[1589]],[[126514,126514],"mapped",[1602]],[[126515,126515],"disallowed"],[[126516,126516],"mapped",[1588]],[[126517,126517],"mapped",[1578]],[[126518,126518],"mapped",[1579]],[[126519,126519],"mapped",[1582]],[[126520,126520],"disallowed"],[[126521,126521],"mapped",[1590]],[[126522,126522],"disallowed"],[[126523,126523],"mapped",[1594]],[[126524,126529],"disallowed"],[[126530,126530],"mapped",[1580]],[[126531,126534],"disallowed"],[[126535,126535],"mapped",[1581]],[[126536,126536],"disallowed"],[[126537,126537],"mapped",[1610]],[[126538,126538],"disallowed"],[[126539,126539],"mapped",[1604]],[[126540,126540],"disallowed"],[[126541,126541],"mapped",[1606]],[[126542,126542],"mapped",[1587]],[[126543,126543],"mapped",[1593]],[[126544,126544],"disallowed"],[[126545,126545],"mapped",[1589]],[[126546,126546],"mapped",[1602]],[[126547,126547],"disallowed"],[[126548,126548],"mapped",[1588]],[[126549,126550],"disallowed"],[[126551,126551],"mapped",[1582]],[[126552,126552],"disallowed"],[[126553,126553],"mapped",[1590]],[[126554,126554],"disallowed"],[[126555,126555],"mapped",[1594]],[[126556,126556],"disallowed"],[[126557,126557],"mapped",[1722]],[[126558,126558],"disallowed"],[[126559,126559],"mapped",[1647]],[[126560,126560],"disallowed"],[[126561,126561],"mapped",[1576]],[[126562,126562],"mapped",[1580]],[[126563,126563],"disallowed"],[[126564,126564],"mapped",[1607]],[[126565,126566],"disallowed"],[[126567,126567],"mapped",[1581]],[[126568,126568],"mapped",[1591]],[[126569,126569],"mapped",[1610]],[[126570,126570],"mapped",[1603]],[[126571,126571],"disallowed"],[[126572,126572],"mapped",[1605]],[[126573,126573],"mapped",[1606]],[[126574,126574],"mapped",[1587]],[[126575,126575],"mapped",[1593]],[[126576,126576],"mapped",[1601]],[[126577,126577],"mapped",[1589]],[[126578,126578],"mapped",[1602]],[[126579,126579],"disallowed"],[[126580,126580],"mapped",[1588]],[[126581,126581],"mapped",[1578]],[[126582,126582],"mapped",[1579]],[[126583,126583],"mapped",[1582]],[[126584,126584],"disallowed"],[[126585,126585],"mapped",[1590]],[[126586,126586],"mapped",[1592]],[[126587,126587],"mapped",[1594]],[[126588,126588],"mapped",[1646]],[[126589,126589],"disallowed"],[[126590,126590],"mapped",[1697]],[[126591,126591],"disallowed"],[[126592,126592],"mapped",[1575]],[[126593,126593],"mapped",[1576]],[[126594,126594],"mapped",[1580]],[[126595,126595],"mapped",[1583]],[[126596,126596],"mapped",[1607]],[[126597,126597],"mapped",[1608]],[[126598,126598],"mapped",[1586]],[[126599,126599],"mapped",[1581]],[[126600,126600],"mapped",[1591]],[[126601,126601],"mapped",[1610]],[[126602,126602],"disallowed"],[[126603,126603],"mapped",[1604]],[[126604,126604],"mapped",[1605]],[[126605,126605],"mapped",[1606]],[[126606,126606],"mapped",[1587]],[[126607,126607],"mapped",[1593]],[[126608,126608],"mapped",[1601]],[[126609,126609],"mapped",[1589]],[[126610,126610],"mapped",[1602]],[[126611,126611],"mapped",[1585]],[[126612,126612],"mapped",[1588]],[[126613,126613],"mapped",[1578]],[[126614,126614],"mapped",[1579]],[[126615,126615],"mapped",[1582]],[[126616,126616],"mapped",[1584]],[[126617,126617],"mapped",[1590]],[[126618,126618],"mapped",[1592]],[[126619,126619],"mapped",[1594]],[[126620,126624],"disallowed"],[[126625,126625],"mapped",[1576]],[[126626,126626],"mapped",[1580]],[[126627,126627],"mapped",[1583]],[[126628,126628],"disallowed"],[[126629,126629],"mapped",[1608]],[[126630,126630],"mapped",[1586]],[[126631,126631],"mapped",[1581]],[[126632,126632],"mapped",[1591]],[[126633,126633],"mapped",[1610]],[[126634,126634],"disallowed"],[[126635,126635],"mapped",[1604]],[[126636,126636],"mapped",[1605]],[[126637,126637],"mapped",[1606]],[[126638,126638],"mapped",[1587]],[[126639,126639],"mapped",[1593]],[[126640,126640],"mapped",[1601]],[[126641,126641],"mapped",[1589]],[[126642,126642],"mapped",[1602]],[[126643,126643],"mapped",[1585]],[[126644,126644],"mapped",[1588]],[[126645,126645],"mapped",[1578]],[[126646,126646],"mapped",[1579]],[[126647,126647],"mapped",[1582]],[[126648,126648],"mapped",[1584]],[[126649,126649],"mapped",[1590]],[[126650,126650],"mapped",[1592]],[[126651,126651],"mapped",[1594]],[[126652,126703],"disallowed"],[[126704,126705],"valid",[],"NV8"],[[126706,126975],"disallowed"],[[126976,127019],"valid",[],"NV8"],[[127020,127023],"disallowed"],[[127024,127123],"valid",[],"NV8"],[[127124,127135],"disallowed"],[[127136,127150],"valid",[],"NV8"],[[127151,127152],"disallowed"],[[127153,127166],"valid",[],"NV8"],[[127167,127167],"valid",[],"NV8"],[[127168,127168],"disallowed"],[[127169,127183],"valid",[],"NV8"],[[127184,127184],"disallowed"],[[127185,127199],"valid",[],"NV8"],[[127200,127221],"valid",[],"NV8"],[[127222,127231],"disallowed"],[[127232,127232],"disallowed"],[[127233,127233],"disallowed_STD3_mapped",[48,44]],[[127234,127234],"disallowed_STD3_mapped",[49,44]],[[127235,127235],"disallowed_STD3_mapped",[50,44]],[[127236,127236],"disallowed_STD3_mapped",[51,44]],[[127237,127237],"disallowed_STD3_mapped",[52,44]],[[127238,127238],"disallowed_STD3_mapped",[53,44]],[[127239,127239],"disallowed_STD3_mapped",[54,44]],[[127240,127240],"disallowed_STD3_mapped",[55,44]],[[127241,127241],"disallowed_STD3_mapped",[56,44]],[[127242,127242],"disallowed_STD3_mapped",[57,44]],[[127243,127244],"valid",[],"NV8"],[[127245,127247],"disallowed"],[[127248,127248],"disallowed_STD3_mapped",[40,97,41]],[[127249,127249],"disallowed_STD3_mapped",[40,98,41]],[[127250,127250],"disallowed_STD3_mapped",[40,99,41]],[[127251,127251],"disallowed_STD3_mapped",[40,100,41]],[[127252,127252],"disallowed_STD3_mapped",[40,101,41]],[[127253,127253],"disallowed_STD3_mapped",[40,102,41]],[[127254,127254],"disallowed_STD3_mapped",[40,103,41]],[[127255,127255],"disallowed_STD3_mapped",[40,104,41]],[[127256,127256],"disallowed_STD3_mapped",[40,105,41]],[[127257,127257],"disallowed_STD3_mapped",[40,106,41]],[[127258,127258],"disallowed_STD3_mapped",[40,107,41]],[[127259,127259],"disallowed_STD3_mapped",[40,108,41]],[[127260,127260],"disallowed_STD3_mapped",[40,109,41]],[[127261,127261],"disallowed_STD3_mapped",[40,110,41]],[[127262,127262],"disallowed_STD3_mapped",[40,111,41]],[[127263,127263],"disallowed_STD3_mapped",[40,112,41]],[[127264,127264],"disallowed_STD3_mapped",[40,113,41]],[[127265,127265],"disallowed_STD3_mapped",[40,114,41]],[[127266,127266],"disallowed_STD3_mapped",[40,115,41]],[[127267,127267],"disallowed_STD3_mapped",[40,116,41]],[[127268,127268],"disallowed_STD3_mapped",[40,117,41]],[[127269,127269],"disallowed_STD3_mapped",[40,118,41]],[[127270,127270],"disallowed_STD3_mapped",[40,119,41]],[[127271,127271],"disallowed_STD3_mapped",[40,120,41]],[[127272,127272],"disallowed_STD3_mapped",[40,121,41]],[[127273,127273],"disallowed_STD3_mapped",[40,122,41]],[[127274,127274],"mapped",[12308,115,12309]],[[127275,127275],"mapped",[99]],[[127276,127276],"mapped",[114]],[[127277,127277],"mapped",[99,100]],[[127278,127278],"mapped",[119,122]],[[127279,127279],"disallowed"],[[127280,127280],"mapped",[97]],[[127281,127281],"mapped",[98]],[[127282,127282],"mapped",[99]],[[127283,127283],"mapped",[100]],[[127284,127284],"mapped",[101]],[[127285,127285],"mapped",[102]],[[127286,127286],"mapped",[103]],[[127287,127287],"mapped",[104]],[[127288,127288],"mapped",[105]],[[127289,127289],"mapped",[106]],[[127290,127290],"mapped",[107]],[[127291,127291],"mapped",[108]],[[127292,127292],"mapped",[109]],[[127293,127293],"mapped",[110]],[[127294,127294],"mapped",[111]],[[127295,127295],"mapped",[112]],[[127296,127296],"mapped",[113]],[[127297,127297],"mapped",[114]],[[127298,127298],"mapped",[115]],[[127299,127299],"mapped",[116]],[[127300,127300],"mapped",[117]],[[127301,127301],"mapped",[118]],[[127302,127302],"mapped",[119]],[[127303,127303],"mapped",[120]],[[127304,127304],"mapped",[121]],[[127305,127305],"mapped",[122]],[[127306,127306],"mapped",[104,118]],[[127307,127307],"mapped",[109,118]],[[127308,127308],"mapped",[115,100]],[[127309,127309],"mapped",[115,115]],[[127310,127310],"mapped",[112,112,118]],[[127311,127311],"mapped",[119,99]],[[127312,127318],"valid",[],"NV8"],[[127319,127319],"valid",[],"NV8"],[[127320,127326],"valid",[],"NV8"],[[127327,127327],"valid",[],"NV8"],[[127328,127337],"valid",[],"NV8"],[[127338,127338],"mapped",[109,99]],[[127339,127339],"mapped",[109,100]],[[127340,127343],"disallowed"],[[127344,127352],"valid",[],"NV8"],[[127353,127353],"valid",[],"NV8"],[[127354,127354],"valid",[],"NV8"],[[127355,127356],"valid",[],"NV8"],[[127357,127358],"valid",[],"NV8"],[[127359,127359],"valid",[],"NV8"],[[127360,127369],"valid",[],"NV8"],[[127370,127373],"valid",[],"NV8"],[[127374,127375],"valid",[],"NV8"],[[127376,127376],"mapped",[100,106]],[[127377,127386],"valid",[],"NV8"],[[127387,127461],"disallowed"],[[127462,127487],"valid",[],"NV8"],[[127488,127488],"mapped",[12411,12363]],[[127489,127489],"mapped",[12467,12467]],[[127490,127490],"mapped",[12469]],[[127491,127503],"disallowed"],[[127504,127504],"mapped",[25163]],[[127505,127505],"mapped",[23383]],[[127506,127506],"mapped",[21452]],[[127507,127507],"mapped",[12487]],[[127508,127508],"mapped",[20108]],[[127509,127509],"mapped",[22810]],[[127510,127510],"mapped",[35299]],[[127511,127511],"mapped",[22825]],[[127512,127512],"mapped",[20132]],[[127513,127513],"mapped",[26144]],[[127514,127514],"mapped",[28961]],[[127515,127515],"mapped",[26009]],[[127516,127516],"mapped",[21069]],[[127517,127517],"mapped",[24460]],[[127518,127518],"mapped",[20877]],[[127519,127519],"mapped",[26032]],[[127520,127520],"mapped",[21021]],[[127521,127521],"mapped",[32066]],[[127522,127522],"mapped",[29983]],[[127523,127523],"mapped",[36009]],[[127524,127524],"mapped",[22768]],[[127525,127525],"mapped",[21561]],[[127526,127526],"mapped",[28436]],[[127527,127527],"mapped",[25237]],[[127528,127528],"mapped",[25429]],[[127529,127529],"mapped",[19968]],[[127530,127530],"mapped",[19977]],[[127531,127531],"mapped",[36938]],[[127532,127532],"mapped",[24038]],[[127533,127533],"mapped",[20013]],[[127534,127534],"mapped",[21491]],[[127535,127535],"mapped",[25351]],[[127536,127536],"mapped",[36208]],[[127537,127537],"mapped",[25171]],[[127538,127538],"mapped",[31105]],[[127539,127539],"mapped",[31354]],[[127540,127540],"mapped",[21512]],[[127541,127541],"mapped",[28288]],[[127542,127542],"mapped",[26377]],[[127543,127543],"mapped",[26376]],[[127544,127544],"mapped",[30003]],[[127545,127545],"mapped",[21106]],[[127546,127546],"mapped",[21942]],[[127547,127551],"disallowed"],[[127552,127552],"mapped",[12308,26412,12309]],[[127553,127553],"mapped",[12308,19977,12309]],[[127554,127554],"mapped",[12308,20108,12309]],[[127555,127555],"mapped",[12308,23433,12309]],[[127556,127556],"mapped",[12308,28857,12309]],[[127557,127557],"mapped",[12308,25171,12309]],[[127558,127558],"mapped",[12308,30423,12309]],[[127559,127559],"mapped",[12308,21213,12309]],[[127560,127560],"mapped",[12308,25943,12309]],[[127561,127567],"disallowed"],[[127568,127568],"mapped",[24471]],[[127569,127569],"mapped",[21487]],[[127570,127743],"disallowed"],[[127744,127776],"valid",[],"NV8"],[[127777,127788],"valid",[],"NV8"],[[127789,127791],"valid",[],"NV8"],[[127792,127797],"valid",[],"NV8"],[[127798,127798],"valid",[],"NV8"],[[127799,127868],"valid",[],"NV8"],[[127869,127869],"valid",[],"NV8"],[[127870,127871],"valid",[],"NV8"],[[127872,127891],"valid",[],"NV8"],[[127892,127903],"valid",[],"NV8"],[[127904,127940],"valid",[],"NV8"],[[127941,127941],"valid",[],"NV8"],[[127942,127946],"valid",[],"NV8"],[[127947,127950],"valid",[],"NV8"],[[127951,127955],"valid",[],"NV8"],[[127956,127967],"valid",[],"NV8"],[[127968,127984],"valid",[],"NV8"],[[127985,127991],"valid",[],"NV8"],[[127992,127999],"valid",[],"NV8"],[[128000,128062],"valid",[],"NV8"],[[128063,128063],"valid",[],"NV8"],[[128064,128064],"valid",[],"NV8"],[[128065,128065],"valid",[],"NV8"],[[128066,128247],"valid",[],"NV8"],[[128248,128248],"valid",[],"NV8"],[[128249,128252],"valid",[],"NV8"],[[128253,128254],"valid",[],"NV8"],[[128255,128255],"valid",[],"NV8"],[[128256,128317],"valid",[],"NV8"],[[128318,128319],"valid",[],"NV8"],[[128320,128323],"valid",[],"NV8"],[[128324,128330],"valid",[],"NV8"],[[128331,128335],"valid",[],"NV8"],[[128336,128359],"valid",[],"NV8"],[[128360,128377],"valid",[],"NV8"],[[128378,128378],"disallowed"],[[128379,128419],"valid",[],"NV8"],[[128420,128420],"disallowed"],[[128421,128506],"valid",[],"NV8"],[[128507,128511],"valid",[],"NV8"],[[128512,128512],"valid",[],"NV8"],[[128513,128528],"valid",[],"NV8"],[[128529,128529],"valid",[],"NV8"],[[128530,128532],"valid",[],"NV8"],[[128533,128533],"valid",[],"NV8"],[[128534,128534],"valid",[],"NV8"],[[128535,128535],"valid",[],"NV8"],[[128536,128536],"valid",[],"NV8"],[[128537,128537],"valid",[],"NV8"],[[128538,128538],"valid",[],"NV8"],[[128539,128539],"valid",[],"NV8"],[[128540,128542],"valid",[],"NV8"],[[128543,128543],"valid",[],"NV8"],[[128544,128549],"valid",[],"NV8"],[[128550,128551],"valid",[],"NV8"],[[128552,128555],"valid",[],"NV8"],[[128556,128556],"valid",[],"NV8"],[[128557,128557],"valid",[],"NV8"],[[128558,128559],"valid",[],"NV8"],[[128560,128563],"valid",[],"NV8"],[[128564,128564],"valid",[],"NV8"],[[128565,128576],"valid",[],"NV8"],[[128577,128578],"valid",[],"NV8"],[[128579,128580],"valid",[],"NV8"],[[128581,128591],"valid",[],"NV8"],[[128592,128639],"valid",[],"NV8"],[[128640,128709],"valid",[],"NV8"],[[128710,128719],"valid",[],"NV8"],[[128720,128720],"valid",[],"NV8"],[[128721,128735],"disallowed"],[[128736,128748],"valid",[],"NV8"],[[128749,128751],"disallowed"],[[128752,128755],"valid",[],"NV8"],[[128756,128767],"disallowed"],[[128768,128883],"valid",[],"NV8"],[[128884,128895],"disallowed"],[[128896,128980],"valid",[],"NV8"],[[128981,129023],"disallowed"],[[129024,129035],"valid",[],"NV8"],[[129036,129039],"disallowed"],[[129040,129095],"valid",[],"NV8"],[[129096,129103],"disallowed"],[[129104,129113],"valid",[],"NV8"],[[129114,129119],"disallowed"],[[129120,129159],"valid",[],"NV8"],[[129160,129167],"disallowed"],[[129168,129197],"valid",[],"NV8"],[[129198,129295],"disallowed"],[[129296,129304],"valid",[],"NV8"],[[129305,129407],"disallowed"],[[129408,129412],"valid",[],"NV8"],[[129413,129471],"disallowed"],[[129472,129472],"valid",[],"NV8"],[[129473,131069],"disallowed"],[[131070,131071],"disallowed"],[[131072,173782],"valid"],[[173783,173823],"disallowed"],[[173824,177972],"valid"],[[177973,177983],"disallowed"],[[177984,178205],"valid"],[[178206,178207],"disallowed"],[[178208,183969],"valid"],[[183970,194559],"disallowed"],[[194560,194560],"mapped",[20029]],[[194561,194561],"mapped",[20024]],[[194562,194562],"mapped",[20033]],[[194563,194563],"mapped",[131362]],[[194564,194564],"mapped",[20320]],[[194565,194565],"mapped",[20398]],[[194566,194566],"mapped",[20411]],[[194567,194567],"mapped",[20482]],[[194568,194568],"mapped",[20602]],[[194569,194569],"mapped",[20633]],[[194570,194570],"mapped",[20711]],[[194571,194571],"mapped",[20687]],[[194572,194572],"mapped",[13470]],[[194573,194573],"mapped",[132666]],[[194574,194574],"mapped",[20813]],[[194575,194575],"mapped",[20820]],[[194576,194576],"mapped",[20836]],[[194577,194577],"mapped",[20855]],[[194578,194578],"mapped",[132380]],[[194579,194579],"mapped",[13497]],[[194580,194580],"mapped",[20839]],[[194581,194581],"mapped",[20877]],[[194582,194582],"mapped",[132427]],[[194583,194583],"mapped",[20887]],[[194584,194584],"mapped",[20900]],[[194585,194585],"mapped",[20172]],[[194586,194586],"mapped",[20908]],[[194587,194587],"mapped",[20917]],[[194588,194588],"mapped",[168415]],[[194589,194589],"mapped",[20981]],[[194590,194590],"mapped",[20995]],[[194591,194591],"mapped",[13535]],[[194592,194592],"mapped",[21051]],[[194593,194593],"mapped",[21062]],[[194594,194594],"mapped",[21106]],[[194595,194595],"mapped",[21111]],[[194596,194596],"mapped",[13589]],[[194597,194597],"mapped",[21191]],[[194598,194598],"mapped",[21193]],[[194599,194599],"mapped",[21220]],[[194600,194600],"mapped",[21242]],[[194601,194601],"mapped",[21253]],[[194602,194602],"mapped",[21254]],[[194603,194603],"mapped",[21271]],[[194604,194604],"mapped",[21321]],[[194605,194605],"mapped",[21329]],[[194606,194606],"mapped",[21338]],[[194607,194607],"mapped",[21363]],[[194608,194608],"mapped",[21373]],[[194609,194611],"mapped",[21375]],[[194612,194612],"mapped",[133676]],[[194613,194613],"mapped",[28784]],[[194614,194614],"mapped",[21450]],[[194615,194615],"mapped",[21471]],[[194616,194616],"mapped",[133987]],[[194617,194617],"mapped",[21483]],[[194618,194618],"mapped",[21489]],[[194619,194619],"mapped",[21510]],[[194620,194620],"mapped",[21662]],[[194621,194621],"mapped",[21560]],[[194622,194622],"mapped",[21576]],[[194623,194623],"mapped",[21608]],[[194624,194624],"mapped",[21666]],[[194625,194625],"mapped",[21750]],[[194626,194626],"mapped",[21776]],[[194627,194627],"mapped",[21843]],[[194628,194628],"mapped",[21859]],[[194629,194630],"mapped",[21892]],[[194631,194631],"mapped",[21913]],[[194632,194632],"mapped",[21931]],[[194633,194633],"mapped",[21939]],[[194634,194634],"mapped",[21954]],[[194635,194635],"mapped",[22294]],[[194636,194636],"mapped",[22022]],[[194637,194637],"mapped",[22295]],[[194638,194638],"mapped",[22097]],[[194639,194639],"mapped",[22132]],[[194640,194640],"mapped",[20999]],[[194641,194641],"mapped",[22766]],[[194642,194642],"mapped",[22478]],[[194643,194643],"mapped",[22516]],[[194644,194644],"mapped",[22541]],[[194645,194645],"mapped",[22411]],[[194646,194646],"mapped",[22578]],[[194647,194647],"mapped",[22577]],[[194648,194648],"mapped",[22700]],[[194649,194649],"mapped",[136420]],[[194650,194650],"mapped",[22770]],[[194651,194651],"mapped",[22775]],[[194652,194652],"mapped",[22790]],[[194653,194653],"mapped",[22810]],[[194654,194654],"mapped",[22818]],[[194655,194655],"mapped",[22882]],[[194656,194656],"mapped",[136872]],[[194657,194657],"mapped",[136938]],[[194658,194658],"mapped",[23020]],[[194659,194659],"mapped",[23067]],[[194660,194660],"mapped",[23079]],[[194661,194661],"mapped",[23000]],[[194662,194662],"mapped",[23142]],[[194663,194663],"mapped",[14062]],[[194664,194664],"disallowed"],[[194665,194665],"mapped",[23304]],[[194666,194667],"mapped",[23358]],[[194668,194668],"mapped",[137672]],[[194669,194669],"mapped",[23491]],[[194670,194670],"mapped",[23512]],[[194671,194671],"mapped",[23527]],[[194672,194672],"mapped",[23539]],[[194673,194673],"mapped",[138008]],[[194674,194674],"mapped",[23551]],[[194675,194675],"mapped",[23558]],[[194676,194676],"disallowed"],[[194677,194677],"mapped",[23586]],[[194678,194678],"mapped",[14209]],[[194679,194679],"mapped",[23648]],[[194680,194680],"mapped",[23662]],[[194681,194681],"mapped",[23744]],[[194682,194682],"mapped",[23693]],[[194683,194683],"mapped",[138724]],[[194684,194684],"mapped",[23875]],[[194685,194685],"mapped",[138726]],[[194686,194686],"mapped",[23918]],[[194687,194687],"mapped",[23915]],[[194688,194688],"mapped",[23932]],[[194689,194689],"mapped",[24033]],[[194690,194690],"mapped",[24034]],[[194691,194691],"mapped",[14383]],[[194692,194692],"mapped",[24061]],[[194693,194693],"mapped",[24104]],[[194694,194694],"mapped",[24125]],[[194695,194695],"mapped",[24169]],[[194696,194696],"mapped",[14434]],[[194697,194697],"mapped",[139651]],[[194698,194698],"mapped",[14460]],[[194699,194699],"mapped",[24240]],[[194700,194700],"mapped",[24243]],[[194701,194701],"mapped",[24246]],[[194702,194702],"mapped",[24266]],[[194703,194703],"mapped",[172946]],[[194704,194704],"mapped",[24318]],[[194705,194706],"mapped",[140081]],[[194707,194707],"mapped",[33281]],[[194708,194709],"mapped",[24354]],[[194710,194710],"mapped",[14535]],[[194711,194711],"mapped",[144056]],[[194712,194712],"mapped",[156122]],[[194713,194713],"mapped",[24418]],[[194714,194714],"mapped",[24427]],[[194715,194715],"mapped",[14563]],[[194716,194716],"mapped",[24474]],[[194717,194717],"mapped",[24525]],[[194718,194718],"mapped",[24535]],[[194719,194719],"mapped",[24569]],[[194720,194720],"mapped",[24705]],[[194721,194721],"mapped",[14650]],[[194722,194722],"mapped",[14620]],[[194723,194723],"mapped",[24724]],[[194724,194724],"mapped",[141012]],[[194725,194725],"mapped",[24775]],[[194726,194726],"mapped",[24904]],[[194727,194727],"mapped",[24908]],[[194728,194728],"mapped",[24910]],[[194729,194729],"mapped",[24908]],[[194730,194730],"mapped",[24954]],[[194731,194731],"mapped",[24974]],[[194732,194732],"mapped",[25010]],[[194733,194733],"mapped",[24996]],[[194734,194734],"mapped",[25007]],[[194735,194735],"mapped",[25054]],[[194736,194736],"mapped",[25074]],[[194737,194737],"mapped",[25078]],[[194738,194738],"mapped",[25104]],[[194739,194739],"mapped",[25115]],[[194740,194740],"mapped",[25181]],[[194741,194741],"mapped",[25265]],[[194742,194742],"mapped",[25300]],[[194743,194743],"mapped",[25424]],[[194744,194744],"mapped",[142092]],[[194745,194745],"mapped",[25405]],[[194746,194746],"mapped",[25340]],[[194747,194747],"mapped",[25448]],[[194748,194748],"mapped",[25475]],[[194749,194749],"mapped",[25572]],[[194750,194750],"mapped",[142321]],[[194751,194751],"mapped",[25634]],[[194752,194752],"mapped",[25541]],[[194753,194753],"mapped",[25513]],[[194754,194754],"mapped",[14894]],[[194755,194755],"mapped",[25705]],[[194756,194756],"mapped",[25726]],[[194757,194757],"mapped",[25757]],[[194758,194758],"mapped",[25719]],[[194759,194759],"mapped",[14956]],[[194760,194760],"mapped",[25935]],[[194761,194761],"mapped",[25964]],[[194762,194762],"mapped",[143370]],[[194763,194763],"mapped",[26083]],[[194764,194764],"mapped",[26360]],[[194765,194765],"mapped",[26185]],[[194766,194766],"mapped",[15129]],[[194767,194767],"mapped",[26257]],[[194768,194768],"mapped",[15112]],[[194769,194769],"mapped",[15076]],[[194770,194770],"mapped",[20882]],[[194771,194771],"mapped",[20885]],[[194772,194772],"mapped",[26368]],[[194773,194773],"mapped",[26268]],[[194774,194774],"mapped",[32941]],[[194775,194775],"mapped",[17369]],[[194776,194776],"mapped",[26391]],[[194777,194777],"mapped",[26395]],[[194778,194778],"mapped",[26401]],[[194779,194779],"mapped",[26462]],[[194780,194780],"mapped",[26451]],[[194781,194781],"mapped",[144323]],[[194782,194782],"mapped",[15177]],[[194783,194783],"mapped",[26618]],[[194784,194784],"mapped",[26501]],[[194785,194785],"mapped",[26706]],[[194786,194786],"mapped",[26757]],[[194787,194787],"mapped",[144493]],[[194788,194788],"mapped",[26766]],[[194789,194789],"mapped",[26655]],[[194790,194790],"mapped",[26900]],[[194791,194791],"mapped",[15261]],[[194792,194792],"mapped",[26946]],[[194793,194793],"mapped",[27043]],[[194794,194794],"mapped",[27114]],[[194795,194795],"mapped",[27304]],[[194796,194796],"mapped",[145059]],[[194797,194797],"mapped",[27355]],[[194798,194798],"mapped",[15384]],[[194799,194799],"mapped",[27425]],[[194800,194800],"mapped",[145575]],[[194801,194801],"mapped",[27476]],[[194802,194802],"mapped",[15438]],[[194803,194803],"mapped",[27506]],[[194804,194804],"mapped",[27551]],[[194805,194805],"mapped",[27578]],[[194806,194806],"mapped",[27579]],[[194807,194807],"mapped",[146061]],[[194808,194808],"mapped",[138507]],[[194809,194809],"mapped",[146170]],[[194810,194810],"mapped",[27726]],[[194811,194811],"mapped",[146620]],[[194812,194812],"mapped",[27839]],[[194813,194813],"mapped",[27853]],[[194814,194814],"mapped",[27751]],[[194815,194815],"mapped",[27926]],[[194816,194816],"mapped",[27966]],[[194817,194817],"mapped",[28023]],[[194818,194818],"mapped",[27969]],[[194819,194819],"mapped",[28009]],[[194820,194820],"mapped",[28024]],[[194821,194821],"mapped",[28037]],[[194822,194822],"mapped",[146718]],[[194823,194823],"mapped",[27956]],[[194824,194824],"mapped",[28207]],[[194825,194825],"mapped",[28270]],[[194826,194826],"mapped",[15667]],[[194827,194827],"mapped",[28363]],[[194828,194828],"mapped",[28359]],[[194829,194829],"mapped",[147153]],[[194830,194830],"mapped",[28153]],[[194831,194831],"mapped",[28526]],[[194832,194832],"mapped",[147294]],[[194833,194833],"mapped",[147342]],[[194834,194834],"mapped",[28614]],[[194835,194835],"mapped",[28729]],[[194836,194836],"mapped",[28702]],[[194837,194837],"mapped",[28699]],[[194838,194838],"mapped",[15766]],[[194839,194839],"mapped",[28746]],[[194840,194840],"mapped",[28797]],[[194841,194841],"mapped",[28791]],[[194842,194842],"mapped",[28845]],[[194843,194843],"mapped",[132389]],[[194844,194844],"mapped",[28997]],[[194845,194845],"mapped",[148067]],[[194846,194846],"mapped",[29084]],[[194847,194847],"disallowed"],[[194848,194848],"mapped",[29224]],[[194849,194849],"mapped",[29237]],[[194850,194850],"mapped",[29264]],[[194851,194851],"mapped",[149000]],[[194852,194852],"mapped",[29312]],[[194853,194853],"mapped",[29333]],[[194854,194854],"mapped",[149301]],[[194855,194855],"mapped",[149524]],[[194856,194856],"mapped",[29562]],[[194857,194857],"mapped",[29579]],[[194858,194858],"mapped",[16044]],[[194859,194859],"mapped",[29605]],[[194860,194861],"mapped",[16056]],[[194862,194862],"mapped",[29767]],[[194863,194863],"mapped",[29788]],[[194864,194864],"mapped",[29809]],[[194865,194865],"mapped",[29829]],[[194866,194866],"mapped",[29898]],[[194867,194867],"mapped",[16155]],[[194868,194868],"mapped",[29988]],[[194869,194869],"mapped",[150582]],[[194870,194870],"mapped",[30014]],[[194871,194871],"mapped",[150674]],[[194872,194872],"mapped",[30064]],[[194873,194873],"mapped",[139679]],[[194874,194874],"mapped",[30224]],[[194875,194875],"mapped",[151457]],[[194876,194876],"mapped",[151480]],[[194877,194877],"mapped",[151620]],[[194878,194878],"mapped",[16380]],[[194879,194879],"mapped",[16392]],[[194880,194880],"mapped",[30452]],[[194881,194881],"mapped",[151795]],[[194882,194882],"mapped",[151794]],[[194883,194883],"mapped",[151833]],[[194884,194884],"mapped",[151859]],[[194885,194885],"mapped",[30494]],[[194886,194887],"mapped",[30495]],[[194888,194888],"mapped",[30538]],[[194889,194889],"mapped",[16441]],[[194890,194890],"mapped",[30603]],[[194891,194891],"mapped",[16454]],[[194892,194892],"mapped",[16534]],[[194893,194893],"mapped",[152605]],[[194894,194894],"mapped",[30798]],[[194895,194895],"mapped",[30860]],[[194896,194896],"mapped",[30924]],[[194897,194897],"mapped",[16611]],[[194898,194898],"mapped",[153126]],[[194899,194899],"mapped",[31062]],[[194900,194900],"mapped",[153242]],[[194901,194901],"mapped",[153285]],[[194902,194902],"mapped",[31119]],[[194903,194903],"mapped",[31211]],[[194904,194904],"mapped",[16687]],[[194905,194905],"mapped",[31296]],[[194906,194906],"mapped",[31306]],[[194907,194907],"mapped",[31311]],[[194908,194908],"mapped",[153980]],[[194909,194910],"mapped",[154279]],[[194911,194911],"disallowed"],[[194912,194912],"mapped",[16898]],[[194913,194913],"mapped",[154539]],[[194914,194914],"mapped",[31686]],[[194915,194915],"mapped",[31689]],[[194916,194916],"mapped",[16935]],[[194917,194917],"mapped",[154752]],[[194918,194918],"mapped",[31954]],[[194919,194919],"mapped",[17056]],[[194920,194920],"mapped",[31976]],[[194921,194921],"mapped",[31971]],[[194922,194922],"mapped",[32000]],[[194923,194923],"mapped",[155526]],[[194924,194924],"mapped",[32099]],[[194925,194925],"mapped",[17153]],[[194926,194926],"mapped",[32199]],[[194927,194927],"mapped",[32258]],[[194928,194928],"mapped",[32325]],[[194929,194929],"mapped",[17204]],[[194930,194930],"mapped",[156200]],[[194931,194931],"mapped",[156231]],[[194932,194932],"mapped",[17241]],[[194933,194933],"mapped",[156377]],[[194934,194934],"mapped",[32634]],[[194935,194935],"mapped",[156478]],[[194936,194936],"mapped",[32661]],[[194937,194937],"mapped",[32762]],[[194938,194938],"mapped",[32773]],[[194939,194939],"mapped",[156890]],[[194940,194940],"mapped",[156963]],[[194941,194941],"mapped",[32864]],[[194942,194942],"mapped",[157096]],[[194943,194943],"mapped",[32880]],[[194944,194944],"mapped",[144223]],[[194945,194945],"mapped",[17365]],[[194946,194946],"mapped",[32946]],[[194947,194947],"mapped",[33027]],[[194948,194948],"mapped",[17419]],[[194949,194949],"mapped",[33086]],[[194950,194950],"mapped",[23221]],[[194951,194951],"mapped",[157607]],[[194952,194952],"mapped",[157621]],[[194953,194953],"mapped",[144275]],[[194954,194954],"mapped",[144284]],[[194955,194955],"mapped",[33281]],[[194956,194956],"mapped",[33284]],[[194957,194957],"mapped",[36766]],[[194958,194958],"mapped",[17515]],[[194959,194959],"mapped",[33425]],[[194960,194960],"mapped",[33419]],[[194961,194961],"mapped",[33437]],[[194962,194962],"mapped",[21171]],[[194963,194963],"mapped",[33457]],[[194964,194964],"mapped",[33459]],[[194965,194965],"mapped",[33469]],[[194966,194966],"mapped",[33510]],[[194967,194967],"mapped",[158524]],[[194968,194968],"mapped",[33509]],[[194969,194969],"mapped",[33565]],[[194970,194970],"mapped",[33635]],[[194971,194971],"mapped",[33709]],[[194972,194972],"mapped",[33571]],[[194973,194973],"mapped",[33725]],[[194974,194974],"mapped",[33767]],[[194975,194975],"mapped",[33879]],[[194976,194976],"mapped",[33619]],[[194977,194977],"mapped",[33738]],[[194978,194978],"mapped",[33740]],[[194979,194979],"mapped",[33756]],[[194980,194980],"mapped",[158774]],[[194981,194981],"mapped",[159083]],[[194982,194982],"mapped",[158933]],[[194983,194983],"mapped",[17707]],[[194984,194984],"mapped",[34033]],[[194985,194985],"mapped",[34035]],[[194986,194986],"mapped",[34070]],[[194987,194987],"mapped",[160714]],[[194988,194988],"mapped",[34148]],[[194989,194989],"mapped",[159532]],[[194990,194990],"mapped",[17757]],[[194991,194991],"mapped",[17761]],[[194992,194992],"mapped",[159665]],[[194993,194993],"mapped",[159954]],[[194994,194994],"mapped",[17771]],[[194995,194995],"mapped",[34384]],[[194996,194996],"mapped",[34396]],[[194997,194997],"mapped",[34407]],[[194998,194998],"mapped",[34409]],[[194999,194999],"mapped",[34473]],[[195000,195000],"mapped",[34440]],[[195001,195001],"mapped",[34574]],[[195002,195002],"mapped",[34530]],[[195003,195003],"mapped",[34681]],[[195004,195004],"mapped",[34600]],[[195005,195005],"mapped",[34667]],[[195006,195006],"mapped",[34694]],[[195007,195007],"disallowed"],[[195008,195008],"mapped",[34785]],[[195009,195009],"mapped",[34817]],[[195010,195010],"mapped",[17913]],[[195011,195011],"mapped",[34912]],[[195012,195012],"mapped",[34915]],[[195013,195013],"mapped",[161383]],[[195014,195014],"mapped",[35031]],[[195015,195015],"mapped",[35038]],[[195016,195016],"mapped",[17973]],[[195017,195017],"mapped",[35066]],[[195018,195018],"mapped",[13499]],[[195019,195019],"mapped",[161966]],[[195020,195020],"mapped",[162150]],[[195021,195021],"mapped",[18110]],[[195022,195022],"mapped",[18119]],[[195023,195023],"mapped",[35488]],[[195024,195024],"mapped",[35565]],[[195025,195025],"mapped",[35722]],[[195026,195026],"mapped",[35925]],[[195027,195027],"mapped",[162984]],[[195028,195028],"mapped",[36011]],[[195029,195029],"mapped",[36033]],[[195030,195030],"mapped",[36123]],[[195031,195031],"mapped",[36215]],[[195032,195032],"mapped",[163631]],[[195033,195033],"mapped",[133124]],[[195034,195034],"mapped",[36299]],[[195035,195035],"mapped",[36284]],[[195036,195036],"mapped",[36336]],[[195037,195037],"mapped",[133342]],[[195038,195038],"mapped",[36564]],[[195039,195039],"mapped",[36664]],[[195040,195040],"mapped",[165330]],[[195041,195041],"mapped",[165357]],[[195042,195042],"mapped",[37012]],[[195043,195043],"mapped",[37105]],[[195044,195044],"mapped",[37137]],[[195045,195045],"mapped",[165678]],[[195046,195046],"mapped",[37147]],[[195047,195047],"mapped",[37432]],[[195048,195048],"mapped",[37591]],[[195049,195049],"mapped",[37592]],[[195050,195050],"mapped",[37500]],[[195051,195051],"mapped",[37881]],[[195052,195052],"mapped",[37909]],[[195053,195053],"mapped",[166906]],[[195054,195054],"mapped",[38283]],[[195055,195055],"mapped",[18837]],[[195056,195056],"mapped",[38327]],[[195057,195057],"mapped",[167287]],[[195058,195058],"mapped",[18918]],[[195059,195059],"mapped",[38595]],[[195060,195060],"mapped",[23986]],[[195061,195061],"mapped",[38691]],[[195062,195062],"mapped",[168261]],[[195063,195063],"mapped",[168474]],[[195064,195064],"mapped",[19054]],[[195065,195065],"mapped",[19062]],[[195066,195066],"mapped",[38880]],[[195067,195067],"mapped",[168970]],[[195068,195068],"mapped",[19122]],[[195069,195069],"mapped",[169110]],[[195070,195071],"mapped",[38923]],[[195072,195072],"mapped",[38953]],[[195073,195073],"mapped",[169398]],[[195074,195074],"mapped",[39138]],[[195075,195075],"mapped",[19251]],[[195076,195076],"mapped",[39209]],[[195077,195077],"mapped",[39335]],[[195078,195078],"mapped",[39362]],[[195079,195079],"mapped",[39422]],[[195080,195080],"mapped",[19406]],[[195081,195081],"mapped",[170800]],[[195082,195082],"mapped",[39698]],[[195083,195083],"mapped",[40000]],[[195084,195084],"mapped",[40189]],[[195085,195085],"mapped",[19662]],[[195086,195086],"mapped",[19693]],[[195087,195087],"mapped",[40295]],[[195088,195088],"mapped",[172238]],[[195089,195089],"mapped",[19704]],[[195090,195090],"mapped",[172293]],[[195091,195091],"mapped",[172558]],[[195092,195092],"mapped",[172689]],[[195093,195093],"mapped",[40635]],[[195094,195094],"mapped",[19798]],[[195095,195095],"mapped",[40697]],[[195096,195096],"mapped",[40702]],[[195097,195097],"mapped",[40709]],[[195098,195098],"mapped",[40719]],[[195099,195099],"mapped",[40726]],[[195100,195100],"mapped",[40763]],[[195101,195101],"mapped",[173568]],[[195102,196605],"disallowed"],[[196606,196607],"disallowed"],[[196608,262141],"disallowed"],[[262142,262143],"disallowed"],[[262144,327677],"disallowed"],[[327678,327679],"disallowed"],[[327680,393213],"disallowed"],[[393214,393215],"disallowed"],[[393216,458749],"disallowed"],[[458750,458751],"disallowed"],[[458752,524285],"disallowed"],[[524286,524287],"disallowed"],[[524288,589821],"disallowed"],[[589822,589823],"disallowed"],[[589824,655357],"disallowed"],[[655358,655359],"disallowed"],[[655360,720893],"disallowed"],[[720894,720895],"disallowed"],[[720896,786429],"disallowed"],[[786430,786431],"disallowed"],[[786432,851965],"disallowed"],[[851966,851967],"disallowed"],[[851968,917501],"disallowed"],[[917502,917503],"disallowed"],[[917504,917504],"disallowed"],[[917505,917505],"disallowed"],[[917506,917535],"disallowed"],[[917536,917631],"disallowed"],[[917632,917759],"disallowed"],[[917760,917999],"ignored"],[[918000,983037],"disallowed"],[[983038,983039],"disallowed"],[[983040,1048573],"disallowed"],[[1048574,1048575],"disallowed"],[[1048576,1114109],"disallowed"],[[1114110,1114111],"disallowed"]] \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/tr46/package.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/tr46/package.json deleted file mode 100644 index b6826da1..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/tr46/package.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "name": "tr46", - "version": "0.0.3", - "description": "An implementation of the Unicode TR46 spec", - "main": "index.js", - "scripts": { - "test": "mocha", - "pretest": "node scripts/getLatestUnicodeTests.js", - "prepublish": "node scripts/generateMappingTable.js" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/Sebmaster/tr46.js.git" - }, - "keywords": [ - "unicode", - "tr46", - "url", - "whatwg" - ], - "author": "Sebastian Mayr ", - "license": "MIT", - "bugs": { - "url": "https://github.com/Sebmaster/tr46.js/issues" - }, - "homepage": "https://github.com/Sebmaster/tr46.js#readme", - "devDependencies": { - "mocha": "^2.2.5", - "request": "^2.57.0" - } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/tslib/CopyrightNotice.txt b/packages/wyatt_notification_bloc/example/scripts/node_modules/tslib/CopyrightNotice.txt deleted file mode 100644 index 0e425423..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/tslib/CopyrightNotice.txt +++ /dev/null @@ -1,15 +0,0 @@ -/****************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */ - diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/tslib/LICENSE.txt b/packages/wyatt_notification_bloc/example/scripts/node_modules/tslib/LICENSE.txt deleted file mode 100644 index bfe6430c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/tslib/LICENSE.txt +++ /dev/null @@ -1,12 +0,0 @@ -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/tslib/README.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/tslib/README.md deleted file mode 100644 index 72ff8e79..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/tslib/README.md +++ /dev/null @@ -1,164 +0,0 @@ -# tslib - -This is a runtime library for [TypeScript](http://www.typescriptlang.org/) that contains all of the TypeScript helper functions. - -This library is primarily used by the `--importHelpers` flag in TypeScript. -When using `--importHelpers`, a module that uses helper functions like `__extends` and `__assign` in the following emitted file: - -```ts -var __assign = (this && this.__assign) || Object.assign || function(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; -}; -exports.x = {}; -exports.y = __assign({}, exports.x); - -``` - -will instead be emitted as something like the following: - -```ts -var tslib_1 = require("tslib"); -exports.x = {}; -exports.y = tslib_1.__assign({}, exports.x); -``` - -Because this can avoid duplicate declarations of things like `__extends`, `__assign`, etc., this means delivering users smaller files on average, as well as less runtime overhead. -For optimized bundles with TypeScript, you should absolutely consider using `tslib` and `--importHelpers`. - -# Installing - -For the latest stable version, run: - -## npm - -```sh -# TypeScript 3.9.2 or later -npm install tslib - -# TypeScript 3.8.4 or earlier -npm install tslib@^1 - -# TypeScript 2.3.2 or earlier -npm install tslib@1.6.1 -``` - -## yarn - -```sh -# TypeScript 3.9.2 or later -yarn add tslib - -# TypeScript 3.8.4 or earlier -yarn add tslib@^1 - -# TypeScript 2.3.2 or earlier -yarn add tslib@1.6.1 -``` - -## bower - -```sh -# TypeScript 3.9.2 or later -bower install tslib - -# TypeScript 3.8.4 or earlier -bower install tslib@^1 - -# TypeScript 2.3.2 or earlier -bower install tslib@1.6.1 -``` - -## JSPM - -```sh -# TypeScript 3.9.2 or later -jspm install tslib - -# TypeScript 3.8.4 or earlier -jspm install tslib@^1 - -# TypeScript 2.3.2 or earlier -jspm install tslib@1.6.1 -``` - -# Usage - -Set the `importHelpers` compiler option on the command line: - -``` -tsc --importHelpers file.ts -``` - -or in your tsconfig.json: - -```json -{ - "compilerOptions": { - "importHelpers": true - } -} -``` - -#### For bower and JSPM users - -You will need to add a `paths` mapping for `tslib`, e.g. For Bower users: - -```json -{ - "compilerOptions": { - "module": "amd", - "importHelpers": true, - "baseUrl": "./", - "paths": { - "tslib" : ["bower_components/tslib/tslib.d.ts"] - } - } -} -``` - -For JSPM users: - -```json -{ - "compilerOptions": { - "module": "system", - "importHelpers": true, - "baseUrl": "./", - "paths": { - "tslib" : ["jspm_packages/npm/tslib@2.x.y/tslib.d.ts"] - } - } -} -``` - -## Deployment - -- Choose your new version number -- Set it in `package.json` and `bower.json` -- Create a tag: `git tag [version]` -- Push the tag: `git push --tags` -- Create a [release in GitHub](https://github.com/microsoft/tslib/releases) -- Run the [publish to npm](https://github.com/microsoft/tslib/actions?query=workflow%3A%22Publish+to+NPM%22) workflow - -Done. - -# Contribute - -There are many ways to [contribute](https://github.com/Microsoft/TypeScript/blob/master/CONTRIBUTING.md) to TypeScript. - -* [Submit bugs](https://github.com/Microsoft/TypeScript/issues) and help us verify fixes as they are checked in. -* Review the [source code changes](https://github.com/Microsoft/TypeScript/pulls). -* Engage with other TypeScript users and developers on [StackOverflow](http://stackoverflow.com/questions/tagged/typescript). -* Join the [#typescript](http://twitter.com/#!/search/realtime/%23typescript) discussion on Twitter. -* [Contribute bug fixes](https://github.com/Microsoft/TypeScript/blob/master/CONTRIBUTING.md). - -# Documentation - -* [Quick tutorial](http://www.typescriptlang.org/Tutorial) -* [Programming handbook](http://www.typescriptlang.org/Handbook) -* [Homepage](http://www.typescriptlang.org/) diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/tslib/SECURITY.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/tslib/SECURITY.md deleted file mode 100644 index 869fdfe2..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/tslib/SECURITY.md +++ /dev/null @@ -1,41 +0,0 @@ - - -## Security - -Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/Microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet), [Xamarin](https://github.com/xamarin), and [our GitHub organizations](https://opensource.microsoft.com/). - -If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://aka.ms/opensource/security/definition), please report it to us as described below. - -## Reporting Security Issues - -**Please do not report security vulnerabilities through public GitHub issues.** - -Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://aka.ms/opensource/security/create-report). - -If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://aka.ms/opensource/security/pgpkey). - -You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://aka.ms/opensource/security/msrc). - -Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue: - - * Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.) - * Full paths of source file(s) related to the manifestation of the issue - * The location of the affected source code (tag/branch/commit or direct URL) - * Any special configuration required to reproduce the issue - * Step-by-step instructions to reproduce the issue - * Proof-of-concept or exploit code (if possible) - * Impact of the issue, including how an attacker might exploit the issue - -This information will help us triage your report more quickly. - -If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://aka.ms/opensource/security/bounty) page for more details about our active programs. - -## Preferred Languages - -We prefer all communications to be in English. - -## Policy - -Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://aka.ms/opensource/security/cvd). - - diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/tslib/modules/index.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/tslib/modules/index.js deleted file mode 100644 index aaac8bf9..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/tslib/modules/index.js +++ /dev/null @@ -1,55 +0,0 @@ -import tslib from '../tslib.js'; -const { - __extends, - __assign, - __rest, - __decorate, - __param, - __metadata, - __awaiter, - __generator, - __exportStar, - __createBinding, - __values, - __read, - __spread, - __spreadArrays, - __spreadArray, - __await, - __asyncGenerator, - __asyncDelegator, - __asyncValues, - __makeTemplateObject, - __importStar, - __importDefault, - __classPrivateFieldGet, - __classPrivateFieldSet, - __classPrivateFieldIn, -} = tslib; -export { - __extends, - __assign, - __rest, - __decorate, - __param, - __metadata, - __awaiter, - __generator, - __exportStar, - __createBinding, - __values, - __read, - __spread, - __spreadArrays, - __spreadArray, - __await, - __asyncGenerator, - __asyncDelegator, - __asyncValues, - __makeTemplateObject, - __importStar, - __importDefault, - __classPrivateFieldGet, - __classPrivateFieldSet, - __classPrivateFieldIn, -}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/tslib/modules/package.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/tslib/modules/package.json deleted file mode 100644 index aafa0e4b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/tslib/modules/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "type": "module" -} \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/tslib/package.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/tslib/package.json deleted file mode 100644 index 29c903b7..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/tslib/package.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "name": "tslib", - "author": "Microsoft Corp.", - "homepage": "https://www.typescriptlang.org/", - "version": "2.4.1", - "license": "0BSD", - "description": "Runtime library for TypeScript helper functions", - "keywords": [ - "TypeScript", - "Microsoft", - "compiler", - "language", - "javascript", - "tslib", - "runtime" - ], - "bugs": { - "url": "https://github.com/Microsoft/TypeScript/issues" - }, - "repository": { - "type": "git", - "url": "https://github.com/Microsoft/tslib.git" - }, - "main": "tslib.js", - "module": "tslib.es6.js", - "jsnext:main": "tslib.es6.js", - "typings": "tslib.d.ts", - "sideEffects": false, - "exports": { - ".": { - "module": "./tslib.es6.js", - "import": "./modules/index.js", - "default": "./tslib.js" - }, - "./*": "./*", - "./": "./" - } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/tslib/tslib.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/tslib/tslib.d.ts deleted file mode 100644 index b8e49f08..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/tslib/tslib.d.ts +++ /dev/null @@ -1,398 +0,0 @@ -/****************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */ - -/** - * Used to shim class extends. - * - * @param d The derived class. - * @param b The base class. - */ -export declare function __extends(d: Function, b: Function): void; - -/** - * Copy the values of all of the enumerable own properties from one or more source objects to a - * target object. Returns the target object. - * - * @param t The target object to copy to. - * @param sources One or more source objects from which to copy properties - */ -export declare function __assign(t: any, ...sources: any[]): any; - -/** - * Performs a rest spread on an object. - * - * @param t The source value. - * @param propertyNames The property names excluded from the rest spread. - */ -export declare function __rest(t: any, propertyNames: (string | symbol)[]): any; - -/** - * Applies decorators to a target object - * - * @param decorators The set of decorators to apply. - * @param target The target object. - * @param key If specified, the own property to apply the decorators to. - * @param desc The property descriptor, defaults to fetching the descriptor from the target object. - * @experimental - */ -export declare function __decorate(decorators: Function[], target: any, key?: string | symbol, desc?: any): any; - -/** - * Creates an observing function decorator from a parameter decorator. - * - * @param paramIndex The parameter index to apply the decorator to. - * @param decorator The parameter decorator to apply. Note that the return value is ignored. - * @experimental - */ -export declare function __param(paramIndex: number, decorator: Function): Function; - -/** - * Creates a decorator that sets metadata. - * - * @param metadataKey The metadata key - * @param metadataValue The metadata value - * @experimental - */ -export declare function __metadata(metadataKey: any, metadataValue: any): Function; - -/** - * Converts a generator function into a pseudo-async function, by treating each `yield` as an `await`. - * - * @param thisArg The reference to use as the `this` value in the generator function - * @param _arguments The optional arguments array - * @param P The optional promise constructor argument, defaults to the `Promise` property of the global object. - * @param generator The generator function - */ -export declare function __awaiter(thisArg: any, _arguments: any, P: Function, generator: Function): any; - -/** - * Creates an Iterator object using the body as the implementation. - * - * @param thisArg The reference to use as the `this` value in the function - * @param body The generator state-machine based implementation. - * - * @see [./docs/generator.md] - */ -export declare function __generator(thisArg: any, body: Function): any; - -/** - * Creates bindings for all enumerable properties of `m` on `exports` - * - * @param m The source object - * @param exports The `exports` object. - */ -export declare function __exportStar(m: any, o: any): void; - -/** - * Creates a value iterator from an `Iterable` or `ArrayLike` object. - * - * @param o The object. - * @throws {TypeError} If `o` is neither `Iterable`, nor an `ArrayLike`. - */ -export declare function __values(o: any): any; - -/** - * Reads values from an `Iterable` or `ArrayLike` object and returns the resulting array. - * - * @param o The object to read from. - * @param n The maximum number of arguments to read, defaults to `Infinity`. - */ -export declare function __read(o: any, n?: number): any[]; - -/** - * Creates an array from iterable spread. - * - * @param args The Iterable objects to spread. - * @deprecated since TypeScript 4.2 - Use `__spreadArray` - */ -export declare function __spread(...args: any[][]): any[]; - -/** - * Creates an array from array spread. - * - * @param args The ArrayLikes to spread into the resulting array. - * @deprecated since TypeScript 4.2 - Use `__spreadArray` - */ -export declare function __spreadArrays(...args: any[][]): any[]; - -/** - * Spreads the `from` array into the `to` array. - * - * @param pack Replace empty elements with `undefined`. - */ -export declare function __spreadArray(to: any[], from: any[], pack?: boolean): any[]; - -/** - * Creates an object that signals to `__asyncGenerator` that it shouldn't be yielded, - * and instead should be awaited and the resulting value passed back to the generator. - * - * @param v The value to await. - */ -export declare function __await(v: any): any; - -/** - * Converts a generator function into an async generator function, by using `yield __await` - * in place of normal `await`. - * - * @param thisArg The reference to use as the `this` value in the generator function - * @param _arguments The optional arguments array - * @param generator The generator function - */ -export declare function __asyncGenerator(thisArg: any, _arguments: any, generator: Function): any; - -/** - * Used to wrap a potentially async iterator in such a way so that it wraps the result - * of calling iterator methods of `o` in `__await` instances, and then yields the awaited values. - * - * @param o The potentially async iterator. - * @returns A synchronous iterator yielding `__await` instances on every odd invocation - * and returning the awaited `IteratorResult` passed to `next` every even invocation. - */ -export declare function __asyncDelegator(o: any): any; - -/** - * Creates a value async iterator from an `AsyncIterable`, `Iterable` or `ArrayLike` object. - * - * @param o The object. - * @throws {TypeError} If `o` is neither `AsyncIterable`, `Iterable`, nor an `ArrayLike`. - */ -export declare function __asyncValues(o: any): any; - -/** - * Creates a `TemplateStringsArray` frozen object from the `cooked` and `raw` arrays. - * - * @param cooked The cooked possibly-sparse array. - * @param raw The raw string content. - */ -export declare function __makeTemplateObject(cooked: string[], raw: string[]): TemplateStringsArray; - -/** - * Used to shim default and named imports in ECMAScript Modules transpiled to CommonJS. - * - * ```js - * import Default, { Named, Other } from "mod"; - * // or - * import { default as Default, Named, Other } from "mod"; - * ``` - * - * @param mod The CommonJS module exports object. - */ -export declare function __importStar(mod: T): T; - -/** - * Used to shim default imports in ECMAScript Modules transpiled to CommonJS. - * - * ```js - * import Default from "mod"; - * ``` - * - * @param mod The CommonJS module exports object. - */ -export declare function __importDefault(mod: T): T | { default: T }; - -/** - * Emulates reading a private instance field. - * - * @param receiver The instance from which to read the private field. - * @param state A WeakMap containing the private field value for an instance. - * @param kind Either `"f"` for a field, `"a"` for an accessor, or `"m"` for a method. - * - * @throws {TypeError} If `state` doesn't have an entry for `receiver`. - */ -export declare function __classPrivateFieldGet( - receiver: T, - state: { has(o: T): boolean, get(o: T): V | undefined }, - kind?: "f" -): V; - -/** - * Emulates reading a private static field. - * - * @param receiver The object from which to read the private static field. - * @param state The class constructor containing the definition of the static field. - * @param kind Either `"f"` for a field, `"a"` for an accessor, or `"m"` for a method. - * @param f The descriptor that holds the static field value. - * - * @throws {TypeError} If `receiver` is not `state`. - */ -export declare function __classPrivateFieldGet unknown, V>( - receiver: T, - state: T, - kind: "f", - f: { value: V } -): V; - -/** - * Emulates evaluating a private instance "get" accessor. - * - * @param receiver The instance on which to evaluate the private "get" accessor. - * @param state A WeakSet used to verify an instance supports the private "get" accessor. - * @param kind Either `"f"` for a field, `"a"` for an accessor, or `"m"` for a method. - * @param f The "get" accessor function to evaluate. - * - * @throws {TypeError} If `state` doesn't have an entry for `receiver`. - */ -export declare function __classPrivateFieldGet( - receiver: T, - state: { has(o: T): boolean }, - kind: "a", - f: () => V -): V; - -/** - * Emulates evaluating a private static "get" accessor. - * - * @param receiver The object on which to evaluate the private static "get" accessor. - * @param state The class constructor containing the definition of the static "get" accessor. - * @param kind Either `"f"` for a field, `"a"` for an accessor, or `"m"` for a method. - * @param f The "get" accessor function to evaluate. - * - * @throws {TypeError} If `receiver` is not `state`. - */ -export declare function __classPrivateFieldGet unknown, V>( - receiver: T, - state: T, - kind: "a", - f: () => V -): V; - -/** - * Emulates reading a private instance method. - * - * @param receiver The instance from which to read a private method. - * @param state A WeakSet used to verify an instance supports the private method. - * @param kind Either `"f"` for a field, `"a"` for an accessor, or `"m"` for a method. - * @param f The function to return as the private instance method. - * - * @throws {TypeError} If `state` doesn't have an entry for `receiver`. - */ -export declare function __classPrivateFieldGet unknown>( - receiver: T, - state: { has(o: T): boolean }, - kind: "m", - f: V -): V; - -/** - * Emulates reading a private static method. - * - * @param receiver The object from which to read the private static method. - * @param state The class constructor containing the definition of the static method. - * @param kind Either `"f"` for a field, `"a"` for an accessor, or `"m"` for a method. - * @param f The function to return as the private static method. - * - * @throws {TypeError} If `receiver` is not `state`. - */ -export declare function __classPrivateFieldGet unknown, V extends (...args: any[]) => unknown>( - receiver: T, - state: T, - kind: "m", - f: V -): V; - -/** - * Emulates writing to a private instance field. - * - * @param receiver The instance on which to set a private field value. - * @param state A WeakMap used to store the private field value for an instance. - * @param value The value to store in the private field. - * @param kind Either `"f"` for a field, `"a"` for an accessor, or `"m"` for a method. - * - * @throws {TypeError} If `state` doesn't have an entry for `receiver`. - */ -export declare function __classPrivateFieldSet( - receiver: T, - state: { has(o: T): boolean, set(o: T, value: V): unknown }, - value: V, - kind?: "f" -): V; - -/** - * Emulates writing to a private static field. - * - * @param receiver The object on which to set the private static field. - * @param state The class constructor containing the definition of the private static field. - * @param value The value to store in the private field. - * @param kind Either `"f"` for a field, `"a"` for an accessor, or `"m"` for a method. - * @param f The descriptor that holds the static field value. - * - * @throws {TypeError} If `receiver` is not `state`. - */ -export declare function __classPrivateFieldSet unknown, V>( - receiver: T, - state: T, - value: V, - kind: "f", - f: { value: V } -): V; - -/** - * Emulates writing to a private instance "set" accessor. - * - * @param receiver The instance on which to evaluate the private instance "set" accessor. - * @param state A WeakSet used to verify an instance supports the private "set" accessor. - * @param value The value to store in the private accessor. - * @param kind Either `"f"` for a field, `"a"` for an accessor, or `"m"` for a method. - * @param f The "set" accessor function to evaluate. - * - * @throws {TypeError} If `state` doesn't have an entry for `receiver`. - */ -export declare function __classPrivateFieldSet( - receiver: T, - state: { has(o: T): boolean }, - value: V, - kind: "a", - f: (v: V) => void -): V; - -/** - * Emulates writing to a private static "set" accessor. - * - * @param receiver The object on which to evaluate the private static "set" accessor. - * @param state The class constructor containing the definition of the static "set" accessor. - * @param value The value to store in the private field. - * @param kind Either `"f"` for a field, `"a"` for an accessor, or `"m"` for a method. - * @param f The "set" accessor function to evaluate. - * - * @throws {TypeError} If `receiver` is not `state`. - */ -export declare function __classPrivateFieldSet unknown, V>( - receiver: T, - state: T, - value: V, - kind: "a", - f: (v: V) => void -): V; - -/** - * Checks for the existence of a private field/method/accessor. - * - * @param state The class constructor containing the static member, or the WeakMap or WeakSet associated with a private instance member. - * @param receiver The object for which to test the presence of the private member. - */ -export declare function __classPrivateFieldIn( - state: (new (...args: any[]) => unknown) | { has(o: any): boolean }, - receiver: unknown, -): boolean; - -/** - * Creates a re-export binding on `object` with key `objectKey` that references `target[key]`. - * - * @param object The local `exports` object. - * @param target The object to re-export from. - * @param key The property key of `target` to re-export. - * @param objectKey The property key to re-export as. Defaults to `key`. - */ -export declare function __createBinding(object: object, target: object, key: PropertyKey, objectKey?: PropertyKey): void; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/tslib/tslib.es6.html b/packages/wyatt_notification_bloc/example/scripts/node_modules/tslib/tslib.es6.html deleted file mode 100644 index b122e41b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/tslib/tslib.es6.html +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/tslib/tslib.es6.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/tslib/tslib.es6.js deleted file mode 100644 index 9e05b062..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/tslib/tslib.es6.js +++ /dev/null @@ -1,248 +0,0 @@ -/****************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */ -/* global Reflect, Promise */ - -var extendStatics = function(d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); -}; - -export function __extends(d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -} - -export var __assign = function() { - __assign = Object.assign || function __assign(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; - } - return t; - } - return __assign.apply(this, arguments); -} - -export function __rest(s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { - if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) - t[p[i]] = s[p[i]]; - } - return t; -} - -export function __decorate(decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -} - -export function __param(paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } -} - -export function __metadata(metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); -} - -export function __awaiter(thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -} - -export function __generator(thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (g && (g = 0, op[0] && (_ = 0)), _) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } -} - -export var __createBinding = Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -}); - -export function __exportStar(m, o) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); -} - -export function __values(o) { - var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; - if (m) return m.call(o); - if (o && typeof o.length === "number") return { - next: function () { - if (o && i >= o.length) o = void 0; - return { value: o && o[i++], done: !o }; - } - }; - throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); -} - -export function __read(o, n) { - var m = typeof Symbol === "function" && o[Symbol.iterator]; - if (!m) return o; - var i = m.call(o), r, ar = [], e; - try { - while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); - } - catch (error) { e = { error: error }; } - finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } - finally { if (e) throw e.error; } - } - return ar; -} - -/** @deprecated */ -export function __spread() { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read(arguments[i])); - return ar; -} - -/** @deprecated */ -export function __spreadArrays() { - for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; - for (var r = Array(s), k = 0, i = 0; i < il; i++) - for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) - r[k] = a[j]; - return r; -} - -export function __spreadArray(to, from, pack) { - if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } - } - return to.concat(ar || Array.prototype.slice.call(from)); -} - -export function __await(v) { - return this instanceof __await ? (this.v = v, this) : new __await(v); -} - -export function __asyncGenerator(thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var g = generator.apply(thisArg, _arguments || []), i, q = []; - return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; - function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } - function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } - function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } - function fulfill(value) { resume("next", value); } - function reject(value) { resume("throw", value); } - function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } -} - -export function __asyncDelegator(o) { - var i, p; - return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; - function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; } -} - -export function __asyncValues(o) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var m = o[Symbol.asyncIterator], i; - return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); - function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } - function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } -} - -export function __makeTemplateObject(cooked, raw) { - if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } - return cooked; -}; - -var __setModuleDefault = Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}; - -export function __importStar(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -} - -export function __importDefault(mod) { - return (mod && mod.__esModule) ? mod : { default: mod }; -} - -export function __classPrivateFieldGet(receiver, state, kind, f) { - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); -} - -export function __classPrivateFieldSet(receiver, state, value, kind, f) { - if (kind === "m") throw new TypeError("Private method is not writable"); - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; -} - -export function __classPrivateFieldIn(state, receiver) { - if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object"); - return typeof state === "function" ? receiver === state : state.has(receiver); -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/tslib/tslib.html b/packages/wyatt_notification_bloc/example/scripts/node_modules/tslib/tslib.html deleted file mode 100644 index 44c9ba51..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/tslib/tslib.html +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/tslib/tslib.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/tslib/tslib.js deleted file mode 100644 index e222adbf..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/tslib/tslib.js +++ /dev/null @@ -1,317 +0,0 @@ -/****************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */ -/* global global, define, System, Reflect, Promise */ -var __extends; -var __assign; -var __rest; -var __decorate; -var __param; -var __metadata; -var __awaiter; -var __generator; -var __exportStar; -var __values; -var __read; -var __spread; -var __spreadArrays; -var __spreadArray; -var __await; -var __asyncGenerator; -var __asyncDelegator; -var __asyncValues; -var __makeTemplateObject; -var __importStar; -var __importDefault; -var __classPrivateFieldGet; -var __classPrivateFieldSet; -var __classPrivateFieldIn; -var __createBinding; -(function (factory) { - var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {}; - if (typeof define === "function" && define.amd) { - define("tslib", ["exports"], function (exports) { factory(createExporter(root, createExporter(exports))); }); - } - else if (typeof module === "object" && typeof module.exports === "object") { - factory(createExporter(root, createExporter(module.exports))); - } - else { - factory(createExporter(root)); - } - function createExporter(exports, previous) { - if (exports !== root) { - if (typeof Object.create === "function") { - Object.defineProperty(exports, "__esModule", { value: true }); - } - else { - exports.__esModule = true; - } - } - return function (id, v) { return exports[id] = previous ? previous(id, v) : v; }; - } -}) -(function (exporter) { - var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - - __extends = function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - - __assign = Object.assign || function (t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; - } - return t; - }; - - __rest = function (s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { - if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) - t[p[i]] = s[p[i]]; - } - return t; - }; - - __decorate = function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - - __param = function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } - }; - - __metadata = function (metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); - }; - - __awaiter = function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - - __generator = function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (g && (g = 0, op[0] && (_ = 0)), _) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } - }; - - __exportStar = function(m, o) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); - }; - - __createBinding = Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; - }); - - __values = function (o) { - var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; - if (m) return m.call(o); - if (o && typeof o.length === "number") return { - next: function () { - if (o && i >= o.length) o = void 0; - return { value: o && o[i++], done: !o }; - } - }; - throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); - }; - - __read = function (o, n) { - var m = typeof Symbol === "function" && o[Symbol.iterator]; - if (!m) return o; - var i = m.call(o), r, ar = [], e; - try { - while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); - } - catch (error) { e = { error: error }; } - finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } - finally { if (e) throw e.error; } - } - return ar; - }; - - /** @deprecated */ - __spread = function () { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read(arguments[i])); - return ar; - }; - - /** @deprecated */ - __spreadArrays = function () { - for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; - for (var r = Array(s), k = 0, i = 0; i < il; i++) - for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) - r[k] = a[j]; - return r; - }; - - __spreadArray = function (to, from, pack) { - if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } - } - return to.concat(ar || Array.prototype.slice.call(from)); - }; - - __await = function (v) { - return this instanceof __await ? (this.v = v, this) : new __await(v); - }; - - __asyncGenerator = function (thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var g = generator.apply(thisArg, _arguments || []), i, q = []; - return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; - function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } - function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } - function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } - function fulfill(value) { resume("next", value); } - function reject(value) { resume("throw", value); } - function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } - }; - - __asyncDelegator = function (o) { - var i, p; - return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; - function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; } - }; - - __asyncValues = function (o) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var m = o[Symbol.asyncIterator], i; - return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); - function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } - function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } - }; - - __makeTemplateObject = function (cooked, raw) { - if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } - return cooked; - }; - - var __setModuleDefault = Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }; - - __importStar = function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; - }; - - __importDefault = function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; - }; - - __classPrivateFieldGet = function (receiver, state, kind, f) { - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); - }; - - __classPrivateFieldSet = function (receiver, state, value, kind, f) { - if (kind === "m") throw new TypeError("Private method is not writable"); - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; - }; - - __classPrivateFieldIn = function (state, receiver) { - if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object"); - return typeof state === "function" ? receiver === state : state.has(receiver); - }; - - exporter("__extends", __extends); - exporter("__assign", __assign); - exporter("__rest", __rest); - exporter("__decorate", __decorate); - exporter("__param", __param); - exporter("__metadata", __metadata); - exporter("__awaiter", __awaiter); - exporter("__generator", __generator); - exporter("__exportStar", __exportStar); - exporter("__createBinding", __createBinding); - exporter("__values", __values); - exporter("__read", __read); - exporter("__spread", __spread); - exporter("__spreadArrays", __spreadArrays); - exporter("__spreadArray", __spreadArray); - exporter("__await", __await); - exporter("__asyncGenerator", __asyncGenerator); - exporter("__asyncDelegator", __asyncDelegator); - exporter("__asyncValues", __asyncValues); - exporter("__makeTemplateObject", __makeTemplateObject); - exporter("__importStar", __importStar); - exporter("__importDefault", __importDefault); - exporter("__classPrivateFieldGet", __classPrivateFieldGet); - exporter("__classPrivateFieldSet", __classPrivateFieldSet); - exporter("__classPrivateFieldIn", __classPrivateFieldIn); -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/type-check/LICENSE b/packages/wyatt_notification_bloc/example/scripts/node_modules/type-check/LICENSE deleted file mode 100644 index 525b1185..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/type-check/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -Copyright (c) George Zahariev - -Permission is hereby granted, free of charge, to any person -obtaining a copy of this software and associated documentation -files (the "Software"), to deal in the Software without -restriction, including without limitation the rights to use, -copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following -conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/type-check/README.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/type-check/README.md deleted file mode 100644 index ec92d593..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/type-check/README.md +++ /dev/null @@ -1,210 +0,0 @@ -# type-check [![Build Status](https://travis-ci.org/gkz/type-check.png?branch=master)](https://travis-ci.org/gkz/type-check) - - - -`type-check` is a library which allows you to check the types of JavaScript values at runtime with a Haskell like type syntax. It is great for checking external input, for testing, or even for adding a bit of safety to your internal code. It is a major component of [levn](https://github.com/gkz/levn). MIT license. Version 0.3.2. Check out the [demo](http://gkz.github.io/type-check/). - -For updates on `type-check`, [follow me on twitter](https://twitter.com/gkzahariev). - - npm install type-check - -## Quick Examples - -```js -// Basic types: -var typeCheck = require('type-check').typeCheck; -typeCheck('Number', 1); // true -typeCheck('Number', 'str'); // false -typeCheck('Error', new Error); // true -typeCheck('Undefined', undefined); // true - -// Comment -typeCheck('count::Number', 1); // true - -// One type OR another type: -typeCheck('Number | String', 2); // true -typeCheck('Number | String', 'str'); // true - -// Wildcard, matches all types: -typeCheck('*', 2) // true - -// Array, all elements of a single type: -typeCheck('[Number]', [1, 2, 3]); // true -typeCheck('[Number]', [1, 'str', 3]); // false - -// Tuples, or fixed length arrays with elements of different types: -typeCheck('(String, Number)', ['str', 2]); // true -typeCheck('(String, Number)', ['str']); // false -typeCheck('(String, Number)', ['str', 2, 5]); // false - -// Object properties: -typeCheck('{x: Number, y: Boolean}', {x: 2, y: false}); // true -typeCheck('{x: Number, y: Boolean}', {x: 2}); // false -typeCheck('{x: Number, y: Maybe Boolean}', {x: 2}); // true -typeCheck('{x: Number, y: Boolean}', {x: 2, y: false, z: 3}); // false -typeCheck('{x: Number, y: Boolean, ...}', {x: 2, y: false, z: 3}); // true - -// A particular type AND object properties: -typeCheck('RegExp{source: String, ...}', /re/i); // true -typeCheck('RegExp{source: String, ...}', {source: 're'}); // false - -// Custom types: -var opt = {customTypes: - {Even: { typeOf: 'Number', validate: function(x) { return x % 2 === 0; }}}}; -typeCheck('Even', 2, opt); // true - -// Nested: -var type = '{a: (String, [Number], {y: Array, ...}), b: Error{message: String, ...}}' -typeCheck(type, {a: ['hi', [1, 2, 3], {y: [1, 'ms']}], b: new Error('oh no')}); // true -``` - -Check out the [type syntax format](#syntax) and [guide](#guide). - -## Usage - -`require('type-check');` returns an object that exposes four properties. `VERSION` is the current version of the library as a string. `typeCheck`, `parseType`, and `parsedTypeCheck` are functions. - -```js -// typeCheck(type, input, options); -typeCheck('Number', 2); // true - -// parseType(type); -var parsedType = parseType('Number'); // object - -// parsedTypeCheck(parsedType, input, options); -parsedTypeCheck(parsedType, 2); // true -``` - -### typeCheck(type, input, options) - -`typeCheck` checks a JavaScript value `input` against `type` written in the [type format](#type-format) (and taking account the optional `options`) and returns whether the `input` matches the `type`. - -##### arguments -* type - `String` - the type written in the [type format](#type-format) which to check against -* input - `*` - any JavaScript value, which is to be checked against the type -* options - `Maybe Object` - an optional parameter specifying additional options, currently the only available option is specifying [custom types](#custom-types) - -##### returns -`Boolean` - whether the input matches the type - -##### example -```js -typeCheck('Number', 2); // true -``` - -### parseType(type) - -`parseType` parses string `type` written in the [type format](#type-format) into an object representing the parsed type. - -##### arguments -* type - `String` - the type written in the [type format](#type-format) which to parse - -##### returns -`Object` - an object in the parsed type format representing the parsed type - -##### example -```js -parseType('Number'); // [{type: 'Number'}] -``` -### parsedTypeCheck(parsedType, input, options) - -`parsedTypeCheck` checks a JavaScript value `input` against parsed `type` in the parsed type format (and taking account the optional `options`) and returns whether the `input` matches the `type`. Use this in conjunction with `parseType` if you are going to use a type more than once. - -##### arguments -* type - `Object` - the type in the parsed type format which to check against -* input - `*` - any JavaScript value, which is to be checked against the type -* options - `Maybe Object` - an optional parameter specifying additional options, currently the only available option is specifying [custom types](#custom-types) - -##### returns -`Boolean` - whether the input matches the type - -##### example -```js -parsedTypeCheck([{type: 'Number'}], 2); // true -var parsedType = parseType('String'); -parsedTypeCheck(parsedType, 'str'); // true -``` - - -## Type Format - -### Syntax - -White space is ignored. The root node is a __Types__. - -* __Identifier__ = `[\$\w]+` - a group of any lower or upper case letters, numbers, underscores, or dollar signs - eg. `String` -* __Type__ = an `Identifier`, an `Identifier` followed by a `Structure`, just a `Structure`, or a wildcard `*` - eg. `String`, `Object{x: Number}`, `{x: Number}`, `Array{0: String, 1: Boolean, length: Number}`, `*` -* __Types__ = optionally a comment (an `Indentifier` followed by a `::`), optionally the identifier `Maybe`, one or more `Type`, separated by `|` - eg. `Number`, `String | Date`, `Maybe Number`, `Maybe Boolean | String` -* __Structure__ = `Fields`, or a `Tuple`, or an `Array` - eg. `{x: Number}`, `(String, Number)`, `[Date]` -* __Fields__ = a `{`, followed one or more `Field` separated by a comma `,` (trailing comma `,` is permitted), optionally an `...` (always preceded by a comma `,`), followed by a `}` - eg. `{x: Number, y: String}`, `{k: Function, ...}` -* __Field__ = an `Identifier`, followed by a colon `:`, followed by `Types` - eg. `x: Date | String`, `y: Boolean` -* __Tuple__ = a `(`, followed by one or more `Types` separated by a comma `,` (trailing comma `,` is permitted), followed by a `)` - eg `(Date)`, `(Number, Date)` -* __Array__ = a `[` followed by exactly one `Types` followed by a `]` - eg. `[Boolean]`, `[Boolean | Null]` - -### Guide - -`type-check` uses `Object.toString` to find out the basic type of a value. Specifically, - -```js -{}.toString.call(VALUE).slice(8, -1) -{}.toString.call(true).slice(8, -1) // 'Boolean' -``` -A basic type, eg. `Number`, uses this check. This is much more versatile than using `typeof` - for example, with `document`, `typeof` produces `'object'` which isn't that useful, and our technique produces `'HTMLDocument'`. - -You may check for multiple types by separating types with a `|`. The checker proceeds from left to right, and passes if the value is any of the types - eg. `String | Boolean` first checks if the value is a string, and then if it is a boolean. If it is none of those, then it returns false. - -Adding a `Maybe` in front of a list of multiple types is the same as also checking for `Null` and `Undefined` - eg. `Maybe String` is equivalent to `Undefined | Null | String`. - -You may add a comment to remind you of what the type is for by following an identifier with a `::` before a type (or multiple types). The comment is simply thrown out. - -The wildcard `*` matches all types. - -There are three types of structures for checking the contents of a value: 'fields', 'tuple', and 'array'. - -If used by itself, a 'fields' structure will pass with any type of object as long as it is an instance of `Object` and the properties pass - this allows for duck typing - eg. `{x: Boolean}`. - -To check if the properties pass, and the value is of a certain type, you can specify the type - eg. `Error{message: String}`. - -If you want to make a field optional, you can simply use `Maybe` - eg. `{x: Boolean, y: Maybe String}` will still pass if `y` is undefined (or null). - -If you don't care if the value has properties beyond what you have specified, you can use the 'etc' operator `...` - eg. `{x: Boolean, ...}` will match an object with an `x` property that is a boolean, and with zero or more other properties. - -For an array, you must specify one or more types (separated by `|`) - it will pass for something of any length as long as each element passes the types provided - eg. `[Number]`, `[Number | String]`. - -A tuple checks for a fixed number of elements, each of a potentially different type. Each element is separated by a comma - eg. `(String, Number)`. - -An array and tuple structure check that the value is of type `Array` by default, but if another type is specified, they will check for that instead - eg. `Int32Array[Number]`. You can use the wildcard `*` to search for any type at all. - -Check out the [type precedence](https://github.com/zaboco/type-precedence) library for type-check. - -## Options - -Options is an object. It is an optional parameter to the `typeCheck` and `parsedTypeCheck` functions. The only current option is `customTypes`. - - -### Custom Types - -__Example:__ - -```js -var options = { - customTypes: { - Even: { - typeOf: 'Number', - validate: function(x) { - return x % 2 === 0; - } - } - } -}; -typeCheck('Even', 2, options); // true -typeCheck('Even', 3, options); // false -``` - -`customTypes` allows you to set up custom types for validation. The value of this is an object. The keys of the object are the types you will be matching. Each value of the object will be an object having a `typeOf` property - a string, and `validate` property - a function. - -The `typeOf` property is the type the value should be, and `validate` is a function which should return true if the value is of that type. `validate` receives one parameter, which is the value that we are checking. - -## Technical About - -`type-check` is written in [LiveScript](http://livescript.net/) - a language that compiles to JavaScript. It also uses the [prelude.ls](http://preludels.com/) library. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/type-check/lib/check.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/type-check/lib/check.js deleted file mode 100644 index 0504c8d2..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/type-check/lib/check.js +++ /dev/null @@ -1,126 +0,0 @@ -// Generated by LiveScript 1.4.0 -(function(){ - var ref$, any, all, isItNaN, types, defaultType, customTypes, toString$ = {}.toString; - ref$ = require('prelude-ls'), any = ref$.any, all = ref$.all, isItNaN = ref$.isItNaN; - types = { - Number: { - typeOf: 'Number', - validate: function(it){ - return !isItNaN(it); - } - }, - NaN: { - typeOf: 'Number', - validate: isItNaN - }, - Int: { - typeOf: 'Number', - validate: function(it){ - return !isItNaN(it) && it % 1 === 0; - } - }, - Float: { - typeOf: 'Number', - validate: function(it){ - return !isItNaN(it); - } - }, - Date: { - typeOf: 'Date', - validate: function(it){ - return !isItNaN(it.getTime()); - } - } - }; - defaultType = { - array: 'Array', - tuple: 'Array' - }; - function checkArray(input, type){ - return all(function(it){ - return checkMultiple(it, type.of); - }, input); - } - function checkTuple(input, type){ - var i, i$, ref$, len$, types; - i = 0; - for (i$ = 0, len$ = (ref$ = type.of).length; i$ < len$; ++i$) { - types = ref$[i$]; - if (!checkMultiple(input[i], types)) { - return false; - } - i++; - } - return input.length <= i; - } - function checkFields(input, type){ - var inputKeys, numInputKeys, k, numOfKeys, key, ref$, types; - inputKeys = {}; - numInputKeys = 0; - for (k in input) { - inputKeys[k] = true; - numInputKeys++; - } - numOfKeys = 0; - for (key in ref$ = type.of) { - types = ref$[key]; - if (!checkMultiple(input[key], types)) { - return false; - } - if (inputKeys[key]) { - numOfKeys++; - } - } - return type.subset || numInputKeys === numOfKeys; - } - function checkStructure(input, type){ - if (!(input instanceof Object)) { - return false; - } - switch (type.structure) { - case 'fields': - return checkFields(input, type); - case 'array': - return checkArray(input, type); - case 'tuple': - return checkTuple(input, type); - } - } - function check(input, typeObj){ - var type, structure, setting, that; - type = typeObj.type, structure = typeObj.structure; - if (type) { - if (type === '*') { - return true; - } - setting = customTypes[type] || types[type]; - if (setting) { - return setting.typeOf === toString$.call(input).slice(8, -1) && setting.validate(input); - } else { - return type === toString$.call(input).slice(8, -1) && (!structure || checkStructure(input, typeObj)); - } - } else if (structure) { - if (that = defaultType[structure]) { - if (that !== toString$.call(input).slice(8, -1)) { - return false; - } - } - return checkStructure(input, typeObj); - } else { - throw new Error("No type defined. Input: " + input + "."); - } - } - function checkMultiple(input, types){ - if (toString$.call(types).slice(8, -1) !== 'Array') { - throw new Error("Types must be in an array. Input: " + input + "."); - } - return any(function(it){ - return check(input, it); - }, types); - } - module.exports = function(parsedType, input, options){ - options == null && (options = {}); - customTypes = options.customTypes || {}; - return checkMultiple(input, parsedType); - }; -}).call(this); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/type-check/lib/index.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/type-check/lib/index.js deleted file mode 100644 index f3316bab..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/type-check/lib/index.js +++ /dev/null @@ -1,16 +0,0 @@ -// Generated by LiveScript 1.4.0 -(function(){ - var VERSION, parseType, parsedTypeCheck, typeCheck; - VERSION = '0.3.2'; - parseType = require('./parse-type'); - parsedTypeCheck = require('./check'); - typeCheck = function(type, input, options){ - return parsedTypeCheck(parseType(type), input, options); - }; - module.exports = { - VERSION: VERSION, - typeCheck: typeCheck, - parsedTypeCheck: parsedTypeCheck, - parseType: parseType - }; -}).call(this); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/type-check/lib/parse-type.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/type-check/lib/parse-type.js deleted file mode 100644 index 5baf661f..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/type-check/lib/parse-type.js +++ /dev/null @@ -1,196 +0,0 @@ -// Generated by LiveScript 1.4.0 -(function(){ - var identifierRegex, tokenRegex; - identifierRegex = /[\$\w]+/; - function peek(tokens){ - var token; - token = tokens[0]; - if (token == null) { - throw new Error('Unexpected end of input.'); - } - return token; - } - function consumeIdent(tokens){ - var token; - token = peek(tokens); - if (!identifierRegex.test(token)) { - throw new Error("Expected text, got '" + token + "' instead."); - } - return tokens.shift(); - } - function consumeOp(tokens, op){ - var token; - token = peek(tokens); - if (token !== op) { - throw new Error("Expected '" + op + "', got '" + token + "' instead."); - } - return tokens.shift(); - } - function maybeConsumeOp(tokens, op){ - var token; - token = tokens[0]; - if (token === op) { - return tokens.shift(); - } else { - return null; - } - } - function consumeArray(tokens){ - var types; - consumeOp(tokens, '['); - if (peek(tokens) === ']') { - throw new Error("Must specify type of Array - eg. [Type], got [] instead."); - } - types = consumeTypes(tokens); - consumeOp(tokens, ']'); - return { - structure: 'array', - of: types - }; - } - function consumeTuple(tokens){ - var components; - components = []; - consumeOp(tokens, '('); - if (peek(tokens) === ')') { - throw new Error("Tuple must be of at least length 1 - eg. (Type), got () instead."); - } - for (;;) { - components.push(consumeTypes(tokens)); - maybeConsumeOp(tokens, ','); - if (')' === peek(tokens)) { - break; - } - } - consumeOp(tokens, ')'); - return { - structure: 'tuple', - of: components - }; - } - function consumeFields(tokens){ - var fields, subset, ref$, key, types; - fields = {}; - consumeOp(tokens, '{'); - subset = false; - for (;;) { - if (maybeConsumeOp(tokens, '...')) { - subset = true; - break; - } - ref$ = consumeField(tokens), key = ref$[0], types = ref$[1]; - fields[key] = types; - maybeConsumeOp(tokens, ','); - if ('}' === peek(tokens)) { - break; - } - } - consumeOp(tokens, '}'); - return { - structure: 'fields', - of: fields, - subset: subset - }; - } - function consumeField(tokens){ - var key, types; - key = consumeIdent(tokens); - consumeOp(tokens, ':'); - types = consumeTypes(tokens); - return [key, types]; - } - function maybeConsumeStructure(tokens){ - switch (tokens[0]) { - case '[': - return consumeArray(tokens); - case '(': - return consumeTuple(tokens); - case '{': - return consumeFields(tokens); - } - } - function consumeType(tokens){ - var token, wildcard, type, structure; - token = peek(tokens); - wildcard = token === '*'; - if (wildcard || identifierRegex.test(token)) { - type = wildcard - ? consumeOp(tokens, '*') - : consumeIdent(tokens); - structure = maybeConsumeStructure(tokens); - if (structure) { - return structure.type = type, structure; - } else { - return { - type: type - }; - } - } else { - structure = maybeConsumeStructure(tokens); - if (!structure) { - throw new Error("Unexpected character: " + token); - } - return structure; - } - } - function consumeTypes(tokens){ - var lookahead, types, typesSoFar, typeObj, type; - if ('::' === peek(tokens)) { - throw new Error("No comment before comment separator '::' found."); - } - lookahead = tokens[1]; - if (lookahead != null && lookahead === '::') { - tokens.shift(); - tokens.shift(); - } - types = []; - typesSoFar = {}; - if ('Maybe' === peek(tokens)) { - tokens.shift(); - types = [ - { - type: 'Undefined' - }, { - type: 'Null' - } - ]; - typesSoFar = { - Undefined: true, - Null: true - }; - } - for (;;) { - typeObj = consumeType(tokens), type = typeObj.type; - if (!typesSoFar[type]) { - types.push(typeObj); - } - typesSoFar[type] = true; - if (!maybeConsumeOp(tokens, '|')) { - break; - } - } - return types; - } - tokenRegex = RegExp('\\.\\.\\.|::|->|' + identifierRegex.source + '|\\S', 'g'); - module.exports = function(input){ - var tokens, e; - if (!input.length) { - throw new Error('No type specified.'); - } - tokens = input.match(tokenRegex) || []; - if (in$('->', tokens)) { - throw new Error("Function types are not supported.\ To validate that something is a function, you may use 'Function'."); - } - try { - return consumeTypes(tokens); - } catch (e$) { - e = e$; - throw new Error(e.message + " - Remaining tokens: " + JSON.stringify(tokens) + " - Initial input: '" + input + "'"); - } - }; - function in$(x, xs){ - var i = -1, l = xs.length >>> 0; - while (++i < l) if (x === xs[i]) return true; - return false; - } -}).call(this); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/type-check/package.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/type-check/package.json deleted file mode 100644 index 8c0b0213..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/type-check/package.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "name": "type-check", - "version": "0.3.2", - "author": "George Zahariev ", - "description": "type-check allows you to check the types of JavaScript values at runtime with a Haskell like type syntax.", - "homepage": "https://github.com/gkz/type-check", - "keywords": [ - "type", - "check", - "checking", - "library" - ], - "files": [ - "lib", - "README.md", - "LICENSE" - ], - "main": "./lib/", - "bugs": "https://github.com/gkz/type-check/issues", - "license": "MIT", - "engines": { - "node": ">= 0.8.0" - }, - "repository": { - "type": "git", - "url": "git://github.com/gkz/type-check.git" - }, - "scripts": { - "test": "make test" - }, - "dependencies": { - "prelude-ls": "~1.1.2" - }, - "devDependencies": { - "livescript": "~1.4.0", - "mocha": "~2.3.4", - "istanbul": "~0.4.1", - "browserify": "~12.0.1" - } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/uc.micro/CHANGELOG.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/uc.micro/CHANGELOG.md deleted file mode 100644 index 974a9690..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/uc.micro/CHANGELOG.md +++ /dev/null @@ -1,52 +0,0 @@ -1.0.6 / 2019-01-31 ------------------- - -- Unicode update to 10.0.0. -- Fixed `Z` content (added missed line and paragraph seperators), #10. - - -1.0.5 / 2018-01-26 ------------------- - -- Remove outdated license info from readme (missed in previous update). - - -1.0.4 / 2018-01-26 ------------------- - -- Unicode update to 10.0.0. -- Clarified license, should be MIT, #6. - - -1.0.3 / 2016-09-14 ------------------- - -- Unicode update to 9.0.0. -- Rewrite update script (use npm instead of Makefile). -- Added integrity tests. - - -1.0.2 / 2015-06-24 ------------------- - -- License info clarify, #3. - - -1.0.1 / 2015-05-30 ------------------- - -- Update to Unicode 8.+. -- Also automatically fix possible ReDOS in `Any`, if source used to generate - patterns like `(Any)+`. - - -1.0.0 / 2015-03-10 ------------------- - -- Export all in index.js. - - -0.1.0 / 2015-02-22 ------------------- - -- First release. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/uc.micro/LICENSE.txt b/packages/wyatt_notification_bloc/example/scripts/node_modules/uc.micro/LICENSE.txt deleted file mode 100644 index a41e0a7e..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/uc.micro/LICENSE.txt +++ /dev/null @@ -1,20 +0,0 @@ -Copyright Mathias Bynens - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/uc.micro/README.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/uc.micro/README.md deleted file mode 100644 index 3c555ea7..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/uc.micro/README.md +++ /dev/null @@ -1,14 +0,0 @@ -# uc.micro - -[![Build Status](https://img.shields.io/travis/markdown-it/uc.micro/master.svg?style=flat)](https://travis-ci.org/markdown-it/uc.micro) -[![NPM version](https://img.shields.io/npm/v/uc.micro.svg?style=flat)](https://www.npmjs.org/package/uc.micro) - -> Micro subset of unicode data files for [markdown-it](https://github.com/markdown-it) projects. - -Content of this repo is autogenerated from `unicode-` package, -maintained by [Mathias Bynens](https://github.com/mathiasbynens). - -That's just a proxy to reduce dependencies/install size. - -**This package content is ONLY for [markdown-it](https://github.com/markdown-it) -projects needs. Don't ask to extend it!** diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/uc.micro/categories/Cc/regex.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/uc.micro/categories/Cc/regex.js deleted file mode 100644 index 99be991f..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/uc.micro/categories/Cc/regex.js +++ /dev/null @@ -1 +0,0 @@ -module.exports=/[\0-\x1F\x7F-\x9F]/ \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/uc.micro/categories/Cf/regex.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/uc.micro/categories/Cf/regex.js deleted file mode 100644 index e89eff62..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/uc.micro/categories/Cf/regex.js +++ /dev/null @@ -1 +0,0 @@ -module.exports=/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/ \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/uc.micro/categories/P/regex.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/uc.micro/categories/P/regex.js deleted file mode 100644 index 7e18fa73..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/uc.micro/categories/P/regex.js +++ /dev/null @@ -1 +0,0 @@ -module.exports=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4E\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDF55-\uDF59]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDF3C-\uDF3E]|\uD806[\uDC3B\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/ \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/uc.micro/categories/Z/regex.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/uc.micro/categories/Z/regex.js deleted file mode 100644 index 76976a4d..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/uc.micro/categories/Z/regex.js +++ /dev/null @@ -1 +0,0 @@ -module.exports=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/ \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/uc.micro/index.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/uc.micro/index.js deleted file mode 100644 index 03b6d4ab..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/uc.micro/index.js +++ /dev/null @@ -1,7 +0,0 @@ -'use strict'; - -exports.Any = require('./properties/Any/regex'); -exports.Cc = require('./categories/Cc/regex'); -exports.Cf = require('./categories/Cf/regex'); -exports.P = require('./categories/P/regex'); -exports.Z = require('./categories/Z/regex'); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/uc.micro/package.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/uc.micro/package.json deleted file mode 100644 index 798e4bba..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/uc.micro/package.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "name": "uc.micro", - "version": "1.0.6", - "description": "Micro subset of unicode data files for markdown-it projects.", - "repository": "markdown-it/uc.micro", - "license": "MIT", - "files": [ - "categories/", - "properties/", - "index.js" - ], - "scripts": { - "test": "mocha", - "update": "node update.js && npm test" - }, - "devDependencies": { - "mocha": "^5.0.0", - "shelljs": "^0.8.1", - "unicode-11.0.0": "^0.7.8" - } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/uc.micro/properties/Any/regex.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/uc.micro/properties/Any/regex.js deleted file mode 100644 index 22afa15a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/uc.micro/properties/Any/regex.js +++ /dev/null @@ -1 +0,0 @@ -module.exports=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/ \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/uglify-js/LICENSE b/packages/wyatt_notification_bloc/example/scripts/node_modules/uglify-js/LICENSE deleted file mode 100644 index 122e8fb9..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/uglify-js/LICENSE +++ /dev/null @@ -1,29 +0,0 @@ -UglifyJS is released under the BSD license: - -Copyright 2012-2019 (c) Mihai Bazon - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - - * Redistributions of source code must retain the above - copyright notice, this list of conditions and the following - disclaimer. - - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials - provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE -LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, -OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR -TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF -THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/uglify-js/README.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/uglify-js/README.md deleted file mode 100644 index ba5f2a29..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/uglify-js/README.md +++ /dev/null @@ -1,1478 +0,0 @@ -UglifyJS 3 -========== - -UglifyJS is a JavaScript parser, minifier, compressor and beautifier toolkit. - -#### Note: -- `uglify-js` supports JavaScript and most language features in ECMAScript. -- For more exotic parts of ECMAScript, process your source file with transpilers - like [Babel](https://babeljs.io/) before passing onto `uglify-js`. -- `uglify-js@3` has a simplified [API](#api-reference) and [CLI](#command-line-usage) - that is not backwards compatible with [`uglify-js@2`](https://github.com/mishoo/UglifyJS/tree/v2.x). - -Install -------- - -First make sure you have installed the latest version of [node.js](http://nodejs.org/) -(You may need to restart your computer after this step). - -From NPM for use as a command line app: - - npm install uglify-js -g - -From NPM for programmatic use: - - npm install uglify-js - -# Command line usage - - uglifyjs [input files] [options] - -UglifyJS can take multiple input files. It's recommended that you pass the -input files first, then pass the options. UglifyJS will parse input files -in sequence and apply any compression options. The files are parsed in the -same global scope, that is, a reference from a file to some -variable/function declared in another file will be matched properly. - -If no input file is specified, UglifyJS will read from STDIN. - -If you wish to pass your options before the input files, separate the two with -a double dash to prevent input files being used as option arguments: - - uglifyjs --compress --mangle -- input.js - -### Command line options - -``` - -h, --help Print usage information. - `--help options` for details on available options. - -V, --version Print version number. - -p, --parse Specify parser options: - `acorn` Use Acorn for parsing. - `bare_returns` Allow return outside of functions. - Useful when minifying CommonJS - modules and Userscripts that may - be anonymous function wrapped (IIFE) - by the .user.js engine `caller`. - `spidermonkey` Assume input files are SpiderMonkey - AST format (as JSON). - -c, --compress [options] Enable compressor/specify compressor options: - `pure_funcs` List of functions that can be safely - removed when their return values are - not used. - -m, --mangle [options] Mangle names/specify mangler options: - `reserved` List of names that should not be mangled. - --mangle-props [options] Mangle properties/specify mangler options: - `builtins` Mangle property names that overlaps - with standard JavaScript globals. - `debug` Add debug prefix and suffix. - `domprops` Mangle property names that overlaps - with DOM properties. - `keep_quoted` Only mangle unquoted properties. - `regex` Only mangle matched property names. - `reserved` List of names that should not be mangled. - -b, --beautify [options] Beautify output/specify output options: - `beautify` Enabled with `--beautify` by default. - `preamble` Preamble to prepend to the output. You - can use this to insert a comment, for - example for licensing information. - This will not be parsed, but the source - map will adjust for its presence. - `quote_style` Quote style: - 0 - auto - 1 - single - 2 - double - 3 - original - `wrap_iife` Wrap IIFEs in parentheses. Note: you may - want to disable `negate_iife` under - compressor options. - -O, --output-opts [options] Specify output options (`beautify` disabled by default). - -o, --output Output file path (default STDOUT). Specify `ast` or - `spidermonkey` to write UglifyJS or SpiderMonkey AST - as JSON to STDOUT respectively. - --annotations Process and preserve comment annotations. - (`/*@__PURE__*/` or `/*#__PURE__*/`) - --no-annotations Ignore and discard comment annotations. - --comments [filter] Preserve copyright comments in the output. By - default this works like Google Closure, keeping - JSDoc-style comments that contain "@license" or - "@preserve". You can optionally pass one of the - following arguments to this flag: - - "all" to keep all comments - - a valid JS RegExp like `/foo/` or `/^!/` to - keep only matching comments. - Note that currently not *all* comments can be - kept when compression is on, because of dead - code removal or cascading statements into - sequences. - --config-file Read `minify()` options from JSON file. - -d, --define [=value] Global definitions. - -e, --enclose [arg[:value]] Embed everything in a big function, with configurable - argument(s) & value(s). - --expression Parse a single expression, rather than a program - (for parsing JSON). - --ie Support non-standard Internet Explorer. - Equivalent to setting `ie: true` in `minify()` - for `compress`, `mangle` and `output` options. - By default UglifyJS will not try to be IE-proof. - --keep-fargs Do not mangle/drop function arguments. - --keep-fnames Do not mangle/drop function names. Useful for - code relying on Function.prototype.name. - --module Process input as ES module (implies --toplevel) - --name-cache File to hold mangled name mappings. - --self Build UglifyJS as a library (implies --wrap UglifyJS) - --source-map [options] Enable source map/specify source map options: - `base` Path to compute relative paths from input files. - `content` Input source map, useful if you're compressing - JS that was generated from some other original - code. Specify "inline" if the source map is - included within the sources. - `filename` Filename and/or location of the output source - (sets `file` attribute in source map). - `includeSources` Pass this flag if you want to include - the content of source files in the - source map as sourcesContent property. - `names` Include symbol names in the source map. - `root` Path to the original source to be included in - the source map. - `url` If specified, path to the source map to append in - `//# sourceMappingURL`. - --timings Display operations run time on STDERR. - --toplevel Compress and/or mangle variables in top level scope. - --v8 Support non-standard Chrome & Node.js - Equivalent to setting `v8: true` in `minify()` - for `mangle` and `output` options. - By default UglifyJS will not try to be v8-proof. - --verbose Print diagnostic messages. - --warn Print warning messages. - --webkit Support non-standard Safari/Webkit. - Equivalent to setting `webkit: true` in `minify()` - for `compress`, `mangle` and `output` options. - By default UglifyJS will not try to be Safari-proof. - --wrap Embed everything in a big function, making the - “exports” and “global” variables available. You - need to pass an argument to this option to - specify the name that your module will take - when included in, say, a browser. -``` - -Specify `--output` (`-o`) to declare the output file. Otherwise the output -goes to STDOUT. - -## CLI source map options - -UglifyJS can generate a source map file, which is highly useful for -debugging your compressed JavaScript. To get a source map, pass -`--source-map --output output.js` (source map will be written out to -`output.js.map`). - -Additional options: - -- `--source-map "filename=''"` to specify the name of the source map. The value of - `filename` is only used to set `file` attribute (see [the spec][sm-spec]) - in source map file. - -- `--source-map "root=''"` to pass the URL where the original files can be found. - -- `--source-map "names=false"` to omit symbol names if you want to reduce size - of the source map file. - -- `--source-map "url=''"` to specify the URL where the source map can be found. - Otherwise UglifyJS assumes HTTP `X-SourceMap` is being used and will omit the - `//# sourceMappingURL=` directive. - -For example: - - uglifyjs js/file1.js js/file2.js \ - -o foo.min.js -c -m \ - --source-map "root='http://foo.com/src',url='foo.min.js.map'" - -The above will compress and mangle `file1.js` and `file2.js`, will drop the -output in `foo.min.js` and the source map in `foo.min.js.map`. The source -mapping will refer to `http://foo.com/src/js/file1.js` and -`http://foo.com/src/js/file2.js` (in fact it will list `http://foo.com/src` -as the source map root, and the original files as `js/file1.js` and -`js/file2.js`). - -### Composed source map - -When you're compressing JS code that was output by a compiler such as -CoffeeScript, mapping to the JS code won't be too helpful. Instead, you'd -like to map back to the original code (i.e. CoffeeScript). UglifyJS has an -option to take an input source map. Assuming you have a mapping from -CoffeeScript → compiled JS, UglifyJS can generate a map from CoffeeScript → -compressed JS by mapping every token in the compiled JS to its original -location. - -To use this feature pass `--source-map "content='/path/to/input/source.map'"` -or `--source-map "content=inline"` if the source map is included inline with -the sources. - -## CLI compress options - -You need to pass `--compress` (`-c`) to enable the compressor. Optionally -you can pass a comma-separated list of [compress options](#compress-options). - -Options are in the form `foo=bar`, or just `foo` (the latter implies -a boolean option that you want to set `true`; it's effectively a -shortcut for `foo=true`). - -Example: - - uglifyjs file.js -c toplevel,sequences=false - -## CLI mangle options - -To enable the mangler you need to pass `--mangle` (`-m`). The following -(comma-separated) options are supported: - -- `eval` (default: `false`) — mangle names visible in scopes where `eval` or - `with` are used. - -- `reserved` (default: `[]`) — when mangling is enabled but you want to - prevent certain names from being mangled, you can declare those names with - `--mangle reserved` — pass a comma-separated list of names. For example: - - uglifyjs ... -m reserved=['$','require','exports'] - - to prevent the `require`, `exports` and `$` names from being changed. - -### CLI mangling property names (`--mangle-props`) - -**Note:** THIS WILL PROBABLY BREAK YOUR CODE. Mangling property names -is a separate step, different from variable name mangling. Pass -`--mangle-props` to enable it. It will mangle all properties in the -input code with the exception of built in DOM properties and properties -in core JavaScript classes. For example: - -```javascript -// example.js -var x = { - baz_: 0, - foo_: 1, - calc: function() { - return this.foo_ + this.baz_; - } -}; -x.bar_ = 2; -x["baz_"] = 3; -console.log(x.calc()); -``` -Mangle all properties (except for JavaScript `builtins`): -```bash -$ uglifyjs example.js -c -m --mangle-props -``` -```javascript -var x={o:0,_:1,l:function(){return this._+this.o}};x.t=2,x.o=3,console.log(x.l()); -``` -Mangle all properties except for `reserved` properties: -```bash -$ uglifyjs example.js -c -m --mangle-props reserved=[foo_,bar_] -``` -```javascript -var x={o:0,foo_:1,_:function(){return this.foo_+this.o}};x.bar_=2,x.o=3,console.log(x._()); -``` -Mangle all properties matching a `regex`: -```bash -$ uglifyjs example.js -c -m --mangle-props regex=/_$/ -``` -```javascript -var x={o:0,_:1,calc:function(){return this._+this.o}};x.l=2,x.o=3,console.log(x.calc()); -``` - -Combining mangle properties options: -```bash -$ uglifyjs example.js -c -m --mangle-props regex=/_$/,reserved=[bar_] -``` -```javascript -var x={o:0,_:1,calc:function(){return this._+this.o}};x.bar_=2,x.o=3,console.log(x.calc()); -``` - -In order for this to be of any use, we avoid mangling standard JS names by -default (`--mangle-props builtins` to override). - -A default exclusion file is provided in `tools/domprops.json` which should -cover most standard JS and DOM properties defined in various browsers. Pass -`--mangle-props domprops` to disable this feature. - -A regular expression can be used to define which property names should be -mangled. For example, `--mangle-props regex=/^_/` will only mangle property -names that start with an underscore. - -When you compress multiple files using this option, in order for them to -work together in the end we need to ensure somehow that one property gets -mangled to the same name in all of them. For this, pass `--name-cache filename.json` -and UglifyJS will maintain these mappings in a file which can then be reused. -It should be initially empty. Example: - -```bash -$ rm -f /tmp/cache.json # start fresh -$ uglifyjs file1.js file2.js --mangle-props --name-cache /tmp/cache.json -o part1.js -$ uglifyjs file3.js file4.js --mangle-props --name-cache /tmp/cache.json -o part2.js -``` - -Now, `part1.js` and `part2.js` will be consistent with each other in terms -of mangled property names. - -Using the name cache is not necessary if you compress all your files in a -single call to UglifyJS. - -### Mangling unquoted names (`--mangle-props keep_quoted`) - -Using quoted property name (`o["foo"]`) reserves the property name (`foo`) -so that it is not mangled throughout the entire script even when used in an -unquoted style (`o.foo`). Example: - -```javascript -// stuff.js -var o = { - "foo": 1, - bar: 3, -}; -o.foo += o.bar; -console.log(o.foo); -``` -```bash -$ uglifyjs stuff.js --mangle-props keep_quoted -c -m -``` -```javascript -var o={foo:1,o:3};o.foo+=o.o,console.log(o.foo); -``` - -If the minified output will be processed again by UglifyJS, consider specifying -`keep_quoted_props` so the same property names are preserved: - -```bash -$ uglifyjs stuff.js --mangle-props keep_quoted -c -m -O keep_quoted_props -``` -```javascript -var o={"foo":1,o:3};o.foo+=o.o,console.log(o.foo); -``` - -### Debugging property name mangling - -You can also pass `--mangle-props debug` in order to mangle property names -without completely obscuring them. For example the property `o.foo` -would mangle to `o._$foo$_` with this option. This allows property mangling -of a large codebase while still being able to debug the code and identify -where mangling is breaking things. - -```bash -$ uglifyjs stuff.js --mangle-props debug -c -m -``` -```javascript -var o={_$foo$_:1,_$bar$_:3};o._$foo$_+=o._$bar$_,console.log(o._$foo$_); -``` - -You can also pass a custom suffix using `--mangle-props debug=XYZ`. This would then -mangle `o.foo` to `o._$foo$XYZ_`. You can change this each time you compile a -script to identify how a property got mangled. One technique is to pass a -random number on every compile to simulate mangling changing with different -inputs (e.g. as you update the input script with new properties), and to help -identify mistakes like writing mangled keys to storage. - - -# API Reference - -Assuming installation via NPM, you can load UglifyJS in your application -like this: -```javascript -var UglifyJS = require("uglify-js"); -``` - -There is a single high level function, **`minify(code, options)`**, -which will perform all minification [phases](#minify-options) in a configurable -manner. By default `minify()` will enable the options [`compress`](#compress-options) -and [`mangle`](#mangle-options). Example: -```javascript -var code = "function add(first, second) { return first + second; }"; -var result = UglifyJS.minify(code); -console.log(result.error); // runtime error, or `undefined` if no error -console.log(result.code); // minified output: function add(n,d){return n+d} -``` - -You can `minify` more than one JavaScript file at a time by using an object -for the first argument where the keys are file names and the values are source -code: -```javascript -var code = { - "file1.js": "function add(first, second) { return first + second; }", - "file2.js": "console.log(add(1 + 2, 3 + 4));" -}; -var result = UglifyJS.minify(code); -console.log(result.code); -// function add(d,n){return d+n}console.log(add(3,7)); -``` - -The `toplevel` option: -```javascript -var code = { - "file1.js": "function add(first, second) { return first + second; }", - "file2.js": "console.log(add(1 + 2, 3 + 4));" -}; -var options = { toplevel: true }; -var result = UglifyJS.minify(code, options); -console.log(result.code); -// console.log(3+7); -``` - -The `nameCache` option: -```javascript -var options = { - mangle: { - toplevel: true, - }, - nameCache: {} -}; -var result1 = UglifyJS.minify({ - "file1.js": "function add(first, second) { return first + second; }" -}, options); -var result2 = UglifyJS.minify({ - "file2.js": "console.log(add(1 + 2, 3 + 4));" -}, options); -console.log(result1.code); -// function n(n,r){return n+r} -console.log(result2.code); -// console.log(n(3,7)); -``` - -You may persist the name cache to the file system in the following way: -```javascript -var cacheFileName = "/tmp/cache.json"; -var options = { - mangle: { - properties: true, - }, - nameCache: JSON.parse(fs.readFileSync(cacheFileName, "utf8")) -}; -fs.writeFileSync("part1.js", UglifyJS.minify({ - "file1.js": fs.readFileSync("file1.js", "utf8"), - "file2.js": fs.readFileSync("file2.js", "utf8") -}, options).code, "utf8"); -fs.writeFileSync("part2.js", UglifyJS.minify({ - "file3.js": fs.readFileSync("file3.js", "utf8"), - "file4.js": fs.readFileSync("file4.js", "utf8") -}, options).code, "utf8"); -fs.writeFileSync(cacheFileName, JSON.stringify(options.nameCache), "utf8"); -``` - -An example of a combination of `minify()` options: -```javascript -var code = { - "file1.js": "function add(first, second) { return first + second; }", - "file2.js": "console.log(add(1 + 2, 3 + 4));" -}; -var options = { - toplevel: true, - compress: { - global_defs: { - "@console.log": "alert" - }, - passes: 2 - }, - output: { - beautify: false, - preamble: "/* uglified */" - } -}; -var result = UglifyJS.minify(code, options); -console.log(result.code); -// /* uglified */ -// alert(10);" -``` - -To produce warnings: -```javascript -var code = "function f(){ var u; return 2 + 3; }"; -var options = { warnings: true }; -var result = UglifyJS.minify(code, options); -console.log(result.error); // runtime error, `undefined` in this case -console.log(result.warnings); // [ 'Dropping unused variable u [0:1,18]' ] -console.log(result.code); // function f(){return 5} -``` - -An error example: -```javascript -var result = UglifyJS.minify({"foo.js" : "if (0) else console.log(1);"}); -console.log(JSON.stringify(result.error)); -// {"message":"Unexpected token: keyword (else)","filename":"foo.js","line":1,"col":7,"pos":7} -``` -Note: unlike `uglify-js@2.x`, the `3.x` API does not throw errors. To -achieve a similar effect one could do the following: -```javascript -var result = UglifyJS.minify(code, options); -if (result.error) throw result.error; -``` - -## Minify options - -- `annotations` — pass `false` to ignore all comment annotations and elide them - from output. Useful when, for instance, external tools incorrectly applied - `/*@__PURE__*/` or `/*#__PURE__*/`. Pass `true` to both compress and retain - comment annotations in output to allow for further processing downstream. - -- `compress` (default: `{}`) — pass `false` to skip compressing entirely. - Pass an object to specify custom [compress options](#compress-options). - -- `expression` (default: `false`) — parse as a single expression, e.g. JSON. - -- `ie` (default: `false`) — enable workarounds for Internet Explorer bugs. - -- `keep_fargs` (default: `false`) — pass `true` to prevent discarding or mangling - of function arguments. - -- `keep_fnames` (default: `false`) — pass `true` to prevent discarding or mangling - of function names. Useful for code relying on `Function.prototype.name`. - -- `mangle` (default: `true`) — pass `false` to skip mangling names, or pass - an object to specify [mangle options](#mangle-options) (see below). - - - `mangle.properties` (default: `false`) — a subcategory of the mangle option. - Pass an object to specify custom [mangle property options](#mangle-properties-options). - -- `module` (default: `false`) — set to `true` if you wish to process input as - ES module, i.e. implicit `"use strict";` and support for top-level `await`, - alongside with `toplevel` enabled. - -- `nameCache` (default: `null`) — pass an empty object `{}` or a previously - used `nameCache` object if you wish to cache mangled variable and - property names across multiple invocations of `minify()`. Note: this is - a read/write property. `minify()` will read the name cache state of this - object and update it during minification so that it may be - reused or externally persisted by the user. - -- `output` (default: `null`) — pass an object if you wish to specify - additional [output options](#output-options). The defaults are optimized - for best compression. - -- `parse` (default: `{}`) — pass an object if you wish to specify some - additional [parse options](#parse-options). - -- `sourceMap` (default: `false`) — pass an object if you wish to specify - [source map options](#source-map-options). - -- `toplevel` (default: `false`) — set to `true` if you wish to enable top level - variable and function name mangling and to drop unused variables and functions. - -- `v8` (default: `false`) — enable workarounds for Chrome & Node.js bugs. - -- `warnings` (default: `false`) — pass `true` to return compressor warnings - in `result.warnings`. Use the value `"verbose"` for more detailed warnings. - -- `webkit` (default: `false`) — enable workarounds for Safari/WebKit bugs. - PhantomJS users should set this option to `true`. - -## Minify options structure - -```javascript -{ - parse: { - // parse options - }, - compress: { - // compress options - }, - mangle: { - // mangle options - - properties: { - // mangle property options - } - }, - output: { - // output options - }, - sourceMap: { - // source map options - }, - nameCache: null, // or specify a name cache object - toplevel: false, - warnings: false, -} -``` - -### Source map options - -To generate a source map: -```javascript -var result = UglifyJS.minify({"file1.js": "var a = function() {};"}, { - sourceMap: { - filename: "out.js", - url: "out.js.map" - } -}); -console.log(result.code); // minified output -console.log(result.map); // source map -``` - -Note that the source map is not saved in a file, it's just returned in -`result.map`. The value passed for `sourceMap.url` is only used to set -`//# sourceMappingURL=out.js.map` in `result.code`. The value of -`filename` is only used to set `file` attribute (see [the spec][sm-spec]) -in source map file. - -You can set option `sourceMap.url` to be `"inline"` and source map will -be appended to code. - -You can also specify sourceRoot property to be included in source map: -```javascript -var result = UglifyJS.minify({"file1.js": "var a = function() {};"}, { - sourceMap: { - root: "http://example.com/src", - url: "out.js.map" - } -}); -``` - -If you're compressing compiled JavaScript and have a source map for it, you -can use `sourceMap.content`: -```javascript -var result = UglifyJS.minify({"compiled.js": "compiled code"}, { - sourceMap: { - content: "content from compiled.js.map", - url: "minified.js.map" - } -}); -// same as before, it returns `code` and `map` -``` - -If you're using the `X-SourceMap` header instead, you can just omit `sourceMap.url`. - -If you wish to reduce file size of the source map, set option `sourceMap.names` -to be `false` and all symbol names will be omitted. - -## Parse options - -- `bare_returns` (default: `false`) — support top level `return` statements - -- `html5_comments` (default: `true`) — process HTML comment as workaround for - browsers which do not recognize `` in strings - -- `keep_quoted_props` (default: `false`) — when turned on, prevents stripping - quotes from property names in object literals. - -- `max_line_len` (default: `false`) — maximum line length (for uglified code) - -- `preamble` (default: `null`) — when passed it must be a string and - it will be prepended to the output literally. The source map will - adjust for this text. Can be used to insert a comment containing - licensing information, for example. - -- `preserve_line` (default: `false`) — pass `true` to retain line numbering on - a best effort basis. - -- `quote_keys` (default: `false`) — pass `true` to quote all keys in literal - objects - -- `quote_style` (default: `0`) — preferred quote style for strings (affects - quoted property names and directives as well): - - `0` — prefers double quotes, switches to single quotes when there are - more double quotes in the string itself. `0` is best for gzip size. - - `1` — always use single quotes - - `2` — always use double quotes - - `3` — always use the original quotes - -- `semicolons` (default: `true`) — separate statements with semicolons. If - you pass `false` then whenever possible we will use a newline instead of a - semicolon, leading to more readable output of uglified code (size before - gzip could be smaller; size after gzip insignificantly larger). - -- `shebang` (default: `true`) — preserve shebang `#!` in preamble (bash scripts) - -- `width` (default: `80`) — only takes effect when beautification is on, this - specifies an (orientative) line width that the beautifier will try to - obey. It refers to the width of the line text (excluding indentation). - It doesn't work very well currently, but it does make the code generated - by UglifyJS more readable. - -- `wrap_iife` (default: `false`) — pass `true` to wrap immediately invoked - function expressions. See - [#640](https://github.com/mishoo/UglifyJS/issues/640) for more details. - -# Miscellaneous - -### Keeping copyright notices or other comments - -You can pass `--comments` to retain certain comments in the output. By -default it will keep JSDoc-style comments that contain "@preserve", -"@license" or "@cc_on" (conditional compilation for IE). You can pass -`--comments all` to keep all the comments, or a valid JavaScript regexp to -keep only comments that match this regexp. For example `--comments /^!/` -will keep comments like `/*! Copyright Notice */`. - -Note, however, that there might be situations where comments are lost. For -example: -```javascript -function f() { - /** @preserve Foo Bar */ - function g() { - // this function is never called - } - return something(); -} -``` - -Even though it has "@preserve", the comment will be lost because the inner -function `g` (which is the AST node to which the comment is attached to) is -discarded by the compressor as not referenced. - -The safest comments where to place copyright information (or other info that -needs to be kept in the output) are comments attached to toplevel nodes. - -### The `unsafe` `compress` option - -It enables some transformations that *might* break code logic in certain -contrived cases, but should be fine for most code. You might want to try it -on your own code, it should reduce the minified size. Here's what happens -when this flag is on: - -- `new Array(1, 2, 3)` or `Array(1, 2, 3)` → `[ 1, 2, 3 ]` -- `new Object()` → `{}` -- `String(exp)` or `exp.toString()` → `"" + exp` -- `new Object/RegExp/Function/Error/Array (...)` → we discard the `new` - -### Conditional compilation - -You can use the `--define` (`-d`) switch in order to declare global -variables that UglifyJS will assume to be constants (unless defined in -scope). For example if you pass `--define DEBUG=false` then, coupled with -dead code removal UglifyJS will discard the following from the output: -```javascript -if (DEBUG) { - console.log("debug stuff"); -} -``` - -You can specify nested constants in the form of `--define env.DEBUG=false`. - -UglifyJS will warn about the condition being always false and about dropping -unreachable code; for now there is no option to turn off only this specific -warning, you can pass `warnings=false` to turn off *all* warnings. - -Another way of doing that is to declare your globals as constants in a -separate file and include it into the build. For example you can have a -`build/defines.js` file with the following: -```javascript -var DEBUG = false; -var PRODUCTION = true; -// etc. -``` - -and build your code like this: - - uglifyjs build/defines.js js/foo.js js/bar.js... -c - -UglifyJS will notice the constants and, since they cannot be altered, it -will evaluate references to them to the value itself and drop unreachable -code as usual. The build will contain the `const` declarations if you use -them. If you are targeting < ES6 environments which does not support `const`, -using `var` with `reduce_vars` (enabled by default) should suffice. - -### Conditional compilation API - -You can also use conditional compilation via the programmatic API. With the difference that the -property name is `global_defs` and is a compressor property: - -```javascript -var result = UglifyJS.minify(fs.readFileSync("input.js", "utf8"), { - compress: { - dead_code: true, - global_defs: { - DEBUG: false - } - } -}); -``` - -To replace an identifier with an arbitrary non-constant expression it is -necessary to prefix the `global_defs` key with `"@"` to instruct UglifyJS -to parse the value as an expression: -```javascript -UglifyJS.minify("alert('hello');", { - compress: { - global_defs: { - "@alert": "console.log" - } - } -}).code; -// returns: 'console.log("hello");' -``` - -Otherwise it would be replaced as string literal: -```javascript -UglifyJS.minify("alert('hello');", { - compress: { - global_defs: { - "alert": "console.log" - } - } -}).code; -// returns: '"console.log"("hello");' -``` - -### Using native Uglify AST with `minify()` -```javascript -// example: parse only, produce native Uglify AST - -var result = UglifyJS.minify(code, { - parse: {}, - compress: false, - mangle: false, - output: { - ast: true, - code: false // optional - faster if false - } -}); - -// result.ast contains native Uglify AST -``` -```javascript -// example: accept native Uglify AST input and then compress and mangle -// to produce both code and native AST. - -var result = UglifyJS.minify(ast, { - compress: {}, - mangle: {}, - output: { - ast: true, - code: true // optional - faster if false - } -}); - -// result.ast contains native Uglify AST -// result.code contains the minified code in string form. -``` - -### Working with Uglify AST - -Transversal and transformation of the native AST can be performed through -[`TreeWalker`](https://github.com/mishoo/UglifyJS/blob/master/lib/ast.js) and -[`TreeTransformer`](https://github.com/mishoo/UglifyJS/blob/master/lib/transform.js) -respectively. - -### ESTree / SpiderMonkey AST - -UglifyJS has its own abstract syntax tree format; for -[practical reasons](http://lisperator.net/blog/uglifyjs-why-not-switching-to-spidermonkey-ast/) -we can't easily change to using the SpiderMonkey AST internally. However, -UglifyJS now has a converter which can import a SpiderMonkey AST. - -For example [Acorn][acorn] is a super-fast parser that produces a -SpiderMonkey AST. It has a small CLI utility that parses one file and dumps -the AST in JSON on the standard output. To use UglifyJS to mangle and -compress that: - - acorn file.js | uglifyjs -p spidermonkey -m -c - -The `-p spidermonkey` option tells UglifyJS that all input files are not -JavaScript, but JS code described in SpiderMonkey AST in JSON. Therefore we -don't use our own parser in this case, but just transform that AST into our -internal AST. - -### Use Acorn for parsing - -More for fun, I added the `-p acorn` option which will use Acorn to do all -the parsing. If you pass this option, UglifyJS will `require("acorn")`. - -Acorn is really fast (e.g. 250ms instead of 380ms on some 650K code), but -converting the SpiderMonkey tree that Acorn produces takes another 150ms so -in total it's a bit more than just using UglifyJS's own parser. - -[acorn]: https://github.com/ternjs/acorn -[sm-spec]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k - -### Uglify Fast Minify Mode - -It's not well known, but whitespace removal and symbol mangling accounts -for 95% of the size reduction in minified code for most JavaScript - not -elaborate code transforms. One can simply disable `compress` to speed up -Uglify builds by 3 to 5 times. - -| d3.js | minify size | gzip size | minify time (seconds) | -| --- | ---: | ---: | ---: | -| original | 511,371 | 119,932 | - | -| uglify-js@3.13.0 mangle=false, compress=false | 363,988 | 95,695 | 0.56 | -| uglify-js@3.13.0 mangle=true, compress=false | 253,305 | 81,281 | 0.99 | -| uglify-js@3.13.0 mangle=true, compress=true | 244,436 | 79,854 | 5.30 | - -To enable fast minify mode from the CLI use: -``` -uglifyjs file.js -m -``` -To enable fast minify mode with the API use: -```javascript -UglifyJS.minify(code, { compress: false, mangle: true }); -``` - -### Source maps and debugging - -Various `compress` transforms that simplify, rearrange, inline and remove code -are known to have an adverse effect on debugging with source maps. This is -expected as code is optimized and mappings are often simply not possible as -some code no longer exists. For highest fidelity in source map debugging -disable the Uglify `compress` option and just use `mangle`. - -### Compiler assumptions - -To allow for better optimizations, the compiler makes various assumptions: - -- The code does not rely on preserving its runtime performance characteristics. - Typically uglified code will run faster due to less instructions and easier - inlining, but may be slower on rare occasions for a specific platform, e.g. - see [`reduce_funcs`](#compress-options). -- `.toString()` and `.valueOf()` don't have side effects, and for built-in - objects they have not been overridden. -- `undefined`, `NaN` and `Infinity` have not been externally redefined. -- `arguments.callee`, `arguments.caller` and `Function.prototype.caller` are not used. -- The code doesn't expect the contents of `Function.prototype.toString()` or - `Error.prototype.stack` to be anything in particular. -- Getting and setting properties on a plain object does not cause other side effects - (using `.watch()` or `Proxy`). -- Object properties can be added, removed and modified (not prevented with - `Object.defineProperty()`, `Object.defineProperties()`, `Object.freeze()`, - `Object.preventExtensions()` or `Object.seal()`). -- If array destructuring is present, index-like properties in `Array.prototype` - have not been overridden: - ```javascript - Object.prototype[0] = 42; - var [ a ] = []; - var { 0: b } = {}; - // 42 undefined - console.log([][0], a); - // 42 42 - console.log({}[0], b); - ``` -- Earlier versions of JavaScript will throw `SyntaxError` with the following: - ```javascript - ({ - p: 42, - get p() {}, - }); - // SyntaxError: Object literal may not have data and accessor property with - // the same name - ``` - UglifyJS may modify the input which in turn may suppress those errors. -- Iteration order of keys over an object which contains spread syntax in later - versions of Chrome and Node.js may be altered. -- When `toplevel` is enabled, UglifyJS effectively assumes input code is wrapped - within `function(){ ... }`, thus forbids aliasing of declared global variables: - ```javascript - A = "FAIL"; - var B = "FAIL"; - // can be `global`, `self`, `window` etc. - var top = function() { - return this; - }(); - // "PASS" - top.A = "PASS"; - console.log(A); - // "FAIL" after compress and/or mangle - top.B = "PASS"; - console.log(B); - ``` -- Use of `arguments` alongside destructuring as function parameters, e.g. - `function({}, arguments) {}` will result in `SyntaxError` in earlier versions - of Chrome and Node.js - UglifyJS may modify the input which in turn may - suppress those errors. -- Earlier versions of Chrome and Node.js will throw `ReferenceError` with the - following: - ```javascript - var a; - try { - throw 42; - } catch ({ - [a]: b, - // ReferenceError: a is not defined - }) { - let a; - } - ``` - UglifyJS may modify the input which in turn may suppress those errors. -- Later versions of JavaScript will throw `SyntaxError` with the following: - ```javascript - a => { - let a; - }; - // SyntaxError: Identifier 'a' has already been declared - ``` - UglifyJS may modify the input which in turn may suppress those errors. -- Later versions of JavaScript will throw `SyntaxError` with the following: - ```javascript - try { - // ... - } catch ({ message: a }) { - var a; - } - // SyntaxError: Identifier 'a' has already been declared - ``` - UglifyJS may modify the input which in turn may suppress those errors. -- Some versions of Chrome and Node.js will throw `ReferenceError` with the - following: - ```javascript - console.log(((a, b = function() { - return a; - // ReferenceError: a is not defined - }()) => b)()); - ``` - UglifyJS may modify the input which in turn may suppress those errors. -- Some arithmetic operations with `BigInt` may throw `TypeError`: - ```javascript - 1n + 1; - // TypeError: can't convert BigInt to number - ``` - UglifyJS may modify the input which in turn may suppress those errors. -- Some versions of JavaScript will throw `SyntaxError` with the - following: - ```javascript - console.log(String.raw`\uFo`); - // SyntaxError: Invalid Unicode escape sequence - ``` - UglifyJS may modify the input which in turn may suppress those errors. -- Some versions of JavaScript will throw `SyntaxError` with the - following: - ```javascript - try {} catch (e) { - for (var e of []); - } - // SyntaxError: Identifier 'e' has already been declared - ``` - UglifyJS may modify the input which in turn may suppress those errors. -- Some versions of Chrome and Node.js will give incorrect results with the - following: - ```javascript - console.log({ - ...{ - set 42(v) {}, - 42: "PASS", - }, - }); - // Expected: { '42': 'PASS' } - // Actual: { '42': undefined } - ``` - UglifyJS may modify the input which in turn may suppress those errors. -- Later versions of JavaScript will throw `SyntaxError` with the following: - ```javascript - var await; - class A { - static p = await; - } - // SyntaxError: Unexpected reserved word - ``` - UglifyJS may modify the input which in turn may suppress those errors. -- Later versions of JavaScript will throw `SyntaxError` with the following: - ```javascript - var async; - for (async of []); - // SyntaxError: The left-hand side of a for-of loop may not be 'async'. - ``` - UglifyJS may modify the input which in turn may suppress those errors. -- Some versions of Chrome and Node.js will give incorrect results with the - following: - ```javascript - console.log({ - ...console, - get 42() { - return "FAIL"; - }, - [42]: "PASS", - }[42], { - ...console, - get 42() { - return "FAIL"; - }, - 42: "PASS", - }[42]); - // Expected: "PASS PASS" - // Actual: "PASS FAIL" - ``` - UglifyJS may modify the input which in turn may suppress those errors. -- Earlier versions of JavaScript will throw `TypeError` with the following: - ```javascript - (function() { - { - const a = "foo"; - } - { - const a = "bar"; - } - })(); - // TypeError: const 'a' has already been declared - ``` - UglifyJS may modify the input which in turn may suppress those errors. -- Later versions of Chrome and Node.js will give incorrect results with the - following: - ```javascript - try { - class A { - static 42; - static get 42() {} - } - console.log("PASS"); - } catch (e) { - console.log("FAIL"); - } - // Expected: "PASS" - // Actual: "FAIL" - ``` - UglifyJS may modify the input which in turn may suppress those errors. -- Some versions of Chrome and Node.js will give incorrect results with the - following: - ```javascript - (async function(a) { - (function() { - var b = await => console.log("PASS"); - b(); - })(); - })().catch(console.error); - // Expected: "PASS" - // Actual: SyntaxError: Unexpected reserved word - ``` - UglifyJS may modify the input which in turn may suppress those errors. -- Later versions of Chrome and Node.js will give incorrect results with the - following: - ```javascript - try { - f(); - function f() { - throw 42; - } - } catch (e) { - console.log(typeof f, e); - } - // Expected: "function 42" - // Actual: "undefined 42" - ``` - UglifyJS may modify the input which in turn may suppress those errors. -- Later versions of JavaScript will throw `SyntaxError` with the following: - ```javascript - "use strict"; - console.log(function f() { - return f = "PASS"; - }()); - // Expected: "PASS" - // Actual: TypeError: invalid assignment to const 'f' - ``` - UglifyJS may modify the input which in turn may suppress those errors. -- Adobe ExtendScript will give incorrect results with the following: - ```javascript - alert(true ? "PASS" : false ? "FAIL" : null); - // Expected: "PASS" - // Actual: "FAIL" - ``` - UglifyJS may modify the input which in turn may suppress those errors. -- Adobe ExtendScript will give incorrect results with the following: - ```javascript - alert(42 ? null ? "FAIL" : "PASS" : "FAIL"); - // Expected: "PASS" - // Actual: SyntaxError: Expected: : - ``` - UglifyJS may modify the input which in turn may suppress those errors. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/uglify-js/bin/uglifyjs b/packages/wyatt_notification_bloc/example/scripts/node_modules/uglify-js/bin/uglifyjs deleted file mode 100755 index 49e5185e..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/uglify-js/bin/uglifyjs +++ /dev/null @@ -1,605 +0,0 @@ -#! /usr/bin/env node -// -*- js -*- - -"use strict"; - -require("../tools/tty"); - -var fs = require("fs"); -var info = require("../package.json"); -var path = require("path"); -var UglifyJS = require("../tools/node"); - -var skip_keys = [ "cname", "fixed", "in_arg", "inlined", "length_read", "parent_scope", "redef", "scope", "unused" ]; -var truthy_keys = [ "optional", "pure", "terminal", "uses_arguments", "uses_eval", "uses_with" ]; - -var files = {}; -var options = {}; -var short_forms = { - b: "beautify", - c: "compress", - d: "define", - e: "enclose", - h: "help", - m: "mangle", - o: "output", - O: "output-opts", - p: "parse", - v: "version", - V: "version", -}; -var args = process.argv.slice(2); -var paths = []; -var output, nameCache; -var specified = {}; -while (args.length) { - var arg = args.shift(); - if (arg[0] != "-") { - paths.push(arg); - } else if (arg == "--") { - paths = paths.concat(args); - break; - } else if (arg[1] == "-") { - process_option(arg.slice(2)); - } else [].forEach.call(arg.slice(1), function(letter, index, arg) { - if (!(letter in short_forms)) fatal("invalid option -" + letter); - process_option(short_forms[letter], index + 1 < arg.length); - }); -} - -function process_option(name, no_value) { - specified[name] = true; - switch (name) { - case "help": - switch (read_value()) { - case "ast": - print(UglifyJS.describe_ast()); - break; - case "options": - var text = []; - var toplevels = []; - var padding = ""; - var defaults = UglifyJS.default_options(); - for (var name in defaults) { - var option = defaults[name]; - if (option && typeof option == "object") { - text.push("--" + ({ - output: "beautify", - sourceMap: "source-map", - }[name] || name) + " options:"); - text.push(format_object(option)); - text.push(""); - } else { - if (padding.length < name.length) padding = Array(name.length + 1).join(" "); - toplevels.push([ { - keep_fargs: "keep-fargs", - keep_fnames: "keep-fnames", - nameCache: "name-cache", - }[name] || name, option ]); - } - } - toplevels.forEach(function(tokens) { - text.push("--" + tokens[0] + padding.slice(tokens[0].length - 2) + tokens[1]); - }); - print(text.join("\n")); - break; - default: - print([ - "Usage: uglifyjs [files...] [options]", - "", - "Options:", - " -h, --help Print usage information.", - " `--help options` for details on available options.", - " -v, -V, --version Print version number.", - " -p, --parse Specify parser options.", - " -c, --compress [options] Enable compressor/specify compressor options.", - " -m, --mangle [options] Mangle names/specify mangler options.", - " --mangle-props [options] Mangle properties/specify mangler options.", - " -b, --beautify [options] Beautify output/specify output options.", - " -O, --output-opts Output options (beautify disabled).", - " -o, --output Output file (default STDOUT).", - " --annotations Process and preserve comment annotations.", - " --no-annotations Ignore and discard comment annotations.", - " --comments [filter] Preserve copyright comments in the output.", - " --config-file Read minify() options from JSON file.", - " -d, --define [=value] Global definitions.", - " -e, --enclose [arg[,...][:value[,...]]] Embed everything in a big function, with configurable argument(s) & value(s).", - " --expression Parse a single expression, rather than a program.", - " --ie Support non-standard Internet Explorer.", - " --keep-fargs Do not mangle/drop function arguments.", - " --keep-fnames Do not mangle/drop function names. Useful for code relying on Function.prototype.name.", - " --module Process input as ES module (implies --toplevel)", - " --name-cache File to hold mangled name mappings.", - " --rename Force symbol expansion.", - " --no-rename Disable symbol expansion.", - " --self Build UglifyJS as a library (implies --wrap UglifyJS)", - " --source-map [options] Enable source map/specify source map options.", - " --timings Display operations run time on STDERR.", - " --toplevel Compress and/or mangle variables in toplevel scope.", - " --v8 Support non-standard Chrome & Node.js.", - " --validate Perform validation during AST manipulations.", - " --verbose Print diagnostic messages.", - " --warn Print warning messages.", - " --webkit Support non-standard Safari/Webkit.", - " --wrap Embed everything as a function with “exports” corresponding to “name” globally.", - "", - "(internal debug use only)", - " --in-situ Warning: replaces original source files with minified output.", - " --reduce-test Reduce a standalone test case (assumes cloned repository).", - ].join("\n")); - } - process.exit(); - case "version": - print(info.name + " " + info.version); - process.exit(); - case "config-file": - var config = JSON.parse(read_file(read_value(true))); - if (config.mangle && config.mangle.properties && config.mangle.properties.regex) { - config.mangle.properties.regex = UglifyJS.parse(config.mangle.properties.regex, { - expression: true, - }).value; - } - for (var key in config) if (!(key in options)) options[key] = config[key]; - break; - case "compress": - case "mangle": - options[name] = parse_js(read_value(), options[name]); - break; - case "source-map": - options.sourceMap = parse_js(read_value(), options.sourceMap); - break; - case "enclose": - options[name] = read_value(); - break; - case "annotations": - case "expression": - case "ie": - case "ie8": - case "module": - case "timings": - case "toplevel": - case "v8": - case "validate": - case "webkit": - options[name] = true; - break; - case "no-annotations": - options.annotations = false; - break; - case "keep-fargs": - options.keep_fargs = true; - break; - case "keep-fnames": - options.keep_fnames = true; - break; - case "wrap": - options[name] = read_value(true); - break; - case "verbose": - options.warnings = "verbose"; - break; - case "warn": - if (!options.warnings) options.warnings = true; - break; - case "beautify": - options.output = parse_js(read_value(), options.output); - if (!("beautify" in options.output)) options.output.beautify = true; - break; - case "output-opts": - options.output = parse_js(read_value(true), options.output); - break; - case "comments": - if (typeof options.output != "object") options.output = {}; - options.output.comments = read_value(); - if (options.output.comments === true) options.output.comments = "some"; - break; - case "define": - if (typeof options.compress != "object") options.compress = {}; - options.compress.global_defs = parse_js(read_value(true), options.compress.global_defs, "define"); - break; - case "mangle-props": - if (typeof options.mangle != "object") options.mangle = {}; - options.mangle.properties = parse_js(read_value(), options.mangle.properties); - break; - case "name-cache": - nameCache = read_value(true); - options.nameCache = JSON.parse(read_file(nameCache, "{}")); - break; - case "output": - output = read_value(true); - break; - case "parse": - options.parse = parse_js(read_value(true), options.parse); - break; - case "rename": - options.rename = true; - break; - case "no-rename": - options.rename = false; - break; - case "in-situ": - case "reduce-test": - case "self": - break; - default: - fatal("invalid option --" + name); - } - - function read_value(required) { - if (no_value || !args.length || args[0][0] == "-") { - if (required) fatal("missing option argument for --" + name); - return true; - } - return args.shift(); - } -} -if (!output && options.sourceMap && options.sourceMap.url != "inline") fatal("cannot write source map to STDOUT"); -if (specified["beautify"] && specified["output-opts"]) fatal("--beautify cannot be used with --output-opts"); -[ "compress", "mangle" ].forEach(function(name) { - if (!(name in options)) options[name] = false; -}); -if (/^ast|spidermonkey$/.test(output)) { - if (typeof options.output != "object") options.output = {}; - options.output.ast = true; - options.output.code = false; -} -if (options.parse && (options.parse.acorn || options.parse.spidermonkey) - && options.sourceMap && options.sourceMap.content == "inline") { - fatal("inline source map only works with built-in parser"); -} -if (options.warnings) { - UglifyJS.AST_Node.log_function(print_error, options.warnings == "verbose"); - delete options.warnings; -} -var convert_path = function(name) { - return name; -}; -if (typeof options.sourceMap == "object" && "base" in options.sourceMap) { - convert_path = function() { - var base = options.sourceMap.base; - delete options.sourceMap.base; - return function(name) { - return path.relative(base, name); - }; - }(); -} -if (specified["self"]) { - if (paths.length) UglifyJS.AST_Node.warn("Ignoring input files since --self was passed"); - if (!options.wrap) options.wrap = "UglifyJS"; - paths = UglifyJS.FILES; -} else if (paths.length) { - paths = simple_glob(paths); -} -if (specified["in-situ"]) { - if (output && output != "spidermonkey" || specified["reduce-test"] || specified["self"]) { - fatal("incompatible options specified"); - } - paths.forEach(function(name) { - print(name); - if (/^ast|spidermonkey$/.test(name)) fatal("invalid file name specified"); - files = {}; - files[convert_path(name)] = read_file(name); - output = name; - run(); - }); -} else if (paths.length) { - paths.forEach(function(name) { - files[convert_path(name)] = read_file(name); - }); - run(); -} else { - var timerId = process.stdin.isTTY && process.argv.length < 3 && setTimeout(function() { - print_error("Waiting for input... (use `--help` to print usage information)"); - }, 1500); - var chunks = []; - process.stdin.setEncoding("utf8"); - process.stdin.once("data", function() { - clearTimeout(timerId); - }).on("data", function(chunk) { - chunks.push(chunk); - }).on("end", function() { - files = { STDIN: chunks.join("") }; - run(); - }); - process.stdin.resume(); -} - -function convert_ast(fn) { - return UglifyJS.AST_Node.from_mozilla_ast(Object.keys(files).reduce(fn, null)); -} - -function run() { - var content = options.sourceMap && options.sourceMap.content; - if (content && content != "inline") { - UglifyJS.AST_Node.info("Using input source map: {content}", { - content : content, - }); - options.sourceMap.content = read_file(content, content); - } - try { - if (options.parse) { - if (options.parse.acorn) { - var annotations = Object.create(null); - files = convert_ast(function(toplevel, name) { - var content = files[name]; - var list = annotations[name] = []; - var prev = -1; - return require("acorn").parse(content, { - allowHashBang: true, - ecmaVersion: "latest", - locations: true, - onComment: function(block, text, start, end) { - var match = /[@#]__PURE__/.exec(text); - if (!match) { - if (start != prev) return; - match = [ list[prev] ]; - } - while (/\s/.test(content[end])) end++; - list[end] = match[0]; - prev = end; - }, - preserveParens: true, - program: toplevel, - sourceFile: name, - sourceType: "module", - }); - }); - files.walk(new UglifyJS.TreeWalker(function(node) { - if (!(node instanceof UglifyJS.AST_Call)) return; - var list = annotations[node.start.file]; - var pure = list[node.start.pos]; - if (!pure) { - var tokens = node.start.parens; - if (tokens) for (var i = 0; !pure && i < tokens.length; i++) { - pure = list[tokens[i].pos]; - } - } - if (pure) node.pure = pure; - })); - } else if (options.parse.spidermonkey) { - files = convert_ast(function(toplevel, name) { - var obj = JSON.parse(files[name]); - if (!toplevel) return obj; - toplevel.body = toplevel.body.concat(obj.body); - return toplevel; - }); - } - } - } catch (ex) { - fatal(ex); - } - var result; - if (specified["reduce-test"]) { - // load on demand - assumes cloned repository - var reduce_test = require("../test/reduce"); - if (Object.keys(files).length != 1) fatal("can only test on a single file"); - result = reduce_test(files[Object.keys(files)[0]], options, { - log: print_error, - verbose: true, - }); - } else { - result = UglifyJS.minify(files, options); - } - if (result.error) { - var ex = result.error; - if (ex.name == "SyntaxError") { - print_error("Parse error at " + ex.filename + ":" + ex.line + "," + ex.col); - var file = files[ex.filename]; - if (file) { - var col = ex.col; - var lines = file.split(/\r?\n/); - var line = lines[ex.line - 1]; - if (!line && !col) { - line = lines[ex.line - 2]; - col = line.length; - } - if (line) { - var limit = 70; - if (col > limit) { - line = line.slice(col - limit); - col = limit; - } - print_error(line.slice(0, 80)); - print_error(line.slice(0, col).replace(/\S/g, " ") + "^"); - } - } - } else if (ex.defs) { - print_error("Supported options:"); - print_error(format_object(ex.defs)); - } - fatal(ex); - } else if (output == "ast") { - if (!options.compress && !options.mangle) { - var toplevel = result.ast; - if (!(toplevel instanceof UglifyJS.AST_Toplevel)) { - if (!(toplevel instanceof UglifyJS.AST_Statement)) toplevel = new UglifyJS.AST_SimpleStatement({ - body: toplevel, - }); - toplevel = new UglifyJS.AST_Toplevel({ - body: [ toplevel ], - }); - } - toplevel.figure_out_scope({}); - } - print(JSON.stringify(result.ast, function(key, value) { - if (value) switch (key) { - case "enclosed": - return value.length ? value.map(symdef) : undefined; - case "functions": - case "globals": - case "variables": - return value.size() ? value.map(symdef) : undefined; - case "thedef": - return symdef(value); - } - if (skip_property(key, value)) return; - if (value instanceof UglifyJS.AST_Token) return; - if (value instanceof UglifyJS.Dictionary) return; - if (value instanceof UglifyJS.AST_Node) { - var result = { - _class: "AST_" + value.TYPE - }; - value.CTOR.PROPS.forEach(function(prop) { - result[prop] = value[prop]; - }); - return result; - } - return value; - }, 2)); - } else if (output == "spidermonkey") { - print(JSON.stringify(result.ast.to_mozilla_ast(), null, 2)); - } else if (output) { - var code; - if (result.ast) { - var opts = {}; - for (var name in options.output) { - if (!/^ast|code$/.test(name)) opts[name] = options.output[name]; - } - code = UglifyJS.AST_Node.from_mozilla_ast(result.ast.to_mozilla_ast()).print_to_string(opts); - } else { - code = result.code; - } - fs.writeFileSync(output, code); - if (result.map) fs.writeFileSync(output + ".map", result.map); - } else { - print(result.code); - } - if (nameCache) fs.writeFileSync(nameCache, JSON.stringify(options.nameCache)); - if (result.timings) for (var phase in result.timings) { - print_error("- " + phase + ": " + result.timings[phase].toFixed(3) + "s"); - } -} - -function fatal(message) { - if (message instanceof Error) { - message = message.stack.replace(/^\S*?Error:/, "ERROR:") - } else { - message = "ERROR: " + message; - } - print_error(message); - process.exit(1); -} - -// A file glob function that only supports "*" and "?" wildcards in the basename. -// Example: "foo/bar/*baz??.*.js" -// Argument `paths` must be an array of strings. -// Returns an array of strings. Garbage in, garbage out. -function simple_glob(paths) { - return paths.reduce(function(paths, glob) { - if (/\*|\?/.test(glob)) { - var dir = path.dirname(glob); - try { - var entries = fs.readdirSync(dir).filter(function(name) { - try { - return fs.statSync(path.join(dir, name)).isFile(); - } catch (ex) { - return false; - } - }); - } catch (ex) {} - if (entries) { - var pattern = "^" + path.basename(glob) - .replace(/[.+^$[\]\\(){}]/g, "\\$&") - .replace(/\*/g, "[^/\\\\]*") - .replace(/\?/g, "[^/\\\\]") + "$"; - var mod = process.platform === "win32" ? "i" : ""; - var rx = new RegExp(pattern, mod); - var results = entries.filter(function(name) { - return rx.test(name); - }).sort().map(function(name) { - return path.join(dir, name); - }); - if (results.length) { - [].push.apply(paths, results); - return paths; - } - } - } - paths.push(glob); - return paths; - }, []); -} - -function read_file(path, default_value) { - try { - return fs.readFileSync(path, "utf8"); - } catch (ex) { - if (ex.code == "ENOENT" && default_value != null) return default_value; - fatal(ex); - } -} - -function parse_js(value, options, flag) { - if (!options || typeof options != "object") options = Object.create(null); - if (typeof value == "string") try { - UglifyJS.parse(value, { - expression: true - }).walk(new UglifyJS.TreeWalker(function(node) { - if (node instanceof UglifyJS.AST_Assign) { - var name = node.left.print_to_string(); - var value = node.right; - if (flag) { - options[name] = value; - } else if (value instanceof UglifyJS.AST_Array) { - options[name] = value.elements.map(to_string); - } else { - options[name] = to_string(value); - } - return true; - } - if (node instanceof UglifyJS.AST_Symbol || node instanceof UglifyJS.AST_PropAccess) { - var name = node.print_to_string(); - options[name] = true; - return true; - } - if (!(node instanceof UglifyJS.AST_Sequence)) throw node; - - function to_string(value) { - return value instanceof UglifyJS.AST_Constant ? value.value : value.print_to_string({ - quote_keys: true - }); - } - })); - } catch (ex) { - if (flag) { - fatal("cannot parse arguments for '" + flag + "': " + value); - } else { - options[value] = null; - } - } - return options; -} - -function skip_property(key, value) { - return skip_keys.indexOf(key) >= 0 - // only skip truthy_keys if their value is falsy - || truthy_keys.indexOf(key) >= 0 && !value; -} - -function symdef(def) { - var ret = (1e6 + def.id) + " " + def.name; - if (def.mangled_name) ret += " " + def.mangled_name; - return ret; -} - -function format_object(obj) { - var lines = []; - var padding = ""; - Object.keys(obj).map(function(name) { - if (padding.length < name.length) padding = Array(name.length + 1).join(" "); - return [ name, JSON.stringify(obj[name]) ]; - }).forEach(function(tokens) { - lines.push(" " + tokens[0] + padding.slice(tokens[0].length - 2) + tokens[1]); - }); - return lines.join("\n"); -} - -function print_error(msg) { - process.stderr.write(msg); - process.stderr.write("\n"); -} - -function print(txt) { - process.stdout.write(txt); - process.stdout.write("\n"); -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/uglify-js/lib/ast.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/uglify-js/lib/ast.js deleted file mode 100644 index 16ea9c80..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/uglify-js/lib/ast.js +++ /dev/null @@ -1,2356 +0,0 @@ -/*********************************************************************** - - A JavaScript tokenizer / parser / beautifier / compressor. - https://github.com/mishoo/UglifyJS - - -------------------------------- (C) --------------------------------- - - Author: Mihai Bazon - - http://mihai.bazon.net/blog - - Distributed under the BSD license: - - Copyright 2012 (c) Mihai Bazon - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - * Redistributions of source code must retain the above - copyright notice, this list of conditions and the following - disclaimer. - - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials - provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY - EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR - TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF - THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - SUCH DAMAGE. - - ***********************************************************************/ - -"use strict"; - -function DEFNODE(type, props, methods, base) { - if (typeof base === "undefined") base = AST_Node; - props = props ? props.split(/\s+/) : []; - var self_props = props; - if (base && base.PROPS) props = props.concat(base.PROPS); - var code = [ - "return function AST_", type, "(props){", - // not essential, but speeds up compress by a few percent - "this._bits=0;", - "if(props){", - ]; - props.forEach(function(prop) { - code.push("this.", prop, "=props.", prop, ";"); - }); - code.push("}"); - var proto = Object.create(base && base.prototype); - if (methods.initialize || proto.initialize) code.push("this.initialize();"); - code.push("};"); - var ctor = new Function(code.join(""))(); - ctor.prototype = proto; - ctor.prototype.CTOR = ctor; - ctor.prototype.TYPE = ctor.TYPE = type; - if (base) { - ctor.BASE = base; - base.SUBCLASSES.push(ctor); - } - ctor.DEFMETHOD = function(name, method) { - this.prototype[name] = method; - }; - ctor.PROPS = props; - ctor.SELF_PROPS = self_props; - ctor.SUBCLASSES = []; - for (var name in methods) if (HOP(methods, name)) { - if (/^\$/.test(name)) { - ctor[name.substr(1)] = methods[name]; - } else { - ctor.DEFMETHOD(name, methods[name]); - } - } - if (typeof exports !== "undefined") exports["AST_" + type] = ctor; - return ctor; -} - -var AST_Token = DEFNODE("Token", "type value line col pos endline endcol endpos nlb comments_before comments_after file raw", { -}, null); - -var AST_Node = DEFNODE("Node", "start end", { - _clone: function(deep) { - if (deep) { - var self = this.clone(); - return self.transform(new TreeTransformer(function(node) { - if (node !== self) { - return node.clone(true); - } - })); - } - return new this.CTOR(this); - }, - clone: function(deep) { - return this._clone(deep); - }, - $documentation: "Base class of all AST nodes", - $propdoc: { - start: "[AST_Token] The first token of this node", - end: "[AST_Token] The last token of this node" - }, - equals: function(node) { - return this.TYPE == node.TYPE && this._equals(node); - }, - walk: function(visitor) { - visitor.visit(this); - }, - _validate: function() { - if (this.TYPE == "Node") throw new Error("should not instantiate AST_Node"); - }, - validate: function() { - var ctor = this.CTOR; - do { - ctor.prototype._validate.call(this); - } while (ctor = ctor.BASE); - }, - validate_ast: function() { - var marker = {}; - this.walk(new TreeWalker(function(node) { - if (node.validate_visited === marker) { - throw new Error(string_template("cannot reuse AST_{TYPE} from [{start}]", node)); - } - node.validate_visited = marker; - })); - }, -}, null); - -DEF_BITPROPS(AST_Node, [ - // AST_Node - "_optimized", - "_squeezed", - // AST_Call - "call_only", - // AST_Lambda - "collapse_scanning", - // AST_SymbolRef - "defined", - "evaluating", - "falsy", - // AST_SymbolRef - "in_arg", - // AST_Return - "in_bool", - // AST_SymbolRef - "is_undefined", - // AST_LambdaExpression - // AST_LambdaDefinition - "inlined", - // AST_Lambda - "length_read", - // AST_Yield - "nested", - // AST_Lambda - "new", - // AST_Call - // AST_PropAccess - "optional", - // AST_ClassProperty - "private", - // AST_Call - "pure", - // AST_Assign - "redundant", - // AST_Node - "single_use", - // AST_ClassProperty - "static", - // AST_Call - // AST_PropAccess - "terminal", - "truthy", - // AST_Scope - "uses_eval", - // AST_Scope - "uses_with", -]); - -(AST_Node.log_function = function(fn, verbose) { - if (typeof fn != "function") { - AST_Node.info = AST_Node.warn = noop; - return; - } - var printed = Object.create(null); - AST_Node.info = verbose ? function(text, props) { - log("INFO: " + string_template(text, props)); - } : noop; - AST_Node.warn = function(text, props) { - log("WARN: " + string_template(text, props)); - }; - - function log(msg) { - if (printed[msg]) return; - printed[msg] = true; - fn(msg); - } -})(); - -var restore_transforms = []; -AST_Node.enable_validation = function() { - AST_Node.disable_validation(); - (function validate_transform(ctor) { - ctor.SUBCLASSES.forEach(validate_transform); - if (!HOP(ctor.prototype, "transform")) return; - var transform = ctor.prototype.transform; - ctor.prototype.transform = function(tw, in_list) { - var node = transform.call(this, tw, in_list); - if (node instanceof AST_Node) { - node.validate(); - } else if (!(node === null || in_list && List.is_op(node))) { - throw new Error("invalid transformed value: " + node); - } - return node; - }; - restore_transforms.push(function() { - ctor.prototype.transform = transform; - }); - })(this); -}; - -AST_Node.disable_validation = function() { - var restore; - while (restore = restore_transforms.pop()) restore(); -}; - -function all_equals(k, l) { - return k.length == l.length && all(k, function(m, i) { - return m.equals(l[i]); - }); -} - -function list_equals(s, t) { - return s.length == t.length && all(s, function(u, i) { - return u == t[i]; - }); -} - -function prop_equals(u, v) { - if (u === v) return true; - if (u == null) return v == null; - return u instanceof AST_Node && v instanceof AST_Node && u.equals(v); -} - -/* -----[ statements ]----- */ - -var AST_Statement = DEFNODE("Statement", null, { - $documentation: "Base class of all statements", - _validate: function() { - if (this.TYPE == "Statement") throw new Error("should not instantiate AST_Statement"); - }, -}); - -var AST_Debugger = DEFNODE("Debugger", null, { - $documentation: "Represents a debugger statement", - _equals: return_true, -}, AST_Statement); - -var AST_Directive = DEFNODE("Directive", "quote value", { - $documentation: "Represents a directive, like \"use strict\";", - $propdoc: { - quote: "[string?] the original quote character", - value: "[string] The value of this directive as a plain string (it's not an AST_String!)", - }, - _equals: function(node) { - return this.value == node.value; - }, - _validate: function() { - if (this.quote != null) { - if (typeof this.quote != "string") throw new Error("quote must be string"); - if (!/^["']$/.test(this.quote)) throw new Error("invalid quote: " + this.quote); - } - if (typeof this.value != "string") throw new Error("value must be string"); - }, -}, AST_Statement); - -var AST_EmptyStatement = DEFNODE("EmptyStatement", null, { - $documentation: "The empty statement (empty block or simply a semicolon)", - _equals: return_true, -}, AST_Statement); - -function is_statement(node) { - return node instanceof AST_Statement - && !(node instanceof AST_ClassExpression) - && !(node instanceof AST_LambdaExpression); -} - -function validate_expression(value, prop, multiple, allow_spread, allow_hole) { - multiple = multiple ? "contain" : "be"; - if (!(value instanceof AST_Node)) throw new Error(prop + " must " + multiple + " AST_Node"); - if (value instanceof AST_DefaultValue) throw new Error(prop + " cannot " + multiple + " AST_DefaultValue"); - if (value instanceof AST_Destructured) throw new Error(prop + " cannot " + multiple + " AST_Destructured"); - if (value instanceof AST_Hole && !allow_hole) throw new Error(prop + " cannot " + multiple + " AST_Hole"); - if (value instanceof AST_Spread && !allow_spread) throw new Error(prop + " cannot " + multiple + " AST_Spread"); - if (is_statement(value)) throw new Error(prop + " cannot " + multiple + " AST_Statement"); - if (value instanceof AST_SymbolDeclaration) { - throw new Error(prop + " cannot " + multiple + " AST_SymbolDeclaration"); - } -} - -function must_be_expression(node, prop) { - validate_expression(node[prop], prop); -} - -var AST_SimpleStatement = DEFNODE("SimpleStatement", "body", { - $documentation: "A statement consisting of an expression, i.e. a = 1 + 2", - $propdoc: { - body: "[AST_Node] an expression node (should not be instanceof AST_Statement)", - }, - _equals: function(node) { - return this.body.equals(node.body); - }, - walk: function(visitor) { - var node = this; - visitor.visit(node, function() { - node.body.walk(visitor); - }); - }, - _validate: function() { - must_be_expression(this, "body"); - }, -}, AST_Statement); - -var AST_BlockScope = DEFNODE("BlockScope", "_var_names enclosed functions make_def parent_scope variables", { - $documentation: "Base class for all statements introducing a lexical scope", - $propdoc: { - enclosed: "[SymbolDef*/S] a list of all symbol definitions that are accessed from this scope or any inner scopes", - functions: "[Dictionary/S] like `variables`, but only lists function declarations", - parent_scope: "[AST_Scope?/S] link to the parent scope", - variables: "[Dictionary/S] a map of name ---> SymbolDef for all variables/functions defined in this scope", - }, - clone: function(deep) { - var node = this._clone(deep); - if (this.enclosed) node.enclosed = this.enclosed.slice(); - if (this.functions) node.functions = this.functions.clone(); - if (this.variables) node.variables = this.variables.clone(); - return node; - }, - pinned: function() { - return this.resolve().pinned(); - }, - resolve: function() { - return this.parent_scope.resolve(); - }, - _validate: function() { - if (this.TYPE == "BlockScope") throw new Error("should not instantiate AST_BlockScope"); - if (this.parent_scope == null) return; - if (!(this.parent_scope instanceof AST_BlockScope)) throw new Error("parent_scope must be AST_BlockScope"); - if (!(this.resolve() instanceof AST_Scope)) throw new Error("must be contained within AST_Scope"); - }, -}, AST_Statement); - -function walk_body(node, visitor) { - node.body.forEach(function(node) { - node.walk(visitor); - }); -} - -var AST_Block = DEFNODE("Block", "body", { - $documentation: "A body of statements (usually braced)", - $propdoc: { - body: "[AST_Statement*] an array of statements" - }, - _equals: function(node) { - return all_equals(this.body, node.body); - }, - walk: function(visitor) { - var node = this; - visitor.visit(node, function() { - walk_body(node, visitor); - }); - }, - _validate: function() { - if (this.TYPE == "Block") throw new Error("should not instantiate AST_Block"); - this.body.forEach(function(node) { - if (!is_statement(node)) throw new Error("body must contain AST_Statement"); - }); - }, -}, AST_BlockScope); - -var AST_BlockStatement = DEFNODE("BlockStatement", null, { - $documentation: "A block statement", -}, AST_Block); - -var AST_StatementWithBody = DEFNODE("StatementWithBody", "body", { - $documentation: "Base class for all statements that contain one nested body: `For`, `ForIn`, `Do`, `While`, `With`", - $propdoc: { - body: "[AST_Statement] the body; this should always be present, even if it's an AST_EmptyStatement" - }, - _validate: function() { - if (this.TYPE == "StatementWithBody") throw new Error("should not instantiate AST_StatementWithBody"); - if (!is_statement(this.body)) throw new Error("body must be AST_Statement"); - }, -}, AST_BlockScope); - -var AST_LabeledStatement = DEFNODE("LabeledStatement", "label", { - $documentation: "Statement with a label", - $propdoc: { - label: "[AST_Label] a label definition" - }, - _equals: function(node) { - return this.label.equals(node.label) - && this.body.equals(node.body); - }, - walk: function(visitor) { - var node = this; - visitor.visit(node, function() { - node.label.walk(visitor); - node.body.walk(visitor); - }); - }, - clone: function(deep) { - var node = this._clone(deep); - if (deep) { - var label = node.label; - var def = this.label; - node.walk(new TreeWalker(function(node) { - if (node instanceof AST_LoopControl) { - if (!node.label || node.label.thedef !== def) return; - node.label.thedef = label; - label.references.push(node); - return true; - } - if (node instanceof AST_Scope) return true; - })); - } - return node; - }, - _validate: function() { - if (!(this.label instanceof AST_Label)) throw new Error("label must be AST_Label"); - }, -}, AST_StatementWithBody); - -var AST_IterationStatement = DEFNODE("IterationStatement", null, { - $documentation: "Internal class. All loops inherit from it.", - _validate: function() { - if (this.TYPE == "IterationStatement") throw new Error("should not instantiate AST_IterationStatement"); - }, -}, AST_StatementWithBody); - -var AST_DWLoop = DEFNODE("DWLoop", "condition", { - $documentation: "Base class for do/while statements", - $propdoc: { - condition: "[AST_Node] the loop condition. Should not be instanceof AST_Statement" - }, - _equals: function(node) { - return this.body.equals(node.body) - && this.condition.equals(node.condition); - }, - _validate: function() { - if (this.TYPE == "DWLoop") throw new Error("should not instantiate AST_DWLoop"); - must_be_expression(this, "condition"); - }, -}, AST_IterationStatement); - -var AST_Do = DEFNODE("Do", null, { - $documentation: "A `do` statement", - walk: function(visitor) { - var node = this; - visitor.visit(node, function() { - node.body.walk(visitor); - node.condition.walk(visitor); - }); - }, -}, AST_DWLoop); - -var AST_While = DEFNODE("While", null, { - $documentation: "A `while` statement", - walk: function(visitor) { - var node = this; - visitor.visit(node, function() { - node.condition.walk(visitor); - node.body.walk(visitor); - }); - }, -}, AST_DWLoop); - -var AST_For = DEFNODE("For", "init condition step", { - $documentation: "A `for` statement", - $propdoc: { - init: "[AST_Node?] the `for` initialization code, or null if empty", - condition: "[AST_Node?] the `for` termination clause, or null if empty", - step: "[AST_Node?] the `for` update clause, or null if empty" - }, - _equals: function(node) { - return prop_equals(this.init, node.init) - && prop_equals(this.condition, node.condition) - && prop_equals(this.step, node.step) - && this.body.equals(node.body); - }, - walk: function(visitor) { - var node = this; - visitor.visit(node, function() { - if (node.init) node.init.walk(visitor); - if (node.condition) node.condition.walk(visitor); - if (node.step) node.step.walk(visitor); - node.body.walk(visitor); - }); - }, - _validate: function() { - if (this.init != null) { - if (!(this.init instanceof AST_Node)) throw new Error("init must be AST_Node"); - if (is_statement(this.init) && !(this.init instanceof AST_Definitions)) { - throw new Error("init cannot be AST_Statement"); - } - } - if (this.condition != null) must_be_expression(this, "condition"); - if (this.step != null) must_be_expression(this, "step"); - }, -}, AST_IterationStatement); - -var AST_ForEnumeration = DEFNODE("ForEnumeration", "init object", { - $documentation: "Base class for enumeration loops, i.e. `for ... in`, `for ... of` & `for await ... of`", - $propdoc: { - init: "[AST_Node] the assignment target during iteration", - object: "[AST_Node] the object to iterate over" - }, - _equals: function(node) { - return this.init.equals(node.init) - && this.object.equals(node.object) - && this.body.equals(node.body); - }, - walk: function(visitor) { - var node = this; - visitor.visit(node, function() { - node.init.walk(visitor); - node.object.walk(visitor); - node.body.walk(visitor); - }); - }, - _validate: function() { - if (this.TYPE == "ForEnumeration") throw new Error("should not instantiate AST_ForEnumeration"); - if (this.init instanceof AST_Definitions) { - if (this.init.definitions.length != 1) throw new Error("init must have single declaration"); - } else { - validate_destructured(this.init, function(node) { - if (!(node instanceof AST_PropAccess || node instanceof AST_SymbolRef)) { - throw new Error("init must be assignable: " + node.TYPE); - } - }); - } - must_be_expression(this, "object"); - }, -}, AST_IterationStatement); - -var AST_ForIn = DEFNODE("ForIn", null, { - $documentation: "A `for ... in` statement", -}, AST_ForEnumeration); - -var AST_ForOf = DEFNODE("ForOf", null, { - $documentation: "A `for ... of` statement", -}, AST_ForEnumeration); - -var AST_ForAwaitOf = DEFNODE("ForAwaitOf", null, { - $documentation: "A `for await ... of` statement", -}, AST_ForOf); - -var AST_With = DEFNODE("With", "expression", { - $documentation: "A `with` statement", - $propdoc: { - expression: "[AST_Node] the `with` expression" - }, - _equals: function(node) { - return this.expression.equals(node.expression) - && this.body.equals(node.body); - }, - walk: function(visitor) { - var node = this; - visitor.visit(node, function() { - node.expression.walk(visitor); - node.body.walk(visitor); - }); - }, - _validate: function() { - must_be_expression(this, "expression"); - }, -}, AST_StatementWithBody); - -/* -----[ scope and functions ]----- */ - -var AST_Scope = DEFNODE("Scope", "fn_defs may_call_this uses_eval uses_with", { - $documentation: "Base class for all statements introducing a lambda scope", - $propdoc: { - uses_eval: "[boolean/S] tells whether this scope contains a direct call to the global `eval`", - uses_with: "[boolean/S] tells whether this scope uses the `with` statement", - }, - pinned: function() { - return this.uses_eval || this.uses_with; - }, - resolve: return_this, - _validate: function() { - if (this.TYPE == "Scope") throw new Error("should not instantiate AST_Scope"); - }, -}, AST_Block); - -var AST_Toplevel = DEFNODE("Toplevel", "globals", { - $documentation: "The toplevel scope", - $propdoc: { - globals: "[Dictionary/S] a map of name ---> SymbolDef for all undeclared names", - }, - wrap: function(name) { - var body = this.body; - return parse([ - "(function(exports){'$ORIG';})(typeof ", - name, - "=='undefined'?(", - name, - "={}):", - name, - ");" - ].join(""), { - filename: "wrap=" + JSON.stringify(name) - }).transform(new TreeTransformer(function(node) { - if (node instanceof AST_Directive && node.value == "$ORIG") { - return List.splice(body); - } - })); - }, - enclose: function(args_values) { - if (typeof args_values != "string") args_values = ""; - var index = args_values.indexOf(":"); - if (index < 0) index = args_values.length; - var body = this.body; - return parse([ - "(function(", - args_values.slice(0, index), - '){"$ORIG"})(', - args_values.slice(index + 1), - ")" - ].join(""), { - filename: "enclose=" + JSON.stringify(args_values) - }).transform(new TreeTransformer(function(node) { - if (node instanceof AST_Directive && node.value == "$ORIG") { - return List.splice(body); - } - })); - } -}, AST_Scope); - -var AST_ClassInitBlock = DEFNODE("ClassInitBlock", null, { - $documentation: "Value for `class` static initialization blocks", -}, AST_Scope); - -var AST_Lambda = DEFNODE("Lambda", "argnames length_read rest safe_ids uses_arguments", { - $documentation: "Base class for functions", - $propdoc: { - argnames: "[(AST_DefaultValue|AST_Destructured|AST_SymbolFunarg)*] array of function arguments and/or destructured literals", - length_read: "[boolean/S] whether length property of this function is accessed", - rest: "[(AST_Destructured|AST_SymbolFunarg)?] rest parameter, or null if absent", - uses_arguments: "[boolean|number/S] whether this function accesses the arguments array", - }, - each_argname: function(visit) { - var tw = new TreeWalker(function(node) { - if (node instanceof AST_DefaultValue) { - node.name.walk(tw); - return true; - } - if (node instanceof AST_DestructuredKeyVal) { - node.value.walk(tw); - return true; - } - if (node instanceof AST_SymbolFunarg) visit(node); - }); - this.argnames.forEach(function(argname) { - argname.walk(tw); - }); - if (this.rest) this.rest.walk(tw); - }, - _equals: function(node) { - return prop_equals(this.rest, node.rest) - && prop_equals(this.name, node.name) - && prop_equals(this.value, node.value) - && all_equals(this.argnames, node.argnames) - && all_equals(this.body, node.body); - }, - walk: function(visitor) { - var node = this; - visitor.visit(node, function() { - if (node.name) node.name.walk(visitor); - node.argnames.forEach(function(argname) { - argname.walk(visitor); - }); - if (node.rest) node.rest.walk(visitor); - walk_body(node, visitor); - }); - }, - _validate: function() { - if (this.TYPE == "Lambda") throw new Error("should not instantiate AST_Lambda"); - this.argnames.forEach(function(node) { - validate_destructured(node, function(node) { - if (!(node instanceof AST_SymbolFunarg)) throw new Error("argnames must be AST_SymbolFunarg[]"); - }, true); - }); - if (this.rest != null) validate_destructured(this.rest, function(node) { - if (!(node instanceof AST_SymbolFunarg)) throw new Error("rest must be AST_SymbolFunarg"); - }); - }, -}, AST_Scope); - -var AST_Accessor = DEFNODE("Accessor", null, { - $documentation: "A getter/setter function", - _validate: function() { - if (this.name != null) throw new Error("name must be null"); - }, -}, AST_Lambda); - -var AST_LambdaExpression = DEFNODE("LambdaExpression", "inlined", { - $documentation: "Base class for function expressions", - $propdoc: { - inlined: "[boolean/S] whether this function has been inlined", - }, - _validate: function() { - if (this.TYPE == "LambdaExpression") throw new Error("should not instantiate AST_LambdaExpression"); - }, -}, AST_Lambda); - -function is_arrow(node) { - return node instanceof AST_Arrow || node instanceof AST_AsyncArrow; -} - -function is_async(node) { - return node instanceof AST_AsyncArrow - || node instanceof AST_AsyncDefun - || node instanceof AST_AsyncFunction - || node instanceof AST_AsyncGeneratorDefun - || node instanceof AST_AsyncGeneratorFunction; -} - -function is_generator(node) { - return node instanceof AST_AsyncGeneratorDefun - || node instanceof AST_AsyncGeneratorFunction - || node instanceof AST_GeneratorDefun - || node instanceof AST_GeneratorFunction; -} - -function walk_lambda(node, tw) { - if (is_arrow(node) && node.value) { - node.value.walk(tw); - } else { - walk_body(node, tw); - } -} - -var AST_Arrow = DEFNODE("Arrow", "value", { - $documentation: "An arrow function expression", - $propdoc: { - value: "[AST_Node?] simple return expression, or null if using function body.", - }, - walk: function(visitor) { - var node = this; - visitor.visit(node, function() { - node.argnames.forEach(function(argname) { - argname.walk(visitor); - }); - if (node.rest) node.rest.walk(visitor); - if (node.value) { - node.value.walk(visitor); - } else { - walk_body(node, visitor); - } - }); - }, - _validate: function() { - if (this.name != null) throw new Error("name must be null"); - if (this.uses_arguments) throw new Error("uses_arguments must be false"); - if (this.value != null) { - must_be_expression(this, "value"); - if (this.body.length) throw new Error("body must be empty if value exists"); - } - }, -}, AST_LambdaExpression); - -var AST_AsyncArrow = DEFNODE("AsyncArrow", "value", { - $documentation: "An asynchronous arrow function expression", - $propdoc: { - value: "[AST_Node?] simple return expression, or null if using function body.", - }, - walk: function(visitor) { - var node = this; - visitor.visit(node, function() { - node.argnames.forEach(function(argname) { - argname.walk(visitor); - }); - if (node.rest) node.rest.walk(visitor); - if (node.value) { - node.value.walk(visitor); - } else { - walk_body(node, visitor); - } - }); - }, - _validate: function() { - if (this.name != null) throw new Error("name must be null"); - if (this.uses_arguments) throw new Error("uses_arguments must be false"); - if (this.value != null) { - must_be_expression(this, "value"); - if (this.body.length) throw new Error("body must be empty if value exists"); - } - }, -}, AST_LambdaExpression); - -var AST_AsyncFunction = DEFNODE("AsyncFunction", "name", { - $documentation: "An asynchronous function expression", - $propdoc: { - name: "[AST_SymbolLambda?] the name of this function, or null if not specified", - }, - _validate: function() { - if (this.name != null) { - if (!(this.name instanceof AST_SymbolLambda)) throw new Error("name must be AST_SymbolLambda"); - } - }, -}, AST_LambdaExpression); - -var AST_AsyncGeneratorFunction = DEFNODE("AsyncGeneratorFunction", "name", { - $documentation: "An asynchronous generator function expression", - $propdoc: { - name: "[AST_SymbolLambda?] the name of this function, or null if not specified", - }, - _validate: function() { - if (this.name != null) { - if (!(this.name instanceof AST_SymbolLambda)) throw new Error("name must be AST_SymbolLambda"); - } - }, -}, AST_LambdaExpression); - -var AST_Function = DEFNODE("Function", "name", { - $documentation: "A function expression", - $propdoc: { - name: "[AST_SymbolLambda?] the name of this function, or null if not specified", - }, - _validate: function() { - if (this.name != null) { - if (!(this.name instanceof AST_SymbolLambda)) throw new Error("name must be AST_SymbolLambda"); - } - }, -}, AST_LambdaExpression); - -var AST_GeneratorFunction = DEFNODE("GeneratorFunction", "name", { - $documentation: "A generator function expression", - $propdoc: { - name: "[AST_SymbolLambda?] the name of this function, or null if not specified", - }, - _validate: function() { - if (this.name != null) { - if (!(this.name instanceof AST_SymbolLambda)) throw new Error("name must be AST_SymbolLambda"); - } - }, -}, AST_LambdaExpression); - -var AST_LambdaDefinition = DEFNODE("LambdaDefinition", "inlined name", { - $documentation: "Base class for function definitions", - $propdoc: { - inlined: "[boolean/S] whether this function has been inlined", - name: "[AST_SymbolDefun] the name of this function", - }, - _validate: function() { - if (this.TYPE == "LambdaDefinition") throw new Error("should not instantiate AST_LambdaDefinition"); - if (!(this.name instanceof AST_SymbolDefun)) throw new Error("name must be AST_SymbolDefun"); - }, -}, AST_Lambda); - -var AST_AsyncDefun = DEFNODE("AsyncDefun", null, { - $documentation: "An asynchronous function definition", -}, AST_LambdaDefinition); - -var AST_AsyncGeneratorDefun = DEFNODE("AsyncGeneratorDefun", null, { - $documentation: "An asynchronous generator function definition", -}, AST_LambdaDefinition); - -var AST_Defun = DEFNODE("Defun", null, { - $documentation: "A function definition", -}, AST_LambdaDefinition); - -var AST_GeneratorDefun = DEFNODE("GeneratorDefun", null, { - $documentation: "A generator function definition", -}, AST_LambdaDefinition); - -/* -----[ classes ]----- */ - -var AST_Class = DEFNODE("Class", "extends name properties", { - $documentation: "Base class for class literals", - $propdoc: { - extends: "[AST_Node?] the super class, or null if not specified", - properties: "[AST_ClassProperty*] array of class properties", - }, - _equals: function(node) { - return prop_equals(this.name, node.name) - && prop_equals(this.extends, node.extends) - && all_equals(this.properties, node.properties); - }, - resolve: function(def_class) { - return def_class ? this : this.parent_scope.resolve(); - }, - walk: function(visitor) { - var node = this; - visitor.visit(node, function() { - if (node.name) node.name.walk(visitor); - if (node.extends) node.extends.walk(visitor); - node.properties.forEach(function(prop) { - prop.walk(visitor); - }); - }); - }, - _validate: function() { - if (this.TYPE == "Class") throw new Error("should not instantiate AST_Class"); - if (this.extends != null) must_be_expression(this, "extends"); - this.properties.forEach(function(node) { - if (!(node instanceof AST_ClassProperty)) throw new Error("properties must contain AST_ClassProperty"); - }); - }, -}, AST_BlockScope); - -var AST_DefClass = DEFNODE("DefClass", null, { - $documentation: "A class definition", - $propdoc: { - name: "[AST_SymbolDefClass] the name of this class", - }, - _validate: function() { - if (!(this.name instanceof AST_SymbolDefClass)) throw new Error("name must be AST_SymbolDefClass"); - }, -}, AST_Class); - -var AST_ClassExpression = DEFNODE("ClassExpression", null, { - $documentation: "A class expression", - $propdoc: { - name: "[AST_SymbolClass?] the name of this class, or null if not specified", - }, - _validate: function() { - if (this.name != null) { - if (!(this.name instanceof AST_SymbolClass)) throw new Error("name must be AST_SymbolClass"); - } - }, -}, AST_Class); - -var AST_ClassProperty = DEFNODE("ClassProperty", "key private static value", { - $documentation: "Base class for `class` properties", - $propdoc: { - key: "[string|AST_Node?] property name (AST_Node for computed property, null for initialization block)", - private: "[boolean] whether this is a private property", - static: "[boolean] whether this is a static property", - value: "[AST_Node?] property value (AST_Accessor for getters/setters, AST_LambdaExpression for methods, null if not specified for fields)", - }, - _equals: function(node) { - return !this.private == !node.private - && !this.static == !node.static - && prop_equals(this.key, node.key) - && prop_equals(this.value, node.value); - }, - walk: function(visitor) { - var node = this; - visitor.visit(node, function() { - if (node.key instanceof AST_Node) node.key.walk(visitor); - if (node.value) node.value.walk(visitor); - }); - }, - _validate: function() { - if (this.TYPE == "ClassProperty") throw new Error("should not instantiate AST_ClassProperty"); - if (this instanceof AST_ClassInit) { - if (this.key != null) throw new Error("key must be null"); - } else if (typeof this.key != "string") { - if (!(this.key instanceof AST_Node)) throw new Error("key must be string or AST_Node"); - must_be_expression(this, "key"); - } - if(this.value != null) { - if (!(this.value instanceof AST_Node)) throw new Error("value must be AST_Node"); - } - }, -}); - -var AST_ClassField = DEFNODE("ClassField", null, { - $documentation: "A `class` field", - _validate: function() { - if(this.value != null) must_be_expression(this, "value"); - }, -}, AST_ClassProperty); - -var AST_ClassGetter = DEFNODE("ClassGetter", null, { - $documentation: "A `class` getter", - _validate: function() { - if (!(this.value instanceof AST_Accessor)) throw new Error("value must be AST_Accessor"); - }, -}, AST_ClassProperty); - -var AST_ClassSetter = DEFNODE("ClassSetter", null, { - $documentation: "A `class` setter", - _validate: function() { - if (!(this.value instanceof AST_Accessor)) throw new Error("value must be AST_Accessor"); - }, -}, AST_ClassProperty); - -var AST_ClassMethod = DEFNODE("ClassMethod", null, { - $documentation: "A `class` method", - _validate: function() { - if (!(this.value instanceof AST_LambdaExpression)) throw new Error("value must be AST_LambdaExpression"); - if (is_arrow(this.value)) throw new Error("value cannot be AST_Arrow or AST_AsyncArrow"); - if (this.value.name != null) throw new Error("name of class method's lambda must be null"); - }, -}, AST_ClassProperty); - -var AST_ClassInit = DEFNODE("ClassInit", null, { - $documentation: "A `class` static initialization block", - _validate: function() { - if (!this.static) throw new Error("static must be true"); - if (!(this.value instanceof AST_ClassInitBlock)) throw new Error("value must be AST_ClassInitBlock"); - }, - initialize: function() { - this.static = true; - }, -}, AST_ClassProperty); - -/* -----[ JUMPS ]----- */ - -var AST_Jump = DEFNODE("Jump", null, { - $documentation: "Base class for “jumps” (for now that's `return`, `throw`, `break` and `continue`)", - _validate: function() { - if (this.TYPE == "Jump") throw new Error("should not instantiate AST_Jump"); - }, -}, AST_Statement); - -var AST_Exit = DEFNODE("Exit", "value", { - $documentation: "Base class for “exits” (`return` and `throw`)", - $propdoc: { - value: "[AST_Node?] the value returned or thrown by this statement; could be null for AST_Return" - }, - _equals: function(node) { - return prop_equals(this.value, node.value); - }, - walk: function(visitor) { - var node = this; - visitor.visit(node, function() { - if (node.value) node.value.walk(visitor); - }); - }, - _validate: function() { - if (this.TYPE == "Exit") throw new Error("should not instantiate AST_Exit"); - }, -}, AST_Jump); - -var AST_Return = DEFNODE("Return", null, { - $documentation: "A `return` statement", - _validate: function() { - if (this.value != null) must_be_expression(this, "value"); - }, -}, AST_Exit); - -var AST_Throw = DEFNODE("Throw", null, { - $documentation: "A `throw` statement", - _validate: function() { - must_be_expression(this, "value"); - }, -}, AST_Exit); - -var AST_LoopControl = DEFNODE("LoopControl", "label", { - $documentation: "Base class for loop control statements (`break` and `continue`)", - $propdoc: { - label: "[AST_LabelRef?] the label, or null if none", - }, - _equals: function(node) { - return prop_equals(this.label, node.label); - }, - walk: function(visitor) { - var node = this; - visitor.visit(node, function() { - if (node.label) node.label.walk(visitor); - }); - }, - _validate: function() { - if (this.TYPE == "LoopControl") throw new Error("should not instantiate AST_LoopControl"); - if (this.label != null) { - if (!(this.label instanceof AST_LabelRef)) throw new Error("label must be AST_LabelRef"); - } - }, -}, AST_Jump); - -var AST_Break = DEFNODE("Break", null, { - $documentation: "A `break` statement" -}, AST_LoopControl); - -var AST_Continue = DEFNODE("Continue", null, { - $documentation: "A `continue` statement" -}, AST_LoopControl); - -/* -----[ IF ]----- */ - -var AST_If = DEFNODE("If", "condition alternative", { - $documentation: "A `if` statement", - $propdoc: { - condition: "[AST_Node] the `if` condition", - alternative: "[AST_Statement?] the `else` part, or null if not present" - }, - _equals: function(node) { - return this.body.equals(node.body) - && this.condition.equals(node.condition) - && prop_equals(this.alternative, node.alternative); - }, - walk: function(visitor) { - var node = this; - visitor.visit(node, function() { - node.condition.walk(visitor); - node.body.walk(visitor); - if (node.alternative) node.alternative.walk(visitor); - }); - }, - _validate: function() { - must_be_expression(this, "condition"); - if (this.alternative != null) { - if (!is_statement(this.alternative)) throw new Error("alternative must be AST_Statement"); - } - }, -}, AST_StatementWithBody); - -/* -----[ SWITCH ]----- */ - -var AST_Switch = DEFNODE("Switch", "expression", { - $documentation: "A `switch` statement", - $propdoc: { - expression: "[AST_Node] the `switch` “discriminant”" - }, - _equals: function(node) { - return this.expression.equals(node.expression) - && all_equals(this.body, node.body); - }, - walk: function(visitor) { - var node = this; - visitor.visit(node, function() { - node.expression.walk(visitor); - walk_body(node, visitor); - }); - }, - _validate: function() { - must_be_expression(this, "expression"); - this.body.forEach(function(node) { - if (!(node instanceof AST_SwitchBranch)) throw new Error("body must be AST_SwitchBranch[]"); - }); - }, -}, AST_Block); - -var AST_SwitchBranch = DEFNODE("SwitchBranch", null, { - $documentation: "Base class for `switch` branches", - _validate: function() { - if (this.TYPE == "SwitchBranch") throw new Error("should not instantiate AST_SwitchBranch"); - }, -}, AST_Block); - -var AST_Default = DEFNODE("Default", null, { - $documentation: "A `default` switch branch", -}, AST_SwitchBranch); - -var AST_Case = DEFNODE("Case", "expression", { - $documentation: "A `case` switch branch", - $propdoc: { - expression: "[AST_Node] the `case` expression" - }, - _equals: function(node) { - return this.expression.equals(node.expression) - && all_equals(this.body, node.body); - }, - walk: function(visitor) { - var node = this; - visitor.visit(node, function() { - node.expression.walk(visitor); - walk_body(node, visitor); - }); - }, - _validate: function() { - must_be_expression(this, "expression"); - }, -}, AST_SwitchBranch); - -/* -----[ EXCEPTIONS ]----- */ - -var AST_Try = DEFNODE("Try", "bcatch bfinally", { - $documentation: "A `try` statement", - $propdoc: { - bcatch: "[AST_Catch?] the catch block, or null if not present", - bfinally: "[AST_Finally?] the finally block, or null if not present" - }, - _equals: function(node) { - return all_equals(this.body, node.body) - && prop_equals(this.bcatch, node.bcatch) - && prop_equals(this.bfinally, node.bfinally); - }, - walk: function(visitor) { - var node = this; - visitor.visit(node, function() { - walk_body(node, visitor); - if (node.bcatch) node.bcatch.walk(visitor); - if (node.bfinally) node.bfinally.walk(visitor); - }); - }, - _validate: function() { - if (this.bcatch != null) { - if (!(this.bcatch instanceof AST_Catch)) throw new Error("bcatch must be AST_Catch"); - } - if (this.bfinally != null) { - if (!(this.bfinally instanceof AST_Finally)) throw new Error("bfinally must be AST_Finally"); - } - }, -}, AST_Block); - -var AST_Catch = DEFNODE("Catch", "argname", { - $documentation: "A `catch` node; only makes sense as part of a `try` statement", - $propdoc: { - argname: "[(AST_Destructured|AST_SymbolCatch)?] symbol for the exception, or null if not present", - }, - _equals: function(node) { - return prop_equals(this.argname, node.argname) - && all_equals(this.body, node.body); - }, - walk: function(visitor) { - var node = this; - visitor.visit(node, function() { - if (node.argname) node.argname.walk(visitor); - walk_body(node, visitor); - }); - }, - _validate: function() { - if (this.argname != null) validate_destructured(this.argname, function(node) { - if (!(node instanceof AST_SymbolCatch)) throw new Error("argname must be AST_SymbolCatch"); - }); - }, -}, AST_Block); - -var AST_Finally = DEFNODE("Finally", null, { - $documentation: "A `finally` node; only makes sense as part of a `try` statement" -}, AST_Block); - -/* -----[ VAR ]----- */ - -var AST_Definitions = DEFNODE("Definitions", "definitions", { - $documentation: "Base class for `var` nodes (variable declarations/initializations)", - $propdoc: { - definitions: "[AST_VarDef*] array of variable definitions" - }, - _equals: function(node) { - return all_equals(this.definitions, node.definitions); - }, - walk: function(visitor) { - var node = this; - visitor.visit(node, function() { - node.definitions.forEach(function(defn) { - defn.walk(visitor); - }); - }); - }, - _validate: function() { - if (this.TYPE == "Definitions") throw new Error("should not instantiate AST_Definitions"); - if (this.definitions.length < 1) throw new Error("must have at least one definition"); - }, -}, AST_Statement); - -var AST_Const = DEFNODE("Const", null, { - $documentation: "A `const` statement", - _validate: function() { - this.definitions.forEach(function(node) { - if (!(node instanceof AST_VarDef)) throw new Error("definitions must be AST_VarDef[]"); - validate_destructured(node.name, function(node) { - if (!(node instanceof AST_SymbolConst)) throw new Error("name must be AST_SymbolConst"); - }); - }); - }, -}, AST_Definitions); - -var AST_Let = DEFNODE("Let", null, { - $documentation: "A `let` statement", - _validate: function() { - this.definitions.forEach(function(node) { - if (!(node instanceof AST_VarDef)) throw new Error("definitions must be AST_VarDef[]"); - validate_destructured(node.name, function(node) { - if (!(node instanceof AST_SymbolLet)) throw new Error("name must be AST_SymbolLet"); - }); - }); - }, -}, AST_Definitions); - -var AST_Var = DEFNODE("Var", null, { - $documentation: "A `var` statement", - _validate: function() { - this.definitions.forEach(function(node) { - if (!(node instanceof AST_VarDef)) throw new Error("definitions must be AST_VarDef[]"); - validate_destructured(node.name, function(node) { - if (!(node instanceof AST_SymbolVar)) throw new Error("name must be AST_SymbolVar"); - }); - }); - }, -}, AST_Definitions); - -var AST_VarDef = DEFNODE("VarDef", "name value", { - $documentation: "A variable declaration; only appears in a AST_Definitions node", - $propdoc: { - name: "[AST_Destructured|AST_SymbolVar] name of the variable", - value: "[AST_Node?] initializer, or null of there's no initializer", - }, - _equals: function(node) { - return this.name.equals(node.name) - && prop_equals(this.value, node.value); - }, - walk: function(visitor) { - var node = this; - visitor.visit(node, function() { - node.name.walk(visitor); - if (node.value) node.value.walk(visitor); - }); - }, - _validate: function() { - if (this.value != null) must_be_expression(this, "value"); - }, -}); - -/* -----[ OTHER ]----- */ - -var AST_ExportDeclaration = DEFNODE("ExportDeclaration", "body", { - $documentation: "An `export` statement", - $propdoc: { - body: "[AST_DefClass|AST_Definitions|AST_LambdaDefinition] the statement to export", - }, - _equals: function(node) { - return this.body.equals(node.body); - }, - walk: function(visitor) { - var node = this; - visitor.visit(node, function() { - node.body.walk(visitor); - }); - }, - _validate: function() { - if (!(this.body instanceof AST_DefClass - || this.body instanceof AST_Definitions - || this.body instanceof AST_LambdaDefinition)) { - throw new Error("body must be AST_DefClass, AST_Definitions or AST_LambdaDefinition"); - } - }, -}, AST_Statement); - -var AST_ExportDefault = DEFNODE("ExportDefault", "body", { - $documentation: "An `export default` statement", - $propdoc: { - body: "[AST_Node] the default export", - }, - _equals: function(node) { - return this.body.equals(node.body); - }, - walk: function(visitor) { - var node = this; - visitor.visit(node, function() { - node.body.walk(visitor); - }); - }, - _validate: function() { - if (!(this.body instanceof AST_DefClass || this.body instanceof AST_LambdaDefinition)) { - must_be_expression(this, "body"); - } - }, -}, AST_Statement); - -var AST_ExportForeign = DEFNODE("ExportForeign", "aliases keys path", { - $documentation: "An `export ... from '...'` statement", - $propdoc: { - aliases: "[AST_String*] array of aliases to export", - keys: "[AST_String*] array of keys to import", - path: "[AST_String] the path to import module", - }, - _equals: function(node) { - return this.path.equals(node.path) - && all_equals(this.aliases, node.aliases) - && all_equals(this.keys, node.keys); - }, - _validate: function() { - if (this.aliases.length != this.keys.length) { - throw new Error("aliases:key length mismatch: " + this.aliases.length + " != " + this.keys.length); - } - this.aliases.forEach(function(name) { - if (!(name instanceof AST_String)) throw new Error("aliases must contain AST_String"); - }); - this.keys.forEach(function(name) { - if (!(name instanceof AST_String)) throw new Error("keys must contain AST_String"); - }); - if (!(this.path instanceof AST_String)) throw new Error("path must be AST_String"); - }, -}, AST_Statement); - -var AST_ExportReferences = DEFNODE("ExportReferences", "properties", { - $documentation: "An `export { ... }` statement", - $propdoc: { - properties: "[AST_SymbolExport*] array of aliases to export", - }, - _equals: function(node) { - return all_equals(this.properties, node.properties); - }, - walk: function(visitor) { - var node = this; - visitor.visit(node, function() { - node.properties.forEach(function(prop) { - prop.walk(visitor); - }); - }); - }, - _validate: function() { - this.properties.forEach(function(prop) { - if (!(prop instanceof AST_SymbolExport)) throw new Error("properties must contain AST_SymbolExport"); - }); - }, -}, AST_Statement); - -var AST_Import = DEFNODE("Import", "all default path properties", { - $documentation: "An `import` statement", - $propdoc: { - all: "[AST_SymbolImport?] the imported namespace, or null if not specified", - default: "[AST_SymbolImport?] the alias for default `export`, or null if not specified", - path: "[AST_String] the path to import module", - properties: "[(AST_SymbolImport*)?] array of aliases, or null if not specified", - }, - _equals: function(node) { - return this.path.equals(node.path) - && prop_equals(this.all, node.all) - && prop_equals(this.default, node.default) - && !this.properties == !node.properties - && (!this.properties || all_equals(this.properties, node.properties)); - }, - walk: function(visitor) { - var node = this; - visitor.visit(node, function() { - if (node.all) node.all.walk(visitor); - if (node.default) node.default.walk(visitor); - if (node.properties) node.properties.forEach(function(prop) { - prop.walk(visitor); - }); - }); - }, - _validate: function() { - if (this.all != null) { - if (!(this.all instanceof AST_SymbolImport)) throw new Error("all must be AST_SymbolImport"); - if (this.properties != null) throw new Error("cannot import both * and {} in the same statement"); - } - if (this.default != null) { - if (!(this.default instanceof AST_SymbolImport)) throw new Error("default must be AST_SymbolImport"); - if (this.default.key.value !== "") throw new Error("invalid default key: " + this.default.key.value); - } - if (!(this.path instanceof AST_String)) throw new Error("path must be AST_String"); - if (this.properties != null) this.properties.forEach(function(node) { - if (!(node instanceof AST_SymbolImport)) throw new Error("properties must contain AST_SymbolImport"); - }); - }, -}, AST_Statement); - -var AST_DefaultValue = DEFNODE("DefaultValue", "name value", { - $documentation: "A default value declaration", - $propdoc: { - name: "[AST_Destructured|AST_SymbolDeclaration] name of the variable", - value: "[AST_Node] value to assign if variable is `undefined`", - }, - _equals: function(node) { - return this.name.equals(node.name) - && this.value.equals(node.value); - }, - walk: function(visitor) { - var node = this; - visitor.visit(node, function() { - node.name.walk(visitor); - node.value.walk(visitor); - }); - }, - _validate: function() { - must_be_expression(this, "value"); - }, -}); - -function must_be_expressions(node, prop, allow_spread, allow_hole) { - node[prop].forEach(function(node) { - validate_expression(node, prop, true, allow_spread, allow_hole); - }); -} - -var AST_Call = DEFNODE("Call", "args expression optional pure terminal", { - $documentation: "A function call expression", - $propdoc: { - args: "[AST_Node*] array of arguments", - expression: "[AST_Node] expression to invoke as function", - optional: "[boolean] whether the expression is optional chaining", - pure: "[boolean/S] marker for side-effect-free call expression", - terminal: "[boolean] whether the chain has ended", - }, - _equals: function(node) { - return !this.optional == !node.optional - && this.expression.equals(node.expression) - && all_equals(this.args, node.args); - }, - walk: function(visitor) { - var node = this; - visitor.visit(node, function() { - node.expression.walk(visitor); - node.args.forEach(function(arg) { - arg.walk(visitor); - }); - }); - }, - _validate: function() { - must_be_expression(this, "expression"); - must_be_expressions(this, "args", true); - }, -}); - -var AST_New = DEFNODE("New", null, { - $documentation: "An object instantiation. Derives from a function call since it has exactly the same properties", - _validate: function() { - if (this.optional) throw new Error("optional must be false"); - if (this.terminal) throw new Error("terminal must be false"); - }, -}, AST_Call); - -var AST_Sequence = DEFNODE("Sequence", "expressions", { - $documentation: "A sequence expression (comma-separated expressions)", - $propdoc: { - expressions: "[AST_Node*] array of expressions (at least two)", - }, - _equals: function(node) { - return all_equals(this.expressions, node.expressions); - }, - walk: function(visitor) { - var node = this; - visitor.visit(node, function() { - node.expressions.forEach(function(expr) { - expr.walk(visitor); - }); - }); - }, - _validate: function() { - if (this.expressions.length < 2) throw new Error("expressions must contain multiple elements"); - must_be_expressions(this, "expressions"); - }, -}); - -function root_expr(prop) { - while (prop instanceof AST_PropAccess) prop = prop.expression; - return prop; -} - -var AST_PropAccess = DEFNODE("PropAccess", "expression optional property terminal", { - $documentation: "Base class for property access expressions, i.e. `a.foo` or `a[\"foo\"]`", - $propdoc: { - expression: "[AST_Node] the “container” expression", - optional: "[boolean] whether the expression is optional chaining", - property: "[AST_Node|string] the property to access. For AST_Dot this is always a plain string, while for AST_Sub it's an arbitrary AST_Node", - terminal: "[boolean] whether the chain has ended", - }, - _equals: function(node) { - return !this.optional == !node.optional - && prop_equals(this.property, node.property) - && this.expression.equals(node.expression); - }, - get_property: function() { - var p = this.property; - if (p instanceof AST_Constant) return p.value; - if (p instanceof AST_UnaryPrefix && p.operator == "void" && p.expression instanceof AST_Constant) return; - return p; - }, - _validate: function() { - if (this.TYPE == "PropAccess") throw new Error("should not instantiate AST_PropAccess"); - must_be_expression(this, "expression"); - }, -}); - -var AST_Dot = DEFNODE("Dot", "quoted", { - $documentation: "A dotted property access expression", - $propdoc: { - quoted: "[boolean] whether property is transformed from a quoted string", - }, - walk: function(visitor) { - var node = this; - visitor.visit(node, function() { - node.expression.walk(visitor); - }); - }, - _validate: function() { - if (typeof this.property != "string") throw new Error("property must be string"); - }, -}, AST_PropAccess); - -var AST_Sub = DEFNODE("Sub", null, { - $documentation: "Index-style property access, i.e. `a[\"foo\"]`", - walk: function(visitor) { - var node = this; - visitor.visit(node, function() { - node.expression.walk(visitor); - node.property.walk(visitor); - }); - }, - _validate: function() { - must_be_expression(this, "property"); - }, -}, AST_PropAccess); - -var AST_Spread = DEFNODE("Spread", "expression", { - $documentation: "Spread expression in array/object literals or function calls", - $propdoc: { - expression: "[AST_Node] expression to be expanded", - }, - _equals: function(node) { - return this.expression.equals(node.expression); - }, - walk: function(visitor) { - var node = this; - visitor.visit(node, function() { - node.expression.walk(visitor); - }); - }, - _validate: function() { - must_be_expression(this, "expression"); - }, -}); - -var AST_Unary = DEFNODE("Unary", "operator expression", { - $documentation: "Base class for unary expressions", - $propdoc: { - operator: "[string] the operator", - expression: "[AST_Node] expression that this unary operator applies to", - }, - _equals: function(node) { - return this.operator == node.operator - && this.expression.equals(node.expression); - }, - walk: function(visitor) { - var node = this; - visitor.visit(node, function() { - node.expression.walk(visitor); - }); - }, - _validate: function() { - if (this.TYPE == "Unary") throw new Error("should not instantiate AST_Unary"); - if (typeof this.operator != "string") throw new Error("operator must be string"); - must_be_expression(this, "expression"); - }, -}); - -var AST_UnaryPrefix = DEFNODE("UnaryPrefix", null, { - $documentation: "Unary prefix expression, i.e. `typeof i` or `++i`" -}, AST_Unary); - -var AST_UnaryPostfix = DEFNODE("UnaryPostfix", null, { - $documentation: "Unary postfix expression, i.e. `i++`" -}, AST_Unary); - -var AST_Binary = DEFNODE("Binary", "operator left right", { - $documentation: "Binary expression, i.e. `a + b`", - $propdoc: { - left: "[AST_Node] left-hand side expression", - operator: "[string] the operator", - right: "[AST_Node] right-hand side expression" - }, - _equals: function(node) { - return this.operator == node.operator - && this.left.equals(node.left) - && this.right.equals(node.right); - }, - walk: function(visitor) { - var node = this; - visitor.visit(node, function() { - node.left.walk(visitor); - node.right.walk(visitor); - }); - }, - _validate: function() { - if (!(this instanceof AST_Assign)) must_be_expression(this, "left"); - if (typeof this.operator != "string") throw new Error("operator must be string"); - must_be_expression(this, "right"); - }, -}); - -var AST_Conditional = DEFNODE("Conditional", "condition consequent alternative", { - $documentation: "Conditional expression using the ternary operator, i.e. `a ? b : c`", - $propdoc: { - condition: "[AST_Node]", - consequent: "[AST_Node]", - alternative: "[AST_Node]" - }, - _equals: function(node) { - return this.condition.equals(node.condition) - && this.consequent.equals(node.consequent) - && this.alternative.equals(node.alternative); - }, - walk: function(visitor) { - var node = this; - visitor.visit(node, function() { - node.condition.walk(visitor); - node.consequent.walk(visitor); - node.alternative.walk(visitor); - }); - }, - _validate: function() { - must_be_expression(this, "condition"); - must_be_expression(this, "consequent"); - must_be_expression(this, "alternative"); - }, -}); - -var AST_Assign = DEFNODE("Assign", null, { - $documentation: "An assignment expression — `a = b + 5`", - _validate: function() { - if (this.operator.indexOf("=") < 0) throw new Error('operator must contain "="'); - if (this.left instanceof AST_Destructured) { - if (this.operator != "=") throw new Error("invalid destructuring operator: " + this.operator); - validate_destructured(this.left, function(node) { - if (!(node instanceof AST_PropAccess || node instanceof AST_SymbolRef)) { - throw new Error("left must be assignable: " + node.TYPE); - } - }); - } else if (!(this.left instanceof AST_Infinity - || this.left instanceof AST_NaN - || this.left instanceof AST_PropAccess && !this.left.optional - || this.left instanceof AST_SymbolRef - || this.left instanceof AST_Undefined)) { - throw new Error("left must be assignable"); - } - }, -}, AST_Binary); - -var AST_Await = DEFNODE("Await", "expression", { - $documentation: "An await expression", - $propdoc: { - expression: "[AST_Node] expression with Promise to resolve on", - }, - _equals: function(node) { - return this.expression.equals(node.expression); - }, - walk: function(visitor) { - var node = this; - visitor.visit(node, function() { - node.expression.walk(visitor); - }); - }, - _validate: function() { - must_be_expression(this, "expression"); - }, -}); - -var AST_Yield = DEFNODE("Yield", "expression nested", { - $documentation: "A yield expression", - $propdoc: { - expression: "[AST_Node?] return value for iterator, or null if undefined", - nested: "[boolean] whether to iterate over expression as generator", - }, - _equals: function(node) { - return !this.nested == !node.nested - && prop_equals(this.expression, node.expression); - }, - walk: function(visitor) { - var node = this; - visitor.visit(node, function() { - if (node.expression) node.expression.walk(visitor); - }); - }, - _validate: function() { - if (this.expression != null) { - must_be_expression(this, "expression"); - } else if (this.nested) { - throw new Error("yield* must contain expression"); - } - }, -}); - -/* -----[ LITERALS ]----- */ - -var AST_Array = DEFNODE("Array", "elements", { - $documentation: "An array literal", - $propdoc: { - elements: "[AST_Node*] array of elements" - }, - _equals: function(node) { - return all_equals(this.elements, node.elements); - }, - walk: function(visitor) { - var node = this; - visitor.visit(node, function() { - node.elements.forEach(function(element) { - element.walk(visitor); - }); - }); - }, - _validate: function() { - must_be_expressions(this, "elements", true, true); - }, -}); - -var AST_Destructured = DEFNODE("Destructured", "rest", { - $documentation: "Base class for destructured literal", - $propdoc: { - rest: "[(AST_Destructured|AST_SymbolDeclaration|AST_SymbolRef)?] rest parameter, or null if absent", - }, - _validate: function() { - if (this.TYPE == "Destructured") throw new Error("should not instantiate AST_Destructured"); - }, -}); - -function validate_destructured(node, check, allow_default) { - if (node instanceof AST_DefaultValue && allow_default) return validate_destructured(node.name, check); - if (node instanceof AST_Destructured) { - if (node.rest != null) validate_destructured(node.rest, check); - if (node instanceof AST_DestructuredArray) return node.elements.forEach(function(node) { - if (!(node instanceof AST_Hole)) validate_destructured(node, check, true); - }); - if (node instanceof AST_DestructuredObject) return node.properties.forEach(function(prop) { - validate_destructured(prop.value, check, true); - }); - } - check(node); -} - -var AST_DestructuredArray = DEFNODE("DestructuredArray", "elements", { - $documentation: "A destructured array literal", - $propdoc: { - elements: "[(AST_DefaultValue|AST_Destructured|AST_SymbolDeclaration|AST_SymbolRef)*] array of elements", - }, - _equals: function(node) { - return prop_equals(this.rest, node.rest) - && all_equals(this.elements, node.elements); - }, - walk: function(visitor) { - var node = this; - visitor.visit(node, function() { - node.elements.forEach(function(element) { - element.walk(visitor); - }); - if (node.rest) node.rest.walk(visitor); - }); - }, -}, AST_Destructured); - -var AST_DestructuredKeyVal = DEFNODE("DestructuredKeyVal", "key value", { - $documentation: "A key: value destructured property", - $propdoc: { - key: "[string|AST_Node] property name. For computed property this is an AST_Node.", - value: "[AST_DefaultValue|AST_Destructured|AST_SymbolDeclaration|AST_SymbolRef] property value", - }, - _equals: function(node) { - return prop_equals(this.key, node.key) - && this.value.equals(node.value); - }, - walk: function(visitor) { - var node = this; - visitor.visit(node, function() { - if (node.key instanceof AST_Node) node.key.walk(visitor); - node.value.walk(visitor); - }); - }, - _validate: function() { - if (typeof this.key != "string") { - if (!(this.key instanceof AST_Node)) throw new Error("key must be string or AST_Node"); - must_be_expression(this, "key"); - } - if (!(this.value instanceof AST_Node)) throw new Error("value must be AST_Node"); - }, -}); - -var AST_DestructuredObject = DEFNODE("DestructuredObject", "properties", { - $documentation: "A destructured object literal", - $propdoc: { - properties: "[AST_DestructuredKeyVal*] array of properties", - }, - _equals: function(node) { - return prop_equals(this.rest, node.rest) - && all_equals(this.properties, node.properties); - }, - walk: function(visitor) { - var node = this; - visitor.visit(node, function() { - node.properties.forEach(function(prop) { - prop.walk(visitor); - }); - if (node.rest) node.rest.walk(visitor); - }); - }, - _validate: function() { - this.properties.forEach(function(node) { - if (!(node instanceof AST_DestructuredKeyVal)) throw new Error("properties must be AST_DestructuredKeyVal[]"); - }); - }, -}, AST_Destructured); - -var AST_Object = DEFNODE("Object", "properties", { - $documentation: "An object literal", - $propdoc: { - properties: "[(AST_ObjectProperty|AST_Spread)*] array of properties" - }, - _equals: function(node) { - return all_equals(this.properties, node.properties); - }, - walk: function(visitor) { - var node = this; - visitor.visit(node, function() { - node.properties.forEach(function(prop) { - prop.walk(visitor); - }); - }); - }, - _validate: function() { - this.properties.forEach(function(node) { - if (!(node instanceof AST_ObjectProperty || node instanceof AST_Spread)) { - throw new Error("properties must contain AST_ObjectProperty and/or AST_Spread only"); - } - }); - }, -}); - -var AST_ObjectProperty = DEFNODE("ObjectProperty", "key value", { - $documentation: "Base class for literal object properties", - $propdoc: { - key: "[string|AST_Node] property name. For computed property this is an AST_Node.", - value: "[AST_Node] property value. For getters and setters this is an AST_Accessor.", - }, - _equals: function(node) { - return prop_equals(this.key, node.key) - && this.value.equals(node.value); - }, - walk: function(visitor) { - var node = this; - visitor.visit(node, function() { - if (node.key instanceof AST_Node) node.key.walk(visitor); - node.value.walk(visitor); - }); - }, - _validate: function() { - if (this.TYPE == "ObjectProperty") throw new Error("should not instantiate AST_ObjectProperty"); - if (typeof this.key != "string") { - if (!(this.key instanceof AST_Node)) throw new Error("key must be string or AST_Node"); - must_be_expression(this, "key"); - } - if (!(this.value instanceof AST_Node)) throw new Error("value must be AST_Node"); - }, -}); - -var AST_ObjectKeyVal = DEFNODE("ObjectKeyVal", null, { - $documentation: "A key: value object property", - _validate: function() { - must_be_expression(this, "value"); - }, -}, AST_ObjectProperty); - -var AST_ObjectMethod = DEFNODE("ObjectMethod", null, { - $documentation: "A key(){} object property", - _validate: function() { - if (!(this.value instanceof AST_LambdaExpression)) throw new Error("value must be AST_LambdaExpression"); - if (is_arrow(this.value)) throw new Error("value cannot be AST_Arrow or AST_AsyncArrow"); - if (this.value.name != null) throw new Error("name of object method's lambda must be null"); - }, -}, AST_ObjectKeyVal); - -var AST_ObjectSetter = DEFNODE("ObjectSetter", null, { - $documentation: "An object setter property", - _validate: function() { - if (!(this.value instanceof AST_Accessor)) throw new Error("value must be AST_Accessor"); - }, -}, AST_ObjectProperty); - -var AST_ObjectGetter = DEFNODE("ObjectGetter", null, { - $documentation: "An object getter property", - _validate: function() { - if (!(this.value instanceof AST_Accessor)) throw new Error("value must be AST_Accessor"); - }, -}, AST_ObjectProperty); - -var AST_Symbol = DEFNODE("Symbol", "scope name thedef", { - $documentation: "Base class for all symbols", - $propdoc: { - name: "[string] name of this symbol", - scope: "[AST_Scope/S] the current scope (not necessarily the definition scope)", - thedef: "[SymbolDef/S] the definition of this symbol" - }, - _equals: function(node) { - return this.thedef ? this.thedef === node.thedef : this.name == node.name; - }, - _validate: function() { - if (this.TYPE == "Symbol") throw new Error("should not instantiate AST_Symbol"); - if (typeof this.name != "string") throw new Error("name must be string"); - }, -}); - -var AST_SymbolDeclaration = DEFNODE("SymbolDeclaration", "init", { - $documentation: "A declaration symbol (symbol in var, function name or argument, symbol in catch)", -}, AST_Symbol); - -var AST_SymbolConst = DEFNODE("SymbolConst", null, { - $documentation: "Symbol defining a constant", -}, AST_SymbolDeclaration); - -var AST_SymbolImport = DEFNODE("SymbolImport", "key", { - $documentation: "Symbol defined by an `import` statement", - $propdoc: { - key: "[AST_String] the original `export` name", - }, - _equals: function(node) { - return this.name == node.name - && this.key.equals(node.key); - }, - _validate: function() { - if (!(this.key instanceof AST_String)) throw new Error("key must be AST_String"); - }, -}, AST_SymbolConst); - -var AST_SymbolLet = DEFNODE("SymbolLet", null, { - $documentation: "Symbol defining a lexical-scoped variable", -}, AST_SymbolDeclaration); - -var AST_SymbolVar = DEFNODE("SymbolVar", null, { - $documentation: "Symbol defining a variable", -}, AST_SymbolDeclaration); - -var AST_SymbolFunarg = DEFNODE("SymbolFunarg", "unused", { - $documentation: "Symbol naming a function argument", -}, AST_SymbolVar); - -var AST_SymbolDefun = DEFNODE("SymbolDefun", null, { - $documentation: "Symbol defining a function", -}, AST_SymbolDeclaration); - -var AST_SymbolLambda = DEFNODE("SymbolLambda", null, { - $documentation: "Symbol naming a function expression", -}, AST_SymbolDeclaration); - -var AST_SymbolDefClass = DEFNODE("SymbolDefClass", null, { - $documentation: "Symbol defining a class", -}, AST_SymbolConst); - -var AST_SymbolClass = DEFNODE("SymbolClass", null, { - $documentation: "Symbol naming a class expression", -}, AST_SymbolConst); - -var AST_SymbolCatch = DEFNODE("SymbolCatch", null, { - $documentation: "Symbol naming the exception in catch", -}, AST_SymbolDeclaration); - -var AST_Label = DEFNODE("Label", "references", { - $documentation: "Symbol naming a label (declaration)", - $propdoc: { - references: "[AST_LoopControl*] a list of nodes referring to this label" - }, - initialize: function() { - this.references = []; - this.thedef = this; - }, -}, AST_Symbol); - -var AST_SymbolRef = DEFNODE("SymbolRef", "fixed in_arg redef", { - $documentation: "Reference to some symbol (not definition/declaration)", -}, AST_Symbol); - -var AST_SymbolExport = DEFNODE("SymbolExport", "alias", { - $documentation: "Reference in an `export` statement", - $propdoc: { - alias: "[AST_String] the `export` alias", - }, - _equals: function(node) { - return this.name == node.name - && this.alias.equals(node.alias); - }, - _validate: function() { - if (!(this.alias instanceof AST_String)) throw new Error("alias must be AST_String"); - }, -}, AST_SymbolRef); - -var AST_LabelRef = DEFNODE("LabelRef", null, { - $documentation: "Reference to a label symbol", -}, AST_Symbol); - -var AST_ObjectIdentity = DEFNODE("ObjectIdentity", null, { - $documentation: "Base class for `super` & `this`", - _equals: return_true, - _validate: function() { - if (this.TYPE == "ObjectIdentity") throw new Error("should not instantiate AST_ObjectIdentity"); - }, -}, AST_Symbol); - -var AST_Super = DEFNODE("Super", null, { - $documentation: "The `super` symbol", - _validate: function() { - if (this.name !== "super") throw new Error('name must be "super"'); - }, -}, AST_ObjectIdentity); - -var AST_This = DEFNODE("This", null, { - $documentation: "The `this` symbol", - _validate: function() { - if (this.TYPE == "This" && this.name !== "this") throw new Error('name must be "this"'); - }, -}, AST_ObjectIdentity); - -var AST_NewTarget = DEFNODE("NewTarget", null, { - $documentation: "The `new.target` symbol", - initialize: function() { - this.name = "new.target"; - }, - _validate: function() { - if (this.name !== "new.target") throw new Error('name must be "new.target": ' + this.name); - }, -}, AST_This); - -var AST_Template = DEFNODE("Template", "expressions strings tag", { - $documentation: "A template literal, i.e. tag`str1${expr1}...strN${exprN}strN+1`", - $propdoc: { - expressions: "[AST_Node*] the placeholder expressions", - strings: "[string*] the raw text segments", - tag: "[AST_Node?] tag function, or null if absent", - }, - _equals: function(node) { - return prop_equals(this.tag, node.tag) - && list_equals(this.strings, node.strings) - && all_equals(this.expressions, node.expressions); - }, - walk: function(visitor) { - var node = this; - visitor.visit(node, function() { - if (node.tag) node.tag.walk(visitor); - node.expressions.forEach(function(expr) { - expr.walk(visitor); - }); - }); - }, - _validate: function() { - if (this.expressions.length + 1 != this.strings.length) { - throw new Error("malformed template with " + this.expressions.length + " placeholder(s) but " + this.strings.length + " text segment(s)"); - } - must_be_expressions(this, "expressions"); - this.strings.forEach(function(string) { - if (typeof string != "string") throw new Error("strings must contain string"); - }); - if (this.tag != null) must_be_expression(this, "tag"); - }, -}); - -var AST_Constant = DEFNODE("Constant", null, { - $documentation: "Base class for all constants", - _equals: function(node) { - return this.value === node.value; - }, - _validate: function() { - if (this.TYPE == "Constant") throw new Error("should not instantiate AST_Constant"); - }, -}); - -var AST_String = DEFNODE("String", "quote value", { - $documentation: "A string literal", - $propdoc: { - quote: "[string?] the original quote character", - value: "[string] the contents of this string", - }, - _validate: function() { - if (this.quote != null) { - if (typeof this.quote != "string") throw new Error("quote must be string"); - if (!/^["']$/.test(this.quote)) throw new Error("invalid quote: " + this.quote); - } - if (typeof this.value != "string") throw new Error("value must be string"); - }, -}, AST_Constant); - -var AST_Number = DEFNODE("Number", "value", { - $documentation: "A number literal", - $propdoc: { - value: "[number] the numeric value", - }, - _validate: function() { - if (typeof this.value != "number") throw new Error("value must be number"); - if (!isFinite(this.value)) throw new Error("value must be finite"); - if (this.value < 0) throw new Error("value cannot be negative"); - }, -}, AST_Constant); - -var AST_BigInt = DEFNODE("BigInt", "value", { - $documentation: "A BigInt literal", - $propdoc: { - value: "[string] the numeric representation", - }, - _validate: function() { - if (typeof this.value != "string") throw new Error("value must be string"); - if (this.value[0] == "-") throw new Error("value cannot be negative"); - }, -}, AST_Constant); - -var AST_RegExp = DEFNODE("RegExp", "value", { - $documentation: "A regexp literal", - $propdoc: { - value: "[RegExp] the actual regexp" - }, - _equals: function(node) { - return "" + this.value == "" + node.value; - }, - _validate: function() { - if (!(this.value instanceof RegExp)) throw new Error("value must be RegExp"); - }, -}, AST_Constant); - -var AST_Atom = DEFNODE("Atom", null, { - $documentation: "Base class for atoms", - _equals: return_true, - _validate: function() { - if (this.TYPE == "Atom") throw new Error("should not instantiate AST_Atom"); - }, -}, AST_Constant); - -var AST_Null = DEFNODE("Null", null, { - $documentation: "The `null` atom", - value: null, -}, AST_Atom); - -var AST_NaN = DEFNODE("NaN", null, { - $documentation: "The impossible value", - value: 0/0, -}, AST_Atom); - -var AST_Undefined = DEFNODE("Undefined", null, { - $documentation: "The `undefined` value", - value: function(){}(), -}, AST_Atom); - -var AST_Hole = DEFNODE("Hole", null, { - $documentation: "A hole in an array", - value: function(){}(), -}, AST_Atom); - -var AST_Infinity = DEFNODE("Infinity", null, { - $documentation: "The `Infinity` value", - value: 1/0, -}, AST_Atom); - -var AST_Boolean = DEFNODE("Boolean", null, { - $documentation: "Base class for booleans", - _validate: function() { - if (this.TYPE == "Boolean") throw new Error("should not instantiate AST_Boolean"); - }, -}, AST_Atom); - -var AST_False = DEFNODE("False", null, { - $documentation: "The `false` atom", - value: false, -}, AST_Boolean); - -var AST_True = DEFNODE("True", null, { - $documentation: "The `true` atom", - value: true, -}, AST_Boolean); - -/* -----[ TreeWalker ]----- */ - -function TreeWalker(callback) { - this.callback = callback; - this.directives = Object.create(null); - this.stack = []; -} -TreeWalker.prototype = { - visit: function(node, descend) { - this.push(node); - var done = this.callback(node, descend || noop); - if (!done && descend) descend(); - this.pop(); - }, - parent: function(n) { - return this.stack[this.stack.length - 2 - (n || 0)]; - }, - push: function(node) { - var value; - if (node instanceof AST_Class) { - this.directives = Object.create(this.directives); - value = "use strict"; - } else if (node instanceof AST_Directive) { - value = node.value; - } else if (node instanceof AST_Lambda) { - this.directives = Object.create(this.directives); - } - if (value && !this.directives[value]) this.directives[value] = node; - this.stack.push(node); - }, - pop: function() { - var node = this.stack.pop(); - if (node instanceof AST_Class || node instanceof AST_Lambda) { - this.directives = Object.getPrototypeOf(this.directives); - } - }, - self: function() { - return this.stack[this.stack.length - 1]; - }, - find_parent: function(type) { - var stack = this.stack; - for (var i = stack.length - 1; --i >= 0;) { - var x = stack[i]; - if (x instanceof type) return x; - } - }, - has_directive: function(type) { - var dir = this.directives[type]; - if (dir) return dir; - var node = this.stack[this.stack.length - 1]; - if (node instanceof AST_Scope) { - for (var i = 0; i < node.body.length; ++i) { - var st = node.body[i]; - if (!(st instanceof AST_Directive)) break; - if (st.value == type) return st; - } - } - }, - loopcontrol_target: function(node) { - var stack = this.stack; - if (node.label) for (var i = stack.length; --i >= 0;) { - var x = stack[i]; - if (x instanceof AST_LabeledStatement && x.label.name == node.label.name) - return x.body; - } else for (var i = stack.length; --i >= 0;) { - var x = stack[i]; - if (x instanceof AST_IterationStatement - || node instanceof AST_Break && x instanceof AST_Switch) - return x; - } - }, - in_boolean_context: function() { - for (var drop = true, level = 0, parent, self = this.self(); parent = this.parent(level++); self = parent) { - if (parent instanceof AST_Binary) switch (parent.operator) { - case "&&": - case "||": - if (parent.left === self) drop = false; - continue; - default: - return false; - } - if (parent instanceof AST_Conditional) { - if (parent.condition === self) return true; - continue; - } - if (parent instanceof AST_DWLoop) return parent.condition === self; - if (parent instanceof AST_For) return parent.condition === self; - if (parent instanceof AST_If) return parent.condition === self; - if (parent instanceof AST_Return) { - if (parent.in_bool) return true; - while (parent = this.parent(level++)) { - if (parent instanceof AST_Lambda) { - if (parent.name) return false; - parent = this.parent(level++); - if (parent.TYPE != "Call") return false; - break; - } - } - } - if (parent instanceof AST_Sequence) { - if (parent.tail_node() === self) continue; - return drop ? "d" : true; - } - if (parent instanceof AST_SimpleStatement) return drop ? "d" : true; - if (parent instanceof AST_UnaryPrefix) return parent.operator == "!"; - return false; - } - } -}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/uglify-js/lib/compress.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/uglify-js/lib/compress.js deleted file mode 100644 index cde397cf..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/uglify-js/lib/compress.js +++ /dev/null @@ -1,14241 +0,0 @@ -/*********************************************************************** - - A JavaScript tokenizer / parser / beautifier / compressor. - https://github.com/mishoo/UglifyJS - - -------------------------------- (C) --------------------------------- - - Author: Mihai Bazon - - http://mihai.bazon.net/blog - - Distributed under the BSD license: - - Copyright 2012 (c) Mihai Bazon - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - * Redistributions of source code must retain the above - copyright notice, this list of conditions and the following - disclaimer. - - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials - provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY - EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR - TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF - THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - SUCH DAMAGE. - - ***********************************************************************/ - -"use strict"; - -function Compressor(options, false_by_default) { - if (!(this instanceof Compressor)) - return new Compressor(options, false_by_default); - TreeTransformer.call(this, this.before, this.after); - this.options = defaults(options, { - annotations : !false_by_default, - arguments : !false_by_default, - arrows : !false_by_default, - assignments : !false_by_default, - awaits : !false_by_default, - booleans : !false_by_default, - collapse_vars : !false_by_default, - comparisons : !false_by_default, - conditionals : !false_by_default, - dead_code : !false_by_default, - default_values : !false_by_default, - directives : !false_by_default, - drop_console : false, - drop_debugger : !false_by_default, - evaluate : !false_by_default, - expression : false, - functions : !false_by_default, - global_defs : false, - hoist_exports : !false_by_default, - hoist_funs : false, - hoist_props : !false_by_default, - hoist_vars : false, - ie : false, - if_return : !false_by_default, - imports : !false_by_default, - inline : !false_by_default, - join_vars : !false_by_default, - keep_fargs : false_by_default, - keep_fnames : false, - keep_infinity : false, - loops : !false_by_default, - merge_vars : !false_by_default, - module : false, - negate_iife : !false_by_default, - objects : !false_by_default, - optional_chains : !false_by_default, - passes : 1, - properties : !false_by_default, - pure_funcs : null, - pure_getters : !false_by_default && "strict", - reduce_funcs : !false_by_default, - reduce_vars : !false_by_default, - rests : !false_by_default, - sequences : !false_by_default, - side_effects : !false_by_default, - spreads : !false_by_default, - strings : !false_by_default, - switches : !false_by_default, - templates : !false_by_default, - top_retain : null, - toplevel : !!(options && (options["module"] || options["top_retain"])), - typeofs : !false_by_default, - unsafe : false, - unsafe_comps : false, - unsafe_Function : false, - unsafe_math : false, - unsafe_proto : false, - unsafe_regexp : false, - unsafe_undefined: false, - unused : !false_by_default, - varify : !false_by_default, - webkit : false, - yields : !false_by_default, - }, true); - var evaluate = this.options["evaluate"]; - this.eval_threshold = /eager/.test(evaluate) ? 1 / 0 : +evaluate; - var global_defs = this.options["global_defs"]; - if (typeof global_defs == "object") for (var key in global_defs) { - if (/^@/.test(key) && HOP(global_defs, key)) { - global_defs[key.slice(1)] = parse(global_defs[key], { expression: true }); - } - } - if (this.options["inline"] === true) this.options["inline"] = 4; - this.drop_fargs = this.options["keep_fargs"] ? return_false : function(lambda, parent) { - if (lambda.length_read) return false; - var name = lambda.name; - if (!name) return parent && parent.TYPE == "Call" && parent.expression === lambda; - if (name.fixed_value() !== lambda) return false; - var def = name.definition(); - if (def.direct_access) return false; - var escaped = def.escaped; - return escaped && escaped.depth != 1; - }; - if (this.options["module"]) this.directives["use strict"] = true; - var pure_funcs = this.options["pure_funcs"]; - if (typeof pure_funcs == "function") { - this.pure_funcs = pure_funcs; - } else if (typeof pure_funcs == "string") { - this.pure_funcs = function(node) { - var expr; - if (node instanceof AST_Call) { - expr = node.expression; - } else if (node instanceof AST_Template) { - expr = node.tag; - } - return !(expr && pure_funcs === expr.print_to_string()); - }; - } else if (Array.isArray(pure_funcs)) { - this.pure_funcs = function(node) { - var expr; - if (node instanceof AST_Call) { - expr = node.expression; - } else if (node instanceof AST_Template) { - expr = node.tag; - } - return !(expr && member(expr.print_to_string(), pure_funcs)); - }; - } else { - this.pure_funcs = return_true; - } - var sequences = this.options["sequences"]; - this.sequences_limit = sequences == 1 ? 800 : sequences | 0; - var top_retain = this.options["top_retain"]; - if (top_retain instanceof RegExp) { - this.top_retain = function(def) { - return top_retain.test(def.name); - }; - } else if (typeof top_retain == "function") { - this.top_retain = top_retain; - } else if (top_retain) { - if (typeof top_retain == "string") { - top_retain = top_retain.split(/,/); - } - this.top_retain = function(def) { - return member(def.name, top_retain); - }; - } - var toplevel = this.options["toplevel"]; - this.toplevel = typeof toplevel == "string" ? { - funcs: /funcs/.test(toplevel), - vars: /vars/.test(toplevel) - } : { - funcs: toplevel, - vars: toplevel - }; -} - -Compressor.prototype = new TreeTransformer(function(node, descend, in_list) { - if (node._squeezed) return node; - var is_scope = node instanceof AST_Scope; - if (is_scope) { - if (this.option("arrows") && is_arrow(node) && node.value) { - node.body = [ node.first_statement() ]; - node.value = null; - } - node.hoist_properties(this); - node.hoist_declarations(this); - node.process_returns(this); - } - // Before https://github.com/mishoo/UglifyJS/pull/1602 AST_Node.optimize() - // would call AST_Node.transform() if a different instance of AST_Node is - // produced after OPT(). - // This corrupts TreeWalker.stack, which cause AST look-ups to malfunction. - // Migrate and defer all children's AST_Node.transform() to below, which - // will now happen after this parent AST_Node has been properly substituted - // thus gives a consistent AST snapshot. - descend(node, this); - // Existing code relies on how AST_Node.optimize() worked, and omitting the - // following replacement call would result in degraded efficiency of both - // output and performance. - descend(node, this); - var opt = node.optimize(this); - if (is_scope && opt === node && !this.has_directive("use asm") && !opt.pinned()) { - opt.drop_unused(this); - if (opt.merge_variables(this)) opt.drop_unused(this); - descend(opt, this); - } - if (opt === node) opt._squeezed = true; - return opt; -}); -Compressor.prototype.option = function(key) { - return this.options[key]; -}; -Compressor.prototype.exposed = function(def) { - if (def.exported) return true; - if (def.undeclared) return true; - if (!(def.global || def.scope.resolve() instanceof AST_Toplevel)) return false; - var toplevel = this.toplevel; - return !all(def.orig, function(sym) { - return toplevel[sym instanceof AST_SymbolDefun ? "funcs" : "vars"]; - }); -}; -Compressor.prototype.compress = function(node) { - node = node.resolve_defines(this); - node.hoist_exports(this); - if (this.option("expression")) node.process_expression(true); - var merge_vars = this.options.merge_vars; - var passes = +this.options.passes || 1; - var min_count = 1 / 0; - var stopping = false; - var mangle = { ie: this.option("ie") }; - for (var pass = 0; pass < passes; pass++) { - node.figure_out_scope(mangle); - if (pass > 0 || this.option("reduce_vars")) - node.reset_opt_flags(this); - this.options.merge_vars = merge_vars && (stopping || pass == passes - 1); - node = node.transform(this); - if (passes > 1) { - var count = 0; - node.walk(new TreeWalker(function() { - count++; - })); - AST_Node.info("pass {pass}: last_count: {min_count}, count: {count}", { - pass: pass, - min_count: min_count, - count: count, - }); - if (count < min_count) { - min_count = count; - stopping = false; - } else if (stopping) { - break; - } else { - stopping = true; - } - } - } - if (this.option("expression")) node.process_expression(false); - return node; -}; - -(function(OPT) { - OPT(AST_Node, function(self, compressor) { - return self; - }); - - AST_Toplevel.DEFMETHOD("hoist_exports", function(compressor) { - if (!compressor.option("hoist_exports")) return; - var body = this.body, props = []; - for (var i = 0; i < body.length; i++) { - var stat = body[i]; - if (stat instanceof AST_ExportDeclaration) { - body[i] = stat = stat.body; - if (stat instanceof AST_Definitions) { - stat.definitions.forEach(function(defn) { - defn.name.match_symbol(export_symbol, true); - }); - } else { - export_symbol(stat.name); - } - } else if (stat instanceof AST_ExportReferences) { - body.splice(i--, 1); - [].push.apply(props, stat.properties); - } - } - if (props.length) body.push(make_node(AST_ExportReferences, this, { properties: props })); - - function export_symbol(sym) { - if (!(sym instanceof AST_SymbolDeclaration)) return; - var node = make_node(AST_SymbolExport, sym); - node.alias = make_node(AST_String, node, { value: node.name }); - props.push(node); - } - }); - - AST_Scope.DEFMETHOD("process_expression", function(insert, transform) { - var self = this; - var tt = new TreeTransformer(function(node) { - if (insert) { - if (node instanceof AST_Directive) node = make_node(AST_SimpleStatement, node, { - body: make_node(AST_String, node), - }); - if (node instanceof AST_SimpleStatement) { - return transform ? transform(node) : make_node(AST_Return, node, { value: node.body }); - } - } else if (node instanceof AST_Return) { - if (transform) return transform(node); - var value = node.value; - if (value instanceof AST_String) return make_node(AST_Directive, value); - return make_node(AST_SimpleStatement, node, { - body: value || make_node(AST_UnaryPrefix, node, { - operator: "void", - expression: make_node(AST_Number, node, { value: 0 }), - }), - }); - } - if (node instanceof AST_Block) { - if (node instanceof AST_Lambda) { - if (node !== self) return node; - } else if (insert === "awaits" && node instanceof AST_Try) { - if (node.bfinally) return node; - } - for (var index = node.body.length; --index >= 0;) { - var stat = node.body[index]; - if (!is_declaration(stat, true)) { - node.body[index] = stat.transform(tt); - break; - } - } - } else if (node instanceof AST_If) { - node.body = node.body.transform(tt); - if (node.alternative) node.alternative = node.alternative.transform(tt); - } else if (node instanceof AST_With) { - node.body = node.body.transform(tt); - } - return node; - }); - self.transform(tt); - }); - AST_Toplevel.DEFMETHOD("unwrap_expression", function() { - var self = this; - switch (self.body.length) { - case 0: - return make_node(AST_UnaryPrefix, self, { - operator: "void", - expression: make_node(AST_Number, self, { value: 0 }), - }); - case 1: - var stat = self.body[0]; - if (stat instanceof AST_Directive) return make_node(AST_String, stat); - if (stat instanceof AST_SimpleStatement) return stat.body; - default: - return make_node(AST_Call, self, { - expression: make_node(AST_Function, self, { - argnames: [], - body: self.body, - }).init_vars(self), - args: [], - }); - } - }); - AST_Node.DEFMETHOD("wrap_expression", function() { - var self = this; - if (!is_statement(self)) self = make_node(AST_SimpleStatement, self, { body: self }); - if (!(self instanceof AST_Toplevel)) self = make_node(AST_Toplevel, self, { body: [ self ] }); - return self; - }); - - function read_property(obj, node) { - var key = node.get_property(); - if (key instanceof AST_Node) return; - var value; - if (obj instanceof AST_Array) { - var elements = obj.elements; - if (key == "length") return make_node_from_constant(elements.length, obj); - if (typeof key == "number" && key in elements) value = elements[key]; - } else if (obj instanceof AST_Lambda) { - if (key == "length") { - obj.length_read = true; - return make_node_from_constant(obj.argnames.length, obj); - } - } else if (obj instanceof AST_Object) { - key = "" + key; - var props = obj.properties; - for (var i = props.length; --i >= 0;) { - var prop = props[i]; - if (!can_hoist_property(prop)) return; - if (!value && props[i].key === key) value = props[i].value; - } - } - return value instanceof AST_SymbolRef && value.fixed_value() || value; - } - - function is_read_only_fn(value, name) { - if (value instanceof AST_Boolean) return native_fns.Boolean[name]; - if (value instanceof AST_Number) return native_fns.Number[name]; - if (value instanceof AST_String) return native_fns.String[name]; - if (name == "valueOf") return false; - if (value instanceof AST_Array) return native_fns.Array[name]; - if (value instanceof AST_Lambda) return native_fns.Function[name]; - if (value instanceof AST_Object) return native_fns.Object[name]; - if (value instanceof AST_RegExp) return native_fns.RegExp[name] && !value.value.global; - } - - function is_modified(compressor, tw, node, value, level, immutable, recursive) { - var parent = tw.parent(level); - if (compressor.option("unsafe") && parent instanceof AST_Dot && is_read_only_fn(value, parent.property)) { - return; - } - var lhs = is_lhs(node, parent); - if (lhs) return lhs; - if (level == 0 && value && value.is_constant()) return; - if (parent instanceof AST_Array) return is_modified(compressor, tw, parent, parent, level + 1); - if (parent instanceof AST_Assign) switch (parent.operator) { - case "=": - return is_modified(compressor, tw, parent, value, level + 1, immutable, recursive); - case "&&=": - case "||=": - case "??=": - return is_modified(compressor, tw, parent, parent, level + 1); - default: - return; - } - if (parent instanceof AST_Binary) { - if (!lazy_op[parent.operator]) return; - return is_modified(compressor, tw, parent, parent, level + 1); - } - if (parent instanceof AST_Call) { - return !immutable - && parent.expression === node - && !parent.is_expr_pure(compressor) - && (!(value instanceof AST_LambdaExpression) || !(parent instanceof AST_New) && value.contains_this()); - } - if (parent instanceof AST_Conditional) { - if (parent.condition === node) return; - return is_modified(compressor, tw, parent, parent, level + 1); - } - if (parent instanceof AST_ForEnumeration) return parent.init === node; - if (parent instanceof AST_ObjectKeyVal) { - if (parent.value !== node) return; - var obj = tw.parent(level + 1); - return is_modified(compressor, tw, obj, obj, level + 2); - } - if (parent instanceof AST_PropAccess) { - if (parent.expression !== node) return; - var prop = read_property(value, parent); - return (!immutable || recursive) && is_modified(compressor, tw, parent, prop, level + 1); - } - if (parent instanceof AST_Sequence) { - if (parent.tail_node() !== node) return; - return is_modified(compressor, tw, parent, value, level + 1, immutable, recursive); - } - } - - function is_lambda(node) { - return node instanceof AST_Class || node instanceof AST_Lambda; - } - - function safe_for_extends(node) { - return node instanceof AST_Class || node instanceof AST_Defun || node instanceof AST_Function; - } - - function is_arguments(def) { - return def.name == "arguments" && def.scope.uses_arguments; - } - - function cross_scope(def, sym) { - do { - if (def === sym) return false; - if (sym instanceof AST_Scope) return true; - } while (sym = sym.parent_scope); - } - - function can_drop_symbol(ref, compressor, keep_lambda) { - var def = ref.redef || ref.definition(); - if (ref.in_arg && is_funarg(def)) return false; - return all(def.orig, function(sym) { - if (sym instanceof AST_SymbolConst || sym instanceof AST_SymbolLet) { - if (sym instanceof AST_SymbolImport) return true; - return compressor && can_varify(compressor, sym); - } - return !(keep_lambda && sym instanceof AST_SymbolLambda); - }); - } - - function has_escaped(d, scope, node, parent) { - if (parent instanceof AST_Assign) return parent.operator == "=" && parent.right === node; - if (parent instanceof AST_Call) return parent.expression !== node || parent instanceof AST_New; - if (parent instanceof AST_ClassField) return parent.value === node && !parent.static; - if (parent instanceof AST_Exit) return parent.value === node && scope.resolve() !== d.scope.resolve(); - if (parent instanceof AST_VarDef) return parent.value === node; - } - - function make_ref(ref, fixed) { - var node = make_node(AST_SymbolRef, ref); - node.fixed = fixed || make_node(AST_Undefined, ref); - return node; - } - - function replace_ref(resolve, fixed) { - return function(node) { - var ref = resolve(node); - var node = make_ref(ref, fixed); - var def = ref.definition(); - def.references.push(node); - def.replaced++; - return node; - }; - } - - var RE_POSITIVE_INTEGER = /^(0|[1-9][0-9]*)$/; - (function(def) { - def(AST_Node, noop); - - function reset_def(tw, compressor, def) { - def.assignments = 0; - def.bool_return = 0; - def.drop_return = 0; - def.cross_loop = false; - def.direct_access = false; - def.escaped = []; - def.fixed = !def.const_redefs - && !def.scope.pinned() - && !compressor.exposed(def) - && !(def.init instanceof AST_LambdaExpression && def.init !== def.scope) - && def.init; - def.reassigned = 0; - def.recursive_refs = 0; - def.references = []; - def.single_use = undefined; - } - - function reset_block_variables(tw, compressor, scope) { - scope.variables.each(function(def) { - reset_def(tw, compressor, def); - }); - } - - function reset_variables(tw, compressor, scope) { - scope.fn_defs = []; - scope.variables.each(function(def) { - reset_def(tw, compressor, def); - var init = def.init; - if (init instanceof AST_LambdaDefinition) { - scope.fn_defs.push(init); - init.safe_ids = null; - } - if (def.fixed === null) { - def.safe_ids = tw.safe_ids; - mark(tw, def); - } else if (def.fixed) { - tw.loop_ids[def.id] = tw.in_loop; - mark(tw, def); - } - }); - scope.may_call_this = function() { - scope.may_call_this = scope.contains_this() ? return_true : return_false; - }; - if (scope.uses_arguments) scope.each_argname(function(node) { - node.definition().last_ref = false; - }); - if (compressor.option("ie")) scope.variables.each(function(def) { - var d = def.orig[0].definition(); - if (d !== def) d.fixed = false; - }); - } - - function safe_to_visit(tw, fn) { - var marker = fn.safe_ids; - return marker === undefined || marker === tw.safe_ids; - } - - function walk_fn_def(tw, fn) { - var was_scanning = tw.fn_scanning; - tw.fn_scanning = fn; - fn.walk(tw); - tw.fn_scanning = was_scanning; - } - - function revisit_fn_def(tw, fn) { - fn.enclosed.forEach(function(d) { - if (fn.variables.get(d.name) === d) return; - if (safe_to_read(tw, d)) return; - d.single_use = false; - var fixed = d.fixed; - if (typeof fixed == "function") fixed = fixed(); - if (fixed instanceof AST_Lambda && fixed.safe_ids !== undefined) return; - d.fixed = false; - }); - } - - function mark_fn_def(tw, def, fn) { - var marker = fn.safe_ids; - if (marker === undefined) return; - if (marker === false) return; - if (fn.parent_scope.resolve().may_call_this === return_true) { - if (member(fn, tw.fn_visited)) revisit_fn_def(tw, fn); - } else if (marker) { - var visited = member(fn, tw.fn_visited); - if (marker === tw.safe_ids) { - if (!visited) walk_fn_def(tw, fn); - } else if (visited) { - revisit_fn_def(tw, fn); - } else { - fn.safe_ids = false; - } - } else if (tw.fn_scanning && tw.fn_scanning !== def.scope.resolve()) { - fn.safe_ids = false; - } else { - fn.safe_ids = tw.safe_ids; - walk_fn_def(tw, fn); - } - } - - function pop_scope(tw, scope) { - var fn_defs = scope.fn_defs; - var tangled = scope.may_call_this === return_true ? fn_defs : fn_defs.filter(function(fn) { - if (fn.safe_ids === false) return true; - fn.safe_ids = tw.safe_ids; - walk_fn_def(tw, fn); - return false; - }); - pop(tw); - tangled.forEach(function(fn) { - fn.safe_ids = tw.safe_ids; - walk_fn_def(tw, fn); - }); - fn_defs.forEach(function(fn) { - fn.safe_ids = undefined; - }); - scope.fn_defs = undefined; - scope.may_call_this = undefined; - } - - function push(tw, sequential) { - var safe_ids = Object.create(tw.safe_ids); - if (!sequential) safe_ids.seq = {}; - tw.safe_ids = safe_ids; - } - - function pop(tw) { - tw.safe_ids = Object.getPrototypeOf(tw.safe_ids); - } - - function mark(tw, def) { - tw.safe_ids[def.id] = {}; - } - - function push_ref(def, ref) { - def.references.push(ref); - if (def.last_ref !== false) def.last_ref = ref; - } - - function safe_to_read(tw, def) { - if (def.single_use == "m") return false; - var safe = tw.safe_ids[def.id]; - if (safe) { - var in_order = HOP(tw.safe_ids, def.id); - if (!in_order) { - var seq = tw.safe_ids.seq; - if (!safe.read) { - safe.read = seq; - } else if (safe.read !== seq) { - safe.read = true; - } - } - if (def.fixed == null) { - if (is_arguments(def)) return false; - if (def.global && def.name == "arguments") return false; - tw.loop_ids[def.id] = null; - def.fixed = make_node(AST_Undefined, def.orig[0]); - if (in_order) def.safe_ids = undefined; - return true; - } - return !safe.assign || safe.assign === tw.safe_ids; - } - return def.fixed instanceof AST_LambdaDefinition; - } - - function safe_to_assign(tw, def, declare) { - if (!declare) { - if (is_funarg(def) && def.scope.uses_arguments && !tw.has_directive("use strict")) return false; - if (!all(def.orig, function(sym) { - return !(sym instanceof AST_SymbolConst); - })) return false; - } - if (def.fixed === undefined) return declare || all(def.orig, function(sym) { - return !(sym instanceof AST_SymbolLet); - }); - if (def.fixed === false || def.fixed === 0) return false; - var safe = tw.safe_ids[def.id]; - if (def.safe_ids) { - def.safe_ids[def.id] = false; - def.safe_ids = undefined; - return def.fixed === null || HOP(tw.safe_ids, def.id) && !safe.read; - } - if (!HOP(tw.safe_ids, def.id)) { - if (!safe) return false; - if (safe.read || tw.in_loop) { - var scope = tw.find_parent(AST_BlockScope); - if (scope instanceof AST_Class) return false; - if (def.scope.resolve() !== scope.resolve()) return false; - } - safe.assign = safe.assign && safe.assign !== tw.safe_ids ? true : tw.safe_ids; - } - if (def.fixed != null && safe.read) { - if (safe.read !== tw.safe_ids.seq) return false; - if (tw.loop_ids[def.id] !== tw.in_loop) return false; - } - return safe_to_read(tw, def) && all(def.orig, function(sym) { - return !(sym instanceof AST_SymbolLambda); - }); - } - - function ref_once(compressor, def) { - return compressor.option("unused") - && !def.scope.pinned() - && def.single_use !== false - && def.references.length - def.recursive_refs == 1 - && !(is_funarg(def) && def.scope.uses_arguments); - } - - function is_immutable(value) { - if (!value) return false; - if (value instanceof AST_Assign) { - var op = value.operator; - return op == "=" ? is_immutable(value.right) : !lazy_op[op.slice(0, -1)]; - } - if (value instanceof AST_Sequence) return is_immutable(value.tail_node()); - return value.is_constant() || is_lambda(value) || value instanceof AST_ObjectIdentity; - } - - function value_in_use(node, parent) { - if (parent instanceof AST_Array) return true; - if (parent instanceof AST_Binary) return lazy_op[parent.operator]; - if (parent instanceof AST_Conditional) return parent.condition !== node; - if (parent instanceof AST_Sequence) return parent.tail_node() === node; - if (parent instanceof AST_Spread) return true; - } - - function mark_escaped(tw, d, scope, node, value, level, depth) { - var parent = tw.parent(level); - if (value && value.is_constant()) return; - if (has_escaped(d, scope, node, parent)) { - d.escaped.push(parent); - if (depth > 1 && !(value && value.is_constant_expression(scope))) depth = 1; - if (!d.escaped.depth || d.escaped.depth > depth) d.escaped.depth = depth; - if (d.scope.resolve() !== scope.resolve()) d.escaped.cross_scope = true; - if (d.fixed) d.fixed.escaped = d.escaped; - return; - } else if (value_in_use(node, parent)) { - mark_escaped(tw, d, scope, parent, parent, level + 1, depth); - } else if (parent instanceof AST_ObjectKeyVal && parent.value === node) { - var obj = tw.parent(level + 1); - mark_escaped(tw, d, scope, obj, obj, level + 2, depth); - } else if (parent instanceof AST_PropAccess && parent.expression === node) { - value = read_property(value, parent); - mark_escaped(tw, d, scope, parent, value, level + 1, depth + 1); - if (value) return; - } - if (level > 0) return; - if (parent instanceof AST_Call && parent.expression === node) return; - if (parent instanceof AST_Sequence && parent.tail_node() !== node) return; - if (parent instanceof AST_SimpleStatement) return; - if (parent instanceof AST_Unary && !unary_side_effects[parent.operator]) return; - d.direct_access = true; - if (d.fixed) d.fixed.direct_access = true; - } - - function mark_assignment_to_arguments(node) { - if (!(node instanceof AST_Sub)) return; - var expr = node.expression; - if (!(expr instanceof AST_SymbolRef)) return; - var def = expr.definition(); - if (!is_arguments(def)) return; - var key = node.property; - if (key.is_constant()) key = key.value; - if (!(key instanceof AST_Node) && !RE_POSITIVE_INTEGER.test(key)) return; - def.reassigned++; - (key instanceof AST_Node ? def.scope.argnames : [ def.scope.argnames[key] ]).forEach(function(argname) { - if (argname instanceof AST_SymbolFunarg) argname.definition().fixed = false; - }); - } - - function make_fixed(save, fn) { - var prev_save, prev_value; - return function() { - var current = save(); - if (prev_save !== current) { - prev_save = current; - prev_value = fn(current); - } - return prev_value; - }; - } - - function make_fixed_default(compressor, node, save) { - var prev_save, prev_seq; - return function() { - if (prev_seq === node) return node; - var current = save(); - var ev = fuzzy_eval(compressor, current, true); - if (ev instanceof AST_Node) { - prev_seq = node; - } else if (prev_save !== current) { - prev_save = current; - prev_seq = ev === undefined ? make_sequence(node, [ current, node.value ]) : current; - } - return prev_seq; - }; - } - - function scan_declaration(tw, compressor, lhs, fixed, visit) { - var scanner = new TreeWalker(function(node) { - if (node instanceof AST_DefaultValue) { - reset_flags(node); - push(tw, true); - node.value.walk(tw); - pop(tw); - var save = fixed; - if (save) fixed = make_fixed_default(compressor, node, save); - node.name.walk(scanner); - fixed = save; - return true; - } - if (node instanceof AST_DestructuredArray) { - reset_flags(node); - var save = fixed; - node.elements.forEach(function(node, index) { - if (node instanceof AST_Hole) return reset_flags(node); - if (save) fixed = make_fixed(save, function(value) { - return make_node(AST_Sub, node, { - expression: value, - property: make_node(AST_Number, node, { value: index }), - }); - }); - node.walk(scanner); - }); - if (node.rest) { - var fixed_node; - if (save) fixed = compressor.option("rests") && make_fixed(save, function(value) { - if (!(value instanceof AST_Array)) return node; - for (var i = 0, len = node.elements.length; i < len; i++) { - if (value.elements[i] instanceof AST_Spread) return node; - } - if (!fixed_node) fixed_node = make_node(AST_Array, node, {}); - fixed_node.elements = value.elements.slice(len); - return fixed_node; - }); - node.rest.walk(scanner); - } - fixed = save; - return true; - } - if (node instanceof AST_DestructuredObject) { - reset_flags(node); - var save = fixed; - node.properties.forEach(function(node) { - reset_flags(node); - if (node.key instanceof AST_Node) { - push(tw); - node.key.walk(tw); - pop(tw); - } - if (save) fixed = make_fixed(save, function(value) { - var key = node.key; - var type = AST_Sub; - if (typeof key == "string") { - if (is_identifier_string(key)) { - type = AST_Dot; - } else { - key = make_node_from_constant(key, node); - } - } - return make_node(type, node, { - expression: value, - property: key, - }); - }); - node.value.walk(scanner); - }); - if (node.rest) { - fixed = false; - node.rest.walk(scanner); - } - fixed = save; - return true; - } - visit(node, fixed, function() { - var save_len = tw.stack.length; - for (var i = 0, len = scanner.stack.length - 1; i < len; i++) { - tw.stack.push(scanner.stack[i]); - } - node.walk(tw); - tw.stack.length = save_len; - }); - return true; - }); - lhs.walk(scanner); - } - - function reduce_iife(tw, descend, compressor) { - var fn = this; - fn.inlined = false; - var iife = tw.parent(); - var sequential = !is_async(fn) && !is_generator(fn); - var hit = !sequential; - var aborts = false; - fn.walk(new TreeWalker(function(node) { - if (hit) return aborts = true; - if (node instanceof AST_Return) return hit = true; - if (node instanceof AST_Scope && node !== fn) return true; - })); - if (aborts) push(tw, sequential); - reset_variables(tw, compressor, fn); - // Virtually turn IIFE parameters into variable definitions: - // (function(a,b) {...})(c,d) ---> (function() {var a=c,b=d; ...})() - // So existing transformation rules can work on them. - var safe = !fn.uses_arguments || tw.has_directive("use strict"); - fn.argnames.forEach(function(argname, i) { - var value = iife.args[i]; - scan_declaration(tw, compressor, argname, function() { - var j = fn.argnames.indexOf(argname); - var arg = j < 0 ? value : iife.args[j]; - if (arg instanceof AST_Sequence && arg.expressions.length < 2) arg = arg.expressions[0]; - return arg || make_node(AST_Undefined, iife); - }, visit); - }); - var rest = fn.rest, fixed_node; - if (rest) scan_declaration(tw, compressor, rest, compressor.option("rests") && function() { - if (fn.rest !== rest) return rest; - if (!fixed_node) fixed_node = make_node(AST_Array, fn, {}); - fixed_node.elements = iife.args.slice(fn.argnames.length); - return fixed_node; - }, visit); - walk_lambda(fn, tw); - var safe_ids = tw.safe_ids; - pop_scope(tw, fn); - if (!aborts) tw.safe_ids = safe_ids; - return true; - - function visit(node, fixed) { - var d = node.definition(); - if (fixed && safe && d.fixed === undefined) { - mark(tw, d); - tw.loop_ids[d.id] = tw.in_loop; - d.fixed = fixed; - d.fixed.assigns = [ node ]; - } else { - d.fixed = false; - } - } - } - - def(AST_Assign, function(tw, descend, compressor) { - var node = this; - var left = node.left; - var right = node.right; - var ld = left instanceof AST_SymbolRef && left.definition(); - var scan = ld || left instanceof AST_Destructured; - switch (node.operator) { - case "=": - if (left.equals(right) && !left.has_side_effects(compressor)) { - right.walk(tw); - walk_prop(left); - node.redundant = true; - return true; - } - if (ld && right instanceof AST_LambdaExpression) { - walk_assign(); - right.parent_scope.resolve().fn_defs.push(right); - right.safe_ids = null; - if (!ld.fixed || !node.write_only) mark_fn_def(tw, ld, right); - return true; - } - if (scan) { - right.walk(tw); - walk_assign(); - return true; - } - mark_assignment_to_arguments(left); - return; - case "&&=": - case "||=": - case "??=": - var lazy = true; - default: - if (!scan) { - mark_assignment_to_arguments(left); - return walk_lazy(); - } - ld.assignments++; - var fixed = ld.fixed; - if (is_modified(compressor, tw, node, node, 0)) { - ld.fixed = false; - return walk_lazy(); - } - var safe = safe_to_read(tw, ld); - if (lazy) push(tw, true); - right.walk(tw); - if (lazy) pop(tw); - if (safe && !left.in_arg && safe_to_assign(tw, ld)) { - push_ref(ld, left); - mark(tw, ld); - if (ld.single_use) ld.single_use = false; - left.fixed = ld.fixed = function() { - return make_node(AST_Binary, node, { - operator: node.operator.slice(0, -1), - left: make_ref(left, fixed), - right: node.right, - }); - }; - left.fixed.assigns = !fixed || !fixed.assigns ? [ ld.orig[0] ] : fixed.assigns.slice(); - left.fixed.assigns.push(node); - left.fixed.to_binary = replace_ref(function(node) { - return node.left; - }, fixed); - } else { - left.walk(tw); - ld.fixed = false; - } - return true; - } - - function walk_prop(lhs) { - reset_flags(lhs); - if (lhs instanceof AST_Dot) { - walk_prop(lhs.expression); - } else if (lhs instanceof AST_Sub) { - walk_prop(lhs.expression); - lhs.property.walk(tw); - } else if (lhs instanceof AST_SymbolRef) { - var d = lhs.definition(); - push_ref(d, lhs); - if (d.fixed) { - lhs.fixed = d.fixed; - if (lhs.fixed.assigns) { - lhs.fixed.assigns.push(node); - } else { - lhs.fixed.assigns = [ node ]; - } - } - } else { - lhs.walk(tw); - } - } - - function walk_assign() { - var recursive = ld && recursive_ref(tw, ld); - var modified = is_modified(compressor, tw, node, right, 0, is_immutable(right), recursive); - scan_declaration(tw, compressor, left, function() { - return node.right; - }, function(sym, fixed, walk) { - if (!(sym instanceof AST_SymbolRef)) { - mark_assignment_to_arguments(sym); - walk(); - return; - } - var d = sym.definition(); - d.assignments++; - if (!fixed || sym.in_arg || !safe_to_assign(tw, d)) { - walk(); - d.fixed = false; - } else { - push_ref(d, sym); - mark(tw, d); - if (left instanceof AST_Destructured - || d.orig.length == 1 && d.orig[0] instanceof AST_SymbolDefun) { - d.single_use = false; - } - tw.loop_ids[d.id] = tw.in_loop; - d.fixed = modified ? 0 : fixed; - sym.fixed = fixed; - sym.fixed.assigns = [ node ]; - mark_escaped(tw, d, sym.scope, node, right, 0, 1); - } - }); - } - - function walk_lazy() { - if (!lazy) return; - left.walk(tw); - push(tw, true); - right.walk(tw); - pop(tw); - return true; - } - }); - def(AST_Binary, function(tw) { - if (!lazy_op[this.operator]) return; - this.left.walk(tw); - push(tw, true); - this.right.walk(tw); - pop(tw); - return true; - }); - def(AST_BlockScope, function(tw, descend, compressor) { - reset_block_variables(tw, compressor, this); - }); - def(AST_Call, function(tw, descend) { - var node = this; - var exp = node.expression; - if (exp instanceof AST_LambdaExpression) { - var iife = is_iife_single(node); - node.args.forEach(function(arg) { - arg.walk(tw); - if (arg instanceof AST_Spread) iife = false; - }); - if (iife) exp.reduce_vars = reduce_iife; - exp.walk(tw); - if (iife) delete exp.reduce_vars; - return true; - } - if (node.TYPE == "Call") switch (tw.in_boolean_context()) { - case "d": - var drop = true; - case true: - mark_refs(exp, drop); - } - exp.walk(tw); - var optional = node.optional; - if (optional) push(tw, true); - node.args.forEach(function(arg) { - arg.walk(tw); - }); - if (optional) pop(tw); - var fixed = exp instanceof AST_SymbolRef && exp.fixed_value(); - if (fixed instanceof AST_Lambda) { - mark_fn_def(tw, exp.definition(), fixed); - } else { - tw.find_parent(AST_Scope).may_call_this(); - } - return true; - - function mark_refs(node, drop) { - if (node instanceof AST_Assign) { - if (node.operator != "=") return; - mark_refs(node.left, drop); - mark_refs(node.right, drop); - } else if (node instanceof AST_Binary) { - if (!lazy_op[node.operator]) return; - mark_refs(node.left, drop); - mark_refs(node.right, drop); - } else if (node instanceof AST_Conditional) { - mark_refs(node.consequent, drop); - mark_refs(node.alternative, drop); - } else if (node instanceof AST_SymbolRef) { - var def = node.definition(); - def.bool_return++; - if (drop) def.drop_return++; - } - } - }); - def(AST_Class, function(tw, descend, compressor) { - var node = this; - reset_block_variables(tw, compressor, node); - if (node.extends) node.extends.walk(tw); - var props = node.properties.filter(function(prop) { - reset_flags(prop); - if (prop.key instanceof AST_Node) { - tw.push(prop); - prop.key.walk(tw); - tw.pop(); - } - return prop.value; - }); - if (node.name) { - var d = node.name.definition(); - var parent = tw.parent(); - if (parent instanceof AST_ExportDeclaration || parent instanceof AST_ExportDefault) d.single_use = false; - if (safe_to_assign(tw, d, true)) { - mark(tw, d); - tw.loop_ids[d.id] = tw.in_loop; - d.fixed = function() { - return node; - }; - d.fixed.assigns = [ node ]; - if (!is_safe_lexical(d)) d.single_use = false; - } else { - d.fixed = false; - } - } - props.forEach(function(prop) { - tw.push(prop); - if (!prop.static || is_static_field_or_init(prop) && prop.value.contains_this()) { - push(tw); - prop.value.walk(tw); - pop(tw); - } else { - prop.value.walk(tw); - } - tw.pop(); - }); - return true; - }); - def(AST_ClassInitBlock, function(tw, descend, compressor) { - var node = this; - push(tw, true); - reset_variables(tw, compressor, node); - descend(); - pop_scope(tw, node); - return true; - }); - def(AST_Conditional, function(tw) { - this.condition.walk(tw); - push(tw, true); - this.consequent.walk(tw); - pop(tw); - push(tw, true); - this.alternative.walk(tw); - pop(tw); - return true; - }); - def(AST_DefaultValue, function(tw) { - push(tw, true); - this.value.walk(tw); - pop(tw); - this.name.walk(tw); - return true; - }); - def(AST_Do, function(tw) { - var save_loop = tw.in_loop; - tw.in_loop = this; - push(tw); - this.body.walk(tw); - if (has_loop_control(this, tw.parent())) { - pop(tw); - push(tw); - } - this.condition.walk(tw); - pop(tw); - tw.in_loop = save_loop; - return true; - }); - def(AST_For, function(tw, descend, compressor) { - var node = this; - reset_block_variables(tw, compressor, node); - if (node.init) node.init.walk(tw); - var save_loop = tw.in_loop; - tw.in_loop = node; - push(tw); - if (node.condition) node.condition.walk(tw); - node.body.walk(tw); - if (node.step) { - if (has_loop_control(node, tw.parent())) { - pop(tw); - push(tw); - } - node.step.walk(tw); - } - pop(tw); - tw.in_loop = save_loop; - return true; - }); - def(AST_ForEnumeration, function(tw, descend, compressor) { - var node = this; - reset_block_variables(tw, compressor, node); - node.object.walk(tw); - var save_loop = tw.in_loop; - tw.in_loop = node; - push(tw); - var init = node.init; - if (init instanceof AST_Definitions) { - init.definitions[0].name.mark_symbol(function(node) { - if (node instanceof AST_SymbolDeclaration) { - var def = node.definition(); - def.assignments++; - def.fixed = false; - } - }, tw); - } else if (init instanceof AST_Destructured || init instanceof AST_SymbolRef) { - init.mark_symbol(function(node) { - if (node instanceof AST_SymbolRef) { - var def = node.definition(); - push_ref(def, node); - def.assignments++; - if (!node.is_immutable()) def.fixed = false; - } - }, tw); - } else { - init.walk(tw); - } - node.body.walk(tw); - pop(tw); - tw.in_loop = save_loop; - return true; - }); - def(AST_If, function(tw) { - this.condition.walk(tw); - push(tw, true); - this.body.walk(tw); - pop(tw); - if (this.alternative) { - push(tw, true); - this.alternative.walk(tw); - pop(tw); - } - return true; - }); - def(AST_LabeledStatement, function(tw) { - push(tw, true); - this.body.walk(tw); - pop(tw); - return true; - }); - def(AST_Lambda, function(tw, descend, compressor) { - var fn = this; - if (!safe_to_visit(tw, fn)) return true; - if (!push_uniq(tw.fn_visited, fn)) return true; - fn.inlined = false; - push(tw); - reset_variables(tw, compressor, fn); - descend(); - pop_scope(tw, fn); - if (fn.name) mark_escaped(tw, fn.name.definition(), fn, fn.name, fn, 0, 1); - return true; - }); - def(AST_LambdaDefinition, function(tw, descend, compressor) { - var fn = this; - var def = fn.name.definition(); - var parent = tw.parent(); - if (parent instanceof AST_ExportDeclaration || parent instanceof AST_ExportDefault) def.single_use = false; - if (!safe_to_visit(tw, fn)) return true; - if (!push_uniq(tw.fn_visited, fn)) return true; - fn.inlined = false; - push(tw); - reset_variables(tw, compressor, fn); - descend(); - pop_scope(tw, fn); - return true; - }); - def(AST_Sub, function(tw) { - if (!this.optional) return; - this.expression.walk(tw); - push(tw, true); - this.property.walk(tw); - pop(tw); - return true; - }); - def(AST_Switch, function(tw, descend, compressor) { - var node = this; - reset_block_variables(tw, compressor, node); - node.expression.walk(tw); - var first = true; - node.body.forEach(function(branch) { - if (branch instanceof AST_Default) return; - branch.expression.walk(tw); - if (first) { - first = false; - push(tw, true); - } - }) - if (!first) pop(tw); - walk_body(node, tw); - return true; - }); - def(AST_SwitchBranch, function(tw) { - push(tw, true); - walk_body(this, tw); - pop(tw); - return true; - }); - def(AST_SymbolCatch, function() { - this.definition().fixed = false; - }); - def(AST_SymbolImport, function() { - this.definition().fixed = false; - }); - def(AST_SymbolRef, function(tw, descend, compressor) { - var ref = this; - var d = ref.definition(); - var fixed = d.fixed || d.last_ref && d.last_ref.fixed; - push_ref(d, ref); - if (d.references.length == 1 && !d.fixed && d.orig[0] instanceof AST_SymbolDefun) { - tw.loop_ids[d.id] = tw.in_loop; - } - var recursive = recursive_ref(tw, d); - if (recursive) recursive.enclosed.forEach(function(def) { - if (d === def) return; - if (def.scope.resolve() === recursive) return; - var assigns = def.fixed && def.fixed.assigns; - if (!assigns) return; - if (assigns[assigns.length - 1] instanceof AST_VarDef) return; - var safe = tw.safe_ids[def.id]; - if (!safe) return; - safe.assign = true; - }); - if (d.single_use == "m" && d.fixed) { - d.fixed = 0; - d.single_use = false; - } - switch (d.fixed) { - case 0: - if (!safe_to_read(tw, d)) d.fixed = false; - case false: - var redef = d.redefined(); - if (redef && cross_scope(d.scope, ref.scope)) redef.single_use = false; - break; - case undefined: - d.fixed = false; - break; - default: - if (!safe_to_read(tw, d)) { - d.fixed = false; - break; - } - if (ref.in_arg && d.orig[0] instanceof AST_SymbolLambda) ref.fixed = d.scope; - var value = ref.fixed_value(); - if (recursive) { - d.recursive_refs++; - } else if (value && ref_once(compressor, d)) { - d.in_loop = tw.loop_ids[d.id] !== tw.in_loop; - d.single_use = is_lambda(value) - && !value.pinned() - && (!d.in_loop || tw.parent() instanceof AST_Call) - || !d.in_loop - && d.scope === ref.scope.resolve() - && value.is_constant_expression(); - } else { - d.single_use = false; - } - if (is_modified(compressor, tw, ref, value, 0, is_immutable(value), recursive)) { - if (d.single_use) { - d.single_use = "m"; - } else { - d.fixed = 0; - } - } - if (d.fixed && tw.loop_ids[d.id] !== tw.in_loop) d.cross_loop = true; - mark_escaped(tw, d, ref.scope, ref, value, 0, 1); - break; - } - if (!ref.fixed) ref.fixed = d.fixed === 0 ? fixed : d.fixed; - var parent; - if (value instanceof AST_Lambda - && !((parent = tw.parent()) instanceof AST_Call && parent.expression === ref)) { - mark_fn_def(tw, d, value); - } - }); - def(AST_Template, function(tw, descend) { - var node = this; - var tag = node.tag; - if (!tag) return; - if (tag instanceof AST_LambdaExpression) { - node.expressions.forEach(function(exp) { - exp.walk(tw); - }); - tag.walk(tw); - return true; - } - tag.walk(tw); - node.expressions.forEach(function(exp) { - exp.walk(tw); - }); - var fixed = tag instanceof AST_SymbolRef && tag.fixed_value(); - if (fixed instanceof AST_Lambda) { - mark_fn_def(tw, tag.definition(), fixed); - } else { - tw.find_parent(AST_Scope).may_call_this(); - } - return true; - }); - def(AST_Toplevel, function(tw, descend, compressor) { - var node = this; - node.globals.each(function(def) { - reset_def(tw, compressor, def); - }); - push(tw, true); - reset_variables(tw, compressor, node); - descend(); - pop_scope(tw, node); - return true; - }); - def(AST_Try, function(tw, descend, compressor) { - var node = this; - reset_block_variables(tw, compressor, node); - push(tw, true); - walk_body(node, tw); - pop(tw); - if (node.bcatch) { - push(tw, true); - node.bcatch.walk(tw); - pop(tw); - } - if (node.bfinally) node.bfinally.walk(tw); - return true; - }); - def(AST_Unary, function(tw, descend) { - var node = this; - if (!UNARY_POSTFIX[node.operator]) return; - var exp = node.expression; - if (!(exp instanceof AST_SymbolRef)) { - mark_assignment_to_arguments(exp); - return; - } - var d = exp.definition(); - d.assignments++; - var fixed = d.fixed; - if (safe_to_read(tw, d) && !exp.in_arg && safe_to_assign(tw, d)) { - push_ref(d, exp); - mark(tw, d); - if (d.single_use) d.single_use = false; - d.fixed = function() { - return make_node(AST_Binary, node, { - operator: node.operator.slice(0, -1), - left: make_node(AST_UnaryPrefix, node, { - operator: "+", - expression: make_ref(exp, fixed), - }), - right: make_node(AST_Number, node, { value: 1 }), - }); - }; - d.fixed.assigns = fixed && fixed.assigns ? fixed.assigns.slice() : []; - d.fixed.assigns.push(node); - if (node instanceof AST_UnaryPrefix) { - exp.fixed = d.fixed; - } else { - exp.fixed = function() { - return make_node(AST_UnaryPrefix, node, { - operator: "+", - expression: make_ref(exp, fixed), - }); - }; - exp.fixed.assigns = fixed && fixed.assigns; - exp.fixed.to_prefix = replace_ref(function(node) { - return node.expression; - }, d.fixed); - } - } else { - exp.walk(tw); - d.fixed = false; - } - return true; - }); - def(AST_VarDef, function(tw, descend, compressor) { - var node = this; - var value = node.value; - if (value instanceof AST_LambdaExpression && node.name instanceof AST_SymbolDeclaration) { - walk_defn(); - value.parent_scope.resolve().fn_defs.push(value); - value.safe_ids = null; - var ld = node.name.definition(); - if (!ld.fixed) mark_fn_def(tw, ld, value); - } else if (value) { - value.walk(tw); - walk_defn(); - } else if (tw.parent() instanceof AST_Let) { - walk_defn(); - } - return true; - - function walk_defn() { - scan_declaration(tw, compressor, node.name, function() { - return node.value || make_node(AST_Undefined, node); - }, function(name, fixed) { - var d = name.definition(); - if (fixed && safe_to_assign(tw, d, true)) { - mark(tw, d); - tw.loop_ids[d.id] = tw.in_loop; - d.fixed = fixed; - d.fixed.assigns = [ node ]; - if (name instanceof AST_SymbolConst && d.redefined() - || !(can_drop_symbol(name) || is_safe_lexical(d))) { - d.single_use = false; - } - } else { - d.fixed = false; - } - }); - } - }); - def(AST_While, function(tw, descend) { - var save_loop = tw.in_loop; - tw.in_loop = this; - push(tw); - descend(); - pop(tw); - tw.in_loop = save_loop; - return true; - }); - })(function(node, func) { - node.DEFMETHOD("reduce_vars", func); - }); - - function reset_flags(node) { - node._squeezed = false; - node._optimized = false; - if (node instanceof AST_BlockScope) node._var_names = undefined; - if (node instanceof AST_SymbolRef) node.fixed = undefined; - } - - AST_Toplevel.DEFMETHOD("reset_opt_flags", function(compressor) { - var tw = new TreeWalker(compressor.option("reduce_vars") ? function(node, descend) { - reset_flags(node); - return node.reduce_vars(tw, descend, compressor); - } : reset_flags); - // Flow control for visiting lambda definitions - tw.fn_scanning = null; - tw.fn_visited = []; - // Record the loop body in which `AST_SymbolDeclaration` is first encountered - tw.in_loop = null; - tw.loop_ids = Object.create(null); - // Stack of look-up tables to keep track of whether a `SymbolDef` has been - // properly assigned before use: - // - `push()` & `pop()` when visiting conditional branches - // - backup & restore via `save_ids` when visiting out-of-order sections - tw.safe_ids = Object.create(null); - tw.safe_ids.seq = {}; - this.walk(tw); - }); - - AST_Symbol.DEFMETHOD("fixed_value", function(ref_only) { - var def = this.definition(); - var fixed = def.fixed; - if (fixed) { - if (this.fixed) fixed = this.fixed; - return (fixed instanceof AST_Node ? fixed : fixed()).tail_node(); - } - fixed = fixed === 0 && this.fixed; - if (!fixed) return fixed; - var value = (fixed instanceof AST_Node ? fixed : fixed()).tail_node(); - if (ref_only && def.escaped.depth != 1 && is_object(value, true)) return value; - if (value.is_constant()) return value; - }); - - AST_SymbolRef.DEFMETHOD("is_immutable", function() { - var def = this.redef || this.definition(); - if (!(def.orig[0] instanceof AST_SymbolLambda)) return false; - if (def.orig.length == 1) return true; - if (!this.in_arg) return false; - return !(def.orig[1] instanceof AST_SymbolFunarg); - }); - - AST_Node.DEFMETHOD("convert_symbol", noop); - function convert_destructured(type, process) { - return this.transform(new TreeTransformer(function(node, descend) { - if (node instanceof AST_DefaultValue) { - node = node.clone(); - node.name = node.name.transform(this); - return node; - } - if (node instanceof AST_Destructured) { - node = node.clone(); - descend(node, this); - return node; - } - if (node instanceof AST_DestructuredKeyVal) { - node = node.clone(); - node.value = node.value.transform(this); - return node; - } - return node.convert_symbol(type, process); - })); - } - AST_DefaultValue.DEFMETHOD("convert_symbol", convert_destructured); - AST_Destructured.DEFMETHOD("convert_symbol", convert_destructured); - function convert_symbol(type, process) { - var node = make_node(type, this); - return process(node, this) || node; - } - AST_SymbolDeclaration.DEFMETHOD("convert_symbol", convert_symbol); - AST_SymbolRef.DEFMETHOD("convert_symbol", convert_symbol); - - function process_to_assign(ref) { - var def = ref.definition(); - def.assignments++; - def.references.push(ref); - } - - function mark_destructured(process, tw) { - var marker = new TreeWalker(function(node) { - if (node instanceof AST_DefaultValue) { - node.value.walk(tw); - node.name.walk(marker); - return true; - } - if (node instanceof AST_DestructuredKeyVal) { - if (node.key instanceof AST_Node) node.key.walk(tw); - node.value.walk(marker); - return true; - } - return process(node); - }); - this.walk(marker); - } - AST_DefaultValue.DEFMETHOD("mark_symbol", mark_destructured); - AST_Destructured.DEFMETHOD("mark_symbol", mark_destructured); - function mark_symbol(process) { - return process(this); - } - AST_SymbolDeclaration.DEFMETHOD("mark_symbol", mark_symbol); - AST_SymbolRef.DEFMETHOD("mark_symbol", mark_symbol); - - AST_Node.DEFMETHOD("match_symbol", function(predicate) { - return predicate(this); - }); - function match_destructured(predicate, ignore_side_effects) { - var found = false; - var tw = new TreeWalker(function(node) { - if (found) return true; - if (node instanceof AST_DefaultValue) { - if (!ignore_side_effects) return found = true; - node.name.walk(tw); - return true; - } - if (node instanceof AST_DestructuredKeyVal) { - if (!ignore_side_effects && node.key instanceof AST_Node) return found = true; - node.value.walk(tw); - return true; - } - if (predicate(node)) return found = true; - }); - this.walk(tw); - return found; - } - AST_DefaultValue.DEFMETHOD("match_symbol", match_destructured); - AST_Destructured.DEFMETHOD("match_symbol", match_destructured); - - function in_async_generator(scope) { - return scope instanceof AST_AsyncGeneratorDefun || scope instanceof AST_AsyncGeneratorFunction; - } - - function find_scope(compressor) { - var level = 0, node = compressor.self(); - do { - if (node.variables) return node; - } while (node = compressor.parent(level++)); - } - - function find_try(compressor, level, node, scope, may_throw, sync) { - for (var parent; parent = compressor.parent(level++); node = parent) { - if (parent === scope) return false; - if (sync && parent instanceof AST_Lambda) { - if (parent.name || is_async(parent) || is_generator(parent)) return true; - } else if (parent instanceof AST_Try) { - if (parent.bfinally && parent.bfinally !== node) return true; - if (may_throw && parent.bcatch && parent.bcatch !== node) return true; - } - } - return false; - } - - var identifier_atom = makePredicate("Infinity NaN undefined"); - function is_lhs_read_only(lhs, compressor) { - if (lhs instanceof AST_Atom) return true; - if (lhs instanceof AST_ObjectIdentity) return true; - if (lhs instanceof AST_PropAccess) { - if (lhs.property === "__proto__") return true; - lhs = lhs.expression; - if (lhs instanceof AST_SymbolRef) { - if (lhs.is_immutable()) return false; - lhs = lhs.fixed_value(); - } - if (!lhs) return true; - if (lhs.tail_node().is_constant()) return true; - return is_lhs_read_only(lhs, compressor); - } - if (lhs instanceof AST_SymbolRef) { - if (lhs.is_immutable()) return true; - var def = lhs.definition(); - return compressor.exposed(def) && identifier_atom[def.name]; - } - return false; - } - - function make_node(ctor, orig, props) { - if (props) { - props.start = orig.start; - props.end = orig.end; - } else { - props = orig; - } - return new ctor(props); - } - - function make_sequence(orig, expressions) { - if (expressions.length == 1) return expressions[0]; - return make_node(AST_Sequence, orig, { expressions: expressions.reduce(merge_sequence, []) }); - } - - function make_node_from_constant(val, orig) { - switch (typeof val) { - case "string": - return make_node(AST_String, orig, { value: val }); - case "number": - if (isNaN(val)) return make_node(AST_NaN, orig); - if (isFinite(val)) { - return 1 / val < 0 ? make_node(AST_UnaryPrefix, orig, { - operator: "-", - expression: make_node(AST_Number, orig, { value: -val }), - }) : make_node(AST_Number, orig, { value: val }); - } - return val < 0 ? make_node(AST_UnaryPrefix, orig, { - operator: "-", - expression: make_node(AST_Infinity, orig), - }) : make_node(AST_Infinity, orig); - case "boolean": - return make_node(val ? AST_True : AST_False, orig); - case "undefined": - return make_node(AST_Undefined, orig); - default: - if (val === null) { - return make_node(AST_Null, orig); - } - if (val instanceof RegExp) { - return make_node(AST_RegExp, orig, { value: val }); - } - throw new Error(string_template("Can't handle constant of type: {type}", { type: typeof val })); - } - } - - function needs_unbinding(val) { - return val instanceof AST_PropAccess - || is_undeclared_ref(val) && val.name == "eval"; - } - - // we shouldn't compress (1,func)(something) to - // func(something) because that changes the meaning of - // the func (becomes lexical instead of global). - function maintain_this_binding(parent, orig, val) { - var wrap = false; - if (parent.TYPE == "Call") { - wrap = parent.expression === orig && needs_unbinding(val); - } else if (parent instanceof AST_Template) { - wrap = parent.tag === orig && needs_unbinding(val); - } else if (parent instanceof AST_UnaryPrefix) { - wrap = parent.operator == "delete" - || parent.operator == "typeof" && is_undeclared_ref(val); - } - return wrap ? make_sequence(orig, [ make_node(AST_Number, orig, { value: 0 }), val ]) : val; - } - - function merge_expression(base, target) { - var fixed_by_id = new Dictionary(); - base.walk(new TreeWalker(function(node) { - if (!(node instanceof AST_SymbolRef)) return; - var def = node.definition(); - var fixed = node.fixed; - if (!fixed || !fixed_by_id.has(def.id)) { - fixed_by_id.set(def.id, fixed); - } else if (fixed_by_id.get(def.id) !== fixed) { - fixed_by_id.set(def.id, false); - } - })); - if (fixed_by_id.size() > 0) target.walk(new TreeWalker(function(node) { - if (!(node instanceof AST_SymbolRef)) return; - var def = node.definition(); - var fixed = node.fixed; - if (!fixed || !fixed_by_id.has(def.id)) return; - if (fixed_by_id.get(def.id) !== fixed) node.fixed = false; - })); - return target; - } - - function merge_sequence(array, node) { - if (node instanceof AST_Sequence) { - [].push.apply(array, node.expressions); - } else { - array.push(node); - } - return array; - } - - function is_lexical_definition(stat) { - return stat instanceof AST_Const || stat instanceof AST_DefClass || stat instanceof AST_Let; - } - - function safe_to_trim(stat) { - if (stat instanceof AST_LambdaDefinition) { - var def = stat.name.definition(); - var scope = stat.name.scope; - return def.scope === scope || all(def.references, function(ref) { - var s = ref.scope; - do { - if (s === scope) return true; - } while (s = s.parent_scope); - }); - } - return !is_lexical_definition(stat); - } - - function as_statement_array(thing) { - if (thing === null) return []; - if (thing instanceof AST_BlockStatement) return all(thing.body, safe_to_trim) ? thing.body : [ thing ]; - if (thing instanceof AST_EmptyStatement) return []; - if (is_statement(thing)) return [ thing ]; - throw new Error("Can't convert thing to statement array"); - } - - function is_empty(thing) { - if (thing === null) return true; - if (thing instanceof AST_EmptyStatement) return true; - if (thing instanceof AST_BlockStatement) return thing.body.length == 0; - return false; - } - - function has_declarations_only(block) { - return all(block.body, function(stat) { - return is_empty(stat) - || stat instanceof AST_Defun - || stat instanceof AST_Var && declarations_only(stat); - }); - } - - function loop_body(x) { - if (x instanceof AST_IterationStatement) { - return x.body instanceof AST_BlockStatement ? x.body : x; - } - return x; - } - - function is_iife_call(node) { - if (node.TYPE != "Call") return false; - do { - node = node.expression; - } while (node instanceof AST_PropAccess); - return node instanceof AST_LambdaExpression ? !is_arrow(node) : is_iife_call(node); - } - - function is_iife_single(call) { - var exp = call.expression; - if (exp.name) return false; - if (!(call instanceof AST_New)) return true; - var found = false; - exp.walk(new TreeWalker(function(node) { - if (found) return true; - if (node instanceof AST_NewTarget) return found = true; - if (node instanceof AST_Scope && node !== exp) return true; - })); - return !found; - } - - function is_undeclared_ref(node) { - return node instanceof AST_SymbolRef && node.definition().undeclared; - } - - var global_names = makePredicate("Array Boolean clearInterval clearTimeout console Date decodeURI decodeURIComponent encodeURI encodeURIComponent Error escape eval EvalError Function isFinite isNaN JSON Map Math Number parseFloat parseInt RangeError ReferenceError RegExp Object Set setInterval setTimeout String SyntaxError TypeError unescape URIError WeakMap WeakSet"); - AST_SymbolRef.DEFMETHOD("is_declared", function(compressor) { - return this.defined - || !this.definition().undeclared - || compressor.option("unsafe") && global_names[this.name]; - }); - - function is_static_field_or_init(prop) { - return prop.static && prop.value && (prop instanceof AST_ClassField || prop instanceof AST_ClassInit); - } - - function declarations_only(node) { - return all(node.definitions, function(var_def) { - return !var_def.value; - }); - } - - function is_declaration(stat, lexical) { - if (stat instanceof AST_DefClass) return lexical && !stat.extends && all(stat.properties, function(prop) { - if (prop.key instanceof AST_Node) return false; - return !is_static_field_or_init(prop); - }); - if (stat instanceof AST_Definitions) return (lexical || stat instanceof AST_Var) && declarations_only(stat); - if (stat instanceof AST_ExportDeclaration) return is_declaration(stat.body, lexical); - if (stat instanceof AST_ExportDefault) return is_declaration(stat.body, lexical); - return stat instanceof AST_LambdaDefinition; - } - - function is_last_statement(body, stat) { - var index = body.lastIndexOf(stat); - if (index < 0) return false; - while (++index < body.length) { - if (!is_declaration(body[index], true)) return false; - } - return true; - } - - // Certain combination of unused name + side effect leads to invalid AST: - // https://github.com/mishoo/UglifyJS/issues/44 - // https://github.com/mishoo/UglifyJS/issues/1838 - // https://github.com/mishoo/UglifyJS/issues/3371 - // We fix it at this stage by moving the `var` outside the `for`. - function patch_for_init(node, in_list) { - var block; - if (node.init instanceof AST_BlockStatement) { - block = node.init; - node.init = block.body.pop(); - block.body.push(node); - } - if (node.init instanceof AST_Defun) { - if (!block) block = make_node(AST_BlockStatement, node, { body: [ node ] }); - block.body.splice(-1, 0, node.init); - node.init = null; - } else if (node.init instanceof AST_SimpleStatement) { - node.init = node.init.body; - } else if (is_empty(node.init)) { - node.init = null; - } - if (!block) return; - return in_list ? List.splice(block.body) : block; - } - - function tighten_body(statements, compressor) { - var in_lambda = last_of(compressor, function(node) { - return node instanceof AST_Lambda; - }); - var block_scope, iife_in_try, in_iife_single, in_loop, in_try, scope; - find_loop_scope_try(); - var changed, last_changed, max_iter = 10; - do { - last_changed = changed; - changed = 0; - if (eliminate_spurious_blocks(statements)) changed = 1; - if (!changed && last_changed == 1) break; - if (compressor.option("dead_code")) { - if (eliminate_dead_code(statements, compressor)) changed = 2; - if (!changed && last_changed == 2) break; - } - if (compressor.option("if_return")) { - if (handle_if_return(statements, compressor)) changed = 3; - if (!changed && last_changed == 3) break; - } - if (compressor.option("awaits") && compressor.option("side_effects")) { - if (trim_awaits(statements, compressor)) changed = 4; - if (!changed && last_changed == 4) break; - } - if (compressor.option("inline") >= 4) { - if (inline_iife(statements, compressor)) changed = 5; - if (!changed && last_changed == 5) break; - } - if (compressor.sequences_limit > 0) { - if (sequencesize(statements, compressor)) changed = 6; - if (!changed && last_changed == 6) break; - if (sequencesize_2(statements, compressor)) changed = 7; - if (!changed && last_changed == 7) break; - } - if (compressor.option("join_vars")) { - if (join_consecutive_vars(statements)) changed = 8; - if (!changed && last_changed == 8) break; - } - if (compressor.option("collapse_vars")) { - if (collapse(statements, compressor)) changed = 9; - } - } while (changed && max_iter-- > 0); - return statements; - - function last_of(compressor, predicate) { - var block = compressor.self(), level = 0, stat; - do { - if (block instanceof AST_Catch) { - block = compressor.parent(level++); - } else if (block instanceof AST_LabeledStatement) { - block = block.body; - } else if (block instanceof AST_SwitchBranch) { - var branches = compressor.parent(level); - if (branches.body[branches.body.length - 1] === block || has_break(block.body)) { - level++; - block = branches; - } - } - do { - stat = block; - if (predicate(stat)) return stat; - block = compressor.parent(level++); - } while (block instanceof AST_If); - } while (stat - && (block instanceof AST_BlockStatement - || block instanceof AST_Catch - || block instanceof AST_Scope - || block instanceof AST_SwitchBranch - || block instanceof AST_Try) - && is_last_statement(block.body, stat)); - - function has_break(stats) { - for (var i = stats.length; --i >= 0;) { - if (stats[i] instanceof AST_Break) return true; - } - return false; - } - } - - function find_loop_scope_try() { - var node = compressor.self(), level = 0; - do { - if (!block_scope && node.variables) block_scope = node; - if (node instanceof AST_Catch) { - if (compressor.parent(level).bfinally) { - if (!in_try) in_try = {}; - in_try.bfinally = true; - } - level++; - } else if (node instanceof AST_Finally) { - level++; - } else if (node instanceof AST_IterationStatement) { - in_loop = true; - } else if (node instanceof AST_Scope) { - scope = node; - break; - } else if (node instanceof AST_Try) { - if (!in_try) in_try = {}; - if (node.bcatch) in_try.bcatch = true; - if (node.bfinally) in_try.bfinally = true; - } - } while (node = compressor.parent(level++)); - } - - // Search from right to left for assignment-like expressions: - // - `var a = x;` - // - `a = x;` - // - `++a` - // For each candidate, scan from left to right for first usage, then try - // to fold assignment into the site for compression. - // Will not attempt to collapse assignments into or past code blocks - // which are not sequentially executed, e.g. loops and conditionals. - function collapse(statements, compressor) { - if (scope.pinned()) return; - var args; - var assignments = new Dictionary(); - var candidates = []; - var changed = false; - var declare_only = new Dictionary(); - var force_single; - var stat_index = statements.length; - var scanner = new TreeTransformer(function(node, descend) { - if (abort) return node; - // Skip nodes before `candidate` as quickly as possible - if (!hit) { - if (node !== hit_stack[hit_index]) return node; - hit_index++; - if (hit_index < hit_stack.length) return handle_custom_scan_order(node, scanner); - hit = true; - stop_after = (value_def ? find_stop_value : find_stop)(node, 0); - if (stop_after === node) abort = true; - return node; - } - var parent = scanner.parent(); - // Stop only if candidate is found within conditional branches - if (!stop_if_hit && in_conditional(node, parent)) { - stop_if_hit = parent; - } - // Cascade compound assignments - if (compound && scan_lhs && can_replace && !stop_if_hit - && node instanceof AST_Assign && node.operator != "=" && node.left.equals(lhs)) { - replaced++; - changed = true; - AST_Node.info("Cascading {this} [{start}]", node); - can_replace = false; - lvalues = get_lvalues(lhs); - node.right.transform(scanner); - clear_write_only(candidate); - var folded; - if (abort) { - folded = candidate; - } else { - abort = true; - folded = make_node(AST_Binary, candidate, { - operator: compound, - left: lhs.fixed && lhs.definition().fixed ? lhs.fixed.to_binary(candidate) : lhs, - right: rvalue, - }); - } - return make_node(AST_Assign, node, { - operator: "=", - left: node.left, - right: make_node(AST_Binary, node, { - operator: node.operator.slice(0, -1), - left: folded, - right: node.right, - }), - }); - } - // Stop immediately if these node types are encountered - if (should_stop(node, parent)) { - abort = true; - return node; - } - // Skip transient nodes caused by single-use variable replacement - if (node.single_use) return node; - // Replace variable with assignment when found - var hit_rhs; - if (!(node instanceof AST_SymbolDeclaration) - && (scan_lhs && lhs.equals(node) - || scan_rhs && (hit_rhs = scan_rhs(node, this)))) { - if (!can_replace || stop_if_hit && (hit_rhs || !lhs_local || !replace_all)) { - if (!hit_rhs && !value_def) abort = true; - return node; - } - if (is_lhs(node, parent)) { - if (value_def && !hit_rhs) assign_used = true; - return node; - } - if (!hit_rhs && verify_ref && node.fixed !== lhs.fixed) { - abort = true; - return node; - } - if (value_def) { - if (stop_if_hit && assign_pos == 0) assign_pos = remaining - replaced; - if (!hit_rhs) replaced++; - return node; - } - replaced++; - changed = abort = true; - AST_Node.info("Collapsing {this} [{start}]", node); - if (candidate.TYPE == "Binary") { - update_symbols(candidate, node); - return make_node(AST_Assign, candidate, { - operator: "=", - left: candidate.right.left, - right: candidate.operator == "&&" ? make_node(AST_Conditional, candidate, { - condition: candidate.left, - consequent: candidate.right.right, - alternative: node, - }) : make_node(AST_Conditional, candidate, { - condition: candidate.left, - consequent: node, - alternative: candidate.right.right, - }), - }); - } - if (candidate instanceof AST_UnaryPostfix) return make_node(AST_UnaryPrefix, candidate, { - operator: candidate.operator, - expression: lhs.fixed && lhs.definition().fixed ? lhs.fixed.to_prefix(candidate) : lhs, - }); - if (candidate instanceof AST_UnaryPrefix) { - clear_write_only(candidate); - return candidate; - } - update_symbols(rvalue, node); - if (candidate instanceof AST_VarDef) { - var def = candidate.name.definition(); - if (def.references.length - def.replaced == 1 && !compressor.exposed(def)) { - def.replaced++; - return maintain_this_binding(parent, node, rvalue); - } - return make_node(AST_Assign, candidate, { - operator: "=", - left: node, - right: rvalue, - }); - } - clear_write_only(rvalue); - var assign = candidate.clone(); - assign.right = rvalue; - return assign; - } - // Stop signals related to AST_SymbolRef - if (should_stop_ref(node, parent)) { - abort = true; - return node; - } - // These node types have child nodes that execute sequentially, - // but are otherwise not safe to scan into or beyond them. - if (is_last_node(node, parent) || may_throw(node)) { - stop_after = node; - if (node instanceof AST_Scope) abort = true; - } - // Scan but don't replace inside getter/setter - if (node instanceof AST_Accessor) { - var replace = can_replace; - can_replace = false; - descend(node, scanner); - can_replace = replace; - return signal_abort(node); - } - // Scan but don't replace inside destructuring expression - if (node instanceof AST_Destructured) { - var replace = can_replace; - can_replace = false; - descend(node, scanner); - can_replace = replace; - return signal_abort(node); - } - // Scan but don't replace inside default value - if (node instanceof AST_DefaultValue) { - node.name = node.name.transform(scanner); - var replace = can_replace; - can_replace = false; - node.value = node.value.transform(scanner); - can_replace = replace; - return signal_abort(node); - } - // Scan but don't replace inside block scope with colliding variable - if (node instanceof AST_BlockScope - && !(node instanceof AST_Scope) - && !(node.variables && node.variables.all(function(def) { - return !enclosed.has(def.name) && !lvalues.has(def.name); - }))) { - var replace = can_replace; - can_replace = false; - if (!handle_custom_scan_order(node, scanner)) descend(node, scanner); - can_replace = replace; - return signal_abort(node); - } - if (handle_custom_scan_order(node, scanner)) return signal_abort(node); - }, signal_abort); - var multi_replacer = new TreeTransformer(function(node) { - if (abort) return node; - // Skip nodes before `candidate` as quickly as possible - if (!hit) { - if (node !== hit_stack[hit_index]) return node; - hit_index++; - switch (hit_stack.length - hit_index) { - case 0: - hit = true; - if (assign_used) return node; - if (node !== candidate) return node; - if (node instanceof AST_VarDef) return node; - def.replaced++; - var parent = multi_replacer.parent(); - if (parent instanceof AST_Sequence && parent.tail_node() !== node) { - value_def.replaced++; - if (rvalue === rhs_value) return List.skip; - return make_sequence(rhs_value, rhs_value.expressions.slice(0, -1)); - } - return rvalue; - case 1: - if (!assign_used && node.body === candidate) { - hit = true; - def.replaced++; - value_def.replaced++; - return null; - } - default: - return handle_custom_scan_order(node, multi_replacer); - } - } - // Replace variable when found - if (node instanceof AST_SymbolRef && node.definition() === def) { - if (is_lhs(node, multi_replacer.parent())) return node; - if (!--replaced) abort = true; - AST_Node.info("Replacing {this} [{start}]", node); - var ref = rvalue.clone(); - ref.scope = node.scope; - ref.reference(); - if (replaced == assign_pos) { - abort = true; - return make_node(AST_Assign, candidate, { - operator: "=", - left: node, - right: ref, - }); - } - def.replaced++; - return ref; - } - // Skip (non-executed) functions and (leading) default case in switch statements - if (node instanceof AST_Default || node instanceof AST_Scope) return node; - }, function(node) { - return patch_sequence(node, multi_replacer); - }); - while (--stat_index >= 0) { - // Treat parameters as collapsible in IIFE, i.e. - // function(a, b){ ... }(x()); - // would be translated into equivalent assignments: - // var a = x(), b = undefined; - if (stat_index == 0 && compressor.option("unused")) extract_args(); - // Find collapsible assignments - var hit_stack = []; - extract_candidates(statements[stat_index]); - while (candidates.length > 0) { - hit_stack = candidates.pop(); - var hit_index = 0; - var candidate = hit_stack[hit_stack.length - 1]; - var assign_pos = -1; - var assign_used = false; - var verify_ref = false; - var remaining; - var value_def = null; - var stop_after = null; - var stop_if_hit = null; - var lhs = get_lhs(candidate); - var side_effects = lhs && lhs.has_side_effects(compressor); - var scan_lhs = lhs && (!side_effects || lhs instanceof AST_SymbolRef) - && !is_lhs_read_only(lhs, compressor); - var scan_rhs = foldable(candidate); - if (!scan_lhs && !scan_rhs) continue; - var compound = candidate instanceof AST_Assign && candidate.operator.slice(0, -1); - var funarg = candidate.name instanceof AST_SymbolFunarg; - var may_throw = return_false; - if (candidate.may_throw(compressor)) { - if (funarg && is_async(scope)) continue; - may_throw = in_try ? function(node) { - return node.has_side_effects(compressor); - } : side_effects_external; - } - var read_toplevel = false; - var modify_toplevel = false; - // Locate symbols which may execute code outside of scanning range - var enclosed = new Dictionary(); - var well_defined = true; - var lvalues = get_lvalues(candidate); - var lhs_local = is_lhs_local(lhs); - var rhs_value = get_rvalue(candidate); - var rvalue = rhs_value; - if (!side_effects) { - if (!compound && rvalue instanceof AST_Sequence) rvalue = rvalue.tail_node(); - side_effects = value_has_side_effects(); - } - var check_destructured = in_try || !lhs_local ? function(node) { - return node instanceof AST_Destructured; - } : return_false; - var replace_all = replace_all_symbols(candidate); - var hit = funarg; - var abort = false; - var replaced = 0; - var can_replace = !args || !hit; - if (!can_replace) { - for (var j = candidate.arg_index + 1; !abort && j < args.length; j++) { - if (args[j]) args[j].transform(scanner); - } - can_replace = true; - } - for (var i = stat_index; !abort && i < statements.length; i++) { - statements[i].transform(scanner); - } - if (value_def) { - if (!replaced || remaining > replaced + assign_used) { - candidates.push(hit_stack); - force_single = true; - continue; - } - if (replaced == assign_pos) assign_used = true; - var def = lhs.definition(); - abort = false; - hit_index = 0; - hit = funarg; - for (var i = stat_index; !abort && i < statements.length; i++) { - if (!statements[i].transform(multi_replacer)) statements.splice(i--, 1); - } - replaced = candidate instanceof AST_VarDef - && candidate === hit_stack[hit_stack.length - 1] - && def.references.length == def.replaced - && !compressor.exposed(def); - value_def.last_ref = false; - value_def.single_use = false; - changed = true; - } - if (replaced) remove_candidate(candidate); - } - } - return changed; - - function signal_abort(node) { - if (abort) return node; - if (stop_after === node) abort = true; - if (stop_if_hit === node) stop_if_hit = null; - return node; - } - - function handle_custom_scan_order(node, tt) { - if (!(node instanceof AST_BlockScope)) return; - // Skip (non-executed) functions - if (node instanceof AST_Scope) return node; - // Scan computed keys, static fields & initializers in class - if (node instanceof AST_Class) { - if (node.name) node.name = node.name.transform(tt); - if (!abort && node.extends) node.extends = node.extends.transform(tt); - var fields = [], stats = []; - for (var i = 0; !abort && i < node.properties.length; i++) { - var prop = node.properties[i]; - if (prop.key instanceof AST_Node) prop.key = prop.key.transform(tt); - if (!prop.static) continue; - if (prop instanceof AST_ClassField) { - if (prop.value) fields.push(prop); - } else if (prop instanceof AST_ClassInit) { - [].push.apply(stats, prop.value.body); - } - } - for (var i = 0; !abort && i < stats.length; i++) { - stats[i].transform(tt); - } - for (var i = 0; !abort && i < fields.length; i++) { - var prop = fields[i]; - prop.value = prop.value.transform(tt); - } - return node; - } - // Scan object only in a for-in/of statement - if (node instanceof AST_ForEnumeration) { - node.object = node.object.transform(tt); - abort = true; - return node; - } - // Scan first case expression only in a switch statement - if (node instanceof AST_Switch) { - node.expression = node.expression.transform(tt); - for (var i = 0; !abort && i < node.body.length; i++) { - var branch = node.body[i]; - if (branch instanceof AST_Case) { - if (!hit) { - if (branch !== hit_stack[hit_index]) continue; - hit_index++; - } - branch.expression = branch.expression.transform(tt); - if (!replace_all) break; - scan_rhs = false; - } - } - abort = true; - return node; - } - } - - function is_direct_assignment(node, parent) { - if (parent instanceof AST_Assign) return parent.operator == "=" && parent.left === node; - if (parent instanceof AST_DefaultValue) return parent.name === node; - if (parent instanceof AST_DestructuredArray) return true; - if (parent instanceof AST_DestructuredKeyVal) return parent.value === node; - } - - function should_stop(node, parent) { - if (node === rvalue) return true; - if (parent instanceof AST_For) { - if (node !== parent.init) return true; - } - if (node instanceof AST_Assign) { - return node.operator != "=" && lhs.equals(node.left); - } - if (node instanceof AST_Call) { - if (!(lhs instanceof AST_PropAccess)) return false; - if (!lhs.equals(node.expression)) return false; - return !(rvalue instanceof AST_LambdaExpression && !rvalue.contains_this()); - } - if (node instanceof AST_Class) return !compressor.has_directive("use strict"); - if (node instanceof AST_Debugger) return true; - if (node instanceof AST_Defun) return funarg && lhs.name === node.name.name; - if (node instanceof AST_DestructuredKeyVal) return node.key instanceof AST_Node; - if (node instanceof AST_DWLoop) return true; - if (node instanceof AST_LoopControl) return true; - if (node instanceof AST_Try) return true; - if (node instanceof AST_With) return true; - return false; - } - - function should_stop_ref(node, parent) { - if (!(node instanceof AST_SymbolRef)) return false; - if (node.is_declared(compressor)) { - if (node.fixed_value()) return false; - if (can_drop_symbol(node)) { - return !(parent instanceof AST_PropAccess && parent.expression === node) - && is_arguments(node.definition()); - } - } else if (is_direct_assignment(node, parent)) { - return false; - } - if (!replace_all) return true; - scan_rhs = false; - return false; - } - - function in_conditional(node, parent) { - if (parent instanceof AST_Assign) return parent.left !== node && lazy_op[parent.operator.slice(0, -1)]; - if (parent instanceof AST_Binary) return parent.left !== node && lazy_op[parent.operator]; - if (parent instanceof AST_Call) return parent.optional && parent.expression !== node; - if (parent instanceof AST_Case) return parent.expression !== node; - if (parent instanceof AST_Conditional) return parent.condition !== node; - if (parent instanceof AST_If) return parent.condition !== node; - if (parent instanceof AST_Sub) return parent.optional && parent.expression !== node; - } - - function is_last_node(node, parent) { - if (node instanceof AST_Await) return true; - if (node.TYPE == "Binary") return !can_drop_op(node.operator, node.right, compressor); - if (node instanceof AST_Call) { - var def, fn = node.expression; - if (fn instanceof AST_SymbolRef) { - def = fn.definition(); - fn = fn.fixed_value(); - } - if (!(fn instanceof AST_Lambda)) return !node.is_expr_pure(compressor); - if (def && recursive_ref(compressor, def, fn)) return true; - if (fn.collapse_scanning) return false; - fn.collapse_scanning = true; - var replace = can_replace; - can_replace = false; - var after = stop_after; - var if_hit = stop_if_hit; - for (var i = 0; !abort && i < fn.argnames.length; i++) { - if (arg_may_throw(reject, fn.argnames[i], node.args[i])) abort = true; - } - if (!abort) { - if (fn.rest && arg_may_throw(reject, fn.rest, make_node(AST_Array, node, { - elements: node.args.slice(i), - }))) { - abort = true; - } else if (is_arrow(fn) && fn.value) { - fn.value.transform(scanner); - } else for (var i = 0; !abort && i < fn.body.length; i++) { - var stat = fn.body[i]; - if (stat instanceof AST_Return) { - if (stat.value) stat.value.transform(scanner); - break; - } - stat.transform(scanner); - } - } - stop_if_hit = if_hit; - stop_after = after; - can_replace = replace; - fn.collapse_scanning = false; - if (!abort) return false; - abort = false; - return true; - } - if (node instanceof AST_Class) { - if (!in_try) return false; - var base = node.extends; - if (!base) return false; - if (base instanceof AST_SymbolRef) base = base.fixed_value(); - return !safe_for_extends(base); - } - if (node instanceof AST_Exit) { - if (in_try) { - if (in_try.bfinally) return true; - if (in_try.bcatch && node instanceof AST_Throw) return true; - } - return side_effects || lhs instanceof AST_PropAccess || may_modify(lhs); - } - if (node instanceof AST_Function) { - return compressor.option("ie") && node.name && lvalues.has(node.name.name); - } - if (node instanceof AST_ObjectIdentity) return symbol_in_lvalues(node, parent); - if (node instanceof AST_PropAccess) { - if (side_effects) return true; - var exp = node.expression; - if (exp instanceof AST_SymbolRef && is_arguments(exp.definition())) return true; - if (compressor.option("unsafe")) { - if (is_undeclared_ref(exp) && global_names[exp.name]) return false; - if (is_static_fn(exp)) return false; - } - if (!well_defined) return true; - if (value_def) return false; - if (!in_try && lhs_local) return false; - if (node.optional) return false; - return exp.may_throw_on_access(compressor); - } - if (node instanceof AST_Spread) return true; - if (node instanceof AST_SymbolRef) { - if (symbol_in_lvalues(node, parent)) return !is_direct_assignment(node, parent); - if (side_effects && may_modify(node)) return true; - var def = node.definition(); - return (in_try || def.scope.resolve() !== scope) && !can_drop_symbol(node); - } - if (node instanceof AST_Template) return !node.is_expr_pure(compressor); - if (node instanceof AST_VarDef) { - if (check_destructured(node.name)) return true; - return (node.value || parent instanceof AST_Let) && node.name.match_symbol(function(node) { - return node instanceof AST_SymbolDeclaration - && (lvalues.has(node.name) || side_effects && may_modify(node)); - }, true); - } - if (node instanceof AST_Yield) return true; - var sym = is_lhs(node.left, node); - if (!sym) return false; - if (sym instanceof AST_PropAccess) return true; - if (check_destructured(sym)) return true; - return sym.match_symbol(function(node) { - return node instanceof AST_SymbolRef - && (lvalues.has(node.name) || read_toplevel && compressor.exposed(node.definition())); - }, true); - - function reject(node) { - node.transform(scanner); - return abort; - } - } - - function arg_may_throw(reject, node, value) { - if (node instanceof AST_DefaultValue) { - return reject(node.value) - || arg_may_throw(reject, node.name, node.value) - || !is_undefined(value) && arg_may_throw(reject, node.name, value); - } - if (!value) return !(node instanceof AST_Symbol); - if (node instanceof AST_Destructured) { - if (node.rest && arg_may_throw(reject, node.rest)) return true; - if (node instanceof AST_DestructuredArray) { - if (value instanceof AST_Array) return !all(node.elements, function(element, index) { - return !arg_may_throw(reject, element, value[index]); - }); - if (!value.is_string(compressor)) return true; - return !all(node.elements, function(element) { - return !arg_may_throw(reject, element); - }); - } - if (node instanceof AST_DestructuredObject) { - if (value.may_throw_on_access(compressor)) return true; - return !all(node.properties, function(prop) { - if (prop.key instanceof AST_Node && reject(prop.key)) return false; - return !arg_may_throw(reject, prop.value); - }); - } - } - } - - function extract_args() { - if (in_iife_single === false) return; - var iife = compressor.parent(), fn = compressor.self(); - if (in_iife_single === undefined) { - if (!(fn instanceof AST_LambdaExpression) - || is_generator(fn) - || fn.uses_arguments - || fn.pinned() - || !(iife instanceof AST_Call) - || iife.expression !== fn - || !all(iife.args, function(arg) { - return !(arg instanceof AST_Spread); - })) { - in_iife_single = false; - return; - } - if (!is_iife_single(iife)) return; - in_iife_single = true; - } - var fn_strict = fn.in_strict_mode(compressor) - && !fn.parent_scope.resolve(true).in_strict_mode(compressor); - var has_await; - if (is_async(fn)) { - has_await = function(node) { - return node instanceof AST_Symbol && node.name == "await"; - }; - iife_in_try = true; - } else { - has_await = function(node) { - return node instanceof AST_Await && !tw.find_parent(AST_Scope); - }; - if (iife_in_try === undefined) iife_in_try = find_try(compressor, 1, iife, null, true, true); - } - var arg_scope = null; - var tw = new TreeWalker(function(node, descend) { - if (!arg) return true; - if (has_await(node) || node instanceof AST_Yield) { - arg = null; - return true; - } - if (node instanceof AST_ObjectIdentity) { - if (fn_strict || !arg_scope) arg = null; - return true; - } - if (node instanceof AST_SymbolRef) { - var def; - if (node.in_arg && !is_safe_lexical(node.definition()) - || (def = fn.variables.get(node.name)) && def !== node.definition()) { - arg = null; - } - return true; - } - if (node instanceof AST_Scope && !is_arrow(node)) { - var save_scope = arg_scope; - arg_scope = node; - descend(); - arg_scope = save_scope; - return true; - } - }); - args = iife.args.slice(); - var len = args.length; - var names = new Dictionary(); - for (var i = fn.argnames.length; --i >= 0;) { - var sym = fn.argnames[i]; - var arg = args[i]; - var value = null; - if (sym instanceof AST_DefaultValue) { - value = sym.value; - sym = sym.name; - args[len + i] = value; - } - if (sym instanceof AST_Destructured) { - if (iife_in_try && arg_may_throw(function(node) { - return node.has_side_effects(compressor); - }, sym, arg)) { - candidates.length = 0; - break; - } - args[len + i] = fn.argnames[i]; - continue; - } - if (names.has(sym.name)) continue; - names.set(sym.name, true); - if (value) arg = is_undefined(arg) ? value : null; - if (!arg && !value) { - arg = make_node(AST_Undefined, sym).transform(compressor); - } else if (arg instanceof AST_Lambda && arg.pinned()) { - arg = null; - } else if (arg) { - arg.walk(tw); - } - if (!arg) continue; - var candidate = make_node(AST_VarDef, sym, { - name: sym, - value: arg, - }); - candidate.name_index = i; - candidate.arg_index = value ? len + i : i; - candidates.unshift([ candidate ]); - } - if (fn.rest) args.push(fn.rest); - } - - function extract_candidates(expr, unused) { - hit_stack.push(expr); - if (expr instanceof AST_Array) { - expr.elements.forEach(function(node) { - extract_candidates(node, unused); - }); - } else if (expr instanceof AST_Assign) { - var lhs = expr.left; - if (!(lhs instanceof AST_Destructured)) candidates.push(hit_stack.slice()); - extract_candidates(lhs); - extract_candidates(expr.right); - if (lhs instanceof AST_SymbolRef && expr.operator == "=") { - assignments.set(lhs.name, (assignments.get(lhs.name) || 0) + 1); - } - } else if (expr instanceof AST_Await) { - extract_candidates(expr.expression, unused); - } else if (expr instanceof AST_Binary) { - var lazy = lazy_op[expr.operator]; - if (unused - && lazy - && expr.operator != "??" - && expr.right instanceof AST_Assign - && expr.right.operator == "=" - && !(expr.right.left instanceof AST_Destructured)) { - candidates.push(hit_stack.slice()); - } - extract_candidates(expr.left, !lazy && unused); - extract_candidates(expr.right, unused); - } else if (expr instanceof AST_Call) { - extract_candidates(expr.expression); - expr.args.forEach(extract_candidates); - } else if (expr instanceof AST_Case) { - extract_candidates(expr.expression); - } else if (expr instanceof AST_Conditional) { - extract_candidates(expr.condition); - extract_candidates(expr.consequent, unused); - extract_candidates(expr.alternative, unused); - } else if (expr instanceof AST_Definitions) { - expr.definitions.forEach(extract_candidates); - } else if (expr instanceof AST_Dot) { - extract_candidates(expr.expression); - } else if (expr instanceof AST_DWLoop) { - extract_candidates(expr.condition); - if (!(expr.body instanceof AST_Block)) { - extract_candidates(expr.body); - } - } else if (expr instanceof AST_Exit) { - if (expr.value) extract_candidates(expr.value); - } else if (expr instanceof AST_For) { - if (expr.init) extract_candidates(expr.init, true); - if (expr.condition) extract_candidates(expr.condition); - if (expr.step) extract_candidates(expr.step, true); - if (!(expr.body instanceof AST_Block)) { - extract_candidates(expr.body); - } - } else if (expr instanceof AST_ForEnumeration) { - extract_candidates(expr.object); - if (!(expr.body instanceof AST_Block)) { - extract_candidates(expr.body); - } - } else if (expr instanceof AST_If) { - extract_candidates(expr.condition); - if (!(expr.body instanceof AST_Block)) { - extract_candidates(expr.body); - } - if (expr.alternative && !(expr.alternative instanceof AST_Block)) { - extract_candidates(expr.alternative); - } - } else if (expr instanceof AST_Object) { - expr.properties.forEach(function(prop) { - hit_stack.push(prop); - if (prop.key instanceof AST_Node) extract_candidates(prop.key); - if (prop instanceof AST_ObjectKeyVal) extract_candidates(prop.value, unused); - hit_stack.pop(); - }); - } else if (expr instanceof AST_Sequence) { - var end = expr.expressions.length - (unused ? 0 : 1); - expr.expressions.forEach(function(node, index) { - extract_candidates(node, index < end); - }); - } else if (expr instanceof AST_SimpleStatement) { - extract_candidates(expr.body, true); - } else if (expr instanceof AST_Spread) { - extract_candidates(expr.expression); - } else if (expr instanceof AST_Sub) { - extract_candidates(expr.expression); - extract_candidates(expr.property); - } else if (expr instanceof AST_Switch) { - extract_candidates(expr.expression); - expr.body.forEach(extract_candidates); - } else if (expr instanceof AST_Unary) { - if (UNARY_POSTFIX[expr.operator]) { - candidates.push(hit_stack.slice()); - } else { - extract_candidates(expr.expression); - } - } else if (expr instanceof AST_VarDef) { - if (expr.name instanceof AST_SymbolVar) { - if (expr.value) { - var def = expr.name.definition(); - if (def.references.length > def.replaced) { - candidates.push(hit_stack.slice()); - } - } else { - declare_only.set(expr.name.name, (declare_only.get(expr.name.name) || 0) + 1); - } - } - if (expr.value) extract_candidates(expr.value); - } else if (expr instanceof AST_Yield) { - if (expr.expression) extract_candidates(expr.expression); - } - hit_stack.pop(); - } - - function find_stop(node, level) { - var parent = scanner.parent(level); - if (parent instanceof AST_Array) return node; - if (parent instanceof AST_Assign) return node; - if (parent instanceof AST_Await) return node; - if (parent instanceof AST_Binary) return node; - if (parent instanceof AST_Call) return node; - if (parent instanceof AST_Case) return node; - if (parent instanceof AST_Conditional) return node; - if (parent instanceof AST_Definitions) return find_stop_unused(parent, level + 1); - if (parent instanceof AST_Exit) return node; - if (parent instanceof AST_If) return node; - if (parent instanceof AST_IterationStatement) return node; - if (parent instanceof AST_ObjectProperty) return node; - if (parent instanceof AST_PropAccess) return node; - if (parent instanceof AST_Sequence) { - return (parent.tail_node() === node ? find_stop : find_stop_unused)(parent, level + 1); - } - if (parent instanceof AST_SimpleStatement) return find_stop_unused(parent, level + 1); - if (parent instanceof AST_Spread) return node; - if (parent instanceof AST_Switch) return node; - if (parent instanceof AST_Unary) return node; - if (parent instanceof AST_VarDef) return node; - if (parent instanceof AST_Yield) return node; - return null; - } - - function find_stop_logical(parent, op, level) { - var node; - do { - node = parent; - parent = scanner.parent(++level); - } while (parent instanceof AST_Assign && parent.operator.slice(0, -1) == op - || parent instanceof AST_Binary && parent.operator == op); - return node; - } - - function find_stop_expr(expr, cont, node, parent, level) { - var replace = can_replace; - can_replace = false; - var after = stop_after; - var if_hit = stop_if_hit; - var stack = scanner.stack; - scanner.stack = [ parent ]; - expr.transform(scanner); - scanner.stack = stack; - stop_if_hit = if_hit; - stop_after = after; - can_replace = replace; - if (abort) { - abort = false; - return node; - } - return cont(parent, level + 1); - } - - function find_stop_value(node, level) { - var parent = scanner.parent(level); - if (parent instanceof AST_Array) return find_stop_value(parent, level + 1); - if (parent instanceof AST_Assign) { - if (may_throw(parent)) return node; - if (parent.left.match_symbol(function(ref) { - return ref instanceof AST_SymbolRef && (lhs.name == ref.name || value_def.name == ref.name); - })) return node; - var op; - if (parent.left === node || !lazy_op[op = parent.operator.slice(0, -1)]) { - return find_stop_value(parent, level + 1); - } - return find_stop_logical(parent, op, level); - } - if (parent instanceof AST_Await) return find_stop_value(parent, level + 1); - if (parent instanceof AST_Binary) { - var op; - if (parent.left === node || !lazy_op[op = parent.operator]) { - return find_stop_value(parent, level + 1); - } - return find_stop_logical(parent, op, level); - } - if (parent instanceof AST_Call) return parent; - if (parent instanceof AST_Case) { - if (parent.expression !== node) return node; - return find_stop_value(parent, level + 1); - } - if (parent instanceof AST_Conditional) { - if (parent.condition !== node) return node; - return find_stop_value(parent, level + 1); - } - if (parent instanceof AST_Definitions) return find_stop_unused(parent, level + 1); - if (parent instanceof AST_Do) return node; - if (parent instanceof AST_Exit) return find_stop_unused(parent, level + 1); - if (parent instanceof AST_For) { - if (parent.init !== node && parent.condition !== node) return node; - return find_stop_value(parent, level + 1); - } - if (parent instanceof AST_ForEnumeration) { - if (parent.init !== node) return node; - return find_stop_value(parent, level + 1); - } - if (parent instanceof AST_If) { - if (parent.condition !== node) return node; - return find_stop_value(parent, level + 1); - } - if (parent instanceof AST_ObjectProperty) { - var obj = scanner.parent(level + 1); - return all(obj.properties, function(prop) { - return prop instanceof AST_ObjectKeyVal; - }) ? find_stop_value(obj, level + 2) : obj; - } - if (parent instanceof AST_PropAccess) { - var exp = parent.expression; - return exp === node ? find_stop_value(parent, level + 1) : node; - } - if (parent instanceof AST_Sequence) { - return (parent.tail_node() === node ? find_stop_value : find_stop_unused)(parent, level + 1); - } - if (parent instanceof AST_SimpleStatement) return find_stop_unused(parent, level + 1); - if (parent instanceof AST_Spread) return find_stop_value(parent, level + 1); - if (parent instanceof AST_Switch) { - if (parent.expression !== node) return node; - return find_stop_value(parent, level + 1); - } - if (parent instanceof AST_Unary) { - if (parent.operator == "delete") return node; - return find_stop_value(parent, level + 1); - } - if (parent instanceof AST_VarDef) return parent.name.match_symbol(function(sym) { - return sym instanceof AST_SymbolDeclaration && (lhs.name == sym.name || value_def.name == sym.name); - }) ? node : find_stop_value(parent, level + 1); - if (parent instanceof AST_While) { - if (parent.condition !== node) return node; - return find_stop_value(parent, level + 1); - } - if (parent instanceof AST_Yield) return find_stop_value(parent, level + 1); - return null; - } - - function find_stop_unused(node, level) { - var parent = scanner.parent(level); - if (is_last_node(node, parent)) return node; - if (in_conditional(node, parent)) return node; - if (parent instanceof AST_Array) return find_stop_unused(parent, level + 1); - if (parent instanceof AST_Assign) return check_assignment(parent.left); - if (parent instanceof AST_Await) return node; - if (parent instanceof AST_Binary) return find_stop_unused(parent, level + 1); - if (parent instanceof AST_Call) return find_stop_unused(parent, level + 1); - if (parent instanceof AST_Case) return find_stop_unused(parent, level + 1); - if (parent instanceof AST_Conditional) return find_stop_unused(parent, level + 1); - if (parent instanceof AST_Definitions) return find_stop_unused(parent, level + 1); - if (parent instanceof AST_Exit) return find_stop_unused(parent, level + 1); - if (parent instanceof AST_If) return find_stop_unused(parent, level + 1); - if (parent instanceof AST_IterationStatement) return node; - if (parent instanceof AST_ObjectProperty) { - var obj = scanner.parent(level + 1); - return all(obj.properties, function(prop) { - return prop instanceof AST_ObjectKeyVal; - }) ? find_stop_unused(obj, level + 2) : obj; - } - if (parent instanceof AST_PropAccess) { - var exp = parent.expression; - if (exp === node) return find_stop_unused(parent, level + 1); - return find_stop_expr(exp, find_stop_unused, node, parent, level); - } - if (parent instanceof AST_Sequence) return find_stop_unused(parent, level + 1); - if (parent instanceof AST_SimpleStatement) return find_stop_unused(parent, level + 1); - if (parent instanceof AST_Spread) return node; - if (parent instanceof AST_Switch) return find_stop_unused(parent, level + 1); - if (parent instanceof AST_Unary) return find_stop_unused(parent, level + 1); - if (parent instanceof AST_VarDef) return check_assignment(parent.name); - if (parent instanceof AST_Yield) return node; - return null; - - function check_assignment(lhs) { - if (may_throw(parent)) return node; - if (lhs !== node && lhs instanceof AST_Destructured) { - return find_stop_expr(lhs, find_stop_unused, node, parent, level); - } - return find_stop_unused(parent, level + 1); - } - } - - function mangleable_var(rhs) { - if (force_single) { - force_single = false; - return; - } - if (remaining < 1) return; - rhs = rhs.tail_node(); - var value = rhs instanceof AST_Assign && rhs.operator == "=" ? rhs.left : rhs; - if (!(value instanceof AST_SymbolRef)) return; - var def = value.definition(); - if (def.undeclared) return; - if (is_arguments(def)) return; - if (value !== rhs) { - if (is_lhs_read_only(value, compressor)) return; - var referenced = def.references.length - def.replaced; - if (referenced < 2) return; - var expr = candidate.clone(); - expr[expr instanceof AST_Assign ? "right" : "value"] = value; - if (candidate.name_index >= 0) { - expr.name_index = candidate.name_index; - expr.arg_index = candidate.arg_index; - } - candidate = expr; - } - return value_def = def; - } - - function remaining_refs(def) { - return def.references.length - def.replaced - (assignments.get(def.name) || 0); - } - - function get_lhs(expr) { - if (expr instanceof AST_Assign) { - var lhs = expr.left; - if (!(lhs instanceof AST_SymbolRef)) return lhs; - var def = lhs.definition(); - if (scope.uses_arguments && is_funarg(def)) return lhs; - if (compressor.exposed(def)) return lhs; - remaining = remaining_refs(def); - if (def.fixed && lhs.fixed) { - var matches = def.references.filter(function(ref) { - return ref.fixed === lhs.fixed; - }).length - 1; - if (matches < remaining) { - remaining = matches; - assign_pos = 0; - verify_ref = true; - } - } - if (expr.operator == "=") mangleable_var(expr.right); - return lhs; - } - if (expr instanceof AST_Binary) return expr.right.left; - if (expr instanceof AST_Unary) return expr.expression; - if (expr instanceof AST_VarDef) { - var lhs = expr.name; - var def = lhs.definition(); - if (def.const_redefs) return; - if (!member(lhs, def.orig)) return; - if (scope.uses_arguments && is_funarg(def)) return; - var declared = def.orig.length - def.eliminated - (declare_only.get(def.name) || 0); - remaining = remaining_refs(def); - if (def.fixed) remaining = Math.min(remaining, def.references.filter(function(ref) { - if (!ref.fixed) return true; - if (!ref.fixed.assigns) return true; - var assign = ref.fixed.assigns[0]; - return assign === lhs || get_rvalue(assign) === expr.value; - }).length); - if (declared > 1 && !(lhs instanceof AST_SymbolFunarg)) { - mangleable_var(expr.value); - return make_node(AST_SymbolRef, lhs); - } - if (mangleable_var(expr.value) || remaining == 1 && !compressor.exposed(def)) { - return make_node(AST_SymbolRef, lhs); - } - return; - } - } - - function get_rvalue(expr) { - if (expr instanceof AST_Assign) return expr.right; - if (expr instanceof AST_Binary) { - var node = expr.clone(); - node.right = expr.right.right; - return node; - } - if (expr instanceof AST_VarDef) return expr.value; - } - - function invariant(expr) { - if (expr instanceof AST_Array) return false; - if (expr instanceof AST_Binary && lazy_op[expr.operator]) { - return invariant(expr.left) && invariant(expr.right); - } - if (expr instanceof AST_Call) return false; - if (expr instanceof AST_Conditional) { - return invariant(expr.consequent) && invariant(expr.alternative); - } - if (expr instanceof AST_Object) return false; - return !expr.has_side_effects(compressor); - } - - function foldable(expr) { - if (expr instanceof AST_Assign && expr.right.single_use) return; - var lhs_ids = Object.create(null); - var marker = new TreeWalker(function(node) { - if (node instanceof AST_SymbolRef) lhs_ids[node.definition().id] = true; - }); - while (expr instanceof AST_Assign && expr.operator == "=") { - expr.left.walk(marker); - expr = expr.right; - } - if (expr instanceof AST_ObjectIdentity) return rhs_exact_match; - if (expr instanceof AST_SymbolRef) { - var value = expr.evaluate(compressor); - if (value === expr) return rhs_exact_match; - return rhs_fuzzy_match(value, rhs_exact_match); - } - if (expr.is_truthy()) return rhs_fuzzy_match(true, return_false); - if (expr.is_constant()) { - var ev = expr.evaluate(compressor); - if (!(ev instanceof AST_Node)) return rhs_fuzzy_match(ev, rhs_exact_match); - } - if (!(lhs instanceof AST_SymbolRef)) return false; - if (!invariant(expr)) return false; - var circular; - expr.walk(new TreeWalker(function(node) { - if (circular) return true; - if (node instanceof AST_SymbolRef && lhs_ids[node.definition().id]) circular = true; - })); - return !circular && rhs_exact_match; - - function rhs_exact_match(node) { - return expr.equals(node); - } - } - - function rhs_fuzzy_match(value, fallback) { - return function(node, tw) { - if (tw.in_boolean_context()) { - if (value && node.is_truthy() && !node.has_side_effects(compressor)) { - return true; - } - if (node.is_constant()) { - var ev = node.evaluate(compressor); - if (!(ev instanceof AST_Node)) return !ev == !value; - } - } - return fallback(node); - }; - } - - function clear_write_only(assign) { - while (assign.write_only) { - assign.write_only = false; - if (!(assign instanceof AST_Assign)) break; - assign = assign.right; - } - } - - function update_symbols(value, node) { - var scope = node.scope || find_scope(scanner) || block_scope; - value.walk(new TreeWalker(function(node) { - if (node instanceof AST_BlockScope) return true; - if (node instanceof AST_Symbol) node.scope = scope; - })); - } - - function may_be_global(node) { - if (node instanceof AST_SymbolRef) { - node = node.fixed_value(); - if (!node) return true; - } - if (node instanceof AST_Assign) return node.operator == "=" && may_be_global(node.right); - return node instanceof AST_PropAccess || node instanceof AST_ObjectIdentity; - } - - function get_lvalues(expr) { - var lvalues = new Dictionary(); - if (expr instanceof AST_VarDef) { - if (!expr.name.definition().fixed) well_defined = false; - lvalues.add(expr.name.name, lhs); - } - var find_arguments = scope.uses_arguments && !compressor.has_directive("use strict"); - var scan_toplevel = scope instanceof AST_Toplevel; - var tw = new TreeWalker(function(node) { - var value; - if (node instanceof AST_SymbolRef) { - value = node.fixed_value(); - if (!value) { - value = node; - var def = node.definition(); - var escaped = node.fixed && node.fixed.escaped || def.escaped; - if (!def.undeclared - && (def.assignments || !escaped || escaped.cross_scope) - && (has_escaped(def, node.scope, node, tw.parent()) || !same_scope(def))) { - well_defined = false; - } - } - } else if (node instanceof AST_ObjectIdentity) { - value = node; - } - if (value) { - lvalues.add(node.name, is_modified(compressor, tw, node, value, 0)); - } else if (node instanceof AST_Lambda) { - for (var level = 0, parent, child = node; parent = tw.parent(level++); child = parent) { - if (parent instanceof AST_Assign) { - if (parent.left === child) break; - if (parent.operator == "=") continue; - if (lazy_op[parent.operator.slice(0, -1)]) continue; - break; - } - if (parent instanceof AST_Binary) { - if (lazy_op[parent.operator]) continue; - break; - } - if (parent instanceof AST_Call) return; - if (parent instanceof AST_Scope) return; - if (parent instanceof AST_Sequence) { - if (parent.tail_node() === child) continue; - break; - } - if (parent instanceof AST_Template) { - if (parent.tag) return; - break; - } - } - node.enclosed.forEach(function(def) { - if (def.scope !== node) enclosed.set(def.name, true); - }); - return true; - } else if (find_arguments && node instanceof AST_Sub) { - scope.each_argname(function(argname) { - if (!compressor.option("reduce_vars") || argname.definition().assignments) { - if (!argname.definition().fixed) well_defined = false; - lvalues.add(argname.name, true); - } - }); - find_arguments = false; - } - if (!scan_toplevel) return; - if (node.TYPE == "Call") { - if (modify_toplevel) return; - var exp = node.expression; - if (exp instanceof AST_PropAccess) return; - if (exp instanceof AST_LambdaExpression && !exp.contains_this()) return; - modify_toplevel = true; - } else if (node instanceof AST_PropAccess && may_be_global(node.expression)) { - if (node === lhs && !(expr instanceof AST_Unary)) { - modify_toplevel = true; - } else { - read_toplevel = true; - } - } - }); - expr.walk(tw); - return lvalues; - } - - function remove_candidate(expr) { - var value = rvalue === rhs_value ? null : make_sequence(rhs_value, rhs_value.expressions.slice(0, -1)); - var index = expr.name_index; - if (index >= 0) { - var args, argname = scope.argnames[index]; - if (argname instanceof AST_DefaultValue) { - scope.argnames[index] = argname = argname.clone(); - argname.value = value || make_node(AST_Number, argname, { value: 0 }); - } else if ((args = compressor.parent().args)[index]) { - scope.argnames[index] = argname.clone(); - args[index] = value || make_node(AST_Number, args[index], { value: 0 }); - } - return; - } - var end = hit_stack.length - 1; - var last = hit_stack[end]; - if (last instanceof AST_VarDef || hit_stack[end - 1].body === last) end--; - var tt = new TreeTransformer(function(node, descend, in_list) { - if (hit) return node; - if (node !== hit_stack[hit_index]) return node; - hit_index++; - if (hit_index <= end) return handle_custom_scan_order(node, tt); - hit = true; - if (node instanceof AST_Definitions) { - declare_only.set(last.name.name, (declare_only.get(last.name.name) || 0) + 1); - if (value_def) value_def.replaced++; - var defns = node.definitions; - var index = defns.indexOf(last); - var defn = last.clone(); - defn.value = null; - if (!value) { - node.definitions[index] = defn; - return node; - } - var body = [ make_node(AST_SimpleStatement, value, { body: value }) ]; - if (index > 0) { - var head = node.clone(); - head.definitions = defns.slice(0, index); - body.unshift(head); - node = node.clone(); - node.definitions = defns.slice(index); - } - body.push(node); - node.definitions[0] = defn; - return in_list ? List.splice(body) : make_node(AST_BlockStatement, node, { body: body }); - } - if (!value) return in_list ? List.skip : null; - return is_statement(node) ? make_node(AST_SimpleStatement, value, { body: value }) : value; - }, function(node, in_list) { - if (node instanceof AST_For) return patch_for_init(node, in_list); - return patch_sequence(node, tt); - }); - abort = false; - hit = false; - hit_index = 0; - if (!(statements[stat_index] = statements[stat_index].transform(tt))) statements.splice(stat_index, 1); - } - - function patch_sequence(node, tt) { - if (node instanceof AST_Sequence) switch (node.expressions.length) { - case 0: return null; - case 1: return maintain_this_binding(tt.parent(), node, node.expressions[0]); - } - } - - function is_lhs_local(lhs) { - var sym = root_expr(lhs); - if (!(sym instanceof AST_SymbolRef)) return false; - if (sym.definition().scope.resolve() !== scope) return false; - if (!in_loop) return true; - if (compound) return false; - if (candidate instanceof AST_Unary) return false; - var lvalue = lvalues.get(sym.name); - return !lvalue || lvalue[0] === lhs; - } - - function value_has_side_effects() { - if (candidate instanceof AST_Unary) return false; - return rvalue.has_side_effects(compressor); - } - - function replace_all_symbols(expr) { - if (expr instanceof AST_Unary) return false; - if (side_effects) return false; - if (value_def) return true; - if (!(lhs instanceof AST_SymbolRef)) return false; - var referenced; - if (expr instanceof AST_VarDef) { - referenced = 1; - } else if (expr.operator == "=") { - referenced = 2; - } else { - return false; - } - var def = lhs.definition(); - if (def.references.length - def.replaced == referenced) return true; - if (!def.fixed) return false; - if (!lhs.fixed) return false; - var assigns = lhs.fixed.assigns; - var matched = 0; - if (!all(def.references, function(ref, index) { - var fixed = ref.fixed; - if (!fixed) return false; - if (fixed.to_binary || fixed.to_prefix) return false; - if (fixed === lhs.fixed) { - matched++; - return true; - } - return assigns && fixed.assigns && assigns[0] !== fixed.assigns[0]; - })) return false; - if (matched != referenced) return false; - verify_ref = true; - return true; - } - - function symbol_in_lvalues(sym, parent) { - var lvalue = lvalues.get(sym.name); - if (!lvalue || all(lvalue, function(lhs) { - return !lhs; - })) return; - if (lvalue[0] !== lhs) return true; - scan_rhs = false; - } - - function may_modify(sym) { - var def = sym.definition(); - if (def.orig.length == 1 && def.orig[0] instanceof AST_SymbolDefun) return false; - if (def.scope.resolve() !== scope) return true; - if (modify_toplevel && compressor.exposed(def)) return true; - return !all(def.references, function(ref) { - return ref.scope.resolve(true) === scope; - }); - } - - function side_effects_external(node, lhs) { - if (node instanceof AST_Assign) return side_effects_external(node.left, true); - if (node instanceof AST_Unary) return side_effects_external(node.expression, true); - if (node instanceof AST_VarDef) return node.value && side_effects_external(node.value); - if (lhs) { - if (node instanceof AST_Dot) return side_effects_external(node.expression, true); - if (node instanceof AST_Sub) return side_effects_external(node.expression, true); - if (node instanceof AST_SymbolRef) return node.definition().scope.resolve() !== scope; - } - return false; - } - } - - function eliminate_spurious_blocks(statements) { - var changed = false, seen_dirs = []; - for (var i = 0; i < statements.length;) { - var stat = statements[i]; - if (stat instanceof AST_BlockStatement) { - if (all(stat.body, safe_to_trim)) { - changed = true; - eliminate_spurious_blocks(stat.body); - [].splice.apply(statements, [i, 1].concat(stat.body)); - i += stat.body.length; - continue; - } - } - if (stat instanceof AST_Directive) { - if (member(stat.value, seen_dirs)) { - changed = true; - statements.splice(i, 1); - continue; - } - seen_dirs.push(stat.value); - } - if (stat instanceof AST_EmptyStatement) { - changed = true; - statements.splice(i, 1); - continue; - } - i++; - } - return changed; - } - - function handle_if_return(statements, compressor) { - var changed = false; - var parent = compressor.parent(); - var self = compressor.self(); - var declare_only, jump, merge_jump; - var in_iife = in_lambda && parent && parent.TYPE == "Call" && parent.expression === self; - var chain_if_returns = in_lambda && compressor.option("conditionals") && compressor.option("sequences"); - var drop_return_void = !(in_try && in_try.bfinally && in_async_generator(scope)); - var multiple_if_returns = has_multiple_if_returns(statements); - for (var i = statements.length; --i >= 0;) { - var stat = statements[i]; - var j = next_index(i); - var next = statements[j]; - - if (in_lambda && declare_only && !next && stat instanceof AST_Return - && drop_return_void && !(self instanceof AST_SwitchBranch)) { - var body = stat.value; - if (!body) { - changed = true; - statements.splice(i, 1); - continue; - } - var tail = body.tail_node(); - if (is_undefined(tail)) { - changed = true; - if (body instanceof AST_UnaryPrefix) { - body = body.expression; - } else if (tail instanceof AST_UnaryPrefix) { - body = body.clone(); - body.expressions[body.expressions.length - 1] = tail.expression; - } - statements[i] = make_node(AST_SimpleStatement, stat, { body: body }); - continue; - } - } - - if (stat instanceof AST_If) { - var ab = aborts(stat.body); - // if (foo()) { bar(); return; } else baz(); moo(); ---> if (foo()) bar(); else { baz(); moo(); } - if (can_merge_flow(ab)) { - if (ab.label) remove(ab.label.thedef.references, ab); - changed = true; - stat = stat.clone(); - stat.body = make_node(AST_BlockStatement, stat, { - body: as_statement_array_with_return(stat.body, ab), - }); - stat.alternative = make_node(AST_BlockStatement, stat, { - body: as_statement_array(stat.alternative).concat(extract_functions(merge_jump, jump)), - }); - adjust_refs(ab.value, merge_jump); - statements[i] = stat; - statements[i] = stat.transform(compressor); - continue; - } - // if (foo()) { bar(); return x; } return y; ---> if (!foo()) return y; bar(); return x; - if (ab && !stat.alternative && next instanceof AST_Jump) { - var cond = stat.condition; - var preference = i + 1 == j && stat.body instanceof AST_BlockStatement; - cond = best_of_expression(cond, cond.negate(compressor), preference); - if (cond !== stat.condition) { - changed = true; - stat = stat.clone(); - stat.condition = cond; - var body = stat.body; - stat.body = make_node(AST_BlockStatement, next, { - body: extract_functions(true, null, j + 1), - }); - statements.splice(i, 1, stat, body); - // proceed further only if `TreeWalker.stack` is in a consistent state - // https://github.com/mishoo/UglifyJS/issues/5595 - // https://github.com/mishoo/UglifyJS/issues/5597 - if (!in_lambda || self instanceof AST_Block && self.body === statements) { - statements[i] = stat.transform(compressor); - } - continue; - } - } - var alt = aborts(stat.alternative); - // if (foo()) bar(); else { baz(); return; } moo(); ---> if (foo()) { bar(); moo(); } else baz(); - if (can_merge_flow(alt)) { - if (alt.label) remove(alt.label.thedef.references, alt); - changed = true; - stat = stat.clone(); - stat.body = make_node(AST_BlockStatement, stat.body, { - body: as_statement_array(stat.body).concat(extract_functions(merge_jump, jump)), - }); - stat.alternative = make_node(AST_BlockStatement, stat.alternative, { - body: as_statement_array_with_return(stat.alternative, alt), - }); - adjust_refs(alt.value, merge_jump); - statements[i] = stat; - statements[i] = stat.transform(compressor); - continue; - } - if (compressor.option("typeofs")) { - if (ab && !alt) { - var stats = make_node(AST_BlockStatement, self, { body: statements.slice(i + 1) }); - mark_locally_defined(stat.condition, null, stats); - } - if (!ab && alt) { - var stats = make_node(AST_BlockStatement, self, { body: statements.slice(i + 1) }); - mark_locally_defined(stat.condition, stats); - } - } - } - - if (stat instanceof AST_If && stat.body instanceof AST_Return) { - var value = stat.body.value; - var in_bool = stat.body.in_bool || next instanceof AST_Return && next.in_bool; - // if (foo()) return x; return y; ---> return foo() ? x : y; - if (!stat.alternative && next instanceof AST_Return - && (drop_return_void || !value == !next.value)) { - changed = true; - stat = stat.clone(); - stat.alternative = make_node(AST_BlockStatement, next, { - body: extract_functions(true, null, j + 1), - }); - statements[i] = stat; - statements[i] = stat.transform(compressor); - continue; - } - // if (foo()) return x; [ return ; ] ---> return foo() ? x : undefined; - // if (foo()) return bar() ? x : void 0; ---> return foo() && bar() ? x : void 0; - // if (foo()) return bar() ? void 0 : x; ---> return !foo() || bar() ? void 0 : x; - if (in_lambda && declare_only && !next && !stat.alternative && (in_bool - || value && multiple_if_returns - || value instanceof AST_Conditional && (is_undefined(value.consequent, compressor) - || is_undefined(value.alternative, compressor)))) { - changed = true; - stat = stat.clone(); - stat.alternative = make_node(AST_Return, stat, { value: null }); - statements[i] = stat; - statements[i] = stat.transform(compressor); - continue; - } - // if (a) return b; if (c) return d; e; ---> return a ? b : c ? d : void e; - // - // if sequences is not enabled, this can lead to an endless loop (issue #866). - // however, with sequences on this helps producing slightly better output for - // the example code. - var prev, prev_stat; - if (chain_if_returns && !stat.alternative - && (!(prev_stat = statements[prev = prev_index(i)]) && in_iife - || prev_stat instanceof AST_If && prev_stat.body instanceof AST_Return) - && (!next ? !declare_only - : next instanceof AST_SimpleStatement && next_index(j) == statements.length)) { - changed = true; - var exprs = []; - stat = stat.clone(); - exprs.push(stat.condition); - stat.condition = make_sequence(stat, exprs); - stat.alternative = make_node(AST_BlockStatement, self, { - body: extract_functions().concat(make_node(AST_Return, self, { value: null })), - }); - statements[i] = stat.transform(compressor); - i = prev + 1; - continue; - } - } - - if (stat instanceof AST_Break || stat instanceof AST_Exit) { - jump = stat; - continue; - } - - if (declare_only && jump && jump === next) eliminate_returns(stat); - } - return changed; - - function has_multiple_if_returns(statements) { - var n = 0; - for (var i = statements.length; --i >= 0;) { - var stat = statements[i]; - if (stat instanceof AST_If && stat.body instanceof AST_Return) { - if (++n > 1) return true; - } - } - return false; - } - - function match_target(target) { - return last_of(compressor, function(node) { - return node === target; - }); - } - - function match_return(ab, exact) { - if (!jump) return false; - if (jump.TYPE != ab.TYPE) return false; - var value = ab.value; - if (!value) return false; - var equals = jump.equals(ab); - if (!equals && value instanceof AST_Sequence) { - value = value.tail_node(); - if (jump.value && jump.value.equals(value)) equals = 2; - } - if (!equals && !exact && jump.value instanceof AST_Sequence) { - if (jump.value.tail_node().equals(value)) equals = 3; - } - return equals; - } - - function can_drop_abort(ab) { - if (ab instanceof AST_Exit) { - if (merge_jump = match_return(ab)) return true; - if (!in_lambda) return false; - if (!(ab instanceof AST_Return)) return false; - var value = ab.value; - if (value && !is_undefined(value.tail_node())) return false; - if (!(self instanceof AST_SwitchBranch)) return true; - if (!jump) return false; - if (jump instanceof AST_Exit && jump.value) return false; - merge_jump = 4; - return true; - } - if (!(ab instanceof AST_LoopControl)) return false; - if (self instanceof AST_SwitchBranch) { - if (jump instanceof AST_Exit) { - if (!in_lambda) return false; - if (jump.value) return false; - merge_jump = true; - } else if (jump) { - if (compressor.loopcontrol_target(jump) !== parent) return false; - merge_jump = true; - } else if (jump === false) { - return false; - } - } - var lct = compressor.loopcontrol_target(ab); - if (ab instanceof AST_Continue) return match_target(loop_body(lct)); - if (lct instanceof AST_IterationStatement) return false; - return match_target(lct); - } - - function can_merge_flow(ab) { - merge_jump = false; - if (!can_drop_abort(ab)) return false; - for (var j = statements.length; --j > i;) { - var stat = statements[j]; - if (stat instanceof AST_DefClass) { - if (stat.name.definition().preinit) return false; - } else if (stat instanceof AST_Const || stat instanceof AST_Let) { - if (!all(stat.definitions, function(defn) { - return !defn.name.match_symbol(function(node) { - return node instanceof AST_SymbolDeclaration && node.definition().preinit; - }); - })) return false; - } - } - return true; - } - - function extract_functions(mode, stop, end) { - var defuns = []; - var lexical = false; - var start = i + 1; - if (!mode) { - end = statements.length; - jump = null; - } else if (stop) { - end = statements.lastIndexOf(stop); - } else { - stop = statements[end]; - if (stop !== jump) jump = false; - } - var tail = statements.splice(start, end - start).filter(function(stat) { - if (stat instanceof AST_LambdaDefinition) { - defuns.push(stat); - return false; - } - if (is_lexical_definition(stat)) lexical = true; - return true; - }); - if (mode === 3) { - tail.push(make_node(AST_SimpleStatement, stop.value, { - body: make_sequence(stop.value, stop.value.expressions.slice(0, -1)), - })); - stop.value = stop.value.tail_node(); - } - [].push.apply(lexical ? tail : statements, defuns); - return tail; - } - - function trim_return(value, mode) { - if (value) switch (mode) { - case 4: - return value; - case 3: - if (!(value instanceof AST_Sequence)) break; - case 2: - return make_sequence(value, value.expressions.slice(0, -1)); - } - } - - function as_statement_array_with_return(node, ab) { - var body = as_statement_array(node); - var block = body, last; - while ((last = block[block.length - 1]) !== ab) { - block = last.body; - } - block.pop(); - var value = ab.value; - if (merge_jump) value = trim_return(value, merge_jump); - if (value) block.push(make_node(AST_SimpleStatement, value, { body: value })); - return body; - } - - function adjust_refs(value, mode) { - if (!mode) return; - if (!value) return; - switch (mode) { - case 4: - return; - case 3: - case 2: - value = value.tail_node(); - } - merge_expression(value, jump.value); - } - - function next_index(i) { - declare_only = true; - for (var j = i; ++j < statements.length;) { - var stat = statements[j]; - if (is_declaration(stat)) continue; - if (stat instanceof AST_Var) { - declare_only = false; - continue; - } - break; - } - return j; - } - - function prev_index(i) { - for (var j = i; --j >= 0;) { - var stat = statements[j]; - if (stat instanceof AST_Var) continue; - if (is_declaration(stat)) continue; - break; - } - return j; - } - - function eliminate_returns(stat, keep_throws, in_block) { - if (stat instanceof AST_Exit) { - var mode = !(keep_throws && stat instanceof AST_Throw) && match_return(stat, true); - if (mode) { - changed = true; - var value = trim_return(stat.value, mode); - if (value) return make_node(AST_SimpleStatement, value, { body: value }); - return in_block ? null : make_node(AST_EmptyStatement, stat); - } - } else if (stat instanceof AST_If) { - stat.body = eliminate_returns(stat.body, keep_throws); - if (stat.alternative) stat.alternative = eliminate_returns(stat.alternative, keep_throws); - } else if (stat instanceof AST_LabeledStatement) { - stat.body = eliminate_returns(stat.body, keep_throws); - } else if (stat instanceof AST_Try) { - if (!stat.bfinally || !jump.value || jump.value.is_constant()) { - if (stat.bcatch) eliminate_returns(stat.bcatch, keep_throws); - var trimmed = eliminate_returns(stat.body.pop(), true, true); - if (trimmed) stat.body.push(trimmed); - } - } else if (stat instanceof AST_Block && !(stat instanceof AST_Scope || stat instanceof AST_Switch)) { - var trimmed = eliminate_returns(stat.body.pop(), keep_throws, true); - if (trimmed) stat.body.push(trimmed); - } - return stat; - } - } - - function eliminate_dead_code(statements, compressor) { - var has_quit; - var self = compressor.self(); - if (self instanceof AST_Catch) { - self = compressor.parent(); - } else if (self instanceof AST_LabeledStatement) { - self = self.body; - } - for (var i = 0, n = 0, len = statements.length; i < len; i++) { - var stat = statements[i]; - if (stat instanceof AST_LoopControl) { - var lct = compressor.loopcontrol_target(stat); - if (loop_body(lct) !== self - || stat instanceof AST_Break && lct instanceof AST_IterationStatement) { - statements[n++] = stat; - } else if (stat.label) { - remove(stat.label.thedef.references, stat); - } - } else { - statements[n++] = stat; - } - if (aborts(stat)) { - has_quit = statements.slice(i + 1); - break; - } - } - statements.length = n; - if (has_quit) has_quit.forEach(function(stat) { - extract_declarations_from_unreachable_code(compressor, stat, statements); - }); - return statements.length != len; - } - - function trim_awaits(statements, compressor) { - if (!in_lambda || in_try && in_try.bfinally) return; - var changed = false; - for (var index = statements.length; --index >= 0;) { - var stat = statements[index]; - if (!(stat instanceof AST_SimpleStatement)) break; - var node = stat.body; - if (!(node instanceof AST_Await)) break; - var exp = node.expression; - if (!needs_enqueuing(compressor, exp)) break; - changed = true; - exp = exp.drop_side_effect_free(compressor, true); - if (exp) { - stat.body = exp; - break; - } - } - statements.length = index + 1; - return changed; - } - - function inline_iife(statements, compressor) { - var changed = false; - var index = statements.length - 1; - if (in_lambda && index >= 0) { - var no_return = in_try && in_try.bfinally && in_async_generator(scope); - var inlined = statements[index].try_inline(compressor, block_scope, no_return); - if (inlined) { - statements[index--] = inlined; - changed = true; - } - } - var loop = in_loop && in_try && in_try.bfinally ? "try" : in_loop; - for (; index >= 0; index--) { - var inlined = statements[index].try_inline(compressor, block_scope, true, loop); - if (!inlined) continue; - statements[index] = inlined; - changed = true; - } - return changed; - } - - function sequencesize(statements, compressor) { - if (statements.length < 2) return; - var seq = [], n = 0; - function push_seq() { - if (!seq.length) return; - var body = make_sequence(seq[0], seq); - statements[n++] = make_node(AST_SimpleStatement, body, { body: body }); - seq = []; - } - for (var i = 0, len = statements.length; i < len; i++) { - var stat = statements[i]; - if (stat instanceof AST_SimpleStatement) { - if (seq.length >= compressor.sequences_limit) push_seq(); - merge_sequence(seq, stat.body); - } else if (is_declaration(stat)) { - statements[n++] = stat; - } else { - push_seq(); - statements[n++] = stat; - } - } - push_seq(); - statements.length = n; - return n != len; - } - - function to_simple_statement(block, decls) { - if (!(block instanceof AST_BlockStatement)) return block; - var stat = null; - for (var i = 0; i < block.body.length; i++) { - var line = block.body[i]; - if (line instanceof AST_Var && declarations_only(line)) { - decls.push(line); - } else if (stat || is_lexical_definition(line)) { - return false; - } else { - stat = line; - } - } - return stat; - } - - function sequencesize_2(statements, compressor) { - var changed = false, n = 0, prev; - for (var i = 0; i < statements.length; i++) { - var stat = statements[i]; - if (prev) { - if (stat instanceof AST_Exit) { - if (stat.value || !in_async_generator(scope)) { - stat.value = cons_seq(stat.value || make_node(AST_Undefined, stat)).optimize(compressor); - } - } else if (stat instanceof AST_For) { - if (!(stat.init instanceof AST_Definitions)) { - var abort = false; - prev.body.walk(new TreeWalker(function(node) { - if (abort || node instanceof AST_Scope) return true; - if (node instanceof AST_Binary && node.operator == "in") { - abort = true; - return true; - } - })); - if (!abort) { - if (stat.init) stat.init = cons_seq(stat.init); - else { - stat.init = prev.body; - n--; - changed = true; - } - } - } - } else if (stat instanceof AST_ForIn) { - if (!is_lexical_definition(stat.init)) stat.object = cons_seq(stat.object); - } else if (stat instanceof AST_If) { - stat.condition = cons_seq(stat.condition); - } else if (stat instanceof AST_Switch) { - stat.expression = cons_seq(stat.expression); - } else if (stat instanceof AST_With) { - stat.expression = cons_seq(stat.expression); - } - } - if (compressor.option("conditionals") && stat instanceof AST_If) { - var decls = []; - var body = to_simple_statement(stat.body, decls); - var alt = to_simple_statement(stat.alternative, decls); - if (body !== false && alt !== false && decls.length > 0) { - var len = decls.length; - decls.push(make_node(AST_If, stat, { - condition: stat.condition, - body: body || make_node(AST_EmptyStatement, stat.body), - alternative: alt, - })); - decls.unshift(n, 1); - [].splice.apply(statements, decls); - i += len; - n += len + 1; - prev = null; - changed = true; - continue; - } - } - statements[n++] = stat; - prev = stat instanceof AST_SimpleStatement ? stat : null; - } - statements.length = n; - return changed; - - function cons_seq(right) { - n--; - changed = true; - var left = prev.body; - return make_sequence(left, [ left, right ]); - } - } - - function extract_exprs(body) { - if (body instanceof AST_Assign) return [ body ]; - if (body instanceof AST_Sequence) return body.expressions.slice(); - } - - function join_assigns(defn, body, keep) { - var exprs = extract_exprs(body); - if (!exprs) return; - keep = keep || 0; - var trimmed = false; - for (var i = exprs.length - keep; --i >= 0;) { - var expr = exprs[i]; - if (!can_trim(expr)) continue; - var tail; - if (expr.left instanceof AST_SymbolRef) { - tail = exprs.slice(i + 1); - } else if (expr.left instanceof AST_PropAccess && can_trim(expr.left.expression)) { - tail = exprs.slice(i + 1); - var flattened = expr.clone(); - expr = expr.left.expression; - flattened.left = flattened.left.clone(); - flattened.left.expression = expr.left.clone(); - tail.unshift(flattened); - } else { - continue; - } - if (tail.length == 0) continue; - if (!trim_assigns(expr.left, expr.right, tail)) continue; - trimmed = true; - exprs = exprs.slice(0, i).concat(expr, tail); - } - if (defn instanceof AST_Definitions) { - for (var i = defn.definitions.length; --i >= 0;) { - var def = defn.definitions[i]; - if (!def.value) continue; - if (trim_assigns(def.name, def.value, exprs)) trimmed = true; - if (merge_conditional_assignments(def, exprs, keep)) trimmed = true; - break; - } - if (defn instanceof AST_Var && join_var_assign(defn.definitions, exprs, keep)) trimmed = true; - } - return trimmed && exprs; - - function can_trim(node) { - return node instanceof AST_Assign && node.operator == "="; - } - } - - function merge_assigns(prev, defn) { - if (!(prev instanceof AST_SimpleStatement)) return; - if (declarations_only(defn)) return; - var exprs = extract_exprs(prev.body); - if (!exprs) return; - var definitions = []; - if (!join_var_assign(definitions, exprs.reverse(), 0)) return; - defn.definitions = definitions.reverse().concat(defn.definitions); - return exprs.reverse(); - } - - function merge_conditional_assignments(var_def, exprs, keep) { - if (!compressor.option("conditionals")) return; - if (var_def.name instanceof AST_Destructured) return; - var trimmed = false; - var def = var_def.name.definition(); - while (exprs.length > keep) { - var cond = to_conditional_assignment(compressor, def, var_def.value, exprs[0]); - if (!cond) break; - var_def.value = cond; - exprs.shift(); - trimmed = true; - } - return trimmed; - } - - function join_var_assign(definitions, exprs, keep) { - var trimmed = false; - while (exprs.length > keep) { - var expr = exprs[0]; - if (!(expr instanceof AST_Assign)) break; - if (expr.operator != "=") break; - var lhs = expr.left; - if (!(lhs instanceof AST_SymbolRef)) break; - if (is_undeclared_ref(lhs)) break; - if (lhs.scope.resolve() !== scope) break; - var def = lhs.definition(); - if (def.scope !== scope) break; - if (def.orig.length > def.eliminated + 1) break; - if (def.orig[0].TYPE != "SymbolVar") break; - var name = make_node(AST_SymbolVar, lhs); - definitions.push(make_node(AST_VarDef, expr, { - name: name, - value: expr.right, - })); - def.orig.push(name); - def.replaced++; - exprs.shift(); - trimmed = true; - } - return trimmed; - } - - function trim_assigns(name, value, exprs) { - var names = new Dictionary(); - names.set(name.name, true); - while (value instanceof AST_Assign && value.operator == "=") { - if (value.left instanceof AST_SymbolRef) names.set(value.left.name, true); - value = value.right; - } - if (!(value instanceof AST_Object)) return; - var trimmed = false; - do { - if (!try_join(exprs[0])) break; - exprs.shift(); - trimmed = true; - } while (exprs.length); - return trimmed; - - function try_join(node) { - if (!(node instanceof AST_Assign)) return; - if (node.operator != "=") return; - if (!(node.left instanceof AST_PropAccess)) return; - var sym = node.left.expression; - if (!(sym instanceof AST_SymbolRef)) return; - if (!names.has(sym.name)) return; - if (!node.right.is_constant_expression(scope)) return; - var prop = node.left.property; - if (prop instanceof AST_Node) { - if (try_join(prop)) prop = node.left.property = prop.right.clone(); - prop = prop.evaluate(compressor); - } - if (prop instanceof AST_Node) return; - prop = "" + prop; - var diff = prop == "__proto__" || compressor.has_directive("use strict") ? function(node) { - var key = node.key; - return typeof key == "string" && key != prop && key != "__proto__"; - } : function(node) { - var key = node.key; - if (node instanceof AST_ObjectGetter || node instanceof AST_ObjectSetter) { - return typeof key == "string" && key != prop; - } - return key !== "__proto__"; - }; - if (!all(value.properties, diff)) return; - value.properties.push(make_node(AST_ObjectKeyVal, node, { - key: prop, - value: node.right, - })); - return true; - } - } - - function join_consecutive_vars(statements) { - var changed = false, defs; - for (var i = 0, j = -1; i < statements.length; i++) { - var stat = statements[i]; - var prev = statements[j]; - if (stat instanceof AST_Definitions) { - if (prev && prev.TYPE == stat.TYPE) { - prev.definitions = prev.definitions.concat(stat.definitions); - changed = true; - } else if (defs && defs.TYPE == stat.TYPE && declarations_only(stat)) { - defs.definitions = defs.definitions.concat(stat.definitions); - changed = true; - } else if (stat instanceof AST_Var) { - var exprs = merge_assigns(prev, stat); - if (exprs) { - if (exprs.length) { - prev.body = make_sequence(prev, exprs); - j++; - } - changed = true; - } else { - j++; - } - statements[j] = defs = stat; - } else { - statements[++j] = stat; - } - continue; - } else if (stat instanceof AST_Exit) { - stat.value = join_assigns_expr(stat.value); - } else if (stat instanceof AST_For) { - var exprs = join_assigns(prev, stat.init); - if (exprs) { - changed = true; - stat.init = exprs.length ? make_sequence(stat.init, exprs) : null; - } else if (prev instanceof AST_Var && (!stat.init || stat.init.TYPE == prev.TYPE)) { - if (stat.init) { - prev.definitions = prev.definitions.concat(stat.init.definitions); - } - stat = stat.clone(); - defs = stat.init = prev; - statements[j] = merge_defns(stat); - changed = true; - continue; - } else if (defs && stat.init && defs.TYPE == stat.init.TYPE && declarations_only(stat.init)) { - defs.definitions = defs.definitions.concat(stat.init.definitions); - stat.init = null; - changed = true; - } else if (stat.init instanceof AST_Var) { - defs = stat.init; - exprs = merge_assigns(prev, stat.init); - if (exprs) { - changed = true; - if (exprs.length == 0) { - statements[j] = merge_defns(stat); - continue; - } - prev.body = make_sequence(prev, exprs); - } - } - } else if (stat instanceof AST_ForEnumeration) { - if (defs && defs.TYPE == stat.init.TYPE) { - var defns = defs.definitions.slice(); - stat.init = stat.init.definitions[0].name.convert_symbol(AST_SymbolRef, function(ref, name) { - defns.push(make_node(AST_VarDef, name, { - name: name, - value: null, - })); - name.definition().references.push(ref); - }); - defs.definitions = defns; - changed = true; - } - stat.object = join_assigns_expr(stat.object); - } else if (stat instanceof AST_If) { - stat.condition = join_assigns_expr(stat.condition); - } else if (stat instanceof AST_SimpleStatement) { - var exprs = join_assigns(prev, stat.body), next; - if (exprs) { - changed = true; - if (!exprs.length) continue; - stat.body = make_sequence(stat.body, exprs); - } else if (prev instanceof AST_Definitions - && (next = statements[i + 1]) - && prev.TYPE == next.TYPE - && (next = next.definitions[0]).value) { - changed = true; - next.value = make_sequence(stat, [ stat.body, next.value ]); - continue; - } - } else if (stat instanceof AST_Switch) { - stat.expression = join_assigns_expr(stat.expression); - } else if (stat instanceof AST_With) { - stat.expression = join_assigns_expr(stat.expression); - } - statements[++j] = defs ? merge_defns(stat) : stat; - } - statements.length = j + 1; - return changed; - - function join_assigns_expr(value) { - var exprs = join_assigns(prev, value, 1); - if (!exprs) return value; - changed = true; - var tail = value.tail_node(); - if (exprs[exprs.length - 1] !== tail) exprs.push(tail.left); - return make_sequence(value, exprs); - } - - function merge_defns(stat) { - return stat.transform(new TreeTransformer(function(node, descend, in_list) { - if (node instanceof AST_Definitions) { - if (defs === node) return node; - if (defs.TYPE != node.TYPE) return node; - var parent = this.parent(); - if (parent instanceof AST_ForEnumeration && parent.init === node) return node; - if (!declarations_only(node)) return node; - defs.definitions = defs.definitions.concat(node.definitions); - changed = true; - if (parent instanceof AST_For && parent.init === node) return null; - return in_list ? List.skip : make_node(AST_EmptyStatement, node); - } - if (node instanceof AST_ExportDeclaration) return node; - if (node instanceof AST_Scope) return node; - if (!is_statement(node)) return node; - })); - } - } - } - - function extract_declarations_from_unreachable_code(compressor, stat, target) { - var block; - var dropped = false; - stat.walk(new TreeWalker(function(node, descend) { - if (node instanceof AST_DefClass) { - node.extends = null; - node.properties = []; - push(node); - return true; - } - if (node instanceof AST_Definitions) { - var defns = []; - if (node.remove_initializers(compressor, defns)) { - AST_Node.warn("Dropping initialization in unreachable code [{start}]", node); - } - if (defns.length > 0) { - node.definitions = defns; - push(node); - } - return true; - } - if (node instanceof AST_LambdaDefinition) { - push(node); - return true; - } - if (node instanceof AST_Scope) return true; - if (node instanceof AST_BlockScope) { - var save = block; - block = []; - descend(); - if (block.required) { - target.push(make_node(AST_BlockStatement, stat, { body: block })); - } else if (block.length) { - [].push.apply(target, block); - } - block = save; - return true; - } - if (!(node instanceof AST_LoopControl)) dropped = true; - })); - if (dropped) AST_Node.warn("Dropping unreachable code [{start}]", stat); - - function push(node) { - if (block) { - block.push(node); - if (!safe_to_trim(node)) block.required = true; - } else { - target.push(node); - } - } - } - - function is_undefined(node, compressor) { - return node == null - || node.is_undefined - || node instanceof AST_Undefined - || node instanceof AST_UnaryPrefix - && node.operator == "void" - && !(compressor && node.expression.has_side_effects(compressor)); - } - - // in_strict_mode() - // return true if scope executes in Strict Mode - (function(def) { - def(AST_Class, return_true); - def(AST_Scope, function(compressor) { - var body = this.body; - for (var i = 0; i < body.length; i++) { - var stat = body[i]; - if (!(stat instanceof AST_Directive)) break; - if (stat.value == "use strict") return true; - } - var parent = this.parent_scope; - if (!parent) return compressor.option("module"); - return parent.resolve(true).in_strict_mode(compressor); - }); - })(function(node, func) { - node.DEFMETHOD("in_strict_mode", func); - }); - - // is_truthy() - // return true if `!!node === true` - (function(def) { - def(AST_Node, return_false); - def(AST_Array, return_true); - def(AST_Assign, function() { - return this.operator == "=" && this.right.is_truthy(); - }); - def(AST_Lambda, return_true); - def(AST_Object, return_true); - def(AST_RegExp, return_true); - def(AST_Sequence, function() { - return this.tail_node().is_truthy(); - }); - def(AST_SymbolRef, function() { - var fixed = this.fixed_value(); - if (!fixed) return false; - this.is_truthy = return_false; - var result = fixed.is_truthy(); - delete this.is_truthy; - return result; - }); - })(function(node, func) { - node.DEFMETHOD("is_truthy", func); - }); - - // is_negative_zero() - // return true if the node may represent -0 - (function(def) { - def(AST_Node, return_true); - def(AST_Array, return_false); - function binary(op, left, right) { - switch (op) { - case "-": - return left.is_negative_zero() - && (!(right instanceof AST_Constant) || right.value == 0); - case "&&": - case "||": - return left.is_negative_zero() || right.is_negative_zero(); - case "*": - case "/": - case "%": - case "**": - return true; - default: - return false; - } - } - def(AST_Assign, function() { - var op = this.operator; - if (op == "=") return this.right.is_negative_zero(); - return binary(op.slice(0, -1), this.left, this.right); - }); - def(AST_Binary, function() { - return binary(this.operator, this.left, this.right); - }); - def(AST_Constant, function() { - return this.value == 0 && 1 / this.value < 0; - }); - def(AST_Lambda, return_false); - def(AST_Object, return_false); - def(AST_RegExp, return_false); - def(AST_Sequence, function() { - return this.tail_node().is_negative_zero(); - }); - def(AST_SymbolRef, function() { - var fixed = this.fixed_value(); - if (!fixed) return true; - this.is_negative_zero = return_true; - var result = fixed.is_negative_zero(); - delete this.is_negative_zero; - return result; - }); - def(AST_UnaryPrefix, function() { - return this.operator == "+" && this.expression.is_negative_zero() - || this.operator == "-"; - }); - })(function(node, func) { - node.DEFMETHOD("is_negative_zero", func); - }); - - // may_throw_on_access() - // returns true if this node may be null, undefined or contain `AST_Accessor` - (function(def) { - AST_Node.DEFMETHOD("may_throw_on_access", function(compressor, force) { - return !compressor.option("pure_getters") || this._dot_throw(compressor, force); - }); - function is_strict(compressor, force) { - return force || /strict/.test(compressor.option("pure_getters")); - } - def(AST_Node, is_strict); - def(AST_Array, return_false); - def(AST_Assign, function(compressor) { - var op = this.operator; - var sym = this.left; - var rhs = this.right; - if (op != "=") { - return lazy_op[op.slice(0, -1)] && (sym._dot_throw(compressor) || rhs._dot_throw(compressor)); - } - if (!rhs._dot_throw(compressor)) return false; - if (!(sym instanceof AST_SymbolRef)) return true; - if (rhs instanceof AST_Binary && rhs.operator == "||" && sym.name == rhs.left.name) { - return rhs.right._dot_throw(compressor); - } - return true; - }); - def(AST_Binary, function(compressor) { - return lazy_op[this.operator] && (this.left._dot_throw(compressor) || this.right._dot_throw(compressor)); - }); - def(AST_Class, function(compressor, force) { - return is_strict(compressor, force) && !all(this.properties, function(prop) { - if (prop.private) return true; - if (!prop.static) return true; - return !(prop instanceof AST_ClassGetter || prop instanceof AST_ClassSetter); - }); - }); - def(AST_Conditional, function(compressor) { - return this.consequent._dot_throw(compressor) || this.alternative._dot_throw(compressor); - }); - def(AST_Constant, return_false); - def(AST_Dot, function(compressor, force) { - if (!is_strict(compressor, force)) return false; - var exp = this.expression; - if (exp instanceof AST_SymbolRef) exp = exp.fixed_value(); - return !(this.property == "prototype" && is_lambda(exp)); - }); - def(AST_Lambda, return_false); - def(AST_Null, return_true); - def(AST_Object, function(compressor, force) { - return is_strict(compressor, force) && !all(this.properties, function(prop) { - if (prop instanceof AST_ObjectGetter || prop instanceof AST_ObjectSetter) return false; - return !(prop.key === "__proto__" && prop.value._dot_throw(compressor, force)); - }); - }); - def(AST_ObjectIdentity, function(compressor, force) { - return is_strict(compressor, force) && !this.scope.resolve().new; - }); - def(AST_Sequence, function(compressor) { - return this.tail_node()._dot_throw(compressor); - }); - def(AST_SymbolRef, function(compressor, force) { - if (this.is_undefined) return true; - if (!is_strict(compressor, force)) return false; - if (is_undeclared_ref(this) && this.is_declared(compressor)) return false; - if (this.is_immutable()) return false; - var def = this.definition(); - if (is_arguments(def) && !def.scope.rest && all(def.scope.argnames, function(argname) { - return argname instanceof AST_SymbolFunarg; - })) return def.scope.uses_arguments > 2; - var fixed = this.fixed_value(true); - if (!fixed) return true; - this._dot_throw = return_true; - if (fixed._dot_throw(compressor)) { - delete this._dot_throw; - return true; - } - this._dot_throw = return_false; - return false; - }); - def(AST_UnaryPrefix, function() { - return this.operator == "void"; - }); - def(AST_UnaryPostfix, return_false); - def(AST_Undefined, return_true); - })(function(node, func) { - node.DEFMETHOD("_dot_throw", func); - }); - - (function(def) { - def(AST_Node, return_false); - def(AST_Array, return_true); - function is_binary_defined(compressor, op, node) { - switch (op) { - case "&&": - return node.left.is_defined(compressor) && node.right.is_defined(compressor); - case "||": - return node.left.is_truthy() || node.right.is_defined(compressor); - case "??": - return node.left.is_defined(compressor) || node.right.is_defined(compressor); - default: - return true; - } - } - def(AST_Assign, function(compressor) { - var op = this.operator; - if (op == "=") return this.right.is_defined(compressor); - return is_binary_defined(compressor, op.slice(0, -1), this); - }); - def(AST_Binary, function(compressor) { - return is_binary_defined(compressor, this.operator, this); - }); - def(AST_Conditional, function(compressor) { - return this.consequent.is_defined(compressor) && this.alternative.is_defined(compressor); - }); - def(AST_Constant, return_true); - def(AST_Hole, return_false); - def(AST_Lambda, return_true); - def(AST_Object, return_true); - def(AST_Sequence, function(compressor) { - return this.tail_node().is_defined(compressor); - }); - def(AST_SymbolRef, function(compressor) { - if (this.is_undefined) return false; - if (is_undeclared_ref(this) && this.is_declared(compressor)) return true; - if (this.is_immutable()) return true; - var fixed = this.fixed_value(); - if (!fixed) return false; - this.is_defined = return_false; - var result = fixed.is_defined(compressor); - delete this.is_defined; - return result; - }); - def(AST_UnaryPrefix, function() { - return this.operator != "void"; - }); - def(AST_UnaryPostfix, return_true); - def(AST_Undefined, return_false); - })(function(node, func) { - node.DEFMETHOD("is_defined", func); - }); - - /* -----[ boolean/negation helpers ]----- */ - - // methods to determine whether an expression has a boolean result type - (function(def) { - def(AST_Node, return_false); - def(AST_Assign, function(compressor) { - return this.operator == "=" && this.right.is_boolean(compressor); - }); - var binary = makePredicate("in instanceof == != === !== < <= >= >"); - def(AST_Binary, function(compressor) { - return binary[this.operator] || lazy_op[this.operator] - && this.left.is_boolean(compressor) - && this.right.is_boolean(compressor); - }); - def(AST_Boolean, return_true); - var fn = makePredicate("every hasOwnProperty isPrototypeOf propertyIsEnumerable some"); - def(AST_Call, function(compressor) { - if (!compressor.option("unsafe")) return false; - var exp = this.expression; - return exp instanceof AST_Dot && (fn[exp.property] - || exp.property == "test" && exp.expression instanceof AST_RegExp); - }); - def(AST_Conditional, function(compressor) { - return this.consequent.is_boolean(compressor) && this.alternative.is_boolean(compressor); - }); - def(AST_New, return_false); - def(AST_Sequence, function(compressor) { - return this.tail_node().is_boolean(compressor); - }); - def(AST_SymbolRef, function(compressor) { - var fixed = this.fixed_value(); - if (!fixed) return false; - this.is_boolean = return_false; - var result = fixed.is_boolean(compressor); - delete this.is_boolean; - return result; - }); - var unary = makePredicate("! delete"); - def(AST_UnaryPrefix, function() { - return unary[this.operator]; - }); - })(function(node, func) { - node.DEFMETHOD("is_boolean", func); - }); - - // methods to determine if an expression has a numeric result type - (function(def) { - def(AST_Node, return_false); - var binary = makePredicate("- * / % ** & | ^ << >> >>>"); - def(AST_Assign, function(compressor) { - return binary[this.operator.slice(0, -1)] - || this.operator == "=" && this.right.is_number(compressor); - }); - def(AST_Binary, function(compressor) { - if (binary[this.operator]) return true; - if (this.operator != "+") return false; - return (this.left.is_boolean(compressor) || this.left.is_number(compressor)) - && (this.right.is_boolean(compressor) || this.right.is_number(compressor)); - }); - var fn = makePredicate([ - "charCodeAt", - "getDate", - "getDay", - "getFullYear", - "getHours", - "getMilliseconds", - "getMinutes", - "getMonth", - "getSeconds", - "getTime", - "getTimezoneOffset", - "getUTCDate", - "getUTCDay", - "getUTCFullYear", - "getUTCHours", - "getUTCMilliseconds", - "getUTCMinutes", - "getUTCMonth", - "getUTCSeconds", - "getYear", - "indexOf", - "lastIndexOf", - "localeCompare", - "push", - "search", - "setDate", - "setFullYear", - "setHours", - "setMilliseconds", - "setMinutes", - "setMonth", - "setSeconds", - "setTime", - "setUTCDate", - "setUTCFullYear", - "setUTCHours", - "setUTCMilliseconds", - "setUTCMinutes", - "setUTCMonth", - "setUTCSeconds", - "setYear", - ]); - def(AST_Call, function(compressor) { - if (!compressor.option("unsafe")) return false; - var exp = this.expression; - return exp instanceof AST_Dot && (fn[exp.property] - || is_undeclared_ref(exp.expression) && exp.expression.name == "Math"); - }); - def(AST_Conditional, function(compressor) { - return this.consequent.is_number(compressor) && this.alternative.is_number(compressor); - }); - def(AST_New, return_false); - def(AST_Number, return_true); - def(AST_Sequence, function(compressor) { - return this.tail_node().is_number(compressor); - }); - def(AST_SymbolRef, function(compressor, keep_unary) { - var fixed = this.fixed_value(); - if (!fixed) return false; - if (keep_unary - && fixed instanceof AST_UnaryPrefix - && fixed.operator == "+" - && fixed.expression.equals(this)) { - return false; - } - this.is_number = return_false; - var result = fixed.is_number(compressor); - delete this.is_number; - return result; - }); - var unary = makePredicate("+ - ~ ++ --"); - def(AST_Unary, function() { - return unary[this.operator]; - }); - })(function(node, func) { - node.DEFMETHOD("is_number", func); - }); - - // methods to determine if an expression has a string result type - (function(def) { - def(AST_Node, return_false); - def(AST_Assign, function(compressor) { - switch (this.operator) { - case "+=": - if (this.left.is_string(compressor)) return true; - case "=": - return this.right.is_string(compressor); - } - }); - def(AST_Binary, function(compressor) { - return this.operator == "+" && - (this.left.is_string(compressor) || this.right.is_string(compressor)); - }); - var fn = makePredicate([ - "charAt", - "substr", - "substring", - "toExponential", - "toFixed", - "toLowerCase", - "toPrecision", - "toString", - "toUpperCase", - "trim", - ]); - def(AST_Call, function(compressor) { - if (!compressor.option("unsafe")) return false; - var exp = this.expression; - return exp instanceof AST_Dot && fn[exp.property]; - }); - def(AST_Conditional, function(compressor) { - return this.consequent.is_string(compressor) && this.alternative.is_string(compressor); - }); - def(AST_Sequence, function(compressor) { - return this.tail_node().is_string(compressor); - }); - def(AST_String, return_true); - def(AST_SymbolRef, function(compressor) { - var fixed = this.fixed_value(); - if (!fixed) return false; - this.is_string = return_false; - var result = fixed.is_string(compressor); - delete this.is_string; - return result; - }); - def(AST_Template, function(compressor) { - return !this.tag || is_raw_tag(compressor, this.tag); - }); - def(AST_UnaryPrefix, function() { - return this.operator == "typeof"; - }); - })(function(node, func) { - node.DEFMETHOD("is_string", func); - }); - - var lazy_op = makePredicate("&& || ??"); - - (function(def) { - function to_node(value, orig) { - if (value instanceof AST_Node) return value.clone(true); - if (Array.isArray(value)) return make_node(AST_Array, orig, { - elements: value.map(function(value) { - return to_node(value, orig); - }) - }); - if (value && typeof value == "object") { - var props = []; - for (var key in value) if (HOP(value, key)) { - props.push(make_node(AST_ObjectKeyVal, orig, { - key: key, - value: to_node(value[key], orig), - })); - } - return make_node(AST_Object, orig, { properties: props }); - } - return make_node_from_constant(value, orig); - } - - function warn(node) { - AST_Node.warn("global_defs {this} redefined [{start}]", node); - } - - AST_Toplevel.DEFMETHOD("resolve_defines", function(compressor) { - if (!compressor.option("global_defs")) return this; - this.figure_out_scope({ ie: compressor.option("ie") }); - return this.transform(new TreeTransformer(function(node) { - var def = node._find_defs(compressor, ""); - if (!def) return; - var level = 0, child = node, parent; - while (parent = this.parent(level++)) { - if (!(parent instanceof AST_PropAccess)) break; - if (parent.expression !== child) break; - child = parent; - } - if (is_lhs(child, parent)) { - warn(node); - return; - } - return def; - })); - }); - def(AST_Node, noop); - def(AST_Dot, function(compressor, suffix) { - return this.expression._find_defs(compressor, "." + this.property + suffix); - }); - def(AST_SymbolDeclaration, function(compressor) { - if (!this.definition().global) return; - if (HOP(compressor.option("global_defs"), this.name)) warn(this); - }); - def(AST_SymbolRef, function(compressor, suffix) { - if (!this.definition().global) return; - var defines = compressor.option("global_defs"); - var name = this.name + suffix; - if (HOP(defines, name)) return to_node(defines[name], this); - }); - })(function(node, func) { - node.DEFMETHOD("_find_defs", func); - }); - - function best_of_expression(ast1, ast2, threshold) { - var delta = ast2.print_to_string().length - ast1.print_to_string().length; - return delta < (threshold || 0) ? ast2 : ast1; - } - - function best_of_statement(ast1, ast2, threshold) { - return best_of_expression(make_node(AST_SimpleStatement, ast1, { - body: ast1, - }), make_node(AST_SimpleStatement, ast2, { - body: ast2, - }), threshold).body; - } - - function best_of(compressor, ast1, ast2, threshold) { - return (first_in_statement(compressor) ? best_of_statement : best_of_expression)(ast1, ast2, threshold); - } - - function convert_to_predicate(obj) { - var map = Object.create(null); - Object.keys(obj).forEach(function(key) { - map[key] = makePredicate(obj[key]); - }); - return map; - } - - function skip_directives(body) { - for (var i = 0; i < body.length; i++) { - var stat = body[i]; - if (!(stat instanceof AST_Directive)) return stat; - } - } - - function arrow_first_statement() { - if (this.value) return make_node(AST_Return, this.value, { value: this.value }); - return skip_directives(this.body); - } - AST_Arrow.DEFMETHOD("first_statement", arrow_first_statement); - AST_AsyncArrow.DEFMETHOD("first_statement", arrow_first_statement); - AST_Lambda.DEFMETHOD("first_statement", function() { - return skip_directives(this.body); - }); - - AST_Lambda.DEFMETHOD("length", function() { - var argnames = this.argnames; - for (var i = 0; i < argnames.length; i++) { - if (argnames[i] instanceof AST_DefaultValue) break; - } - return i; - }); - - function try_evaluate(compressor, node) { - var ev = node.evaluate(compressor); - if (ev === node) return node; - ev = make_node_from_constant(ev, node).optimize(compressor); - return best_of(compressor, node, ev, compressor.eval_threshold); - } - - var object_fns = [ - "constructor", - "toString", - "valueOf", - ]; - var native_fns = convert_to_predicate({ - Array: [ - "indexOf", - "join", - "lastIndexOf", - "slice", - ].concat(object_fns), - Boolean: object_fns, - Function: object_fns, - Number: [ - "toExponential", - "toFixed", - "toPrecision", - ].concat(object_fns), - Object: object_fns, - RegExp: [ - "exec", - "test", - ].concat(object_fns), - String: [ - "charAt", - "charCodeAt", - "concat", - "indexOf", - "italics", - "lastIndexOf", - "match", - "replace", - "search", - "slice", - "split", - "substr", - "substring", - "toLowerCase", - "toUpperCase", - "trim", - ].concat(object_fns), - }); - var static_fns = convert_to_predicate({ - Array: [ - "isArray", - ], - Math: [ - "abs", - "acos", - "asin", - "atan", - "ceil", - "cos", - "exp", - "floor", - "log", - "round", - "sin", - "sqrt", - "tan", - "atan2", - "pow", - "max", - "min", - ], - Number: [ - "isFinite", - "isNaN", - ], - Object: [ - "create", - "getOwnPropertyDescriptor", - "getOwnPropertyNames", - "getPrototypeOf", - "isExtensible", - "isFrozen", - "isSealed", - "keys", - ], - String: [ - "fromCharCode", - "raw", - ], - }); - - function is_static_fn(node) { - if (!(node instanceof AST_Dot)) return false; - var expr = node.expression; - if (!is_undeclared_ref(expr)) return false; - var static_fn = static_fns[expr.name]; - return static_fn && (static_fn[node.property] || expr.name == "Math" && node.property == "random"); - } - - // Accommodate when compress option evaluate=false - // as well as the common constant expressions !0 and -1 - (function(def) { - def(AST_Node, return_false); - def(AST_Constant, return_true); - def(AST_RegExp, return_false); - var unaryPrefix = makePredicate("! ~ - + void"); - def(AST_UnaryPrefix, function() { - return unaryPrefix[this.operator] && this.expression instanceof AST_Constant; - }); - })(function(node, func) { - node.DEFMETHOD("is_constant", func); - }); - - // methods to evaluate a constant expression - (function(def) { - // If the node has been successfully reduced to a constant, - // then its value is returned; otherwise the element itself - // is returned. - // - // They can be distinguished as constant value is never a - // descendant of AST_Node. - // - // When `ignore_side_effects` is `true`, inspect the constant value - // produced without worrying about any side effects caused by said - // expression. - AST_Node.DEFMETHOD("evaluate", function(compressor, ignore_side_effects) { - if (!compressor.option("evaluate")) return this; - var cached = []; - var val = this._eval(compressor, ignore_side_effects, cached, 1); - cached.forEach(function(node) { - delete node._eval; - }); - if (ignore_side_effects) return val; - if (!val || val instanceof RegExp) return val; - if (typeof val == "function" || typeof val == "object") return this; - return val; - }); - var scan_modified = new TreeWalker(function(node) { - if (node instanceof AST_Assign) modified(node.left); - if (node instanceof AST_ForEnumeration) modified(node.init); - if (node instanceof AST_Unary && UNARY_POSTFIX[node.operator]) modified(node.expression); - }); - function modified(node) { - if (node instanceof AST_DestructuredArray) { - node.elements.forEach(modified); - } else if (node instanceof AST_DestructuredObject) { - node.properties.forEach(function(prop) { - modified(prop.value); - }); - } else if (node instanceof AST_PropAccess) { - modified(node.expression); - } else if (node instanceof AST_SymbolRef) { - node.definition().references.forEach(function(ref) { - delete ref._eval; - }); - } - } - def(AST_Statement, function() { - throw new Error(string_template("Cannot evaluate a statement [{start}]", this)); - }); - def(AST_Accessor, return_this); - def(AST_BigInt, return_this); - def(AST_Class, return_this); - def(AST_Node, return_this); - def(AST_Constant, function() { - return this.value; - }); - def(AST_Assign, function(compressor, ignore_side_effects, cached, depth) { - var lhs = this.left; - if (!ignore_side_effects) { - if (!(lhs instanceof AST_SymbolRef)) return this; - if (!HOP(lhs, "_eval")) { - if (!lhs.fixed) return this; - var def = lhs.definition(); - if (!def.fixed) return this; - if (def.undeclared) return this; - if (def.last_ref !== lhs) return this; - if (def.single_use == "m") return this; - if (this.right.has_side_effects(compressor)) return this; - } - } - var op = this.operator; - var node; - if (!HOP(lhs, "_eval") && lhs instanceof AST_SymbolRef && lhs.fixed && lhs.definition().fixed) { - node = lhs; - } else if (op == "=") { - node = this.right; - } else { - node = make_node(AST_Binary, this, { - operator: op.slice(0, -1), - left: lhs, - right: this.right, - }); - } - lhs.walk(scan_modified); - var value = node._eval(compressor, ignore_side_effects, cached, depth); - if (typeof value == "object") return this; - modified(lhs); - return value; - }); - def(AST_Sequence, function(compressor, ignore_side_effects, cached, depth) { - if (!ignore_side_effects) return this; - var exprs = this.expressions; - for (var i = 0, last = exprs.length - 1; i < last; i++) { - exprs[i].walk(scan_modified); - } - var tail = exprs[last]; - var value = tail._eval(compressor, ignore_side_effects, cached, depth); - return value === tail ? this : value; - }); - def(AST_Lambda, function(compressor) { - if (compressor.option("unsafe")) { - var fn = function() {}; - fn.node = this; - fn.toString = function() { - return "function(){}"; - }; - return fn; - } - return this; - }); - def(AST_Array, function(compressor, ignore_side_effects, cached, depth) { - if (compressor.option("unsafe")) { - var elements = []; - for (var i = 0; i < this.elements.length; i++) { - var element = this.elements[i]; - if (element instanceof AST_Hole) return this; - var value = element._eval(compressor, ignore_side_effects, cached, depth); - if (element === value) return this; - elements.push(value); - } - return elements; - } - return this; - }); - def(AST_Object, function(compressor, ignore_side_effects, cached, depth) { - if (compressor.option("unsafe")) { - var val = {}; - for (var i = 0; i < this.properties.length; i++) { - var prop = this.properties[i]; - if (!(prop instanceof AST_ObjectKeyVal)) return this; - var key = prop.key; - if (key instanceof AST_Node) { - key = key._eval(compressor, ignore_side_effects, cached, depth); - if (key === prop.key) return this; - } - switch (key) { - case "__proto__": - case "toString": - case "valueOf": - return this; - } - val[key] = prop.value._eval(compressor, ignore_side_effects, cached, depth); - if (val[key] === prop.value) return this; - } - return val; - } - return this; - }); - var non_converting_unary = makePredicate("! typeof void"); - def(AST_UnaryPrefix, function(compressor, ignore_side_effects, cached, depth) { - var e = this.expression; - var op = this.operator; - // Function would be evaluated to an array and so typeof would - // incorrectly return "object". Hence making is a special case. - if (compressor.option("typeofs") - && op == "typeof" - && (e instanceof AST_Lambda - || e instanceof AST_SymbolRef - && e.fixed_value() instanceof AST_Lambda)) { - return typeof function(){}; - } - var def = e instanceof AST_SymbolRef && e.definition(); - if (!non_converting_unary[op] && !(def && def.fixed)) depth++; - e.walk(scan_modified); - var v = e._eval(compressor, ignore_side_effects, cached, depth); - if (v === e) { - if (ignore_side_effects && op == "void") return; - return this; - } - switch (op) { - case "!": return !v; - case "typeof": - // typeof returns "object" or "function" on different platforms - // so cannot evaluate reliably - if (v instanceof RegExp) return this; - return typeof v; - case "void": return; - case "~": return ~v; - case "-": return -v; - case "+": return +v; - case "++": - case "--": - if (!def) return this; - if (!ignore_side_effects) { - if (def.undeclared) return this; - if (def.last_ref !== e) return this; - } - if (HOP(e, "_eval")) v = +(op[0] + 1) + +v; - modified(e); - return v; - } - return this; - }); - def(AST_UnaryPostfix, function(compressor, ignore_side_effects, cached, depth) { - var e = this.expression; - if (!(e instanceof AST_SymbolRef)) { - if (!ignore_side_effects) return this; - } else if (!HOP(e, "_eval")) { - if (!e.fixed) return this; - if (!ignore_side_effects) { - var def = e.definition(); - if (!def.fixed) return this; - if (def.undeclared) return this; - if (def.last_ref !== e) return this; - } - } - if (!(e instanceof AST_SymbolRef && e.definition().fixed)) depth++; - e.walk(scan_modified); - var v = e._eval(compressor, ignore_side_effects, cached, depth); - if (v === e) return this; - modified(e); - return +v; - }); - var non_converting_binary = makePredicate("&& || === !=="); - def(AST_Binary, function(compressor, ignore_side_effects, cached, depth) { - if (!non_converting_binary[this.operator]) depth++; - var left = this.left._eval(compressor, ignore_side_effects, cached, depth); - if (left === this.left) return this; - if (this.operator == (left ? "||" : "&&")) return left; - var rhs_ignore_side_effects = ignore_side_effects && !(left && typeof left == "object"); - var right = this.right._eval(compressor, rhs_ignore_side_effects, cached, depth); - if (right === this.right) return this; - var result; - switch (this.operator) { - case "&&" : result = left && right; break; - case "||" : result = left || right; break; - case "??" : - result = left == null ? right : left; - break; - case "|" : result = left | right; break; - case "&" : result = left & right; break; - case "^" : result = left ^ right; break; - case "+" : result = left + right; break; - case "-" : result = left - right; break; - case "*" : result = left * right; break; - case "/" : result = left / right; break; - case "%" : result = left % right; break; - case "<<" : result = left << right; break; - case ">>" : result = left >> right; break; - case ">>>": result = left >>> right; break; - case "==" : result = left == right; break; - case "===": result = left === right; break; - case "!=" : result = left != right; break; - case "!==": result = left !== right; break; - case "<" : result = left < right; break; - case "<=" : result = left <= right; break; - case ">" : result = left > right; break; - case ">=" : result = left >= right; break; - case "**": - result = Math.pow(left, right); - break; - case "in": - if (right && typeof right == "object" && HOP(right, left)) { - result = true; - break; - } - default: - return this; - } - if (isNaN(result)) return compressor.find_parent(AST_With) ? this : result; - if (compressor.option("unsafe_math") - && !ignore_side_effects - && result - && typeof result == "number" - && (this.operator == "+" || this.operator == "-")) { - var digits = Math.max(0, decimals(left), decimals(right)); - // 53-bit significand ---> 15.95 decimal places - if (digits < 16) return +result.toFixed(digits); - } - return result; - - function decimals(operand) { - var match = /(\.[0-9]*)?(e[^e]+)?$/.exec(+operand); - return (match[1] || ".").length - 1 - (match[2] || "").slice(1); - } - }); - def(AST_Conditional, function(compressor, ignore_side_effects, cached, depth) { - var condition = this.condition._eval(compressor, ignore_side_effects, cached, depth); - if (condition === this.condition) return this; - var node = condition ? this.consequent : this.alternative; - var value = node._eval(compressor, ignore_side_effects, cached, depth); - return value === node ? this : value; - }); - function verify_escaped(ref, depth) { - var escaped = ref.definition().escaped; - switch (escaped.length) { - case 0: - return true; - case 1: - var found = false; - escaped[0].walk(new TreeWalker(function(node) { - if (found) return true; - if (node === ref) return found = true; - if (node instanceof AST_Scope) return true; - })); - return found; - default: - return depth <= escaped.depth; - } - } - def(AST_SymbolRef, function(compressor, ignore_side_effects, cached, depth) { - var fixed = this.fixed_value(); - if (!fixed) return this; - var value; - if (HOP(fixed, "_eval")) { - value = fixed._eval(); - } else { - this._eval = return_this; - value = fixed._eval(compressor, ignore_side_effects, cached, depth); - delete this._eval; - if (value === fixed) return this; - fixed._eval = function() { - return value; - }; - cached.push(fixed); - } - return value && typeof value == "object" && !verify_escaped(this, depth) ? this : value; - }); - var global_objs = { - Array: Array, - Math: Math, - Number: Number, - Object: Object, - String: String, - }; - var static_values = convert_to_predicate({ - Math: [ - "E", - "LN10", - "LN2", - "LOG2E", - "LOG10E", - "PI", - "SQRT1_2", - "SQRT2", - ], - Number: [ - "MAX_VALUE", - "MIN_VALUE", - "NaN", - "NEGATIVE_INFINITY", - "POSITIVE_INFINITY", - ], - }); - var regexp_props = makePredicate("global ignoreCase multiline source"); - def(AST_PropAccess, function(compressor, ignore_side_effects, cached, depth) { - if (compressor.option("unsafe")) { - var val; - var exp = this.expression; - if (!is_undeclared_ref(exp)) { - val = exp._eval(compressor, ignore_side_effects, cached, depth + 1); - if (val == null || val === exp) return this; - } - var key = this.property; - if (key instanceof AST_Node) { - key = key._eval(compressor, ignore_side_effects, cached, depth); - if (key === this.property) return this; - } - if (val === undefined) { - var static_value = static_values[exp.name]; - if (!static_value || !static_value[key]) return this; - val = global_objs[exp.name]; - } else if (val instanceof RegExp) { - if (!regexp_props[key]) return this; - } else if (typeof val == "object") { - if (!HOP(val, key)) return this; - } else if (typeof val == "function") switch (key) { - case "name": - return val.node.name ? val.node.name.name : ""; - case "length": - return val.node.length(); - default: - return this; - } - return val[key]; - } - return this; - }); - function eval_all(nodes, compressor, ignore_side_effects, cached, depth) { - var values = []; - for (var i = 0; i < nodes.length; i++) { - var node = nodes[i]; - var value = node._eval(compressor, ignore_side_effects, cached, depth); - if (node === value) return; - values.push(value); - } - return values; - } - def(AST_Call, function(compressor, ignore_side_effects, cached, depth) { - var exp = this.expression; - var fn = exp instanceof AST_SymbolRef ? exp.fixed_value() : exp; - if (fn instanceof AST_Arrow || fn instanceof AST_Defun || fn instanceof AST_Function) { - if (fn.evaluating) return this; - if (fn.name && fn.name.definition().recursive_refs > 0) return this; - if (this.is_expr_pure(compressor)) return this; - var args = eval_all(this.args, compressor, ignore_side_effects, cached, depth); - if (!all(fn.argnames, function(sym, index) { - if (sym instanceof AST_DefaultValue) { - if (!args) return false; - if (args[index] === undefined) { - var value = sym.value._eval(compressor, ignore_side_effects, cached, depth); - if (value === sym.value) return false; - args[index] = value; - } - sym = sym.name; - } - return !(sym instanceof AST_Destructured); - })) return this; - if (fn.rest instanceof AST_Destructured) return this; - if (!args && !ignore_side_effects) return this; - var stat = fn.first_statement(); - if (!(stat instanceof AST_Return)) { - if (ignore_side_effects) { - fn.walk(scan_modified); - var found = false; - fn.evaluating = true; - walk_body(fn, new TreeWalker(function(node) { - if (found) return true; - if (node instanceof AST_Return) { - if (node.value && node.value._eval(compressor, true, cached, depth) !== undefined) { - found = true; - } - return true; - } - if (node instanceof AST_Scope && node !== fn) return true; - })); - fn.evaluating = false; - if (!found) return; - } - return this; - } - var val = stat.value; - if (!val) return; - var cached_args = []; - if (!args || all(fn.argnames, function(sym, i) { - return assign(sym, args[i]); - }) && !(fn.rest && !assign(fn.rest, args.slice(fn.argnames.length))) || ignore_side_effects) { - if (ignore_side_effects) fn.argnames.forEach(function(sym) { - if (sym instanceof AST_DefaultValue) sym.value.walk(scan_modified); - }); - fn.evaluating = true; - val = val._eval(compressor, ignore_side_effects, cached, depth); - fn.evaluating = false; - } - cached_args.forEach(function(node) { - delete node._eval; - }); - return val === stat.value ? this : val; - } else if (compressor.option("unsafe") && exp instanceof AST_PropAccess) { - var key = exp.property; - if (key instanceof AST_Node) { - key = key._eval(compressor, ignore_side_effects, cached, depth); - if (key === exp.property) return this; - } - var val; - var e = exp.expression; - if (is_undeclared_ref(e)) { - var static_fn = static_fns[e.name]; - if (!static_fn || !static_fn[key]) return this; - val = global_objs[e.name]; - } else { - val = e._eval(compressor, ignore_side_effects, cached, depth + 1); - if (val == null || val === e) return this; - var native_fn = native_fns[val.constructor.name]; - if (!native_fn || !native_fn[key]) return this; - if (val instanceof RegExp && val.global && !(e instanceof AST_RegExp)) return this; - } - var args = eval_all(this.args, compressor, ignore_side_effects, cached, depth); - if (!args) return this; - if (key == "replace" && typeof args[1] == "function") return this; - try { - return val[key].apply(val, args); - } catch (ex) { - AST_Node.warn("Error evaluating {this} [{start}]", this); - } finally { - if (val instanceof RegExp) val.lastIndex = 0; - } - } - return this; - - function assign(sym, arg) { - if (sym instanceof AST_DefaultValue) sym = sym.name; - var def = sym.definition(); - if (def.orig[def.orig.length - 1] !== sym) return false; - var value = arg; - def.references.forEach(function(node) { - node._eval = function() { - return value; - }; - cached_args.push(node); - }); - return true; - } - }); - def(AST_New, return_this); - def(AST_Template, function(compressor, ignore_side_effects, cached, depth) { - if (!compressor.option("templates")) return this; - if (this.tag) { - if (!is_raw_tag(compressor, this.tag)) return this; - decode = function(str) { - return str; - }; - } - var exprs = eval_all(this.expressions, compressor, ignore_side_effects, cached, depth); - if (!exprs) return this; - var malformed = false; - var ret = decode(this.strings[0]); - for (var i = 0; i < exprs.length; i++) { - ret += exprs[i] + decode(this.strings[i + 1]); - } - if (!malformed) return ret; - this._eval = return_this; - return this; - - function decode(str) { - str = decode_template(str); - if (typeof str != "string") malformed = true; - return str; - } - }); - })(function(node, func) { - node.DEFMETHOD("_eval", func); - }); - - // method to negate an expression - (function(def) { - function basic_negation(exp) { - return make_node(AST_UnaryPrefix, exp, { - operator: "!", - expression: exp, - }); - } - function best(orig, alt, first_in_statement) { - var negated = basic_negation(orig); - if (first_in_statement) return best_of_expression(negated, make_node(AST_SimpleStatement, alt, { - body: alt, - })) === negated ? negated : alt; - return best_of_expression(negated, alt); - } - def(AST_Node, function() { - return basic_negation(this); - }); - def(AST_Statement, function() { - throw new Error("Cannot negate a statement"); - }); - def(AST_Binary, function(compressor, first_in_statement) { - var self = this.clone(), op = this.operator; - if (compressor.option("unsafe_comps")) { - switch (op) { - case "<=" : self.operator = ">" ; return self; - case "<" : self.operator = ">=" ; return self; - case ">=" : self.operator = "<" ; return self; - case ">" : self.operator = "<=" ; return self; - } - } - switch (op) { - case "==" : self.operator = "!="; return self; - case "!=" : self.operator = "=="; return self; - case "===": self.operator = "!=="; return self; - case "!==": self.operator = "==="; return self; - case "&&": - self.operator = "||"; - self.left = self.left.negate(compressor, first_in_statement); - self.right = self.right.negate(compressor); - return best(this, self, first_in_statement); - case "||": - self.operator = "&&"; - self.left = self.left.negate(compressor, first_in_statement); - self.right = self.right.negate(compressor); - return best(this, self, first_in_statement); - } - return basic_negation(this); - }); - def(AST_ClassExpression, function() { - return basic_negation(this); - }); - def(AST_Conditional, function(compressor, first_in_statement) { - var self = this.clone(); - self.consequent = self.consequent.negate(compressor); - self.alternative = self.alternative.negate(compressor); - return best(this, self, first_in_statement); - }); - def(AST_LambdaExpression, function() { - return basic_negation(this); - }); - def(AST_Sequence, function(compressor) { - var expressions = this.expressions.slice(); - expressions.push(expressions.pop().negate(compressor)); - return make_sequence(this, expressions); - }); - def(AST_UnaryPrefix, function() { - if (this.operator == "!") - return this.expression; - return basic_negation(this); - }); - })(function(node, func) { - node.DEFMETHOD("negate", function(compressor, first_in_statement) { - return func.call(this, compressor, first_in_statement); - }); - }); - - var global_pure_fns = makePredicate("Boolean decodeURI decodeURIComponent Date encodeURI encodeURIComponent Error escape EvalError isFinite isNaN Number Object parseFloat parseInt RangeError ReferenceError String SyntaxError TypeError unescape URIError"); - var global_pure_constructors = makePredicate("Map Set WeakMap WeakSet"); - AST_Call.DEFMETHOD("is_expr_pure", function(compressor) { - if (compressor.option("unsafe")) { - var expr = this.expression; - if (is_undeclared_ref(expr)) { - if (global_pure_fns[expr.name]) return true; - if (this instanceof AST_New && global_pure_constructors[expr.name]) return true; - } - if (is_static_fn(expr)) return true; - } - return compressor.option("annotations") && this.pure || !compressor.pure_funcs(this); - }); - AST_Template.DEFMETHOD("is_expr_pure", function(compressor) { - var tag = this.tag; - if (!tag) return true; - if (compressor.option("unsafe")) { - if (is_undeclared_ref(tag) && global_pure_fns[tag.name]) return true; - if (tag instanceof AST_Dot && is_undeclared_ref(tag.expression)) { - var static_fn = static_fns[tag.expression.name]; - return static_fn && (static_fn[tag.property] - || tag.expression.name == "Math" && tag.property == "random"); - } - } - return !compressor.pure_funcs(this); - }); - AST_Node.DEFMETHOD("is_call_pure", return_false); - AST_Call.DEFMETHOD("is_call_pure", function(compressor) { - if (!compressor.option("unsafe")) return false; - var dot = this.expression; - if (!(dot instanceof AST_Dot)) return false; - var exp = dot.expression; - var map; - var prop = dot.property; - if (exp instanceof AST_Array) { - map = native_fns.Array; - } else if (exp.is_boolean(compressor)) { - map = native_fns.Boolean; - } else if (exp.is_number(compressor)) { - map = native_fns.Number; - } else if (exp instanceof AST_RegExp) { - map = native_fns.RegExp; - } else if (exp.is_string(compressor)) { - map = native_fns.String; - if (prop == "replace") { - var arg = this.args[1]; - if (arg && !arg.is_string(compressor)) return false; - } - } else if (!dot.may_throw_on_access(compressor)) { - map = native_fns.Object; - } - return map && map[prop]; - }); - - // determine if object spread syntax may cause runtime exception - (function(def) { - def(AST_Node, return_false); - def(AST_Array, return_true); - def(AST_Assign, function() { - switch (this.operator) { - case "=": - return this.right.safe_to_spread(); - case "&&=": - case "||=": - case "??=": - return this.left.safe_to_spread() && this.right.safe_to_spread(); - } - return true; - }); - def(AST_Binary, function() { - return !lazy_op[this.operator] || this.left.safe_to_spread() && this.right.safe_to_spread(); - }); - def(AST_Constant, return_true); - def(AST_Lambda, return_true); - def(AST_Object, function() { - return all(this.properties, function(prop) { - return !(prop instanceof AST_ObjectGetter || prop instanceof AST_Spread); - }); - }); - def(AST_Sequence, function() { - return this.tail_node().safe_to_spread(); - }); - def(AST_SymbolRef, function() { - var fixed = this.fixed_value(); - return fixed && fixed.safe_to_spread(); - }); - def(AST_Unary, return_true); - })(function(node, func) { - node.DEFMETHOD("safe_to_spread", func); - }); - - // determine if expression has side effects - (function(def) { - function any(list, compressor, spread) { - return !all(list, spread ? function(node) { - return node instanceof AST_Spread ? !spread(node, compressor) : !node.has_side_effects(compressor); - } : function(node) { - return !node.has_side_effects(compressor); - }); - } - function array_spread(node, compressor) { - var exp = node.expression; - return !exp.is_string(compressor) || exp.has_side_effects(compressor); - } - def(AST_Node, return_true); - def(AST_Array, function(compressor) { - return any(this.elements, compressor, array_spread); - }); - def(AST_Assign, function(compressor) { - var lhs = this.left; - if (!(lhs instanceof AST_PropAccess)) return true; - var node = lhs.expression; - return !(node instanceof AST_ObjectIdentity) - || !node.scope.resolve().new - || lhs instanceof AST_Sub && lhs.property.has_side_effects(compressor) - || this.right.has_side_effects(compressor); - }); - def(AST_Binary, function(compressor) { - return this.left.has_side_effects(compressor) - || this.right.has_side_effects(compressor) - || !can_drop_op(this.operator, this.right, compressor); - }); - def(AST_Block, function(compressor) { - return any(this.body, compressor); - }); - def(AST_Call, function(compressor) { - if (!this.is_expr_pure(compressor) - && (!this.is_call_pure(compressor) || this.expression.has_side_effects(compressor))) { - return true; - } - return any(this.args, compressor, array_spread); - }); - def(AST_Case, function(compressor) { - return this.expression.has_side_effects(compressor) - || any(this.body, compressor); - }); - def(AST_Class, function(compressor) { - var base = this.extends; - if (base) { - if (base instanceof AST_SymbolRef) base = base.fixed_value(); - if (!safe_for_extends(base)) return true; - } - return any(this.properties, compressor); - }); - def(AST_ClassProperty, function(compressor) { - return this.key instanceof AST_Node && this.key.has_side_effects(compressor) - || this.static && this.value && this.value.has_side_effects(compressor); - }); - def(AST_Conditional, function(compressor) { - return this.condition.has_side_effects(compressor) - || this.consequent.has_side_effects(compressor) - || this.alternative.has_side_effects(compressor); - }); - def(AST_Constant, return_false); - def(AST_Definitions, function(compressor) { - return any(this.definitions, compressor); - }); - def(AST_DestructuredArray, function(compressor) { - return any(this.elements, compressor); - }); - def(AST_DestructuredKeyVal, function(compressor) { - return this.key instanceof AST_Node && this.key.has_side_effects(compressor) - || this.value.has_side_effects(compressor); - }); - def(AST_DestructuredObject, function(compressor) { - return any(this.properties, compressor); - }); - def(AST_Dot, function(compressor) { - return this.expression.may_throw_on_access(compressor) - || this.expression.has_side_effects(compressor); - }); - def(AST_EmptyStatement, return_false); - def(AST_If, function(compressor) { - return this.condition.has_side_effects(compressor) - || this.body && this.body.has_side_effects(compressor) - || this.alternative && this.alternative.has_side_effects(compressor); - }); - def(AST_LabeledStatement, function(compressor) { - return this.body.has_side_effects(compressor); - }); - def(AST_Lambda, return_false); - def(AST_Object, function(compressor) { - return any(this.properties, compressor, function(node, compressor) { - var exp = node.expression; - return !exp.safe_to_spread() || exp.has_side_effects(compressor); - }); - }); - def(AST_ObjectIdentity, return_false); - def(AST_ObjectProperty, function(compressor) { - return this.key instanceof AST_Node && this.key.has_side_effects(compressor) - || this.value.has_side_effects(compressor); - }); - def(AST_Sequence, function(compressor) { - return any(this.expressions, compressor); - }); - def(AST_SimpleStatement, function(compressor) { - return this.body.has_side_effects(compressor); - }); - def(AST_Sub, function(compressor) { - return this.expression.may_throw_on_access(compressor) - || this.expression.has_side_effects(compressor) - || this.property.has_side_effects(compressor); - }); - def(AST_Switch, function(compressor) { - return this.expression.has_side_effects(compressor) - || any(this.body, compressor); - }); - def(AST_SymbolDeclaration, return_false); - def(AST_SymbolRef, function(compressor) { - return !this.is_declared(compressor) || !can_drop_symbol(this, compressor); - }); - def(AST_Template, function(compressor) { - return !this.is_expr_pure(compressor) || any(this.expressions, compressor); - }); - def(AST_Try, function(compressor) { - return any(this.body, compressor) - || this.bcatch && this.bcatch.has_side_effects(compressor) - || this.bfinally && this.bfinally.has_side_effects(compressor); - }); - def(AST_Unary, function(compressor) { - return unary_side_effects[this.operator] - || this.expression.has_side_effects(compressor); - }); - def(AST_VarDef, function() { - return this.value; - }); - })(function(node, func) { - node.DEFMETHOD("has_side_effects", func); - }); - - // determine if expression may throw - (function(def) { - def(AST_Node, return_true); - - def(AST_Constant, return_false); - def(AST_EmptyStatement, return_false); - def(AST_Lambda, return_false); - def(AST_ObjectIdentity, return_false); - def(AST_SymbolDeclaration, return_false); - - function any(list, compressor) { - for (var i = list.length; --i >= 0;) - if (list[i].may_throw(compressor)) - return true; - return false; - } - - function call_may_throw(exp, compressor) { - if (exp.may_throw(compressor)) return true; - if (exp instanceof AST_SymbolRef) exp = exp.fixed_value(); - if (!(exp instanceof AST_Lambda)) return true; - if (any(exp.argnames, compressor)) return true; - if (any(exp.body, compressor)) return true; - return is_arrow(exp) && exp.value && exp.value.may_throw(compressor); - } - - def(AST_Array, function(compressor) { - return any(this.elements, compressor); - }); - def(AST_Assign, function(compressor) { - if (this.right.may_throw(compressor)) return true; - if (!compressor.has_directive("use strict") - && this.operator == "=" - && this.left instanceof AST_SymbolRef) { - return false; - } - return this.left.may_throw(compressor); - }); - def(AST_Await, function(compressor) { - return this.expression.may_throw(compressor); - }); - def(AST_Binary, function(compressor) { - return this.left.may_throw(compressor) - || this.right.may_throw(compressor) - || !can_drop_op(this.operator, this.right, compressor); - }); - def(AST_Block, function(compressor) { - return any(this.body, compressor); - }); - def(AST_Call, function(compressor) { - if (any(this.args, compressor)) return true; - if (this.is_expr_pure(compressor)) return false; - this.may_throw = return_true; - var ret = call_may_throw(this.expression, compressor); - delete this.may_throw; - return ret; - }); - def(AST_Case, function(compressor) { - return this.expression.may_throw(compressor) - || any(this.body, compressor); - }); - def(AST_Conditional, function(compressor) { - return this.condition.may_throw(compressor) - || this.consequent.may_throw(compressor) - || this.alternative.may_throw(compressor); - }); - def(AST_DefaultValue, function(compressor) { - return this.name.may_throw(compressor) - || this.value && this.value.may_throw(compressor); - }); - def(AST_Definitions, function(compressor) { - return any(this.definitions, compressor); - }); - def(AST_Dot, function(compressor) { - return !this.optional && this.expression.may_throw_on_access(compressor) - || this.expression.may_throw(compressor); - }); - def(AST_ForEnumeration, function(compressor) { - if (this.init.may_throw(compressor)) return true; - var obj = this.object; - if (obj.may_throw(compressor)) return true; - obj = obj.tail_node(); - if (!(obj instanceof AST_Array || obj.is_string(compressor))) return true; - return this.body.may_throw(compressor); - }); - def(AST_If, function(compressor) { - return this.condition.may_throw(compressor) - || this.body && this.body.may_throw(compressor) - || this.alternative && this.alternative.may_throw(compressor); - }); - def(AST_LabeledStatement, function(compressor) { - return this.body.may_throw(compressor); - }); - def(AST_Object, function(compressor) { - return any(this.properties, compressor); - }); - def(AST_ObjectProperty, function(compressor) { - return this.value.may_throw(compressor) - || this.key instanceof AST_Node && this.key.may_throw(compressor); - }); - def(AST_Return, function(compressor) { - return this.value && this.value.may_throw(compressor); - }); - def(AST_Sequence, function(compressor) { - return any(this.expressions, compressor); - }); - def(AST_SimpleStatement, function(compressor) { - return this.body.may_throw(compressor); - }); - def(AST_Sub, function(compressor) { - return !this.optional && this.expression.may_throw_on_access(compressor) - || this.expression.may_throw(compressor) - || this.property.may_throw(compressor); - }); - def(AST_Switch, function(compressor) { - return this.expression.may_throw(compressor) - || any(this.body, compressor); - }); - def(AST_SymbolRef, function(compressor) { - return !this.is_declared(compressor) || !can_drop_symbol(this, compressor); - }); - def(AST_Template, function(compressor) { - if (any(this.expressions, compressor)) return true; - if (this.is_expr_pure(compressor)) return false; - if (!this.tag) return false; - this.may_throw = return_true; - var ret = call_may_throw(this.tag, compressor); - delete this.may_throw; - return ret; - }); - def(AST_Try, function(compressor) { - return (this.bcatch ? this.bcatch.may_throw(compressor) : any(this.body, compressor)) - || this.bfinally && this.bfinally.may_throw(compressor); - }); - def(AST_Unary, function(compressor) { - return this.expression.may_throw(compressor) - && !(this.operator == "typeof" && this.expression instanceof AST_SymbolRef); - }); - def(AST_VarDef, function(compressor) { - return this.name.may_throw(compressor) - || this.value && this.value.may_throw(compressor); - }); - })(function(node, func) { - node.DEFMETHOD("may_throw", func); - }); - - // determine if expression is constant - (function(def) { - function all_constant(list, scope) { - for (var i = list.length; --i >= 0;) - if (!list[i].is_constant_expression(scope)) - return false; - return true; - } - def(AST_Node, return_false); - def(AST_Array, function(scope) { - return all_constant(this.elements, scope); - }); - def(AST_Binary, function(scope) { - return this.left.is_constant_expression(scope) - && this.right.is_constant_expression(scope) - && can_drop_op(this.operator, this.right); - }); - def(AST_Class, function(scope) { - var base = this.extends; - if (base && !safe_for_extends(base)) return false; - return all_constant(this.properties, scope); - }); - def(AST_ClassProperty, function(scope) { - return typeof this.key == "string" && (!this.value || this.value.is_constant_expression(scope)); - }); - def(AST_Constant, return_true); - def(AST_Lambda, function(scope) { - var self = this; - var result = true; - var scopes = []; - self.walk(new TreeWalker(function(node, descend) { - if (!result) return true; - if (node instanceof AST_BlockScope) { - if (node === self) return; - scopes.push(node); - descend(); - scopes.pop(); - return true; - } - if (node instanceof AST_SymbolRef) { - if (self.inlined || node.redef || node.in_arg) { - result = false; - return true; - } - if (self.variables.has(node.name)) return true; - var def = node.definition(); - if (member(def.scope, scopes)) return true; - if (scope && !def.redefined()) { - var scope_def = scope.find_variable(node.name); - if (scope_def ? scope_def === def : def.undeclared) { - result = "f"; - return true; - } - } - result = false; - return true; - } - if (node instanceof AST_ObjectIdentity) { - if (is_arrow(self) && all(scopes, function(s) { - return !(s instanceof AST_Scope) || is_arrow(s); - })) result = false; - return true; - } - })); - return result; - }); - def(AST_Object, function(scope) { - return all_constant(this.properties, scope); - }); - def(AST_ObjectProperty, function(scope) { - return typeof this.key == "string" && this.value.is_constant_expression(scope); - }); - def(AST_Unary, function(scope) { - return this.expression.is_constant_expression(scope); - }); - })(function(node, func) { - node.DEFMETHOD("is_constant_expression", func); - }); - - // tell me if a statement aborts - function aborts(thing) { - return thing && thing.aborts(); - } - (function(def) { - def(AST_Statement, return_null); - def(AST_Jump, return_this); - function block_aborts() { - var n = this.body.length; - return n > 0 && aborts(this.body[n - 1]); - } - def(AST_BlockStatement, block_aborts); - def(AST_SwitchBranch, block_aborts); - def(AST_If, function() { - return this.alternative && aborts(this.body) && aborts(this.alternative) && this; - }); - })(function(node, func) { - node.DEFMETHOD("aborts", func); - }); - - /* -----[ optimizers ]----- */ - - var directives = makePredicate(["use asm", "use strict"]); - OPT(AST_Directive, function(self, compressor) { - if (compressor.option("directives") - && (!directives[self.value] || compressor.has_directive(self.value) !== self)) { - return make_node(AST_EmptyStatement, self); - } - return self; - }); - - OPT(AST_Debugger, function(self, compressor) { - if (compressor.option("drop_debugger")) - return make_node(AST_EmptyStatement, self); - return self; - }); - - OPT(AST_LabeledStatement, function(self, compressor) { - if (self.body instanceof AST_If || self.body instanceof AST_Break) { - var body = tighten_body([ self.body ], compressor); - switch (body.length) { - case 0: - self.body = make_node(AST_EmptyStatement, self); - break; - case 1: - self.body = body[0]; - break; - default: - self.body = make_node(AST_BlockStatement, self, { body: body }); - break; - } - } - return compressor.option("unused") && self.label.references.length == 0 ? self.body : self; - }); - - OPT(AST_LoopControl, function(self, compressor) { - if (!compressor.option("dead_code")) return self; - var label = self.label; - if (label) { - var lct = compressor.loopcontrol_target(self); - self.label = null; - if (compressor.loopcontrol_target(self) === lct) { - remove(label.thedef.references, self); - } else { - self.label = label; - } - } - return self; - }); - - OPT(AST_Block, function(self, compressor) { - self.body = tighten_body(self.body, compressor); - return self; - }); - - function trim_block(node, parent, in_list) { - switch (node.body.length) { - case 0: - return in_list ? List.skip : make_node(AST_EmptyStatement, node); - case 1: - var stat = node.body[0]; - if (!safe_to_trim(stat)) return node; - if (parent instanceof AST_IterationStatement && stat instanceof AST_LambdaDefinition) return node; - return stat; - } - return node; - } - - OPT(AST_BlockStatement, function(self, compressor) { - self.body = tighten_body(self.body, compressor); - return trim_block(self, compressor.parent()); - }); - - function drop_rest_farg(fn, compressor) { - if (!compressor.option("rests")) return; - if (fn.uses_arguments) return; - if (!(fn.rest instanceof AST_DestructuredArray)) return; - if (!compressor.drop_fargs(fn, compressor.parent())) return; - fn.argnames = fn.argnames.concat(fn.rest.elements); - fn.rest = fn.rest.rest; - } - - OPT(AST_Lambda, function(self, compressor) { - drop_rest_farg(self, compressor); - self.body = tighten_body(self.body, compressor); - return self; - }); - - function opt_arrow(self, compressor) { - if (!compressor.option("arrows")) return self; - drop_rest_farg(self, compressor); - if (self.value) self.body = [ self.first_statement() ]; - var body = tighten_body(self.body, compressor); - switch (body.length) { - case 1: - var stat = body[0]; - if (stat instanceof AST_Return) { - self.body.length = 0; - self.value = stat.value; - break; - } - default: - self.body = body; - self.value = null; - break; - } - return self; - } - OPT(AST_Arrow, opt_arrow); - OPT(AST_AsyncArrow, opt_arrow); - - OPT(AST_Function, function(self, compressor) { - drop_rest_farg(self, compressor); - self.body = tighten_body(self.body, compressor); - var parent = compressor.parent(); - if (compressor.option("inline")) for (var i = 0; i < self.body.length; i++) { - var stat = self.body[i]; - if (stat instanceof AST_Directive) continue; - if (stat instanceof AST_Return) { - if (i != self.body.length - 1) break; - var call = stat.value; - if (!call || call.TYPE != "Call") break; - if (call.is_expr_pure(compressor)) break; - var exp = call.expression, fn; - if (!(exp instanceof AST_SymbolRef)) { - fn = exp; - } else if (self.name && self.name.definition() === exp.definition()) { - break; - } else { - fn = exp.fixed_value(); - } - if (!(fn instanceof AST_Defun || fn instanceof AST_Function)) break; - if (fn.rest) break; - if (fn.uses_arguments) break; - if (fn === exp) { - if (fn.parent_scope !== self) break; - if (!all(fn.enclosed, function(def) { - return def.scope !== self; - })) break; - } - if ((fn !== exp || fn.name) - && (parent instanceof AST_ClassMethod || parent instanceof AST_ObjectMethod) - && parent.value === compressor.self()) break; - if (fn.contains_this()) break; - var len = fn.argnames.length; - if (len > 0 && compressor.option("inline") < 2) break; - if (len > self.argnames.length) break; - if (!all(self.argnames, function(argname) { - return argname instanceof AST_SymbolFunarg; - })) break; - if (!all(call.args, function(arg) { - return !(arg instanceof AST_Spread); - })) break; - for (var j = 0; j < len; j++) { - var arg = call.args[j]; - if (!(arg instanceof AST_SymbolRef)) break; - if (arg.definition() !== self.argnames[j].definition()) break; - } - if (j < len) break; - for (; j < call.args.length; j++) { - if (call.args[j].has_side_effects(compressor)) break; - } - if (j < call.args.length) break; - if (len < self.argnames.length && !compressor.drop_fargs(self, parent)) { - if (!compressor.drop_fargs(fn, call)) break; - do { - fn.argnames.push(fn.make_var(AST_SymbolFunarg, fn, "argument_" + len)); - } while (++len < self.argnames.length); - } - return exp; - } - break; - } - return self; - }); - - var NO_MERGE = makePredicate("arguments await yield"); - AST_Scope.DEFMETHOD("merge_variables", function(compressor) { - if (!compressor.option("merge_vars")) return; - var in_arg = [], in_try, root, segment = {}, self = this; - var first = [], last = [], index = 0; - var declarations = new Dictionary(); - var references = Object.create(null); - var prev = Object.create(null); - var tw = new TreeWalker(function(node, descend) { - if (node instanceof AST_Assign) { - var lhs = node.left; - var rhs = node.right; - if (lhs instanceof AST_Destructured) { - rhs.walk(tw); - walk_destructured(AST_SymbolRef, mark, lhs); - return true; - } - if (lazy_op[node.operator.slice(0, -1)]) { - lhs.walk(tw); - push(); - rhs.walk(tw); - if (lhs instanceof AST_SymbolRef) mark(lhs); - pop(); - return true; - } - if (lhs instanceof AST_SymbolRef) { - if (node.operator != "=") mark(lhs, true); - rhs.walk(tw); - mark(lhs); - return true; - } - return; - } - if (node instanceof AST_Binary) { - if (!lazy_op[node.operator]) return; - walk_cond(node); - return true; - } - if (node instanceof AST_Break) { - var target = tw.loopcontrol_target(node); - if (!(target instanceof AST_IterationStatement)) insert(target); - return true; - } - if (node instanceof AST_Call) { - var exp = node.expression; - if (exp instanceof AST_LambdaExpression) { - node.args.forEach(function(arg) { - arg.walk(tw); - }); - exp.walk(tw); - } else { - descend(); - mark_expression(exp); - } - return true; - } - if (node instanceof AST_Class) { - if (node.name) node.name.walk(tw); - if (node.extends) node.extends.walk(tw); - node.properties.filter(function(prop) { - if (prop.key instanceof AST_Node) prop.key.walk(tw); - return prop.value; - }).forEach(function(prop) { - if (prop.static) { - prop.value.walk(tw); - } else { - push(); - segment.block = node; - prop.value.walk(tw); - pop(); - } - }); - return true; - } - if (node instanceof AST_Conditional) { - walk_cond(node.condition, node.consequent, node.alternative); - return true; - } - if (node instanceof AST_Continue) { - var target = tw.loopcontrol_target(node); - if (target instanceof AST_Do) insert(target); - return true; - } - if (node instanceof AST_Do) { - push(); - segment.block = node; - segment.loop = true; - var save = segment; - node.body.walk(tw); - if (segment.inserted === node) segment = save; - node.condition.walk(tw); - pop(); - return true; - } - if (node instanceof AST_For) { - if (node.init) node.init.walk(tw); - push(); - segment.block = node; - segment.loop = true; - if (node.condition) node.condition.walk(tw); - node.body.walk(tw); - if (node.step) node.step.walk(tw); - pop(); - return true; - } - if (node instanceof AST_ForEnumeration) { - node.object.walk(tw); - push(); - segment.block = node; - segment.loop = true; - node.init.walk(tw); - node.body.walk(tw); - pop(); - return true; - } - if (node instanceof AST_If) { - walk_cond(node.condition, node.body, node.alternative); - return true; - } - if (node instanceof AST_LabeledStatement) { - push(); - segment.block = node; - var save = segment; - node.body.walk(tw); - if (segment.inserted === node) segment = save; - pop(); - return true; - } - if (node instanceof AST_Scope) { - push(); - segment.block = node; - if (node === self) root = segment; - if (node instanceof AST_Lambda) { - if (node.name) references[node.name.definition().id] = false; - var marker = node.uses_arguments && !tw.has_directive("use strict") ? function(node) { - references[node.definition().id] = false; - } : function(node) { - mark(node); - }; - in_arg.push(node); - node.argnames.forEach(function(argname) { - walk_destructured(AST_SymbolFunarg, marker, argname); - }); - if (node.rest) walk_destructured(AST_SymbolFunarg, marker, node.rest); - in_arg.pop(); - } - walk_lambda(node, tw); - pop(); - return true; - } - if (node instanceof AST_Sub) { - var exp = node.expression; - if (node.optional) { - exp.walk(tw); - push(); - node.property.walk(tw); - pop(); - } else { - descend(); - } - mark_expression(exp); - return true; - } - if (node instanceof AST_Switch) { - node.expression.walk(tw); - var save = segment; - node.body.forEach(function(branch) { - if (branch instanceof AST_Default) return; - branch.expression.walk(tw); - if (save === segment) push(); - }); - segment = save; - node.body.forEach(function(branch) { - push(); - segment.block = node; - var save = segment; - walk_body(branch, tw); - if (segment.inserted === node) segment = save; - pop(); - }); - return true; - } - if (node instanceof AST_SymbolConst || node instanceof AST_SymbolLet) { - references[node.definition().id] = false; - return true; - } - if (node instanceof AST_SymbolRef) { - mark(node, true); - return true; - } - if (node instanceof AST_Try) { - var save_try = in_try; - in_try = node; - walk_body(node, tw); - if (node.bcatch) { - if (node.bcatch.argname) node.bcatch.argname.mark_symbol(function(node) { - if (node instanceof AST_SymbolCatch) { - var def = node.definition(); - references[def.id] = false; - if (def = def.redefined()) references[def.id] = false; - } - }, tw); - if (node.bfinally || (in_try = save_try)) { - walk_body(node.bcatch, tw); - } else { - push(); - walk_body(node.bcatch, tw); - pop(); - } - } - in_try = save_try; - if (node.bfinally) node.bfinally.walk(tw); - return true; - } - if (node instanceof AST_Unary) { - if (!UNARY_POSTFIX[node.operator]) return; - var sym = node.expression; - if (!(sym instanceof AST_SymbolRef)) return; - mark(sym, true); - return true; - } - if (node instanceof AST_VarDef) { - var assigned = node.value; - if (assigned) { - assigned.walk(tw); - } else { - assigned = segment.block instanceof AST_ForEnumeration && segment.block.init === tw.parent(); - } - walk_destructured(AST_SymbolDeclaration, assigned ? function(node) { - if (node instanceof AST_SymbolVar) { - mark(node); - } else { - node.walk(tw); - } - } : function(node) { - if (node instanceof AST_SymbolVar) { - var id = node.definition().id; - var refs = references[id]; - if (refs) { - refs.push(node); - } else if (!(id in references)) { - declarations.add(id, node); - } - } else { - node.walk(tw); - } - }, node.name); - return true; - } - if (node instanceof AST_While) { - push(); - segment.block = node; - segment.loop = true; - descend(); - pop(); - return true; - } - - function mark_expression(exp) { - if (!compressor.option("ie")) return; - var sym = root_expr(exp); - if (sym instanceof AST_SymbolRef) sym.walk(tw); - } - - function walk_cond(condition, consequent, alternative) { - var save = segment; - var segments = [ save, save ]; - if (condition instanceof AST_Binary) switch (condition.operator) { - case "&&": - segments[0] = walk_cond(condition.left, condition.right)[0]; - break; - case "||": - case "??": - segments[1] = walk_cond(condition.left, null, condition.right)[1]; - break; - default: - condition.walk(tw); - break; - } else if (condition instanceof AST_Conditional) { - walk_cond(condition.condition, condition.consequent, condition.alternative); - } else { - condition.walk(tw); - } - segment = segments[0]; - if (consequent) { - push(); - consequent.walk(tw); - } - segments[0] = segment; - segment = segments[1]; - if (alternative) { - push(); - alternative.walk(tw); - } - segments[1] = segment; - segment = save; - return segments; - } - }); - tw.directives = Object.create(compressor.directives); - self.walk(tw); - var changed = false; - var merged = Object.create(null); - while (first.length && last.length) { - var tail = last.shift(); - if (!tail) continue; - var def = tail.definition; - var tail_refs = references[def.id]; - if (!tail_refs) continue; - tail_refs = { end: tail_refs.end }; - while (def.id in merged) def = merged[def.id]; - tail_refs.start = references[def.id].start; - var skipped = []; - do { - var head = first.shift(); - if (tail.index > head.index) continue; - var prev_def = head.definition; - if (!(prev_def.id in prev)) continue; - var head_refs = references[prev_def.id]; - if (!head_refs) continue; - if (head_refs.start.block !== tail_refs.start.block - || !mergeable(head_refs, tail_refs) - || (head_refs.start.loop || !same_scope(def)) && !mergeable(tail_refs, head_refs) - || compressor.option("webkit") && is_funarg(def) !== is_funarg(prev_def) - || prev_def.const_redefs - || !all(head_refs.scopes, function(scope) { - return scope.find_variable(def.name) === def; - })) { - skipped.push(head); - continue; - } - head_refs.forEach(function(sym) { - sym.thedef = def; - sym.name = def.name; - if (sym instanceof AST_SymbolRef) { - def.references.push(sym); - prev_def.replaced++; - } else { - def.orig.push(sym); - prev_def.eliminated++; - } - }); - if (!prev_def.fixed) def.fixed = false; - merged[prev_def.id] = def; - changed = true; - break; - } while (first.length); - if (skipped.length) first = skipped.concat(first); - } - return changed; - - function push() { - segment = Object.create(segment); - } - - function pop() { - segment = Object.getPrototypeOf(segment); - } - - function walk_destructured(symbol_type, mark, lhs) { - var marker = new TreeWalker(function(node) { - if (node instanceof AST_Destructured) return; - if (node instanceof AST_DefaultValue) { - push(); - node.value.walk(tw); - pop(); - node.name.walk(marker); - } else if (node instanceof AST_DestructuredKeyVal) { - if (!(node.key instanceof AST_Node)) { - node.value.walk(marker); - } else if (node.value instanceof AST_PropAccess) { - push(); - segment.block = node; - node.key.walk(tw); - node.value.walk(marker); - pop(); - } else { - node.key.walk(tw); - node.value.walk(marker); - } - } else if (node instanceof symbol_type) { - mark(node); - } else { - node.walk(tw); - } - return true; - }); - lhs.walk(marker); - } - - function mark(sym, read) { - var def = sym.definition(), ldef; - if (read && !all(in_arg, function(fn) { - ldef = fn.variables.get(sym.name); - if (!ldef) return true; - if (!is_funarg(ldef)) return true; - return ldef !== def - && !def.undeclared - && fn.parent_scope.find_variable(sym.name) !== def; - })) return references[def.id] = references[ldef.id] = false; - var seg = segment; - if (in_try) { - push(); - seg = segment; - pop(); - } - if (def.id in references) { - var refs = references[def.id]; - if (!refs) return; - if (refs.start.block !== seg.block) return references[def.id] = false; - push_ref(sym); - refs.end = seg; - if (def.id in prev) { - last[prev[def.id]] = null; - } else if (!read) { - return; - } - } else if ((ldef = self.variables.get(def.name)) !== def) { - if (ldef && root === seg) references[ldef.id] = false; - return references[def.id] = false; - } else if (compressor.exposed(def) || NO_MERGE[sym.name]) { - return references[def.id] = false; - } else { - var refs = declarations.get(def.id) || []; - refs.scopes = []; - push_ref(sym); - references[def.id] = refs; - if (!read) { - refs.start = seg; - return first.push({ - index: index++, - definition: def, - }); - } - if (seg.block !== self) return references[def.id] = false; - refs.start = root; - } - prev[def.id] = last.length; - last.push({ - index: index++, - definition: def, - }); - - function push_ref(sym) { - refs.push(sym); - push_uniq(refs.scopes, sym.scope); - var scope = find_scope(tw); - if (scope !== sym.scope) push_uniq(refs.scopes, scope); - } - } - - function insert(target) { - var stack = []; - while (true) { - if (HOP(segment, "block")) { - var block = segment.block; - if (block instanceof AST_LabeledStatement) block = block.body; - if (block === target) break; - } - stack.push(segment); - pop(); - } - segment.inserted = segment.block; - push(); - while (stack.length) { - var seg = stack.pop(); - push(); - if (HOP(seg, "block")) segment.block = seg.block; - if (HOP(seg, "loop")) segment.loop = seg.loop; - } - } - - function must_visit(base, segment) { - return base === segment || base.isPrototypeOf(segment); - } - - function mergeable(head, tail) { - return must_visit(head.start, head.end) || must_visit(head.start, tail.start); - } - }); - - function fill_holes(orig, elements) { - for (var i = elements.length; --i >= 0;) { - if (!elements[i]) elements[i] = make_node(AST_Hole, orig); - } - } - - function to_class_expr(defcl, drop_name) { - var cl = make_node(AST_ClassExpression, defcl); - if (cl.name) cl.name = drop_name ? null : make_node(AST_SymbolClass, cl.name); - return cl; - } - - function to_func_expr(defun, drop_name) { - var ctor; - switch (defun.CTOR) { - case AST_AsyncDefun: - ctor = AST_AsyncFunction; - break; - case AST_AsyncGeneratorDefun: - ctor = AST_AsyncGeneratorFunction; - break; - case AST_Defun: - ctor = AST_Function; - break; - case AST_GeneratorDefun: - ctor = AST_GeneratorFunction; - break; - } - var fn = make_node(ctor, defun); - fn.name = drop_name ? null : make_node(AST_SymbolLambda, defun.name); - return fn; - } - - AST_Scope.DEFMETHOD("drop_unused", function(compressor) { - if (!compressor.option("unused")) return; - var self = this; - var drop_funcs = !(self instanceof AST_Toplevel) || compressor.toplevel.funcs; - var drop_vars = !(self instanceof AST_Toplevel) || compressor.toplevel.vars; - var assign_as_unused = /keep_assign/.test(compressor.option("unused")) ? return_false : function(node, props) { - var sym, nested = false; - if (node instanceof AST_Assign) { - if (node.write_only || node.operator == "=") sym = extract_reference(node.left, props); - } else if (node instanceof AST_Unary) { - if (node.write_only) sym = extract_reference(node.expression, props); - } - if (!(sym instanceof AST_SymbolRef)) return; - var def = sym.definition(); - if (export_defaults[def.id]) return; - if (compressor.exposed(def)) return; - if (!can_drop_symbol(sym, compressor, nested)) return; - return sym; - - function extract_reference(node, props) { - if (node instanceof AST_PropAccess) { - var expr = node.expression; - if (!expr.may_throw_on_access(compressor, true)) { - nested = true; - if (props && node instanceof AST_Sub) props.unshift(node.property); - return extract_reference(expr, props); - } - } else if (node instanceof AST_Assign && node.operator == "=") { - node.write_only = "p"; - var ref = extract_reference(node.right); - if (!props) return ref; - props.assign = node; - return ref instanceof AST_SymbolRef ? ref : node.left; - } - return node; - } - }; - var assign_in_use = Object.create(null); - var export_defaults = Object.create(null); - var find_variable = function(name) { - find_variable = compose(self, 0, noop); - return find_variable(name); - - function compose(child, level, find) { - var parent = compressor.parent(level); - if (!parent) return find; - var in_arg = parent instanceof AST_Lambda && member(child, parent.argnames); - return compose(parent, level + 1, in_arg ? function(name) { - var def = find(name); - if (def) return def; - def = parent.variables.get(name); - if (def) { - var sym = def.orig[0]; - if (sym instanceof AST_SymbolFunarg || sym instanceof AST_SymbolLambda) return def; - } - } : parent.variables ? function(name) { - return find(name) || parent.variables.get(name); - } : find); - } - }; - var for_ins = Object.create(null); - var in_use = []; - var in_use_ids = Object.create(null); // avoid expensive linear scans of in_use - var lambda_ids = Object.create(null); - var value_read = Object.create(null); - var value_modified = Object.create(null); - var var_defs = Object.create(null); - if (self instanceof AST_Toplevel && compressor.top_retain) { - self.variables.each(function(def) { - if (compressor.top_retain(def) && !(def.id in in_use_ids)) { - AST_Node.info("Retaining variable {name}", def); - in_use_ids[def.id] = true; - in_use.push(def); - } - }); - } - var assignments = new Dictionary(); - var initializations = new Dictionary(); - // pass 1: find out which symbols are directly used in - // this scope (not in nested scopes). - var scope = this; - var tw = new TreeWalker(function(node, descend) { - if (node instanceof AST_Lambda && node.uses_arguments && !tw.has_directive("use strict")) { - node.each_argname(function(argname) { - var def = argname.definition(); - if (!(def.id in in_use_ids)) { - in_use_ids[def.id] = true; - in_use.push(def); - } - }); - } - if (node === self) return; - if (scope === self) { - if (node instanceof AST_DefClass) { - var def = node.name.definition(); - var drop = drop_funcs && !def.exported; - if (!drop && !(def.id in in_use_ids)) { - in_use_ids[def.id] = true; - in_use.push(def); - } - var used = tw.parent() instanceof AST_ExportDefault; - if (used) { - export_defaults[def.id] = true; - } else if (drop && !(def.id in lambda_ids)) { - lambda_ids[def.id] = 1; - } - if (node.extends) node.extends.walk(tw); - var values = []; - node.properties.forEach(function(prop) { - if (prop.key instanceof AST_Node) prop.key.walk(tw); - var value = prop.value; - if (!value) return; - if (is_static_field_or_init(prop)) { - if (!used && value.contains_this()) used = true; - walk_class_prop(value); - } else { - values.push(value); - } - }); - values.forEach(drop && used ? walk_class_prop : function(value) { - initializations.add(def.id, value); - }); - return true; - } - if (node instanceof AST_LambdaDefinition) { - var def = node.name.definition(); - var drop = drop_funcs && !def.exported; - if (!drop && !(def.id in in_use_ids)) { - in_use_ids[def.id] = true; - in_use.push(def); - } - initializations.add(def.id, node); - if (tw.parent() instanceof AST_ExportDefault) { - export_defaults[def.id] = true; - return scan_ref_scoped(node, descend, true); - } - if (drop && !(def.id in lambda_ids)) lambda_ids[def.id] = 1; - return true; - } - if (node instanceof AST_Definitions) { - node.definitions.forEach(function(defn) { - var value = defn.value; - var side_effects = value - && (defn.name instanceof AST_Destructured || value.has_side_effects(compressor)); - var shared = side_effects && value.tail_node().operator == "="; - defn.name.mark_symbol(function(name) { - if (!(name instanceof AST_SymbolDeclaration)) return; - var def = name.definition(); - var_defs[def.id] = (var_defs[def.id] || 0) + 1; - if (node instanceof AST_Var && def.orig[0] instanceof AST_SymbolCatch) { - var redef = def.redefined(); - if (redef) var_defs[redef.id] = (var_defs[redef.id] || 0) + 1; - } - if (!(def.id in in_use_ids) && (!drop_vars || def.exported - || (node instanceof AST_Const ? def.redefined() : def.const_redefs) - || !(node instanceof AST_Var || is_safe_lexical(def)))) { - in_use_ids[def.id] = true; - in_use.push(def); - } - if (value) { - if (!side_effects) { - initializations.add(def.id, value); - } else if (shared) { - verify_safe_usage(def, name, value_modified[def.id]); - } - assignments.add(def.id, defn); - } - unmark_lambda(def); - return true; - }, tw); - if (side_effects) value.walk(tw); - }); - return true; - } - if (node instanceof AST_SymbolFunarg) { - var def = node.definition(); - var_defs[def.id] = (var_defs[def.id] || 0) + 1; - assignments.add(def.id, node); - return true; - } - if (node instanceof AST_SymbolImport) { - var def = node.definition(); - if (!(def.id in in_use_ids) && (!drop_vars || !is_safe_lexical(def))) { - in_use_ids[def.id] = true; - in_use.push(def); - } - return true; - } - } - return scan_ref_scoped(node, descend, true); - - function walk_class_prop(value) { - var save_scope = scope; - scope = node; - value.walk(tw); - scope = save_scope; - } - }); - tw.directives = Object.create(compressor.directives); - self.walk(tw); - var drop_fn_name = compressor.option("keep_fnames") ? return_false : compressor.option("ie") ? function(def) { - return !compressor.exposed(def) && def.references.length == def.replaced; - } : function(def) { - if (!(def.id in in_use_ids)) return true; - if (def.orig.length - def.eliminated < 2) return false; - // function argument will always overshadow its name - if (def.orig[1] instanceof AST_SymbolFunarg) return true; - // retain if referenced within destructured object of argument - return all(def.references, function(ref) { - return !ref.in_arg; - }); - }; - if (compressor.option("ie")) initializations.each(function(init, id) { - if (id in in_use_ids) return; - init.forEach(function(init) { - init.walk(new TreeWalker(function(node) { - if (node instanceof AST_Function && node.name && !drop_fn_name(node.name.definition())) { - node.walk(tw); - return true; - } - if (node instanceof AST_Scope) return true; - })); - }); - }); - // pass 2: for every used symbol we need to walk its - // initialization code to figure out if it uses other - // symbols (that may not be in_use). - tw = new TreeWalker(scan_ref_scoped); - for (var i = 0; i < in_use.length; i++) { - var init = initializations.get(in_use[i].id); - if (init) init.forEach(function(init) { - init.walk(tw); - }); - } - Object.keys(assign_in_use).forEach(function(id) { - var assigns = assign_in_use[id]; - if (!assigns) { - delete assign_in_use[id]; - return; - } - assigns = assigns.reduce(function(in_use, assigns) { - assigns.forEach(function(assign) { - push_uniq(in_use, assign); - }); - return in_use; - }, []); - var in_use = (assignments.get(id) || []).filter(function(node) { - return find_if(node instanceof AST_Unary ? function(assign) { - return assign === node; - } : function(assign) { - if (assign === node) return true; - if (assign instanceof AST_Unary) return false; - return get_rvalue(assign) === get_rvalue(node); - }, assigns); - }); - if (assigns.length == in_use.length) { - assign_in_use[id] = in_use; - } else { - delete assign_in_use[id]; - } - }); - // pass 3: we should drop declarations not in_use - var calls_to_drop_args = []; - var fns_with_marked_args = []; - var trimmer = new TreeTransformer(function(node) { - if (node instanceof AST_DefaultValue) return trim_default(trimmer, node); - if (node instanceof AST_Destructured && node.rest) node.rest = node.rest.transform(trimmer); - if (node instanceof AST_DestructuredArray) { - var trim = !node.rest; - for (var i = node.elements.length; --i >= 0;) { - var element = node.elements[i].transform(trimmer); - if (element) { - node.elements[i] = element; - trim = false; - } else if (trim) { - node.elements.pop(); - } else { - node.elements[i] = make_node(AST_Hole, node.elements[i]); - } - } - return node; - } - if (node instanceof AST_DestructuredObject) { - var properties = []; - node.properties.forEach(function(prop) { - var retain = false; - if (prop.key instanceof AST_Node) { - prop.key = prop.key.transform(tt); - retain = prop.key.has_side_effects(compressor); - } - if ((retain || node.rest) && is_decl(prop.value)) { - prop.value = prop.value.transform(tt); - properties.push(prop); - } else { - var value = prop.value.transform(trimmer); - if (!value && node.rest) { - if (prop.value instanceof AST_DestructuredArray) { - value = make_node(AST_DestructuredArray, prop.value, { elements: [] }); - } else { - value = make_node(AST_DestructuredObject, prop.value, { properties: [] }); - } - } - if (value) { - prop.value = value; - properties.push(prop); - } - } - }); - node.properties = properties; - return node; - } - if (node instanceof AST_SymbolDeclaration) return trim_decl(node); - }); - var tt = new TreeTransformer(function(node, descend, in_list) { - var parent = tt.parent(); - if (drop_vars) { - var props = [], sym = assign_as_unused(node, props); - if (sym) { - var value; - if (can_drop_lhs(sym, node)) { - if (node instanceof AST_Assign) { - value = get_rhs(node); - if (node.write_only === true) value = value.drop_side_effect_free(compressor); - } - if (!value) value = make_node(AST_Number, node, { value: 0 }); - } - if (value) { - if (props.assign) { - var assign = props.assign.drop_side_effect_free(compressor); - if (assign) { - assign.write_only = true; - props.unshift(assign); - } - } - if (!(parent instanceof AST_Sequence) - || parent.tail_node() === node - || value.has_side_effects(compressor)) { - props.push(value); - } - switch (props.length) { - case 0: - return List.skip; - case 1: - return maintain_this_binding(parent, node, props[0].transform(tt)); - default: - return make_sequence(node, props.map(function(prop) { - return prop.transform(tt); - })); - } - } - } else if (node instanceof AST_UnaryPostfix - && node.expression instanceof AST_SymbolRef - && indexOf_assign(node.expression.definition(), node) < 0) { - return make_node(AST_UnaryPrefix, node, { - operator: "+", - expression: node.expression, - }); - } - } - if (node instanceof AST_Binary && node.operator == "instanceof") { - var sym = node.right; - if (!(sym instanceof AST_SymbolRef)) return; - if (sym.definition().id in in_use_ids) return; - var lhs = node.left.drop_side_effect_free(compressor); - var value = make_node(AST_False, node).optimize(compressor); - return lhs ? make_sequence(node, [ lhs, value ]) : value; - } - if (node instanceof AST_Call) { - calls_to_drop_args.push(node); - node.args = node.args.map(function(arg) { - return arg.transform(tt); - }); - node.expression = node.expression.transform(tt); - return node; - } - if (scope !== self) return; - if (drop_funcs && node !== self && node instanceof AST_DefClass) { - var def = node.name.definition(); - if (!(def.id in in_use_ids)) { - log(node.name, "Dropping unused class {name}"); - def.eliminated++; - descend(node, tt); - var trimmed = to_class_expr(node, true); - if (parent instanceof AST_ExportDefault) return trimmed; - trimmed = trimmed.drop_side_effect_free(compressor, true); - if (trimmed) return make_node(AST_SimpleStatement, node, { body: trimmed }); - return in_list ? List.skip : make_node(AST_EmptyStatement, node); - } - } - if (node instanceof AST_ClassExpression && node.name && drop_fn_name(node.name.definition())) { - node.name = null; - } - if (node instanceof AST_Lambda) { - if (drop_funcs && node !== self && node instanceof AST_LambdaDefinition) { - var def = node.name.definition(); - if (!(def.id in in_use_ids)) { - log(node.name, "Dropping unused function {name}"); - def.eliminated++; - if (parent instanceof AST_ExportDefault) { - descend_scope(); - return to_func_expr(node, true); - } - return in_list ? List.skip : make_node(AST_EmptyStatement, node); - } - } - descend_scope(); - if (node instanceof AST_LambdaExpression && node.name && drop_fn_name(node.name.definition())) { - node.name = null; - } - if (!(node instanceof AST_Accessor)) { - var args, spread, trim = compressor.drop_fargs(node, parent); - if (trim && parent instanceof AST_Call && parent.expression === node) { - args = parent.args; - for (spread = 0; spread < args.length; spread++) { - if (args[spread] instanceof AST_Spread) break; - } - } - var argnames = node.argnames; - var rest = node.rest; - var after = false, before = false; - if (rest) { - before = true; - if (!args || spread < argnames.length || rest instanceof AST_SymbolFunarg) { - rest = rest.transform(trimmer); - } else { - var trimmed = trim_destructured(rest, make_node(AST_Array, parent, { - elements: args.slice(argnames.length), - }), trim_decl, !node.uses_arguments, rest); - rest = trimmed.name; - args.length = argnames.length; - if (trimmed.value.elements.length) [].push.apply(args, trimmed.value.elements); - } - if (rest instanceof AST_Destructured && !rest.rest) { - if (rest instanceof AST_DestructuredArray) { - if (rest.elements.length == 0) rest = null; - } else if (rest.properties.length == 0) { - rest = null; - } - } - node.rest = rest; - if (rest) { - trim = false; - after = true; - } - } - var default_length = trim ? -1 : node.length(); - var trim_value = args && !node.uses_arguments && parent !== compressor.parent(); - for (var i = argnames.length; --i >= 0;) { - var sym = argnames[i]; - if (sym instanceof AST_SymbolFunarg) { - var def = sym.definition(); - if (def.id in in_use_ids) { - trim = false; - if (indexOf_assign(def, sym) < 0) sym.unused = null; - } else if (trim) { - log(sym, "Dropping unused function argument {name}"); - argnames.pop(); - def.eliminated++; - sym.unused = true; - } else { - sym.unused = true; - } - } else { - before = true; - var funarg; - if (!args || spread < i) { - funarg = sym.transform(trimmer); - } else { - var trimmed = trim_destructured(sym, args[i], trim_decl, trim_value, sym); - funarg = trimmed.name; - if (trimmed.value) args[i] = trimmed.value; - } - if (funarg) { - trim = false; - argnames[i] = funarg; - if (!after) after = !(funarg instanceof AST_SymbolFunarg); - } else if (trim) { - log_default(sym, "Dropping unused default argument {name}"); - argnames.pop(); - } else if (i > default_length) { - log_default(sym, "Dropping unused default argument assignment {name}"); - if (sym.name instanceof AST_SymbolFunarg) { - sym.name.unused = true; - } else { - after = true; - } - argnames[i] = sym.name; - } else { - log_default(sym, "Dropping unused default argument value {name}"); - argnames[i] = sym = sym.clone(); - sym.value = make_node(AST_Number, sym, { value: 0 }); - after = true; - } - } - } - if (before && !after && node.uses_arguments && !tt.has_directive("use strict")) { - node.rest = make_node(AST_DestructuredArray, node, { elements: [] }); - } - fns_with_marked_args.push(node); - } - return node; - } - if (node instanceof AST_Catch && node.argname instanceof AST_Destructured) { - node.argname.transform(trimmer); - } - if (node instanceof AST_Definitions && !(parent instanceof AST_ForEnumeration && parent.init === node)) { - // place uninitialized names at the start - var body = [], head = [], tail = []; - // for unused names whose initialization has - // side effects, we can cascade the init. code - // into the next one, or next statement. - var side_effects = []; - var duplicated = 0; - var is_var = node instanceof AST_Var; - node.definitions.forEach(function(def) { - if (def.value) def.value = def.value.transform(tt); - var value = def.value; - if (def.name instanceof AST_Destructured) { - var trimmed = trim_destructured(def.name, value, function(node) { - if (!drop_vars) return node; - if (node.definition().id in in_use_ids) return node; - if (is_catch(node)) return node; - if (is_var && !can_drop_symbol(node)) return node; - return null; - }, true); - if (trimmed.name) { - def = make_node(AST_VarDef, def, { - name: trimmed.name, - value: value = trimmed.value, - }); - flush(); - } else if (trimmed.value) { - side_effects.push(trimmed.value); - } - return; - } - var sym = def.name.definition(); - var drop_sym = is_var ? can_drop_symbol(def.name) : is_safe_lexical(sym); - if (!drop_sym || !drop_vars || sym.id in in_use_ids) { - var index; - if (value && ((index = indexOf_assign(sym, def)) < 0 || self_assign(value.tail_node()))) { - def = def.clone(); - value = value.drop_side_effect_free(compressor); - if (value) AST_Node.warn("Side effects in definition of variable {name} [{start}]", def.name); - if (node instanceof AST_Const) { - def.value = value || make_node(AST_Number, def, { value: 0 }); - } else { - def.value = null; - if (value) side_effects.push(value); - } - value = null; - if (index >= 0) assign_in_use[sym.id][index] = def; - } - var old_def, fn; - if (!value && !(node instanceof AST_Let)) { - if (parent instanceof AST_ExportDeclaration) { - flush(); - } else if (drop_sym && var_defs[sym.id] > 1) { - AST_Node.info("Dropping declaration of variable {name} [{start}]", def.name); - var_defs[sym.id]--; - sym.eliminated++; - } else { - head.push(def); - } - } else if (compressor.option("functions") - && !compressor.option("ie") - && drop_sym - && value - && var_defs[sym.id] == 1 - && sym.assignments == 0 - && (fn = value.tail_node()) instanceof AST_LambdaExpression - && !is_arguments(sym) - && !is_arrow(fn) - && assigned_once(fn, sym.references) - && can_declare_defun(fn) - && (old_def = rename_def(fn, def.name.name)) !== false) { - AST_Node.warn("Declaring {name} as function [{start}]", def.name); - var ctor; - switch (fn.CTOR) { - case AST_AsyncFunction: - ctor = AST_AsyncDefun; - break; - case AST_AsyncGeneratorFunction: - ctor = AST_AsyncGeneratorDefun; - break; - case AST_Function: - ctor = AST_Defun; - break; - case AST_GeneratorFunction: - ctor = AST_GeneratorDefun; - break; - } - var defun = make_node(ctor, fn); - defun.name = make_node(AST_SymbolDefun, def.name); - var name_def = def.name.scope.resolve().def_function(defun.name); - if (old_def) old_def.forEach(function(node) { - node.name = name_def.name; - node.thedef = name_def; - node.reference(); - }); - body.push(defun); - if (value !== fn) [].push.apply(side_effects, value.expressions.slice(0, -1)); - } else { - if (drop_sym - && var_defs[sym.id] > 1 - && !(parent instanceof AST_ExportDeclaration) - && sym.orig.indexOf(def.name) > sym.eliminated) { - var_defs[sym.id]--; - duplicated++; - } - flush(); - } - } else if (is_catch(def.name)) { - value = value && value.drop_side_effect_free(compressor); - if (value) side_effects.push(value); - if (var_defs[sym.id] > 1) { - AST_Node.warn("Dropping duplicated declaration of variable {name} [{start}]", def.name); - var_defs[sym.id]--; - sym.eliminated++; - } else { - def.value = null; - head.push(def); - } - } else { - value = value && value.drop_side_effect_free(compressor); - if (value) { - AST_Node.warn("Side effects in initialization of unused variable {name} [{start}]", def.name); - side_effects.push(value); - } else { - log(def.name, "Dropping unused variable {name}"); - } - sym.eliminated++; - } - - function self_assign(ref) { - return ref instanceof AST_SymbolRef && ref.definition() === sym; - } - - function assigned_once(fn, refs) { - if (refs.length == 0) return fn === def.name.fixed_value(); - return all(refs, function(ref) { - return fn === ref.fixed_value(); - }); - } - - function can_declare_defun(fn) { - if (!is_var || compressor.has_directive("use strict") || !(fn instanceof AST_Function)) { - return parent instanceof AST_Scope; - } - return parent instanceof AST_Block - || parent instanceof AST_For && parent.init === node - || parent instanceof AST_If; - } - - function rename_def(fn, name) { - if (!fn.name) return null; - var def = fn.name.definition(); - if (def.orig.length > 1) return null; - if (def.assignments > 0) return false; - if (def.name == name) return def; - if (compressor.option("keep_fnames")) return false; - var forbidden; - switch (name) { - case "await": - forbidden = is_async; - break; - case "yield": - forbidden = is_generator; - break; - } - return all(def.references, function(ref) { - var scope = ref.scope; - if (scope.find_variable(name) !== sym) return false; - if (forbidden) do { - scope = scope.resolve(); - if (forbidden(scope)) return false; - } while (scope !== fn && (scope = scope.parent_scope)); - return true; - }) && def; - } - - function is_catch(node) { - var sym = node.definition(); - return sym.orig[0] instanceof AST_SymbolCatch && sym.scope.resolve() === node.scope.resolve(); - } - - function flush() { - if (side_effects.length > 0) { - if (tail.length == 0) { - body.push(make_node(AST_SimpleStatement, node, { - body: make_sequence(node, side_effects), - })); - } else if (value) { - side_effects.push(value); - def.value = make_sequence(value, side_effects); - } else { - def.value = make_node(AST_UnaryPrefix, def, { - operator: "void", - expression: make_sequence(def, side_effects), - }); - } - side_effects = []; - } - tail.push(def); - } - }); - switch (head.length) { - case 0: - if (tail.length == 0) break; - if (tail.length == duplicated) { - [].unshift.apply(side_effects, tail.map(function(def) { - AST_Node.info("Dropping duplicated definition of variable {name} [{start}]", def.name); - var sym = def.name.definition(); - var ref = make_node(AST_SymbolRef, def.name); - sym.references.push(ref); - var assign = make_node(AST_Assign, def, { - operator: "=", - left: ref, - right: def.value, - }); - var index = indexOf_assign(sym, def); - if (index >= 0) assign_in_use[sym.id][index] = assign; - sym.assignments++; - sym.eliminated++; - return assign; - })); - break; - } - case 1: - if (tail.length == 0) { - var id = head[0].name.definition().id; - if (id in for_ins) { - node.definitions = head; - for_ins[id].init = node; - break; - } - } - default: - var seq; - if (tail.length > 0 && (seq = tail[0].value) instanceof AST_Sequence) { - tail[0].value = seq.tail_node(); - body.push(make_node(AST_SimpleStatement, node, { - body: make_sequence(seq, seq.expressions.slice(0, -1)), - })); - } - node.definitions = head.concat(tail); - body.push(node); - } - if (side_effects.length > 0) { - body.push(make_node(AST_SimpleStatement, node, { body: make_sequence(node, side_effects) })); - } - return insert_statements(body, node, in_list); - } - if (node instanceof AST_Assign) { - descend(node, tt); - if (!(node.left instanceof AST_Destructured)) return node; - var trimmed = trim_destructured(node.left, node.right, function(node) { - return node; - }, node.write_only === true); - if (trimmed.name) return make_node(AST_Assign, node, { - operator: node.operator, - left: trimmed.name, - right: trimmed.value, - }); - if (trimmed.value) return trimmed.value; - if (parent instanceof AST_Sequence && parent.tail_node() !== node) return List.skip; - return make_node(AST_Number, node, { value: 0 }); - } - if (node instanceof AST_LabeledStatement && node.body instanceof AST_For) { - // Certain combination of unused name + side effect leads to invalid AST: - // https://github.com/mishoo/UglifyJS/issues/1830 - // We fix it at this stage by moving the label inwards, back to the `for`. - descend(node, tt); - if (node.body instanceof AST_BlockStatement) { - var block = node.body; - node.body = block.body.pop(); - block.body.push(node); - return in_list ? List.splice(block.body) : block; - } - return node; - } - if (node instanceof AST_Scope) { - descend_scope(); - return node; - } - if (node instanceof AST_SymbolImport) { - if (!compressor.option("imports") || node.definition().id in in_use_ids) return node; - return in_list ? List.skip : null; - } - - function descend_scope() { - var save_scope = scope; - scope = node; - descend(node, tt); - scope = save_scope; - } - }, function(node, in_list) { - if (node instanceof AST_BlockStatement) return trim_block(node, tt.parent(), in_list); - if (node instanceof AST_ExportDeclaration) { - var block = node.body; - if (!(block instanceof AST_BlockStatement)) return; - node.body = block.body.pop(); - block.body.push(node); - return in_list ? List.splice(block.body) : block; - } - if (node instanceof AST_For) return patch_for_init(node, in_list); - if (node instanceof AST_ForIn) { - if (!drop_vars || !compressor.option("loops")) return; - if (!is_empty(node.body)) return; - var sym = get_init_symbol(node); - if (!sym) return; - var def = sym.definition(); - if (def.id in in_use_ids) return; - log(sym, "Dropping unused loop variable {name}"); - if (for_ins[def.id] === node) delete for_ins[def.id]; - var body = []; - var value = node.object.drop_side_effect_free(compressor); - if (value) { - AST_Node.warn("Side effects in object of for-in loop [{start}]", value); - body.push(make_node(AST_SimpleStatement, node, { body: value })); - } - if (node.init instanceof AST_Definitions && def.orig[0] instanceof AST_SymbolCatch) { - body.push(node.init); - } - return insert_statements(body, node, in_list); - } - if (node instanceof AST_Import) { - if (node.properties && node.properties.length == 0) node.properties = null; - return node; - } - if (node instanceof AST_Sequence) { - if (node.expressions.length > 1) return; - return maintain_this_binding(tt.parent(), node, node.expressions[0]); - } - }); - tt.push(compressor.parent()); - tt.directives = Object.create(compressor.directives); - self.transform(tt); - if (self instanceof AST_Lambda - && self.body.length == 1 - && self.body[0] instanceof AST_Directive - && self.body[0].value == "use strict") { - self.body.length = 0; - } - calls_to_drop_args.forEach(function(call) { - drop_unused_call_args(call, compressor, fns_with_marked_args); - }); - - function log(sym, text) { - AST_Node[sym.definition().references.length > 0 ? "info" : "warn"](text + " [{start}]", sym); - } - - function log_default(node, text) { - if (node.name instanceof AST_SymbolFunarg) { - log(node.name, text); - } else { - AST_Node.info(text + " [{start}]", node); - } - } - - function get_rvalue(expr) { - return expr[expr instanceof AST_Assign ? "right" : "value"]; - } - - function insert_statements(body, orig, in_list) { - switch (body.length) { - case 0: - return in_list ? List.skip : make_node(AST_EmptyStatement, orig); - case 1: - return body[0]; - default: - return in_list ? List.splice(body) : make_node(AST_BlockStatement, orig, { body: body }); - } - } - - function track_assigns(def, node) { - if (def.scope.resolve() !== self) return false; - if (!def.fixed || !node.fixed) assign_in_use[def.id] = false; - return assign_in_use[def.id] !== false; - } - - function add_assigns(def, node) { - if (!assign_in_use[def.id]) assign_in_use[def.id] = []; - if (node.fixed.assigns) push_uniq(assign_in_use[def.id], node.fixed.assigns); - } - - function indexOf_assign(def, node) { - var nodes = assign_in_use[def.id]; - return nodes && nodes.indexOf(node); - } - - function unmark_lambda(def) { - if (lambda_ids[def.id] > 1 && !(def.id in in_use_ids)) { - in_use_ids[def.id] = true; - in_use.push(def); - } - lambda_ids[def.id] = 0; - } - - function verify_safe_usage(def, read, modified) { - if (def.id in in_use_ids) return; - if (read && modified) { - in_use_ids[def.id] = read; - in_use.push(def); - } else { - value_read[def.id] = read; - value_modified[def.id] = modified; - } - } - - function can_drop_lhs(sym, node) { - var def = sym.definition(); - var in_use = in_use_ids[def.id]; - if (!in_use) return true; - if (node[node instanceof AST_Assign ? "left" : "expression"] !== sym) return false; - return in_use === sym && def.references.length - def.replaced == 1 || indexOf_assign(def, node) < 0; - } - - function get_rhs(assign) { - var rhs = assign.right; - if (!assign.write_only) return rhs; - if (!(rhs instanceof AST_Binary && lazy_op[rhs.operator])) return rhs; - if (!(rhs.left instanceof AST_SymbolRef)) return rhs; - if (!(assign.left instanceof AST_SymbolRef)) return rhs; - var def = assign.left.definition(); - if (rhs.left.definition() !== def) return rhs; - if (rhs.right.has_side_effects(compressor)) return rhs; - if (track_assigns(def, rhs.left)) add_assigns(def, rhs.left); - return rhs.right; - } - - function get_init_symbol(for_in) { - var init = for_in.init; - if (init instanceof AST_Definitions) { - init = init.definitions[0].name; - return init instanceof AST_SymbolDeclaration && init; - } - while (init instanceof AST_PropAccess) init = init.expression.tail_node(); - if (init instanceof AST_SymbolRef) return init; - } - - function scan_ref_scoped(node, descend, init) { - if (node instanceof AST_Assign && node.left instanceof AST_SymbolRef) { - var def = node.left.definition(); - if (def.scope.resolve() === self) assignments.add(def.id, node); - } - if (node instanceof AST_SymbolRef && node.in_arg) var_defs[node.definition().id] = 0; - if (node instanceof AST_Unary && node.expression instanceof AST_SymbolRef) { - var def = node.expression.definition(); - if (def.scope.resolve() === self) assignments.add(def.id, node); - } - var props = [], sym = assign_as_unused(node, props); - if (sym) { - var node_def = sym.definition(); - if (node_def.scope.resolve() !== self && self.variables.get(sym.name) !== node_def) return; - if (is_arguments(node_def) && !all(self.argnames, function(argname) { - return !argname.match_symbol(function(node) { - if (node instanceof AST_SymbolFunarg) { - var def = node.definition(); - return def.references.length > def.replaced; - } - }, true); - })) return; - if (node.write_only === "p" && node.right.may_throw_on_access(compressor, true)) return; - var assign = props.assign; - if (assign) { - assign.write_only = true; - assign.walk(tw); - } - props.forEach(function(prop) { - prop.walk(tw); - }); - if (node instanceof AST_Assign) { - var right = get_rhs(node), shared = false; - if (init && node.write_only === true && !right.has_side_effects(compressor)) { - initializations.add(node_def.id, right); - } else { - right.walk(tw); - shared = right.tail_node().operator == "="; - } - if (node.left === sym) { - if (!node.write_only || shared) { - verify_safe_usage(node_def, sym, value_modified[node_def.id]); - } - } else { - var fixed = sym.fixed_value(); - if (!fixed || !fixed.is_constant()) { - verify_safe_usage(node_def, value_read[node_def.id], true); - } - } - } - if (track_assigns(node_def, sym) && is_lhs(sym, node) !== sym) add_assigns(node_def, sym); - unmark_lambda(node_def); - return true; - } - if (node instanceof AST_Binary) { - if (node.operator != "instanceof") return; - var sym = node.right; - if (!(sym instanceof AST_SymbolRef)) return; - var id = sym.definition().id; - if (!lambda_ids[id]) return; - node.left.walk(tw); - lambda_ids[id]++; - return true; - } - if (node instanceof AST_ForIn) { - if (node.init instanceof AST_SymbolRef && scope === self) { - var id = node.init.definition().id; - if (!(id in for_ins)) for_ins[id] = node; - } - if (!drop_vars || !compressor.option("loops")) return; - if (!is_empty(node.body)) return; - if (node.init.has_side_effects(compressor)) return; - var sym = get_init_symbol(node); - if (!sym) return; - var def = sym.definition(); - if (def.scope.resolve() !== self) { - var d = find_variable(sym.name); - if (d === def || d && d.redefined() === def) return; - } - node.object.walk(tw); - return true; - } - if (node instanceof AST_SymbolRef) { - var node_def = node.definition(); - if (!(node_def.id in in_use_ids)) { - in_use_ids[node_def.id] = true; - in_use.push(node_def); - } - if (cross_scope(node_def.scope, node.scope)) { - var redef = node_def.redefined(); - if (redef && !(redef.id in in_use_ids)) { - in_use_ids[redef.id] = true; - in_use.push(redef); - } - } - if (track_assigns(node_def, node)) add_assigns(node_def, node); - return true; - } - if (node instanceof AST_Scope) { - var save_scope = scope; - scope = node; - descend(); - scope = save_scope; - return true; - } - } - - function is_decl(node) { - return (node instanceof AST_DefaultValue ? node.name : node) instanceof AST_SymbolDeclaration; - } - - function trim_decl(node) { - if (node.definition().id in in_use_ids) return node; - if (node instanceof AST_SymbolFunarg) node.unused = true; - return null; - } - - function trim_default(trimmer, node) { - node.value = node.value.transform(tt); - var name = node.name.transform(trimmer); - if (!name) { - if (node.name instanceof AST_Destructured) return null; - var value = node.value.drop_side_effect_free(compressor); - if (!value) return null; - log(node.name, "Side effects in default value of unused variable {name}"); - node = node.clone(); - node.name.unused = null; - node.value = value; - } - return node; - } - - function trim_destructured(node, value, process, drop, root) { - var trimmer = new TreeTransformer(function(node) { - if (node instanceof AST_DefaultValue) { - if (!(compressor.option("default_values") && value && value.is_defined(compressor))) { - var save_drop = drop; - drop = false; - var trimmed = trim_default(trimmer, node); - drop = save_drop; - if (!trimmed && drop && value) value = value.drop_side_effect_free(compressor); - return trimmed; - } else if (node === root) { - root = node = node.name; - } else { - node = node.name; - } - } - if (node instanceof AST_DestructuredArray) { - var save_drop = drop; - var save_value = value; - if (value instanceof AST_SymbolRef) { - drop = false; - value = value.fixed_value(); - } - var native, values; - if (value instanceof AST_Array) { - native = true; - values = value.elements; - } else { - native = value && value.is_string(compressor); - values = false; - } - var elements = [], newValues = drop && [], pos = 0; - node.elements.forEach(function(element, index) { - value = values && values[index]; - if (value instanceof AST_Hole) { - value = null; - } else if (value instanceof AST_Spread) { - if (drop) { - newValues.length = pos; - fill_holes(save_value, newValues); - [].push.apply(newValues, values.slice(index)); - save_value.elements = newValues; - } - value = values = false; - } - element = element.transform(trimmer); - if (element) elements[pos] = element; - if (drop && value) newValues[pos] = value; - if (element || value || !drop || !values) pos++; - }); - value = values && make_node(AST_Array, save_value, { - elements: values.slice(node.elements.length), - }); - if (node.rest) { - var was_drop = drop; - drop = false; - node.rest = node.rest.transform(compressor.option("rests") ? trimmer : tt); - drop = was_drop; - if (node.rest) elements.length = pos; - } - if (drop) { - if (value && !node.rest) value = value.drop_side_effect_free(compressor); - if (value instanceof AST_Array) { - value = value.elements; - } else if (value instanceof AST_Sequence) { - value = value.expressions; - } else if (value) { - value = [ value ]; - } - if (value && value.length) { - newValues.length = pos; - [].push.apply(newValues, value); - } - } - value = save_value; - drop = save_drop; - if (values && newValues) { - fill_holes(value, newValues); - value = value.clone(); - value.elements = newValues; - } - if (!native) { - elements.length = node.elements.length; - } else if (!node.rest) switch (elements.length) { - case 0: - if (node === root) break; - if (drop) value = value.drop_side_effect_free(compressor); - return null; - case 1: - if (!drop) break; - if (node === root) break; - var sym = elements[0]; - if (sym.has_side_effects(compressor)) break; - if (value.has_side_effects(compressor) && sym.match_symbol(function(node) { - return node instanceof AST_PropAccess; - })) break; - value = make_node(AST_Sub, node, { - expression: value, - property: make_node(AST_Number, node, { value: 0 }), - }); - return sym; - } - fill_holes(node, elements); - node.elements = elements; - return node; - } - if (node instanceof AST_DestructuredObject) { - var save_drop = drop; - var save_value = value; - if (value instanceof AST_SymbolRef) { - drop = false; - value = value.fixed_value(); - } - var prop_keys, prop_map, values; - if (value instanceof AST_Object) { - prop_keys = []; - prop_map = new Dictionary(); - values = value.properties.map(function(prop, index) { - prop = prop.clone(); - if (prop instanceof AST_Spread) { - prop_map = false; - } else { - var key = prop.key; - if (key instanceof AST_Node) key = key.evaluate(compressor, true); - if (key instanceof AST_Node) { - prop_map = false; - } else if (prop_map && !(prop instanceof AST_ObjectSetter)) { - prop_map.set(key, prop); - } - prop_keys[index] = key; - } - return prop; - }); - } - if (node.rest) { - value = false; - node.rest = node.rest.transform(compressor.option("rests") ? trimmer : tt); - } - var can_drop = new Dictionary(); - var drop_keys = drop && new Dictionary(); - var properties = []; - node.properties.map(function(prop) { - var key = prop.key; - if (key instanceof AST_Node) { - prop.key = key = key.transform(tt); - key = key.evaluate(compressor, true); - } - if (key instanceof AST_Node) { - drop_keys = false; - } else { - can_drop.set(key, !can_drop.has(key)); - } - return key; - }).forEach(function(key, index) { - var prop = node.properties[index], trimmed; - if (key instanceof AST_Node) { - drop = false; - value = false; - trimmed = prop.value.transform(trimmer) || retain_lhs(prop.value); - } else { - drop = drop_keys && can_drop.get(key); - var mapped = prop_map && prop_map.get(key); - if (mapped) { - value = mapped.value; - if (value instanceof AST_Accessor) value = false; - } else { - value = false; - } - trimmed = prop.value.transform(trimmer); - if (!trimmed) { - if (node.rest || retain_key(prop)) trimmed = retain_lhs(prop.value); - if (drop_keys && !drop_keys.has(key)) { - if (mapped) { - drop_keys.set(key, mapped); - if (value === null) { - prop_map.set(key, retain_key(mapped) && make_node(AST_ObjectKeyVal, mapped, { - key: mapped.key, - value: make_node(AST_Number, mapped, { value: 0 }), - })); - } - } else { - drop_keys.set(key, true); - } - } - } else if (drop_keys) { - drop_keys.set(key, false); - } - if (value) mapped.value = value; - } - if (trimmed) { - prop.value = trimmed; - properties.push(prop); - } - }); - value = save_value; - drop = save_drop; - if (drop_keys && prop_keys) { - value = value.clone(); - value.properties = List(values, function(prop, index) { - if (prop instanceof AST_Spread) return prop; - var key = prop_keys[index]; - if (key instanceof AST_Node) return prop; - if (drop_keys.has(key)) { - var mapped = drop_keys.get(key); - if (!mapped) return prop; - if (mapped === prop) return prop_map.get(key) || List.skip; - } else if (node.rest) { - return prop; - } - var trimmed = prop.value.drop_side_effect_free(compressor); - if (trimmed) { - prop.value = trimmed; - return prop; - } - return retain_key(prop) ? make_node(AST_ObjectKeyVal, prop, { - key: prop.key, - value: make_node(AST_Number, prop, { value: 0 }), - }) : List.skip; - }); - } - if (value && !node.rest) switch (properties.length) { - case 0: - if (node === root) break; - if (value.may_throw_on_access(compressor, true)) break; - if (drop) value = value.drop_side_effect_free(compressor); - return null; - case 1: - if (!drop) break; - if (node === root) break; - var prop = properties[0]; - if (prop.key instanceof AST_Node) break; - if (prop.value.has_side_effects(compressor)) break; - if (value.has_side_effects(compressor) && prop.value.match_symbol(function(node) { - return node instanceof AST_PropAccess; - })) break; - value = make_node(AST_Sub, node, { - expression: value, - property: make_node_from_constant(prop.key, prop), - }); - return prop.value; - } - node.properties = properties; - return node; - } - if (node instanceof AST_Hole) { - node = null; - } else { - node = process(node); - } - if (!node && drop && value) value = value.drop_side_effect_free(compressor); - return node; - }); - return { - name: node.transform(trimmer), - value: value, - }; - - function retain_key(prop) { - return prop.key instanceof AST_Node && prop.key.has_side_effects(compressor); - } - - function clear_write_only(node) { - if (node instanceof AST_Assign) { - node.write_only = false; - clear_write_only(node.right); - } else if (node instanceof AST_Binary) { - if (!lazy_op[node.operator]) return; - clear_write_only(node.left); - clear_write_only(node.right); - } else if (node instanceof AST_Conditional) { - clear_write_only(node.consequent); - clear_write_only(node.alternative); - } else if (node instanceof AST_Sequence) { - clear_write_only(node.tail_node()); - } else if (node instanceof AST_Unary) { - node.write_only = false; - } - } - - function retain_lhs(node) { - if (node instanceof AST_DefaultValue) return retain_lhs(node.name); - if (node instanceof AST_Destructured) { - if (value === null) { - value = make_node(AST_Number, node, { value: 0 }); - } else if (value) { - if (value.may_throw_on_access(compressor, true)) { - value = make_node(AST_Array, node, { - elements: value instanceof AST_Sequence ? value.expressions : [ value ], - }); - } else { - clear_write_only(value); - } - } - return make_node(AST_DestructuredObject, node, { properties: [] }); - } - node.unused = null; - return node; - } - } - }); - - AST_Scope.DEFMETHOD("hoist_declarations", function(compressor) { - if (compressor.has_directive("use asm")) return; - var hoist_funs = compressor.option("hoist_funs"); - var hoist_vars = compressor.option("hoist_vars"); - var self = this; - if (hoist_vars) { - // let's count var_decl first, we seem to waste a lot of - // space if we hoist `var` when there's only one. - var var_decl = 0; - self.walk(new TreeWalker(function(node) { - if (var_decl > 1) return true; - if (node instanceof AST_ExportDeclaration) return true; - if (node instanceof AST_Scope && node !== self) return true; - if (node instanceof AST_Var) { - var_decl++; - return true; - } - })); - if (var_decl <= 1) hoist_vars = false; - } - if (!hoist_funs && !hoist_vars) return; - var consts = new Dictionary(); - var dirs = []; - var hoisted = []; - var vars = new Dictionary(); - var tt = new TreeTransformer(function(node, descend, in_list) { - if (node === self) return; - if (node instanceof AST_Directive) { - dirs.push(node); - return in_list ? List.skip : make_node(AST_EmptyStatement, node); - } - if (node instanceof AST_LambdaDefinition) { - if (!hoist_funs) return node; - var p = tt.parent(); - if (p instanceof AST_ExportDeclaration) return node; - if (p instanceof AST_ExportDefault) return node; - if (p !== self && compressor.has_directive("use strict")) return node; - hoisted.push(node); - return in_list ? List.skip : make_node(AST_EmptyStatement, node); - } - if (node instanceof AST_Var) { - if (!hoist_vars) return node; - var p = tt.parent(); - if (p instanceof AST_ExportDeclaration) return node; - if (!all(node.definitions, function(defn) { - var sym = defn.name; - return sym instanceof AST_SymbolVar - && !consts.has(sym.name) - && self.find_variable(sym.name) === sym.definition(); - })) return node; - node.definitions.forEach(function(defn) { - vars.set(defn.name.name, defn); - }); - var seq = node.to_assignments(); - if (p instanceof AST_ForEnumeration && p.init === node) { - if (seq) return seq; - var sym = node.definitions[0].name; - return make_node(AST_SymbolRef, sym); - } - if (p instanceof AST_For && p.init === node) return seq; - if (!seq) return in_list ? List.skip : make_node(AST_EmptyStatement, node); - return make_node(AST_SimpleStatement, node, { body: seq }); - } - if (node instanceof AST_Scope) return node; - if (node instanceof AST_SymbolConst) { - consts.set(node.name, true); - return node; - } - }); - self.transform(tt); - if (vars.size() > 0) { - // collect only vars which don't show up in self's arguments list - var defns = []; - if (self instanceof AST_Lambda) self.each_argname(function(argname) { - if (all(argname.definition().references, function(ref) { - return !ref.in_arg; - })) vars.del(argname.name); - }); - vars.each(function(defn, name) { - defn = defn.clone(); - defn.name = defn.name.clone(); - defn.value = null; - defns.push(defn); - vars.set(name, defn); - defn.name.definition().orig.unshift(defn.name); - }); - if (defns.length > 0) hoisted.push(make_node(AST_Var, self, { definitions: defns })); - } - self.body = dirs.concat(hoisted, self.body); - }); - - function scan_local_returns(fn, transform) { - fn.walk(new TreeWalker(function(node) { - if (node instanceof AST_Return) { - transform(node); - return true; - } - if (node instanceof AST_Scope && node !== fn) return true; - })); - } - - function map_self_returns(fn) { - var map = Object.create(null); - scan_local_returns(fn, function(node) { - var value = node.value; - if (value) value = value.tail_node(); - if (value instanceof AST_SymbolRef) { - var id = value.definition().id; - map[id] = (map[id] || 0) + 1; - } - }); - return map; - } - - function can_trim_returns(def, self_returns, compressor) { - if (compressor.exposed(def)) return false; - switch (def.references.length - def.replaced - (self_returns[def.id] || 0)) { - case def.drop_return: - return "d"; - case def.bool_return: - return true; - } - } - - function process_boolean_returns(fn, compressor) { - scan_local_returns(fn, function(node) { - node.in_bool = true; - var value = node.value; - if (value) { - var ev = fuzzy_eval(compressor, value); - if (!ev) { - value = value.drop_side_effect_free(compressor); - node.value = value ? make_sequence(node.value, [ - value, - make_node(AST_Number, node.value, { value: 0 }), - ]) : null; - } else if (!(ev instanceof AST_Node)) { - value = value.drop_side_effect_free(compressor); - node.value = value ? make_sequence(node.value, [ - value, - make_node(AST_Number, node.value, { value: 1 }), - ]) : make_node(AST_Number, node.value, { value: 1 }); - } - } - }); - } - - AST_Scope.DEFMETHOD("process_returns", noop); - AST_Defun.DEFMETHOD("process_returns", function(compressor) { - if (!compressor.option("booleans")) return; - if (compressor.parent() instanceof AST_ExportDefault) return; - switch (can_trim_returns(this.name.definition(), map_self_returns(this), compressor)) { - case "d": - drop_returns(compressor, this, true); - break; - case true: - process_boolean_returns(this, compressor); - break; - } - }); - AST_Function.DEFMETHOD("process_returns", function(compressor) { - if (!compressor.option("booleans")) return; - var drop = true; - var self_returns = map_self_returns(this); - if (this.name && !can_trim(this.name.definition())) return; - var parent = compressor.parent(); - if (parent instanceof AST_Assign) { - if (parent.operator != "=") return; - var sym = parent.left; - if (!(sym instanceof AST_SymbolRef)) return; - if (!can_trim(sym.definition())) return; - } else if (parent instanceof AST_Call && parent.expression !== this) { - var exp = parent.expression; - if (exp instanceof AST_SymbolRef) exp = exp.fixed_value(); - if (!(exp instanceof AST_Lambda)) return; - if (exp.uses_arguments || exp.pinned()) return; - var args = parent.args, sym; - for (var i = 0; i < args.length; i++) { - var arg = args[i]; - if (arg === this) { - sym = exp.argnames[i]; - if (!sym && exp.rest) return; - break; - } - if (arg instanceof AST_Spread) return; - } - if (sym instanceof AST_DefaultValue) sym = sym.name; - if (sym instanceof AST_SymbolFunarg && !can_trim(sym.definition())) return; - } else if (parent.TYPE == "Call") { - compressor.pop(); - var in_bool = compressor.in_boolean_context(); - compressor.push(this); - switch (in_bool) { - case true: - drop = false; - case "d": - break; - default: - return; - } - } else return; - if (drop) { - drop_returns(compressor, this, true); - } else { - process_boolean_returns(this, compressor); - } - - function can_trim(def) { - switch (can_trim_returns(def, self_returns, compressor)) { - case true: - drop = false; - case "d": - return true; - } - } - }); - - AST_BlockScope.DEFMETHOD("var_names", function() { - var var_names = this._var_names; - if (!var_names) { - this._var_names = var_names = new Dictionary(); - this.enclosed.forEach(function(def) { - var_names.set(def.name, true); - }); - this.variables.each(function(def, name) { - var_names.set(name, true); - }); - } - return var_names; - }); - - AST_Scope.DEFMETHOD("make_var", function(type, orig, prefix) { - var scopes = [ this ]; - if (orig instanceof AST_SymbolDeclaration) orig.definition().references.forEach(function(ref) { - var s = ref.scope; - do { - if (!push_uniq(scopes, s)) return; - s = s.parent_scope; - } while (s && s !== this); - }); - prefix = prefix.replace(/^[^a-z_$]|[^a-z0-9_$]/gi, "_"); - var name = prefix; - for (var i = 0; !all(scopes, function(scope) { - return !scope.var_names().has(name); - }); i++) name = prefix + "$" + i; - var sym = make_node(type, orig, { - name: name, - scope: this, - }); - var def = this.def_variable(sym); - scopes.forEach(function(scope) { - scope.enclosed.push(def); - scope.var_names().set(name, true); - }); - return sym; - }); - - AST_Scope.DEFMETHOD("hoist_properties", function(compressor) { - if (!compressor.option("hoist_props") || compressor.has_directive("use asm")) return; - var self = this; - if (is_arrow(self) && self.value) return; - var top_retain = self instanceof AST_Toplevel && compressor.top_retain || return_false; - var defs_by_id = Object.create(null); - var tt = new TreeTransformer(function(node, descend) { - if (node instanceof AST_Assign) { - if (node.operator != "=") return; - if (!node.write_only) return; - if (!can_hoist(node.left, node.right, 1)) return; - descend(node, tt); - var defs = new Dictionary(); - var assignments = []; - var decls = []; - node.right.properties.forEach(function(prop) { - var decl = make_sym(AST_SymbolVar, node.left, prop.key); - decls.push(make_node(AST_VarDef, node, { - name: decl, - value: null, - })); - var sym = make_node(AST_SymbolRef, node, { - name: decl.name, - scope: self, - thedef: decl.definition(), - }); - sym.reference(); - assignments.push(make_node(AST_Assign, node, { - operator: "=", - left: sym, - right: prop.value, - })); - }); - defs.value = node.right; - defs_by_id[node.left.definition().id] = defs; - self.body.splice(self.body.indexOf(tt.stack[1]) + 1, 0, make_node(AST_Var, node, { - definitions: decls, - })); - return make_sequence(node, assignments); - } - if (node instanceof AST_Scope) { - if (node === self) return; - var parent = tt.parent(); - if (parent.TYPE == "Call" && parent.expression === node) return; - return node; - } - if (node instanceof AST_VarDef) { - if (!can_hoist(node.name, node.value, 0)) return; - descend(node, tt); - var defs = new Dictionary(); - var var_defs = []; - var decl = node.clone(); - decl.value = node.name instanceof AST_SymbolConst ? make_node(AST_Number, node, { value: 0 }) : null; - var_defs.push(decl); - node.value.properties.forEach(function(prop) { - var_defs.push(make_node(AST_VarDef, node, { - name: make_sym(node.name.CTOR, node.name, prop.key), - value: prop.value, - })); - }); - defs.value = node.value; - defs_by_id[node.name.definition().id] = defs; - return List.splice(var_defs); - } - - function make_sym(type, sym, key) { - var new_var = self.make_var(type, sym, sym.name + "_" + key); - defs.set(key, new_var.definition()); - return new_var; - } - }); - self.transform(tt); - self.transform(new TreeTransformer(function(node, descend) { - if (node instanceof AST_PropAccess) { - if (!(node.expression instanceof AST_SymbolRef)) return; - var defs = defs_by_id[node.expression.definition().id]; - if (!defs) return; - if (node.expression.fixed_value() !== defs.value) return; - var def = defs.get(node.get_property()); - var sym = make_node(AST_SymbolRef, node, { - name: def.name, - scope: node.expression.scope, - thedef: def, - }); - sym.reference(); - return sym; - } - if (node instanceof AST_SymbolRef) { - var defs = defs_by_id[node.definition().id]; - if (!defs) return; - if (node.fixed_value() !== defs.value) return; - return make_node(AST_Object, node, { properties: [] }); - } - })); - - function can_hoist(sym, right, count) { - if (!(sym instanceof AST_Symbol)) return; - var def = sym.definition(); - if (def.assignments != count) return; - if (def.references.length - def.replaced == count) return; - if (def.single_use) return; - if (self.find_variable(sym.name) !== def) return; - if (top_retain(def)) return; - if (sym.fixed_value() !== right) return; - var fixed = sym.fixed || def.fixed; - if (fixed.direct_access) return; - if (fixed.escaped && fixed.escaped.depth == 1) return; - return right instanceof AST_Object - && right.properties.length > 0 - && can_drop_symbol(sym, compressor) - && all(right.properties, function(prop) { - return can_hoist_property(prop) && prop.key !== "__proto__"; - }); - } - }); - - function fn_name_unused(fn, compressor) { - if (!fn.name || !compressor.option("ie")) return true; - var def = fn.name.definition(); - if (compressor.exposed(def)) return false; - return all(def.references, function(sym) { - return !(sym instanceof AST_SymbolRef); - }); - } - - function drop_returns(compressor, exp, ignore_name) { - if (!(exp instanceof AST_Lambda)) return; - var arrow = is_arrow(exp); - var async = is_async(exp); - var changed = false; - var drop_body = false; - if (arrow && compressor.option("arrows")) { - if (!exp.value) { - drop_body = true; - } else if (!async || needs_enqueuing(compressor, exp.value)) { - var dropped = exp.value.drop_side_effect_free(compressor); - if (dropped !== exp.value) { - changed = true; - exp.value = dropped; - } - } - } else if (!is_generator(exp)) { - if (!ignore_name && exp.name) { - var def = exp.name.definition(); - drop_body = def.references.length == def.replaced; - } else { - drop_body = true; - } - } - if (drop_body) { - exp.process_expression(false, function(node) { - var value = node.value; - if (value) { - if (async && !needs_enqueuing(compressor, value)) return node; - value = value.drop_side_effect_free(compressor, true); - } - changed = true; - if (!value) return make_node(AST_EmptyStatement, node); - return make_node(AST_SimpleStatement, node, { body: value }); - }); - scan_local_returns(exp, function(node) { - var value = node.value; - if (value) { - if (async && !needs_enqueuing(compressor, value)) return; - var dropped = value.drop_side_effect_free(compressor); - if (dropped !== value) { - changed = true; - if (dropped && async && !needs_enqueuing(compressor, dropped)) { - dropped = dropped.negate(compressor); - } - node.value = dropped; - } - } - }); - } - if (async && compressor.option("awaits")) { - if (drop_body) exp.process_expression("awaits", function(node) { - var body = node.body; - if (body instanceof AST_Await) { - if (needs_enqueuing(compressor, body.expression)) { - changed = true; - body = body.expression.drop_side_effect_free(compressor, true); - if (!body) return make_node(AST_EmptyStatement, node); - node.body = body; - } - } else if (body instanceof AST_Sequence) { - var exprs = body.expressions; - for (var i = exprs.length; --i >= 0;) { - var tail = exprs[i]; - if (!(tail instanceof AST_Await)) break; - var value = tail.expression; - if (!needs_enqueuing(compressor, value)) break; - changed = true; - if (exprs[i] = value.drop_side_effect_free(compressor)) break; - } - switch (i) { - case -1: - return make_node(AST_EmptyStatement, node); - case 0: - node.body = exprs[0]; - break; - default: - exprs.length = i + 1; - break; - } - } - return node; - }); - var abort = !drop_body && exp.name || arrow && exp.value && !needs_enqueuing(compressor, exp.value); - var tw = new TreeWalker(function(node) { - if (abort) return true; - if (tw.parent() === exp && node.may_throw(compressor)) return abort = true; - if (node instanceof AST_Await) return abort = true; - if (node instanceof AST_ForAwaitOf) return abort = true; - if (node instanceof AST_Return) { - if (node.value && !needs_enqueuing(compressor, node.value)) return abort = true; - return; - } - if (node instanceof AST_Scope && node !== exp) return true; - }); - exp.walk(tw); - if (!abort) { - var ctor; - switch (exp.CTOR) { - case AST_AsyncArrow: - ctor = AST_Arrow; - break; - case AST_AsyncFunction: - ctor = AST_Function; - break; - case AST_AsyncGeneratorFunction: - ctor = AST_GeneratorFunction; - break; - } - return make_node(ctor, exp); - } - } - return changed && exp.clone(); - } - - // drop_side_effect_free() - // remove side-effect-free parts which only affects return value - (function(def) { - // Drop side-effect-free elements from an array of expressions. - // Returns an array of expressions with side-effects or null - // if all elements were dropped. Note: original array may be - // returned if nothing changed. - function trim(nodes, compressor, first_in_statement, spread) { - var len = nodes.length; - var ret = [], changed = false; - for (var i = 0; i < len; i++) { - var node = nodes[i]; - var trimmed; - if (spread && node instanceof AST_Spread) { - trimmed = spread(node, compressor, first_in_statement); - } else { - trimmed = node.drop_side_effect_free(compressor, first_in_statement); - } - if (trimmed !== node) changed = true; - if (trimmed) { - ret.push(trimmed); - first_in_statement = false; - } - } - return ret.length ? changed ? ret : nodes : null; - } - function array_spread(node, compressor, first_in_statement) { - var exp = node.expression; - if (!exp.is_string(compressor)) return node; - return exp.drop_side_effect_free(compressor, first_in_statement); - } - function convert_spread(node) { - return node instanceof AST_Spread ? make_node(AST_Array, node, { elements: [ node ] }) : node; - } - def(AST_Node, return_this); - def(AST_Accessor, return_null); - def(AST_Array, function(compressor, first_in_statement) { - var values = trim(this.elements, compressor, first_in_statement, array_spread); - if (!values) return null; - if (values === this.elements && all(values, function(node) { - return node instanceof AST_Spread; - })) return this; - return make_sequence(this, values.map(convert_spread)); - }); - def(AST_Assign, function(compressor) { - var left = this.left; - if (left instanceof AST_PropAccess) { - var expr = left.expression; - if (expr.may_throw_on_access(compressor, true)) return this; - if (compressor.has_directive("use strict") && expr.is_constant()) return this; - } - if (left.has_side_effects(compressor)) return this; - if (lazy_op[this.operator.slice(0, -1)]) return this; - this.write_only = true; - if (!root_expr(left).is_constant_expression(compressor.find_parent(AST_Scope))) return this; - return this.right.drop_side_effect_free(compressor); - }); - def(AST_Await, function(compressor) { - if (!compressor.option("awaits")) return this; - var exp = this.expression; - if (!needs_enqueuing(compressor, exp)) return this; - if (exp instanceof AST_UnaryPrefix && exp.operator == "!") exp = exp.expression; - var dropped = exp.drop_side_effect_free(compressor); - if (dropped === exp) return this; - if (!dropped) { - dropped = make_node(AST_Number, exp, { value: 0 }); - } else if (!needs_enqueuing(compressor, dropped)) { - dropped = dropped.negate(compressor); - } - var node = this.clone(); - node.expression = dropped; - return node; - }); - def(AST_Binary, function(compressor, first_in_statement) { - var left = this.left; - var right = this.right; - var op = this.operator; - if (!can_drop_op(op, right, compressor)) { - var lhs = left.drop_side_effect_free(compressor, first_in_statement); - if (lhs === left) return this; - var node = this.clone(); - node.left = lhs || make_node(AST_Number, left, { value: 0 }); - return node; - } - var rhs = right.drop_side_effect_free(compressor, first_in_statement); - if (!rhs) return left.drop_side_effect_free(compressor, first_in_statement); - if (lazy_op[op] && rhs.has_side_effects(compressor)) { - var node = this; - if (rhs !== right) { - node = node.clone(); - node.right = rhs.drop_side_effect_free(compressor); - } - if (op == "??") return node; - var negated = node.clone(); - negated.operator = op == "&&" ? "||" : "&&"; - negated.left = left.negate(compressor, first_in_statement); - var negated_rhs = negated.right.tail_node(); - if (negated_rhs instanceof AST_Binary && negated.operator == negated_rhs.operator) swap_chain(negated); - var best = first_in_statement ? best_of_statement : best_of_expression; - return op == "&&" ? best(node, negated) : best(negated, node); - } - var lhs = left.drop_side_effect_free(compressor, first_in_statement); - if (!lhs) return rhs; - rhs = rhs.drop_side_effect_free(compressor); - if (!rhs) return lhs; - return make_sequence(this, [ lhs, rhs ]); - }); - function assign_this_only(fn, compressor) { - fn.new = true; - var result = all(fn.body, function(stat) { - return !stat.has_side_effects(compressor); - }) && all(fn.argnames, function(argname) { - return !argname.match_symbol(return_false); - }) && !(fn.rest && fn.rest.match_symbol(return_false)); - fn.new = false; - return result; - } - def(AST_Call, function(compressor, first_in_statement) { - var self = this; - if (self.is_expr_pure(compressor)) { - if (self.pure) AST_Node.warn("Dropping __PURE__ call [{start}]", self); - var args = trim(self.args, compressor, first_in_statement, array_spread); - return args && make_sequence(self, args.map(convert_spread)); - } - var exp = self.expression; - if (self.is_call_pure(compressor)) { - var exprs = self.args.slice(); - exprs.unshift(exp.expression); - exprs = trim(exprs, compressor, first_in_statement, array_spread); - return exprs && make_sequence(self, exprs.map(convert_spread)); - } - if (compressor.option("yields") && is_generator(exp)) { - var call = self.clone(); - call.expression = make_node(AST_Function, exp); - call.expression.body = []; - var opt = call.transform(compressor); - if (opt !== call) return opt.drop_side_effect_free(compressor, first_in_statement); - } - var dropped = drop_returns(compressor, exp); - if (dropped) { - // always shallow clone to ensure stripping of negated IIFEs - self = self.clone(); - self.expression = dropped; - // avoid extraneous traversal - if (exp._squeezed) self.expression._squeezed = true; - } - if (self instanceof AST_New) { - var fn = exp; - if (fn instanceof AST_SymbolRef) fn = fn.fixed_value(); - if (fn instanceof AST_Lambda) { - if (assign_this_only(fn, compressor)) { - var exprs = self.args.slice(); - exprs.unshift(exp); - exprs = trim(exprs, compressor, first_in_statement, array_spread); - return exprs && make_sequence(self, exprs.map(convert_spread)); - } - if (!fn.contains_this()) { - self = make_node(AST_Call, self); - self.expression = self.expression.clone(); - self.args = self.args.slice(); - } - } - } - self.call_only = true; - return self; - }); - def(AST_ClassExpression, function(compressor, first_in_statement) { - var self = this; - var exprs = [], values = [], init = 0; - var props = self.properties; - for (var i = 0; i < props.length; i++) { - var prop = props[i]; - if (prop.key instanceof AST_Node) exprs.push(prop.key); - if (!is_static_field_or_init(prop)) continue; - var value = prop.value; - if (!value.has_side_effects(compressor)) continue; - if (value.contains_this()) return self; - if (prop instanceof AST_ClassInit) { - init++; - values.push(prop); - } else { - values.push(value); - } - } - var base = self.extends; - if (base) { - if (base instanceof AST_SymbolRef) base = base.fixed_value(); - base = !safe_for_extends(base); - if (!base) exprs.unshift(self.extends); - } - exprs = trim(exprs, compressor, first_in_statement); - if (exprs) first_in_statement = false; - values = trim(values, compressor, first_in_statement); - if (!exprs) { - if (!base && !values && !self.name) return null; - exprs = []; - } - if (base || self.name || !compressor.has_directive("use strict")) { - var node = to_class_expr(self); - if (!base) node.extends = null; - node.properties = []; - if (values) { - if (values.length == init) { - if (exprs.length) values.unshift(make_node(AST_ClassField, self, { - key: make_sequence(self, exprs), - value: null, - })); - node.properties = values; - } else node.properties.push(make_node(AST_ClassField, self, { - static: true, - key: exprs.length ? make_sequence(self, exprs) : "c", - value: make_value(), - })); - } else if (exprs.length) node.properties.push(make_node(AST_ClassMethod, self, { - key: make_sequence(self, exprs), - value: make_node(AST_Function, self, { - argnames: [], - body: [], - }).init_vars(node), - })); - return node; - } - if (values) exprs.push(make_node(AST_Call, self, { - expression: make_node(AST_Arrow, self, { - argnames: [], - body: [], - value: make_value(), - }).init_vars(self.parent_scope), - args: [], - })); - return make_sequence(self, exprs); - - function make_value() { - return make_sequence(self, values.map(function(node) { - if (!(node instanceof AST_ClassInit)) return node; - var fn = make_node(AST_Arrow, node.value); - fn.argnames = []; - return make_node(AST_Call, node, { - expression: fn, - args: [], - }); - })); - } - }); - def(AST_Conditional, function(compressor) { - var consequent = this.consequent.drop_side_effect_free(compressor); - var alternative = this.alternative.drop_side_effect_free(compressor); - if (consequent === this.consequent && alternative === this.alternative) return this; - var exprs; - if (compressor.option("ie")) { - exprs = []; - if (consequent instanceof AST_Function) { - exprs.push(consequent); - consequent = null; - } - if (alternative instanceof AST_Function) { - exprs.push(alternative); - alternative = null; - } - } - var node; - if (!consequent) { - node = alternative ? make_node(AST_Binary, this, { - operator: "||", - left: this.condition, - right: alternative, - }) : this.condition.drop_side_effect_free(compressor); - } else if (!alternative) { - node = make_node(AST_Binary, this, { - operator: "&&", - left: this.condition, - right: consequent, - }); - } else { - node = this.clone(); - node.consequent = consequent; - node.alternative = alternative; - } - if (!exprs) return node; - if (node) exprs.push(node); - return exprs.length == 0 ? null : make_sequence(this, exprs); - }); - def(AST_Constant, return_null); - def(AST_Dot, function(compressor, first_in_statement) { - var expr = this.expression; - if (expr.may_throw_on_access(compressor)) return this; - return expr.drop_side_effect_free(compressor, first_in_statement); - }); - def(AST_Function, function(compressor) { - return fn_name_unused(this, compressor) ? null : this; - }); - def(AST_LambdaExpression, return_null); - def(AST_Object, function(compressor, first_in_statement) { - var exprs = []; - this.properties.forEach(function(prop) { - if (prop instanceof AST_Spread) { - exprs.push(prop); - } else { - if (prop.key instanceof AST_Node) exprs.push(prop.key); - exprs.push(prop.value); - } - }); - var values = trim(exprs, compressor, first_in_statement, function(node, compressor, first_in_statement) { - var exp = node.expression; - return exp.safe_to_spread() ? exp.drop_side_effect_free(compressor, first_in_statement) : node; - }); - if (!values) return null; - if (values === exprs && !all(values, function(node) { - return !(node instanceof AST_Spread); - })) return this; - return make_sequence(this, values.map(function(node) { - return node instanceof AST_Spread ? make_node(AST_Object, node, { properties: [ node ] }) : node; - })); - }); - def(AST_ObjectIdentity, return_null); - def(AST_Sequence, function(compressor, first_in_statement) { - var expressions = trim(this.expressions, compressor, first_in_statement); - if (!expressions) return null; - var end = expressions.length - 1; - var last = expressions[end]; - if (compressor.option("awaits") && end > 0 && last instanceof AST_Await && last.expression.is_constant()) { - expressions = expressions.slice(0, -1); - end--; - var expr = expressions[end]; - last.expression = needs_enqueuing(compressor, expr) ? expr : expr.negate(compressor); - expressions[end] = last; - } - var assign, cond, lhs; - if (compressor.option("conditionals") - && end > 0 - && (assign = expressions[end - 1]) instanceof AST_Assign - && assign.operator == "=" - && (lhs = assign.left) instanceof AST_SymbolRef - && (cond = to_conditional_assignment(compressor, lhs.definition(), assign.right, last))) { - assign = assign.clone(); - assign.right = cond; - expressions = expressions.slice(0, -2); - expressions.push(assign.drop_side_effect_free(compressor, first_in_statement)); - } - return expressions === this.expressions ? this : make_sequence(this, expressions); - }); - def(AST_Sub, function(compressor, first_in_statement) { - var expr = this.expression; - if (expr.may_throw_on_access(compressor)) return this; - var prop = this.property; - expr = expr.drop_side_effect_free(compressor, first_in_statement); - if (!expr) return prop.drop_side_effect_free(compressor, first_in_statement); - prop = prop.drop_side_effect_free(compressor); - if (!prop) return expr; - return make_sequence(this, [ expr, prop ]); - }); - def(AST_SymbolRef, function(compressor) { - return this.is_declared(compressor) && can_drop_symbol(this, compressor) ? null : this; - }); - def(AST_Template, function(compressor, first_in_statement) { - var self = this; - if (self.is_expr_pure(compressor)) { - var expressions = self.expressions; - if (expressions.length == 0) return null; - return make_sequence(self, expressions).drop_side_effect_free(compressor, first_in_statement); - } - var tag = self.tag; - var dropped = drop_returns(compressor, tag); - if (dropped) { - // always shallow clone to signal internal changes - self = self.clone(); - self.tag = dropped; - // avoid extraneous traversal - if (tag._squeezed) self.tag._squeezed = true; - } - return self; - }); - def(AST_Unary, function(compressor, first_in_statement) { - var exp = this.expression; - if (unary_side_effects[this.operator]) { - this.write_only = !exp.has_side_effects(compressor); - return this; - } - if (this.operator == "typeof" && exp instanceof AST_SymbolRef && can_drop_symbol(exp, compressor)) { - return null; - } - var node = exp.drop_side_effect_free(compressor, first_in_statement); - if (first_in_statement && node && is_iife_call(node)) { - if (node === exp && this.operator == "!") return this; - return node.negate(compressor, first_in_statement); - } - return node; - }); - })(function(node, func) { - node.DEFMETHOD("drop_side_effect_free", func); - }); - - OPT(AST_SimpleStatement, function(self, compressor) { - if (compressor.option("side_effects")) { - var body = self.body; - var node = body.drop_side_effect_free(compressor, true); - if (!node) { - AST_Node.warn("Dropping side-effect-free statement [{start}]", self); - return make_node(AST_EmptyStatement, self); - } - if (node !== body) { - return make_node(AST_SimpleStatement, self, { body: node }); - } - } - return self; - }); - - OPT(AST_While, function(self, compressor) { - return compressor.option("loops") ? make_node(AST_For, self).optimize(compressor) : self; - }); - - function has_loop_control(loop, parent, type) { - if (!type) type = AST_LoopControl; - var found = false; - var tw = new TreeWalker(function(node) { - if (found || node instanceof AST_Scope) return true; - if (node instanceof type && tw.loopcontrol_target(node) === loop) { - return found = true; - } - }); - if (parent instanceof AST_LabeledStatement) tw.push(parent); - tw.push(loop); - loop.body.walk(tw); - return found; - } - - OPT(AST_Do, function(self, compressor) { - if (!compressor.option("loops")) return self; - var cond = fuzzy_eval(compressor, self.condition); - if (!(cond instanceof AST_Node)) { - if (cond && !has_loop_control(self, compressor.parent(), AST_Continue)) return make_node(AST_For, self, { - body: make_node(AST_BlockStatement, self.body, { - body: [ - self.body, - make_node(AST_SimpleStatement, self.condition, { body: self.condition }), - ], - }), - }).optimize(compressor); - if (!has_loop_control(self, compressor.parent())) return make_node(AST_BlockStatement, self.body, { - body: [ - self.body, - make_node(AST_SimpleStatement, self.condition, { body: self.condition }), - ], - }).optimize(compressor); - } - if (self.body instanceof AST_BlockStatement && !has_loop_control(self, compressor.parent(), AST_Continue)) { - var body = self.body.body; - for (var i = body.length; --i >= 0;) { - var stat = body[i]; - if (stat instanceof AST_If - && !stat.alternative - && stat.body instanceof AST_Break - && compressor.loopcontrol_target(stat.body) === self) { - if (has_block_scope_refs(stat.condition)) break; - self.condition = make_node(AST_Binary, self, { - operator: "&&", - left: stat.condition.negate(compressor), - right: self.condition, - }); - body.splice(i, 1); - } else if (stat instanceof AST_SimpleStatement) { - if (has_block_scope_refs(stat.body)) break; - self.condition = make_sequence(self, [ - stat.body, - self.condition, - ]); - body.splice(i, 1); - } else if (!is_declaration(stat, true)) { - break; - } - } - self.body = trim_block(self.body, compressor.parent()); - } - if (self.body instanceof AST_EmptyStatement) return make_node(AST_For, self).optimize(compressor); - if (self.body instanceof AST_SimpleStatement) return make_node(AST_For, self, { - condition: make_sequence(self.condition, [ - self.body.body, - self.condition, - ]), - body: make_node(AST_EmptyStatement, self), - }).optimize(compressor); - return self; - - function has_block_scope_refs(node) { - var found = false; - node.walk(new TreeWalker(function(node) { - if (found) return true; - if (node instanceof AST_SymbolRef) { - if (!member(node.definition(), self.enclosed)) found = true; - return true; - } - })); - return found; - } - }); - - function if_break_in_loop(self, compressor) { - var first = first_statement(self.body); - if (compressor.option("dead_code") - && (first instanceof AST_Break - || first instanceof AST_Continue && external_target(first) - || first instanceof AST_Exit)) { - var body = []; - if (is_statement(self.init)) { - body.push(self.init); - } else if (self.init) { - body.push(make_node(AST_SimpleStatement, self.init, { body: self.init })); - } - var retain = external_target(first) || first instanceof AST_Exit; - if (self.condition && retain) { - body.push(make_node(AST_If, self, { - condition: self.condition, - body: first, - alternative: null, - })); - } else if (self.condition) { - body.push(make_node(AST_SimpleStatement, self.condition, { body: self.condition })); - } else if (retain) { - body.push(first); - } - extract_declarations_from_unreachable_code(compressor, self.body, body); - return make_node(AST_BlockStatement, self, { body: body }); - } - if (first instanceof AST_If) { - var ab = first_statement(first.body); - if (ab instanceof AST_Break && !external_target(ab)) { - if (self.condition) { - self.condition = make_node(AST_Binary, self.condition, { - left: self.condition, - operator: "&&", - right: first.condition.negate(compressor), - }); - } else { - self.condition = first.condition.negate(compressor); - } - var body = as_statement_array(first.alternative); - extract_declarations_from_unreachable_code(compressor, first.body, body); - return drop_it(body); - } - ab = first_statement(first.alternative); - if (ab instanceof AST_Break && !external_target(ab)) { - if (self.condition) { - self.condition = make_node(AST_Binary, self.condition, { - left: self.condition, - operator: "&&", - right: first.condition, - }); - } else { - self.condition = first.condition; - } - var body = as_statement_array(first.body); - extract_declarations_from_unreachable_code(compressor, first.alternative, body); - return drop_it(body); - } - } - return self; - - function first_statement(body) { - return body instanceof AST_BlockStatement ? body.body[0] : body; - } - - function external_target(node) { - return compressor.loopcontrol_target(node) !== compressor.self(); - } - - function drop_it(rest) { - if (self.body instanceof AST_BlockStatement) { - self.body = self.body.clone(); - self.body.body = rest.concat(self.body.body.slice(1)); - self.body = self.body.transform(compressor); - } else { - self.body = make_node(AST_BlockStatement, self.body, { body: rest }).transform(compressor); - } - return if_break_in_loop(self, compressor); - } - } - - OPT(AST_For, function(self, compressor) { - if (!compressor.option("loops")) return self; - if (compressor.option("side_effects")) { - if (self.init) self.init = self.init.drop_side_effect_free(compressor); - if (self.step) self.step = self.step.drop_side_effect_free(compressor); - } - if (self.condition) { - var cond = fuzzy_eval(compressor, self.condition); - if (!cond) { - if (compressor.option("dead_code")) { - var body = []; - if (is_statement(self.init)) { - body.push(self.init); - } else if (self.init) { - body.push(make_node(AST_SimpleStatement, self.init, { body: self.init })); - } - body.push(make_node(AST_SimpleStatement, self.condition, { body: self.condition })); - extract_declarations_from_unreachable_code(compressor, self.body, body); - return make_node(AST_BlockStatement, self, { body: body }).optimize(compressor); - } - } else if (!(cond instanceof AST_Node)) { - self.body = make_node(AST_BlockStatement, self.body, { - body: [ - make_node(AST_SimpleStatement, self.condition, { body: self.condition }), - self.body, - ], - }); - self.condition = null; - } - } - return if_break_in_loop(self, compressor); - }); - - OPT(AST_ForEnumeration, function(self, compressor) { - if (compressor.option("varify") && is_lexical_definition(self.init)) { - var name = self.init.definitions[0].name; - if ((name instanceof AST_Destructured || name instanceof AST_SymbolLet) - && !name.match_symbol(function(node) { - if (node instanceof AST_SymbolDeclaration) { - var def = node.definition(); - return !same_scope(def) || may_overlap(compressor, def); - } - }, true)) { - self.init = to_var(self.init, self.resolve()); - } - } - return self; - }); - - function mark_locally_defined(condition, consequent, alternative) { - if (condition instanceof AST_Sequence) condition = condition.tail_node(); - if (!(condition instanceof AST_Binary)) return; - if (!(condition.left instanceof AST_String)) { - switch (condition.operator) { - case "&&": - mark_locally_defined(condition.left, consequent); - mark_locally_defined(condition.right, consequent); - break; - case "||": - mark_locally_defined(negate(condition.left), alternative); - mark_locally_defined(negate(condition.right), alternative); - break; - } - return; - } - if (!(condition.right instanceof AST_UnaryPrefix)) return; - if (condition.right.operator != "typeof") return; - var sym = condition.right.expression; - if (!is_undeclared_ref(sym)) return; - var body; - var undef = condition.left.value == "undefined"; - switch (condition.operator) { - case "==": - body = undef ? alternative : consequent; - break; - case "!=": - body = undef ? consequent : alternative; - break; - default: - return; - } - if (!body) return; - var abort = false; - var def = sym.definition(); - var fn; - var refs = []; - var scanned = []; - var tw = new TreeWalker(function(node, descend) { - if (abort) return true; - if (node instanceof AST_Assign) { - var ref = node.left; - if (!(ref instanceof AST_SymbolRef && ref.definition() === def)) return; - node.right.walk(tw); - switch (node.operator) { - case "=": - case "&&=": - abort = true; - } - return true; - } - if (node instanceof AST_Call) { - descend(); - fn = node.expression.tail_node(); - var save; - if (fn instanceof AST_SymbolRef) { - fn = fn.fixed_value(); - save = refs.length; - } - if (!(fn instanceof AST_Lambda)) { - abort = true; - } else if (push_uniq(scanned, fn)) { - fn.walk(tw); - } - if (save >= 0) refs.length = save; - return true; - } - if (node instanceof AST_DWLoop) { - var save = refs.length; - descend(); - if (abort) refs.length = save; - return true; - } - if (node instanceof AST_For) { - if (node.init) node.init.walk(tw); - var save = refs.length; - if (node.condition) node.condition.walk(tw); - node.body.walk(tw); - if (node.step) node.step.walk(tw); - if (abort) refs.length = save; - return true; - } - if (node instanceof AST_ForEnumeration) { - node.object.walk(tw); - var save = refs.length; - node.init.walk(tw); - node.body.walk(tw); - if (abort) refs.length = save; - return true; - } - if (node instanceof AST_Scope) { - if (node === fn) return; - return true; - } - if (node instanceof AST_SymbolRef) { - if (node.definition() === def) refs.push(node); - return true; - } - }); - body.walk(tw); - refs.forEach(function(ref) { - ref.defined = true; - }); - - function negate(node) { - if (!(node instanceof AST_Binary)) return; - switch (node.operator) { - case "==": - node = node.clone(); - node.operator = "!="; - return node; - case "!=": - node = node.clone(); - node.operator = "=="; - return node; - } - } - } - - function fuzzy_eval(compressor, node, nullish) { - if (node.truthy) return true; - if (is_undefined(node)) return undefined; - if (node.falsy && !nullish) return false; - if (node.is_truthy()) return true; - return node.evaluate(compressor, true); - } - - function mark_duplicate_condition(compressor, node) { - var child; - var level = 0; - var negated = false; - var parent = compressor.self(); - if (!is_statement(parent)) while (true) { - child = parent; - parent = compressor.parent(level++); - if (parent instanceof AST_Binary) { - switch (child) { - case parent.left: - if (lazy_op[parent.operator]) continue; - break; - case parent.right: - if (match(parent.left)) switch (parent.operator) { - case "&&": - node[negated ? "falsy" : "truthy"] = true; - break; - case "||": - case "??": - node[negated ? "truthy" : "falsy"] = true; - break; - } - break; - } - } else if (parent instanceof AST_Conditional) { - var cond = parent.condition; - if (cond === child) continue; - if (match(cond)) switch (child) { - case parent.consequent: - node[negated ? "falsy" : "truthy"] = true; - break; - case parent.alternative: - node[negated ? "truthy" : "falsy"] = true; - break; - } - } else if (parent instanceof AST_Exit) { - break; - } else if (parent instanceof AST_If) { - break; - } else if (parent instanceof AST_Sequence) { - if (parent.expressions[0] === child) continue; - } else if (parent instanceof AST_SimpleStatement) { - break; - } - return; - } - while (true) { - child = parent; - parent = compressor.parent(level++); - if (parent instanceof AST_BlockStatement) { - if (parent.body[0] === child) continue; - } else if (parent instanceof AST_If) { - if (match(parent.condition)) switch (child) { - case parent.body: - node[negated ? "falsy" : "truthy"] = true; - break; - case parent.alternative: - node[negated ? "truthy" : "falsy"] = true; - break; - } - } - return; - } - - function match(cond) { - if (node.equals(cond)) return true; - if (!(cond instanceof AST_UnaryPrefix)) return false; - if (cond.operator != "!") return false; - if (!node.equals(cond.expression)) return false; - negated = true; - return true; - } - } - - OPT(AST_If, function(self, compressor) { - if (is_empty(self.alternative)) self.alternative = null; - - if (!compressor.option("conditionals")) return self; - if (compressor.option("booleans") && !self.condition.has_side_effects(compressor)) { - mark_duplicate_condition(compressor, self.condition); - } - // if condition can be statically determined, warn and drop - // one of the blocks. note, statically determined implies - // “has no side effects”; also it doesn't work for cases like - // `x && true`, though it probably should. - if (compressor.option("dead_code")) { - var cond = fuzzy_eval(compressor, self.condition); - if (!cond) { - AST_Node.warn("Condition always false [{start}]", self.condition); - var body = [ - make_node(AST_SimpleStatement, self.condition, { body: self.condition }).transform(compressor), - ]; - extract_declarations_from_unreachable_code(compressor, self.body, body); - if (self.alternative) body.push(self.alternative); - return make_node(AST_BlockStatement, self, { body: body }).optimize(compressor); - } else if (!(cond instanceof AST_Node)) { - AST_Node.warn("Condition always true [{start}]", self.condition); - var body = [ - make_node(AST_SimpleStatement, self.condition, { body: self.condition }).transform(compressor), - self.body, - ]; - if (self.alternative) extract_declarations_from_unreachable_code(compressor, self.alternative, body); - return make_node(AST_BlockStatement, self, { body: body }).optimize(compressor); - } - } - var negated = self.condition.negate(compressor); - var self_condition_length = self.condition.print_to_string().length; - var negated_length = negated.print_to_string().length; - var negated_is_best = negated_length < self_condition_length; - if (self.alternative && negated_is_best) { - negated_is_best = false; // because we already do the switch here. - // no need to swap values of self_condition_length and negated_length - // here because they are only used in an equality comparison later on. - self.condition = negated; - var tmp = self.body; - self.body = self.alternative; - self.alternative = is_empty(tmp) ? null : tmp; - } - var body_defuns = []; - var body_var_defs = []; - var body_refs = []; - var body_exprs = sequencesize(self.body, body_defuns, body_var_defs, body_refs); - var alt_defuns = []; - var alt_var_defs = []; - var alt_refs = []; - var alt_exprs = sequencesize(self.alternative, alt_defuns, alt_var_defs, alt_refs); - if (body_exprs instanceof AST_BlockStatement || alt_exprs instanceof AST_BlockStatement) { - var body = [], var_defs = []; - if (body_exprs) { - [].push.apply(body, body_defuns); - [].push.apply(var_defs, body_var_defs); - if (body_exprs instanceof AST_BlockStatement) { - self.body = body_exprs; - } else if (body_exprs.length == 0) { - self.body = make_node(AST_EmptyStatement, self.body); - } else { - self.body = make_node(AST_SimpleStatement, self.body, { - body: make_sequence(self.body, body_exprs), - }); - } - body_refs.forEach(process_to_assign); - } - if (alt_exprs) { - [].push.apply(body, alt_defuns); - [].push.apply(var_defs, alt_var_defs); - if (alt_exprs instanceof AST_BlockStatement) { - self.alternative = alt_exprs; - } else if (alt_exprs.length == 0) { - self.alternative = null; - } else { - self.alternative = make_node(AST_SimpleStatement, self.alternative, { - body: make_sequence(self.alternative, alt_exprs), - }); - } - alt_refs.forEach(process_to_assign); - } - if (var_defs.length > 0) body.push(make_node(AST_Var, self, { definitions: var_defs })); - if (body.length > 0) { - body.push(self.transform(compressor)); - return make_node(AST_BlockStatement, self, { body: body }).optimize(compressor); - } - } else if (body_exprs && alt_exprs) { - var body = body_defuns.concat(alt_defuns); - if (body_var_defs.length > 0 || alt_var_defs.length > 0) body.push(make_node(AST_Var, self, { - definitions: body_var_defs.concat(alt_var_defs), - })); - if (body_exprs.length == 0) { - body.push(make_node(AST_SimpleStatement, self.condition, { - body: alt_exprs.length > 0 ? make_node(AST_Binary, self, { - operator: "||", - left: self.condition, - right: make_sequence(self.alternative, alt_exprs), - }).transform(compressor) : self.condition.clone(), - }).optimize(compressor)); - } else if (alt_exprs.length == 0) { - if (self_condition_length === negated_length && !negated_is_best - && self.condition instanceof AST_Binary && self.condition.operator == "||") { - // although the code length of self.condition and negated are the same, - // negated does not require additional surrounding parentheses. - // see https://github.com/mishoo/UglifyJS/issues/979 - negated_is_best = true; - } - body.push(make_node(AST_SimpleStatement, self, { - body: make_node(AST_Binary, self, { - operator: negated_is_best ? "||" : "&&", - left: negated_is_best ? negated : self.condition, - right: make_sequence(self.body, body_exprs), - }).transform(compressor), - }).optimize(compressor)); - } else { - body.push(make_node(AST_SimpleStatement, self, { - body: make_node(AST_Conditional, self, { - condition: self.condition, - consequent: make_sequence(self.body, body_exprs), - alternative: make_sequence(self.alternative, alt_exprs), - }), - }).optimize(compressor)); - } - body_refs.forEach(process_to_assign); - alt_refs.forEach(process_to_assign); - return make_node(AST_BlockStatement, self, { body: body }).optimize(compressor); - } - if (is_empty(self.body)) self = make_node(AST_If, self, { - condition: negated, - body: self.alternative, - alternative: null, - }); - if (self.alternative instanceof AST_Exit && self.body.TYPE == self.alternative.TYPE) { - var cons_value = self.body.value; - var alt_value = self.alternative.value; - if (!cons_value && !alt_value) return make_node(AST_BlockStatement, self, { - body: [ - make_node(AST_SimpleStatement, self, { body: self.condition }), - self.body, - ], - }).optimize(compressor); - if (cons_value && alt_value || !keep_return_void()) { - var exit = make_node(self.body.CTOR, self, { - value: make_node(AST_Conditional, self, { - condition: self.condition, - consequent: cons_value || make_node(AST_Undefined, self.body).transform(compressor), - alternative: alt_value || make_node(AST_Undefined, self.alternative).transform(compressor), - }), - }); - if (exit instanceof AST_Return) exit.in_bool = self.body.in_bool || self.alternative.in_bool; - return exit; - } - } - if (self.body instanceof AST_If && !self.body.alternative && !self.alternative) { - self = make_node(AST_If, self, { - condition: make_node(AST_Binary, self.condition, { - operator: "&&", - left: self.condition, - right: self.body.condition, - }), - body: self.body.body, - alternative: null, - }); - } - if (aborts(self.body) && self.alternative) { - var alt = self.alternative; - self.alternative = null; - return make_node(AST_BlockStatement, self, { body: [ self, alt ] }).optimize(compressor); - } - if (aborts(self.alternative)) { - var body = self.body; - self.body = self.alternative; - self.condition = negated_is_best ? negated : self.condition.negate(compressor); - self.alternative = null; - return make_node(AST_BlockStatement, self, { body: [ self, body ] }).optimize(compressor); - } - if (self.alternative) { - var body_stats = as_array(self.body); - var body_index = last_index(body_stats); - var alt_stats = as_array(self.alternative); - var alt_index = last_index(alt_stats); - for (var stats = []; body_index >= 0 && alt_index >= 0;) { - var stat = body_stats[body_index]; - var alt_stat = alt_stats[alt_index]; - if (stat.equals(alt_stat)) { - body_stats.splice(body_index--, 1); - alt_stats.splice(alt_index--, 1); - stats.unshift(merge_expression(stat, alt_stat)); - } else { - if (!(stat instanceof AST_SimpleStatement)) break; - if (!(alt_stat instanceof AST_SimpleStatement)) break; - var expr1 = stat.body.tail_node(); - var expr2 = alt_stat.body.tail_node(); - if (!expr1.equals(expr2)) break; - body_index = pop_expr(body_stats, stat.body, body_index); - alt_index = pop_expr(alt_stats, alt_stat.body, alt_index); - stats.unshift(make_node(AST_SimpleStatement, expr1, { body: merge_expression(expr1, expr2) })); - } - } - if (stats.length > 0) { - self.body = body_stats.length > 0 ? make_node(AST_BlockStatement, self, { - body: body_stats, - }) : make_node(AST_EmptyStatement, self); - self.alternative = alt_stats.length > 0 ? make_node(AST_BlockStatement, self, { - body: alt_stats, - }) : null; - stats.unshift(self); - return make_node(AST_BlockStatement, self, { body: stats }).optimize(compressor); - } - } - if (compressor.option("typeofs")) mark_locally_defined(self.condition, self.body, self.alternative); - return self; - - function as_array(node) { - return node instanceof AST_BlockStatement ? node.body : [ node ]; - } - - function keep_return_void() { - var has_finally = false, level = 0, node = compressor.self(); - do { - if (node instanceof AST_Catch) { - if (compressor.parent(level).bfinally) has_finally = true; - level++; - } else if (node instanceof AST_Finally) { - level++; - } else if (node instanceof AST_Scope) { - return has_finally && in_async_generator(node); - } else if (node instanceof AST_Try) { - if (node.bfinally) has_finally = true; - } - } while (node = compressor.parent(level++)); - } - - function last_index(stats) { - for (var index = stats.length; --index >= 0;) { - if (!is_declaration(stats[index], true)) break; - } - return index; - } - - function pop_expr(stats, body, index) { - if (body instanceof AST_Sequence) { - stats[index] = make_node(AST_SimpleStatement, body, { - body: make_sequence(body, body.expressions.slice(0, -1)), - }); - } else { - stats.splice(index--, 1); - } - return index; - } - - function sequencesize(stat, defuns, var_defs, refs) { - if (stat == null) return []; - if (stat instanceof AST_BlockStatement) { - var exprs = []; - for (var i = 0; i < stat.body.length; i++) { - var line = stat.body[i]; - if (line instanceof AST_EmptyStatement) continue; - if (line instanceof AST_Exit) { - if (i == 0) return; - if (exprs.length > 0) { - line = line.clone(); - exprs.push(line.value || make_node(AST_Undefined, line).transform(compressor)); - line.value = make_sequence(stat, exprs); - } - var block = stat.clone(); - block.body = block.body.slice(i + 1); - block.body.unshift(line); - return block; - } - if (line instanceof AST_LambdaDefinition) { - defuns.push(line); - } else if (line instanceof AST_SimpleStatement) { - if (!compressor.option("sequences") && exprs.length > 0) return; - exprs.push(line.body); - } else if (line instanceof AST_Var) { - if (!compressor.option("sequences") && exprs.length > 0) return; - line.remove_initializers(compressor, var_defs); - line.definitions.forEach(process_var_def); - } else { - return; - } - } - return exprs; - } - if (stat instanceof AST_LambdaDefinition) { - defuns.push(stat); - return []; - } - if (stat instanceof AST_EmptyStatement) return []; - if (stat instanceof AST_SimpleStatement) return [ stat.body ]; - if (stat instanceof AST_Var) { - var exprs = []; - stat.remove_initializers(compressor, var_defs); - stat.definitions.forEach(process_var_def); - return exprs; - } - - function process_var_def(var_def) { - if (!var_def.value) return; - exprs.push(make_node(AST_Assign, var_def, { - operator: "=", - left: var_def.name.convert_symbol(AST_SymbolRef, function(ref) { - refs.push(ref); - }), - right: var_def.value, - })); - } - } - }); - - OPT(AST_Switch, function(self, compressor) { - if (!compressor.option("switches")) return self; - if (!compressor.option("dead_code")) return self; - var body = []; - var branch; - var decl = []; - var default_branch; - var exact_match; - var side_effects = []; - for (var i = 0, len = self.body.length; i < len; i++) { - branch = self.body[i]; - if (branch instanceof AST_Default) { - var prev = body[body.length - 1]; - if (default_branch || is_break(branch.body[0], compressor) && (!prev || aborts(prev))) { - eliminate_branch(branch, prev); - continue; - } else { - default_branch = branch; - } - } else { - var exp = branch.expression; - var equals = make_node(AST_Binary, self, { - operator: "===", - left: self.expression, - right: exp, - }).evaluate(compressor, true); - if (!equals) { - if (exp.has_side_effects(compressor)) side_effects.push(exp); - eliminate_branch(branch, body[body.length - 1]); - continue; - } - if (!(equals instanceof AST_Node)) { - if (default_branch) { - var default_index = body.indexOf(default_branch); - body.splice(default_index, 1); - eliminate_branch(default_branch, body[default_index - 1]); - default_branch = null; - } - if (exp.has_side_effects(compressor)) { - exact_match = branch; - } else { - default_branch = branch = make_node(AST_Default, branch); - } - while (++i < len) eliminate_branch(self.body[i], branch); - } - } - if (i + 1 >= len || aborts(branch)) { - var prev = body[body.length - 1]; - var statements = branch.body; - if (aborts(prev)) switch (prev.body.length - statements.length) { - case 1: - var stat = prev.body[prev.body.length - 1]; - if (!is_break(stat, compressor)) break; - statements = statements.concat(stat); - case 0: - var prev_block = make_node(AST_BlockStatement, prev); - var next_block = make_node(AST_BlockStatement, branch, { body: statements }); - if (prev_block.equals(next_block)) prev.body = []; - } - } - if (side_effects.length) { - if (branch instanceof AST_Default) { - body.push(make_node(AST_Case, self, { expression: make_sequence(self, side_effects), body: [] })); - } else { - side_effects.push(branch.expression); - branch.expression = make_sequence(self, side_effects); - } - side_effects = []; - } - body.push(branch); - } - if (side_effects.length && !exact_match) { - body.push(make_node(AST_Case, self, { expression: make_sequence(self, side_effects), body: [] })); - } - while (branch = body[body.length - 1]) { - var stat = branch.body[branch.body.length - 1]; - if (is_break(stat, compressor)) branch.body.pop(); - if (branch === default_branch) { - if (!has_declarations_only(branch)) break; - } else if (branch.expression.has_side_effects(compressor)) { - break; - } else if (default_branch) { - if (!has_declarations_only(default_branch)) break; - if (body[body.length - 2] !== default_branch) break; - default_branch.body = default_branch.body.concat(branch.body); - branch.body = []; - } else if (!has_declarations_only(branch)) break; - eliminate_branch(branch); - if (body.pop() === default_branch) default_branch = null; - } - if (!branch) { - decl.push(make_node(AST_SimpleStatement, self.expression, { body: self.expression })); - if (side_effects.length) decl.push(make_node(AST_SimpleStatement, self, { - body: make_sequence(self, side_effects), - })); - return make_node(AST_BlockStatement, self, { body: decl }).optimize(compressor); - } - if (branch === default_branch) while (branch = body[body.length - 2]) { - if (branch instanceof AST_Default) break; - if (!has_declarations_only(branch)) break; - var exp = branch.expression; - if (exp.has_side_effects(compressor)) { - var prev = body[body.length - 3]; - if (prev && !aborts(prev)) break; - default_branch.body.unshift(make_node(AST_SimpleStatement, self, { body: exp })); - } - eliminate_branch(branch); - body.splice(-2, 1); - } - body[0].body = decl.concat(body[0].body); - self.body = body; - if (compressor.option("conditionals")) switch (body.length) { - case 1: - if (!no_break(body[0])) break; - var exp = body[0].expression; - var statements = body[0].body.slice(); - if (body[0] !== default_branch && body[0] !== exact_match) return make_node(AST_If, self, { - condition: make_node(AST_Binary, self, { - operator: "===", - left: self.expression, - right: exp, - }), - body: make_node(AST_BlockStatement, self, { body: statements }), - alternative: null, - }).optimize(compressor); - if (exp) statements.unshift(make_node(AST_SimpleStatement, exp, { body: exp })); - statements.unshift(make_node(AST_SimpleStatement, self.expression, { body: self.expression })); - return make_node(AST_BlockStatement, self, { body: statements }).optimize(compressor); - case 2: - if (!member(default_branch, body) || !no_break(body[1])) break; - var statements = body[0].body.slice(); - var exclusive = statements.length && is_break(statements[statements.length - 1], compressor); - if (exclusive) statements.pop(); - if (!all(statements, no_break)) break; - var alternative = body[1].body.length && make_node(AST_BlockStatement, body[1]); - var node = make_node(AST_If, self, { - condition: make_node(AST_Binary, self, body[0] === default_branch ? { - operator: "!==", - left: self.expression, - right: body[1].expression, - } : { - operator: "===", - left: self.expression, - right: body[0].expression, - }), - body: make_node(AST_BlockStatement, body[0], { body: statements }), - alternative: exclusive && alternative || null, - }); - if (!exclusive && alternative) node = make_node(AST_BlockStatement, self, { body: [ node, alternative ] }); - return node.optimize(compressor); - } - return self; - - function is_break(node, tw) { - return node instanceof AST_Break && tw.loopcontrol_target(node) === self; - } - - function no_break(node) { - var found = false; - var tw = new TreeWalker(function(node) { - if (found - || node instanceof AST_Lambda - || node instanceof AST_SimpleStatement) return true; - if (is_break(node, tw)) found = true; - }); - tw.push(self); - node.walk(tw); - return !found; - } - - function eliminate_branch(branch, prev) { - if (prev && !aborts(prev)) { - prev.body = prev.body.concat(branch.body); - } else { - extract_declarations_from_unreachable_code(compressor, branch, decl); - } - } - }); - - OPT(AST_Try, function(self, compressor) { - self.body = tighten_body(self.body, compressor); - if (compressor.option("dead_code")) { - if (has_declarations_only(self) - && !(self.bcatch && self.bcatch.argname && self.bcatch.argname.match_symbol(function(node) { - return node instanceof AST_SymbolCatch && !can_drop_symbol(node); - }, true))) { - var body = []; - if (self.bcatch) { - extract_declarations_from_unreachable_code(compressor, self.bcatch, body); - body.forEach(function(stat) { - if (!(stat instanceof AST_Var)) return; - stat.definitions.forEach(function(var_def) { - var def = var_def.name.definition().redefined(); - if (!def) return; - var_def.name = var_def.name.clone(); - var_def.name.thedef = def; - }); - }); - } - body.unshift(make_node(AST_BlockStatement, self).optimize(compressor)); - if (self.bfinally) { - body.push(make_node(AST_BlockStatement, self.bfinally).optimize(compressor)); - } - return make_node(AST_BlockStatement, self, { body: body }).optimize(compressor); - } - if (self.bfinally && has_declarations_only(self.bfinally)) { - var body = make_node(AST_BlockStatement, self.bfinally).optimize(compressor); - body = self.body.concat(body); - if (!self.bcatch) return make_node(AST_BlockStatement, self, { body: body }).optimize(compressor); - self.body = body; - self.bfinally = null; - } - } - return self; - }); - - function remove_initializers(make_value) { - return function(compressor, defns) { - var dropped = false; - this.definitions.forEach(function(defn) { - if (defn.value) dropped = true; - defn.name.match_symbol(function(node) { - if (node instanceof AST_SymbolDeclaration) defns.push(make_node(AST_VarDef, node, { - name: node, - value: make_value(compressor, node), - })); - }, true); - }); - return dropped; - }; - } - - AST_Const.DEFMETHOD("remove_initializers", remove_initializers(function(compressor, node) { - return make_node(AST_Undefined, node).optimize(compressor); - })); - AST_Let.DEFMETHOD("remove_initializers", remove_initializers(return_null)); - AST_Var.DEFMETHOD("remove_initializers", remove_initializers(return_null)); - - AST_Definitions.DEFMETHOD("to_assignments", function() { - var assignments = this.definitions.reduce(function(a, defn) { - var def = defn.name.definition(); - var value = defn.value; - if (value) { - if (value instanceof AST_Sequence) value = value.clone(); - var name = make_node(AST_SymbolRef, defn.name); - var assign = make_node(AST_Assign, defn, { - operator: "=", - left: name, - right: value, - }); - a.push(assign); - var fixed = function() { - return assign.right; - }; - fixed.assigns = [ assign ]; - fixed.direct_access = def.direct_access; - fixed.escaped = def.escaped; - name.fixed = fixed; - def.references.forEach(function(ref) { - if (!ref.fixed) return; - var assigns = ref.fixed.assigns; - if (!assigns) return; - if (assigns[0] !== defn) return; - if (assigns.length > 1 || ref.fixed.to_binary || ref.fixed.to_prefix) { - assigns[0] = assign; - } else { - ref.fixed = fixed; - if (def.fixed === ref.fixed) def.fixed = fixed; - } - }); - def.references.push(name); - } - def.assignments++; - def.eliminated++; - def.single_use = false; - return a; - }, []); - if (assignments.length == 0) return null; - return make_sequence(this, assignments); - }); - - function is_safe_lexical(def) { - return def.name != "arguments" && def.orig.length < (def.orig[0] instanceof AST_SymbolLambda ? 3 : 2); - } - - function may_overlap(compressor, def) { - if (compressor.exposed(def)) return true; - var scope = def.scope.resolve(); - for (var s = def.scope; s !== scope;) { - s = s.parent_scope; - if (s.var_names().has(def.name)) return true; - } - } - - function to_var(stat, scope) { - return make_node(AST_Var, stat, { - definitions: stat.definitions.map(function(defn) { - return make_node(AST_VarDef, defn, { - name: defn.name.convert_symbol(AST_SymbolVar, function(name, node) { - var def = name.definition(); - def.orig[def.orig.indexOf(node)] = name; - if (def.scope === scope) return; - def.scope = scope; - scope.variables.set(def.name, def); - scope.enclosed.push(def); - scope.var_names().set(def.name, true); - }), - value: defn.value, - }); - }), - }); - } - - function can_varify(compressor, sym) { - var def = sym.definition(); - return (def.fixed || def.fixed === 0) - && is_safe_lexical(def) - && same_scope(def) - && !may_overlap(compressor, def); - } - - function varify(self, compressor) { - return compressor.option("varify") && all(self.definitions, function(defn) { - return !defn.name.match_symbol(function(node) { - if (node instanceof AST_SymbolDeclaration) return !can_varify(compressor, node); - }, true); - }) ? to_var(self, compressor.find_parent(AST_Scope)) : self; - } - - OPT(AST_Const, varify); - OPT(AST_Let, varify); - - function trim_optional_chain(node, compressor) { - if (!compressor.option("optional_chains")) return; - if (node.terminal) do { - var expr = node.expression; - if (node.optional) { - var ev = fuzzy_eval(compressor, expr, true); - if (ev == null) return make_node(AST_UnaryPrefix, node, { - operator: "void", - expression: expr, - }).optimize(compressor); - if (!(ev instanceof AST_Node)) node.optional = false; - } - node = expr; - } while ((node.TYPE == "Call" || node instanceof AST_PropAccess) && !node.terminal); - } - - function lift_sequence_in_expression(node, compressor) { - var exp = node.expression; - if (!(exp instanceof AST_Sequence)) return node; - var x = exp.expressions.slice(); - var e = node.clone(); - e.expression = x.pop(); - x.push(e); - return make_sequence(node, x); - } - - function drop_unused_call_args(call, compressor, fns_with_marked_args) { - var exp = call.expression; - var fn = exp instanceof AST_SymbolRef ? exp.fixed_value() : exp; - if (!(fn instanceof AST_Lambda)) return; - if (fn.uses_arguments) return; - if (fn.pinned()) return; - if (fns_with_marked_args && fns_with_marked_args.indexOf(fn) < 0) return; - var args = call.args; - if (!all(args, function(arg) { - return !(arg instanceof AST_Spread); - })) return; - var argnames = fn.argnames; - var is_iife = fn === exp && !fn.name; - if (fn.rest) { - if (!(is_iife && compressor.option("rests"))) return; - var insert = argnames.length; - args = args.slice(0, insert); - while (args.length < insert) args.push(make_node(AST_Undefined, call).optimize(compressor)); - args.push(make_node(AST_Array, call, { elements: call.args.slice(insert) })); - argnames = argnames.concat(fn.rest); - fn.rest = null; - } else { - args = args.slice(); - argnames = argnames.slice(); - } - var pos = 0, last = 0; - var drop_defaults = is_iife && compressor.option("default_values"); - var drop_fargs = is_iife && compressor.drop_fargs(fn, call) ? function(argname, arg) { - if (!argname) return true; - if (argname instanceof AST_DestructuredArray) { - return argname.elements.length == 0 && !argname.rest && arg instanceof AST_Array; - } - if (argname instanceof AST_DestructuredObject) { - return argname.properties.length == 0 && !argname.rest && arg && !arg.may_throw_on_access(compressor); - } - return argname.unused; - } : return_false; - var side_effects = []; - for (var i = 0; i < args.length; i++) { - var argname = argnames[i]; - if (drop_defaults && argname instanceof AST_DefaultValue && args[i].is_defined(compressor)) { - argnames[i] = argname = argname.name; - } - if (!argname || argname.unused !== undefined) { - var node = args[i].drop_side_effect_free(compressor); - if (drop_fargs(argname)) { - if (argname) argnames.splice(i, 1); - args.splice(i, 1); - if (node) side_effects.push(node); - i--; - continue; - } else if (node) { - side_effects.push(node); - args[pos++] = make_sequence(call, side_effects); - side_effects = []; - } else if (argname) { - if (side_effects.length) { - args[pos++] = make_sequence(call, side_effects); - side_effects = []; - } else { - args[pos++] = make_node(AST_Number, args[i], { value: 0 }); - continue; - } - } - } else if (drop_fargs(argname, args[i])) { - var node = args[i].drop_side_effect_free(compressor); - argnames.splice(i, 1); - args.splice(i, 1); - if (node) side_effects.push(node); - i--; - continue; - } else { - side_effects.push(args[i]); - args[pos++] = make_sequence(call, side_effects); - side_effects = []; - } - last = pos; - } - for (; i < argnames.length; i++) { - if (drop_fargs(argnames[i])) argnames.splice(i--, 1); - } - fn.argnames = argnames; - args.length = last; - call.args = args; - if (!side_effects.length) return; - var arg = make_sequence(call, side_effects); - args.push(args.length < argnames.length ? make_node(AST_UnaryPrefix, call, { - operator: "void", - expression: arg, - }) : arg); - } - - function avoid_await_yield(compressor, parent_scope) { - if (!parent_scope) parent_scope = compressor.find_parent(AST_Scope); - var avoid = []; - if (is_async(parent_scope) || parent_scope instanceof AST_Toplevel && compressor.option("module")) { - avoid.push("await"); - } - if (is_generator(parent_scope)) avoid.push("yield"); - return avoid.length && makePredicate(avoid); - } - - function safe_from_await_yield(fn, avoid) { - if (!avoid) return true; - var safe = true; - var tw = new TreeWalker(function(node) { - if (!safe) return true; - if (node instanceof AST_Scope) { - if (node === fn) return; - if (is_arrow(node)) { - for (var i = 0; safe && i < node.argnames.length; i++) node.argnames[i].walk(tw); - } else if (node instanceof AST_LambdaDefinition && avoid[node.name.name]) { - safe = false; - } - return true; - } - if (node instanceof AST_Symbol && avoid[node.name] && node !== fn.name) safe = false; - }); - fn.walk(tw); - return safe; - } - - function safe_from_strict_mode(fn, compressor) { - return fn.in_strict_mode(compressor) || !compressor.has_directive("use strict"); - } - - OPT(AST_Call, function(self, compressor) { - var exp = self.expression; - var terminated = trim_optional_chain(self, compressor); - if (terminated) return terminated; - if (compressor.option("sequences")) { - if (exp instanceof AST_PropAccess) { - var seq = lift_sequence_in_expression(exp, compressor); - if (seq !== exp) { - var call = self.clone(); - call.expression = seq.expressions.pop(); - seq.expressions.push(call); - return seq.optimize(compressor); - } - } else if (!needs_unbinding(exp.tail_node())) { - var seq = lift_sequence_in_expression(self, compressor); - if (seq !== self) return seq.optimize(compressor); - } - } - if (compressor.option("unused")) drop_unused_call_args(self, compressor); - if (compressor.option("unsafe")) { - if (is_undeclared_ref(exp)) switch (exp.name) { - case "Array": - // Array(n) ---> [ , , ... , ] - if (self.args.length == 1) { - var first = self.args[0]; - if (first instanceof AST_Number) try { - var length = first.value; - if (length > 6) break; - var elements = Array(length); - for (var i = 0; i < length; i++) elements[i] = make_node(AST_Hole, self); - return make_node(AST_Array, self, { elements: elements }); - } catch (ex) { - AST_Node.warn("Invalid array length: {length} [{start}]", { - length: length, - start: self.start, - }); - break; - } - if (!first.is_boolean(compressor) && !first.is_string(compressor)) break; - } - // Array(...) ---> [ ... ] - return make_node(AST_Array, self, { elements: self.args }); - case "Object": - // Object() ---> {} - if (self.args.length == 0) return make_node(AST_Object, self, { properties: [] }); - break; - case "String": - // String() ---> "" - if (self.args.length == 0) return make_node(AST_String, self, { value: "" }); - // String(x) ---> "" + x - if (self.args.length == 1) return make_node(AST_Binary, self, { - operator: "+", - left: make_node(AST_String, self, { value: "" }), - right: self.args[0], - }).optimize(compressor); - break; - case "Number": - // Number() ---> 0 - if (self.args.length == 0) return make_node(AST_Number, self, { value: 0 }); - // Number(x) ---> +("" + x) - if (self.args.length == 1) return make_node(AST_UnaryPrefix, self, { - operator: "+", - expression: make_node(AST_Binary, self, { - operator: "+", - left: make_node(AST_String, self, { value: "" }), - right: self.args[0], - }), - }).optimize(compressor); - break; - case "Boolean": - // Boolean() ---> false - if (self.args.length == 0) return make_node(AST_False, self).optimize(compressor); - // Boolean(x) ---> !!x - if (self.args.length == 1) return make_node(AST_UnaryPrefix, self, { - operator: "!", - expression: make_node(AST_UnaryPrefix, self, { - operator: "!", - expression: self.args[0], - }), - }).optimize(compressor); - break; - case "RegExp": - // attempt to convert RegExp(...) to literal - var params = []; - if (all(self.args, function(arg) { - var value = arg.evaluate(compressor); - params.unshift(value); - return arg !== value; - })) try { - return best_of(compressor, self, make_node(AST_RegExp, self, { - value: RegExp.apply(RegExp, params), - })); - } catch (ex) { - AST_Node.warn("Error converting {this} [{start}]", self); - } - break; - } else if (exp instanceof AST_Dot) switch (exp.property) { - case "toString": - // x.toString() ---> "" + x - var expr = exp.expression; - if (self.args.length == 0 && !(expr.may_throw_on_access(compressor) || expr instanceof AST_Super)) { - return make_node(AST_Binary, self, { - operator: "+", - left: make_node(AST_String, self, { value: "" }), - right: expr, - }).optimize(compressor); - } - break; - case "join": - if (exp.expression instanceof AST_Array && self.args.length < 2) EXIT: { - var separator = self.args[0]; - // [].join() ---> "" - // [].join(x) ---> (x, "") - if (exp.expression.elements.length == 0 && !(separator instanceof AST_Spread)) { - return separator ? make_sequence(self, [ - separator, - make_node(AST_String, self, { value: "" }), - ]).optimize(compressor) : make_node(AST_String, self, { value: "" }); - } - if (separator) { - separator = separator.evaluate(compressor); - if (separator instanceof AST_Node) break EXIT; // not a constant - } - var elements = []; - var consts = []; - for (var i = 0; i < exp.expression.elements.length; i++) { - var el = exp.expression.elements[i]; - var value = el.evaluate(compressor); - if (value !== el) { - consts.push(value); - } else if (el instanceof AST_Spread) { - break EXIT; - } else { - if (consts.length > 0) { - elements.push(make_node(AST_String, self, { value: consts.join(separator) })); - consts.length = 0; - } - elements.push(el); - } - } - if (consts.length > 0) elements.push(make_node(AST_String, self, { - value: consts.join(separator), - })); - // [ x ].join() ---> "" + x - // [ x ].join(".") ---> "" + x - // [ 1, 2, 3 ].join() ---> "1,2,3" - // [ 1, 2, 3 ].join(".") ---> "1.2.3" - if (elements.length == 1) { - if (elements[0].is_string(compressor)) return elements[0]; - return make_node(AST_Binary, elements[0], { - operator: "+", - left: make_node(AST_String, self, { value: "" }), - right: elements[0], - }); - } - // [ 1, 2, a, 3 ].join("") ---> "12" + a + "3" - if (separator == "") { - var first; - if (elements[0].is_string(compressor) || elements[1].is_string(compressor)) { - first = elements.shift(); - } else { - first = make_node(AST_String, self, { value: "" }); - } - return elements.reduce(function(prev, el) { - return make_node(AST_Binary, el, { - operator: "+", - left: prev, - right: el, - }); - }, first).optimize(compressor); - } - // [ x, "foo", "bar", y ].join() ---> [ x, "foo,bar", y ].join() - // [ x, "foo", "bar", y ].join("-") ---> [ x, "foo-bar", y ].join("-") - // need this awkward cloning to not affect original element - // best_of will decide which one to get through. - var node = self.clone(); - node.expression = node.expression.clone(); - node.expression.expression = node.expression.expression.clone(); - node.expression.expression.elements = elements; - return best_of(compressor, self, node); - } - break; - case "charAt": - if (self.args.length < 2) { - var node = make_node(AST_Binary, self, { - operator: "||", - left: make_node(AST_Sub, self, { - expression: exp.expression, - property: self.args.length ? make_node(AST_Binary, self.args[0], { - operator: "|", - left: make_node(AST_Number, self, { value: 0 }), - right: self.args[0], - }) : make_node(AST_Number, self, { value: 0 }), - }).optimize(compressor), - right: make_node(AST_String, self, { value: "" }), - }); - node.is_string = return_true; - return node.optimize(compressor); - } - break; - case "apply": - if (self.args.length == 2 && self.args[1] instanceof AST_Array) { - var args = self.args[1].elements.slice(); - args.unshift(self.args[0]); - return make_node(AST_Call, self, { - expression: make_node(AST_Dot, exp, { - expression: exp.expression, - property: "call", - }), - args: args, - }).optimize(compressor); - } - break; - case "call": - var func = exp.expression; - if (func instanceof AST_SymbolRef) { - func = func.fixed_value(); - } - if (func instanceof AST_Lambda && !func.contains_this()) { - return (self.args.length ? make_sequence(self, [ - self.args[0], - make_node(AST_Call, self, { - expression: exp.expression, - args: self.args.slice(1), - }), - ]) : make_node(AST_Call, self, { - expression: exp.expression, - args: [], - })).optimize(compressor); - } - break; - } else if (compressor.option("side_effects") - && exp instanceof AST_Call - && exp.args.length == 1 - && is_undeclared_ref(exp.expression) - && exp.expression.name == "Object") { - var call = self.clone(); - call.expression = maintain_this_binding(self, exp, exp.args[0]); - return call.optimize(compressor); - } - } - if (compressor.option("unsafe_Function") - && is_undeclared_ref(exp) - && exp.name == "Function") { - // new Function() ---> function(){} - if (self.args.length == 0) return make_node(AST_Function, self, { - argnames: [], - body: [], - }).init_vars(exp.scope); - if (all(self.args, function(x) { - return x instanceof AST_String; - })) { - // quite a corner-case, but we can handle it: - // https://github.com/mishoo/UglifyJS/issues/203 - // if the code argument is a constant, then we can minify it. - try { - var code = "n(function(" + self.args.slice(0, -1).map(function(arg) { - return arg.value; - }).join() + "){" + self.args[self.args.length - 1].value + "})"; - var ast = parse(code); - var mangle = { ie: compressor.option("ie") }; - ast.figure_out_scope(mangle); - var comp = new Compressor(compressor.options); - ast = ast.transform(comp); - ast.figure_out_scope(mangle); - ast.compute_char_frequency(mangle); - ast.mangle_names(mangle); - var fun; - ast.walk(new TreeWalker(function(node) { - if (fun) return true; - if (node instanceof AST_Lambda) { - fun = node; - return true; - } - })); - var code = OutputStream(); - AST_BlockStatement.prototype._codegen.call(fun, code); - self.args = [ - make_node(AST_String, self, { - value: fun.argnames.map(function(arg) { - return arg.print_to_string(); - }).join(), - }), - make_node(AST_String, self.args[self.args.length - 1], { - value: code.get().replace(/^\{|\}$/g, "") - }), - ]; - return self; - } catch (ex) { - if (ex instanceof JS_Parse_Error) { - AST_Node.warn("Error parsing code passed to new Function [{start}]", self.args[self.args.length - 1]); - AST_Node.warn(ex.toString()); - } else { - throw ex; - } - } - } - } - var fn = exp instanceof AST_SymbolRef ? exp.fixed_value() : exp; - var parent = compressor.parent(), current = compressor.self(); - var is_func = fn instanceof AST_Lambda - && (!is_async(fn) || compressor.option("awaits") && parent instanceof AST_Await) - && (!is_generator(fn) || compressor.option("yields") && current instanceof AST_Yield && current.nested); - var stat = is_func && fn.first_statement(); - var has_default = 0, has_destructured = false; - var has_spread = !all(self.args, function(arg) { - return !(arg instanceof AST_Spread); - }); - var can_drop = is_func && all(fn.argnames, function(argname, index) { - if (has_default == 1 && self.args[index] instanceof AST_Spread) has_default = 2; - if (argname instanceof AST_DefaultValue) { - if (!has_default) has_default = 1; - var arg = has_default == 1 && self.args[index]; - if (!is_undefined(arg)) has_default = 2; - if (has_arg_refs(fn, argname.value)) return false; - argname = argname.name; - } - if (argname instanceof AST_Destructured) { - has_destructured = true; - if (has_arg_refs(fn, argname)) return false; - } - return true; - }) && !(fn.rest instanceof AST_Destructured && has_arg_refs(fn, fn.rest)); - var can_inline = can_drop - && compressor.option("inline") - && !self.is_expr_pure(compressor) - && (exp === fn || safe_from_strict_mode(fn, compressor)); - if (can_inline && stat instanceof AST_Return) { - var value = stat.value; - if (exp === fn - && !fn.name - && (!value || value.is_constant_expression()) - && safe_from_await_yield(fn, avoid_await_yield(compressor))) { - return make_sequence(self, convert_args(value)).optimize(compressor); - } - } - if (is_func && !fn.contains_this()) { - var def, value, var_assigned = false; - if (can_inline - && !fn.uses_arguments - && !fn.pinned() - && !(fn.name && fn instanceof AST_LambdaExpression) - && (exp === fn || !recursive_ref(compressor, def = exp.definition(), fn) - && fn.is_constant_expression(find_scope(compressor))) - && (value = can_flatten_body(stat))) { - var replacing = exp === fn || def.single_use && def.references.length - def.replaced == 1; - if (can_substitute_directly()) { - var args = self.args.slice(); - var refs = []; - var retValue = value.clone(true).transform(new TreeTransformer(function(node) { - if (node instanceof AST_SymbolRef) { - var def = node.definition(); - if (fn.variables.get(node.name) !== def) { - refs.push(node); - return node; - } - var index = resolve_index(def); - var arg = args[index]; - if (!arg) return make_node(AST_Undefined, self); - args[index] = null; - var parent = this.parent(); - return parent ? maintain_this_binding(parent, node, arg) : arg; - } - })); - var save_inlined = fn.inlined; - if (exp !== fn) fn.inlined = true; - var exprs = []; - args.forEach(function(arg) { - if (!arg) return; - arg = arg.clone(true); - arg.walk(new TreeWalker(function(node) { - if (node instanceof AST_SymbolRef) refs.push(node); - })); - exprs.push(arg); - }, []); - exprs.push(retValue); - var node = make_sequence(self, exprs).optimize(compressor); - fn.inlined = save_inlined; - node = maintain_this_binding(parent, current, node); - if (replacing || best_of_expression(node, self) === node) { - refs.forEach(function(ref) { - ref.scope = exp === fn ? fn.parent_scope : exp.scope; - ref.reference(); - var def = ref.definition(); - if (replacing) def.replaced++; - def.single_use = false; - }); - return node; - } else if (!node.has_side_effects(compressor)) { - self.drop_side_effect_free = function(compressor, first_in_statement) { - var self = this; - var exprs = self.args.slice(); - exprs.unshift(self.expression); - return make_sequence(self, exprs).drop_side_effect_free(compressor, first_in_statement); - }; - } - } - var arg_used, insert, in_loop, scope; - if (replacing && can_inject_symbols()) { - fn._squeezed = true; - if (exp !== fn) fn.parent_scope = exp.scope; - var node = make_sequence(self, flatten_fn()).optimize(compressor); - return maintain_this_binding(parent, current, node); - } - } - if (compressor.option("side_effects") - && can_drop - && all(fn.body, is_empty) - && (fn === exp ? fn_name_unused(fn, compressor) : !has_default && !has_destructured && !fn.rest) - && !(is_arrow(fn) && fn.value) - && safe_from_await_yield(fn, avoid_await_yield(compressor))) { - return make_sequence(self, convert_args()).optimize(compressor); - } - } - if (compressor.option("drop_console")) { - if (exp instanceof AST_PropAccess) { - var name = exp.expression; - while (name.expression) { - name = name.expression; - } - if (is_undeclared_ref(name) && name.name == "console") { - return make_node(AST_Undefined, self).optimize(compressor); - } - } - } - if (compressor.option("negate_iife") && parent instanceof AST_SimpleStatement && is_iife_call(current)) { - return self.negate(compressor, true); - } - return try_evaluate(compressor, self); - - function make_void_lhs(orig) { - return make_node(AST_Sub, orig, { - expression: make_node(AST_Array, orig, { elements: [] }), - property: make_node(AST_Number, orig, { value: 0 }), - }); - } - - function convert_args(value) { - var args = self.args.slice(); - var destructured = has_default > 1 || has_destructured || fn.rest; - if (destructured || has_spread) args = [ make_node(AST_Array, self, { elements: args }) ]; - if (destructured) { - var tt = new TreeTransformer(function(node, descend) { - if (node instanceof AST_DefaultValue) return make_node(AST_DefaultValue, node, { - name: node.name.transform(tt) || make_void_lhs(node), - value: node.value, - }); - if (node instanceof AST_DestructuredArray) { - var elements = []; - node.elements.forEach(function(node, index) { - node = node.transform(tt); - if (node) elements[index] = node; - }); - fill_holes(node, elements); - return make_node(AST_DestructuredArray, node, { elements: elements }); - } - if (node instanceof AST_DestructuredObject) { - var properties = [], side_effects = []; - node.properties.forEach(function(prop) { - var key = prop.key; - var value = prop.value.transform(tt); - if (value) { - if (side_effects.length) { - if (!(key instanceof AST_Node)) key = make_node_from_constant(key, prop); - side_effects.push(key); - key = make_sequence(node, side_effects); - side_effects = []; - } - properties.push(make_node(AST_DestructuredKeyVal, prop, { - key: key, - value: value, - })); - } else if (key instanceof AST_Node) { - side_effects.push(key); - } - }); - if (side_effects.length) properties.push(make_node(AST_DestructuredKeyVal, node, { - key: make_sequence(node, side_effects), - value: make_void_lhs(node), - })); - return make_node(AST_DestructuredObject, node, { properties: properties }); - } - if (node instanceof AST_SymbolFunarg) return null; - }); - var lhs = []; - fn.argnames.forEach(function(argname, index) { - argname = argname.transform(tt); - if (argname) lhs[index] = argname; - }); - var rest = fn.rest && fn.rest.transform(tt); - if (rest) lhs.length = fn.argnames.length; - fill_holes(fn, lhs); - args[0] = make_node(AST_Assign, self, { - operator: "=", - left: make_node(AST_DestructuredArray, fn, { - elements: lhs, - rest: rest, - }), - right: args[0], - }); - } else fn.argnames.forEach(function(argname) { - if (argname instanceof AST_DefaultValue) args.push(argname.value); - }); - args.push(value || make_node(AST_Undefined, self)); - return args; - } - - function noop_value() { - return self.call_only ? make_node(AST_Number, self, { value: 0 }) : make_node(AST_Undefined, self); - } - - function return_value(stat) { - if (!stat) return noop_value(); - if (stat instanceof AST_Return) return stat.value || noop_value(); - if (stat instanceof AST_SimpleStatement) { - return self.call_only ? stat.body : make_node(AST_UnaryPrefix, stat, { - operator: "void", - expression: stat.body, - }); - } - } - - function can_flatten_body(stat) { - var len = fn.body.length; - if (len < 2) { - stat = return_value(stat); - if (stat) return stat; - } - if (compressor.option("inline") < 3) return false; - stat = null; - for (var i = 0; i < len; i++) { - var line = fn.body[i]; - if (line instanceof AST_Var) { - if (var_assigned) { - if (!stat) continue; - if (!(stat instanceof AST_SimpleStatement)) return false; - if (!declarations_only(line)) stat = null; - } else if (!declarations_only(line)) { - if (stat && !(stat instanceof AST_SimpleStatement)) return false; - stat = null; - var_assigned = true; - } - } else if (line instanceof AST_AsyncDefun - || line instanceof AST_Defun - || line instanceof AST_EmptyStatement) { - continue; - } else if (stat) { - return false; - } else { - stat = line; - } - } - return return_value(stat); - } - - function resolve_index(def) { - for (var i = fn.argnames.length; --i >= 0;) { - if (fn.argnames[i].definition() === def) return i; - } - } - - function can_substitute_directly() { - if (has_default || has_destructured || has_spread || var_assigned || fn.rest) return; - if (compressor.option("inline") < 2 && fn.argnames.length) return; - if (!fn.variables.all(function(def) { - return def.references.length - def.replaced < 2 && def.orig[0] instanceof AST_SymbolFunarg; - })) return; - var scope = compressor.find_parent(AST_Scope); - var abort = false; - var avoid = avoid_await_yield(compressor, scope); - var begin; - var in_order = []; - var side_effects = false; - var tw = new TreeWalker(function(node, descend) { - if (abort) return true; - if (node instanceof AST_Binary && lazy_op[node.operator] - || node instanceof AST_Conditional) { - in_order = null; - return; - } - if (node instanceof AST_Scope) return abort = true; - if (avoid && node instanceof AST_Symbol && avoid[node.name]) return abort = true; - if (node instanceof AST_SymbolRef) { - var def = node.definition(); - if (fn.variables.get(node.name) !== def) { - in_order = null; - return; - } - if (def.init instanceof AST_LambdaDefinition) return abort = true; - if (is_lhs(node, tw.parent())) return abort = true; - var index = resolve_index(def); - if (!(begin < index)) begin = index; - if (!in_order) return; - if (side_effects) { - in_order = null; - } else { - in_order.push(fn.argnames[index]); - } - return; - } - if (side_effects) return; - if (node instanceof AST_Assign && node.left instanceof AST_PropAccess) { - node.left.expression.walk(tw); - if (node.left instanceof AST_Sub) node.left.property.walk(tw); - node.right.walk(tw); - side_effects = true; - return true; - } - if (node.has_side_effects(compressor)) { - descend(); - side_effects = true; - return true; - } - }); - value.walk(tw); - if (abort) return; - var end = self.args.length; - if (in_order && fn.argnames.length >= end) { - end = fn.argnames.length; - while (end-- > begin && fn.argnames[end] === in_order.pop()); - end++; - } - return end <= begin || all(self.args.slice(begin, end), side_effects && !in_order ? function(funarg) { - return funarg.is_constant_expression(scope); - } : function(funarg) { - return !funarg.has_side_effects(compressor); - }); - } - - function var_exists(defined, name) { - return defined.has(name) || identifier_atom[name] || scope.var_names().has(name); - } - - function can_inject_args(defined, safe_to_inject) { - var abort = false; - fn.each_argname(function(arg) { - if (abort) return; - if (arg.unused) return; - if (!safe_to_inject || var_exists(defined, arg.name)) return abort = true; - arg_used.set(arg.name, true); - if (in_loop) in_loop.push(arg.definition()); - }); - return !abort; - } - - function can_inject_vars(defined, safe_to_inject) { - for (var i = 0; i < fn.body.length; i++) { - var stat = fn.body[i]; - if (stat instanceof AST_LambdaDefinition) { - var name = stat.name; - if (!safe_to_inject) return false; - if (arg_used.has(name.name)) return false; - if (var_exists(defined, name.name)) return false; - if (!all(stat.enclosed, function(def) { - return def.scope === scope || def.scope === stat || !defined.has(def.name); - })) return false; - if (in_loop) in_loop.push(name.definition()); - continue; - } - if (!(stat instanceof AST_Var)) continue; - if (!safe_to_inject) return false; - for (var j = stat.definitions.length; --j >= 0;) { - var name = stat.definitions[j].name; - if (var_exists(defined, name.name)) return false; - if (in_loop) in_loop.push(name.definition()); - } - } - return true; - } - - function can_inject_symbols() { - var defined = new Dictionary(); - var level = 0, child; - scope = current; - do { - if (scope.variables) scope.variables.each(function(def) { - defined.set(def.name, true); - }); - child = scope; - scope = compressor.parent(level++); - if (scope instanceof AST_ClassField) { - if (!scope.static) return false; - } else if (scope instanceof AST_DWLoop) { - in_loop = []; - } else if (scope instanceof AST_For) { - if (scope.init === child) continue; - in_loop = []; - } else if (scope instanceof AST_ForEnumeration) { - if (scope.init === child) continue; - if (scope.object === child) continue; - in_loop = []; - } - } while (!(scope instanceof AST_Scope)); - insert = scope.body.indexOf(child) + 1; - if (!insert) return false; - if (!safe_from_await_yield(fn, avoid_await_yield(compressor, scope))) return false; - var safe_to_inject = (exp !== fn || fn.parent_scope.resolve() === scope) && !scope.pinned(); - if (scope instanceof AST_Toplevel) { - if (compressor.toplevel.vars) { - defined.set("arguments", true); - } else { - safe_to_inject = false; - } - } - arg_used = new Dictionary(); - var inline = compressor.option("inline"); - if (!can_inject_args(defined, inline >= 2 && safe_to_inject)) return false; - if (!can_inject_vars(defined, inline >= 3 && safe_to_inject)) return false; - return !in_loop || in_loop.length == 0 || !is_reachable(fn, in_loop); - } - - function append_var(decls, expressions, name, value) { - var def = name.definition(); - if (!scope.var_names().has(name.name)) { - scope.var_names().set(name.name, true); - decls.push(make_node(AST_VarDef, name, { - name: name, - value: null, - })); - } - scope.variables.set(name.name, def); - scope.enclosed.push(def); - if (!value) return; - var sym = make_node(AST_SymbolRef, name); - def.assignments++; - def.references.push(sym); - expressions.push(make_node(AST_Assign, self, { - operator: "=", - left: sym, - right: value, - })); - } - - function flatten_args(decls, expressions) { - var len = fn.argnames.length; - for (var i = self.args.length; --i >= len;) { - expressions.push(self.args[i]); - } - var default_args = []; - for (i = len; --i >= 0;) { - var argname = fn.argnames[i]; - var name; - if (argname instanceof AST_DefaultValue) { - default_args.push(argname); - name = argname.name; - } else { - name = argname; - } - var value = self.args[i]; - if (name.unused || scope.var_names().has(name.name)) { - if (value) expressions.push(value); - } else { - var symbol = make_node(AST_SymbolVar, name); - var def = name.definition(); - def.orig.push(symbol); - def.eliminated++; - if (name.unused !== undefined) { - append_var(decls, expressions, symbol); - if (value) expressions.push(value); - } else { - if (!value && argname === name && (in_loop - || name.name == "arguments" && !is_arrow(fn) && is_arrow(scope))) { - value = make_node(AST_Undefined, self); - } - append_var(decls, expressions, symbol, value); - } - } - } - decls.reverse(); - expressions.reverse(); - for (i = default_args.length; --i >= 0;) { - var node = default_args[i]; - if (node.name.unused !== undefined) { - expressions.push(node.value); - } else { - var sym = make_node(AST_SymbolRef, node.name); - node.name.definition().references.push(sym); - expressions.push(make_node(AST_Assign, node, { - operator: "=", - left: sym, - right: node.value, - })); - } - } - } - - function flatten_destructured(decls, expressions) { - expressions.push(make_node(AST_Assign, self, { - operator: "=", - left: make_node(AST_DestructuredArray, self, { - elements: fn.argnames.map(function(argname) { - if (argname.unused) return make_node(AST_Hole, argname); - return argname.convert_symbol(AST_SymbolRef, process); - }), - rest: fn.rest && fn.rest.convert_symbol(AST_SymbolRef, process), - }), - right: make_node(AST_Array, self, { elements: self.args.slice() }), - })); - - function process(ref, name) { - if (name.unused) return make_void_lhs(name); - var def = name.definition(); - def.assignments++; - def.references.push(ref); - var symbol = make_node(AST_SymbolVar, name); - def.orig.push(symbol); - def.eliminated++; - append_var(decls, expressions, symbol); - } - } - - function flatten_vars(decls, expressions) { - var args = [ insert, 0 ]; - var decl_var = [], expr_fn = [], expr_var = [], expr_loop = [], exprs = []; - fn.body.filter(in_loop ? function(stat) { - if (!(stat instanceof AST_LambdaDefinition)) return true; - var name = make_node(AST_SymbolVar, flatten_var(stat.name)); - var def = name.definition(); - def.fixed = false; - def.orig.push(name); - def.eliminated++; - append_var(decls, expr_fn, name, to_func_expr(stat, true)); - return false; - } : function(stat) { - if (!(stat instanceof AST_LambdaDefinition)) return true; - var def = stat.name.definition(); - scope.functions.set(def.name, def); - scope.variables.set(def.name, def); - scope.enclosed.push(def); - scope.var_names().set(def.name, true); - args.push(stat); - return false; - }).forEach(function(stat) { - if (!(stat instanceof AST_Var)) { - if (stat instanceof AST_SimpleStatement) exprs.push(stat.body); - return; - } - for (var j = 0; j < stat.definitions.length; j++) { - var var_def = stat.definitions[j]; - var name = flatten_var(var_def.name); - var value = var_def.value; - if (value && exprs.length > 0) { - exprs.push(value); - value = make_sequence(var_def, exprs); - exprs = []; - } - append_var(decl_var, expr_var, name, value); - if (!in_loop) continue; - if (arg_used.has(name.name)) continue; - if (name.definition().orig.length == 1 && fn.functions.has(name.name)) continue; - expr_loop.push(init_ref(compressor, name)); - } - }); - [].push.apply(decls, decl_var); - [].push.apply(expressions, expr_loop); - [].push.apply(expressions, expr_fn); - [].push.apply(expressions, expr_var); - return args; - } - - function flatten_fn() { - var decls = []; - var expressions = []; - if (has_default > 1 || has_destructured || has_spread || fn.rest) { - flatten_destructured(decls, expressions); - } else { - flatten_args(decls, expressions); - } - var args = flatten_vars(decls, expressions); - expressions.push(value); - if (decls.length) args.push(make_node(AST_Var, fn, { definitions: decls })); - [].splice.apply(scope.body, args); - fn.enclosed.forEach(function(def) { - if (scope.var_names().has(def.name)) return; - scope.enclosed.push(def); - scope.var_names().set(def.name, true); - }); - return expressions; - } - }); - - OPT(AST_New, function(self, compressor) { - if (compressor.option("unsafe")) { - var exp = self.expression; - if (is_undeclared_ref(exp)) switch (exp.name) { - case "Array": - case "Error": - case "Function": - case "Object": - case "RegExp": - return make_node(AST_Call, self).transform(compressor); - } - } - if (compressor.option("sequences")) { - var seq = lift_sequence_in_expression(self, compressor); - if (seq !== self) return seq.optimize(compressor); - } - if (compressor.option("unused")) drop_unused_call_args(self, compressor); - return self; - }); - - // (a = b, x && a = c) ---> a = x ? c : b - // (a = b, x || a = c) ---> a = x ? b : c - function to_conditional_assignment(compressor, def, value, node) { - if (!(node instanceof AST_Binary)) return; - if (!(node.operator == "&&" || node.operator == "||")) return; - if (!(node.right instanceof AST_Assign)) return; - if (node.right.operator != "=") return; - if (!(node.right.left instanceof AST_SymbolRef)) return; - if (node.right.left.definition() !== def) return; - if (value.has_side_effects(compressor)) return; - if (!safe_from_assignment(node.left)) return; - if (!safe_from_assignment(node.right.right)) return; - def.replaced++; - return node.operator == "&&" ? make_node(AST_Conditional, node, { - condition: node.left, - consequent: node.right.right, - alternative: value, - }) : make_node(AST_Conditional, node, { - condition: node.left, - consequent: value, - alternative: node.right.right, - }); - - function safe_from_assignment(node) { - if (node.has_side_effects(compressor)) return; - var hit = false; - node.walk(new TreeWalker(function(node) { - if (hit) return true; - if (node instanceof AST_SymbolRef && node.definition() === def) return hit = true; - })); - return !hit; - } - } - - OPT(AST_Sequence, function(self, compressor) { - var expressions = filter_for_side_effects(); - var end = expressions.length - 1; - merge_assignments(); - trim_right_for_undefined(); - if (end == 0) { - self = maintain_this_binding(compressor.parent(), compressor.self(), expressions[0]); - if (!(self instanceof AST_Sequence)) self = self.optimize(compressor); - return self; - } - self.expressions = expressions; - return self; - - function filter_for_side_effects() { - if (!compressor.option("side_effects")) return self.expressions; - var expressions = []; - var first = first_in_statement(compressor); - var last = self.expressions.length - 1; - self.expressions.forEach(function(expr, index) { - if (index < last) expr = expr.drop_side_effect_free(compressor, first); - if (expr) { - merge_sequence(expressions, expr); - first = false; - } - }); - return expressions; - } - - function trim_right_for_undefined() { - if (!compressor.option("side_effects")) return; - while (end > 0 && is_undefined(expressions[end], compressor)) end--; - if (end < expressions.length - 1) { - expressions[end] = make_node(AST_UnaryPrefix, self, { - operator: "void", - expression: expressions[end], - }); - expressions.length = end + 1; - } - } - - function is_simple_assign(node) { - return node instanceof AST_Assign - && node.operator == "=" - && node.left instanceof AST_SymbolRef - && node.left.definition(); - } - - function merge_assignments() { - for (var i = 1; i < end; i++) { - var prev = expressions[i - 1]; - var def = is_simple_assign(prev); - if (!def) continue; - var expr = expressions[i]; - if (compressor.option("conditionals")) { - var cond = to_conditional_assignment(compressor, def, prev.right, expr); - if (cond) { - prev.right = cond; - expressions.splice(i--, 1); - end--; - continue; - } - } - if (compressor.option("dead_code") - && is_simple_assign(expr) === def - && expr.right.is_constant_expression(def.scope.resolve())) { - expressions[--i] = prev.right; - } - } - } - }); - - OPT(AST_UnaryPostfix, function(self, compressor) { - if (compressor.option("sequences")) { - var seq = lift_sequence_in_expression(self, compressor); - if (seq !== self) return seq.optimize(compressor); - } - return try_evaluate(compressor, self); - }); - - var SIGN_OPS = makePredicate("+ -"); - var MULTIPLICATIVE_OPS = makePredicate("* / %"); - OPT(AST_UnaryPrefix, function(self, compressor) { - var op = self.operator; - var exp = self.expression; - if (compressor.option("sequences") && can_lift()) { - var seq = lift_sequence_in_expression(self, compressor); - if (seq !== self) return seq.optimize(compressor); - } - switch (op) { - case "+": - if (!compressor.option("evaluate")) break; - if (!exp.is_number(compressor, true)) break; - var parent = compressor.parent(); - if (parent instanceof AST_UnaryPrefix && parent.operator == "delete") break; - return exp; - case "-": - if (exp instanceof AST_Infinity) exp = exp.transform(compressor); - // avoids infinite recursion of numerals - if (exp instanceof AST_Number || exp instanceof AST_Infinity) return self; - break; - case "!": - if (!compressor.option("booleans")) break; - if (exp.is_truthy()) return make_sequence(self, [ exp, make_node(AST_False, self) ]).optimize(compressor); - if (compressor.in_boolean_context()) { - // !!foo ---> foo, if we're in boolean context - if (exp instanceof AST_UnaryPrefix && exp.operator == "!") return exp.expression; - if (exp instanceof AST_Binary) { - var first = first_in_statement(compressor); - self = (first ? best_of_statement : best_of_expression)(self, exp.negate(compressor, first)); - } - } - break; - case "delete": - if (!compressor.option("evaluate")) break; - if (may_not_delete(exp)) break; - return make_sequence(self, [ exp, make_node(AST_True, self) ]).optimize(compressor); - case "typeof": - if (!compressor.option("booleans")) break; - if (!compressor.in_boolean_context()) break; - // typeof always returns a non-empty string, thus always truthy - AST_Node.warn("Boolean expression always true [{start}]", self); - var exprs = [ make_node(AST_True, self) ]; - if (!(exp instanceof AST_SymbolRef && can_drop_symbol(exp, compressor))) exprs.unshift(exp); - return make_sequence(self, exprs).optimize(compressor); - case "void": - if (!compressor.option("side_effects")) break; - exp = exp.drop_side_effect_free(compressor); - if (!exp) return make_node(AST_Undefined, self).optimize(compressor); - self.expression = exp; - return self; - } - if (compressor.option("evaluate") - && exp instanceof AST_Binary - && SIGN_OPS[op] - && MULTIPLICATIVE_OPS[exp.operator] - && (exp.left.is_constant() || !exp.right.has_side_effects(compressor))) { - return make_node(AST_Binary, self, { - operator: exp.operator, - left: make_node(AST_UnaryPrefix, exp.left, { - operator: op, - expression: exp.left, - }), - right: exp.right, - }); - } - return try_evaluate(compressor, self); - - function may_not_delete(node) { - return node instanceof AST_Infinity - || node instanceof AST_NaN - || node instanceof AST_NewTarget - || node instanceof AST_PropAccess - || node instanceof AST_SymbolRef - || node instanceof AST_Undefined; - } - - function can_lift() { - switch (op) { - case "delete": - return !may_not_delete(exp.tail_node()); - case "typeof": - return !is_undeclared_ref(exp.tail_node()); - default: - return true; - } - } - }); - - OPT(AST_Await, function(self, compressor) { - if (!compressor.option("awaits")) return self; - if (compressor.option("sequences")) { - var seq = lift_sequence_in_expression(self, compressor); - if (seq !== self) return seq.optimize(compressor); - } - if (compressor.option("side_effects")) { - var exp = self.expression; - if (exp instanceof AST_Await) return exp.optimize(compressor); - if (exp instanceof AST_UnaryPrefix && exp.expression instanceof AST_Await) return exp.optimize(compressor); - for (var level = 0, node = self, parent; parent = compressor.parent(level++); node = parent) { - if (is_arrow(parent)) { - if (parent.value === node) return exp.optimize(compressor); - } else if (parent instanceof AST_Return) { - var drop = true; - do { - node = parent; - parent = compressor.parent(level++); - if (parent instanceof AST_Try && (parent.bfinally || parent.bcatch) !== node) { - drop = false; - break; - } - } while (parent && !(parent instanceof AST_Scope)); - if (drop) return exp.optimize(compressor); - } else if (parent instanceof AST_Sequence) { - if (parent.tail_node() === node) continue; - } - break; - } - } - return self; - }); - - OPT(AST_Yield, function(self, compressor) { - if (!compressor.option("yields")) return self; - if (compressor.option("sequences")) { - var seq = lift_sequence_in_expression(self, compressor); - if (seq !== self) return seq.optimize(compressor); - } - var exp = self.expression; - if (self.nested && exp.TYPE == "Call") { - var inlined = exp.clone().optimize(compressor); - if (inlined.TYPE != "Call") return inlined; - } - return self; - }); - - AST_Binary.DEFMETHOD("lift_sequences", function(compressor) { - if (this.left instanceof AST_PropAccess) { - if (!(this.left.expression instanceof AST_Sequence)) return this; - var x = this.left.expression.expressions.slice(); - var e = this.clone(); - e.left = e.left.clone(); - e.left.expression = x.pop(); - x.push(e); - return make_sequence(this, x); - } - if (this.left instanceof AST_Sequence) { - var x = this.left.expressions.slice(); - var e = this.clone(); - e.left = x.pop(); - x.push(e); - return make_sequence(this, x); - } - if (this.right instanceof AST_Sequence) { - if (this.left.has_side_effects(compressor)) return this; - var assign = this.operator == "=" && this.left instanceof AST_SymbolRef; - var x = this.right.expressions; - var last = x.length - 1; - for (var i = 0; i < last; i++) { - if (!assign && x[i].has_side_effects(compressor)) break; - } - if (i == last) { - x = x.slice(); - var e = this.clone(); - e.right = x.pop(); - x.push(e); - return make_sequence(this, x); - } - if (i > 0) { - var e = this.clone(); - e.right = make_sequence(this.right, x.slice(i)); - x = x.slice(0, i); - x.push(e); - return make_sequence(this, x); - } - } - return this; - }); - - var indexFns = makePredicate("indexOf lastIndexOf"); - var commutativeOperators = makePredicate("== === != !== * & | ^"); - function is_object(node, plain) { - if (node instanceof AST_Assign) return !plain && node.operator == "=" && is_object(node.right); - if (node instanceof AST_New) return !plain; - if (node instanceof AST_Sequence) return is_object(node.tail_node(), plain); - if (node instanceof AST_SymbolRef) return !plain && is_object(node.fixed_value()); - return node instanceof AST_Array - || node instanceof AST_Class - || node instanceof AST_Lambda - || node instanceof AST_Object; - } - - function can_drop_op(op, rhs, compressor) { - switch (op) { - case "in": - return is_object(rhs) || compressor && compressor.option("unsafe_comps"); - case "instanceof": - if (rhs instanceof AST_SymbolRef) rhs = rhs.fixed_value(); - return is_lambda(rhs) || compressor && compressor.option("unsafe_comps"); - default: - return true; - } - } - - function needs_enqueuing(compressor, node) { - if (node.is_constant()) return true; - if (node instanceof AST_Assign) return node.operator != "=" || needs_enqueuing(compressor, node.right); - if (node instanceof AST_Binary) { - return !lazy_op[node.operator] - || needs_enqueuing(compressor, node.left) && needs_enqueuing(compressor, node.right); - } - if (node instanceof AST_Call) return is_async(node.expression); - if (node instanceof AST_Conditional) { - return needs_enqueuing(compressor, node.consequent) && needs_enqueuing(compressor, node.alternative); - } - if (node instanceof AST_Sequence) return needs_enqueuing(compressor, node.tail_node()); - if (node instanceof AST_SymbolRef) { - var fixed = node.fixed_value(); - return fixed && needs_enqueuing(compressor, fixed); - } - if (node instanceof AST_Template) return !node.tag || is_raw_tag(compressor, node.tag); - if (node instanceof AST_Unary) return true; - } - - function extract_lhs(node, compressor) { - if (node instanceof AST_Assign) return is_lhs_read_only(node.left, compressor) ? node : node.left; - if (node instanceof AST_Sequence) return extract_lhs(node.tail_node(), compressor); - if (node instanceof AST_UnaryPrefix && UNARY_POSTFIX[node.operator]) { - return is_lhs_read_only(node.expression, compressor) ? node : node.expression; - } - return node; - } - - function repeatable(compressor, node) { - if (node instanceof AST_Dot) return repeatable(compressor, node.expression); - if (node instanceof AST_Sub) { - return repeatable(compressor, node.expression) && repeatable(compressor, node.property); - } - if (node instanceof AST_Symbol) return true; - return !node.has_side_effects(compressor); - } - - function swap_chain(self, compressor) { - var rhs = self.right.tail_node(); - if (rhs !== self.right) { - var exprs = self.right.expressions.slice(0, -1); - exprs.push(rhs.left); - rhs = rhs.clone(); - rhs.left = make_sequence(self.right, exprs); - self.right = rhs; - } - self.left = make_node(AST_Binary, self, { - operator: self.operator, - left: self.left, - right: rhs.left, - start: self.left.start, - end: rhs.left.end, - }); - self.right = rhs.right; - if (compressor) { - self.left = self.left.transform(compressor); - } else if (self.operator == rhs.left.operator) { - swap_chain(self.left); - } - } - - OPT(AST_Binary, function(self, compressor) { - if (commutativeOperators[self.operator] - && self.right.is_constant() - && !self.left.is_constant() - && !(self.left instanceof AST_Binary - && PRECEDENCE[self.left.operator] >= PRECEDENCE[self.operator])) { - // if right is a constant, whatever side effects the - // left side might have could not influence the - // result. hence, force switch. - reverse(); - } - if (compressor.option("sequences")) { - var seq = self.lift_sequences(compressor); - if (seq !== self) return seq.optimize(compressor); - } - if (compressor.option("assignments") && lazy_op[self.operator]) { - var lhs = extract_lhs(self.left, compressor); - var right = self.right; - // a || (a = x) ---> a = a || x - // (a = x) && (a = y) ---> a = (a = x) && y - if (lhs instanceof AST_SymbolRef - && right instanceof AST_Assign - && right.operator == "=" - && lhs.equals(right.left)) { - lhs = lhs.clone(); - var assign = make_node(AST_Assign, self, { - operator: "=", - left: lhs, - right: make_node(AST_Binary, self, { - operator: self.operator, - left: self.left, - right: right.right, - }), - }); - if (lhs.fixed) { - lhs.fixed = function() { - return assign.right; - }; - lhs.fixed.assigns = [ assign ]; - } - var def = lhs.definition(); - def.references.push(lhs); - def.replaced++; - return assign.optimize(compressor); - } - } - if (compressor.option("comparisons")) switch (self.operator) { - case "===": - case "!==": - if (is_undefined(self.left, compressor) && self.right.is_defined(compressor)) { - AST_Node.warn("Expression always defined [{start}]", self); - return make_sequence(self, [ - self.right, - make_node(self.operator == "===" ? AST_False : AST_True, self), - ]).optimize(compressor); - } - var is_strict_comparison = true; - if ((self.left.is_string(compressor) && self.right.is_string(compressor)) || - (self.left.is_number(compressor) && self.right.is_number(compressor)) || - (self.left.is_boolean(compressor) && self.right.is_boolean(compressor)) || - repeatable(compressor, self.left) && self.left.equals(self.right)) { - self.operator = self.operator.slice(0, 2); - } - // XXX: intentionally falling down to the next case - case "==": - case "!=": - // void 0 == x ---> null == x - if (!is_strict_comparison && is_undefined(self.left, compressor)) { - self.left = make_node(AST_Null, self.left); - } - // "undefined" == typeof x ---> undefined === x - else if (compressor.option("typeofs") - && self.left instanceof AST_String - && self.left.value == "undefined" - && self.right instanceof AST_UnaryPrefix - && self.right.operator == "typeof") { - var expr = self.right.expression; - if (expr instanceof AST_SymbolRef ? expr.is_declared(compressor) - : !(expr instanceof AST_PropAccess && compressor.option("ie"))) { - self.right = expr; - self.left = make_node(AST_Undefined, self.left).optimize(compressor); - if (self.operator.length == 2) self.operator += "="; - } - } - // obj !== obj ---> false - else if (self.left instanceof AST_SymbolRef - && self.right instanceof AST_SymbolRef - && self.left.definition() === self.right.definition() - && is_object(self.left)) { - return make_node(self.operator[0] == "=" ? AST_True : AST_False, self).optimize(compressor); - } - break; - case "&&": - case "||": - // void 0 !== x && null !== x ---> null != x - // void 0 === x || null === x ---> null == x - var left = self.left; - if (!(left instanceof AST_Binary)) break; - if (left.operator != (self.operator == "&&" ? "!==" : "===")) break; - if (!(self.right instanceof AST_Binary)) break; - if (left.operator != self.right.operator) break; - if (is_undefined(left.left, compressor) && self.right.left instanceof AST_Null - || left.left instanceof AST_Null && is_undefined(self.right.left, compressor)) { - var expr = left.right; - if (expr instanceof AST_Assign && expr.operator == "=") expr = expr.left; - if (expr.has_side_effects(compressor)) break; - if (!expr.equals(self.right.right)) break; - left.operator = left.operator.slice(0, -1); - left.left = make_node(AST_Null, self); - return left; - } - break; - } - var in_bool = false; - var parent = compressor.parent(); - if (compressor.option("booleans")) { - var lhs = extract_lhs(self.left, compressor); - if (lazy_op[self.operator] && !lhs.has_side_effects(compressor)) { - // a || a ---> a - // (a = x) && a --> a = x - if (lhs.equals(self.right)) { - return maintain_this_binding(parent, compressor.self(), self.left).optimize(compressor); - } - mark_duplicate_condition(compressor, lhs); - } - in_bool = compressor.in_boolean_context(); - } - if (in_bool) switch (self.operator) { - case "+": - var ev = self.left.evaluate(compressor, true); - if (ev && typeof ev == "string" || (ev = self.right.evaluate(compressor, true)) && typeof ev == "string") { - AST_Node.warn("+ in boolean context always true [{start}]", self); - var exprs = []; - if (self.left.evaluate(compressor) instanceof AST_Node) exprs.push(self.left); - if (self.right.evaluate(compressor) instanceof AST_Node) exprs.push(self.right); - if (exprs.length < 2) { - exprs.push(make_node(AST_True, self)); - return make_sequence(self, exprs).optimize(compressor); - } - self.truthy = true; - } - break; - case "==": - if (self.left instanceof AST_String && self.left.value == "" && self.right.is_string(compressor)) { - return make_node(AST_UnaryPrefix, self, { - operator: "!", - expression: self.right, - }).optimize(compressor); - } - break; - case "!=": - if (self.left instanceof AST_String && self.left.value == "" && self.right.is_string(compressor)) { - return self.right.optimize(compressor); - } - break; - } - if (compressor.option("comparisons") && self.is_boolean(compressor)) { - if (parent.TYPE != "Binary") { - var negated = make_node(AST_UnaryPrefix, self, { - operator: "!", - expression: self.negate(compressor), - }); - if (best_of(compressor, self, negated) === negated) return negated; - } - switch (self.operator) { - case ">": reverse("<"); break; - case ">=": reverse("<="); break; - } - } - if (compressor.option("conditionals") && lazy_op[self.operator]) { - if (self.left instanceof AST_Binary && self.operator == self.left.operator) { - var before = make_node(AST_Binary, self, { - operator: self.operator, - left: self.left.right, - right: self.right, - }); - var after = before.transform(compressor); - if (before !== after) { - self.left = self.left.left; - self.right = after; - } - } - // x && (y && z) ---> x && y && z - // w || (x, y || z) ---> w || (x, y) || z - var rhs = self.right.tail_node(); - if (rhs instanceof AST_Binary && self.operator == rhs.operator) swap_chain(self, compressor); - } - if (compressor.option("strings") && self.operator == "+") { - // "foo" + 42 + "" ---> "foo" + 42 - if (self.right instanceof AST_String - && self.right.value == "" - && self.left.is_string(compressor)) { - return self.left.optimize(compressor); - } - // "" + ("foo" + 42) ---> "foo" + 42 - if (self.left instanceof AST_String - && self.left.value == "" - && self.right.is_string(compressor)) { - return self.right.optimize(compressor); - } - // "" + 42 + "foo" ---> 42 + "foo" - if (self.left instanceof AST_Binary - && self.left.operator == "+" - && self.left.left instanceof AST_String - && self.left.left.value == "" - && self.right.is_string(compressor) - && (self.left.right.is_constant() || !self.right.has_side_effects(compressor))) { - self.left = self.left.right; - return self.optimize(compressor); - } - // "x" + (y + "z") ---> "x" + y + "z" - // w + (x, "y" + z) ---> w + (x, "y") + z - var rhs = self.right.tail_node(); - if (rhs instanceof AST_Binary - && self.operator == rhs.operator - && (self.left.is_string(compressor) && rhs.is_string(compressor) - || rhs.left.is_string(compressor) - && (self.left.is_constant() || !rhs.right.has_side_effects(compressor)))) { - swap_chain(self, compressor); - } - } - if (compressor.option("evaluate")) { - var associative = true; - switch (self.operator) { - case "&&": - var ll = fuzzy_eval(compressor, self.left); - if (!ll) { - AST_Node.warn("Condition left of && always false [{start}]", self); - return maintain_this_binding(parent, compressor.self(), self.left).optimize(compressor); - } else if (!(ll instanceof AST_Node)) { - AST_Node.warn("Condition left of && always true [{start}]", self); - return make_sequence(self, [ self.left, self.right ]).optimize(compressor); - } - if (!self.right.evaluate(compressor, true)) { - if (in_bool && !(self.right.evaluate(compressor) instanceof AST_Node)) { - AST_Node.warn("Boolean && always false [{start}]", self); - return make_sequence(self, [ self.left, make_node(AST_False, self) ]).optimize(compressor); - } else self.falsy = true; - } else if ((in_bool || parent.operator == "&&" && parent.left === compressor.self()) - && !(self.right.evaluate(compressor) instanceof AST_Node)) { - AST_Node.warn("Dropping side-effect-free && [{start}]", self); - return self.left.optimize(compressor); - } - // (x || false) && y ---> x ? y : false - if (self.left.operator == "||") { - var lr = fuzzy_eval(compressor, self.left.right); - if (!lr) return make_node(AST_Conditional, self, { - condition: self.left.left, - consequent: self.right, - alternative: self.left.right, - }).optimize(compressor); - } - break; - case "??": - var nullish = true; - case "||": - var ll = fuzzy_eval(compressor, self.left, nullish); - if (nullish ? ll == null : !ll) { - AST_Node.warn("Condition left of {operator} always {value} [{start}]", { - operator: self.operator, - value: nullish ? "nullish" : "false", - start: self.start, - }); - return make_sequence(self, [ self.left, self.right ]).optimize(compressor); - } else if (!(ll instanceof AST_Node)) { - AST_Node.warn("Condition left of {operator} always {value} [{start}]", { - operator: self.operator, - value: nullish ? "defined" : "true", - start: self.start, - }); - return maintain_this_binding(parent, compressor.self(), self.left).optimize(compressor); - } - var rr; - if (!nullish && (rr = self.right.evaluate(compressor, true)) && !(rr instanceof AST_Node)) { - if (in_bool && !(self.right.evaluate(compressor) instanceof AST_Node)) { - AST_Node.warn("Boolean || always true [{start}]", self); - return make_sequence(self, [ self.left, make_node(AST_True, self) ]).optimize(compressor); - } else self.truthy = true; - } else if ((in_bool || parent.operator == "||" && parent.left === compressor.self()) - && !self.right.evaluate(compressor)) { - AST_Node.warn("Dropping side-effect-free {operator} [{start}]", self); - return self.left.optimize(compressor); - } - // x && true || y ---> x ? true : y - if (!nullish && self.left.operator == "&&") { - var lr = fuzzy_eval(compressor, self.left.right); - if (lr && !(lr instanceof AST_Node)) return make_node(AST_Conditional, self, { - condition: self.left.left, - consequent: self.left.right, - alternative: self.right, - }).optimize(compressor); - } - break; - case "+": - // "foo" + ("bar" + x) ---> "foobar" + x - if (self.left instanceof AST_Constant - && self.right instanceof AST_Binary - && self.right.operator == "+" - && self.right.left instanceof AST_Constant - && self.right.is_string(compressor)) { - self = make_node(AST_Binary, self, { - operator: "+", - left: make_node(AST_String, self.left, { - value: "" + self.left.value + self.right.left.value, - start: self.left.start, - end: self.right.left.end, - }), - right: self.right.right, - }); - } - // (x + "foo") + "bar" ---> x + "foobar" - if (self.right instanceof AST_Constant - && self.left instanceof AST_Binary - && self.left.operator == "+" - && self.left.right instanceof AST_Constant - && self.left.is_string(compressor)) { - self = make_node(AST_Binary, self, { - operator: "+", - left: self.left.left, - right: make_node(AST_String, self.right, { - value: "" + self.left.right.value + self.right.value, - start: self.left.right.start, - end: self.right.end, - }), - }); - } - // a + -b ---> a - b - if (self.right instanceof AST_UnaryPrefix - && self.right.operator == "-" - && self.left.is_number(compressor)) { - self = make_node(AST_Binary, self, { - operator: "-", - left: self.left, - right: self.right.expression, - }); - break; - } - // -a + b ---> b - a - if (self.left instanceof AST_UnaryPrefix - && self.left.operator == "-" - && reversible() - && self.right.is_number(compressor)) { - self = make_node(AST_Binary, self, { - operator: "-", - left: self.right, - right: self.left.expression, - }); - break; - } - // (a + b) + 3 ---> 3 + (a + b) - if (compressor.option("unsafe_math") - && self.left instanceof AST_Binary - && PRECEDENCE[self.left.operator] == PRECEDENCE[self.operator] - && self.right.is_constant() - && (self.right.is_boolean(compressor) || self.right.is_number(compressor)) - && self.left.is_number(compressor) - && !self.left.right.is_constant() - && (self.left.left.is_boolean(compressor) || self.left.left.is_number(compressor))) { - self = make_node(AST_Binary, self, { - operator: self.left.operator, - left: make_node(AST_Binary, self, { - operator: self.operator, - left: self.right, - right: self.left.left, - }), - right: self.left.right, - }); - break; - } - case "-": - // a - -b ---> a + b - if (self.right instanceof AST_UnaryPrefix - && self.right.operator == "-" - && self.left.is_number(compressor) - && self.right.expression.is_number(compressor)) { - self = make_node(AST_Binary, self, { - operator: "+", - left: self.left, - right: self.right.expression, - }); - break; - } - case "*": - case "/": - associative = compressor.option("unsafe_math"); - // +a - b ---> a - b - // a - +b ---> a - b - if (self.operator != "+") [ "left", "right" ].forEach(function(operand) { - var node = self[operand]; - if (node instanceof AST_UnaryPrefix && node.operator == "+") { - var exp = node.expression; - if (exp.is_boolean(compressor) || exp.is_number(compressor) || exp.is_string(compressor)) { - self[operand] = exp; - } - } - }); - case "&": - case "|": - case "^": - // a + +b ---> +b + a - if (self.operator != "-" - && self.operator != "/" - && (self.left.is_boolean(compressor) || self.left.is_number(compressor)) - && (self.right.is_boolean(compressor) || self.right.is_number(compressor)) - && reversible() - && !(self.left instanceof AST_Binary - && self.left.operator != self.operator - && PRECEDENCE[self.left.operator] >= PRECEDENCE[self.operator])) { - self = best_of(compressor, self, make_node(AST_Binary, self, { - operator: self.operator, - left: self.right, - right: self.left, - }), self.right instanceof AST_Constant && !(self.left instanceof AST_Constant)); - } - if (!associative || !self.is_number(compressor)) break; - // a + (b + c) ---> (a + b) + c - if (self.right instanceof AST_Binary - && self.right.operator != "%" - && PRECEDENCE[self.right.operator] == PRECEDENCE[self.operator] - && self.right.is_number(compressor) - && (self.operator != "+" - || self.right.left.is_boolean(compressor) - || self.right.left.is_number(compressor)) - && (self.operator != "-" || !self.left.is_negative_zero()) - && (self.right.left.is_constant_expression() - || !self.right.right.has_side_effects(compressor)) - && !is_modify_array(self.right.right)) { - self = make_node(AST_Binary, self, { - operator: align(self.operator, self.right.operator), - left: make_node(AST_Binary, self.left, { - operator: self.operator, - left: self.left, - right: self.right.left, - start: self.left.start, - end: self.right.left.end, - }), - right: self.right.right, - }); - if (self.operator == "+" - && !self.right.is_boolean(compressor) - && !self.right.is_number(compressor)) { - self.right = make_node(AST_UnaryPrefix, self.right, { - operator: "+", - expression: self.right, - }); - } - } - // (2 * n) * 3 ---> 6 * n - // (n + 2) + 3 ---> n + 5 - if (self.right instanceof AST_Constant - && self.left instanceof AST_Binary - && self.left.operator != "%" - && PRECEDENCE[self.left.operator] == PRECEDENCE[self.operator] - && self.left.is_number(compressor)) { - if (self.left.left instanceof AST_Constant) { - var lhs = make_binary(self.operator, self.left.left, self.right, { - start: self.left.left.start, - end: self.right.end, - }); - self = make_binary(self.left.operator, try_evaluate(compressor, lhs), self.left.right, self); - } else if (self.left.right instanceof AST_Constant) { - var op = align(self.left.operator, self.operator); - var rhs = try_evaluate(compressor, make_binary(op, self.left.right, self.right, self.left)); - if (rhs.is_constant() - && !(self.left.operator == "-" - && self.right.value != 0 - && +rhs.value == 0 - && self.left.left.is_negative_zero())) { - self = make_binary(self.left.operator, self.left.left, rhs, self); - } - } - } - break; - case "instanceof": - if (is_lambda(self.right)) return make_sequence(self, [ - self, - make_node(AST_False, self), - ]).optimize(compressor); - break; - } - if (!(parent instanceof AST_UnaryPrefix && parent.operator == "delete")) { - if (self.left instanceof AST_Number && !self.right.is_constant()) switch (self.operator) { - // 0 + n ---> n - case "+": - if (self.left.value == 0) { - if (self.right.is_boolean(compressor)) return make_node(AST_UnaryPrefix, self, { - operator: "+", - expression: self.right, - }).optimize(compressor); - if (self.right.is_number(compressor) && !self.right.is_negative_zero()) return self.right; - } - break; - // 1 * n ---> n - case "*": - if (self.left.value == 1) return make_node(AST_UnaryPrefix, self, { - operator: "+", - expression: self.right, - }).optimize(compressor); - break; - } - if (self.right instanceof AST_Number && !self.left.is_constant()) switch (self.operator) { - // n + 0 ---> n - case "+": - if (self.right.value == 0) { - if (self.left.is_boolean(compressor)) return make_node(AST_UnaryPrefix, self, { - operator: "+", - expression: self.left, - }).optimize(compressor); - if (self.left.is_number(compressor) && !self.left.is_negative_zero()) return self.left; - } - break; - // n - 0 ---> n - case "-": - if (self.right.value == 0) return make_node(AST_UnaryPrefix, self, { - operator: "+", - expression: self.left, - }).optimize(compressor); - break; - // n / 1 ---> n - case "/": - if (self.right.value == 1) return make_node(AST_UnaryPrefix, self, { - operator: "+", - expression: self.left, - }).optimize(compressor); - break; - } - } - } - if (compressor.option("typeofs")) switch (self.operator) { - case "&&": - mark_locally_defined(self.left, self.right, null); - break; - case "||": - mark_locally_defined(self.left, null, self.right); - break; - } - if (compressor.option("unsafe")) { - var indexRight = is_indexFn(self.right); - if (in_bool - && indexRight - && (self.operator == "==" || self.operator == "!=") - && self.left instanceof AST_Number - && self.left.value == 0) { - return (self.operator == "==" ? make_node(AST_UnaryPrefix, self, { - operator: "!", - expression: self.right, - }) : self.right).optimize(compressor); - } - var indexLeft = is_indexFn(self.left); - if (compressor.option("comparisons") && is_indexOf_match_pattern()) { - var node = make_node(AST_UnaryPrefix, self, { - operator: "!", - expression: make_node(AST_UnaryPrefix, self, { - operator: "~", - expression: indexLeft ? self.left : self.right, - }), - }); - switch (self.operator) { - case "<": - if (indexLeft) break; - case "<=": - case "!=": - node = make_node(AST_UnaryPrefix, self, { - operator: "!", - expression: node, - }); - break; - } - return node.optimize(compressor); - } - } - return try_evaluate(compressor, self); - - function is_modify_array(node) { - var found = false; - node.walk(new TreeWalker(function(node) { - if (found) return true; - if (node instanceof AST_Assign) { - if (node.left instanceof AST_PropAccess) return found = true; - } else if (node instanceof AST_Unary) { - if (unary_side_effects[node.operator] && node.expression instanceof AST_PropAccess) { - return found = true; - } - } - })); - return found; - } - - function align(ref, op) { - switch (ref) { - case "-": - return op == "+" ? "-" : "+"; - case "/": - return op == "*" ? "/" : "*"; - default: - return op; - } - } - - function make_binary(op, left, right, orig) { - if (op == "+") { - if (!left.is_boolean(compressor) && !left.is_number(compressor)) { - left = make_node(AST_UnaryPrefix, left, { - operator: "+", - expression: left, - }); - } - if (!right.is_boolean(compressor) && !right.is_number(compressor)) { - right = make_node(AST_UnaryPrefix, right, { - operator: "+", - expression: right, - }); - } - } - return make_node(AST_Binary, orig, { - operator: op, - left: left, - right: right, - }); - } - - function is_indexFn(node) { - return node.TYPE == "Call" - && node.expression instanceof AST_Dot - && indexFns[node.expression.property]; - } - - function is_indexOf_match_pattern() { - switch (self.operator) { - case "<=": - // 0 <= array.indexOf(string) ---> !!~array.indexOf(string) - return indexRight && self.left instanceof AST_Number && self.left.value == 0; - case "<": - // array.indexOf(string) < 0 ---> !~array.indexOf(string) - if (indexLeft && self.right instanceof AST_Number && self.right.value == 0) return true; - // -1 < array.indexOf(string) ---> !!~array.indexOf(string) - case "==": - case "!=": - // -1 == array.indexOf(string) ---> !~array.indexOf(string) - // -1 != array.indexOf(string) ---> !!~array.indexOf(string) - if (!indexRight) return false; - return self.left instanceof AST_Number && self.left.value == -1 - || self.left instanceof AST_UnaryPrefix && self.left.operator == "-" - && self.left.expression instanceof AST_Number && self.left.expression.value == 1; - } - } - - function reversible() { - return self.left.is_constant() - || self.right.is_constant() - || !self.left.has_side_effects(compressor) - && !self.right.has_side_effects(compressor); - } - - function reverse(op) { - if (reversible()) { - if (op) self.operator = op; - var tmp = self.left; - self.left = self.right; - self.right = tmp; - } - } - }); - - OPT(AST_SymbolExport, function(self) { - return self; - }); - - function recursive_ref(compressor, def, fn) { - var level = 0, node = compressor.self(); - do { - if (node === fn) return node; - if (is_lambda(node) && node.name && node.name.definition() === def) return node; - } while (node = compressor.parent(level++)); - } - - function same_scope(def) { - var scope = def.scope.resolve(); - return all(def.references, function(ref) { - return scope === ref.scope.resolve(); - }); - } - - OPT(AST_SymbolRef, function(self, compressor) { - if (!compressor.option("ie") - && is_undeclared_ref(self) - // testing against `self.scope.uses_with` is an optimization - && !(self.scope.resolve().uses_with && compressor.find_parent(AST_With))) { - switch (self.name) { - case "undefined": - return make_node(AST_Undefined, self).optimize(compressor); - case "NaN": - return make_node(AST_NaN, self).optimize(compressor); - case "Infinity": - return make_node(AST_Infinity, self).optimize(compressor); - } - } - var parent = compressor.parent(); - if (compressor.option("reduce_vars") && is_lhs(compressor.self(), parent) !== compressor.self()) { - var def = self.definition(); - var fixed = self.fixed_value(); - var single_use = def.single_use && !(parent instanceof AST_Call && parent.is_expr_pure(compressor)); - if (single_use) { - if (is_lambda(fixed)) { - if ((def.scope !== self.scope.resolve(true) || def.in_loop) - && (!compressor.option("reduce_funcs") || def.escaped.depth == 1 || fixed.inlined)) { - single_use = false; - } else if (def.redefined()) { - single_use = false; - } else if (recursive_ref(compressor, def, fixed)) { - single_use = false; - } else if (fixed.name && fixed.name.definition() !== def) { - single_use = false; - } else if (fixed.parent_scope !== self.scope || is_funarg(def)) { - if (!safe_from_strict_mode(fixed, compressor)) { - single_use = false; - } else if ((single_use = fixed.is_constant_expression(self.scope)) == "f") { - var scope = self.scope; - do { - if (scope instanceof AST_LambdaDefinition || scope instanceof AST_LambdaExpression) { - scope.inlined = true; - } - } while (scope = scope.parent_scope); - } - } else if (fixed.name && (fixed.name.name == "await" && is_async(fixed) - || fixed.name.name == "yield" && is_generator(fixed))) { - single_use = false; - } else if (fixed.has_side_effects(compressor)) { - single_use = false; - } else if (compressor.option("ie") && fixed instanceof AST_Class) { - single_use = false; - } - if (single_use) fixed.parent_scope = self.scope; - } else if (!fixed - || def.recursive_refs > 0 - || !fixed.is_constant_expression() - || fixed.drop_side_effect_free(compressor)) { - single_use = false; - } - } - if (single_use) { - def.single_use = false; - fixed._squeezed = true; - fixed.single_use = true; - if (fixed instanceof AST_DefClass) fixed = to_class_expr(fixed); - if (fixed instanceof AST_LambdaDefinition) fixed = to_func_expr(fixed); - if (is_lambda(fixed)) { - var scopes = []; - var scope = self.scope; - do { - scopes.push(scope); - if (scope === def.scope) break; - } while (scope = scope.parent_scope); - fixed.enclosed.forEach(function(def) { - if (fixed.variables.has(def.name)) return; - for (var i = 0; i < scopes.length; i++) { - var scope = scopes[i]; - if (!push_uniq(scope.enclosed, def)) return; - scope.var_names().set(def.name, true); - } - }); - } - var value; - if (def.recursive_refs > 0) { - value = fixed.clone(true); - var defun_def = value.name.definition(); - var lambda_def = value.variables.get(value.name.name); - var name = lambda_def && lambda_def.orig[0]; - var def_fn_name, symbol_type; - if (value instanceof AST_Class) { - def_fn_name = "def_function"; - symbol_type = AST_SymbolClass; - } else { - def_fn_name = "def_variable"; - symbol_type = AST_SymbolLambda; - } - if (!(name instanceof symbol_type)) { - name = make_node(symbol_type, value.name); - name.scope = value; - value.name = name; - lambda_def = value[def_fn_name](name); - lambda_def.recursive_refs = def.recursive_refs; - } - value.walk(new TreeWalker(function(node) { - if (node instanceof AST_SymbolDeclaration) { - if (node !== name) { - var def = node.definition(); - def.orig.push(node); - def.eliminated++; - } - return; - } - if (!(node instanceof AST_SymbolRef)) return; - var def = node.definition(); - if (def === defun_def) { - node.thedef = def = lambda_def; - } else { - def.single_use = false; - var fn = node.fixed_value(); - if (is_lambda(fn) - && fn.name - && fn.name.definition() === def - && def.scope === fn.name.scope - && fixed.variables.get(fn.name.name) === def) { - fn.name = fn.name.clone(); - node.thedef = def = value.variables.get(fn.name.name) || value[def_fn_name](fn.name); - } - } - def.references.push(node); - })); - } else { - if (fixed instanceof AST_Scope) { - compressor.push(fixed); - value = fixed.optimize(compressor); - compressor.pop(); - } else { - value = fixed.optimize(compressor); - } - value = value.transform(new TreeTransformer(function(node, descend) { - if (node instanceof AST_Scope) return node; - node = node.clone(); - descend(node, this); - return node; - })); - } - def.replaced++; - return value; - } - var state; - if (fixed && (state = self.fixed || def.fixed).should_replace !== false) { - var ev, init; - if (fixed instanceof AST_This) { - if (!is_funarg(def) && same_scope(def) && !cross_class(def)) init = fixed; - } else if ((ev = fixed.evaluate(compressor, true)) !== fixed - && typeof ev != "function" - && (ev === null - || typeof ev != "object" - || compressor.option("unsafe_regexp") - && ev instanceof RegExp && !def.cross_loop && same_scope(def))) { - init = make_node_from_constant(ev, fixed); - } - if (init) { - if (state.should_replace === undefined) { - var value_length = init.optimize(compressor).print_to_string().length; - if (!has_symbol_ref(fixed)) { - value_length = Math.min(value_length, fixed.print_to_string().length); - } - var name_length = def.name.length; - if (compressor.option("unused") && !compressor.exposed(def)) { - var refs = def.references.length - def.replaced - def.assignments; - refs = Math.min(refs, def.references.filter(function(ref) { - return ref.fixed === state; - }).length); - name_length += (name_length + 2 + value_length) / Math.max(1, refs); - } - state.should_replace = value_length - Math.floor(name_length) < compressor.eval_threshold; - } - if (state.should_replace) { - var value; - if (has_symbol_ref(fixed)) { - value = init.optimize(compressor); - if (value === init) value = value.clone(true); - } else { - value = best_of_expression(init.optimize(compressor), fixed); - if (value === init || value === fixed) value = value.clone(true); - } - def.replaced++; - return value; - } - } - } - } - return self; - - function cross_class(def) { - var scope = self.scope; - while (scope !== def.scope) { - if (scope instanceof AST_Class) return true; - scope = scope.parent_scope; - } - } - - function has_symbol_ref(value) { - var found; - value.walk(new TreeWalker(function(node) { - if (node instanceof AST_SymbolRef) found = true; - if (found) return true; - })); - return found; - } - }); - - function is_raw_tag(compressor, tag) { - return compressor.option("unsafe") - && tag instanceof AST_Dot - && tag.property == "raw" - && is_undeclared_ref(tag.expression) - && tag.expression.name == "String"; - } - - function decode_template(str) { - var malformed = false; - str = str.replace(/\\(u\{[^{}]*\}?|u[\s\S]{0,4}|x[\s\S]{0,2}|[0-9]+|[\s\S])/g, function(match, seq) { - var ch = decode_escape_sequence(seq); - if (typeof ch == "string") return ch; - malformed = true; - }); - if (!malformed) return str; - } - - OPT(AST_Template, function(self, compressor) { - if (!compressor.option("templates")) return self; - var tag = self.tag; - if (!tag || is_raw_tag(compressor, tag)) { - var exprs = []; - var strs = []; - for (var i = 0, status; i < self.strings.length; i++) { - var str = self.strings[i]; - if (!tag) { - var trimmed = decode_template(str); - if (trimmed) str = escape_literal(trimmed); - } - if (i > 0) { - var node = self.expressions[i - 1]; - var value = should_join(node); - if (value) { - var prev = strs[strs.length - 1]; - var joined = prev + value + str; - var decoded; - if (tag || typeof (decoded = decode_template(joined)) == status) { - strs[strs.length - 1] = decoded ? escape_literal(decoded) : joined; - continue; - } - } - exprs.push(node); - } - strs.push(str); - if (!tag) status = typeof trimmed; - } - if (!tag && strs.length > 1) { - if (strs[strs.length - 1] == "") return make_node(AST_Binary, self, { - operator: "+", - left: make_node(AST_Template, self, { - expressions: exprs.slice(0, -1), - strings: strs.slice(0, -1), - }).transform(compressor), - right: exprs[exprs.length - 1], - }).optimize(compressor); - if (strs[0] == "") { - var left = make_node(AST_Binary, self, { - operator: "+", - left: make_node(AST_String, self, { value: "" }), - right: exprs[0], - }); - for (var i = 1; strs[i] == "" && i < exprs.length; i++) { - left = make_node(AST_Binary, self, { - operator: "+", - left: left, - right: exprs[i], - }); - } - return best_of(compressor, self, make_node(AST_Binary, self, { - operator: "+", - left: left.transform(compressor), - right: make_node(AST_Template, self, { - expressions: exprs.slice(i), - strings: strs.slice(i), - }).transform(compressor), - }).optimize(compressor)); - } - } - self.expressions = exprs; - self.strings = strs; - } - return try_evaluate(compressor, self); - - function escape_literal(str) { - return str.replace(/\r|\\|`|\${/g, function(s) { - return "\\" + (s == "\r" ? "r" : s); - }); - } - - function should_join(node) { - var ev = node.evaluate(compressor); - if (ev === node) return; - if (tag && /\r|\\|`/.test(ev)) return; - ev = escape_literal("" + ev); - if (ev.length > node.print_to_string().length + "${}".length) return; - return ev; - } - }); - - function is_atomic(lhs, self) { - return lhs instanceof AST_SymbolRef || lhs.TYPE === self.TYPE; - } - - OPT(AST_Undefined, function(self, compressor) { - if (compressor.option("unsafe_undefined")) { - var undef = find_scope(compressor).find_variable("undefined"); - if (undef) { - var ref = make_node(AST_SymbolRef, self, { - name: "undefined", - scope: undef.scope, - thedef: undef, - }); - ref.is_undefined = true; - return ref; - } - } - var lhs = is_lhs(compressor.self(), compressor.parent()); - if (lhs && is_atomic(lhs, self)) return self; - return make_node(AST_UnaryPrefix, self, { - operator: "void", - expression: make_node(AST_Number, self, { value: 0 }), - }); - }); - - OPT(AST_Infinity, function(self, compressor) { - var lhs = is_lhs(compressor.self(), compressor.parent()); - if (lhs && is_atomic(lhs, self)) return self; - if (compressor.option("keep_infinity") && !lhs && !find_scope(compressor).find_variable("Infinity")) { - return self; - } - return make_node(AST_Binary, self, { - operator: "/", - left: make_node(AST_Number, self, { value: 1 }), - right: make_node(AST_Number, self, { value: 0 }), - }); - }); - - OPT(AST_NaN, function(self, compressor) { - var lhs = is_lhs(compressor.self(), compressor.parent()); - if (lhs && is_atomic(lhs, self)) return self; - if (!lhs && !find_scope(compressor).find_variable("NaN")) return self; - return make_node(AST_Binary, self, { - operator: "/", - left: make_node(AST_Number, self, { value: 0 }), - right: make_node(AST_Number, self, { value: 0 }), - }); - }); - - function is_reachable(self, defs) { - var reachable = false; - var find_ref = new TreeWalker(function(node) { - if (reachable) return true; - if (node instanceof AST_SymbolRef && member(node.definition(), defs)) return reachable = true; - }); - var scan_scope = new TreeWalker(function(node) { - if (reachable) return true; - if (node instanceof AST_Lambda && node !== self) { - if (!(node.name || is_async(node) || is_generator(node))) { - var parent = scan_scope.parent(); - if (parent instanceof AST_Call && parent.expression === node) return; - } - node.walk(find_ref); - return true; - } - }); - self.walk(scan_scope); - return reachable; - } - - var ASSIGN_OPS = makePredicate("+ - * / % >> << >>> | ^ &"); - var ASSIGN_OPS_COMMUTATIVE = makePredicate("* | ^ &"); - OPT(AST_Assign, function(self, compressor) { - if (compressor.option("dead_code")) { - if (self.left instanceof AST_PropAccess) { - if (self.operator == "=") { - if (self.redundant) { - var exprs = [ self.left.expression ]; - if (self.left instanceof AST_Sub) exprs.push(self.left.property); - exprs.push(self.right); - return make_sequence(self, exprs).optimize(compressor); - } - if (self.left.equals(self.right) && !self.left.has_side_effects(compressor)) { - return self.right; - } - var exp = self.left.expression; - if (exp instanceof AST_Lambda - || !compressor.has_directive("use strict") - && exp instanceof AST_Constant - && !exp.may_throw_on_access(compressor)) { - return self.left instanceof AST_Dot ? self.right : make_sequence(self, [ - self.left.property, - self.right - ]).optimize(compressor); - } - } - } else if (self.left instanceof AST_SymbolRef && can_drop_symbol(self.left, compressor)) { - var parent; - if (self.operator == "=" && self.left.equals(self.right) - && !((parent = compressor.parent()) instanceof AST_UnaryPrefix && parent.operator == "delete")) { - return self.right; - } - if (self.left.is_immutable()) return strip_assignment(); - var def = self.left.definition(); - var scope = def.scope.resolve(); - var local = scope === compressor.find_parent(AST_Lambda); - var level = 0, node; - parent = compressor.self(); - if (!(scope.uses_arguments && is_funarg(def)) || compressor.has_directive("use strict")) do { - node = parent; - parent = compressor.parent(level++); - if (parent instanceof AST_Assign) { - if (parent.left instanceof AST_SymbolRef && parent.left.definition() === def) { - if (in_try(level, parent, !local)) break; - return strip_assignment(def); - } - if (parent.left.match_symbol(function(node) { - if (node instanceof AST_PropAccess) return true; - })) break; - continue; - } - if (parent instanceof AST_Exit) { - if (!local) break; - if (in_try(level, parent)) break; - if (is_reachable(scope, [ def ])) break; - return strip_assignment(def); - } - if (parent instanceof AST_SimpleStatement) { - if (!local) break; - if (is_reachable(scope, [ def ])) break; - var stat; - do { - stat = parent; - parent = compressor.parent(level++); - if (parent === scope && is_last_statement(parent.body, stat)) return strip_assignment(def); - } while (is_tail_block(stat, parent)); - break; - } - if (parent instanceof AST_VarDef) { - if (!(parent.name instanceof AST_SymbolDeclaration)) continue; - if (parent.name.definition() !== def) continue; - if (in_try(level, parent)) break; - return strip_assignment(def); - } - } while (is_tail(node, parent)); - } - } - if (compressor.option("sequences")) { - var seq = self.lift_sequences(compressor); - if (seq !== self) return seq.optimize(compressor); - } - if (compressor.option("assignments")) { - if (self.operator == "=" && self.left instanceof AST_SymbolRef && self.right instanceof AST_Binary) { - // x = expr1 OP expr2 - if (self.right.left instanceof AST_SymbolRef - && self.right.left.name == self.left.name - && ASSIGN_OPS[self.right.operator]) { - // x = x - 2 ---> x -= 2 - return make_compound(self.right.right); - } - if (self.right.right instanceof AST_SymbolRef - && self.right.right.name == self.left.name - && ASSIGN_OPS_COMMUTATIVE[self.right.operator] - && !self.right.left.has_side_effects(compressor)) { - // x = 2 & x ---> x &= 2 - return make_compound(self.right.left); - } - } - if ((self.operator == "-=" || self.operator == "+=" - && (self.left.is_boolean(compressor) || self.left.is_number(compressor))) - && self.right instanceof AST_Number - && self.right.value == 1) { - var op = self.operator.slice(0, -1); - return make_node(AST_UnaryPrefix, self, { - operator: op + op, - expression: self.left, - }); - } - } - return try_evaluate(compressor, self); - - function is_tail(node, parent) { - if (parent instanceof AST_Binary) switch (node) { - case parent.left: - return parent.right.is_constant_expression(scope); - case parent.right: - return true; - default: - return false; - } - if (parent instanceof AST_Conditional) switch (node) { - case parent.condition: - return parent.consequent.is_constant_expression(scope) - && parent.alternative.is_constant_expression(scope); - case parent.consequent: - case parent.alternative: - return true; - default: - return false; - } - if (parent instanceof AST_Sequence) { - var exprs = parent.expressions; - var stop = exprs.indexOf(node); - if (stop < 0) return false; - for (var i = exprs.length; --i > stop;) { - if (!exprs[i].is_constant_expression(scope)) return false; - } - return true; - } - return parent instanceof AST_UnaryPrefix; - } - - function is_tail_block(stat, parent) { - if (parent instanceof AST_BlockStatement) return is_last_statement(parent.body, stat); - if (parent instanceof AST_Catch) return is_last_statement(parent.body, stat); - if (parent instanceof AST_Finally) return is_last_statement(parent.body, stat); - if (parent instanceof AST_If) return parent.body === stat || parent.alternative === stat; - if (parent instanceof AST_Try) return parent.bfinally ? parent.bfinally === stat : parent.bcatch === stat; - } - - function in_try(level, node, sync) { - var right = self.right; - self.right = make_node(AST_Null, right); - var may_throw = node.may_throw(compressor); - self.right = right; - return find_try(compressor, level, node, scope, may_throw, sync); - } - - function make_compound(rhs) { - var fixed = self.left.fixed; - if (fixed) fixed.to_binary = replace_ref(function(node) { - return node.left; - }, fixed); - return make_node(AST_Assign, self, { - operator: self.right.operator + "=", - left: self.left, - right: rhs, - }); - } - - function strip_assignment(def) { - if (def) def.fixed = false; - return (self.operator != "=" ? make_node(AST_Binary, self, { - operator: self.operator.slice(0, -1), - left: self.left, - right: self.right, - }) : maintain_this_binding(compressor.parent(), self, self.right)).optimize(compressor); - } - }); - - OPT(AST_Conditional, function(self, compressor) { - if (compressor.option("sequences") && self.condition instanceof AST_Sequence) { - var expressions = self.condition.expressions.slice(); - var node = self.clone(); - node.condition = expressions.pop(); - expressions.push(node); - return make_sequence(self, expressions).optimize(compressor); - } - if (!compressor.option("conditionals")) return self; - var condition = self.condition; - if (compressor.option("booleans") && !condition.has_side_effects(compressor)) { - mark_duplicate_condition(compressor, condition); - } - condition = fuzzy_eval(compressor, condition); - if (!condition) { - AST_Node.warn("Condition always false [{start}]", self); - return make_sequence(self, [ self.condition, self.alternative ]).optimize(compressor); - } else if (!(condition instanceof AST_Node)) { - AST_Node.warn("Condition always true [{start}]", self); - return make_sequence(self, [ self.condition, self.consequent ]).optimize(compressor); - } - var first = first_in_statement(compressor); - var negated = condition.negate(compressor, first); - if ((first ? best_of_statement : best_of_expression)(condition, negated) === negated) { - self = make_node(AST_Conditional, self, { - condition: negated, - consequent: self.alternative, - alternative: self.consequent, - }); - negated = condition; - condition = self.condition; - } - var consequent = self.consequent; - var alternative = self.alternative; - var cond_lhs = extract_lhs(condition, compressor); - if (repeatable(compressor, cond_lhs)) { - // x ? x : y ---> x || y - if (cond_lhs.equals(consequent)) return make_node(AST_Binary, self, { - operator: "||", - left: condition, - right: alternative, - }).optimize(compressor); - // x ? y : x ---> x && y - if (cond_lhs.equals(alternative)) return make_node(AST_Binary, self, { - operator: "&&", - left: condition, - right: consequent, - }).optimize(compressor); - } - // if (foo) exp = something; else exp = something_else; - // | - // v - // exp = foo ? something : something_else; - var seq_tail = consequent.tail_node(); - if (seq_tail instanceof AST_Assign) { - var is_eq = seq_tail.operator == "="; - var alt_tail = is_eq ? alternative.tail_node() : alternative; - if ((is_eq || consequent === seq_tail) - && alt_tail instanceof AST_Assign - && seq_tail.operator == alt_tail.operator - && seq_tail.left.equals(alt_tail.left) - && (is_eq && seq_tail.left instanceof AST_SymbolRef - || !condition.has_side_effects(compressor) - && can_shift_lhs_of_tail(consequent) - && can_shift_lhs_of_tail(alternative))) { - return make_node(AST_Assign, self, { - operator: seq_tail.operator, - left: seq_tail.left, - right: make_node(AST_Conditional, self, { - condition: condition, - consequent: pop_lhs(consequent), - alternative: pop_lhs(alternative), - }), - }); - } - } - var alt_tail = alternative.tail_node(); - // x ? y : y ---> x, y - // x ? (a, c) : (b, c) ---> x ? a : b, c - if (seq_tail.equals(alt_tail)) return make_sequence(self, consequent.equals(alternative) ? [ - condition, - consequent, - ] : [ - make_node(AST_Conditional, self, { - condition: condition, - consequent: pop_seq(consequent), - alternative: pop_seq(alternative), - }), - alt_tail, - ]).optimize(compressor); - // x ? y.p : z.p ---> (x ? y : z).p - // x ? y(a) : z(a) ---> (x ? y : z)(a) - // x ? y.f(a) : z.f(a) ---> (x ? y : z).f(a) - var combined = combine_tail(consequent, alternative, true); - if (combined) return combined; - // x ? y(a) : y(b) ---> y(x ? a : b) - var arg_index; - if (consequent instanceof AST_Call - && alternative.TYPE == consequent.TYPE - && (arg_index = arg_diff(consequent, alternative)) >= 0 - && consequent.expression.equals(alternative.expression) - && !condition.has_side_effects(compressor) - && !consequent.expression.has_side_effects(compressor)) { - var node = consequent.clone(); - var arg = consequent.args[arg_index]; - node.args[arg_index] = arg instanceof AST_Spread ? make_node(AST_Spread, self, { - expression: make_node(AST_Conditional, self, { - condition: condition, - consequent: arg.expression, - alternative: alternative.args[arg_index].expression, - }), - }) : make_node(AST_Conditional, self, { - condition: condition, - consequent: arg, - alternative: alternative.args[arg_index], - }); - return node; - } - // x ? (y ? a : b) : b ---> x && y ? a : b - if (seq_tail instanceof AST_Conditional - && seq_tail.alternative.equals(alternative)) { - return make_node(AST_Conditional, self, { - condition: make_node(AST_Binary, self, { - left: condition, - operator: "&&", - right: fuse(consequent, seq_tail, "condition"), - }), - consequent: seq_tail.consequent, - alternative: merge_expression(seq_tail.alternative, alternative), - }); - } - // x ? (y ? a : b) : a ---> !x || y ? a : b - if (seq_tail instanceof AST_Conditional - && seq_tail.consequent.equals(alternative)) { - return make_node(AST_Conditional, self, { - condition: make_node(AST_Binary, self, { - left: negated, - operator: "||", - right: fuse(consequent, seq_tail, "condition"), - }), - consequent: merge_expression(seq_tail.consequent, alternative), - alternative: seq_tail.alternative, - }); - } - // x ? a : (y ? a : b) ---> x || y ? a : b - if (alt_tail instanceof AST_Conditional - && consequent.equals(alt_tail.consequent)) { - return make_node(AST_Conditional, self, { - condition: make_node(AST_Binary, self, { - left: condition, - operator: "||", - right: fuse(alternative, alt_tail, "condition"), - }), - consequent: merge_expression(consequent, alt_tail.consequent), - alternative: alt_tail.alternative, - }); - } - // x ? b : (y ? a : b) ---> !x && y ? a : b - if (alt_tail instanceof AST_Conditional - && consequent.equals(alt_tail.alternative)) { - return make_node(AST_Conditional, self, { - condition: make_node(AST_Binary, self, { - left: negated, - operator: "&&", - right: fuse(alternative, alt_tail, "condition"), - }), - consequent: alt_tail.consequent, - alternative: merge_expression(consequent, alt_tail.alternative), - }); - } - // x ? y && a : a ---> (!x || y) && a - if (seq_tail instanceof AST_Binary - && seq_tail.operator == "&&" - && seq_tail.right.equals(alternative)) { - return make_node(AST_Binary, self, { - operator: "&&", - left: make_node(AST_Binary, self, { - operator: "||", - left: negated, - right: fuse(consequent, seq_tail, "left"), - }), - right: merge_expression(seq_tail.right, alternative), - }).optimize(compressor); - } - // x ? y || a : a ---> x && y || a - if (seq_tail instanceof AST_Binary - && seq_tail.operator == "||" - && seq_tail.right.equals(alternative)) { - return make_node(AST_Binary, self, { - operator: "||", - left: make_node(AST_Binary, self, { - operator: "&&", - left: condition, - right: fuse(consequent, seq_tail, "left"), - }), - right: merge_expression(seq_tail.right, alternative), - }).optimize(compressor); - } - // x ? a : y && a ---> (x || y) && a - if (alt_tail instanceof AST_Binary - && alt_tail.operator == "&&" - && alt_tail.right.equals(consequent)) { - return make_node(AST_Binary, self, { - operator: "&&", - left: make_node(AST_Binary, self, { - operator: "||", - left: condition, - right: fuse(alternative, alt_tail, "left"), - }), - right: merge_expression(consequent, alt_tail.right), - }).optimize(compressor); - } - // x ? a : y || a ---> !x && y || a - if (alt_tail instanceof AST_Binary - && alt_tail.operator == "||" - && alt_tail.right.equals(consequent)) { - return make_node(AST_Binary, self, { - operator: "||", - left: make_node(AST_Binary, self, { - operator: "&&", - left: negated, - right: fuse(alternative, alt_tail, "left"), - }), - right: merge_expression(consequent, alt_tail.right), - }).optimize(compressor); - } - var in_bool = compressor.option("booleans") && compressor.in_boolean_context(); - if (is_true(consequent)) { - // c ? true : false ---> !!c - if (is_false(alternative)) return booleanize(condition); - // c ? true : x ---> !!c || x - return make_node(AST_Binary, self, { - operator: "||", - left: booleanize(condition), - right: alternative, - }).optimize(compressor); - } - if (is_false(consequent)) { - // c ? false : true ---> !c - if (is_true(alternative)) return booleanize(condition.negate(compressor)); - // c ? false : x ---> !c && x - return make_node(AST_Binary, self, { - operator: "&&", - left: booleanize(condition.negate(compressor)), - right: alternative, - }).optimize(compressor); - } - // c ? x : true ---> !c || x - if (is_true(alternative)) return make_node(AST_Binary, self, { - operator: "||", - left: booleanize(condition.negate(compressor)), - right: consequent, - }).optimize(compressor); - // c ? x : false ---> !!c && x - if (is_false(alternative)) return make_node(AST_Binary, self, { - operator: "&&", - left: booleanize(condition), - right: consequent, - }).optimize(compressor); - if (compressor.option("typeofs")) mark_locally_defined(condition, consequent, alternative); - return self; - - function booleanize(node) { - if (node.is_boolean(compressor)) return node; - // !!expression - return make_node(AST_UnaryPrefix, node, { - operator: "!", - expression: node.negate(compressor), - }); - } - - // AST_True or !0 - function is_true(node) { - return node instanceof AST_True - || in_bool - && node instanceof AST_Constant - && node.value - || (node instanceof AST_UnaryPrefix - && node.operator == "!" - && node.expression instanceof AST_Constant - && !node.expression.value); - } - // AST_False or !1 or void 0 - function is_false(node) { - return node instanceof AST_False - || in_bool - && (node instanceof AST_Constant - && !node.value - || node instanceof AST_UnaryPrefix - && node.operator == "void" - && !node.expression.has_side_effects(compressor)) - || (node instanceof AST_UnaryPrefix - && node.operator == "!" - && node.expression instanceof AST_Constant - && node.expression.value); - } - - function arg_diff(consequent, alternative) { - var a = consequent.args; - var b = alternative.args; - var len = a.length; - if (len != b.length) return -2; - for (var i = 0; i < len; i++) { - if (!a[i].equals(b[i])) { - if (a[i] instanceof AST_Spread !== b[i] instanceof AST_Spread) return -3; - for (var j = i + 1; j < len; j++) { - if (!a[j].equals(b[j])) return -2; - } - return i; - } - } - return -1; - } - - function fuse(node, tail, prop) { - if (node === tail) return tail[prop]; - var exprs = node.expressions.slice(0, -1); - exprs.push(tail[prop]); - return make_sequence(node, exprs); - } - - function is_tail_equivalent(consequent, alternative) { - if (consequent.TYPE != alternative.TYPE) return; - if (consequent.optional != alternative.optional) return; - if (consequent instanceof AST_Call) { - if (arg_diff(consequent, alternative) != -1) return; - return consequent.TYPE != "Call" - || !(consequent.expression instanceof AST_PropAccess - || alternative.expression instanceof AST_PropAccess) - || is_tail_equivalent(consequent.expression, alternative.expression); - } - if (!(consequent instanceof AST_PropAccess)) return; - var p = consequent.property; - var q = alternative.property; - return (p instanceof AST_Node ? p.equals(q) : p == q) - && !(consequent.expression instanceof AST_Super || alternative.expression instanceof AST_Super); - } - - function combine_tail(consequent, alternative, top) { - var seq_tail = consequent.tail_node(); - var alt_tail = alternative.tail_node(); - if (!is_tail_equivalent(seq_tail, alt_tail)) return !top && make_node(AST_Conditional, self, { - condition: condition, - consequent: consequent, - alternative: alternative, - }); - var node = seq_tail.clone(); - var seq_expr = fuse(consequent, seq_tail, "expression"); - var alt_expr = fuse(alternative, alt_tail, "expression"); - var combined = combine_tail(seq_expr, alt_expr); - if (seq_tail.expression instanceof AST_Sequence) { - combined = maintain_this_binding(seq_tail, seq_tail.expression, combined); - } - node.expression = combined; - return node; - } - - function can_shift_lhs_of_tail(node) { - return node === node.tail_node() || all(node.expressions.slice(0, -1), function(expr) { - return !expr.has_side_effects(compressor); - }); - } - - function pop_lhs(node) { - if (!(node instanceof AST_Sequence)) return node.right; - var exprs = node.expressions.slice(); - exprs.push(exprs.pop().right); - return make_sequence(node, exprs); - } - - function pop_seq(node) { - if (!(node instanceof AST_Sequence)) return make_node(AST_Number, node, { value: 0 }); - return make_sequence(node, node.expressions.slice(0, -1)); - } - }); - - OPT(AST_Boolean, function(self, compressor) { - if (!compressor.option("booleans")) return self; - if (compressor.in_boolean_context()) return make_node(AST_Number, self, { value: +self.value }); - var p = compressor.parent(); - if (p instanceof AST_Binary && (p.operator == "==" || p.operator == "!=")) { - AST_Node.warn("Non-strict equality against boolean: {operator} {value} [{start}]", { - operator: p.operator, - value: self.value, - start: p.start, - }); - return make_node(AST_Number, self, { value: +self.value }); - } - return make_node(AST_UnaryPrefix, self, { - operator: "!", - expression: make_node(AST_Number, self, { value: 1 - self.value }), - }); - }); - - OPT(AST_Spread, function(self, compressor) { - var exp = self.expression; - if (compressor.option("spreads") && exp instanceof AST_Array && !(compressor.parent() instanceof AST_Object)) { - return List.splice(exp.elements.map(function(node) { - return node instanceof AST_Hole ? make_node(AST_Undefined, node).optimize(compressor) : node; - })); - } - return self; - }); - - function safe_to_flatten(value, compressor) { - if (!value) return false; - var parent = compressor.parent(); - if (parent.TYPE != "Call") return true; - if (parent.expression !== compressor.self()) return true; - if (value instanceof AST_SymbolRef) { - value = value.fixed_value(); - if (!value) return false; - } - return value instanceof AST_Lambda && !value.contains_this(); - } - - OPT(AST_Sub, function(self, compressor) { - var expr = self.expression; - var prop = self.property; - var terminated = trim_optional_chain(self, compressor); - if (terminated) return terminated; - if (compressor.option("properties")) { - var key = prop.evaluate(compressor); - if (key !== prop) { - if (typeof key == "string") { - if (key == "undefined") { - key = undefined; - } else { - var value = parseFloat(key); - if (value.toString() == key) { - key = value; - } - } - } - prop = self.property = best_of_expression(prop, make_node_from_constant(key, prop).transform(compressor)); - var property = "" + key; - if (is_identifier_string(property) - && property.length <= prop.print_to_string().length + 1) { - return make_node(AST_Dot, self, { - optional: self.optional, - expression: expr, - property: property, - quoted: true, - }).optimize(compressor); - } - } - } - var parent = compressor.parent(); - var assigned = is_lhs(compressor.self(), parent); - var def, fn, fn_parent, index; - if (compressor.option("arguments") - && expr instanceof AST_SymbolRef - && is_arguments(def = expr.definition()) - && !expr.in_arg - && prop instanceof AST_Number - && Math.floor(index = prop.value) == index - && (fn = def.scope) === find_lambda() - && fn.uses_arguments < (assigned ? 2 : 3)) { - if (parent instanceof AST_UnaryPrefix && parent.operator == "delete") { - if (!def.deleted) def.deleted = []; - def.deleted[index] = true; - } - var argname = fn.argnames[index]; - if (def.deleted && def.deleted[index]) { - argname = null; - } else if (argname) { - var arg_def; - if (!(argname instanceof AST_SymbolFunarg) - || argname.name == "await" - || expr.scope.find_variable(argname.name) !== (arg_def = argname.definition())) { - argname = null; - } else if (compressor.has_directive("use strict") - || fn.name - || fn.rest - || !(fn_parent instanceof AST_Call - && index < fn_parent.args.length - && all(fn_parent.args.slice(0, index + 1), function(arg) { - return !(arg instanceof AST_Spread); - })) - || !all(fn.argnames, function(argname) { - return argname instanceof AST_SymbolFunarg; - })) { - if (has_reassigned() || arg_def.assignments || arg_def.orig.length > 1) argname = null; - } - } else if ((assigned || !has_reassigned()) - && index < fn.argnames.length + 5 - && compressor.drop_fargs(fn, fn_parent) - && !fn.rest) { - while (index >= fn.argnames.length) { - argname = fn.make_var(AST_SymbolFunarg, fn, "argument_" + fn.argnames.length); - fn.argnames.push(argname); - } - } - if (argname && find_if(function(node) { - return node.name === argname.name; - }, fn.argnames) === argname) { - if (assigned) def.reassigned--; - var sym = make_node(AST_SymbolRef, argname); - sym.reference(); - argname.unused = undefined; - return sym; - } - } - if (assigned) return self; - if (compressor.option("sequences") - && parent.TYPE != "Call" - && !(parent instanceof AST_ForEnumeration && parent.init === self)) { - var seq = lift_sequence_in_expression(self, compressor); - if (seq !== self) return seq.optimize(compressor); - } - if (key !== prop) { - var sub = self.flatten_object(property, compressor); - if (sub) { - expr = self.expression = sub.expression; - prop = self.property = sub.property; - } - } - var elements; - if (compressor.option("properties") - && compressor.option("side_effects") - && prop instanceof AST_Number - && expr instanceof AST_Array - && all(elements = expr.elements, function(value) { - return !(value instanceof AST_Spread); - })) { - var index = prop.value; - var retValue = elements[index]; - if (safe_to_flatten(retValue, compressor)) { - var is_hole = retValue instanceof AST_Hole; - var flatten = !is_hole; - var values = []; - for (var i = elements.length; --i > index;) { - var value = elements[i].drop_side_effect_free(compressor); - if (value) { - values.unshift(value); - if (flatten && value.has_side_effects(compressor)) flatten = false; - } - } - if (!flatten) values.unshift(retValue); - while (--i >= 0) { - var value = elements[i].drop_side_effect_free(compressor); - if (value) { - values.unshift(value); - } else if (is_hole) { - values.unshift(make_node(AST_Hole, elements[i])); - } else { - index--; - } - } - if (flatten) { - values.push(retValue); - return make_sequence(self, values).optimize(compressor); - } - return make_node(AST_Sub, self, { - expression: make_node(AST_Array, expr, { elements: values }), - property: make_node(AST_Number, prop, { value: index }), - }); - } - } - return try_evaluate(compressor, self); - - function find_lambda() { - var i = 0, p; - while (p = compressor.parent(i++)) { - if (p instanceof AST_Lambda) { - if (p instanceof AST_Accessor) return; - if (is_arrow(p)) continue; - fn_parent = compressor.parent(i); - return p; - } - } - } - - function has_reassigned() { - return !compressor.option("reduce_vars") || def.reassigned; - } - }); - - AST_LambdaExpression.DEFMETHOD("contains_super", function() { - var result = false; - var self = this; - self.walk(new TreeWalker(function(node) { - if (result) return true; - if (node instanceof AST_Super) return result = true; - if (node !== self && node instanceof AST_Scope && !is_arrow(node)) return true; - })); - return result; - }); - - // contains_this() - // returns false only if context bound by the specified scope (or scope - // containing the specified expression) is not referenced by `this` - (function(def) { - // scope of arrow function cannot bind to any context - def(AST_Arrow, return_false); - def(AST_AsyncArrow, return_false); - def(AST_Node, function() { - var result = false; - var self = this; - self.walk(new TreeWalker(function(node) { - if (result) return true; - if (node instanceof AST_This) return result = true; - if (node !== self && node instanceof AST_Scope && !is_arrow(node)) return true; - })); - return result; - }); - })(function(node, func) { - node.DEFMETHOD("contains_this", func); - }); - - function can_hoist_property(prop) { - return prop instanceof AST_ObjectKeyVal - && typeof prop.key == "string" - && !(prop instanceof AST_ObjectMethod && prop.value.contains_super()); - } - - AST_PropAccess.DEFMETHOD("flatten_object", function(key, compressor) { - if (!compressor.option("properties")) return; - if (key === "__proto__") return; - var self = this; - var expr = self.expression; - if (!(expr instanceof AST_Object)) return; - var props = expr.properties; - for (var i = props.length; --i >= 0;) { - var prop = props[i]; - if (prop.key !== key) continue; - if (!all(props, can_hoist_property)) return; - if (!safe_to_flatten(prop.value, compressor)) return; - var call, scope, values = []; - for (var j = 0; j < props.length; j++) { - var value = props[j].value; - if (props[j] instanceof AST_ObjectMethod) { - var arrow = !(value.uses_arguments || is_generator(value) || value.contains_this()); - if (arrow) { - if (!scope) scope = compressor.find_parent(AST_Scope); - var avoid = avoid_await_yield(compressor, scope); - value.each_argname(function(argname) { - if (avoid[argname.name]) arrow = false; - }); - } - var ctor; - if (arrow) { - ctor = is_async(value) ? AST_AsyncArrow : AST_Arrow; - } else if (i != j - || (call = compressor.parent()) instanceof AST_Call && call.expression === self) { - ctor = value.CTOR; - } else { - return; - } - value = make_node(ctor, value); - } - values.push(value); - } - return make_node(AST_Sub, self, { - expression: make_node(AST_Array, expr, { elements: values }), - property: make_node(AST_Number, self, { value: i }), - }); - } - }); - - OPT(AST_Dot, function(self, compressor) { - if (self.property == "arguments" || self.property == "caller") { - AST_Node.warn("Function.prototype.{property} not supported [{start}]", self); - } - var parent = compressor.parent(); - if (is_lhs(compressor.self(), parent)) return self; - var terminated = trim_optional_chain(self, compressor); - if (terminated) return terminated; - if (compressor.option("sequences") - && parent.TYPE != "Call" - && !(parent instanceof AST_ForEnumeration && parent.init === self)) { - var seq = lift_sequence_in_expression(self, compressor); - if (seq !== self) return seq.optimize(compressor); - } - if (compressor.option("unsafe_proto") - && self.expression instanceof AST_Dot - && self.expression.property == "prototype") { - var exp = self.expression.expression; - if (is_undeclared_ref(exp)) switch (exp.name) { - case "Array": - self.expression = make_node(AST_Array, self.expression, { elements: [] }); - break; - case "Function": - self.expression = make_node(AST_Function, self.expression, { - argnames: [], - body: [], - }).init_vars(exp.scope); - break; - case "Number": - self.expression = make_node(AST_Number, self.expression, { value: 0 }); - break; - case "Object": - self.expression = make_node(AST_Object, self.expression, { properties: [] }); - break; - case "RegExp": - self.expression = make_node(AST_RegExp, self.expression, { value: /t/ }); - break; - case "String": - self.expression = make_node(AST_String, self.expression, { value: "" }); - break; - } - } - var sub = self.flatten_object(self.property, compressor); - if (sub) return sub.optimize(compressor); - return try_evaluate(compressor, self); - }); - - OPT(AST_DestructuredArray, function(self, compressor) { - if (compressor.option("rests") && self.rest instanceof AST_DestructuredArray) { - return make_node(AST_DestructuredArray, self, { - elements: self.elements.concat(self.rest.elements), - rest: self.rest.rest, - }); - } - return self; - }); - - OPT(AST_DestructuredKeyVal, function(self, compressor) { - if (compressor.option("objects")) { - var key = self.key; - if (key instanceof AST_Node) { - key = key.evaluate(compressor); - if (key !== self.key) self.key = "" + key; - } - } - return self; - }); - - OPT(AST_Object, function(self, compressor) { - if (!compressor.option("objects")) return self; - var changed = false; - var found = false; - var generated = false; - var keep_duplicate = compressor.has_directive("use strict"); - var keys = []; - var map = new Dictionary(); - var values = []; - self.properties.forEach(function(prop) { - if (!(prop instanceof AST_Spread)) return process(prop); - found = true; - var exp = prop.expression; - if (compressor.option("spreads") && exp instanceof AST_Object && all(exp.properties, function(prop) { - if (prop instanceof AST_ObjectGetter) return false; - if (prop instanceof AST_Spread) return false; - if (prop.key !== "__proto__") return true; - if (prop instanceof AST_ObjectSetter) return true; - return !prop.value.has_side_effects(compressor); - })) { - changed = true; - exp.properties.forEach(function(prop) { - var key = prop.key; - var setter = prop instanceof AST_ObjectSetter; - if (key === "__proto__") { - if (!setter) return; - key = make_node_from_constant(key, prop); - } - process(setter ? make_node(AST_ObjectKeyVal, prop, { - key: key, - value: make_node(AST_Undefined, prop).optimize(compressor), - }) : prop); - }); - } else { - generated = true; - flush(); - values.push(prop); - } - }); - flush(); - if (!changed) return self; - if (found && generated && values.length == 1) { - var value = values[0]; - if (value instanceof AST_ObjectProperty && value.key instanceof AST_Number) { - value.key = "" + value.key.value; - } - } - return make_node(AST_Object, self, { properties: values }); - - function flush() { - keys.forEach(function(key) { - var props = map.get(key); - switch (props.length) { - case 0: - return; - case 1: - return values.push(props[0]); - } - changed = true; - var tail = keep_duplicate && !generated && props.pop(); - values.push(props.length == 1 ? props[0] : make_node(AST_ObjectKeyVal, self, { - key: props[0].key, - value: make_sequence(self, props.map(function(prop) { - return prop.value; - })), - })); - if (tail) values.push(tail); - props.length = 0; - }); - keys = []; - map = new Dictionary(); - } - - function process(prop) { - var key = prop.key; - if (key instanceof AST_Node) { - found = true; - key = key.evaluate(compressor); - if (key === prop.key || key === "__proto__") { - generated = true; - } else { - key = prop.key = "" + key; - } - } - if (can_hoist_property(prop)) { - if (prop.value.has_side_effects(compressor)) flush(); - keys.push(key); - map.add(key, prop); - } else { - flush(); - values.push(prop); - } - if (found && !generated && typeof key == "string" && RE_POSITIVE_INTEGER.test(key)) { - generated = true; - if (map.has(key)) prop = map.get(key)[0]; - prop.key = make_node(AST_Number, prop, { value: +key }); - } - } - }); - - function flatten_var(name) { - var redef = name.definition().redefined(); - if (redef) { - name = name.clone(); - name.thedef = redef; - } - return name; - } - - function has_arg_refs(fn, node) { - var found = false; - node.walk(new TreeWalker(function(node) { - if (found) return true; - if (node instanceof AST_SymbolRef && fn.variables.get(node.name) === node.definition()) { - return found = true; - } - })); - return found; - } - - function insert_assign(def, assign) { - var visited = []; - def.references.forEach(function(ref) { - var fixed = ref.fixed; - if (!fixed || !push_uniq(visited, fixed)) return; - if (fixed.assigns) { - fixed.assigns.unshift(assign); - } else { - fixed.assigns = [ assign ]; - } - }); - } - - function init_ref(compressor, name) { - var sym = make_node(AST_SymbolRef, name); - var assign = make_node(AST_Assign, name, { - operator: "=", - left: sym, - right: make_node(AST_Undefined, name).transform(compressor), - }); - var def = name.definition(); - if (def.fixed) { - sym.fixed = function() { - return assign.right; - }; - sym.fixed.assigns = [ assign ]; - insert_assign(def, assign); - } - def.assignments++; - def.references.push(sym); - return assign; - } - - (function(def) { - def(AST_Node, noop); - def(AST_Assign, noop); - def(AST_Await, function(compressor, scope, no_return, in_loop) { - if (!compressor.option("awaits")) return; - var self = this; - var inlined = self.expression.try_inline(compressor, scope, no_return, in_loop, true); - if (!inlined) return; - if (!no_return) scan_local_returns(inlined, function(node) { - node.in_bool = false; - var value = node.value; - if (value instanceof AST_Await) return; - node.value = make_node(AST_Await, self, { - expression: value || make_node(AST_Undefined, node).transform(compressor), - }); - }); - return aborts(inlined) ? inlined : make_node(AST_BlockStatement, self, { - body: [ inlined, make_node(AST_SimpleStatement, self, { - body: make_node(AST_Await, self, { expression: make_node(AST_Number, self, { value: 0 })}), - }) ], - }); - }); - def(AST_Binary, function(compressor, scope, no_return, in_loop, in_await) { - if (no_return === undefined) return; - var self = this; - var op = self.operator; - if (!lazy_op[op]) return; - var inlined = self.right.try_inline(compressor, scope, no_return, in_loop, in_await); - if (!inlined) return; - return make_node(AST_If, self, { - condition: make_condition(self.left), - body: inlined, - alternative: no_return ? null : make_node(AST_Return, self, { - value: make_node(AST_Undefined, self).transform(compressor), - }), - }); - - function make_condition(cond) { - switch (op) { - case "&&": - return cond; - case "||": - return cond.negate(compressor); - case "??": - return make_node(AST_Binary, self, { - operator: "==", - left: make_node(AST_Null, self), - right: cond, - }); - } - } - }); - def(AST_BlockStatement, function(compressor, scope, no_return, in_loop) { - if (no_return) return; - if (!this.variables) return; - var body = this.body; - var last = body.length - 1; - if (last < 0) return; - var inlined = body[last].try_inline(compressor, this, no_return, in_loop); - if (!inlined) return; - body[last] = inlined; - return this; - }); - def(AST_Call, function(compressor, scope, no_return, in_loop, in_await) { - if (compressor.option("inline") < 4) return; - var call = this; - if (call.is_expr_pure(compressor)) return; - var fn = call.expression; - if (!(fn instanceof AST_LambdaExpression)) return; - if (fn.name) return; - if (fn.uses_arguments) return; - if (fn.pinned()) return; - if (is_generator(fn)) return; - var arrow = is_arrow(fn); - if (arrow && fn.value) return; - if (fn.body[0] instanceof AST_Directive) return; - if (fn.contains_this()) return; - if (!scope) scope = find_scope(compressor); - var defined = new Dictionary(); - defined.set("NaN", true); - while (!(scope instanceof AST_Scope)) { - scope.variables.each(function(def) { - defined.set(def.name, true); - }); - scope = scope.parent_scope; - } - if (!member(scope, compressor.stack)) return; - if (scope.pinned() && fn.variables.size() > (arrow ? 0 : 1)) return; - if (scope instanceof AST_Toplevel) { - if (fn.variables.size() > (arrow ? 0 : 1)) { - if (!compressor.toplevel.vars) return; - if (fn.functions.size() > 0 && !compressor.toplevel.funcs) return; - } - defined.set("arguments", true); - } - var async = !in_await && is_async(fn); - if (async) { - if (!compressor.option("awaits")) return; - if (!is_async(scope)) return; - if (call.may_throw(compressor)) return; - } - var names = scope.var_names(); - if (in_loop) in_loop = []; - if (!fn.variables.all(function(def, name) { - if (in_loop) in_loop.push(def); - if (!defined.has(name) && !names.has(name)) return true; - return !arrow && name == "arguments" && def.orig.length == 1; - })) return; - if (in_loop && in_loop.length > 0 && is_reachable(fn, in_loop)) return; - var simple_argnames = true; - if (!all(fn.argnames, function(argname) { - var abort = false; - var tw = new TreeWalker(function(node) { - if (abort) return true; - if (node instanceof AST_DefaultValue) { - if (has_arg_refs(fn, node.value)) return abort = true; - node.name.walk(tw); - return true; - } - if (node instanceof AST_DestructuredKeyVal) { - if (node.key instanceof AST_Node && has_arg_refs(fn, node.key)) return abort = true; - node.value.walk(tw); - return true; - } - if (node instanceof AST_SymbolFunarg && !all(node.definition().orig, function(sym) { - return !(sym instanceof AST_SymbolDefun); - })) return abort = true; - }); - argname.walk(tw); - if (abort) return false; - if (!(argname instanceof AST_SymbolFunarg)) simple_argnames = false; - return true; - })) return; - if (fn.rest) { - if (has_arg_refs(fn, fn.rest)) return; - simple_argnames = false; - } - var verify_body; - if (no_return) { - verify_body = function(stat) { - var abort = false; - stat.walk(new TreeWalker(function(node) { - if (abort) return true; - if (async && (node instanceof AST_Await || node instanceof AST_ForAwaitOf) - || node instanceof AST_Return) { - return abort = true; - } - if (node instanceof AST_Scope) return true; - })); - return !abort; - }; - } else if (in_await || is_async(fn) || in_async_generator(scope)) { - verify_body = function(stat) { - var abort = false; - var find_return = new TreeWalker(function(node) { - if (abort) return true; - if (node instanceof AST_Return) return abort = true; - if (node instanceof AST_Scope) return true; - }); - stat.walk(new TreeWalker(function(node) { - if (abort) return true; - if (node instanceof AST_Try) { - if (node.bfinally && all(node.body, function(stat) { - stat.walk(find_return); - return !abort; - }) && node.bcatch) node.bcatch.walk(find_return); - return true; - } - if (node instanceof AST_Scope) return true; - })); - return !abort; - }; - } - if (verify_body && !all(fn.body, verify_body)) return; - if (!safe_from_await_yield(fn, avoid_await_yield(compressor, scope))) return; - fn.functions.each(function(def, name) { - scope.functions.set(name, def); - }); - var body = []; - fn.variables.each(function(def, name) { - if (!arrow && name == "arguments" && def.orig.length == 1) return; - names.set(name, true); - scope.enclosed.push(def); - scope.variables.set(name, def); - def.single_use = false; - if (!in_loop) return; - if (def.references.length == def.replaced) return; - if (def.orig.length == def.eliminated) return; - if (def.orig.length == 1 && fn.functions.has(name)) return; - if (!all(def.orig, function(sym) { - if (sym instanceof AST_SymbolConst) return false; - if (sym instanceof AST_SymbolFunarg) return !sym.unused && def.scope.resolve() !== fn; - if (sym instanceof AST_SymbolLet) return false; - return true; - })) return; - var sym = def.orig[0]; - if (sym instanceof AST_SymbolCatch) return; - body.push(make_node(AST_SimpleStatement, sym, { body: init_ref(compressor, flatten_var(sym)) })); - }); - var defs = Object.create(null), syms = new Dictionary(); - if (simple_argnames && all(call.args, function(arg) { - return !(arg instanceof AST_Spread); - })) { - var values = call.args.slice(); - fn.argnames.forEach(function(argname) { - var value = values.shift(); - if (argname.unused) { - if (value) body.push(make_node(AST_SimpleStatement, call, { body: value })); - return; - } - var defn = make_node(AST_VarDef, call, { - name: argname.convert_symbol(AST_SymbolVar, process), - value: value || make_node(AST_Undefined, call).transform(compressor), - }); - if (argname instanceof AST_SymbolFunarg) insert_assign(argname.definition(), defn); - body.push(make_node(AST_Var, call, { definitions: [ defn ] })); - }); - if (values.length) body.push(make_node(AST_SimpleStatement, call, { - body: make_sequence(call, values), - })); - } else { - body.push(make_node(AST_Var, call, { - definitions: [ make_node(AST_VarDef, call, { - name: make_node(AST_DestructuredArray, call, { - elements: fn.argnames.map(function(argname) { - if (argname.unused) return make_node(AST_Hole, argname); - return argname.convert_symbol(AST_SymbolVar, process); - }), - rest: fn.rest && fn.rest.convert_symbol(AST_SymbolVar, process), - }), - value: make_node(AST_Array, call, { elements: call.args.slice() }), - }) ], - })); - } - syms.each(function(orig, id) { - var def = defs[id]; - [].unshift.apply(def.orig, orig); - def.eliminated += orig.length; - }); - [].push.apply(body, in_loop ? fn.body.filter(function(stat) { - if (!(stat instanceof AST_LambdaDefinition)) return true; - var name = make_node(AST_SymbolVar, flatten_var(stat.name)); - var def = name.definition(); - def.fixed = false; - def.orig.push(name); - def.eliminated++; - body.push(make_node(AST_Var, stat, { - definitions: [ make_node(AST_VarDef, stat, { - name: name, - value: to_func_expr(stat, true), - }) ], - })); - return false; - }) : fn.body); - var inlined = make_node(AST_BlockStatement, call, { body: body }); - if (!no_return) { - if (async) scan_local_returns(inlined, function(node) { - var value = node.value; - if (is_undefined(value)) return; - node.value = make_node(AST_Await, call, { expression: value }); - }); - body.push(make_node(AST_Return, call, { - value: in_async_generator(scope) ? make_node(AST_Undefined, call).transform(compressor) : null, - })); - } - return inlined; - - function process(sym, argname) { - var def = argname.definition(); - defs[def.id] = def; - syms.add(def.id, sym); - } - }); - def(AST_Conditional, function(compressor, scope, no_return, in_loop, in_await) { - var self = this; - var body = self.consequent.try_inline(compressor, scope, no_return, in_loop, in_await); - var alt = self.alternative.try_inline(compressor, scope, no_return, in_loop, in_await); - if (!body && !alt) return; - return make_node(AST_If, self, { - condition: self.condition, - body: body || make_body(self.consequent), - alternative: alt || make_body(self.alternative), - }); - - function make_body(value) { - if (no_return) return make_node(AST_SimpleStatement, value, { body: value }); - return make_node(AST_Return, value, { value: value }); - } - }); - def(AST_For, function(compressor, scope, no_return, in_loop) { - var body = this.body.try_inline(compressor, scope, true, true); - if (body) this.body = body; - var inlined = this.init; - if (inlined) { - inlined = inlined.try_inline(compressor, scope, true, in_loop); - if (inlined) { - this.init = null; - if (inlined instanceof AST_BlockStatement) { - inlined.body.push(this); - return inlined; - } - return make_node(AST_BlockStatement, inlined, { body: [ inlined, this ] }); - } - } - return body && this; - }); - def(AST_ForEnumeration, function(compressor, scope, no_return, in_loop) { - var body = this.body.try_inline(compressor, scope, true, true); - if (body) this.body = body; - var obj = this.object; - if (obj instanceof AST_Sequence) { - var inlined = inline_sequence(compressor, scope, true, in_loop, false, obj, 1); - if (inlined) { - this.object = obj.tail_node(); - inlined.body.push(this); - return inlined; - } - } - return body && this; - }); - def(AST_If, function(compressor, scope, no_return, in_loop) { - var body = this.body.try_inline(compressor, scope, no_return, in_loop); - if (body) this.body = body; - var alt = this.alternative; - if (alt) { - alt = alt.try_inline(compressor, scope, no_return, in_loop); - if (alt) this.alternative = alt; - } - var cond = this.condition; - if (cond instanceof AST_Sequence) { - var inlined = inline_sequence(compressor, scope, true, in_loop, false, cond, 1); - if (inlined) { - this.condition = cond.tail_node(); - inlined.body.push(this); - return inlined; - } - } - return (body || alt) && this; - }); - def(AST_IterationStatement, function(compressor, scope, no_return, in_loop) { - var body = this.body.try_inline(compressor, scope, true, true); - if (!body) return; - this.body = body; - return this; - }); - def(AST_LabeledStatement, function(compressor, scope, no_return, in_loop) { - var body = this.body.try_inline(compressor, scope, no_return, in_loop); - if (!body) return; - if (this.body instanceof AST_IterationStatement && body instanceof AST_BlockStatement) { - var loop = body.body.pop(); - this.body = loop; - body.body.push(this); - return body; - } - this.body = body; - return this; - }); - def(AST_New, noop); - def(AST_Return, function(compressor, scope, no_return, in_loop) { - var value = this.value; - return value && value.try_inline(compressor, scope, undefined, in_loop === "try"); - }); - function inline_sequence(compressor, scope, no_return, in_loop, in_await, node, skip) { - var body = [], exprs = node.expressions, no_ret = no_return; - for (var i = exprs.length - (skip || 0), j = i; --i >= 0; no_ret = true, in_await = false) { - var inlined = exprs[i].try_inline(compressor, scope, no_ret, in_loop, in_await); - if (!inlined) continue; - flush(); - body.push(inlined); - } - if (body.length == 0) return; - flush(); - if (!no_return && body[0] instanceof AST_SimpleStatement) { - body[0] = make_node(AST_Return, node, { value: body[0].body }); - } - return make_node(AST_BlockStatement, node, { body: body.reverse() }); - - function flush() { - if (j > i + 1) body.push(make_node(AST_SimpleStatement, node, { - body: make_sequence(node, exprs.slice(i + 1, j)), - })); - j = i; - } - } - def(AST_Sequence, function(compressor, scope, no_return, in_loop, in_await) { - return inline_sequence(compressor, scope, no_return, in_loop, in_await, this); - }); - def(AST_SimpleStatement, function(compressor, scope, no_return, in_loop) { - var body = this.body; - while (body instanceof AST_UnaryPrefix) { - var op = body.operator; - if (unary_side_effects[op]) break; - if (op == "void") break; - body = body.expression; - } - if (!no_return && !is_undefined(body)) body = make_node(AST_UnaryPrefix, this, { - operator: "void", - expression: body, - }); - return body.try_inline(compressor, scope, no_return || false, in_loop); - }); - def(AST_UnaryPrefix, function(compressor, scope, no_return, in_loop, in_await) { - var self = this; - var op = self.operator; - if (unary_side_effects[op]) return; - if (!no_return && op == "void") no_return = false; - var inlined = self.expression.try_inline(compressor, scope, no_return, in_loop, in_await); - if (!inlined) return; - if (!no_return) scan_local_returns(inlined, function(node) { - node.in_bool = false; - var value = node.value; - if (op == "void" && is_undefined(value)) return; - node.value = make_node(AST_UnaryPrefix, self, { - operator: op, - expression: value || make_node(AST_Undefined, node).transform(compressor), - }); - }); - return inlined; - }); - def(AST_With, function(compressor, scope, no_return, in_loop) { - var body = this.body.try_inline(compressor, scope, no_return, in_loop); - if (body) this.body = body; - var exp = this.expression; - if (exp instanceof AST_Sequence) { - var inlined = inline_sequence(compressor, scope, true, in_loop, false, exp, 1); - if (inlined) { - this.expression = exp.tail_node(); - inlined.body.push(this); - return inlined; - } - } - return body && this; - }); - def(AST_Yield, function(compressor, scope, no_return, in_loop) { - if (!compressor.option("yields")) return; - if (!this.nested) return; - var call = this.expression; - if (call.TYPE != "Call") return; - var fn = call.expression; - switch (fn.CTOR) { - case AST_AsyncGeneratorFunction: - fn = make_node(AST_AsyncFunction, fn); - break; - case AST_GeneratorFunction: - fn = make_node(AST_Function, fn); - break; - default: - return; - } - call = call.clone(); - call.expression = fn; - return call.try_inline(compressor, scope, no_return, in_loop); - }); - })(function(node, func) { - node.DEFMETHOD("try_inline", func); - }); - - OPT(AST_Return, function(self, compressor) { - var value = self.value; - if (value && compressor.option("side_effects") - && is_undefined(value, compressor) - && !in_async_generator(compressor.find_parent(AST_Scope))) { - self.value = null; - } - return self; - }); -})(function(node, optimizer) { - node.DEFMETHOD("optimize", function(compressor) { - var self = this; - if (self._optimized) return self; - if (compressor.has_directive("use asm")) return self; - var opt = optimizer(self, compressor); - opt._optimized = true; - return opt; - }); -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/uglify-js/lib/minify.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/uglify-js/lib/minify.js deleted file mode 100644 index c7a1341c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/uglify-js/lib/minify.js +++ /dev/null @@ -1,276 +0,0 @@ -"use strict"; - -var to_ascii, to_base64; -if (typeof Buffer == "undefined") { - to_ascii = atob; - to_base64 = btoa; -} else if (typeof Buffer.alloc == "undefined") { - to_ascii = function(b64) { - return new Buffer(b64, "base64").toString(); - }; - to_base64 = function(str) { - return new Buffer(str).toString("base64"); - }; -} else { - to_ascii = function(b64) { - return Buffer.from(b64, "base64").toString(); - }; - to_base64 = function(str) { - return Buffer.from(str).toString("base64"); - }; -} - -function read_source_map(name, toplevel) { - var comments = toplevel.end.comments_after; - for (var i = comments.length; --i >= 0;) { - var comment = comments[i]; - if (comment.type != "comment1") break; - var match = /^# ([^\s=]+)=(\S+)\s*$/.exec(comment.value); - if (!match) break; - if (match[1] == "sourceMappingURL") { - match = /^data:application\/json(;.*?)?;base64,([^,]+)$/.exec(match[2]); - if (!match) break; - return to_ascii(match[2]); - } - } - AST_Node.warn("inline source map not found: {name}", { - name: name, - }); -} - -function parse_source_map(content) { - try { - return JSON.parse(content); - } catch (ex) { - throw new Error("invalid input source map: " + content); - } -} - -function set_shorthand(name, options, keys) { - keys.forEach(function(key) { - if (options[key]) { - if (typeof options[key] != "object") options[key] = {}; - if (!(name in options[key])) options[key][name] = options[name]; - } - }); -} - -function init_cache(cache) { - if (!cache) return; - if (!("props" in cache)) { - cache.props = new Dictionary(); - } else if (!(cache.props instanceof Dictionary)) { - cache.props = Dictionary.fromObject(cache.props); - } -} - -function to_json(cache) { - return { - props: cache.props.toObject() - }; -} - -function minify(files, options) { - try { - options = defaults(options, { - annotations: undefined, - compress: {}, - enclose: false, - expression: false, - ie: false, - ie8: false, - keep_fargs: false, - keep_fnames: false, - mangle: {}, - module: false, - nameCache: null, - output: {}, - parse: {}, - rename: undefined, - sourceMap: false, - timings: false, - toplevel: !!(options && options["module"]), - v8: false, - validate: false, - warnings: false, - webkit: false, - wrap: false, - }, true); - if (options.validate) AST_Node.enable_validation(); - var timings = options.timings && { start: Date.now() }; - if (options.annotations !== undefined) set_shorthand("annotations", options, [ "compress", "output" ]); - if (options.expression) set_shorthand("expression", options, [ "compress", "parse" ]); - if (options.ie8) options.ie = options.ie || options.ie8; - if (options.ie) set_shorthand("ie", options, [ "compress", "mangle", "output", "rename" ]); - if (options.keep_fargs) set_shorthand("keep_fargs", options, [ "compress", "mangle", "rename" ]); - if (options.keep_fnames) set_shorthand("keep_fnames", options, [ "compress", "mangle", "rename" ]); - if (options.module) set_shorthand("module", options, [ "compress", "parse" ]); - if (options.toplevel) set_shorthand("toplevel", options, [ "compress", "mangle", "rename" ]); - if (options.v8) set_shorthand("v8", options, [ "mangle", "output", "rename" ]); - if (options.webkit) set_shorthand("webkit", options, [ "compress", "mangle", "output", "rename" ]); - var quoted_props; - if (options.mangle) { - options.mangle = defaults(options.mangle, { - cache: options.nameCache && (options.nameCache.vars || {}), - eval: false, - ie: false, - keep_fargs: false, - keep_fnames: false, - properties: false, - reserved: [], - toplevel: false, - v8: false, - webkit: false, - }, true); - if (options.mangle.properties) { - if (typeof options.mangle.properties != "object") { - options.mangle.properties = {}; - } - if (options.mangle.properties.keep_quoted) { - quoted_props = options.mangle.properties.reserved; - if (!Array.isArray(quoted_props)) quoted_props = []; - options.mangle.properties.reserved = quoted_props; - } - if (options.nameCache && !("cache" in options.mangle.properties)) { - options.mangle.properties.cache = options.nameCache.props || {}; - } - } - init_cache(options.mangle.cache); - init_cache(options.mangle.properties.cache); - } - if (options.rename === undefined) options.rename = options.compress && options.mangle; - if (options.sourceMap) { - options.sourceMap = defaults(options.sourceMap, { - content: null, - filename: null, - includeSources: false, - names: true, - root: null, - url: null, - }, true); - } - var warnings = []; - if (options.warnings) AST_Node.log_function(function(warning) { - warnings.push(warning); - }, options.warnings == "verbose"); - if (timings) timings.parse = Date.now(); - var toplevel; - options.parse = options.parse || {}; - if (files instanceof AST_Node) { - toplevel = files; - } else { - if (typeof files == "string") files = [ files ]; - options.parse.toplevel = null; - var source_map_content = options.sourceMap && options.sourceMap.content; - if (typeof source_map_content == "string" && source_map_content != "inline") { - source_map_content = parse_source_map(source_map_content); - } - if (source_map_content) options.sourceMap.orig = Object.create(null); - for (var name in files) if (HOP(files, name)) { - options.parse.filename = name; - options.parse.toplevel = toplevel = parse(files[name], options.parse); - if (source_map_content == "inline") { - var inlined_content = read_source_map(name, toplevel); - if (inlined_content) options.sourceMap.orig[name] = parse_source_map(inlined_content); - } else if (source_map_content) { - options.sourceMap.orig[name] = source_map_content; - } - } - } - if (options.parse.expression) toplevel = toplevel.wrap_expression(); - if (quoted_props) reserve_quoted_keys(toplevel, quoted_props); - [ "enclose", "wrap" ].forEach(function(action) { - var option = options[action]; - if (!option) return; - var orig = toplevel.print_to_string().slice(0, -1); - toplevel = toplevel[action](option); - files[toplevel.start.file] = toplevel.print_to_string().replace(orig, ""); - }); - if (options.validate) toplevel.validate_ast(); - if (timings) timings.rename = Date.now(); - if (options.rename) { - toplevel.figure_out_scope(options.rename); - toplevel.expand_names(options.rename); - } - if (timings) timings.compress = Date.now(); - if (options.compress) { - toplevel = new Compressor(options.compress).compress(toplevel); - if (options.validate) toplevel.validate_ast(); - } - if (timings) timings.scope = Date.now(); - if (options.mangle) toplevel.figure_out_scope(options.mangle); - if (timings) timings.mangle = Date.now(); - if (options.mangle) { - toplevel.compute_char_frequency(options.mangle); - toplevel.mangle_names(options.mangle); - } - if (timings) timings.properties = Date.now(); - if (quoted_props) reserve_quoted_keys(toplevel, quoted_props); - if (options.mangle && options.mangle.properties) mangle_properties(toplevel, options.mangle.properties); - if (options.parse.expression) toplevel = toplevel.unwrap_expression(); - if (timings) timings.output = Date.now(); - var result = {}; - var output = defaults(options.output, { - ast: false, - code: true, - }); - if (output.ast) result.ast = toplevel; - if (output.code) { - if (options.sourceMap) { - output.source_map = SourceMap(options.sourceMap); - if (options.sourceMap.includeSources) { - if (files instanceof AST_Toplevel) { - throw new Error("original source content unavailable"); - } else for (var name in files) if (HOP(files, name)) { - output.source_map.setSourceContent(name, files[name]); - } - } - } - delete output.ast; - delete output.code; - var stream = OutputStream(output); - toplevel.print(stream); - result.code = stream.get(); - if (options.sourceMap) { - result.map = output.source_map.toString(); - var url = options.sourceMap.url; - if (url) { - result.code = result.code.replace(/\n\/\/# sourceMappingURL=\S+\s*$/, ""); - if (url == "inline") { - result.code += "\n//# sourceMappingURL=data:application/json;charset=utf-8;base64," + to_base64(result.map); - } else { - result.code += "\n//# sourceMappingURL=" + url; - } - } - } - } - if (options.nameCache && options.mangle) { - if (options.mangle.cache) options.nameCache.vars = to_json(options.mangle.cache); - if (options.mangle.properties && options.mangle.properties.cache) { - options.nameCache.props = to_json(options.mangle.properties.cache); - } - } - if (timings) { - timings.end = Date.now(); - result.timings = { - parse: 1e-3 * (timings.rename - timings.parse), - rename: 1e-3 * (timings.compress - timings.rename), - compress: 1e-3 * (timings.scope - timings.compress), - scope: 1e-3 * (timings.mangle - timings.scope), - mangle: 1e-3 * (timings.properties - timings.mangle), - properties: 1e-3 * (timings.output - timings.properties), - output: 1e-3 * (timings.end - timings.output), - total: 1e-3 * (timings.end - timings.start) - }; - } - if (warnings.length) { - result.warnings = warnings; - } - return result; - } catch (ex) { - return { error: ex }; - } finally { - AST_Node.log_function(); - AST_Node.disable_validation(); - } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/uglify-js/lib/mozilla-ast.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/uglify-js/lib/mozilla-ast.js deleted file mode 100644 index 3e0534c8..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/uglify-js/lib/mozilla-ast.js +++ /dev/null @@ -1,1310 +0,0 @@ -/*********************************************************************** - - A JavaScript tokenizer / parser / beautifier / compressor. - https://github.com/mishoo/UglifyJS - - -------------------------------- (C) --------------------------------- - - Author: Mihai Bazon - - http://mihai.bazon.net/blog - - Distributed under the BSD license: - - Copyright 2012 (c) Mihai Bazon - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - * Redistributions of source code must retain the above - copyright notice, this list of conditions and the following - disclaimer. - - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials - provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY - EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR - TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF - THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - SUCH DAMAGE. - - ***********************************************************************/ - -"use strict"; - -(function() { - var MOZ_TO_ME = { - Program: function(M) { - return new AST_Toplevel({ - start: my_start_token(M), - end: my_end_token(M), - body: normalize_directives(M.body.map(from_moz)), - }); - }, - ArrowFunctionExpression: function(M) { - var argnames = [], rest = null; - M.params.forEach(function(param) { - if (param.type == "RestElement") { - rest = from_moz(param.argument); - } else { - argnames.push(from_moz(param)); - } - }); - var fn = new (M.async ? AST_AsyncArrow : AST_Arrow)({ - start: my_start_token(M), - end: my_end_token(M), - argnames: argnames, - rest: rest, - }); - var node = from_moz(M.body); - if (node instanceof AST_BlockStatement) { - fn.body = normalize_directives(node.body); - fn.value = null; - } else { - fn.body = []; - fn.value = node; - } - return fn; - }, - FunctionDeclaration: function(M) { - var ctor; - if (M.async) { - ctor = M.generator ? AST_AsyncGeneratorDefun : AST_AsyncDefun; - } else { - ctor = M.generator ? AST_GeneratorDefun : AST_Defun; - } - var argnames = [], rest = null; - M.params.forEach(function(param) { - if (param.type == "RestElement") { - rest = from_moz(param.argument); - } else { - argnames.push(from_moz(param)); - } - }); - return new ctor({ - start: my_start_token(M), - end: my_end_token(M), - name: from_moz(M.id), - argnames: argnames, - rest: rest, - body: normalize_directives(from_moz(M.body).body), - }); - }, - FunctionExpression: function(M) { - var ctor; - if (M.async) { - ctor = M.generator ? AST_AsyncGeneratorFunction : AST_AsyncFunction; - } else { - ctor = M.generator ? AST_GeneratorFunction : AST_Function; - } - var argnames = [], rest = null; - M.params.forEach(function(param) { - if (param.type == "RestElement") { - rest = from_moz(param.argument); - } else { - argnames.push(from_moz(param)); - } - }); - return new ctor({ - start: my_start_token(M), - end: my_end_token(M), - name: from_moz(M.id), - argnames: argnames, - rest: rest, - body: normalize_directives(from_moz(M.body).body), - }); - }, - ClassDeclaration: function(M) { - return new AST_DefClass({ - start: my_start_token(M), - end: my_end_token(M), - name: from_moz(M.id), - extends: from_moz(M.superClass), - properties: M.body.body.map(from_moz), - }); - }, - ClassExpression: function(M) { - return new AST_ClassExpression({ - start: my_start_token(M), - end: my_end_token(M), - name: from_moz(M.id), - extends: from_moz(M.superClass), - properties: M.body.body.map(from_moz), - }); - }, - MethodDefinition: function(M) { - var key = M.key, internal = false; - if (M.computed) { - key = from_moz(key); - } else if (key.type == "PrivateIdentifier") { - internal = true; - key = "#" + key.name; - } else { - key = read_name(key); - } - var ctor = AST_ClassMethod, value = from_moz(M.value); - switch (M.kind) { - case "get": - ctor = AST_ClassGetter; - value = new AST_Accessor(value); - break; - case "set": - ctor = AST_ClassSetter; - value = new AST_Accessor(value); - break; - } - return new ctor({ - start: my_start_token(M), - end: my_end_token(M), - key: key, - private: internal, - static: M.static, - value: value, - }); - }, - PropertyDefinition: function(M) { - var key = M.key, internal = false; - if (M.computed) { - key = from_moz(key); - } else if (key.type == "PrivateIdentifier") { - internal = true; - key = "#" + key.name; - } else { - key = read_name(key); - } - return new AST_ClassField({ - start: my_start_token(M), - end: my_end_token(M), - key: key, - private: internal, - static: M.static, - value: from_moz(M.value), - }); - }, - StaticBlock: function(M) { - var start = my_start_token(M); - var end = my_end_token(M); - return new AST_ClassInit({ - start: start, - end: end, - value: new AST_ClassInitBlock({ - start: start, - end: end, - body: normalize_directives(M.body.map(from_moz)), - }), - }); - }, - ForOfStatement: function(M) { - return new (M.await ? AST_ForAwaitOf : AST_ForOf)({ - start: my_start_token(M), - end: my_end_token(M), - init: from_moz(M.left), - object: from_moz(M.right), - body: from_moz(M.body), - }); - }, - TryStatement: function(M) { - var handlers = M.handlers || [M.handler]; - if (handlers.length > 1 || M.guardedHandlers && M.guardedHandlers.length) { - throw new Error("Multiple catch clauses are not supported."); - } - return new AST_Try({ - start : my_start_token(M), - end : my_end_token(M), - body : from_moz(M.block).body, - bcatch : from_moz(handlers[0]), - bfinally : M.finalizer ? new AST_Finally(from_moz(M.finalizer)) : null, - }); - }, - Property: function(M) { - var key = M.computed ? from_moz(M.key) : read_name(M.key); - var args = { - start: my_start_token(M), - end: my_end_token(M), - key: key, - value: from_moz(M.value), - }; - if (M.kind == "init") return new (M.method ? AST_ObjectMethod : AST_ObjectKeyVal)(args); - args.value = new AST_Accessor(args.value); - if (M.kind == "get") return new AST_ObjectGetter(args); - if (M.kind == "set") return new AST_ObjectSetter(args); - }, - ArrayExpression: function(M) { - return new AST_Array({ - start: my_start_token(M), - end: my_end_token(M), - elements: M.elements.map(function(elem) { - return elem === null ? new AST_Hole() : from_moz(elem); - }), - }); - }, - ArrayPattern: function(M) { - var elements = [], rest = null; - M.elements.forEach(function(el) { - if (el === null) { - elements.push(new AST_Hole()); - } else if (el.type == "RestElement") { - rest = from_moz(el.argument); - } else { - elements.push(from_moz(el)); - } - }); - return new AST_DestructuredArray({ - start: my_start_token(M), - end: my_end_token(M), - elements: elements, - rest: rest, - }); - }, - ObjectPattern: function(M) { - var props = [], rest = null; - M.properties.forEach(function(prop) { - if (prop.type == "RestElement") { - rest = from_moz(prop.argument); - } else { - props.push(new AST_DestructuredKeyVal(from_moz(prop))); - } - }); - return new AST_DestructuredObject({ - start: my_start_token(M), - end: my_end_token(M), - properties: props, - rest: rest, - }); - }, - MemberExpression: function(M) { - return new (M.computed ? AST_Sub : AST_Dot)({ - start: my_start_token(M), - end: my_end_token(M), - optional: M.optional, - expression: from_moz(M.object), - property: M.computed ? from_moz(M.property) : M.property.name, - }); - }, - MetaProperty: function(M) { - var expr = from_moz(M.meta); - var prop = read_name(M.property); - if (expr.name == "new" && prop == "target") return new AST_NewTarget({ - start: my_start_token(M), - end: my_end_token(M), - name: "new.target", - }); - return new AST_Dot({ - start: my_start_token(M), - end: my_end_token(M), - expression: expr, - property: prop, - }); - }, - SwitchCase: function(M) { - return new (M.test ? AST_Case : AST_Default)({ - start : my_start_token(M), - end : my_end_token(M), - expression : from_moz(M.test), - body : M.consequent.map(from_moz), - }); - }, - ExportAllDeclaration: function(M) { - var start = my_start_token(M); - var end = my_end_token(M); - return new AST_ExportForeign({ - start: start, - end: end, - aliases: [ M.exported ? from_moz_alias(M.exported) : new AST_String({ - start: start, - value: "*", - end: end, - }) ], - keys: [ new AST_String({ - start: start, - value: "*", - end: end, - }) ], - path: from_moz(M.source), - }); - }, - ExportDefaultDeclaration: function(M) { - var decl = from_moz(M.declaration); - if (!decl.name) switch (decl.CTOR) { - case AST_AsyncDefun: - decl = new AST_AsyncFunction(decl); - break; - case AST_AsyncGeneratorDefun: - decl = new AST_AsyncGeneratorFunction(decl); - break; - case AST_DefClass: - decl = new AST_ClassExpression(decl); - break; - case AST_Defun: - decl = new AST_Function(decl); - break; - case AST_GeneratorDefun: - decl = new AST_GeneratorFunction(decl); - break; - } - return new AST_ExportDefault({ - start: my_start_token(M), - end: my_end_token(M), - body: decl, - }); - }, - ExportNamedDeclaration: function(M) { - if (M.declaration) return new AST_ExportDeclaration({ - start: my_start_token(M), - end: my_end_token(M), - body: from_moz(M.declaration), - }); - if (M.source) { - var aliases = [], keys = []; - M.specifiers.forEach(function(prop) { - aliases.push(from_moz_alias(prop.exported)); - keys.push(from_moz_alias(prop.local)); - }); - return new AST_ExportForeign({ - start: my_start_token(M), - end: my_end_token(M), - aliases: aliases, - keys: keys, - path: from_moz(M.source), - }); - } - return new AST_ExportReferences({ - start: my_start_token(M), - end: my_end_token(M), - properties: M.specifiers.map(function(prop) { - var sym = new AST_SymbolExport(from_moz(prop.local)); - sym.alias = from_moz_alias(prop.exported); - return sym; - }), - }); - }, - ImportDeclaration: function(M) { - var start = my_start_token(M); - var end = my_end_token(M); - var all = null, def = null, props = null; - M.specifiers.forEach(function(prop) { - var sym = new AST_SymbolImport(from_moz(prop.local)); - switch (prop.type) { - case "ImportDefaultSpecifier": - def = sym; - def.key = new AST_String({ - start: start, - value: "", - end: end, - }); - break; - case "ImportNamespaceSpecifier": - all = sym; - all.key = new AST_String({ - start: start, - value: "*", - end: end, - }); - break; - default: - sym.key = from_moz_alias(prop.imported); - if (!props) props = []; - props.push(sym); - break; - } - }); - return new AST_Import({ - start: start, - end: end, - all: all, - default: def, - properties: props, - path: from_moz(M.source), - }); - }, - ImportExpression: function(M) { - var start = my_start_token(M); - var arg = from_moz(M.source); - return new AST_Call({ - start: start, - end: my_end_token(M), - expression: new AST_SymbolRef({ - start: start, - end: arg.start, - name: "import", - }), - args: [ arg ], - }); - }, - VariableDeclaration: function(M) { - return new ({ - const: AST_Const, - let: AST_Let, - }[M.kind] || AST_Var)({ - start: my_start_token(M), - end: my_end_token(M), - definitions: M.declarations.map(from_moz), - }); - }, - Literal: function(M) { - var args = { - start: my_start_token(M), - end: my_end_token(M), - }; - if (M.bigint) { - args.value = M.bigint.toLowerCase() + "n"; - return new AST_BigInt(args); - } - var val = M.value; - if (val === null) return new AST_Null(args); - var rx = M.regex; - if (rx && rx.pattern) { - // RegExpLiteral as per ESTree AST spec - args.value = new RegExp(rx.pattern, rx.flags); - args.value.raw_source = rx.pattern; - return new AST_RegExp(args); - } else if (rx) { - // support legacy RegExp - args.value = M.regex && M.raw ? M.raw : val; - return new AST_RegExp(args); - } - switch (typeof val) { - case "string": - args.value = val; - return new AST_String(args); - case "number": - if (isNaN(val)) return new AST_NaN(args); - var negate, node; - if (isFinite(val)) { - negate = 1 / val < 0; - args.value = negate ? -val : val; - node = new AST_Number(args); - } else { - negate = val < 0; - node = new AST_Infinity(args); - } - return negate ? new AST_UnaryPrefix({ - start: args.start, - end: args.end, - operator: "-", - expression: node, - }) : node; - case "boolean": - return new (val ? AST_True : AST_False)(args); - } - }, - TemplateLiteral: function(M) { - return new AST_Template({ - start: my_start_token(M), - end: my_end_token(M), - expressions: M.expressions.map(from_moz), - strings: M.quasis.map(function(el) { - return el.value.raw; - }), - }); - }, - TaggedTemplateExpression: function(M) { - var tmpl = from_moz(M.quasi); - tmpl.start = my_start_token(M); - tmpl.end = my_end_token(M); - tmpl.tag = from_moz(M.tag); - return tmpl; - }, - Identifier: function(M) { - var p, level = FROM_MOZ_STACK.length - 1; - do { - p = FROM_MOZ_STACK[--level]; - } while (p.type == "ArrayPattern" - || p.type == "AssignmentPattern" && p.left === FROM_MOZ_STACK[level + 1] - || p.type == "ObjectPattern" - || p.type == "Property" && p.value === FROM_MOZ_STACK[level + 1] - || p.type == "VariableDeclarator" && p.id === FROM_MOZ_STACK[level + 1]); - var ctor = AST_SymbolRef; - switch (p.type) { - case "ArrowFunctionExpression": - if (p.body !== FROM_MOZ_STACK[level + 1]) ctor = AST_SymbolFunarg; - break; - case "BreakStatement": - case "ContinueStatement": - ctor = AST_LabelRef; - break; - case "CatchClause": - ctor = AST_SymbolCatch; - break; - case "ClassDeclaration": - if (p.id === FROM_MOZ_STACK[level + 1]) ctor = AST_SymbolDefClass; - break; - case "ClassExpression": - if (p.id === FROM_MOZ_STACK[level + 1]) ctor = AST_SymbolClass; - break; - case "FunctionDeclaration": - ctor = p.id === FROM_MOZ_STACK[level + 1] ? AST_SymbolDefun : AST_SymbolFunarg; - break; - case "FunctionExpression": - ctor = p.id === FROM_MOZ_STACK[level + 1] ? AST_SymbolLambda : AST_SymbolFunarg; - break; - case "LabeledStatement": - ctor = AST_Label; - break; - case "VariableDeclaration": - ctor = { - const: AST_SymbolConst, - let: AST_SymbolLet, - }[p.kind] || AST_SymbolVar; - break; - } - return new ctor({ - start: my_start_token(M), - end: my_end_token(M), - name: M.name, - }); - }, - Super: function(M) { - return new AST_Super({ - start: my_start_token(M), - end: my_end_token(M), - name: "super", - }); - }, - ThisExpression: function(M) { - return new AST_This({ - start: my_start_token(M), - end: my_end_token(M), - name: "this", - }); - }, - ParenthesizedExpression: function(M) { - var node = from_moz(M.expression); - if (!node.start.parens) node.start.parens = []; - node.start.parens.push(my_start_token(M)); - if (!node.end.parens) node.end.parens = []; - node.end.parens.push(my_end_token(M)); - return node; - }, - ChainExpression: function(M) { - var node = from_moz(M.expression); - node.terminal = true; - return node; - }, - }; - - MOZ_TO_ME.UpdateExpression = - MOZ_TO_ME.UnaryExpression = function To_Moz_Unary(M) { - var prefix = "prefix" in M ? M.prefix - : M.type == "UnaryExpression" ? true : false; - return new (prefix ? AST_UnaryPrefix : AST_UnaryPostfix)({ - start : my_start_token(M), - end : my_end_token(M), - operator : M.operator, - expression : from_moz(M.argument) - }); - }; - - map("EmptyStatement", AST_EmptyStatement); - map("ExpressionStatement", AST_SimpleStatement, "expression>body"); - map("BlockStatement", AST_BlockStatement, "body@body"); - map("IfStatement", AST_If, "test>condition, consequent>body, alternate>alternative"); - map("LabeledStatement", AST_LabeledStatement, "label>label, body>body"); - map("BreakStatement", AST_Break, "label>label"); - map("ContinueStatement", AST_Continue, "label>label"); - map("WithStatement", AST_With, "object>expression, body>body"); - map("SwitchStatement", AST_Switch, "discriminant>expression, cases@body"); - map("ReturnStatement", AST_Return, "argument>value"); - map("ThrowStatement", AST_Throw, "argument>value"); - map("WhileStatement", AST_While, "test>condition, body>body"); - map("DoWhileStatement", AST_Do, "test>condition, body>body"); - map("ForStatement", AST_For, "init>init, test>condition, update>step, body>body"); - map("ForInStatement", AST_ForIn, "left>init, right>object, body>body"); - map("DebuggerStatement", AST_Debugger); - map("VariableDeclarator", AST_VarDef, "id>name, init>value"); - map("CatchClause", AST_Catch, "param>argname, body%body"); - - map("BinaryExpression", AST_Binary, "operator=operator, left>left, right>right"); - map("LogicalExpression", AST_Binary, "operator=operator, left>left, right>right"); - map("AssignmentExpression", AST_Assign, "operator=operator, left>left, right>right"); - map("AssignmentPattern", AST_DefaultValue, "left>name, right>value"); - map("ConditionalExpression", AST_Conditional, "test>condition, consequent>consequent, alternate>alternative"); - map("NewExpression", AST_New, "callee>expression, arguments@args, pure=pure"); - map("CallExpression", AST_Call, "callee>expression, arguments@args, optional=optional, pure=pure"); - map("SequenceExpression", AST_Sequence, "expressions@expressions"); - map("SpreadElement", AST_Spread, "argument>expression"); - map("ObjectExpression", AST_Object, "properties@properties"); - map("AwaitExpression", AST_Await, "argument>expression"); - map("YieldExpression", AST_Yield, "argument>expression, delegate=nested"); - - def_to_moz(AST_Toplevel, function To_Moz_Program(M) { - return to_moz_scope("Program", M); - }); - - def_to_moz(AST_LambdaDefinition, function To_Moz_FunctionDeclaration(M) { - var params = M.argnames.map(to_moz); - if (M.rest) params.push({ - type: "RestElement", - argument: to_moz(M.rest), - }); - return { - type: "FunctionDeclaration", - id: to_moz(M.name), - async: is_async(M), - generator: is_generator(M), - params: params, - body: to_moz_scope("BlockStatement", M), - }; - }); - - def_to_moz(AST_Lambda, function To_Moz_FunctionExpression(M) { - var params = M.argnames.map(to_moz); - if (M.rest) params.push({ - type: "RestElement", - argument: to_moz(M.rest), - }); - if (is_arrow(M)) return { - type: "ArrowFunctionExpression", - async: is_async(M), - params: params, - body: M.value ? to_moz(M.value) : to_moz_scope("BlockStatement", M), - }; - return { - type: "FunctionExpression", - id: to_moz(M.name), - async: is_async(M), - generator: is_generator(M), - params: params, - body: to_moz_scope("BlockStatement", M), - }; - }); - - def_to_moz(AST_DefClass, function To_Moz_ClassDeclaration(M) { - return { - type: "ClassDeclaration", - id: to_moz(M.name), - superClass: to_moz(M.extends), - body: { - type: "ClassBody", - body: M.properties.map(to_moz), - }, - }; - }); - - def_to_moz(AST_ClassExpression, function To_Moz_ClassExpression(M) { - return { - type: "ClassExpression", - id: to_moz(M.name), - superClass: to_moz(M.extends), - body: { - type: "ClassBody", - body: M.properties.map(to_moz), - }, - }; - }); - - function To_Moz_MethodDefinition(kind) { - return function(M) { - var computed = M.key instanceof AST_Node; - var key = computed ? to_moz(M.key) : M.private ? { - type: "PrivateIdentifier", - name: M.key.slice(1), - } : { - type: "Literal", - value: M.key, - }; - return { - type: "MethodDefinition", - kind: kind, - computed: computed, - key: key, - static: M.static, - value: to_moz(M.value), - }; - }; - } - def_to_moz(AST_ClassGetter, To_Moz_MethodDefinition("get")); - def_to_moz(AST_ClassSetter, To_Moz_MethodDefinition("set")); - def_to_moz(AST_ClassMethod, To_Moz_MethodDefinition("method")); - - def_to_moz(AST_ClassField, function To_Moz_PropertyDefinition(M) { - var computed = M.key instanceof AST_Node; - var key = computed ? to_moz(M.key) : M.private ? { - type: "PrivateIdentifier", - name: M.key.slice(1), - } : { - type: "Literal", - value: M.key, - }; - return { - type: "PropertyDefinition", - computed: computed, - key: key, - static: M.static, - value: to_moz(M.value), - }; - }); - - def_to_moz(AST_ClassInit, function To_Moz_StaticBlock(M) { - return to_moz_scope("StaticBlock", M.value); - }); - - function To_Moz_ForOfStatement(is_await) { - return function(M) { - return { - type: "ForOfStatement", - await: is_await, - left: to_moz(M.init), - right: to_moz(M.object), - body: to_moz(M.body), - }; - }; - } - def_to_moz(AST_ForAwaitOf, To_Moz_ForOfStatement(true)); - def_to_moz(AST_ForOf, To_Moz_ForOfStatement(false)); - - def_to_moz(AST_Directive, function To_Moz_Directive(M) { - return { - type: "ExpressionStatement", - expression: set_moz_loc(M, { - type: "Literal", - value: M.value, - }), - }; - }); - - def_to_moz(AST_SwitchBranch, function To_Moz_SwitchCase(M) { - return { - type: "SwitchCase", - test: to_moz(M.expression), - consequent: M.body.map(to_moz), - }; - }); - - def_to_moz(AST_Try, function To_Moz_TryStatement(M) { - return { - type: "TryStatement", - block: to_moz_block(M), - handler: to_moz(M.bcatch), - guardedHandlers: [], - finalizer: to_moz(M.bfinally), - }; - }); - - def_to_moz(AST_Catch, function To_Moz_CatchClause(M) { - return { - type: "CatchClause", - param: to_moz(M.argname), - guard: null, - body: to_moz_block(M), - }; - }); - - def_to_moz(AST_ExportDeclaration, function To_Moz_ExportNamedDeclaration_declaration(M) { - return { - type: "ExportNamedDeclaration", - declaration: to_moz(M.body), - }; - }); - - def_to_moz(AST_ExportDefault, function To_Moz_ExportDefaultDeclaration(M) { - return { - type: "ExportDefaultDeclaration", - declaration: to_moz(M.body), - }; - }); - - def_to_moz(AST_ExportForeign, function To_Moz_ExportAllDeclaration_ExportNamedDeclaration(M) { - if (M.keys[0].value == "*") return { - type: "ExportAllDeclaration", - exported: M.aliases[0].value == "*" ? null : to_moz_alias(M.aliases[0]), - source: to_moz(M.path), - }; - var specifiers = []; - for (var i = 0; i < M.aliases.length; i++) { - specifiers.push(set_moz_loc({ - start: M.keys[i].start, - end: M.aliases[i].end, - }, { - type: "ExportSpecifier", - local: to_moz_alias(M.keys[i]), - exported: to_moz_alias(M.aliases[i]), - })); - } - return { - type: "ExportNamedDeclaration", - specifiers: specifiers, - source: to_moz(M.path), - }; - }); - - def_to_moz(AST_ExportReferences, function To_Moz_ExportNamedDeclaration_specifiers(M) { - return { - type: "ExportNamedDeclaration", - specifiers: M.properties.map(function(prop) { - return set_moz_loc({ - start: prop.start, - end: prop.alias.end, - }, { - type: "ExportSpecifier", - local: to_moz(prop), - exported: to_moz_alias(prop.alias), - }); - }), - }; - }); - - def_to_moz(AST_Import, function To_Moz_ImportDeclaration(M) { - var specifiers = M.properties ? M.properties.map(function(prop) { - return set_moz_loc({ - start: prop.key.start, - end: prop.end, - }, { - type: "ImportSpecifier", - local: to_moz(prop), - imported: to_moz_alias(prop.key), - }); - }) : []; - if (M.all) specifiers.unshift(set_moz_loc(M.all, { - type: "ImportNamespaceSpecifier", - local: to_moz(M.all), - })); - if (M.default) specifiers.unshift(set_moz_loc(M.default, { - type: "ImportDefaultSpecifier", - local: to_moz(M.default), - })); - return { - type: "ImportDeclaration", - specifiers: specifiers, - source: to_moz(M.path), - }; - }); - - def_to_moz(AST_Definitions, function To_Moz_VariableDeclaration(M) { - return { - type: "VariableDeclaration", - kind: M.TYPE.toLowerCase(), - declarations: M.definitions.map(to_moz), - }; - }); - - def_to_moz(AST_PropAccess, function To_Moz_MemberExpression(M) { - var computed = M instanceof AST_Sub; - var expr = { - type: "MemberExpression", - object: to_moz(M.expression), - computed: computed, - optional: M.optional, - property: computed ? to_moz(M.property) : { - type: "Identifier", - name: M.property, - }, - }; - return M.terminal ? { - type: "ChainExpression", - expression: expr, - } : expr; - }); - - def_to_moz(AST_Unary, function To_Moz_Unary(M) { - return { - type: M.operator == "++" || M.operator == "--" ? "UpdateExpression" : "UnaryExpression", - operator: M.operator, - prefix: M instanceof AST_UnaryPrefix, - argument: to_moz(M.expression) - }; - }); - - def_to_moz(AST_Binary, function To_Moz_BinaryExpression(M) { - return { - type: M.operator == "&&" || M.operator == "||" ? "LogicalExpression" : "BinaryExpression", - left: to_moz(M.left), - operator: M.operator, - right: to_moz(M.right) - }; - }); - - def_to_moz(AST_Array, function To_Moz_ArrayExpression(M) { - return { - type: "ArrayExpression", - elements: M.elements.map(to_moz), - }; - }); - - def_to_moz(AST_DestructuredArray, function To_Moz_ArrayPattern(M) { - var elements = M.elements.map(to_moz); - if (M.rest) elements.push({ - type: "RestElement", - argument: to_moz(M.rest), - }); - return { - type: "ArrayPattern", - elements: elements, - }; - }); - - def_to_moz(AST_DestructuredKeyVal, function To_Moz_Property(M) { - var computed = M.key instanceof AST_Node; - var key = computed ? to_moz(M.key) : { - type: "Literal", - value: M.key, - }; - return { - type: "Property", - kind: "init", - computed: computed, - key: key, - value: to_moz(M.value), - }; - }); - - def_to_moz(AST_DestructuredObject, function To_Moz_ObjectPattern(M) { - var props = M.properties.map(to_moz); - if (M.rest) props.push({ - type: "RestElement", - argument: to_moz(M.rest), - }); - return { - type: "ObjectPattern", - properties: props, - }; - }); - - def_to_moz(AST_ObjectProperty, function To_Moz_Property(M) { - var computed = M.key instanceof AST_Node; - var key = computed ? to_moz(M.key) : { - type: "Literal", - value: M.key, - }; - var kind; - if (M instanceof AST_ObjectKeyVal) { - kind = "init"; - } else if (M instanceof AST_ObjectGetter) { - kind = "get"; - } else if (M instanceof AST_ObjectSetter) { - kind = "set"; - } - return { - type: "Property", - kind: kind, - computed: computed, - method: M instanceof AST_ObjectMethod, - key: key, - value: to_moz(M.value), - }; - }); - - def_to_moz(AST_Symbol, function To_Moz_Identifier(M) { - var def = M.definition(); - return { - type: "Identifier", - name: def && def.mangled_name || M.name, - }; - }); - - def_to_moz(AST_Super, function To_Moz_Super() { - return { type: "Super" }; - }); - - def_to_moz(AST_This, function To_Moz_ThisExpression() { - return { type: "ThisExpression" }; - }); - - def_to_moz(AST_NewTarget, function To_Moz_MetaProperty() { - return { - type: "MetaProperty", - meta: { - type: "Identifier", - name: "new", - }, - property: { - type: "Identifier", - name: "target", - }, - }; - }); - - def_to_moz(AST_RegExp, function To_Moz_RegExpLiteral(M) { - var flags = M.value.toString().match(/\/([gimuy]*)$/)[1]; - var value = "/" + M.value.raw_source + "/" + flags; - return { - type: "Literal", - value: value, - raw: value, - regex: { - pattern: M.value.raw_source, - flags: flags, - }, - }; - }); - - def_to_moz(AST_BigInt, function To_Moz_BigInt(M) { - var value = M.value; - return { - type: "Literal", - bigint: value.slice(0, -1), - raw: value, - }; - }); - - function To_Moz_Literal(M) { - var value = M.value; - if (typeof value === "number" && (value < 0 || (value === 0 && 1 / value < 0))) { - return { - type: "UnaryExpression", - operator: "-", - prefix: true, - argument: { - type: "Literal", - value: -value, - raw: M.start.raw, - }, - }; - } - return { - type: "Literal", - value: value, - raw: M.start.raw, - }; - } - def_to_moz(AST_Boolean, To_Moz_Literal); - def_to_moz(AST_Constant, To_Moz_Literal); - def_to_moz(AST_Null, To_Moz_Literal); - - def_to_moz(AST_Atom, function To_Moz_Atom(M) { - return { - type: "Identifier", - name: String(M.value), - }; - }); - - def_to_moz(AST_Template, function To_Moz_TemplateLiteral_TaggedTemplateExpression(M) { - var last = M.strings.length - 1; - var tmpl = { - type: "TemplateLiteral", - expressions: M.expressions.map(to_moz), - quasis: M.strings.map(function(str, index) { - return { - type: "TemplateElement", - tail: index == last, - value: { raw: str }, - }; - }), - }; - if (!M.tag) return tmpl; - return { - type: "TaggedTemplateExpression", - tag: to_moz(M.tag), - quasi: tmpl, - }; - }); - - AST_Block.DEFMETHOD("to_mozilla_ast", AST_BlockStatement.prototype.to_mozilla_ast); - AST_Hole.DEFMETHOD("to_mozilla_ast", return_null); - AST_Node.DEFMETHOD("to_mozilla_ast", function() { - throw new Error("Cannot convert AST_" + this.TYPE); - }); - - /* -----[ tools ]----- */ - - function normalize_directives(body) { - for (var i = 0; i < body.length; i++) { - var stat = body[i]; - if (!(stat instanceof AST_SimpleStatement)) break; - var node = stat.body; - if (!(node instanceof AST_String)) break; - if (stat.start.pos !== node.start.pos) break; - body[i] = new AST_Directive(node); - } - return body; - } - - function raw_token(moznode) { - if (moznode.type == "Literal") { - return moznode.raw != null ? moznode.raw : moznode.value + ""; - } - } - - function my_start_token(moznode) { - var loc = moznode.loc, start = loc && loc.start; - var range = moznode.range; - return new AST_Token({ - file : loc && loc.source, - line : start && start.line, - col : start && start.column, - pos : range ? range[0] : moznode.start, - endline : start && start.line, - endcol : start && start.column, - endpos : range ? range[0] : moznode.start, - raw : raw_token(moznode), - }); - } - - function my_end_token(moznode) { - var loc = moznode.loc, end = loc && loc.end; - var range = moznode.range; - return new AST_Token({ - file : loc && loc.source, - line : end && end.line, - col : end && end.column, - pos : range ? range[1] : moznode.end, - endline : end && end.line, - endcol : end && end.column, - endpos : range ? range[1] : moznode.end, - raw : raw_token(moznode), - }); - } - - function read_name(M) { - return "" + M[M.type == "Identifier" ? "name" : "value"]; - } - - function map(moztype, mytype, propmap) { - var moz_to_me = [ - "start: my_start_token(M)", - "end: my_end_token(M)", - ]; - var me_to_moz = [ - "type: " + JSON.stringify(moztype), - ]; - - if (propmap) propmap.split(/\s*,\s*/).forEach(function(prop) { - var m = /([a-z0-9$_]+)(=|@|>|%)([a-z0-9$_]+)/i.exec(prop); - if (!m) throw new Error("Can't understand property map: " + prop); - var moz = m[1], how = m[2], my = m[3]; - switch (how) { - case "@": - moz_to_me.push(my + ": M." + moz + ".map(from_moz)"); - me_to_moz.push(moz + ": M." + my + ".map(to_moz)"); - break; - case ">": - moz_to_me.push(my + ": from_moz(M." + moz + ")"); - me_to_moz.push(moz + ": to_moz(M." + my + ")"); - break; - case "=": - moz_to_me.push(my + ": M." + moz); - me_to_moz.push(moz + ": M." + my); - break; - case "%": - moz_to_me.push(my + ": from_moz(M." + moz + ").body"); - me_to_moz.push(moz + ": to_moz_block(M)"); - break; - default: - throw new Error("Can't understand operator in propmap: " + prop); - } - }); - - MOZ_TO_ME[moztype] = new Function("U2", "my_start_token", "my_end_token", "from_moz", [ - "return function From_Moz_" + moztype + "(M) {", - " return new U2.AST_" + mytype.TYPE + "({", - moz_to_me.join(",\n"), - " });", - "};", - ].join("\n"))(exports, my_start_token, my_end_token, from_moz); - def_to_moz(mytype, new Function("to_moz", "to_moz_block", "to_moz_scope", [ - "return function To_Moz_" + moztype + "(M) {", - " return {", - me_to_moz.join(",\n"), - " };", - "};", - ].join("\n"))(to_moz, to_moz_block, to_moz_scope)); - } - - var FROM_MOZ_STACK = null; - - function from_moz(moz) { - FROM_MOZ_STACK.push(moz); - var node = null; - if (moz) { - if (!HOP(MOZ_TO_ME, moz.type)) throw new Error("Unsupported type: " + moz.type); - node = MOZ_TO_ME[moz.type](moz); - } - FROM_MOZ_STACK.pop(); - return node; - } - - function from_moz_alias(moz) { - return new AST_String({ - start: my_start_token(moz), - value: read_name(moz), - end: my_end_token(moz), - }); - } - - AST_Node.from_mozilla_ast = function(node) { - var save_stack = FROM_MOZ_STACK; - FROM_MOZ_STACK = []; - var ast = from_moz(node); - FROM_MOZ_STACK = save_stack; - ast.walk(new TreeWalker(function(node) { - if (node instanceof AST_LabelRef) { - for (var level = 0, parent; parent = this.parent(level); level++) { - if (parent instanceof AST_Scope) break; - if (parent instanceof AST_LabeledStatement && parent.label.name == node.name) { - node.thedef = parent.label; - break; - } - } - if (!node.thedef) { - var s = node.start; - js_error("Undefined label " + node.name, s.file, s.line, s.col, s.pos); - } - } - })); - return ast; - }; - - function set_moz_loc(mynode, moznode) { - var start = mynode.start; - var end = mynode.end; - if (start.pos != null && end.endpos != null) { - moznode.range = [start.pos, end.endpos]; - } - if (start.line) { - moznode.loc = { - start: {line: start.line, column: start.col}, - end: end.endline ? {line: end.endline, column: end.endcol} : null, - }; - if (start.file) { - moznode.loc.source = start.file; - } - } - return moznode; - } - - function def_to_moz(mytype, handler) { - mytype.DEFMETHOD("to_mozilla_ast", function() { - return set_moz_loc(this, handler(this)); - }); - } - - function to_moz(node) { - return node != null ? node.to_mozilla_ast() : null; - } - - function to_moz_alias(alias) { - return is_identifier_string(alias.value) ? set_moz_loc(alias, { - type: "Identifier", - name: alias.value, - }) : to_moz(alias); - } - - function to_moz_block(node) { - return { - type: "BlockStatement", - body: node.body.map(to_moz), - }; - } - - function to_moz_scope(type, node) { - var body = node.body.map(to_moz); - if (node.body[0] instanceof AST_SimpleStatement && node.body[0].body instanceof AST_String) { - body.unshift(to_moz(new AST_EmptyStatement(node.body[0]))); - } - return { - type: type, - body: body, - }; - } -})(); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/uglify-js/lib/output.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/uglify-js/lib/output.js deleted file mode 100644 index 7e93d05e..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/uglify-js/lib/output.js +++ /dev/null @@ -1,1956 +0,0 @@ -/*********************************************************************** - - A JavaScript tokenizer / parser / beautifier / compressor. - https://github.com/mishoo/UglifyJS - - -------------------------------- (C) --------------------------------- - - Author: Mihai Bazon - - http://mihai.bazon.net/blog - - Distributed under the BSD license: - - Copyright 2012 (c) Mihai Bazon - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - * Redistributions of source code must retain the above - copyright notice, this list of conditions and the following - disclaimer. - - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials - provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY - EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR - TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF - THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - SUCH DAMAGE. - - ***********************************************************************/ - -"use strict"; - -function is_some_comments(comment) { - // multiline comment - return comment.type == "comment2" && /@preserve|@license|@cc_on/i.test(comment.value); -} - -function OutputStream(options) { - options = defaults(options, { - annotations : false, - ascii_only : false, - beautify : false, - braces : false, - comments : false, - extendscript : false, - galio : false, - ie : false, - indent_level : 4, - indent_start : 0, - inline_script : true, - keep_quoted_props: false, - max_line_len : false, - preamble : null, - preserve_line : false, - quote_keys : false, - quote_style : 0, - semicolons : true, - shebang : true, - source_map : null, - v8 : false, - webkit : false, - width : 80, - wrap_iife : false, - }, true); - - // Convert comment option to RegExp if necessary and set up comments filter - var comment_filter = return_false; // Default case, throw all comments away - if (options.comments) { - var comments = options.comments; - if (typeof options.comments === "string" && /^\/.*\/[a-zA-Z]*$/.test(options.comments)) { - var regex_pos = options.comments.lastIndexOf("/"); - comments = new RegExp( - options.comments.substr(1, regex_pos - 1), - options.comments.substr(regex_pos + 1) - ); - } - if (comments instanceof RegExp) { - comment_filter = function(comment) { - return comment.type != "comment5" && comments.test(comment.value); - }; - } else if (typeof comments === "function") { - comment_filter = function(comment) { - return comment.type != "comment5" && comments(this, comment); - }; - } else if (comments === "some") { - comment_filter = is_some_comments; - } else { // NOTE includes "all" option - comment_filter = return_true; - } - } - - function make_indent(value) { - if (typeof value == "number") return new Array(value + 1).join(" "); - if (!value) return ""; - if (!/^\s*$/.test(value)) throw new Error("unsupported indentation: " + JSON.stringify("" + value)); - return value; - } - - var current_col = 0; - var current_line = 1; - var current_indent = make_indent(options.indent_start); - var full_indent = make_indent(options.indent_level); - var half_indent = full_indent.length + 1 >> 1; - var last; - var line_end = 0; - var line_fixed = true; - var mappings = options.source_map && []; - var mapping_name; - var mapping_token; - var might_need_space; - var might_need_semicolon; - var need_newline_indented = false; - var need_space = false; - var output; - var stack; - var stored = ""; - - function reset() { - last = ""; - might_need_space = false; - might_need_semicolon = false; - stack = []; - var str = output; - output = ""; - return str; - } - - reset(); - var to_utf8 = options.ascii_only ? function(str, identifier) { - if (identifier) str = str.replace(/[\ud800-\udbff][\udc00-\udfff]/g, function(ch) { - return "\\u{" + (ch.charCodeAt(0) - 0xd7c0 << 10 | ch.charCodeAt(1) - 0xdc00).toString(16) + "}"; - }); - return str.replace(/[\u0000-\u001f\u007f-\uffff]/g, function(ch) { - var code = ch.charCodeAt(0).toString(16); - if (code.length <= 2 && !identifier) { - while (code.length < 2) code = "0" + code; - return "\\x" + code; - } else { - while (code.length < 4) code = "0" + code; - return "\\u" + code; - } - }); - } : function(str) { - var s = ""; - for (var i = 0, j = 0; i < str.length; i++) { - var code = str.charCodeAt(i); - if (is_surrogate_pair_head(code)) { - if (is_surrogate_pair_tail(str.charCodeAt(i + 1))) { - i++; - continue; - } - } else if (!is_surrogate_pair_tail(code)) { - continue; - } - s += str.slice(j, i) + "\\u" + code.toString(16); - j = i + 1; - } - return j == 0 ? str : s + str.slice(j); - }; - - function quote_single(str) { - return "'" + str.replace(/\x27/g, "\\'") + "'"; - } - - function quote_double(str) { - return '"' + str.replace(/\x22/g, '\\"') + '"'; - } - - var quote_string = [ - null, - quote_single, - quote_double, - function(str, quote) { - return quote == "'" ? quote_single(str) : quote_double(str); - }, - ][options.quote_style] || function(str, quote, dq, sq) { - return dq > sq ? quote_single(str) : quote_double(str); - }; - - function make_string(str, quote) { - var dq = 0, sq = 0; - str = str.replace(/[\\\b\f\n\r\v\t\x22\x27\u2028\u2029\0\ufeff]/g, function(s, i) { - switch (s) { - case '"': ++dq; return '"'; - case "'": ++sq; return "'"; - case "\\": return "\\\\"; - case "\n": return "\\n"; - case "\r": return "\\r"; - case "\t": return "\\t"; - case "\b": return "\\b"; - case "\f": return "\\f"; - case "\x0B": return options.ie ? "\\x0B" : "\\v"; - case "\u2028": return "\\u2028"; - case "\u2029": return "\\u2029"; - case "\ufeff": return "\\ufeff"; - case "\0": - return /[0-9]/.test(str.charAt(i+1)) ? "\\x00" : "\\0"; - } - return s; - }); - return quote_string(to_utf8(str), quote, dq, sq); - } - - /* -----[ beautification/minification ]----- */ - - var adjust_mappings = mappings ? function(line, col) { - mappings.forEach(function(mapping) { - mapping.line += line; - mapping.col += col; - }); - } : noop; - - var flush_mappings = mappings ? function() { - mappings.forEach(function(mapping) { - options.source_map.add( - mapping.token.file, - mapping.line, mapping.col, - mapping.token.line, mapping.token.col, - !mapping.name && mapping.token.type == "name" ? mapping.token.value : mapping.name - ); - }); - mappings = []; - } : noop; - - function insert_newlines(count) { - stored += output.slice(0, line_end); - output = output.slice(line_end); - var new_col = output.length; - adjust_mappings(count, new_col - current_col); - current_line += count; - current_col = new_col; - while (count--) stored += "\n"; - } - - var fix_line = options.max_line_len ? function(flush) { - if (line_fixed) { - if (current_col > options.max_line_len) { - AST_Node.warn("Output exceeds {max_line_len} characters", options); - } - return; - } - if (current_col > options.max_line_len) { - insert_newlines(1); - line_fixed = true; - } - if (line_fixed || flush) flush_mappings(); - } : noop; - - var require_semicolon = makePredicate("( [ + * / - , ."); - - function require_space(prev, ch, str) { - return is_identifier_char(prev) && (is_identifier_char(ch) || ch == "\\") - || (ch == "/" && ch == prev) - || ((ch == "+" || ch == "-") && ch == last) - || last == "--" && ch == ">" - || last == "!" && str == "--" - || prev == "/" && (str == "in" || str == "instanceof"); - } - - var print = options.beautify - || options.comments - || options.max_line_len - || options.preserve_line - || options.shebang - || !options.semicolons - || options.source_map - || options.width ? function(str) { - var ch = str.charAt(0); - if (need_newline_indented && ch) { - need_newline_indented = false; - if (ch != "\n") { - print("\n"); - indent(); - } - } - if (need_space && ch) { - need_space = false; - if (!/[\s;})]/.test(ch)) { - space(); - } - } - var prev = last.slice(-1); - if (might_need_semicolon) { - might_need_semicolon = false; - if (prev == ":" && ch == "}" || prev != ";" && (!ch || ";}".indexOf(ch) < 0)) { - var need_semicolon = require_semicolon[ch]; - if (need_semicolon || options.semicolons) { - output += ";"; - current_col++; - if (!line_fixed) { - fix_line(); - if (line_fixed && !need_semicolon && output == ";") { - output = ""; - current_col = 0; - } - } - if (line_end == output.length - 1) line_end++; - } else { - fix_line(); - output += "\n"; - current_line++; - current_col = 0; - // reset the semicolon flag, since we didn't print one - // now and might still have to later - if (/^\s+$/.test(str)) might_need_semicolon = true; - } - if (!options.beautify) might_need_space = false; - } - } - - if (might_need_space) { - if (require_space(prev, ch, str)) { - output += " "; - current_col++; - } - if (prev != "<" || str != "!") might_need_space = false; - } - - if (mapping_token) { - mappings.push({ - token: mapping_token, - name: mapping_name, - line: current_line, - col: current_col, - }); - mapping_token = false; - if (line_fixed) flush_mappings(); - } - - output += str; - var a = str.split(/\r?\n/), n = a.length - 1; - current_line += n; - current_col += a[0].length; - if (n > 0) { - fix_line(); - current_col = a[n].length; - } - last = str; - } : function(str) { - var ch = str.charAt(0); - var prev = last.slice(-1); - if (might_need_semicolon) { - might_need_semicolon = false; - if (prev == ":" && ch == "}" || (!ch || ";}".indexOf(ch) < 0) && prev != ";") { - output += ";"; - might_need_space = false; - } - } - if (might_need_space) { - if (require_space(prev, ch, str)) output += " "; - if (prev != "<" || str != "!") might_need_space = false; - } - output += str; - last = str; - }; - - var space = options.beautify ? function() { - print(" "); - } : function() { - might_need_space = true; - }; - - var indent = options.beautify ? function(half) { - if (need_newline_indented) print("\n"); - print(half ? current_indent.slice(0, -half_indent) : current_indent); - } : noop; - - var with_indent = options.beautify ? function(cont) { - var save_indentation = current_indent; - current_indent += full_indent; - cont(); - current_indent = save_indentation; - } : function(cont) { cont() }; - - var may_add_newline = options.max_line_len || options.preserve_line ? function() { - fix_line(); - line_end = output.length; - line_fixed = false; - } : noop; - - var newline = options.beautify ? function() { - print("\n"); - line_end = output.length; - } : may_add_newline; - - var semicolon = options.beautify ? function() { - print(";"); - } : function() { - might_need_semicolon = true; - }; - - function force_semicolon() { - if (might_need_semicolon) print(";"); - print(";"); - } - - function with_block(cont, end) { - print("{"); - newline(); - with_indent(cont); - add_mapping(end); - indent(); - print("}"); - } - - function with_parens(cont) { - print("("); - may_add_newline(); - cont(); - may_add_newline(); - print(")"); - } - - function with_square(cont) { - print("["); - may_add_newline(); - cont(); - may_add_newline(); - print("]"); - } - - function comma() { - may_add_newline(); - print(","); - may_add_newline(); - space(); - } - - function colon() { - print(":"); - space(); - } - - var add_mapping = mappings ? function(token, name) { - mapping_token = token; - mapping_name = name; - } : noop; - - function get() { - if (!line_fixed) fix_line(true); - return stored + output; - } - - function has_nlb() { - return /(^|\n) *$/.test(output); - } - - function pad_comment(token, force) { - if (need_newline_indented) return; - if (token.nlb && (force || !has_nlb())) { - need_newline_indented = true; - } else if (force) { - need_space = true; - } - } - - function print_comment(comment) { - var value = comment.value.replace(/[@#]__PURE__/g, " "); - if (/^\s*$/.test(value) && !/^\s*$/.test(comment.value)) return false; - if (/comment[134]/.test(comment.type)) { - print("//" + value); - need_newline_indented = true; - } else if (comment.type == "comment2") { - print("/*" + value + "*/"); - } - return true; - } - - function should_merge_comments(node, parent) { - if (parent instanceof AST_Binary) return parent.left === node; - if (parent.TYPE == "Call") return parent.expression === node; - if (parent instanceof AST_Conditional) return parent.condition === node; - if (parent instanceof AST_Dot) return parent.expression === node; - if (parent instanceof AST_Exit) return true; - if (parent instanceof AST_Sequence) return parent.expressions[0] === node; - if (parent instanceof AST_Sub) return parent.expression === node; - if (parent instanceof AST_UnaryPostfix) return true; - if (parent instanceof AST_Yield) return true; - } - - function prepend_comments(node) { - var self = this; - var scan; - if (node instanceof AST_Exit) { - scan = node.value; - } else if (node instanceof AST_Yield) { - scan = node.expression; - } - var comments = dump(node); - if (!comments) comments = []; - - if (scan) { - var tw = new TreeWalker(function(node) { - if (!should_merge_comments(node, tw.parent())) return true; - var before = dump(node); - if (before) comments = comments.concat(before); - }); - tw.push(node); - scan.walk(tw); - } - - if (current_line == 1 && current_col == 0) { - if (comments.length > 0 && options.shebang && comments[0].type == "comment5") { - print("#!" + comments.shift().value + "\n"); - indent(); - } - var preamble = options.preamble; - if (preamble) print(preamble.replace(/\r\n?|\u2028|\u2029|(^|\S)\s*$/g, "$1\n")); - } - - comments = comments.filter(comment_filter, node); - var printed = false; - comments.forEach(function(comment, index) { - pad_comment(comment, index); - if (print_comment(comment)) printed = true; - }); - if (printed) pad_comment(node.start, true); - - function dump(node) { - var token = node.start; - if (!token) { - if (!scan) return; - node.start = token = new AST_Token(); - } - var comments = token.comments_before; - if (!comments) { - if (!scan) return; - token.comments_before = comments = []; - } - if (comments._dumped === self) return; - comments._dumped = self; - return comments; - } - } - - function append_comments(node, tail) { - var self = this; - var token = node.end; - if (!token) return; - var comments = token[tail ? "comments_before" : "comments_after"]; - if (!comments || comments._dumped === self) return; - if (!(node instanceof AST_Statement || all(comments, function(c) { - return !/comment[134]/.test(c.type); - }))) return; - comments._dumped = self; - comments.filter(comment_filter, node).forEach(function(comment, index) { - pad_comment(comment, index || !tail); - print_comment(comment); - }); - } - - return { - get : get, - reset : reset, - indent : indent, - should_break : options.beautify && options.width ? function() { - return current_col >= options.width; - } : return_false, - has_parens : function() { return last.slice(-1) == "(" }, - newline : newline, - print : print, - space : space, - comma : comma, - colon : colon, - last : function() { return last }, - semicolon : semicolon, - force_semicolon : force_semicolon, - to_utf8 : to_utf8, - print_name : function(name) { print(to_utf8(name.toString(), true)) }, - print_string : options.inline_script ? function(str, quote) { - str = make_string(str, quote).replace(/<\x2f(script)([>\/\t\n\f\r ])/gi, "<\\/$1$2"); - print(str.replace(/\x3c!--/g, "\\x3c!--").replace(/--\x3e/g, "--\\x3e")); - } : function(str, quote) { - print(make_string(str, quote)); - }, - with_indent : with_indent, - with_block : with_block, - with_parens : with_parens, - with_square : with_square, - add_mapping : add_mapping, - option : function(opt) { return options[opt] }, - prepend_comments: options.comments || options.shebang ? prepend_comments : noop, - append_comments : options.comments ? append_comments : noop, - push_node : function(node) { stack.push(node) }, - pop_node : options.preserve_line ? function() { - var node = stack.pop(); - if (node.start && node.start.line > current_line) { - insert_newlines(node.start.line - current_line); - } - } : function() { - stack.pop(); - }, - parent : function(n) { - return stack[stack.length - 2 - (n || 0)]; - }, - }; -} - -/* -----[ code generators ]----- */ - -(function() { - - /* -----[ utils ]----- */ - - function DEFPRINT(nodetype, generator) { - nodetype.DEFMETHOD("_codegen", generator); - } - - var use_asm = false; - - AST_Node.DEFMETHOD("print", function(stream, force_parens) { - var self = this; - stream.push_node(self); - if (force_parens || self.needs_parens(stream)) { - stream.with_parens(doit); - } else { - doit(); - } - stream.pop_node(); - - function doit() { - stream.prepend_comments(self); - self.add_source_map(stream); - self._codegen(stream); - stream.append_comments(self); - } - }); - var readonly = OutputStream({ - inline_script: false, - shebang: false, - width: false, - }); - AST_Node.DEFMETHOD("print_to_string", function(options) { - if (options) { - var stream = OutputStream(options); - this.print(stream); - return stream.get(); - } - this.print(readonly); - return readonly.reset(); - }); - - /* -----[ PARENTHESES ]----- */ - - function PARENS(nodetype, func) { - nodetype.DEFMETHOD("needs_parens", func); - } - - PARENS(AST_Node, return_false); - - // a function expression needs parens around it when it's provably - // the first token to appear in a statement. - function needs_parens_function(output) { - var p = output.parent(); - if (!output.has_parens() && first_in_statement(output, false, true)) { - // export default function() {} - // export default (function foo() {}); - // export default (function() {})(foo); - // export default (function() {})`foo`; - // export default (function() {}) ? foo : bar; - return this.name || !(p instanceof AST_ExportDefault); - } - if (output.option("webkit") && p instanceof AST_PropAccess && p.expression === this) return true; - if (output.option("wrap_iife") && p instanceof AST_Call && p.expression === this) return true; - } - PARENS(AST_AsyncFunction, needs_parens_function); - PARENS(AST_AsyncGeneratorFunction, needs_parens_function); - PARENS(AST_ClassExpression, needs_parens_function); - PARENS(AST_Function, needs_parens_function); - PARENS(AST_GeneratorFunction, needs_parens_function); - - // same goes for an object literal, because otherwise it would be - // interpreted as a block of code. - function needs_parens_obj(output) { - return !output.has_parens() && first_in_statement(output, true); - } - PARENS(AST_Object, needs_parens_obj); - - function needs_parens_unary(output) { - var p = output.parent(); - // (-x) ** y - if (p instanceof AST_Binary) return p.operator == "**" && p.left === this; - // (await x)(y) - // new (await x) - if (p instanceof AST_Call) return p.expression === this; - // class extends (x++) {} - // class x extends (typeof y) {} - if (p instanceof AST_Class) return true; - // (x++)[y] - // (typeof x).y - // https://github.com/mishoo/UglifyJS/issues/115 - if (p instanceof AST_PropAccess) return p.expression === this; - // (~x)`foo` - if (p instanceof AST_Template) return p.tag === this; - } - PARENS(AST_Await, needs_parens_unary); - PARENS(AST_Unary, needs_parens_unary); - - PARENS(AST_Sequence, function(output) { - var p = output.parent(); - // [ 1, (2, 3), 4 ] ---> [ 1, 3, 4 ] - return p instanceof AST_Array - // () ---> (foo, bar) - || is_arrow(p) && p.value === this - // await (foo, bar) - || p instanceof AST_Await - // 1 + (2, 3) + 4 ---> 8 - || p instanceof AST_Binary - // new (foo, bar) or foo(1, (2, 3), 4) - || p instanceof AST_Call - // class extends (foo, bar) {} - // class foo extends (bar, baz) {} - || p instanceof AST_Class - // class { foo = (bar, baz) } - // class { [(foo, bar)]() {} } - || p instanceof AST_ClassProperty - // (false, true) ? (a = 10, b = 20) : (c = 30) - // ---> 20 (side effect, set a := 10 and b := 20) - || p instanceof AST_Conditional - // [ a = (1, 2) ] = [] ---> a == 2 - || p instanceof AST_DefaultValue - // { [(1, 2)]: foo } = bar - // { 1: (2, foo) } = bar - || p instanceof AST_DestructuredKeyVal - // export default (foo, bar) - || p instanceof AST_ExportDefault - // for (foo of (bar, baz)); - || p instanceof AST_ForOf - // { [(1, 2)]: 3 }[2] ---> 3 - // { foo: (1, 2) }.foo ---> 2 - || p instanceof AST_ObjectProperty - // (1, {foo:2}).foo or (1, {foo:2})["foo"] ---> 2 - || p instanceof AST_PropAccess && p.expression === this - // ...(foo, bar, baz) - || p instanceof AST_Spread - // (foo, bar)`baz` - || p instanceof AST_Template && p.tag === this - // !(foo, bar, baz) - || p instanceof AST_Unary - // var a = (1, 2), b = a + a; ---> b == 4 - || p instanceof AST_VarDef - // yield (foo, bar) - || p instanceof AST_Yield; - }); - - PARENS(AST_Binary, function(output) { - var p = output.parent(); - // await (foo && bar) - if (p instanceof AST_Await) return true; - // this deals with precedence: - // 3 * (2 + 1) - // 3 - (2 - 1) - // (1 ** 2) ** 3 - if (p instanceof AST_Binary) { - var po = p.operator, pp = PRECEDENCE[po]; - var so = this.operator, sp = PRECEDENCE[so]; - return pp > sp - || po == "??" && (so == "&&" || so == "||") - || (pp == sp && this === p[po == "**" ? "left" : "right"]); - } - // (foo && bar)() - if (p instanceof AST_Call) return p.expression === this; - // class extends (foo && bar) {} - // class foo extends (bar || null) {} - if (p instanceof AST_Class) return true; - // (foo && bar)["prop"], (foo && bar).prop - if (p instanceof AST_PropAccess) return p.expression === this; - // (foo && bar)`` - if (p instanceof AST_Template) return p.tag === this; - // typeof (foo && bar) - if (p instanceof AST_Unary) return true; - }); - - function need_chain_parens(node, parent) { - if (!node.terminal) return false; - if (!(parent instanceof AST_Call || parent instanceof AST_PropAccess)) return false; - return parent.expression === node; - } - - PARENS(AST_PropAccess, function(output) { - var node = this; - var p = output.parent(); - // i.e. new (foo().bar) - // - // if there's one call into this subtree, then we need - // parens around it too, otherwise the call will be - // interpreted as passing the arguments to the upper New - // expression. - if (p instanceof AST_New && p.expression === node && root_expr(node).TYPE == "Call") return true; - // (foo?.bar)() - // (foo?.bar).baz - // new (foo?.bar)() - return need_chain_parens(node, p); - }); - - PARENS(AST_Call, function(output) { - var node = this; - var p = output.parent(); - if (p instanceof AST_New) return p.expression === node; - // https://bugs.webkit.org/show_bug.cgi?id=123506 - if (output.option("webkit") - && node.expression instanceof AST_Function - && p instanceof AST_PropAccess - && p.expression === node) { - var g = output.parent(1); - if (g instanceof AST_Assign && g.left === p) return true; - } - // (foo?.())() - // (foo?.()).bar - // new (foo?.())() - return need_chain_parens(node, p); - }); - - PARENS(AST_New, function(output) { - if (need_constructor_parens(this, output)) return false; - var p = output.parent(); - // (new foo)(bar) - if (p instanceof AST_Call) return p.expression === this; - // (new Date).getTime(), (new Date)["getTime"]() - if (p instanceof AST_PropAccess) return true; - // (new foo)`bar` - if (p instanceof AST_Template) return p.tag === this; - }); - - PARENS(AST_Number, function(output) { - if (!output.option("galio")) return false; - // https://github.com/mishoo/UglifyJS/pull/1009 - var p = output.parent(); - return p instanceof AST_PropAccess && p.expression === this && /^0/.test(make_num(this.value)); - }); - - function needs_parens_assign_cond(self, output) { - var p = output.parent(); - // await (a = foo) - if (p instanceof AST_Await) return true; - // 1 + (a = 2) + 3 → 6, side effect setting a = 2 - if (p instanceof AST_Binary) return !(p instanceof AST_Assign); - // (a = func)() —or— new (a = Object)() - if (p instanceof AST_Call) return p.expression === self; - // class extends (a = foo) {} - // class foo extends (bar ? baz : moo) {} - if (p instanceof AST_Class) return true; - // (a = foo) ? bar : baz - if (p instanceof AST_Conditional) return p.condition === self; - // (a = foo)["prop"] —or— (a = foo).prop - if (p instanceof AST_PropAccess) return p.expression === self; - // (a = foo)`bar` - if (p instanceof AST_Template) return p.tag === self; - // !(a = false) → true - if (p instanceof AST_Unary) return true; - } - PARENS(AST_Arrow, function(output) { - return needs_parens_assign_cond(this, output); - }); - PARENS(AST_Assign, function(output) { - if (needs_parens_assign_cond(this, output)) return true; - // v8 parser bug ---> workaround - // f([1], [a] = []) ---> f([1], ([a] = [])) - if (output.option("v8")) return this.left instanceof AST_Destructured; - // ({ p: a } = o); - if (this.left instanceof AST_DestructuredObject) return needs_parens_obj(output); - }); - PARENS(AST_AsyncArrow, function(output) { - return needs_parens_assign_cond(this, output); - }); - PARENS(AST_Conditional, function(output) { - return needs_parens_assign_cond(this, output) - // https://github.com/mishoo/UglifyJS/issues/1144 - || output.option("extendscript") && output.parent() instanceof AST_Conditional; - }); - PARENS(AST_Yield, function(output) { - return needs_parens_assign_cond(this, output); - }); - - /* -----[ PRINTERS ]----- */ - - DEFPRINT(AST_Directive, function(output) { - var quote = this.quote; - var value = this.value; - switch (output.option("quote_style")) { - case 0: - case 2: - if (value.indexOf('"') == -1) quote = '"'; - break; - case 1: - if (value.indexOf("'") == -1) quote = "'"; - break; - } - output.print(quote + value + quote); - output.semicolon(); - }); - DEFPRINT(AST_Debugger, function(output) { - output.print("debugger"); - output.semicolon(); - }); - - /* -----[ statements ]----- */ - - function display_body(body, is_toplevel, output, allow_directives) { - var last = body.length - 1; - var in_directive = allow_directives; - var was_asm = use_asm; - body.forEach(function(stmt, i) { - if (in_directive) { - if (stmt instanceof AST_Directive) { - if (stmt.value == "use asm") use_asm = true; - } else if (!(stmt instanceof AST_EmptyStatement)) { - if (stmt instanceof AST_SimpleStatement && stmt.body instanceof AST_String) { - output.force_semicolon(); - } - in_directive = false; - } - } - if (stmt instanceof AST_EmptyStatement) return; - output.indent(); - stmt.print(output); - if (i == last && is_toplevel) return; - output.newline(); - if (is_toplevel) output.newline(); - }); - use_asm = was_asm; - } - - DEFPRINT(AST_Toplevel, function(output) { - display_body(this.body, true, output, true); - output.print(""); - }); - DEFPRINT(AST_LabeledStatement, function(output) { - this.label.print(output); - output.colon(); - this.body.print(output); - }); - DEFPRINT(AST_SimpleStatement, function(output) { - this.body.print(output); - output.semicolon(); - }); - function print_braced_empty(self, output) { - output.print("{"); - output.with_indent(function() { - output.append_comments(self, true); - }); - output.print("}"); - } - function print_braced(self, output, allow_directives) { - if (self.body.length > 0) { - output.with_block(function() { - display_body(self.body, false, output, allow_directives); - }, self.end); - } else print_braced_empty(self, output); - } - DEFPRINT(AST_BlockStatement, function(output) { - print_braced(this, output); - }); - DEFPRINT(AST_EmptyStatement, function(output) { - output.semicolon(); - }); - DEFPRINT(AST_Do, function(output) { - var self = this; - output.print("do"); - make_block(self.body, output); - output.space(); - output.print("while"); - output.space(); - output.with_parens(function() { - self.condition.print(output); - }); - output.semicolon(); - }); - DEFPRINT(AST_While, function(output) { - var self = this; - output.print("while"); - output.space(); - output.with_parens(function() { - self.condition.print(output); - }); - force_statement(self.body, output); - }); - DEFPRINT(AST_For, function(output) { - var self = this; - output.print("for"); - output.space(); - output.with_parens(function() { - if (self.init) { - if (self.init instanceof AST_Definitions) { - self.init.print(output); - } else { - parenthesize_for_no_in(self.init, output, true); - } - output.print(";"); - output.space(); - } else { - output.print(";"); - } - if (self.condition) { - self.condition.print(output); - output.print(";"); - output.space(); - } else { - output.print(";"); - } - if (self.step) { - self.step.print(output); - } - }); - force_statement(self.body, output); - }); - function print_for_enum(prefix, infix) { - return function(output) { - var self = this; - output.print(prefix); - output.space(); - output.with_parens(function() { - self.init.print(output); - output.space(); - output.print(infix); - output.space(); - self.object.print(output); - }); - force_statement(self.body, output); - }; - } - DEFPRINT(AST_ForAwaitOf, print_for_enum("for await", "of")); - DEFPRINT(AST_ForIn, print_for_enum("for", "in")); - DEFPRINT(AST_ForOf, print_for_enum("for", "of")); - DEFPRINT(AST_With, function(output) { - var self = this; - output.print("with"); - output.space(); - output.with_parens(function() { - self.expression.print(output); - }); - force_statement(self.body, output); - }); - DEFPRINT(AST_ExportDeclaration, function(output) { - output.print("export"); - output.space(); - this.body.print(output); - }); - DEFPRINT(AST_ExportDefault, function(output) { - output.print("export"); - output.space(); - output.print("default"); - output.space(); - var body = this.body; - body.print(output); - if (body instanceof AST_ClassExpression) { - if (!body.name) return; - } - if (body instanceof AST_DefClass) return; - if (body instanceof AST_LambdaDefinition) return; - if (body instanceof AST_LambdaExpression) { - if (!body.name && !is_arrow(body)) return; - } - output.semicolon(); - }); - function print_alias(alias, output) { - var value = alias.value; - if (value == "*" || is_identifier_string(value)) { - output.print_name(value); - } else { - output.print_string(value, alias.quote); - } - } - DEFPRINT(AST_ExportForeign, function(output) { - var self = this; - output.print("export"); - output.space(); - var len = self.keys.length; - if (len == 0) { - print_braced_empty(self, output); - } else if (self.keys[0].value == "*") { - print_entry(0); - } else output.with_block(function() { - output.indent(); - print_entry(0); - for (var i = 1; i < len; i++) { - output.print(","); - output.newline(); - output.indent(); - print_entry(i); - } - output.newline(); - }, self.end); - output.space(); - output.print("from"); - output.space(); - self.path.print(output); - output.semicolon(); - - function print_entry(index) { - var alias = self.aliases[index]; - var key = self.keys[index]; - print_alias(key, output); - if (alias.value != key.value) { - output.space(); - output.print("as"); - output.space(); - print_alias(alias, output); - } - } - }); - DEFPRINT(AST_ExportReferences, function(output) { - var self = this; - output.print("export"); - output.space(); - print_properties(self, output); - output.semicolon(); - }); - DEFPRINT(AST_Import, function(output) { - var self = this; - output.print("import"); - output.space(); - if (self.default) self.default.print(output); - if (self.all) { - if (self.default) output.comma(); - self.all.print(output); - } - if (self.properties) { - if (self.default) output.comma(); - print_properties(self, output); - } - if (self.all || self.default || self.properties) { - output.space(); - output.print("from"); - output.space(); - } - self.path.print(output); - output.semicolon(); - }); - - /* -----[ functions ]----- */ - function print_funargs(self, output) { - output.with_parens(function() { - self.argnames.forEach(function(arg, i) { - if (i) output.comma(); - arg.print(output); - }); - if (self.rest) { - if (self.argnames.length) output.comma(); - output.print("..."); - self.rest.print(output); - } - }); - } - function print_arrow(self, output) { - var argname = self.argnames.length == 1 && !self.rest && self.argnames[0]; - if (argname instanceof AST_SymbolFunarg && argname.name != "yield") { - argname.print(output); - } else { - print_funargs(self, output); - } - output.space(); - output.print("=>"); - output.space(); - if (self.value) { - self.value.print(output); - } else { - print_braced(self, output, true); - } - } - DEFPRINT(AST_Arrow, function(output) { - print_arrow(this, output); - }); - DEFPRINT(AST_AsyncArrow, function(output) { - output.print("async"); - output.space(); - print_arrow(this, output); - }); - function print_lambda(self, output) { - if (self.name) { - output.space(); - self.name.print(output); - } - print_funargs(self, output); - output.space(); - print_braced(self, output, true); - } - DEFPRINT(AST_Lambda, function(output) { - output.print("function"); - print_lambda(this, output); - }); - function print_async(output) { - output.print("async"); - output.space(); - output.print("function"); - print_lambda(this, output); - } - DEFPRINT(AST_AsyncDefun, print_async); - DEFPRINT(AST_AsyncFunction, print_async); - function print_async_generator(output) { - output.print("async"); - output.space(); - output.print("function*"); - print_lambda(this, output); - } - DEFPRINT(AST_AsyncGeneratorDefun, print_async_generator); - DEFPRINT(AST_AsyncGeneratorFunction, print_async_generator); - function print_generator(output) { - output.print("function*"); - print_lambda(this, output); - } - DEFPRINT(AST_GeneratorDefun, print_generator); - DEFPRINT(AST_GeneratorFunction, print_generator); - - /* -----[ classes ]----- */ - DEFPRINT(AST_Class, function(output) { - var self = this; - output.print("class"); - if (self.name) { - output.space(); - self.name.print(output); - } - if (self.extends) { - output.space(); - output.print("extends"); - output.space(); - self.extends.print(output); - } - output.space(); - print_properties(self, output, true); - }); - DEFPRINT(AST_ClassField, function(output) { - var self = this; - if (self.static) { - output.print("static"); - output.space(); - } - print_property_key(self, output); - if (self.value) { - output.space(); - output.print("="); - output.space(); - self.value.print(output); - } - output.semicolon(); - }); - DEFPRINT(AST_ClassGetter, print_accessor("get")); - DEFPRINT(AST_ClassSetter, print_accessor("set")); - function print_method(self, output) { - var fn = self.value; - if (is_async(fn)) { - output.print("async"); - output.space(); - } - if (is_generator(fn)) output.print("*"); - print_property_key(self, output); - print_lambda(self.value, output); - } - DEFPRINT(AST_ClassMethod, function(output) { - var self = this; - if (self.static) { - output.print("static"); - output.space(); - } - print_method(self, output); - }); - DEFPRINT(AST_ClassInit, function(output) { - output.print("static"); - output.space(); - print_braced(this.value, output); - }); - - /* -----[ jumps ]----- */ - function print_jump(kind, prop) { - return function(output) { - output.print(kind); - var target = this[prop]; - if (target) { - output.space(); - target.print(output); - } - output.semicolon(); - }; - } - DEFPRINT(AST_Return, print_jump("return", "value")); - DEFPRINT(AST_Throw, print_jump("throw", "value")); - DEFPRINT(AST_Break, print_jump("break", "label")); - DEFPRINT(AST_Continue, print_jump("continue", "label")); - - /* -----[ if ]----- */ - function make_then(self, output) { - var b = self.body; - if (output.option("braces") && !(b instanceof AST_Const || b instanceof AST_Let) - || output.option("ie") && b instanceof AST_Do) - return make_block(b, output); - // The squeezer replaces "block"-s that contain only a single - // statement with the statement itself; technically, the AST - // is correct, but this can create problems when we output an - // IF having an ELSE clause where the THEN clause ends in an - // IF *without* an ELSE block (then the outer ELSE would refer - // to the inner IF). This function checks for this case and - // adds the block braces if needed. - if (!b) return output.force_semicolon(); - while (true) { - if (b instanceof AST_If) { - if (!b.alternative) { - make_block(self.body, output); - return; - } - b = b.alternative; - } else if (b instanceof AST_StatementWithBody) { - b = b.body; - } else break; - } - force_statement(self.body, output); - } - DEFPRINT(AST_If, function(output) { - var self = this; - output.print("if"); - output.space(); - output.with_parens(function() { - self.condition.print(output); - }); - if (self.alternative) { - make_then(self, output); - output.space(); - output.print("else"); - if (self.alternative instanceof AST_If) { - output.space(); - self.alternative.print(output); - } else { - force_statement(self.alternative, output); - } - } else { - force_statement(self.body, output); - } - }); - - /* -----[ switch ]----- */ - DEFPRINT(AST_Switch, function(output) { - var self = this; - output.print("switch"); - output.space(); - output.with_parens(function() { - self.expression.print(output); - }); - output.space(); - var last = self.body.length - 1; - if (last < 0) print_braced_empty(self, output); - else output.with_block(function() { - self.body.forEach(function(branch, i) { - output.indent(true); - branch.print(output); - if (i < last && branch.body.length > 0) - output.newline(); - }); - }, self.end); - }); - function print_branch_body(self, output) { - output.newline(); - self.body.forEach(function(stmt) { - output.indent(); - stmt.print(output); - output.newline(); - }); - } - DEFPRINT(AST_Default, function(output) { - output.print("default:"); - print_branch_body(this, output); - }); - DEFPRINT(AST_Case, function(output) { - var self = this; - output.print("case"); - output.space(); - self.expression.print(output); - output.print(":"); - print_branch_body(self, output); - }); - - /* -----[ exceptions ]----- */ - DEFPRINT(AST_Try, function(output) { - var self = this; - output.print("try"); - output.space(); - print_braced(self, output); - if (self.bcatch) { - output.space(); - self.bcatch.print(output); - } - if (self.bfinally) { - output.space(); - self.bfinally.print(output); - } - }); - DEFPRINT(AST_Catch, function(output) { - var self = this; - output.print("catch"); - if (self.argname) { - output.space(); - output.with_parens(function() { - self.argname.print(output); - }); - } - output.space(); - print_braced(self, output); - }); - DEFPRINT(AST_Finally, function(output) { - output.print("finally"); - output.space(); - print_braced(this, output); - }); - - function print_definitions(type) { - return function(output) { - var self = this; - output.print(type); - output.space(); - self.definitions.forEach(function(def, i) { - if (i) output.comma(); - def.print(output); - }); - var p = output.parent(); - if (!(p instanceof AST_IterationStatement && p.init === self)) output.semicolon(); - }; - } - DEFPRINT(AST_Const, print_definitions("const")); - DEFPRINT(AST_Let, print_definitions("let")); - DEFPRINT(AST_Var, print_definitions("var")); - - function parenthesize_for_no_in(node, output, no_in) { - var parens = false; - // need to take some precautions here: - // https://github.com/mishoo/UglifyJS/issues/60 - if (no_in) node.walk(new TreeWalker(function(node) { - if (parens) return true; - if (node instanceof AST_Binary && node.operator == "in") return parens = true; - if (node instanceof AST_Scope && !(is_arrow(node) && node.value)) return true; - })); - node.print(output, parens); - } - - DEFPRINT(AST_VarDef, function(output) { - var self = this; - self.name.print(output); - if (self.value) { - output.space(); - output.print("="); - output.space(); - var p = output.parent(1); - var no_in = p instanceof AST_For || p instanceof AST_ForEnumeration; - parenthesize_for_no_in(self.value, output, no_in); - } - }); - - DEFPRINT(AST_DefaultValue, function(output) { - var self = this; - self.name.print(output); - output.space(); - output.print("="); - output.space(); - self.value.print(output); - }); - - /* -----[ other expressions ]----- */ - function print_annotation(self, output) { - if (!output.option("annotations")) return; - if (!self.pure) return; - var level = 0, parent = self, node; - do { - node = parent; - parent = output.parent(level++); - if (parent instanceof AST_Call && parent.expression === node) return; - } while (parent instanceof AST_PropAccess && parent.expression === node); - output.print("/*@__PURE__*/"); - } - function print_call_args(self, output) { - output.with_parens(function() { - self.args.forEach(function(expr, i) { - if (i) output.comma(); - expr.print(output); - }); - output.add_mapping(self.end); - }); - } - DEFPRINT(AST_Call, function(output) { - var self = this; - print_annotation(self, output); - self.expression.print(output); - if (self.optional) output.print("?."); - print_call_args(self, output); - }); - DEFPRINT(AST_New, function(output) { - var self = this; - print_annotation(self, output); - output.print("new"); - output.space(); - self.expression.print(output); - if (need_constructor_parens(self, output)) print_call_args(self, output); - }); - DEFPRINT(AST_Sequence, function(output) { - this.expressions.forEach(function(node, index) { - if (index > 0) { - output.comma(); - if (output.should_break()) { - output.newline(); - output.indent(); - } - } - node.print(output); - }); - }); - DEFPRINT(AST_Dot, function(output) { - var self = this; - var expr = self.expression; - expr.print(output); - var prop = self.property; - if (output.option("ie") && RESERVED_WORDS[prop] || self.quoted && output.option("keep_quoted_props")) { - if (self.optional) output.print("?."); - output.with_square(function() { - output.add_mapping(self.end); - output.print_string(prop); - }); - } else { - if (expr instanceof AST_Number && !/[ex.)]/i.test(output.last())) output.print("."); - output.print(self.optional ? "?." : "."); - // the name after dot would be mapped about here. - output.add_mapping(self.end); - output.print_name(prop); - } - }); - DEFPRINT(AST_Sub, function(output) { - var self = this; - self.expression.print(output); - if (self.optional) output.print("?."); - output.with_square(function() { - self.property.print(output); - }); - }); - DEFPRINT(AST_Spread, function(output) { - output.print("..."); - this.expression.print(output); - }); - DEFPRINT(AST_UnaryPrefix, function(output) { - var op = this.operator; - var exp = this.expression; - output.print(op); - if (/^[a-z]/i.test(op) - || (/[+-]$/.test(op) - && exp instanceof AST_UnaryPrefix - && /^[+-]/.test(exp.operator))) { - output.space(); - } - exp.print(output); - }); - DEFPRINT(AST_UnaryPostfix, function(output) { - var self = this; - self.expression.print(output); - output.add_mapping(self.end); - output.print(self.operator); - }); - DEFPRINT(AST_Binary, function(output) { - var self = this; - self.left.print(output); - output.space(); - output.print(self.operator); - output.space(); - self.right.print(output); - }); - DEFPRINT(AST_Conditional, function(output) { - var self = this; - self.condition.print(output); - output.space(); - output.print("?"); - output.space(); - self.consequent.print(output); - output.space(); - output.colon(); - self.alternative.print(output); - }); - DEFPRINT(AST_Await, function(output) { - output.print("await"); - output.space(); - this.expression.print(output); - }); - DEFPRINT(AST_Yield, function(output) { - output.print(this.nested ? "yield*" : "yield"); - if (this.expression) { - output.space(); - this.expression.print(output); - } - }); - - /* -----[ literals ]----- */ - DEFPRINT(AST_Array, function(output) { - var a = this.elements, len = a.length; - output.with_square(len > 0 ? function() { - output.space(); - a.forEach(function(exp, i) { - if (i) output.comma(); - exp.print(output); - // If the final element is a hole, we need to make sure it - // doesn't look like a trailing comma, by inserting an actual - // trailing comma. - if (i === len - 1 && exp instanceof AST_Hole) - output.comma(); - }); - output.space(); - } : noop); - }); - DEFPRINT(AST_DestructuredArray, function(output) { - var a = this.elements, len = a.length, rest = this.rest; - output.with_square(len || rest ? function() { - output.space(); - a.forEach(function(exp, i) { - if (i) output.comma(); - exp.print(output); - }); - if (rest) { - if (len) output.comma(); - output.print("..."); - rest.print(output); - } else if (a[len - 1] instanceof AST_Hole) { - // If the final element is a hole, we need to make sure it - // doesn't look like a trailing comma, by inserting an actual - // trailing comma. - output.comma(); - } - output.space(); - } : noop); - }); - DEFPRINT(AST_DestructuredKeyVal, function(output) { - var self = this; - var key = print_property_key(self, output); - var value = self.value; - if (key) { - if (value instanceof AST_DefaultValue) { - if (value.name instanceof AST_Symbol && key == get_symbol_name(value.name)) { - output.space(); - output.print("="); - output.space(); - value.value.print(output); - return; - } - } else if (value instanceof AST_Symbol) { - if (key == get_symbol_name(value)) return; - } - } - output.colon(); - value.print(output); - }); - DEFPRINT(AST_DestructuredObject, function(output) { - var self = this; - var props = self.properties, len = props.length, rest = self.rest; - if (len || rest) output.with_block(function() { - props.forEach(function(prop, i) { - if (i) { - output.print(","); - output.newline(); - } - output.indent(); - prop.print(output); - }); - if (rest) { - if (len) { - output.print(","); - output.newline(); - } - output.indent(); - output.print("..."); - rest.print(output); - } - output.newline(); - }, self.end); - else print_braced_empty(self, output); - }); - function print_properties(self, output, no_comma) { - var props = self.properties; - if (props.length > 0) output.with_block(function() { - props.forEach(function(prop, i) { - if (i) { - if (!no_comma) output.print(","); - output.newline(); - } - output.indent(); - prop.print(output); - }); - output.newline(); - }, self.end); - else print_braced_empty(self, output); - } - DEFPRINT(AST_Object, function(output) { - print_properties(this, output); - }); - - function print_property_key(self, output) { - var key = self.key; - if (key instanceof AST_Node) return output.with_square(function() { - key.print(output); - }); - var quote = self.start && self.start.quote; - if (output.option("quote_keys") || quote && output.option("keep_quoted_props")) { - output.print_string(key, quote); - } else if ("" + +key == key && key >= 0) { - output.print(make_num(key)); - } else if (self.private) { - output.print_name(key); - } else if (RESERVED_WORDS[key] ? !output.option("ie") : is_identifier_string(key)) { - output.print_name(key); - return key; - } else { - output.print_string(key, quote); - } - } - DEFPRINT(AST_ObjectKeyVal, function(output) { - var self = this; - print_property_key(self, output); - output.colon(); - self.value.print(output); - }); - DEFPRINT(AST_ObjectMethod, function(output) { - print_method(this, output); - }); - function print_accessor(type) { - return function(output) { - var self = this; - if (self.static) { - output.print("static"); - output.space(); - } - output.print(type); - output.space(); - print_property_key(self, output); - print_lambda(self.value, output); - }; - } - DEFPRINT(AST_ObjectGetter, print_accessor("get")); - DEFPRINT(AST_ObjectSetter, print_accessor("set")); - function get_symbol_name(sym) { - var def = sym.definition(); - return def && def.mangled_name || sym.name; - } - DEFPRINT(AST_Symbol, function(output) { - output.print_name(get_symbol_name(this)); - }); - DEFPRINT(AST_SymbolExport, function(output) { - var self = this; - var name = get_symbol_name(self); - output.print_name(name); - var alias = self.alias; - if (alias.value != name) { - output.space(); - output.print("as"); - output.space(); - print_alias(alias, output); - } - }); - DEFPRINT(AST_SymbolImport, function(output) { - var self = this; - var name = get_symbol_name(self); - var key = self.key; - if (key.value && key.value != name) { - print_alias(key, output); - output.space(); - output.print("as"); - output.space(); - } - output.print_name(name); - }); - DEFPRINT(AST_Hole, noop); - DEFPRINT(AST_Template, function(output) { - var self = this; - if (self.tag) self.tag.print(output); - output.print("`"); - for (var i = 0; i < self.expressions.length; i++) { - output.print(self.strings[i]); - output.print("${"); - self.expressions[i].print(output); - output.print("}"); - } - output.print(self.strings[i]); - output.print("`"); - }); - DEFPRINT(AST_Constant, function(output) { - output.print("" + this.value); - }); - DEFPRINT(AST_String, function(output) { - output.print_string(this.value, this.quote); - }); - DEFPRINT(AST_Number, function(output) { - var start = this.start; - if (use_asm && start && start.raw != null) { - output.print(start.raw); - } else { - output.print(make_num(this.value)); - } - }); - - DEFPRINT(AST_RegExp, function(output) { - var regexp = this.value; - var str = regexp.toString(); - var end = str.lastIndexOf("/"); - if (regexp.raw_source) { - str = "/" + regexp.raw_source + str.slice(end); - } else if (end == 1) { - str = "/(?:)" + str.slice(end); - } else if (str.indexOf("/", 1) < end) { - str = "/" + str.slice(1, end).replace(/\\\\|[^/]?\//g, function(match) { - return match[0] == "\\" ? match : match.slice(0, -1) + "\\/"; - }) + str.slice(end); - } - output.print(output.to_utf8(str).replace(/\\(?:\0(?![0-9])|[^\0])/g, function(match) { - switch (match[1]) { - case "\n": return "\\n"; - case "\r": return "\\r"; - case "\t": return "\t"; - case "\b": return "\b"; - case "\f": return "\f"; - case "\0": return "\0"; - case "\x0B": return "\v"; - case "\u2028": return "\\u2028"; - case "\u2029": return "\\u2029"; - default: return match; - } - }).replace(/[\n\r\u2028\u2029]/g, function(c) { - switch (c) { - case "\n": return "\\n"; - case "\r": return "\\r"; - case "\u2028": return "\\u2028"; - case "\u2029": return "\\u2029"; - } - })); - }); - - function force_statement(stat, output) { - if (output.option("braces") && !(stat instanceof AST_Const || stat instanceof AST_Let)) { - make_block(stat, output); - } else if (stat instanceof AST_EmptyStatement) { - output.force_semicolon(); - } else { - output.space(); - stat.print(output); - } - } - - // self should be AST_New. decide if we want to show parens or not. - function need_constructor_parens(self, output) { - // Always print parentheses with arguments - if (self.args.length > 0) return true; - - return output.option("beautify"); - } - - function best_of(a) { - var best = a[0], len = best.length; - for (var i = 1; i < a.length; ++i) { - if (a[i].length < len) { - best = a[i]; - len = best.length; - } - } - return best; - } - - function make_num(num) { - var str = num.toString(10).replace(/^0\./, ".").replace("e+", "e"); - var candidates = [ str ]; - if (Math.floor(num) === num) { - if (num < 0) { - candidates.push("-0x" + (-num).toString(16).toLowerCase()); - } else { - candidates.push("0x" + num.toString(16).toLowerCase()); - } - } - var match, len, digits; - if (match = /^\.0+/.exec(str)) { - len = match[0].length; - digits = str.slice(len); - candidates.push(digits + "e-" + (digits.length + len - 1)); - } else if (match = /[^0]0+$/.exec(str)) { - len = match[0].length - 1; - candidates.push(str.slice(0, -len) + "e" + len); - } else if (match = /^(\d)\.(\d+)e(-?\d+)$/.exec(str)) { - candidates.push(match[1] + match[2] + "e" + (match[3] - match[2].length)); - } - return best_of(candidates); - } - - function make_block(stmt, output) { - output.space(); - if (stmt instanceof AST_EmptyStatement) { - print_braced_empty(stmt, output); - } else if (stmt instanceof AST_BlockStatement) { - stmt.print(output); - } else output.with_block(function() { - output.indent(); - stmt.print(output); - output.newline(); - }, stmt.end); - } - - /* -----[ source map generators ]----- */ - - function DEFMAP(nodetype, generator) { - nodetype.forEach(function(nodetype) { - nodetype.DEFMETHOD("add_source_map", generator); - }); - } - - DEFMAP([ - // We could easily add info for ALL nodes, but it seems to me that - // would be quite wasteful, hence this noop in the base class. - AST_Node, - // since the label symbol will mark it - AST_LabeledStatement, - ], noop); - - // XXX: I'm not exactly sure if we need it for all of these nodes, - // or if we should add even more. - DEFMAP([ - AST_Array, - AST_Await, - AST_BlockStatement, - AST_Catch, - AST_Constant, - AST_Debugger, - AST_Definitions, - AST_Destructured, - AST_Directive, - AST_Finally, - AST_Jump, - AST_Lambda, - AST_New, - AST_Object, - AST_Spread, - AST_StatementWithBody, - AST_Symbol, - AST_Switch, - AST_SwitchBranch, - AST_Try, - AST_UnaryPrefix, - AST_Yield, - ], function(output) { - output.add_mapping(this.start); - }); - - DEFMAP([ - AST_ClassProperty, - AST_DestructuredKeyVal, - AST_ObjectProperty, - ], function(output) { - if (typeof this.key == "string") output.add_mapping(this.start, this.key); - }); -})(); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/uglify-js/lib/parse.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/uglify-js/lib/parse.js deleted file mode 100644 index 8fb7f383..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/uglify-js/lib/parse.js +++ /dev/null @@ -1,2585 +0,0 @@ -/*********************************************************************** - - A JavaScript tokenizer / parser / beautifier / compressor. - https://github.com/mishoo/UglifyJS - - -------------------------------- (C) --------------------------------- - - Author: Mihai Bazon - - http://mihai.bazon.net/blog - - Distributed under the BSD license: - - Copyright 2012 (c) Mihai Bazon - Parser based on parse-js (http://marijn.haverbeke.nl/parse-js/). - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - * Redistributions of source code must retain the above - copyright notice, this list of conditions and the following - disclaimer. - - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials - provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY - EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR - TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF - THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - SUCH DAMAGE. - - ***********************************************************************/ - -"use strict"; - -var KEYWORDS = "break case catch class const continue debugger default delete do else extends finally for function if in instanceof new return switch throw try typeof var void while with"; -var KEYWORDS_ATOM = "false null true"; -var RESERVED_WORDS = [ - "abstract async await boolean byte char double enum export final float goto implements import int interface let long native package private protected public short static super synchronized this throws transient volatile yield", - KEYWORDS_ATOM, - KEYWORDS, -].join(" "); -var KEYWORDS_BEFORE_EXPRESSION = "return new delete throw else case"; - -KEYWORDS = makePredicate(KEYWORDS); -RESERVED_WORDS = makePredicate(RESERVED_WORDS); -KEYWORDS_BEFORE_EXPRESSION = makePredicate(KEYWORDS_BEFORE_EXPRESSION); -KEYWORDS_ATOM = makePredicate(KEYWORDS_ATOM); - -var RE_BIN_NUMBER = /^0b([01]+)$/i; -var RE_HEX_NUMBER = /^0x([0-9a-f]+)$/i; -var RE_OCT_NUMBER = /^0o?([0-7]+)$/i; - -var OPERATORS = makePredicate([ - "in", - "instanceof", - "typeof", - "new", - "void", - "delete", - "++", - "--", - "+", - "-", - "!", - "~", - "&", - "|", - "^", - "*", - "/", - "%", - "**", - ">>", - "<<", - ">>>", - "<", - ">", - "<=", - ">=", - "==", - "===", - "!=", - "!==", - "?", - "=", - "+=", - "-=", - "/=", - "*=", - "%=", - "**=", - ">>=", - "<<=", - ">>>=", - "&=", - "|=", - "^=", - "&&", - "||", - "??", - "&&=", - "||=", - "??=", -]); - -var NEWLINE_CHARS = "\n\r\u2028\u2029"; -var OPERATOR_CHARS = "+-*&%=<>!?|~^"; -var PUNC_OPENERS = "[{("; -var PUNC_SEPARATORS = ",;:"; -var PUNC_CLOSERS = ")}]"; -var PUNC_AFTER_EXPRESSION = PUNC_SEPARATORS + PUNC_CLOSERS; -var PUNC_BEFORE_EXPRESSION = PUNC_OPENERS + PUNC_SEPARATORS; -var PUNC_CHARS = PUNC_BEFORE_EXPRESSION + "`" + PUNC_CLOSERS; -var WHITESPACE_CHARS = NEWLINE_CHARS + " \u00a0\t\f\u000b\u200b\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\uFEFF"; -var NON_IDENTIFIER_CHARS = makePredicate(characters("./'\"#" + OPERATOR_CHARS + PUNC_CHARS + WHITESPACE_CHARS)); - -NEWLINE_CHARS = makePredicate(characters(NEWLINE_CHARS)); -OPERATOR_CHARS = makePredicate(characters(OPERATOR_CHARS)); -PUNC_AFTER_EXPRESSION = makePredicate(characters(PUNC_AFTER_EXPRESSION)); -PUNC_BEFORE_EXPRESSION = makePredicate(characters(PUNC_BEFORE_EXPRESSION)); -PUNC_CHARS = makePredicate(characters(PUNC_CHARS)); -WHITESPACE_CHARS = makePredicate(characters(WHITESPACE_CHARS)); - -/* -----[ Tokenizer ]----- */ - -function is_surrogate_pair_head(code) { - return code >= 0xd800 && code <= 0xdbff; -} - -function is_surrogate_pair_tail(code) { - return code >= 0xdc00 && code <= 0xdfff; -} - -function is_digit(code) { - return code >= 48 && code <= 57; -} - -function is_identifier_char(ch) { - return !NON_IDENTIFIER_CHARS[ch]; -} - -function is_identifier_string(str) { - return /^[a-z_$][a-z0-9_$]*$/i.test(str); -} - -function decode_escape_sequence(seq) { - switch (seq[0]) { - case "b": return "\b"; - case "f": return "\f"; - case "n": return "\n"; - case "r": return "\r"; - case "t": return "\t"; - case "u": - var code; - if (seq[1] == "{" && seq.slice(-1) == "}") { - code = seq.slice(2, -1); - } else if (seq.length == 5) { - code = seq.slice(1); - } else { - return; - } - var num = parseInt(code, 16); - if (num < 0 || isNaN(num)) return; - if (num < 0x10000) return String.fromCharCode(num); - if (num > 0x10ffff) return; - return String.fromCharCode((num >> 10) + 0xd7c0) + String.fromCharCode((num & 0x03ff) + 0xdc00); - case "v": return "\u000b"; - case "x": - if (seq.length != 3) return; - var num = parseInt(seq.slice(1), 16); - if (num < 0 || isNaN(num)) return; - return String.fromCharCode(num); - case "\r": - case "\n": - return ""; - default: - if (seq == "0") return "\0"; - if (seq[0] >= "0" && seq[0] <= "9") return; - return seq; - } -} - -function parse_js_number(num) { - var match; - if (match = RE_BIN_NUMBER.exec(num)) return parseInt(match[1], 2); - if (match = RE_HEX_NUMBER.exec(num)) return parseInt(match[1], 16); - if (match = RE_OCT_NUMBER.exec(num)) return parseInt(match[1], 8); - var val = parseFloat(num); - if (val == num) return val; -} - -function JS_Parse_Error(message, filename, line, col, pos) { - this.message = message; - this.filename = filename; - this.line = line; - this.col = col; - this.pos = pos; -} -JS_Parse_Error.prototype = Object.create(Error.prototype); -JS_Parse_Error.prototype.constructor = JS_Parse_Error; -JS_Parse_Error.prototype.name = "SyntaxError"; -configure_error_stack(JS_Parse_Error); - -function js_error(message, filename, line, col, pos) { - throw new JS_Parse_Error(message, filename, line, col, pos); -} - -function is_token(token, type, val) { - return token.type == type && (val == null || token.value == val); -} - -var EX_EOF = {}; - -function tokenizer($TEXT, filename, html5_comments, shebang) { - - var S = { - text : $TEXT, - filename : filename, - pos : 0, - tokpos : 0, - line : 1, - tokline : 0, - col : 0, - tokcol : 0, - newline_before : false, - regex_allowed : false, - comments_before : [], - directives : Object.create(null), - read_template : with_eof_error("Unterminated template literal", function(strings) { - var s = ""; - for (;;) { - var ch = read(); - switch (ch) { - case "\\": - ch += read(); - break; - case "`": - strings.push(s); - return; - case "$": - if (peek() == "{") { - next(); - strings.push(s); - S.regex_allowed = true; - return true; - } - } - s += ch; - } - - function read() { - var ch = next(true, true); - return ch == "\r" ? "\n" : ch; - } - }), - }; - var prev_was_dot = false; - - function peek() { - return S.text.charAt(S.pos); - } - - function next(signal_eof, in_string) { - var ch = S.text.charAt(S.pos++); - if (signal_eof && !ch) - throw EX_EOF; - if (NEWLINE_CHARS[ch]) { - S.col = 0; - S.line++; - if (!in_string) S.newline_before = true; - if (ch == "\r" && peek() == "\n") { - // treat `\r\n` as `\n` - S.pos++; - ch = "\n"; - } - } else { - S.col++; - } - return ch; - } - - function forward(i) { - while (i-- > 0) next(); - } - - function looking_at(str) { - return S.text.substr(S.pos, str.length) == str; - } - - function find_eol() { - var text = S.text; - for (var i = S.pos; i < S.text.length; ++i) { - if (NEWLINE_CHARS[text[i]]) return i; - } - return -1; - } - - function find(what, signal_eof) { - var pos = S.text.indexOf(what, S.pos); - if (signal_eof && pos == -1) throw EX_EOF; - return pos; - } - - function start_token() { - S.tokline = S.line; - S.tokcol = S.col; - S.tokpos = S.pos; - } - - function token(type, value, is_comment) { - S.regex_allowed = type == "operator" && !UNARY_POSTFIX[value] - || type == "keyword" && KEYWORDS_BEFORE_EXPRESSION[value] - || type == "punc" && PUNC_BEFORE_EXPRESSION[value]; - if (type == "punc" && value == ".") prev_was_dot = true; - else if (!is_comment) prev_was_dot = false; - var ret = { - type : type, - value : value, - line : S.tokline, - col : S.tokcol, - pos : S.tokpos, - endline : S.line, - endcol : S.col, - endpos : S.pos, - nlb : S.newline_before, - file : filename - }; - if (/^(?:num|string|regexp)$/i.test(type)) { - ret.raw = $TEXT.substring(ret.pos, ret.endpos); - } - if (!is_comment) { - ret.comments_before = S.comments_before; - ret.comments_after = S.comments_before = []; - } - S.newline_before = false; - return new AST_Token(ret); - } - - function skip_whitespace() { - while (WHITESPACE_CHARS[peek()]) - next(); - } - - function read_while(pred) { - var ret = "", ch; - while ((ch = peek()) && pred(ch, ret)) ret += next(); - return ret; - } - - function parse_error(err) { - js_error(err, filename, S.tokline, S.tokcol, S.tokpos); - } - - function is_octal(num) { - return /^0[0-7_]+$/.test(num); - } - - function read_num(prefix) { - var has_e = false, after_e = false, has_x = false, has_dot = prefix == "."; - var num = read_while(function(ch, str) { - switch (ch) { - case "x": case "X": - return has_x ? false : (has_x = true); - case "e": case "E": - return has_x ? true : has_e ? false : (has_e = after_e = true); - case "+": case "-": - return after_e; - case (after_e = false, "."): - return has_dot || has_e || has_x || is_octal(str) ? false : (has_dot = true); - } - return /[_0-9a-dfo]/i.test(ch); - }); - if (prefix) num = prefix + num; - if (is_octal(num)) { - if (next_token.has_directive("use strict")) parse_error("Legacy octal literals are not allowed in strict mode"); - } else { - num = num.replace(has_x ? /([1-9a-f]|.0)_(?=[0-9a-f])/gi : /([1-9]|.0)_(?=[0-9])/gi, "$1"); - } - var valid = parse_js_number(num); - if (isNaN(valid)) parse_error("Invalid syntax: " + num); - if (has_dot || has_e || peek() != "n") return token("num", valid); - return token("bigint", num.toLowerCase() + next()); - } - - function read_escaped_char(in_string) { - var seq = next(true, in_string); - if (seq >= "0" && seq <= "7") return read_octal_escape_sequence(seq); - if (seq == "u") { - var ch = next(true, in_string); - seq += ch; - if (ch != "{") { - seq += next(true, in_string) + next(true, in_string) + next(true, in_string); - } else do { - ch = next(true, in_string); - seq += ch; - } while (ch != "}"); - } else if (seq == "x") { - seq += next(true, in_string) + next(true, in_string); - } - var str = decode_escape_sequence(seq); - if (typeof str != "string") parse_error("Invalid escape sequence: \\" + seq); - return str; - } - - function read_octal_escape_sequence(ch) { - // Read - var p = peek(); - if (p >= "0" && p <= "7") { - ch += next(true); - if (ch[0] <= "3" && (p = peek()) >= "0" && p <= "7") - ch += next(true); - } - - // Parse - if (ch === "0") return "\0"; - if (ch.length > 0 && next_token.has_directive("use strict")) - parse_error("Legacy octal escape sequences are not allowed in strict mode"); - return String.fromCharCode(parseInt(ch, 8)); - } - - var read_string = with_eof_error("Unterminated string constant", function(quote_char) { - var quote = next(), ret = ""; - for (;;) { - var ch = next(true, true); - if (ch == "\\") ch = read_escaped_char(true); - else if (NEWLINE_CHARS[ch]) parse_error("Unterminated string constant"); - else if (ch == quote) break; - ret += ch; - } - var tok = token("string", ret); - tok.quote = quote_char; - return tok; - }); - - function skip_line_comment(type) { - var regex_allowed = S.regex_allowed; - var i = find_eol(), ret; - if (i == -1) { - ret = S.text.substr(S.pos); - S.pos = S.text.length; - } else { - ret = S.text.substring(S.pos, i); - S.pos = i; - } - S.col = S.tokcol + (S.pos - S.tokpos); - S.comments_before.push(token(type, ret, true)); - S.regex_allowed = regex_allowed; - return next_token; - } - - var skip_multiline_comment = with_eof_error("Unterminated multiline comment", function() { - var regex_allowed = S.regex_allowed; - var i = find("*/", true); - var text = S.text.substring(S.pos, i).replace(/\r\n|\r|\u2028|\u2029/g, "\n"); - // update stream position - forward(text.length /* doesn't count \r\n as 2 char while S.pos - i does */ + 2); - S.comments_before.push(token("comment2", text, true)); - S.regex_allowed = regex_allowed; - return next_token; - }); - - function read_name() { - var backslash = false, ch, escaped = false, name = peek() == "#" ? next() : ""; - while (ch = peek()) { - if (!backslash) { - if (ch == "\\") escaped = backslash = true, next(); - else if (is_identifier_char(ch)) name += next(); - else break; - } else { - if (ch != "u") parse_error("Expecting UnicodeEscapeSequence -- uXXXX"); - ch = read_escaped_char(); - if (!is_identifier_char(ch)) parse_error("Unicode char: " + ch.charCodeAt(0) + " is not valid in identifier"); - name += ch; - backslash = false; - } - } - if (KEYWORDS[name] && escaped) { - var hex = name.charCodeAt(0).toString(16).toUpperCase(); - name = "\\u" + "0000".substr(hex.length) + hex + name.slice(1); - } - return name; - } - - var read_regexp = with_eof_error("Unterminated regular expression", function(source) { - var prev_backslash = false, ch, in_class = false; - while ((ch = next(true))) if (NEWLINE_CHARS[ch]) { - parse_error("Unexpected line terminator"); - } else if (prev_backslash) { - source += "\\" + ch; - prev_backslash = false; - } else if (ch == "[") { - in_class = true; - source += ch; - } else if (ch == "]" && in_class) { - in_class = false; - source += ch; - } else if (ch == "/" && !in_class) { - break; - } else if (ch == "\\") { - prev_backslash = true; - } else { - source += ch; - } - var mods = read_name(); - try { - var regexp = new RegExp(source, mods); - regexp.raw_source = source; - return token("regexp", regexp); - } catch (e) { - parse_error(e.message); - } - }); - - function read_operator(prefix) { - function grow(op) { - if (!peek()) return op; - var bigger = op + peek(); - if (OPERATORS[bigger]) { - next(); - return grow(bigger); - } else { - return op; - } - } - return token("operator", grow(prefix || next())); - } - - function handle_slash() { - next(); - switch (peek()) { - case "/": - next(); - return skip_line_comment("comment1"); - case "*": - next(); - return skip_multiline_comment(); - } - return S.regex_allowed ? read_regexp("") : read_operator("/"); - } - - function handle_dot() { - next(); - if (looking_at("..")) return token("operator", "." + next() + next()); - return is_digit(peek().charCodeAt(0)) ? read_num(".") : token("punc", "."); - } - - function read_word() { - var word = read_name(); - if (prev_was_dot) return token("name", word); - return KEYWORDS_ATOM[word] ? token("atom", word) - : !KEYWORDS[word] ? token("name", word) - : OPERATORS[word] ? token("operator", word) - : token("keyword", word); - } - - function with_eof_error(eof_error, cont) { - return function(x) { - try { - return cont(x); - } catch (ex) { - if (ex === EX_EOF) parse_error(eof_error); - else throw ex; - } - }; - } - - function next_token(force_regexp) { - if (force_regexp != null) - return read_regexp(force_regexp); - if (shebang && S.pos == 0 && looking_at("#!")) { - start_token(); - forward(2); - skip_line_comment("comment5"); - } - for (;;) { - skip_whitespace(); - start_token(); - if (html5_comments) { - if (looking_at("") && S.newline_before) { - forward(3); - skip_line_comment("comment4"); - continue; - } - } - var ch = peek(); - if (!ch) return token("eof"); - var code = ch.charCodeAt(0); - switch (code) { - case 34: case 39: return read_string(ch); - case 46: return handle_dot(); - case 47: - var tok = handle_slash(); - if (tok === next_token) continue; - return tok; - } - if (is_digit(code)) return read_num(); - if (PUNC_CHARS[ch]) return token("punc", next()); - if (looking_at("=>")) return token("punc", next() + next()); - if (OPERATOR_CHARS[ch]) return read_operator(); - if (code == 35 || code == 92 || !NON_IDENTIFIER_CHARS[ch]) return read_word(); - break; - } - parse_error("Unexpected character '" + ch + "'"); - } - - next_token.context = function(nc) { - if (nc) S = nc; - return S; - }; - - next_token.add_directive = function(directive) { - S.directives[directive] = true; - } - - next_token.push_directives_stack = function() { - S.directives = Object.create(S.directives); - } - - next_token.pop_directives_stack = function() { - S.directives = Object.getPrototypeOf(S.directives); - } - - next_token.has_directive = function(directive) { - return !!S.directives[directive]; - } - - return next_token; -} - -/* -----[ Parser (constants) ]----- */ - -var UNARY_PREFIX = makePredicate("typeof void delete -- ++ ! ~ - +"); - -var UNARY_POSTFIX = makePredicate("-- ++"); - -var ASSIGNMENT = makePredicate("= += -= /= *= %= **= >>= <<= >>>= &= |= ^= &&= ||= ??="); - -var PRECEDENCE = function(a, ret) { - for (var i = 0; i < a.length;) { - var b = a[i++]; - for (var j = 0; j < b.length; j++) { - ret[b[j]] = i; - } - } - return ret; -}([ - ["??"], - ["||"], - ["&&"], - ["|"], - ["^"], - ["&"], - ["==", "===", "!=", "!=="], - ["<", ">", "<=", ">=", "in", "instanceof"], - [">>", "<<", ">>>"], - ["+", "-"], - ["*", "/", "%"], - ["**"], -], {}); - -var ATOMIC_START_TOKEN = makePredicate("atom bigint num regexp string"); - -/* -----[ Parser ]----- */ - -function parse($TEXT, options) { - options = defaults(options, { - bare_returns : false, - expression : false, - filename : null, - html5_comments : true, - module : false, - shebang : true, - strict : false, - toplevel : null, - }, true); - - var S = { - input : typeof $TEXT == "string" - ? tokenizer($TEXT, options.filename, options.html5_comments, options.shebang) - : $TEXT, - in_async : false, - in_directives : true, - in_funarg : -1, - in_function : 0, - in_generator : false, - in_loop : 0, - labels : [], - peeked : null, - prev : null, - token : null, - }; - - S.token = next(); - - function is(type, value) { - return is_token(S.token, type, value); - } - - function peek() { - return S.peeked || (S.peeked = S.input()); - } - - function next() { - S.prev = S.token; - if (S.peeked) { - S.token = S.peeked; - S.peeked = null; - } else { - S.token = S.input(); - } - S.in_directives = S.in_directives && ( - S.token.type == "string" || is("punc", ";") - ); - return S.token; - } - - function prev() { - return S.prev; - } - - function croak(msg, line, col, pos) { - var ctx = S.input.context(); - js_error(msg, - ctx.filename, - line != null ? line : ctx.tokline, - col != null ? col : ctx.tokcol, - pos != null ? pos : ctx.tokpos); - } - - function token_error(token, msg) { - croak(msg, token.line, token.col); - } - - function token_to_string(type, value) { - return type + (value === undefined ? "" : " «" + value + "»"); - } - - function unexpected(token) { - if (token == null) token = S.token; - token_error(token, "Unexpected token: " + token_to_string(token.type, token.value)); - } - - function expect_token(type, val) { - if (is(type, val)) return next(); - token_error(S.token, "Unexpected token: " + token_to_string(S.token.type, S.token.value) + ", expected: " + token_to_string(type, val)); - } - - function expect(punc) { - return expect_token("punc", punc); - } - - function has_newline_before(token) { - return token.nlb || !all(token.comments_before, function(comment) { - return !comment.nlb; - }); - } - - function can_insert_semicolon() { - return !options.strict - && (is("eof") || is("punc", "}") || has_newline_before(S.token)); - } - - function semicolon(optional) { - if (is("punc", ";")) next(); - else if (!optional && !can_insert_semicolon()) expect(";"); - } - - function parenthesized() { - expect("("); - var exp = expression(); - expect(")"); - return exp; - } - - function embed_tokens(parser) { - return function() { - var start = S.token; - var expr = parser.apply(null, arguments); - var end = prev(); - expr.start = start; - expr.end = end; - return expr; - }; - } - - function handle_regexp() { - if (is("operator", "/") || is("operator", "/=")) { - S.peeked = null; - S.token = S.input(S.token.value.substr(1)); // force regexp - } - } - - var statement = embed_tokens(function(toplevel) { - handle_regexp(); - switch (S.token.type) { - case "string": - var dir = S.in_directives; - var body = expression(); - if (dir) { - if (body instanceof AST_String) { - var value = body.start.raw.slice(1, -1); - S.input.add_directive(value); - body.value = value; - } else { - S.in_directives = dir = false; - } - } - semicolon(); - return dir ? new AST_Directive(body) : new AST_SimpleStatement({ body: body }); - case "num": - case "bigint": - case "regexp": - case "operator": - case "atom": - return simple_statement(); - - case "name": - switch (S.token.value) { - case "async": - if (is_token(peek(), "keyword", "function")) { - next(); - next(); - if (!is("operator", "*")) return function_(AST_AsyncDefun); - next(); - return function_(AST_AsyncGeneratorDefun); - } - break; - case "await": - if (S.in_async) return simple_statement(); - break; - case "export": - if (!toplevel && options.module !== "") unexpected(); - next(); - return export_(); - case "import": - var token = peek(); - if (token.type == "punc" && /^[(.]$/.test(token.value)) break; - if (!toplevel && options.module !== "") unexpected(); - next(); - return import_(); - case "let": - if (is_vardefs()) { - next(); - var node = let_(); - semicolon(); - return node; - } - break; - case "yield": - if (S.in_generator) return simple_statement(); - break; - } - return is_token(peek(), "punc", ":") - ? labeled_statement() - : simple_statement(); - - case "punc": - switch (S.token.value) { - case "{": - return new AST_BlockStatement({ - start : S.token, - body : block_(), - end : prev() - }); - case "[": - case "(": - case "`": - return simple_statement(); - case ";": - S.in_directives = false; - next(); - return new AST_EmptyStatement(); - default: - unexpected(); - } - - case "keyword": - switch (S.token.value) { - case "break": - next(); - return break_cont(AST_Break); - - case "class": - next(); - return class_(AST_DefClass); - - case "const": - next(); - var node = const_(); - semicolon(); - return node; - - case "continue": - next(); - return break_cont(AST_Continue); - - case "debugger": - next(); - semicolon(); - return new AST_Debugger(); - - case "do": - next(); - var body = in_loop(statement); - expect_token("keyword", "while"); - var condition = parenthesized(); - semicolon(true); - return new AST_Do({ - body : body, - condition : condition, - }); - - case "while": - next(); - return new AST_While({ - condition : parenthesized(), - body : in_loop(statement), - }); - - case "for": - next(); - return for_(); - - case "function": - next(); - if (!is("operator", "*")) return function_(AST_Defun); - next(); - return function_(AST_GeneratorDefun); - - case "if": - next(); - return if_(); - - case "return": - if (S.in_function == 0 && !options.bare_returns) - croak("'return' outside of function"); - next(); - var value = null; - if (is("punc", ";")) { - next(); - } else if (!can_insert_semicolon()) { - value = expression(); - semicolon(); - } - return new AST_Return({ value: value }); - - case "switch": - next(); - return new AST_Switch({ - expression : parenthesized(), - body : in_loop(switch_body_), - }); - - case "throw": - next(); - if (has_newline_before(S.token)) - croak("Illegal newline after 'throw'"); - var value = expression(); - semicolon(); - return new AST_Throw({ value: value }); - - case "try": - next(); - return try_(); - - case "var": - next(); - var node = var_(); - semicolon(); - return node; - - case "with": - if (S.input.has_directive("use strict")) { - croak("Strict mode may not include a with statement"); - } - next(); - return new AST_With({ - expression : parenthesized(), - body : statement(), - }); - } - } - unexpected(); - }); - - function labeled_statement() { - var label = as_symbol(AST_Label); - if (!all(S.labels, function(l) { - return l.name != label.name; - })) { - // ECMA-262, 12.12: An ECMAScript program is considered - // syntactically incorrect if it contains a - // LabelledStatement that is enclosed by a - // LabelledStatement with the same Identifier as label. - croak("Label " + label.name + " defined twice"); - } - expect(":"); - S.labels.push(label); - var stat = statement(); - S.labels.pop(); - if (!(stat instanceof AST_IterationStatement)) { - // check for `continue` that refers to this label. - // those should be reported as syntax errors. - // https://github.com/mishoo/UglifyJS/issues/287 - label.references.forEach(function(ref) { - if (ref instanceof AST_Continue) { - token_error(ref.label.start, "Continue label `" + label.name + "` must refer to IterationStatement"); - } - }); - } - return new AST_LabeledStatement({ body: stat, label: label }); - } - - function simple_statement() { - var body = expression(); - semicolon(); - return new AST_SimpleStatement({ body: body }); - } - - function break_cont(type) { - var label = null, ldef; - if (!can_insert_semicolon()) { - label = as_symbol(AST_LabelRef, true); - } - if (label != null) { - ldef = find_if(function(l) { - return l.name == label.name; - }, S.labels); - if (!ldef) token_error(label.start, "Undefined label " + label.name); - label.thedef = ldef; - } else if (S.in_loop == 0) croak(type.TYPE + " not inside a loop or switch"); - semicolon(); - var stat = new type({ label: label }); - if (ldef) ldef.references.push(stat); - return stat; - } - - function has_modifier(name, no_nlb) { - if (!is("name", name)) return; - var token = peek(); - if (!token) return; - if (is_token(token, "operator", "=")) return; - if (token.type == "punc" && /^[(;}]$/.test(token.value)) return; - if (no_nlb && has_newline_before(token)) return; - return next(); - } - - function class_(ctor) { - var was_async = S.in_async; - var was_gen = S.in_generator; - S.input.push_directives_stack(); - S.input.add_directive("use strict"); - var name; - if (ctor === AST_DefClass) { - name = as_symbol(AST_SymbolDefClass); - } else { - name = as_symbol(AST_SymbolClass, true); - } - var parent = null; - if (is("keyword", "extends")) { - next(); - handle_regexp(); - parent = expr_atom(true); - } - expect("{"); - var props = []; - while (!is("punc", "}")) { - if (is("punc", ";")) { - next(); - continue; - } - var start = S.token; - var fixed = !!has_modifier("static"); - var async = has_modifier("async", true); - if (is("operator", "*")) { - next(); - var internal = is("name") && /^#/.test(S.token.value); - var key = as_property_key(); - var gen_start = S.token; - var gen = function_(async ? AST_AsyncGeneratorFunction : AST_GeneratorFunction); - gen.start = gen_start; - gen.end = prev(); - props.push(new AST_ClassMethod({ - start: start, - static: fixed, - private: internal, - key: key, - value: gen, - end: prev(), - })); - continue; - } - if (fixed && is("punc", "{")) { - props.push(new AST_ClassInit({ - start: start, - value: new AST_ClassInitBlock({ - start: start, - body: block_(), - end: prev(), - }), - end: prev(), - })); - continue; - } - var internal = is("name") && /^#/.test(S.token.value); - var key = as_property_key(); - if (is("punc", "(")) { - var func_start = S.token; - var func = function_(async ? AST_AsyncFunction : AST_Function); - func.start = func_start; - func.end = prev(); - props.push(new AST_ClassMethod({ - start: start, - static: fixed, - private: internal, - key: key, - value: func, - end: prev(), - })); - continue; - } - if (async) unexpected(async); - var value = null; - if (is("operator", "=")) { - next(); - S.in_async = false; - S.in_generator = false; - value = maybe_assign(); - S.in_generator = was_gen; - S.in_async = was_async; - } else if (!(is("punc", ";") || is("punc", "}"))) { - var type = null; - switch (key) { - case "get": - type = AST_ClassGetter; - break; - case "set": - type = AST_ClassSetter; - break; - } - if (type) { - props.push(new type({ - start: start, - static: fixed, - private: is("name") && /^#/.test(S.token.value), - key: as_property_key(), - value: create_accessor(), - end: prev(), - })); - continue; - } - } - semicolon(); - props.push(new AST_ClassField({ - start: start, - static: fixed, - private: internal, - key: key, - value: value, - end: prev(), - })); - } - next(); - S.input.pop_directives_stack(); - S.in_generator = was_gen; - S.in_async = was_async; - return new ctor({ - extends: parent, - name: name, - properties: props, - }); - } - - function for_() { - var await_token = is("name", "await") && next(); - expect("("); - var init = null; - if (await_token || !is("punc", ";")) { - init = is("keyword", "const") - ? (next(), const_(true)) - : is("name", "let") && is_vardefs() - ? (next(), let_(true)) - : is("keyword", "var") - ? (next(), var_(true)) - : expression(true); - var ctor; - if (await_token) { - expect_token("name", "of"); - ctor = AST_ForAwaitOf; - } else if (is("operator", "in")) { - next(); - ctor = AST_ForIn; - } else if (is("name", "of")) { - next(); - ctor = AST_ForOf; - } - if (ctor) { - if (init instanceof AST_Definitions) { - if (init.definitions.length > 1) { - token_error(init.start, "Only one variable declaration allowed in for..in/of loop"); - } - if (ctor !== AST_ForIn && init.definitions[0].value) { - token_error(init.definitions[0].value.start, "No initializers allowed in for..of loop"); - } - } else if (!(is_assignable(init) || (init = to_destructured(init)) instanceof AST_Destructured)) { - token_error(init.start, "Invalid left-hand side in for..in/of loop"); - } - return for_enum(ctor, init); - } - } - return regular_for(init); - } - - function regular_for(init) { - expect(";"); - var test = is("punc", ";") ? null : expression(); - expect(";"); - var step = is("punc", ")") ? null : expression(); - expect(")"); - return new AST_For({ - init : init, - condition : test, - step : step, - body : in_loop(statement) - }); - } - - function for_enum(ctor, init) { - handle_regexp(); - var obj = expression(); - expect(")"); - return new ctor({ - init : init, - object : obj, - body : in_loop(statement) - }); - } - - function to_funarg(node) { - if (node instanceof AST_Array) { - var rest = null; - if (node.elements[node.elements.length - 1] instanceof AST_Spread) { - rest = to_funarg(node.elements.pop().expression); - } - return new AST_DestructuredArray({ - start: node.start, - elements: node.elements.map(to_funarg), - rest: rest, - end: node.end, - }); - } - if (node instanceof AST_Assign) return new AST_DefaultValue({ - start: node.start, - name: to_funarg(node.left), - value: node.right, - end: node.end, - }); - if (node instanceof AST_DefaultValue) { - node.name = to_funarg(node.name); - return node; - } - if (node instanceof AST_DestructuredArray) { - node.elements = node.elements.map(to_funarg); - if (node.rest) node.rest = to_funarg(node.rest); - return node; - } - if (node instanceof AST_DestructuredObject) { - node.properties.forEach(function(prop) { - prop.value = to_funarg(prop.value); - }); - if (node.rest) node.rest = to_funarg(node.rest); - return node; - } - if (node instanceof AST_Hole) return node; - if (node instanceof AST_Object) { - var rest = null; - if (node.properties[node.properties.length - 1] instanceof AST_Spread) { - rest = to_funarg(node.properties.pop().expression); - } - return new AST_DestructuredObject({ - start: node.start, - properties: node.properties.map(function(prop) { - if (!(prop instanceof AST_ObjectKeyVal)) token_error(prop.start, "Invalid destructuring assignment"); - return new AST_DestructuredKeyVal({ - start: prop.start, - key: prop.key, - value: to_funarg(prop.value), - end: prop.end, - }); - }), - rest: rest, - end: node.end, - }); - } - if (node instanceof AST_SymbolFunarg) return node; - if (node instanceof AST_SymbolRef) return new AST_SymbolFunarg(node); - if (node instanceof AST_Yield) return new AST_SymbolFunarg({ - start: node.start, - name: "yield", - end: node.end, - }); - token_error(node.start, "Invalid arrow parameter"); - } - - function arrow(exprs, start, async) { - var was_async = S.in_async; - var was_gen = S.in_generator; - S.in_async = async; - S.in_generator = false; - var was_funarg = S.in_funarg; - S.in_funarg = S.in_function; - var argnames = exprs.map(to_funarg); - var rest = exprs.rest || null; - if (rest) rest = to_funarg(rest); - S.in_funarg = was_funarg; - expect("=>"); - var body, value; - var loop = S.in_loop; - var labels = S.labels; - ++S.in_function; - S.input.push_directives_stack(); - S.in_loop = 0; - S.labels = []; - if (is("punc", "{")) { - S.in_directives = true; - body = block_(); - value = null; - } else { - body = []; - handle_regexp(); - value = maybe_assign(); - } - var is_strict = S.input.has_directive("use strict"); - S.input.pop_directives_stack(); - --S.in_function; - S.in_loop = loop; - S.labels = labels; - S.in_generator = was_gen; - S.in_async = was_async; - var node = new (async ? AST_AsyncArrow : AST_Arrow)({ - start: start, - argnames: argnames, - rest: rest, - body: body, - value: value, - end: prev(), - }); - if (is_strict) node.each_argname(strict_verify_symbol); - return node; - } - - var function_ = function(ctor) { - var was_async = S.in_async; - var was_gen = S.in_generator; - var name; - if (/Defun$/.test(ctor.TYPE)) { - name = as_symbol(AST_SymbolDefun); - S.in_async = /^Async/.test(ctor.TYPE); - S.in_generator = /Generator/.test(ctor.TYPE); - } else { - S.in_async = /^Async/.test(ctor.TYPE); - S.in_generator = /Generator/.test(ctor.TYPE); - name = as_symbol(AST_SymbolLambda, true); - } - if (name && ctor !== AST_Accessor && !(name instanceof AST_SymbolDeclaration)) - unexpected(prev()); - expect("("); - var was_funarg = S.in_funarg; - S.in_funarg = S.in_function; - var argnames = expr_list(")", !options.strict, false, function() { - return maybe_default(AST_SymbolFunarg); - }); - S.in_funarg = was_funarg; - var loop = S.in_loop; - var labels = S.labels; - ++S.in_function; - S.in_directives = true; - S.input.push_directives_stack(); - S.in_loop = 0; - S.labels = []; - var body = block_(); - var is_strict = S.input.has_directive("use strict"); - S.input.pop_directives_stack(); - --S.in_function; - S.in_loop = loop; - S.labels = labels; - S.in_generator = was_gen; - S.in_async = was_async; - var node = new ctor({ - name: name, - argnames: argnames, - rest: argnames.rest || null, - body: body, - }); - if (is_strict) { - if (name) strict_verify_symbol(name); - node.each_argname(strict_verify_symbol); - } - return node; - }; - - function if_() { - var cond = parenthesized(), body = statement(), alt = null; - if (is("keyword", "else")) { - next(); - alt = statement(); - } - return new AST_If({ - condition : cond, - body : body, - alternative : alt, - }); - } - - function is_alias() { - return is("name") || is("string") || is_identifier_string(S.token.value); - } - - function make_string(token) { - return new AST_String({ - start: token, - quote: token.quote, - value: token.value, - end: token, - }); - } - - function as_path() { - var path = S.token; - expect_token("string"); - semicolon(); - return make_string(path); - } - - function export_() { - if (is("operator", "*")) { - var key = S.token; - var alias = key; - next(); - if (is("name", "as")) { - next(); - if (!is_alias()) expect_token("name"); - alias = S.token; - next(); - } - expect_token("name", "from"); - return new AST_ExportForeign({ - aliases: [ make_string(alias) ], - keys: [ make_string(key) ], - path: as_path(), - }); - } - if (is("punc", "{")) { - next(); - var aliases = []; - var keys = []; - while (is_alias()) { - var key = S.token; - next(); - keys.push(key); - if (is("name", "as")) { - next(); - if (!is_alias()) expect_token("name"); - aliases.push(S.token); - next(); - } else { - aliases.push(key); - } - if (!is("punc", "}")) expect(","); - } - expect("}"); - if (is("name", "from")) { - next(); - return new AST_ExportForeign({ - aliases: aliases.map(make_string), - keys: keys.map(make_string), - path: as_path(), - }); - } - semicolon(); - return new AST_ExportReferences({ - properties: keys.map(function(token, index) { - if (!is_token(token, "name")) token_error(token, "Name expected"); - var sym = _make_symbol(AST_SymbolExport, token); - sym.alias = make_string(aliases[index]); - return sym; - }), - }); - } - if (is("keyword", "default")) { - next(); - var start = S.token; - var body = export_default_decl(); - if (body) { - body.start = start; - body.end = prev(); - } else { - handle_regexp(); - body = expression(); - semicolon(); - } - return new AST_ExportDefault({ body: body }); - } - return new AST_ExportDeclaration({ body: export_decl() }); - } - - function maybe_named(def, expr) { - if (expr.name) { - expr = new def(expr); - expr.name = new (def === AST_DefClass ? AST_SymbolDefClass : AST_SymbolDefun)(expr.name); - } - return expr; - } - - function export_default_decl() { - if (is("name", "async")) { - if (!is_token(peek(), "keyword", "function")) return; - next(); - next(); - if (!is("operator", "*")) return maybe_named(AST_AsyncDefun, function_(AST_AsyncFunction)); - next(); - return maybe_named(AST_AsyncGeneratorDefun, function_(AST_AsyncGeneratorFunction)); - } else if (is("keyword")) switch (S.token.value) { - case "class": - next(); - return maybe_named(AST_DefClass, class_(AST_ClassExpression)); - case "function": - next(); - if (!is("operator", "*")) return maybe_named(AST_Defun, function_(AST_Function)); - next(); - return maybe_named(AST_GeneratorDefun, function_(AST_GeneratorFunction)); - } - } - - var export_decl = embed_tokens(function() { - if (is("name")) switch (S.token.value) { - case "async": - next(); - expect_token("keyword", "function"); - if (!is("operator", "*")) return function_(AST_AsyncDefun); - next(); - return function_(AST_AsyncGeneratorDefun); - case "let": - next(); - var node = let_(); - semicolon(); - return node; - } else if (is("keyword")) switch (S.token.value) { - case "class": - next(); - return class_(AST_DefClass); - case "const": - next(); - var node = const_(); - semicolon(); - return node; - case "function": - next(); - if (!is("operator", "*")) return function_(AST_Defun); - next(); - return function_(AST_GeneratorDefun); - case "var": - next(); - var node = var_(); - semicolon(); - return node; - } - unexpected(); - }); - - function import_() { - var all = null; - var def = as_symbol(AST_SymbolImport, true); - var props = null; - var cont; - if (def) { - def.key = new AST_String({ - start: def.start, - value: "", - end: def.end, - }); - if (cont = is("punc", ",")) next(); - } else { - cont = !is("string"); - } - if (cont) { - if (is("operator", "*")) { - var key = S.token; - next(); - expect_token("name", "as"); - all = as_symbol(AST_SymbolImport); - all.key = make_string(key); - } else { - expect("{"); - props = []; - while (is_alias()) { - var alias; - if (is_token(peek(), "name", "as")) { - var key = S.token; - next(); - next(); - alias = as_symbol(AST_SymbolImport); - alias.key = make_string(key); - } else { - alias = as_symbol(AST_SymbolImport); - alias.key = new AST_String({ - start: alias.start, - value: alias.name, - end: alias.end, - }); - } - props.push(alias); - if (!is("punc", "}")) expect(","); - } - expect("}"); - } - } - if (all || def || props) expect_token("name", "from"); - return new AST_Import({ - all: all, - default: def, - path: as_path(), - properties: props, - }); - } - - function block_() { - expect("{"); - var a = []; - while (!is("punc", "}")) { - if (is("eof")) expect("}"); - a.push(statement()); - } - next(); - return a; - } - - function switch_body_() { - expect("{"); - var a = [], branch, cur, default_branch, tmp; - while (!is("punc", "}")) { - if (is("eof")) expect("}"); - if (is("keyword", "case")) { - if (branch) branch.end = prev(); - cur = []; - branch = new AST_Case({ - start : (tmp = S.token, next(), tmp), - expression : expression(), - body : cur - }); - a.push(branch); - expect(":"); - } else if (is("keyword", "default")) { - if (branch) branch.end = prev(); - if (default_branch) croak("More than one default clause in switch statement"); - cur = []; - branch = new AST_Default({ - start : (tmp = S.token, next(), expect(":"), tmp), - body : cur - }); - a.push(branch); - default_branch = branch; - } else { - if (!cur) unexpected(); - cur.push(statement()); - } - } - if (branch) branch.end = prev(); - next(); - return a; - } - - function try_() { - var body = block_(), bcatch = null, bfinally = null; - if (is("keyword", "catch")) { - var start = S.token; - next(); - var name = null; - if (is("punc", "(")) { - next(); - name = maybe_destructured(AST_SymbolCatch); - expect(")"); - } - bcatch = new AST_Catch({ - start : start, - argname : name, - body : block_(), - end : prev() - }); - } - if (is("keyword", "finally")) { - var start = S.token; - next(); - bfinally = new AST_Finally({ - start : start, - body : block_(), - end : prev() - }); - } - if (!bcatch && !bfinally) - croak("Missing catch/finally blocks"); - return new AST_Try({ - body : body, - bcatch : bcatch, - bfinally : bfinally - }); - } - - function vardefs(type, no_in) { - var a = []; - for (;;) { - var start = S.token; - var name = maybe_destructured(type); - var value = null; - if (is("operator", "=")) { - next(); - value = maybe_assign(no_in); - } else if (!no_in && (type === AST_SymbolConst || name instanceof AST_Destructured)) { - croak("Missing initializer in declaration"); - } - a.push(new AST_VarDef({ - start : start, - name : name, - value : value, - end : prev() - })); - if (!is("punc", ",")) - break; - next(); - } - return a; - } - - function is_vardefs() { - var token = peek(); - return is_token(token, "name") || is_token(token, "punc", "[") || is_token(token, "punc", "{"); - } - - var const_ = function(no_in) { - return new AST_Const({ - start : prev(), - definitions : vardefs(AST_SymbolConst, no_in), - end : prev() - }); - }; - - var let_ = function(no_in) { - return new AST_Let({ - start : prev(), - definitions : vardefs(AST_SymbolLet, no_in), - end : prev() - }); - }; - - var var_ = function(no_in) { - return new AST_Var({ - start : prev(), - definitions : vardefs(AST_SymbolVar, no_in), - end : prev() - }); - }; - - var new_ = function(allow_calls) { - var start = S.token; - expect_token("operator", "new"); - var call; - if (is("punc", ".") && is_token(peek(), "name", "target")) { - next(); - next(); - call = new AST_NewTarget(); - } else { - var exp = expr_atom(false), args; - if (is("punc", "(")) { - next(); - args = expr_list(")", !options.strict); - } else { - args = []; - } - call = new AST_New({ expression: exp, args: args }); - } - call.start = start; - call.end = prev(); - return subscripts(call, allow_calls); - }; - - function as_atom_node() { - var ret, tok = S.token, value = tok.value; - switch (tok.type) { - case "num": - if (isFinite(value)) { - ret = new AST_Number({ value: value }); - } else { - ret = new AST_Infinity(); - if (value < 0) ret = new AST_UnaryPrefix({ operator: "-", expression: ret }); - } - break; - case "bigint": - ret = new AST_BigInt({ value: value }); - break; - case "string": - ret = new AST_String({ value: value, quote: tok.quote }); - break; - case "regexp": - ret = new AST_RegExp({ value: value }); - break; - case "atom": - switch (value) { - case "false": - ret = new AST_False(); - break; - case "true": - ret = new AST_True(); - break; - case "null": - ret = new AST_Null(); - break; - default: - unexpected(); - } - break; - default: - unexpected(); - } - next(); - ret.start = ret.end = tok; - return ret; - } - - var expr_atom = function(allow_calls) { - if (is("operator", "new")) { - return new_(allow_calls); - } - var start = S.token; - if (is("punc")) { - switch (start.value) { - case "`": - return subscripts(template(null), allow_calls); - case "(": - next(); - if (is("punc", ")")) { - next(); - return arrow([], start); - } - var ex = expression(false, true); - var len = start.comments_before.length; - [].unshift.apply(ex.start.comments_before, start.comments_before); - start.comments_before.length = 0; - start.comments_before = ex.start.comments_before; - start.comments_before_length = len; - if (len == 0 && start.comments_before.length > 0) { - var comment = start.comments_before[0]; - if (!comment.nlb) { - comment.nlb = start.nlb; - start.nlb = false; - } - } - start.comments_after = ex.start.comments_after; - ex.start = start; - expect(")"); - var end = prev(); - end.comments_before = ex.end.comments_before; - end.comments_after.forEach(function(comment) { - ex.end.comments_after.push(comment); - if (comment.nlb) S.token.nlb = true; - }); - end.comments_after.length = 0; - end.comments_after = ex.end.comments_after; - ex.end = end; - if (is("punc", "=>")) return arrow(ex instanceof AST_Sequence ? ex.expressions : [ ex ], start); - return subscripts(ex, allow_calls); - case "[": - return subscripts(array_(), allow_calls); - case "{": - return subscripts(object_(), allow_calls); - } - unexpected(); - } - if (is("keyword")) switch (start.value) { - case "class": - next(); - var clazz = class_(AST_ClassExpression); - clazz.start = start; - clazz.end = prev(); - return subscripts(clazz, allow_calls); - case "function": - next(); - var func; - if (is("operator", "*")) { - next(); - func = function_(AST_GeneratorFunction); - } else { - func = function_(AST_Function); - } - func.start = start; - func.end = prev(); - return subscripts(func, allow_calls); - } - if (is("name")) { - var sym = _make_symbol(AST_SymbolRef, start); - next(); - if (sym.name == "async") { - if (is("keyword", "function")) { - next(); - var func; - if (is("operator", "*")) { - next(); - func = function_(AST_AsyncGeneratorFunction); - } else { - func = function_(AST_AsyncFunction); - } - func.start = start; - func.end = prev(); - return subscripts(func, allow_calls); - } - if (is("name") && is_token(peek(), "punc", "=>")) { - start = S.token; - sym = _make_symbol(AST_SymbolRef, start); - next(); - return arrow([ sym ], start, true); - } - if (is("punc", "(")) { - var call = subscripts(sym, allow_calls); - if (!is("punc", "=>")) return call; - var args = call.args; - if (args[args.length - 1] instanceof AST_Spread) { - args.rest = args.pop().expression; - } - return arrow(args, start, true); - } - } - return is("punc", "=>") ? arrow([ sym ], start) : subscripts(sym, allow_calls); - } - if (ATOMIC_START_TOKEN[S.token.type]) { - return subscripts(as_atom_node(), allow_calls); - } - unexpected(); - }; - - function expr_list(closing, allow_trailing_comma, allow_empty, parser) { - if (!parser) parser = maybe_assign; - var first = true, a = []; - while (!is("punc", closing)) { - if (first) first = false; else expect(","); - if (allow_trailing_comma && is("punc", closing)) break; - if (allow_empty && is("punc", ",")) { - a.push(new AST_Hole({ start: S.token, end: S.token })); - } else if (!is("operator", "...")) { - a.push(parser()); - } else if (parser === maybe_assign) { - a.push(new AST_Spread({ - start: S.token, - expression: (next(), parser()), - end: prev(), - })); - } else { - next(); - a.rest = parser(); - if (a.rest instanceof AST_DefaultValue) token_error(a.rest.start, "Invalid rest parameter"); - break; - } - } - expect(closing); - return a; - } - - var array_ = embed_tokens(function() { - expect("["); - return new AST_Array({ - elements: expr_list("]", !options.strict, true) - }); - }); - - var create_accessor = embed_tokens(function() { - return function_(AST_Accessor); - }); - - var object_ = embed_tokens(function() { - expect("{"); - var first = true, a = []; - while (!is("punc", "}")) { - if (first) first = false; else expect(","); - // allow trailing comma - if (!options.strict && is("punc", "}")) break; - var start = S.token; - if (is("operator", "*")) { - next(); - var key = as_property_key(); - var gen_start = S.token; - var gen = function_(AST_GeneratorFunction); - gen.start = gen_start; - gen.end = prev(); - a.push(new AST_ObjectMethod({ - start: start, - key: key, - value: gen, - end: prev(), - })); - continue; - } - if (is("operator", "...")) { - next(); - a.push(new AST_Spread({ - start: start, - expression: maybe_assign(), - end: prev(), - })); - continue; - } - if (is_token(peek(), "operator", "=")) { - var name = as_symbol(AST_SymbolRef); - next(); - a.push(new AST_ObjectKeyVal({ - start: start, - key: start.value, - value: new AST_Assign({ - start: start, - left: name, - operator: "=", - right: maybe_assign(), - end: prev(), - }), - end: prev(), - })); - continue; - } - if (is_token(peek(), "punc", ",") || is_token(peek(), "punc", "}")) { - a.push(new AST_ObjectKeyVal({ - start: start, - key: start.value, - value: as_symbol(AST_SymbolRef), - end: prev(), - })); - continue; - } - var key = as_property_key(); - if (is("punc", "(")) { - var func_start = S.token; - var func = function_(AST_Function); - func.start = func_start; - func.end = prev(); - a.push(new AST_ObjectMethod({ - start: start, - key: key, - value: func, - end: prev(), - })); - continue; - } - if (is("punc", ":")) { - next(); - a.push(new AST_ObjectKeyVal({ - start: start, - key: key, - value: maybe_assign(), - end: prev(), - })); - continue; - } - if (start.type == "name") switch (key) { - case "async": - var is_gen = is("operator", "*") && next(); - key = as_property_key(); - var func_start = S.token; - var func = function_(is_gen ? AST_AsyncGeneratorFunction : AST_AsyncFunction); - func.start = func_start; - func.end = prev(); - a.push(new AST_ObjectMethod({ - start: start, - key: key, - value: func, - end: prev(), - })); - continue; - case "get": - a.push(new AST_ObjectGetter({ - start: start, - key: as_property_key(), - value: create_accessor(), - end: prev(), - })); - continue; - case "set": - a.push(new AST_ObjectSetter({ - start: start, - key: as_property_key(), - value: create_accessor(), - end: prev(), - })); - continue; - } - unexpected(); - } - next(); - return new AST_Object({ properties: a }); - }); - - function as_property_key() { - var tmp = S.token; - switch (tmp.type) { - case "operator": - if (!KEYWORDS[tmp.value]) unexpected(); - case "num": - case "string": - case "name": - case "keyword": - case "atom": - next(); - return "" + tmp.value; - case "punc": - expect("["); - var key = maybe_assign(); - expect("]"); - return key; - default: - unexpected(); - } - } - - function as_name() { - var name = S.token.value; - expect_token("name"); - return name; - } - - function _make_symbol(type, token) { - var name = token.value; - switch (name) { - case "await": - if (S.in_async) unexpected(token); - break; - case "super": - type = AST_Super; - break; - case "this": - type = AST_This; - break; - case "yield": - if (S.in_generator) unexpected(token); - break; - } - return new type({ - name: "" + name, - start: token, - end: token, - }); - } - - function strict_verify_symbol(sym) { - if (sym.name == "arguments" || sym.name == "eval" || sym.name == "let") - token_error(sym.start, "Unexpected " + sym.name + " in strict mode"); - } - - function as_symbol(type, no_error) { - if (!is("name")) { - if (!no_error) croak("Name expected"); - return null; - } - var sym = _make_symbol(type, S.token); - if (S.input.has_directive("use strict") && sym instanceof AST_SymbolDeclaration) { - strict_verify_symbol(sym); - } - next(); - return sym; - } - - function maybe_destructured(type) { - var start = S.token; - if (is("punc", "[")) { - next(); - var elements = expr_list("]", !options.strict, true, function() { - return maybe_default(type); - }); - return new AST_DestructuredArray({ - start: start, - elements: elements, - rest: elements.rest || null, - end: prev(), - }); - } - if (is("punc", "{")) { - next(); - var first = true, a = [], rest = null; - while (!is("punc", "}")) { - if (first) first = false; else expect(","); - // allow trailing comma - if (!options.strict && is("punc", "}")) break; - var key_start = S.token; - if (is("punc", "[") || is_token(peek(), "punc", ":")) { - var key = as_property_key(); - expect(":"); - a.push(new AST_DestructuredKeyVal({ - start: key_start, - key: key, - value: maybe_default(type), - end: prev(), - })); - continue; - } - if (is("operator", "...")) { - next(); - rest = maybe_destructured(type); - break; - } - var name = as_symbol(type); - if (is("operator", "=")) { - next(); - name = new AST_DefaultValue({ - start: name.start, - name: name, - value: maybe_assign(), - end: prev(), - }); - } - a.push(new AST_DestructuredKeyVal({ - start: key_start, - key: key_start.value, - value: name, - end: prev(), - })); - } - expect("}"); - return new AST_DestructuredObject({ - start: start, - properties: a, - rest: rest, - end: prev(), - }); - } - return as_symbol(type); - } - - function maybe_default(type) { - var start = S.token; - var name = maybe_destructured(type); - if (!is("operator", "=")) return name; - next(); - return new AST_DefaultValue({ - start: start, - name: name, - value: maybe_assign(), - end: prev(), - }); - } - - function template(tag) { - var start = tag ? tag.start : S.token; - var read = S.input.context().read_template; - var strings = []; - var expressions = []; - while (read(strings)) { - next(); - expressions.push(expression()); - if (!is("punc", "}")) unexpected(); - } - next(); - return new AST_Template({ - start: start, - expressions: expressions, - strings: strings, - tag: tag, - end: prev(), - }); - } - - function subscripts(expr, allow_calls) { - var start = expr.start; - var optional = null; - while (true) { - if (is("operator", "?") && is_token(peek(), "punc", ".")) { - next(); - next(); - optional = expr; - } - if (is("punc", "[")) { - next(); - var prop = expression(); - expect("]"); - expr = new AST_Sub({ - start: start, - optional: optional === expr, - expression: expr, - property: prop, - end: prev(), - }); - } else if (allow_calls && is("punc", "(")) { - next(); - expr = new AST_Call({ - start: start, - optional: optional === expr, - expression: expr, - args: expr_list(")", !options.strict), - end: prev(), - }); - } else if (optional === expr || is("punc", ".")) { - if (optional !== expr) next(); - expr = new AST_Dot({ - start: start, - optional: optional === expr, - expression: expr, - property: as_name(), - end: prev(), - }); - } else if (is("punc", "`")) { - if (optional) croak("Invalid template on optional chain"); - expr = template(expr); - } else { - break; - } - } - if (optional) expr.terminal = true; - if (expr instanceof AST_Call && !expr.pure) { - var start = expr.start; - var comments = start.comments_before; - var i = HOP(start, "comments_before_length") ? start.comments_before_length : comments.length; - while (--i >= 0) { - if (/[@#]__PURE__/.test(comments[i].value)) { - expr.pure = true; - break; - } - } - } - return expr; - } - - function maybe_unary(no_in) { - var start = S.token; - if (S.in_async && is("name", "await")) { - if (S.in_funarg === S.in_function) croak("Invalid use of await in function argument"); - S.input.context().regex_allowed = true; - next(); - return new AST_Await({ - start: start, - expression: maybe_unary(no_in), - end: prev(), - }); - } - if (S.in_generator && is("name", "yield")) { - if (S.in_funarg === S.in_function) croak("Invalid use of yield in function argument"); - S.input.context().regex_allowed = true; - next(); - var exp = null; - var nested = false; - if (is("operator", "*")) { - next(); - exp = maybe_assign(no_in); - nested = true; - } else if (is("punc") ? !PUNC_AFTER_EXPRESSION[S.token.value] : !can_insert_semicolon()) { - exp = maybe_assign(no_in); - } - return new AST_Yield({ - start: start, - expression: exp, - nested: nested, - end: prev(), - }); - } - if (is("operator") && UNARY_PREFIX[start.value]) { - next(); - handle_regexp(); - var ex = make_unary(AST_UnaryPrefix, start, maybe_unary(no_in)); - ex.start = start; - ex.end = prev(); - return ex; - } - var val = expr_atom(true); - while (is("operator") && UNARY_POSTFIX[S.token.value] && !has_newline_before(S.token)) { - val = make_unary(AST_UnaryPostfix, S.token, val); - val.start = start; - val.end = S.token; - next(); - } - return val; - } - - function make_unary(ctor, token, expr) { - var op = token.value; - switch (op) { - case "++": - case "--": - if (!is_assignable(expr)) - token_error(token, "Invalid use of " + op + " operator"); - break; - case "delete": - if (expr instanceof AST_SymbolRef && S.input.has_directive("use strict")) - token_error(expr.start, "Calling delete on expression not allowed in strict mode"); - break; - } - return new ctor({ operator: op, expression: expr }); - } - - var expr_op = function(left, min_precision, no_in) { - var op = is("operator") ? S.token.value : null; - if (op == "in" && no_in) op = null; - var precision = op != null ? PRECEDENCE[op] : null; - if (precision != null && precision > min_precision) { - next(); - var right = expr_op(maybe_unary(no_in), op == "**" ? precision - 1 : precision, no_in); - return expr_op(new AST_Binary({ - start : left.start, - left : left, - operator : op, - right : right, - end : right.end, - }), min_precision, no_in); - } - return left; - }; - - function expr_ops(no_in) { - return expr_op(maybe_unary(no_in), 0, no_in); - } - - var maybe_conditional = function(no_in) { - var start = S.token; - var expr = expr_ops(no_in); - if (is("operator", "?")) { - next(); - var yes = maybe_assign(); - expect(":"); - return new AST_Conditional({ - start : start, - condition : expr, - consequent : yes, - alternative : maybe_assign(no_in), - end : prev() - }); - } - return expr; - }; - - function is_assignable(expr) { - return expr instanceof AST_PropAccess && !expr.optional || expr instanceof AST_SymbolRef; - } - - function to_destructured(node) { - if (node instanceof AST_Array) { - var rest = null; - if (node.elements[node.elements.length - 1] instanceof AST_Spread) { - rest = to_destructured(node.elements.pop().expression); - if (!(rest instanceof AST_Destructured || is_assignable(rest))) return node; - } - var elements = node.elements.map(to_destructured); - return all(elements, function(node) { - return node instanceof AST_DefaultValue - || node instanceof AST_Destructured - || node instanceof AST_Hole - || is_assignable(node); - }) ? new AST_DestructuredArray({ - start: node.start, - elements: elements, - rest: rest, - end: node.end, - }) : node; - } - if (node instanceof AST_Assign) { - var name = to_destructured(node.left); - return name instanceof AST_Destructured || is_assignable(name) ? new AST_DefaultValue({ - start: node.start, - name: name, - value: node.right, - end: node.end, - }) : node; - } - if (!(node instanceof AST_Object)) return node; - var rest = null; - if (node.properties[node.properties.length - 1] instanceof AST_Spread) { - rest = to_destructured(node.properties.pop().expression); - if (!(rest instanceof AST_Destructured || is_assignable(rest))) return node; - } - var props = []; - for (var i = 0; i < node.properties.length; i++) { - var prop = node.properties[i]; - if (!(prop instanceof AST_ObjectKeyVal)) return node; - var value = to_destructured(prop.value); - if (!(value instanceof AST_DefaultValue || value instanceof AST_Destructured || is_assignable(value))) { - return node; - } - props.push(new AST_DestructuredKeyVal({ - start: prop.start, - key: prop.key, - value: value, - end: prop.end, - })); - } - return new AST_DestructuredObject({ - start: node.start, - properties: props, - rest: rest, - end: node.end, - }); - } - - function maybe_assign(no_in) { - var start = S.token; - var left = maybe_conditional(no_in), val = S.token.value; - if (is("operator") && ASSIGNMENT[val]) { - if (is_assignable(left) || val == "=" && (left = to_destructured(left)) instanceof AST_Destructured) { - next(); - return new AST_Assign({ - start : start, - left : left, - operator : val, - right : maybe_assign(no_in), - end : prev() - }); - } - croak("Invalid assignment"); - } - return left; - } - - function expression(no_in, maybe_arrow) { - var start = S.token; - var exprs = []; - while (true) { - if (maybe_arrow && is("operator", "...")) { - next(); - exprs.rest = maybe_destructured(AST_SymbolFunarg); - break; - } - exprs.push(maybe_assign(no_in)); - if (!is("punc", ",")) break; - next(); - if (maybe_arrow && is("punc", ")") && is_token(peek(), "punc", "=>")) break; - } - return exprs.length == 1 && !exprs.rest ? exprs[0] : new AST_Sequence({ - start: start, - expressions: exprs, - end: prev(), - }); - } - - function in_loop(cont) { - ++S.in_loop; - var ret = cont(); - --S.in_loop; - return ret; - } - - if (options.expression) { - handle_regexp(); - var exp = expression(); - expect_token("eof"); - return exp; - } - - return function() { - var start = S.token; - var body = []; - if (options.module) { - S.in_async = true; - S.input.add_directive("use strict"); - } - S.input.push_directives_stack(); - while (!is("eof")) - body.push(statement(true)); - S.input.pop_directives_stack(); - var end = prev() || start; - var toplevel = options.toplevel; - if (toplevel) { - toplevel.body = toplevel.body.concat(body); - toplevel.end = end; - } else { - toplevel = new AST_Toplevel({ start: start, body: body, end: end }); - } - return toplevel; - }(); -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/uglify-js/lib/propmangle.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/uglify-js/lib/propmangle.js deleted file mode 100644 index 3e71b68c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/uglify-js/lib/propmangle.js +++ /dev/null @@ -1,328 +0,0 @@ -/*********************************************************************** - - A JavaScript tokenizer / parser / beautifier / compressor. - https://github.com/mishoo/UglifyJS - - -------------------------------- (C) --------------------------------- - - Author: Mihai Bazon - - http://mihai.bazon.net/blog - - Distributed under the BSD license: - - Copyright 2012 (c) Mihai Bazon - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - * Redistributions of source code must retain the above - copyright notice, this list of conditions and the following - disclaimer. - - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials - provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY - EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR - TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF - THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - SUCH DAMAGE. - - ***********************************************************************/ - -"use strict"; - -function get_builtins() { - var names = new Dictionary(); - // constants - [ - "NaN", - "null", - "true", - "false", - "Infinity", - "-Infinity", - "undefined", - ].forEach(add); - // global functions - [ - "encodeURI", - "encodeURIComponent", - "escape", - "eval", - "decodeURI", - "decodeURIComponent", - "isFinite", - "isNaN", - "parseFloat", - "parseInt", - "unescape", - ].forEach(add); - // global constructors & objects - var global = Function("return this")(); - [ - "Array", - "ArrayBuffer", - "Atomics", - "BigInt", - "Boolean", - "console", - "DataView", - "Date", - "Error", - "Function", - "Int8Array", - "Intl", - "JSON", - "Map", - "Math", - "Number", - "Object", - "Promise", - "Proxy", - "Reflect", - "RegExp", - "Set", - "String", - "Symbol", - "WebAssembly", - ].forEach(function(name) { - add(name); - var ctor = global[name]; - if (!ctor) return; - Object.getOwnPropertyNames(ctor).map(add); - if (typeof ctor != "function") return; - if (ctor.__proto__) Object.getOwnPropertyNames(ctor.__proto__).map(add); - if (ctor.prototype) Object.getOwnPropertyNames(ctor.prototype).map(add); - try { - Object.getOwnPropertyNames(new ctor()).map(add); - } catch (e) { - try { - Object.getOwnPropertyNames(ctor()).map(add); - } catch (e) {} - } - }); - return (get_builtins = function() { - return names.clone(); - })(); - - function add(name) { - names.set(name, true); - } -} - -function reserve_quoted_keys(ast, reserved) { - ast.walk(new TreeWalker(function(node) { - if (node instanceof AST_ClassProperty - || node instanceof AST_DestructuredKeyVal - || node instanceof AST_ObjectProperty) { - if (node.key instanceof AST_Node) { - addStrings(node.key, add); - } else if (node.start && node.start.quote) { - add(node.key); - } - } else if (node instanceof AST_Dot) { - if (node.quoted) add(node.property); - } else if (node instanceof AST_Sub) { - addStrings(node.property, add); - } - })); - - function add(name) { - push_uniq(reserved, name); - } -} - -function addStrings(node, add) { - if (node instanceof AST_Conditional) { - addStrings(node.consequent, add); - addStrings(node.alternative, add); - } else if (node instanceof AST_Sequence) { - addStrings(node.tail_node(), add); - } else if (node instanceof AST_String) { - add(node.value); - } -} - -function mangle_properties(ast, options) { - options = defaults(options, { - builtins: false, - cache: null, - debug: false, - domprops: false, - keep_quoted: false, - regex: null, - reserved: null, - }, true); - - var reserved = options.builtins ? new Dictionary() : get_builtins(); - if (!options.domprops && typeof domprops !== "undefined") domprops.forEach(function(name) { - reserved.set(name, true); - }); - if (Array.isArray(options.reserved)) options.reserved.forEach(function(name) { - reserved.set(name, true); - }); - - var cname = -1; - var cache; - if (options.cache) { - cache = options.cache.props; - cache.each(function(name) { - reserved.set(name, true); - }); - } else { - cache = new Dictionary(); - } - - var regex = options.regex; - - // note debug is either false (disabled), or a string of the debug suffix to use (enabled). - // note debug may be enabled as an empty string, which is falsy. Also treat passing 'true' - // the same as passing an empty string. - var debug = options.debug !== false; - var debug_suffix; - if (debug) debug_suffix = options.debug === true ? "" : options.debug; - - var names_to_mangle = new Dictionary(); - var unmangleable = reserved.clone(); - - // step 1: find candidates to mangle - ast.walk(new TreeWalker(function(node) { - if (node.TYPE == "Call") { - var exp = node.expression; - if (exp instanceof AST_Dot) switch (exp.property) { - case "defineProperty": - case "getOwnPropertyDescriptor": - if (node.args.length < 2) break; - exp = exp.expression; - if (!(exp instanceof AST_SymbolRef)) break; - if (exp.name != "Object") break; - if (!exp.definition().undeclared) break; - addStrings(node.args[1], add); - break; - case "hasOwnProperty": - if (node.args.length < 1) break; - addStrings(node.args[0], add); - break; - } - } else if (node instanceof AST_ClassProperty - || node instanceof AST_DestructuredKeyVal - || node instanceof AST_ObjectProperty) { - if (node.key instanceof AST_Node) { - addStrings(node.key, add); - } else { - add(node.key); - } - } else if (node instanceof AST_Dot) { - if (is_lhs(node, this.parent())) add(node.property); - } else if (node instanceof AST_Sub) { - if (is_lhs(node, this.parent())) addStrings(node.property, add); - } - })); - - // step 2: renaming properties - ast.walk(new TreeWalker(function(node) { - if (node instanceof AST_Binary) { - if (node.operator == "in") mangleStrings(node.left); - } else if (node.TYPE == "Call") { - var exp = node.expression; - if (exp instanceof AST_Dot) switch (exp.property) { - case "defineProperty": - case "getOwnPropertyDescriptor": - if (node.args.length < 2) break; - exp = exp.expression; - if (!(exp instanceof AST_SymbolRef)) break; - if (exp.name != "Object") break; - if (!exp.definition().undeclared) break; - mangleStrings(node.args[1]); - break; - case "hasOwnProperty": - if (node.args.length < 1) break; - mangleStrings(node.args[0]); - break; - } - } else if (node instanceof AST_ClassProperty - || node instanceof AST_DestructuredKeyVal - || node instanceof AST_ObjectProperty) { - if (node.key instanceof AST_Node) { - mangleStrings(node.key); - } else { - node.key = mangle(node.key); - } - } else if (node instanceof AST_Dot) { - node.property = mangle(node.property); - } else if (node instanceof AST_Sub) { - if (!options.keep_quoted) mangleStrings(node.property); - } - })); - - // only function declarations after this line - - function can_mangle(name) { - if (unmangleable.has(name)) return false; - if (/^-?[0-9]+(\.[0-9]+)?(e[+-][0-9]+)?$/.test(name)) return false; - return true; - } - - function should_mangle(name) { - if (reserved.has(name)) { - AST_Node.info("Preserving reserved property {this}", name); - return false; - } - if (regex && !regex.test(name)) { - AST_Node.info("Preserving excluded property {this}", name); - return false; - } - return cache.has(name) || names_to_mangle.has(name); - } - - function add(name) { - if (can_mangle(name)) names_to_mangle.set(name, true); - if (!should_mangle(name)) unmangleable.set(name, true); - } - - function mangle(name) { - if (!should_mangle(name)) return name; - var mangled = cache.get(name); - if (!mangled) { - if (debug) { - // debug mode: use a prefix and suffix to preserve readability, e.g. o.foo ---> o._$foo$NNN_. - var debug_mangled = "_$" + name + "$" + debug_suffix + "_"; - if (can_mangle(debug_mangled)) mangled = debug_mangled; - } - // either debug mode is off, or it is on and we could not use the mangled name - if (!mangled) do { - mangled = base54(++cname); - } while (!can_mangle(mangled)); - if (/^#/.test(name)) mangled = "#" + mangled; - cache.set(name, mangled); - } - AST_Node.info("Mapping property {name} to {mangled}", { - mangled: mangled, - name: name, - }); - return mangled; - } - - function mangleStrings(node) { - if (node instanceof AST_Sequence) { - mangleStrings(node.tail_node()); - } else if (node instanceof AST_String) { - node.value = mangle(node.value); - } else if (node instanceof AST_Conditional) { - mangleStrings(node.consequent); - mangleStrings(node.alternative); - } - } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/uglify-js/lib/scope.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/uglify-js/lib/scope.js deleted file mode 100644 index c2108c50..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/uglify-js/lib/scope.js +++ /dev/null @@ -1,866 +0,0 @@ -/*********************************************************************** - - A JavaScript tokenizer / parser / beautifier / compressor. - https://github.com/mishoo/UglifyJS - - -------------------------------- (C) --------------------------------- - - Author: Mihai Bazon - - http://mihai.bazon.net/blog - - Distributed under the BSD license: - - Copyright 2012 (c) Mihai Bazon - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - * Redistributions of source code must retain the above - copyright notice, this list of conditions and the following - disclaimer. - - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials - provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY - EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR - TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF - THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - SUCH DAMAGE. - - ***********************************************************************/ - -"use strict"; - -function SymbolDef(id, scope, orig, init) { - this._bits = 0; - this.defun = undefined; - this.eliminated = 0; - this.id = id; - this.init = init; - this.mangled_name = null; - this.name = orig.name; - this.orig = [ orig ]; - this.references = []; - this.replaced = 0; - this.safe_ids = undefined; - this.scope = scope; -} - -SymbolDef.prototype = { - forEach: function(fn) { - this.orig.forEach(fn); - this.references.forEach(fn); - }, - mangle: function(options) { - if (this.mangled_name) return; - var cache = this.global && options.cache && options.cache.props; - if (cache && cache.has(this.name)) { - this.mangled_name = cache.get(this.name); - } else if (this.unmangleable(options)) { - names_in_use(this.scope, options).set(this.name, true); - } else { - var def = this.redefined(); - if (def) { - this.mangled_name = def.mangled_name || def.name; - } else { - this.mangled_name = next_mangled_name(this, options); - } - if (cache) cache.set(this.name, this.mangled_name); - } - }, - redefined: function() { - var self = this; - var scope = self.defun; - if (!scope) return; - var name = self.name; - var def = scope.variables.get(name) - || scope instanceof AST_Toplevel && scope.globals.get(name) - || self.orig[0] instanceof AST_SymbolConst && find_if(function(def) { - return def.name == name; - }, scope.enclosed); - if (def && def !== self) return def.redefined() || def; - }, - unmangleable: function(options) { - if (this.exported) return true; - if (this.undeclared) return true; - if (!options.eval && this.scope.pinned()) return true; - if (options.keep_fargs && is_funarg(this)) return true; - if (options.keep_fnames) { - var sym = this.orig[0]; - if (sym instanceof AST_SymbolClass) return true; - if (sym instanceof AST_SymbolDefClass) return true; - if (sym instanceof AST_SymbolDefun) return true; - if (sym instanceof AST_SymbolLambda) return true; - } - if (!options.toplevel && this.global) return true; - return false; - }, -}; - -DEF_BITPROPS(SymbolDef, [ - "const_redefs", - "cross_loop", - "direct_access", - "exported", - "global", - "undeclared", -]); - -function is_funarg(def) { - return def.orig[0] instanceof AST_SymbolFunarg || def.orig[1] instanceof AST_SymbolFunarg; -} - -var unary_side_effects = makePredicate("delete ++ --"); - -function is_lhs(node, parent) { - if (parent instanceof AST_Assign) return parent.left === node && node; - if (parent instanceof AST_DefaultValue) return parent.name === node && node; - if (parent instanceof AST_Destructured) return node; - if (parent instanceof AST_DestructuredKeyVal) return node; - if (parent instanceof AST_ForEnumeration) return parent.init === node && node; - if (parent instanceof AST_Unary) return unary_side_effects[parent.operator] && parent.expression; -} - -AST_Toplevel.DEFMETHOD("figure_out_scope", function(options) { - options = defaults(options, { - cache: null, - ie: false, - }); - - // pass 1: setup scope chaining and handle definitions - var self = this; - var defun = null; - var exported = false; - var next_def_id = 0; - var scope = self.parent_scope = null; - var tw = new TreeWalker(function(node, descend) { - if (node instanceof AST_DefClass) { - var save_exported = exported; - exported = tw.parent() instanceof AST_ExportDeclaration; - node.name.walk(tw); - exported = save_exported; - walk_scope(function() { - if (node.extends) node.extends.walk(tw); - node.properties.forEach(function(prop) { - prop.walk(tw); - }); - }); - return true; - } - if (node instanceof AST_Definitions) { - var save_exported = exported; - exported = tw.parent() instanceof AST_ExportDeclaration; - descend(); - exported = save_exported; - return true; - } - if (node instanceof AST_LambdaDefinition) { - var save_exported = exported; - exported = tw.parent() instanceof AST_ExportDeclaration; - node.name.walk(tw); - exported = save_exported; - walk_scope(function() { - node.argnames.forEach(function(argname) { - argname.walk(tw); - }); - if (node.rest) node.rest.walk(tw); - walk_body(node, tw); - }); - return true; - } - if (node instanceof AST_SwitchBranch) { - node.init_vars(scope); - descend(); - return true; - } - if (node instanceof AST_Try) { - walk_scope(function() { - walk_body(node, tw); - }); - if (node.bcatch) node.bcatch.walk(tw); - if (node.bfinally) node.bfinally.walk(tw); - return true; - } - if (node instanceof AST_With) { - var s = scope; - do { - s = s.resolve(); - if (s.uses_with) break; - s.uses_with = true; - } while (s = s.parent_scope); - walk_scope(descend); - return true; - } - if (node instanceof AST_BlockScope) { - walk_scope(descend); - return true; - } - if (node instanceof AST_Symbol) { - node.scope = scope; - } - if (node instanceof AST_Label) { - node.thedef = node; - node.references = []; - } - if (node instanceof AST_SymbolCatch) { - scope.def_variable(node).defun = defun; - } else if (node instanceof AST_SymbolConst) { - var def = scope.def_variable(node); - def.defun = defun; - if (exported) def.exported = true; - } else if (node instanceof AST_SymbolDefun) { - var def = defun.def_function(node, tw.parent()); - if (exported) def.exported = true; - } else if (node instanceof AST_SymbolFunarg) { - defun.def_variable(node); - } else if (node instanceof AST_SymbolLambda) { - var def = defun.def_function(node, node.name == "arguments" ? undefined : defun); - if (options.ie && node.name != "arguments") def.defun = defun.parent_scope.resolve(); - } else if (node instanceof AST_SymbolLet) { - var def = scope.def_variable(node); - if (exported) def.exported = true; - } else if (node instanceof AST_SymbolVar) { - var def = defun.def_variable(node, node instanceof AST_SymbolImport ? undefined : null); - if (exported) def.exported = true; - } - - function walk_scope(descend) { - node.init_vars(scope); - var save_defun = defun; - var save_scope = scope; - if (node instanceof AST_Scope) defun = node; - scope = node; - descend(); - scope = save_scope; - defun = save_defun; - } - }); - self.make_def = function(orig, init) { - return new SymbolDef(++next_def_id, this, orig, init); - }; - self.walk(tw); - - // pass 2: find back references and eval - self.globals = new Dictionary(); - var in_arg = []; - var tw = new TreeWalker(function(node) { - if (node instanceof AST_Catch) { - if (!(node.argname instanceof AST_Destructured)) return; - in_arg.push(node); - node.argname.walk(tw); - in_arg.pop(); - walk_body(node, tw); - return true; - } - if (node instanceof AST_Lambda) { - in_arg.push(node); - if (node.name) node.name.walk(tw); - node.argnames.forEach(function(argname) { - argname.walk(tw); - }); - if (node.rest) node.rest.walk(tw); - in_arg.pop(); - walk_lambda(node, tw); - return true; - } - if (node instanceof AST_LoopControl) { - if (node.label) node.label.thedef.references.push(node); - return true; - } - if (node instanceof AST_SymbolDeclaration) { - var def = node.definition(); - def.preinit = def.references.length; - if (node instanceof AST_SymbolCatch) { - // ensure mangling works if `catch` reuses a scope variable - var redef = def.redefined(); - if (redef) for (var s = node.scope; s; s = s.parent_scope) { - if (!push_uniq(s.enclosed, redef)) break; - if (s === redef.scope) break; - } - } else if (node instanceof AST_SymbolConst) { - // ensure compression works if `const` reuses a scope variable - var redef = def.redefined(); - if (redef) redef.const_redefs = true; - } else if (def.scope !== node.scope && (node instanceof AST_SymbolDefun - || node instanceof AST_SymbolFunarg - || node instanceof AST_SymbolVar)) { - node.mark_enclosed(options); - var redef = node.scope.find_variable(node.name); - if (node.thedef !== redef) { - node.thedef = redef; - redef.orig.push(node); - node.mark_enclosed(options); - } - } - if (node.name != "arguments") return true; - var parent = node instanceof AST_SymbolVar && tw.parent(); - if (parent instanceof AST_VarDef && !parent.value) return true; - var sym = node.scope.resolve().find_variable("arguments"); - if (sym && is_arguments(sym)) sym.scope.uses_arguments = 3; - return true; - } - if (node instanceof AST_SymbolRef) { - var name = node.name; - var sym = node.scope.find_variable(name); - for (var i = in_arg.length; i > 0 && sym;) { - i = in_arg.lastIndexOf(sym.scope, i - 1); - if (i < 0) break; - var decl = sym.orig[0]; - if (decl instanceof AST_SymbolCatch - || decl instanceof AST_SymbolFunarg - || decl instanceof AST_SymbolLambda) { - node.in_arg = true; - break; - } - sym = sym.scope.parent_scope.find_variable(name); - } - if (!sym) { - sym = self.def_global(node); - } else if (name == "arguments" && is_arguments(sym)) { - var parent = tw.parent(); - if (is_lhs(node, parent)) { - sym.scope.uses_arguments = 3; - } else if (sym.scope.uses_arguments < 2 - && !(parent instanceof AST_PropAccess && parent.expression === node)) { - sym.scope.uses_arguments = 2; - } else if (!sym.scope.uses_arguments) { - sym.scope.uses_arguments = true; - } - } - if (name == "eval") { - var parent = tw.parent(); - if (parent.TYPE == "Call" && parent.expression === node) { - var s = node.scope; - do { - s = s.resolve(); - if (s.uses_eval) break; - s.uses_eval = true; - } while (s = s.parent_scope); - } else if (sym.undeclared) { - self.uses_eval = true; - } - } - if (sym.init instanceof AST_LambdaDefinition && sym.scope !== sym.init.name.scope) { - var scope = node.scope; - do { - if (scope === sym.init.name.scope) break; - } while (scope = scope.parent_scope); - if (!scope) sym.init = undefined; - } - node.thedef = sym; - node.reference(options); - return true; - } - }); - self.walk(tw); - - // pass 3: fix up any scoping issue with IE8 - if (options.ie) self.walk(new TreeWalker(function(node) { - if (node instanceof AST_SymbolCatch) { - var def = node.thedef; - var scope = def.defun; - if (def.name != "arguments" && scope.name instanceof AST_SymbolLambda && scope.name.name == def.name) { - scope = scope.parent_scope.resolve(); - } - redefine(node, scope); - return true; - } - if (node instanceof AST_SymbolLambda) { - var def = node.thedef; - if (!redefine(node, node.scope.parent_scope.resolve())) { - def.defun = undefined; - } else if (typeof node.thedef.init !== "undefined") { - node.thedef.init = false; - } else if (def.init) { - node.thedef.init = def.init; - } - return true; - } - })); - - function is_arguments(sym) { - return sym.orig[0] instanceof AST_SymbolFunarg - && !(sym.orig[1] instanceof AST_SymbolFunarg || sym.orig[2] instanceof AST_SymbolFunarg) - && !is_arrow(sym.scope); - } - - function redefine(node, scope) { - var name = node.name; - var old_def = node.thedef; - if (!all(old_def.orig, function(sym) { - return !(sym instanceof AST_SymbolConst || sym instanceof AST_SymbolLet); - })) return false; - var new_def = scope.find_variable(name); - if (new_def) { - var redef = new_def.redefined(); - if (redef) new_def = redef; - } else { - new_def = self.globals.get(name); - } - if (new_def) { - new_def.orig.push(node); - } else { - new_def = scope.def_variable(node); - } - if (new_def.undeclared) self.variables.set(name, new_def); - if (name == "arguments" && is_arguments(old_def) && node instanceof AST_SymbolLambda) return true; - old_def.defun = new_def.scope; - old_def.forEach(function(node) { - node.redef = old_def; - node.thedef = new_def; - node.reference(options); - }); - return true; - } -}); - -AST_Toplevel.DEFMETHOD("def_global", function(node) { - var globals = this.globals, name = node.name; - if (globals.has(name)) { - return globals.get(name); - } else { - var g = this.make_def(node); - g.undeclared = true; - g.global = true; - globals.set(name, g); - return g; - } -}); - -function init_block_vars(scope, parent) { - scope.enclosed = []; // variables from this or outer scope(s) that are referenced from this or inner scopes - scope.parent_scope = parent; // the parent scope (null if this is the top level) - scope.functions = new Dictionary(); // map name to AST_SymbolDefun (functions defined in this scope) - scope.variables = new Dictionary(); // map name to AST_SymbolVar (variables defined in this scope; includes functions) - if (parent) scope.make_def = parent.make_def; // top-level tracking of SymbolDef instances -} - -function init_scope_vars(scope, parent) { - init_block_vars(scope, parent); - scope.uses_eval = false; // will be set to true if this or nested scope uses the global `eval` - scope.uses_with = false; // will be set to true if this or some nested scope uses the `with` statement -} - -AST_BlockScope.DEFMETHOD("init_vars", function(parent_scope) { - init_block_vars(this, parent_scope); -}); -AST_Scope.DEFMETHOD("init_vars", function(parent_scope) { - init_scope_vars(this, parent_scope); -}); -AST_Arrow.DEFMETHOD("init_vars", function(parent_scope) { - init_scope_vars(this, parent_scope); - return this; -}); -AST_AsyncArrow.DEFMETHOD("init_vars", function(parent_scope) { - init_scope_vars(this, parent_scope); -}); -AST_Lambda.DEFMETHOD("init_vars", function(parent_scope) { - init_scope_vars(this, parent_scope); - this.uses_arguments = false; - this.def_variable(new AST_SymbolFunarg({ - name: "arguments", - scope: this, - start: this.start, - end: this.end, - })); - return this; -}); - -AST_Symbol.DEFMETHOD("mark_enclosed", function(options) { - var def = this.definition(); - for (var s = this.scope; s; s = s.parent_scope) { - if (!push_uniq(s.enclosed, def)) break; - if (!options) { - s._var_names = undefined; - } else { - if (options.keep_fargs && s instanceof AST_Lambda) s.each_argname(function(arg) { - push_uniq(def.scope.enclosed, arg.definition()); - }); - if (options.keep_fnames) s.functions.each(function(d) { - push_uniq(def.scope.enclosed, d); - }); - } - if (s === def.scope) break; - } -}); - -AST_Symbol.DEFMETHOD("reference", function(options) { - this.definition().references.push(this); - this.mark_enclosed(options); -}); - -AST_BlockScope.DEFMETHOD("find_variable", function(name) { - return this.variables.get(name) - || this.parent_scope && this.parent_scope.find_variable(name); -}); - -AST_BlockScope.DEFMETHOD("def_function", function(symbol, init) { - var def = this.def_variable(symbol, init); - if (!def.init || def.init instanceof AST_LambdaDefinition) def.init = init; - this.functions.set(symbol.name, def); - return def; -}); - -AST_BlockScope.DEFMETHOD("def_variable", function(symbol, init) { - var def = this.variables.get(symbol.name); - if (def) { - def.orig.push(symbol); - if (def.init instanceof AST_LambdaExpression) def.init = init; - } else { - def = this.make_def(symbol, init); - this.variables.set(symbol.name, def); - def.global = !this.parent_scope; - } - return symbol.thedef = def; -}); - -function names_in_use(scope, options) { - var names = scope.names_in_use; - if (!names) { - scope.cname = -1; - scope.cname_holes = []; - scope.names_in_use = names = new Dictionary(); - var cache = options.cache && options.cache.props; - scope.enclosed.forEach(function(def) { - if (def.unmangleable(options)) names.set(def.name, true); - if (def.global && cache && cache.has(def.name)) { - names.set(cache.get(def.name), true); - } - }); - } - return names; -} - -function next_mangled_name(def, options) { - var scope = def.scope; - var in_use = names_in_use(scope, options); - var holes = scope.cname_holes; - var names = new Dictionary(); - var scopes = [ scope ]; - def.forEach(function(sym) { - var scope = sym.scope; - do { - if (member(scope, scopes)) break; - names_in_use(scope, options).each(function(marker, name) { - names.set(name, marker); - }); - scopes.push(scope); - } while (scope = scope.parent_scope); - }); - var name; - for (var i = 0; i < holes.length; i++) { - name = base54(holes[i]); - if (names.has(name)) continue; - holes.splice(i, 1); - in_use.set(name, true); - return name; - } - while (true) { - name = base54(++scope.cname); - if (in_use.has(name) || RESERVED_WORDS[name] || options.reserved.has[name]) continue; - if (!names.has(name)) break; - holes.push(scope.cname); - } - in_use.set(name, true); - return name; -} - -AST_Symbol.DEFMETHOD("unmangleable", function(options) { - var def = this.definition(); - return !def || def.unmangleable(options); -}); - -// labels are always mangleable -AST_Label.DEFMETHOD("unmangleable", return_false); - -AST_Symbol.DEFMETHOD("definition", function() { - return this.thedef; -}); - -function _default_mangler_options(options) { - options = defaults(options, { - eval : false, - ie : false, - keep_fargs : false, - keep_fnames : false, - reserved : [], - toplevel : false, - v8 : false, - webkit : false, - }); - if (!Array.isArray(options.reserved)) options.reserved = []; - // Never mangle `arguments` - push_uniq(options.reserved, "arguments"); - options.reserved.has = makePredicate(options.reserved); - return options; -} - -// We only need to mangle declaration nodes. Special logic wired into the code -// generator will display the mangled name if it is present (and for -// `AST_SymbolRef`s it will use the mangled name of the `AST_SymbolDeclaration` -// that it points to). -AST_Toplevel.DEFMETHOD("mangle_names", function(options) { - options = _default_mangler_options(options); - if (options.cache && options.cache.props) { - var mangled_names = names_in_use(this, options); - options.cache.props.each(function(mangled_name) { - mangled_names.set(mangled_name, true); - }); - } - var cutoff = 36; - var lname = -1; - var redefined = []; - var tw = new TreeWalker(function(node, descend) { - var save_nesting; - if (node instanceof AST_BlockScope) { - // `lname` is incremented when we get to the `AST_Label` - if (node instanceof AST_LabeledStatement) save_nesting = lname; - if (options.webkit && node instanceof AST_IterationStatement && node.init instanceof AST_Let) { - node.init.definitions.forEach(function(defn) { - defn.name.match_symbol(function(sym) { - if (!(sym instanceof AST_SymbolLet)) return; - var def = sym.definition(); - var scope = sym.scope.parent_scope; - var redef = scope.def_variable(sym); - sym.thedef = def; - scope.to_mangle.push(redef); - def.redefined = function() { - return redef; - }; - }); - }, true); - } - var to_mangle = node.to_mangle = []; - node.variables.each(function(def) { - if (!defer_redef(def)) to_mangle.push(def); - }); - descend(); - if (options.cache && node instanceof AST_Toplevel) { - node.globals.each(mangle); - } - if (node instanceof AST_Defun && tw.has_directive("use asm")) { - var sym = new AST_SymbolRef(node.name); - sym.scope = node; - sym.reference(options); - } - if (to_mangle.length > cutoff) { - var indices = to_mangle.map(function(def, index) { - return index; - }).sort(function(i, j) { - return to_mangle[j].references.length - to_mangle[i].references.length || i - j; - }); - to_mangle = indices.slice(0, cutoff).sort(function(i, j) { - return i - j; - }).map(function(index) { - return to_mangle[index]; - }).concat(indices.slice(cutoff).sort(function(i, j) { - return i - j; - }).map(function(index) { - return to_mangle[index]; - })); - } - to_mangle.forEach(mangle); - if (node instanceof AST_LabeledStatement && !(options.v8 && in_label(tw))) lname = save_nesting; - return true; - } - if (node instanceof AST_Label) { - var name; - do { - name = base54(++lname); - } while (RESERVED_WORDS[name]); - node.mangled_name = name; - return true; - } - }); - this.walk(tw); - redefined.forEach(mangle); - - function mangle(def) { - if (options.reserved.has[def.name]) return; - def.mangle(options); - } - - function defer_redef(def) { - var sym = def.orig[0]; - var redef = def.redefined(); - if (!redef) { - if (!(sym instanceof AST_SymbolConst)) return false; - var scope = def.scope.resolve(); - if (def.scope === scope) return false; - if (def.scope.parent_scope.find_variable(sym.name)) return false; - redef = scope.def_variable(sym); - scope.to_mangle.push(redef); - } - redefined.push(def); - def.references.forEach(reference); - if (sym instanceof AST_SymbolCatch || sym instanceof AST_SymbolConst) { - reference(sym); - def.redefined = function() { - return redef; - }; - } - return true; - - function reference(sym) { - sym.thedef = redef; - sym.reference(options); - sym.thedef = def; - } - } - - function in_label(tw) { - var level = 0, parent; - while (parent = tw.parent(level++)) { - if (parent instanceof AST_Block) return parent instanceof AST_Toplevel && !options.toplevel; - if (parent instanceof AST_LabeledStatement) return true; - } - } -}); - -AST_Toplevel.DEFMETHOD("find_colliding_names", function(options) { - var cache = options.cache && options.cache.props; - var avoid = Object.create(RESERVED_WORDS); - options.reserved.forEach(to_avoid); - this.globals.each(add_def); - this.walk(new TreeWalker(function(node) { - if (node instanceof AST_BlockScope) node.variables.each(add_def); - })); - return avoid; - - function to_avoid(name) { - avoid[name] = true; - } - - function add_def(def) { - var name = def.name; - if (def.global && cache && cache.has(name)) name = cache.get(name); - else if (!def.unmangleable(options)) return; - to_avoid(name); - } -}); - -AST_Toplevel.DEFMETHOD("expand_names", function(options) { - base54.reset(); - base54.sort(); - options = _default_mangler_options(options); - var avoid = this.find_colliding_names(options); - var cname = 0; - this.globals.each(rename); - this.walk(new TreeWalker(function(node) { - if (node instanceof AST_BlockScope) node.variables.each(rename); - })); - - function next_name() { - var name; - do { - name = base54(cname++); - } while (avoid[name]); - return name; - } - - function rename(def) { - if (def.global && options.cache) return; - if (def.unmangleable(options)) return; - if (options.reserved.has[def.name]) return; - var redef = def.redefined(); - var name = redef ? redef.rename || redef.name : next_name(); - def.rename = name; - def.forEach(function(sym) { - if (sym.definition() === def) sym.name = name; - }); - } -}); - -AST_Node.DEFMETHOD("tail_node", return_this); -AST_Sequence.DEFMETHOD("tail_node", function() { - return this.expressions[this.expressions.length - 1]; -}); - -AST_Toplevel.DEFMETHOD("compute_char_frequency", function(options) { - options = _default_mangler_options(options); - base54.reset(); - var fn = AST_Symbol.prototype.add_source_map; - try { - AST_Symbol.prototype.add_source_map = function() { - if (!this.unmangleable(options)) base54.consider(this.name, -1); - }; - if (options.properties) { - AST_Dot.prototype.add_source_map = function() { - base54.consider(this.property, -1); - }; - AST_Sub.prototype.add_source_map = function() { - skip_string(this.property); - }; - } - base54.consider(this.print_to_string(), 1); - } finally { - AST_Symbol.prototype.add_source_map = fn; - delete AST_Dot.prototype.add_source_map; - delete AST_Sub.prototype.add_source_map; - } - base54.sort(); - - function skip_string(node) { - if (node instanceof AST_String) { - base54.consider(node.value, -1); - } else if (node instanceof AST_Conditional) { - skip_string(node.consequent); - skip_string(node.alternative); - } else if (node instanceof AST_Sequence) { - skip_string(node.tail_node()); - } - } -}); - -var base54 = (function() { - var freq = Object.create(null); - function init(chars) { - var array = []; - for (var i = 0; i < chars.length; i++) { - var ch = chars[i]; - array.push(ch); - freq[ch] = -1e-2 * i; - } - return array; - } - var digits = init("0123456789"); - var leading = init("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_"); - var chars, frequency; - function reset() { - chars = null; - frequency = Object.create(freq); - } - base54.consider = function(str, delta) { - for (var i = str.length; --i >= 0;) { - frequency[str[i]] += delta; - } - }; - function compare(a, b) { - return frequency[b] - frequency[a]; - } - base54.sort = function() { - chars = leading.sort(compare).concat(digits).sort(compare); - }; - base54.reset = reset; - reset(); - function base54(num) { - var ret = leading[num % 54]; - for (num = Math.floor(num / 54); --num >= 0; num >>= 6) { - ret += chars[num & 0x3F]; - } - return ret; - } - return base54; -})(); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/uglify-js/lib/sourcemap.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/uglify-js/lib/sourcemap.js deleted file mode 100644 index a230a44c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/uglify-js/lib/sourcemap.js +++ /dev/null @@ -1,195 +0,0 @@ -/*********************************************************************** - - A JavaScript tokenizer / parser / beautifier / compressor. - https://github.com/mishoo/UglifyJS - - -------------------------------- (C) --------------------------------- - - Author: Mihai Bazon - - http://mihai.bazon.net/blog - - Distributed under the BSD license: - - Copyright 2012 (c) Mihai Bazon - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - * Redistributions of source code must retain the above - copyright notice, this list of conditions and the following - disclaimer. - - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials - provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY - EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR - TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF - THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - SUCH DAMAGE. - - ***********************************************************************/ - -"use strict"; - -var vlq_char = characters("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"); -var vlq_bits = vlq_char.reduce(function(map, ch, bits) { - map[ch] = bits; - return map; -}, Object.create(null)); - -function vlq_decode(indices, str) { - var value = 0; - var shift = 0; - for (var i = 0, j = 0; i < str.length; i++) { - var bits = vlq_bits[str[i]]; - value += (bits & 31) << shift; - if (bits & 32) { - shift += 5; - } else { - indices[j++] += value & 1 ? 0x80000000 | -(value >> 1) : value >> 1; - value = shift = 0; - } - } - return j; -} - -function vlq_encode(num) { - var result = ""; - num = Math.abs(num) << 1 | num >>> 31; - do { - var bits = num & 31; - if (num >>>= 5) bits |= 32; - result += vlq_char[bits]; - } while (num); - return result; -} - -function create_array_map() { - var map = new Dictionary(); - var array = []; - array.index = function(name) { - var index = map.get(name); - if (!(index >= 0)) { - index = array.length; - array.push(name); - map.set(name, index); - } - return index; - }; - return array; -} - -function SourceMap(options) { - var sources = create_array_map(); - var sources_content = options.includeSources && new Dictionary(); - var names = create_array_map(); - var mappings = ""; - if (options.orig) Object.keys(options.orig).forEach(function(name) { - var map = options.orig[name]; - var indices = [ 0, 0, 1, 0, 0 ]; - options.orig[name] = { - names: map.names, - mappings: map.mappings.split(/;/).map(function(line) { - indices[0] = 0; - return line.split(/,/).map(function(segment) { - return indices.slice(0, vlq_decode(indices, segment)); - }); - }), - sources: map.sources, - }; - if (!sources_content || !map.sourcesContent) return; - for (var i = 0; i < map.sources.length; i++) { - var content = map.sourcesContent[i]; - if (content) sources_content.set(map.sources[i], content); - } - }); - var prev_source; - var generated_line = 1; - var generated_column = 0; - var source_index = 0; - var original_line = 1; - var original_column = 0; - var name_index = 0; - return { - add: options.orig ? function(source, gen_line, gen_col, orig_line, orig_col, name) { - var map = options.orig[source]; - if (map) { - var segments = map.mappings[orig_line - 1]; - if (!segments) return; - var indices; - for (var i = 0; i < segments.length; i++) { - var col = segments[i][0]; - if (orig_col >= col) indices = segments[i]; - if (orig_col <= col) break; - } - if (!indices || indices.length < 4) { - source = null; - } else { - source = map.sources[indices[1]]; - orig_line = indices[2]; - orig_col = indices[3]; - if (indices.length > 4) name = map.names[indices[4]]; - } - } - add(source, gen_line, gen_col, orig_line, orig_col, name); - } : add, - setSourceContent: sources_content ? function(source, content) { - if (!sources_content.has(source)) { - sources_content.set(source, content); - } - } : noop, - toString: function() { - return JSON.stringify({ - version: 3, - file: options.filename || undefined, - sourceRoot: options.root || undefined, - sources: sources, - sourcesContent: sources_content ? sources.map(function(source) { - return sources_content.get(source) || null; - }) : undefined, - names: names, - mappings: mappings, - }); - } - }; - - function add(source, gen_line, gen_col, orig_line, orig_col, name) { - if (prev_source == null && source == null) return; - prev_source = source; - if (generated_line < gen_line) { - generated_column = 0; - do { - mappings += ";"; - } while (++generated_line < gen_line); - } else if (mappings) { - mappings += ","; - } - mappings += vlq_encode(gen_col - generated_column); - generated_column = gen_col; - if (source == null) return; - var src_idx = sources.index(source); - mappings += vlq_encode(src_idx - source_index); - source_index = src_idx; - mappings += vlq_encode(orig_line - original_line); - original_line = orig_line; - mappings += vlq_encode(orig_col - original_column); - original_column = orig_col; - if (options.names && name != null) { - var name_idx = names.index(name); - mappings += vlq_encode(name_idx - name_index); - name_index = name_idx; - } - } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/uglify-js/lib/transform.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/uglify-js/lib/transform.js deleted file mode 100644 index dcf90dfa..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/uglify-js/lib/transform.js +++ /dev/null @@ -1,250 +0,0 @@ -/*********************************************************************** - - A JavaScript tokenizer / parser / beautifier / compressor. - https://github.com/mishoo/UglifyJS - - -------------------------------- (C) --------------------------------- - - Author: Mihai Bazon - - http://mihai.bazon.net/blog - - Distributed under the BSD license: - - Copyright 2012 (c) Mihai Bazon - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - * Redistributions of source code must retain the above - copyright notice, this list of conditions and the following - disclaimer. - - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials - provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY - EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR - TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF - THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - SUCH DAMAGE. - - ***********************************************************************/ - -"use strict"; - -function TreeTransformer(before, after) { - TreeWalker.call(this); - this.before = before; - this.after = after; -} -TreeTransformer.prototype = new TreeWalker; - -(function(DEF) { - function do_list(list, tw) { - return List(list, function(node) { - return node.transform(tw, true); - }); - } - - DEF(AST_Node, noop); - DEF(AST_LabeledStatement, function(self, tw) { - self.label = self.label.transform(tw); - self.body = self.body.transform(tw); - }); - DEF(AST_SimpleStatement, function(self, tw) { - self.body = self.body.transform(tw); - }); - DEF(AST_Block, function(self, tw) { - self.body = do_list(self.body, tw); - }); - DEF(AST_Do, function(self, tw) { - self.body = self.body.transform(tw); - self.condition = self.condition.transform(tw); - }); - DEF(AST_While, function(self, tw) { - self.condition = self.condition.transform(tw); - self.body = self.body.transform(tw); - }); - DEF(AST_For, function(self, tw) { - if (self.init) self.init = self.init.transform(tw); - if (self.condition) self.condition = self.condition.transform(tw); - if (self.step) self.step = self.step.transform(tw); - self.body = self.body.transform(tw); - }); - DEF(AST_ForEnumeration, function(self, tw) { - self.init = self.init.transform(tw); - self.object = self.object.transform(tw); - self.body = self.body.transform(tw); - }); - DEF(AST_With, function(self, tw) { - self.expression = self.expression.transform(tw); - self.body = self.body.transform(tw); - }); - DEF(AST_Exit, function(self, tw) { - if (self.value) self.value = self.value.transform(tw); - }); - DEF(AST_LoopControl, function(self, tw) { - if (self.label) self.label = self.label.transform(tw); - }); - DEF(AST_If, function(self, tw) { - self.condition = self.condition.transform(tw); - self.body = self.body.transform(tw); - if (self.alternative) self.alternative = self.alternative.transform(tw); - }); - DEF(AST_Switch, function(self, tw) { - self.expression = self.expression.transform(tw); - self.body = do_list(self.body, tw); - }); - DEF(AST_Case, function(self, tw) { - self.expression = self.expression.transform(tw); - self.body = do_list(self.body, tw); - }); - DEF(AST_Try, function(self, tw) { - self.body = do_list(self.body, tw); - if (self.bcatch) self.bcatch = self.bcatch.transform(tw); - if (self.bfinally) self.bfinally = self.bfinally.transform(tw); - }); - DEF(AST_Catch, function(self, tw) { - if (self.argname) self.argname = self.argname.transform(tw); - self.body = do_list(self.body, tw); - }); - DEF(AST_Definitions, function(self, tw) { - self.definitions = do_list(self.definitions, tw); - }); - DEF(AST_VarDef, function(self, tw) { - self.name = self.name.transform(tw); - if (self.value) self.value = self.value.transform(tw); - }); - DEF(AST_DefaultValue, function(self, tw) { - self.name = self.name.transform(tw); - self.value = self.value.transform(tw); - }); - DEF(AST_Lambda, function(self, tw) { - if (self.name) self.name = self.name.transform(tw); - self.argnames = do_list(self.argnames, tw); - if (self.rest) self.rest = self.rest.transform(tw); - self.body = do_list(self.body, tw); - }); - function transform_arrow(self, tw) { - self.argnames = do_list(self.argnames, tw); - if (self.rest) self.rest = self.rest.transform(tw); - if (self.value) { - self.value = self.value.transform(tw); - } else { - self.body = do_list(self.body, tw); - } - } - DEF(AST_Arrow, transform_arrow); - DEF(AST_AsyncArrow, transform_arrow); - DEF(AST_Class, function(self, tw) { - if (self.name) self.name = self.name.transform(tw); - if (self.extends) self.extends = self.extends.transform(tw); - self.properties = do_list(self.properties, tw); - }); - DEF(AST_ClassProperty, function(self, tw) { - if (self.key instanceof AST_Node) self.key = self.key.transform(tw); - if (self.value) self.value = self.value.transform(tw); - }); - DEF(AST_Call, function(self, tw) { - self.expression = self.expression.transform(tw); - self.args = do_list(self.args, tw); - }); - DEF(AST_Sequence, function(self, tw) { - self.expressions = do_list(self.expressions, tw); - }); - DEF(AST_Await, function(self, tw) { - self.expression = self.expression.transform(tw); - }); - DEF(AST_Yield, function(self, tw) { - if (self.expression) self.expression = self.expression.transform(tw); - }); - DEF(AST_Dot, function(self, tw) { - self.expression = self.expression.transform(tw); - }); - DEF(AST_Sub, function(self, tw) { - self.expression = self.expression.transform(tw); - self.property = self.property.transform(tw); - }); - DEF(AST_Spread, function(self, tw) { - self.expression = self.expression.transform(tw); - }); - DEF(AST_Unary, function(self, tw) { - self.expression = self.expression.transform(tw); - }); - DEF(AST_Binary, function(self, tw) { - self.left = self.left.transform(tw); - self.right = self.right.transform(tw); - }); - DEF(AST_Conditional, function(self, tw) { - self.condition = self.condition.transform(tw); - self.consequent = self.consequent.transform(tw); - self.alternative = self.alternative.transform(tw); - }); - DEF(AST_Array, function(self, tw) { - self.elements = do_list(self.elements, tw); - }); - DEF(AST_DestructuredArray, function(self, tw) { - self.elements = do_list(self.elements, tw); - if (self.rest) self.rest = self.rest.transform(tw); - }); - DEF(AST_DestructuredKeyVal, function(self, tw) { - if (self.key instanceof AST_Node) self.key = self.key.transform(tw); - self.value = self.value.transform(tw); - }); - DEF(AST_DestructuredObject, function(self, tw) { - self.properties = do_list(self.properties, tw); - if (self.rest) self.rest = self.rest.transform(tw); - }); - DEF(AST_Object, function(self, tw) { - self.properties = do_list(self.properties, tw); - }); - DEF(AST_ObjectProperty, function(self, tw) { - if (self.key instanceof AST_Node) self.key = self.key.transform(tw); - self.value = self.value.transform(tw); - }); - DEF(AST_ExportDeclaration, function(self, tw) { - self.body = self.body.transform(tw); - }); - DEF(AST_ExportDefault, function(self, tw) { - self.body = self.body.transform(tw); - }); - DEF(AST_ExportReferences, function(self, tw) { - self.properties = do_list(self.properties, tw); - }); - DEF(AST_Import, function(self, tw) { - if (self.all) self.all = self.all.transform(tw); - if (self.default) self.default = self.default.transform(tw); - if (self.properties) self.properties = do_list(self.properties, tw); - }); - DEF(AST_Template, function(self, tw) { - if (self.tag) self.tag = self.tag.transform(tw); - self.expressions = do_list(self.expressions, tw); - }); -})(function(node, descend) { - node.DEFMETHOD("transform", function(tw, in_list) { - var x, y; - tw.push(this); - if (tw.before) x = tw.before(this, descend, in_list); - if (typeof x === "undefined") { - x = this; - descend(x, tw); - if (tw.after) { - y = tw.after(x, in_list); - if (typeof y !== "undefined") x = y; - } - } - tw.pop(); - return x; - }); -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/uglify-js/lib/utils.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/uglify-js/lib/utils.js deleted file mode 100644 index 6faaa152..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/uglify-js/lib/utils.js +++ /dev/null @@ -1,287 +0,0 @@ -/*********************************************************************** - - A JavaScript tokenizer / parser / beautifier / compressor. - https://github.com/mishoo/UglifyJS - - -------------------------------- (C) --------------------------------- - - Author: Mihai Bazon - - http://mihai.bazon.net/blog - - Distributed under the BSD license: - - Copyright 2012 (c) Mihai Bazon - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - * Redistributions of source code must retain the above - copyright notice, this list of conditions and the following - disclaimer. - - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials - provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY - EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR - TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF - THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - SUCH DAMAGE. - - ***********************************************************************/ - -"use strict"; - -function characters(str) { - return str.split(""); -} - -function member(name, array) { - return array.indexOf(name) >= 0; -} - -function find_if(func, array) { - for (var i = array.length; --i >= 0;) if (func(array[i])) return array[i]; -} - -function configure_error_stack(fn) { - Object.defineProperty(fn.prototype, "stack", { - get: function() { - var err = new Error(this.message); - err.name = this.name; - try { - throw err; - } catch (e) { - return e.stack; - } - } - }); -} - -function DefaultsError(msg, defs) { - this.message = msg; - this.defs = defs; -} -DefaultsError.prototype = Object.create(Error.prototype); -DefaultsError.prototype.constructor = DefaultsError; -DefaultsError.prototype.name = "DefaultsError"; -configure_error_stack(DefaultsError); - -function defaults(args, defs, croak) { - if (croak) for (var i in args) { - if (HOP(args, i) && !HOP(defs, i)) throw new DefaultsError("`" + i + "` is not a supported option", defs); - } - for (var i in args) { - if (HOP(args, i)) defs[i] = args[i]; - } - return defs; -} - -function noop() {} -function return_false() { return false; } -function return_true() { return true; } -function return_this() { return this; } -function return_null() { return null; } - -var List = (function() { - function List(a, f) { - var ret = []; - for (var i = 0; i < a.length; i++) { - var val = f(a[i], i); - if (val === skip) continue; - if (val instanceof Splice) { - ret.push.apply(ret, val.v); - } else { - ret.push(val); - } - } - return ret; - } - List.is_op = function(val) { - return val === skip || val instanceof Splice; - }; - List.splice = function(val) { - return new Splice(val); - }; - var skip = List.skip = {}; - function Splice(val) { - this.v = val; - } - return List; -})(); - -function push_uniq(array, el) { - if (array.indexOf(el) < 0) return array.push(el); -} - -function string_template(text, props) { - return text.replace(/\{([^{}]+)\}/g, function(str, p) { - var value = p == "this" ? props : props[p]; - if (value instanceof AST_Node) return value.print_to_string(); - if (value instanceof AST_Token) return value.file + ":" + value.line + "," + value.col; - return value; - }); -} - -function remove(array, el) { - var index = array.indexOf(el); - if (index >= 0) array.splice(index, 1); -} - -function makePredicate(words) { - if (!Array.isArray(words)) words = words.split(" "); - var map = Object.create(null); - words.forEach(function(word) { - map[word] = true; - }); - return map; -} - -function all(array, predicate) { - for (var i = array.length; --i >= 0;) - if (!predicate(array[i], i)) - return false; - return true; -} - -function Dictionary() { - this.values = Object.create(null); -} -Dictionary.prototype = { - set: function(key, val) { - if (key == "__proto__") { - this.proto_value = val; - } else { - this.values[key] = val; - } - return this; - }, - add: function(key, val) { - var list = this.get(key); - if (list) { - list.push(val); - } else { - this.set(key, [ val ]); - } - return this; - }, - get: function(key) { - return key == "__proto__" ? this.proto_value : this.values[key]; - }, - del: function(key) { - if (key == "__proto__") { - delete this.proto_value; - } else { - delete this.values[key]; - } - return this; - }, - has: function(key) { - return key == "__proto__" ? "proto_value" in this : key in this.values; - }, - all: function(predicate) { - for (var i in this.values) - if (!predicate(this.values[i], i)) return false; - if ("proto_value" in this && !predicate(this.proto_value, "__proto__")) return false; - return true; - }, - each: function(f) { - for (var i in this.values) - f(this.values[i], i); - if ("proto_value" in this) f(this.proto_value, "__proto__"); - }, - size: function() { - return Object.keys(this.values).length + ("proto_value" in this); - }, - map: function(f) { - var ret = []; - for (var i in this.values) - ret.push(f(this.values[i], i)); - if ("proto_value" in this) ret.push(f(this.proto_value, "__proto__")); - return ret; - }, - clone: function() { - var ret = new Dictionary(); - this.each(function(value, i) { - ret.set(i, value); - }); - return ret; - }, - toObject: function() { - var obj = {}; - this.each(function(value, i) { - obj["$" + i] = value; - }); - return obj; - }, -}; -Dictionary.fromObject = function(obj) { - var dict = new Dictionary(); - for (var i in obj) - if (HOP(obj, i)) dict.set(i.slice(1), obj[i]); - return dict; -}; - -function HOP(obj, prop) { - return Object.prototype.hasOwnProperty.call(obj, prop); -} - -// return true if the node at the top of the stack (that means the -// innermost node in the current output) is lexically the first in -// a statement. -function first_in_statement(stack, arrow, export_default) { - var node = stack.parent(-1); - for (var i = 0, p; p = stack.parent(i++); node = p) { - if (is_arrow(p)) { - return arrow && p.value === node; - } else if (p instanceof AST_Binary) { - if (p.left === node) continue; - } else if (p.TYPE == "Call") { - if (p.expression === node) continue; - } else if (p instanceof AST_Conditional) { - if (p.condition === node) continue; - } else if (p instanceof AST_ExportDefault) { - return export_default; - } else if (p instanceof AST_PropAccess) { - if (p.expression === node) continue; - } else if (p instanceof AST_Sequence) { - if (p.expressions[0] === node) continue; - } else if (p instanceof AST_SimpleStatement) { - return true; - } else if (p instanceof AST_Template) { - if (p.tag === node) continue; - } else if (p instanceof AST_UnaryPostfix) { - if (p.expression === node) continue; - } - return false; - } -} - -function DEF_BITPROPS(ctor, props) { - if (props.length > 31) throw new Error("Too many properties: " + props.length + "\n" + props.join(", ")); - props.forEach(function(name, pos) { - var mask = 1 << pos; - Object.defineProperty(ctor.prototype, name, { - get: function() { - return !!(this._bits & mask); - }, - set: function(val) { - if (val) - this._bits |= mask; - else - this._bits &= ~mask; - }, - }); - }); -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/uglify-js/package.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/uglify-js/package.json deleted file mode 100644 index 5776de16..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/uglify-js/package.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "name": "uglify-js", - "description": "JavaScript parser, mangler/compressor and beautifier toolkit", - "author": "Mihai Bazon (http://lisperator.net/)", - "license": "BSD-2-Clause", - "version": "3.17.4", - "engines": { - "node": ">=0.8.0" - }, - "maintainers": [ - "Alex Lam ", - "Mihai Bazon (http://lisperator.net/)" - ], - "repository": "mishoo/UglifyJS", - "main": "tools/node.js", - "bin": { - "uglifyjs": "bin/uglifyjs" - }, - "files": [ - "bin", - "lib", - "tools", - "LICENSE" - ], - "devDependencies": { - "acorn": "~8.7.1", - "semver": "~6.3.0" - }, - "scripts": { - "test": "node test/compress.js && node test/mocha.js" - }, - "keywords": [ - "cli", - "compress", - "compressor", - "ecma", - "ecmascript", - "es", - "es5", - "javascript", - "js", - "jsmin", - "min", - "minification", - "minifier", - "minify", - "optimize", - "optimizer", - "pack", - "packer", - "parse", - "parser", - "uglifier", - "uglify" - ] -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/uglify-js/tools/domprops.html b/packages/wyatt_notification_bloc/example/scripts/node_modules/uglify-js/tools/domprops.html deleted file mode 100644 index e217b173..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/uglify-js/tools/domprops.html +++ /dev/null @@ -1,456 +0,0 @@ - - - - - - diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/uglify-js/tools/domprops.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/uglify-js/tools/domprops.json deleted file mode 100644 index 1045429d..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/uglify-js/tools/domprops.json +++ /dev/null @@ -1,8325 +0,0 @@ -[ - "$&", - "$'", - "$*", - "$+", - "$1", - "$2", - "$3", - "$4", - "$5", - "$6", - "$7", - "$8", - "$9", - "$_", - "$`", - "$input", - "-moz-animation", - "-moz-animation-delay", - "-moz-animation-direction", - "-moz-animation-duration", - "-moz-animation-fill-mode", - "-moz-animation-iteration-count", - "-moz-animation-name", - "-moz-animation-play-state", - "-moz-animation-timing-function", - "-moz-appearance", - "-moz-backface-visibility", - "-moz-binding", - "-moz-border-end", - "-moz-border-end-color", - "-moz-border-end-style", - "-moz-border-end-width", - "-moz-border-image", - "-moz-border-start", - "-moz-border-start-color", - "-moz-border-start-style", - "-moz-border-start-width", - "-moz-box-align", - "-moz-box-direction", - "-moz-box-flex", - "-moz-box-ordinal-group", - "-moz-box-orient", - "-moz-box-pack", - "-moz-box-sizing", - "-moz-column-count", - "-moz-column-fill", - "-moz-column-gap", - "-moz-column-rule", - "-moz-column-rule-color", - "-moz-column-rule-style", - "-moz-column-rule-width", - "-moz-column-width", - "-moz-columns", - "-moz-float-edge", - "-moz-font-feature-settings", - "-moz-font-language-override", - "-moz-force-broken-image-icon", - "-moz-hyphens", - "-moz-image-region", - "-moz-margin-end", - "-moz-margin-start", - "-moz-orient", - "-moz-outline-radius", - "-moz-outline-radius-bottomleft", - "-moz-outline-radius-bottomright", - "-moz-outline-radius-topleft", - "-moz-outline-radius-topright", - "-moz-padding-end", - "-moz-padding-start", - "-moz-perspective", - "-moz-perspective-origin", - "-moz-stack-sizing", - "-moz-tab-size", - "-moz-text-size-adjust", - "-moz-transform", - "-moz-transform-origin", - "-moz-transform-style", - "-moz-transition", - "-moz-transition-delay", - "-moz-transition-duration", - "-moz-transition-property", - "-moz-transition-timing-function", - "-moz-user-focus", - "-moz-user-input", - "-moz-user-modify", - "-moz-user-select", - "-moz-window-dragging", - "-webkit-align-content", - "-webkit-align-items", - "-webkit-align-self", - "-webkit-animation", - "-webkit-animation-delay", - "-webkit-animation-direction", - "-webkit-animation-duration", - "-webkit-animation-fill-mode", - "-webkit-animation-iteration-count", - "-webkit-animation-name", - "-webkit-animation-play-state", - "-webkit-animation-timing-function", - "-webkit-appearance", - "-webkit-backface-visibility", - "-webkit-background-clip", - "-webkit-background-origin", - "-webkit-background-size", - "-webkit-border-bottom-left-radius", - "-webkit-border-bottom-right-radius", - "-webkit-border-image", - "-webkit-border-radius", - "-webkit-border-top-left-radius", - "-webkit-border-top-right-radius", - "-webkit-box-align", - "-webkit-box-direction", - "-webkit-box-flex", - "-webkit-box-ordinal-group", - "-webkit-box-orient", - "-webkit-box-pack", - "-webkit-box-shadow", - "-webkit-box-sizing", - "-webkit-filter", - "-webkit-flex", - "-webkit-flex-basis", - "-webkit-flex-direction", - "-webkit-flex-flow", - "-webkit-flex-grow", - "-webkit-flex-shrink", - "-webkit-flex-wrap", - "-webkit-justify-content", - "-webkit-line-clamp", - "-webkit-mask", - "-webkit-mask-clip", - "-webkit-mask-composite", - "-webkit-mask-image", - "-webkit-mask-origin", - "-webkit-mask-position", - "-webkit-mask-position-x", - "-webkit-mask-position-y", - "-webkit-mask-repeat", - "-webkit-mask-size", - "-webkit-order", - "-webkit-perspective", - "-webkit-perspective-origin", - "-webkit-text-fill-color", - "-webkit-text-size-adjust", - "-webkit-text-stroke", - "-webkit-text-stroke-color", - "-webkit-text-stroke-width", - "-webkit-transform", - "-webkit-transform-origin", - "-webkit-transform-style", - "-webkit-transition", - "-webkit-transition-delay", - "-webkit-transition-duration", - "-webkit-transition-property", - "-webkit-transition-timing-function", - "-webkit-user-select", - "0", - "1", - "10", - "11", - "12", - "13", - "14", - "15", - "16", - "17", - "18", - "19", - "2", - "20", - "21", - "22", - "23", - "24", - "25", - "26", - "27", - "28", - "29", - "3", - "30", - "31", - "32", - "33", - "34", - "35", - "36", - "37", - "38", - "39", - "4", - "40", - "41", - "42", - "43", - "44", - "45", - "46", - "47", - "48", - "49", - "5", - "50", - "51", - "6", - "7", - "8", - "9", - "@@iterator", - "ABORT_ERR", - "ACTIVE", - "ACTIVE_ATTRIBUTES", - "ACTIVE_TEXTURE", - "ACTIVE_UNIFORMS", - "ACTIVE_UNIFORM_BLOCKS", - "ADDITION", - "ALIASED_LINE_WIDTH_RANGE", - "ALIASED_POINT_SIZE_RANGE", - "ALLOW_KEYBOARD_INPUT", - "ALLPASS", - "ALPHA", - "ALPHA_BITS", - "ALREADY_SIGNALED", - "ALT_MASK", - "ALWAYS", - "ANDROID", - "ANGLE_instanced_arrays", - "ANY_SAMPLES_PASSED", - "ANY_SAMPLES_PASSED_CONSERVATIVE", - "ANY_TYPE", - "ANY_UNORDERED_NODE_TYPE", - "APP_UPDATE", - "ARM", - "ARRAY_BUFFER", - "ARRAY_BUFFER_BINDING", - "ATTACHED_SHADERS", - "ATTRIBUTE_NODE", - "AT_TARGET", - "AbortController", - "AbortSignal", - "AbsoluteOrientationSensor", - "AbstractRange", - "Accelerometer", - "ActiveXObject", - "AddSearchProvider", - "AesGcmEncryptResult", - "AggregateError", - "AnalyserNode", - "Animation", - "AnimationEffect", - "AnimationEvent", - "AnimationPlaybackEvent", - "AnimationTimeline", - "AnonXMLHttpRequest", - "AppBannerPromptResult", - "ApplicationCache", - "ApplicationCacheErrorEvent", - "Array", - "ArrayBuffer", - "Atomics", - "Attr", - "Audio", - "AudioBuffer", - "AudioBufferSourceNode", - "AudioContext", - "AudioDestinationNode", - "AudioListener", - "AudioNode", - "AudioParam", - "AudioParamMap", - "AudioProcessingEvent", - "AudioScheduledSourceNode", - "AudioStreamTrack", - "AudioTrack", - "AudioTrackList", - "AudioWorklet", - "AudioWorkletNode", - "AuthenticatorAssertionResponse", - "AuthenticatorAttestationResponse", - "AuthenticatorResponse", - "AutocompleteErrorEvent", - "BACK", - "BAD_BOUNDARYPOINTS_ERR", - "BAD_REQUEST", - "BANDPASS", - "BLEND", - "BLEND_COLOR", - "BLEND_DST_ALPHA", - "BLEND_DST_RGB", - "BLEND_EQUATION", - "BLEND_EQUATION_ALPHA", - "BLEND_EQUATION_RGB", - "BLEND_SRC_ALPHA", - "BLEND_SRC_RGB", - "BLUE_BITS", - "BLUR", - "BOOL", - "BOOLEAN_TYPE", - "BOOL_VEC2", - "BOOL_VEC3", - "BOOL_VEC4", - "BOTH", - "BROWSER_DEFAULT_WEBGL", - "BUBBLING_PHASE", - "BUFFER_SIZE", - "BUFFER_USAGE", - "BYTE", - "BYTES_PER_ELEMENT", - "BackgroundFetchManager", - "BackgroundFetchRecord", - "BackgroundFetchRegistration", - "BarProp", - "BarcodeDetector", - "BaseAudioContext", - "BaseHref", - "BatteryManager", - "BeforeInstallPromptEvent", - "BeforeLoadEvent", - "BeforeUnloadEvent", - "BigInt", - "BigInt64Array", - "BigUint64Array", - "BiquadFilterNode", - "Blob", - "BlobEvent", - "Bluetooth", - "BluetoothCharacteristicProperties", - "BluetoothDevice", - "BluetoothRemoteGATTCharacteristic", - "BluetoothRemoteGATTDescriptor", - "BluetoothRemoteGATTServer", - "BluetoothRemoteGATTService", - "BluetoothUUID", - "BookmarkCollection", - "Boolean", - "BroadcastChannel", - "ByteLengthQueuingStrategy", - "CANNOT_RUN", - "CAPTURING_PHASE", - "CCW", - "CDATASection", - "CDATA_SECTION_NODE", - "CHANGE", - "CHARSET_RULE", - "CHECKING", - "CHROME_UPDATE", - "CLAMP_TO_EDGE", - "CLICK", - "CLOSED", - "CLOSING", - "COLOR", - "COLOR_ATTACHMENT0", - "COLOR_ATTACHMENT1", - "COLOR_ATTACHMENT10", - "COLOR_ATTACHMENT11", - "COLOR_ATTACHMENT12", - "COLOR_ATTACHMENT13", - "COLOR_ATTACHMENT14", - "COLOR_ATTACHMENT15", - "COLOR_ATTACHMENT2", - "COLOR_ATTACHMENT3", - "COLOR_ATTACHMENT4", - "COLOR_ATTACHMENT5", - "COLOR_ATTACHMENT6", - "COLOR_ATTACHMENT7", - "COLOR_ATTACHMENT8", - "COLOR_ATTACHMENT9", - "COLOR_BUFFER_BIT", - "COLOR_CLEAR_VALUE", - "COLOR_WRITEMASK", - "COMMENT_NODE", - "COMPARE_REF_TO_TEXTURE", - "COMPILE_STATUS", - "COMPRESSED_RGBA_S3TC_DXT1_EXT", - "COMPRESSED_RGBA_S3TC_DXT3_EXT", - "COMPRESSED_RGBA_S3TC_DXT5_EXT", - "COMPRESSED_RGB_S3TC_DXT1_EXT", - "COMPRESSED_TEXTURE_FORMATS", - "CONDITION_SATISFIED", - "CONFIGURATION_UNSUPPORTED", - "CONNECTING", - "CONSTANT_ALPHA", - "CONSTANT_COLOR", - "CONSTRAINT_ERR", - "CONTENT", - "CONTEXT_LOST_WEBGL", - "CONTROL_MASK", - "COPY_READ_BUFFER", - "COPY_READ_BUFFER_BINDING", - "COPY_WRITE_BUFFER", - "COPY_WRITE_BUFFER_BINDING", - "COUNTER_STYLE_RULE", - "CROS", - "CSS", - "CSS2Properties", - "CSSAnimation", - "CSSCharsetRule", - "CSSConditionRule", - "CSSCounterStyleRule", - "CSSFontFaceRule", - "CSSFontFeatureValuesRule", - "CSSGroupingRule", - "CSSImageValue", - "CSSImportRule", - "CSSKeyframeRule", - "CSSKeyframesRule", - "CSSKeywordValue", - "CSSMathInvert", - "CSSMathMax", - "CSSMathMin", - "CSSMathNegate", - "CSSMathProduct", - "CSSMathSum", - "CSSMathValue", - "CSSMatrixComponent", - "CSSMediaRule", - "CSSMozDocumentRule", - "CSSNameSpaceRule", - "CSSNamespaceRule", - "CSSNumericArray", - "CSSNumericValue", - "CSSPageRule", - "CSSPerspective", - "CSSPositionValue", - "CSSPrimitiveValue", - "CSSRotate", - "CSSRule", - "CSSRuleList", - "CSSScale", - "CSSSkew", - "CSSSkewX", - "CSSSkewY", - "CSSStyleDeclaration", - "CSSStyleRule", - "CSSStyleSheet", - "CSSStyleValue", - "CSSSupportsRule", - "CSSTransformComponent", - "CSSTransformValue", - "CSSTransition", - "CSSTranslate", - "CSSUnitValue", - "CSSUnknownRule", - "CSSUnparsedValue", - "CSSValue", - "CSSValueList", - "CSSVariableReferenceValue", - "CSSVariablesDeclaration", - "CSSVariablesRule", - "CSSViewportRule", - "CSS_ATTR", - "CSS_CM", - "CSS_COUNTER", - "CSS_CUSTOM", - "CSS_DEG", - "CSS_DIMENSION", - "CSS_EMS", - "CSS_EXS", - "CSS_FILTER_BLUR", - "CSS_FILTER_BRIGHTNESS", - "CSS_FILTER_CONTRAST", - "CSS_FILTER_CUSTOM", - "CSS_FILTER_DROP_SHADOW", - "CSS_FILTER_GRAYSCALE", - "CSS_FILTER_HUE_ROTATE", - "CSS_FILTER_INVERT", - "CSS_FILTER_OPACITY", - "CSS_FILTER_REFERENCE", - "CSS_FILTER_SATURATE", - "CSS_FILTER_SEPIA", - "CSS_GRAD", - "CSS_HZ", - "CSS_IDENT", - "CSS_IN", - "CSS_INHERIT", - "CSS_KHZ", - "CSS_MATRIX", - "CSS_MATRIX3D", - "CSS_MM", - "CSS_MS", - "CSS_NUMBER", - "CSS_PC", - "CSS_PERCENTAGE", - "CSS_PERSPECTIVE", - "CSS_PRIMITIVE_VALUE", - "CSS_PT", - "CSS_PX", - "CSS_RAD", - "CSS_RECT", - "CSS_RGBCOLOR", - "CSS_ROTATE", - "CSS_ROTATE3D", - "CSS_ROTATEX", - "CSS_ROTATEY", - "CSS_ROTATEZ", - "CSS_S", - "CSS_SCALE", - "CSS_SCALE3D", - "CSS_SCALEX", - "CSS_SCALEY", - "CSS_SCALEZ", - "CSS_SKEW", - "CSS_SKEWX", - "CSS_SKEWY", - "CSS_STRING", - "CSS_TRANSLATE", - "CSS_TRANSLATE3D", - "CSS_TRANSLATEX", - "CSS_TRANSLATEY", - "CSS_TRANSLATEZ", - "CSS_UNKNOWN", - "CSS_URI", - "CSS_VALUE_LIST", - "CSS_VH", - "CSS_VMAX", - "CSS_VMIN", - "CSS_VW", - "CULL_FACE", - "CULL_FACE_MODE", - "CURRENT_PROGRAM", - "CURRENT_QUERY", - "CURRENT_VERTEX_ATTRIB", - "CUSTOM", - "CW", - "Cache", - "CacheStorage", - "CanvasCaptureMediaStream", - "CanvasCaptureMediaStreamTrack", - "CanvasGradient", - "CanvasPattern", - "CanvasPixelArray", - "CanvasRenderingContext2D", - "CaretPosition", - "ChannelMergerNode", - "ChannelSplitterNode", - "CharacterData", - "Chrome PDF Plugin", - "Chrome PDF Viewer", - "ClientRect", - "ClientRectList", - "Clipboard", - "ClipboardEvent", - "ClipboardItem", - "CloseEvent", - "Collator", - "CollectGarbage", - "CommandEvent", - "Comment", - "CompileError", - "CompositionEvent", - "CompressionStream", - "Console", - "ConstantSourceNode", - "ControlRangeCollection", - "Controllers", - "ConvolverNode", - "Coordinates", - "CountQueuingStrategy", - "Counter", - "Credential", - "CredentialsContainer", - "Crypto", - "CryptoKey", - "CryptoOperation", - "CustomElementRegistry", - "CustomEvent", - "DATABASE_ERR", - "DATA_CLONE_ERR", - "DATA_ERR", - "DBLCLICK", - "DECR", - "DECR_WRAP", - "DELETE_STATUS", - "DEPTH", - "DEPTH24_STENCIL8", - "DEPTH32F_STENCIL8", - "DEPTH_ATTACHMENT", - "DEPTH_BITS", - "DEPTH_BUFFER_BIT", - "DEPTH_CLEAR_VALUE", - "DEPTH_COMPONENT", - "DEPTH_COMPONENT16", - "DEPTH_COMPONENT24", - "DEPTH_COMPONENT32F", - "DEPTH_FUNC", - "DEPTH_RANGE", - "DEPTH_STENCIL", - "DEPTH_STENCIL_ATTACHMENT", - "DEPTH_TEST", - "DEPTH_WRITEMASK", - "DEVICE_INELIGIBLE", - "DIRECTION_DOWN", - "DIRECTION_LEFT", - "DIRECTION_RIGHT", - "DIRECTION_UP", - "DISABLED", - "DISPATCH_REQUEST_ERR", - "DITHER", - "DOCUMENT_FRAGMENT_NODE", - "DOCUMENT_NODE", - "DOCUMENT_POSITION_CONTAINED_BY", - "DOCUMENT_POSITION_CONTAINS", - "DOCUMENT_POSITION_DISCONNECTED", - "DOCUMENT_POSITION_FOLLOWING", - "DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC", - "DOCUMENT_POSITION_PRECEDING", - "DOCUMENT_TYPE_NODE", - "DOMCursor", - "DOMError", - "DOMException", - "DOMImplementation", - "DOMImplementationLS", - "DOMMatrix", - "DOMMatrixReadOnly", - "DOMParser", - "DOMPoint", - "DOMPointReadOnly", - "DOMQuad", - "DOMRect", - "DOMRectList", - "DOMRectReadOnly", - "DOMRequest", - "DOMSTRING_SIZE_ERR", - "DOMSettableTokenList", - "DOMStringList", - "DOMStringMap", - "DOMTokenList", - "DOMTransactionEvent", - "DOM_DELTA_LINE", - "DOM_DELTA_PAGE", - "DOM_DELTA_PIXEL", - "DOM_INPUT_METHOD_DROP", - "DOM_INPUT_METHOD_HANDWRITING", - "DOM_INPUT_METHOD_IME", - "DOM_INPUT_METHOD_KEYBOARD", - "DOM_INPUT_METHOD_MULTIMODAL", - "DOM_INPUT_METHOD_OPTION", - "DOM_INPUT_METHOD_PASTE", - "DOM_INPUT_METHOD_SCRIPT", - "DOM_INPUT_METHOD_UNKNOWN", - "DOM_INPUT_METHOD_VOICE", - "DOM_KEY_LOCATION_JOYSTICK", - "DOM_KEY_LOCATION_LEFT", - "DOM_KEY_LOCATION_MOBILE", - "DOM_KEY_LOCATION_NUMPAD", - "DOM_KEY_LOCATION_RIGHT", - "DOM_KEY_LOCATION_STANDARD", - "DOM_VK_0", - "DOM_VK_1", - "DOM_VK_2", - "DOM_VK_3", - "DOM_VK_4", - "DOM_VK_5", - "DOM_VK_6", - "DOM_VK_7", - "DOM_VK_8", - "DOM_VK_9", - "DOM_VK_A", - "DOM_VK_ACCEPT", - "DOM_VK_ADD", - "DOM_VK_ALT", - "DOM_VK_ALTGR", - "DOM_VK_AMPERSAND", - "DOM_VK_ASTERISK", - "DOM_VK_AT", - "DOM_VK_ATTN", - "DOM_VK_B", - "DOM_VK_BACKSPACE", - "DOM_VK_BACK_QUOTE", - "DOM_VK_BACK_SLASH", - "DOM_VK_BACK_SPACE", - "DOM_VK_C", - "DOM_VK_CANCEL", - "DOM_VK_CAPS_LOCK", - "DOM_VK_CIRCUMFLEX", - "DOM_VK_CLEAR", - "DOM_VK_CLOSE_BRACKET", - "DOM_VK_CLOSE_CURLY_BRACKET", - "DOM_VK_CLOSE_PAREN", - "DOM_VK_COLON", - "DOM_VK_COMMA", - "DOM_VK_CONTEXT_MENU", - "DOM_VK_CONTROL", - "DOM_VK_CONVERT", - "DOM_VK_CRSEL", - "DOM_VK_CTRL", - "DOM_VK_D", - "DOM_VK_DECIMAL", - "DOM_VK_DELETE", - "DOM_VK_DIVIDE", - "DOM_VK_DOLLAR", - "DOM_VK_DOUBLE_QUOTE", - "DOM_VK_DOWN", - "DOM_VK_E", - "DOM_VK_EISU", - "DOM_VK_END", - "DOM_VK_ENTER", - "DOM_VK_EQUALS", - "DOM_VK_EREOF", - "DOM_VK_ESCAPE", - "DOM_VK_EXCLAMATION", - "DOM_VK_EXECUTE", - "DOM_VK_EXSEL", - "DOM_VK_F", - "DOM_VK_F1", - "DOM_VK_F10", - "DOM_VK_F11", - "DOM_VK_F12", - "DOM_VK_F13", - "DOM_VK_F14", - "DOM_VK_F15", - "DOM_VK_F16", - "DOM_VK_F17", - "DOM_VK_F18", - "DOM_VK_F19", - "DOM_VK_F2", - "DOM_VK_F20", - "DOM_VK_F21", - "DOM_VK_F22", - "DOM_VK_F23", - "DOM_VK_F24", - "DOM_VK_F25", - "DOM_VK_F26", - "DOM_VK_F27", - "DOM_VK_F28", - "DOM_VK_F29", - "DOM_VK_F3", - "DOM_VK_F30", - "DOM_VK_F31", - "DOM_VK_F32", - "DOM_VK_F33", - "DOM_VK_F34", - "DOM_VK_F35", - "DOM_VK_F36", - "DOM_VK_F4", - "DOM_VK_F5", - "DOM_VK_F6", - "DOM_VK_F7", - "DOM_VK_F8", - "DOM_VK_F9", - "DOM_VK_FINAL", - "DOM_VK_FRONT", - "DOM_VK_G", - "DOM_VK_GREATER_THAN", - "DOM_VK_H", - "DOM_VK_HANGUL", - "DOM_VK_HANJA", - "DOM_VK_HASH", - "DOM_VK_HELP", - "DOM_VK_HK_TOGGLE", - "DOM_VK_HOME", - "DOM_VK_HYPHEN_MINUS", - "DOM_VK_I", - "DOM_VK_INSERT", - "DOM_VK_J", - "DOM_VK_JUNJA", - "DOM_VK_K", - "DOM_VK_KANA", - "DOM_VK_KANJI", - "DOM_VK_L", - "DOM_VK_LEFT", - "DOM_VK_LEFT_TAB", - "DOM_VK_LESS_THAN", - "DOM_VK_M", - "DOM_VK_META", - "DOM_VK_MODECHANGE", - "DOM_VK_MULTIPLY", - "DOM_VK_N", - "DOM_VK_NONCONVERT", - "DOM_VK_NUMPAD0", - "DOM_VK_NUMPAD1", - "DOM_VK_NUMPAD2", - "DOM_VK_NUMPAD3", - "DOM_VK_NUMPAD4", - "DOM_VK_NUMPAD5", - "DOM_VK_NUMPAD6", - "DOM_VK_NUMPAD7", - "DOM_VK_NUMPAD8", - "DOM_VK_NUMPAD9", - "DOM_VK_NUM_LOCK", - "DOM_VK_O", - "DOM_VK_OEM_1", - "DOM_VK_OEM_102", - "DOM_VK_OEM_2", - "DOM_VK_OEM_3", - "DOM_VK_OEM_4", - "DOM_VK_OEM_5", - "DOM_VK_OEM_6", - "DOM_VK_OEM_7", - "DOM_VK_OEM_8", - "DOM_VK_OEM_COMMA", - "DOM_VK_OEM_MINUS", - "DOM_VK_OEM_PERIOD", - "DOM_VK_OEM_PLUS", - "DOM_VK_OPEN_BRACKET", - "DOM_VK_OPEN_CURLY_BRACKET", - "DOM_VK_OPEN_PAREN", - "DOM_VK_P", - "DOM_VK_PA1", - "DOM_VK_PAGEDOWN", - "DOM_VK_PAGEUP", - "DOM_VK_PAGE_DOWN", - "DOM_VK_PAGE_UP", - "DOM_VK_PAUSE", - "DOM_VK_PERCENT", - "DOM_VK_PERIOD", - "DOM_VK_PIPE", - "DOM_VK_PLAY", - "DOM_VK_PLUS", - "DOM_VK_PRINT", - "DOM_VK_PRINTSCREEN", - "DOM_VK_PROCESSKEY", - "DOM_VK_PROPERITES", - "DOM_VK_Q", - "DOM_VK_QUESTION_MARK", - "DOM_VK_QUOTE", - "DOM_VK_R", - "DOM_VK_REDO", - "DOM_VK_RETURN", - "DOM_VK_RIGHT", - "DOM_VK_S", - "DOM_VK_SCROLL_LOCK", - "DOM_VK_SELECT", - "DOM_VK_SEMICOLON", - "DOM_VK_SEPARATOR", - "DOM_VK_SHIFT", - "DOM_VK_SLASH", - "DOM_VK_SLEEP", - "DOM_VK_SPACE", - "DOM_VK_SUBTRACT", - "DOM_VK_T", - "DOM_VK_TAB", - "DOM_VK_TILDE", - "DOM_VK_U", - "DOM_VK_UNDERSCORE", - "DOM_VK_UNDO", - "DOM_VK_UNICODE", - "DOM_VK_UP", - "DOM_VK_V", - "DOM_VK_VOLUME_DOWN", - "DOM_VK_VOLUME_MUTE", - "DOM_VK_VOLUME_UP", - "DOM_VK_W", - "DOM_VK_WIN", - "DOM_VK_WINDOW", - "DOM_VK_WIN_ICO_00", - "DOM_VK_WIN_ICO_CLEAR", - "DOM_VK_WIN_ICO_HELP", - "DOM_VK_WIN_OEM_ATTN", - "DOM_VK_WIN_OEM_AUTO", - "DOM_VK_WIN_OEM_BACKTAB", - "DOM_VK_WIN_OEM_CLEAR", - "DOM_VK_WIN_OEM_COPY", - "DOM_VK_WIN_OEM_CUSEL", - "DOM_VK_WIN_OEM_ENLW", - "DOM_VK_WIN_OEM_FINISH", - "DOM_VK_WIN_OEM_FJ_JISHO", - "DOM_VK_WIN_OEM_FJ_LOYA", - "DOM_VK_WIN_OEM_FJ_MASSHOU", - "DOM_VK_WIN_OEM_FJ_ROYA", - "DOM_VK_WIN_OEM_FJ_TOUROKU", - "DOM_VK_WIN_OEM_JUMP", - "DOM_VK_WIN_OEM_PA1", - "DOM_VK_WIN_OEM_PA2", - "DOM_VK_WIN_OEM_PA3", - "DOM_VK_WIN_OEM_RESET", - "DOM_VK_WIN_OEM_WSCTRL", - "DOM_VK_X", - "DOM_VK_XF86XK_ADD_FAVORITE", - "DOM_VK_XF86XK_APPLICATION_LEFT", - "DOM_VK_XF86XK_APPLICATION_RIGHT", - "DOM_VK_XF86XK_AUDIO_CYCLE_TRACK", - "DOM_VK_XF86XK_AUDIO_FORWARD", - "DOM_VK_XF86XK_AUDIO_LOWER_VOLUME", - "DOM_VK_XF86XK_AUDIO_MEDIA", - "DOM_VK_XF86XK_AUDIO_MUTE", - "DOM_VK_XF86XK_AUDIO_NEXT", - "DOM_VK_XF86XK_AUDIO_PAUSE", - "DOM_VK_XF86XK_AUDIO_PLAY", - "DOM_VK_XF86XK_AUDIO_PREV", - "DOM_VK_XF86XK_AUDIO_RAISE_VOLUME", - "DOM_VK_XF86XK_AUDIO_RANDOM_PLAY", - "DOM_VK_XF86XK_AUDIO_RECORD", - "DOM_VK_XF86XK_AUDIO_REPEAT", - "DOM_VK_XF86XK_AUDIO_REWIND", - "DOM_VK_XF86XK_AUDIO_STOP", - "DOM_VK_XF86XK_AWAY", - "DOM_VK_XF86XK_BACK", - "DOM_VK_XF86XK_BACK_FORWARD", - "DOM_VK_XF86XK_BATTERY", - "DOM_VK_XF86XK_BLUE", - "DOM_VK_XF86XK_BLUETOOTH", - "DOM_VK_XF86XK_BOOK", - "DOM_VK_XF86XK_BRIGHTNESS_ADJUST", - "DOM_VK_XF86XK_CALCULATOR", - "DOM_VK_XF86XK_CALENDAR", - "DOM_VK_XF86XK_CD", - "DOM_VK_XF86XK_CLOSE", - "DOM_VK_XF86XK_COMMUNITY", - "DOM_VK_XF86XK_CONTRAST_ADJUST", - "DOM_VK_XF86XK_COPY", - "DOM_VK_XF86XK_CUT", - "DOM_VK_XF86XK_CYCLE_ANGLE", - "DOM_VK_XF86XK_DISPLAY", - "DOM_VK_XF86XK_DOCUMENTS", - "DOM_VK_XF86XK_DOS", - "DOM_VK_XF86XK_EJECT", - "DOM_VK_XF86XK_EXCEL", - "DOM_VK_XF86XK_EXPLORER", - "DOM_VK_XF86XK_FAVORITES", - "DOM_VK_XF86XK_FINANCE", - "DOM_VK_XF86XK_FORWARD", - "DOM_VK_XF86XK_FRAME_BACK", - "DOM_VK_XF86XK_FRAME_FORWARD", - "DOM_VK_XF86XK_GAME", - "DOM_VK_XF86XK_GO", - "DOM_VK_XF86XK_GREEN", - "DOM_VK_XF86XK_HIBERNATE", - "DOM_VK_XF86XK_HISTORY", - "DOM_VK_XF86XK_HOME_PAGE", - "DOM_VK_XF86XK_HOT_LINKS", - "DOM_VK_XF86XK_I_TOUCH", - "DOM_VK_XF86XK_KBD_BRIGHTNESS_DOWN", - "DOM_VK_XF86XK_KBD_BRIGHTNESS_UP", - "DOM_VK_XF86XK_KBD_LIGHT_ON_OFF", - "DOM_VK_XF86XK_LAUNCH0", - "DOM_VK_XF86XK_LAUNCH1", - "DOM_VK_XF86XK_LAUNCH2", - "DOM_VK_XF86XK_LAUNCH3", - "DOM_VK_XF86XK_LAUNCH4", - "DOM_VK_XF86XK_LAUNCH5", - "DOM_VK_XF86XK_LAUNCH6", - "DOM_VK_XF86XK_LAUNCH7", - "DOM_VK_XF86XK_LAUNCH8", - "DOM_VK_XF86XK_LAUNCH9", - "DOM_VK_XF86XK_LAUNCH_A", - "DOM_VK_XF86XK_LAUNCH_B", - "DOM_VK_XF86XK_LAUNCH_C", - "DOM_VK_XF86XK_LAUNCH_D", - "DOM_VK_XF86XK_LAUNCH_E", - "DOM_VK_XF86XK_LAUNCH_F", - "DOM_VK_XF86XK_LIGHT_BULB", - "DOM_VK_XF86XK_LOG_OFF", - "DOM_VK_XF86XK_MAIL", - "DOM_VK_XF86XK_MAIL_FORWARD", - "DOM_VK_XF86XK_MARKET", - "DOM_VK_XF86XK_MEETING", - "DOM_VK_XF86XK_MEMO", - "DOM_VK_XF86XK_MENU_KB", - "DOM_VK_XF86XK_MENU_PB", - "DOM_VK_XF86XK_MESSENGER", - "DOM_VK_XF86XK_MON_BRIGHTNESS_DOWN", - "DOM_VK_XF86XK_MON_BRIGHTNESS_UP", - "DOM_VK_XF86XK_MUSIC", - "DOM_VK_XF86XK_MY_COMPUTER", - "DOM_VK_XF86XK_MY_SITES", - "DOM_VK_XF86XK_NEW", - "DOM_VK_XF86XK_NEWS", - "DOM_VK_XF86XK_OFFICE_HOME", - "DOM_VK_XF86XK_OPEN", - "DOM_VK_XF86XK_OPEN_URL", - "DOM_VK_XF86XK_OPTION", - "DOM_VK_XF86XK_PASTE", - "DOM_VK_XF86XK_PHONE", - "DOM_VK_XF86XK_PICTURES", - "DOM_VK_XF86XK_POWER_DOWN", - "DOM_VK_XF86XK_POWER_OFF", - "DOM_VK_XF86XK_RED", - "DOM_VK_XF86XK_REFRESH", - "DOM_VK_XF86XK_RELOAD", - "DOM_VK_XF86XK_REPLY", - "DOM_VK_XF86XK_ROCKER_DOWN", - "DOM_VK_XF86XK_ROCKER_ENTER", - "DOM_VK_XF86XK_ROCKER_UP", - "DOM_VK_XF86XK_ROTATE_WINDOWS", - "DOM_VK_XF86XK_ROTATION_KB", - "DOM_VK_XF86XK_ROTATION_PB", - "DOM_VK_XF86XK_SAVE", - "DOM_VK_XF86XK_SCREEN_SAVER", - "DOM_VK_XF86XK_SCROLL_CLICK", - "DOM_VK_XF86XK_SCROLL_DOWN", - "DOM_VK_XF86XK_SCROLL_UP", - "DOM_VK_XF86XK_SEARCH", - "DOM_VK_XF86XK_SEND", - "DOM_VK_XF86XK_SHOP", - "DOM_VK_XF86XK_SPELL", - "DOM_VK_XF86XK_SPLIT_SCREEN", - "DOM_VK_XF86XK_STANDBY", - "DOM_VK_XF86XK_START", - "DOM_VK_XF86XK_STOP", - "DOM_VK_XF86XK_SUBTITLE", - "DOM_VK_XF86XK_SUPPORT", - "DOM_VK_XF86XK_SUSPEND", - "DOM_VK_XF86XK_TASK_PANE", - "DOM_VK_XF86XK_TERMINAL", - "DOM_VK_XF86XK_TIME", - "DOM_VK_XF86XK_TOOLS", - "DOM_VK_XF86XK_TOP_MENU", - "DOM_VK_XF86XK_TO_DO_LIST", - "DOM_VK_XF86XK_TRAVEL", - "DOM_VK_XF86XK_USER1KB", - "DOM_VK_XF86XK_USER2KB", - "DOM_VK_XF86XK_USER_PB", - "DOM_VK_XF86XK_UWB", - "DOM_VK_XF86XK_VENDOR_HOME", - "DOM_VK_XF86XK_VIDEO", - "DOM_VK_XF86XK_VIEW", - "DOM_VK_XF86XK_WAKE_UP", - "DOM_VK_XF86XK_WEB_CAM", - "DOM_VK_XF86XK_WHEEL_BUTTON", - "DOM_VK_XF86XK_WLAN", - "DOM_VK_XF86XK_WORD", - "DOM_VK_XF86XK_WWW", - "DOM_VK_XF86XK_XFER", - "DOM_VK_XF86XK_YELLOW", - "DOM_VK_XF86XK_ZOOM_IN", - "DOM_VK_XF86XK_ZOOM_OUT", - "DOM_VK_Y", - "DOM_VK_Z", - "DOM_VK_ZOOM", - "DONE", - "DONT_CARE", - "DOWNLOADING", - "DRAGDROP", - "DRAW_BUFFER0", - "DRAW_BUFFER1", - "DRAW_BUFFER10", - "DRAW_BUFFER11", - "DRAW_BUFFER12", - "DRAW_BUFFER13", - "DRAW_BUFFER14", - "DRAW_BUFFER15", - "DRAW_BUFFER2", - "DRAW_BUFFER3", - "DRAW_BUFFER4", - "DRAW_BUFFER5", - "DRAW_BUFFER6", - "DRAW_BUFFER7", - "DRAW_BUFFER8", - "DRAW_BUFFER9", - "DRAW_FRAMEBUFFER", - "DRAW_FRAMEBUFFER_BINDING", - "DST_ALPHA", - "DST_COLOR", - "DYNAMIC_COPY", - "DYNAMIC_DRAW", - "DYNAMIC_READ", - "DataChannel", - "DataCue", - "DataTransfer", - "DataTransferItem", - "DataTransferItemList", - "DataView", - "Database", - "Date", - "DateTimeFormat", - "Debug", - "DecompressionStream", - "Default Browser Helper", - "DelayNode", - "DesktopNotification", - "DesktopNotificationCenter", - "DeviceAcceleration", - "DeviceLightEvent", - "DeviceMotionEvent", - "DeviceMotionEventAcceleration", - "DeviceMotionEventRotationRate", - "DeviceOrientationEvent", - "DeviceProximityEvent", - "DeviceRotationRate", - "DeviceStorage", - "DeviceStorageChangeEvent", - "Directory", - "DisplayNames", - "Document", - "DocumentFragment", - "DocumentTimeline", - "DocumentType", - "DragEvent", - "DynamicsCompressorNode", - "E", - "ELEMENT_ARRAY_BUFFER", - "ELEMENT_ARRAY_BUFFER_BINDING", - "ELEMENT_NODE", - "EMPTY", - "ENCODING_ERR", - "ENDED", - "END_TO_END", - "END_TO_START", - "ENTITY_NODE", - "ENTITY_REFERENCE_NODE", - "EPSILON", - "EQUAL", - "EQUALPOWER", - "ERROR", - "EXPONENTIAL_DISTANCE", - "EXT_texture_filter_anisotropic", - "Element", - "ElementInternals", - "ElementQuery", - "EnterPictureInPictureEvent", - "Entity", - "EntityReference", - "Enumerator", - "Error", - "ErrorEvent", - "EvalError", - "Event", - "EventException", - "EventSource", - "EventTarget", - "External", - "FASTEST", - "FIDOSDK", - "FILTER_ACCEPT", - "FILTER_INTERRUPT", - "FILTER_REJECT", - "FILTER_SKIP", - "FINISHED_STATE", - "FIRST_ORDERED_NODE_TYPE", - "FLOAT", - "FLOAT_32_UNSIGNED_INT_24_8_REV", - "FLOAT_MAT2", - "FLOAT_MAT2x3", - "FLOAT_MAT2x4", - "FLOAT_MAT3", - "FLOAT_MAT3x2", - "FLOAT_MAT3x4", - "FLOAT_MAT4", - "FLOAT_MAT4x2", - "FLOAT_MAT4x3", - "FLOAT_VEC2", - "FLOAT_VEC3", - "FLOAT_VEC4", - "FOCUS", - "FONT_FACE_RULE", - "FONT_FEATURE_VALUES_RULE", - "FRAGMENT_SHADER", - "FRAGMENT_SHADER_DERIVATIVE_HINT", - "FRAGMENT_SHADER_DERIVATIVE_HINT_OES", - "FRAMEBUFFER", - "FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE", - "FRAMEBUFFER_ATTACHMENT_BLUE_SIZE", - "FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING", - "FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE", - "FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE", - "FRAMEBUFFER_ATTACHMENT_GREEN_SIZE", - "FRAMEBUFFER_ATTACHMENT_OBJECT_NAME", - "FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE", - "FRAMEBUFFER_ATTACHMENT_RED_SIZE", - "FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE", - "FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE", - "FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER", - "FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL", - "FRAMEBUFFER_BINDING", - "FRAMEBUFFER_COMPLETE", - "FRAMEBUFFER_DEFAULT", - "FRAMEBUFFER_INCOMPLETE_ATTACHMENT", - "FRAMEBUFFER_INCOMPLETE_DIMENSIONS", - "FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT", - "FRAMEBUFFER_INCOMPLETE_MULTISAMPLE", - "FRAMEBUFFER_UNSUPPORTED", - "FRONT", - "FRONT_AND_BACK", - "FRONT_FACE", - "FUNC_ADD", - "FUNC_REVERSE_SUBTRACT", - "FUNC_SUBTRACT", - "FeaturePolicy", - "FederatedCredential", - "Feed", - "FeedEntry", - "File", - "FileError", - "FileList", - "FileReader", - "FileSystem", - "FileSystemDirectoryEntry", - "FileSystemDirectoryReader", - "FileSystemEntry", - "FileSystemFileEntry", - "FinalizationRegistry", - "FindInPage", - "Float32Array", - "Float64Array", - "FocusEvent", - "FontFace", - "FontFaceSet", - "FontFaceSetLoadEvent", - "FormData", - "FormDataEvent", - "FragmentDirective", - "Function", - "GENERATE_MIPMAP_HINT", - "GEQUAL", - "GREATER", - "GREEN_BITS", - "GainNode", - "Gamepad", - "GamepadButton", - "GamepadEvent", - "GamepadHapticActuator", - "GamepadPose", - "Geolocation", - "GeolocationCoordinates", - "GeolocationPosition", - "GeolocationPositionError", - "GestureEvent", - "Global", - "Gyroscope", - "HALF_FLOAT", - "HAVE_CURRENT_DATA", - "HAVE_ENOUGH_DATA", - "HAVE_FUTURE_DATA", - "HAVE_METADATA", - "HAVE_NOTHING", - "HEADERS_RECEIVED", - "HIDDEN", - "HIERARCHY_REQUEST_ERR", - "HIGHPASS", - "HIGHSHELF", - "HIGH_FLOAT", - "HIGH_INT", - "HORIZONTAL", - "HORIZONTAL_AXIS", - "HRTF", - "HTMLAllCollection", - "HTMLAnchorElement", - "HTMLAppletElement", - "HTMLAreaElement", - "HTMLAreasCollection", - "HTMLAudioElement", - "HTMLBGSoundElement", - "HTMLBRElement", - "HTMLBaseElement", - "HTMLBaseFontElement", - "HTMLBlockElement", - "HTMLBlockquoteElement", - "HTMLBodyElement", - "HTMLButtonElement", - "HTMLCanvasElement", - "HTMLCollection", - "HTMLCommandElement", - "HTMLContentElement", - "HTMLDDElement", - "HTMLDListElement", - "HTMLDTElement", - "HTMLDataElement", - "HTMLDataListElement", - "HTMLDetailsElement", - "HTMLDialogElement", - "HTMLDirectoryElement", - "HTMLDivElement", - "HTMLDocument", - "HTMLElement", - "HTMLEmbedElement", - "HTMLFieldSetElement", - "HTMLFontElement", - "HTMLFormControlsCollection", - "HTMLFormElement", - "HTMLFrameElement", - "HTMLFrameSetElement", - "HTMLHRElement", - "HTMLHeadElement", - "HTMLHeadingElement", - "HTMLHtmlElement", - "HTMLIFrameElement", - "HTMLImageElement", - "HTMLInputElement", - "HTMLIsIndexElement", - "HTMLKeygenElement", - "HTMLLIElement", - "HTMLLabelElement", - "HTMLLegendElement", - "HTMLLinkElement", - "HTMLMapElement", - "HTMLMarqueeElement", - "HTMLMediaElement", - "HTMLMenuElement", - "HTMLMenuItemElement", - "HTMLMetaElement", - "HTMLMeterElement", - "HTMLModElement", - "HTMLNextIdElement", - "HTMLOListElement", - "HTMLObjectElement", - "HTMLOptGroupElement", - "HTMLOptionElement", - "HTMLOptionsCollection", - "HTMLOutputElement", - "HTMLParagraphElement", - "HTMLParamElement", - "HTMLPhraseElement", - "HTMLPictureElement", - "HTMLPreElement", - "HTMLProgressElement", - "HTMLPropertiesCollection", - "HTMLQuoteElement", - "HTMLScriptElement", - "HTMLSelectElement", - "HTMLShadowElement", - "HTMLSlotElement", - "HTMLSourceElement", - "HTMLSpanElement", - "HTMLStyleElement", - "HTMLTableCaptionElement", - "HTMLTableCellElement", - "HTMLTableColElement", - "HTMLTableDataCellElement", - "HTMLTableElement", - "HTMLTableHeaderCellElement", - "HTMLTableRowElement", - "HTMLTableSectionElement", - "HTMLTemplateElement", - "HTMLTextAreaElement", - "HTMLTimeElement", - "HTMLTitleElement", - "HTMLTrackElement", - "HTMLUListElement", - "HTMLUnknownElement", - "HTMLVideoElement", - "HashChangeEvent", - "Headers", - "History", - "Hz", - "ICE_CHECKING", - "ICE_CLOSED", - "ICE_COMPLETED", - "ICE_CONNECTED", - "ICE_FAILED", - "ICE_GATHERING", - "ICE_WAITING", - "IDBCursor", - "IDBCursorWithValue", - "IDBDatabase", - "IDBDatabaseException", - "IDBFactory", - "IDBFileHandle", - "IDBFileRequest", - "IDBIndex", - "IDBKeyRange", - "IDBMutableFile", - "IDBObjectStore", - "IDBOpenDBRequest", - "IDBRequest", - "IDBTransaction", - "IDBVersionChangeEvent", - "IDLE", - "IIRFilterNode", - "IMPLEMENTATION_COLOR_READ_FORMAT", - "IMPLEMENTATION_COLOR_READ_TYPE", - "IMPORT_RULE", - "INCR", - "INCR_WRAP", - "INDEX_SIZE_ERR", - "INSTALL", - "INSTALLED", - "INT", - "INTERLEAVED_ATTRIBS", - "INT_2_10_10_10_REV", - "INT_SAMPLER_2D", - "INT_SAMPLER_2D_ARRAY", - "INT_SAMPLER_3D", - "INT_SAMPLER_CUBE", - "INT_VEC2", - "INT_VEC3", - "INT_VEC4", - "INUSE_ATTRIBUTE_ERR", - "INVALID_ACCESS_ERR", - "INVALID_CHARACTER_ERR", - "INVALID_ENUM", - "INVALID_EXPRESSION_ERR", - "INVALID_FRAMEBUFFER_OPERATION", - "INVALID_INDEX", - "INVALID_MODIFICATION_ERR", - "INVALID_NODE_TYPE_ERR", - "INVALID_OPERATION", - "INVALID_STATE_ERR", - "INVALID_VALUE", - "INVERSE_DISTANCE", - "INVERT", - "IceCandidate", - "IdleDeadline", - "Image", - "ImageBitmap", - "ImageBitmapRenderingContext", - "ImageCapture", - "ImageData", - "Infinity", - "InputDeviceCapabilities", - "InputDeviceInfo", - "InputEvent", - "InputMethodContext", - "InstallState", - "InstallTrigger", - "Instance", - "Int16Array", - "Int32Array", - "Int8Array", - "Intent", - "InternalError", - "IntersectionObserver", - "IntersectionObserverEntry", - "Intl", - "IsSearchProviderInstalled", - "Iterator", - "JSON", - "Java Deployment Toolkit 7.0.250.17", - "Java(TM) Platform SE 7 U25", - "KEEP", - "KEYDOWN", - "KEYFRAMES_RULE", - "KEYFRAME_RULE", - "KEYPRESS", - "KEYUP", - "Key", - "KeyEvent", - "KeyOperation", - "KeyPair", - "Keyboard", - "KeyboardEvent", - "KeyboardLayoutMap", - "KeyframeEffect", - "LENGTHADJUST_SPACING", - "LENGTHADJUST_SPACINGANDGLYPHS", - "LENGTHADJUST_UNKNOWN", - "LEQUAL", - "LESS", - "LINEAR", - "LINEAR_DISTANCE", - "LINEAR_MIPMAP_LINEAR", - "LINEAR_MIPMAP_NEAREST", - "LINES", - "LINE_LOOP", - "LINE_STRIP", - "LINE_WIDTH", - "LINK_STATUS", - "LINUX", - "LIVE", - "LN10", - "LN2", - "LOADED", - "LOADING", - "LOCALE", - "LOG10E", - "LOG2E", - "LOWPASS", - "LOWSHELF", - "LOW_FLOAT", - "LOW_INT", - "LSException", - "LSParserFilter", - "LUMINANCE", - "LUMINANCE_ALPHA", - "LargestContentfulPaint", - "LayoutShift", - "LayoutShiftAttribution", - "LinearAccelerationSensor", - "LinkError", - "ListFormat", - "LocalMediaStream", - "Locale", - "Location", - "Lock", - "LockManager", - "MAC", - "MAX", - "MAX_3D_TEXTURE_SIZE", - "MAX_ARRAY_TEXTURE_LAYERS", - "MAX_CLIENT_WAIT_TIMEOUT_WEBGL", - "MAX_COLOR_ATTACHMENTS", - "MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS", - "MAX_COMBINED_TEXTURE_IMAGE_UNITS", - "MAX_COMBINED_UNIFORM_BLOCKS", - "MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS", - "MAX_CUBE_MAP_TEXTURE_SIZE", - "MAX_DRAW_BUFFERS", - "MAX_ELEMENTS_INDICES", - "MAX_ELEMENTS_VERTICES", - "MAX_ELEMENT_INDEX", - "MAX_FRAGMENT_INPUT_COMPONENTS", - "MAX_FRAGMENT_UNIFORM_BLOCKS", - "MAX_FRAGMENT_UNIFORM_COMPONENTS", - "MAX_FRAGMENT_UNIFORM_VECTORS", - "MAX_PROGRAM_TEXEL_OFFSET", - "MAX_RENDERBUFFER_SIZE", - "MAX_SAFE_INTEGER", - "MAX_SAMPLES", - "MAX_SERVER_WAIT_TIMEOUT", - "MAX_TEXTURE_IMAGE_UNITS", - "MAX_TEXTURE_LOD_BIAS", - "MAX_TEXTURE_MAX_ANISOTROPY_EXT", - "MAX_TEXTURE_SIZE", - "MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS", - "MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS", - "MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS", - "MAX_UNIFORM_BLOCK_SIZE", - "MAX_UNIFORM_BUFFER_BINDINGS", - "MAX_VALUE", - "MAX_VARYING_COMPONENTS", - "MAX_VARYING_VECTORS", - "MAX_VERTEX_ATTRIBS", - "MAX_VERTEX_OUTPUT_COMPONENTS", - "MAX_VERTEX_TEXTURE_IMAGE_UNITS", - "MAX_VERTEX_UNIFORM_BLOCKS", - "MAX_VERTEX_UNIFORM_COMPONENTS", - "MAX_VERTEX_UNIFORM_VECTORS", - "MAX_VIEWPORT_DIMS", - "MEDIA_ERR_ABORTED", - "MEDIA_ERR_DECODE", - "MEDIA_ERR_ENCRYPTED", - "MEDIA_ERR_NETWORK", - "MEDIA_ERR_SRC_NOT_SUPPORTED", - "MEDIA_KEYERR_CLIENT", - "MEDIA_KEYERR_DOMAIN", - "MEDIA_KEYERR_HARDWARECHANGE", - "MEDIA_KEYERR_OUTPUT", - "MEDIA_KEYERR_SERVICE", - "MEDIA_KEYERR_UNKNOWN", - "MEDIA_RULE", - "MEDIUM_FLOAT", - "MEDIUM_INT", - "META_MASK", - "MIDIAccess", - "MIDIConnectionEvent", - "MIDIInput", - "MIDIInputMap", - "MIDIMessageEvent", - "MIDIOutput", - "MIDIOutputMap", - "MIDIPort", - "MIN", - "MIN_PROGRAM_TEXEL_OFFSET", - "MIN_SAFE_INTEGER", - "MIN_VALUE", - "MIRRORED_REPEAT", - "MODE_ASYNCHRONOUS", - "MODE_SYNCHRONOUS", - "MODIFICATION", - "MOUSEDOWN", - "MOUSEDRAG", - "MOUSEMOVE", - "MOUSEOUT", - "MOUSEOVER", - "MOUSEUP", - "MOZ_KEYFRAMES_RULE", - "MOZ_KEYFRAME_RULE", - "MOZ_SOURCE_CURSOR", - "MOZ_SOURCE_ERASER", - "MOZ_SOURCE_KEYBOARD", - "MOZ_SOURCE_MOUSE", - "MOZ_SOURCE_PEN", - "MOZ_SOURCE_TOUCH", - "MOZ_SOURCE_UNKNOWN", - "MSBehaviorUrnsCollection", - "MSBlobBuilder", - "MSCSSMatrix", - "MSCSSProperties", - "MSCSSRuleList", - "MSCompatibleInfo", - "MSCompatibleInfoCollection", - "MSCurrentStyleCSSProperties", - "MSEventObj", - "MSGESTURE_FLAG_BEGIN", - "MSGESTURE_FLAG_CANCEL", - "MSGESTURE_FLAG_END", - "MSGESTURE_FLAG_INERTIA", - "MSGESTURE_FLAG_NONE", - "MSGesture", - "MSGestureEvent", - "MSGraphicsTrust", - "MSInputMethodContext", - "MSManipulationEvent", - "MSMediaKeyError", - "MSMediaKeyMessageEvent", - "MSMediaKeyNeededEvent", - "MSMediaKeySession", - "MSMediaKeys", - "MSMimeTypesCollection", - "MSPOINTER_TYPE_MOUSE", - "MSPOINTER_TYPE_PEN", - "MSPOINTER_TYPE_TOUCH", - "MSPluginsCollection", - "MSPointerEvent", - "MSRangeCollection", - "MSSiteModeEvent", - "MSStream", - "MSStreamReader", - "MSStyleCSSProperties", - "MS_ASYNC_CALLBACK_STATUS_ASSIGN_DELEGATE", - "MS_ASYNC_CALLBACK_STATUS_CANCEL", - "MS_ASYNC_CALLBACK_STATUS_CHOOSEANY", - "MS_ASYNC_CALLBACK_STATUS_ERROR", - "MS_ASYNC_CALLBACK_STATUS_JOIN", - "MS_ASYNC_OP_STATUS_CANCELED", - "MS_ASYNC_OP_STATUS_ERROR", - "MS_ASYNC_OP_STATUS_SUCCESS", - "MS_MANIPULATION_STATE_ACTIVE", - "MS_MANIPULATION_STATE_CANCELLED", - "MS_MANIPULATION_STATE_COMMITTED", - "MS_MANIPULATION_STATE_DRAGGING", - "MS_MANIPULATION_STATE_INERTIA", - "MS_MANIPULATION_STATE_PRESELECT", - "MS_MANIPULATION_STATE_SELECTING", - "MS_MANIPULATION_STATE_STOPPED", - "MS_MEDIA_ERR_ENCRYPTED", - "MS_MEDIA_KEYERR_CLIENT", - "MS_MEDIA_KEYERR_DOMAIN", - "MS_MEDIA_KEYERR_HARDWARECHANGE", - "MS_MEDIA_KEYERR_OUTPUT", - "MS_MEDIA_KEYERR_SERVICE", - "MS_MEDIA_KEYERR_UNKNOWN", - "Map", - "Math", - "MathMLElement", - "MediaCapabilities", - "MediaCapabilitiesInfo", - "MediaController", - "MediaDeviceInfo", - "MediaDevices", - "MediaElementAudioSourceNode", - "MediaEncryptedEvent", - "MediaError", - "MediaKeyError", - "MediaKeyEvent", - "MediaKeyMessageEvent", - "MediaKeyNeededEvent", - "MediaKeySession", - "MediaKeyStatusMap", - "MediaKeySystemAccess", - "MediaKeys", - "MediaList", - "MediaMetadata", - "MediaQueryList", - "MediaQueryListEvent", - "MediaRecorder", - "MediaRecorderErrorEvent", - "MediaSession", - "MediaSettingsRange", - "MediaSource", - "MediaStream", - "MediaStreamAudioDestinationNode", - "MediaStreamAudioSourceNode", - "MediaStreamEvent", - "MediaStreamTrack", - "MediaStreamTrackAudioSourceNode", - "MediaStreamTrackEvent", - "Memory", - "MessageChannel", - "MessageEvent", - "MessagePort", - "Methods", - "Microsoft® DRM", - "MimeType", - "MimeTypeArray", - "Module", - "MouseEvent", - "MouseScrollEvent", - "MouseWheelEvent", - "MozAnimation", - "MozAnimationDelay", - "MozAnimationDirection", - "MozAnimationDuration", - "MozAnimationFillMode", - "MozAnimationIterationCount", - "MozAnimationName", - "MozAnimationPlayState", - "MozAnimationTimingFunction", - "MozAppearance", - "MozBackfaceVisibility", - "MozBinding", - "MozBorderBottomColors", - "MozBorderEnd", - "MozBorderEndColor", - "MozBorderEndStyle", - "MozBorderEndWidth", - "MozBorderImage", - "MozBorderLeftColors", - "MozBorderRightColors", - "MozBorderStart", - "MozBorderStartColor", - "MozBorderStartStyle", - "MozBorderStartWidth", - "MozBorderTopColors", - "MozBoxAlign", - "MozBoxDirection", - "MozBoxFlex", - "MozBoxOrdinalGroup", - "MozBoxOrient", - "MozBoxPack", - "MozBoxSizing", - "MozCSSKeyframeRule", - "MozCSSKeyframesRule", - "MozColumnCount", - "MozColumnFill", - "MozColumnGap", - "MozColumnRule", - "MozColumnRuleColor", - "MozColumnRuleStyle", - "MozColumnRuleWidth", - "MozColumnWidth", - "MozColumns", - "MozContactChangeEvent", - "MozFloatEdge", - "MozFontFeatureSettings", - "MozFontLanguageOverride", - "MozForceBrokenImageIcon", - "MozHyphens", - "MozImageRegion", - "MozMarginEnd", - "MozMarginStart", - "MozMmsEvent", - "MozMmsMessage", - "MozMobileMessageThread", - "MozOSXFontSmoothing", - "MozOrient", - "MozOutlineRadius", - "MozOutlineRadiusBottomleft", - "MozOutlineRadiusBottomright", - "MozOutlineRadiusTopleft", - "MozOutlineRadiusTopright", - "MozPaddingEnd", - "MozPaddingStart", - "MozPerspective", - "MozPerspectiveOrigin", - "MozPowerManager", - "MozSettingsEvent", - "MozSmsEvent", - "MozSmsMessage", - "MozStackSizing", - "MozTabSize", - "MozTextAlignLast", - "MozTextDecorationColor", - "MozTextDecorationLine", - "MozTextDecorationStyle", - "MozTextSizeAdjust", - "MozTransform", - "MozTransformOrigin", - "MozTransformStyle", - "MozTransition", - "MozTransitionDelay", - "MozTransitionDuration", - "MozTransitionProperty", - "MozTransitionTimingFunction", - "MozUserFocus", - "MozUserInput", - "MozUserModify", - "MozUserSelect", - "MozWindowDragging", - "MozWindowShadow", - "MutationEvent", - "MutationObserver", - "MutationRecord", - "NAMESPACE_ERR", - "NAMESPACE_RULE", - "NEAREST", - "NEAREST_MIPMAP_LINEAR", - "NEAREST_MIPMAP_NEAREST", - "NEGATIVE_INFINITY", - "NETWORK_EMPTY", - "NETWORK_ERR", - "NETWORK_IDLE", - "NETWORK_LOADED", - "NETWORK_LOADING", - "NETWORK_NO_SOURCE", - "NEVER", - "NEW", - "NEXT", - "NEXT_NO_DUPLICATE", - "NICEST", - "NODE_AFTER", - "NODE_BEFORE", - "NODE_BEFORE_AND_AFTER", - "NODE_INSIDE", - "NONE", - "NON_TRANSIENT_ERR", - "NOTATION_NODE", - "NOTCH", - "NOTEQUAL", - "NOT_ALLOWED_ERR", - "NOT_FOUND_ERR", - "NOT_INSTALLED", - "NOT_READABLE_ERR", - "NOT_SUPPORTED_ERR", - "NO_DATA_ALLOWED_ERR", - "NO_ERR", - "NO_ERROR", - "NO_MODIFICATION_ALLOWED_ERR", - "NO_UPDATE", - "NUMBER_TYPE", - "NUM_COMPRESSED_TEXTURE_FORMATS", - "NaN", - "NamedNodeMap", - "Native Client", - "NavigationPreloadManager", - "Navigator", - "NearbyLinks", - "NetworkInformation", - "Node", - "NodeFilter", - "NodeIterator", - "NodeList", - "Notation", - "Notification", - "NotifyPaintEvent", - "Number", - "NumberFormat", - "OBJECT_TYPE", - "OBSOLETE", - "OES_element_index_uint", - "OES_standard_derivatives", - "OES_texture_float", - "OES_texture_float_linear", - "OK", - "ONE", - "ONE_MINUS_CONSTANT_ALPHA", - "ONE_MINUS_CONSTANT_COLOR", - "ONE_MINUS_DST_ALPHA", - "ONE_MINUS_DST_COLOR", - "ONE_MINUS_SRC_ALPHA", - "ONE_MINUS_SRC_COLOR", - "OPEN", - "OPENBSD", - "OPENED", - "OPENING", - "ORDERED_NODE_ITERATOR_TYPE", - "ORDERED_NODE_SNAPSHOT_TYPE", - "OS_UPDATE", - "OTHER_ERROR", - "OUT_OF_MEMORY", - "Object", - "OfflineAudioCompletionEvent", - "OfflineAudioContext", - "OfflineResourceList", - "OffscreenCanvas", - "OffscreenCanvasRenderingContext2D", - "OnInstalledReason", - "OnRestartRequiredReason", - "Option", - "OrientationSensor", - "OscillatorNode", - "OverconstrainedError", - "OverconstrainedErrorEvent", - "OverflowEvent", - "PACKAGE", - "PACK_ALIGNMENT", - "PACK_ROW_LENGTH", - "PACK_SKIP_PIXELS", - "PACK_SKIP_ROWS", - "PAGE_RULE", - "PARSE_ERR", - "PATHSEG_ARC_ABS", - "PATHSEG_ARC_REL", - "PATHSEG_CLOSEPATH", - "PATHSEG_CURVETO_CUBIC_ABS", - "PATHSEG_CURVETO_CUBIC_REL", - "PATHSEG_CURVETO_CUBIC_SMOOTH_ABS", - "PATHSEG_CURVETO_CUBIC_SMOOTH_REL", - "PATHSEG_CURVETO_QUADRATIC_ABS", - "PATHSEG_CURVETO_QUADRATIC_REL", - "PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS", - "PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL", - "PATHSEG_LINETO_ABS", - "PATHSEG_LINETO_HORIZONTAL_ABS", - "PATHSEG_LINETO_HORIZONTAL_REL", - "PATHSEG_LINETO_REL", - "PATHSEG_LINETO_VERTICAL_ABS", - "PATHSEG_LINETO_VERTICAL_REL", - "PATHSEG_MOVETO_ABS", - "PATHSEG_MOVETO_REL", - "PATHSEG_UNKNOWN", - "PATH_EXISTS_ERR", - "PEAKING", - "PERIODIC", - "PERMISSION_DENIED", - "PERSISTENT", - "PI", - "PIXEL_PACK_BUFFER", - "PIXEL_PACK_BUFFER_BINDING", - "PIXEL_UNPACK_BUFFER", - "PIXEL_UNPACK_BUFFER_BINDING", - "PLAYING_STATE", - "POINTS", - "POLYGON_OFFSET_FACTOR", - "POLYGON_OFFSET_FILL", - "POLYGON_OFFSET_UNITS", - "POSITION_UNAVAILABLE", - "POSITIVE_INFINITY", - "PREV", - "PREV_NO_DUPLICATE", - "PROCESSING_INSTRUCTION_NODE", - "PageChangeEvent", - "PageTransitionEvent", - "PaintRequest", - "PaintRequestList", - "PannerNode", - "PasswordCredential", - "Path2D", - "PaymentAddress", - "PaymentInstruments", - "PaymentManager", - "PaymentMethodChangeEvent", - "PaymentRequest", - "PaymentRequestUpdateEvent", - "PaymentResponse", - "Performance", - "PerformanceElementTiming", - "PerformanceEntry", - "PerformanceEventTiming", - "PerformanceLongTaskTiming", - "PerformanceMark", - "PerformanceMeasure", - "PerformanceNavigation", - "PerformanceNavigationTiming", - "PerformanceObserver", - "PerformanceObserverEntryList", - "PerformancePaintTiming", - "PerformanceResourceTiming", - "PerformanceServerTiming", - "PerformanceTiming", - "PeriodicSyncManager", - "PeriodicWave", - "PermissionStatus", - "Permissions", - "PhotoCapabilities", - "PictureInPictureWindow", - "PlatformArch", - "PlatformNaclArch", - "PlatformOs", - "Plugin", - "PluginArray", - "PluralRules", - "PointerEvent", - "PopStateEvent", - "PopupBlockedEvent", - "Position", - "PositionError", - "Presentation", - "PresentationAvailability", - "PresentationConnection", - "PresentationConnectionAvailableEvent", - "PresentationConnectionCloseEvent", - "PresentationConnectionList", - "PresentationReceiver", - "PresentationRequest", - "ProcessingInstruction", - "ProgressEvent", - "Promise", - "PromiseRejectionEvent", - "PropertyNodeList", - "Proxy", - "PublicKeyCredential", - "PushManager", - "PushSubscription", - "PushSubscriptionOptions", - "Q", - "QUERY_RESULT", - "QUERY_RESULT_AVAILABLE", - "QUOTA_ERR", - "QUOTA_EXCEEDED_ERR", - "QueryInterface", - "R11F_G11F_B10F", - "R16F", - "R16I", - "R16UI", - "R32F", - "R32I", - "R32UI", - "R8", - "R8I", - "R8UI", - "R8_SNORM", - "RASTERIZER_DISCARD", - "READY_TO_RUN", - "READ_BUFFER", - "READ_FRAMEBUFFER", - "READ_FRAMEBUFFER_BINDING", - "READ_ONLY", - "READ_ONLY_ERR", - "READ_WRITE", - "RED", - "RED_BITS", - "RED_INTEGER", - "REMOVAL", - "RENDERBUFFER", - "RENDERBUFFER_ALPHA_SIZE", - "RENDERBUFFER_BINDING", - "RENDERBUFFER_BLUE_SIZE", - "RENDERBUFFER_DEPTH_SIZE", - "RENDERBUFFER_GREEN_SIZE", - "RENDERBUFFER_HEIGHT", - "RENDERBUFFER_INTERNAL_FORMAT", - "RENDERBUFFER_RED_SIZE", - "RENDERBUFFER_SAMPLES", - "RENDERBUFFER_STENCIL_SIZE", - "RENDERBUFFER_WIDTH", - "RENDERER", - "RENDERING_INTENT_ABSOLUTE_COLORIMETRIC", - "RENDERING_INTENT_AUTO", - "RENDERING_INTENT_PERCEPTUAL", - "RENDERING_INTENT_RELATIVE_COLORIMETRIC", - "RENDERING_INTENT_SATURATION", - "RENDERING_INTENT_UNKNOWN", - "REPEAT", - "REPLACE", - "RG", - "RG16F", - "RG16I", - "RG16UI", - "RG32F", - "RG32I", - "RG32UI", - "RG8", - "RG8I", - "RG8UI", - "RG8_SNORM", - "RGB", - "RGB10_A2", - "RGB10_A2UI", - "RGB16F", - "RGB16I", - "RGB16UI", - "RGB32F", - "RGB32I", - "RGB32UI", - "RGB565", - "RGB5_A1", - "RGB8", - "RGB8I", - "RGB8UI", - "RGB8_SNORM", - "RGB9_E5", - "RGBA", - "RGBA16F", - "RGBA16I", - "RGBA16UI", - "RGBA32F", - "RGBA32I", - "RGBA32UI", - "RGBA4", - "RGBA8", - "RGBA8I", - "RGBA8UI", - "RGBA8_SNORM", - "RGBA_INTEGER", - "RGBColor", - "RGB_INTEGER", - "RG_INTEGER", - "ROTATION_CLOCKWISE", - "ROTATION_COUNTERCLOCKWISE", - "RTCCertificate", - "RTCDTMFSender", - "RTCDTMFToneChangeEvent", - "RTCDataChannel", - "RTCDataChannelEvent", - "RTCDtlsTransport", - "RTCError", - "RTCErrorEvent", - "RTCIceCandidate", - "RTCIceTransport", - "RTCPeerConnection", - "RTCPeerConnectionIceErrorEvent", - "RTCPeerConnectionIceEvent", - "RTCRtpReceiver", - "RTCRtpSender", - "RTCRtpTransceiver", - "RTCSctpTransport", - "RTCSessionDescription", - "RTCStatsReport", - "RTCTrackEvent", - "RUNNING", - "RadioNodeList", - "Range", - "RangeError", - "RangeException", - "ReadableByteStream", - "ReadableStream", - "ReadableStreamDefaultReader", - "RecordErrorEvent", - "Rect", - "ReferenceError", - "Reflect", - "RegExp", - "RelativeOrientationSensor", - "RelativeTimeFormat", - "RemotePlayback", - "ReportingObserver", - "Request", - "RequestUpdateCheckStatus", - "ResizeObserver", - "ResizeObserverEntry", - "ResizeObserverSize", - "Response", - "RunningState", - "RuntimeError", - "SAMPLER_2D", - "SAMPLER_2D_ARRAY", - "SAMPLER_2D_ARRAY_SHADOW", - "SAMPLER_2D_SHADOW", - "SAMPLER_3D", - "SAMPLER_BINDING", - "SAMPLER_CUBE", - "SAMPLER_CUBE_SHADOW", - "SAMPLES", - "SAMPLE_ALPHA_TO_COVERAGE", - "SAMPLE_BUFFERS", - "SAMPLE_COVERAGE", - "SAMPLE_COVERAGE_INVERT", - "SAMPLE_COVERAGE_VALUE", - "SAWTOOTH", - "SCHEDULED_STATE", - "SCISSOR_BOX", - "SCISSOR_TEST", - "SCROLL_PAGE_DOWN", - "SCROLL_PAGE_UP", - "SDP_ANSWER", - "SDP_OFFER", - "SDP_PRANSWER", - "SECURITY_ERR", - "SELECT", - "SEPARATE_ATTRIBS", - "SERIALIZE_ERR", - "SEVERITY_ERROR", - "SEVERITY_FATAL_ERROR", - "SEVERITY_WARNING", - "SHADER_COMPILER", - "SHADER_TYPE", - "SHADING_LANGUAGE_VERSION", - "SHARED_MODULE_UPDATE", - "SHIFT_MASK", - "SHORT", - "SHOWING", - "SHOW_ALL", - "SHOW_ATTRIBUTE", - "SHOW_CDATA_SECTION", - "SHOW_COMMENT", - "SHOW_DOCUMENT", - "SHOW_DOCUMENT_FRAGMENT", - "SHOW_DOCUMENT_TYPE", - "SHOW_ELEMENT", - "SHOW_ENTITY", - "SHOW_ENTITY_REFERENCE", - "SHOW_NOTATION", - "SHOW_PROCESSING_INSTRUCTION", - "SHOW_TEXT", - "SIGNALED", - "SIGNED_NORMALIZED", - "SINE", - "SKIN", - "SOUNDFIELD", - "SQLError", - "SQLException", - "SQLResultSet", - "SQLResultSetRowList", - "SQLTransaction", - "SQRT1_2", - "SQRT2", - "SQUARE", - "SRC_ALPHA", - "SRC_ALPHA_SATURATE", - "SRC_COLOR", - "SRGB", - "SRGB8", - "SRGB8_ALPHA8", - "START_TO_END", - "START_TO_START", - "STATIC_COPY", - "STATIC_DRAW", - "STATIC_READ", - "STENCIL", - "STENCIL_ATTACHMENT", - "STENCIL_BACK_FAIL", - "STENCIL_BACK_FUNC", - "STENCIL_BACK_PASS_DEPTH_FAIL", - "STENCIL_BACK_PASS_DEPTH_PASS", - "STENCIL_BACK_REF", - "STENCIL_BACK_VALUE_MASK", - "STENCIL_BACK_WRITEMASK", - "STENCIL_BITS", - "STENCIL_BUFFER_BIT", - "STENCIL_CLEAR_VALUE", - "STENCIL_FAIL", - "STENCIL_FUNC", - "STENCIL_INDEX", - "STENCIL_INDEX8", - "STENCIL_PASS_DEPTH_FAIL", - "STENCIL_PASS_DEPTH_PASS", - "STENCIL_REF", - "STENCIL_TEST", - "STENCIL_VALUE_MASK", - "STENCIL_WRITEMASK", - "STREAM_COPY", - "STREAM_DRAW", - "STREAM_READ", - "STRING_TYPE", - "STYLE_RULE", - "SUBPIXEL_BITS", - "SUPPORTS_RULE", - "SVGAElement", - "SVGAltGlyphDefElement", - "SVGAltGlyphElement", - "SVGAltGlyphItemElement", - "SVGAngle", - "SVGAnimateColorElement", - "SVGAnimateElement", - "SVGAnimateMotionElement", - "SVGAnimateTransformElement", - "SVGAnimatedAngle", - "SVGAnimatedBoolean", - "SVGAnimatedEnumeration", - "SVGAnimatedInteger", - "SVGAnimatedLength", - "SVGAnimatedLengthList", - "SVGAnimatedNumber", - "SVGAnimatedNumberList", - "SVGAnimatedPreserveAspectRatio", - "SVGAnimatedRect", - "SVGAnimatedString", - "SVGAnimatedTransformList", - "SVGAnimationElement", - "SVGCircleElement", - "SVGClipPathElement", - "SVGColor", - "SVGComponentTransferFunctionElement", - "SVGCursorElement", - "SVGDefsElement", - "SVGDescElement", - "SVGDiscardElement", - "SVGDocument", - "SVGElement", - "SVGElementInstance", - "SVGElementInstanceList", - "SVGEllipseElement", - "SVGException", - "SVGFEBlendElement", - "SVGFEColorMatrixElement", - "SVGFEComponentTransferElement", - "SVGFECompositeElement", - "SVGFEConvolveMatrixElement", - "SVGFEDiffuseLightingElement", - "SVGFEDisplacementMapElement", - "SVGFEDistantLightElement", - "SVGFEDropShadowElement", - "SVGFEFloodElement", - "SVGFEFuncAElement", - "SVGFEFuncBElement", - "SVGFEFuncGElement", - "SVGFEFuncRElement", - "SVGFEGaussianBlurElement", - "SVGFEImageElement", - "SVGFEMergeElement", - "SVGFEMergeNodeElement", - "SVGFEMorphologyElement", - "SVGFEOffsetElement", - "SVGFEPointLightElement", - "SVGFESpecularLightingElement", - "SVGFESpotLightElement", - "SVGFETileElement", - "SVGFETurbulenceElement", - "SVGFilterElement", - "SVGFontElement", - "SVGFontFaceElement", - "SVGFontFaceFormatElement", - "SVGFontFaceNameElement", - "SVGFontFaceSrcElement", - "SVGFontFaceUriElement", - "SVGForeignObjectElement", - "SVGGElement", - "SVGGeometryElement", - "SVGGlyphElement", - "SVGGlyphRefElement", - "SVGGradientElement", - "SVGGraphicsElement", - "SVGHKernElement", - "SVGImageElement", - "SVGLength", - "SVGLengthList", - "SVGLineElement", - "SVGLinearGradientElement", - "SVGMPathElement", - "SVGMarkerElement", - "SVGMaskElement", - "SVGMatrix", - "SVGMetadataElement", - "SVGMissingGlyphElement", - "SVGNumber", - "SVGNumberList", - "SVGPaint", - "SVGPathElement", - "SVGPathSeg", - "SVGPathSegArcAbs", - "SVGPathSegArcRel", - "SVGPathSegClosePath", - "SVGPathSegCurvetoCubicAbs", - "SVGPathSegCurvetoCubicRel", - "SVGPathSegCurvetoCubicSmoothAbs", - "SVGPathSegCurvetoCubicSmoothRel", - "SVGPathSegCurvetoQuadraticAbs", - "SVGPathSegCurvetoQuadraticRel", - "SVGPathSegCurvetoQuadraticSmoothAbs", - "SVGPathSegCurvetoQuadraticSmoothRel", - "SVGPathSegLinetoAbs", - "SVGPathSegLinetoHorizontalAbs", - "SVGPathSegLinetoHorizontalRel", - "SVGPathSegLinetoRel", - "SVGPathSegLinetoVerticalAbs", - "SVGPathSegLinetoVerticalRel", - "SVGPathSegList", - "SVGPathSegMovetoAbs", - "SVGPathSegMovetoRel", - "SVGPatternElement", - "SVGPoint", - "SVGPointList", - "SVGPolygonElement", - "SVGPolylineElement", - "SVGPreserveAspectRatio", - "SVGRadialGradientElement", - "SVGRect", - "SVGRectElement", - "SVGRenderingIntent", - "SVGSVGElement", - "SVGScriptElement", - "SVGSetElement", - "SVGStopElement", - "SVGStringList", - "SVGStyleElement", - "SVGSwitchElement", - "SVGSymbolElement", - "SVGTRefElement", - "SVGTSpanElement", - "SVGTextContentElement", - "SVGTextElement", - "SVGTextPathElement", - "SVGTextPositioningElement", - "SVGTitleElement", - "SVGTransform", - "SVGTransformList", - "SVGUnitTypes", - "SVGUseElement", - "SVGVKernElement", - "SVGViewElement", - "SVGViewSpec", - "SVGZoomAndPan", - "SVGZoomEvent", - "SVG_ANGLETYPE_DEG", - "SVG_ANGLETYPE_GRAD", - "SVG_ANGLETYPE_RAD", - "SVG_ANGLETYPE_UNKNOWN", - "SVG_ANGLETYPE_UNSPECIFIED", - "SVG_CHANNEL_A", - "SVG_CHANNEL_B", - "SVG_CHANNEL_G", - "SVG_CHANNEL_R", - "SVG_CHANNEL_UNKNOWN", - "SVG_COLORTYPE_CURRENTCOLOR", - "SVG_COLORTYPE_RGBCOLOR", - "SVG_COLORTYPE_RGBCOLOR_ICCCOLOR", - "SVG_COLORTYPE_UNKNOWN", - "SVG_EDGEMODE_DUPLICATE", - "SVG_EDGEMODE_NONE", - "SVG_EDGEMODE_UNKNOWN", - "SVG_EDGEMODE_WRAP", - "SVG_FEBLEND_MODE_COLOR", - "SVG_FEBLEND_MODE_COLOR_BURN", - "SVG_FEBLEND_MODE_COLOR_DODGE", - "SVG_FEBLEND_MODE_DARKEN", - "SVG_FEBLEND_MODE_DIFFERENCE", - "SVG_FEBLEND_MODE_EXCLUSION", - "SVG_FEBLEND_MODE_HARD_LIGHT", - "SVG_FEBLEND_MODE_HUE", - "SVG_FEBLEND_MODE_LIGHTEN", - "SVG_FEBLEND_MODE_LUMINOSITY", - "SVG_FEBLEND_MODE_MULTIPLY", - "SVG_FEBLEND_MODE_NORMAL", - "SVG_FEBLEND_MODE_OVERLAY", - "SVG_FEBLEND_MODE_SATURATION", - "SVG_FEBLEND_MODE_SCREEN", - "SVG_FEBLEND_MODE_SOFT_LIGHT", - "SVG_FEBLEND_MODE_UNKNOWN", - "SVG_FECOLORMATRIX_TYPE_HUEROTATE", - "SVG_FECOLORMATRIX_TYPE_LUMINANCETOALPHA", - "SVG_FECOLORMATRIX_TYPE_MATRIX", - "SVG_FECOLORMATRIX_TYPE_SATURATE", - "SVG_FECOLORMATRIX_TYPE_UNKNOWN", - "SVG_FECOMPONENTTRANSFER_TYPE_DISCRETE", - "SVG_FECOMPONENTTRANSFER_TYPE_GAMMA", - "SVG_FECOMPONENTTRANSFER_TYPE_IDENTITY", - "SVG_FECOMPONENTTRANSFER_TYPE_LINEAR", - "SVG_FECOMPONENTTRANSFER_TYPE_TABLE", - "SVG_FECOMPONENTTRANSFER_TYPE_UNKNOWN", - "SVG_FECOMPOSITE_OPERATOR_ARITHMETIC", - "SVG_FECOMPOSITE_OPERATOR_ATOP", - "SVG_FECOMPOSITE_OPERATOR_IN", - "SVG_FECOMPOSITE_OPERATOR_OUT", - "SVG_FECOMPOSITE_OPERATOR_OVER", - "SVG_FECOMPOSITE_OPERATOR_UNKNOWN", - "SVG_FECOMPOSITE_OPERATOR_XOR", - "SVG_INVALID_VALUE_ERR", - "SVG_LENGTHTYPE_CM", - "SVG_LENGTHTYPE_EMS", - "SVG_LENGTHTYPE_EXS", - "SVG_LENGTHTYPE_IN", - "SVG_LENGTHTYPE_MM", - "SVG_LENGTHTYPE_NUMBER", - "SVG_LENGTHTYPE_PC", - "SVG_LENGTHTYPE_PERCENTAGE", - "SVG_LENGTHTYPE_PT", - "SVG_LENGTHTYPE_PX", - "SVG_LENGTHTYPE_UNKNOWN", - "SVG_MARKERUNITS_STROKEWIDTH", - "SVG_MARKERUNITS_UNKNOWN", - "SVG_MARKERUNITS_USERSPACEONUSE", - "SVG_MARKER_ORIENT_ANGLE", - "SVG_MARKER_ORIENT_AUTO", - "SVG_MARKER_ORIENT_UNKNOWN", - "SVG_MASKTYPE_ALPHA", - "SVG_MASKTYPE_LUMINANCE", - "SVG_MATRIX_NOT_INVERTABLE", - "SVG_MEETORSLICE_MEET", - "SVG_MEETORSLICE_SLICE", - "SVG_MEETORSLICE_UNKNOWN", - "SVG_MORPHOLOGY_OPERATOR_DILATE", - "SVG_MORPHOLOGY_OPERATOR_ERODE", - "SVG_MORPHOLOGY_OPERATOR_UNKNOWN", - "SVG_PAINTTYPE_CURRENTCOLOR", - "SVG_PAINTTYPE_NONE", - "SVG_PAINTTYPE_RGBCOLOR", - "SVG_PAINTTYPE_RGBCOLOR_ICCCOLOR", - "SVG_PAINTTYPE_UNKNOWN", - "SVG_PAINTTYPE_URI", - "SVG_PAINTTYPE_URI_CURRENTCOLOR", - "SVG_PAINTTYPE_URI_NONE", - "SVG_PAINTTYPE_URI_RGBCOLOR", - "SVG_PAINTTYPE_URI_RGBCOLOR_ICCCOLOR", - "SVG_PRESERVEASPECTRATIO_NONE", - "SVG_PRESERVEASPECTRATIO_UNKNOWN", - "SVG_PRESERVEASPECTRATIO_XMAXYMAX", - "SVG_PRESERVEASPECTRATIO_XMAXYMID", - "SVG_PRESERVEASPECTRATIO_XMAXYMIN", - "SVG_PRESERVEASPECTRATIO_XMIDYMAX", - "SVG_PRESERVEASPECTRATIO_XMIDYMID", - "SVG_PRESERVEASPECTRATIO_XMIDYMIN", - "SVG_PRESERVEASPECTRATIO_XMINYMAX", - "SVG_PRESERVEASPECTRATIO_XMINYMID", - "SVG_PRESERVEASPECTRATIO_XMINYMIN", - "SVG_SPREADMETHOD_PAD", - "SVG_SPREADMETHOD_REFLECT", - "SVG_SPREADMETHOD_REPEAT", - "SVG_SPREADMETHOD_UNKNOWN", - "SVG_STITCHTYPE_NOSTITCH", - "SVG_STITCHTYPE_STITCH", - "SVG_STITCHTYPE_UNKNOWN", - "SVG_TRANSFORM_MATRIX", - "SVG_TRANSFORM_ROTATE", - "SVG_TRANSFORM_SCALE", - "SVG_TRANSFORM_SKEWX", - "SVG_TRANSFORM_SKEWY", - "SVG_TRANSFORM_TRANSLATE", - "SVG_TRANSFORM_UNKNOWN", - "SVG_TURBULENCE_TYPE_FRACTALNOISE", - "SVG_TURBULENCE_TYPE_TURBULENCE", - "SVG_TURBULENCE_TYPE_UNKNOWN", - "SVG_UNIT_TYPE_OBJECTBOUNDINGBOX", - "SVG_UNIT_TYPE_UNKNOWN", - "SVG_UNIT_TYPE_USERSPACEONUSE", - "SVG_WRONG_TYPE_ERR", - "SVG_ZOOMANDPAN_DISABLE", - "SVG_ZOOMANDPAN_MAGNIFY", - "SVG_ZOOMANDPAN_UNKNOWN", - "SYNC_CONDITION", - "SYNC_FENCE", - "SYNC_FLAGS", - "SYNC_FLUSH_COMMANDS_BIT", - "SYNC_GPU_COMMANDS_COMPLETE", - "SYNC_STATUS", - "SYNTAX_ERR", - "SavedPages", - "Screen", - "ScreenOrientation", - "Script", - "ScriptEngine", - "ScriptEngineBuildVersion", - "ScriptEngineMajorVersion", - "ScriptEngineMinorVersion", - "ScriptProcessorNode", - "ScrollAreaEvent", - "SecurityPolicyViolationEvent", - "Selection", - "Sensor", - "SensorErrorEvent", - "ServiceWorker", - "ServiceWorkerContainer", - "ServiceWorkerMessageEvent", - "ServiceWorkerRegistration", - "SessionDescription", - "Set", - "ShadowRoot", - "SharedArrayBuffer", - "SharedWorker", - "SimpleGestureEvent", - "SourceBuffer", - "SourceBufferList", - "SpeechSynthesis", - "SpeechSynthesisErrorEvent", - "SpeechSynthesisEvent", - "SpeechSynthesisUtterance", - "SpeechSynthesisVoice", - "StaticRange", - "StereoPannerNode", - "StopIteration", - "Storage", - "StorageEvent", - "StorageManager", - "String", - "StyleMedia", - "StylePropertyMap", - "StylePropertyMapReadOnly", - "StyleSheet", - "StyleSheetList", - "StyleSheetPageList", - "SubmitEvent", - "SubtleCrypto", - "Symbol", - "SyncManager", - "SyntaxError", - "TEMPORARY", - "TEXTPATH_METHODTYPE_ALIGN", - "TEXTPATH_METHODTYPE_STRETCH", - "TEXTPATH_METHODTYPE_UNKNOWN", - "TEXTPATH_SPACINGTYPE_AUTO", - "TEXTPATH_SPACINGTYPE_EXACT", - "TEXTPATH_SPACINGTYPE_UNKNOWN", - "TEXTURE", - "TEXTURE0", - "TEXTURE1", - "TEXTURE10", - "TEXTURE11", - "TEXTURE12", - "TEXTURE13", - "TEXTURE14", - "TEXTURE15", - "TEXTURE16", - "TEXTURE17", - "TEXTURE18", - "TEXTURE19", - "TEXTURE2", - "TEXTURE20", - "TEXTURE21", - "TEXTURE22", - "TEXTURE23", - "TEXTURE24", - "TEXTURE25", - "TEXTURE26", - "TEXTURE27", - "TEXTURE28", - "TEXTURE29", - "TEXTURE3", - "TEXTURE30", - "TEXTURE31", - "TEXTURE4", - "TEXTURE5", - "TEXTURE6", - "TEXTURE7", - "TEXTURE8", - "TEXTURE9", - "TEXTURE_2D", - "TEXTURE_2D_ARRAY", - "TEXTURE_3D", - "TEXTURE_BASE_LEVEL", - "TEXTURE_BINDING_2D", - "TEXTURE_BINDING_2D_ARRAY", - "TEXTURE_BINDING_3D", - "TEXTURE_BINDING_CUBE_MAP", - "TEXTURE_COMPARE_FUNC", - "TEXTURE_COMPARE_MODE", - "TEXTURE_CUBE_MAP", - "TEXTURE_CUBE_MAP_NEGATIVE_X", - "TEXTURE_CUBE_MAP_NEGATIVE_Y", - "TEXTURE_CUBE_MAP_NEGATIVE_Z", - "TEXTURE_CUBE_MAP_POSITIVE_X", - "TEXTURE_CUBE_MAP_POSITIVE_Y", - "TEXTURE_CUBE_MAP_POSITIVE_Z", - "TEXTURE_IMMUTABLE_FORMAT", - "TEXTURE_IMMUTABLE_LEVELS", - "TEXTURE_MAG_FILTER", - "TEXTURE_MAX_ANISOTROPY_EXT", - "TEXTURE_MAX_LEVEL", - "TEXTURE_MAX_LOD", - "TEXTURE_MIN_FILTER", - "TEXTURE_MIN_LOD", - "TEXTURE_WRAP_R", - "TEXTURE_WRAP_S", - "TEXTURE_WRAP_T", - "TEXT_NODE", - "THROTTLED", - "TIMEOUT", - "TIMEOUT_ERR", - "TIMEOUT_EXPIRED", - "TIMEOUT_IGNORED", - "TOO_LARGE_ERR", - "TRANSACTION_INACTIVE_ERR", - "TRANSFORM_FEEDBACK", - "TRANSFORM_FEEDBACK_ACTIVE", - "TRANSFORM_FEEDBACK_BINDING", - "TRANSFORM_FEEDBACK_BUFFER", - "TRANSFORM_FEEDBACK_BUFFER_BINDING", - "TRANSFORM_FEEDBACK_BUFFER_MODE", - "TRANSFORM_FEEDBACK_BUFFER_SIZE", - "TRANSFORM_FEEDBACK_BUFFER_START", - "TRANSFORM_FEEDBACK_PAUSED", - "TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN", - "TRANSFORM_FEEDBACK_VARYINGS", - "TRIANGLE", - "TRIANGLES", - "TRIANGLE_FAN", - "TRIANGLE_STRIP", - "TYPE_BACK_FORWARD", - "TYPE_ERR", - "TYPE_MISMATCH_ERR", - "TYPE_NAVIGATE", - "TYPE_RELOAD", - "TYPE_RESERVED", - "Table", - "TaskAttributionTiming", - "Text", - "TextDecoder", - "TextDecoderStream", - "TextEncoder", - "TextEncoderStream", - "TextEvent", - "TextMetrics", - "TextRange", - "TextRangeCollection", - "TextTrack", - "TextTrackCue", - "TextTrackCueList", - "TextTrackList", - "TimeEvent", - "TimeRanges", - "Touch", - "TouchEvent", - "TouchList", - "TrackEvent", - "TransformStream", - "TransitionEvent", - "TreeWalker", - "TrustedHTML", - "TrustedScript", - "TrustedScriptURL", - "TrustedTypePolicy", - "TrustedTypePolicyFactory", - "TypeError", - "U2F", - "UIEvent", - "UNCACHED", - "UNIFORM_ARRAY_STRIDE", - "UNIFORM_BLOCK_ACTIVE_UNIFORMS", - "UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES", - "UNIFORM_BLOCK_BINDING", - "UNIFORM_BLOCK_DATA_SIZE", - "UNIFORM_BLOCK_INDEX", - "UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER", - "UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER", - "UNIFORM_BUFFER", - "UNIFORM_BUFFER_BINDING", - "UNIFORM_BUFFER_OFFSET_ALIGNMENT", - "UNIFORM_BUFFER_SIZE", - "UNIFORM_BUFFER_START", - "UNIFORM_IS_ROW_MAJOR", - "UNIFORM_MATRIX_STRIDE", - "UNIFORM_OFFSET", - "UNIFORM_SIZE", - "UNIFORM_TYPE", - "UNKNOWN_ERR", - "UNKNOWN_RULE", - "UNMASKED_RENDERER_WEBGL", - "UNMASKED_VENDOR_WEBGL", - "UNORDERED_NODE_ITERATOR_TYPE", - "UNORDERED_NODE_SNAPSHOT_TYPE", - "UNPACK_ALIGNMENT", - "UNPACK_COLORSPACE_CONVERSION_WEBGL", - "UNPACK_FLIP_Y_WEBGL", - "UNPACK_IMAGE_HEIGHT", - "UNPACK_PREMULTIPLY_ALPHA_WEBGL", - "UNPACK_ROW_LENGTH", - "UNPACK_SKIP_IMAGES", - "UNPACK_SKIP_PIXELS", - "UNPACK_SKIP_ROWS", - "UNSCHEDULED_STATE", - "UNSENT", - "UNSIGNALED", - "UNSIGNED_BYTE", - "UNSIGNED_INT", - "UNSIGNED_INT_10F_11F_11F_REV", - "UNSIGNED_INT_24_8", - "UNSIGNED_INT_2_10_10_10_REV", - "UNSIGNED_INT_5_9_9_9_REV", - "UNSIGNED_INT_SAMPLER_2D", - "UNSIGNED_INT_SAMPLER_2D_ARRAY", - "UNSIGNED_INT_SAMPLER_3D", - "UNSIGNED_INT_SAMPLER_CUBE", - "UNSIGNED_INT_VEC2", - "UNSIGNED_INT_VEC3", - "UNSIGNED_INT_VEC4", - "UNSIGNED_NORMALIZED", - "UNSIGNED_SHORT", - "UNSIGNED_SHORT_4_4_4_4", - "UNSIGNED_SHORT_5_5_5_1", - "UNSIGNED_SHORT_5_6_5", - "UNSPECIFIED_EVENT_TYPE_ERR", - "UPDATE", - "UPDATEREADY", - "UPDATE_AVAILABLE", - "URIError", - "URL", - "URLSearchParams", - "URLUnencoded", - "URL_MISMATCH_ERR", - "USB", - "USBAlternateInterface", - "USBConfiguration", - "USBConnectionEvent", - "USBDevice", - "USBEndpoint", - "USBInTransferResult", - "USBInterface", - "USBIsochronousInTransferPacket", - "USBIsochronousInTransferResult", - "USBIsochronousOutTransferPacket", - "USBIsochronousOutTransferResult", - "USBOutTransferResult", - "UTC", - "Uint16Array", - "Uint32Array", - "Uint8Array", - "Uint8ClampedArray", - "UserActivation", - "UserMessageHandler", - "UserMessageHandlersNamespace", - "UserProximityEvent", - "VALIDATE_STATUS", - "VALIDATION_ERR", - "VARIABLES_RULE", - "VBArray", - "VENDOR", - "VERSION", - "VERSION_CHANGE", - "VERSION_ERR", - "VERTEX_ARRAY_BINDING", - "VERTEX_ATTRIB_ARRAY_BUFFER_BINDING", - "VERTEX_ATTRIB_ARRAY_DIVISOR", - "VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE", - "VERTEX_ATTRIB_ARRAY_ENABLED", - "VERTEX_ATTRIB_ARRAY_INTEGER", - "VERTEX_ATTRIB_ARRAY_NORMALIZED", - "VERTEX_ATTRIB_ARRAY_POINTER", - "VERTEX_ATTRIB_ARRAY_SIZE", - "VERTEX_ATTRIB_ARRAY_STRIDE", - "VERTEX_ATTRIB_ARRAY_TYPE", - "VERTEX_SHADER", - "VERTICAL", - "VERTICAL_AXIS", - "VER_ERR", - "VIEWPORT", - "VIEWPORT_RULE", - "VRDisplay", - "VRDisplayCapabilities", - "VRDisplayEvent", - "VREyeParameters", - "VRFieldOfView", - "VRFrameData", - "VRPose", - "VRStageParameters", - "VTTCue", - "VTTRegion", - "ValidityState", - "VideoPlaybackQuality", - "VideoStreamTrack", - "VideoTrack", - "VideoTrackList", - "VisualViewport", - "WAIT_FAILED", - "WEBGL_compressed_texture_s3tc", - "WEBGL_debug_renderer_info", - "WEBKIT_FILTER_RULE", - "WEBKIT_FORCE_AT_FORCE_MOUSE_DOWN", - "WEBKIT_FORCE_AT_MOUSE_DOWN", - "WEBKIT_KEYFRAMES_RULE", - "WEBKIT_KEYFRAME_RULE", - "WEBKIT_REGION_RULE", - "WIN", - "WRONG_DOCUMENT_ERR", - "WakeLock", - "WakeLockSentinel", - "WaveShaperNode", - "WeakMap", - "WeakRef", - "WeakSet", - "WebAssembly", - "WebGL2RenderingContext", - "WebGLActiveInfo", - "WebGLBuffer", - "WebGLContextEvent", - "WebGLFramebuffer", - "WebGLObject", - "WebGLProgram", - "WebGLQuery", - "WebGLRenderbuffer", - "WebGLRenderingContext", - "WebGLSampler", - "WebGLShader", - "WebGLShaderPrecisionFormat", - "WebGLSync", - "WebGLTexture", - "WebGLTransformFeedback", - "WebGLUniformLocation", - "WebGLVertexArray", - "WebGLVertexArrayObject", - "WebKit built-in PDF", - "WebKitAnimationEvent", - "WebKitBlobBuilder", - "WebKitCSSFilterRule", - "WebKitCSSFilterValue", - "WebKitCSSKeyframeRule", - "WebKitCSSKeyframesRule", - "WebKitCSSMatrix", - "WebKitCSSRegionRule", - "WebKitCSSTransformValue", - "WebKitDataCue", - "WebKitGamepad", - "WebKitMediaKeyError", - "WebKitMediaKeyMessageEvent", - "WebKitMediaKeyNeededEvent", - "WebKitMediaKeySession", - "WebKitMediaKeys", - "WebKitMediaSource", - "WebKitMutationObserver", - "WebKitNamespace", - "WebKitPlaybackTargetAvailabilityEvent", - "WebKitPoint", - "WebKitShadowRoot", - "WebKitSourceBuffer", - "WebKitSourceBufferList", - "WebKitTransitionEvent", - "WebSocket", - "WebkitAlignContent", - "WebkitAlignItems", - "WebkitAlignSelf", - "WebkitAnimation", - "WebkitAnimationDelay", - "WebkitAnimationDirection", - "WebkitAnimationDuration", - "WebkitAnimationFillMode", - "WebkitAnimationIterationCount", - "WebkitAnimationName", - "WebkitAnimationPlayState", - "WebkitAnimationTimingFunction", - "WebkitAppearance", - "WebkitBackfaceVisibility", - "WebkitBackgroundClip", - "WebkitBackgroundOrigin", - "WebkitBackgroundSize", - "WebkitBorderBottomLeftRadius", - "WebkitBorderBottomRightRadius", - "WebkitBorderImage", - "WebkitBorderRadius", - "WebkitBorderTopLeftRadius", - "WebkitBorderTopRightRadius", - "WebkitBoxAlign", - "WebkitBoxDirection", - "WebkitBoxFlex", - "WebkitBoxOrdinalGroup", - "WebkitBoxOrient", - "WebkitBoxPack", - "WebkitBoxShadow", - "WebkitBoxSizing", - "WebkitFilter", - "WebkitFlex", - "WebkitFlexBasis", - "WebkitFlexDirection", - "WebkitFlexFlow", - "WebkitFlexGrow", - "WebkitFlexShrink", - "WebkitFlexWrap", - "WebkitJustifyContent", - "WebkitLineClamp", - "WebkitMask", - "WebkitMaskClip", - "WebkitMaskComposite", - "WebkitMaskImage", - "WebkitMaskOrigin", - "WebkitMaskPosition", - "WebkitMaskPositionX", - "WebkitMaskPositionY", - "WebkitMaskRepeat", - "WebkitMaskSize", - "WebkitOrder", - "WebkitPerspective", - "WebkitPerspectiveOrigin", - "WebkitTextFillColor", - "WebkitTextSizeAdjust", - "WebkitTextStroke", - "WebkitTextStrokeColor", - "WebkitTextStrokeWidth", - "WebkitTransform", - "WebkitTransformOrigin", - "WebkitTransformStyle", - "WebkitTransition", - "WebkitTransitionDelay", - "WebkitTransitionDuration", - "WebkitTransitionProperty", - "WebkitTransitionTimingFunction", - "WebkitUserSelect", - "WheelEvent", - "Window", - "Windows Media Player Plug-in Dynamic Link Library", - "Windows Presentation Foundation", - "Worker", - "Worklet", - "WritableStream", - "WritableStreamDefaultWriter", - "X86_32", - "X86_64", - "XMLDocument", - "XMLHttpRequest", - "XMLHttpRequestEventTarget", - "XMLHttpRequestException", - "XMLHttpRequestProgressEvent", - "XMLHttpRequestUpload", - "XMLSerializer", - "XMLStylesheetProcessingInstruction", - "XPathEvaluator", - "XPathException", - "XPathExpression", - "XPathNSResolver", - "XPathResult", - "XR", - "XRBoundedReferenceSpace", - "XRDOMOverlayState", - "XRFrame", - "XRHitTestResult", - "XRHitTestSource", - "XRInputSource", - "XRInputSourceArray", - "XRInputSourceEvent", - "XRInputSourcesChangeEvent", - "XRLayer", - "XRPose", - "XRRay", - "XRReferenceSpace", - "XRReferenceSpaceEvent", - "XRRenderState", - "XRRigidTransform", - "XRSession", - "XRSessionEvent", - "XRSpace", - "XRSystem", - "XRTransientInputHitTestResult", - "XRTransientInputHitTestSource", - "XRView", - "XRViewerPose", - "XRViewport", - "XRWebGLLayer", - "XSLTProcessor", - "ZERO", - "_XD0M_", - "_YD0M_", - "__defineGetter__", - "__defineSetter__", - "__lookupGetter__", - "__lookupSetter__", - "__opera", - "__proto__", - "__relevantExtensionKeys", - "_browserjsran", - "a", - "aLink", - "abbr", - "abort", - "aborted", - "abs", - "absolute", - "acceleration", - "accelerationIncludingGravity", - "accelerator", - "accept", - "acceptCharset", - "acceptNode", - "accessKey", - "accessKeyLabel", - "accuracy", - "acos", - "acosh", - "action", - "actionURL", - "actions", - "activated", - "active", - "activeCues", - "activeElement", - "activeSourceBuffers", - "activeSourceCount", - "activeTexture", - "activeVRDisplays", - "actualBoundingBoxAscent", - "actualBoundingBoxDescent", - "actualBoundingBoxLeft", - "actualBoundingBoxRight", - "add", - "addAll", - "addBehavior", - "addCandidate", - "addColorStop", - "addCue", - "addElement", - "addEventListener", - "addFilter", - "addFromString", - "addFromUri", - "addIceCandidate", - "addImport", - "addListener", - "addModule", - "addNamed", - "addPageRule", - "addPath", - "addPointer", - "addRange", - "addRegion", - "addRule", - "addRules", - "addSearchEngine", - "addSourceBuffer", - "addStream", - "addTextTrack", - "addTrack", - "addTransceiver", - "addWakeLockListener", - "added", - "addedNodes", - "additionalName", - "additiveSymbols", - "addons", - "address", - "addressLine", - "adoptNode", - "adoptText", - "adoptedCallback", - "adoptedStyleSheets", - "adr", - "advance", - "after", - "album", - "alert", - "algorithm", - "align", - "align-content", - "align-items", - "align-self", - "alignContent", - "alignItems", - "alignSelf", - "alignmentBaseline", - "alinkColor", - "all", - "allSettled", - "allow", - "allowFullscreen", - "allowPaymentRequest", - "allowTransparency", - "allowedDirections", - "allowedFeatures", - "allowsFeature", - "alpha", - "alphabeticBaseline", - "alt", - "altGraphKey", - "altHtml", - "altKey", - "altLeft", - "alternate", - "alternateSetting", - "alternates", - "altitude", - "altitudeAccuracy", - "amplitude", - "ancestorOrigins", - "anchor", - "anchorNode", - "anchorOffset", - "anchors", - "and", - "angle", - "angularAcceleration", - "angularVelocity", - "animVal", - "animate", - "animatedInstanceRoot", - "animatedNormalizedPathSegList", - "animatedPathSegList", - "animatedPoints", - "animation", - "animation-delay", - "animation-direction", - "animation-duration", - "animation-fill-mode", - "animation-iteration-count", - "animation-name", - "animation-play-state", - "animation-timing-function", - "animationDelay", - "animationDirection", - "animationDuration", - "animationFillMode", - "animationIterationCount", - "animationName", - "animationPlayState", - "animationStartTime", - "animationTimingFunction", - "animationsPaused", - "anniversary", - "antialias", - "any", - "app", - "appCodeName", - "appMinorVersion", - "appName", - "appNotifications", - "appVersion", - "appearance", - "append", - "appendBuffer", - "appendChild", - "appendData", - "appendItem", - "appendMedium", - "appendNamed", - "appendRule", - "appendStream", - "appendWindowEnd", - "appendWindowStart", - "appleTrailingWord", - "applets", - "application/apple-default-browser", - "application/asx", - "application/java-deployment-toolkit", - "application/pdf", - "application/postscript", - "application/x-drm", - "application/x-drm-v2", - "application/x-google-chrome-pdf", - "application/x-java-applet", - "application/x-java-applet;deploy=10.25.2", - "application/x-java-applet;javafx=2.2.25", - "application/x-java-applet;jpi-version=1.7.0_25", - "application/x-java-applet;version=1.1", - "application/x-java-applet;version=1.1.1", - "application/x-java-applet;version=1.1.2", - "application/x-java-applet;version=1.1.3", - "application/x-java-applet;version=1.2", - "application/x-java-applet;version=1.2.1", - "application/x-java-applet;version=1.2.2", - "application/x-java-applet;version=1.3", - "application/x-java-applet;version=1.3.1", - "application/x-java-applet;version=1.4", - "application/x-java-applet;version=1.4.1", - "application/x-java-applet;version=1.4.2", - "application/x-java-applet;version=1.5", - "application/x-java-applet;version=1.6", - "application/x-java-applet;version=1.7", - "application/x-java-bean", - "application/x-java-bean;jpi-version=1.7.0_25", - "application/x-java-bean;version=1.1", - "application/x-java-bean;version=1.1.1", - "application/x-java-bean;version=1.1.2", - "application/x-java-bean;version=1.1.3", - "application/x-java-bean;version=1.2", - "application/x-java-bean;version=1.2.1", - "application/x-java-bean;version=1.2.2", - "application/x-java-bean;version=1.3", - "application/x-java-bean;version=1.3.1", - "application/x-java-bean;version=1.4", - "application/x-java-bean;version=1.4.1", - "application/x-java-bean;version=1.4.2", - "application/x-java-bean;version=1.5", - "application/x-java-bean;version=1.6", - "application/x-java-bean;version=1.7", - "application/x-java-vm", - "application/x-java-vm-npruntime", - "application/x-mplayer2", - "application/x-ms-xbap", - "application/x-nacl", - "application/x-pnacl", - "application/xaml+xml", - "applicationCache", - "applicationServerKey", - "apply", - "applyConstraints", - "applyElement", - "arc", - "arcTo", - "archive", - "areas", - "arguments", - "aria-activedescendant", - "aria-busy", - "aria-checked", - "aria-controls", - "aria-describedby", - "aria-disabled", - "aria-expanded", - "aria-flowto", - "aria-haspopup", - "aria-hidden", - "aria-invalid", - "aria-labelledby", - "aria-level", - "aria-live", - "aria-multiselectable", - "aria-owns", - "aria-posinset", - "aria-pressed", - "aria-readonly", - "aria-relevant", - "aria-required", - "aria-secret", - "aria-selected", - "aria-setsize", - "aria-valuemax", - "aria-valuemin", - "aria-valuenow", - "ariaAtomic", - "ariaAutoComplete", - "ariaBusy", - "ariaChecked", - "ariaColCount", - "ariaColIndex", - "ariaColSpan", - "ariaCurrent", - "ariaDescription", - "ariaDisabled", - "ariaExpanded", - "ariaHasPopup", - "ariaHidden", - "ariaKeyShortcuts", - "ariaLabel", - "ariaLevel", - "ariaLive", - "ariaModal", - "ariaMultiLine", - "ariaMultiSelectable", - "ariaOrientation", - "ariaPlaceholder", - "ariaPosInSet", - "ariaPressed", - "ariaReadOnly", - "ariaRelevant", - "ariaRequired", - "ariaRoleDescription", - "ariaRowCount", - "ariaRowIndex", - "ariaRowSpan", - "ariaSelected", - "ariaSetSize", - "ariaSort", - "ariaValueMax", - "ariaValueMin", - "ariaValueNow", - "ariaValueText", - "arrayBuffer", - "artist", - "artwork", - "as", - "asIntN", - "asUintN", - "asin", - "asinh", - "assert", - "assign", - "assignedElements", - "assignedNodes", - "assignedSlot", - "async", - "asyncIterator", - "atEnd", - "atan", - "atan2", - "atanh", - "atob", - "atomic", - "attachEvent", - "attachInternals", - "attachShader", - "attachShadow", - "attachments", - "attack", - "attestationObject", - "attrChange", - "attrName", - "attributeChangedCallback", - "attributeFilter", - "attributeName", - "attributeNamespace", - "attributeOldValue", - "attributeStyleMap", - "attributes", - "attribution", - "audio/x-ms-wax", - "audio/x-ms-wma", - "audioBitsPerSecond", - "audioTracks", - "audioWorklet", - "authenticatedSignedWrites", - "authenticatorData", - "autoIncrement", - "autobuffer", - "autocapitalize", - "autocomplete", - "autocorrect", - "autofocus", - "automationRate", - "autoplay", - "availHeight", - "availLeft", - "availTop", - "availWidth", - "availability", - "available", - "aversion", - "ax", - "axes", - "axis", - "ay", - "azimuth", - "b", - "back", - "backdropFilter", - "backface-visibility", - "backfaceVisibility", - "background", - "background-attachment", - "background-blend-mode", - "background-clip", - "background-color", - "background-image", - "background-origin", - "background-position", - "background-position-x", - "background-position-y", - "background-repeat", - "background-size", - "backgroundAttachment", - "backgroundBlendMode", - "backgroundClip", - "backgroundColor", - "backgroundFetch", - "backgroundImage", - "backgroundOrigin", - "backgroundPosition", - "backgroundPositionX", - "backgroundPositionY", - "backgroundRepeat", - "backgroundRepeatX", - "backgroundRepeatY", - "backgroundSize", - "badInput", - "badge", - "balance", - "baseFrequencyX", - "baseFrequencyY", - "baseLatency", - "baseLayer", - "baseName", - "baseNode", - "baseOffset", - "baseURI", - "baseVal", - "baselineShift", - "battery", - "bday", - "before", - "beginElement", - "beginElementAt", - "beginPath", - "beginQuery", - "beginTransformFeedback", - "behavior", - "behaviorCookie", - "behaviorPart", - "behaviorUrns", - "beta", - "bezierCurveTo", - "bgColor", - "bgProperties", - "bias", - "big", - "binaryType", - "bind", - "bindAttribLocation", - "bindBuffer", - "bindBufferBase", - "bindBufferRange", - "bindFramebuffer", - "bindRenderbuffer", - "bindSampler", - "bindTexture", - "bindTransformFeedback", - "bindVertexArray", - "blendColor", - "blendEquation", - "blendEquationSeparate", - "blendFunc", - "blendFuncSeparate", - "blink", - "blitFramebuffer", - "blob", - "block-size", - "blockDirection", - "blockSize", - "blockedURI", - "blue", - "bluetooth", - "blur", - "body", - "bodyUsed", - "bold", - "bookmarks", - "booleanValue", - "border", - "border-block", - "border-block-color", - "border-block-end", - "border-block-end-color", - "border-block-end-style", - "border-block-end-width", - "border-block-start", - "border-block-start-color", - "border-block-start-style", - "border-block-start-width", - "border-block-style", - "border-block-width", - "border-bottom", - "border-bottom-color", - "border-bottom-left-radius", - "border-bottom-right-radius", - "border-bottom-style", - "border-bottom-width", - "border-collapse", - "border-color", - "border-end-end-radius", - "border-end-start-radius", - "border-image", - "border-image-outset", - "border-image-repeat", - "border-image-slice", - "border-image-source", - "border-image-width", - "border-inline", - "border-inline-color", - "border-inline-end", - "border-inline-end-color", - "border-inline-end-style", - "border-inline-end-width", - "border-inline-start", - "border-inline-start-color", - "border-inline-start-style", - "border-inline-start-width", - "border-inline-style", - "border-inline-width", - "border-left", - "border-left-color", - "border-left-style", - "border-left-width", - "border-radius", - "border-right", - "border-right-color", - "border-right-style", - "border-right-width", - "border-spacing", - "border-start-end-radius", - "border-start-start-radius", - "border-style", - "border-top", - "border-top-color", - "border-top-left-radius", - "border-top-right-radius", - "border-top-style", - "border-top-width", - "border-width", - "borderBlock", - "borderBlockColor", - "borderBlockEnd", - "borderBlockEndColor", - "borderBlockEndStyle", - "borderBlockEndWidth", - "borderBlockStart", - "borderBlockStartColor", - "borderBlockStartStyle", - "borderBlockStartWidth", - "borderBlockStyle", - "borderBlockWidth", - "borderBottom", - "borderBottomColor", - "borderBottomLeftRadius", - "borderBottomRightRadius", - "borderBottomStyle", - "borderBottomWidth", - "borderBoxSize", - "borderCollapse", - "borderColor", - "borderColorDark", - "borderColorLight", - "borderEndEndRadius", - "borderEndStartRadius", - "borderImage", - "borderImageOutset", - "borderImageRepeat", - "borderImageSlice", - "borderImageSource", - "borderImageWidth", - "borderInline", - "borderInlineColor", - "borderInlineEnd", - "borderInlineEndColor", - "borderInlineEndStyle", - "borderInlineEndWidth", - "borderInlineStart", - "borderInlineStartColor", - "borderInlineStartStyle", - "borderInlineStartWidth", - "borderInlineStyle", - "borderInlineWidth", - "borderLeft", - "borderLeftColor", - "borderLeftStyle", - "borderLeftWidth", - "borderRadius", - "borderRight", - "borderRightColor", - "borderRightStyle", - "borderRightWidth", - "borderSpacing", - "borderStartEndRadius", - "borderStartStartRadius", - "borderStyle", - "borderTop", - "borderTopColor", - "borderTopLeftRadius", - "borderTopRightRadius", - "borderTopStyle", - "borderTopWidth", - "borderWidth", - "bottom", - "bottomMargin", - "bound", - "boundElements", - "boundingClientRect", - "boundingHeight", - "boundingLeft", - "boundingTop", - "boundingWidth", - "bounds", - "boundsGeometry", - "box-decoration-break", - "box-shadow", - "box-sizing", - "boxDecorationBreak", - "boxShadow", - "boxSizing", - "break-after", - "break-before", - "break-inside", - "breakAfter", - "breakBefore", - "breakInside", - "breakType", - "broadcast", - "browserLanguage", - "btoa", - "bubbles", - "buffer", - "bufferData", - "bufferDepth", - "bufferSize", - "bufferSubData", - "buffered", - "bufferedAmount", - "bufferedAmountLowThreshold", - "bufferedRendering", - "buildID", - "buildNumber", - "button", - "buttonID", - "buttons", - "byteLength", - "byteOffset", - "bytesWritten", - "c", - "cache", - "caches", - "calendar", - "call", - "caller", - "canBeFormatted", - "canBeMounted", - "canBeShared", - "canHaveChildren", - "canHaveHTML", - "canInsertDTMF", - "canMakePayment", - "canPlayType", - "canPresent", - "canTrickleIceCandidates", - "cancel", - "cancelAndHoldAtTime", - "cancelAnimationFrame", - "cancelBubble", - "cancelIdleCallback", - "cancelScheduledValues", - "cancelVideoFrameCallback", - "cancelWatchAvailability", - "cancelable", - "candidate", - "canonicalUUID", - "canvas", - "capabilities", - "caption", - "caption-side", - "captionSide", - "capture", - "captureEvents", - "captureStackTrace", - "captureStream", - "caret-color", - "caretBidiLevel", - "caretColor", - "caretPositionFromPoint", - "caretRangeFromPoint", - "caseFirst", - "cast", - "catch", - "category", - "cbrt", - "cd", - "ceil", - "cellIndex", - "cellPadding", - "cellSpacing", - "cells", - "ch", - "chOff", - "chain", - "challenge", - "changeType", - "changeVersion", - "changedTouches", - "channel", - "channelCount", - "channelCountMode", - "channelInterpretation", - "char", - "charAt", - "charCode", - "charCodeAt", - "charIndex", - "charLength", - "characterData", - "characterDataOldValue", - "characterSet", - "characteristic", - "charging", - "chargingTime", - "charset", - "check", - "checkEnclosure", - "checkFramebufferStatus", - "checkInstalled", - "checkIntersection", - "checkValidity", - "checked", - "childElementCount", - "childList", - "childNodes", - "children", - "chrome", - "ciphertext", - "cite", - "city", - "claimInterface", - "claimed", - "classList", - "className", - "classid", - "clear", - "clearAppBadge", - "clearAttributes", - "clearBufferfi", - "clearBufferfv", - "clearBufferiv", - "clearBufferuiv", - "clearColor", - "clearData", - "clearDepth", - "clearHalt", - "clearImmediate", - "clearInterval", - "clearLiveSeekableRange", - "clearMarks", - "clearMeasures", - "clearParameters", - "clearRect", - "clearResourceTimings", - "clearShadow", - "clearStencil", - "clearTimeout", - "clearWatch", - "click", - "clickCount", - "clientDataJSON", - "clientHeight", - "clientInformation", - "clientLeft", - "clientRect", - "clientRects", - "clientTop", - "clientWaitSync", - "clientWidth", - "clientX", - "clientY", - "clip", - "clip-path", - "clip-rule", - "clipBottom", - "clipLeft", - "clipPath", - "clipPathUnits", - "clipRight", - "clipRule", - "clipTop", - "clipboard", - "clipboardData", - "clone", - "cloneContents", - "cloneNode", - "cloneRange", - "close", - "closePath", - "closed", - "closest", - "clz", - "clz32", - "cm", - "cmp", - "code", - "codeBase", - "codePointAt", - "codeType", - "colSpan", - "collapse", - "collapseToEnd", - "collapseToStart", - "collapsed", - "collation", - "collect", - "colno", - "color", - "color-adjust", - "color-interpolation", - "color-interpolation-filters", - "colorAdjust", - "colorDepth", - "colorInterpolation", - "colorInterpolationFilters", - "colorMask", - "colorProfile", - "colorRendering", - "colorScheme", - "colorType", - "cols", - "column", - "column-count", - "column-fill", - "column-gap", - "column-rule", - "column-rule-color", - "column-rule-style", - "column-rule-width", - "column-span", - "column-width", - "columnCount", - "columnFill", - "columnGap", - "columnNumber", - "columnRule", - "columnRuleColor", - "columnRuleStyle", - "columnRuleWidth", - "columnSpan", - "columnWidth", - "columns", - "command", - "commit", - "commitLoadTime", - "commitPreferences", - "commitStyles", - "commonAncestorContainer", - "compact", - "compare", - "compareBoundaryPoints", - "compareDocumentPosition", - "compareEndPoints", - "compareExchange", - "compareNode", - "comparePoint", - "compatMode", - "compatible", - "compile", - "compileShader", - "compileStreaming", - "complete", - "component", - "componentFromPoint", - "composed", - "composedPath", - "composite", - "compositionEndOffset", - "compositionStartOffset", - "compressedTexImage2D", - "compressedTexImage3D", - "compressedTexSubImage2D", - "compressedTexSubImage3D", - "computedStyleMap", - "concat", - "conditionText", - "coneInnerAngle", - "coneOuterAngle", - "coneOuterGain", - "configuration", - "configurationName", - "configurationValue", - "configurations", - "confirm", - "confirmComposition", - "confirmSiteSpecificTrackingException", - "confirmWebWideTrackingException", - "connect", - "connectEnd", - "connectStart", - "connected", - "connectedCallback", - "connection", - "connectionInfo", - "connectionList", - "connectionSpeed", - "connectionState", - "connections", - "console", - "consoleHistory", - "consolidate", - "constraint", - "constrictionActive", - "construct", - "constructor", - "contactID", - "contain", - "containIntrinsicSize", - "containerId", - "containerName", - "containerSrc", - "containerType", - "contains", - "containsNode", - "content", - "contentBoxSize", - "contentDocument", - "contentEditable", - "contentHint", - "contentOverflow", - "contentRect", - "contentScriptType", - "contentStyleType", - "contentType", - "contentWindow", - "context", - "contextMenu", - "contextmenu", - "continue", - "continuePrimaryKey", - "continuous", - "control", - "controlTransferIn", - "controlTransferOut", - "controller", - "controls", - "controlsList", - "convertToBlob", - "convertToSpecifiedUnits", - "cookie", - "cookieEnabled", - "coords", - "copyBufferSubData", - "copyFromChannel", - "copyTexImage2D", - "copyTexSubImage2D", - "copyTexSubImage3D", - "copyToChannel", - "copyWithin", - "correspondingElement", - "correspondingUseElement", - "corruptedVideoFrames", - "cos", - "cosh", - "count", - "countReset", - "counter-increment", - "counter-reset", - "counter-set", - "counterIncrement", - "counterReset", - "counterSet", - "country", - "cpuClass", - "cpuSleepAllowed", - "create", - "createAnalyser", - "createAnswer", - "createAttribute", - "createAttributeNS", - "createBiquadFilter", - "createBuffer", - "createBufferSource", - "createCDATASection", - "createCSSStyleSheet", - "createCaption", - "createChannelMerger", - "createChannelSplitter", - "createComment", - "createConstantSource", - "createContextualFragment", - "createControlRange", - "createConvolver", - "createDTMFSender", - "createDataChannel", - "createDelay", - "createDelayNode", - "createDocument", - "createDocumentFragment", - "createDocumentType", - "createDynamicsCompressor", - "createElement", - "createElementNS", - "createEntityReference", - "createEvent", - "createEventObject", - "createExpression", - "createFramebuffer", - "createFunction", - "createGain", - "createGainNode", - "createHTML", - "createHTMLDocument", - "createIIRFilter", - "createImageBitmap", - "createImageData", - "createIndex", - "createJavaScriptNode", - "createLinearGradient", - "createMediaElementSource", - "createMediaKeys", - "createMediaStreamDestination", - "createMediaStreamSource", - "createMediaStreamTrackSource", - "createMutableFile", - "createNSResolver", - "createNodeIterator", - "createNotification", - "createObjectStore", - "createObjectURL", - "createOffer", - "createOscillator", - "createPanner", - "createPattern", - "createPeriodicWave", - "createPolicy", - "createPopup", - "createProcessingInstruction", - "createProgram", - "createQuery", - "createRadialGradient", - "createRange", - "createRangeCollection", - "createReader", - "createRenderbuffer", - "createSVGAngle", - "createSVGLength", - "createSVGMatrix", - "createSVGNumber", - "createSVGPathSegArcAbs", - "createSVGPathSegArcRel", - "createSVGPathSegClosePath", - "createSVGPathSegCurvetoCubicAbs", - "createSVGPathSegCurvetoCubicRel", - "createSVGPathSegCurvetoCubicSmoothAbs", - "createSVGPathSegCurvetoCubicSmoothRel", - "createSVGPathSegCurvetoQuadraticAbs", - "createSVGPathSegCurvetoQuadraticRel", - "createSVGPathSegCurvetoQuadraticSmoothAbs", - "createSVGPathSegCurvetoQuadraticSmoothRel", - "createSVGPathSegLinetoAbs", - "createSVGPathSegLinetoHorizontalAbs", - "createSVGPathSegLinetoHorizontalRel", - "createSVGPathSegLinetoRel", - "createSVGPathSegLinetoVerticalAbs", - "createSVGPathSegLinetoVerticalRel", - "createSVGPathSegMovetoAbs", - "createSVGPathSegMovetoRel", - "createSVGPoint", - "createSVGRect", - "createSVGTransform", - "createSVGTransformFromMatrix", - "createSampler", - "createScript", - "createScriptProcessor", - "createScriptURL", - "createSession", - "createShader", - "createShadowRoot", - "createStereoPanner", - "createStyleSheet", - "createTBody", - "createTFoot", - "createTHead", - "createTextNode", - "createTextRange", - "createTexture", - "createTouch", - "createTouchList", - "createTransformFeedback", - "createTreeWalker", - "createVertexArray", - "createWaveShaper", - "creationTime", - "credentials", - "crossOrigin", - "crossOriginIsolated", - "crypto", - "csi", - "csp", - "cssFloat", - "cssRules", - "cssText", - "cssValueType", - "ctrlKey", - "ctrlLeft", - "cues", - "cullFace", - "currency", - "currencyDisplay", - "current", - "currentDirection", - "currentLocalDescription", - "currentNode", - "currentPage", - "currentRect", - "currentRemoteDescription", - "currentScale", - "currentScript", - "currentSrc", - "currentState", - "currentStyle", - "currentTarget", - "currentTime", - "currentTranslate", - "currentView", - "cursor", - "curve", - "customElements", - "customError", - "customSections", - "cx", - "cy", - "d", - "data", - "dataFld", - "dataFormatAs", - "dataLoss", - "dataLossMessage", - "dataPageSize", - "dataSrc", - "dataTransfer", - "database", - "databases", - "dataset", - "dateTime", - "day", - "db", - "debug", - "debuggerEnabled", - "declare", - "decode", - "decodeAudioData", - "decodeURI", - "decodeURIComponent", - "decodedBodySize", - "decoding", - "decodingInfo", - "decrypt", - "default", - "defaultCharset", - "defaultChecked", - "defaultMuted", - "defaultPlaybackRate", - "defaultPolicy", - "defaultPrevented", - "defaultRequest", - "defaultSelected", - "defaultStatus", - "defaultURL", - "defaultValue", - "defaultView", - "defaultstatus", - "defer", - "define", - "defineMagicFunction", - "defineMagicVariable", - "defineProperties", - "defineProperty", - "deg", - "delay", - "delayTime", - "delegatesFocus", - "delete", - "deleteBuffer", - "deleteCaption", - "deleteCell", - "deleteContents", - "deleteData", - "deleteDatabase", - "deleteFramebuffer", - "deleteFromDocument", - "deleteIndex", - "deleteMedium", - "deleteObjectStore", - "deleteProgram", - "deleteProperty", - "deleteQuery", - "deleteRenderbuffer", - "deleteRow", - "deleteRule", - "deleteSampler", - "deleteShader", - "deleteSync", - "deleteTFoot", - "deleteTHead", - "deleteTexture", - "deleteTransformFeedback", - "deleteVertexArray", - "deliverChangeRecords", - "delivery", - "deliveryInfo", - "deliveryStatus", - "deliveryTimestamp", - "delta", - "deltaMode", - "deltaX", - "deltaY", - "deltaZ", - "dependentLocality", - "depthFar", - "depthFunc", - "depthMask", - "depthNear", - "depthRange", - "deref", - "deriveBits", - "deriveKey", - "description", - "deselectAll", - "designMode", - "desiredSize", - "destination", - "destinationURL", - "detach", - "detachEvent", - "detachShader", - "detail", - "details", - "detect", - "detune", - "device", - "deviceClass", - "deviceId", - "deviceMemory", - "devicePixelContentBoxSize", - "devicePixelRatio", - "deviceProtocol", - "deviceSessionId", - "deviceSubclass", - "deviceVersionMajor", - "deviceVersionMinor", - "deviceVersionSubminor", - "deviceXDPI", - "deviceYDPI", - "didTimeout", - "diffuseConstant", - "digest", - "dimensions", - "dir", - "dirName", - "dirXml", - "direction", - "dirxml", - "disable", - "disablePictureInPicture", - "disableRemotePlayback", - "disableVertexAttribArray", - "disabled", - "dischargingTime", - "disconnect", - "disconnectedCallback", - "dispatch", - "dispatchEvent", - "dispatchToListener", - "display", - "displayId", - "displayName", - "disposition", - "distanceModel", - "div", - "divisor", - "djsapi", - "djsproxy", - "doImport", - "doNotTrack", - "doScroll", - "doctype", - "document", - "documentElement", - "documentMode", - "documentURI", - "dolphin", - "dolphinGameCenter", - "dolphininfo", - "dolphinmeta", - "domComplete", - "domContentLoadedEventEnd", - "domContentLoadedEventStart", - "domInteractive", - "domLoading", - "domOverlayState", - "domain", - "domainLookupEnd", - "domainLookupStart", - "dominant-baseline", - "dominantBaseline", - "done", - "dopplerFactor", - "dotAll", - "downDegrees", - "downlink", - "download", - "downloadTotal", - "downloaded", - "dpcm", - "dpi", - "dppx", - "dragDrop", - "draggable", - "drawArrays", - "drawArraysInstanced", - "drawArraysInstancedANGLE", - "drawBuffers", - "drawCustomFocusRing", - "drawElements", - "drawElementsInstanced", - "drawElementsInstancedANGLE", - "drawFocusIfNeeded", - "drawImage", - "drawImageFromRect", - "drawRangeElements", - "drawSystemFocusRing", - "drawingBufferHeight", - "drawingBufferWidth", - "dropEffect", - "droppedVideoFrames", - "dropzone", - "dtmf", - "dump", - "duplicate", - "durability", - "duration", - "dvname", - "dvnum", - "dx", - "dy", - "dynsrc", - "e", - "edgeMode", - "effect", - "effectAllowed", - "effectiveDirective", - "effectiveType", - "elapsedTime", - "element", - "elementFromPoint", - "elementTiming", - "elements", - "elementsFromPoint", - "elevation", - "ellipse", - "em", - "emHeightAscent", - "emHeightDescent", - "email", - "embeds", - "emma", - "empty", - "empty-cells", - "emptyCells", - "emptyHTML", - "emptyScript", - "emulatedPosition", - "enable", - "enableBackground", - "enableDelegations", - "enableStyleSheetsForSet", - "enableVertexAttribArray", - "enabled", - "enabledPlugin", - "encode", - "encodeInto", - "encodeURI", - "encodeURIComponent", - "encodedBodySize", - "encoding", - "encodingInfo", - "encrypt", - "enctype", - "end", - "endContainer", - "endElement", - "endElementAt", - "endOfStream", - "endOffset", - "endQuery", - "endTime", - "endTransformFeedback", - "ended", - "endpoint", - "endpointNumber", - "endpoints", - "endsWith", - "enterKeyHint", - "entities", - "entries", - "entryType", - "enumerate", - "enumerateDevices", - "enumerateEditable", - "environmentBlendMode", - "epubCaptionSide", - "epubTextCombine", - "epubTextEmphasis", - "epubTextEmphasisColor", - "epubTextEmphasisStyle", - "epubTextOrientation", - "epubTextTransform", - "epubWordBreak", - "epubWritingMode", - "equals", - "era", - "error", - "errorCode", - "errorDetail", - "errorText", - "escape", - "estimate", - "eval", - "evaluate", - "event", - "eventPhase", - "every", - "ex", - "exception", - "exchange", - "exec", - "execCommand", - "execCommandShowHelp", - "execScript", - "executeSql", - "exitFullscreen", - "exitPictureInPicture", - "exitPointerLock", - "exitPresent", - "exp", - "expand", - "expandEntityReferences", - "expando", - "expansion", - "expiration", - "expirationTime", - "expires", - "expiryDate", - "explicitOriginalTarget", - "expm1", - "exponent", - "exponentialRampToValueAtTime", - "exportKey", - "exports", - "extend", - "extensions", - "extentNode", - "extentOffset", - "external", - "externalResourcesRequired", - "extractContents", - "extractable", - "eye", - "f", - "face", - "factoryReset", - "failureReason", - "fallback", - "family", - "familyName", - "farthestViewportElement", - "fastSeek", - "fatal", - "featurePolicy", - "featureSettings", - "features", - "fenceSync", - "fetch", - "fetchStart", - "fftSize", - "fgColor", - "fieldOfView", - "file", - "fileCreatedDate", - "fileHandle", - "fileModifiedDate", - "fileName", - "fileSize", - "fileUpdatedDate", - "filename", - "files", - "filesystem", - "fill", - "fill-opacity", - "fill-rule", - "fillLightMode", - "fillOpacity", - "fillRect", - "fillRule", - "fillStyle", - "fillText", - "filter", - "filterResX", - "filterResY", - "filterUnits", - "filters", - "finally", - "find", - "findIndex", - "findRule", - "findText", - "finish", - "finishDocumentLoadTime", - "finishLoadTime", - "finished", - "fireEvent", - "firesTouchEvents", - "first", - "firstChild", - "firstElementChild", - "firstPage", - "firstPaintAfterLoadTime", - "firstPaintTime", - "fixed", - "flags", - "flat", - "flatMap", - "flex", - "flex-basis", - "flex-direction", - "flex-flow", - "flex-grow", - "flex-shrink", - "flex-wrap", - "flexBasis", - "flexDirection", - "flexFlow", - "flexGrow", - "flexShrink", - "flexWrap", - "flipX", - "flipY", - "float", - "flood-color", - "flood-opacity", - "floodColor", - "floodOpacity", - "floor", - "flush", - "focus", - "focusNode", - "focusOffset", - "font", - "font-family", - "font-feature-settings", - "font-kerning", - "font-language-override", - "font-size", - "font-size-adjust", - "font-stretch", - "font-style", - "font-synthesis", - "font-variant", - "font-variant-alternates", - "font-variant-caps", - "font-variant-east-asian", - "font-variant-ligatures", - "font-variant-numeric", - "font-variant-position", - "font-weight", - "fontBoundingBoxAscent", - "fontBoundingBoxDescent", - "fontDisplay", - "fontFamily", - "fontFeatureSettings", - "fontKerning", - "fontLanguageOverride", - "fontOpticalSizing", - "fontSize", - "fontSizeAdjust", - "fontSmoothingEnabled", - "fontStretch", - "fontStyle", - "fontSynthesis", - "fontVariant", - "fontVariantAlternates", - "fontVariantCaps", - "fontVariantEastAsian", - "fontVariantLigatures", - "fontVariantNumeric", - "fontVariantPosition", - "fontVariationSettings", - "fontWeight", - "fontcolor", - "fontfaces", - "fonts", - "fontsize", - "for", - "forEach", - "force", - "forceRedraw", - "form", - "formAction", - "formData", - "formEnctype", - "formMethod", - "formNoValidate", - "formTarget", - "format", - "formatRange", - "formatRangeToParts", - "formatToParts", - "forms", - "forward", - "forwardX", - "forwardY", - "forwardZ", - "foundation", - "fr", - "fragmentDirective", - "frame", - "frameBorder", - "frameElement", - "frameSpacing", - "framebuffer", - "framebufferHeight", - "framebufferRenderbuffer", - "framebufferTexture2D", - "framebufferTextureLayer", - "framebufferWidth", - "frames", - "freeSpace", - "freeze", - "frequency", - "frequencyBinCount", - "from", - "fromCharCode", - "fromCodePoint", - "fromElement", - "fromEntries", - "fromFloat32Array", - "fromFloat64Array", - "fromMatrix", - "fromPoint", - "fromQuad", - "fromRect", - "frontFace", - "fround", - "fullPath", - "fullScreen", - "fullscreen", - "fullscreenElement", - "fullscreenEnabled", - "fx", - "fy", - "gain", - "gamepad", - "gamma", - "gap", - "gatheringState", - "gatt", - "genderIdentity", - "generateCertificate", - "generateKey", - "generateMipmap", - "generateRequest", - "geolocation", - "gestureObject", - "get", - "getActiveAttrib", - "getActiveUniform", - "getActiveUniformBlockName", - "getActiveUniformBlockParameter", - "getActiveUniforms", - "getAdditionalLanguages", - "getAdjacentText", - "getAll", - "getAllKeys", - "getAllResponseHeaders", - "getAllowlistForFeature", - "getAnimations", - "getAsFile", - "getAsString", - "getAttachedShaders", - "getAttribLocation", - "getAttribute", - "getAttributeNS", - "getAttributeNames", - "getAttributeNode", - "getAttributeNodeNS", - "getAttributeType", - "getAudioTracks", - "getAvailability", - "getBBox", - "getBattery", - "getBigInt64", - "getBigUint64", - "getBlob", - "getBookmark", - "getBoundingClientRect", - "getBounds", - "getBufferParameter", - "getBufferSubData", - "getByteFrequencyData", - "getByteTimeDomainData", - "getCSSCanvasContext", - "getCTM", - "getCandidateWindowClientRect", - "getCanonicalLocales", - "getCapabilities", - "getChannelData", - "getCharNumAtPosition", - "getCharacteristic", - "getCharacteristics", - "getClientExtensionResults", - "getClientRect", - "getClientRects", - "getCoalescedEvents", - "getCompositionAlternatives", - "getComputedStyle", - "getComputedTextLength", - "getComputedTiming", - "getConfiguration", - "getConstraints", - "getContext", - "getContextAttributes", - "getContributingSources", - "getCount", - "getCounterValue", - "getCueAsHTML", - "getCueById", - "getCurrentPosition", - "getCurrentTime", - "getData", - "getDatabaseNames", - "getDate", - "getDay", - "getDefaultComputedStyle", - "getDescriptor", - "getDescriptors", - "getDestinationInsertionPoints", - "getDetails", - "getDevices", - "getDirectory", - "getDisplayMedia", - "getDistributedNodes", - "getEditable", - "getElementById", - "getElementsByClassName", - "getElementsByName", - "getElementsByTagName", - "getElementsByTagNameNS", - "getEnclosureList", - "getEndPositionOfChar", - "getEntries", - "getEntriesByName", - "getEntriesByType", - "getError", - "getExtension", - "getExtentOfChar", - "getEyeParameters", - "getFeature", - "getFile", - "getFiles", - "getFilesAndDirectories", - "getFingerprints", - "getFloat32", - "getFloat64", - "getFloatFrequencyData", - "getFloatTimeDomainData", - "getFloatValue", - "getFragDataLocation", - "getFrameData", - "getFramebufferAttachmentParameter", - "getFrequencyResponse", - "getFullYear", - "getGamepads", - "getHitTestResults", - "getHitTestResultsForTransientInput", - "getHours", - "getIdentityAssertion", - "getIds", - "getImageData", - "getIndexedParameter", - "getInstalled", - "getInstalledRelatedApps", - "getInt16", - "getInt32", - "getInt8", - "getInternalformatParameter", - "getIntersectionList", - "getIsInstalled", - "getItem", - "getItems", - "getKey", - "getKeyframes", - "getLayers", - "getLayoutMap", - "getLineDash", - "getLocalCandidates", - "getLocalParameters", - "getLocalStreams", - "getLocalizationResource", - "getMarks", - "getMatchedCSSRules", - "getMeasures", - "getMetadata", - "getMilliseconds", - "getMinutes", - "getModifierState", - "getMonth", - "getNamedItem", - "getNamedItemNS", - "getNativeFramebufferScaleFactor", - "getNotifications", - "getNotifier", - "getNumberOfChars", - "getOffsetReferenceSpace", - "getOutputTimestamp", - "getOverrideHistoryNavigationMode", - "getOverrideStyle", - "getOwnPropertyDescriptor", - "getOwnPropertyDescriptors", - "getOwnPropertyNames", - "getOwnPropertySymbols", - "getParameter", - "getParameters", - "getParent", - "getPathSegAtLength", - "getPhotoCapabilities", - "getPhotoSettings", - "getPointAtLength", - "getPose", - "getPredictedEvents", - "getPreference", - "getPreferenceDefault", - "getPresentationAttribute", - "getPreventDefault", - "getPrimaryService", - "getPrimaryServices", - "getProgramInfoLog", - "getProgramParameter", - "getPropertyCSSValue", - "getPropertyPriority", - "getPropertyShorthand", - "getPropertyType", - "getPropertyValue", - "getPrototypeOf", - "getQuery", - "getQueryParameter", - "getRGBColorValue", - "getRandomValues", - "getRangeAt", - "getReader", - "getReceivers", - "getRectValue", - "getRegistration", - "getRegistrations", - "getRemoteCandidates", - "getRemoteCertificates", - "getRemoteParameters", - "getRemoteStreams", - "getRenderbufferParameter", - "getResponseHeader", - "getRevision", - "getRoot", - "getRootNode", - "getRotationOfChar", - "getRules", - "getSVGDocument", - "getSamplerParameter", - "getScreenCTM", - "getSeconds", - "getSelectedCandidatePair", - "getSelection", - "getSelf", - "getSenders", - "getService", - "getSettings", - "getShaderInfoLog", - "getShaderParameter", - "getShaderPrecisionFormat", - "getShaderSource", - "getSimpleDuration", - "getSiteIcons", - "getSources", - "getSpeculativeParserUrls", - "getStartDate", - "getStartPositionOfChar", - "getStartTime", - "getState", - "getStats", - "getStatusForPolicy", - "getStorageUpdates", - "getStreamById", - "getStringValue", - "getSubStringLength", - "getSubscription", - "getSupportedConstraints", - "getSupportedExtensions", - "getSupportedFormats", - "getSyncParameter", - "getSynchronizationSources", - "getTags", - "getTargetRanges", - "getTexParameter", - "getTime", - "getTimezoneOffset", - "getTiming", - "getTotalLength", - "getTrackById", - "getTracks", - "getTransceivers", - "getTransform", - "getTransformFeedbackVarying", - "getTransformToElement", - "getTransports", - "getType", - "getTypeMapping", - "getUTCDate", - "getUTCDay", - "getUTCFullYear", - "getUTCHours", - "getUTCMilliseconds", - "getUTCMinutes", - "getUTCMonth", - "getUTCSeconds", - "getUint16", - "getUint32", - "getUint8", - "getUniform", - "getUniformBlockIndex", - "getUniformIndices", - "getUniformLocation", - "getUserMedia", - "getVRDisplays", - "getValues", - "getVarDate", - "getVariableValue", - "getVertexAttrib", - "getVertexAttribOffset", - "getVideoPlaybackQuality", - "getVideoTracks", - "getViewerPose", - "getViewport", - "getVoices", - "getWakeLockState", - "getWriter", - "getYear", - "givenName", - "global", - "globalAlpha", - "globalCompositeOperation", - "globalThis", - "glyphOrientationHorizontal", - "glyphOrientationVertical", - "glyphRef", - "go", - "grabFrame", - "grad", - "gradientTransform", - "gradientUnits", - "grammars", - "green", - "grid", - "grid-area", - "grid-auto-columns", - "grid-auto-flow", - "grid-auto-rows", - "grid-column", - "grid-column-end", - "grid-column-gap", - "grid-column-start", - "grid-gap", - "grid-row", - "grid-row-end", - "grid-row-gap", - "grid-row-start", - "grid-template", - "grid-template-areas", - "grid-template-columns", - "grid-template-rows", - "gridArea", - "gridAutoColumns", - "gridAutoFlow", - "gridAutoRows", - "gridColumn", - "gridColumnEnd", - "gridColumnGap", - "gridColumnStart", - "gridGap", - "gridRow", - "gridRowEnd", - "gridRowGap", - "gridRowStart", - "gridTemplate", - "gridTemplateAreas", - "gridTemplateColumns", - "gridTemplateRows", - "gripSpace", - "group", - "groupCollapsed", - "groupEnd", - "groupId", - "grow", - "hadRecentInput", - "hand", - "handedness", - "hangingBaseline", - "hangingPunctuation", - "hapticActuators", - "hardwareConcurrency", - "has", - "hasAttribute", - "hasAttributeNS", - "hasAttributes", - "hasBeenActive", - "hasChildNodes", - "hasComposition", - "hasEnrolledInstrument", - "hasExtension", - "hasExternalDisplay", - "hasFeature", - "hasFocus", - "hasInstance", - "hasLayout", - "hasListener", - "hasListeners", - "hasOrientation", - "hasOwnProperty", - "hasPointerCapture", - "hasPosition", - "hasReading", - "hasStorageAccess", - "hash", - "head", - "headers", - "heading", - "height", - "hidden", - "hide", - "hideFocus", - "high", - "highWaterMark", - "hint", - "history", - "honorificPrefix", - "honorificSuffix", - "horizontalOverflow", - "host", - "hostCandidate", - "hostname", - "hour", - "hour12", - "hourCycle", - "href", - "hrefTranslate", - "hreflang", - "hspace", - "html5TagCheckInerface", - "htmlFor", - "htmlText", - "httpEquiv", - "httpRequestStatusCode", - "hwTimestamp", - "hyphens", - "hypot", - "iccId", - "iceConnectionState", - "iceGatheringState", - "iceTransport", - "icon", - "iconURL", - "id", - "identifier", - "identity", - "ideographicBaseline", - "idpLoginUrl", - "ignoreBOM", - "ignoreCase", - "ignoreDepthValues", - "ignoreMutedMedia", - "ignorePunctuation", - "image-orientation", - "image-rendering", - "imageHeight", - "imageOrientation", - "imageRendering", - "imageSizes", - "imageSmoothingEnabled", - "imageSmoothingQuality", - "imageSrcset", - "imageWidth", - "images", - "ime-mode", - "imeMode", - "implementation", - "import", - "importKey", - "importNode", - "importStylesheet", - "imports", - "impp", - "imul", - "in", - "in1", - "in2", - "inBandMetadataTrackDispatchType", - "inRange", - "includes", - "incremental", - "indeterminate", - "index", - "indexNames", - "indexOf", - "indexedDB", - "indicate", - "inertiaDestinationX", - "inertiaDestinationY", - "info", - "init", - "initAnimationEvent", - "initBeforeLoadEvent", - "initClipboardEvent", - "initCloseEvent", - "initCommandEvent", - "initCompositionEvent", - "initCustomEvent", - "initData", - "initDataType", - "initDeviceMotionEvent", - "initDeviceOrientationEvent", - "initDragEvent", - "initErrorEvent", - "initEvent", - "initFocusEvent", - "initGestureEvent", - "initHashChangeEvent", - "initKeyEvent", - "initKeyboardEvent", - "initMSManipulationEvent", - "initMessageEvent", - "initMouseEvent", - "initMouseScrollEvent", - "initMouseWheelEvent", - "initMutationEvent", - "initNSMouseEvent", - "initOverflowEvent", - "initPageEvent", - "initPageTransitionEvent", - "initPointerEvent", - "initPopStateEvent", - "initProgressEvent", - "initScrollAreaEvent", - "initSimpleGestureEvent", - "initStorageEvent", - "initTextEvent", - "initTimeEvent", - "initTouchEvent", - "initTransitionEvent", - "initUIEvent", - "initWebKitAnimationEvent", - "initWebKitTransitionEvent", - "initWebKitWheelEvent", - "initWheelEvent", - "initialTime", - "initialize", - "initiatorType", - "inline-size", - "inlineSize", - "inlineVerticalFieldOfView", - "inner", - "innerHTML", - "innerHeight", - "innerText", - "innerWidth", - "input", - "inputBuffer", - "inputEncoding", - "inputMethod", - "inputMode", - "inputSource", - "inputSources", - "inputType", - "inputs", - "insertAdjacentElement", - "insertAdjacentHTML", - "insertAdjacentText", - "insertBefore", - "insertCell", - "insertDTMF", - "insertData", - "insertId", - "insertItemBefore", - "insertNode", - "insertRow", - "insertRule", - "inset", - "inset-block", - "inset-block-end", - "inset-block-start", - "inset-inline", - "inset-inline-end", - "inset-inline-start", - "insetBlock", - "insetBlockEnd", - "insetBlockStart", - "insetInline", - "insetInlineEnd", - "insetInlineStart", - "install", - "installChrome", - "installPackage", - "installState", - "installing", - "instanceRoot", - "instantiate", - "instantiateStreaming", - "instruments", - "integrity", - "interactionMode", - "intercept", - "interfaceClass", - "interfaceName", - "interfaceNumber", - "interfaceProtocol", - "interfaceSubclass", - "interfaces", - "interimResults", - "internalSubset", - "interpretation", - "intersectionRatio", - "intersectionRect", - "intersectsNode", - "interval", - "invalidIteratorState", - "invalidateFramebuffer", - "invalidateSubFramebuffer", - "inverse", - "invertSelf", - "is", - "is2D", - "isActive", - "isAlternate", - "isArray", - "isBingCurrentSearchDefault", - "isBuffer", - "isCandidateWindowVisible", - "isChar", - "isCollapsed", - "isComposing", - "isConcatSpreadable", - "isConnected", - "isContentEditable", - "isContentHandlerRegistered", - "isContextLost", - "isDefaultNamespace", - "isDirectory", - "isDisabled", - "isEnabled", - "isEqual", - "isEqualNode", - "isExtensible", - "isExternalCTAP2SecurityKeySupported", - "isFile", - "isFinite", - "isFramebuffer", - "isFrozen", - "isGenerator", - "isHTML", - "isHistoryNavigation", - "isId", - "isIdentity", - "isInjected", - "isInstalled", - "isInteger", - "isIntersecting", - "isLockFree", - "isMap", - "isMultiLine", - "isNaN", - "isOpen", - "isPointInFill", - "isPointInPath", - "isPointInRange", - "isPointInStroke", - "isPrefAlternate", - "isPresenting", - "isPrimary", - "isProgram", - "isPropertyImplicit", - "isProtocolHandlerRegistered", - "isPrototypeOf", - "isQuery", - "isRenderbuffer", - "isSafeInteger", - "isSameNode", - "isSampler", - "isScript", - "isScriptURL", - "isSealed", - "isSecureContext", - "isSessionSupported", - "isShader", - "isSupported", - "isSync", - "isTextEdit", - "isTexture", - "isTransformFeedback", - "isTrusted", - "isTypeSupported", - "isTypeSupportedWithFeatures", - "isUserVerifyingPlatformAuthenticatorAvailable", - "isVertexArray", - "isView", - "isVisible", - "isochronousTransferIn", - "isochronousTransferOut", - "isolation", - "italics", - "item", - "itemId", - "itemProp", - "itemRef", - "itemScope", - "itemType", - "itemValue", - "items", - "iterateNext", - "iterator", - "javaEnabled", - "jobTitle", - "join", - "jsHeapSizeLimit", - "json", - "justify-content", - "justify-items", - "justify-self", - "justifyContent", - "justifyItems", - "justifySelf", - "k1", - "k2", - "k3", - "k4", - "kHz", - "keepalive", - "kernelMatrix", - "kernelUnitLengthX", - "kernelUnitLengthY", - "kerning", - "key", - "keyCode", - "keyFor", - "keyIdentifier", - "keyLightEnabled", - "keyLocation", - "keyPath", - "keyStatuses", - "keySystem", - "keyText", - "keyUsage", - "keyboard", - "keys", - "keytype", - "kind", - "knee", - "label", - "labels", - "lang", - "language", - "languages", - "largeArcFlag", - "lastActivePanel", - "lastChild", - "lastElementChild", - "lastEventId", - "lastIndex", - "lastIndexOf", - "lastInputTime", - "lastMatch", - "lastMessageSubject", - "lastMessageType", - "lastModified", - "lastModifiedDate", - "lastPage", - "lastParen", - "lastState", - "lastStyleSheetSet", - "latitude", - "layerX", - "layerY", - "layoutFlow", - "layoutGrid", - "layoutGridChar", - "layoutGridLine", - "layoutGridMode", - "layoutGridType", - "lbound", - "left", - "leftContext", - "leftDegrees", - "leftMargin", - "leftProjectionMatrix", - "leftViewMatrix", - "length", - "lengthAdjust", - "lengthComputable", - "letter-spacing", - "letterSpacing", - "level", - "lighting-color", - "lightingColor", - "limitingConeAngle", - "line", - "line-break", - "line-height", - "lineAlign", - "lineBreak", - "lineCap", - "lineDashOffset", - "lineHeight", - "lineJoin", - "lineNumber", - "lineTo", - "lineWidth", - "linearAcceleration", - "linearRampToValueAtTime", - "linearVelocity", - "lineno", - "lines", - "link", - "linkColor", - "linkProgram", - "links", - "list", - "list-style", - "list-style-image", - "list-style-position", - "list-style-type", - "listStyle", - "listStyleImage", - "listStylePosition", - "listStyleType", - "listener", - "load", - "loadEventEnd", - "loadEventStart", - "loadTime", - "loadTimes", - "loaded", - "loading", - "localDescription", - "localName", - "localService", - "localStorage", - "locale", - "localeCompare", - "location", - "locationbar", - "lock", - "locked", - "lockedFile", - "locks", - "log", - "log10", - "log1p", - "log2", - "logicalXDPI", - "logicalYDPI", - "longDesc", - "longitude", - "lookupNamespaceURI", - "lookupPrefix", - "loop", - "loopEnd", - "loopStart", - "looping", - "low", - "lower", - "lowerBound", - "lowerOpen", - "lowsrc", - "m11", - "m12", - "m13", - "m14", - "m21", - "m22", - "m23", - "m24", - "m31", - "m32", - "m33", - "m34", - "m41", - "m42", - "m43", - "m44", - "makeXRCompatible", - "manifest", - "manufacturer", - "manufacturerName", - "map", - "mapping", - "margin", - "margin-block", - "margin-block-end", - "margin-block-start", - "margin-bottom", - "margin-inline", - "margin-inline-end", - "margin-inline-start", - "margin-left", - "margin-right", - "margin-top", - "marginBlock", - "marginBlockEnd", - "marginBlockStart", - "marginBottom", - "marginHeight", - "marginInline", - "marginInlineEnd", - "marginInlineStart", - "marginLeft", - "marginRight", - "marginTop", - "marginWidth", - "mark", - "markTimeline", - "marker", - "marker-end", - "marker-mid", - "marker-offset", - "marker-start", - "markerEnd", - "markerHeight", - "markerMid", - "markerOffset", - "markerStart", - "markerUnits", - "markerWidth", - "marks", - "mask", - "mask-clip", - "mask-composite", - "mask-image", - "mask-mode", - "mask-origin", - "mask-position", - "mask-position-x", - "mask-position-y", - "mask-repeat", - "mask-size", - "mask-type", - "maskClip", - "maskComposite", - "maskContentUnits", - "maskImage", - "maskMode", - "maskOrigin", - "maskPosition", - "maskPositionX", - "maskPositionY", - "maskRepeat", - "maskSize", - "maskType", - "maskUnits", - "match", - "matchAll", - "matchMedia", - "matchMedium", - "matches", - "matrix", - "matrixTransform", - "max", - "max-block-size", - "max-height", - "max-inline-size", - "max-width", - "maxActions", - "maxAlternatives", - "maxBlockSize", - "maxChannelCount", - "maxChannels", - "maxConnectionsPerServer", - "maxDecibels", - "maxDistance", - "maxHeight", - "maxInlineSize", - "maxLayers", - "maxLength", - "maxMessageSize", - "maxPacketLifeTime", - "maxRetransmits", - "maxTouchPoints", - "maxValue", - "maxWidth", - "maxZoom", - "maximize", - "maximumFractionDigits", - "measure", - "measureText", - "media", - "mediaCapabilities", - "mediaDevices", - "mediaElement", - "mediaGroup", - "mediaKeys", - "mediaSession", - "mediaStream", - "mediaText", - "meetOrSlice", - "memory", - "menubar", - "mergeAttributes", - "message", - "messageClass", - "messageHandlers", - "messageType", - "metaKey", - "metadata", - "method", - "methodDetails", - "methodName", - "mid", - "mimeType", - "mimeTypes", - "min", - "min-block-size", - "min-height", - "min-inline-size", - "min-width", - "minBlockSize", - "minDecibels", - "minHeight", - "minInlineSize", - "minLength", - "minValue", - "minWidth", - "minZoom", - "minimize", - "minimumFractionDigits", - "minimumIntegerDigits", - "minute", - "miterLimit", - "mix-blend-mode", - "mixBlendMode", - "mm", - "mode", - "modify", - "month", - "motion", - "motionOffset", - "motionPath", - "motionRotation", - "mount", - "move", - "moveBy", - "moveEnd", - "moveFirst", - "moveFocusDown", - "moveFocusLeft", - "moveFocusRight", - "moveFocusUp", - "moveNext", - "moveRow", - "moveStart", - "moveTo", - "moveToBookmark", - "moveToElementText", - "moveToPoint", - "movementX", - "movementY", - "mozAdd", - "mozAnimationStartTime", - "mozAnon", - "mozApps", - "mozAudioCaptured", - "mozAudioChannelType", - "mozAutoplayEnabled", - "mozCancelAnimationFrame", - "mozCancelFullScreen", - "mozCancelRequestAnimationFrame", - "mozCaptureStream", - "mozCaptureStreamUntilEnded", - "mozClearDataAt", - "mozContact", - "mozContacts", - "mozCreateFileHandle", - "mozCurrentTransform", - "mozCurrentTransformInverse", - "mozCursor", - "mozDash", - "mozDashOffset", - "mozDecodedFrames", - "mozExitPointerLock", - "mozFillRule", - "mozFragmentEnd", - "mozFrameDelay", - "mozFullScreen", - "mozFullScreenElement", - "mozFullScreenEnabled", - "mozGetAll", - "mozGetAllKeys", - "mozGetAsFile", - "mozGetDataAt", - "mozGetMetadata", - "mozGetUserMedia", - "mozHasAudio", - "mozHasItem", - "mozHidden", - "mozImageSmoothingEnabled", - "mozIndexedDB", - "mozInnerScreenX", - "mozInnerScreenY", - "mozInputSource", - "mozIsTextField", - "mozItem", - "mozItemCount", - "mozItems", - "mozLength", - "mozLockOrientation", - "mozMatchesSelector", - "mozMovementX", - "mozMovementY", - "mozOpaque", - "mozOrientation", - "mozPaintCount", - "mozPaintedFrames", - "mozParsedFrames", - "mozPay", - "mozPointerLockElement", - "mozPresentedFrames", - "mozPreservesPitch", - "mozPressure", - "mozPrintCallback", - "mozRTCIceCandidate", - "mozRTCPeerConnection", - "mozRTCSessionDescription", - "mozRemove", - "mozRequestAnimationFrame", - "mozRequestFullScreen", - "mozRequestPointerLock", - "mozSetDataAt", - "mozSetImageElement", - "mozSourceNode", - "mozSrcObject", - "mozSystem", - "mozTCPSocket", - "mozTextStyle", - "mozTypesAt", - "mozUnlockOrientation", - "mozUserCancelled", - "mozVisibilityState", - "ms", - "msAnimation", - "msAnimationDelay", - "msAnimationDirection", - "msAnimationDuration", - "msAnimationFillMode", - "msAnimationIterationCount", - "msAnimationName", - "msAnimationPlayState", - "msAnimationStartTime", - "msAnimationTimingFunction", - "msBackfaceVisibility", - "msBlockProgression", - "msCSSOMElementFloatMetrics", - "msCaching", - "msCachingEnabled", - "msCancelRequestAnimationFrame", - "msCapsLockWarningOff", - "msClearImmediate", - "msClose", - "msContentZoomChaining", - "msContentZoomFactor", - "msContentZoomLimit", - "msContentZoomLimitMax", - "msContentZoomLimitMin", - "msContentZoomSnap", - "msContentZoomSnapPoints", - "msContentZoomSnapType", - "msContentZooming", - "msConvertURL", - "msCrypto", - "msDoNotTrack", - "msElementsFromPoint", - "msElementsFromRect", - "msExitFullscreen", - "msExtendedCode", - "msFillRule", - "msFirstPaint", - "msFlex", - "msFlexAlign", - "msFlexDirection", - "msFlexFlow", - "msFlexItemAlign", - "msFlexLinePack", - "msFlexNegative", - "msFlexOrder", - "msFlexPack", - "msFlexPositive", - "msFlexPreferredSize", - "msFlexWrap", - "msFlowFrom", - "msFlowInto", - "msFontFeatureSettings", - "msFullscreenElement", - "msFullscreenEnabled", - "msGetInputContext", - "msGetRegionContent", - "msGetUntransformedBounds", - "msGraphicsTrustStatus", - "msGridColumn", - "msGridColumnAlign", - "msGridColumnSpan", - "msGridColumns", - "msGridRow", - "msGridRowAlign", - "msGridRowSpan", - "msGridRows", - "msHidden", - "msHighContrastAdjust", - "msHyphenateLimitChars", - "msHyphenateLimitLines", - "msHyphenateLimitZone", - "msHyphens", - "msImageSmoothingEnabled", - "msImeAlign", - "msIndexedDB", - "msInterpolationMode", - "msIsStaticHTML", - "msKeySystem", - "msKeys", - "msLaunchUri", - "msLockOrientation", - "msManipulationViewsEnabled", - "msMatchMedia", - "msMatchesSelector", - "msMaxTouchPoints", - "msOrientation", - "msOverflowStyle", - "msPerspective", - "msPerspectiveOrigin", - "msPlayToDisabled", - "msPlayToPreferredSourceUri", - "msPlayToPrimary", - "msPointerEnabled", - "msRegionOverflow", - "msReleasePointerCapture", - "msRequestAnimationFrame", - "msRequestFullscreen", - "msSaveBlob", - "msSaveOrOpenBlob", - "msScrollChaining", - "msScrollLimit", - "msScrollLimitXMax", - "msScrollLimitXMin", - "msScrollLimitYMax", - "msScrollLimitYMin", - "msScrollRails", - "msScrollSnapPointsX", - "msScrollSnapPointsY", - "msScrollSnapType", - "msScrollSnapX", - "msScrollSnapY", - "msScrollTranslation", - "msSetImmediate", - "msSetMediaKeys", - "msSetPointerCapture", - "msTextCombineHorizontal", - "msTextSizeAdjust", - "msToBlob", - "msTouchAction", - "msTouchSelect", - "msTraceAsyncCallbackCompleted", - "msTraceAsyncCallbackStarting", - "msTraceAsyncOperationCompleted", - "msTraceAsyncOperationStarting", - "msTransform", - "msTransformOrigin", - "msTransformStyle", - "msTransition", - "msTransitionDelay", - "msTransitionDuration", - "msTransitionProperty", - "msTransitionTimingFunction", - "msUnlockOrientation", - "msUpdateAsyncCallbackRelation", - "msUserSelect", - "msVisibilityState", - "msWrapFlow", - "msWrapMargin", - "msWrapThrough", - "msWriteProfilerMark", - "msZoom", - "msZoomTo", - "mt", - "mul", - "multiEntry", - "multiSelectionObj", - "multiline", - "multiple", - "multiply", - "multiplySelf", - "mutableFile", - "muted", - "n", - "name", - "nameProp", - "namedItem", - "namedRecordset", - "names", - "namespaceURI", - "namespaces", - "naturalHeight", - "naturalWidth", - "navigate", - "navigation", - "navigationMode", - "navigationPreload", - "navigationStart", - "navigationType", - "navigator", - "near", - "nearestViewportElement", - "negative", - "negotiated", - "netscape", - "networkState", - "newScale", - "newTranslate", - "newURL", - "newValue", - "newValueSpecifiedUnits", - "newVersion", - "newhome", - "next", - "nextElementSibling", - "nextHopProtocol", - "nextNode", - "nextPage", - "nextSibling", - "nickname", - "noHref", - "noModule", - "noResize", - "noShade", - "noValidate", - "noWrap", - "node", - "nodeName", - "nodeType", - "nodeValue", - "nonce", - "normalize", - "normalizedPathSegList", - "notationName", - "notations", - "note", - "noteGrainOn", - "noteOff", - "noteOn", - "notify", - "now", - "npnNegotiatedProtocol", - "numOctaves", - "number", - "numberOfChannels", - "numberOfInputs", - "numberOfItems", - "numberOfOutputs", - "numberValue", - "numberingSystem", - "numeric", - "oMatchesSelector", - "object", - "object-fit", - "object-position", - "objectFit", - "objectPosition", - "objectStore", - "objectStoreNames", - "observe", - "observedAttributes", - "of", - "offscreenBuffering", - "offset", - "offset-anchor", - "offset-block-end", - "offset-block-start", - "offset-distance", - "offset-inline-end", - "offset-inline-start", - "offset-path", - "offset-rotate", - "offsetAnchor", - "offsetBlockEnd", - "offsetBlockStart", - "offsetDistance", - "offsetHeight", - "offsetInlineEnd", - "offsetInlineStart", - "offsetLeft", - "offsetNode", - "offsetParent", - "offsetPath", - "offsetRotate", - "offsetTop", - "offsetWidth", - "offsetX", - "offsetY", - "ok", - "oldURL", - "oldValue", - "oldVersion", - "olderShadowRoot", - "onDownloadProgress", - "onInstallStageChanged", - "onLine", - "onabort", - "onabsolutedeviceorientation", - "onactivate", - "onactive", - "onaddsourcebuffer", - "onaddstream", - "onaddtrack", - "onafterprint", - "onafterscriptexecute", - "onafterupdate", - "onanimationcancel", - "onanimationend", - "onanimationiteration", - "onanimationstart", - "onappinstalled", - "onaudioend", - "onaudioprocess", - "onaudiostart", - "onautocomplete", - "onautocompleteerror", - "onauxclick", - "onbeforeactivate", - "onbeforecopy", - "onbeforecut", - "onbeforedeactivate", - "onbeforeeditfocus", - "onbeforeinput", - "onbeforeinstallprompt", - "onbeforeload", - "onbeforepaste", - "onbeforeprint", - "onbeforescriptexecute", - "onbeforeunload", - "onbeforeupdate", - "onbeforexrselect", - "onbegin", - "onblocked", - "onblur", - "onbounce", - "onboundary", - "onbufferedamountlow", - "oncached", - "oncancel", - "oncandidatewindowhide", - "oncandidatewindowshow", - "oncandidatewindowupdate", - "oncanplay", - "oncanplaythrough", - "once", - "oncellchange", - "onchange", - "oncharacteristicvaluechanged", - "onchargingchange", - "onchargingtimechange", - "onchecking", - "onclick", - "onclose", - "onclosing", - "oncompassneedscalibration", - "oncomplete", - "onconnect", - "onconnecting", - "onconnectionavailable", - "onconnectionstatechange", - "oncontactchange", - "oncontextmenu", - "oncontrollerchange", - "oncontrolselect", - "oncopy", - "oncuechange", - "oncut", - "ondataavailable", - "ondatachannel", - "ondatasetchanged", - "ondatasetcomplete", - "ondblclick", - "ondeactivate", - "ondevicechange", - "ondevicelight", - "ondevicemotion", - "ondeviceorientation", - "ondeviceorientationabsolute", - "ondeviceproximity", - "ondischargingtimechange", - "ondisconnect", - "ondisplay", - "ondownloading", - "ondrag", - "ondragend", - "ondragenter", - "ondragexit", - "ondragleave", - "ondragover", - "ondragstart", - "ondrop", - "ondurationchange", - "onemptied", - "onencrypted", - "onend", - "onended", - "onenter", - "onenterpictureinpicture", - "onerror", - "onerrorupdate", - "onexit", - "onfilterchange", - "onfinish", - "onfocus", - "onfocusin", - "onfocusout", - "onformdata", - "onfreeze", - "onfullscreenchange", - "onfullscreenerror", - "ongatheringstatechange", - "ongattserverdisconnected", - "ongesturechange", - "ongestureend", - "ongesturestart", - "ongotpointercapture", - "onhashchange", - "onhelp", - "onicecandidate", - "onicecandidateerror", - "oniceconnectionstatechange", - "onicegatheringstatechange", - "oninactive", - "oninput", - "oninputsourceschange", - "oninvalid", - "onkeydown", - "onkeypress", - "onkeystatuseschange", - "onkeyup", - "onlanguagechange", - "onlayoutcomplete", - "onleavepictureinpicture", - "onlevelchange", - "onload", - "onloadT", - "onloadeddata", - "onloadedmetadata", - "onloadend", - "onloading", - "onloadingdone", - "onloadingerror", - "onloadstart", - "onlosecapture", - "onlostpointercapture", - "only", - "onmark", - "onmessage", - "onmessageerror", - "onmidimessage", - "onmousedown", - "onmouseenter", - "onmouseleave", - "onmousemove", - "onmouseout", - "onmouseover", - "onmouseup", - "onmousewheel", - "onmove", - "onmoveend", - "onmovestart", - "onmozfullscreenchange", - "onmozfullscreenerror", - "onmozorientationchange", - "onmozpointerlockchange", - "onmozpointerlockerror", - "onmscontentzoom", - "onmsfullscreenchange", - "onmsfullscreenerror", - "onmsgesturechange", - "onmsgesturedoubletap", - "onmsgestureend", - "onmsgesturehold", - "onmsgesturestart", - "onmsgesturetap", - "onmsgotpointercapture", - "onmsinertiastart", - "onmslostpointercapture", - "onmsmanipulationstatechanged", - "onmsneedkey", - "onmsorientationchange", - "onmspointercancel", - "onmspointerdown", - "onmspointerenter", - "onmspointerhover", - "onmspointerleave", - "onmspointermove", - "onmspointerout", - "onmspointerover", - "onmspointerup", - "onmssitemodejumplistitemremoved", - "onmsthumbnailclick", - "onmute", - "onnegotiationneeded", - "onnomatch", - "onnoupdate", - "onobsolete", - "onoffline", - "ononline", - "onopen", - "onorientationchange", - "onoverconstrained", - "onpage", - "onpagechange", - "onpagehide", - "onpageshow", - "onpaste", - "onpause", - "onpayerdetailchange", - "onpaymentmethodchange", - "onplay", - "onplaying", - "onpluginstreamstart", - "onpointercancel", - "onpointerdown", - "onpointerenter", - "onpointerleave", - "onpointerlockchange", - "onpointerlockerror", - "onpointermove", - "onpointerout", - "onpointerover", - "onpointerrawupdate", - "onpointerup", - "onpopstate", - "onprocessorerror", - "onprogress", - "onpropertychange", - "onratechange", - "onreading", - "onreadystatechange", - "onrejectionhandled", - "onrelease", - "onremove", - "onremovesourcebuffer", - "onremovestream", - "onremovetrack", - "onrepeat", - "onreset", - "onresize", - "onresizeend", - "onresizestart", - "onresourcetimingbufferfull", - "onresult", - "onresume", - "onrowenter", - "onrowexit", - "onrowsdelete", - "onrowsinserted", - "onscroll", - "onsearch", - "onsecuritypolicyviolation", - "onseeked", - "onseeking", - "onselect", - "onselectedcandidatepairchange", - "onselectend", - "onselectionchange", - "onselectstart", - "onshippingaddresschange", - "onshippingoptionchange", - "onshow", - "onsignalingstatechange", - "onsoundend", - "onsoundstart", - "onsourceclose", - "onsourceclosed", - "onsourceended", - "onsourceopen", - "onspeechend", - "onspeechstart", - "onsqueeze", - "onsqueezeend", - "onsqueezestart", - "onstalled", - "onstart", - "onstatechange", - "onstop", - "onstorage", - "onstoragecommit", - "onsubmit", - "onsuccess", - "onsuspend", - "onterminate", - "ontextinput", - "ontimeout", - "ontimeupdate", - "ontoggle", - "ontonechange", - "ontouchcancel", - "ontouchend", - "ontouchmove", - "ontouchstart", - "ontrack", - "ontransitioncancel", - "ontransitionend", - "ontransitionrun", - "ontransitionstart", - "onunhandledrejection", - "onunload", - "onunmute", - "onupdate", - "onupdateend", - "onupdatefound", - "onupdateready", - "onupdatestart", - "onupgradeneeded", - "onuserproximity", - "onversionchange", - "onvisibilitychange", - "onvoiceschanged", - "onvolumechange", - "onvrdisplayactivate", - "onvrdisplayconnect", - "onvrdisplaydeactivate", - "onvrdisplaydisconnect", - "onvrdisplaypresentchange", - "onwaiting", - "onwaitingforkey", - "onwarning", - "onwebkitanimationend", - "onwebkitanimationiteration", - "onwebkitanimationstart", - "onwebkitcurrentplaybacktargetiswirelesschanged", - "onwebkitfullscreenchange", - "onwebkitfullscreenerror", - "onwebkitkeyadded", - "onwebkitkeyerror", - "onwebkitkeymessage", - "onwebkitmouseforcechanged", - "onwebkitmouseforcedown", - "onwebkitmouseforceup", - "onwebkitmouseforcewillbegin", - "onwebkitneedkey", - "onwebkitorientationchange", - "onwebkitplaybacktargetavailabilitychanged", - "onwebkitpointerlockchange", - "onwebkitpointerlockerror", - "onwebkitresourcetimingbufferfull", - "onwebkittransitionend", - "onwheel", - "onzoom", - "opacity", - "open", - "openCursor", - "openDatabase", - "openKeyCursor", - "opened", - "opener", - "opera", - "operationType", - "operator", - "opr", - "opsProfile", - "optimum", - "options", - "or", - "order", - "orderX", - "orderY", - "ordered", - "org", - "organization", - "orient", - "orientAngle", - "orientType", - "orientation", - "orientationX", - "orientationY", - "orientationZ", - "origin", - "originalPolicy", - "originalTarget", - "orphans", - "oscpu", - "outcome", - "outerHTML", - "outerHeight", - "outerText", - "outerWidth", - "outline", - "outline-color", - "outline-offset", - "outline-style", - "outline-width", - "outlineColor", - "outlineOffset", - "outlineStyle", - "outlineWidth", - "outputBuffer", - "outputLatency", - "outputs", - "overflow", - "overflow-anchor", - "overflow-block", - "overflow-inline", - "overflow-wrap", - "overflow-x", - "overflow-y", - "overflowAnchor", - "overflowBlock", - "overflowInline", - "overflowWrap", - "overflowX", - "overflowY", - "overrideMimeType", - "oversample", - "overscroll-behavior", - "overscroll-behavior-block", - "overscroll-behavior-inline", - "overscroll-behavior-x", - "overscroll-behavior-y", - "overscrollBehavior", - "overscrollBehaviorBlock", - "overscrollBehaviorInline", - "overscrollBehaviorX", - "overscrollBehaviorY", - "ownKeys", - "ownerDocument", - "ownerElement", - "ownerNode", - "ownerRule", - "ownerSVGElement", - "owningElement", - "p1", - "p2", - "p3", - "p4", - "packetSize", - "packets", - "pad", - "padEnd", - "padStart", - "padding", - "padding-block", - "padding-block-end", - "padding-block-start", - "padding-bottom", - "padding-inline", - "padding-inline-end", - "padding-inline-start", - "padding-left", - "padding-right", - "padding-top", - "paddingBlock", - "paddingBlockEnd", - "paddingBlockStart", - "paddingBottom", - "paddingInline", - "paddingInlineEnd", - "paddingInlineStart", - "paddingLeft", - "paddingRight", - "paddingTop", - "page", - "page-break-after", - "page-break-before", - "page-break-inside", - "pageBreakAfter", - "pageBreakBefore", - "pageBreakInside", - "pageCount", - "pageLeft", - "pageT", - "pageTop", - "pageX", - "pageXOffset", - "pageY", - "pageYOffset", - "pages", - "paint-order", - "paintOrder", - "paintRequests", - "paintType", - "paintWorklet", - "palette", - "pan", - "panningModel", - "parameters", - "parent", - "parentElement", - "parentNode", - "parentRule", - "parentStyleSheet", - "parentTextEdit", - "parentWindow", - "parse", - "parseAll", - "parseFloat", - "parseFromString", - "parseInt", - "part", - "participants", - "passive", - "password", - "pasteHTML", - "path", - "pathLength", - "pathSegList", - "pathSegType", - "pathSegTypeAsLetter", - "pathname", - "pattern", - "patternContentUnits", - "patternMismatch", - "patternTransform", - "patternUnits", - "pause", - "pauseAnimations", - "pauseOnExit", - "pauseTransformFeedback", - "paused", - "payerEmail", - "payerName", - "payerPhone", - "paymentManager", - "pc", - "peerIdentity", - "pending", - "pendingLocalDescription", - "pendingRemoteDescription", - "percent", - "performance", - "periodicSync", - "permission", - "permissionState", - "permissions", - "persist", - "persisted", - "personalbar", - "perspective", - "perspective-origin", - "perspectiveOrigin", - "perspectiveOriginX", - "perspectiveOriginY", - "phone", - "phoneticFamilyName", - "phoneticGivenName", - "photo", - "pictureInPictureElement", - "pictureInPictureEnabled", - "pictureInPictureWindow", - "ping", - "pipeThrough", - "pipeTo", - "pitch", - "pixelBottom", - "pixelDepth", - "pixelHeight", - "pixelLeft", - "pixelRight", - "pixelStorei", - "pixelTop", - "pixelUnitToMillimeterX", - "pixelUnitToMillimeterY", - "pixelWidth", - "place-content", - "place-items", - "place-self", - "placeContent", - "placeItems", - "placeSelf", - "placeholder", - "platform", - "platforms", - "play", - "playEffect", - "playState", - "playbackRate", - "playbackState", - "playbackTime", - "played", - "playoutDelayHint", - "playsInline", - "plugins", - "pluginspage", - "pname", - "pointer-events", - "pointerBeforeReferenceNode", - "pointerEnabled", - "pointerEvents", - "pointerId", - "pointerLockElement", - "pointerType", - "points", - "pointsAtX", - "pointsAtY", - "pointsAtZ", - "polygonOffset", - "pop", - "populateMatrix", - "popupWindowFeatures", - "popupWindowName", - "popupWindowURI", - "port", - "port1", - "port2", - "ports", - "posBottom", - "posHeight", - "posLeft", - "posRight", - "posTop", - "posWidth", - "pose", - "position", - "positionAlign", - "positionX", - "positionY", - "positionZ", - "postError", - "postMessage", - "postalCode", - "poster", - "pow", - "powerEfficient", - "powerOff", - "preMultiplySelf", - "precision", - "preferredStyleSheetSet", - "preferredStylesheetSet", - "prefix", - "preload", - "prepend", - "presentation", - "preserveAlpha", - "preserveAspectRatio", - "preserveAspectRatioString", - "pressed", - "pressure", - "prevValue", - "preventDefault", - "preventExtensions", - "preventSilentAccess", - "previousElementSibling", - "previousNode", - "previousPage", - "previousRect", - "previousScale", - "previousSibling", - "previousTranslate", - "primaryKey", - "primitiveType", - "primitiveUnits", - "principals", - "print", - "priority", - "privateKey", - "probablySupportsContext", - "process", - "processIceMessage", - "processingEnd", - "processingStart", - "product", - "productId", - "productName", - "productSub", - "profile", - "profileEnd", - "profiles", - "projectionMatrix", - "promise", - "prompt", - "properties", - "propertyIsEnumerable", - "propertyName", - "protocol", - "protocolLong", - "prototype", - "provider", - "pseudoClass", - "pseudoElement", - "pt", - "publicId", - "publicKey", - "published", - "pulse", - "push", - "pushManager", - "pushNotification", - "pushState", - "put", - "putImageData", - "px", - "quadraticCurveTo", - "qualifier", - "quaternion", - "query", - "queryCommandEnabled", - "queryCommandIndeterm", - "queryCommandState", - "queryCommandSupported", - "queryCommandText", - "queryCommandValue", - "querySelector", - "querySelectorAll", - "queryUsageAndQuota", - "queueMicrotask", - "quote", - "quotes", - "r", - "r1", - "r2", - "race", - "rad", - "radiogroup", - "radiusX", - "radiusY", - "random", - "range", - "rangeCount", - "rangeMax", - "rangeMin", - "rangeOffset", - "rangeOverflow", - "rangeParent", - "rangeUnderflow", - "rate", - "ratio", - "raw", - "rawId", - "read", - "readAsArrayBuffer", - "readAsBinaryString", - "readAsBlob", - "readAsDataURL", - "readAsText", - "readBuffer", - "readEntries", - "readOnly", - "readPixels", - "readReportRequested", - "readText", - "readTransaction", - "readValue", - "readable", - "ready", - "readyState", - "reason", - "reboot", - "receivedAlert", - "receivedTime", - "receiver", - "receivers", - "recipient", - "reconnect", - "record", - "recordEnd", - "recordNumber", - "recordsAvailable", - "recordset", - "rect", - "red", - "redEyeReduction", - "redirect", - "redirectCount", - "redirectEnd", - "redirectStart", - "redirected", - "reduce", - "reduceRight", - "reduction", - "refDistance", - "refX", - "refY", - "referenceNode", - "referenceSpace", - "referrer", - "referrerPolicy", - "refresh", - "region", - "regionAnchorX", - "regionAnchorY", - "regionId", - "regions", - "register", - "registerContentHandler", - "registerElement", - "registerProperty", - "registerProtocolHandler", - "reject", - "rel", - "relList", - "relatedAddress", - "relatedNode", - "relatedPort", - "relatedTarget", - "release", - "releaseCapture", - "releaseEvents", - "releaseInterface", - "releaseLock", - "releasePointerCapture", - "releaseShaderCompiler", - "reliable", - "reliableWrite", - "reload", - "rem", - "remainingSpace", - "remote", - "remoteDescription", - "remove", - "removeAllRanges", - "removeAttribute", - "removeAttributeNS", - "removeAttributeNode", - "removeBehavior", - "removeChild", - "removeCue", - "removeEventListener", - "removeFilter", - "removeImport", - "removeItem", - "removeListener", - "removeNamedItem", - "removeNamedItemNS", - "removeNode", - "removeParameter", - "removeProperty", - "removeRange", - "removeRegion", - "removeRule", - "removeRules", - "removeSiteSpecificTrackingException", - "removeSourceBuffer", - "removeStream", - "removeTrack", - "removeVariable", - "removeWakeLockListener", - "removeWebWideTrackingException", - "removed", - "removedNodes", - "renderHeight", - "renderState", - "renderTime", - "renderWidth", - "renderbufferStorage", - "renderbufferStorageMultisample", - "renderedBuffer", - "renderingMode", - "renotify", - "repeat", - "replace", - "replaceAdjacentText", - "replaceAll", - "replaceChild", - "replaceChildren", - "replaceData", - "replaceId", - "replaceItem", - "replaceNode", - "replaceState", - "replaceSync", - "replaceTrack", - "replaceWholeText", - "replaceWith", - "reportValidity", - "request", - "requestAnimationFrame", - "requestAutocomplete", - "requestData", - "requestDevice", - "requestFrame", - "requestFullscreen", - "requestHitTestSource", - "requestHitTestSourceForTransientInput", - "requestId", - "requestIdleCallback", - "requestMIDIAccess", - "requestMediaKeySystemAccess", - "requestPermission", - "requestPictureInPicture", - "requestPointerLock", - "requestPresent", - "requestQuota", - "requestReferenceSpace", - "requestSession", - "requestStart", - "requestStorageAccess", - "requestSubmit", - "requestTime", - "requestVideoFrameCallback", - "requestedLocale", - "requestingWindow", - "requireInteraction", - "required", - "requiredExtensions", - "requiredFeatures", - "reset", - "resetPose", - "resetTransform", - "resize", - "resizeBy", - "resizeTo", - "resolve", - "resolved", - "resolvedOptions", - "resource-history", - "resourcesFramesExpanded", - "response", - "responseBody", - "responseEnd", - "responseReady", - "responseStart", - "responseText", - "responseType", - "responseURL", - "responseXML", - "restartIce", - "restore", - "result", - "resultIndex", - "resultType", - "results", - "resume", - "resumeTransformFeedback", - "retry", - "returnValue", - "rev", - "reverse", - "reversed", - "revocable", - "revokeObjectURL", - "rgbColor", - "right", - "rightContext", - "rightDegrees", - "rightMargin", - "rightProjectionMatrix", - "rightViewMatrix", - "role", - "rolloffFactor", - "root", - "rootBounds", - "rootElement", - "rootMargin", - "rotate", - "rotateAxisAngle", - "rotateAxisAngleSelf", - "rotateFromVector", - "rotateFromVectorSelf", - "rotateSelf", - "rotation", - "rotationAngle", - "rotationRate", - "round", - "row-gap", - "rowGap", - "rowIndex", - "rowSpan", - "rows", - "rowsAffected", - "rtcpTransport", - "rtt", - "ruby-align", - "ruby-position", - "rubyAlign", - "rubyOverhang", - "rubyPosition", - "rules", - "runningState", - "runtime", - "runtimeStyle", - "rx", - "ry", - "s", - "safari", - "sample", - "sampleCoverage", - "sampleRate", - "samplerParameterf", - "samplerParameteri", - "sandbox", - "save", - "saveData", - "scale", - "scale3d", - "scale3dSelf", - "scaleNonUniform", - "scaleNonUniformSelf", - "scaleSelf", - "scheme", - "scissor", - "scope", - "scopeName", - "scoped", - "screen", - "screenBrightness", - "screenEnabled", - "screenLeft", - "screenPixelToMillimeterX", - "screenPixelToMillimeterY", - "screenTop", - "screenX", - "screenY", - "script", - "scriptURL", - "scripts", - "scroll", - "scroll-behavior", - "scroll-margin", - "scroll-margin-block", - "scroll-margin-block-end", - "scroll-margin-block-start", - "scroll-margin-bottom", - "scroll-margin-inline", - "scroll-margin-inline-end", - "scroll-margin-inline-start", - "scroll-margin-left", - "scroll-margin-right", - "scroll-margin-top", - "scroll-padding", - "scroll-padding-block", - "scroll-padding-block-end", - "scroll-padding-block-start", - "scroll-padding-bottom", - "scroll-padding-inline", - "scroll-padding-inline-end", - "scroll-padding-inline-start", - "scroll-padding-left", - "scroll-padding-right", - "scroll-padding-top", - "scroll-snap-align", - "scroll-snap-coordinate", - "scroll-snap-destination", - "scroll-snap-points-x", - "scroll-snap-points-y", - "scroll-snap-type", - "scroll-snap-type-x", - "scroll-snap-type-y", - "scrollAmount", - "scrollBehavior", - "scrollBy", - "scrollByLines", - "scrollByPages", - "scrollDelay", - "scrollHeight", - "scrollIntoView", - "scrollIntoViewIfNeeded", - "scrollLeft", - "scrollLeftMax", - "scrollMargin", - "scrollMarginBlock", - "scrollMarginBlockEnd", - "scrollMarginBlockStart", - "scrollMarginBottom", - "scrollMarginInline", - "scrollMarginInlineEnd", - "scrollMarginInlineStart", - "scrollMarginLeft", - "scrollMarginRight", - "scrollMarginTop", - "scrollMaxX", - "scrollMaxY", - "scrollPadding", - "scrollPaddingBlock", - "scrollPaddingBlockEnd", - "scrollPaddingBlockStart", - "scrollPaddingBottom", - "scrollPaddingInline", - "scrollPaddingInlineEnd", - "scrollPaddingInlineStart", - "scrollPaddingLeft", - "scrollPaddingRight", - "scrollPaddingTop", - "scrollRestoration", - "scrollSnapAlign", - "scrollSnapCoordinate", - "scrollSnapDestination", - "scrollSnapMargin", - "scrollSnapMarginBottom", - "scrollSnapMarginLeft", - "scrollSnapMarginRight", - "scrollSnapMarginTop", - "scrollSnapPointsX", - "scrollSnapPointsY", - "scrollSnapStop", - "scrollSnapType", - "scrollSnapTypeX", - "scrollSnapTypeY", - "scrollTo", - "scrollTop", - "scrollTopMax", - "scrollWidth", - "scrollX", - "scrollY", - "scrollbar-color", - "scrollbar-width", - "scrollbar3dLightColor", - "scrollbarArrowColor", - "scrollbarBaseColor", - "scrollbarColor", - "scrollbarDarkShadowColor", - "scrollbarFaceColor", - "scrollbarHighlightColor", - "scrollbarShadowColor", - "scrollbarTrackColor", - "scrollbarWidth", - "scrollbars", - "scrolling", - "scrollingElement", - "sctp", - "sctpCauseCode", - "sdp", - "sdpLineNumber", - "sdpMLineIndex", - "sdpMid", - "seal", - "search", - "searchBox", - "searchBoxJavaBridge_", - "searchParams", - "second", - "sectionRowIndex", - "secureConnectionStart", - "security", - "seed", - "seekToNextFrame", - "seekable", - "seeking", - "select", - "selectAllChildren", - "selectAlternateInterface", - "selectConfiguration", - "selectNode", - "selectNodeContents", - "selectNodes", - "selectSingleNode", - "selectSubString", - "selected", - "selectedIndex", - "selectedOption", - "selectedOptions", - "selectedStyleSheetSet", - "selectedStylesheetSet", - "selection", - "selectionDirection", - "selectionEnd", - "selectionStart", - "selector", - "selectorText", - "self", - "send", - "sendAsBinary", - "sendBeacon", - "sendMessage", - "sender", - "sensitivity", - "sentAlert", - "sentTimestamp", - "separator", - "serialNumber", - "serializeToString", - "serverTiming", - "service", - "serviceWorker", - "session", - "sessionId", - "sessionStorage", - "set", - "setActionHandler", - "setActive", - "setAlpha", - "setAppBadge", - "setAttribute", - "setAttributeNS", - "setAttributeNode", - "setAttributeNodeNS", - "setBaseAndExtent", - "setBigInt64", - "setBigUint64", - "setBingCurrentSearchDefault", - "setCapture", - "setCodecPreferences", - "setColor", - "setCompositeOperation", - "setConfiguration", - "setCurrentTime", - "setCustomValidity", - "setData", - "setDate", - "setDirection", - "setDragImage", - "setEnd", - "setEndAfter", - "setEndBefore", - "setEndPoint", - "setFillColor", - "setFilterRes", - "setFloat32", - "setFloat64", - "setFloatValue", - "setFormValue", - "setFullYear", - "setHeaderValue", - "setHours", - "setIdentityProvider", - "setImmediate", - "setInt16", - "setInt32", - "setInt8", - "setInterval", - "setItem", - "setKeyframes", - "setLineCap", - "setLineDash", - "setLineJoin", - "setLineWidth", - "setLiveSeekableRange", - "setLocalDescription", - "setMatrix", - "setMatrixValue", - "setMediaKeys", - "setMilliseconds", - "setMinutes", - "setMiterLimit", - "setMonth", - "setNamedItem", - "setNamedItemNS", - "setNonUserCodeExceptions", - "setOrientToAngle", - "setOrientToAuto", - "setOrientation", - "setOverrideHistoryNavigationMode", - "setPaint", - "setParameter", - "setParameters", - "setPeriodicWave", - "setPointerCapture", - "setPosition", - "setPositionState", - "setPreference", - "setProperty", - "setPrototypeOf", - "setRGBColor", - "setRGBColorICCColor", - "setRadius", - "setRangeText", - "setRemoteDescription", - "setRequestHeader", - "setResizable", - "setResourceTimingBufferSize", - "setRotate", - "setScale", - "setSeconds", - "setSelectionRange", - "setServerCertificate", - "setShadow", - "setSinkId", - "setSkewX", - "setSkewY", - "setStart", - "setStartAfter", - "setStartBefore", - "setStdDeviation", - "setStreams", - "setStringValue", - "setStrokeColor", - "setSuggestResult", - "setTargetAtTime", - "setTargetValueAtTime", - "setTime", - "setTimeout", - "setTransform", - "setTranslate", - "setUTCDate", - "setUTCFullYear", - "setUTCHours", - "setUTCMilliseconds", - "setUTCMinutes", - "setUTCMonth", - "setUTCSeconds", - "setUint16", - "setUint32", - "setUint8", - "setUri", - "setValidity", - "setValueAtTime", - "setValueCurveAtTime", - "setVariable", - "setVelocity", - "setVersion", - "setYear", - "settingName", - "settingValue", - "sex", - "shaderSource", - "shadowBlur", - "shadowColor", - "shadowOffsetX", - "shadowOffsetY", - "shadowRoot", - "shape", - "shape-image-threshold", - "shape-margin", - "shape-outside", - "shape-rendering", - "shapeImageThreshold", - "shapeMargin", - "shapeOutside", - "shapeRendering", - "sheet", - "shift", - "shiftKey", - "shiftLeft", - "shippingAddress", - "shippingOption", - "shippingType", - "show", - "showHelp", - "showModal", - "showModalDialog", - "showModelessDialog", - "showNotification", - "sidebar", - "sign", - "signal", - "signalingState", - "signature", - "silent", - "sin", - "singleNodeValue", - "sinh", - "sinkId", - "sittingToStandingTransform", - "size", - "sizeToContent", - "sizeX", - "sizeZ", - "sizes", - "skewX", - "skewXSelf", - "skewY", - "skewYSelf", - "slice", - "slope", - "slot", - "small", - "smil", - "smooth", - "smoothingTimeConstant", - "snapToLines", - "snapshotItem", - "snapshotLength", - "some", - "sort", - "sortingCode", - "source", - "sourceBuffer", - "sourceBuffers", - "sourceCapabilities", - "sourceFile", - "sourceIndex", - "sourceURL", - "sources", - "spacing", - "span", - "speak", - "speakAs", - "speaking", - "species", - "specified", - "specularConstant", - "specularExponent", - "speechSynthesis", - "speed", - "speedOfSound", - "spellcheck", - "splice", - "split", - "splitText", - "spreadMethod", - "sqrt", - "src", - "srcElement", - "srcFilter", - "srcObject", - "srcUrn", - "srcdoc", - "srclang", - "srcset", - "stack", - "stackTraceLimit", - "stacktrace", - "stageParameters", - "standalone", - "standby", - "start", - "startContainer", - "startE", - "startIce", - "startLoadTime", - "startMessages", - "startNotifications", - "startOffset", - "startRendering", - "startSoftwareUpdate", - "startTime", - "startsWith", - "state", - "status", - "statusCode", - "statusMessage", - "statusText", - "statusbar", - "stdDeviationX", - "stdDeviationY", - "stencilFunc", - "stencilFuncSeparate", - "stencilMask", - "stencilMaskSeparate", - "stencilOp", - "stencilOpSeparate", - "step", - "stepDown", - "stepMismatch", - "stepUp", - "sticky", - "stitchTiles", - "stop", - "stop-color", - "stop-opacity", - "stopColor", - "stopImmediatePropagation", - "stopNotifications", - "stopOpacity", - "stopPropagation", - "stopped", - "storage", - "storageArea", - "storageName", - "storageStatus", - "store", - "storeSiteSpecificTrackingException", - "storeWebWideTrackingException", - "stpVersion", - "stream", - "streams", - "strength", - "stretch", - "strike", - "stringValue", - "stringify", - "stroke", - "stroke-dasharray", - "stroke-dashoffset", - "stroke-linecap", - "stroke-linejoin", - "stroke-miterlimit", - "stroke-opacity", - "stroke-width", - "strokeColor", - "strokeDasharray", - "strokeDashoffset", - "strokeLinecap", - "strokeLinejoin", - "strokeMiterlimit", - "strokeOpacity", - "strokeRect", - "strokeStyle", - "strokeText", - "strokeWidth", - "style", - "styleFloat", - "styleMap", - "styleMedia", - "styleSheet", - "styleSheetSets", - "styleSheets", - "sub", - "subarray", - "subject", - "submit", - "submitFrame", - "submitter", - "subscribe", - "substr", - "substring", - "substringData", - "subtle", - "subtree", - "suffix", - "suffixes", - "summary", - "sup", - "supported", - "supportedContentEncodings", - "supportedEntryTypes", - "supportedLocalesOf", - "supports", - "supportsSession", - "surfaceScale", - "surroundContents", - "suspend", - "suspendRedraw", - "swapCache", - "swapNode", - "sweepFlag", - "symbols", - "sync", - "sysexEnabled", - "system", - "systemCode", - "systemId", - "systemLanguage", - "systemXDPI", - "systemYDPI", - "tBodies", - "tFoot", - "tHead", - "tabIndex", - "tabSize", - "table", - "table-layout", - "tableLayout", - "tableValues", - "tag", - "tagName", - "tagUrn", - "tags", - "taintEnabled", - "takeHeapSnapshot", - "takePhoto", - "takeRecords", - "tan", - "tangentialPressure", - "tanh", - "target", - "targetElement", - "targetRayMode", - "targetRaySpace", - "targetTouches", - "targetX", - "targetY", - "tcpType", - "tee", - "tel", - "terminate", - "test", - "texImage2D", - "texImage3D", - "texParameterf", - "texParameteri", - "texStorage2D", - "texStorage3D", - "texSubImage2D", - "texSubImage3D", - "text", - "text-align", - "text-align-last", - "text-anchor", - "text-combine-upright", - "text-decoration", - "text-decoration-color", - "text-decoration-line", - "text-decoration-skip-ink", - "text-decoration-style", - "text-decoration-thickness", - "text-emphasis", - "text-emphasis-color", - "text-emphasis-position", - "text-emphasis-style", - "text-indent", - "text-justify", - "text-orientation", - "text-overflow", - "text-rendering", - "text-shadow", - "text-transform", - "text-underline-offset", - "text-underline-position", - "text/pdf", - "textAlign", - "textAlignLast", - "textAnchor", - "textAutospace", - "textBaseline", - "textCombineUpright", - "textContent", - "textDecoration", - "textDecorationBlink", - "textDecorationColor", - "textDecorationLine", - "textDecorationLineThrough", - "textDecorationNone", - "textDecorationOverline", - "textDecorationSkipInk", - "textDecorationStyle", - "textDecorationThickness", - "textDecorationUnderline", - "textEmphasis", - "textEmphasisColor", - "textEmphasisPosition", - "textEmphasisStyle", - "textIndent", - "textJustify", - "textJustifyTrim", - "textKashida", - "textKashidaSpace", - "textLength", - "textOrientation", - "textOverflow", - "textRendering", - "textShadow", - "textSizeAdjust", - "textTracks", - "textTransform", - "textUnderlineOffset", - "textUnderlinePosition", - "then", - "threadId", - "threshold", - "thresholds", - "tiltX", - "tiltY", - "time", - "timeEnd", - "timeLog", - "timeOrigin", - "timeRemaining", - "timeStamp", - "timeZone", - "timeZoneName", - "timecode", - "timeline", - "timelineEnd", - "timelineTime", - "timeout", - "timestamp", - "timestampOffset", - "timing", - "title", - "to", - "toArray", - "toBlob", - "toDataURL", - "toDateString", - "toElement", - "toExponential", - "toFixed", - "toFloat32Array", - "toFloat64Array", - "toGMTString", - "toISOString", - "toJSON", - "toLocaleDateString", - "toLocaleFormat", - "toLocaleLowerCase", - "toLocaleString", - "toLocaleTimeString", - "toLocaleUpperCase", - "toLowerCase", - "toMatrix", - "toMethod", - "toPrecision", - "toPrimitive", - "toSdp", - "toSource", - "toStaticHTML", - "toString", - "toStringTag", - "toSum", - "toTimeString", - "toUTCString", - "toUpperCase", - "toggle", - "toggleAttribute", - "toggleLongPressEnabled", - "tone", - "toneBuffer", - "tooLong", - "tooShort", - "toolbar", - "top", - "topMargin", - "total", - "totalFrameDelay", - "totalJSHeapSize", - "totalSize", - "totalVideoFrames", - "touch-action", - "touchAction", - "touched", - "touches", - "trace", - "track", - "trackVisibility", - "tran", - "transaction", - "transactions", - "transceiver", - "transferControlToOffscreen", - "transferFromImageBitmap", - "transferImageBitmap", - "transferIn", - "transferOut", - "transferSize", - "transferToImageBitmap", - "transform", - "transform-box", - "transform-origin", - "transform-style", - "transformBox", - "transformFeedbackVaryings", - "transformOrigin", - "transformOriginX", - "transformOriginY", - "transformOriginZ", - "transformPoint", - "transformString", - "transformStyle", - "transformToDocument", - "transformToFragment", - "transition", - "transition-delay", - "transition-duration", - "transition-property", - "transition-timing-function", - "transitionDelay", - "transitionDuration", - "transitionProperty", - "transitionTimingFunction", - "translate", - "translateSelf", - "translationX", - "translationY", - "transport", - "trim", - "trimEnd", - "trimLeft", - "trimRight", - "trimStart", - "trueSpeed", - "trunc", - "truncate", - "trustedTypes", - "turn", - "twist", - "type", - "typeDetail", - "typeMismatch", - "typeMustMatch", - "types", - "tz", - "u2f", - "ubound", - "undefined", - "unescape", - "uneval", - "unicode", - "unicode-bidi", - "unicodeBidi", - "unicodeRange", - "uniform1f", - "uniform1fv", - "uniform1i", - "uniform1iv", - "uniform1ui", - "uniform1uiv", - "uniform2f", - "uniform2fv", - "uniform2i", - "uniform2iv", - "uniform2ui", - "uniform2uiv", - "uniform3f", - "uniform3fv", - "uniform3i", - "uniform3iv", - "uniform3ui", - "uniform3uiv", - "uniform4f", - "uniform4fv", - "uniform4i", - "uniform4iv", - "uniform4ui", - "uniform4uiv", - "uniformBlockBinding", - "uniformMatrix2fv", - "uniformMatrix2x3fv", - "uniformMatrix2x4fv", - "uniformMatrix3fv", - "uniformMatrix3x2fv", - "uniformMatrix3x4fv", - "uniformMatrix4fv", - "uniformMatrix4x2fv", - "uniformMatrix4x3fv", - "unique", - "uniqueID", - "uniqueNumber", - "unit", - "unitType", - "units", - "unloadEventEnd", - "unloadEventStart", - "unlock", - "unmount", - "unobserve", - "unpause", - "unpauseAnimations", - "unreadCount", - "unregister", - "unregisterContentHandler", - "unregisterProtocolHandler", - "unscopables", - "unselectable", - "unshift", - "unsubscribe", - "unsuspendRedraw", - "unsuspendRedrawAll", - "unwatch", - "unwrapKey", - "upDegrees", - "upX", - "upY", - "upZ", - "update", - "updateCommands", - "updateEnabled", - "updateIce", - "updateInterval", - "updatePlaybackRate", - "updateRenderState", - "updateSettings", - "updateTiming", - "updateViaCache", - "updateWith", - "updated", - "updating", - "upgrade", - "upload", - "uploadTotal", - "uploaded", - "upper", - "upperBound", - "upperOpen", - "uri", - "url", - "urn", - "urns", - "usage", - "usages", - "usb", - "usbVersionMajor", - "usbVersionMinor", - "usbVersionSubminor", - "useCurrentView", - "useGrouping", - "useMap", - "useProgram", - "usedJSHeapSize", - "usedSpace", - "user-select", - "userActivation", - "userAgent", - "userChoice", - "userHandle", - "userHint", - "userLanguage", - "userProfile", - "userSelect", - "userVisibleOnly", - "userZoom", - "username", - "usernameFragment", - "utterance", - "uuid", - "v8BreakIterator", - "v8Parse", - "vAlign", - "vLink", - "valid", - "validate", - "validateProgram", - "validationMessage", - "validity", - "value", - "valueAsDate", - "valueAsNumber", - "valueAsString", - "valueInSpecifiedUnits", - "valueMissing", - "valueOf", - "valueText", - "valueType", - "values", - "variable", - "variant", - "vector-effect", - "vectorEffect", - "velocityAngular", - "velocityExpansion", - "velocityX", - "velocityY", - "vendor", - "vendorId", - "vendorSub", - "verify", - "version", - "vertexAttrib1f", - "vertexAttrib1fv", - "vertexAttrib2f", - "vertexAttrib2fv", - "vertexAttrib3f", - "vertexAttrib3fv", - "vertexAttrib4f", - "vertexAttrib4fv", - "vertexAttribDivisor", - "vertexAttribDivisorANGLE", - "vertexAttribI4i", - "vertexAttribI4iv", - "vertexAttribI4ui", - "vertexAttribI4uiv", - "vertexAttribIPointer", - "vertexAttribPointer", - "vertical", - "vertical-align", - "verticalAlign", - "verticalOverflow", - "vh", - "vibrate", - "vibrationActuator", - "video/x-ms-asf", - "video/x-ms-asf-plugin", - "video/x-ms-wm", - "video/x-ms-wmv", - "video/x-ms-wvx", - "videoBitsPerSecond", - "videoHeight", - "videoTracks", - "videoWidth", - "view", - "viewBox", - "viewBoxString", - "viewTarget", - "viewTargetString", - "viewport", - "viewportAnchorX", - "viewportAnchorY", - "viewportElement", - "views", - "violatedDirective", - "visibility", - "visibilityState", - "visible", - "visualViewport", - "vlinkColor", - "vmax", - "vmin", - "voice", - "voiceURI", - "volume", - "vrml", - "vspace", - "vw", - "w", - "wait", - "waitSync", - "waiting", - "wake", - "wakeLock", - "wand", - "warn", - "wasAlternateProtocolAvailable", - "wasClean", - "wasDiscarded", - "wasFetchedViaSpdy", - "wasNpnNegotiated", - "watch", - "watchAvailability", - "watchPosition", - "webdriver", - "webkitAddKey", - "webkitAlignContent", - "webkitAlignItems", - "webkitAlignSelf", - "webkitAnimation", - "webkitAnimationDelay", - "webkitAnimationDirection", - "webkitAnimationDuration", - "webkitAnimationFillMode", - "webkitAnimationIterationCount", - "webkitAnimationName", - "webkitAnimationPlayState", - "webkitAnimationTimingFunction", - "webkitAppRegion", - "webkitAppearance", - "webkitAspectRatio", - "webkitAudioContext", - "webkitAudioDecodedByteCount", - "webkitAudioPannerNode", - "webkitBackdropFilter", - "webkitBackfaceVisibility", - "webkitBackground", - "webkitBackgroundAttachment", - "webkitBackgroundClip", - "webkitBackgroundColor", - "webkitBackgroundComposite", - "webkitBackgroundImage", - "webkitBackgroundOrigin", - "webkitBackgroundPosition", - "webkitBackgroundPositionX", - "webkitBackgroundPositionY", - "webkitBackgroundRepeat", - "webkitBackgroundSize", - "webkitBackingStorePixelRatio", - "webkitBorderAfter", - "webkitBorderAfterColor", - "webkitBorderAfterStyle", - "webkitBorderAfterWidth", - "webkitBorderBefore", - "webkitBorderBeforeColor", - "webkitBorderBeforeStyle", - "webkitBorderBeforeWidth", - "webkitBorderBottomLeftRadius", - "webkitBorderBottomRightRadius", - "webkitBorderEnd", - "webkitBorderEndColor", - "webkitBorderEndStyle", - "webkitBorderEndWidth", - "webkitBorderFit", - "webkitBorderHorizontalSpacing", - "webkitBorderImage", - "webkitBorderImageOutset", - "webkitBorderImageRepeat", - "webkitBorderImageSlice", - "webkitBorderImageSource", - "webkitBorderImageWidth", - "webkitBorderRadius", - "webkitBorderStart", - "webkitBorderStartColor", - "webkitBorderStartStyle", - "webkitBorderStartWidth", - "webkitBorderTopLeftRadius", - "webkitBorderTopRightRadius", - "webkitBorderVerticalSpacing", - "webkitBoxAlign", - "webkitBoxDecorationBreak", - "webkitBoxDirection", - "webkitBoxFlex", - "webkitBoxFlexGroup", - "webkitBoxLines", - "webkitBoxOrdinalGroup", - "webkitBoxOrient", - "webkitBoxPack", - "webkitBoxReflect", - "webkitBoxShadow", - "webkitBoxSizing", - "webkitCancelAnimationFrame", - "webkitCancelFullScreen", - "webkitCancelKeyRequest", - "webkitCancelRequestAnimationFrame", - "webkitClearResourceTimings", - "webkitClipPath", - "webkitClosedCaptionsVisible", - "webkitColumnAxis", - "webkitColumnBreakAfter", - "webkitColumnBreakBefore", - "webkitColumnBreakInside", - "webkitColumnCount", - "webkitColumnGap", - "webkitColumnProgression", - "webkitColumnRule", - "webkitColumnRuleColor", - "webkitColumnRuleStyle", - "webkitColumnRuleWidth", - "webkitColumnSpan", - "webkitColumnWidth", - "webkitColumns", - "webkitConvertPointFromNodeToPage", - "webkitConvertPointFromPageToNode", - "webkitCreateShadowRoot", - "webkitCurrentFullScreenElement", - "webkitCurrentPlaybackTargetIsWireless", - "webkitCursorVisibility", - "webkitDashboardRegion", - "webkitDecodedFrameCount", - "webkitDirectionInvertedFromDevice", - "webkitDisplayingFullscreen", - "webkitDroppedFrameCount", - "webkitEnterFullScreen", - "webkitEnterFullscreen", - "webkitEntries", - "webkitExitFullScreen", - "webkitExitFullscreen", - "webkitExitPointerLock", - "webkitFilter", - "webkitFlex", - "webkitFlexBasis", - "webkitFlexDirection", - "webkitFlexFlow", - "webkitFlexGrow", - "webkitFlexShrink", - "webkitFlexWrap", - "webkitFontFeatureSettings", - "webkitFontKerning", - "webkitFontSizeDelta", - "webkitFontSmoothing", - "webkitForce", - "webkitFullScreenKeyboardInputAllowed", - "webkitFullscreenElement", - "webkitFullscreenEnabled", - "webkitGenerateKeyRequest", - "webkitGetAsEntry", - "webkitGetDatabaseNames", - "webkitGetEntries", - "webkitGetEntriesByName", - "webkitGetEntriesByType", - "webkitGetFlowByName", - "webkitGetGamepads", - "webkitGetImageDataHD", - "webkitGetNamedFlows", - "webkitGetRegionFlowRanges", - "webkitGetUserMedia", - "webkitHasClosedCaptions", - "webkitHidden", - "webkitHighlight", - "webkitHyphenateCharacter", - "webkitHyphenateLimitAfter", - "webkitHyphenateLimitBefore", - "webkitHyphenateLimitLines", - "webkitHyphens", - "webkitIDBCursor", - "webkitIDBDatabase", - "webkitIDBDatabaseError", - "webkitIDBDatabaseException", - "webkitIDBFactory", - "webkitIDBIndex", - "webkitIDBKeyRange", - "webkitIDBObjectStore", - "webkitIDBRequest", - "webkitIDBTransaction", - "webkitImageSmoothingEnabled", - "webkitIndexedDB", - "webkitInitMessageEvent", - "webkitInitialLetter", - "webkitIsFullScreen", - "webkitJustifyContent", - "webkitKeys", - "webkitLineAlign", - "webkitLineBoxContain", - "webkitLineBreak", - "webkitLineClamp", - "webkitLineDash", - "webkitLineDashOffset", - "webkitLineGrid", - "webkitLineSnap", - "webkitLocale", - "webkitLockOrientation", - "webkitLogicalHeight", - "webkitLogicalWidth", - "webkitMarginAfter", - "webkitMarginAfterCollapse", - "webkitMarginBefore", - "webkitMarginBeforeCollapse", - "webkitMarginBottomCollapse", - "webkitMarginCollapse", - "webkitMarginEnd", - "webkitMarginStart", - "webkitMarginTopCollapse", - "webkitMarquee", - "webkitMarqueeDirection", - "webkitMarqueeIncrement", - "webkitMarqueeRepetition", - "webkitMarqueeSpeed", - "webkitMarqueeStyle", - "webkitMask", - "webkitMaskBoxImage", - "webkitMaskBoxImageOutset", - "webkitMaskBoxImageRepeat", - "webkitMaskBoxImageSlice", - "webkitMaskBoxImageSource", - "webkitMaskBoxImageWidth", - "webkitMaskClip", - "webkitMaskComposite", - "webkitMaskImage", - "webkitMaskOrigin", - "webkitMaskPosition", - "webkitMaskPositionX", - "webkitMaskPositionY", - "webkitMaskRepeat", - "webkitMaskRepeatX", - "webkitMaskRepeatY", - "webkitMaskSize", - "webkitMaskSourceType", - "webkitMatchesSelector", - "webkitMaxLogicalHeight", - "webkitMaxLogicalWidth", - "webkitMediaStream", - "webkitMinLogicalHeight", - "webkitMinLogicalWidth", - "webkitNbspMode", - "webkitNotifications", - "webkitOfflineAudioContext", - "webkitOpacity", - "webkitOrder", - "webkitOrientation", - "webkitPaddingAfter", - "webkitPaddingBefore", - "webkitPaddingEnd", - "webkitPaddingStart", - "webkitPeerConnection00", - "webkitPersistentStorage", - "webkitPerspective", - "webkitPerspectiveOrigin", - "webkitPerspectiveOriginX", - "webkitPerspectiveOriginY", - "webkitPointerLockElement", - "webkitPostMessage", - "webkitPreservesPitch", - "webkitPrintColorAdjust", - "webkitPutImageDataHD", - "webkitRTCPeerConnection", - "webkitRegionOverset", - "webkitRelativePath", - "webkitRequestAnimationFrame", - "webkitRequestFileSystem", - "webkitRequestFullScreen", - "webkitRequestFullscreen", - "webkitRequestPointerLock", - "webkitResolveLocalFileSystemURL", - "webkitRtlOrdering", - "webkitRubyPosition", - "webkitSetMediaKeys", - "webkitSetResourceTimingBufferSize", - "webkitShadowRoot", - "webkitShapeImageThreshold", - "webkitShapeMargin", - "webkitShapeOutside", - "webkitShowPlaybackTargetPicker", - "webkitSlice", - "webkitSpeechGrammar", - "webkitSpeechGrammarList", - "webkitSpeechRecognition", - "webkitSpeechRecognitionError", - "webkitSpeechRecognitionEvent", - "webkitStorageInfo", - "webkitSupportsFullscreen", - "webkitSvgShadow", - "webkitTapHighlightColor", - "webkitTemporaryStorage", - "webkitTextCombine", - "webkitTextDecoration", - "webkitTextDecorationColor", - "webkitTextDecorationLine", - "webkitTextDecorationSkip", - "webkitTextDecorationStyle", - "webkitTextDecorationsInEffect", - "webkitTextEmphasis", - "webkitTextEmphasisColor", - "webkitTextEmphasisPosition", - "webkitTextEmphasisStyle", - "webkitTextFillColor", - "webkitTextOrientation", - "webkitTextSecurity", - "webkitTextSizeAdjust", - "webkitTextStroke", - "webkitTextStrokeColor", - "webkitTextStrokeWidth", - "webkitTextUnderlinePosition", - "webkitTextZoom", - "webkitTransform", - "webkitTransformOrigin", - "webkitTransformOriginX", - "webkitTransformOriginY", - "webkitTransformOriginZ", - "webkitTransformStyle", - "webkitTransition", - "webkitTransitionDelay", - "webkitTransitionDuration", - "webkitTransitionProperty", - "webkitTransitionTimingFunction", - "webkitURL", - "webkitUnlockOrientation", - "webkitUserDrag", - "webkitUserModify", - "webkitUserSelect", - "webkitVideoDecodedByteCount", - "webkitVisibilityState", - "webkitWirelessVideoPlaybackDisabled", - "webkitWritingMode", - "webkitdirectory", - "webkitdropzone", - "webstore", - "weekday", - "weight", - "whatToShow", - "wheelDelta", - "wheelDeltaX", - "wheelDeltaY", - "whenDefined", - "which", - "white-space", - "whiteSpace", - "wholeText", - "widows", - "width", - "will-change", - "willChange", - "willValidate", - "window", - "withCredentials", - "word-break", - "word-spacing", - "word-wrap", - "wordBreak", - "wordSpacing", - "wordWrap", - "workerStart", - "wrap", - "wrapKey", - "writable", - "writableAuxiliaries", - "write", - "writeText", - "writeValue", - "writeWithoutResponse", - "writeln", - "writing-mode", - "writingMode", - "x", - "x1", - "x2", - "xChannelSelector", - "xmlEncoding", - "xmlStandalone", - "xmlVersion", - "xmlbase", - "xmllang", - "xmlspace", - "xor", - "xr", - "y", - "y1", - "y2", - "yChannelSelector", - "yandex", - "year", - "z", - "z-index", - "zIndex", - "zoom", - "zoomAndPan", - "zoomRectScreen" -] diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/uglify-js/tools/exports.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/uglify-js/tools/exports.js deleted file mode 100644 index 1d2d510e..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/uglify-js/tools/exports.js +++ /dev/null @@ -1,8 +0,0 @@ -exports["Dictionary"] = Dictionary; -exports["is_statement"] = is_statement; -exports["List"] = List; -exports["minify"] = minify; -exports["parse"] = parse; -exports["push_uniq"] = push_uniq; -exports["TreeTransformer"] = TreeTransformer; -exports["TreeWalker"] = TreeWalker; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/uglify-js/tools/node.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/uglify-js/tools/node.js deleted file mode 100644 index 7ca19829..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/uglify-js/tools/node.js +++ /dev/null @@ -1,110 +0,0 @@ -var fs = require("fs"); - -exports.FILES = [ - require.resolve("../lib/utils.js"), - require.resolve("../lib/ast.js"), - require.resolve("../lib/transform.js"), - require.resolve("../lib/parse.js"), - require.resolve("../lib/scope.js"), - require.resolve("../lib/compress.js"), - require.resolve("../lib/output.js"), - require.resolve("../lib/sourcemap.js"), - require.resolve("../lib/mozilla-ast.js"), - require.resolve("../lib/propmangle.js"), - require.resolve("../lib/minify.js"), - require.resolve("./exports.js"), -]; - -new Function("domprops", "exports", function() { - var code = exports.FILES.map(function(file) { - return fs.readFileSync(file, "utf8"); - }); - code.push("exports.describe_ast = " + describe_ast.toString()); - return code.join("\n\n"); -}())(require("./domprops.json"), exports); - -function to_comment(value) { - if (typeof value != "string") value = JSON.stringify(value, function(key, value) { - return typeof value == "function" ? "<[ " + value + " ]>" : value; - }, 2); - return "// " + value.replace(/\n/g, "\n// "); -} - -if (+process.env["UGLIFY_BUG_REPORT"]) exports.minify = function(files, options) { - if (typeof options == "undefined") options = "<>"; - var code = [ - "// UGLIFY_BUG_REPORT", - to_comment(options), - ]; - if (typeof files == "string") { - code.push(""); - code.push("//-------------------------------------------------------------") - code.push("// INPUT CODE", files); - } else for (var name in files) { - code.push(""); - code.push("//-------------------------------------------------------------") - code.push(to_comment(name), files[name]); - } - if (options.sourceMap && options.sourceMap.url) { - code.push(""); - code.push("//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiJ9"); - } - var result = { code: code.join("\n") }; - if (options.sourceMap) result.map = '{"version":3,"sources":[],"names":[],"mappings":""}'; - return result; -}; - -function describe_ast() { - var out = OutputStream({ beautify: true }); - doitem(AST_Node); - return out.get() + "\n"; - - function doitem(ctor) { - out.print("AST_" + ctor.TYPE); - var props = ctor.SELF_PROPS.filter(function(prop) { - return !/^\$/.test(prop); - }); - if (props.length > 0) { - out.space(); - out.with_parens(function() { - props.forEach(function(prop, i) { - if (i) out.space(); - out.print(prop); - }); - }); - } - if (ctor.documentation) { - out.space(); - out.print_string(ctor.documentation); - } - if (ctor.SUBCLASSES.length > 0) { - out.space(); - out.with_block(function() { - ctor.SUBCLASSES.sort(function(a, b) { - return a.TYPE < b.TYPE ? -1 : 1; - }).forEach(function(ctor, i) { - out.indent(); - doitem(ctor); - out.newline(); - }); - }); - } - } -} - -function infer_options(options) { - var result = exports.minify("", options); - return result.error && result.error.defs; -} - -exports.default_options = function() { - var defs = infer_options({ 0: 0 }); - Object.keys(defs).forEach(function(component) { - var options = {}; - options[component] = { 0: 0 }; - if (options = infer_options(options)) { - defs[component] = options; - } - }); - return defs; -}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/uglify-js/tools/tty.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/uglify-js/tools/tty.js deleted file mode 100644 index 395c48ec..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/uglify-js/tools/tty.js +++ /dev/null @@ -1,22 +0,0 @@ -// workaround for tty output truncation on Node.js -try { - // prevent buffer overflow and other asynchronous bugs - process.stdout._handle.setBlocking(true); - process.stderr._handle.setBlocking(true); -} catch (e) { - // ensure output buffers are flushed before process termination - var exit = process.exit; - process.exit = function() { - var args = [].slice.call(arguments); - process.once("uncaughtException", function() { - (function callback() { - if (process.stdout.bufferSize || process.stderr.bufferSize) { - setTimeout(callback, 1); - } else { - exit.apply(process, args); - } - })(); - }); - throw exit; - }; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/LICENSE b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/LICENSE deleted file mode 100644 index 12a7f05a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -Copyright (c) 2009-2022 Jeremy Ashkenas, Julian Gonggrijp, and DocumentCloud and Investigative Reporters & Editors - -Permission is hereby granted, free of charge, to any person -obtaining a copy of this software and associated documentation -files (the "Software"), to deal in the Software without -restriction, including without limitation the rights to use, -copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following -conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/README.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/README.md deleted file mode 100644 index 9beae505..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/README.md +++ /dev/null @@ -1,34 +0,0 @@ - __ - /\ \ __ - __ __ ___ \_\ \ __ _ __ ____ ___ ___ _ __ __ /\_\ ____ - /\ \/\ \ /' _ `\ /'_ \ /'__`\/\ __\/ ,__\ / ___\ / __`\/\ __\/'__`\ \/\ \ /',__\ - \ \ \_\ \/\ \/\ \/\ \ \ \/\ __/\ \ \//\__, `\/\ \__//\ \ \ \ \ \//\ __/ __ \ \ \/\__, `\ - \ \____/\ \_\ \_\ \___,_\ \____\\ \_\\/\____/\ \____\ \____/\ \_\\ \____\/\_\ _\ \ \/\____/ - \/___/ \/_/\/_/\/__,_ /\/____/ \/_/ \/___/ \/____/\/___/ \/_/ \/____/\/_//\ \_\ \/___/ - \ \____/ - \/___/ - -Underscore.js is a utility-belt library for JavaScript that provides -support for the usual functional suspects (each, map, reduce, filter...) -without extending any core JavaScript objects. - -For Docs, License, Tests, and pre-packed downloads, see: -https://underscorejs.org - -For support and questions, please consult -our [security policy](SECURITY.md), -[the gitter channel](https://gitter.im/jashkenas/underscore) -or [stackoverflow](https://stackoverflow.com/search?q=underscore.js) - -Underscore is an open-sourced component of DocumentCloud: -https://github.com/documentcloud - -Many thanks to our contributors: -https://github.com/jashkenas/underscore/contributors - -You can support the project by donating on -[Patreon](https://patreon.com/juliangonggrijp). -Enterprise coverage is available as part of the -[Tidelift Subscription](https://tidelift.com/subscription/pkg/npm-underscore?utm_source=npm-underscore&utm_medium=referral&utm_campaign=enterprise). - -This project adheres to a [code of conduct](CODE_OF_CONDUCT.md). By participating, you are expected to uphold this code. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/_baseCreate.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/_baseCreate.js deleted file mode 100644 index 34ae6def..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/_baseCreate.js +++ /dev/null @@ -1,21 +0,0 @@ -define(['./isObject', './_setup'], function (isObject, _setup) { - - // Create a naked function reference for surrogate-prototype-swapping. - function ctor() { - return function(){}; - } - - // An internal function for creating a new object that inherits from another. - function baseCreate(prototype) { - if (!isObject(prototype)) return {}; - if (_setup.nativeCreate) return _setup.nativeCreate(prototype); - var Ctor = ctor(); - Ctor.prototype = prototype; - var result = new Ctor; - Ctor.prototype = null; - return result; - } - - return baseCreate; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/_baseIteratee.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/_baseIteratee.js deleted file mode 100644 index 6579215b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/_baseIteratee.js +++ /dev/null @@ -1,15 +0,0 @@ -define(['./identity', './isFunction', './isObject', './isArray', './matcher', './property', './_optimizeCb'], function (identity, isFunction, isObject, isArray, matcher, property, _optimizeCb) { - - // An internal function to generate callbacks that can be applied to each - // element in a collection, returning the desired result — either `_.identity`, - // an arbitrary callback, a property matcher, or a property accessor. - function baseIteratee(value, context, argCount) { - if (value == null) return identity; - if (isFunction(value)) return _optimizeCb(value, context, argCount); - if (isObject(value) && !isArray(value)) return matcher(value); - return property(value); - } - - return baseIteratee; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/_cb.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/_cb.js deleted file mode 100644 index 6544623b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/_cb.js +++ /dev/null @@ -1,12 +0,0 @@ -define(['./underscore', './_baseIteratee', './iteratee'], function (underscore, _baseIteratee, iteratee) { - - // The function we call internally to generate a callback. It invokes - // `_.iteratee` if overridden, otherwise `baseIteratee`. - function cb(value, context, argCount) { - if (underscore.iteratee !== iteratee) return underscore.iteratee(value, context); - return _baseIteratee(value, context, argCount); - } - - return cb; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/_chainResult.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/_chainResult.js deleted file mode 100644 index f9e3002d..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/_chainResult.js +++ /dev/null @@ -1,10 +0,0 @@ -define(['./underscore'], function (underscore) { - - // Helper function to continue chaining intermediate results. - function chainResult(instance, obj) { - return instance._chain ? underscore(obj).chain() : obj; - } - - return chainResult; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/_collectNonEnumProps.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/_collectNonEnumProps.js deleted file mode 100644 index cb8af807..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/_collectNonEnumProps.js +++ /dev/null @@ -1,42 +0,0 @@ -define(['./_setup', './isFunction', './_has'], function (_setup, isFunction, _has) { - - // Internal helper to create a simple lookup structure. - // `collectNonEnumProps` used to depend on `_.contains`, but this led to - // circular imports. `emulatedSet` is a one-off solution that only works for - // arrays of strings. - function emulatedSet(keys) { - var hash = {}; - for (var l = keys.length, i = 0; i < l; ++i) hash[keys[i]] = true; - return { - contains: function(key) { return hash[key] === true; }, - push: function(key) { - hash[key] = true; - return keys.push(key); - } - }; - } - - // Internal helper. Checks `keys` for the presence of keys in IE < 9 that won't - // be iterated by `for key in ...` and thus missed. Extends `keys` in place if - // needed. - function collectNonEnumProps(obj, keys) { - keys = emulatedSet(keys); - var nonEnumIdx = _setup.nonEnumerableProps.length; - var constructor = obj.constructor; - var proto = (isFunction(constructor) && constructor.prototype) || _setup.ObjProto; - - // Constructor is a special case. - var prop = 'constructor'; - if (_has(obj, prop) && !keys.contains(prop)) keys.push(prop); - - while (nonEnumIdx--) { - prop = _setup.nonEnumerableProps[nonEnumIdx]; - if (prop in obj && obj[prop] !== proto[prop] && !keys.contains(prop)) { - keys.push(prop); - } - } - } - - return collectNonEnumProps; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/_createAssigner.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/_createAssigner.js deleted file mode 100644 index deb5902d..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/_createAssigner.js +++ /dev/null @@ -1,24 +0,0 @@ -define(function () { - - // An internal function for creating assigner functions. - function createAssigner(keysFunc, defaults) { - return function(obj) { - var length = arguments.length; - if (defaults) obj = Object(obj); - if (length < 2 || obj == null) return obj; - for (var index = 1; index < length; index++) { - var source = arguments[index], - keys = keysFunc(source), - l = keys.length; - for (var i = 0; i < l; i++) { - var key = keys[i]; - if (!defaults || obj[key] === void 0) obj[key] = source[key]; - } - } - return obj; - }; - } - - return createAssigner; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/_createEscaper.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/_createEscaper.js deleted file mode 100644 index 385ad84e..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/_createEscaper.js +++ /dev/null @@ -1,21 +0,0 @@ -define(['./keys'], function (keys) { - - // Internal helper to generate functions for escaping and unescaping strings - // to/from HTML interpolation. - function createEscaper(map) { - var escaper = function(match) { - return map[match]; - }; - // Regexes for identifying a key that needs to be escaped. - var source = '(?:' + keys(map).join('|') + ')'; - var testRegexp = RegExp(source); - var replaceRegexp = RegExp(source, 'g'); - return function(string) { - string = string == null ? '' : '' + string; - return testRegexp.test(string) ? string.replace(replaceRegexp, escaper) : string; - }; - } - - return createEscaper; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/_createIndexFinder.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/_createIndexFinder.js deleted file mode 100644 index 400fb05d..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/_createIndexFinder.js +++ /dev/null @@ -1,30 +0,0 @@ -define(['./_getLength', './_setup', './isNaN'], function (_getLength, _setup, _isNaN) { - - // Internal function to generate the `_.indexOf` and `_.lastIndexOf` functions. - function createIndexFinder(dir, predicateFind, sortedIndex) { - return function(array, item, idx) { - var i = 0, length = _getLength(array); - if (typeof idx == 'number') { - if (dir > 0) { - i = idx >= 0 ? idx : Math.max(idx + length, i); - } else { - length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1; - } - } else if (sortedIndex && idx && length) { - idx = sortedIndex(array, item); - return array[idx] === item ? idx : -1; - } - if (item !== item) { - idx = predicateFind(_setup.slice.call(array, i, length), _isNaN); - return idx >= 0 ? idx + i : -1; - } - for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) { - if (array[idx] === item) return idx; - } - return -1; - }; - } - - return createIndexFinder; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/_createPredicateIndexFinder.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/_createPredicateIndexFinder.js deleted file mode 100644 index 27635f2e..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/_createPredicateIndexFinder.js +++ /dev/null @@ -1,18 +0,0 @@ -define(['./_cb', './_getLength'], function (_cb, _getLength) { - - // Internal function to generate `_.findIndex` and `_.findLastIndex`. - function createPredicateIndexFinder(dir) { - return function(array, predicate, context) { - predicate = _cb(predicate, context); - var length = _getLength(array); - var index = dir > 0 ? 0 : length - 1; - for (; index >= 0 && index < length; index += dir) { - if (predicate(array[index], index, array)) return index; - } - return -1; - }; - } - - return createPredicateIndexFinder; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/_createReduce.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/_createReduce.js deleted file mode 100644 index 303a6d85..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/_createReduce.js +++ /dev/null @@ -1,30 +0,0 @@ -define(['./_isArrayLike', './keys', './_optimizeCb'], function (_isArrayLike, keys, _optimizeCb) { - - // Internal helper to create a reducing function, iterating left or right. - function createReduce(dir) { - // Wrap code that reassigns argument variables in a separate function than - // the one that accesses `arguments.length` to avoid a perf hit. (#1991) - var reducer = function(obj, iteratee, memo, initial) { - var _keys = !_isArrayLike(obj) && keys(obj), - length = (_keys || obj).length, - index = dir > 0 ? 0 : length - 1; - if (!initial) { - memo = obj[_keys ? _keys[index] : index]; - index += dir; - } - for (; index >= 0 && index < length; index += dir) { - var currentKey = _keys ? _keys[index] : index; - memo = iteratee(memo, obj[currentKey], currentKey, obj); - } - return memo; - }; - - return function(obj, iteratee, memo, context) { - var initial = arguments.length >= 3; - return reducer(obj, _optimizeCb(iteratee, context, 4), memo, initial); - }; - } - - return createReduce; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/_createSizePropertyCheck.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/_createSizePropertyCheck.js deleted file mode 100644 index 83ce2c43..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/_createSizePropertyCheck.js +++ /dev/null @@ -1,13 +0,0 @@ -define(['./_setup'], function (_setup) { - - // Common internal logic for `isArrayLike` and `isBufferLike`. - function createSizePropertyCheck(getSizeProperty) { - return function(collection) { - var sizeProperty = getSizeProperty(collection); - return typeof sizeProperty == 'number' && sizeProperty >= 0 && sizeProperty <= _setup.MAX_ARRAY_INDEX; - } - } - - return createSizePropertyCheck; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/_deepGet.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/_deepGet.js deleted file mode 100644 index e0751085..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/_deepGet.js +++ /dev/null @@ -1,15 +0,0 @@ -define(function () { - - // Internal function to obtain a nested property in `obj` along `path`. - function deepGet(obj, path) { - var length = path.length; - for (var i = 0; i < length; i++) { - if (obj == null) return void 0; - obj = obj[path[i]]; - } - return length ? obj : void 0; - } - - return deepGet; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/_escapeMap.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/_escapeMap.js deleted file mode 100644 index 584873e8..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/_escapeMap.js +++ /dev/null @@ -1,15 +0,0 @@ -define(function () { - - // Internal list of HTML entities for escaping. - var escapeMap = { - '&': '&', - '<': '<', - '>': '>', - '"': '"', - "'": ''', - '`': '`' - }; - - return escapeMap; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/_executeBound.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/_executeBound.js deleted file mode 100644 index b3ac1cb9..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/_executeBound.js +++ /dev/null @@ -1,16 +0,0 @@ -define(['./_baseCreate', './isObject'], function (_baseCreate, isObject) { - - // Internal function to execute `sourceFunc` bound to `context` with optional - // `args`. Determines whether to execute a function as a constructor or as a - // normal function. - function executeBound(sourceFunc, boundFunc, context, callingContext, args) { - if (!(callingContext instanceof boundFunc)) return sourceFunc.apply(context, args); - var self = _baseCreate(sourceFunc.prototype); - var result = sourceFunc.apply(self, args); - if (isObject(result)) return result; - return self; - } - - return executeBound; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/_flatten.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/_flatten.js deleted file mode 100644 index 26ca34d7..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/_flatten.js +++ /dev/null @@ -1,32 +0,0 @@ -define(['./_getLength', './_isArrayLike', './isArray', './isArguments'], function (_getLength, _isArrayLike, isArray, isArguments) { - - // Internal implementation of a recursive `flatten` function. - function flatten(input, depth, strict, output) { - output = output || []; - if (!depth && depth !== 0) { - depth = Infinity; - } else if (depth <= 0) { - return output.concat(input); - } - var idx = output.length; - for (var i = 0, length = _getLength(input); i < length; i++) { - var value = input[i]; - if (_isArrayLike(value) && (isArray(value) || isArguments(value))) { - // Flatten current level of array or arguments object. - if (depth > 1) { - flatten(value, depth - 1, strict, output); - idx = output.length; - } else { - var j = 0, len = value.length; - while (j < len) output[idx++] = value[j++]; - } - } else if (!strict) { - output[idx++] = value; - } - } - return output; - } - - return flatten; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/_getByteLength.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/_getByteLength.js deleted file mode 100644 index c6d9974a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/_getByteLength.js +++ /dev/null @@ -1,8 +0,0 @@ -define(['./_shallowProperty'], function (_shallowProperty) { - - // Internal helper to obtain the `byteLength` property of an object. - var getByteLength = _shallowProperty('byteLength'); - - return getByteLength; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/_getLength.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/_getLength.js deleted file mode 100644 index f889b985..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/_getLength.js +++ /dev/null @@ -1,8 +0,0 @@ -define(['./_shallowProperty'], function (_shallowProperty) { - - // Internal helper to obtain the `length` property of an object. - var getLength = _shallowProperty('length'); - - return getLength; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/_group.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/_group.js deleted file mode 100644 index d9805520..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/_group.js +++ /dev/null @@ -1,18 +0,0 @@ -define(['./_cb', './each'], function (_cb, each) { - - // An internal function used for aggregate "group by" operations. - function group(behavior, partition) { - return function(obj, iteratee, context) { - var result = partition ? [[], []] : {}; - iteratee = _cb(iteratee, context); - each(obj, function(value, index) { - var key = iteratee(value, index, obj); - behavior(result, value, key); - }); - return result; - }; - } - - return group; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/_has.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/_has.js deleted file mode 100644 index 983f0602..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/_has.js +++ /dev/null @@ -1,10 +0,0 @@ -define(['./_setup'], function (_setup) { - - // Internal function to check whether `key` is an own property name of `obj`. - function has(obj, key) { - return obj != null && _setup.hasOwnProperty.call(obj, key); - } - - return has; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/_hasObjectTag.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/_hasObjectTag.js deleted file mode 100644 index bb9bee63..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/_hasObjectTag.js +++ /dev/null @@ -1,7 +0,0 @@ -define(['./_tagTester'], function (_tagTester) { - - var hasObjectTag = _tagTester('Object'); - - return hasObjectTag; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/_isArrayLike.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/_isArrayLike.js deleted file mode 100644 index 2137c4b4..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/_isArrayLike.js +++ /dev/null @@ -1,11 +0,0 @@ -define(['./_createSizePropertyCheck', './_getLength'], function (_createSizePropertyCheck, _getLength) { - - // Internal helper for collection methods to determine whether a collection - // should be iterated as an array or as an object. - // Related: https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength - // Avoids a very nasty iOS 8 JIT bug on ARM-64. #2094 - var isArrayLike = _createSizePropertyCheck(_getLength); - - return isArrayLike; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/_isBufferLike.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/_isBufferLike.js deleted file mode 100644 index 813641d8..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/_isBufferLike.js +++ /dev/null @@ -1,9 +0,0 @@ -define(['./_createSizePropertyCheck', './_getByteLength'], function (_createSizePropertyCheck, _getByteLength) { - - // Internal helper to determine whether we should spend extensive checks against - // `ArrayBuffer` et al. - var isBufferLike = _createSizePropertyCheck(_getByteLength); - - return isBufferLike; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/_keyInObj.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/_keyInObj.js deleted file mode 100644 index ba269d98..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/_keyInObj.js +++ /dev/null @@ -1,11 +0,0 @@ -define(function () { - - // Internal `_.pick` helper function to determine whether `key` is an enumerable - // property name of `obj`. - function keyInObj(value, key, obj) { - return key in obj; - } - - return keyInObj; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/_methodFingerprint.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/_methodFingerprint.js deleted file mode 100644 index c651f61f..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/_methodFingerprint.js +++ /dev/null @@ -1,44 +0,0 @@ -define(['exports', './_getLength', './isFunction', './allKeys'], function (exports, _getLength, isFunction, allKeys) { - - // Since the regular `Object.prototype.toString` type tests don't work for - // some types in IE 11, we use a fingerprinting heuristic instead, based - // on the methods. It's not great, but it's the best we got. - // The fingerprint method lists are defined below. - function ie11fingerprint(methods) { - var length = _getLength(methods); - return function(obj) { - if (obj == null) return false; - // `Map`, `WeakMap` and `Set` have no enumerable keys. - var keys = allKeys(obj); - if (_getLength(keys)) return false; - for (var i = 0; i < length; i++) { - if (!isFunction(obj[methods[i]])) return false; - } - // If we are testing against `WeakMap`, we need to ensure that - // `obj` doesn't have a `forEach` method in order to distinguish - // it from a regular `Map`. - return methods !== weakMapMethods || !isFunction(obj[forEachName]); - }; - } - - // In the interest of compact minification, we write - // each string in the fingerprints only once. - var forEachName = 'forEach', - hasName = 'has', - commonInit = ['clear', 'delete'], - mapTail = ['get', hasName, 'set']; - - // `Map`, `WeakMap` and `Set` each have slightly different - // combinations of the above sublists. - var mapMethods = commonInit.concat(forEachName, mapTail), - weakMapMethods = commonInit.concat(mapTail), - setMethods = ['add'].concat(commonInit, forEachName, hasName); - - exports.ie11fingerprint = ie11fingerprint; - exports.mapMethods = mapMethods; - exports.setMethods = setMethods; - exports.weakMapMethods = weakMapMethods; - - Object.defineProperty(exports, '__esModule', { value: true }); - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/_optimizeCb.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/_optimizeCb.js deleted file mode 100644 index 0ed8c681..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/_optimizeCb.js +++ /dev/null @@ -1,27 +0,0 @@ -define(function () { - - // Internal function that returns an efficient (for current engines) version - // of the passed-in callback, to be repeatedly applied in other Underscore - // functions. - function optimizeCb(func, context, argCount) { - if (context === void 0) return func; - switch (argCount == null ? 3 : argCount) { - case 1: return function(value) { - return func.call(context, value); - }; - // The 2-argument case is omitted because we’re not using it. - case 3: return function(value, index, collection) { - return func.call(context, value, index, collection); - }; - case 4: return function(accumulator, value, index, collection) { - return func.call(context, accumulator, value, index, collection); - }; - } - return function() { - return func.apply(context, arguments); - }; - } - - return optimizeCb; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/_set.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/_set.js deleted file mode 100644 index 92099e09..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/_set.js +++ /dev/null @@ -1,21 +0,0 @@ -define(['./isNumber', './isArray', './isObject'], function (isNumber, isArray, isObject) { - - function set (obj, path, value) { - var key = String(path[0]); - - if (path.length === 1) { - obj[key] = value; - return; - } - - if (!isArray(obj[key]) || !isObject(obj[key])) { - var nextKey = path[1]; - obj[key] = isNumber(nextKey) ? [] : {}; - } - - return set(obj[key], path.slice(1), value); - } - - return set; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/_setup.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/_setup.js deleted file mode 100644 index a9acf567..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/_setup.js +++ /dev/null @@ -1,70 +0,0 @@ -define(['exports'], function (exports) { - - // Current version. - var VERSION = '1.13.6'; - - // Establish the root object, `window` (`self`) in the browser, `global` - // on the server, or `this` in some virtual machines. We use `self` - // instead of `window` for `WebWorker` support. - var root = (typeof self == 'object' && self.self === self && self) || - (typeof global == 'object' && global.global === global && global) || - Function('return this')() || - {}; - - // Save bytes in the minified (but not gzipped) version: - var ArrayProto = Array.prototype, ObjProto = Object.prototype; - var SymbolProto = typeof Symbol !== 'undefined' ? Symbol.prototype : null; - - // Create quick reference variables for speed access to core prototypes. - var push = ArrayProto.push, - slice = ArrayProto.slice, - toString = ObjProto.toString, - hasOwnProperty = ObjProto.hasOwnProperty; - - // Modern feature detection. - var supportsArrayBuffer = typeof ArrayBuffer !== 'undefined', - supportsDataView = typeof DataView !== 'undefined'; - - // All **ECMAScript 5+** native function implementations that we hope to use - // are declared here. - var nativeIsArray = Array.isArray, - nativeKeys = Object.keys, - nativeCreate = Object.create, - nativeIsView = supportsArrayBuffer && ArrayBuffer.isView; - - // Create references to these builtin functions because we override them. - var _isNaN = isNaN, - _isFinite = isFinite; - - // Keys in IE < 9 that won't be iterated by `for key in ...` and thus missed. - var hasEnumBug = !{toString: null}.propertyIsEnumerable('toString'); - var nonEnumerableProps = ['valueOf', 'isPrototypeOf', 'toString', - 'propertyIsEnumerable', 'hasOwnProperty', 'toLocaleString']; - - // The largest integer that can be represented exactly. - var MAX_ARRAY_INDEX = Math.pow(2, 53) - 1; - - exports.ArrayProto = ArrayProto; - exports.MAX_ARRAY_INDEX = MAX_ARRAY_INDEX; - exports.ObjProto = ObjProto; - exports.SymbolProto = SymbolProto; - exports.VERSION = VERSION; - exports._isFinite = _isFinite; - exports._isNaN = _isNaN; - exports.hasEnumBug = hasEnumBug; - exports.hasOwnProperty = hasOwnProperty; - exports.nativeCreate = nativeCreate; - exports.nativeIsArray = nativeIsArray; - exports.nativeIsView = nativeIsView; - exports.nativeKeys = nativeKeys; - exports.nonEnumerableProps = nonEnumerableProps; - exports.push = push; - exports.root = root; - exports.slice = slice; - exports.supportsArrayBuffer = supportsArrayBuffer; - exports.supportsDataView = supportsDataView; - exports.toString = toString; - - Object.defineProperty(exports, '__esModule', { value: true }); - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/_shallowProperty.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/_shallowProperty.js deleted file mode 100644 index e0ca2269..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/_shallowProperty.js +++ /dev/null @@ -1,12 +0,0 @@ -define(function () { - - // Internal helper to generate a function to obtain property `key` from `obj`. - function shallowProperty(key) { - return function(obj) { - return obj == null ? void 0 : obj[key]; - }; - } - - return shallowProperty; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/_stringTagBug.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/_stringTagBug.js deleted file mode 100644 index c4ec5b1e..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/_stringTagBug.js +++ /dev/null @@ -1,16 +0,0 @@ -define(['exports', './_setup', './_hasObjectTag'], function (exports, _setup, _hasObjectTag) { - - // In IE 10 - Edge 13, `DataView` has string tag `'[object Object]'`. - // In IE 11, the most common among them, this problem also applies to - // `Map`, `WeakMap` and `Set`. - var hasStringTagBug = ( - _setup.supportsDataView && _hasObjectTag(new DataView(new ArrayBuffer(8))) - ), - isIE11 = (typeof Map !== 'undefined' && _hasObjectTag(new Map)); - - exports.hasStringTagBug = hasStringTagBug; - exports.isIE11 = isIE11; - - Object.defineProperty(exports, '__esModule', { value: true }); - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/_tagTester.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/_tagTester.js deleted file mode 100644 index 6b1f09eb..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/_tagTester.js +++ /dev/null @@ -1,13 +0,0 @@ -define(['./_setup'], function (_setup) { - - // Internal function for creating a `toString`-based type tester. - function tagTester(name) { - var tag = '[object ' + name + ']'; - return function(obj) { - return _setup.toString.call(obj) === tag; - }; - } - - return tagTester; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/_toBufferView.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/_toBufferView.js deleted file mode 100644 index e9464a32..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/_toBufferView.js +++ /dev/null @@ -1,15 +0,0 @@ -define(['./_getByteLength'], function (_getByteLength) { - - // Internal function to wrap or shallow-copy an ArrayBuffer, - // typed array or DataView to a new view, reusing the buffer. - function toBufferView(bufferSource) { - return new Uint8Array( - bufferSource.buffer || bufferSource, - bufferSource.byteOffset || 0, - _getByteLength(bufferSource) - ); - } - - return toBufferView; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/_toPath.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/_toPath.js deleted file mode 100644 index e692cfd9..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/_toPath.js +++ /dev/null @@ -1,11 +0,0 @@ -define(['./underscore', './toPath'], function (underscore, toPath$1) { - - // Internal wrapper for `_.toPath` to enable minification. - // Similar to `cb` for `_.iteratee`. - function toPath(path) { - return underscore.toPath(path); - } - - return toPath; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/_unescapeMap.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/_unescapeMap.js deleted file mode 100644 index 28cf0709..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/_unescapeMap.js +++ /dev/null @@ -1,8 +0,0 @@ -define(['./invert', './_escapeMap'], function (invert, _escapeMap) { - - // Internal list of HTML entities for unescaping. - var unescapeMap = invert(_escapeMap); - - return unescapeMap; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/after.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/after.js deleted file mode 100644 index 69b73c69..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/after.js +++ /dev/null @@ -1,14 +0,0 @@ -define(function () { - - // Returns a function that will only be executed on and after the Nth call. - function after(times, func) { - return function() { - if (--times < 1) { - return func.apply(this, arguments); - } - }; - } - - return after; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/allKeys.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/allKeys.js deleted file mode 100644 index 1be84f1c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/allKeys.js +++ /dev/null @@ -1,15 +0,0 @@ -define(['./isObject', './_setup', './_collectNonEnumProps'], function (isObject, _setup, _collectNonEnumProps) { - - // Retrieve all the enumerable property names of an object. - function allKeys(obj) { - if (!isObject(obj)) return []; - var keys = []; - for (var key in obj) keys.push(key); - // Ahem, IE < 9. - if (_setup.hasEnumBug) _collectNonEnumProps(obj, keys); - return keys; - } - - return allKeys; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/before.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/before.js deleted file mode 100644 index bd856c69..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/before.js +++ /dev/null @@ -1,18 +0,0 @@ -define(function () { - - // Returns a function that will only be executed up to (but not including) the - // Nth call. - function before(times, func) { - var memo; - return function() { - if (--times > 0) { - memo = func.apply(this, arguments); - } - if (times <= 1) func = null; - return memo; - }; - } - - return before; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/bind.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/bind.js deleted file mode 100644 index d41ec562..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/bind.js +++ /dev/null @@ -1,15 +0,0 @@ -define(['./restArguments', './isFunction', './_executeBound'], function (restArguments, isFunction, _executeBound) { - - // Create a function bound to a given object (assigning `this`, and arguments, - // optionally). - var bind = restArguments(function(func, context, args) { - if (!isFunction(func)) throw new TypeError('Bind must be called on a function'); - var bound = restArguments(function(callArgs) { - return _executeBound(func, bound, context, this, args.concat(callArgs)); - }); - return bound; - }); - - return bind; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/bindAll.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/bindAll.js deleted file mode 100644 index 26dcef1e..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/bindAll.js +++ /dev/null @@ -1,19 +0,0 @@ -define(['./restArguments', './_flatten', './bind'], function (restArguments, _flatten, bind) { - - // Bind a number of an object's methods to that object. Remaining arguments - // are the method names to be bound. Useful for ensuring that all callbacks - // defined on an object belong to it. - var bindAll = restArguments(function(obj, keys) { - keys = _flatten(keys, false, false); - var index = keys.length; - if (index < 1) throw new Error('bindAll must be passed function names'); - while (index--) { - var key = keys[index]; - obj[key] = bind(obj[key], obj); - } - return obj; - }); - - return bindAll; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/chain.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/chain.js deleted file mode 100644 index ba42101d..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/chain.js +++ /dev/null @@ -1,12 +0,0 @@ -define(['./underscore'], function (underscore) { - - // Start chaining a wrapped Underscore object. - function chain(obj) { - var instance = underscore(obj); - instance._chain = true; - return instance; - } - - return chain; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/chunk.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/chunk.js deleted file mode 100644 index ed4e0865..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/chunk.js +++ /dev/null @@ -1,17 +0,0 @@ -define(['./_setup'], function (_setup) { - - // Chunk a single array into multiple arrays, each containing `count` or fewer - // items. - function chunk(array, count) { - if (count == null || count < 1) return []; - var result = []; - var i = 0, length = array.length; - while (i < length) { - result.push(_setup.slice.call(array, i, i += count)); - } - return result; - } - - return chunk; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/clone.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/clone.js deleted file mode 100644 index 1a196300..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/clone.js +++ /dev/null @@ -1,11 +0,0 @@ -define(['./isObject', './isArray', './extend'], function (isObject, isArray, extend) { - - // Create a (shallow-cloned) duplicate of an object. - function clone(obj) { - if (!isObject(obj)) return obj; - return isArray(obj) ? obj.slice() : extend({}, obj); - } - - return clone; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/compact.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/compact.js deleted file mode 100644 index 202433b4..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/compact.js +++ /dev/null @@ -1,10 +0,0 @@ -define(['./filter'], function (filter) { - - // Trim out all falsy values from an array. - function compact(array) { - return filter(array, Boolean); - } - - return compact; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/compose.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/compose.js deleted file mode 100644 index 93d8c36e..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/compose.js +++ /dev/null @@ -1,18 +0,0 @@ -define(function () { - - // Returns a function that is the composition of a list of functions, each - // consuming the return value of the function that follows. - function compose() { - var args = arguments; - var start = args.length - 1; - return function() { - var i = start; - var result = args[start].apply(this, arguments); - while (i--) result = args[i].call(this, result); - return result; - }; - } - - return compose; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/constant.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/constant.js deleted file mode 100644 index 6d3ac2cf..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/constant.js +++ /dev/null @@ -1,12 +0,0 @@ -define(function () { - - // Predicate-generating function. Often useful outside of Underscore. - function constant(value) { - return function() { - return value; - }; - } - - return constant; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/contains.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/contains.js deleted file mode 100644 index 578b0501..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/contains.js +++ /dev/null @@ -1,12 +0,0 @@ -define(['./_isArrayLike', './values', './indexOf'], function (_isArrayLike, values, indexOf) { - - // Determine if the array or object contains a given item (using `===`). - function contains(obj, item, fromIndex, guard) { - if (!_isArrayLike(obj)) obj = values(obj); - if (typeof fromIndex != 'number' || guard) fromIndex = 0; - return indexOf(obj, item, fromIndex) >= 0; - } - - return contains; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/countBy.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/countBy.js deleted file mode 100644 index 0ab64227..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/countBy.js +++ /dev/null @@ -1,12 +0,0 @@ -define(['./_group', './_has'], function (_group, _has) { - - // Counts instances of an object that group by a certain criterion. Pass - // either a string attribute to count by, or a function that returns the - // criterion. - var countBy = _group(function(result, value, key) { - if (_has(result, key)) result[key]++; else result[key] = 1; - }); - - return countBy; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/create.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/create.js deleted file mode 100644 index d5e28136..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/create.js +++ /dev/null @@ -1,14 +0,0 @@ -define(['./_baseCreate', './extendOwn'], function (_baseCreate, extendOwn) { - - // Creates an object that inherits from the given prototype object. - // If additional properties are provided then they will be added to the - // created object. - function create(prototype, props) { - var result = _baseCreate(prototype); - if (props) extendOwn(result, props); - return result; - } - - return create; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/debounce.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/debounce.js deleted file mode 100644 index 1d88168f..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/debounce.js +++ /dev/null @@ -1,43 +0,0 @@ -define(['./restArguments', './now'], function (restArguments, now) { - - // When a sequence of calls of the returned function ends, the argument - // function is triggered. The end of a sequence is defined by the `wait` - // parameter. If `immediate` is passed, the argument function will be - // triggered at the beginning of the sequence instead of at the end. - function debounce(func, wait, immediate) { - var timeout, previous, args, result, context; - - var later = function() { - var passed = now() - previous; - if (wait > passed) { - timeout = setTimeout(later, wait - passed); - } else { - timeout = null; - if (!immediate) result = func.apply(context, args); - // This check is needed because `func` can recursively invoke `debounced`. - if (!timeout) args = context = null; - } - }; - - var debounced = restArguments(function(_args) { - context = this; - args = _args; - previous = now(); - if (!timeout) { - timeout = setTimeout(later, wait); - if (immediate) result = func.apply(context, args); - } - return result; - }); - - debounced.cancel = function() { - clearTimeout(timeout); - timeout = args = context = null; - }; - - return debounced; - } - - return debounce; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/defaults.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/defaults.js deleted file mode 100644 index 6903faac..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/defaults.js +++ /dev/null @@ -1,8 +0,0 @@ -define(['./_createAssigner', './allKeys'], function (_createAssigner, allKeys) { - - // Fill in a given object with default properties. - var defaults = _createAssigner(allKeys, true); - - return defaults; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/defer.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/defer.js deleted file mode 100644 index ce338a7b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/defer.js +++ /dev/null @@ -1,9 +0,0 @@ -define(['./partial', './delay', './underscore'], function (partial, delay, underscore) { - - // Defers a function, scheduling it to run after the current call stack has - // cleared. - var defer = partial(delay, underscore, 1); - - return defer; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/delay.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/delay.js deleted file mode 100644 index 715d24d7..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/delay.js +++ /dev/null @@ -1,13 +0,0 @@ -define(['./restArguments'], function (restArguments) { - - // Delays a function for the given number of milliseconds, and then calls - // it with the arguments supplied. - var delay = restArguments(function(func, wait, args) { - return setTimeout(function() { - return func.apply(null, args); - }, wait); - }); - - return delay; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/difference.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/difference.js deleted file mode 100644 index 11f19027..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/difference.js +++ /dev/null @@ -1,14 +0,0 @@ -define(['./restArguments', './_flatten', './filter', './contains'], function (restArguments, _flatten, filter, contains) { - - // Take the difference between one array and a number of other arrays. - // Only the elements present in just the first array will remain. - var difference = restArguments(function(array, rest) { - rest = _flatten(rest, true, true); - return filter(array, function(value){ - return !contains(rest, value); - }); - }); - - return difference; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/each.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/each.js deleted file mode 100644 index f5c47ab8..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/each.js +++ /dev/null @@ -1,25 +0,0 @@ -define(['./_optimizeCb', './_isArrayLike', './keys'], function (_optimizeCb, _isArrayLike, keys) { - - // The cornerstone for collection functions, an `each` - // implementation, aka `forEach`. - // Handles raw objects in addition to array-likes. Treats all - // sparse array-likes as if they were dense. - function each(obj, iteratee, context) { - iteratee = _optimizeCb(iteratee, context); - var i, length; - if (_isArrayLike(obj)) { - for (i = 0, length = obj.length; i < length; i++) { - iteratee(obj[i], i, obj); - } - } else { - var _keys = keys(obj); - for (i = 0, length = _keys.length; i < length; i++) { - iteratee(obj[_keys[i]], _keys[i], obj); - } - } - return obj; - } - - return each; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/escape.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/escape.js deleted file mode 100644 index 6714d122..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/escape.js +++ /dev/null @@ -1,8 +0,0 @@ -define(['./_createEscaper', './_escapeMap'], function (_createEscaper, _escapeMap) { - - // Function for escaping strings to HTML interpolation. - var _escape = _createEscaper(_escapeMap); - - return _escape; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/every.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/every.js deleted file mode 100644 index 1180c445..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/every.js +++ /dev/null @@ -1,17 +0,0 @@ -define(['./_cb', './_isArrayLike', './keys'], function (_cb, _isArrayLike, keys) { - - // Determine whether all of the elements pass a truth test. - function every(obj, predicate, context) { - predicate = _cb(predicate, context); - var _keys = !_isArrayLike(obj) && keys(obj), - length = (_keys || obj).length; - for (var index = 0; index < length; index++) { - var currentKey = _keys ? _keys[index] : index; - if (!predicate(obj[currentKey], currentKey, obj)) return false; - } - return true; - } - - return every; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/extend.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/extend.js deleted file mode 100644 index 35d87616..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/extend.js +++ /dev/null @@ -1,8 +0,0 @@ -define(['./_createAssigner', './allKeys'], function (_createAssigner, allKeys) { - - // Extend a given object with all the properties in passed-in object(s). - var extend = _createAssigner(allKeys); - - return extend; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/extendOwn.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/extendOwn.js deleted file mode 100644 index 2e1e4b5d..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/extendOwn.js +++ /dev/null @@ -1,10 +0,0 @@ -define(['./_createAssigner', './keys'], function (_createAssigner, keys) { - - // Assigns a given object with all the own properties in the passed-in - // object(s). - // (https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/assign) - var extendOwn = _createAssigner(keys); - - return extendOwn; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/filter.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/filter.js deleted file mode 100644 index a7675687..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/filter.js +++ /dev/null @@ -1,15 +0,0 @@ -define(['./_cb', './each'], function (_cb, each) { - - // Return all the elements that pass a truth test. - function filter(obj, predicate, context) { - var results = []; - predicate = _cb(predicate, context); - each(obj, function(value, index, list) { - if (predicate(value, index, list)) results.push(value); - }); - return results; - } - - return filter; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/find.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/find.js deleted file mode 100644 index 586518d0..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/find.js +++ /dev/null @@ -1,12 +0,0 @@ -define(['./_isArrayLike', './findIndex', './findKey'], function (_isArrayLike, findIndex, findKey) { - - // Return the first value which passes a truth test. - function find(obj, predicate, context) { - var keyFinder = _isArrayLike(obj) ? findIndex : findKey; - var key = keyFinder(obj, predicate, context); - if (key !== void 0 && key !== -1) return obj[key]; - } - - return find; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/findIndex.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/findIndex.js deleted file mode 100644 index 90d4cf3f..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/findIndex.js +++ /dev/null @@ -1,8 +0,0 @@ -define(['./_createPredicateIndexFinder'], function (_createPredicateIndexFinder) { - - // Returns the first index on an array-like that passes a truth test. - var findIndex = _createPredicateIndexFinder(1); - - return findIndex; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/findKey.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/findKey.js deleted file mode 100644 index 80a5beb8..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/findKey.js +++ /dev/null @@ -1,15 +0,0 @@ -define(['./_cb', './keys'], function (_cb, keys) { - - // Returns the first key on an object that passes a truth test. - function findKey(obj, predicate, context) { - predicate = _cb(predicate, context); - var _keys = keys(obj), key; - for (var i = 0, length = _keys.length; i < length; i++) { - key = _keys[i]; - if (predicate(obj[key], key, obj)) return key; - } - } - - return findKey; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/findLastIndex.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/findLastIndex.js deleted file mode 100644 index f3e78a06..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/findLastIndex.js +++ /dev/null @@ -1,8 +0,0 @@ -define(['./_createPredicateIndexFinder'], function (_createPredicateIndexFinder) { - - // Returns the last index on an array-like that passes a truth test. - var findLastIndex = _createPredicateIndexFinder(-1); - - return findLastIndex; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/findWhere.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/findWhere.js deleted file mode 100644 index 40695859..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/findWhere.js +++ /dev/null @@ -1,11 +0,0 @@ -define(['./find', './matcher'], function (find, matcher) { - - // Convenience version of a common use case of `_.find`: getting the first - // object containing specific `key:value` pairs. - function findWhere(obj, attrs) { - return find(obj, matcher(attrs)); - } - - return findWhere; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/first.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/first.js deleted file mode 100644 index 96c5a56a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/first.js +++ /dev/null @@ -1,13 +0,0 @@ -define(['./initial'], function (initial) { - - // Get the first element of an array. Passing **n** will return the first N - // values in the array. The **guard** check allows it to work with `_.map`. - function first(array, n, guard) { - if (array == null || array.length < 1) return n == null || guard ? void 0 : []; - if (n == null || guard) return array[0]; - return initial(array, array.length - n); - } - - return first; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/flatten.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/flatten.js deleted file mode 100644 index 7d2891aa..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/flatten.js +++ /dev/null @@ -1,11 +0,0 @@ -define(['./_flatten'], function (_flatten) { - - // Flatten out an array, either recursively (by default), or up to `depth`. - // Passing `true` or `false` as `depth` means `1` or `Infinity`, respectively. - function flatten(array, depth) { - return _flatten(array, depth, false); - } - - return flatten; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/functions.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/functions.js deleted file mode 100644 index b929883b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/functions.js +++ /dev/null @@ -1,14 +0,0 @@ -define(['./isFunction'], function (isFunction) { - - // Return a sorted list of the function names available on the object. - function functions(obj) { - var names = []; - for (var key in obj) { - if (isFunction(obj[key])) names.push(key); - } - return names.sort(); - } - - return functions; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/get.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/get.js deleted file mode 100644 index 1404ea02..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/get.js +++ /dev/null @@ -1,14 +0,0 @@ -define(['./_toPath', './_deepGet', './isUndefined'], function (_toPath, _deepGet, isUndefined) { - - // Get the value of the (deep) property on `path` from `object`. - // If any property in `path` does not exist or if the value is - // `undefined`, return `defaultValue` instead. - // The `path` is normalized through `_.toPath`. - function get(object, path, defaultValue) { - var value = _deepGet(object, _toPath(path)); - return isUndefined(value) ? defaultValue : value; - } - - return get; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/groupBy.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/groupBy.js deleted file mode 100644 index 4374d768..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/groupBy.js +++ /dev/null @@ -1,11 +0,0 @@ -define(['./_group', './_has'], function (_group, _has) { - - // Groups the object's values by a criterion. Pass either a string attribute - // to group by, or a function that returns the criterion. - var groupBy = _group(function(result, value, key) { - if (_has(result, key)) result[key].push(value); else result[key] = [value]; - }); - - return groupBy; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/has.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/has.js deleted file mode 100644 index a81ec08f..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/has.js +++ /dev/null @@ -1,19 +0,0 @@ -define(['./_has', './_toPath'], function (_has, _toPath) { - - // Shortcut function for checking if an object has a given property directly on - // itself (in other words, not on a prototype). Unlike the internal `has` - // function, this public version can also traverse nested properties. - function has(obj, path) { - path = _toPath(path); - var length = path.length; - for (var i = 0; i < length; i++) { - var key = path[i]; - if (!_has(obj, key)) return false; - obj = obj[key]; - } - return !!length; - } - - return has; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/identity.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/identity.js deleted file mode 100644 index fee04583..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/identity.js +++ /dev/null @@ -1,10 +0,0 @@ -define(function () { - - // Keep the identity function around for default iteratees. - function identity(value) { - return value; - } - - return identity; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/index-default.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/index-default.js deleted file mode 100644 index 0f506052..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/index-default.js +++ /dev/null @@ -1,12 +0,0 @@ -define(['./index', './mixin'], function (index, mixin) { - - // Default Export - - // Add all of the Underscore functions to the wrapper object. - var _ = mixin(index); - // Legacy Node.js API. - _._ = _; - - return _; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/index.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/index.js deleted file mode 100644 index 14a7179e..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/index.js +++ /dev/null @@ -1,154 +0,0 @@ -define(['exports', './_setup', './restArguments', './isObject', './isNull', './isUndefined', './isBoolean', './isElement', './isString', './isNumber', './isDate', './isRegExp', './isError', './isSymbol', './isArrayBuffer', './isDataView', './isArray', './isFunction', './isArguments', './isFinite', './isNaN', './isTypedArray', './isEmpty', './isMatch', './isEqual', './isMap', './isWeakMap', './isSet', './isWeakSet', './keys', './allKeys', './values', './pairs', './invert', './functions', './extend', './extendOwn', './defaults', './create', './clone', './tap', './get', './has', './mapObject', './identity', './constant', './noop', './toPath', './property', './propertyOf', './matcher', './times', './random', './now', './escape', './unescape', './templateSettings', './template', './result', './uniqueId', './chain', './iteratee', './partial', './bind', './bindAll', './memoize', './delay', './defer', './throttle', './debounce', './wrap', './negate', './compose', './after', './before', './once', './findKey', './findIndex', './findLastIndex', './sortedIndex', './indexOf', './lastIndexOf', './find', './findWhere', './each', './map', './reduce', './reduceRight', './filter', './reject', './every', './some', './contains', './invoke', './pluck', './where', './max', './min', './shuffle', './sample', './sortBy', './groupBy', './indexBy', './countBy', './partition', './toArray', './size', './pick', './omit', './first', './initial', './last', './rest', './compact', './flatten', './without', './uniq', './union', './intersection', './difference', './unzip', './zip', './object', './range', './chunk', './mixin', './underscore-array-methods', './underscore'], function (exports, _setup, restArguments, isObject, isNull, isUndefined, isBoolean, isElement, isString, isNumber, isDate, isRegExp, isError, isSymbol, isArrayBuffer, isDataView, isArray, isFunction, isArguments, _isFinite, _isNaN, isTypedArray, isEmpty, isMatch, isEqual, isMap, isWeakMap, isSet, isWeakSet, keys, allKeys, values, pairs, invert, functions, extend, extendOwn, defaults, create, clone, tap, get, has, mapObject, identity, constant, noop, toPath, property, propertyOf, matcher, times, random, now, _escape, _unescape, templateSettings, template, result, uniqueId, chain, iteratee, partial, bind, bindAll, memoize, delay, defer, throttle, debounce, wrap, negate, compose, after, before, once, findKey, findIndex, findLastIndex, sortedIndex, indexOf, lastIndexOf, find, findWhere, each, map, reduce, reduceRight, filter, reject, every, some, contains, invoke, pluck, where, max, min, shuffle, sample, sortBy, groupBy, indexBy, countBy, partition, toArray, size, pick, omit, first, initial, last, rest, compact, flatten, without, uniq, union, intersection, difference, unzip, zip, object, range, chunk, mixin, underscoreArrayMethods, underscore) { - - // Named Exports - - exports.VERSION = _setup.VERSION; - exports.restArguments = restArguments; - exports.isObject = isObject; - exports.isNull = isNull; - exports.isUndefined = isUndefined; - exports.isBoolean = isBoolean; - exports.isElement = isElement; - exports.isString = isString; - exports.isNumber = isNumber; - exports.isDate = isDate; - exports.isRegExp = isRegExp; - exports.isError = isError; - exports.isSymbol = isSymbol; - exports.isArrayBuffer = isArrayBuffer; - exports.isDataView = isDataView; - exports.isArray = isArray; - exports.isFunction = isFunction; - exports.isArguments = isArguments; - exports.isFinite = _isFinite; - exports.isNaN = _isNaN; - exports.isTypedArray = isTypedArray; - exports.isEmpty = isEmpty; - exports.isMatch = isMatch; - exports.isEqual = isEqual; - exports.isMap = isMap; - exports.isWeakMap = isWeakMap; - exports.isSet = isSet; - exports.isWeakSet = isWeakSet; - exports.keys = keys; - exports.allKeys = allKeys; - exports.values = values; - exports.pairs = pairs; - exports.invert = invert; - exports.functions = functions; - exports.methods = functions; - exports.extend = extend; - exports.assign = extendOwn; - exports.extendOwn = extendOwn; - exports.defaults = defaults; - exports.create = create; - exports.clone = clone; - exports.tap = tap; - exports.get = get; - exports.has = has; - exports.mapObject = mapObject; - exports.identity = identity; - exports.constant = constant; - exports.noop = noop; - exports.toPath = toPath; - exports.property = property; - exports.propertyOf = propertyOf; - exports.matcher = matcher; - exports.matches = matcher; - exports.times = times; - exports.random = random; - exports.now = now; - exports.escape = _escape; - exports.unescape = _unescape; - exports.templateSettings = templateSettings; - exports.template = template; - exports.result = result; - exports.uniqueId = uniqueId; - exports.chain = chain; - exports.iteratee = iteratee; - exports.partial = partial; - exports.bind = bind; - exports.bindAll = bindAll; - exports.memoize = memoize; - exports.delay = delay; - exports.defer = defer; - exports.throttle = throttle; - exports.debounce = debounce; - exports.wrap = wrap; - exports.negate = negate; - exports.compose = compose; - exports.after = after; - exports.before = before; - exports.once = once; - exports.findKey = findKey; - exports.findIndex = findIndex; - exports.findLastIndex = findLastIndex; - exports.sortedIndex = sortedIndex; - exports.indexOf = indexOf; - exports.lastIndexOf = lastIndexOf; - exports.detect = find; - exports.find = find; - exports.findWhere = findWhere; - exports.each = each; - exports.forEach = each; - exports.collect = map; - exports.map = map; - exports.foldl = reduce; - exports.inject = reduce; - exports.reduce = reduce; - exports.foldr = reduceRight; - exports.reduceRight = reduceRight; - exports.filter = filter; - exports.select = filter; - exports.reject = reject; - exports.all = every; - exports.every = every; - exports.any = some; - exports.some = some; - exports.contains = contains; - exports.include = contains; - exports.includes = contains; - exports.invoke = invoke; - exports.pluck = pluck; - exports.where = where; - exports.max = max; - exports.min = min; - exports.shuffle = shuffle; - exports.sample = sample; - exports.sortBy = sortBy; - exports.groupBy = groupBy; - exports.indexBy = indexBy; - exports.countBy = countBy; - exports.partition = partition; - exports.toArray = toArray; - exports.size = size; - exports.pick = pick; - exports.omit = omit; - exports.first = first; - exports.head = first; - exports.take = first; - exports.initial = initial; - exports.last = last; - exports.drop = rest; - exports.rest = rest; - exports.tail = rest; - exports.compact = compact; - exports.flatten = flatten; - exports.without = without; - exports.uniq = uniq; - exports.unique = uniq; - exports.union = union; - exports.intersection = intersection; - exports.difference = difference; - exports.transpose = unzip; - exports.unzip = unzip; - exports.zip = zip; - exports.object = object; - exports.range = range; - exports.chunk = chunk; - exports.mixin = mixin; - exports.default = underscore; - - Object.defineProperty(exports, '__esModule', { value: true }); - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/indexBy.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/indexBy.js deleted file mode 100644 index dacc792a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/indexBy.js +++ /dev/null @@ -1,11 +0,0 @@ -define(['./_group'], function (_group) { - - // Indexes the object's values by a criterion, similar to `_.groupBy`, but for - // when you know that your index values will be unique. - var indexBy = _group(function(result, value, key) { - result[key] = value; - }); - - return indexBy; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/indexOf.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/indexOf.js deleted file mode 100644 index 108f201f..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/indexOf.js +++ /dev/null @@ -1,11 +0,0 @@ -define(['./sortedIndex', './findIndex', './_createIndexFinder'], function (sortedIndex, findIndex, _createIndexFinder) { - - // Return the position of the first occurrence of an item in an array, - // or -1 if the item is not included in the array. - // If the array is large and already in sort order, pass `true` - // for **isSorted** to use binary search. - var indexOf = _createIndexFinder(1, findIndex, sortedIndex); - - return indexOf; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/initial.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/initial.js deleted file mode 100644 index ca73c1a4..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/initial.js +++ /dev/null @@ -1,12 +0,0 @@ -define(['./_setup'], function (_setup) { - - // Returns everything but the last entry of the array. Especially useful on - // the arguments object. Passing **n** will return all the values in - // the array, excluding the last N. - function initial(array, n, guard) { - return _setup.slice.call(array, 0, Math.max(0, array.length - (n == null || guard ? 1 : n))); - } - - return initial; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/intersection.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/intersection.js deleted file mode 100644 index 8592d750..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/intersection.js +++ /dev/null @@ -1,22 +0,0 @@ -define(['./_getLength', './contains'], function (_getLength, contains) { - - // Produce an array that contains every item shared between all the - // passed-in arrays. - function intersection(array) { - var result = []; - var argsLength = arguments.length; - for (var i = 0, length = _getLength(array); i < length; i++) { - var item = array[i]; - if (contains(result, item)) continue; - var j; - for (j = 1; j < argsLength; j++) { - if (!contains(arguments[j], item)) break; - } - if (j === argsLength) result.push(item); - } - return result; - } - - return intersection; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/invert.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/invert.js deleted file mode 100644 index 446b8cb7..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/invert.js +++ /dev/null @@ -1,15 +0,0 @@ -define(['./keys'], function (keys) { - - // Invert the keys and values of an object. The values must be serializable. - function invert(obj) { - var result = {}; - var _keys = keys(obj); - for (var i = 0, length = _keys.length; i < length; i++) { - result[obj[_keys[i]]] = _keys[i]; - } - return result; - } - - return invert; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/invoke.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/invoke.js deleted file mode 100644 index 72684f46..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/invoke.js +++ /dev/null @@ -1,28 +0,0 @@ -define(['./restArguments', './isFunction', './map', './_deepGet', './_toPath'], function (restArguments, isFunction, map, _deepGet, _toPath) { - - // Invoke a method (with arguments) on every item in a collection. - var invoke = restArguments(function(obj, path, args) { - var contextPath, func; - if (isFunction(path)) { - func = path; - } else { - path = _toPath(path); - contextPath = path.slice(0, -1); - path = path[path.length - 1]; - } - return map(obj, function(context) { - var method = func; - if (!method) { - if (contextPath && contextPath.length) { - context = _deepGet(context, contextPath); - } - if (context == null) return void 0; - method = context[path]; - } - return method == null ? method : method.apply(context, args); - }); - }); - - return invoke; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/isArguments.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/isArguments.js deleted file mode 100644 index c4448f4d..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/isArguments.js +++ /dev/null @@ -1,19 +0,0 @@ -define(['./_tagTester', './_has'], function (_tagTester, _has) { - - var isArguments = _tagTester('Arguments'); - - // Define a fallback version of the method in browsers (ahem, IE < 9), where - // there isn't any inspectable "Arguments" type. - (function() { - if (!isArguments(arguments)) { - isArguments = function(obj) { - return _has(obj, 'callee'); - }; - } - }()); - - var isArguments$1 = isArguments; - - return isArguments$1; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/isArray.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/isArray.js deleted file mode 100644 index ef305850..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/isArray.js +++ /dev/null @@ -1,9 +0,0 @@ -define(['./_setup', './_tagTester'], function (_setup, _tagTester) { - - // Is a given value an array? - // Delegates to ECMA5's native `Array.isArray`. - var isArray = _setup.nativeIsArray || _tagTester('Array'); - - return isArray; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/isArrayBuffer.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/isArrayBuffer.js deleted file mode 100644 index e739aa89..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/isArrayBuffer.js +++ /dev/null @@ -1,7 +0,0 @@ -define(['./_tagTester'], function (_tagTester) { - - var isArrayBuffer = _tagTester('ArrayBuffer'); - - return isArrayBuffer; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/isBoolean.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/isBoolean.js deleted file mode 100644 index e3f1d8b1..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/isBoolean.js +++ /dev/null @@ -1,10 +0,0 @@ -define(['./_setup'], function (_setup) { - - // Is a given value a boolean? - function isBoolean(obj) { - return obj === true || obj === false || _setup.toString.call(obj) === '[object Boolean]'; - } - - return isBoolean; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/isDataView.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/isDataView.js deleted file mode 100644 index 3668b0aa..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/isDataView.js +++ /dev/null @@ -1,15 +0,0 @@ -define(['./_tagTester', './isFunction', './isArrayBuffer', './_stringTagBug'], function (_tagTester, isFunction, isArrayBuffer, _stringTagBug) { - - var isDataView = _tagTester('DataView'); - - // In IE 10 - Edge 13, we need a different heuristic - // to determine whether an object is a `DataView`. - function ie10IsDataView(obj) { - return obj != null && isFunction(obj.getInt8) && isArrayBuffer(obj.buffer); - } - - var isDataView$1 = (_stringTagBug.hasStringTagBug ? ie10IsDataView : isDataView); - - return isDataView$1; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/isDate.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/isDate.js deleted file mode 100644 index 8a84bcde..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/isDate.js +++ /dev/null @@ -1,7 +0,0 @@ -define(['./_tagTester'], function (_tagTester) { - - var isDate = _tagTester('Date'); - - return isDate; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/isElement.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/isElement.js deleted file mode 100644 index f1812e1e..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/isElement.js +++ /dev/null @@ -1,10 +0,0 @@ -define(function () { - - // Is a given value a DOM element? - function isElement(obj) { - return !!(obj && obj.nodeType === 1); - } - - return isElement; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/isEmpty.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/isEmpty.js deleted file mode 100644 index b0119161..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/isEmpty.js +++ /dev/null @@ -1,18 +0,0 @@ -define(['./_getLength', './isArray', './isString', './isArguments', './keys'], function (_getLength, isArray, isString, isArguments, keys) { - - // Is a given array, string, or object empty? - // An "empty" object has no enumerable own-properties. - function isEmpty(obj) { - if (obj == null) return true; - // Skip the more expensive `toString`-based type checks if `obj` has no - // `.length`. - var length = _getLength(obj); - if (typeof length == 'number' && ( - isArray(obj) || isString(obj) || isArguments(obj) - )) return length === 0; - return _getLength(keys(obj)) === 0; - } - - return isEmpty; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/isEqual.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/isEqual.js deleted file mode 100644 index 683c62ff..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/isEqual.js +++ /dev/null @@ -1,133 +0,0 @@ -define(['./underscore', './_setup', './_getByteLength', './isTypedArray', './isFunction', './_stringTagBug', './isDataView', './keys', './_has', './_toBufferView'], function (underscore, _setup, _getByteLength, isTypedArray, isFunction, _stringTagBug, isDataView, keys, _has, _toBufferView) { - - // We use this string twice, so give it a name for minification. - var tagDataView = '[object DataView]'; - - // Internal recursive comparison function for `_.isEqual`. - function eq(a, b, aStack, bStack) { - // Identical objects are equal. `0 === -0`, but they aren't identical. - // See the [Harmony `egal` proposal](https://wiki.ecmascript.org/doku.php?id=harmony:egal). - if (a === b) return a !== 0 || 1 / a === 1 / b; - // `null` or `undefined` only equal to itself (strict comparison). - if (a == null || b == null) return false; - // `NaN`s are equivalent, but non-reflexive. - if (a !== a) return b !== b; - // Exhaust primitive checks - var type = typeof a; - if (type !== 'function' && type !== 'object' && typeof b != 'object') return false; - return deepEq(a, b, aStack, bStack); - } - - // Internal recursive comparison function for `_.isEqual`. - function deepEq(a, b, aStack, bStack) { - // Unwrap any wrapped objects. - if (a instanceof underscore) a = a._wrapped; - if (b instanceof underscore) b = b._wrapped; - // Compare `[[Class]]` names. - var className = _setup.toString.call(a); - if (className !== _setup.toString.call(b)) return false; - // Work around a bug in IE 10 - Edge 13. - if (_stringTagBug.hasStringTagBug && className == '[object Object]' && isDataView(a)) { - if (!isDataView(b)) return false; - className = tagDataView; - } - switch (className) { - // These types are compared by value. - case '[object RegExp]': - // RegExps are coerced to strings for comparison (Note: '' + /a/i === '/a/i') - case '[object String]': - // Primitives and their corresponding object wrappers are equivalent; thus, `"5"` is - // equivalent to `new String("5")`. - return '' + a === '' + b; - case '[object Number]': - // `NaN`s are equivalent, but non-reflexive. - // Object(NaN) is equivalent to NaN. - if (+a !== +a) return +b !== +b; - // An `egal` comparison is performed for other numeric values. - return +a === 0 ? 1 / +a === 1 / b : +a === +b; - case '[object Date]': - case '[object Boolean]': - // Coerce dates and booleans to numeric primitive values. Dates are compared by their - // millisecond representations. Note that invalid dates with millisecond representations - // of `NaN` are not equivalent. - return +a === +b; - case '[object Symbol]': - return _setup.SymbolProto.valueOf.call(a) === _setup.SymbolProto.valueOf.call(b); - case '[object ArrayBuffer]': - case tagDataView: - // Coerce to typed array so we can fall through. - return deepEq(_toBufferView(a), _toBufferView(b), aStack, bStack); - } - - var areArrays = className === '[object Array]'; - if (!areArrays && isTypedArray(a)) { - var byteLength = _getByteLength(a); - if (byteLength !== _getByteLength(b)) return false; - if (a.buffer === b.buffer && a.byteOffset === b.byteOffset) return true; - areArrays = true; - } - if (!areArrays) { - if (typeof a != 'object' || typeof b != 'object') return false; - - // Objects with different constructors are not equivalent, but `Object`s or `Array`s - // from different frames are. - var aCtor = a.constructor, bCtor = b.constructor; - if (aCtor !== bCtor && !(isFunction(aCtor) && aCtor instanceof aCtor && - isFunction(bCtor) && bCtor instanceof bCtor) - && ('constructor' in a && 'constructor' in b)) { - return false; - } - } - // Assume equality for cyclic structures. The algorithm for detecting cyclic - // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`. - - // Initializing stack of traversed objects. - // It's done here since we only need them for objects and arrays comparison. - aStack = aStack || []; - bStack = bStack || []; - var length = aStack.length; - while (length--) { - // Linear search. Performance is inversely proportional to the number of - // unique nested structures. - if (aStack[length] === a) return bStack[length] === b; - } - - // Add the first object to the stack of traversed objects. - aStack.push(a); - bStack.push(b); - - // Recursively compare objects and arrays. - if (areArrays) { - // Compare array lengths to determine if a deep comparison is necessary. - length = a.length; - if (length !== b.length) return false; - // Deep compare the contents, ignoring non-numeric properties. - while (length--) { - if (!eq(a[length], b[length], aStack, bStack)) return false; - } - } else { - // Deep compare objects. - var _keys = keys(a), key; - length = _keys.length; - // Ensure that both objects contain the same number of properties before comparing deep equality. - if (keys(b).length !== length) return false; - while (length--) { - // Deep compare each member - key = _keys[length]; - if (!(_has(b, key) && eq(a[key], b[key], aStack, bStack))) return false; - } - } - // Remove the first object from the stack of traversed objects. - aStack.pop(); - bStack.pop(); - return true; - } - - // Perform a deep comparison to check if two objects are equal. - function isEqual(a, b) { - return eq(a, b); - } - - return isEqual; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/isError.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/isError.js deleted file mode 100644 index dd349a82..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/isError.js +++ /dev/null @@ -1,7 +0,0 @@ -define(['./_tagTester'], function (_tagTester) { - - var isError = _tagTester('Error'); - - return isError; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/isFinite.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/isFinite.js deleted file mode 100644 index b2a8d182..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/isFinite.js +++ /dev/null @@ -1,10 +0,0 @@ -define(['./_setup', './isSymbol'], function (_setup, isSymbol) { - - // Is a given object a finite number? - function isFinite(obj) { - return !isSymbol(obj) && _setup._isFinite(obj) && !isNaN(parseFloat(obj)); - } - - return isFinite; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/isFunction.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/isFunction.js deleted file mode 100644 index 4dabb909..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/isFunction.js +++ /dev/null @@ -1,18 +0,0 @@ -define(['./_tagTester', './_setup'], function (_tagTester, _setup) { - - var isFunction = _tagTester('Function'); - - // Optimize `isFunction` if appropriate. Work around some `typeof` bugs in old - // v8, IE 11 (#1621), Safari 8 (#1929), and PhantomJS (#2236). - var nodelist = _setup.root.document && _setup.root.document.childNodes; - if (typeof /./ != 'function' && typeof Int8Array != 'object' && typeof nodelist != 'function') { - isFunction = function(obj) { - return typeof obj == 'function' || false; - }; - } - - var isFunction$1 = isFunction; - - return isFunction$1; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/isMap.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/isMap.js deleted file mode 100644 index c3470b4e..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/isMap.js +++ /dev/null @@ -1,7 +0,0 @@ -define(['./_tagTester', './_stringTagBug', './_methodFingerprint'], function (_tagTester, _stringTagBug, _methodFingerprint) { - - var isMap = _stringTagBug.isIE11 ? _methodFingerprint.ie11fingerprint(_methodFingerprint.mapMethods) : _tagTester('Map'); - - return isMap; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/isMatch.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/isMatch.js deleted file mode 100644 index c3864783..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/isMatch.js +++ /dev/null @@ -1,17 +0,0 @@ -define(['./keys'], function (keys) { - - // Returns whether an object has a given set of `key:value` pairs. - function isMatch(object, attrs) { - var _keys = keys(attrs), length = _keys.length; - if (object == null) return !length; - var obj = Object(object); - for (var i = 0; i < length; i++) { - var key = _keys[i]; - if (attrs[key] !== obj[key] || !(key in obj)) return false; - } - return true; - } - - return isMatch; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/isNaN.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/isNaN.js deleted file mode 100644 index 01bf22de..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/isNaN.js +++ /dev/null @@ -1,10 +0,0 @@ -define(['./_setup', './isNumber'], function (_setup, isNumber) { - - // Is the given value `NaN`? - function isNaN(obj) { - return isNumber(obj) && _setup._isNaN(obj); - } - - return isNaN; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/isNull.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/isNull.js deleted file mode 100644 index c8b7bc60..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/isNull.js +++ /dev/null @@ -1,10 +0,0 @@ -define(function () { - - // Is a given value equal to null? - function isNull(obj) { - return obj === null; - } - - return isNull; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/isNumber.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/isNumber.js deleted file mode 100644 index a5d0152c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/isNumber.js +++ /dev/null @@ -1,7 +0,0 @@ -define(['./_tagTester'], function (_tagTester) { - - var isNumber = _tagTester('Number'); - - return isNumber; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/isObject.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/isObject.js deleted file mode 100644 index 9a244504..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/isObject.js +++ /dev/null @@ -1,11 +0,0 @@ -define(function () { - - // Is a given variable an object? - function isObject(obj) { - var type = typeof obj; - return type === 'function' || (type === 'object' && !!obj); - } - - return isObject; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/isRegExp.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/isRegExp.js deleted file mode 100644 index b1d5adeb..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/isRegExp.js +++ /dev/null @@ -1,7 +0,0 @@ -define(['./_tagTester'], function (_tagTester) { - - var isRegExp = _tagTester('RegExp'); - - return isRegExp; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/isSet.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/isSet.js deleted file mode 100644 index c04a5d80..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/isSet.js +++ /dev/null @@ -1,7 +0,0 @@ -define(['./_tagTester', './_stringTagBug', './_methodFingerprint'], function (_tagTester, _stringTagBug, _methodFingerprint) { - - var isSet = _stringTagBug.isIE11 ? _methodFingerprint.ie11fingerprint(_methodFingerprint.setMethods) : _tagTester('Set'); - - return isSet; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/isString.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/isString.js deleted file mode 100644 index dd8d9e2f..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/isString.js +++ /dev/null @@ -1,7 +0,0 @@ -define(['./_tagTester'], function (_tagTester) { - - var isString = _tagTester('String'); - - return isString; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/isSymbol.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/isSymbol.js deleted file mode 100644 index b2ebc620..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/isSymbol.js +++ /dev/null @@ -1,7 +0,0 @@ -define(['./_tagTester'], function (_tagTester) { - - var isSymbol = _tagTester('Symbol'); - - return isSymbol; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/isTypedArray.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/isTypedArray.js deleted file mode 100644 index db728f6e..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/isTypedArray.js +++ /dev/null @@ -1,16 +0,0 @@ -define(['./_setup', './isDataView', './constant', './_isBufferLike'], function (_setup, isDataView, constant, _isBufferLike) { - - // Is a given value a typed array? - var typedArrayPattern = /\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/; - function isTypedArray(obj) { - // `ArrayBuffer.isView` is the most future-proof, so use it when available. - // Otherwise, fall back on the above regular expression. - return _setup.nativeIsView ? (_setup.nativeIsView(obj) && !isDataView(obj)) : - _isBufferLike(obj) && typedArrayPattern.test(_setup.toString.call(obj)); - } - - var isTypedArray$1 = _setup.supportsArrayBuffer ? isTypedArray : constant(false); - - return isTypedArray$1; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/isUndefined.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/isUndefined.js deleted file mode 100644 index 2372b0cf..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/isUndefined.js +++ /dev/null @@ -1,10 +0,0 @@ -define(function () { - - // Is a given variable undefined? - function isUndefined(obj) { - return obj === void 0; - } - - return isUndefined; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/isWeakMap.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/isWeakMap.js deleted file mode 100644 index cf66b26c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/isWeakMap.js +++ /dev/null @@ -1,7 +0,0 @@ -define(['./_tagTester', './_stringTagBug', './_methodFingerprint'], function (_tagTester, _stringTagBug, _methodFingerprint) { - - var isWeakMap = _stringTagBug.isIE11 ? _methodFingerprint.ie11fingerprint(_methodFingerprint.weakMapMethods) : _tagTester('WeakMap'); - - return isWeakMap; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/isWeakSet.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/isWeakSet.js deleted file mode 100644 index a7258525..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/isWeakSet.js +++ /dev/null @@ -1,7 +0,0 @@ -define(['./_tagTester'], function (_tagTester) { - - var isWeakSet = _tagTester('WeakSet'); - - return isWeakSet; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/iteratee.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/iteratee.js deleted file mode 100644 index 52a1d6f7..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/iteratee.js +++ /dev/null @@ -1,13 +0,0 @@ -define(['./underscore', './_baseIteratee'], function (underscore, _baseIteratee) { - - // External wrapper for our callback generator. Users may customize - // `_.iteratee` if they want additional predicate/iteratee shorthand styles. - // This abstraction hides the internal-only `argCount` argument. - function iteratee(value, context) { - return _baseIteratee(value, context, Infinity); - } - underscore.iteratee = iteratee; - - return iteratee; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/keys.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/keys.js deleted file mode 100644 index 6db6bf4c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/keys.js +++ /dev/null @@ -1,17 +0,0 @@ -define(['./isObject', './_setup', './_has', './_collectNonEnumProps'], function (isObject, _setup, _has, _collectNonEnumProps) { - - // Retrieve the names of an object's own properties. - // Delegates to **ECMAScript 5**'s native `Object.keys`. - function keys(obj) { - if (!isObject(obj)) return []; - if (_setup.nativeKeys) return _setup.nativeKeys(obj); - var keys = []; - for (var key in obj) if (_has(obj, key)) keys.push(key); - // Ahem, IE < 9. - if (_setup.hasEnumBug) _collectNonEnumProps(obj, keys); - return keys; - } - - return keys; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/last.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/last.js deleted file mode 100644 index dfe3df2e..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/last.js +++ /dev/null @@ -1,13 +0,0 @@ -define(['./rest'], function (rest) { - - // Get the last element of an array. Passing **n** will return the last N - // values in the array. - function last(array, n, guard) { - if (array == null || array.length < 1) return n == null || guard ? void 0 : []; - if (n == null || guard) return array[array.length - 1]; - return rest(array, Math.max(0, array.length - n)); - } - - return last; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/lastIndexOf.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/lastIndexOf.js deleted file mode 100644 index da1c8b5b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/lastIndexOf.js +++ /dev/null @@ -1,9 +0,0 @@ -define(['./findLastIndex', './_createIndexFinder'], function (findLastIndex, _createIndexFinder) { - - // Return the position of the last occurrence of an item in an array, - // or -1 if the item is not included in the array. - var lastIndexOf = _createIndexFinder(-1, findLastIndex); - - return lastIndexOf; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/map.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/map.js deleted file mode 100644 index 0a045c09..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/map.js +++ /dev/null @@ -1,18 +0,0 @@ -define(['./_cb', './_isArrayLike', './keys'], function (_cb, _isArrayLike, keys) { - - // Return the results of applying the iteratee to each element. - function map(obj, iteratee, context) { - iteratee = _cb(iteratee, context); - var _keys = !_isArrayLike(obj) && keys(obj), - length = (_keys || obj).length, - results = Array(length); - for (var index = 0; index < length; index++) { - var currentKey = _keys ? _keys[index] : index; - results[index] = iteratee(obj[currentKey], currentKey, obj); - } - return results; - } - - return map; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/mapObject.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/mapObject.js deleted file mode 100644 index abf15a99..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/mapObject.js +++ /dev/null @@ -1,19 +0,0 @@ -define(['./_cb', './keys'], function (_cb, keys) { - - // Returns the results of applying the `iteratee` to each element of `obj`. - // In contrast to `_.map` it returns an object. - function mapObject(obj, iteratee, context) { - iteratee = _cb(iteratee, context); - var _keys = keys(obj), - length = _keys.length, - results = {}; - for (var index = 0; index < length; index++) { - var currentKey = _keys[index]; - results[currentKey] = iteratee(obj[currentKey], currentKey, obj); - } - return results; - } - - return mapObject; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/matcher.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/matcher.js deleted file mode 100644 index e5c85789..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/matcher.js +++ /dev/null @@ -1,14 +0,0 @@ -define(['./extendOwn', './isMatch'], function (extendOwn, isMatch) { - - // Returns a predicate for checking whether an object has a given set of - // `key:value` pairs. - function matcher(attrs) { - attrs = extendOwn({}, attrs); - return function(obj) { - return isMatch(obj, attrs); - }; - } - - return matcher; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/max.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/max.js deleted file mode 100644 index 5d566765..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/max.js +++ /dev/null @@ -1,30 +0,0 @@ -define(['./_isArrayLike', './values', './_cb', './each'], function (_isArrayLike, values, _cb, each) { - - // Return the maximum element (or element-based computation). - function max(obj, iteratee, context) { - var result = -Infinity, lastComputed = -Infinity, - value, computed; - if (iteratee == null || (typeof iteratee == 'number' && typeof obj[0] != 'object' && obj != null)) { - obj = _isArrayLike(obj) ? obj : values(obj); - for (var i = 0, length = obj.length; i < length; i++) { - value = obj[i]; - if (value != null && value > result) { - result = value; - } - } - } else { - iteratee = _cb(iteratee, context); - each(obj, function(v, index, list) { - computed = iteratee(v, index, list); - if (computed > lastComputed || (computed === -Infinity && result === -Infinity)) { - result = v; - lastComputed = computed; - } - }); - } - return result; - } - - return max; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/memoize.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/memoize.js deleted file mode 100644 index ae3d473a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/memoize.js +++ /dev/null @@ -1,17 +0,0 @@ -define(['./_has'], function (_has) { - - // Memoize an expensive function by storing its results. - function memoize(func, hasher) { - var memoize = function(key) { - var cache = memoize.cache; - var address = '' + (hasher ? hasher.apply(this, arguments) : key); - if (!_has(cache, address)) cache[address] = func.apply(this, arguments); - return cache[address]; - }; - memoize.cache = {}; - return memoize; - } - - return memoize; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/min.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/min.js deleted file mode 100644 index a298bdb3..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/min.js +++ /dev/null @@ -1,30 +0,0 @@ -define(['./_isArrayLike', './values', './_cb', './each'], function (_isArrayLike, values, _cb, each) { - - // Return the minimum element (or element-based computation). - function min(obj, iteratee, context) { - var result = Infinity, lastComputed = Infinity, - value, computed; - if (iteratee == null || (typeof iteratee == 'number' && typeof obj[0] != 'object' && obj != null)) { - obj = _isArrayLike(obj) ? obj : values(obj); - for (var i = 0, length = obj.length; i < length; i++) { - value = obj[i]; - if (value != null && value < result) { - result = value; - } - } - } else { - iteratee = _cb(iteratee, context); - each(obj, function(v, index, list) { - computed = iteratee(v, index, list); - if (computed < lastComputed || (computed === Infinity && result === Infinity)) { - result = v; - lastComputed = computed; - } - }); - } - return result; - } - - return min; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/mixin.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/mixin.js deleted file mode 100644 index a64604a6..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/mixin.js +++ /dev/null @@ -1,18 +0,0 @@ -define(['./underscore', './each', './functions', './_setup', './_chainResult'], function (underscore, each, functions, _setup, _chainResult) { - - // Add your own custom functions to the Underscore object. - function mixin(obj) { - each(functions(obj), function(name) { - var func = underscore[name] = obj[name]; - underscore.prototype[name] = function() { - var args = [this._wrapped]; - _setup.push.apply(args, arguments); - return _chainResult(this, func.apply(underscore, args)); - }; - }); - return underscore; - } - - return mixin; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/negate.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/negate.js deleted file mode 100644 index 420113d3..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/negate.js +++ /dev/null @@ -1,12 +0,0 @@ -define(function () { - - // Returns a negated version of the passed-in predicate. - function negate(predicate) { - return function() { - return !predicate.apply(this, arguments); - }; - } - - return negate; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/noop.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/noop.js deleted file mode 100644 index df96fc52..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/noop.js +++ /dev/null @@ -1,8 +0,0 @@ -define(function () { - - // Predicate-generating function. Often useful outside of Underscore. - function noop(){} - - return noop; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/now.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/now.js deleted file mode 100644 index a59807a5..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/now.js +++ /dev/null @@ -1,10 +0,0 @@ -define(function () { - - // A (possibly faster) way to get the current timestamp as an integer. - var now = Date.now || function() { - return new Date().getTime(); - }; - - return now; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/object.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/object.js deleted file mode 100644 index 02862521..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/object.js +++ /dev/null @@ -1,20 +0,0 @@ -define(['./_getLength'], function (_getLength) { - - // Converts lists into objects. Pass either a single array of `[key, value]` - // pairs, or two parallel arrays of the same length -- one of keys, and one of - // the corresponding values. Passing by pairs is the reverse of `_.pairs`. - function object(list, values) { - var result = {}; - for (var i = 0, length = _getLength(list); i < length; i++) { - if (values) { - result[list[i]] = values[i]; - } else { - result[list[i][0]] = list[i][1]; - } - } - return result; - } - - return object; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/omit.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/omit.js deleted file mode 100644 index 81d691cf..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/omit.js +++ /dev/null @@ -1,20 +0,0 @@ -define(['./restArguments', './isFunction', './negate', './map', './_flatten', './contains', './pick'], function (restArguments, isFunction, negate, map, _flatten, contains, pick) { - - // Return a copy of the object without the disallowed properties. - var omit = restArguments(function(obj, keys) { - var iteratee = keys[0], context; - if (isFunction(iteratee)) { - iteratee = negate(iteratee); - if (keys.length > 1) context = keys[1]; - } else { - keys = map(_flatten(keys, false, false), String); - iteratee = function(value, key) { - return !contains(keys, key); - }; - } - return pick(obj, iteratee, context); - }); - - return omit; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/once.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/once.js deleted file mode 100644 index 4fc1ddf2..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/once.js +++ /dev/null @@ -1,9 +0,0 @@ -define(['./partial', './before'], function (partial, before) { - - // Returns a function that will be executed at most one time, no matter how - // often you call it. Useful for lazy initialization. - var once = partial(before, 2); - - return once; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/pairs.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/pairs.js deleted file mode 100644 index 47576813..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/pairs.js +++ /dev/null @@ -1,17 +0,0 @@ -define(['./keys'], function (keys) { - - // Convert an object into a list of `[key, value]` pairs. - // The opposite of `_.object` with one argument. - function pairs(obj) { - var _keys = keys(obj); - var length = _keys.length; - var pairs = Array(length); - for (var i = 0; i < length; i++) { - pairs[i] = [_keys[i], obj[_keys[i]]]; - } - return pairs; - } - - return pairs; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/partial.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/partial.js deleted file mode 100644 index 64f95dfa..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/partial.js +++ /dev/null @@ -1,25 +0,0 @@ -define(['./restArguments', './_executeBound', './underscore'], function (restArguments, _executeBound, underscore) { - - // Partially apply a function by creating a version that has had some of its - // arguments pre-filled, without changing its dynamic `this` context. `_` acts - // as a placeholder by default, allowing any combination of arguments to be - // pre-filled. Set `_.partial.placeholder` for a custom placeholder argument. - var partial = restArguments(function(func, boundArgs) { - var placeholder = partial.placeholder; - var bound = function() { - var position = 0, length = boundArgs.length; - var args = Array(length); - for (var i = 0; i < length; i++) { - args[i] = boundArgs[i] === placeholder ? arguments[position++] : boundArgs[i]; - } - while (position < arguments.length) args.push(arguments[position++]); - return _executeBound(func, bound, this, this, args); - }; - return bound; - }); - - partial.placeholder = underscore; - - return partial; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/partition.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/partition.js deleted file mode 100644 index a87e5fb9..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/partition.js +++ /dev/null @@ -1,11 +0,0 @@ -define(['./_group'], function (_group) { - - // Split a collection into two arrays: one whose elements all pass the given - // truth test, and one whose elements all do not pass the truth test. - var partition = _group(function(result, value, pass) { - result[pass ? 0 : 1].push(value); - }, true); - - return partition; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/pick.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/pick.js deleted file mode 100644 index 1d4d89a2..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/pick.js +++ /dev/null @@ -1,25 +0,0 @@ -define(['./restArguments', './isFunction', './_optimizeCb', './allKeys', './_keyInObj', './_flatten'], function (restArguments, isFunction, _optimizeCb, allKeys, _keyInObj, _flatten) { - - // Return a copy of the object only containing the allowed properties. - var pick = restArguments(function(obj, keys) { - var result = {}, iteratee = keys[0]; - if (obj == null) return result; - if (isFunction(iteratee)) { - if (keys.length > 1) iteratee = _optimizeCb(iteratee, keys[1]); - keys = allKeys(obj); - } else { - iteratee = _keyInObj; - keys = _flatten(keys, false, false); - obj = Object(obj); - } - for (var i = 0, length = keys.length; i < length; i++) { - var key = keys[i]; - var value = obj[key]; - if (iteratee(value, key, obj)) result[key] = value; - } - return result; - }); - - return pick; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/pluck.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/pluck.js deleted file mode 100644 index d93d80c2..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/pluck.js +++ /dev/null @@ -1,10 +0,0 @@ -define(['./map', './property'], function (map, property) { - - // Convenience version of a common use case of `_.map`: fetching a property. - function pluck(obj, key) { - return map(obj, property(key)); - } - - return pluck; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/property.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/property.js deleted file mode 100644 index 94c6ccca..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/property.js +++ /dev/null @@ -1,14 +0,0 @@ -define(['./_deepGet', './_toPath'], function (_deepGet, _toPath) { - - // Creates a function that, when passed an object, will traverse that object’s - // properties down the given `path`, specified as an array of keys or indices. - function property(path) { - path = _toPath(path); - return function(obj) { - return _deepGet(obj, path); - }; - } - - return property; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/propertyOf.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/propertyOf.js deleted file mode 100644 index 13cfb750..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/propertyOf.js +++ /dev/null @@ -1,13 +0,0 @@ -define(['./noop', './get'], function (noop, get) { - - // Generates a function for a given object that returns a given property. - function propertyOf(obj) { - if (obj == null) return noop; - return function(path) { - return get(obj, path); - }; - } - - return propertyOf; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/random.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/random.js deleted file mode 100644 index ba82815c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/random.js +++ /dev/null @@ -1,14 +0,0 @@ -define(function () { - - // Return a random integer between `min` and `max` (inclusive). - function random(min, max) { - if (max == null) { - max = min; - min = 0; - } - return min + Math.floor(Math.random() * (max - min + 1)); - } - - return random; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/range.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/range.js deleted file mode 100644 index 47eb9edc..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/range.js +++ /dev/null @@ -1,27 +0,0 @@ -define(function () { - - // Generate an integer Array containing an arithmetic progression. A port of - // the native Python `range()` function. See - // [the Python documentation](https://docs.python.org/library/functions.html#range). - function range(start, stop, step) { - if (stop == null) { - stop = start || 0; - start = 0; - } - if (!step) { - step = stop < start ? -1 : 1; - } - - var length = Math.max(Math.ceil((stop - start) / step), 0); - var range = Array(length); - - for (var idx = 0; idx < length; idx++, start += step) { - range[idx] = start; - } - - return range; - } - - return range; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/reduce.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/reduce.js deleted file mode 100644 index 2aae8cae..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/reduce.js +++ /dev/null @@ -1,9 +0,0 @@ -define(['./_createReduce'], function (_createReduce) { - - // **Reduce** builds up a single result from a list of values, aka `inject`, - // or `foldl`. - var reduce = _createReduce(1); - - return reduce; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/reduceRight.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/reduceRight.js deleted file mode 100644 index ccb17392..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/reduceRight.js +++ /dev/null @@ -1,8 +0,0 @@ -define(['./_createReduce'], function (_createReduce) { - - // The right-associative version of reduce, also known as `foldr`. - var reduceRight = _createReduce(-1); - - return reduceRight; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/reject.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/reject.js deleted file mode 100644 index acc91cf4..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/reject.js +++ /dev/null @@ -1,10 +0,0 @@ -define(['./filter', './negate', './_cb'], function (filter, negate, _cb) { - - // Return all the elements for which a truth test fails. - function reject(obj, predicate, context) { - return filter(obj, negate(_cb(predicate)), context); - } - - return reject; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/rest.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/rest.js deleted file mode 100644 index ecf6b74a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/rest.js +++ /dev/null @@ -1,12 +0,0 @@ -define(['./_setup'], function (_setup) { - - // Returns everything but the first entry of the `array`. Especially useful on - // the `arguments` object. Passing an **n** will return the rest N values in the - // `array`. - function rest(array, n, guard) { - return _setup.slice.call(array, n == null || guard ? 1 : n); - } - - return rest; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/restArguments.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/restArguments.js deleted file mode 100644 index dd712748..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/restArguments.js +++ /dev/null @@ -1,33 +0,0 @@ -define(function () { - - // Some functions take a variable number of arguments, or a few expected - // arguments at the beginning and then a variable number of values to operate - // on. This helper accumulates all remaining arguments past the function’s - // argument length (or an explicit `startIndex`), into an array that becomes - // the last argument. Similar to ES6’s "rest parameter". - function restArguments(func, startIndex) { - startIndex = startIndex == null ? func.length - 1 : +startIndex; - return function() { - var length = Math.max(arguments.length - startIndex, 0), - rest = Array(length), - index = 0; - for (; index < length; index++) { - rest[index] = arguments[index + startIndex]; - } - switch (startIndex) { - case 0: return func.call(this, rest); - case 1: return func.call(this, arguments[0], rest); - case 2: return func.call(this, arguments[0], arguments[1], rest); - } - var args = Array(startIndex + 1); - for (index = 0; index < startIndex; index++) { - args[index] = arguments[index]; - } - args[startIndex] = rest; - return func.apply(this, args); - }; - } - - return restArguments; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/result.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/result.js deleted file mode 100644 index 093a9113..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/result.js +++ /dev/null @@ -1,25 +0,0 @@ -define(['./isFunction', './_toPath'], function (isFunction, _toPath) { - - // Traverses the children of `obj` along `path`. If a child is a function, it - // is invoked with its parent as context. Returns the value of the final - // child, or `fallback` if any child is undefined. - function result(obj, path, fallback) { - path = _toPath(path); - var length = path.length; - if (!length) { - return isFunction(fallback) ? fallback.call(obj) : fallback; - } - for (var i = 0; i < length; i++) { - var prop = obj == null ? void 0 : obj[path[i]]; - if (prop === void 0) { - prop = fallback; - i = length; // Ensure we don't continue iterating. - } - obj = isFunction(prop) ? prop.call(obj) : prop; - } - return obj; - } - - return result; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/sample.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/sample.js deleted file mode 100644 index 0189bb58..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/sample.js +++ /dev/null @@ -1,27 +0,0 @@ -define(['./_isArrayLike', './values', './_getLength', './random', './toArray'], function (_isArrayLike, values, _getLength, random, toArray) { - - // Sample **n** random values from a collection using the modern version of the - // [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher–Yates_shuffle). - // If **n** is not specified, returns a single random element. - // The internal `guard` argument allows it to work with `_.map`. - function sample(obj, n, guard) { - if (n == null || guard) { - if (!_isArrayLike(obj)) obj = values(obj); - return obj[random(obj.length - 1)]; - } - var sample = toArray(obj); - var length = _getLength(sample); - n = Math.max(Math.min(n, length), 0); - var last = length - 1; - for (var index = 0; index < n; index++) { - var rand = random(index, last); - var temp = sample[index]; - sample[index] = sample[rand]; - sample[rand] = temp; - } - return sample.slice(0, n); - } - - return sample; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/set.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/set.js deleted file mode 100644 index 2c278c32..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/set.js +++ /dev/null @@ -1,15 +0,0 @@ -define(['./isArray', './isObject', './_set'], function (isArray, isObject, _set) { - - // set the value in given path - function set (obj, path, value) { - if (!isObject(obj) || !isArray(path)) return obj; - if (path.length === 0) return obj; - - _set(obj, path, value); - - return obj; - } - - return set; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/shuffle.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/shuffle.js deleted file mode 100644 index ff14021b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/shuffle.js +++ /dev/null @@ -1,10 +0,0 @@ -define(['./sample'], function (sample) { - - // Shuffle a collection. - function shuffle(obj) { - return sample(obj, Infinity); - } - - return shuffle; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/size.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/size.js deleted file mode 100644 index b741f4e0..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/size.js +++ /dev/null @@ -1,11 +0,0 @@ -define(['./_isArrayLike', './keys'], function (_isArrayLike, keys) { - - // Return the number of elements in a collection. - function size(obj) { - if (obj == null) return 0; - return _isArrayLike(obj) ? obj.length : keys(obj).length; - } - - return size; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/some.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/some.js deleted file mode 100644 index bb4e966a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/some.js +++ /dev/null @@ -1,17 +0,0 @@ -define(['./_cb', './_isArrayLike', './keys'], function (_cb, _isArrayLike, keys) { - - // Determine if at least one element in the object passes a truth test. - function some(obj, predicate, context) { - predicate = _cb(predicate, context); - var _keys = !_isArrayLike(obj) && keys(obj), - length = (_keys || obj).length; - for (var index = 0; index < length; index++) { - var currentKey = _keys ? _keys[index] : index; - if (predicate(obj[currentKey], currentKey, obj)) return true; - } - return false; - } - - return some; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/sortBy.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/sortBy.js deleted file mode 100644 index a4af6cb0..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/sortBy.js +++ /dev/null @@ -1,26 +0,0 @@ -define(['./_cb', './pluck', './map'], function (_cb, pluck, map) { - - // Sort the object's values by a criterion produced by an iteratee. - function sortBy(obj, iteratee, context) { - var index = 0; - iteratee = _cb(iteratee, context); - return pluck(map(obj, function(value, key, list) { - return { - value: value, - index: index++, - criteria: iteratee(value, key, list) - }; - }).sort(function(left, right) { - var a = left.criteria; - var b = right.criteria; - if (a !== b) { - if (a > b || a === void 0) return 1; - if (a < b || b === void 0) return -1; - } - return left.index - right.index; - }), 'value'); - } - - return sortBy; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/sortedIndex.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/sortedIndex.js deleted file mode 100644 index 83aac9ec..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/sortedIndex.js +++ /dev/null @@ -1,18 +0,0 @@ -define(['./_cb', './_getLength'], function (_cb, _getLength) { - - // Use a comparator function to figure out the smallest index at which - // an object should be inserted so as to maintain order. Uses binary search. - function sortedIndex(array, obj, iteratee, context) { - iteratee = _cb(iteratee, context, 1); - var value = iteratee(obj); - var low = 0, high = _getLength(array); - while (low < high) { - var mid = Math.floor((low + high) / 2); - if (iteratee(array[mid]) < value) low = mid + 1; else high = mid; - } - return low; - } - - return sortedIndex; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/tap.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/tap.js deleted file mode 100644 index 8605d102..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/tap.js +++ /dev/null @@ -1,13 +0,0 @@ -define(function () { - - // Invokes `interceptor` with the `obj` and then returns `obj`. - // The primary purpose of this method is to "tap into" a method chain, in - // order to perform operations on intermediate results within the chain. - function tap(obj, interceptor) { - interceptor(obj); - return obj; - } - - return tap; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/template.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/template.js deleted file mode 100644 index 65695ba5..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/template.js +++ /dev/null @@ -1,103 +0,0 @@ -define(['./defaults', './underscore', './templateSettings'], function (defaults, underscore, templateSettings) { - - // When customizing `_.templateSettings`, if you don't want to define an - // interpolation, evaluation or escaping regex, we need one that is - // guaranteed not to match. - var noMatch = /(.)^/; - - // Certain characters need to be escaped so that they can be put into a - // string literal. - var escapes = { - "'": "'", - '\\': '\\', - '\r': 'r', - '\n': 'n', - '\u2028': 'u2028', - '\u2029': 'u2029' - }; - - var escapeRegExp = /\\|'|\r|\n|\u2028|\u2029/g; - - function escapeChar(match) { - return '\\' + escapes[match]; - } - - // In order to prevent third-party code injection through - // `_.templateSettings.variable`, we test it against the following regular - // expression. It is intentionally a bit more liberal than just matching valid - // identifiers, but still prevents possible loopholes through defaults or - // destructuring assignment. - var bareIdentifier = /^\s*(\w|\$)+\s*$/; - - // JavaScript micro-templating, similar to John Resig's implementation. - // Underscore templating handles arbitrary delimiters, preserves whitespace, - // and correctly escapes quotes within interpolated code. - // NB: `oldSettings` only exists for backwards compatibility. - function template(text, settings, oldSettings) { - if (!settings && oldSettings) settings = oldSettings; - settings = defaults({}, settings, underscore.templateSettings); - - // Combine delimiters into one regular expression via alternation. - var matcher = RegExp([ - (settings.escape || noMatch).source, - (settings.interpolate || noMatch).source, - (settings.evaluate || noMatch).source - ].join('|') + '|$', 'g'); - - // Compile the template source, escaping string literals appropriately. - var index = 0; - var source = "__p+='"; - text.replace(matcher, function(match, escape, interpolate, evaluate, offset) { - source += text.slice(index, offset).replace(escapeRegExp, escapeChar); - index = offset + match.length; - - if (escape) { - source += "'+\n((__t=(" + escape + "))==null?'':_.escape(__t))+\n'"; - } else if (interpolate) { - source += "'+\n((__t=(" + interpolate + "))==null?'':__t)+\n'"; - } else if (evaluate) { - source += "';\n" + evaluate + "\n__p+='"; - } - - // Adobe VMs need the match returned to produce the correct offset. - return match; - }); - source += "';\n"; - - var argument = settings.variable; - if (argument) { - // Insure against third-party code injection. (CVE-2021-23358) - if (!bareIdentifier.test(argument)) throw new Error( - 'variable is not a bare identifier: ' + argument - ); - } else { - // If a variable is not specified, place data values in local scope. - source = 'with(obj||{}){\n' + source + '}\n'; - argument = 'obj'; - } - - source = "var __t,__p='',__j=Array.prototype.join," + - "print=function(){__p+=__j.call(arguments,'');};\n" + - source + 'return __p;\n'; - - var render; - try { - render = new Function(argument, '_', source); - } catch (e) { - e.source = source; - throw e; - } - - var template = function(data) { - return render.call(this, data, underscore); - }; - - // Provide the compiled source as a convenience for precompilation. - template.source = 'function(' + argument + '){\n' + source + '}'; - - return template; - } - - return template; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/templateSettings.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/templateSettings.js deleted file mode 100644 index 94abcb53..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/templateSettings.js +++ /dev/null @@ -1,13 +0,0 @@ -define(['./underscore'], function (underscore) { - - // By default, Underscore uses ERB-style template delimiters. Change the - // following template settings to use alternative delimiters. - var templateSettings = underscore.templateSettings = { - evaluate: /<%([\s\S]+?)%>/g, - interpolate: /<%=([\s\S]+?)%>/g, - escape: /<%-([\s\S]+?)%>/g - }; - - return templateSettings; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/throttle.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/throttle.js deleted file mode 100644 index 555100ab..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/throttle.js +++ /dev/null @@ -1,51 +0,0 @@ -define(['./now'], function (now) { - - // Returns a function, that, when invoked, will only be triggered at most once - // during a given window of time. Normally, the throttled function will run - // as much as it can, without ever going more than once per `wait` duration; - // but if you'd like to disable the execution on the leading edge, pass - // `{leading: false}`. To disable execution on the trailing edge, ditto. - function throttle(func, wait, options) { - var timeout, context, args, result; - var previous = 0; - if (!options) options = {}; - - var later = function() { - previous = options.leading === false ? 0 : now(); - timeout = null; - result = func.apply(context, args); - if (!timeout) context = args = null; - }; - - var throttled = function() { - var _now = now(); - if (!previous && options.leading === false) previous = _now; - var remaining = wait - (_now - previous); - context = this; - args = arguments; - if (remaining <= 0 || remaining > wait) { - if (timeout) { - clearTimeout(timeout); - timeout = null; - } - previous = _now; - result = func.apply(context, args); - if (!timeout) context = args = null; - } else if (!timeout && options.trailing !== false) { - timeout = setTimeout(later, remaining); - } - return result; - }; - - throttled.cancel = function() { - clearTimeout(timeout); - previous = 0; - timeout = context = args = null; - }; - - return throttled; - } - - return throttle; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/times.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/times.js deleted file mode 100644 index d70145d3..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/times.js +++ /dev/null @@ -1,13 +0,0 @@ -define(['./_optimizeCb'], function (_optimizeCb) { - - // Run a function **n** times. - function times(n, iteratee, context) { - var accum = Array(Math.max(0, n)); - iteratee = _optimizeCb(iteratee, context, 1); - for (var i = 0; i < n; i++) accum[i] = iteratee(i); - return accum; - } - - return times; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/toArray.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/toArray.js deleted file mode 100644 index 27b41699..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/toArray.js +++ /dev/null @@ -1,18 +0,0 @@ -define(['./isArray', './_setup', './isString', './_isArrayLike', './map', './identity', './values'], function (isArray, _setup, isString, _isArrayLike, map, identity, values) { - - // Safely create a real, live array from anything iterable. - var reStrSymbol = /[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g; - function toArray(obj) { - if (!obj) return []; - if (isArray(obj)) return _setup.slice.call(obj); - if (isString(obj)) { - // Keep surrogate pair characters together. - return obj.match(reStrSymbol); - } - if (_isArrayLike(obj)) return map(obj, identity); - return values(obj); - } - - return toArray; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/toPath.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/toPath.js deleted file mode 100644 index e2dfb23a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/toPath.js +++ /dev/null @@ -1,12 +0,0 @@ -define(['./underscore', './isArray'], function (underscore, isArray) { - - // Normalize a (deep) property `path` to array. - // Like `_.iteratee`, this function can be customized. - function toPath(path) { - return isArray(path) ? path : [path]; - } - underscore.toPath = toPath; - - return toPath; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/underscore-array-methods.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/underscore-array-methods.js deleted file mode 100644 index bb56875f..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/underscore-array-methods.js +++ /dev/null @@ -1,30 +0,0 @@ -define(['./underscore', './each', './_setup', './_chainResult'], function (underscore, each, _setup, _chainResult) { - - // Add all mutator `Array` functions to the wrapper. - each(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(name) { - var method = _setup.ArrayProto[name]; - underscore.prototype[name] = function() { - var obj = this._wrapped; - if (obj != null) { - method.apply(obj, arguments); - if ((name === 'shift' || name === 'splice') && obj.length === 0) { - delete obj[0]; - } - } - return _chainResult(this, obj); - }; - }); - - // Add all accessor `Array` functions to the wrapper. - each(['concat', 'join', 'slice'], function(name) { - var method = _setup.ArrayProto[name]; - underscore.prototype[name] = function() { - var obj = this._wrapped; - if (obj != null) obj = method.apply(obj, arguments); - return _chainResult(this, obj); - }; - }); - - return underscore; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/underscore.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/underscore.js deleted file mode 100644 index 03492abf..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/underscore.js +++ /dev/null @@ -1,29 +0,0 @@ -define(['./_setup'], function (_setup) { - - // If Underscore is called as a function, it returns a wrapped object that can - // be used OO-style. This wrapper holds altered versions of all functions added - // through `_.mixin`. Wrapped objects may be chained. - function _(obj) { - if (obj instanceof _) return obj; - if (!(this instanceof _)) return new _(obj); - this._wrapped = obj; - } - - _.VERSION = _setup.VERSION; - - // Extracts the result from a wrapped and chained object. - _.prototype.value = function() { - return this._wrapped; - }; - - // Provide unwrapping proxies for some methods used in engine operations - // such as arithmetic and JSON stringification. - _.prototype.valueOf = _.prototype.toJSON = _.prototype.value; - - _.prototype.toString = function() { - return String(this._wrapped); - }; - - return _; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/unescape.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/unescape.js deleted file mode 100644 index b48d4447..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/unescape.js +++ /dev/null @@ -1,8 +0,0 @@ -define(['./_createEscaper', './_unescapeMap'], function (_createEscaper, _unescapeMap) { - - // Function for unescaping strings from HTML interpolation. - var _unescape = _createEscaper(_unescapeMap); - - return _unescape; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/union.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/union.js deleted file mode 100644 index 67884bad..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/union.js +++ /dev/null @@ -1,11 +0,0 @@ -define(['./restArguments', './uniq', './_flatten'], function (restArguments, uniq, _flatten) { - - // Produce an array that contains the union: each distinct element from all of - // the passed-in arrays. - var union = restArguments(function(arrays) { - return uniq(_flatten(arrays, true, true)); - }); - - return union; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/uniq.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/uniq.js deleted file mode 100644 index 5e05e41b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/uniq.js +++ /dev/null @@ -1,37 +0,0 @@ -define(['./isBoolean', './_cb', './_getLength', './contains'], function (isBoolean, _cb, _getLength, contains) { - - // Produce a duplicate-free version of the array. If the array has already - // been sorted, you have the option of using a faster algorithm. - // The faster algorithm will not work with an iteratee if the iteratee - // is not a one-to-one function, so providing an iteratee will disable - // the faster algorithm. - function uniq(array, isSorted, iteratee, context) { - if (!isBoolean(isSorted)) { - context = iteratee; - iteratee = isSorted; - isSorted = false; - } - if (iteratee != null) iteratee = _cb(iteratee, context); - var result = []; - var seen = []; - for (var i = 0, length = _getLength(array); i < length; i++) { - var value = array[i], - computed = iteratee ? iteratee(value, i, array) : value; - if (isSorted && !iteratee) { - if (!i || seen !== computed) result.push(value); - seen = computed; - } else if (iteratee) { - if (!contains(seen, computed)) { - seen.push(computed); - result.push(value); - } - } else if (!contains(result, value)) { - result.push(value); - } - } - return result; - } - - return uniq; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/uniqueId.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/uniqueId.js deleted file mode 100644 index 4c99d645..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/uniqueId.js +++ /dev/null @@ -1,13 +0,0 @@ -define(function () { - - // Generate a unique integer id (unique within the entire client session). - // Useful for temporary DOM ids. - var idCounter = 0; - function uniqueId(prefix) { - var id = ++idCounter + ''; - return prefix ? prefix + id : id; - } - - return uniqueId; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/unzip.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/unzip.js deleted file mode 100644 index 28232232..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/unzip.js +++ /dev/null @@ -1,17 +0,0 @@ -define(['./max', './_getLength', './pluck'], function (max, _getLength, pluck) { - - // Complement of zip. Unzip accepts an array of arrays and groups - // each array's elements on shared indices. - function unzip(array) { - var length = (array && max(array, _getLength).length) || 0; - var result = Array(length); - - for (var index = 0; index < length; index++) { - result[index] = pluck(array, index); - } - return result; - } - - return unzip; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/values.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/values.js deleted file mode 100644 index f42830ab..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/values.js +++ /dev/null @@ -1,16 +0,0 @@ -define(['./keys'], function (keys) { - - // Retrieve the values of an object's properties. - function values(obj) { - var _keys = keys(obj); - var length = _keys.length; - var values = Array(length); - for (var i = 0; i < length; i++) { - values[i] = obj[_keys[i]]; - } - return values; - } - - return values; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/where.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/where.js deleted file mode 100644 index a9d8b253..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/where.js +++ /dev/null @@ -1,11 +0,0 @@ -define(['./filter', './matcher'], function (filter, matcher) { - - // Convenience version of a common use case of `_.filter`: selecting only - // objects containing specific `key:value` pairs. - function where(obj, attrs) { - return filter(obj, matcher(attrs)); - } - - return where; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/without.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/without.js deleted file mode 100644 index eb0ac62e..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/without.js +++ /dev/null @@ -1,10 +0,0 @@ -define(['./restArguments', './difference'], function (restArguments, difference) { - - // Return a version of the array that does not contain the specified value(s). - var without = restArguments(function(array, otherArrays) { - return difference(array, otherArrays); - }); - - return without; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/wrap.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/wrap.js deleted file mode 100644 index 25f19952..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/wrap.js +++ /dev/null @@ -1,12 +0,0 @@ -define(['./partial'], function (partial) { - - // Returns the first function passed as an argument to the second, - // allowing you to adjust arguments, run code before and after, and - // conditionally execute the original function. - function wrap(func, wrapper) { - return partial(wrapper, func); - } - - return wrap; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/zip.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/zip.js deleted file mode 100644 index 25e61fe3..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/amd/zip.js +++ /dev/null @@ -1,9 +0,0 @@ -define(['./restArguments', './unzip'], function (restArguments, unzip) { - - // Zip together multiple lists into a single array -- elements that share - // an index go together. - var zip = restArguments(unzip); - - return zip; - -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/_baseCreate.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/_baseCreate.js deleted file mode 100644 index aacc4f47..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/_baseCreate.js +++ /dev/null @@ -1,20 +0,0 @@ -var isObject = require('./isObject.js'); -var _setup = require('./_setup.js'); - -// Create a naked function reference for surrogate-prototype-swapping. -function ctor() { - return function(){}; -} - -// An internal function for creating a new object that inherits from another. -function baseCreate(prototype) { - if (!isObject(prototype)) return {}; - if (_setup.nativeCreate) return _setup.nativeCreate(prototype); - var Ctor = ctor(); - Ctor.prototype = prototype; - var result = new Ctor; - Ctor.prototype = null; - return result; -} - -module.exports = baseCreate; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/_baseIteratee.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/_baseIteratee.js deleted file mode 100644 index a826d1a2..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/_baseIteratee.js +++ /dev/null @@ -1,19 +0,0 @@ -var identity = require('./identity.js'); -var isFunction = require('./isFunction.js'); -var isObject = require('./isObject.js'); -var isArray = require('./isArray.js'); -var matcher = require('./matcher.js'); -var property = require('./property.js'); -var _optimizeCb = require('./_optimizeCb.js'); - -// An internal function to generate callbacks that can be applied to each -// element in a collection, returning the desired result — either `_.identity`, -// an arbitrary callback, a property matcher, or a property accessor. -function baseIteratee(value, context, argCount) { - if (value == null) return identity; - if (isFunction(value)) return _optimizeCb(value, context, argCount); - if (isObject(value) && !isArray(value)) return matcher(value); - return property(value); -} - -module.exports = baseIteratee; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/_cb.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/_cb.js deleted file mode 100644 index 8b5d3898..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/_cb.js +++ /dev/null @@ -1,12 +0,0 @@ -var underscore = require('./underscore.js'); -var _baseIteratee = require('./_baseIteratee.js'); -var iteratee = require('./iteratee.js'); - -// The function we call internally to generate a callback. It invokes -// `_.iteratee` if overridden, otherwise `baseIteratee`. -function cb(value, context, argCount) { - if (underscore.iteratee !== iteratee) return underscore.iteratee(value, context); - return _baseIteratee(value, context, argCount); -} - -module.exports = cb; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/_chainResult.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/_chainResult.js deleted file mode 100644 index 8670e3d8..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/_chainResult.js +++ /dev/null @@ -1,8 +0,0 @@ -var underscore = require('./underscore.js'); - -// Helper function to continue chaining intermediate results. -function chainResult(instance, obj) { - return instance._chain ? underscore(obj).chain() : obj; -} - -module.exports = chainResult; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/_collectNonEnumProps.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/_collectNonEnumProps.js deleted file mode 100644 index 6e62c916..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/_collectNonEnumProps.js +++ /dev/null @@ -1,42 +0,0 @@ -var _setup = require('./_setup.js'); -var isFunction = require('./isFunction.js'); -var _has = require('./_has.js'); - -// Internal helper to create a simple lookup structure. -// `collectNonEnumProps` used to depend on `_.contains`, but this led to -// circular imports. `emulatedSet` is a one-off solution that only works for -// arrays of strings. -function emulatedSet(keys) { - var hash = {}; - for (var l = keys.length, i = 0; i < l; ++i) hash[keys[i]] = true; - return { - contains: function(key) { return hash[key] === true; }, - push: function(key) { - hash[key] = true; - return keys.push(key); - } - }; -} - -// Internal helper. Checks `keys` for the presence of keys in IE < 9 that won't -// be iterated by `for key in ...` and thus missed. Extends `keys` in place if -// needed. -function collectNonEnumProps(obj, keys) { - keys = emulatedSet(keys); - var nonEnumIdx = _setup.nonEnumerableProps.length; - var constructor = obj.constructor; - var proto = (isFunction(constructor) && constructor.prototype) || _setup.ObjProto; - - // Constructor is a special case. - var prop = 'constructor'; - if (_has(obj, prop) && !keys.contains(prop)) keys.push(prop); - - while (nonEnumIdx--) { - prop = _setup.nonEnumerableProps[nonEnumIdx]; - if (prop in obj && obj[prop] !== proto[prop] && !keys.contains(prop)) { - keys.push(prop); - } - } -} - -module.exports = collectNonEnumProps; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/_createAssigner.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/_createAssigner.js deleted file mode 100644 index 13fa0ddf..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/_createAssigner.js +++ /dev/null @@ -1,20 +0,0 @@ -// An internal function for creating assigner functions. -function createAssigner(keysFunc, defaults) { - return function(obj) { - var length = arguments.length; - if (defaults) obj = Object(obj); - if (length < 2 || obj == null) return obj; - for (var index = 1; index < length; index++) { - var source = arguments[index], - keys = keysFunc(source), - l = keys.length; - for (var i = 0; i < l; i++) { - var key = keys[i]; - if (!defaults || obj[key] === void 0) obj[key] = source[key]; - } - } - return obj; - }; -} - -module.exports = createAssigner; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/_createEscaper.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/_createEscaper.js deleted file mode 100644 index c3b7ac4a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/_createEscaper.js +++ /dev/null @@ -1,19 +0,0 @@ -var keys = require('./keys.js'); - -// Internal helper to generate functions for escaping and unescaping strings -// to/from HTML interpolation. -function createEscaper(map) { - var escaper = function(match) { - return map[match]; - }; - // Regexes for identifying a key that needs to be escaped. - var source = '(?:' + keys(map).join('|') + ')'; - var testRegexp = RegExp(source); - var replaceRegexp = RegExp(source, 'g'); - return function(string) { - string = string == null ? '' : '' + string; - return testRegexp.test(string) ? string.replace(replaceRegexp, escaper) : string; - }; -} - -module.exports = createEscaper; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/_createIndexFinder.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/_createIndexFinder.js deleted file mode 100644 index 7f390392..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/_createIndexFinder.js +++ /dev/null @@ -1,30 +0,0 @@ -var _getLength = require('./_getLength.js'); -var _setup = require('./_setup.js'); -var _isNaN = require('./isNaN.js'); - -// Internal function to generate the `_.indexOf` and `_.lastIndexOf` functions. -function createIndexFinder(dir, predicateFind, sortedIndex) { - return function(array, item, idx) { - var i = 0, length = _getLength(array); - if (typeof idx == 'number') { - if (dir > 0) { - i = idx >= 0 ? idx : Math.max(idx + length, i); - } else { - length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1; - } - } else if (sortedIndex && idx && length) { - idx = sortedIndex(array, item); - return array[idx] === item ? idx : -1; - } - if (item !== item) { - idx = predicateFind(_setup.slice.call(array, i, length), _isNaN); - return idx >= 0 ? idx + i : -1; - } - for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) { - if (array[idx] === item) return idx; - } - return -1; - }; -} - -module.exports = createIndexFinder; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/_createPredicateIndexFinder.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/_createPredicateIndexFinder.js deleted file mode 100644 index e954419c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/_createPredicateIndexFinder.js +++ /dev/null @@ -1,17 +0,0 @@ -var _cb = require('./_cb.js'); -var _getLength = require('./_getLength.js'); - -// Internal function to generate `_.findIndex` and `_.findLastIndex`. -function createPredicateIndexFinder(dir) { - return function(array, predicate, context) { - predicate = _cb(predicate, context); - var length = _getLength(array); - var index = dir > 0 ? 0 : length - 1; - for (; index >= 0 && index < length; index += dir) { - if (predicate(array[index], index, array)) return index; - } - return -1; - }; -} - -module.exports = createPredicateIndexFinder; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/_createReduce.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/_createReduce.js deleted file mode 100644 index fb246081..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/_createReduce.js +++ /dev/null @@ -1,30 +0,0 @@ -var _isArrayLike = require('./_isArrayLike.js'); -var keys = require('./keys.js'); -var _optimizeCb = require('./_optimizeCb.js'); - -// Internal helper to create a reducing function, iterating left or right. -function createReduce(dir) { - // Wrap code that reassigns argument variables in a separate function than - // the one that accesses `arguments.length` to avoid a perf hit. (#1991) - var reducer = function(obj, iteratee, memo, initial) { - var _keys = !_isArrayLike(obj) && keys(obj), - length = (_keys || obj).length, - index = dir > 0 ? 0 : length - 1; - if (!initial) { - memo = obj[_keys ? _keys[index] : index]; - index += dir; - } - for (; index >= 0 && index < length; index += dir) { - var currentKey = _keys ? _keys[index] : index; - memo = iteratee(memo, obj[currentKey], currentKey, obj); - } - return memo; - }; - - return function(obj, iteratee, memo, context) { - var initial = arguments.length >= 3; - return reducer(obj, _optimizeCb(iteratee, context, 4), memo, initial); - }; -} - -module.exports = createReduce; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/_createSizePropertyCheck.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/_createSizePropertyCheck.js deleted file mode 100644 index 72711297..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/_createSizePropertyCheck.js +++ /dev/null @@ -1,11 +0,0 @@ -var _setup = require('./_setup.js'); - -// Common internal logic for `isArrayLike` and `isBufferLike`. -function createSizePropertyCheck(getSizeProperty) { - return function(collection) { - var sizeProperty = getSizeProperty(collection); - return typeof sizeProperty == 'number' && sizeProperty >= 0 && sizeProperty <= _setup.MAX_ARRAY_INDEX; - } -} - -module.exports = createSizePropertyCheck; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/_deepGet.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/_deepGet.js deleted file mode 100644 index 90170589..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/_deepGet.js +++ /dev/null @@ -1,11 +0,0 @@ -// Internal function to obtain a nested property in `obj` along `path`. -function deepGet(obj, path) { - var length = path.length; - for (var i = 0; i < length; i++) { - if (obj == null) return void 0; - obj = obj[path[i]]; - } - return length ? obj : void 0; -} - -module.exports = deepGet; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/_escapeMap.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/_escapeMap.js deleted file mode 100644 index 821501ed..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/_escapeMap.js +++ /dev/null @@ -1,11 +0,0 @@ -// Internal list of HTML entities for escaping. -var escapeMap = { - '&': '&', - '<': '<', - '>': '>', - '"': '"', - "'": ''', - '`': '`' -}; - -module.exports = escapeMap; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/_executeBound.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/_executeBound.js deleted file mode 100644 index de0220ea..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/_executeBound.js +++ /dev/null @@ -1,15 +0,0 @@ -var _baseCreate = require('./_baseCreate.js'); -var isObject = require('./isObject.js'); - -// Internal function to execute `sourceFunc` bound to `context` with optional -// `args`. Determines whether to execute a function as a constructor or as a -// normal function. -function executeBound(sourceFunc, boundFunc, context, callingContext, args) { - if (!(callingContext instanceof boundFunc)) return sourceFunc.apply(context, args); - var self = _baseCreate(sourceFunc.prototype); - var result = sourceFunc.apply(self, args); - if (isObject(result)) return result; - return self; -} - -module.exports = executeBound; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/_flatten.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/_flatten.js deleted file mode 100644 index 830221d0..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/_flatten.js +++ /dev/null @@ -1,33 +0,0 @@ -var _getLength = require('./_getLength.js'); -var _isArrayLike = require('./_isArrayLike.js'); -var isArray = require('./isArray.js'); -var isArguments = require('./isArguments.js'); - -// Internal implementation of a recursive `flatten` function. -function flatten(input, depth, strict, output) { - output = output || []; - if (!depth && depth !== 0) { - depth = Infinity; - } else if (depth <= 0) { - return output.concat(input); - } - var idx = output.length; - for (var i = 0, length = _getLength(input); i < length; i++) { - var value = input[i]; - if (_isArrayLike(value) && (isArray(value) || isArguments(value))) { - // Flatten current level of array or arguments object. - if (depth > 1) { - flatten(value, depth - 1, strict, output); - idx = output.length; - } else { - var j = 0, len = value.length; - while (j < len) output[idx++] = value[j++]; - } - } else if (!strict) { - output[idx++] = value; - } - } - return output; -} - -module.exports = flatten; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/_getByteLength.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/_getByteLength.js deleted file mode 100644 index 49acd7f8..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/_getByteLength.js +++ /dev/null @@ -1,6 +0,0 @@ -var _shallowProperty = require('./_shallowProperty.js'); - -// Internal helper to obtain the `byteLength` property of an object. -var getByteLength = _shallowProperty('byteLength'); - -module.exports = getByteLength; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/_getLength.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/_getLength.js deleted file mode 100644 index 1ad70920..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/_getLength.js +++ /dev/null @@ -1,6 +0,0 @@ -var _shallowProperty = require('./_shallowProperty.js'); - -// Internal helper to obtain the `length` property of an object. -var getLength = _shallowProperty('length'); - -module.exports = getLength; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/_group.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/_group.js deleted file mode 100644 index cb1f5a85..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/_group.js +++ /dev/null @@ -1,17 +0,0 @@ -var _cb = require('./_cb.js'); -var each = require('./each.js'); - -// An internal function used for aggregate "group by" operations. -function group(behavior, partition) { - return function(obj, iteratee, context) { - var result = partition ? [[], []] : {}; - iteratee = _cb(iteratee, context); - each(obj, function(value, index) { - var key = iteratee(value, index, obj); - behavior(result, value, key); - }); - return result; - }; -} - -module.exports = group; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/_has.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/_has.js deleted file mode 100644 index 6540346b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/_has.js +++ /dev/null @@ -1,8 +0,0 @@ -var _setup = require('./_setup.js'); - -// Internal function to check whether `key` is an own property name of `obj`. -function has(obj, key) { - return obj != null && _setup.hasOwnProperty.call(obj, key); -} - -module.exports = has; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/_hasObjectTag.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/_hasObjectTag.js deleted file mode 100644 index fb714528..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/_hasObjectTag.js +++ /dev/null @@ -1,5 +0,0 @@ -var _tagTester = require('./_tagTester.js'); - -var hasObjectTag = _tagTester('Object'); - -module.exports = hasObjectTag; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/_isArrayLike.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/_isArrayLike.js deleted file mode 100644 index b835307c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/_isArrayLike.js +++ /dev/null @@ -1,10 +0,0 @@ -var _createSizePropertyCheck = require('./_createSizePropertyCheck.js'); -var _getLength = require('./_getLength.js'); - -// Internal helper for collection methods to determine whether a collection -// should be iterated as an array or as an object. -// Related: https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength -// Avoids a very nasty iOS 8 JIT bug on ARM-64. #2094 -var isArrayLike = _createSizePropertyCheck(_getLength); - -module.exports = isArrayLike; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/_isBufferLike.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/_isBufferLike.js deleted file mode 100644 index bf919aa8..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/_isBufferLike.js +++ /dev/null @@ -1,8 +0,0 @@ -var _createSizePropertyCheck = require('./_createSizePropertyCheck.js'); -var _getByteLength = require('./_getByteLength.js'); - -// Internal helper to determine whether we should spend extensive checks against -// `ArrayBuffer` et al. -var isBufferLike = _createSizePropertyCheck(_getByteLength); - -module.exports = isBufferLike; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/_keyInObj.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/_keyInObj.js deleted file mode 100644 index 12adc826..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/_keyInObj.js +++ /dev/null @@ -1,7 +0,0 @@ -// Internal `_.pick` helper function to determine whether `key` is an enumerable -// property name of `obj`. -function keyInObj(value, key, obj) { - return key in obj; -} - -module.exports = keyInObj; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/_methodFingerprint.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/_methodFingerprint.js deleted file mode 100644 index 26028c9c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/_methodFingerprint.js +++ /dev/null @@ -1,44 +0,0 @@ -Object.defineProperty(exports, '__esModule', { value: true }); - -var _getLength = require('./_getLength.js'); -var isFunction = require('./isFunction.js'); -var allKeys = require('./allKeys.js'); - -// Since the regular `Object.prototype.toString` type tests don't work for -// some types in IE 11, we use a fingerprinting heuristic instead, based -// on the methods. It's not great, but it's the best we got. -// The fingerprint method lists are defined below. -function ie11fingerprint(methods) { - var length = _getLength(methods); - return function(obj) { - if (obj == null) return false; - // `Map`, `WeakMap` and `Set` have no enumerable keys. - var keys = allKeys(obj); - if (_getLength(keys)) return false; - for (var i = 0; i < length; i++) { - if (!isFunction(obj[methods[i]])) return false; - } - // If we are testing against `WeakMap`, we need to ensure that - // `obj` doesn't have a `forEach` method in order to distinguish - // it from a regular `Map`. - return methods !== weakMapMethods || !isFunction(obj[forEachName]); - }; -} - -// In the interest of compact minification, we write -// each string in the fingerprints only once. -var forEachName = 'forEach', - hasName = 'has', - commonInit = ['clear', 'delete'], - mapTail = ['get', hasName, 'set']; - -// `Map`, `WeakMap` and `Set` each have slightly different -// combinations of the above sublists. -var mapMethods = commonInit.concat(forEachName, mapTail), - weakMapMethods = commonInit.concat(mapTail), - setMethods = ['add'].concat(commonInit, forEachName, hasName); - -exports.ie11fingerprint = ie11fingerprint; -exports.mapMethods = mapMethods; -exports.setMethods = setMethods; -exports.weakMapMethods = weakMapMethods; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/_optimizeCb.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/_optimizeCb.js deleted file mode 100644 index e6c25386..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/_optimizeCb.js +++ /dev/null @@ -1,23 +0,0 @@ -// Internal function that returns an efficient (for current engines) version -// of the passed-in callback, to be repeatedly applied in other Underscore -// functions. -function optimizeCb(func, context, argCount) { - if (context === void 0) return func; - switch (argCount == null ? 3 : argCount) { - case 1: return function(value) { - return func.call(context, value); - }; - // The 2-argument case is omitted because we’re not using it. - case 3: return function(value, index, collection) { - return func.call(context, value, index, collection); - }; - case 4: return function(accumulator, value, index, collection) { - return func.call(context, accumulator, value, index, collection); - }; - } - return function() { - return func.apply(context, arguments); - }; -} - -module.exports = optimizeCb; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/_set.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/_set.js deleted file mode 100644 index e2a10463..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/_set.js +++ /dev/null @@ -1,21 +0,0 @@ -var isNumber = require('./isNumber.js'); -var isArray = require('./isArray.js'); -var isObject = require('./isObject.js'); - -function set (obj, path, value) { - var key = String(path[0]); - - if (path.length === 1) { - obj[key] = value; - return; - } - - if (!isArray(obj[key]) || !isObject(obj[key])) { - var nextKey = path[1]; - obj[key] = isNumber(nextKey) ? [] : {}; - } - - return set(obj[key], path.slice(1), value); -} - -module.exports = set; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/_setup.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/_setup.js deleted file mode 100644 index e02ac794..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/_setup.js +++ /dev/null @@ -1,66 +0,0 @@ -Object.defineProperty(exports, '__esModule', { value: true }); - -// Current version. -var VERSION = '1.13.6'; - -// Establish the root object, `window` (`self`) in the browser, `global` -// on the server, or `this` in some virtual machines. We use `self` -// instead of `window` for `WebWorker` support. -var root = (typeof self == 'object' && self.self === self && self) || - (typeof global == 'object' && global.global === global && global) || - Function('return this')() || - {}; - -// Save bytes in the minified (but not gzipped) version: -var ArrayProto = Array.prototype, ObjProto = Object.prototype; -var SymbolProto = typeof Symbol !== 'undefined' ? Symbol.prototype : null; - -// Create quick reference variables for speed access to core prototypes. -var push = ArrayProto.push, - slice = ArrayProto.slice, - toString = ObjProto.toString, - hasOwnProperty = ObjProto.hasOwnProperty; - -// Modern feature detection. -var supportsArrayBuffer = typeof ArrayBuffer !== 'undefined', - supportsDataView = typeof DataView !== 'undefined'; - -// All **ECMAScript 5+** native function implementations that we hope to use -// are declared here. -var nativeIsArray = Array.isArray, - nativeKeys = Object.keys, - nativeCreate = Object.create, - nativeIsView = supportsArrayBuffer && ArrayBuffer.isView; - -// Create references to these builtin functions because we override them. -var _isNaN = isNaN, - _isFinite = isFinite; - -// Keys in IE < 9 that won't be iterated by `for key in ...` and thus missed. -var hasEnumBug = !{toString: null}.propertyIsEnumerable('toString'); -var nonEnumerableProps = ['valueOf', 'isPrototypeOf', 'toString', - 'propertyIsEnumerable', 'hasOwnProperty', 'toLocaleString']; - -// The largest integer that can be represented exactly. -var MAX_ARRAY_INDEX = Math.pow(2, 53) - 1; - -exports.ArrayProto = ArrayProto; -exports.MAX_ARRAY_INDEX = MAX_ARRAY_INDEX; -exports.ObjProto = ObjProto; -exports.SymbolProto = SymbolProto; -exports.VERSION = VERSION; -exports._isFinite = _isFinite; -exports._isNaN = _isNaN; -exports.hasEnumBug = hasEnumBug; -exports.hasOwnProperty = hasOwnProperty; -exports.nativeCreate = nativeCreate; -exports.nativeIsArray = nativeIsArray; -exports.nativeIsView = nativeIsView; -exports.nativeKeys = nativeKeys; -exports.nonEnumerableProps = nonEnumerableProps; -exports.push = push; -exports.root = root; -exports.slice = slice; -exports.supportsArrayBuffer = supportsArrayBuffer; -exports.supportsDataView = supportsDataView; -exports.toString = toString; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/_shallowProperty.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/_shallowProperty.js deleted file mode 100644 index aabdc625..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/_shallowProperty.js +++ /dev/null @@ -1,8 +0,0 @@ -// Internal helper to generate a function to obtain property `key` from `obj`. -function shallowProperty(key) { - return function(obj) { - return obj == null ? void 0 : obj[key]; - }; -} - -module.exports = shallowProperty; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/_stringTagBug.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/_stringTagBug.js deleted file mode 100644 index b5b21caf..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/_stringTagBug.js +++ /dev/null @@ -1,15 +0,0 @@ -Object.defineProperty(exports, '__esModule', { value: true }); - -var _setup = require('./_setup.js'); -var _hasObjectTag = require('./_hasObjectTag.js'); - -// In IE 10 - Edge 13, `DataView` has string tag `'[object Object]'`. -// In IE 11, the most common among them, this problem also applies to -// `Map`, `WeakMap` and `Set`. -var hasStringTagBug = ( - _setup.supportsDataView && _hasObjectTag(new DataView(new ArrayBuffer(8))) - ), - isIE11 = (typeof Map !== 'undefined' && _hasObjectTag(new Map)); - -exports.hasStringTagBug = hasStringTagBug; -exports.isIE11 = isIE11; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/_tagTester.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/_tagTester.js deleted file mode 100644 index 2578e9b6..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/_tagTester.js +++ /dev/null @@ -1,11 +0,0 @@ -var _setup = require('./_setup.js'); - -// Internal function for creating a `toString`-based type tester. -function tagTester(name) { - var tag = '[object ' + name + ']'; - return function(obj) { - return _setup.toString.call(obj) === tag; - }; -} - -module.exports = tagTester; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/_toBufferView.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/_toBufferView.js deleted file mode 100644 index 3ad4e881..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/_toBufferView.js +++ /dev/null @@ -1,13 +0,0 @@ -var _getByteLength = require('./_getByteLength.js'); - -// Internal function to wrap or shallow-copy an ArrayBuffer, -// typed array or DataView to a new view, reusing the buffer. -function toBufferView(bufferSource) { - return new Uint8Array( - bufferSource.buffer || bufferSource, - bufferSource.byteOffset || 0, - _getByteLength(bufferSource) - ); -} - -module.exports = toBufferView; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/_toPath.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/_toPath.js deleted file mode 100644 index 33f1fa7c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/_toPath.js +++ /dev/null @@ -1,10 +0,0 @@ -var underscore = require('./underscore.js'); -require('./toPath.js'); - -// Internal wrapper for `_.toPath` to enable minification. -// Similar to `cb` for `_.iteratee`. -function toPath(path) { - return underscore.toPath(path); -} - -module.exports = toPath; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/_unescapeMap.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/_unescapeMap.js deleted file mode 100644 index b2f68c8b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/_unescapeMap.js +++ /dev/null @@ -1,7 +0,0 @@ -var invert = require('./invert.js'); -var _escapeMap = require('./_escapeMap.js'); - -// Internal list of HTML entities for unescaping. -var unescapeMap = invert(_escapeMap); - -module.exports = unescapeMap; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/after.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/after.js deleted file mode 100644 index c047e20b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/after.js +++ /dev/null @@ -1,10 +0,0 @@ -// Returns a function that will only be executed on and after the Nth call. -function after(times, func) { - return function() { - if (--times < 1) { - return func.apply(this, arguments); - } - }; -} - -module.exports = after; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/allKeys.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/allKeys.js deleted file mode 100644 index 1eb5e842..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/allKeys.js +++ /dev/null @@ -1,15 +0,0 @@ -var isObject = require('./isObject.js'); -var _setup = require('./_setup.js'); -var _collectNonEnumProps = require('./_collectNonEnumProps.js'); - -// Retrieve all the enumerable property names of an object. -function allKeys(obj) { - if (!isObject(obj)) return []; - var keys = []; - for (var key in obj) keys.push(key); - // Ahem, IE < 9. - if (_setup.hasEnumBug) _collectNonEnumProps(obj, keys); - return keys; -} - -module.exports = allKeys; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/before.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/before.js deleted file mode 100644 index 714a31e3..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/before.js +++ /dev/null @@ -1,14 +0,0 @@ -// Returns a function that will only be executed up to (but not including) the -// Nth call. -function before(times, func) { - var memo; - return function() { - if (--times > 0) { - memo = func.apply(this, arguments); - } - if (times <= 1) func = null; - return memo; - }; -} - -module.exports = before; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/bind.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/bind.js deleted file mode 100644 index 59bc5ee6..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/bind.js +++ /dev/null @@ -1,15 +0,0 @@ -var restArguments = require('./restArguments.js'); -var isFunction = require('./isFunction.js'); -var _executeBound = require('./_executeBound.js'); - -// Create a function bound to a given object (assigning `this`, and arguments, -// optionally). -var bind = restArguments(function(func, context, args) { - if (!isFunction(func)) throw new TypeError('Bind must be called on a function'); - var bound = restArguments(function(callArgs) { - return _executeBound(func, bound, context, this, args.concat(callArgs)); - }); - return bound; -}); - -module.exports = bind; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/bindAll.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/bindAll.js deleted file mode 100644 index 12c14023..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/bindAll.js +++ /dev/null @@ -1,19 +0,0 @@ -var restArguments = require('./restArguments.js'); -var _flatten = require('./_flatten.js'); -var bind = require('./bind.js'); - -// Bind a number of an object's methods to that object. Remaining arguments -// are the method names to be bound. Useful for ensuring that all callbacks -// defined on an object belong to it. -var bindAll = restArguments(function(obj, keys) { - keys = _flatten(keys, false, false); - var index = keys.length; - if (index < 1) throw new Error('bindAll must be passed function names'); - while (index--) { - var key = keys[index]; - obj[key] = bind(obj[key], obj); - } - return obj; -}); - -module.exports = bindAll; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/chain.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/chain.js deleted file mode 100644 index 07e35eaf..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/chain.js +++ /dev/null @@ -1,10 +0,0 @@ -var underscore = require('./underscore.js'); - -// Start chaining a wrapped Underscore object. -function chain(obj) { - var instance = underscore(obj); - instance._chain = true; - return instance; -} - -module.exports = chain; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/chunk.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/chunk.js deleted file mode 100644 index 3e10d88e..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/chunk.js +++ /dev/null @@ -1,15 +0,0 @@ -var _setup = require('./_setup.js'); - -// Chunk a single array into multiple arrays, each containing `count` or fewer -// items. -function chunk(array, count) { - if (count == null || count < 1) return []; - var result = []; - var i = 0, length = array.length; - while (i < length) { - result.push(_setup.slice.call(array, i, i += count)); - } - return result; -} - -module.exports = chunk; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/clone.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/clone.js deleted file mode 100644 index 91b3e5b8..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/clone.js +++ /dev/null @@ -1,11 +0,0 @@ -var isObject = require('./isObject.js'); -var isArray = require('./isArray.js'); -var extend = require('./extend.js'); - -// Create a (shallow-cloned) duplicate of an object. -function clone(obj) { - if (!isObject(obj)) return obj; - return isArray(obj) ? obj.slice() : extend({}, obj); -} - -module.exports = clone; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/compact.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/compact.js deleted file mode 100644 index 8fd210e1..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/compact.js +++ /dev/null @@ -1,8 +0,0 @@ -var filter = require('./filter.js'); - -// Trim out all falsy values from an array. -function compact(array) { - return filter(array, Boolean); -} - -module.exports = compact; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/compose.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/compose.js deleted file mode 100644 index f95f8905..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/compose.js +++ /dev/null @@ -1,14 +0,0 @@ -// Returns a function that is the composition of a list of functions, each -// consuming the return value of the function that follows. -function compose() { - var args = arguments; - var start = args.length - 1; - return function() { - var i = start; - var result = args[start].apply(this, arguments); - while (i--) result = args[i].call(this, result); - return result; - }; -} - -module.exports = compose; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/constant.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/constant.js deleted file mode 100644 index 0b2904b2..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/constant.js +++ /dev/null @@ -1,8 +0,0 @@ -// Predicate-generating function. Often useful outside of Underscore. -function constant(value) { - return function() { - return value; - }; -} - -module.exports = constant; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/contains.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/contains.js deleted file mode 100644 index bfe13415..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/contains.js +++ /dev/null @@ -1,12 +0,0 @@ -var _isArrayLike = require('./_isArrayLike.js'); -var values = require('./values.js'); -var indexOf = require('./indexOf.js'); - -// Determine if the array or object contains a given item (using `===`). -function contains(obj, item, fromIndex, guard) { - if (!_isArrayLike(obj)) obj = values(obj); - if (typeof fromIndex != 'number' || guard) fromIndex = 0; - return indexOf(obj, item, fromIndex) >= 0; -} - -module.exports = contains; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/countBy.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/countBy.js deleted file mode 100644 index 88803264..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/countBy.js +++ /dev/null @@ -1,11 +0,0 @@ -var _group = require('./_group.js'); -var _has = require('./_has.js'); - -// Counts instances of an object that group by a certain criterion. Pass -// either a string attribute to count by, or a function that returns the -// criterion. -var countBy = _group(function(result, value, key) { - if (_has(result, key)) result[key]++; else result[key] = 1; -}); - -module.exports = countBy; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/create.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/create.js deleted file mode 100644 index 68332186..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/create.js +++ /dev/null @@ -1,13 +0,0 @@ -var _baseCreate = require('./_baseCreate.js'); -var extendOwn = require('./extendOwn.js'); - -// Creates an object that inherits from the given prototype object. -// If additional properties are provided then they will be added to the -// created object. -function create(prototype, props) { - var result = _baseCreate(prototype); - if (props) extendOwn(result, props); - return result; -} - -module.exports = create; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/debounce.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/debounce.js deleted file mode 100644 index 517086c2..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/debounce.js +++ /dev/null @@ -1,42 +0,0 @@ -var restArguments = require('./restArguments.js'); -var now = require('./now.js'); - -// When a sequence of calls of the returned function ends, the argument -// function is triggered. The end of a sequence is defined by the `wait` -// parameter. If `immediate` is passed, the argument function will be -// triggered at the beginning of the sequence instead of at the end. -function debounce(func, wait, immediate) { - var timeout, previous, args, result, context; - - var later = function() { - var passed = now() - previous; - if (wait > passed) { - timeout = setTimeout(later, wait - passed); - } else { - timeout = null; - if (!immediate) result = func.apply(context, args); - // This check is needed because `func` can recursively invoke `debounced`. - if (!timeout) args = context = null; - } - }; - - var debounced = restArguments(function(_args) { - context = this; - args = _args; - previous = now(); - if (!timeout) { - timeout = setTimeout(later, wait); - if (immediate) result = func.apply(context, args); - } - return result; - }); - - debounced.cancel = function() { - clearTimeout(timeout); - timeout = args = context = null; - }; - - return debounced; -} - -module.exports = debounce; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/defaults.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/defaults.js deleted file mode 100644 index 180cdd14..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/defaults.js +++ /dev/null @@ -1,7 +0,0 @@ -var _createAssigner = require('./_createAssigner.js'); -var allKeys = require('./allKeys.js'); - -// Fill in a given object with default properties. -var defaults = _createAssigner(allKeys, true); - -module.exports = defaults; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/defer.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/defer.js deleted file mode 100644 index 2f1ef252..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/defer.js +++ /dev/null @@ -1,9 +0,0 @@ -var partial = require('./partial.js'); -var delay = require('./delay.js'); -var underscore = require('./underscore.js'); - -// Defers a function, scheduling it to run after the current call stack has -// cleared. -var defer = partial(delay, underscore, 1); - -module.exports = defer; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/delay.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/delay.js deleted file mode 100644 index 49b5387e..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/delay.js +++ /dev/null @@ -1,11 +0,0 @@ -var restArguments = require('./restArguments.js'); - -// Delays a function for the given number of milliseconds, and then calls -// it with the arguments supplied. -var delay = restArguments(function(func, wait, args) { - return setTimeout(function() { - return func.apply(null, args); - }, wait); -}); - -module.exports = delay; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/difference.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/difference.js deleted file mode 100644 index 8e472d6e..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/difference.js +++ /dev/null @@ -1,15 +0,0 @@ -var restArguments = require('./restArguments.js'); -var _flatten = require('./_flatten.js'); -var filter = require('./filter.js'); -var contains = require('./contains.js'); - -// Take the difference between one array and a number of other arrays. -// Only the elements present in just the first array will remain. -var difference = restArguments(function(array, rest) { - rest = _flatten(rest, true, true); - return filter(array, function(value){ - return !contains(rest, value); - }); -}); - -module.exports = difference; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/each.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/each.js deleted file mode 100644 index f6fa21e4..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/each.js +++ /dev/null @@ -1,25 +0,0 @@ -var _optimizeCb = require('./_optimizeCb.js'); -var _isArrayLike = require('./_isArrayLike.js'); -var keys = require('./keys.js'); - -// The cornerstone for collection functions, an `each` -// implementation, aka `forEach`. -// Handles raw objects in addition to array-likes. Treats all -// sparse array-likes as if they were dense. -function each(obj, iteratee, context) { - iteratee = _optimizeCb(iteratee, context); - var i, length; - if (_isArrayLike(obj)) { - for (i = 0, length = obj.length; i < length; i++) { - iteratee(obj[i], i, obj); - } - } else { - var _keys = keys(obj); - for (i = 0, length = _keys.length; i < length; i++) { - iteratee(obj[_keys[i]], _keys[i], obj); - } - } - return obj; -} - -module.exports = each; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/escape.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/escape.js deleted file mode 100644 index 0f29ef8a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/escape.js +++ /dev/null @@ -1,7 +0,0 @@ -var _createEscaper = require('./_createEscaper.js'); -var _escapeMap = require('./_escapeMap.js'); - -// Function for escaping strings to HTML interpolation. -var _escape = _createEscaper(_escapeMap); - -module.exports = _escape; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/every.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/every.js deleted file mode 100644 index d0786954..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/every.js +++ /dev/null @@ -1,17 +0,0 @@ -var _cb = require('./_cb.js'); -var _isArrayLike = require('./_isArrayLike.js'); -var keys = require('./keys.js'); - -// Determine whether all of the elements pass a truth test. -function every(obj, predicate, context) { - predicate = _cb(predicate, context); - var _keys = !_isArrayLike(obj) && keys(obj), - length = (_keys || obj).length; - for (var index = 0; index < length; index++) { - var currentKey = _keys ? _keys[index] : index; - if (!predicate(obj[currentKey], currentKey, obj)) return false; - } - return true; -} - -module.exports = every; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/extend.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/extend.js deleted file mode 100644 index 7c5511c5..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/extend.js +++ /dev/null @@ -1,7 +0,0 @@ -var _createAssigner = require('./_createAssigner.js'); -var allKeys = require('./allKeys.js'); - -// Extend a given object with all the properties in passed-in object(s). -var extend = _createAssigner(allKeys); - -module.exports = extend; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/extendOwn.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/extendOwn.js deleted file mode 100644 index 337195a8..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/extendOwn.js +++ /dev/null @@ -1,9 +0,0 @@ -var _createAssigner = require('./_createAssigner.js'); -var keys = require('./keys.js'); - -// Assigns a given object with all the own properties in the passed-in -// object(s). -// (https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/assign) -var extendOwn = _createAssigner(keys); - -module.exports = extendOwn; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/filter.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/filter.js deleted file mode 100644 index ba1a0634..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/filter.js +++ /dev/null @@ -1,14 +0,0 @@ -var _cb = require('./_cb.js'); -var each = require('./each.js'); - -// Return all the elements that pass a truth test. -function filter(obj, predicate, context) { - var results = []; - predicate = _cb(predicate, context); - each(obj, function(value, index, list) { - if (predicate(value, index, list)) results.push(value); - }); - return results; -} - -module.exports = filter; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/find.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/find.js deleted file mode 100644 index 03728b46..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/find.js +++ /dev/null @@ -1,12 +0,0 @@ -var _isArrayLike = require('./_isArrayLike.js'); -var findIndex = require('./findIndex.js'); -var findKey = require('./findKey.js'); - -// Return the first value which passes a truth test. -function find(obj, predicate, context) { - var keyFinder = _isArrayLike(obj) ? findIndex : findKey; - var key = keyFinder(obj, predicate, context); - if (key !== void 0 && key !== -1) return obj[key]; -} - -module.exports = find; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/findIndex.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/findIndex.js deleted file mode 100644 index e5a1fecd..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/findIndex.js +++ /dev/null @@ -1,6 +0,0 @@ -var _createPredicateIndexFinder = require('./_createPredicateIndexFinder.js'); - -// Returns the first index on an array-like that passes a truth test. -var findIndex = _createPredicateIndexFinder(1); - -module.exports = findIndex; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/findKey.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/findKey.js deleted file mode 100644 index 4f2c2918..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/findKey.js +++ /dev/null @@ -1,14 +0,0 @@ -var _cb = require('./_cb.js'); -var keys = require('./keys.js'); - -// Returns the first key on an object that passes a truth test. -function findKey(obj, predicate, context) { - predicate = _cb(predicate, context); - var _keys = keys(obj), key; - for (var i = 0, length = _keys.length; i < length; i++) { - key = _keys[i]; - if (predicate(obj[key], key, obj)) return key; - } -} - -module.exports = findKey; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/findLastIndex.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/findLastIndex.js deleted file mode 100644 index c9165cba..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/findLastIndex.js +++ /dev/null @@ -1,6 +0,0 @@ -var _createPredicateIndexFinder = require('./_createPredicateIndexFinder.js'); - -// Returns the last index on an array-like that passes a truth test. -var findLastIndex = _createPredicateIndexFinder(-1); - -module.exports = findLastIndex; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/findWhere.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/findWhere.js deleted file mode 100644 index cf66e0d6..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/findWhere.js +++ /dev/null @@ -1,10 +0,0 @@ -var find = require('./find.js'); -var matcher = require('./matcher.js'); - -// Convenience version of a common use case of `_.find`: getting the first -// object containing specific `key:value` pairs. -function findWhere(obj, attrs) { - return find(obj, matcher(attrs)); -} - -module.exports = findWhere; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/first.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/first.js deleted file mode 100644 index 82b68463..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/first.js +++ /dev/null @@ -1,11 +0,0 @@ -var initial = require('./initial.js'); - -// Get the first element of an array. Passing **n** will return the first N -// values in the array. The **guard** check allows it to work with `_.map`. -function first(array, n, guard) { - if (array == null || array.length < 1) return n == null || guard ? void 0 : []; - if (n == null || guard) return array[0]; - return initial(array, array.length - n); -} - -module.exports = first; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/flatten.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/flatten.js deleted file mode 100644 index b8878390..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/flatten.js +++ /dev/null @@ -1,9 +0,0 @@ -var _flatten = require('./_flatten.js'); - -// Flatten out an array, either recursively (by default), or up to `depth`. -// Passing `true` or `false` as `depth` means `1` or `Infinity`, respectively. -function flatten(array, depth) { - return _flatten(array, depth, false); -} - -module.exports = flatten; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/functions.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/functions.js deleted file mode 100644 index f9afb43b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/functions.js +++ /dev/null @@ -1,12 +0,0 @@ -var isFunction = require('./isFunction.js'); - -// Return a sorted list of the function names available on the object. -function functions(obj) { - var names = []; - for (var key in obj) { - if (isFunction(obj[key])) names.push(key); - } - return names.sort(); -} - -module.exports = functions; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/get.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/get.js deleted file mode 100644 index 0f57fe04..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/get.js +++ /dev/null @@ -1,14 +0,0 @@ -var _toPath = require('./_toPath.js'); -var _deepGet = require('./_deepGet.js'); -var isUndefined = require('./isUndefined.js'); - -// Get the value of the (deep) property on `path` from `object`. -// If any property in `path` does not exist or if the value is -// `undefined`, return `defaultValue` instead. -// The `path` is normalized through `_.toPath`. -function get(object, path, defaultValue) { - var value = _deepGet(object, _toPath(path)); - return isUndefined(value) ? defaultValue : value; -} - -module.exports = get; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/groupBy.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/groupBy.js deleted file mode 100644 index f152f9db..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/groupBy.js +++ /dev/null @@ -1,10 +0,0 @@ -var _group = require('./_group.js'); -var _has = require('./_has.js'); - -// Groups the object's values by a criterion. Pass either a string attribute -// to group by, or a function that returns the criterion. -var groupBy = _group(function(result, value, key) { - if (_has(result, key)) result[key].push(value); else result[key] = [value]; -}); - -module.exports = groupBy; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/has.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/has.js deleted file mode 100644 index 26c123d1..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/has.js +++ /dev/null @@ -1,18 +0,0 @@ -var _has = require('./_has.js'); -var _toPath = require('./_toPath.js'); - -// Shortcut function for checking if an object has a given property directly on -// itself (in other words, not on a prototype). Unlike the internal `has` -// function, this public version can also traverse nested properties. -function has(obj, path) { - path = _toPath(path); - var length = path.length; - for (var i = 0; i < length; i++) { - var key = path[i]; - if (!_has(obj, key)) return false; - obj = obj[key]; - } - return !!length; -} - -module.exports = has; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/identity.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/identity.js deleted file mode 100644 index d65566a1..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/identity.js +++ /dev/null @@ -1,6 +0,0 @@ -// Keep the identity function around for default iteratees. -function identity(value) { - return value; -} - -module.exports = identity; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/index-default.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/index-default.js deleted file mode 100644 index 46859496..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/index-default.js +++ /dev/null @@ -1,11 +0,0 @@ -var index = require('./index.js'); -var mixin = require('./mixin.js'); - -// Default Export - -// Add all of the Underscore functions to the wrapper object. -var _ = mixin(index); -// Legacy Node.js API. -_._ = _; - -module.exports = _; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/index.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/index.js deleted file mode 100644 index cb06a751..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/index.js +++ /dev/null @@ -1,278 +0,0 @@ -Object.defineProperty(exports, '__esModule', { value: true }); - -var _setup = require('./_setup.js'); -var restArguments = require('./restArguments.js'); -var isObject = require('./isObject.js'); -var isNull = require('./isNull.js'); -var isUndefined = require('./isUndefined.js'); -var isBoolean = require('./isBoolean.js'); -var isElement = require('./isElement.js'); -var isString = require('./isString.js'); -var isNumber = require('./isNumber.js'); -var isDate = require('./isDate.js'); -var isRegExp = require('./isRegExp.js'); -var isError = require('./isError.js'); -var isSymbol = require('./isSymbol.js'); -var isArrayBuffer = require('./isArrayBuffer.js'); -var isDataView = require('./isDataView.js'); -var isArray = require('./isArray.js'); -var isFunction = require('./isFunction.js'); -var isArguments = require('./isArguments.js'); -var _isFinite = require('./isFinite.js'); -var _isNaN = require('./isNaN.js'); -var isTypedArray = require('./isTypedArray.js'); -var isEmpty = require('./isEmpty.js'); -var isMatch = require('./isMatch.js'); -var isEqual = require('./isEqual.js'); -var isMap = require('./isMap.js'); -var isWeakMap = require('./isWeakMap.js'); -var isSet = require('./isSet.js'); -var isWeakSet = require('./isWeakSet.js'); -var keys = require('./keys.js'); -var allKeys = require('./allKeys.js'); -var values = require('./values.js'); -var pairs = require('./pairs.js'); -var invert = require('./invert.js'); -var functions = require('./functions.js'); -var extend = require('./extend.js'); -var extendOwn = require('./extendOwn.js'); -var defaults = require('./defaults.js'); -var create = require('./create.js'); -var clone = require('./clone.js'); -var tap = require('./tap.js'); -var get = require('./get.js'); -var has = require('./has.js'); -var mapObject = require('./mapObject.js'); -var identity = require('./identity.js'); -var constant = require('./constant.js'); -var noop = require('./noop.js'); -var toPath = require('./toPath.js'); -var property = require('./property.js'); -var propertyOf = require('./propertyOf.js'); -var matcher = require('./matcher.js'); -var times = require('./times.js'); -var random = require('./random.js'); -var now = require('./now.js'); -var _escape = require('./escape.js'); -var _unescape = require('./unescape.js'); -var templateSettings = require('./templateSettings.js'); -var template = require('./template.js'); -var result = require('./result.js'); -var uniqueId = require('./uniqueId.js'); -var chain = require('./chain.js'); -var iteratee = require('./iteratee.js'); -var partial = require('./partial.js'); -var bind = require('./bind.js'); -var bindAll = require('./bindAll.js'); -var memoize = require('./memoize.js'); -var delay = require('./delay.js'); -var defer = require('./defer.js'); -var throttle = require('./throttle.js'); -var debounce = require('./debounce.js'); -var wrap = require('./wrap.js'); -var negate = require('./negate.js'); -var compose = require('./compose.js'); -var after = require('./after.js'); -var before = require('./before.js'); -var once = require('./once.js'); -var findKey = require('./findKey.js'); -var findIndex = require('./findIndex.js'); -var findLastIndex = require('./findLastIndex.js'); -var sortedIndex = require('./sortedIndex.js'); -var indexOf = require('./indexOf.js'); -var lastIndexOf = require('./lastIndexOf.js'); -var find = require('./find.js'); -var findWhere = require('./findWhere.js'); -var each = require('./each.js'); -var map = require('./map.js'); -var reduce = require('./reduce.js'); -var reduceRight = require('./reduceRight.js'); -var filter = require('./filter.js'); -var reject = require('./reject.js'); -var every = require('./every.js'); -var some = require('./some.js'); -var contains = require('./contains.js'); -var invoke = require('./invoke.js'); -var pluck = require('./pluck.js'); -var where = require('./where.js'); -var max = require('./max.js'); -var min = require('./min.js'); -var shuffle = require('./shuffle.js'); -var sample = require('./sample.js'); -var sortBy = require('./sortBy.js'); -var groupBy = require('./groupBy.js'); -var indexBy = require('./indexBy.js'); -var countBy = require('./countBy.js'); -var partition = require('./partition.js'); -var toArray = require('./toArray.js'); -var size = require('./size.js'); -var pick = require('./pick.js'); -var omit = require('./omit.js'); -var first = require('./first.js'); -var initial = require('./initial.js'); -var last = require('./last.js'); -var rest = require('./rest.js'); -var compact = require('./compact.js'); -var flatten = require('./flatten.js'); -var without = require('./without.js'); -var uniq = require('./uniq.js'); -var union = require('./union.js'); -var intersection = require('./intersection.js'); -var difference = require('./difference.js'); -var unzip = require('./unzip.js'); -var zip = require('./zip.js'); -var object = require('./object.js'); -var range = require('./range.js'); -var chunk = require('./chunk.js'); -var mixin = require('./mixin.js'); -require('./underscore-array-methods.js'); -var underscore = require('./underscore.js'); - -// Named Exports - -exports.VERSION = _setup.VERSION; -exports.restArguments = restArguments; -exports.isObject = isObject; -exports.isNull = isNull; -exports.isUndefined = isUndefined; -exports.isBoolean = isBoolean; -exports.isElement = isElement; -exports.isString = isString; -exports.isNumber = isNumber; -exports.isDate = isDate; -exports.isRegExp = isRegExp; -exports.isError = isError; -exports.isSymbol = isSymbol; -exports.isArrayBuffer = isArrayBuffer; -exports.isDataView = isDataView; -exports.isArray = isArray; -exports.isFunction = isFunction; -exports.isArguments = isArguments; -exports.isFinite = _isFinite; -exports.isNaN = _isNaN; -exports.isTypedArray = isTypedArray; -exports.isEmpty = isEmpty; -exports.isMatch = isMatch; -exports.isEqual = isEqual; -exports.isMap = isMap; -exports.isWeakMap = isWeakMap; -exports.isSet = isSet; -exports.isWeakSet = isWeakSet; -exports.keys = keys; -exports.allKeys = allKeys; -exports.values = values; -exports.pairs = pairs; -exports.invert = invert; -exports.functions = functions; -exports.methods = functions; -exports.extend = extend; -exports.assign = extendOwn; -exports.extendOwn = extendOwn; -exports.defaults = defaults; -exports.create = create; -exports.clone = clone; -exports.tap = tap; -exports.get = get; -exports.has = has; -exports.mapObject = mapObject; -exports.identity = identity; -exports.constant = constant; -exports.noop = noop; -exports.toPath = toPath; -exports.property = property; -exports.propertyOf = propertyOf; -exports.matcher = matcher; -exports.matches = matcher; -exports.times = times; -exports.random = random; -exports.now = now; -exports.escape = _escape; -exports.unescape = _unescape; -exports.templateSettings = templateSettings; -exports.template = template; -exports.result = result; -exports.uniqueId = uniqueId; -exports.chain = chain; -exports.iteratee = iteratee; -exports.partial = partial; -exports.bind = bind; -exports.bindAll = bindAll; -exports.memoize = memoize; -exports.delay = delay; -exports.defer = defer; -exports.throttle = throttle; -exports.debounce = debounce; -exports.wrap = wrap; -exports.negate = negate; -exports.compose = compose; -exports.after = after; -exports.before = before; -exports.once = once; -exports.findKey = findKey; -exports.findIndex = findIndex; -exports.findLastIndex = findLastIndex; -exports.sortedIndex = sortedIndex; -exports.indexOf = indexOf; -exports.lastIndexOf = lastIndexOf; -exports.detect = find; -exports.find = find; -exports.findWhere = findWhere; -exports.each = each; -exports.forEach = each; -exports.collect = map; -exports.map = map; -exports.foldl = reduce; -exports.inject = reduce; -exports.reduce = reduce; -exports.foldr = reduceRight; -exports.reduceRight = reduceRight; -exports.filter = filter; -exports.select = filter; -exports.reject = reject; -exports.all = every; -exports.every = every; -exports.any = some; -exports.some = some; -exports.contains = contains; -exports.include = contains; -exports.includes = contains; -exports.invoke = invoke; -exports.pluck = pluck; -exports.where = where; -exports.max = max; -exports.min = min; -exports.shuffle = shuffle; -exports.sample = sample; -exports.sortBy = sortBy; -exports.groupBy = groupBy; -exports.indexBy = indexBy; -exports.countBy = countBy; -exports.partition = partition; -exports.toArray = toArray; -exports.size = size; -exports.pick = pick; -exports.omit = omit; -exports.first = first; -exports.head = first; -exports.take = first; -exports.initial = initial; -exports.last = last; -exports.drop = rest; -exports.rest = rest; -exports.tail = rest; -exports.compact = compact; -exports.flatten = flatten; -exports.without = without; -exports.uniq = uniq; -exports.unique = uniq; -exports.union = union; -exports.intersection = intersection; -exports.difference = difference; -exports.transpose = unzip; -exports.unzip = unzip; -exports.zip = zip; -exports.object = object; -exports.range = range; -exports.chunk = chunk; -exports.mixin = mixin; -exports.default = underscore; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/indexBy.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/indexBy.js deleted file mode 100644 index 89ff21af..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/indexBy.js +++ /dev/null @@ -1,9 +0,0 @@ -var _group = require('./_group.js'); - -// Indexes the object's values by a criterion, similar to `_.groupBy`, but for -// when you know that your index values will be unique. -var indexBy = _group(function(result, value, key) { - result[key] = value; -}); - -module.exports = indexBy; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/indexOf.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/indexOf.js deleted file mode 100644 index ef3352b0..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/indexOf.js +++ /dev/null @@ -1,11 +0,0 @@ -var sortedIndex = require('./sortedIndex.js'); -var findIndex = require('./findIndex.js'); -var _createIndexFinder = require('./_createIndexFinder.js'); - -// Return the position of the first occurrence of an item in an array, -// or -1 if the item is not included in the array. -// If the array is large and already in sort order, pass `true` -// for **isSorted** to use binary search. -var indexOf = _createIndexFinder(1, findIndex, sortedIndex); - -module.exports = indexOf; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/initial.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/initial.js deleted file mode 100644 index 9db2cd28..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/initial.js +++ /dev/null @@ -1,10 +0,0 @@ -var _setup = require('./_setup.js'); - -// Returns everything but the last entry of the array. Especially useful on -// the arguments object. Passing **n** will return all the values in -// the array, excluding the last N. -function initial(array, n, guard) { - return _setup.slice.call(array, 0, Math.max(0, array.length - (n == null || guard ? 1 : n))); -} - -module.exports = initial; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/intersection.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/intersection.js deleted file mode 100644 index e28fe2fd..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/intersection.js +++ /dev/null @@ -1,21 +0,0 @@ -var _getLength = require('./_getLength.js'); -var contains = require('./contains.js'); - -// Produce an array that contains every item shared between all the -// passed-in arrays. -function intersection(array) { - var result = []; - var argsLength = arguments.length; - for (var i = 0, length = _getLength(array); i < length; i++) { - var item = array[i]; - if (contains(result, item)) continue; - var j; - for (j = 1; j < argsLength; j++) { - if (!contains(arguments[j], item)) break; - } - if (j === argsLength) result.push(item); - } - return result; -} - -module.exports = intersection; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/invert.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/invert.js deleted file mode 100644 index a0c51506..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/invert.js +++ /dev/null @@ -1,13 +0,0 @@ -var keys = require('./keys.js'); - -// Invert the keys and values of an object. The values must be serializable. -function invert(obj) { - var result = {}; - var _keys = keys(obj); - for (var i = 0, length = _keys.length; i < length; i++) { - result[obj[_keys[i]]] = _keys[i]; - } - return result; -} - -module.exports = invert; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/invoke.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/invoke.js deleted file mode 100644 index e2f1267c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/invoke.js +++ /dev/null @@ -1,30 +0,0 @@ -var restArguments = require('./restArguments.js'); -var isFunction = require('./isFunction.js'); -var map = require('./map.js'); -var _deepGet = require('./_deepGet.js'); -var _toPath = require('./_toPath.js'); - -// Invoke a method (with arguments) on every item in a collection. -var invoke = restArguments(function(obj, path, args) { - var contextPath, func; - if (isFunction(path)) { - func = path; - } else { - path = _toPath(path); - contextPath = path.slice(0, -1); - path = path[path.length - 1]; - } - return map(obj, function(context) { - var method = func; - if (!method) { - if (contextPath && contextPath.length) { - context = _deepGet(context, contextPath); - } - if (context == null) return void 0; - method = context[path]; - } - return method == null ? method : method.apply(context, args); - }); -}); - -module.exports = invoke; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/isArguments.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/isArguments.js deleted file mode 100644 index 8b33b111..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/isArguments.js +++ /dev/null @@ -1,18 +0,0 @@ -var _tagTester = require('./_tagTester.js'); -var _has = require('./_has.js'); - -var isArguments = _tagTester('Arguments'); - -// Define a fallback version of the method in browsers (ahem, IE < 9), where -// there isn't any inspectable "Arguments" type. -(function() { - if (!isArguments(arguments)) { - isArguments = function(obj) { - return _has(obj, 'callee'); - }; - } -}()); - -var isArguments$1 = isArguments; - -module.exports = isArguments$1; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/isArray.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/isArray.js deleted file mode 100644 index abcdad3a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/isArray.js +++ /dev/null @@ -1,8 +0,0 @@ -var _setup = require('./_setup.js'); -var _tagTester = require('./_tagTester.js'); - -// Is a given value an array? -// Delegates to ECMA5's native `Array.isArray`. -var isArray = _setup.nativeIsArray || _tagTester('Array'); - -module.exports = isArray; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/isArrayBuffer.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/isArrayBuffer.js deleted file mode 100644 index c69523f3..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/isArrayBuffer.js +++ /dev/null @@ -1,5 +0,0 @@ -var _tagTester = require('./_tagTester.js'); - -var isArrayBuffer = _tagTester('ArrayBuffer'); - -module.exports = isArrayBuffer; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/isBoolean.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/isBoolean.js deleted file mode 100644 index 29b82d81..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/isBoolean.js +++ /dev/null @@ -1,8 +0,0 @@ -var _setup = require('./_setup.js'); - -// Is a given value a boolean? -function isBoolean(obj) { - return obj === true || obj === false || _setup.toString.call(obj) === '[object Boolean]'; -} - -module.exports = isBoolean; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/isDataView.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/isDataView.js deleted file mode 100644 index e74b6ec2..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/isDataView.js +++ /dev/null @@ -1,16 +0,0 @@ -var _tagTester = require('./_tagTester.js'); -var isFunction = require('./isFunction.js'); -var isArrayBuffer = require('./isArrayBuffer.js'); -var _stringTagBug = require('./_stringTagBug.js'); - -var isDataView = _tagTester('DataView'); - -// In IE 10 - Edge 13, we need a different heuristic -// to determine whether an object is a `DataView`. -function ie10IsDataView(obj) { - return obj != null && isFunction(obj.getInt8) && isArrayBuffer(obj.buffer); -} - -var isDataView$1 = (_stringTagBug.hasStringTagBug ? ie10IsDataView : isDataView); - -module.exports = isDataView$1; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/isDate.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/isDate.js deleted file mode 100644 index e342bc90..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/isDate.js +++ /dev/null @@ -1,5 +0,0 @@ -var _tagTester = require('./_tagTester.js'); - -var isDate = _tagTester('Date'); - -module.exports = isDate; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/isElement.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/isElement.js deleted file mode 100644 index 13b63ccf..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/isElement.js +++ /dev/null @@ -1,6 +0,0 @@ -// Is a given value a DOM element? -function isElement(obj) { - return !!(obj && obj.nodeType === 1); -} - -module.exports = isElement; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/isEmpty.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/isEmpty.js deleted file mode 100644 index 2f1e315a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/isEmpty.js +++ /dev/null @@ -1,20 +0,0 @@ -var _getLength = require('./_getLength.js'); -var isArray = require('./isArray.js'); -var isString = require('./isString.js'); -var isArguments = require('./isArguments.js'); -var keys = require('./keys.js'); - -// Is a given array, string, or object empty? -// An "empty" object has no enumerable own-properties. -function isEmpty(obj) { - if (obj == null) return true; - // Skip the more expensive `toString`-based type checks if `obj` has no - // `.length`. - var length = _getLength(obj); - if (typeof length == 'number' && ( - isArray(obj) || isString(obj) || isArguments(obj) - )) return length === 0; - return _getLength(keys(obj)) === 0; -} - -module.exports = isEmpty; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/isEqual.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/isEqual.js deleted file mode 100644 index 34bf5e62..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/isEqual.js +++ /dev/null @@ -1,140 +0,0 @@ -var underscore = require('./underscore.js'); -var _setup = require('./_setup.js'); -var _getByteLength = require('./_getByteLength.js'); -var isTypedArray = require('./isTypedArray.js'); -var isFunction = require('./isFunction.js'); -var _stringTagBug = require('./_stringTagBug.js'); -var isDataView = require('./isDataView.js'); -var keys = require('./keys.js'); -var _has = require('./_has.js'); -var _toBufferView = require('./_toBufferView.js'); - -// We use this string twice, so give it a name for minification. -var tagDataView = '[object DataView]'; - -// Internal recursive comparison function for `_.isEqual`. -function eq(a, b, aStack, bStack) { - // Identical objects are equal. `0 === -0`, but they aren't identical. - // See the [Harmony `egal` proposal](https://wiki.ecmascript.org/doku.php?id=harmony:egal). - if (a === b) return a !== 0 || 1 / a === 1 / b; - // `null` or `undefined` only equal to itself (strict comparison). - if (a == null || b == null) return false; - // `NaN`s are equivalent, but non-reflexive. - if (a !== a) return b !== b; - // Exhaust primitive checks - var type = typeof a; - if (type !== 'function' && type !== 'object' && typeof b != 'object') return false; - return deepEq(a, b, aStack, bStack); -} - -// Internal recursive comparison function for `_.isEqual`. -function deepEq(a, b, aStack, bStack) { - // Unwrap any wrapped objects. - if (a instanceof underscore) a = a._wrapped; - if (b instanceof underscore) b = b._wrapped; - // Compare `[[Class]]` names. - var className = _setup.toString.call(a); - if (className !== _setup.toString.call(b)) return false; - // Work around a bug in IE 10 - Edge 13. - if (_stringTagBug.hasStringTagBug && className == '[object Object]' && isDataView(a)) { - if (!isDataView(b)) return false; - className = tagDataView; - } - switch (className) { - // These types are compared by value. - case '[object RegExp]': - // RegExps are coerced to strings for comparison (Note: '' + /a/i === '/a/i') - case '[object String]': - // Primitives and their corresponding object wrappers are equivalent; thus, `"5"` is - // equivalent to `new String("5")`. - return '' + a === '' + b; - case '[object Number]': - // `NaN`s are equivalent, but non-reflexive. - // Object(NaN) is equivalent to NaN. - if (+a !== +a) return +b !== +b; - // An `egal` comparison is performed for other numeric values. - return +a === 0 ? 1 / +a === 1 / b : +a === +b; - case '[object Date]': - case '[object Boolean]': - // Coerce dates and booleans to numeric primitive values. Dates are compared by their - // millisecond representations. Note that invalid dates with millisecond representations - // of `NaN` are not equivalent. - return +a === +b; - case '[object Symbol]': - return _setup.SymbolProto.valueOf.call(a) === _setup.SymbolProto.valueOf.call(b); - case '[object ArrayBuffer]': - case tagDataView: - // Coerce to typed array so we can fall through. - return deepEq(_toBufferView(a), _toBufferView(b), aStack, bStack); - } - - var areArrays = className === '[object Array]'; - if (!areArrays && isTypedArray(a)) { - var byteLength = _getByteLength(a); - if (byteLength !== _getByteLength(b)) return false; - if (a.buffer === b.buffer && a.byteOffset === b.byteOffset) return true; - areArrays = true; - } - if (!areArrays) { - if (typeof a != 'object' || typeof b != 'object') return false; - - // Objects with different constructors are not equivalent, but `Object`s or `Array`s - // from different frames are. - var aCtor = a.constructor, bCtor = b.constructor; - if (aCtor !== bCtor && !(isFunction(aCtor) && aCtor instanceof aCtor && - isFunction(bCtor) && bCtor instanceof bCtor) - && ('constructor' in a && 'constructor' in b)) { - return false; - } - } - // Assume equality for cyclic structures. The algorithm for detecting cyclic - // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`. - - // Initializing stack of traversed objects. - // It's done here since we only need them for objects and arrays comparison. - aStack = aStack || []; - bStack = bStack || []; - var length = aStack.length; - while (length--) { - // Linear search. Performance is inversely proportional to the number of - // unique nested structures. - if (aStack[length] === a) return bStack[length] === b; - } - - // Add the first object to the stack of traversed objects. - aStack.push(a); - bStack.push(b); - - // Recursively compare objects and arrays. - if (areArrays) { - // Compare array lengths to determine if a deep comparison is necessary. - length = a.length; - if (length !== b.length) return false; - // Deep compare the contents, ignoring non-numeric properties. - while (length--) { - if (!eq(a[length], b[length], aStack, bStack)) return false; - } - } else { - // Deep compare objects. - var _keys = keys(a), key; - length = _keys.length; - // Ensure that both objects contain the same number of properties before comparing deep equality. - if (keys(b).length !== length) return false; - while (length--) { - // Deep compare each member - key = _keys[length]; - if (!(_has(b, key) && eq(a[key], b[key], aStack, bStack))) return false; - } - } - // Remove the first object from the stack of traversed objects. - aStack.pop(); - bStack.pop(); - return true; -} - -// Perform a deep comparison to check if two objects are equal. -function isEqual(a, b) { - return eq(a, b); -} - -module.exports = isEqual; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/isError.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/isError.js deleted file mode 100644 index a2df9142..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/isError.js +++ /dev/null @@ -1,5 +0,0 @@ -var _tagTester = require('./_tagTester.js'); - -var isError = _tagTester('Error'); - -module.exports = isError; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/isFinite.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/isFinite.js deleted file mode 100644 index 5359c3a6..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/isFinite.js +++ /dev/null @@ -1,9 +0,0 @@ -var _setup = require('./_setup.js'); -var isSymbol = require('./isSymbol.js'); - -// Is a given object a finite number? -function isFinite(obj) { - return !isSymbol(obj) && _setup._isFinite(obj) && !isNaN(parseFloat(obj)); -} - -module.exports = isFinite; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/isFunction.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/isFunction.js deleted file mode 100644 index a1c5968a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/isFunction.js +++ /dev/null @@ -1,17 +0,0 @@ -var _tagTester = require('./_tagTester.js'); -var _setup = require('./_setup.js'); - -var isFunction = _tagTester('Function'); - -// Optimize `isFunction` if appropriate. Work around some `typeof` bugs in old -// v8, IE 11 (#1621), Safari 8 (#1929), and PhantomJS (#2236). -var nodelist = _setup.root.document && _setup.root.document.childNodes; -if (typeof /./ != 'function' && typeof Int8Array != 'object' && typeof nodelist != 'function') { - isFunction = function(obj) { - return typeof obj == 'function' || false; - }; -} - -var isFunction$1 = isFunction; - -module.exports = isFunction$1; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/isMap.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/isMap.js deleted file mode 100644 index a7dfb03b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/isMap.js +++ /dev/null @@ -1,7 +0,0 @@ -var _tagTester = require('./_tagTester.js'); -var _stringTagBug = require('./_stringTagBug.js'); -var _methodFingerprint = require('./_methodFingerprint.js'); - -var isMap = _stringTagBug.isIE11 ? _methodFingerprint.ie11fingerprint(_methodFingerprint.mapMethods) : _tagTester('Map'); - -module.exports = isMap; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/isMatch.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/isMatch.js deleted file mode 100644 index 7b6c5000..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/isMatch.js +++ /dev/null @@ -1,15 +0,0 @@ -var keys = require('./keys.js'); - -// Returns whether an object has a given set of `key:value` pairs. -function isMatch(object, attrs) { - var _keys = keys(attrs), length = _keys.length; - if (object == null) return !length; - var obj = Object(object); - for (var i = 0; i < length; i++) { - var key = _keys[i]; - if (attrs[key] !== obj[key] || !(key in obj)) return false; - } - return true; -} - -module.exports = isMatch; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/isNaN.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/isNaN.js deleted file mode 100644 index f6ade7e8..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/isNaN.js +++ /dev/null @@ -1,9 +0,0 @@ -var _setup = require('./_setup.js'); -var isNumber = require('./isNumber.js'); - -// Is the given value `NaN`? -function isNaN(obj) { - return isNumber(obj) && _setup._isNaN(obj); -} - -module.exports = isNaN; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/isNull.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/isNull.js deleted file mode 100644 index 43705a42..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/isNull.js +++ /dev/null @@ -1,6 +0,0 @@ -// Is a given value equal to null? -function isNull(obj) { - return obj === null; -} - -module.exports = isNull; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/isNumber.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/isNumber.js deleted file mode 100644 index 52d5b448..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/isNumber.js +++ /dev/null @@ -1,5 +0,0 @@ -var _tagTester = require('./_tagTester.js'); - -var isNumber = _tagTester('Number'); - -module.exports = isNumber; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/isObject.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/isObject.js deleted file mode 100644 index 6f9ae3b9..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/isObject.js +++ /dev/null @@ -1,7 +0,0 @@ -// Is a given variable an object? -function isObject(obj) { - var type = typeof obj; - return type === 'function' || (type === 'object' && !!obj); -} - -module.exports = isObject; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/isRegExp.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/isRegExp.js deleted file mode 100644 index 3026bab9..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/isRegExp.js +++ /dev/null @@ -1,5 +0,0 @@ -var _tagTester = require('./_tagTester.js'); - -var isRegExp = _tagTester('RegExp'); - -module.exports = isRegExp; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/isSet.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/isSet.js deleted file mode 100644 index a28c1d94..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/isSet.js +++ /dev/null @@ -1,7 +0,0 @@ -var _tagTester = require('./_tagTester.js'); -var _stringTagBug = require('./_stringTagBug.js'); -var _methodFingerprint = require('./_methodFingerprint.js'); - -var isSet = _stringTagBug.isIE11 ? _methodFingerprint.ie11fingerprint(_methodFingerprint.setMethods) : _tagTester('Set'); - -module.exports = isSet; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/isString.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/isString.js deleted file mode 100644 index c7c38874..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/isString.js +++ /dev/null @@ -1,5 +0,0 @@ -var _tagTester = require('./_tagTester.js'); - -var isString = _tagTester('String'); - -module.exports = isString; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/isSymbol.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/isSymbol.js deleted file mode 100644 index 140a54ef..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/isSymbol.js +++ /dev/null @@ -1,5 +0,0 @@ -var _tagTester = require('./_tagTester.js'); - -var isSymbol = _tagTester('Symbol'); - -module.exports = isSymbol; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/isTypedArray.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/isTypedArray.js deleted file mode 100644 index c3b467f0..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/isTypedArray.js +++ /dev/null @@ -1,17 +0,0 @@ -var _setup = require('./_setup.js'); -var isDataView = require('./isDataView.js'); -var constant = require('./constant.js'); -var _isBufferLike = require('./_isBufferLike.js'); - -// Is a given value a typed array? -var typedArrayPattern = /\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/; -function isTypedArray(obj) { - // `ArrayBuffer.isView` is the most future-proof, so use it when available. - // Otherwise, fall back on the above regular expression. - return _setup.nativeIsView ? (_setup.nativeIsView(obj) && !isDataView(obj)) : - _isBufferLike(obj) && typedArrayPattern.test(_setup.toString.call(obj)); -} - -var isTypedArray$1 = _setup.supportsArrayBuffer ? isTypedArray : constant(false); - -module.exports = isTypedArray$1; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/isUndefined.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/isUndefined.js deleted file mode 100644 index e59c968b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/isUndefined.js +++ /dev/null @@ -1,6 +0,0 @@ -// Is a given variable undefined? -function isUndefined(obj) { - return obj === void 0; -} - -module.exports = isUndefined; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/isWeakMap.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/isWeakMap.js deleted file mode 100644 index ee3c10e7..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/isWeakMap.js +++ /dev/null @@ -1,7 +0,0 @@ -var _tagTester = require('./_tagTester.js'); -var _stringTagBug = require('./_stringTagBug.js'); -var _methodFingerprint = require('./_methodFingerprint.js'); - -var isWeakMap = _stringTagBug.isIE11 ? _methodFingerprint.ie11fingerprint(_methodFingerprint.weakMapMethods) : _tagTester('WeakMap'); - -module.exports = isWeakMap; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/isWeakSet.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/isWeakSet.js deleted file mode 100644 index 06104ea6..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/isWeakSet.js +++ /dev/null @@ -1,5 +0,0 @@ -var _tagTester = require('./_tagTester.js'); - -var isWeakSet = _tagTester('WeakSet'); - -module.exports = isWeakSet; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/iteratee.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/iteratee.js deleted file mode 100644 index 52b52758..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/iteratee.js +++ /dev/null @@ -1,12 +0,0 @@ -var underscore = require('./underscore.js'); -var _baseIteratee = require('./_baseIteratee.js'); - -// External wrapper for our callback generator. Users may customize -// `_.iteratee` if they want additional predicate/iteratee shorthand styles. -// This abstraction hides the internal-only `argCount` argument. -function iteratee(value, context) { - return _baseIteratee(value, context, Infinity); -} -underscore.iteratee = iteratee; - -module.exports = iteratee; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/keys.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/keys.js deleted file mode 100644 index 9caff250..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/keys.js +++ /dev/null @@ -1,18 +0,0 @@ -var isObject = require('./isObject.js'); -var _setup = require('./_setup.js'); -var _has = require('./_has.js'); -var _collectNonEnumProps = require('./_collectNonEnumProps.js'); - -// Retrieve the names of an object's own properties. -// Delegates to **ECMAScript 5**'s native `Object.keys`. -function keys(obj) { - if (!isObject(obj)) return []; - if (_setup.nativeKeys) return _setup.nativeKeys(obj); - var keys = []; - for (var key in obj) if (_has(obj, key)) keys.push(key); - // Ahem, IE < 9. - if (_setup.hasEnumBug) _collectNonEnumProps(obj, keys); - return keys; -} - -module.exports = keys; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/last.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/last.js deleted file mode 100644 index 9a9ff6d1..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/last.js +++ /dev/null @@ -1,11 +0,0 @@ -var rest = require('./rest.js'); - -// Get the last element of an array. Passing **n** will return the last N -// values in the array. -function last(array, n, guard) { - if (array == null || array.length < 1) return n == null || guard ? void 0 : []; - if (n == null || guard) return array[array.length - 1]; - return rest(array, Math.max(0, array.length - n)); -} - -module.exports = last; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/lastIndexOf.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/lastIndexOf.js deleted file mode 100644 index d7af8580..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/lastIndexOf.js +++ /dev/null @@ -1,8 +0,0 @@ -var findLastIndex = require('./findLastIndex.js'); -var _createIndexFinder = require('./_createIndexFinder.js'); - -// Return the position of the last occurrence of an item in an array, -// or -1 if the item is not included in the array. -var lastIndexOf = _createIndexFinder(-1, findLastIndex); - -module.exports = lastIndexOf; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/map.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/map.js deleted file mode 100644 index e44d51d7..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/map.js +++ /dev/null @@ -1,18 +0,0 @@ -var _cb = require('./_cb.js'); -var _isArrayLike = require('./_isArrayLike.js'); -var keys = require('./keys.js'); - -// Return the results of applying the iteratee to each element. -function map(obj, iteratee, context) { - iteratee = _cb(iteratee, context); - var _keys = !_isArrayLike(obj) && keys(obj), - length = (_keys || obj).length, - results = Array(length); - for (var index = 0; index < length; index++) { - var currentKey = _keys ? _keys[index] : index; - results[index] = iteratee(obj[currentKey], currentKey, obj); - } - return results; -} - -module.exports = map; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/mapObject.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/mapObject.js deleted file mode 100644 index 883caa75..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/mapObject.js +++ /dev/null @@ -1,18 +0,0 @@ -var _cb = require('./_cb.js'); -var keys = require('./keys.js'); - -// Returns the results of applying the `iteratee` to each element of `obj`. -// In contrast to `_.map` it returns an object. -function mapObject(obj, iteratee, context) { - iteratee = _cb(iteratee, context); - var _keys = keys(obj), - length = _keys.length, - results = {}; - for (var index = 0; index < length; index++) { - var currentKey = _keys[index]; - results[currentKey] = iteratee(obj[currentKey], currentKey, obj); - } - return results; -} - -module.exports = mapObject; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/matcher.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/matcher.js deleted file mode 100644 index 579f8a8d..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/matcher.js +++ /dev/null @@ -1,13 +0,0 @@ -var extendOwn = require('./extendOwn.js'); -var isMatch = require('./isMatch.js'); - -// Returns a predicate for checking whether an object has a given set of -// `key:value` pairs. -function matcher(attrs) { - attrs = extendOwn({}, attrs); - return function(obj) { - return isMatch(obj, attrs); - }; -} - -module.exports = matcher; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/max.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/max.js deleted file mode 100644 index 2b06f514..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/max.js +++ /dev/null @@ -1,31 +0,0 @@ -var _isArrayLike = require('./_isArrayLike.js'); -var values = require('./values.js'); -var _cb = require('./_cb.js'); -var each = require('./each.js'); - -// Return the maximum element (or element-based computation). -function max(obj, iteratee, context) { - var result = -Infinity, lastComputed = -Infinity, - value, computed; - if (iteratee == null || (typeof iteratee == 'number' && typeof obj[0] != 'object' && obj != null)) { - obj = _isArrayLike(obj) ? obj : values(obj); - for (var i = 0, length = obj.length; i < length; i++) { - value = obj[i]; - if (value != null && value > result) { - result = value; - } - } - } else { - iteratee = _cb(iteratee, context); - each(obj, function(v, index, list) { - computed = iteratee(v, index, list); - if (computed > lastComputed || (computed === -Infinity && result === -Infinity)) { - result = v; - lastComputed = computed; - } - }); - } - return result; -} - -module.exports = max; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/memoize.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/memoize.js deleted file mode 100644 index 9d5b4e2d..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/memoize.js +++ /dev/null @@ -1,15 +0,0 @@ -var _has = require('./_has.js'); - -// Memoize an expensive function by storing its results. -function memoize(func, hasher) { - var memoize = function(key) { - var cache = memoize.cache; - var address = '' + (hasher ? hasher.apply(this, arguments) : key); - if (!_has(cache, address)) cache[address] = func.apply(this, arguments); - return cache[address]; - }; - memoize.cache = {}; - return memoize; -} - -module.exports = memoize; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/min.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/min.js deleted file mode 100644 index 17de77dd..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/min.js +++ /dev/null @@ -1,31 +0,0 @@ -var _isArrayLike = require('./_isArrayLike.js'); -var values = require('./values.js'); -var _cb = require('./_cb.js'); -var each = require('./each.js'); - -// Return the minimum element (or element-based computation). -function min(obj, iteratee, context) { - var result = Infinity, lastComputed = Infinity, - value, computed; - if (iteratee == null || (typeof iteratee == 'number' && typeof obj[0] != 'object' && obj != null)) { - obj = _isArrayLike(obj) ? obj : values(obj); - for (var i = 0, length = obj.length; i < length; i++) { - value = obj[i]; - if (value != null && value < result) { - result = value; - } - } - } else { - iteratee = _cb(iteratee, context); - each(obj, function(v, index, list) { - computed = iteratee(v, index, list); - if (computed < lastComputed || (computed === Infinity && result === Infinity)) { - result = v; - lastComputed = computed; - } - }); - } - return result; -} - -module.exports = min; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/mixin.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/mixin.js deleted file mode 100644 index a0fbb3a4..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/mixin.js +++ /dev/null @@ -1,20 +0,0 @@ -var underscore = require('./underscore.js'); -var each = require('./each.js'); -var functions = require('./functions.js'); -var _setup = require('./_setup.js'); -var _chainResult = require('./_chainResult.js'); - -// Add your own custom functions to the Underscore object. -function mixin(obj) { - each(functions(obj), function(name) { - var func = underscore[name] = obj[name]; - underscore.prototype[name] = function() { - var args = [this._wrapped]; - _setup.push.apply(args, arguments); - return _chainResult(this, func.apply(underscore, args)); - }; - }); - return underscore; -} - -module.exports = mixin; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/negate.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/negate.js deleted file mode 100644 index d4a22ed4..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/negate.js +++ /dev/null @@ -1,8 +0,0 @@ -// Returns a negated version of the passed-in predicate. -function negate(predicate) { - return function() { - return !predicate.apply(this, arguments); - }; -} - -module.exports = negate; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/noop.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/noop.js deleted file mode 100644 index 4d355ba5..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/noop.js +++ /dev/null @@ -1,4 +0,0 @@ -// Predicate-generating function. Often useful outside of Underscore. -function noop(){} - -module.exports = noop; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/now.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/now.js deleted file mode 100644 index 746e66e6..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/now.js +++ /dev/null @@ -1,6 +0,0 @@ -// A (possibly faster) way to get the current timestamp as an integer. -var now = Date.now || function() { - return new Date().getTime(); -}; - -module.exports = now; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/object.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/object.js deleted file mode 100644 index 583b3208..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/object.js +++ /dev/null @@ -1,18 +0,0 @@ -var _getLength = require('./_getLength.js'); - -// Converts lists into objects. Pass either a single array of `[key, value]` -// pairs, or two parallel arrays of the same length -- one of keys, and one of -// the corresponding values. Passing by pairs is the reverse of `_.pairs`. -function object(list, values) { - var result = {}; - for (var i = 0, length = _getLength(list); i < length; i++) { - if (values) { - result[list[i]] = values[i]; - } else { - result[list[i][0]] = list[i][1]; - } - } - return result; -} - -module.exports = object; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/omit.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/omit.js deleted file mode 100644 index b80651bf..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/omit.js +++ /dev/null @@ -1,24 +0,0 @@ -var restArguments = require('./restArguments.js'); -var isFunction = require('./isFunction.js'); -var negate = require('./negate.js'); -var map = require('./map.js'); -var _flatten = require('./_flatten.js'); -var contains = require('./contains.js'); -var pick = require('./pick.js'); - -// Return a copy of the object without the disallowed properties. -var omit = restArguments(function(obj, keys) { - var iteratee = keys[0], context; - if (isFunction(iteratee)) { - iteratee = negate(iteratee); - if (keys.length > 1) context = keys[1]; - } else { - keys = map(_flatten(keys, false, false), String); - iteratee = function(value, key) { - return !contains(keys, key); - }; - } - return pick(obj, iteratee, context); -}); - -module.exports = omit; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/once.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/once.js deleted file mode 100644 index d9cb81da..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/once.js +++ /dev/null @@ -1,8 +0,0 @@ -var partial = require('./partial.js'); -var before = require('./before.js'); - -// Returns a function that will be executed at most one time, no matter how -// often you call it. Useful for lazy initialization. -var once = partial(before, 2); - -module.exports = once; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/pairs.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/pairs.js deleted file mode 100644 index 399243e0..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/pairs.js +++ /dev/null @@ -1,15 +0,0 @@ -var keys = require('./keys.js'); - -// Convert an object into a list of `[key, value]` pairs. -// The opposite of `_.object` with one argument. -function pairs(obj) { - var _keys = keys(obj); - var length = _keys.length; - var pairs = Array(length); - for (var i = 0; i < length; i++) { - pairs[i] = [_keys[i], obj[_keys[i]]]; - } - return pairs; -} - -module.exports = pairs; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/partial.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/partial.js deleted file mode 100644 index d6f5bd80..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/partial.js +++ /dev/null @@ -1,25 +0,0 @@ -var restArguments = require('./restArguments.js'); -var _executeBound = require('./_executeBound.js'); -var underscore = require('./underscore.js'); - -// Partially apply a function by creating a version that has had some of its -// arguments pre-filled, without changing its dynamic `this` context. `_` acts -// as a placeholder by default, allowing any combination of arguments to be -// pre-filled. Set `_.partial.placeholder` for a custom placeholder argument. -var partial = restArguments(function(func, boundArgs) { - var placeholder = partial.placeholder; - var bound = function() { - var position = 0, length = boundArgs.length; - var args = Array(length); - for (var i = 0; i < length; i++) { - args[i] = boundArgs[i] === placeholder ? arguments[position++] : boundArgs[i]; - } - while (position < arguments.length) args.push(arguments[position++]); - return _executeBound(func, bound, this, this, args); - }; - return bound; -}); - -partial.placeholder = underscore; - -module.exports = partial; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/partition.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/partition.js deleted file mode 100644 index 294786fe..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/partition.js +++ /dev/null @@ -1,9 +0,0 @@ -var _group = require('./_group.js'); - -// Split a collection into two arrays: one whose elements all pass the given -// truth test, and one whose elements all do not pass the truth test. -var partition = _group(function(result, value, pass) { - result[pass ? 0 : 1].push(value); -}, true); - -module.exports = partition; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/pick.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/pick.js deleted file mode 100644 index df742202..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/pick.js +++ /dev/null @@ -1,28 +0,0 @@ -var restArguments = require('./restArguments.js'); -var isFunction = require('./isFunction.js'); -var _optimizeCb = require('./_optimizeCb.js'); -var allKeys = require('./allKeys.js'); -var _keyInObj = require('./_keyInObj.js'); -var _flatten = require('./_flatten.js'); - -// Return a copy of the object only containing the allowed properties. -var pick = restArguments(function(obj, keys) { - var result = {}, iteratee = keys[0]; - if (obj == null) return result; - if (isFunction(iteratee)) { - if (keys.length > 1) iteratee = _optimizeCb(iteratee, keys[1]); - keys = allKeys(obj); - } else { - iteratee = _keyInObj; - keys = _flatten(keys, false, false); - obj = Object(obj); - } - for (var i = 0, length = keys.length; i < length; i++) { - var key = keys[i]; - var value = obj[key]; - if (iteratee(value, key, obj)) result[key] = value; - } - return result; -}); - -module.exports = pick; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/pluck.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/pluck.js deleted file mode 100644 index 043c1b40..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/pluck.js +++ /dev/null @@ -1,9 +0,0 @@ -var map = require('./map.js'); -var property = require('./property.js'); - -// Convenience version of a common use case of `_.map`: fetching a property. -function pluck(obj, key) { - return map(obj, property(key)); -} - -module.exports = pluck; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/property.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/property.js deleted file mode 100644 index e7b069d6..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/property.js +++ /dev/null @@ -1,13 +0,0 @@ -var _deepGet = require('./_deepGet.js'); -var _toPath = require('./_toPath.js'); - -// Creates a function that, when passed an object, will traverse that object’s -// properties down the given `path`, specified as an array of keys or indices. -function property(path) { - path = _toPath(path); - return function(obj) { - return _deepGet(obj, path); - }; -} - -module.exports = property; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/propertyOf.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/propertyOf.js deleted file mode 100644 index 2039a32e..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/propertyOf.js +++ /dev/null @@ -1,12 +0,0 @@ -var noop = require('./noop.js'); -var get = require('./get.js'); - -// Generates a function for a given object that returns a given property. -function propertyOf(obj) { - if (obj == null) return noop; - return function(path) { - return get(obj, path); - }; -} - -module.exports = propertyOf; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/random.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/random.js deleted file mode 100644 index cb9a0abc..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/random.js +++ /dev/null @@ -1,10 +0,0 @@ -// Return a random integer between `min` and `max` (inclusive). -function random(min, max) { - if (max == null) { - max = min; - min = 0; - } - return min + Math.floor(Math.random() * (max - min + 1)); -} - -module.exports = random; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/range.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/range.js deleted file mode 100644 index 7a5a2413..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/range.js +++ /dev/null @@ -1,23 +0,0 @@ -// Generate an integer Array containing an arithmetic progression. A port of -// the native Python `range()` function. See -// [the Python documentation](https://docs.python.org/library/functions.html#range). -function range(start, stop, step) { - if (stop == null) { - stop = start || 0; - start = 0; - } - if (!step) { - step = stop < start ? -1 : 1; - } - - var length = Math.max(Math.ceil((stop - start) / step), 0); - var range = Array(length); - - for (var idx = 0; idx < length; idx++, start += step) { - range[idx] = start; - } - - return range; -} - -module.exports = range; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/reduce.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/reduce.js deleted file mode 100644 index 170b1b09..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/reduce.js +++ /dev/null @@ -1,7 +0,0 @@ -var _createReduce = require('./_createReduce.js'); - -// **Reduce** builds up a single result from a list of values, aka `inject`, -// or `foldl`. -var reduce = _createReduce(1); - -module.exports = reduce; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/reduceRight.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/reduceRight.js deleted file mode 100644 index 52413d79..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/reduceRight.js +++ /dev/null @@ -1,6 +0,0 @@ -var _createReduce = require('./_createReduce.js'); - -// The right-associative version of reduce, also known as `foldr`. -var reduceRight = _createReduce(-1); - -module.exports = reduceRight; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/reject.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/reject.js deleted file mode 100644 index 8608b63c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/reject.js +++ /dev/null @@ -1,10 +0,0 @@ -var filter = require('./filter.js'); -var negate = require('./negate.js'); -var _cb = require('./_cb.js'); - -// Return all the elements for which a truth test fails. -function reject(obj, predicate, context) { - return filter(obj, negate(_cb(predicate)), context); -} - -module.exports = reject; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/rest.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/rest.js deleted file mode 100644 index 4ce76623..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/rest.js +++ /dev/null @@ -1,10 +0,0 @@ -var _setup = require('./_setup.js'); - -// Returns everything but the first entry of the `array`. Especially useful on -// the `arguments` object. Passing an **n** will return the rest N values in the -// `array`. -function rest(array, n, guard) { - return _setup.slice.call(array, n == null || guard ? 1 : n); -} - -module.exports = rest; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/restArguments.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/restArguments.js deleted file mode 100644 index b292cb4c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/restArguments.js +++ /dev/null @@ -1,29 +0,0 @@ -// Some functions take a variable number of arguments, or a few expected -// arguments at the beginning and then a variable number of values to operate -// on. This helper accumulates all remaining arguments past the function’s -// argument length (or an explicit `startIndex`), into an array that becomes -// the last argument. Similar to ES6’s "rest parameter". -function restArguments(func, startIndex) { - startIndex = startIndex == null ? func.length - 1 : +startIndex; - return function() { - var length = Math.max(arguments.length - startIndex, 0), - rest = Array(length), - index = 0; - for (; index < length; index++) { - rest[index] = arguments[index + startIndex]; - } - switch (startIndex) { - case 0: return func.call(this, rest); - case 1: return func.call(this, arguments[0], rest); - case 2: return func.call(this, arguments[0], arguments[1], rest); - } - var args = Array(startIndex + 1); - for (index = 0; index < startIndex; index++) { - args[index] = arguments[index]; - } - args[startIndex] = rest; - return func.apply(this, args); - }; -} - -module.exports = restArguments; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/result.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/result.js deleted file mode 100644 index 7bd3fb65..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/result.js +++ /dev/null @@ -1,24 +0,0 @@ -var isFunction = require('./isFunction.js'); -var _toPath = require('./_toPath.js'); - -// Traverses the children of `obj` along `path`. If a child is a function, it -// is invoked with its parent as context. Returns the value of the final -// child, or `fallback` if any child is undefined. -function result(obj, path, fallback) { - path = _toPath(path); - var length = path.length; - if (!length) { - return isFunction(fallback) ? fallback.call(obj) : fallback; - } - for (var i = 0; i < length; i++) { - var prop = obj == null ? void 0 : obj[path[i]]; - if (prop === void 0) { - prop = fallback; - i = length; // Ensure we don't continue iterating. - } - obj = isFunction(prop) ? prop.call(obj) : prop; - } - return obj; -} - -module.exports = result; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/sample.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/sample.js deleted file mode 100644 index c640ff4f..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/sample.js +++ /dev/null @@ -1,29 +0,0 @@ -var _isArrayLike = require('./_isArrayLike.js'); -var values = require('./values.js'); -var _getLength = require('./_getLength.js'); -var random = require('./random.js'); -var toArray = require('./toArray.js'); - -// Sample **n** random values from a collection using the modern version of the -// [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher–Yates_shuffle). -// If **n** is not specified, returns a single random element. -// The internal `guard` argument allows it to work with `_.map`. -function sample(obj, n, guard) { - if (n == null || guard) { - if (!_isArrayLike(obj)) obj = values(obj); - return obj[random(obj.length - 1)]; - } - var sample = toArray(obj); - var length = _getLength(sample); - n = Math.max(Math.min(n, length), 0); - var last = length - 1; - for (var index = 0; index < n; index++) { - var rand = random(index, last); - var temp = sample[index]; - sample[index] = sample[rand]; - sample[rand] = temp; - } - return sample.slice(0, n); -} - -module.exports = sample; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/set.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/set.js deleted file mode 100644 index a357a2b7..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/set.js +++ /dev/null @@ -1,15 +0,0 @@ -var isArray = require('./isArray.js'); -var isObject = require('./isObject.js'); -var _set = require('./_set.js'); - -// set the value in given path -function set (obj, path, value) { - if (!isObject(obj) || !isArray(path)) return obj; - if (path.length === 0) return obj; - - _set(obj, path, value); - - return obj; -} - -module.exports = set; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/shuffle.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/shuffle.js deleted file mode 100644 index 2694917e..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/shuffle.js +++ /dev/null @@ -1,8 +0,0 @@ -var sample = require('./sample.js'); - -// Shuffle a collection. -function shuffle(obj) { - return sample(obj, Infinity); -} - -module.exports = shuffle; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/size.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/size.js deleted file mode 100644 index a65f4c08..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/size.js +++ /dev/null @@ -1,10 +0,0 @@ -var _isArrayLike = require('./_isArrayLike.js'); -var keys = require('./keys.js'); - -// Return the number of elements in a collection. -function size(obj) { - if (obj == null) return 0; - return _isArrayLike(obj) ? obj.length : keys(obj).length; -} - -module.exports = size; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/some.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/some.js deleted file mode 100644 index 346752ec..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/some.js +++ /dev/null @@ -1,17 +0,0 @@ -var _cb = require('./_cb.js'); -var _isArrayLike = require('./_isArrayLike.js'); -var keys = require('./keys.js'); - -// Determine if at least one element in the object passes a truth test. -function some(obj, predicate, context) { - predicate = _cb(predicate, context); - var _keys = !_isArrayLike(obj) && keys(obj), - length = (_keys || obj).length; - for (var index = 0; index < length; index++) { - var currentKey = _keys ? _keys[index] : index; - if (predicate(obj[currentKey], currentKey, obj)) return true; - } - return false; -} - -module.exports = some; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/sortBy.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/sortBy.js deleted file mode 100644 index 28dae07f..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/sortBy.js +++ /dev/null @@ -1,26 +0,0 @@ -var _cb = require('./_cb.js'); -var pluck = require('./pluck.js'); -var map = require('./map.js'); - -// Sort the object's values by a criterion produced by an iteratee. -function sortBy(obj, iteratee, context) { - var index = 0; - iteratee = _cb(iteratee, context); - return pluck(map(obj, function(value, key, list) { - return { - value: value, - index: index++, - criteria: iteratee(value, key, list) - }; - }).sort(function(left, right) { - var a = left.criteria; - var b = right.criteria; - if (a !== b) { - if (a > b || a === void 0) return 1; - if (a < b || b === void 0) return -1; - } - return left.index - right.index; - }), 'value'); -} - -module.exports = sortBy; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/sortedIndex.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/sortedIndex.js deleted file mode 100644 index 1f261713..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/sortedIndex.js +++ /dev/null @@ -1,17 +0,0 @@ -var _cb = require('./_cb.js'); -var _getLength = require('./_getLength.js'); - -// Use a comparator function to figure out the smallest index at which -// an object should be inserted so as to maintain order. Uses binary search. -function sortedIndex(array, obj, iteratee, context) { - iteratee = _cb(iteratee, context, 1); - var value = iteratee(obj); - var low = 0, high = _getLength(array); - while (low < high) { - var mid = Math.floor((low + high) / 2); - if (iteratee(array[mid]) < value) low = mid + 1; else high = mid; - } - return low; -} - -module.exports = sortedIndex; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/tap.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/tap.js deleted file mode 100644 index 3dc681f8..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/tap.js +++ /dev/null @@ -1,9 +0,0 @@ -// Invokes `interceptor` with the `obj` and then returns `obj`. -// The primary purpose of this method is to "tap into" a method chain, in -// order to perform operations on intermediate results within the chain. -function tap(obj, interceptor) { - interceptor(obj); - return obj; -} - -module.exports = tap; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/template.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/template.js deleted file mode 100644 index cf626aa6..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/template.js +++ /dev/null @@ -1,103 +0,0 @@ -var defaults = require('./defaults.js'); -var underscore = require('./underscore.js'); -require('./templateSettings.js'); - -// When customizing `_.templateSettings`, if you don't want to define an -// interpolation, evaluation or escaping regex, we need one that is -// guaranteed not to match. -var noMatch = /(.)^/; - -// Certain characters need to be escaped so that they can be put into a -// string literal. -var escapes = { - "'": "'", - '\\': '\\', - '\r': 'r', - '\n': 'n', - '\u2028': 'u2028', - '\u2029': 'u2029' -}; - -var escapeRegExp = /\\|'|\r|\n|\u2028|\u2029/g; - -function escapeChar(match) { - return '\\' + escapes[match]; -} - -// In order to prevent third-party code injection through -// `_.templateSettings.variable`, we test it against the following regular -// expression. It is intentionally a bit more liberal than just matching valid -// identifiers, but still prevents possible loopholes through defaults or -// destructuring assignment. -var bareIdentifier = /^\s*(\w|\$)+\s*$/; - -// JavaScript micro-templating, similar to John Resig's implementation. -// Underscore templating handles arbitrary delimiters, preserves whitespace, -// and correctly escapes quotes within interpolated code. -// NB: `oldSettings` only exists for backwards compatibility. -function template(text, settings, oldSettings) { - if (!settings && oldSettings) settings = oldSettings; - settings = defaults({}, settings, underscore.templateSettings); - - // Combine delimiters into one regular expression via alternation. - var matcher = RegExp([ - (settings.escape || noMatch).source, - (settings.interpolate || noMatch).source, - (settings.evaluate || noMatch).source - ].join('|') + '|$', 'g'); - - // Compile the template source, escaping string literals appropriately. - var index = 0; - var source = "__p+='"; - text.replace(matcher, function(match, escape, interpolate, evaluate, offset) { - source += text.slice(index, offset).replace(escapeRegExp, escapeChar); - index = offset + match.length; - - if (escape) { - source += "'+\n((__t=(" + escape + "))==null?'':_.escape(__t))+\n'"; - } else if (interpolate) { - source += "'+\n((__t=(" + interpolate + "))==null?'':__t)+\n'"; - } else if (evaluate) { - source += "';\n" + evaluate + "\n__p+='"; - } - - // Adobe VMs need the match returned to produce the correct offset. - return match; - }); - source += "';\n"; - - var argument = settings.variable; - if (argument) { - // Insure against third-party code injection. (CVE-2021-23358) - if (!bareIdentifier.test(argument)) throw new Error( - 'variable is not a bare identifier: ' + argument - ); - } else { - // If a variable is not specified, place data values in local scope. - source = 'with(obj||{}){\n' + source + '}\n'; - argument = 'obj'; - } - - source = "var __t,__p='',__j=Array.prototype.join," + - "print=function(){__p+=__j.call(arguments,'');};\n" + - source + 'return __p;\n'; - - var render; - try { - render = new Function(argument, '_', source); - } catch (e) { - e.source = source; - throw e; - } - - var template = function(data) { - return render.call(this, data, underscore); - }; - - // Provide the compiled source as a convenience for precompilation. - template.source = 'function(' + argument + '){\n' + source + '}'; - - return template; -} - -module.exports = template; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/templateSettings.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/templateSettings.js deleted file mode 100644 index 4b557989..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/templateSettings.js +++ /dev/null @@ -1,11 +0,0 @@ -var underscore = require('./underscore.js'); - -// By default, Underscore uses ERB-style template delimiters. Change the -// following template settings to use alternative delimiters. -var templateSettings = underscore.templateSettings = { - evaluate: /<%([\s\S]+?)%>/g, - interpolate: /<%=([\s\S]+?)%>/g, - escape: /<%-([\s\S]+?)%>/g -}; - -module.exports = templateSettings; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/throttle.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/throttle.js deleted file mode 100644 index 3b013d92..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/throttle.js +++ /dev/null @@ -1,49 +0,0 @@ -var now = require('./now.js'); - -// Returns a function, that, when invoked, will only be triggered at most once -// during a given window of time. Normally, the throttled function will run -// as much as it can, without ever going more than once per `wait` duration; -// but if you'd like to disable the execution on the leading edge, pass -// `{leading: false}`. To disable execution on the trailing edge, ditto. -function throttle(func, wait, options) { - var timeout, context, args, result; - var previous = 0; - if (!options) options = {}; - - var later = function() { - previous = options.leading === false ? 0 : now(); - timeout = null; - result = func.apply(context, args); - if (!timeout) context = args = null; - }; - - var throttled = function() { - var _now = now(); - if (!previous && options.leading === false) previous = _now; - var remaining = wait - (_now - previous); - context = this; - args = arguments; - if (remaining <= 0 || remaining > wait) { - if (timeout) { - clearTimeout(timeout); - timeout = null; - } - previous = _now; - result = func.apply(context, args); - if (!timeout) context = args = null; - } else if (!timeout && options.trailing !== false) { - timeout = setTimeout(later, remaining); - } - return result; - }; - - throttled.cancel = function() { - clearTimeout(timeout); - previous = 0; - timeout = context = args = null; - }; - - return throttled; -} - -module.exports = throttle; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/times.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/times.js deleted file mode 100644 index 0a36b794..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/times.js +++ /dev/null @@ -1,11 +0,0 @@ -var _optimizeCb = require('./_optimizeCb.js'); - -// Run a function **n** times. -function times(n, iteratee, context) { - var accum = Array(Math.max(0, n)); - iteratee = _optimizeCb(iteratee, context, 1); - for (var i = 0; i < n; i++) accum[i] = iteratee(i); - return accum; -} - -module.exports = times; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/toArray.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/toArray.js deleted file mode 100644 index 4f29a058..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/toArray.js +++ /dev/null @@ -1,22 +0,0 @@ -var isArray = require('./isArray.js'); -var _setup = require('./_setup.js'); -var isString = require('./isString.js'); -var _isArrayLike = require('./_isArrayLike.js'); -var map = require('./map.js'); -var identity = require('./identity.js'); -var values = require('./values.js'); - -// Safely create a real, live array from anything iterable. -var reStrSymbol = /[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g; -function toArray(obj) { - if (!obj) return []; - if (isArray(obj)) return _setup.slice.call(obj); - if (isString(obj)) { - // Keep surrogate pair characters together. - return obj.match(reStrSymbol); - } - if (_isArrayLike(obj)) return map(obj, identity); - return values(obj); -} - -module.exports = toArray; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/toPath.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/toPath.js deleted file mode 100644 index 94f41c90..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/toPath.js +++ /dev/null @@ -1,11 +0,0 @@ -var underscore = require('./underscore.js'); -var isArray = require('./isArray.js'); - -// Normalize a (deep) property `path` to array. -// Like `_.iteratee`, this function can be customized. -function toPath(path) { - return isArray(path) ? path : [path]; -} -underscore.toPath = toPath; - -module.exports = toPath; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/underscore-array-methods.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/underscore-array-methods.js deleted file mode 100644 index baf2d18c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/underscore-array-methods.js +++ /dev/null @@ -1,31 +0,0 @@ -var underscore = require('./underscore.js'); -var each = require('./each.js'); -var _setup = require('./_setup.js'); -var _chainResult = require('./_chainResult.js'); - -// Add all mutator `Array` functions to the wrapper. -each(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(name) { - var method = _setup.ArrayProto[name]; - underscore.prototype[name] = function() { - var obj = this._wrapped; - if (obj != null) { - method.apply(obj, arguments); - if ((name === 'shift' || name === 'splice') && obj.length === 0) { - delete obj[0]; - } - } - return _chainResult(this, obj); - }; -}); - -// Add all accessor `Array` functions to the wrapper. -each(['concat', 'join', 'slice'], function(name) { - var method = _setup.ArrayProto[name]; - underscore.prototype[name] = function() { - var obj = this._wrapped; - if (obj != null) obj = method.apply(obj, arguments); - return _chainResult(this, obj); - }; -}); - -module.exports = underscore; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/underscore.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/underscore.js deleted file mode 100644 index d3cf8091..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/underscore.js +++ /dev/null @@ -1,27 +0,0 @@ -var _setup = require('./_setup.js'); - -// If Underscore is called as a function, it returns a wrapped object that can -// be used OO-style. This wrapper holds altered versions of all functions added -// through `_.mixin`. Wrapped objects may be chained. -function _(obj) { - if (obj instanceof _) return obj; - if (!(this instanceof _)) return new _(obj); - this._wrapped = obj; -} - -_.VERSION = _setup.VERSION; - -// Extracts the result from a wrapped and chained object. -_.prototype.value = function() { - return this._wrapped; -}; - -// Provide unwrapping proxies for some methods used in engine operations -// such as arithmetic and JSON stringification. -_.prototype.valueOf = _.prototype.toJSON = _.prototype.value; - -_.prototype.toString = function() { - return String(this._wrapped); -}; - -module.exports = _; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/unescape.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/unescape.js deleted file mode 100644 index 2d5a5975..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/unescape.js +++ /dev/null @@ -1,7 +0,0 @@ -var _createEscaper = require('./_createEscaper.js'); -var _unescapeMap = require('./_unescapeMap.js'); - -// Function for unescaping strings from HTML interpolation. -var _unescape = _createEscaper(_unescapeMap); - -module.exports = _unescape; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/union.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/union.js deleted file mode 100644 index fb15bcbf..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/union.js +++ /dev/null @@ -1,11 +0,0 @@ -var restArguments = require('./restArguments.js'); -var uniq = require('./uniq.js'); -var _flatten = require('./_flatten.js'); - -// Produce an array that contains the union: each distinct element from all of -// the passed-in arrays. -var union = restArguments(function(arrays) { - return uniq(_flatten(arrays, true, true)); -}); - -module.exports = union; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/uniq.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/uniq.js deleted file mode 100644 index 2e8f6837..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/uniq.js +++ /dev/null @@ -1,38 +0,0 @@ -var isBoolean = require('./isBoolean.js'); -var _cb = require('./_cb.js'); -var _getLength = require('./_getLength.js'); -var contains = require('./contains.js'); - -// Produce a duplicate-free version of the array. If the array has already -// been sorted, you have the option of using a faster algorithm. -// The faster algorithm will not work with an iteratee if the iteratee -// is not a one-to-one function, so providing an iteratee will disable -// the faster algorithm. -function uniq(array, isSorted, iteratee, context) { - if (!isBoolean(isSorted)) { - context = iteratee; - iteratee = isSorted; - isSorted = false; - } - if (iteratee != null) iteratee = _cb(iteratee, context); - var result = []; - var seen = []; - for (var i = 0, length = _getLength(array); i < length; i++) { - var value = array[i], - computed = iteratee ? iteratee(value, i, array) : value; - if (isSorted && !iteratee) { - if (!i || seen !== computed) result.push(value); - seen = computed; - } else if (iteratee) { - if (!contains(seen, computed)) { - seen.push(computed); - result.push(value); - } - } else if (!contains(result, value)) { - result.push(value); - } - } - return result; -} - -module.exports = uniq; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/uniqueId.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/uniqueId.js deleted file mode 100644 index e639e837..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/uniqueId.js +++ /dev/null @@ -1,9 +0,0 @@ -// Generate a unique integer id (unique within the entire client session). -// Useful for temporary DOM ids. -var idCounter = 0; -function uniqueId(prefix) { - var id = ++idCounter + ''; - return prefix ? prefix + id : id; -} - -module.exports = uniqueId; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/unzip.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/unzip.js deleted file mode 100644 index 2493e542..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/unzip.js +++ /dev/null @@ -1,17 +0,0 @@ -var max = require('./max.js'); -var _getLength = require('./_getLength.js'); -var pluck = require('./pluck.js'); - -// Complement of zip. Unzip accepts an array of arrays and groups -// each array's elements on shared indices. -function unzip(array) { - var length = (array && max(array, _getLength).length) || 0; - var result = Array(length); - - for (var index = 0; index < length; index++) { - result[index] = pluck(array, index); - } - return result; -} - -module.exports = unzip; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/values.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/values.js deleted file mode 100644 index 393c8b7a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/values.js +++ /dev/null @@ -1,14 +0,0 @@ -var keys = require('./keys.js'); - -// Retrieve the values of an object's properties. -function values(obj) { - var _keys = keys(obj); - var length = _keys.length; - var values = Array(length); - for (var i = 0; i < length; i++) { - values[i] = obj[_keys[i]]; - } - return values; -} - -module.exports = values; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/where.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/where.js deleted file mode 100644 index 94ccfe7a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/where.js +++ /dev/null @@ -1,10 +0,0 @@ -var filter = require('./filter.js'); -var matcher = require('./matcher.js'); - -// Convenience version of a common use case of `_.filter`: selecting only -// objects containing specific `key:value` pairs. -function where(obj, attrs) { - return filter(obj, matcher(attrs)); -} - -module.exports = where; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/without.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/without.js deleted file mode 100644 index 5eaa4cdb..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/without.js +++ /dev/null @@ -1,9 +0,0 @@ -var restArguments = require('./restArguments.js'); -var difference = require('./difference.js'); - -// Return a version of the array that does not contain the specified value(s). -var without = restArguments(function(array, otherArrays) { - return difference(array, otherArrays); -}); - -module.exports = without; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/wrap.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/wrap.js deleted file mode 100644 index e95d5a7f..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/wrap.js +++ /dev/null @@ -1,10 +0,0 @@ -var partial = require('./partial.js'); - -// Returns the first function passed as an argument to the second, -// allowing you to adjust arguments, run code before and after, and -// conditionally execute the original function. -function wrap(func, wrapper) { - return partial(wrapper, func); -} - -module.exports = wrap; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/zip.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/zip.js deleted file mode 100644 index 70cbd3b1..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/cjs/zip.js +++ /dev/null @@ -1,8 +0,0 @@ -var restArguments = require('./restArguments.js'); -var unzip = require('./unzip.js'); - -// Zip together multiple lists into a single array -- elements that share -// an index go together. -var zip = restArguments(unzip); - -module.exports = zip; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/.eslintrc b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/.eslintrc deleted file mode 100644 index 23961d5f..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/.eslintrc +++ /dev/null @@ -1,21 +0,0 @@ -{ - "parserOptions": { - "ecmaVersion": 6, - "sourceType": "module", - }, - "plugins": [ - "import" - ], - "extends": [ - "plugin:import/errors" - ], - "rules": { - // ExtendScript wrongly gives equal precedence to && and ||. #2949 - "no-mixed-operators": [ - "error", - { - "groups": [["&&", "||"]] - } - ] - } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/_baseCreate.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/_baseCreate.js deleted file mode 100644 index 032a9728..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/_baseCreate.js +++ /dev/null @@ -1,18 +0,0 @@ -import isObject from './isObject.js'; -import { nativeCreate } from './_setup.js'; - -// Create a naked function reference for surrogate-prototype-swapping. -function ctor() { - return function(){}; -} - -// An internal function for creating a new object that inherits from another. -export default function baseCreate(prototype) { - if (!isObject(prototype)) return {}; - if (nativeCreate) return nativeCreate(prototype); - var Ctor = ctor(); - Ctor.prototype = prototype; - var result = new Ctor; - Ctor.prototype = null; - return result; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/_baseIteratee.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/_baseIteratee.js deleted file mode 100644 index c276ebec..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/_baseIteratee.js +++ /dev/null @@ -1,17 +0,0 @@ -import identity from './identity.js'; -import isFunction from './isFunction.js'; -import isObject from './isObject.js'; -import isArray from './isArray.js'; -import matcher from './matcher.js'; -import property from './property.js'; -import optimizeCb from './_optimizeCb.js'; - -// An internal function to generate callbacks that can be applied to each -// element in a collection, returning the desired result — either `_.identity`, -// an arbitrary callback, a property matcher, or a property accessor. -export default function baseIteratee(value, context, argCount) { - if (value == null) return identity; - if (isFunction(value)) return optimizeCb(value, context, argCount); - if (isObject(value) && !isArray(value)) return matcher(value); - return property(value); -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/_cb.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/_cb.js deleted file mode 100644 index 9b8b5557..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/_cb.js +++ /dev/null @@ -1,10 +0,0 @@ -import _ from './underscore.js'; -import baseIteratee from './_baseIteratee.js'; -import iteratee from './iteratee.js'; - -// The function we call internally to generate a callback. It invokes -// `_.iteratee` if overridden, otherwise `baseIteratee`. -export default function cb(value, context, argCount) { - if (_.iteratee !== iteratee) return _.iteratee(value, context); - return baseIteratee(value, context, argCount); -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/_chainResult.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/_chainResult.js deleted file mode 100644 index b786520c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/_chainResult.js +++ /dev/null @@ -1,6 +0,0 @@ -import _ from './underscore.js'; - -// Helper function to continue chaining intermediate results. -export default function chainResult(instance, obj) { - return instance._chain ? _(obj).chain() : obj; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/_collectNonEnumProps.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/_collectNonEnumProps.js deleted file mode 100644 index eed0f7b6..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/_collectNonEnumProps.js +++ /dev/null @@ -1,40 +0,0 @@ -import { nonEnumerableProps, ObjProto } from './_setup.js'; -import isFunction from './isFunction.js'; -import has from './_has.js'; - -// Internal helper to create a simple lookup structure. -// `collectNonEnumProps` used to depend on `_.contains`, but this led to -// circular imports. `emulatedSet` is a one-off solution that only works for -// arrays of strings. -function emulatedSet(keys) { - var hash = {}; - for (var l = keys.length, i = 0; i < l; ++i) hash[keys[i]] = true; - return { - contains: function(key) { return hash[key] === true; }, - push: function(key) { - hash[key] = true; - return keys.push(key); - } - }; -} - -// Internal helper. Checks `keys` for the presence of keys in IE < 9 that won't -// be iterated by `for key in ...` and thus missed. Extends `keys` in place if -// needed. -export default function collectNonEnumProps(obj, keys) { - keys = emulatedSet(keys); - var nonEnumIdx = nonEnumerableProps.length; - var constructor = obj.constructor; - var proto = (isFunction(constructor) && constructor.prototype) || ObjProto; - - // Constructor is a special case. - var prop = 'constructor'; - if (has(obj, prop) && !keys.contains(prop)) keys.push(prop); - - while (nonEnumIdx--) { - prop = nonEnumerableProps[nonEnumIdx]; - if (prop in obj && obj[prop] !== proto[prop] && !keys.contains(prop)) { - keys.push(prop); - } - } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/_createAssigner.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/_createAssigner.js deleted file mode 100644 index b1023931..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/_createAssigner.js +++ /dev/null @@ -1,18 +0,0 @@ -// An internal function for creating assigner functions. -export default function createAssigner(keysFunc, defaults) { - return function(obj) { - var length = arguments.length; - if (defaults) obj = Object(obj); - if (length < 2 || obj == null) return obj; - for (var index = 1; index < length; index++) { - var source = arguments[index], - keys = keysFunc(source), - l = keys.length; - for (var i = 0; i < l; i++) { - var key = keys[i]; - if (!defaults || obj[key] === void 0) obj[key] = source[key]; - } - } - return obj; - }; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/_createEscaper.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/_createEscaper.js deleted file mode 100644 index 3828b56f..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/_createEscaper.js +++ /dev/null @@ -1,17 +0,0 @@ -import keys from './keys.js'; - -// Internal helper to generate functions for escaping and unescaping strings -// to/from HTML interpolation. -export default function createEscaper(map) { - var escaper = function(match) { - return map[match]; - }; - // Regexes for identifying a key that needs to be escaped. - var source = '(?:' + keys(map).join('|') + ')'; - var testRegexp = RegExp(source); - var replaceRegexp = RegExp(source, 'g'); - return function(string) { - string = string == null ? '' : '' + string; - return testRegexp.test(string) ? string.replace(replaceRegexp, escaper) : string; - }; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/_createIndexFinder.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/_createIndexFinder.js deleted file mode 100644 index eadedef0..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/_createIndexFinder.js +++ /dev/null @@ -1,28 +0,0 @@ -import getLength from './_getLength.js'; -import { slice } from './_setup.js'; -import isNaN from './isNaN.js'; - -// Internal function to generate the `_.indexOf` and `_.lastIndexOf` functions. -export default function createIndexFinder(dir, predicateFind, sortedIndex) { - return function(array, item, idx) { - var i = 0, length = getLength(array); - if (typeof idx == 'number') { - if (dir > 0) { - i = idx >= 0 ? idx : Math.max(idx + length, i); - } else { - length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1; - } - } else if (sortedIndex && idx && length) { - idx = sortedIndex(array, item); - return array[idx] === item ? idx : -1; - } - if (item !== item) { - idx = predicateFind(slice.call(array, i, length), isNaN); - return idx >= 0 ? idx + i : -1; - } - for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) { - if (array[idx] === item) return idx; - } - return -1; - }; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/_createPredicateIndexFinder.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/_createPredicateIndexFinder.js deleted file mode 100644 index c0659485..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/_createPredicateIndexFinder.js +++ /dev/null @@ -1,15 +0,0 @@ -import cb from './_cb.js'; -import getLength from './_getLength.js'; - -// Internal function to generate `_.findIndex` and `_.findLastIndex`. -export default function createPredicateIndexFinder(dir) { - return function(array, predicate, context) { - predicate = cb(predicate, context); - var length = getLength(array); - var index = dir > 0 ? 0 : length - 1; - for (; index >= 0 && index < length; index += dir) { - if (predicate(array[index], index, array)) return index; - } - return -1; - }; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/_createReduce.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/_createReduce.js deleted file mode 100644 index 20f4ee11..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/_createReduce.js +++ /dev/null @@ -1,28 +0,0 @@ -import isArrayLike from './_isArrayLike.js'; -import keys from './keys.js'; -import optimizeCb from './_optimizeCb.js'; - -// Internal helper to create a reducing function, iterating left or right. -export default function createReduce(dir) { - // Wrap code that reassigns argument variables in a separate function than - // the one that accesses `arguments.length` to avoid a perf hit. (#1991) - var reducer = function(obj, iteratee, memo, initial) { - var _keys = !isArrayLike(obj) && keys(obj), - length = (_keys || obj).length, - index = dir > 0 ? 0 : length - 1; - if (!initial) { - memo = obj[_keys ? _keys[index] : index]; - index += dir; - } - for (; index >= 0 && index < length; index += dir) { - var currentKey = _keys ? _keys[index] : index; - memo = iteratee(memo, obj[currentKey], currentKey, obj); - } - return memo; - }; - - return function(obj, iteratee, memo, context) { - var initial = arguments.length >= 3; - return reducer(obj, optimizeCb(iteratee, context, 4), memo, initial); - }; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/_createSizePropertyCheck.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/_createSizePropertyCheck.js deleted file mode 100644 index cc38007b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/_createSizePropertyCheck.js +++ /dev/null @@ -1,9 +0,0 @@ -import { MAX_ARRAY_INDEX } from './_setup.js'; - -// Common internal logic for `isArrayLike` and `isBufferLike`. -export default function createSizePropertyCheck(getSizeProperty) { - return function(collection) { - var sizeProperty = getSizeProperty(collection); - return typeof sizeProperty == 'number' && sizeProperty >= 0 && sizeProperty <= MAX_ARRAY_INDEX; - } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/_deepGet.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/_deepGet.js deleted file mode 100644 index 42bbec31..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/_deepGet.js +++ /dev/null @@ -1,9 +0,0 @@ -// Internal function to obtain a nested property in `obj` along `path`. -export default function deepGet(obj, path) { - var length = path.length; - for (var i = 0; i < length; i++) { - if (obj == null) return void 0; - obj = obj[path[i]]; - } - return length ? obj : void 0; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/_escapeMap.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/_escapeMap.js deleted file mode 100644 index cc9d615f..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/_escapeMap.js +++ /dev/null @@ -1,9 +0,0 @@ -// Internal list of HTML entities for escaping. -export default { - '&': '&', - '<': '<', - '>': '>', - '"': '"', - "'": ''', - '`': '`' -}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/_executeBound.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/_executeBound.js deleted file mode 100644 index f54fa780..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/_executeBound.js +++ /dev/null @@ -1,13 +0,0 @@ -import baseCreate from './_baseCreate.js'; -import isObject from './isObject.js'; - -// Internal function to execute `sourceFunc` bound to `context` with optional -// `args`. Determines whether to execute a function as a constructor or as a -// normal function. -export default function executeBound(sourceFunc, boundFunc, context, callingContext, args) { - if (!(callingContext instanceof boundFunc)) return sourceFunc.apply(context, args); - var self = baseCreate(sourceFunc.prototype); - var result = sourceFunc.apply(self, args); - if (isObject(result)) return result; - return self; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/_flatten.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/_flatten.js deleted file mode 100644 index 1767a8b8..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/_flatten.js +++ /dev/null @@ -1,31 +0,0 @@ -import getLength from './_getLength.js'; -import isArrayLike from './_isArrayLike.js'; -import isArray from './isArray.js'; -import isArguments from './isArguments.js'; - -// Internal implementation of a recursive `flatten` function. -export default function flatten(input, depth, strict, output) { - output = output || []; - if (!depth && depth !== 0) { - depth = Infinity; - } else if (depth <= 0) { - return output.concat(input); - } - var idx = output.length; - for (var i = 0, length = getLength(input); i < length; i++) { - var value = input[i]; - if (isArrayLike(value) && (isArray(value) || isArguments(value))) { - // Flatten current level of array or arguments object. - if (depth > 1) { - flatten(value, depth - 1, strict, output); - idx = output.length; - } else { - var j = 0, len = value.length; - while (j < len) output[idx++] = value[j++]; - } - } else if (!strict) { - output[idx++] = value; - } - } - return output; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/_getByteLength.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/_getByteLength.js deleted file mode 100644 index 11e45287..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/_getByteLength.js +++ /dev/null @@ -1,4 +0,0 @@ -import shallowProperty from './_shallowProperty.js'; - -// Internal helper to obtain the `byteLength` property of an object. -export default shallowProperty('byteLength'); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/_getLength.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/_getLength.js deleted file mode 100644 index 090b156b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/_getLength.js +++ /dev/null @@ -1,4 +0,0 @@ -import shallowProperty from './_shallowProperty.js'; - -// Internal helper to obtain the `length` property of an object. -export default shallowProperty('length'); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/_group.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/_group.js deleted file mode 100644 index 8fdd9857..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/_group.js +++ /dev/null @@ -1,15 +0,0 @@ -import cb from './_cb.js'; -import each from './each.js'; - -// An internal function used for aggregate "group by" operations. -export default function group(behavior, partition) { - return function(obj, iteratee, context) { - var result = partition ? [[], []] : {}; - iteratee = cb(iteratee, context); - each(obj, function(value, index) { - var key = iteratee(value, index, obj); - behavior(result, value, key); - }); - return result; - }; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/_has.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/_has.js deleted file mode 100644 index 06361812..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/_has.js +++ /dev/null @@ -1,6 +0,0 @@ -import { hasOwnProperty } from './_setup.js'; - -// Internal function to check whether `key` is an own property name of `obj`. -export default function has(obj, key) { - return obj != null && hasOwnProperty.call(obj, key); -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/_hasObjectTag.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/_hasObjectTag.js deleted file mode 100644 index 85db78c1..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/_hasObjectTag.js +++ /dev/null @@ -1,3 +0,0 @@ -import tagTester from './_tagTester.js'; - -export default tagTester('Object'); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/_isArrayLike.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/_isArrayLike.js deleted file mode 100644 index a87fe488..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/_isArrayLike.js +++ /dev/null @@ -1,8 +0,0 @@ -import createSizePropertyCheck from './_createSizePropertyCheck.js'; -import getLength from './_getLength.js'; - -// Internal helper for collection methods to determine whether a collection -// should be iterated as an array or as an object. -// Related: https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength -// Avoids a very nasty iOS 8 JIT bug on ARM-64. #2094 -export default createSizePropertyCheck(getLength); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/_isBufferLike.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/_isBufferLike.js deleted file mode 100644 index 8cab6ee0..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/_isBufferLike.js +++ /dev/null @@ -1,6 +0,0 @@ -import createSizePropertyCheck from './_createSizePropertyCheck.js'; -import getByteLength from './_getByteLength.js'; - -// Internal helper to determine whether we should spend extensive checks against -// `ArrayBuffer` et al. -export default createSizePropertyCheck(getByteLength); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/_keyInObj.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/_keyInObj.js deleted file mode 100644 index f72a8514..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/_keyInObj.js +++ /dev/null @@ -1,5 +0,0 @@ -// Internal `_.pick` helper function to determine whether `key` is an enumerable -// property name of `obj`. -export default function keyInObj(value, key, obj) { - return key in obj; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/_methodFingerprint.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/_methodFingerprint.js deleted file mode 100644 index a1ebff33..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/_methodFingerprint.js +++ /dev/null @@ -1,37 +0,0 @@ -import getLength from './_getLength.js'; -import isFunction from './isFunction.js'; -import allKeys from './allKeys.js'; - -// Since the regular `Object.prototype.toString` type tests don't work for -// some types in IE 11, we use a fingerprinting heuristic instead, based -// on the methods. It's not great, but it's the best we got. -// The fingerprint method lists are defined below. -export function ie11fingerprint(methods) { - var length = getLength(methods); - return function(obj) { - if (obj == null) return false; - // `Map`, `WeakMap` and `Set` have no enumerable keys. - var keys = allKeys(obj); - if (getLength(keys)) return false; - for (var i = 0; i < length; i++) { - if (!isFunction(obj[methods[i]])) return false; - } - // If we are testing against `WeakMap`, we need to ensure that - // `obj` doesn't have a `forEach` method in order to distinguish - // it from a regular `Map`. - return methods !== weakMapMethods || !isFunction(obj[forEachName]); - }; -} - -// In the interest of compact minification, we write -// each string in the fingerprints only once. -var forEachName = 'forEach', - hasName = 'has', - commonInit = ['clear', 'delete'], - mapTail = ['get', hasName, 'set']; - -// `Map`, `WeakMap` and `Set` each have slightly different -// combinations of the above sublists. -export var mapMethods = commonInit.concat(forEachName, mapTail), - weakMapMethods = commonInit.concat(mapTail), - setMethods = ['add'].concat(commonInit, forEachName, hasName); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/_optimizeCb.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/_optimizeCb.js deleted file mode 100644 index 59e40e66..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/_optimizeCb.js +++ /dev/null @@ -1,21 +0,0 @@ -// Internal function that returns an efficient (for current engines) version -// of the passed-in callback, to be repeatedly applied in other Underscore -// functions. -export default function optimizeCb(func, context, argCount) { - if (context === void 0) return func; - switch (argCount == null ? 3 : argCount) { - case 1: return function(value) { - return func.call(context, value); - }; - // The 2-argument case is omitted because we’re not using it. - case 3: return function(value, index, collection) { - return func.call(context, value, index, collection); - }; - case 4: return function(accumulator, value, index, collection) { - return func.call(context, accumulator, value, index, collection); - }; - } - return function() { - return func.apply(context, arguments); - }; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/_setup.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/_setup.js deleted file mode 100644 index de8d79ca..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/_setup.js +++ /dev/null @@ -1,43 +0,0 @@ -// Current version. -export var VERSION = '1.13.6'; - -// Establish the root object, `window` (`self`) in the browser, `global` -// on the server, or `this` in some virtual machines. We use `self` -// instead of `window` for `WebWorker` support. -export var root = (typeof self == 'object' && self.self === self && self) || - (typeof global == 'object' && global.global === global && global) || - Function('return this')() || - {}; - -// Save bytes in the minified (but not gzipped) version: -export var ArrayProto = Array.prototype, ObjProto = Object.prototype; -export var SymbolProto = typeof Symbol !== 'undefined' ? Symbol.prototype : null; - -// Create quick reference variables for speed access to core prototypes. -export var push = ArrayProto.push, - slice = ArrayProto.slice, - toString = ObjProto.toString, - hasOwnProperty = ObjProto.hasOwnProperty; - -// Modern feature detection. -export var supportsArrayBuffer = typeof ArrayBuffer !== 'undefined', - supportsDataView = typeof DataView !== 'undefined'; - -// All **ECMAScript 5+** native function implementations that we hope to use -// are declared here. -export var nativeIsArray = Array.isArray, - nativeKeys = Object.keys, - nativeCreate = Object.create, - nativeIsView = supportsArrayBuffer && ArrayBuffer.isView; - -// Create references to these builtin functions because we override them. -export var _isNaN = isNaN, - _isFinite = isFinite; - -// Keys in IE < 9 that won't be iterated by `for key in ...` and thus missed. -export var hasEnumBug = !{toString: null}.propertyIsEnumerable('toString'); -export var nonEnumerableProps = ['valueOf', 'isPrototypeOf', 'toString', - 'propertyIsEnumerable', 'hasOwnProperty', 'toLocaleString']; - -// The largest integer that can be represented exactly. -export var MAX_ARRAY_INDEX = Math.pow(2, 53) - 1; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/_shallowProperty.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/_shallowProperty.js deleted file mode 100644 index 00bf0902..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/_shallowProperty.js +++ /dev/null @@ -1,6 +0,0 @@ -// Internal helper to generate a function to obtain property `key` from `obj`. -export default function shallowProperty(key) { - return function(obj) { - return obj == null ? void 0 : obj[key]; - }; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/_stringTagBug.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/_stringTagBug.js deleted file mode 100644 index c85dd85e..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/_stringTagBug.js +++ /dev/null @@ -1,10 +0,0 @@ -import { supportsDataView } from './_setup.js'; -import hasObjectTag from './_hasObjectTag.js'; - -// In IE 10 - Edge 13, `DataView` has string tag `'[object Object]'`. -// In IE 11, the most common among them, this problem also applies to -// `Map`, `WeakMap` and `Set`. -export var hasStringTagBug = ( - supportsDataView && hasObjectTag(new DataView(new ArrayBuffer(8))) - ), - isIE11 = (typeof Map !== 'undefined' && hasObjectTag(new Map)); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/_tagTester.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/_tagTester.js deleted file mode 100644 index 8d417dde..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/_tagTester.js +++ /dev/null @@ -1,9 +0,0 @@ -import { toString } from './_setup.js'; - -// Internal function for creating a `toString`-based type tester. -export default function tagTester(name) { - var tag = '[object ' + name + ']'; - return function(obj) { - return toString.call(obj) === tag; - }; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/_toBufferView.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/_toBufferView.js deleted file mode 100644 index dd646a52..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/_toBufferView.js +++ /dev/null @@ -1,11 +0,0 @@ -import getByteLength from './_getByteLength.js'; - -// Internal function to wrap or shallow-copy an ArrayBuffer, -// typed array or DataView to a new view, reusing the buffer. -export default function toBufferView(bufferSource) { - return new Uint8Array( - bufferSource.buffer || bufferSource, - bufferSource.byteOffset || 0, - getByteLength(bufferSource) - ); -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/_toPath.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/_toPath.js deleted file mode 100644 index fad51504..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/_toPath.js +++ /dev/null @@ -1,8 +0,0 @@ -import _ from './underscore.js'; -import './toPath.js'; - -// Internal wrapper for `_.toPath` to enable minification. -// Similar to `cb` for `_.iteratee`. -export default function toPath(path) { - return _.toPath(path); -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/_unescapeMap.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/_unescapeMap.js deleted file mode 100644 index af35e3d7..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/_unescapeMap.js +++ /dev/null @@ -1,5 +0,0 @@ -import invert from './invert.js'; -import escapeMap from './_escapeMap.js'; - -// Internal list of HTML entities for unescaping. -export default invert(escapeMap); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/after.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/after.js deleted file mode 100644 index 863e8b51..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/after.js +++ /dev/null @@ -1,8 +0,0 @@ -// Returns a function that will only be executed on and after the Nth call. -export default function after(times, func) { - return function() { - if (--times < 1) { - return func.apply(this, arguments); - } - }; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/allKeys.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/allKeys.js deleted file mode 100644 index 489cead5..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/allKeys.js +++ /dev/null @@ -1,13 +0,0 @@ -import isObject from './isObject.js'; -import { hasEnumBug } from './_setup.js'; -import collectNonEnumProps from './_collectNonEnumProps.js'; - -// Retrieve all the enumerable property names of an object. -export default function allKeys(obj) { - if (!isObject(obj)) return []; - var keys = []; - for (var key in obj) keys.push(key); - // Ahem, IE < 9. - if (hasEnumBug) collectNonEnumProps(obj, keys); - return keys; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/before.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/before.js deleted file mode 100644 index 74ec2448..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/before.js +++ /dev/null @@ -1,12 +0,0 @@ -// Returns a function that will only be executed up to (but not including) the -// Nth call. -export default function before(times, func) { - var memo; - return function() { - if (--times > 0) { - memo = func.apply(this, arguments); - } - if (times <= 1) func = null; - return memo; - }; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/bind.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/bind.js deleted file mode 100644 index c172e345..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/bind.js +++ /dev/null @@ -1,13 +0,0 @@ -import restArguments from './restArguments.js'; -import isFunction from './isFunction.js'; -import executeBound from './_executeBound.js'; - -// Create a function bound to a given object (assigning `this`, and arguments, -// optionally). -export default restArguments(function(func, context, args) { - if (!isFunction(func)) throw new TypeError('Bind must be called on a function'); - var bound = restArguments(function(callArgs) { - return executeBound(func, bound, context, this, args.concat(callArgs)); - }); - return bound; -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/bindAll.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/bindAll.js deleted file mode 100644 index da51aebd..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/bindAll.js +++ /dev/null @@ -1,17 +0,0 @@ -import restArguments from './restArguments.js'; -import flatten from './_flatten.js'; -import bind from './bind.js'; - -// Bind a number of an object's methods to that object. Remaining arguments -// are the method names to be bound. Useful for ensuring that all callbacks -// defined on an object belong to it. -export default restArguments(function(obj, keys) { - keys = flatten(keys, false, false); - var index = keys.length; - if (index < 1) throw new Error('bindAll must be passed function names'); - while (index--) { - var key = keys[index]; - obj[key] = bind(obj[key], obj); - } - return obj; -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/chain.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/chain.js deleted file mode 100644 index d9dcf057..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/chain.js +++ /dev/null @@ -1,8 +0,0 @@ -import _ from './underscore.js'; - -// Start chaining a wrapped Underscore object. -export default function chain(obj) { - var instance = _(obj); - instance._chain = true; - return instance; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/chunk.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/chunk.js deleted file mode 100644 index 5e01af5d..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/chunk.js +++ /dev/null @@ -1,13 +0,0 @@ -import { slice } from './_setup.js'; - -// Chunk a single array into multiple arrays, each containing `count` or fewer -// items. -export default function chunk(array, count) { - if (count == null || count < 1) return []; - var result = []; - var i = 0, length = array.length; - while (i < length) { - result.push(slice.call(array, i, i += count)); - } - return result; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/clone.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/clone.js deleted file mode 100644 index b74689b5..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/clone.js +++ /dev/null @@ -1,9 +0,0 @@ -import isObject from './isObject.js'; -import isArray from './isArray.js'; -import extend from './extend.js'; - -// Create a (shallow-cloned) duplicate of an object. -export default function clone(obj) { - if (!isObject(obj)) return obj; - return isArray(obj) ? obj.slice() : extend({}, obj); -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/compact.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/compact.js deleted file mode 100644 index d5d519e3..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/compact.js +++ /dev/null @@ -1,6 +0,0 @@ -import filter from './filter.js'; - -// Trim out all falsy values from an array. -export default function compact(array) { - return filter(array, Boolean); -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/compose.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/compose.js deleted file mode 100644 index 0d2584c8..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/compose.js +++ /dev/null @@ -1,12 +0,0 @@ -// Returns a function that is the composition of a list of functions, each -// consuming the return value of the function that follows. -export default function compose() { - var args = arguments; - var start = args.length - 1; - return function() { - var i = start; - var result = args[start].apply(this, arguments); - while (i--) result = args[i].call(this, result); - return result; - }; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/constant.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/constant.js deleted file mode 100644 index 6cfd92ce..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/constant.js +++ /dev/null @@ -1,6 +0,0 @@ -// Predicate-generating function. Often useful outside of Underscore. -export default function constant(value) { - return function() { - return value; - }; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/contains.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/contains.js deleted file mode 100644 index 11cf64d6..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/contains.js +++ /dev/null @@ -1,10 +0,0 @@ -import isArrayLike from './_isArrayLike.js'; -import values from './values.js'; -import indexOf from './indexOf.js'; - -// Determine if the array or object contains a given item (using `===`). -export default function contains(obj, item, fromIndex, guard) { - if (!isArrayLike(obj)) obj = values(obj); - if (typeof fromIndex != 'number' || guard) fromIndex = 0; - return indexOf(obj, item, fromIndex) >= 0; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/countBy.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/countBy.js deleted file mode 100644 index 5d4cc7d9..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/countBy.js +++ /dev/null @@ -1,9 +0,0 @@ -import group from './_group.js'; -import has from './_has.js'; - -// Counts instances of an object that group by a certain criterion. Pass -// either a string attribute to count by, or a function that returns the -// criterion. -export default group(function(result, value, key) { - if (has(result, key)) result[key]++; else result[key] = 1; -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/create.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/create.js deleted file mode 100644 index 353e5a50..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/create.js +++ /dev/null @@ -1,11 +0,0 @@ -import baseCreate from './_baseCreate.js'; -import extendOwn from './extendOwn.js'; - -// Creates an object that inherits from the given prototype object. -// If additional properties are provided then they will be added to the -// created object. -export default function create(prototype, props) { - var result = baseCreate(prototype); - if (props) extendOwn(result, props); - return result; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/debounce.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/debounce.js deleted file mode 100644 index 76e3ae82..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/debounce.js +++ /dev/null @@ -1,40 +0,0 @@ -import restArguments from './restArguments.js'; -import now from './now.js'; - -// When a sequence of calls of the returned function ends, the argument -// function is triggered. The end of a sequence is defined by the `wait` -// parameter. If `immediate` is passed, the argument function will be -// triggered at the beginning of the sequence instead of at the end. -export default function debounce(func, wait, immediate) { - var timeout, previous, args, result, context; - - var later = function() { - var passed = now() - previous; - if (wait > passed) { - timeout = setTimeout(later, wait - passed); - } else { - timeout = null; - if (!immediate) result = func.apply(context, args); - // This check is needed because `func` can recursively invoke `debounced`. - if (!timeout) args = context = null; - } - }; - - var debounced = restArguments(function(_args) { - context = this; - args = _args; - previous = now(); - if (!timeout) { - timeout = setTimeout(later, wait); - if (immediate) result = func.apply(context, args); - } - return result; - }); - - debounced.cancel = function() { - clearTimeout(timeout); - timeout = args = context = null; - }; - - return debounced; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/defaults.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/defaults.js deleted file mode 100644 index 48016cca..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/defaults.js +++ /dev/null @@ -1,5 +0,0 @@ -import createAssigner from './_createAssigner.js'; -import allKeys from './allKeys.js'; - -// Fill in a given object with default properties. -export default createAssigner(allKeys, true); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/defer.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/defer.js deleted file mode 100644 index 19c85fd5..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/defer.js +++ /dev/null @@ -1,7 +0,0 @@ -import partial from './partial.js'; -import delay from './delay.js'; -import _ from './underscore.js'; - -// Defers a function, scheduling it to run after the current call stack has -// cleared. -export default partial(delay, _, 1); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/delay.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/delay.js deleted file mode 100644 index c144a846..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/delay.js +++ /dev/null @@ -1,9 +0,0 @@ -import restArguments from './restArguments.js'; - -// Delays a function for the given number of milliseconds, and then calls -// it with the arguments supplied. -export default restArguments(function(func, wait, args) { - return setTimeout(function() { - return func.apply(null, args); - }, wait); -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/difference.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/difference.js deleted file mode 100644 index c769923d..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/difference.js +++ /dev/null @@ -1,13 +0,0 @@ -import restArguments from './restArguments.js'; -import flatten from './_flatten.js'; -import filter from './filter.js'; -import contains from './contains.js'; - -// Take the difference between one array and a number of other arrays. -// Only the elements present in just the first array will remain. -export default restArguments(function(array, rest) { - rest = flatten(rest, true, true); - return filter(array, function(value){ - return !contains(rest, value); - }); -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/each.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/each.js deleted file mode 100644 index d0502009..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/each.js +++ /dev/null @@ -1,23 +0,0 @@ -import optimizeCb from './_optimizeCb.js'; -import isArrayLike from './_isArrayLike.js'; -import keys from './keys.js'; - -// The cornerstone for collection functions, an `each` -// implementation, aka `forEach`. -// Handles raw objects in addition to array-likes. Treats all -// sparse array-likes as if they were dense. -export default function each(obj, iteratee, context) { - iteratee = optimizeCb(iteratee, context); - var i, length; - if (isArrayLike(obj)) { - for (i = 0, length = obj.length; i < length; i++) { - iteratee(obj[i], i, obj); - } - } else { - var _keys = keys(obj); - for (i = 0, length = _keys.length; i < length; i++) { - iteratee(obj[_keys[i]], _keys[i], obj); - } - } - return obj; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/escape.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/escape.js deleted file mode 100644 index 2bcb68f0..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/escape.js +++ /dev/null @@ -1,5 +0,0 @@ -import createEscaper from './_createEscaper.js'; -import escapeMap from './_escapeMap.js'; - -// Function for escaping strings to HTML interpolation. -export default createEscaper(escapeMap); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/every.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/every.js deleted file mode 100644 index 9bc1408b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/every.js +++ /dev/null @@ -1,15 +0,0 @@ -import cb from './_cb.js'; -import isArrayLike from './_isArrayLike.js'; -import keys from './keys.js'; - -// Determine whether all of the elements pass a truth test. -export default function every(obj, predicate, context) { - predicate = cb(predicate, context); - var _keys = !isArrayLike(obj) && keys(obj), - length = (_keys || obj).length; - for (var index = 0; index < length; index++) { - var currentKey = _keys ? _keys[index] : index; - if (!predicate(obj[currentKey], currentKey, obj)) return false; - } - return true; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/extend.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/extend.js deleted file mode 100644 index e22032b4..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/extend.js +++ /dev/null @@ -1,5 +0,0 @@ -import createAssigner from './_createAssigner.js'; -import allKeys from './allKeys.js'; - -// Extend a given object with all the properties in passed-in object(s). -export default createAssigner(allKeys); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/extendOwn.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/extendOwn.js deleted file mode 100644 index 5338451d..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/extendOwn.js +++ /dev/null @@ -1,7 +0,0 @@ -import createAssigner from './_createAssigner.js'; -import keys from './keys.js'; - -// Assigns a given object with all the own properties in the passed-in -// object(s). -// (https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/assign) -export default createAssigner(keys); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/filter.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/filter.js deleted file mode 100644 index d1701125..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/filter.js +++ /dev/null @@ -1,12 +0,0 @@ -import cb from './_cb.js'; -import each from './each.js'; - -// Return all the elements that pass a truth test. -export default function filter(obj, predicate, context) { - var results = []; - predicate = cb(predicate, context); - each(obj, function(value, index, list) { - if (predicate(value, index, list)) results.push(value); - }); - return results; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/find.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/find.js deleted file mode 100644 index d1f4d280..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/find.js +++ /dev/null @@ -1,10 +0,0 @@ -import isArrayLike from './_isArrayLike.js'; -import findIndex from './findIndex.js'; -import findKey from './findKey.js'; - -// Return the first value which passes a truth test. -export default function find(obj, predicate, context) { - var keyFinder = isArrayLike(obj) ? findIndex : findKey; - var key = keyFinder(obj, predicate, context); - if (key !== void 0 && key !== -1) return obj[key]; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/findIndex.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/findIndex.js deleted file mode 100644 index b2c87f51..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/findIndex.js +++ /dev/null @@ -1,4 +0,0 @@ -import createPredicateIndexFinder from './_createPredicateIndexFinder.js'; - -// Returns the first index on an array-like that passes a truth test. -export default createPredicateIndexFinder(1); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/findKey.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/findKey.js deleted file mode 100644 index e80f1c11..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/findKey.js +++ /dev/null @@ -1,12 +0,0 @@ -import cb from './_cb.js'; -import keys from './keys.js'; - -// Returns the first key on an object that passes a truth test. -export default function findKey(obj, predicate, context) { - predicate = cb(predicate, context); - var _keys = keys(obj), key; - for (var i = 0, length = _keys.length; i < length; i++) { - key = _keys[i]; - if (predicate(obj[key], key, obj)) return key; - } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/findLastIndex.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/findLastIndex.js deleted file mode 100644 index 58f26a73..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/findLastIndex.js +++ /dev/null @@ -1,4 +0,0 @@ -import createPredicateIndexFinder from './_createPredicateIndexFinder.js'; - -// Returns the last index on an array-like that passes a truth test. -export default createPredicateIndexFinder(-1); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/findWhere.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/findWhere.js deleted file mode 100644 index 6e8bce9e..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/findWhere.js +++ /dev/null @@ -1,8 +0,0 @@ -import find from './find.js'; -import matcher from './matcher.js'; - -// Convenience version of a common use case of `_.find`: getting the first -// object containing specific `key:value` pairs. -export default function findWhere(obj, attrs) { - return find(obj, matcher(attrs)); -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/first.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/first.js deleted file mode 100644 index 3b6685e1..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/first.js +++ /dev/null @@ -1,9 +0,0 @@ -import initial from './initial.js'; - -// Get the first element of an array. Passing **n** will return the first N -// values in the array. The **guard** check allows it to work with `_.map`. -export default function first(array, n, guard) { - if (array == null || array.length < 1) return n == null || guard ? void 0 : []; - if (n == null || guard) return array[0]; - return initial(array, array.length - n); -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/flatten.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/flatten.js deleted file mode 100644 index a5f2b512..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/flatten.js +++ /dev/null @@ -1,7 +0,0 @@ -import _flatten from './_flatten.js'; - -// Flatten out an array, either recursively (by default), or up to `depth`. -// Passing `true` or `false` as `depth` means `1` or `Infinity`, respectively. -export default function flatten(array, depth) { - return _flatten(array, depth, false); -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/functions.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/functions.js deleted file mode 100644 index a16e5683..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/functions.js +++ /dev/null @@ -1,10 +0,0 @@ -import isFunction from './isFunction.js'; - -// Return a sorted list of the function names available on the object. -export default function functions(obj) { - var names = []; - for (var key in obj) { - if (isFunction(obj[key])) names.push(key); - } - return names.sort(); -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/get.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/get.js deleted file mode 100644 index 6987abe6..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/get.js +++ /dev/null @@ -1,12 +0,0 @@ -import toPath from './_toPath.js'; -import deepGet from './_deepGet.js'; -import isUndefined from './isUndefined.js'; - -// Get the value of the (deep) property on `path` from `object`. -// If any property in `path` does not exist or if the value is -// `undefined`, return `defaultValue` instead. -// The `path` is normalized through `_.toPath`. -export default function get(object, path, defaultValue) { - var value = deepGet(object, toPath(path)); - return isUndefined(value) ? defaultValue : value; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/groupBy.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/groupBy.js deleted file mode 100644 index 2670958d..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/groupBy.js +++ /dev/null @@ -1,8 +0,0 @@ -import group from './_group.js'; -import has from './_has.js'; - -// Groups the object's values by a criterion. Pass either a string attribute -// to group by, or a function that returns the criterion. -export default group(function(result, value, key) { - if (has(result, key)) result[key].push(value); else result[key] = [value]; -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/has.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/has.js deleted file mode 100644 index 72326463..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/has.js +++ /dev/null @@ -1,16 +0,0 @@ -import _has from './_has.js'; -import toPath from './_toPath.js'; - -// Shortcut function for checking if an object has a given property directly on -// itself (in other words, not on a prototype). Unlike the internal `has` -// function, this public version can also traverse nested properties. -export default function has(obj, path) { - path = toPath(path); - var length = path.length; - for (var i = 0; i < length; i++) { - var key = path[i]; - if (!_has(obj, key)) return false; - obj = obj[key]; - } - return !!length; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/identity.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/identity.js deleted file mode 100644 index 6df631c1..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/identity.js +++ /dev/null @@ -1,4 +0,0 @@ -// Keep the identity function around for default iteratees. -export default function identity(value) { - return value; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/index-all.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/index-all.js deleted file mode 100644 index dd2cbc1d..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/index-all.js +++ /dev/null @@ -1,18 +0,0 @@ -// ESM Exports -// =========== -// This module is the package entry point for ES module users. In other words, -// it is the module they are interfacing with when they import from the whole -// package instead of from a submodule, like this: -// -// ```js -// import { map } from 'underscore'; -// ``` -// -// The difference with `./index-default`, which is the package entry point for -// CommonJS, AMD and UMD users, is purely technical. In ES modules, named and -// default exports are considered to be siblings, so when you have a default -// export, its properties are not automatically available as named exports. For -// this reason, we re-export the named exports in addition to providing the same -// default export as in `./index-default`. -export { default } from './index-default.js'; -export * from './index.js'; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/index-default.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/index-default.js deleted file mode 100644 index d3a2b1e8..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/index-default.js +++ /dev/null @@ -1,27 +0,0 @@ -// Default Export -// ============== -// In this module, we mix our bundled exports into the `_` object and export -// the result. This is analogous to setting `module.exports = _` in CommonJS. -// Hence, this module is also the entry point of our UMD bundle and the package -// entry point for CommonJS and AMD users. In other words, this is (the source -// of) the module you are interfacing with when you do any of the following: -// -// ```js -// // CommonJS -// var _ = require('underscore'); -// -// // AMD -// define(['underscore'], function(_) {...}); -// -// // UMD in the browser -// // _ is available as a global variable -// ``` -import * as allExports from './index.js'; -import { mixin } from './index.js'; - -// Add all of the Underscore functions to the wrapper object. -var _ = mixin(allExports); -// Legacy Node.js API. -_._ = _; -// Export the Underscore API. -export default _; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/index.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/index.js deleted file mode 100644 index 9d76652a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/index.js +++ /dev/null @@ -1,200 +0,0 @@ -// Named Exports -// ============= - -// Underscore.js 1.13.6 -// https://underscorejs.org -// (c) 2009-2022 Jeremy Ashkenas, Julian Gonggrijp, and DocumentCloud and Investigative Reporters & Editors -// Underscore may be freely distributed under the MIT license. - -// Baseline setup. -export { VERSION } from './_setup.js'; -export { default as restArguments } from './restArguments.js'; - -// Object Functions -// ---------------- -// Our most fundamental functions operate on any JavaScript object. -// Most functions in Underscore depend on at least one function in this section. - -// A group of functions that check the types of core JavaScript values. -// These are often informally referred to as the "isType" functions. -export { default as isObject } from './isObject.js'; -export { default as isNull } from './isNull.js'; -export { default as isUndefined } from './isUndefined.js'; -export { default as isBoolean } from './isBoolean.js'; -export { default as isElement } from './isElement.js'; -export { default as isString } from './isString.js'; -export { default as isNumber } from './isNumber.js'; -export { default as isDate } from './isDate.js'; -export { default as isRegExp } from './isRegExp.js'; -export { default as isError } from './isError.js'; -export { default as isSymbol } from './isSymbol.js'; -export { default as isArrayBuffer } from './isArrayBuffer.js'; -export { default as isDataView } from './isDataView.js'; -export { default as isArray } from './isArray.js'; -export { default as isFunction } from './isFunction.js'; -export { default as isArguments } from './isArguments.js'; -export { default as isFinite } from './isFinite.js'; -export { default as isNaN } from './isNaN.js'; -export { default as isTypedArray } from './isTypedArray.js'; -export { default as isEmpty } from './isEmpty.js'; -export { default as isMatch } from './isMatch.js'; -export { default as isEqual } from './isEqual.js'; -export { default as isMap } from './isMap.js'; -export { default as isWeakMap } from './isWeakMap.js'; -export { default as isSet } from './isSet.js'; -export { default as isWeakSet } from './isWeakSet.js'; - -// Functions that treat an object as a dictionary of key-value pairs. -export { default as keys } from './keys.js'; -export { default as allKeys } from './allKeys.js'; -export { default as values } from './values.js'; -export { default as pairs } from './pairs.js'; -export { default as invert } from './invert.js'; -export { default as functions, - default as methods } from './functions.js'; -export { default as extend } from './extend.js'; -export { default as extendOwn, - default as assign } from './extendOwn.js'; -export { default as defaults } from './defaults.js'; -export { default as create } from './create.js'; -export { default as clone } from './clone.js'; -export { default as tap } from './tap.js'; -export { default as get } from './get.js'; -export { default as has } from './has.js'; -export { default as mapObject } from './mapObject.js'; - -// Utility Functions -// ----------------- -// A bit of a grab bag: Predicate-generating functions for use with filters and -// loops, string escaping and templating, create random numbers and unique ids, -// and functions that facilitate Underscore's chaining and iteration conventions. -export { default as identity } from './identity.js'; -export { default as constant } from './constant.js'; -export { default as noop } from './noop.js'; -export { default as toPath } from './toPath.js'; -export { default as property } from './property.js'; -export { default as propertyOf } from './propertyOf.js'; -export { default as matcher, - default as matches } from './matcher.js'; -export { default as times } from './times.js'; -export { default as random } from './random.js'; -export { default as now } from './now.js'; -export { default as escape } from './escape.js'; -export { default as unescape } from './unescape.js'; -export { default as templateSettings } from './templateSettings.js'; -export { default as template } from './template.js'; -export { default as result } from './result.js'; -export { default as uniqueId } from './uniqueId.js'; -export { default as chain } from './chain.js'; -export { default as iteratee } from './iteratee.js'; - -// Function (ahem) Functions -// ------------------------- -// These functions take a function as an argument and return a new function -// as the result. Also known as higher-order functions. -export { default as partial } from './partial.js'; -export { default as bind } from './bind.js'; -export { default as bindAll } from './bindAll.js'; -export { default as memoize } from './memoize.js'; -export { default as delay } from './delay.js'; -export { default as defer } from './defer.js'; -export { default as throttle } from './throttle.js'; -export { default as debounce } from './debounce.js'; -export { default as wrap } from './wrap.js'; -export { default as negate } from './negate.js'; -export { default as compose } from './compose.js'; -export { default as after } from './after.js'; -export { default as before } from './before.js'; -export { default as once } from './once.js'; - -// Finders -// ------- -// Functions that extract (the position of) a single element from an object -// or array based on some criterion. -export { default as findKey } from './findKey.js'; -export { default as findIndex } from './findIndex.js'; -export { default as findLastIndex } from './findLastIndex.js'; -export { default as sortedIndex } from './sortedIndex.js'; -export { default as indexOf } from './indexOf.js'; -export { default as lastIndexOf } from './lastIndexOf.js'; -export { default as find, - default as detect } from './find.js'; -export { default as findWhere } from './findWhere.js'; - -// Collection Functions -// -------------------- -// Functions that work on any collection of elements: either an array, or -// an object of key-value pairs. -export { default as each, - default as forEach } from './each.js'; -export { default as map, - default as collect } from './map.js'; -export { default as reduce, - default as foldl, - default as inject } from './reduce.js'; -export { default as reduceRight, - default as foldr } from './reduceRight.js'; -export { default as filter, - default as select } from './filter.js'; -export { default as reject } from './reject.js'; -export { default as every, - default as all } from './every.js'; -export { default as some, - default as any } from './some.js'; -export { default as contains, - default as includes, - default as include } from './contains.js'; -export { default as invoke } from './invoke.js'; -export { default as pluck } from './pluck.js'; -export { default as where } from './where.js'; -export { default as max } from './max.js'; -export { default as min } from './min.js'; -export { default as shuffle } from './shuffle.js'; -export { default as sample } from './sample.js'; -export { default as sortBy } from './sortBy.js'; -export { default as groupBy } from './groupBy.js'; -export { default as indexBy } from './indexBy.js'; -export { default as countBy } from './countBy.js'; -export { default as partition } from './partition.js'; -export { default as toArray } from './toArray.js'; -export { default as size } from './size.js'; - -// `_.pick` and `_.omit` are actually object functions, but we put -// them here in order to create a more natural reading order in the -// monolithic build as they depend on `_.contains`. -export { default as pick } from './pick.js'; -export { default as omit } from './omit.js'; - -// Array Functions -// --------------- -// Functions that operate on arrays (and array-likes) only, because they’re -// expressed in terms of operations on an ordered list of values. -export { default as first, - default as head, - default as take } from './first.js'; -export { default as initial } from './initial.js'; -export { default as last } from './last.js'; -export { default as rest, - default as tail, - default as drop } from './rest.js'; -export { default as compact } from './compact.js'; -export { default as flatten } from './flatten.js'; -export { default as without } from './without.js'; -export { default as uniq, - default as unique } from './uniq.js'; -export { default as union } from './union.js'; -export { default as intersection } from './intersection.js'; -export { default as difference } from './difference.js'; -export { default as unzip, - default as transpose } from './unzip.js'; -export { default as zip } from './zip.js'; -export { default as object } from './object.js'; -export { default as range } from './range.js'; -export { default as chunk } from './chunk.js'; - -// OOP -// --- -// These modules support the "object-oriented" calling style. See also -// `underscore.js` and `index-default.js`. -export { default as mixin } from './mixin.js'; -export { default } from './underscore-array-methods.js'; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/indexBy.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/indexBy.js deleted file mode 100644 index 8fb81ea0..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/indexBy.js +++ /dev/null @@ -1,7 +0,0 @@ -import group from './_group.js'; - -// Indexes the object's values by a criterion, similar to `_.groupBy`, but for -// when you know that your index values will be unique. -export default group(function(result, value, key) { - result[key] = value; -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/indexOf.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/indexOf.js deleted file mode 100644 index a926ba5a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/indexOf.js +++ /dev/null @@ -1,9 +0,0 @@ -import sortedIndex from './sortedIndex.js'; -import findIndex from './findIndex.js'; -import createIndexFinder from './_createIndexFinder.js'; - -// Return the position of the first occurrence of an item in an array, -// or -1 if the item is not included in the array. -// If the array is large and already in sort order, pass `true` -// for **isSorted** to use binary search. -export default createIndexFinder(1, findIndex, sortedIndex); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/initial.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/initial.js deleted file mode 100644 index 0b991dcc..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/initial.js +++ /dev/null @@ -1,8 +0,0 @@ -import { slice } from './_setup.js'; - -// Returns everything but the last entry of the array. Especially useful on -// the arguments object. Passing **n** will return all the values in -// the array, excluding the last N. -export default function initial(array, n, guard) { - return slice.call(array, 0, Math.max(0, array.length - (n == null || guard ? 1 : n))); -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/intersection.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/intersection.js deleted file mode 100644 index 60d1df40..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/intersection.js +++ /dev/null @@ -1,19 +0,0 @@ -import getLength from './_getLength.js'; -import contains from './contains.js'; - -// Produce an array that contains every item shared between all the -// passed-in arrays. -export default function intersection(array) { - var result = []; - var argsLength = arguments.length; - for (var i = 0, length = getLength(array); i < length; i++) { - var item = array[i]; - if (contains(result, item)) continue; - var j; - for (j = 1; j < argsLength; j++) { - if (!contains(arguments[j], item)) break; - } - if (j === argsLength) result.push(item); - } - return result; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/invert.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/invert.js deleted file mode 100644 index 898b16a0..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/invert.js +++ /dev/null @@ -1,11 +0,0 @@ -import keys from './keys.js'; - -// Invert the keys and values of an object. The values must be serializable. -export default function invert(obj) { - var result = {}; - var _keys = keys(obj); - for (var i = 0, length = _keys.length; i < length; i++) { - result[obj[_keys[i]]] = _keys[i]; - } - return result; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/invoke.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/invoke.js deleted file mode 100644 index b18af887..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/invoke.js +++ /dev/null @@ -1,28 +0,0 @@ -import restArguments from './restArguments.js'; -import isFunction from './isFunction.js'; -import map from './map.js'; -import deepGet from './_deepGet.js'; -import toPath from './_toPath.js'; - -// Invoke a method (with arguments) on every item in a collection. -export default restArguments(function(obj, path, args) { - var contextPath, func; - if (isFunction(path)) { - func = path; - } else { - path = toPath(path); - contextPath = path.slice(0, -1); - path = path[path.length - 1]; - } - return map(obj, function(context) { - var method = func; - if (!method) { - if (contextPath && contextPath.length) { - context = deepGet(context, contextPath); - } - if (context == null) return void 0; - method = context[path]; - } - return method == null ? method : method.apply(context, args); - }); -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/isArguments.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/isArguments.js deleted file mode 100644 index 61582bf8..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/isArguments.js +++ /dev/null @@ -1,16 +0,0 @@ -import tagTester from './_tagTester.js'; -import has from './_has.js'; - -var isArguments = tagTester('Arguments'); - -// Define a fallback version of the method in browsers (ahem, IE < 9), where -// there isn't any inspectable "Arguments" type. -(function() { - if (!isArguments(arguments)) { - isArguments = function(obj) { - return has(obj, 'callee'); - }; - } -}()); - -export default isArguments; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/isArray.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/isArray.js deleted file mode 100644 index 7ead47d7..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/isArray.js +++ /dev/null @@ -1,6 +0,0 @@ -import { nativeIsArray } from './_setup.js'; -import tagTester from './_tagTester.js'; - -// Is a given value an array? -// Delegates to ECMA5's native `Array.isArray`. -export default nativeIsArray || tagTester('Array'); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/isArrayBuffer.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/isArrayBuffer.js deleted file mode 100644 index 867ba4b2..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/isArrayBuffer.js +++ /dev/null @@ -1,3 +0,0 @@ -import tagTester from './_tagTester.js'; - -export default tagTester('ArrayBuffer'); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/isBoolean.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/isBoolean.js deleted file mode 100644 index 3dddf2c1..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/isBoolean.js +++ /dev/null @@ -1,6 +0,0 @@ -import { toString } from './_setup.js'; - -// Is a given value a boolean? -export default function isBoolean(obj) { - return obj === true || obj === false || toString.call(obj) === '[object Boolean]'; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/isDataView.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/isDataView.js deleted file mode 100644 index e607856a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/isDataView.js +++ /dev/null @@ -1,14 +0,0 @@ -import tagTester from './_tagTester.js'; -import isFunction from './isFunction.js'; -import isArrayBuffer from './isArrayBuffer.js'; -import { hasStringTagBug } from './_stringTagBug.js'; - -var isDataView = tagTester('DataView'); - -// In IE 10 - Edge 13, we need a different heuristic -// to determine whether an object is a `DataView`. -function ie10IsDataView(obj) { - return obj != null && isFunction(obj.getInt8) && isArrayBuffer(obj.buffer); -} - -export default (hasStringTagBug ? ie10IsDataView : isDataView); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/isDate.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/isDate.js deleted file mode 100644 index 25e1d1c3..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/isDate.js +++ /dev/null @@ -1,3 +0,0 @@ -import tagTester from './_tagTester.js'; - -export default tagTester('Date'); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/isElement.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/isElement.js deleted file mode 100644 index 4ab415a8..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/isElement.js +++ /dev/null @@ -1,4 +0,0 @@ -// Is a given value a DOM element? -export default function isElement(obj) { - return !!(obj && obj.nodeType === 1); -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/isEmpty.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/isEmpty.js deleted file mode 100644 index 718ef4a6..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/isEmpty.js +++ /dev/null @@ -1,18 +0,0 @@ -import getLength from './_getLength.js'; -import isArray from './isArray.js'; -import isString from './isString.js'; -import isArguments from './isArguments.js'; -import keys from './keys.js'; - -// Is a given array, string, or object empty? -// An "empty" object has no enumerable own-properties. -export default function isEmpty(obj) { - if (obj == null) return true; - // Skip the more expensive `toString`-based type checks if `obj` has no - // `.length`. - var length = getLength(obj); - if (typeof length == 'number' && ( - isArray(obj) || isString(obj) || isArguments(obj) - )) return length === 0; - return getLength(keys(obj)) === 0; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/isEqual.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/isEqual.js deleted file mode 100644 index 5285c55a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/isEqual.js +++ /dev/null @@ -1,138 +0,0 @@ -import _ from './underscore.js'; -import { toString, SymbolProto } from './_setup.js'; -import getByteLength from './_getByteLength.js'; -import isTypedArray from './isTypedArray.js'; -import isFunction from './isFunction.js'; -import { hasStringTagBug } from './_stringTagBug.js'; -import isDataView from './isDataView.js'; -import keys from './keys.js'; -import has from './_has.js'; -import toBufferView from './_toBufferView.js'; - -// We use this string twice, so give it a name for minification. -var tagDataView = '[object DataView]'; - -// Internal recursive comparison function for `_.isEqual`. -function eq(a, b, aStack, bStack) { - // Identical objects are equal. `0 === -0`, but they aren't identical. - // See the [Harmony `egal` proposal](https://wiki.ecmascript.org/doku.php?id=harmony:egal). - if (a === b) return a !== 0 || 1 / a === 1 / b; - // `null` or `undefined` only equal to itself (strict comparison). - if (a == null || b == null) return false; - // `NaN`s are equivalent, but non-reflexive. - if (a !== a) return b !== b; - // Exhaust primitive checks - var type = typeof a; - if (type !== 'function' && type !== 'object' && typeof b != 'object') return false; - return deepEq(a, b, aStack, bStack); -} - -// Internal recursive comparison function for `_.isEqual`. -function deepEq(a, b, aStack, bStack) { - // Unwrap any wrapped objects. - if (a instanceof _) a = a._wrapped; - if (b instanceof _) b = b._wrapped; - // Compare `[[Class]]` names. - var className = toString.call(a); - if (className !== toString.call(b)) return false; - // Work around a bug in IE 10 - Edge 13. - if (hasStringTagBug && className == '[object Object]' && isDataView(a)) { - if (!isDataView(b)) return false; - className = tagDataView; - } - switch (className) { - // These types are compared by value. - case '[object RegExp]': - // RegExps are coerced to strings for comparison (Note: '' + /a/i === '/a/i') - case '[object String]': - // Primitives and their corresponding object wrappers are equivalent; thus, `"5"` is - // equivalent to `new String("5")`. - return '' + a === '' + b; - case '[object Number]': - // `NaN`s are equivalent, but non-reflexive. - // Object(NaN) is equivalent to NaN. - if (+a !== +a) return +b !== +b; - // An `egal` comparison is performed for other numeric values. - return +a === 0 ? 1 / +a === 1 / b : +a === +b; - case '[object Date]': - case '[object Boolean]': - // Coerce dates and booleans to numeric primitive values. Dates are compared by their - // millisecond representations. Note that invalid dates with millisecond representations - // of `NaN` are not equivalent. - return +a === +b; - case '[object Symbol]': - return SymbolProto.valueOf.call(a) === SymbolProto.valueOf.call(b); - case '[object ArrayBuffer]': - case tagDataView: - // Coerce to typed array so we can fall through. - return deepEq(toBufferView(a), toBufferView(b), aStack, bStack); - } - - var areArrays = className === '[object Array]'; - if (!areArrays && isTypedArray(a)) { - var byteLength = getByteLength(a); - if (byteLength !== getByteLength(b)) return false; - if (a.buffer === b.buffer && a.byteOffset === b.byteOffset) return true; - areArrays = true; - } - if (!areArrays) { - if (typeof a != 'object' || typeof b != 'object') return false; - - // Objects with different constructors are not equivalent, but `Object`s or `Array`s - // from different frames are. - var aCtor = a.constructor, bCtor = b.constructor; - if (aCtor !== bCtor && !(isFunction(aCtor) && aCtor instanceof aCtor && - isFunction(bCtor) && bCtor instanceof bCtor) - && ('constructor' in a && 'constructor' in b)) { - return false; - } - } - // Assume equality for cyclic structures. The algorithm for detecting cyclic - // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`. - - // Initializing stack of traversed objects. - // It's done here since we only need them for objects and arrays comparison. - aStack = aStack || []; - bStack = bStack || []; - var length = aStack.length; - while (length--) { - // Linear search. Performance is inversely proportional to the number of - // unique nested structures. - if (aStack[length] === a) return bStack[length] === b; - } - - // Add the first object to the stack of traversed objects. - aStack.push(a); - bStack.push(b); - - // Recursively compare objects and arrays. - if (areArrays) { - // Compare array lengths to determine if a deep comparison is necessary. - length = a.length; - if (length !== b.length) return false; - // Deep compare the contents, ignoring non-numeric properties. - while (length--) { - if (!eq(a[length], b[length], aStack, bStack)) return false; - } - } else { - // Deep compare objects. - var _keys = keys(a), key; - length = _keys.length; - // Ensure that both objects contain the same number of properties before comparing deep equality. - if (keys(b).length !== length) return false; - while (length--) { - // Deep compare each member - key = _keys[length]; - if (!(has(b, key) && eq(a[key], b[key], aStack, bStack))) return false; - } - } - // Remove the first object from the stack of traversed objects. - aStack.pop(); - bStack.pop(); - return true; -} - -// Perform a deep comparison to check if two objects are equal. -export default function isEqual(a, b) { - return eq(a, b); -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/isError.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/isError.js deleted file mode 100644 index 178fa3ec..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/isError.js +++ /dev/null @@ -1,3 +0,0 @@ -import tagTester from './_tagTester.js'; - -export default tagTester('Error'); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/isFinite.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/isFinite.js deleted file mode 100644 index fbeb79ef..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/isFinite.js +++ /dev/null @@ -1,7 +0,0 @@ -import { _isFinite } from './_setup.js'; -import isSymbol from './isSymbol.js'; - -// Is a given object a finite number? -export default function isFinite(obj) { - return !isSymbol(obj) && _isFinite(obj) && !isNaN(parseFloat(obj)); -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/isFunction.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/isFunction.js deleted file mode 100644 index 35c41be0..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/isFunction.js +++ /dev/null @@ -1,15 +0,0 @@ -import tagTester from './_tagTester.js'; -import { root } from './_setup.js'; - -var isFunction = tagTester('Function'); - -// Optimize `isFunction` if appropriate. Work around some `typeof` bugs in old -// v8, IE 11 (#1621), Safari 8 (#1929), and PhantomJS (#2236). -var nodelist = root.document && root.document.childNodes; -if (typeof /./ != 'function' && typeof Int8Array != 'object' && typeof nodelist != 'function') { - isFunction = function(obj) { - return typeof obj == 'function' || false; - }; -} - -export default isFunction; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/isMap.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/isMap.js deleted file mode 100644 index 1e9f0954..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/isMap.js +++ /dev/null @@ -1,5 +0,0 @@ -import tagTester from './_tagTester.js'; -import { isIE11 } from './_stringTagBug.js'; -import { ie11fingerprint, mapMethods } from './_methodFingerprint.js'; - -export default isIE11 ? ie11fingerprint(mapMethods) : tagTester('Map'); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/isMatch.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/isMatch.js deleted file mode 100644 index 81e43d95..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/isMatch.js +++ /dev/null @@ -1,13 +0,0 @@ -import keys from './keys.js'; - -// Returns whether an object has a given set of `key:value` pairs. -export default function isMatch(object, attrs) { - var _keys = keys(attrs), length = _keys.length; - if (object == null) return !length; - var obj = Object(object); - for (var i = 0; i < length; i++) { - var key = _keys[i]; - if (attrs[key] !== obj[key] || !(key in obj)) return false; - } - return true; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/isNaN.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/isNaN.js deleted file mode 100644 index 9fa7afee..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/isNaN.js +++ /dev/null @@ -1,7 +0,0 @@ -import { _isNaN } from './_setup.js'; -import isNumber from './isNumber.js'; - -// Is the given value `NaN`? -export default function isNaN(obj) { - return isNumber(obj) && _isNaN(obj); -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/isNull.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/isNull.js deleted file mode 100644 index e729c2ee..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/isNull.js +++ /dev/null @@ -1,4 +0,0 @@ -// Is a given value equal to null? -export default function isNull(obj) { - return obj === null; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/isNumber.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/isNumber.js deleted file mode 100644 index 627d8d4d..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/isNumber.js +++ /dev/null @@ -1,3 +0,0 @@ -import tagTester from './_tagTester.js'; - -export default tagTester('Number'); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/isObject.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/isObject.js deleted file mode 100644 index db4675a8..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/isObject.js +++ /dev/null @@ -1,5 +0,0 @@ -// Is a given variable an object? -export default function isObject(obj) { - var type = typeof obj; - return type === 'function' || (type === 'object' && !!obj); -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/isRegExp.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/isRegExp.js deleted file mode 100644 index ef64d1e8..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/isRegExp.js +++ /dev/null @@ -1,3 +0,0 @@ -import tagTester from './_tagTester.js'; - -export default tagTester('RegExp'); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/isSet.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/isSet.js deleted file mode 100644 index 0e8b6ca6..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/isSet.js +++ /dev/null @@ -1,5 +0,0 @@ -import tagTester from './_tagTester.js'; -import { isIE11 } from './_stringTagBug.js'; -import { ie11fingerprint, setMethods } from './_methodFingerprint.js'; - -export default isIE11 ? ie11fingerprint(setMethods) : tagTester('Set'); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/isString.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/isString.js deleted file mode 100644 index f02707d3..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/isString.js +++ /dev/null @@ -1,3 +0,0 @@ -import tagTester from './_tagTester.js'; - -export default tagTester('String'); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/isSymbol.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/isSymbol.js deleted file mode 100644 index de4050d5..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/isSymbol.js +++ /dev/null @@ -1,3 +0,0 @@ -import tagTester from './_tagTester.js'; - -export default tagTester('Symbol'); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/isTypedArray.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/isTypedArray.js deleted file mode 100644 index a65c917e..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/isTypedArray.js +++ /dev/null @@ -1,15 +0,0 @@ -import { supportsArrayBuffer, nativeIsView, toString } from './_setup.js'; -import isDataView from './isDataView.js'; -import constant from './constant.js'; -import isBufferLike from './_isBufferLike.js'; - -// Is a given value a typed array? -var typedArrayPattern = /\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/; -function isTypedArray(obj) { - // `ArrayBuffer.isView` is the most future-proof, so use it when available. - // Otherwise, fall back on the above regular expression. - return nativeIsView ? (nativeIsView(obj) && !isDataView(obj)) : - isBufferLike(obj) && typedArrayPattern.test(toString.call(obj)); -} - -export default supportsArrayBuffer ? isTypedArray : constant(false); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/isUndefined.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/isUndefined.js deleted file mode 100644 index eddf88f1..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/isUndefined.js +++ /dev/null @@ -1,4 +0,0 @@ -// Is a given variable undefined? -export default function isUndefined(obj) { - return obj === void 0; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/isWeakMap.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/isWeakMap.js deleted file mode 100644 index 729ca474..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/isWeakMap.js +++ /dev/null @@ -1,5 +0,0 @@ -import tagTester from './_tagTester.js'; -import { isIE11 } from './_stringTagBug.js'; -import { ie11fingerprint, weakMapMethods } from './_methodFingerprint.js'; - -export default isIE11 ? ie11fingerprint(weakMapMethods) : tagTester('WeakMap'); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/isWeakSet.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/isWeakSet.js deleted file mode 100644 index 5331048e..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/isWeakSet.js +++ /dev/null @@ -1,3 +0,0 @@ -import tagTester from './_tagTester.js'; - -export default tagTester('WeakSet'); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/iteratee.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/iteratee.js deleted file mode 100644 index 9057701b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/iteratee.js +++ /dev/null @@ -1,10 +0,0 @@ -import _ from './underscore.js'; -import baseIteratee from './_baseIteratee.js'; - -// External wrapper for our callback generator. Users may customize -// `_.iteratee` if they want additional predicate/iteratee shorthand styles. -// This abstraction hides the internal-only `argCount` argument. -export default function iteratee(value, context) { - return baseIteratee(value, context, Infinity); -} -_.iteratee = iteratee; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/keys.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/keys.js deleted file mode 100644 index f5b596cf..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/keys.js +++ /dev/null @@ -1,16 +0,0 @@ -import isObject from './isObject.js'; -import { nativeKeys, hasEnumBug } from './_setup.js'; -import has from './_has.js'; -import collectNonEnumProps from './_collectNonEnumProps.js'; - -// Retrieve the names of an object's own properties. -// Delegates to **ECMAScript 5**'s native `Object.keys`. -export default function keys(obj) { - if (!isObject(obj)) return []; - if (nativeKeys) return nativeKeys(obj); - var keys = []; - for (var key in obj) if (has(obj, key)) keys.push(key); - // Ahem, IE < 9. - if (hasEnumBug) collectNonEnumProps(obj, keys); - return keys; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/last.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/last.js deleted file mode 100644 index 3f30ebc1..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/last.js +++ /dev/null @@ -1,9 +0,0 @@ -import rest from './rest.js'; - -// Get the last element of an array. Passing **n** will return the last N -// values in the array. -export default function last(array, n, guard) { - if (array == null || array.length < 1) return n == null || guard ? void 0 : []; - if (n == null || guard) return array[array.length - 1]; - return rest(array, Math.max(0, array.length - n)); -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/lastIndexOf.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/lastIndexOf.js deleted file mode 100644 index bcacf495..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/lastIndexOf.js +++ /dev/null @@ -1,6 +0,0 @@ -import findLastIndex from './findLastIndex.js'; -import createIndexFinder from './_createIndexFinder.js'; - -// Return the position of the last occurrence of an item in an array, -// or -1 if the item is not included in the array. -export default createIndexFinder(-1, findLastIndex); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/map.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/map.js deleted file mode 100644 index a2e51216..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/map.js +++ /dev/null @@ -1,16 +0,0 @@ -import cb from './_cb.js'; -import isArrayLike from './_isArrayLike.js'; -import keys from './keys.js'; - -// Return the results of applying the iteratee to each element. -export default function map(obj, iteratee, context) { - iteratee = cb(iteratee, context); - var _keys = !isArrayLike(obj) && keys(obj), - length = (_keys || obj).length, - results = Array(length); - for (var index = 0; index < length; index++) { - var currentKey = _keys ? _keys[index] : index; - results[index] = iteratee(obj[currentKey], currentKey, obj); - } - return results; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/mapObject.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/mapObject.js deleted file mode 100644 index 2b44d286..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/mapObject.js +++ /dev/null @@ -1,16 +0,0 @@ -import cb from './_cb.js'; -import keys from './keys.js'; - -// Returns the results of applying the `iteratee` to each element of `obj`. -// In contrast to `_.map` it returns an object. -export default function mapObject(obj, iteratee, context) { - iteratee = cb(iteratee, context); - var _keys = keys(obj), - length = _keys.length, - results = {}; - for (var index = 0; index < length; index++) { - var currentKey = _keys[index]; - results[currentKey] = iteratee(obj[currentKey], currentKey, obj); - } - return results; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/matcher.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/matcher.js deleted file mode 100644 index 245fa944..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/matcher.js +++ /dev/null @@ -1,11 +0,0 @@ -import extendOwn from './extendOwn.js'; -import isMatch from './isMatch.js'; - -// Returns a predicate for checking whether an object has a given set of -// `key:value` pairs. -export default function matcher(attrs) { - attrs = extendOwn({}, attrs); - return function(obj) { - return isMatch(obj, attrs); - }; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/max.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/max.js deleted file mode 100644 index e3254097..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/max.js +++ /dev/null @@ -1,29 +0,0 @@ -import isArrayLike from './_isArrayLike.js'; -import values from './values.js'; -import cb from './_cb.js'; -import each from './each.js'; - -// Return the maximum element (or element-based computation). -export default function max(obj, iteratee, context) { - var result = -Infinity, lastComputed = -Infinity, - value, computed; - if (iteratee == null || (typeof iteratee == 'number' && typeof obj[0] != 'object' && obj != null)) { - obj = isArrayLike(obj) ? obj : values(obj); - for (var i = 0, length = obj.length; i < length; i++) { - value = obj[i]; - if (value != null && value > result) { - result = value; - } - } - } else { - iteratee = cb(iteratee, context); - each(obj, function(v, index, list) { - computed = iteratee(v, index, list); - if (computed > lastComputed || (computed === -Infinity && result === -Infinity)) { - result = v; - lastComputed = computed; - } - }); - } - return result; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/memoize.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/memoize.js deleted file mode 100644 index 50c55f53..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/memoize.js +++ /dev/null @@ -1,13 +0,0 @@ -import has from './_has.js'; - -// Memoize an expensive function by storing its results. -export default function memoize(func, hasher) { - var memoize = function(key) { - var cache = memoize.cache; - var address = '' + (hasher ? hasher.apply(this, arguments) : key); - if (!has(cache, address)) cache[address] = func.apply(this, arguments); - return cache[address]; - }; - memoize.cache = {}; - return memoize; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/min.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/min.js deleted file mode 100644 index c6b25fd8..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/min.js +++ /dev/null @@ -1,29 +0,0 @@ -import isArrayLike from './_isArrayLike.js'; -import values from './values.js'; -import cb from './_cb.js'; -import each from './each.js'; - -// Return the minimum element (or element-based computation). -export default function min(obj, iteratee, context) { - var result = Infinity, lastComputed = Infinity, - value, computed; - if (iteratee == null || (typeof iteratee == 'number' && typeof obj[0] != 'object' && obj != null)) { - obj = isArrayLike(obj) ? obj : values(obj); - for (var i = 0, length = obj.length; i < length; i++) { - value = obj[i]; - if (value != null && value < result) { - result = value; - } - } - } else { - iteratee = cb(iteratee, context); - each(obj, function(v, index, list) { - computed = iteratee(v, index, list); - if (computed < lastComputed || (computed === Infinity && result === Infinity)) { - result = v; - lastComputed = computed; - } - }); - } - return result; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/mixin.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/mixin.js deleted file mode 100644 index 352a76ad..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/mixin.js +++ /dev/null @@ -1,18 +0,0 @@ -import _ from './underscore.js'; -import each from './each.js'; -import functions from './functions.js'; -import { push } from './_setup.js'; -import chainResult from './_chainResult.js'; - -// Add your own custom functions to the Underscore object. -export default function mixin(obj) { - each(functions(obj), function(name) { - var func = _[name] = obj[name]; - _.prototype[name] = function() { - var args = [this._wrapped]; - push.apply(args, arguments); - return chainResult(this, func.apply(_, args)); - }; - }); - return _; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/negate.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/negate.js deleted file mode 100644 index 172c7d65..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/negate.js +++ /dev/null @@ -1,6 +0,0 @@ -// Returns a negated version of the passed-in predicate. -export default function negate(predicate) { - return function() { - return !predicate.apply(this, arguments); - }; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/noop.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/noop.js deleted file mode 100644 index 9746addc..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/noop.js +++ /dev/null @@ -1,2 +0,0 @@ -// Predicate-generating function. Often useful outside of Underscore. -export default function noop(){} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/now.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/now.js deleted file mode 100644 index 3ab6b3f4..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/now.js +++ /dev/null @@ -1,4 +0,0 @@ -// A (possibly faster) way to get the current timestamp as an integer. -export default Date.now || function() { - return new Date().getTime(); -}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/object.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/object.js deleted file mode 100644 index d983f8f6..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/object.js +++ /dev/null @@ -1,16 +0,0 @@ -import getLength from './_getLength.js'; - -// Converts lists into objects. Pass either a single array of `[key, value]` -// pairs, or two parallel arrays of the same length -- one of keys, and one of -// the corresponding values. Passing by pairs is the reverse of `_.pairs`. -export default function object(list, values) { - var result = {}; - for (var i = 0, length = getLength(list); i < length; i++) { - if (values) { - result[list[i]] = values[i]; - } else { - result[list[i][0]] = list[i][1]; - } - } - return result; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/omit.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/omit.js deleted file mode 100644 index f7233cf3..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/omit.js +++ /dev/null @@ -1,22 +0,0 @@ -import restArguments from './restArguments.js'; -import isFunction from './isFunction.js'; -import negate from './negate.js'; -import map from './map.js'; -import flatten from './_flatten.js'; -import contains from './contains.js'; -import pick from './pick.js'; - -// Return a copy of the object without the disallowed properties. -export default restArguments(function(obj, keys) { - var iteratee = keys[0], context; - if (isFunction(iteratee)) { - iteratee = negate(iteratee); - if (keys.length > 1) context = keys[1]; - } else { - keys = map(flatten(keys, false, false), String); - iteratee = function(value, key) { - return !contains(keys, key); - }; - } - return pick(obj, iteratee, context); -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/once.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/once.js deleted file mode 100644 index e7e41ac2..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/once.js +++ /dev/null @@ -1,6 +0,0 @@ -import partial from './partial.js'; -import before from './before.js'; - -// Returns a function that will be executed at most one time, no matter how -// often you call it. Useful for lazy initialization. -export default partial(before, 2); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/package.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/package.json deleted file mode 100644 index e51a03da..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/package.json +++ /dev/null @@ -1 +0,0 @@ -{"type":"module","version":"1.13.6"} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/pairs.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/pairs.js deleted file mode 100644 index 0e4af7bb..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/pairs.js +++ /dev/null @@ -1,13 +0,0 @@ -import keys from './keys.js'; - -// Convert an object into a list of `[key, value]` pairs. -// The opposite of `_.object` with one argument. -export default function pairs(obj) { - var _keys = keys(obj); - var length = _keys.length; - var pairs = Array(length); - for (var i = 0; i < length; i++) { - pairs[i] = [_keys[i], obj[_keys[i]]]; - } - return pairs; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/partial.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/partial.js deleted file mode 100644 index 4a4a4685..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/partial.js +++ /dev/null @@ -1,24 +0,0 @@ -import restArguments from './restArguments.js'; -import executeBound from './_executeBound.js'; -import _ from './underscore.js'; - -// Partially apply a function by creating a version that has had some of its -// arguments pre-filled, without changing its dynamic `this` context. `_` acts -// as a placeholder by default, allowing any combination of arguments to be -// pre-filled. Set `_.partial.placeholder` for a custom placeholder argument. -var partial = restArguments(function(func, boundArgs) { - var placeholder = partial.placeholder; - var bound = function() { - var position = 0, length = boundArgs.length; - var args = Array(length); - for (var i = 0; i < length; i++) { - args[i] = boundArgs[i] === placeholder ? arguments[position++] : boundArgs[i]; - } - while (position < arguments.length) args.push(arguments[position++]); - return executeBound(func, bound, this, this, args); - }; - return bound; -}); - -partial.placeholder = _; -export default partial; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/partition.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/partition.js deleted file mode 100644 index bf63c0de..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/partition.js +++ /dev/null @@ -1,7 +0,0 @@ -import group from './_group.js'; - -// Split a collection into two arrays: one whose elements all pass the given -// truth test, and one whose elements all do not pass the truth test. -export default group(function(result, value, pass) { - result[pass ? 0 : 1].push(value); -}, true); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/pick.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/pick.js deleted file mode 100644 index 29858a04..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/pick.js +++ /dev/null @@ -1,26 +0,0 @@ -import restArguments from './restArguments.js'; -import isFunction from './isFunction.js'; -import optimizeCb from './_optimizeCb.js'; -import allKeys from './allKeys.js'; -import keyInObj from './_keyInObj.js'; -import flatten from './_flatten.js'; - -// Return a copy of the object only containing the allowed properties. -export default restArguments(function(obj, keys) { - var result = {}, iteratee = keys[0]; - if (obj == null) return result; - if (isFunction(iteratee)) { - if (keys.length > 1) iteratee = optimizeCb(iteratee, keys[1]); - keys = allKeys(obj); - } else { - iteratee = keyInObj; - keys = flatten(keys, false, false); - obj = Object(obj); - } - for (var i = 0, length = keys.length; i < length; i++) { - var key = keys[i]; - var value = obj[key]; - if (iteratee(value, key, obj)) result[key] = value; - } - return result; -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/pluck.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/pluck.js deleted file mode 100644 index 45a35338..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/pluck.js +++ /dev/null @@ -1,7 +0,0 @@ -import map from './map.js'; -import property from './property.js'; - -// Convenience version of a common use case of `_.map`: fetching a property. -export default function pluck(obj, key) { - return map(obj, property(key)); -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/property.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/property.js deleted file mode 100644 index 48538668..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/property.js +++ /dev/null @@ -1,11 +0,0 @@ -import deepGet from './_deepGet.js'; -import toPath from './_toPath.js'; - -// Creates a function that, when passed an object, will traverse that object’s -// properties down the given `path`, specified as an array of keys or indices. -export default function property(path) { - path = toPath(path); - return function(obj) { - return deepGet(obj, path); - }; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/propertyOf.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/propertyOf.js deleted file mode 100644 index 0bf36f89..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/propertyOf.js +++ /dev/null @@ -1,10 +0,0 @@ -import noop from './noop.js'; -import get from './get.js'; - -// Generates a function for a given object that returns a given property. -export default function propertyOf(obj) { - if (obj == null) return noop; - return function(path) { - return get(obj, path); - }; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/random.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/random.js deleted file mode 100644 index d861b60f..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/random.js +++ /dev/null @@ -1,8 +0,0 @@ -// Return a random integer between `min` and `max` (inclusive). -export default function random(min, max) { - if (max == null) { - max = min; - min = 0; - } - return min + Math.floor(Math.random() * (max - min + 1)); -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/range.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/range.js deleted file mode 100644 index 9c7c6b87..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/range.js +++ /dev/null @@ -1,21 +0,0 @@ -// Generate an integer Array containing an arithmetic progression. A port of -// the native Python `range()` function. See -// [the Python documentation](https://docs.python.org/library/functions.html#range). -export default function range(start, stop, step) { - if (stop == null) { - stop = start || 0; - start = 0; - } - if (!step) { - step = stop < start ? -1 : 1; - } - - var length = Math.max(Math.ceil((stop - start) / step), 0); - var range = Array(length); - - for (var idx = 0; idx < length; idx++, start += step) { - range[idx] = start; - } - - return range; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/reduce.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/reduce.js deleted file mode 100644 index 951eaa3e..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/reduce.js +++ /dev/null @@ -1,5 +0,0 @@ -import createReduce from './_createReduce.js'; - -// **Reduce** builds up a single result from a list of values, aka `inject`, -// or `foldl`. -export default createReduce(1); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/reduceRight.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/reduceRight.js deleted file mode 100644 index 2e8e23ae..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/reduceRight.js +++ /dev/null @@ -1,4 +0,0 @@ -import createReduce from './_createReduce.js'; - -// The right-associative version of reduce, also known as `foldr`. -export default createReduce(-1); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/reject.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/reject.js deleted file mode 100644 index ba4c841d..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/reject.js +++ /dev/null @@ -1,8 +0,0 @@ -import filter from './filter.js'; -import negate from './negate.js'; -import cb from './_cb.js'; - -// Return all the elements for which a truth test fails. -export default function reject(obj, predicate, context) { - return filter(obj, negate(cb(predicate)), context); -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/rest.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/rest.js deleted file mode 100644 index 776b5555..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/rest.js +++ /dev/null @@ -1,8 +0,0 @@ -import { slice } from './_setup.js'; - -// Returns everything but the first entry of the `array`. Especially useful on -// the `arguments` object. Passing an **n** will return the rest N values in the -// `array`. -export default function rest(array, n, guard) { - return slice.call(array, n == null || guard ? 1 : n); -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/restArguments.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/restArguments.js deleted file mode 100644 index d12057eb..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/restArguments.js +++ /dev/null @@ -1,27 +0,0 @@ -// Some functions take a variable number of arguments, or a few expected -// arguments at the beginning and then a variable number of values to operate -// on. This helper accumulates all remaining arguments past the function’s -// argument length (or an explicit `startIndex`), into an array that becomes -// the last argument. Similar to ES6’s "rest parameter". -export default function restArguments(func, startIndex) { - startIndex = startIndex == null ? func.length - 1 : +startIndex; - return function() { - var length = Math.max(arguments.length - startIndex, 0), - rest = Array(length), - index = 0; - for (; index < length; index++) { - rest[index] = arguments[index + startIndex]; - } - switch (startIndex) { - case 0: return func.call(this, rest); - case 1: return func.call(this, arguments[0], rest); - case 2: return func.call(this, arguments[0], arguments[1], rest); - } - var args = Array(startIndex + 1); - for (index = 0; index < startIndex; index++) { - args[index] = arguments[index]; - } - args[startIndex] = rest; - return func.apply(this, args); - }; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/result.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/result.js deleted file mode 100644 index 30c4e200..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/result.js +++ /dev/null @@ -1,22 +0,0 @@ -import isFunction from './isFunction.js'; -import toPath from './_toPath.js'; - -// Traverses the children of `obj` along `path`. If a child is a function, it -// is invoked with its parent as context. Returns the value of the final -// child, or `fallback` if any child is undefined. -export default function result(obj, path, fallback) { - path = toPath(path); - var length = path.length; - if (!length) { - return isFunction(fallback) ? fallback.call(obj) : fallback; - } - for (var i = 0; i < length; i++) { - var prop = obj == null ? void 0 : obj[path[i]]; - if (prop === void 0) { - prop = fallback; - i = length; // Ensure we don't continue iterating. - } - obj = isFunction(prop) ? prop.call(obj) : prop; - } - return obj; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/sample.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/sample.js deleted file mode 100644 index db12e283..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/sample.js +++ /dev/null @@ -1,27 +0,0 @@ -import isArrayLike from './_isArrayLike.js'; -import values from './values.js'; -import getLength from './_getLength.js'; -import random from './random.js'; -import toArray from './toArray.js'; - -// Sample **n** random values from a collection using the modern version of the -// [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher–Yates_shuffle). -// If **n** is not specified, returns a single random element. -// The internal `guard` argument allows it to work with `_.map`. -export default function sample(obj, n, guard) { - if (n == null || guard) { - if (!isArrayLike(obj)) obj = values(obj); - return obj[random(obj.length - 1)]; - } - var sample = toArray(obj); - var length = getLength(sample); - n = Math.max(Math.min(n, length), 0); - var last = length - 1; - for (var index = 0; index < n; index++) { - var rand = random(index, last); - var temp = sample[index]; - sample[index] = sample[rand]; - sample[rand] = temp; - } - return sample.slice(0, n); -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/shuffle.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/shuffle.js deleted file mode 100644 index 907b87a0..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/shuffle.js +++ /dev/null @@ -1,6 +0,0 @@ -import sample from './sample.js'; - -// Shuffle a collection. -export default function shuffle(obj) { - return sample(obj, Infinity); -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/size.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/size.js deleted file mode 100644 index 4ce37148..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/size.js +++ /dev/null @@ -1,8 +0,0 @@ -import isArrayLike from './_isArrayLike.js'; -import keys from './keys.js'; - -// Return the number of elements in a collection. -export default function size(obj) { - if (obj == null) return 0; - return isArrayLike(obj) ? obj.length : keys(obj).length; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/some.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/some.js deleted file mode 100644 index ac09c078..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/some.js +++ /dev/null @@ -1,15 +0,0 @@ -import cb from './_cb.js'; -import isArrayLike from './_isArrayLike.js'; -import keys from './keys.js'; - -// Determine if at least one element in the object passes a truth test. -export default function some(obj, predicate, context) { - predicate = cb(predicate, context); - var _keys = !isArrayLike(obj) && keys(obj), - length = (_keys || obj).length; - for (var index = 0; index < length; index++) { - var currentKey = _keys ? _keys[index] : index; - if (predicate(obj[currentKey], currentKey, obj)) return true; - } - return false; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/sortBy.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/sortBy.js deleted file mode 100644 index bca494bf..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/sortBy.js +++ /dev/null @@ -1,24 +0,0 @@ -import cb from './_cb.js'; -import pluck from './pluck.js'; -import map from './map.js'; - -// Sort the object's values by a criterion produced by an iteratee. -export default function sortBy(obj, iteratee, context) { - var index = 0; - iteratee = cb(iteratee, context); - return pluck(map(obj, function(value, key, list) { - return { - value: value, - index: index++, - criteria: iteratee(value, key, list) - }; - }).sort(function(left, right) { - var a = left.criteria; - var b = right.criteria; - if (a !== b) { - if (a > b || a === void 0) return 1; - if (a < b || b === void 0) return -1; - } - return left.index - right.index; - }), 'value'); -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/sortedIndex.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/sortedIndex.js deleted file mode 100644 index 09ead4aa..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/sortedIndex.js +++ /dev/null @@ -1,15 +0,0 @@ -import cb from './_cb.js'; -import getLength from './_getLength.js'; - -// Use a comparator function to figure out the smallest index at which -// an object should be inserted so as to maintain order. Uses binary search. -export default function sortedIndex(array, obj, iteratee, context) { - iteratee = cb(iteratee, context, 1); - var value = iteratee(obj); - var low = 0, high = getLength(array); - while (low < high) { - var mid = Math.floor((low + high) / 2); - if (iteratee(array[mid]) < value) low = mid + 1; else high = mid; - } - return low; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/tap.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/tap.js deleted file mode 100644 index 47537916..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/tap.js +++ /dev/null @@ -1,7 +0,0 @@ -// Invokes `interceptor` with the `obj` and then returns `obj`. -// The primary purpose of this method is to "tap into" a method chain, in -// order to perform operations on intermediate results within the chain. -export default function tap(obj, interceptor) { - interceptor(obj); - return obj; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/template.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/template.js deleted file mode 100644 index 69791832..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/template.js +++ /dev/null @@ -1,101 +0,0 @@ -import defaults from './defaults.js'; -import _ from './underscore.js'; -import './templateSettings.js'; - -// When customizing `_.templateSettings`, if you don't want to define an -// interpolation, evaluation or escaping regex, we need one that is -// guaranteed not to match. -var noMatch = /(.)^/; - -// Certain characters need to be escaped so that they can be put into a -// string literal. -var escapes = { - "'": "'", - '\\': '\\', - '\r': 'r', - '\n': 'n', - '\u2028': 'u2028', - '\u2029': 'u2029' -}; - -var escapeRegExp = /\\|'|\r|\n|\u2028|\u2029/g; - -function escapeChar(match) { - return '\\' + escapes[match]; -} - -// In order to prevent third-party code injection through -// `_.templateSettings.variable`, we test it against the following regular -// expression. It is intentionally a bit more liberal than just matching valid -// identifiers, but still prevents possible loopholes through defaults or -// destructuring assignment. -var bareIdentifier = /^\s*(\w|\$)+\s*$/; - -// JavaScript micro-templating, similar to John Resig's implementation. -// Underscore templating handles arbitrary delimiters, preserves whitespace, -// and correctly escapes quotes within interpolated code. -// NB: `oldSettings` only exists for backwards compatibility. -export default function template(text, settings, oldSettings) { - if (!settings && oldSettings) settings = oldSettings; - settings = defaults({}, settings, _.templateSettings); - - // Combine delimiters into one regular expression via alternation. - var matcher = RegExp([ - (settings.escape || noMatch).source, - (settings.interpolate || noMatch).source, - (settings.evaluate || noMatch).source - ].join('|') + '|$', 'g'); - - // Compile the template source, escaping string literals appropriately. - var index = 0; - var source = "__p+='"; - text.replace(matcher, function(match, escape, interpolate, evaluate, offset) { - source += text.slice(index, offset).replace(escapeRegExp, escapeChar); - index = offset + match.length; - - if (escape) { - source += "'+\n((__t=(" + escape + "))==null?'':_.escape(__t))+\n'"; - } else if (interpolate) { - source += "'+\n((__t=(" + interpolate + "))==null?'':__t)+\n'"; - } else if (evaluate) { - source += "';\n" + evaluate + "\n__p+='"; - } - - // Adobe VMs need the match returned to produce the correct offset. - return match; - }); - source += "';\n"; - - var argument = settings.variable; - if (argument) { - // Insure against third-party code injection. (CVE-2021-23358) - if (!bareIdentifier.test(argument)) throw new Error( - 'variable is not a bare identifier: ' + argument - ); - } else { - // If a variable is not specified, place data values in local scope. - source = 'with(obj||{}){\n' + source + '}\n'; - argument = 'obj'; - } - - source = "var __t,__p='',__j=Array.prototype.join," + - "print=function(){__p+=__j.call(arguments,'');};\n" + - source + 'return __p;\n'; - - var render; - try { - render = new Function(argument, '_', source); - } catch (e) { - e.source = source; - throw e; - } - - var template = function(data) { - return render.call(this, data, _); - }; - - // Provide the compiled source as a convenience for precompilation. - template.source = 'function(' + argument + '){\n' + source + '}'; - - return template; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/templateSettings.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/templateSettings.js deleted file mode 100644 index 4a02f76a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/templateSettings.js +++ /dev/null @@ -1,9 +0,0 @@ -import _ from './underscore.js'; - -// By default, Underscore uses ERB-style template delimiters. Change the -// following template settings to use alternative delimiters. -export default _.templateSettings = { - evaluate: /<%([\s\S]+?)%>/g, - interpolate: /<%=([\s\S]+?)%>/g, - escape: /<%-([\s\S]+?)%>/g -}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/throttle.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/throttle.js deleted file mode 100644 index 7ab97408..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/throttle.js +++ /dev/null @@ -1,47 +0,0 @@ -import now from './now.js'; - -// Returns a function, that, when invoked, will only be triggered at most once -// during a given window of time. Normally, the throttled function will run -// as much as it can, without ever going more than once per `wait` duration; -// but if you'd like to disable the execution on the leading edge, pass -// `{leading: false}`. To disable execution on the trailing edge, ditto. -export default function throttle(func, wait, options) { - var timeout, context, args, result; - var previous = 0; - if (!options) options = {}; - - var later = function() { - previous = options.leading === false ? 0 : now(); - timeout = null; - result = func.apply(context, args); - if (!timeout) context = args = null; - }; - - var throttled = function() { - var _now = now(); - if (!previous && options.leading === false) previous = _now; - var remaining = wait - (_now - previous); - context = this; - args = arguments; - if (remaining <= 0 || remaining > wait) { - if (timeout) { - clearTimeout(timeout); - timeout = null; - } - previous = _now; - result = func.apply(context, args); - if (!timeout) context = args = null; - } else if (!timeout && options.trailing !== false) { - timeout = setTimeout(later, remaining); - } - return result; - }; - - throttled.cancel = function() { - clearTimeout(timeout); - previous = 0; - timeout = context = args = null; - }; - - return throttled; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/times.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/times.js deleted file mode 100644 index ab1960d5..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/times.js +++ /dev/null @@ -1,9 +0,0 @@ -import optimizeCb from './_optimizeCb.js'; - -// Run a function **n** times. -export default function times(n, iteratee, context) { - var accum = Array(Math.max(0, n)); - iteratee = optimizeCb(iteratee, context, 1); - for (var i = 0; i < n; i++) accum[i] = iteratee(i); - return accum; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/toArray.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/toArray.js deleted file mode 100644 index 00730e61..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/toArray.js +++ /dev/null @@ -1,20 +0,0 @@ -import isArray from './isArray.js'; -import { slice } from './_setup.js'; -import isString from './isString.js'; -import isArrayLike from './_isArrayLike.js'; -import map from './map.js'; -import identity from './identity.js'; -import values from './values.js'; - -// Safely create a real, live array from anything iterable. -var reStrSymbol = /[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g; -export default function toArray(obj) { - if (!obj) return []; - if (isArray(obj)) return slice.call(obj); - if (isString(obj)) { - // Keep surrogate pair characters together. - return obj.match(reStrSymbol); - } - if (isArrayLike(obj)) return map(obj, identity); - return values(obj); -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/toPath.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/toPath.js deleted file mode 100644 index 7d72d1ff..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/toPath.js +++ /dev/null @@ -1,9 +0,0 @@ -import _ from './underscore.js'; -import isArray from './isArray.js'; - -// Normalize a (deep) property `path` to array. -// Like `_.iteratee`, this function can be customized. -export default function toPath(path) { - return isArray(path) ? path : [path]; -} -_.toPath = toPath; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/underscore-array-methods.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/underscore-array-methods.js deleted file mode 100644 index ca7c382b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/underscore-array-methods.js +++ /dev/null @@ -1,31 +0,0 @@ -import _ from './underscore.js'; -import each from './each.js'; -import { ArrayProto } from './_setup.js'; -import chainResult from './_chainResult.js'; - -// Add all mutator `Array` functions to the wrapper. -each(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(name) { - var method = ArrayProto[name]; - _.prototype[name] = function() { - var obj = this._wrapped; - if (obj != null) { - method.apply(obj, arguments); - if ((name === 'shift' || name === 'splice') && obj.length === 0) { - delete obj[0]; - } - } - return chainResult(this, obj); - }; -}); - -// Add all accessor `Array` functions to the wrapper. -each(['concat', 'join', 'slice'], function(name) { - var method = ArrayProto[name]; - _.prototype[name] = function() { - var obj = this._wrapped; - if (obj != null) obj = method.apply(obj, arguments); - return chainResult(this, obj); - }; -}); - -export default _; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/underscore.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/underscore.js deleted file mode 100644 index 6029e2a1..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/underscore.js +++ /dev/null @@ -1,25 +0,0 @@ -import { VERSION } from './_setup.js'; - -// If Underscore is called as a function, it returns a wrapped object that can -// be used OO-style. This wrapper holds altered versions of all functions added -// through `_.mixin`. Wrapped objects may be chained. -export default function _(obj) { - if (obj instanceof _) return obj; - if (!(this instanceof _)) return new _(obj); - this._wrapped = obj; -} - -_.VERSION = VERSION; - -// Extracts the result from a wrapped and chained object. -_.prototype.value = function() { - return this._wrapped; -}; - -// Provide unwrapping proxies for some methods used in engine operations -// such as arithmetic and JSON stringification. -_.prototype.valueOf = _.prototype.toJSON = _.prototype.value; - -_.prototype.toString = function() { - return String(this._wrapped); -}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/unescape.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/unescape.js deleted file mode 100644 index 4edefcc8..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/unescape.js +++ /dev/null @@ -1,5 +0,0 @@ -import createEscaper from './_createEscaper.js'; -import unescapeMap from './_unescapeMap.js'; - -// Function for unescaping strings from HTML interpolation. -export default createEscaper(unescapeMap); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/union.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/union.js deleted file mode 100644 index aa108be9..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/union.js +++ /dev/null @@ -1,9 +0,0 @@ -import restArguments from './restArguments.js'; -import uniq from './uniq.js'; -import flatten from './_flatten.js'; - -// Produce an array that contains the union: each distinct element from all of -// the passed-in arrays. -export default restArguments(function(arrays) { - return uniq(flatten(arrays, true, true)); -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/uniq.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/uniq.js deleted file mode 100644 index ee4c8a31..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/uniq.js +++ /dev/null @@ -1,36 +0,0 @@ -import isBoolean from './isBoolean.js'; -import cb from './_cb.js'; -import getLength from './_getLength.js'; -import contains from './contains.js'; - -// Produce a duplicate-free version of the array. If the array has already -// been sorted, you have the option of using a faster algorithm. -// The faster algorithm will not work with an iteratee if the iteratee -// is not a one-to-one function, so providing an iteratee will disable -// the faster algorithm. -export default function uniq(array, isSorted, iteratee, context) { - if (!isBoolean(isSorted)) { - context = iteratee; - iteratee = isSorted; - isSorted = false; - } - if (iteratee != null) iteratee = cb(iteratee, context); - var result = []; - var seen = []; - for (var i = 0, length = getLength(array); i < length; i++) { - var value = array[i], - computed = iteratee ? iteratee(value, i, array) : value; - if (isSorted && !iteratee) { - if (!i || seen !== computed) result.push(value); - seen = computed; - } else if (iteratee) { - if (!contains(seen, computed)) { - seen.push(computed); - result.push(value); - } - } else if (!contains(result, value)) { - result.push(value); - } - } - return result; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/uniqueId.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/uniqueId.js deleted file mode 100644 index 20f321a8..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/uniqueId.js +++ /dev/null @@ -1,7 +0,0 @@ -// Generate a unique integer id (unique within the entire client session). -// Useful for temporary DOM ids. -var idCounter = 0; -export default function uniqueId(prefix) { - var id = ++idCounter + ''; - return prefix ? prefix + id : id; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/unzip.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/unzip.js deleted file mode 100644 index 15a3cf11..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/unzip.js +++ /dev/null @@ -1,15 +0,0 @@ -import max from './max.js'; -import getLength from './_getLength.js'; -import pluck from './pluck.js'; - -// Complement of zip. Unzip accepts an array of arrays and groups -// each array's elements on shared indices. -export default function unzip(array) { - var length = (array && max(array, getLength).length) || 0; - var result = Array(length); - - for (var index = 0; index < length; index++) { - result[index] = pluck(array, index); - } - return result; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/values.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/values.js deleted file mode 100644 index 9591de3e..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/values.js +++ /dev/null @@ -1,12 +0,0 @@ -import keys from './keys.js'; - -// Retrieve the values of an object's properties. -export default function values(obj) { - var _keys = keys(obj); - var length = _keys.length; - var values = Array(length); - for (var i = 0; i < length; i++) { - values[i] = obj[_keys[i]]; - } - return values; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/where.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/where.js deleted file mode 100644 index 645f8cb2..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/where.js +++ /dev/null @@ -1,8 +0,0 @@ -import filter from './filter.js'; -import matcher from './matcher.js'; - -// Convenience version of a common use case of `_.filter`: selecting only -// objects containing specific `key:value` pairs. -export default function where(obj, attrs) { - return filter(obj, matcher(attrs)); -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/without.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/without.js deleted file mode 100644 index 7790e0fa..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/without.js +++ /dev/null @@ -1,7 +0,0 @@ -import restArguments from './restArguments.js'; -import difference from './difference.js'; - -// Return a version of the array that does not contain the specified value(s). -export default restArguments(function(array, otherArrays) { - return difference(array, otherArrays); -}); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/wrap.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/wrap.js deleted file mode 100644 index b2b3fd41..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/wrap.js +++ /dev/null @@ -1,8 +0,0 @@ -import partial from './partial.js'; - -// Returns the first function passed as an argument to the second, -// allowing you to adjust arguments, run code before and after, and -// conditionally execute the original function. -export default function wrap(func, wrapper) { - return partial(wrapper, func); -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/zip.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/zip.js deleted file mode 100644 index ae43cb37..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/modules/zip.js +++ /dev/null @@ -1,6 +0,0 @@ -import restArguments from './restArguments.js'; -import unzip from './unzip.js'; - -// Zip together multiple lists into a single array -- elements that share -// an index go together. -export default restArguments(unzip); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/package.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/package.json deleted file mode 100644 index bbc69cdf..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/package.json +++ /dev/null @@ -1,124 +0,0 @@ -{ - "name": "underscore", - "description": "JavaScript's functional programming helper library.", - "version": "1.13.6", - "author": "Jeremy Ashkenas ", - "license": "MIT", - "homepage": "https://underscorejs.org", - "repository": { - "type": "git", - "url": "git://github.com/jashkenas/underscore.git" - }, - "keywords": [ - "util", - "functional", - "server", - "client", - "browser" - ], - "main": "underscore-umd.js", - "module": "modules/index-all.js", - "type": "commonjs", - "exports": { - ".": { - "import": { - "module": "./modules/index-all.js", - "browser": { - "production": "./underscore-esm-min.js", - "default": "./underscore-esm.js" - }, - "node": "./underscore-node.mjs", - "default": "./underscore-esm.js" - }, - "require": { - "module": "./modules/index-all.js", - "browser": { - "production": "./underscore-umd-min.js", - "default": "./underscore-umd.js" - }, - "node": "./underscore-node.cjs", - "default": "./underscore-umd.js" - }, - "default": "./underscore-umd.js" - }, - "./underscore*": "./underscore*", - "./modules/*": { - "require": "./cjs/*", - "default": "./modules/*" - }, - "./amd/*": "./amd/*", - "./cjs/*": "./cjs/*", - "./package.json": "./package.json" - }, - "devDependencies": { - "coveralls": "^3.1.1", - "cpy-cli": "^3.1.1", - "docco": "^0.8.0", - "eslint": "^6.8.0", - "eslint-plugin-import": "^2.20.1", - "glob": "^7.1.6", - "gzip-size-cli": "^1.0.0", - "husky": "^4.2.3", - "karma": "^4.4.1", - "karma-qunit": "^4.1.2", - "karma-sauce-launcher": "^4.3.6", - "nyc": "^15.1.0", - "patch-package": "^6.4.7", - "pretty-bytes-cli": "^1.0.0", - "qunit": "2.10.1", - "rollup": "^2.40.0", - "terser": "^4.6.13" - }, - "overrides": { - "colors@>1.4.0": "1.4.0" - }, - "scripts": { - "test": "npm run lint && npm run prepare-tests && npm run test-node", - "coverage": "npm run prepare-tests && nyc npm run test-node && nyc report", - "coveralls": "nyc npm run test-node && nyc report --reporter=text-lcov | coveralls", - "lint": "eslint modules/*.js test/*.js", - "test-node": "qunit test/", - "test-browser": "npm i karma-phantomjs-launcher && karma start", - "bundle": "rollup -c && eslint underscore-umd.js && rollup -c rollup.config2.js", - "bundle-treeshake": "cd test-treeshake && rollup --config", - "prepare-tests": "npm run bundle && npm run bundle-treeshake", - "minify-umd": "terser underscore-umd.js -c \"evaluate=false\" --comments \"/ .*/\" -m", - "minify-esm": "terser underscore-esm.js -c \"evaluate=false\" --comments \"/ .*/\" -m", - "module-package-json": "node -e 'console.log(`{\"type\":\"module\",\"version\":\"${process.env.npm_package_version}\"}`)' > modules/package.json", - "build-umd": "npm run minify-umd -- --source-map content=underscore-umd.js.map --source-map-url \" \" -o underscore-umd-min.js", - "build-esm": "npm run module-package-json && npm run minify-esm -- --source-map content=underscore-esm.js.map --source-map-url \" \" -o underscore-esm-min.js", - "alias-bundle": "cpy --rename=underscore.js underscore-umd.js . && cpy --rename=underscore-min.js underscore-umd-min.js . && cpy --rename=underscore-min.js.map underscore-umd-min.js.map .", - "build": "npm run bundle && npm run build-umd && npm run build-esm && npm run alias-bundle", - "doc": "docco underscore-esm.js && docco modules/*.js -c docco.css -t docs/linked-esm.jst", - "weight": "npm run bundle && npm run minify-umd | gzip-size | pretty-bytes", - "prepublishOnly": "npm run build && npm run doc" - }, - "files": [ - "underscore-esm.js", - "underscore-esm.js.map", - "underscore-esm-min.js", - "underscore-esm-min.js.map", - "underscore-umd.js", - "underscore-umd.js.map", - "underscore-umd-min.js", - "underscore-umd-min.js.map", - "underscore.js", - "underscore-min.js", - "underscore-min.js.map", - "underscore-node-f.cjs", - "underscore-node-f.cjs.map", - "underscore-node.cjs", - "underscore-node.cjs.map", - "underscore-node.mjs", - "underscore-node.mjs.map", - "modules/", - "amd/", - "cjs/" - ], - "husky": { - "hooks": { - "pre-commit": "npm run bundle && git add underscore-umd.js underscore-umd.js.map underscore-esm.js underscore-esm.js.map underscore-node-f.cjs underscore-node-f.cjs.map underscore-node.cjs underscore-node.cjs.map underscore-node.mjs underscore-node.mjs.map", - "post-commit": "git reset underscore-umd.js underscore-umd.js.map underscore-esm.js underscore-esm.js.map underscore-node-f.cjs underscore-node-f.cjs.map underscore-node.cjs underscore-node.cjs.map underscore-node.mjs underscore-node.mjs.map" - } - } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/underscore-esm-min.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/underscore-esm-min.js deleted file mode 100644 index 86862a1a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/underscore-esm-min.js +++ /dev/null @@ -1,5 +0,0 @@ -// Underscore.js 1.13.6 -// https://underscorejs.org -// (c) 2009-2022 Jeremy Ashkenas, Julian Gonggrijp, and DocumentCloud and Investigative Reporters & Editors -// Underscore may be freely distributed under the MIT license. -var VERSION="1.13.6",root="object"==typeof self&&self.self===self&&self||"object"==typeof global&&global.global===global&&global||Function("return this")()||{},ArrayProto=Array.prototype,ObjProto=Object.prototype,SymbolProto="undefined"!=typeof Symbol?Symbol.prototype:null,push=ArrayProto.push,slice=ArrayProto.slice,toString=ObjProto.toString,hasOwnProperty=ObjProto.hasOwnProperty,supportsArrayBuffer="undefined"!=typeof ArrayBuffer,supportsDataView="undefined"!=typeof DataView,nativeIsArray=Array.isArray,nativeKeys=Object.keys,nativeCreate=Object.create,nativeIsView=supportsArrayBuffer&&ArrayBuffer.isView,_isNaN=isNaN,_isFinite=isFinite,hasEnumBug=!{toString:null}.propertyIsEnumerable("toString"),nonEnumerableProps=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],MAX_ARRAY_INDEX=Math.pow(2,53)-1;function restArguments(e,t){return t=null==t?e.length-1:+t,function(){for(var n=Math.max(arguments.length-t,0),r=Array(n),i=0;i=0&&n<=MAX_ARRAY_INDEX}}function shallowProperty(e){return function(t){return null==t?void 0:t[e]}}var getByteLength=shallowProperty("byteLength"),isBufferLike=createSizePropertyCheck(getByteLength),typedArrayPattern=/\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/;function isTypedArray(e){return nativeIsView?nativeIsView(e)&&!isDataView$1(e):isBufferLike(e)&&typedArrayPattern.test(toString.call(e))}var isTypedArray$1=supportsArrayBuffer?isTypedArray:constant(!1),getLength=shallowProperty("length");function emulatedSet(e){for(var t={},n=e.length,r=0;r":">",'"':""","'":"'","`":"`"},_escape=createEscaper(escapeMap),unescapeMap=invert(escapeMap),_unescape=createEscaper(unescapeMap),templateSettings=_$1.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g},noMatch=/(.)^/,escapes={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},escapeRegExp=/\\|'|\r|\n|\u2028|\u2029/g;function escapeChar(e){return"\\"+escapes[e]}var bareIdentifier=/^\s*(\w|\$)+\s*$/;function template(e,t,n){!t&&n&&(t=n),t=defaults({},t,_$1.templateSettings);var r=RegExp([(t.escape||noMatch).source,(t.interpolate||noMatch).source,(t.evaluate||noMatch).source].join("|")+"|$","g"),i=0,a="__p+='";e.replace(r,(function(t,n,r,u,o){return a+=e.slice(i,o).replace(escapeRegExp,escapeChar),i=o+t.length,n?a+="'+\n((__t=("+n+"))==null?'':_.escape(__t))+\n'":r?a+="'+\n((__t=("+r+"))==null?'':__t)+\n'":u&&(a+="';\n"+u+"\n__p+='"),t})),a+="';\n";var u,o=t.variable;if(o){if(!bareIdentifier.test(o))throw new Error("variable is not a bare identifier: "+o)}else a="with(obj||{}){\n"+a+"}\n",o="obj";a="var __t,__p='',__j=Array.prototype.join,"+"print=function(){__p+=__j.call(arguments,'');};\n"+a+"return __p;\n";try{u=new Function(o,"_",a)}catch(e){throw e.source=a,e}var s=function(e){return u.call(this,e,_$1)};return s.source="function("+o+"){\n"+a+"}",s}function result(e,t,n){var r=(t=toPath(t)).length;if(!r)return isFunction$1(n)?n.call(e):n;for(var i=0;i1)flatten$1(o,t-1,n,r),i=r.length;else for(var s=0,c=o.length;st?(r&&(clearTimeout(r),r=null),o=c,u=e.apply(i,a),r||(i=a=null)):r||!1===n.trailing||(r=setTimeout(s,f)),u};return c.cancel=function(){clearTimeout(r),o=0,r=i=a=null},c}function debounce(e,t,n){var r,i,a,u,o,s=function(){var c=now()-i;t>c?r=setTimeout(s,t-c):(r=null,n||(u=e.apply(o,a)),r||(a=o=null))},c=restArguments((function(c){return o=this,a=c,i=now(),r||(r=setTimeout(s,t),n&&(u=e.apply(o,a))),u}));return c.cancel=function(){clearTimeout(r),r=a=o=null},c}function wrap(e,t){return partial(t,e)}function negate(e){return function(){return!e.apply(this,arguments)}}function compose(){var e=arguments,t=e.length-1;return function(){for(var n=t,r=e[t].apply(this,arguments);n--;)r=e[n].call(this,r);return r}}function after(e,t){return function(){if(--e<1)return t.apply(this,arguments)}}function before(e,t){var n;return function(){return--e>0&&(n=t.apply(this,arguments)),e<=1&&(t=null),n}}var once=partial(before,2);function findKey(e,t,n){t=cb(t,n);for(var r,i=keys(e),a=0,u=i.length;a0?0:i-1;a>=0&&a0?u=a>=0?a:Math.max(a+o,u):o=a>=0?Math.min(a+1,o):a+o+1;else if(n&&a&&o)return r[a=n(r,i)]===i?a:-1;if(i!=i)return(a=t(slice.call(r,u,o),isNaN$1))>=0?a+u:-1;for(a=e>0?u:o-1;a>=0&&a0?0:u-1;for(i||(r=t[a?a[o]:o],o+=e);o>=0&&o=3;return t(e,optimizeCb(n,i,4),r,a)}}var reduce=createReduce(1),reduceRight=createReduce(-1);function filter(e,t,n){var r=[];return t=cb(t,n),each(e,(function(e,n,i){t(e,n,i)&&r.push(e)})),r}function reject(e,t,n){return filter(e,negate(cb(t)),n)}function every(e,t,n){t=cb(t,n);for(var r=!isArrayLike(e)&&keys(e),i=(r||e).length,a=0;a=0}var invoke=restArguments((function(e,t,n){var r,i;return isFunction$1(t)?i=t:(t=toPath(t),r=t.slice(0,-1),t=t[t.length-1]),map(e,(function(e){var a=i;if(!a){if(r&&r.length&&(e=deepGet(e,r)),null==e)return;a=e[t]}return null==a?a:a.apply(e,n)}))}));function pluck(e,t){return map(e,property(t))}function where(e,t){return filter(e,matcher(t))}function max(e,t,n){var r,i,a=-1/0,u=-1/0;if(null==t||"number"==typeof t&&"object"!=typeof e[0]&&null!=e)for(var o=0,s=(e=isArrayLike(e)?e:values(e)).length;oa&&(a=r);else t=cb(t,n),each(e,(function(e,n,r){((i=t(e,n,r))>u||i===-1/0&&a===-1/0)&&(a=e,u=i)}));return a}function min(e,t,n){var r,i,a=1/0,u=1/0;if(null==t||"number"==typeof t&&"object"!=typeof e[0]&&null!=e)for(var o=0,s=(e=isArrayLike(e)?e:values(e)).length;or||void 0===n)return 1;if(n1&&(r=optimizeCb(r,t[1])),t=allKeys(e)):(r=keyInObj,t=flatten$1(t,!1,!1),e=Object(e));for(var i=0,a=t.length;i1&&(n=t[1])):(t=map(flatten$1(t,!1,!1),String),r=function(e,n){return!contains(t,n)}),pick(e,r,n)}));function initial(e,t,n){return slice.call(e,0,Math.max(0,e.length-(null==t||n?1:t)))}function first(e,t,n){return null==e||e.length<1?null==t||n?void 0:[]:null==t||n?e[0]:initial(e,e.length-t)}function rest(e,t,n){return slice.call(e,null==t||n?1:t)}function last(e,t,n){return null==e||e.length<1?null==t||n?void 0:[]:null==t||n?e[e.length-1]:rest(e,Math.max(0,e.length-t))}function compact(e){return filter(e,Boolean)}function flatten(e,t){return flatten$1(e,t,!1)}var difference=restArguments((function(e,t){return t=flatten$1(t,!0,!0),filter(e,(function(e){return!contains(t,e)}))})),without=restArguments((function(e,t){return difference(e,t)}));function uniq(e,t,n,r){isBoolean(t)||(r=n,n=t,t=!1),null!=n&&(n=cb(n,r));for(var i=[],a=[],u=0,o=getLength(e);u= 0 && sizeProperty <= MAX_ARRAY_INDEX; - } -} - -// Internal helper to generate a function to obtain property `key` from `obj`. -function shallowProperty(key) { - return function(obj) { - return obj == null ? void 0 : obj[key]; - }; -} - -// Internal helper to obtain the `byteLength` property of an object. -var getByteLength = shallowProperty('byteLength'); - -// Internal helper to determine whether we should spend extensive checks against -// `ArrayBuffer` et al. -var isBufferLike = createSizePropertyCheck(getByteLength); - -// Is a given value a typed array? -var typedArrayPattern = /\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/; -function isTypedArray(obj) { - // `ArrayBuffer.isView` is the most future-proof, so use it when available. - // Otherwise, fall back on the above regular expression. - return nativeIsView ? (nativeIsView(obj) && !isDataView$1(obj)) : - isBufferLike(obj) && typedArrayPattern.test(toString.call(obj)); -} - -var isTypedArray$1 = supportsArrayBuffer ? isTypedArray : constant(false); - -// Internal helper to obtain the `length` property of an object. -var getLength = shallowProperty('length'); - -// Internal helper to create a simple lookup structure. -// `collectNonEnumProps` used to depend on `_.contains`, but this led to -// circular imports. `emulatedSet` is a one-off solution that only works for -// arrays of strings. -function emulatedSet(keys) { - var hash = {}; - for (var l = keys.length, i = 0; i < l; ++i) hash[keys[i]] = true; - return { - contains: function(key) { return hash[key] === true; }, - push: function(key) { - hash[key] = true; - return keys.push(key); - } - }; -} - -// Internal helper. Checks `keys` for the presence of keys in IE < 9 that won't -// be iterated by `for key in ...` and thus missed. Extends `keys` in place if -// needed. -function collectNonEnumProps(obj, keys) { - keys = emulatedSet(keys); - var nonEnumIdx = nonEnumerableProps.length; - var constructor = obj.constructor; - var proto = (isFunction$1(constructor) && constructor.prototype) || ObjProto; - - // Constructor is a special case. - var prop = 'constructor'; - if (has$1(obj, prop) && !keys.contains(prop)) keys.push(prop); - - while (nonEnumIdx--) { - prop = nonEnumerableProps[nonEnumIdx]; - if (prop in obj && obj[prop] !== proto[prop] && !keys.contains(prop)) { - keys.push(prop); - } - } -} - -// Retrieve the names of an object's own properties. -// Delegates to **ECMAScript 5**'s native `Object.keys`. -function keys(obj) { - if (!isObject(obj)) return []; - if (nativeKeys) return nativeKeys(obj); - var keys = []; - for (var key in obj) if (has$1(obj, key)) keys.push(key); - // Ahem, IE < 9. - if (hasEnumBug) collectNonEnumProps(obj, keys); - return keys; -} - -// Is a given array, string, or object empty? -// An "empty" object has no enumerable own-properties. -function isEmpty(obj) { - if (obj == null) return true; - // Skip the more expensive `toString`-based type checks if `obj` has no - // `.length`. - var length = getLength(obj); - if (typeof length == 'number' && ( - isArray(obj) || isString(obj) || isArguments$1(obj) - )) return length === 0; - return getLength(keys(obj)) === 0; -} - -// Returns whether an object has a given set of `key:value` pairs. -function isMatch(object, attrs) { - var _keys = keys(attrs), length = _keys.length; - if (object == null) return !length; - var obj = Object(object); - for (var i = 0; i < length; i++) { - var key = _keys[i]; - if (attrs[key] !== obj[key] || !(key in obj)) return false; - } - return true; -} - -// If Underscore is called as a function, it returns a wrapped object that can -// be used OO-style. This wrapper holds altered versions of all functions added -// through `_.mixin`. Wrapped objects may be chained. -function _$1(obj) { - if (obj instanceof _$1) return obj; - if (!(this instanceof _$1)) return new _$1(obj); - this._wrapped = obj; -} - -_$1.VERSION = VERSION; - -// Extracts the result from a wrapped and chained object. -_$1.prototype.value = function() { - return this._wrapped; -}; - -// Provide unwrapping proxies for some methods used in engine operations -// such as arithmetic and JSON stringification. -_$1.prototype.valueOf = _$1.prototype.toJSON = _$1.prototype.value; - -_$1.prototype.toString = function() { - return String(this._wrapped); -}; - -// Internal function to wrap or shallow-copy an ArrayBuffer, -// typed array or DataView to a new view, reusing the buffer. -function toBufferView(bufferSource) { - return new Uint8Array( - bufferSource.buffer || bufferSource, - bufferSource.byteOffset || 0, - getByteLength(bufferSource) - ); -} - -// We use this string twice, so give it a name for minification. -var tagDataView = '[object DataView]'; - -// Internal recursive comparison function for `_.isEqual`. -function eq(a, b, aStack, bStack) { - // Identical objects are equal. `0 === -0`, but they aren't identical. - // See the [Harmony `egal` proposal](https://wiki.ecmascript.org/doku.php?id=harmony:egal). - if (a === b) return a !== 0 || 1 / a === 1 / b; - // `null` or `undefined` only equal to itself (strict comparison). - if (a == null || b == null) return false; - // `NaN`s are equivalent, but non-reflexive. - if (a !== a) return b !== b; - // Exhaust primitive checks - var type = typeof a; - if (type !== 'function' && type !== 'object' && typeof b != 'object') return false; - return deepEq(a, b, aStack, bStack); -} - -// Internal recursive comparison function for `_.isEqual`. -function deepEq(a, b, aStack, bStack) { - // Unwrap any wrapped objects. - if (a instanceof _$1) a = a._wrapped; - if (b instanceof _$1) b = b._wrapped; - // Compare `[[Class]]` names. - var className = toString.call(a); - if (className !== toString.call(b)) return false; - // Work around a bug in IE 10 - Edge 13. - if (hasStringTagBug && className == '[object Object]' && isDataView$1(a)) { - if (!isDataView$1(b)) return false; - className = tagDataView; - } - switch (className) { - // These types are compared by value. - case '[object RegExp]': - // RegExps are coerced to strings for comparison (Note: '' + /a/i === '/a/i') - case '[object String]': - // Primitives and their corresponding object wrappers are equivalent; thus, `"5"` is - // equivalent to `new String("5")`. - return '' + a === '' + b; - case '[object Number]': - // `NaN`s are equivalent, but non-reflexive. - // Object(NaN) is equivalent to NaN. - if (+a !== +a) return +b !== +b; - // An `egal` comparison is performed for other numeric values. - return +a === 0 ? 1 / +a === 1 / b : +a === +b; - case '[object Date]': - case '[object Boolean]': - // Coerce dates and booleans to numeric primitive values. Dates are compared by their - // millisecond representations. Note that invalid dates with millisecond representations - // of `NaN` are not equivalent. - return +a === +b; - case '[object Symbol]': - return SymbolProto.valueOf.call(a) === SymbolProto.valueOf.call(b); - case '[object ArrayBuffer]': - case tagDataView: - // Coerce to typed array so we can fall through. - return deepEq(toBufferView(a), toBufferView(b), aStack, bStack); - } - - var areArrays = className === '[object Array]'; - if (!areArrays && isTypedArray$1(a)) { - var byteLength = getByteLength(a); - if (byteLength !== getByteLength(b)) return false; - if (a.buffer === b.buffer && a.byteOffset === b.byteOffset) return true; - areArrays = true; - } - if (!areArrays) { - if (typeof a != 'object' || typeof b != 'object') return false; - - // Objects with different constructors are not equivalent, but `Object`s or `Array`s - // from different frames are. - var aCtor = a.constructor, bCtor = b.constructor; - if (aCtor !== bCtor && !(isFunction$1(aCtor) && aCtor instanceof aCtor && - isFunction$1(bCtor) && bCtor instanceof bCtor) - && ('constructor' in a && 'constructor' in b)) { - return false; - } - } - // Assume equality for cyclic structures. The algorithm for detecting cyclic - // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`. - - // Initializing stack of traversed objects. - // It's done here since we only need them for objects and arrays comparison. - aStack = aStack || []; - bStack = bStack || []; - var length = aStack.length; - while (length--) { - // Linear search. Performance is inversely proportional to the number of - // unique nested structures. - if (aStack[length] === a) return bStack[length] === b; - } - - // Add the first object to the stack of traversed objects. - aStack.push(a); - bStack.push(b); - - // Recursively compare objects and arrays. - if (areArrays) { - // Compare array lengths to determine if a deep comparison is necessary. - length = a.length; - if (length !== b.length) return false; - // Deep compare the contents, ignoring non-numeric properties. - while (length--) { - if (!eq(a[length], b[length], aStack, bStack)) return false; - } - } else { - // Deep compare objects. - var _keys = keys(a), key; - length = _keys.length; - // Ensure that both objects contain the same number of properties before comparing deep equality. - if (keys(b).length !== length) return false; - while (length--) { - // Deep compare each member - key = _keys[length]; - if (!(has$1(b, key) && eq(a[key], b[key], aStack, bStack))) return false; - } - } - // Remove the first object from the stack of traversed objects. - aStack.pop(); - bStack.pop(); - return true; -} - -// Perform a deep comparison to check if two objects are equal. -function isEqual(a, b) { - return eq(a, b); -} - -// Retrieve all the enumerable property names of an object. -function allKeys(obj) { - if (!isObject(obj)) return []; - var keys = []; - for (var key in obj) keys.push(key); - // Ahem, IE < 9. - if (hasEnumBug) collectNonEnumProps(obj, keys); - return keys; -} - -// Since the regular `Object.prototype.toString` type tests don't work for -// some types in IE 11, we use a fingerprinting heuristic instead, based -// on the methods. It's not great, but it's the best we got. -// The fingerprint method lists are defined below. -function ie11fingerprint(methods) { - var length = getLength(methods); - return function(obj) { - if (obj == null) return false; - // `Map`, `WeakMap` and `Set` have no enumerable keys. - var keys = allKeys(obj); - if (getLength(keys)) return false; - for (var i = 0; i < length; i++) { - if (!isFunction$1(obj[methods[i]])) return false; - } - // If we are testing against `WeakMap`, we need to ensure that - // `obj` doesn't have a `forEach` method in order to distinguish - // it from a regular `Map`. - return methods !== weakMapMethods || !isFunction$1(obj[forEachName]); - }; -} - -// In the interest of compact minification, we write -// each string in the fingerprints only once. -var forEachName = 'forEach', - hasName = 'has', - commonInit = ['clear', 'delete'], - mapTail = ['get', hasName, 'set']; - -// `Map`, `WeakMap` and `Set` each have slightly different -// combinations of the above sublists. -var mapMethods = commonInit.concat(forEachName, mapTail), - weakMapMethods = commonInit.concat(mapTail), - setMethods = ['add'].concat(commonInit, forEachName, hasName); - -var isMap = isIE11 ? ie11fingerprint(mapMethods) : tagTester('Map'); - -var isWeakMap = isIE11 ? ie11fingerprint(weakMapMethods) : tagTester('WeakMap'); - -var isSet = isIE11 ? ie11fingerprint(setMethods) : tagTester('Set'); - -var isWeakSet = tagTester('WeakSet'); - -// Retrieve the values of an object's properties. -function values(obj) { - var _keys = keys(obj); - var length = _keys.length; - var values = Array(length); - for (var i = 0; i < length; i++) { - values[i] = obj[_keys[i]]; - } - return values; -} - -// Convert an object into a list of `[key, value]` pairs. -// The opposite of `_.object` with one argument. -function pairs(obj) { - var _keys = keys(obj); - var length = _keys.length; - var pairs = Array(length); - for (var i = 0; i < length; i++) { - pairs[i] = [_keys[i], obj[_keys[i]]]; - } - return pairs; -} - -// Invert the keys and values of an object. The values must be serializable. -function invert(obj) { - var result = {}; - var _keys = keys(obj); - for (var i = 0, length = _keys.length; i < length; i++) { - result[obj[_keys[i]]] = _keys[i]; - } - return result; -} - -// Return a sorted list of the function names available on the object. -function functions(obj) { - var names = []; - for (var key in obj) { - if (isFunction$1(obj[key])) names.push(key); - } - return names.sort(); -} - -// An internal function for creating assigner functions. -function createAssigner(keysFunc, defaults) { - return function(obj) { - var length = arguments.length; - if (defaults) obj = Object(obj); - if (length < 2 || obj == null) return obj; - for (var index = 1; index < length; index++) { - var source = arguments[index], - keys = keysFunc(source), - l = keys.length; - for (var i = 0; i < l; i++) { - var key = keys[i]; - if (!defaults || obj[key] === void 0) obj[key] = source[key]; - } - } - return obj; - }; -} - -// Extend a given object with all the properties in passed-in object(s). -var extend = createAssigner(allKeys); - -// Assigns a given object with all the own properties in the passed-in -// object(s). -// (https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/assign) -var extendOwn = createAssigner(keys); - -// Fill in a given object with default properties. -var defaults = createAssigner(allKeys, true); - -// Create a naked function reference for surrogate-prototype-swapping. -function ctor() { - return function(){}; -} - -// An internal function for creating a new object that inherits from another. -function baseCreate(prototype) { - if (!isObject(prototype)) return {}; - if (nativeCreate) return nativeCreate(prototype); - var Ctor = ctor(); - Ctor.prototype = prototype; - var result = new Ctor; - Ctor.prototype = null; - return result; -} - -// Creates an object that inherits from the given prototype object. -// If additional properties are provided then they will be added to the -// created object. -function create(prototype, props) { - var result = baseCreate(prototype); - if (props) extendOwn(result, props); - return result; -} - -// Create a (shallow-cloned) duplicate of an object. -function clone(obj) { - if (!isObject(obj)) return obj; - return isArray(obj) ? obj.slice() : extend({}, obj); -} - -// Invokes `interceptor` with the `obj` and then returns `obj`. -// The primary purpose of this method is to "tap into" a method chain, in -// order to perform operations on intermediate results within the chain. -function tap(obj, interceptor) { - interceptor(obj); - return obj; -} - -// Normalize a (deep) property `path` to array. -// Like `_.iteratee`, this function can be customized. -function toPath$1(path) { - return isArray(path) ? path : [path]; -} -_$1.toPath = toPath$1; - -// Internal wrapper for `_.toPath` to enable minification. -// Similar to `cb` for `_.iteratee`. -function toPath(path) { - return _$1.toPath(path); -} - -// Internal function to obtain a nested property in `obj` along `path`. -function deepGet(obj, path) { - var length = path.length; - for (var i = 0; i < length; i++) { - if (obj == null) return void 0; - obj = obj[path[i]]; - } - return length ? obj : void 0; -} - -// Get the value of the (deep) property on `path` from `object`. -// If any property in `path` does not exist or if the value is -// `undefined`, return `defaultValue` instead. -// The `path` is normalized through `_.toPath`. -function get(object, path, defaultValue) { - var value = deepGet(object, toPath(path)); - return isUndefined(value) ? defaultValue : value; -} - -// Shortcut function for checking if an object has a given property directly on -// itself (in other words, not on a prototype). Unlike the internal `has` -// function, this public version can also traverse nested properties. -function has(obj, path) { - path = toPath(path); - var length = path.length; - for (var i = 0; i < length; i++) { - var key = path[i]; - if (!has$1(obj, key)) return false; - obj = obj[key]; - } - return !!length; -} - -// Keep the identity function around for default iteratees. -function identity(value) { - return value; -} - -// Returns a predicate for checking whether an object has a given set of -// `key:value` pairs. -function matcher(attrs) { - attrs = extendOwn({}, attrs); - return function(obj) { - return isMatch(obj, attrs); - }; -} - -// Creates a function that, when passed an object, will traverse that object’s -// properties down the given `path`, specified as an array of keys or indices. -function property(path) { - path = toPath(path); - return function(obj) { - return deepGet(obj, path); - }; -} - -// Internal function that returns an efficient (for current engines) version -// of the passed-in callback, to be repeatedly applied in other Underscore -// functions. -function optimizeCb(func, context, argCount) { - if (context === void 0) return func; - switch (argCount == null ? 3 : argCount) { - case 1: return function(value) { - return func.call(context, value); - }; - // The 2-argument case is omitted because we’re not using it. - case 3: return function(value, index, collection) { - return func.call(context, value, index, collection); - }; - case 4: return function(accumulator, value, index, collection) { - return func.call(context, accumulator, value, index, collection); - }; - } - return function() { - return func.apply(context, arguments); - }; -} - -// An internal function to generate callbacks that can be applied to each -// element in a collection, returning the desired result — either `_.identity`, -// an arbitrary callback, a property matcher, or a property accessor. -function baseIteratee(value, context, argCount) { - if (value == null) return identity; - if (isFunction$1(value)) return optimizeCb(value, context, argCount); - if (isObject(value) && !isArray(value)) return matcher(value); - return property(value); -} - -// External wrapper for our callback generator. Users may customize -// `_.iteratee` if they want additional predicate/iteratee shorthand styles. -// This abstraction hides the internal-only `argCount` argument. -function iteratee(value, context) { - return baseIteratee(value, context, Infinity); -} -_$1.iteratee = iteratee; - -// The function we call internally to generate a callback. It invokes -// `_.iteratee` if overridden, otherwise `baseIteratee`. -function cb(value, context, argCount) { - if (_$1.iteratee !== iteratee) return _$1.iteratee(value, context); - return baseIteratee(value, context, argCount); -} - -// Returns the results of applying the `iteratee` to each element of `obj`. -// In contrast to `_.map` it returns an object. -function mapObject(obj, iteratee, context) { - iteratee = cb(iteratee, context); - var _keys = keys(obj), - length = _keys.length, - results = {}; - for (var index = 0; index < length; index++) { - var currentKey = _keys[index]; - results[currentKey] = iteratee(obj[currentKey], currentKey, obj); - } - return results; -} - -// Predicate-generating function. Often useful outside of Underscore. -function noop(){} - -// Generates a function for a given object that returns a given property. -function propertyOf(obj) { - if (obj == null) return noop; - return function(path) { - return get(obj, path); - }; -} - -// Run a function **n** times. -function times(n, iteratee, context) { - var accum = Array(Math.max(0, n)); - iteratee = optimizeCb(iteratee, context, 1); - for (var i = 0; i < n; i++) accum[i] = iteratee(i); - return accum; -} - -// Return a random integer between `min` and `max` (inclusive). -function random(min, max) { - if (max == null) { - max = min; - min = 0; - } - return min + Math.floor(Math.random() * (max - min + 1)); -} - -// A (possibly faster) way to get the current timestamp as an integer. -var now = Date.now || function() { - return new Date().getTime(); -}; - -// Internal helper to generate functions for escaping and unescaping strings -// to/from HTML interpolation. -function createEscaper(map) { - var escaper = function(match) { - return map[match]; - }; - // Regexes for identifying a key that needs to be escaped. - var source = '(?:' + keys(map).join('|') + ')'; - var testRegexp = RegExp(source); - var replaceRegexp = RegExp(source, 'g'); - return function(string) { - string = string == null ? '' : '' + string; - return testRegexp.test(string) ? string.replace(replaceRegexp, escaper) : string; - }; -} - -// Internal list of HTML entities for escaping. -var escapeMap = { - '&': '&', - '<': '<', - '>': '>', - '"': '"', - "'": ''', - '`': '`' -}; - -// Function for escaping strings to HTML interpolation. -var _escape = createEscaper(escapeMap); - -// Internal list of HTML entities for unescaping. -var unescapeMap = invert(escapeMap); - -// Function for unescaping strings from HTML interpolation. -var _unescape = createEscaper(unescapeMap); - -// By default, Underscore uses ERB-style template delimiters. Change the -// following template settings to use alternative delimiters. -var templateSettings = _$1.templateSettings = { - evaluate: /<%([\s\S]+?)%>/g, - interpolate: /<%=([\s\S]+?)%>/g, - escape: /<%-([\s\S]+?)%>/g -}; - -// When customizing `_.templateSettings`, if you don't want to define an -// interpolation, evaluation or escaping regex, we need one that is -// guaranteed not to match. -var noMatch = /(.)^/; - -// Certain characters need to be escaped so that they can be put into a -// string literal. -var escapes = { - "'": "'", - '\\': '\\', - '\r': 'r', - '\n': 'n', - '\u2028': 'u2028', - '\u2029': 'u2029' -}; - -var escapeRegExp = /\\|'|\r|\n|\u2028|\u2029/g; - -function escapeChar(match) { - return '\\' + escapes[match]; -} - -// In order to prevent third-party code injection through -// `_.templateSettings.variable`, we test it against the following regular -// expression. It is intentionally a bit more liberal than just matching valid -// identifiers, but still prevents possible loopholes through defaults or -// destructuring assignment. -var bareIdentifier = /^\s*(\w|\$)+\s*$/; - -// JavaScript micro-templating, similar to John Resig's implementation. -// Underscore templating handles arbitrary delimiters, preserves whitespace, -// and correctly escapes quotes within interpolated code. -// NB: `oldSettings` only exists for backwards compatibility. -function template(text, settings, oldSettings) { - if (!settings && oldSettings) settings = oldSettings; - settings = defaults({}, settings, _$1.templateSettings); - - // Combine delimiters into one regular expression via alternation. - var matcher = RegExp([ - (settings.escape || noMatch).source, - (settings.interpolate || noMatch).source, - (settings.evaluate || noMatch).source - ].join('|') + '|$', 'g'); - - // Compile the template source, escaping string literals appropriately. - var index = 0; - var source = "__p+='"; - text.replace(matcher, function(match, escape, interpolate, evaluate, offset) { - source += text.slice(index, offset).replace(escapeRegExp, escapeChar); - index = offset + match.length; - - if (escape) { - source += "'+\n((__t=(" + escape + "))==null?'':_.escape(__t))+\n'"; - } else if (interpolate) { - source += "'+\n((__t=(" + interpolate + "))==null?'':__t)+\n'"; - } else if (evaluate) { - source += "';\n" + evaluate + "\n__p+='"; - } - - // Adobe VMs need the match returned to produce the correct offset. - return match; - }); - source += "';\n"; - - var argument = settings.variable; - if (argument) { - // Insure against third-party code injection. (CVE-2021-23358) - if (!bareIdentifier.test(argument)) throw new Error( - 'variable is not a bare identifier: ' + argument - ); - } else { - // If a variable is not specified, place data values in local scope. - source = 'with(obj||{}){\n' + source + '}\n'; - argument = 'obj'; - } - - source = "var __t,__p='',__j=Array.prototype.join," + - "print=function(){__p+=__j.call(arguments,'');};\n" + - source + 'return __p;\n'; - - var render; - try { - render = new Function(argument, '_', source); - } catch (e) { - e.source = source; - throw e; - } - - var template = function(data) { - return render.call(this, data, _$1); - }; - - // Provide the compiled source as a convenience for precompilation. - template.source = 'function(' + argument + '){\n' + source + '}'; - - return template; -} - -// Traverses the children of `obj` along `path`. If a child is a function, it -// is invoked with its parent as context. Returns the value of the final -// child, or `fallback` if any child is undefined. -function result(obj, path, fallback) { - path = toPath(path); - var length = path.length; - if (!length) { - return isFunction$1(fallback) ? fallback.call(obj) : fallback; - } - for (var i = 0; i < length; i++) { - var prop = obj == null ? void 0 : obj[path[i]]; - if (prop === void 0) { - prop = fallback; - i = length; // Ensure we don't continue iterating. - } - obj = isFunction$1(prop) ? prop.call(obj) : prop; - } - return obj; -} - -// Generate a unique integer id (unique within the entire client session). -// Useful for temporary DOM ids. -var idCounter = 0; -function uniqueId(prefix) { - var id = ++idCounter + ''; - return prefix ? prefix + id : id; -} - -// Start chaining a wrapped Underscore object. -function chain(obj) { - var instance = _$1(obj); - instance._chain = true; - return instance; -} - -// Internal function to execute `sourceFunc` bound to `context` with optional -// `args`. Determines whether to execute a function as a constructor or as a -// normal function. -function executeBound(sourceFunc, boundFunc, context, callingContext, args) { - if (!(callingContext instanceof boundFunc)) return sourceFunc.apply(context, args); - var self = baseCreate(sourceFunc.prototype); - var result = sourceFunc.apply(self, args); - if (isObject(result)) return result; - return self; -} - -// Partially apply a function by creating a version that has had some of its -// arguments pre-filled, without changing its dynamic `this` context. `_` acts -// as a placeholder by default, allowing any combination of arguments to be -// pre-filled. Set `_.partial.placeholder` for a custom placeholder argument. -var partial = restArguments(function(func, boundArgs) { - var placeholder = partial.placeholder; - var bound = function() { - var position = 0, length = boundArgs.length; - var args = Array(length); - for (var i = 0; i < length; i++) { - args[i] = boundArgs[i] === placeholder ? arguments[position++] : boundArgs[i]; - } - while (position < arguments.length) args.push(arguments[position++]); - return executeBound(func, bound, this, this, args); - }; - return bound; -}); - -partial.placeholder = _$1; - -// Create a function bound to a given object (assigning `this`, and arguments, -// optionally). -var bind = restArguments(function(func, context, args) { - if (!isFunction$1(func)) throw new TypeError('Bind must be called on a function'); - var bound = restArguments(function(callArgs) { - return executeBound(func, bound, context, this, args.concat(callArgs)); - }); - return bound; -}); - -// Internal helper for collection methods to determine whether a collection -// should be iterated as an array or as an object. -// Related: https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength -// Avoids a very nasty iOS 8 JIT bug on ARM-64. #2094 -var isArrayLike = createSizePropertyCheck(getLength); - -// Internal implementation of a recursive `flatten` function. -function flatten$1(input, depth, strict, output) { - output = output || []; - if (!depth && depth !== 0) { - depth = Infinity; - } else if (depth <= 0) { - return output.concat(input); - } - var idx = output.length; - for (var i = 0, length = getLength(input); i < length; i++) { - var value = input[i]; - if (isArrayLike(value) && (isArray(value) || isArguments$1(value))) { - // Flatten current level of array or arguments object. - if (depth > 1) { - flatten$1(value, depth - 1, strict, output); - idx = output.length; - } else { - var j = 0, len = value.length; - while (j < len) output[idx++] = value[j++]; - } - } else if (!strict) { - output[idx++] = value; - } - } - return output; -} - -// Bind a number of an object's methods to that object. Remaining arguments -// are the method names to be bound. Useful for ensuring that all callbacks -// defined on an object belong to it. -var bindAll = restArguments(function(obj, keys) { - keys = flatten$1(keys, false, false); - var index = keys.length; - if (index < 1) throw new Error('bindAll must be passed function names'); - while (index--) { - var key = keys[index]; - obj[key] = bind(obj[key], obj); - } - return obj; -}); - -// Memoize an expensive function by storing its results. -function memoize(func, hasher) { - var memoize = function(key) { - var cache = memoize.cache; - var address = '' + (hasher ? hasher.apply(this, arguments) : key); - if (!has$1(cache, address)) cache[address] = func.apply(this, arguments); - return cache[address]; - }; - memoize.cache = {}; - return memoize; -} - -// Delays a function for the given number of milliseconds, and then calls -// it with the arguments supplied. -var delay = restArguments(function(func, wait, args) { - return setTimeout(function() { - return func.apply(null, args); - }, wait); -}); - -// Defers a function, scheduling it to run after the current call stack has -// cleared. -var defer = partial(delay, _$1, 1); - -// Returns a function, that, when invoked, will only be triggered at most once -// during a given window of time. Normally, the throttled function will run -// as much as it can, without ever going more than once per `wait` duration; -// but if you'd like to disable the execution on the leading edge, pass -// `{leading: false}`. To disable execution on the trailing edge, ditto. -function throttle(func, wait, options) { - var timeout, context, args, result; - var previous = 0; - if (!options) options = {}; - - var later = function() { - previous = options.leading === false ? 0 : now(); - timeout = null; - result = func.apply(context, args); - if (!timeout) context = args = null; - }; - - var throttled = function() { - var _now = now(); - if (!previous && options.leading === false) previous = _now; - var remaining = wait - (_now - previous); - context = this; - args = arguments; - if (remaining <= 0 || remaining > wait) { - if (timeout) { - clearTimeout(timeout); - timeout = null; - } - previous = _now; - result = func.apply(context, args); - if (!timeout) context = args = null; - } else if (!timeout && options.trailing !== false) { - timeout = setTimeout(later, remaining); - } - return result; - }; - - throttled.cancel = function() { - clearTimeout(timeout); - previous = 0; - timeout = context = args = null; - }; - - return throttled; -} - -// When a sequence of calls of the returned function ends, the argument -// function is triggered. The end of a sequence is defined by the `wait` -// parameter. If `immediate` is passed, the argument function will be -// triggered at the beginning of the sequence instead of at the end. -function debounce(func, wait, immediate) { - var timeout, previous, args, result, context; - - var later = function() { - var passed = now() - previous; - if (wait > passed) { - timeout = setTimeout(later, wait - passed); - } else { - timeout = null; - if (!immediate) result = func.apply(context, args); - // This check is needed because `func` can recursively invoke `debounced`. - if (!timeout) args = context = null; - } - }; - - var debounced = restArguments(function(_args) { - context = this; - args = _args; - previous = now(); - if (!timeout) { - timeout = setTimeout(later, wait); - if (immediate) result = func.apply(context, args); - } - return result; - }); - - debounced.cancel = function() { - clearTimeout(timeout); - timeout = args = context = null; - }; - - return debounced; -} - -// Returns the first function passed as an argument to the second, -// allowing you to adjust arguments, run code before and after, and -// conditionally execute the original function. -function wrap(func, wrapper) { - return partial(wrapper, func); -} - -// Returns a negated version of the passed-in predicate. -function negate(predicate) { - return function() { - return !predicate.apply(this, arguments); - }; -} - -// Returns a function that is the composition of a list of functions, each -// consuming the return value of the function that follows. -function compose() { - var args = arguments; - var start = args.length - 1; - return function() { - var i = start; - var result = args[start].apply(this, arguments); - while (i--) result = args[i].call(this, result); - return result; - }; -} - -// Returns a function that will only be executed on and after the Nth call. -function after(times, func) { - return function() { - if (--times < 1) { - return func.apply(this, arguments); - } - }; -} - -// Returns a function that will only be executed up to (but not including) the -// Nth call. -function before(times, func) { - var memo; - return function() { - if (--times > 0) { - memo = func.apply(this, arguments); - } - if (times <= 1) func = null; - return memo; - }; -} - -// Returns a function that will be executed at most one time, no matter how -// often you call it. Useful for lazy initialization. -var once = partial(before, 2); - -// Returns the first key on an object that passes a truth test. -function findKey(obj, predicate, context) { - predicate = cb(predicate, context); - var _keys = keys(obj), key; - for (var i = 0, length = _keys.length; i < length; i++) { - key = _keys[i]; - if (predicate(obj[key], key, obj)) return key; - } -} - -// Internal function to generate `_.findIndex` and `_.findLastIndex`. -function createPredicateIndexFinder(dir) { - return function(array, predicate, context) { - predicate = cb(predicate, context); - var length = getLength(array); - var index = dir > 0 ? 0 : length - 1; - for (; index >= 0 && index < length; index += dir) { - if (predicate(array[index], index, array)) return index; - } - return -1; - }; -} - -// Returns the first index on an array-like that passes a truth test. -var findIndex = createPredicateIndexFinder(1); - -// Returns the last index on an array-like that passes a truth test. -var findLastIndex = createPredicateIndexFinder(-1); - -// Use a comparator function to figure out the smallest index at which -// an object should be inserted so as to maintain order. Uses binary search. -function sortedIndex(array, obj, iteratee, context) { - iteratee = cb(iteratee, context, 1); - var value = iteratee(obj); - var low = 0, high = getLength(array); - while (low < high) { - var mid = Math.floor((low + high) / 2); - if (iteratee(array[mid]) < value) low = mid + 1; else high = mid; - } - return low; -} - -// Internal function to generate the `_.indexOf` and `_.lastIndexOf` functions. -function createIndexFinder(dir, predicateFind, sortedIndex) { - return function(array, item, idx) { - var i = 0, length = getLength(array); - if (typeof idx == 'number') { - if (dir > 0) { - i = idx >= 0 ? idx : Math.max(idx + length, i); - } else { - length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1; - } - } else if (sortedIndex && idx && length) { - idx = sortedIndex(array, item); - return array[idx] === item ? idx : -1; - } - if (item !== item) { - idx = predicateFind(slice.call(array, i, length), isNaN$1); - return idx >= 0 ? idx + i : -1; - } - for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) { - if (array[idx] === item) return idx; - } - return -1; - }; -} - -// Return the position of the first occurrence of an item in an array, -// or -1 if the item is not included in the array. -// If the array is large and already in sort order, pass `true` -// for **isSorted** to use binary search. -var indexOf = createIndexFinder(1, findIndex, sortedIndex); - -// Return the position of the last occurrence of an item in an array, -// or -1 if the item is not included in the array. -var lastIndexOf = createIndexFinder(-1, findLastIndex); - -// Return the first value which passes a truth test. -function find(obj, predicate, context) { - var keyFinder = isArrayLike(obj) ? findIndex : findKey; - var key = keyFinder(obj, predicate, context); - if (key !== void 0 && key !== -1) return obj[key]; -} - -// Convenience version of a common use case of `_.find`: getting the first -// object containing specific `key:value` pairs. -function findWhere(obj, attrs) { - return find(obj, matcher(attrs)); -} - -// The cornerstone for collection functions, an `each` -// implementation, aka `forEach`. -// Handles raw objects in addition to array-likes. Treats all -// sparse array-likes as if they were dense. -function each(obj, iteratee, context) { - iteratee = optimizeCb(iteratee, context); - var i, length; - if (isArrayLike(obj)) { - for (i = 0, length = obj.length; i < length; i++) { - iteratee(obj[i], i, obj); - } - } else { - var _keys = keys(obj); - for (i = 0, length = _keys.length; i < length; i++) { - iteratee(obj[_keys[i]], _keys[i], obj); - } - } - return obj; -} - -// Return the results of applying the iteratee to each element. -function map(obj, iteratee, context) { - iteratee = cb(iteratee, context); - var _keys = !isArrayLike(obj) && keys(obj), - length = (_keys || obj).length, - results = Array(length); - for (var index = 0; index < length; index++) { - var currentKey = _keys ? _keys[index] : index; - results[index] = iteratee(obj[currentKey], currentKey, obj); - } - return results; -} - -// Internal helper to create a reducing function, iterating left or right. -function createReduce(dir) { - // Wrap code that reassigns argument variables in a separate function than - // the one that accesses `arguments.length` to avoid a perf hit. (#1991) - var reducer = function(obj, iteratee, memo, initial) { - var _keys = !isArrayLike(obj) && keys(obj), - length = (_keys || obj).length, - index = dir > 0 ? 0 : length - 1; - if (!initial) { - memo = obj[_keys ? _keys[index] : index]; - index += dir; - } - for (; index >= 0 && index < length; index += dir) { - var currentKey = _keys ? _keys[index] : index; - memo = iteratee(memo, obj[currentKey], currentKey, obj); - } - return memo; - }; - - return function(obj, iteratee, memo, context) { - var initial = arguments.length >= 3; - return reducer(obj, optimizeCb(iteratee, context, 4), memo, initial); - }; -} - -// **Reduce** builds up a single result from a list of values, aka `inject`, -// or `foldl`. -var reduce = createReduce(1); - -// The right-associative version of reduce, also known as `foldr`. -var reduceRight = createReduce(-1); - -// Return all the elements that pass a truth test. -function filter(obj, predicate, context) { - var results = []; - predicate = cb(predicate, context); - each(obj, function(value, index, list) { - if (predicate(value, index, list)) results.push(value); - }); - return results; -} - -// Return all the elements for which a truth test fails. -function reject(obj, predicate, context) { - return filter(obj, negate(cb(predicate)), context); -} - -// Determine whether all of the elements pass a truth test. -function every(obj, predicate, context) { - predicate = cb(predicate, context); - var _keys = !isArrayLike(obj) && keys(obj), - length = (_keys || obj).length; - for (var index = 0; index < length; index++) { - var currentKey = _keys ? _keys[index] : index; - if (!predicate(obj[currentKey], currentKey, obj)) return false; - } - return true; -} - -// Determine if at least one element in the object passes a truth test. -function some(obj, predicate, context) { - predicate = cb(predicate, context); - var _keys = !isArrayLike(obj) && keys(obj), - length = (_keys || obj).length; - for (var index = 0; index < length; index++) { - var currentKey = _keys ? _keys[index] : index; - if (predicate(obj[currentKey], currentKey, obj)) return true; - } - return false; -} - -// Determine if the array or object contains a given item (using `===`). -function contains(obj, item, fromIndex, guard) { - if (!isArrayLike(obj)) obj = values(obj); - if (typeof fromIndex != 'number' || guard) fromIndex = 0; - return indexOf(obj, item, fromIndex) >= 0; -} - -// Invoke a method (with arguments) on every item in a collection. -var invoke = restArguments(function(obj, path, args) { - var contextPath, func; - if (isFunction$1(path)) { - func = path; - } else { - path = toPath(path); - contextPath = path.slice(0, -1); - path = path[path.length - 1]; - } - return map(obj, function(context) { - var method = func; - if (!method) { - if (contextPath && contextPath.length) { - context = deepGet(context, contextPath); - } - if (context == null) return void 0; - method = context[path]; - } - return method == null ? method : method.apply(context, args); - }); -}); - -// Convenience version of a common use case of `_.map`: fetching a property. -function pluck(obj, key) { - return map(obj, property(key)); -} - -// Convenience version of a common use case of `_.filter`: selecting only -// objects containing specific `key:value` pairs. -function where(obj, attrs) { - return filter(obj, matcher(attrs)); -} - -// Return the maximum element (or element-based computation). -function max(obj, iteratee, context) { - var result = -Infinity, lastComputed = -Infinity, - value, computed; - if (iteratee == null || (typeof iteratee == 'number' && typeof obj[0] != 'object' && obj != null)) { - obj = isArrayLike(obj) ? obj : values(obj); - for (var i = 0, length = obj.length; i < length; i++) { - value = obj[i]; - if (value != null && value > result) { - result = value; - } - } - } else { - iteratee = cb(iteratee, context); - each(obj, function(v, index, list) { - computed = iteratee(v, index, list); - if (computed > lastComputed || (computed === -Infinity && result === -Infinity)) { - result = v; - lastComputed = computed; - } - }); - } - return result; -} - -// Return the minimum element (or element-based computation). -function min(obj, iteratee, context) { - var result = Infinity, lastComputed = Infinity, - value, computed; - if (iteratee == null || (typeof iteratee == 'number' && typeof obj[0] != 'object' && obj != null)) { - obj = isArrayLike(obj) ? obj : values(obj); - for (var i = 0, length = obj.length; i < length; i++) { - value = obj[i]; - if (value != null && value < result) { - result = value; - } - } - } else { - iteratee = cb(iteratee, context); - each(obj, function(v, index, list) { - computed = iteratee(v, index, list); - if (computed < lastComputed || (computed === Infinity && result === Infinity)) { - result = v; - lastComputed = computed; - } - }); - } - return result; -} - -// Safely create a real, live array from anything iterable. -var reStrSymbol = /[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g; -function toArray(obj) { - if (!obj) return []; - if (isArray(obj)) return slice.call(obj); - if (isString(obj)) { - // Keep surrogate pair characters together. - return obj.match(reStrSymbol); - } - if (isArrayLike(obj)) return map(obj, identity); - return values(obj); -} - -// Sample **n** random values from a collection using the modern version of the -// [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher–Yates_shuffle). -// If **n** is not specified, returns a single random element. -// The internal `guard` argument allows it to work with `_.map`. -function sample(obj, n, guard) { - if (n == null || guard) { - if (!isArrayLike(obj)) obj = values(obj); - return obj[random(obj.length - 1)]; - } - var sample = toArray(obj); - var length = getLength(sample); - n = Math.max(Math.min(n, length), 0); - var last = length - 1; - for (var index = 0; index < n; index++) { - var rand = random(index, last); - var temp = sample[index]; - sample[index] = sample[rand]; - sample[rand] = temp; - } - return sample.slice(0, n); -} - -// Shuffle a collection. -function shuffle(obj) { - return sample(obj, Infinity); -} - -// Sort the object's values by a criterion produced by an iteratee. -function sortBy(obj, iteratee, context) { - var index = 0; - iteratee = cb(iteratee, context); - return pluck(map(obj, function(value, key, list) { - return { - value: value, - index: index++, - criteria: iteratee(value, key, list) - }; - }).sort(function(left, right) { - var a = left.criteria; - var b = right.criteria; - if (a !== b) { - if (a > b || a === void 0) return 1; - if (a < b || b === void 0) return -1; - } - return left.index - right.index; - }), 'value'); -} - -// An internal function used for aggregate "group by" operations. -function group(behavior, partition) { - return function(obj, iteratee, context) { - var result = partition ? [[], []] : {}; - iteratee = cb(iteratee, context); - each(obj, function(value, index) { - var key = iteratee(value, index, obj); - behavior(result, value, key); - }); - return result; - }; -} - -// Groups the object's values by a criterion. Pass either a string attribute -// to group by, or a function that returns the criterion. -var groupBy = group(function(result, value, key) { - if (has$1(result, key)) result[key].push(value); else result[key] = [value]; -}); - -// Indexes the object's values by a criterion, similar to `_.groupBy`, but for -// when you know that your index values will be unique. -var indexBy = group(function(result, value, key) { - result[key] = value; -}); - -// Counts instances of an object that group by a certain criterion. Pass -// either a string attribute to count by, or a function that returns the -// criterion. -var countBy = group(function(result, value, key) { - if (has$1(result, key)) result[key]++; else result[key] = 1; -}); - -// Split a collection into two arrays: one whose elements all pass the given -// truth test, and one whose elements all do not pass the truth test. -var partition = group(function(result, value, pass) { - result[pass ? 0 : 1].push(value); -}, true); - -// Return the number of elements in a collection. -function size(obj) { - if (obj == null) return 0; - return isArrayLike(obj) ? obj.length : keys(obj).length; -} - -// Internal `_.pick` helper function to determine whether `key` is an enumerable -// property name of `obj`. -function keyInObj(value, key, obj) { - return key in obj; -} - -// Return a copy of the object only containing the allowed properties. -var pick = restArguments(function(obj, keys) { - var result = {}, iteratee = keys[0]; - if (obj == null) return result; - if (isFunction$1(iteratee)) { - if (keys.length > 1) iteratee = optimizeCb(iteratee, keys[1]); - keys = allKeys(obj); - } else { - iteratee = keyInObj; - keys = flatten$1(keys, false, false); - obj = Object(obj); - } - for (var i = 0, length = keys.length; i < length; i++) { - var key = keys[i]; - var value = obj[key]; - if (iteratee(value, key, obj)) result[key] = value; - } - return result; -}); - -// Return a copy of the object without the disallowed properties. -var omit = restArguments(function(obj, keys) { - var iteratee = keys[0], context; - if (isFunction$1(iteratee)) { - iteratee = negate(iteratee); - if (keys.length > 1) context = keys[1]; - } else { - keys = map(flatten$1(keys, false, false), String); - iteratee = function(value, key) { - return !contains(keys, key); - }; - } - return pick(obj, iteratee, context); -}); - -// Returns everything but the last entry of the array. Especially useful on -// the arguments object. Passing **n** will return all the values in -// the array, excluding the last N. -function initial(array, n, guard) { - return slice.call(array, 0, Math.max(0, array.length - (n == null || guard ? 1 : n))); -} - -// Get the first element of an array. Passing **n** will return the first N -// values in the array. The **guard** check allows it to work with `_.map`. -function first(array, n, guard) { - if (array == null || array.length < 1) return n == null || guard ? void 0 : []; - if (n == null || guard) return array[0]; - return initial(array, array.length - n); -} - -// Returns everything but the first entry of the `array`. Especially useful on -// the `arguments` object. Passing an **n** will return the rest N values in the -// `array`. -function rest(array, n, guard) { - return slice.call(array, n == null || guard ? 1 : n); -} - -// Get the last element of an array. Passing **n** will return the last N -// values in the array. -function last(array, n, guard) { - if (array == null || array.length < 1) return n == null || guard ? void 0 : []; - if (n == null || guard) return array[array.length - 1]; - return rest(array, Math.max(0, array.length - n)); -} - -// Trim out all falsy values from an array. -function compact(array) { - return filter(array, Boolean); -} - -// Flatten out an array, either recursively (by default), or up to `depth`. -// Passing `true` or `false` as `depth` means `1` or `Infinity`, respectively. -function flatten(array, depth) { - return flatten$1(array, depth, false); -} - -// Take the difference between one array and a number of other arrays. -// Only the elements present in just the first array will remain. -var difference = restArguments(function(array, rest) { - rest = flatten$1(rest, true, true); - return filter(array, function(value){ - return !contains(rest, value); - }); -}); - -// Return a version of the array that does not contain the specified value(s). -var without = restArguments(function(array, otherArrays) { - return difference(array, otherArrays); -}); - -// Produce a duplicate-free version of the array. If the array has already -// been sorted, you have the option of using a faster algorithm. -// The faster algorithm will not work with an iteratee if the iteratee -// is not a one-to-one function, so providing an iteratee will disable -// the faster algorithm. -function uniq(array, isSorted, iteratee, context) { - if (!isBoolean(isSorted)) { - context = iteratee; - iteratee = isSorted; - isSorted = false; - } - if (iteratee != null) iteratee = cb(iteratee, context); - var result = []; - var seen = []; - for (var i = 0, length = getLength(array); i < length; i++) { - var value = array[i], - computed = iteratee ? iteratee(value, i, array) : value; - if (isSorted && !iteratee) { - if (!i || seen !== computed) result.push(value); - seen = computed; - } else if (iteratee) { - if (!contains(seen, computed)) { - seen.push(computed); - result.push(value); - } - } else if (!contains(result, value)) { - result.push(value); - } - } - return result; -} - -// Produce an array that contains the union: each distinct element from all of -// the passed-in arrays. -var union = restArguments(function(arrays) { - return uniq(flatten$1(arrays, true, true)); -}); - -// Produce an array that contains every item shared between all the -// passed-in arrays. -function intersection(array) { - var result = []; - var argsLength = arguments.length; - for (var i = 0, length = getLength(array); i < length; i++) { - var item = array[i]; - if (contains(result, item)) continue; - var j; - for (j = 1; j < argsLength; j++) { - if (!contains(arguments[j], item)) break; - } - if (j === argsLength) result.push(item); - } - return result; -} - -// Complement of zip. Unzip accepts an array of arrays and groups -// each array's elements on shared indices. -function unzip(array) { - var length = (array && max(array, getLength).length) || 0; - var result = Array(length); - - for (var index = 0; index < length; index++) { - result[index] = pluck(array, index); - } - return result; -} - -// Zip together multiple lists into a single array -- elements that share -// an index go together. -var zip = restArguments(unzip); - -// Converts lists into objects. Pass either a single array of `[key, value]` -// pairs, or two parallel arrays of the same length -- one of keys, and one of -// the corresponding values. Passing by pairs is the reverse of `_.pairs`. -function object(list, values) { - var result = {}; - for (var i = 0, length = getLength(list); i < length; i++) { - if (values) { - result[list[i]] = values[i]; - } else { - result[list[i][0]] = list[i][1]; - } - } - return result; -} - -// Generate an integer Array containing an arithmetic progression. A port of -// the native Python `range()` function. See -// [the Python documentation](https://docs.python.org/library/functions.html#range). -function range(start, stop, step) { - if (stop == null) { - stop = start || 0; - start = 0; - } - if (!step) { - step = stop < start ? -1 : 1; - } - - var length = Math.max(Math.ceil((stop - start) / step), 0); - var range = Array(length); - - for (var idx = 0; idx < length; idx++, start += step) { - range[idx] = start; - } - - return range; -} - -// Chunk a single array into multiple arrays, each containing `count` or fewer -// items. -function chunk(array, count) { - if (count == null || count < 1) return []; - var result = []; - var i = 0, length = array.length; - while (i < length) { - result.push(slice.call(array, i, i += count)); - } - return result; -} - -// Helper function to continue chaining intermediate results. -function chainResult(instance, obj) { - return instance._chain ? _$1(obj).chain() : obj; -} - -// Add your own custom functions to the Underscore object. -function mixin(obj) { - each(functions(obj), function(name) { - var func = _$1[name] = obj[name]; - _$1.prototype[name] = function() { - var args = [this._wrapped]; - push.apply(args, arguments); - return chainResult(this, func.apply(_$1, args)); - }; - }); - return _$1; -} - -// Add all mutator `Array` functions to the wrapper. -each(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(name) { - var method = ArrayProto[name]; - _$1.prototype[name] = function() { - var obj = this._wrapped; - if (obj != null) { - method.apply(obj, arguments); - if ((name === 'shift' || name === 'splice') && obj.length === 0) { - delete obj[0]; - } - } - return chainResult(this, obj); - }; -}); - -// Add all accessor `Array` functions to the wrapper. -each(['concat', 'join', 'slice'], function(name) { - var method = ArrayProto[name]; - _$1.prototype[name] = function() { - var obj = this._wrapped; - if (obj != null) obj = method.apply(obj, arguments); - return chainResult(this, obj); - }; -}); - -// Named Exports - -var allExports = { - __proto__: null, - VERSION: VERSION, - restArguments: restArguments, - isObject: isObject, - isNull: isNull, - isUndefined: isUndefined, - isBoolean: isBoolean, - isElement: isElement, - isString: isString, - isNumber: isNumber, - isDate: isDate, - isRegExp: isRegExp, - isError: isError, - isSymbol: isSymbol, - isArrayBuffer: isArrayBuffer, - isDataView: isDataView$1, - isArray: isArray, - isFunction: isFunction$1, - isArguments: isArguments$1, - isFinite: isFinite$1, - isNaN: isNaN$1, - isTypedArray: isTypedArray$1, - isEmpty: isEmpty, - isMatch: isMatch, - isEqual: isEqual, - isMap: isMap, - isWeakMap: isWeakMap, - isSet: isSet, - isWeakSet: isWeakSet, - keys: keys, - allKeys: allKeys, - values: values, - pairs: pairs, - invert: invert, - functions: functions, - methods: functions, - extend: extend, - extendOwn: extendOwn, - assign: extendOwn, - defaults: defaults, - create: create, - clone: clone, - tap: tap, - get: get, - has: has, - mapObject: mapObject, - identity: identity, - constant: constant, - noop: noop, - toPath: toPath$1, - property: property, - propertyOf: propertyOf, - matcher: matcher, - matches: matcher, - times: times, - random: random, - now: now, - escape: _escape, - unescape: _unescape, - templateSettings: templateSettings, - template: template, - result: result, - uniqueId: uniqueId, - chain: chain, - iteratee: iteratee, - partial: partial, - bind: bind, - bindAll: bindAll, - memoize: memoize, - delay: delay, - defer: defer, - throttle: throttle, - debounce: debounce, - wrap: wrap, - negate: negate, - compose: compose, - after: after, - before: before, - once: once, - findKey: findKey, - findIndex: findIndex, - findLastIndex: findLastIndex, - sortedIndex: sortedIndex, - indexOf: indexOf, - lastIndexOf: lastIndexOf, - find: find, - detect: find, - findWhere: findWhere, - each: each, - forEach: each, - map: map, - collect: map, - reduce: reduce, - foldl: reduce, - inject: reduce, - reduceRight: reduceRight, - foldr: reduceRight, - filter: filter, - select: filter, - reject: reject, - every: every, - all: every, - some: some, - any: some, - contains: contains, - includes: contains, - include: contains, - invoke: invoke, - pluck: pluck, - where: where, - max: max, - min: min, - shuffle: shuffle, - sample: sample, - sortBy: sortBy, - groupBy: groupBy, - indexBy: indexBy, - countBy: countBy, - partition: partition, - toArray: toArray, - size: size, - pick: pick, - omit: omit, - first: first, - head: first, - take: first, - initial: initial, - last: last, - rest: rest, - tail: rest, - drop: rest, - compact: compact, - flatten: flatten, - without: without, - uniq: uniq, - unique: uniq, - union: union, - intersection: intersection, - difference: difference, - unzip: unzip, - transpose: unzip, - zip: zip, - object: object, - range: range, - chunk: chunk, - mixin: mixin, - 'default': _$1 -}; - -// Default Export - -// Add all of the Underscore functions to the wrapper object. -var _ = mixin(allExports); -// Legacy Node.js API. -_._ = _; - -// ESM Exports - -export default _; -export { VERSION, after, every as all, allKeys, some as any, extendOwn as assign, before, bind, bindAll, chain, chunk, clone, map as collect, compact, compose, constant, contains, countBy, create, debounce, defaults, defer, delay, find as detect, difference, rest as drop, each, _escape as escape, every, extend, extendOwn, filter, find, findIndex, findKey, findLastIndex, findWhere, first, flatten, reduce as foldl, reduceRight as foldr, each as forEach, functions, get, groupBy, has, first as head, identity, contains as include, contains as includes, indexBy, indexOf, initial, reduce as inject, intersection, invert, invoke, isArguments$1 as isArguments, isArray, isArrayBuffer, isBoolean, isDataView$1 as isDataView, isDate, isElement, isEmpty, isEqual, isError, isFinite$1 as isFinite, isFunction$1 as isFunction, isMap, isMatch, isNaN$1 as isNaN, isNull, isNumber, isObject, isRegExp, isSet, isString, isSymbol, isTypedArray$1 as isTypedArray, isUndefined, isWeakMap, isWeakSet, iteratee, keys, last, lastIndexOf, map, mapObject, matcher, matcher as matches, max, memoize, functions as methods, min, mixin, negate, noop, now, object, omit, once, pairs, partial, partition, pick, pluck, property, propertyOf, random, range, reduce, reduceRight, reject, rest, restArguments, result, sample, filter as select, shuffle, size, some, sortBy, sortedIndex, rest as tail, first as take, tap, template, templateSettings, throttle, times, toArray, toPath$1 as toPath, unzip as transpose, _unescape as unescape, union, uniq, uniq as unique, uniqueId, unzip, values, where, without, wrap, zip }; -//# sourceMappingURL=underscore-esm.js.map diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/underscore-min.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/underscore-min.js deleted file mode 100644 index b73f16e9..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/underscore-min.js +++ /dev/null @@ -1,6 +0,0 @@ -!function(n,r){"object"==typeof exports&&"undefined"!=typeof module?module.exports=r():"function"==typeof define&&define.amd?define("underscore",r):(n="undefined"!=typeof globalThis?globalThis:n||self,function(){var t=n._,e=n._=r();e.noConflict=function(){return n._=t,e}}())}(this,(function(){ -// Underscore.js 1.13.6 -// https://underscorejs.org -// (c) 2009-2022 Jeremy Ashkenas, Julian Gonggrijp, and DocumentCloud and Investigative Reporters & Editors -// Underscore may be freely distributed under the MIT license. -var n="1.13.6",r="object"==typeof self&&self.self===self&&self||"object"==typeof global&&global.global===global&&global||Function("return this")()||{},t=Array.prototype,e=Object.prototype,u="undefined"!=typeof Symbol?Symbol.prototype:null,o=t.push,i=t.slice,a=e.toString,f=e.hasOwnProperty,c="undefined"!=typeof ArrayBuffer,l="undefined"!=typeof DataView,s=Array.isArray,p=Object.keys,v=Object.create,h=c&&ArrayBuffer.isView,y=isNaN,d=isFinite,g=!{toString:null}.propertyIsEnumerable("toString"),b=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],m=Math.pow(2,53)-1;function j(n,r){return r=null==r?n.length-1:+r,function(){for(var t=Math.max(arguments.length-r,0),e=Array(t),u=0;u=0&&t<=m}}function J(n){return function(r){return null==r?void 0:r[n]}}var G=J("byteLength"),H=K(G),Q=/\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/;var X=c?function(n){return h?h(n)&&!q(n):H(n)&&Q.test(a.call(n))}:C(!1),Y=J("length");function Z(n,r){r=function(n){for(var r={},t=n.length,e=0;e":">",'"':""","'":"'","`":"`"},$n=zn(Ln),Cn=zn(_n(Ln)),Kn=tn.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g},Jn=/(.)^/,Gn={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},Hn=/\\|'|\r|\n|\u2028|\u2029/g;function Qn(n){return"\\"+Gn[n]}var Xn=/^\s*(\w|\$)+\s*$/;var Yn=0;function Zn(n,r,t,e,u){if(!(e instanceof r))return n.apply(t,u);var o=Mn(n.prototype),i=n.apply(o,u);return _(i)?i:o}var nr=j((function(n,r){var t=nr.placeholder,e=function(){for(var u=0,o=r.length,i=Array(o),a=0;a1)er(a,r-1,t,e),u=e.length;else for(var f=0,c=a.length;f0&&(t=r.apply(this,arguments)),n<=1&&(r=null),t}}var cr=nr(fr,2);function lr(n,r,t){r=Pn(r,t);for(var e,u=nn(n),o=0,i=u.length;o0?0:u-1;o>=0&&o0?a=o>=0?o:Math.max(o+f,a):f=o>=0?Math.min(o+1,f):o+f+1;else if(t&&o&&f)return e[o=t(e,u)]===u?o:-1;if(u!=u)return(o=r(i.call(e,a,f),$))>=0?o+a:-1;for(o=n>0?a:f-1;o>=0&&o0?0:i-1;for(u||(e=r[o?o[a]:a],a+=n);a>=0&&a=3;return r(n,Rn(t,u,4),e,o)}}var wr=_r(1),Ar=_r(-1);function xr(n,r,t){var e=[];return r=Pn(r,t),mr(n,(function(n,t,u){r(n,t,u)&&e.push(n)})),e}function Sr(n,r,t){r=Pn(r,t);for(var e=!tr(n)&&nn(n),u=(e||n).length,o=0;o=0}var Er=j((function(n,r,t){var e,u;return D(r)?u=r:(r=Bn(r),e=r.slice(0,-1),r=r[r.length-1]),jr(n,(function(n){var o=u;if(!o){if(e&&e.length&&(n=Nn(n,e)),null==n)return;o=n[r]}return null==o?o:o.apply(n,t)}))}));function Br(n,r){return jr(n,Dn(r))}function Nr(n,r,t){var e,u,o=-1/0,i=-1/0;if(null==r||"number"==typeof r&&"object"!=typeof n[0]&&null!=n)for(var a=0,f=(n=tr(n)?n:jn(n)).length;ao&&(o=e);else r=Pn(r,t),mr(n,(function(n,t,e){((u=r(n,t,e))>i||u===-1/0&&o===-1/0)&&(o=n,i=u)}));return o}var Ir=/[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g;function Tr(n){return n?U(n)?i.call(n):S(n)?n.match(Ir):tr(n)?jr(n,Tn):jn(n):[]}function kr(n,r,t){if(null==r||t)return tr(n)||(n=jn(n)),n[Un(n.length-1)];var e=Tr(n),u=Y(e);r=Math.max(Math.min(r,u),0);for(var o=u-1,i=0;i1&&(e=Rn(e,r[1])),r=an(n)):(e=qr,r=er(r,!1,!1),n=Object(n));for(var u=0,o=r.length;u1&&(t=r[1])):(r=jr(er(r,!1,!1),String),e=function(n,t){return!Mr(r,t)}),Ur(n,e,t)}));function zr(n,r,t){return i.call(n,0,Math.max(0,n.length-(null==r||t?1:r)))}function Lr(n,r,t){return null==n||n.length<1?null==r||t?void 0:[]:null==r||t?n[0]:zr(n,n.length-r)}function $r(n,r,t){return i.call(n,null==r||t?1:r)}var Cr=j((function(n,r){return r=er(r,!0,!0),xr(n,(function(n){return!Mr(r,n)}))})),Kr=j((function(n,r){return Cr(n,r)}));function Jr(n,r,t,e){A(r)||(e=t,t=r,r=!1),null!=t&&(t=Pn(t,e));for(var u=[],o=[],i=0,a=Y(n);ir?(e&&(clearTimeout(e),e=null),a=c,i=n.apply(u,o),e||(u=o=null)):e||!1===t.trailing||(e=setTimeout(f,l)),i};return c.cancel=function(){clearTimeout(e),a=0,e=u=o=null},c},debounce:function(n,r,t){var e,u,o,i,a,f=function(){var c=Wn()-u;r>c?e=setTimeout(f,r-c):(e=null,t||(i=n.apply(a,o)),e||(o=a=null))},c=j((function(c){return a=this,o=c,u=Wn(),e||(e=setTimeout(f,r),t&&(i=n.apply(a,o))),i}));return c.cancel=function(){clearTimeout(e),e=o=a=null},c},wrap:function(n,r){return nr(r,n)},negate:ar,compose:function(){var n=arguments,r=n.length-1;return function(){for(var t=r,e=n[r].apply(this,arguments);t--;)e=n[t].call(this,e);return e}},after:function(n,r){return function(){if(--n<1)return r.apply(this,arguments)}},before:fr,once:cr,findKey:lr,findIndex:pr,findLastIndex:vr,sortedIndex:hr,indexOf:dr,lastIndexOf:gr,find:br,detect:br,findWhere:function(n,r){return br(n,kn(r))},each:mr,forEach:mr,map:jr,collect:jr,reduce:wr,foldl:wr,inject:wr,reduceRight:Ar,foldr:Ar,filter:xr,select:xr,reject:function(n,r,t){return xr(n,ar(Pn(r)),t)},every:Sr,all:Sr,some:Or,any:Or,contains:Mr,includes:Mr,include:Mr,invoke:Er,pluck:Br,where:function(n,r){return xr(n,kn(r))},max:Nr,min:function(n,r,t){var e,u,o=1/0,i=1/0;if(null==r||"number"==typeof r&&"object"!=typeof n[0]&&null!=n)for(var a=0,f=(n=tr(n)?n:jn(n)).length;ae||void 0===t)return 1;if(t= 0 && sizeProperty <= MAX_ARRAY_INDEX; - } -} - -// Internal helper to generate a function to obtain property `key` from `obj`. -function shallowProperty(key) { - return function(obj) { - return obj == null ? void 0 : obj[key]; - }; -} - -// Internal helper to obtain the `byteLength` property of an object. -var getByteLength = shallowProperty('byteLength'); - -// Internal helper to determine whether we should spend extensive checks against -// `ArrayBuffer` et al. -var isBufferLike = createSizePropertyCheck(getByteLength); - -// Is a given value a typed array? -var typedArrayPattern = /\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/; -function isTypedArray(obj) { - // `ArrayBuffer.isView` is the most future-proof, so use it when available. - // Otherwise, fall back on the above regular expression. - return nativeIsView ? (nativeIsView(obj) && !isDataView$1(obj)) : - isBufferLike(obj) && typedArrayPattern.test(toString.call(obj)); -} - -var isTypedArray$1 = supportsArrayBuffer ? isTypedArray : constant(false); - -// Internal helper to obtain the `length` property of an object. -var getLength = shallowProperty('length'); - -// Internal helper to create a simple lookup structure. -// `collectNonEnumProps` used to depend on `_.contains`, but this led to -// circular imports. `emulatedSet` is a one-off solution that only works for -// arrays of strings. -function emulatedSet(keys) { - var hash = {}; - for (var l = keys.length, i = 0; i < l; ++i) hash[keys[i]] = true; - return { - contains: function(key) { return hash[key] === true; }, - push: function(key) { - hash[key] = true; - return keys.push(key); - } - }; -} - -// Internal helper. Checks `keys` for the presence of keys in IE < 9 that won't -// be iterated by `for key in ...` and thus missed. Extends `keys` in place if -// needed. -function collectNonEnumProps(obj, keys) { - keys = emulatedSet(keys); - var nonEnumIdx = nonEnumerableProps.length; - var constructor = obj.constructor; - var proto = (isFunction$1(constructor) && constructor.prototype) || ObjProto; - - // Constructor is a special case. - var prop = 'constructor'; - if (has$1(obj, prop) && !keys.contains(prop)) keys.push(prop); - - while (nonEnumIdx--) { - prop = nonEnumerableProps[nonEnumIdx]; - if (prop in obj && obj[prop] !== proto[prop] && !keys.contains(prop)) { - keys.push(prop); - } - } -} - -// Retrieve the names of an object's own properties. -// Delegates to **ECMAScript 5**'s native `Object.keys`. -function keys(obj) { - if (!isObject(obj)) return []; - if (nativeKeys) return nativeKeys(obj); - var keys = []; - for (var key in obj) if (has$1(obj, key)) keys.push(key); - // Ahem, IE < 9. - if (hasEnumBug) collectNonEnumProps(obj, keys); - return keys; -} - -// Is a given array, string, or object empty? -// An "empty" object has no enumerable own-properties. -function isEmpty(obj) { - if (obj == null) return true; - // Skip the more expensive `toString`-based type checks if `obj` has no - // `.length`. - var length = getLength(obj); - if (typeof length == 'number' && ( - isArray(obj) || isString(obj) || isArguments$1(obj) - )) return length === 0; - return getLength(keys(obj)) === 0; -} - -// Returns whether an object has a given set of `key:value` pairs. -function isMatch(object, attrs) { - var _keys = keys(attrs), length = _keys.length; - if (object == null) return !length; - var obj = Object(object); - for (var i = 0; i < length; i++) { - var key = _keys[i]; - if (attrs[key] !== obj[key] || !(key in obj)) return false; - } - return true; -} - -// If Underscore is called as a function, it returns a wrapped object that can -// be used OO-style. This wrapper holds altered versions of all functions added -// through `_.mixin`. Wrapped objects may be chained. -function _$1(obj) { - if (obj instanceof _$1) return obj; - if (!(this instanceof _$1)) return new _$1(obj); - this._wrapped = obj; -} - -_$1.VERSION = VERSION; - -// Extracts the result from a wrapped and chained object. -_$1.prototype.value = function() { - return this._wrapped; -}; - -// Provide unwrapping proxies for some methods used in engine operations -// such as arithmetic and JSON stringification. -_$1.prototype.valueOf = _$1.prototype.toJSON = _$1.prototype.value; - -_$1.prototype.toString = function() { - return String(this._wrapped); -}; - -// Internal function to wrap or shallow-copy an ArrayBuffer, -// typed array or DataView to a new view, reusing the buffer. -function toBufferView(bufferSource) { - return new Uint8Array( - bufferSource.buffer || bufferSource, - bufferSource.byteOffset || 0, - getByteLength(bufferSource) - ); -} - -// We use this string twice, so give it a name for minification. -var tagDataView = '[object DataView]'; - -// Internal recursive comparison function for `_.isEqual`. -function eq(a, b, aStack, bStack) { - // Identical objects are equal. `0 === -0`, but they aren't identical. - // See the [Harmony `egal` proposal](https://wiki.ecmascript.org/doku.php?id=harmony:egal). - if (a === b) return a !== 0 || 1 / a === 1 / b; - // `null` or `undefined` only equal to itself (strict comparison). - if (a == null || b == null) return false; - // `NaN`s are equivalent, but non-reflexive. - if (a !== a) return b !== b; - // Exhaust primitive checks - var type = typeof a; - if (type !== 'function' && type !== 'object' && typeof b != 'object') return false; - return deepEq(a, b, aStack, bStack); -} - -// Internal recursive comparison function for `_.isEqual`. -function deepEq(a, b, aStack, bStack) { - // Unwrap any wrapped objects. - if (a instanceof _$1) a = a._wrapped; - if (b instanceof _$1) b = b._wrapped; - // Compare `[[Class]]` names. - var className = toString.call(a); - if (className !== toString.call(b)) return false; - // Work around a bug in IE 10 - Edge 13. - if (hasStringTagBug && className == '[object Object]' && isDataView$1(a)) { - if (!isDataView$1(b)) return false; - className = tagDataView; - } - switch (className) { - // These types are compared by value. - case '[object RegExp]': - // RegExps are coerced to strings for comparison (Note: '' + /a/i === '/a/i') - case '[object String]': - // Primitives and their corresponding object wrappers are equivalent; thus, `"5"` is - // equivalent to `new String("5")`. - return '' + a === '' + b; - case '[object Number]': - // `NaN`s are equivalent, but non-reflexive. - // Object(NaN) is equivalent to NaN. - if (+a !== +a) return +b !== +b; - // An `egal` comparison is performed for other numeric values. - return +a === 0 ? 1 / +a === 1 / b : +a === +b; - case '[object Date]': - case '[object Boolean]': - // Coerce dates and booleans to numeric primitive values. Dates are compared by their - // millisecond representations. Note that invalid dates with millisecond representations - // of `NaN` are not equivalent. - return +a === +b; - case '[object Symbol]': - return SymbolProto.valueOf.call(a) === SymbolProto.valueOf.call(b); - case '[object ArrayBuffer]': - case tagDataView: - // Coerce to typed array so we can fall through. - return deepEq(toBufferView(a), toBufferView(b), aStack, bStack); - } - - var areArrays = className === '[object Array]'; - if (!areArrays && isTypedArray$1(a)) { - var byteLength = getByteLength(a); - if (byteLength !== getByteLength(b)) return false; - if (a.buffer === b.buffer && a.byteOffset === b.byteOffset) return true; - areArrays = true; - } - if (!areArrays) { - if (typeof a != 'object' || typeof b != 'object') return false; - - // Objects with different constructors are not equivalent, but `Object`s or `Array`s - // from different frames are. - var aCtor = a.constructor, bCtor = b.constructor; - if (aCtor !== bCtor && !(isFunction$1(aCtor) && aCtor instanceof aCtor && - isFunction$1(bCtor) && bCtor instanceof bCtor) - && ('constructor' in a && 'constructor' in b)) { - return false; - } - } - // Assume equality for cyclic structures. The algorithm for detecting cyclic - // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`. - - // Initializing stack of traversed objects. - // It's done here since we only need them for objects and arrays comparison. - aStack = aStack || []; - bStack = bStack || []; - var length = aStack.length; - while (length--) { - // Linear search. Performance is inversely proportional to the number of - // unique nested structures. - if (aStack[length] === a) return bStack[length] === b; - } - - // Add the first object to the stack of traversed objects. - aStack.push(a); - bStack.push(b); - - // Recursively compare objects and arrays. - if (areArrays) { - // Compare array lengths to determine if a deep comparison is necessary. - length = a.length; - if (length !== b.length) return false; - // Deep compare the contents, ignoring non-numeric properties. - while (length--) { - if (!eq(a[length], b[length], aStack, bStack)) return false; - } - } else { - // Deep compare objects. - var _keys = keys(a), key; - length = _keys.length; - // Ensure that both objects contain the same number of properties before comparing deep equality. - if (keys(b).length !== length) return false; - while (length--) { - // Deep compare each member - key = _keys[length]; - if (!(has$1(b, key) && eq(a[key], b[key], aStack, bStack))) return false; - } - } - // Remove the first object from the stack of traversed objects. - aStack.pop(); - bStack.pop(); - return true; -} - -// Perform a deep comparison to check if two objects are equal. -function isEqual(a, b) { - return eq(a, b); -} - -// Retrieve all the enumerable property names of an object. -function allKeys(obj) { - if (!isObject(obj)) return []; - var keys = []; - for (var key in obj) keys.push(key); - // Ahem, IE < 9. - if (hasEnumBug) collectNonEnumProps(obj, keys); - return keys; -} - -// Since the regular `Object.prototype.toString` type tests don't work for -// some types in IE 11, we use a fingerprinting heuristic instead, based -// on the methods. It's not great, but it's the best we got. -// The fingerprint method lists are defined below. -function ie11fingerprint(methods) { - var length = getLength(methods); - return function(obj) { - if (obj == null) return false; - // `Map`, `WeakMap` and `Set` have no enumerable keys. - var keys = allKeys(obj); - if (getLength(keys)) return false; - for (var i = 0; i < length; i++) { - if (!isFunction$1(obj[methods[i]])) return false; - } - // If we are testing against `WeakMap`, we need to ensure that - // `obj` doesn't have a `forEach` method in order to distinguish - // it from a regular `Map`. - return methods !== weakMapMethods || !isFunction$1(obj[forEachName]); - }; -} - -// In the interest of compact minification, we write -// each string in the fingerprints only once. -var forEachName = 'forEach', - hasName = 'has', - commonInit = ['clear', 'delete'], - mapTail = ['get', hasName, 'set']; - -// `Map`, `WeakMap` and `Set` each have slightly different -// combinations of the above sublists. -var mapMethods = commonInit.concat(forEachName, mapTail), - weakMapMethods = commonInit.concat(mapTail), - setMethods = ['add'].concat(commonInit, forEachName, hasName); - -var isMap = isIE11 ? ie11fingerprint(mapMethods) : tagTester('Map'); - -var isWeakMap = isIE11 ? ie11fingerprint(weakMapMethods) : tagTester('WeakMap'); - -var isSet = isIE11 ? ie11fingerprint(setMethods) : tagTester('Set'); - -var isWeakSet = tagTester('WeakSet'); - -// Retrieve the values of an object's properties. -function values(obj) { - var _keys = keys(obj); - var length = _keys.length; - var values = Array(length); - for (var i = 0; i < length; i++) { - values[i] = obj[_keys[i]]; - } - return values; -} - -// Convert an object into a list of `[key, value]` pairs. -// The opposite of `_.object` with one argument. -function pairs(obj) { - var _keys = keys(obj); - var length = _keys.length; - var pairs = Array(length); - for (var i = 0; i < length; i++) { - pairs[i] = [_keys[i], obj[_keys[i]]]; - } - return pairs; -} - -// Invert the keys and values of an object. The values must be serializable. -function invert(obj) { - var result = {}; - var _keys = keys(obj); - for (var i = 0, length = _keys.length; i < length; i++) { - result[obj[_keys[i]]] = _keys[i]; - } - return result; -} - -// Return a sorted list of the function names available on the object. -function functions(obj) { - var names = []; - for (var key in obj) { - if (isFunction$1(obj[key])) names.push(key); - } - return names.sort(); -} - -// An internal function for creating assigner functions. -function createAssigner(keysFunc, defaults) { - return function(obj) { - var length = arguments.length; - if (defaults) obj = Object(obj); - if (length < 2 || obj == null) return obj; - for (var index = 1; index < length; index++) { - var source = arguments[index], - keys = keysFunc(source), - l = keys.length; - for (var i = 0; i < l; i++) { - var key = keys[i]; - if (!defaults || obj[key] === void 0) obj[key] = source[key]; - } - } - return obj; - }; -} - -// Extend a given object with all the properties in passed-in object(s). -var extend = createAssigner(allKeys); - -// Assigns a given object with all the own properties in the passed-in -// object(s). -// (https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/assign) -var extendOwn = createAssigner(keys); - -// Fill in a given object with default properties. -var defaults = createAssigner(allKeys, true); - -// Create a naked function reference for surrogate-prototype-swapping. -function ctor() { - return function(){}; -} - -// An internal function for creating a new object that inherits from another. -function baseCreate(prototype) { - if (!isObject(prototype)) return {}; - if (nativeCreate) return nativeCreate(prototype); - var Ctor = ctor(); - Ctor.prototype = prototype; - var result = new Ctor; - Ctor.prototype = null; - return result; -} - -// Creates an object that inherits from the given prototype object. -// If additional properties are provided then they will be added to the -// created object. -function create(prototype, props) { - var result = baseCreate(prototype); - if (props) extendOwn(result, props); - return result; -} - -// Create a (shallow-cloned) duplicate of an object. -function clone(obj) { - if (!isObject(obj)) return obj; - return isArray(obj) ? obj.slice() : extend({}, obj); -} - -// Invokes `interceptor` with the `obj` and then returns `obj`. -// The primary purpose of this method is to "tap into" a method chain, in -// order to perform operations on intermediate results within the chain. -function tap(obj, interceptor) { - interceptor(obj); - return obj; -} - -// Normalize a (deep) property `path` to array. -// Like `_.iteratee`, this function can be customized. -function toPath$1(path) { - return isArray(path) ? path : [path]; -} -_$1.toPath = toPath$1; - -// Internal wrapper for `_.toPath` to enable minification. -// Similar to `cb` for `_.iteratee`. -function toPath(path) { - return _$1.toPath(path); -} - -// Internal function to obtain a nested property in `obj` along `path`. -function deepGet(obj, path) { - var length = path.length; - for (var i = 0; i < length; i++) { - if (obj == null) return void 0; - obj = obj[path[i]]; - } - return length ? obj : void 0; -} - -// Get the value of the (deep) property on `path` from `object`. -// If any property in `path` does not exist or if the value is -// `undefined`, return `defaultValue` instead. -// The `path` is normalized through `_.toPath`. -function get(object, path, defaultValue) { - var value = deepGet(object, toPath(path)); - return isUndefined(value) ? defaultValue : value; -} - -// Shortcut function for checking if an object has a given property directly on -// itself (in other words, not on a prototype). Unlike the internal `has` -// function, this public version can also traverse nested properties. -function has(obj, path) { - path = toPath(path); - var length = path.length; - for (var i = 0; i < length; i++) { - var key = path[i]; - if (!has$1(obj, key)) return false; - obj = obj[key]; - } - return !!length; -} - -// Keep the identity function around for default iteratees. -function identity(value) { - return value; -} - -// Returns a predicate for checking whether an object has a given set of -// `key:value` pairs. -function matcher(attrs) { - attrs = extendOwn({}, attrs); - return function(obj) { - return isMatch(obj, attrs); - }; -} - -// Creates a function that, when passed an object, will traverse that object’s -// properties down the given `path`, specified as an array of keys or indices. -function property(path) { - path = toPath(path); - return function(obj) { - return deepGet(obj, path); - }; -} - -// Internal function that returns an efficient (for current engines) version -// of the passed-in callback, to be repeatedly applied in other Underscore -// functions. -function optimizeCb(func, context, argCount) { - if (context === void 0) return func; - switch (argCount == null ? 3 : argCount) { - case 1: return function(value) { - return func.call(context, value); - }; - // The 2-argument case is omitted because we’re not using it. - case 3: return function(value, index, collection) { - return func.call(context, value, index, collection); - }; - case 4: return function(accumulator, value, index, collection) { - return func.call(context, accumulator, value, index, collection); - }; - } - return function() { - return func.apply(context, arguments); - }; -} - -// An internal function to generate callbacks that can be applied to each -// element in a collection, returning the desired result — either `_.identity`, -// an arbitrary callback, a property matcher, or a property accessor. -function baseIteratee(value, context, argCount) { - if (value == null) return identity; - if (isFunction$1(value)) return optimizeCb(value, context, argCount); - if (isObject(value) && !isArray(value)) return matcher(value); - return property(value); -} - -// External wrapper for our callback generator. Users may customize -// `_.iteratee` if they want additional predicate/iteratee shorthand styles. -// This abstraction hides the internal-only `argCount` argument. -function iteratee(value, context) { - return baseIteratee(value, context, Infinity); -} -_$1.iteratee = iteratee; - -// The function we call internally to generate a callback. It invokes -// `_.iteratee` if overridden, otherwise `baseIteratee`. -function cb(value, context, argCount) { - if (_$1.iteratee !== iteratee) return _$1.iteratee(value, context); - return baseIteratee(value, context, argCount); -} - -// Returns the results of applying the `iteratee` to each element of `obj`. -// In contrast to `_.map` it returns an object. -function mapObject(obj, iteratee, context) { - iteratee = cb(iteratee, context); - var _keys = keys(obj), - length = _keys.length, - results = {}; - for (var index = 0; index < length; index++) { - var currentKey = _keys[index]; - results[currentKey] = iteratee(obj[currentKey], currentKey, obj); - } - return results; -} - -// Predicate-generating function. Often useful outside of Underscore. -function noop(){} - -// Generates a function for a given object that returns a given property. -function propertyOf(obj) { - if (obj == null) return noop; - return function(path) { - return get(obj, path); - }; -} - -// Run a function **n** times. -function times(n, iteratee, context) { - var accum = Array(Math.max(0, n)); - iteratee = optimizeCb(iteratee, context, 1); - for (var i = 0; i < n; i++) accum[i] = iteratee(i); - return accum; -} - -// Return a random integer between `min` and `max` (inclusive). -function random(min, max) { - if (max == null) { - max = min; - min = 0; - } - return min + Math.floor(Math.random() * (max - min + 1)); -} - -// A (possibly faster) way to get the current timestamp as an integer. -var now = Date.now || function() { - return new Date().getTime(); -}; - -// Internal helper to generate functions for escaping and unescaping strings -// to/from HTML interpolation. -function createEscaper(map) { - var escaper = function(match) { - return map[match]; - }; - // Regexes for identifying a key that needs to be escaped. - var source = '(?:' + keys(map).join('|') + ')'; - var testRegexp = RegExp(source); - var replaceRegexp = RegExp(source, 'g'); - return function(string) { - string = string == null ? '' : '' + string; - return testRegexp.test(string) ? string.replace(replaceRegexp, escaper) : string; - }; -} - -// Internal list of HTML entities for escaping. -var escapeMap = { - '&': '&', - '<': '<', - '>': '>', - '"': '"', - "'": ''', - '`': '`' -}; - -// Function for escaping strings to HTML interpolation. -var _escape = createEscaper(escapeMap); - -// Internal list of HTML entities for unescaping. -var unescapeMap = invert(escapeMap); - -// Function for unescaping strings from HTML interpolation. -var _unescape = createEscaper(unescapeMap); - -// By default, Underscore uses ERB-style template delimiters. Change the -// following template settings to use alternative delimiters. -var templateSettings = _$1.templateSettings = { - evaluate: /<%([\s\S]+?)%>/g, - interpolate: /<%=([\s\S]+?)%>/g, - escape: /<%-([\s\S]+?)%>/g -}; - -// When customizing `_.templateSettings`, if you don't want to define an -// interpolation, evaluation or escaping regex, we need one that is -// guaranteed not to match. -var noMatch = /(.)^/; - -// Certain characters need to be escaped so that they can be put into a -// string literal. -var escapes = { - "'": "'", - '\\': '\\', - '\r': 'r', - '\n': 'n', - '\u2028': 'u2028', - '\u2029': 'u2029' -}; - -var escapeRegExp = /\\|'|\r|\n|\u2028|\u2029/g; - -function escapeChar(match) { - return '\\' + escapes[match]; -} - -// In order to prevent third-party code injection through -// `_.templateSettings.variable`, we test it against the following regular -// expression. It is intentionally a bit more liberal than just matching valid -// identifiers, but still prevents possible loopholes through defaults or -// destructuring assignment. -var bareIdentifier = /^\s*(\w|\$)+\s*$/; - -// JavaScript micro-templating, similar to John Resig's implementation. -// Underscore templating handles arbitrary delimiters, preserves whitespace, -// and correctly escapes quotes within interpolated code. -// NB: `oldSettings` only exists for backwards compatibility. -function template(text, settings, oldSettings) { - if (!settings && oldSettings) settings = oldSettings; - settings = defaults({}, settings, _$1.templateSettings); - - // Combine delimiters into one regular expression via alternation. - var matcher = RegExp([ - (settings.escape || noMatch).source, - (settings.interpolate || noMatch).source, - (settings.evaluate || noMatch).source - ].join('|') + '|$', 'g'); - - // Compile the template source, escaping string literals appropriately. - var index = 0; - var source = "__p+='"; - text.replace(matcher, function(match, escape, interpolate, evaluate, offset) { - source += text.slice(index, offset).replace(escapeRegExp, escapeChar); - index = offset + match.length; - - if (escape) { - source += "'+\n((__t=(" + escape + "))==null?'':_.escape(__t))+\n'"; - } else if (interpolate) { - source += "'+\n((__t=(" + interpolate + "))==null?'':__t)+\n'"; - } else if (evaluate) { - source += "';\n" + evaluate + "\n__p+='"; - } - - // Adobe VMs need the match returned to produce the correct offset. - return match; - }); - source += "';\n"; - - var argument = settings.variable; - if (argument) { - // Insure against third-party code injection. (CVE-2021-23358) - if (!bareIdentifier.test(argument)) throw new Error( - 'variable is not a bare identifier: ' + argument - ); - } else { - // If a variable is not specified, place data values in local scope. - source = 'with(obj||{}){\n' + source + '}\n'; - argument = 'obj'; - } - - source = "var __t,__p='',__j=Array.prototype.join," + - "print=function(){__p+=__j.call(arguments,'');};\n" + - source + 'return __p;\n'; - - var render; - try { - render = new Function(argument, '_', source); - } catch (e) { - e.source = source; - throw e; - } - - var template = function(data) { - return render.call(this, data, _$1); - }; - - // Provide the compiled source as a convenience for precompilation. - template.source = 'function(' + argument + '){\n' + source + '}'; - - return template; -} - -// Traverses the children of `obj` along `path`. If a child is a function, it -// is invoked with its parent as context. Returns the value of the final -// child, or `fallback` if any child is undefined. -function result(obj, path, fallback) { - path = toPath(path); - var length = path.length; - if (!length) { - return isFunction$1(fallback) ? fallback.call(obj) : fallback; - } - for (var i = 0; i < length; i++) { - var prop = obj == null ? void 0 : obj[path[i]]; - if (prop === void 0) { - prop = fallback; - i = length; // Ensure we don't continue iterating. - } - obj = isFunction$1(prop) ? prop.call(obj) : prop; - } - return obj; -} - -// Generate a unique integer id (unique within the entire client session). -// Useful for temporary DOM ids. -var idCounter = 0; -function uniqueId(prefix) { - var id = ++idCounter + ''; - return prefix ? prefix + id : id; -} - -// Start chaining a wrapped Underscore object. -function chain(obj) { - var instance = _$1(obj); - instance._chain = true; - return instance; -} - -// Internal function to execute `sourceFunc` bound to `context` with optional -// `args`. Determines whether to execute a function as a constructor or as a -// normal function. -function executeBound(sourceFunc, boundFunc, context, callingContext, args) { - if (!(callingContext instanceof boundFunc)) return sourceFunc.apply(context, args); - var self = baseCreate(sourceFunc.prototype); - var result = sourceFunc.apply(self, args); - if (isObject(result)) return result; - return self; -} - -// Partially apply a function by creating a version that has had some of its -// arguments pre-filled, without changing its dynamic `this` context. `_` acts -// as a placeholder by default, allowing any combination of arguments to be -// pre-filled. Set `_.partial.placeholder` for a custom placeholder argument. -var partial = restArguments(function(func, boundArgs) { - var placeholder = partial.placeholder; - var bound = function() { - var position = 0, length = boundArgs.length; - var args = Array(length); - for (var i = 0; i < length; i++) { - args[i] = boundArgs[i] === placeholder ? arguments[position++] : boundArgs[i]; - } - while (position < arguments.length) args.push(arguments[position++]); - return executeBound(func, bound, this, this, args); - }; - return bound; -}); - -partial.placeholder = _$1; - -// Create a function bound to a given object (assigning `this`, and arguments, -// optionally). -var bind = restArguments(function(func, context, args) { - if (!isFunction$1(func)) throw new TypeError('Bind must be called on a function'); - var bound = restArguments(function(callArgs) { - return executeBound(func, bound, context, this, args.concat(callArgs)); - }); - return bound; -}); - -// Internal helper for collection methods to determine whether a collection -// should be iterated as an array or as an object. -// Related: https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength -// Avoids a very nasty iOS 8 JIT bug on ARM-64. #2094 -var isArrayLike = createSizePropertyCheck(getLength); - -// Internal implementation of a recursive `flatten` function. -function flatten$1(input, depth, strict, output) { - output = output || []; - if (!depth && depth !== 0) { - depth = Infinity; - } else if (depth <= 0) { - return output.concat(input); - } - var idx = output.length; - for (var i = 0, length = getLength(input); i < length; i++) { - var value = input[i]; - if (isArrayLike(value) && (isArray(value) || isArguments$1(value))) { - // Flatten current level of array or arguments object. - if (depth > 1) { - flatten$1(value, depth - 1, strict, output); - idx = output.length; - } else { - var j = 0, len = value.length; - while (j < len) output[idx++] = value[j++]; - } - } else if (!strict) { - output[idx++] = value; - } - } - return output; -} - -// Bind a number of an object's methods to that object. Remaining arguments -// are the method names to be bound. Useful for ensuring that all callbacks -// defined on an object belong to it. -var bindAll = restArguments(function(obj, keys) { - keys = flatten$1(keys, false, false); - var index = keys.length; - if (index < 1) throw new Error('bindAll must be passed function names'); - while (index--) { - var key = keys[index]; - obj[key] = bind(obj[key], obj); - } - return obj; -}); - -// Memoize an expensive function by storing its results. -function memoize(func, hasher) { - var memoize = function(key) { - var cache = memoize.cache; - var address = '' + (hasher ? hasher.apply(this, arguments) : key); - if (!has$1(cache, address)) cache[address] = func.apply(this, arguments); - return cache[address]; - }; - memoize.cache = {}; - return memoize; -} - -// Delays a function for the given number of milliseconds, and then calls -// it with the arguments supplied. -var delay = restArguments(function(func, wait, args) { - return setTimeout(function() { - return func.apply(null, args); - }, wait); -}); - -// Defers a function, scheduling it to run after the current call stack has -// cleared. -var defer = partial(delay, _$1, 1); - -// Returns a function, that, when invoked, will only be triggered at most once -// during a given window of time. Normally, the throttled function will run -// as much as it can, without ever going more than once per `wait` duration; -// but if you'd like to disable the execution on the leading edge, pass -// `{leading: false}`. To disable execution on the trailing edge, ditto. -function throttle(func, wait, options) { - var timeout, context, args, result; - var previous = 0; - if (!options) options = {}; - - var later = function() { - previous = options.leading === false ? 0 : now(); - timeout = null; - result = func.apply(context, args); - if (!timeout) context = args = null; - }; - - var throttled = function() { - var _now = now(); - if (!previous && options.leading === false) previous = _now; - var remaining = wait - (_now - previous); - context = this; - args = arguments; - if (remaining <= 0 || remaining > wait) { - if (timeout) { - clearTimeout(timeout); - timeout = null; - } - previous = _now; - result = func.apply(context, args); - if (!timeout) context = args = null; - } else if (!timeout && options.trailing !== false) { - timeout = setTimeout(later, remaining); - } - return result; - }; - - throttled.cancel = function() { - clearTimeout(timeout); - previous = 0; - timeout = context = args = null; - }; - - return throttled; -} - -// When a sequence of calls of the returned function ends, the argument -// function is triggered. The end of a sequence is defined by the `wait` -// parameter. If `immediate` is passed, the argument function will be -// triggered at the beginning of the sequence instead of at the end. -function debounce(func, wait, immediate) { - var timeout, previous, args, result, context; - - var later = function() { - var passed = now() - previous; - if (wait > passed) { - timeout = setTimeout(later, wait - passed); - } else { - timeout = null; - if (!immediate) result = func.apply(context, args); - // This check is needed because `func` can recursively invoke `debounced`. - if (!timeout) args = context = null; - } - }; - - var debounced = restArguments(function(_args) { - context = this; - args = _args; - previous = now(); - if (!timeout) { - timeout = setTimeout(later, wait); - if (immediate) result = func.apply(context, args); - } - return result; - }); - - debounced.cancel = function() { - clearTimeout(timeout); - timeout = args = context = null; - }; - - return debounced; -} - -// Returns the first function passed as an argument to the second, -// allowing you to adjust arguments, run code before and after, and -// conditionally execute the original function. -function wrap(func, wrapper) { - return partial(wrapper, func); -} - -// Returns a negated version of the passed-in predicate. -function negate(predicate) { - return function() { - return !predicate.apply(this, arguments); - }; -} - -// Returns a function that is the composition of a list of functions, each -// consuming the return value of the function that follows. -function compose() { - var args = arguments; - var start = args.length - 1; - return function() { - var i = start; - var result = args[start].apply(this, arguments); - while (i--) result = args[i].call(this, result); - return result; - }; -} - -// Returns a function that will only be executed on and after the Nth call. -function after(times, func) { - return function() { - if (--times < 1) { - return func.apply(this, arguments); - } - }; -} - -// Returns a function that will only be executed up to (but not including) the -// Nth call. -function before(times, func) { - var memo; - return function() { - if (--times > 0) { - memo = func.apply(this, arguments); - } - if (times <= 1) func = null; - return memo; - }; -} - -// Returns a function that will be executed at most one time, no matter how -// often you call it. Useful for lazy initialization. -var once = partial(before, 2); - -// Returns the first key on an object that passes a truth test. -function findKey(obj, predicate, context) { - predicate = cb(predicate, context); - var _keys = keys(obj), key; - for (var i = 0, length = _keys.length; i < length; i++) { - key = _keys[i]; - if (predicate(obj[key], key, obj)) return key; - } -} - -// Internal function to generate `_.findIndex` and `_.findLastIndex`. -function createPredicateIndexFinder(dir) { - return function(array, predicate, context) { - predicate = cb(predicate, context); - var length = getLength(array); - var index = dir > 0 ? 0 : length - 1; - for (; index >= 0 && index < length; index += dir) { - if (predicate(array[index], index, array)) return index; - } - return -1; - }; -} - -// Returns the first index on an array-like that passes a truth test. -var findIndex = createPredicateIndexFinder(1); - -// Returns the last index on an array-like that passes a truth test. -var findLastIndex = createPredicateIndexFinder(-1); - -// Use a comparator function to figure out the smallest index at which -// an object should be inserted so as to maintain order. Uses binary search. -function sortedIndex(array, obj, iteratee, context) { - iteratee = cb(iteratee, context, 1); - var value = iteratee(obj); - var low = 0, high = getLength(array); - while (low < high) { - var mid = Math.floor((low + high) / 2); - if (iteratee(array[mid]) < value) low = mid + 1; else high = mid; - } - return low; -} - -// Internal function to generate the `_.indexOf` and `_.lastIndexOf` functions. -function createIndexFinder(dir, predicateFind, sortedIndex) { - return function(array, item, idx) { - var i = 0, length = getLength(array); - if (typeof idx == 'number') { - if (dir > 0) { - i = idx >= 0 ? idx : Math.max(idx + length, i); - } else { - length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1; - } - } else if (sortedIndex && idx && length) { - idx = sortedIndex(array, item); - return array[idx] === item ? idx : -1; - } - if (item !== item) { - idx = predicateFind(slice.call(array, i, length), isNaN$1); - return idx >= 0 ? idx + i : -1; - } - for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) { - if (array[idx] === item) return idx; - } - return -1; - }; -} - -// Return the position of the first occurrence of an item in an array, -// or -1 if the item is not included in the array. -// If the array is large and already in sort order, pass `true` -// for **isSorted** to use binary search. -var indexOf = createIndexFinder(1, findIndex, sortedIndex); - -// Return the position of the last occurrence of an item in an array, -// or -1 if the item is not included in the array. -var lastIndexOf = createIndexFinder(-1, findLastIndex); - -// Return the first value which passes a truth test. -function find(obj, predicate, context) { - var keyFinder = isArrayLike(obj) ? findIndex : findKey; - var key = keyFinder(obj, predicate, context); - if (key !== void 0 && key !== -1) return obj[key]; -} - -// Convenience version of a common use case of `_.find`: getting the first -// object containing specific `key:value` pairs. -function findWhere(obj, attrs) { - return find(obj, matcher(attrs)); -} - -// The cornerstone for collection functions, an `each` -// implementation, aka `forEach`. -// Handles raw objects in addition to array-likes. Treats all -// sparse array-likes as if they were dense. -function each(obj, iteratee, context) { - iteratee = optimizeCb(iteratee, context); - var i, length; - if (isArrayLike(obj)) { - for (i = 0, length = obj.length; i < length; i++) { - iteratee(obj[i], i, obj); - } - } else { - var _keys = keys(obj); - for (i = 0, length = _keys.length; i < length; i++) { - iteratee(obj[_keys[i]], _keys[i], obj); - } - } - return obj; -} - -// Return the results of applying the iteratee to each element. -function map(obj, iteratee, context) { - iteratee = cb(iteratee, context); - var _keys = !isArrayLike(obj) && keys(obj), - length = (_keys || obj).length, - results = Array(length); - for (var index = 0; index < length; index++) { - var currentKey = _keys ? _keys[index] : index; - results[index] = iteratee(obj[currentKey], currentKey, obj); - } - return results; -} - -// Internal helper to create a reducing function, iterating left or right. -function createReduce(dir) { - // Wrap code that reassigns argument variables in a separate function than - // the one that accesses `arguments.length` to avoid a perf hit. (#1991) - var reducer = function(obj, iteratee, memo, initial) { - var _keys = !isArrayLike(obj) && keys(obj), - length = (_keys || obj).length, - index = dir > 0 ? 0 : length - 1; - if (!initial) { - memo = obj[_keys ? _keys[index] : index]; - index += dir; - } - for (; index >= 0 && index < length; index += dir) { - var currentKey = _keys ? _keys[index] : index; - memo = iteratee(memo, obj[currentKey], currentKey, obj); - } - return memo; - }; - - return function(obj, iteratee, memo, context) { - var initial = arguments.length >= 3; - return reducer(obj, optimizeCb(iteratee, context, 4), memo, initial); - }; -} - -// **Reduce** builds up a single result from a list of values, aka `inject`, -// or `foldl`. -var reduce = createReduce(1); - -// The right-associative version of reduce, also known as `foldr`. -var reduceRight = createReduce(-1); - -// Return all the elements that pass a truth test. -function filter(obj, predicate, context) { - var results = []; - predicate = cb(predicate, context); - each(obj, function(value, index, list) { - if (predicate(value, index, list)) results.push(value); - }); - return results; -} - -// Return all the elements for which a truth test fails. -function reject(obj, predicate, context) { - return filter(obj, negate(cb(predicate)), context); -} - -// Determine whether all of the elements pass a truth test. -function every(obj, predicate, context) { - predicate = cb(predicate, context); - var _keys = !isArrayLike(obj) && keys(obj), - length = (_keys || obj).length; - for (var index = 0; index < length; index++) { - var currentKey = _keys ? _keys[index] : index; - if (!predicate(obj[currentKey], currentKey, obj)) return false; - } - return true; -} - -// Determine if at least one element in the object passes a truth test. -function some(obj, predicate, context) { - predicate = cb(predicate, context); - var _keys = !isArrayLike(obj) && keys(obj), - length = (_keys || obj).length; - for (var index = 0; index < length; index++) { - var currentKey = _keys ? _keys[index] : index; - if (predicate(obj[currentKey], currentKey, obj)) return true; - } - return false; -} - -// Determine if the array or object contains a given item (using `===`). -function contains(obj, item, fromIndex, guard) { - if (!isArrayLike(obj)) obj = values(obj); - if (typeof fromIndex != 'number' || guard) fromIndex = 0; - return indexOf(obj, item, fromIndex) >= 0; -} - -// Invoke a method (with arguments) on every item in a collection. -var invoke = restArguments(function(obj, path, args) { - var contextPath, func; - if (isFunction$1(path)) { - func = path; - } else { - path = toPath(path); - contextPath = path.slice(0, -1); - path = path[path.length - 1]; - } - return map(obj, function(context) { - var method = func; - if (!method) { - if (contextPath && contextPath.length) { - context = deepGet(context, contextPath); - } - if (context == null) return void 0; - method = context[path]; - } - return method == null ? method : method.apply(context, args); - }); -}); - -// Convenience version of a common use case of `_.map`: fetching a property. -function pluck(obj, key) { - return map(obj, property(key)); -} - -// Convenience version of a common use case of `_.filter`: selecting only -// objects containing specific `key:value` pairs. -function where(obj, attrs) { - return filter(obj, matcher(attrs)); -} - -// Return the maximum element (or element-based computation). -function max(obj, iteratee, context) { - var result = -Infinity, lastComputed = -Infinity, - value, computed; - if (iteratee == null || (typeof iteratee == 'number' && typeof obj[0] != 'object' && obj != null)) { - obj = isArrayLike(obj) ? obj : values(obj); - for (var i = 0, length = obj.length; i < length; i++) { - value = obj[i]; - if (value != null && value > result) { - result = value; - } - } - } else { - iteratee = cb(iteratee, context); - each(obj, function(v, index, list) { - computed = iteratee(v, index, list); - if (computed > lastComputed || (computed === -Infinity && result === -Infinity)) { - result = v; - lastComputed = computed; - } - }); - } - return result; -} - -// Return the minimum element (or element-based computation). -function min(obj, iteratee, context) { - var result = Infinity, lastComputed = Infinity, - value, computed; - if (iteratee == null || (typeof iteratee == 'number' && typeof obj[0] != 'object' && obj != null)) { - obj = isArrayLike(obj) ? obj : values(obj); - for (var i = 0, length = obj.length; i < length; i++) { - value = obj[i]; - if (value != null && value < result) { - result = value; - } - } - } else { - iteratee = cb(iteratee, context); - each(obj, function(v, index, list) { - computed = iteratee(v, index, list); - if (computed < lastComputed || (computed === Infinity && result === Infinity)) { - result = v; - lastComputed = computed; - } - }); - } - return result; -} - -// Safely create a real, live array from anything iterable. -var reStrSymbol = /[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g; -function toArray(obj) { - if (!obj) return []; - if (isArray(obj)) return slice.call(obj); - if (isString(obj)) { - // Keep surrogate pair characters together. - return obj.match(reStrSymbol); - } - if (isArrayLike(obj)) return map(obj, identity); - return values(obj); -} - -// Sample **n** random values from a collection using the modern version of the -// [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher–Yates_shuffle). -// If **n** is not specified, returns a single random element. -// The internal `guard` argument allows it to work with `_.map`. -function sample(obj, n, guard) { - if (n == null || guard) { - if (!isArrayLike(obj)) obj = values(obj); - return obj[random(obj.length - 1)]; - } - var sample = toArray(obj); - var length = getLength(sample); - n = Math.max(Math.min(n, length), 0); - var last = length - 1; - for (var index = 0; index < n; index++) { - var rand = random(index, last); - var temp = sample[index]; - sample[index] = sample[rand]; - sample[rand] = temp; - } - return sample.slice(0, n); -} - -// Shuffle a collection. -function shuffle(obj) { - return sample(obj, Infinity); -} - -// Sort the object's values by a criterion produced by an iteratee. -function sortBy(obj, iteratee, context) { - var index = 0; - iteratee = cb(iteratee, context); - return pluck(map(obj, function(value, key, list) { - return { - value: value, - index: index++, - criteria: iteratee(value, key, list) - }; - }).sort(function(left, right) { - var a = left.criteria; - var b = right.criteria; - if (a !== b) { - if (a > b || a === void 0) return 1; - if (a < b || b === void 0) return -1; - } - return left.index - right.index; - }), 'value'); -} - -// An internal function used for aggregate "group by" operations. -function group(behavior, partition) { - return function(obj, iteratee, context) { - var result = partition ? [[], []] : {}; - iteratee = cb(iteratee, context); - each(obj, function(value, index) { - var key = iteratee(value, index, obj); - behavior(result, value, key); - }); - return result; - }; -} - -// Groups the object's values by a criterion. Pass either a string attribute -// to group by, or a function that returns the criterion. -var groupBy = group(function(result, value, key) { - if (has$1(result, key)) result[key].push(value); else result[key] = [value]; -}); - -// Indexes the object's values by a criterion, similar to `_.groupBy`, but for -// when you know that your index values will be unique. -var indexBy = group(function(result, value, key) { - result[key] = value; -}); - -// Counts instances of an object that group by a certain criterion. Pass -// either a string attribute to count by, or a function that returns the -// criterion. -var countBy = group(function(result, value, key) { - if (has$1(result, key)) result[key]++; else result[key] = 1; -}); - -// Split a collection into two arrays: one whose elements all pass the given -// truth test, and one whose elements all do not pass the truth test. -var partition = group(function(result, value, pass) { - result[pass ? 0 : 1].push(value); -}, true); - -// Return the number of elements in a collection. -function size(obj) { - if (obj == null) return 0; - return isArrayLike(obj) ? obj.length : keys(obj).length; -} - -// Internal `_.pick` helper function to determine whether `key` is an enumerable -// property name of `obj`. -function keyInObj(value, key, obj) { - return key in obj; -} - -// Return a copy of the object only containing the allowed properties. -var pick = restArguments(function(obj, keys) { - var result = {}, iteratee = keys[0]; - if (obj == null) return result; - if (isFunction$1(iteratee)) { - if (keys.length > 1) iteratee = optimizeCb(iteratee, keys[1]); - keys = allKeys(obj); - } else { - iteratee = keyInObj; - keys = flatten$1(keys, false, false); - obj = Object(obj); - } - for (var i = 0, length = keys.length; i < length; i++) { - var key = keys[i]; - var value = obj[key]; - if (iteratee(value, key, obj)) result[key] = value; - } - return result; -}); - -// Return a copy of the object without the disallowed properties. -var omit = restArguments(function(obj, keys) { - var iteratee = keys[0], context; - if (isFunction$1(iteratee)) { - iteratee = negate(iteratee); - if (keys.length > 1) context = keys[1]; - } else { - keys = map(flatten$1(keys, false, false), String); - iteratee = function(value, key) { - return !contains(keys, key); - }; - } - return pick(obj, iteratee, context); -}); - -// Returns everything but the last entry of the array. Especially useful on -// the arguments object. Passing **n** will return all the values in -// the array, excluding the last N. -function initial(array, n, guard) { - return slice.call(array, 0, Math.max(0, array.length - (n == null || guard ? 1 : n))); -} - -// Get the first element of an array. Passing **n** will return the first N -// values in the array. The **guard** check allows it to work with `_.map`. -function first(array, n, guard) { - if (array == null || array.length < 1) return n == null || guard ? void 0 : []; - if (n == null || guard) return array[0]; - return initial(array, array.length - n); -} - -// Returns everything but the first entry of the `array`. Especially useful on -// the `arguments` object. Passing an **n** will return the rest N values in the -// `array`. -function rest(array, n, guard) { - return slice.call(array, n == null || guard ? 1 : n); -} - -// Get the last element of an array. Passing **n** will return the last N -// values in the array. -function last(array, n, guard) { - if (array == null || array.length < 1) return n == null || guard ? void 0 : []; - if (n == null || guard) return array[array.length - 1]; - return rest(array, Math.max(0, array.length - n)); -} - -// Trim out all falsy values from an array. -function compact(array) { - return filter(array, Boolean); -} - -// Flatten out an array, either recursively (by default), or up to `depth`. -// Passing `true` or `false` as `depth` means `1` or `Infinity`, respectively. -function flatten(array, depth) { - return flatten$1(array, depth, false); -} - -// Take the difference between one array and a number of other arrays. -// Only the elements present in just the first array will remain. -var difference = restArguments(function(array, rest) { - rest = flatten$1(rest, true, true); - return filter(array, function(value){ - return !contains(rest, value); - }); -}); - -// Return a version of the array that does not contain the specified value(s). -var without = restArguments(function(array, otherArrays) { - return difference(array, otherArrays); -}); - -// Produce a duplicate-free version of the array. If the array has already -// been sorted, you have the option of using a faster algorithm. -// The faster algorithm will not work with an iteratee if the iteratee -// is not a one-to-one function, so providing an iteratee will disable -// the faster algorithm. -function uniq(array, isSorted, iteratee, context) { - if (!isBoolean(isSorted)) { - context = iteratee; - iteratee = isSorted; - isSorted = false; - } - if (iteratee != null) iteratee = cb(iteratee, context); - var result = []; - var seen = []; - for (var i = 0, length = getLength(array); i < length; i++) { - var value = array[i], - computed = iteratee ? iteratee(value, i, array) : value; - if (isSorted && !iteratee) { - if (!i || seen !== computed) result.push(value); - seen = computed; - } else if (iteratee) { - if (!contains(seen, computed)) { - seen.push(computed); - result.push(value); - } - } else if (!contains(result, value)) { - result.push(value); - } - } - return result; -} - -// Produce an array that contains the union: each distinct element from all of -// the passed-in arrays. -var union = restArguments(function(arrays) { - return uniq(flatten$1(arrays, true, true)); -}); - -// Produce an array that contains every item shared between all the -// passed-in arrays. -function intersection(array) { - var result = []; - var argsLength = arguments.length; - for (var i = 0, length = getLength(array); i < length; i++) { - var item = array[i]; - if (contains(result, item)) continue; - var j; - for (j = 1; j < argsLength; j++) { - if (!contains(arguments[j], item)) break; - } - if (j === argsLength) result.push(item); - } - return result; -} - -// Complement of zip. Unzip accepts an array of arrays and groups -// each array's elements on shared indices. -function unzip(array) { - var length = (array && max(array, getLength).length) || 0; - var result = Array(length); - - for (var index = 0; index < length; index++) { - result[index] = pluck(array, index); - } - return result; -} - -// Zip together multiple lists into a single array -- elements that share -// an index go together. -var zip = restArguments(unzip); - -// Converts lists into objects. Pass either a single array of `[key, value]` -// pairs, or two parallel arrays of the same length -- one of keys, and one of -// the corresponding values. Passing by pairs is the reverse of `_.pairs`. -function object(list, values) { - var result = {}; - for (var i = 0, length = getLength(list); i < length; i++) { - if (values) { - result[list[i]] = values[i]; - } else { - result[list[i][0]] = list[i][1]; - } - } - return result; -} - -// Generate an integer Array containing an arithmetic progression. A port of -// the native Python `range()` function. See -// [the Python documentation](https://docs.python.org/library/functions.html#range). -function range(start, stop, step) { - if (stop == null) { - stop = start || 0; - start = 0; - } - if (!step) { - step = stop < start ? -1 : 1; - } - - var length = Math.max(Math.ceil((stop - start) / step), 0); - var range = Array(length); - - for (var idx = 0; idx < length; idx++, start += step) { - range[idx] = start; - } - - return range; -} - -// Chunk a single array into multiple arrays, each containing `count` or fewer -// items. -function chunk(array, count) { - if (count == null || count < 1) return []; - var result = []; - var i = 0, length = array.length; - while (i < length) { - result.push(slice.call(array, i, i += count)); - } - return result; -} - -// Helper function to continue chaining intermediate results. -function chainResult(instance, obj) { - return instance._chain ? _$1(obj).chain() : obj; -} - -// Add your own custom functions to the Underscore object. -function mixin(obj) { - each(functions(obj), function(name) { - var func = _$1[name] = obj[name]; - _$1.prototype[name] = function() { - var args = [this._wrapped]; - push.apply(args, arguments); - return chainResult(this, func.apply(_$1, args)); - }; - }); - return _$1; -} - -// Add all mutator `Array` functions to the wrapper. -each(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(name) { - var method = ArrayProto[name]; - _$1.prototype[name] = function() { - var obj = this._wrapped; - if (obj != null) { - method.apply(obj, arguments); - if ((name === 'shift' || name === 'splice') && obj.length === 0) { - delete obj[0]; - } - } - return chainResult(this, obj); - }; -}); - -// Add all accessor `Array` functions to the wrapper. -each(['concat', 'join', 'slice'], function(name) { - var method = ArrayProto[name]; - _$1.prototype[name] = function() { - var obj = this._wrapped; - if (obj != null) obj = method.apply(obj, arguments); - return chainResult(this, obj); - }; -}); - -// Named Exports - -var allExports = { - __proto__: null, - VERSION: VERSION, - restArguments: restArguments, - isObject: isObject, - isNull: isNull, - isUndefined: isUndefined, - isBoolean: isBoolean, - isElement: isElement, - isString: isString, - isNumber: isNumber, - isDate: isDate, - isRegExp: isRegExp, - isError: isError, - isSymbol: isSymbol, - isArrayBuffer: isArrayBuffer, - isDataView: isDataView$1, - isArray: isArray, - isFunction: isFunction$1, - isArguments: isArguments$1, - isFinite: isFinite$1, - isNaN: isNaN$1, - isTypedArray: isTypedArray$1, - isEmpty: isEmpty, - isMatch: isMatch, - isEqual: isEqual, - isMap: isMap, - isWeakMap: isWeakMap, - isSet: isSet, - isWeakSet: isWeakSet, - keys: keys, - allKeys: allKeys, - values: values, - pairs: pairs, - invert: invert, - functions: functions, - methods: functions, - extend: extend, - extendOwn: extendOwn, - assign: extendOwn, - defaults: defaults, - create: create, - clone: clone, - tap: tap, - get: get, - has: has, - mapObject: mapObject, - identity: identity, - constant: constant, - noop: noop, - toPath: toPath$1, - property: property, - propertyOf: propertyOf, - matcher: matcher, - matches: matcher, - times: times, - random: random, - now: now, - escape: _escape, - unescape: _unescape, - templateSettings: templateSettings, - template: template, - result: result, - uniqueId: uniqueId, - chain: chain, - iteratee: iteratee, - partial: partial, - bind: bind, - bindAll: bindAll, - memoize: memoize, - delay: delay, - defer: defer, - throttle: throttle, - debounce: debounce, - wrap: wrap, - negate: negate, - compose: compose, - after: after, - before: before, - once: once, - findKey: findKey, - findIndex: findIndex, - findLastIndex: findLastIndex, - sortedIndex: sortedIndex, - indexOf: indexOf, - lastIndexOf: lastIndexOf, - find: find, - detect: find, - findWhere: findWhere, - each: each, - forEach: each, - map: map, - collect: map, - reduce: reduce, - foldl: reduce, - inject: reduce, - reduceRight: reduceRight, - foldr: reduceRight, - filter: filter, - select: filter, - reject: reject, - every: every, - all: every, - some: some, - any: some, - contains: contains, - includes: contains, - include: contains, - invoke: invoke, - pluck: pluck, - where: where, - max: max, - min: min, - shuffle: shuffle, - sample: sample, - sortBy: sortBy, - groupBy: groupBy, - indexBy: indexBy, - countBy: countBy, - partition: partition, - toArray: toArray, - size: size, - pick: pick, - omit: omit, - first: first, - head: first, - take: first, - initial: initial, - last: last, - rest: rest, - tail: rest, - drop: rest, - compact: compact, - flatten: flatten, - without: without, - uniq: uniq, - unique: uniq, - union: union, - intersection: intersection, - difference: difference, - unzip: unzip, - transpose: unzip, - zip: zip, - object: object, - range: range, - chunk: chunk, - mixin: mixin, - 'default': _$1 -}; - -// Default Export - -// Add all of the Underscore functions to the wrapper object. -var _ = mixin(allExports); -// Legacy Node.js API. -_._ = _; - -exports.VERSION = VERSION; -exports._ = _; -exports._escape = _escape; -exports._unescape = _unescape; -exports.after = after; -exports.allKeys = allKeys; -exports.before = before; -exports.bind = bind; -exports.bindAll = bindAll; -exports.chain = chain; -exports.chunk = chunk; -exports.clone = clone; -exports.compact = compact; -exports.compose = compose; -exports.constant = constant; -exports.contains = contains; -exports.countBy = countBy; -exports.create = create; -exports.debounce = debounce; -exports.defaults = defaults; -exports.defer = defer; -exports.delay = delay; -exports.difference = difference; -exports.each = each; -exports.every = every; -exports.extend = extend; -exports.extendOwn = extendOwn; -exports.filter = filter; -exports.find = find; -exports.findIndex = findIndex; -exports.findKey = findKey; -exports.findLastIndex = findLastIndex; -exports.findWhere = findWhere; -exports.first = first; -exports.flatten = flatten; -exports.functions = functions; -exports.get = get; -exports.groupBy = groupBy; -exports.has = has; -exports.identity = identity; -exports.indexBy = indexBy; -exports.indexOf = indexOf; -exports.initial = initial; -exports.intersection = intersection; -exports.invert = invert; -exports.invoke = invoke; -exports.isArguments = isArguments$1; -exports.isArray = isArray; -exports.isArrayBuffer = isArrayBuffer; -exports.isBoolean = isBoolean; -exports.isDataView = isDataView$1; -exports.isDate = isDate; -exports.isElement = isElement; -exports.isEmpty = isEmpty; -exports.isEqual = isEqual; -exports.isError = isError; -exports.isFinite = isFinite$1; -exports.isFunction = isFunction$1; -exports.isMap = isMap; -exports.isMatch = isMatch; -exports.isNaN = isNaN$1; -exports.isNull = isNull; -exports.isNumber = isNumber; -exports.isObject = isObject; -exports.isRegExp = isRegExp; -exports.isSet = isSet; -exports.isString = isString; -exports.isSymbol = isSymbol; -exports.isTypedArray = isTypedArray$1; -exports.isUndefined = isUndefined; -exports.isWeakMap = isWeakMap; -exports.isWeakSet = isWeakSet; -exports.iteratee = iteratee; -exports.keys = keys; -exports.last = last; -exports.lastIndexOf = lastIndexOf; -exports.map = map; -exports.mapObject = mapObject; -exports.matcher = matcher; -exports.max = max; -exports.memoize = memoize; -exports.min = min; -exports.mixin = mixin; -exports.negate = negate; -exports.noop = noop; -exports.now = now; -exports.object = object; -exports.omit = omit; -exports.once = once; -exports.pairs = pairs; -exports.partial = partial; -exports.partition = partition; -exports.pick = pick; -exports.pluck = pluck; -exports.property = property; -exports.propertyOf = propertyOf; -exports.random = random; -exports.range = range; -exports.reduce = reduce; -exports.reduceRight = reduceRight; -exports.reject = reject; -exports.rest = rest; -exports.restArguments = restArguments; -exports.result = result; -exports.sample = sample; -exports.shuffle = shuffle; -exports.size = size; -exports.some = some; -exports.sortBy = sortBy; -exports.sortedIndex = sortedIndex; -exports.tap = tap; -exports.template = template; -exports.templateSettings = templateSettings; -exports.throttle = throttle; -exports.times = times; -exports.toArray = toArray; -exports.toPath = toPath$1; -exports.union = union; -exports.uniq = uniq; -exports.uniqueId = uniqueId; -exports.unzip = unzip; -exports.values = values; -exports.where = where; -exports.without = without; -exports.wrap = wrap; -exports.zip = zip; -//# sourceMappingURL=underscore-node-f.cjs.map diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/underscore-node-f.cjs.map b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/underscore-node-f.cjs.map deleted file mode 100644 index a3ca460f..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/underscore-node-f.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"underscore-node-f.cjs","sources":["underscore-node-f-pre.js"],"sourcesContent":null,"names":[],"mappings":";;;;;;;AAAA;AACG,IAAC,OAAO,GAAG,SAAS;AACvB;AACA;AACA;AACA;AACA,IAAI,IAAI,GAAG,CAAC,OAAO,IAAI,IAAI,QAAQ,IAAI,IAAI,CAAC,IAAI,KAAK,IAAI,IAAI,IAAI;AACjE,WAAW,OAAO,MAAM,IAAI,QAAQ,IAAI,MAAM,CAAC,MAAM,KAAK,MAAM,IAAI,MAAM,CAAC;AAC3E,UAAU,QAAQ,CAAC,aAAa,CAAC,EAAE;AACnC,UAAU,EAAE,CAAC;AACb;AACA;AACA,IAAI,UAAU,GAAG,KAAK,CAAC,SAAS,EAAE,QAAQ,GAAG,MAAM,CAAC,SAAS,CAAC;AAC9D,IAAI,WAAW,GAAG,OAAO,MAAM,KAAK,WAAW,GAAG,MAAM,CAAC,SAAS,GAAG,IAAI,CAAC;AAC1E;AACA;AACA,IAAI,IAAI,GAAG,UAAU,CAAC,IAAI;AAC1B,IAAI,KAAK,GAAG,UAAU,CAAC,KAAK;AAC5B,IAAI,QAAQ,GAAG,QAAQ,CAAC,QAAQ;AAChC,IAAI,cAAc,GAAG,QAAQ,CAAC,cAAc,CAAC;AAC7C;AACA;AACA,IAAI,mBAAmB,GAAG,OAAO,WAAW,KAAK,WAAW;AAC5D,IAAI,gBAAgB,GAAG,OAAO,QAAQ,KAAK,WAAW,CAAC;AACvD;AACA;AACA;AACA,IAAI,aAAa,GAAG,KAAK,CAAC,OAAO;AACjC,IAAI,UAAU,GAAG,MAAM,CAAC,IAAI;AAC5B,IAAI,YAAY,GAAG,MAAM,CAAC,MAAM;AAChC,IAAI,YAAY,GAAG,mBAAmB,IAAI,WAAW,CAAC,MAAM,CAAC;AAC7D;AACA;AACA,IAAI,MAAM,GAAG,KAAK;AAClB,IAAI,SAAS,GAAG,QAAQ,CAAC;AACzB;AACA;AACA,IAAI,UAAU,GAAG,CAAC,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC,oBAAoB,CAAC,UAAU,CAAC,CAAC;AACpE,IAAI,kBAAkB,GAAG,CAAC,SAAS,EAAE,eAAe,EAAE,UAAU;AAChE,EAAE,sBAAsB,EAAE,gBAAgB,EAAE,gBAAgB,CAAC,CAAC;AAC9D;AACA;AACA,IAAI,eAAe,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,aAAa,CAAC,IAAI,EAAE,UAAU,EAAE;AACzC,EAAE,UAAU,GAAG,UAAU,IAAI,IAAI,GAAG,IAAI,CAAC,MAAM,GAAG,CAAC,GAAG,CAAC,UAAU,CAAC;AAClE,EAAE,OAAO,WAAW;AACpB,IAAI,IAAI,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,MAAM,GAAG,UAAU,EAAE,CAAC,CAAC;AAC3D,QAAQ,IAAI,GAAG,KAAK,CAAC,MAAM,CAAC;AAC5B,QAAQ,KAAK,GAAG,CAAC,CAAC;AAClB,IAAI,OAAO,KAAK,GAAG,MAAM,EAAE,KAAK,EAAE,EAAE;AACpC,MAAM,IAAI,CAAC,KAAK,CAAC,GAAG,SAAS,CAAC,KAAK,GAAG,UAAU,CAAC,CAAC;AAClD,KAAK;AACL,IAAI,QAAQ,UAAU;AACtB,MAAM,KAAK,CAAC,EAAE,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;AAC3C,MAAM,KAAK,CAAC,EAAE,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC;AACzD,MAAM,KAAK,CAAC,EAAE,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC;AACvE,KAAK;AACL,IAAI,IAAI,IAAI,GAAG,KAAK,CAAC,UAAU,GAAG,CAAC,CAAC,CAAC;AACrC,IAAI,KAAK,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,UAAU,EAAE,KAAK,EAAE,EAAE;AACjD,MAAM,IAAI,CAAC,KAAK,CAAC,GAAG,SAAS,CAAC,KAAK,CAAC,CAAC;AACrC,KAAK;AACL,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,IAAI,CAAC;AAC5B,IAAI,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;AAClC,GAAG,CAAC;AACJ,CAAC;AACD;AACA;AACA,SAAS,QAAQ,CAAC,GAAG,EAAE;AACvB,EAAE,IAAI,IAAI,GAAG,OAAO,GAAG,CAAC;AACxB,EAAE,OAAO,IAAI,KAAK,UAAU,KAAK,IAAI,KAAK,QAAQ,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;AAC7D,CAAC;AACD;AACA;AACA,SAAS,MAAM,CAAC,GAAG,EAAE;AACrB,EAAE,OAAO,GAAG,KAAK,IAAI,CAAC;AACtB,CAAC;AACD;AACA;AACA,SAAS,WAAW,CAAC,GAAG,EAAE;AAC1B,EAAE,OAAO,GAAG,KAAK,KAAK,CAAC,CAAC;AACxB,CAAC;AACD;AACA;AACA,SAAS,SAAS,CAAC,GAAG,EAAE;AACxB,EAAE,OAAO,GAAG,KAAK,IAAI,IAAI,GAAG,KAAK,KAAK,IAAI,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,kBAAkB,CAAC;AACpF,CAAC;AACD;AACA;AACA,SAAS,SAAS,CAAC,GAAG,EAAE;AACxB,EAAE,OAAO,CAAC,EAAE,GAAG,IAAI,GAAG,CAAC,QAAQ,KAAK,CAAC,CAAC,CAAC;AACvC,CAAC;AACD;AACA;AACA,SAAS,SAAS,CAAC,IAAI,EAAE;AACzB,EAAE,IAAI,GAAG,GAAG,UAAU,GAAG,IAAI,GAAG,GAAG,CAAC;AACpC,EAAE,OAAO,SAAS,GAAG,EAAE;AACvB,IAAI,OAAO,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,GAAG,CAAC;AACtC,GAAG,CAAC;AACJ,CAAC;AACD;AACG,IAAC,QAAQ,GAAG,SAAS,CAAC,QAAQ,EAAE;AACnC;AACG,IAAC,QAAQ,GAAG,SAAS,CAAC,QAAQ,EAAE;AACnC;AACG,IAAC,MAAM,GAAG,SAAS,CAAC,MAAM,EAAE;AAC/B;AACG,IAAC,QAAQ,GAAG,SAAS,CAAC,QAAQ,EAAE;AACnC;AACG,IAAC,OAAO,GAAG,SAAS,CAAC,OAAO,EAAE;AACjC;AACG,IAAC,QAAQ,GAAG,SAAS,CAAC,QAAQ,EAAE;AACnC;AACG,IAAC,aAAa,GAAG,SAAS,CAAC,aAAa,EAAE;AAC7C;AACA,IAAI,UAAU,GAAG,SAAS,CAAC,UAAU,CAAC,CAAC;AACvC;AACA;AACA;AACA,IAAI,QAAQ,GAAG,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC;AACzD,IAAI,OAAO,GAAG,IAAI,UAAU,IAAI,OAAO,SAAS,IAAI,QAAQ,IAAI,OAAO,QAAQ,IAAI,UAAU,EAAE;AAC/F,EAAE,UAAU,GAAG,SAAS,GAAG,EAAE;AAC7B,IAAI,OAAO,OAAO,GAAG,IAAI,UAAU,IAAI,KAAK,CAAC;AAC7C,GAAG,CAAC;AACJ,CAAC;AACD;AACG,IAAC,YAAY,GAAG,WAAW;AAC9B;AACA,IAAI,YAAY,GAAG,SAAS,CAAC,QAAQ,CAAC,CAAC;AACvC;AACA;AACA;AACA;AACA,IAAI,eAAe;AACnB,MAAM,gBAAgB,IAAI,YAAY,CAAC,IAAI,QAAQ,CAAC,IAAI,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC;AACxE,KAAK;AACL,IAAI,MAAM,IAAI,OAAO,GAAG,KAAK,WAAW,IAAI,YAAY,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC;AACnE;AACA,IAAI,UAAU,GAAG,SAAS,CAAC,UAAU,CAAC,CAAC;AACvC;AACA;AACA;AACA,SAAS,cAAc,CAAC,GAAG,EAAE;AAC7B,EAAE,OAAO,GAAG,IAAI,IAAI,IAAI,YAAY,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,aAAa,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AAC/E,CAAC;AACD;AACG,IAAC,YAAY,IAAI,eAAe,GAAG,cAAc,GAAG,UAAU,EAAE;AACnE;AACA;AACA;AACG,IAAC,OAAO,GAAG,aAAa,IAAI,SAAS,CAAC,OAAO,EAAE;AAClD;AACA;AACA,SAAS,KAAK,CAAC,GAAG,EAAE,GAAG,EAAE;AACzB,EAAE,OAAO,GAAG,IAAI,IAAI,IAAI,cAAc,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;AACtD,CAAC;AACD;AACA,IAAI,WAAW,GAAG,SAAS,CAAC,WAAW,CAAC,CAAC;AACzC;AACA;AACA;AACA,CAAC,WAAW;AACZ,EAAE,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,EAAE;AAC/B,IAAI,WAAW,GAAG,SAAS,GAAG,EAAE;AAChC,MAAM,OAAO,KAAK,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;AAClC,KAAK,CAAC;AACN,GAAG;AACH,CAAC,EAAE,EAAE;AACL;AACG,IAAC,aAAa,GAAG,YAAY;AAChC;AACA;AACA,SAAS,UAAU,CAAC,GAAG,EAAE;AACzB,EAAE,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC;AACrE,CAAC;AACD;AACA;AACA,SAAS,OAAO,CAAC,GAAG,EAAE;AACtB,EAAE,OAAO,QAAQ,CAAC,GAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC;AACtC,CAAC;AACD;AACA;AACA,SAAS,QAAQ,CAAC,KAAK,EAAE;AACzB,EAAE,OAAO,WAAW;AACpB,IAAI,OAAO,KAAK,CAAC;AACjB,GAAG,CAAC;AACJ,CAAC;AACD;AACA;AACA,SAAS,uBAAuB,CAAC,eAAe,EAAE;AAClD,EAAE,OAAO,SAAS,UAAU,EAAE;AAC9B,IAAI,IAAI,YAAY,GAAG,eAAe,CAAC,UAAU,CAAC,CAAC;AACnD,IAAI,OAAO,OAAO,YAAY,IAAI,QAAQ,IAAI,YAAY,IAAI,CAAC,IAAI,YAAY,IAAI,eAAe,CAAC;AACnG,GAAG;AACH,CAAC;AACD;AACA;AACA,SAAS,eAAe,CAAC,GAAG,EAAE;AAC9B,EAAE,OAAO,SAAS,GAAG,EAAE;AACvB,IAAI,OAAO,GAAG,IAAI,IAAI,GAAG,KAAK,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC;AAC3C,GAAG,CAAC;AACJ,CAAC;AACD;AACA;AACA,IAAI,aAAa,GAAG,eAAe,CAAC,YAAY,CAAC,CAAC;AAClD;AACA;AACA;AACA,IAAI,YAAY,GAAG,uBAAuB,CAAC,aAAa,CAAC,CAAC;AAC1D;AACA;AACA,IAAI,iBAAiB,GAAG,6EAA6E,CAAC;AACtG,SAAS,YAAY,CAAC,GAAG,EAAE;AAC3B;AACA;AACA,EAAE,OAAO,YAAY,IAAI,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC;AAChE,gBAAgB,YAAY,CAAC,GAAG,CAAC,IAAI,iBAAiB,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAChF,CAAC;AACD;AACG,IAAC,cAAc,GAAG,mBAAmB,GAAG,YAAY,GAAG,QAAQ,CAAC,KAAK,EAAE;AAC1E;AACA;AACA,IAAI,SAAS,GAAG,eAAe,CAAC,QAAQ,CAAC,CAAC;AAC1C;AACA;AACA;AACA;AACA;AACA,SAAS,WAAW,CAAC,IAAI,EAAE;AAC3B,EAAE,IAAI,IAAI,GAAG,EAAE,CAAC;AAChB,EAAE,KAAK,IAAI,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;AACpE,EAAE,OAAO;AACT,IAAI,QAAQ,EAAE,SAAS,GAAG,EAAE,EAAE,OAAO,IAAI,CAAC,GAAG,CAAC,KAAK,IAAI,CAAC,EAAE;AAC1D,IAAI,IAAI,EAAE,SAAS,GAAG,EAAE;AACxB,MAAM,IAAI,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC;AACvB,MAAM,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC5B,KAAK;AACL,GAAG,CAAC;AACJ,CAAC;AACD;AACA;AACA;AACA;AACA,SAAS,mBAAmB,CAAC,GAAG,EAAE,IAAI,EAAE;AACxC,EAAE,IAAI,GAAG,WAAW,CAAC,IAAI,CAAC,CAAC;AAC3B,EAAE,IAAI,UAAU,GAAG,kBAAkB,CAAC,MAAM,CAAC;AAC7C,EAAE,IAAI,WAAW,GAAG,GAAG,CAAC,WAAW,CAAC;AACpC,EAAE,IAAI,KAAK,GAAG,CAAC,YAAY,CAAC,WAAW,CAAC,IAAI,WAAW,CAAC,SAAS,KAAK,QAAQ,CAAC;AAC/E;AACA;AACA,EAAE,IAAI,IAAI,GAAG,aAAa,CAAC;AAC3B,EAAE,IAAI,KAAK,CAAC,GAAG,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAChE;AACA,EAAE,OAAO,UAAU,EAAE,EAAE;AACvB,IAAI,IAAI,GAAG,kBAAkB,CAAC,UAAU,CAAC,CAAC;AAC1C,IAAI,IAAI,IAAI,IAAI,GAAG,IAAI,GAAG,CAAC,IAAI,CAAC,KAAK,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE;AAC1E,MAAM,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACtB,KAAK;AACL,GAAG;AACH,CAAC;AACD;AACA;AACA;AACA,SAAS,IAAI,CAAC,GAAG,EAAE;AACnB,EAAE,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,OAAO,EAAE,CAAC;AAChC,EAAE,IAAI,UAAU,EAAE,OAAO,UAAU,CAAC,GAAG,CAAC,CAAC;AACzC,EAAE,IAAI,IAAI,GAAG,EAAE,CAAC;AAChB,EAAE,KAAK,IAAI,GAAG,IAAI,GAAG,EAAE,IAAI,KAAK,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC3D;AACA,EAAE,IAAI,UAAU,EAAE,mBAAmB,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;AACjD,EAAE,OAAO,IAAI,CAAC;AACd,CAAC;AACD;AACA;AACA;AACA,SAAS,OAAO,CAAC,GAAG,EAAE;AACtB,EAAE,IAAI,GAAG,IAAI,IAAI,EAAE,OAAO,IAAI,CAAC;AAC/B;AACA;AACA,EAAE,IAAI,MAAM,GAAG,SAAS,CAAC,GAAG,CAAC,CAAC;AAC9B,EAAE,IAAI,OAAO,MAAM,IAAI,QAAQ;AAC/B,IAAI,OAAO,CAAC,GAAG,CAAC,IAAI,QAAQ,CAAC,GAAG,CAAC,IAAI,aAAa,CAAC,GAAG,CAAC;AACvD,GAAG,EAAE,OAAO,MAAM,KAAK,CAAC,CAAC;AACzB,EAAE,OAAO,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC;AACpC,CAAC;AACD;AACA;AACA,SAAS,OAAO,CAAC,MAAM,EAAE,KAAK,EAAE;AAChC,EAAE,IAAI,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC;AACjD,EAAE,IAAI,MAAM,IAAI,IAAI,EAAE,OAAO,CAAC,MAAM,CAAC;AACrC,EAAE,IAAI,GAAG,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC;AAC3B,EAAE,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,EAAE,CAAC,EAAE,EAAE;AACnC,IAAI,IAAI,GAAG,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;AACvB,IAAI,IAAI,KAAK,CAAC,GAAG,CAAC,KAAK,GAAG,CAAC,GAAG,CAAC,IAAI,EAAE,GAAG,IAAI,GAAG,CAAC,EAAE,OAAO,KAAK,CAAC;AAC/D,GAAG;AACH,EAAE,OAAO,IAAI,CAAC;AACd,CAAC;AACD;AACA;AACA;AACA;AACA,SAAS,GAAG,CAAC,GAAG,EAAE;AAClB,EAAE,IAAI,GAAG,YAAY,GAAG,EAAE,OAAO,GAAG,CAAC;AACrC,EAAE,IAAI,EAAE,IAAI,YAAY,GAAG,CAAC,EAAE,OAAO,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC;AAClD,EAAE,IAAI,CAAC,QAAQ,GAAG,GAAG,CAAC;AACtB,CAAC;AACD;AACA,GAAG,CAAC,OAAO,GAAG,OAAO,CAAC;AACtB;AACA;AACA,GAAG,CAAC,SAAS,CAAC,KAAK,GAAG,WAAW;AACjC,EAAE,OAAO,IAAI,CAAC,QAAQ,CAAC;AACvB,CAAC,CAAC;AACF;AACA;AACA;AACA,GAAG,CAAC,SAAS,CAAC,OAAO,GAAG,GAAG,CAAC,SAAS,CAAC,MAAM,GAAG,GAAG,CAAC,SAAS,CAAC,KAAK,CAAC;AACnE;AACA,GAAG,CAAC,SAAS,CAAC,QAAQ,GAAG,WAAW;AACpC,EAAE,OAAO,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;AAC/B,CAAC,CAAC;AACF;AACA;AACA;AACA,SAAS,YAAY,CAAC,YAAY,EAAE;AACpC,EAAE,OAAO,IAAI,UAAU;AACvB,IAAI,YAAY,CAAC,MAAM,IAAI,YAAY;AACvC,IAAI,YAAY,CAAC,UAAU,IAAI,CAAC;AAChC,IAAI,aAAa,CAAC,YAAY,CAAC;AAC/B,GAAG,CAAC;AACJ,CAAC;AACD;AACA;AACA,IAAI,WAAW,GAAG,mBAAmB,CAAC;AACtC;AACA;AACA,SAAS,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE;AAClC;AACA;AACA,EAAE,IAAI,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;AACjD;AACA,EAAE,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,IAAI,EAAE,OAAO,KAAK,CAAC;AAC3C;AACA,EAAE,IAAI,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC;AAC9B;AACA,EAAE,IAAI,IAAI,GAAG,OAAO,CAAC,CAAC;AACtB,EAAE,IAAI,IAAI,KAAK,UAAU,IAAI,IAAI,KAAK,QAAQ,IAAI,OAAO,CAAC,IAAI,QAAQ,EAAE,OAAO,KAAK,CAAC;AACrF,EAAE,OAAO,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;AACtC,CAAC;AACD;AACA;AACA,SAAS,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE;AACtC;AACA,EAAE,IAAI,CAAC,YAAY,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC;AACvC,EAAE,IAAI,CAAC,YAAY,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC;AACvC;AACA,EAAE,IAAI,SAAS,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACnC,EAAE,IAAI,SAAS,KAAK,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,OAAO,KAAK,CAAC;AACnD;AACA,EAAE,IAAI,eAAe,IAAI,SAAS,IAAI,iBAAiB,IAAI,YAAY,CAAC,CAAC,CAAC,EAAE;AAC5E,IAAI,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,OAAO,KAAK,CAAC;AACvC,IAAI,SAAS,GAAG,WAAW,CAAC;AAC5B,GAAG;AACH,EAAE,QAAQ,SAAS;AACnB;AACA,IAAI,KAAK,iBAAiB,CAAC;AAC3B;AACA,IAAI,KAAK,iBAAiB;AAC1B;AACA;AACA,MAAM,OAAO,EAAE,GAAG,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;AAC/B,IAAI,KAAK,iBAAiB;AAC1B;AACA;AACA,MAAM,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;AACtC;AACA,MAAM,OAAO,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;AACrD,IAAI,KAAK,eAAe,CAAC;AACzB,IAAI,KAAK,kBAAkB;AAC3B;AACA;AACA;AACA,MAAM,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;AACvB,IAAI,KAAK,iBAAiB;AAC1B,MAAM,OAAO,WAAW,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,WAAW,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACzE,IAAI,KAAK,sBAAsB,CAAC;AAChC,IAAI,KAAK,WAAW;AACpB;AACA,MAAM,OAAO,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;AACtE,GAAG;AACH;AACA,EAAE,IAAI,SAAS,GAAG,SAAS,KAAK,gBAAgB,CAAC;AACjD,EAAE,IAAI,CAAC,SAAS,IAAI,cAAc,CAAC,CAAC,CAAC,EAAE;AACvC,MAAM,IAAI,UAAU,GAAG,aAAa,CAAC,CAAC,CAAC,CAAC;AACxC,MAAM,IAAI,UAAU,KAAK,aAAa,CAAC,CAAC,CAAC,EAAE,OAAO,KAAK,CAAC;AACxD,MAAM,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,MAAM,IAAI,CAAC,CAAC,UAAU,KAAK,CAAC,CAAC,UAAU,EAAE,OAAO,IAAI,CAAC;AAC9E,MAAM,SAAS,GAAG,IAAI,CAAC;AACvB,GAAG;AACH,EAAE,IAAI,CAAC,SAAS,EAAE;AAClB,IAAI,IAAI,OAAO,CAAC,IAAI,QAAQ,IAAI,OAAO,CAAC,IAAI,QAAQ,EAAE,OAAO,KAAK,CAAC;AACnE;AACA;AACA;AACA,IAAI,IAAI,KAAK,GAAG,CAAC,CAAC,WAAW,EAAE,KAAK,GAAG,CAAC,CAAC,WAAW,CAAC;AACrD,IAAI,IAAI,KAAK,KAAK,KAAK,IAAI,EAAE,YAAY,CAAC,KAAK,CAAC,IAAI,KAAK,YAAY,KAAK;AAC1E,6BAA6B,YAAY,CAAC,KAAK,CAAC,IAAI,KAAK,YAAY,KAAK,CAAC;AAC3E,4BAA4B,aAAa,IAAI,CAAC,IAAI,aAAa,IAAI,CAAC,CAAC,EAAE;AACvE,MAAM,OAAO,KAAK,CAAC;AACnB,KAAK;AACL,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,EAAE,MAAM,GAAG,MAAM,IAAI,EAAE,CAAC;AACxB,EAAE,MAAM,GAAG,MAAM,IAAI,EAAE,CAAC;AACxB,EAAE,IAAI,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;AAC7B,EAAE,OAAO,MAAM,EAAE,EAAE;AACnB;AACA;AACA,IAAI,IAAI,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,OAAO,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAC1D,GAAG;AACH;AACA;AACA,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACjB,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACjB;AACA;AACA,EAAE,IAAI,SAAS,EAAE;AACjB;AACA,IAAI,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC;AACtB,IAAI,IAAI,MAAM,KAAK,CAAC,CAAC,MAAM,EAAE,OAAO,KAAK,CAAC;AAC1C;AACA,IAAI,OAAO,MAAM,EAAE,EAAE;AACrB,MAAM,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,OAAO,KAAK,CAAC;AAClE,KAAK;AACL,GAAG,MAAM;AACT;AACA,IAAI,IAAI,KAAK,GAAG,IAAI,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC;AAC7B,IAAI,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC;AAC1B;AACA,IAAI,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,KAAK,MAAM,EAAE,OAAO,KAAK,CAAC;AAChD,IAAI,OAAO,MAAM,EAAE,EAAE;AACrB;AACA,MAAM,GAAG,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC;AAC1B,MAAM,IAAI,EAAE,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,EAAE,OAAO,KAAK,CAAC;AAC/E,KAAK;AACL,GAAG;AACH;AACA,EAAE,MAAM,CAAC,GAAG,EAAE,CAAC;AACf,EAAE,MAAM,CAAC,GAAG,EAAE,CAAC;AACf,EAAE,OAAO,IAAI,CAAC;AACd,CAAC;AACD;AACA;AACA,SAAS,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE;AACvB,EAAE,OAAO,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAClB,CAAC;AACD;AACA;AACA,SAAS,OAAO,CAAC,GAAG,EAAE;AACtB,EAAE,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,OAAO,EAAE,CAAC;AAChC,EAAE,IAAI,IAAI,GAAG,EAAE,CAAC;AAChB,EAAE,KAAK,IAAI,GAAG,IAAI,GAAG,EAAE,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACtC;AACA,EAAE,IAAI,UAAU,EAAE,mBAAmB,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;AACjD,EAAE,OAAO,IAAI,CAAC;AACd,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,SAAS,eAAe,CAAC,OAAO,EAAE;AAClC,EAAE,IAAI,MAAM,GAAG,SAAS,CAAC,OAAO,CAAC,CAAC;AAClC,EAAE,OAAO,SAAS,GAAG,EAAE;AACvB,IAAI,IAAI,GAAG,IAAI,IAAI,EAAE,OAAO,KAAK,CAAC;AAClC;AACA,IAAI,IAAI,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;AAC5B,IAAI,IAAI,SAAS,CAAC,IAAI,CAAC,EAAE,OAAO,KAAK,CAAC;AACtC,IAAI,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,EAAE,CAAC,EAAE,EAAE;AACrC,MAAM,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,OAAO,KAAK,CAAC;AACvD,KAAK;AACL;AACA;AACA;AACA,IAAI,OAAO,OAAO,KAAK,cAAc,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC;AACzE,GAAG,CAAC;AACJ,CAAC;AACD;AACA;AACA;AACA,IAAI,WAAW,GAAG,SAAS;AAC3B,IAAI,OAAO,GAAG,KAAK;AACnB,IAAI,UAAU,GAAG,CAAC,OAAO,EAAE,QAAQ,CAAC;AACpC,IAAI,OAAO,GAAG,CAAC,KAAK,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;AACtC;AACA;AACA;AACA,IAAI,UAAU,GAAG,UAAU,CAAC,MAAM,CAAC,WAAW,EAAE,OAAO,CAAC;AACxD,IAAI,cAAc,GAAG,UAAU,CAAC,MAAM,CAAC,OAAO,CAAC;AAC/C,IAAI,UAAU,GAAG,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,UAAU,EAAE,WAAW,EAAE,OAAO,CAAC,CAAC;AAClE;AACG,IAAC,KAAK,GAAG,MAAM,GAAG,eAAe,CAAC,UAAU,CAAC,GAAG,SAAS,CAAC,KAAK,EAAE;AACpE;AACG,IAAC,SAAS,GAAG,MAAM,GAAG,eAAe,CAAC,cAAc,CAAC,GAAG,SAAS,CAAC,SAAS,EAAE;AAChF;AACG,IAAC,KAAK,GAAG,MAAM,GAAG,eAAe,CAAC,UAAU,CAAC,GAAG,SAAS,CAAC,KAAK,EAAE;AACpE;AACG,IAAC,SAAS,GAAG,SAAS,CAAC,SAAS,EAAE;AACrC;AACA;AACA,SAAS,MAAM,CAAC,GAAG,EAAE;AACrB,EAAE,IAAI,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC;AACxB,EAAE,IAAI,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC;AAC5B,EAAE,IAAI,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC;AAC7B,EAAE,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,EAAE,CAAC,EAAE,EAAE;AACnC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;AAC9B,GAAG;AACH,EAAE,OAAO,MAAM,CAAC;AAChB,CAAC;AACD;AACA;AACA;AACA,SAAS,KAAK,CAAC,GAAG,EAAE;AACpB,EAAE,IAAI,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC;AACxB,EAAE,IAAI,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC;AAC5B,EAAE,IAAI,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC;AAC5B,EAAE,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,EAAE,CAAC,EAAE,EAAE;AACnC,IAAI,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACzC,GAAG;AACH,EAAE,OAAO,KAAK,CAAC;AACf,CAAC;AACD;AACA;AACA,SAAS,MAAM,CAAC,GAAG,EAAE;AACrB,EAAE,IAAI,MAAM,GAAG,EAAE,CAAC;AAClB,EAAE,IAAI,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC;AACxB,EAAE,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,GAAG,MAAM,EAAE,CAAC,EAAE,EAAE;AAC1D,IAAI,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;AACrC,GAAG;AACH,EAAE,OAAO,MAAM,CAAC;AAChB,CAAC;AACD;AACA;AACA,SAAS,SAAS,CAAC,GAAG,EAAE;AACxB,EAAE,IAAI,KAAK,GAAG,EAAE,CAAC;AACjB,EAAE,KAAK,IAAI,GAAG,IAAI,GAAG,EAAE;AACvB,IAAI,IAAI,YAAY,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAChD,GAAG;AACH,EAAE,OAAO,KAAK,CAAC,IAAI,EAAE,CAAC;AACtB,CAAC;AACD;AACA;AACA,SAAS,cAAc,CAAC,QAAQ,EAAE,QAAQ,EAAE;AAC5C,EAAE,OAAO,SAAS,GAAG,EAAE;AACvB,IAAI,IAAI,MAAM,GAAG,SAAS,CAAC,MAAM,CAAC;AAClC,IAAI,IAAI,QAAQ,EAAE,GAAG,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;AACpC,IAAI,IAAI,MAAM,GAAG,CAAC,IAAI,GAAG,IAAI,IAAI,EAAE,OAAO,GAAG,CAAC;AAC9C,IAAI,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,MAAM,EAAE,KAAK,EAAE,EAAE;AACjD,MAAM,IAAI,MAAM,GAAG,SAAS,CAAC,KAAK,CAAC;AACnC,UAAU,IAAI,GAAG,QAAQ,CAAC,MAAM,CAAC;AACjC,UAAU,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC;AAC1B,MAAM,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;AAClC,QAAQ,IAAI,GAAG,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;AAC1B,QAAQ,IAAI,CAAC,QAAQ,IAAI,GAAG,CAAC,GAAG,CAAC,KAAK,KAAK,CAAC,EAAE,GAAG,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;AACrE,OAAO;AACP,KAAK;AACL,IAAI,OAAO,GAAG,CAAC;AACf,GAAG,CAAC;AACJ,CAAC;AACD;AACA;AACG,IAAC,MAAM,GAAG,cAAc,CAAC,OAAO,EAAE;AACrC;AACA;AACA;AACA;AACG,IAAC,SAAS,GAAG,cAAc,CAAC,IAAI,EAAE;AACrC;AACA;AACG,IAAC,QAAQ,GAAG,cAAc,CAAC,OAAO,EAAE,IAAI,EAAE;AAC7C;AACA;AACA,SAAS,IAAI,GAAG;AAChB,EAAE,OAAO,UAAU,EAAE,CAAC;AACtB,CAAC;AACD;AACA;AACA,SAAS,UAAU,CAAC,SAAS,EAAE;AAC/B,EAAE,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,EAAE,CAAC;AACtC,EAAE,IAAI,YAAY,EAAE,OAAO,YAAY,CAAC,SAAS,CAAC,CAAC;AACnD,EAAE,IAAI,IAAI,GAAG,IAAI,EAAE,CAAC;AACpB,EAAE,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;AAC7B,EAAE,IAAI,MAAM,GAAG,IAAI,IAAI,CAAC;AACxB,EAAE,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;AACxB,EAAE,OAAO,MAAM,CAAC;AAChB,CAAC;AACD;AACA;AACA;AACA;AACA,SAAS,MAAM,CAAC,SAAS,EAAE,KAAK,EAAE;AAClC,EAAE,IAAI,MAAM,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC;AACrC,EAAE,IAAI,KAAK,EAAE,SAAS,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;AACtC,EAAE,OAAO,MAAM,CAAC;AAChB,CAAC;AACD;AACA;AACA,SAAS,KAAK,CAAC,GAAG,EAAE;AACpB,EAAE,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,OAAO,GAAG,CAAC;AACjC,EAAE,OAAO,OAAO,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC,KAAK,EAAE,GAAG,MAAM,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC;AACtD,CAAC;AACD;AACA;AACA;AACA;AACA,SAAS,GAAG,CAAC,GAAG,EAAE,WAAW,EAAE;AAC/B,EAAE,WAAW,CAAC,GAAG,CAAC,CAAC;AACnB,EAAE,OAAO,GAAG,CAAC;AACb,CAAC;AACD;AACA;AACA;AACA,SAAS,QAAQ,CAAC,IAAI,EAAE;AACxB,EAAE,OAAO,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,GAAG,CAAC,IAAI,CAAC,CAAC;AACvC,CAAC;AACD,GAAG,CAAC,MAAM,GAAG,QAAQ,CAAC;AACtB;AACA;AACA;AACA,SAAS,MAAM,CAAC,IAAI,EAAE;AACtB,EAAE,OAAO,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC;AACD;AACA;AACA,SAAS,OAAO,CAAC,GAAG,EAAE,IAAI,EAAE;AAC5B,EAAE,IAAI,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;AAC3B,EAAE,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,EAAE,CAAC,EAAE,EAAE;AACnC,IAAI,IAAI,GAAG,IAAI,IAAI,EAAE,OAAO,KAAK,CAAC,CAAC;AACnC,IAAI,GAAG,GAAG,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;AACvB,GAAG;AACH,EAAE,OAAO,MAAM,GAAG,GAAG,GAAG,KAAK,CAAC,CAAC;AAC/B,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,SAAS,GAAG,CAAC,MAAM,EAAE,IAAI,EAAE,YAAY,EAAE;AACzC,EAAE,IAAI,KAAK,GAAG,OAAO,CAAC,MAAM,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;AAC5C,EAAE,OAAO,WAAW,CAAC,KAAK,CAAC,GAAG,YAAY,GAAG,KAAK,CAAC;AACnD,CAAC;AACD;AACA;AACA;AACA;AACA,SAAS,GAAG,CAAC,GAAG,EAAE,IAAI,EAAE;AACxB,EAAE,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC;AACtB,EAAE,IAAI,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;AAC3B,EAAE,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,EAAE,CAAC,EAAE,EAAE;AACnC,IAAI,IAAI,GAAG,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;AACtB,IAAI,IAAI,CAAC,KAAK,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,OAAO,KAAK,CAAC;AACvC,IAAI,GAAG,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC;AACnB,GAAG;AACH,EAAE,OAAO,CAAC,CAAC,MAAM,CAAC;AAClB,CAAC;AACD;AACA;AACA,SAAS,QAAQ,CAAC,KAAK,EAAE;AACzB,EAAE,OAAO,KAAK,CAAC;AACf,CAAC;AACD;AACA;AACA;AACA,SAAS,OAAO,CAAC,KAAK,EAAE;AACxB,EAAE,KAAK,GAAG,SAAS,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;AAC/B,EAAE,OAAO,SAAS,GAAG,EAAE;AACvB,IAAI,OAAO,OAAO,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;AAC/B,GAAG,CAAC;AACJ,CAAC;AACD;AACA;AACA;AACA,SAAS,QAAQ,CAAC,IAAI,EAAE;AACxB,EAAE,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC;AACtB,EAAE,OAAO,SAAS,GAAG,EAAE;AACvB,IAAI,OAAO,OAAO,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;AAC9B,GAAG,CAAC;AACJ,CAAC;AACD;AACA;AACA;AACA;AACA,SAAS,UAAU,CAAC,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE;AAC7C,EAAE,IAAI,OAAO,KAAK,KAAK,CAAC,EAAE,OAAO,IAAI,CAAC;AACtC,EAAE,QAAQ,QAAQ,IAAI,IAAI,GAAG,CAAC,GAAG,QAAQ;AACzC,IAAI,KAAK,CAAC,EAAE,OAAO,SAAS,KAAK,EAAE;AACnC,MAAM,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;AACvC,KAAK,CAAC;AACN;AACA,IAAI,KAAK,CAAC,EAAE,OAAO,SAAS,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE;AACtD,MAAM,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,UAAU,CAAC,CAAC;AAC1D,KAAK,CAAC;AACN,IAAI,KAAK,CAAC,EAAE,OAAO,SAAS,WAAW,EAAE,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE;AACnE,MAAM,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,KAAK,EAAE,UAAU,CAAC,CAAC;AACvE,KAAK,CAAC;AACN,GAAG;AACH,EAAE,OAAO,WAAW;AACpB,IAAI,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;AAC1C,GAAG,CAAC;AACJ,CAAC;AACD;AACA;AACA;AACA;AACA,SAAS,YAAY,CAAC,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE;AAChD,EAAE,IAAI,KAAK,IAAI,IAAI,EAAE,OAAO,QAAQ,CAAC;AACrC,EAAE,IAAI,YAAY,CAAC,KAAK,CAAC,EAAE,OAAO,UAAU,CAAC,KAAK,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;AACvE,EAAE,IAAI,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,OAAO,OAAO,CAAC,KAAK,CAAC,CAAC;AAChE,EAAE,OAAO,QAAQ,CAAC,KAAK,CAAC,CAAC;AACzB,CAAC;AACD;AACA;AACA;AACA;AACA,SAAS,QAAQ,CAAC,KAAK,EAAE,OAAO,EAAE;AAClC,EAAE,OAAO,YAAY,CAAC,KAAK,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;AAChD,CAAC;AACD,GAAG,CAAC,QAAQ,GAAG,QAAQ,CAAC;AACxB;AACA;AACA;AACA,SAAS,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE;AACtC,EAAE,IAAI,GAAG,CAAC,QAAQ,KAAK,QAAQ,EAAE,OAAO,GAAG,CAAC,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;AACrE,EAAE,OAAO,YAAY,CAAC,KAAK,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;AAChD,CAAC;AACD;AACA;AACA;AACA,SAAS,SAAS,CAAC,GAAG,EAAE,QAAQ,EAAE,OAAO,EAAE;AAC3C,EAAE,QAAQ,GAAG,EAAE,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;AACnC,EAAE,IAAI,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC;AACvB,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM;AAC3B,MAAM,OAAO,GAAG,EAAE,CAAC;AACnB,EAAE,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,MAAM,EAAE,KAAK,EAAE,EAAE;AAC/C,IAAI,IAAI,UAAU,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC;AAClC,IAAI,OAAO,CAAC,UAAU,CAAC,GAAG,QAAQ,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE,UAAU,EAAE,GAAG,CAAC,CAAC;AACrE,GAAG;AACH,EAAE,OAAO,OAAO,CAAC;AACjB,CAAC;AACD;AACA;AACA,SAAS,IAAI,EAAE,EAAE;AACjB;AACA;AACA,SAAS,UAAU,CAAC,GAAG,EAAE;AACzB,EAAE,IAAI,GAAG,IAAI,IAAI,EAAE,OAAO,IAAI,CAAC;AAC/B,EAAE,OAAO,SAAS,IAAI,EAAE;AACxB,IAAI,OAAO,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;AAC1B,GAAG,CAAC;AACJ,CAAC;AACD;AACA;AACA,SAAS,KAAK,CAAC,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE;AACrC,EAAE,IAAI,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;AACpC,EAAE,QAAQ,GAAG,UAAU,CAAC,QAAQ,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC;AAC9C,EAAE,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;AACrD,EAAE,OAAO,KAAK,CAAC;AACf,CAAC;AACD;AACA;AACA,SAAS,MAAM,CAAC,GAAG,EAAE,GAAG,EAAE;AAC1B,EAAE,IAAI,GAAG,IAAI,IAAI,EAAE;AACnB,IAAI,GAAG,GAAG,GAAG,CAAC;AACd,IAAI,GAAG,GAAG,CAAC,CAAC;AACZ,GAAG;AACH,EAAE,OAAO,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,GAAG,GAAG,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC;AAC3D,CAAC;AACD;AACA;AACG,IAAC,GAAG,GAAG,IAAI,CAAC,GAAG,IAAI,WAAW;AACjC,EAAE,OAAO,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,CAAC;AAC9B,EAAE;AACF;AACA;AACA;AACA,SAAS,aAAa,CAAC,GAAG,EAAE;AAC5B,EAAE,IAAI,OAAO,GAAG,SAAS,KAAK,EAAE;AAChC,IAAI,OAAO,GAAG,CAAC,KAAK,CAAC,CAAC;AACtB,GAAG,CAAC;AACJ;AACA,EAAE,IAAI,MAAM,GAAG,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC;AACjD,EAAE,IAAI,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC;AAClC,EAAE,IAAI,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;AAC1C,EAAE,OAAO,SAAS,MAAM,EAAE;AAC1B,IAAI,MAAM,GAAG,MAAM,IAAI,IAAI,GAAG,EAAE,GAAG,EAAE,GAAG,MAAM,CAAC;AAC/C,IAAI,OAAO,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC,OAAO,CAAC,aAAa,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC;AACrF,GAAG,CAAC;AACJ,CAAC;AACD;AACA;AACA,IAAI,SAAS,GAAG;AAChB,EAAE,GAAG,EAAE,OAAO;AACd,EAAE,GAAG,EAAE,MAAM;AACb,EAAE,GAAG,EAAE,MAAM;AACb,EAAE,GAAG,EAAE,QAAQ;AACf,EAAE,GAAG,EAAE,QAAQ;AACf,EAAE,GAAG,EAAE,QAAQ;AACf,CAAC,CAAC;AACF;AACA;AACG,IAAC,OAAO,GAAG,aAAa,CAAC,SAAS,EAAE;AACvC;AACA;AACA,IAAI,WAAW,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC;AACpC;AACA;AACG,IAAC,SAAS,GAAG,aAAa,CAAC,WAAW,EAAE;AAC3C;AACA;AACA;AACG,IAAC,gBAAgB,GAAG,GAAG,CAAC,gBAAgB,GAAG;AAC9C,EAAE,QAAQ,EAAE,iBAAiB;AAC7B,EAAE,WAAW,EAAE,kBAAkB;AACjC,EAAE,MAAM,EAAE,kBAAkB;AAC5B,EAAE;AACF;AACA;AACA;AACA;AACA,IAAI,OAAO,GAAG,MAAM,CAAC;AACrB;AACA;AACA;AACA,IAAI,OAAO,GAAG;AACd,EAAE,GAAG,EAAE,GAAG;AACV,EAAE,IAAI,EAAE,IAAI;AACZ,EAAE,IAAI,EAAE,GAAG;AACX,EAAE,IAAI,EAAE,GAAG;AACX,EAAE,QAAQ,EAAE,OAAO;AACnB,EAAE,QAAQ,EAAE,OAAO;AACnB,CAAC,CAAC;AACF;AACA,IAAI,YAAY,GAAG,2BAA2B,CAAC;AAC/C;AACA,SAAS,UAAU,CAAC,KAAK,EAAE;AAC3B,EAAE,OAAO,IAAI,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;AAC/B,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,cAAc,GAAG,kBAAkB,CAAC;AACxC;AACA;AACA;AACA;AACA;AACA,SAAS,QAAQ,CAAC,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE;AAC/C,EAAE,IAAI,CAAC,QAAQ,IAAI,WAAW,EAAE,QAAQ,GAAG,WAAW,CAAC;AACvD,EAAE,QAAQ,GAAG,QAAQ,CAAC,EAAE,EAAE,QAAQ,EAAE,GAAG,CAAC,gBAAgB,CAAC,CAAC;AAC1D;AACA;AACA,EAAE,IAAI,OAAO,GAAG,MAAM,CAAC;AACvB,IAAI,CAAC,QAAQ,CAAC,MAAM,IAAI,OAAO,EAAE,MAAM;AACvC,IAAI,CAAC,QAAQ,CAAC,WAAW,IAAI,OAAO,EAAE,MAAM;AAC5C,IAAI,CAAC,QAAQ,CAAC,QAAQ,IAAI,OAAO,EAAE,MAAM;AACzC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,IAAI,EAAE,GAAG,CAAC,CAAC;AAC3B;AACA;AACA,EAAE,IAAI,KAAK,GAAG,CAAC,CAAC;AAChB,EAAE,IAAI,MAAM,GAAG,QAAQ,CAAC;AACxB,EAAE,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,SAAS,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,EAAE;AAC/E,IAAI,MAAM,IAAI,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,OAAO,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC;AAC1E,IAAI,KAAK,GAAG,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC;AAClC;AACA,IAAI,IAAI,MAAM,EAAE;AAChB,MAAM,MAAM,IAAI,aAAa,GAAG,MAAM,GAAG,gCAAgC,CAAC;AAC1E,KAAK,MAAM,IAAI,WAAW,EAAE;AAC5B,MAAM,MAAM,IAAI,aAAa,GAAG,WAAW,GAAG,sBAAsB,CAAC;AACrE,KAAK,MAAM,IAAI,QAAQ,EAAE;AACzB,MAAM,MAAM,IAAI,MAAM,GAAG,QAAQ,GAAG,UAAU,CAAC;AAC/C,KAAK;AACL;AACA;AACA,IAAI,OAAO,KAAK,CAAC;AACjB,GAAG,CAAC,CAAC;AACL,EAAE,MAAM,IAAI,MAAM,CAAC;AACnB;AACA,EAAE,IAAI,QAAQ,GAAG,QAAQ,CAAC,QAAQ,CAAC;AACnC,EAAE,IAAI,QAAQ,EAAE;AAChB;AACA,IAAI,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,MAAM,IAAI,KAAK;AACvD,MAAM,qCAAqC,GAAG,QAAQ;AACtD,KAAK,CAAC;AACN,GAAG,MAAM;AACT;AACA,IAAI,MAAM,GAAG,kBAAkB,GAAG,MAAM,GAAG,KAAK,CAAC;AACjD,IAAI,QAAQ,GAAG,KAAK,CAAC;AACrB,GAAG;AACH;AACA,EAAE,MAAM,GAAG,0CAA0C;AACrD,IAAI,mDAAmD;AACvD,IAAI,MAAM,GAAG,eAAe,CAAC;AAC7B;AACA,EAAE,IAAI,MAAM,CAAC;AACb,EAAE,IAAI;AACN,IAAI,MAAM,GAAG,IAAI,QAAQ,CAAC,QAAQ,EAAE,GAAG,EAAE,MAAM,CAAC,CAAC;AACjD,GAAG,CAAC,OAAO,CAAC,EAAE;AACd,IAAI,CAAC,CAAC,MAAM,GAAG,MAAM,CAAC;AACtB,IAAI,MAAM,CAAC,CAAC;AACZ,GAAG;AACH;AACA,EAAE,IAAI,QAAQ,GAAG,SAAS,IAAI,EAAE;AAChC,IAAI,OAAO,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,CAAC,CAAC;AACxC,GAAG,CAAC;AACJ;AACA;AACA,EAAE,QAAQ,CAAC,MAAM,GAAG,WAAW,GAAG,QAAQ,GAAG,MAAM,GAAG,MAAM,GAAG,GAAG,CAAC;AACnE;AACA,EAAE,OAAO,QAAQ,CAAC;AAClB,CAAC;AACD;AACA;AACA;AACA;AACA,SAAS,MAAM,CAAC,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE;AACrC,EAAE,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC;AACtB,EAAE,IAAI,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;AAC3B,EAAE,IAAI,CAAC,MAAM,EAAE;AACf,IAAI,OAAO,YAAY,CAAC,QAAQ,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,QAAQ,CAAC;AAClE,GAAG;AACH,EAAE,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,EAAE,CAAC,EAAE,EAAE;AACnC,IAAI,IAAI,IAAI,GAAG,GAAG,IAAI,IAAI,GAAG,KAAK,CAAC,GAAG,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;AACnD,IAAI,IAAI,IAAI,KAAK,KAAK,CAAC,EAAE;AACzB,MAAM,IAAI,GAAG,QAAQ,CAAC;AACtB,MAAM,CAAC,GAAG,MAAM,CAAC;AACjB,KAAK;AACL,IAAI,GAAG,GAAG,YAAY,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC;AACrD,GAAG;AACH,EAAE,OAAO,GAAG,CAAC;AACb,CAAC;AACD;AACA;AACA;AACA,IAAI,SAAS,GAAG,CAAC,CAAC;AAClB,SAAS,QAAQ,CAAC,MAAM,EAAE;AAC1B,EAAE,IAAI,EAAE,GAAG,EAAE,SAAS,GAAG,EAAE,CAAC;AAC5B,EAAE,OAAO,MAAM,GAAG,MAAM,GAAG,EAAE,GAAG,EAAE,CAAC;AACnC,CAAC;AACD;AACA;AACA,SAAS,KAAK,CAAC,GAAG,EAAE;AACpB,EAAE,IAAI,QAAQ,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC;AAC1B,EAAE,QAAQ,CAAC,MAAM,GAAG,IAAI,CAAC;AACzB,EAAE,OAAO,QAAQ,CAAC;AAClB,CAAC;AACD;AACA;AACA;AACA;AACA,SAAS,YAAY,CAAC,UAAU,EAAE,SAAS,EAAE,OAAO,EAAE,cAAc,EAAE,IAAI,EAAE;AAC5E,EAAE,IAAI,EAAE,cAAc,YAAY,SAAS,CAAC,EAAE,OAAO,UAAU,CAAC,KAAK,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;AACrF,EAAE,IAAI,IAAI,GAAG,UAAU,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;AAC9C,EAAE,IAAI,MAAM,GAAG,UAAU,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;AAC5C,EAAE,IAAI,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,MAAM,CAAC;AACtC,EAAE,OAAO,IAAI,CAAC;AACd,CAAC;AACD;AACA;AACA;AACA;AACA;AACG,IAAC,OAAO,GAAG,aAAa,CAAC,SAAS,IAAI,EAAE,SAAS,EAAE;AACtD,EAAE,IAAI,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC;AACxC,EAAE,IAAI,KAAK,GAAG,WAAW;AACzB,IAAI,IAAI,QAAQ,GAAG,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC,MAAM,CAAC;AAChD,IAAI,IAAI,IAAI,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC;AAC7B,IAAI,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,EAAE,CAAC,EAAE,EAAE;AACrC,MAAM,IAAI,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC,CAAC,KAAK,WAAW,GAAG,SAAS,CAAC,QAAQ,EAAE,CAAC,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC;AACpF,KAAK;AACL,IAAI,OAAO,QAAQ,GAAG,SAAS,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC;AACzE,IAAI,OAAO,YAAY,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;AACvD,GAAG,CAAC;AACJ,EAAE,OAAO,KAAK,CAAC;AACf,CAAC,EAAE;AACH;AACA,OAAO,CAAC,WAAW,GAAG,GAAG,CAAC;AAC1B;AACA;AACA;AACG,IAAC,IAAI,GAAG,aAAa,CAAC,SAAS,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE;AACvD,EAAE,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,MAAM,IAAI,SAAS,CAAC,mCAAmC,CAAC,CAAC;AACpF,EAAE,IAAI,KAAK,GAAG,aAAa,CAAC,SAAS,QAAQ,EAAE;AAC/C,IAAI,OAAO,YAAY,CAAC,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC;AAC3E,GAAG,CAAC,CAAC;AACL,EAAE,OAAO,KAAK,CAAC;AACf,CAAC,EAAE;AACH;AACA;AACA;AACA;AACA;AACA,IAAI,WAAW,GAAG,uBAAuB,CAAC,SAAS,CAAC,CAAC;AACrD;AACA;AACA,SAAS,SAAS,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE;AACjD,EAAE,MAAM,GAAG,MAAM,IAAI,EAAE,CAAC;AACxB,EAAE,IAAI,CAAC,KAAK,IAAI,KAAK,KAAK,CAAC,EAAE;AAC7B,IAAI,KAAK,GAAG,QAAQ,CAAC;AACrB,GAAG,MAAM,IAAI,KAAK,IAAI,CAAC,EAAE;AACzB,IAAI,OAAO,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAChC,GAAG;AACH,EAAE,IAAI,GAAG,GAAG,MAAM,CAAC,MAAM,CAAC;AAC1B,EAAE,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC,KAAK,CAAC,EAAE,CAAC,GAAG,MAAM,EAAE,CAAC,EAAE,EAAE;AAC9D,IAAI,IAAI,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;AACzB,IAAI,IAAI,WAAW,CAAC,KAAK,CAAC,KAAK,OAAO,CAAC,KAAK,CAAC,IAAI,aAAa,CAAC,KAAK,CAAC,CAAC,EAAE;AACxE;AACA,MAAM,IAAI,KAAK,GAAG,CAAC,EAAE;AACrB,QAAQ,SAAS,CAAC,KAAK,EAAE,KAAK,GAAG,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;AACpD,QAAQ,GAAG,GAAG,MAAM,CAAC,MAAM,CAAC;AAC5B,OAAO,MAAM;AACb,QAAQ,IAAI,CAAC,GAAG,CAAC,EAAE,GAAG,GAAG,KAAK,CAAC,MAAM,CAAC;AACtC,QAAQ,OAAO,CAAC,GAAG,GAAG,EAAE,MAAM,CAAC,GAAG,EAAE,CAAC,GAAG,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC;AACnD,OAAO;AACP,KAAK,MAAM,IAAI,CAAC,MAAM,EAAE;AACxB,MAAM,MAAM,CAAC,GAAG,EAAE,CAAC,GAAG,KAAK,CAAC;AAC5B,KAAK;AACL,GAAG;AACH,EAAE,OAAO,MAAM,CAAC;AAChB,CAAC;AACD;AACA;AACA;AACA;AACG,IAAC,OAAO,GAAG,aAAa,CAAC,SAAS,GAAG,EAAE,IAAI,EAAE;AAChD,EAAE,IAAI,GAAG,SAAS,CAAC,IAAI,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;AACvC,EAAE,IAAI,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC;AAC1B,EAAE,IAAI,KAAK,GAAG,CAAC,EAAE,MAAM,IAAI,KAAK,CAAC,uCAAuC,CAAC,CAAC;AAC1E,EAAE,OAAO,KAAK,EAAE,EAAE;AAClB,IAAI,IAAI,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC;AAC1B,IAAI,GAAG,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC,CAAC;AACnC,GAAG;AACH,EAAE,OAAO,GAAG,CAAC;AACb,CAAC,EAAE;AACH;AACA;AACA,SAAS,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE;AAC/B,EAAE,IAAI,OAAO,GAAG,SAAS,GAAG,EAAE;AAC9B,IAAI,IAAI,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;AAC9B,IAAI,IAAI,OAAO,GAAG,EAAE,IAAI,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,IAAI,EAAE,SAAS,CAAC,GAAG,GAAG,CAAC,CAAC;AACtE,IAAI,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,OAAO,CAAC,EAAE,KAAK,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;AAC7E,IAAI,OAAO,KAAK,CAAC,OAAO,CAAC,CAAC;AAC1B,GAAG,CAAC;AACJ,EAAE,OAAO,CAAC,KAAK,GAAG,EAAE,CAAC;AACrB,EAAE,OAAO,OAAO,CAAC;AACjB,CAAC;AACD;AACA;AACA;AACG,IAAC,KAAK,GAAG,aAAa,CAAC,SAAS,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE;AACrD,EAAE,OAAO,UAAU,CAAC,WAAW;AAC/B,IAAI,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;AAClC,GAAG,EAAE,IAAI,CAAC,CAAC;AACX,CAAC,EAAE;AACH;AACA;AACA;AACG,IAAC,KAAK,GAAG,OAAO,CAAC,KAAK,EAAE,GAAG,EAAE,CAAC,EAAE;AACnC;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,QAAQ,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE;AACvC,EAAE,IAAI,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,CAAC;AACrC,EAAE,IAAI,QAAQ,GAAG,CAAC,CAAC;AACnB,EAAE,IAAI,CAAC,OAAO,EAAE,OAAO,GAAG,EAAE,CAAC;AAC7B;AACA,EAAE,IAAI,KAAK,GAAG,WAAW;AACzB,IAAI,QAAQ,GAAG,OAAO,CAAC,OAAO,KAAK,KAAK,GAAG,CAAC,GAAG,GAAG,EAAE,CAAC;AACrD,IAAI,OAAO,GAAG,IAAI,CAAC;AACnB,IAAI,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;AACvC,IAAI,IAAI,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,GAAG,IAAI,CAAC;AACxC,GAAG,CAAC;AACJ;AACA,EAAE,IAAI,SAAS,GAAG,WAAW;AAC7B,IAAI,IAAI,IAAI,GAAG,GAAG,EAAE,CAAC;AACrB,IAAI,IAAI,CAAC,QAAQ,IAAI,OAAO,CAAC,OAAO,KAAK,KAAK,EAAE,QAAQ,GAAG,IAAI,CAAC;AAChE,IAAI,IAAI,SAAS,GAAG,IAAI,IAAI,IAAI,GAAG,QAAQ,CAAC,CAAC;AAC7C,IAAI,OAAO,GAAG,IAAI,CAAC;AACnB,IAAI,IAAI,GAAG,SAAS,CAAC;AACrB,IAAI,IAAI,SAAS,IAAI,CAAC,IAAI,SAAS,GAAG,IAAI,EAAE;AAC5C,MAAM,IAAI,OAAO,EAAE;AACnB,QAAQ,YAAY,CAAC,OAAO,CAAC,CAAC;AAC9B,QAAQ,OAAO,GAAG,IAAI,CAAC;AACvB,OAAO;AACP,MAAM,QAAQ,GAAG,IAAI,CAAC;AACtB,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;AACzC,MAAM,IAAI,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,GAAG,IAAI,CAAC;AAC1C,KAAK,MAAM,IAAI,CAAC,OAAO,IAAI,OAAO,CAAC,QAAQ,KAAK,KAAK,EAAE;AACvD,MAAM,OAAO,GAAG,UAAU,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;AAC7C,KAAK;AACL,IAAI,OAAO,MAAM,CAAC;AAClB,GAAG,CAAC;AACJ;AACA,EAAE,SAAS,CAAC,MAAM,GAAG,WAAW;AAChC,IAAI,YAAY,CAAC,OAAO,CAAC,CAAC;AAC1B,IAAI,QAAQ,GAAG,CAAC,CAAC;AACjB,IAAI,OAAO,GAAG,OAAO,GAAG,IAAI,GAAG,IAAI,CAAC;AACpC,GAAG,CAAC;AACJ;AACA,EAAE,OAAO,SAAS,CAAC;AACnB,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,SAAS,QAAQ,CAAC,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE;AACzC,EAAE,IAAI,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC;AAC/C;AACA,EAAE,IAAI,KAAK,GAAG,WAAW;AACzB,IAAI,IAAI,MAAM,GAAG,GAAG,EAAE,GAAG,QAAQ,CAAC;AAClC,IAAI,IAAI,IAAI,GAAG,MAAM,EAAE;AACvB,MAAM,OAAO,GAAG,UAAU,CAAC,KAAK,EAAE,IAAI,GAAG,MAAM,CAAC,CAAC;AACjD,KAAK,MAAM;AACX,MAAM,OAAO,GAAG,IAAI,CAAC;AACrB,MAAM,IAAI,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;AACzD;AACA,MAAM,IAAI,CAAC,OAAO,EAAE,IAAI,GAAG,OAAO,GAAG,IAAI,CAAC;AAC1C,KAAK;AACL,GAAG,CAAC;AACJ;AACA,EAAE,IAAI,SAAS,GAAG,aAAa,CAAC,SAAS,KAAK,EAAE;AAChD,IAAI,OAAO,GAAG,IAAI,CAAC;AACnB,IAAI,IAAI,GAAG,KAAK,CAAC;AACjB,IAAI,QAAQ,GAAG,GAAG,EAAE,CAAC;AACrB,IAAI,IAAI,CAAC,OAAO,EAAE;AAClB,MAAM,OAAO,GAAG,UAAU,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;AACxC,MAAM,IAAI,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;AACxD,KAAK;AACL,IAAI,OAAO,MAAM,CAAC;AAClB,GAAG,CAAC,CAAC;AACL;AACA,EAAE,SAAS,CAAC,MAAM,GAAG,WAAW;AAChC,IAAI,YAAY,CAAC,OAAO,CAAC,CAAC;AAC1B,IAAI,OAAO,GAAG,IAAI,GAAG,OAAO,GAAG,IAAI,CAAC;AACpC,GAAG,CAAC;AACJ;AACA,EAAE,OAAO,SAAS,CAAC;AACnB,CAAC;AACD;AACA;AACA;AACA;AACA,SAAS,IAAI,CAAC,IAAI,EAAE,OAAO,EAAE;AAC7B,EAAE,OAAO,OAAO,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;AAChC,CAAC;AACD;AACA;AACA,SAAS,MAAM,CAAC,SAAS,EAAE;AAC3B,EAAE,OAAO,WAAW;AACpB,IAAI,OAAO,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;AAC7C,GAAG,CAAC;AACJ,CAAC;AACD;AACA;AACA;AACA,SAAS,OAAO,GAAG;AACnB,EAAE,IAAI,IAAI,GAAG,SAAS,CAAC;AACvB,EAAE,IAAI,KAAK,GAAG,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;AAC9B,EAAE,OAAO,WAAW;AACpB,IAAI,IAAI,CAAC,GAAG,KAAK,CAAC;AAClB,IAAI,IAAI,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;AACpD,IAAI,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;AACpD,IAAI,OAAO,MAAM,CAAC;AAClB,GAAG,CAAC;AACJ,CAAC;AACD;AACA;AACA,SAAS,KAAK,CAAC,KAAK,EAAE,IAAI,EAAE;AAC5B,EAAE,OAAO,WAAW;AACpB,IAAI,IAAI,EAAE,KAAK,GAAG,CAAC,EAAE;AACrB,MAAM,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;AACzC,KAAK;AACL,GAAG,CAAC;AACJ,CAAC;AACD;AACA;AACA;AACA,SAAS,MAAM,CAAC,KAAK,EAAE,IAAI,EAAE;AAC7B,EAAE,IAAI,IAAI,CAAC;AACX,EAAE,OAAO,WAAW;AACpB,IAAI,IAAI,EAAE,KAAK,GAAG,CAAC,EAAE;AACrB,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;AACzC,KAAK;AACL,IAAI,IAAI,KAAK,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;AAChC,IAAI,OAAO,IAAI,CAAC;AAChB,GAAG,CAAC;AACJ,CAAC;AACD;AACA;AACA;AACG,IAAC,IAAI,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,EAAE;AAC9B;AACA;AACA,SAAS,OAAO,CAAC,GAAG,EAAE,SAAS,EAAE,OAAO,EAAE;AAC1C,EAAE,SAAS,GAAG,EAAE,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;AACrC,EAAE,IAAI,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC;AAC7B,EAAE,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,GAAG,MAAM,EAAE,CAAC,EAAE,EAAE;AAC1D,IAAI,GAAG,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;AACnB,IAAI,IAAI,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,GAAG,EAAE,GAAG,CAAC,EAAE,OAAO,GAAG,CAAC;AAClD,GAAG;AACH,CAAC;AACD;AACA;AACA,SAAS,0BAA0B,CAAC,GAAG,EAAE;AACzC,EAAE,OAAO,SAAS,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE;AAC7C,IAAI,SAAS,GAAG,EAAE,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;AACvC,IAAI,IAAI,MAAM,GAAG,SAAS,CAAC,KAAK,CAAC,CAAC;AAClC,IAAI,IAAI,KAAK,GAAG,GAAG,GAAG,CAAC,GAAG,CAAC,GAAG,MAAM,GAAG,CAAC,CAAC;AACzC,IAAI,OAAO,KAAK,IAAI,CAAC,IAAI,KAAK,GAAG,MAAM,EAAE,KAAK,IAAI,GAAG,EAAE;AACvD,MAAM,IAAI,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,EAAE,OAAO,KAAK,CAAC;AAC9D,KAAK;AACL,IAAI,OAAO,CAAC,CAAC,CAAC;AACd,GAAG,CAAC;AACJ,CAAC;AACD;AACA;AACG,IAAC,SAAS,GAAG,0BAA0B,CAAC,CAAC,EAAE;AAC9C;AACA;AACG,IAAC,aAAa,GAAG,0BAA0B,CAAC,CAAC,CAAC,EAAE;AACnD;AACA;AACA;AACA,SAAS,WAAW,CAAC,KAAK,EAAE,GAAG,EAAE,QAAQ,EAAE,OAAO,EAAE;AACpD,EAAE,QAAQ,GAAG,EAAE,CAAC,QAAQ,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC;AACtC,EAAE,IAAI,KAAK,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC;AAC5B,EAAE,IAAI,GAAG,GAAG,CAAC,EAAE,IAAI,GAAG,SAAS,CAAC,KAAK,CAAC,CAAC;AACvC,EAAE,OAAO,GAAG,GAAG,IAAI,EAAE;AACrB,IAAI,IAAI,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,GAAG,IAAI,IAAI,CAAC,CAAC,CAAC;AAC3C,IAAI,IAAI,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,KAAK,EAAE,GAAG,GAAG,GAAG,GAAG,CAAC,CAAC,MAAM,IAAI,GAAG,GAAG,CAAC;AACrE,GAAG;AACH,EAAE,OAAO,GAAG,CAAC;AACb,CAAC;AACD;AACA;AACA,SAAS,iBAAiB,CAAC,GAAG,EAAE,aAAa,EAAE,WAAW,EAAE;AAC5D,EAAE,OAAO,SAAS,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE;AACpC,IAAI,IAAI,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC,KAAK,CAAC,CAAC;AACzC,IAAI,IAAI,OAAO,GAAG,IAAI,QAAQ,EAAE;AAChC,MAAM,IAAI,GAAG,GAAG,CAAC,EAAE;AACnB,QAAQ,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,GAAG,MAAM,EAAE,CAAC,CAAC,CAAC;AACvD,OAAO,MAAM;AACb,QAAQ,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC,EAAE,MAAM,CAAC,GAAG,GAAG,GAAG,MAAM,GAAG,CAAC,CAAC;AACzE,OAAO;AACP,KAAK,MAAM,IAAI,WAAW,IAAI,GAAG,IAAI,MAAM,EAAE;AAC7C,MAAM,GAAG,GAAG,WAAW,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;AACrC,MAAM,OAAO,KAAK,CAAC,GAAG,CAAC,KAAK,IAAI,GAAG,GAAG,GAAG,CAAC,CAAC,CAAC;AAC5C,KAAK;AACL,IAAI,IAAI,IAAI,KAAK,IAAI,EAAE;AACvB,MAAM,GAAG,GAAG,aAAa,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,EAAE,MAAM,CAAC,EAAE,OAAO,CAAC,CAAC;AACjE,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;AACrC,KAAK;AACL,IAAI,KAAK,GAAG,GAAG,GAAG,GAAG,CAAC,GAAG,CAAC,GAAG,MAAM,GAAG,CAAC,EAAE,GAAG,IAAI,CAAC,IAAI,GAAG,GAAG,MAAM,EAAE,GAAG,IAAI,GAAG,EAAE;AAC/E,MAAM,IAAI,KAAK,CAAC,GAAG,CAAC,KAAK,IAAI,EAAE,OAAO,GAAG,CAAC;AAC1C,KAAK;AACL,IAAI,OAAO,CAAC,CAAC,CAAC;AACd,GAAG,CAAC;AACJ,CAAC;AACD;AACA;AACA;AACA;AACA;AACG,IAAC,OAAO,GAAG,iBAAiB,CAAC,CAAC,EAAE,SAAS,EAAE,WAAW,EAAE;AAC3D;AACA;AACA;AACG,IAAC,WAAW,GAAG,iBAAiB,CAAC,CAAC,CAAC,EAAE,aAAa,EAAE;AACvD;AACA;AACA,SAAS,IAAI,CAAC,GAAG,EAAE,SAAS,EAAE,OAAO,EAAE;AACvC,EAAE,IAAI,SAAS,GAAG,WAAW,CAAC,GAAG,CAAC,GAAG,SAAS,GAAG,OAAO,CAAC;AACzD,EAAE,IAAI,GAAG,GAAG,SAAS,CAAC,GAAG,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC;AAC/C,EAAE,IAAI,GAAG,KAAK,KAAK,CAAC,IAAI,GAAG,KAAK,CAAC,CAAC,EAAE,OAAO,GAAG,CAAC,GAAG,CAAC,CAAC;AACpD,CAAC;AACD;AACA;AACA;AACA,SAAS,SAAS,CAAC,GAAG,EAAE,KAAK,EAAE;AAC/B,EAAE,OAAO,IAAI,CAAC,GAAG,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC;AACnC,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,SAAS,IAAI,CAAC,GAAG,EAAE,QAAQ,EAAE,OAAO,EAAE;AACtC,EAAE,QAAQ,GAAG,UAAU,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;AAC3C,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC;AAChB,EAAE,IAAI,WAAW,CAAC,GAAG,CAAC,EAAE;AACxB,IAAI,KAAK,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC,GAAG,MAAM,EAAE,CAAC,EAAE,EAAE;AACtD,MAAM,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,CAAC;AAC/B,KAAK;AACL,GAAG,MAAM;AACT,IAAI,IAAI,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC;AAC1B,IAAI,KAAK,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,GAAG,MAAM,EAAE,CAAC,EAAE,EAAE;AACxD,MAAM,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;AAC7C,KAAK;AACL,GAAG;AACH,EAAE,OAAO,GAAG,CAAC;AACb,CAAC;AACD;AACA;AACA,SAAS,GAAG,CAAC,GAAG,EAAE,QAAQ,EAAE,OAAO,EAAE;AACrC,EAAE,QAAQ,GAAG,EAAE,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;AACnC,EAAE,IAAI,KAAK,GAAG,CAAC,WAAW,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC,GAAG,CAAC;AAC5C,MAAM,MAAM,GAAG,CAAC,KAAK,IAAI,GAAG,EAAE,MAAM;AACpC,MAAM,OAAO,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC;AAC9B,EAAE,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,MAAM,EAAE,KAAK,EAAE,EAAE;AAC/C,IAAI,IAAI,UAAU,GAAG,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC;AAClD,IAAI,OAAO,CAAC,KAAK,CAAC,GAAG,QAAQ,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE,UAAU,EAAE,GAAG,CAAC,CAAC;AAChE,GAAG;AACH,EAAE,OAAO,OAAO,CAAC;AACjB,CAAC;AACD;AACA;AACA,SAAS,YAAY,CAAC,GAAG,EAAE;AAC3B;AACA;AACA,EAAE,IAAI,OAAO,GAAG,SAAS,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE;AACvD,IAAI,IAAI,KAAK,GAAG,CAAC,WAAW,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC,GAAG,CAAC;AAC9C,QAAQ,MAAM,GAAG,CAAC,KAAK,IAAI,GAAG,EAAE,MAAM;AACtC,QAAQ,KAAK,GAAG,GAAG,GAAG,CAAC,GAAG,CAAC,GAAG,MAAM,GAAG,CAAC,CAAC;AACzC,IAAI,IAAI,CAAC,OAAO,EAAE;AAClB,MAAM,IAAI,GAAG,GAAG,CAAC,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC,CAAC;AAC/C,MAAM,KAAK,IAAI,GAAG,CAAC;AACnB,KAAK;AACL,IAAI,OAAO,KAAK,IAAI,CAAC,IAAI,KAAK,GAAG,MAAM,EAAE,KAAK,IAAI,GAAG,EAAE;AACvD,MAAM,IAAI,UAAU,GAAG,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC;AACpD,MAAM,IAAI,GAAG,QAAQ,CAAC,IAAI,EAAE,GAAG,CAAC,UAAU,CAAC,EAAE,UAAU,EAAE,GAAG,CAAC,CAAC;AAC9D,KAAK;AACL,IAAI,OAAO,IAAI,CAAC;AAChB,GAAG,CAAC;AACJ;AACA,EAAE,OAAO,SAAS,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE;AAChD,IAAI,IAAI,OAAO,GAAG,SAAS,CAAC,MAAM,IAAI,CAAC,CAAC;AACxC,IAAI,OAAO,OAAO,CAAC,GAAG,EAAE,UAAU,CAAC,QAAQ,EAAE,OAAO,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;AACzE,GAAG,CAAC;AACJ,CAAC;AACD;AACA;AACA;AACG,IAAC,MAAM,GAAG,YAAY,CAAC,CAAC,EAAE;AAC7B;AACA;AACG,IAAC,WAAW,GAAG,YAAY,CAAC,CAAC,CAAC,EAAE;AACnC;AACA;AACA,SAAS,MAAM,CAAC,GAAG,EAAE,SAAS,EAAE,OAAO,EAAE;AACzC,EAAE,IAAI,OAAO,GAAG,EAAE,CAAC;AACnB,EAAE,SAAS,GAAG,EAAE,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;AACrC,EAAE,IAAI,CAAC,GAAG,EAAE,SAAS,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE;AACzC,IAAI,IAAI,SAAS,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AAC3D,GAAG,CAAC,CAAC;AACL,EAAE,OAAO,OAAO,CAAC;AACjB,CAAC;AACD;AACA;AACA,SAAS,MAAM,CAAC,GAAG,EAAE,SAAS,EAAE,OAAO,EAAE;AACzC,EAAE,OAAO,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;AACrD,CAAC;AACD;AACA;AACA,SAAS,KAAK,CAAC,GAAG,EAAE,SAAS,EAAE,OAAO,EAAE;AACxC,EAAE,SAAS,GAAG,EAAE,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;AACrC,EAAE,IAAI,KAAK,GAAG,CAAC,WAAW,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC,GAAG,CAAC;AAC5C,MAAM,MAAM,GAAG,CAAC,KAAK,IAAI,GAAG,EAAE,MAAM,CAAC;AACrC,EAAE,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,MAAM,EAAE,KAAK,EAAE,EAAE;AAC/C,IAAI,IAAI,UAAU,GAAG,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC;AAClD,IAAI,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE,UAAU,EAAE,GAAG,CAAC,EAAE,OAAO,KAAK,CAAC;AACnE,GAAG;AACH,EAAE,OAAO,IAAI,CAAC;AACd,CAAC;AACD;AACA;AACA,SAAS,IAAI,CAAC,GAAG,EAAE,SAAS,EAAE,OAAO,EAAE;AACvC,EAAE,SAAS,GAAG,EAAE,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;AACrC,EAAE,IAAI,KAAK,GAAG,CAAC,WAAW,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC,GAAG,CAAC;AAC5C,MAAM,MAAM,GAAG,CAAC,KAAK,IAAI,GAAG,EAAE,MAAM,CAAC;AACrC,EAAE,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,MAAM,EAAE,KAAK,EAAE,EAAE;AAC/C,IAAI,IAAI,UAAU,GAAG,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC;AAClD,IAAI,IAAI,SAAS,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE,UAAU,EAAE,GAAG,CAAC,EAAE,OAAO,IAAI,CAAC;AACjE,GAAG;AACH,EAAE,OAAO,KAAK,CAAC;AACf,CAAC;AACD;AACA;AACA,SAAS,QAAQ,CAAC,GAAG,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE;AAC/C,EAAE,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,EAAE,GAAG,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;AAC3C,EAAE,IAAI,OAAO,SAAS,IAAI,QAAQ,IAAI,KAAK,EAAE,SAAS,GAAG,CAAC,CAAC;AAC3D,EAAE,OAAO,OAAO,CAAC,GAAG,EAAE,IAAI,EAAE,SAAS,CAAC,IAAI,CAAC,CAAC;AAC5C,CAAC;AACD;AACA;AACG,IAAC,MAAM,GAAG,aAAa,CAAC,SAAS,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE;AACrD,EAAE,IAAI,WAAW,EAAE,IAAI,CAAC;AACxB,EAAE,IAAI,YAAY,CAAC,IAAI,CAAC,EAAE;AAC1B,IAAI,IAAI,GAAG,IAAI,CAAC;AAChB,GAAG,MAAM;AACT,IAAI,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC;AACxB,IAAI,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;AACpC,IAAI,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;AACjC,GAAG;AACH,EAAE,OAAO,GAAG,CAAC,GAAG,EAAE,SAAS,OAAO,EAAE;AACpC,IAAI,IAAI,MAAM,GAAG,IAAI,CAAC;AACtB,IAAI,IAAI,CAAC,MAAM,EAAE;AACjB,MAAM,IAAI,WAAW,IAAI,WAAW,CAAC,MAAM,EAAE;AAC7C,QAAQ,OAAO,GAAG,OAAO,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;AAChD,OAAO;AACP,MAAM,IAAI,OAAO,IAAI,IAAI,EAAE,OAAO,KAAK,CAAC,CAAC;AACzC,MAAM,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;AAC7B,KAAK;AACL,IAAI,OAAO,MAAM,IAAI,IAAI,GAAG,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;AACjE,GAAG,CAAC,CAAC;AACL,CAAC,EAAE;AACH;AACA;AACA,SAAS,KAAK,CAAC,GAAG,EAAE,GAAG,EAAE;AACzB,EAAE,OAAO,GAAG,CAAC,GAAG,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC;AACjC,CAAC;AACD;AACA;AACA;AACA,SAAS,KAAK,CAAC,GAAG,EAAE,KAAK,EAAE;AAC3B,EAAE,OAAO,MAAM,CAAC,GAAG,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC;AACrC,CAAC;AACD;AACA;AACA,SAAS,GAAG,CAAC,GAAG,EAAE,QAAQ,EAAE,OAAO,EAAE;AACrC,EAAE,IAAI,MAAM,GAAG,CAAC,QAAQ,EAAE,YAAY,GAAG,CAAC,QAAQ;AAClD,MAAM,KAAK,EAAE,QAAQ,CAAC;AACtB,EAAE,IAAI,QAAQ,IAAI,IAAI,KAAK,OAAO,QAAQ,IAAI,QAAQ,IAAI,OAAO,GAAG,CAAC,CAAC,CAAC,IAAI,QAAQ,IAAI,GAAG,IAAI,IAAI,CAAC,EAAE;AACrG,IAAI,GAAG,GAAG,WAAW,CAAC,GAAG,CAAC,GAAG,GAAG,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;AAC/C,IAAI,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC,GAAG,MAAM,EAAE,CAAC,EAAE,EAAE;AAC1D,MAAM,KAAK,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC;AACrB,MAAM,IAAI,KAAK,IAAI,IAAI,IAAI,KAAK,GAAG,MAAM,EAAE;AAC3C,QAAQ,MAAM,GAAG,KAAK,CAAC;AACvB,OAAO;AACP,KAAK;AACL,GAAG,MAAM;AACT,IAAI,QAAQ,GAAG,EAAE,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;AACrC,IAAI,IAAI,CAAC,GAAG,EAAE,SAAS,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE;AACvC,MAAM,QAAQ,GAAG,QAAQ,CAAC,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC;AAC1C,MAAM,IAAI,QAAQ,GAAG,YAAY,KAAK,QAAQ,KAAK,CAAC,QAAQ,IAAI,MAAM,KAAK,CAAC,QAAQ,CAAC,EAAE;AACvF,QAAQ,MAAM,GAAG,CAAC,CAAC;AACnB,QAAQ,YAAY,GAAG,QAAQ,CAAC;AAChC,OAAO;AACP,KAAK,CAAC,CAAC;AACP,GAAG;AACH,EAAE,OAAO,MAAM,CAAC;AAChB,CAAC;AACD;AACA;AACA,SAAS,GAAG,CAAC,GAAG,EAAE,QAAQ,EAAE,OAAO,EAAE;AACrC,EAAE,IAAI,MAAM,GAAG,QAAQ,EAAE,YAAY,GAAG,QAAQ;AAChD,MAAM,KAAK,EAAE,QAAQ,CAAC;AACtB,EAAE,IAAI,QAAQ,IAAI,IAAI,KAAK,OAAO,QAAQ,IAAI,QAAQ,IAAI,OAAO,GAAG,CAAC,CAAC,CAAC,IAAI,QAAQ,IAAI,GAAG,IAAI,IAAI,CAAC,EAAE;AACrG,IAAI,GAAG,GAAG,WAAW,CAAC,GAAG,CAAC,GAAG,GAAG,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;AAC/C,IAAI,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC,GAAG,MAAM,EAAE,CAAC,EAAE,EAAE;AAC1D,MAAM,KAAK,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC;AACrB,MAAM,IAAI,KAAK,IAAI,IAAI,IAAI,KAAK,GAAG,MAAM,EAAE;AAC3C,QAAQ,MAAM,GAAG,KAAK,CAAC;AACvB,OAAO;AACP,KAAK;AACL,GAAG,MAAM;AACT,IAAI,QAAQ,GAAG,EAAE,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;AACrC,IAAI,IAAI,CAAC,GAAG,EAAE,SAAS,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE;AACvC,MAAM,QAAQ,GAAG,QAAQ,CAAC,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC;AAC1C,MAAM,IAAI,QAAQ,GAAG,YAAY,KAAK,QAAQ,KAAK,QAAQ,IAAI,MAAM,KAAK,QAAQ,CAAC,EAAE;AACrF,QAAQ,MAAM,GAAG,CAAC,CAAC;AACnB,QAAQ,YAAY,GAAG,QAAQ,CAAC;AAChC,OAAO;AACP,KAAK,CAAC,CAAC;AACP,GAAG;AACH,EAAE,OAAO,MAAM,CAAC;AAChB,CAAC;AACD;AACA;AACA,IAAI,WAAW,GAAG,kEAAkE,CAAC;AACrF,SAAS,OAAO,CAAC,GAAG,EAAE;AACtB,EAAE,IAAI,CAAC,GAAG,EAAE,OAAO,EAAE,CAAC;AACtB,EAAE,IAAI,OAAO,CAAC,GAAG,CAAC,EAAE,OAAO,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC3C,EAAE,IAAI,QAAQ,CAAC,GAAG,CAAC,EAAE;AACrB;AACA,IAAI,OAAO,GAAG,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;AAClC,GAAG;AACH,EAAE,IAAI,WAAW,CAAC,GAAG,CAAC,EAAE,OAAO,GAAG,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;AAClD,EAAE,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC;AACrB,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,SAAS,MAAM,CAAC,GAAG,EAAE,CAAC,EAAE,KAAK,EAAE;AAC/B,EAAE,IAAI,CAAC,IAAI,IAAI,IAAI,KAAK,EAAE;AAC1B,IAAI,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,EAAE,GAAG,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;AAC7C,IAAI,OAAO,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC;AACvC,GAAG;AACH,EAAE,IAAI,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;AAC5B,EAAE,IAAI,MAAM,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC;AACjC,EAAE,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC;AACvC,EAAE,IAAI,IAAI,GAAG,MAAM,GAAG,CAAC,CAAC;AACxB,EAAE,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,CAAC,EAAE,KAAK,EAAE,EAAE;AAC1C,IAAI,IAAI,IAAI,GAAG,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;AACnC,IAAI,IAAI,IAAI,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;AAC7B,IAAI,MAAM,CAAC,KAAK,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC;AACjC,IAAI,MAAM,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;AACxB,GAAG;AACH,EAAE,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAC5B,CAAC;AACD;AACA;AACA,SAAS,OAAO,CAAC,GAAG,EAAE;AACtB,EAAE,OAAO,MAAM,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;AAC/B,CAAC;AACD;AACA;AACA,SAAS,MAAM,CAAC,GAAG,EAAE,QAAQ,EAAE,OAAO,EAAE;AACxC,EAAE,IAAI,KAAK,GAAG,CAAC,CAAC;AAChB,EAAE,QAAQ,GAAG,EAAE,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;AACnC,EAAE,OAAO,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,SAAS,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE;AACnD,IAAI,OAAO;AACX,MAAM,KAAK,EAAE,KAAK;AAClB,MAAM,KAAK,EAAE,KAAK,EAAE;AACpB,MAAM,QAAQ,EAAE,QAAQ,CAAC,KAAK,EAAE,GAAG,EAAE,IAAI,CAAC;AAC1C,KAAK,CAAC;AACN,GAAG,CAAC,CAAC,IAAI,CAAC,SAAS,IAAI,EAAE,KAAK,EAAE;AAChC,IAAI,IAAI,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC;AAC1B,IAAI,IAAI,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC;AAC3B,IAAI,IAAI,CAAC,KAAK,CAAC,EAAE;AACjB,MAAM,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,KAAK,CAAC,EAAE,OAAO,CAAC,CAAC;AAC1C,MAAM,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,KAAK,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC;AAC3C,KAAK;AACL,IAAI,OAAO,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC;AACpC,GAAG,CAAC,EAAE,OAAO,CAAC,CAAC;AACf,CAAC;AACD;AACA;AACA,SAAS,KAAK,CAAC,QAAQ,EAAE,SAAS,EAAE;AACpC,EAAE,OAAO,SAAS,GAAG,EAAE,QAAQ,EAAE,OAAO,EAAE;AAC1C,IAAI,IAAI,MAAM,GAAG,SAAS,GAAG,CAAC,EAAE,EAAE,EAAE,CAAC,GAAG,EAAE,CAAC;AAC3C,IAAI,QAAQ,GAAG,EAAE,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;AACrC,IAAI,IAAI,CAAC,GAAG,EAAE,SAAS,KAAK,EAAE,KAAK,EAAE;AACrC,MAAM,IAAI,GAAG,GAAG,QAAQ,CAAC,KAAK,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC;AAC5C,MAAM,QAAQ,CAAC,MAAM,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC;AACnC,KAAK,CAAC,CAAC;AACP,IAAI,OAAO,MAAM,CAAC;AAClB,GAAG,CAAC;AACJ,CAAC;AACD;AACA;AACA;AACG,IAAC,OAAO,GAAG,KAAK,CAAC,SAAS,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE;AACjD,EAAE,IAAI,KAAK,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AAC9E,CAAC,EAAE;AACH;AACA;AACA;AACG,IAAC,OAAO,GAAG,KAAK,CAAC,SAAS,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE;AACjD,EAAE,MAAM,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;AACtB,CAAC,EAAE;AACH;AACA;AACA;AACA;AACG,IAAC,OAAO,GAAG,KAAK,CAAC,SAAS,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE;AACjD,EAAE,IAAI,KAAK,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,MAAM,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAC9D,CAAC,EAAE;AACH;AACA;AACA;AACG,IAAC,SAAS,GAAG,KAAK,CAAC,SAAS,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE;AACpD,EAAE,MAAM,CAAC,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AACnC,CAAC,EAAE,IAAI,EAAE;AACT;AACA;AACA,SAAS,IAAI,CAAC,GAAG,EAAE;AACnB,EAAE,IAAI,GAAG,IAAI,IAAI,EAAE,OAAO,CAAC,CAAC;AAC5B,EAAE,OAAO,WAAW,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC;AAC1D,CAAC;AACD;AACA;AACA;AACA,SAAS,QAAQ,CAAC,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE;AACnC,EAAE,OAAO,GAAG,IAAI,GAAG,CAAC;AACpB,CAAC;AACD;AACA;AACG,IAAC,IAAI,GAAG,aAAa,CAAC,SAAS,GAAG,EAAE,IAAI,EAAE;AAC7C,EAAE,IAAI,MAAM,GAAG,EAAE,EAAE,QAAQ,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;AACtC,EAAE,IAAI,GAAG,IAAI,IAAI,EAAE,OAAO,MAAM,CAAC;AACjC,EAAE,IAAI,YAAY,CAAC,QAAQ,CAAC,EAAE;AAC9B,IAAI,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,QAAQ,GAAG,UAAU,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;AAClE,IAAI,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;AACxB,GAAG,MAAM;AACT,IAAI,QAAQ,GAAG,QAAQ,CAAC;AACxB,IAAI,IAAI,GAAG,SAAS,CAAC,IAAI,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;AACzC,IAAI,GAAG,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;AACtB,GAAG;AACH,EAAE,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,GAAG,MAAM,EAAE,CAAC,EAAE,EAAE;AACzD,IAAI,IAAI,GAAG,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;AACtB,IAAI,IAAI,KAAK,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC;AACzB,IAAI,IAAI,QAAQ,CAAC,KAAK,EAAE,GAAG,EAAE,GAAG,CAAC,EAAE,MAAM,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;AACvD,GAAG;AACH,EAAE,OAAO,MAAM,CAAC;AAChB,CAAC,EAAE;AACH;AACA;AACG,IAAC,IAAI,GAAG,aAAa,CAAC,SAAS,GAAG,EAAE,IAAI,EAAE;AAC7C,EAAE,IAAI,QAAQ,GAAG,IAAI,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC;AAClC,EAAE,IAAI,YAAY,CAAC,QAAQ,CAAC,EAAE;AAC9B,IAAI,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC;AAChC,IAAI,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;AAC3C,GAAG,MAAM;AACT,IAAI,IAAI,GAAG,GAAG,CAAC,SAAS,CAAC,IAAI,EAAE,KAAK,EAAE,KAAK,CAAC,EAAE,MAAM,CAAC,CAAC;AACtD,IAAI,QAAQ,GAAG,SAAS,KAAK,EAAE,GAAG,EAAE;AACpC,MAAM,OAAO,CAAC,QAAQ,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;AAClC,KAAK,CAAC;AACN,GAAG;AACH,EAAE,OAAO,IAAI,CAAC,GAAG,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;AACtC,CAAC,EAAE;AACH;AACA;AACA;AACA;AACA,SAAS,OAAO,CAAC,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE;AAClC,EAAE,OAAO,KAAK,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,CAAC,MAAM,IAAI,CAAC,IAAI,IAAI,IAAI,KAAK,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;AACxF,CAAC;AACD;AACA;AACA;AACA,SAAS,KAAK,CAAC,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE;AAChC,EAAE,IAAI,KAAK,IAAI,IAAI,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,OAAO,CAAC,IAAI,IAAI,IAAI,KAAK,GAAG,KAAK,CAAC,GAAG,EAAE,CAAC;AACjF,EAAE,IAAI,CAAC,IAAI,IAAI,IAAI,KAAK,EAAE,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC;AAC1C,EAAE,OAAO,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;AAC1C,CAAC;AACD;AACA;AACA;AACA;AACA,SAAS,IAAI,CAAC,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE;AAC/B,EAAE,OAAO,KAAK,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,IAAI,IAAI,IAAI,KAAK,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;AACvD,CAAC;AACD;AACA;AACA;AACA,SAAS,IAAI,CAAC,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE;AAC/B,EAAE,IAAI,KAAK,IAAI,IAAI,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,OAAO,CAAC,IAAI,IAAI,IAAI,KAAK,GAAG,KAAK,CAAC,GAAG,EAAE,CAAC;AACjF,EAAE,IAAI,CAAC,IAAI,IAAI,IAAI,KAAK,EAAE,OAAO,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;AACzD,EAAE,OAAO,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC;AACpD,CAAC;AACD;AACA;AACA,SAAS,OAAO,CAAC,KAAK,EAAE;AACxB,EAAE,OAAO,MAAM,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;AAChC,CAAC;AACD;AACA;AACA;AACA,SAAS,OAAO,CAAC,KAAK,EAAE,KAAK,EAAE;AAC/B,EAAE,OAAO,SAAS,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;AACxC,CAAC;AACD;AACA;AACA;AACG,IAAC,UAAU,GAAG,aAAa,CAAC,SAAS,KAAK,EAAE,IAAI,EAAE;AACrD,EAAE,IAAI,GAAG,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;AACrC,EAAE,OAAO,MAAM,CAAC,KAAK,EAAE,SAAS,KAAK,CAAC;AACtC,IAAI,OAAO,CAAC,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;AAClC,GAAG,CAAC,CAAC;AACL,CAAC,EAAE;AACH;AACA;AACG,IAAC,OAAO,GAAG,aAAa,CAAC,SAAS,KAAK,EAAE,WAAW,EAAE;AACzD,EAAE,OAAO,UAAU,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC;AACxC,CAAC,EAAE;AACH;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,IAAI,CAAC,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE;AAClD,EAAE,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,EAAE;AAC5B,IAAI,OAAO,GAAG,QAAQ,CAAC;AACvB,IAAI,QAAQ,GAAG,QAAQ,CAAC;AACxB,IAAI,QAAQ,GAAG,KAAK,CAAC;AACrB,GAAG;AACH,EAAE,IAAI,QAAQ,IAAI,IAAI,EAAE,QAAQ,GAAG,EAAE,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;AACzD,EAAE,IAAI,MAAM,GAAG,EAAE,CAAC;AAClB,EAAE,IAAI,IAAI,GAAG,EAAE,CAAC;AAChB,EAAE,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC,KAAK,CAAC,EAAE,CAAC,GAAG,MAAM,EAAE,CAAC,EAAE,EAAE;AAC9D,IAAI,IAAI,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC;AACxB,QAAQ,QAAQ,GAAG,QAAQ,GAAG,QAAQ,CAAC,KAAK,EAAE,CAAC,EAAE,KAAK,CAAC,GAAG,KAAK,CAAC;AAChE,IAAI,IAAI,QAAQ,IAAI,CAAC,QAAQ,EAAE;AAC/B,MAAM,IAAI,CAAC,CAAC,IAAI,IAAI,KAAK,QAAQ,EAAE,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AACtD,MAAM,IAAI,GAAG,QAAQ,CAAC;AACtB,KAAK,MAAM,IAAI,QAAQ,EAAE;AACzB,MAAM,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC,EAAE;AACrC,QAAQ,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;AAC5B,QAAQ,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AAC3B,OAAO;AACP,KAAK,MAAM,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,KAAK,CAAC,EAAE;AACzC,MAAM,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AACzB,KAAK;AACL,GAAG;AACH,EAAE,OAAO,MAAM,CAAC;AAChB,CAAC;AACD;AACA;AACA;AACG,IAAC,KAAK,GAAG,aAAa,CAAC,SAAS,MAAM,EAAE;AAC3C,EAAE,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC;AAC7C,CAAC,EAAE;AACH;AACA;AACA;AACA,SAAS,YAAY,CAAC,KAAK,EAAE;AAC7B,EAAE,IAAI,MAAM,GAAG,EAAE,CAAC;AAClB,EAAE,IAAI,UAAU,GAAG,SAAS,CAAC,MAAM,CAAC;AACpC,EAAE,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC,KAAK,CAAC,EAAE,CAAC,GAAG,MAAM,EAAE,CAAC,EAAE,EAAE;AAC9D,IAAI,IAAI,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;AACxB,IAAI,IAAI,QAAQ,CAAC,MAAM,EAAE,IAAI,CAAC,EAAE,SAAS;AACzC,IAAI,IAAI,CAAC,CAAC;AACV,IAAI,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,UAAU,EAAE,CAAC,EAAE,EAAE;AACrC,MAAM,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,EAAE,MAAM;AAC/C,KAAK;AACL,IAAI,IAAI,CAAC,KAAK,UAAU,EAAE,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC5C,GAAG;AACH,EAAE,OAAO,MAAM,CAAC;AAChB,CAAC;AACD;AACA;AACA;AACA,SAAS,KAAK,CAAC,KAAK,EAAE;AACtB,EAAE,IAAI,MAAM,GAAG,CAAC,KAAK,IAAI,GAAG,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC;AAC5D,EAAE,IAAI,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC;AAC7B;AACA,EAAE,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,MAAM,EAAE,KAAK,EAAE,EAAE;AAC/C,IAAI,MAAM,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;AACxC,GAAG;AACH,EAAE,OAAO,MAAM,CAAC;AAChB,CAAC;AACD;AACA;AACA;AACG,IAAC,GAAG,GAAG,aAAa,CAAC,KAAK,EAAE;AAC/B;AACA;AACA;AACA;AACA,SAAS,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE;AAC9B,EAAE,IAAI,MAAM,GAAG,EAAE,CAAC;AAClB,EAAE,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC,GAAG,MAAM,EAAE,CAAC,EAAE,EAAE;AAC7D,IAAI,IAAI,MAAM,EAAE;AAChB,MAAM,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AAClC,KAAK,MAAM;AACX,MAAM,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACtC,KAAK;AACL,GAAG;AACH,EAAE,OAAO,MAAM,CAAC;AAChB,CAAC;AACD;AACA;AACA;AACA;AACA,SAAS,KAAK,CAAC,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE;AAClC,EAAE,IAAI,IAAI,IAAI,IAAI,EAAE;AACpB,IAAI,IAAI,GAAG,KAAK,IAAI,CAAC,CAAC;AACtB,IAAI,KAAK,GAAG,CAAC,CAAC;AACd,GAAG;AACH,EAAE,IAAI,CAAC,IAAI,EAAE;AACb,IAAI,IAAI,GAAG,IAAI,GAAG,KAAK,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;AACjC,GAAG;AACH;AACA,EAAE,IAAI,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,GAAG,KAAK,IAAI,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC;AAC7D,EAAE,IAAI,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC;AAC5B;AACA,EAAE,KAAK,IAAI,GAAG,GAAG,CAAC,EAAE,GAAG,GAAG,MAAM,EAAE,GAAG,EAAE,EAAE,KAAK,IAAI,IAAI,EAAE;AACxD,IAAI,KAAK,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;AACvB,GAAG;AACH;AACA,EAAE,OAAO,KAAK,CAAC;AACf,CAAC;AACD;AACA;AACA;AACA,SAAS,KAAK,CAAC,KAAK,EAAE,KAAK,EAAE;AAC7B,EAAE,IAAI,KAAK,IAAI,IAAI,IAAI,KAAK,GAAG,CAAC,EAAE,OAAO,EAAE,CAAC;AAC5C,EAAE,IAAI,MAAM,GAAG,EAAE,CAAC;AAClB,EAAE,IAAI,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC;AACnC,EAAE,OAAO,CAAC,GAAG,MAAM,EAAE;AACrB,IAAI,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,EAAE,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC;AAClD,GAAG;AACH,EAAE,OAAO,MAAM,CAAC;AAChB,CAAC;AACD;AACA;AACA,SAAS,WAAW,CAAC,QAAQ,EAAE,GAAG,EAAE;AACpC,EAAE,OAAO,QAAQ,CAAC,MAAM,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,GAAG,GAAG,CAAC;AAClD,CAAC;AACD;AACA;AACA,SAAS,KAAK,CAAC,GAAG,EAAE;AACpB,EAAE,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE,SAAS,IAAI,EAAE;AACtC,IAAI,IAAI,IAAI,GAAG,GAAG,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC,IAAI,CAAC,CAAC;AACrC,IAAI,GAAG,CAAC,SAAS,CAAC,IAAI,CAAC,GAAG,WAAW;AACrC,MAAM,IAAI,IAAI,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;AACjC,MAAM,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;AAClC,MAAM,OAAO,WAAW,CAAC,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC,CAAC;AACtD,KAAK,CAAC;AACN,GAAG,CAAC,CAAC;AACL,EAAE,OAAO,GAAG,CAAC;AACb,CAAC;AACD;AACA;AACA,IAAI,CAAC,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,CAAC,EAAE,SAAS,IAAI,EAAE;AACtF,EAAE,IAAI,MAAM,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC;AAChC,EAAE,GAAG,CAAC,SAAS,CAAC,IAAI,CAAC,GAAG,WAAW;AACnC,IAAI,IAAI,GAAG,GAAG,IAAI,CAAC,QAAQ,CAAC;AAC5B,IAAI,IAAI,GAAG,IAAI,IAAI,EAAE;AACrB,MAAM,MAAM,CAAC,KAAK,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC;AACnC,MAAM,IAAI,CAAC,IAAI,KAAK,OAAO,IAAI,IAAI,KAAK,QAAQ,KAAK,GAAG,CAAC,MAAM,KAAK,CAAC,EAAE;AACvE,QAAQ,OAAO,GAAG,CAAC,CAAC,CAAC,CAAC;AACtB,OAAO;AACP,KAAK;AACL,IAAI,OAAO,WAAW,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;AAClC,GAAG,CAAC;AACJ,CAAC,CAAC,CAAC;AACH;AACA;AACA,IAAI,CAAC,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,SAAS,IAAI,EAAE;AACjD,EAAE,IAAI,MAAM,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC;AAChC,EAAE,GAAG,CAAC,SAAS,CAAC,IAAI,CAAC,GAAG,WAAW;AACnC,IAAI,IAAI,GAAG,GAAG,IAAI,CAAC,QAAQ,CAAC;AAC5B,IAAI,IAAI,GAAG,IAAI,IAAI,EAAE,GAAG,GAAG,MAAM,CAAC,KAAK,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC;AACxD,IAAI,OAAO,WAAW,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;AAClC,GAAG,CAAC;AACJ,CAAC,CAAC,CAAC;AACH;AACA;AACA;AACA,IAAI,UAAU,GAAG;AACjB,EAAE,SAAS,EAAE,IAAI;AACjB,EAAE,OAAO,EAAE,OAAO;AAClB,EAAE,aAAa,EAAE,aAAa;AAC9B,EAAE,QAAQ,EAAE,QAAQ;AACpB,EAAE,MAAM,EAAE,MAAM;AAChB,EAAE,WAAW,EAAE,WAAW;AAC1B,EAAE,SAAS,EAAE,SAAS;AACtB,EAAE,SAAS,EAAE,SAAS;AACtB,EAAE,QAAQ,EAAE,QAAQ;AACpB,EAAE,QAAQ,EAAE,QAAQ;AACpB,EAAE,MAAM,EAAE,MAAM;AAChB,EAAE,QAAQ,EAAE,QAAQ;AACpB,EAAE,OAAO,EAAE,OAAO;AAClB,EAAE,QAAQ,EAAE,QAAQ;AACpB,EAAE,aAAa,EAAE,aAAa;AAC9B,EAAE,UAAU,EAAE,YAAY;AAC1B,EAAE,OAAO,EAAE,OAAO;AAClB,EAAE,UAAU,EAAE,YAAY;AAC1B,EAAE,WAAW,EAAE,aAAa;AAC5B,EAAE,QAAQ,EAAE,UAAU;AACtB,EAAE,KAAK,EAAE,OAAO;AAChB,EAAE,YAAY,EAAE,cAAc;AAC9B,EAAE,OAAO,EAAE,OAAO;AAClB,EAAE,OAAO,EAAE,OAAO;AAClB,EAAE,OAAO,EAAE,OAAO;AAClB,EAAE,KAAK,EAAE,KAAK;AACd,EAAE,SAAS,EAAE,SAAS;AACtB,EAAE,KAAK,EAAE,KAAK;AACd,EAAE,SAAS,EAAE,SAAS;AACtB,EAAE,IAAI,EAAE,IAAI;AACZ,EAAE,OAAO,EAAE,OAAO;AAClB,EAAE,MAAM,EAAE,MAAM;AAChB,EAAE,KAAK,EAAE,KAAK;AACd,EAAE,MAAM,EAAE,MAAM;AAChB,EAAE,SAAS,EAAE,SAAS;AACtB,EAAE,OAAO,EAAE,SAAS;AACpB,EAAE,MAAM,EAAE,MAAM;AAChB,EAAE,SAAS,EAAE,SAAS;AACtB,EAAE,MAAM,EAAE,SAAS;AACnB,EAAE,QAAQ,EAAE,QAAQ;AACpB,EAAE,MAAM,EAAE,MAAM;AAChB,EAAE,KAAK,EAAE,KAAK;AACd,EAAE,GAAG,EAAE,GAAG;AACV,EAAE,GAAG,EAAE,GAAG;AACV,EAAE,GAAG,EAAE,GAAG;AACV,EAAE,SAAS,EAAE,SAAS;AACtB,EAAE,QAAQ,EAAE,QAAQ;AACpB,EAAE,QAAQ,EAAE,QAAQ;AACpB,EAAE,IAAI,EAAE,IAAI;AACZ,EAAE,MAAM,EAAE,QAAQ;AAClB,EAAE,QAAQ,EAAE,QAAQ;AACpB,EAAE,UAAU,EAAE,UAAU;AACxB,EAAE,OAAO,EAAE,OAAO;AAClB,EAAE,OAAO,EAAE,OAAO;AAClB,EAAE,KAAK,EAAE,KAAK;AACd,EAAE,MAAM,EAAE,MAAM;AAChB,EAAE,GAAG,EAAE,GAAG;AACV,EAAE,MAAM,EAAE,OAAO;AACjB,EAAE,QAAQ,EAAE,SAAS;AACrB,EAAE,gBAAgB,EAAE,gBAAgB;AACpC,EAAE,QAAQ,EAAE,QAAQ;AACpB,EAAE,MAAM,EAAE,MAAM;AAChB,EAAE,QAAQ,EAAE,QAAQ;AACpB,EAAE,KAAK,EAAE,KAAK;AACd,EAAE,QAAQ,EAAE,QAAQ;AACpB,EAAE,OAAO,EAAE,OAAO;AAClB,EAAE,IAAI,EAAE,IAAI;AACZ,EAAE,OAAO,EAAE,OAAO;AAClB,EAAE,OAAO,EAAE,OAAO;AAClB,EAAE,KAAK,EAAE,KAAK;AACd,EAAE,KAAK,EAAE,KAAK;AACd,EAAE,QAAQ,EAAE,QAAQ;AACpB,EAAE,QAAQ,EAAE,QAAQ;AACpB,EAAE,IAAI,EAAE,IAAI;AACZ,EAAE,MAAM,EAAE,MAAM;AAChB,EAAE,OAAO,EAAE,OAAO;AAClB,EAAE,KAAK,EAAE,KAAK;AACd,EAAE,MAAM,EAAE,MAAM;AAChB,EAAE,IAAI,EAAE,IAAI;AACZ,EAAE,OAAO,EAAE,OAAO;AAClB,EAAE,SAAS,EAAE,SAAS;AACtB,EAAE,aAAa,EAAE,aAAa;AAC9B,EAAE,WAAW,EAAE,WAAW;AAC1B,EAAE,OAAO,EAAE,OAAO;AAClB,EAAE,WAAW,EAAE,WAAW;AAC1B,EAAE,IAAI,EAAE,IAAI;AACZ,EAAE,MAAM,EAAE,IAAI;AACd,EAAE,SAAS,EAAE,SAAS;AACtB,EAAE,IAAI,EAAE,IAAI;AACZ,EAAE,OAAO,EAAE,IAAI;AACf,EAAE,GAAG,EAAE,GAAG;AACV,EAAE,OAAO,EAAE,GAAG;AACd,EAAE,MAAM,EAAE,MAAM;AAChB,EAAE,KAAK,EAAE,MAAM;AACf,EAAE,MAAM,EAAE,MAAM;AAChB,EAAE,WAAW,EAAE,WAAW;AAC1B,EAAE,KAAK,EAAE,WAAW;AACpB,EAAE,MAAM,EAAE,MAAM;AAChB,EAAE,MAAM,EAAE,MAAM;AAChB,EAAE,MAAM,EAAE,MAAM;AAChB,EAAE,KAAK,EAAE,KAAK;AACd,EAAE,GAAG,EAAE,KAAK;AACZ,EAAE,IAAI,EAAE,IAAI;AACZ,EAAE,GAAG,EAAE,IAAI;AACX,EAAE,QAAQ,EAAE,QAAQ;AACpB,EAAE,QAAQ,EAAE,QAAQ;AACpB,EAAE,OAAO,EAAE,QAAQ;AACnB,EAAE,MAAM,EAAE,MAAM;AAChB,EAAE,KAAK,EAAE,KAAK;AACd,EAAE,KAAK,EAAE,KAAK;AACd,EAAE,GAAG,EAAE,GAAG;AACV,EAAE,GAAG,EAAE,GAAG;AACV,EAAE,OAAO,EAAE,OAAO;AAClB,EAAE,MAAM,EAAE,MAAM;AAChB,EAAE,MAAM,EAAE,MAAM;AAChB,EAAE,OAAO,EAAE,OAAO;AAClB,EAAE,OAAO,EAAE,OAAO;AAClB,EAAE,OAAO,EAAE,OAAO;AAClB,EAAE,SAAS,EAAE,SAAS;AACtB,EAAE,OAAO,EAAE,OAAO;AAClB,EAAE,IAAI,EAAE,IAAI;AACZ,EAAE,IAAI,EAAE,IAAI;AACZ,EAAE,IAAI,EAAE,IAAI;AACZ,EAAE,KAAK,EAAE,KAAK;AACd,EAAE,IAAI,EAAE,KAAK;AACb,EAAE,IAAI,EAAE,KAAK;AACb,EAAE,OAAO,EAAE,OAAO;AAClB,EAAE,IAAI,EAAE,IAAI;AACZ,EAAE,IAAI,EAAE,IAAI;AACZ,EAAE,IAAI,EAAE,IAAI;AACZ,EAAE,IAAI,EAAE,IAAI;AACZ,EAAE,OAAO,EAAE,OAAO;AAClB,EAAE,OAAO,EAAE,OAAO;AAClB,EAAE,OAAO,EAAE,OAAO;AAClB,EAAE,IAAI,EAAE,IAAI;AACZ,EAAE,MAAM,EAAE,IAAI;AACd,EAAE,KAAK,EAAE,KAAK;AACd,EAAE,YAAY,EAAE,YAAY;AAC5B,EAAE,UAAU,EAAE,UAAU;AACxB,EAAE,KAAK,EAAE,KAAK;AACd,EAAE,SAAS,EAAE,KAAK;AAClB,EAAE,GAAG,EAAE,GAAG;AACV,EAAE,MAAM,EAAE,MAAM;AAChB,EAAE,KAAK,EAAE,KAAK;AACd,EAAE,KAAK,EAAE,KAAK;AACd,EAAE,KAAK,EAAE,KAAK;AACd,EAAE,SAAS,EAAE,GAAG;AAChB,CAAC,CAAC;AACF;AACA;AACA;AACA;AACG,IAAC,CAAC,GAAG,KAAK,CAAC,UAAU,EAAE;AAC1B;AACA,CAAC,CAAC,CAAC,GAAG,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/underscore-node.cjs b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/underscore-node.cjs deleted file mode 100644 index 31e374fa..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/underscore-node.cjs +++ /dev/null @@ -1,11 +0,0 @@ -// Underscore.js 1.13.6 -// https://underscorejs.org -// (c) 2009-2022 Jeremy Ashkenas, Julian Gonggrijp, and DocumentCloud and Investigative Reporters & Editors -// Underscore may be freely distributed under the MIT license. - -var underscoreNodeF = require('./underscore-node-f.cjs'); - - - -module.exports = underscoreNodeF._; -//# sourceMappingURL=underscore-node.cjs.map diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/underscore-node.cjs.map b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/underscore-node.cjs.map deleted file mode 100644 index 34b7b298..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/underscore-node.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"underscore-node.cjs","sources":[],"sourcesContent":null,"names":[],"mappings":";;;;;;;;;"} \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/underscore-node.mjs b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/underscore-node.mjs deleted file mode 100644 index da6df40f..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/underscore-node.mjs +++ /dev/null @@ -1,7 +0,0 @@ -// Underscore.js 1.13.6 -// https://underscorejs.org -// (c) 2009-2022 Jeremy Ashkenas, Julian Gonggrijp, and DocumentCloud and Investigative Reporters & Editors -// Underscore may be freely distributed under the MIT license. - -export { VERSION, after, every as all, allKeys, some as any, extendOwn as assign, before, bind, bindAll, chain, chunk, clone, map as collect, compact, compose, constant, contains, countBy, create, debounce, _ as default, defaults, defer, delay, find as detect, difference, rest as drop, each, _escape as escape, every, extend, extendOwn, filter, find, findIndex, findKey, findLastIndex, findWhere, first, flatten, reduce as foldl, reduceRight as foldr, each as forEach, functions, get, groupBy, has, first as head, identity, contains as include, contains as includes, indexBy, indexOf, initial, reduce as inject, intersection, invert, invoke, isArguments, isArray, isArrayBuffer, isBoolean, isDataView, isDate, isElement, isEmpty, isEqual, isError, isFinite, isFunction, isMap, isMatch, isNaN, isNull, isNumber, isObject, isRegExp, isSet, isString, isSymbol, isTypedArray, isUndefined, isWeakMap, isWeakSet, iteratee, keys, last, lastIndexOf, map, mapObject, matcher, matcher as matches, max, memoize, functions as methods, min, mixin, negate, noop, now, object, omit, once, pairs, partial, partition, pick, pluck, property, propertyOf, random, range, reduce, reduceRight, reject, rest, restArguments, result, sample, filter as select, shuffle, size, some, sortBy, sortedIndex, rest as tail, first as take, tap, template, templateSettings, throttle, times, toArray, toPath, unzip as transpose, _unescape as unescape, union, uniq, uniq as unique, uniqueId, unzip, values, where, without, wrap, zip } from './underscore-node-f.cjs'; -//# sourceMappingURL=underscore-node.mjs.map diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/underscore-node.mjs.map b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/underscore-node.mjs.map deleted file mode 100644 index 5d1025b9..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/underscore-node.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"underscore-node.mjs","sources":[],"sourcesContent":null,"names":[],"mappings":";;;;;"} \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/underscore-umd-min.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/underscore-umd-min.js deleted file mode 100644 index b73f16e9..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/underscore-umd-min.js +++ /dev/null @@ -1,6 +0,0 @@ -!function(n,r){"object"==typeof exports&&"undefined"!=typeof module?module.exports=r():"function"==typeof define&&define.amd?define("underscore",r):(n="undefined"!=typeof globalThis?globalThis:n||self,function(){var t=n._,e=n._=r();e.noConflict=function(){return n._=t,e}}())}(this,(function(){ -// Underscore.js 1.13.6 -// https://underscorejs.org -// (c) 2009-2022 Jeremy Ashkenas, Julian Gonggrijp, and DocumentCloud and Investigative Reporters & Editors -// Underscore may be freely distributed under the MIT license. -var n="1.13.6",r="object"==typeof self&&self.self===self&&self||"object"==typeof global&&global.global===global&&global||Function("return this")()||{},t=Array.prototype,e=Object.prototype,u="undefined"!=typeof Symbol?Symbol.prototype:null,o=t.push,i=t.slice,a=e.toString,f=e.hasOwnProperty,c="undefined"!=typeof ArrayBuffer,l="undefined"!=typeof DataView,s=Array.isArray,p=Object.keys,v=Object.create,h=c&&ArrayBuffer.isView,y=isNaN,d=isFinite,g=!{toString:null}.propertyIsEnumerable("toString"),b=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],m=Math.pow(2,53)-1;function j(n,r){return r=null==r?n.length-1:+r,function(){for(var t=Math.max(arguments.length-r,0),e=Array(t),u=0;u=0&&t<=m}}function J(n){return function(r){return null==r?void 0:r[n]}}var G=J("byteLength"),H=K(G),Q=/\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/;var X=c?function(n){return h?h(n)&&!q(n):H(n)&&Q.test(a.call(n))}:C(!1),Y=J("length");function Z(n,r){r=function(n){for(var r={},t=n.length,e=0;e":">",'"':""","'":"'","`":"`"},$n=zn(Ln),Cn=zn(_n(Ln)),Kn=tn.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g},Jn=/(.)^/,Gn={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},Hn=/\\|'|\r|\n|\u2028|\u2029/g;function Qn(n){return"\\"+Gn[n]}var Xn=/^\s*(\w|\$)+\s*$/;var Yn=0;function Zn(n,r,t,e,u){if(!(e instanceof r))return n.apply(t,u);var o=Mn(n.prototype),i=n.apply(o,u);return _(i)?i:o}var nr=j((function(n,r){var t=nr.placeholder,e=function(){for(var u=0,o=r.length,i=Array(o),a=0;a1)er(a,r-1,t,e),u=e.length;else for(var f=0,c=a.length;f0&&(t=r.apply(this,arguments)),n<=1&&(r=null),t}}var cr=nr(fr,2);function lr(n,r,t){r=Pn(r,t);for(var e,u=nn(n),o=0,i=u.length;o0?0:u-1;o>=0&&o0?a=o>=0?o:Math.max(o+f,a):f=o>=0?Math.min(o+1,f):o+f+1;else if(t&&o&&f)return e[o=t(e,u)]===u?o:-1;if(u!=u)return(o=r(i.call(e,a,f),$))>=0?o+a:-1;for(o=n>0?a:f-1;o>=0&&o0?0:i-1;for(u||(e=r[o?o[a]:a],a+=n);a>=0&&a=3;return r(n,Rn(t,u,4),e,o)}}var wr=_r(1),Ar=_r(-1);function xr(n,r,t){var e=[];return r=Pn(r,t),mr(n,(function(n,t,u){r(n,t,u)&&e.push(n)})),e}function Sr(n,r,t){r=Pn(r,t);for(var e=!tr(n)&&nn(n),u=(e||n).length,o=0;o=0}var Er=j((function(n,r,t){var e,u;return D(r)?u=r:(r=Bn(r),e=r.slice(0,-1),r=r[r.length-1]),jr(n,(function(n){var o=u;if(!o){if(e&&e.length&&(n=Nn(n,e)),null==n)return;o=n[r]}return null==o?o:o.apply(n,t)}))}));function Br(n,r){return jr(n,Dn(r))}function Nr(n,r,t){var e,u,o=-1/0,i=-1/0;if(null==r||"number"==typeof r&&"object"!=typeof n[0]&&null!=n)for(var a=0,f=(n=tr(n)?n:jn(n)).length;ao&&(o=e);else r=Pn(r,t),mr(n,(function(n,t,e){((u=r(n,t,e))>i||u===-1/0&&o===-1/0)&&(o=n,i=u)}));return o}var Ir=/[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g;function Tr(n){return n?U(n)?i.call(n):S(n)?n.match(Ir):tr(n)?jr(n,Tn):jn(n):[]}function kr(n,r,t){if(null==r||t)return tr(n)||(n=jn(n)),n[Un(n.length-1)];var e=Tr(n),u=Y(e);r=Math.max(Math.min(r,u),0);for(var o=u-1,i=0;i1&&(e=Rn(e,r[1])),r=an(n)):(e=qr,r=er(r,!1,!1),n=Object(n));for(var u=0,o=r.length;u1&&(t=r[1])):(r=jr(er(r,!1,!1),String),e=function(n,t){return!Mr(r,t)}),Ur(n,e,t)}));function zr(n,r,t){return i.call(n,0,Math.max(0,n.length-(null==r||t?1:r)))}function Lr(n,r,t){return null==n||n.length<1?null==r||t?void 0:[]:null==r||t?n[0]:zr(n,n.length-r)}function $r(n,r,t){return i.call(n,null==r||t?1:r)}var Cr=j((function(n,r){return r=er(r,!0,!0),xr(n,(function(n){return!Mr(r,n)}))})),Kr=j((function(n,r){return Cr(n,r)}));function Jr(n,r,t,e){A(r)||(e=t,t=r,r=!1),null!=t&&(t=Pn(t,e));for(var u=[],o=[],i=0,a=Y(n);ir?(e&&(clearTimeout(e),e=null),a=c,i=n.apply(u,o),e||(u=o=null)):e||!1===t.trailing||(e=setTimeout(f,l)),i};return c.cancel=function(){clearTimeout(e),a=0,e=u=o=null},c},debounce:function(n,r,t){var e,u,o,i,a,f=function(){var c=Wn()-u;r>c?e=setTimeout(f,r-c):(e=null,t||(i=n.apply(a,o)),e||(o=a=null))},c=j((function(c){return a=this,o=c,u=Wn(),e||(e=setTimeout(f,r),t&&(i=n.apply(a,o))),i}));return c.cancel=function(){clearTimeout(e),e=o=a=null},c},wrap:function(n,r){return nr(r,n)},negate:ar,compose:function(){var n=arguments,r=n.length-1;return function(){for(var t=r,e=n[r].apply(this,arguments);t--;)e=n[t].call(this,e);return e}},after:function(n,r){return function(){if(--n<1)return r.apply(this,arguments)}},before:fr,once:cr,findKey:lr,findIndex:pr,findLastIndex:vr,sortedIndex:hr,indexOf:dr,lastIndexOf:gr,find:br,detect:br,findWhere:function(n,r){return br(n,kn(r))},each:mr,forEach:mr,map:jr,collect:jr,reduce:wr,foldl:wr,inject:wr,reduceRight:Ar,foldr:Ar,filter:xr,select:xr,reject:function(n,r,t){return xr(n,ar(Pn(r)),t)},every:Sr,all:Sr,some:Or,any:Or,contains:Mr,includes:Mr,include:Mr,invoke:Er,pluck:Br,where:function(n,r){return xr(n,kn(r))},max:Nr,min:function(n,r,t){var e,u,o=1/0,i=1/0;if(null==r||"number"==typeof r&&"object"!=typeof n[0]&&null!=n)for(var a=0,f=(n=tr(n)?n:jn(n)).length;ae||void 0===t)return 1;if(t= 0 && sizeProperty <= MAX_ARRAY_INDEX; - } - } - - // Internal helper to generate a function to obtain property `key` from `obj`. - function shallowProperty(key) { - return function(obj) { - return obj == null ? void 0 : obj[key]; - }; - } - - // Internal helper to obtain the `byteLength` property of an object. - var getByteLength = shallowProperty('byteLength'); - - // Internal helper to determine whether we should spend extensive checks against - // `ArrayBuffer` et al. - var isBufferLike = createSizePropertyCheck(getByteLength); - - // Is a given value a typed array? - var typedArrayPattern = /\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/; - function isTypedArray(obj) { - // `ArrayBuffer.isView` is the most future-proof, so use it when available. - // Otherwise, fall back on the above regular expression. - return nativeIsView ? (nativeIsView(obj) && !isDataView$1(obj)) : - isBufferLike(obj) && typedArrayPattern.test(toString.call(obj)); - } - - var isTypedArray$1 = supportsArrayBuffer ? isTypedArray : constant(false); - - // Internal helper to obtain the `length` property of an object. - var getLength = shallowProperty('length'); - - // Internal helper to create a simple lookup structure. - // `collectNonEnumProps` used to depend on `_.contains`, but this led to - // circular imports. `emulatedSet` is a one-off solution that only works for - // arrays of strings. - function emulatedSet(keys) { - var hash = {}; - for (var l = keys.length, i = 0; i < l; ++i) hash[keys[i]] = true; - return { - contains: function(key) { return hash[key] === true; }, - push: function(key) { - hash[key] = true; - return keys.push(key); - } - }; - } - - // Internal helper. Checks `keys` for the presence of keys in IE < 9 that won't - // be iterated by `for key in ...` and thus missed. Extends `keys` in place if - // needed. - function collectNonEnumProps(obj, keys) { - keys = emulatedSet(keys); - var nonEnumIdx = nonEnumerableProps.length; - var constructor = obj.constructor; - var proto = (isFunction$1(constructor) && constructor.prototype) || ObjProto; - - // Constructor is a special case. - var prop = 'constructor'; - if (has$1(obj, prop) && !keys.contains(prop)) keys.push(prop); - - while (nonEnumIdx--) { - prop = nonEnumerableProps[nonEnumIdx]; - if (prop in obj && obj[prop] !== proto[prop] && !keys.contains(prop)) { - keys.push(prop); - } - } - } - - // Retrieve the names of an object's own properties. - // Delegates to **ECMAScript 5**'s native `Object.keys`. - function keys(obj) { - if (!isObject(obj)) return []; - if (nativeKeys) return nativeKeys(obj); - var keys = []; - for (var key in obj) if (has$1(obj, key)) keys.push(key); - // Ahem, IE < 9. - if (hasEnumBug) collectNonEnumProps(obj, keys); - return keys; - } - - // Is a given array, string, or object empty? - // An "empty" object has no enumerable own-properties. - function isEmpty(obj) { - if (obj == null) return true; - // Skip the more expensive `toString`-based type checks if `obj` has no - // `.length`. - var length = getLength(obj); - if (typeof length == 'number' && ( - isArray(obj) || isString(obj) || isArguments$1(obj) - )) return length === 0; - return getLength(keys(obj)) === 0; - } - - // Returns whether an object has a given set of `key:value` pairs. - function isMatch(object, attrs) { - var _keys = keys(attrs), length = _keys.length; - if (object == null) return !length; - var obj = Object(object); - for (var i = 0; i < length; i++) { - var key = _keys[i]; - if (attrs[key] !== obj[key] || !(key in obj)) return false; - } - return true; - } - - // If Underscore is called as a function, it returns a wrapped object that can - // be used OO-style. This wrapper holds altered versions of all functions added - // through `_.mixin`. Wrapped objects may be chained. - function _$1(obj) { - if (obj instanceof _$1) return obj; - if (!(this instanceof _$1)) return new _$1(obj); - this._wrapped = obj; - } - - _$1.VERSION = VERSION; - - // Extracts the result from a wrapped and chained object. - _$1.prototype.value = function() { - return this._wrapped; - }; - - // Provide unwrapping proxies for some methods used in engine operations - // such as arithmetic and JSON stringification. - _$1.prototype.valueOf = _$1.prototype.toJSON = _$1.prototype.value; - - _$1.prototype.toString = function() { - return String(this._wrapped); - }; - - // Internal function to wrap or shallow-copy an ArrayBuffer, - // typed array or DataView to a new view, reusing the buffer. - function toBufferView(bufferSource) { - return new Uint8Array( - bufferSource.buffer || bufferSource, - bufferSource.byteOffset || 0, - getByteLength(bufferSource) - ); - } - - // We use this string twice, so give it a name for minification. - var tagDataView = '[object DataView]'; - - // Internal recursive comparison function for `_.isEqual`. - function eq(a, b, aStack, bStack) { - // Identical objects are equal. `0 === -0`, but they aren't identical. - // See the [Harmony `egal` proposal](https://wiki.ecmascript.org/doku.php?id=harmony:egal). - if (a === b) return a !== 0 || 1 / a === 1 / b; - // `null` or `undefined` only equal to itself (strict comparison). - if (a == null || b == null) return false; - // `NaN`s are equivalent, but non-reflexive. - if (a !== a) return b !== b; - // Exhaust primitive checks - var type = typeof a; - if (type !== 'function' && type !== 'object' && typeof b != 'object') return false; - return deepEq(a, b, aStack, bStack); - } - - // Internal recursive comparison function for `_.isEqual`. - function deepEq(a, b, aStack, bStack) { - // Unwrap any wrapped objects. - if (a instanceof _$1) a = a._wrapped; - if (b instanceof _$1) b = b._wrapped; - // Compare `[[Class]]` names. - var className = toString.call(a); - if (className !== toString.call(b)) return false; - // Work around a bug in IE 10 - Edge 13. - if (hasStringTagBug && className == '[object Object]' && isDataView$1(a)) { - if (!isDataView$1(b)) return false; - className = tagDataView; - } - switch (className) { - // These types are compared by value. - case '[object RegExp]': - // RegExps are coerced to strings for comparison (Note: '' + /a/i === '/a/i') - case '[object String]': - // Primitives and their corresponding object wrappers are equivalent; thus, `"5"` is - // equivalent to `new String("5")`. - return '' + a === '' + b; - case '[object Number]': - // `NaN`s are equivalent, but non-reflexive. - // Object(NaN) is equivalent to NaN. - if (+a !== +a) return +b !== +b; - // An `egal` comparison is performed for other numeric values. - return +a === 0 ? 1 / +a === 1 / b : +a === +b; - case '[object Date]': - case '[object Boolean]': - // Coerce dates and booleans to numeric primitive values. Dates are compared by their - // millisecond representations. Note that invalid dates with millisecond representations - // of `NaN` are not equivalent. - return +a === +b; - case '[object Symbol]': - return SymbolProto.valueOf.call(a) === SymbolProto.valueOf.call(b); - case '[object ArrayBuffer]': - case tagDataView: - // Coerce to typed array so we can fall through. - return deepEq(toBufferView(a), toBufferView(b), aStack, bStack); - } - - var areArrays = className === '[object Array]'; - if (!areArrays && isTypedArray$1(a)) { - var byteLength = getByteLength(a); - if (byteLength !== getByteLength(b)) return false; - if (a.buffer === b.buffer && a.byteOffset === b.byteOffset) return true; - areArrays = true; - } - if (!areArrays) { - if (typeof a != 'object' || typeof b != 'object') return false; - - // Objects with different constructors are not equivalent, but `Object`s or `Array`s - // from different frames are. - var aCtor = a.constructor, bCtor = b.constructor; - if (aCtor !== bCtor && !(isFunction$1(aCtor) && aCtor instanceof aCtor && - isFunction$1(bCtor) && bCtor instanceof bCtor) - && ('constructor' in a && 'constructor' in b)) { - return false; - } - } - // Assume equality for cyclic structures. The algorithm for detecting cyclic - // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`. - - // Initializing stack of traversed objects. - // It's done here since we only need them for objects and arrays comparison. - aStack = aStack || []; - bStack = bStack || []; - var length = aStack.length; - while (length--) { - // Linear search. Performance is inversely proportional to the number of - // unique nested structures. - if (aStack[length] === a) return bStack[length] === b; - } - - // Add the first object to the stack of traversed objects. - aStack.push(a); - bStack.push(b); - - // Recursively compare objects and arrays. - if (areArrays) { - // Compare array lengths to determine if a deep comparison is necessary. - length = a.length; - if (length !== b.length) return false; - // Deep compare the contents, ignoring non-numeric properties. - while (length--) { - if (!eq(a[length], b[length], aStack, bStack)) return false; - } - } else { - // Deep compare objects. - var _keys = keys(a), key; - length = _keys.length; - // Ensure that both objects contain the same number of properties before comparing deep equality. - if (keys(b).length !== length) return false; - while (length--) { - // Deep compare each member - key = _keys[length]; - if (!(has$1(b, key) && eq(a[key], b[key], aStack, bStack))) return false; - } - } - // Remove the first object from the stack of traversed objects. - aStack.pop(); - bStack.pop(); - return true; - } - - // Perform a deep comparison to check if two objects are equal. - function isEqual(a, b) { - return eq(a, b); - } - - // Retrieve all the enumerable property names of an object. - function allKeys(obj) { - if (!isObject(obj)) return []; - var keys = []; - for (var key in obj) keys.push(key); - // Ahem, IE < 9. - if (hasEnumBug) collectNonEnumProps(obj, keys); - return keys; - } - - // Since the regular `Object.prototype.toString` type tests don't work for - // some types in IE 11, we use a fingerprinting heuristic instead, based - // on the methods. It's not great, but it's the best we got. - // The fingerprint method lists are defined below. - function ie11fingerprint(methods) { - var length = getLength(methods); - return function(obj) { - if (obj == null) return false; - // `Map`, `WeakMap` and `Set` have no enumerable keys. - var keys = allKeys(obj); - if (getLength(keys)) return false; - for (var i = 0; i < length; i++) { - if (!isFunction$1(obj[methods[i]])) return false; - } - // If we are testing against `WeakMap`, we need to ensure that - // `obj` doesn't have a `forEach` method in order to distinguish - // it from a regular `Map`. - return methods !== weakMapMethods || !isFunction$1(obj[forEachName]); - }; - } - - // In the interest of compact minification, we write - // each string in the fingerprints only once. - var forEachName = 'forEach', - hasName = 'has', - commonInit = ['clear', 'delete'], - mapTail = ['get', hasName, 'set']; - - // `Map`, `WeakMap` and `Set` each have slightly different - // combinations of the above sublists. - var mapMethods = commonInit.concat(forEachName, mapTail), - weakMapMethods = commonInit.concat(mapTail), - setMethods = ['add'].concat(commonInit, forEachName, hasName); - - var isMap = isIE11 ? ie11fingerprint(mapMethods) : tagTester('Map'); - - var isWeakMap = isIE11 ? ie11fingerprint(weakMapMethods) : tagTester('WeakMap'); - - var isSet = isIE11 ? ie11fingerprint(setMethods) : tagTester('Set'); - - var isWeakSet = tagTester('WeakSet'); - - // Retrieve the values of an object's properties. - function values(obj) { - var _keys = keys(obj); - var length = _keys.length; - var values = Array(length); - for (var i = 0; i < length; i++) { - values[i] = obj[_keys[i]]; - } - return values; - } - - // Convert an object into a list of `[key, value]` pairs. - // The opposite of `_.object` with one argument. - function pairs(obj) { - var _keys = keys(obj); - var length = _keys.length; - var pairs = Array(length); - for (var i = 0; i < length; i++) { - pairs[i] = [_keys[i], obj[_keys[i]]]; - } - return pairs; - } - - // Invert the keys and values of an object. The values must be serializable. - function invert(obj) { - var result = {}; - var _keys = keys(obj); - for (var i = 0, length = _keys.length; i < length; i++) { - result[obj[_keys[i]]] = _keys[i]; - } - return result; - } - - // Return a sorted list of the function names available on the object. - function functions(obj) { - var names = []; - for (var key in obj) { - if (isFunction$1(obj[key])) names.push(key); - } - return names.sort(); - } - - // An internal function for creating assigner functions. - function createAssigner(keysFunc, defaults) { - return function(obj) { - var length = arguments.length; - if (defaults) obj = Object(obj); - if (length < 2 || obj == null) return obj; - for (var index = 1; index < length; index++) { - var source = arguments[index], - keys = keysFunc(source), - l = keys.length; - for (var i = 0; i < l; i++) { - var key = keys[i]; - if (!defaults || obj[key] === void 0) obj[key] = source[key]; - } - } - return obj; - }; - } - - // Extend a given object with all the properties in passed-in object(s). - var extend = createAssigner(allKeys); - - // Assigns a given object with all the own properties in the passed-in - // object(s). - // (https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/assign) - var extendOwn = createAssigner(keys); - - // Fill in a given object with default properties. - var defaults = createAssigner(allKeys, true); - - // Create a naked function reference for surrogate-prototype-swapping. - function ctor() { - return function(){}; - } - - // An internal function for creating a new object that inherits from another. - function baseCreate(prototype) { - if (!isObject(prototype)) return {}; - if (nativeCreate) return nativeCreate(prototype); - var Ctor = ctor(); - Ctor.prototype = prototype; - var result = new Ctor; - Ctor.prototype = null; - return result; - } - - // Creates an object that inherits from the given prototype object. - // If additional properties are provided then they will be added to the - // created object. - function create(prototype, props) { - var result = baseCreate(prototype); - if (props) extendOwn(result, props); - return result; - } - - // Create a (shallow-cloned) duplicate of an object. - function clone(obj) { - if (!isObject(obj)) return obj; - return isArray(obj) ? obj.slice() : extend({}, obj); - } - - // Invokes `interceptor` with the `obj` and then returns `obj`. - // The primary purpose of this method is to "tap into" a method chain, in - // order to perform operations on intermediate results within the chain. - function tap(obj, interceptor) { - interceptor(obj); - return obj; - } - - // Normalize a (deep) property `path` to array. - // Like `_.iteratee`, this function can be customized. - function toPath$1(path) { - return isArray(path) ? path : [path]; - } - _$1.toPath = toPath$1; - - // Internal wrapper for `_.toPath` to enable minification. - // Similar to `cb` for `_.iteratee`. - function toPath(path) { - return _$1.toPath(path); - } - - // Internal function to obtain a nested property in `obj` along `path`. - function deepGet(obj, path) { - var length = path.length; - for (var i = 0; i < length; i++) { - if (obj == null) return void 0; - obj = obj[path[i]]; - } - return length ? obj : void 0; - } - - // Get the value of the (deep) property on `path` from `object`. - // If any property in `path` does not exist or if the value is - // `undefined`, return `defaultValue` instead. - // The `path` is normalized through `_.toPath`. - function get(object, path, defaultValue) { - var value = deepGet(object, toPath(path)); - return isUndefined(value) ? defaultValue : value; - } - - // Shortcut function for checking if an object has a given property directly on - // itself (in other words, not on a prototype). Unlike the internal `has` - // function, this public version can also traverse nested properties. - function has(obj, path) { - path = toPath(path); - var length = path.length; - for (var i = 0; i < length; i++) { - var key = path[i]; - if (!has$1(obj, key)) return false; - obj = obj[key]; - } - return !!length; - } - - // Keep the identity function around for default iteratees. - function identity(value) { - return value; - } - - // Returns a predicate for checking whether an object has a given set of - // `key:value` pairs. - function matcher(attrs) { - attrs = extendOwn({}, attrs); - return function(obj) { - return isMatch(obj, attrs); - }; - } - - // Creates a function that, when passed an object, will traverse that object’s - // properties down the given `path`, specified as an array of keys or indices. - function property(path) { - path = toPath(path); - return function(obj) { - return deepGet(obj, path); - }; - } - - // Internal function that returns an efficient (for current engines) version - // of the passed-in callback, to be repeatedly applied in other Underscore - // functions. - function optimizeCb(func, context, argCount) { - if (context === void 0) return func; - switch (argCount == null ? 3 : argCount) { - case 1: return function(value) { - return func.call(context, value); - }; - // The 2-argument case is omitted because we’re not using it. - case 3: return function(value, index, collection) { - return func.call(context, value, index, collection); - }; - case 4: return function(accumulator, value, index, collection) { - return func.call(context, accumulator, value, index, collection); - }; - } - return function() { - return func.apply(context, arguments); - }; - } - - // An internal function to generate callbacks that can be applied to each - // element in a collection, returning the desired result — either `_.identity`, - // an arbitrary callback, a property matcher, or a property accessor. - function baseIteratee(value, context, argCount) { - if (value == null) return identity; - if (isFunction$1(value)) return optimizeCb(value, context, argCount); - if (isObject(value) && !isArray(value)) return matcher(value); - return property(value); - } - - // External wrapper for our callback generator. Users may customize - // `_.iteratee` if they want additional predicate/iteratee shorthand styles. - // This abstraction hides the internal-only `argCount` argument. - function iteratee(value, context) { - return baseIteratee(value, context, Infinity); - } - _$1.iteratee = iteratee; - - // The function we call internally to generate a callback. It invokes - // `_.iteratee` if overridden, otherwise `baseIteratee`. - function cb(value, context, argCount) { - if (_$1.iteratee !== iteratee) return _$1.iteratee(value, context); - return baseIteratee(value, context, argCount); - } - - // Returns the results of applying the `iteratee` to each element of `obj`. - // In contrast to `_.map` it returns an object. - function mapObject(obj, iteratee, context) { - iteratee = cb(iteratee, context); - var _keys = keys(obj), - length = _keys.length, - results = {}; - for (var index = 0; index < length; index++) { - var currentKey = _keys[index]; - results[currentKey] = iteratee(obj[currentKey], currentKey, obj); - } - return results; - } - - // Predicate-generating function. Often useful outside of Underscore. - function noop(){} - - // Generates a function for a given object that returns a given property. - function propertyOf(obj) { - if (obj == null) return noop; - return function(path) { - return get(obj, path); - }; - } - - // Run a function **n** times. - function times(n, iteratee, context) { - var accum = Array(Math.max(0, n)); - iteratee = optimizeCb(iteratee, context, 1); - for (var i = 0; i < n; i++) accum[i] = iteratee(i); - return accum; - } - - // Return a random integer between `min` and `max` (inclusive). - function random(min, max) { - if (max == null) { - max = min; - min = 0; - } - return min + Math.floor(Math.random() * (max - min + 1)); - } - - // A (possibly faster) way to get the current timestamp as an integer. - var now = Date.now || function() { - return new Date().getTime(); - }; - - // Internal helper to generate functions for escaping and unescaping strings - // to/from HTML interpolation. - function createEscaper(map) { - var escaper = function(match) { - return map[match]; - }; - // Regexes for identifying a key that needs to be escaped. - var source = '(?:' + keys(map).join('|') + ')'; - var testRegexp = RegExp(source); - var replaceRegexp = RegExp(source, 'g'); - return function(string) { - string = string == null ? '' : '' + string; - return testRegexp.test(string) ? string.replace(replaceRegexp, escaper) : string; - }; - } - - // Internal list of HTML entities for escaping. - var escapeMap = { - '&': '&', - '<': '<', - '>': '>', - '"': '"', - "'": ''', - '`': '`' - }; - - // Function for escaping strings to HTML interpolation. - var _escape = createEscaper(escapeMap); - - // Internal list of HTML entities for unescaping. - var unescapeMap = invert(escapeMap); - - // Function for unescaping strings from HTML interpolation. - var _unescape = createEscaper(unescapeMap); - - // By default, Underscore uses ERB-style template delimiters. Change the - // following template settings to use alternative delimiters. - var templateSettings = _$1.templateSettings = { - evaluate: /<%([\s\S]+?)%>/g, - interpolate: /<%=([\s\S]+?)%>/g, - escape: /<%-([\s\S]+?)%>/g - }; - - // When customizing `_.templateSettings`, if you don't want to define an - // interpolation, evaluation or escaping regex, we need one that is - // guaranteed not to match. - var noMatch = /(.)^/; - - // Certain characters need to be escaped so that they can be put into a - // string literal. - var escapes = { - "'": "'", - '\\': '\\', - '\r': 'r', - '\n': 'n', - '\u2028': 'u2028', - '\u2029': 'u2029' - }; - - var escapeRegExp = /\\|'|\r|\n|\u2028|\u2029/g; - - function escapeChar(match) { - return '\\' + escapes[match]; - } - - // In order to prevent third-party code injection through - // `_.templateSettings.variable`, we test it against the following regular - // expression. It is intentionally a bit more liberal than just matching valid - // identifiers, but still prevents possible loopholes through defaults or - // destructuring assignment. - var bareIdentifier = /^\s*(\w|\$)+\s*$/; - - // JavaScript micro-templating, similar to John Resig's implementation. - // Underscore templating handles arbitrary delimiters, preserves whitespace, - // and correctly escapes quotes within interpolated code. - // NB: `oldSettings` only exists for backwards compatibility. - function template(text, settings, oldSettings) { - if (!settings && oldSettings) settings = oldSettings; - settings = defaults({}, settings, _$1.templateSettings); - - // Combine delimiters into one regular expression via alternation. - var matcher = RegExp([ - (settings.escape || noMatch).source, - (settings.interpolate || noMatch).source, - (settings.evaluate || noMatch).source - ].join('|') + '|$', 'g'); - - // Compile the template source, escaping string literals appropriately. - var index = 0; - var source = "__p+='"; - text.replace(matcher, function(match, escape, interpolate, evaluate, offset) { - source += text.slice(index, offset).replace(escapeRegExp, escapeChar); - index = offset + match.length; - - if (escape) { - source += "'+\n((__t=(" + escape + "))==null?'':_.escape(__t))+\n'"; - } else if (interpolate) { - source += "'+\n((__t=(" + interpolate + "))==null?'':__t)+\n'"; - } else if (evaluate) { - source += "';\n" + evaluate + "\n__p+='"; - } - - // Adobe VMs need the match returned to produce the correct offset. - return match; - }); - source += "';\n"; - - var argument = settings.variable; - if (argument) { - // Insure against third-party code injection. (CVE-2021-23358) - if (!bareIdentifier.test(argument)) throw new Error( - 'variable is not a bare identifier: ' + argument - ); - } else { - // If a variable is not specified, place data values in local scope. - source = 'with(obj||{}){\n' + source + '}\n'; - argument = 'obj'; - } - - source = "var __t,__p='',__j=Array.prototype.join," + - "print=function(){__p+=__j.call(arguments,'');};\n" + - source + 'return __p;\n'; - - var render; - try { - render = new Function(argument, '_', source); - } catch (e) { - e.source = source; - throw e; - } - - var template = function(data) { - return render.call(this, data, _$1); - }; - - // Provide the compiled source as a convenience for precompilation. - template.source = 'function(' + argument + '){\n' + source + '}'; - - return template; - } - - // Traverses the children of `obj` along `path`. If a child is a function, it - // is invoked with its parent as context. Returns the value of the final - // child, or `fallback` if any child is undefined. - function result(obj, path, fallback) { - path = toPath(path); - var length = path.length; - if (!length) { - return isFunction$1(fallback) ? fallback.call(obj) : fallback; - } - for (var i = 0; i < length; i++) { - var prop = obj == null ? void 0 : obj[path[i]]; - if (prop === void 0) { - prop = fallback; - i = length; // Ensure we don't continue iterating. - } - obj = isFunction$1(prop) ? prop.call(obj) : prop; - } - return obj; - } - - // Generate a unique integer id (unique within the entire client session). - // Useful for temporary DOM ids. - var idCounter = 0; - function uniqueId(prefix) { - var id = ++idCounter + ''; - return prefix ? prefix + id : id; - } - - // Start chaining a wrapped Underscore object. - function chain(obj) { - var instance = _$1(obj); - instance._chain = true; - return instance; - } - - // Internal function to execute `sourceFunc` bound to `context` with optional - // `args`. Determines whether to execute a function as a constructor or as a - // normal function. - function executeBound(sourceFunc, boundFunc, context, callingContext, args) { - if (!(callingContext instanceof boundFunc)) return sourceFunc.apply(context, args); - var self = baseCreate(sourceFunc.prototype); - var result = sourceFunc.apply(self, args); - if (isObject(result)) return result; - return self; - } - - // Partially apply a function by creating a version that has had some of its - // arguments pre-filled, without changing its dynamic `this` context. `_` acts - // as a placeholder by default, allowing any combination of arguments to be - // pre-filled. Set `_.partial.placeholder` for a custom placeholder argument. - var partial = restArguments(function(func, boundArgs) { - var placeholder = partial.placeholder; - var bound = function() { - var position = 0, length = boundArgs.length; - var args = Array(length); - for (var i = 0; i < length; i++) { - args[i] = boundArgs[i] === placeholder ? arguments[position++] : boundArgs[i]; - } - while (position < arguments.length) args.push(arguments[position++]); - return executeBound(func, bound, this, this, args); - }; - return bound; - }); - - partial.placeholder = _$1; - - // Create a function bound to a given object (assigning `this`, and arguments, - // optionally). - var bind = restArguments(function(func, context, args) { - if (!isFunction$1(func)) throw new TypeError('Bind must be called on a function'); - var bound = restArguments(function(callArgs) { - return executeBound(func, bound, context, this, args.concat(callArgs)); - }); - return bound; - }); - - // Internal helper for collection methods to determine whether a collection - // should be iterated as an array or as an object. - // Related: https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength - // Avoids a very nasty iOS 8 JIT bug on ARM-64. #2094 - var isArrayLike = createSizePropertyCheck(getLength); - - // Internal implementation of a recursive `flatten` function. - function flatten$1(input, depth, strict, output) { - output = output || []; - if (!depth && depth !== 0) { - depth = Infinity; - } else if (depth <= 0) { - return output.concat(input); - } - var idx = output.length; - for (var i = 0, length = getLength(input); i < length; i++) { - var value = input[i]; - if (isArrayLike(value) && (isArray(value) || isArguments$1(value))) { - // Flatten current level of array or arguments object. - if (depth > 1) { - flatten$1(value, depth - 1, strict, output); - idx = output.length; - } else { - var j = 0, len = value.length; - while (j < len) output[idx++] = value[j++]; - } - } else if (!strict) { - output[idx++] = value; - } - } - return output; - } - - // Bind a number of an object's methods to that object. Remaining arguments - // are the method names to be bound. Useful for ensuring that all callbacks - // defined on an object belong to it. - var bindAll = restArguments(function(obj, keys) { - keys = flatten$1(keys, false, false); - var index = keys.length; - if (index < 1) throw new Error('bindAll must be passed function names'); - while (index--) { - var key = keys[index]; - obj[key] = bind(obj[key], obj); - } - return obj; - }); - - // Memoize an expensive function by storing its results. - function memoize(func, hasher) { - var memoize = function(key) { - var cache = memoize.cache; - var address = '' + (hasher ? hasher.apply(this, arguments) : key); - if (!has$1(cache, address)) cache[address] = func.apply(this, arguments); - return cache[address]; - }; - memoize.cache = {}; - return memoize; - } - - // Delays a function for the given number of milliseconds, and then calls - // it with the arguments supplied. - var delay = restArguments(function(func, wait, args) { - return setTimeout(function() { - return func.apply(null, args); - }, wait); - }); - - // Defers a function, scheduling it to run after the current call stack has - // cleared. - var defer = partial(delay, _$1, 1); - - // Returns a function, that, when invoked, will only be triggered at most once - // during a given window of time. Normally, the throttled function will run - // as much as it can, without ever going more than once per `wait` duration; - // but if you'd like to disable the execution on the leading edge, pass - // `{leading: false}`. To disable execution on the trailing edge, ditto. - function throttle(func, wait, options) { - var timeout, context, args, result; - var previous = 0; - if (!options) options = {}; - - var later = function() { - previous = options.leading === false ? 0 : now(); - timeout = null; - result = func.apply(context, args); - if (!timeout) context = args = null; - }; - - var throttled = function() { - var _now = now(); - if (!previous && options.leading === false) previous = _now; - var remaining = wait - (_now - previous); - context = this; - args = arguments; - if (remaining <= 0 || remaining > wait) { - if (timeout) { - clearTimeout(timeout); - timeout = null; - } - previous = _now; - result = func.apply(context, args); - if (!timeout) context = args = null; - } else if (!timeout && options.trailing !== false) { - timeout = setTimeout(later, remaining); - } - return result; - }; - - throttled.cancel = function() { - clearTimeout(timeout); - previous = 0; - timeout = context = args = null; - }; - - return throttled; - } - - // When a sequence of calls of the returned function ends, the argument - // function is triggered. The end of a sequence is defined by the `wait` - // parameter. If `immediate` is passed, the argument function will be - // triggered at the beginning of the sequence instead of at the end. - function debounce(func, wait, immediate) { - var timeout, previous, args, result, context; - - var later = function() { - var passed = now() - previous; - if (wait > passed) { - timeout = setTimeout(later, wait - passed); - } else { - timeout = null; - if (!immediate) result = func.apply(context, args); - // This check is needed because `func` can recursively invoke `debounced`. - if (!timeout) args = context = null; - } - }; - - var debounced = restArguments(function(_args) { - context = this; - args = _args; - previous = now(); - if (!timeout) { - timeout = setTimeout(later, wait); - if (immediate) result = func.apply(context, args); - } - return result; - }); - - debounced.cancel = function() { - clearTimeout(timeout); - timeout = args = context = null; - }; - - return debounced; - } - - // Returns the first function passed as an argument to the second, - // allowing you to adjust arguments, run code before and after, and - // conditionally execute the original function. - function wrap(func, wrapper) { - return partial(wrapper, func); - } - - // Returns a negated version of the passed-in predicate. - function negate(predicate) { - return function() { - return !predicate.apply(this, arguments); - }; - } - - // Returns a function that is the composition of a list of functions, each - // consuming the return value of the function that follows. - function compose() { - var args = arguments; - var start = args.length - 1; - return function() { - var i = start; - var result = args[start].apply(this, arguments); - while (i--) result = args[i].call(this, result); - return result; - }; - } - - // Returns a function that will only be executed on and after the Nth call. - function after(times, func) { - return function() { - if (--times < 1) { - return func.apply(this, arguments); - } - }; - } - - // Returns a function that will only be executed up to (but not including) the - // Nth call. - function before(times, func) { - var memo; - return function() { - if (--times > 0) { - memo = func.apply(this, arguments); - } - if (times <= 1) func = null; - return memo; - }; - } - - // Returns a function that will be executed at most one time, no matter how - // often you call it. Useful for lazy initialization. - var once = partial(before, 2); - - // Returns the first key on an object that passes a truth test. - function findKey(obj, predicate, context) { - predicate = cb(predicate, context); - var _keys = keys(obj), key; - for (var i = 0, length = _keys.length; i < length; i++) { - key = _keys[i]; - if (predicate(obj[key], key, obj)) return key; - } - } - - // Internal function to generate `_.findIndex` and `_.findLastIndex`. - function createPredicateIndexFinder(dir) { - return function(array, predicate, context) { - predicate = cb(predicate, context); - var length = getLength(array); - var index = dir > 0 ? 0 : length - 1; - for (; index >= 0 && index < length; index += dir) { - if (predicate(array[index], index, array)) return index; - } - return -1; - }; - } - - // Returns the first index on an array-like that passes a truth test. - var findIndex = createPredicateIndexFinder(1); - - // Returns the last index on an array-like that passes a truth test. - var findLastIndex = createPredicateIndexFinder(-1); - - // Use a comparator function to figure out the smallest index at which - // an object should be inserted so as to maintain order. Uses binary search. - function sortedIndex(array, obj, iteratee, context) { - iteratee = cb(iteratee, context, 1); - var value = iteratee(obj); - var low = 0, high = getLength(array); - while (low < high) { - var mid = Math.floor((low + high) / 2); - if (iteratee(array[mid]) < value) low = mid + 1; else high = mid; - } - return low; - } - - // Internal function to generate the `_.indexOf` and `_.lastIndexOf` functions. - function createIndexFinder(dir, predicateFind, sortedIndex) { - return function(array, item, idx) { - var i = 0, length = getLength(array); - if (typeof idx == 'number') { - if (dir > 0) { - i = idx >= 0 ? idx : Math.max(idx + length, i); - } else { - length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1; - } - } else if (sortedIndex && idx && length) { - idx = sortedIndex(array, item); - return array[idx] === item ? idx : -1; - } - if (item !== item) { - idx = predicateFind(slice.call(array, i, length), isNaN$1); - return idx >= 0 ? idx + i : -1; - } - for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) { - if (array[idx] === item) return idx; - } - return -1; - }; - } - - // Return the position of the first occurrence of an item in an array, - // or -1 if the item is not included in the array. - // If the array is large and already in sort order, pass `true` - // for **isSorted** to use binary search. - var indexOf = createIndexFinder(1, findIndex, sortedIndex); - - // Return the position of the last occurrence of an item in an array, - // or -1 if the item is not included in the array. - var lastIndexOf = createIndexFinder(-1, findLastIndex); - - // Return the first value which passes a truth test. - function find(obj, predicate, context) { - var keyFinder = isArrayLike(obj) ? findIndex : findKey; - var key = keyFinder(obj, predicate, context); - if (key !== void 0 && key !== -1) return obj[key]; - } - - // Convenience version of a common use case of `_.find`: getting the first - // object containing specific `key:value` pairs. - function findWhere(obj, attrs) { - return find(obj, matcher(attrs)); - } - - // The cornerstone for collection functions, an `each` - // implementation, aka `forEach`. - // Handles raw objects in addition to array-likes. Treats all - // sparse array-likes as if they were dense. - function each(obj, iteratee, context) { - iteratee = optimizeCb(iteratee, context); - var i, length; - if (isArrayLike(obj)) { - for (i = 0, length = obj.length; i < length; i++) { - iteratee(obj[i], i, obj); - } - } else { - var _keys = keys(obj); - for (i = 0, length = _keys.length; i < length; i++) { - iteratee(obj[_keys[i]], _keys[i], obj); - } - } - return obj; - } - - // Return the results of applying the iteratee to each element. - function map(obj, iteratee, context) { - iteratee = cb(iteratee, context); - var _keys = !isArrayLike(obj) && keys(obj), - length = (_keys || obj).length, - results = Array(length); - for (var index = 0; index < length; index++) { - var currentKey = _keys ? _keys[index] : index; - results[index] = iteratee(obj[currentKey], currentKey, obj); - } - return results; - } - - // Internal helper to create a reducing function, iterating left or right. - function createReduce(dir) { - // Wrap code that reassigns argument variables in a separate function than - // the one that accesses `arguments.length` to avoid a perf hit. (#1991) - var reducer = function(obj, iteratee, memo, initial) { - var _keys = !isArrayLike(obj) && keys(obj), - length = (_keys || obj).length, - index = dir > 0 ? 0 : length - 1; - if (!initial) { - memo = obj[_keys ? _keys[index] : index]; - index += dir; - } - for (; index >= 0 && index < length; index += dir) { - var currentKey = _keys ? _keys[index] : index; - memo = iteratee(memo, obj[currentKey], currentKey, obj); - } - return memo; - }; - - return function(obj, iteratee, memo, context) { - var initial = arguments.length >= 3; - return reducer(obj, optimizeCb(iteratee, context, 4), memo, initial); - }; - } - - // **Reduce** builds up a single result from a list of values, aka `inject`, - // or `foldl`. - var reduce = createReduce(1); - - // The right-associative version of reduce, also known as `foldr`. - var reduceRight = createReduce(-1); - - // Return all the elements that pass a truth test. - function filter(obj, predicate, context) { - var results = []; - predicate = cb(predicate, context); - each(obj, function(value, index, list) { - if (predicate(value, index, list)) results.push(value); - }); - return results; - } - - // Return all the elements for which a truth test fails. - function reject(obj, predicate, context) { - return filter(obj, negate(cb(predicate)), context); - } - - // Determine whether all of the elements pass a truth test. - function every(obj, predicate, context) { - predicate = cb(predicate, context); - var _keys = !isArrayLike(obj) && keys(obj), - length = (_keys || obj).length; - for (var index = 0; index < length; index++) { - var currentKey = _keys ? _keys[index] : index; - if (!predicate(obj[currentKey], currentKey, obj)) return false; - } - return true; - } - - // Determine if at least one element in the object passes a truth test. - function some(obj, predicate, context) { - predicate = cb(predicate, context); - var _keys = !isArrayLike(obj) && keys(obj), - length = (_keys || obj).length; - for (var index = 0; index < length; index++) { - var currentKey = _keys ? _keys[index] : index; - if (predicate(obj[currentKey], currentKey, obj)) return true; - } - return false; - } - - // Determine if the array or object contains a given item (using `===`). - function contains(obj, item, fromIndex, guard) { - if (!isArrayLike(obj)) obj = values(obj); - if (typeof fromIndex != 'number' || guard) fromIndex = 0; - return indexOf(obj, item, fromIndex) >= 0; - } - - // Invoke a method (with arguments) on every item in a collection. - var invoke = restArguments(function(obj, path, args) { - var contextPath, func; - if (isFunction$1(path)) { - func = path; - } else { - path = toPath(path); - contextPath = path.slice(0, -1); - path = path[path.length - 1]; - } - return map(obj, function(context) { - var method = func; - if (!method) { - if (contextPath && contextPath.length) { - context = deepGet(context, contextPath); - } - if (context == null) return void 0; - method = context[path]; - } - return method == null ? method : method.apply(context, args); - }); - }); - - // Convenience version of a common use case of `_.map`: fetching a property. - function pluck(obj, key) { - return map(obj, property(key)); - } - - // Convenience version of a common use case of `_.filter`: selecting only - // objects containing specific `key:value` pairs. - function where(obj, attrs) { - return filter(obj, matcher(attrs)); - } - - // Return the maximum element (or element-based computation). - function max(obj, iteratee, context) { - var result = -Infinity, lastComputed = -Infinity, - value, computed; - if (iteratee == null || (typeof iteratee == 'number' && typeof obj[0] != 'object' && obj != null)) { - obj = isArrayLike(obj) ? obj : values(obj); - for (var i = 0, length = obj.length; i < length; i++) { - value = obj[i]; - if (value != null && value > result) { - result = value; - } - } - } else { - iteratee = cb(iteratee, context); - each(obj, function(v, index, list) { - computed = iteratee(v, index, list); - if (computed > lastComputed || (computed === -Infinity && result === -Infinity)) { - result = v; - lastComputed = computed; - } - }); - } - return result; - } - - // Return the minimum element (or element-based computation). - function min(obj, iteratee, context) { - var result = Infinity, lastComputed = Infinity, - value, computed; - if (iteratee == null || (typeof iteratee == 'number' && typeof obj[0] != 'object' && obj != null)) { - obj = isArrayLike(obj) ? obj : values(obj); - for (var i = 0, length = obj.length; i < length; i++) { - value = obj[i]; - if (value != null && value < result) { - result = value; - } - } - } else { - iteratee = cb(iteratee, context); - each(obj, function(v, index, list) { - computed = iteratee(v, index, list); - if (computed < lastComputed || (computed === Infinity && result === Infinity)) { - result = v; - lastComputed = computed; - } - }); - } - return result; - } - - // Safely create a real, live array from anything iterable. - var reStrSymbol = /[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g; - function toArray(obj) { - if (!obj) return []; - if (isArray(obj)) return slice.call(obj); - if (isString(obj)) { - // Keep surrogate pair characters together. - return obj.match(reStrSymbol); - } - if (isArrayLike(obj)) return map(obj, identity); - return values(obj); - } - - // Sample **n** random values from a collection using the modern version of the - // [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher–Yates_shuffle). - // If **n** is not specified, returns a single random element. - // The internal `guard` argument allows it to work with `_.map`. - function sample(obj, n, guard) { - if (n == null || guard) { - if (!isArrayLike(obj)) obj = values(obj); - return obj[random(obj.length - 1)]; - } - var sample = toArray(obj); - var length = getLength(sample); - n = Math.max(Math.min(n, length), 0); - var last = length - 1; - for (var index = 0; index < n; index++) { - var rand = random(index, last); - var temp = sample[index]; - sample[index] = sample[rand]; - sample[rand] = temp; - } - return sample.slice(0, n); - } - - // Shuffle a collection. - function shuffle(obj) { - return sample(obj, Infinity); - } - - // Sort the object's values by a criterion produced by an iteratee. - function sortBy(obj, iteratee, context) { - var index = 0; - iteratee = cb(iteratee, context); - return pluck(map(obj, function(value, key, list) { - return { - value: value, - index: index++, - criteria: iteratee(value, key, list) - }; - }).sort(function(left, right) { - var a = left.criteria; - var b = right.criteria; - if (a !== b) { - if (a > b || a === void 0) return 1; - if (a < b || b === void 0) return -1; - } - return left.index - right.index; - }), 'value'); - } - - // An internal function used for aggregate "group by" operations. - function group(behavior, partition) { - return function(obj, iteratee, context) { - var result = partition ? [[], []] : {}; - iteratee = cb(iteratee, context); - each(obj, function(value, index) { - var key = iteratee(value, index, obj); - behavior(result, value, key); - }); - return result; - }; - } - - // Groups the object's values by a criterion. Pass either a string attribute - // to group by, or a function that returns the criterion. - var groupBy = group(function(result, value, key) { - if (has$1(result, key)) result[key].push(value); else result[key] = [value]; - }); - - // Indexes the object's values by a criterion, similar to `_.groupBy`, but for - // when you know that your index values will be unique. - var indexBy = group(function(result, value, key) { - result[key] = value; - }); - - // Counts instances of an object that group by a certain criterion. Pass - // either a string attribute to count by, or a function that returns the - // criterion. - var countBy = group(function(result, value, key) { - if (has$1(result, key)) result[key]++; else result[key] = 1; - }); - - // Split a collection into two arrays: one whose elements all pass the given - // truth test, and one whose elements all do not pass the truth test. - var partition = group(function(result, value, pass) { - result[pass ? 0 : 1].push(value); - }, true); - - // Return the number of elements in a collection. - function size(obj) { - if (obj == null) return 0; - return isArrayLike(obj) ? obj.length : keys(obj).length; - } - - // Internal `_.pick` helper function to determine whether `key` is an enumerable - // property name of `obj`. - function keyInObj(value, key, obj) { - return key in obj; - } - - // Return a copy of the object only containing the allowed properties. - var pick = restArguments(function(obj, keys) { - var result = {}, iteratee = keys[0]; - if (obj == null) return result; - if (isFunction$1(iteratee)) { - if (keys.length > 1) iteratee = optimizeCb(iteratee, keys[1]); - keys = allKeys(obj); - } else { - iteratee = keyInObj; - keys = flatten$1(keys, false, false); - obj = Object(obj); - } - for (var i = 0, length = keys.length; i < length; i++) { - var key = keys[i]; - var value = obj[key]; - if (iteratee(value, key, obj)) result[key] = value; - } - return result; - }); - - // Return a copy of the object without the disallowed properties. - var omit = restArguments(function(obj, keys) { - var iteratee = keys[0], context; - if (isFunction$1(iteratee)) { - iteratee = negate(iteratee); - if (keys.length > 1) context = keys[1]; - } else { - keys = map(flatten$1(keys, false, false), String); - iteratee = function(value, key) { - return !contains(keys, key); - }; - } - return pick(obj, iteratee, context); - }); - - // Returns everything but the last entry of the array. Especially useful on - // the arguments object. Passing **n** will return all the values in - // the array, excluding the last N. - function initial(array, n, guard) { - return slice.call(array, 0, Math.max(0, array.length - (n == null || guard ? 1 : n))); - } - - // Get the first element of an array. Passing **n** will return the first N - // values in the array. The **guard** check allows it to work with `_.map`. - function first(array, n, guard) { - if (array == null || array.length < 1) return n == null || guard ? void 0 : []; - if (n == null || guard) return array[0]; - return initial(array, array.length - n); - } - - // Returns everything but the first entry of the `array`. Especially useful on - // the `arguments` object. Passing an **n** will return the rest N values in the - // `array`. - function rest(array, n, guard) { - return slice.call(array, n == null || guard ? 1 : n); - } - - // Get the last element of an array. Passing **n** will return the last N - // values in the array. - function last(array, n, guard) { - if (array == null || array.length < 1) return n == null || guard ? void 0 : []; - if (n == null || guard) return array[array.length - 1]; - return rest(array, Math.max(0, array.length - n)); - } - - // Trim out all falsy values from an array. - function compact(array) { - return filter(array, Boolean); - } - - // Flatten out an array, either recursively (by default), or up to `depth`. - // Passing `true` or `false` as `depth` means `1` or `Infinity`, respectively. - function flatten(array, depth) { - return flatten$1(array, depth, false); - } - - // Take the difference between one array and a number of other arrays. - // Only the elements present in just the first array will remain. - var difference = restArguments(function(array, rest) { - rest = flatten$1(rest, true, true); - return filter(array, function(value){ - return !contains(rest, value); - }); - }); - - // Return a version of the array that does not contain the specified value(s). - var without = restArguments(function(array, otherArrays) { - return difference(array, otherArrays); - }); - - // Produce a duplicate-free version of the array. If the array has already - // been sorted, you have the option of using a faster algorithm. - // The faster algorithm will not work with an iteratee if the iteratee - // is not a one-to-one function, so providing an iteratee will disable - // the faster algorithm. - function uniq(array, isSorted, iteratee, context) { - if (!isBoolean(isSorted)) { - context = iteratee; - iteratee = isSorted; - isSorted = false; - } - if (iteratee != null) iteratee = cb(iteratee, context); - var result = []; - var seen = []; - for (var i = 0, length = getLength(array); i < length; i++) { - var value = array[i], - computed = iteratee ? iteratee(value, i, array) : value; - if (isSorted && !iteratee) { - if (!i || seen !== computed) result.push(value); - seen = computed; - } else if (iteratee) { - if (!contains(seen, computed)) { - seen.push(computed); - result.push(value); - } - } else if (!contains(result, value)) { - result.push(value); - } - } - return result; - } - - // Produce an array that contains the union: each distinct element from all of - // the passed-in arrays. - var union = restArguments(function(arrays) { - return uniq(flatten$1(arrays, true, true)); - }); - - // Produce an array that contains every item shared between all the - // passed-in arrays. - function intersection(array) { - var result = []; - var argsLength = arguments.length; - for (var i = 0, length = getLength(array); i < length; i++) { - var item = array[i]; - if (contains(result, item)) continue; - var j; - for (j = 1; j < argsLength; j++) { - if (!contains(arguments[j], item)) break; - } - if (j === argsLength) result.push(item); - } - return result; - } - - // Complement of zip. Unzip accepts an array of arrays and groups - // each array's elements on shared indices. - function unzip(array) { - var length = (array && max(array, getLength).length) || 0; - var result = Array(length); - - for (var index = 0; index < length; index++) { - result[index] = pluck(array, index); - } - return result; - } - - // Zip together multiple lists into a single array -- elements that share - // an index go together. - var zip = restArguments(unzip); - - // Converts lists into objects. Pass either a single array of `[key, value]` - // pairs, or two parallel arrays of the same length -- one of keys, and one of - // the corresponding values. Passing by pairs is the reverse of `_.pairs`. - function object(list, values) { - var result = {}; - for (var i = 0, length = getLength(list); i < length; i++) { - if (values) { - result[list[i]] = values[i]; - } else { - result[list[i][0]] = list[i][1]; - } - } - return result; - } - - // Generate an integer Array containing an arithmetic progression. A port of - // the native Python `range()` function. See - // [the Python documentation](https://docs.python.org/library/functions.html#range). - function range(start, stop, step) { - if (stop == null) { - stop = start || 0; - start = 0; - } - if (!step) { - step = stop < start ? -1 : 1; - } - - var length = Math.max(Math.ceil((stop - start) / step), 0); - var range = Array(length); - - for (var idx = 0; idx < length; idx++, start += step) { - range[idx] = start; - } - - return range; - } - - // Chunk a single array into multiple arrays, each containing `count` or fewer - // items. - function chunk(array, count) { - if (count == null || count < 1) return []; - var result = []; - var i = 0, length = array.length; - while (i < length) { - result.push(slice.call(array, i, i += count)); - } - return result; - } - - // Helper function to continue chaining intermediate results. - function chainResult(instance, obj) { - return instance._chain ? _$1(obj).chain() : obj; - } - - // Add your own custom functions to the Underscore object. - function mixin(obj) { - each(functions(obj), function(name) { - var func = _$1[name] = obj[name]; - _$1.prototype[name] = function() { - var args = [this._wrapped]; - push.apply(args, arguments); - return chainResult(this, func.apply(_$1, args)); - }; - }); - return _$1; - } - - // Add all mutator `Array` functions to the wrapper. - each(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(name) { - var method = ArrayProto[name]; - _$1.prototype[name] = function() { - var obj = this._wrapped; - if (obj != null) { - method.apply(obj, arguments); - if ((name === 'shift' || name === 'splice') && obj.length === 0) { - delete obj[0]; - } - } - return chainResult(this, obj); - }; - }); - - // Add all accessor `Array` functions to the wrapper. - each(['concat', 'join', 'slice'], function(name) { - var method = ArrayProto[name]; - _$1.prototype[name] = function() { - var obj = this._wrapped; - if (obj != null) obj = method.apply(obj, arguments); - return chainResult(this, obj); - }; - }); - - // Named Exports - - var allExports = { - __proto__: null, - VERSION: VERSION, - restArguments: restArguments, - isObject: isObject, - isNull: isNull, - isUndefined: isUndefined, - isBoolean: isBoolean, - isElement: isElement, - isString: isString, - isNumber: isNumber, - isDate: isDate, - isRegExp: isRegExp, - isError: isError, - isSymbol: isSymbol, - isArrayBuffer: isArrayBuffer, - isDataView: isDataView$1, - isArray: isArray, - isFunction: isFunction$1, - isArguments: isArguments$1, - isFinite: isFinite$1, - isNaN: isNaN$1, - isTypedArray: isTypedArray$1, - isEmpty: isEmpty, - isMatch: isMatch, - isEqual: isEqual, - isMap: isMap, - isWeakMap: isWeakMap, - isSet: isSet, - isWeakSet: isWeakSet, - keys: keys, - allKeys: allKeys, - values: values, - pairs: pairs, - invert: invert, - functions: functions, - methods: functions, - extend: extend, - extendOwn: extendOwn, - assign: extendOwn, - defaults: defaults, - create: create, - clone: clone, - tap: tap, - get: get, - has: has, - mapObject: mapObject, - identity: identity, - constant: constant, - noop: noop, - toPath: toPath$1, - property: property, - propertyOf: propertyOf, - matcher: matcher, - matches: matcher, - times: times, - random: random, - now: now, - escape: _escape, - unescape: _unescape, - templateSettings: templateSettings, - template: template, - result: result, - uniqueId: uniqueId, - chain: chain, - iteratee: iteratee, - partial: partial, - bind: bind, - bindAll: bindAll, - memoize: memoize, - delay: delay, - defer: defer, - throttle: throttle, - debounce: debounce, - wrap: wrap, - negate: negate, - compose: compose, - after: after, - before: before, - once: once, - findKey: findKey, - findIndex: findIndex, - findLastIndex: findLastIndex, - sortedIndex: sortedIndex, - indexOf: indexOf, - lastIndexOf: lastIndexOf, - find: find, - detect: find, - findWhere: findWhere, - each: each, - forEach: each, - map: map, - collect: map, - reduce: reduce, - foldl: reduce, - inject: reduce, - reduceRight: reduceRight, - foldr: reduceRight, - filter: filter, - select: filter, - reject: reject, - every: every, - all: every, - some: some, - any: some, - contains: contains, - includes: contains, - include: contains, - invoke: invoke, - pluck: pluck, - where: where, - max: max, - min: min, - shuffle: shuffle, - sample: sample, - sortBy: sortBy, - groupBy: groupBy, - indexBy: indexBy, - countBy: countBy, - partition: partition, - toArray: toArray, - size: size, - pick: pick, - omit: omit, - first: first, - head: first, - take: first, - initial: initial, - last: last, - rest: rest, - tail: rest, - drop: rest, - compact: compact, - flatten: flatten, - without: without, - uniq: uniq, - unique: uniq, - union: union, - intersection: intersection, - difference: difference, - unzip: unzip, - transpose: unzip, - zip: zip, - object: object, - range: range, - chunk: chunk, - mixin: mixin, - 'default': _$1 - }; - - // Default Export - - // Add all of the Underscore functions to the wrapper object. - var _ = mixin(allExports); - // Legacy Node.js API. - _._ = _; - - return _; - -}))); -//# sourceMappingURL=underscore-umd.js.map diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/underscore.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/underscore.js deleted file mode 100644 index c81e732e..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/underscore/underscore.js +++ /dev/null @@ -1,2042 +0,0 @@ -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : - typeof define === 'function' && define.amd ? define('underscore', factory) : - (global = typeof globalThis !== 'undefined' ? globalThis : global || self, (function () { - var current = global._; - var exports = global._ = factory(); - exports.noConflict = function () { global._ = current; return exports; }; - }())); -}(this, (function () { - // Underscore.js 1.13.6 - // https://underscorejs.org - // (c) 2009-2022 Jeremy Ashkenas, Julian Gonggrijp, and DocumentCloud and Investigative Reporters & Editors - // Underscore may be freely distributed under the MIT license. - - // Current version. - var VERSION = '1.13.6'; - - // Establish the root object, `window` (`self`) in the browser, `global` - // on the server, or `this` in some virtual machines. We use `self` - // instead of `window` for `WebWorker` support. - var root = (typeof self == 'object' && self.self === self && self) || - (typeof global == 'object' && global.global === global && global) || - Function('return this')() || - {}; - - // Save bytes in the minified (but not gzipped) version: - var ArrayProto = Array.prototype, ObjProto = Object.prototype; - var SymbolProto = typeof Symbol !== 'undefined' ? Symbol.prototype : null; - - // Create quick reference variables for speed access to core prototypes. - var push = ArrayProto.push, - slice = ArrayProto.slice, - toString = ObjProto.toString, - hasOwnProperty = ObjProto.hasOwnProperty; - - // Modern feature detection. - var supportsArrayBuffer = typeof ArrayBuffer !== 'undefined', - supportsDataView = typeof DataView !== 'undefined'; - - // All **ECMAScript 5+** native function implementations that we hope to use - // are declared here. - var nativeIsArray = Array.isArray, - nativeKeys = Object.keys, - nativeCreate = Object.create, - nativeIsView = supportsArrayBuffer && ArrayBuffer.isView; - - // Create references to these builtin functions because we override them. - var _isNaN = isNaN, - _isFinite = isFinite; - - // Keys in IE < 9 that won't be iterated by `for key in ...` and thus missed. - var hasEnumBug = !{toString: null}.propertyIsEnumerable('toString'); - var nonEnumerableProps = ['valueOf', 'isPrototypeOf', 'toString', - 'propertyIsEnumerable', 'hasOwnProperty', 'toLocaleString']; - - // The largest integer that can be represented exactly. - var MAX_ARRAY_INDEX = Math.pow(2, 53) - 1; - - // Some functions take a variable number of arguments, or a few expected - // arguments at the beginning and then a variable number of values to operate - // on. This helper accumulates all remaining arguments past the function’s - // argument length (or an explicit `startIndex`), into an array that becomes - // the last argument. Similar to ES6’s "rest parameter". - function restArguments(func, startIndex) { - startIndex = startIndex == null ? func.length - 1 : +startIndex; - return function() { - var length = Math.max(arguments.length - startIndex, 0), - rest = Array(length), - index = 0; - for (; index < length; index++) { - rest[index] = arguments[index + startIndex]; - } - switch (startIndex) { - case 0: return func.call(this, rest); - case 1: return func.call(this, arguments[0], rest); - case 2: return func.call(this, arguments[0], arguments[1], rest); - } - var args = Array(startIndex + 1); - for (index = 0; index < startIndex; index++) { - args[index] = arguments[index]; - } - args[startIndex] = rest; - return func.apply(this, args); - }; - } - - // Is a given variable an object? - function isObject(obj) { - var type = typeof obj; - return type === 'function' || (type === 'object' && !!obj); - } - - // Is a given value equal to null? - function isNull(obj) { - return obj === null; - } - - // Is a given variable undefined? - function isUndefined(obj) { - return obj === void 0; - } - - // Is a given value a boolean? - function isBoolean(obj) { - return obj === true || obj === false || toString.call(obj) === '[object Boolean]'; - } - - // Is a given value a DOM element? - function isElement(obj) { - return !!(obj && obj.nodeType === 1); - } - - // Internal function for creating a `toString`-based type tester. - function tagTester(name) { - var tag = '[object ' + name + ']'; - return function(obj) { - return toString.call(obj) === tag; - }; - } - - var isString = tagTester('String'); - - var isNumber = tagTester('Number'); - - var isDate = tagTester('Date'); - - var isRegExp = tagTester('RegExp'); - - var isError = tagTester('Error'); - - var isSymbol = tagTester('Symbol'); - - var isArrayBuffer = tagTester('ArrayBuffer'); - - var isFunction = tagTester('Function'); - - // Optimize `isFunction` if appropriate. Work around some `typeof` bugs in old - // v8, IE 11 (#1621), Safari 8 (#1929), and PhantomJS (#2236). - var nodelist = root.document && root.document.childNodes; - if (typeof /./ != 'function' && typeof Int8Array != 'object' && typeof nodelist != 'function') { - isFunction = function(obj) { - return typeof obj == 'function' || false; - }; - } - - var isFunction$1 = isFunction; - - var hasObjectTag = tagTester('Object'); - - // In IE 10 - Edge 13, `DataView` has string tag `'[object Object]'`. - // In IE 11, the most common among them, this problem also applies to - // `Map`, `WeakMap` and `Set`. - var hasStringTagBug = ( - supportsDataView && hasObjectTag(new DataView(new ArrayBuffer(8))) - ), - isIE11 = (typeof Map !== 'undefined' && hasObjectTag(new Map)); - - var isDataView = tagTester('DataView'); - - // In IE 10 - Edge 13, we need a different heuristic - // to determine whether an object is a `DataView`. - function ie10IsDataView(obj) { - return obj != null && isFunction$1(obj.getInt8) && isArrayBuffer(obj.buffer); - } - - var isDataView$1 = (hasStringTagBug ? ie10IsDataView : isDataView); - - // Is a given value an array? - // Delegates to ECMA5's native `Array.isArray`. - var isArray = nativeIsArray || tagTester('Array'); - - // Internal function to check whether `key` is an own property name of `obj`. - function has$1(obj, key) { - return obj != null && hasOwnProperty.call(obj, key); - } - - var isArguments = tagTester('Arguments'); - - // Define a fallback version of the method in browsers (ahem, IE < 9), where - // there isn't any inspectable "Arguments" type. - (function() { - if (!isArguments(arguments)) { - isArguments = function(obj) { - return has$1(obj, 'callee'); - }; - } - }()); - - var isArguments$1 = isArguments; - - // Is a given object a finite number? - function isFinite$1(obj) { - return !isSymbol(obj) && _isFinite(obj) && !isNaN(parseFloat(obj)); - } - - // Is the given value `NaN`? - function isNaN$1(obj) { - return isNumber(obj) && _isNaN(obj); - } - - // Predicate-generating function. Often useful outside of Underscore. - function constant(value) { - return function() { - return value; - }; - } - - // Common internal logic for `isArrayLike` and `isBufferLike`. - function createSizePropertyCheck(getSizeProperty) { - return function(collection) { - var sizeProperty = getSizeProperty(collection); - return typeof sizeProperty == 'number' && sizeProperty >= 0 && sizeProperty <= MAX_ARRAY_INDEX; - } - } - - // Internal helper to generate a function to obtain property `key` from `obj`. - function shallowProperty(key) { - return function(obj) { - return obj == null ? void 0 : obj[key]; - }; - } - - // Internal helper to obtain the `byteLength` property of an object. - var getByteLength = shallowProperty('byteLength'); - - // Internal helper to determine whether we should spend extensive checks against - // `ArrayBuffer` et al. - var isBufferLike = createSizePropertyCheck(getByteLength); - - // Is a given value a typed array? - var typedArrayPattern = /\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/; - function isTypedArray(obj) { - // `ArrayBuffer.isView` is the most future-proof, so use it when available. - // Otherwise, fall back on the above regular expression. - return nativeIsView ? (nativeIsView(obj) && !isDataView$1(obj)) : - isBufferLike(obj) && typedArrayPattern.test(toString.call(obj)); - } - - var isTypedArray$1 = supportsArrayBuffer ? isTypedArray : constant(false); - - // Internal helper to obtain the `length` property of an object. - var getLength = shallowProperty('length'); - - // Internal helper to create a simple lookup structure. - // `collectNonEnumProps` used to depend on `_.contains`, but this led to - // circular imports. `emulatedSet` is a one-off solution that only works for - // arrays of strings. - function emulatedSet(keys) { - var hash = {}; - for (var l = keys.length, i = 0; i < l; ++i) hash[keys[i]] = true; - return { - contains: function(key) { return hash[key] === true; }, - push: function(key) { - hash[key] = true; - return keys.push(key); - } - }; - } - - // Internal helper. Checks `keys` for the presence of keys in IE < 9 that won't - // be iterated by `for key in ...` and thus missed. Extends `keys` in place if - // needed. - function collectNonEnumProps(obj, keys) { - keys = emulatedSet(keys); - var nonEnumIdx = nonEnumerableProps.length; - var constructor = obj.constructor; - var proto = (isFunction$1(constructor) && constructor.prototype) || ObjProto; - - // Constructor is a special case. - var prop = 'constructor'; - if (has$1(obj, prop) && !keys.contains(prop)) keys.push(prop); - - while (nonEnumIdx--) { - prop = nonEnumerableProps[nonEnumIdx]; - if (prop in obj && obj[prop] !== proto[prop] && !keys.contains(prop)) { - keys.push(prop); - } - } - } - - // Retrieve the names of an object's own properties. - // Delegates to **ECMAScript 5**'s native `Object.keys`. - function keys(obj) { - if (!isObject(obj)) return []; - if (nativeKeys) return nativeKeys(obj); - var keys = []; - for (var key in obj) if (has$1(obj, key)) keys.push(key); - // Ahem, IE < 9. - if (hasEnumBug) collectNonEnumProps(obj, keys); - return keys; - } - - // Is a given array, string, or object empty? - // An "empty" object has no enumerable own-properties. - function isEmpty(obj) { - if (obj == null) return true; - // Skip the more expensive `toString`-based type checks if `obj` has no - // `.length`. - var length = getLength(obj); - if (typeof length == 'number' && ( - isArray(obj) || isString(obj) || isArguments$1(obj) - )) return length === 0; - return getLength(keys(obj)) === 0; - } - - // Returns whether an object has a given set of `key:value` pairs. - function isMatch(object, attrs) { - var _keys = keys(attrs), length = _keys.length; - if (object == null) return !length; - var obj = Object(object); - for (var i = 0; i < length; i++) { - var key = _keys[i]; - if (attrs[key] !== obj[key] || !(key in obj)) return false; - } - return true; - } - - // If Underscore is called as a function, it returns a wrapped object that can - // be used OO-style. This wrapper holds altered versions of all functions added - // through `_.mixin`. Wrapped objects may be chained. - function _$1(obj) { - if (obj instanceof _$1) return obj; - if (!(this instanceof _$1)) return new _$1(obj); - this._wrapped = obj; - } - - _$1.VERSION = VERSION; - - // Extracts the result from a wrapped and chained object. - _$1.prototype.value = function() { - return this._wrapped; - }; - - // Provide unwrapping proxies for some methods used in engine operations - // such as arithmetic and JSON stringification. - _$1.prototype.valueOf = _$1.prototype.toJSON = _$1.prototype.value; - - _$1.prototype.toString = function() { - return String(this._wrapped); - }; - - // Internal function to wrap or shallow-copy an ArrayBuffer, - // typed array or DataView to a new view, reusing the buffer. - function toBufferView(bufferSource) { - return new Uint8Array( - bufferSource.buffer || bufferSource, - bufferSource.byteOffset || 0, - getByteLength(bufferSource) - ); - } - - // We use this string twice, so give it a name for minification. - var tagDataView = '[object DataView]'; - - // Internal recursive comparison function for `_.isEqual`. - function eq(a, b, aStack, bStack) { - // Identical objects are equal. `0 === -0`, but they aren't identical. - // See the [Harmony `egal` proposal](https://wiki.ecmascript.org/doku.php?id=harmony:egal). - if (a === b) return a !== 0 || 1 / a === 1 / b; - // `null` or `undefined` only equal to itself (strict comparison). - if (a == null || b == null) return false; - // `NaN`s are equivalent, but non-reflexive. - if (a !== a) return b !== b; - // Exhaust primitive checks - var type = typeof a; - if (type !== 'function' && type !== 'object' && typeof b != 'object') return false; - return deepEq(a, b, aStack, bStack); - } - - // Internal recursive comparison function for `_.isEqual`. - function deepEq(a, b, aStack, bStack) { - // Unwrap any wrapped objects. - if (a instanceof _$1) a = a._wrapped; - if (b instanceof _$1) b = b._wrapped; - // Compare `[[Class]]` names. - var className = toString.call(a); - if (className !== toString.call(b)) return false; - // Work around a bug in IE 10 - Edge 13. - if (hasStringTagBug && className == '[object Object]' && isDataView$1(a)) { - if (!isDataView$1(b)) return false; - className = tagDataView; - } - switch (className) { - // These types are compared by value. - case '[object RegExp]': - // RegExps are coerced to strings for comparison (Note: '' + /a/i === '/a/i') - case '[object String]': - // Primitives and their corresponding object wrappers are equivalent; thus, `"5"` is - // equivalent to `new String("5")`. - return '' + a === '' + b; - case '[object Number]': - // `NaN`s are equivalent, but non-reflexive. - // Object(NaN) is equivalent to NaN. - if (+a !== +a) return +b !== +b; - // An `egal` comparison is performed for other numeric values. - return +a === 0 ? 1 / +a === 1 / b : +a === +b; - case '[object Date]': - case '[object Boolean]': - // Coerce dates and booleans to numeric primitive values. Dates are compared by their - // millisecond representations. Note that invalid dates with millisecond representations - // of `NaN` are not equivalent. - return +a === +b; - case '[object Symbol]': - return SymbolProto.valueOf.call(a) === SymbolProto.valueOf.call(b); - case '[object ArrayBuffer]': - case tagDataView: - // Coerce to typed array so we can fall through. - return deepEq(toBufferView(a), toBufferView(b), aStack, bStack); - } - - var areArrays = className === '[object Array]'; - if (!areArrays && isTypedArray$1(a)) { - var byteLength = getByteLength(a); - if (byteLength !== getByteLength(b)) return false; - if (a.buffer === b.buffer && a.byteOffset === b.byteOffset) return true; - areArrays = true; - } - if (!areArrays) { - if (typeof a != 'object' || typeof b != 'object') return false; - - // Objects with different constructors are not equivalent, but `Object`s or `Array`s - // from different frames are. - var aCtor = a.constructor, bCtor = b.constructor; - if (aCtor !== bCtor && !(isFunction$1(aCtor) && aCtor instanceof aCtor && - isFunction$1(bCtor) && bCtor instanceof bCtor) - && ('constructor' in a && 'constructor' in b)) { - return false; - } - } - // Assume equality for cyclic structures. The algorithm for detecting cyclic - // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`. - - // Initializing stack of traversed objects. - // It's done here since we only need them for objects and arrays comparison. - aStack = aStack || []; - bStack = bStack || []; - var length = aStack.length; - while (length--) { - // Linear search. Performance is inversely proportional to the number of - // unique nested structures. - if (aStack[length] === a) return bStack[length] === b; - } - - // Add the first object to the stack of traversed objects. - aStack.push(a); - bStack.push(b); - - // Recursively compare objects and arrays. - if (areArrays) { - // Compare array lengths to determine if a deep comparison is necessary. - length = a.length; - if (length !== b.length) return false; - // Deep compare the contents, ignoring non-numeric properties. - while (length--) { - if (!eq(a[length], b[length], aStack, bStack)) return false; - } - } else { - // Deep compare objects. - var _keys = keys(a), key; - length = _keys.length; - // Ensure that both objects contain the same number of properties before comparing deep equality. - if (keys(b).length !== length) return false; - while (length--) { - // Deep compare each member - key = _keys[length]; - if (!(has$1(b, key) && eq(a[key], b[key], aStack, bStack))) return false; - } - } - // Remove the first object from the stack of traversed objects. - aStack.pop(); - bStack.pop(); - return true; - } - - // Perform a deep comparison to check if two objects are equal. - function isEqual(a, b) { - return eq(a, b); - } - - // Retrieve all the enumerable property names of an object. - function allKeys(obj) { - if (!isObject(obj)) return []; - var keys = []; - for (var key in obj) keys.push(key); - // Ahem, IE < 9. - if (hasEnumBug) collectNonEnumProps(obj, keys); - return keys; - } - - // Since the regular `Object.prototype.toString` type tests don't work for - // some types in IE 11, we use a fingerprinting heuristic instead, based - // on the methods. It's not great, but it's the best we got. - // The fingerprint method lists are defined below. - function ie11fingerprint(methods) { - var length = getLength(methods); - return function(obj) { - if (obj == null) return false; - // `Map`, `WeakMap` and `Set` have no enumerable keys. - var keys = allKeys(obj); - if (getLength(keys)) return false; - for (var i = 0; i < length; i++) { - if (!isFunction$1(obj[methods[i]])) return false; - } - // If we are testing against `WeakMap`, we need to ensure that - // `obj` doesn't have a `forEach` method in order to distinguish - // it from a regular `Map`. - return methods !== weakMapMethods || !isFunction$1(obj[forEachName]); - }; - } - - // In the interest of compact minification, we write - // each string in the fingerprints only once. - var forEachName = 'forEach', - hasName = 'has', - commonInit = ['clear', 'delete'], - mapTail = ['get', hasName, 'set']; - - // `Map`, `WeakMap` and `Set` each have slightly different - // combinations of the above sublists. - var mapMethods = commonInit.concat(forEachName, mapTail), - weakMapMethods = commonInit.concat(mapTail), - setMethods = ['add'].concat(commonInit, forEachName, hasName); - - var isMap = isIE11 ? ie11fingerprint(mapMethods) : tagTester('Map'); - - var isWeakMap = isIE11 ? ie11fingerprint(weakMapMethods) : tagTester('WeakMap'); - - var isSet = isIE11 ? ie11fingerprint(setMethods) : tagTester('Set'); - - var isWeakSet = tagTester('WeakSet'); - - // Retrieve the values of an object's properties. - function values(obj) { - var _keys = keys(obj); - var length = _keys.length; - var values = Array(length); - for (var i = 0; i < length; i++) { - values[i] = obj[_keys[i]]; - } - return values; - } - - // Convert an object into a list of `[key, value]` pairs. - // The opposite of `_.object` with one argument. - function pairs(obj) { - var _keys = keys(obj); - var length = _keys.length; - var pairs = Array(length); - for (var i = 0; i < length; i++) { - pairs[i] = [_keys[i], obj[_keys[i]]]; - } - return pairs; - } - - // Invert the keys and values of an object. The values must be serializable. - function invert(obj) { - var result = {}; - var _keys = keys(obj); - for (var i = 0, length = _keys.length; i < length; i++) { - result[obj[_keys[i]]] = _keys[i]; - } - return result; - } - - // Return a sorted list of the function names available on the object. - function functions(obj) { - var names = []; - for (var key in obj) { - if (isFunction$1(obj[key])) names.push(key); - } - return names.sort(); - } - - // An internal function for creating assigner functions. - function createAssigner(keysFunc, defaults) { - return function(obj) { - var length = arguments.length; - if (defaults) obj = Object(obj); - if (length < 2 || obj == null) return obj; - for (var index = 1; index < length; index++) { - var source = arguments[index], - keys = keysFunc(source), - l = keys.length; - for (var i = 0; i < l; i++) { - var key = keys[i]; - if (!defaults || obj[key] === void 0) obj[key] = source[key]; - } - } - return obj; - }; - } - - // Extend a given object with all the properties in passed-in object(s). - var extend = createAssigner(allKeys); - - // Assigns a given object with all the own properties in the passed-in - // object(s). - // (https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/assign) - var extendOwn = createAssigner(keys); - - // Fill in a given object with default properties. - var defaults = createAssigner(allKeys, true); - - // Create a naked function reference for surrogate-prototype-swapping. - function ctor() { - return function(){}; - } - - // An internal function for creating a new object that inherits from another. - function baseCreate(prototype) { - if (!isObject(prototype)) return {}; - if (nativeCreate) return nativeCreate(prototype); - var Ctor = ctor(); - Ctor.prototype = prototype; - var result = new Ctor; - Ctor.prototype = null; - return result; - } - - // Creates an object that inherits from the given prototype object. - // If additional properties are provided then they will be added to the - // created object. - function create(prototype, props) { - var result = baseCreate(prototype); - if (props) extendOwn(result, props); - return result; - } - - // Create a (shallow-cloned) duplicate of an object. - function clone(obj) { - if (!isObject(obj)) return obj; - return isArray(obj) ? obj.slice() : extend({}, obj); - } - - // Invokes `interceptor` with the `obj` and then returns `obj`. - // The primary purpose of this method is to "tap into" a method chain, in - // order to perform operations on intermediate results within the chain. - function tap(obj, interceptor) { - interceptor(obj); - return obj; - } - - // Normalize a (deep) property `path` to array. - // Like `_.iteratee`, this function can be customized. - function toPath$1(path) { - return isArray(path) ? path : [path]; - } - _$1.toPath = toPath$1; - - // Internal wrapper for `_.toPath` to enable minification. - // Similar to `cb` for `_.iteratee`. - function toPath(path) { - return _$1.toPath(path); - } - - // Internal function to obtain a nested property in `obj` along `path`. - function deepGet(obj, path) { - var length = path.length; - for (var i = 0; i < length; i++) { - if (obj == null) return void 0; - obj = obj[path[i]]; - } - return length ? obj : void 0; - } - - // Get the value of the (deep) property on `path` from `object`. - // If any property in `path` does not exist or if the value is - // `undefined`, return `defaultValue` instead. - // The `path` is normalized through `_.toPath`. - function get(object, path, defaultValue) { - var value = deepGet(object, toPath(path)); - return isUndefined(value) ? defaultValue : value; - } - - // Shortcut function for checking if an object has a given property directly on - // itself (in other words, not on a prototype). Unlike the internal `has` - // function, this public version can also traverse nested properties. - function has(obj, path) { - path = toPath(path); - var length = path.length; - for (var i = 0; i < length; i++) { - var key = path[i]; - if (!has$1(obj, key)) return false; - obj = obj[key]; - } - return !!length; - } - - // Keep the identity function around for default iteratees. - function identity(value) { - return value; - } - - // Returns a predicate for checking whether an object has a given set of - // `key:value` pairs. - function matcher(attrs) { - attrs = extendOwn({}, attrs); - return function(obj) { - return isMatch(obj, attrs); - }; - } - - // Creates a function that, when passed an object, will traverse that object’s - // properties down the given `path`, specified as an array of keys or indices. - function property(path) { - path = toPath(path); - return function(obj) { - return deepGet(obj, path); - }; - } - - // Internal function that returns an efficient (for current engines) version - // of the passed-in callback, to be repeatedly applied in other Underscore - // functions. - function optimizeCb(func, context, argCount) { - if (context === void 0) return func; - switch (argCount == null ? 3 : argCount) { - case 1: return function(value) { - return func.call(context, value); - }; - // The 2-argument case is omitted because we’re not using it. - case 3: return function(value, index, collection) { - return func.call(context, value, index, collection); - }; - case 4: return function(accumulator, value, index, collection) { - return func.call(context, accumulator, value, index, collection); - }; - } - return function() { - return func.apply(context, arguments); - }; - } - - // An internal function to generate callbacks that can be applied to each - // element in a collection, returning the desired result — either `_.identity`, - // an arbitrary callback, a property matcher, or a property accessor. - function baseIteratee(value, context, argCount) { - if (value == null) return identity; - if (isFunction$1(value)) return optimizeCb(value, context, argCount); - if (isObject(value) && !isArray(value)) return matcher(value); - return property(value); - } - - // External wrapper for our callback generator. Users may customize - // `_.iteratee` if they want additional predicate/iteratee shorthand styles. - // This abstraction hides the internal-only `argCount` argument. - function iteratee(value, context) { - return baseIteratee(value, context, Infinity); - } - _$1.iteratee = iteratee; - - // The function we call internally to generate a callback. It invokes - // `_.iteratee` if overridden, otherwise `baseIteratee`. - function cb(value, context, argCount) { - if (_$1.iteratee !== iteratee) return _$1.iteratee(value, context); - return baseIteratee(value, context, argCount); - } - - // Returns the results of applying the `iteratee` to each element of `obj`. - // In contrast to `_.map` it returns an object. - function mapObject(obj, iteratee, context) { - iteratee = cb(iteratee, context); - var _keys = keys(obj), - length = _keys.length, - results = {}; - for (var index = 0; index < length; index++) { - var currentKey = _keys[index]; - results[currentKey] = iteratee(obj[currentKey], currentKey, obj); - } - return results; - } - - // Predicate-generating function. Often useful outside of Underscore. - function noop(){} - - // Generates a function for a given object that returns a given property. - function propertyOf(obj) { - if (obj == null) return noop; - return function(path) { - return get(obj, path); - }; - } - - // Run a function **n** times. - function times(n, iteratee, context) { - var accum = Array(Math.max(0, n)); - iteratee = optimizeCb(iteratee, context, 1); - for (var i = 0; i < n; i++) accum[i] = iteratee(i); - return accum; - } - - // Return a random integer between `min` and `max` (inclusive). - function random(min, max) { - if (max == null) { - max = min; - min = 0; - } - return min + Math.floor(Math.random() * (max - min + 1)); - } - - // A (possibly faster) way to get the current timestamp as an integer. - var now = Date.now || function() { - return new Date().getTime(); - }; - - // Internal helper to generate functions for escaping and unescaping strings - // to/from HTML interpolation. - function createEscaper(map) { - var escaper = function(match) { - return map[match]; - }; - // Regexes for identifying a key that needs to be escaped. - var source = '(?:' + keys(map).join('|') + ')'; - var testRegexp = RegExp(source); - var replaceRegexp = RegExp(source, 'g'); - return function(string) { - string = string == null ? '' : '' + string; - return testRegexp.test(string) ? string.replace(replaceRegexp, escaper) : string; - }; - } - - // Internal list of HTML entities for escaping. - var escapeMap = { - '&': '&', - '<': '<', - '>': '>', - '"': '"', - "'": ''', - '`': '`' - }; - - // Function for escaping strings to HTML interpolation. - var _escape = createEscaper(escapeMap); - - // Internal list of HTML entities for unescaping. - var unescapeMap = invert(escapeMap); - - // Function for unescaping strings from HTML interpolation. - var _unescape = createEscaper(unescapeMap); - - // By default, Underscore uses ERB-style template delimiters. Change the - // following template settings to use alternative delimiters. - var templateSettings = _$1.templateSettings = { - evaluate: /<%([\s\S]+?)%>/g, - interpolate: /<%=([\s\S]+?)%>/g, - escape: /<%-([\s\S]+?)%>/g - }; - - // When customizing `_.templateSettings`, if you don't want to define an - // interpolation, evaluation or escaping regex, we need one that is - // guaranteed not to match. - var noMatch = /(.)^/; - - // Certain characters need to be escaped so that they can be put into a - // string literal. - var escapes = { - "'": "'", - '\\': '\\', - '\r': 'r', - '\n': 'n', - '\u2028': 'u2028', - '\u2029': 'u2029' - }; - - var escapeRegExp = /\\|'|\r|\n|\u2028|\u2029/g; - - function escapeChar(match) { - return '\\' + escapes[match]; - } - - // In order to prevent third-party code injection through - // `_.templateSettings.variable`, we test it against the following regular - // expression. It is intentionally a bit more liberal than just matching valid - // identifiers, but still prevents possible loopholes through defaults or - // destructuring assignment. - var bareIdentifier = /^\s*(\w|\$)+\s*$/; - - // JavaScript micro-templating, similar to John Resig's implementation. - // Underscore templating handles arbitrary delimiters, preserves whitespace, - // and correctly escapes quotes within interpolated code. - // NB: `oldSettings` only exists for backwards compatibility. - function template(text, settings, oldSettings) { - if (!settings && oldSettings) settings = oldSettings; - settings = defaults({}, settings, _$1.templateSettings); - - // Combine delimiters into one regular expression via alternation. - var matcher = RegExp([ - (settings.escape || noMatch).source, - (settings.interpolate || noMatch).source, - (settings.evaluate || noMatch).source - ].join('|') + '|$', 'g'); - - // Compile the template source, escaping string literals appropriately. - var index = 0; - var source = "__p+='"; - text.replace(matcher, function(match, escape, interpolate, evaluate, offset) { - source += text.slice(index, offset).replace(escapeRegExp, escapeChar); - index = offset + match.length; - - if (escape) { - source += "'+\n((__t=(" + escape + "))==null?'':_.escape(__t))+\n'"; - } else if (interpolate) { - source += "'+\n((__t=(" + interpolate + "))==null?'':__t)+\n'"; - } else if (evaluate) { - source += "';\n" + evaluate + "\n__p+='"; - } - - // Adobe VMs need the match returned to produce the correct offset. - return match; - }); - source += "';\n"; - - var argument = settings.variable; - if (argument) { - // Insure against third-party code injection. (CVE-2021-23358) - if (!bareIdentifier.test(argument)) throw new Error( - 'variable is not a bare identifier: ' + argument - ); - } else { - // If a variable is not specified, place data values in local scope. - source = 'with(obj||{}){\n' + source + '}\n'; - argument = 'obj'; - } - - source = "var __t,__p='',__j=Array.prototype.join," + - "print=function(){__p+=__j.call(arguments,'');};\n" + - source + 'return __p;\n'; - - var render; - try { - render = new Function(argument, '_', source); - } catch (e) { - e.source = source; - throw e; - } - - var template = function(data) { - return render.call(this, data, _$1); - }; - - // Provide the compiled source as a convenience for precompilation. - template.source = 'function(' + argument + '){\n' + source + '}'; - - return template; - } - - // Traverses the children of `obj` along `path`. If a child is a function, it - // is invoked with its parent as context. Returns the value of the final - // child, or `fallback` if any child is undefined. - function result(obj, path, fallback) { - path = toPath(path); - var length = path.length; - if (!length) { - return isFunction$1(fallback) ? fallback.call(obj) : fallback; - } - for (var i = 0; i < length; i++) { - var prop = obj == null ? void 0 : obj[path[i]]; - if (prop === void 0) { - prop = fallback; - i = length; // Ensure we don't continue iterating. - } - obj = isFunction$1(prop) ? prop.call(obj) : prop; - } - return obj; - } - - // Generate a unique integer id (unique within the entire client session). - // Useful for temporary DOM ids. - var idCounter = 0; - function uniqueId(prefix) { - var id = ++idCounter + ''; - return prefix ? prefix + id : id; - } - - // Start chaining a wrapped Underscore object. - function chain(obj) { - var instance = _$1(obj); - instance._chain = true; - return instance; - } - - // Internal function to execute `sourceFunc` bound to `context` with optional - // `args`. Determines whether to execute a function as a constructor or as a - // normal function. - function executeBound(sourceFunc, boundFunc, context, callingContext, args) { - if (!(callingContext instanceof boundFunc)) return sourceFunc.apply(context, args); - var self = baseCreate(sourceFunc.prototype); - var result = sourceFunc.apply(self, args); - if (isObject(result)) return result; - return self; - } - - // Partially apply a function by creating a version that has had some of its - // arguments pre-filled, without changing its dynamic `this` context. `_` acts - // as a placeholder by default, allowing any combination of arguments to be - // pre-filled. Set `_.partial.placeholder` for a custom placeholder argument. - var partial = restArguments(function(func, boundArgs) { - var placeholder = partial.placeholder; - var bound = function() { - var position = 0, length = boundArgs.length; - var args = Array(length); - for (var i = 0; i < length; i++) { - args[i] = boundArgs[i] === placeholder ? arguments[position++] : boundArgs[i]; - } - while (position < arguments.length) args.push(arguments[position++]); - return executeBound(func, bound, this, this, args); - }; - return bound; - }); - - partial.placeholder = _$1; - - // Create a function bound to a given object (assigning `this`, and arguments, - // optionally). - var bind = restArguments(function(func, context, args) { - if (!isFunction$1(func)) throw new TypeError('Bind must be called on a function'); - var bound = restArguments(function(callArgs) { - return executeBound(func, bound, context, this, args.concat(callArgs)); - }); - return bound; - }); - - // Internal helper for collection methods to determine whether a collection - // should be iterated as an array or as an object. - // Related: https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength - // Avoids a very nasty iOS 8 JIT bug on ARM-64. #2094 - var isArrayLike = createSizePropertyCheck(getLength); - - // Internal implementation of a recursive `flatten` function. - function flatten$1(input, depth, strict, output) { - output = output || []; - if (!depth && depth !== 0) { - depth = Infinity; - } else if (depth <= 0) { - return output.concat(input); - } - var idx = output.length; - for (var i = 0, length = getLength(input); i < length; i++) { - var value = input[i]; - if (isArrayLike(value) && (isArray(value) || isArguments$1(value))) { - // Flatten current level of array or arguments object. - if (depth > 1) { - flatten$1(value, depth - 1, strict, output); - idx = output.length; - } else { - var j = 0, len = value.length; - while (j < len) output[idx++] = value[j++]; - } - } else if (!strict) { - output[idx++] = value; - } - } - return output; - } - - // Bind a number of an object's methods to that object. Remaining arguments - // are the method names to be bound. Useful for ensuring that all callbacks - // defined on an object belong to it. - var bindAll = restArguments(function(obj, keys) { - keys = flatten$1(keys, false, false); - var index = keys.length; - if (index < 1) throw new Error('bindAll must be passed function names'); - while (index--) { - var key = keys[index]; - obj[key] = bind(obj[key], obj); - } - return obj; - }); - - // Memoize an expensive function by storing its results. - function memoize(func, hasher) { - var memoize = function(key) { - var cache = memoize.cache; - var address = '' + (hasher ? hasher.apply(this, arguments) : key); - if (!has$1(cache, address)) cache[address] = func.apply(this, arguments); - return cache[address]; - }; - memoize.cache = {}; - return memoize; - } - - // Delays a function for the given number of milliseconds, and then calls - // it with the arguments supplied. - var delay = restArguments(function(func, wait, args) { - return setTimeout(function() { - return func.apply(null, args); - }, wait); - }); - - // Defers a function, scheduling it to run after the current call stack has - // cleared. - var defer = partial(delay, _$1, 1); - - // Returns a function, that, when invoked, will only be triggered at most once - // during a given window of time. Normally, the throttled function will run - // as much as it can, without ever going more than once per `wait` duration; - // but if you'd like to disable the execution on the leading edge, pass - // `{leading: false}`. To disable execution on the trailing edge, ditto. - function throttle(func, wait, options) { - var timeout, context, args, result; - var previous = 0; - if (!options) options = {}; - - var later = function() { - previous = options.leading === false ? 0 : now(); - timeout = null; - result = func.apply(context, args); - if (!timeout) context = args = null; - }; - - var throttled = function() { - var _now = now(); - if (!previous && options.leading === false) previous = _now; - var remaining = wait - (_now - previous); - context = this; - args = arguments; - if (remaining <= 0 || remaining > wait) { - if (timeout) { - clearTimeout(timeout); - timeout = null; - } - previous = _now; - result = func.apply(context, args); - if (!timeout) context = args = null; - } else if (!timeout && options.trailing !== false) { - timeout = setTimeout(later, remaining); - } - return result; - }; - - throttled.cancel = function() { - clearTimeout(timeout); - previous = 0; - timeout = context = args = null; - }; - - return throttled; - } - - // When a sequence of calls of the returned function ends, the argument - // function is triggered. The end of a sequence is defined by the `wait` - // parameter. If `immediate` is passed, the argument function will be - // triggered at the beginning of the sequence instead of at the end. - function debounce(func, wait, immediate) { - var timeout, previous, args, result, context; - - var later = function() { - var passed = now() - previous; - if (wait > passed) { - timeout = setTimeout(later, wait - passed); - } else { - timeout = null; - if (!immediate) result = func.apply(context, args); - // This check is needed because `func` can recursively invoke `debounced`. - if (!timeout) args = context = null; - } - }; - - var debounced = restArguments(function(_args) { - context = this; - args = _args; - previous = now(); - if (!timeout) { - timeout = setTimeout(later, wait); - if (immediate) result = func.apply(context, args); - } - return result; - }); - - debounced.cancel = function() { - clearTimeout(timeout); - timeout = args = context = null; - }; - - return debounced; - } - - // Returns the first function passed as an argument to the second, - // allowing you to adjust arguments, run code before and after, and - // conditionally execute the original function. - function wrap(func, wrapper) { - return partial(wrapper, func); - } - - // Returns a negated version of the passed-in predicate. - function negate(predicate) { - return function() { - return !predicate.apply(this, arguments); - }; - } - - // Returns a function that is the composition of a list of functions, each - // consuming the return value of the function that follows. - function compose() { - var args = arguments; - var start = args.length - 1; - return function() { - var i = start; - var result = args[start].apply(this, arguments); - while (i--) result = args[i].call(this, result); - return result; - }; - } - - // Returns a function that will only be executed on and after the Nth call. - function after(times, func) { - return function() { - if (--times < 1) { - return func.apply(this, arguments); - } - }; - } - - // Returns a function that will only be executed up to (but not including) the - // Nth call. - function before(times, func) { - var memo; - return function() { - if (--times > 0) { - memo = func.apply(this, arguments); - } - if (times <= 1) func = null; - return memo; - }; - } - - // Returns a function that will be executed at most one time, no matter how - // often you call it. Useful for lazy initialization. - var once = partial(before, 2); - - // Returns the first key on an object that passes a truth test. - function findKey(obj, predicate, context) { - predicate = cb(predicate, context); - var _keys = keys(obj), key; - for (var i = 0, length = _keys.length; i < length; i++) { - key = _keys[i]; - if (predicate(obj[key], key, obj)) return key; - } - } - - // Internal function to generate `_.findIndex` and `_.findLastIndex`. - function createPredicateIndexFinder(dir) { - return function(array, predicate, context) { - predicate = cb(predicate, context); - var length = getLength(array); - var index = dir > 0 ? 0 : length - 1; - for (; index >= 0 && index < length; index += dir) { - if (predicate(array[index], index, array)) return index; - } - return -1; - }; - } - - // Returns the first index on an array-like that passes a truth test. - var findIndex = createPredicateIndexFinder(1); - - // Returns the last index on an array-like that passes a truth test. - var findLastIndex = createPredicateIndexFinder(-1); - - // Use a comparator function to figure out the smallest index at which - // an object should be inserted so as to maintain order. Uses binary search. - function sortedIndex(array, obj, iteratee, context) { - iteratee = cb(iteratee, context, 1); - var value = iteratee(obj); - var low = 0, high = getLength(array); - while (low < high) { - var mid = Math.floor((low + high) / 2); - if (iteratee(array[mid]) < value) low = mid + 1; else high = mid; - } - return low; - } - - // Internal function to generate the `_.indexOf` and `_.lastIndexOf` functions. - function createIndexFinder(dir, predicateFind, sortedIndex) { - return function(array, item, idx) { - var i = 0, length = getLength(array); - if (typeof idx == 'number') { - if (dir > 0) { - i = idx >= 0 ? idx : Math.max(idx + length, i); - } else { - length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1; - } - } else if (sortedIndex && idx && length) { - idx = sortedIndex(array, item); - return array[idx] === item ? idx : -1; - } - if (item !== item) { - idx = predicateFind(slice.call(array, i, length), isNaN$1); - return idx >= 0 ? idx + i : -1; - } - for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) { - if (array[idx] === item) return idx; - } - return -1; - }; - } - - // Return the position of the first occurrence of an item in an array, - // or -1 if the item is not included in the array. - // If the array is large and already in sort order, pass `true` - // for **isSorted** to use binary search. - var indexOf = createIndexFinder(1, findIndex, sortedIndex); - - // Return the position of the last occurrence of an item in an array, - // or -1 if the item is not included in the array. - var lastIndexOf = createIndexFinder(-1, findLastIndex); - - // Return the first value which passes a truth test. - function find(obj, predicate, context) { - var keyFinder = isArrayLike(obj) ? findIndex : findKey; - var key = keyFinder(obj, predicate, context); - if (key !== void 0 && key !== -1) return obj[key]; - } - - // Convenience version of a common use case of `_.find`: getting the first - // object containing specific `key:value` pairs. - function findWhere(obj, attrs) { - return find(obj, matcher(attrs)); - } - - // The cornerstone for collection functions, an `each` - // implementation, aka `forEach`. - // Handles raw objects in addition to array-likes. Treats all - // sparse array-likes as if they were dense. - function each(obj, iteratee, context) { - iteratee = optimizeCb(iteratee, context); - var i, length; - if (isArrayLike(obj)) { - for (i = 0, length = obj.length; i < length; i++) { - iteratee(obj[i], i, obj); - } - } else { - var _keys = keys(obj); - for (i = 0, length = _keys.length; i < length; i++) { - iteratee(obj[_keys[i]], _keys[i], obj); - } - } - return obj; - } - - // Return the results of applying the iteratee to each element. - function map(obj, iteratee, context) { - iteratee = cb(iteratee, context); - var _keys = !isArrayLike(obj) && keys(obj), - length = (_keys || obj).length, - results = Array(length); - for (var index = 0; index < length; index++) { - var currentKey = _keys ? _keys[index] : index; - results[index] = iteratee(obj[currentKey], currentKey, obj); - } - return results; - } - - // Internal helper to create a reducing function, iterating left or right. - function createReduce(dir) { - // Wrap code that reassigns argument variables in a separate function than - // the one that accesses `arguments.length` to avoid a perf hit. (#1991) - var reducer = function(obj, iteratee, memo, initial) { - var _keys = !isArrayLike(obj) && keys(obj), - length = (_keys || obj).length, - index = dir > 0 ? 0 : length - 1; - if (!initial) { - memo = obj[_keys ? _keys[index] : index]; - index += dir; - } - for (; index >= 0 && index < length; index += dir) { - var currentKey = _keys ? _keys[index] : index; - memo = iteratee(memo, obj[currentKey], currentKey, obj); - } - return memo; - }; - - return function(obj, iteratee, memo, context) { - var initial = arguments.length >= 3; - return reducer(obj, optimizeCb(iteratee, context, 4), memo, initial); - }; - } - - // **Reduce** builds up a single result from a list of values, aka `inject`, - // or `foldl`. - var reduce = createReduce(1); - - // The right-associative version of reduce, also known as `foldr`. - var reduceRight = createReduce(-1); - - // Return all the elements that pass a truth test. - function filter(obj, predicate, context) { - var results = []; - predicate = cb(predicate, context); - each(obj, function(value, index, list) { - if (predicate(value, index, list)) results.push(value); - }); - return results; - } - - // Return all the elements for which a truth test fails. - function reject(obj, predicate, context) { - return filter(obj, negate(cb(predicate)), context); - } - - // Determine whether all of the elements pass a truth test. - function every(obj, predicate, context) { - predicate = cb(predicate, context); - var _keys = !isArrayLike(obj) && keys(obj), - length = (_keys || obj).length; - for (var index = 0; index < length; index++) { - var currentKey = _keys ? _keys[index] : index; - if (!predicate(obj[currentKey], currentKey, obj)) return false; - } - return true; - } - - // Determine if at least one element in the object passes a truth test. - function some(obj, predicate, context) { - predicate = cb(predicate, context); - var _keys = !isArrayLike(obj) && keys(obj), - length = (_keys || obj).length; - for (var index = 0; index < length; index++) { - var currentKey = _keys ? _keys[index] : index; - if (predicate(obj[currentKey], currentKey, obj)) return true; - } - return false; - } - - // Determine if the array or object contains a given item (using `===`). - function contains(obj, item, fromIndex, guard) { - if (!isArrayLike(obj)) obj = values(obj); - if (typeof fromIndex != 'number' || guard) fromIndex = 0; - return indexOf(obj, item, fromIndex) >= 0; - } - - // Invoke a method (with arguments) on every item in a collection. - var invoke = restArguments(function(obj, path, args) { - var contextPath, func; - if (isFunction$1(path)) { - func = path; - } else { - path = toPath(path); - contextPath = path.slice(0, -1); - path = path[path.length - 1]; - } - return map(obj, function(context) { - var method = func; - if (!method) { - if (contextPath && contextPath.length) { - context = deepGet(context, contextPath); - } - if (context == null) return void 0; - method = context[path]; - } - return method == null ? method : method.apply(context, args); - }); - }); - - // Convenience version of a common use case of `_.map`: fetching a property. - function pluck(obj, key) { - return map(obj, property(key)); - } - - // Convenience version of a common use case of `_.filter`: selecting only - // objects containing specific `key:value` pairs. - function where(obj, attrs) { - return filter(obj, matcher(attrs)); - } - - // Return the maximum element (or element-based computation). - function max(obj, iteratee, context) { - var result = -Infinity, lastComputed = -Infinity, - value, computed; - if (iteratee == null || (typeof iteratee == 'number' && typeof obj[0] != 'object' && obj != null)) { - obj = isArrayLike(obj) ? obj : values(obj); - for (var i = 0, length = obj.length; i < length; i++) { - value = obj[i]; - if (value != null && value > result) { - result = value; - } - } - } else { - iteratee = cb(iteratee, context); - each(obj, function(v, index, list) { - computed = iteratee(v, index, list); - if (computed > lastComputed || (computed === -Infinity && result === -Infinity)) { - result = v; - lastComputed = computed; - } - }); - } - return result; - } - - // Return the minimum element (or element-based computation). - function min(obj, iteratee, context) { - var result = Infinity, lastComputed = Infinity, - value, computed; - if (iteratee == null || (typeof iteratee == 'number' && typeof obj[0] != 'object' && obj != null)) { - obj = isArrayLike(obj) ? obj : values(obj); - for (var i = 0, length = obj.length; i < length; i++) { - value = obj[i]; - if (value != null && value < result) { - result = value; - } - } - } else { - iteratee = cb(iteratee, context); - each(obj, function(v, index, list) { - computed = iteratee(v, index, list); - if (computed < lastComputed || (computed === Infinity && result === Infinity)) { - result = v; - lastComputed = computed; - } - }); - } - return result; - } - - // Safely create a real, live array from anything iterable. - var reStrSymbol = /[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g; - function toArray(obj) { - if (!obj) return []; - if (isArray(obj)) return slice.call(obj); - if (isString(obj)) { - // Keep surrogate pair characters together. - return obj.match(reStrSymbol); - } - if (isArrayLike(obj)) return map(obj, identity); - return values(obj); - } - - // Sample **n** random values from a collection using the modern version of the - // [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher–Yates_shuffle). - // If **n** is not specified, returns a single random element. - // The internal `guard` argument allows it to work with `_.map`. - function sample(obj, n, guard) { - if (n == null || guard) { - if (!isArrayLike(obj)) obj = values(obj); - return obj[random(obj.length - 1)]; - } - var sample = toArray(obj); - var length = getLength(sample); - n = Math.max(Math.min(n, length), 0); - var last = length - 1; - for (var index = 0; index < n; index++) { - var rand = random(index, last); - var temp = sample[index]; - sample[index] = sample[rand]; - sample[rand] = temp; - } - return sample.slice(0, n); - } - - // Shuffle a collection. - function shuffle(obj) { - return sample(obj, Infinity); - } - - // Sort the object's values by a criterion produced by an iteratee. - function sortBy(obj, iteratee, context) { - var index = 0; - iteratee = cb(iteratee, context); - return pluck(map(obj, function(value, key, list) { - return { - value: value, - index: index++, - criteria: iteratee(value, key, list) - }; - }).sort(function(left, right) { - var a = left.criteria; - var b = right.criteria; - if (a !== b) { - if (a > b || a === void 0) return 1; - if (a < b || b === void 0) return -1; - } - return left.index - right.index; - }), 'value'); - } - - // An internal function used for aggregate "group by" operations. - function group(behavior, partition) { - return function(obj, iteratee, context) { - var result = partition ? [[], []] : {}; - iteratee = cb(iteratee, context); - each(obj, function(value, index) { - var key = iteratee(value, index, obj); - behavior(result, value, key); - }); - return result; - }; - } - - // Groups the object's values by a criterion. Pass either a string attribute - // to group by, or a function that returns the criterion. - var groupBy = group(function(result, value, key) { - if (has$1(result, key)) result[key].push(value); else result[key] = [value]; - }); - - // Indexes the object's values by a criterion, similar to `_.groupBy`, but for - // when you know that your index values will be unique. - var indexBy = group(function(result, value, key) { - result[key] = value; - }); - - // Counts instances of an object that group by a certain criterion. Pass - // either a string attribute to count by, or a function that returns the - // criterion. - var countBy = group(function(result, value, key) { - if (has$1(result, key)) result[key]++; else result[key] = 1; - }); - - // Split a collection into two arrays: one whose elements all pass the given - // truth test, and one whose elements all do not pass the truth test. - var partition = group(function(result, value, pass) { - result[pass ? 0 : 1].push(value); - }, true); - - // Return the number of elements in a collection. - function size(obj) { - if (obj == null) return 0; - return isArrayLike(obj) ? obj.length : keys(obj).length; - } - - // Internal `_.pick` helper function to determine whether `key` is an enumerable - // property name of `obj`. - function keyInObj(value, key, obj) { - return key in obj; - } - - // Return a copy of the object only containing the allowed properties. - var pick = restArguments(function(obj, keys) { - var result = {}, iteratee = keys[0]; - if (obj == null) return result; - if (isFunction$1(iteratee)) { - if (keys.length > 1) iteratee = optimizeCb(iteratee, keys[1]); - keys = allKeys(obj); - } else { - iteratee = keyInObj; - keys = flatten$1(keys, false, false); - obj = Object(obj); - } - for (var i = 0, length = keys.length; i < length; i++) { - var key = keys[i]; - var value = obj[key]; - if (iteratee(value, key, obj)) result[key] = value; - } - return result; - }); - - // Return a copy of the object without the disallowed properties. - var omit = restArguments(function(obj, keys) { - var iteratee = keys[0], context; - if (isFunction$1(iteratee)) { - iteratee = negate(iteratee); - if (keys.length > 1) context = keys[1]; - } else { - keys = map(flatten$1(keys, false, false), String); - iteratee = function(value, key) { - return !contains(keys, key); - }; - } - return pick(obj, iteratee, context); - }); - - // Returns everything but the last entry of the array. Especially useful on - // the arguments object. Passing **n** will return all the values in - // the array, excluding the last N. - function initial(array, n, guard) { - return slice.call(array, 0, Math.max(0, array.length - (n == null || guard ? 1 : n))); - } - - // Get the first element of an array. Passing **n** will return the first N - // values in the array. The **guard** check allows it to work with `_.map`. - function first(array, n, guard) { - if (array == null || array.length < 1) return n == null || guard ? void 0 : []; - if (n == null || guard) return array[0]; - return initial(array, array.length - n); - } - - // Returns everything but the first entry of the `array`. Especially useful on - // the `arguments` object. Passing an **n** will return the rest N values in the - // `array`. - function rest(array, n, guard) { - return slice.call(array, n == null || guard ? 1 : n); - } - - // Get the last element of an array. Passing **n** will return the last N - // values in the array. - function last(array, n, guard) { - if (array == null || array.length < 1) return n == null || guard ? void 0 : []; - if (n == null || guard) return array[array.length - 1]; - return rest(array, Math.max(0, array.length - n)); - } - - // Trim out all falsy values from an array. - function compact(array) { - return filter(array, Boolean); - } - - // Flatten out an array, either recursively (by default), or up to `depth`. - // Passing `true` or `false` as `depth` means `1` or `Infinity`, respectively. - function flatten(array, depth) { - return flatten$1(array, depth, false); - } - - // Take the difference between one array and a number of other arrays. - // Only the elements present in just the first array will remain. - var difference = restArguments(function(array, rest) { - rest = flatten$1(rest, true, true); - return filter(array, function(value){ - return !contains(rest, value); - }); - }); - - // Return a version of the array that does not contain the specified value(s). - var without = restArguments(function(array, otherArrays) { - return difference(array, otherArrays); - }); - - // Produce a duplicate-free version of the array. If the array has already - // been sorted, you have the option of using a faster algorithm. - // The faster algorithm will not work with an iteratee if the iteratee - // is not a one-to-one function, so providing an iteratee will disable - // the faster algorithm. - function uniq(array, isSorted, iteratee, context) { - if (!isBoolean(isSorted)) { - context = iteratee; - iteratee = isSorted; - isSorted = false; - } - if (iteratee != null) iteratee = cb(iteratee, context); - var result = []; - var seen = []; - for (var i = 0, length = getLength(array); i < length; i++) { - var value = array[i], - computed = iteratee ? iteratee(value, i, array) : value; - if (isSorted && !iteratee) { - if (!i || seen !== computed) result.push(value); - seen = computed; - } else if (iteratee) { - if (!contains(seen, computed)) { - seen.push(computed); - result.push(value); - } - } else if (!contains(result, value)) { - result.push(value); - } - } - return result; - } - - // Produce an array that contains the union: each distinct element from all of - // the passed-in arrays. - var union = restArguments(function(arrays) { - return uniq(flatten$1(arrays, true, true)); - }); - - // Produce an array that contains every item shared between all the - // passed-in arrays. - function intersection(array) { - var result = []; - var argsLength = arguments.length; - for (var i = 0, length = getLength(array); i < length; i++) { - var item = array[i]; - if (contains(result, item)) continue; - var j; - for (j = 1; j < argsLength; j++) { - if (!contains(arguments[j], item)) break; - } - if (j === argsLength) result.push(item); - } - return result; - } - - // Complement of zip. Unzip accepts an array of arrays and groups - // each array's elements on shared indices. - function unzip(array) { - var length = (array && max(array, getLength).length) || 0; - var result = Array(length); - - for (var index = 0; index < length; index++) { - result[index] = pluck(array, index); - } - return result; - } - - // Zip together multiple lists into a single array -- elements that share - // an index go together. - var zip = restArguments(unzip); - - // Converts lists into objects. Pass either a single array of `[key, value]` - // pairs, or two parallel arrays of the same length -- one of keys, and one of - // the corresponding values. Passing by pairs is the reverse of `_.pairs`. - function object(list, values) { - var result = {}; - for (var i = 0, length = getLength(list); i < length; i++) { - if (values) { - result[list[i]] = values[i]; - } else { - result[list[i][0]] = list[i][1]; - } - } - return result; - } - - // Generate an integer Array containing an arithmetic progression. A port of - // the native Python `range()` function. See - // [the Python documentation](https://docs.python.org/library/functions.html#range). - function range(start, stop, step) { - if (stop == null) { - stop = start || 0; - start = 0; - } - if (!step) { - step = stop < start ? -1 : 1; - } - - var length = Math.max(Math.ceil((stop - start) / step), 0); - var range = Array(length); - - for (var idx = 0; idx < length; idx++, start += step) { - range[idx] = start; - } - - return range; - } - - // Chunk a single array into multiple arrays, each containing `count` or fewer - // items. - function chunk(array, count) { - if (count == null || count < 1) return []; - var result = []; - var i = 0, length = array.length; - while (i < length) { - result.push(slice.call(array, i, i += count)); - } - return result; - } - - // Helper function to continue chaining intermediate results. - function chainResult(instance, obj) { - return instance._chain ? _$1(obj).chain() : obj; - } - - // Add your own custom functions to the Underscore object. - function mixin(obj) { - each(functions(obj), function(name) { - var func = _$1[name] = obj[name]; - _$1.prototype[name] = function() { - var args = [this._wrapped]; - push.apply(args, arguments); - return chainResult(this, func.apply(_$1, args)); - }; - }); - return _$1; - } - - // Add all mutator `Array` functions to the wrapper. - each(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(name) { - var method = ArrayProto[name]; - _$1.prototype[name] = function() { - var obj = this._wrapped; - if (obj != null) { - method.apply(obj, arguments); - if ((name === 'shift' || name === 'splice') && obj.length === 0) { - delete obj[0]; - } - } - return chainResult(this, obj); - }; - }); - - // Add all accessor `Array` functions to the wrapper. - each(['concat', 'join', 'slice'], function(name) { - var method = ArrayProto[name]; - _$1.prototype[name] = function() { - var obj = this._wrapped; - if (obj != null) obj = method.apply(obj, arguments); - return chainResult(this, obj); - }; - }); - - // Named Exports - - var allExports = { - __proto__: null, - VERSION: VERSION, - restArguments: restArguments, - isObject: isObject, - isNull: isNull, - isUndefined: isUndefined, - isBoolean: isBoolean, - isElement: isElement, - isString: isString, - isNumber: isNumber, - isDate: isDate, - isRegExp: isRegExp, - isError: isError, - isSymbol: isSymbol, - isArrayBuffer: isArrayBuffer, - isDataView: isDataView$1, - isArray: isArray, - isFunction: isFunction$1, - isArguments: isArguments$1, - isFinite: isFinite$1, - isNaN: isNaN$1, - isTypedArray: isTypedArray$1, - isEmpty: isEmpty, - isMatch: isMatch, - isEqual: isEqual, - isMap: isMap, - isWeakMap: isWeakMap, - isSet: isSet, - isWeakSet: isWeakSet, - keys: keys, - allKeys: allKeys, - values: values, - pairs: pairs, - invert: invert, - functions: functions, - methods: functions, - extend: extend, - extendOwn: extendOwn, - assign: extendOwn, - defaults: defaults, - create: create, - clone: clone, - tap: tap, - get: get, - has: has, - mapObject: mapObject, - identity: identity, - constant: constant, - noop: noop, - toPath: toPath$1, - property: property, - propertyOf: propertyOf, - matcher: matcher, - matches: matcher, - times: times, - random: random, - now: now, - escape: _escape, - unescape: _unescape, - templateSettings: templateSettings, - template: template, - result: result, - uniqueId: uniqueId, - chain: chain, - iteratee: iteratee, - partial: partial, - bind: bind, - bindAll: bindAll, - memoize: memoize, - delay: delay, - defer: defer, - throttle: throttle, - debounce: debounce, - wrap: wrap, - negate: negate, - compose: compose, - after: after, - before: before, - once: once, - findKey: findKey, - findIndex: findIndex, - findLastIndex: findLastIndex, - sortedIndex: sortedIndex, - indexOf: indexOf, - lastIndexOf: lastIndexOf, - find: find, - detect: find, - findWhere: findWhere, - each: each, - forEach: each, - map: map, - collect: map, - reduce: reduce, - foldl: reduce, - inject: reduce, - reduceRight: reduceRight, - foldr: reduceRight, - filter: filter, - select: filter, - reject: reject, - every: every, - all: every, - some: some, - any: some, - contains: contains, - includes: contains, - include: contains, - invoke: invoke, - pluck: pluck, - where: where, - max: max, - min: min, - shuffle: shuffle, - sample: sample, - sortBy: sortBy, - groupBy: groupBy, - indexBy: indexBy, - countBy: countBy, - partition: partition, - toArray: toArray, - size: size, - pick: pick, - omit: omit, - first: first, - head: first, - take: first, - initial: initial, - last: last, - rest: rest, - tail: rest, - drop: rest, - compact: compact, - flatten: flatten, - without: without, - uniq: uniq, - unique: uniq, - union: union, - intersection: intersection, - difference: difference, - unzip: unzip, - transpose: unzip, - zip: zip, - object: object, - range: range, - chunk: chunk, - mixin: mixin, - 'default': _$1 - }; - - // Default Export - - // Add all of the Underscore functions to the wrapper object. - var _ = mixin(allExports); - // Legacy Node.js API. - _._ = _; - - return _; - -}))); -//# sourceMappingURL=underscore-umd.js.map diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/util-deprecate/History.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/util-deprecate/History.md deleted file mode 100644 index acc86753..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/util-deprecate/History.md +++ /dev/null @@ -1,16 +0,0 @@ - -1.0.2 / 2015-10-07 -================== - - * use try/catch when checking `localStorage` (#3, @kumavis) - -1.0.1 / 2014-11-25 -================== - - * browser: use `console.warn()` for deprecation calls - * browser: more jsdocs - -1.0.0 / 2014-04-30 -================== - - * initial commit diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/util-deprecate/LICENSE b/packages/wyatt_notification_bloc/example/scripts/node_modules/util-deprecate/LICENSE deleted file mode 100644 index 6a60e8c2..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/util-deprecate/LICENSE +++ /dev/null @@ -1,24 +0,0 @@ -(The MIT License) - -Copyright (c) 2014 Nathan Rajlich - -Permission is hereby granted, free of charge, to any person -obtaining a copy of this software and associated documentation -files (the "Software"), to deal in the Software without -restriction, including without limitation the rights to use, -copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following -conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/util-deprecate/README.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/util-deprecate/README.md deleted file mode 100644 index 75622fa7..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/util-deprecate/README.md +++ /dev/null @@ -1,53 +0,0 @@ -util-deprecate -============== -### The Node.js `util.deprecate()` function with browser support - -In Node.js, this module simply re-exports the `util.deprecate()` function. - -In the web browser (i.e. via browserify), a browser-specific implementation -of the `util.deprecate()` function is used. - - -## API - -A `deprecate()` function is the only thing exposed by this module. - -``` javascript -// setup: -exports.foo = deprecate(foo, 'foo() is deprecated, use bar() instead'); - - -// users see: -foo(); -// foo() is deprecated, use bar() instead -foo(); -foo(); -``` - - -## License - -(The MIT License) - -Copyright (c) 2014 Nathan Rajlich - -Permission is hereby granted, free of charge, to any person -obtaining a copy of this software and associated documentation -files (the "Software"), to deal in the Software without -restriction, including without limitation the rights to use, -copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following -conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/util-deprecate/browser.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/util-deprecate/browser.js deleted file mode 100644 index 549ae2f0..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/util-deprecate/browser.js +++ /dev/null @@ -1,67 +0,0 @@ - -/** - * Module exports. - */ - -module.exports = deprecate; - -/** - * Mark that a method should not be used. - * Returns a modified function which warns once by default. - * - * If `localStorage.noDeprecation = true` is set, then it is a no-op. - * - * If `localStorage.throwDeprecation = true` is set, then deprecated functions - * will throw an Error when invoked. - * - * If `localStorage.traceDeprecation = true` is set, then deprecated functions - * will invoke `console.trace()` instead of `console.error()`. - * - * @param {Function} fn - the function to deprecate - * @param {String} msg - the string to print to the console when `fn` is invoked - * @returns {Function} a new "deprecated" version of `fn` - * @api public - */ - -function deprecate (fn, msg) { - if (config('noDeprecation')) { - return fn; - } - - var warned = false; - function deprecated() { - if (!warned) { - if (config('throwDeprecation')) { - throw new Error(msg); - } else if (config('traceDeprecation')) { - console.trace(msg); - } else { - console.warn(msg); - } - warned = true; - } - return fn.apply(this, arguments); - } - - return deprecated; -} - -/** - * Checks `localStorage` for boolean values for the given `name`. - * - * @param {String} name - * @returns {Boolean} - * @api private - */ - -function config (name) { - // accessing global.localStorage can trigger a DOMException in sandboxed iframes - try { - if (!global.localStorage) return false; - } catch (_) { - return false; - } - var val = global.localStorage[name]; - if (null == val) return false; - return String(val).toLowerCase() === 'true'; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/util-deprecate/node.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/util-deprecate/node.js deleted file mode 100644 index 5e6fcff5..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/util-deprecate/node.js +++ /dev/null @@ -1,6 +0,0 @@ - -/** - * For Node.js, simply re-export the core `util.deprecate` function. - */ - -module.exports = require('util').deprecate; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/util-deprecate/package.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/util-deprecate/package.json deleted file mode 100644 index 2e79f89a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/util-deprecate/package.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "name": "util-deprecate", - "version": "1.0.2", - "description": "The Node.js `util.deprecate()` function with browser support", - "main": "node.js", - "browser": "browser.js", - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "repository": { - "type": "git", - "url": "git://github.com/TooTallNate/util-deprecate.git" - }, - "keywords": [ - "util", - "deprecate", - "browserify", - "browser", - "node" - ], - "author": "Nathan Rajlich (http://n8.io/)", - "license": "MIT", - "bugs": { - "url": "https://github.com/TooTallNate/util-deprecate/issues" - }, - "homepage": "https://github.com/TooTallNate/util-deprecate" -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/CHANGELOG.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/CHANGELOG.md deleted file mode 100644 index d4d3972c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/CHANGELOG.md +++ /dev/null @@ -1,268 +0,0 @@ -# Changelog - -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. - -## [9.0.0](https://github.com/uuidjs/uuid/compare/v8.3.2...v9.0.0) (2022-09-05) - -### ⚠ BREAKING CHANGES - -- Drop Node.js 10.x support. This library always aims at supporting one EOLed LTS release which by this time now is 12.x which has reached EOL 30 Apr 2022. - -- Remove the minified UMD build from the package. - - Minified code is hard to audit and since this is a widely used library it seems more appropriate nowadays to optimize for auditability than to ship a legacy module format that, at best, serves educational purposes nowadays. - - For production browser use cases, users should be using a bundler. For educational purposes, today's online sandboxes like replit.com offer convenient ways to load npm modules, so the use case for UMD through repos like UNPKG or jsDelivr has largely vanished. - -- Drop IE 11 and Safari 10 support. Drop support for browsers that don't correctly implement const/let and default arguments, and no longer transpile the browser build to ES2015. - - This also removes the fallback on msCrypto instead of the crypto API. - - Browser tests are run in the first supported version of each supported browser and in the latest (as of this commit) version available on Browserstack. - -### Features - -- optimize uuid.v1 by 1.3x uuid.v4 by 4.3x (430%) ([#597](https://github.com/uuidjs/uuid/issues/597)) ([3a033f6](https://github.com/uuidjs/uuid/commit/3a033f6bab6bb3780ece6d645b902548043280bc)) -- remove UMD build ([#645](https://github.com/uuidjs/uuid/issues/645)) ([e948a0f](https://github.com/uuidjs/uuid/commit/e948a0f22bf22f4619b27bd913885e478e20fe6f)), closes [#620](https://github.com/uuidjs/uuid/issues/620) -- use native crypto.randomUUID when available ([#600](https://github.com/uuidjs/uuid/issues/600)) ([c9e076c](https://github.com/uuidjs/uuid/commit/c9e076c852edad7e9a06baaa1d148cf4eda6c6c4)) - -### Bug Fixes - -- add Jest/jsdom compatibility ([#642](https://github.com/uuidjs/uuid/issues/642)) ([16f9c46](https://github.com/uuidjs/uuid/commit/16f9c469edf46f0786164cdf4dc980743984a6fd)) -- change default export to named function ([#545](https://github.com/uuidjs/uuid/issues/545)) ([c57bc5a](https://github.com/uuidjs/uuid/commit/c57bc5a9a0653273aa639cda9177ce52efabe42a)) -- handle error when parameter is not set in v3 and v5 ([#622](https://github.com/uuidjs/uuid/issues/622)) ([fcd7388](https://github.com/uuidjs/uuid/commit/fcd73881692d9fabb63872576ba28e30ff852091)) -- run npm audit fix ([#644](https://github.com/uuidjs/uuid/issues/644)) ([04686f5](https://github.com/uuidjs/uuid/commit/04686f54c5fed2cfffc1b619f4970c4bb8532353)) -- upgrading from uuid3 broken link ([#568](https://github.com/uuidjs/uuid/issues/568)) ([1c849da](https://github.com/uuidjs/uuid/commit/1c849da6e164259e72e18636726345b13a7eddd6)) - -### build - -- drop Node.js 8.x from babel transpile target ([#603](https://github.com/uuidjs/uuid/issues/603)) ([aa11485](https://github.com/uuidjs/uuid/commit/aa114858260402107ec8a1e1a825dea0a259bcb5)) -- drop support for legacy browsers (IE11, Safari 10) ([#604](https://github.com/uuidjs/uuid/issues/604)) ([0f433e5](https://github.com/uuidjs/uuid/commit/0f433e5ec444edacd53016de67db021102f36148)) - -- drop node 10.x to upgrade dev dependencies ([#653](https://github.com/uuidjs/uuid/issues/653)) ([28a5712](https://github.com/uuidjs/uuid/commit/28a571283f8abda6b9d85e689f95b7d3ee9e282e)), closes [#643](https://github.com/uuidjs/uuid/issues/643) - -### [8.3.2](https://github.com/uuidjs/uuid/compare/v8.3.1...v8.3.2) (2020-12-08) - -### Bug Fixes - -- lazy load getRandomValues ([#537](https://github.com/uuidjs/uuid/issues/537)) ([16c8f6d](https://github.com/uuidjs/uuid/commit/16c8f6df2f6b09b4d6235602d6a591188320a82e)), closes [#536](https://github.com/uuidjs/uuid/issues/536) - -### [8.3.1](https://github.com/uuidjs/uuid/compare/v8.3.0...v8.3.1) (2020-10-04) - -### Bug Fixes - -- support expo>=39.0.0 ([#515](https://github.com/uuidjs/uuid/issues/515)) ([c65a0f3](https://github.com/uuidjs/uuid/commit/c65a0f3fa73b901959d638d1e3591dfacdbed867)), closes [#375](https://github.com/uuidjs/uuid/issues/375) - -## [8.3.0](https://github.com/uuidjs/uuid/compare/v8.2.0...v8.3.0) (2020-07-27) - -### Features - -- add parse/stringify/validate/version/NIL APIs ([#479](https://github.com/uuidjs/uuid/issues/479)) ([0e6c10b](https://github.com/uuidjs/uuid/commit/0e6c10ba1bf9517796ff23c052fc0468eedfd5f4)), closes [#475](https://github.com/uuidjs/uuid/issues/475) [#478](https://github.com/uuidjs/uuid/issues/478) [#480](https://github.com/uuidjs/uuid/issues/480) [#481](https://github.com/uuidjs/uuid/issues/481) [#180](https://github.com/uuidjs/uuid/issues/180) - -## [8.2.0](https://github.com/uuidjs/uuid/compare/v8.1.0...v8.2.0) (2020-06-23) - -### Features - -- improve performance of v1 string representation ([#453](https://github.com/uuidjs/uuid/issues/453)) ([0ee0b67](https://github.com/uuidjs/uuid/commit/0ee0b67c37846529c66089880414d29f3ae132d5)) -- remove deprecated v4 string parameter ([#454](https://github.com/uuidjs/uuid/issues/454)) ([88ce3ca](https://github.com/uuidjs/uuid/commit/88ce3ca0ba046f60856de62c7ce03f7ba98ba46c)), closes [#437](https://github.com/uuidjs/uuid/issues/437) -- support jspm ([#473](https://github.com/uuidjs/uuid/issues/473)) ([e9f2587](https://github.com/uuidjs/uuid/commit/e9f2587a92575cac31bc1d4ae944e17c09756659)) - -### Bug Fixes - -- prepare package exports for webpack 5 ([#468](https://github.com/uuidjs/uuid/issues/468)) ([8d6e6a5](https://github.com/uuidjs/uuid/commit/8d6e6a5f8965ca9575eb4d92e99a43435f4a58a8)) - -## [8.1.0](https://github.com/uuidjs/uuid/compare/v8.0.0...v8.1.0) (2020-05-20) - -### Features - -- improve v4 performance by reusing random number array ([#435](https://github.com/uuidjs/uuid/issues/435)) ([bf4af0d](https://github.com/uuidjs/uuid/commit/bf4af0d711b4d2ed03d1f74fd12ad0baa87dc79d)) -- optimize V8 performance of bytesToUuid ([#434](https://github.com/uuidjs/uuid/issues/434)) ([e156415](https://github.com/uuidjs/uuid/commit/e156415448ec1af2351fa0b6660cfb22581971f2)) - -### Bug Fixes - -- export package.json required by react-native and bundlers ([#449](https://github.com/uuidjs/uuid/issues/449)) ([be1c8fe](https://github.com/uuidjs/uuid/commit/be1c8fe9a3206c358e0059b52fafd7213aa48a52)), closes [ai/nanoevents#44](https://github.com/ai/nanoevents/issues/44#issuecomment-602010343) [#444](https://github.com/uuidjs/uuid/issues/444) - -## [8.0.0](https://github.com/uuidjs/uuid/compare/v7.0.3...v8.0.0) (2020-04-29) - -### ⚠ BREAKING CHANGES - -- For native ECMAScript Module (ESM) usage in Node.js only named exports are exposed, there is no more default export. - - ```diff - -import uuid from 'uuid'; - -console.log(uuid.v4()); // -> 'cd6c3b08-0adc-4f4b-a6ef-36087a1c9869' - +import { v4 as uuidv4 } from 'uuid'; - +uuidv4(); // ⇨ '9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d' - ``` - -- Deep requiring specific algorithms of this library like `require('uuid/v4')`, which has been deprecated in `uuid@7`, is no longer supported. - - Instead use the named exports that this module exports. - - For ECMAScript Modules (ESM): - - ```diff - -import uuidv4 from 'uuid/v4'; - +import { v4 as uuidv4 } from 'uuid'; - uuidv4(); - ``` - - For CommonJS: - - ```diff - -const uuidv4 = require('uuid/v4'); - +const { v4: uuidv4 } = require('uuid'); - uuidv4(); - ``` - -### Features - -- native Node.js ES Modules (wrapper approach) ([#423](https://github.com/uuidjs/uuid/issues/423)) ([2d9f590](https://github.com/uuidjs/uuid/commit/2d9f590ad9701d692625c07ed62f0a0f91227991)), closes [#245](https://github.com/uuidjs/uuid/issues/245) [#419](https://github.com/uuidjs/uuid/issues/419) [#342](https://github.com/uuidjs/uuid/issues/342) -- remove deep requires ([#426](https://github.com/uuidjs/uuid/issues/426)) ([daf72b8](https://github.com/uuidjs/uuid/commit/daf72b84ceb20272a81bb5fbddb05dd95922cbba)) - -### Bug Fixes - -- add CommonJS syntax example to README quickstart section ([#417](https://github.com/uuidjs/uuid/issues/417)) ([e0ec840](https://github.com/uuidjs/uuid/commit/e0ec8402c7ad44b7ef0453036c612f5db513fda0)) - -### [7.0.3](https://github.com/uuidjs/uuid/compare/v7.0.2...v7.0.3) (2020-03-31) - -### Bug Fixes - -- make deep require deprecation warning work in browsers ([#409](https://github.com/uuidjs/uuid/issues/409)) ([4b71107](https://github.com/uuidjs/uuid/commit/4b71107d8c0d2ef56861ede6403fc9dc35a1e6bf)), closes [#408](https://github.com/uuidjs/uuid/issues/408) - -### [7.0.2](https://github.com/uuidjs/uuid/compare/v7.0.1...v7.0.2) (2020-03-04) - -### Bug Fixes - -- make access to msCrypto consistent ([#393](https://github.com/uuidjs/uuid/issues/393)) ([8bf2a20](https://github.com/uuidjs/uuid/commit/8bf2a20f3565df743da7215eebdbada9d2df118c)) -- simplify link in deprecation warning ([#391](https://github.com/uuidjs/uuid/issues/391)) ([bb2c8e4](https://github.com/uuidjs/uuid/commit/bb2c8e4e9f4c5f9c1eaaf3ea59710c633cd90cb7)) -- update links to match content in readme ([#386](https://github.com/uuidjs/uuid/issues/386)) ([44f2f86](https://github.com/uuidjs/uuid/commit/44f2f86e9d2bbf14ee5f0f00f72a3db1292666d4)) - -### [7.0.1](https://github.com/uuidjs/uuid/compare/v7.0.0...v7.0.1) (2020-02-25) - -### Bug Fixes - -- clean up esm builds for node and browser ([#383](https://github.com/uuidjs/uuid/issues/383)) ([59e6a49](https://github.com/uuidjs/uuid/commit/59e6a49e7ce7b3e8fb0f3ee52b9daae72af467dc)) -- provide browser versions independent from module system ([#380](https://github.com/uuidjs/uuid/issues/380)) ([4344a22](https://github.com/uuidjs/uuid/commit/4344a22e7aed33be8627eeaaf05360f256a21753)), closes [#378](https://github.com/uuidjs/uuid/issues/378) - -## [7.0.0](https://github.com/uuidjs/uuid/compare/v3.4.0...v7.0.0) (2020-02-24) - -### ⚠ BREAKING CHANGES - -- The default export, which used to be the v4() method but which was already discouraged in v3.x of this library, has been removed. -- Explicitly note that deep imports of the different uuid version functions are deprecated and no longer encouraged and that ECMAScript module named imports should be used instead. Emit a deprecation warning for people who deep-require the different algorithm variants. -- Remove builtin support for insecure random number generators in the browser. Users who want that will have to supply their own random number generator function. -- Remove support for generating v3 and v5 UUIDs in Node.js<4.x -- Convert code base to ECMAScript Modules (ESM) and release CommonJS build for node and ESM build for browser bundlers. - -### Features - -- add UMD build to npm package ([#357](https://github.com/uuidjs/uuid/issues/357)) ([4e75adf](https://github.com/uuidjs/uuid/commit/4e75adf435196f28e3fbbe0185d654b5ded7ca2c)), closes [#345](https://github.com/uuidjs/uuid/issues/345) -- add various es module and CommonJS examples ([b238510](https://github.com/uuidjs/uuid/commit/b238510bf352463521f74bab175a3af9b7a42555)) -- ensure that docs are up-to-date in CI ([ee5e77d](https://github.com/uuidjs/uuid/commit/ee5e77db547474f5a8f23d6c857a6d399209986b)) -- hybrid CommonJS & ECMAScript modules build ([a3f078f](https://github.com/uuidjs/uuid/commit/a3f078faa0baff69ab41aed08e041f8f9c8993d0)) -- remove insecure fallback random number generator ([3a5842b](https://github.com/uuidjs/uuid/commit/3a5842b141a6e5de0ae338f391661e6b84b167c9)), closes [#173](https://github.com/uuidjs/uuid/issues/173) -- remove support for pre Node.js v4 Buffer API ([#356](https://github.com/uuidjs/uuid/issues/356)) ([b59b5c5](https://github.com/uuidjs/uuid/commit/b59b5c5ecad271c5453f1a156f011671f6d35627)) -- rename repository to github:uuidjs/uuid ([#351](https://github.com/uuidjs/uuid/issues/351)) ([c37a518](https://github.com/uuidjs/uuid/commit/c37a518e367ac4b6d0aa62dba1bc6ce9e85020f7)), closes [#338](https://github.com/uuidjs/uuid/issues/338) - -### Bug Fixes - -- add deep-require proxies for local testing and adjust tests ([#365](https://github.com/uuidjs/uuid/issues/365)) ([7fedc79](https://github.com/uuidjs/uuid/commit/7fedc79ac8fda4bfd1c566c7f05ef4ac13b2db48)) -- add note about removal of default export ([#372](https://github.com/uuidjs/uuid/issues/372)) ([12749b7](https://github.com/uuidjs/uuid/commit/12749b700eb49db8a9759fd306d8be05dbfbd58c)), closes [#370](https://github.com/uuidjs/uuid/issues/370) -- deprecated deep requiring of the different algorithm versions ([#361](https://github.com/uuidjs/uuid/issues/361)) ([c0bdf15](https://github.com/uuidjs/uuid/commit/c0bdf15e417639b1aeb0b247b2fb11f7a0a26b23)) - -## [3.4.0](https://github.com/uuidjs/uuid/compare/v3.3.3...v3.4.0) (2020-01-16) - -### Features - -- rename repository to github:uuidjs/uuid ([#351](https://github.com/uuidjs/uuid/issues/351)) ([e2d7314](https://github.com/uuidjs/uuid/commit/e2d7314)), closes [#338](https://github.com/uuidjs/uuid/issues/338) - -## [3.3.3](https://github.com/uuidjs/uuid/compare/v3.3.2...v3.3.3) (2019-08-19) - -### Bug Fixes - -- no longer run ci tests on node v4 -- upgrade dependencies - -## [3.3.2](https://github.com/uuidjs/uuid/compare/v3.3.1...v3.3.2) (2018-06-28) - -### Bug Fixes - -- typo ([305d877](https://github.com/uuidjs/uuid/commit/305d877)) - -## [3.3.1](https://github.com/uuidjs/uuid/compare/v3.3.0...v3.3.1) (2018-06-28) - -### Bug Fixes - -- fix [#284](https://github.com/uuidjs/uuid/issues/284) by setting function name in try-catch ([f2a60f2](https://github.com/uuidjs/uuid/commit/f2a60f2)) - -# [3.3.0](https://github.com/uuidjs/uuid/compare/v3.2.1...v3.3.0) (2018-06-22) - -### Bug Fixes - -- assignment to readonly property to allow running in strict mode ([#270](https://github.com/uuidjs/uuid/issues/270)) ([d062fdc](https://github.com/uuidjs/uuid/commit/d062fdc)) -- fix [#229](https://github.com/uuidjs/uuid/issues/229) ([c9684d4](https://github.com/uuidjs/uuid/commit/c9684d4)) -- Get correct version of IE11 crypto ([#274](https://github.com/uuidjs/uuid/issues/274)) ([153d331](https://github.com/uuidjs/uuid/commit/153d331)) -- mem issue when generating uuid ([#267](https://github.com/uuidjs/uuid/issues/267)) ([c47702c](https://github.com/uuidjs/uuid/commit/c47702c)) - -### Features - -- enforce Conventional Commit style commit messages ([#282](https://github.com/uuidjs/uuid/issues/282)) ([cc9a182](https://github.com/uuidjs/uuid/commit/cc9a182)) - -## [3.2.1](https://github.com/uuidjs/uuid/compare/v3.2.0...v3.2.1) (2018-01-16) - -### Bug Fixes - -- use msCrypto if available. Fixes [#241](https://github.com/uuidjs/uuid/issues/241) ([#247](https://github.com/uuidjs/uuid/issues/247)) ([1fef18b](https://github.com/uuidjs/uuid/commit/1fef18b)) - -# [3.2.0](https://github.com/uuidjs/uuid/compare/v3.1.0...v3.2.0) (2018-01-16) - -### Bug Fixes - -- remove mistakenly added typescript dependency, rollback version (standard-version will auto-increment) ([09fa824](https://github.com/uuidjs/uuid/commit/09fa824)) -- use msCrypto if available. Fixes [#241](https://github.com/uuidjs/uuid/issues/241) ([#247](https://github.com/uuidjs/uuid/issues/247)) ([1fef18b](https://github.com/uuidjs/uuid/commit/1fef18b)) - -### Features - -- Add v3 Support ([#217](https://github.com/uuidjs/uuid/issues/217)) ([d94f726](https://github.com/uuidjs/uuid/commit/d94f726)) - -# [3.1.0](https://github.com/uuidjs/uuid/compare/v3.1.0...v3.0.1) (2017-06-17) - -### Bug Fixes - -- (fix) Add .npmignore file to exclude test/ and other non-essential files from packing. (#183) -- Fix typo (#178) -- Simple typo fix (#165) - -### Features - -- v5 support in CLI (#197) -- V5 support (#188) - -# 3.0.1 (2016-11-28) - -- split uuid versions into separate files - -# 3.0.0 (2016-11-17) - -- remove .parse and .unparse - -# 2.0.0 - -- Removed uuid.BufferClass - -# 1.4.0 - -- Improved module context detection -- Removed public RNG functions - -# 1.3.2 - -- Improve tests and handling of v1() options (Issue #24) -- Expose RNG option to allow for perf testing with different generators - -# 1.3.0 - -- Support for version 1 ids, thanks to [@ctavan](https://github.com/ctavan)! -- Support for node.js crypto API -- De-emphasizing performance in favor of a) cryptographic quality PRNGs where available and b) more manageable code diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/CONTRIBUTING.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/CONTRIBUTING.md deleted file mode 100644 index 4a4503d0..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/CONTRIBUTING.md +++ /dev/null @@ -1,18 +0,0 @@ -# Contributing - -Please feel free to file GitHub Issues or propose Pull Requests. We're always happy to discuss improvements to this library! - -## Testing - -```shell -npm test -``` - -## Releasing - -Releases are supposed to be done from master, version bumping is automated through [`standard-version`](https://github.com/conventional-changelog/standard-version): - -```shell -npm run release -- --dry-run # verify output manually -npm run release # follow the instructions from the output of this command -``` diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/LICENSE.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/LICENSE.md deleted file mode 100644 index 39341683..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/LICENSE.md +++ /dev/null @@ -1,9 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2010-2020 Robert Kieffer and other contributors - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/README.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/README.md deleted file mode 100644 index c1fb9ac1..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/README.md +++ /dev/null @@ -1,462 +0,0 @@ - - -# uuid [![CI](https://github.com/uuidjs/uuid/workflows/CI/badge.svg)](https://github.com/uuidjs/uuid/actions?query=workflow%3ACI) [![Browser](https://github.com/uuidjs/uuid/workflows/Browser/badge.svg)](https://github.com/uuidjs/uuid/actions?query=workflow%3ABrowser) - -For the creation of [RFC4122](https://www.ietf.org/rfc/rfc4122.txt) UUIDs - -- **Complete** - Support for RFC4122 version 1, 3, 4, and 5 UUIDs -- **Cross-platform** - Support for ... - - CommonJS, [ECMAScript Modules](#ecmascript-modules) and [CDN builds](#cdn-builds) - - Node 12, 14, 16, 18 - - Chrome, Safari, Firefox, Edge browsers - - Webpack and rollup.js module bundlers - - [React Native / Expo](#react-native--expo) -- **Secure** - Cryptographically-strong random values -- **Small** - Zero-dependency, small footprint, plays nice with "tree shaking" packagers -- **CLI** - Includes the [`uuid` command line](#command-line) utility - -**Upgrading from `uuid@3`?** Your code is probably okay, but check out [Upgrading From `uuid@3`](#upgrading-from-uuid3) for details. - -## Quickstart - -To create a random UUID... - -**1. Install** - -```shell -npm install uuid -``` - -**2. Create a UUID** (ES6 module syntax) - -```javascript -import { v4 as uuidv4 } from 'uuid'; -uuidv4(); // ⇨ '9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d' -``` - -... or using CommonJS syntax: - -```javascript -const { v4: uuidv4 } = require('uuid'); -uuidv4(); // ⇨ '1b9d6bcd-bbfd-4b2d-9b5d-ab8dfbbd4bed' -``` - -For timestamp UUIDs, namespace UUIDs, and other options read on ... - -## API Summary - -| | | | -| --- | --- | --- | -| [`uuid.NIL`](#uuidnil) | The nil UUID string (all zeros) | New in `uuid@8.3` | -| [`uuid.parse()`](#uuidparsestr) | Convert UUID string to array of bytes | New in `uuid@8.3` | -| [`uuid.stringify()`](#uuidstringifyarr-offset) | Convert array of bytes to UUID string | New in `uuid@8.3` | -| [`uuid.v1()`](#uuidv1options-buffer-offset) | Create a version 1 (timestamp) UUID | | -| [`uuid.v3()`](#uuidv3name-namespace-buffer-offset) | Create a version 3 (namespace w/ MD5) UUID | | -| [`uuid.v4()`](#uuidv4options-buffer-offset) | Create a version 4 (random) UUID | | -| [`uuid.v5()`](#uuidv5name-namespace-buffer-offset) | Create a version 5 (namespace w/ SHA-1) UUID | | -| [`uuid.validate()`](#uuidvalidatestr) | Test a string to see if it is a valid UUID | New in `uuid@8.3` | -| [`uuid.version()`](#uuidversionstr) | Detect RFC version of a UUID | New in `uuid@8.3` | - -## API - -### uuid.NIL - -The nil UUID string (all zeros). - -Example: - -```javascript -import { NIL as NIL_UUID } from 'uuid'; - -NIL_UUID; // ⇨ '00000000-0000-0000-0000-000000000000' -``` - -### uuid.parse(str) - -Convert UUID string to array of bytes - -| | | -| --------- | ---------------------------------------- | -| `str` | A valid UUID `String` | -| _returns_ | `Uint8Array[16]` | -| _throws_ | `TypeError` if `str` is not a valid UUID | - -Note: Ordering of values in the byte arrays used by `parse()` and `stringify()` follows the left ↠ right order of hex-pairs in UUID strings. As shown in the example below. - -Example: - -```javascript -import { parse as uuidParse } from 'uuid'; - -// Parse a UUID -const bytes = uuidParse('6ec0bd7f-11c0-43da-975e-2a8ad9ebae0b'); - -// Convert to hex strings to show byte order (for documentation purposes) -[...bytes].map((v) => v.toString(16).padStart(2, '0')); // ⇨ - // [ - // '6e', 'c0', 'bd', '7f', - // '11', 'c0', '43', 'da', - // '97', '5e', '2a', '8a', - // 'd9', 'eb', 'ae', '0b' - // ] -``` - -### uuid.stringify(arr[, offset]) - -Convert array of bytes to UUID string - -| | | -| -------------- | ---------------------------------------------------------------------------- | -| `arr` | `Array`-like collection of 16 values (starting from `offset`) between 0-255. | -| [`offset` = 0] | `Number` Starting index in the Array | -| _returns_ | `String` | -| _throws_ | `TypeError` if a valid UUID string cannot be generated | - -Note: Ordering of values in the byte arrays used by `parse()` and `stringify()` follows the left ↠ right order of hex-pairs in UUID strings. As shown in the example below. - -Example: - -```javascript -import { stringify as uuidStringify } from 'uuid'; - -const uuidBytes = [ - 0x6e, 0xc0, 0xbd, 0x7f, 0x11, 0xc0, 0x43, 0xda, 0x97, 0x5e, 0x2a, 0x8a, 0xd9, 0xeb, 0xae, 0x0b, -]; - -uuidStringify(uuidBytes); // ⇨ '6ec0bd7f-11c0-43da-975e-2a8ad9ebae0b' -``` - -### uuid.v1([options[, buffer[, offset]]]) - -Create an RFC version 1 (timestamp) UUID - -| | | -| --- | --- | -| [`options`] | `Object` with one or more of the following properties: | -| [`options.node` ] | RFC "node" field as an `Array[6]` of byte values (per 4.1.6) | -| [`options.clockseq`] | RFC "clock sequence" as a `Number` between 0 - 0x3fff | -| [`options.msecs`] | RFC "timestamp" field (`Number` of milliseconds, unix epoch) | -| [`options.nsecs`] | RFC "timestamp" field (`Number` of nanseconds to add to `msecs`, should be 0-10,000) | -| [`options.random`] | `Array` of 16 random bytes (0-255) | -| [`options.rng`] | Alternative to `options.random`, a `Function` that returns an `Array` of 16 random bytes (0-255) | -| [`buffer`] | `Array \| Buffer` If specified, uuid will be written here in byte-form, starting at `offset` | -| [`offset` = 0] | `Number` Index to start writing UUID bytes in `buffer` | -| _returns_ | UUID `String` if no `buffer` is specified, otherwise returns `buffer` | -| _throws_ | `Error` if more than 10M UUIDs/sec are requested | - -Note: The default [node id](https://tools.ietf.org/html/rfc4122#section-4.1.6) (the last 12 digits in the UUID) is generated once, randomly, on process startup, and then remains unchanged for the duration of the process. - -Note: `options.random` and `options.rng` are only meaningful on the very first call to `v1()`, where they may be passed to initialize the internal `node` and `clockseq` fields. - -Example: - -```javascript -import { v1 as uuidv1 } from 'uuid'; - -uuidv1(); // ⇨ '2c5ea4c0-4067-11e9-8bad-9b1deb4d3b7d' -``` - -Example using `options`: - -```javascript -import { v1 as uuidv1 } from 'uuid'; - -const v1options = { - node: [0x01, 0x23, 0x45, 0x67, 0x89, 0xab], - clockseq: 0x1234, - msecs: new Date('2011-11-01').getTime(), - nsecs: 5678, -}; -uuidv1(v1options); // ⇨ '710b962e-041c-11e1-9234-0123456789ab' -``` - -### uuid.v3(name, namespace[, buffer[, offset]]) - -Create an RFC version 3 (namespace w/ MD5) UUID - -API is identical to `v5()`, but uses "v3" instead. - -⚠️ Note: Per the RFC, "_If backward compatibility is not an issue, SHA-1 [Version 5] is preferred_." - -### uuid.v4([options[, buffer[, offset]]]) - -Create an RFC version 4 (random) UUID - -| | | -| --- | --- | -| [`options`] | `Object` with one or more of the following properties: | -| [`options.random`] | `Array` of 16 random bytes (0-255) | -| [`options.rng`] | Alternative to `options.random`, a `Function` that returns an `Array` of 16 random bytes (0-255) | -| [`buffer`] | `Array \| Buffer` If specified, uuid will be written here in byte-form, starting at `offset` | -| [`offset` = 0] | `Number` Index to start writing UUID bytes in `buffer` | -| _returns_ | UUID `String` if no `buffer` is specified, otherwise returns `buffer` | - -Example: - -```javascript -import { v4 as uuidv4 } from 'uuid'; - -uuidv4(); // ⇨ '1b9d6bcd-bbfd-4b2d-9b5d-ab8dfbbd4bed' -``` - -Example using predefined `random` values: - -```javascript -import { v4 as uuidv4 } from 'uuid'; - -const v4options = { - random: [ - 0x10, 0x91, 0x56, 0xbe, 0xc4, 0xfb, 0xc1, 0xea, 0x71, 0xb4, 0xef, 0xe1, 0x67, 0x1c, 0x58, 0x36, - ], -}; -uuidv4(v4options); // ⇨ '109156be-c4fb-41ea-b1b4-efe1671c5836' -``` - -### uuid.v5(name, namespace[, buffer[, offset]]) - -Create an RFC version 5 (namespace w/ SHA-1) UUID - -| | | -| --- | --- | -| `name` | `String \| Array` | -| `namespace` | `String \| Array[16]` Namespace UUID | -| [`buffer`] | `Array \| Buffer` If specified, uuid will be written here in byte-form, starting at `offset` | -| [`offset` = 0] | `Number` Index to start writing UUID bytes in `buffer` | -| _returns_ | UUID `String` if no `buffer` is specified, otherwise returns `buffer` | - -Note: The RFC `DNS` and `URL` namespaces are available as `v5.DNS` and `v5.URL`. - -Example with custom namespace: - -```javascript -import { v5 as uuidv5 } from 'uuid'; - -// Define a custom namespace. Readers, create your own using something like -// https://www.uuidgenerator.net/ -const MY_NAMESPACE = '1b671a64-40d5-491e-99b0-da01ff1f3341'; - -uuidv5('Hello, World!', MY_NAMESPACE); // ⇨ '630eb68f-e0fa-5ecc-887a-7c7a62614681' -``` - -Example with RFC `URL` namespace: - -```javascript -import { v5 as uuidv5 } from 'uuid'; - -uuidv5('https://www.w3.org/', uuidv5.URL); // ⇨ 'c106a26a-21bb-5538-8bf2-57095d1976c1' -``` - -### uuid.validate(str) - -Test a string to see if it is a valid UUID - -| | | -| --------- | --------------------------------------------------- | -| `str` | `String` to validate | -| _returns_ | `true` if string is a valid UUID, `false` otherwise | - -Example: - -```javascript -import { validate as uuidValidate } from 'uuid'; - -uuidValidate('not a UUID'); // ⇨ false -uuidValidate('6ec0bd7f-11c0-43da-975e-2a8ad9ebae0b'); // ⇨ true -``` - -Using `validate` and `version` together it is possible to do per-version validation, e.g. validate for only v4 UUIds. - -```javascript -import { version as uuidVersion } from 'uuid'; -import { validate as uuidValidate } from 'uuid'; - -function uuidValidateV4(uuid) { - return uuidValidate(uuid) && uuidVersion(uuid) === 4; -} - -const v1Uuid = 'd9428888-122b-11e1-b85c-61cd3cbb3210'; -const v4Uuid = '109156be-c4fb-41ea-b1b4-efe1671c5836'; - -uuidValidateV4(v4Uuid); // ⇨ true -uuidValidateV4(v1Uuid); // ⇨ false -``` - -### uuid.version(str) - -Detect RFC version of a UUID - -| | | -| --------- | ---------------------------------------- | -| `str` | A valid UUID `String` | -| _returns_ | `Number` The RFC version of the UUID | -| _throws_ | `TypeError` if `str` is not a valid UUID | - -Example: - -```javascript -import { version as uuidVersion } from 'uuid'; - -uuidVersion('45637ec4-c85f-11ea-87d0-0242ac130003'); // ⇨ 1 -uuidVersion('6ec0bd7f-11c0-43da-975e-2a8ad9ebae0b'); // ⇨ 4 -``` - -## Command Line - -UUIDs can be generated from the command line using `uuid`. - -```shell -$ npx uuid -ddeb27fb-d9a0-4624-be4d-4615062daed4 -``` - -The default is to generate version 4 UUIDS, however the other versions are supported. Type `uuid --help` for details: - -```shell -$ npx uuid --help - -Usage: - uuid - uuid v1 - uuid v3 - uuid v4 - uuid v5 - uuid --help - -Note: may be "URL" or "DNS" to use the corresponding UUIDs -defined by RFC4122 -``` - -## ECMAScript Modules - -This library comes with [ECMAScript Modules](https://www.ecma-international.org/ecma-262/6.0/#sec-modules) (ESM) support for Node.js versions that support it ([example](./examples/node-esmodules/)) as well as bundlers like [rollup.js](https://rollupjs.org/guide/en/#tree-shaking) ([example](./examples/browser-rollup/)) and [webpack](https://webpack.js.org/guides/tree-shaking/) ([example](./examples/browser-webpack/)) (targeting both, Node.js and browser environments). - -```javascript -import { v4 as uuidv4 } from 'uuid'; -uuidv4(); // ⇨ '1b9d6bcd-bbfd-4b2d-9b5d-ab8dfbbd4bed' -``` - -To run the examples you must first create a dist build of this library in the module root: - -```shell -npm run build -``` - -## CDN Builds - -### ECMAScript Modules - -To load this module directly into modern browsers that [support loading ECMAScript Modules](https://caniuse.com/#feat=es6-module) you can make use of [jspm](https://jspm.org/): - -```html - -``` - -### UMD - -As of `uuid@9` [UMD (Universal Module Definition)](https://github.com/umdjs/umd) builds are no longer shipped with this library. - -If you need a UMD build of this library, use a bundler like Webpack or Rollup. Alternatively, refer to the documentation of [`uuid@8.3.2`](https://github.com/uuidjs/uuid/blob/v8.3.2/README.md#umd) which was the last version that shipped UMD builds. - -## Known issues - -### Duplicate UUIDs (Googlebot) - -This module may generate duplicate UUIDs when run in clients with _deterministic_ random number generators, such as [Googlebot crawlers](https://developers.google.com/search/docs/advanced/crawling/overview-google-crawlers). This can cause problems for apps that expect client-generated UUIDs to always be unique. Developers should be prepared for this and have a strategy for dealing with possible collisions, such as: - -- Check for duplicate UUIDs, fail gracefully -- Disable write operations for Googlebot clients - -### "getRandomValues() not supported" - -This error occurs in environments where the standard [`crypto.getRandomValues()`](https://developer.mozilla.org/en-US/docs/Web/API/Crypto/getRandomValues) API is not supported. This issue can be resolved by adding an appropriate polyfill: - -### React Native / Expo - -1. Install [`react-native-get-random-values`](https://github.com/LinusU/react-native-get-random-values#readme) -1. Import it _before_ `uuid`. Since `uuid` might also appear as a transitive dependency of some other imports it's safest to just import `react-native-get-random-values` as the very first thing in your entry point: - -```javascript -import 'react-native-get-random-values'; -import { v4 as uuidv4 } from 'uuid'; -``` - -Note: If you are using Expo, you must be using at least `react-native-get-random-values@1.5.0` and `expo@39.0.0`. - -### Web Workers / Service Workers (Edge <= 18) - -[In Edge <= 18, Web Crypto is not supported in Web Workers or Service Workers](https://caniuse.com/#feat=cryptography) and we are not aware of a polyfill (let us know if you find one, please). - -### IE 11 (Internet Explorer) - -Support for IE11 and other legacy browsers has been dropped as of `uuid@9`. If you need to support legacy browsers, you can always transpile the uuid module source yourself (e.g. using [Babel](https://babeljs.io/)). - -## Upgrading From `uuid@7` - -### Only Named Exports Supported When Using with Node.js ESM - -`uuid@7` did not come with native ECMAScript Module (ESM) support for Node.js. Importing it in Node.js ESM consequently imported the CommonJS source with a default export. This library now comes with true Node.js ESM support and only provides named exports. - -Instead of doing: - -```javascript -import uuid from 'uuid'; -uuid.v4(); -``` - -you will now have to use the named exports: - -```javascript -import { v4 as uuidv4 } from 'uuid'; -uuidv4(); -``` - -### Deep Requires No Longer Supported - -Deep requires like `require('uuid/v4')` [which have been deprecated in `uuid@7`](#deep-requires-now-deprecated) are no longer supported. - -## Upgrading From `uuid@3` - -"_Wait... what happened to `uuid@4` thru `uuid@6`?!?_" - -In order to avoid confusion with RFC [version 4](#uuidv4options-buffer-offset) and [version 5](#uuidv5name-namespace-buffer-offset) UUIDs, and a possible [version 6](http://gh.peabody.io/uuidv6/), releases 4 thru 6 of this module have been skipped. - -### Deep Requires Now Deprecated - -`uuid@3` encouraged the use of deep requires to minimize the bundle size of browser builds: - -```javascript -const uuidv4 = require('uuid/v4'); // <== NOW DEPRECATED! -uuidv4(); -``` - -As of `uuid@7` this library now provides ECMAScript modules builds, which allow packagers like Webpack and Rollup to do "tree-shaking" to remove dead code. Instead, use the `import` syntax: - -```javascript -import { v4 as uuidv4 } from 'uuid'; -uuidv4(); -``` - -... or for CommonJS: - -```javascript -const { v4: uuidv4 } = require('uuid'); -uuidv4(); -``` - -### Default Export Removed - -`uuid@3` was exporting the Version 4 UUID method as a default export: - -```javascript -const uuid = require('uuid'); // <== REMOVED! -``` - -This usage pattern was already discouraged in `uuid@3` and has been removed in `uuid@7`. - ----- -Markdown generated from [README_js.md](README_js.md) by [![RunMD Logo](https://i.imgur.com/h0FVyzU.png)](https://github.com/broofa/runmd) \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/bin/uuid b/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/bin/uuid deleted file mode 100755 index f38d2ee1..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/bin/uuid +++ /dev/null @@ -1,2 +0,0 @@ -#!/usr/bin/env node -require('../uuid-bin'); diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/commonjs-browser/index.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/commonjs-browser/index.js deleted file mode 100644 index 5586dd3d..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/commonjs-browser/index.js +++ /dev/null @@ -1,79 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -Object.defineProperty(exports, "NIL", { - enumerable: true, - get: function get() { - return _nil.default; - } -}); -Object.defineProperty(exports, "parse", { - enumerable: true, - get: function get() { - return _parse.default; - } -}); -Object.defineProperty(exports, "stringify", { - enumerable: true, - get: function get() { - return _stringify.default; - } -}); -Object.defineProperty(exports, "v1", { - enumerable: true, - get: function get() { - return _v.default; - } -}); -Object.defineProperty(exports, "v3", { - enumerable: true, - get: function get() { - return _v2.default; - } -}); -Object.defineProperty(exports, "v4", { - enumerable: true, - get: function get() { - return _v3.default; - } -}); -Object.defineProperty(exports, "v5", { - enumerable: true, - get: function get() { - return _v4.default; - } -}); -Object.defineProperty(exports, "validate", { - enumerable: true, - get: function get() { - return _validate.default; - } -}); -Object.defineProperty(exports, "version", { - enumerable: true, - get: function get() { - return _version.default; - } -}); - -var _v = _interopRequireDefault(require("./v1.js")); - -var _v2 = _interopRequireDefault(require("./v3.js")); - -var _v3 = _interopRequireDefault(require("./v4.js")); - -var _v4 = _interopRequireDefault(require("./v5.js")); - -var _nil = _interopRequireDefault(require("./nil.js")); - -var _version = _interopRequireDefault(require("./version.js")); - -var _validate = _interopRequireDefault(require("./validate.js")); - -var _stringify = _interopRequireDefault(require("./stringify.js")); - -var _parse = _interopRequireDefault(require("./parse.js")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/commonjs-browser/md5.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/commonjs-browser/md5.js deleted file mode 100644 index 7a4582ac..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/commonjs-browser/md5.js +++ /dev/null @@ -1,223 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; - -/* - * Browser-compatible JavaScript MD5 - * - * Modification of JavaScript MD5 - * https://github.com/blueimp/JavaScript-MD5 - * - * Copyright 2011, Sebastian Tschan - * https://blueimp.net - * - * Licensed under the MIT license: - * https://opensource.org/licenses/MIT - * - * Based on - * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message - * Digest Algorithm, as defined in RFC 1321. - * Version 2.2 Copyright (C) Paul Johnston 1999 - 2009 - * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet - * Distributed under the BSD License - * See http://pajhome.org.uk/crypt/md5 for more info. - */ -function md5(bytes) { - if (typeof bytes === 'string') { - const msg = unescape(encodeURIComponent(bytes)); // UTF8 escape - - bytes = new Uint8Array(msg.length); - - for (let i = 0; i < msg.length; ++i) { - bytes[i] = msg.charCodeAt(i); - } - } - - return md5ToHexEncodedArray(wordsToMd5(bytesToWords(bytes), bytes.length * 8)); -} -/* - * Convert an array of little-endian words to an array of bytes - */ - - -function md5ToHexEncodedArray(input) { - const output = []; - const length32 = input.length * 32; - const hexTab = '0123456789abcdef'; - - for (let i = 0; i < length32; i += 8) { - const x = input[i >> 5] >>> i % 32 & 0xff; - const hex = parseInt(hexTab.charAt(x >>> 4 & 0x0f) + hexTab.charAt(x & 0x0f), 16); - output.push(hex); - } - - return output; -} -/** - * Calculate output length with padding and bit length - */ - - -function getOutputLength(inputLength8) { - return (inputLength8 + 64 >>> 9 << 4) + 14 + 1; -} -/* - * Calculate the MD5 of an array of little-endian words, and a bit length. - */ - - -function wordsToMd5(x, len) { - /* append padding */ - x[len >> 5] |= 0x80 << len % 32; - x[getOutputLength(len) - 1] = len; - let a = 1732584193; - let b = -271733879; - let c = -1732584194; - let d = 271733878; - - for (let i = 0; i < x.length; i += 16) { - const olda = a; - const oldb = b; - const oldc = c; - const oldd = d; - a = md5ff(a, b, c, d, x[i], 7, -680876936); - d = md5ff(d, a, b, c, x[i + 1], 12, -389564586); - c = md5ff(c, d, a, b, x[i + 2], 17, 606105819); - b = md5ff(b, c, d, a, x[i + 3], 22, -1044525330); - a = md5ff(a, b, c, d, x[i + 4], 7, -176418897); - d = md5ff(d, a, b, c, x[i + 5], 12, 1200080426); - c = md5ff(c, d, a, b, x[i + 6], 17, -1473231341); - b = md5ff(b, c, d, a, x[i + 7], 22, -45705983); - a = md5ff(a, b, c, d, x[i + 8], 7, 1770035416); - d = md5ff(d, a, b, c, x[i + 9], 12, -1958414417); - c = md5ff(c, d, a, b, x[i + 10], 17, -42063); - b = md5ff(b, c, d, a, x[i + 11], 22, -1990404162); - a = md5ff(a, b, c, d, x[i + 12], 7, 1804603682); - d = md5ff(d, a, b, c, x[i + 13], 12, -40341101); - c = md5ff(c, d, a, b, x[i + 14], 17, -1502002290); - b = md5ff(b, c, d, a, x[i + 15], 22, 1236535329); - a = md5gg(a, b, c, d, x[i + 1], 5, -165796510); - d = md5gg(d, a, b, c, x[i + 6], 9, -1069501632); - c = md5gg(c, d, a, b, x[i + 11], 14, 643717713); - b = md5gg(b, c, d, a, x[i], 20, -373897302); - a = md5gg(a, b, c, d, x[i + 5], 5, -701558691); - d = md5gg(d, a, b, c, x[i + 10], 9, 38016083); - c = md5gg(c, d, a, b, x[i + 15], 14, -660478335); - b = md5gg(b, c, d, a, x[i + 4], 20, -405537848); - a = md5gg(a, b, c, d, x[i + 9], 5, 568446438); - d = md5gg(d, a, b, c, x[i + 14], 9, -1019803690); - c = md5gg(c, d, a, b, x[i + 3], 14, -187363961); - b = md5gg(b, c, d, a, x[i + 8], 20, 1163531501); - a = md5gg(a, b, c, d, x[i + 13], 5, -1444681467); - d = md5gg(d, a, b, c, x[i + 2], 9, -51403784); - c = md5gg(c, d, a, b, x[i + 7], 14, 1735328473); - b = md5gg(b, c, d, a, x[i + 12], 20, -1926607734); - a = md5hh(a, b, c, d, x[i + 5], 4, -378558); - d = md5hh(d, a, b, c, x[i + 8], 11, -2022574463); - c = md5hh(c, d, a, b, x[i + 11], 16, 1839030562); - b = md5hh(b, c, d, a, x[i + 14], 23, -35309556); - a = md5hh(a, b, c, d, x[i + 1], 4, -1530992060); - d = md5hh(d, a, b, c, x[i + 4], 11, 1272893353); - c = md5hh(c, d, a, b, x[i + 7], 16, -155497632); - b = md5hh(b, c, d, a, x[i + 10], 23, -1094730640); - a = md5hh(a, b, c, d, x[i + 13], 4, 681279174); - d = md5hh(d, a, b, c, x[i], 11, -358537222); - c = md5hh(c, d, a, b, x[i + 3], 16, -722521979); - b = md5hh(b, c, d, a, x[i + 6], 23, 76029189); - a = md5hh(a, b, c, d, x[i + 9], 4, -640364487); - d = md5hh(d, a, b, c, x[i + 12], 11, -421815835); - c = md5hh(c, d, a, b, x[i + 15], 16, 530742520); - b = md5hh(b, c, d, a, x[i + 2], 23, -995338651); - a = md5ii(a, b, c, d, x[i], 6, -198630844); - d = md5ii(d, a, b, c, x[i + 7], 10, 1126891415); - c = md5ii(c, d, a, b, x[i + 14], 15, -1416354905); - b = md5ii(b, c, d, a, x[i + 5], 21, -57434055); - a = md5ii(a, b, c, d, x[i + 12], 6, 1700485571); - d = md5ii(d, a, b, c, x[i + 3], 10, -1894986606); - c = md5ii(c, d, a, b, x[i + 10], 15, -1051523); - b = md5ii(b, c, d, a, x[i + 1], 21, -2054922799); - a = md5ii(a, b, c, d, x[i + 8], 6, 1873313359); - d = md5ii(d, a, b, c, x[i + 15], 10, -30611744); - c = md5ii(c, d, a, b, x[i + 6], 15, -1560198380); - b = md5ii(b, c, d, a, x[i + 13], 21, 1309151649); - a = md5ii(a, b, c, d, x[i + 4], 6, -145523070); - d = md5ii(d, a, b, c, x[i + 11], 10, -1120210379); - c = md5ii(c, d, a, b, x[i + 2], 15, 718787259); - b = md5ii(b, c, d, a, x[i + 9], 21, -343485551); - a = safeAdd(a, olda); - b = safeAdd(b, oldb); - c = safeAdd(c, oldc); - d = safeAdd(d, oldd); - } - - return [a, b, c, d]; -} -/* - * Convert an array bytes to an array of little-endian words - * Characters >255 have their high-byte silently ignored. - */ - - -function bytesToWords(input) { - if (input.length === 0) { - return []; - } - - const length8 = input.length * 8; - const output = new Uint32Array(getOutputLength(length8)); - - for (let i = 0; i < length8; i += 8) { - output[i >> 5] |= (input[i / 8] & 0xff) << i % 32; - } - - return output; -} -/* - * Add integers, wrapping at 2^32. This uses 16-bit operations internally - * to work around bugs in some JS interpreters. - */ - - -function safeAdd(x, y) { - const lsw = (x & 0xffff) + (y & 0xffff); - const msw = (x >> 16) + (y >> 16) + (lsw >> 16); - return msw << 16 | lsw & 0xffff; -} -/* - * Bitwise rotate a 32-bit number to the left. - */ - - -function bitRotateLeft(num, cnt) { - return num << cnt | num >>> 32 - cnt; -} -/* - * These functions implement the four basic operations the algorithm uses. - */ - - -function md5cmn(q, a, b, x, s, t) { - return safeAdd(bitRotateLeft(safeAdd(safeAdd(a, q), safeAdd(x, t)), s), b); -} - -function md5ff(a, b, c, d, x, s, t) { - return md5cmn(b & c | ~b & d, a, b, x, s, t); -} - -function md5gg(a, b, c, d, x, s, t) { - return md5cmn(b & d | c & ~d, a, b, x, s, t); -} - -function md5hh(a, b, c, d, x, s, t) { - return md5cmn(b ^ c ^ d, a, b, x, s, t); -} - -function md5ii(a, b, c, d, x, s, t) { - return md5cmn(c ^ (b | ~d), a, b, x, s, t); -} - -var _default = md5; -exports.default = _default; \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/commonjs-browser/native.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/commonjs-browser/native.js deleted file mode 100644 index c2eea59d..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/commonjs-browser/native.js +++ /dev/null @@ -1,11 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; -const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto); -var _default = { - randomUUID -}; -exports.default = _default; \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/commonjs-browser/nil.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/commonjs-browser/nil.js deleted file mode 100644 index 7ade577b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/commonjs-browser/nil.js +++ /dev/null @@ -1,8 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; -var _default = '00000000-0000-0000-0000-000000000000'; -exports.default = _default; \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/commonjs-browser/parse.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/commonjs-browser/parse.js deleted file mode 100644 index 4c69fc39..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/commonjs-browser/parse.js +++ /dev/null @@ -1,45 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; - -var _validate = _interopRequireDefault(require("./validate.js")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function parse(uuid) { - if (!(0, _validate.default)(uuid)) { - throw TypeError('Invalid UUID'); - } - - let v; - const arr = new Uint8Array(16); // Parse ########-....-....-....-............ - - arr[0] = (v = parseInt(uuid.slice(0, 8), 16)) >>> 24; - arr[1] = v >>> 16 & 0xff; - arr[2] = v >>> 8 & 0xff; - arr[3] = v & 0xff; // Parse ........-####-....-....-............ - - arr[4] = (v = parseInt(uuid.slice(9, 13), 16)) >>> 8; - arr[5] = v & 0xff; // Parse ........-....-####-....-............ - - arr[6] = (v = parseInt(uuid.slice(14, 18), 16)) >>> 8; - arr[7] = v & 0xff; // Parse ........-....-....-####-............ - - arr[8] = (v = parseInt(uuid.slice(19, 23), 16)) >>> 8; - arr[9] = v & 0xff; // Parse ........-....-....-....-############ - // (Use "/" to avoid 32-bit truncation when bit-shifting high-order bytes) - - arr[10] = (v = parseInt(uuid.slice(24, 36), 16)) / 0x10000000000 & 0xff; - arr[11] = v / 0x100000000 & 0xff; - arr[12] = v >>> 24 & 0xff; - arr[13] = v >>> 16 & 0xff; - arr[14] = v >>> 8 & 0xff; - arr[15] = v & 0xff; - return arr; -} - -var _default = parse; -exports.default = _default; \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/commonjs-browser/regex.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/commonjs-browser/regex.js deleted file mode 100644 index 1ef91d64..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/commonjs-browser/regex.js +++ /dev/null @@ -1,8 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; -var _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; -exports.default = _default; \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/commonjs-browser/rng.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/commonjs-browser/rng.js deleted file mode 100644 index d067cdb0..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/commonjs-browser/rng.js +++ /dev/null @@ -1,25 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = rng; -// Unique ID creation requires a high quality random # generator. In the browser we therefore -// require the crypto API and do not support built-in fallback to lower quality random number -// generators (like Math.random()). -let getRandomValues; -const rnds8 = new Uint8Array(16); - -function rng() { - // lazy load so that environments that need to polyfill have a chance to do so - if (!getRandomValues) { - // getRandomValues needs to be invoked in a context where "this" is a Crypto implementation. - getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto); - - if (!getRandomValues) { - throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported'); - } - } - - return getRandomValues(rnds8); -} \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/commonjs-browser/sha1.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/commonjs-browser/sha1.js deleted file mode 100644 index 24cbcedc..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/commonjs-browser/sha1.js +++ /dev/null @@ -1,104 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; - -// Adapted from Chris Veness' SHA1 code at -// http://www.movable-type.co.uk/scripts/sha1.html -function f(s, x, y, z) { - switch (s) { - case 0: - return x & y ^ ~x & z; - - case 1: - return x ^ y ^ z; - - case 2: - return x & y ^ x & z ^ y & z; - - case 3: - return x ^ y ^ z; - } -} - -function ROTL(x, n) { - return x << n | x >>> 32 - n; -} - -function sha1(bytes) { - const K = [0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xca62c1d6]; - const H = [0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0]; - - if (typeof bytes === 'string') { - const msg = unescape(encodeURIComponent(bytes)); // UTF8 escape - - bytes = []; - - for (let i = 0; i < msg.length; ++i) { - bytes.push(msg.charCodeAt(i)); - } - } else if (!Array.isArray(bytes)) { - // Convert Array-like to Array - bytes = Array.prototype.slice.call(bytes); - } - - bytes.push(0x80); - const l = bytes.length / 4 + 2; - const N = Math.ceil(l / 16); - const M = new Array(N); - - for (let i = 0; i < N; ++i) { - const arr = new Uint32Array(16); - - for (let j = 0; j < 16; ++j) { - arr[j] = bytes[i * 64 + j * 4] << 24 | bytes[i * 64 + j * 4 + 1] << 16 | bytes[i * 64 + j * 4 + 2] << 8 | bytes[i * 64 + j * 4 + 3]; - } - - M[i] = arr; - } - - M[N - 1][14] = (bytes.length - 1) * 8 / Math.pow(2, 32); - M[N - 1][14] = Math.floor(M[N - 1][14]); - M[N - 1][15] = (bytes.length - 1) * 8 & 0xffffffff; - - for (let i = 0; i < N; ++i) { - const W = new Uint32Array(80); - - for (let t = 0; t < 16; ++t) { - W[t] = M[i][t]; - } - - for (let t = 16; t < 80; ++t) { - W[t] = ROTL(W[t - 3] ^ W[t - 8] ^ W[t - 14] ^ W[t - 16], 1); - } - - let a = H[0]; - let b = H[1]; - let c = H[2]; - let d = H[3]; - let e = H[4]; - - for (let t = 0; t < 80; ++t) { - const s = Math.floor(t / 20); - const T = ROTL(a, 5) + f(s, b, c, d) + e + K[s] + W[t] >>> 0; - e = d; - d = c; - c = ROTL(b, 30) >>> 0; - b = a; - a = T; - } - - H[0] = H[0] + a >>> 0; - H[1] = H[1] + b >>> 0; - H[2] = H[2] + c >>> 0; - H[3] = H[3] + d >>> 0; - H[4] = H[4] + e >>> 0; - } - - return [H[0] >> 24 & 0xff, H[0] >> 16 & 0xff, H[0] >> 8 & 0xff, H[0] & 0xff, H[1] >> 24 & 0xff, H[1] >> 16 & 0xff, H[1] >> 8 & 0xff, H[1] & 0xff, H[2] >> 24 & 0xff, H[2] >> 16 & 0xff, H[2] >> 8 & 0xff, H[2] & 0xff, H[3] >> 24 & 0xff, H[3] >> 16 & 0xff, H[3] >> 8 & 0xff, H[3] & 0xff, H[4] >> 24 & 0xff, H[4] >> 16 & 0xff, H[4] >> 8 & 0xff, H[4] & 0xff]; -} - -var _default = sha1; -exports.default = _default; \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/commonjs-browser/stringify.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/commonjs-browser/stringify.js deleted file mode 100644 index bdcea1ce..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/commonjs-browser/stringify.js +++ /dev/null @@ -1,44 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; -exports.unsafeStringify = unsafeStringify; - -var _validate = _interopRequireDefault(require("./validate.js")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * Convert array of 16 byte values to UUID string format of the form: - * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX - */ -const byteToHex = []; - -for (let i = 0; i < 256; ++i) { - byteToHex.push((i + 0x100).toString(16).slice(1)); -} - -function unsafeStringify(arr, offset = 0) { - // Note: Be careful editing this code! It's been tuned for performance - // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434 - return (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase(); -} - -function stringify(arr, offset = 0) { - const uuid = unsafeStringify(arr, offset); // Consistency check for valid UUID. If this throws, it's likely due to one - // of the following: - // - One or more input array values don't map to a hex octet (leading to - // "undefined" in the uuid) - // - Invalid input values for the RFC `version` or `variant` fields - - if (!(0, _validate.default)(uuid)) { - throw TypeError('Stringified UUID is invalid'); - } - - return uuid; -} - -var _default = stringify; -exports.default = _default; \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/commonjs-browser/v1.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/commonjs-browser/v1.js deleted file mode 100644 index 125bc58f..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/commonjs-browser/v1.js +++ /dev/null @@ -1,107 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; - -var _rng = _interopRequireDefault(require("./rng.js")); - -var _stringify = require("./stringify.js"); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -// **`v1()` - Generate time-based UUID** -// -// Inspired by https://github.com/LiosK/UUID.js -// and http://docs.python.org/library/uuid.html -let _nodeId; - -let _clockseq; // Previous uuid creation time - - -let _lastMSecs = 0; -let _lastNSecs = 0; // See https://github.com/uuidjs/uuid for API details - -function v1(options, buf, offset) { - let i = buf && offset || 0; - const b = buf || new Array(16); - options = options || {}; - let node = options.node || _nodeId; - let clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq; // node and clockseq need to be initialized to random values if they're not - // specified. We do this lazily to minimize issues related to insufficient - // system entropy. See #189 - - if (node == null || clockseq == null) { - const seedBytes = options.random || (options.rng || _rng.default)(); - - if (node == null) { - // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1) - node = _nodeId = [seedBytes[0] | 0x01, seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]]; - } - - if (clockseq == null) { - // Per 4.2.2, randomize (14 bit) clockseq - clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff; - } - } // UUID timestamps are 100 nano-second units since the Gregorian epoch, - // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so - // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs' - // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00. - - - let msecs = options.msecs !== undefined ? options.msecs : Date.now(); // Per 4.2.1.2, use count of uuid's generated during the current clock - // cycle to simulate higher resolution clock - - let nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1; // Time since last uuid creation (in msecs) - - const dt = msecs - _lastMSecs + (nsecs - _lastNSecs) / 10000; // Per 4.2.1.2, Bump clockseq on clock regression - - if (dt < 0 && options.clockseq === undefined) { - clockseq = clockseq + 1 & 0x3fff; - } // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new - // time interval - - - if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) { - nsecs = 0; - } // Per 4.2.1.2 Throw error if too many uuids are requested - - - if (nsecs >= 10000) { - throw new Error("uuid.v1(): Can't create more than 10M uuids/sec"); - } - - _lastMSecs = msecs; - _lastNSecs = nsecs; - _clockseq = clockseq; // Per 4.1.4 - Convert from unix epoch to Gregorian epoch - - msecs += 12219292800000; // `time_low` - - const tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000; - b[i++] = tl >>> 24 & 0xff; - b[i++] = tl >>> 16 & 0xff; - b[i++] = tl >>> 8 & 0xff; - b[i++] = tl & 0xff; // `time_mid` - - const tmh = msecs / 0x100000000 * 10000 & 0xfffffff; - b[i++] = tmh >>> 8 & 0xff; - b[i++] = tmh & 0xff; // `time_high_and_version` - - b[i++] = tmh >>> 24 & 0xf | 0x10; // include version - - b[i++] = tmh >>> 16 & 0xff; // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant) - - b[i++] = clockseq >>> 8 | 0x80; // `clock_seq_low` - - b[i++] = clockseq & 0xff; // `node` - - for (let n = 0; n < 6; ++n) { - b[i + n] = node[n]; - } - - return buf || (0, _stringify.unsafeStringify)(b); -} - -var _default = v1; -exports.default = _default; \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/commonjs-browser/v3.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/commonjs-browser/v3.js deleted file mode 100644 index 6b47ff51..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/commonjs-browser/v3.js +++ /dev/null @@ -1,16 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; - -var _v = _interopRequireDefault(require("./v35.js")); - -var _md = _interopRequireDefault(require("./md5.js")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -const v3 = (0, _v.default)('v3', 0x30, _md.default); -var _default = v3; -exports.default = _default; \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/commonjs-browser/v35.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/commonjs-browser/v35.js deleted file mode 100644 index 7c522d97..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/commonjs-browser/v35.js +++ /dev/null @@ -1,80 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.URL = exports.DNS = void 0; -exports.default = v35; - -var _stringify = require("./stringify.js"); - -var _parse = _interopRequireDefault(require("./parse.js")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function stringToBytes(str) { - str = unescape(encodeURIComponent(str)); // UTF8 escape - - const bytes = []; - - for (let i = 0; i < str.length; ++i) { - bytes.push(str.charCodeAt(i)); - } - - return bytes; -} - -const DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8'; -exports.DNS = DNS; -const URL = '6ba7b811-9dad-11d1-80b4-00c04fd430c8'; -exports.URL = URL; - -function v35(name, version, hashfunc) { - function generateUUID(value, namespace, buf, offset) { - var _namespace; - - if (typeof value === 'string') { - value = stringToBytes(value); - } - - if (typeof namespace === 'string') { - namespace = (0, _parse.default)(namespace); - } - - if (((_namespace = namespace) === null || _namespace === void 0 ? void 0 : _namespace.length) !== 16) { - throw TypeError('Namespace must be array-like (16 iterable integer values, 0-255)'); - } // Compute hash of namespace and value, Per 4.3 - // Future: Use spread syntax when supported on all platforms, e.g. `bytes = - // hashfunc([...namespace, ... value])` - - - let bytes = new Uint8Array(16 + value.length); - bytes.set(namespace); - bytes.set(value, namespace.length); - bytes = hashfunc(bytes); - bytes[6] = bytes[6] & 0x0f | version; - bytes[8] = bytes[8] & 0x3f | 0x80; - - if (buf) { - offset = offset || 0; - - for (let i = 0; i < 16; ++i) { - buf[offset + i] = bytes[i]; - } - - return buf; - } - - return (0, _stringify.unsafeStringify)(bytes); - } // Function#name is not settable on some platforms (#270) - - - try { - generateUUID.name = name; // eslint-disable-next-line no-empty - } catch (err) {} // For CommonJS default export support - - - generateUUID.DNS = DNS; - generateUUID.URL = URL; - return generateUUID; -} \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/commonjs-browser/v4.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/commonjs-browser/v4.js deleted file mode 100644 index 959d6986..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/commonjs-browser/v4.js +++ /dev/null @@ -1,43 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; - -var _native = _interopRequireDefault(require("./native.js")); - -var _rng = _interopRequireDefault(require("./rng.js")); - -var _stringify = require("./stringify.js"); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function v4(options, buf, offset) { - if (_native.default.randomUUID && !buf && !options) { - return _native.default.randomUUID(); - } - - options = options || {}; - - const rnds = options.random || (options.rng || _rng.default)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved` - - - rnds[6] = rnds[6] & 0x0f | 0x40; - rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided - - if (buf) { - offset = offset || 0; - - for (let i = 0; i < 16; ++i) { - buf[offset + i] = rnds[i]; - } - - return buf; - } - - return (0, _stringify.unsafeStringify)(rnds); -} - -var _default = v4; -exports.default = _default; \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/commonjs-browser/v5.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/commonjs-browser/v5.js deleted file mode 100644 index 99d615e0..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/commonjs-browser/v5.js +++ /dev/null @@ -1,16 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; - -var _v = _interopRequireDefault(require("./v35.js")); - -var _sha = _interopRequireDefault(require("./sha1.js")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -const v5 = (0, _v.default)('v5', 0x50, _sha.default); -var _default = v5; -exports.default = _default; \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/commonjs-browser/validate.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/commonjs-browser/validate.js deleted file mode 100644 index fd052157..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/commonjs-browser/validate.js +++ /dev/null @@ -1,17 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; - -var _regex = _interopRequireDefault(require("./regex.js")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function validate(uuid) { - return typeof uuid === 'string' && _regex.default.test(uuid); -} - -var _default = validate; -exports.default = _default; \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/commonjs-browser/version.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/commonjs-browser/version.js deleted file mode 100644 index f63af01a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/commonjs-browser/version.js +++ /dev/null @@ -1,21 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; - -var _validate = _interopRequireDefault(require("./validate.js")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function version(uuid) { - if (!(0, _validate.default)(uuid)) { - throw TypeError('Invalid UUID'); - } - - return parseInt(uuid.slice(14, 15), 16); -} - -var _default = version; -exports.default = _default; \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/esm-browser/index.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/esm-browser/index.js deleted file mode 100644 index 1db6f6d2..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/esm-browser/index.js +++ /dev/null @@ -1,9 +0,0 @@ -export { default as v1 } from './v1.js'; -export { default as v3 } from './v3.js'; -export { default as v4 } from './v4.js'; -export { default as v5 } from './v5.js'; -export { default as NIL } from './nil.js'; -export { default as version } from './version.js'; -export { default as validate } from './validate.js'; -export { default as stringify } from './stringify.js'; -export { default as parse } from './parse.js'; \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/esm-browser/md5.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/esm-browser/md5.js deleted file mode 100644 index f12212ea..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/esm-browser/md5.js +++ /dev/null @@ -1,215 +0,0 @@ -/* - * Browser-compatible JavaScript MD5 - * - * Modification of JavaScript MD5 - * https://github.com/blueimp/JavaScript-MD5 - * - * Copyright 2011, Sebastian Tschan - * https://blueimp.net - * - * Licensed under the MIT license: - * https://opensource.org/licenses/MIT - * - * Based on - * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message - * Digest Algorithm, as defined in RFC 1321. - * Version 2.2 Copyright (C) Paul Johnston 1999 - 2009 - * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet - * Distributed under the BSD License - * See http://pajhome.org.uk/crypt/md5 for more info. - */ -function md5(bytes) { - if (typeof bytes === 'string') { - const msg = unescape(encodeURIComponent(bytes)); // UTF8 escape - - bytes = new Uint8Array(msg.length); - - for (let i = 0; i < msg.length; ++i) { - bytes[i] = msg.charCodeAt(i); - } - } - - return md5ToHexEncodedArray(wordsToMd5(bytesToWords(bytes), bytes.length * 8)); -} -/* - * Convert an array of little-endian words to an array of bytes - */ - - -function md5ToHexEncodedArray(input) { - const output = []; - const length32 = input.length * 32; - const hexTab = '0123456789abcdef'; - - for (let i = 0; i < length32; i += 8) { - const x = input[i >> 5] >>> i % 32 & 0xff; - const hex = parseInt(hexTab.charAt(x >>> 4 & 0x0f) + hexTab.charAt(x & 0x0f), 16); - output.push(hex); - } - - return output; -} -/** - * Calculate output length with padding and bit length - */ - - -function getOutputLength(inputLength8) { - return (inputLength8 + 64 >>> 9 << 4) + 14 + 1; -} -/* - * Calculate the MD5 of an array of little-endian words, and a bit length. - */ - - -function wordsToMd5(x, len) { - /* append padding */ - x[len >> 5] |= 0x80 << len % 32; - x[getOutputLength(len) - 1] = len; - let a = 1732584193; - let b = -271733879; - let c = -1732584194; - let d = 271733878; - - for (let i = 0; i < x.length; i += 16) { - const olda = a; - const oldb = b; - const oldc = c; - const oldd = d; - a = md5ff(a, b, c, d, x[i], 7, -680876936); - d = md5ff(d, a, b, c, x[i + 1], 12, -389564586); - c = md5ff(c, d, a, b, x[i + 2], 17, 606105819); - b = md5ff(b, c, d, a, x[i + 3], 22, -1044525330); - a = md5ff(a, b, c, d, x[i + 4], 7, -176418897); - d = md5ff(d, a, b, c, x[i + 5], 12, 1200080426); - c = md5ff(c, d, a, b, x[i + 6], 17, -1473231341); - b = md5ff(b, c, d, a, x[i + 7], 22, -45705983); - a = md5ff(a, b, c, d, x[i + 8], 7, 1770035416); - d = md5ff(d, a, b, c, x[i + 9], 12, -1958414417); - c = md5ff(c, d, a, b, x[i + 10], 17, -42063); - b = md5ff(b, c, d, a, x[i + 11], 22, -1990404162); - a = md5ff(a, b, c, d, x[i + 12], 7, 1804603682); - d = md5ff(d, a, b, c, x[i + 13], 12, -40341101); - c = md5ff(c, d, a, b, x[i + 14], 17, -1502002290); - b = md5ff(b, c, d, a, x[i + 15], 22, 1236535329); - a = md5gg(a, b, c, d, x[i + 1], 5, -165796510); - d = md5gg(d, a, b, c, x[i + 6], 9, -1069501632); - c = md5gg(c, d, a, b, x[i + 11], 14, 643717713); - b = md5gg(b, c, d, a, x[i], 20, -373897302); - a = md5gg(a, b, c, d, x[i + 5], 5, -701558691); - d = md5gg(d, a, b, c, x[i + 10], 9, 38016083); - c = md5gg(c, d, a, b, x[i + 15], 14, -660478335); - b = md5gg(b, c, d, a, x[i + 4], 20, -405537848); - a = md5gg(a, b, c, d, x[i + 9], 5, 568446438); - d = md5gg(d, a, b, c, x[i + 14], 9, -1019803690); - c = md5gg(c, d, a, b, x[i + 3], 14, -187363961); - b = md5gg(b, c, d, a, x[i + 8], 20, 1163531501); - a = md5gg(a, b, c, d, x[i + 13], 5, -1444681467); - d = md5gg(d, a, b, c, x[i + 2], 9, -51403784); - c = md5gg(c, d, a, b, x[i + 7], 14, 1735328473); - b = md5gg(b, c, d, a, x[i + 12], 20, -1926607734); - a = md5hh(a, b, c, d, x[i + 5], 4, -378558); - d = md5hh(d, a, b, c, x[i + 8], 11, -2022574463); - c = md5hh(c, d, a, b, x[i + 11], 16, 1839030562); - b = md5hh(b, c, d, a, x[i + 14], 23, -35309556); - a = md5hh(a, b, c, d, x[i + 1], 4, -1530992060); - d = md5hh(d, a, b, c, x[i + 4], 11, 1272893353); - c = md5hh(c, d, a, b, x[i + 7], 16, -155497632); - b = md5hh(b, c, d, a, x[i + 10], 23, -1094730640); - a = md5hh(a, b, c, d, x[i + 13], 4, 681279174); - d = md5hh(d, a, b, c, x[i], 11, -358537222); - c = md5hh(c, d, a, b, x[i + 3], 16, -722521979); - b = md5hh(b, c, d, a, x[i + 6], 23, 76029189); - a = md5hh(a, b, c, d, x[i + 9], 4, -640364487); - d = md5hh(d, a, b, c, x[i + 12], 11, -421815835); - c = md5hh(c, d, a, b, x[i + 15], 16, 530742520); - b = md5hh(b, c, d, a, x[i + 2], 23, -995338651); - a = md5ii(a, b, c, d, x[i], 6, -198630844); - d = md5ii(d, a, b, c, x[i + 7], 10, 1126891415); - c = md5ii(c, d, a, b, x[i + 14], 15, -1416354905); - b = md5ii(b, c, d, a, x[i + 5], 21, -57434055); - a = md5ii(a, b, c, d, x[i + 12], 6, 1700485571); - d = md5ii(d, a, b, c, x[i + 3], 10, -1894986606); - c = md5ii(c, d, a, b, x[i + 10], 15, -1051523); - b = md5ii(b, c, d, a, x[i + 1], 21, -2054922799); - a = md5ii(a, b, c, d, x[i + 8], 6, 1873313359); - d = md5ii(d, a, b, c, x[i + 15], 10, -30611744); - c = md5ii(c, d, a, b, x[i + 6], 15, -1560198380); - b = md5ii(b, c, d, a, x[i + 13], 21, 1309151649); - a = md5ii(a, b, c, d, x[i + 4], 6, -145523070); - d = md5ii(d, a, b, c, x[i + 11], 10, -1120210379); - c = md5ii(c, d, a, b, x[i + 2], 15, 718787259); - b = md5ii(b, c, d, a, x[i + 9], 21, -343485551); - a = safeAdd(a, olda); - b = safeAdd(b, oldb); - c = safeAdd(c, oldc); - d = safeAdd(d, oldd); - } - - return [a, b, c, d]; -} -/* - * Convert an array bytes to an array of little-endian words - * Characters >255 have their high-byte silently ignored. - */ - - -function bytesToWords(input) { - if (input.length === 0) { - return []; - } - - const length8 = input.length * 8; - const output = new Uint32Array(getOutputLength(length8)); - - for (let i = 0; i < length8; i += 8) { - output[i >> 5] |= (input[i / 8] & 0xff) << i % 32; - } - - return output; -} -/* - * Add integers, wrapping at 2^32. This uses 16-bit operations internally - * to work around bugs in some JS interpreters. - */ - - -function safeAdd(x, y) { - const lsw = (x & 0xffff) + (y & 0xffff); - const msw = (x >> 16) + (y >> 16) + (lsw >> 16); - return msw << 16 | lsw & 0xffff; -} -/* - * Bitwise rotate a 32-bit number to the left. - */ - - -function bitRotateLeft(num, cnt) { - return num << cnt | num >>> 32 - cnt; -} -/* - * These functions implement the four basic operations the algorithm uses. - */ - - -function md5cmn(q, a, b, x, s, t) { - return safeAdd(bitRotateLeft(safeAdd(safeAdd(a, q), safeAdd(x, t)), s), b); -} - -function md5ff(a, b, c, d, x, s, t) { - return md5cmn(b & c | ~b & d, a, b, x, s, t); -} - -function md5gg(a, b, c, d, x, s, t) { - return md5cmn(b & d | c & ~d, a, b, x, s, t); -} - -function md5hh(a, b, c, d, x, s, t) { - return md5cmn(b ^ c ^ d, a, b, x, s, t); -} - -function md5ii(a, b, c, d, x, s, t) { - return md5cmn(c ^ (b | ~d), a, b, x, s, t); -} - -export default md5; \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/esm-browser/native.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/esm-browser/native.js deleted file mode 100644 index b22292cd..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/esm-browser/native.js +++ /dev/null @@ -1,4 +0,0 @@ -const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto); -export default { - randomUUID -}; \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/esm-browser/nil.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/esm-browser/nil.js deleted file mode 100644 index b36324c2..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/esm-browser/nil.js +++ /dev/null @@ -1 +0,0 @@ -export default '00000000-0000-0000-0000-000000000000'; \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/esm-browser/parse.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/esm-browser/parse.js deleted file mode 100644 index 6421c5d5..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/esm-browser/parse.js +++ /dev/null @@ -1,35 +0,0 @@ -import validate from './validate.js'; - -function parse(uuid) { - if (!validate(uuid)) { - throw TypeError('Invalid UUID'); - } - - let v; - const arr = new Uint8Array(16); // Parse ########-....-....-....-............ - - arr[0] = (v = parseInt(uuid.slice(0, 8), 16)) >>> 24; - arr[1] = v >>> 16 & 0xff; - arr[2] = v >>> 8 & 0xff; - arr[3] = v & 0xff; // Parse ........-####-....-....-............ - - arr[4] = (v = parseInt(uuid.slice(9, 13), 16)) >>> 8; - arr[5] = v & 0xff; // Parse ........-....-####-....-............ - - arr[6] = (v = parseInt(uuid.slice(14, 18), 16)) >>> 8; - arr[7] = v & 0xff; // Parse ........-....-....-####-............ - - arr[8] = (v = parseInt(uuid.slice(19, 23), 16)) >>> 8; - arr[9] = v & 0xff; // Parse ........-....-....-....-############ - // (Use "/" to avoid 32-bit truncation when bit-shifting high-order bytes) - - arr[10] = (v = parseInt(uuid.slice(24, 36), 16)) / 0x10000000000 & 0xff; - arr[11] = v / 0x100000000 & 0xff; - arr[12] = v >>> 24 & 0xff; - arr[13] = v >>> 16 & 0xff; - arr[14] = v >>> 8 & 0xff; - arr[15] = v & 0xff; - return arr; -} - -export default parse; \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/esm-browser/regex.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/esm-browser/regex.js deleted file mode 100644 index 3da8673a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/esm-browser/regex.js +++ /dev/null @@ -1 +0,0 @@ -export 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; \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/esm-browser/rng.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/esm-browser/rng.js deleted file mode 100644 index 6e652346..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/esm-browser/rng.js +++ /dev/null @@ -1,18 +0,0 @@ -// Unique ID creation requires a high quality random # generator. In the browser we therefore -// require the crypto API and do not support built-in fallback to lower quality random number -// generators (like Math.random()). -let getRandomValues; -const rnds8 = new Uint8Array(16); -export default function rng() { - // lazy load so that environments that need to polyfill have a chance to do so - if (!getRandomValues) { - // getRandomValues needs to be invoked in a context where "this" is a Crypto implementation. - getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto); - - if (!getRandomValues) { - throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported'); - } - } - - return getRandomValues(rnds8); -} \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/esm-browser/sha1.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/esm-browser/sha1.js deleted file mode 100644 index d3c25659..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/esm-browser/sha1.js +++ /dev/null @@ -1,96 +0,0 @@ -// Adapted from Chris Veness' SHA1 code at -// http://www.movable-type.co.uk/scripts/sha1.html -function f(s, x, y, z) { - switch (s) { - case 0: - return x & y ^ ~x & z; - - case 1: - return x ^ y ^ z; - - case 2: - return x & y ^ x & z ^ y & z; - - case 3: - return x ^ y ^ z; - } -} - -function ROTL(x, n) { - return x << n | x >>> 32 - n; -} - -function sha1(bytes) { - const K = [0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xca62c1d6]; - const H = [0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0]; - - if (typeof bytes === 'string') { - const msg = unescape(encodeURIComponent(bytes)); // UTF8 escape - - bytes = []; - - for (let i = 0; i < msg.length; ++i) { - bytes.push(msg.charCodeAt(i)); - } - } else if (!Array.isArray(bytes)) { - // Convert Array-like to Array - bytes = Array.prototype.slice.call(bytes); - } - - bytes.push(0x80); - const l = bytes.length / 4 + 2; - const N = Math.ceil(l / 16); - const M = new Array(N); - - for (let i = 0; i < N; ++i) { - const arr = new Uint32Array(16); - - for (let j = 0; j < 16; ++j) { - arr[j] = bytes[i * 64 + j * 4] << 24 | bytes[i * 64 + j * 4 + 1] << 16 | bytes[i * 64 + j * 4 + 2] << 8 | bytes[i * 64 + j * 4 + 3]; - } - - M[i] = arr; - } - - M[N - 1][14] = (bytes.length - 1) * 8 / Math.pow(2, 32); - M[N - 1][14] = Math.floor(M[N - 1][14]); - M[N - 1][15] = (bytes.length - 1) * 8 & 0xffffffff; - - for (let i = 0; i < N; ++i) { - const W = new Uint32Array(80); - - for (let t = 0; t < 16; ++t) { - W[t] = M[i][t]; - } - - for (let t = 16; t < 80; ++t) { - W[t] = ROTL(W[t - 3] ^ W[t - 8] ^ W[t - 14] ^ W[t - 16], 1); - } - - let a = H[0]; - let b = H[1]; - let c = H[2]; - let d = H[3]; - let e = H[4]; - - for (let t = 0; t < 80; ++t) { - const s = Math.floor(t / 20); - const T = ROTL(a, 5) + f(s, b, c, d) + e + K[s] + W[t] >>> 0; - e = d; - d = c; - c = ROTL(b, 30) >>> 0; - b = a; - a = T; - } - - H[0] = H[0] + a >>> 0; - H[1] = H[1] + b >>> 0; - H[2] = H[2] + c >>> 0; - H[3] = H[3] + d >>> 0; - H[4] = H[4] + e >>> 0; - } - - return [H[0] >> 24 & 0xff, H[0] >> 16 & 0xff, H[0] >> 8 & 0xff, H[0] & 0xff, H[1] >> 24 & 0xff, H[1] >> 16 & 0xff, H[1] >> 8 & 0xff, H[1] & 0xff, H[2] >> 24 & 0xff, H[2] >> 16 & 0xff, H[2] >> 8 & 0xff, H[2] & 0xff, H[3] >> 24 & 0xff, H[3] >> 16 & 0xff, H[3] >> 8 & 0xff, H[3] & 0xff, H[4] >> 24 & 0xff, H[4] >> 16 & 0xff, H[4] >> 8 & 0xff, H[4] & 0xff]; -} - -export default sha1; \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/esm-browser/stringify.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/esm-browser/stringify.js deleted file mode 100644 index 80fac8a6..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/esm-browser/stringify.js +++ /dev/null @@ -1,33 +0,0 @@ -import validate from './validate.js'; -/** - * Convert array of 16 byte values to UUID string format of the form: - * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX - */ - -const byteToHex = []; - -for (let i = 0; i < 256; ++i) { - byteToHex.push((i + 0x100).toString(16).slice(1)); -} - -export function unsafeStringify(arr, offset = 0) { - // Note: Be careful editing this code! It's been tuned for performance - // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434 - return (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase(); -} - -function stringify(arr, offset = 0) { - const uuid = unsafeStringify(arr, offset); // Consistency check for valid UUID. If this throws, it's likely due to one - // of the following: - // - One or more input array values don't map to a hex octet (leading to - // "undefined" in the uuid) - // - Invalid input values for the RFC `version` or `variant` fields - - if (!validate(uuid)) { - throw TypeError('Stringified UUID is invalid'); - } - - return uuid; -} - -export default stringify; \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/esm-browser/v1.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/esm-browser/v1.js deleted file mode 100644 index 382e5d79..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/esm-browser/v1.js +++ /dev/null @@ -1,95 +0,0 @@ -import rng from './rng.js'; -import { unsafeStringify } from './stringify.js'; // **`v1()` - Generate time-based UUID** -// -// Inspired by https://github.com/LiosK/UUID.js -// and http://docs.python.org/library/uuid.html - -let _nodeId; - -let _clockseq; // Previous uuid creation time - - -let _lastMSecs = 0; -let _lastNSecs = 0; // See https://github.com/uuidjs/uuid for API details - -function v1(options, buf, offset) { - let i = buf && offset || 0; - const b = buf || new Array(16); - options = options || {}; - let node = options.node || _nodeId; - let clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq; // node and clockseq need to be initialized to random values if they're not - // specified. We do this lazily to minimize issues related to insufficient - // system entropy. See #189 - - if (node == null || clockseq == null) { - const seedBytes = options.random || (options.rng || rng)(); - - if (node == null) { - // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1) - node = _nodeId = [seedBytes[0] | 0x01, seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]]; - } - - if (clockseq == null) { - // Per 4.2.2, randomize (14 bit) clockseq - clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff; - } - } // UUID timestamps are 100 nano-second units since the Gregorian epoch, - // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so - // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs' - // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00. - - - let msecs = options.msecs !== undefined ? options.msecs : Date.now(); // Per 4.2.1.2, use count of uuid's generated during the current clock - // cycle to simulate higher resolution clock - - let nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1; // Time since last uuid creation (in msecs) - - const dt = msecs - _lastMSecs + (nsecs - _lastNSecs) / 10000; // Per 4.2.1.2, Bump clockseq on clock regression - - if (dt < 0 && options.clockseq === undefined) { - clockseq = clockseq + 1 & 0x3fff; - } // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new - // time interval - - - if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) { - nsecs = 0; - } // Per 4.2.1.2 Throw error if too many uuids are requested - - - if (nsecs >= 10000) { - throw new Error("uuid.v1(): Can't create more than 10M uuids/sec"); - } - - _lastMSecs = msecs; - _lastNSecs = nsecs; - _clockseq = clockseq; // Per 4.1.4 - Convert from unix epoch to Gregorian epoch - - msecs += 12219292800000; // `time_low` - - const tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000; - b[i++] = tl >>> 24 & 0xff; - b[i++] = tl >>> 16 & 0xff; - b[i++] = tl >>> 8 & 0xff; - b[i++] = tl & 0xff; // `time_mid` - - const tmh = msecs / 0x100000000 * 10000 & 0xfffffff; - b[i++] = tmh >>> 8 & 0xff; - b[i++] = tmh & 0xff; // `time_high_and_version` - - b[i++] = tmh >>> 24 & 0xf | 0x10; // include version - - b[i++] = tmh >>> 16 & 0xff; // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant) - - b[i++] = clockseq >>> 8 | 0x80; // `clock_seq_low` - - b[i++] = clockseq & 0xff; // `node` - - for (let n = 0; n < 6; ++n) { - b[i + n] = node[n]; - } - - return buf || unsafeStringify(b); -} - -export default v1; \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/esm-browser/v3.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/esm-browser/v3.js deleted file mode 100644 index 09063b86..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/esm-browser/v3.js +++ /dev/null @@ -1,4 +0,0 @@ -import v35 from './v35.js'; -import md5 from './md5.js'; -const v3 = v35('v3', 0x30, md5); -export default v3; \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/esm-browser/v35.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/esm-browser/v35.js deleted file mode 100644 index 3355e1f5..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/esm-browser/v35.js +++ /dev/null @@ -1,66 +0,0 @@ -import { unsafeStringify } from './stringify.js'; -import parse from './parse.js'; - -function stringToBytes(str) { - str = unescape(encodeURIComponent(str)); // UTF8 escape - - const bytes = []; - - for (let i = 0; i < str.length; ++i) { - bytes.push(str.charCodeAt(i)); - } - - return bytes; -} - -export const DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8'; -export const URL = '6ba7b811-9dad-11d1-80b4-00c04fd430c8'; -export default function v35(name, version, hashfunc) { - function generateUUID(value, namespace, buf, offset) { - var _namespace; - - if (typeof value === 'string') { - value = stringToBytes(value); - } - - if (typeof namespace === 'string') { - namespace = parse(namespace); - } - - if (((_namespace = namespace) === null || _namespace === void 0 ? void 0 : _namespace.length) !== 16) { - throw TypeError('Namespace must be array-like (16 iterable integer values, 0-255)'); - } // Compute hash of namespace and value, Per 4.3 - // Future: Use spread syntax when supported on all platforms, e.g. `bytes = - // hashfunc([...namespace, ... value])` - - - let bytes = new Uint8Array(16 + value.length); - bytes.set(namespace); - bytes.set(value, namespace.length); - bytes = hashfunc(bytes); - bytes[6] = bytes[6] & 0x0f | version; - bytes[8] = bytes[8] & 0x3f | 0x80; - - if (buf) { - offset = offset || 0; - - for (let i = 0; i < 16; ++i) { - buf[offset + i] = bytes[i]; - } - - return buf; - } - - return unsafeStringify(bytes); - } // Function#name is not settable on some platforms (#270) - - - try { - generateUUID.name = name; // eslint-disable-next-line no-empty - } catch (err) {} // For CommonJS default export support - - - generateUUID.DNS = DNS; - generateUUID.URL = URL; - return generateUUID; -} \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/esm-browser/v4.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/esm-browser/v4.js deleted file mode 100644 index 95ea8799..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/esm-browser/v4.js +++ /dev/null @@ -1,29 +0,0 @@ -import native from './native.js'; -import rng from './rng.js'; -import { unsafeStringify } from './stringify.js'; - -function v4(options, buf, offset) { - if (native.randomUUID && !buf && !options) { - return native.randomUUID(); - } - - options = options || {}; - const rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved` - - rnds[6] = rnds[6] & 0x0f | 0x40; - rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided - - if (buf) { - offset = offset || 0; - - for (let i = 0; i < 16; ++i) { - buf[offset + i] = rnds[i]; - } - - return buf; - } - - return unsafeStringify(rnds); -} - -export default v4; \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/esm-browser/v5.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/esm-browser/v5.js deleted file mode 100644 index e87fe317..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/esm-browser/v5.js +++ /dev/null @@ -1,4 +0,0 @@ -import v35 from './v35.js'; -import sha1 from './sha1.js'; -const v5 = v35('v5', 0x50, sha1); -export default v5; \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/esm-browser/validate.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/esm-browser/validate.js deleted file mode 100644 index f1cdc7af..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/esm-browser/validate.js +++ /dev/null @@ -1,7 +0,0 @@ -import REGEX from './regex.js'; - -function validate(uuid) { - return typeof uuid === 'string' && REGEX.test(uuid); -} - -export default validate; \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/esm-browser/version.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/esm-browser/version.js deleted file mode 100644 index 93630763..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/esm-browser/version.js +++ /dev/null @@ -1,11 +0,0 @@ -import validate from './validate.js'; - -function version(uuid) { - if (!validate(uuid)) { - throw TypeError('Invalid UUID'); - } - - return parseInt(uuid.slice(14, 15), 16); -} - -export default version; \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/esm-node/index.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/esm-node/index.js deleted file mode 100644 index 1db6f6d2..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/esm-node/index.js +++ /dev/null @@ -1,9 +0,0 @@ -export { default as v1 } from './v1.js'; -export { default as v3 } from './v3.js'; -export { default as v4 } from './v4.js'; -export { default as v5 } from './v5.js'; -export { default as NIL } from './nil.js'; -export { default as version } from './version.js'; -export { default as validate } from './validate.js'; -export { default as stringify } from './stringify.js'; -export { default as parse } from './parse.js'; \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/esm-node/md5.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/esm-node/md5.js deleted file mode 100644 index 4d68b040..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/esm-node/md5.js +++ /dev/null @@ -1,13 +0,0 @@ -import crypto from 'crypto'; - -function md5(bytes) { - if (Array.isArray(bytes)) { - bytes = Buffer.from(bytes); - } else if (typeof bytes === 'string') { - bytes = Buffer.from(bytes, 'utf8'); - } - - return crypto.createHash('md5').update(bytes).digest(); -} - -export default md5; \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/esm-node/native.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/esm-node/native.js deleted file mode 100644 index f0d19926..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/esm-node/native.js +++ /dev/null @@ -1,4 +0,0 @@ -import crypto from 'crypto'; -export default { - randomUUID: crypto.randomUUID -}; \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/esm-node/nil.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/esm-node/nil.js deleted file mode 100644 index b36324c2..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/esm-node/nil.js +++ /dev/null @@ -1 +0,0 @@ -export default '00000000-0000-0000-0000-000000000000'; \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/esm-node/parse.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/esm-node/parse.js deleted file mode 100644 index 6421c5d5..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/esm-node/parse.js +++ /dev/null @@ -1,35 +0,0 @@ -import validate from './validate.js'; - -function parse(uuid) { - if (!validate(uuid)) { - throw TypeError('Invalid UUID'); - } - - let v; - const arr = new Uint8Array(16); // Parse ########-....-....-....-............ - - arr[0] = (v = parseInt(uuid.slice(0, 8), 16)) >>> 24; - arr[1] = v >>> 16 & 0xff; - arr[2] = v >>> 8 & 0xff; - arr[3] = v & 0xff; // Parse ........-####-....-....-............ - - arr[4] = (v = parseInt(uuid.slice(9, 13), 16)) >>> 8; - arr[5] = v & 0xff; // Parse ........-....-####-....-............ - - arr[6] = (v = parseInt(uuid.slice(14, 18), 16)) >>> 8; - arr[7] = v & 0xff; // Parse ........-....-....-####-............ - - arr[8] = (v = parseInt(uuid.slice(19, 23), 16)) >>> 8; - arr[9] = v & 0xff; // Parse ........-....-....-....-############ - // (Use "/" to avoid 32-bit truncation when bit-shifting high-order bytes) - - arr[10] = (v = parseInt(uuid.slice(24, 36), 16)) / 0x10000000000 & 0xff; - arr[11] = v / 0x100000000 & 0xff; - arr[12] = v >>> 24 & 0xff; - arr[13] = v >>> 16 & 0xff; - arr[14] = v >>> 8 & 0xff; - arr[15] = v & 0xff; - return arr; -} - -export default parse; \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/esm-node/regex.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/esm-node/regex.js deleted file mode 100644 index 3da8673a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/esm-node/regex.js +++ /dev/null @@ -1 +0,0 @@ -export 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; \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/esm-node/rng.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/esm-node/rng.js deleted file mode 100644 index 80062449..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/esm-node/rng.js +++ /dev/null @@ -1,12 +0,0 @@ -import crypto from 'crypto'; -const rnds8Pool = new Uint8Array(256); // # of random values to pre-allocate - -let poolPtr = rnds8Pool.length; -export default function rng() { - if (poolPtr > rnds8Pool.length - 16) { - crypto.randomFillSync(rnds8Pool); - poolPtr = 0; - } - - return rnds8Pool.slice(poolPtr, poolPtr += 16); -} \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/esm-node/sha1.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/esm-node/sha1.js deleted file mode 100644 index e23850b4..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/esm-node/sha1.js +++ /dev/null @@ -1,13 +0,0 @@ -import crypto from 'crypto'; - -function sha1(bytes) { - if (Array.isArray(bytes)) { - bytes = Buffer.from(bytes); - } else if (typeof bytes === 'string') { - bytes = Buffer.from(bytes, 'utf8'); - } - - return crypto.createHash('sha1').update(bytes).digest(); -} - -export default sha1; \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/esm-node/stringify.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/esm-node/stringify.js deleted file mode 100644 index 80fac8a6..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/esm-node/stringify.js +++ /dev/null @@ -1,33 +0,0 @@ -import validate from './validate.js'; -/** - * Convert array of 16 byte values to UUID string format of the form: - * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX - */ - -const byteToHex = []; - -for (let i = 0; i < 256; ++i) { - byteToHex.push((i + 0x100).toString(16).slice(1)); -} - -export function unsafeStringify(arr, offset = 0) { - // Note: Be careful editing this code! It's been tuned for performance - // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434 - return (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase(); -} - -function stringify(arr, offset = 0) { - const uuid = unsafeStringify(arr, offset); // Consistency check for valid UUID. If this throws, it's likely due to one - // of the following: - // - One or more input array values don't map to a hex octet (leading to - // "undefined" in the uuid) - // - Invalid input values for the RFC `version` or `variant` fields - - if (!validate(uuid)) { - throw TypeError('Stringified UUID is invalid'); - } - - return uuid; -} - -export default stringify; \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/esm-node/v1.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/esm-node/v1.js deleted file mode 100644 index 382e5d79..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/esm-node/v1.js +++ /dev/null @@ -1,95 +0,0 @@ -import rng from './rng.js'; -import { unsafeStringify } from './stringify.js'; // **`v1()` - Generate time-based UUID** -// -// Inspired by https://github.com/LiosK/UUID.js -// and http://docs.python.org/library/uuid.html - -let _nodeId; - -let _clockseq; // Previous uuid creation time - - -let _lastMSecs = 0; -let _lastNSecs = 0; // See https://github.com/uuidjs/uuid for API details - -function v1(options, buf, offset) { - let i = buf && offset || 0; - const b = buf || new Array(16); - options = options || {}; - let node = options.node || _nodeId; - let clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq; // node and clockseq need to be initialized to random values if they're not - // specified. We do this lazily to minimize issues related to insufficient - // system entropy. See #189 - - if (node == null || clockseq == null) { - const seedBytes = options.random || (options.rng || rng)(); - - if (node == null) { - // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1) - node = _nodeId = [seedBytes[0] | 0x01, seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]]; - } - - if (clockseq == null) { - // Per 4.2.2, randomize (14 bit) clockseq - clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff; - } - } // UUID timestamps are 100 nano-second units since the Gregorian epoch, - // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so - // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs' - // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00. - - - let msecs = options.msecs !== undefined ? options.msecs : Date.now(); // Per 4.2.1.2, use count of uuid's generated during the current clock - // cycle to simulate higher resolution clock - - let nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1; // Time since last uuid creation (in msecs) - - const dt = msecs - _lastMSecs + (nsecs - _lastNSecs) / 10000; // Per 4.2.1.2, Bump clockseq on clock regression - - if (dt < 0 && options.clockseq === undefined) { - clockseq = clockseq + 1 & 0x3fff; - } // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new - // time interval - - - if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) { - nsecs = 0; - } // Per 4.2.1.2 Throw error if too many uuids are requested - - - if (nsecs >= 10000) { - throw new Error("uuid.v1(): Can't create more than 10M uuids/sec"); - } - - _lastMSecs = msecs; - _lastNSecs = nsecs; - _clockseq = clockseq; // Per 4.1.4 - Convert from unix epoch to Gregorian epoch - - msecs += 12219292800000; // `time_low` - - const tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000; - b[i++] = tl >>> 24 & 0xff; - b[i++] = tl >>> 16 & 0xff; - b[i++] = tl >>> 8 & 0xff; - b[i++] = tl & 0xff; // `time_mid` - - const tmh = msecs / 0x100000000 * 10000 & 0xfffffff; - b[i++] = tmh >>> 8 & 0xff; - b[i++] = tmh & 0xff; // `time_high_and_version` - - b[i++] = tmh >>> 24 & 0xf | 0x10; // include version - - b[i++] = tmh >>> 16 & 0xff; // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant) - - b[i++] = clockseq >>> 8 | 0x80; // `clock_seq_low` - - b[i++] = clockseq & 0xff; // `node` - - for (let n = 0; n < 6; ++n) { - b[i + n] = node[n]; - } - - return buf || unsafeStringify(b); -} - -export default v1; \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/esm-node/v3.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/esm-node/v3.js deleted file mode 100644 index 09063b86..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/esm-node/v3.js +++ /dev/null @@ -1,4 +0,0 @@ -import v35 from './v35.js'; -import md5 from './md5.js'; -const v3 = v35('v3', 0x30, md5); -export default v3; \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/esm-node/v35.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/esm-node/v35.js deleted file mode 100644 index 3355e1f5..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/esm-node/v35.js +++ /dev/null @@ -1,66 +0,0 @@ -import { unsafeStringify } from './stringify.js'; -import parse from './parse.js'; - -function stringToBytes(str) { - str = unescape(encodeURIComponent(str)); // UTF8 escape - - const bytes = []; - - for (let i = 0; i < str.length; ++i) { - bytes.push(str.charCodeAt(i)); - } - - return bytes; -} - -export const DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8'; -export const URL = '6ba7b811-9dad-11d1-80b4-00c04fd430c8'; -export default function v35(name, version, hashfunc) { - function generateUUID(value, namespace, buf, offset) { - var _namespace; - - if (typeof value === 'string') { - value = stringToBytes(value); - } - - if (typeof namespace === 'string') { - namespace = parse(namespace); - } - - if (((_namespace = namespace) === null || _namespace === void 0 ? void 0 : _namespace.length) !== 16) { - throw TypeError('Namespace must be array-like (16 iterable integer values, 0-255)'); - } // Compute hash of namespace and value, Per 4.3 - // Future: Use spread syntax when supported on all platforms, e.g. `bytes = - // hashfunc([...namespace, ... value])` - - - let bytes = new Uint8Array(16 + value.length); - bytes.set(namespace); - bytes.set(value, namespace.length); - bytes = hashfunc(bytes); - bytes[6] = bytes[6] & 0x0f | version; - bytes[8] = bytes[8] & 0x3f | 0x80; - - if (buf) { - offset = offset || 0; - - for (let i = 0; i < 16; ++i) { - buf[offset + i] = bytes[i]; - } - - return buf; - } - - return unsafeStringify(bytes); - } // Function#name is not settable on some platforms (#270) - - - try { - generateUUID.name = name; // eslint-disable-next-line no-empty - } catch (err) {} // For CommonJS default export support - - - generateUUID.DNS = DNS; - generateUUID.URL = URL; - return generateUUID; -} \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/esm-node/v4.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/esm-node/v4.js deleted file mode 100644 index 95ea8799..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/esm-node/v4.js +++ /dev/null @@ -1,29 +0,0 @@ -import native from './native.js'; -import rng from './rng.js'; -import { unsafeStringify } from './stringify.js'; - -function v4(options, buf, offset) { - if (native.randomUUID && !buf && !options) { - return native.randomUUID(); - } - - options = options || {}; - const rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved` - - rnds[6] = rnds[6] & 0x0f | 0x40; - rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided - - if (buf) { - offset = offset || 0; - - for (let i = 0; i < 16; ++i) { - buf[offset + i] = rnds[i]; - } - - return buf; - } - - return unsafeStringify(rnds); -} - -export default v4; \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/esm-node/v5.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/esm-node/v5.js deleted file mode 100644 index e87fe317..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/esm-node/v5.js +++ /dev/null @@ -1,4 +0,0 @@ -import v35 from './v35.js'; -import sha1 from './sha1.js'; -const v5 = v35('v5', 0x50, sha1); -export default v5; \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/esm-node/validate.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/esm-node/validate.js deleted file mode 100644 index f1cdc7af..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/esm-node/validate.js +++ /dev/null @@ -1,7 +0,0 @@ -import REGEX from './regex.js'; - -function validate(uuid) { - return typeof uuid === 'string' && REGEX.test(uuid); -} - -export default validate; \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/esm-node/version.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/esm-node/version.js deleted file mode 100644 index 93630763..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/esm-node/version.js +++ /dev/null @@ -1,11 +0,0 @@ -import validate from './validate.js'; - -function version(uuid) { - if (!validate(uuid)) { - throw TypeError('Invalid UUID'); - } - - return parseInt(uuid.slice(14, 15), 16); -} - -export default version; \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/index.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/index.js deleted file mode 100644 index 88d676a2..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/index.js +++ /dev/null @@ -1,79 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -Object.defineProperty(exports, "NIL", { - enumerable: true, - get: function () { - return _nil.default; - } -}); -Object.defineProperty(exports, "parse", { - enumerable: true, - get: function () { - return _parse.default; - } -}); -Object.defineProperty(exports, "stringify", { - enumerable: true, - get: function () { - return _stringify.default; - } -}); -Object.defineProperty(exports, "v1", { - enumerable: true, - get: function () { - return _v.default; - } -}); -Object.defineProperty(exports, "v3", { - enumerable: true, - get: function () { - return _v2.default; - } -}); -Object.defineProperty(exports, "v4", { - enumerable: true, - get: function () { - return _v3.default; - } -}); -Object.defineProperty(exports, "v5", { - enumerable: true, - get: function () { - return _v4.default; - } -}); -Object.defineProperty(exports, "validate", { - enumerable: true, - get: function () { - return _validate.default; - } -}); -Object.defineProperty(exports, "version", { - enumerable: true, - get: function () { - return _version.default; - } -}); - -var _v = _interopRequireDefault(require("./v1.js")); - -var _v2 = _interopRequireDefault(require("./v3.js")); - -var _v3 = _interopRequireDefault(require("./v4.js")); - -var _v4 = _interopRequireDefault(require("./v5.js")); - -var _nil = _interopRequireDefault(require("./nil.js")); - -var _version = _interopRequireDefault(require("./version.js")); - -var _validate = _interopRequireDefault(require("./validate.js")); - -var _stringify = _interopRequireDefault(require("./stringify.js")); - -var _parse = _interopRequireDefault(require("./parse.js")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/md5-browser.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/md5-browser.js deleted file mode 100644 index 7a4582ac..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/md5-browser.js +++ /dev/null @@ -1,223 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; - -/* - * Browser-compatible JavaScript MD5 - * - * Modification of JavaScript MD5 - * https://github.com/blueimp/JavaScript-MD5 - * - * Copyright 2011, Sebastian Tschan - * https://blueimp.net - * - * Licensed under the MIT license: - * https://opensource.org/licenses/MIT - * - * Based on - * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message - * Digest Algorithm, as defined in RFC 1321. - * Version 2.2 Copyright (C) Paul Johnston 1999 - 2009 - * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet - * Distributed under the BSD License - * See http://pajhome.org.uk/crypt/md5 for more info. - */ -function md5(bytes) { - if (typeof bytes === 'string') { - const msg = unescape(encodeURIComponent(bytes)); // UTF8 escape - - bytes = new Uint8Array(msg.length); - - for (let i = 0; i < msg.length; ++i) { - bytes[i] = msg.charCodeAt(i); - } - } - - return md5ToHexEncodedArray(wordsToMd5(bytesToWords(bytes), bytes.length * 8)); -} -/* - * Convert an array of little-endian words to an array of bytes - */ - - -function md5ToHexEncodedArray(input) { - const output = []; - const length32 = input.length * 32; - const hexTab = '0123456789abcdef'; - - for (let i = 0; i < length32; i += 8) { - const x = input[i >> 5] >>> i % 32 & 0xff; - const hex = parseInt(hexTab.charAt(x >>> 4 & 0x0f) + hexTab.charAt(x & 0x0f), 16); - output.push(hex); - } - - return output; -} -/** - * Calculate output length with padding and bit length - */ - - -function getOutputLength(inputLength8) { - return (inputLength8 + 64 >>> 9 << 4) + 14 + 1; -} -/* - * Calculate the MD5 of an array of little-endian words, and a bit length. - */ - - -function wordsToMd5(x, len) { - /* append padding */ - x[len >> 5] |= 0x80 << len % 32; - x[getOutputLength(len) - 1] = len; - let a = 1732584193; - let b = -271733879; - let c = -1732584194; - let d = 271733878; - - for (let i = 0; i < x.length; i += 16) { - const olda = a; - const oldb = b; - const oldc = c; - const oldd = d; - a = md5ff(a, b, c, d, x[i], 7, -680876936); - d = md5ff(d, a, b, c, x[i + 1], 12, -389564586); - c = md5ff(c, d, a, b, x[i + 2], 17, 606105819); - b = md5ff(b, c, d, a, x[i + 3], 22, -1044525330); - a = md5ff(a, b, c, d, x[i + 4], 7, -176418897); - d = md5ff(d, a, b, c, x[i + 5], 12, 1200080426); - c = md5ff(c, d, a, b, x[i + 6], 17, -1473231341); - b = md5ff(b, c, d, a, x[i + 7], 22, -45705983); - a = md5ff(a, b, c, d, x[i + 8], 7, 1770035416); - d = md5ff(d, a, b, c, x[i + 9], 12, -1958414417); - c = md5ff(c, d, a, b, x[i + 10], 17, -42063); - b = md5ff(b, c, d, a, x[i + 11], 22, -1990404162); - a = md5ff(a, b, c, d, x[i + 12], 7, 1804603682); - d = md5ff(d, a, b, c, x[i + 13], 12, -40341101); - c = md5ff(c, d, a, b, x[i + 14], 17, -1502002290); - b = md5ff(b, c, d, a, x[i + 15], 22, 1236535329); - a = md5gg(a, b, c, d, x[i + 1], 5, -165796510); - d = md5gg(d, a, b, c, x[i + 6], 9, -1069501632); - c = md5gg(c, d, a, b, x[i + 11], 14, 643717713); - b = md5gg(b, c, d, a, x[i], 20, -373897302); - a = md5gg(a, b, c, d, x[i + 5], 5, -701558691); - d = md5gg(d, a, b, c, x[i + 10], 9, 38016083); - c = md5gg(c, d, a, b, x[i + 15], 14, -660478335); - b = md5gg(b, c, d, a, x[i + 4], 20, -405537848); - a = md5gg(a, b, c, d, x[i + 9], 5, 568446438); - d = md5gg(d, a, b, c, x[i + 14], 9, -1019803690); - c = md5gg(c, d, a, b, x[i + 3], 14, -187363961); - b = md5gg(b, c, d, a, x[i + 8], 20, 1163531501); - a = md5gg(a, b, c, d, x[i + 13], 5, -1444681467); - d = md5gg(d, a, b, c, x[i + 2], 9, -51403784); - c = md5gg(c, d, a, b, x[i + 7], 14, 1735328473); - b = md5gg(b, c, d, a, x[i + 12], 20, -1926607734); - a = md5hh(a, b, c, d, x[i + 5], 4, -378558); - d = md5hh(d, a, b, c, x[i + 8], 11, -2022574463); - c = md5hh(c, d, a, b, x[i + 11], 16, 1839030562); - b = md5hh(b, c, d, a, x[i + 14], 23, -35309556); - a = md5hh(a, b, c, d, x[i + 1], 4, -1530992060); - d = md5hh(d, a, b, c, x[i + 4], 11, 1272893353); - c = md5hh(c, d, a, b, x[i + 7], 16, -155497632); - b = md5hh(b, c, d, a, x[i + 10], 23, -1094730640); - a = md5hh(a, b, c, d, x[i + 13], 4, 681279174); - d = md5hh(d, a, b, c, x[i], 11, -358537222); - c = md5hh(c, d, a, b, x[i + 3], 16, -722521979); - b = md5hh(b, c, d, a, x[i + 6], 23, 76029189); - a = md5hh(a, b, c, d, x[i + 9], 4, -640364487); - d = md5hh(d, a, b, c, x[i + 12], 11, -421815835); - c = md5hh(c, d, a, b, x[i + 15], 16, 530742520); - b = md5hh(b, c, d, a, x[i + 2], 23, -995338651); - a = md5ii(a, b, c, d, x[i], 6, -198630844); - d = md5ii(d, a, b, c, x[i + 7], 10, 1126891415); - c = md5ii(c, d, a, b, x[i + 14], 15, -1416354905); - b = md5ii(b, c, d, a, x[i + 5], 21, -57434055); - a = md5ii(a, b, c, d, x[i + 12], 6, 1700485571); - d = md5ii(d, a, b, c, x[i + 3], 10, -1894986606); - c = md5ii(c, d, a, b, x[i + 10], 15, -1051523); - b = md5ii(b, c, d, a, x[i + 1], 21, -2054922799); - a = md5ii(a, b, c, d, x[i + 8], 6, 1873313359); - d = md5ii(d, a, b, c, x[i + 15], 10, -30611744); - c = md5ii(c, d, a, b, x[i + 6], 15, -1560198380); - b = md5ii(b, c, d, a, x[i + 13], 21, 1309151649); - a = md5ii(a, b, c, d, x[i + 4], 6, -145523070); - d = md5ii(d, a, b, c, x[i + 11], 10, -1120210379); - c = md5ii(c, d, a, b, x[i + 2], 15, 718787259); - b = md5ii(b, c, d, a, x[i + 9], 21, -343485551); - a = safeAdd(a, olda); - b = safeAdd(b, oldb); - c = safeAdd(c, oldc); - d = safeAdd(d, oldd); - } - - return [a, b, c, d]; -} -/* - * Convert an array bytes to an array of little-endian words - * Characters >255 have their high-byte silently ignored. - */ - - -function bytesToWords(input) { - if (input.length === 0) { - return []; - } - - const length8 = input.length * 8; - const output = new Uint32Array(getOutputLength(length8)); - - for (let i = 0; i < length8; i += 8) { - output[i >> 5] |= (input[i / 8] & 0xff) << i % 32; - } - - return output; -} -/* - * Add integers, wrapping at 2^32. This uses 16-bit operations internally - * to work around bugs in some JS interpreters. - */ - - -function safeAdd(x, y) { - const lsw = (x & 0xffff) + (y & 0xffff); - const msw = (x >> 16) + (y >> 16) + (lsw >> 16); - return msw << 16 | lsw & 0xffff; -} -/* - * Bitwise rotate a 32-bit number to the left. - */ - - -function bitRotateLeft(num, cnt) { - return num << cnt | num >>> 32 - cnt; -} -/* - * These functions implement the four basic operations the algorithm uses. - */ - - -function md5cmn(q, a, b, x, s, t) { - return safeAdd(bitRotateLeft(safeAdd(safeAdd(a, q), safeAdd(x, t)), s), b); -} - -function md5ff(a, b, c, d, x, s, t) { - return md5cmn(b & c | ~b & d, a, b, x, s, t); -} - -function md5gg(a, b, c, d, x, s, t) { - return md5cmn(b & d | c & ~d, a, b, x, s, t); -} - -function md5hh(a, b, c, d, x, s, t) { - return md5cmn(b ^ c ^ d, a, b, x, s, t); -} - -function md5ii(a, b, c, d, x, s, t) { - return md5cmn(c ^ (b | ~d), a, b, x, s, t); -} - -var _default = md5; -exports.default = _default; \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/md5.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/md5.js deleted file mode 100644 index 824d4816..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/md5.js +++ /dev/null @@ -1,23 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; - -var _crypto = _interopRequireDefault(require("crypto")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function md5(bytes) { - if (Array.isArray(bytes)) { - bytes = Buffer.from(bytes); - } else if (typeof bytes === 'string') { - bytes = Buffer.from(bytes, 'utf8'); - } - - return _crypto.default.createHash('md5').update(bytes).digest(); -} - -var _default = md5; -exports.default = _default; \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/native-browser.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/native-browser.js deleted file mode 100644 index c2eea59d..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/native-browser.js +++ /dev/null @@ -1,11 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; -const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto); -var _default = { - randomUUID -}; -exports.default = _default; \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/native.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/native.js deleted file mode 100644 index de804691..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/native.js +++ /dev/null @@ -1,15 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; - -var _crypto = _interopRequireDefault(require("crypto")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var _default = { - randomUUID: _crypto.default.randomUUID -}; -exports.default = _default; \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/nil.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/nil.js deleted file mode 100644 index 7ade577b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/nil.js +++ /dev/null @@ -1,8 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; -var _default = '00000000-0000-0000-0000-000000000000'; -exports.default = _default; \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/parse.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/parse.js deleted file mode 100644 index 4c69fc39..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/parse.js +++ /dev/null @@ -1,45 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; - -var _validate = _interopRequireDefault(require("./validate.js")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function parse(uuid) { - if (!(0, _validate.default)(uuid)) { - throw TypeError('Invalid UUID'); - } - - let v; - const arr = new Uint8Array(16); // Parse ########-....-....-....-............ - - arr[0] = (v = parseInt(uuid.slice(0, 8), 16)) >>> 24; - arr[1] = v >>> 16 & 0xff; - arr[2] = v >>> 8 & 0xff; - arr[3] = v & 0xff; // Parse ........-####-....-....-............ - - arr[4] = (v = parseInt(uuid.slice(9, 13), 16)) >>> 8; - arr[5] = v & 0xff; // Parse ........-....-####-....-............ - - arr[6] = (v = parseInt(uuid.slice(14, 18), 16)) >>> 8; - arr[7] = v & 0xff; // Parse ........-....-....-####-............ - - arr[8] = (v = parseInt(uuid.slice(19, 23), 16)) >>> 8; - arr[9] = v & 0xff; // Parse ........-....-....-....-############ - // (Use "/" to avoid 32-bit truncation when bit-shifting high-order bytes) - - arr[10] = (v = parseInt(uuid.slice(24, 36), 16)) / 0x10000000000 & 0xff; - arr[11] = v / 0x100000000 & 0xff; - arr[12] = v >>> 24 & 0xff; - arr[13] = v >>> 16 & 0xff; - arr[14] = v >>> 8 & 0xff; - arr[15] = v & 0xff; - return arr; -} - -var _default = parse; -exports.default = _default; \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/regex.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/regex.js deleted file mode 100644 index 1ef91d64..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/regex.js +++ /dev/null @@ -1,8 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; -var _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; -exports.default = _default; \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/rng-browser.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/rng-browser.js deleted file mode 100644 index d067cdb0..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/rng-browser.js +++ /dev/null @@ -1,25 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = rng; -// Unique ID creation requires a high quality random # generator. In the browser we therefore -// require the crypto API and do not support built-in fallback to lower quality random number -// generators (like Math.random()). -let getRandomValues; -const rnds8 = new Uint8Array(16); - -function rng() { - // lazy load so that environments that need to polyfill have a chance to do so - if (!getRandomValues) { - // getRandomValues needs to be invoked in a context where "this" is a Crypto implementation. - getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto); - - if (!getRandomValues) { - throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported'); - } - } - - return getRandomValues(rnds8); -} \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/rng.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/rng.js deleted file mode 100644 index 3507f937..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/rng.js +++ /dev/null @@ -1,24 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = rng; - -var _crypto = _interopRequireDefault(require("crypto")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -const rnds8Pool = new Uint8Array(256); // # of random values to pre-allocate - -let poolPtr = rnds8Pool.length; - -function rng() { - if (poolPtr > rnds8Pool.length - 16) { - _crypto.default.randomFillSync(rnds8Pool); - - poolPtr = 0; - } - - return rnds8Pool.slice(poolPtr, poolPtr += 16); -} \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/sha1-browser.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/sha1-browser.js deleted file mode 100644 index 24cbcedc..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/sha1-browser.js +++ /dev/null @@ -1,104 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; - -// Adapted from Chris Veness' SHA1 code at -// http://www.movable-type.co.uk/scripts/sha1.html -function f(s, x, y, z) { - switch (s) { - case 0: - return x & y ^ ~x & z; - - case 1: - return x ^ y ^ z; - - case 2: - return x & y ^ x & z ^ y & z; - - case 3: - return x ^ y ^ z; - } -} - -function ROTL(x, n) { - return x << n | x >>> 32 - n; -} - -function sha1(bytes) { - const K = [0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xca62c1d6]; - const H = [0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0]; - - if (typeof bytes === 'string') { - const msg = unescape(encodeURIComponent(bytes)); // UTF8 escape - - bytes = []; - - for (let i = 0; i < msg.length; ++i) { - bytes.push(msg.charCodeAt(i)); - } - } else if (!Array.isArray(bytes)) { - // Convert Array-like to Array - bytes = Array.prototype.slice.call(bytes); - } - - bytes.push(0x80); - const l = bytes.length / 4 + 2; - const N = Math.ceil(l / 16); - const M = new Array(N); - - for (let i = 0; i < N; ++i) { - const arr = new Uint32Array(16); - - for (let j = 0; j < 16; ++j) { - arr[j] = bytes[i * 64 + j * 4] << 24 | bytes[i * 64 + j * 4 + 1] << 16 | bytes[i * 64 + j * 4 + 2] << 8 | bytes[i * 64 + j * 4 + 3]; - } - - M[i] = arr; - } - - M[N - 1][14] = (bytes.length - 1) * 8 / Math.pow(2, 32); - M[N - 1][14] = Math.floor(M[N - 1][14]); - M[N - 1][15] = (bytes.length - 1) * 8 & 0xffffffff; - - for (let i = 0; i < N; ++i) { - const W = new Uint32Array(80); - - for (let t = 0; t < 16; ++t) { - W[t] = M[i][t]; - } - - for (let t = 16; t < 80; ++t) { - W[t] = ROTL(W[t - 3] ^ W[t - 8] ^ W[t - 14] ^ W[t - 16], 1); - } - - let a = H[0]; - let b = H[1]; - let c = H[2]; - let d = H[3]; - let e = H[4]; - - for (let t = 0; t < 80; ++t) { - const s = Math.floor(t / 20); - const T = ROTL(a, 5) + f(s, b, c, d) + e + K[s] + W[t] >>> 0; - e = d; - d = c; - c = ROTL(b, 30) >>> 0; - b = a; - a = T; - } - - H[0] = H[0] + a >>> 0; - H[1] = H[1] + b >>> 0; - H[2] = H[2] + c >>> 0; - H[3] = H[3] + d >>> 0; - H[4] = H[4] + e >>> 0; - } - - return [H[0] >> 24 & 0xff, H[0] >> 16 & 0xff, H[0] >> 8 & 0xff, H[0] & 0xff, H[1] >> 24 & 0xff, H[1] >> 16 & 0xff, H[1] >> 8 & 0xff, H[1] & 0xff, H[2] >> 24 & 0xff, H[2] >> 16 & 0xff, H[2] >> 8 & 0xff, H[2] & 0xff, H[3] >> 24 & 0xff, H[3] >> 16 & 0xff, H[3] >> 8 & 0xff, H[3] & 0xff, H[4] >> 24 & 0xff, H[4] >> 16 & 0xff, H[4] >> 8 & 0xff, H[4] & 0xff]; -} - -var _default = sha1; -exports.default = _default; \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/sha1.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/sha1.js deleted file mode 100644 index 03bdd63c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/sha1.js +++ /dev/null @@ -1,23 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; - -var _crypto = _interopRequireDefault(require("crypto")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function sha1(bytes) { - if (Array.isArray(bytes)) { - bytes = Buffer.from(bytes); - } else if (typeof bytes === 'string') { - bytes = Buffer.from(bytes, 'utf8'); - } - - return _crypto.default.createHash('sha1').update(bytes).digest(); -} - -var _default = sha1; -exports.default = _default; \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/stringify.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/stringify.js deleted file mode 100644 index bdcea1ce..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/stringify.js +++ /dev/null @@ -1,44 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; -exports.unsafeStringify = unsafeStringify; - -var _validate = _interopRequireDefault(require("./validate.js")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * Convert array of 16 byte values to UUID string format of the form: - * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX - */ -const byteToHex = []; - -for (let i = 0; i < 256; ++i) { - byteToHex.push((i + 0x100).toString(16).slice(1)); -} - -function unsafeStringify(arr, offset = 0) { - // Note: Be careful editing this code! It's been tuned for performance - // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434 - return (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase(); -} - -function stringify(arr, offset = 0) { - const uuid = unsafeStringify(arr, offset); // Consistency check for valid UUID. If this throws, it's likely due to one - // of the following: - // - One or more input array values don't map to a hex octet (leading to - // "undefined" in the uuid) - // - Invalid input values for the RFC `version` or `variant` fields - - if (!(0, _validate.default)(uuid)) { - throw TypeError('Stringified UUID is invalid'); - } - - return uuid; -} - -var _default = stringify; -exports.default = _default; \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/uuid-bin.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/uuid-bin.js deleted file mode 100644 index 50a7a9f1..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/uuid-bin.js +++ /dev/null @@ -1,85 +0,0 @@ -"use strict"; - -var _assert = _interopRequireDefault(require("assert")); - -var _v = _interopRequireDefault(require("./v1.js")); - -var _v2 = _interopRequireDefault(require("./v3.js")); - -var _v3 = _interopRequireDefault(require("./v4.js")); - -var _v4 = _interopRequireDefault(require("./v5.js")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function usage() { - console.log('Usage:'); - console.log(' uuid'); - console.log(' uuid v1'); - console.log(' uuid v3 '); - console.log(' uuid v4'); - console.log(' uuid v5 '); - console.log(' uuid --help'); - console.log('\nNote: may be "URL" or "DNS" to use the corresponding UUIDs defined by RFC4122'); -} - -const args = process.argv.slice(2); - -if (args.indexOf('--help') >= 0) { - usage(); - process.exit(0); -} - -const version = args.shift() || 'v4'; - -switch (version) { - case 'v1': - console.log((0, _v.default)()); - break; - - case 'v3': - { - const name = args.shift(); - let namespace = args.shift(); - (0, _assert.default)(name != null, 'v3 name not specified'); - (0, _assert.default)(namespace != null, 'v3 namespace not specified'); - - if (namespace === 'URL') { - namespace = _v2.default.URL; - } - - if (namespace === 'DNS') { - namespace = _v2.default.DNS; - } - - console.log((0, _v2.default)(name, namespace)); - break; - } - - case 'v4': - console.log((0, _v3.default)()); - break; - - case 'v5': - { - const name = args.shift(); - let namespace = args.shift(); - (0, _assert.default)(name != null, 'v5 name not specified'); - (0, _assert.default)(namespace != null, 'v5 namespace not specified'); - - if (namespace === 'URL') { - namespace = _v4.default.URL; - } - - if (namespace === 'DNS') { - namespace = _v4.default.DNS; - } - - console.log((0, _v4.default)(name, namespace)); - break; - } - - default: - usage(); - process.exit(1); -} \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/v1.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/v1.js deleted file mode 100644 index 125bc58f..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/v1.js +++ /dev/null @@ -1,107 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; - -var _rng = _interopRequireDefault(require("./rng.js")); - -var _stringify = require("./stringify.js"); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -// **`v1()` - Generate time-based UUID** -// -// Inspired by https://github.com/LiosK/UUID.js -// and http://docs.python.org/library/uuid.html -let _nodeId; - -let _clockseq; // Previous uuid creation time - - -let _lastMSecs = 0; -let _lastNSecs = 0; // See https://github.com/uuidjs/uuid for API details - -function v1(options, buf, offset) { - let i = buf && offset || 0; - const b = buf || new Array(16); - options = options || {}; - let node = options.node || _nodeId; - let clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq; // node and clockseq need to be initialized to random values if they're not - // specified. We do this lazily to minimize issues related to insufficient - // system entropy. See #189 - - if (node == null || clockseq == null) { - const seedBytes = options.random || (options.rng || _rng.default)(); - - if (node == null) { - // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1) - node = _nodeId = [seedBytes[0] | 0x01, seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]]; - } - - if (clockseq == null) { - // Per 4.2.2, randomize (14 bit) clockseq - clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff; - } - } // UUID timestamps are 100 nano-second units since the Gregorian epoch, - // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so - // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs' - // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00. - - - let msecs = options.msecs !== undefined ? options.msecs : Date.now(); // Per 4.2.1.2, use count of uuid's generated during the current clock - // cycle to simulate higher resolution clock - - let nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1; // Time since last uuid creation (in msecs) - - const dt = msecs - _lastMSecs + (nsecs - _lastNSecs) / 10000; // Per 4.2.1.2, Bump clockseq on clock regression - - if (dt < 0 && options.clockseq === undefined) { - clockseq = clockseq + 1 & 0x3fff; - } // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new - // time interval - - - if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) { - nsecs = 0; - } // Per 4.2.1.2 Throw error if too many uuids are requested - - - if (nsecs >= 10000) { - throw new Error("uuid.v1(): Can't create more than 10M uuids/sec"); - } - - _lastMSecs = msecs; - _lastNSecs = nsecs; - _clockseq = clockseq; // Per 4.1.4 - Convert from unix epoch to Gregorian epoch - - msecs += 12219292800000; // `time_low` - - const tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000; - b[i++] = tl >>> 24 & 0xff; - b[i++] = tl >>> 16 & 0xff; - b[i++] = tl >>> 8 & 0xff; - b[i++] = tl & 0xff; // `time_mid` - - const tmh = msecs / 0x100000000 * 10000 & 0xfffffff; - b[i++] = tmh >>> 8 & 0xff; - b[i++] = tmh & 0xff; // `time_high_and_version` - - b[i++] = tmh >>> 24 & 0xf | 0x10; // include version - - b[i++] = tmh >>> 16 & 0xff; // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant) - - b[i++] = clockseq >>> 8 | 0x80; // `clock_seq_low` - - b[i++] = clockseq & 0xff; // `node` - - for (let n = 0; n < 6; ++n) { - b[i + n] = node[n]; - } - - return buf || (0, _stringify.unsafeStringify)(b); -} - -var _default = v1; -exports.default = _default; \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/v3.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/v3.js deleted file mode 100644 index 6b47ff51..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/v3.js +++ /dev/null @@ -1,16 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; - -var _v = _interopRequireDefault(require("./v35.js")); - -var _md = _interopRequireDefault(require("./md5.js")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -const v3 = (0, _v.default)('v3', 0x30, _md.default); -var _default = v3; -exports.default = _default; \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/v35.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/v35.js deleted file mode 100644 index 7c522d97..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/v35.js +++ /dev/null @@ -1,80 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.URL = exports.DNS = void 0; -exports.default = v35; - -var _stringify = require("./stringify.js"); - -var _parse = _interopRequireDefault(require("./parse.js")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function stringToBytes(str) { - str = unescape(encodeURIComponent(str)); // UTF8 escape - - const bytes = []; - - for (let i = 0; i < str.length; ++i) { - bytes.push(str.charCodeAt(i)); - } - - return bytes; -} - -const DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8'; -exports.DNS = DNS; -const URL = '6ba7b811-9dad-11d1-80b4-00c04fd430c8'; -exports.URL = URL; - -function v35(name, version, hashfunc) { - function generateUUID(value, namespace, buf, offset) { - var _namespace; - - if (typeof value === 'string') { - value = stringToBytes(value); - } - - if (typeof namespace === 'string') { - namespace = (0, _parse.default)(namespace); - } - - if (((_namespace = namespace) === null || _namespace === void 0 ? void 0 : _namespace.length) !== 16) { - throw TypeError('Namespace must be array-like (16 iterable integer values, 0-255)'); - } // Compute hash of namespace and value, Per 4.3 - // Future: Use spread syntax when supported on all platforms, e.g. `bytes = - // hashfunc([...namespace, ... value])` - - - let bytes = new Uint8Array(16 + value.length); - bytes.set(namespace); - bytes.set(value, namespace.length); - bytes = hashfunc(bytes); - bytes[6] = bytes[6] & 0x0f | version; - bytes[8] = bytes[8] & 0x3f | 0x80; - - if (buf) { - offset = offset || 0; - - for (let i = 0; i < 16; ++i) { - buf[offset + i] = bytes[i]; - } - - return buf; - } - - return (0, _stringify.unsafeStringify)(bytes); - } // Function#name is not settable on some platforms (#270) - - - try { - generateUUID.name = name; // eslint-disable-next-line no-empty - } catch (err) {} // For CommonJS default export support - - - generateUUID.DNS = DNS; - generateUUID.URL = URL; - return generateUUID; -} \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/v4.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/v4.js deleted file mode 100644 index 959d6986..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/v4.js +++ /dev/null @@ -1,43 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; - -var _native = _interopRequireDefault(require("./native.js")); - -var _rng = _interopRequireDefault(require("./rng.js")); - -var _stringify = require("./stringify.js"); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function v4(options, buf, offset) { - if (_native.default.randomUUID && !buf && !options) { - return _native.default.randomUUID(); - } - - options = options || {}; - - const rnds = options.random || (options.rng || _rng.default)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved` - - - rnds[6] = rnds[6] & 0x0f | 0x40; - rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided - - if (buf) { - offset = offset || 0; - - for (let i = 0; i < 16; ++i) { - buf[offset + i] = rnds[i]; - } - - return buf; - } - - return (0, _stringify.unsafeStringify)(rnds); -} - -var _default = v4; -exports.default = _default; \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/v5.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/v5.js deleted file mode 100644 index 99d615e0..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/v5.js +++ /dev/null @@ -1,16 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; - -var _v = _interopRequireDefault(require("./v35.js")); - -var _sha = _interopRequireDefault(require("./sha1.js")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -const v5 = (0, _v.default)('v5', 0x50, _sha.default); -var _default = v5; -exports.default = _default; \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/validate.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/validate.js deleted file mode 100644 index fd052157..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/validate.js +++ /dev/null @@ -1,17 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; - -var _regex = _interopRequireDefault(require("./regex.js")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function validate(uuid) { - return typeof uuid === 'string' && _regex.default.test(uuid); -} - -var _default = validate; -exports.default = _default; \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/version.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/version.js deleted file mode 100644 index f63af01a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/dist/version.js +++ /dev/null @@ -1,21 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; - -var _validate = _interopRequireDefault(require("./validate.js")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function version(uuid) { - if (!(0, _validate.default)(uuid)) { - throw TypeError('Invalid UUID'); - } - - return parseInt(uuid.slice(14, 15), 16); -} - -var _default = version; -exports.default = _default; \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/package.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/package.json deleted file mode 100644 index 92cd9eba..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/package.json +++ /dev/null @@ -1,131 +0,0 @@ -{ - "name": "uuid", - "version": "9.0.0", - "description": "RFC4122 (v1, v4, and v5) UUIDs", - "commitlint": { - "extends": [ - "@commitlint/config-conventional" - ] - }, - "keywords": [ - "uuid", - "guid", - "rfc4122" - ], - "license": "MIT", - "bin": { - "uuid": "./dist/bin/uuid" - }, - "sideEffects": false, - "main": "./dist/index.js", - "exports": { - ".": { - "node": { - "module": "./dist/esm-node/index.js", - "require": "./dist/index.js", - "import": "./wrapper.mjs" - }, - "browser": { - "import": "./dist/esm-browser/index.js", - "require": "./dist/commonjs-browser/index.js" - }, - "default": "./dist/esm-browser/index.js" - }, - "./package.json": "./package.json" - }, - "module": "./dist/esm-node/index.js", - "browser": { - "./dist/md5.js": "./dist/md5-browser.js", - "./dist/native.js": "./dist/native-browser.js", - "./dist/rng.js": "./dist/rng-browser.js", - "./dist/sha1.js": "./dist/sha1-browser.js", - "./dist/esm-node/index.js": "./dist/esm-browser/index.js" - }, - "files": [ - "CHANGELOG.md", - "CONTRIBUTING.md", - "LICENSE.md", - "README.md", - "dist", - "wrapper.mjs" - ], - "devDependencies": { - "@babel/cli": "7.18.10", - "@babel/core": "7.18.10", - "@babel/eslint-parser": "7.18.9", - "@babel/preset-env": "7.18.10", - "@commitlint/cli": "17.0.3", - "@commitlint/config-conventional": "17.0.3", - "bundlewatch": "0.3.3", - "eslint": "8.21.0", - "eslint-config-prettier": "8.5.0", - "eslint-config-standard": "17.0.0", - "eslint-plugin-import": "2.26.0", - "eslint-plugin-node": "11.1.0", - "eslint-plugin-prettier": "4.2.1", - "eslint-plugin-promise": "6.0.0", - "husky": "8.0.1", - "jest": "28.1.3", - "lint-staged": "13.0.3", - "npm-run-all": "4.1.5", - "optional-dev-dependency": "2.0.1", - "prettier": "2.7.1", - "random-seed": "0.3.0", - "runmd": "1.3.6", - "standard-version": "9.5.0" - }, - "optionalDevDependencies": { - "@wdio/browserstack-service": "7.16.10", - "@wdio/cli": "7.16.10", - "@wdio/jasmine-framework": "7.16.6", - "@wdio/local-runner": "7.16.10", - "@wdio/spec-reporter": "7.16.9", - "@wdio/static-server-service": "7.16.6" - }, - "scripts": { - "examples:browser:webpack:build": "cd examples/browser-webpack && npm install && npm run build", - "examples:browser:rollup:build": "cd examples/browser-rollup && npm install && npm run build", - "examples:node:commonjs:test": "cd examples/node-commonjs && npm install && npm test", - "examples:node:esmodules:test": "cd examples/node-esmodules && npm install && npm test", - "examples:node:jest:test": "cd examples/node-jest && npm install && npm test", - "prepare": "cd $( git rev-parse --show-toplevel ) && husky install", - "lint": "npm run eslint:check && npm run prettier:check", - "eslint:check": "eslint src/ test/ examples/ *.js", - "eslint:fix": "eslint --fix src/ test/ examples/ *.js", - "pretest": "[ -n $CI ] || npm run build", - "test": "BABEL_ENV=commonjsNode node --throw-deprecation node_modules/.bin/jest test/unit/", - "pretest:browser": "optional-dev-dependency && npm run build && npm-run-all --parallel examples:browser:**", - "test:browser": "wdio run ./wdio.conf.js", - "pretest:node": "npm run build", - "test:node": "npm-run-all --parallel examples:node:**", - "test:pack": "./scripts/testpack.sh", - "pretest:benchmark": "npm run build", - "test:benchmark": "cd examples/benchmark && npm install && npm test", - "prettier:check": "prettier --check '**/*.{js,jsx,json,md}'", - "prettier:fix": "prettier --write '**/*.{js,jsx,json,md}'", - "bundlewatch": "npm run pretest:browser && bundlewatch --config bundlewatch.config.json", - "md": "runmd --watch --output=README.md README_js.md", - "docs": "( node --version | grep -q 'v16' ) && ( npm run build && runmd --output=README.md README_js.md )", - "docs:diff": "npm run docs && git diff --quiet README.md", - "build": "./scripts/build.sh", - "prepack": "npm run build", - "release": "standard-version --no-verify" - }, - "repository": { - "type": "git", - "url": "https://github.com/uuidjs/uuid.git" - }, - "lint-staged": { - "*.{js,jsx,json,md}": [ - "prettier --write" - ], - "*.{js,jsx}": [ - "eslint --fix" - ] - }, - "standard-version": { - "scripts": { - "postchangelog": "prettier --write CHANGELOG.md" - } - } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/wrapper.mjs b/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/wrapper.mjs deleted file mode 100644 index c31e9cef..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/uuid/wrapper.mjs +++ /dev/null @@ -1,10 +0,0 @@ -import uuid from './dist/index.js'; -export const v1 = uuid.v1; -export const v3 = uuid.v3; -export const v4 = uuid.v4; -export const v5 = uuid.v5; -export const NIL = uuid.NIL; -export const version = uuid.version; -export const validate = uuid.validate; -export const stringify = uuid.stringify; -export const parse = uuid.parse; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/webidl-conversions/LICENSE.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/webidl-conversions/LICENSE.md deleted file mode 100644 index d4a994f5..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/webidl-conversions/LICENSE.md +++ /dev/null @@ -1,12 +0,0 @@ -# The BSD 2-Clause License - -Copyright (c) 2014, Domenic Denicola -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/webidl-conversions/README.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/webidl-conversions/README.md deleted file mode 100644 index 3657890a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/webidl-conversions/README.md +++ /dev/null @@ -1,53 +0,0 @@ -# WebIDL Type Conversions on JavaScript Values - -This package implements, in JavaScript, the algorithms to convert a given JavaScript value according to a given [WebIDL](http://heycam.github.io/webidl/) [type](http://heycam.github.io/webidl/#idl-types). - -The goal is that you should be able to write code like - -```js -const conversions = require("webidl-conversions"); - -function doStuff(x, y) { - x = conversions["boolean"](x); - y = conversions["unsigned long"](y); - // actual algorithm code here -} -``` - -and your function `doStuff` will behave the same as a WebIDL operation declared as - -```webidl -void doStuff(boolean x, unsigned long y); -``` - -## API - -This package's main module's default export is an object with a variety of methods, each corresponding to a different WebIDL type. Each method, when invoked on a JavaScript value, will give back the new JavaScript value that results after passing through the WebIDL conversion rules. (See below for more details on what that means.) Alternately, the method could throw an error, if the WebIDL algorithm is specified to do so: for example `conversions["float"](NaN)` [will throw a `TypeError`](http://heycam.github.io/webidl/#es-float). - -## Status - -All of the numeric types are implemented (float being implemented as double) and some others are as well - check the source for all of them. This list will grow over time in service of the [HTML as Custom Elements](https://github.com/dglazkov/html-as-custom-elements) project, but in the meantime, pull requests welcome! - -I'm not sure yet what the strategy will be for modifiers, e.g. [`[Clamp]`](http://heycam.github.io/webidl/#Clamp). Maybe something like `conversions["unsigned long"](x, { clamp: true })`? We'll see. - -We might also want to extend the API to give better error messages, e.g. "Argument 1 of HTMLMediaElement.fastSeek is not a finite floating-point value" instead of "Argument is not a finite floating-point value." This would require passing in more information to the conversion functions than we currently do. - -## Background - -What's actually going on here, conceptually, is pretty weird. Let's try to explain. - -WebIDL, as part of its madness-inducing design, has its own type system. When people write algorithms in web platform specs, they usually operate on WebIDL values, i.e. instances of WebIDL types. For example, if they were specifying the algorithm for our `doStuff` operation above, they would treat `x` as a WebIDL value of [WebIDL type `boolean`](http://heycam.github.io/webidl/#idl-boolean). Crucially, they would _not_ treat `x` as a JavaScript variable whose value is either the JavaScript `true` or `false`. They're instead working in a different type system altogether, with its own rules. - -Separately from its type system, WebIDL defines a ["binding"](http://heycam.github.io/webidl/#ecmascript-binding) of the type system into JavaScript. This contains rules like: when you pass a JavaScript value to the JavaScript method that manifests a given WebIDL operation, how does that get converted into a WebIDL value? For example, a JavaScript `true` passed in the position of a WebIDL `boolean` argument becomes a WebIDL `true`. But, a JavaScript `true` passed in the position of a [WebIDL `unsigned long`](http://heycam.github.io/webidl/#idl-unsigned-long) becomes a WebIDL `1`. And so on. - -Finally, we have the actual implementation code. This is usually C++, although these days [some smart people are using Rust](https://github.com/servo/servo). The implementation, of course, has its own type system. So when they implement the WebIDL algorithms, they don't actually use WebIDL values, since those aren't "real" outside of specs. Instead, implementations apply the WebIDL binding rules in such a way as to convert incoming JavaScript values into C++ values. For example, if code in the browser called `doStuff(true, true)`, then the implementation code would eventually receive a C++ `bool` containing `true` and a C++ `uint32_t` containing `1`. - -The upside of all this is that implementations can abstract all the conversion logic away, letting WebIDL handle it, and focus on implementing the relevant methods in C++ with values of the correct type already provided. That is payoff of WebIDL, in a nutshell. - -And getting to that payoff is the goal of _this_ project—but for JavaScript implementations, instead of C++ ones. That is, this library is designed to make it easier for JavaScript developers to write functions that behave like a given WebIDL operation. So conceptually, the conversion pipeline, which in its general form is JavaScript values ↦ WebIDL values ↦ implementation-language values, in this case becomes JavaScript values ↦ WebIDL values ↦ JavaScript values. And that intermediate step is where all the logic is performed: a JavaScript `true` becomes a WebIDL `1` in an unsigned long context, which then becomes a JavaScript `1`. - -## Don't Use This - -Seriously, why would you ever use this? You really shouldn't. WebIDL is … not great, and you shouldn't be emulating its semantics. If you're looking for a generic argument-processing library, you should find one with better rules than those from WebIDL. In general, your JavaScript should not be trying to become more like WebIDL; if anything, we should fix WebIDL to make it more like JavaScript. - -The _only_ people who should use this are those trying to create faithful implementations (or polyfills) of web platform interfaces defined in WebIDL. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/webidl-conversions/lib/index.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/webidl-conversions/lib/index.js deleted file mode 100644 index c5153a3a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/webidl-conversions/lib/index.js +++ /dev/null @@ -1,189 +0,0 @@ -"use strict"; - -var conversions = {}; -module.exports = conversions; - -function sign(x) { - return x < 0 ? -1 : 1; -} - -function evenRound(x) { - // Round x to the nearest integer, choosing the even integer if it lies halfway between two. - if ((x % 1) === 0.5 && (x & 1) === 0) { // [even number].5; round down (i.e. floor) - return Math.floor(x); - } else { - return Math.round(x); - } -} - -function createNumberConversion(bitLength, typeOpts) { - if (!typeOpts.unsigned) { - --bitLength; - } - const lowerBound = typeOpts.unsigned ? 0 : -Math.pow(2, bitLength); - const upperBound = Math.pow(2, bitLength) - 1; - - const moduloVal = typeOpts.moduloBitLength ? Math.pow(2, typeOpts.moduloBitLength) : Math.pow(2, bitLength); - const moduloBound = typeOpts.moduloBitLength ? Math.pow(2, typeOpts.moduloBitLength - 1) : Math.pow(2, bitLength - 1); - - return function(V, opts) { - if (!opts) opts = {}; - - let x = +V; - - if (opts.enforceRange) { - if (!Number.isFinite(x)) { - throw new TypeError("Argument is not a finite number"); - } - - x = sign(x) * Math.floor(Math.abs(x)); - if (x < lowerBound || x > upperBound) { - throw new TypeError("Argument is not in byte range"); - } - - return x; - } - - if (!isNaN(x) && opts.clamp) { - x = evenRound(x); - - if (x < lowerBound) x = lowerBound; - if (x > upperBound) x = upperBound; - return x; - } - - if (!Number.isFinite(x) || x === 0) { - return 0; - } - - x = sign(x) * Math.floor(Math.abs(x)); - x = x % moduloVal; - - if (!typeOpts.unsigned && x >= moduloBound) { - return x - moduloVal; - } else if (typeOpts.unsigned) { - if (x < 0) { - x += moduloVal; - } else if (x === -0) { // don't return negative zero - return 0; - } - } - - return x; - } -} - -conversions["void"] = function () { - return undefined; -}; - -conversions["boolean"] = function (val) { - return !!val; -}; - -conversions["byte"] = createNumberConversion(8, { unsigned: false }); -conversions["octet"] = createNumberConversion(8, { unsigned: true }); - -conversions["short"] = createNumberConversion(16, { unsigned: false }); -conversions["unsigned short"] = createNumberConversion(16, { unsigned: true }); - -conversions["long"] = createNumberConversion(32, { unsigned: false }); -conversions["unsigned long"] = createNumberConversion(32, { unsigned: true }); - -conversions["long long"] = createNumberConversion(32, { unsigned: false, moduloBitLength: 64 }); -conversions["unsigned long long"] = createNumberConversion(32, { unsigned: true, moduloBitLength: 64 }); - -conversions["double"] = function (V) { - const x = +V; - - if (!Number.isFinite(x)) { - throw new TypeError("Argument is not a finite floating-point value"); - } - - return x; -}; - -conversions["unrestricted double"] = function (V) { - const x = +V; - - if (isNaN(x)) { - throw new TypeError("Argument is NaN"); - } - - return x; -}; - -// not quite valid, but good enough for JS -conversions["float"] = conversions["double"]; -conversions["unrestricted float"] = conversions["unrestricted double"]; - -conversions["DOMString"] = function (V, opts) { - if (!opts) opts = {}; - - if (opts.treatNullAsEmptyString && V === null) { - return ""; - } - - return String(V); -}; - -conversions["ByteString"] = function (V, opts) { - const x = String(V); - let c = undefined; - for (let i = 0; (c = x.codePointAt(i)) !== undefined; ++i) { - if (c > 255) { - throw new TypeError("Argument is not a valid bytestring"); - } - } - - return x; -}; - -conversions["USVString"] = function (V) { - const S = String(V); - const n = S.length; - const U = []; - for (let i = 0; i < n; ++i) { - const c = S.charCodeAt(i); - if (c < 0xD800 || c > 0xDFFF) { - U.push(String.fromCodePoint(c)); - } else if (0xDC00 <= c && c <= 0xDFFF) { - U.push(String.fromCodePoint(0xFFFD)); - } else { - if (i === n - 1) { - U.push(String.fromCodePoint(0xFFFD)); - } else { - const d = S.charCodeAt(i + 1); - if (0xDC00 <= d && d <= 0xDFFF) { - const a = c & 0x3FF; - const b = d & 0x3FF; - U.push(String.fromCodePoint((2 << 15) + (2 << 9) * a + b)); - ++i; - } else { - U.push(String.fromCodePoint(0xFFFD)); - } - } - } - } - - return U.join(''); -}; - -conversions["Date"] = function (V, opts) { - if (!(V instanceof Date)) { - throw new TypeError("Argument is not a Date object"); - } - if (isNaN(V)) { - return undefined; - } - - return V; -}; - -conversions["RegExp"] = function (V, opts) { - if (!(V instanceof RegExp)) { - V = new RegExp(V); - } - - return V; -}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/webidl-conversions/package.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/webidl-conversions/package.json deleted file mode 100644 index c31bc074..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/webidl-conversions/package.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "name": "webidl-conversions", - "version": "3.0.1", - "description": "Implements the WebIDL algorithms for converting to and from JavaScript values", - "main": "lib/index.js", - "scripts": { - "test": "mocha test/*.js" - }, - "repository": "jsdom/webidl-conversions", - "keywords": [ - "webidl", - "web", - "types" - ], - "files": [ - "lib/" - ], - "author": "Domenic Denicola (https://domenic.me/)", - "license": "BSD-2-Clause", - "devDependencies": { - "mocha": "^1.21.4" - } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/websocket-driver/CHANGELOG.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/websocket-driver/CHANGELOG.md deleted file mode 100644 index cb3945ff..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/websocket-driver/CHANGELOG.md +++ /dev/null @@ -1,142 +0,0 @@ -### 0.7.4 / 2020-05-22 - -- Avoid crashing if `process.version` does not contain any digits -- Emit `ping` and `pong` events from the `Server` driver -- Require http-parser-js >=0.5.1 which fixes the bug we addressed in 0.7.3 - -### 0.7.3 / 2019-06-13 - -- Cap version of http-parser-js below 0.4.11, which introduced a bug that - prevents us from handling messages that are part of the same input buffer as - the handshake response if chunked encoding is specified - -### 0.7.2 / 2019-06-13 - -(This version was pulled due to an error when publishing) - -### 0.7.1 / 2019-06-10 - -- Catch any exceptions produced while generating a handshake response and send a - `400 Bad Request` response to the client -- Pick the RFC-6455 protocol version if the request contains any of the headers - used by that version -- Use the `Buffer.alloc()` and `Buffer.from()` functions instead of the unsafe - `Buffer()` constructor -- Handle errors encountered while handling malformed draft-76 requests -- Change license from MIT to Apache 2.0 - -### 0.7.0 / 2017-09-11 - -- Add `ping` and `pong` to the set of events users can listen to -- Replace the bindings to Node's HTTP parser with `http-parser-js` - -### 0.6.5 / 2016-05-20 - -- Don't mutate buffers passed in by the application when masking - -### 0.6.4 / 2016-01-07 - -- If a number is given as input for a frame payload, send it as a string - -### 0.6.3 / 2015-11-06 - -- Reject draft-76 handshakes if their Sec-WebSocket-Key headers are invalid -- Throw a more helpful error if a client is created with an invalid URL - -### 0.6.2 / 2015-07-18 - -- When the peer sends a close frame with no error code, emit 1000 - -### 0.6.1 / 2015-07-13 - -- Use the `buffer.{read,write}UInt{16,32}BE` methods for reading/writing numbers - to buffers rather than including duplicate logic for this - -### 0.6.0 / 2015-07-08 - -- Allow the parser to recover cleanly if event listeners raise an error -- Add a `pong` method for sending unsolicited pong frames - -### 0.5.4 / 2015-03-29 - -- Don't emit extra close frames if we receive a close frame after we already - sent one -- Fail the connection when the driver receives an invalid - `Sec-WebSocket-Extensions` header - -### 0.5.3 / 2015-02-22 - -- Don't treat incoming data as WebSocket frames if a client driver is closed - before receiving the server handshake - -### 0.5.2 / 2015-02-19 - -- Fix compatibility with the HTTP parser on io.js -- Use `websocket-extensions` to make sure messages and close frames are kept in - order -- Don't emit multiple `error` events - -### 0.5.1 / 2014-12-18 - -- Don't allow drivers to be created with unrecognized options - -### 0.5.0 / 2014-12-13 - -- Support protocol extensions via the websocket-extensions module - -### 0.4.0 / 2014-11-08 - -- Support connection via HTTP proxies using `CONNECT` - -### 0.3.6 / 2014-10-04 - -- It is now possible to call `close()` before `start()` and close the driver - -### 0.3.5 / 2014-07-06 - -- Don't hold references to frame buffers after a message has been emitted -- Make sure that `protocol` and `version` are exposed properly by the TCP driver - -### 0.3.4 / 2014-05-08 - -- Don't hold memory-leaking references to I/O buffers after they have been - parsed - -### 0.3.3 / 2014-04-24 - -- Correct the draft-76 status line reason phrase - -### 0.3.2 / 2013-12-29 - -- Expand `maxLength` to cover sequences of continuation frames and - `draft-{75,76}` -- Decrease default maximum frame buffer size to 64MB -- Stop parsing when the protocol enters a failure mode, to save CPU cycles - -### 0.3.1 / 2013-12-03 - -- Add a `maxLength` option to limit allowed frame size -- Don't pre-allocate a message buffer until the whole frame has arrived -- Fix compatibility with Node v0.11 `HTTPParser` - -### 0.3.0 / 2013-09-09 - -- Support client URLs with Basic Auth credentials - -### 0.2.2 / 2013-07-05 - -- No functional changes, just updates to package.json - -### 0.2.1 / 2013-05-17 - -- Export the isSecureRequest() method since faye-websocket relies on it -- Queue sent messages in the client's initial state - -### 0.2.0 / 2013-05-12 - -- Add API for setting and reading headers -- Add Driver.server() method for getting a driver for TCP servers - -### 0.1.0 / 2013-05-04 - -- First stable release diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/websocket-driver/LICENSE.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/websocket-driver/LICENSE.md deleted file mode 100644 index 9475f063..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/websocket-driver/LICENSE.md +++ /dev/null @@ -1,12 +0,0 @@ -Copyright 2010-2020 James Coglan - -Licensed under the Apache License, Version 2.0 (the "License"); you may not use -this file except in compliance with the License. You may obtain a copy of the -License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software distributed -under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -CONDITIONS OF ANY KIND, either express or implied. See the License for the -specific language governing permissions and limitations under the License. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/websocket-driver/README.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/websocket-driver/README.md deleted file mode 100644 index 95c33c44..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/websocket-driver/README.md +++ /dev/null @@ -1,370 +0,0 @@ -# websocket-driver [![Build Status](https://travis-ci.org/faye/websocket-driver-node.svg)](https://travis-ci.org/faye/websocket-driver-node) - -This module provides a complete implementation of the WebSocket protocols that -can be hooked up to any I/O stream. It aims to simplify things by decoupling the -protocol details from the I/O layer, such that users only need to implement code -to stream data in and out of it without needing to know anything about how the -protocol actually works. Think of it as a complete WebSocket system with -pluggable I/O. - -Due to this design, you get a lot of things for free. In particular, if you hook -this module up to some I/O object, it will do all of this for you: - -- Select the correct server-side driver to talk to the client -- Generate and send both server- and client-side handshakes -- Recognize when the handshake phase completes and the WS protocol begins -- Negotiate subprotocol selection based on `Sec-WebSocket-Protocol` -- Negotiate and use extensions via the - [websocket-extensions](https://github.com/faye/websocket-extensions-node) - module -- Buffer sent messages until the handshake process is finished -- Deal with proxies that defer delivery of the draft-76 handshake body -- Notify you when the socket is open and closed and when messages arrive -- Recombine fragmented messages -- Dispatch text, binary, ping, pong and close frames -- Manage the socket-closing handshake process -- Automatically reply to ping frames with a matching pong -- Apply masking to messages sent by the client - -This library was originally extracted from the [Faye](http://faye.jcoglan.com) -project but now aims to provide simple WebSocket support for any Node-based -project. - - -## Installation - -``` -$ npm install websocket-driver -``` - - -## Usage - -This module provides protocol drivers that have the same interface on the server -and on the client. A WebSocket driver is an object with two duplex streams -attached; one for incoming/outgoing messages and one for managing the wire -protocol over an I/O stream. The full API is described below. - - -### Server-side with HTTP - -A Node webserver emits a special event for 'upgrade' requests, and this is where -you should handle WebSockets. You first check whether the request is a -WebSocket, and if so you can create a driver and attach the request's I/O stream -to it. - -```js -var http = require('http'), - websocket = require('websocket-driver'); - -var server = http.createServer(); - -server.on('upgrade', function(request, socket, body) { - if (!websocket.isWebSocket(request)) return; - - var driver = websocket.http(request); - - driver.io.write(body); - socket.pipe(driver.io).pipe(socket); - - driver.messages.on('data', function(message) { - console.log('Got a message', message); - }); - - driver.start(); -}); -``` - -Note the line `driver.io.write(body)` - you must pass the `body` buffer to the -socket driver in order to make certain versions of the protocol work. - - -### Server-side with TCP - -You can also handle WebSocket connections in a bare TCP server, if you're not -using an HTTP server and don't want to implement HTTP parsing yourself. - -The driver will emit a `connect` event when a request is received, and at this -point you can detect whether it's a WebSocket and handle it as such. Here's an -example using the Node `net` module: - -```js -var net = require('net'), - websocket = require('websocket-driver'); - -var server = net.createServer(function(connection) { - var driver = websocket.server(); - - driver.on('connect', function() { - if (websocket.isWebSocket(driver)) { - driver.start(); - } else { - // handle other HTTP requests - } - }); - - driver.on('close', function() { connection.end() }); - connection.on('error', function() {}); - - connection.pipe(driver.io).pipe(connection); - - driver.messages.pipe(driver.messages); -}); - -server.listen(4180); -``` - -In the `connect` event, the driver gains several properties to describe the -request, similar to a Node request object, such as `method`, `url` and -`headers`. However you should remember it's not a real request object; you -cannot write data to it, it only tells you what request data we parsed from the -input. - -If the request has a body, it will be in the `driver.body` buffer, but only as -much of the body as has been piped into the driver when the `connect` event -fires. - - -### Client-side - -Similarly, to implement a WebSocket client you just need to make a driver by -passing in a URL. After this you use the driver API as described below to -process incoming data and send outgoing data. - - -```js -var net = require('net'), - websocket = require('websocket-driver'); - -var driver = websocket.client('ws://www.example.com/socket'), - tcp = net.connect(80, 'www.example.com'); - -tcp.pipe(driver.io).pipe(tcp); - -tcp.on('connect', function() { - driver.start(); -}); - -driver.messages.on('data', function(message) { - console.log('Got a message', message); -}); -``` - -Client drivers have two additional properties for reading the HTTP data that was -sent back by the server: - -- `driver.statusCode` - the integer value of the HTTP status code -- `driver.headers` - an object containing the response headers - - -### HTTP Proxies - -The client driver supports connections via HTTP proxies using the `CONNECT` -method. Instead of sending the WebSocket handshake immediately, it will send a -`CONNECT` request, wait for a `200` response, and then proceed as normal. - -To use this feature, call `driver.proxy(url)` where `url` is the origin of the -proxy, including a username and password if required. This produces a duplex -stream that you should pipe in and out of your TCP connection to the proxy -server. When the proxy emits `connect`, you can then pipe `driver.io` to your -TCP stream and call `driver.start()`. - -```js -var net = require('net'), - websocket = require('websocket-driver'); - -var driver = websocket.client('ws://www.example.com/socket'), - proxy = driver.proxy('http://username:password@proxy.example.com'), - tcp = net.connect(80, 'proxy.example.com'); - -tcp.pipe(proxy).pipe(tcp, { end: false }); - -tcp.on('connect', function() { - proxy.start(); -}); - -proxy.on('connect', function() { - driver.io.pipe(tcp).pipe(driver.io); - driver.start(); -}); - -driver.messages.on('data', function(message) { - console.log('Got a message', message); -}); -``` - -The proxy's `connect` event is also where you should perform a TLS handshake on -your TCP stream, if you are connecting to a `wss:` endpoint. - -In the event that proxy connection fails, `proxy` will emit an `error`. You can -inspect the proxy's response via `proxy.statusCode` and `proxy.headers`. - -```js -proxy.on('error', function(error) { - console.error(error.message); - console.log(proxy.statusCode); - console.log(proxy.headers); -}); -``` - -Before calling `proxy.start()` you can set custom headers using -`proxy.setHeader()`: - -```js -proxy.setHeader('User-Agent', 'node'); -proxy.start(); -``` - - -### Driver API - -Drivers are created using one of the following methods: - -```js -driver = websocket.http(request, options) -driver = websocket.server(options) -driver = websocket.client(url, options) -``` - -The `http` method returns a driver chosen using the headers from a Node HTTP -request object. The `server` method returns a driver that will parse an HTTP -request and then decide which driver to use for it using the `http` method. The -`client` method always returns a driver for the RFC version of the protocol with -masking enabled on outgoing frames. - -The `options` argument is optional, and is an object. It may contain the -following fields: - -- `maxLength` - the maximum allowed size of incoming message frames, in bytes. - The default value is `2^26 - 1`, or 1 byte short of 64 MiB. -- `protocols` - an array of strings representing acceptable subprotocols for use - over the socket. The driver will negotiate one of these to use via the - `Sec-WebSocket-Protocol` header if supported by the other peer. - -A driver has two duplex streams attached to it: - -- **`driver.io`** - this stream should be attached to an I/O socket like a TCP - stream. Pipe incoming TCP chunks to this stream for them to be parsed, and - pipe this stream back into TCP to send outgoing frames. -- **`driver.messages`** - this stream emits messages received over the - WebSocket. Writing to it sends messages to the other peer by emitting frames - via the `driver.io` stream. - -All drivers respond to the following API methods, but some of them are no-ops -depending on whether the client supports the behaviour. - -Note that most of these methods are commands: if they produce data that should -be sent over the socket, they will give this to you by emitting `data` events on -the `driver.io` stream. - -#### `driver.on('open', function(event) {})` - -Adds a callback to execute when the socket becomes open. - -#### `driver.on('message', function(event) {})` - -Adds a callback to execute when a message is received. `event` will have a -`data` attribute containing either a string in the case of a text message or a -`Buffer` in the case of a binary message. - -You can also listen for messages using the `driver.messages.on('data')` event, -which emits strings for text messages and buffers for binary messages. - -#### `driver.on('error', function(event) {})` - -Adds a callback to execute when a protocol error occurs due to the other peer -sending an invalid byte sequence. `event` will have a `message` attribute -describing the error. - -#### `driver.on('close', function(event) {})` - -Adds a callback to execute when the socket becomes closed. The `event` object -has `code` and `reason` attributes. - -#### `driver.on('ping', function(event) {})` - -Adds a callback block to execute when a ping is received. You do not need to -handle this by sending a pong frame yourself; the driver handles this for you. - -#### `driver.on('pong', function(event) {})` - -Adds a callback block to execute when a pong is received. If this was in -response to a ping you sent, you can also handle this event via the -`driver.ping(message, function() { ... })` callback. - -#### `driver.addExtension(extension)` - -Registers a protocol extension whose operation will be negotiated via the -`Sec-WebSocket-Extensions` header. `extension` is any extension compatible with -the [websocket-extensions](https://github.com/faye/websocket-extensions-node) -framework. - -#### `driver.setHeader(name, value)` - -Sets a custom header to be sent as part of the handshake response, either from -the server or from the client. Must be called before `start()`, since this is -when the headers are serialized and sent. - -#### `driver.start()` - -Initiates the protocol by sending the handshake - either the response for a -server-side driver or the request for a client-side one. This should be the -first method you invoke. Returns `true` if and only if a handshake was sent. - -#### `driver.parse(string)` - -Takes a string and parses it, potentially resulting in message events being -emitted (see `on('message')` above) or in data being sent to `driver.io`. You -should send all data you receive via I/O to this method by piping a stream into -`driver.io`. - -#### `driver.text(string)` - -Sends a text message over the socket. If the socket handshake is not yet -complete, the message will be queued until it is. Returns `true` if the message -was sent or queued, and `false` if the socket can no longer send messages. - -This method is equivalent to `driver.messages.write(string)`. - -#### `driver.binary(buffer)` - -Takes a `Buffer` and sends it as a binary message. Will queue and return `true` -or `false` the same way as the `text` method. It will also return `false` if the -driver does not support binary messages. - -This method is equivalent to `driver.messages.write(buffer)`. - -#### `driver.ping(string = '', function() {})` - -Sends a ping frame over the socket, queueing it if necessary. `string` and the -callback are both optional. If a callback is given, it will be invoked when the -socket receives a pong frame whose content matches `string`. Returns `false` if -frames can no longer be sent, or if the driver does not support ping/pong. - -#### `driver.pong(string = '')` - -Sends a pong frame over the socket, queueing it if necessary. `string` is -optional. Returns `false` if frames can no longer be sent, or if the driver does -not support ping/pong. - -You don't need to call this when a ping frame is received; pings are replied to -automatically by the driver. This method is for sending unsolicited pongs. - -#### `driver.close()` - -Initiates the closing handshake if the socket is still open. For drivers with no -closing handshake, this will result in the immediate execution of the -`on('close')` driver. For drivers with a closing handshake, this sends a closing -frame and `emit('close')` will execute when a response is received or a protocol -error occurs. - -#### `driver.version` - -Returns the WebSocket version in use as a string. Will either be `hixie-75`, -`hixie-76` or `hybi-$version`. - -#### `driver.protocol` - -Returns a string containing the selected subprotocol, if any was agreed upon -using the `Sec-WebSocket-Protocol` mechanism. This value becomes available after -`emit('open')` has fired. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/websocket-driver/lib/websocket/driver.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/websocket-driver/lib/websocket/driver.js deleted file mode 100644 index 3d701cc5..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/websocket-driver/lib/websocket/driver.js +++ /dev/null @@ -1,43 +0,0 @@ -'use strict'; - -// Protocol references: -// -// * http://tools.ietf.org/html/draft-hixie-thewebsocketprotocol-75 -// * http://tools.ietf.org/html/draft-hixie-thewebsocketprotocol-76 -// * http://tools.ietf.org/html/draft-ietf-hybi-thewebsocketprotocol-17 - -var Base = require('./driver/base'), - Client = require('./driver/client'), - Server = require('./driver/server'); - -var Driver = { - client: function(url, options) { - options = options || {}; - if (options.masking === undefined) options.masking = true; - return new Client(url, options); - }, - - server: function(options) { - options = options || {}; - if (options.requireMasking === undefined) options.requireMasking = true; - return new Server(options); - }, - - http: function() { - return Server.http.apply(Server, arguments); - }, - - isSecureRequest: function(request) { - return Server.isSecureRequest(request); - }, - - isWebSocket: function(request) { - return Base.isWebSocket(request); - }, - - validateOptions: function(options, validKeys) { - Base.validateOptions(options, validKeys); - } -}; - -module.exports = Driver; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/websocket-driver/lib/websocket/driver/base.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/websocket-driver/lib/websocket/driver/base.js deleted file mode 100644 index f05af5f2..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/websocket-driver/lib/websocket/driver/base.js +++ /dev/null @@ -1,193 +0,0 @@ -'use strict'; - -var Buffer = require('safe-buffer').Buffer, - Emitter = require('events').EventEmitter, - util = require('util'), - streams = require('../streams'), - Headers = require('./headers'), - Reader = require('./stream_reader'); - -var Base = function(request, url, options) { - Emitter.call(this); - Base.validateOptions(options || {}, ['maxLength', 'masking', 'requireMasking', 'protocols']); - - this._request = request; - this._reader = new Reader(); - this._options = options || {}; - this._maxLength = this._options.maxLength || this.MAX_LENGTH; - this._headers = new Headers(); - this.__queue = []; - this.readyState = 0; - this.url = url; - - this.io = new streams.IO(this); - this.messages = new streams.Messages(this); - this._bindEventListeners(); -}; -util.inherits(Base, Emitter); - -Base.isWebSocket = function(request) { - var connection = request.headers.connection || '', - upgrade = request.headers.upgrade || ''; - - return request.method === 'GET' && - connection.toLowerCase().split(/ *, */).indexOf('upgrade') >= 0 && - upgrade.toLowerCase() === 'websocket'; -}; - -Base.validateOptions = function(options, validKeys) { - for (var key in options) { - if (validKeys.indexOf(key) < 0) - throw new Error('Unrecognized option: ' + key); - } -}; - -var instance = { - // This is 64MB, small enough for an average VPS to handle without - // crashing from process out of memory - MAX_LENGTH: 0x3ffffff, - - STATES: ['connecting', 'open', 'closing', 'closed'], - - _bindEventListeners: function() { - var self = this; - - // Protocol errors are informational and do not have to be handled - this.messages.on('error', function() {}); - - this.on('message', function(event) { - var messages = self.messages; - if (messages.readable) messages.emit('data', event.data); - }); - - this.on('error', function(error) { - var messages = self.messages; - if (messages.readable) messages.emit('error', error); - }); - - this.on('close', function() { - var messages = self.messages; - if (!messages.readable) return; - messages.readable = messages.writable = false; - messages.emit('end'); - }); - }, - - getState: function() { - return this.STATES[this.readyState] || null; - }, - - addExtension: function(extension) { - return false; - }, - - setHeader: function(name, value) { - if (this.readyState > 0) return false; - this._headers.set(name, value); - return true; - }, - - start: function() { - if (this.readyState !== 0) return false; - - if (!Base.isWebSocket(this._request)) - return this._failHandshake(new Error('Not a WebSocket request')); - - var response; - - try { - response = this._handshakeResponse(); - } catch (error) { - return this._failHandshake(error); - } - - this._write(response); - if (this._stage !== -1) this._open(); - return true; - }, - - _failHandshake: function(error) { - var headers = new Headers(); - headers.set('Content-Type', 'text/plain'); - headers.set('Content-Length', Buffer.byteLength(error.message, 'utf8')); - - headers = ['HTTP/1.1 400 Bad Request', headers.toString(), error.message]; - this._write(Buffer.from(headers.join('\r\n'), 'utf8')); - this._fail('protocol_error', error.message); - - return false; - }, - - text: function(message) { - return this.frame(message); - }, - - binary: function(message) { - return false; - }, - - ping: function() { - return false; - }, - - pong: function() { - return false; - }, - - close: function(reason, code) { - if (this.readyState !== 1) return false; - this.readyState = 3; - this.emit('close', new Base.CloseEvent(null, null)); - return true; - }, - - _open: function() { - this.readyState = 1; - this.__queue.forEach(function(args) { this.frame.apply(this, args) }, this); - this.__queue = []; - this.emit('open', new Base.OpenEvent()); - }, - - _queue: function(message) { - this.__queue.push(message); - return true; - }, - - _write: function(chunk) { - var io = this.io; - if (io.readable) io.emit('data', chunk); - }, - - _fail: function(type, message) { - this.readyState = 2; - this.emit('error', new Error(message)); - this.close(); - } -}; - -for (var key in instance) - Base.prototype[key] = instance[key]; - - -Base.ConnectEvent = function() {}; - -Base.OpenEvent = function() {}; - -Base.CloseEvent = function(code, reason) { - this.code = code; - this.reason = reason; -}; - -Base.MessageEvent = function(data) { - this.data = data; -}; - -Base.PingEvent = function(data) { - this.data = data; -}; - -Base.PongEvent = function(data) { - this.data = data; -}; - -module.exports = Base; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/websocket-driver/lib/websocket/driver/client.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/websocket-driver/lib/websocket/driver/client.js deleted file mode 100644 index f24d6458..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/websocket-driver/lib/websocket/driver/client.js +++ /dev/null @@ -1,142 +0,0 @@ -'use strict'; - -var Buffer = require('safe-buffer').Buffer, - crypto = require('crypto'), - url = require('url'), - util = require('util'), - HttpParser = require('../http_parser'), - Base = require('./base'), - Hybi = require('./hybi'), - Proxy = require('./proxy'); - -var Client = function(_url, options) { - this.version = 'hybi-' + Hybi.VERSION; - Hybi.call(this, null, _url, options); - - this.readyState = -1; - this._key = Client.generateKey(); - this._accept = Hybi.generateAccept(this._key); - this._http = new HttpParser('response'); - - var uri = url.parse(this.url), - auth = uri.auth && Buffer.from(uri.auth, 'utf8').toString('base64'); - - if (this.VALID_PROTOCOLS.indexOf(uri.protocol) < 0) - throw new Error(this.url + ' is not a valid WebSocket URL'); - - this._pathname = (uri.pathname || '/') + (uri.search || ''); - - this._headers.set('Host', uri.host); - this._headers.set('Upgrade', 'websocket'); - this._headers.set('Connection', 'Upgrade'); - this._headers.set('Sec-WebSocket-Key', this._key); - this._headers.set('Sec-WebSocket-Version', Hybi.VERSION); - - if (this._protocols.length > 0) - this._headers.set('Sec-WebSocket-Protocol', this._protocols.join(', ')); - - if (auth) - this._headers.set('Authorization', 'Basic ' + auth); -}; -util.inherits(Client, Hybi); - -Client.generateKey = function() { - return crypto.randomBytes(16).toString('base64'); -}; - -var instance = { - VALID_PROTOCOLS: ['ws:', 'wss:'], - - proxy: function(origin, options) { - return new Proxy(this, origin, options); - }, - - start: function() { - if (this.readyState !== -1) return false; - this._write(this._handshakeRequest()); - this.readyState = 0; - return true; - }, - - parse: function(chunk) { - if (this.readyState === 3) return; - if (this.readyState > 0) return Hybi.prototype.parse.call(this, chunk); - - this._http.parse(chunk); - if (!this._http.isComplete()) return; - - this._validateHandshake(); - if (this.readyState === 3) return; - - this._open(); - this.parse(this._http.body); - }, - - _handshakeRequest: function() { - var extensions = this._extensions.generateOffer(); - if (extensions) - this._headers.set('Sec-WebSocket-Extensions', extensions); - - var start = 'GET ' + this._pathname + ' HTTP/1.1', - headers = [start, this._headers.toString(), '']; - - return Buffer.from(headers.join('\r\n'), 'utf8'); - }, - - _failHandshake: function(message) { - message = 'Error during WebSocket handshake: ' + message; - this.readyState = 3; - this.emit('error', new Error(message)); - this.emit('close', new Base.CloseEvent(this.ERRORS.protocol_error, message)); - }, - - _validateHandshake: function() { - this.statusCode = this._http.statusCode; - this.headers = this._http.headers; - - if (this._http.error) - return this._failHandshake(this._http.error.message); - - if (this._http.statusCode !== 101) - return this._failHandshake('Unexpected response code: ' + this._http.statusCode); - - var headers = this._http.headers, - upgrade = headers['upgrade'] || '', - connection = headers['connection'] || '', - accept = headers['sec-websocket-accept'] || '', - protocol = headers['sec-websocket-protocol'] || ''; - - if (upgrade === '') - return this._failHandshake("'Upgrade' header is missing"); - if (upgrade.toLowerCase() !== 'websocket') - return this._failHandshake("'Upgrade' header value is not 'WebSocket'"); - - if (connection === '') - return this._failHandshake("'Connection' header is missing"); - if (connection.toLowerCase() !== 'upgrade') - return this._failHandshake("'Connection' header value is not 'Upgrade'"); - - if (accept !== this._accept) - return this._failHandshake('Sec-WebSocket-Accept mismatch'); - - this.protocol = null; - - if (protocol !== '') { - if (this._protocols.indexOf(protocol) < 0) - return this._failHandshake('Sec-WebSocket-Protocol mismatch'); - else - this.protocol = protocol; - } - - try { - this._extensions.activate(this.headers['sec-websocket-extensions']); - } catch (e) { - return this._failHandshake(e.message); - } - } -}; - -for (var key in instance) - Client.prototype[key] = instance[key]; - -module.exports = Client; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/websocket-driver/lib/websocket/driver/draft75.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/websocket-driver/lib/websocket/driver/draft75.js deleted file mode 100644 index 583f985f..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/websocket-driver/lib/websocket/driver/draft75.js +++ /dev/null @@ -1,123 +0,0 @@ -'use strict'; - -var Buffer = require('safe-buffer').Buffer, - Base = require('./base'), - util = require('util'); - -var Draft75 = function(request, url, options) { - Base.apply(this, arguments); - this._stage = 0; - this.version = 'hixie-75'; - - this._headers.set('Upgrade', 'WebSocket'); - this._headers.set('Connection', 'Upgrade'); - this._headers.set('WebSocket-Origin', this._request.headers.origin); - this._headers.set('WebSocket-Location', this.url); -}; -util.inherits(Draft75, Base); - -var instance = { - close: function() { - if (this.readyState === 3) return false; - this.readyState = 3; - this.emit('close', new Base.CloseEvent(null, null)); - return true; - }, - - parse: function(chunk) { - if (this.readyState > 1) return; - - this._reader.put(chunk); - - this._reader.eachByte(function(octet) { - var message; - - switch (this._stage) { - case -1: - this._body.push(octet); - this._sendHandshakeBody(); - break; - - case 0: - this._parseLeadingByte(octet); - break; - - case 1: - this._length = (octet & 0x7F) + 128 * this._length; - - if (this._closing && this._length === 0) { - return this.close(); - } - else if ((octet & 0x80) !== 0x80) { - if (this._length === 0) { - this._stage = 0; - } - else { - this._skipped = 0; - this._stage = 2; - } - } - break; - - case 2: - if (octet === 0xFF) { - this._stage = 0; - message = Buffer.from(this._buffer).toString('utf8', 0, this._buffer.length); - this.emit('message', new Base.MessageEvent(message)); - } - else { - if (this._length) { - this._skipped += 1; - if (this._skipped === this._length) - this._stage = 0; - } else { - this._buffer.push(octet); - if (this._buffer.length > this._maxLength) return this.close(); - } - } - break; - } - }, this); - }, - - frame: function(buffer) { - if (this.readyState === 0) return this._queue([buffer]); - if (this.readyState > 1) return false; - - if (typeof buffer !== 'string') buffer = buffer.toString(); - - var length = Buffer.byteLength(buffer), - frame = Buffer.allocUnsafe(length + 2); - - frame[0] = 0x00; - frame.write(buffer, 1); - frame[frame.length - 1] = 0xFF; - - this._write(frame); - return true; - }, - - _handshakeResponse: function() { - var start = 'HTTP/1.1 101 Web Socket Protocol Handshake', - headers = [start, this._headers.toString(), '']; - - return Buffer.from(headers.join('\r\n'), 'utf8'); - }, - - _parseLeadingByte: function(octet) { - if ((octet & 0x80) === 0x80) { - this._length = 0; - this._stage = 1; - } else { - delete this._length; - delete this._skipped; - this._buffer = []; - this._stage = 2; - } - } -}; - -for (var key in instance) - Draft75.prototype[key] = instance[key]; - -module.exports = Draft75; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/websocket-driver/lib/websocket/driver/draft76.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/websocket-driver/lib/websocket/driver/draft76.js deleted file mode 100644 index bdaab31b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/websocket-driver/lib/websocket/driver/draft76.js +++ /dev/null @@ -1,117 +0,0 @@ -'use strict'; - -var Buffer = require('safe-buffer').Buffer, - Base = require('./base'), - Draft75 = require('./draft75'), - crypto = require('crypto'), - util = require('util'); - - -var numberFromKey = function(key) { - return parseInt((key.match(/[0-9]/g) || []).join(''), 10); -}; - -var spacesInKey = function(key) { - return (key.match(/ /g) || []).length; -}; - - -var Draft76 = function(request, url, options) { - Draft75.apply(this, arguments); - this._stage = -1; - this._body = []; - this.version = 'hixie-76'; - - this._headers.clear(); - - this._headers.set('Upgrade', 'WebSocket'); - this._headers.set('Connection', 'Upgrade'); - this._headers.set('Sec-WebSocket-Origin', this._request.headers.origin); - this._headers.set('Sec-WebSocket-Location', this.url); -}; -util.inherits(Draft76, Draft75); - -var instance = { - BODY_SIZE: 8, - - start: function() { - if (!Draft75.prototype.start.call(this)) return false; - this._started = true; - this._sendHandshakeBody(); - return true; - }, - - close: function() { - if (this.readyState === 3) return false; - if (this.readyState === 1) this._write(Buffer.from([0xFF, 0x00])); - this.readyState = 3; - this.emit('close', new Base.CloseEvent(null, null)); - return true; - }, - - _handshakeResponse: function() { - var headers = this._request.headers, - key1 = headers['sec-websocket-key1'], - key2 = headers['sec-websocket-key2']; - - if (!key1) throw new Error('Missing required header: Sec-WebSocket-Key1'); - if (!key2) throw new Error('Missing required header: Sec-WebSocket-Key2'); - - var number1 = numberFromKey(key1), - spaces1 = spacesInKey(key1), - - number2 = numberFromKey(key2), - spaces2 = spacesInKey(key2); - - if (number1 % spaces1 !== 0 || number2 % spaces2 !== 0) - throw new Error('Client sent invalid Sec-WebSocket-Key headers'); - - this._keyValues = [number1 / spaces1, number2 / spaces2]; - - var start = 'HTTP/1.1 101 WebSocket Protocol Handshake', - headers = [start, this._headers.toString(), '']; - - return Buffer.from(headers.join('\r\n'), 'binary'); - }, - - _handshakeSignature: function() { - if (this._body.length < this.BODY_SIZE) return null; - - var md5 = crypto.createHash('md5'), - buffer = Buffer.allocUnsafe(8 + this.BODY_SIZE); - - buffer.writeUInt32BE(this._keyValues[0], 0); - buffer.writeUInt32BE(this._keyValues[1], 4); - Buffer.from(this._body).copy(buffer, 8, 0, this.BODY_SIZE); - - md5.update(buffer); - return Buffer.from(md5.digest('binary'), 'binary'); - }, - - _sendHandshakeBody: function() { - if (!this._started) return; - var signature = this._handshakeSignature(); - if (!signature) return; - - this._write(signature); - this._stage = 0; - this._open(); - - if (this._body.length > this.BODY_SIZE) - this.parse(this._body.slice(this.BODY_SIZE)); - }, - - _parseLeadingByte: function(octet) { - if (octet !== 0xFF) - return Draft75.prototype._parseLeadingByte.call(this, octet); - - this._closing = true; - this._length = 0; - this._stage = 1; - } -}; - -for (var key in instance) - Draft76.prototype[key] = instance[key]; - -module.exports = Draft76; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/websocket-driver/lib/websocket/driver/headers.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/websocket-driver/lib/websocket/driver/headers.js deleted file mode 100644 index bc96b7dc..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/websocket-driver/lib/websocket/driver/headers.js +++ /dev/null @@ -1,35 +0,0 @@ -'use strict'; - -var Headers = function() { - this.clear(); -}; - -Headers.prototype.ALLOWED_DUPLICATES = ['set-cookie', 'set-cookie2', 'warning', 'www-authenticate']; - -Headers.prototype.clear = function() { - this._sent = {}; - this._lines = []; -}; - -Headers.prototype.set = function(name, value) { - if (value === undefined) return; - - name = this._strip(name); - value = this._strip(value); - - var key = name.toLowerCase(); - if (!this._sent.hasOwnProperty(key) || this.ALLOWED_DUPLICATES.indexOf(key) >= 0) { - this._sent[key] = true; - this._lines.push(name + ': ' + value + '\r\n'); - } -}; - -Headers.prototype.toString = function() { - return this._lines.join(''); -}; - -Headers.prototype._strip = function(string) { - return string.toString().replace(/^ */, '').replace(/ *$/, ''); -}; - -module.exports = Headers; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/websocket-driver/lib/websocket/driver/hybi.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/websocket-driver/lib/websocket/driver/hybi.js deleted file mode 100644 index 9027f904..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/websocket-driver/lib/websocket/driver/hybi.js +++ /dev/null @@ -1,483 +0,0 @@ -'use strict'; - -var Buffer = require('safe-buffer').Buffer, - crypto = require('crypto'), - util = require('util'), - Extensions = require('websocket-extensions'), - Base = require('./base'), - Frame = require('./hybi/frame'), - Message = require('./hybi/message'); - -var Hybi = function(request, url, options) { - Base.apply(this, arguments); - - this._extensions = new Extensions(); - this._stage = 0; - this._masking = this._options.masking; - this._protocols = this._options.protocols || []; - this._requireMasking = this._options.requireMasking; - this._pingCallbacks = {}; - - if (typeof this._protocols === 'string') - this._protocols = this._protocols.split(/ *, */); - - if (!this._request) return; - - var protos = this._request.headers['sec-websocket-protocol'], - supported = this._protocols; - - if (protos !== undefined) { - if (typeof protos === 'string') protos = protos.split(/ *, */); - this.protocol = protos.filter(function(p) { return supported.indexOf(p) >= 0 })[0]; - } - - this.version = 'hybi-' + Hybi.VERSION; -}; -util.inherits(Hybi, Base); - -Hybi.VERSION = '13'; - -Hybi.mask = function(payload, mask, offset) { - if (!mask || mask.length === 0) return payload; - offset = offset || 0; - - for (var i = 0, n = payload.length - offset; i < n; i++) { - payload[offset + i] = payload[offset + i] ^ mask[i % 4]; - } - return payload; -}; - -Hybi.generateAccept = function(key) { - var sha1 = crypto.createHash('sha1'); - sha1.update(key + Hybi.GUID); - return sha1.digest('base64'); -}; - -Hybi.GUID = '258EAFA5-E914-47DA-95CA-C5AB0DC85B11'; - -var instance = { - FIN: 0x80, - MASK: 0x80, - RSV1: 0x40, - RSV2: 0x20, - RSV3: 0x10, - OPCODE: 0x0F, - LENGTH: 0x7F, - - OPCODES: { - continuation: 0, - text: 1, - binary: 2, - close: 8, - ping: 9, - pong: 10 - }, - - OPCODE_CODES: [0, 1, 2, 8, 9, 10], - MESSAGE_OPCODES: [0, 1, 2], - OPENING_OPCODES: [1, 2], - - ERRORS: { - normal_closure: 1000, - going_away: 1001, - protocol_error: 1002, - unacceptable: 1003, - encoding_error: 1007, - policy_violation: 1008, - too_large: 1009, - extension_error: 1010, - unexpected_condition: 1011 - }, - - ERROR_CODES: [1000, 1001, 1002, 1003, 1007, 1008, 1009, 1010, 1011], - DEFAULT_ERROR_CODE: 1000, - MIN_RESERVED_ERROR: 3000, - MAX_RESERVED_ERROR: 4999, - - // http://www.w3.org/International/questions/qa-forms-utf-8.en.php - UTF8_MATCH: /^([\x00-\x7F]|[\xC2-\xDF][\x80-\xBF]|\xE0[\xA0-\xBF][\x80-\xBF]|[\xE1-\xEC\xEE\xEF][\x80-\xBF]{2}|\xED[\x80-\x9F][\x80-\xBF]|\xF0[\x90-\xBF][\x80-\xBF]{2}|[\xF1-\xF3][\x80-\xBF]{3}|\xF4[\x80-\x8F][\x80-\xBF]{2})*$/, - - addExtension: function(extension) { - this._extensions.add(extension); - return true; - }, - - parse: function(chunk) { - this._reader.put(chunk); - var buffer = true; - while (buffer) { - switch (this._stage) { - case 0: - buffer = this._reader.read(1); - if (buffer) this._parseOpcode(buffer[0]); - break; - - case 1: - buffer = this._reader.read(1); - if (buffer) this._parseLength(buffer[0]); - break; - - case 2: - buffer = this._reader.read(this._frame.lengthBytes); - if (buffer) this._parseExtendedLength(buffer); - break; - - case 3: - buffer = this._reader.read(4); - if (buffer) { - this._stage = 4; - this._frame.maskingKey = buffer; - } - break; - - case 4: - buffer = this._reader.read(this._frame.length); - if (buffer) { - this._stage = 0; - this._emitFrame(buffer); - } - break; - - default: - buffer = null; - } - } - }, - - text: function(message) { - if (this.readyState > 1) return false; - return this.frame(message, 'text'); - }, - - binary: function(message) { - if (this.readyState > 1) return false; - return this.frame(message, 'binary'); - }, - - ping: function(message, callback) { - if (this.readyState > 1) return false; - message = message || ''; - if (callback) this._pingCallbacks[message] = callback; - return this.frame(message, 'ping'); - }, - - pong: function(message) { - if (this.readyState > 1) return false; - message = message ||''; - return this.frame(message, 'pong'); - }, - - close: function(reason, code) { - reason = reason || ''; - code = code || this.ERRORS.normal_closure; - - if (this.readyState <= 0) { - this.readyState = 3; - this.emit('close', new Base.CloseEvent(code, reason)); - return true; - } else if (this.readyState === 1) { - this.readyState = 2; - this._extensions.close(function() { this.frame(reason, 'close', code) }, this); - return true; - } else { - return false; - } - }, - - frame: function(buffer, type, code) { - if (this.readyState <= 0) return this._queue([buffer, type, code]); - if (this.readyState > 2) return false; - - if (buffer instanceof Array) buffer = Buffer.from(buffer); - if (typeof buffer === 'number') buffer = buffer.toString(); - - var message = new Message(), - isText = (typeof buffer === 'string'), - payload, copy; - - message.rsv1 = message.rsv2 = message.rsv3 = false; - message.opcode = this.OPCODES[type || (isText ? 'text' : 'binary')]; - - payload = isText ? Buffer.from(buffer, 'utf8') : buffer; - - if (code) { - copy = payload; - payload = Buffer.allocUnsafe(2 + copy.length); - payload.writeUInt16BE(code, 0); - copy.copy(payload, 2); - } - message.data = payload; - - var onMessageReady = function(message) { - var frame = new Frame(); - - frame.final = true; - frame.rsv1 = message.rsv1; - frame.rsv2 = message.rsv2; - frame.rsv3 = message.rsv3; - frame.opcode = message.opcode; - frame.masked = !!this._masking; - frame.length = message.data.length; - frame.payload = message.data; - - if (frame.masked) frame.maskingKey = crypto.randomBytes(4); - - this._sendFrame(frame); - }; - - if (this.MESSAGE_OPCODES.indexOf(message.opcode) >= 0) - this._extensions.processOutgoingMessage(message, function(error, message) { - if (error) return this._fail('extension_error', error.message); - onMessageReady.call(this, message); - }, this); - else - onMessageReady.call(this, message); - - return true; - }, - - _sendFrame: function(frame) { - var length = frame.length, - header = (length <= 125) ? 2 : (length <= 65535 ? 4 : 10), - offset = header + (frame.masked ? 4 : 0), - buffer = Buffer.allocUnsafe(offset + length), - masked = frame.masked ? this.MASK : 0; - - buffer[0] = (frame.final ? this.FIN : 0) | - (frame.rsv1 ? this.RSV1 : 0) | - (frame.rsv2 ? this.RSV2 : 0) | - (frame.rsv3 ? this.RSV3 : 0) | - frame.opcode; - - if (length <= 125) { - buffer[1] = masked | length; - } else if (length <= 65535) { - buffer[1] = masked | 126; - buffer.writeUInt16BE(length, 2); - } else { - buffer[1] = masked | 127; - buffer.writeUInt32BE(Math.floor(length / 0x100000000), 2); - buffer.writeUInt32BE(length % 0x100000000, 6); - } - - frame.payload.copy(buffer, offset); - - if (frame.masked) { - frame.maskingKey.copy(buffer, header); - Hybi.mask(buffer, frame.maskingKey, offset); - } - - this._write(buffer); - }, - - _handshakeResponse: function() { - var secKey = this._request.headers['sec-websocket-key'], - version = this._request.headers['sec-websocket-version']; - - if (version !== Hybi.VERSION) - throw new Error('Unsupported WebSocket version: ' + version); - - if (typeof secKey !== 'string') - throw new Error('Missing handshake request header: Sec-WebSocket-Key'); - - this._headers.set('Upgrade', 'websocket'); - this._headers.set('Connection', 'Upgrade'); - this._headers.set('Sec-WebSocket-Accept', Hybi.generateAccept(secKey)); - - if (this.protocol) this._headers.set('Sec-WebSocket-Protocol', this.protocol); - - var extensions = this._extensions.generateResponse(this._request.headers['sec-websocket-extensions']); - if (extensions) this._headers.set('Sec-WebSocket-Extensions', extensions); - - var start = 'HTTP/1.1 101 Switching Protocols', - headers = [start, this._headers.toString(), '']; - - return Buffer.from(headers.join('\r\n'), 'utf8'); - }, - - _shutdown: function(code, reason, error) { - delete this._frame; - delete this._message; - this._stage = 5; - - var sendCloseFrame = (this.readyState === 1); - this.readyState = 2; - - this._extensions.close(function() { - if (sendCloseFrame) this.frame(reason, 'close', code); - this.readyState = 3; - if (error) this.emit('error', new Error(reason)); - this.emit('close', new Base.CloseEvent(code, reason)); - }, this); - }, - - _fail: function(type, message) { - if (this.readyState > 1) return; - this._shutdown(this.ERRORS[type], message, true); - }, - - _parseOpcode: function(octet) { - var rsvs = [this.RSV1, this.RSV2, this.RSV3].map(function(rsv) { - return (octet & rsv) === rsv; - }); - - var frame = this._frame = new Frame(); - - frame.final = (octet & this.FIN) === this.FIN; - frame.rsv1 = rsvs[0]; - frame.rsv2 = rsvs[1]; - frame.rsv3 = rsvs[2]; - frame.opcode = (octet & this.OPCODE); - - this._stage = 1; - - if (!this._extensions.validFrameRsv(frame)) - return this._fail('protocol_error', - 'One or more reserved bits are on: reserved1 = ' + (frame.rsv1 ? 1 : 0) + - ', reserved2 = ' + (frame.rsv2 ? 1 : 0) + - ', reserved3 = ' + (frame.rsv3 ? 1 : 0)); - - if (this.OPCODE_CODES.indexOf(frame.opcode) < 0) - return this._fail('protocol_error', 'Unrecognized frame opcode: ' + frame.opcode); - - if (this.MESSAGE_OPCODES.indexOf(frame.opcode) < 0 && !frame.final) - return this._fail('protocol_error', 'Received fragmented control frame: opcode = ' + frame.opcode); - - if (this._message && this.OPENING_OPCODES.indexOf(frame.opcode) >= 0) - return this._fail('protocol_error', 'Received new data frame but previous continuous frame is unfinished'); - }, - - _parseLength: function(octet) { - var frame = this._frame; - frame.masked = (octet & this.MASK) === this.MASK; - frame.length = (octet & this.LENGTH); - - if (frame.length >= 0 && frame.length <= 125) { - this._stage = frame.masked ? 3 : 4; - if (!this._checkFrameLength()) return; - } else { - this._stage = 2; - frame.lengthBytes = (frame.length === 126 ? 2 : 8); - } - - if (this._requireMasking && !frame.masked) - return this._fail('unacceptable', 'Received unmasked frame but masking is required'); - }, - - _parseExtendedLength: function(buffer) { - var frame = this._frame; - frame.length = this._readUInt(buffer); - - this._stage = frame.masked ? 3 : 4; - - if (this.MESSAGE_OPCODES.indexOf(frame.opcode) < 0 && frame.length > 125) - return this._fail('protocol_error', 'Received control frame having too long payload: ' + frame.length); - - if (!this._checkFrameLength()) return; - }, - - _checkFrameLength: function() { - var length = this._message ? this._message.length : 0; - - if (length + this._frame.length > this._maxLength) { - this._fail('too_large', 'WebSocket frame length too large'); - return false; - } else { - return true; - } - }, - - _emitFrame: function(buffer) { - var frame = this._frame, - payload = frame.payload = Hybi.mask(buffer, frame.maskingKey), - opcode = frame.opcode, - message, - code, reason, - callbacks, callback; - - delete this._frame; - - if (opcode === this.OPCODES.continuation) { - if (!this._message) return this._fail('protocol_error', 'Received unexpected continuation frame'); - this._message.pushFrame(frame); - } - - if (opcode === this.OPCODES.text || opcode === this.OPCODES.binary) { - this._message = new Message(); - this._message.pushFrame(frame); - } - - if (frame.final && this.MESSAGE_OPCODES.indexOf(opcode) >= 0) - return this._emitMessage(this._message); - - if (opcode === this.OPCODES.close) { - code = (payload.length >= 2) ? payload.readUInt16BE(0) : null; - reason = (payload.length > 2) ? this._encode(payload.slice(2)) : null; - - if (!(payload.length === 0) && - !(code !== null && code >= this.MIN_RESERVED_ERROR && code <= this.MAX_RESERVED_ERROR) && - this.ERROR_CODES.indexOf(code) < 0) - code = this.ERRORS.protocol_error; - - if (payload.length > 125 || (payload.length > 2 && !reason)) - code = this.ERRORS.protocol_error; - - this._shutdown(code || this.DEFAULT_ERROR_CODE, reason || ''); - } - - if (opcode === this.OPCODES.ping) { - this.frame(payload, 'pong'); - this.emit('ping', new Base.PingEvent(payload.toString())) - } - - if (opcode === this.OPCODES.pong) { - callbacks = this._pingCallbacks; - message = this._encode(payload); - callback = callbacks[message]; - - delete callbacks[message]; - if (callback) callback() - - this.emit('pong', new Base.PongEvent(payload.toString())) - } - }, - - _emitMessage: function(message) { - var message = this._message; - message.read(); - - delete this._message; - - this._extensions.processIncomingMessage(message, function(error, message) { - if (error) return this._fail('extension_error', error.message); - - var payload = message.data; - if (message.opcode === this.OPCODES.text) payload = this._encode(payload); - - if (payload === null) - return this._fail('encoding_error', 'Could not decode a text frame as UTF-8'); - else - this.emit('message', new Base.MessageEvent(payload)); - }, this); - }, - - _encode: function(buffer) { - try { - var string = buffer.toString('binary', 0, buffer.length); - if (!this.UTF8_MATCH.test(string)) return null; - } catch (e) {} - return buffer.toString('utf8', 0, buffer.length); - }, - - _readUInt: function(buffer) { - if (buffer.length === 2) return buffer.readUInt16BE(0); - - return buffer.readUInt32BE(0) * 0x100000000 + - buffer.readUInt32BE(4); - } -}; - -for (var key in instance) - Hybi.prototype[key] = instance[key]; - -module.exports = Hybi; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/websocket-driver/lib/websocket/driver/hybi/frame.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/websocket-driver/lib/websocket/driver/hybi/frame.js deleted file mode 100644 index 0fb003f8..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/websocket-driver/lib/websocket/driver/hybi/frame.js +++ /dev/null @@ -1,21 +0,0 @@ -'use strict'; - -var Frame = function() {}; - -var instance = { - final: false, - rsv1: false, - rsv2: false, - rsv3: false, - opcode: null, - masked: false, - maskingKey: null, - lengthBytes: 1, - length: 0, - payload: null -}; - -for (var key in instance) - Frame.prototype[key] = instance[key]; - -module.exports = Frame; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/websocket-driver/lib/websocket/driver/hybi/message.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/websocket-driver/lib/websocket/driver/hybi/message.js deleted file mode 100644 index e881273f..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/websocket-driver/lib/websocket/driver/hybi/message.js +++ /dev/null @@ -1,34 +0,0 @@ -'use strict'; - -var Buffer = require('safe-buffer').Buffer; - -var Message = function() { - this.rsv1 = false; - this.rsv2 = false; - this.rsv3 = false; - this.opcode = null; - this.length = 0; - this._chunks = []; -}; - -var instance = { - read: function() { - return this.data = this.data || Buffer.concat(this._chunks, this.length); - }, - - pushFrame: function(frame) { - this.rsv1 = this.rsv1 || frame.rsv1; - this.rsv2 = this.rsv2 || frame.rsv2; - this.rsv3 = this.rsv3 || frame.rsv3; - - if (this.opcode === null) this.opcode = frame.opcode; - - this._chunks.push(frame.payload); - this.length += frame.length; - } -}; - -for (var key in instance) - Message.prototype[key] = instance[key]; - -module.exports = Message; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/websocket-driver/lib/websocket/driver/proxy.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/websocket-driver/lib/websocket/driver/proxy.js deleted file mode 100644 index 2fdd32e3..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/websocket-driver/lib/websocket/driver/proxy.js +++ /dev/null @@ -1,99 +0,0 @@ -'use strict'; - -var Buffer = require('safe-buffer').Buffer, - Stream = require('stream').Stream, - url = require('url'), - util = require('util'), - Base = require('./base'), - Headers = require('./headers'), - HttpParser = require('../http_parser'); - -var PORTS = { 'ws:': 80, 'wss:': 443 }; - -var Proxy = function(client, origin, options) { - this._client = client; - this._http = new HttpParser('response'); - this._origin = (typeof client.url === 'object') ? client.url : url.parse(client.url); - this._url = (typeof origin === 'object') ? origin : url.parse(origin); - this._options = options || {}; - this._state = 0; - - this.readable = this.writable = true; - this._paused = false; - - this._headers = new Headers(); - this._headers.set('Host', this._origin.host); - this._headers.set('Connection', 'keep-alive'); - this._headers.set('Proxy-Connection', 'keep-alive'); - - var auth = this._url.auth && Buffer.from(this._url.auth, 'utf8').toString('base64'); - if (auth) this._headers.set('Proxy-Authorization', 'Basic ' + auth); -}; -util.inherits(Proxy, Stream); - -var instance = { - setHeader: function(name, value) { - if (this._state !== 0) return false; - this._headers.set(name, value); - return true; - }, - - start: function() { - if (this._state !== 0) return false; - this._state = 1; - - var origin = this._origin, - port = origin.port || PORTS[origin.protocol], - start = 'CONNECT ' + origin.hostname + ':' + port + ' HTTP/1.1'; - - var headers = [start, this._headers.toString(), '']; - - this.emit('data', Buffer.from(headers.join('\r\n'), 'utf8')); - return true; - }, - - pause: function() { - this._paused = true; - }, - - resume: function() { - this._paused = false; - this.emit('drain'); - }, - - write: function(chunk) { - if (!this.writable) return false; - - this._http.parse(chunk); - if (!this._http.isComplete()) return !this._paused; - - this.statusCode = this._http.statusCode; - this.headers = this._http.headers; - - if (this.statusCode === 200) { - this.emit('connect', new Base.ConnectEvent()); - } else { - var message = "Can't establish a connection to the server at " + this._origin.href; - this.emit('error', new Error(message)); - } - this.end(); - return !this._paused; - }, - - end: function(chunk) { - if (!this.writable) return; - if (chunk !== undefined) this.write(chunk); - this.readable = this.writable = false; - this.emit('close'); - this.emit('end'); - }, - - destroy: function() { - this.end(); - } -}; - -for (var key in instance) - Proxy.prototype[key] = instance[key]; - -module.exports = Proxy; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/websocket-driver/lib/websocket/driver/server.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/websocket-driver/lib/websocket/driver/server.js deleted file mode 100644 index dc635b0e..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/websocket-driver/lib/websocket/driver/server.js +++ /dev/null @@ -1,112 +0,0 @@ -'use strict'; - -var util = require('util'), - HttpParser = require('../http_parser'), - Base = require('./base'), - Draft75 = require('./draft75'), - Draft76 = require('./draft76'), - Hybi = require('./hybi'); - -var Server = function(options) { - Base.call(this, null, null, options); - this._http = new HttpParser('request'); -}; -util.inherits(Server, Base); - -var instance = { - EVENTS: ['open', 'message', 'error', 'close', 'ping', 'pong'], - - _bindEventListeners: function() { - this.messages.on('error', function() {}); - this.on('error', function() {}); - }, - - parse: function(chunk) { - if (this._delegate) return this._delegate.parse(chunk); - - this._http.parse(chunk); - if (!this._http.isComplete()) return; - - this.method = this._http.method; - this.url = this._http.url; - this.headers = this._http.headers; - this.body = this._http.body; - - var self = this; - this._delegate = Server.http(this, this._options); - this._delegate.messages = this.messages; - this._delegate.io = this.io; - this._open(); - - this.EVENTS.forEach(function(event) { - this._delegate.on(event, function(e) { self.emit(event, e) }); - }, this); - - this.protocol = this._delegate.protocol; - this.version = this._delegate.version; - - this.parse(this._http.body); - this.emit('connect', new Base.ConnectEvent()); - }, - - _open: function() { - this.__queue.forEach(function(msg) { - this._delegate[msg[0]].apply(this._delegate, msg[1]); - }, this); - this.__queue = []; - } -}; - -['addExtension', 'setHeader', 'start', 'frame', 'text', 'binary', 'ping', 'close'].forEach(function(method) { - instance[method] = function() { - if (this._delegate) { - return this._delegate[method].apply(this._delegate, arguments); - } else { - this.__queue.push([method, arguments]); - return true; - } - }; -}); - -for (var key in instance) - Server.prototype[key] = instance[key]; - -Server.isSecureRequest = function(request) { - if (request.connection && request.connection.authorized !== undefined) return true; - if (request.socket && request.socket.secure) return true; - - var headers = request.headers; - if (!headers) return false; - if (headers['https'] === 'on') return true; - if (headers['x-forwarded-ssl'] === 'on') return true; - if (headers['x-forwarded-scheme'] === 'https') return true; - if (headers['x-forwarded-proto'] === 'https') return true; - - return false; -}; - -Server.determineUrl = function(request) { - var scheme = this.isSecureRequest(request) ? 'wss:' : 'ws:'; - return scheme + '//' + request.headers.host + request.url; -}; - -Server.http = function(request, options) { - options = options || {}; - if (options.requireMasking === undefined) options.requireMasking = true; - - var headers = request.headers, - version = headers['sec-websocket-version'], - key = headers['sec-websocket-key'], - key1 = headers['sec-websocket-key1'], - key2 = headers['sec-websocket-key2'], - url = this.determineUrl(request); - - if (version || key) - return new Hybi(request, url, options); - else if (key1 || key2) - return new Draft76(request, url, options); - else - return new Draft75(request, url, options); -}; - -module.exports = Server; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/websocket-driver/lib/websocket/driver/stream_reader.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/websocket-driver/lib/websocket/driver/stream_reader.js deleted file mode 100644 index 3564da83..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/websocket-driver/lib/websocket/driver/stream_reader.js +++ /dev/null @@ -1,69 +0,0 @@ -'use strict'; - -var Buffer = require('safe-buffer').Buffer; - -var StreamReader = function() { - this._queue = []; - this._queueSize = 0; - this._offset = 0; -}; - -StreamReader.prototype.put = function(buffer) { - if (!buffer || buffer.length === 0) return; - if (!Buffer.isBuffer(buffer)) buffer = Buffer.from(buffer); - this._queue.push(buffer); - this._queueSize += buffer.length; -}; - -StreamReader.prototype.read = function(length) { - if (length > this._queueSize) return null; - if (length === 0) return Buffer.alloc(0); - - this._queueSize -= length; - - var queue = this._queue, - remain = length, - first = queue[0], - buffers, buffer; - - if (first.length >= length) { - if (first.length === length) { - return queue.shift(); - } else { - buffer = first.slice(0, length); - queue[0] = first.slice(length); - return buffer; - } - } - - for (var i = 0, n = queue.length; i < n; i++) { - if (remain < queue[i].length) break; - remain -= queue[i].length; - } - buffers = queue.splice(0, i); - - if (remain > 0 && queue.length > 0) { - buffers.push(queue[0].slice(0, remain)); - queue[0] = queue[0].slice(remain); - } - return Buffer.concat(buffers, length); -}; - -StreamReader.prototype.eachByte = function(callback, context) { - var buffer, n, index; - - while (this._queue.length > 0) { - buffer = this._queue[0]; - n = buffer.length; - - while (this._offset < n) { - index = this._offset; - this._offset += 1; - callback.call(context, buffer[index]); - } - this._offset = 0; - this._queue.shift(); - } -}; - -module.exports = StreamReader; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/websocket-driver/lib/websocket/http_parser.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/websocket-driver/lib/websocket/http_parser.js deleted file mode 100644 index 1396656e..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/websocket-driver/lib/websocket/http_parser.js +++ /dev/null @@ -1,135 +0,0 @@ -'use strict'; - -var NodeHTTPParser = require('http-parser-js').HTTPParser, - Buffer = require('safe-buffer').Buffer; - -var TYPES = { - request: NodeHTTPParser.REQUEST || 'request', - response: NodeHTTPParser.RESPONSE || 'response' -}; - -var HttpParser = function(type) { - this._type = type; - this._parser = new NodeHTTPParser(TYPES[type]); - this._complete = false; - this.headers = {}; - - var current = null, - self = this; - - this._parser.onHeaderField = function(b, start, length) { - current = b.toString('utf8', start, start + length).toLowerCase(); - }; - - this._parser.onHeaderValue = function(b, start, length) { - var value = b.toString('utf8', start, start + length); - - if (self.headers.hasOwnProperty(current)) - self.headers[current] += ', ' + value; - else - self.headers[current] = value; - }; - - this._parser.onHeadersComplete = this._parser[NodeHTTPParser.kOnHeadersComplete] = - function(majorVersion, minorVersion, headers, method, pathname, statusCode) { - var info = arguments[0]; - - if (typeof info === 'object') { - method = info.method; - pathname = info.url; - statusCode = info.statusCode; - headers = info.headers; - } - - self.method = (typeof method === 'number') ? HttpParser.METHODS[method] : method; - self.statusCode = statusCode; - self.url = pathname; - - if (!headers) return; - - for (var i = 0, n = headers.length, key, value; i < n; i += 2) { - key = headers[i].toLowerCase(); - value = headers[i+1]; - if (self.headers.hasOwnProperty(key)) - self.headers[key] += ', ' + value; - else - self.headers[key] = value; - } - - self._complete = true; - }; -}; - -HttpParser.METHODS = { - 0: 'DELETE', - 1: 'GET', - 2: 'HEAD', - 3: 'POST', - 4: 'PUT', - 5: 'CONNECT', - 6: 'OPTIONS', - 7: 'TRACE', - 8: 'COPY', - 9: 'LOCK', - 10: 'MKCOL', - 11: 'MOVE', - 12: 'PROPFIND', - 13: 'PROPPATCH', - 14: 'SEARCH', - 15: 'UNLOCK', - 16: 'BIND', - 17: 'REBIND', - 18: 'UNBIND', - 19: 'ACL', - 20: 'REPORT', - 21: 'MKACTIVITY', - 22: 'CHECKOUT', - 23: 'MERGE', - 24: 'M-SEARCH', - 25: 'NOTIFY', - 26: 'SUBSCRIBE', - 27: 'UNSUBSCRIBE', - 28: 'PATCH', - 29: 'PURGE', - 30: 'MKCALENDAR', - 31: 'LINK', - 32: 'UNLINK' -}; - -var VERSION = process.version - ? process.version.match(/[0-9]+/g).map(function(n) { return parseInt(n, 10) }) - : []; - -if (VERSION[0] === 0 && VERSION[1] === 12) { - HttpParser.METHODS[16] = 'REPORT'; - HttpParser.METHODS[17] = 'MKACTIVITY'; - HttpParser.METHODS[18] = 'CHECKOUT'; - HttpParser.METHODS[19] = 'MERGE'; - HttpParser.METHODS[20] = 'M-SEARCH'; - HttpParser.METHODS[21] = 'NOTIFY'; - HttpParser.METHODS[22] = 'SUBSCRIBE'; - HttpParser.METHODS[23] = 'UNSUBSCRIBE'; - HttpParser.METHODS[24] = 'PATCH'; - HttpParser.METHODS[25] = 'PURGE'; -} - -HttpParser.prototype.isComplete = function() { - return this._complete; -}; - -HttpParser.prototype.parse = function(chunk) { - var consumed = this._parser.execute(chunk, 0, chunk.length); - - if (typeof consumed !== 'number') { - this.error = consumed; - this._complete = true; - return; - } - - if (this._complete) - this.body = (consumed < chunk.length) - ? chunk.slice(consumed) - : Buffer.alloc(0); -}; - -module.exports = HttpParser; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/websocket-driver/lib/websocket/streams.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/websocket-driver/lib/websocket/streams.js deleted file mode 100644 index 96ab31fa..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/websocket-driver/lib/websocket/streams.js +++ /dev/null @@ -1,146 +0,0 @@ -'use strict'; - -/** - -Streams in a WebSocket connection ---------------------------------- - -We model a WebSocket as two duplex streams: one stream is for the wire protocol -over an I/O socket, and the other is for incoming/outgoing messages. - - - +----------+ +---------+ +----------+ - [1] write(chunk) -->| ~~~~~~~~ +----->| parse() +----->| ~~~~~~~~ +--> emit('data') [2] - | | +----+----+ | | - | | | | | - | IO | | [5] | Messages | - | | V | | - | | +---------+ | | - [4] emit('data') <--+ ~~~~~~~~ |<-----+ frame() |<-----+ ~~~~~~~~ |<-- write(chunk) [3] - +----------+ +---------+ +----------+ - - -Message transfer in each direction is simple: IO receives a byte stream [1] and -sends this stream for parsing. The parser will periodically emit a complete -message text on the Messages stream [2]. Similarly, when messages are written -to the Messages stream [3], they are framed using the WebSocket wire format and -emitted via IO [4]. - -There is a feedback loop via [5] since some input from [1] will be things like -ping, pong and close frames. In these cases the protocol responds by emitting -responses directly back to [4] rather than emitting messages via [2]. - -For the purposes of flow control, we consider the sources of each Readable -stream to be as follows: - -* [2] receives input from [1] -* [4] receives input from [1] and [3] - -The classes below express the relationships described above without prescribing -anything about how parse() and frame() work, other than assuming they emit -'data' events to the IO and Messages streams. They will work with any protocol -driver having these two methods. -**/ - - -var Stream = require('stream').Stream, - util = require('util'); - - -var IO = function(driver) { - this.readable = this.writable = true; - this._paused = false; - this._driver = driver; -}; -util.inherits(IO, Stream); - -// The IO pause() and resume() methods will be called when the socket we are -// piping to gets backed up and drains. Since IO output [4] comes from IO input -// [1] and Messages input [3], we need to tell both of those to return false -// from write() when this stream is paused. - -IO.prototype.pause = function() { - this._paused = true; - this._driver.messages._paused = true; -}; - -IO.prototype.resume = function() { - this._paused = false; - this.emit('drain'); - - var messages = this._driver.messages; - messages._paused = false; - messages.emit('drain'); -}; - -// When we receive input from a socket, send it to the parser and tell the -// source whether to back off. -IO.prototype.write = function(chunk) { - if (!this.writable) return false; - this._driver.parse(chunk); - return !this._paused; -}; - -// The IO end() method will be called when the socket piping into it emits -// 'close' or 'end', i.e. the socket is closed. In this situation the Messages -// stream will not emit any more data so we emit 'end'. -IO.prototype.end = function(chunk) { - if (!this.writable) return; - if (chunk !== undefined) this.write(chunk); - this.writable = false; - - var messages = this._driver.messages; - if (messages.readable) { - messages.readable = messages.writable = false; - messages.emit('end'); - } -}; - -IO.prototype.destroy = function() { - this.end(); -}; - - -var Messages = function(driver) { - this.readable = this.writable = true; - this._paused = false; - this._driver = driver; -}; -util.inherits(Messages, Stream); - -// The Messages pause() and resume() methods will be called when the app that's -// processing the messages gets backed up and drains. If we're emitting -// messages too fast we should tell the source to slow down. Message output [2] -// comes from IO input [1]. - -Messages.prototype.pause = function() { - this._driver.io._paused = true; -}; - -Messages.prototype.resume = function() { - this._driver.io._paused = false; - this._driver.io.emit('drain'); -}; - -// When we receive messages from the user, send them to the formatter and tell -// the source whether to back off. -Messages.prototype.write = function(message) { - if (!this.writable) return false; - if (typeof message === 'string') this._driver.text(message); - else this._driver.binary(message); - return !this._paused; -}; - -// The Messages end() method will be called when a stream piping into it emits -// 'end'. Many streams may be piped into the WebSocket and one of them ending -// does not mean the whole socket is done, so just process the input and move -// on leaving the socket open. -Messages.prototype.end = function(message) { - if (message !== undefined) this.write(message); -}; - -Messages.prototype.destroy = function() {}; - - -exports.IO = IO; -exports.Messages = Messages; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/websocket-driver/package.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/websocket-driver/package.json deleted file mode 100644 index fab2506b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/websocket-driver/package.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "name": "websocket-driver", - "description": "WebSocket protocol handler with pluggable I/O", - "homepage": "https://github.com/faye/websocket-driver-node", - "author": "James Coglan (http://jcoglan.com/)", - "keywords": [ - "websocket" - ], - "license": "Apache-2.0", - "version": "0.7.4", - "engines": { - "node": ">=0.8.0" - }, - "files": [ - "lib" - ], - "main": "./lib/websocket/driver", - "dependencies": { - "http-parser-js": ">=0.5.1", - "safe-buffer": ">=5.1.0", - "websocket-extensions": ">=0.1.1" - }, - "devDependencies": { - "jstest": "*", - "permessage-deflate": "*" - }, - "scripts": { - "test": "jstest spec/runner.js" - }, - "repository": { - "type": "git", - "url": "git://github.com/faye/websocket-driver-node.git" - }, - "bugs": "https://github.com/faye/websocket-driver-node/issues" -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/websocket-extensions/CHANGELOG.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/websocket-extensions/CHANGELOG.md deleted file mode 100644 index bb84f5ae..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/websocket-extensions/CHANGELOG.md +++ /dev/null @@ -1,28 +0,0 @@ -### 0.1.4 / 2020-06-02 - -- Remove a ReDoS vulnerability in the header parser (CVE-2020-7662, reported by - Robert McLaughlin) -- Change license from MIT to Apache 2.0 - -### 0.1.3 / 2017-11-11 - -- Accept extension names and parameters including uppercase letters -- Handle extension names that clash with `Object.prototype` properties - -### 0.1.2 / 2017-09-10 - -- Catch synchronous exceptions thrown when calling an extension -- Fix race condition caused when a message is pushed after a cell has stopped - due to an error -- Fix failure of `close()` to return if a message that's queued after one that - produces an error never finishes being processed - -### 0.1.1 / 2015-02-19 - -- Prevent sessions being closed before they have finished processing messages -- Add a callback to `Extensions.close()` so the caller can tell when it's safe - to close the socket - -### 0.1.0 / 2014-12-12 - -- Initial release diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/websocket-extensions/LICENSE.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/websocket-extensions/LICENSE.md deleted file mode 100644 index 3a88e512..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/websocket-extensions/LICENSE.md +++ /dev/null @@ -1,12 +0,0 @@ -Copyright 2014-2020 James Coglan - -Licensed under the Apache License, Version 2.0 (the "License"); you may not use -this file except in compliance with the License. You may obtain a copy of the -License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software distributed -under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -CONDITIONS OF ANY KIND, either express or implied. See the License for the -specific language governing permissions and limitations under the License. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/websocket-extensions/README.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/websocket-extensions/README.md deleted file mode 100644 index 68694ea4..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/websocket-extensions/README.md +++ /dev/null @@ -1,331 +0,0 @@ -# websocket-extensions [![Build status](https://secure.travis-ci.org/faye/websocket-extensions-node.svg)](http://travis-ci.org/faye/websocket-extensions-node) - -A minimal framework that supports the implementation of WebSocket extensions in -a way that's decoupled from the main protocol. This library aims to allow a -WebSocket extension to be written and used with any protocol library, by -defining abstract representations of frames and messages that allow modules to -co-operate. - -`websocket-extensions` provides a container for registering extension plugins, -and provides all the functions required to negotiate which extensions to use -during a session via the `Sec-WebSocket-Extensions` header. By implementing the -APIs defined in this document, an extension may be used by any WebSocket library -based on this framework. - -## Installation - -``` -$ npm install websocket-extensions -``` - -## Usage - -There are two main audiences for this library: authors implementing the -WebSocket protocol, and authors implementing extensions. End users of a -WebSocket library or an extension should be able to use any extension by passing -it as an argument to their chosen protocol library, without needing to know how -either of them work, or how the `websocket-extensions` framework operates. - -The library is designed with the aim that any protocol implementation and any -extension can be used together, so long as they support the same abstract -representation of frames and messages. - -### Data types - -The APIs provided by the framework rely on two data types; extensions will -expect to be given data and to be able to return data in these formats: - -#### *Frame* - -*Frame* is a structure representing a single WebSocket frame of any type. Frames -are simple objects that must have at least the following properties, which -represent the data encoded in the frame: - -| property | description | -| ------------ | ------------------------------------------------------------------ | -| `final` | `true` if the `FIN` bit is set, `false` otherwise | -| `rsv1` | `true` if the `RSV1` bit is set, `false` otherwise | -| `rsv2` | `true` if the `RSV2` bit is set, `false` otherwise | -| `rsv3` | `true` if the `RSV3` bit is set, `false` otherwise | -| `opcode` | the numeric opcode (`0`, `1`, `2`, `8`, `9`, or `10`) of the frame | -| `masked` | `true` if the `MASK` bit is set, `false` otherwise | -| `maskingKey` | a 4-byte `Buffer` if `masked` is `true`, otherwise `null` | -| `payload` | a `Buffer` containing the (unmasked) application data | - -#### *Message* - -A *Message* represents a complete application message, which can be formed from -text, binary and continuation frames. It has the following properties: - -| property | description | -| -------- | ----------------------------------------------------------------- | -| `rsv1` | `true` if the first frame of the message has the `RSV1` bit set | -| `rsv2` | `true` if the first frame of the message has the `RSV2` bit set | -| `rsv3` | `true` if the first frame of the message has the `RSV3` bit set | -| `opcode` | the numeric opcode (`1` or `2`) of the first frame of the message | -| `data` | the concatenation of all the frame payloads in the message | - -### For driver authors - -A driver author is someone implementing the WebSocket protocol proper, and who -wishes end users to be able to use WebSocket extensions with their library. - -At the start of a WebSocket session, on both the client and the server side, -they should begin by creating an extension container and adding whichever -extensions they want to use. - -```js -var Extensions = require('websocket-extensions'), - deflate = require('permessage-deflate'); - -var exts = new Extensions(); -exts.add(deflate); -``` - -In the following examples, `exts` refers to this `Extensions` instance. - -#### Client sessions - -Clients will use the methods `generateOffer()` and `activate(header)`. - -As part of the handshake process, the client must send a -`Sec-WebSocket-Extensions` header to advertise that it supports the registered -extensions. This header should be generated using: - -```js -request.headers['sec-websocket-extensions'] = exts.generateOffer(); -``` - -This returns a string, for example `"permessage-deflate; -client_max_window_bits"`, that represents all the extensions the client is -offering to use, and their parameters. This string may contain multiple offers -for the same extension. - -When the client receives the handshake response from the server, it should pass -the incoming `Sec-WebSocket-Extensions` header in to `exts` to activate the -extensions the server has accepted: - -```js -exts.activate(response.headers['sec-websocket-extensions']); -``` - -If the server has sent any extension responses that the client does not -recognize, or are in conflict with one another for use of RSV bits, or that use -invalid parameters for the named extensions, then `exts.activate()` will -`throw`. In this event, the client driver should fail the connection with -closing code `1010`. - -#### Server sessions - -Servers will use the method `generateResponse(header)`. - -A server session needs to generate a `Sec-WebSocket-Extensions` header to send -in its handshake response: - -```js -var clientOffer = request.headers['sec-websocket-extensions'], - extResponse = exts.generateResponse(clientOffer); - -response.headers['sec-websocket-extensions'] = extResponse; -``` - -Calling `exts.generateResponse(header)` activates those extensions the client -has asked to use, if they are registered, asks each extension for a set of -response parameters, and returns a string containing the response parameters for -all accepted extensions. - -#### In both directions - -Both clients and servers will use the methods `validFrameRsv(frame)`, -`processIncomingMessage(message)` and `processOutgoingMessage(message)`. - -The WebSocket protocol requires that frames do not have any of the `RSV` bits -set unless there is an extension in use that allows otherwise. When processing -an incoming frame, sessions should pass a *Frame* object to: - -```js -exts.validFrameRsv(frame) -``` - -If this method returns `false`, the session should fail the WebSocket connection -with closing code `1002`. - -To pass incoming messages through the extension stack, a session should -construct a *Message* object according to the above datatype definitions, and -call: - -```js -exts.processIncomingMessage(message, function(error, msg) { - // hand the message off to the application -}); -``` - -If any extensions fail to process the message, then the callback will yield an -error and the session should fail the WebSocket connection with closing code -`1010`. If `error` is `null`, then `msg` should be passed on to the application. - -To pass outgoing messages through the extension stack, a session should -construct a *Message* as before, and call: - -```js -exts.processOutgoingMessage(message, function(error, msg) { - // write message to the transport -}); -``` - -If any extensions fail to process the message, then the callback will yield an -error and the session should fail the WebSocket connection with closing code -`1010`. If `error` is `null`, then `message` should be converted into frames -(with the message's `rsv1`, `rsv2`, `rsv3` and `opcode` set on the first frame) -and written to the transport. - -At the end of the WebSocket session (either when the protocol is explicitly -ended or the transport connection disconnects), the driver should call: - -```js -exts.close(function() {}) -``` - -The callback is invoked when all extensions have finished processing any -messages in the pipeline and it's safe to close the socket. - -### For extension authors - -An extension author is someone implementing an extension that transforms -WebSocket messages passing between the client and server. They would like to -implement their extension once and have it work with any protocol library. - -Extension authors will not install `websocket-extensions` or call it directly. -Instead, they should implement the following API to allow their extension to -plug into the `websocket-extensions` framework. - -An `Extension` is any object that has the following properties: - -| property | description | -| -------- | ---------------------------------------------------------------------------- | -| `name` | a string containing the name of the extension as used in negotiation headers | -| `type` | a string, must be `"permessage"` | -| `rsv1` | either `true` if the extension uses the RSV1 bit, `false` otherwise | -| `rsv2` | either `true` if the extension uses the RSV2 bit, `false` otherwise | -| `rsv3` | either `true` if the extension uses the RSV3 bit, `false` otherwise | - -It must also implement the following methods: - -```js -ext.createClientSession() -``` - -This returns a *ClientSession*, whose interface is defined below. - -```js -ext.createServerSession(offers) -``` - -This takes an array of offer params and returns a *ServerSession*, whose -interface is defined below. For example, if the client handshake contains the -offer header: - -``` -Sec-WebSocket-Extensions: permessage-deflate; server_no_context_takeover; server_max_window_bits=8, \ - permessage-deflate; server_max_window_bits=15 -``` - -then the `permessage-deflate` extension will receive the call: - -```js -ext.createServerSession([ - { server_no_context_takeover: true, server_max_window_bits: 8 }, - { server_max_window_bits: 15 } -]); -``` - -The extension must decide which set of parameters it wants to accept, if any, -and return a *ServerSession* if it wants to accept the parameters and `null` -otherwise. - -#### *ClientSession* - -A *ClientSession* is the type returned by `ext.createClientSession()`. It must -implement the following methods, as well as the *Session* API listed below. - -```js -clientSession.generateOffer() -// e.g. -> [ -// { server_no_context_takeover: true, server_max_window_bits: 8 }, -// { server_max_window_bits: 15 } -// ] -``` - -This must return a set of parameters to include in the client's -`Sec-WebSocket-Extensions` offer header. If the session wants to offer multiple -configurations, it can return an array of sets of parameters as shown above. - -```js -clientSession.activate(params) // -> true -``` - -This must take a single set of parameters from the server's handshake response -and use them to configure the client session. If the client accepts the given -parameters, then this method must return `true`. If it returns any other value, -the framework will interpret this as the client rejecting the response, and will -`throw`. - -#### *ServerSession* - -A *ServerSession* is the type returned by `ext.createServerSession(offers)`. It -must implement the following methods, as well as the *Session* API listed below. - -```js -serverSession.generateResponse() -// e.g. -> { server_max_window_bits: 8 } -``` - -This returns the set of parameters the server session wants to send in its -`Sec-WebSocket-Extensions` response header. Only one set of parameters is -returned to the client per extension. Server sessions that would confict on -their use of RSV bits are not activated. - -#### *Session* - -The *Session* API must be implemented by both client and server sessions. It -contains two methods, `processIncomingMessage(message)` and -`processOutgoingMessage(message)`. - -```js -session.processIncomingMessage(message, function(error, msg) { ... }) -``` - -The session must implement this method to take an incoming *Message* as defined -above, transform it in any way it needs, then return it via the callback. If -there is an error processing the message, this method should yield an error as -the first argument. - -```js -session.processOutgoingMessage(message, function(error, msg) { ... }) -``` - -The session must implement this method to take an outgoing *Message* as defined -above, transform it in any way it needs, then return it via the callback. If -there is an error processing the message, this method should yield an error as -the first argument. - -Note that both `processIncomingMessage()` and `processOutgoingMessage()` can -perform their logic asynchronously, are allowed to process multiple messages -concurrently, and are not required to complete working on messages in the same -order the messages arrive. `websocket-extensions` will reorder messages as your -extension emits them and will make sure every extension is given messages in the -order they arrive from the driver. This allows extensions to maintain state that -depends on the messages' wire order, for example keeping a DEFLATE compression -context between messages. - -```js -session.close() -``` - -The framework will call this method when the WebSocket session ends, allowing -the session to release any resources it's using. - -## Examples - -- Consumer: [websocket-driver](https://github.com/faye/websocket-driver-node) -- Provider: [permessage-deflate](https://github.com/faye/permessage-deflate-node) diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/websocket-extensions/lib/parser.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/websocket-extensions/lib/parser.js deleted file mode 100644 index 533767e0..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/websocket-extensions/lib/parser.js +++ /dev/null @@ -1,103 +0,0 @@ -'use strict'; - -var TOKEN = /([!#\$%&'\*\+\-\.\^_`\|~0-9A-Za-z]+)/, - NOTOKEN = /([^!#\$%&'\*\+\-\.\^_`\|~0-9A-Za-z])/g, - QUOTED = /"((?:\\[\x00-\x7f]|[^\x00-\x08\x0a-\x1f\x7f"\\])*)"/, - PARAM = new RegExp(TOKEN.source + '(?:=(?:' + TOKEN.source + '|' + QUOTED.source + '))?'), - EXT = new RegExp(TOKEN.source + '(?: *; *' + PARAM.source + ')*', 'g'), - EXT_LIST = new RegExp('^' + EXT.source + '(?: *, *' + EXT.source + ')*$'), - NUMBER = /^-?(0|[1-9][0-9]*)(\.[0-9]+)?$/; - -var hasOwnProperty = Object.prototype.hasOwnProperty; - -var Parser = { - parseHeader: function(header) { - var offers = new Offers(); - if (header === '' || header === undefined) return offers; - - if (!EXT_LIST.test(header)) - throw new SyntaxError('Invalid Sec-WebSocket-Extensions header: ' + header); - - var values = header.match(EXT); - - values.forEach(function(value) { - var params = value.match(new RegExp(PARAM.source, 'g')), - name = params.shift(), - offer = {}; - - params.forEach(function(param) { - var args = param.match(PARAM), key = args[1], data; - - if (args[2] !== undefined) { - data = args[2]; - } else if (args[3] !== undefined) { - data = args[3].replace(/\\/g, ''); - } else { - data = true; - } - if (NUMBER.test(data)) data = parseFloat(data); - - if (hasOwnProperty.call(offer, key)) { - offer[key] = [].concat(offer[key]); - offer[key].push(data); - } else { - offer[key] = data; - } - }, this); - offers.push(name, offer); - }, this); - - return offers; - }, - - serializeParams: function(name, params) { - var values = []; - - var print = function(key, value) { - if (value instanceof Array) { - value.forEach(function(v) { print(key, v) }); - } else if (value === true) { - values.push(key); - } else if (typeof value === 'number') { - values.push(key + '=' + value); - } else if (NOTOKEN.test(value)) { - values.push(key + '="' + value.replace(/"/g, '\\"') + '"'); - } else { - values.push(key + '=' + value); - } - }; - - for (var key in params) print(key, params[key]); - - return [name].concat(values).join('; '); - } -}; - -var Offers = function() { - this._byName = {}; - this._inOrder = []; -}; - -Offers.prototype.push = function(name, params) { - if (!hasOwnProperty.call(this._byName, name)) - this._byName[name] = []; - - this._byName[name].push(params); - this._inOrder.push({ name: name, params: params }); -}; - -Offers.prototype.eachOffer = function(callback, context) { - var list = this._inOrder; - for (var i = 0, n = list.length; i < n; i++) - callback.call(context, list[i].name, list[i].params); -}; - -Offers.prototype.byName = function(name) { - return this._byName[name] || []; -}; - -Offers.prototype.toArray = function() { - return this._inOrder.slice(); -}; - -module.exports = Parser; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/websocket-extensions/lib/pipeline/README.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/websocket-extensions/lib/pipeline/README.md deleted file mode 100644 index 322a9c56..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/websocket-extensions/lib/pipeline/README.md +++ /dev/null @@ -1,607 +0,0 @@ -# Extension pipelining - -`websocket-extensions` models the extension negotiation and processing pipeline -of the WebSocket protocol. Between the driver parsing messages from the TCP -stream and handing those messages off to the application, there may exist a -stack of extensions that transform the message somehow. - -In the parlance of this framework, a *session* refers to a single instance of an -extension, acting on a particular socket on either the server or the client -side. A session may transform messages both incoming to the application and -outgoing from the application, for example the `permessage-deflate` extension -compresses outgoing messages and decompresses incoming messages. Message streams -in either direction are independent; that is, incoming and outgoing messages -cannot be assumed to 'pair up' as in a request-response protocol. - -Asynchronous processing of messages poses a number of problems that this -pipeline construction is intended to solve. - - -## Overview - -Logically, we have the following: - - - +-------------+ out +---+ +---+ +---+ +--------+ - | |------>| |---->| |---->| |------>| | - | Application | | A | | B | | C | | Driver | - | |<------| |<----| |<----| |<------| | - +-------------+ in +---+ +---+ +---+ +--------+ - - \ / - +----------o----------+ - | - sessions - - -For outgoing messages, the driver receives the result of - - C.outgoing(B.outgoing(A.outgoing(message))) - - or, [A, B, C].reduce(((m, ext) => ext.outgoing(m)), message) - -For incoming messages, the application receives the result of - - A.incoming(B.incoming(C.incoming(message))) - - or, [C, B, A].reduce(((m, ext) => ext.incoming(m)), message) - -A session is of the following type, to borrow notation from pseudo-Haskell: - - type Session = { - incoming :: Message -> Message - outgoing :: Message -> Message - close :: () -> () - } - -(That `() -> ()` syntax is intended to mean that `close()` is a nullary void -method; I apologise to any Haskell readers for not using the right monad.) - -The `incoming()` and `outgoing()` methods perform message transformation in the -respective directions; `close()` is called when a socket closes so the session -can release any resources it's holding, for example a DEFLATE de/compression -context. - -However because this is JavaScript, the `incoming()` and `outgoing()` methods -may be asynchronous (indeed, `permessage-deflate` is based on `zlib`, whose API -is stream-based). So their interface is strictly: - - type Session = { - incoming :: Message -> Callback -> () - outgoing :: Message -> Callback -> () - close :: () -> () - } - - type Callback = Either Error Message -> () - -This means a message *m2* can be pushed into a session while it's still -processing the preceding message *m1*. The messages can be processed -concurrently but they *must* be given to the next session in line (or to the -application) in the same order they came in. Applications will expect to receive -messages in the order they arrived over the wire, and sessions require this too. -So ordering of messages must be preserved throughout the pipeline. - -Consider the following highly simplified extension that deflates messages on the -wire. `message` is a value conforming the type: - - type Message = { - rsv1 :: Boolean - rsv2 :: Boolean - rsv3 :: Boolean - opcode :: Number - data :: Buffer - } - -Here's the extension: - -```js -var zlib = require('zlib'); - -var deflate = { - outgoing: function(message, callback) { - zlib.deflateRaw(message.data, function(error, result) { - message.rsv1 = true; - message.data = result; - callback(error, message); - }); - }, - - incoming: function(message, callback) { - // decompress inbound messages (elided) - }, - - close: function() { - // no state to clean up - } -}; -``` - -We can call it with a large message followed by a small one, and the small one -will be returned first: - -```js -var crypto = require('crypto'), - large = crypto.randomBytes(1 << 14), - small = new Buffer('hi'); - -deflate.outgoing({ data: large }, function() { - console.log(1, 'large'); -}); - -deflate.outgoing({ data: small }, function() { - console.log(2, 'small'); -}); - -/* prints: 2 'small' - 1 'large' */ -``` - -So a session that processes messages asynchronously may fail to preserve message -ordering. - -Now, this extension is stateless, so it can process messages in any order and -still produce the same output. But some extensions are stateful and require -message order to be preserved. - -For example, when using `permessage-deflate` without `no_context_takeover` set, -the session retains a DEFLATE de/compression context between messages, which -accumulates state as it consumes data (later messages can refer to sections of -previous ones to improve compression). Reordering parts of the DEFLATE stream -will result in a failed decompression. Messages must be decompressed in the same -order they were compressed by the peer in order for the DEFLATE protocol to -work. - -Finally, there is the problem of closing a socket. When a WebSocket is closed by -the application, or receives a closing request from the other peer, there may be -messages outgoing from the application and incoming from the peer in the -pipeline. If we close the socket and pipeline immediately, two problems arise: - -* We may send our own closing frame to the peer before all prior messages we - sent have been written to the socket, and before we have finished processing - all prior messages from the peer -* The session may be instructed to close its resources (e.g. its de/compression - context) while it's in the middle of processing a message, or before it has - received messages that are upstream of it in the pipeline - -Essentially, we must defer closing the sessions and sending a closing frame -until after all prior messages have exited the pipeline. - - -## Design goals - -* Message order must be preserved between the protocol driver, the extension - sessions, and the application -* Messages should be handed off to sessions and endpoints as soon as possible, - to maximise throughput of stateless sessions -* The closing procedure should block any further messages from entering the - pipeline, and should allow all existing messages to drain -* Sessions should be closed as soon as possible to prevent them holding memory - and other resources when they have no more messages to handle -* The closing API should allow the caller to detect when the pipeline is empty - and it is safe to continue the WebSocket closing procedure -* Individual extensions should remain as simple as possible to facilitate - modularity and independent authorship - -The final point about modularity is an important one: this framework is designed -to facilitate extensions existing as plugins, by decoupling the protocol driver, -extensions, and application. In an ideal world, plugins should only need to -contain code for their specific functionality, and not solve these problems that -apply to all sessions. Also, solving some of these problems requires -consideration of all active sessions collectively, which an individual session -is incapable of doing. - -For example, it is entirely possible to take the simple `deflate` extension -above and wrap its `incoming()` and `outgoing()` methods in two `Transform` -streams, producing this type: - - type Session = { - incoming :: TransformStream - outtoing :: TransformStream - close :: () -> () - } - -The `Transform` class makes it easy to wrap an async function such that message -order is preserved: - -```js -var stream = require('stream'), - session = new stream.Transform({ objectMode: true }); - -session._transform = function(message, _, callback) { - var self = this; - deflate.outgoing(message, function(error, result) { - self.push(result); - callback(); - }); -}; -``` - -However, this has a negative impact on throughput: it works by deferring -`callback()` until the async function has 'returned', which blocks `Transform` -from passing further input into the `_transform()` method until the current -message is dealt with completely. This would prevent sessions from processing -messages concurrently, and would unnecessarily reduce the throughput of -stateless extensions. - -So, input should be handed off to sessions as soon as possible, and all we need -is a mechanism to reorder the output so that message order is preserved for the -next session in line. - - -## Solution - -We now describe the model implemented here and how it meets the above design -goals. The above diagram where a stack of extensions sit between the driver and -application describes the data flow, but not the object graph. That looks like -this: - - - +--------+ - | Driver | - +---o----+ - | - V - +------------+ +----------+ - | Extensions o----->| Pipeline | - +------------+ +-----o----+ - | - +---------------+---------------+ - | | | - +-----o----+ +-----o----+ +-----o----+ - | Cell [A] | | Cell [B] | | Cell [C] | - +----------+ +----------+ +----------+ - - -A driver using this framework holds an instance of the `Extensions` class, which -it uses to register extension plugins, negotiate headers and transform messages. -The `Extensions` instance itself holds a `Pipeline`, which contains an array of -`Cell` objects, each of which wraps one of the sessions. - - -### Message processing - -Both the `Pipeline` and `Cell` classes have `incoming()` and `outgoing()` -methods; the `Pipeline` interface pushes messages into the pipe, delegates the -message to each `Cell` in turn, then returns it back to the driver. Outgoing -messages pass through `A` then `B` then `C`, and incoming messages in the -reverse order. - -Internally, a `Cell` contains two `Functor` objects. A `Functor` wraps an async -function and makes sure its output messages maintain the order of its input -messages. This name is due to [@fronx](https://github.com/fronx), on the basis -that, by preserving message order, the abstraction preserves the *mapping* -between input and output messages. To use our simple `deflate` extension from -above: - -```js -var functor = new Functor(deflate, 'outgoing'); - -functor.call({ data: large }, function() { - console.log(1, 'large'); -}); - -functor.call({ data: small }, function() { - console.log(2, 'small'); -}); - -/* -> 1 'large' - 2 'small' */ -``` - -A `Cell` contains two of these, one for each direction: - - - +-----------------------+ - +---->| Functor [A, incoming] | - +----------+ | +-----------------------+ - | Cell [A] o------+ - +----------+ | +-----------------------+ - +---->| Functor [A, outgoing] | - +-----------------------+ - - -This satisfies the message transformation requirements: the `Pipeline` simply -loops over the cells in the appropriate direction to transform each message. -Because each `Cell` will preserve message order, we can pass a message to the -next `Cell` in line as soon as the current `Cell` returns it. This gives each -`Cell` all the messages in order while maximising throughput. - - -### Session closing - -We want to close each session as soon as possible, after all existing messages -have drained. To do this, each `Cell` begins with a pending message counter in -each direction, labelled `in` and `out` below. - - - +----------+ - | Pipeline | - +-----o----+ - | - +---------------+---------------+ - | | | - +-----o----+ +-----o----+ +-----o----+ - | Cell [A] | | Cell [B] | | Cell [C] | - +----------+ +----------+ +----------+ - in: 0 in: 0 in: 0 - out: 0 out: 0 out: 0 - - -When a message *m1* enters the pipeline, say in the `outgoing` direction, we -increment the `pending.out` counter on all cells immediately. - - - +----------+ - m1 => | Pipeline | - +-----o----+ - | - +---------------+---------------+ - | | | - +-----o----+ +-----o----+ +-----o----+ - | Cell [A] | | Cell [B] | | Cell [C] | - +----------+ +----------+ +----------+ - in: 0 in: 0 in: 0 - out: 1 out: 1 out: 1 - - -*m1* is handed off to `A`, meanwhile a second message `m2` arrives in the same -direction. All `pending.out` counters are again incremented. - - - +----------+ - m2 => | Pipeline | - +-----o----+ - | - +---------------+---------------+ - m1 | | | - +-----o----+ +-----o----+ +-----o----+ - | Cell [A] | | Cell [B] | | Cell [C] | - +----------+ +----------+ +----------+ - in: 0 in: 0 in: 0 - out: 2 out: 2 out: 2 - - -When the first cell's `A.outgoing` functor finishes processing *m1*, the first -`pending.out` counter is decremented and *m1* is handed off to cell `B`. - - - +----------+ - | Pipeline | - +-----o----+ - | - +---------------+---------------+ - m2 | m1 | | - +-----o----+ +-----o----+ +-----o----+ - | Cell [A] | | Cell [B] | | Cell [C] | - +----------+ +----------+ +----------+ - in: 0 in: 0 in: 0 - out: 1 out: 2 out: 2 - - - -As `B` finishes with *m1*, and as `A` finishes with *m2*, the `pending.out` -counters continue to decrement. - - - +----------+ - | Pipeline | - +-----o----+ - | - +---------------+---------------+ - | m2 | m1 | - +-----o----+ +-----o----+ +-----o----+ - | Cell [A] | | Cell [B] | | Cell [C] | - +----------+ +----------+ +----------+ - in: 0 in: 0 in: 0 - out: 0 out: 1 out: 2 - - - -Say `C` is a little slow, and begins processing *m2* while still processing -*m1*. That's fine, the `Functor` mechanism will keep *m1* ahead of *m2* in the -output. - - - +----------+ - | Pipeline | - +-----o----+ - | - +---------------+---------------+ - | | m2 | m1 - +-----o----+ +-----o----+ +-----o----+ - | Cell [A] | | Cell [B] | | Cell [C] | - +----------+ +----------+ +----------+ - in: 0 in: 0 in: 0 - out: 0 out: 0 out: 2 - - -Once all messages are dealt with, the counters return to `0`. - - - +----------+ - | Pipeline | - +-----o----+ - | - +---------------+---------------+ - | | | - +-----o----+ +-----o----+ +-----o----+ - | Cell [A] | | Cell [B] | | Cell [C] | - +----------+ +----------+ +----------+ - in: 0 in: 0 in: 0 - out: 0 out: 0 out: 0 - - -The same process applies in the `incoming` direction, the only difference being -that messages are passed to `C` first. - -This makes closing the sessions quite simple. When the driver wants to close the -socket, it calls `Pipeline.close()`. This *immediately* calls `close()` on all -the cells. If a cell has `in == out == 0`, then it immediately calls -`session.close()`. Otherwise, it stores the closing call and defers it until -`in` and `out` have both ticked down to zero. The pipeline will not accept new -messages after `close()` has been called, so we know the pending counts will not -increase after this point. - -This means each session is closed as soon as possible: `A` can close while the -slow `C` session is still working, because it knows there are no more messages -on the way. Similarly, `C` will defer closing if `close()` is called while *m1* -is still in `B`, and *m2* in `A`, because its pending count means it knows it -has work yet to do, even if it's not received those messages yet. This concern -cannot be addressed by extensions acting only on their own local state, unless -we pollute individual extensions by making them all implement this same -mechanism. - -The actual closing API at each level is slightly different: - - type Session = { - close :: () -> () - } - - type Cell = { - close :: () -> Promise () - } - - type Pipeline = { - close :: Callback -> () - } - -This might appear inconsistent so it's worth explaining. Remember that a -`Pipeline` holds a list of `Cell` objects, each wrapping a `Session`. The driver -talks (via the `Extensions` API) to the `Pipeline` interface, and it wants -`Pipeline.close()` to do two things: close all the sessions, and tell me when -it's safe to start the closing procedure (i.e. when all messages have drained -from the pipe and been handed off to the application or socket). A callback API -works well for that. - -At the other end of the stack, `Session.close()` is a nullary void method with -no callback or promise API because we don't care what it does, and whatever it -does do will not block the WebSocket protocol; we're not going to hold off -processing messages while a session closes its de/compression context. We just -tell it to close itself, and don't want to wait while it does that. - -In the middle, `Cell.close()` returns a promise rather than using a callback. -This is for two reasons. First, `Cell.close()` might not do anything -immediately, it might have to defer its effect while messages drain. So, if -given a callback, it would have to store it in a queue for later execution. -Callbacks work fine if your method does something and can then invoke the -callback itself, but if you need to store callbacks somewhere so another method -can execute them, a promise is a better fit. Second, it better serves the -purposes of `Pipeline.close()`: it wants to call `close()` on each of a list of -cells, and wait for all of them to finish. This is simple and idiomatic using -promises: - -```js -var closed = cells.map((cell) => cell.close()); -Promise.all(closed).then(callback); -``` - -(We don't actually use a full *Promises/A+* compatible promise here, we use a -much simplified construction that acts as a callback aggregater and resolves -synchronously and does not support chaining, but the principle is the same.) - - -### Error handling - -We've not mentioned error handling so far but it bears some explanation. The -above counter system still applies, but behaves slightly differently in the -presence of errors. - -Say we push three messages into the pipe in the outgoing direction: - - - +----------+ - m3, m2, m1 => | Pipeline | - +-----o----+ - | - +---------------+---------------+ - | | | - +-----o----+ +-----o----+ +-----o----+ - | Cell [A] | | Cell [B] | | Cell [C] | - +----------+ +----------+ +----------+ - in: 0 in: 0 in: 0 - out: 3 out: 3 out: 3 - - -They pass through the cells successfully up to this point: - - - +----------+ - | Pipeline | - +-----o----+ - | - +---------------+---------------+ - m3 | m2 | m1 | - +-----o----+ +-----o----+ +-----o----+ - | Cell [A] | | Cell [B] | | Cell [C] | - +----------+ +----------+ +----------+ - in: 0 in: 0 in: 0 - out: 1 out: 2 out: 3 - - -At this point, session `B` produces an error while processing *m2*, that is *m2* -becomes *e2*. *m1* is still in the pipeline, and *m3* is queued behind *m2*. -What ought to happen is that *m1* is handed off to the socket, then *m2* is -released to the driver, which will detect the error and begin closing the -socket. No further processing should be done on *m3* and it should not be -released to the driver after the error is emitted. - -To handle this, we allow errors to pass down the pipeline just like messages do, -to maintain ordering. But, once a cell sees its session produce an error, or it -receives an error from upstream, it should refuse to accept any further -messages. Session `B` might have begun processing *m3* by the time it produces -the error *e2*, but `C` will have been given *e2* before it receives *m3*, and -can simply drop *m3*. - -Now, say *e2* reaches the slow session `C` while *m1* is still present, -meanwhile *m3* has been dropped. `C` will never receive *m3* since it will have -been dropped upstream. Under the present model, its `out` counter will be `3` -but it is only going to emit two more values: *m1* and *e2*. In order for -closing to work, we need to decrement `out` to reflect this. The situation -should look like this: - - - +----------+ - | Pipeline | - +-----o----+ - | - +---------------+---------------+ - | | e2 | m1 - +-----o----+ +-----o----+ +-----o----+ - | Cell [A] | | Cell [B] | | Cell [C] | - +----------+ +----------+ +----------+ - in: 0 in: 0 in: 0 - out: 0 out: 0 out: 2 - - -When a cell sees its session emit an error, or when it receives an error from -upstream, it sets its pending count in the appropriate direction to equal the -number of messages it is *currently* processing. It will not accept any messages -after it sees the error, so this will allow the counter to reach zero. - -Note that while *e2* is in the pipeline, `Pipeline` should drop any further -messages in the outgoing direction, but should continue to accept incoming -messages. Until *e2* makes it out of the pipe to the driver, behind previous -successful messages, the driver does not know an error has happened, and a -message may arrive over the socket and make it all the way through the incoming -pipe in the meantime. We only halt processing in the affected direction to avoid -doing unnecessary work since messages arriving after an error should not be -processed. - -Some unnecessary work may happen, for example any messages already in the -pipeline following *m2* will be processed by `A`, since it's upstream of the -error. Those messages will be dropped by `B`. - - -## Alternative ideas - -I am considering implementing `Functor` as an object-mode transform stream -rather than what is essentially an async function. Being object-mode, a stream -would preserve message boundaries and would also possibly help address -back-pressure. I'm not sure whether this would require external API changes so -that such streams could be connected to the downstream driver's streams. - - -## Acknowledgements - -Credit is due to [@mnowster](https://github.com/mnowster) for helping with the -design and to [@fronx](https://github.com/fronx) for helping name things. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/websocket-extensions/lib/pipeline/cell.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/websocket-extensions/lib/pipeline/cell.js deleted file mode 100644 index b2901ba7..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/websocket-extensions/lib/pipeline/cell.js +++ /dev/null @@ -1,53 +0,0 @@ -'use strict'; - -var Functor = require('./functor'), - Pledge = require('./pledge'); - -var Cell = function(tuple) { - this._ext = tuple[0]; - this._session = tuple[1]; - - this._functors = { - incoming: new Functor(this._session, 'processIncomingMessage'), - outgoing: new Functor(this._session, 'processOutgoingMessage') - }; -}; - -Cell.prototype.pending = function(direction) { - var functor = this._functors[direction]; - if (!functor._stopped) functor.pending += 1; -}; - -Cell.prototype.incoming = function(error, message, callback, context) { - this._exec('incoming', error, message, callback, context); -}; - -Cell.prototype.outgoing = function(error, message, callback, context) { - this._exec('outgoing', error, message, callback, context); -}; - -Cell.prototype.close = function() { - this._closed = this._closed || new Pledge(); - this._doClose(); - return this._closed; -}; - -Cell.prototype._exec = function(direction, error, message, callback, context) { - this._functors[direction].call(error, message, function(err, msg) { - if (err) err.message = this._ext.name + ': ' + err.message; - callback.call(context, err, msg); - this._doClose(); - }, this); -}; - -Cell.prototype._doClose = function() { - var fin = this._functors.incoming, - fout = this._functors.outgoing; - - if (!this._closed || fin.pending + fout.pending !== 0) return; - if (this._session) this._session.close(); - this._session = null; - this._closed.done(); -}; - -module.exports = Cell; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/websocket-extensions/lib/pipeline/functor.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/websocket-extensions/lib/pipeline/functor.js deleted file mode 100644 index fadb49ac..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/websocket-extensions/lib/pipeline/functor.js +++ /dev/null @@ -1,72 +0,0 @@ -'use strict'; - -var RingBuffer = require('./ring_buffer'); - -var Functor = function(session, method) { - this._session = session; - this._method = method; - this._queue = new RingBuffer(Functor.QUEUE_SIZE); - this._stopped = false; - this.pending = 0; -}; - -Functor.QUEUE_SIZE = 8; - -Functor.prototype.call = function(error, message, callback, context) { - if (this._stopped) return; - - var record = { error: error, message: message, callback: callback, context: context, done: false }, - called = false, - self = this; - - this._queue.push(record); - - if (record.error) { - record.done = true; - this._stop(); - return this._flushQueue(); - } - - var handler = function(err, msg) { - if (!(called ^ (called = true))) return; - - if (err) { - self._stop(); - record.error = err; - record.message = null; - } else { - record.message = msg; - } - - record.done = true; - self._flushQueue(); - }; - - try { - this._session[this._method](message, handler); - } catch (err) { - handler(err); - } -}; - -Functor.prototype._stop = function() { - this.pending = this._queue.length; - this._stopped = true; -}; - -Functor.prototype._flushQueue = function() { - var queue = this._queue, record; - - while (queue.length > 0 && queue.peek().done) { - record = queue.shift(); - if (record.error) { - this.pending = 0; - queue.clear(); - } else { - this.pending -= 1; - } - record.callback.call(record.context, record.error, record.message); - } -}; - -module.exports = Functor; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/websocket-extensions/lib/pipeline/index.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/websocket-extensions/lib/pipeline/index.js deleted file mode 100644 index 930bbc82..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/websocket-extensions/lib/pipeline/index.js +++ /dev/null @@ -1,47 +0,0 @@ -'use strict'; - -var Cell = require('./cell'), - Pledge = require('./pledge'); - -var Pipeline = function(sessions) { - this._cells = sessions.map(function(session) { return new Cell(session) }); - this._stopped = { incoming: false, outgoing: false }; -}; - -Pipeline.prototype.processIncomingMessage = function(message, callback, context) { - if (this._stopped.incoming) return; - this._loop('incoming', this._cells.length - 1, -1, -1, message, callback, context); -}; - -Pipeline.prototype.processOutgoingMessage = function(message, callback, context) { - if (this._stopped.outgoing) return; - this._loop('outgoing', 0, this._cells.length, 1, message, callback, context); -}; - -Pipeline.prototype.close = function(callback, context) { - this._stopped = { incoming: true, outgoing: true }; - - var closed = this._cells.map(function(a) { return a.close() }); - if (callback) - Pledge.all(closed).then(function() { callback.call(context) }); -}; - -Pipeline.prototype._loop = function(direction, start, end, step, message, callback, context) { - var cells = this._cells, - n = cells.length, - self = this; - - while (n--) cells[n].pending(direction); - - var pipe = function(index, error, msg) { - if (index === end) return callback.call(context, error, msg); - - cells[index][direction](error, msg, function(err, m) { - if (err) self._stopped[direction] = true; - pipe(index + step, err, m); - }); - }; - pipe(start, null, message); -}; - -module.exports = Pipeline; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/websocket-extensions/lib/pipeline/pledge.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/websocket-extensions/lib/pipeline/pledge.js deleted file mode 100644 index 8a1f45df..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/websocket-extensions/lib/pipeline/pledge.js +++ /dev/null @@ -1,37 +0,0 @@ -'use strict'; - -var RingBuffer = require('./ring_buffer'); - -var Pledge = function() { - this._complete = false; - this._callbacks = new RingBuffer(Pledge.QUEUE_SIZE); -}; - -Pledge.QUEUE_SIZE = 4; - -Pledge.all = function(list) { - var pledge = new Pledge(), - pending = list.length, - n = pending; - - if (pending === 0) pledge.done(); - - while (n--) list[n].then(function() { - pending -= 1; - if (pending === 0) pledge.done(); - }); - return pledge; -}; - -Pledge.prototype.then = function(callback) { - if (this._complete) callback(); - else this._callbacks.push(callback); -}; - -Pledge.prototype.done = function() { - this._complete = true; - var callbacks = this._callbacks, callback; - while (callback = callbacks.shift()) callback(); -}; - -module.exports = Pledge; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/websocket-extensions/lib/pipeline/ring_buffer.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/websocket-extensions/lib/pipeline/ring_buffer.js deleted file mode 100644 index 676ff944..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/websocket-extensions/lib/pipeline/ring_buffer.js +++ /dev/null @@ -1,66 +0,0 @@ -'use strict'; - -var RingBuffer = function(bufferSize) { - this._bufferSize = bufferSize; - this.clear(); -}; - -RingBuffer.prototype.clear = function() { - this._buffer = new Array(this._bufferSize); - this._ringOffset = 0; - this._ringSize = this._bufferSize; - this._head = 0; - this._tail = 0; - this.length = 0; -}; - -RingBuffer.prototype.push = function(value) { - var expandBuffer = false, - expandRing = false; - - if (this._ringSize < this._bufferSize) { - expandBuffer = (this._tail === 0); - } else if (this._ringOffset === this._ringSize) { - expandBuffer = true; - expandRing = (this._tail === 0); - } - - if (expandBuffer) { - this._tail = this._bufferSize; - this._buffer = this._buffer.concat(new Array(this._bufferSize)); - this._bufferSize = this._buffer.length; - - if (expandRing) - this._ringSize = this._bufferSize; - } - - this._buffer[this._tail] = value; - this.length += 1; - if (this._tail < this._ringSize) this._ringOffset += 1; - this._tail = (this._tail + 1) % this._bufferSize; -}; - -RingBuffer.prototype.peek = function() { - if (this.length === 0) return void 0; - return this._buffer[this._head]; -}; - -RingBuffer.prototype.shift = function() { - if (this.length === 0) return void 0; - - var value = this._buffer[this._head]; - this._buffer[this._head] = void 0; - this.length -= 1; - this._ringOffset -= 1; - - if (this._ringOffset === 0 && this.length > 0) { - this._head = this._ringSize; - this._ringOffset = this.length; - this._ringSize = this._bufferSize; - } else { - this._head = (this._head + 1) % this._ringSize; - } - return value; -}; - -module.exports = RingBuffer; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/websocket-extensions/lib/websocket_extensions.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/websocket-extensions/lib/websocket_extensions.js deleted file mode 100644 index 48adad85..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/websocket-extensions/lib/websocket_extensions.js +++ /dev/null @@ -1,162 +0,0 @@ -'use strict'; - -var Parser = require('./parser'), - Pipeline = require('./pipeline'); - -var Extensions = function() { - this._rsv1 = this._rsv2 = this._rsv3 = null; - - this._byName = {}; - this._inOrder = []; - this._sessions = []; - this._index = {}; -}; - -Extensions.MESSAGE_OPCODES = [1, 2]; - -var instance = { - add: function(ext) { - if (typeof ext.name !== 'string') throw new TypeError('extension.name must be a string'); - if (ext.type !== 'permessage') throw new TypeError('extension.type must be "permessage"'); - - if (typeof ext.rsv1 !== 'boolean') throw new TypeError('extension.rsv1 must be true or false'); - if (typeof ext.rsv2 !== 'boolean') throw new TypeError('extension.rsv2 must be true or false'); - if (typeof ext.rsv3 !== 'boolean') throw new TypeError('extension.rsv3 must be true or false'); - - if (this._byName.hasOwnProperty(ext.name)) - throw new TypeError('An extension with name "' + ext.name + '" is already registered'); - - this._byName[ext.name] = ext; - this._inOrder.push(ext); - }, - - generateOffer: function() { - var sessions = [], - offer = [], - index = {}; - - this._inOrder.forEach(function(ext) { - var session = ext.createClientSession(); - if (!session) return; - - var record = [ext, session]; - sessions.push(record); - index[ext.name] = record; - - var offers = session.generateOffer(); - offers = offers ? [].concat(offers) : []; - - offers.forEach(function(off) { - offer.push(Parser.serializeParams(ext.name, off)); - }, this); - }, this); - - this._sessions = sessions; - this._index = index; - - return offer.length > 0 ? offer.join(', ') : null; - }, - - activate: function(header) { - var responses = Parser.parseHeader(header), - sessions = []; - - responses.eachOffer(function(name, params) { - var record = this._index[name]; - - if (!record) - throw new Error('Server sent an extension response for unknown extension "' + name + '"'); - - var ext = record[0], - session = record[1], - reserved = this._reserved(ext); - - if (reserved) - throw new Error('Server sent two extension responses that use the RSV' + - reserved[0] + ' bit: "' + - reserved[1] + '" and "' + ext.name + '"'); - - if (session.activate(params) !== true) - throw new Error('Server sent unacceptable extension parameters: ' + - Parser.serializeParams(name, params)); - - this._reserve(ext); - sessions.push(record); - }, this); - - this._sessions = sessions; - this._pipeline = new Pipeline(sessions); - }, - - generateResponse: function(header) { - var sessions = [], - response = [], - offers = Parser.parseHeader(header); - - this._inOrder.forEach(function(ext) { - var offer = offers.byName(ext.name); - if (offer.length === 0 || this._reserved(ext)) return; - - var session = ext.createServerSession(offer); - if (!session) return; - - this._reserve(ext); - sessions.push([ext, session]); - response.push(Parser.serializeParams(ext.name, session.generateResponse())); - }, this); - - this._sessions = sessions; - this._pipeline = new Pipeline(sessions); - - return response.length > 0 ? response.join(', ') : null; - }, - - validFrameRsv: function(frame) { - var allowed = { rsv1: false, rsv2: false, rsv3: false }, - ext; - - if (Extensions.MESSAGE_OPCODES.indexOf(frame.opcode) >= 0) { - for (var i = 0, n = this._sessions.length; i < n; i++) { - ext = this._sessions[i][0]; - allowed.rsv1 = allowed.rsv1 || ext.rsv1; - allowed.rsv2 = allowed.rsv2 || ext.rsv2; - allowed.rsv3 = allowed.rsv3 || ext.rsv3; - } - } - - return (allowed.rsv1 || !frame.rsv1) && - (allowed.rsv2 || !frame.rsv2) && - (allowed.rsv3 || !frame.rsv3); - }, - - processIncomingMessage: function(message, callback, context) { - this._pipeline.processIncomingMessage(message, callback, context); - }, - - processOutgoingMessage: function(message, callback, context) { - this._pipeline.processOutgoingMessage(message, callback, context); - }, - - close: function(callback, context) { - if (!this._pipeline) return callback.call(context); - this._pipeline.close(callback, context); - }, - - _reserve: function(ext) { - this._rsv1 = this._rsv1 || (ext.rsv1 && ext.name); - this._rsv2 = this._rsv2 || (ext.rsv2 && ext.name); - this._rsv3 = this._rsv3 || (ext.rsv3 && ext.name); - }, - - _reserved: function(ext) { - if (this._rsv1 && ext.rsv1) return [1, this._rsv1]; - if (this._rsv2 && ext.rsv2) return [2, this._rsv2]; - if (this._rsv3 && ext.rsv3) return [3, this._rsv3]; - return false; - } -}; - -for (var key in instance) - Extensions.prototype[key] = instance[key]; - -module.exports = Extensions; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/websocket-extensions/package.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/websocket-extensions/package.json deleted file mode 100644 index e4f2f916..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/websocket-extensions/package.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "name": "websocket-extensions", - "description": "Generic extension manager for WebSocket connections", - "homepage": "http://github.com/faye/websocket-extensions-node", - "author": "James Coglan (http://jcoglan.com/)", - "keywords": [ - "websocket" - ], - "license": "Apache-2.0", - "version": "0.1.4", - "engines": { - "node": ">=0.8.0" - }, - "files": [ - "lib" - ], - "main": "./lib/websocket_extensions", - "devDependencies": { - "jstest": "*" - }, - "scripts": { - "test": "jstest spec/runner.js" - }, - "repository": { - "type": "git", - "url": "git://github.com/faye/websocket-extensions-node.git" - }, - "bugs": "http://github.com/faye/websocket-extensions-node/issues" -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/whatwg-url/LICENSE.txt b/packages/wyatt_notification_bloc/example/scripts/node_modules/whatwg-url/LICENSE.txt deleted file mode 100644 index 54dfac39..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/whatwg-url/LICENSE.txt +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015–2016 Sebastian Mayr - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/whatwg-url/README.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/whatwg-url/README.md deleted file mode 100644 index 4347a7fc..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/whatwg-url/README.md +++ /dev/null @@ -1,67 +0,0 @@ -# whatwg-url - -whatwg-url is a full implementation of the WHATWG [URL Standard](https://url.spec.whatwg.org/). It can be used standalone, but it also exposes a lot of the internal algorithms that are useful for integrating a URL parser into a project like [jsdom](https://github.com/tmpvar/jsdom). - -## Current Status - -whatwg-url is currently up to date with the URL spec up to commit [a62223](https://github.com/whatwg/url/commit/a622235308342c9adc7fc2fd1659ff059f7d5e2a). - -## API - -### The `URL` Constructor - -The main API is the [`URL`](https://url.spec.whatwg.org/#url) export, which follows the spec's behavior in all ways (including e.g. `USVString` conversion). Most consumers of this library will want to use this. - -### Low-level URL Standard API - -The following methods are exported for use by places like jsdom that need to implement things like [`HTMLHyperlinkElementUtils`](https://html.spec.whatwg.org/#htmlhyperlinkelementutils). They operate on or return an "internal URL" or ["URL record"](https://url.spec.whatwg.org/#concept-url) type. - -- [URL parser](https://url.spec.whatwg.org/#concept-url-parser): `parseURL(input, { baseURL, encodingOverride })` -- [Basic URL parser](https://url.spec.whatwg.org/#concept-basic-url-parser): `basicURLParse(input, { baseURL, encodingOverride, url, stateOverride })` -- [URL serializer](https://url.spec.whatwg.org/#concept-url-serializer): `serializeURL(urlRecord, excludeFragment)` -- [Host serializer](https://url.spec.whatwg.org/#concept-host-serializer): `serializeHost(hostFromURLRecord)` -- [Serialize an integer](https://url.spec.whatwg.org/#serialize-an-integer): `serializeInteger(number)` -- [Origin](https://url.spec.whatwg.org/#concept-url-origin) [serializer](https://html.spec.whatwg.org/multipage/browsers.html#serialization-of-an-origin): `serializeURLOrigin(urlRecord)` -- [Set the username](https://url.spec.whatwg.org/#set-the-username): `setTheUsername(urlRecord, usernameString)` -- [Set the password](https://url.spec.whatwg.org/#set-the-password): `setThePassword(urlRecord, passwordString)` -- [Cannot have a username/password/port](https://url.spec.whatwg.org/#cannot-have-a-username-password-port): `cannotHaveAUsernamePasswordPort(urlRecord)` - -The `stateOverride` parameter is one of the following strings: - -- [`"scheme start"`](https://url.spec.whatwg.org/#scheme-start-state) -- [`"scheme"`](https://url.spec.whatwg.org/#scheme-state) -- [`"no scheme"`](https://url.spec.whatwg.org/#no-scheme-state) -- [`"special relative or authority"`](https://url.spec.whatwg.org/#special-relative-or-authority-state) -- [`"path or authority"`](https://url.spec.whatwg.org/#path-or-authority-state) -- [`"relative"`](https://url.spec.whatwg.org/#relative-state) -- [`"relative slash"`](https://url.spec.whatwg.org/#relative-slash-state) -- [`"special authority slashes"`](https://url.spec.whatwg.org/#special-authority-slashes-state) -- [`"special authority ignore slashes"`](https://url.spec.whatwg.org/#special-authority-ignore-slashes-state) -- [`"authority"`](https://url.spec.whatwg.org/#authority-state) -- [`"host"`](https://url.spec.whatwg.org/#host-state) -- [`"hostname"`](https://url.spec.whatwg.org/#hostname-state) -- [`"port"`](https://url.spec.whatwg.org/#port-state) -- [`"file"`](https://url.spec.whatwg.org/#file-state) -- [`"file slash"`](https://url.spec.whatwg.org/#file-slash-state) -- [`"file host"`](https://url.spec.whatwg.org/#file-host-state) -- [`"path start"`](https://url.spec.whatwg.org/#path-start-state) -- [`"path"`](https://url.spec.whatwg.org/#path-state) -- [`"cannot-be-a-base-URL path"`](https://url.spec.whatwg.org/#cannot-be-a-base-url-path-state) -- [`"query"`](https://url.spec.whatwg.org/#query-state) -- [`"fragment"`](https://url.spec.whatwg.org/#fragment-state) - -The URL record type has the following API: - -- [`scheme`](https://url.spec.whatwg.org/#concept-url-scheme) -- [`username`](https://url.spec.whatwg.org/#concept-url-username) -- [`password`](https://url.spec.whatwg.org/#concept-url-password) -- [`host`](https://url.spec.whatwg.org/#concept-url-host) -- [`port`](https://url.spec.whatwg.org/#concept-url-port) -- [`path`](https://url.spec.whatwg.org/#concept-url-path) (as an array) -- [`query`](https://url.spec.whatwg.org/#concept-url-query) -- [`fragment`](https://url.spec.whatwg.org/#concept-url-fragment) -- [`cannotBeABaseURL`](https://url.spec.whatwg.org/#url-cannot-be-a-base-url-flag) (as a boolean) - -These properties should be treated with care, as in general changing them will cause the URL record to be in an inconsistent state until the appropriate invocation of `basicURLParse` is used to fix it up. You can see examples of this in the URL Standard, where there are many step sequences like "4. Set context object’s url’s fragment to the empty string. 5. Basic URL parse _input_ with context object’s url as _url_ and fragment state as _state override_." In between those two steps, a URL record is in an unusable state. - -The return value of "failure" in the spec is represented by the string `"failure"`. That is, functions like `parseURL` and `basicURLParse` can return _either_ a URL record _or_ the string `"failure"`. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/whatwg-url/lib/URL-impl.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/whatwg-url/lib/URL-impl.js deleted file mode 100644 index dc7452cc..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/whatwg-url/lib/URL-impl.js +++ /dev/null @@ -1,200 +0,0 @@ -"use strict"; -const usm = require("./url-state-machine"); - -exports.implementation = class URLImpl { - constructor(constructorArgs) { - const url = constructorArgs[0]; - const base = constructorArgs[1]; - - let parsedBase = null; - if (base !== undefined) { - parsedBase = usm.basicURLParse(base); - if (parsedBase === "failure") { - throw new TypeError("Invalid base URL"); - } - } - - const parsedURL = usm.basicURLParse(url, { baseURL: parsedBase }); - if (parsedURL === "failure") { - throw new TypeError("Invalid URL"); - } - - this._url = parsedURL; - - // TODO: query stuff - } - - get href() { - return usm.serializeURL(this._url); - } - - set href(v) { - const parsedURL = usm.basicURLParse(v); - if (parsedURL === "failure") { - throw new TypeError("Invalid URL"); - } - - this._url = parsedURL; - } - - get origin() { - return usm.serializeURLOrigin(this._url); - } - - get protocol() { - return this._url.scheme + ":"; - } - - set protocol(v) { - usm.basicURLParse(v + ":", { url: this._url, stateOverride: "scheme start" }); - } - - get username() { - return this._url.username; - } - - set username(v) { - if (usm.cannotHaveAUsernamePasswordPort(this._url)) { - return; - } - - usm.setTheUsername(this._url, v); - } - - get password() { - return this._url.password; - } - - set password(v) { - if (usm.cannotHaveAUsernamePasswordPort(this._url)) { - return; - } - - usm.setThePassword(this._url, v); - } - - get host() { - const url = this._url; - - if (url.host === null) { - return ""; - } - - if (url.port === null) { - return usm.serializeHost(url.host); - } - - return usm.serializeHost(url.host) + ":" + usm.serializeInteger(url.port); - } - - set host(v) { - if (this._url.cannotBeABaseURL) { - return; - } - - usm.basicURLParse(v, { url: this._url, stateOverride: "host" }); - } - - get hostname() { - if (this._url.host === null) { - return ""; - } - - return usm.serializeHost(this._url.host); - } - - set hostname(v) { - if (this._url.cannotBeABaseURL) { - return; - } - - usm.basicURLParse(v, { url: this._url, stateOverride: "hostname" }); - } - - get port() { - if (this._url.port === null) { - return ""; - } - - return usm.serializeInteger(this._url.port); - } - - set port(v) { - if (usm.cannotHaveAUsernamePasswordPort(this._url)) { - return; - } - - if (v === "") { - this._url.port = null; - } else { - usm.basicURLParse(v, { url: this._url, stateOverride: "port" }); - } - } - - get pathname() { - if (this._url.cannotBeABaseURL) { - return this._url.path[0]; - } - - if (this._url.path.length === 0) { - return ""; - } - - return "/" + this._url.path.join("/"); - } - - set pathname(v) { - if (this._url.cannotBeABaseURL) { - return; - } - - this._url.path = []; - usm.basicURLParse(v, { url: this._url, stateOverride: "path start" }); - } - - get search() { - if (this._url.query === null || this._url.query === "") { - return ""; - } - - return "?" + this._url.query; - } - - set search(v) { - // TODO: query stuff - - const url = this._url; - - if (v === "") { - url.query = null; - return; - } - - const input = v[0] === "?" ? v.substring(1) : v; - url.query = ""; - usm.basicURLParse(input, { url, stateOverride: "query" }); - } - - get hash() { - if (this._url.fragment === null || this._url.fragment === "") { - return ""; - } - - return "#" + this._url.fragment; - } - - set hash(v) { - if (v === "") { - this._url.fragment = null; - return; - } - - const input = v[0] === "#" ? v.substring(1) : v; - this._url.fragment = ""; - usm.basicURLParse(input, { url: this._url, stateOverride: "fragment" }); - } - - toJSON() { - return this.href; - } -}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/whatwg-url/lib/URL.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/whatwg-url/lib/URL.js deleted file mode 100644 index 78c7207e..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/whatwg-url/lib/URL.js +++ /dev/null @@ -1,196 +0,0 @@ -"use strict"; - -const conversions = require("webidl-conversions"); -const utils = require("./utils.js"); -const Impl = require(".//URL-impl.js"); - -const impl = utils.implSymbol; - -function URL(url) { - if (!this || this[impl] || !(this instanceof URL)) { - throw new TypeError("Failed to construct 'URL': Please use the 'new' operator, this DOM object constructor cannot be called as a function."); - } - if (arguments.length < 1) { - throw new TypeError("Failed to construct 'URL': 1 argument required, but only " + arguments.length + " present."); - } - const args = []; - for (let i = 0; i < arguments.length && i < 2; ++i) { - args[i] = arguments[i]; - } - args[0] = conversions["USVString"](args[0]); - if (args[1] !== undefined) { - args[1] = conversions["USVString"](args[1]); - } - - module.exports.setup(this, args); -} - -URL.prototype.toJSON = function toJSON() { - if (!this || !module.exports.is(this)) { - throw new TypeError("Illegal invocation"); - } - const args = []; - for (let i = 0; i < arguments.length && i < 0; ++i) { - args[i] = arguments[i]; - } - return this[impl].toJSON.apply(this[impl], args); -}; -Object.defineProperty(URL.prototype, "href", { - get() { - return this[impl].href; - }, - set(V) { - V = conversions["USVString"](V); - this[impl].href = V; - }, - enumerable: true, - configurable: true -}); - -URL.prototype.toString = function () { - if (!this || !module.exports.is(this)) { - throw new TypeError("Illegal invocation"); - } - return this.href; -}; - -Object.defineProperty(URL.prototype, "origin", { - get() { - return this[impl].origin; - }, - enumerable: true, - configurable: true -}); - -Object.defineProperty(URL.prototype, "protocol", { - get() { - return this[impl].protocol; - }, - set(V) { - V = conversions["USVString"](V); - this[impl].protocol = V; - }, - enumerable: true, - configurable: true -}); - -Object.defineProperty(URL.prototype, "username", { - get() { - return this[impl].username; - }, - set(V) { - V = conversions["USVString"](V); - this[impl].username = V; - }, - enumerable: true, - configurable: true -}); - -Object.defineProperty(URL.prototype, "password", { - get() { - return this[impl].password; - }, - set(V) { - V = conversions["USVString"](V); - this[impl].password = V; - }, - enumerable: true, - configurable: true -}); - -Object.defineProperty(URL.prototype, "host", { - get() { - return this[impl].host; - }, - set(V) { - V = conversions["USVString"](V); - this[impl].host = V; - }, - enumerable: true, - configurable: true -}); - -Object.defineProperty(URL.prototype, "hostname", { - get() { - return this[impl].hostname; - }, - set(V) { - V = conversions["USVString"](V); - this[impl].hostname = V; - }, - enumerable: true, - configurable: true -}); - -Object.defineProperty(URL.prototype, "port", { - get() { - return this[impl].port; - }, - set(V) { - V = conversions["USVString"](V); - this[impl].port = V; - }, - enumerable: true, - configurable: true -}); - -Object.defineProperty(URL.prototype, "pathname", { - get() { - return this[impl].pathname; - }, - set(V) { - V = conversions["USVString"](V); - this[impl].pathname = V; - }, - enumerable: true, - configurable: true -}); - -Object.defineProperty(URL.prototype, "search", { - get() { - return this[impl].search; - }, - set(V) { - V = conversions["USVString"](V); - this[impl].search = V; - }, - enumerable: true, - configurable: true -}); - -Object.defineProperty(URL.prototype, "hash", { - get() { - return this[impl].hash; - }, - set(V) { - V = conversions["USVString"](V); - this[impl].hash = V; - }, - enumerable: true, - configurable: true -}); - - -module.exports = { - is(obj) { - return !!obj && obj[impl] instanceof Impl.implementation; - }, - create(constructorArgs, privateData) { - let obj = Object.create(URL.prototype); - this.setup(obj, constructorArgs, privateData); - return obj; - }, - setup(obj, constructorArgs, privateData) { - if (!privateData) privateData = {}; - privateData.wrapper = obj; - - obj[impl] = new Impl.implementation(constructorArgs, privateData); - obj[impl][utils.wrapperSymbol] = obj; - }, - interface: URL, - expose: { - Window: { URL: URL }, - Worker: { URL: URL } - } -}; - diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/whatwg-url/lib/public-api.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/whatwg-url/lib/public-api.js deleted file mode 100644 index 932dcada..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/whatwg-url/lib/public-api.js +++ /dev/null @@ -1,11 +0,0 @@ -"use strict"; - -exports.URL = require("./URL").interface; -exports.serializeURL = require("./url-state-machine").serializeURL; -exports.serializeURLOrigin = require("./url-state-machine").serializeURLOrigin; -exports.basicURLParse = require("./url-state-machine").basicURLParse; -exports.setTheUsername = require("./url-state-machine").setTheUsername; -exports.setThePassword = require("./url-state-machine").setThePassword; -exports.serializeHost = require("./url-state-machine").serializeHost; -exports.serializeInteger = require("./url-state-machine").serializeInteger; -exports.parseURL = require("./url-state-machine").parseURL; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/whatwg-url/lib/url-state-machine.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/whatwg-url/lib/url-state-machine.js deleted file mode 100644 index c25dbc2c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/whatwg-url/lib/url-state-machine.js +++ /dev/null @@ -1,1297 +0,0 @@ -"use strict"; -const punycode = require("punycode"); -const tr46 = require("tr46"); - -const specialSchemes = { - ftp: 21, - file: null, - gopher: 70, - http: 80, - https: 443, - ws: 80, - wss: 443 -}; - -const failure = Symbol("failure"); - -function countSymbols(str) { - return punycode.ucs2.decode(str).length; -} - -function at(input, idx) { - const c = input[idx]; - return isNaN(c) ? undefined : String.fromCodePoint(c); -} - -function isASCIIDigit(c) { - return c >= 0x30 && c <= 0x39; -} - -function isASCIIAlpha(c) { - return (c >= 0x41 && c <= 0x5A) || (c >= 0x61 && c <= 0x7A); -} - -function isASCIIAlphanumeric(c) { - return isASCIIAlpha(c) || isASCIIDigit(c); -} - -function isASCIIHex(c) { - return isASCIIDigit(c) || (c >= 0x41 && c <= 0x46) || (c >= 0x61 && c <= 0x66); -} - -function isSingleDot(buffer) { - return buffer === "." || buffer.toLowerCase() === "%2e"; -} - -function isDoubleDot(buffer) { - buffer = buffer.toLowerCase(); - return buffer === ".." || buffer === "%2e." || buffer === ".%2e" || buffer === "%2e%2e"; -} - -function isWindowsDriveLetterCodePoints(cp1, cp2) { - return isASCIIAlpha(cp1) && (cp2 === 58 || cp2 === 124); -} - -function isWindowsDriveLetterString(string) { - return string.length === 2 && isASCIIAlpha(string.codePointAt(0)) && (string[1] === ":" || string[1] === "|"); -} - -function isNormalizedWindowsDriveLetterString(string) { - return string.length === 2 && isASCIIAlpha(string.codePointAt(0)) && string[1] === ":"; -} - -function containsForbiddenHostCodePoint(string) { - return string.search(/\u0000|\u0009|\u000A|\u000D|\u0020|#|%|\/|:|\?|@|\[|\\|\]/) !== -1; -} - -function containsForbiddenHostCodePointExcludingPercent(string) { - return string.search(/\u0000|\u0009|\u000A|\u000D|\u0020|#|\/|:|\?|@|\[|\\|\]/) !== -1; -} - -function isSpecialScheme(scheme) { - return specialSchemes[scheme] !== undefined; -} - -function isSpecial(url) { - return isSpecialScheme(url.scheme); -} - -function defaultPort(scheme) { - return specialSchemes[scheme]; -} - -function percentEncode(c) { - let hex = c.toString(16).toUpperCase(); - if (hex.length === 1) { - hex = "0" + hex; - } - - return "%" + hex; -} - -function utf8PercentEncode(c) { - const buf = new Buffer(c); - - let str = ""; - - for (let i = 0; i < buf.length; ++i) { - str += percentEncode(buf[i]); - } - - return str; -} - -function utf8PercentDecode(str) { - const input = new Buffer(str); - const output = []; - for (let i = 0; i < input.length; ++i) { - if (input[i] !== 37) { - output.push(input[i]); - } else if (input[i] === 37 && isASCIIHex(input[i + 1]) && isASCIIHex(input[i + 2])) { - output.push(parseInt(input.slice(i + 1, i + 3).toString(), 16)); - i += 2; - } else { - output.push(input[i]); - } - } - return new Buffer(output).toString(); -} - -function isC0ControlPercentEncode(c) { - return c <= 0x1F || c > 0x7E; -} - -const extraPathPercentEncodeSet = new Set([32, 34, 35, 60, 62, 63, 96, 123, 125]); -function isPathPercentEncode(c) { - return isC0ControlPercentEncode(c) || extraPathPercentEncodeSet.has(c); -} - -const extraUserinfoPercentEncodeSet = - new Set([47, 58, 59, 61, 64, 91, 92, 93, 94, 124]); -function isUserinfoPercentEncode(c) { - return isPathPercentEncode(c) || extraUserinfoPercentEncodeSet.has(c); -} - -function percentEncodeChar(c, encodeSetPredicate) { - const cStr = String.fromCodePoint(c); - - if (encodeSetPredicate(c)) { - return utf8PercentEncode(cStr); - } - - return cStr; -} - -function parseIPv4Number(input) { - let R = 10; - - if (input.length >= 2 && input.charAt(0) === "0" && input.charAt(1).toLowerCase() === "x") { - input = input.substring(2); - R = 16; - } else if (input.length >= 2 && input.charAt(0) === "0") { - input = input.substring(1); - R = 8; - } - - if (input === "") { - return 0; - } - - const regex = R === 10 ? /[^0-9]/ : (R === 16 ? /[^0-9A-Fa-f]/ : /[^0-7]/); - if (regex.test(input)) { - return failure; - } - - return parseInt(input, R); -} - -function parseIPv4(input) { - const parts = input.split("."); - if (parts[parts.length - 1] === "") { - if (parts.length > 1) { - parts.pop(); - } - } - - if (parts.length > 4) { - return input; - } - - const numbers = []; - for (const part of parts) { - if (part === "") { - return input; - } - const n = parseIPv4Number(part); - if (n === failure) { - return input; - } - - numbers.push(n); - } - - for (let i = 0; i < numbers.length - 1; ++i) { - if (numbers[i] > 255) { - return failure; - } - } - if (numbers[numbers.length - 1] >= Math.pow(256, 5 - numbers.length)) { - return failure; - } - - let ipv4 = numbers.pop(); - let counter = 0; - - for (const n of numbers) { - ipv4 += n * Math.pow(256, 3 - counter); - ++counter; - } - - return ipv4; -} - -function serializeIPv4(address) { - let output = ""; - let n = address; - - for (let i = 1; i <= 4; ++i) { - output = String(n % 256) + output; - if (i !== 4) { - output = "." + output; - } - n = Math.floor(n / 256); - } - - return output; -} - -function parseIPv6(input) { - const address = [0, 0, 0, 0, 0, 0, 0, 0]; - let pieceIndex = 0; - let compress = null; - let pointer = 0; - - input = punycode.ucs2.decode(input); - - if (input[pointer] === 58) { - if (input[pointer + 1] !== 58) { - return failure; - } - - pointer += 2; - ++pieceIndex; - compress = pieceIndex; - } - - while (pointer < input.length) { - if (pieceIndex === 8) { - return failure; - } - - if (input[pointer] === 58) { - if (compress !== null) { - return failure; - } - ++pointer; - ++pieceIndex; - compress = pieceIndex; - continue; - } - - let value = 0; - let length = 0; - - while (length < 4 && isASCIIHex(input[pointer])) { - value = value * 0x10 + parseInt(at(input, pointer), 16); - ++pointer; - ++length; - } - - if (input[pointer] === 46) { - if (length === 0) { - return failure; - } - - pointer -= length; - - if (pieceIndex > 6) { - return failure; - } - - let numbersSeen = 0; - - while (input[pointer] !== undefined) { - let ipv4Piece = null; - - if (numbersSeen > 0) { - if (input[pointer] === 46 && numbersSeen < 4) { - ++pointer; - } else { - return failure; - } - } - - if (!isASCIIDigit(input[pointer])) { - return failure; - } - - while (isASCIIDigit(input[pointer])) { - const number = parseInt(at(input, pointer)); - if (ipv4Piece === null) { - ipv4Piece = number; - } else if (ipv4Piece === 0) { - return failure; - } else { - ipv4Piece = ipv4Piece * 10 + number; - } - if (ipv4Piece > 255) { - return failure; - } - ++pointer; - } - - address[pieceIndex] = address[pieceIndex] * 0x100 + ipv4Piece; - - ++numbersSeen; - - if (numbersSeen === 2 || numbersSeen === 4) { - ++pieceIndex; - } - } - - if (numbersSeen !== 4) { - return failure; - } - - break; - } else if (input[pointer] === 58) { - ++pointer; - if (input[pointer] === undefined) { - return failure; - } - } else if (input[pointer] !== undefined) { - return failure; - } - - address[pieceIndex] = value; - ++pieceIndex; - } - - if (compress !== null) { - let swaps = pieceIndex - compress; - pieceIndex = 7; - while (pieceIndex !== 0 && swaps > 0) { - const temp = address[compress + swaps - 1]; - address[compress + swaps - 1] = address[pieceIndex]; - address[pieceIndex] = temp; - --pieceIndex; - --swaps; - } - } else if (compress === null && pieceIndex !== 8) { - return failure; - } - - return address; -} - -function serializeIPv6(address) { - let output = ""; - const seqResult = findLongestZeroSequence(address); - const compress = seqResult.idx; - let ignore0 = false; - - for (let pieceIndex = 0; pieceIndex <= 7; ++pieceIndex) { - if (ignore0 && address[pieceIndex] === 0) { - continue; - } else if (ignore0) { - ignore0 = false; - } - - if (compress === pieceIndex) { - const separator = pieceIndex === 0 ? "::" : ":"; - output += separator; - ignore0 = true; - continue; - } - - output += address[pieceIndex].toString(16); - - if (pieceIndex !== 7) { - output += ":"; - } - } - - return output; -} - -function parseHost(input, isSpecialArg) { - if (input[0] === "[") { - if (input[input.length - 1] !== "]") { - return failure; - } - - return parseIPv6(input.substring(1, input.length - 1)); - } - - if (!isSpecialArg) { - return parseOpaqueHost(input); - } - - const domain = utf8PercentDecode(input); - const asciiDomain = tr46.toASCII(domain, false, tr46.PROCESSING_OPTIONS.NONTRANSITIONAL, false); - if (asciiDomain === null) { - return failure; - } - - if (containsForbiddenHostCodePoint(asciiDomain)) { - return failure; - } - - const ipv4Host = parseIPv4(asciiDomain); - if (typeof ipv4Host === "number" || ipv4Host === failure) { - return ipv4Host; - } - - return asciiDomain; -} - -function parseOpaqueHost(input) { - if (containsForbiddenHostCodePointExcludingPercent(input)) { - return failure; - } - - let output = ""; - const decoded = punycode.ucs2.decode(input); - for (let i = 0; i < decoded.length; ++i) { - output += percentEncodeChar(decoded[i], isC0ControlPercentEncode); - } - return output; -} - -function findLongestZeroSequence(arr) { - let maxIdx = null; - let maxLen = 1; // only find elements > 1 - let currStart = null; - let currLen = 0; - - for (let i = 0; i < arr.length; ++i) { - if (arr[i] !== 0) { - if (currLen > maxLen) { - maxIdx = currStart; - maxLen = currLen; - } - - currStart = null; - currLen = 0; - } else { - if (currStart === null) { - currStart = i; - } - ++currLen; - } - } - - // if trailing zeros - if (currLen > maxLen) { - maxIdx = currStart; - maxLen = currLen; - } - - return { - idx: maxIdx, - len: maxLen - }; -} - -function serializeHost(host) { - if (typeof host === "number") { - return serializeIPv4(host); - } - - // IPv6 serializer - if (host instanceof Array) { - return "[" + serializeIPv6(host) + "]"; - } - - return host; -} - -function trimControlChars(url) { - return url.replace(/^[\u0000-\u001F\u0020]+|[\u0000-\u001F\u0020]+$/g, ""); -} - -function trimTabAndNewline(url) { - return url.replace(/\u0009|\u000A|\u000D/g, ""); -} - -function shortenPath(url) { - const path = url.path; - if (path.length === 0) { - return; - } - if (url.scheme === "file" && path.length === 1 && isNormalizedWindowsDriveLetter(path[0])) { - return; - } - - path.pop(); -} - -function includesCredentials(url) { - return url.username !== "" || url.password !== ""; -} - -function cannotHaveAUsernamePasswordPort(url) { - return url.host === null || url.host === "" || url.cannotBeABaseURL || url.scheme === "file"; -} - -function isNormalizedWindowsDriveLetter(string) { - return /^[A-Za-z]:$/.test(string); -} - -function URLStateMachine(input, base, encodingOverride, url, stateOverride) { - this.pointer = 0; - this.input = input; - this.base = base || null; - this.encodingOverride = encodingOverride || "utf-8"; - this.stateOverride = stateOverride; - this.url = url; - this.failure = false; - this.parseError = false; - - if (!this.url) { - this.url = { - scheme: "", - username: "", - password: "", - host: null, - port: null, - path: [], - query: null, - fragment: null, - - cannotBeABaseURL: false - }; - - const res = trimControlChars(this.input); - if (res !== this.input) { - this.parseError = true; - } - this.input = res; - } - - const res = trimTabAndNewline(this.input); - if (res !== this.input) { - this.parseError = true; - } - this.input = res; - - this.state = stateOverride || "scheme start"; - - this.buffer = ""; - this.atFlag = false; - this.arrFlag = false; - this.passwordTokenSeenFlag = false; - - this.input = punycode.ucs2.decode(this.input); - - for (; this.pointer <= this.input.length; ++this.pointer) { - const c = this.input[this.pointer]; - const cStr = isNaN(c) ? undefined : String.fromCodePoint(c); - - // exec state machine - const ret = this["parse " + this.state](c, cStr); - if (!ret) { - break; // terminate algorithm - } else if (ret === failure) { - this.failure = true; - break; - } - } -} - -URLStateMachine.prototype["parse scheme start"] = function parseSchemeStart(c, cStr) { - if (isASCIIAlpha(c)) { - this.buffer += cStr.toLowerCase(); - this.state = "scheme"; - } else if (!this.stateOverride) { - this.state = "no scheme"; - --this.pointer; - } else { - this.parseError = true; - return failure; - } - - return true; -}; - -URLStateMachine.prototype["parse scheme"] = function parseScheme(c, cStr) { - if (isASCIIAlphanumeric(c) || c === 43 || c === 45 || c === 46) { - this.buffer += cStr.toLowerCase(); - } else if (c === 58) { - if (this.stateOverride) { - if (isSpecial(this.url) && !isSpecialScheme(this.buffer)) { - return false; - } - - if (!isSpecial(this.url) && isSpecialScheme(this.buffer)) { - return false; - } - - if ((includesCredentials(this.url) || this.url.port !== null) && this.buffer === "file") { - return false; - } - - if (this.url.scheme === "file" && (this.url.host === "" || this.url.host === null)) { - return false; - } - } - this.url.scheme = this.buffer; - this.buffer = ""; - if (this.stateOverride) { - return false; - } - if (this.url.scheme === "file") { - if (this.input[this.pointer + 1] !== 47 || this.input[this.pointer + 2] !== 47) { - this.parseError = true; - } - this.state = "file"; - } else if (isSpecial(this.url) && this.base !== null && this.base.scheme === this.url.scheme) { - this.state = "special relative or authority"; - } else if (isSpecial(this.url)) { - this.state = "special authority slashes"; - } else if (this.input[this.pointer + 1] === 47) { - this.state = "path or authority"; - ++this.pointer; - } else { - this.url.cannotBeABaseURL = true; - this.url.path.push(""); - this.state = "cannot-be-a-base-URL path"; - } - } else if (!this.stateOverride) { - this.buffer = ""; - this.state = "no scheme"; - this.pointer = -1; - } else { - this.parseError = true; - return failure; - } - - return true; -}; - -URLStateMachine.prototype["parse no scheme"] = function parseNoScheme(c) { - if (this.base === null || (this.base.cannotBeABaseURL && c !== 35)) { - return failure; - } else if (this.base.cannotBeABaseURL && c === 35) { - this.url.scheme = this.base.scheme; - this.url.path = this.base.path.slice(); - this.url.query = this.base.query; - this.url.fragment = ""; - this.url.cannotBeABaseURL = true; - this.state = "fragment"; - } else if (this.base.scheme === "file") { - this.state = "file"; - --this.pointer; - } else { - this.state = "relative"; - --this.pointer; - } - - return true; -}; - -URLStateMachine.prototype["parse special relative or authority"] = function parseSpecialRelativeOrAuthority(c) { - if (c === 47 && this.input[this.pointer + 1] === 47) { - this.state = "special authority ignore slashes"; - ++this.pointer; - } else { - this.parseError = true; - this.state = "relative"; - --this.pointer; - } - - return true; -}; - -URLStateMachine.prototype["parse path or authority"] = function parsePathOrAuthority(c) { - if (c === 47) { - this.state = "authority"; - } else { - this.state = "path"; - --this.pointer; - } - - return true; -}; - -URLStateMachine.prototype["parse relative"] = function parseRelative(c) { - this.url.scheme = this.base.scheme; - if (isNaN(c)) { - this.url.username = this.base.username; - this.url.password = this.base.password; - this.url.host = this.base.host; - this.url.port = this.base.port; - this.url.path = this.base.path.slice(); - this.url.query = this.base.query; - } else if (c === 47) { - this.state = "relative slash"; - } else if (c === 63) { - this.url.username = this.base.username; - this.url.password = this.base.password; - this.url.host = this.base.host; - this.url.port = this.base.port; - this.url.path = this.base.path.slice(); - this.url.query = ""; - this.state = "query"; - } else if (c === 35) { - this.url.username = this.base.username; - this.url.password = this.base.password; - this.url.host = this.base.host; - this.url.port = this.base.port; - this.url.path = this.base.path.slice(); - this.url.query = this.base.query; - this.url.fragment = ""; - this.state = "fragment"; - } else if (isSpecial(this.url) && c === 92) { - this.parseError = true; - this.state = "relative slash"; - } else { - this.url.username = this.base.username; - this.url.password = this.base.password; - this.url.host = this.base.host; - this.url.port = this.base.port; - this.url.path = this.base.path.slice(0, this.base.path.length - 1); - - this.state = "path"; - --this.pointer; - } - - return true; -}; - -URLStateMachine.prototype["parse relative slash"] = function parseRelativeSlash(c) { - if (isSpecial(this.url) && (c === 47 || c === 92)) { - if (c === 92) { - this.parseError = true; - } - this.state = "special authority ignore slashes"; - } else if (c === 47) { - this.state = "authority"; - } else { - this.url.username = this.base.username; - this.url.password = this.base.password; - this.url.host = this.base.host; - this.url.port = this.base.port; - this.state = "path"; - --this.pointer; - } - - return true; -}; - -URLStateMachine.prototype["parse special authority slashes"] = function parseSpecialAuthoritySlashes(c) { - if (c === 47 && this.input[this.pointer + 1] === 47) { - this.state = "special authority ignore slashes"; - ++this.pointer; - } else { - this.parseError = true; - this.state = "special authority ignore slashes"; - --this.pointer; - } - - return true; -}; - -URLStateMachine.prototype["parse special authority ignore slashes"] = function parseSpecialAuthorityIgnoreSlashes(c) { - if (c !== 47 && c !== 92) { - this.state = "authority"; - --this.pointer; - } else { - this.parseError = true; - } - - return true; -}; - -URLStateMachine.prototype["parse authority"] = function parseAuthority(c, cStr) { - if (c === 64) { - this.parseError = true; - if (this.atFlag) { - this.buffer = "%40" + this.buffer; - } - this.atFlag = true; - - // careful, this is based on buffer and has its own pointer (this.pointer != pointer) and inner chars - const len = countSymbols(this.buffer); - for (let pointer = 0; pointer < len; ++pointer) { - const codePoint = this.buffer.codePointAt(pointer); - - if (codePoint === 58 && !this.passwordTokenSeenFlag) { - this.passwordTokenSeenFlag = true; - continue; - } - const encodedCodePoints = percentEncodeChar(codePoint, isUserinfoPercentEncode); - if (this.passwordTokenSeenFlag) { - this.url.password += encodedCodePoints; - } else { - this.url.username += encodedCodePoints; - } - } - this.buffer = ""; - } else if (isNaN(c) || c === 47 || c === 63 || c === 35 || - (isSpecial(this.url) && c === 92)) { - if (this.atFlag && this.buffer === "") { - this.parseError = true; - return failure; - } - this.pointer -= countSymbols(this.buffer) + 1; - this.buffer = ""; - this.state = "host"; - } else { - this.buffer += cStr; - } - - return true; -}; - -URLStateMachine.prototype["parse hostname"] = -URLStateMachine.prototype["parse host"] = function parseHostName(c, cStr) { - if (this.stateOverride && this.url.scheme === "file") { - --this.pointer; - this.state = "file host"; - } else if (c === 58 && !this.arrFlag) { - if (this.buffer === "") { - this.parseError = true; - return failure; - } - - const host = parseHost(this.buffer, isSpecial(this.url)); - if (host === failure) { - return failure; - } - - this.url.host = host; - this.buffer = ""; - this.state = "port"; - if (this.stateOverride === "hostname") { - return false; - } - } else if (isNaN(c) || c === 47 || c === 63 || c === 35 || - (isSpecial(this.url) && c === 92)) { - --this.pointer; - if (isSpecial(this.url) && this.buffer === "") { - this.parseError = true; - return failure; - } else if (this.stateOverride && this.buffer === "" && - (includesCredentials(this.url) || this.url.port !== null)) { - this.parseError = true; - return false; - } - - const host = parseHost(this.buffer, isSpecial(this.url)); - if (host === failure) { - return failure; - } - - this.url.host = host; - this.buffer = ""; - this.state = "path start"; - if (this.stateOverride) { - return false; - } - } else { - if (c === 91) { - this.arrFlag = true; - } else if (c === 93) { - this.arrFlag = false; - } - this.buffer += cStr; - } - - return true; -}; - -URLStateMachine.prototype["parse port"] = function parsePort(c, cStr) { - if (isASCIIDigit(c)) { - this.buffer += cStr; - } else if (isNaN(c) || c === 47 || c === 63 || c === 35 || - (isSpecial(this.url) && c === 92) || - this.stateOverride) { - if (this.buffer !== "") { - const port = parseInt(this.buffer); - if (port > Math.pow(2, 16) - 1) { - this.parseError = true; - return failure; - } - this.url.port = port === defaultPort(this.url.scheme) ? null : port; - this.buffer = ""; - } - if (this.stateOverride) { - return false; - } - this.state = "path start"; - --this.pointer; - } else { - this.parseError = true; - return failure; - } - - return true; -}; - -const fileOtherwiseCodePoints = new Set([47, 92, 63, 35]); - -URLStateMachine.prototype["parse file"] = function parseFile(c) { - this.url.scheme = "file"; - - if (c === 47 || c === 92) { - if (c === 92) { - this.parseError = true; - } - this.state = "file slash"; - } else if (this.base !== null && this.base.scheme === "file") { - if (isNaN(c)) { - this.url.host = this.base.host; - this.url.path = this.base.path.slice(); - this.url.query = this.base.query; - } else if (c === 63) { - this.url.host = this.base.host; - this.url.path = this.base.path.slice(); - this.url.query = ""; - this.state = "query"; - } else if (c === 35) { - this.url.host = this.base.host; - this.url.path = this.base.path.slice(); - this.url.query = this.base.query; - this.url.fragment = ""; - this.state = "fragment"; - } else { - if (this.input.length - this.pointer - 1 === 0 || // remaining consists of 0 code points - !isWindowsDriveLetterCodePoints(c, this.input[this.pointer + 1]) || - (this.input.length - this.pointer - 1 >= 2 && // remaining has at least 2 code points - !fileOtherwiseCodePoints.has(this.input[this.pointer + 2]))) { - this.url.host = this.base.host; - this.url.path = this.base.path.slice(); - shortenPath(this.url); - } else { - this.parseError = true; - } - - this.state = "path"; - --this.pointer; - } - } else { - this.state = "path"; - --this.pointer; - } - - return true; -}; - -URLStateMachine.prototype["parse file slash"] = function parseFileSlash(c) { - if (c === 47 || c === 92) { - if (c === 92) { - this.parseError = true; - } - this.state = "file host"; - } else { - if (this.base !== null && this.base.scheme === "file") { - if (isNormalizedWindowsDriveLetterString(this.base.path[0])) { - this.url.path.push(this.base.path[0]); - } else { - this.url.host = this.base.host; - } - } - this.state = "path"; - --this.pointer; - } - - return true; -}; - -URLStateMachine.prototype["parse file host"] = function parseFileHost(c, cStr) { - if (isNaN(c) || c === 47 || c === 92 || c === 63 || c === 35) { - --this.pointer; - if (!this.stateOverride && isWindowsDriveLetterString(this.buffer)) { - this.parseError = true; - this.state = "path"; - } else if (this.buffer === "") { - this.url.host = ""; - if (this.stateOverride) { - return false; - } - this.state = "path start"; - } else { - let host = parseHost(this.buffer, isSpecial(this.url)); - if (host === failure) { - return failure; - } - if (host === "localhost") { - host = ""; - } - this.url.host = host; - - if (this.stateOverride) { - return false; - } - - this.buffer = ""; - this.state = "path start"; - } - } else { - this.buffer += cStr; - } - - return true; -}; - -URLStateMachine.prototype["parse path start"] = function parsePathStart(c) { - if (isSpecial(this.url)) { - if (c === 92) { - this.parseError = true; - } - this.state = "path"; - - if (c !== 47 && c !== 92) { - --this.pointer; - } - } else if (!this.stateOverride && c === 63) { - this.url.query = ""; - this.state = "query"; - } else if (!this.stateOverride && c === 35) { - this.url.fragment = ""; - this.state = "fragment"; - } else if (c !== undefined) { - this.state = "path"; - if (c !== 47) { - --this.pointer; - } - } - - return true; -}; - -URLStateMachine.prototype["parse path"] = function parsePath(c) { - if (isNaN(c) || c === 47 || (isSpecial(this.url) && c === 92) || - (!this.stateOverride && (c === 63 || c === 35))) { - if (isSpecial(this.url) && c === 92) { - this.parseError = true; - } - - if (isDoubleDot(this.buffer)) { - shortenPath(this.url); - if (c !== 47 && !(isSpecial(this.url) && c === 92)) { - this.url.path.push(""); - } - } else if (isSingleDot(this.buffer) && c !== 47 && - !(isSpecial(this.url) && c === 92)) { - this.url.path.push(""); - } else if (!isSingleDot(this.buffer)) { - if (this.url.scheme === "file" && this.url.path.length === 0 && isWindowsDriveLetterString(this.buffer)) { - if (this.url.host !== "" && this.url.host !== null) { - this.parseError = true; - this.url.host = ""; - } - this.buffer = this.buffer[0] + ":"; - } - this.url.path.push(this.buffer); - } - this.buffer = ""; - if (this.url.scheme === "file" && (c === undefined || c === 63 || c === 35)) { - while (this.url.path.length > 1 && this.url.path[0] === "") { - this.parseError = true; - this.url.path.shift(); - } - } - if (c === 63) { - this.url.query = ""; - this.state = "query"; - } - if (c === 35) { - this.url.fragment = ""; - this.state = "fragment"; - } - } else { - // TODO: If c is not a URL code point and not "%", parse error. - - if (c === 37 && - (!isASCIIHex(this.input[this.pointer + 1]) || - !isASCIIHex(this.input[this.pointer + 2]))) { - this.parseError = true; - } - - this.buffer += percentEncodeChar(c, isPathPercentEncode); - } - - return true; -}; - -URLStateMachine.prototype["parse cannot-be-a-base-URL path"] = function parseCannotBeABaseURLPath(c) { - if (c === 63) { - this.url.query = ""; - this.state = "query"; - } else if (c === 35) { - this.url.fragment = ""; - this.state = "fragment"; - } else { - // TODO: Add: not a URL code point - if (!isNaN(c) && c !== 37) { - this.parseError = true; - } - - if (c === 37 && - (!isASCIIHex(this.input[this.pointer + 1]) || - !isASCIIHex(this.input[this.pointer + 2]))) { - this.parseError = true; - } - - if (!isNaN(c)) { - this.url.path[0] = this.url.path[0] + percentEncodeChar(c, isC0ControlPercentEncode); - } - } - - return true; -}; - -URLStateMachine.prototype["parse query"] = function parseQuery(c, cStr) { - if (isNaN(c) || (!this.stateOverride && c === 35)) { - if (!isSpecial(this.url) || this.url.scheme === "ws" || this.url.scheme === "wss") { - this.encodingOverride = "utf-8"; - } - - const buffer = new Buffer(this.buffer); // TODO: Use encoding override instead - for (let i = 0; i < buffer.length; ++i) { - if (buffer[i] < 0x21 || buffer[i] > 0x7E || buffer[i] === 0x22 || buffer[i] === 0x23 || - buffer[i] === 0x3C || buffer[i] === 0x3E) { - this.url.query += percentEncode(buffer[i]); - } else { - this.url.query += String.fromCodePoint(buffer[i]); - } - } - - this.buffer = ""; - if (c === 35) { - this.url.fragment = ""; - this.state = "fragment"; - } - } else { - // TODO: If c is not a URL code point and not "%", parse error. - if (c === 37 && - (!isASCIIHex(this.input[this.pointer + 1]) || - !isASCIIHex(this.input[this.pointer + 2]))) { - this.parseError = true; - } - - this.buffer += cStr; - } - - return true; -}; - -URLStateMachine.prototype["parse fragment"] = function parseFragment(c) { - if (isNaN(c)) { // do nothing - } else if (c === 0x0) { - this.parseError = true; - } else { - // TODO: If c is not a URL code point and not "%", parse error. - if (c === 37 && - (!isASCIIHex(this.input[this.pointer + 1]) || - !isASCIIHex(this.input[this.pointer + 2]))) { - this.parseError = true; - } - - this.url.fragment += percentEncodeChar(c, isC0ControlPercentEncode); - } - - return true; -}; - -function serializeURL(url, excludeFragment) { - let output = url.scheme + ":"; - if (url.host !== null) { - output += "//"; - - if (url.username !== "" || url.password !== "") { - output += url.username; - if (url.password !== "") { - output += ":" + url.password; - } - output += "@"; - } - - output += serializeHost(url.host); - - if (url.port !== null) { - output += ":" + url.port; - } - } else if (url.host === null && url.scheme === "file") { - output += "//"; - } - - if (url.cannotBeABaseURL) { - output += url.path[0]; - } else { - for (const string of url.path) { - output += "/" + string; - } - } - - if (url.query !== null) { - output += "?" + url.query; - } - - if (!excludeFragment && url.fragment !== null) { - output += "#" + url.fragment; - } - - return output; -} - -function serializeOrigin(tuple) { - let result = tuple.scheme + "://"; - result += serializeHost(tuple.host); - - if (tuple.port !== null) { - result += ":" + tuple.port; - } - - return result; -} - -module.exports.serializeURL = serializeURL; - -module.exports.serializeURLOrigin = function (url) { - // https://url.spec.whatwg.org/#concept-url-origin - switch (url.scheme) { - case "blob": - try { - return module.exports.serializeURLOrigin(module.exports.parseURL(url.path[0])); - } catch (e) { - // serializing an opaque origin returns "null" - return "null"; - } - case "ftp": - case "gopher": - case "http": - case "https": - case "ws": - case "wss": - return serializeOrigin({ - scheme: url.scheme, - host: url.host, - port: url.port - }); - case "file": - // spec says "exercise to the reader", chrome says "file://" - return "file://"; - default: - // serializing an opaque origin returns "null" - return "null"; - } -}; - -module.exports.basicURLParse = function (input, options) { - if (options === undefined) { - options = {}; - } - - const usm = new URLStateMachine(input, options.baseURL, options.encodingOverride, options.url, options.stateOverride); - if (usm.failure) { - return "failure"; - } - - return usm.url; -}; - -module.exports.setTheUsername = function (url, username) { - url.username = ""; - const decoded = punycode.ucs2.decode(username); - for (let i = 0; i < decoded.length; ++i) { - url.username += percentEncodeChar(decoded[i], isUserinfoPercentEncode); - } -}; - -module.exports.setThePassword = function (url, password) { - url.password = ""; - const decoded = punycode.ucs2.decode(password); - for (let i = 0; i < decoded.length; ++i) { - url.password += percentEncodeChar(decoded[i], isUserinfoPercentEncode); - } -}; - -module.exports.serializeHost = serializeHost; - -module.exports.cannotHaveAUsernamePasswordPort = cannotHaveAUsernamePasswordPort; - -module.exports.serializeInteger = function (integer) { - return String(integer); -}; - -module.exports.parseURL = function (input, options) { - if (options === undefined) { - options = {}; - } - - // We don't handle blobs, so this just delegates: - return module.exports.basicURLParse(input, { baseURL: options.baseURL, encodingOverride: options.encodingOverride }); -}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/whatwg-url/lib/utils.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/whatwg-url/lib/utils.js deleted file mode 100644 index a562009c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/whatwg-url/lib/utils.js +++ /dev/null @@ -1,20 +0,0 @@ -"use strict"; - -module.exports.mixin = function mixin(target, source) { - const keys = Object.getOwnPropertyNames(source); - for (let i = 0; i < keys.length; ++i) { - Object.defineProperty(target, keys[i], Object.getOwnPropertyDescriptor(source, keys[i])); - } -}; - -module.exports.wrapperSymbol = Symbol("wrapper"); -module.exports.implSymbol = Symbol("impl"); - -module.exports.wrapperForImpl = function (impl) { - return impl[module.exports.wrapperSymbol]; -}; - -module.exports.implForWrapper = function (wrapper) { - return wrapper[module.exports.implSymbol]; -}; - diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/whatwg-url/package.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/whatwg-url/package.json deleted file mode 100644 index fce35ae7..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/whatwg-url/package.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "name": "whatwg-url", - "version": "5.0.0", - "description": "An implementation of the WHATWG URL Standard's URL API and parsing machinery", - "main": "lib/public-api.js", - "files": [ - "lib/" - ], - "author": "Sebastian Mayr ", - "license": "MIT", - "repository": "jsdom/whatwg-url", - "dependencies": { - "tr46": "~0.0.3", - "webidl-conversions": "^3.0.0" - }, - "devDependencies": { - "eslint": "^2.6.0", - "istanbul": "~0.4.3", - "mocha": "^2.2.4", - "recast": "~0.10.29", - "request": "^2.55.0", - "webidl2js": "^3.0.2" - }, - "scripts": { - "build": "node scripts/transform.js && node scripts/convert-idl.js", - "coverage": "istanbul cover node_modules/mocha/bin/_mocha", - "lint": "eslint .", - "prepublish": "npm run build", - "pretest": "node scripts/get-latest-platform-tests.js && npm run build", - "test": "mocha" - } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/word-wrap/LICENSE b/packages/wyatt_notification_bloc/example/scripts/node_modules/word-wrap/LICENSE deleted file mode 100644 index d734237b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/word-wrap/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014-2017, Jon Schlinkert - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/word-wrap/README.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/word-wrap/README.md deleted file mode 100644 index 88b96840..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/word-wrap/README.md +++ /dev/null @@ -1,182 +0,0 @@ -# word-wrap [![NPM version](https://img.shields.io/npm/v/word-wrap.svg?style=flat)](https://www.npmjs.com/package/word-wrap) [![NPM monthly downloads](https://img.shields.io/npm/dm/word-wrap.svg?style=flat)](https://npmjs.org/package/word-wrap) [![NPM total downloads](https://img.shields.io/npm/dt/word-wrap.svg?style=flat)](https://npmjs.org/package/word-wrap) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/word-wrap.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/word-wrap) - -> Wrap words to a specified length. - -## Install - -Install with [npm](https://www.npmjs.com/): - -```sh -$ npm install --save word-wrap -``` - -## Usage - -```js -var wrap = require('word-wrap'); - -wrap('Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.'); -``` - -Results in: - -``` - Lorem ipsum dolor sit amet, consectetur adipiscing - elit, sed do eiusmod tempor incididunt ut labore - et dolore magna aliqua. Ut enim ad minim veniam, - quis nostrud exercitation ullamco laboris nisi ut - aliquip ex ea commodo consequat. -``` - -## Options - -![image](https://cloud.githubusercontent.com/assets/383994/6543728/7a381c08-c4f6-11e4-8b7d-b6ba197569c9.png) - -### options.width - -Type: `Number` - -Default: `50` - -The width of the text before wrapping to a new line. - -**Example:** - -```js -wrap(str, {width: 60}); -``` - -### options.indent - -Type: `String` - -Default: `` (two spaces) - -The string to use at the beginning of each line. - -**Example:** - -```js -wrap(str, {indent: ' '}); -``` - -### options.newline - -Type: `String` - -Default: `\n` - -The string to use at the end of each line. - -**Example:** - -```js -wrap(str, {newline: '\n\n'}); -``` - -### options.escape - -Type: `function` - -Default: `function(str){return str;}` - -An escape function to run on each line after splitting them. - -**Example:** - -```js -var xmlescape = require('xml-escape'); -wrap(str, { - escape: function(string){ - return xmlescape(string); - } -}); -``` - -### options.trim - -Type: `Boolean` - -Default: `false` - -Trim trailing whitespace from the returned string. This option is included since `.trim()` would also strip the leading indentation from the first line. - -**Example:** - -```js -wrap(str, {trim: true}); -``` - -### options.cut - -Type: `Boolean` - -Default: `false` - -Break a word between any two letters when the word is longer than the specified width. - -**Example:** - -```js -wrap(str, {cut: true}); -``` - -## About - -### Related projects - -* [common-words](https://www.npmjs.com/package/common-words): Updated list (JSON) of the 100 most common words in the English language. Useful for… [more](https://github.com/jonschlinkert/common-words) | [homepage](https://github.com/jonschlinkert/common-words "Updated list (JSON) of the 100 most common words in the English language. Useful for excluding these words from arrays.") -* [shuffle-words](https://www.npmjs.com/package/shuffle-words): Shuffle the words in a string and optionally the letters in each word using the… [more](https://github.com/jonschlinkert/shuffle-words) | [homepage](https://github.com/jonschlinkert/shuffle-words "Shuffle the words in a string and optionally the letters in each word using the Fisher-Yates algorithm. Useful for creating test fixtures, benchmarking samples, etc.") -* [unique-words](https://www.npmjs.com/package/unique-words): Return the unique words in a string or array. | [homepage](https://github.com/jonschlinkert/unique-words "Return the unique words in a string or array.") -* [wordcount](https://www.npmjs.com/package/wordcount): Count the words in a string. Support for english, CJK and Cyrillic. | [homepage](https://github.com/jonschlinkert/wordcount "Count the words in a string. Support for english, CJK and Cyrillic.") - -### Contributing - -Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). - -### Contributors - -| **Commits** | **Contributor** | -| --- | --- | -| 43 | [jonschlinkert](https://github.com/jonschlinkert) | -| 2 | [lordvlad](https://github.com/lordvlad) | -| 2 | [hildjj](https://github.com/hildjj) | -| 1 | [danilosampaio](https://github.com/danilosampaio) | -| 1 | [2fd](https://github.com/2fd) | -| 1 | [toddself](https://github.com/toddself) | -| 1 | [wolfgang42](https://github.com/wolfgang42) | -| 1 | [zachhale](https://github.com/zachhale) | - -### Building docs - -_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ - -To generate the readme, run the following command: - -```sh -$ npm install -g verbose/verb#dev verb-generate-readme && verb -``` - -### Running tests - -Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: - -```sh -$ npm install && npm test -``` - -### Author - -**Jon Schlinkert** - -* [github/jonschlinkert](https://github.com/jonschlinkert) -* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) - -### License - -Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert). -Released under the [MIT License](LICENSE). - -*** - -_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on June 02, 2017._ \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/word-wrap/index.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/word-wrap/index.d.ts deleted file mode 100644 index 54ee5f26..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/word-wrap/index.d.ts +++ /dev/null @@ -1,50 +0,0 @@ -/** - * Wrap words to a specified length. - */ -export = wrap; - -declare function wrap(str: string, options?: wrap.IOptions): string; - -declare namespace wrap { - export interface IOptions { - - /** - * The width of the text before wrapping to a new line. - * @default ´50´ - */ - width?: number; - - /** - * The string to use at the beginning of each line. - * @default ´ ´ (two spaces) - */ - indent?: string; - - /** - * The string to use at the end of each line. - * @default ´\n´ - */ - newline?: string; - - /** - * An escape function to run on each line after splitting them. - * @default (str: string) => string; - */ - escape?: (str: string) => string; - - /** - * Trim trailing whitespace from the returned string. - * This option is included since .trim() would also strip - * the leading indentation from the first line. - * @default true - */ - trim?: boolean; - - /** - * Break a word between any two letters when the word is longer - * than the specified width. - * @default false - */ - cut?: boolean; - } -} \ No newline at end of file diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/word-wrap/index.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/word-wrap/index.js deleted file mode 100644 index 45373c6d..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/word-wrap/index.js +++ /dev/null @@ -1,46 +0,0 @@ -/*! - * word-wrap - * - * Copyright (c) 2014-2017, Jon Schlinkert. - * Released under the MIT License. - */ - -module.exports = function(str, options) { - options = options || {}; - if (str == null) { - return str; - } - - var width = options.width || 50; - var indent = (typeof options.indent === 'string') - ? options.indent - : ' '; - - var newline = options.newline || '\n' + indent; - var escape = typeof options.escape === 'function' - ? options.escape - : identity; - - var regexString = '.{1,' + width + '}'; - if (options.cut !== true) { - regexString += '([\\s\u200B]+|$)|[^\\s\u200B]+?([\\s\u200B]+|$)'; - } - - var re = new RegExp(regexString, 'g'); - var lines = str.match(re) || []; - var result = indent + lines.map(function(line) { - if (line.slice(-1) === '\n') { - line = line.slice(0, line.length - 1); - } - return escape(line); - }).join(newline); - - if (options.trim === true) { - result = result.replace(/[ \t]*$/gm, ''); - } - return result; -}; - -function identity(str) { - return str; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/word-wrap/package.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/word-wrap/package.json deleted file mode 100644 index 6f8f633c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/word-wrap/package.json +++ /dev/null @@ -1,77 +0,0 @@ -{ - "name": "word-wrap", - "description": "Wrap words to a specified length.", - "version": "1.2.3", - "homepage": "https://github.com/jonschlinkert/word-wrap", - "author": "Jon Schlinkert (https://github.com/jonschlinkert)", - "contributors": [ - "Danilo Sampaio (localhost:8080)", - "Fede Ramirez (https://2fd.github.io)", - "Joe Hildebrand (https://twitter.com/hildjj)", - "Jon Schlinkert (http://twitter.com/jonschlinkert)", - "Todd Kennedy (https://tck.io)", - "Waldemar Reusch (https://github.com/lordvlad)", - "Wolfgang Faust (http://www.linestarve.com)", - "Zach Hale (http://zachhale.com)" - ], - "repository": "jonschlinkert/word-wrap", - "bugs": { - "url": "https://github.com/jonschlinkert/word-wrap/issues" - }, - "license": "MIT", - "files": [ - "index.js", - "index.d.ts" - ], - "main": "index.js", - "engines": { - "node": ">=0.10.0" - }, - "scripts": { - "test": "mocha" - }, - "devDependencies": { - "gulp-format-md": "^0.1.11", - "mocha": "^3.2.0" - }, - "keywords": [ - "break", - "carriage", - "line", - "new-line", - "newline", - "return", - "soft", - "text", - "word", - "word-wrap", - "words", - "wrap" - ], - "typings": "index.d.ts", - "verb": { - "toc": false, - "layout": "default", - "tasks": [ - "readme" - ], - "plugins": [ - "gulp-format-md" - ], - "lint": { - "reflinks": true - }, - "related": { - "list": [ - "common-words", - "shuffle-words", - "unique-words", - "wordcount" - ] - }, - "reflinks": [ - "verb", - "verb-generate-readme" - ] - } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/wrap-ansi/index.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/wrap-ansi/index.js deleted file mode 100755 index d502255b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/wrap-ansi/index.js +++ /dev/null @@ -1,216 +0,0 @@ -'use strict'; -const stringWidth = require('string-width'); -const stripAnsi = require('strip-ansi'); -const ansiStyles = require('ansi-styles'); - -const ESCAPES = new Set([ - '\u001B', - '\u009B' -]); - -const END_CODE = 39; - -const ANSI_ESCAPE_BELL = '\u0007'; -const ANSI_CSI = '['; -const ANSI_OSC = ']'; -const ANSI_SGR_TERMINATOR = 'm'; -const ANSI_ESCAPE_LINK = `${ANSI_OSC}8;;`; - -const wrapAnsi = code => `${ESCAPES.values().next().value}${ANSI_CSI}${code}${ANSI_SGR_TERMINATOR}`; -const wrapAnsiHyperlink = uri => `${ESCAPES.values().next().value}${ANSI_ESCAPE_LINK}${uri}${ANSI_ESCAPE_BELL}`; - -// Calculate the length of words split on ' ', ignoring -// the extra characters added by ansi escape codes -const wordLengths = string => string.split(' ').map(character => stringWidth(character)); - -// Wrap a long word across multiple rows -// Ansi escape codes do not count towards length -const wrapWord = (rows, word, columns) => { - const characters = [...word]; - - let isInsideEscape = false; - let isInsideLinkEscape = false; - let visible = stringWidth(stripAnsi(rows[rows.length - 1])); - - for (const [index, character] of characters.entries()) { - const characterLength = stringWidth(character); - - if (visible + characterLength <= columns) { - rows[rows.length - 1] += character; - } else { - rows.push(character); - visible = 0; - } - - if (ESCAPES.has(character)) { - isInsideEscape = true; - isInsideLinkEscape = characters.slice(index + 1).join('').startsWith(ANSI_ESCAPE_LINK); - } - - if (isInsideEscape) { - if (isInsideLinkEscape) { - if (character === ANSI_ESCAPE_BELL) { - isInsideEscape = false; - isInsideLinkEscape = false; - } - } else if (character === ANSI_SGR_TERMINATOR) { - isInsideEscape = false; - } - - continue; - } - - visible += characterLength; - - if (visible === columns && index < characters.length - 1) { - rows.push(''); - visible = 0; - } - } - - // It's possible that the last row we copy over is only - // ansi escape characters, handle this edge-case - if (!visible && rows[rows.length - 1].length > 0 && rows.length > 1) { - rows[rows.length - 2] += rows.pop(); - } -}; - -// Trims spaces from a string ignoring invisible sequences -const stringVisibleTrimSpacesRight = string => { - const words = string.split(' '); - let last = words.length; - - while (last > 0) { - if (stringWidth(words[last - 1]) > 0) { - break; - } - - last--; - } - - if (last === words.length) { - return string; - } - - return words.slice(0, last).join(' ') + words.slice(last).join(''); -}; - -// The wrap-ansi module can be invoked in either 'hard' or 'soft' wrap mode -// -// 'hard' will never allow a string to take up more than columns characters -// -// 'soft' allows long words to expand past the column length -const exec = (string, columns, options = {}) => { - if (options.trim !== false && string.trim() === '') { - return ''; - } - - let returnValue = ''; - let escapeCode; - let escapeUrl; - - const lengths = wordLengths(string); - let rows = ['']; - - for (const [index, word] of string.split(' ').entries()) { - if (options.trim !== false) { - rows[rows.length - 1] = rows[rows.length - 1].trimStart(); - } - - let rowLength = stringWidth(rows[rows.length - 1]); - - if (index !== 0) { - if (rowLength >= columns && (options.wordWrap === false || options.trim === false)) { - // If we start with a new word but the current row length equals the length of the columns, add a new row - rows.push(''); - rowLength = 0; - } - - if (rowLength > 0 || options.trim === false) { - rows[rows.length - 1] += ' '; - rowLength++; - } - } - - // In 'hard' wrap mode, the length of a line is never allowed to extend past 'columns' - if (options.hard && lengths[index] > columns) { - const remainingColumns = (columns - rowLength); - const breaksStartingThisLine = 1 + Math.floor((lengths[index] - remainingColumns - 1) / columns); - const breaksStartingNextLine = Math.floor((lengths[index] - 1) / columns); - if (breaksStartingNextLine < breaksStartingThisLine) { - rows.push(''); - } - - wrapWord(rows, word, columns); - continue; - } - - if (rowLength + lengths[index] > columns && rowLength > 0 && lengths[index] > 0) { - if (options.wordWrap === false && rowLength < columns) { - wrapWord(rows, word, columns); - continue; - } - - rows.push(''); - } - - if (rowLength + lengths[index] > columns && options.wordWrap === false) { - wrapWord(rows, word, columns); - continue; - } - - rows[rows.length - 1] += word; - } - - if (options.trim !== false) { - rows = rows.map(stringVisibleTrimSpacesRight); - } - - const pre = [...rows.join('\n')]; - - for (const [index, character] of pre.entries()) { - returnValue += character; - - if (ESCAPES.has(character)) { - const {groups} = new RegExp(`(?:\\${ANSI_CSI}(?\\d+)m|\\${ANSI_ESCAPE_LINK}(?.*)${ANSI_ESCAPE_BELL})`).exec(pre.slice(index).join('')) || {groups: {}}; - if (groups.code !== undefined) { - const code = Number.parseFloat(groups.code); - escapeCode = code === END_CODE ? undefined : code; - } else if (groups.uri !== undefined) { - escapeUrl = groups.uri.length === 0 ? undefined : groups.uri; - } - } - - const code = ansiStyles.codes.get(Number(escapeCode)); - - if (pre[index + 1] === '\n') { - if (escapeUrl) { - returnValue += wrapAnsiHyperlink(''); - } - - if (escapeCode && code) { - returnValue += wrapAnsi(code); - } - } else if (character === '\n') { - if (escapeCode && code) { - returnValue += wrapAnsi(escapeCode); - } - - if (escapeUrl) { - returnValue += wrapAnsiHyperlink(escapeUrl); - } - } - } - - return returnValue; -}; - -// For each newline, invoke the method separately -module.exports = (string, columns, options) => { - return String(string) - .normalize() - .replace(/\r\n/g, '\n') - .split('\n') - .map(line => exec(line, columns, options)) - .join('\n'); -}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/wrap-ansi/license b/packages/wyatt_notification_bloc/example/scripts/node_modules/wrap-ansi/license deleted file mode 100644 index fa7ceba3..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/wrap-ansi/license +++ /dev/null @@ -1,9 +0,0 @@ -MIT License - -Copyright (c) Sindre Sorhus (https://sindresorhus.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/wrap-ansi/package.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/wrap-ansi/package.json deleted file mode 100644 index dfb2f4f1..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/wrap-ansi/package.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "name": "wrap-ansi", - "version": "7.0.0", - "description": "Wordwrap a string with ANSI escape codes", - "license": "MIT", - "repository": "chalk/wrap-ansi", - "funding": "https://github.com/chalk/wrap-ansi?sponsor=1", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "https://sindresorhus.com" - }, - "engines": { - "node": ">=10" - }, - "scripts": { - "test": "xo && nyc ava" - }, - "files": [ - "index.js" - ], - "keywords": [ - "wrap", - "break", - "wordwrap", - "wordbreak", - "linewrap", - "ansi", - "styles", - "color", - "colour", - "colors", - "terminal", - "console", - "cli", - "string", - "tty", - "escape", - "formatting", - "rgb", - "256", - "shell", - "xterm", - "log", - "logging", - "command-line", - "text" - ], - "dependencies": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - }, - "devDependencies": { - "ava": "^2.1.0", - "chalk": "^4.0.0", - "coveralls": "^3.0.3", - "has-ansi": "^4.0.0", - "nyc": "^15.0.1", - "xo": "^0.29.1" - } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/wrap-ansi/readme.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/wrap-ansi/readme.md deleted file mode 100644 index 68779ba5..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/wrap-ansi/readme.md +++ /dev/null @@ -1,91 +0,0 @@ -# wrap-ansi [![Build Status](https://travis-ci.com/chalk/wrap-ansi.svg?branch=master)](https://travis-ci.com/chalk/wrap-ansi) [![Coverage Status](https://coveralls.io/repos/github/chalk/wrap-ansi/badge.svg?branch=master)](https://coveralls.io/github/chalk/wrap-ansi?branch=master) - -> Wordwrap a string with [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code#Colors_and_Styles) - -## Install - -``` -$ npm install wrap-ansi -``` - -## Usage - -```js -const chalk = require('chalk'); -const wrapAnsi = require('wrap-ansi'); - -const input = 'The quick brown ' + chalk.red('fox jumped over ') + - 'the lazy ' + chalk.green('dog and then ran away with the unicorn.'); - -console.log(wrapAnsi(input, 20)); -``` - - - -## API - -### wrapAnsi(string, columns, options?) - -Wrap words to the specified column width. - -#### string - -Type: `string` - -String with ANSI escape codes. Like one styled by [`chalk`](https://github.com/chalk/chalk). Newline characters will be normalized to `\n`. - -#### columns - -Type: `number` - -Number of columns to wrap the text to. - -#### options - -Type: `object` - -##### hard - -Type: `boolean`\ -Default: `false` - -By default the wrap is soft, meaning long words may extend past the column width. Setting this to `true` will make it hard wrap at the column width. - -##### wordWrap - -Type: `boolean`\ -Default: `true` - -By default, an attempt is made to split words at spaces, ensuring that they don't extend past the configured columns. If wordWrap is `false`, each column will instead be completely filled splitting words as necessary. - -##### trim - -Type: `boolean`\ -Default: `true` - -Whitespace on all lines is removed by default. Set this option to `false` if you don't want to trim. - -## Related - -- [slice-ansi](https://github.com/chalk/slice-ansi) - Slice a string with ANSI escape codes -- [cli-truncate](https://github.com/sindresorhus/cli-truncate) - Truncate a string to a specific width in the terminal -- [chalk](https://github.com/chalk/chalk) - Terminal string styling done right -- [jsesc](https://github.com/mathiasbynens/jsesc) - Generate ASCII-only output from Unicode strings. Useful for creating test fixtures. - -## Maintainers - -- [Sindre Sorhus](https://github.com/sindresorhus) -- [Josh Junon](https://github.com/qix-) -- [Benjamin Coe](https://github.com/bcoe) - ---- - -
    - - Get professional support for this package with a Tidelift subscription - -
    - - Tidelift helps make open source sustainable for maintainers while giving companies
    assurances about security, maintenance, and licensing for their dependencies. -
    -
    diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/wrappy/LICENSE b/packages/wyatt_notification_bloc/example/scripts/node_modules/wrappy/LICENSE deleted file mode 100644 index 19129e31..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/wrappy/LICENSE +++ /dev/null @@ -1,15 +0,0 @@ -The ISC License - -Copyright (c) Isaac Z. Schlueter and Contributors - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR -IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/wrappy/README.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/wrappy/README.md deleted file mode 100644 index 98eab252..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/wrappy/README.md +++ /dev/null @@ -1,36 +0,0 @@ -# wrappy - -Callback wrapping utility - -## USAGE - -```javascript -var wrappy = require("wrappy") - -// var wrapper = wrappy(wrapperFunction) - -// make sure a cb is called only once -// See also: http://npm.im/once for this specific use case -var once = wrappy(function (cb) { - var called = false - return function () { - if (called) return - called = true - return cb.apply(this, arguments) - } -}) - -function printBoo () { - console.log('boo') -} -// has some rando property -printBoo.iAmBooPrinter = true - -var onlyPrintOnce = once(printBoo) - -onlyPrintOnce() // prints 'boo' -onlyPrintOnce() // does nothing - -// random property is retained! -assert.equal(onlyPrintOnce.iAmBooPrinter, true) -``` diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/wrappy/package.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/wrappy/package.json deleted file mode 100644 index 13075204..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/wrappy/package.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "name": "wrappy", - "version": "1.0.2", - "description": "Callback wrapping utility", - "main": "wrappy.js", - "files": [ - "wrappy.js" - ], - "directories": { - "test": "test" - }, - "dependencies": {}, - "devDependencies": { - "tap": "^2.3.1" - }, - "scripts": { - "test": "tap --coverage test/*.js" - }, - "repository": { - "type": "git", - "url": "https://github.com/npm/wrappy" - }, - "author": "Isaac Z. Schlueter (http://blog.izs.me/)", - "license": "ISC", - "bugs": { - "url": "https://github.com/npm/wrappy/issues" - }, - "homepage": "https://github.com/npm/wrappy" -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/wrappy/wrappy.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/wrappy/wrappy.js deleted file mode 100644 index bb7e7d6f..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/wrappy/wrappy.js +++ /dev/null @@ -1,33 +0,0 @@ -// Returns a wrapper function that returns a wrapped callback -// The wrapper function should do some stuff, and return a -// presumably different callback function. -// This makes sure that own properties are retained, so that -// decorations and such are not lost along the way. -module.exports = wrappy -function wrappy (fn, cb) { - if (fn && cb) return wrappy(fn)(cb) - - if (typeof fn !== 'function') - throw new TypeError('need wrapper function') - - Object.keys(fn).forEach(function (k) { - wrapper[k] = fn[k] - }) - - return wrapper - - function wrapper() { - var args = new Array(arguments.length) - for (var i = 0; i < args.length; i++) { - args[i] = arguments[i] - } - var ret = fn.apply(this, args) - var cb = args[args.length-1] - if (typeof ret === 'function' && ret !== cb) { - Object.keys(cb).forEach(function (k) { - ret[k] = cb[k] - }) - } - return ret - } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/CHANGES.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/CHANGES.md deleted file mode 100644 index 402032c8..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/CHANGES.md +++ /dev/null @@ -1,53 +0,0 @@ -## 2.0.4 ## - -* Update dependencies -* Bug fixes - -## 2.0.3 ## - -* Bug fixes - -## 2.0.2 ## - -* Update dependencies -* Use ESLint instead of TSLint -* Use npm instead of gulp - -## 2.0.1 ## - -* Bug fixes - -## 2.0.0 ## - -* API rewrite and simplification -* Add option to use self-closing tags if an element is empty -* Stop indenting multi-line strings -* Add option to automatically fix strings that are not valid XML in certain - cases -* More detailed error messages -* Other bug fixes - -## 1.0.2 ## - -* Bug fixes - -## 1.0.1 ## - -* Documentation fixes - -## 1.0.0 ## - -* Add null and undefined in type declarations -* Replace `XmlText` with `XmlCharData` and `XmlAttributeText` to reflect - differences in what characters are acceptable in attribute values versus - character data - -## 0.1.1 ## - -* Re-write in TypeScript -* Remove expensive dependencies (especially babel-runtime) -* Bug fixes and documentation fixes - -## 0.1.0 ## - -* Initial release diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/LICENSE b/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/LICENSE deleted file mode 100644 index 29f81d81..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/NOTICE b/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/NOTICE deleted file mode 100644 index 6eb66f1c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/NOTICE +++ /dev/null @@ -1,2 +0,0 @@ -xmlcreate -Copyright (C) 2016-2021 Michael Kourlas diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/README.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/README.md deleted file mode 100644 index 79d5d5f9..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/README.md +++ /dev/null @@ -1,141 +0,0 @@ -# xmlcreate # - -[![Node.js CI](https://github.com/michaelkourlas/node-xmlcreate/actions/workflows/node.js.yml/badge.svg)](https://github.com/michaelkourlas/node-xmlcreate/actions/workflows/node.js.yml) -[![npm version](https://badge.fury.io/js/xmlcreate.svg)](https://badge.fury.io/js/xmlcreate) - -## Overview ## - -xmlcreate is a Node.js module that can be used to build XML using a simple API. - -## Features ## - -xmlcreate allows you to use a series of chained function calls to build an XML -tree. - -Once the tree is built, it can be serialized to text. The formatting of the -text is customizable. - -xmlcreate can perform some basic validation to check that the resulting XML -is well-formed. - -## Installation ## - -The easiest way to install xmlcreate is using npm: - -``` -npm install xmlcreate -``` - -You can also build xmlcreate from source using npm: - -``` -git clone https://github.com/michaelkourlas/node-xmlcreate.git -npm install -npm run-script build -``` - -The `build` script will build the production variant of xmlcreate, run all -tests, and build the documentation. - -You can build the production variant without running tests using the script -`prod`. You can also build the development version using the script `dev`. -The only difference between the two is that the development version includes -source maps. - -## Usage ## - -The documentation for the current version is available [here](http://www.kourlas.com/node-xmlcreate/docs/2.0.4/). - -You can also build the documentation using npm: - -``` -npm run-script docs -``` - -## Examples ## - -The following TypeScript example illustrates the basic usage of xmlcreate: - -```typescript -import {document} from "xmlcreate"; - -const tree = document(); -tree - .decl({encoding: "UTF-8"}) - .up() - .dtd({ - name: "html", - pubId: "-//W3C//DTD XHTML 1.0 Strict//EN", - sysId: "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" - }) - .up() - .element({name: "html"}) - .attribute({name: "xmlns"}) - .text({charData: "http://www.w3.org/1999/xhtml"}) - .up() - .up() - .attribute({name: "xml:lang"}) - .text({charData: "en"}) - .up() - .up() - .element({name: "head"}) - .element({name: "title"}) - .charData({charData: "My page title"}) - .up() - .up() - .up() - .element({name: "body"}) - .element({name: "h1"}) - .charData({charData: "Welcome!"}) - .up() - .up() - .element({name: "p"}) - .charData({charData: "This is some text on my website."}) - .up() - .up() - .element({name: "div"}) - .element({name: "img"}) - .attribute({name: "src"}) - .text({charData: "picture.png"}) - .up() - .up() - .attribute({name: "alt"}) - .text({charData: "picture"}).up().up().up().up().up(); - -console.log(tree.toString({doubleQuotes: true})); -``` - -This example produces the following XML: - -```xml - - - - - My page title - - -

    Welcome!

    -

    This is some text on my website.

    - - -``` - -A JavaScript version of this example can be found in the examples directory. - -## Tests ## - -xmlcreate includes a set of tests to verify core functionality. You can run -the tests using npm: - -``` -npm run-script test-prod -``` - -The only difference between the `test-prod` and `test-dev` scripts is that the -development version includes source maps. - -## License ## - -xmlcreate is licensed under the [Apache License 2.0](http://www.apache.org/licenses/LICENSE-2.0). -Please see the LICENSE file for more information. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/error.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/error.d.ts deleted file mode 100644 index b15ede28..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/error.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -/** - * Copyright (C) 2019 Michael Kourlas - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Returns a context string for the specified node, for use in error messages. - */ -export declare function getContext(obj: unknown): string; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/error.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/error.js deleted file mode 100644 index a7506765..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/error.js +++ /dev/null @@ -1,47 +0,0 @@ -"use strict"; -/** - * Copyright (C) 2019 Michael Kourlas - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.getContext = void 0; -var XmlAttribute_1 = __importDefault(require("./nodes/XmlAttribute")); -var XmlDocument_1 = __importDefault(require("./nodes/XmlDocument")); -var XmlDtd_1 = __importDefault(require("./nodes/XmlDtd")); -var XmlElement_1 = __importDefault(require("./nodes/XmlElement")); -/** - * Returns a context string for the specified node, for use in error messages. - */ -function getContext(obj) { - if (obj instanceof XmlAttribute_1.default) { - return getContext(obj.up()) + (" > attribute \"" + obj.name + "\""); - } - else if (obj instanceof XmlDocument_1.default) { - return "in XML document"; - } - else if (obj instanceof XmlDtd_1.default) { - return getContext(obj.up()) + " > DTD"; - } - else if (obj instanceof XmlElement_1.default) { - return getContext(obj.up()) + (" > element \"" + obj.name + "\""); - } - else { - throw new Error("Unrecognized object of type " - + Object.prototype.toString.call(obj)); - } -} -exports.getContext = getContext; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/escape.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/escape.d.ts deleted file mode 100644 index 9f4dc101..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/escape.d.ts +++ /dev/null @@ -1,37 +0,0 @@ -/** - * Copyright (C) 2016-2018 Michael Kourlas - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Replaces ampersands (&) with the appropriate XML character reference. - */ -export declare function escapeAmpersands(str: string): string; -/** - * Replaces left angle brackets (<) with the appropriate XML character - * reference. - */ -export declare function escapeLeftAngleBrackets(str: string): string; -/** - * Replaces right angle brackets (>) with the appropriate XML character - * reference when part of the string "]]>". - */ -export declare function escapeRightAngleBracketsInCdataTerminator(str: string): string; -/** - * Replaces single quotes (") with the appropriate XML character reference. - */ -export declare function escapeSingleQuotes(str: string): string; -/** - * Replaces double quotes (") with the appropriate XML character reference. - */ -export declare function escapeDoubleQuotes(str: string): string; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/escape.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/escape.js deleted file mode 100644 index 2335c0a6..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/escape.js +++ /dev/null @@ -1,55 +0,0 @@ -"use strict"; -/** - * Copyright (C) 2016-2018 Michael Kourlas - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.escapeDoubleQuotes = exports.escapeSingleQuotes = exports.escapeRightAngleBracketsInCdataTerminator = exports.escapeLeftAngleBrackets = exports.escapeAmpersands = void 0; -/** - * Replaces ampersands (&) with the appropriate XML character reference. - */ -function escapeAmpersands(str) { - return str.replace(/&/g, "&"); -} -exports.escapeAmpersands = escapeAmpersands; -/** - * Replaces left angle brackets (<) with the appropriate XML character - * reference. - */ -function escapeLeftAngleBrackets(str) { - return str.replace(/". - */ -function escapeRightAngleBracketsInCdataTerminator(str) { - return str.replace(/]]>/g, "]]>"); -} -exports.escapeRightAngleBracketsInCdataTerminator = escapeRightAngleBracketsInCdataTerminator; -/** - * Replaces single quotes (") with the appropriate XML character reference. - */ -function escapeSingleQuotes(str) { - return str.replace(/'/g, "'"); -} -exports.escapeSingleQuotes = escapeSingleQuotes; -/** - * Replaces double quotes (") with the appropriate XML character reference. - */ -function escapeDoubleQuotes(str) { - return str.replace(/"/g, """); -} -exports.escapeDoubleQuotes = escapeDoubleQuotes; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/main.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/main.d.ts deleted file mode 100644 index 83ea5b34..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/main.d.ts +++ /dev/null @@ -1,38 +0,0 @@ -/** - * Copyright (C) 2016-2019 Michael Kourlas - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import XmlDocument, { IXmlDocumentOptions } from "./nodes/XmlDocument"; -export { default as XmlAttribute, IXmlAttributeOptions } from "./nodes/XmlAttribute"; -export { default as XmlAttributeText, IXmlAttributeTextOptions } from "./nodes/XmlAttributeText"; -export { default as XmlCdata, IXmlCdataOptions } from "./nodes/XmlCdata"; -export { default as XmlCharData, IXmlCharDataOptions } from "./nodes/XmlCharData"; -export { default as XmlCharRef, IXmlCharRefOptions } from "./nodes/XmlCharRef"; -export { default as XmlComment, IXmlCommentOptions } from "./nodes/XmlComment"; -export { default as XmlDecl, IXmlDeclOptions } from "./nodes/XmlDecl"; -export { default as XmlDocument, IXmlDocumentOptions } from "./nodes/XmlDocument"; -export { default as XmlDtd, IXmlDtdOptions } from "./nodes/XmlDtd"; -export { default as XmlDtdAttlist, IXmlDtdAttlistOptions } from "./nodes/XmlDtdAttlist"; -export { default as XmlDtdElement, IXmlDtdElementOptions } from "./nodes/XmlDtdElement"; -export { default as XmlDtdEntity, IXmlDtdEntityOptions } from "./nodes/XmlDtdEntity"; -export { default as XmlDtdNotation, IXmlDtdNotationOptions } from "./nodes/XmlDtdNotation"; -export { default as XmlDtdParamEntityRef, IXmlDtdParamEntityRefOptions } from "./nodes/XmlDtdParamEntityRef"; -export { default as XmlElement, IXmlElementOptions } from "./nodes/XmlElement"; -export { default as XmlEntityRef, IXmlEntityRefOptions } from "./nodes/XmlEntityRef"; -export { default as XmlProcInst, IXmlProcInstOptions } from "./nodes/XmlProcInst"; -export { IStringOptions } from "./options"; -/** - * Returns a new XML document with the specified options. - */ -export declare function document(options?: IXmlDocumentOptions): XmlDocument; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/main.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/main.js deleted file mode 100644 index 85e7cbd9..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/main.js +++ /dev/null @@ -1,64 +0,0 @@ -"use strict"; -/** - * Copyright (C) 2016-2019 Michael Kourlas - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.document = exports.XmlProcInst = exports.XmlEntityRef = exports.XmlElement = exports.XmlDtdParamEntityRef = exports.XmlDtdNotation = exports.XmlDtdEntity = exports.XmlDtdElement = exports.XmlDtdAttlist = exports.XmlDtd = exports.XmlDocument = exports.XmlDecl = exports.XmlComment = exports.XmlCharRef = exports.XmlCharData = exports.XmlCdata = exports.XmlAttributeText = exports.XmlAttribute = void 0; -var XmlDocument_1 = __importDefault(require("./nodes/XmlDocument")); -var XmlAttribute_1 = require("./nodes/XmlAttribute"); -Object.defineProperty(exports, "XmlAttribute", { enumerable: true, get: function () { return __importDefault(XmlAttribute_1).default; } }); -var XmlAttributeText_1 = require("./nodes/XmlAttributeText"); -Object.defineProperty(exports, "XmlAttributeText", { enumerable: true, get: function () { return __importDefault(XmlAttributeText_1).default; } }); -var XmlCdata_1 = require("./nodes/XmlCdata"); -Object.defineProperty(exports, "XmlCdata", { enumerable: true, get: function () { return __importDefault(XmlCdata_1).default; } }); -var XmlCharData_1 = require("./nodes/XmlCharData"); -Object.defineProperty(exports, "XmlCharData", { enumerable: true, get: function () { return __importDefault(XmlCharData_1).default; } }); -var XmlCharRef_1 = require("./nodes/XmlCharRef"); -Object.defineProperty(exports, "XmlCharRef", { enumerable: true, get: function () { return __importDefault(XmlCharRef_1).default; } }); -var XmlComment_1 = require("./nodes/XmlComment"); -Object.defineProperty(exports, "XmlComment", { enumerable: true, get: function () { return __importDefault(XmlComment_1).default; } }); -var XmlDecl_1 = require("./nodes/XmlDecl"); -Object.defineProperty(exports, "XmlDecl", { enumerable: true, get: function () { return __importDefault(XmlDecl_1).default; } }); -var XmlDocument_2 = require("./nodes/XmlDocument"); -Object.defineProperty(exports, "XmlDocument", { enumerable: true, get: function () { return __importDefault(XmlDocument_2).default; } }); -var XmlDtd_1 = require("./nodes/XmlDtd"); -Object.defineProperty(exports, "XmlDtd", { enumerable: true, get: function () { return __importDefault(XmlDtd_1).default; } }); -var XmlDtdAttlist_1 = require("./nodes/XmlDtdAttlist"); -Object.defineProperty(exports, "XmlDtdAttlist", { enumerable: true, get: function () { return __importDefault(XmlDtdAttlist_1).default; } }); -var XmlDtdElement_1 = require("./nodes/XmlDtdElement"); -Object.defineProperty(exports, "XmlDtdElement", { enumerable: true, get: function () { return __importDefault(XmlDtdElement_1).default; } }); -var XmlDtdEntity_1 = require("./nodes/XmlDtdEntity"); -Object.defineProperty(exports, "XmlDtdEntity", { enumerable: true, get: function () { return __importDefault(XmlDtdEntity_1).default; } }); -var XmlDtdNotation_1 = require("./nodes/XmlDtdNotation"); -Object.defineProperty(exports, "XmlDtdNotation", { enumerable: true, get: function () { return __importDefault(XmlDtdNotation_1).default; } }); -var XmlDtdParamEntityRef_1 = require("./nodes/XmlDtdParamEntityRef"); -Object.defineProperty(exports, "XmlDtdParamEntityRef", { enumerable: true, get: function () { return __importDefault(XmlDtdParamEntityRef_1).default; } }); -var XmlElement_1 = require("./nodes/XmlElement"); -Object.defineProperty(exports, "XmlElement", { enumerable: true, get: function () { return __importDefault(XmlElement_1).default; } }); -var XmlEntityRef_1 = require("./nodes/XmlEntityRef"); -Object.defineProperty(exports, "XmlEntityRef", { enumerable: true, get: function () { return __importDefault(XmlEntityRef_1).default; } }); -var XmlProcInst_1 = require("./nodes/XmlProcInst"); -Object.defineProperty(exports, "XmlProcInst", { enumerable: true, get: function () { return __importDefault(XmlProcInst_1).default; } }); -/** - * Returns a new XML document with the specified options. - */ -function document(options) { - if (options === void 0) { options = {}; } - return new XmlDocument_1.default(options); -} -exports.document = document; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/nodes/XmlAttribute.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/nodes/XmlAttribute.d.ts deleted file mode 100644 index a6e7981e..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/nodes/XmlAttribute.d.ts +++ /dev/null @@ -1,88 +0,0 @@ -/** - * Copyright (C) 2016-2019 Michael Kourlas - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { IStringOptions } from "../options"; -import XmlAttributeText, { IXmlAttributeTextOptions } from "./XmlAttributeText"; -import XmlCharRef, { IXmlCharRefOptions } from "./XmlCharRef"; -import XmlEntityRef, { IXmlEntityRefOptions } from "./XmlEntityRef"; -/** - * The options used to create a new attribute. - */ -export interface IXmlAttributeOptions { - /** - * The name of the attribute. - */ - name: string; - /** - * Whether to replace any invalid characters in the name of the attribute - * with the Unicode replacement character. By default, this is disabled. - */ - replaceInvalidCharsInName?: boolean; -} -/** - * Represents an attribute. - * - * An attribute is part of the start tag of an element and is - * structured as follows, where `{name}` is the name of the attribute and - * `{value}` is the value of the attribute: - * - * ```xml - * - * ``` - * - * The `{name}` value is a property of this node, while the `{value}` property - * consists of the children of this node. - * - * Attributes can have an unlimited number of attribute text, character - * references, and entity references. - */ -export default class XmlAttribute { - private readonly _children; - private readonly _replaceInvalidCharsInName; - private readonly _parent; - private readonly _validation; - private _name; - constructor(parent: Parent, validation: boolean, options: IXmlAttributeOptions); - /** - * Gets the name of this attribute. - */ - get name(): string; - /** - * Sets the name of this attribute. - */ - set name(name: string); - /** - * Adds a character reference to this attribute and returns the new - * character reference. - */ - charRef(options: IXmlCharRefOptions): XmlCharRef; - /** - * Adds an entity reference to this attribute and returns the new entity - * reference. - */ - entityRef(options: IXmlEntityRefOptions): XmlEntityRef; - /** - * Adds attribute text to this attribute and returns the new text. - */ - text(options: IXmlAttributeTextOptions): XmlAttributeText; - /** - * Returns an XML string representation of this attribute. - */ - toString(options?: IStringOptions): string; - /** - * Returns the parent of this attribute. - */ - up(): Parent; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/nodes/XmlAttribute.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/nodes/XmlAttribute.js deleted file mode 100644 index 4563b62d..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/nodes/XmlAttribute.js +++ /dev/null @@ -1,146 +0,0 @@ -"use strict"; -/** - * Copyright (C) 2016-2019 Michael Kourlas - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -var error_1 = require("../error"); -var escape_1 = require("../escape"); -var options_1 = require("../options"); -var validate_1 = require("../validate"); -var XmlAttributeText_1 = __importDefault(require("./XmlAttributeText")); -var XmlCharRef_1 = __importDefault(require("./XmlCharRef")); -var XmlEntityRef_1 = __importDefault(require("./XmlEntityRef")); -/** - * Represents an attribute. - * - * An attribute is part of the start tag of an element and is - * structured as follows, where `{name}` is the name of the attribute and - * `{value}` is the value of the attribute: - * - * ```xml - * - * ``` - * - * The `{name}` value is a property of this node, while the `{value}` property - * consists of the children of this node. - * - * Attributes can have an unlimited number of attribute text, character - * references, and entity references. - */ -var XmlAttribute = /** @class */ (function () { - function XmlAttribute(parent, validation, options) { - this._validation = validation; - if (!(0, validate_1.isUndefined)(options.replaceInvalidCharsInName)) { - this._replaceInvalidCharsInName = options.replaceInvalidCharsInName; - } - else { - this._replaceInvalidCharsInName = false; - } - this._children = []; - this._parent = parent; - this.name = options.name; - } - Object.defineProperty(XmlAttribute.prototype, "name", { - /** - * Gets the name of this attribute. - */ - get: function () { - return this._name; - }, - /** - * Sets the name of this attribute. - */ - set: function (name) { - if (this._replaceInvalidCharsInName) { - name = (0, validate_1.fixName)(name); - if (name.length === 0) { - throw new Error((0, error_1.getContext)(this.up()) + ": attribute name" - + " should not be empty"); - } - } - else if (this._validation && !(0, validate_1.validateName)(name)) { - if (name.length === 0) { - throw new Error((0, error_1.getContext)(this.up()) + ": attribute name" - + " should not be empty"); - } - else { - throw new Error((0, error_1.getContext)(this.up()) + ": attribute name" - + (" \"" + name + "\" should not contain characters not") - + " allowed in XML names"); - } - } - this._name = name; - }, - enumerable: false, - configurable: true - }); - /** - * Adds a character reference to this attribute and returns the new - * character reference. - */ - XmlAttribute.prototype.charRef = function (options) { - var charRef = new XmlCharRef_1.default(this, this._validation, options); - this._children.push(charRef); - return charRef; - }; - /** - * Adds an entity reference to this attribute and returns the new entity - * reference. - */ - XmlAttribute.prototype.entityRef = function (options) { - var charRef = new XmlEntityRef_1.default(this, this._validation, options); - this._children.push(charRef); - return charRef; - }; - /** - * Adds attribute text to this attribute and returns the new text. - */ - XmlAttribute.prototype.text = function (options) { - var textNode = new XmlAttributeText_1.default(this, this._validation, options); - this._children.push(textNode); - return textNode; - }; - /** - * Returns an XML string representation of this attribute. - */ - XmlAttribute.prototype.toString = function (options) { - if (options === void 0) { options = {}; } - var optionsObj = new options_1.StringOptions(options); - var quote = optionsObj.doubleQuotes ? "\"" : "'"; - var str = this._name + "=" + quote; - for (var _i = 0, _a = this._children; _i < _a.length; _i++) { - var child = _a[_i]; - if (optionsObj.doubleQuotes) { - str += (0, escape_1.escapeDoubleQuotes)(child.toString()); - } - else { - str += (0, escape_1.escapeSingleQuotes)(child.toString()); - } - } - str += quote; - return str; - }; - /** - * Returns the parent of this attribute. - */ - XmlAttribute.prototype.up = function () { - return this._parent; - }; - return XmlAttribute; -}()); -exports.default = XmlAttribute; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/nodes/XmlAttributeText.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/nodes/XmlAttributeText.d.ts deleted file mode 100644 index 9069f517..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/nodes/XmlAttributeText.d.ts +++ /dev/null @@ -1,58 +0,0 @@ -/** - * Copyright (C) 2016-2019 Michael Kourlas - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * The options used to create attribute text. - */ -export interface IXmlAttributeTextOptions { - /** - * The attribute text. - */ - charData: string; - /** - * Whether to replace any invalid characters in the attribute text with the - * Unicode replacement character. By default, this is disabled. - */ - replaceInvalidCharsInCharData?: boolean; -} -/** - * Represents text in an attribute value. - * - * Restricted characters, such as the ampersand (`&`) and the opening angle - * bracket (`<`), are all automatically escaped. - */ -export default class XmlAttributeText { - private readonly _replaceInvalidCharsInCharData; - private readonly _parent; - private readonly _validation; - private _charData; - constructor(parent: Parent, validation: boolean, options: IXmlAttributeTextOptions); - /** - * Gets this attribute text. - */ - get charData(): string; - /** - * Sets this attribute text. - */ - set charData(charData: string); - /** - * Returns an XML string representation of this attribute text. - */ - toString(): string; - /** - * Returns the parent of this attribute text. - */ - up(): Parent; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/nodes/XmlAttributeText.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/nodes/XmlAttributeText.js deleted file mode 100644 index db1ae45f..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/nodes/XmlAttributeText.js +++ /dev/null @@ -1,80 +0,0 @@ -"use strict"; -/** - * Copyright (C) 2016-2019 Michael Kourlas - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var error_1 = require("../error"); -var escape_1 = require("../escape"); -var validate_1 = require("../validate"); -/** - * Represents text in an attribute value. - * - * Restricted characters, such as the ampersand (`&`) and the opening angle - * bracket (`<`), are all automatically escaped. - */ -var XmlAttributeText = /** @class */ (function () { - function XmlAttributeText(parent, validation, options) { - this._validation = validation; - if (!(0, validate_1.isUndefined)(options.replaceInvalidCharsInCharData)) { - this._replaceInvalidCharsInCharData = (options.replaceInvalidCharsInCharData); - } - else { - this._replaceInvalidCharsInCharData = false; - } - this._parent = parent; - this.charData = options.charData; - } - Object.defineProperty(XmlAttributeText.prototype, "charData", { - /** - * Gets this attribute text. - */ - get: function () { - return this._charData; - }, - /** - * Sets this attribute text. - */ - set: function (charData) { - if (this._replaceInvalidCharsInCharData) { - charData = (0, validate_1.fixChar)(charData); - } - else if (this._validation && !(0, validate_1.validateChar)(charData)) { - throw new Error((0, error_1.getContext)(this.up()) + ": attribute text" - + (" \"" + charData + "\" should not contain characters not") - + " allowed in XML"); - } - this._charData = charData; - }, - enumerable: false, - configurable: true - }); - /** - * Returns an XML string representation of this attribute text. - */ - XmlAttributeText.prototype.toString = function () { - var str = this._charData; - str = (0, escape_1.escapeAmpersands)(str); - str = (0, escape_1.escapeLeftAngleBrackets)(str); - return str; - }; - /** - * Returns the parent of this attribute text. - */ - XmlAttributeText.prototype.up = function () { - return this._parent; - }; - return XmlAttributeText; -}()); -exports.default = XmlAttributeText; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/nodes/XmlCdata.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/nodes/XmlCdata.d.ts deleted file mode 100644 index 5603e707..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/nodes/XmlCdata.d.ts +++ /dev/null @@ -1,63 +0,0 @@ -/** - * Copyright (C) 2016-2019 Michael Kourlas - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * The options used to create a CDATA section. - */ -export interface IXmlCdataOptions { - /** - * The character data of the CDATA section. - */ - charData: string; - /** - * Whether to replace any invalid characters in the character data of the - * CDATA section with the Unicode replacement character. By default, this - * is disabled. - */ - replaceInvalidCharsInCharData?: boolean; -} -/** - * Represents a CDATA section. - * - * A CDATA section is structured as follows, where `{data}` is the - * character data of the section: - * - * ```xml - * - * ``` - */ -export default class XmlCdata { - private readonly _replaceInvalidCharsInCharData; - private readonly _parent; - private readonly _validation; - private _charData; - constructor(parent: Parent, validation: boolean, options: IXmlCdataOptions); - /** - * Gets the character data of this CDATA section. - */ - get charData(): string; - /** - * Sets the character data of this CDATA section. - */ - set charData(charData: string); - /** - * Returns an XML string representation of this CDATA section. - */ - toString(): string; - /** - * Returns the parent of this CDATA section. - */ - up(): Parent; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/nodes/XmlCdata.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/nodes/XmlCdata.js deleted file mode 100644 index f120e457..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/nodes/XmlCdata.js +++ /dev/null @@ -1,88 +0,0 @@ -"use strict"; -/** - * Copyright (C) 2016-2019 Michael Kourlas - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var error_1 = require("../error"); -var validate_1 = require("../validate"); -/** - * Represents a CDATA section. - * - * A CDATA section is structured as follows, where `{data}` is the - * character data of the section: - * - * ```xml - * - * ``` - */ -var XmlCdata = /** @class */ (function () { - function XmlCdata(parent, validation, options) { - this._validation = validation; - if (!(0, validate_1.isUndefined)(options.replaceInvalidCharsInCharData)) { - this._replaceInvalidCharsInCharData = (options.replaceInvalidCharsInCharData); - } - else { - this._replaceInvalidCharsInCharData = false; - } - this._parent = parent; - this.charData = options.charData; - } - Object.defineProperty(XmlCdata.prototype, "charData", { - /** - * Gets the character data of this CDATA section. - */ - get: function () { - return this._charData; - }, - /** - * Sets the character data of this CDATA section. - */ - set: function (charData) { - if (this._replaceInvalidCharsInCharData) { - charData = (0, validate_1.fixChar)(charData); - } - else if (this._validation && !(0, validate_1.validateChar)(charData)) { - throw new Error((0, error_1.getContext)(this.up()) + ": CDATA section" - + (" \"" + charData + "\" should not contain characters") - + " not allowed in XML"); - } - if (this._replaceInvalidCharsInCharData) { - charData = charData.replace("]]>", "\uFFFD\uFFFD\uFFFD"); - } - else if (this._validation && charData.indexOf("]]>") !== -1) { - throw new Error((0, error_1.getContext)(this.up()) + ": CDATA section" - + (" \"" + charData + "\" should not contain the string") - + " ']]>'"); - } - this._charData = charData; - }, - enumerable: false, - configurable: true - }); - /** - * Returns an XML string representation of this CDATA section. - */ - XmlCdata.prototype.toString = function () { - return ""; - }; - /** - * Returns the parent of this CDATA section. - */ - XmlCdata.prototype.up = function () { - return this._parent; - }; - return XmlCdata; -}()); -exports.default = XmlCdata; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/nodes/XmlCharData.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/nodes/XmlCharData.d.ts deleted file mode 100644 index bc56b587..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/nodes/XmlCharData.d.ts +++ /dev/null @@ -1,59 +0,0 @@ -/** - * Copyright (C) 2016-2019 Michael Kourlas - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * The options used to create new character data. - */ -export interface IXmlCharDataOptions { - /** - * The character data. - */ - charData: string; - /** - * Whether to replace any invalid characters in the character data with the - * Unicode replacement character. By default, this is disabled. - */ - replaceInvalidCharsInCharData?: boolean; -} -/** - * Represents character data. - * - * Restricted characters, such as the ampersand (`&`), the opening angle - * bracket (`<`), and the closing angle bracket (`>`) when it appears in the - * string `]]>`, are all automatically escaped. - */ -export default class XmlCharData { - private readonly _replaceInvalidCharsInCharData; - private readonly _parent; - private readonly _validation; - private _charData; - constructor(parent: Parent, validation: boolean, options: IXmlCharDataOptions); - /** - * Gets the text of this character data. - */ - get charData(): string; - /** - * Sets the text of this character data. - */ - set charData(charData: string); - /** - * Returns an XML string representation of this character data. - */ - toString(): string; - /** - * Returns the parent of this character data. - */ - up(): Parent; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/nodes/XmlCharData.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/nodes/XmlCharData.js deleted file mode 100644 index 77965900..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/nodes/XmlCharData.js +++ /dev/null @@ -1,82 +0,0 @@ -"use strict"; -/** - * Copyright (C) 2016-2019 Michael Kourlas - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var error_1 = require("../error"); -var escape_1 = require("../escape"); -var validate_1 = require("../validate"); -/** - * Represents character data. - * - * Restricted characters, such as the ampersand (`&`), the opening angle - * bracket (`<`), and the closing angle bracket (`>`) when it appears in the - * string `]]>`, are all automatically escaped. - */ -var XmlCharData = /** @class */ (function () { - function XmlCharData(parent, validation, options) { - this._validation = validation; - if (!(0, validate_1.isUndefined)(options.replaceInvalidCharsInCharData)) { - this._replaceInvalidCharsInCharData = (options.replaceInvalidCharsInCharData); - } - else { - this._replaceInvalidCharsInCharData = false; - } - this._parent = parent; - this.charData = options.charData; - } - Object.defineProperty(XmlCharData.prototype, "charData", { - /** - * Gets the text of this character data. - */ - get: function () { - return this._charData; - }, - /** - * Sets the text of this character data. - */ - set: function (charData) { - if (this._replaceInvalidCharsInCharData) { - charData = (0, validate_1.fixChar)(charData); - } - else if (this._validation && !(0, validate_1.validateChar)(charData)) { - throw new Error((0, error_1.getContext)(this.up()) + ": character data" - + ("\"" + charData + "\" should not contain characters not") - + " allowed in XML"); - } - this._charData = charData; - }, - enumerable: false, - configurable: true - }); - /** - * Returns an XML string representation of this character data. - */ - XmlCharData.prototype.toString = function () { - var str = this._charData; - str = (0, escape_1.escapeAmpersands)(str); - str = (0, escape_1.escapeLeftAngleBrackets)(str); - str = (0, escape_1.escapeRightAngleBracketsInCdataTerminator)(str); - return str; - }; - /** - * Returns the parent of this character data. - */ - XmlCharData.prototype.up = function () { - return this._parent; - }; - return XmlCharData; -}()); -exports.default = XmlCharData; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/nodes/XmlCharRef.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/nodes/XmlCharRef.d.ts deleted file mode 100644 index 444d1436..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/nodes/XmlCharRef.d.ts +++ /dev/null @@ -1,89 +0,0 @@ -/** - * Copyright (C) 2016-2019 Michael Kourlas - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * The options used to create a new character reference. - */ -export interface IXmlCharRefOptions { - /** - * The character to represent using the reference. - */ - char: string; - /** - * Whether to use the hexadecimal or decimal representation for the - * reference. Defaults to false. - */ - hex?: boolean; -} -/** - * Represents a character reference. - * - * A character reference is structured as follows, where `{dec}` is the - * decimal representation code point corresponding to a particular Unicode - * character: - * - * ```xml - * &#{dec}; - * ``` - * - * The corresponding hexadecimal version is structured as follows, where - * `{hex}` is the hexadecimal representation code point corresponding to a - * particular Unicode character: - * - * ```xml - * &#x{hex}; - * ``` - * - * Unicode characters outside of the Basic Multilingual Plane are represented - * using a surrogate pair consisting of two character references. - * - * The `{dec}` and `{hex}` values are defined by the `char` and `hex` - * properties of this node; the former is the character to be represented while - * the latter indicates whether the decimal or hexadecimal representation - * should be used. - */ -export default class XmlCharRef { - private readonly _validation; - private readonly _parent; - private _char; - private _hex; - constructor(parent: Parent, validation: boolean, options: IXmlCharRefOptions); - /** - * Gets the character of this character reference. - */ - get char(): string; - /** - * Sets the character of this character reference. - */ - set char(char: string); - /** - * Gets whether the decimal or hexadecimal representation should be used - * for this character reference. - */ - get hex(): boolean; - /** - * Sets whether the decimal or hexadecimal representation should be used - * for this character reference. - */ - set hex(hex: boolean); - /** - * Returns an XML string representation of this character reference. - */ - toString(): string; - /** - * Returns the parent of this character reference. - */ - up(): Parent; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/nodes/XmlCharRef.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/nodes/XmlCharRef.js deleted file mode 100644 index dc53ba40..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/nodes/XmlCharRef.js +++ /dev/null @@ -1,136 +0,0 @@ -"use strict"; -/** - * Copyright (C) 2016-2019 Michael Kourlas - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var error_1 = require("../error"); -var validate_1 = require("../validate"); -/** - * Represents a character reference. - * - * A character reference is structured as follows, where `{dec}` is the - * decimal representation code point corresponding to a particular Unicode - * character: - * - * ```xml - * &#{dec}; - * ``` - * - * The corresponding hexadecimal version is structured as follows, where - * `{hex}` is the hexadecimal representation code point corresponding to a - * particular Unicode character: - * - * ```xml - * &#x{hex}; - * ``` - * - * Unicode characters outside of the Basic Multilingual Plane are represented - * using a surrogate pair consisting of two character references. - * - * The `{dec}` and `{hex}` values are defined by the `char` and `hex` - * properties of this node; the former is the character to be represented while - * the latter indicates whether the decimal or hexadecimal representation - * should be used. - */ -var XmlCharRef = /** @class */ (function () { - function XmlCharRef(parent, validation, options) { - this._hex = false; - this._validation = validation; - this._parent = parent; - this.char = options.char; - if (!(0, validate_1.isUndefined)(options.hex)) { - this.hex = options.hex; - } - } - Object.defineProperty(XmlCharRef.prototype, "char", { - /** - * Gets the character of this character reference. - */ - get: function () { - return this._char; - }, - /** - * Sets the character of this character reference. - */ - set: function (char) { - if (this._validation && !(0, validate_1.validateSingleChar)(char)) { - throw new Error((0, error_1.getContext)(this.up()) + ": character reference" - + (" \"" + char + "\" should reference a single character,") - + " and this character should be allowed in XML"); - } - this._char = char; - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(XmlCharRef.prototype, "hex", { - /** - * Gets whether the decimal or hexadecimal representation should be used - * for this character reference. - */ - get: function () { - return this._hex; - }, - /** - * Sets whether the decimal or hexadecimal representation should be used - * for this character reference. - */ - set: function (hex) { - this._hex = hex; - }, - enumerable: false, - configurable: true - }); - /** - * Returns an XML string representation of this character reference. - */ - XmlCharRef.prototype.toString = function () { - var char; - if (this._char.length === 1) { - char = this._char.charCodeAt(0); - } - else { - var first = this._char.charCodeAt(0); - if (first >= 0xD800 && first <= 0xDBFF && this._char.length > 1) { - var second = this._char.charCodeAt(1); - if (second >= 0xDC00 && second <= 0xDFFF) { - char = (first - 0xD800) * 0x400 + second - 0xDC00 + 0x10000; - } - else { - throw new Error((0, error_1.getContext)(this.up()) + ": character" - + (" reference \"" + this.char + "\" should") - + " reference a valid Unicode character"); - } - } - else { - char = first; - } - } - if (this._hex) { - return "&#x" + char.toString(16) + ";"; - } - else { - return "&#" + char + ";"; - } - }; - /** - * Returns the parent of this character reference. - */ - XmlCharRef.prototype.up = function () { - return this._parent; - }; - return XmlCharRef; -}()); -exports.default = XmlCharRef; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/nodes/XmlComment.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/nodes/XmlComment.d.ts deleted file mode 100644 index 28aadb8e..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/nodes/XmlComment.d.ts +++ /dev/null @@ -1,62 +0,0 @@ -/** - * Copyright (C) 2016-2019 Michael Kourlas - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * The options used to create a new comment. - */ -export interface IXmlCommentOptions { - /** - * The content of the comment. - */ - charData: string; - /** - * Whether to replace any invalid characters in the content of the comment - * with the Unicode replacement character. By default, this is disabled. - */ - replaceInvalidCharsInCharData?: boolean; -} -/** - * Represents a comment. - * - * A comment is structured as follows, where `{content}` is the text of the - * comment: - * - * ```xml - * - * ``` - */ -export default class XmlComment { - private readonly _replaceInvalidCharsInCharData; - private readonly _parent; - private readonly _validation; - private _charData; - constructor(parent: Parent, validation: boolean, options: IXmlCommentOptions); - /** - * Gets the text of this comment. - */ - get charData(): string; - /** - * Sets the text of this comment. - */ - set charData(charData: string); - /** - * Returns an XML string representation of this comment. - */ - toString(): string; - /** - * Returns the parent of this comment. - */ - up(): Parent; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/nodes/XmlComment.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/nodes/XmlComment.js deleted file mode 100644 index 81a40f32..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/nodes/XmlComment.js +++ /dev/null @@ -1,99 +0,0 @@ -"use strict"; -/** - * Copyright (C) 2016-2019 Michael Kourlas - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var error_1 = require("../error"); -var validate_1 = require("../validate"); -/** - * Represents a comment. - * - * A comment is structured as follows, where `{content}` is the text of the - * comment: - * - * ```xml - * - * ``` - */ -var XmlComment = /** @class */ (function () { - function XmlComment(parent, validation, options) { - this._validation = validation; - if (!(0, validate_1.isUndefined)(options.replaceInvalidCharsInCharData)) { - this._replaceInvalidCharsInCharData = (options.replaceInvalidCharsInCharData); - } - else { - this._replaceInvalidCharsInCharData = false; - } - this._parent = parent; - this.charData = options.charData; - } - Object.defineProperty(XmlComment.prototype, "charData", { - /** - * Gets the text of this comment. - */ - get: function () { - return this._charData; - }, - /** - * Sets the text of this comment. - */ - set: function (charData) { - if (this._replaceInvalidCharsInCharData) { - charData = (0, validate_1.fixChar)(charData); - } - else if (this._validation && !(0, validate_1.validateChar)(charData)) { - throw new Error((0, error_1.getContext)(this.up()) + ": comment content" - + (" \"" + charData + "\" should not contain characters") - + " not allowed in XML"); - } - if (this._replaceInvalidCharsInCharData) { - charData = charData.replace("--", "\uFFFD\uFFFD"); - } - else if (this._validation && charData.indexOf("--") !== -1) { - throw new Error((0, error_1.getContext)(this.up()) + ": comment content" - + (" \"" + charData + "\" should not contain the string") - + " '--'"); - } - if (this._replaceInvalidCharsInCharData) { - if (charData.lastIndexOf("-") === charData.length - 1) { - charData = charData.substr(0, charData.length - 1) + "\uFFFD"; - } - } - else if (this._validation - && charData.lastIndexOf("-") === charData.length - 1) { - throw new Error((0, error_1.getContext)(this.up()) + ": comment content" - + (" \"" + charData + "\" should not end with the string") - + " '-'"); - } - this._charData = charData; - }, - enumerable: false, - configurable: true - }); - /** - * Returns an XML string representation of this comment. - */ - XmlComment.prototype.toString = function () { - return ""; - }; - /** - * Returns the parent of this comment. - */ - XmlComment.prototype.up = function () { - return this._parent; - }; - return XmlComment; -}()); -exports.default = XmlComment; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/nodes/XmlDecl.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/nodes/XmlDecl.d.ts deleted file mode 100644 index 2313a721..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/nodes/XmlDecl.d.ts +++ /dev/null @@ -1,92 +0,0 @@ -/** - * Copyright (C) 2016-2019 Michael Kourlas - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { IStringOptions } from "../options"; -/** - * The options used to create a new declaration. - */ -export interface IXmlDeclOptions { - /** - * The encoding attribute to be included in the declaration. If defined, - * this value must be a valid encoding. By default, no encoding attribute - * is included. - */ - encoding?: string; - /** - * The value of the standalone attribute to be included in the declaration. - * If defined, this value must be "yes" or "no". By default, no standalone - * attribute is included. - */ - standalone?: string; - /** - * The XML version to be included in the declaration. If defined, this - * value must be a valid XML version number. Defaults to "1.0". - */ - version?: string; -} -/** - * Represents a declaration. - * - * A declaration is structured as follows, where `{version}` is the XML - * version, `{encoding}` is the encoding of the document, and `{standalone}` - * is either "yes" or "no", depending on whether the document may contain - * external markup declarations: - * - * ```xml - * - * ``` - */ -export default class XmlDecl { - private readonly _validation; - private _encoding; - private readonly _parent; - private _standalone; - private _version; - constructor(parent: Parent, validation: boolean, options: IXmlDeclOptions); - /** - * Gets the encoding associated with this declaration. - */ - get encoding(): string | undefined; - /** - * Sets the encoding associated with this declaration. - */ - set encoding(encoding: string | undefined); - /** - * Gets the value of the standalone attribute associated with this - * declaration. - */ - get standalone(): string | undefined; - /** - * Sets the value of the standalone attribute associated with this - * declaration. - */ - set standalone(standalone: string | undefined); - /** - * Gets the XML version associated with this declaration. - */ - get version(): string; - /** - * Sets the XML version associated with this declaration. - */ - set version(version: string); - /** - * Returns an XML string representation of this declaration. - */ - toString(options?: IStringOptions): string; - /** - * Returns the parent of this declaration. - */ - up(): Parent; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/nodes/XmlDecl.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/nodes/XmlDecl.js deleted file mode 100644 index 8adb1644..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/nodes/XmlDecl.js +++ /dev/null @@ -1,180 +0,0 @@ -"use strict"; -/** - * Copyright (C) 2016-2019 Michael Kourlas - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var error_1 = require("../error"); -var options_1 = require("../options"); -var validate_1 = require("../validate"); -/** - * Represents a declaration. - * - * A declaration is structured as follows, where `{version}` is the XML - * version, `{encoding}` is the encoding of the document, and `{standalone}` - * is either "yes" or "no", depending on whether the document may contain - * external markup declarations: - * - * ```xml - * - * ``` - */ -var XmlDecl = /** @class */ (function () { - function XmlDecl(parent, validation, options) { - this._version = "1.0"; - this._validation = validation; - this._parent = parent; - this.encoding = options.encoding; - this.standalone = options.standalone; - if (!(0, validate_1.isUndefined)(options.version)) { - this.version = options.version; - } - } - Object.defineProperty(XmlDecl.prototype, "encoding", { - /** - * Gets the encoding associated with this declaration. - */ - get: function () { - return this._encoding; - }, - /** - * Sets the encoding associated with this declaration. - */ - set: function (encoding) { - if (this._validation && !(0, validate_1.isUndefined)(encoding)) { - if (!validateEncoding(encoding)) { - throw new Error((0, error_1.getContext)(this.up()) + ": declaration" - + (" encoding attribute " + encoding + " should be a") - + " valid encoding"); - } - } - this._encoding = encoding; - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(XmlDecl.prototype, "standalone", { - /** - * Gets the value of the standalone attribute associated with this - * declaration. - */ - get: function () { - return this._standalone; - }, - /** - * Sets the value of the standalone attribute associated with this - * declaration. - */ - set: function (standalone) { - if (this._validation && !(0, validate_1.isUndefined)(standalone)) { - if (standalone !== "yes" && standalone !== "no") { - throw new Error((0, error_1.getContext)(this.up()) + ": declaration" - + (" standalone attribute " + standalone + " should") - + " be the string 'yes' or the string 'no'"); - } - } - this._standalone = standalone; - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(XmlDecl.prototype, "version", { - /** - * Gets the XML version associated with this declaration. - */ - get: function () { - return this._version; - }, - /** - * Sets the XML version associated with this declaration. - */ - set: function (version) { - if (this._validation && !validateVersion(version)) { - throw new Error((0, error_1.getContext)(this.up()) + ": declaration version" - + (" attribute " + version + " should be a valid XML") - + " version"); - } - this._version = version; - }, - enumerable: false, - configurable: true - }); - /** - * Returns an XML string representation of this declaration. - */ - XmlDecl.prototype.toString = function (options) { - if (options === void 0) { options = {}; } - var optionsObj = new options_1.StringOptions(options); - var quote = optionsObj.doubleQuotes ? '"' : "'"; - var str = ""; - return str; - }; - /** - * Returns the parent of this declaration. - */ - XmlDecl.prototype.up = function () { - return this._parent; - }; - return XmlDecl; -}()); -exports.default = XmlDecl; -/** - * Returns true if the specified encoding only contains characters permitted by - * the XML specification. - */ -function validateEncoding(str) { - if (str.length === 0) { - return false; - } - var initialChar = str.charCodeAt(0); - if (!((initialChar >= 0x41 && initialChar <= 0x5A) - || (initialChar >= 0x61 && initialChar <= 0x7A))) { - return false; - } - for (var i = 1; i < str.length; i++) { - var char = str.charCodeAt(i); - if (char === 0x5F - || char === 0x2D - || char === 0x2E - || (char >= 0x30 && char <= 0x39) - || (char >= 0x41 && char <= 0x5A) - || (char >= 0x61 && char <= 0x7A)) { - continue; - } - if (i + 1 === str.length) { - return false; - } - return false; - } - return true; -} -/** - * Returns true if the specified version only contains characters permitted by - * the XML specification. - */ -function validateVersion(str) { - for (var i = 0; i <= 9; i++) { - if (str === "1." + i) { - return true; - } - } - return false; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/nodes/XmlDocument.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/nodes/XmlDocument.d.ts deleted file mode 100644 index d4a74ecf..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/nodes/XmlDocument.d.ts +++ /dev/null @@ -1,96 +0,0 @@ -/** - * Copyright (C) 2016-2019 Michael Kourlas - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { IStringOptions } from "../options"; -import XmlComment, { IXmlCommentOptions } from "./XmlComment"; -import XmlDecl, { IXmlDeclOptions } from "./XmlDecl"; -import XmlDtd, { IXmlDtdOptions } from "./XmlDtd"; -import XmlElement, { IXmlElementOptions } from "./XmlElement"; -import XmlProcInst, { IXmlProcInstOptions } from "./XmlProcInst"; -/** - * The options used to create a new document. - */ -export interface IXmlDocumentOptions { - /** - * Whether to throw an exception if basic XML validation fails while - * building the document. - */ - validation?: boolean; -} -/** - * Represents a document. - * - * A sample document is structured as follows: - * - * ```xml - * - * - * - * - * My page title - * - * - *

    Welcome!

    - *

    I hope you enjoy visiting my website.

    - * - * - * - * ``` - * - * Each component of the document, such as the declaration, document type - * definition, and root element, are children of this node. - * - * Documents must have exactly one element, which is the document's root - * element. - * - * Documents can have exactly one declaration and one document type definition - * in that order, so long as they precede the element. - * - * Documents can have an unlimited number of comments or processing - * instructions, so long as they follow the declaration, if one exists. - */ -export default class XmlDocument { - private readonly _children; - private readonly _validation; - constructor(options: IXmlDocumentOptions); - /** - * Adds a comment to this document and returns the new comment. - */ - comment(options: IXmlCommentOptions): XmlComment; - /** - * Adds a declaration to this document and returns the new declaration. - */ - decl(options?: IXmlDeclOptions): XmlDecl; - /** - * Adds a document type definition to this document and returns the new - * document type definition. - */ - dtd(options: IXmlDtdOptions): XmlDtd; - /** - * Adds the root element to this document and returns the element. - */ - element(options: IXmlElementOptions): XmlElement; - /** - * Adds a processing instruction to this document and returns the new - * processing instruction. - */ - procInst(options: IXmlProcInstOptions): XmlProcInst; - /** - * Returns an XML string representation of this document using the - * specified options. - */ - toString(options?: IStringOptions): string; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/nodes/XmlDocument.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/nodes/XmlDocument.js deleted file mode 100644 index 5d31d67b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/nodes/XmlDocument.js +++ /dev/null @@ -1,166 +0,0 @@ -"use strict"; -/** - * Copyright (C) 2016-2019 Michael Kourlas - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -var options_1 = require("../options"); -var validate_1 = require("../validate"); -var XmlComment_1 = __importDefault(require("./XmlComment")); -var XmlDecl_1 = __importDefault(require("./XmlDecl")); -var XmlDtd_1 = __importDefault(require("./XmlDtd")); -var XmlElement_1 = __importDefault(require("./XmlElement")); -var XmlProcInst_1 = __importDefault(require("./XmlProcInst")); -/** - * Represents a document. - * - * A sample document is structured as follows: - * - * ```xml - * - * - * - * - * My page title - * - * - *

    Welcome!

    - *

    I hope you enjoy visiting my website.

    - * - * - * - * ``` - * - * Each component of the document, such as the declaration, document type - * definition, and root element, are children of this node. - * - * Documents must have exactly one element, which is the document's root - * element. - * - * Documents can have exactly one declaration and one document type definition - * in that order, so long as they precede the element. - * - * Documents can have an unlimited number of comments or processing - * instructions, so long as they follow the declaration, if one exists. - */ -var XmlDocument = /** @class */ (function () { - function XmlDocument(options) { - this._children = []; - this._validation = !(0, validate_1.isUndefined)(options.validation) - ? options.validation - : true; - } - /** - * Adds a comment to this document and returns the new comment. - */ - XmlDocument.prototype.comment = function (options) { - var comment = new XmlComment_1.default(this, this._validation, options); - this._children.push(comment); - return comment; - }; - /** - * Adds a declaration to this document and returns the new declaration. - */ - XmlDocument.prototype.decl = function (options) { - if (options === void 0) { options = {}; } - if (this._validation && this._children.length !== 0) { - throw new Error("in XML document: declaration must be the first" - + " child"); - } - var declaration = new XmlDecl_1.default(this, this._validation, options); - this._children.push(declaration); - return declaration; - }; - /** - * Adds a document type definition to this document and returns the new - * document type definition. - */ - XmlDocument.prototype.dtd = function (options) { - var filteredChildren = this._children.filter(function (value) { - return value instanceof XmlElement_1.default; - }); - if (this._validation && filteredChildren.length !== 0) { - throw new Error("in XML document: DTD must precede the root" - + " element"); - } - var dtd = new XmlDtd_1.default(this, this._validation, options); - this._children.push(dtd); - return dtd; - }; - /** - * Adds the root element to this document and returns the element. - */ - XmlDocument.prototype.element = function (options) { - var filteredChildren = this._children.filter(function (value) { - return value instanceof XmlElement_1.default; - }); - if (this._validation && filteredChildren.length !== 0) { - throw new Error("in XML document: only one root element is" - + " permitted"); - } - var element = new XmlElement_1.default(this, this._validation, options); - this._children.push(element); - return element; - }; - /** - * Adds a processing instruction to this document and returns the new - * processing instruction. - */ - XmlDocument.prototype.procInst = function (options) { - var procInst = new XmlProcInst_1.default(this, this._validation, options); - this._children.push(procInst); - return procInst; - }; - /** - * Returns an XML string representation of this document using the - * specified options. - */ - XmlDocument.prototype.toString = function (options) { - if (options === void 0) { options = {}; } - var filteredChildren = this._children.filter(function (value) { - return value instanceof XmlElement_1.default; - }); - if (this._validation && filteredChildren.length !== 1) { - throw new Error("in XML document: no more than one root element" - + " is permitted"); - } - var optionsObj = new options_1.StringOptions(options); - var str = ""; - for (var _i = 0, _a = this._children; _i < _a.length; _i++) { - var node = _a[_i]; - if (node instanceof XmlDecl_1.default - || node instanceof XmlDtd_1.default - || node instanceof XmlElement_1.default) { - str += node.toString(options); - } - else { - str += node.toString(); - } - if (optionsObj.pretty) { - str += optionsObj.newline; - } - } - var len = str.length - optionsObj.newline.length; - if (str.substr(len) === optionsObj.newline) { - str = str.substr(0, len); - } - return str; - }; - return XmlDocument; -}()); -exports.default = XmlDocument; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/nodes/XmlDtd.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/nodes/XmlDtd.d.ts deleted file mode 100644 index bbb159f8..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/nodes/XmlDtd.d.ts +++ /dev/null @@ -1,147 +0,0 @@ -/** - * Copyright (C) 2016-2019 Michael Kourlas - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { IStringOptions } from "../options"; -import XmlComment, { IXmlCommentOptions } from "./XmlComment"; -import XmlDtdAttlist, { IXmlDtdAttlistOptions } from "./XmlDtdAttlist"; -import XmlDtdElement, { IXmlDtdElementOptions } from "./XmlDtdElement"; -import XmlDtdEntity, { IXmlDtdEntityOptions } from "./XmlDtdEntity"; -import XmlDtdNotation, { IXmlDtdNotationOptions } from "./XmlDtdNotation"; -import { default as XmlDtdParamEntityRef, IXmlDtdParamEntityRefOptions } from "./XmlDtdParamEntityRef"; -import XmlProcInst, { IXmlProcInstOptions } from "./XmlProcInst"; -/** - * The options used to create a new document type definition. - */ -export interface IXmlDtdOptions { - /** - * The name of the DTD. - */ - name: string; - /** - * The system identifier of the DTD, excluding quotation marks. By default, - * no system identifier is included. - */ - sysId?: string; - /** - * The public identifier of the DTD, excluding quotation marks. If a public - * identifier is provided, a system identifier must be provided as well. - * By default, no public identifier is included. - */ - pubId?: string; -} -/** - * Represents an XML document type definition (DTD). - * - * A document type definition is structured as follows, where `{name}` is - * the name of the DTD, `{sysId}` is the system identifier of the DTD, - * `{pubId}` is the public identifier of the DTD, and `{intSubset}` is the - * internal subset of the DTD: - * - * ```xml - * - * ``` - * - * DTDs can have an unlimited number of comments, attribute-list declarations, - * element declarations, entity declarations, notation declarations, parameter - * entity references, and processing instructions. - */ -export default class XmlDtd { - private readonly _children; - private readonly _parent; - private _name; - private readonly _validation; - private _pubId; - private _sysId; - constructor(parent: Parent, validation: boolean, options: IXmlDtdOptions); - /** - * Gets the name of the DTD. - */ - get name(): string; - /** - * Sets the name of the DTD. - */ - set name(name: string); - /** - * Gets the public identifier of the DTD. - */ - get pubId(): string | undefined; - /** - * Sets the public identifier of the DTD. - */ - set pubId(pubId: string | undefined); - /** - * Gets the system identifier of the DTD. - */ - get sysId(): string | undefined; - /** - * Sets the system identifier of the DTD. - */ - set sysId(sysId: string | undefined); - /** - * Adds an attribute-list declaration to this document type declaration - * and returns the new attribute-list declaration. - */ - attlist(options: IXmlDtdAttlistOptions): XmlDtdAttlist; - /** - * Adds a comment to this document type declaration and returns the - * new comment. - */ - comment(options: IXmlCommentOptions): XmlComment; - /** - * Adds an element declaration to this document type declaration - * and returns the new element declaration. - */ - element(options: IXmlDtdElementOptions): XmlDtdElement; - /** - * Adds an entity declaration to this document type declaration - * and returns the new entity declaration. - */ - entity(options: IXmlDtdEntityOptions): XmlDtdEntity; - /** - * Adds a notation declaration to this document type declaration - * and returns the new notation declaration. - */ - notation(options: IXmlDtdNotationOptions): XmlDtdNotation; - /** - * Adds a parameter entity reference to this document type declaration - * and returns the new parameter entity reference. - */ - paramEntityRef(options: IXmlDtdParamEntityRefOptions): XmlDtdParamEntityRef; - /** - * Adds a processing instruction to this document type declaration - * and returns the new processing instruction. - */ - procInst(options: IXmlProcInstOptions): XmlProcInst; - /** - * Returns an XML string representation of this document type declaration. - */ - toString(options?: IStringOptions): string; - /** - * Returns the parent of this attribute. - */ - up(): Parent; - /** - * Appends the XML string representation of a public or system identifier - * to an existing string. - */ - private appendId; -} -/** - * Returns true if the specified public identifier only contains characters - * permitted by the XML specification. - */ -export declare function validatePubId(str: string): boolean; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/nodes/XmlDtd.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/nodes/XmlDtd.js deleted file mode 100644 index 71e4d630..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/nodes/XmlDtd.js +++ /dev/null @@ -1,312 +0,0 @@ -"use strict"; -/** - * Copyright (C) 2016-2019 Michael Kourlas - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.validatePubId = void 0; -var error_1 = require("../error"); -var options_1 = require("../options"); -var validate_1 = require("../validate"); -var XmlComment_1 = __importDefault(require("./XmlComment")); -var XmlDtdAttlist_1 = __importDefault(require("./XmlDtdAttlist")); -var XmlDtdElement_1 = __importDefault(require("./XmlDtdElement")); -var XmlDtdEntity_1 = __importDefault(require("./XmlDtdEntity")); -var XmlDtdNotation_1 = __importDefault(require("./XmlDtdNotation")); -var XmlDtdParamEntityRef_1 = __importDefault(require("./XmlDtdParamEntityRef")); -var XmlProcInst_1 = __importDefault(require("./XmlProcInst")); -/** - * Represents an XML document type definition (DTD). - * - * A document type definition is structured as follows, where `{name}` is - * the name of the DTD, `{sysId}` is the system identifier of the DTD, - * `{pubId}` is the public identifier of the DTD, and `{intSubset}` is the - * internal subset of the DTD: - * - * ```xml - * - * ``` - * - * DTDs can have an unlimited number of comments, attribute-list declarations, - * element declarations, entity declarations, notation declarations, parameter - * entity references, and processing instructions. - */ -var XmlDtd = /** @class */ (function () { - function XmlDtd(parent, validation, options) { - this._pubId = undefined; - this._sysId = undefined; - this._validation = validation; - this._children = []; - this._parent = parent; - this.name = options.name; - if (!(0, validate_1.isUndefined)(options.sysId)) { - this.sysId = options.sysId; - } - if (!(0, validate_1.isUndefined)(options.pubId)) { - this.pubId = options.pubId; - } - } - Object.defineProperty(XmlDtd.prototype, "name", { - /** - * Gets the name of the DTD. - */ - get: function () { - return this._name; - }, - /** - * Sets the name of the DTD. - */ - set: function (name) { - if (this._validation && !(0, validate_1.validateName)(name)) { - throw new Error((0, error_1.getContext)(this.up()) + ": DTD name \"" + name + "\"" - + " should not contain characters not allowed in" - + " XML names"); - } - this._name = name; - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(XmlDtd.prototype, "pubId", { - /** - * Gets the public identifier of the DTD. - */ - get: function () { - return this._pubId; - }, - /** - * Sets the public identifier of the DTD. - */ - set: function (pubId) { - if (!(0, validate_1.isUndefined)(pubId)) { - if (this._validation && !validatePubId(pubId)) { - throw new Error((0, error_1.getContext)(this.up()) + ": DTD public" - + (" identifier \"" + pubId + "\" should not contain") - + " characters not allowed in public" - + " identifiers"); - } - if (this._validation && (0, validate_1.isUndefined)(this._sysId)) { - throw new Error((0, error_1.getContext)(this.up()) + ": DTD public" - + (" identifier \"" + pubId + "\" should not be defined") - + " if system identifier is undefined"); - } - } - this._pubId = pubId; - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(XmlDtd.prototype, "sysId", { - /** - * Gets the system identifier of the DTD. - */ - get: function () { - return this._sysId; - }, - /** - * Sets the system identifier of the DTD. - */ - set: function (sysId) { - if (!(0, validate_1.isUndefined)(sysId)) { - if (this._validation && !(0, validate_1.validateChar)(sysId)) { - throw new Error((0, error_1.getContext)(this.up()) + ": DTD system" - + (" identifier \"" + sysId + "\" should not contain") - + " characters not allowed in XML"); - } - else if (this._validation - && sysId.indexOf("'") !== -1 - && sysId.indexOf("\"") !== -1) { - throw new Error((0, error_1.getContext)(this.up()) + ": DTD system" - + (" identifier \"" + sysId + "\" should not contain") - + " both single quotes and double quotes"); - } - } - this._sysId = sysId; - }, - enumerable: false, - configurable: true - }); - /** - * Adds an attribute-list declaration to this document type declaration - * and returns the new attribute-list declaration. - */ - XmlDtd.prototype.attlist = function (options) { - var attlist = new XmlDtdAttlist_1.default(this, this._validation, options); - this._children.push(attlist); - return attlist; - }; - /** - * Adds a comment to this document type declaration and returns the - * new comment. - */ - XmlDtd.prototype.comment = function (options) { - var comment = new XmlComment_1.default(this, this._validation, options); - this._children.push(comment); - return comment; - }; - /** - * Adds an element declaration to this document type declaration - * and returns the new element declaration. - */ - XmlDtd.prototype.element = function (options) { - var element = new XmlDtdElement_1.default(this, this._validation, options); - this._children.push(element); - return element; - }; - /** - * Adds an entity declaration to this document type declaration - * and returns the new entity declaration. - */ - XmlDtd.prototype.entity = function (options) { - var entity = new XmlDtdEntity_1.default(this, this._validation, options); - this._children.push(entity); - return entity; - }; - /** - * Adds a notation declaration to this document type declaration - * and returns the new notation declaration. - */ - XmlDtd.prototype.notation = function (options) { - var notation = new XmlDtdNotation_1.default(this, this._validation, options); - this._children.push(notation); - return notation; - }; - /** - * Adds a parameter entity reference to this document type declaration - * and returns the new parameter entity reference. - */ - XmlDtd.prototype.paramEntityRef = function (options) { - var paramEntity = new XmlDtdParamEntityRef_1.default(this, this._validation, options); - this._children.push(paramEntity); - return paramEntity; - }; - /** - * Adds a processing instruction to this document type declaration - * and returns the new processing instruction. - */ - XmlDtd.prototype.procInst = function (options) { - var procInst = new XmlProcInst_1.default(this, this._validation, options); - this._children.push(procInst); - return procInst; - }; - /** - * Returns an XML string representation of this document type declaration. - */ - XmlDtd.prototype.toString = function (options) { - if (options === void 0) { options = {}; } - var optionsObj = new options_1.StringOptions(options); - var str = ""; - } - else { - str += ">"; - } - return str; - }; - /** - * Returns the parent of this attribute. - */ - XmlDtd.prototype.up = function () { - return this._parent; - }; - /** - * Appends the XML string representation of a public or system identifier - * to an existing string. - */ - XmlDtd.prototype.appendId = function (type, value, str, options) { - str += type + " "; - if (options.doubleQuotes) { - if (this._validation && value.indexOf("\"") !== -1) { - throw new Error((0, error_1.getContext)(this.up()) + ": doubleQuotes option" - + " inconsistent with DTD system identifier or" - + " public identifier"); - } - str += "\"" + value + "\""; - } - else { - if (this._validation && value.indexOf("'") !== -1) { - throw new Error((0, error_1.getContext)(this) + ": doubleQuotes option" - + " inconsistent with DTD system identifier or" - + " public identifier"); - } - str += "'" + value + "'"; - } - return str; - }; - return XmlDtd; -}()); -exports.default = XmlDtd; -/** - * Returns true if the specified public identifier only contains characters - * permitted by the XML specification. - */ -function validatePubId(str) { - for (var i = 0; i < str.length; i++) { - var char = str.charCodeAt(i); - if (char === 0xA - || char === 0xD - || char === 0x20 - || char === 0x21 - || (char >= 0x23 && char <= 0x25) - || (char >= 0x27 && char <= 0x2F) - || (char >= 0x30 && char <= 0x39) - || char === 0x3A - || char === 0x3B - || char === 0x3D - || char === 0x3F - || (char >= 0x40 && char <= 0x5A) - || char === 0x5F - || (char >= 0x61 && char <= 0x7A)) { - continue; - } - if (i + 1 === str.length) { - return false; - } - return false; - } - return true; -} -exports.validatePubId = validatePubId; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/nodes/XmlDtdAttlist.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/nodes/XmlDtdAttlist.d.ts deleted file mode 100644 index e7c217dc..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/nodes/XmlDtdAttlist.d.ts +++ /dev/null @@ -1,56 +0,0 @@ -/** - * Copyright (C) 2016-2019 Michael Kourlas - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * The options used to create a new attribute-list declaration. - */ -export interface IXmlDtdAttlistOptions { - /** - * The text of the declaration. - */ - charData: string; -} -/** - * Represents an attribute-list declaration in a document type definition. - * - * An attribute-list declaration is structured as follows, where `{text}` - * is the text of the declaration: - * - * ```xml - * - * ``` - */ -export default class XmlDtdAttlist { - private readonly _validation; - private readonly _parent; - private _charData; - constructor(parent: Parent, validation: boolean, options: IXmlDtdAttlistOptions); - /** - * Gets the text of this entity declaration. - */ - get charData(): string; - /** - * Sets the text of this entity declaration. - */ - set charData(charData: string); - /** - * Returns an XML string representation of this entity declaration. - */ - toString(): string; - /** - * Returns the parent of this entity declaration. - */ - up(): Parent; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/nodes/XmlDtdAttlist.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/nodes/XmlDtdAttlist.js deleted file mode 100644 index 1d8edb1b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/nodes/XmlDtdAttlist.js +++ /dev/null @@ -1,71 +0,0 @@ -"use strict"; -/** - * Copyright (C) 2016-2019 Michael Kourlas - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var error_1 = require("../error"); -var validate_1 = require("../validate"); -/** - * Represents an attribute-list declaration in a document type definition. - * - * An attribute-list declaration is structured as follows, where `{text}` - * is the text of the declaration: - * - * ```xml - * - * ``` - */ -var XmlDtdAttlist = /** @class */ (function () { - function XmlDtdAttlist(parent, validation, options) { - this._validation = validation; - this._parent = parent; - this.charData = options.charData; - } - Object.defineProperty(XmlDtdAttlist.prototype, "charData", { - /** - * Gets the text of this entity declaration. - */ - get: function () { - return this._charData; - }, - /** - * Sets the text of this entity declaration. - */ - set: function (charData) { - if (this._validation && !(0, validate_1.validateChar)(charData)) { - throw new Error((0, error_1.getContext)(this.up()) + ": attribute-list" - + (" declaration \"" + charData + "\" should not contain") - + " characters not allowed in XML"); - } - this._charData = charData; - }, - enumerable: false, - configurable: true - }); - /** - * Returns an XML string representation of this entity declaration. - */ - XmlDtdAttlist.prototype.toString = function () { - return ""; - }; - /** - * Returns the parent of this entity declaration. - */ - XmlDtdAttlist.prototype.up = function () { - return this._parent; - }; - return XmlDtdAttlist; -}()); -exports.default = XmlDtdAttlist; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/nodes/XmlDtdElement.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/nodes/XmlDtdElement.d.ts deleted file mode 100644 index 3b96320d..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/nodes/XmlDtdElement.d.ts +++ /dev/null @@ -1,56 +0,0 @@ -/** - * Copyright (C) 2016-2019 Michael Kourlas - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * The options used to create a new element declaration. - */ -export interface IXmlDtdElementOptions { - /** - * The text of the declaration. - */ - charData: string; -} -/** - * Represents an element declaration in a document type definition. - * - * An element declaration is structured as follows, where `{text}` is the - * text of the declaration: - * - * ```xml - * - * ``` - */ -export default class XmlDtdElement { - private readonly _validation; - private readonly _parent; - private _charData; - constructor(parent: Parent, validation: boolean, options: IXmlDtdElementOptions); - /** - * Gets the text of this element declaration. - */ - get charData(): string; - /** - * Sets the text of this element declaration. - */ - set charData(charData: string); - /** - * Returns an XML string representation of this element declaration. - */ - toString(): string; - /** - * Returns the parent of this element declaration. - */ - up(): Parent; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/nodes/XmlDtdElement.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/nodes/XmlDtdElement.js deleted file mode 100644 index 1b8d1f3e..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/nodes/XmlDtdElement.js +++ /dev/null @@ -1,71 +0,0 @@ -"use strict"; -/** - * Copyright (C) 2016-2019 Michael Kourlas - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var error_1 = require("../error"); -var validate_1 = require("../validate"); -/** - * Represents an element declaration in a document type definition. - * - * An element declaration is structured as follows, where `{text}` is the - * text of the declaration: - * - * ```xml - * - * ``` - */ -var XmlDtdElement = /** @class */ (function () { - function XmlDtdElement(parent, validation, options) { - this._validation = validation; - this._parent = parent; - this.charData = options.charData; - } - Object.defineProperty(XmlDtdElement.prototype, "charData", { - /** - * Gets the text of this element declaration. - */ - get: function () { - return this._charData; - }, - /** - * Sets the text of this element declaration. - */ - set: function (charData) { - if (this._validation && !(0, validate_1.validateChar)(charData)) { - throw new Error((0, error_1.getContext)(this.up()) + ": element declaration" - + (" \"" + charData + "\" should not contain characters") - + " not allowed in XML"); - } - this._charData = charData; - }, - enumerable: false, - configurable: true - }); - /** - * Returns an XML string representation of this element declaration. - */ - XmlDtdElement.prototype.toString = function () { - return ""; - }; - /** - * Returns the parent of this element declaration. - */ - XmlDtdElement.prototype.up = function () { - return this._parent; - }; - return XmlDtdElement; -}()); -exports.default = XmlDtdElement; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/nodes/XmlDtdEntity.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/nodes/XmlDtdEntity.d.ts deleted file mode 100644 index 71f348a5..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/nodes/XmlDtdEntity.d.ts +++ /dev/null @@ -1,56 +0,0 @@ -/** - * Copyright (C) 2016-2019 Michael Kourlas - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * The options used to create a new entity declaration. - */ -export interface IXmlDtdEntityOptions { - /** - * The text of the declaration. - */ - charData: string; -} -/** - * Represents an entity declaration in a document type definition. - * - * An entity declaration is structured as follows, where `{text}` is the - * text of the declaration: - * - * ```xml - * - * ``` - */ -export default class XmlDtdEntity { - private readonly _validation; - private readonly _parent; - private _charData; - constructor(parent: Parent, validation: boolean, options: IXmlDtdEntityOptions); - /** - * Gets the text of this entity declaration. - */ - get charData(): string; - /** - * Sets the text of this entity declaration. - */ - set charData(charData: string); - /** - * Returns an XML string representation of this entity declaration. - */ - toString(): string; - /** - * Returns the parent of this entity declaration. - */ - up(): Parent; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/nodes/XmlDtdEntity.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/nodes/XmlDtdEntity.js deleted file mode 100644 index dd67d5d9..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/nodes/XmlDtdEntity.js +++ /dev/null @@ -1,71 +0,0 @@ -"use strict"; -/** - * Copyright (C) 2016-2019 Michael Kourlas - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var error_1 = require("../error"); -var validate_1 = require("../validate"); -/** - * Represents an entity declaration in a document type definition. - * - * An entity declaration is structured as follows, where `{text}` is the - * text of the declaration: - * - * ```xml - * - * ``` - */ -var XmlDtdEntity = /** @class */ (function () { - function XmlDtdEntity(parent, validation, options) { - this._validation = validation; - this._parent = parent; - this.charData = options.charData; - } - Object.defineProperty(XmlDtdEntity.prototype, "charData", { - /** - * Gets the text of this entity declaration. - */ - get: function () { - return this._charData; - }, - /** - * Sets the text of this entity declaration. - */ - set: function (charData) { - if (this._validation && !(0, validate_1.validateChar)(charData)) { - throw new Error((0, error_1.getContext)(this.up()) + ": entity declaration" - + (" \"" + charData + "\" should not contain characters") - + " not allowed in XML"); - } - this._charData = charData; - }, - enumerable: false, - configurable: true - }); - /** - * Returns an XML string representation of this entity declaration. - */ - XmlDtdEntity.prototype.toString = function () { - return ""; - }; - /** - * Returns the parent of this entity declaration. - */ - XmlDtdEntity.prototype.up = function () { - return this._parent; - }; - return XmlDtdEntity; -}()); -exports.default = XmlDtdEntity; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/nodes/XmlDtdNotation.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/nodes/XmlDtdNotation.d.ts deleted file mode 100644 index 17c17934..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/nodes/XmlDtdNotation.d.ts +++ /dev/null @@ -1,56 +0,0 @@ -/** - * Copyright (C) 2016-2019 Michael Kourlas - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * The options used to create a new notation declaration. - */ -export interface IXmlDtdNotationOptions { - /** - * The text of the declaration. - */ - charData: string; -} -/** - * Represents a notation declaration in a document type definition. - * - * A notation declaration is structured as follows, where `{text}` is the - * text of the declaration: - * - * ```xml - * - * ``` - */ -export default class XmlDtdNotation { - private readonly _validation; - private readonly _parent; - private _charData; - constructor(parent: Parent, validation: boolean, options: IXmlDtdNotationOptions); - /** - * Gets the text of this notation declaration. - */ - get charData(): string; - /** - * Sets the text of this notation declaration. - */ - set charData(charData: string); - /** - * Returns an XML string representation of this notation declaration. - */ - toString(): string; - /** - * Returns the parent of this notation declaration. - */ - up(): Parent; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/nodes/XmlDtdNotation.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/nodes/XmlDtdNotation.js deleted file mode 100644 index 9b6dc4e5..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/nodes/XmlDtdNotation.js +++ /dev/null @@ -1,71 +0,0 @@ -"use strict"; -/** - * Copyright (C) 2016-2019 Michael Kourlas - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var error_1 = require("../error"); -var validate_1 = require("../validate"); -/** - * Represents a notation declaration in a document type definition. - * - * A notation declaration is structured as follows, where `{text}` is the - * text of the declaration: - * - * ```xml - * - * ``` - */ -var XmlDtdNotation = /** @class */ (function () { - function XmlDtdNotation(parent, validation, options) { - this._validation = validation; - this._parent = parent; - this.charData = options.charData; - } - Object.defineProperty(XmlDtdNotation.prototype, "charData", { - /** - * Gets the text of this notation declaration. - */ - get: function () { - return this._charData; - }, - /** - * Sets the text of this notation declaration. - */ - set: function (charData) { - if (this._validation && !(0, validate_1.validateChar)(charData)) { - throw new Error((0, error_1.getContext)(this.up()) + ": notation declaration" - + (" \"" + charData + "\" should not contain characters") - + " not allowed in XML"); - } - this._charData = charData; - }, - enumerable: false, - configurable: true - }); - /** - * Returns an XML string representation of this notation declaration. - */ - XmlDtdNotation.prototype.toString = function () { - return ""; - }; - /** - * Returns the parent of this notation declaration. - */ - XmlDtdNotation.prototype.up = function () { - return this._parent; - }; - return XmlDtdNotation; -}()); -exports.default = XmlDtdNotation; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/nodes/XmlDtdParamEntityRef.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/nodes/XmlDtdParamEntityRef.d.ts deleted file mode 100644 index c9aac39f..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/nodes/XmlDtdParamEntityRef.d.ts +++ /dev/null @@ -1,56 +0,0 @@ -/** - * Copyright (C) 2016-2019 Michael Kourlas - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * The options used to create a new parameter entity reference. - */ -export interface IXmlDtdParamEntityRefOptions { - /** - * The name of the entity to be referenced. - */ - name: string; -} -/** - * Represents a parameter entity reference in a document type definition. - * - * A parameter entity reference is structured as follows, where `{entity}` - * is the name of the entity: - * - * ```xml - * %{entity}; - * ``` - */ -export default class XmlDtdParamEntityRef { - private readonly _validation; - private readonly _parent; - private _name; - constructor(parent: Parent, validation: boolean, options: IXmlDtdParamEntityRefOptions); - /** - * Gets the name of this parameter entity reference. - */ - get name(): string; - /** - * Sets the name of this parameter entity reference. - */ - set name(name: string); - /** - * Returns an XML string representation of this parameter entity reference. - */ - toString(): string; - /** - * Returns the parent of this parameter entity reference. - */ - up(): Parent; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/nodes/XmlDtdParamEntityRef.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/nodes/XmlDtdParamEntityRef.js deleted file mode 100644 index 931c82e9..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/nodes/XmlDtdParamEntityRef.js +++ /dev/null @@ -1,71 +0,0 @@ -"use strict"; -/** - * Copyright (C) 2016-2019 Michael Kourlas - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var error_1 = require("../error"); -var validate_1 = require("../validate"); -/** - * Represents a parameter entity reference in a document type definition. - * - * A parameter entity reference is structured as follows, where `{entity}` - * is the name of the entity: - * - * ```xml - * %{entity}; - * ``` - */ -var XmlDtdParamEntityRef = /** @class */ (function () { - function XmlDtdParamEntityRef(parent, validation, options) { - this._validation = validation; - this._parent = parent; - this.name = options.name; - } - Object.defineProperty(XmlDtdParamEntityRef.prototype, "name", { - /** - * Gets the name of this parameter entity reference. - */ - get: function () { - return this._name; - }, - /** - * Sets the name of this parameter entity reference. - */ - set: function (name) { - if (this._validation && !(0, validate_1.validateName)(name)) { - throw new Error((0, error_1.getContext)(this.up()) + ": parameter entity" - + (" reference name \"" + name + "\" should not contain") - + " characters not allowed in XML names"); - } - this._name = name; - }, - enumerable: false, - configurable: true - }); - /** - * Returns an XML string representation of this parameter entity reference. - */ - XmlDtdParamEntityRef.prototype.toString = function () { - return "%" + this._name + ";"; - }; - /** - * Returns the parent of this parameter entity reference. - */ - XmlDtdParamEntityRef.prototype.up = function () { - return this._parent; - }; - return XmlDtdParamEntityRef; -}()); -exports.default = XmlDtdParamEntityRef; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/nodes/XmlElement.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/nodes/XmlElement.d.ts deleted file mode 100644 index 187f376b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/nodes/XmlElement.d.ts +++ /dev/null @@ -1,153 +0,0 @@ -/** - * Copyright (C) 2016-2019 Michael Kourlas - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { IStringOptions } from "../options"; -import { default as XmlAttribute, IXmlAttributeOptions as IXmlAttributeOptions } from "./XmlAttribute"; -import XmlCdata, { IXmlCdataOptions } from "./XmlCdata"; -import XmlCharData, { IXmlCharDataOptions } from "./XmlCharData"; -import XmlCharRef, { IXmlCharRefOptions } from "./XmlCharRef"; -import XmlComment, { IXmlCommentOptions } from "./XmlComment"; -import XmlEntityRef, { IXmlEntityRefOptions } from "./XmlEntityRef"; -import XmlProcInst, { IXmlProcInstOptions } from "./XmlProcInst"; -/** - * The options used to create a new element. - */ -export interface IXmlElementOptions { - /** - * The name of the element. - */ - name: string; - /** - * Whether to replace any invalid characters in the name of the element - * with the Unicode replacement character. By default, this is disabled. - */ - replaceInvalidCharsInName?: boolean; - /** - * Whether to use a self-closing tag if this element is empty. - * - * For example, use: - * ```xml - * - * ``` - * instead of: - * ```xml - * - * ``` - * - * By default, this is enabled. - */ - useSelfClosingTagIfEmpty?: boolean; -} -/** - * Represents an XML element. - * - * A sample element is structured as follows, where `{name}` is the name - * of the element: - * - * ```xml - * <{name} attname="attvalue"> - * - * - * text - * - * ``` - * - * XML elements can have an unlimited number of attributes, CDATA sections, - * character references, comments, elements, entity references, processing - * instructions, and character data. - * - * An element with no content will be represented using an empty element tag: - * - * ```xml - * <{name}/> - * ``` - */ -export default class XmlElement { - private readonly _validation; - private readonly _children; - private readonly _attributeNames; - private readonly _parent; - private readonly _replaceInvalidCharsInName; - private readonly _useSelfClosingTagIfEmpty; - private _name; - constructor(parent: Parent, validation: boolean, options: IXmlElementOptions); - /** - * Gets the name of this element. - */ - get name(): string; - /** - * Sets the name of this element. - */ - set name(name: string); - /** - * Adds an attribute to this element and returns the new attribute. - */ - attribute(options: IXmlAttributeOptions): XmlAttribute; - /** - * Adds a CDATA section to this element and returns the new CDATA section. - */ - cdata(options: IXmlCdataOptions): XmlCdata; - /** - * Adds character data to this element and returns the new character data. - */ - charData(options: IXmlCharDataOptions): XmlCharData; - /** - * Adds a character reference to this element and returns the new - * character reference. - */ - charRef(options: IXmlCharRefOptions): XmlCharRef; - /** - * Adds a comment to this element and returns the new comment. - */ - comment(options: IXmlCommentOptions): XmlComment; - /** - * Adds an element to this element and returns the new element. - */ - element(options: IXmlElementOptions): XmlElement; - /** - * Adds an entity reference to this element and returns the new entity - * reference. - */ - entityRef(options: IXmlEntityRefOptions): XmlEntityRef; - /** - * Adds a processing instruction to this element and returns the new - * processing instruction. - */ - procInst(options: IXmlProcInstOptions): XmlProcInst; - /** - * Returns an XML string representation of this element using the specified - * options. - */ - toString(options?: IStringOptions): string; - /** - * Returns the parent of this element. - */ - up(): Parent; - /** - * Returns an XML string representation of this element using the specified - * options and initial indent. - */ - private toStringWithIndent; - /** - * Returns true if the specified nodes are all character references, - * entity references, or character data. - */ - private allSameLineNodes; - /** - * Returns true if the specified nodes are all character references, - * entity references, or character data. - */ - private onSameLine; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/nodes/XmlElement.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/nodes/XmlElement.js deleted file mode 100644 index 0a8c9a4c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/nodes/XmlElement.js +++ /dev/null @@ -1,302 +0,0 @@ -"use strict"; -/** - * Copyright (C) 2016-2019 Michael Kourlas - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -var error_1 = require("../error"); -var options_1 = require("../options"); -var validate_1 = require("../validate"); -var XmlAttribute_1 = __importDefault(require("./XmlAttribute")); -var XmlCdata_1 = __importDefault(require("./XmlCdata")); -var XmlCharData_1 = __importDefault(require("./XmlCharData")); -var XmlCharRef_1 = __importDefault(require("./XmlCharRef")); -var XmlComment_1 = __importDefault(require("./XmlComment")); -var XmlEntityRef_1 = __importDefault(require("./XmlEntityRef")); -var XmlProcInst_1 = __importDefault(require("./XmlProcInst")); -/** - * Represents an XML element. - * - * A sample element is structured as follows, where `{name}` is the name - * of the element: - * - * ```xml - * <{name} attname="attvalue"> - * - * - * text - * - * ``` - * - * XML elements can have an unlimited number of attributes, CDATA sections, - * character references, comments, elements, entity references, processing - * instructions, and character data. - * - * An element with no content will be represented using an empty element tag: - * - * ```xml - * <{name}/> - * ``` - */ -var XmlElement = /** @class */ (function () { - function XmlElement(parent, validation, options) { - this._validation = validation; - if (!(0, validate_1.isUndefined)(options.replaceInvalidCharsInName)) { - this._replaceInvalidCharsInName = options.replaceInvalidCharsInName; - } - else { - this._replaceInvalidCharsInName = false; - } - if (!(0, validate_1.isUndefined)(options.useSelfClosingTagIfEmpty)) { - this._useSelfClosingTagIfEmpty = options.useSelfClosingTagIfEmpty; - } - else { - this._useSelfClosingTagIfEmpty = true; - } - this._children = []; - this._attributeNames = []; - this._parent = parent; - this.name = options.name; - } - Object.defineProperty(XmlElement.prototype, "name", { - /** - * Gets the name of this element. - */ - get: function () { - return this._name; - }, - /** - * Sets the name of this element. - */ - set: function (name) { - if (this._replaceInvalidCharsInName) { - name = (0, validate_1.fixName)(name); - if (name.length === 0) { - throw new Error((0, error_1.getContext)(this.up()) + ": element name should" - + " not be empty"); - } - } - else if (this._validation && !(0, validate_1.validateName)(name)) { - if (name.length === 0) { - throw new Error((0, error_1.getContext)(this.up()) + ": element name should" - + " not be empty"); - } - else { - throw new Error((0, error_1.getContext)(this.up()) + ": element name" - + (" \"" + name + "\" should not contain characters not") - + " allowed in XML names"); - } - } - this._name = name; - }, - enumerable: false, - configurable: true - }); - /** - * Adds an attribute to this element and returns the new attribute. - */ - XmlElement.prototype.attribute = function (options) { - if (this._validation - && this._attributeNames.indexOf(options.name) !== -1) { - throw new Error((0, error_1.getContext)(this.up()) + ": element \"" + this.name + "\"" - + " already contains an attribute with the" - + (" name \"" + options.name + "\"")); - } - var attribute = new XmlAttribute_1.default(this, this._validation, options); - this._children.push(attribute); - this._attributeNames.push(options.name); - return attribute; - }; - /** - * Adds a CDATA section to this element and returns the new CDATA section. - */ - XmlElement.prototype.cdata = function (options) { - var cdata = new XmlCdata_1.default(this, this._validation, options); - this._children.push(cdata); - return cdata; - }; - /** - * Adds character data to this element and returns the new character data. - */ - XmlElement.prototype.charData = function (options) { - var charDataNode = new XmlCharData_1.default(this, this._validation, options); - this._children.push(charDataNode); - return charDataNode; - }; - /** - * Adds a character reference to this element and returns the new - * character reference. - */ - XmlElement.prototype.charRef = function (options) { - var charRef = new XmlCharRef_1.default(this, this._validation, options); - this._children.push(charRef); - return charRef; - }; - /** - * Adds a comment to this element and returns the new comment. - */ - XmlElement.prototype.comment = function (options) { - var comment = new XmlComment_1.default(this, this._validation, options); - this._children.push(comment); - return comment; - }; - /** - * Adds an element to this element and returns the new element. - */ - XmlElement.prototype.element = function (options) { - var element = new XmlElement(this, this._validation, options); - this._children.push(element); - return element; - }; - /** - * Adds an entity reference to this element and returns the new entity - * reference. - */ - XmlElement.prototype.entityRef = function (options) { - var entityRef = new XmlEntityRef_1.default(this, this._validation, options); - this._children.push(entityRef); - return entityRef; - }; - /** - * Adds a processing instruction to this element and returns the new - * processing instruction. - */ - XmlElement.prototype.procInst = function (options) { - var procInst = new XmlProcInst_1.default(this, this._validation, options); - this._children.push(procInst); - return procInst; - }; - /** - * Returns an XML string representation of this element using the specified - * options. - */ - XmlElement.prototype.toString = function (options) { - if (options === void 0) { options = {}; } - return this.toStringWithIndent(options, ""); - }; - /** - * Returns the parent of this element. - */ - XmlElement.prototype.up = function () { - return this._parent; - }; - /** - * Returns an XML string representation of this element using the specified - * options and initial indent. - */ - XmlElement.prototype.toStringWithIndent = function (options, indent) { - var optionsObj = new options_1.StringOptions(options); - var newIndent = indent + optionsObj.indent; - // Element tag start - var str = "<" + this._name; - // Attributes and other nodes - var nodes = []; - for (var _i = 0, _a = this._children; _i < _a.length; _i++) { - var node = _a[_i]; - if (node instanceof XmlAttribute_1.default) { - str += " " + node.toString(options); - } - else { - nodes.push(node); - } - } - // Child nodes - if (nodes.length > 0) { - var childStr = ""; - for (var i = 0; i < nodes.length; i++) { - var next = nodes[i]; - var nextStr = ""; - if (next instanceof XmlElement) { - nextStr += next.toStringWithIndent(optionsObj, newIndent); - } - else { - nextStr += next.toString(); - } - var prev = i > 0 ? nodes[i - 1] : undefined; - // Skip empty nodes - if (next instanceof XmlCharData_1.default && next.toString() === "") { - continue; - } - // Line break before child nodes unless all nodes, or at least - // the most recent two, are of type XmlCharacterReference, - // XmlEntityReference, or XmlCharData - if (optionsObj.pretty) { - if (!this.allSameLineNodes(nodes)) { - if (!(i > 0 && this.onSameLine(next, prev))) { - nextStr = optionsObj.newline + newIndent + nextStr; - } - } - } - childStr += nextStr; - } - // Line break before end tag unless all nodes are of type - // XmlCharacterReference, XmlEntityReference, or XmlCharData - if (optionsObj.pretty) { - if (!this.allSameLineNodes(nodes)) { - childStr += optionsObj.newline + indent; - } - } - if (childStr.length === 0 && this._useSelfClosingTagIfEmpty) { - // Element empty tag end - str += "/>"; - } - else { - // Element start and end tags - str += ">" + childStr + ""; - } - } - else if (this._useSelfClosingTagIfEmpty) { - // Element empty tag end - str += "/>"; - } - else { - // Element start and end tags - str += ">"; - } - return str; - }; - /** - * Returns true if the specified nodes are all character references, - * entity references, or character data. - */ - XmlElement.prototype.allSameLineNodes = function (nodes) { - for (var _i = 0, nodes_1 = nodes; _i < nodes_1.length; _i++) { - var node = nodes_1[_i]; - if (!((node instanceof XmlCharRef_1.default - || node instanceof XmlEntityRef_1.default - || node instanceof XmlCharData_1.default))) { - return false; - } - } - return true; - }; - /** - * Returns true if the specified nodes are all character references, - * entity references, or character data. - */ - XmlElement.prototype.onSameLine = function (prev, next) { - return (prev instanceof XmlCharRef_1.default - || prev instanceof XmlEntityRef_1.default - || prev instanceof XmlCharData_1.default) - && (!(0, validate_1.isUndefined)(next) - && (next instanceof XmlCharRef_1.default - || next instanceof XmlEntityRef_1.default - || next instanceof XmlCharData_1.default)); - }; - return XmlElement; -}()); -exports.default = XmlElement; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/nodes/XmlEntityRef.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/nodes/XmlEntityRef.d.ts deleted file mode 100644 index 848e1322..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/nodes/XmlEntityRef.d.ts +++ /dev/null @@ -1,56 +0,0 @@ -/** - * Copyright (C) 2016-2019 Michael Kourlas - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * The options used to create a new entity reference. - */ -export interface IXmlEntityRefOptions { - /** - * The name of the entity to be referenced. - */ - name: string; -} -/** - * Represents an entity reference. - * - * An entity reference is structured as follows, where `{name}` is the name of - * the entity to be referenced: - * - * ```xml - * &{entity}; - * ``` - */ -export default class XmlEntityRef { - private readonly _validation; - private readonly _parent; - private _name; - constructor(parent: Parent, validation: boolean, options: IXmlEntityRefOptions); - /** - * Gets the name of this entity reference. - */ - get name(): string; - /** - * Sets the name of this entity reference. - */ - set name(name: string); - /** - * Returns an XML string representation of this entity reference. - */ - toString(): string; - /** - * Returns the parent of this entity reference. - */ - up(): Parent; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/nodes/XmlEntityRef.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/nodes/XmlEntityRef.js deleted file mode 100644 index 874f8d27..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/nodes/XmlEntityRef.js +++ /dev/null @@ -1,71 +0,0 @@ -"use strict"; -/** - * Copyright (C) 2016-2019 Michael Kourlas - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var error_1 = require("../error"); -var validate_1 = require("../validate"); -/** - * Represents an entity reference. - * - * An entity reference is structured as follows, where `{name}` is the name of - * the entity to be referenced: - * - * ```xml - * &{entity}; - * ``` - */ -var XmlEntityRef = /** @class */ (function () { - function XmlEntityRef(parent, validation, options) { - this._validation = validation; - this._parent = parent; - this.name = options.name; - } - Object.defineProperty(XmlEntityRef.prototype, "name", { - /** - * Gets the name of this entity reference. - */ - get: function () { - return this._name; - }, - /** - * Sets the name of this entity reference. - */ - set: function (name) { - if (this._validation && !(0, validate_1.validateName)(name)) { - throw new Error((0, error_1.getContext)(this.up()) + ": entity reference name" - + (" \"" + name + "\" should not contain characters not") - + " allowed in XML names"); - } - this._name = name; - }, - enumerable: false, - configurable: true - }); - /** - * Returns an XML string representation of this entity reference. - */ - XmlEntityRef.prototype.toString = function () { - return "&" + this._name + ";"; - }; - /** - * Returns the parent of this entity reference. - */ - XmlEntityRef.prototype.up = function () { - return this._parent; - }; - return XmlEntityRef; -}()); -exports.default = XmlEntityRef; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/nodes/XmlProcInst.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/nodes/XmlProcInst.d.ts deleted file mode 100644 index eb8a6376..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/nodes/XmlProcInst.d.ts +++ /dev/null @@ -1,71 +0,0 @@ -/** - * Copyright (C) 2016-2019 Michael Kourlas - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * The options used to create a new processing instruction. - */ -export interface IXmlProcInstOptions { - /** - * The target of the processing instruction. - */ - target: string; - /** - * The data of the processing instruction, or undefined if there is no - * content. - */ - content?: string; -} -/** - * Represents a processing instruction. - * - * A processing instruction is structured as follows, where `{target}` and - * `{content}` are the target and content of the processing instruction - * respectively: - * - * ```xml - * - * ``` - */ -export default class XmlProcInst { - private readonly _validation; - private readonly _parent; - private _content; - private _target; - constructor(parent: Parent, validation: boolean, options: IXmlProcInstOptions); - /** - * Gets the content of this processing instruction. - */ - get content(): string | undefined; - /** - * Sets the content of this processing instruction. - */ - set content(content: string | undefined); - /** - * Gets the target of this processing instruction. - */ - get target(): string; - /** - * Sets the content of this processing instruction. - */ - set target(target: string); - /** - * Returns an XML string representation of this processing instruction. - */ - toString(): string; - /** - * Returns the parent of this processing instruction. - */ - up(): Parent; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/nodes/XmlProcInst.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/nodes/XmlProcInst.js deleted file mode 100644 index 283f587d..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/nodes/XmlProcInst.js +++ /dev/null @@ -1,112 +0,0 @@ -"use strict"; -/** - * Copyright (C) 2016-2019 Michael Kourlas - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var error_1 = require("../error"); -var validate_1 = require("../validate"); -/** - * Represents a processing instruction. - * - * A processing instruction is structured as follows, where `{target}` and - * `{content}` are the target and content of the processing instruction - * respectively: - * - * ```xml - * - * ``` - */ -var XmlProcInst = /** @class */ (function () { - function XmlProcInst(parent, validation, options) { - this._validation = validation; - this._parent = parent; - this.content = options.content; - this.target = options.target; - } - Object.defineProperty(XmlProcInst.prototype, "content", { - /** - * Gets the content of this processing instruction. - */ - get: function () { - return this._content; - }, - /** - * Sets the content of this processing instruction. - */ - set: function (content) { - if (!(0, validate_1.isUndefined)(content)) { - if (this._validation && !(0, validate_1.validateChar)(content)) { - throw new Error((0, error_1.getContext)(this.up()) + ": processing" - + (" instruction content \"" + content + "\" should") - + " not contain characters not allowed in XML"); - } - else if (this._validation && content.indexOf("?>") !== -1) { - throw new Error((0, error_1.getContext)(this.up()) + ": processing" - + (" instruction content \"" + content + "\" should") - + " not contain the string '?>'"); - } - } - this._content = content; - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(XmlProcInst.prototype, "target", { - /** - * Gets the target of this processing instruction. - */ - get: function () { - return this._target; - }, - /** - * Sets the content of this processing instruction. - */ - set: function (target) { - if (this._validation && !(0, validate_1.validateName)(target)) { - throw new Error((0, error_1.getContext)(this.up()) + ": processing" - + (" instruction target \"" + target + "\" should") - + " not contain characters not allowed in XML" - + " names"); - } - if (this._validation && target === "xml") { - throw new Error((0, error_1.getContext)(this.up()) + ": processing" - + (" instruction target \"" + target + "\" should") - + " not be the string 'xml'"); - } - this._target = target; - }, - enumerable: false, - configurable: true - }); - /** - * Returns an XML string representation of this processing instruction. - */ - XmlProcInst.prototype.toString = function () { - if ((0, validate_1.isUndefined)(this._content)) { - return ""; - } - else { - return ""; - } - }; - /** - * Returns the parent of this processing instruction. - */ - XmlProcInst.prototype.up = function () { - return this._parent; - }; - return XmlProcInst; -}()); -exports.default = XmlProcInst; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/options.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/options.d.ts deleted file mode 100644 index d3edf1db..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/options.d.ts +++ /dev/null @@ -1,51 +0,0 @@ -/** - * Copyright (C) 2016-2019 Michael Kourlas - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Formatting options for the string representation of an XML node. - */ -export interface IStringOptions { - /** - * Whether double quotes or single quotes should be used in XML attributes. - * By default, single quotes are used. - */ - doubleQuotes?: boolean; - /** - * The indent string used for pretty-printing. The default indent string is - * four spaces. - */ - indent?: string; - /** - * The newline string used for pretty-printing. The default newline string - * is "\n". - */ - newline?: string; - /** - * Whether pretty-printing is enabled. By default, pretty-printing is - * enabled. - */ - pretty?: boolean; -} -/** - * Implementation of the IStringOptions interface used to provide default - * values to fields. - */ -export declare class StringOptions implements IStringOptions { - doubleQuotes: boolean; - indent: string; - newline: string; - pretty: boolean; - constructor(options: IStringOptions); -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/options.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/options.js deleted file mode 100644 index d9d95892..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/options.js +++ /dev/null @@ -1,45 +0,0 @@ -"use strict"; -/** - * Copyright (C) 2016-2019 Michael Kourlas - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.StringOptions = void 0; -var validate_1 = require("./validate"); -/** - * Implementation of the IStringOptions interface used to provide default - * values to fields. - */ -var StringOptions = /** @class */ (function () { - function StringOptions(options) { - this.doubleQuotes = false; - this.indent = " "; - this.newline = "\n"; - this.pretty = true; - if (!(0, validate_1.isUndefined)(options.doubleQuotes)) { - this.doubleQuotes = options.doubleQuotes; - } - if (!(0, validate_1.isUndefined)(options.indent)) { - this.indent = options.indent; - } - if (!(0, validate_1.isUndefined)(options.newline)) { - this.newline = options.newline; - } - if (!(0, validate_1.isUndefined)(options.pretty)) { - this.pretty = options.pretty; - } - } - return StringOptions; -}()); -exports.StringOptions = StringOptions; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/validate.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/validate.d.ts deleted file mode 100644 index ef40ad85..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/validate.d.ts +++ /dev/null @@ -1,46 +0,0 @@ -/** - * Copyright (C) 2016-2019 Michael Kourlas - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Returns true if the specified string only contains characters permitted by - * the XML specification. - */ -export declare function validateChar(str: string): boolean; -/** - * Returns a version of the specified string that only contains characters - * permitted by the XML specification, with invalid characters replaced - * by the replacement character U+FFFD. - */ -export declare function fixChar(str: string): string; -/** - * Returns true if the specified string only contains a single character, and - * that this character is permitted by the XML specification. - */ -export declare function validateSingleChar(str: string): boolean; -/** - * Returns true if the specified string only contains characters permitted by - * the XML specification for names. - */ -export declare function validateName(str: string): boolean; -/** - * Returns a version of the specified string that only contains characters - * permitted by the XML specification for names, with invalid characters - * replaced by the replacement character U+FFFD. - */ -export declare function fixName(str: string): string; -/** - * Returns true if the specified value is undefined. - */ -export declare function isUndefined(val: unknown): val is undefined; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/validate.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/validate.js deleted file mode 100644 index c8566e32..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/lib/validate.js +++ /dev/null @@ -1,274 +0,0 @@ -"use strict"; -/** - * Copyright (C) 2016-2019 Michael Kourlas - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.isUndefined = exports.fixName = exports.validateName = exports.validateSingleChar = exports.fixChar = exports.validateChar = void 0; -/** - * Returns true if the specified string only contains characters permitted by - * the XML specification. - */ -function validateChar(str) { - for (var i = 0; i < str.length; i++) { - var firstChar = str.charCodeAt(i); - if (firstChar === 0x9 || firstChar === 0xA || firstChar === 0xD - || (firstChar >= 0x20 && firstChar <= 0xD7FF) - || (firstChar >= 0xE000 && firstChar <= 0xFFFD)) { - continue; - } - if (i + 1 === str.length) { - return false; - } - // UTF-16 surrogate characters - var secondChar = str.charCodeAt(i + 1); - if ((firstChar >= 0xD800 && firstChar <= 0xDBFF) - && (secondChar >= 0xDC00 && secondChar <= 0xDFFF)) { - i++; - continue; - } - return false; - } - return true; -} -exports.validateChar = validateChar; -/** - * Returns a version of the specified string that only contains characters - * permitted by the XML specification, with invalid characters replaced - * by the replacement character U+FFFD. - */ -function fixChar(str) { - var newStr = ""; - for (var i = 0; i < str.length; i++) { - var firstChar = str.charCodeAt(i); - if (firstChar === 0x9 || firstChar === 0xA || firstChar === 0xD - || (firstChar >= 0x20 && firstChar <= 0xD7FF) - || (firstChar >= 0xE000 && firstChar <= 0xFFFD)) { - newStr += str[i]; - continue; - } - if (i + 1 === str.length) { - newStr += "\uFFFD"; - return newStr; - } - // UTF-16 surrogate characters - var secondChar = str.charCodeAt(i + 1); - if ((firstChar >= 0xD800 && firstChar <= 0xDBFF) - && (secondChar >= 0xDC00 && secondChar <= 0xDFFF)) { - newStr += str[i] + str[i + 1]; - i++; - continue; - } - newStr += "\uFFFD"; - } - return newStr; -} -exports.fixChar = fixChar; -/** - * Returns true if the specified string only contains a single character, and - * that this character is permitted by the XML specification. - */ -function validateSingleChar(str) { - if (str.length === 0) { - return false; - } - var firstChar = str.charCodeAt(0); - if (str.length === 1) { - return (firstChar === 0x9 || firstChar === 0xA || firstChar === 0xD - || (firstChar >= 0x20 && firstChar <= 0xD7FF) - || (firstChar >= 0xE000 && firstChar <= 0xFFFD)); - } - if (str.length !== 2) { - return false; - } - // UTF-16 surrogate characters - var secondChar = str.charCodeAt(1); - return ((firstChar >= 0xD800 && firstChar <= 0xDBFF) - && (secondChar >= 0xDC00 && secondChar <= 0xDFFF)); -} -exports.validateSingleChar = validateSingleChar; -/** - * Returns true if the specified string only contains characters permitted by - * the XML specification for names. - */ -function validateName(str) { - if (str.length === 0) { - return false; - } - var initialFirstChar = str.charCodeAt(0); - var initialFirstCharMatch = (initialFirstChar === 0x3A - || initialFirstChar === 0x5F - || (initialFirstChar >= 0x41 && initialFirstChar <= 0x5A) - || (initialFirstChar >= 0x61 && initialFirstChar <= 0x7A) - || (initialFirstChar >= 0xC0 && initialFirstChar <= 0xD6) - || (initialFirstChar >= 0xD8 && initialFirstChar <= 0xF6) - || (initialFirstChar >= 0XF8 && initialFirstChar <= 0X2FF) - || (initialFirstChar >= 0x370 && initialFirstChar <= 0x37D) - || (initialFirstChar >= 0x37F && initialFirstChar <= 0X1FFF) - || (initialFirstChar >= 0x200C && initialFirstChar <= 0x200D) - || (initialFirstChar >= 0x2070 && initialFirstChar <= 0x218F) - || (initialFirstChar >= 0x2C00 && initialFirstChar <= 0x2FEF) - || (initialFirstChar >= 0x3001 && initialFirstChar <= 0xD7FF) - || (initialFirstChar >= 0xF900 && initialFirstChar <= 0xFDCF) - || (initialFirstChar >= 0xFDF0 && initialFirstChar <= 0xFFFD)); - if (str.length === 1) { - return initialFirstCharMatch; - } - // UTF-16 surrogate characters - var initialSecondChar = str.charCodeAt(1); - var initialSecondCharMatch = ((initialFirstChar >= 0xD800 && initialFirstChar <= 0xDB7F) - && (initialSecondChar >= 0xDC00 && initialSecondChar <= 0xDFFF)); - if (!initialFirstCharMatch && !initialSecondCharMatch) { - return false; - } - var start = initialSecondCharMatch ? 2 : 1; - for (var i = start; i < str.length; i++) { - var firstChar = str.charCodeAt(i); - if (firstChar === 0x3A - || firstChar === 0x5F - || firstChar === 0x2D - || firstChar === 0x2E - || firstChar === 0xB7 - || (firstChar >= 0x30 && firstChar <= 0x39) - || (firstChar >= 0x41 && firstChar <= 0x5A) - || (firstChar >= 0x61 && firstChar <= 0x7A) - || (firstChar >= 0xC0 && firstChar <= 0xD6) - || (firstChar >= 0xD8 && firstChar <= 0xF6) - || (firstChar >= 0XF8 && firstChar <= 0X2FF) - || (firstChar >= 0x300 && firstChar <= 0x36F) - || (firstChar >= 0x370 && firstChar <= 0x37D) - || (firstChar >= 0x37F && firstChar <= 0X1FFF) - || (firstChar >= 0x200C && firstChar <= 0x200D) - || (firstChar >= 0x203F && firstChar <= 0x2040) - || (firstChar >= 0x2070 && firstChar <= 0x218F) - || (firstChar >= 0x2C00 && firstChar <= 0x2FEF) - || (firstChar >= 0x3001 && firstChar <= 0xD7FF) - || (firstChar >= 0xF900 && firstChar <= 0xFDCF) - || (firstChar >= 0xFDF0 && firstChar <= 0xFFFD)) { - continue; - } - if (i + 1 === str.length) { - return false; - } - // UTF-16 surrogate characters - var secondChar = str.charCodeAt(i + 1); - if ((firstChar >= 0xD800 && firstChar <= 0xDB7F) - && (secondChar >= 0xDC00 && secondChar <= 0xDFFF)) { - i++; - continue; - } - return false; - } - return true; -} -exports.validateName = validateName; -/** - * Returns a version of the specified string that only contains characters - * permitted by the XML specification for names, with invalid characters - * replaced by the replacement character U+FFFD. - */ -function fixName(str) { - var newStr = ""; - if (str.length === 0) { - return newStr; - } - var initialFirstChar = str.charCodeAt(0); - var initialFirstCharMatch = (initialFirstChar === 0x3A - || initialFirstChar === 0x5F - || (initialFirstChar >= 0x41 && initialFirstChar <= 0x5A) - || (initialFirstChar >= 0x61 && initialFirstChar <= 0x7A) - || (initialFirstChar >= 0xC0 && initialFirstChar <= 0xD6) - || (initialFirstChar >= 0xD8 && initialFirstChar <= 0xF6) - || (initialFirstChar >= 0XF8 && initialFirstChar <= 0X2FF) - || (initialFirstChar >= 0x370 && initialFirstChar <= 0x37D) - || (initialFirstChar >= 0x37F && initialFirstChar <= 0X1FFF) - || (initialFirstChar >= 0x200C && initialFirstChar <= 0x200D) - || (initialFirstChar >= 0x2070 && initialFirstChar <= 0x218F) - || (initialFirstChar >= 0x2C00 && initialFirstChar <= 0x2FEF) - || (initialFirstChar >= 0x3001 && initialFirstChar <= 0xD7FF) - || (initialFirstChar >= 0xF900 && initialFirstChar <= 0xFDCF) - || (initialFirstChar >= 0xFDF0 && initialFirstChar <= 0xFFFD)); - if (str.length === 1) { - if (initialFirstCharMatch) { - newStr = str[0]; - } - else { - newStr = "\uFFFD"; - } - return newStr; - } - // UTF-16 surrogate characters - var initialSecondChar = str.charCodeAt(1); - var initialSecondCharMatch = ((initialFirstChar >= 0xD800 && initialFirstChar <= 0xDB7F) - && (initialSecondChar >= 0xDC00 && initialSecondChar <= 0xDFFF)); - if (initialSecondCharMatch) { - newStr = str[0] + str[1]; - } - else if (initialFirstCharMatch) { - newStr = str[0]; - } - else { - newStr = "\uFFFD"; - } - var start = initialSecondCharMatch ? 2 : 1; - for (var i = start; i < str.length; i++) { - var firstChar = str.charCodeAt(i); - if (firstChar === 0x3A - || firstChar === 0x5F - || firstChar === 0x2D - || firstChar === 0x2E - || firstChar === 0xB7 - || (firstChar >= 0x30 && firstChar <= 0x39) - || (firstChar >= 0x41 && firstChar <= 0x5A) - || (firstChar >= 0x61 && firstChar <= 0x7A) - || (firstChar >= 0xC0 && firstChar <= 0xD6) - || (firstChar >= 0xD8 && firstChar <= 0xF6) - || (firstChar >= 0XF8 && firstChar <= 0X2FF) - || (firstChar >= 0x300 && firstChar <= 0x36F) - || (firstChar >= 0x370 && firstChar <= 0x37D) - || (firstChar >= 0x37F && firstChar <= 0X1FFF) - || (firstChar >= 0x200C && firstChar <= 0x200D) - || (firstChar >= 0x203F && firstChar <= 0x2040) - || (firstChar >= 0x2070 && firstChar <= 0x218F) - || (firstChar >= 0x2C00 && firstChar <= 0x2FEF) - || (firstChar >= 0x3001 && firstChar <= 0xD7FF) - || (firstChar >= 0xF900 && firstChar <= 0xFDCF) - || (firstChar >= 0xFDF0 && firstChar <= 0xFFFD)) { - newStr += str[i]; - continue; - } - if (i + 1 === str.length) { - newStr += "\uFFFD"; - return newStr; - } - // UTF-16 surrogate characters - var secondChar = str.charCodeAt(i + 1); - if ((firstChar >= 0xD800 && firstChar <= 0xDB7F) - && (secondChar >= 0xDC00 && secondChar <= 0xDFFF)) { - newStr += str[i] + str[i + 1]; - i++; - continue; - } - newStr += "\uFFFD"; - } - return newStr; -} -exports.fixName = fixName; -/** - * Returns true if the specified value is undefined. - */ -function isUndefined(val) { - return Object.prototype.toString.call(val) === "[object Undefined]"; -} -exports.isUndefined = isUndefined; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/package.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/package.json deleted file mode 100644 index 642d91b5..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/xmlcreate/package.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "name": "xmlcreate", - "version": "2.0.4", - "description": "Simple XML builder for Node.js", - "keywords": [ - "build", - "builder", - "create", - "creator", - "xml" - ], - "license": "Apache-2.0", - "author": { - "name": "Michael Kourlas", - "email": "michael@kourlas.com" - }, - "files": [ - "lib", - "CHANGES.md", - "LICENSE", - "NOTICE", - "package.json", - "README.md" - ], - "main": "./lib/main.js", - "typings": "./lib/main", - "repository": { - "type": "git", - "url": "git://github.com/michaelkourlas/node-xmlcreate.git" - }, - "scripts": { - "build": "npm run-script prod && npm run-script test-prod && npm run-script docs", - "clean": "rimraf lib", - "clean-docs": "rimraf docs", - "clean-test": "rimraf test/lib", - "dev": "npm run-script clean && npm run-script lint && tsc -p tsconfig.json --sourceMap", - "docs": "npm run-script clean-docs && typedoc --out docs --excludePrivate src/main.ts", - "lint": "eslint . --ext .ts", - "prod": "npm run-script clean && npm run-script lint && tsc -p tsconfig.json", - "test-dev": "npm run-script clean-test && tsc -p test/tsconfig.json --sourceMap && mocha --recursive test/lib", - "test-prod": "npm run-script clean-test && tsc -p test/tsconfig.json && mocha --recursive test/lib" - }, - "devDependencies": { - "@types/chai": "^4.2.22", - "@types/mocha": "^9.0.0", - "@typescript-eslint/eslint-plugin": "^5.2.0", - "@typescript-eslint/parser": "^5.2.0", - "chai": "^4.3.4", - "eslint": "^8.1.0", - "mocha": "^9.1.3", - "rimraf": "^3.0.2", - "typedoc": "^0.22.7", - "typescript": "^4.4.4" - } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/y18n/CHANGELOG.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/y18n/CHANGELOG.md deleted file mode 100644 index 244d8385..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/y18n/CHANGELOG.md +++ /dev/null @@ -1,100 +0,0 @@ -# Change Log - -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. - -### [5.0.8](https://www.github.com/yargs/y18n/compare/v5.0.7...v5.0.8) (2021-04-07) - - -### Bug Fixes - -* **deno:** force modern release for Deno ([b1c215a](https://www.github.com/yargs/y18n/commit/b1c215aed714bee5830e76de3e335504dc2c4dab)) - -### [5.0.7](https://www.github.com/yargs/y18n/compare/v5.0.6...v5.0.7) (2021-04-07) - - -### Bug Fixes - -* **deno:** force release for deno ([#121](https://www.github.com/yargs/y18n/issues/121)) ([d3f2560](https://www.github.com/yargs/y18n/commit/d3f2560e6cedf2bfa2352e9eec044da53f9a06b2)) - -### [5.0.6](https://www.github.com/yargs/y18n/compare/v5.0.5...v5.0.6) (2021-04-05) - - -### Bug Fixes - -* **webpack:** skip readFileSync if not defined ([#117](https://www.github.com/yargs/y18n/issues/117)) ([6966fa9](https://www.github.com/yargs/y18n/commit/6966fa91d2881cc6a6c531e836099e01f4da1616)) - -### [5.0.5](https://www.github.com/yargs/y18n/compare/v5.0.4...v5.0.5) (2020-10-25) - - -### Bug Fixes - -* address prototype pollution issue ([#108](https://www.github.com/yargs/y18n/issues/108)) ([a9ac604](https://www.github.com/yargs/y18n/commit/a9ac604abf756dec9687be3843e2c93bfe581f25)) - -### [5.0.4](https://www.github.com/yargs/y18n/compare/v5.0.3...v5.0.4) (2020-10-16) - - -### Bug Fixes - -* **exports:** node 13.0 and 13.1 require the dotted object form _with_ a string fallback ([#105](https://www.github.com/yargs/y18n/issues/105)) ([4f85d80](https://www.github.com/yargs/y18n/commit/4f85d80dbaae6d2c7899ae394f7ad97805df4886)) - -### [5.0.3](https://www.github.com/yargs/y18n/compare/v5.0.2...v5.0.3) (2020-10-16) - - -### Bug Fixes - -* **exports:** node 13.0-13.6 require a string fallback ([#103](https://www.github.com/yargs/y18n/issues/103)) ([e39921e](https://www.github.com/yargs/y18n/commit/e39921e1017f88f5d8ea97ddea854ffe92d68e74)) - -### [5.0.2](https://www.github.com/yargs/y18n/compare/v5.0.1...v5.0.2) (2020-10-01) - - -### Bug Fixes - -* **deno:** update types for deno ^1.4.0 ([#100](https://www.github.com/yargs/y18n/issues/100)) ([3834d9a](https://www.github.com/yargs/y18n/commit/3834d9ab1332f2937c935ada5e76623290efae81)) - -### [5.0.1](https://www.github.com/yargs/y18n/compare/v5.0.0...v5.0.1) (2020-09-05) - - -### Bug Fixes - -* main had old index path ([#98](https://www.github.com/yargs/y18n/issues/98)) ([124f7b0](https://www.github.com/yargs/y18n/commit/124f7b047ba9596bdbdf64459988304e77f3de1b)) - -## [5.0.0](https://www.github.com/yargs/y18n/compare/v4.0.0...v5.0.0) (2020-09-05) - - -### ⚠ BREAKING CHANGES - -* exports maps are now used, which modifies import behavior. -* drops Node 6 and 4. begin following Node.js LTS schedule (#89) - -### Features - -* add support for ESM and Deno [#95](https://www.github.com/yargs/y18n/issues/95)) ([4d7ae94](https://www.github.com/yargs/y18n/commit/4d7ae94bcb42e84164e2180366474b1cd321ed94)) - - -### Build System - -* drops Node 6 and 4. begin following Node.js LTS schedule ([#89](https://www.github.com/yargs/y18n/issues/89)) ([3cc0c28](https://www.github.com/yargs/y18n/commit/3cc0c287240727b84eaf1927f903612ec80f5e43)) - -### 4.0.1 (2020-10-25) - - -### Bug Fixes - -* address prototype pollution issue ([#108](https://www.github.com/yargs/y18n/issues/108)) ([a9ac604](https://www.github.com/yargs/y18n/commit/7de58ca0d315990cdb38234e97fc66254cdbcd71)) - -## [4.0.0](https://github.com/yargs/y18n/compare/v3.2.1...v4.0.0) (2017-10-10) - - -### Bug Fixes - -* allow support for falsy values like 0 in tagged literal ([#45](https://github.com/yargs/y18n/issues/45)) ([c926123](https://github.com/yargs/y18n/commit/c926123)) - - -### Features - -* **__:** added tagged template literal support ([#44](https://github.com/yargs/y18n/issues/44)) ([0598daf](https://github.com/yargs/y18n/commit/0598daf)) - - -### BREAKING CHANGES - -* **__:** dropping Node 0.10/Node 0.12 support diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/y18n/LICENSE b/packages/wyatt_notification_bloc/example/scripts/node_modules/y18n/LICENSE deleted file mode 100644 index 3c157f0b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/y18n/LICENSE +++ /dev/null @@ -1,13 +0,0 @@ -Copyright (c) 2015, Contributors - -Permission to use, copy, modify, and/or distribute this software for any purpose -with or without fee is hereby granted, provided that the above copyright notice -and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS -OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER -TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF -THIS SOFTWARE. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/y18n/README.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/y18n/README.md deleted file mode 100644 index 5102bb17..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/y18n/README.md +++ /dev/null @@ -1,127 +0,0 @@ -# y18n - -[![NPM version][npm-image]][npm-url] -[![js-standard-style][standard-image]][standard-url] -[![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg)](https://conventionalcommits.org) - -The bare-bones internationalization library used by yargs. - -Inspired by [i18n](https://www.npmjs.com/package/i18n). - -## Examples - -_simple string translation:_ - -```js -const __ = require('y18n')().__; - -console.log(__('my awesome string %s', 'foo')); -``` - -output: - -`my awesome string foo` - -_using tagged template literals_ - -```js -const __ = require('y18n')().__; - -const str = 'foo'; - -console.log(__`my awesome string ${str}`); -``` - -output: - -`my awesome string foo` - -_pluralization support:_ - -```js -const __n = require('y18n')().__n; - -console.log(__n('one fish %s', '%d fishes %s', 2, 'foo')); -``` - -output: - -`2 fishes foo` - -## Deno Example - -As of `v5` `y18n` supports [Deno](https://github.com/denoland/deno): - -```typescript -import y18n from "https://deno.land/x/y18n/deno.ts"; - -const __ = y18n({ - locale: 'pirate', - directory: './test/locales' -}).__ - -console.info(__`Hi, ${'Ben'} ${'Coe'}!`) -``` - -You will need to run with `--allow-read` to load alternative locales. - -## JSON Language Files - -The JSON language files should be stored in a `./locales` folder. -File names correspond to locales, e.g., `en.json`, `pirate.json`. - -When strings are observed for the first time they will be -added to the JSON file corresponding to the current locale. - -## Methods - -### require('y18n')(config) - -Create an instance of y18n with the config provided, options include: - -* `directory`: the locale directory, default `./locales`. -* `updateFiles`: should newly observed strings be updated in file, default `true`. -* `locale`: what locale should be used. -* `fallbackToLanguage`: should fallback to a language-only file (e.g. `en.json`) - be allowed if a file matching the locale does not exist (e.g. `en_US.json`), - default `true`. - -### y18n.\_\_(str, arg, arg, arg) - -Print a localized string, `%s` will be replaced with `arg`s. - -This function can also be used as a tag for a template literal. You can use it -like this: __`hello ${'world'}`. This will be equivalent to -`__('hello %s', 'world')`. - -### y18n.\_\_n(singularString, pluralString, count, arg, arg, arg) - -Print a localized string with appropriate pluralization. If `%d` is provided -in the string, the `count` will replace this placeholder. - -### y18n.setLocale(str) - -Set the current locale being used. - -### y18n.getLocale() - -What locale is currently being used? - -### y18n.updateLocale(obj) - -Update the current locale with the key value pairs in `obj`. - -## Supported Node.js Versions - -Libraries in this ecosystem make a best effort to track -[Node.js' release schedule](https://nodejs.org/en/about/releases/). Here's [a -post on why we think this is important](https://medium.com/the-node-js-collection/maintainers-should-consider-following-node-js-release-schedule-ab08ed4de71a). - -## License - -ISC - -[npm-url]: https://npmjs.org/package/y18n -[npm-image]: https://img.shields.io/npm/v/y18n.svg -[standard-image]: https://img.shields.io/badge/code%20style-standard-brightgreen.svg -[standard-url]: https://github.com/feross/standard diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/y18n/index.mjs b/packages/wyatt_notification_bloc/example/scripts/node_modules/y18n/index.mjs deleted file mode 100644 index 46c82133..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/y18n/index.mjs +++ /dev/null @@ -1,8 +0,0 @@ -import shim from './build/lib/platform-shims/node.js' -import { y18n as _y18n } from './build/lib/index.js' - -const y18n = (opts) => { - return _y18n(opts, shim) -} - -export default y18n diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/y18n/package.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/y18n/package.json deleted file mode 100644 index 4e5c1ca6..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/y18n/package.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "name": "y18n", - "version": "5.0.8", - "description": "the bare-bones internationalization library used by yargs", - "exports": { - ".": [ - { - "import": "./index.mjs", - "require": "./build/index.cjs" - }, - "./build/index.cjs" - ] - }, - "type": "module", - "module": "./build/lib/index.js", - "keywords": [ - "i18n", - "internationalization", - "yargs" - ], - "homepage": "https://github.com/yargs/y18n", - "bugs": { - "url": "https://github.com/yargs/y18n/issues" - }, - "repository": "yargs/y18n", - "license": "ISC", - "author": "Ben Coe ", - "main": "./build/index.cjs", - "scripts": { - "check": "standardx **/*.ts **/*.cjs **/*.mjs", - "fix": "standardx --fix **/*.ts **/*.cjs **/*.mjs", - "pretest": "rimraf build && tsc -p tsconfig.test.json && cross-env NODE_ENV=test npm run build:cjs", - "test": "c8 --reporter=text --reporter=html mocha test/*.cjs", - "test:esm": "c8 --reporter=text --reporter=html mocha test/esm/*.mjs", - "posttest": "npm run check", - "coverage": "c8 report --check-coverage", - "precompile": "rimraf build", - "compile": "tsc", - "postcompile": "npm run build:cjs", - "build:cjs": "rollup -c", - "prepare": "npm run compile" - }, - "devDependencies": { - "@types/node": "^14.6.4", - "@wessberg/rollup-plugin-ts": "^1.3.1", - "c8": "^7.3.0", - "chai": "^4.0.1", - "cross-env": "^7.0.2", - "gts": "^3.0.0", - "mocha": "^8.0.0", - "rimraf": "^3.0.2", - "rollup": "^2.26.10", - "standardx": "^7.0.0", - "ts-transform-default-export": "^1.0.2", - "typescript": "^4.0.0" - }, - "files": [ - "build", - "index.mjs", - "!*.d.ts" - ], - "engines": { - "node": ">=10" - }, - "standardx": { - "ignore": [ - "build" - ] - } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/yallist/LICENSE b/packages/wyatt_notification_bloc/example/scripts/node_modules/yallist/LICENSE deleted file mode 100644 index 19129e31..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/yallist/LICENSE +++ /dev/null @@ -1,15 +0,0 @@ -The ISC License - -Copyright (c) Isaac Z. Schlueter and Contributors - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR -IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/yallist/README.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/yallist/README.md deleted file mode 100644 index f5861018..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/yallist/README.md +++ /dev/null @@ -1,204 +0,0 @@ -# yallist - -Yet Another Linked List - -There are many doubly-linked list implementations like it, but this -one is mine. - -For when an array would be too big, and a Map can't be iterated in -reverse order. - - -[![Build Status](https://travis-ci.org/isaacs/yallist.svg?branch=master)](https://travis-ci.org/isaacs/yallist) [![Coverage Status](https://coveralls.io/repos/isaacs/yallist/badge.svg?service=github)](https://coveralls.io/github/isaacs/yallist) - -## basic usage - -```javascript -var yallist = require('yallist') -var myList = yallist.create([1, 2, 3]) -myList.push('foo') -myList.unshift('bar') -// of course pop() and shift() are there, too -console.log(myList.toArray()) // ['bar', 1, 2, 3, 'foo'] -myList.forEach(function (k) { - // walk the list head to tail -}) -myList.forEachReverse(function (k, index, list) { - // walk the list tail to head -}) -var myDoubledList = myList.map(function (k) { - return k + k -}) -// now myDoubledList contains ['barbar', 2, 4, 6, 'foofoo'] -// mapReverse is also a thing -var myDoubledListReverse = myList.mapReverse(function (k) { - return k + k -}) // ['foofoo', 6, 4, 2, 'barbar'] - -var reduced = myList.reduce(function (set, entry) { - set += entry - return set -}, 'start') -console.log(reduced) // 'startfoo123bar' -``` - -## api - -The whole API is considered "public". - -Functions with the same name as an Array method work more or less the -same way. - -There's reverse versions of most things because that's the point. - -### Yallist - -Default export, the class that holds and manages a list. - -Call it with either a forEach-able (like an array) or a set of -arguments, to initialize the list. - -The Array-ish methods all act like you'd expect. No magic length, -though, so if you change that it won't automatically prune or add -empty spots. - -### Yallist.create(..) - -Alias for Yallist function. Some people like factories. - -#### yallist.head - -The first node in the list - -#### yallist.tail - -The last node in the list - -#### yallist.length - -The number of nodes in the list. (Change this at your peril. It is -not magic like Array length.) - -#### yallist.toArray() - -Convert the list to an array. - -#### yallist.forEach(fn, [thisp]) - -Call a function on each item in the list. - -#### yallist.forEachReverse(fn, [thisp]) - -Call a function on each item in the list, in reverse order. - -#### yallist.get(n) - -Get the data at position `n` in the list. If you use this a lot, -probably better off just using an Array. - -#### yallist.getReverse(n) - -Get the data at position `n`, counting from the tail. - -#### yallist.map(fn, thisp) - -Create a new Yallist with the result of calling the function on each -item. - -#### yallist.mapReverse(fn, thisp) - -Same as `map`, but in reverse. - -#### yallist.pop() - -Get the data from the list tail, and remove the tail from the list. - -#### yallist.push(item, ...) - -Insert one or more items to the tail of the list. - -#### yallist.reduce(fn, initialValue) - -Like Array.reduce. - -#### yallist.reduceReverse - -Like Array.reduce, but in reverse. - -#### yallist.reverse - -Reverse the list in place. - -#### yallist.shift() - -Get the data from the list head, and remove the head from the list. - -#### yallist.slice([from], [to]) - -Just like Array.slice, but returns a new Yallist. - -#### yallist.sliceReverse([from], [to]) - -Just like yallist.slice, but the result is returned in reverse. - -#### yallist.toArray() - -Create an array representation of the list. - -#### yallist.toArrayReverse() - -Create a reversed array representation of the list. - -#### yallist.unshift(item, ...) - -Insert one or more items to the head of the list. - -#### yallist.unshiftNode(node) - -Move a Node object to the front of the list. (That is, pull it out of -wherever it lives, and make it the new head.) - -If the node belongs to a different list, then that list will remove it -first. - -#### yallist.pushNode(node) - -Move a Node object to the end of the list. (That is, pull it out of -wherever it lives, and make it the new tail.) - -If the node belongs to a list already, then that list will remove it -first. - -#### yallist.removeNode(node) - -Remove a node from the list, preserving referential integrity of head -and tail and other nodes. - -Will throw an error if you try to have a list remove a node that -doesn't belong to it. - -### Yallist.Node - -The class that holds the data and is actually the list. - -Call with `var n = new Node(value, previousNode, nextNode)` - -Note that if you do direct operations on Nodes themselves, it's very -easy to get into weird states where the list is broken. Be careful :) - -#### node.next - -The next node in the list. - -#### node.prev - -The previous node in the list. - -#### node.value - -The data the node contains. - -#### node.list - -The list to which this node belongs. (Null if it does not belong to -any list.) diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/yallist/iterator.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/yallist/iterator.js deleted file mode 100644 index d41c97a1..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/yallist/iterator.js +++ /dev/null @@ -1,8 +0,0 @@ -'use strict' -module.exports = function (Yallist) { - Yallist.prototype[Symbol.iterator] = function* () { - for (let walker = this.head; walker; walker = walker.next) { - yield walker.value - } - } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/yallist/package.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/yallist/package.json deleted file mode 100644 index 8a083867..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/yallist/package.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "name": "yallist", - "version": "4.0.0", - "description": "Yet Another Linked List", - "main": "yallist.js", - "directories": { - "test": "test" - }, - "files": [ - "yallist.js", - "iterator.js" - ], - "dependencies": {}, - "devDependencies": { - "tap": "^12.1.0" - }, - "scripts": { - "test": "tap test/*.js --100", - "preversion": "npm test", - "postversion": "npm publish", - "postpublish": "git push origin --all; git push origin --tags" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/isaacs/yallist.git" - }, - "author": "Isaac Z. Schlueter (http://blog.izs.me/)", - "license": "ISC" -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/yallist/yallist.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/yallist/yallist.js deleted file mode 100644 index 4e83ab1c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/yallist/yallist.js +++ /dev/null @@ -1,426 +0,0 @@ -'use strict' -module.exports = Yallist - -Yallist.Node = Node -Yallist.create = Yallist - -function Yallist (list) { - var self = this - if (!(self instanceof Yallist)) { - self = new Yallist() - } - - self.tail = null - self.head = null - self.length = 0 - - if (list && typeof list.forEach === 'function') { - list.forEach(function (item) { - self.push(item) - }) - } else if (arguments.length > 0) { - for (var i = 0, l = arguments.length; i < l; i++) { - self.push(arguments[i]) - } - } - - return self -} - -Yallist.prototype.removeNode = function (node) { - if (node.list !== this) { - throw new Error('removing node which does not belong to this list') - } - - var next = node.next - var prev = node.prev - - if (next) { - next.prev = prev - } - - if (prev) { - prev.next = next - } - - if (node === this.head) { - this.head = next - } - if (node === this.tail) { - this.tail = prev - } - - node.list.length-- - node.next = null - node.prev = null - node.list = null - - return next -} - -Yallist.prototype.unshiftNode = function (node) { - if (node === this.head) { - return - } - - if (node.list) { - node.list.removeNode(node) - } - - var head = this.head - node.list = this - node.next = head - if (head) { - head.prev = node - } - - this.head = node - if (!this.tail) { - this.tail = node - } - this.length++ -} - -Yallist.prototype.pushNode = function (node) { - if (node === this.tail) { - return - } - - if (node.list) { - node.list.removeNode(node) - } - - var tail = this.tail - node.list = this - node.prev = tail - if (tail) { - tail.next = node - } - - this.tail = node - if (!this.head) { - this.head = node - } - this.length++ -} - -Yallist.prototype.push = function () { - for (var i = 0, l = arguments.length; i < l; i++) { - push(this, arguments[i]) - } - return this.length -} - -Yallist.prototype.unshift = function () { - for (var i = 0, l = arguments.length; i < l; i++) { - unshift(this, arguments[i]) - } - return this.length -} - -Yallist.prototype.pop = function () { - if (!this.tail) { - return undefined - } - - var res = this.tail.value - this.tail = this.tail.prev - if (this.tail) { - this.tail.next = null - } else { - this.head = null - } - this.length-- - return res -} - -Yallist.prototype.shift = function () { - if (!this.head) { - return undefined - } - - var res = this.head.value - this.head = this.head.next - if (this.head) { - this.head.prev = null - } else { - this.tail = null - } - this.length-- - return res -} - -Yallist.prototype.forEach = function (fn, thisp) { - thisp = thisp || this - for (var walker = this.head, i = 0; walker !== null; i++) { - fn.call(thisp, walker.value, i, this) - walker = walker.next - } -} - -Yallist.prototype.forEachReverse = function (fn, thisp) { - thisp = thisp || this - for (var walker = this.tail, i = this.length - 1; walker !== null; i--) { - fn.call(thisp, walker.value, i, this) - walker = walker.prev - } -} - -Yallist.prototype.get = function (n) { - for (var i = 0, walker = this.head; walker !== null && i < n; i++) { - // abort out of the list early if we hit a cycle - walker = walker.next - } - if (i === n && walker !== null) { - return walker.value - } -} - -Yallist.prototype.getReverse = function (n) { - for (var i = 0, walker = this.tail; walker !== null && i < n; i++) { - // abort out of the list early if we hit a cycle - walker = walker.prev - } - if (i === n && walker !== null) { - return walker.value - } -} - -Yallist.prototype.map = function (fn, thisp) { - thisp = thisp || this - var res = new Yallist() - for (var walker = this.head; walker !== null;) { - res.push(fn.call(thisp, walker.value, this)) - walker = walker.next - } - return res -} - -Yallist.prototype.mapReverse = function (fn, thisp) { - thisp = thisp || this - var res = new Yallist() - for (var walker = this.tail; walker !== null;) { - res.push(fn.call(thisp, walker.value, this)) - walker = walker.prev - } - return res -} - -Yallist.prototype.reduce = function (fn, initial) { - var acc - var walker = this.head - if (arguments.length > 1) { - acc = initial - } else if (this.head) { - walker = this.head.next - acc = this.head.value - } else { - throw new TypeError('Reduce of empty list with no initial value') - } - - for (var i = 0; walker !== null; i++) { - acc = fn(acc, walker.value, i) - walker = walker.next - } - - return acc -} - -Yallist.prototype.reduceReverse = function (fn, initial) { - var acc - var walker = this.tail - if (arguments.length > 1) { - acc = initial - } else if (this.tail) { - walker = this.tail.prev - acc = this.tail.value - } else { - throw new TypeError('Reduce of empty list with no initial value') - } - - for (var i = this.length - 1; walker !== null; i--) { - acc = fn(acc, walker.value, i) - walker = walker.prev - } - - return acc -} - -Yallist.prototype.toArray = function () { - var arr = new Array(this.length) - for (var i = 0, walker = this.head; walker !== null; i++) { - arr[i] = walker.value - walker = walker.next - } - return arr -} - -Yallist.prototype.toArrayReverse = function () { - var arr = new Array(this.length) - for (var i = 0, walker = this.tail; walker !== null; i++) { - arr[i] = walker.value - walker = walker.prev - } - return arr -} - -Yallist.prototype.slice = function (from, to) { - to = to || this.length - if (to < 0) { - to += this.length - } - from = from || 0 - if (from < 0) { - from += this.length - } - var ret = new Yallist() - if (to < from || to < 0) { - return ret - } - if (from < 0) { - from = 0 - } - if (to > this.length) { - to = this.length - } - for (var i = 0, walker = this.head; walker !== null && i < from; i++) { - walker = walker.next - } - for (; walker !== null && i < to; i++, walker = walker.next) { - ret.push(walker.value) - } - return ret -} - -Yallist.prototype.sliceReverse = function (from, to) { - to = to || this.length - if (to < 0) { - to += this.length - } - from = from || 0 - if (from < 0) { - from += this.length - } - var ret = new Yallist() - if (to < from || to < 0) { - return ret - } - if (from < 0) { - from = 0 - } - if (to > this.length) { - to = this.length - } - for (var i = this.length, walker = this.tail; walker !== null && i > to; i--) { - walker = walker.prev - } - for (; walker !== null && i > from; i--, walker = walker.prev) { - ret.push(walker.value) - } - return ret -} - -Yallist.prototype.splice = function (start, deleteCount, ...nodes) { - if (start > this.length) { - start = this.length - 1 - } - if (start < 0) { - start = this.length + start; - } - - for (var i = 0, walker = this.head; walker !== null && i < start; i++) { - walker = walker.next - } - - var ret = [] - for (var i = 0; walker && i < deleteCount; i++) { - ret.push(walker.value) - walker = this.removeNode(walker) - } - if (walker === null) { - walker = this.tail - } - - if (walker !== this.head && walker !== this.tail) { - walker = walker.prev - } - - for (var i = 0; i < nodes.length; i++) { - walker = insert(this, walker, nodes[i]) - } - return ret; -} - -Yallist.prototype.reverse = function () { - var head = this.head - var tail = this.tail - for (var walker = head; walker !== null; walker = walker.prev) { - var p = walker.prev - walker.prev = walker.next - walker.next = p - } - this.head = tail - this.tail = head - return this -} - -function insert (self, node, value) { - var inserted = node === self.head ? - new Node(value, null, node, self) : - new Node(value, node, node.next, self) - - if (inserted.next === null) { - self.tail = inserted - } - if (inserted.prev === null) { - self.head = inserted - } - - self.length++ - - return inserted -} - -function push (self, item) { - self.tail = new Node(item, self.tail, null, self) - if (!self.head) { - self.head = self.tail - } - self.length++ -} - -function unshift (self, item) { - self.head = new Node(item, null, self.head, self) - if (!self.tail) { - self.tail = self.head - } - self.length++ -} - -function Node (value, prev, next, list) { - if (!(this instanceof Node)) { - return new Node(value, prev, next, list) - } - - this.list = list - this.value = value - - if (prev) { - prev.next = this - this.prev = prev - } else { - this.prev = null - } - - if (next) { - next.prev = this - this.next = next - } else { - this.next = null - } -} - -try { - // add if support for Symbol.iterator is present - require('./iterator.js')(Yallist) -} catch (er) {} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/yargs-parser/CHANGELOG.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/yargs-parser/CHANGELOG.md deleted file mode 100644 index 2aad0acb..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/yargs-parser/CHANGELOG.md +++ /dev/null @@ -1,263 +0,0 @@ -# Changelog - -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. - -### [20.2.9](https://www.github.com/yargs/yargs-parser/compare/yargs-parser-v20.2.8...yargs-parser-v20.2.9) (2021-06-20) - - -### Bug Fixes - -* **build:** fixed automated release pipeline ([1fe9135](https://www.github.com/yargs/yargs-parser/commit/1fe9135884790a083615419b2861683e2597dac3)) - -### [20.2.8](https://www.github.com/yargs/yargs-parser/compare/yargs-parser-v20.2.7...yargs-parser-v20.2.8) (2021-06-20) - - -### Bug Fixes - -* **locale:** Turkish camelize and decamelize issues with toLocaleLowerCase/toLocaleUpperCase ([2617303](https://www.github.com/yargs/yargs-parser/commit/261730383e02448562f737b94bbd1f164aed5143)) -* **perf:** address slow parse when using unknown-options-as-args ([#394](https://www.github.com/yargs/yargs-parser/issues/394)) ([441f059](https://www.github.com/yargs/yargs-parser/commit/441f059d585d446551068ad213db79ac91daf83a)) -* **string-utils:** detect [0,1] ranged values as numbers ([#388](https://www.github.com/yargs/yargs-parser/issues/388)) ([efcc32c](https://www.github.com/yargs/yargs-parser/commit/efcc32c2d6b09aba31abfa2db9bd947befe5586b)) - -### [20.2.7](https://www.github.com/yargs/yargs-parser/compare/v20.2.6...v20.2.7) (2021-03-10) - - -### Bug Fixes - -* **deno:** force release for Deno ([6687c97](https://www.github.com/yargs/yargs-parser/commit/6687c972d0f3ca7865a97908dde3080b05f8b026)) - -### [20.2.6](https://www.github.com/yargs/yargs-parser/compare/v20.2.5...v20.2.6) (2021-02-22) - - -### Bug Fixes - -* **populate--:** -- should always be array ([#354](https://www.github.com/yargs/yargs-parser/issues/354)) ([585ae8f](https://www.github.com/yargs/yargs-parser/commit/585ae8ffad74cc02974f92d788e750137fd65146)) - -### [20.2.5](https://www.github.com/yargs/yargs-parser/compare/v20.2.4...v20.2.5) (2021-02-13) - - -### Bug Fixes - -* do not lowercase camel cased string ([#348](https://www.github.com/yargs/yargs-parser/issues/348)) ([5f4da1f](https://www.github.com/yargs/yargs-parser/commit/5f4da1f17d9d50542d2aaa206c9806ce3e320335)) - -### [20.2.4](https://www.github.com/yargs/yargs-parser/compare/v20.2.3...v20.2.4) (2020-11-09) - - -### Bug Fixes - -* **deno:** address import issues in Deno ([#339](https://www.github.com/yargs/yargs-parser/issues/339)) ([3b54e5e](https://www.github.com/yargs/yargs-parser/commit/3b54e5eef6e9a7b7c6eec7c12bab3ba3b8ba8306)) - -### [20.2.3](https://www.github.com/yargs/yargs-parser/compare/v20.2.2...v20.2.3) (2020-10-16) - - -### Bug Fixes - -* **exports:** node 13.0 and 13.1 require the dotted object form _with_ a string fallback ([#336](https://www.github.com/yargs/yargs-parser/issues/336)) ([3ae7242](https://www.github.com/yargs/yargs-parser/commit/3ae7242040ff876d28dabded60ac226e00150c88)) - -### [20.2.2](https://www.github.com/yargs/yargs-parser/compare/v20.2.1...v20.2.2) (2020-10-14) - - -### Bug Fixes - -* **exports:** node 13.0-13.6 require a string fallback ([#333](https://www.github.com/yargs/yargs-parser/issues/333)) ([291aeda](https://www.github.com/yargs/yargs-parser/commit/291aeda06b685b7a015d83bdf2558e180b37388d)) - -### [20.2.1](https://www.github.com/yargs/yargs-parser/compare/v20.2.0...v20.2.1) (2020-10-01) - - -### Bug Fixes - -* **deno:** update types for deno ^1.4.0 ([#330](https://www.github.com/yargs/yargs-parser/issues/330)) ([0ab92e5](https://www.github.com/yargs/yargs-parser/commit/0ab92e50b090f11196334c048c9c92cecaddaf56)) - -## [20.2.0](https://www.github.com/yargs/yargs-parser/compare/v20.1.0...v20.2.0) (2020-09-21) - - -### Features - -* **string-utils:** export looksLikeNumber helper ([#324](https://www.github.com/yargs/yargs-parser/issues/324)) ([c8580a2](https://www.github.com/yargs/yargs-parser/commit/c8580a2327b55f6342acecb6e72b62963d506750)) - - -### Bug Fixes - -* **unknown-options-as-args:** convert positionals that look like numbers ([#326](https://www.github.com/yargs/yargs-parser/issues/326)) ([f85ebb4](https://www.github.com/yargs/yargs-parser/commit/f85ebb4face9d4b0f56147659404cbe0002f3dad)) - -## [20.1.0](https://www.github.com/yargs/yargs-parser/compare/v20.0.0...v20.1.0) (2020-09-20) - - -### Features - -* adds parse-positional-numbers configuration ([#321](https://www.github.com/yargs/yargs-parser/issues/321)) ([9cec00a](https://www.github.com/yargs/yargs-parser/commit/9cec00a622251292ffb7dce6f78f5353afaa0d4c)) - - -### Bug Fixes - -* **build:** update release-please; make labels kick off builds ([#323](https://www.github.com/yargs/yargs-parser/issues/323)) ([09f448b](https://www.github.com/yargs/yargs-parser/commit/09f448b4cd66e25d2872544718df46dab8af062a)) - -## [20.0.0](https://www.github.com/yargs/yargs-parser/compare/v19.0.4...v20.0.0) (2020-09-09) - - -### ⚠ BREAKING CHANGES - -* do not ship type definitions (#318) - -### Bug Fixes - -* only strip camel case if hyphenated ([#316](https://www.github.com/yargs/yargs-parser/issues/316)) ([95a9e78](https://www.github.com/yargs/yargs-parser/commit/95a9e785127b9bbf2d1db1f1f808ca1fb100e82a)), closes [#315](https://www.github.com/yargs/yargs-parser/issues/315) - - -### Code Refactoring - -* do not ship type definitions ([#318](https://www.github.com/yargs/yargs-parser/issues/318)) ([8fbd56f](https://www.github.com/yargs/yargs-parser/commit/8fbd56f1d0b6c44c30fca62708812151ca0ce330)) - -### [19.0.4](https://www.github.com/yargs/yargs-parser/compare/v19.0.3...v19.0.4) (2020-08-27) - - -### Bug Fixes - -* **build:** fixing publication ([#310](https://www.github.com/yargs/yargs-parser/issues/310)) ([5d3c6c2](https://www.github.com/yargs/yargs-parser/commit/5d3c6c29a9126248ba601920d9cf87c78e161ff5)) - -### [19.0.3](https://www.github.com/yargs/yargs-parser/compare/v19.0.2...v19.0.3) (2020-08-27) - - -### Bug Fixes - -* **build:** switch to action for publish ([#308](https://www.github.com/yargs/yargs-parser/issues/308)) ([5c2f305](https://www.github.com/yargs/yargs-parser/commit/5c2f30585342bcd8aaf926407c863099d256d174)) - -### [19.0.2](https://www.github.com/yargs/yargs-parser/compare/v19.0.1...v19.0.2) (2020-08-27) - - -### Bug Fixes - -* **types:** envPrefix should be optional ([#305](https://www.github.com/yargs/yargs-parser/issues/305)) ([ae3f180](https://www.github.com/yargs/yargs-parser/commit/ae3f180e14df2de2fd962145f4518f9aa0e76523)) - -### [19.0.1](https://www.github.com/yargs/yargs-parser/compare/v19.0.0...v19.0.1) (2020-08-09) - - -### Bug Fixes - -* **build:** push tag created for deno ([2186a14](https://www.github.com/yargs/yargs-parser/commit/2186a14989749887d56189867602e39e6679f8b0)) - -## [19.0.0](https://www.github.com/yargs/yargs-parser/compare/v18.1.3...v19.0.0) (2020-08-09) - - -### ⚠ BREAKING CHANGES - -* adds support for ESM and Deno (#295) -* **ts:** projects using `@types/yargs-parser` may see variations in type definitions. -* drops Node 6. begin following Node.js LTS schedule (#278) - -### Features - -* adds support for ESM and Deno ([#295](https://www.github.com/yargs/yargs-parser/issues/295)) ([195bc4a](https://www.github.com/yargs/yargs-parser/commit/195bc4a7f20c2a8f8e33fbb6ba96ef6e9a0120a1)) -* expose camelCase and decamelize helpers ([#296](https://www.github.com/yargs/yargs-parser/issues/296)) ([39154ce](https://www.github.com/yargs/yargs-parser/commit/39154ceb5bdcf76b5f59a9219b34cedb79b67f26)) -* **deps:** update to latest camelcase/decamelize ([#281](https://www.github.com/yargs/yargs-parser/issues/281)) ([8931ab0](https://www.github.com/yargs/yargs-parser/commit/8931ab08f686cc55286f33a95a83537da2be5516)) - - -### Bug Fixes - -* boolean numeric short option ([#294](https://www.github.com/yargs/yargs-parser/issues/294)) ([f600082](https://www.github.com/yargs/yargs-parser/commit/f600082c959e092076caf420bbbc9d7a231e2418)) -* raise permission error for Deno if config load fails ([#298](https://www.github.com/yargs/yargs-parser/issues/298)) ([1174e2b](https://www.github.com/yargs/yargs-parser/commit/1174e2b3f0c845a1cd64e14ffc3703e730567a84)) -* **deps:** update dependency decamelize to v3 ([#274](https://www.github.com/yargs/yargs-parser/issues/274)) ([4d98698](https://www.github.com/yargs/yargs-parser/commit/4d98698bc6767e84ec54a0842908191739be73b7)) -* **types:** switch back to using Partial types ([#293](https://www.github.com/yargs/yargs-parser/issues/293)) ([bdc80ba](https://www.github.com/yargs/yargs-parser/commit/bdc80ba59fa13bc3025ce0a85e8bad9f9da24ea7)) - - -### Build System - -* drops Node 6. begin following Node.js LTS schedule ([#278](https://www.github.com/yargs/yargs-parser/issues/278)) ([9014ed7](https://www.github.com/yargs/yargs-parser/commit/9014ed722a32768b96b829e65a31705db5c1458a)) - - -### Code Refactoring - -* **ts:** move index.js to TypeScript ([#292](https://www.github.com/yargs/yargs-parser/issues/292)) ([f78d2b9](https://www.github.com/yargs/yargs-parser/commit/f78d2b97567ac4828624406e420b4047c710b789)) - -### [18.1.3](https://www.github.com/yargs/yargs-parser/compare/v18.1.2...v18.1.3) (2020-04-16) - - -### Bug Fixes - -* **setArg:** options using camel-case and dot-notation populated twice ([#268](https://www.github.com/yargs/yargs-parser/issues/268)) ([f7e15b9](https://www.github.com/yargs/yargs-parser/commit/f7e15b9800900b9856acac1a830a5f35847be73e)) - -### [18.1.2](https://www.github.com/yargs/yargs-parser/compare/v18.1.1...v18.1.2) (2020-03-26) - - -### Bug Fixes - -* **array, nargs:** support -o=--value and --option=--value format ([#262](https://www.github.com/yargs/yargs-parser/issues/262)) ([41d3f81](https://www.github.com/yargs/yargs-parser/commit/41d3f8139e116706b28de9b0de3433feb08d2f13)) - -### [18.1.1](https://www.github.com/yargs/yargs-parser/compare/v18.1.0...v18.1.1) (2020-03-16) - - -### Bug Fixes - -* \_\_proto\_\_ will now be replaced with \_\_\_proto\_\_\_ in parse ([#258](https://www.github.com/yargs/yargs-parser/issues/258)), patching a potential -prototype pollution vulnerability. This was reported by the Snyk Security Research Team.([63810ca](https://www.github.com/yargs/yargs-parser/commit/63810ca1ae1a24b08293a4d971e70e058c7a41e2)) - -## [18.1.0](https://www.github.com/yargs/yargs-parser/compare/v18.0.0...v18.1.0) (2020-03-07) - - -### Features - -* introduce single-digit boolean aliases ([#255](https://www.github.com/yargs/yargs-parser/issues/255)) ([9c60265](https://www.github.com/yargs/yargs-parser/commit/9c60265fd7a03cb98e6df3e32c8c5e7508d9f56f)) - -## [18.0.0](https://www.github.com/yargs/yargs-parser/compare/v17.1.0...v18.0.0) (2020-03-02) - - -### ⚠ BREAKING CHANGES - -* the narg count is now enforced when parsing arrays. - -### Features - -* NaN can now be provided as a value for nargs, indicating "at least" one value is expected for array ([#251](https://www.github.com/yargs/yargs-parser/issues/251)) ([9db4be8](https://www.github.com/yargs/yargs-parser/commit/9db4be81417a2c7097128db34d86fe70ef4af70c)) - -## [17.1.0](https://www.github.com/yargs/yargs-parser/compare/v17.0.1...v17.1.0) (2020-03-01) - - -### Features - -* introduce greedy-arrays config, for specifying whether arrays consume multiple positionals ([#249](https://www.github.com/yargs/yargs-parser/issues/249)) ([60e880a](https://www.github.com/yargs/yargs-parser/commit/60e880a837046314d89fa4725f923837fd33a9eb)) - -### [17.0.1](https://www.github.com/yargs/yargs-parser/compare/v17.0.0...v17.0.1) (2020-02-29) - - -### Bug Fixes - -* normalized keys were not enumerable ([#247](https://www.github.com/yargs/yargs-parser/issues/247)) ([57119f9](https://www.github.com/yargs/yargs-parser/commit/57119f9f17cf27499bd95e61c2f72d18314f11ba)) - -## [17.0.0](https://www.github.com/yargs/yargs-parser/compare/v16.1.0...v17.0.0) (2020-02-10) - - -### ⚠ BREAKING CHANGES - -* this reverts parsing behavior of booleans to that of yargs@14 -* objects used during parsing are now created with a null -prototype. There may be some scenarios where this change in behavior -leaks externally. - -### Features - -* boolean arguments will not be collected into an implicit array ([#236](https://www.github.com/yargs/yargs-parser/issues/236)) ([34c4e19](https://www.github.com/yargs/yargs-parser/commit/34c4e19bae4e7af63e3cb6fa654a97ed476e5eb5)) -* introduce nargs-eats-options config option ([#246](https://www.github.com/yargs/yargs-parser/issues/246)) ([d50822a](https://www.github.com/yargs/yargs-parser/commit/d50822ac10e1b05f2e9643671ca131ac251b6732)) - - -### Bug Fixes - -* address bugs with "uknown-options-as-args" ([bc023e3](https://www.github.com/yargs/yargs-parser/commit/bc023e3b13e20a118353f9507d1c999bf388a346)) -* array should take precedence over nargs, but enforce nargs ([#243](https://www.github.com/yargs/yargs-parser/issues/243)) ([4cbc188](https://www.github.com/yargs/yargs-parser/commit/4cbc188b7abb2249529a19c090338debdad2fe6c)) -* support keys that collide with object prototypes ([#234](https://www.github.com/yargs/yargs-parser/issues/234)) ([1587b6d](https://www.github.com/yargs/yargs-parser/commit/1587b6d91db853a9109f1be6b209077993fee4de)) -* unknown options terminated with digits now handled by unknown-options-as-args ([#238](https://www.github.com/yargs/yargs-parser/issues/238)) ([d36cdfa](https://www.github.com/yargs/yargs-parser/commit/d36cdfa854254d7c7e0fe1d583818332ac46c2a5)) - -## [16.1.0](https://www.github.com/yargs/yargs-parser/compare/v16.0.0...v16.1.0) (2019-11-01) - - -### ⚠ BREAKING CHANGES - -* populate error if incompatible narg/count or array/count options are used (#191) - -### Features - -* options that have had their default value used are now tracked ([#211](https://www.github.com/yargs/yargs-parser/issues/211)) ([a525234](https://www.github.com/yargs/yargs-parser/commit/a525234558c847deedd73f8792e0a3b77b26e2c0)) -* populate error if incompatible narg/count or array/count options are used ([#191](https://www.github.com/yargs/yargs-parser/issues/191)) ([84a401f](https://www.github.com/yargs/yargs-parser/commit/84a401f0fa3095e0a19661670d1570d0c3b9d3c9)) - - -### Reverts - -* revert 16.0.0 CHANGELOG entry ([920320a](https://www.github.com/yargs/yargs-parser/commit/920320ad9861bbfd58eda39221ae211540fc1daf)) diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/yargs-parser/LICENSE.txt b/packages/wyatt_notification_bloc/example/scripts/node_modules/yargs-parser/LICENSE.txt deleted file mode 100644 index 836440be..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/yargs-parser/LICENSE.txt +++ /dev/null @@ -1,14 +0,0 @@ -Copyright (c) 2016, Contributors - -Permission to use, copy, modify, and/or distribute this software -for any purpose with or without fee is hereby granted, provided -that the above copyright notice and this permission notice -appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES -OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE -LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES -OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/yargs-parser/README.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/yargs-parser/README.md deleted file mode 100644 index 26148407..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/yargs-parser/README.md +++ /dev/null @@ -1,518 +0,0 @@ -# yargs-parser - -![ci](https://github.com/yargs/yargs-parser/workflows/ci/badge.svg) -[![NPM version](https://img.shields.io/npm/v/yargs-parser.svg)](https://www.npmjs.com/package/yargs-parser) -[![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg)](https://conventionalcommits.org) -![nycrc config on GitHub](https://img.shields.io/nycrc/yargs/yargs-parser) - -The mighty option parser used by [yargs](https://github.com/yargs/yargs). - -visit the [yargs website](http://yargs.js.org/) for more examples, and thorough usage instructions. - - - -## Example - -```sh -npm i yargs-parser --save -``` - -```js -const argv = require('yargs-parser')(process.argv.slice(2)) -console.log(argv) -``` - -```console -$ node example.js --foo=33 --bar hello -{ _: [], foo: 33, bar: 'hello' } -``` - -_or parse a string!_ - -```js -const argv = require('yargs-parser')('--foo=99 --bar=33') -console.log(argv) -``` - -```console -{ _: [], foo: 99, bar: 33 } -``` - -Convert an array of mixed types before passing to `yargs-parser`: - -```js -const parse = require('yargs-parser') -parse(['-f', 11, '--zoom', 55].join(' ')) // <-- array to string -parse(['-f', 11, '--zoom', 55].map(String)) // <-- array of strings -``` - -## Deno Example - -As of `v19` `yargs-parser` supports [Deno](https://github.com/denoland/deno): - -```typescript -import parser from "https://deno.land/x/yargs_parser/deno.ts"; - -const argv = parser('--foo=99 --bar=9987930', { - string: ['bar'] -}) -console.log(argv) -``` - -## ESM Example - -As of `v19` `yargs-parser` supports ESM (_both in Node.js and in the browser_): - -**Node.js:** - -```js -import parser from 'yargs-parser' - -const argv = parser('--foo=99 --bar=9987930', { - string: ['bar'] -}) -console.log(argv) -``` - -**Browsers:** - -```html - - - - -``` - -## API - -### parser(args, opts={}) - -Parses command line arguments returning a simple mapping of keys and values. - -**expects:** - -* `args`: a string or array of strings representing the options to parse. -* `opts`: provide a set of hints indicating how `args` should be parsed: - * `opts.alias`: an object representing the set of aliases for a key: `{alias: {foo: ['f']}}`. - * `opts.array`: indicate that keys should be parsed as an array: `{array: ['foo', 'bar']}`.
    - Indicate that keys should be parsed as an array and coerced to booleans / numbers:
    - `{array: [{ key: 'foo', boolean: true }, {key: 'bar', number: true}]}`. - * `opts.boolean`: arguments should be parsed as booleans: `{boolean: ['x', 'y']}`. - * `opts.coerce`: provide a custom synchronous function that returns a coerced value from the argument provided - (or throws an error). For arrays the function is called only once for the entire array:
    - `{coerce: {foo: function (arg) {return modifiedArg}}}`. - * `opts.config`: indicate a key that represents a path to a configuration file (this file will be loaded and parsed). - * `opts.configObjects`: configuration objects to parse, their properties will be set as arguments:
    - `{configObjects: [{'x': 5, 'y': 33}, {'z': 44}]}`. - * `opts.configuration`: provide configuration options to the yargs-parser (see: [configuration](#configuration)). - * `opts.count`: indicate a key that should be used as a counter, e.g., `-vvv` = `{v: 3}`. - * `opts.default`: provide default values for keys: `{default: {x: 33, y: 'hello world!'}}`. - * `opts.envPrefix`: environment variables (`process.env`) with the prefix provided should be parsed. - * `opts.narg`: specify that a key requires `n` arguments: `{narg: {x: 2}}`. - * `opts.normalize`: `path.normalize()` will be applied to values set to this key. - * `opts.number`: keys should be treated as numbers. - * `opts.string`: keys should be treated as strings (even if they resemble a number `-x 33`). - -**returns:** - -* `obj`: an object representing the parsed value of `args` - * `key/value`: key value pairs for each argument and their aliases. - * `_`: an array representing the positional arguments. - * [optional] `--`: an array with arguments after the end-of-options flag `--`. - -### require('yargs-parser').detailed(args, opts={}) - -Parses a command line string, returning detailed information required by the -yargs engine. - -**expects:** - -* `args`: a string or array of strings representing options to parse. -* `opts`: provide a set of hints indicating how `args`, inputs are identical to `require('yargs-parser')(args, opts={})`. - -**returns:** - -* `argv`: an object representing the parsed value of `args` - * `key/value`: key value pairs for each argument and their aliases. - * `_`: an array representing the positional arguments. - * [optional] `--`: an array with arguments after the end-of-options flag `--`. -* `error`: populated with an error object if an exception occurred during parsing. -* `aliases`: the inferred list of aliases built by combining lists in `opts.alias`. -* `newAliases`: any new aliases added via camel-case expansion: - * `boolean`: `{ fooBar: true }` -* `defaulted`: any new argument created by `opts.default`, no aliases included. - * `boolean`: `{ foo: true }` -* `configuration`: given by default settings and `opts.configuration`. - - - -### Configuration - -The yargs-parser applies several automated transformations on the keys provided -in `args`. These features can be turned on and off using the `configuration` field -of `opts`. - -```js -var parsed = parser(['--no-dice'], { - configuration: { - 'boolean-negation': false - } -}) -``` - -### short option groups - -* default: `true`. -* key: `short-option-groups`. - -Should a group of short-options be treated as boolean flags? - -```console -$ node example.js -abc -{ _: [], a: true, b: true, c: true } -``` - -_if disabled:_ - -```console -$ node example.js -abc -{ _: [], abc: true } -``` - -### camel-case expansion - -* default: `true`. -* key: `camel-case-expansion`. - -Should hyphenated arguments be expanded into camel-case aliases? - -```console -$ node example.js --foo-bar -{ _: [], 'foo-bar': true, fooBar: true } -``` - -_if disabled:_ - -```console -$ node example.js --foo-bar -{ _: [], 'foo-bar': true } -``` - -### dot-notation - -* default: `true` -* key: `dot-notation` - -Should keys that contain `.` be treated as objects? - -```console -$ node example.js --foo.bar -{ _: [], foo: { bar: true } } -``` - -_if disabled:_ - -```console -$ node example.js --foo.bar -{ _: [], "foo.bar": true } -``` - -### parse numbers - -* default: `true` -* key: `parse-numbers` - -Should keys that look like numbers be treated as such? - -```console -$ node example.js --foo=99.3 -{ _: [], foo: 99.3 } -``` - -_if disabled:_ - -```console -$ node example.js --foo=99.3 -{ _: [], foo: "99.3" } -``` - -### parse positional numbers - -* default: `true` -* key: `parse-positional-numbers` - -Should positional keys that look like numbers be treated as such. - -```console -$ node example.js 99.3 -{ _: [99.3] } -``` - -_if disabled:_ - -```console -$ node example.js 99.3 -{ _: ['99.3'] } -``` - -### boolean negation - -* default: `true` -* key: `boolean-negation` - -Should variables prefixed with `--no` be treated as negations? - -```console -$ node example.js --no-foo -{ _: [], foo: false } -``` - -_if disabled:_ - -```console -$ node example.js --no-foo -{ _: [], "no-foo": true } -``` - -### combine arrays - -* default: `false` -* key: `combine-arrays` - -Should arrays be combined when provided by both command line arguments and -a configuration file. - -### duplicate arguments array - -* default: `true` -* key: `duplicate-arguments-array` - -Should arguments be coerced into an array when duplicated: - -```console -$ node example.js -x 1 -x 2 -{ _: [], x: [1, 2] } -``` - -_if disabled:_ - -```console -$ node example.js -x 1 -x 2 -{ _: [], x: 2 } -``` - -### flatten duplicate arrays - -* default: `true` -* key: `flatten-duplicate-arrays` - -Should array arguments be coerced into a single array when duplicated: - -```console -$ node example.js -x 1 2 -x 3 4 -{ _: [], x: [1, 2, 3, 4] } -``` - -_if disabled:_ - -```console -$ node example.js -x 1 2 -x 3 4 -{ _: [], x: [[1, 2], [3, 4]] } -``` - -### greedy arrays - -* default: `true` -* key: `greedy-arrays` - -Should arrays consume more than one positional argument following their flag. - -```console -$ node example --arr 1 2 -{ _: [], arr: [1, 2] } -``` - -_if disabled:_ - -```console -$ node example --arr 1 2 -{ _: [2], arr: [1] } -``` - -**Note: in `v18.0.0` we are considering defaulting greedy arrays to `false`.** - -### nargs eats options - -* default: `false` -* key: `nargs-eats-options` - -Should nargs consume dash options as well as positional arguments. - -### negation prefix - -* default: `no-` -* key: `negation-prefix` - -The prefix to use for negated boolean variables. - -```console -$ node example.js --no-foo -{ _: [], foo: false } -``` - -_if set to `quux`:_ - -```console -$ node example.js --quuxfoo -{ _: [], foo: false } -``` - -### populate -- - -* default: `false`. -* key: `populate--` - -Should unparsed flags be stored in `--` or `_`. - -_If disabled:_ - -```console -$ node example.js a -b -- x y -{ _: [ 'a', 'x', 'y' ], b: true } -``` - -_If enabled:_ - -```console -$ node example.js a -b -- x y -{ _: [ 'a' ], '--': [ 'x', 'y' ], b: true } -``` - -### set placeholder key - -* default: `false`. -* key: `set-placeholder-key`. - -Should a placeholder be added for keys not set via the corresponding CLI argument? - -_If disabled:_ - -```console -$ node example.js -a 1 -c 2 -{ _: [], a: 1, c: 2 } -``` - -_If enabled:_ - -```console -$ node example.js -a 1 -c 2 -{ _: [], a: 1, b: undefined, c: 2 } -``` - -### halt at non-option - -* default: `false`. -* key: `halt-at-non-option`. - -Should parsing stop at the first positional argument? This is similar to how e.g. `ssh` parses its command line. - -_If disabled:_ - -```console -$ node example.js -a run b -x y -{ _: [ 'b' ], a: 'run', x: 'y' } -``` - -_If enabled:_ - -```console -$ node example.js -a run b -x y -{ _: [ 'b', '-x', 'y' ], a: 'run' } -``` - -### strip aliased - -* default: `false` -* key: `strip-aliased` - -Should aliases be removed before returning results? - -_If disabled:_ - -```console -$ node example.js --test-field 1 -{ _: [], 'test-field': 1, testField: 1, 'test-alias': 1, testAlias: 1 } -``` - -_If enabled:_ - -```console -$ node example.js --test-field 1 -{ _: [], 'test-field': 1, testField: 1 } -``` - -### strip dashed - -* default: `false` -* key: `strip-dashed` - -Should dashed keys be removed before returning results? This option has no effect if -`camel-case-expansion` is disabled. - -_If disabled:_ - -```console -$ node example.js --test-field 1 -{ _: [], 'test-field': 1, testField: 1 } -``` - -_If enabled:_ - -```console -$ node example.js --test-field 1 -{ _: [], testField: 1 } -``` - -### unknown options as args - -* default: `false` -* key: `unknown-options-as-args` - -Should unknown options be treated like regular arguments? An unknown option is one that is not -configured in `opts`. - -_If disabled_ - -```console -$ node example.js --unknown-option --known-option 2 --string-option --unknown-option2 -{ _: [], unknownOption: true, knownOption: 2, stringOption: '', unknownOption2: true } -``` - -_If enabled_ - -```console -$ node example.js --unknown-option --known-option 2 --string-option --unknown-option2 -{ _: ['--unknown-option'], knownOption: 2, stringOption: '--unknown-option2' } -``` - -## Supported Node.js Versions - -Libraries in this ecosystem make a best effort to track -[Node.js' release schedule](https://nodejs.org/en/about/releases/). Here's [a -post on why we think this is important](https://medium.com/the-node-js-collection/maintainers-should-consider-following-node-js-release-schedule-ab08ed4de71a). - -## Special Thanks - -The yargs project evolves from optimist and minimist. It owes its -existence to a lot of James Halliday's hard work. Thanks [substack](https://github.com/substack) **beep** **boop** \o/ - -## License - -ISC diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/yargs-parser/browser.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/yargs-parser/browser.js deleted file mode 100644 index 241202c7..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/yargs-parser/browser.js +++ /dev/null @@ -1,29 +0,0 @@ -// Main entrypoint for ESM web browser environments. Avoids using Node.js -// specific libraries, such as "path". -// -// TODO: figure out reasonable web equivalents for "resolve", "normalize", etc. -import { camelCase, decamelize, looksLikeNumber } from './build/lib/string-utils.js' -import { YargsParser } from './build/lib/yargs-parser.js' -const parser = new YargsParser({ - cwd: () => { return '' }, - format: (str, arg) => { return str.replace('%s', arg) }, - normalize: (str) => { return str }, - resolve: (str) => { return str }, - require: () => { - throw Error('loading config from files not currently supported in browser') - }, - env: () => {} -}) - -const yargsParser = function Parser (args, opts) { - const result = parser.parse(args.slice(), opts) - return result.argv -} -yargsParser.detailed = function (args, opts) { - return parser.parse(args.slice(), opts) -} -yargsParser.camelCase = camelCase -yargsParser.decamelize = decamelize -yargsParser.looksLikeNumber = looksLikeNumber - -export default yargsParser diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/yargs-parser/package.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/yargs-parser/package.json deleted file mode 100644 index f97aa9e5..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/yargs-parser/package.json +++ /dev/null @@ -1,87 +0,0 @@ -{ - "name": "yargs-parser", - "version": "20.2.9", - "description": "the mighty option parser used by yargs", - "main": "build/index.cjs", - "exports": { - ".": [ - { - "import": "./build/lib/index.js", - "require": "./build/index.cjs" - }, - "./build/index.cjs" - ] - }, - "type": "module", - "module": "./build/lib/index.js", - "scripts": { - "check": "standardx '**/*.ts' && standardx '**/*.js' && standardx '**/*.cjs'", - "fix": "standardx --fix '**/*.ts' && standardx --fix '**/*.js' && standardx --fix '**/*.cjs'", - "pretest": "rimraf build && tsc -p tsconfig.test.json && cross-env NODE_ENV=test npm run build:cjs", - "test": "c8 --reporter=text --reporter=html mocha test/*.cjs", - "test:browser": "start-server-and-test 'serve ./ -p 8080' http://127.0.0.1:8080/package.json 'node ./test/browser/yargs-test.cjs'", - "pretest:typescript": "npm run pretest", - "test:typescript": "c8 mocha ./build/test/typescript/*.js", - "coverage": "c8 report --check-coverage", - "precompile": "rimraf build", - "compile": "tsc", - "postcompile": "npm run build:cjs", - "build:cjs": "rollup -c", - "prepare": "npm run compile" - }, - "repository": { - "type": "git", - "url": "https://github.com/yargs/yargs-parser.git" - }, - "keywords": [ - "argument", - "parser", - "yargs", - "command", - "cli", - "parsing", - "option", - "args", - "argument" - ], - "author": "Ben Coe ", - "license": "ISC", - "devDependencies": { - "@types/chai": "^4.2.11", - "@types/mocha": "^8.0.0", - "@types/node": "^14.0.0", - "@typescript-eslint/eslint-plugin": "^3.10.1", - "@typescript-eslint/parser": "^3.10.1", - "@wessberg/rollup-plugin-ts": "^1.2.28", - "c8": "^7.3.0", - "chai": "^4.2.0", - "cross-env": "^7.0.2", - "eslint": "^7.0.0", - "eslint-plugin-import": "^2.20.1", - "eslint-plugin-node": "^11.0.0", - "gts": "^3.0.0", - "mocha": "^9.0.0", - "puppeteer": "^10.0.0", - "rimraf": "^3.0.2", - "rollup": "^2.22.1", - "rollup-plugin-cleanup": "^3.1.1", - "serve": "^12.0.0", - "standardx": "^7.0.0", - "start-server-and-test": "^1.11.2", - "ts-transform-default-export": "^1.0.2", - "typescript": "^4.0.0" - }, - "files": [ - "browser.js", - "build", - "!*.d.ts" - ], - "engines": { - "node": ">=10" - }, - "standardx": { - "ignore": [ - "build" - ] - } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/CHANGELOG.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/CHANGELOG.md deleted file mode 100644 index ebc3b22f..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/CHANGELOG.md +++ /dev/null @@ -1,88 +0,0 @@ -# Changelog - -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. - -## [16.2.0](https://www.github.com/yargs/yargs/compare/v16.1.1...v16.2.0) (2020-12-05) - - -### Features - -* command() now accepts an array of modules ([f415388](https://www.github.com/yargs/yargs/commit/f415388cc454d02786c65c50dd6c7a0cf9d8b842)) - - -### Bug Fixes - -* add package.json to module exports ([#1818](https://www.github.com/yargs/yargs/issues/1818)) ([d783a49](https://www.github.com/yargs/yargs/commit/d783a49a7f21c9bbd4eec2990268f3244c4d5662)), closes [#1817](https://www.github.com/yargs/yargs/issues/1817) - -### [16.1.1](https://www.github.com/yargs/yargs/compare/v16.1.0...v16.1.1) (2020-11-15) - - -### Bug Fixes - -* expose helpers for legacy versions of Node.js ([#1801](https://www.github.com/yargs/yargs/issues/1801)) ([107deaa](https://www.github.com/yargs/yargs/commit/107deaa4f68b7bc3f2386041e1f4fe0272b29c0a)) -* **deno:** get yargs working on deno@1.5.x ([#1799](https://www.github.com/yargs/yargs/issues/1799)) ([cb01c98](https://www.github.com/yargs/yargs/commit/cb01c98c44e30f55c2dc9434caef524ae433d9a4)) - -## [16.1.0](https://www.github.com/yargs/yargs/compare/v16.0.3...v16.1.0) (2020-10-15) - - -### Features - -* expose hideBin helper for CJS ([#1768](https://www.github.com/yargs/yargs/issues/1768)) ([63e1173](https://www.github.com/yargs/yargs/commit/63e1173bb47dc651c151973a16ef659082a9ae66)) - - -### Bug Fixes - -* **deno:** update types for deno ^1.4.0 ([#1772](https://www.github.com/yargs/yargs/issues/1772)) ([0801752](https://www.github.com/yargs/yargs/commit/080175207d281be63edf90adfe4f0568700b0bf5)) -* **exports:** node 13.0-13.6 require a string fallback ([#1776](https://www.github.com/yargs/yargs/issues/1776)) ([b45c43a](https://www.github.com/yargs/yargs/commit/b45c43a5f64b565c3794f9792150eaeec4e00b69)) -* **modules:** module path was incorrect ([#1759](https://www.github.com/yargs/yargs/issues/1759)) ([95a4a0a](https://www.github.com/yargs/yargs/commit/95a4a0ac573cfe158e6e4bc8c8682ebd1644a198)) -* **positional:** positional strings no longer drop decimals ([#1761](https://www.github.com/yargs/yargs/issues/1761)) ([e1a300f](https://www.github.com/yargs/yargs/commit/e1a300f1293ad821c900284616337f080b207980)) -* make positionals in -- count towards validation ([#1752](https://www.github.com/yargs/yargs/issues/1752)) ([eb2b29d](https://www.github.com/yargs/yargs/commit/eb2b29d34f1a41e0fd6c4e841960e5bfc329dc3c)) - -### [16.0.3](https://www.github.com/yargs/yargs/compare/v16.0.2...v16.0.3) (2020-09-10) - - -### Bug Fixes - -* move yargs.cjs to yargs to fix Node 10 imports ([#1747](https://www.github.com/yargs/yargs/issues/1747)) ([5bfb85b](https://www.github.com/yargs/yargs/commit/5bfb85b33b85db8a44b5f7a700a8e4dbaf022df0)) - -### [16.0.2](https://www.github.com/yargs/yargs/compare/v16.0.1...v16.0.2) (2020-09-09) - - -### Bug Fixes - -* **typescript:** yargs-parser was breaking @types/yargs ([#1745](https://www.github.com/yargs/yargs/issues/1745)) ([2253284](https://www.github.com/yargs/yargs/commit/2253284b233cceabd8db677b81c5bf1755eef230)) - -### [16.0.1](https://www.github.com/yargs/yargs/compare/v16.0.0...v16.0.1) (2020-09-09) - - -### Bug Fixes - -* code was not passed to process.exit ([#1742](https://www.github.com/yargs/yargs/issues/1742)) ([d1a9930](https://www.github.com/yargs/yargs/commit/d1a993035a2f76c138460052cf19425f9684b637)) - -## [16.0.0](https://www.github.com/yargs/yargs/compare/v15.4.2...v16.0.0) (2020-09-09) - - -### ⚠ BREAKING CHANGES - -* tweaks to ESM/Deno API surface: now exports yargs function by default; getProcessArgvWithoutBin becomes hideBin; types now exported for Deno. -* find-up replaced with escalade; export map added (limits importable files in Node >= 12); yarser-parser@19.x.x (new decamelize/camelcase implementation). -* **usage:** single character aliases are now shown first in help output -* rebase helper is no longer provided on yargs instance. -* drop support for EOL Node 8 (#1686) - -### Features - -* adds strictOptions() ([#1738](https://www.github.com/yargs/yargs/issues/1738)) ([b215fba](https://www.github.com/yargs/yargs/commit/b215fba0ed6e124e5aad6cf22c8d5875661c63a3)) -* **helpers:** rebase, Parser, applyExtends now blessed helpers ([#1733](https://www.github.com/yargs/yargs/issues/1733)) ([c7debe8](https://www.github.com/yargs/yargs/commit/c7debe8eb1e5bc6ea20b5ed68026c56e5ebec9e1)) -* adds support for ESM and Deno ([#1708](https://www.github.com/yargs/yargs/issues/1708)) ([ac6d5d1](https://www.github.com/yargs/yargs/commit/ac6d5d105a75711fe703f6a39dad5181b383d6c6)) -* drop support for EOL Node 8 ([#1686](https://www.github.com/yargs/yargs/issues/1686)) ([863937f](https://www.github.com/yargs/yargs/commit/863937f23c3102f804cdea78ee3097e28c7c289f)) -* i18n for ESM and Deno ([#1735](https://www.github.com/yargs/yargs/issues/1735)) ([c71783a](https://www.github.com/yargs/yargs/commit/c71783a5a898a0c0e92ac501c939a3ec411ac0c1)) -* tweaks to API surface based on user feedback ([#1726](https://www.github.com/yargs/yargs/issues/1726)) ([4151fee](https://www.github.com/yargs/yargs/commit/4151fee4c33a97d26bc40de7e623e5b0eb87e9bb)) -* **usage:** single char aliases first in help ([#1574](https://www.github.com/yargs/yargs/issues/1574)) ([a552990](https://www.github.com/yargs/yargs/commit/a552990c120646c2d85a5c9b628e1ce92a68e797)) - - -### Bug Fixes - -* **yargs:** add missing command(module) signature ([#1707](https://www.github.com/yargs/yargs/issues/1707)) ([0f81024](https://www.github.com/yargs/yargs/commit/0f810245494ccf13a35b7786d021b30fc95ecad5)), closes [#1704](https://www.github.com/yargs/yargs/issues/1704) - -[Older CHANGELOG Entries](https://github.com/yargs/yargs/blob/master/docs/CHANGELOG-historical.md) diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/LICENSE b/packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/LICENSE deleted file mode 100644 index b0145ca0..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright 2010 James Halliday (mail@substack.net); Modified work Copyright 2014 Contributors (ben@npmjs.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/README.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/README.md deleted file mode 100644 index 25a888ea..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/README.md +++ /dev/null @@ -1,202 +0,0 @@ -

    - -

    -

    Yargs

    -

    - Yargs be a node.js library fer hearties tryin' ter parse optstrings -

    - -
    - -![ci](https://github.com/yargs/yargs/workflows/ci/badge.svg) -[![NPM version][npm-image]][npm-url] -[![js-standard-style][standard-image]][standard-url] -[![Coverage][coverage-image]][coverage-url] -[![Conventional Commits][conventional-commits-image]][conventional-commits-url] -[![Slack][slack-image]][slack-url] - -## Description -Yargs helps you build interactive command line tools, by parsing arguments and generating an elegant user interface. - -It gives you: - -* commands and (grouped) options (`my-program.js serve --port=5000`). -* a dynamically generated help menu based on your arguments: - -``` -mocha [spec..] - -Run tests with Mocha - -Commands - mocha inspect [spec..] Run tests with Mocha [default] - mocha init create a client-side Mocha setup at - -Rules & Behavior - --allow-uncaught Allow uncaught errors to propagate [boolean] - --async-only, -A Require all tests to use a callback (async) or - return a Promise [boolean] -``` - -* bash-completion shortcuts for commands and options. -* and [tons more](/docs/api.md). - -## Installation - -Stable version: -```bash -npm i yargs -``` - -Bleeding edge version with the most recent features: -```bash -npm i yargs@next -``` - -## Usage - -### Simple Example - -```javascript -#!/usr/bin/env node -const yargs = require('yargs/yargs') -const { hideBin } = require('yargs/helpers') -const argv = yargs(hideBin(process.argv)).argv - -if (argv.ships > 3 && argv.distance < 53.5) { - console.log('Plunder more riffiwobbles!') -} else { - console.log('Retreat from the xupptumblers!') -} -``` - -```bash -$ ./plunder.js --ships=4 --distance=22 -Plunder more riffiwobbles! - -$ ./plunder.js --ships 12 --distance 98.7 -Retreat from the xupptumblers! -``` - -### Complex Example - -```javascript -#!/usr/bin/env node -const yargs = require('yargs/yargs') -const { hideBin } = require('yargs/helpers') - -yargs(hideBin(process.argv)) - .command('serve [port]', 'start the server', (yargs) => { - yargs - .positional('port', { - describe: 'port to bind on', - default: 5000 - }) - }, (argv) => { - if (argv.verbose) console.info(`start server on :${argv.port}`) - serve(argv.port) - }) - .option('verbose', { - alias: 'v', - type: 'boolean', - description: 'Run with verbose logging' - }) - .argv -``` - -Run the example above with `--help` to see the help for the application. - -## Supported Platforms - -### TypeScript - -yargs has type definitions at [@types/yargs][type-definitions]. - -``` -npm i @types/yargs --save-dev -``` - -See usage examples in [docs](/docs/typescript.md). - -### Deno - -As of `v16`, `yargs` supports [Deno](https://github.com/denoland/deno): - -```typescript -import yargs from 'https://deno.land/x/yargs/deno.ts' -import { Arguments } from 'https://deno.land/x/yargs/deno-types.ts' - -yargs(Deno.args) - .command('download ', 'download a list of files', (yargs: any) => { - return yargs.positional('files', { - describe: 'a list of files to do something with' - }) - }, (argv: Arguments) => { - console.info(argv) - }) - .strictCommands() - .demandCommand(1) - .argv -``` - -### ESM - -As of `v16`,`yargs` supports ESM imports: - -```js -import yargs from 'yargs' -import { hideBin } from 'yargs/helpers' - -yargs(hideBin(process.argv)) - .command('curl ', 'fetch the contents of the URL', () => {}, (argv) => { - console.info(argv) - }) - .demandCommand(1) - .argv -``` - -### Usage in Browser - -See examples of using yargs in the browser in [docs](/docs/browser.md). - -## Community - -Having problems? want to contribute? join our [community slack](http://devtoolscommunity.herokuapp.com). - -## Documentation - -### Table of Contents - -* [Yargs' API](/docs/api.md) -* [Examples](/docs/examples.md) -* [Parsing Tricks](/docs/tricks.md) - * [Stop the Parser](/docs/tricks.md#stop) - * [Negating Boolean Arguments](/docs/tricks.md#negate) - * [Numbers](/docs/tricks.md#numbers) - * [Arrays](/docs/tricks.md#arrays) - * [Objects](/docs/tricks.md#objects) - * [Quotes](/docs/tricks.md#quotes) -* [Advanced Topics](/docs/advanced.md) - * [Composing Your App Using Commands](/docs/advanced.md#commands) - * [Building Configurable CLI Apps](/docs/advanced.md#configuration) - * [Customizing Yargs' Parser](/docs/advanced.md#customizing) - * [Bundling yargs](/docs/bundling.md) -* [Contributing](/contributing.md) - -## Supported Node.js Versions - -Libraries in this ecosystem make a best effort to track -[Node.js' release schedule](https://nodejs.org/en/about/releases/). Here's [a -post on why we think this is important](https://medium.com/the-node-js-collection/maintainers-should-consider-following-node-js-release-schedule-ab08ed4de71a). - -[npm-url]: https://www.npmjs.com/package/yargs -[npm-image]: https://img.shields.io/npm/v/yargs.svg -[standard-image]: https://img.shields.io/badge/code%20style-standard-brightgreen.svg -[standard-url]: http://standardjs.com/ -[conventional-commits-image]: https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg -[conventional-commits-url]: https://conventionalcommits.org/ -[slack-image]: http://devtoolscommunity.herokuapp.com/badge.svg -[slack-url]: http://devtoolscommunity.herokuapp.com -[type-definitions]: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/yargs -[coverage-image]: https://img.shields.io/nycrc/yargs/yargs -[coverage-url]: https://github.com/yargs/yargs/blob/master/.nycrc diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/browser.mjs b/packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/browser.mjs deleted file mode 100644 index d8a9f3de..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/browser.mjs +++ /dev/null @@ -1,7 +0,0 @@ -// Bootstrap yargs for browser: -import browserPlatformShim from './lib/platform-shims/browser.mjs'; -import {YargsWithShim} from './build/lib/yargs-factory.js'; - -const Yargs = YargsWithShim(browserPlatformShim); - -export default Yargs; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/helpers/helpers.mjs b/packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/helpers/helpers.mjs deleted file mode 100644 index 3f96b3db..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/helpers/helpers.mjs +++ /dev/null @@ -1,10 +0,0 @@ -import {applyExtends as _applyExtends} from '../build/lib/utils/apply-extends.js'; -import {hideBin} from '../build/lib/utils/process-argv.js'; -import Parser from 'yargs-parser'; -import shim from '../lib/platform-shims/esm.mjs'; - -const applyExtends = (config, cwd, mergeExtends) => { - return _applyExtends(config, cwd, mergeExtends, shim); -}; - -export {applyExtends, hideBin, Parser}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/helpers/index.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/helpers/index.js deleted file mode 100644 index 8ab79a33..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/helpers/index.js +++ /dev/null @@ -1,14 +0,0 @@ -const { - applyExtends, - cjsPlatformShim, - Parser, - processArgv, -} = require('../build/index.cjs'); - -module.exports = { - applyExtends: (config, cwd, mergeExtends) => { - return applyExtends(config, cwd, mergeExtends, cjsPlatformShim); - }, - hideBin: processArgv.hideBin, - Parser, -}; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/helpers/package.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/helpers/package.json deleted file mode 100644 index 5bbefffb..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/helpers/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "type": "commonjs" -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/index.cjs b/packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/index.cjs deleted file mode 100644 index 7ac4d358..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/index.cjs +++ /dev/null @@ -1,39 +0,0 @@ -'use strict'; -// classic singleton yargs API, to use yargs -// without running as a singleton do: -// require('yargs/yargs')(process.argv.slice(2)) -const {Yargs, processArgv} = require('./build/index.cjs'); - -Argv(processArgv.hideBin(process.argv)); - -module.exports = Argv; - -function Argv(processArgs, cwd) { - const argv = Yargs(processArgs, cwd, require); - singletonify(argv); - return argv; -} - -/* Hack an instance of Argv with process.argv into Argv - so people can do - require('yargs')(['--beeble=1','-z','zizzle']).argv - to parse a list of args and - require('yargs').argv - to get a parsed version of process.argv. -*/ -function singletonify(inst) { - Object.keys(inst).forEach(key => { - if (key === 'argv') { - Argv.__defineGetter__(key, inst.__lookupGetter__(key)); - } else if (typeof inst[key] === 'function') { - Argv[key] = inst[key].bind(inst); - } else { - Argv.__defineGetter__('$0', () => { - return inst.$0; - }); - Argv.__defineGetter__('parsed', () => { - return inst.parsed; - }); - } - }); -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/index.mjs b/packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/index.mjs deleted file mode 100644 index 23d90801..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/index.mjs +++ /dev/null @@ -1,8 +0,0 @@ -'use strict'; - -// Bootstraps yargs for ESM: -import esmPlatformShim from './lib/platform-shims/esm.mjs'; -import {YargsWithShim} from './build/lib/yargs-factory.js'; - -const Yargs = YargsWithShim(esmPlatformShim); -export default Yargs; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/lib/platform-shims/browser.mjs b/packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/lib/platform-shims/browser.mjs deleted file mode 100644 index 5740a0fe..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/lib/platform-shims/browser.mjs +++ /dev/null @@ -1,92 +0,0 @@ -'use strict'; - -import cliui from 'https://unpkg.com/cliui@7.0.1/index.mjs'; // eslint-disable-line -import Parser from 'https://unpkg.com/yargs-parser@19.0.0/browser.js'; // eslint-disable-line -import {getProcessArgvBin} from '../../build/lib/utils/process-argv.js'; -import {YError} from '../../build/lib/yerror.js'; - -const REQUIRE_ERROR = 'require is not supported in browser'; -const REQUIRE_DIRECTORY_ERROR = - 'loading a directory of commands is not supported in browser'; - -export default { - assert: { - notStrictEqual: (a, b) => { - // noop. - }, - strictEqual: (a, b) => { - // noop. - }, - }, - cliui, - findUp: () => undefined, - getEnv: key => { - // There is no environment in browser: - return undefined; - }, - inspect: console.log, - getCallerFile: () => { - throw new YError(REQUIRE_DIRECTORY_ERROR); - }, - getProcessArgvBin, - mainFilename: 'yargs', - Parser, - path: { - basename: str => str, - dirname: str => str, - extname: str => str, - relative: str => str, - }, - process: { - argv: () => [], - cwd: () => '', - execPath: () => '', - // exit is noop browser: - exit: () => {}, - nextTick: cb => { - window.setTimeout(cb, 1); - }, - stdColumns: 80, - }, - readFileSync: () => { - return ''; - }, - require: () => { - throw new YError(REQUIRE_ERROR); - }, - requireDirectory: () => { - throw new YError(REQUIRE_DIRECTORY_ERROR); - }, - stringWidth: str => { - return [...str].length; - }, - // TODO: replace this with y18n once it's ported to ESM: - y18n: { - __: (...str) => { - if (str.length === 0) return ''; - const args = str.slice(1); - return sprintf(str[0], ...args); - }, - __n: (str1, str2, count, ...args) => { - if (count === 1) { - return sprintf(str1, ...args); - } else { - return sprintf(str2, ...args); - } - }, - getLocale: () => { - return 'en_US'; - }, - setLocale: () => {}, - updateLocale: () => {}, - }, -}; - -function sprintf(_str, ...args) { - let str = ''; - const split = _str.split('%s'); - split.forEach((token, i) => { - str += `${token}${split[i + 1] !== undefined && args[i] ? args[i] : ''}`; - }); - return str; -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/lib/platform-shims/esm.mjs b/packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/lib/platform-shims/esm.mjs deleted file mode 100644 index bc047916..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/lib/platform-shims/esm.mjs +++ /dev/null @@ -1,67 +0,0 @@ -'use strict' - -import { notStrictEqual, strictEqual } from 'assert' -import cliui from 'cliui' -import escalade from 'escalade/sync' -import { format, inspect } from 'util' -import { readFileSync } from 'fs' -import { fileURLToPath } from 'url'; -import Parser from 'yargs-parser' -import { basename, dirname, extname, relative, resolve } from 'path' -import { getProcessArgvBin } from '../../build/lib/utils/process-argv.js' -import { YError } from '../../build/lib/yerror.js' -import y18n from 'y18n' - -const REQUIRE_ERROR = 'require is not supported by ESM' -const REQUIRE_DIRECTORY_ERROR = 'loading a directory of commands is not supported yet for ESM' - -const mainFilename = fileURLToPath(import.meta.url).split('node_modules')[0] -const __dirname = fileURLToPath(import.meta.url) - -export default { - assert: { - notStrictEqual, - strictEqual - }, - cliui, - findUp: escalade, - getEnv: (key) => { - return process.env[key] - }, - inspect, - getCallerFile: () => { - throw new YError(REQUIRE_DIRECTORY_ERROR) - }, - getProcessArgvBin, - mainFilename: mainFilename || process.cwd(), - Parser, - path: { - basename, - dirname, - extname, - relative, - resolve - }, - process: { - argv: () => process.argv, - cwd: process.cwd, - execPath: () => process.execPath, - exit: process.exit, - nextTick: process.nextTick, - stdColumns: typeof process.stdout.columns !== 'undefined' ? process.stdout.columns : null - }, - readFileSync, - require: () => { - throw new YError(REQUIRE_ERROR) - }, - requireDirectory: () => { - throw new YError(REQUIRE_DIRECTORY_ERROR) - }, - stringWidth: (str) => { - return [...str].length - }, - y18n: y18n({ - directory: resolve(__dirname, '../../../locales'), - updateFiles: false - }) -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/locales/be.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/locales/be.json deleted file mode 100644 index e28fa301..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/locales/be.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "Commands:": "Каманды:", - "Options:": "Опцыі:", - "Examples:": "Прыклады:", - "boolean": "булевы тып", - "count": "падлік", - "string": "радковы тып", - "number": "лік", - "array": "масіў", - "required": "неабходна", - "default": "па змаўчанні", - "default:": "па змаўчанні:", - "choices:": "магчымасці:", - "aliases:": "аліасы:", - "generated-value": "згенераванае значэнне", - "Not enough non-option arguments: got %s, need at least %s": { - "one": "Недастаткова неапцыйных аргументаў: ёсць %s, трэба як мінімум %s", - "other": "Недастаткова неапцыйных аргументаў: ёсць %s, трэба як мінімум %s" - }, - "Too many non-option arguments: got %s, maximum of %s": { - "one": "Занадта шмат неапцыйных аргументаў: ёсць %s, максімум дапушчальна %s", - "other": "Занадта шмат неапцыйных аргументаў: ёсць %s, максімум дапушчальна %s" - }, - "Missing argument value: %s": { - "one": "Не хапае значэння аргументу: %s", - "other": "Не хапае значэнняў аргументаў: %s" - }, - "Missing required argument: %s": { - "one": "Не хапае неабходнага аргументу: %s", - "other": "Не хапае неабходных аргументаў: %s" - }, - "Unknown argument: %s": { - "one": "Невядомы аргумент: %s", - "other": "Невядомыя аргументы: %s" - }, - "Invalid values:": "Несапраўдныя значэння:", - "Argument: %s, Given: %s, Choices: %s": "Аргумент: %s, Дадзенае значэнне: %s, Магчымасці: %s", - "Argument check failed: %s": "Праверка аргументаў не ўдалася: %s", - "Implications failed:": "Дадзены аргумент патрабуе наступны дадатковы аргумент:", - "Not enough arguments following: %s": "Недастаткова наступных аргументаў: %s", - "Invalid JSON config file: %s": "Несапраўдны файл канфігурацыі JSON: %s", - "Path to JSON config file": "Шлях да файла канфігурацыі JSON", - "Show help": "Паказаць дапамогу", - "Show version number": "Паказаць нумар версіі", - "Did you mean %s?": "Вы мелі на ўвазе %s?" -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/locales/de.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/locales/de.json deleted file mode 100644 index dc73ec3f..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/locales/de.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "Commands:": "Kommandos:", - "Options:": "Optionen:", - "Examples:": "Beispiele:", - "boolean": "boolean", - "count": "Zähler", - "string": "string", - "number": "Zahl", - "array": "array", - "required": "erforderlich", - "default": "Standard", - "default:": "Standard:", - "choices:": "Möglichkeiten:", - "aliases:": "Aliase:", - "generated-value": "Generierter-Wert", - "Not enough non-option arguments: got %s, need at least %s": { - "one": "Nicht genügend Argumente ohne Optionen: %s vorhanden, mindestens %s benötigt", - "other": "Nicht genügend Argumente ohne Optionen: %s vorhanden, mindestens %s benötigt" - }, - "Too many non-option arguments: got %s, maximum of %s": { - "one": "Zu viele Argumente ohne Optionen: %s vorhanden, maximal %s erlaubt", - "other": "Zu viele Argumente ohne Optionen: %s vorhanden, maximal %s erlaubt" - }, - "Missing argument value: %s": { - "one": "Fehlender Argumentwert: %s", - "other": "Fehlende Argumentwerte: %s" - }, - "Missing required argument: %s": { - "one": "Fehlendes Argument: %s", - "other": "Fehlende Argumente: %s" - }, - "Unknown argument: %s": { - "one": "Unbekanntes Argument: %s", - "other": "Unbekannte Argumente: %s" - }, - "Invalid values:": "Unzulässige Werte:", - "Argument: %s, Given: %s, Choices: %s": "Argument: %s, Gegeben: %s, Möglichkeiten: %s", - "Argument check failed: %s": "Argumente-Check fehlgeschlagen: %s", - "Implications failed:": "Fehlende abhängige Argumente:", - "Not enough arguments following: %s": "Nicht genügend Argumente nach: %s", - "Invalid JSON config file: %s": "Fehlerhafte JSON-Config Datei: %s", - "Path to JSON config file": "Pfad zur JSON-Config Datei", - "Show help": "Hilfe anzeigen", - "Show version number": "Version anzeigen", - "Did you mean %s?": "Meintest du %s?" -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/locales/en.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/locales/en.json deleted file mode 100644 index d794947d..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/locales/en.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "Commands:": "Commands:", - "Options:": "Options:", - "Examples:": "Examples:", - "boolean": "boolean", - "count": "count", - "string": "string", - "number": "number", - "array": "array", - "required": "required", - "default": "default", - "default:": "default:", - "choices:": "choices:", - "aliases:": "aliases:", - "generated-value": "generated-value", - "Not enough non-option arguments: got %s, need at least %s": { - "one": "Not enough non-option arguments: got %s, need at least %s", - "other": "Not enough non-option arguments: got %s, need at least %s" - }, - "Too many non-option arguments: got %s, maximum of %s": { - "one": "Too many non-option arguments: got %s, maximum of %s", - "other": "Too many non-option arguments: got %s, maximum of %s" - }, - "Missing argument value: %s": { - "one": "Missing argument value: %s", - "other": "Missing argument values: %s" - }, - "Missing required argument: %s": { - "one": "Missing required argument: %s", - "other": "Missing required arguments: %s" - }, - "Unknown argument: %s": { - "one": "Unknown argument: %s", - "other": "Unknown arguments: %s" - }, - "Invalid values:": "Invalid values:", - "Argument: %s, Given: %s, Choices: %s": "Argument: %s, Given: %s, Choices: %s", - "Argument check failed: %s": "Argument check failed: %s", - "Implications failed:": "Missing dependent arguments:", - "Not enough arguments following: %s": "Not enough arguments following: %s", - "Invalid JSON config file: %s": "Invalid JSON config file: %s", - "Path to JSON config file": "Path to JSON config file", - "Show help": "Show help", - "Show version number": "Show version number", - "Did you mean %s?": "Did you mean %s?", - "Arguments %s and %s are mutually exclusive" : "Arguments %s and %s are mutually exclusive", - "Positionals:": "Positionals:", - "command": "command", - "deprecated": "deprecated", - "deprecated: %s": "deprecated: %s" -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/locales/es.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/locales/es.json deleted file mode 100644 index d77b4616..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/locales/es.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "Commands:": "Comandos:", - "Options:": "Opciones:", - "Examples:": "Ejemplos:", - "boolean": "booleano", - "count": "cuenta", - "string": "cadena de caracteres", - "number": "número", - "array": "tabla", - "required": "requerido", - "default": "defecto", - "default:": "defecto:", - "choices:": "selección:", - "aliases:": "alias:", - "generated-value": "valor-generado", - "Not enough non-option arguments: got %s, need at least %s": { - "one": "Hacen falta argumentos no-opcionales: Número recibido %s, necesita por lo menos %s", - "other": "Hacen falta argumentos no-opcionales: Número recibido %s, necesita por lo menos %s" - }, - "Too many non-option arguments: got %s, maximum of %s": { - "one": "Demasiados argumentos no-opcionales: Número recibido %s, máximo es %s", - "other": "Demasiados argumentos no-opcionales: Número recibido %s, máximo es %s" - }, - "Missing argument value: %s": { - "one": "Falta argumento: %s", - "other": "Faltan argumentos: %s" - }, - "Missing required argument: %s": { - "one": "Falta argumento requerido: %s", - "other": "Faltan argumentos requeridos: %s" - }, - "Unknown argument: %s": { - "one": "Argumento desconocido: %s", - "other": "Argumentos desconocidos: %s" - }, - "Invalid values:": "Valores inválidos:", - "Argument: %s, Given: %s, Choices: %s": "Argumento: %s, Recibido: %s, Seleccionados: %s", - "Argument check failed: %s": "Verificación de argumento ha fallado: %s", - "Implications failed:": "Implicaciones fallidas:", - "Not enough arguments following: %s": "No hay suficientes argumentos después de: %s", - "Invalid JSON config file: %s": "Archivo de configuración JSON inválido: %s", - "Path to JSON config file": "Ruta al archivo de configuración JSON", - "Show help": "Muestra ayuda", - "Show version number": "Muestra número de versión", - "Did you mean %s?": "Quisiste decir %s?" -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/locales/fi.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/locales/fi.json deleted file mode 100644 index 0728c578..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/locales/fi.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "Commands:": "Komennot:", - "Options:": "Valinnat:", - "Examples:": "Esimerkkejä:", - "boolean": "totuusarvo", - "count": "lukumäärä", - "string": "merkkijono", - "number": "numero", - "array": "taulukko", - "required": "pakollinen", - "default": "oletusarvo", - "default:": "oletusarvo:", - "choices:": "vaihtoehdot:", - "aliases:": "aliakset:", - "generated-value": "generoitu-arvo", - "Not enough non-option arguments: got %s, need at least %s": { - "one": "Liian vähän argumentteja, jotka eivät ole valintoja: annettu %s, vaaditaan vähintään %s", - "other": "Liian vähän argumentteja, jotka eivät ole valintoja: annettu %s, vaaditaan vähintään %s" - }, - "Too many non-option arguments: got %s, maximum of %s": { - "one": "Liikaa argumentteja, jotka eivät ole valintoja: annettu %s, sallitaan enintään %s", - "other": "Liikaa argumentteja, jotka eivät ole valintoja: annettu %s, sallitaan enintään %s" - }, - "Missing argument value: %s": { - "one": "Argumentin arvo puuttuu: %s", - "other": "Argumentin arvot puuttuvat: %s" - }, - "Missing required argument: %s": { - "one": "Pakollinen argumentti puuttuu: %s", - "other": "Pakollisia argumentteja puuttuu: %s" - }, - "Unknown argument: %s": { - "one": "Tuntematon argumenttn: %s", - "other": "Tuntemattomia argumentteja: %s" - }, - "Invalid values:": "Virheelliset arvot:", - "Argument: %s, Given: %s, Choices: %s": "Argumentti: %s, Annettu: %s, Vaihtoehdot: %s", - "Argument check failed: %s": "Argumentin tarkistus epäonnistui: %s", - "Implications failed:": "Riippuvia argumentteja puuttuu:", - "Not enough arguments following: %s": "Argumentin perässä ei ole tarpeeksi argumentteja: %s", - "Invalid JSON config file: %s": "Epävalidi JSON-asetustiedosto: %s", - "Path to JSON config file": "JSON-asetustiedoston polku", - "Show help": "Näytä ohje", - "Show version number": "Näytä versionumero", - "Did you mean %s?": "Tarkoititko %s?", - "Arguments %s and %s are mutually exclusive" : "Argumentit %s ja %s eivät ole yhteensopivat", - "Positionals:": "Sijaintiparametrit:", - "command": "komento" -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/locales/fr.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/locales/fr.json deleted file mode 100644 index edd743f0..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/locales/fr.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "Commands:": "Commandes :", - "Options:": "Options :", - "Examples:": "Exemples :", - "boolean": "booléen", - "count": "compteur", - "string": "chaîne de caractères", - "number": "nombre", - "array": "tableau", - "required": "requis", - "default": "défaut", - "default:": "défaut :", - "choices:": "choix :", - "aliases:": "alias :", - "generated-value": "valeur générée", - "Not enough non-option arguments: got %s, need at least %s": { - "one": "Pas assez d'arguments (hors options) : reçu %s, besoin d'au moins %s", - "other": "Pas assez d'arguments (hors options) : reçus %s, besoin d'au moins %s" - }, - "Too many non-option arguments: got %s, maximum of %s": { - "one": "Trop d'arguments (hors options) : reçu %s, maximum de %s", - "other": "Trop d'arguments (hors options) : reçus %s, maximum de %s" - }, - "Missing argument value: %s": { - "one": "Argument manquant : %s", - "other": "Arguments manquants : %s" - }, - "Missing required argument: %s": { - "one": "Argument requis manquant : %s", - "other": "Arguments requis manquants : %s" - }, - "Unknown argument: %s": { - "one": "Argument inconnu : %s", - "other": "Arguments inconnus : %s" - }, - "Unknown command: %s": { - "one": "Commande inconnue : %s", - "other": "Commandes inconnues : %s" - }, - "Invalid values:": "Valeurs invalides :", - "Argument: %s, Given: %s, Choices: %s": "Argument : %s, donné : %s, choix : %s", - "Argument check failed: %s": "Echec de la vérification de l'argument : %s", - "Implications failed:": "Arguments dépendants manquants :", - "Not enough arguments following: %s": "Pas assez d'arguments après : %s", - "Invalid JSON config file: %s": "Fichier de configuration JSON invalide : %s", - "Path to JSON config file": "Chemin du fichier de configuration JSON", - "Show help": "Affiche l'aide", - "Show version number": "Affiche le numéro de version", - "Did you mean %s?": "Vouliez-vous dire %s ?", - "Arguments %s and %s are mutually exclusive" : "Les arguments %s et %s sont mutuellement exclusifs", - "Positionals:": "Arguments positionnels :", - "command": "commande" -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/locales/hi.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/locales/hi.json deleted file mode 100644 index a9de77cc..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/locales/hi.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "Commands:": "आदेश:", - "Options:": "विकल्प:", - "Examples:": "उदाहरण:", - "boolean": "सत्यता", - "count": "संख्या", - "string": "वर्णों का तार ", - "number": "अंक", - "array": "सरणी", - "required": "आवश्यक", - "default": "डिफॉल्ट", - "default:": "डिफॉल्ट:", - "choices:": "विकल्प:", - "aliases:": "उपनाम:", - "generated-value": "उत्पन्न-मूल्य", - "Not enough non-option arguments: got %s, need at least %s": { - "one": "पर्याप्त गैर-विकल्प तर्क प्राप्त नहीं: %s प्राप्त, कम से कम %s की आवश्यकता है", - "other": "पर्याप्त गैर-विकल्प तर्क प्राप्त नहीं: %s प्राप्त, कम से कम %s की आवश्यकता है" - }, - "Too many non-option arguments: got %s, maximum of %s": { - "one": "बहुत सारे गैर-विकल्प तर्क: %s प्राप्त, अधिकतम %s मान्य", - "other": "बहुत सारे गैर-विकल्प तर्क: %s प्राप्त, अधिकतम %s मान्य" - }, - "Missing argument value: %s": { - "one": "कुछ तर्को के मूल्य गुम हैं: %s", - "other": "कुछ तर्को के मूल्य गुम हैं: %s" - }, - "Missing required argument: %s": { - "one": "आवश्यक तर्क गुम हैं: %s", - "other": "आवश्यक तर्क गुम हैं: %s" - }, - "Unknown argument: %s": { - "one": "अज्ञात तर्क प्राप्त: %s", - "other": "अज्ञात तर्क प्राप्त: %s" - }, - "Invalid values:": "अमान्य मूल्य:", - "Argument: %s, Given: %s, Choices: %s": "तर्क: %s, प्राप्त: %s, विकल्प: %s", - "Argument check failed: %s": "तर्क जांच विफल: %s", - "Implications failed:": "दिए गए तर्क के लिए अतिरिक्त तर्क की अपेक्षा है:", - "Not enough arguments following: %s": "निम्नलिखित के बाद पर्याप्त तर्क नहीं प्राप्त: %s", - "Invalid JSON config file: %s": "अमान्य JSON config फाइल: %s", - "Path to JSON config file": "JSON config फाइल का पथ", - "Show help": "सहायता दिखाएँ", - "Show version number": "Version संख्या दिखाएँ", - "Did you mean %s?": "क्या आपका मतलब है %s?", - "Arguments %s and %s are mutually exclusive" : "तर्क %s और %s परस्पर अनन्य हैं", - "Positionals:": "स्थानीय:", - "command": "आदेश" -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/locales/hu.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/locales/hu.json deleted file mode 100644 index 21492d05..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/locales/hu.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "Commands:": "Parancsok:", - "Options:": "Opciók:", - "Examples:": "Példák:", - "boolean": "boolean", - "count": "számláló", - "string": "szöveg", - "number": "szám", - "array": "tömb", - "required": "kötelező", - "default": "alapértelmezett", - "default:": "alapértelmezett:", - "choices:": "lehetőségek:", - "aliases:": "aliaszok:", - "generated-value": "generált-érték", - "Not enough non-option arguments: got %s, need at least %s": { - "one": "Nincs elég nem opcionális argumentum: %s van, legalább %s kell", - "other": "Nincs elég nem opcionális argumentum: %s van, legalább %s kell" - }, - "Too many non-option arguments: got %s, maximum of %s": { - "one": "Túl sok nem opciánlis argumentum van: %s van, maximum %s lehet", - "other": "Túl sok nem opciánlis argumentum van: %s van, maximum %s lehet" - }, - "Missing argument value: %s": { - "one": "Hiányzó argumentum érték: %s", - "other": "Hiányzó argumentum értékek: %s" - }, - "Missing required argument: %s": { - "one": "Hiányzó kötelező argumentum: %s", - "other": "Hiányzó kötelező argumentumok: %s" - }, - "Unknown argument: %s": { - "one": "Ismeretlen argumentum: %s", - "other": "Ismeretlen argumentumok: %s" - }, - "Invalid values:": "Érvénytelen érték:", - "Argument: %s, Given: %s, Choices: %s": "Argumentum: %s, Megadott: %s, Lehetőségek: %s", - "Argument check failed: %s": "Argumentum ellenőrzés sikertelen: %s", - "Implications failed:": "Implikációk sikertelenek:", - "Not enough arguments following: %s": "Nem elég argumentum követi: %s", - "Invalid JSON config file: %s": "Érvénytelen JSON konfigurációs file: %s", - "Path to JSON config file": "JSON konfigurációs file helye", - "Show help": "Súgo megjelenítése", - "Show version number": "Verziószám megjelenítése", - "Did you mean %s?": "Erre gondoltál %s?" -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/locales/id.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/locales/id.json deleted file mode 100644 index 125867cb..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/locales/id.json +++ /dev/null @@ -1,50 +0,0 @@ - -{ - "Commands:": "Perintah:", - "Options:": "Pilihan:", - "Examples:": "Contoh:", - "boolean": "boolean", - "count": "jumlah", - "number": "nomor", - "string": "string", - "array": "larik", - "required": "diperlukan", - "default": "bawaan", - "default:": "bawaan:", - "aliases:": "istilah lain:", - "choices:": "pilihan:", - "generated-value": "nilai-yang-dihasilkan", - "Not enough non-option arguments: got %s, need at least %s": { - "one": "Argumen wajib kurang: hanya %s, minimal %s", - "other": "Argumen wajib kurang: hanya %s, minimal %s" - }, - "Too many non-option arguments: got %s, maximum of %s": { - "one": "Terlalu banyak argumen wajib: ada %s, maksimal %s", - "other": "Terlalu banyak argumen wajib: ada %s, maksimal %s" - }, - "Missing argument value: %s": { - "one": "Kurang argumen: %s", - "other": "Kurang argumen: %s" - }, - "Missing required argument: %s": { - "one": "Kurang argumen wajib: %s", - "other": "Kurang argumen wajib: %s" - }, - "Unknown argument: %s": { - "one": "Argumen tak diketahui: %s", - "other": "Argumen tak diketahui: %s" - }, - "Invalid values:": "Nilai-nilai tidak valid:", - "Argument: %s, Given: %s, Choices: %s": "Argumen: %s, Diberikan: %s, Pilihan: %s", - "Argument check failed: %s": "Pemeriksaan argument gagal: %s", - "Implications failed:": "Implikasi gagal:", - "Not enough arguments following: %s": "Kurang argumen untuk: %s", - "Invalid JSON config file: %s": "Berkas konfigurasi JSON tidak valid: %s", - "Path to JSON config file": "Alamat berkas konfigurasi JSON", - "Show help": "Lihat bantuan", - "Show version number": "Lihat nomor versi", - "Did you mean %s?": "Maksud Anda: %s?", - "Arguments %s and %s are mutually exclusive" : "Argumen %s dan %s saling eksklusif", - "Positionals:": "Posisional-posisional:", - "command": "perintah" -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/locales/it.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/locales/it.json deleted file mode 100644 index fde57561..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/locales/it.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "Commands:": "Comandi:", - "Options:": "Opzioni:", - "Examples:": "Esempi:", - "boolean": "booleano", - "count": "contatore", - "string": "stringa", - "number": "numero", - "array": "vettore", - "required": "richiesto", - "default": "predefinito", - "default:": "predefinito:", - "choices:": "scelte:", - "aliases:": "alias:", - "generated-value": "valore generato", - "Not enough non-option arguments: got %s, need at least %s": { - "one": "Numero insufficiente di argomenti non opzione: inseriti %s, richiesti almeno %s", - "other": "Numero insufficiente di argomenti non opzione: inseriti %s, richiesti almeno %s" - }, - "Too many non-option arguments: got %s, maximum of %s": { - "one": "Troppi argomenti non opzione: inseriti %s, massimo possibile %s", - "other": "Troppi argomenti non opzione: inseriti %s, massimo possibile %s" - }, - "Missing argument value: %s": { - "one": "Argomento mancante: %s", - "other": "Argomenti mancanti: %s" - }, - "Missing required argument: %s": { - "one": "Argomento richiesto mancante: %s", - "other": "Argomenti richiesti mancanti: %s" - }, - "Unknown argument: %s": { - "one": "Argomento sconosciuto: %s", - "other": "Argomenti sconosciuti: %s" - }, - "Invalid values:": "Valori non validi:", - "Argument: %s, Given: %s, Choices: %s": "Argomento: %s, Richiesto: %s, Scelte: %s", - "Argument check failed: %s": "Controllo dell'argomento fallito: %s", - "Implications failed:": "Argomenti dipendenti mancanti:", - "Not enough arguments following: %s": "Argomenti insufficienti dopo: %s", - "Invalid JSON config file: %s": "File di configurazione JSON non valido: %s", - "Path to JSON config file": "Percorso del file di configurazione JSON", - "Show help": "Mostra la schermata di aiuto", - "Show version number": "Mostra il numero di versione", - "Did you mean %s?": "Intendi forse %s?" -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/locales/ja.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/locales/ja.json deleted file mode 100644 index 3954ae68..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/locales/ja.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "Commands:": "コマンド:", - "Options:": "オプション:", - "Examples:": "例:", - "boolean": "真偽", - "count": "カウント", - "string": "文字列", - "number": "数値", - "array": "配列", - "required": "必須", - "default": "デフォルト", - "default:": "デフォルト:", - "choices:": "選択してください:", - "aliases:": "エイリアス:", - "generated-value": "生成された値", - "Not enough non-option arguments: got %s, need at least %s": { - "one": "オプションではない引数が %s 個では不足しています。少なくとも %s 個の引数が必要です:", - "other": "オプションではない引数が %s 個では不足しています。少なくとも %s 個の引数が必要です:" - }, - "Too many non-option arguments: got %s, maximum of %s": { - "one": "オプションではない引数が %s 個では多すぎます。最大で %s 個までです:", - "other": "オプションではない引数が %s 個では多すぎます。最大で %s 個までです:" - }, - "Missing argument value: %s": { - "one": "引数の値が見つかりません: %s", - "other": "引数の値が見つかりません: %s" - }, - "Missing required argument: %s": { - "one": "必須の引数が見つかりません: %s", - "other": "必須の引数が見つかりません: %s" - }, - "Unknown argument: %s": { - "one": "未知の引数です: %s", - "other": "未知の引数です: %s" - }, - "Invalid values:": "不正な値です:", - "Argument: %s, Given: %s, Choices: %s": "引数は %s です。与えられた値: %s, 選択してください: %s", - "Argument check failed: %s": "引数のチェックに失敗しました: %s", - "Implications failed:": "オプションの組み合わせで不正が生じました:", - "Not enough arguments following: %s": "次の引数が不足しています。: %s", - "Invalid JSON config file: %s": "JSONの設定ファイルが不正です: %s", - "Path to JSON config file": "JSONの設定ファイルまでのpath", - "Show help": "ヘルプを表示", - "Show version number": "バージョンを表示", - "Did you mean %s?": "もしかして %s?", - "Arguments %s and %s are mutually exclusive" : "引数 %s と %s は同時に指定できません", - "Positionals:": "位置:", - "command": "コマンド", - "deprecated": "非推奨", - "deprecated: %s": "非推奨: %s" -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/locales/ko.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/locales/ko.json deleted file mode 100644 index e3187eaf..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/locales/ko.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "Commands:": "명령:", - "Options:": "옵션:", - "Examples:": "예시:", - "boolean": "여부", - "count": "개수", - "string": "문자열", - "number": "숫자", - "array": "배열", - "required": "필수", - "default": "기본", - "default:": "기본:", - "choices:": "선택:", - "aliases:": "별칭:", - "generated-value": "생성된 값", - "Not enough non-option arguments: got %s, need at least %s": { - "one": "옵션이 아닌 인자가 충분치 않습니다: %s개를 받았지만, 적어도 %s개는 필요합니다", - "other": "옵션이 아닌 인자가 충분치 않습니다: %s개를 받았지만, 적어도 %s개는 필요합니다" - }, - "Too many non-option arguments: got %s, maximum of %s": { - "one": "옵션이 아닌 인자가 너무 많습니다: %s개를 받았지만, %s개 이하여야 합니다", - "other": "옵션이 아닌 인자가 너무 많습니다: %s개를 받았지만, %s개 이하여야 합니다" - }, - "Missing argument value: %s": { - "one": "인자값을 받지 못했습니다: %s", - "other": "인자값들을 받지 못했습니다: %s" - }, - "Missing required argument: %s": { - "one": "필수 인자를 받지 못했습니다: %s", - "other": "필수 인자들을 받지 못했습니다: %s" - }, - "Unknown argument: %s": { - "one": "알 수 없는 인자입니다: %s", - "other": "알 수 없는 인자들입니다: %s" - }, - "Invalid values:": "잘못된 값입니다:", - "Argument: %s, Given: %s, Choices: %s": "인자: %s, 입력받은 값: %s, 선택지: %s", - "Argument check failed: %s": "유효하지 않은 인자입니다: %s", - "Implications failed:": "옵션의 조합이 잘못되었습니다:", - "Not enough arguments following: %s": "인자가 충분하게 주어지지 않았습니다: %s", - "Invalid JSON config file: %s": "유효하지 않은 JSON 설정파일입니다: %s", - "Path to JSON config file": "JSON 설정파일 경로", - "Show help": "도움말을 보여줍니다", - "Show version number": "버전 넘버를 보여줍니다", - "Did you mean %s?": "찾고계신게 %s입니까?", - "Arguments %s and %s are mutually exclusive" : "%s와 %s 인자는 같이 사용될 수 없습니다", - "Positionals:": "위치:", - "command": "명령" -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/locales/nb.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/locales/nb.json deleted file mode 100644 index 6f410ed0..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/locales/nb.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "Commands:": "Kommandoer:", - "Options:": "Alternativer:", - "Examples:": "Eksempler:", - "boolean": "boolsk", - "count": "antall", - "string": "streng", - "number": "nummer", - "array": "matrise", - "required": "obligatorisk", - "default": "standard", - "default:": "standard:", - "choices:": "valg:", - "generated-value": "generert-verdi", - "Not enough non-option arguments: got %s, need at least %s": { - "one": "Ikke nok ikke-alternativ argumenter: fikk %s, trenger minst %s", - "other": "Ikke nok ikke-alternativ argumenter: fikk %s, trenger minst %s" - }, - "Too many non-option arguments: got %s, maximum of %s": { - "one": "For mange ikke-alternativ argumenter: fikk %s, maksimum %s", - "other": "For mange ikke-alternativ argumenter: fikk %s, maksimum %s" - }, - "Missing argument value: %s": { - "one": "Mangler argument verdi: %s", - "other": "Mangler argument verdier: %s" - }, - "Missing required argument: %s": { - "one": "Mangler obligatorisk argument: %s", - "other": "Mangler obligatoriske argumenter: %s" - }, - "Unknown argument: %s": { - "one": "Ukjent argument: %s", - "other": "Ukjente argumenter: %s" - }, - "Invalid values:": "Ugyldige verdier:", - "Argument: %s, Given: %s, Choices: %s": "Argument: %s, Gitt: %s, Valg: %s", - "Argument check failed: %s": "Argumentsjekk mislyktes: %s", - "Implications failed:": "Konsekvensene mislyktes:", - "Not enough arguments following: %s": "Ikke nok følgende argumenter: %s", - "Invalid JSON config file: %s": "Ugyldig JSON konfigurasjonsfil: %s", - "Path to JSON config file": "Bane til JSON konfigurasjonsfil", - "Show help": "Vis hjelp", - "Show version number": "Vis versjonsnummer" -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/locales/nl.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/locales/nl.json deleted file mode 100644 index 9ff95c55..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/locales/nl.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "Commands:": "Commando's:", - "Options:": "Opties:", - "Examples:": "Voorbeelden:", - "boolean": "booleaans", - "count": "aantal", - "string": "string", - "number": "getal", - "array": "lijst", - "required": "verplicht", - "default": "standaard", - "default:": "standaard:", - "choices:": "keuzes:", - "aliases:": "aliassen:", - "generated-value": "gegenereerde waarde", - "Not enough non-option arguments: got %s, need at least %s": { - "one": "Niet genoeg niet-optie-argumenten: %s gekregen, minstens %s nodig", - "other": "Niet genoeg niet-optie-argumenten: %s gekregen, minstens %s nodig" - }, - "Too many non-option arguments: got %s, maximum of %s": { - "one": "Te veel niet-optie-argumenten: %s gekregen, maximum is %s", - "other": "Te veel niet-optie-argumenten: %s gekregen, maximum is %s" - }, - "Missing argument value: %s": { - "one": "Missende argumentwaarde: %s", - "other": "Missende argumentwaarden: %s" - }, - "Missing required argument: %s": { - "one": "Missend verplicht argument: %s", - "other": "Missende verplichte argumenten: %s" - }, - "Unknown argument: %s": { - "one": "Onbekend argument: %s", - "other": "Onbekende argumenten: %s" - }, - "Invalid values:": "Ongeldige waarden:", - "Argument: %s, Given: %s, Choices: %s": "Argument: %s, Gegeven: %s, Keuzes: %s", - "Argument check failed: %s": "Argumentcontrole mislukt: %s", - "Implications failed:": "Ontbrekende afhankelijke argumenten:", - "Not enough arguments following: %s": "Niet genoeg argumenten na: %s", - "Invalid JSON config file: %s": "Ongeldig JSON-config-bestand: %s", - "Path to JSON config file": "Pad naar JSON-config-bestand", - "Show help": "Toon help", - "Show version number": "Toon versienummer", - "Did you mean %s?": "Bedoelde u misschien %s?", - "Arguments %s and %s are mutually exclusive": "Argumenten %s en %s kunnen niet tegelijk gebruikt worden", - "Positionals:": "Positie-afhankelijke argumenten", - "command": "commando" -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/locales/nn.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/locales/nn.json deleted file mode 100644 index 24479ac9..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/locales/nn.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "Commands:": "Kommandoar:", - "Options:": "Alternativ:", - "Examples:": "Døme:", - "boolean": "boolsk", - "count": "mengd", - "string": "streng", - "number": "nummer", - "array": "matrise", - "required": "obligatorisk", - "default": "standard", - "default:": "standard:", - "choices:": "val:", - "generated-value": "generert-verdi", - "Not enough non-option arguments: got %s, need at least %s": { - "one": "Ikkje nok ikkje-alternativ argument: fekk %s, treng minst %s", - "other": "Ikkje nok ikkje-alternativ argument: fekk %s, treng minst %s" - }, - "Too many non-option arguments: got %s, maximum of %s": { - "one": "For mange ikkje-alternativ argument: fekk %s, maksimum %s", - "other": "For mange ikkje-alternativ argument: fekk %s, maksimum %s" - }, - "Missing argument value: %s": { - "one": "Manglar argumentverdi: %s", - "other": "Manglar argumentverdiar: %s" - }, - "Missing required argument: %s": { - "one": "Manglar obligatorisk argument: %s", - "other": "Manglar obligatoriske argument: %s" - }, - "Unknown argument: %s": { - "one": "Ukjent argument: %s", - "other": "Ukjende argument: %s" - }, - "Invalid values:": "Ugyldige verdiar:", - "Argument: %s, Given: %s, Choices: %s": "Argument: %s, Gjeve: %s, Val: %s", - "Argument check failed: %s": "Argumentsjekk mislukkast: %s", - "Implications failed:": "Konsekvensane mislukkast:", - "Not enough arguments following: %s": "Ikkje nok fylgjande argument: %s", - "Invalid JSON config file: %s": "Ugyldig JSON konfigurasjonsfil: %s", - "Path to JSON config file": "Bane til JSON konfigurasjonsfil", - "Show help": "Vis hjelp", - "Show version number": "Vis versjonsnummer" -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/locales/pirate.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/locales/pirate.json deleted file mode 100644 index dcb5cb75..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/locales/pirate.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "Commands:": "Choose yer command:", - "Options:": "Options for me hearties!", - "Examples:": "Ex. marks the spot:", - "required": "requi-yar-ed", - "Missing required argument: %s": { - "one": "Ye be havin' to set the followin' argument land lubber: %s", - "other": "Ye be havin' to set the followin' arguments land lubber: %s" - }, - "Show help": "Parlay this here code of conduct", - "Show version number": "'Tis the version ye be askin' fer", - "Arguments %s and %s are mutually exclusive" : "Yon scurvy dogs %s and %s be as bad as rum and a prudish wench" -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/locales/pl.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/locales/pl.json deleted file mode 100644 index a41d4bd5..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/locales/pl.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "Commands:": "Polecenia:", - "Options:": "Opcje:", - "Examples:": "Przykłady:", - "boolean": "boolean", - "count": "ilość", - "string": "ciąg znaków", - "number": "liczba", - "array": "tablica", - "required": "wymagany", - "default": "domyślny", - "default:": "domyślny:", - "choices:": "dostępne:", - "aliases:": "aliasy:", - "generated-value": "wygenerowana-wartość", - "Not enough non-option arguments: got %s, need at least %s": { - "one": "Niewystarczająca ilość argumentów: otrzymano %s, wymagane co najmniej %s", - "other": "Niewystarczająca ilość argumentów: otrzymano %s, wymagane co najmniej %s" - }, - "Too many non-option arguments: got %s, maximum of %s": { - "one": "Zbyt duża ilość argumentów: otrzymano %s, wymagane co najwyżej %s", - "other": "Zbyt duża ilość argumentów: otrzymano %s, wymagane co najwyżej %s" - }, - "Missing argument value: %s": { - "one": "Brak wartości dla argumentu: %s", - "other": "Brak wartości dla argumentów: %s" - }, - "Missing required argument: %s": { - "one": "Brak wymaganego argumentu: %s", - "other": "Brak wymaganych argumentów: %s" - }, - "Unknown argument: %s": { - "one": "Nieznany argument: %s", - "other": "Nieznane argumenty: %s" - }, - "Invalid values:": "Nieprawidłowe wartości:", - "Argument: %s, Given: %s, Choices: %s": "Argument: %s, Otrzymano: %s, Dostępne: %s", - "Argument check failed: %s": "Weryfikacja argumentów nie powiodła się: %s", - "Implications failed:": "Założenia nie zostały spełnione:", - "Not enough arguments following: %s": "Niewystarczająca ilość argumentów następujących po: %s", - "Invalid JSON config file: %s": "Nieprawidłowy plik konfiguracyjny JSON: %s", - "Path to JSON config file": "Ścieżka do pliku konfiguracyjnego JSON", - "Show help": "Pokaż pomoc", - "Show version number": "Pokaż numer wersji", - "Did you mean %s?": "Czy chodziło Ci o %s?", - "Arguments %s and %s are mutually exclusive": "Argumenty %s i %s wzajemnie się wykluczają", - "Positionals:": "Pozycyjne:", - "command": "polecenie" -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/locales/pt.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/locales/pt.json deleted file mode 100644 index 0c8ac99c..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/locales/pt.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "Commands:": "Comandos:", - "Options:": "Opções:", - "Examples:": "Exemplos:", - "boolean": "boolean", - "count": "contagem", - "string": "cadeia de caracteres", - "number": "número", - "array": "arranjo", - "required": "requerido", - "default": "padrão", - "default:": "padrão:", - "choices:": "escolhas:", - "generated-value": "valor-gerado", - "Not enough non-option arguments: got %s, need at least %s": { - "one": "Argumentos insuficientes não opcionais: Argumento %s, necessário pelo menos %s", - "other": "Argumentos insuficientes não opcionais: Argumento %s, necessário pelo menos %s" - }, - "Too many non-option arguments: got %s, maximum of %s": { - "one": "Excesso de argumentos não opcionais: recebido %s, máximo de %s", - "other": "Excesso de argumentos não opcionais: recebido %s, máximo de %s" - }, - "Missing argument value: %s": { - "one": "Falta valor de argumento: %s", - "other": "Falta valores de argumento: %s" - }, - "Missing required argument: %s": { - "one": "Falta argumento obrigatório: %s", - "other": "Faltando argumentos obrigatórios: %s" - }, - "Unknown argument: %s": { - "one": "Argumento desconhecido: %s", - "other": "Argumentos desconhecidos: %s" - }, - "Invalid values:": "Valores inválidos:", - "Argument: %s, Given: %s, Choices: %s": "Argumento: %s, Dado: %s, Escolhas: %s", - "Argument check failed: %s": "Verificação de argumento falhou: %s", - "Implications failed:": "Implicações falharam:", - "Not enough arguments following: %s": "Insuficientes argumentos a seguir: %s", - "Invalid JSON config file: %s": "Arquivo de configuração em JSON esta inválido: %s", - "Path to JSON config file": "Caminho para o arquivo de configuração em JSON", - "Show help": "Mostra ajuda", - "Show version number": "Mostra número de versão", - "Arguments %s and %s are mutually exclusive" : "Argumentos %s e %s são mutualmente exclusivos" -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/locales/pt_BR.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/locales/pt_BR.json deleted file mode 100644 index eae1ec60..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/locales/pt_BR.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "Commands:": "Comandos:", - "Options:": "Opções:", - "Examples:": "Exemplos:", - "boolean": "booleano", - "count": "contagem", - "string": "string", - "number": "número", - "array": "array", - "required": "obrigatório", - "default:": "padrão:", - "choices:": "opções:", - "aliases:": "sinônimos:", - "generated-value": "valor-gerado", - "Not enough non-option arguments: got %s, need at least %s": { - "one": "Argumentos insuficientes: Argumento %s, necessário pelo menos %s", - "other": "Argumentos insuficientes: Argumento %s, necessário pelo menos %s" - }, - "Too many non-option arguments: got %s, maximum of %s": { - "one": "Excesso de argumentos: recebido %s, máximo de %s", - "other": "Excesso de argumentos: recebido %s, máximo de %s" - }, - "Missing argument value: %s": { - "one": "Falta valor de argumento: %s", - "other": "Falta valores de argumento: %s" - }, - "Missing required argument: %s": { - "one": "Falta argumento obrigatório: %s", - "other": "Faltando argumentos obrigatórios: %s" - }, - "Unknown argument: %s": { - "one": "Argumento desconhecido: %s", - "other": "Argumentos desconhecidos: %s" - }, - "Invalid values:": "Valores inválidos:", - "Argument: %s, Given: %s, Choices: %s": "Argumento: %s, Dado: %s, Opções: %s", - "Argument check failed: %s": "Verificação de argumento falhou: %s", - "Implications failed:": "Implicações falharam:", - "Not enough arguments following: %s": "Argumentos insuficientes a seguir: %s", - "Invalid JSON config file: %s": "Arquivo JSON de configuração inválido: %s", - "Path to JSON config file": "Caminho para o arquivo JSON de configuração", - "Show help": "Exibe ajuda", - "Show version number": "Exibe a versão", - "Did you mean %s?": "Você quis dizer %s?", - "Arguments %s and %s are mutually exclusive" : "Argumentos %s e %s são mutualmente exclusivos", - "Positionals:": "Posicionais:", - "command": "comando" -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/locales/ru.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/locales/ru.json deleted file mode 100644 index 5f7f7681..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/locales/ru.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "Commands:": "Команды:", - "Options:": "Опции:", - "Examples:": "Примеры:", - "boolean": "булевый тип", - "count": "подсчет", - "string": "строковой тип", - "number": "число", - "array": "массив", - "required": "необходимо", - "default": "по умолчанию", - "default:": "по умолчанию:", - "choices:": "возможности:", - "aliases:": "алиасы:", - "generated-value": "генерированное значение", - "Not enough non-option arguments: got %s, need at least %s": { - "one": "Недостаточно неопционных аргументов: есть %s, нужно как минимум %s", - "other": "Недостаточно неопционных аргументов: есть %s, нужно как минимум %s" - }, - "Too many non-option arguments: got %s, maximum of %s": { - "one": "Слишком много неопционных аргументов: есть %s, максимум допустимо %s", - "other": "Слишком много неопционных аргументов: есть %s, максимум допустимо %s" - }, - "Missing argument value: %s": { - "one": "Не хватает значения аргумента: %s", - "other": "Не хватает значений аргументов: %s" - }, - "Missing required argument: %s": { - "one": "Не хватает необходимого аргумента: %s", - "other": "Не хватает необходимых аргументов: %s" - }, - "Unknown argument: %s": { - "one": "Неизвестный аргумент: %s", - "other": "Неизвестные аргументы: %s" - }, - "Invalid values:": "Недействительные значения:", - "Argument: %s, Given: %s, Choices: %s": "Аргумент: %s, Данное значение: %s, Возможности: %s", - "Argument check failed: %s": "Проверка аргументов не удалась: %s", - "Implications failed:": "Данный аргумент требует следующий дополнительный аргумент:", - "Not enough arguments following: %s": "Недостаточно следующих аргументов: %s", - "Invalid JSON config file: %s": "Недействительный файл конфигурации JSON: %s", - "Path to JSON config file": "Путь к файлу конфигурации JSON", - "Show help": "Показать помощь", - "Show version number": "Показать номер версии", - "Did you mean %s?": "Вы имели в виду %s?" -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/locales/th.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/locales/th.json deleted file mode 100644 index 33b048e2..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/locales/th.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "Commands:": "คอมมาน", - "Options:": "ออฟชั่น", - "Examples:": "ตัวอย่าง", - "boolean": "บูลีน", - "count": "นับ", - "string": "สตริง", - "number": "ตัวเลข", - "array": "อาเรย์", - "required": "จำเป็น", - "default": "ค่าเริ่มต้", - "default:": "ค่าเริ่มต้น", - "choices:": "ตัวเลือก", - "aliases:": "เอเลียส", - "generated-value": "ค่าที่ถูกสร้างขึ้น", - "Not enough non-option arguments: got %s, need at least %s": { - "one": "ใส่อาร์กิวเมนต์ไม่ครบตามจำนวนที่กำหนด: ใส่ค่ามาจำนวน %s ค่า, แต่ต้องการอย่างน้อย %s ค่า", - "other": "ใส่อาร์กิวเมนต์ไม่ครบตามจำนวนที่กำหนด: ใส่ค่ามาจำนวน %s ค่า, แต่ต้องการอย่างน้อย %s ค่า" - }, - "Too many non-option arguments: got %s, maximum of %s": { - "one": "ใส่อาร์กิวเมนต์เกินจำนวนที่กำหนด: ใส่ค่ามาจำนวน %s ค่า, แต่ต้องการมากที่สุด %s ค่า", - "other": "ใส่อาร์กิวเมนต์เกินจำนวนที่กำหนด: ใส่ค่ามาจำนวน %s ค่า, แต่ต้องการมากที่สุด %s ค่า" - }, - "Missing argument value: %s": { - "one": "ค่าอาร์กิวเมนต์ที่ขาดไป: %s", - "other": "ค่าอาร์กิวเมนต์ที่ขาดไป: %s" - }, - "Missing required argument: %s": { - "one": "อาร์กิวเมนต์จำเป็นที่ขาดไป: %s", - "other": "อาร์กิวเมนต์จำเป็นที่ขาดไป: %s" - }, - "Unknown argument: %s": { - "one": "อาร์กิวเมนต์ที่ไม่รู้จัก: %s", - "other": "อาร์กิวเมนต์ที่ไม่รู้จัก: %s" - }, - "Invalid values:": "ค่าไม่ถูกต้อง:", - "Argument: %s, Given: %s, Choices: %s": "อาร์กิวเมนต์: %s, ได้รับ: %s, ตัวเลือก: %s", - "Argument check failed: %s": "ตรวจสอบพบอาร์กิวเมนต์ที่ไม่ถูกต้อง: %s", - "Implications failed:": "Implications ไม่สำเร็จ:", - "Not enough arguments following: %s": "ใส่อาร์กิวเมนต์ไม่ครบ: %s", - "Invalid JSON config file: %s": "ไฟล์คอนฟิค JSON ไม่ถูกต้อง: %s", - "Path to JSON config file": "พาทไฟล์คอนฟิค JSON", - "Show help": "ขอความช่วยเหลือ", - "Show version number": "แสดงตัวเลขเวอร์ชั่น", - "Did you mean %s?": "คุณหมายถึง %s?" -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/locales/tr.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/locales/tr.json deleted file mode 100644 index 0d0d2ccd..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/locales/tr.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "Commands:": "Komutlar:", - "Options:": "Seçenekler:", - "Examples:": "Örnekler:", - "boolean": "boolean", - "count": "sayı", - "string": "string", - "number": "numara", - "array": "array", - "required": "zorunlu", - "default": "varsayılan", - "default:": "varsayılan:", - "choices:": "seçimler:", - "aliases:": "takma adlar:", - "generated-value": "oluşturulan-değer", - "Not enough non-option arguments: got %s, need at least %s": { - "one": "Seçenek dışı argümanlar yetersiz: %s bulundu, %s gerekli", - "other": "Seçenek dışı argümanlar yetersiz: %s bulundu, %s gerekli" - }, - "Too many non-option arguments: got %s, maximum of %s": { - "one": "Seçenek dışı argümanlar gereğinden fazla: %s bulundu, azami %s", - "other": "Seçenek dışı argümanlar gereğinden fazla: %s bulundu, azami %s" - }, - "Missing argument value: %s": { - "one": "Eksik argüman değeri: %s", - "other": "Eksik argüman değerleri: %s" - }, - "Missing required argument: %s": { - "one": "Eksik zorunlu argüman: %s", - "other": "Eksik zorunlu argümanlar: %s" - }, - "Unknown argument: %s": { - "one": "Bilinmeyen argüman: %s", - "other": "Bilinmeyen argümanlar: %s" - }, - "Invalid values:": "Geçersiz değerler:", - "Argument: %s, Given: %s, Choices: %s": "Argüman: %s, Verilen: %s, Seçimler: %s", - "Argument check failed: %s": "Argüman kontrolü başarısız oldu: %s", - "Implications failed:": "Sonuçlar başarısız oldu:", - "Not enough arguments following: %s": "%s için yeterli argüman bulunamadı", - "Invalid JSON config file: %s": "Geçersiz JSON yapılandırma dosyası: %s", - "Path to JSON config file": "JSON yapılandırma dosya konumu", - "Show help": "Yardım detaylarını göster", - "Show version number": "Versiyon detaylarını göster", - "Did you mean %s?": "Bunu mu demek istediniz: %s?", - "Positionals:": "Sıralılar:", - "command": "komut" -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/locales/zh_CN.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/locales/zh_CN.json deleted file mode 100644 index 257d26ba..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/locales/zh_CN.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "Commands:": "命令:", - "Options:": "选项:", - "Examples:": "示例:", - "boolean": "布尔", - "count": "计数", - "string": "字符串", - "number": "数字", - "array": "数组", - "required": "必需", - "default": "默认值", - "default:": "默认值:", - "choices:": "可选值:", - "generated-value": "生成的值", - "Not enough non-option arguments: got %s, need at least %s": { - "one": "缺少 non-option 参数:传入了 %s 个, 至少需要 %s 个", - "other": "缺少 non-option 参数:传入了 %s 个, 至少需要 %s 个" - }, - "Too many non-option arguments: got %s, maximum of %s": { - "one": "non-option 参数过多:传入了 %s 个, 最大允许 %s 个", - "other": "non-option 参数过多:传入了 %s 个, 最大允许 %s 个" - }, - "Missing argument value: %s": { - "one": "没有给此选项指定值:%s", - "other": "没有给这些选项指定值:%s" - }, - "Missing required argument: %s": { - "one": "缺少必须的选项:%s", - "other": "缺少这些必须的选项:%s" - }, - "Unknown argument: %s": { - "one": "无法识别的选项:%s", - "other": "无法识别这些选项:%s" - }, - "Invalid values:": "无效的选项值:", - "Argument: %s, Given: %s, Choices: %s": "选项名称: %s, 传入的值: %s, 可选的值:%s", - "Argument check failed: %s": "选项值验证失败:%s", - "Implications failed:": "缺少依赖的选项:", - "Not enough arguments following: %s": "没有提供足够的值给此选项:%s", - "Invalid JSON config file: %s": "无效的 JSON 配置文件:%s", - "Path to JSON config file": "JSON 配置文件的路径", - "Show help": "显示帮助信息", - "Show version number": "显示版本号", - "Did you mean %s?": "是指 %s?", - "Arguments %s and %s are mutually exclusive" : "选项 %s 和 %s 是互斥的", - "Positionals:": "位置:", - "command": "命令" -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/locales/zh_TW.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/locales/zh_TW.json deleted file mode 100644 index e3c7bcf4..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/locales/zh_TW.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "Commands:": "命令:", - "Options:": "選項:", - "Examples:": "例:", - "boolean": "布林", - "count": "次數", - "string": "字串", - "number": "數字", - "array": "陣列", - "required": "必須", - "default": "預設值", - "default:": "預設值:", - "choices:": "可選值:", - "aliases:": "別名:", - "generated-value": "生成的值", - "Not enough non-option arguments: got %s, need at least %s": { - "one": "non-option 引數不足:只傳入了 %s 個, 至少要 %s 個", - "other": "non-option 引數不足:只傳入了 %s 個, 至少要 %s 個" - }, - "Too many non-option arguments: got %s, maximum of %s": { - "one": "non-option 引數過多:傳入了 %s 個, 但最多 %s 個", - "other": "non-option 引數過多:傳入了 %s 個, 但最多 %s 個" - }, - "Missing argument value: %s": { - "one": "此引數無指定值:%s", - "other": "這些引數無指定值:%s" - }, - "Missing required argument: %s": { - "one": "缺少必須的引數:%s", - "other": "缺少這些必須的引數:%s" - }, - "Unknown argument: %s": { - "one": "未知的引數:%s", - "other": "未知的這些引數:%s" - }, - "Invalid values:": "無效的選項值:", - "Argument: %s, Given: %s, Choices: %s": "引數名稱: %s, 傳入的值: %s, 可選的值:%s", - "Argument check failed: %s": "引數驗證失敗:%s", - "Implications failed:": "缺少依賴的選項:", - "Not enough arguments following: %s": "沒有提供足夠的值給此引數:%s", - "Invalid JSON config file: %s": "無效的 JSON 設置文件:%s", - "Path to JSON config file": "JSON 設置文件的路徑", - "Show help": "顯示說明", - "Show version number": "顯示版本", - "Did you mean %s?": "是指 %s?", - "Arguments %s and %s are mutually exclusive" : "引數 %s 和 %s 是互斥的" -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/package.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/package.json deleted file mode 100644 index 428ead29..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/package.json +++ /dev/null @@ -1,122 +0,0 @@ -{ - "name": "yargs", - "version": "16.2.0", - "description": "yargs the modern, pirate-themed, successor to optimist.", - "main": "./index.cjs", - "exports": { - "./package.json": "./package.json", - ".": [ - { - "import": "./index.mjs", - "require": "./index.cjs" - }, - "./index.cjs" - ], - "./helpers": { - "import": "./helpers/helpers.mjs", - "require": "./helpers/index.js" - }, - "./yargs": [ - { - "require": "./yargs" - }, - "./yargs" - ] - }, - "type": "module", - "module": "./index.mjs", - "contributors": [ - { - "name": "Yargs Contributors", - "url": "https://github.com/yargs/yargs/graphs/contributors" - } - ], - "files": [ - "browser.mjs", - "index.cjs", - "helpers/*.js", - "helpers/*", - "index.mjs", - "yargs", - "build", - "locales", - "LICENSE", - "lib/platform-shims/*.mjs", - "!*.d.ts" - ], - "dependencies": { - "cliui": "^7.0.2", - "escalade": "^3.1.1", - "get-caller-file": "^2.0.5", - "require-directory": "^2.1.1", - "string-width": "^4.2.0", - "y18n": "^5.0.5", - "yargs-parser": "^20.2.2" - }, - "devDependencies": { - "@types/chai": "^4.2.11", - "@types/mocha": "^8.0.0", - "@types/node": "^14.11.2", - "@wessberg/rollup-plugin-ts": "^1.3.2", - "c8": "^7.0.0", - "chai": "^4.2.0", - "chalk": "^4.0.0", - "coveralls": "^3.0.9", - "cpr": "^3.0.1", - "cross-env": "^7.0.2", - "cross-spawn": "^7.0.0", - "gts": "^3.0.0", - "hashish": "0.0.4", - "mocha": "^8.0.0", - "rimraf": "^3.0.2", - "rollup": "^2.23.0", - "rollup-plugin-cleanup": "^3.1.1", - "standardx": "^5.0.0", - "typescript": "^4.0.2", - "which": "^2.0.0", - "yargs-test-extends": "^1.0.1" - }, - "scripts": { - "fix": "gts fix && npm run fix:js", - "fix:js": "standardx --fix '**/*.mjs' && standardx --fix '**/*.cjs' && standardx --fix './*.mjs' && standardx --fix './*.cjs'", - "posttest": "npm run check", - "test": "c8 mocha ./test/*.cjs --require ./test/before.cjs --timeout=12000 --check-leaks", - "test:esm": "c8 mocha ./test/esm/*.mjs --check-leaks", - "coverage": "c8 report --check-coverage", - "prepare": "npm run compile", - "pretest": "npm run compile -- -p tsconfig.test.json && cross-env NODE_ENV=test npm run build:cjs", - "compile": "rimraf build && tsc", - "postcompile": "npm run build:cjs", - "build:cjs": "rollup -c rollup.config.cjs", - "postbuild:cjs": "rimraf ./build/index.cjs.d.ts", - "check": "gts lint && npm run check:js", - "check:js": "standardx '**/*.mjs' && standardx '**/*.cjs' && standardx './*.mjs' && standardx './*.cjs'", - "clean": "gts clean" - }, - "repository": { - "type": "git", - "url": "https://github.com/yargs/yargs.git" - }, - "homepage": "https://yargs.js.org/", - "standardx": { - "ignore": [ - "build", - "helpers", - "**/example/**", - "**/platform-shims/esm.mjs" - ] - }, - "keywords": [ - "argument", - "args", - "option", - "parser", - "parsing", - "cli", - "command" - ], - "license": "MIT", - "engines": { - "node": ">=10" - } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/yargs b/packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/yargs deleted file mode 100644 index 8460d10a..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/yargs/yargs +++ /dev/null @@ -1,9 +0,0 @@ -// TODO: consolidate on using a helpers file at some point in the future, which -// is the approach currently used to export Parser and applyExtends for ESM: -const {applyExtends, cjsPlatformShim, Parser, Yargs, processArgv} = require('./build/index.cjs') -Yargs.applyExtends = (config, cwd, mergeExtends) => { - return applyExtends(config, cwd, mergeExtends, cjsPlatformShim) -} -Yargs.hideBin = processArgv.hideBin -Yargs.Parser = Parser -module.exports = Yargs diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/yocto-queue/index.d.ts b/packages/wyatt_notification_bloc/example/scripts/node_modules/yocto-queue/index.d.ts deleted file mode 100644 index 9541986b..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/yocto-queue/index.d.ts +++ /dev/null @@ -1,56 +0,0 @@ -declare class Queue implements Iterable { - /** - The size of the queue. - */ - readonly size: number; - - /** - Tiny queue data structure. - - The instance is an [`Iterable`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols), which means you can iterate over the queue front to back with a “for…of” loop, or use spreading to convert the queue to an array. Don't do this unless you really need to though, since it's slow. - - @example - ``` - import Queue = require('yocto-queue'); - - const queue = new Queue(); - - queue.enqueue('🦄'); - queue.enqueue('🌈'); - - console.log(queue.size); - //=> 2 - - console.log(...queue); - //=> '🦄 🌈' - - console.log(queue.dequeue()); - //=> '🦄' - - console.log(queue.dequeue()); - //=> '🌈' - ``` - */ - constructor(); - - [Symbol.iterator](): IterableIterator; - - /** - Add a value to the queue. - */ - enqueue(value: ValueType): void; - - /** - Remove the next value in the queue. - - @returns The removed value or `undefined` if the queue is empty. - */ - dequeue(): ValueType | undefined; - - /** - Clear the queue. - */ - clear(): void; -} - -export = Queue; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/yocto-queue/index.js b/packages/wyatt_notification_bloc/example/scripts/node_modules/yocto-queue/index.js deleted file mode 100644 index 2f3e6dcd..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/yocto-queue/index.js +++ /dev/null @@ -1,68 +0,0 @@ -class Node { - /// value; - /// next; - - constructor(value) { - this.value = value; - - // TODO: Remove this when targeting Node.js 12. - this.next = undefined; - } -} - -class Queue { - // TODO: Use private class fields when targeting Node.js 12. - // #_head; - // #_tail; - // #_size; - - constructor() { - this.clear(); - } - - enqueue(value) { - const node = new Node(value); - - if (this._head) { - this._tail.next = node; - this._tail = node; - } else { - this._head = node; - this._tail = node; - } - - this._size++; - } - - dequeue() { - const current = this._head; - if (!current) { - return; - } - - this._head = this._head.next; - this._size--; - return current.value; - } - - clear() { - this._head = undefined; - this._tail = undefined; - this._size = 0; - } - - get size() { - return this._size; - } - - * [Symbol.iterator]() { - let current = this._head; - - while (current) { - yield current.value; - current = current.next; - } - } -} - -module.exports = Queue; diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/yocto-queue/license b/packages/wyatt_notification_bloc/example/scripts/node_modules/yocto-queue/license deleted file mode 100644 index fa7ceba3..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/yocto-queue/license +++ /dev/null @@ -1,9 +0,0 @@ -MIT License - -Copyright (c) Sindre Sorhus (https://sindresorhus.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/yocto-queue/package.json b/packages/wyatt_notification_bloc/example/scripts/node_modules/yocto-queue/package.json deleted file mode 100644 index 71a91017..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/yocto-queue/package.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "name": "yocto-queue", - "version": "0.1.0", - "description": "Tiny queue data structure", - "license": "MIT", - "repository": "sindresorhus/yocto-queue", - "funding": "https://github.com/sponsors/sindresorhus", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "https://sindresorhus.com" - }, - "engines": { - "node": ">=10" - }, - "scripts": { - "test": "xo && ava && tsd" - }, - "files": [ - "index.js", - "index.d.ts" - ], - "keywords": [ - "queue", - "data", - "structure", - "algorithm", - "queues", - "queuing", - "list", - "array", - "linkedlist", - "fifo", - "enqueue", - "dequeue", - "data-structure" - ], - "devDependencies": { - "ava": "^2.4.0", - "tsd": "^0.13.1", - "xo": "^0.35.0" - } -} diff --git a/packages/wyatt_notification_bloc/example/scripts/node_modules/yocto-queue/readme.md b/packages/wyatt_notification_bloc/example/scripts/node_modules/yocto-queue/readme.md deleted file mode 100644 index c72fefc4..00000000 --- a/packages/wyatt_notification_bloc/example/scripts/node_modules/yocto-queue/readme.md +++ /dev/null @@ -1,64 +0,0 @@ -# yocto-queue [![](https://badgen.net/bundlephobia/minzip/yocto-queue)](https://bundlephobia.com/result?p=yocto-queue) - -> Tiny queue data structure - -You should use this package instead of an array if you do a lot of `Array#push()` and `Array#shift()` on large arrays, since `Array#shift()` has [linear time complexity](https://medium.com/@ariel.salem1989/an-easy-to-use-guide-to-big-o-time-complexity-5dcf4be8a444#:~:text=O(N)%E2%80%94Linear%20Time) *O(n)* while `Queue#dequeue()` has [constant time complexity](https://medium.com/@ariel.salem1989/an-easy-to-use-guide-to-big-o-time-complexity-5dcf4be8a444#:~:text=O(1)%20%E2%80%94%20Constant%20Time) *O(1)*. That makes a huge difference for large arrays. - -> A [queue](https://en.wikipedia.org/wiki/Queue_(abstract_data_type)) is an ordered list of elements where an element is inserted at the end of the queue and is removed from the front of the queue. A queue works based on the first-in, first-out ([FIFO](https://en.wikipedia.org/wiki/FIFO_(computing_and_electronics))) principle. - -## Install - -``` -$ npm install yocto-queue -``` - -## Usage - -```js -const Queue = require('yocto-queue'); - -const queue = new Queue(); - -queue.enqueue('🦄'); -queue.enqueue('🌈'); - -console.log(queue.size); -//=> 2 - -console.log(...queue); -//=> '🦄 🌈' - -console.log(queue.dequeue()); -//=> '🦄' - -console.log(queue.dequeue()); -//=> '🌈' -``` - -## API - -### `queue = new Queue()` - -The instance is an [`Iterable`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols), which means you can iterate over the queue front to back with a “for…of” loop, or use spreading to convert the queue to an array. Don't do this unless you really need to though, since it's slow. - -#### `.enqueue(value)` - -Add a value to the queue. - -#### `.dequeue()` - -Remove the next value in the queue. - -Returns the removed value or `undefined` if the queue is empty. - -#### `.clear()` - -Clear the queue. - -#### `.size` - -The size of the queue. - -## Related - -- [quick-lru](https://github.com/sindresorhus/quick-lru) - Simple “Least Recently Used” (LRU) cache